From: Andrea Bianco Date: Sun, 17 May 2020 12:31:31 +0000 (+0200) Subject: Built motion from commit (unavailable).|2.4.17 X-Git-Url: http://repos.xcallymotion.com/?a=commitdiff_plain;h=6887e58b9541ceb2a98db769561123a9e693795f;p=motion2.git Built motion from commit (unavailable).|2.4.17 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index ed26e3f..0d4db51 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2020-05-17T09:03:52.270Z", + "time": "2020-05-17T12:17:59.425Z", "url": "http://apidocjs.com", "version": "0.20.1" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index d2322f6..9df4a73 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2020-05-17T09:03:52.270Z", + "time": "2020-05-17T12:17:59.425Z", "url": "http://apidocjs.com", "version": "0.20.1" } diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index 8c06181..0cb1dcc 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 _0xbd4c=['integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','TEXT','exports','STRING','integration','jscripty','browser','bot','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)]'];(function(_0x44474f,_0x431580){var _0x427d97=function(_0x53f7d4){while(--_0x53f7d4){_0x44474f['push'](_0x44474f['shift']());}};_0x427d97(++_0x431580);}(_0xbd4c,0xca));var _0xcbd4=function(_0x46140b,_0x15c5e0){_0x46140b=_0x46140b-0x0;var _0xfccdb0=_0xbd4c[_0x46140b];return _0xfccdb0;};'use strict';var Sequelize=require('sequelize');module[_0xcbd4('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x306b82){return this['getDataValue']('action');}},'action':{'type':Sequelize[_0xcbd4('0x1')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0xcbd4('0x2'),'motionbar',_0xcbd4('0x3'),'urlForward',_0xcbd4('0x4'),_0xcbd4('0x5'),'script']],'msg':_0xcbd4('0x6')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0xcbd4('0x1')](0x1000),'comment':_0xcbd4('0x7')},'data2':{'type':Sequelize[_0xcbd4('0x1')](0x1000),'comment':_0xcbd4('0x8')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':'motionbar[NULL,NULL,WinAppArguments]'},'data4':{'type':Sequelize[_0xcbd4('0x1')](0x1000)},'data5':{'type':Sequelize['STRING'](0x1000)},'data6':{'type':Sequelize['STRING']},'data7':{'type':Sequelize[_0xcbd4('0x9')]}}; \ No newline at end of file +var _0x481c=['bot','script','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]','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize','exports','VIRTUAL','getDataValue','STRING','contactManager','integration','jscripty','browser'];(function(_0x190dde,_0x5bb90f){var _0x2a3638=function(_0x242516){while(--_0x242516){_0x190dde['push'](_0x190dde['shift']());}};_0x2a3638(++_0x5bb90f);}(_0x481c,0x197));var _0xc481=function(_0x11b61e,_0x1e25c2){_0x11b61e=_0x11b61e-0x0;var _0x23a8fa=_0x481c[_0x11b61e];return _0x23a8fa;};'use strict';var Sequelize=require(_0xc481('0x0'));module[_0xc481('0x1')]={'name':{'type':Sequelize[_0xc481('0x2')],'get':function(_0x27ce94){return this[_0xc481('0x3')]('action');}},'action':{'type':Sequelize[_0xc481('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0xc481('0x5'),_0xc481('0x6'),'motionbar',_0xc481('0x7'),'urlForward',_0xc481('0x8'),_0xc481('0x9'),_0xc481('0xa')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xc481('0xb')},'data1':{'type':Sequelize[_0xc481('0x4')](0x1000),'comment':_0xc481('0xc')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0xc481('0xd')},'data3':{'type':Sequelize[_0xc481('0x4')](0x1000),'comment':_0xc481('0xe')},'data4':{'type':Sequelize[_0xc481('0x4')](0x1000)},'data5':{'type':Sequelize[_0xc481('0x4')](0x1000)},'data6':{'type':Sequelize[_0xc481('0x4')]},'data7':{'type':Sequelize[_0xc481('0xf')]}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index a64dd4e..52aa58e 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 _0xfa4c=['mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','body','Action','catch','find','params','html-pdf','eml-format','zip-dir','moment'];(function(_0x120012,_0x16dd6b){var _0x4d9832=function(_0x3af7c9){while(--_0x3af7c9){_0x120012['push'](_0x120012['shift']());}};_0x4d9832(++_0x16dd6b);}(_0xfa4c,0x1e0));var _0xcfa4=function(_0x76c02d,_0x56edfa){_0x76c02d=_0x76c02d-0x0;var _0x43acda=_0xfa4c[_0x76c02d];return _0x43acda;};'use strict';var pdf=require(_0xcfa4('0x0'));var emlformat=require(_0xcfa4('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xcfa4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xcfa4('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xcfa4('0x4'));var util=require('util');var path=require(_0xcfa4('0x5'));var sox=require(_0xcfa4('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xcfa4('0x7'));var squel=require(_0xcfa4('0x8'));var crypto=require(_0xcfa4('0x9'));var jsforce=require(_0xcfa4('0xa'));var deskjs=require(_0xcfa4('0xb'));var toCsv=require(_0xcfa4('0xc'));var querystring=require(_0xcfa4('0xd'));var Papa=require('papaparse');var Redis=require(_0xcfa4('0xe'));var authService=require(_0xcfa4('0xf'));var qs=require(_0xcfa4('0x10'));var as=require(_0xcfa4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcfa4('0x12'))(_0xcfa4('0x13'));var utils=require('../../config/utils');var config=require(_0xcfa4('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e5643,_0x460774){_0x460774=_0x460774||0xcc;return function(_0x3c98b1){if(_0x3c98b1){return _0x4e5643[_0xcfa4('0x15')](_0x460774);}return _0x4e5643['status'](_0x460774)[_0xcfa4('0x16')]();};}function respondWithResult(_0x385903,_0x3b415f){_0x3b415f=_0x3b415f||0xc8;return function(_0x1aeced){if(_0x1aeced){return _0x385903[_0xcfa4('0x17')](_0x3b415f)[_0xcfa4('0x18')](_0x1aeced);}};}function respondWithFilteredResult(_0x3c2c7d,_0x19e707){return function(_0xb8ada9){if(_0xb8ada9){var _0x26d7a7=_0xb8ada9[_0xcfa4('0x19')],_0x5dfd87=_0x19e707[_0xcfa4('0x1a')],_0x4c454a=_0x19e707[_0xcfa4('0x1a')]+_0x19e707[_0xcfa4('0x1b')],_0x2270ce;if(_0x4c454a>=_0x26d7a7){_0x4c454a=_0x26d7a7;_0x2270ce=0xc8;}else{_0x2270ce=0xce;}_0x3c2c7d[_0xcfa4('0x17')](_0x2270ce);return _0x3c2c7d[_0xcfa4('0x1c')](_0xcfa4('0x1d'),_0x5dfd87+'-'+_0x4c454a+'/'+_0x26d7a7)[_0xcfa4('0x18')](_0xb8ada9);}return null;};}function patchUpdates(_0x39fc57){return function(_0x10644c){try{jsonpatch[_0xcfa4('0x1e')](_0x10644c,_0x39fc57,!![]);}catch(_0x1bf046){return BPromise[_0xcfa4('0x1f')](_0x1bf046);}return _0x10644c[_0xcfa4('0x20')]();};}function saveUpdates(_0x20c1f2,_0x5e886f){return function(_0x254401){if(_0x254401){return _0x254401[_0xcfa4('0x21')](_0x20c1f2)[_0xcfa4('0x22')](function(_0x4194cc){return _0x4194cc;});}return null;};}function removeEntity(_0x5d45bf,_0x3bc339){return function(_0x48d10b){if(_0x48d10b){return _0x48d10b[_0xcfa4('0x23')]()[_0xcfa4('0x22')](function(){_0x5d45bf[_0xcfa4('0x17')](0xcc)[_0xcfa4('0x16')]();});}};}function handleEntityNotFound(_0x5c46db,_0x552a50){return function(_0x37c1f5){if(!_0x37c1f5){_0x5c46db[_0xcfa4('0x15')](0x194);}return _0x37c1f5;};}function handleError(_0x209392,_0x615464){_0x615464=_0x615464||0x1f4;return function(_0x3e5c6a){logger[_0xcfa4('0x24')](_0x3e5c6a['stack']);if(_0x3e5c6a[_0xcfa4('0x25')]){delete _0x3e5c6a[_0xcfa4('0x25')];}_0x209392[_0xcfa4('0x17')](_0x615464)[_0xcfa4('0x26')](_0x3e5c6a);};}exports[_0xcfa4('0x21')]=function(_0x5162cb,_0x17bd7b){if(_0x5162cb['body']['id']){delete _0x5162cb[_0xcfa4('0x27')]['id'];}return db[_0xcfa4('0x28')]['find']({'where':{'id':_0x5162cb['params']['id']}})[_0xcfa4('0x22')](handleEntityNotFound(_0x17bd7b,null))['then'](saveUpdates(_0x5162cb[_0xcfa4('0x27')],null))['then'](respondWithResult(_0x17bd7b,null))[_0xcfa4('0x29')](handleError(_0x17bd7b,null));};exports['destroy']=function(_0x4a4a7e,_0x42db7b){return db[_0xcfa4('0x28')][_0xcfa4('0x2a')]({'where':{'id':_0x4a4a7e[_0xcfa4('0x2b')]['id']}})['then'](handleEntityNotFound(_0x42db7b,null))[_0xcfa4('0x22')](removeEntity(_0x42db7b,null))[_0xcfa4('0x29')](handleError(_0x42db7b,null));}; \ No newline at end of file +var _0xa114=['sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','destroy','then','name','send','update','body','Action','find','params','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x27c021,_0x190f72){var _0x1d0700=function(_0x8b02b4){while(--_0x8b02b4){_0x27c021['push'](_0x27c021['shift']());}};_0x1d0700(++_0x190f72);}(_0xa114,0xa3));var _0x4a11=function(_0x525af9,_0x4edd23){_0x525af9=_0x525af9-0x0;var _0x129fbf=_0xa114[_0x525af9];return _0x129fbf;};'use strict';var pdf=require(_0x4a11('0x0'));var emlformat=require(_0x4a11('0x1'));var rimraf=require(_0x4a11('0x2'));var zipdir=require(_0x4a11('0x3'));var jsonpatch=require(_0x4a11('0x4'));var rp=require(_0x4a11('0x5'));var moment=require(_0x4a11('0x6'));var BPromise=require(_0x4a11('0x7'));var Mustache=require(_0x4a11('0x8'));var util=require('util');var path=require('path');var sox=require(_0x4a11('0x9'));var csv=require(_0x4a11('0xa'));var ejs=require(_0x4a11('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4a11('0xc'));var crypto=require(_0x4a11('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4a11('0xe'));var toCsv=require(_0x4a11('0xa'));var querystring=require(_0x4a11('0xf'));var Papa=require(_0x4a11('0x10'));var Redis=require('ioredis');var authService=require(_0x4a11('0x11'));var qs=require(_0x4a11('0x12'));var as=require(_0x4a11('0x13'));var hardwareService=require(_0x4a11('0x14'));var logger=require(_0x4a11('0x15'))('api');var utils=require(_0x4a11('0x16'));var config=require(_0x4a11('0x17'));var db=require(_0x4a11('0x18'))['db'];function respondWithStatusCode(_0x480759,_0x52dd34){_0x52dd34=_0x52dd34||0xcc;return function(_0x15a5e4){if(_0x15a5e4){return _0x480759[_0x4a11('0x19')](_0x52dd34);}return _0x480759[_0x4a11('0x1a')](_0x52dd34)[_0x4a11('0x1b')]();};}function respondWithResult(_0x328d11,_0x1b2919){_0x1b2919=_0x1b2919||0xc8;return function(_0x5c2842){if(_0x5c2842){return _0x328d11[_0x4a11('0x1a')](_0x1b2919)['json'](_0x5c2842);}};}function respondWithFilteredResult(_0x1fe64a,_0x3cb9e5){return function(_0x5acdd7){if(_0x5acdd7){var _0xe43281=_0x5acdd7[_0x4a11('0x1c')],_0x3b5b73=_0x3cb9e5[_0x4a11('0x1d')],_0x2c733f=_0x3cb9e5[_0x4a11('0x1d')]+_0x3cb9e5[_0x4a11('0x1e')],_0x32354c;if(_0x2c733f>=_0xe43281){_0x2c733f=_0xe43281;_0x32354c=0xc8;}else{_0x32354c=0xce;}_0x1fe64a[_0x4a11('0x1a')](_0x32354c);return _0x1fe64a[_0x4a11('0x1f')](_0x4a11('0x20'),_0x3b5b73+'-'+_0x2c733f+'/'+_0xe43281)[_0x4a11('0x21')](_0x5acdd7);}return null;};}function patchUpdates(_0x358e83){return function(_0x37657f){try{jsonpatch[_0x4a11('0x22')](_0x37657f,_0x358e83,!![]);}catch(_0x3deac4){return BPromise[_0x4a11('0x23')](_0x3deac4);}return _0x37657f[_0x4a11('0x24')]();};}function saveUpdates(_0x1f49be,_0x5ab91e){return function(_0x5ae716){if(_0x5ae716){return _0x5ae716['update'](_0x1f49be)['then'](function(_0x467cc5){return _0x467cc5;});}return null;};}function removeEntity(_0x3ab73f,_0x4f6740){return function(_0x310e9e){if(_0x310e9e){return _0x310e9e[_0x4a11('0x25')]()[_0x4a11('0x26')](function(){_0x3ab73f[_0x4a11('0x1a')](0xcc)[_0x4a11('0x1b')]();});}};}function handleEntityNotFound(_0x3fba74,_0x4776e5){return function(_0x1b3acc){if(!_0x1b3acc){_0x3fba74[_0x4a11('0x19')](0x194);}return _0x1b3acc;};}function handleError(_0x45bb34,_0x3df3b1){_0x3df3b1=_0x3df3b1||0x1f4;return function(_0x2d2b16){logger['error'](_0x2d2b16['stack']);if(_0x2d2b16[_0x4a11('0x27')]){delete _0x2d2b16['name'];}_0x45bb34['status'](_0x3df3b1)[_0x4a11('0x28')](_0x2d2b16);};}exports[_0x4a11('0x29')]=function(_0x583b25,_0x2046b5){if(_0x583b25[_0x4a11('0x2a')]['id']){delete _0x583b25[_0x4a11('0x2a')]['id'];}return db[_0x4a11('0x2b')][_0x4a11('0x2c')]({'where':{'id':_0x583b25[_0x4a11('0x2d')]['id']}})[_0x4a11('0x26')](handleEntityNotFound(_0x2046b5,null))[_0x4a11('0x26')](saveUpdates(_0x583b25[_0x4a11('0x2a')],null))[_0x4a11('0x26')](respondWithResult(_0x2046b5,null))[_0x4a11('0x2e')](handleError(_0x2046b5,null));};exports[_0x4a11('0x25')]=function(_0x2f5f70,_0x55d346){return db[_0x4a11('0x2b')][_0x4a11('0x2c')]({'where':{'id':_0x2f5f70['params']['id']}})[_0x4a11('0x26')](handleEntityNotFound(_0x55d346,null))['then'](removeEntity(_0x55d346,null))[_0x4a11('0x2e')](handleError(_0x55d346,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 227b46f..124d76c 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 _0x2440=['util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','define','Action','tools_actions'];(function(_0x4d45cb,_0x3017b4){var _0xea21b9=function(_0x34b0b6){while(--_0x34b0b6){_0x4d45cb['push'](_0x4d45cb['shift']());}};_0xea21b9(++_0x3017b4);}(_0x2440,0xdc));var _0x0244=function(_0x56df11,_0x381c04){_0x56df11=_0x56df11-0x0;var _0x3c4453=_0x2440[_0x56df11];return _0x3c4453;};'use strict';var _=require('lodash');var util=require(_0x0244('0x0'));var logger=require(_0x0244('0x1'))(_0x0244('0x2'));var moment=require(_0x0244('0x3'));var BPromise=require(_0x0244('0x4'));var rp=require(_0x0244('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0244('0x6'));var attributes=require('./action.attributes');module[_0x0244('0x7')]=function(_0x4013d8,_0x5c1d2e){return _0x4013d8[_0x0244('0x8')](_0x0244('0x9'),attributes,{'tableName':_0x0244('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xde2c=['lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','Action'];(function(_0x12670a,_0x3f8b09){var _0x20f572=function(_0x521d94){while(--_0x521d94){_0x12670a['push'](_0x12670a['shift']());}};_0x20f572(++_0x3f8b09);}(_0xde2c,0x156));var _0xcde2=function(_0x3e0dc4,_0x13971b){_0x3e0dc4=_0x3e0dc4-0x0;var _0x586111=_0xde2c[_0x3e0dc4];return _0x586111;};'use strict';var _=require(_0xcde2('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xcde2('0x1'));var moment=require('moment');var BPromise=require(_0xcde2('0x2'));var rp=require(_0xcde2('0x3'));var fs=require('fs');var path=require(_0xcde2('0x4'));var rimraf=require(_0xcde2('0x5'));var config=require(_0xcde2('0x6'));var attributes=require(_0xcde2('0x7'));module['exports']=function(_0x5199df,_0xb1ff5b){return _0x5199df['define'](_0xcde2('0x8'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index a0e5c59..3296fea 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 _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s'];(function(_0x13f44a,_0x3da5be){var _0x4d3b30=function(_0xec8901){while(--_0xec8901){_0x13f44a['push'](_0x13f44a['shift']());}};_0x4d3b30(++_0x3da5be);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x51cc1d,_0xaa88ae){_0x51cc1d=_0x51cc1d-0x0;var _0x2eb9f2=_0xcb91[_0x51cc1d];return _0x2eb9f2;};'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')]('Action,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file +var _0xa9e0=['http','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\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(_0x3d9d8c,_0x14da55){var _0x3babda=function(_0x491add){while(--_0x491add){_0x3d9d8c['push'](_0x3d9d8c['shift']());}};_0x3babda(++_0x14da55);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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/action/index.js b/server/api/action/index.js index e803ecf..382cc6c 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 _0x7248=['util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./action.controller','/:id','isAuthenticated','update','delete','exports'];(function(_0x4f1111,_0x355b62){var _0xb18f9c=function(_0x452b70){while(--_0x452b70){_0x4f1111['push'](_0x4f1111['shift']());}};_0xb18f9c(++_0x355b62);}(_0x7248,0x15f));var _0x8724=function(_0x1486ce,_0x233c7f){_0x1486ce=_0x1486ce-0x0;var _0x10a7b2=_0x7248[_0x1486ce];return _0x10a7b2;};'use strict';var multer=require('multer');var util=require(_0x8724('0x0'));var path=require(_0x8724('0x1'));var timeout=require(_0x8724('0x2'));var express=require(_0x8724('0x3'));var router=express[_0x8724('0x4')]();var auth=require(_0x8724('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8724('0x6'));var controller=require(_0x8724('0x7'));router['put'](_0x8724('0x8'),auth[_0x8724('0x9')](),controller[_0x8724('0xa')]);router[_0x8724('0xb')](_0x8724('0x8'),auth[_0x8724('0x9')](),controller['destroy']);module[_0x8724('0xc')]=router; \ No newline at end of file +var _0x06b5=['express','Router','../../components/interaction/service','../../config/environment','put','/:id','isAuthenticated','update','exports','multer','util','path'];(function(_0xe34ce5,_0x1a08c7){var _0x3067ec=function(_0x511e3b){while(--_0x511e3b){_0xe34ce5['push'](_0xe34ce5['shift']());}};_0x3067ec(++_0x1a08c7);}(_0x06b5,0x1d1));var _0x506b=function(_0x5a74bc,_0x32f10c){_0x5a74bc=_0x5a74bc-0x0;var _0x18078f=_0x06b5[_0x5a74bc];return _0x18078f;};'use strict';var multer=require(_0x506b('0x0'));var util=require(_0x506b('0x1'));var path=require(_0x506b('0x2'));var timeout=require('connect-timeout');var express=require(_0x506b('0x3'));var router=express[_0x506b('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x506b('0x5'));var config=require(_0x506b('0x6'));var controller=require('./action.controller');router[_0x506b('0x7')](_0x506b('0x8'),auth[_0x506b('0x9')](),controller[_0x506b('0xa')]);router['delete'](_0x506b('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x506b('0xb')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 7a913c5..2ce533c 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 _0xffd6=['TEXT','sequelize','exports','STRING'];(function(_0x416b8e,_0x24c2cc){var _0x2301c8=function(_0x1d9baa){while(--_0x1d9baa){_0x416b8e['push'](_0x416b8e['shift']());}};_0x2301c8(++_0x24c2cc);}(_0xffd6,0xad));var _0x6ffd=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0xffd6[_0x3305de];return _0x3b5a84;};'use strict';var Sequelize=require(_0x6ffd('0x0'));module[_0x6ffd('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x6ffd('0x2')]},'parent':{'type':Sequelize[_0x6ffd('0x2')]},'table':{'type':Sequelize[_0x6ffd('0x2')]},'conditions':{'type':Sequelize[_0x6ffd('0x3')]},'joins':{'type':Sequelize[_0x6ffd('0x3')]}}; \ No newline at end of file +var _0xa1af=['exports','STRING','TEXT'];(function(_0x3389da,_0x55192f){var _0x1d5312=function(_0x3a0ffc){while(--_0x3a0ffc){_0x3389da['push'](_0x3389da['shift']());}};_0x1d5312(++_0x55192f);}(_0xa1af,0x1a4));var _0xfa1a=function(_0x7bf4f0,_0x2f9d9d){_0x7bf4f0=_0x7bf4f0-0x0;var _0x496e67=_0xa1af[_0x7bf4f0];return _0x496e67;};'use strict';var Sequelize=require('sequelize');module[_0xfa1a('0x0')]={'name':{'type':Sequelize[_0xfa1a('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xfa1a('0x1')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xfa1a('0x1')]},'conditions':{'type':Sequelize[_0xfa1a('0x2')]},'joins':{'type':Sequelize[_0xfa1a('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 11dec54..582c43b 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 _0x7112=['json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','error','stack','name','send','AnalyticCustomReport','rawAttributes','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','options','includeAll','rows','catch','show','params','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','left_join','right_join','cross_join','SUM(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','join','COUNT(%s)','COUNT(DISTINCT\x20%s)','HOUR(%s)','output','web','fullPath','%s-%s.%s','randomstring','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','html-pdf','rimraf','zip-dir','moment','bluebird','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0xd109cf,_0x2e3179){var _0x145baa=function(_0x28e0e7){while(--_0x28e0e7){_0xd109cf['push'](_0xd109cf['shift']());}};_0x145baa(++_0x2e3179);}(_0x7112,0x1d3));var _0x2711=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x7112[_0x21a9d9];return _0x46adce;};'use strict';var pdf=require(_0x2711('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2711('0x1'));var zipdir=require(_0x2711('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2711('0x3'));var BPromise=require(_0x2711('0x4'));var Mustache=require('mustache');var util=require(_0x2711('0x5'));var path=require('path');var sox=require(_0x2711('0x6'));var csv=require(_0x2711('0x7'));var ejs=require(_0x2711('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2711('0x9'));var crypto=require(_0x2711('0xa'));var jsforce=require(_0x2711('0xb'));var deskjs=require(_0x2711('0xc'));var toCsv=require('to-csv');var querystring=require(_0x2711('0xd'));var Papa=require(_0x2711('0xe'));var Redis=require('ioredis');var authService=require(_0x2711('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2711('0x10'));var logger=require(_0x2711('0x11'))(_0x2711('0x12'));var utils=require(_0x2711('0x13'));var config=require(_0x2711('0x14'));var db=require(_0x2711('0x15'))['db'];function respondWithStatusCode(_0x2854e2,_0x3a94fd){_0x3a94fd=_0x3a94fd||0xcc;return function(_0x3936d2){if(_0x3936d2){return _0x2854e2[_0x2711('0x16')](_0x3a94fd);}return _0x2854e2[_0x2711('0x17')](_0x3a94fd)[_0x2711('0x18')]();};}function respondWithResult(_0x3b60ab,_0x5eeac9){_0x5eeac9=_0x5eeac9||0xc8;return function(_0x1594e2){if(_0x1594e2){return _0x3b60ab[_0x2711('0x17')](_0x5eeac9)[_0x2711('0x19')](_0x1594e2);}};}function respondWithFilteredResult(_0x2a1d25,_0x9ec76d){return function(_0x648aab){if(_0x648aab){var _0x2544fe=_0x648aab[_0x2711('0x1a')],_0x3c2f02=_0x9ec76d[_0x2711('0x1b')],_0x420b71=_0x9ec76d[_0x2711('0x1b')]+_0x9ec76d[_0x2711('0x1c')],_0x27e5c2;if(_0x420b71>=_0x2544fe){_0x420b71=_0x2544fe;_0x27e5c2=0xc8;}else{_0x27e5c2=0xce;}_0x2a1d25[_0x2711('0x17')](_0x27e5c2);return _0x2a1d25[_0x2711('0x1d')](_0x2711('0x1e'),_0x3c2f02+'-'+_0x420b71+'/'+_0x2544fe)[_0x2711('0x19')](_0x648aab);}return null;};}function patchUpdates(_0x113562){return function(_0x42de2a){try{jsonpatch[_0x2711('0x1f')](_0x42de2a,_0x113562,!![]);}catch(_0x217ef7){return BPromise[_0x2711('0x20')](_0x217ef7);}return _0x42de2a[_0x2711('0x21')]();};}function saveUpdates(_0x41df07,_0x1ee9df){return function(_0x14cf6c){if(_0x14cf6c){return _0x14cf6c[_0x2711('0x22')](_0x41df07)[_0x2711('0x23')](function(_0x285224){return _0x285224;});}return null;};}function removeEntity(_0x3c8540,_0x3bc5f8){return function(_0x398cf8){if(_0x398cf8){return _0x398cf8[_0x2711('0x24')]()[_0x2711('0x23')](function(){var _0x1d49c8=_0x398cf8[_0x2711('0x25')]({'plain':!![]});var _0x3c231c=_0x2711('0x26');return db[_0x2711('0x27')][_0x2711('0x24')]({'where':{'type':_0x3c231c,'resourceId':_0x1d49c8['id']}})[_0x2711('0x23')](function(){return _0x398cf8;});})[_0x2711('0x23')](function(){_0x3c8540[_0x2711('0x17')](0xcc)[_0x2711('0x18')]();});}};}function handleEntityNotFound(_0x1d4c69,_0x4f0f24){return function(_0x2267f7){if(!_0x2267f7){_0x1d4c69[_0x2711('0x16')](0x194);}return _0x2267f7;};}function handleError(_0x4677ea,_0xdc5a19){_0xdc5a19=_0xdc5a19||0x1f4;return function(_0x4fc48d){logger[_0x2711('0x28')](_0x4fc48d[_0x2711('0x29')]);if(_0x4fc48d[_0x2711('0x2a')]){delete _0x4fc48d[_0x2711('0x2a')];}_0x4677ea[_0x2711('0x17')](_0xdc5a19)[_0x2711('0x2b')](_0x4fc48d);};}exports['index']=function(_0x5e7285,_0x120497){var _0x38d9bd={},_0x5bca6f={},_0x9e836c={'count':0x0,'rows':[]};var _0x410150=_['map'](db[_0x2711('0x2c')][_0x2711('0x2d')],function(_0x264b45){return{'name':_0x264b45['fieldName'],'type':_0x264b45[_0x2711('0x2e')][_0x2711('0x2f')]};});_0x5bca6f[_0x2711('0x30')]=_[_0x2711('0x31')](_0x410150,_0x2711('0x2a'));_0x5bca6f[_0x2711('0x32')]=_[_0x2711('0x33')](_0x5e7285[_0x2711('0x32')]);_0x5bca6f['filters']=_[_0x2711('0x34')](_0x5bca6f[_0x2711('0x30')],_0x5bca6f[_0x2711('0x32')]);_0x38d9bd[_0x2711('0x35')]=_[_0x2711('0x34')](_0x5bca6f[_0x2711('0x30')],qs[_0x2711('0x36')](_0x5e7285['query'][_0x2711('0x36')]));_0x38d9bd[_0x2711('0x35')]=_0x38d9bd[_0x2711('0x35')][_0x2711('0x37')]?_0x38d9bd[_0x2711('0x35')]:_0x5bca6f[_0x2711('0x30')];if(!_0x5e7285[_0x2711('0x32')][_0x2711('0x38')](_0x2711('0x39'))){_0x38d9bd[_0x2711('0x1c')]=qs[_0x2711('0x1c')](_0x5e7285[_0x2711('0x32')]['limit']);_0x38d9bd[_0x2711('0x1b')]=qs[_0x2711('0x1b')](_0x5e7285['query']['offset']);}_0x38d9bd[_0x2711('0x3a')]=qs['sort'](_0x5e7285[_0x2711('0x32')]['sort']);_0x38d9bd[_0x2711('0x3b')]=qs[_0x2711('0x3c')](_[_0x2711('0x3d')](_0x5e7285[_0x2711('0x32')],_0x5bca6f[_0x2711('0x3c')]));if(_0x5e7285[_0x2711('0x32')][_0x2711('0x3e')]){_0x38d9bd['where']=_[_0x2711('0x3f')](_0x38d9bd[_0x2711('0x3b')],{'$or':_['map'](_0x410150,function(_0x32ef49){if(_0x32ef49[_0x2711('0x2e')]!=='VIRTUAL'){var _0x2710f6={};_0x2710f6[_0x32ef49[_0x2711('0x2a')]]={'$like':'%'+_0x5e7285[_0x2711('0x32')][_0x2711('0x3e')]+'%'};return _0x2710f6;}})});}_0x38d9bd=_[_0x2711('0x3f')]({},_0x38d9bd,_0x5e7285[_0x2711('0x40')]);var _0x5a38bc={'where':_0x38d9bd['where']};return db['AnalyticCustomReport'][_0x2711('0x1a')](_0x5a38bc)[_0x2711('0x23')](function(_0x6c3617){_0x9e836c[_0x2711('0x1a')]=_0x6c3617;if(_0x5e7285['query'][_0x2711('0x41')]){_0x38d9bd['include']=[{'all':!![]}];}return db['AnalyticCustomReport']['findAll'](_0x38d9bd);})[_0x2711('0x23')](function(_0x413439){_0x9e836c[_0x2711('0x42')]=_0x413439;return _0x9e836c;})[_0x2711('0x23')](respondWithFilteredResult(_0x120497,_0x38d9bd))[_0x2711('0x43')](handleError(_0x120497,null));};exports[_0x2711('0x44')]=function(_0x5403e6,_0x5a851d){var _0x2e18a5={'raw':![],'where':{'id':_0x5403e6[_0x2711('0x45')]['id']}},_0x56d52d={};_0x56d52d['model']=_[_0x2711('0x33')](db['AnalyticCustomReport'][_0x2711('0x2d')]);_0x56d52d[_0x2711('0x32')]=_[_0x2711('0x33')](_0x5403e6[_0x2711('0x32')]);_0x56d52d[_0x2711('0x3c')]=_['intersection'](_0x56d52d[_0x2711('0x30')],_0x56d52d['query']);_0x2e18a5[_0x2711('0x35')]=_[_0x2711('0x34')](_0x56d52d[_0x2711('0x30')],qs['fields'](_0x5403e6[_0x2711('0x32')]['fields']));_0x2e18a5[_0x2711('0x35')]=_0x2e18a5['attributes'][_0x2711('0x37')]?_0x2e18a5['attributes']:_0x56d52d[_0x2711('0x30')];if(_0x5403e6[_0x2711('0x32')][_0x2711('0x41')]){_0x2e18a5[_0x2711('0x46')]=[{'all':!![]}];}_0x2e18a5=_[_0x2711('0x3f')]({},_0x2e18a5,_0x5403e6[_0x2711('0x40')]);return db[_0x2711('0x2c')]['find'](_0x2e18a5)[_0x2711('0x23')](handleEntityNotFound(_0x5a851d,null))[_0x2711('0x23')](respondWithResult(_0x5a851d,null))['catch'](handleError(_0x5a851d,null));};exports[_0x2711('0x47')]=function(_0x4b7b1e,_0x37ad40){return db[_0x2711('0x2c')][_0x2711('0x47')](_0x4b7b1e['body'],{})[_0x2711('0x23')](function(_0x173a16){var _0x2f8f55=_0x4b7b1e[_0x2711('0x48')][_0x2711('0x25')]({'plain':!![]});if(!_0x2f8f55)throw new Error(_0x2711('0x49'));if(_0x2f8f55[_0x2711('0x4a')]==='user'){var _0x56e0bf=_0x173a16['get']({'plain':!![]});var _0x52fb74=_0x2711('0x4b');return db['UserProfileSection'][_0x2711('0x4c')]({'where':{'name':_0x52fb74,'userProfileId':_0x2f8f55[_0x2711('0x4d')]},'raw':!![]})['then'](function(_0x1f2308){if(_0x1f2308&&_0x1f2308[_0x2711('0x4e')]===0x0){return db[_0x2711('0x27')][_0x2711('0x47')]({'name':_0x56e0bf[_0x2711('0x2a')],'resourceId':_0x56e0bf['id'],'type':_0x2711('0x26'),'sectionId':_0x1f2308['id']},{})[_0x2711('0x23')](function(){return _0x173a16;});}else{return _0x173a16;}})[_0x2711('0x43')](function(_0x174830){logger[_0x2711('0x28')](_0x2711('0x4f'),_0x174830);throw _0x174830;});}return _0x173a16;})['then'](respondWithResult(_0x37ad40,0xc9))[_0x2711('0x43')](handleError(_0x37ad40,null));};exports[_0x2711('0x22')]=function(_0x3f4ab3,_0x2a2b07){if(_0x3f4ab3[_0x2711('0x50')]['id']){delete _0x3f4ab3[_0x2711('0x50')]['id'];}return db[_0x2711('0x2c')]['find']({'where':{'id':_0x3f4ab3[_0x2711('0x45')]['id']}})[_0x2711('0x23')](handleEntityNotFound(_0x2a2b07,null))['then'](saveUpdates(_0x3f4ab3[_0x2711('0x50')],null))['then'](respondWithResult(_0x2a2b07,null))[_0x2711('0x43')](handleError(_0x2a2b07,null));};exports[_0x2711('0x24')]=function(_0x47be5c,_0x1f810e){return db[_0x2711('0x2c')]['find']({'where':{'id':_0x47be5c[_0x2711('0x45')]['id']}})['then'](handleEntityNotFound(_0x1f810e,null))[_0x2711('0x23')](removeEntity(_0x1f810e,null))[_0x2711('0x43')](handleError(_0x1f810e,null));};exports[_0x2711('0x51')]=function(_0x552a3a,_0x4f60e9){var _0x14912e=0xa;var _0x2ce712=['join',_0x2711('0x52'),_0x2711('0x53'),_0x2711('0x54')];var _0x1a1db1={'SUM':_0x2711('0x55'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x2711('0x56'),'MIN':_0x2711('0x57'),'AVG':_0x2711('0x58'),'GROUP_CONCAT':_0x2711('0x59'),'GROUP_CONCAT ASC':_0x2711('0x5a'),'GROUP_CONCAT DESC':_0x2711('0x5b')};var _0x4fd0a2={'SEC_TO_TIME':_0x2711('0x5c'),'DATE':_0x2711('0x5d'),'HOUR':'HOUR(%s)','ROUND':_0x2711('0x5e'),'UNIX_TIMESTAMP':_0x2711('0x5f')};var _0x454030=function(_0x4dea98){return!_[_0x2711('0x60')]([_0x2711('0x61'),_0x2711('0x62'),_0x2711('0x63'),_0x2711('0x64')],_0x4dea98);};var _0x10bb72=function(_0x222068){if(!_0x222068||!_0x222068[_0x2711('0x65')][_0x2711('0x37')]){return'';}for(var _0x4c22bd='(',_0x3cb172=0x0;_0x3cb172<_0x222068[_0x2711('0x65')][_0x2711('0x37')];_0x3cb172+=0x1){_0x3cb172>0x0&&(_0x4c22bd+='\x20'+_0x222068[_0x2711('0x66')]+'\x20');_0x4c22bd+=_0x222068['rules'][_0x3cb172]['group']?_0x10bb72(_0x222068[_0x2711('0x65')][_0x3cb172][_0x2711('0x67')]):_0x222068[_0x2711('0x65')][_0x3cb172][_0x2711('0x68')]+'\x20'+_0x222068[_0x2711('0x65')][_0x3cb172][_0x2711('0x69')]+(_0x454030(_0x222068[_0x2711('0x65')][_0x3cb172]['condition'])?'\x20'+_0x222068[_0x2711('0x65')][_0x3cb172][_0x2711('0x6a')]:'');}return _0x4c22bd+')';};var _0x540006={'where':{'id':_0x552a3a[_0x2711('0x45')]['id']}},_0x5e82b9,_0x48510d,_0x4a427e,_0x121d1e,_0x1b44cd;_0x540006=_[_0x2711('0x3f')]({},_0x540006,_0x552a3a[_0x2711('0x40')]);return db[_0x2711('0x2c')][_0x2711('0x4c')](_0x540006)['then'](function(_0x261b04){if(_0x261b04){_0x5e82b9=_0x261b04;return _0x261b04[_0x2711('0x6b')]();}return null;})['then'](function(_0x32fd51){if(_0x32fd51){if(!_0x32fd51['length']){throw new db[(_0x2711('0x6c'))][(_0x2711('0x6d'))](_0x2711('0x6e'),0x193);}_0x48510d=_0x32fd51;return db[_0x2711('0x6f')][_0x2711('0x70')]({'raw':!![]});}return null;})[_0x2711('0x23')](function(_0x12d262){if(_0x12d262){_0x4a427e=_[_0x2711('0x71')](_0x12d262,'id');var _0x3b4654;var _0x28b72f=squel[_0x2711('0x72')]();_0x28b72f[_0x2711('0x73')](_0x5e82b9['table']);for(var _0x59cfd7=0x0;_0x59cfd7<_0x48510d['length'];_0x59cfd7+=0x1){_0x3b4654=_0x48510d[_0x59cfd7][_0x2711('0x74')]?_0x4a427e[_0x48510d[_0x59cfd7][_0x2711('0x74')]][_0x2711('0x75')]:_0x48510d[_0x59cfd7][_0x2711('0x68')];_0x3b4654=_0x48510d[_0x59cfd7][_0x2711('0x76')]?_[_0x2711('0x77')](_0x1a1db1[_0x48510d[_0x59cfd7][_0x2711('0x76')]],'%s',_0x3b4654):_0x3b4654;_0x3b4654=_0x48510d[_0x59cfd7][_0x2711('0x78')]?_[_0x2711('0x77')](_0x4fd0a2[_0x48510d[_0x59cfd7][_0x2711('0x78')]],'%s',_0x3b4654):_0x3b4654;if(_0x48510d[_0x59cfd7][_0x2711('0x79')]){_0x28b72f[_0x2711('0x67')](_0x3b4654);}_0x48510d[_0x59cfd7][_0x2711('0x7a')]&&_0x28b72f[_0x2711('0x3a')](_0x3b4654,_0x48510d[_0x59cfd7][_0x2711('0x7a')]===_0x2711('0x7b')?![]:!![]);_0x28b72f[_0x2711('0x68')](_0x3b4654,_0x48510d[_0x59cfd7][_0x2711('0x7c')]||_0x3b4654);}if(_0x5e82b9[_0x2711('0x7d')]){_0x5e82b9[_0x2711('0x7d')]=JSON[_0x2711('0x7e')](_0x5e82b9[_0x2711('0x7d')]);for(var _0x3c4ca6=0x0;_0x3c4ca6<_0x5e82b9[_0x2711('0x7d')][_0x2711('0x37')];_0x3c4ca6+=0x1){if(_0x5e82b9['joins'][_0x3c4ca6][_0x2711('0x2e')]&&_['includes'](_0x2ce712,_0x5e82b9[_0x2711('0x7d')][_0x3c4ca6]['type'])&&_0x5e82b9[_0x2711('0x7d')][_0x3c4ca6][_0x2711('0x7f')]&&_0x5e82b9[_0x2711('0x7d')][_0x3c4ca6][_0x2711('0x80')]&&_0x5e82b9[_0x2711('0x7d')][_0x3c4ca6][_0x2711('0x81')]){_0x28b72f[_0x5e82b9[_0x2711('0x7d')][_0x3c4ca6][_0x2711('0x2e')]](_0x5e82b9[_0x2711('0x7d')][_0x3c4ca6]['foreignTable'],null,util[_0x2711('0x78')](_0x2711('0x82'),_0x5e82b9[_0x2711('0x83')],_0x5e82b9[_0x2711('0x7d')][_0x3c4ca6][_0x2711('0x7f')],_0x5e82b9[_0x2711('0x7d')][_0x3c4ca6][_0x2711('0x80')],_0x5e82b9[_0x2711('0x7d')][_0x3c4ca6][_0x2711('0x81')]));}}}if(_0x5e82b9['conditions']){_0x5e82b9[_0x2711('0x84')]=JSON['parse'](_0x5e82b9['conditions']);_0x28b72f['where'](_0x10bb72(_0x5e82b9[_0x2711('0x84')][_0x2711('0x67')]));}_0x1b44cd=_0x28b72f[_0x2711('0x85')]();_0x28b72f[_0x2711('0x1c')](_0x14912e);_0x28b72f['offset'](0x0);logger['debug'](_0x2711('0x86'),_0x28b72f[_0x2711('0x87')]());return db[_0x2711('0x88')][_0x2711('0x32')](_0x28b72f[_0x2711('0x87')](),{'type':db['sequelize'][_0x2711('0x89')][_0x2711('0x8a')]});}})[_0x2711('0x23')](respondWithResult(_0x4f60e9,null))[_0x2711('0x43')](handleError(_0x4f60e9,null));};function runReport(_0x540488,_0x4652b4,_0x1ead2b){var _0x3b25b1=_0x4652b4[_0x2711('0x2a')];var _0x415628=0xa;var _0x527122=[_0x2711('0x8b'),_0x2711('0x52'),'right_join',_0x2711('0x54')];var _0x4c7d3b={'SUM':_0x2711('0x55'),'COUNT':_0x2711('0x8c'),'COUNT DISTINCT':_0x2711('0x8d'),'MAX':_0x2711('0x56'),'MIN':_0x2711('0x57'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x2711('0x59'),'GROUP_CONCAT ASC':_0x2711('0x5a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x418d89={'SEC_TO_TIME':_0x2711('0x5c'),'DATE':_0x2711('0x5d'),'HOUR':_0x2711('0x8e'),'ROUND':_0x2711('0x5e'),'UNIX_TIMESTAMP':_0x2711('0x5f')};var _0x3c86b6=function(_0x14e08c){return!_['includes']([_0x2711('0x61'),_0x2711('0x62'),_0x2711('0x63'),'IS\x20NOT\x20EMPTY'],_0x14e08c);};var _0x48cc1e=function(_0x4b9ebb){if(!_0x4b9ebb||!_0x4b9ebb['rules']['length']){return'';}for(var _0x3d8aac='(',_0x2fd4f8=0x0;_0x2fd4f8<_0x4b9ebb[_0x2711('0x65')]['length'];_0x2fd4f8+=0x1){_0x2fd4f8>0x0&&(_0x3d8aac+='\x20'+_0x4b9ebb[_0x2711('0x66')]+'\x20');_0x3d8aac+=_0x4b9ebb[_0x2711('0x65')][_0x2fd4f8][_0x2711('0x67')]?_0x48cc1e(_0x4b9ebb[_0x2711('0x65')][_0x2fd4f8][_0x2711('0x67')]):_0x4b9ebb[_0x2711('0x65')][_0x2fd4f8]['field']+'\x20'+_0x4b9ebb[_0x2711('0x65')][_0x2fd4f8]['condition']+(_0x3c86b6(_0x4b9ebb[_0x2711('0x65')][_0x2fd4f8][_0x2711('0x69')])?'\x20'+_0x4b9ebb['rules'][_0x2fd4f8][_0x2711('0x6a')]:'');}return _0x3d8aac+')';};var _0x2d7961={'where':{'id':_0x540488['id']}},_0x61ea1e,_0x420031,_0x35e87e,_0x449c79,_0x17c21f;_0x2d7961=_[_0x2711('0x3f')]({},_0x2d7961,_0x1ead2b);return db[_0x2711('0x2c')][_0x2711('0x4c')](_0x2d7961)[_0x2711('0x23')](function(_0xf7b65b){if(_0xf7b65b){_0x61ea1e=_0xf7b65b;return _0xf7b65b['getFields']();}return null;})[_0x2711('0x23')](function(_0x46daf4){if(_0x46daf4){if(!_0x46daf4[_0x2711('0x37')]){throw new db[(_0x2711('0x6c'))][(_0x2711('0x6d'))](_0x2711('0x6e'),0x193);}_0x420031=_0x46daf4;return db[_0x2711('0x6f')][_0x2711('0x70')]({'raw':!![]});}return null;})[_0x2711('0x23')](function(_0x84fa48){if(_0x84fa48){_0x35e87e=_[_0x2711('0x71')](_0x84fa48,'id');var _0x220ed9;var _0x438484=squel['select']();_0x438484[_0x2711('0x73')](_0x61ea1e['table']);for(var _0x4d8eaf=0x0;_0x4d8eaf<_0x420031['length'];_0x4d8eaf+=0x1){_0x220ed9=_0x420031[_0x4d8eaf]['MetricId']?_0x35e87e[_0x420031[_0x4d8eaf]['MetricId']][_0x2711('0x75')]:_0x420031[_0x4d8eaf][_0x2711('0x68')];_0x220ed9=_0x420031[_0x4d8eaf][_0x2711('0x76')]?_[_0x2711('0x77')](_0x4c7d3b[_0x420031[_0x4d8eaf][_0x2711('0x76')]],'%s',_0x220ed9):_0x220ed9;_0x220ed9=_0x420031[_0x4d8eaf][_0x2711('0x78')]?_[_0x2711('0x77')](_0x418d89[_0x420031[_0x4d8eaf][_0x2711('0x78')]],'%s',_0x220ed9):_0x220ed9;if(_0x420031[_0x4d8eaf][_0x2711('0x79')]){_0x438484['group'](_0x220ed9);}_0x420031[_0x4d8eaf][_0x2711('0x7a')]&&_0x438484['order'](_0x220ed9,_0x420031[_0x4d8eaf][_0x2711('0x7a')]==='DESC'?![]:!![]);_0x438484['field'](_0x220ed9,_0x420031[_0x4d8eaf]['alias']||_0x220ed9);}if(_0x61ea1e[_0x2711('0x7d')]){_0x61ea1e[_0x2711('0x7d')]=JSON[_0x2711('0x7e')](_0x61ea1e[_0x2711('0x7d')]);for(var _0x4fabc0=0x0;_0x4fabc0<_0x61ea1e['joins'][_0x2711('0x37')];_0x4fabc0+=0x1){if(_0x61ea1e['joins'][_0x4fabc0][_0x2711('0x2e')]&&_['includes'](_0x527122,_0x61ea1e[_0x2711('0x7d')][_0x4fabc0][_0x2711('0x2e')])&&_0x61ea1e[_0x2711('0x7d')][_0x4fabc0]['parentKey']&&_0x61ea1e[_0x2711('0x7d')][_0x4fabc0][_0x2711('0x80')]&&_0x61ea1e['joins'][_0x4fabc0][_0x2711('0x81')]){_0x438484[_0x61ea1e[_0x2711('0x7d')][_0x4fabc0]['type']](_0x61ea1e['joins'][_0x4fabc0]['foreignTable'],null,util[_0x2711('0x78')]('%s.%s\x20=\x20%s.%s',_0x61ea1e[_0x2711('0x83')],_0x61ea1e[_0x2711('0x7d')][_0x4fabc0][_0x2711('0x7f')],_0x61ea1e['joins'][_0x4fabc0][_0x2711('0x80')],_0x61ea1e[_0x2711('0x7d')][_0x4fabc0][_0x2711('0x81')]));}}}if(_0x61ea1e[_0x2711('0x84')]){_0x61ea1e[_0x2711('0x84')]=JSON[_0x2711('0x7e')](_0x61ea1e[_0x2711('0x84')]);_0x438484['where'](_0x48cc1e(_0x61ea1e['conditions']['group']));}_0x17c21f=_0x438484[_0x2711('0x85')]();_0x438484[_0x2711('0x1c')](_0x415628);_0x438484[_0x2711('0x1b')](0x0);logger['debug'](_0x2711('0x86'),_0x438484[_0x2711('0x87')]());return db[_0x2711('0x88')]['query'](_0x438484[_0x2711('0x87')](),{'type':db[_0x2711('0x88')]['QueryTypes']['SELECT']});}})[_0x2711('0x23')](function(_0x2cd766){if(!_0x2cd766[_0x2711('0x37')]){throw new db[(_0x2711('0x6c'))]['ValidationErrorItem']('No\x20available\x20data',0xcc);}if(_0x4652b4[_0x2711('0x8f')]===_0x2711('0x90')){return null;}var _0x5cef44=_['merge'](_0x4652b4,{'name':_0x4652b4[_0x2711('0x91')]||_0x4652b4[_0x2711('0x2a')]||_0x61ea1e[_0x2711('0x2a')],'basename':_0x3b25b1,'savename':util[_0x2711('0x78')](_0x2711('0x92'),_0x4652b4[_0x2711('0x2a')]||_0x61ea1e[_0x2711('0x2a')],require(_0x2711('0x93'))['generate'](0x4),_0x4652b4[_0x2711('0x8f')]||'csv'),'reportId':_0x61ea1e['id'],'reportType':_0x2711('0x94')});return db[_0x2711('0x95')]['create'](_0x5cef44,{'raw':!![]});})[_0x2711('0x23')](function(_0x47189d){if(_0x61ea1e[_0x2711('0x83')]===_0x2711('0x96')){_0x17c21f['where'](_0x61ea1e[_0x2711('0x83')]+_0x2711('0x97'),_0x4652b4['startDate'],_0x4652b4[_0x2711('0x98')]);}else{_0x17c21f[_0x2711('0x3b')](_0x61ea1e[_0x2711('0x83')]+_0x2711('0x99'),_0x4652b4[_0x2711('0x9a')],_0x4652b4[_0x2711('0x98')]);}if(_0x47189d){logger['info'](_0x2711('0x9b'),_0x17c21f[_0x2711('0x87')]());require(_0x2711('0x9c'))[_0x2711('0x9d')](path[_0x2711('0x8b')](__dirname,_0x2711('0x9e'),_0x47189d[_0x2711('0x8f')]),[_0x47189d['id'],_0x17c21f[_0x2711('0x87')](),path['join'](__dirname,_0x2711('0x9f'),_0x47189d[_0x2711('0xa0')]),_0x3b25b1]);return _0x47189d;}else{var _0x7f6385=squel[_0x2711('0x72')]();_0x7f6385[_0x2711('0x73')]('('+_0x17c21f['toString']()+')',_0x2711('0xa1'));_0x7f6385['field'](_0x2711('0xa2'),_0x2711('0x1a'));_0x17c21f[_0x2711('0x1c')](_0x4652b4[_0x2711('0x1c')]||_0x415628);_0x17c21f[_0x2711('0x1b')](_0x4652b4[_0x2711('0x1b')]||0x0);return db[_0x2711('0x88')]['query'](_0x7f6385[_0x2711('0x87')](),{'type':db[_0x2711('0x88')][_0x2711('0x89')][_0x2711('0x8a')]})[_0x2711('0x23')](function(_0x5439b3){if(!_0x5439b3[_0x2711('0x37')]){_0x449c79=0x0;}else{_0x449c79=_0x5439b3[0x0]['count']||0x0;}return db['sequelize'][_0x2711('0x32')](_0x17c21f[_0x2711('0x87')](),{'type':db[_0x2711('0x88')]['QueryTypes'][_0x2711('0x8a')]});})[_0x2711('0x23')](function(_0x5af6ea){return{'rows':_0x5af6ea||[],'count':_0x449c79};});}});}exports[_0x2711('0xa3')]=function(_0x5246ca,_0x181645){return runReport(_0x5246ca['params'],_0x5246ca['query'],_0x5246ca[_0x2711('0x40')])['then'](respondWithResult(_0x181645,null))['catch'](handleError(_0x181645,null));};exports['runReport']=runReport;exports[_0x2711('0x32')]=function(_0x11c3b3,_0x586467){var _0xc02ea7=0xa;var _0x5e1a7c=[_0x2711('0x8b'),_0x2711('0x52'),'right_join',_0x2711('0x54')];var _0x4f1c96={'SUM':'SUM(%s)','COUNT':_0x2711('0x8c'),'COUNT DISTINCT':_0x2711('0x8d'),'MAX':_0x2711('0x56'),'MIN':_0x2711('0x57'),'AVG':_0x2711('0x58'),'GROUP_CONCAT':_0x2711('0x59'),'GROUP_CONCAT ASC':_0x2711('0x5a'),'GROUP_CONCAT DESC':_0x2711('0x5b')};var _0x1e6a01={'SEC_TO_TIME':_0x2711('0x5c'),'DATE':_0x2711('0x5d'),'HOUR':_0x2711('0x8e'),'ROUND':_0x2711('0x5e'),'UNIX_TIMESTAMP':_0x2711('0x5f')};var _0x4e2806=function(_0x594315){return!_['includes']([_0x2711('0x61'),_0x2711('0x62'),'IS\x20EMPTY',_0x2711('0x64')],_0x594315);};var _0x246a8c=function(_0x5ded4e){if(!_0x5ded4e||!_0x5ded4e[_0x2711('0x65')][_0x2711('0x37')]){return'';}for(var _0x6a2e67='(',_0x60c76f=0x0;_0x60c76f<_0x5ded4e['rules'][_0x2711('0x37')];_0x60c76f+=0x1){_0x60c76f>0x0&&(_0x6a2e67+='\x20'+_0x5ded4e[_0x2711('0x66')]+'\x20');_0x6a2e67+=_0x5ded4e['rules'][_0x60c76f][_0x2711('0x67')]?_0x246a8c(_0x5ded4e['rules'][_0x60c76f]['group']):_0x5ded4e[_0x2711('0x65')][_0x60c76f]['field']+'\x20'+_0x5ded4e[_0x2711('0x65')][_0x60c76f][_0x2711('0x69')]+(_0x4e2806(_0x5ded4e[_0x2711('0x65')][_0x60c76f][_0x2711('0x69')])?'\x20'+_0x5ded4e[_0x2711('0x65')][_0x60c76f]['value']:'');}return _0x6a2e67+')';};var _0x7d90a7={'where':{'id':_0x11c3b3[_0x2711('0x45')]['id']}},_0x533d71,_0xb5db80,_0x4c92e2,_0x5615ee,_0x1dd3dc;_0x7d90a7=_[_0x2711('0x3f')]({},_0x7d90a7,_0x11c3b3[_0x2711('0x40')]);return db[_0x2711('0x2c')][_0x2711('0x4c')](_0x7d90a7)[_0x2711('0x23')](function(_0x4a90d4){if(_0x4a90d4){_0x533d71=_0x4a90d4;return _0x4a90d4['getFields']();}return null;})['then'](function(_0x1151c1){if(_0x1151c1){if(!_0x1151c1[_0x2711('0x37')]){throw new db[(_0x2711('0x6c'))]['ValidationErrorItem'](_0x2711('0x6e'),0x193);}_0xb5db80=_0x1151c1;return db[_0x2711('0x6f')][_0x2711('0x70')]({'raw':!![]});}return null;})[_0x2711('0x23')](function(_0x19c2d1){if(_0x19c2d1){_0x4c92e2=_['keyBy'](_0x19c2d1,'id');var _0x4e71be;var _0x2a4ca9=squel[_0x2711('0x72')]();_0x2a4ca9[_0x2711('0x73')](_0x533d71[_0x2711('0x83')]);for(var _0x15f3a8=0x0;_0x15f3a8<_0xb5db80[_0x2711('0x37')];_0x15f3a8+=0x1){_0x4e71be=_0xb5db80[_0x15f3a8][_0x2711('0x74')]?_0x4c92e2[_0xb5db80[_0x15f3a8][_0x2711('0x74')]]['metric']:_0xb5db80[_0x15f3a8]['field'];_0x4e71be=_0xb5db80[_0x15f3a8][_0x2711('0x76')]?_[_0x2711('0x77')](_0x4f1c96[_0xb5db80[_0x15f3a8][_0x2711('0x76')]],'%s',_0x4e71be):_0x4e71be;_0x4e71be=_0xb5db80[_0x15f3a8][_0x2711('0x78')]?_[_0x2711('0x77')](_0x1e6a01[_0xb5db80[_0x15f3a8][_0x2711('0x78')]],'%s',_0x4e71be):_0x4e71be;if(_0xb5db80[_0x15f3a8]['groupBy']){_0x2a4ca9['group'](_0x4e71be);}_0xb5db80[_0x15f3a8][_0x2711('0x7a')]&&_0x2a4ca9[_0x2711('0x3a')](_0x4e71be,_0xb5db80[_0x15f3a8][_0x2711('0x7a')]===_0x2711('0x7b')?![]:!![]);_0x2a4ca9[_0x2711('0x68')](_0x4e71be,_0xb5db80[_0x15f3a8][_0x2711('0x7c')]||_0x4e71be);}if(_0x533d71[_0x2711('0x7d')]){_0x533d71[_0x2711('0x7d')]=JSON[_0x2711('0x7e')](_0x533d71[_0x2711('0x7d')]);for(var _0x2343eb=0x0;_0x2343eb<_0x533d71[_0x2711('0x7d')][_0x2711('0x37')];_0x2343eb+=0x1){if(_0x533d71['joins'][_0x2343eb][_0x2711('0x2e')]&&_[_0x2711('0x60')](_0x5e1a7c,_0x533d71[_0x2711('0x7d')][_0x2343eb][_0x2711('0x2e')])&&_0x533d71[_0x2711('0x7d')][_0x2343eb][_0x2711('0x7f')]&&_0x533d71[_0x2711('0x7d')][_0x2343eb][_0x2711('0x80')]&&_0x533d71[_0x2711('0x7d')][_0x2343eb]['foreignKey']){_0x2a4ca9[_0x533d71['joins'][_0x2343eb][_0x2711('0x2e')]](_0x533d71[_0x2711('0x7d')][_0x2343eb][_0x2711('0x80')],null,util[_0x2711('0x78')](_0x2711('0x82'),_0x533d71['table'],_0x533d71['joins'][_0x2343eb][_0x2711('0x7f')],_0x533d71[_0x2711('0x7d')][_0x2343eb][_0x2711('0x80')],_0x533d71[_0x2711('0x7d')][_0x2343eb][_0x2711('0x81')]));}}}if(_0x533d71[_0x2711('0x84')]){_0x533d71[_0x2711('0x84')]=JSON['parse'](_0x533d71[_0x2711('0x84')]);_0x2a4ca9[_0x2711('0x3b')](_0x246a8c(_0x533d71[_0x2711('0x84')][_0x2711('0x67')]));}_0x1dd3dc=_0x2a4ca9[_0x2711('0x85')]();_0x2a4ca9['limit'](_0xc02ea7);_0x2a4ca9[_0x2711('0x1b')](0x0);logger['debug']('Limited\x20Query:',_0x2a4ca9['toString']());return db['sequelize'][_0x2711('0x32')](_0x2a4ca9[_0x2711('0x87')](),{'type':db[_0x2711('0x88')][_0x2711('0x89')][_0x2711('0x8a')]});}})[_0x2711('0x23')](function(){return{'sql':_0x1dd3dc[_0x2711('0x87')]()};})[_0x2711('0x23')](respondWithResult(_0x586467,null))[_0x2711('0x43')](handleError(_0x586467,null));}; \ No newline at end of file +var _0x8514=['../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','then','get','CustomReports','UserProfileResource','sendStatus','error','stack','name','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','findAll','catch','show','params','fields','include','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','format','replace','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(DISTINCT\x20%s)','UNIX_TIMESTAMP(%s)','operator','groupBy','No\x20available\x20data','web','fullPath','%s-%s.%s','randomstring','generate','output','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','runReport','HOUR(%s)','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils'];(function(_0x37d29a,_0x4e999a){var _0x3948ad=function(_0x36ee69){while(--_0x36ee69){_0x37d29a['push'](_0x37d29a['shift']());}};_0x3948ad(++_0x4e999a);}(_0x8514,0x93));var _0x4851=function(_0xb8a3b,_0x59e6fd){_0xb8a3b=_0xb8a3b-0x0;var _0x416824=_0x8514[_0xb8a3b];return _0x416824;};'use strict';var pdf=require(_0x4851('0x0'));var emlformat=require(_0x4851('0x1'));var rimraf=require(_0x4851('0x2'));var zipdir=require(_0x4851('0x3'));var jsonpatch=require(_0x4851('0x4'));var rp=require(_0x4851('0x5'));var moment=require(_0x4851('0x6'));var BPromise=require(_0x4851('0x7'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x4851('0x8'));var ejs=require(_0x4851('0x9'));var fs=require('fs');var _=require(_0x4851('0xa'));var squel=require(_0x4851('0xb'));var crypto=require(_0x4851('0xc'));var jsforce=require(_0x4851('0xd'));var deskjs=require(_0x4851('0xe'));var toCsv=require(_0x4851('0x8'));var querystring=require(_0x4851('0xf'));var Papa=require(_0x4851('0x10'));var Redis=require(_0x4851('0x11'));var authService=require(_0x4851('0x12'));var qs=require(_0x4851('0x13'));var as=require(_0x4851('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x4851('0x15'));var config=require('../../config/environment');var db=require(_0x4851('0x16'))['db'];function respondWithStatusCode(_0x3ec59f,_0x3f85be){_0x3f85be=_0x3f85be||0xcc;return function(_0x3c50bd){if(_0x3c50bd){return _0x3ec59f['sendStatus'](_0x3f85be);}return _0x3ec59f[_0x4851('0x17')](_0x3f85be)[_0x4851('0x18')]();};}function respondWithResult(_0x4e0db4,_0x54f7f3){_0x54f7f3=_0x54f7f3||0xc8;return function(_0x440c00){if(_0x440c00){return _0x4e0db4[_0x4851('0x17')](_0x54f7f3)[_0x4851('0x19')](_0x440c00);}};}function respondWithFilteredResult(_0x1d8d58,_0x5ad5f5){return function(_0x5beddb){if(_0x5beddb){var _0xec1afb=_0x5beddb[_0x4851('0x1a')],_0x4a26b7=_0x5ad5f5[_0x4851('0x1b')],_0x20a953=_0x5ad5f5[_0x4851('0x1b')]+_0x5ad5f5[_0x4851('0x1c')],_0x3f56ab;if(_0x20a953>=_0xec1afb){_0x20a953=_0xec1afb;_0x3f56ab=0xc8;}else{_0x3f56ab=0xce;}_0x1d8d58[_0x4851('0x17')](_0x3f56ab);return _0x1d8d58[_0x4851('0x1d')](_0x4851('0x1e'),_0x4a26b7+'-'+_0x20a953+'/'+_0xec1afb)[_0x4851('0x19')](_0x5beddb);}return null;};}function patchUpdates(_0x3169c3){return function(_0x3840ad){try{jsonpatch[_0x4851('0x1f')](_0x3840ad,_0x3169c3,!![]);}catch(_0x5b8b72){return BPromise[_0x4851('0x20')](_0x5b8b72);}return _0x3840ad[_0x4851('0x21')]();};}function saveUpdates(_0x39e6b6,_0x3232b2){return function(_0xecf7ca){if(_0xecf7ca){return _0xecf7ca['update'](_0x39e6b6)['then'](function(_0x330939){return _0x330939;});}return null;};}function removeEntity(_0x4f7be6,_0x5d06ba){return function(_0x471fb2){if(_0x471fb2){return _0x471fb2[_0x4851('0x22')]()[_0x4851('0x23')](function(){var _0x520399=_0x471fb2[_0x4851('0x24')]({'plain':!![]});var _0x16f22d=_0x4851('0x25');return db[_0x4851('0x26')][_0x4851('0x22')]({'where':{'type':_0x16f22d,'resourceId':_0x520399['id']}})[_0x4851('0x23')](function(){return _0x471fb2;});})[_0x4851('0x23')](function(){_0x4f7be6[_0x4851('0x17')](0xcc)[_0x4851('0x18')]();});}};}function handleEntityNotFound(_0x36e5fb,_0x79d9b4){return function(_0x207cd2){if(!_0x207cd2){_0x36e5fb[_0x4851('0x27')](0x194);}return _0x207cd2;};}function handleError(_0x4dc353,_0x2aad9c){_0x2aad9c=_0x2aad9c||0x1f4;return function(_0x59230e){logger[_0x4851('0x28')](_0x59230e[_0x4851('0x29')]);if(_0x59230e[_0x4851('0x2a')]){delete _0x59230e['name'];}_0x4dc353[_0x4851('0x17')](_0x2aad9c)['send'](_0x59230e);};}exports[_0x4851('0x2b')]=function(_0x3e475b,_0x11f6da){var _0x344acb={},_0x3f3da0={},_0x39b9d7={'count':0x0,'rows':[]};var _0x12fe16=_[_0x4851('0x2c')](db[_0x4851('0x2d')][_0x4851('0x2e')],function(_0x4858fa){return{'name':_0x4858fa[_0x4851('0x2f')],'type':_0x4858fa[_0x4851('0x30')][_0x4851('0x31')]};});_0x3f3da0[_0x4851('0x32')]=_[_0x4851('0x2c')](_0x12fe16,'name');_0x3f3da0[_0x4851('0x33')]=_[_0x4851('0x34')](_0x3e475b[_0x4851('0x33')]);_0x3f3da0[_0x4851('0x35')]=_[_0x4851('0x36')](_0x3f3da0['model'],_0x3f3da0[_0x4851('0x33')]);_0x344acb[_0x4851('0x37')]=_[_0x4851('0x36')](_0x3f3da0[_0x4851('0x32')],qs['fields'](_0x3e475b[_0x4851('0x33')]['fields']));_0x344acb[_0x4851('0x37')]=_0x344acb['attributes'][_0x4851('0x38')]?_0x344acb[_0x4851('0x37')]:_0x3f3da0['model'];if(!_0x3e475b[_0x4851('0x33')][_0x4851('0x39')](_0x4851('0x3a'))){_0x344acb[_0x4851('0x1c')]=qs[_0x4851('0x1c')](_0x3e475b[_0x4851('0x33')][_0x4851('0x1c')]);_0x344acb[_0x4851('0x1b')]=qs[_0x4851('0x1b')](_0x3e475b['query'][_0x4851('0x1b')]);}_0x344acb[_0x4851('0x3b')]=qs[_0x4851('0x3c')](_0x3e475b[_0x4851('0x33')][_0x4851('0x3c')]);_0x344acb[_0x4851('0x3d')]=qs[_0x4851('0x35')](_[_0x4851('0x3e')](_0x3e475b[_0x4851('0x33')],_0x3f3da0[_0x4851('0x35')]));if(_0x3e475b[_0x4851('0x33')]['filter']){_0x344acb[_0x4851('0x3d')]=_['merge'](_0x344acb[_0x4851('0x3d')],{'$or':_[_0x4851('0x2c')](_0x12fe16,function(_0x209c3b){if(_0x209c3b[_0x4851('0x30')]!==_0x4851('0x3f')){var _0x22aacb={};_0x22aacb[_0x209c3b[_0x4851('0x2a')]]={'$like':'%'+_0x3e475b[_0x4851('0x33')][_0x4851('0x40')]+'%'};return _0x22aacb;}})});}_0x344acb=_[_0x4851('0x41')]({},_0x344acb,_0x3e475b[_0x4851('0x42')]);var _0x4cf709={'where':_0x344acb['where']};return db[_0x4851('0x2d')][_0x4851('0x1a')](_0x4cf709)[_0x4851('0x23')](function(_0x481564){_0x39b9d7['count']=_0x481564;if(_0x3e475b[_0x4851('0x33')][_0x4851('0x43')]){_0x344acb['include']=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x4851('0x44')](_0x344acb);})['then'](function(_0x4b0f68){_0x39b9d7['rows']=_0x4b0f68;return _0x39b9d7;})[_0x4851('0x23')](respondWithFilteredResult(_0x11f6da,_0x344acb))[_0x4851('0x45')](handleError(_0x11f6da,null));};exports[_0x4851('0x46')]=function(_0x5cd5d9,_0x5b9bcb){var _0x572d14={'raw':![],'where':{'id':_0x5cd5d9[_0x4851('0x47')]['id']}},_0x5fafac={};_0x5fafac[_0x4851('0x32')]=_[_0x4851('0x34')](db[_0x4851('0x2d')][_0x4851('0x2e')]);_0x5fafac[_0x4851('0x33')]=_[_0x4851('0x34')](_0x5cd5d9[_0x4851('0x33')]);_0x5fafac['filters']=_['intersection'](_0x5fafac[_0x4851('0x32')],_0x5fafac[_0x4851('0x33')]);_0x572d14[_0x4851('0x37')]=_[_0x4851('0x36')](_0x5fafac['model'],qs[_0x4851('0x48')](_0x5cd5d9[_0x4851('0x33')][_0x4851('0x48')]));_0x572d14[_0x4851('0x37')]=_0x572d14[_0x4851('0x37')][_0x4851('0x38')]?_0x572d14['attributes']:_0x5fafac[_0x4851('0x32')];if(_0x5cd5d9['query']['includeAll']){_0x572d14[_0x4851('0x49')]=[{'all':!![]}];}_0x572d14=_[_0x4851('0x41')]({},_0x572d14,_0x5cd5d9[_0x4851('0x42')]);return db[_0x4851('0x2d')]['find'](_0x572d14)[_0x4851('0x23')](handleEntityNotFound(_0x5b9bcb,null))[_0x4851('0x23')](respondWithResult(_0x5b9bcb,null))[_0x4851('0x45')](handleError(_0x5b9bcb,null));};exports['create']=function(_0x1f036b,_0x44cb77){return db['AnalyticCustomReport'][_0x4851('0x4a')](_0x1f036b[_0x4851('0x4b')],{})[_0x4851('0x23')](function(_0x3d81cc){var _0xb77bc2=_0x1f036b['user'][_0x4851('0x24')]({'plain':!![]});if(!_0xb77bc2)throw new Error(_0x4851('0x4c'));if(_0xb77bc2[_0x4851('0x4d')]===_0x4851('0x4e')){var _0x37ef60=_0x3d81cc[_0x4851('0x24')]({'plain':!![]});var _0xa4b1d7=_0x4851('0x4f');return db['UserProfileSection']['find']({'where':{'name':_0xa4b1d7,'userProfileId':_0xb77bc2[_0x4851('0x50')]},'raw':!![]})[_0x4851('0x23')](function(_0x4a5a59){if(_0x4a5a59&&_0x4a5a59[_0x4851('0x51')]===0x0){return db[_0x4851('0x26')]['create']({'name':_0x37ef60['name'],'resourceId':_0x37ef60['id'],'type':_0x4851('0x25'),'sectionId':_0x4a5a59['id']},{})[_0x4851('0x23')](function(){return _0x3d81cc;});}else{return _0x3d81cc;}})[_0x4851('0x45')](function(_0x48030f){logger[_0x4851('0x28')](_0x4851('0x52'),_0x48030f);throw _0x48030f;});}return _0x3d81cc;})['then'](respondWithResult(_0x44cb77,0xc9))['catch'](handleError(_0x44cb77,null));};exports[_0x4851('0x53')]=function(_0x394026,_0x3cdde3){if(_0x394026[_0x4851('0x4b')]['id']){delete _0x394026[_0x4851('0x4b')]['id'];}return db['AnalyticCustomReport'][_0x4851('0x54')]({'where':{'id':_0x394026[_0x4851('0x47')]['id']}})['then'](handleEntityNotFound(_0x3cdde3,null))[_0x4851('0x23')](saveUpdates(_0x394026[_0x4851('0x4b')],null))[_0x4851('0x23')](respondWithResult(_0x3cdde3,null))[_0x4851('0x45')](handleError(_0x3cdde3,null));};exports[_0x4851('0x22')]=function(_0x114f8c,_0x92d105){return db[_0x4851('0x2d')][_0x4851('0x54')]({'where':{'id':_0x114f8c[_0x4851('0x47')]['id']}})[_0x4851('0x23')](handleEntityNotFound(_0x92d105,null))[_0x4851('0x23')](removeEntity(_0x92d105,null))[_0x4851('0x45')](handleError(_0x92d105,null));};exports[_0x4851('0x55')]=function(_0xed1a39,_0x2c6f4c){var _0x31c329=0xa;var _0x2446d2=[_0x4851('0x56'),_0x4851('0x57'),_0x4851('0x58'),_0x4851('0x59')];var _0x2da794={'SUM':_0x4851('0x5a'),'COUNT':_0x4851('0x5b'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x4851('0x5c'),'MIN':_0x4851('0x5d'),'AVG':_0x4851('0x5e'),'GROUP_CONCAT':_0x4851('0x5f'),'GROUP_CONCAT ASC':_0x4851('0x60'),'GROUP_CONCAT DESC':_0x4851('0x61')};var _0x11688a={'SEC_TO_TIME':_0x4851('0x62'),'DATE':_0x4851('0x63'),'HOUR':'HOUR(%s)','ROUND':_0x4851('0x64'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x31d9a4=function(_0x2d3d9a){return!_[_0x4851('0x65')]([_0x4851('0x66'),_0x4851('0x67'),_0x4851('0x68'),_0x4851('0x69')],_0x2d3d9a);};var _0x5e6d63=function(_0x1a6f85){if(!_0x1a6f85||!_0x1a6f85[_0x4851('0x6a')][_0x4851('0x38')]){return'';}for(var _0x21689b='(',_0x3d076e=0x0;_0x3d076e<_0x1a6f85[_0x4851('0x6a')][_0x4851('0x38')];_0x3d076e+=0x1){_0x3d076e>0x0&&(_0x21689b+='\x20'+_0x1a6f85['operator']+'\x20');_0x21689b+=_0x1a6f85[_0x4851('0x6a')][_0x3d076e][_0x4851('0x6b')]?_0x5e6d63(_0x1a6f85[_0x4851('0x6a')][_0x3d076e][_0x4851('0x6b')]):_0x1a6f85[_0x4851('0x6a')][_0x3d076e][_0x4851('0x6c')]+'\x20'+_0x1a6f85[_0x4851('0x6a')][_0x3d076e][_0x4851('0x6d')]+(_0x31d9a4(_0x1a6f85[_0x4851('0x6a')][_0x3d076e][_0x4851('0x6d')])?'\x20'+_0x1a6f85[_0x4851('0x6a')][_0x3d076e][_0x4851('0x6e')]:'');}return _0x21689b+')';};var _0x27798e={'where':{'id':_0xed1a39['params']['id']}},_0x3ee75d,_0x15ad30,_0x18660a,_0x313560,_0x17612a;_0x27798e=_[_0x4851('0x41')]({},_0x27798e,_0xed1a39[_0x4851('0x42')]);return db[_0x4851('0x2d')][_0x4851('0x54')](_0x27798e)[_0x4851('0x23')](function(_0x49af24){if(_0x49af24){_0x3ee75d=_0x49af24;return _0x49af24[_0x4851('0x6f')]();}return null;})[_0x4851('0x23')](function(_0x31fe77){if(_0x31fe77){if(!_0x31fe77[_0x4851('0x38')]){throw new db[(_0x4851('0x70'))][(_0x4851('0x71'))](_0x4851('0x72'),0x193);}_0x15ad30=_0x31fe77;return db[_0x4851('0x73')][_0x4851('0x44')]({'raw':!![]});}return null;})[_0x4851('0x23')](function(_0x40c71a){if(_0x40c71a){_0x18660a=_[_0x4851('0x74')](_0x40c71a,'id');var _0x20b1d;var _0x39e4b0=squel[_0x4851('0x75')]();_0x39e4b0[_0x4851('0x76')](_0x3ee75d[_0x4851('0x77')]);for(var _0x1372ab=0x0;_0x1372ab<_0x15ad30[_0x4851('0x38')];_0x1372ab+=0x1){_0x20b1d=_0x15ad30[_0x1372ab][_0x4851('0x78')]?_0x18660a[_0x15ad30[_0x1372ab][_0x4851('0x78')]][_0x4851('0x79')]:_0x15ad30[_0x1372ab][_0x4851('0x6c')];_0x20b1d=_0x15ad30[_0x1372ab]['function']?_['replace'](_0x2da794[_0x15ad30[_0x1372ab][_0x4851('0x7a')]],'%s',_0x20b1d):_0x20b1d;_0x20b1d=_0x15ad30[_0x1372ab][_0x4851('0x7b')]?_[_0x4851('0x7c')](_0x11688a[_0x15ad30[_0x1372ab]['format']],'%s',_0x20b1d):_0x20b1d;if(_0x15ad30[_0x1372ab]['groupBy']){_0x39e4b0[_0x4851('0x6b')](_0x20b1d);}_0x15ad30[_0x1372ab][_0x4851('0x7d')]&&_0x39e4b0['order'](_0x20b1d,_0x15ad30[_0x1372ab][_0x4851('0x7d')]===_0x4851('0x7e')?![]:!![]);_0x39e4b0[_0x4851('0x6c')](_0x20b1d,_0x15ad30[_0x1372ab][_0x4851('0x7f')]||_0x20b1d);}if(_0x3ee75d[_0x4851('0x80')]){_0x3ee75d[_0x4851('0x80')]=JSON[_0x4851('0x81')](_0x3ee75d['joins']);for(var _0x59e165=0x0;_0x59e165<_0x3ee75d[_0x4851('0x80')]['length'];_0x59e165+=0x1){if(_0x3ee75d[_0x4851('0x80')][_0x59e165][_0x4851('0x30')]&&_[_0x4851('0x65')](_0x2446d2,_0x3ee75d[_0x4851('0x80')][_0x59e165][_0x4851('0x30')])&&_0x3ee75d[_0x4851('0x80')][_0x59e165][_0x4851('0x82')]&&_0x3ee75d['joins'][_0x59e165][_0x4851('0x83')]&&_0x3ee75d['joins'][_0x59e165][_0x4851('0x84')]){_0x39e4b0[_0x3ee75d[_0x4851('0x80')][_0x59e165][_0x4851('0x30')]](_0x3ee75d['joins'][_0x59e165][_0x4851('0x83')],null,util[_0x4851('0x7b')](_0x4851('0x85'),_0x3ee75d['table'],_0x3ee75d[_0x4851('0x80')][_0x59e165][_0x4851('0x82')],_0x3ee75d[_0x4851('0x80')][_0x59e165][_0x4851('0x83')],_0x3ee75d['joins'][_0x59e165][_0x4851('0x84')]));}}}if(_0x3ee75d[_0x4851('0x86')]){_0x3ee75d[_0x4851('0x86')]=JSON['parse'](_0x3ee75d[_0x4851('0x86')]);_0x39e4b0[_0x4851('0x3d')](_0x5e6d63(_0x3ee75d[_0x4851('0x86')]['group']));}_0x17612a=_0x39e4b0[_0x4851('0x87')]();_0x39e4b0[_0x4851('0x1c')](_0x31c329);_0x39e4b0['offset'](0x0);logger[_0x4851('0x88')](_0x4851('0x89'),_0x39e4b0[_0x4851('0x8a')]());return db[_0x4851('0x8b')]['query'](_0x39e4b0['toString'](),{'type':db['sequelize'][_0x4851('0x8c')][_0x4851('0x8d')]});}})[_0x4851('0x23')](respondWithResult(_0x2c6f4c,null))[_0x4851('0x45')](handleError(_0x2c6f4c,null));};function runReport(_0x38288d,_0x546db8,_0x4a7239){var _0x2f3a40=_0x546db8[_0x4851('0x2a')];var _0x2bfe56=0xa;var _0x19d051=[_0x4851('0x56'),_0x4851('0x57'),'right_join',_0x4851('0x59')];var _0x5cf18d={'SUM':_0x4851('0x5a'),'COUNT':_0x4851('0x5b'),'COUNT DISTINCT':_0x4851('0x8e'),'MAX':_0x4851('0x5c'),'MIN':'MIN(%s)','AVG':_0x4851('0x5e'),'GROUP_CONCAT':_0x4851('0x5f'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4851('0x61')};var _0xaa1304={'SEC_TO_TIME':_0x4851('0x62'),'DATE':_0x4851('0x63'),'HOUR':'HOUR(%s)','ROUND':_0x4851('0x64'),'UNIX_TIMESTAMP':_0x4851('0x8f')};var _0x277646=function(_0x2fd4b1){return!_['includes']([_0x4851('0x66'),'IS\x20NOT\x20NULL',_0x4851('0x68'),'IS\x20NOT\x20EMPTY'],_0x2fd4b1);};var _0x225285=function(_0xd5f74d){if(!_0xd5f74d||!_0xd5f74d['rules']['length']){return'';}for(var _0x338084='(',_0x2c7380=0x0;_0x2c7380<_0xd5f74d[_0x4851('0x6a')][_0x4851('0x38')];_0x2c7380+=0x1){_0x2c7380>0x0&&(_0x338084+='\x20'+_0xd5f74d[_0x4851('0x90')]+'\x20');_0x338084+=_0xd5f74d[_0x4851('0x6a')][_0x2c7380][_0x4851('0x6b')]?_0x225285(_0xd5f74d[_0x4851('0x6a')][_0x2c7380][_0x4851('0x6b')]):_0xd5f74d['rules'][_0x2c7380][_0x4851('0x6c')]+'\x20'+_0xd5f74d[_0x4851('0x6a')][_0x2c7380][_0x4851('0x6d')]+(_0x277646(_0xd5f74d[_0x4851('0x6a')][_0x2c7380][_0x4851('0x6d')])?'\x20'+_0xd5f74d[_0x4851('0x6a')][_0x2c7380]['value']:'');}return _0x338084+')';};var _0x3f0a84={'where':{'id':_0x38288d['id']}},_0x21cffe,_0x586aef,_0x27225f,_0x32675b,_0x22e2da;_0x3f0a84=_[_0x4851('0x41')]({},_0x3f0a84,_0x4a7239);return db['AnalyticCustomReport'][_0x4851('0x54')](_0x3f0a84)['then'](function(_0x2549bf){if(_0x2549bf){_0x21cffe=_0x2549bf;return _0x2549bf[_0x4851('0x6f')]();}return null;})[_0x4851('0x23')](function(_0x35c9fa){if(_0x35c9fa){if(!_0x35c9fa[_0x4851('0x38')]){throw new db['Sequelize']['ValidationErrorItem'](_0x4851('0x72'),0x193);}_0x586aef=_0x35c9fa;return db['AnalyticMetric'][_0x4851('0x44')]({'raw':!![]});}return null;})[_0x4851('0x23')](function(_0x1bee6d){if(_0x1bee6d){_0x27225f=_[_0x4851('0x74')](_0x1bee6d,'id');var _0x926bb9;var _0x46fa01=squel[_0x4851('0x75')]();_0x46fa01[_0x4851('0x76')](_0x21cffe['table']);for(var _0x55e621=0x0;_0x55e621<_0x586aef[_0x4851('0x38')];_0x55e621+=0x1){_0x926bb9=_0x586aef[_0x55e621][_0x4851('0x78')]?_0x27225f[_0x586aef[_0x55e621]['MetricId']][_0x4851('0x79')]:_0x586aef[_0x55e621][_0x4851('0x6c')];_0x926bb9=_0x586aef[_0x55e621][_0x4851('0x7a')]?_[_0x4851('0x7c')](_0x5cf18d[_0x586aef[_0x55e621]['function']],'%s',_0x926bb9):_0x926bb9;_0x926bb9=_0x586aef[_0x55e621][_0x4851('0x7b')]?_[_0x4851('0x7c')](_0xaa1304[_0x586aef[_0x55e621][_0x4851('0x7b')]],'%s',_0x926bb9):_0x926bb9;if(_0x586aef[_0x55e621][_0x4851('0x91')]){_0x46fa01[_0x4851('0x6b')](_0x926bb9);}_0x586aef[_0x55e621][_0x4851('0x7d')]&&_0x46fa01[_0x4851('0x3b')](_0x926bb9,_0x586aef[_0x55e621][_0x4851('0x7d')]===_0x4851('0x7e')?![]:!![]);_0x46fa01[_0x4851('0x6c')](_0x926bb9,_0x586aef[_0x55e621][_0x4851('0x7f')]||_0x926bb9);}if(_0x21cffe[_0x4851('0x80')]){_0x21cffe[_0x4851('0x80')]=JSON['parse'](_0x21cffe['joins']);for(var _0x2bf446=0x0;_0x2bf446<_0x21cffe[_0x4851('0x80')][_0x4851('0x38')];_0x2bf446+=0x1){if(_0x21cffe[_0x4851('0x80')][_0x2bf446][_0x4851('0x30')]&&_[_0x4851('0x65')](_0x19d051,_0x21cffe[_0x4851('0x80')][_0x2bf446][_0x4851('0x30')])&&_0x21cffe[_0x4851('0x80')][_0x2bf446][_0x4851('0x82')]&&_0x21cffe['joins'][_0x2bf446]['foreignTable']&&_0x21cffe['joins'][_0x2bf446]['foreignKey']){_0x46fa01[_0x21cffe[_0x4851('0x80')][_0x2bf446][_0x4851('0x30')]](_0x21cffe['joins'][_0x2bf446][_0x4851('0x83')],null,util[_0x4851('0x7b')](_0x4851('0x85'),_0x21cffe[_0x4851('0x77')],_0x21cffe['joins'][_0x2bf446][_0x4851('0x82')],_0x21cffe[_0x4851('0x80')][_0x2bf446]['foreignTable'],_0x21cffe[_0x4851('0x80')][_0x2bf446][_0x4851('0x84')]));}}}if(_0x21cffe[_0x4851('0x86')]){_0x21cffe[_0x4851('0x86')]=JSON[_0x4851('0x81')](_0x21cffe[_0x4851('0x86')]);_0x46fa01[_0x4851('0x3d')](_0x225285(_0x21cffe[_0x4851('0x86')][_0x4851('0x6b')]));}_0x22e2da=_0x46fa01['clone']();_0x46fa01[_0x4851('0x1c')](_0x2bfe56);_0x46fa01[_0x4851('0x1b')](0x0);logger[_0x4851('0x88')](_0x4851('0x89'),_0x46fa01[_0x4851('0x8a')]());return db[_0x4851('0x8b')][_0x4851('0x33')](_0x46fa01[_0x4851('0x8a')](),{'type':db['sequelize'][_0x4851('0x8c')]['SELECT']});}})[_0x4851('0x23')](function(_0x2be4d3){if(!_0x2be4d3[_0x4851('0x38')]){throw new db[(_0x4851('0x70'))][(_0x4851('0x71'))](_0x4851('0x92'),0xcc);}if(_0x546db8['output']===_0x4851('0x93')){return null;}var _0x5260a8=_[_0x4851('0x41')](_0x546db8,{'name':_0x546db8[_0x4851('0x94')]||_0x546db8[_0x4851('0x2a')]||_0x21cffe['name'],'basename':_0x2f3a40,'savename':util[_0x4851('0x7b')](_0x4851('0x95'),_0x546db8['name']||_0x21cffe[_0x4851('0x2a')],require(_0x4851('0x96'))[_0x4851('0x97')](0x4),_0x546db8[_0x4851('0x98')]||'csv'),'reportId':_0x21cffe['id'],'reportType':_0x4851('0x99')});return db[_0x4851('0x9a')][_0x4851('0x4a')](_0x5260a8,{'raw':!![]});})['then'](function(_0x6a6d55){if(_0x21cffe[_0x4851('0x77')]===_0x4851('0x9b')){_0x22e2da[_0x4851('0x3d')](_0x21cffe['table']+_0x4851('0x9c'),_0x546db8[_0x4851('0x9d')],_0x546db8[_0x4851('0x9e')]);}else{_0x22e2da['where'](_0x21cffe['table']+_0x4851('0x9f'),_0x546db8[_0x4851('0x9d')],_0x546db8[_0x4851('0x9e')]);}if(_0x6a6d55){logger[_0x4851('0xa0')]('Run\x20Query:',_0x22e2da[_0x4851('0x8a')]());require(_0x4851('0xa1'))[_0x4851('0xa2')](path[_0x4851('0x56')](__dirname,'../../components/export/',_0x6a6d55[_0x4851('0x98')]),[_0x6a6d55['id'],_0x22e2da['toString'](),path['join'](__dirname,_0x4851('0xa3'),_0x6a6d55[_0x4851('0xa4')]),_0x2f3a40]);return _0x6a6d55;}else{var _0x2ee5f6=squel[_0x4851('0x75')]();_0x2ee5f6[_0x4851('0x76')]('('+_0x22e2da[_0x4851('0x8a')]()+')',_0x4851('0xa5'));_0x2ee5f6[_0x4851('0x6c')](_0x4851('0xa6'),'count');_0x22e2da[_0x4851('0x1c')](_0x546db8['limit']||_0x2bfe56);_0x22e2da[_0x4851('0x1b')](_0x546db8[_0x4851('0x1b')]||0x0);return db[_0x4851('0x8b')][_0x4851('0x33')](_0x2ee5f6['toString'](),{'type':db['sequelize']['QueryTypes'][_0x4851('0x8d')]})['then'](function(_0xb67b25){if(!_0xb67b25[_0x4851('0x38')]){_0x32675b=0x0;}else{_0x32675b=_0xb67b25[0x0][_0x4851('0x1a')]||0x0;}return db['sequelize'][_0x4851('0x33')](_0x22e2da[_0x4851('0x8a')](),{'type':db[_0x4851('0x8b')][_0x4851('0x8c')][_0x4851('0x8d')]});})[_0x4851('0x23')](function(_0x14a678){return{'rows':_0x14a678||[],'count':_0x32675b};});}});}exports['run']=function(_0xf73cdc,_0x360f99){return runReport(_0xf73cdc[_0x4851('0x47')],_0xf73cdc[_0x4851('0x33')],_0xf73cdc['options'])[_0x4851('0x23')](respondWithResult(_0x360f99,null))[_0x4851('0x45')](handleError(_0x360f99,null));};exports[_0x4851('0xa7')]=runReport;exports[_0x4851('0x33')]=function(_0x128bb3,_0x2254d2){var _0xf6abfa=0xa;var _0x5b6f9d=[_0x4851('0x56'),_0x4851('0x57'),_0x4851('0x58'),_0x4851('0x59')];var _0x243e83={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4851('0x8e'),'MAX':_0x4851('0x5c'),'MIN':_0x4851('0x5d'),'AVG':_0x4851('0x5e'),'GROUP_CONCAT':_0x4851('0x5f'),'GROUP_CONCAT ASC':_0x4851('0x60'),'GROUP_CONCAT DESC':_0x4851('0x61')};var _0x3bea12={'SEC_TO_TIME':_0x4851('0x62'),'DATE':_0x4851('0x63'),'HOUR':_0x4851('0xa8'),'ROUND':_0x4851('0x64'),'UNIX_TIMESTAMP':_0x4851('0x8f')};var _0x3e23cc=function(_0x31174d){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0x4851('0x68'),_0x4851('0x69')],_0x31174d);};var _0x7226ac=function(_0xe0b604){if(!_0xe0b604||!_0xe0b604[_0x4851('0x6a')][_0x4851('0x38')]){return'';}for(var _0x28cbf9='(',_0x1bc9c8=0x0;_0x1bc9c8<_0xe0b604[_0x4851('0x6a')][_0x4851('0x38')];_0x1bc9c8+=0x1){_0x1bc9c8>0x0&&(_0x28cbf9+='\x20'+_0xe0b604[_0x4851('0x90')]+'\x20');_0x28cbf9+=_0xe0b604[_0x4851('0x6a')][_0x1bc9c8]['group']?_0x7226ac(_0xe0b604[_0x4851('0x6a')][_0x1bc9c8][_0x4851('0x6b')]):_0xe0b604[_0x4851('0x6a')][_0x1bc9c8][_0x4851('0x6c')]+'\x20'+_0xe0b604[_0x4851('0x6a')][_0x1bc9c8][_0x4851('0x6d')]+(_0x3e23cc(_0xe0b604[_0x4851('0x6a')][_0x1bc9c8][_0x4851('0x6d')])?'\x20'+_0xe0b604[_0x4851('0x6a')][_0x1bc9c8]['value']:'');}return _0x28cbf9+')';};var _0x1423ef={'where':{'id':_0x128bb3[_0x4851('0x47')]['id']}},_0xfc2874,_0x4b669b,_0x3855b2,_0xcf3c24,_0x56be07;_0x1423ef=_[_0x4851('0x41')]({},_0x1423ef,_0x128bb3[_0x4851('0x42')]);return db[_0x4851('0x2d')]['find'](_0x1423ef)[_0x4851('0x23')](function(_0x51f8d0){if(_0x51f8d0){_0xfc2874=_0x51f8d0;return _0x51f8d0['getFields']();}return null;})[_0x4851('0x23')](function(_0x512fcb){if(_0x512fcb){if(!_0x512fcb[_0x4851('0x38')]){throw new db['Sequelize'][(_0x4851('0x71'))](_0x4851('0x72'),0x193);}_0x4b669b=_0x512fcb;return db[_0x4851('0x73')][_0x4851('0x44')]({'raw':!![]});}return null;})['then'](function(_0x42bb90){if(_0x42bb90){_0x3855b2=_[_0x4851('0x74')](_0x42bb90,'id');var _0x2e8451;var _0x4d7226=squel['select']();_0x4d7226[_0x4851('0x76')](_0xfc2874['table']);for(var _0x5e814d=0x0;_0x5e814d<_0x4b669b['length'];_0x5e814d+=0x1){_0x2e8451=_0x4b669b[_0x5e814d][_0x4851('0x78')]?_0x3855b2[_0x4b669b[_0x5e814d][_0x4851('0x78')]][_0x4851('0x79')]:_0x4b669b[_0x5e814d]['field'];_0x2e8451=_0x4b669b[_0x5e814d]['function']?_[_0x4851('0x7c')](_0x243e83[_0x4b669b[_0x5e814d][_0x4851('0x7a')]],'%s',_0x2e8451):_0x2e8451;_0x2e8451=_0x4b669b[_0x5e814d][_0x4851('0x7b')]?_[_0x4851('0x7c')](_0x3bea12[_0x4b669b[_0x5e814d]['format']],'%s',_0x2e8451):_0x2e8451;if(_0x4b669b[_0x5e814d]['groupBy']){_0x4d7226[_0x4851('0x6b')](_0x2e8451);}_0x4b669b[_0x5e814d][_0x4851('0x7d')]&&_0x4d7226[_0x4851('0x3b')](_0x2e8451,_0x4b669b[_0x5e814d][_0x4851('0x7d')]===_0x4851('0x7e')?![]:!![]);_0x4d7226[_0x4851('0x6c')](_0x2e8451,_0x4b669b[_0x5e814d][_0x4851('0x7f')]||_0x2e8451);}if(_0xfc2874['joins']){_0xfc2874[_0x4851('0x80')]=JSON['parse'](_0xfc2874['joins']);for(var _0x4a738a=0x0;_0x4a738a<_0xfc2874['joins'][_0x4851('0x38')];_0x4a738a+=0x1){if(_0xfc2874[_0x4851('0x80')][_0x4a738a][_0x4851('0x30')]&&_['includes'](_0x5b6f9d,_0xfc2874['joins'][_0x4a738a][_0x4851('0x30')])&&_0xfc2874['joins'][_0x4a738a][_0x4851('0x82')]&&_0xfc2874[_0x4851('0x80')][_0x4a738a][_0x4851('0x83')]&&_0xfc2874['joins'][_0x4a738a]['foreignKey']){_0x4d7226[_0xfc2874[_0x4851('0x80')][_0x4a738a][_0x4851('0x30')]](_0xfc2874['joins'][_0x4a738a][_0x4851('0x83')],null,util[_0x4851('0x7b')](_0x4851('0x85'),_0xfc2874[_0x4851('0x77')],_0xfc2874['joins'][_0x4a738a][_0x4851('0x82')],_0xfc2874['joins'][_0x4a738a]['foreignTable'],_0xfc2874['joins'][_0x4a738a][_0x4851('0x84')]));}}}if(_0xfc2874[_0x4851('0x86')]){_0xfc2874[_0x4851('0x86')]=JSON['parse'](_0xfc2874[_0x4851('0x86')]);_0x4d7226[_0x4851('0x3d')](_0x7226ac(_0xfc2874['conditions'][_0x4851('0x6b')]));}_0x56be07=_0x4d7226[_0x4851('0x87')]();_0x4d7226[_0x4851('0x1c')](_0xf6abfa);_0x4d7226[_0x4851('0x1b')](0x0);logger[_0x4851('0x88')](_0x4851('0x89'),_0x4d7226[_0x4851('0x8a')]());return db[_0x4851('0x8b')][_0x4851('0x33')](_0x4d7226['toString'](),{'type':db['sequelize'][_0x4851('0x8c')][_0x4851('0x8d')]});}})[_0x4851('0x23')](function(){return{'sql':_0x56be07[_0x4851('0x8a')]()};})[_0x4851('0x23')](respondWithResult(_0x2254d2,null))[_0x4851('0x45')](handleError(_0x2254d2,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 4f7a6c5..8edcd09 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 _0xdf8f=['exports','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','bluebird','path','rimraf','./analyticCustomReport.attributes'];(function(_0x28bc89,_0x1edcd4){var _0x31aaa2=function(_0x3182a8){while(--_0x3182a8){_0x28bc89['push'](_0x28bc89['shift']());}};_0x31aaa2(++_0x1edcd4);}(_0xdf8f,0x14d));var _0xfdf8=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xdf8f[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xfdf8('0x0'));var util=require(_0xfdf8('0x1'));var logger=require(_0xfdf8('0x2'))(_0xfdf8('0x3'));var moment=require('moment');var BPromise=require(_0xfdf8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfdf8('0x5'));var rimraf=require(_0xfdf8('0x6'));var config=require('../../config/environment');var attributes=require(_0xfdf8('0x7'));module[_0xfdf8('0x8')]=function(_0x163022,_0x45c1f0){return _0x163022['define'](_0xfdf8('0x9'),attributes,{'tableName':_0xfdf8('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6cd6=['analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport'];(function(_0x1faae6,_0x31ed93){var _0x3db258=function(_0x4baff3){while(--_0x4baff3){_0x1faae6['push'](_0x1faae6['shift']());}};_0x3db258(++_0x31ed93);}(_0x6cd6,0xb7));var _0x66cd=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x6cd6[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x66cd('0x0'));var util=require(_0x66cd('0x1'));var logger=require(_0x66cd('0x2'))(_0x66cd('0x3'));var moment=require(_0x66cd('0x4'));var BPromise=require(_0x66cd('0x5'));var rp=require(_0x66cd('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x66cd('0x7'));var config=require(_0x66cd('0x8'));var attributes=require(_0x66cd('0x9'));module[_0x66cd('0xa')]=function(_0x40c512,_0x22584d){return _0x40c512[_0x66cd('0xb')](_0x66cd('0xc'),attributes,{'tableName':_0x66cd('0xd'),'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 258857d..fa117ac 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 _0xd662=['info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticCustomReport,\x20%s,\x20%s','message'];(function(_0x10355a,_0x5ab3b9){var _0x3481ba=function(_0x271719){while(--_0x271719){_0x10355a['push'](_0x10355a['shift']());}};_0x3481ba(++_0x5ab3b9);}(_0xd662,0x85));var _0x2d66=function(_0x49a655,_0x1ca0b3){_0x49a655=_0x49a655-0x0;var _0x2d513c=_0xd662[_0x49a655];return _0x2d513c;};'use strict';var _=require(_0x2d66('0x0'));var util=require(_0x2d66('0x1'));var moment=require(_0x2d66('0x2'));var BPromise=require(_0x2d66('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2d66('0x4'));var db=require(_0x2d66('0x5'))['db'];var utils=require(_0x2d66('0x6'));var logger=require(_0x2d66('0x7'))(_0x2d66('0x8'));var config=require(_0x2d66('0x9'));var jayson=require(_0x2d66('0xa'));var client=jayson[_0x2d66('0xb')][_0x2d66('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x55eb0e,_0x2a6fc9,_0x11e5f2){return new BPromise(function(_0x50483e,_0x3b1799){return client[_0x2d66('0xd')](_0x55eb0e,_0x11e5f2)[_0x2d66('0xe')](function(_0x564095){logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x2a6fc9,_0x2d66('0xf'));logger[_0x2d66('0x10')](_0x2d66('0x11'),_0x2a6fc9,_0x2d66('0xf'),JSON[_0x2d66('0x12')](_0x564095));if(_0x564095[_0x2d66('0x13')]){if(_0x564095[_0x2d66('0x13')][_0x2d66('0x14')]===0x1f4){logger['error'](_0x2d66('0x15'),_0x2a6fc9,_0x564095[_0x2d66('0x13')][_0x2d66('0x16')]);return _0x3b1799(_0x564095[_0x2d66('0x13')][_0x2d66('0x16')]);}logger[_0x2d66('0x13')](_0x2d66('0x15'),_0x2a6fc9,_0x564095['error']['message']);return _0x50483e(_0x564095[_0x2d66('0x13')][_0x2d66('0x16')]);}else{logger[_0x2d66('0x17')](_0x2d66('0x15'),_0x2a6fc9,_0x2d66('0xf'));_0x50483e(_0x564095[_0x2d66('0x18')][_0x2d66('0x16')]);}})[_0x2d66('0x19')](function(_0x446012){logger[_0x2d66('0x13')](_0x2d66('0x15'),_0x2a6fc9,_0x446012);_0x3b1799(_0x446012);});});} \ No newline at end of file +var _0x06f2=['request','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2ed6c9,_0x21994f){var _0x28557c=function(_0xbc92fa){while(--_0xbc92fa){_0x2ed6c9['push'](_0x2ed6c9['shift']());}};_0x28557c(++_0x21994f);}(_0x06f2,0x96));var _0x206f=function(_0x23d097,_0x49881d){_0x23d097=_0x23d097-0x0;var _0x476197=_0x06f2[_0x23d097];return _0x476197;};'use strict';var _=require('lodash');var util=require(_0x206f('0x0'));var moment=require(_0x206f('0x1'));var BPromise=require(_0x206f('0x2'));var rs=require(_0x206f('0x3'));var fs=require('fs');var Redis=require(_0x206f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x206f('0x5'));var logger=require(_0x206f('0x6'))(_0x206f('0x7'));var config=require(_0x206f('0x8'));var jayson=require(_0x206f('0x9'));var client=jayson['client'][_0x206f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x518619,_0x2b336d,_0x16bbfd){return new BPromise(function(_0x3c23c0,_0x3c4b73){return client[_0x206f('0xb')](_0x518619,_0x16bbfd)[_0x206f('0xc')](function(_0x394ec6){logger['info'](_0x206f('0xd'),_0x2b336d,_0x206f('0xe'));logger[_0x206f('0xf')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x2b336d,_0x206f('0xe'),JSON[_0x206f('0x10')](_0x394ec6));if(_0x394ec6[_0x206f('0x11')]){if(_0x394ec6[_0x206f('0x11')][_0x206f('0x12')]===0x1f4){logger[_0x206f('0x11')](_0x206f('0xd'),_0x2b336d,_0x394ec6['error']['message']);return _0x3c4b73(_0x394ec6[_0x206f('0x11')]['message']);}logger[_0x206f('0x11')](_0x206f('0xd'),_0x2b336d,_0x394ec6[_0x206f('0x11')][_0x206f('0x13')]);return _0x3c23c0(_0x394ec6[_0x206f('0x11')]['message']);}else{logger[_0x206f('0x14')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2b336d,'request\x20sent');_0x3c23c0(_0x394ec6[_0x206f('0x15')][_0x206f('0x13')]);}})[_0x206f('0x16')](function(_0x5af80f){logger[_0x206f('0x11')](_0x206f('0xd'),_0x2b336d,_0x5af80f);_0x3c4b73(_0x5af80f);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 91eb47d..bdd826e 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 _0x6f14=['exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','index','/:id','isAuthenticated','show','/:id/preview','/:id/run','run','/:id/query','query','post','put','update','destroy'];(function(_0x2cdfae,_0x33542f){var _0x33b540=function(_0x1c0d69){while(--_0x1c0d69){_0x2cdfae['push'](_0x2cdfae['shift']());}};_0x33b540(++_0x33542f);}(_0x6f14,0x181));var _0x46f1=function(_0x2ab251,_0x41f7bb){_0x2ab251=_0x2ab251-0x0;var _0x4461c4=_0x6f14[_0x2ab251];return _0x4461c4;};'use strict';var multer=require(_0x46f1('0x0'));var util=require(_0x46f1('0x1'));var path=require('path');var timeout=require(_0x46f1('0x2'));var express=require(_0x46f1('0x3'));var router=express[_0x46f1('0x4')]();var auth=require(_0x46f1('0x5'));var interaction=require(_0x46f1('0x6'));var config=require(_0x46f1('0x7'));var controller=require(_0x46f1('0x8'));router[_0x46f1('0x9')]('/',auth['isAuthenticated'](),controller[_0x46f1('0xa')]);router[_0x46f1('0x9')](_0x46f1('0xb'),auth[_0x46f1('0xc')](),controller[_0x46f1('0xd')]);router[_0x46f1('0x9')](_0x46f1('0xe'),auth['isAuthenticated'](),controller['preview']);router[_0x46f1('0x9')](_0x46f1('0xf'),auth['isAuthenticated'](),controller[_0x46f1('0x10')]);router[_0x46f1('0x9')](_0x46f1('0x11'),auth['isAuthenticated'](),controller[_0x46f1('0x12')]);router[_0x46f1('0x13')]('/',auth[_0x46f1('0xc')](),controller['create']);router[_0x46f1('0x14')]('/:id',auth[_0x46f1('0xc')](),controller[_0x46f1('0x15')]);router['delete'](_0x46f1('0xb'),auth['isAuthenticated'](),controller[_0x46f1('0x16')]);module[_0x46f1('0x17')]=router; \ No newline at end of file +var _0xd9b6=['preview','/:id/run','run','query','post','put','update','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','get','isAuthenticated','index','/:id','show'];(function(_0x57f100,_0xa53aca){var _0x4cac01=function(_0x447061){while(--_0x447061){_0x57f100['push'](_0x57f100['shift']());}};_0x4cac01(++_0xa53aca);}(_0xd9b6,0x135));var _0x6d9b=function(_0x4ac48d,_0x171a68){_0x4ac48d=_0x4ac48d-0x0;var _0x7537af=_0xd9b6[_0x4ac48d];return _0x7537af;};'use strict';var multer=require(_0x6d9b('0x0'));var util=require(_0x6d9b('0x1'));var path=require(_0x6d9b('0x2'));var timeout=require(_0x6d9b('0x3'));var express=require(_0x6d9b('0x4'));var router=express['Router']();var auth=require(_0x6d9b('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticCustomReport.controller');router[_0x6d9b('0x6')]('/',auth[_0x6d9b('0x7')](),controller[_0x6d9b('0x8')]);router[_0x6d9b('0x6')](_0x6d9b('0x9'),auth[_0x6d9b('0x7')](),controller[_0x6d9b('0xa')]);router['get']('/:id/preview',auth['isAuthenticated'](),controller[_0x6d9b('0xb')]);router[_0x6d9b('0x6')](_0x6d9b('0xc'),auth['isAuthenticated'](),controller[_0x6d9b('0xd')]);router[_0x6d9b('0x6')]('/:id/query',auth['isAuthenticated'](),controller[_0x6d9b('0xe')]);router[_0x6d9b('0xf')]('/',auth[_0x6d9b('0x7')](),controller['create']);router[_0x6d9b('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x6d9b('0x11')]);router['delete'](_0x6d9b('0x9'),auth[_0x6d9b('0x7')](),controller[_0x6d9b('0x12')]);module[_0x6d9b('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 1eaa376..452889c 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 _0x387c=['STRING','TEXT','sequelize','exports'];(function(_0x164f7b,_0x31a2ec){var _0x522806=function(_0xcc4f10){while(--_0xcc4f10){_0x164f7b['push'](_0x164f7b['shift']());}};_0x522806(++_0x31a2ec);}(_0x387c,0x66));var _0xc387=function(_0x330723,_0x8de382){_0x330723=_0x330723-0x0;var _0x60c546=_0x387c[_0x330723];return _0x60c546;};'use strict';var Sequelize=require(_0xc387('0x0'));module[_0xc387('0x1')]={'name':{'type':Sequelize[_0xc387('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xc387('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xc387('0x2')]},'conditions':{'type':Sequelize[_0xc387('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xa1fb=['sequelize','exports','STRING','TEXT'];(function(_0x4598e9,_0x5805f5){var _0x32e5b7=function(_0x3a68c6){while(--_0x3a68c6){_0x4598e9['push'](_0x4598e9['shift']());}};_0x32e5b7(++_0x5805f5);}(_0xa1fb,0x1a8));var _0xba1f=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xa1fb[_0x209941];return _0x1e8729;};'use strict';var Sequelize=require(_0xba1f('0x0'));module[_0xba1f('0x1')]={'name':{'type':Sequelize[_0xba1f('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xba1f('0x2')]},'parent':{'type':Sequelize[_0xba1f('0x2')]},'table':{'type':Sequelize[_0xba1f('0x2')]},'conditions':{'type':Sequelize[_0xba1f('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index c43c9fb..acc9ae7 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 _0xe35d=['UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','MetricId','metric','function','format','groupBy','orderBy','DESC','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','Limited\x20Query:','toString','sequelize','MAX(%s)','value','keyBy','replace','alias','SELECT','fullPath','%s-%s.%s','randomstring','generate','output','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','QueryTypes','runReport','GROUP_CONCAT(%s)','IS\x20NOT\x20NULL','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','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','update','then','destroy','get','UserProfileResource','end','error','stack','name','index','map','AnalyticDefaultReport','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','DefaultReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','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)'];(function(_0x40e8cd,_0x2b198a){var _0x58d106=function(_0x5e0893){while(--_0x5e0893){_0x40e8cd['push'](_0x40e8cd['shift']());}};_0x58d106(++_0x2b198a);}(_0xe35d,0xe3));var _0xde35=function(_0x268303,_0x45fcef){_0x268303=_0x268303-0x0;var _0x53cc1e=_0xe35d[_0x268303];return _0x53cc1e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xde35('0x0'));var rimraf=require(_0xde35('0x1'));var zipdir=require(_0xde35('0x2'));var jsonpatch=require(_0xde35('0x3'));var rp=require(_0xde35('0x4'));var moment=require(_0xde35('0x5'));var BPromise=require(_0xde35('0x6'));var Mustache=require(_0xde35('0x7'));var util=require(_0xde35('0x8'));var path=require(_0xde35('0x9'));var sox=require(_0xde35('0xa'));var csv=require(_0xde35('0xb'));var ejs=require(_0xde35('0xc'));var fs=require('fs');var _=require(_0xde35('0xd'));var squel=require(_0xde35('0xe'));var crypto=require(_0xde35('0xf'));var jsforce=require(_0xde35('0x10'));var deskjs=require(_0xde35('0x11'));var toCsv=require(_0xde35('0xb'));var querystring=require('querystring');var Papa=require(_0xde35('0x12'));var Redis=require('ioredis');var authService=require(_0xde35('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xde35('0x14'));var hardwareService=require(_0xde35('0x15'));var logger=require(_0xde35('0x16'))(_0xde35('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3bf143,_0x253054){_0x253054=_0x253054||0xcc;return function(_0x3abbe8){if(_0x3abbe8){return _0x3bf143[_0xde35('0x18')](_0x253054);}return _0x3bf143[_0xde35('0x19')](_0x253054)['end']();};}function respondWithResult(_0x1e1b8c,_0x467d36){_0x467d36=_0x467d36||0xc8;return function(_0x4317ae){if(_0x4317ae){return _0x1e1b8c[_0xde35('0x19')](_0x467d36)[_0xde35('0x1a')](_0x4317ae);}};}function respondWithFilteredResult(_0x421029,_0x1d468d){return function(_0x1b7b92){if(_0x1b7b92){var _0x5ec9e9=_0x1b7b92[_0xde35('0x1b')],_0x1692a0=_0x1d468d[_0xde35('0x1c')],_0x51d79c=_0x1d468d[_0xde35('0x1c')]+_0x1d468d[_0xde35('0x1d')],_0x5a9e17;if(_0x51d79c>=_0x5ec9e9){_0x51d79c=_0x5ec9e9;_0x5a9e17=0xc8;}else{_0x5a9e17=0xce;}_0x421029[_0xde35('0x19')](_0x5a9e17);return _0x421029[_0xde35('0x1e')](_0xde35('0x1f'),_0x1692a0+'-'+_0x51d79c+'/'+_0x5ec9e9)[_0xde35('0x1a')](_0x1b7b92);}return null;};}function patchUpdates(_0x5b4acb){return function(_0x363438){try{jsonpatch[_0xde35('0x20')](_0x363438,_0x5b4acb,!![]);}catch(_0x192d18){return BPromise['reject'](_0x192d18);}return _0x363438['save']();};}function saveUpdates(_0x527254,_0x328aa5){return function(_0x1b9ebf){if(_0x1b9ebf){return _0x1b9ebf[_0xde35('0x21')](_0x527254)[_0xde35('0x22')](function(_0x103fa2){return _0x103fa2;});}return null;};}function removeEntity(_0x339bf8,_0x11be90){return function(_0x1f9132){if(_0x1f9132){return _0x1f9132[_0xde35('0x23')]()['then'](function(){var _0x17c1ba=_0x1f9132[_0xde35('0x24')]({'plain':!![]});var _0x2a1b52='DefaultReports';return db[_0xde35('0x25')]['destroy']({'where':{'type':_0x2a1b52,'resourceId':_0x17c1ba['id']}})['then'](function(){return _0x1f9132;});})[_0xde35('0x22')](function(){_0x339bf8[_0xde35('0x19')](0xcc)[_0xde35('0x26')]();});}};}function handleEntityNotFound(_0x16b21d,_0x489387){return function(_0x189e8c){if(!_0x189e8c){_0x16b21d[_0xde35('0x18')](0x194);}return _0x189e8c;};}function handleError(_0xf28937,_0x5d8186){_0x5d8186=_0x5d8186||0x1f4;return function(_0x408f58){logger[_0xde35('0x27')](_0x408f58[_0xde35('0x28')]);if(_0x408f58[_0xde35('0x29')]){delete _0x408f58[_0xde35('0x29')];}_0xf28937[_0xde35('0x19')](_0x5d8186)['send'](_0x408f58);};}exports[_0xde35('0x2a')]=function(_0x3c3c44,_0x15b293){var _0x490a1b={},_0x1d2b4a={},_0x375b45={'count':0x0,'rows':[]};var _0x190d96=_[_0xde35('0x2b')](db[_0xde35('0x2c')][_0xde35('0x2d')],function(_0x51483b){return{'name':_0x51483b[_0xde35('0x2e')],'type':_0x51483b['type'][_0xde35('0x2f')]};});_0x1d2b4a['model']=_[_0xde35('0x2b')](_0x190d96,_0xde35('0x29'));_0x1d2b4a[_0xde35('0x30')]=_[_0xde35('0x31')](_0x3c3c44[_0xde35('0x30')]);_0x1d2b4a[_0xde35('0x32')]=_[_0xde35('0x33')](_0x1d2b4a['model'],_0x1d2b4a[_0xde35('0x30')]);_0x490a1b[_0xde35('0x34')]=_['intersection'](_0x1d2b4a[_0xde35('0x35')],qs[_0xde35('0x36')](_0x3c3c44[_0xde35('0x30')][_0xde35('0x36')]));_0x490a1b[_0xde35('0x34')]=_0x490a1b[_0xde35('0x34')][_0xde35('0x37')]?_0x490a1b['attributes']:_0x1d2b4a[_0xde35('0x35')];if(!_0x3c3c44[_0xde35('0x30')][_0xde35('0x38')](_0xde35('0x39'))){_0x490a1b['limit']=qs['limit'](_0x3c3c44[_0xde35('0x30')]['limit']);_0x490a1b[_0xde35('0x1c')]=qs['offset'](_0x3c3c44[_0xde35('0x30')][_0xde35('0x1c')]);}_0x490a1b[_0xde35('0x3a')]=qs[_0xde35('0x3b')](_0x3c3c44[_0xde35('0x30')]['sort']);_0x490a1b[_0xde35('0x3c')]=qs['filters'](_[_0xde35('0x3d')](_0x3c3c44[_0xde35('0x30')],_0x1d2b4a[_0xde35('0x32')]));if(_0x3c3c44[_0xde35('0x30')][_0xde35('0x3e')]){_0x490a1b[_0xde35('0x3c')]=_[_0xde35('0x3f')](_0x490a1b[_0xde35('0x3c')],{'$or':_[_0xde35('0x2b')](_0x190d96,function(_0x31bbe6){if(_0x31bbe6[_0xde35('0x40')]!==_0xde35('0x41')){var _0x5f1ee0={};_0x5f1ee0[_0x31bbe6[_0xde35('0x29')]]={'$like':'%'+_0x3c3c44['query'][_0xde35('0x3e')]+'%'};return _0x5f1ee0;}})});}_0x490a1b=_['merge']({},_0x490a1b,_0x3c3c44[_0xde35('0x42')]);var _0x13b5b7={'where':_0x490a1b[_0xde35('0x3c')]};return db[_0xde35('0x2c')]['count'](_0x13b5b7)[_0xde35('0x22')](function(_0x2feb6d){_0x375b45[_0xde35('0x1b')]=_0x2feb6d;if(_0x3c3c44[_0xde35('0x30')][_0xde35('0x43')]){_0x490a1b[_0xde35('0x44')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0xde35('0x45')](_0x490a1b);})[_0xde35('0x22')](function(_0x4e5320){_0x375b45[_0xde35('0x46')]=_0x4e5320;return _0x375b45;})[_0xde35('0x22')](respondWithFilteredResult(_0x15b293,_0x490a1b))[_0xde35('0x47')](handleError(_0x15b293,null));};exports[_0xde35('0x48')]=function(_0x343aa9,_0x1bc8b1){var _0x24e3d9={'raw':!![],'where':{'id':_0x343aa9[_0xde35('0x49')]['id']}},_0x24fbdd={};_0x24fbdd['model']=_[_0xde35('0x31')](db[_0xde35('0x2c')][_0xde35('0x2d')]);_0x24fbdd['query']=_[_0xde35('0x31')](_0x343aa9[_0xde35('0x30')]);_0x24fbdd[_0xde35('0x32')]=_[_0xde35('0x33')](_0x24fbdd['model'],_0x24fbdd[_0xde35('0x30')]);_0x24e3d9['attributes']=_[_0xde35('0x33')](_0x24fbdd[_0xde35('0x35')],qs[_0xde35('0x36')](_0x343aa9[_0xde35('0x30')][_0xde35('0x36')]));_0x24e3d9['attributes']=_0x24e3d9[_0xde35('0x34')][_0xde35('0x37')]?_0x24e3d9[_0xde35('0x34')]:_0x24fbdd[_0xde35('0x35')];if(_0x343aa9['query'][_0xde35('0x43')]){_0x24e3d9[_0xde35('0x44')]=[{'all':!![]}];}_0x24e3d9=_[_0xde35('0x3f')]({},_0x24e3d9,_0x343aa9['options']);return db[_0xde35('0x2c')]['find'](_0x24e3d9)[_0xde35('0x22')](handleEntityNotFound(_0x1bc8b1,null))['then'](respondWithResult(_0x1bc8b1,null))[_0xde35('0x47')](handleError(_0x1bc8b1,null));};exports['create']=function(_0x5cfae9,_0x4eacd7){return db['AnalyticDefaultReport'][_0xde35('0x4a')](_0x5cfae9['body'],{})[_0xde35('0x22')](function(_0x238105){var _0x59eb21=_0x5cfae9[_0xde35('0x4b')][_0xde35('0x24')]({'plain':!![]});if(!_0x59eb21)throw new Error(_0xde35('0x4c'));if(_0x59eb21[_0xde35('0x4d')]===_0xde35('0x4b')){var _0xd325fa=_0x238105[_0xde35('0x24')]({'plain':!![]});var _0x30e188='Reports';return db['UserProfileSection'][_0xde35('0x4e')]({'where':{'name':_0x30e188,'userProfileId':_0x59eb21[_0xde35('0x4f')]},'raw':!![]})[_0xde35('0x22')](function(_0x2c656b){if(_0x2c656b&&_0x2c656b['autoAssociation']===0x0){return db[_0xde35('0x25')]['create']({'name':_0xd325fa[_0xde35('0x29')],'resourceId':_0xd325fa['id'],'type':_0xde35('0x50'),'sectionId':_0x2c656b['id']},{})[_0xde35('0x22')](function(){return _0x238105;});}else{return _0x238105;}})[_0xde35('0x47')](function(_0x16979a){logger[_0xde35('0x27')](_0xde35('0x51'),_0x16979a);throw _0x16979a;});}return _0x238105;})[_0xde35('0x22')](respondWithResult(_0x4eacd7,0xc9))['catch'](handleError(_0x4eacd7,null));};exports[_0xde35('0x21')]=function(_0xabba35,_0x215843){if(_0xabba35[_0xde35('0x52')]['id']){delete _0xabba35[_0xde35('0x52')]['id'];}return db[_0xde35('0x2c')][_0xde35('0x4e')]({'where':{'id':_0xabba35[_0xde35('0x49')]['id']}})[_0xde35('0x22')](handleEntityNotFound(_0x215843,null))['then'](saveUpdates(_0xabba35[_0xde35('0x52')],null))['then'](respondWithResult(_0x215843,null))[_0xde35('0x47')](handleError(_0x215843,null));};exports[_0xde35('0x23')]=function(_0x263d27,_0x44b9d2){return db['AnalyticDefaultReport'][_0xde35('0x4e')]({'where':{'id':_0x263d27['params']['id']}})[_0xde35('0x22')](handleEntityNotFound(_0x44b9d2,null))['then'](removeEntity(_0x44b9d2,null))['catch'](handleError(_0x44b9d2,null));};exports[_0xde35('0x53')]=function(_0x510bde,_0x40b615){var _0x3c9a5d=0xa;var _0x46a28f=[_0xde35('0x54'),_0xde35('0x55'),_0xde35('0x56'),_0xde35('0x57')];var _0x2c7dfd={'SUM':_0xde35('0x58'),'COUNT':_0xde35('0x59'),'COUNT DISTINCT':_0xde35('0x5a'),'MAX':'MAX(%s)','MIN':_0xde35('0x5b'),'AVG':_0xde35('0x5c'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xde35('0x5d'),'GROUP_CONCAT DESC':_0xde35('0x5e')};var _0x58e65={'SEC_TO_TIME':_0xde35('0x5f'),'DATE':_0xde35('0x60'),'HOUR':_0xde35('0x61'),'ROUND':_0xde35('0x62'),'UNIX_TIMESTAMP':_0xde35('0x63')};var _0x3dcf08=function(_0x55cf44){return!_[_0xde35('0x64')]([_0xde35('0x65'),'IS\x20NOT\x20NULL',_0xde35('0x66'),_0xde35('0x67')],_0x55cf44);};var _0x2a6344=function(_0x3619a3){if(!_0x3619a3||!_0x3619a3[_0xde35('0x68')][_0xde35('0x37')]){return'';}for(var _0xdc64bb='(',_0x1143c5=0x0;_0x1143c5<_0x3619a3[_0xde35('0x68')][_0xde35('0x37')];_0x1143c5+=0x1){_0x1143c5>0x0&&(_0xdc64bb+='\x20'+_0x3619a3[_0xde35('0x69')]+'\x20');_0xdc64bb+=_0x3619a3['rules'][_0x1143c5][_0xde35('0x6a')]?_0x2a6344(_0x3619a3['rules'][_0x1143c5]['group']):_0x3619a3[_0xde35('0x68')][_0x1143c5][_0xde35('0x6b')]+'\x20'+_0x3619a3[_0xde35('0x68')][_0x1143c5][_0xde35('0x6c')]+(_0x3dcf08(_0x3619a3[_0xde35('0x68')][_0x1143c5][_0xde35('0x6c')])?'\x20'+_0x3619a3[_0xde35('0x68')][_0x1143c5]['value']:'');}return _0xdc64bb+')';};var _0x273b99={'where':{'id':_0x510bde[_0xde35('0x49')]['id']}},_0x13d8ee,_0x9f8af8,_0x9e270a,_0x15ea11,_0x35c797;_0x273b99=_['merge']({},_0x273b99,_0x510bde[_0xde35('0x42')]);return db['AnalyticDefaultReport'][_0xde35('0x4e')](_0x273b99)['then'](function(_0x1f2583){if(_0x1f2583){_0x13d8ee=_0x1f2583;return _0x1f2583[_0xde35('0x6d')]();}return null;})[_0xde35('0x22')](function(_0x346ad6){if(_0x346ad6){if(!_0x346ad6['length']){throw new db[(_0xde35('0x6e'))][(_0xde35('0x6f'))](_0xde35('0x70'),0x193);}_0x9f8af8=_0x346ad6;return db[_0xde35('0x71')]['findAll']({'raw':!![]});}return null;})[_0xde35('0x22')](function(_0x164514){if(_0x164514){_0x9e270a=_['keyBy'](_0x164514,'id');var _0x5c0086;var _0x26a25f=squel[_0xde35('0x72')]();_0x26a25f[_0xde35('0x73')](_0x13d8ee[_0xde35('0x74')]);for(var _0x541fc2=0x0;_0x541fc2<_0x9f8af8[_0xde35('0x37')];_0x541fc2+=0x1){_0x5c0086=_0x9f8af8[_0x541fc2][_0xde35('0x75')]?_0x9e270a[_0x9f8af8[_0x541fc2][_0xde35('0x75')]][_0xde35('0x76')]:_0x9f8af8[_0x541fc2][_0xde35('0x6b')];_0x5c0086=_0x9f8af8[_0x541fc2][_0xde35('0x77')]?_['replace'](_0x2c7dfd[_0x9f8af8[_0x541fc2][_0xde35('0x77')]],'%s',_0x5c0086):_0x5c0086;_0x5c0086=_0x9f8af8[_0x541fc2][_0xde35('0x78')]?_['replace'](_0x58e65[_0x9f8af8[_0x541fc2][_0xde35('0x78')]],'%s',_0x5c0086):_0x5c0086;if(_0x9f8af8[_0x541fc2][_0xde35('0x79')]){_0x26a25f[_0xde35('0x6a')](_0x5c0086);}_0x9f8af8[_0x541fc2]['orderBy']&&_0x26a25f[_0xde35('0x3a')](_0x5c0086,_0x9f8af8[_0x541fc2][_0xde35('0x7a')]===_0xde35('0x7b')?![]:!![]);_0x26a25f[_0xde35('0x6b')](_0x5c0086,_0x9f8af8[_0x541fc2]['alias']||_0x5c0086);}if(_0x13d8ee[_0xde35('0x7c')]){_0x13d8ee['joins']=JSON['parse'](_0x13d8ee[_0xde35('0x7c')]);for(var _0x42c491=0x0;_0x42c491<_0x13d8ee['joins']['length'];_0x42c491+=0x1){if(_0x13d8ee['joins'][_0x42c491]['type']&&_[_0xde35('0x64')](_0x46a28f,_0x13d8ee['joins'][_0x42c491][_0xde35('0x40')])&&_0x13d8ee[_0xde35('0x7c')][_0x42c491][_0xde35('0x7d')]&&_0x13d8ee[_0xde35('0x7c')][_0x42c491]['foreignTable']&&_0x13d8ee[_0xde35('0x7c')][_0x42c491][_0xde35('0x7e')]){_0x26a25f[_0x13d8ee['joins'][_0x42c491][_0xde35('0x40')]](_0x13d8ee[_0xde35('0x7c')][_0x42c491][_0xde35('0x7f')],null,util[_0xde35('0x78')](_0xde35('0x80'),_0x13d8ee[_0xde35('0x74')],_0x13d8ee[_0xde35('0x7c')][_0x42c491][_0xde35('0x7d')],_0x13d8ee['joins'][_0x42c491][_0xde35('0x7f')],_0x13d8ee[_0xde35('0x7c')][_0x42c491][_0xde35('0x7e')]));}}}if(_0x13d8ee[_0xde35('0x81')]){_0x13d8ee[_0xde35('0x81')]=JSON[_0xde35('0x82')](_0x13d8ee[_0xde35('0x81')]);_0x26a25f[_0xde35('0x3c')](_0x2a6344(_0x13d8ee[_0xde35('0x81')]['group']));}_0x35c797=_0x26a25f[_0xde35('0x83')]();_0x26a25f[_0xde35('0x1d')](_0x3c9a5d);_0x26a25f[_0xde35('0x1c')](0x0);logger[_0xde35('0x84')](_0xde35('0x85'),_0x26a25f[_0xde35('0x86')]());return db[_0xde35('0x87')][_0xde35('0x30')](_0x26a25f[_0xde35('0x86')](),{'type':db[_0xde35('0x87')]['QueryTypes']['SELECT']});}})[_0xde35('0x22')](respondWithResult(_0x40b615,null))[_0xde35('0x47')](handleError(_0x40b615,null));};function runReport(_0x6ec3c1,_0x4ad996,_0x18b8c2){var _0x82d391=_0x4ad996[_0xde35('0x29')];var _0x44c87c=0xa;var _0x22f4ec=[_0xde35('0x54'),'left_join',_0xde35('0x56'),_0xde35('0x57')];var _0x20ab5d={'SUM':_0xde35('0x58'),'COUNT':_0xde35('0x59'),'COUNT DISTINCT':_0xde35('0x5a'),'MAX':_0xde35('0x88'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xde35('0x5d'),'GROUP_CONCAT DESC':_0xde35('0x5e')};var _0x1e8947={'SEC_TO_TIME':_0xde35('0x5f'),'DATE':_0xde35('0x60'),'HOUR':_0xde35('0x61'),'ROUND':_0xde35('0x62'),'UNIX_TIMESTAMP':_0xde35('0x63')};var _0x321a6b=function(_0x32d3d8){return!_[_0xde35('0x64')]([_0xde35('0x65'),'IS\x20NOT\x20NULL',_0xde35('0x66'),_0xde35('0x67')],_0x32d3d8);};var _0x5ddf43=function(_0x5413d7){if(!_0x5413d7||!_0x5413d7[_0xde35('0x68')][_0xde35('0x37')]){return'';}for(var _0x332eba='(',_0x52eb55=0x0;_0x52eb55<_0x5413d7['rules'][_0xde35('0x37')];_0x52eb55+=0x1){_0x52eb55>0x0&&(_0x332eba+='\x20'+_0x5413d7['operator']+'\x20');_0x332eba+=_0x5413d7[_0xde35('0x68')][_0x52eb55][_0xde35('0x6a')]?_0x5ddf43(_0x5413d7[_0xde35('0x68')][_0x52eb55][_0xde35('0x6a')]):_0x5413d7[_0xde35('0x68')][_0x52eb55][_0xde35('0x6b')]+'\x20'+_0x5413d7[_0xde35('0x68')][_0x52eb55][_0xde35('0x6c')]+(_0x321a6b(_0x5413d7[_0xde35('0x68')][_0x52eb55]['condition'])?'\x20'+_0x5413d7[_0xde35('0x68')][_0x52eb55][_0xde35('0x89')]:'');}return _0x332eba+')';};var _0x595ba7={'where':{'id':_0x6ec3c1['id']}},_0x45a97a,_0x91cfcb,_0x56fe19,_0x2b31f1,_0x5cec8a;_0x595ba7=_[_0xde35('0x3f')]({},_0x595ba7,_0x18b8c2);return db['AnalyticDefaultReport'][_0xde35('0x4e')](_0x595ba7)[_0xde35('0x22')](function(_0x20ab36){if(_0x20ab36){_0x45a97a=_0x20ab36;return _0x20ab36['getFields']();}return null;})['then'](function(_0x3accb0){if(_0x3accb0){if(!_0x3accb0[_0xde35('0x37')]){throw new db['Sequelize'][(_0xde35('0x6f'))](_0xde35('0x70'),0x193);}_0x91cfcb=_0x3accb0;return db[_0xde35('0x71')][_0xde35('0x45')]({'raw':!![]});}return null;})[_0xde35('0x22')](function(_0x11b5d3){if(_0x11b5d3){_0x56fe19=_[_0xde35('0x8a')](_0x11b5d3,'id');var _0x3dbbb5;var _0x5d05f5=squel[_0xde35('0x72')]();_0x5d05f5[_0xde35('0x73')](_0x45a97a[_0xde35('0x74')]);for(var _0x579a92=0x0;_0x579a92<_0x91cfcb[_0xde35('0x37')];_0x579a92+=0x1){_0x3dbbb5=_0x91cfcb[_0x579a92][_0xde35('0x75')]?_0x56fe19[_0x91cfcb[_0x579a92][_0xde35('0x75')]][_0xde35('0x76')]:_0x91cfcb[_0x579a92][_0xde35('0x6b')];_0x3dbbb5=_0x91cfcb[_0x579a92][_0xde35('0x77')]?_[_0xde35('0x8b')](_0x20ab5d[_0x91cfcb[_0x579a92]['function']],'%s',_0x3dbbb5):_0x3dbbb5;_0x3dbbb5=_0x91cfcb[_0x579a92]['format']?_[_0xde35('0x8b')](_0x1e8947[_0x91cfcb[_0x579a92][_0xde35('0x78')]],'%s',_0x3dbbb5):_0x3dbbb5;if(_0x91cfcb[_0x579a92][_0xde35('0x79')]){_0x5d05f5[_0xde35('0x6a')](_0x3dbbb5);}_0x91cfcb[_0x579a92][_0xde35('0x7a')]&&_0x5d05f5[_0xde35('0x3a')](_0x3dbbb5,_0x91cfcb[_0x579a92][_0xde35('0x7a')]===_0xde35('0x7b')?![]:!![]);_0x5d05f5[_0xde35('0x6b')](_0x3dbbb5,_0x91cfcb[_0x579a92][_0xde35('0x8c')]||_0x3dbbb5);}if(_0x45a97a['joins']){_0x45a97a[_0xde35('0x7c')]=JSON[_0xde35('0x82')](_0x45a97a[_0xde35('0x7c')]);for(var _0x2f6e61=0x0;_0x2f6e61<_0x45a97a['joins'][_0xde35('0x37')];_0x2f6e61+=0x1){if(_0x45a97a[_0xde35('0x7c')][_0x2f6e61]['type']&&_[_0xde35('0x64')](_0x22f4ec,_0x45a97a['joins'][_0x2f6e61]['type'])&&_0x45a97a['joins'][_0x2f6e61][_0xde35('0x7d')]&&_0x45a97a['joins'][_0x2f6e61][_0xde35('0x7f')]&&_0x45a97a[_0xde35('0x7c')][_0x2f6e61][_0xde35('0x7e')]){_0x5d05f5[_0x45a97a[_0xde35('0x7c')][_0x2f6e61][_0xde35('0x40')]](_0x45a97a[_0xde35('0x7c')][_0x2f6e61][_0xde35('0x7f')],null,util['format'](_0xde35('0x80'),_0x45a97a['table'],_0x45a97a[_0xde35('0x7c')][_0x2f6e61][_0xde35('0x7d')],_0x45a97a[_0xde35('0x7c')][_0x2f6e61]['foreignTable'],_0x45a97a[_0xde35('0x7c')][_0x2f6e61][_0xde35('0x7e')]));}}}if(_0x45a97a[_0xde35('0x81')]){_0x45a97a[_0xde35('0x81')]=JSON[_0xde35('0x82')](_0x45a97a[_0xde35('0x81')]);_0x5d05f5[_0xde35('0x3c')](_0x5ddf43(_0x45a97a[_0xde35('0x81')][_0xde35('0x6a')]));}_0x5cec8a=_0x5d05f5[_0xde35('0x83')]();_0x5d05f5[_0xde35('0x1d')](_0x44c87c);_0x5d05f5[_0xde35('0x1c')](0x0);logger[_0xde35('0x84')](_0xde35('0x85'),_0x5d05f5[_0xde35('0x86')]());return db[_0xde35('0x87')]['query'](_0x5d05f5['toString'](),{'type':db[_0xde35('0x87')]['QueryTypes'][_0xde35('0x8d')]});}})[_0xde35('0x22')](function(_0x397ce5){if(!_0x397ce5[_0xde35('0x37')]){throw new db['Sequelize'][(_0xde35('0x6f'))]('No\x20available\x20data',0xcc);}if(_0x4ad996['output']==='web'){return null;}var _0x2220ec=_[_0xde35('0x3f')](_0x4ad996,{'name':_0x4ad996[_0xde35('0x8e')]||_0x4ad996[_0xde35('0x29')]||_0x45a97a['name'],'basename':_0x82d391,'savename':util[_0xde35('0x78')](_0xde35('0x8f'),_0x4ad996[_0xde35('0x29')]||_0x45a97a[_0xde35('0x29')],require(_0xde35('0x90'))[_0xde35('0x91')](0x4),_0x4ad996[_0xde35('0x92')]||'csv'),'reportId':_0x45a97a['id'],'reportType':'default'});return db[_0xde35('0x93')][_0xde35('0x4a')](_0x2220ec,{'raw':!![]});})['then'](function(_0x1cd5b0){if(_0x45a97a['table']==='cdr'){_0x5cec8a['where'](_0x45a97a[_0xde35('0x74')]+_0xde35('0x94'),_0x4ad996[_0xde35('0x95')],_0x4ad996['endDate']);}else{_0x5cec8a[_0xde35('0x3c')](_0x45a97a['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4ad996['startDate'],_0x4ad996[_0xde35('0x96')]);}if(_0x1cd5b0){logger[_0xde35('0x97')](_0xde35('0x98'),_0x5cec8a[_0xde35('0x86')]());require(_0xde35('0x99'))[_0xde35('0x9a')](path[_0xde35('0x54')](__dirname,_0xde35('0x9b'),_0x1cd5b0[_0xde35('0x92')]),[_0x1cd5b0['id'],_0x5cec8a['toString'](),path[_0xde35('0x54')](__dirname,_0xde35('0x9c'),_0x1cd5b0[_0xde35('0x9d')]),_0x82d391]);return _0x1cd5b0;}else{var _0x55211d=squel['select']();_0x55211d[_0xde35('0x73')]('('+_0x5cec8a[_0xde35('0x86')]()+')',_0xde35('0x9e'));_0x55211d[_0xde35('0x6b')]('COUNT(*)',_0xde35('0x1b'));_0x5cec8a[_0xde35('0x1d')](_0x4ad996[_0xde35('0x1d')]||_0x44c87c);_0x5cec8a[_0xde35('0x1c')](_0x4ad996[_0xde35('0x1c')]||0x0);return db[_0xde35('0x87')]['query'](_0x55211d['toString'](),{'type':db['sequelize'][_0xde35('0x9f')][_0xde35('0x8d')]})[_0xde35('0x22')](function(_0x25ad9){if(!_0x25ad9[_0xde35('0x37')]){_0x2b31f1=0x0;}else{_0x2b31f1=_0x25ad9[0x0]['count']||0x0;}return db[_0xde35('0x87')][_0xde35('0x30')](_0x5cec8a['toString'](),{'type':db['sequelize'][_0xde35('0x9f')][_0xde35('0x8d')]});})[_0xde35('0x22')](function(_0xaf8472){return{'rows':_0xaf8472||[],'count':_0x2b31f1};});}});}exports['run']=function(_0x6e39a9,_0x2b56f5){return runReport(_0x6e39a9['params'],_0x6e39a9[_0xde35('0x30')],_0x6e39a9[_0xde35('0x42')])[_0xde35('0x22')](respondWithResult(_0x2b56f5,null))['catch'](handleError(_0x2b56f5,null));};exports[_0xde35('0xa0')]=runReport;exports['query']=function(_0x310d2c,_0x5b0101){var _0x4a4ffb=0xa;var _0x49135c=[_0xde35('0x54'),_0xde35('0x55'),'right_join',_0xde35('0x57')];var _0x4aef1a={'SUM':_0xde35('0x58'),'COUNT':_0xde35('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xde35('0x88'),'MIN':'MIN(%s)','AVG':_0xde35('0x5c'),'GROUP_CONCAT':_0xde35('0xa1'),'GROUP_CONCAT ASC':_0xde35('0x5d'),'GROUP_CONCAT DESC':_0xde35('0x5e')};var _0x562d6c={'SEC_TO_TIME':_0xde35('0x5f'),'DATE':_0xde35('0x60'),'HOUR':_0xde35('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xde35('0x63')};var _0x4a21fa=function(_0x153dff){return!_['includes']([_0xde35('0x65'),_0xde35('0xa2'),_0xde35('0x66'),'IS\x20NOT\x20EMPTY'],_0x153dff);};var _0x441170=function(_0xde977){if(!_0xde977||!_0xde977[_0xde35('0x68')][_0xde35('0x37')]){return'';}for(var _0x449af9='(',_0x4d3c73=0x0;_0x4d3c73<_0xde977['rules'][_0xde35('0x37')];_0x4d3c73+=0x1){_0x4d3c73>0x0&&(_0x449af9+='\x20'+_0xde977[_0xde35('0x69')]+'\x20');_0x449af9+=_0xde977[_0xde35('0x68')][_0x4d3c73][_0xde35('0x6a')]?_0x441170(_0xde977['rules'][_0x4d3c73][_0xde35('0x6a')]):_0xde977[_0xde35('0x68')][_0x4d3c73]['field']+'\x20'+_0xde977[_0xde35('0x68')][_0x4d3c73][_0xde35('0x6c')]+(_0x4a21fa(_0xde977[_0xde35('0x68')][_0x4d3c73][_0xde35('0x6c')])?'\x20'+_0xde977[_0xde35('0x68')][_0x4d3c73][_0xde35('0x89')]:'');}return _0x449af9+')';};var _0x272a95={'where':{'id':_0x310d2c[_0xde35('0x49')]['id']}},_0x490268,_0x485ade,_0x5d076c,_0xc73975,_0x2f1298;_0x272a95=_[_0xde35('0x3f')]({},_0x272a95,_0x310d2c[_0xde35('0x42')]);return db[_0xde35('0x2c')]['find'](_0x272a95)['then'](function(_0x4b021c){if(_0x4b021c){_0x490268=_0x4b021c;return _0x4b021c[_0xde35('0x6d')]();}return null;})[_0xde35('0x22')](function(_0x1410c3){if(_0x1410c3){if(!_0x1410c3[_0xde35('0x37')]){throw new db[(_0xde35('0x6e'))][(_0xde35('0x6f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x485ade=_0x1410c3;return db[_0xde35('0x71')][_0xde35('0x45')]({'raw':!![]});}return null;})[_0xde35('0x22')](function(_0x2ab3c5){if(_0x2ab3c5){_0x5d076c=_[_0xde35('0x8a')](_0x2ab3c5,'id');var _0x40eba9;var _0x397fb4=squel['select']();_0x397fb4['from'](_0x490268[_0xde35('0x74')]);for(var _0x4983d0=0x0;_0x4983d0<_0x485ade[_0xde35('0x37')];_0x4983d0+=0x1){_0x40eba9=_0x485ade[_0x4983d0][_0xde35('0x75')]?_0x5d076c[_0x485ade[_0x4983d0][_0xde35('0x75')]][_0xde35('0x76')]:_0x485ade[_0x4983d0][_0xde35('0x6b')];_0x40eba9=_0x485ade[_0x4983d0][_0xde35('0x77')]?_[_0xde35('0x8b')](_0x4aef1a[_0x485ade[_0x4983d0][_0xde35('0x77')]],'%s',_0x40eba9):_0x40eba9;_0x40eba9=_0x485ade[_0x4983d0][_0xde35('0x78')]?_[_0xde35('0x8b')](_0x562d6c[_0x485ade[_0x4983d0][_0xde35('0x78')]],'%s',_0x40eba9):_0x40eba9;if(_0x485ade[_0x4983d0][_0xde35('0x79')]){_0x397fb4[_0xde35('0x6a')](_0x40eba9);}_0x485ade[_0x4983d0][_0xde35('0x7a')]&&_0x397fb4[_0xde35('0x3a')](_0x40eba9,_0x485ade[_0x4983d0][_0xde35('0x7a')]==='DESC'?![]:!![]);_0x397fb4[_0xde35('0x6b')](_0x40eba9,_0x485ade[_0x4983d0]['alias']||_0x40eba9);}if(_0x490268[_0xde35('0x7c')]){_0x490268['joins']=JSON[_0xde35('0x82')](_0x490268['joins']);for(var _0x25c6fe=0x0;_0x25c6fe<_0x490268[_0xde35('0x7c')]['length'];_0x25c6fe+=0x1){if(_0x490268[_0xde35('0x7c')][_0x25c6fe]['type']&&_[_0xde35('0x64')](_0x49135c,_0x490268[_0xde35('0x7c')][_0x25c6fe][_0xde35('0x40')])&&_0x490268['joins'][_0x25c6fe][_0xde35('0x7d')]&&_0x490268['joins'][_0x25c6fe]['foreignTable']&&_0x490268[_0xde35('0x7c')][_0x25c6fe][_0xde35('0x7e')]){_0x397fb4[_0x490268[_0xde35('0x7c')][_0x25c6fe][_0xde35('0x40')]](_0x490268[_0xde35('0x7c')][_0x25c6fe]['foreignTable'],null,util['format'](_0xde35('0x80'),_0x490268['table'],_0x490268['joins'][_0x25c6fe][_0xde35('0x7d')],_0x490268[_0xde35('0x7c')][_0x25c6fe][_0xde35('0x7f')],_0x490268[_0xde35('0x7c')][_0x25c6fe]['foreignKey']));}}}if(_0x490268[_0xde35('0x81')]){_0x490268[_0xde35('0x81')]=JSON[_0xde35('0x82')](_0x490268['conditions']);_0x397fb4['where'](_0x441170(_0x490268[_0xde35('0x81')][_0xde35('0x6a')]));}_0x2f1298=_0x397fb4['clone']();_0x397fb4[_0xde35('0x1d')](_0x4a4ffb);_0x397fb4[_0xde35('0x1c')](0x0);logger[_0xde35('0x84')](_0xde35('0x85'),_0x397fb4[_0xde35('0x86')]());return db[_0xde35('0x87')]['query'](_0x397fb4[_0xde35('0x86')](),{'type':db[_0xde35('0x87')][_0xde35('0x9f')][_0xde35('0x8d')]});}})['then'](function(){return{'sql':_0x2f1298[_0xde35('0x86')]()};})['then'](respondWithResult(_0x5b0101,null))['catch'](handleError(_0x5b0101,null));}; \ No newline at end of file +var _0x9ec0=['hasOwnProperty','nolimit','limit','offset','order','sort','where','filters','filter','merge','VIRTUAL','AnalyticDefaultReport','includeAll','findAll','rows','params','include','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','options','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','from','table','MetricId','field','function','replace','format','orderBy','DESC','joins','includes','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','parse','conditions','clone','debug','toString','sequelize','QueryTypes','SELECT','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','metric','groupBy','foreignKey','No\x20available\x20data','fullPath','randomstring','generate','output','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','COUNT(*)','GROUP_CONCAT(%s)','AnalyticMetric','alias','Limited\x20Query:','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','set','Content-Range','apply','reject','save','update','then','destroy','get','DefaultReports','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length'];(function(_0x136619,_0x31c9b2){var _0x38c4a5=function(_0x10b74d){while(--_0x10b74d){_0x136619['push'](_0x136619['shift']());}};_0x38c4a5(++_0x31c9b2);}(_0x9ec0,0x1b9));var _0x09ec=function(_0xae2add,_0x1c1106){_0xae2add=_0xae2add-0x0;var _0x1a512a=_0x9ec0[_0xae2add];return _0x1a512a;};'use strict';var pdf=require(_0x09ec('0x0'));var emlformat=require(_0x09ec('0x1'));var rimraf=require(_0x09ec('0x2'));var zipdir=require(_0x09ec('0x3'));var jsonpatch=require(_0x09ec('0x4'));var rp=require(_0x09ec('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x09ec('0x6'));var util=require(_0x09ec('0x7'));var path=require('path');var sox=require(_0x09ec('0x8'));var csv=require(_0x09ec('0x9'));var ejs=require(_0x09ec('0xa'));var fs=require('fs');var _=require(_0x09ec('0xb'));var squel=require('squel');var crypto=require(_0x09ec('0xc'));var jsforce=require(_0x09ec('0xd'));var deskjs=require(_0x09ec('0xe'));var toCsv=require(_0x09ec('0x9'));var querystring=require(_0x09ec('0xf'));var Papa=require('papaparse');var Redis=require(_0x09ec('0x10'));var authService=require(_0x09ec('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x09ec('0x12'));var hardwareService=require(_0x09ec('0x13'));var logger=require(_0x09ec('0x14'))(_0x09ec('0x15'));var utils=require(_0x09ec('0x16'));var config=require(_0x09ec('0x17'));var db=require(_0x09ec('0x18'))['db'];function respondWithStatusCode(_0x203dc4,_0x1a66f7){_0x1a66f7=_0x1a66f7||0xcc;return function(_0x38c432){if(_0x38c432){return _0x203dc4[_0x09ec('0x19')](_0x1a66f7);}return _0x203dc4[_0x09ec('0x1a')](_0x1a66f7)[_0x09ec('0x1b')]();};}function respondWithResult(_0x2eb6dd,_0x22be15){_0x22be15=_0x22be15||0xc8;return function(_0x486e4b){if(_0x486e4b){return _0x2eb6dd[_0x09ec('0x1a')](_0x22be15)[_0x09ec('0x1c')](_0x486e4b);}};}function respondWithFilteredResult(_0x21b1ec,_0x4af83f){return function(_0x4f865e){if(_0x4f865e){var _0x590cc7=_0x4f865e[_0x09ec('0x1d')],_0x2209a6=_0x4af83f['offset'],_0x1df78a=_0x4af83f['offset']+_0x4af83f['limit'],_0x3c9cbf;if(_0x1df78a>=_0x590cc7){_0x1df78a=_0x590cc7;_0x3c9cbf=0xc8;}else{_0x3c9cbf=0xce;}_0x21b1ec[_0x09ec('0x1a')](_0x3c9cbf);return _0x21b1ec[_0x09ec('0x1e')](_0x09ec('0x1f'),_0x2209a6+'-'+_0x1df78a+'/'+_0x590cc7)[_0x09ec('0x1c')](_0x4f865e);}return null;};}function patchUpdates(_0x11813e){return function(_0x42d620){try{jsonpatch[_0x09ec('0x20')](_0x42d620,_0x11813e,!![]);}catch(_0x1fe08e){return BPromise[_0x09ec('0x21')](_0x1fe08e);}return _0x42d620[_0x09ec('0x22')]();};}function saveUpdates(_0x274eeb,_0x33d3d2){return function(_0x50e112){if(_0x50e112){return _0x50e112[_0x09ec('0x23')](_0x274eeb)[_0x09ec('0x24')](function(_0x4a3c4c){return _0x4a3c4c;});}return null;};}function removeEntity(_0x204841,_0x577839){return function(_0x2d475f){if(_0x2d475f){return _0x2d475f[_0x09ec('0x25')]()[_0x09ec('0x24')](function(){var _0x3bddda=_0x2d475f[_0x09ec('0x26')]({'plain':!![]});var _0x43a2fc=_0x09ec('0x27');return db['UserProfileResource'][_0x09ec('0x25')]({'where':{'type':_0x43a2fc,'resourceId':_0x3bddda['id']}})[_0x09ec('0x24')](function(){return _0x2d475f;});})['then'](function(){_0x204841[_0x09ec('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c311f,_0x57695a){return function(_0x49d47e){if(!_0x49d47e){_0x4c311f[_0x09ec('0x19')](0x194);}return _0x49d47e;};}function handleError(_0x21e201,_0x9a5687){_0x9a5687=_0x9a5687||0x1f4;return function(_0x12167a){logger[_0x09ec('0x28')](_0x12167a[_0x09ec('0x29')]);if(_0x12167a[_0x09ec('0x2a')]){delete _0x12167a[_0x09ec('0x2a')];}_0x21e201[_0x09ec('0x1a')](_0x9a5687)[_0x09ec('0x2b')](_0x12167a);};}exports[_0x09ec('0x2c')]=function(_0x3318bd,_0x1389f7){var _0xef5339={},_0x9173e3={},_0x5a7a0c={'count':0x0,'rows':[]};var _0x3221f4=_[_0x09ec('0x2d')](db['AnalyticDefaultReport'][_0x09ec('0x2e')],function(_0x5c6d01){return{'name':_0x5c6d01[_0x09ec('0x2f')],'type':_0x5c6d01[_0x09ec('0x30')][_0x09ec('0x31')]};});_0x9173e3[_0x09ec('0x32')]=_[_0x09ec('0x2d')](_0x3221f4,_0x09ec('0x2a'));_0x9173e3[_0x09ec('0x33')]=_[_0x09ec('0x34')](_0x3318bd['query']);_0x9173e3['filters']=_['intersection'](_0x9173e3['model'],_0x9173e3[_0x09ec('0x33')]);_0xef5339[_0x09ec('0x35')]=_[_0x09ec('0x36')](_0x9173e3['model'],qs[_0x09ec('0x37')](_0x3318bd[_0x09ec('0x33')][_0x09ec('0x37')]));_0xef5339[_0x09ec('0x35')]=_0xef5339[_0x09ec('0x35')][_0x09ec('0x38')]?_0xef5339[_0x09ec('0x35')]:_0x9173e3[_0x09ec('0x32')];if(!_0x3318bd['query'][_0x09ec('0x39')](_0x09ec('0x3a'))){_0xef5339['limit']=qs[_0x09ec('0x3b')](_0x3318bd[_0x09ec('0x33')][_0x09ec('0x3b')]);_0xef5339['offset']=qs[_0x09ec('0x3c')](_0x3318bd[_0x09ec('0x33')][_0x09ec('0x3c')]);}_0xef5339[_0x09ec('0x3d')]=qs['sort'](_0x3318bd[_0x09ec('0x33')][_0x09ec('0x3e')]);_0xef5339[_0x09ec('0x3f')]=qs['filters'](_['pick'](_0x3318bd[_0x09ec('0x33')],_0x9173e3[_0x09ec('0x40')]));if(_0x3318bd[_0x09ec('0x33')][_0x09ec('0x41')]){_0xef5339[_0x09ec('0x3f')]=_[_0x09ec('0x42')](_0xef5339[_0x09ec('0x3f')],{'$or':_[_0x09ec('0x2d')](_0x3221f4,function(_0x35c0e9){if(_0x35c0e9['type']!==_0x09ec('0x43')){var _0x4a43fe={};_0x4a43fe[_0x35c0e9[_0x09ec('0x2a')]]={'$like':'%'+_0x3318bd['query'][_0x09ec('0x41')]+'%'};return _0x4a43fe;}})});}_0xef5339=_[_0x09ec('0x42')]({},_0xef5339,_0x3318bd['options']);var _0x5135b0={'where':_0xef5339['where']};return db[_0x09ec('0x44')][_0x09ec('0x1d')](_0x5135b0)[_0x09ec('0x24')](function(_0x139a0d){_0x5a7a0c[_0x09ec('0x1d')]=_0x139a0d;if(_0x3318bd[_0x09ec('0x33')][_0x09ec('0x45')]){_0xef5339['include']=[{'all':!![]}];}return db[_0x09ec('0x44')][_0x09ec('0x46')](_0xef5339);})[_0x09ec('0x24')](function(_0x3ceed2){_0x5a7a0c[_0x09ec('0x47')]=_0x3ceed2;return _0x5a7a0c;})[_0x09ec('0x24')](respondWithFilteredResult(_0x1389f7,_0xef5339))['catch'](handleError(_0x1389f7,null));};exports['show']=function(_0x3fc097,_0x102c68){var _0x243d50={'raw':!![],'where':{'id':_0x3fc097[_0x09ec('0x48')]['id']}},_0x257123={};_0x257123[_0x09ec('0x32')]=_[_0x09ec('0x34')](db[_0x09ec('0x44')][_0x09ec('0x2e')]);_0x257123[_0x09ec('0x33')]=_[_0x09ec('0x34')](_0x3fc097['query']);_0x257123[_0x09ec('0x40')]=_[_0x09ec('0x36')](_0x257123[_0x09ec('0x32')],_0x257123[_0x09ec('0x33')]);_0x243d50['attributes']=_[_0x09ec('0x36')](_0x257123[_0x09ec('0x32')],qs[_0x09ec('0x37')](_0x3fc097['query']['fields']));_0x243d50[_0x09ec('0x35')]=_0x243d50[_0x09ec('0x35')]['length']?_0x243d50[_0x09ec('0x35')]:_0x257123[_0x09ec('0x32')];if(_0x3fc097[_0x09ec('0x33')]['includeAll']){_0x243d50[_0x09ec('0x49')]=[{'all':!![]}];}_0x243d50=_['merge']({},_0x243d50,_0x3fc097['options']);return db['AnalyticDefaultReport']['find'](_0x243d50)['then'](handleEntityNotFound(_0x102c68,null))[_0x09ec('0x24')](respondWithResult(_0x102c68,null))[_0x09ec('0x4a')](handleError(_0x102c68,null));};exports[_0x09ec('0x4b')]=function(_0x14ac4e,_0x75687d){return db[_0x09ec('0x44')][_0x09ec('0x4b')](_0x14ac4e[_0x09ec('0x4c')],{})[_0x09ec('0x24')](function(_0x4f33b8){var _0x46a90f=_0x14ac4e['user'][_0x09ec('0x26')]({'plain':!![]});if(!_0x46a90f)throw new Error(_0x09ec('0x4d'));if(_0x46a90f[_0x09ec('0x4e')]===_0x09ec('0x4f')){var _0x29d1e7=_0x4f33b8[_0x09ec('0x26')]({'plain':!![]});var _0x58754d='Reports';return db[_0x09ec('0x50')][_0x09ec('0x51')]({'where':{'name':_0x58754d,'userProfileId':_0x46a90f[_0x09ec('0x52')]},'raw':!![]})[_0x09ec('0x24')](function(_0x151d26){if(_0x151d26&&_0x151d26[_0x09ec('0x53')]===0x0){return db[_0x09ec('0x54')][_0x09ec('0x4b')]({'name':_0x29d1e7[_0x09ec('0x2a')],'resourceId':_0x29d1e7['id'],'type':_0x09ec('0x27'),'sectionId':_0x151d26['id']},{})['then'](function(){return _0x4f33b8;});}else{return _0x4f33b8;}})[_0x09ec('0x4a')](function(_0x17c1b9){logger[_0x09ec('0x28')](_0x09ec('0x55'),_0x17c1b9);throw _0x17c1b9;});}return _0x4f33b8;})[_0x09ec('0x24')](respondWithResult(_0x75687d,0xc9))[_0x09ec('0x4a')](handleError(_0x75687d,null));};exports[_0x09ec('0x23')]=function(_0x3d6dee,_0x64d121){if(_0x3d6dee[_0x09ec('0x4c')]['id']){delete _0x3d6dee[_0x09ec('0x4c')]['id'];}return db[_0x09ec('0x44')]['find']({'where':{'id':_0x3d6dee[_0x09ec('0x48')]['id']}})[_0x09ec('0x24')](handleEntityNotFound(_0x64d121,null))[_0x09ec('0x24')](saveUpdates(_0x3d6dee['body'],null))['then'](respondWithResult(_0x64d121,null))['catch'](handleError(_0x64d121,null));};exports[_0x09ec('0x25')]=function(_0x74c040,_0x49d489){return db[_0x09ec('0x44')][_0x09ec('0x51')]({'where':{'id':_0x74c040['params']['id']}})[_0x09ec('0x24')](handleEntityNotFound(_0x49d489,null))[_0x09ec('0x24')](removeEntity(_0x49d489,null))[_0x09ec('0x4a')](handleError(_0x49d489,null));};exports['preview']=function(_0x20025b,_0x3a6435){var _0x50fe64=0xa;var _0x558b60=[_0x09ec('0x56'),_0x09ec('0x57'),_0x09ec('0x58'),_0x09ec('0x59')];var _0x197e60={'SUM':_0x09ec('0x5a'),'COUNT':_0x09ec('0x5b'),'COUNT DISTINCT':_0x09ec('0x5c'),'MAX':_0x09ec('0x5d'),'MIN':'MIN(%s)','AVG':_0x09ec('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x09ec('0x5f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x498b87={'SEC_TO_TIME':_0x09ec('0x60'),'DATE':_0x09ec('0x61'),'HOUR':_0x09ec('0x62'),'ROUND':_0x09ec('0x63'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x315588=function(_0xebd51d){return!_['includes'](['IS\x20NULL',_0x09ec('0x64'),'IS\x20EMPTY',_0x09ec('0x65')],_0xebd51d);};var _0x47ac5c=function(_0x3b7bba){if(!_0x3b7bba||!_0x3b7bba['rules'][_0x09ec('0x38')]){return'';}for(var _0x3e4183='(',_0x1f8af7=0x0;_0x1f8af7<_0x3b7bba[_0x09ec('0x66')][_0x09ec('0x38')];_0x1f8af7+=0x1){_0x1f8af7>0x0&&(_0x3e4183+='\x20'+_0x3b7bba[_0x09ec('0x67')]+'\x20');_0x3e4183+=_0x3b7bba['rules'][_0x1f8af7][_0x09ec('0x68')]?_0x47ac5c(_0x3b7bba[_0x09ec('0x66')][_0x1f8af7][_0x09ec('0x68')]):_0x3b7bba[_0x09ec('0x66')][_0x1f8af7]['field']+'\x20'+_0x3b7bba[_0x09ec('0x66')][_0x1f8af7][_0x09ec('0x69')]+(_0x315588(_0x3b7bba[_0x09ec('0x66')][_0x1f8af7][_0x09ec('0x69')])?'\x20'+_0x3b7bba[_0x09ec('0x66')][_0x1f8af7][_0x09ec('0x6a')]:'');}return _0x3e4183+')';};var _0xcb3b48={'where':{'id':_0x20025b[_0x09ec('0x48')]['id']}},_0x3fcea7,_0x32e346,_0x55d5be,_0x1ac38,_0x30225d;_0xcb3b48=_[_0x09ec('0x42')]({},_0xcb3b48,_0x20025b[_0x09ec('0x6b')]);return db['AnalyticDefaultReport'][_0x09ec('0x51')](_0xcb3b48)[_0x09ec('0x24')](function(_0x378c14){if(_0x378c14){_0x3fcea7=_0x378c14;return _0x378c14[_0x09ec('0x6c')]();}return null;})[_0x09ec('0x24')](function(_0x45c7f9){if(_0x45c7f9){if(!_0x45c7f9[_0x09ec('0x38')]){throw new db[(_0x09ec('0x6d'))][(_0x09ec('0x6e'))](_0x09ec('0x6f'),0x193);}_0x32e346=_0x45c7f9;return db['AnalyticMetric'][_0x09ec('0x46')]({'raw':!![]});}return null;})['then'](function(_0x318a25){if(_0x318a25){_0x55d5be=_[_0x09ec('0x70')](_0x318a25,'id');var _0x2755a0;var _0x157cd0=squel[_0x09ec('0x71')]();_0x157cd0[_0x09ec('0x72')](_0x3fcea7[_0x09ec('0x73')]);for(var _0x4ec138=0x0;_0x4ec138<_0x32e346['length'];_0x4ec138+=0x1){_0x2755a0=_0x32e346[_0x4ec138][_0x09ec('0x74')]?_0x55d5be[_0x32e346[_0x4ec138][_0x09ec('0x74')]]['metric']:_0x32e346[_0x4ec138][_0x09ec('0x75')];_0x2755a0=_0x32e346[_0x4ec138][_0x09ec('0x76')]?_['replace'](_0x197e60[_0x32e346[_0x4ec138][_0x09ec('0x76')]],'%s',_0x2755a0):_0x2755a0;_0x2755a0=_0x32e346[_0x4ec138]['format']?_[_0x09ec('0x77')](_0x498b87[_0x32e346[_0x4ec138][_0x09ec('0x78')]],'%s',_0x2755a0):_0x2755a0;if(_0x32e346[_0x4ec138]['groupBy']){_0x157cd0[_0x09ec('0x68')](_0x2755a0);}_0x32e346[_0x4ec138][_0x09ec('0x79')]&&_0x157cd0[_0x09ec('0x3d')](_0x2755a0,_0x32e346[_0x4ec138][_0x09ec('0x79')]===_0x09ec('0x7a')?![]:!![]);_0x157cd0[_0x09ec('0x75')](_0x2755a0,_0x32e346[_0x4ec138]['alias']||_0x2755a0);}if(_0x3fcea7[_0x09ec('0x7b')]){_0x3fcea7[_0x09ec('0x7b')]=JSON['parse'](_0x3fcea7[_0x09ec('0x7b')]);for(var _0x472c58=0x0;_0x472c58<_0x3fcea7['joins']['length'];_0x472c58+=0x1){if(_0x3fcea7[_0x09ec('0x7b')][_0x472c58][_0x09ec('0x30')]&&_[_0x09ec('0x7c')](_0x558b60,_0x3fcea7['joins'][_0x472c58]['type'])&&_0x3fcea7['joins'][_0x472c58][_0x09ec('0x7d')]&&_0x3fcea7[_0x09ec('0x7b')][_0x472c58]['foreignTable']&&_0x3fcea7['joins'][_0x472c58]['foreignKey']){_0x157cd0[_0x3fcea7['joins'][_0x472c58][_0x09ec('0x30')]](_0x3fcea7[_0x09ec('0x7b')][_0x472c58][_0x09ec('0x7e')],null,util['format'](_0x09ec('0x7f'),_0x3fcea7[_0x09ec('0x73')],_0x3fcea7['joins'][_0x472c58][_0x09ec('0x7d')],_0x3fcea7['joins'][_0x472c58][_0x09ec('0x7e')],_0x3fcea7[_0x09ec('0x7b')][_0x472c58]['foreignKey']));}}}if(_0x3fcea7['conditions']){_0x3fcea7['conditions']=JSON[_0x09ec('0x80')](_0x3fcea7[_0x09ec('0x81')]);_0x157cd0[_0x09ec('0x3f')](_0x47ac5c(_0x3fcea7[_0x09ec('0x81')][_0x09ec('0x68')]));}_0x30225d=_0x157cd0[_0x09ec('0x82')]();_0x157cd0[_0x09ec('0x3b')](_0x50fe64);_0x157cd0[_0x09ec('0x3c')](0x0);logger[_0x09ec('0x83')]('Limited\x20Query:',_0x157cd0[_0x09ec('0x84')]());return db[_0x09ec('0x85')]['query'](_0x157cd0['toString'](),{'type':db['sequelize'][_0x09ec('0x86')][_0x09ec('0x87')]});}})[_0x09ec('0x24')](respondWithResult(_0x3a6435,null))[_0x09ec('0x4a')](handleError(_0x3a6435,null));};function runReport(_0x4c4a5e,_0xe5e8a,_0x46495f){var _0x120f5b=_0xe5e8a[_0x09ec('0x2a')];var _0xe924dd=0xa;var _0x252365=[_0x09ec('0x56'),_0x09ec('0x57'),_0x09ec('0x58'),_0x09ec('0x59')];var _0x566429={'SUM':_0x09ec('0x5a'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x09ec('0x5c'),'MAX':_0x09ec('0x5d'),'MIN':_0x09ec('0x88'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x09ec('0x89')};var _0x127947={'SEC_TO_TIME':_0x09ec('0x60'),'DATE':'DATE(%s)','HOUR':_0x09ec('0x62'),'ROUND':_0x09ec('0x63'),'UNIX_TIMESTAMP':_0x09ec('0x8a')};var _0x2c731e=function(_0xad8536){return!_[_0x09ec('0x7c')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x09ec('0x8b'),'IS\x20NOT\x20EMPTY'],_0xad8536);};var _0x5d916a=function(_0x3b8374){if(!_0x3b8374||!_0x3b8374[_0x09ec('0x66')]['length']){return'';}for(var _0x4ed123='(',_0x130976=0x0;_0x130976<_0x3b8374[_0x09ec('0x66')]['length'];_0x130976+=0x1){_0x130976>0x0&&(_0x4ed123+='\x20'+_0x3b8374[_0x09ec('0x67')]+'\x20');_0x4ed123+=_0x3b8374[_0x09ec('0x66')][_0x130976]['group']?_0x5d916a(_0x3b8374[_0x09ec('0x66')][_0x130976]['group']):_0x3b8374['rules'][_0x130976][_0x09ec('0x75')]+'\x20'+_0x3b8374['rules'][_0x130976][_0x09ec('0x69')]+(_0x2c731e(_0x3b8374[_0x09ec('0x66')][_0x130976][_0x09ec('0x69')])?'\x20'+_0x3b8374[_0x09ec('0x66')][_0x130976]['value']:'');}return _0x4ed123+')';};var _0x2d5b87={'where':{'id':_0x4c4a5e['id']}},_0x4150be,_0x2f298b,_0x5107d7,_0x5e43f5,_0x4f80f1;_0x2d5b87=_[_0x09ec('0x42')]({},_0x2d5b87,_0x46495f);return db[_0x09ec('0x44')][_0x09ec('0x51')](_0x2d5b87)['then'](function(_0x134ad0){if(_0x134ad0){_0x4150be=_0x134ad0;return _0x134ad0[_0x09ec('0x6c')]();}return null;})[_0x09ec('0x24')](function(_0xad6b05){if(_0xad6b05){if(!_0xad6b05[_0x09ec('0x38')]){throw new db['Sequelize'][(_0x09ec('0x6e'))](_0x09ec('0x6f'),0x193);}_0x2f298b=_0xad6b05;return db['AnalyticMetric'][_0x09ec('0x46')]({'raw':!![]});}return null;})[_0x09ec('0x24')](function(_0x90dfb6){if(_0x90dfb6){_0x5107d7=_['keyBy'](_0x90dfb6,'id');var _0x3433c6;var _0x322788=squel[_0x09ec('0x71')]();_0x322788['from'](_0x4150be[_0x09ec('0x73')]);for(var _0x79b13a=0x0;_0x79b13a<_0x2f298b[_0x09ec('0x38')];_0x79b13a+=0x1){_0x3433c6=_0x2f298b[_0x79b13a][_0x09ec('0x74')]?_0x5107d7[_0x2f298b[_0x79b13a][_0x09ec('0x74')]][_0x09ec('0x8c')]:_0x2f298b[_0x79b13a][_0x09ec('0x75')];_0x3433c6=_0x2f298b[_0x79b13a][_0x09ec('0x76')]?_[_0x09ec('0x77')](_0x566429[_0x2f298b[_0x79b13a][_0x09ec('0x76')]],'%s',_0x3433c6):_0x3433c6;_0x3433c6=_0x2f298b[_0x79b13a]['format']?_[_0x09ec('0x77')](_0x127947[_0x2f298b[_0x79b13a][_0x09ec('0x78')]],'%s',_0x3433c6):_0x3433c6;if(_0x2f298b[_0x79b13a][_0x09ec('0x8d')]){_0x322788[_0x09ec('0x68')](_0x3433c6);}_0x2f298b[_0x79b13a][_0x09ec('0x79')]&&_0x322788['order'](_0x3433c6,_0x2f298b[_0x79b13a]['orderBy']===_0x09ec('0x7a')?![]:!![]);_0x322788[_0x09ec('0x75')](_0x3433c6,_0x2f298b[_0x79b13a]['alias']||_0x3433c6);}if(_0x4150be[_0x09ec('0x7b')]){_0x4150be[_0x09ec('0x7b')]=JSON[_0x09ec('0x80')](_0x4150be[_0x09ec('0x7b')]);for(var _0xf89455=0x0;_0xf89455<_0x4150be[_0x09ec('0x7b')][_0x09ec('0x38')];_0xf89455+=0x1){if(_0x4150be['joins'][_0xf89455][_0x09ec('0x30')]&&_[_0x09ec('0x7c')](_0x252365,_0x4150be[_0x09ec('0x7b')][_0xf89455][_0x09ec('0x30')])&&_0x4150be[_0x09ec('0x7b')][_0xf89455][_0x09ec('0x7d')]&&_0x4150be[_0x09ec('0x7b')][_0xf89455][_0x09ec('0x7e')]&&_0x4150be['joins'][_0xf89455][_0x09ec('0x8e')]){_0x322788[_0x4150be[_0x09ec('0x7b')][_0xf89455][_0x09ec('0x30')]](_0x4150be[_0x09ec('0x7b')][_0xf89455]['foreignTable'],null,util[_0x09ec('0x78')](_0x09ec('0x7f'),_0x4150be[_0x09ec('0x73')],_0x4150be[_0x09ec('0x7b')][_0xf89455][_0x09ec('0x7d')],_0x4150be[_0x09ec('0x7b')][_0xf89455][_0x09ec('0x7e')],_0x4150be[_0x09ec('0x7b')][_0xf89455][_0x09ec('0x8e')]));}}}if(_0x4150be['conditions']){_0x4150be[_0x09ec('0x81')]=JSON[_0x09ec('0x80')](_0x4150be[_0x09ec('0x81')]);_0x322788[_0x09ec('0x3f')](_0x5d916a(_0x4150be[_0x09ec('0x81')]['group']));}_0x4f80f1=_0x322788[_0x09ec('0x82')]();_0x322788[_0x09ec('0x3b')](_0xe924dd);_0x322788[_0x09ec('0x3c')](0x0);logger[_0x09ec('0x83')]('Limited\x20Query:',_0x322788[_0x09ec('0x84')]());return db[_0x09ec('0x85')][_0x09ec('0x33')](_0x322788['toString'](),{'type':db['sequelize'][_0x09ec('0x86')][_0x09ec('0x87')]});}})[_0x09ec('0x24')](function(_0x57d0ce){if(!_0x57d0ce[_0x09ec('0x38')]){throw new db['Sequelize'][(_0x09ec('0x6e'))](_0x09ec('0x8f'),0xcc);}if(_0xe5e8a['output']==='web'){return null;}var _0x1b8ab2=_[_0x09ec('0x42')](_0xe5e8a,{'name':_0xe5e8a[_0x09ec('0x90')]||_0xe5e8a[_0x09ec('0x2a')]||_0x4150be['name'],'basename':_0x120f5b,'savename':util[_0x09ec('0x78')]('%s-%s.%s',_0xe5e8a[_0x09ec('0x2a')]||_0x4150be[_0x09ec('0x2a')],require(_0x09ec('0x91'))[_0x09ec('0x92')](0x4),_0xe5e8a[_0x09ec('0x93')]||'csv'),'reportId':_0x4150be['id'],'reportType':_0x09ec('0x94')});return db['AnalyticExtractedReport']['create'](_0x1b8ab2,{'raw':!![]});})[_0x09ec('0x24')](function(_0x141b78){if(_0x4150be['table']===_0x09ec('0x95')){_0x4f80f1[_0x09ec('0x3f')](_0x4150be[_0x09ec('0x73')]+_0x09ec('0x96'),_0xe5e8a[_0x09ec('0x97')],_0xe5e8a[_0x09ec('0x98')]);}else{_0x4f80f1[_0x09ec('0x3f')](_0x4150be[_0x09ec('0x73')]+_0x09ec('0x99'),_0xe5e8a[_0x09ec('0x97')],_0xe5e8a[_0x09ec('0x98')]);}if(_0x141b78){logger[_0x09ec('0x9a')](_0x09ec('0x9b'),_0x4f80f1[_0x09ec('0x84')]());require(_0x09ec('0x9c'))[_0x09ec('0x9d')](path[_0x09ec('0x56')](__dirname,_0x09ec('0x9e'),_0x141b78[_0x09ec('0x93')]),[_0x141b78['id'],_0x4f80f1[_0x09ec('0x84')](),path[_0x09ec('0x56')](__dirname,_0x09ec('0x9f'),_0x141b78[_0x09ec('0xa0')]),_0x120f5b]);return _0x141b78;}else{var _0x342d73=squel[_0x09ec('0x71')]();_0x342d73[_0x09ec('0x72')]('('+_0x4f80f1[_0x09ec('0x84')]()+')','countTable');_0x342d73[_0x09ec('0x75')](_0x09ec('0xa1'),_0x09ec('0x1d'));_0x4f80f1[_0x09ec('0x3b')](_0xe5e8a['limit']||_0xe924dd);_0x4f80f1['offset'](_0xe5e8a[_0x09ec('0x3c')]||0x0);return db[_0x09ec('0x85')]['query'](_0x342d73[_0x09ec('0x84')](),{'type':db['sequelize'][_0x09ec('0x86')]['SELECT']})[_0x09ec('0x24')](function(_0x125455){if(!_0x125455[_0x09ec('0x38')]){_0x5e43f5=0x0;}else{_0x5e43f5=_0x125455[0x0]['count']||0x0;}return db['sequelize'][_0x09ec('0x33')](_0x4f80f1[_0x09ec('0x84')](),{'type':db[_0x09ec('0x85')][_0x09ec('0x86')][_0x09ec('0x87')]});})['then'](function(_0x36fbb6){return{'rows':_0x36fbb6||[],'count':_0x5e43f5};});}});}exports['run']=function(_0x4fbd31,_0x2d7016){return runReport(_0x4fbd31['params'],_0x4fbd31[_0x09ec('0x33')],_0x4fbd31[_0x09ec('0x6b')])[_0x09ec('0x24')](respondWithResult(_0x2d7016,null))[_0x09ec('0x4a')](handleError(_0x2d7016,null));};exports['runReport']=runReport;exports['query']=function(_0x54859b,_0x362c58){var _0x14f2a5=0xa;var _0x5781d3=[_0x09ec('0x56'),_0x09ec('0x57'),_0x09ec('0x58'),'cross_join'];var _0x44b0bf={'SUM':_0x09ec('0x5a'),'COUNT':_0x09ec('0x5b'),'COUNT DISTINCT':_0x09ec('0x5c'),'MAX':_0x09ec('0x5d'),'MIN':_0x09ec('0x88'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x09ec('0xa2'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x09ec('0x89')};var _0x3b1d7b={'SEC_TO_TIME':_0x09ec('0x60'),'DATE':_0x09ec('0x61'),'HOUR':_0x09ec('0x62'),'ROUND':_0x09ec('0x63'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xd65e78=function(_0x14b802){return!_[_0x09ec('0x7c')](['IS\x20NULL',_0x09ec('0x64'),_0x09ec('0x8b'),_0x09ec('0x65')],_0x14b802);};var _0x378c0f=function(_0x603f6c){if(!_0x603f6c||!_0x603f6c[_0x09ec('0x66')][_0x09ec('0x38')]){return'';}for(var _0x518518='(',_0x497078=0x0;_0x497078<_0x603f6c[_0x09ec('0x66')][_0x09ec('0x38')];_0x497078+=0x1){_0x497078>0x0&&(_0x518518+='\x20'+_0x603f6c[_0x09ec('0x67')]+'\x20');_0x518518+=_0x603f6c['rules'][_0x497078][_0x09ec('0x68')]?_0x378c0f(_0x603f6c[_0x09ec('0x66')][_0x497078][_0x09ec('0x68')]):_0x603f6c[_0x09ec('0x66')][_0x497078][_0x09ec('0x75')]+'\x20'+_0x603f6c['rules'][_0x497078][_0x09ec('0x69')]+(_0xd65e78(_0x603f6c[_0x09ec('0x66')][_0x497078][_0x09ec('0x69')])?'\x20'+_0x603f6c['rules'][_0x497078][_0x09ec('0x6a')]:'');}return _0x518518+')';};var _0x46528d={'where':{'id':_0x54859b['params']['id']}},_0xc54753,_0x52cfae,_0xbb01fd,_0x5d6d3f,_0x3ac0d5;_0x46528d=_[_0x09ec('0x42')]({},_0x46528d,_0x54859b['options']);return db[_0x09ec('0x44')]['find'](_0x46528d)['then'](function(_0xef5370){if(_0xef5370){_0xc54753=_0xef5370;return _0xef5370['getFields']();}return null;})[_0x09ec('0x24')](function(_0x225a77){if(_0x225a77){if(!_0x225a77['length']){throw new db[(_0x09ec('0x6d'))][(_0x09ec('0x6e'))](_0x09ec('0x6f'),0x193);}_0x52cfae=_0x225a77;return db[_0x09ec('0xa3')][_0x09ec('0x46')]({'raw':!![]});}return null;})[_0x09ec('0x24')](function(_0x491572){if(_0x491572){_0xbb01fd=_[_0x09ec('0x70')](_0x491572,'id');var _0x16b870;var _0x1e63e0=squel[_0x09ec('0x71')]();_0x1e63e0[_0x09ec('0x72')](_0xc54753[_0x09ec('0x73')]);for(var _0x407856=0x0;_0x407856<_0x52cfae[_0x09ec('0x38')];_0x407856+=0x1){_0x16b870=_0x52cfae[_0x407856]['MetricId']?_0xbb01fd[_0x52cfae[_0x407856][_0x09ec('0x74')]][_0x09ec('0x8c')]:_0x52cfae[_0x407856]['field'];_0x16b870=_0x52cfae[_0x407856][_0x09ec('0x76')]?_[_0x09ec('0x77')](_0x44b0bf[_0x52cfae[_0x407856][_0x09ec('0x76')]],'%s',_0x16b870):_0x16b870;_0x16b870=_0x52cfae[_0x407856][_0x09ec('0x78')]?_['replace'](_0x3b1d7b[_0x52cfae[_0x407856][_0x09ec('0x78')]],'%s',_0x16b870):_0x16b870;if(_0x52cfae[_0x407856][_0x09ec('0x8d')]){_0x1e63e0[_0x09ec('0x68')](_0x16b870);}_0x52cfae[_0x407856][_0x09ec('0x79')]&&_0x1e63e0[_0x09ec('0x3d')](_0x16b870,_0x52cfae[_0x407856]['orderBy']===_0x09ec('0x7a')?![]:!![]);_0x1e63e0['field'](_0x16b870,_0x52cfae[_0x407856][_0x09ec('0xa4')]||_0x16b870);}if(_0xc54753['joins']){_0xc54753[_0x09ec('0x7b')]=JSON[_0x09ec('0x80')](_0xc54753[_0x09ec('0x7b')]);for(var _0x3a5812=0x0;_0x3a5812<_0xc54753[_0x09ec('0x7b')][_0x09ec('0x38')];_0x3a5812+=0x1){if(_0xc54753[_0x09ec('0x7b')][_0x3a5812][_0x09ec('0x30')]&&_[_0x09ec('0x7c')](_0x5781d3,_0xc54753[_0x09ec('0x7b')][_0x3a5812]['type'])&&_0xc54753['joins'][_0x3a5812][_0x09ec('0x7d')]&&_0xc54753[_0x09ec('0x7b')][_0x3a5812][_0x09ec('0x7e')]&&_0xc54753[_0x09ec('0x7b')][_0x3a5812][_0x09ec('0x8e')]){_0x1e63e0[_0xc54753[_0x09ec('0x7b')][_0x3a5812]['type']](_0xc54753['joins'][_0x3a5812][_0x09ec('0x7e')],null,util[_0x09ec('0x78')](_0x09ec('0x7f'),_0xc54753[_0x09ec('0x73')],_0xc54753[_0x09ec('0x7b')][_0x3a5812][_0x09ec('0x7d')],_0xc54753['joins'][_0x3a5812][_0x09ec('0x7e')],_0xc54753[_0x09ec('0x7b')][_0x3a5812][_0x09ec('0x8e')]));}}}if(_0xc54753[_0x09ec('0x81')]){_0xc54753[_0x09ec('0x81')]=JSON[_0x09ec('0x80')](_0xc54753[_0x09ec('0x81')]);_0x1e63e0[_0x09ec('0x3f')](_0x378c0f(_0xc54753[_0x09ec('0x81')][_0x09ec('0x68')]));}_0x3ac0d5=_0x1e63e0[_0x09ec('0x82')]();_0x1e63e0[_0x09ec('0x3b')](_0x14f2a5);_0x1e63e0[_0x09ec('0x3c')](0x0);logger[_0x09ec('0x83')](_0x09ec('0xa5'),_0x1e63e0[_0x09ec('0x84')]());return db[_0x09ec('0x85')][_0x09ec('0x33')](_0x1e63e0[_0x09ec('0x84')](),{'type':db[_0x09ec('0x85')]['QueryTypes'][_0x09ec('0x87')]});}})['then'](function(){return{'sql':_0x3ac0d5[_0x09ec('0x84')]()};})[_0x09ec('0x24')](respondWithResult(_0x362c58,null))['catch'](handleError(_0x362c58,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 87e3bdd..78320e1 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 _0x5ff3=['analytics_default_reports','util','api','bluebird','request-promise','path','rimraf','./analyticDefaultReport.attributes','exports','define'];(function(_0x40ac28,_0x1b8524){var _0x56048f=function(_0x59fce2){while(--_0x59fce2){_0x40ac28['push'](_0x40ac28['shift']());}};_0x56048f(++_0x1b8524);}(_0x5ff3,0x17d));var _0x35ff=function(_0x3b0776,_0x2eab10){_0x3b0776=_0x3b0776-0x0;var _0x49e4a7=_0x5ff3[_0x3b0776];return _0x49e4a7;};'use strict';var _=require('lodash');var util=require(_0x35ff('0x0'));var logger=require('../../config/logger')(_0x35ff('0x1'));var moment=require('moment');var BPromise=require(_0x35ff('0x2'));var rp=require(_0x35ff('0x3'));var fs=require('fs');var path=require(_0x35ff('0x4'));var rimraf=require(_0x35ff('0x5'));var config=require('../../config/environment');var attributes=require(_0x35ff('0x6'));module[_0x35ff('0x7')]=function(_0x2e9873,_0x11e738){return _0x2e9873[_0x35ff('0x8')]('AnalyticDefaultReport',attributes,{'tableName':_0x35ff('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa8d1=['bluebird','request-promise','path','../../config/environment','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','api','moment'];(function(_0x55b136,_0x5e8cda){var _0x52ddc0=function(_0x3674a0){while(--_0x3674a0){_0x55b136['push'](_0x55b136['shift']());}};_0x52ddc0(++_0x5e8cda);}(_0xa8d1,0x98));var _0x1a8d=function(_0x51bdda,_0x5666ca){_0x51bdda=_0x51bdda-0x0;var _0x998aab=_0xa8d1[_0x51bdda];return _0x998aab;};'use strict';var _=require(_0x1a8d('0x0'));var util=require(_0x1a8d('0x1'));var logger=require('../../config/logger')(_0x1a8d('0x2'));var moment=require(_0x1a8d('0x3'));var BPromise=require(_0x1a8d('0x4'));var rp=require(_0x1a8d('0x5'));var fs=require('fs');var path=require(_0x1a8d('0x6'));var rimraf=require('rimraf');var config=require(_0x1a8d('0x7'));var attributes=require('./analyticDefaultReport.attributes');module[_0x1a8d('0x8')]=function(_0x404c8e,_0x26dab3){return _0x404c8e[_0x1a8d('0x9')](_0x1a8d('0xa'),attributes,{'tableName':_0x1a8d('0xb'),'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 4047253..dabed16 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 _0x8369=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x8369,0x10b));var _0x9836=function(_0x4ca6eb,_0xbf15e5){_0x4ca6eb=_0x4ca6eb-0x0;var _0x4fa9f7=_0x8369[_0x4ca6eb];return _0x4fa9f7;};'use strict';var _=require(_0x9836('0x0'));var util=require(_0x9836('0x1'));var moment=require(_0x9836('0x2'));var BPromise=require(_0x9836('0x3'));var rs=require(_0x9836('0x4'));var fs=require('fs');var Redis=require(_0x9836('0x5'));var db=require(_0x9836('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9836('0x7'))('rpc');var config=require(_0x9836('0x8'));var jayson=require(_0x9836('0x9'));var client=jayson['client'][_0x9836('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e4979,_0x52ae78,_0x37214e){return new BPromise(function(_0x3007ed,_0x16db95){return client[_0x9836('0xb')](_0x2e4979,_0x37214e)['then'](function(_0x30bc66){logger[_0x9836('0xc')](_0x9836('0xd'),_0x52ae78,_0x9836('0xe'));logger['debug'](_0x9836('0xf'),_0x52ae78,_0x9836('0xe'),JSON[_0x9836('0x10')](_0x30bc66));if(_0x30bc66[_0x9836('0x11')]){if(_0x30bc66[_0x9836('0x11')]['code']===0x1f4){logger[_0x9836('0x11')](_0x9836('0xd'),_0x52ae78,_0x30bc66[_0x9836('0x11')][_0x9836('0x12')]);return _0x16db95(_0x30bc66[_0x9836('0x11')][_0x9836('0x12')]);}logger[_0x9836('0x11')](_0x9836('0xd'),_0x52ae78,_0x30bc66['error'][_0x9836('0x12')]);return _0x3007ed(_0x30bc66[_0x9836('0x11')][_0x9836('0x12')]);}else{logger['info'](_0x9836('0xd'),_0x52ae78,'request\x20sent');_0x3007ed(_0x30bc66[_0x9836('0x13')]['message']);}})[_0x9836('0x14')](function(_0x22f9b5){logger[_0x9836('0x11')](_0x9836('0xd'),_0x52ae78,_0x22f9b5);_0x16db95(_0x22f9b5);});});} \ No newline at end of file +var _0x515d=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x590941,_0x1981e0){var _0x43c7bc=function(_0x1cd545){while(--_0x1cd545){_0x590941['push'](_0x590941['shift']());}};_0x43c7bc(++_0x1981e0);}(_0x515d,0x104));var _0xd515=function(_0x2154e7,_0x1b05d2){_0x2154e7=_0x2154e7-0x0;var _0x3857ea=_0x515d[_0x2154e7];return _0x3857ea;};'use strict';var _=require('lodash');var util=require(_0xd515('0x0'));var moment=require(_0xd515('0x1'));var BPromise=require(_0xd515('0x2'));var rs=require(_0xd515('0x3'));var fs=require('fs');var Redis=require(_0xd515('0x4'));var db=require(_0xd515('0x5'))['db'];var utils=require(_0xd515('0x6'));var logger=require(_0xd515('0x7'))('rpc');var config=require(_0xd515('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd515('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1130fc,_0x43d633,_0x26a25d){return new BPromise(function(_0x2ec6e2,_0x55a0da){return client[_0xd515('0xa')](_0x1130fc,_0x26a25d)[_0xd515('0xb')](function(_0x138086){logger[_0xd515('0xc')](_0xd515('0xd'),_0x43d633,_0xd515('0xe'));logger['debug'](_0xd515('0xf'),_0x43d633,_0xd515('0xe'),JSON[_0xd515('0x10')](_0x138086));if(_0x138086[_0xd515('0x11')]){if(_0x138086['error'][_0xd515('0x12')]===0x1f4){logger[_0xd515('0x11')](_0xd515('0xd'),_0x43d633,_0x138086[_0xd515('0x11')][_0xd515('0x13')]);return _0x55a0da(_0x138086[_0xd515('0x11')][_0xd515('0x13')]);}logger[_0xd515('0x11')](_0xd515('0xd'),_0x43d633,_0x138086[_0xd515('0x11')][_0xd515('0x13')]);return _0x2ec6e2(_0x138086[_0xd515('0x11')][_0xd515('0x13')]);}else{logger['info'](_0xd515('0xd'),_0x43d633,_0xd515('0xe'));_0x2ec6e2(_0x138086[_0xd515('0x14')][_0xd515('0x13')]);}})[_0xd515('0x15')](function(_0x33dbb6){logger[_0xd515('0x11')](_0xd515('0xd'),_0x43d633,_0x33dbb6);_0x55a0da(_0x33dbb6);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index f6a6354..3b0db9c 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 _0x95a7=['destroy','exports','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/run','/:id/query','query','post','create','put','update'];(function(_0x207149,_0x262e8c){var _0x2214e3=function(_0x376ceb){while(--_0x376ceb){_0x207149['push'](_0x207149['shift']());}};_0x2214e3(++_0x262e8c);}(_0x95a7,0x1ba));var _0x795a=function(_0xc3127b,_0x44dbe7){_0xc3127b=_0xc3127b-0x0;var _0x50de6b=_0x95a7[_0xc3127b];return _0x50de6b;};'use strict';var multer=require(_0x795a('0x0'));var util=require(_0x795a('0x1'));var path=require('path');var timeout=require(_0x795a('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x795a('0x3'));var interaction=require(_0x795a('0x4'));var config=require(_0x795a('0x5'));var controller=require('./analyticDefaultReport.controller');router['get']('/',auth[_0x795a('0x6')](),controller[_0x795a('0x7')]);router[_0x795a('0x8')](_0x795a('0x9'),auth[_0x795a('0x6')](),controller[_0x795a('0xa')]);router['get']('/:id/preview',auth[_0x795a('0x6')](),controller['preview']);router[_0x795a('0x8')](_0x795a('0xb'),auth[_0x795a('0x6')](),controller['run']);router[_0x795a('0x8')](_0x795a('0xc'),auth[_0x795a('0x6')](),controller[_0x795a('0xd')]);router[_0x795a('0xe')]('/',auth['isAuthenticated'](),controller[_0x795a('0xf')]);router[_0x795a('0x10')](_0x795a('0x9'),auth[_0x795a('0x6')](),controller[_0x795a('0x11')]);router['delete'](_0x795a('0x9'),auth[_0x795a('0x6')](),controller[_0x795a('0x12')]);module[_0x795a('0x13')]=router; \ No newline at end of file +var _0x1870=['delete','destroy','exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id/preview','preview','run','/:id/query','post','create','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1870,0x75));var _0x0187=function(_0x2b7db8,_0x40fea6){_0x2b7db8=_0x2b7db8-0x0;var _0x2fd019=_0x1870[_0x2b7db8];return _0x2fd019;};'use strict';var multer=require(_0x0187('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0187('0x1'));var express=require('express');var router=express[_0x0187('0x2')]();var auth=require(_0x0187('0x3'));var interaction=require(_0x0187('0x4'));var config=require('../../config/environment');var controller=require(_0x0187('0x5'));router[_0x0187('0x6')]('/',auth[_0x0187('0x7')](),controller[_0x0187('0x8')]);router['get']('/:id',auth[_0x0187('0x7')](),controller['show']);router[_0x0187('0x6')](_0x0187('0x9'),auth[_0x0187('0x7')](),controller[_0x0187('0xa')]);router[_0x0187('0x6')]('/:id/run',auth[_0x0187('0x7')](),controller[_0x0187('0xb')]);router[_0x0187('0x6')](_0x0187('0xc'),auth[_0x0187('0x7')](),controller['query']);router[_0x0187('0xd')]('/',auth['isAuthenticated'](),controller[_0x0187('0xe')]);router['put'](_0x0187('0xf'),auth[_0x0187('0x7')](),controller['update']);router[_0x0187('0x10')](_0x0187('0xf'),auth[_0x0187('0x7')](),controller[_0x0187('0x11')]);module[_0x0187('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 2bef358..b56d70c 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 _0xeb79=['DATE','Loading','ENUM','manual','scheduled','UNSIGNED','moment','exports','csv','xlsx','STRING'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0xeb79,0x74));var _0x9eb7=function(_0x332517,_0x5220f3){_0x332517=_0x332517-0x0;var _0x10c1ab=_0xeb79[_0x332517];return _0x10c1ab;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x9eb7('0x0'));module[_0x9eb7('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x9eb7('0x2'),'pdf',_0x9eb7('0x3')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x9eb7('0x4')],'allowNull':![]},'startDate':{'type':Sequelize[_0x9eb7('0x5')]},'endDate':{'type':Sequelize[_0x9eb7('0x5')]},'status':{'type':Sequelize[_0x9eb7('0x4')],'defaultValue':_0x9eb7('0x6')},'type':{'type':Sequelize[_0x9eb7('0x7')](_0x9eb7('0x8'),_0x9eb7('0x9')),'allowNull':![],'defaultValue':_0x9eb7('0x8')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x9eb7('0xa')]},'reportType':{'type':Sequelize[_0x9eb7('0x4')]}}; \ No newline at end of file +var _0x1c7c=['DATE','Loading','manual','scheduled','sequelize','exports','STRING','ENUM','csv','pdf','xlsx'];(function(_0x40d999,_0x1a4bab){var _0x588aea=function(_0x71e217){while(--_0x71e217){_0x40d999['push'](_0x40d999['shift']());}};_0x588aea(++_0x1a4bab);}(_0x1c7c,0x138));var _0xc1c7=function(_0x454806,_0x38a38a){_0x454806=_0x454806-0x0;var _0x3e0336=_0x1c7c[_0x454806];return _0x3e0336;};'use strict';var Sequelize=require(_0xc1c7('0x0'));var moment=require('moment');module[_0xc1c7('0x1')]={'name':{'type':Sequelize[_0xc1c7('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0xc1c7('0x3')](_0xc1c7('0x4'),_0xc1c7('0x5'),_0xc1c7('0x6')),'allowNull':![],'defaultValue':_0xc1c7('0x4')},'savename':{'type':Sequelize[_0xc1c7('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xc1c7('0x7')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0xc1c7('0x2')],'defaultValue':_0xc1c7('0x8')},'type':{'type':Sequelize[_0xc1c7('0x3')](_0xc1c7('0x9'),_0xc1c7('0xa')),'allowNull':![],'defaultValue':_0xc1c7('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0xc1c7('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 20c5d51..3bdcb4f 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 _0x44d0=['sendStatus','status','end','offset','set','Content-Range','apply','reject','save','update','then','get','ExtractedReports','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','hasOwnProperty','nolimit','limit','sort','where','filter','merge','count','includeAll','include','findAll','rows','catch','show','params','intersection','fields','length','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','output','existsSync','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','join','root','format','%s.%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0xe8b6bd,_0x352d0b){var _0x320236=function(_0x33d80b){while(--_0x33d80b){_0xe8b6bd['push'](_0xe8b6bd['shift']());}};_0x320236(++_0x352d0b);}(_0x44d0,0x103));var _0x044d=function(_0x18305e,_0x4a369d){_0x18305e=_0x18305e-0x0;var _0x19088e=_0x44d0[_0x18305e];return _0x19088e;};'use strict';var pdf=require(_0x044d('0x0'));var emlformat=require(_0x044d('0x1'));var rimraf=require(_0x044d('0x2'));var zipdir=require(_0x044d('0x3'));var jsonpatch=require(_0x044d('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x044d('0x5'));var Mustache=require(_0x044d('0x6'));var util=require('util');var path=require(_0x044d('0x7'));var sox=require(_0x044d('0x8'));var csv=require('to-csv');var ejs=require(_0x044d('0x9'));var fs=require('fs');var _=require(_0x044d('0xa'));var squel=require(_0x044d('0xb'));var crypto=require(_0x044d('0xc'));var jsforce=require(_0x044d('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x044d('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x044d('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x044d('0x10'));var hardwareService=require(_0x044d('0x11'));var logger=require(_0x044d('0x12'))(_0x044d('0x13'));var utils=require(_0x044d('0x14'));var config=require(_0x044d('0x15'));var db=require(_0x044d('0x16'))['db'];function respondWithStatusCode(_0x2da13e,_0x5e1285){_0x5e1285=_0x5e1285||0xcc;return function(_0xadef42){if(_0xadef42){return _0x2da13e[_0x044d('0x17')](_0x5e1285);}return _0x2da13e[_0x044d('0x18')](_0x5e1285)[_0x044d('0x19')]();};}function respondWithResult(_0x19e120,_0x41ebaa){_0x41ebaa=_0x41ebaa||0xc8;return function(_0x3d34b5){if(_0x3d34b5){return _0x19e120[_0x044d('0x18')](_0x41ebaa)['json'](_0x3d34b5);}};}function respondWithFilteredResult(_0x5433a0,_0x2f1b30){return function(_0x11cf27){if(_0x11cf27){var _0x432ac8=_0x11cf27['count'],_0x41d2f7=_0x2f1b30[_0x044d('0x1a')],_0x23ac23=_0x2f1b30[_0x044d('0x1a')]+_0x2f1b30['limit'],_0x45ff6f;if(_0x23ac23>=_0x432ac8){_0x23ac23=_0x432ac8;_0x45ff6f=0xc8;}else{_0x45ff6f=0xce;}_0x5433a0[_0x044d('0x18')](_0x45ff6f);return _0x5433a0[_0x044d('0x1b')](_0x044d('0x1c'),_0x41d2f7+'-'+_0x23ac23+'/'+_0x432ac8)['json'](_0x11cf27);}return null;};}function patchUpdates(_0x576f3c){return function(_0x289880){try{jsonpatch[_0x044d('0x1d')](_0x289880,_0x576f3c,!![]);}catch(_0x209279){return BPromise[_0x044d('0x1e')](_0x209279);}return _0x289880[_0x044d('0x1f')]();};}function saveUpdates(_0x2ea0ab,_0x23a005){return function(_0x3ba1f0){if(_0x3ba1f0){return _0x3ba1f0[_0x044d('0x20')](_0x2ea0ab)['then'](function(_0xec72a8){return _0xec72a8;});}return null;};}function removeEntity(_0x53e2b1,_0x5c8d76){return function(_0x3390b4){if(_0x3390b4){return _0x3390b4['destroy']()[_0x044d('0x21')](function(){var _0x1afa17=_0x3390b4[_0x044d('0x22')]({'plain':!![]});var _0x3f18cd=_0x044d('0x23');return db['UserProfileResource']['destroy']({'where':{'type':_0x3f18cd,'resourceId':_0x1afa17['id']}})[_0x044d('0x21')](function(){return _0x3390b4;});})[_0x044d('0x21')](function(){_0x53e2b1['status'](0xcc)[_0x044d('0x19')]();});}};}function handleEntityNotFound(_0x42c0ef,_0x41be28){return function(_0x959936){if(!_0x959936){_0x42c0ef[_0x044d('0x17')](0x194);}return _0x959936;};}function handleError(_0x15d6ff,_0x334caa){_0x334caa=_0x334caa||0x1f4;return function(_0x502234){logger['error'](_0x502234[_0x044d('0x24')]);if(_0x502234[_0x044d('0x25')]){delete _0x502234['name'];}_0x15d6ff[_0x044d('0x18')](_0x334caa)[_0x044d('0x26')](_0x502234);};}exports[_0x044d('0x27')]=function(_0x14c8a,_0x3b225c){var _0x494d1d={},_0x36ceb3={},_0x5d6590={'count':0x0,'rows':[]};var _0x12827e=_[_0x044d('0x28')](db[_0x044d('0x29')][_0x044d('0x2a')],function(_0x2b65fb){return{'name':_0x2b65fb[_0x044d('0x2b')],'type':_0x2b65fb[_0x044d('0x2c')][_0x044d('0x2d')]};});_0x36ceb3[_0x044d('0x2e')]=_['map'](_0x12827e,_0x044d('0x25'));_0x36ceb3[_0x044d('0x2f')]=_[_0x044d('0x30')](_0x14c8a[_0x044d('0x2f')]);_0x36ceb3[_0x044d('0x31')]=_['intersection'](_0x36ceb3[_0x044d('0x2e')],_0x36ceb3[_0x044d('0x2f')]);_0x494d1d[_0x044d('0x32')]=_['intersection'](_0x36ceb3[_0x044d('0x2e')],qs['fields'](_0x14c8a['query']['fields']));_0x494d1d[_0x044d('0x32')]=_0x494d1d[_0x044d('0x32')]['length']?_0x494d1d[_0x044d('0x32')]:_0x36ceb3[_0x044d('0x2e')];if(!_0x14c8a[_0x044d('0x2f')][_0x044d('0x33')](_0x044d('0x34'))){_0x494d1d['limit']=qs['limit'](_0x14c8a[_0x044d('0x2f')][_0x044d('0x35')]);_0x494d1d[_0x044d('0x1a')]=qs[_0x044d('0x1a')](_0x14c8a[_0x044d('0x2f')]['offset']);}_0x494d1d['order']=qs['sort'](_0x14c8a[_0x044d('0x2f')][_0x044d('0x36')]);_0x494d1d[_0x044d('0x37')]=qs[_0x044d('0x31')](_['pick'](_0x14c8a[_0x044d('0x2f')],_0x36ceb3['filters']));if(_0x14c8a['query'][_0x044d('0x38')]){_0x494d1d[_0x044d('0x37')]=_[_0x044d('0x39')](_0x494d1d['where'],{'$or':_[_0x044d('0x28')](_0x12827e,function(_0x5bcd32){if(_0x5bcd32[_0x044d('0x2c')]!=='VIRTUAL'){var _0x1721b0={};_0x1721b0[_0x5bcd32[_0x044d('0x25')]]={'$like':'%'+_0x14c8a['query'][_0x044d('0x38')]+'%'};return _0x1721b0;}})});}_0x494d1d=_[_0x044d('0x39')]({},_0x494d1d,_0x14c8a['options']);var _0x438027={'where':_0x494d1d['where']};return db['AnalyticExtractedReport'][_0x044d('0x3a')](_0x438027)[_0x044d('0x21')](function(_0x451233){_0x5d6590[_0x044d('0x3a')]=_0x451233;if(_0x14c8a[_0x044d('0x2f')][_0x044d('0x3b')]){_0x494d1d[_0x044d('0x3c')]=[{'all':!![]}];}return db[_0x044d('0x29')][_0x044d('0x3d')](_0x494d1d);})[_0x044d('0x21')](function(_0x3e3ef3){_0x5d6590[_0x044d('0x3e')]=_0x3e3ef3;return _0x5d6590;})[_0x044d('0x21')](respondWithFilteredResult(_0x3b225c,_0x494d1d))[_0x044d('0x3f')](handleError(_0x3b225c,null));};exports[_0x044d('0x40')]=function(_0x448746,_0x325cad){var _0x190869={'raw':!![],'where':{'id':_0x448746[_0x044d('0x41')]['id']}},_0x31da63={};_0x31da63['model']=_['keys'](db[_0x044d('0x29')][_0x044d('0x2a')]);_0x31da63[_0x044d('0x2f')]=_[_0x044d('0x30')](_0x448746[_0x044d('0x2f')]);_0x31da63[_0x044d('0x31')]=_[_0x044d('0x42')](_0x31da63[_0x044d('0x2e')],_0x31da63['query']);_0x190869['attributes']=_[_0x044d('0x42')](_0x31da63[_0x044d('0x2e')],qs[_0x044d('0x43')](_0x448746[_0x044d('0x2f')][_0x044d('0x43')]));_0x190869['attributes']=_0x190869[_0x044d('0x32')][_0x044d('0x44')]?_0x190869['attributes']:_0x31da63[_0x044d('0x2e')];if(_0x448746[_0x044d('0x2f')][_0x044d('0x3b')]){_0x190869['include']=[{'all':!![]}];}_0x190869=_[_0x044d('0x39')]({},_0x190869,_0x448746[_0x044d('0x45')]);return db[_0x044d('0x29')]['find'](_0x190869)['then'](handleEntityNotFound(_0x325cad,null))[_0x044d('0x21')](respondWithResult(_0x325cad,null))[_0x044d('0x3f')](handleError(_0x325cad,null));};exports['create']=function(_0xf9ffea,_0x547089){return db[_0x044d('0x29')][_0x044d('0x46')](_0xf9ffea[_0x044d('0x47')],{})[_0x044d('0x21')](function(_0x553167){var _0x164855=_0xf9ffea['user']['get']({'plain':!![]});if(!_0x164855)throw new Error(_0x044d('0x48'));if(_0x164855[_0x044d('0x49')]===_0x044d('0x4a')){var _0x22b896=_0x553167[_0x044d('0x22')]({'plain':!![]});var _0x4cd1f5=_0x044d('0x23');return db[_0x044d('0x4b')][_0x044d('0x4c')]({'where':{'name':_0x4cd1f5,'userProfileId':_0x164855[_0x044d('0x4d')]},'raw':!![]})[_0x044d('0x21')](function(_0x13b84a){if(_0x13b84a&&_0x13b84a[_0x044d('0x4e')]===0x0){return db[_0x044d('0x4f')][_0x044d('0x46')]({'name':_0x22b896['name'],'resourceId':_0x22b896['id'],'type':_0x13b84a[_0x044d('0x25')],'sectionId':_0x13b84a['id']},{})[_0x044d('0x21')](function(){return _0x553167;});}else{return _0x553167;}})[_0x044d('0x3f')](function(_0x53d462){logger[_0x044d('0x50')](_0x044d('0x51'),_0x53d462);throw _0x53d462;});}return _0x553167;})['then'](respondWithResult(_0x547089,0xc9))['catch'](handleError(_0x547089,null));};exports[_0x044d('0x20')]=function(_0x308366,_0x5e024c){if(_0x308366[_0x044d('0x47')]['id']){delete _0x308366[_0x044d('0x47')]['id'];}return db[_0x044d('0x29')][_0x044d('0x4c')]({'where':{'id':_0x308366[_0x044d('0x41')]['id']}})[_0x044d('0x21')](handleEntityNotFound(_0x5e024c,null))['then'](saveUpdates(_0x308366[_0x044d('0x47')],null))[_0x044d('0x21')](respondWithResult(_0x5e024c,null))['catch'](handleError(_0x5e024c,null));};exports['destroy']=function(_0x409693,_0x32b489){return db[_0x044d('0x29')][_0x044d('0x4c')]({'where':{'id':_0x409693['params']['id']}})[_0x044d('0x21')](handleEntityNotFound(_0x32b489,null))['then'](removeEntity(_0x32b489,null))[_0x044d('0x3f')](handleError(_0x32b489,null));};exports[_0x044d('0x52')]=function(_0x20f11f,_0x167d1a,_0x49d75b){return db[_0x044d('0x29')][_0x044d('0x4c')]({'where':{'id':_0x20f11f[_0x044d('0x41')]['id']},'attributes':[_0x044d('0x25'),_0x044d('0x53'),_0x044d('0x54'),_0x044d('0x55')],'raw':!![]})[_0x044d('0x21')](handleEntityNotFound(_0x167d1a,null))[_0x044d('0x21')](function(_0x4cb57f){if(_0x4cb57f){if(!fs[_0x044d('0x56')](path['join'](config['root'],'server/files/reports',_0x4cb57f[_0x044d('0x54')]))){throw new db['Sequelize'][(_0x044d('0x57'))](_0x044d('0x58'));}if(_0x20f11f['query'][_0x044d('0x59')]){return _0x167d1a[_0x044d('0x17')](0xc8);}return _0x167d1a[_0x044d('0x52')](path[_0x044d('0x5a')](config[_0x044d('0x5b')],'server/files/reports',_0x4cb57f[_0x044d('0x54')]),util[_0x044d('0x5c')](_0x044d('0x5d'),_0x4cb57f['basename']||_0x4cb57f[_0x044d('0x25')],_0x4cb57f[_0x044d('0x55')]['toLowerCase']()));}})[_0x044d('0x3f')](handleError(_0x167d1a,null));}; \ No newline at end of file +var _0xf2a2=['name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','show','params','keys','include','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','destroy','download','basename','savename','output','root','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','join','server/files/reports','format','%s.%s','toLowerCase','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','save','update','then','ExtractedReports','error','stack'];(function(_0xd3602a,_0xd49085){var _0xf22d92=function(_0x37e9e6){while(--_0x37e9e6){_0xd3602a['push'](_0xd3602a['shift']());}};_0xf22d92(++_0xd49085);}(_0xf2a2,0x1be));var _0x2f2a=function(_0x2870e8,_0x45e908){_0x2870e8=_0x2870e8-0x0;var _0x13b9d=_0xf2a2[_0x2870e8];return _0x13b9d;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x2f2a('0x0'));var zipdir=require(_0x2f2a('0x1'));var jsonpatch=require(_0x2f2a('0x2'));var rp=require(_0x2f2a('0x3'));var moment=require(_0x2f2a('0x4'));var BPromise=require(_0x2f2a('0x5'));var Mustache=require('mustache');var util=require(_0x2f2a('0x6'));var path=require(_0x2f2a('0x7'));var sox=require(_0x2f2a('0x8'));var csv=require(_0x2f2a('0x9'));var ejs=require(_0x2f2a('0xa'));var fs=require('fs');var _=require(_0x2f2a('0xb'));var squel=require(_0x2f2a('0xc'));var crypto=require('crypto');var jsforce=require(_0x2f2a('0xd'));var deskjs=require(_0x2f2a('0xe'));var toCsv=require(_0x2f2a('0x9'));var querystring=require('querystring');var Papa=require(_0x2f2a('0xf'));var Redis=require('ioredis');var authService=require(_0x2f2a('0x10'));var qs=require(_0x2f2a('0x11'));var as=require(_0x2f2a('0x12'));var hardwareService=require(_0x2f2a('0x13'));var logger=require(_0x2f2a('0x14'))(_0x2f2a('0x15'));var utils=require(_0x2f2a('0x16'));var config=require(_0x2f2a('0x17'));var db=require(_0x2f2a('0x18'))['db'];function respondWithStatusCode(_0x1a72b5,_0x428d59){_0x428d59=_0x428d59||0xcc;return function(_0x139c5e){if(_0x139c5e){return _0x1a72b5[_0x2f2a('0x19')](_0x428d59);}return _0x1a72b5['status'](_0x428d59)[_0x2f2a('0x1a')]();};}function respondWithResult(_0x47e6bc,_0x38677c){_0x38677c=_0x38677c||0xc8;return function(_0x243d1b){if(_0x243d1b){return _0x47e6bc[_0x2f2a('0x1b')](_0x38677c)[_0x2f2a('0x1c')](_0x243d1b);}};}function respondWithFilteredResult(_0x4af7ac,_0x19f873){return function(_0x39fb8c){if(_0x39fb8c){var _0x1697eb=_0x39fb8c[_0x2f2a('0x1d')],_0x156774=_0x19f873[_0x2f2a('0x1e')],_0x37f0fe=_0x19f873['offset']+_0x19f873[_0x2f2a('0x1f')],_0xe311d1;if(_0x37f0fe>=_0x1697eb){_0x37f0fe=_0x1697eb;_0xe311d1=0xc8;}else{_0xe311d1=0xce;}_0x4af7ac['status'](_0xe311d1);return _0x4af7ac[_0x2f2a('0x20')]('Content-Range',_0x156774+'-'+_0x37f0fe+'/'+_0x1697eb)[_0x2f2a('0x1c')](_0x39fb8c);}return null;};}function patchUpdates(_0x2280c9){return function(_0x1e7e61){try{jsonpatch['apply'](_0x1e7e61,_0x2280c9,!![]);}catch(_0x70e07b){return BPromise['reject'](_0x70e07b);}return _0x1e7e61[_0x2f2a('0x21')]();};}function saveUpdates(_0x2e2d70,_0xc3b1f3){return function(_0x451a0f){if(_0x451a0f){return _0x451a0f[_0x2f2a('0x22')](_0x2e2d70)['then'](function(_0x157e39){return _0x157e39;});}return null;};}function removeEntity(_0x276aa3,_0x1c33f1){return function(_0x247c19){if(_0x247c19){return _0x247c19['destroy']()[_0x2f2a('0x23')](function(){var _0x41d2bc=_0x247c19['get']({'plain':!![]});var _0x35da4e=_0x2f2a('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x35da4e,'resourceId':_0x41d2bc['id']}})[_0x2f2a('0x23')](function(){return _0x247c19;});})[_0x2f2a('0x23')](function(){_0x276aa3[_0x2f2a('0x1b')](0xcc)[_0x2f2a('0x1a')]();});}};}function handleEntityNotFound(_0x4faaa5,_0x375bec){return function(_0x11d9f7){if(!_0x11d9f7){_0x4faaa5[_0x2f2a('0x19')](0x194);}return _0x11d9f7;};}function handleError(_0x223793,_0x1e718a){_0x1e718a=_0x1e718a||0x1f4;return function(_0x4c0daa){logger[_0x2f2a('0x25')](_0x4c0daa[_0x2f2a('0x26')]);if(_0x4c0daa[_0x2f2a('0x27')]){delete _0x4c0daa[_0x2f2a('0x27')];}_0x223793['status'](_0x1e718a)[_0x2f2a('0x28')](_0x4c0daa);};}exports[_0x2f2a('0x29')]=function(_0x1ca3f2,_0x5d0d1f){var _0x504256={},_0x3732a8={},_0x3e0c03={'count':0x0,'rows':[]};var _0x1164ac=_[_0x2f2a('0x2a')](db[_0x2f2a('0x2b')][_0x2f2a('0x2c')],function(_0x399f31){return{'name':_0x399f31[_0x2f2a('0x2d')],'type':_0x399f31['type'][_0x2f2a('0x2e')]};});_0x3732a8[_0x2f2a('0x2f')]=_[_0x2f2a('0x2a')](_0x1164ac,_0x2f2a('0x27'));_0x3732a8[_0x2f2a('0x30')]=_['keys'](_0x1ca3f2[_0x2f2a('0x30')]);_0x3732a8[_0x2f2a('0x31')]=_[_0x2f2a('0x32')](_0x3732a8['model'],_0x3732a8[_0x2f2a('0x30')]);_0x504256[_0x2f2a('0x33')]=_[_0x2f2a('0x32')](_0x3732a8[_0x2f2a('0x2f')],qs[_0x2f2a('0x34')](_0x1ca3f2[_0x2f2a('0x30')][_0x2f2a('0x34')]));_0x504256[_0x2f2a('0x33')]=_0x504256[_0x2f2a('0x33')][_0x2f2a('0x35')]?_0x504256[_0x2f2a('0x33')]:_0x3732a8[_0x2f2a('0x2f')];if(!_0x1ca3f2['query'][_0x2f2a('0x36')]('nolimit')){_0x504256[_0x2f2a('0x1f')]=qs[_0x2f2a('0x1f')](_0x1ca3f2[_0x2f2a('0x30')][_0x2f2a('0x1f')]);_0x504256[_0x2f2a('0x1e')]=qs['offset'](_0x1ca3f2[_0x2f2a('0x30')][_0x2f2a('0x1e')]);}_0x504256[_0x2f2a('0x37')]=qs[_0x2f2a('0x38')](_0x1ca3f2[_0x2f2a('0x30')]['sort']);_0x504256[_0x2f2a('0x39')]=qs['filters'](_[_0x2f2a('0x3a')](_0x1ca3f2[_0x2f2a('0x30')],_0x3732a8[_0x2f2a('0x31')]));if(_0x1ca3f2[_0x2f2a('0x30')][_0x2f2a('0x3b')]){_0x504256[_0x2f2a('0x39')]=_[_0x2f2a('0x3c')](_0x504256[_0x2f2a('0x39')],{'$or':_[_0x2f2a('0x2a')](_0x1164ac,function(_0x1df628){if(_0x1df628[_0x2f2a('0x3d')]!==_0x2f2a('0x3e')){var _0x5570e7={};_0x5570e7[_0x1df628[_0x2f2a('0x27')]]={'$like':'%'+_0x1ca3f2[_0x2f2a('0x30')][_0x2f2a('0x3b')]+'%'};return _0x5570e7;}})});}_0x504256=_[_0x2f2a('0x3c')]({},_0x504256,_0x1ca3f2[_0x2f2a('0x3f')]);var _0x319ae2={'where':_0x504256[_0x2f2a('0x39')]};return db['AnalyticExtractedReport'][_0x2f2a('0x1d')](_0x319ae2)['then'](function(_0x16848e){_0x3e0c03[_0x2f2a('0x1d')]=_0x16848e;if(_0x1ca3f2[_0x2f2a('0x30')][_0x2f2a('0x40')]){_0x504256['include']=[{'all':!![]}];}return db[_0x2f2a('0x2b')][_0x2f2a('0x41')](_0x504256);})['then'](function(_0x57f583){_0x3e0c03[_0x2f2a('0x42')]=_0x57f583;return _0x3e0c03;})[_0x2f2a('0x23')](respondWithFilteredResult(_0x5d0d1f,_0x504256))['catch'](handleError(_0x5d0d1f,null));};exports[_0x2f2a('0x43')]=function(_0x269cb2,_0x6c9214){var _0x24aead={'raw':!![],'where':{'id':_0x269cb2[_0x2f2a('0x44')]['id']}},_0x57407b={};_0x57407b[_0x2f2a('0x2f')]=_[_0x2f2a('0x45')](db[_0x2f2a('0x2b')][_0x2f2a('0x2c')]);_0x57407b[_0x2f2a('0x30')]=_[_0x2f2a('0x45')](_0x269cb2[_0x2f2a('0x30')]);_0x57407b[_0x2f2a('0x31')]=_[_0x2f2a('0x32')](_0x57407b[_0x2f2a('0x2f')],_0x57407b[_0x2f2a('0x30')]);_0x24aead[_0x2f2a('0x33')]=_[_0x2f2a('0x32')](_0x57407b[_0x2f2a('0x2f')],qs[_0x2f2a('0x34')](_0x269cb2[_0x2f2a('0x30')]['fields']));_0x24aead['attributes']=_0x24aead[_0x2f2a('0x33')][_0x2f2a('0x35')]?_0x24aead[_0x2f2a('0x33')]:_0x57407b['model'];if(_0x269cb2[_0x2f2a('0x30')][_0x2f2a('0x40')]){_0x24aead[_0x2f2a('0x46')]=[{'all':!![]}];}_0x24aead=_[_0x2f2a('0x3c')]({},_0x24aead,_0x269cb2[_0x2f2a('0x3f')]);return db[_0x2f2a('0x2b')][_0x2f2a('0x47')](_0x24aead)['then'](handleEntityNotFound(_0x6c9214,null))[_0x2f2a('0x23')](respondWithResult(_0x6c9214,null))[_0x2f2a('0x48')](handleError(_0x6c9214,null));};exports[_0x2f2a('0x49')]=function(_0x2b4659,_0x331c98){return db['AnalyticExtractedReport']['create'](_0x2b4659[_0x2f2a('0x4a')],{})[_0x2f2a('0x23')](function(_0x5ea2b1){var _0x57134f=_0x2b4659[_0x2f2a('0x4b')][_0x2f2a('0x4c')]({'plain':!![]});if(!_0x57134f)throw new Error(_0x2f2a('0x4d'));if(_0x57134f[_0x2f2a('0x4e')]==='user'){var _0x1a825d=_0x5ea2b1[_0x2f2a('0x4c')]({'plain':!![]});var _0x189cad='ExtractedReports';return db['UserProfileSection'][_0x2f2a('0x47')]({'where':{'name':_0x189cad,'userProfileId':_0x57134f[_0x2f2a('0x4f')]},'raw':!![]})[_0x2f2a('0x23')](function(_0x2ad684){if(_0x2ad684&&_0x2ad684[_0x2f2a('0x50')]===0x0){return db[_0x2f2a('0x51')][_0x2f2a('0x49')]({'name':_0x1a825d[_0x2f2a('0x27')],'resourceId':_0x1a825d['id'],'type':_0x2ad684[_0x2f2a('0x27')],'sectionId':_0x2ad684['id']},{})[_0x2f2a('0x23')](function(){return _0x5ea2b1;});}else{return _0x5ea2b1;}})[_0x2f2a('0x48')](function(_0x3aad67){logger[_0x2f2a('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3aad67);throw _0x3aad67;});}return _0x5ea2b1;})[_0x2f2a('0x23')](respondWithResult(_0x331c98,0xc9))['catch'](handleError(_0x331c98,null));};exports[_0x2f2a('0x22')]=function(_0x4ac71d,_0x4c80aa){if(_0x4ac71d[_0x2f2a('0x4a')]['id']){delete _0x4ac71d[_0x2f2a('0x4a')]['id'];}return db['AnalyticExtractedReport']['find']({'where':{'id':_0x4ac71d[_0x2f2a('0x44')]['id']}})[_0x2f2a('0x23')](handleEntityNotFound(_0x4c80aa,null))['then'](saveUpdates(_0x4ac71d['body'],null))[_0x2f2a('0x23')](respondWithResult(_0x4c80aa,null))[_0x2f2a('0x48')](handleError(_0x4c80aa,null));};exports[_0x2f2a('0x52')]=function(_0x4290c5,_0x5df5e2){return db[_0x2f2a('0x2b')][_0x2f2a('0x47')]({'where':{'id':_0x4290c5[_0x2f2a('0x44')]['id']}})[_0x2f2a('0x23')](handleEntityNotFound(_0x5df5e2,null))['then'](removeEntity(_0x5df5e2,null))[_0x2f2a('0x48')](handleError(_0x5df5e2,null));};exports[_0x2f2a('0x53')]=function(_0x5c4cd9,_0xd135b3,_0x16de3a){return db[_0x2f2a('0x2b')][_0x2f2a('0x47')]({'where':{'id':_0x5c4cd9['params']['id']},'attributes':[_0x2f2a('0x27'),_0x2f2a('0x54'),_0x2f2a('0x55'),_0x2f2a('0x56')],'raw':!![]})[_0x2f2a('0x23')](handleEntityNotFound(_0xd135b3,null))[_0x2f2a('0x23')](function(_0x54a942){if(_0x54a942){if(!fs['existsSync'](path['join'](config[_0x2f2a('0x57')],'server/files/reports',_0x54a942['savename']))){throw new db[(_0x2f2a('0x58'))][(_0x2f2a('0x59'))](_0x2f2a('0x5a'));}if(_0x5c4cd9[_0x2f2a('0x30')][_0x2f2a('0x5b')]){return _0xd135b3[_0x2f2a('0x19')](0xc8);}return _0xd135b3[_0x2f2a('0x53')](path[_0x2f2a('0x5c')](config[_0x2f2a('0x57')],_0x2f2a('0x5d'),_0x54a942[_0x2f2a('0x55')]),util[_0x2f2a('0x5e')](_0x2f2a('0x5f'),_0x54a942['basename']||_0x54a942['name'],_0x54a942[_0x2f2a('0x56')][_0x2f2a('0x60')]()));}})['catch'](handleError(_0xd135b3,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 6b98e98..910269b 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 _0x8ad5=['request-promise','path','rimraf','./analyticExtractedReport.attributes','exports','define','analytics_extracted_reports','util','api','moment','bluebird'];(function(_0x3517d9,_0x1e6703){var _0x29a2f4=function(_0x29efb9){while(--_0x29efb9){_0x3517d9['push'](_0x3517d9['shift']());}};_0x29a2f4(++_0x1e6703);}(_0x8ad5,0x80));var _0x58ad=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x8ad5[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0x58ad('0x0'));var logger=require('../../config/logger')(_0x58ad('0x1'));var moment=require(_0x58ad('0x2'));var BPromise=require(_0x58ad('0x3'));var rp=require(_0x58ad('0x4'));var fs=require('fs');var path=require(_0x58ad('0x5'));var rimraf=require(_0x58ad('0x6'));var config=require('../../config/environment');var attributes=require(_0x58ad('0x7'));module[_0x58ad('0x8')]=function(_0x476ccd,_0x3adaae){return _0x476ccd[_0x58ad('0x9')]('AnalyticExtractedReport',attributes,{'tableName':_0x58ad('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x38da=['define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x55e1f1,_0x553795){var _0x53f6e3=function(_0x39f55e){while(--_0x39f55e){_0x55e1f1['push'](_0x55e1f1['shift']());}};_0x53f6e3(++_0x553795);}(_0x38da,0xcf));var _0xa38d=function(_0x1b999f,_0xada878){_0x1b999f=_0x1b999f-0x0;var _0x51d27a=_0x38da[_0x1b999f];return _0x51d27a;};'use strict';var _=require(_0xa38d('0x0'));var util=require(_0xa38d('0x1'));var logger=require('../../config/logger')(_0xa38d('0x2'));var moment=require(_0xa38d('0x3'));var BPromise=require(_0xa38d('0x4'));var rp=require(_0xa38d('0x5'));var fs=require('fs');var path=require(_0xa38d('0x6'));var rimraf=require(_0xa38d('0x7'));var config=require(_0xa38d('0x8'));var attributes=require('./analyticExtractedReport.attributes');module['exports']=function(_0x6ad36a,_0xfa22b3){return _0x6ad36a[_0xa38d('0x9')](_0xa38d('0xa'),attributes,{'tableName':_0xa38d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index 6b278c2..9c29b0d 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 _0x4420=['ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','bluebird'];(function(_0x59c301,_0x359c50){var _0x3866b9=function(_0x2d380e){while(--_0x2d380e){_0x59c301['push'](_0x59c301['shift']());}};_0x3866b9(++_0x359c50);}(_0x4420,0x1b6));var _0x0442=function(_0x118b57,_0x1398b5){_0x118b57=_0x118b57-0x0;var _0x3a6c8c=_0x4420[_0x118b57];return _0x3a6c8c;};'use strict';var _=require(_0x0442('0x0'));var util=require(_0x0442('0x1'));var moment=require('moment');var BPromise=require(_0x0442('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0442('0x3'));var db=require(_0x0442('0x4'))['db'];var utils=require(_0x0442('0x5'));var logger=require(_0x0442('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0442('0x7'));var client=jayson[_0x0442('0x8')][_0x0442('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ba247,_0x5351a2,_0x2c6cdf){return new BPromise(function(_0x567179,_0x56e03a){return client[_0x0442('0xa')](_0x2ba247,_0x2c6cdf)[_0x0442('0xb')](function(_0x117d87){logger[_0x0442('0xc')](_0x0442('0xd'),_0x5351a2,_0x0442('0xe'));logger[_0x0442('0xf')](_0x0442('0x10'),_0x5351a2,_0x0442('0xe'),JSON[_0x0442('0x11')](_0x117d87));if(_0x117d87[_0x0442('0x12')]){if(_0x117d87[_0x0442('0x12')][_0x0442('0x13')]===0x1f4){logger[_0x0442('0x12')](_0x0442('0xd'),_0x5351a2,_0x117d87[_0x0442('0x12')]['message']);return _0x56e03a(_0x117d87[_0x0442('0x12')][_0x0442('0x14')]);}logger[_0x0442('0x12')](_0x0442('0xd'),_0x5351a2,_0x117d87['error']['message']);return _0x567179(_0x117d87[_0x0442('0x12')]['message']);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x5351a2,_0x0442('0xe'));_0x567179(_0x117d87['result'][_0x0442('0x14')]);}})['catch'](function(_0x53357c){logger[_0x0442('0x12')](_0x0442('0xd'),_0x5351a2,_0x53357c);_0x56e03a(_0x53357c);});});} \ No newline at end of file +var _0x072a=['lodash','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x2e6e44,_0x574770){var _0x124360=function(_0x238314){while(--_0x238314){_0x2e6e44['push'](_0x2e6e44['shift']());}};_0x124360(++_0x574770);}(_0x072a,0x93));var _0xa072=function(_0x122669,_0x15898c){_0x122669=_0x122669-0x0;var _0xd27e0=_0x072a[_0x122669];return _0xd27e0;};'use strict';var _=require(_0xa072('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa072('0x1'));var rs=require(_0xa072('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa072('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa072('0x4'))('rpc');var config=require(_0xa072('0x5'));var jayson=require(_0xa072('0x6'));var client=jayson['client'][_0xa072('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1f9e43,_0x1b9be0,_0x3b22c0){return new BPromise(function(_0x3de056,_0x6e4d28){return client[_0xa072('0x8')](_0x1f9e43,_0x3b22c0)[_0xa072('0x9')](function(_0x34ec9f){logger[_0xa072('0xa')](_0xa072('0xb'),_0x1b9be0,'request\x20sent');logger[_0xa072('0xc')](_0xa072('0xd'),_0x1b9be0,'request\x20sent',JSON[_0xa072('0xe')](_0x34ec9f));if(_0x34ec9f[_0xa072('0xf')]){if(_0x34ec9f['error'][_0xa072('0x10')]===0x1f4){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x1b9be0,_0x34ec9f[_0xa072('0xf')][_0xa072('0x11')]);return _0x6e4d28(_0x34ec9f['error'][_0xa072('0x11')]);}logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x1b9be0,_0x34ec9f[_0xa072('0xf')][_0xa072('0x11')]);return _0x3de056(_0x34ec9f[_0xa072('0xf')]['message']);}else{logger['info'](_0xa072('0xb'),_0x1b9be0,_0xa072('0x12'));_0x3de056(_0x34ec9f[_0xa072('0x13')][_0xa072('0x11')]);}})[_0xa072('0x14')](function(_0x48d53d){logger['error'](_0xa072('0xb'),_0x1b9be0,_0x48d53d);_0x6e4d28(_0x48d53d);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 11cbcd6..002b176 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 _0xf6e8=['delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','post','put','update'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf6e8,0xc1));var _0x8f6e=function(_0x115527,_0x48a5fa){_0x115527=_0x115527-0x0;var _0x1a194e=_0xf6e8[_0x115527];return _0x1a194e;};'use strict';var multer=require('multer');var util=require(_0x8f6e('0x0'));var path=require(_0x8f6e('0x1'));var timeout=require(_0x8f6e('0x2'));var express=require(_0x8f6e('0x3'));var router=express[_0x8f6e('0x4')]();var auth=require(_0x8f6e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8f6e('0x6'));var controller=require('./analyticExtractedReport.controller');router[_0x8f6e('0x7')]('/',auth[_0x8f6e('0x8')](),controller['index']);router[_0x8f6e('0x7')](_0x8f6e('0x9'),auth[_0x8f6e('0x8')](),controller[_0x8f6e('0xa')]);router[_0x8f6e('0x7')](_0x8f6e('0xb'),auth[_0x8f6e('0x8')](),controller[_0x8f6e('0xc')]);router[_0x8f6e('0xd')]('/',auth[_0x8f6e('0x8')](),controller['create']);router[_0x8f6e('0xe')](_0x8f6e('0x9'),auth['isAuthenticated'](),controller[_0x8f6e('0xf')]);router[_0x8f6e('0x10')](_0x8f6e('0x9'),auth[_0x8f6e('0x8')](),controller[_0x8f6e('0x11')]);module[_0x8f6e('0x12')]=router; \ No newline at end of file +var _0x91e4=['Router','../../components/auth/service','isAuthenticated','get','/:id','/:id/download','create','put','update','delete','destroy','multer','util','connect-timeout'];(function(_0x495984,_0x20ff45){var _0x93c24c=function(_0x48015b){while(--_0x48015b){_0x495984['push'](_0x495984['shift']());}};_0x93c24c(++_0x20ff45);}(_0x91e4,0x14d));var _0x491e=function(_0x403ede,_0x5b1aa2){_0x403ede=_0x403ede-0x0;var _0x29d672=_0x91e4[_0x403ede];return _0x29d672;};'use strict';var multer=require(_0x491e('0x0'));var util=require(_0x491e('0x1'));var path=require('path');var timeout=require(_0x491e('0x2'));var express=require('express');var router=express[_0x491e('0x3')]();var auth=require(_0x491e('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticExtractedReport.controller');router['get']('/',auth[_0x491e('0x5')](),controller['index']);router[_0x491e('0x6')](_0x491e('0x7'),auth[_0x491e('0x5')](),controller['show']);router['get'](_0x491e('0x8'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0x491e('0x5')](),controller[_0x491e('0x9')]);router[_0x491e('0xa')](_0x491e('0x7'),auth[_0x491e('0x5')](),controller[_0x491e('0xb')]);router[_0x491e('0xc')]('/:id',auth[_0x491e('0x5')](),controller[_0x491e('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index bdc9271..ef82bc9 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 _0x326f=['STRING','BOOLEAN','sequelize'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x326f,0xd1));var _0xf326=function(_0x92d22f,_0x264044){_0x92d22f=_0x92d22f-0x0;var _0x2eac13=_0x326f[_0x92d22f];return _0x2eac13;};'use strict';var Sequelize=require(_0xf326('0x0'));module['exports']={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0xf326('0x1')]},'function':{'type':Sequelize[_0xf326('0x1')]},'format':{'type':Sequelize[_0xf326('0x1')]},'groupBy':{'type':Sequelize[_0xf326('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xf326('0x1')]},'custom':{'type':Sequelize[_0xf326('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xc4aa=['exports','TEXT','STRING','sequelize'];(function(_0x399e50,_0x1ffcfb){var _0x2d4c61=function(_0x3f0fb7){while(--_0x3f0fb7){_0x399e50['push'](_0x399e50['shift']());}};_0x2d4c61(++_0x1ffcfb);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xc4aa[_0x4ff09b];return _0x3f5c2e;};'use strict';var Sequelize=require(_0xac4a('0x0'));module[_0xac4a('0x1')]={'field':{'type':Sequelize[_0xac4a('0x2')]},'alias':{'type':Sequelize[_0xac4a('0x3')]},'function':{'type':Sequelize[_0xac4a('0x3')]},'format':{'type':Sequelize[_0xac4a('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 367e076..a236e49 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 _0x3af5=['includeAll','include','findAll','catch','show','params','intersection','find','create','body','bulkCreate','bulkDestroy','ids','AnalyticCustomReport','findOne','sequelize','transaction','html-pdf','eml-format','zip-dir','fast-json-patch','bluebird','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','query','keys','filters','model','fields','length','attributes','nolimit','order','sort','where','pick','filter','merge','options'];(function(_0x229a03,_0x36fefc){var _0x2d6e11=function(_0x592d00){while(--_0x592d00){_0x229a03['push'](_0x229a03['shift']());}};_0x2d6e11(++_0x36fefc);}(_0x3af5,0x1d3));var _0x53af=function(_0x18a577,_0x25560c){_0x18a577=_0x18a577-0x0;var _0x1cb0c7=_0x3af5[_0x18a577];return _0x1cb0c7;};'use strict';var pdf=require(_0x53af('0x0'));var emlformat=require(_0x53af('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x53af('0x2'));var jsonpatch=require(_0x53af('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x53af('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x53af('0x5'));var sox=require(_0x53af('0x6'));var csv=require('to-csv');var ejs=require(_0x53af('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x53af('0x8'));var crypto=require(_0x53af('0x9'));var jsforce=require(_0x53af('0xa'));var deskjs=require(_0x53af('0xb'));var toCsv=require(_0x53af('0xc'));var querystring=require(_0x53af('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x53af('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x53af('0xf'));var hardwareService=require(_0x53af('0x10'));var logger=require('../../config/logger')(_0x53af('0x11'));var utils=require(_0x53af('0x12'));var config=require('../../config/environment');var db=require(_0x53af('0x13'))['db'];function respondWithStatusCode(_0x294b72,_0x3366ea){_0x3366ea=_0x3366ea||0xcc;return function(_0x59285f){if(_0x59285f){return _0x294b72[_0x53af('0x14')](_0x3366ea);}return _0x294b72['status'](_0x3366ea)[_0x53af('0x15')]();};}function respondWithResult(_0x27d451,_0xee9b56){_0xee9b56=_0xee9b56||0xc8;return function(_0xe7cf2){if(_0xe7cf2){return _0x27d451[_0x53af('0x16')](_0xee9b56)[_0x53af('0x17')](_0xe7cf2);}};}function respondWithFilteredResult(_0x2a5a4c,_0x1c8479){return function(_0x1ee76f){if(_0x1ee76f){var _0x3978f9=_0x1ee76f[_0x53af('0x18')],_0x4d601a=_0x1c8479[_0x53af('0x19')],_0x10d18f=_0x1c8479[_0x53af('0x19')]+_0x1c8479[_0x53af('0x1a')],_0x2db860;if(_0x10d18f>=_0x3978f9){_0x10d18f=_0x3978f9;_0x2db860=0xc8;}else{_0x2db860=0xce;}_0x2a5a4c[_0x53af('0x16')](_0x2db860);return _0x2a5a4c['set'](_0x53af('0x1b'),_0x4d601a+'-'+_0x10d18f+'/'+_0x3978f9)[_0x53af('0x17')](_0x1ee76f);}return null;};}function patchUpdates(_0xae3142){return function(_0x8771d1){try{jsonpatch['apply'](_0x8771d1,_0xae3142,!![]);}catch(_0x55427a){return BPromise[_0x53af('0x1c')](_0x55427a);}return _0x8771d1[_0x53af('0x1d')]();};}function saveUpdates(_0x37ecb3,_0x5a31d6){return function(_0x28e1fb){if(_0x28e1fb){return _0x28e1fb[_0x53af('0x1e')](_0x37ecb3)[_0x53af('0x1f')](function(_0x3cd780){return _0x3cd780;});}return null;};}function removeEntity(_0x3060a1,_0x217426){return function(_0x222d73){if(_0x222d73){return _0x222d73[_0x53af('0x20')]()['then'](function(){_0x3060a1[_0x53af('0x16')](0xcc)[_0x53af('0x15')]();});}};}function handleEntityNotFound(_0x4fea36,_0x3e164e){return function(_0x363646){if(!_0x363646){_0x4fea36[_0x53af('0x14')](0x194);}return _0x363646;};}function handleError(_0x57e09e,_0x428751){_0x428751=_0x428751||0x1f4;return function(_0x20cc70){logger[_0x53af('0x21')](_0x20cc70[_0x53af('0x22')]);if(_0x20cc70['name']){delete _0x20cc70[_0x53af('0x23')];}_0x57e09e[_0x53af('0x16')](_0x428751)[_0x53af('0x24')](_0x20cc70);};}exports[_0x53af('0x25')]=function(_0x1db2fc,_0x152dcc){var _0x474d5f={},_0x20449f={},_0x5af078={'count':0x0,'rows':[]};var _0x808023=_[_0x53af('0x26')](db[_0x53af('0x27')][_0x53af('0x28')],function(_0x2820df){return{'name':_0x2820df[_0x53af('0x29')],'type':_0x2820df[_0x53af('0x2a')]['key']};});_0x20449f['model']=_[_0x53af('0x26')](_0x808023,'name');_0x20449f[_0x53af('0x2b')]=_[_0x53af('0x2c')](_0x1db2fc[_0x53af('0x2b')]);_0x20449f[_0x53af('0x2d')]=_['intersection'](_0x20449f[_0x53af('0x2e')],_0x20449f[_0x53af('0x2b')]);_0x474d5f['attributes']=_['intersection'](_0x20449f[_0x53af('0x2e')],qs[_0x53af('0x2f')](_0x1db2fc[_0x53af('0x2b')][_0x53af('0x2f')]));_0x474d5f['attributes']=_0x474d5f['attributes'][_0x53af('0x30')]?_0x474d5f[_0x53af('0x31')]:_0x20449f[_0x53af('0x2e')];if(!_0x1db2fc['query']['hasOwnProperty'](_0x53af('0x32'))){_0x474d5f[_0x53af('0x1a')]=qs[_0x53af('0x1a')](_0x1db2fc[_0x53af('0x2b')][_0x53af('0x1a')]);_0x474d5f[_0x53af('0x19')]=qs[_0x53af('0x19')](_0x1db2fc['query'][_0x53af('0x19')]);}_0x474d5f[_0x53af('0x33')]=qs['sort'](_0x1db2fc[_0x53af('0x2b')][_0x53af('0x34')]);_0x474d5f[_0x53af('0x35')]=qs[_0x53af('0x2d')](_[_0x53af('0x36')](_0x1db2fc['query'],_0x20449f[_0x53af('0x2d')]));if(_0x1db2fc['query'][_0x53af('0x37')]){_0x474d5f[_0x53af('0x35')]=_[_0x53af('0x38')](_0x474d5f[_0x53af('0x35')],{'$or':_[_0x53af('0x26')](_0x808023,function(_0x591b0e){if(_0x591b0e['type']!=='VIRTUAL'){var _0x2f8bfb={};_0x2f8bfb[_0x591b0e['name']]={'$like':'%'+_0x1db2fc['query']['filter']+'%'};return _0x2f8bfb;}})});}_0x474d5f=_[_0x53af('0x38')]({},_0x474d5f,_0x1db2fc[_0x53af('0x39')]);var _0x440655={'where':_0x474d5f[_0x53af('0x35')]};return db[_0x53af('0x27')][_0x53af('0x18')](_0x440655)[_0x53af('0x1f')](function(_0x40f8d5){_0x5af078[_0x53af('0x18')]=_0x40f8d5;if(_0x1db2fc['query'][_0x53af('0x3a')]){_0x474d5f[_0x53af('0x3b')]=[{'all':!![]}];}return db[_0x53af('0x27')][_0x53af('0x3c')](_0x474d5f);})[_0x53af('0x1f')](function(_0x352e87){_0x5af078['rows']=_0x352e87;return _0x5af078;})[_0x53af('0x1f')](respondWithFilteredResult(_0x152dcc,_0x474d5f))[_0x53af('0x3d')](handleError(_0x152dcc,null));};exports[_0x53af('0x3e')]=function(_0x411563,_0x50ce83){var _0x12fbf6={'raw':![],'where':{'id':_0x411563[_0x53af('0x3f')]['id']}},_0x2e7df8={};_0x2e7df8[_0x53af('0x2e')]=_[_0x53af('0x2c')](db['AnalyticFieldReport'][_0x53af('0x28')]);_0x2e7df8[_0x53af('0x2b')]=_[_0x53af('0x2c')](_0x411563[_0x53af('0x2b')]);_0x2e7df8[_0x53af('0x2d')]=_[_0x53af('0x40')](_0x2e7df8[_0x53af('0x2e')],_0x2e7df8['query']);_0x12fbf6[_0x53af('0x31')]=_[_0x53af('0x40')](_0x2e7df8[_0x53af('0x2e')],qs['fields'](_0x411563[_0x53af('0x2b')]['fields']));_0x12fbf6[_0x53af('0x31')]=_0x12fbf6[_0x53af('0x31')][_0x53af('0x30')]?_0x12fbf6[_0x53af('0x31')]:_0x2e7df8[_0x53af('0x2e')];if(_0x411563[_0x53af('0x2b')][_0x53af('0x3a')]){_0x12fbf6['include']=[{'all':!![]}];}_0x12fbf6=_[_0x53af('0x38')]({},_0x12fbf6,_0x411563[_0x53af('0x39')]);return db[_0x53af('0x27')][_0x53af('0x41')](_0x12fbf6)[_0x53af('0x1f')](handleEntityNotFound(_0x50ce83,null))[_0x53af('0x1f')](respondWithResult(_0x50ce83,null))[_0x53af('0x3d')](handleError(_0x50ce83,null));};exports[_0x53af('0x42')]=function(_0x270414,_0x4799d9){return db['AnalyticFieldReport'][_0x53af('0x42')](_0x270414[_0x53af('0x43')],{})['then'](respondWithResult(_0x4799d9,0xc9))['catch'](handleError(_0x4799d9,null));};exports[_0x53af('0x44')]=function(_0x27c961,_0x41b766){return db[_0x53af('0x27')][_0x53af('0x44')](_0x27c961[_0x53af('0x43')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x41b766,0xc9))[_0x53af('0x3d')](handleError(_0x41b766,null));};exports[_0x53af('0x1e')]=function(_0x4586aa,_0x43deab){if(_0x4586aa[_0x53af('0x43')]['id']){delete _0x4586aa[_0x53af('0x43')]['id'];}return db[_0x53af('0x27')][_0x53af('0x41')]({'where':{'id':_0x4586aa['params']['id']}})['then'](handleEntityNotFound(_0x43deab,null))[_0x53af('0x1f')](saveUpdates(_0x4586aa['body'],null))[_0x53af('0x1f')](respondWithResult(_0x43deab,null))[_0x53af('0x3d')](handleError(_0x43deab,null));};exports[_0x53af('0x20')]=function(_0x452e9d,_0x34f63f){return db[_0x53af('0x27')][_0x53af('0x41')]({'where':{'id':_0x452e9d['params']['id']}})['then'](handleEntityNotFound(_0x34f63f,null))['then'](removeEntity(_0x34f63f,null))[_0x53af('0x3d')](handleError(_0x34f63f,null));};exports[_0x53af('0x45')]=function(_0x2cd21d,_0x24c29c){return db['AnalyticFieldReport']['destroy']({'where':{'id':_0x2cd21d[_0x53af('0x2b')][_0x53af('0x46')]||[]},'raw':![],'individualHooks':!![]})[_0x53af('0x1f')](respondWithResult(_0x24c29c,0xcc))['catch'](handleError(_0x24c29c,null));};exports['addFields']=function(_0x56e9f4,_0x31e25c,_0x1a12a7){return db[_0x53af('0x47')][_0x53af('0x48')]({'where':{'id':_0x56e9f4[_0x53af('0x3f')]['id']}})['then'](handleEntityNotFound(_0x31e25c,null))[_0x53af('0x1f')](function(_0xef89da){if(_0xef89da){return db[_0x53af('0x49')][_0x53af('0x4a')](function(_0x185a3a){return db[_0x53af('0x27')]['destroy']({'where':{'CustomReportId':_0x56e9f4[_0x53af('0x3f')]['id']},'transaction':_0x185a3a})['then'](function(_0x374b5c){var _0x5084f2=_[_0x53af('0x26')](_0x56e9f4[_0x53af('0x43')],function(_0x547bd3){delete _0x547bd3['id'];_0x547bd3['CustomReportId']=_0x56e9f4['params']['id'];return _0x547bd3;});return db[_0x53af('0x27')]['bulkCreate'](_0x5084f2,{'transaction':_0x185a3a});});})[_0x53af('0x1f')](function(){return db['AnalyticFieldReport']['findAll']({'where':{'CustomReportId':_0x56e9f4[_0x53af('0x3f')]['id']}});});}})[_0x53af('0x1f')](respondWithResult(_0x31e25c,null))[_0x53af('0x3d')](handleError(_0x31e25c,null));}; \ No newline at end of file +var _0x6c14=['limit','set','Content-Range','reject','update','then','destroy','sendStatus','error','stack','name','index','map','AnalyticFieldReport','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','nolimit','sort','pick','filter','where','merge','VIRTUAL','include','findAll','catch','params','rawAttributes','options','find','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','transaction','CustomReportId','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','count','offset'];(function(_0x15c3cb,_0x23cba0){var _0x164f67=function(_0x461f77){while(--_0x461f77){_0x15c3cb['push'](_0x15c3cb['shift']());}};_0x164f67(++_0x23cba0);}(_0x6c14,0xd1));var _0x46c1=function(_0x1575ec,_0x305edc){_0x1575ec=_0x1575ec-0x0;var _0x569678=_0x6c14[_0x1575ec];return _0x569678;};'use strict';var pdf=require(_0x46c1('0x0'));var emlformat=require(_0x46c1('0x1'));var rimraf=require(_0x46c1('0x2'));var zipdir=require(_0x46c1('0x3'));var jsonpatch=require(_0x46c1('0x4'));var rp=require('request-promise');var moment=require(_0x46c1('0x5'));var BPromise=require(_0x46c1('0x6'));var Mustache=require(_0x46c1('0x7'));var util=require('util');var path=require(_0x46c1('0x8'));var sox=require(_0x46c1('0x9'));var csv=require(_0x46c1('0xa'));var ejs=require(_0x46c1('0xb'));var fs=require('fs');var _=require(_0x46c1('0xc'));var squel=require(_0x46c1('0xd'));var crypto=require(_0x46c1('0xe'));var jsforce=require(_0x46c1('0xf'));var deskjs=require(_0x46c1('0x10'));var toCsv=require('to-csv');var querystring=require(_0x46c1('0x11'));var Papa=require(_0x46c1('0x12'));var Redis=require(_0x46c1('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x46c1('0x14'));var as=require(_0x46c1('0x15'));var hardwareService=require(_0x46c1('0x16'));var logger=require('../../config/logger')(_0x46c1('0x17'));var utils=require(_0x46c1('0x18'));var config=require(_0x46c1('0x19'));var db=require(_0x46c1('0x1a'))['db'];function respondWithStatusCode(_0x532259,_0x2c8a7c){_0x2c8a7c=_0x2c8a7c||0xcc;return function(_0x24626f){if(_0x24626f){return _0x532259['sendStatus'](_0x2c8a7c);}return _0x532259['status'](_0x2c8a7c)[_0x46c1('0x1b')]();};}function respondWithResult(_0x2faf9e,_0xa10462){_0xa10462=_0xa10462||0xc8;return function(_0x228380){if(_0x228380){return _0x2faf9e[_0x46c1('0x1c')](_0xa10462)['json'](_0x228380);}};}function respondWithFilteredResult(_0x436fb6,_0x3033a6){return function(_0x221905){if(_0x221905){var _0x414a3f=_0x221905[_0x46c1('0x1d')],_0x3ce709=_0x3033a6[_0x46c1('0x1e')],_0x4a075f=_0x3033a6[_0x46c1('0x1e')]+_0x3033a6[_0x46c1('0x1f')],_0x5f1dc1;if(_0x4a075f>=_0x414a3f){_0x4a075f=_0x414a3f;_0x5f1dc1=0xc8;}else{_0x5f1dc1=0xce;}_0x436fb6[_0x46c1('0x1c')](_0x5f1dc1);return _0x436fb6[_0x46c1('0x20')](_0x46c1('0x21'),_0x3ce709+'-'+_0x4a075f+'/'+_0x414a3f)['json'](_0x221905);}return null;};}function patchUpdates(_0x247a8b){return function(_0x20e3e2){try{jsonpatch['apply'](_0x20e3e2,_0x247a8b,!![]);}catch(_0x50a76c){return BPromise[_0x46c1('0x22')](_0x50a76c);}return _0x20e3e2['save']();};}function saveUpdates(_0x5b5290,_0x301c0c){return function(_0xfc1f36){if(_0xfc1f36){return _0xfc1f36[_0x46c1('0x23')](_0x5b5290)[_0x46c1('0x24')](function(_0x4253b4){return _0x4253b4;});}return null;};}function removeEntity(_0x3769be,_0x3768e9){return function(_0x21e02d){if(_0x21e02d){return _0x21e02d[_0x46c1('0x25')]()[_0x46c1('0x24')](function(){_0x3769be[_0x46c1('0x1c')](0xcc)[_0x46c1('0x1b')]();});}};}function handleEntityNotFound(_0x12ce45,_0x712eb8){return function(_0x37fa8c){if(!_0x37fa8c){_0x12ce45[_0x46c1('0x26')](0x194);}return _0x37fa8c;};}function handleError(_0x138843,_0x15c4ad){_0x15c4ad=_0x15c4ad||0x1f4;return function(_0x35dd91){logger[_0x46c1('0x27')](_0x35dd91[_0x46c1('0x28')]);if(_0x35dd91[_0x46c1('0x29')]){delete _0x35dd91[_0x46c1('0x29')];}_0x138843['status'](_0x15c4ad)['send'](_0x35dd91);};}exports[_0x46c1('0x2a')]=function(_0x34fe59,_0x54f5e3){var _0x2b94aa={},_0xe710e8={},_0x36d1e9={'count':0x0,'rows':[]};var _0x1410fe=_[_0x46c1('0x2b')](db[_0x46c1('0x2c')]['rawAttributes'],function(_0x114048){return{'name':_0x114048[_0x46c1('0x2d')],'type':_0x114048[_0x46c1('0x2e')][_0x46c1('0x2f')]};});_0xe710e8[_0x46c1('0x30')]=_[_0x46c1('0x2b')](_0x1410fe,_0x46c1('0x29'));_0xe710e8['query']=_[_0x46c1('0x31')](_0x34fe59['query']);_0xe710e8[_0x46c1('0x32')]=_[_0x46c1('0x33')](_0xe710e8[_0x46c1('0x30')],_0xe710e8[_0x46c1('0x34')]);_0x2b94aa['attributes']=_['intersection'](_0xe710e8[_0x46c1('0x30')],qs[_0x46c1('0x35')](_0x34fe59['query'][_0x46c1('0x35')]));_0x2b94aa[_0x46c1('0x36')]=_0x2b94aa[_0x46c1('0x36')][_0x46c1('0x37')]?_0x2b94aa['attributes']:_0xe710e8[_0x46c1('0x30')];if(!_0x34fe59[_0x46c1('0x34')]['hasOwnProperty'](_0x46c1('0x38'))){_0x2b94aa['limit']=qs[_0x46c1('0x1f')](_0x34fe59[_0x46c1('0x34')][_0x46c1('0x1f')]);_0x2b94aa[_0x46c1('0x1e')]=qs[_0x46c1('0x1e')](_0x34fe59[_0x46c1('0x34')]['offset']);}_0x2b94aa['order']=qs[_0x46c1('0x39')](_0x34fe59['query'][_0x46c1('0x39')]);_0x2b94aa['where']=qs['filters'](_[_0x46c1('0x3a')](_0x34fe59[_0x46c1('0x34')],_0xe710e8[_0x46c1('0x32')]));if(_0x34fe59['query'][_0x46c1('0x3b')]){_0x2b94aa[_0x46c1('0x3c')]=_[_0x46c1('0x3d')](_0x2b94aa['where'],{'$or':_[_0x46c1('0x2b')](_0x1410fe,function(_0xf7e5ee){if(_0xf7e5ee[_0x46c1('0x2e')]!==_0x46c1('0x3e')){var _0x473a8e={};_0x473a8e[_0xf7e5ee[_0x46c1('0x29')]]={'$like':'%'+_0x34fe59[_0x46c1('0x34')][_0x46c1('0x3b')]+'%'};return _0x473a8e;}})});}_0x2b94aa=_[_0x46c1('0x3d')]({},_0x2b94aa,_0x34fe59['options']);var _0xcb59ca={'where':_0x2b94aa[_0x46c1('0x3c')]};return db[_0x46c1('0x2c')][_0x46c1('0x1d')](_0xcb59ca)[_0x46c1('0x24')](function(_0x1c7e54){_0x36d1e9['count']=_0x1c7e54;if(_0x34fe59[_0x46c1('0x34')]['includeAll']){_0x2b94aa[_0x46c1('0x3f')]=[{'all':!![]}];}return db[_0x46c1('0x2c')][_0x46c1('0x40')](_0x2b94aa);})['then'](function(_0x3f6106){_0x36d1e9['rows']=_0x3f6106;return _0x36d1e9;})[_0x46c1('0x24')](respondWithFilteredResult(_0x54f5e3,_0x2b94aa))[_0x46c1('0x41')](handleError(_0x54f5e3,null));};exports['show']=function(_0x58d9c4,_0x1fbb74){var _0x520f5d={'raw':![],'where':{'id':_0x58d9c4[_0x46c1('0x42')]['id']}},_0x21208a={};_0x21208a[_0x46c1('0x30')]=_['keys'](db[_0x46c1('0x2c')][_0x46c1('0x43')]);_0x21208a['query']=_[_0x46c1('0x31')](_0x58d9c4[_0x46c1('0x34')]);_0x21208a['filters']=_['intersection'](_0x21208a[_0x46c1('0x30')],_0x21208a['query']);_0x520f5d[_0x46c1('0x36')]=_[_0x46c1('0x33')](_0x21208a[_0x46c1('0x30')],qs[_0x46c1('0x35')](_0x58d9c4['query']['fields']));_0x520f5d[_0x46c1('0x36')]=_0x520f5d[_0x46c1('0x36')][_0x46c1('0x37')]?_0x520f5d[_0x46c1('0x36')]:_0x21208a['model'];if(_0x58d9c4[_0x46c1('0x34')]['includeAll']){_0x520f5d['include']=[{'all':!![]}];}_0x520f5d=_[_0x46c1('0x3d')]({},_0x520f5d,_0x58d9c4[_0x46c1('0x44')]);return db['AnalyticFieldReport'][_0x46c1('0x45')](_0x520f5d)[_0x46c1('0x24')](handleEntityNotFound(_0x1fbb74,null))[_0x46c1('0x24')](respondWithResult(_0x1fbb74,null))[_0x46c1('0x41')](handleError(_0x1fbb74,null));};exports[_0x46c1('0x46')]=function(_0xb0d48,_0x489d71){return db[_0x46c1('0x2c')][_0x46c1('0x46')](_0xb0d48[_0x46c1('0x47')],{})[_0x46c1('0x24')](respondWithResult(_0x489d71,0xc9))['catch'](handleError(_0x489d71,null));};exports[_0x46c1('0x48')]=function(_0x3e3d7e,_0x5c7758){return db[_0x46c1('0x2c')][_0x46c1('0x48')](_0x3e3d7e['body'],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x5c7758,0xc9))[_0x46c1('0x41')](handleError(_0x5c7758,null));};exports[_0x46c1('0x23')]=function(_0x1911e7,_0x4a94b0){if(_0x1911e7[_0x46c1('0x47')]['id']){delete _0x1911e7[_0x46c1('0x47')]['id'];}return db[_0x46c1('0x2c')]['find']({'where':{'id':_0x1911e7[_0x46c1('0x42')]['id']}})[_0x46c1('0x24')](handleEntityNotFound(_0x4a94b0,null))[_0x46c1('0x24')](saveUpdates(_0x1911e7[_0x46c1('0x47')],null))[_0x46c1('0x24')](respondWithResult(_0x4a94b0,null))[_0x46c1('0x41')](handleError(_0x4a94b0,null));};exports[_0x46c1('0x25')]=function(_0x3194e6,_0xa09a0){return db[_0x46c1('0x2c')][_0x46c1('0x45')]({'where':{'id':_0x3194e6[_0x46c1('0x42')]['id']}})[_0x46c1('0x24')](handleEntityNotFound(_0xa09a0,null))[_0x46c1('0x24')](removeEntity(_0xa09a0,null))[_0x46c1('0x41')](handleError(_0xa09a0,null));};exports[_0x46c1('0x49')]=function(_0x2a53cb,_0x5ecde7){return db[_0x46c1('0x2c')][_0x46c1('0x25')]({'where':{'id':_0x2a53cb[_0x46c1('0x34')][_0x46c1('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0x46c1('0x24')](respondWithResult(_0x5ecde7,0xcc))[_0x46c1('0x41')](handleError(_0x5ecde7,null));};exports[_0x46c1('0x4b')]=function(_0x4de56f,_0xda0654,_0x3dcc2a){return db[_0x46c1('0x4c')][_0x46c1('0x4d')]({'where':{'id':_0x4de56f[_0x46c1('0x42')]['id']}})[_0x46c1('0x24')](handleEntityNotFound(_0xda0654,null))[_0x46c1('0x24')](function(_0x42a35d){if(_0x42a35d){return db['sequelize'][_0x46c1('0x4e')](function(_0x52df7b){return db[_0x46c1('0x2c')][_0x46c1('0x25')]({'where':{'CustomReportId':_0x4de56f[_0x46c1('0x42')]['id']},'transaction':_0x52df7b})['then'](function(_0x10590b){var _0x1b0aed=_[_0x46c1('0x2b')](_0x4de56f[_0x46c1('0x47')],function(_0x360615){delete _0x360615['id'];_0x360615[_0x46c1('0x4f')]=_0x4de56f[_0x46c1('0x42')]['id'];return _0x360615;});return db[_0x46c1('0x2c')][_0x46c1('0x48')](_0x1b0aed,{'transaction':_0x52df7b});});})[_0x46c1('0x24')](function(){return db[_0x46c1('0x2c')]['findAll']({'where':{'CustomReportId':_0x4de56f[_0x46c1('0x42')]['id']}});});}})[_0x46c1('0x24')](respondWithResult(_0xda0654,null))[_0x46c1('0x41')](handleError(_0xda0654,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 87a8d23..3c08037 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 _0x2192=['moment','bluebird','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger'];(function(_0x39773a,_0x3af941){var _0x3315ef=function(_0x257094){while(--_0x257094){_0x39773a['push'](_0x39773a['shift']());}};_0x3315ef(++_0x3af941);}(_0x2192,0x142));var _0x2219=function(_0x2e2065,_0x1f336a){_0x2e2065=_0x2e2065-0x0;var _0x3251f7=_0x2192[_0x2e2065];return _0x3251f7;};'use strict';var _=require(_0x2219('0x0'));var util=require(_0x2219('0x1'));var logger=require(_0x2219('0x2'))('api');var moment=require(_0x2219('0x3'));var BPromise=require(_0x2219('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2219('0x5'));var rimraf=require(_0x2219('0x6'));var config=require(_0x2219('0x7'));var attributes=require(_0x2219('0x8'));module[_0x2219('0x9')]=function(_0x252dfc,_0x1cc1ba){return _0x252dfc[_0x2219('0xa')](_0x2219('0xb'),attributes,{'tableName':_0x2219('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc00d=['rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','lodash','api','bluebird','request-promise','path'];(function(_0x1d2b8e,_0x515ae3){var _0x510a10=function(_0x53984e){while(--_0x53984e){_0x1d2b8e['push'](_0x1d2b8e['shift']());}};_0x510a10(++_0x515ae3);}(_0xc00d,0x145));var _0xdc00=function(_0x40de35,_0x28676f){_0x40de35=_0x40de35-0x0;var _0xcbffec=_0xc00d[_0x40de35];return _0xcbffec;};'use strict';var _=require(_0xdc00('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xdc00('0x1'));var moment=require('moment');var BPromise=require(_0xdc00('0x2'));var rp=require(_0xdc00('0x3'));var fs=require('fs');var path=require(_0xdc00('0x4'));var rimraf=require(_0xdc00('0x5'));var config=require(_0xdc00('0x6'));var attributes=require(_0xdc00('0x7'));module[_0xdc00('0x8')]=function(_0x3332db,_0x4099f3){return _0x3332db[_0xdc00('0x9')](_0xdc00('0xa'),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 27e2d98..4295470 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 _0x15ed=['message','info','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x52e68e,_0x309912){var _0x3211a4=function(_0x467c01){while(--_0x467c01){_0x52e68e['push'](_0x52e68e['shift']());}};_0x3211a4(++_0x309912);}(_0x15ed,0x77));var _0xd15e=function(_0x595bd1,_0xb1e7a){_0x595bd1=_0x595bd1-0x0;var _0xd0344f=_0x15ed[_0x595bd1];return _0xd0344f;};'use strict';var _=require('lodash');var util=require(_0xd15e('0x0'));var moment=require('moment');var BPromise=require(_0xd15e('0x1'));var rs=require(_0xd15e('0x2'));var fs=require('fs');var Redis=require(_0xd15e('0x3'));var db=require(_0xd15e('0x4'))['db'];var utils=require(_0xd15e('0x5'));var logger=require(_0xd15e('0x6'))(_0xd15e('0x7'));var config=require(_0xd15e('0x8'));var jayson=require(_0xd15e('0x9'));var client=jayson[_0xd15e('0xa')][_0xd15e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x57828f,_0x39bef3,_0x3b2035){return new BPromise(function(_0x1cd476,_0x509c36){return client[_0xd15e('0xc')](_0x57828f,_0x3b2035)[_0xd15e('0xd')](function(_0x4409b8){logger['info'](_0xd15e('0xe'),_0x39bef3,_0xd15e('0xf'));logger['debug'](_0xd15e('0x10'),_0x39bef3,_0xd15e('0xf'),JSON[_0xd15e('0x11')](_0x4409b8));if(_0x4409b8[_0xd15e('0x12')]){if(_0x4409b8[_0xd15e('0x12')]['code']===0x1f4){logger[_0xd15e('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x39bef3,_0x4409b8[_0xd15e('0x12')]['message']);return _0x509c36(_0x4409b8[_0xd15e('0x12')][_0xd15e('0x13')]);}logger['error'](_0xd15e('0xe'),_0x39bef3,_0x4409b8[_0xd15e('0x12')][_0xd15e('0x13')]);return _0x1cd476(_0x4409b8[_0xd15e('0x12')]['message']);}else{logger[_0xd15e('0x14')](_0xd15e('0xe'),_0x39bef3,_0xd15e('0xf'));_0x1cd476(_0x4409b8[_0xd15e('0x15')][_0xd15e('0x13')]);}})[_0xd15e('0x16')](function(_0x183296){logger[_0xd15e('0x12')](_0xd15e('0xe'),_0x39bef3,_0x183296);_0x509c36(_0x183296);});});} \ No newline at end of file +var _0x551f=['lodash','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','message','catch'];(function(_0x2f337a,_0x3ec178){var _0x526ea5=function(_0x349e75){while(--_0x349e75){_0x2f337a['push'](_0x2f337a['shift']());}};_0x526ea5(++_0x3ec178);}(_0x551f,0xea));var _0xf551=function(_0x1b9d5d,_0x2cc276){_0x1b9d5d=_0x1b9d5d-0x0;var _0x43caa9=_0x551f[_0x1b9d5d];return _0x43caa9;};'use strict';var _=require(_0xf551('0x0'));var util=require('util');var moment=require(_0xf551('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf551('0x2'))['db'];var utils=require(_0xf551('0x3'));var logger=require('../../config/logger')(_0xf551('0x4'));var config=require(_0xf551('0x5'));var jayson=require(_0xf551('0x6'));var client=jayson['client'][_0xf551('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4ba80e,_0x1e3802,_0x24b984){return new BPromise(function(_0x4907ff,_0x4db667){return client['request'](_0x4ba80e,_0x24b984)[_0xf551('0x8')](function(_0x5497f1){logger[_0xf551('0x9')](_0xf551('0xa'),_0x1e3802,_0xf551('0xb'));logger[_0xf551('0xc')](_0xf551('0xd'),_0x1e3802,_0xf551('0xb'),JSON['stringify'](_0x5497f1));if(_0x5497f1[_0xf551('0xe')]){if(_0x5497f1[_0xf551('0xe')][_0xf551('0xf')]===0x1f4){logger[_0xf551('0xe')](_0xf551('0xa'),_0x1e3802,_0x5497f1[_0xf551('0xe')][_0xf551('0x10')]);return _0x4db667(_0x5497f1[_0xf551('0xe')]['message']);}logger['error'](_0xf551('0xa'),_0x1e3802,_0x5497f1[_0xf551('0xe')]['message']);return _0x4907ff(_0x5497f1[_0xf551('0xe')]['message']);}else{logger[_0xf551('0x9')](_0xf551('0xa'),_0x1e3802,_0xf551('0xb'));_0x4907ff(_0x5497f1['result'][_0xf551('0x10')]);}})[_0xf551('0x11')](function(_0x5e0179){logger[_0xf551('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1e3802,_0x5e0179);_0x4db667(_0x5e0179);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index f8fb9a9..5cc33b3 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 _0x814b=['../../config/environment','./analyticFieldReport.controller','get','isAuthenticated','index','/:id','post','create','/create_many','bulkCreate','/:id/create_many','addFields','update','delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x16b596,_0x371210){var _0x2524af=function(_0x519a38){while(--_0x519a38){_0x16b596['push'](_0x16b596['shift']());}};_0x2524af(++_0x371210);}(_0x814b,0x1a2));var _0xb814=function(_0x7642c,_0x2ec4b0){_0x7642c=_0x7642c-0x0;var _0x5412fd=_0x814b[_0x7642c];return _0x5412fd;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xb814('0x6'));var config=require(_0xb814('0x7'));var controller=require(_0xb814('0x8'));router[_0xb814('0x9')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0xb')]);router['get'](_0xb814('0xc'),auth[_0xb814('0xa')](),controller['show']);router[_0xb814('0xd')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0xe')]);router[_0xb814('0xd')](_0xb814('0xf'),auth[_0xb814('0xa')](),controller[_0xb814('0x10')]);router[_0xb814('0xd')](_0xb814('0x11'),auth[_0xb814('0xa')](),controller[_0xb814('0x12')]);router['put'](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router[_0xb814('0x14')](_0xb814('0x15'),auth[_0xb814('0xa')](),controller[_0xb814('0x16')]);router[_0xb814('0x14')](_0xb814('0xc'),auth[_0xb814('0xa')](),controller[_0xb814('0x17')]);module[_0xb814('0x18')]=router; \ No newline at end of file +var _0x814b=['../../config/environment','./analyticFieldReport.controller','get','isAuthenticated','index','/:id','post','create','/create_many','bulkCreate','/:id/create_many','addFields','update','delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x5176c9,_0x4ae890){var _0x1b738f=function(_0x2abd5e){while(--_0x2abd5e){_0x5176c9['push'](_0x5176c9['shift']());}};_0x1b738f(++_0x4ae890);}(_0x814b,0x1a2));var _0xb814=function(_0x220afa,_0xf5f6cc){_0x220afa=_0x220afa-0x0;var _0x1b79d1=_0x814b[_0x220afa];return _0x1b79d1;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xb814('0x6'));var config=require(_0xb814('0x7'));var controller=require(_0xb814('0x8'));router[_0xb814('0x9')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0xb')]);router['get'](_0xb814('0xc'),auth[_0xb814('0xa')](),controller['show']);router[_0xb814('0xd')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0xe')]);router[_0xb814('0xd')](_0xb814('0xf'),auth[_0xb814('0xa')](),controller[_0xb814('0x10')]);router[_0xb814('0xd')](_0xb814('0x11'),auth[_0xb814('0xa')](),controller[_0xb814('0x12')]);router['put'](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router[_0xb814('0x14')](_0xb814('0x15'),auth[_0xb814('0xa')](),controller[_0xb814('0x16')]);router[_0xb814('0x14')](_0xb814('0xc'),auth[_0xb814('0xa')](),controller[_0xb814('0x17')]);module[_0xb814('0x18')]=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index 3df7e3f..3bde3e9 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 _0x0825=['sequelize','exports','STRING','TEXT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0825,0x1e4));var _0x5082=function(_0xb6d27e,_0x38e588){_0xb6d27e=_0xb6d27e-0x0;var _0x2799d6=_0x0825[_0xb6d27e];return _0x2799d6;};'use strict';var Sequelize=require(_0x5082('0x0'));module[_0x5082('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x5082('0x2')]},'metric':{'type':Sequelize[_0x5082('0x3')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x07a2=['sequelize','exports','name','STRING','TEXT'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x07a2,0x12c));var _0x207a=function(_0x754ab4,_0x56daa7){_0x754ab4=_0x754ab4-0x0;var _0x34079a=_0x07a2[_0x754ab4];return _0x34079a;};'use strict';var Sequelize=require(_0x207a('0x0'));module[_0x207a('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x207a('0x2')},'table':{'type':Sequelize[_0x207a('0x3')]},'metric':{'type':Sequelize[_0x207a('0x4')]},'description':{'type':Sequelize[_0x207a('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 3174ffe..5052051 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 _0x90d9=['pick','filter','where','merge','options','includeAll','include','findAll','rows','show','params','AnalyticMetric','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Metrics','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','catch','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','then','destroy','get','UserProfileResource','stack','name','index','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order'];(function(_0x2b92e7,_0x1d6963){var _0x4742a9=function(_0xb0b53c){while(--_0xb0b53c){_0x2b92e7['push'](_0x2b92e7['shift']());}};_0x4742a9(++_0x1d6963);}(_0x90d9,0xbb));var _0x990d=function(_0x5844d1,_0x4e5105){_0x5844d1=_0x5844d1-0x0;var _0x30161d=_0x90d9[_0x5844d1];return _0x30161d;};'use strict';var pdf=require(_0x990d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x990d('0x1'));var zipdir=require(_0x990d('0x2'));var jsonpatch=require(_0x990d('0x3'));var rp=require(_0x990d('0x4'));var moment=require(_0x990d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x990d('0x6'));var util=require(_0x990d('0x7'));var path=require('path');var sox=require(_0x990d('0x8'));var csv=require('to-csv');var ejs=require(_0x990d('0x9'));var fs=require('fs');var _=require(_0x990d('0xa'));var squel=require(_0x990d('0xb'));var crypto=require(_0x990d('0xc'));var jsforce=require(_0x990d('0xd'));var deskjs=require(_0x990d('0xe'));var toCsv=require(_0x990d('0xf'));var querystring=require('querystring');var Papa=require(_0x990d('0x10'));var Redis=require(_0x990d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x990d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x990d('0x13'))(_0x990d('0x14'));var utils=require(_0x990d('0x15'));var config=require('../../config/environment');var db=require(_0x990d('0x16'))['db'];function respondWithStatusCode(_0x4b8fd1,_0x1d61f3){_0x1d61f3=_0x1d61f3||0xcc;return function(_0x485b5d){if(_0x485b5d){return _0x4b8fd1[_0x990d('0x17')](_0x1d61f3);}return _0x4b8fd1[_0x990d('0x18')](_0x1d61f3)[_0x990d('0x19')]();};}function respondWithResult(_0x225e16,_0x57a0d4){_0x57a0d4=_0x57a0d4||0xc8;return function(_0x58211e){if(_0x58211e){return _0x225e16[_0x990d('0x18')](_0x57a0d4)[_0x990d('0x1a')](_0x58211e);}};}function respondWithFilteredResult(_0x4722d0,_0x517143){return function(_0x44aa69){if(_0x44aa69){var _0x2f168d=_0x44aa69[_0x990d('0x1b')],_0x45b7aa=_0x517143[_0x990d('0x1c')],_0x11ca7a=_0x517143[_0x990d('0x1c')]+_0x517143[_0x990d('0x1d')],_0x1628d7;if(_0x11ca7a>=_0x2f168d){_0x11ca7a=_0x2f168d;_0x1628d7=0xc8;}else{_0x1628d7=0xce;}_0x4722d0[_0x990d('0x18')](_0x1628d7);return _0x4722d0[_0x990d('0x1e')](_0x990d('0x1f'),_0x45b7aa+'-'+_0x11ca7a+'/'+_0x2f168d)[_0x990d('0x1a')](_0x44aa69);}return null;};}function patchUpdates(_0x41341a){return function(_0xb80eee){try{jsonpatch[_0x990d('0x20')](_0xb80eee,_0x41341a,!![]);}catch(_0x3be84d){return BPromise['reject'](_0x3be84d);}return _0xb80eee[_0x990d('0x21')]();};}function saveUpdates(_0x4b231d,_0x58024a){return function(_0x316210){if(_0x316210){return _0x316210['update'](_0x4b231d)[_0x990d('0x22')](function(_0x49132a){return _0x49132a;});}return null;};}function removeEntity(_0x41a639,_0x47ec35){return function(_0xd90e7d){if(_0xd90e7d){return _0xd90e7d[_0x990d('0x23')]()[_0x990d('0x22')](function(){var _0x523546=_0xd90e7d[_0x990d('0x24')]({'plain':!![]});var _0x354a1c='Metrics';return db[_0x990d('0x25')][_0x990d('0x23')]({'where':{'type':_0x354a1c,'resourceId':_0x523546['id']}})['then'](function(){return _0xd90e7d;});})[_0x990d('0x22')](function(){_0x41a639[_0x990d('0x18')](0xcc)[_0x990d('0x19')]();});}};}function handleEntityNotFound(_0x18b27f,_0x2555a0){return function(_0x141132){if(!_0x141132){_0x18b27f[_0x990d('0x17')](0x194);}return _0x141132;};}function handleError(_0x2dc395,_0xac17ad){_0xac17ad=_0xac17ad||0x1f4;return function(_0x451a07){logger['error'](_0x451a07[_0x990d('0x26')]);if(_0x451a07['name']){delete _0x451a07[_0x990d('0x27')];}_0x2dc395[_0x990d('0x18')](_0xac17ad)['send'](_0x451a07);};}exports[_0x990d('0x28')]=function(_0x2947cb,_0x4de4f1){var _0x510d52={},_0x22c074={},_0x32aaac={'count':0x0,'rows':[]};var _0x3ac4fb=_['map'](db['AnalyticMetric'][_0x990d('0x29')],function(_0x3c7226){return{'name':_0x3c7226['fieldName'],'type':_0x3c7226[_0x990d('0x2a')][_0x990d('0x2b')]};});_0x22c074[_0x990d('0x2c')]=_[_0x990d('0x2d')](_0x3ac4fb,_0x990d('0x27'));_0x22c074[_0x990d('0x2e')]=_[_0x990d('0x2f')](_0x2947cb[_0x990d('0x2e')]);_0x22c074[_0x990d('0x30')]=_[_0x990d('0x31')](_0x22c074['model'],_0x22c074[_0x990d('0x2e')]);_0x510d52['attributes']=_[_0x990d('0x31')](_0x22c074[_0x990d('0x2c')],qs[_0x990d('0x32')](_0x2947cb[_0x990d('0x2e')][_0x990d('0x32')]));_0x510d52['attributes']=_0x510d52[_0x990d('0x33')][_0x990d('0x34')]?_0x510d52[_0x990d('0x33')]:_0x22c074[_0x990d('0x2c')];if(!_0x2947cb[_0x990d('0x2e')][_0x990d('0x35')](_0x990d('0x36'))){_0x510d52[_0x990d('0x1d')]=qs[_0x990d('0x1d')](_0x2947cb[_0x990d('0x2e')][_0x990d('0x1d')]);_0x510d52['offset']=qs[_0x990d('0x1c')](_0x2947cb[_0x990d('0x2e')][_0x990d('0x1c')]);}_0x510d52[_0x990d('0x37')]=qs['sort'](_0x2947cb[_0x990d('0x2e')]['sort']);_0x510d52['where']=qs[_0x990d('0x30')](_[_0x990d('0x38')](_0x2947cb[_0x990d('0x2e')],_0x22c074['filters']));if(_0x2947cb[_0x990d('0x2e')][_0x990d('0x39')]){_0x510d52[_0x990d('0x3a')]=_[_0x990d('0x3b')](_0x510d52[_0x990d('0x3a')],{'$or':_['map'](_0x3ac4fb,function(_0x6d733c){if(_0x6d733c[_0x990d('0x2a')]!=='VIRTUAL'){var _0x29db6e={};_0x29db6e[_0x6d733c[_0x990d('0x27')]]={'$like':'%'+_0x2947cb[_0x990d('0x2e')][_0x990d('0x39')]+'%'};return _0x29db6e;}})});}_0x510d52=_[_0x990d('0x3b')]({},_0x510d52,_0x2947cb[_0x990d('0x3c')]);var _0x5c0a17={'where':_0x510d52[_0x990d('0x3a')]};return db['AnalyticMetric'][_0x990d('0x1b')](_0x5c0a17)[_0x990d('0x22')](function(_0x4fda93){_0x32aaac[_0x990d('0x1b')]=_0x4fda93;if(_0x2947cb[_0x990d('0x2e')][_0x990d('0x3d')]){_0x510d52[_0x990d('0x3e')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x990d('0x3f')](_0x510d52);})[_0x990d('0x22')](function(_0x42d79b){_0x32aaac[_0x990d('0x40')]=_0x42d79b;return _0x32aaac;})[_0x990d('0x22')](respondWithFilteredResult(_0x4de4f1,_0x510d52))['catch'](handleError(_0x4de4f1,null));};exports[_0x990d('0x41')]=function(_0x16e4b5,_0x59a916){var _0x2a41dd={'raw':!![],'where':{'id':_0x16e4b5[_0x990d('0x42')]['id']}},_0x3726d1={};_0x3726d1[_0x990d('0x2c')]=_[_0x990d('0x2f')](db['AnalyticMetric'][_0x990d('0x29')]);_0x3726d1[_0x990d('0x2e')]=_[_0x990d('0x2f')](_0x16e4b5['query']);_0x3726d1[_0x990d('0x30')]=_[_0x990d('0x31')](_0x3726d1[_0x990d('0x2c')],_0x3726d1[_0x990d('0x2e')]);_0x2a41dd[_0x990d('0x33')]=_[_0x990d('0x31')](_0x3726d1[_0x990d('0x2c')],qs[_0x990d('0x32')](_0x16e4b5[_0x990d('0x2e')]['fields']));_0x2a41dd[_0x990d('0x33')]=_0x2a41dd[_0x990d('0x33')]['length']?_0x2a41dd[_0x990d('0x33')]:_0x3726d1[_0x990d('0x2c')];if(_0x16e4b5[_0x990d('0x2e')][_0x990d('0x3d')]){_0x2a41dd[_0x990d('0x3e')]=[{'all':!![]}];}_0x2a41dd=_[_0x990d('0x3b')]({},_0x2a41dd,_0x16e4b5[_0x990d('0x3c')]);return db[_0x990d('0x43')][_0x990d('0x44')](_0x2a41dd)[_0x990d('0x22')](handleEntityNotFound(_0x59a916,null))[_0x990d('0x22')](respondWithResult(_0x59a916,null))['catch'](handleError(_0x59a916,null));};exports['create']=function(_0x9abe6a,_0x69cc31){return db[_0x990d('0x43')][_0x990d('0x45')](_0x9abe6a['body'],{})[_0x990d('0x22')](function(_0x1310ae){var _0x56d5d0=_0x9abe6a[_0x990d('0x46')][_0x990d('0x24')]({'plain':!![]});if(!_0x56d5d0)throw new Error(_0x990d('0x47'));if(_0x56d5d0[_0x990d('0x48')]===_0x990d('0x46')){var _0x334312=_0x1310ae[_0x990d('0x24')]({'plain':!![]});var _0x40bcb9=_0x990d('0x49');return db[_0x990d('0x4a')]['find']({'where':{'name':_0x40bcb9,'userProfileId':_0x56d5d0['userProfileId']},'raw':!![]})[_0x990d('0x22')](function(_0x3cfe3a){if(_0x3cfe3a&&_0x3cfe3a[_0x990d('0x4b')]===0x0){return db['UserProfileResource'][_0x990d('0x45')]({'name':_0x334312['name'],'resourceId':_0x334312['id'],'type':_0x3cfe3a[_0x990d('0x27')],'sectionId':_0x3cfe3a['id']},{})[_0x990d('0x22')](function(){return _0x1310ae;});}else{return _0x1310ae;}})['catch'](function(_0x5b4369){logger[_0x990d('0x4c')](_0x990d('0x4d'),_0x5b4369);throw _0x5b4369;});}return _0x1310ae;})[_0x990d('0x22')](respondWithResult(_0x69cc31,0xc9))['catch'](handleError(_0x69cc31,null));};exports[_0x990d('0x4e')]=function(_0xa346f4,_0x56a89b){if(_0xa346f4[_0x990d('0x4f')]['id']){delete _0xa346f4[_0x990d('0x4f')]['id'];}return db[_0x990d('0x43')]['find']({'where':{'id':_0xa346f4[_0x990d('0x42')]['id']}})['then'](handleEntityNotFound(_0x56a89b,null))[_0x990d('0x22')](saveUpdates(_0xa346f4['body'],null))[_0x990d('0x22')](respondWithResult(_0x56a89b,null))[_0x990d('0x50')](handleError(_0x56a89b,null));};exports[_0x990d('0x23')]=function(_0x2ef5fd,_0x325f06){return db[_0x990d('0x43')][_0x990d('0x44')]({'where':{'id':_0x2ef5fd[_0x990d('0x42')]['id']}})[_0x990d('0x22')](handleEntityNotFound(_0x325f06,null))[_0x990d('0x22')](removeEntity(_0x325f06,null))[_0x990d('0x50')](handleError(_0x325f06,null));}; \ No newline at end of file +var _0xa60e=['userProfileId','autoAssociation','params','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','count','offset','limit','set','Content-Range','reject','save','then','get','Metrics','UserProfileResource','destroy','end','name','status','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','VIRTUAL','filter','options','AnalyticMetric','includeAll','include','findAll','rows','show','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection'];(function(_0x51b0dc,_0x5307b7){var _0x13fa89=function(_0x2c880f){while(--_0x2c880f){_0x51b0dc['push'](_0x51b0dc['shift']());}};_0x13fa89(++_0x5307b7);}(_0xa60e,0x1e9));var _0xea60=function(_0x40b0c4,_0x3a107c){_0x40b0c4=_0x40b0c4-0x0;var _0x4af891=_0xa60e[_0x40b0c4];return _0x4af891;};'use strict';var pdf=require(_0xea60('0x0'));var emlformat=require(_0xea60('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xea60('0x2'));var jsonpatch=require(_0xea60('0x3'));var rp=require(_0xea60('0x4'));var moment=require(_0xea60('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xea60('0x6'));var util=require('util');var path=require(_0xea60('0x7'));var sox=require(_0xea60('0x8'));var csv=require('to-csv');var ejs=require(_0xea60('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xea60('0xa'));var crypto=require(_0xea60('0xb'));var jsforce=require(_0xea60('0xc'));var deskjs=require(_0xea60('0xd'));var toCsv=require(_0xea60('0xe'));var querystring=require(_0xea60('0xf'));var Papa=require(_0xea60('0x10'));var Redis=require(_0xea60('0x11'));var authService=require(_0xea60('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xea60('0x13'));var hardwareService=require(_0xea60('0x14'));var logger=require('../../config/logger')(_0xea60('0x15'));var utils=require(_0xea60('0x16'));var config=require(_0xea60('0x17'));var db=require(_0xea60('0x18'))['db'];function respondWithStatusCode(_0x1f3449,_0x39828){_0x39828=_0x39828||0xcc;return function(_0x4b6d73){if(_0x4b6d73){return _0x1f3449[_0xea60('0x19')](_0x39828);}return _0x1f3449['status'](_0x39828)['end']();};}function respondWithResult(_0x531d48,_0x206ef2){_0x206ef2=_0x206ef2||0xc8;return function(_0x35d026){if(_0x35d026){return _0x531d48['status'](_0x206ef2)[_0xea60('0x1a')](_0x35d026);}};}function respondWithFilteredResult(_0x203fd4,_0xcfc073){return function(_0x544c58){if(_0x544c58){var _0x1fa286=_0x544c58[_0xea60('0x1b')],_0xb4dd60=_0xcfc073[_0xea60('0x1c')],_0x128f64=_0xcfc073[_0xea60('0x1c')]+_0xcfc073[_0xea60('0x1d')],_0x1a6d13;if(_0x128f64>=_0x1fa286){_0x128f64=_0x1fa286;_0x1a6d13=0xc8;}else{_0x1a6d13=0xce;}_0x203fd4['status'](_0x1a6d13);return _0x203fd4[_0xea60('0x1e')](_0xea60('0x1f'),_0xb4dd60+'-'+_0x128f64+'/'+_0x1fa286)[_0xea60('0x1a')](_0x544c58);}return null;};}function patchUpdates(_0x43996e){return function(_0x5d30f0){try{jsonpatch['apply'](_0x5d30f0,_0x43996e,!![]);}catch(_0x47df74){return BPromise[_0xea60('0x20')](_0x47df74);}return _0x5d30f0[_0xea60('0x21')]();};}function saveUpdates(_0x416b9a,_0x59244d){return function(_0x3093b1){if(_0x3093b1){return _0x3093b1['update'](_0x416b9a)[_0xea60('0x22')](function(_0x2110dd){return _0x2110dd;});}return null;};}function removeEntity(_0x5a0c99,_0x164921){return function(_0x555ed3){if(_0x555ed3){return _0x555ed3['destroy']()[_0xea60('0x22')](function(){var _0x57cba1=_0x555ed3[_0xea60('0x23')]({'plain':!![]});var _0x2b1a9c=_0xea60('0x24');return db[_0xea60('0x25')][_0xea60('0x26')]({'where':{'type':_0x2b1a9c,'resourceId':_0x57cba1['id']}})[_0xea60('0x22')](function(){return _0x555ed3;});})[_0xea60('0x22')](function(){_0x5a0c99['status'](0xcc)[_0xea60('0x27')]();});}};}function handleEntityNotFound(_0x525367,_0xd0a8c1){return function(_0x33d6df){if(!_0x33d6df){_0x525367[_0xea60('0x19')](0x194);}return _0x33d6df;};}function handleError(_0x325c88,_0x57175a){_0x57175a=_0x57175a||0x1f4;return function(_0x5da8b8){logger['error'](_0x5da8b8['stack']);if(_0x5da8b8['name']){delete _0x5da8b8[_0xea60('0x28')];}_0x325c88[_0xea60('0x29')](_0x57175a)[_0xea60('0x2a')](_0x5da8b8);};}exports[_0xea60('0x2b')]=function(_0x537c58,_0x347aae){var _0x2e0741={},_0x5269e7={},_0x5cac2c={'count':0x0,'rows':[]};var _0x53a4f2=_[_0xea60('0x2c')](db['AnalyticMetric'][_0xea60('0x2d')],function(_0x6101a4){return{'name':_0x6101a4[_0xea60('0x2e')],'type':_0x6101a4[_0xea60('0x2f')][_0xea60('0x30')]};});_0x5269e7[_0xea60('0x31')]=_[_0xea60('0x2c')](_0x53a4f2,_0xea60('0x28'));_0x5269e7[_0xea60('0x32')]=_[_0xea60('0x33')](_0x537c58['query']);_0x5269e7[_0xea60('0x34')]=_[_0xea60('0x35')](_0x5269e7['model'],_0x5269e7[_0xea60('0x32')]);_0x2e0741['attributes']=_[_0xea60('0x35')](_0x5269e7[_0xea60('0x31')],qs[_0xea60('0x36')](_0x537c58['query'][_0xea60('0x36')]));_0x2e0741[_0xea60('0x37')]=_0x2e0741[_0xea60('0x37')][_0xea60('0x38')]?_0x2e0741[_0xea60('0x37')]:_0x5269e7[_0xea60('0x31')];if(!_0x537c58['query'][_0xea60('0x39')](_0xea60('0x3a'))){_0x2e0741[_0xea60('0x1d')]=qs[_0xea60('0x1d')](_0x537c58['query'][_0xea60('0x1d')]);_0x2e0741['offset']=qs[_0xea60('0x1c')](_0x537c58[_0xea60('0x32')][_0xea60('0x1c')]);}_0x2e0741[_0xea60('0x3b')]=qs[_0xea60('0x3c')](_0x537c58[_0xea60('0x32')][_0xea60('0x3c')]);_0x2e0741['where']=qs['filters'](_[_0xea60('0x3d')](_0x537c58[_0xea60('0x32')],_0x5269e7['filters']));if(_0x537c58[_0xea60('0x32')]['filter']){_0x2e0741['where']=_['merge'](_0x2e0741['where'],{'$or':_['map'](_0x53a4f2,function(_0x2fad93){if(_0x2fad93[_0xea60('0x2f')]!==_0xea60('0x3e')){var _0x1ed0c1={};_0x1ed0c1[_0x2fad93['name']]={'$like':'%'+_0x537c58['query'][_0xea60('0x3f')]+'%'};return _0x1ed0c1;}})});}_0x2e0741=_['merge']({},_0x2e0741,_0x537c58[_0xea60('0x40')]);var _0x277734={'where':_0x2e0741['where']};return db[_0xea60('0x41')][_0xea60('0x1b')](_0x277734)[_0xea60('0x22')](function(_0x3f1a6e){_0x5cac2c['count']=_0x3f1a6e;if(_0x537c58[_0xea60('0x32')][_0xea60('0x42')]){_0x2e0741[_0xea60('0x43')]=[{'all':!![]}];}return db[_0xea60('0x41')][_0xea60('0x44')](_0x2e0741);})[_0xea60('0x22')](function(_0x1c48b1){_0x5cac2c[_0xea60('0x45')]=_0x1c48b1;return _0x5cac2c;})[_0xea60('0x22')](respondWithFilteredResult(_0x347aae,_0x2e0741))['catch'](handleError(_0x347aae,null));};exports[_0xea60('0x46')]=function(_0x1a35fd,_0x5eab77){var _0xe044ab={'raw':!![],'where':{'id':_0x1a35fd['params']['id']}},_0x41a217={};_0x41a217[_0xea60('0x31')]=_['keys'](db['AnalyticMetric'][_0xea60('0x2d')]);_0x41a217['query']=_['keys'](_0x1a35fd[_0xea60('0x32')]);_0x41a217['filters']=_['intersection'](_0x41a217[_0xea60('0x31')],_0x41a217[_0xea60('0x32')]);_0xe044ab['attributes']=_['intersection'](_0x41a217[_0xea60('0x31')],qs[_0xea60('0x36')](_0x1a35fd['query'][_0xea60('0x36')]));_0xe044ab[_0xea60('0x37')]=_0xe044ab[_0xea60('0x37')][_0xea60('0x38')]?_0xe044ab[_0xea60('0x37')]:_0x41a217['model'];if(_0x1a35fd[_0xea60('0x32')][_0xea60('0x42')]){_0xe044ab[_0xea60('0x43')]=[{'all':!![]}];}_0xe044ab=_['merge']({},_0xe044ab,_0x1a35fd['options']);return db[_0xea60('0x41')][_0xea60('0x47')](_0xe044ab)['then'](handleEntityNotFound(_0x5eab77,null))[_0xea60('0x22')](respondWithResult(_0x5eab77,null))[_0xea60('0x48')](handleError(_0x5eab77,null));};exports[_0xea60('0x49')]=function(_0x483278,_0x378479){return db[_0xea60('0x41')][_0xea60('0x49')](_0x483278[_0xea60('0x4a')],{})[_0xea60('0x22')](function(_0xb48715){var _0x4363f8=_0x483278[_0xea60('0x4b')][_0xea60('0x23')]({'plain':!![]});if(!_0x4363f8)throw new Error(_0xea60('0x4c'));if(_0x4363f8['role']===_0xea60('0x4b')){var _0x5722d3=_0xb48715['get']({'plain':!![]});var _0x12e517=_0xea60('0x24');return db[_0xea60('0x4d')][_0xea60('0x47')]({'where':{'name':_0x12e517,'userProfileId':_0x4363f8[_0xea60('0x4e')]},'raw':!![]})[_0xea60('0x22')](function(_0x3393ad){if(_0x3393ad&&_0x3393ad[_0xea60('0x4f')]===0x0){return db[_0xea60('0x25')]['create']({'name':_0x5722d3[_0xea60('0x28')],'resourceId':_0x5722d3['id'],'type':_0x3393ad[_0xea60('0x28')],'sectionId':_0x3393ad['id']},{})[_0xea60('0x22')](function(){return _0xb48715;});}else{return _0xb48715;}})[_0xea60('0x48')](function(_0x4d62c3){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4d62c3);throw _0x4d62c3;});}return _0xb48715;})[_0xea60('0x22')](respondWithResult(_0x378479,0xc9))[_0xea60('0x48')](handleError(_0x378479,null));};exports['update']=function(_0x801dae,_0x3604da){if(_0x801dae[_0xea60('0x4a')]['id']){delete _0x801dae[_0xea60('0x4a')]['id'];}return db[_0xea60('0x41')][_0xea60('0x47')]({'where':{'id':_0x801dae[_0xea60('0x50')]['id']}})[_0xea60('0x22')](handleEntityNotFound(_0x3604da,null))[_0xea60('0x22')](saveUpdates(_0x801dae[_0xea60('0x4a')],null))['then'](respondWithResult(_0x3604da,null))[_0xea60('0x48')](handleError(_0x3604da,null));};exports['destroy']=function(_0x113cf3,_0x271c68){return db[_0xea60('0x41')][_0xea60('0x47')]({'where':{'id':_0x113cf3[_0xea60('0x50')]['id']}})[_0xea60('0x22')](handleEntityNotFound(_0x271c68,null))[_0xea60('0x22')](removeEntity(_0x271c68,null))['catch'](handleError(_0x271c68,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 29a191f..81b6090 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 _0x490d=['request-promise','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x490d,0x94));var _0xd490=function(_0x1f6c5e,_0x14200e){_0x1f6c5e=_0x1f6c5e-0x0;var _0x2fb057=_0x490d[_0x1f6c5e];return _0x2fb057;};'use strict';var _=require(_0xd490('0x0'));var util=require(_0xd490('0x1'));var logger=require(_0xd490('0x2'))(_0xd490('0x3'));var moment=require(_0xd490('0x4'));var BPromise=require(_0xd490('0x5'));var rp=require(_0xd490('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd490('0x7'));var config=require(_0xd490('0x8'));var attributes=require(_0xd490('0x9'));module[_0xd490('0xa')]=function(_0x11f55a,_0x541adf){return _0x11f55a[_0xd490('0xb')](_0xd490('0xc'),attributes,{'tableName':_0xd490('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ab1=['../../config/logger','moment','bluebird','request-promise','path','rimraf','./analyticMetric.attributes','exports','define','analytics_metrics','lodash','util'];(function(_0x13b7de,_0x5ed4a8){var _0x236576=function(_0x2e76bd){while(--_0x2e76bd){_0x13b7de['push'](_0x13b7de['shift']());}};_0x236576(++_0x5ed4a8);}(_0x8ab1,0x172));var _0x18ab=function(_0x13062b,_0x285d7d){_0x13062b=_0x13062b-0x0;var _0x564586=_0x8ab1[_0x13062b];return _0x564586;};'use strict';var _=require(_0x18ab('0x0'));var util=require(_0x18ab('0x1'));var logger=require(_0x18ab('0x2'))('api');var moment=require(_0x18ab('0x3'));var BPromise=require(_0x18ab('0x4'));var rp=require(_0x18ab('0x5'));var fs=require('fs');var path=require(_0x18ab('0x6'));var rimraf=require(_0x18ab('0x7'));var config=require('../../config/environment');var attributes=require(_0x18ab('0x8'));module[_0x18ab('0x9')]=function(_0x122493,_0x3d0ae0){return _0x122493[_0x18ab('0xa')]('AnalyticMetric',attributes,{'tableName':_0x18ab('0xb'),'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 9b985c5..664c0af 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 _0x2f04=['code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x25616a,_0x1161ff){var _0x5bb255=function(_0x442e77){while(--_0x442e77){_0x25616a['push'](_0x25616a['shift']());}};_0x5bb255(++_0x1161ff);}(_0x2f04,0x1d0));var _0x42f0=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x2f04[_0x11005e];return _0x29338f;};'use strict';var _=require(_0x42f0('0x0'));var util=require('util');var moment=require(_0x42f0('0x1'));var BPromise=require(_0x42f0('0x2'));var rs=require(_0x42f0('0x3'));var fs=require('fs');var Redis=require(_0x42f0('0x4'));var db=require(_0x42f0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x42f0('0x6'))('rpc');var config=require(_0x42f0('0x7'));var jayson=require(_0x42f0('0x8'));var client=jayson['client'][_0x42f0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xb55f44,_0x467e15,_0x2a7f42){return new BPromise(function(_0x499ecc,_0x3a2a87){return client[_0x42f0('0xa')](_0xb55f44,_0x2a7f42)[_0x42f0('0xb')](function(_0x4b148d){logger[_0x42f0('0xc')](_0x42f0('0xd'),_0x467e15,_0x42f0('0xe'));logger[_0x42f0('0xf')](_0x42f0('0x10'),_0x467e15,_0x42f0('0xe'),JSON[_0x42f0('0x11')](_0x4b148d));if(_0x4b148d[_0x42f0('0x12')]){if(_0x4b148d[_0x42f0('0x12')][_0x42f0('0x13')]===0x1f4){logger[_0x42f0('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x467e15,_0x4b148d[_0x42f0('0x12')][_0x42f0('0x14')]);return _0x3a2a87(_0x4b148d[_0x42f0('0x12')][_0x42f0('0x14')]);}logger[_0x42f0('0x12')](_0x42f0('0xd'),_0x467e15,_0x4b148d['error']['message']);return _0x499ecc(_0x4b148d['error'][_0x42f0('0x14')]);}else{logger[_0x42f0('0xc')](_0x42f0('0xd'),_0x467e15,_0x42f0('0xe'));_0x499ecc(_0x4b148d[_0x42f0('0x15')]['message']);}})[_0x42f0('0x16')](function(_0x42e8da){logger[_0x42f0('0x12')](_0x42f0('0xd'),_0x467e15,_0x42e8da);_0x3a2a87(_0x42e8da);});});} \ No newline at end of file +var _0xff3d=['AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info'];(function(_0x21b9d6,_0x799ec){var _0x5510f2=function(_0xa21d92){while(--_0xa21d92){_0x21b9d6['push'](_0x21b9d6['shift']());}};_0x5510f2(++_0x799ec);}(_0xff3d,0x11d));var _0xdff3=function(_0x5b368b,_0x2b6c18){_0x5b368b=_0x5b368b-0x0;var _0x30af61=_0xff3d[_0x5b368b];return _0x30af61;};'use strict';var _=require(_0xdff3('0x0'));var util=require(_0xdff3('0x1'));var moment=require(_0xdff3('0x2'));var BPromise=require('bluebird');var rs=require(_0xdff3('0x3'));var fs=require('fs');var Redis=require(_0xdff3('0x4'));var db=require(_0xdff3('0x5'))['db'];var utils=require(_0xdff3('0x6'));var logger=require(_0xdff3('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xdff3('0x8'));var client=jayson[_0xdff3('0x9')][_0xdff3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1aa3e6,_0x2639d4,_0xc22be){return new BPromise(function(_0x5695c5,_0x3a526c){return client[_0xdff3('0xb')](_0x1aa3e6,_0xc22be)[_0xdff3('0xc')](function(_0x30aba3){logger[_0xdff3('0xd')](_0xdff3('0xe'),_0x2639d4,_0xdff3('0xf'));logger[_0xdff3('0x10')](_0xdff3('0x11'),_0x2639d4,_0xdff3('0xf'),JSON[_0xdff3('0x12')](_0x30aba3));if(_0x30aba3['error']){if(_0x30aba3[_0xdff3('0x13')]['code']===0x1f4){logger[_0xdff3('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x2639d4,_0x30aba3[_0xdff3('0x13')]['message']);return _0x3a526c(_0x30aba3['error'][_0xdff3('0x14')]);}logger[_0xdff3('0x13')](_0xdff3('0xe'),_0x2639d4,_0x30aba3[_0xdff3('0x13')][_0xdff3('0x14')]);return _0x5695c5(_0x30aba3['error']['message']);}else{logger[_0xdff3('0xd')](_0xdff3('0xe'),_0x2639d4,'request\x20sent');_0x5695c5(_0x30aba3[_0xdff3('0x15')][_0xdff3('0x14')]);}})[_0xdff3('0x16')](function(_0x8eb990){logger[_0xdff3('0x13')](_0xdff3('0xe'),_0x2639d4,_0x8eb990);_0x3a526c(_0x8eb990);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index a54d83c..42658a4 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 _0x187d=['update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','get','index','/:id','isAuthenticated','show','post','create'];(function(_0x4905a9,_0x404c61){var _0x3102e8=function(_0x2ed24b){while(--_0x2ed24b){_0x4905a9['push'](_0x4905a9['shift']());}};_0x3102e8(++_0x404c61);}(_0x187d,0x93));var _0xd187=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0x187d[_0x494d1f];return _0x457b6e;};'use strict';var multer=require(_0xd187('0x0'));var util=require('util');var path=require(_0xd187('0x1'));var timeout=require(_0xd187('0x2'));var express=require(_0xd187('0x3'));var router=express[_0xd187('0x4')]();var auth=require(_0xd187('0x5'));var interaction=require(_0xd187('0x6'));var config=require('../../config/environment');var controller=require(_0xd187('0x7'));router[_0xd187('0x8')]('/',auth['isAuthenticated'](),controller[_0xd187('0x9')]);router[_0xd187('0x8')](_0xd187('0xa'),auth[_0xd187('0xb')](),controller[_0xd187('0xc')]);router[_0xd187('0xd')]('/',auth[_0xd187('0xb')](),controller[_0xd187('0xe')]);router['put'](_0xd187('0xa'),auth[_0xd187('0xb')](),controller[_0xd187('0xf')]);router[_0xd187('0x10')](_0xd187('0xa'),auth[_0xd187('0xb')](),controller['destroy']);module[_0xd187('0x11')]=router; \ No newline at end of file +var _0x326f=['show','post','update','delete','destroy','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0x326f,0xd1));var _0xf326=function(_0x2786e7,_0x1a8b70){_0x2786e7=_0x2786e7-0x0;var _0x30fae7=_0x326f[_0x2786e7];return _0x30fae7;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var auth=require(_0xf326('0x4'));var interaction=require(_0xf326('0x5'));var config=require(_0xf326('0x6'));var controller=require(_0xf326('0x7'));router[_0xf326('0x8')]('/',auth[_0xf326('0x9')](),controller[_0xf326('0xa')]);router['get'](_0xf326('0xb'),auth[_0xf326('0x9')](),controller[_0xf326('0xc')]);router[_0xf326('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xf326('0xb'),auth[_0xf326('0x9')](),controller[_0xf326('0xe')]);router[_0xf326('0xf')](_0xf326('0xb'),auth['isAuthenticated'](),controller[_0xf326('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index e9c76b4..a784487 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 _0x63b5=['exports','TEXT','sequelize'];(function(_0x11efc0,_0x166c80){var _0x37d992=function(_0x5ad42b){while(--_0x5ad42b){_0x11efc0['push'](_0x11efc0['shift']());}};_0x37d992(++_0x166c80);}(_0x63b5,0x116));var _0x563b=function(_0x291b79,_0x53fb84){_0x291b79=_0x291b79-0x0;var _0x3b0466=_0x63b5[_0x291b79];return _0x3b0466;};'use strict';var Sequelize=require(_0x563b('0x0'));module[_0x563b('0x1')]={'tree':{'type':Sequelize[_0x563b('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x8028=['sequelize','exports','TEXT'];(function(_0x3efcd5,_0x9bbba3){var _0x54e50a=function(_0x34d7f4){while(--_0x34d7f4){_0x3efcd5['push'](_0x3efcd5['shift']());}};_0x54e50a(++_0x9bbba3);}(_0x8028,0x165));var _0x8802=function(_0x1b62b5,_0x7ae1f){_0x1b62b5=_0x1b62b5-0x0;var _0x30e905=_0x8028[_0x1b62b5];return _0x30e905;};'use strict';var Sequelize=require(_0x8802('0x0'));module[_0x8802('0x1')]={'tree':{'type':Sequelize[_0x8802('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 1300b71..5497ca8 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 _0x087b=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','count','offset','set','Content-Range','apply','reject','update','then','destroy','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','key','model','name','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','merge','where','type','VIRTUAL','options','include','findAll','rows','catch','show','intersection','find','create','body','params','html-pdf','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x402981,_0x2d00a){var _0x581410=function(_0x26b636){while(--_0x26b636){_0x402981['push'](_0x402981['shift']());}};_0x581410(++_0x2d00a);}(_0x087b,0x11a));var _0xb087=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0x087b[_0x3fba9f];return _0x192cf1;};'use strict';var pdf=require(_0xb087('0x0'));var emlformat=require(_0xb087('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb087('0x2'));var rp=require('request-promise');var moment=require(_0xb087('0x3'));var BPromise=require(_0xb087('0x4'));var Mustache=require(_0xb087('0x5'));var util=require(_0xb087('0x6'));var path=require(_0xb087('0x7'));var sox=require(_0xb087('0x8'));var csv=require(_0xb087('0x9'));var ejs=require(_0xb087('0xa'));var fs=require('fs');var _=require(_0xb087('0xb'));var squel=require(_0xb087('0xc'));var crypto=require(_0xb087('0xd'));var jsforce=require(_0xb087('0xe'));var deskjs=require(_0xb087('0xf'));var toCsv=require(_0xb087('0x9'));var querystring=require(_0xb087('0x10'));var Papa=require(_0xb087('0x11'));var Redis=require(_0xb087('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb087('0x13'));var as=require(_0xb087('0x14'));var hardwareService=require(_0xb087('0x15'));var logger=require(_0xb087('0x16'))(_0xb087('0x17'));var utils=require(_0xb087('0x18'));var config=require(_0xb087('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x189e2b,_0x31f977){_0x31f977=_0x31f977||0xcc;return function(_0x323656){if(_0x323656){return _0x189e2b['sendStatus'](_0x31f977);}return _0x189e2b[_0xb087('0x1a')](_0x31f977)[_0xb087('0x1b')]();};}function respondWithResult(_0x43f136,_0x46410b){_0x46410b=_0x46410b||0xc8;return function(_0x11784c){if(_0x11784c){return _0x43f136[_0xb087('0x1a')](_0x46410b)[_0xb087('0x1c')](_0x11784c);}};}function respondWithFilteredResult(_0x5147e3,_0x24e1a3){return function(_0x16d0b7){if(_0x16d0b7){var _0x5193a4=_0x16d0b7[_0xb087('0x1d')],_0x43e576=_0x24e1a3[_0xb087('0x1e')],_0x412b48=_0x24e1a3[_0xb087('0x1e')]+_0x24e1a3['limit'],_0x597478;if(_0x412b48>=_0x5193a4){_0x412b48=_0x5193a4;_0x597478=0xc8;}else{_0x597478=0xce;}_0x5147e3[_0xb087('0x1a')](_0x597478);return _0x5147e3[_0xb087('0x1f')](_0xb087('0x20'),_0x43e576+'-'+_0x412b48+'/'+_0x5193a4)[_0xb087('0x1c')](_0x16d0b7);}return null;};}function patchUpdates(_0x4e333b){return function(_0x13d534){try{jsonpatch[_0xb087('0x21')](_0x13d534,_0x4e333b,!![]);}catch(_0x10bb5b){return BPromise[_0xb087('0x22')](_0x10bb5b);}return _0x13d534['save']();};}function saveUpdates(_0x5aeab1,_0x5ea3dc){return function(_0x49450a){if(_0x49450a){return _0x49450a[_0xb087('0x23')](_0x5aeab1)[_0xb087('0x24')](function(_0x3d0f57){return _0x3d0f57;});}return null;};}function removeEntity(_0x1f3c0e,_0x1fb765){return function(_0x258b4c){if(_0x258b4c){return _0x258b4c[_0xb087('0x25')]()['then'](function(){_0x1f3c0e[_0xb087('0x1a')](0xcc)[_0xb087('0x1b')]();});}};}function handleEntityNotFound(_0x1de654,_0x1cfb3e){return function(_0x3ad74e){if(!_0x3ad74e){_0x1de654['sendStatus'](0x194);}return _0x3ad74e;};}function handleError(_0x183eab,_0xdd4216){_0xdd4216=_0xdd4216||0x1f4;return function(_0x502438){logger['error'](_0x502438['stack']);if(_0x502438['name']){delete _0x502438['name'];}_0x183eab[_0xb087('0x1a')](_0xdd4216)[_0xb087('0x26')](_0x502438);};}exports[_0xb087('0x27')]=function(_0x3ca2df,_0xd9ec66){var _0xb72173={},_0xf3f41f={},_0x35a52c={'count':0x0,'rows':[]};var _0x6cfb22=_[_0xb087('0x28')](db[_0xb087('0x29')][_0xb087('0x2a')],function(_0xb0baf6){return{'name':_0xb0baf6[_0xb087('0x2b')],'type':_0xb0baf6['type'][_0xb087('0x2c')]};});_0xf3f41f[_0xb087('0x2d')]=_[_0xb087('0x28')](_0x6cfb22,_0xb087('0x2e'));_0xf3f41f[_0xb087('0x2f')]=_[_0xb087('0x30')](_0x3ca2df[_0xb087('0x2f')]);_0xf3f41f[_0xb087('0x31')]=_['intersection'](_0xf3f41f['model'],_0xf3f41f[_0xb087('0x2f')]);_0xb72173[_0xb087('0x32')]=_['intersection'](_0xf3f41f[_0xb087('0x2d')],qs[_0xb087('0x33')](_0x3ca2df[_0xb087('0x2f')][_0xb087('0x33')]));_0xb72173[_0xb087('0x32')]=_0xb72173[_0xb087('0x32')][_0xb087('0x34')]?_0xb72173[_0xb087('0x32')]:_0xf3f41f[_0xb087('0x2d')];if(!_0x3ca2df[_0xb087('0x2f')][_0xb087('0x35')](_0xb087('0x36'))){_0xb72173['limit']=qs[_0xb087('0x37')](_0x3ca2df['query'][_0xb087('0x37')]);_0xb72173[_0xb087('0x1e')]=qs[_0xb087('0x1e')](_0x3ca2df[_0xb087('0x2f')][_0xb087('0x1e')]);}_0xb72173[_0xb087('0x38')]=qs[_0xb087('0x39')](_0x3ca2df[_0xb087('0x2f')][_0xb087('0x39')]);_0xb72173['where']=qs['filters'](_[_0xb087('0x3a')](_0x3ca2df[_0xb087('0x2f')],_0xf3f41f[_0xb087('0x31')]));if(_0x3ca2df[_0xb087('0x2f')][_0xb087('0x3b')]){_0xb72173['where']=_[_0xb087('0x3c')](_0xb72173[_0xb087('0x3d')],{'$or':_['map'](_0x6cfb22,function(_0x480e22){if(_0x480e22[_0xb087('0x3e')]!==_0xb087('0x3f')){var _0x130ee9={};_0x130ee9[_0x480e22['name']]={'$like':'%'+_0x3ca2df[_0xb087('0x2f')][_0xb087('0x3b')]+'%'};return _0x130ee9;}})});}_0xb72173=_[_0xb087('0x3c')]({},_0xb72173,_0x3ca2df[_0xb087('0x40')]);var _0x3c8f51={'where':_0xb72173['where']};return db[_0xb087('0x29')]['count'](_0x3c8f51)[_0xb087('0x24')](function(_0x5a582d){_0x35a52c[_0xb087('0x1d')]=_0x5a582d;if(_0x3ca2df[_0xb087('0x2f')]['includeAll']){_0xb72173[_0xb087('0x41')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0xb087('0x42')](_0xb72173);})['then'](function(_0x2d2c74){_0x35a52c[_0xb087('0x43')]=_0x2d2c74;return _0x35a52c;})[_0xb087('0x24')](respondWithFilteredResult(_0xd9ec66,_0xb72173))[_0xb087('0x44')](handleError(_0xd9ec66,null));};exports[_0xb087('0x45')]=function(_0x2a4787,_0x35d010){var _0x5e7690={'raw':!![],'where':{'id':_0x2a4787['params']['id']}},_0x1625f6={};_0x1625f6[_0xb087('0x2d')]=_[_0xb087('0x30')](db['AnalyticTreeReport'][_0xb087('0x2a')]);_0x1625f6[_0xb087('0x2f')]=_[_0xb087('0x30')](_0x2a4787['query']);_0x1625f6[_0xb087('0x31')]=_['intersection'](_0x1625f6[_0xb087('0x2d')],_0x1625f6[_0xb087('0x2f')]);_0x5e7690['attributes']=_[_0xb087('0x46')](_0x1625f6[_0xb087('0x2d')],qs['fields'](_0x2a4787[_0xb087('0x2f')][_0xb087('0x33')]));_0x5e7690['attributes']=_0x5e7690[_0xb087('0x32')][_0xb087('0x34')]?_0x5e7690[_0xb087('0x32')]:_0x1625f6[_0xb087('0x2d')];if(_0x2a4787['query']['includeAll']){_0x5e7690[_0xb087('0x41')]=[{'all':!![]}];}_0x5e7690=_[_0xb087('0x3c')]({},_0x5e7690,_0x2a4787[_0xb087('0x40')]);return db[_0xb087('0x29')][_0xb087('0x47')](_0x5e7690)[_0xb087('0x24')](handleEntityNotFound(_0x35d010,null))['then'](respondWithResult(_0x35d010,null))['catch'](handleError(_0x35d010,null));};exports[_0xb087('0x48')]=function(_0x520acc,_0x3a405b){return db[_0xb087('0x29')][_0xb087('0x48')](_0x520acc[_0xb087('0x49')],{})['then'](respondWithResult(_0x3a405b,0xc9))[_0xb087('0x44')](handleError(_0x3a405b,null));};exports['update']=function(_0x2fe8a0,_0x73413b){if(_0x2fe8a0[_0xb087('0x49')]['id']){delete _0x2fe8a0[_0xb087('0x49')]['id'];}return db[_0xb087('0x29')]['find']({'where':{'id':_0x2fe8a0[_0xb087('0x4a')]['id']}})[_0xb087('0x24')](handleEntityNotFound(_0x73413b,null))[_0xb087('0x24')](saveUpdates(_0x2fe8a0['body'],null))[_0xb087('0x24')](respondWithResult(_0x73413b,null))['catch'](handleError(_0x73413b,null));};exports['destroy']=function(_0x1c9f8f,_0x341665){return db['AnalyticTreeReport'][_0xb087('0x47')]({'where':{'id':_0x1c9f8f[_0xb087('0x4a')]['id']}})[_0xb087('0x24')](handleEntityNotFound(_0x341665,null))['then'](removeEntity(_0x341665,null))['catch'](handleError(_0x341665,null));}; \ No newline at end of file +var _0x0abf=['fields','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','length','find','create','body','html-pdf','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes'];(function(_0x16e57d,_0x2cb7ba){var _0x40239c=function(_0x3cc8f0){while(--_0x3cc8f0){_0x16e57d['push'](_0x16e57d['shift']());}};_0x40239c(++_0x2cb7ba);}(_0x0abf,0xe8));var _0xf0ab=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x0abf[_0x2f5ac5];return _0x37c9a8;};'use strict';var pdf=require(_0xf0ab('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf0ab('0x1'));var zipdir=require(_0xf0ab('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf0ab('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf0ab('0x4'));var util=require(_0xf0ab('0x5'));var path=require(_0xf0ab('0x6'));var sox=require(_0xf0ab('0x7'));var csv=require(_0xf0ab('0x8'));var ejs=require(_0xf0ab('0x9'));var fs=require('fs');var _=require(_0xf0ab('0xa'));var squel=require('squel');var crypto=require(_0xf0ab('0xb'));var jsforce=require(_0xf0ab('0xc'));var deskjs=require(_0xf0ab('0xd'));var toCsv=require(_0xf0ab('0x8'));var querystring=require('querystring');var Papa=require(_0xf0ab('0xe'));var Redis=require(_0xf0ab('0xf'));var authService=require(_0xf0ab('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf0ab('0x11'));var logger=require('../../config/logger')(_0xf0ab('0x12'));var utils=require(_0xf0ab('0x13'));var config=require(_0xf0ab('0x14'));var db=require(_0xf0ab('0x15'))['db'];function respondWithStatusCode(_0x2dc4f8,_0x38ca67){_0x38ca67=_0x38ca67||0xcc;return function(_0x34ccdc){if(_0x34ccdc){return _0x2dc4f8['sendStatus'](_0x38ca67);}return _0x2dc4f8[_0xf0ab('0x16')](_0x38ca67)[_0xf0ab('0x17')]();};}function respondWithResult(_0x1913fe,_0x35c75f){_0x35c75f=_0x35c75f||0xc8;return function(_0x1824ef){if(_0x1824ef){return _0x1913fe[_0xf0ab('0x16')](_0x35c75f)[_0xf0ab('0x18')](_0x1824ef);}};}function respondWithFilteredResult(_0x1fb4e5,_0x180d0b){return function(_0x3c5bfd){if(_0x3c5bfd){var _0x20f453=_0x3c5bfd[_0xf0ab('0x19')],_0x221bac=_0x180d0b['offset'],_0x200cf5=_0x180d0b[_0xf0ab('0x1a')]+_0x180d0b[_0xf0ab('0x1b')],_0x2f4618;if(_0x200cf5>=_0x20f453){_0x200cf5=_0x20f453;_0x2f4618=0xc8;}else{_0x2f4618=0xce;}_0x1fb4e5[_0xf0ab('0x16')](_0x2f4618);return _0x1fb4e5[_0xf0ab('0x1c')](_0xf0ab('0x1d'),_0x221bac+'-'+_0x200cf5+'/'+_0x20f453)[_0xf0ab('0x18')](_0x3c5bfd);}return null;};}function patchUpdates(_0x3a0edf){return function(_0x263e2b){try{jsonpatch[_0xf0ab('0x1e')](_0x263e2b,_0x3a0edf,!![]);}catch(_0x1874a5){return BPromise[_0xf0ab('0x1f')](_0x1874a5);}return _0x263e2b[_0xf0ab('0x20')]();};}function saveUpdates(_0xf43bc4,_0x22a205){return function(_0x2cd961){if(_0x2cd961){return _0x2cd961[_0xf0ab('0x21')](_0xf43bc4)['then'](function(_0x153492){return _0x153492;});}return null;};}function removeEntity(_0x6fa888,_0x1e1483){return function(_0x11ab3a){if(_0x11ab3a){return _0x11ab3a[_0xf0ab('0x22')]()[_0xf0ab('0x23')](function(){_0x6fa888[_0xf0ab('0x16')](0xcc)[_0xf0ab('0x17')]();});}};}function handleEntityNotFound(_0x36ad01,_0x18bb37){return function(_0x43119f){if(!_0x43119f){_0x36ad01['sendStatus'](0x194);}return _0x43119f;};}function handleError(_0x585841,_0x4eee21){_0x4eee21=_0x4eee21||0x1f4;return function(_0x33aaa0){logger['error'](_0x33aaa0[_0xf0ab('0x24')]);if(_0x33aaa0[_0xf0ab('0x25')]){delete _0x33aaa0['name'];}_0x585841[_0xf0ab('0x16')](_0x4eee21)[_0xf0ab('0x26')](_0x33aaa0);};}exports[_0xf0ab('0x27')]=function(_0x38fb71,_0x7d4ff9){var _0x502921={},_0x2d0da7={},_0x574ce7={'count':0x0,'rows':[]};var _0x55d799=_[_0xf0ab('0x28')](db[_0xf0ab('0x29')][_0xf0ab('0x2a')],function(_0x445160){return{'name':_0x445160[_0xf0ab('0x2b')],'type':_0x445160[_0xf0ab('0x2c')][_0xf0ab('0x2d')]};});_0x2d0da7[_0xf0ab('0x2e')]=_[_0xf0ab('0x28')](_0x55d799,_0xf0ab('0x25'));_0x2d0da7[_0xf0ab('0x2f')]=_[_0xf0ab('0x30')](_0x38fb71['query']);_0x2d0da7[_0xf0ab('0x31')]=_[_0xf0ab('0x32')](_0x2d0da7['model'],_0x2d0da7['query']);_0x502921[_0xf0ab('0x33')]=_[_0xf0ab('0x32')](_0x2d0da7[_0xf0ab('0x2e')],qs['fields'](_0x38fb71['query'][_0xf0ab('0x34')]));_0x502921['attributes']=_0x502921[_0xf0ab('0x33')]['length']?_0x502921[_0xf0ab('0x33')]:_0x2d0da7[_0xf0ab('0x2e')];if(!_0x38fb71['query']['hasOwnProperty'](_0xf0ab('0x35'))){_0x502921[_0xf0ab('0x1b')]=qs[_0xf0ab('0x1b')](_0x38fb71[_0xf0ab('0x2f')][_0xf0ab('0x1b')]);_0x502921[_0xf0ab('0x1a')]=qs[_0xf0ab('0x1a')](_0x38fb71[_0xf0ab('0x2f')][_0xf0ab('0x1a')]);}_0x502921[_0xf0ab('0x36')]=qs[_0xf0ab('0x37')](_0x38fb71[_0xf0ab('0x2f')][_0xf0ab('0x37')]);_0x502921[_0xf0ab('0x38')]=qs['filters'](_[_0xf0ab('0x39')](_0x38fb71[_0xf0ab('0x2f')],_0x2d0da7[_0xf0ab('0x31')]));if(_0x38fb71['query'][_0xf0ab('0x3a')]){_0x502921[_0xf0ab('0x38')]=_[_0xf0ab('0x3b')](_0x502921['where'],{'$or':_[_0xf0ab('0x28')](_0x55d799,function(_0x4fe5c0){if(_0x4fe5c0[_0xf0ab('0x2c')]!=='VIRTUAL'){var _0x4763f7={};_0x4763f7[_0x4fe5c0[_0xf0ab('0x25')]]={'$like':'%'+_0x38fb71[_0xf0ab('0x2f')][_0xf0ab('0x3a')]+'%'};return _0x4763f7;}})});}_0x502921=_[_0xf0ab('0x3b')]({},_0x502921,_0x38fb71[_0xf0ab('0x3c')]);var _0x4e3ade={'where':_0x502921[_0xf0ab('0x38')]};return db[_0xf0ab('0x29')]['count'](_0x4e3ade)[_0xf0ab('0x23')](function(_0xce89bc){_0x574ce7[_0xf0ab('0x19')]=_0xce89bc;if(_0x38fb71[_0xf0ab('0x2f')][_0xf0ab('0x3d')]){_0x502921[_0xf0ab('0x3e')]=[{'all':!![]}];}return db[_0xf0ab('0x29')]['findAll'](_0x502921);})[_0xf0ab('0x23')](function(_0x4f6e93){_0x574ce7[_0xf0ab('0x3f')]=_0x4f6e93;return _0x574ce7;})['then'](respondWithFilteredResult(_0x7d4ff9,_0x502921))[_0xf0ab('0x40')](handleError(_0x7d4ff9,null));};exports[_0xf0ab('0x41')]=function(_0x44077b,_0x32b237){var _0x2b7ed5={'raw':!![],'where':{'id':_0x44077b[_0xf0ab('0x42')]['id']}},_0x553d07={};_0x553d07[_0xf0ab('0x2e')]=_[_0xf0ab('0x30')](db[_0xf0ab('0x29')][_0xf0ab('0x2a')]);_0x553d07[_0xf0ab('0x2f')]=_[_0xf0ab('0x30')](_0x44077b[_0xf0ab('0x2f')]);_0x553d07[_0xf0ab('0x31')]=_[_0xf0ab('0x32')](_0x553d07[_0xf0ab('0x2e')],_0x553d07[_0xf0ab('0x2f')]);_0x2b7ed5[_0xf0ab('0x33')]=_['intersection'](_0x553d07['model'],qs[_0xf0ab('0x34')](_0x44077b['query'][_0xf0ab('0x34')]));_0x2b7ed5[_0xf0ab('0x33')]=_0x2b7ed5['attributes'][_0xf0ab('0x43')]?_0x2b7ed5[_0xf0ab('0x33')]:_0x553d07['model'];if(_0x44077b[_0xf0ab('0x2f')][_0xf0ab('0x3d')]){_0x2b7ed5[_0xf0ab('0x3e')]=[{'all':!![]}];}_0x2b7ed5=_[_0xf0ab('0x3b')]({},_0x2b7ed5,_0x44077b[_0xf0ab('0x3c')]);return db[_0xf0ab('0x29')][_0xf0ab('0x44')](_0x2b7ed5)[_0xf0ab('0x23')](handleEntityNotFound(_0x32b237,null))[_0xf0ab('0x23')](respondWithResult(_0x32b237,null))[_0xf0ab('0x40')](handleError(_0x32b237,null));};exports[_0xf0ab('0x45')]=function(_0x302510,_0x13b477){return db[_0xf0ab('0x29')]['create'](_0x302510['body'],{})[_0xf0ab('0x23')](respondWithResult(_0x13b477,0xc9))['catch'](handleError(_0x13b477,null));};exports['update']=function(_0x4e57d3,_0xc3b68d){if(_0x4e57d3[_0xf0ab('0x46')]['id']){delete _0x4e57d3[_0xf0ab('0x46')]['id'];}return db[_0xf0ab('0x29')][_0xf0ab('0x44')]({'where':{'id':_0x4e57d3[_0xf0ab('0x42')]['id']}})[_0xf0ab('0x23')](handleEntityNotFound(_0xc3b68d,null))[_0xf0ab('0x23')](saveUpdates(_0x4e57d3[_0xf0ab('0x46')],null))[_0xf0ab('0x23')](respondWithResult(_0xc3b68d,null))[_0xf0ab('0x40')](handleError(_0xc3b68d,null));};exports[_0xf0ab('0x22')]=function(_0x4e6c9b,_0x393c9a){return db[_0xf0ab('0x29')][_0xf0ab('0x44')]({'where':{'id':_0x4e6c9b[_0xf0ab('0x42')]['id']}})[_0xf0ab('0x23')](handleEntityNotFound(_0x393c9a,null))[_0xf0ab('0x23')](removeEntity(_0x393c9a,null))[_0xf0ab('0x40')](handleError(_0x393c9a,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 4b2d690..aed290a 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 _0x6302=['./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','util','../../config/logger','api','moment','path'];(function(_0x4fbbea,_0x6ff10f){var _0x1faebf=function(_0xdfc63e){while(--_0xdfc63e){_0x4fbbea['push'](_0x4fbbea['shift']());}};_0x1faebf(++_0x6ff10f);}(_0x6302,0x109));var _0x2630=function(_0x50709a,_0x4cf3cc){_0x50709a=_0x50709a-0x0;var _0x5ac0f7=_0x6302[_0x50709a];return _0x5ac0f7;};'use strict';var _=require('lodash');var util=require(_0x2630('0x0'));var logger=require(_0x2630('0x1'))(_0x2630('0x2'));var moment=require(_0x2630('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2630('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2630('0x5'));module[_0x2630('0x6')]=function(_0x434d82,_0x1a9f2b){return _0x434d82[_0x2630('0x7')](_0x2630('0x8'),attributes,{'tableName':_0x2630('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8d0a=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util'];(function(_0x54a9e3,_0x4a3813){var _0x247cce=function(_0x50aa49){while(--_0x50aa49){_0x54a9e3['push'](_0x54a9e3['shift']());}};_0x247cce(++_0x4a3813);}(_0x8d0a,0x172));var _0xa8d0=function(_0x415470,_0x2ea370){_0x415470=_0x415470-0x0;var _0x562e93=_0x8d0a[_0x415470];return _0x562e93;};'use strict';var _=require(_0xa8d0('0x0'));var util=require(_0xa8d0('0x1'));var logger=require(_0xa8d0('0x2'))('api');var moment=require(_0xa8d0('0x3'));var BPromise=require(_0xa8d0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa8d0('0x5'));var rimraf=require(_0xa8d0('0x6'));var config=require(_0xa8d0('0x7'));var attributes=require('./analyticTreeReport.attributes');module[_0xa8d0('0x8')]=function(_0x134652,_0x397f0f){return _0x134652[_0xa8d0('0x9')](_0xa8d0('0xa'),attributes,{'tableName':_0xa8d0('0xb'),'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 dcf6596..bf2c036 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 _0xf7b8=['message','catch','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x5ce52d,_0x475969){var _0x2f2c14=function(_0x38d59f){while(--_0x38d59f){_0x5ce52d['push'](_0x5ce52d['shift']());}};_0x2f2c14(++_0x475969);}(_0xf7b8,0x101));var _0x8f7b=function(_0x1e2307,_0x5211e4){_0x1e2307=_0x1e2307-0x0;var _0x973af1=_0xf7b8[_0x1e2307];return _0x973af1;};'use strict';var _=require('lodash');var util=require(_0x8f7b('0x0'));var moment=require('moment');var BPromise=require(_0x8f7b('0x1'));var rs=require(_0x8f7b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8f7b('0x3'));var logger=require(_0x8f7b('0x4'))(_0x8f7b('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1106d3,_0xf1f60,_0x1ae98d){return new BPromise(function(_0x339042,_0x1a6e56){return client[_0x8f7b('0x6')](_0x1106d3,_0x1ae98d)[_0x8f7b('0x7')](function(_0x5de4c4){logger[_0x8f7b('0x8')](_0x8f7b('0x9'),_0xf1f60,_0x8f7b('0xa'));logger[_0x8f7b('0xb')](_0x8f7b('0xc'),_0xf1f60,_0x8f7b('0xa'),JSON['stringify'](_0x5de4c4));if(_0x5de4c4[_0x8f7b('0xd')]){if(_0x5de4c4[_0x8f7b('0xd')][_0x8f7b('0xe')]===0x1f4){logger[_0x8f7b('0xd')](_0x8f7b('0x9'),_0xf1f60,_0x5de4c4[_0x8f7b('0xd')][_0x8f7b('0xf')]);return _0x1a6e56(_0x5de4c4[_0x8f7b('0xd')][_0x8f7b('0xf')]);}logger[_0x8f7b('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0xf1f60,_0x5de4c4[_0x8f7b('0xd')]['message']);return _0x339042(_0x5de4c4[_0x8f7b('0xd')][_0x8f7b('0xf')]);}else{logger['info']('AnalyticTreeReport,\x20%s,\x20%s',_0xf1f60,_0x8f7b('0xa'));_0x339042(_0x5de4c4['result'][_0x8f7b('0xf')]);}})[_0x8f7b('0x10')](function(_0x1a83c0){logger['error'](_0x8f7b('0x9'),_0xf1f60,_0x1a83c0);_0x1a6e56(_0x1a83c0);});});} \ No newline at end of file +var _0xcd0e=['../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','util','moment','randomstring','ioredis'];(function(_0x41031d,_0x17a3ee){var _0x2606c8=function(_0x24b03a){while(--_0x24b03a){_0x41031d['push'](_0x41031d['shift']());}};_0x2606c8(++_0x17a3ee);}(_0xcd0e,0x150));var _0xecd0=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xcd0e[_0x9df060];return _0x338dfe;};'use strict';var _=require('lodash');var util=require(_0xecd0('0x0'));var moment=require(_0xecd0('0x1'));var BPromise=require('bluebird');var rs=require(_0xecd0('0x2'));var fs=require('fs');var Redis=require(_0xecd0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xecd0('0x4'));var logger=require(_0xecd0('0x5'))(_0xecd0('0x6'));var config=require(_0xecd0('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xecd0('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a5aee,_0x4e3312,_0x9df0c5){return new BPromise(function(_0x32b3c2,_0x2e0cf4){return client[_0xecd0('0x9')](_0x4a5aee,_0x9df0c5)[_0xecd0('0xa')](function(_0x5c16ad){logger[_0xecd0('0xb')](_0xecd0('0xc'),_0x4e3312,_0xecd0('0xd'));logger[_0xecd0('0xe')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x4e3312,_0xecd0('0xd'),JSON[_0xecd0('0xf')](_0x5c16ad));if(_0x5c16ad[_0xecd0('0x10')]){if(_0x5c16ad[_0xecd0('0x10')][_0xecd0('0x11')]===0x1f4){logger[_0xecd0('0x10')](_0xecd0('0xc'),_0x4e3312,_0x5c16ad[_0xecd0('0x10')][_0xecd0('0x12')]);return _0x2e0cf4(_0x5c16ad[_0xecd0('0x10')]['message']);}logger[_0xecd0('0x10')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4e3312,_0x5c16ad[_0xecd0('0x10')][_0xecd0('0x12')]);return _0x32b3c2(_0x5c16ad[_0xecd0('0x10')][_0xecd0('0x12')]);}else{logger[_0xecd0('0xb')](_0xecd0('0xc'),_0x4e3312,_0xecd0('0xd'));_0x32b3c2(_0x5c16ad['result'][_0xecd0('0x12')]);}})[_0xecd0('0x13')](function(_0x5e3677){logger['error'](_0xecd0('0xc'),_0x4e3312,_0x5e3677);_0x2e0cf4(_0x5e3677);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 84c4c01..d5272b1 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 _0xe255=['destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete'];(function(_0x38d4a4,_0x4db1e7){var _0x47dd6f=function(_0x205b6e){while(--_0x205b6e){_0x38d4a4['push'](_0x38d4a4['shift']());}};_0x47dd6f(++_0x4db1e7);}(_0xe255,0x1a6));var _0x5e25=function(_0x532ba2,_0x57960c){_0x532ba2=_0x532ba2-0x0;var _0x51f38b=_0xe255[_0x532ba2];return _0x51f38b;};'use strict';var multer=require(_0x5e25('0x0'));var util=require('util');var path=require(_0x5e25('0x1'));var timeout=require(_0x5e25('0x2'));var express=require(_0x5e25('0x3'));var router=express[_0x5e25('0x4')]();var auth=require(_0x5e25('0x5'));var interaction=require(_0x5e25('0x6'));var config=require(_0x5e25('0x7'));var controller=require(_0x5e25('0x8'));router[_0x5e25('0x9')]('/',auth[_0x5e25('0xa')](),controller[_0x5e25('0xb')]);router[_0x5e25('0x9')](_0x5e25('0xc'),auth[_0x5e25('0xa')](),controller[_0x5e25('0xd')]);router[_0x5e25('0xe')]('/',auth[_0x5e25('0xa')](),controller[_0x5e25('0xf')]);router['put']('/:id',auth[_0x5e25('0xa')](),controller[_0x5e25('0x10')]);router[_0x5e25('0x11')](_0x5e25('0xc'),auth['isAuthenticated'](),controller[_0x5e25('0x12')]);module[_0x5e25('0x13')]=router; \ No newline at end of file +var _0x6191=['destroy','multer','util','connect-timeout','express','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','index','isAuthenticated','show','post','create','/:id'];(function(_0x22d114,_0x2d249b){var _0x17c386=function(_0x398906){while(--_0x398906){_0x22d114['push'](_0x22d114['shift']());}};_0x17c386(++_0x2d249b);}(_0x6191,0x88));var _0x1619=function(_0x5b36bd,_0x4dfb36){_0x5b36bd=_0x5b36bd-0x0;var _0x1614fe=_0x6191[_0x5b36bd];return _0x1614fe;};'use strict';var multer=require(_0x1619('0x0'));var util=require(_0x1619('0x1'));var path=require('path');var timeout=require(_0x1619('0x2'));var express=require(_0x1619('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x1619('0x4'));var config=require(_0x1619('0x5'));var controller=require(_0x1619('0x6'));router[_0x1619('0x7')]('/',auth['isAuthenticated'](),controller[_0x1619('0x8')]);router[_0x1619('0x7')]('/:id',auth[_0x1619('0x9')](),controller[_0x1619('0xa')]);router[_0x1619('0xb')]('/',auth[_0x1619('0x9')](),controller[_0x1619('0xc')]);router['put'](_0x1619('0xd'),auth[_0x1619('0x9')](),controller['update']);router['delete'](_0x1619('0xd'),auth[_0x1619('0x9')](),controller[_0x1619('0xe')]);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 b642a27..d749d3f 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 _0xc5e0=['STRING','sequelize'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0xc5e0,0x18f));var _0x0c5e=function(_0x1f8ef1,_0x20f263){_0x1f8ef1=_0x1f8ef1-0x0;var _0x574cc3=_0xc5e0[_0x1f8ef1];return _0x574cc3;};'use strict';var Sequelize=require(_0x0c5e('0x0'));module['exports']={'name':{'type':Sequelize[_0x0c5e('0x1')]},'basename':{'type':Sequelize[_0x0c5e('0x1')]},'type':{'type':Sequelize[_0x0c5e('0x1')]}}; \ No newline at end of file +var _0xc71e=['exports','STRING','sequelize'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0xc71e,0x1cd));var _0xec71=function(_0x3667c6,_0x3bb757){_0x3667c6=_0x3667c6-0x0;var _0x503ced=_0xc71e[_0x3667c6];return _0x503ced;};'use strict';var Sequelize=require(_0xec71('0x0'));module[_0xec71('0x1')]={'name':{'type':Sequelize[_0xec71('0x2')]},'basename':{'type':Sequelize[_0xec71('0x2')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index f22b268..7ae9d33 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 _0xe804=['Attachment','rawAttributes','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','fields','find','catch','get','omit','updatedAt','createdAt','body','create','originalname','basename','mimetype','join','root','server/files/attachments/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','limit','Content-Range','json','save','update','then','error','stack','name','map'];(function(_0x2ba462,_0x4b8e6f){var _0x1c1278=function(_0x473747){while(--_0x473747){_0x2ba462['push'](_0x2ba462['shift']());}};_0x1c1278(++_0x4b8e6f);}(_0xe804,0xc9));var _0x4e80=function(_0x1465a4,_0x4b1bda){_0x1465a4=_0x1465a4-0x0;var _0x219a98=_0xe804[_0x1465a4];return _0x219a98;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4e80('0x0'));var rimraf=require(_0x4e80('0x1'));var zipdir=require(_0x4e80('0x2'));var jsonpatch=require(_0x4e80('0x3'));var rp=require(_0x4e80('0x4'));var moment=require('moment');var BPromise=require(_0x4e80('0x5'));var Mustache=require(_0x4e80('0x6'));var util=require(_0x4e80('0x7'));var path=require(_0x4e80('0x8'));var sox=require(_0x4e80('0x9'));var csv=require(_0x4e80('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x4e80('0xb'));var crypto=require(_0x4e80('0xc'));var jsforce=require(_0x4e80('0xd'));var deskjs=require(_0x4e80('0xe'));var toCsv=require(_0x4e80('0xa'));var querystring=require(_0x4e80('0xf'));var Papa=require(_0x4e80('0x10'));var Redis=require('ioredis');var authService=require(_0x4e80('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4e80('0x12'));var hardwareService=require(_0x4e80('0x13'));var logger=require(_0x4e80('0x14'))(_0x4e80('0x15'));var utils=require(_0x4e80('0x16'));var config=require('../../config/environment');var db=require(_0x4e80('0x17'))['db'];function respondWithStatusCode(_0x18a927,_0x172bbb){_0x172bbb=_0x172bbb||0xcc;return function(_0x1d42c5){if(_0x1d42c5){return _0x18a927[_0x4e80('0x18')](_0x172bbb);}return _0x18a927[_0x4e80('0x19')](_0x172bbb)[_0x4e80('0x1a')]();};}function respondWithResult(_0x260577,_0x1a82dc){_0x1a82dc=_0x1a82dc||0xc8;return function(_0x556e50){if(_0x556e50){return _0x260577[_0x4e80('0x19')](_0x1a82dc)['json'](_0x556e50);}};}function respondWithFilteredResult(_0x165b66,_0x3d5f8a){return function(_0x10a234){if(_0x10a234){var _0x3cd6e6=_0x10a234[_0x4e80('0x1b')],_0x2675b0=_0x3d5f8a[_0x4e80('0x1c')],_0x413743=_0x3d5f8a[_0x4e80('0x1c')]+_0x3d5f8a[_0x4e80('0x1d')],_0x5b88b5;if(_0x413743>=_0x3cd6e6){_0x413743=_0x3cd6e6;_0x5b88b5=0xc8;}else{_0x5b88b5=0xce;}_0x165b66[_0x4e80('0x19')](_0x5b88b5);return _0x165b66['set'](_0x4e80('0x1e'),_0x2675b0+'-'+_0x413743+'/'+_0x3cd6e6)[_0x4e80('0x1f')](_0x10a234);}return null;};}function patchUpdates(_0x3dad7d){return function(_0xff7cd2){try{jsonpatch['apply'](_0xff7cd2,_0x3dad7d,!![]);}catch(_0x808208){return BPromise['reject'](_0x808208);}return _0xff7cd2[_0x4e80('0x20')]();};}function saveUpdates(_0x249853,_0x42d21a){return function(_0x4ad44b){if(_0x4ad44b){return _0x4ad44b[_0x4e80('0x21')](_0x249853)[_0x4e80('0x22')](function(_0x2a1ec7){return _0x2a1ec7;});}return null;};}function removeEntity(_0x4f6135,_0x524367){return function(_0x7912e9){if(_0x7912e9){return _0x7912e9['destroy']()['then'](function(){_0x4f6135['status'](0xcc)[_0x4e80('0x1a')]();});}};}function handleEntityNotFound(_0x14f445,_0x39011f){return function(_0x46a10c){if(!_0x46a10c){_0x14f445[_0x4e80('0x18')](0x194);}return _0x46a10c;};}function handleError(_0x39f862,_0x36787e){_0x36787e=_0x36787e||0x1f4;return function(_0x384d27){logger[_0x4e80('0x23')](_0x384d27[_0x4e80('0x24')]);if(_0x384d27[_0x4e80('0x25')]){delete _0x384d27[_0x4e80('0x25')];}_0x39f862[_0x4e80('0x19')](_0x36787e)['send'](_0x384d27);};}exports['index']=function(_0x14b2b6,_0x2c3253){var _0x588bf6={},_0x5a8132={},_0x5b3a23={'count':0x0,'rows':[]};var _0x106f52=_[_0x4e80('0x26')](db[_0x4e80('0x27')][_0x4e80('0x28')],function(_0x9446d3){return{'name':_0x9446d3['fieldName'],'type':_0x9446d3[_0x4e80('0x29')][_0x4e80('0x2a')]};});_0x5a8132[_0x4e80('0x2b')]=_[_0x4e80('0x26')](_0x106f52,_0x4e80('0x25'));_0x5a8132[_0x4e80('0x2c')]=_[_0x4e80('0x2d')](_0x14b2b6[_0x4e80('0x2c')]);_0x5a8132['filters']=_['intersection'](_0x5a8132['model'],_0x5a8132[_0x4e80('0x2c')]);_0x588bf6['attributes']=_[_0x4e80('0x2e')](_0x5a8132['model'],qs['fields'](_0x14b2b6['query']['fields']));_0x588bf6[_0x4e80('0x2f')]=_0x588bf6[_0x4e80('0x2f')][_0x4e80('0x30')]?_0x588bf6[_0x4e80('0x2f')]:_0x5a8132[_0x4e80('0x2b')];if(!_0x14b2b6['query'][_0x4e80('0x31')](_0x4e80('0x32'))){_0x588bf6[_0x4e80('0x1d')]=qs[_0x4e80('0x1d')](_0x14b2b6[_0x4e80('0x2c')][_0x4e80('0x1d')]);_0x588bf6[_0x4e80('0x1c')]=qs[_0x4e80('0x1c')](_0x14b2b6[_0x4e80('0x2c')]['offset']);}_0x588bf6[_0x4e80('0x33')]=qs[_0x4e80('0x34')](_0x14b2b6['query'][_0x4e80('0x34')]);_0x588bf6[_0x4e80('0x35')]=qs['filters'](_[_0x4e80('0x36')](_0x14b2b6[_0x4e80('0x2c')],_0x5a8132[_0x4e80('0x37')]));if(_0x14b2b6['query'][_0x4e80('0x38')]){_0x588bf6[_0x4e80('0x35')]=_[_0x4e80('0x39')](_0x588bf6[_0x4e80('0x35')],{'$or':_[_0x4e80('0x26')](_0x106f52,function(_0x34307c){if(_0x34307c['type']!==_0x4e80('0x3a')){var _0x5ea994={};_0x5ea994[_0x34307c[_0x4e80('0x25')]]={'$like':'%'+_0x14b2b6[_0x4e80('0x2c')][_0x4e80('0x38')]+'%'};return _0x5ea994;}})});}_0x588bf6=_[_0x4e80('0x39')]({},_0x588bf6,_0x14b2b6[_0x4e80('0x3b')]);var _0x4ad17e={'where':_0x588bf6[_0x4e80('0x35')]};return db[_0x4e80('0x27')][_0x4e80('0x1b')](_0x4ad17e)[_0x4e80('0x22')](function(_0x1a0c1e){_0x5b3a23[_0x4e80('0x1b')]=_0x1a0c1e;if(_0x14b2b6['query'][_0x4e80('0x3c')]){_0x588bf6[_0x4e80('0x3d')]=[{'all':!![]}];}return db[_0x4e80('0x27')]['findAll'](_0x588bf6);})['then'](function(_0x3b18ae){_0x5b3a23[_0x4e80('0x3e')]=_0x3b18ae;return _0x5b3a23;})[_0x4e80('0x22')](respondWithFilteredResult(_0x2c3253,_0x588bf6))['catch'](handleError(_0x2c3253,null));};exports[_0x4e80('0x3f')]=function(_0x2ebc3d,_0x264d42){var _0x526df4={'raw':!![],'where':{'id':_0x2ebc3d[_0x4e80('0x40')]['id']}},_0xd43b6e={};_0xd43b6e[_0x4e80('0x2b')]=_[_0x4e80('0x2d')](db['Attachment'][_0x4e80('0x28')]);_0xd43b6e[_0x4e80('0x2c')]=_[_0x4e80('0x2d')](_0x2ebc3d[_0x4e80('0x2c')]);_0xd43b6e['filters']=_['intersection'](_0xd43b6e[_0x4e80('0x2b')],_0xd43b6e[_0x4e80('0x2c')]);_0x526df4['attributes']=_[_0x4e80('0x2e')](_0xd43b6e[_0x4e80('0x2b')],qs[_0x4e80('0x41')](_0x2ebc3d['query']['fields']));_0x526df4['attributes']=_0x526df4['attributes'][_0x4e80('0x30')]?_0x526df4[_0x4e80('0x2f')]:_0xd43b6e[_0x4e80('0x2b')];if(_0x2ebc3d[_0x4e80('0x2c')][_0x4e80('0x3c')]){_0x526df4[_0x4e80('0x3d')]=[{'all':!![]}];}_0x526df4=_['merge']({},_0x526df4,_0x2ebc3d[_0x4e80('0x3b')]);return db[_0x4e80('0x27')][_0x4e80('0x42')](_0x526df4)[_0x4e80('0x22')](handleEntityNotFound(_0x264d42,null))[_0x4e80('0x22')](respondWithResult(_0x264d42,null))[_0x4e80('0x43')](handleError(_0x264d42,null));};exports['clone']=function(_0x5c66f6,_0x407473){var _0x135c5f={'where':{'id':_0x5c66f6[_0x4e80('0x40')]['id']}},_0x36748e={};_0x36748e[_0x4e80('0x2b')]=_[_0x4e80('0x2d')](db[_0x4e80('0x27')][_0x4e80('0x28')]);_0x135c5f[_0x4e80('0x2f')]=_[_0x4e80('0x2e')](_0x36748e[_0x4e80('0x2b')],qs[_0x4e80('0x41')](_0x5c66f6[_0x4e80('0x2c')][_0x4e80('0x41')]));_0x135c5f[_0x4e80('0x2f')]=_0x135c5f[_0x4e80('0x2f')][_0x4e80('0x30')]?_0x135c5f['attributes']:_0x36748e[_0x4e80('0x2b')];if(_0x5c66f6['query'][_0x4e80('0x3c')]){_0x135c5f[_0x4e80('0x3d')]=[{'all':!![]}];}_0x135c5f=_[_0x4e80('0x39')]({},_0x135c5f,_0x5c66f6['options']);return db[_0x4e80('0x27')][_0x4e80('0x42')](_0x135c5f)[_0x4e80('0x22')](handleEntityNotFound(_0x407473,null))[_0x4e80('0x22')](function(_0x8055bc){if(_0x8055bc){var _0x333740=_0x8055bc[_0x4e80('0x44')]({'plain':!![]});_0x333740=qs[_0x4e80('0x45')](_0x333740,['id','createdAt',_0x4e80('0x46')]);_0x5c66f6['body']=_['omit'](_0x5c66f6['body'],['id',_0x4e80('0x47'),'updatedAt']);return db[_0x4e80('0x27')]['create'](_['merge'](_0x333740,_0x5c66f6[_0x4e80('0x48')]),{'include':_0x5c66f6[_0x4e80('0x2c')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x4e80('0x22')](respondWithResult(_0x407473,0xc9))[_0x4e80('0x43')](handleError(_0x407473,null));};exports[_0x4e80('0x21')]=function(_0x2c11d6,_0x11f3c5){if(_0x2c11d6[_0x4e80('0x48')]['id']){delete _0x2c11d6[_0x4e80('0x48')]['id'];}return db[_0x4e80('0x27')][_0x4e80('0x42')]({'where':{'id':_0x2c11d6[_0x4e80('0x40')]['id']}})[_0x4e80('0x22')](handleEntityNotFound(_0x11f3c5,null))[_0x4e80('0x22')](saveUpdates(_0x2c11d6[_0x4e80('0x48')],null))['then'](respondWithResult(_0x11f3c5,null))[_0x4e80('0x43')](handleError(_0x11f3c5,null));};exports['destroy']=function(_0x1c2237,_0x3fdbd2){return db[_0x4e80('0x27')][_0x4e80('0x42')]({'where':{'id':_0x1c2237[_0x4e80('0x40')]['id']}})['then'](handleEntityNotFound(_0x3fdbd2,null))['then'](removeEntity(_0x3fdbd2,null))[_0x4e80('0x43')](handleError(_0x3fdbd2,null));};exports[_0x4e80('0x49')]=function(_0x4f7f73,_0x417d33,_0xd37d79){_0x4f7f73[_0x4e80('0x48')][_0x4e80('0x25')]=_0x4f7f73['file'][_0x4e80('0x4a')];_0x4f7f73[_0x4e80('0x48')][_0x4e80('0x4b')]=_0x4f7f73['file']['filename'];_0x4f7f73['body'][_0x4e80('0x29')]=_0x4f7f73['file'][_0x4e80('0x4c')];return db[_0x4e80('0x27')][_0x4e80('0x49')](_0x4f7f73[_0x4e80('0x48')])[_0x4e80('0x22')](respondWithResult(_0x417d33,0xc9))[_0x4e80('0x43')](handleError(_0x417d33,null));};exports['download']=function(_0x46c796,_0xe9076c,_0xc740d6){return db[_0x4e80('0x27')]['findOne']({'where':{'id':_0x46c796[_0x4e80('0x40')]['id']},'raw':!![]})[_0x4e80('0x22')](handleEntityNotFound(_0xe9076c,null))[_0x4e80('0x22')](function(_0x5c4859){if(_0x5c4859){return _0xe9076c['download'](path[_0x4e80('0x4d')](config[_0x4e80('0x4e')],_0x4e80('0x4f'),_0x5c4859[_0x4e80('0x4b')]));}})[_0x4e80('0x43')](handleError(_0xe9076c,null));}; \ No newline at end of file +var _0x377b=['key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','find','catch','clone','omit','createdAt','body','updatedAt','update','destroy','originalname','basename','file','filename','mimetype','download','findOne','server/files/attachments/','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','then','error','name','send','index','map','Attachment','rawAttributes','fieldName','type'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x377b,0x80));var _0xb377=function(_0x7d42b9,_0x531795){_0x7d42b9=_0x7d42b9-0x0;var _0x4cf779=_0x377b[_0x7d42b9];return _0x4cf779;};'use strict';var pdf=require(_0xb377('0x0'));var emlformat=require(_0xb377('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb377('0x2'));var jsonpatch=require(_0xb377('0x3'));var rp=require(_0xb377('0x4'));var moment=require(_0xb377('0x5'));var BPromise=require(_0xb377('0x6'));var Mustache=require(_0xb377('0x7'));var util=require(_0xb377('0x8'));var path=require(_0xb377('0x9'));var sox=require(_0xb377('0xa'));var csv=require('to-csv');var ejs=require(_0xb377('0xb'));var fs=require('fs');var _=require(_0xb377('0xc'));var squel=require('squel');var crypto=require(_0xb377('0xd'));var jsforce=require(_0xb377('0xe'));var deskjs=require(_0xb377('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb377('0x10'));var Papa=require(_0xb377('0x11'));var Redis=require(_0xb377('0x12'));var authService=require(_0xb377('0x13'));var qs=require(_0xb377('0x14'));var as=require(_0xb377('0x15'));var hardwareService=require(_0xb377('0x16'));var logger=require(_0xb377('0x17'))(_0xb377('0x18'));var utils=require('../../config/utils');var config=require(_0xb377('0x19'));var db=require(_0xb377('0x1a'))['db'];function respondWithStatusCode(_0x52edaa,_0x2f980f){_0x2f980f=_0x2f980f||0xcc;return function(_0x423680){if(_0x423680){return _0x52edaa[_0xb377('0x1b')](_0x2f980f);}return _0x52edaa[_0xb377('0x1c')](_0x2f980f)[_0xb377('0x1d')]();};}function respondWithResult(_0x385269,_0x4b540b){_0x4b540b=_0x4b540b||0xc8;return function(_0x38474c){if(_0x38474c){return _0x385269[_0xb377('0x1c')](_0x4b540b)[_0xb377('0x1e')](_0x38474c);}};}function respondWithFilteredResult(_0x572474,_0x447633){return function(_0x398c44){if(_0x398c44){var _0x5acbbf=_0x398c44[_0xb377('0x1f')],_0x235bfa=_0x447633[_0xb377('0x20')],_0x54e98f=_0x447633[_0xb377('0x20')]+_0x447633[_0xb377('0x21')],_0x49b860;if(_0x54e98f>=_0x5acbbf){_0x54e98f=_0x5acbbf;_0x49b860=0xc8;}else{_0x49b860=0xce;}_0x572474['status'](_0x49b860);return _0x572474[_0xb377('0x22')](_0xb377('0x23'),_0x235bfa+'-'+_0x54e98f+'/'+_0x5acbbf)[_0xb377('0x1e')](_0x398c44);}return null;};}function patchUpdates(_0x26ae0a){return function(_0x1e3364){try{jsonpatch['apply'](_0x1e3364,_0x26ae0a,!![]);}catch(_0x557763){return BPromise['reject'](_0x557763);}return _0x1e3364['save']();};}function saveUpdates(_0x1b9e65,_0x5a9cc9){return function(_0x314a5e){if(_0x314a5e){return _0x314a5e['update'](_0x1b9e65)[_0xb377('0x24')](function(_0x428678){return _0x428678;});}return null;};}function removeEntity(_0x5d2468,_0x5a4ffb){return function(_0x88207e){if(_0x88207e){return _0x88207e['destroy']()['then'](function(){_0x5d2468[_0xb377('0x1c')](0xcc)[_0xb377('0x1d')]();});}};}function handleEntityNotFound(_0x37b996,_0x57a1b2){return function(_0x1b738e){if(!_0x1b738e){_0x37b996[_0xb377('0x1b')](0x194);}return _0x1b738e;};}function handleError(_0x192c87,_0x23fd86){_0x23fd86=_0x23fd86||0x1f4;return function(_0x5ad143){logger[_0xb377('0x25')](_0x5ad143['stack']);if(_0x5ad143[_0xb377('0x26')]){delete _0x5ad143[_0xb377('0x26')];}_0x192c87[_0xb377('0x1c')](_0x23fd86)[_0xb377('0x27')](_0x5ad143);};}exports[_0xb377('0x28')]=function(_0x5ea90b,_0x56feaa){var _0x19b498={},_0x176787={},_0x5b332d={'count':0x0,'rows':[]};var _0x46e75e=_[_0xb377('0x29')](db[_0xb377('0x2a')][_0xb377('0x2b')],function(_0x570430){return{'name':_0x570430[_0xb377('0x2c')],'type':_0x570430[_0xb377('0x2d')][_0xb377('0x2e')]};});_0x176787[_0xb377('0x2f')]=_[_0xb377('0x29')](_0x46e75e,_0xb377('0x26'));_0x176787[_0xb377('0x30')]=_[_0xb377('0x31')](_0x5ea90b['query']);_0x176787['filters']=_[_0xb377('0x32')](_0x176787[_0xb377('0x2f')],_0x176787['query']);_0x19b498['attributes']=_['intersection'](_0x176787[_0xb377('0x2f')],qs[_0xb377('0x33')](_0x5ea90b['query'][_0xb377('0x33')]));_0x19b498[_0xb377('0x34')]=_0x19b498[_0xb377('0x34')]['length']?_0x19b498[_0xb377('0x34')]:_0x176787[_0xb377('0x2f')];if(!_0x5ea90b[_0xb377('0x30')][_0xb377('0x35')](_0xb377('0x36'))){_0x19b498[_0xb377('0x21')]=qs['limit'](_0x5ea90b['query'][_0xb377('0x21')]);_0x19b498[_0xb377('0x20')]=qs['offset'](_0x5ea90b['query'][_0xb377('0x20')]);}_0x19b498[_0xb377('0x37')]=qs[_0xb377('0x38')](_0x5ea90b[_0xb377('0x30')][_0xb377('0x38')]);_0x19b498[_0xb377('0x39')]=qs[_0xb377('0x3a')](_['pick'](_0x5ea90b[_0xb377('0x30')],_0x176787['filters']));if(_0x5ea90b[_0xb377('0x30')][_0xb377('0x3b')]){_0x19b498[_0xb377('0x39')]=_[_0xb377('0x3c')](_0x19b498[_0xb377('0x39')],{'$or':_[_0xb377('0x29')](_0x46e75e,function(_0x1cb650){if(_0x1cb650[_0xb377('0x2d')]!==_0xb377('0x3d')){var _0x12e379={};_0x12e379[_0x1cb650[_0xb377('0x26')]]={'$like':'%'+_0x5ea90b['query'][_0xb377('0x3b')]+'%'};return _0x12e379;}})});}_0x19b498=_[_0xb377('0x3c')]({},_0x19b498,_0x5ea90b[_0xb377('0x3e')]);var _0x59aa7c={'where':_0x19b498[_0xb377('0x39')]};return db['Attachment'][_0xb377('0x1f')](_0x59aa7c)['then'](function(_0x20c6f2){_0x5b332d['count']=_0x20c6f2;if(_0x5ea90b[_0xb377('0x30')][_0xb377('0x3f')]){_0x19b498[_0xb377('0x40')]=[{'all':!![]}];}return db[_0xb377('0x2a')][_0xb377('0x41')](_0x19b498);})[_0xb377('0x24')](function(_0x2d6c6c){_0x5b332d[_0xb377('0x42')]=_0x2d6c6c;return _0x5b332d;})['then'](respondWithFilteredResult(_0x56feaa,_0x19b498))['catch'](handleError(_0x56feaa,null));};exports[_0xb377('0x43')]=function(_0xf44313,_0x408473){var _0x57e190={'raw':!![],'where':{'id':_0xf44313[_0xb377('0x44')]['id']}},_0x7898ea={};_0x7898ea[_0xb377('0x2f')]=_[_0xb377('0x31')](db[_0xb377('0x2a')]['rawAttributes']);_0x7898ea[_0xb377('0x30')]=_[_0xb377('0x31')](_0xf44313[_0xb377('0x30')]);_0x7898ea[_0xb377('0x3a')]=_[_0xb377('0x32')](_0x7898ea[_0xb377('0x2f')],_0x7898ea[_0xb377('0x30')]);_0x57e190[_0xb377('0x34')]=_['intersection'](_0x7898ea[_0xb377('0x2f')],qs[_0xb377('0x33')](_0xf44313[_0xb377('0x30')][_0xb377('0x33')]));_0x57e190['attributes']=_0x57e190[_0xb377('0x34')][_0xb377('0x45')]?_0x57e190['attributes']:_0x7898ea[_0xb377('0x2f')];if(_0xf44313[_0xb377('0x30')][_0xb377('0x3f')]){_0x57e190['include']=[{'all':!![]}];}_0x57e190=_[_0xb377('0x3c')]({},_0x57e190,_0xf44313['options']);return db[_0xb377('0x2a')][_0xb377('0x46')](_0x57e190)[_0xb377('0x24')](handleEntityNotFound(_0x408473,null))[_0xb377('0x24')](respondWithResult(_0x408473,null))[_0xb377('0x47')](handleError(_0x408473,null));};exports[_0xb377('0x48')]=function(_0x40b9b5,_0x4daf17){var _0x754bc8={'where':{'id':_0x40b9b5[_0xb377('0x44')]['id']}},_0x10d87c={};_0x10d87c[_0xb377('0x2f')]=_[_0xb377('0x31')](db[_0xb377('0x2a')]['rawAttributes']);_0x754bc8[_0xb377('0x34')]=_['intersection'](_0x10d87c[_0xb377('0x2f')],qs[_0xb377('0x33')](_0x40b9b5[_0xb377('0x30')][_0xb377('0x33')]));_0x754bc8[_0xb377('0x34')]=_0x754bc8[_0xb377('0x34')][_0xb377('0x45')]?_0x754bc8[_0xb377('0x34')]:_0x10d87c[_0xb377('0x2f')];if(_0x40b9b5[_0xb377('0x30')][_0xb377('0x3f')]){_0x754bc8[_0xb377('0x40')]=[{'all':!![]}];}_0x754bc8=_[_0xb377('0x3c')]({},_0x754bc8,_0x40b9b5[_0xb377('0x3e')]);return db[_0xb377('0x2a')][_0xb377('0x46')](_0x754bc8)['then'](handleEntityNotFound(_0x4daf17,null))[_0xb377('0x24')](function(_0x39c27f){if(_0x39c27f){var _0x54443f=_0x39c27f['get']({'plain':!![]});_0x54443f=qs[_0xb377('0x49')](_0x54443f,['id',_0xb377('0x4a'),'updatedAt']);_0x40b9b5[_0xb377('0x4b')]=_['omit'](_0x40b9b5[_0xb377('0x4b')],['id','createdAt',_0xb377('0x4c')]);return db[_0xb377('0x2a')]['create'](_[_0xb377('0x3c')](_0x54443f,_0x40b9b5[_0xb377('0x4b')]),{'include':_0x40b9b5[_0xb377('0x30')]['includeAll']?[{'all':!![]}]:undefined});}})[_0xb377('0x24')](respondWithResult(_0x4daf17,0xc9))[_0xb377('0x47')](handleError(_0x4daf17,null));};exports[_0xb377('0x4d')]=function(_0x1972e3,_0x68103a){if(_0x1972e3['body']['id']){delete _0x1972e3[_0xb377('0x4b')]['id'];}return db[_0xb377('0x2a')][_0xb377('0x46')]({'where':{'id':_0x1972e3[_0xb377('0x44')]['id']}})[_0xb377('0x24')](handleEntityNotFound(_0x68103a,null))[_0xb377('0x24')](saveUpdates(_0x1972e3['body'],null))['then'](respondWithResult(_0x68103a,null))['catch'](handleError(_0x68103a,null));};exports[_0xb377('0x4e')]=function(_0x178f2e,_0x22fc24){return db[_0xb377('0x2a')]['find']({'where':{'id':_0x178f2e[_0xb377('0x44')]['id']}})[_0xb377('0x24')](handleEntityNotFound(_0x22fc24,null))[_0xb377('0x24')](removeEntity(_0x22fc24,null))[_0xb377('0x47')](handleError(_0x22fc24,null));};exports['create']=function(_0x3e566a,_0x100820,_0x430d04){_0x3e566a[_0xb377('0x4b')]['name']=_0x3e566a['file'][_0xb377('0x4f')];_0x3e566a[_0xb377('0x4b')][_0xb377('0x50')]=_0x3e566a[_0xb377('0x51')][_0xb377('0x52')];_0x3e566a[_0xb377('0x4b')]['type']=_0x3e566a['file'][_0xb377('0x53')];return db[_0xb377('0x2a')]['create'](_0x3e566a[_0xb377('0x4b')])[_0xb377('0x24')](respondWithResult(_0x100820,0xc9))['catch'](handleError(_0x100820,null));};exports[_0xb377('0x54')]=function(_0x1b7767,_0x3574e9,_0x456556){return db[_0xb377('0x2a')][_0xb377('0x55')]({'where':{'id':_0x1b7767[_0xb377('0x44')]['id']},'raw':!![]})[_0xb377('0x24')](handleEntityNotFound(_0x3574e9,null))['then'](function(_0x170e35){if(_0x170e35){return _0x3574e9[_0xb377('0x54')](path['join'](config['root'],_0xb377('0x56'),_0x170e35[_0xb377('0x50')]));}})[_0xb377('0x47')](handleError(_0x3574e9,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index c83b39e..4077e40 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 _0xa908=['path','rimraf','./attachment.attributes','exports','define','Attachment','attachments','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x1713e9,_0x4fce7c){var _0x430f3b=function(_0x158235){while(--_0x158235){_0x1713e9['push'](_0x1713e9['shift']());}};_0x430f3b(++_0x4fce7c);}(_0xa908,0x1c3));var _0x8a90=function(_0x11bef7,_0x35cfa2){_0x11bef7=_0x11bef7-0x0;var _0x516854=_0xa908[_0x11bef7];return _0x516854;};'use strict';var _=require(_0x8a90('0x0'));var util=require('util');var logger=require(_0x8a90('0x1'))('api');var moment=require(_0x8a90('0x2'));var BPromise=require(_0x8a90('0x3'));var rp=require(_0x8a90('0x4'));var fs=require('fs');var path=require(_0x8a90('0x5'));var rimraf=require(_0x8a90('0x6'));var config=require('../../config/environment');var attributes=require(_0x8a90('0x7'));module[_0x8a90('0x8')]=function(_0x5e41b9,_0x1c516f){return _0x5e41b9[_0x8a90('0x9')](_0x8a90('0xa'),attributes,{'tableName':_0x8a90('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x980c=['./attachment.attributes','define','Attachment','attachments','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2195f9,_0xcba4a){var _0x114bba=function(_0x731704){while(--_0x731704){_0x2195f9['push'](_0x2195f9['shift']());}};_0x114bba(++_0xcba4a);}(_0x980c,0x100));var _0xc980=function(_0x13bb96,_0xdf19ea){_0x13bb96=_0x13bb96-0x0;var _0x29839f=_0x980c[_0x13bb96];return _0x29839f;};'use strict';var _=require(_0xc980('0x0'));var util=require(_0xc980('0x1'));var logger=require(_0xc980('0x2'))(_0xc980('0x3'));var moment=require(_0xc980('0x4'));var BPromise=require(_0xc980('0x5'));var rp=require(_0xc980('0x6'));var fs=require('fs');var path=require(_0xc980('0x7'));var rimraf=require(_0xc980('0x8'));var config=require(_0xc980('0x9'));var attributes=require(_0xc980('0xa'));module['exports']=function(_0x472ece,_0x311a54){return _0x472ece[_0xc980('0xb')](_0xc980('0xc'),attributes,{'tableName':_0xc980('0xd'),'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 b1509ac..a2e1b57 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 _0xe69f=['debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateAttachment','Attachment','create','body','options','raw'];(function(_0x3f3f40,_0x4c71f4){var _0x403b7a=function(_0x509014){while(--_0x509014){_0x3f3f40['push'](_0x3f3f40['shift']());}};_0x403b7a(++_0x4c71f4);}(_0xe69f,0x76));var _0xfe69=function(_0x488e77,_0x2921d9){_0x488e77=_0x488e77-0x0;var _0x45cd1b=_0xe69f[_0x488e77];return _0x45cd1b;};'use strict';var _=require(_0xfe69('0x0'));var util=require(_0xfe69('0x1'));var moment=require(_0xfe69('0x2'));var BPromise=require(_0xfe69('0x3'));var rs=require(_0xfe69('0x4'));var fs=require('fs');var Redis=require(_0xfe69('0x5'));var db=require(_0xfe69('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfe69('0x7'));var config=require(_0xfe69('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xfe69('0x9')][_0xfe69('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x431af3,_0x29bb10,_0x5f2aae){return new BPromise(function(_0x4282a3,_0x240b12){return client[_0xfe69('0xb')](_0x431af3,_0x5f2aae)['then'](function(_0x3a6134){logger[_0xfe69('0xc')](_0xfe69('0xd'),_0x29bb10,_0xfe69('0xe'));logger['debug'](_0xfe69('0xf'),_0x29bb10,_0xfe69('0xe'),JSON[_0xfe69('0x10')](_0x3a6134));if(_0x3a6134[_0xfe69('0x11')]){if(_0x3a6134[_0xfe69('0x11')][_0xfe69('0x12')]===0x1f4){logger[_0xfe69('0x11')](_0xfe69('0xd'),_0x29bb10,_0x3a6134[_0xfe69('0x11')]['message']);return _0x240b12(_0x3a6134[_0xfe69('0x11')][_0xfe69('0x13')]);}logger['error']('Attachment,\x20%s,\x20%s',_0x29bb10,_0x3a6134[_0xfe69('0x11')][_0xfe69('0x13')]);return _0x4282a3(_0x3a6134[_0xfe69('0x11')][_0xfe69('0x13')]);}else{logger[_0xfe69('0xc')]('Attachment,\x20%s,\x20%s',_0x29bb10,_0xfe69('0xe'));_0x4282a3(_0x3a6134[_0xfe69('0x14')][_0xfe69('0x13')]);}})['catch'](function(_0x1cefbd){logger[_0xfe69('0x11')](_0xfe69('0xd'),_0x29bb10,_0x1cefbd);_0x240b12(_0x1cefbd);});});}exports[_0xfe69('0x15')]=function(_0x53191e){var _0x304af7=this;return new Promise(function(_0x5af060,_0x4c593d){return db[_0xfe69('0x16')][_0xfe69('0x17')](_0x53191e[_0xfe69('0x18')],{'raw':_0x53191e[_0xfe69('0x19')]?_0x53191e[_0xfe69('0x19')][_0xfe69('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x24239b){logger[_0xfe69('0xc')](_0xfe69('0x15'),_0x53191e);logger[_0xfe69('0x1b')](_0xfe69('0x15'),_0x53191e,JSON[_0xfe69('0x10')](_0x24239b));_0x5af060(_0x24239b);})[_0xfe69('0x1c')](function(_0xba8eb0){logger[_0xfe69('0x11')](_0xfe69('0x15'),_0xba8eb0[_0xfe69('0x13')],_0x53191e);_0x4c593d(_0x304af7[_0xfe69('0x11')](0x1f4,_0xba8eb0[_0xfe69('0x13')]));});});}; \ No newline at end of file +var _0x2e18=['options','CreateAttachment','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','Attachment','create'];(function(_0x4c6cf0,_0x826f70){var _0x108145=function(_0x299f69){while(--_0x299f69){_0x4c6cf0['push'](_0x4c6cf0['shift']());}};_0x108145(++_0x826f70);}(_0x2e18,0x197));var _0x82e1=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x2e18[_0x19950b];return _0x3c6b41;};'use strict';var _=require('lodash');var util=require(_0x82e1('0x0'));var moment=require(_0x82e1('0x1'));var BPromise=require('bluebird');var rs=require(_0x82e1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x82e1('0x3'))['db'];var utils=require(_0x82e1('0x4'));var logger=require(_0x82e1('0x5'))(_0x82e1('0x6'));var config=require(_0x82e1('0x7'));var jayson=require(_0x82e1('0x8'));var client=jayson[_0x82e1('0x9')][_0x82e1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x17f6a3,_0xa24899,_0x310c02){return new BPromise(function(_0x377e86,_0x163cc3){return client[_0x82e1('0xb')](_0x17f6a3,_0x310c02)[_0x82e1('0xc')](function(_0x589dc3){logger[_0x82e1('0xd')](_0x82e1('0xe'),_0xa24899,_0x82e1('0xf'));logger[_0x82e1('0x10')](_0x82e1('0x11'),_0xa24899,_0x82e1('0xf'),JSON['stringify'](_0x589dc3));if(_0x589dc3[_0x82e1('0x12')]){if(_0x589dc3['error'][_0x82e1('0x13')]===0x1f4){logger[_0x82e1('0x12')](_0x82e1('0xe'),_0xa24899,_0x589dc3['error']['message']);return _0x163cc3(_0x589dc3[_0x82e1('0x12')]['message']);}logger['error'](_0x82e1('0xe'),_0xa24899,_0x589dc3[_0x82e1('0x12')][_0x82e1('0x14')]);return _0x377e86(_0x589dc3[_0x82e1('0x12')][_0x82e1('0x14')]);}else{logger['info'](_0x82e1('0xe'),_0xa24899,'request\x20sent');_0x377e86(_0x589dc3[_0x82e1('0x15')][_0x82e1('0x14')]);}})[_0x82e1('0x16')](function(_0x7fc99c){logger['error'](_0x82e1('0xe'),_0xa24899,_0x7fc99c);_0x163cc3(_0x7fc99c);});});}exports['CreateAttachment']=function(_0x591b8f){var _0xe16639=this;return new Promise(function(_0x1ad9fe,_0x438d91){return db[_0x82e1('0x17')][_0x82e1('0x18')](_0x591b8f['body'],{'raw':_0x591b8f[_0x82e1('0x19')]?_0x591b8f[_0x82e1('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x82e1('0xc')](function(_0x150b50){logger[_0x82e1('0xd')](_0x82e1('0x1a'),_0x591b8f);logger[_0x82e1('0x10')](_0x82e1('0x1a'),_0x591b8f,JSON['stringify'](_0x150b50));_0x1ad9fe(_0x150b50);})[_0x82e1('0x16')](function(_0x5e97bd){logger[_0x82e1('0x12')](_0x82e1('0x1a'),_0x5e97bd[_0x82e1('0x14')],_0x591b8f);_0x438d91(_0xe16639[_0x82e1('0x12')](0x1f4,_0x5e97bd[_0x82e1('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 88a01b1..56bce58 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 _0x5523=['exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','download','clone','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','post','single','file','create','/:id','update','delete','destroy'];(function(_0x3da832,_0x2133f1){var _0xe602f2=function(_0xb7b2f){while(--_0xb7b2f){_0x3da832['push'](_0x3da832['shift']());}};_0xe602f2(++_0x2133f1);}(_0x5523,0x137));var _0x3552=function(_0xabae28,_0x544bfa){_0xabae28=_0xabae28-0x0;var _0x4a7f8c=_0x5523[_0xabae28];return _0x4a7f8c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3552('0x0'));var timeout=require(_0x3552('0x1'));var express=require(_0x3552('0x2'));var router=express[_0x3552('0x3')]();var auth=require(_0x3552('0x4'));var interaction=require(_0x3552('0x5'));var config=require(_0x3552('0x6'));var controller=require(_0x3552('0x7'));router[_0x3552('0x8')]('/',auth[_0x3552('0x9')](),controller[_0x3552('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x3552('0xb')]);router['get'](_0x3552('0xc'),auth[_0x3552('0x9')](),controller[_0x3552('0xd')]);router['post']('/:id/clone',auth[_0x3552('0x9')](),controller[_0x3552('0xe')]);var upload=multer({'storage':multer[_0x3552('0xf')]({'destination':function(_0x6c32e5,_0x2cc8dc,_0x1b06c8){_0x1b06c8(null,path[_0x3552('0x10')](config[_0x3552('0x11')],_0x3552('0x12')));},'filename':function(_0x8fc5be,_0xae728b,_0x549df0){_0x549df0(null,util[_0x3552('0x13')](_0x3552('0x14'),Date[_0x3552('0x15')](),_0xae728b['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x3552('0x16')]('/',upload[_0x3552('0x17')](_0x3552('0x18')),controller[_0x3552('0x19')]);router['put'](_0x3552('0x1a'),auth[_0x3552('0x9')](),controller[_0x3552('0x1b')]);router[_0x3552('0x1c')]('/:id',auth[_0x3552('0x9')](),controller[_0x3552('0x1d')]);module[_0x3552('0x1e')]=router; \ No newline at end of file +var _0x326b=['express','Router','../../components/interaction/service','./attachment.controller','isAuthenticated','get','/:id','show','download','post','/:id/clone','clone','diskStorage','root','server/files/attachments/','format','%s-%s','now','originalname','replace','single','file','create','put','update','exports','multer','util','path','connect-timeout'];(function(_0x3e6d5d,_0x264c7a){var _0x238923=function(_0x201b19){while(--_0x201b19){_0x3e6d5d['push'](_0x3e6d5d['shift']());}};_0x238923(++_0x264c7a);}(_0x326b,0x1dc));var _0xb326=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0x326b[_0x1573ea];return _0x51c0e2;};'use strict';var multer=require(_0xb326('0x0'));var util=require(_0xb326('0x1'));var path=require(_0xb326('0x2'));var timeout=require(_0xb326('0x3'));var express=require(_0xb326('0x4'));var router=express[_0xb326('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xb326('0x6'));var config=require('../../config/environment');var controller=require(_0xb326('0x7'));router['get']('/',auth[_0xb326('0x8')](),controller['index']);router[_0xb326('0x9')](_0xb326('0xa'),auth[_0xb326('0x8')](),controller[_0xb326('0xb')]);router[_0xb326('0x9')]('/:id/download',auth['isAuthenticated'](),controller[_0xb326('0xc')]);router[_0xb326('0xd')](_0xb326('0xe'),auth[_0xb326('0x8')](),controller[_0xb326('0xf')]);var upload=multer({'storage':multer[_0xb326('0x10')]({'destination':function(_0x29263b,_0x1417d6,_0x2cd751){_0x2cd751(null,path['join'](config[_0xb326('0x11')],_0xb326('0x12')));},'filename':function(_0x42f131,_0xc98b7,_0x595910){_0x595910(null,util[_0xb326('0x13')](_0xb326('0x14'),Date[_0xb326('0x15')](),_0xc98b7[_0xb326('0x16')][_0xb326('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xb326('0xd')]('/',upload[_0xb326('0x18')](_0xb326('0x19')),controller[_0xb326('0x1a')]);router[_0xb326('0x1b')](_0xb326('0xa'),auth[_0xb326('0x8')](),controller[_0xb326('0x1c')]);router['delete'](_0xb326('0xa'),auth[_0xb326('0x8')](),controller['destroy']);module[_0xb326('0x1d')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index b05b47e..782e763 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 _0x6615=['google','/login','email','use','clientID','clientSecret','secret','findOne','blockDuration','then','User','find','map','value','admin','agent','disabled','blocked','blockedAt','add','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','getLicense','catch','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../components/auth/service','../../config/utils','login','authenticate'];(function(_0x59c1be,_0xba160a){var _0x47c031=function(_0xb62b0b){while(--_0xb62b0b){_0x59c1be['push'](_0x59c1be['shift']());}};_0x47c031(++_0xba160a);}(_0x6615,0x1c5));var _0x5661=function(_0x1b54f5,_0x83ee6a){_0x1b54f5=_0x1b54f5-0x0;var _0x3b9975=_0x6615[_0x1b54f5];return _0x3b9975;};'use strict';var _=require('lodash');var passport=require(_0x5661('0x0'));var GoogleStrategy=require(_0x5661('0x1'))[_0x5661('0x2')];var moment=require(_0x5661('0x3'));var db=require(_0x5661('0x4'))['db'];var config=require('../../config/environment');var signToken=require(_0x5661('0x5'))['signToken'];var utils=require(_0x5661('0x6'));exports[_0x5661('0x7')]=passport[_0x5661('0x8')](_0x5661('0x9'),{'failureRedirect':_0x5661('0xa'),'scope':['profile',_0x5661('0xb')],'session':![]});exports['callback']=passport[_0x5661('0x8')]('google',{'failureRedirect':_0x5661('0xa'),'session':![]});passport[_0x5661('0xc')](new GoogleStrategy({'clientID':config['google']?config['google'][_0x5661('0xd')]:'id','clientSecret':config['google']?config['google'][_0x5661('0xe')]:_0x5661('0xf'),'callbackURL':config[_0x5661('0x9')]?config[_0x5661('0x9')]['callbackURL']:''},function(_0x4674dd,_0x41c932,_0x477e91,_0x38434){var _0xdd5a94,_0x363843;return db['Setting'][_0x5661('0x10')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x5661('0x11')],'raw':!![]})[_0x5661('0x12')](function(_0x3b23c7){_0xdd5a94=_0x3b23c7;return db[_0x5661('0x13')][_0x5661('0x14')]({'where':{'email':_[_0x5661('0x15')](_0x477e91['emails'],_0x5661('0x16')),'role':{'$or':[_0x5661('0x17'),'user',_0x5661('0x18')]}}});})[_0x5661('0x12')](function(_0x16b37d){_0x363843=_0x16b37d;if(_0x363843){if(_0x363843[_0x5661('0x19')]){return _0x38434('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0xdd5a94['blockDuration']>0x0){if(_0x363843[_0x5661('0x1a')]){if(moment(_0x363843[_0x5661('0x1b')])[_0x5661('0x1c')](_0xdd5a94['blockDuration'],'minutes')>moment()){return _0x38434(_0x5661('0x1d'));}else{return utils[_0x5661('0x1e')](_0x363843,0x0,![],null)[_0x5661('0x12')](function(){return utils[_0x5661('0x1f')](_0x363843);})[_0x5661('0x12')](function(){return _0x38434(null,_0x363843);});}}else{return utils[_0x5661('0x1f')](_0x363843)[_0x5661('0x12')](function(){return _0x38434(null,_0x363843);});}}else{return utils['getLicense'](_0x363843)['then'](function(){return _0x38434(null,_0x363843);});}}return _0x38434('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0x5661('0x20')](function(_0x5abb97){_0x38434(_0x5abb97);});})); \ No newline at end of file +var _0x6a6a=['passport-google-oauth20','Strategy','moment','../../mysqldb','../../components/auth/service','signToken','../../config/utils','authenticate','/login','profile','email','callback','google','use','clientID','secret','callbackURL','Setting','findOne','blockDuration','User','map','emails','value','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','getLicense','catch','lodash','passport'];(function(_0x251c5a,_0x173cbe){var _0x1cb570=function(_0x3d234b){while(--_0x3d234b){_0x251c5a['push'](_0x251c5a['shift']());}};_0x1cb570(++_0x173cbe);}(_0x6a6a,0x82));var _0xa6a6=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6a6a[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xa6a6('0x0'));var passport=require(_0xa6a6('0x1'));var GoogleStrategy=require(_0xa6a6('0x2'))[_0xa6a6('0x3')];var moment=require(_0xa6a6('0x4'));var db=require(_0xa6a6('0x5'))['db'];var config=require('../../config/environment');var signToken=require(_0xa6a6('0x6'))[_0xa6a6('0x7')];var utils=require(_0xa6a6('0x8'));exports['login']=passport[_0xa6a6('0x9')]('google',{'failureRedirect':_0xa6a6('0xa'),'scope':[_0xa6a6('0xb'),_0xa6a6('0xc')],'session':![]});exports[_0xa6a6('0xd')]=passport[_0xa6a6('0x9')](_0xa6a6('0xe'),{'failureRedirect':_0xa6a6('0xa'),'session':![]});passport[_0xa6a6('0xf')](new GoogleStrategy({'clientID':config[_0xa6a6('0xe')]?config[_0xa6a6('0xe')][_0xa6a6('0x10')]:'id','clientSecret':config[_0xa6a6('0xe')]?config[_0xa6a6('0xe')]['clientSecret']:_0xa6a6('0x11'),'callbackURL':config['google']?config[_0xa6a6('0xe')][_0xa6a6('0x12')]:''},function(_0x58cd7b,_0x4c193c,_0x35e8ae,_0x125ba5){var _0x23120b,_0x296007;return db[_0xa6a6('0x13')][_0xa6a6('0x14')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xa6a6('0x15')],'raw':!![]})['then'](function(_0x6dd76e){_0x23120b=_0x6dd76e;return db[_0xa6a6('0x16')]['find']({'where':{'email':_[_0xa6a6('0x17')](_0x35e8ae[_0xa6a6('0x18')],_0xa6a6('0x19')),'role':{'$or':['admin',_0xa6a6('0x1a'),_0xa6a6('0x1b')]}}});})[_0xa6a6('0x1c')](function(_0x1dacc6){_0x296007=_0x1dacc6;if(_0x296007){if(_0x296007['disabled']){return _0x125ba5(_0xa6a6('0x1d'));}else if(_0x23120b[_0xa6a6('0x15')]>0x0){if(_0x296007[_0xa6a6('0x1e')]){if(moment(_0x296007['blockedAt'])['add'](_0x23120b[_0xa6a6('0x15')],'minutes')>moment()){return _0x125ba5(_0xa6a6('0x1d'));}else{return utils['clearBlockUser'](_0x296007,0x0,![],null)[_0xa6a6('0x1c')](function(){return utils['getLicense'](_0x296007);})[_0xa6a6('0x1c')](function(){return _0x125ba5(null,_0x296007);});}}else{return utils[_0xa6a6('0x1f')](_0x296007)[_0xa6a6('0x1c')](function(){return _0x125ba5(null,_0x296007);});}}else{return utils[_0xa6a6('0x1f')](_0x296007)[_0xa6a6('0x1c')](function(){return _0x125ba5(null,_0x296007);});}}return _0x125ba5('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0xa6a6('0x20')](function(_0x4e5c7d){_0x125ba5(_0x4e5c7d);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index d409c4c..bbc6c83 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 _0x9b9b=['login','/callback','callback','isMiddleware','setTokenCookie','exports','passport','../user/user.controller.js','../../components/auth/service','get'];(function(_0x34cfa7,_0x1ddcce){var _0x4ed241=function(_0x582bb6){while(--_0x582bb6){_0x34cfa7['push'](_0x34cfa7['shift']());}};_0x4ed241(++_0x1ddcce);}(_0x9b9b,0x114));var _0xb9b9=function(_0x18a81a,_0x4fc65b){_0x18a81a=_0x18a81a-0x0;var _0x114027=_0x9b9b[_0x18a81a];return _0x114027;};'use strict';var express=require('express');var passport=require(_0xb9b9('0x0'));var router=express['Router']();var controller=require('./authGoogle.controller');var userController=require(_0xb9b9('0x1'));var authService=require(_0xb9b9('0x2'));router[_0xb9b9('0x3')]('/',controller[_0xb9b9('0x4')]);router[_0xb9b9('0x3')](_0xb9b9('0x5'),controller[_0xb9b9('0x6')],authService[_0xb9b9('0x7')],userController[_0xb9b9('0x4')],authService[_0xb9b9('0x8')]);module[_0xb9b9('0x9')]=router; \ No newline at end of file +var _0xf0cc=['./authGoogle.controller','get','login','callback','isMiddleware','exports','express'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0xf0cc,0xa7));var _0xcf0c=function(_0x4fc3e9,_0x348788){_0x4fc3e9=_0x4fc3e9-0x0;var _0x5bb77b=_0xf0cc[_0x4fc3e9];return _0x5bb77b;};'use strict';var express=require(_0xcf0c('0x0'));var passport=require('passport');var router=express['Router']();var controller=require(_0xcf0c('0x1'));var userController=require('../user/user.controller.js');var authService=require('../../components/auth/service');router[_0xcf0c('0x2')]('/',controller[_0xcf0c('0x3')]);router['get']('/callback',controller[_0xcf0c('0x4')],authService[_0xcf0c('0x5')],userController[_0xcf0c('0x3')],authService['setTokenCookie']);module[_0xcf0c('0x6')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 297f11b..6c2dd29 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 _0x5b9c=['port','secure','authentication','auth','user','merge','format','\x22%s\x22\x20<%s>','email','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','status','send','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','signToken','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','save','Password\x20reset!','use','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','name','password','role','disabled','blockedAt','loginAttempts','admin','agent','then','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','add','clearBlockUser','blocked','minutes','getLicense','catch','MailAccount','find','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host'];(function(_0xc0c6a5,_0x27dcc7){var _0x49fa86=function(_0x2529a0){while(--_0x2529a0){_0xc0c6a5['push'](_0xc0c6a5['shift']());}};_0x49fa86(++_0x27dcc7);}(_0x5b9c,0x152));var _0xc5b9=function(_0x294d4f,_0x1179a4){_0x294d4f=_0x294d4f-0x0;var _0x469dde=_0x5b9c[_0x294d4f];return _0x469dde;};'use strict';var util=require('util');var passport=require('passport');var LocalStrategy=require(_0xc5b9('0x0'))[_0xc5b9('0x1')];var jayson=require(_0xc5b9('0x2'));var _=require(_0xc5b9('0x3'));var rs=require(_0xc5b9('0x4'));var moment=require(_0xc5b9('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0xc5b9('0x6'));var utils=require(_0xc5b9('0x7'));var client=jayson[_0xc5b9('0x8')][_0xc5b9('0x9')]({'port':0x232b});function localAuthenticate(_0x27b28,_0x3bd4d0,_0x3871e8,_0x16c969){var _0x3ad71e,_0x50dbec;return db[_0xc5b9('0xa')][_0xc5b9('0xb')]({'where':{'id':0x1},'attributes':[_0xc5b9('0xc'),'blockDuration'],'raw':!![]})['then'](function(_0x1ffdef){_0x3ad71e=_0x1ffdef;return _0x27b28[_0xc5b9('0xb')]({'attributes':['id',_0xc5b9('0xd'),_0xc5b9('0xe'),'salt',_0xc5b9('0xf'),_0xc5b9('0x10'),'blocked',_0xc5b9('0x11'),_0xc5b9('0x12')],'where':{'name':_0x3bd4d0,'role':{'$or':[_0xc5b9('0x13'),'user',_0xc5b9('0x14')]}}});})[_0xc5b9('0x15')](function(_0x550145){if(!_0x550145||_0x550145&&_0x550145['name']!==_0x3bd4d0){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x50dbec=_0x550145;return _0x50dbec;}})[_0xc5b9('0x15')](function(){_0x50dbec[_0xc5b9('0x16')](_0x3871e8,function(_0x3b1ac5,_0x351cbd){var _0x2f2e7c=_0x50dbec[_0xc5b9('0x12')]+0x1;if(_0x3b1ac5){return _0x16c969(_0x3b1ac5);}else if(!_0x351cbd){if(_0x50dbec[_0xc5b9('0x10')]){return _0x16c969(null,![],{'message':_0xc5b9('0x17')});}else if(_0x3ad71e[_0xc5b9('0xc')]>0x0){if(_0x50dbec['blocked']){if(_0x3ad71e[_0xc5b9('0x18')]>0x0){if(moment(_0x50dbec[_0xc5b9('0x11')])[_0xc5b9('0x19')](_0x3ad71e['blockDuration'],'minutes')>moment()){return _0x16c969(null,![],{'message':_0xc5b9('0x17')});}else{return utils[_0xc5b9('0x1a')](_0x50dbec,_0x2f2e7c,![],null)[_0xc5b9('0x15')](function(){return _0x16c969(null,![],{'message':_0xc5b9('0x17')});});}}else{return _0x16c969(null,![],{'message':_0xc5b9('0x17')});}}else{if(_0x2f2e7c>=_0x3ad71e[_0xc5b9('0xc')]){return utils[_0xc5b9('0x1a')](_0x50dbec,0x0,!![],moment())[_0xc5b9('0x15')](function(){return _0x16c969(null,![],{'message':_0xc5b9('0x17')});});}else{return utils[_0xc5b9('0x1a')](_0x50dbec,_0x2f2e7c,![],null)[_0xc5b9('0x15')](function(){return _0x16c969(null,![],{'message':_0xc5b9('0x17')});});}}}else{return _0x16c969(null,![],{'message':_0xc5b9('0x17')});}}else{if(_0x50dbec[_0xc5b9('0x10')]){return _0x16c969(null,![],{'message':_0xc5b9('0x17')});}else if(_0x3ad71e[_0xc5b9('0xc')]>0x0){if(_0x50dbec[_0xc5b9('0x1b')]){if(_0x3ad71e['blockDuration']>0x0){if(moment(_0x50dbec['blockedAt'])['add'](_0x3ad71e[_0xc5b9('0x18')],_0xc5b9('0x1c'))>moment()){return _0x16c969(null,![],{'message':_0xc5b9('0x17')});}else{return utils['clearBlockUser'](_0x50dbec,0x0,![],null)[_0xc5b9('0x15')](function(){return utils[_0xc5b9('0x1d')](_0x50dbec);})['then'](function(){return _0x16c969(null,_0x50dbec);});}}else{return _0x16c969(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0xc5b9('0x1a')](_0x50dbec,0x0,![],null)['then'](function(){return utils[_0xc5b9('0x1d')](_0x50dbec);})[_0xc5b9('0x15')](function(){return _0x16c969(null,_0x50dbec);})['catch'](function(_0x579e5c){return _0x16c969(null,![],_0x579e5c);});}}else{if(_0x50dbec['blocked']){return _0x16c969(null,![],{'message':_0xc5b9('0x17')});}else{return utils[_0xc5b9('0x1d')](_0x50dbec)[_0xc5b9('0x15')](function(){return _0x16c969(null,_0x50dbec);});}}}});})[_0xc5b9('0x1e')](function(_0x4c0d8f){return _0x16c969(null,![],_0x4c0d8f);});}function sendServiceMail(_0x35f412){return db[_0xc5b9('0x1f')][_0xc5b9('0x20')]({'where':{'service':!![]},'attributes':['id','name','email'],'include':[{'model':db['MailServerOut'],'as':_0xc5b9('0x21')}]})[_0xc5b9('0x15')](function(_0x21cd0c){if(!_0x21cd0c){throw new Error(_0xc5b9('0x22'));}var _0x1b5cde={'tls':{'rejectUnauthorized':![]}};if(_0x21cd0c[_0xc5b9('0x21')][_0xc5b9('0x23')]){_0x1b5cde[_0xc5b9('0x23')]=_0x21cd0c[_0xc5b9('0x21')][_0xc5b9('0x23')];}else{_0x1b5cde[_0xc5b9('0x24')]=_0x21cd0c['Smtp'][_0xc5b9('0x24')];_0x1b5cde[_0xc5b9('0x25')]=_0x21cd0c[_0xc5b9('0x21')][_0xc5b9('0x25')];_0x1b5cde[_0xc5b9('0x26')]=_0x21cd0c['Smtp']['secure'];}if(_0x21cd0c[_0xc5b9('0x21')][_0xc5b9('0x27')]){_0x1b5cde[_0xc5b9('0x28')]={'user':_0x21cd0c[_0xc5b9('0x21')][_0xc5b9('0x29')],'pass':_0x21cd0c[_0xc5b9('0x21')]['pass']};}var _0x235204={'account':_0x1b5cde,'message':_[_0xc5b9('0x2a')]({'from':util[_0xc5b9('0x2b')](_0xc5b9('0x2c'),_0x21cd0c['name'],_0x21cd0c[_0xc5b9('0x2d')]||_0x21cd0c[_0xc5b9('0x21')]['user'])},_0x35f412)};return client['request']('SendMail',_0x235204);})['then'](function(_0x50ab79){if(_0x50ab79[_0xc5b9('0x2e')]){throw new Error(util['format'](_0xc5b9('0x2f'),_0x50ab79[_0xc5b9('0x2e')][_0xc5b9('0x30')]||JSON['stringify'](_0x50ab79[_0xc5b9('0x2e')])));}return!![];});}function handleError(_0x245ff9,_0x277c84,_0x35c5e6){return _0x245ff9[_0xc5b9('0x31')](_0x277c84||0x1f4)[_0xc5b9('0x32')]({'message':_0x35c5e6?_0x35c5e6[_0xc5b9('0x30')]||_0x35c5e6:''});}function checkPasswordPattern(_0x434691,_0x2114ac,_0x16630b){if(_0x16630b){var _0x2f51cf=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2f51cf['test'](_0x2114ac)){return _0x434691;}else{throw new Error(_0xc5b9('0x33'));}}else{return _0x434691;}}exports['login']=function(_0x54e3a5,_0x519b63,_0x1b3bd8){passport[_0xc5b9('0x16')]('local',function(_0x3a4fe7,_0x381827,_0x44f9fb){var _0xd4c44e=_0x3a4fe7||_0x44f9fb;if(_0xd4c44e){return handleError(_0x519b63,0x191,_0xd4c44e);}if(!_0x381827){return handleError(_0x519b63,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x5a06d4={'payload':{'id':_0x381827['id'],'role':_0x381827['role']},'options':{'expiresIn':0x15180}};return authService[_0xc5b9('0x34')](_0x5a06d4)['then'](function(_0x1ce633){_0x519b63['json']({'id':_0x381827['id'],'token':_0x1ce633,'statusCall':'','isAlreadyLogged':_0x381827['online']});});}})(_0x54e3a5,_0x519b63,_0x1b3bd8);};exports[_0xc5b9('0x35')]=function(_0x2b262b,_0x244ddf,_0x14b00d){if(!_0x2b262b[_0xc5b9('0x36')][_0xc5b9('0x2d')]){return handleError(_0x244ddf,0x1f4,{'message':_0xc5b9('0x37')});}var _0x568877=rs[_0xc5b9('0x38')]();_0x2b262b['body'][_0xc5b9('0x2d')]=_0x2b262b[_0xc5b9('0x36')][_0xc5b9('0x2d')][_0xc5b9('0x39')]()['toLowerCase']();var _0x5920cf;return db[_0xc5b9('0xa')][_0xc5b9('0xb')]({'where':{'id':0x1},'attributes':[_0xc5b9('0xc'),_0xc5b9('0x18')],'raw':!![]})[_0xc5b9('0x15')](function(_0x5066f1){_0x5920cf=_0x5066f1;return db[_0xc5b9('0x3a')][_0xc5b9('0x20')]({'where':{'email':_0x2b262b['body']['email']}});})[_0xc5b9('0x15')](function(_0x36ec27){if(!_0x36ec27){throw new Error(_0xc5b9('0x3b'));}if(_0x36ec27[_0xc5b9('0x10')]){throw new Error(_0xc5b9('0x3c'));}if(_0x36ec27[_0xc5b9('0x1b')]){if(moment(_0x36ec27[_0xc5b9('0x11')])[_0xc5b9('0x19')](_0x5920cf['blockDuration'],'minutes')>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x36ec27[_0xc5b9('0x1b')]=![];_0x36ec27['blockedAt']=null;}}_0x36ec27[_0xc5b9('0x3d')]=_0x568877;_0x36ec27[_0xc5b9('0x3e')]=Date[_0xc5b9('0x3f')]()+0x36ee80;return _0x36ec27['save']();})[_0xc5b9('0x15')](function(){return sendServiceMail({'to':_0x2b262b['body'][_0xc5b9('0x2d')],'subject':_0xc5b9('0x40'),'text':_0xc5b9('0x41')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+'http://'+_0x2b262b[_0xc5b9('0x42')][_0xc5b9('0x24')]+'/reset/'+_0x568877+'\x0a\x0a'+_0xc5b9('0x43')});})[_0xc5b9('0x15')](function(){_0x244ddf['status'](0xc8)['send']({'message':'Reset\x20Email\x20sent!'});})['catch'](function(_0x1b515e){return handleError(_0x244ddf,0x1f4,_0x1b515e);});};exports[_0xc5b9('0x44')]=function(_0x4f22bb,_0x45cf6e,_0x5c39eb){var _0x50b16b;return db[_0xc5b9('0x3a')]['find']({'where':{'resetPasswordToken':_0x4f22bb[_0xc5b9('0x45')]['token'],'resetPasswordExpires':{'$gt':Date[_0xc5b9('0x3f')]()}}})[_0xc5b9('0x15')](function(_0x541813){_0x50b16b=_0x541813;if(!_0x50b16b){throw new Error(_0xc5b9('0x46'));}return db[_0xc5b9('0xa')][_0xc5b9('0xb')]({'attributes':['id',_0xc5b9('0x47')]});})[_0xc5b9('0x15')](function(_0xb31da9){return checkPasswordPattern(_0xb31da9,_0x4f22bb[_0xc5b9('0x36')]['password'],_0xb31da9[_0xc5b9('0x47')]);})[_0xc5b9('0x15')](function(){_0x50b16b[_0xc5b9('0xe')]=_0x4f22bb[_0xc5b9('0x36')]['password'];_0x50b16b[_0xc5b9('0x3d')]=null;_0x50b16b[_0xc5b9('0x3e')]=null;return _0x50b16b[_0xc5b9('0x48')]();})['then'](function(){_0x45cf6e['status'](0xc8)[_0xc5b9('0x32')]({'message':_0xc5b9('0x49')});})[_0xc5b9('0x1e')](function(_0x4d8aac){return handleError(_0x45cf6e,0x1f4,_0x4d8aac);});};passport[_0xc5b9('0x4a')](new LocalStrategy({'usernameField':_0xc5b9('0xd'),'passwordField':_0xc5b9('0xe')},function(_0x5ef7a9,_0x3e641b,_0x3293cc){return localAuthenticate(db[_0xc5b9('0x3a')],_0x5ef7a9,_0x3e641b,_0x3293cc);})); \ No newline at end of file +var _0x23f5=['password','salt','disabled','blocked','blockedAt','loginAttempts','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','allowedLoginAttempts','blockDuration','clearBlockUser','add','minutes','getLicense','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','pass','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','message','stringify','status','send','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','forgot','body','generate','trim','toLowerCase','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','http://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','resetPasswordExpires','Password\x20reset!','util','passport-local','jayson/promise','lodash','moment','../../config/utils','findOne','then','name'];(function(_0x11ddf5,_0x2ae965){var _0x28878b=function(_0x445854){while(--_0x445854){_0x11ddf5['push'](_0x11ddf5['shift']());}};_0x28878b(++_0x2ae965);}(_0x23f5,0x95));var _0x523f=function(_0x2df4cc,_0x1233c6){_0x2df4cc=_0x2df4cc-0x0;var _0x40af8d=_0x23f5[_0x2df4cc];return _0x40af8d;};'use strict';var util=require(_0x523f('0x0'));var passport=require('passport');var LocalStrategy=require(_0x523f('0x1'))['Strategy'];var jayson=require(_0x523f('0x2'));var _=require(_0x523f('0x3'));var rs=require('randomstring');var moment=require(_0x523f('0x4'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require(_0x523f('0x5'));var client=jayson['client']['http']({'port':0x232b});function localAuthenticate(_0x5b10e7,_0x23c775,_0x255b5c,_0x3e5785){var _0x5de91c,_0x4104bc;return db['Setting'][_0x523f('0x6')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0x523f('0x7')](function(_0x3ce24c){_0x5de91c=_0x3ce24c;return _0x5b10e7[_0x523f('0x6')]({'attributes':['id',_0x523f('0x8'),_0x523f('0x9'),_0x523f('0xa'),'role',_0x523f('0xb'),_0x523f('0xc'),_0x523f('0xd'),_0x523f('0xe')],'where':{'name':_0x23c775,'role':{'$or':['admin',_0x523f('0xf'),_0x523f('0x10')]}}});})[_0x523f('0x7')](function(_0x1a375d){if(!_0x1a375d||_0x1a375d&&_0x1a375d[_0x523f('0x8')]!==_0x23c775){throw new Error(_0x523f('0x11'));}else{_0x4104bc=_0x1a375d;return _0x4104bc;}})[_0x523f('0x7')](function(){_0x4104bc[_0x523f('0x12')](_0x255b5c,function(_0x5d19de,_0x264a66){var _0x3de6fe=_0x4104bc[_0x523f('0xe')]+0x1;if(_0x5d19de){return _0x3e5785(_0x5d19de);}else if(!_0x264a66){if(_0x4104bc[_0x523f('0xb')]){return _0x3e5785(null,![],{'message':_0x523f('0x11')});}else if(_0x5de91c[_0x523f('0x13')]>0x0){if(_0x4104bc[_0x523f('0xc')]){if(_0x5de91c['blockDuration']>0x0){if(moment(_0x4104bc[_0x523f('0xd')])['add'](_0x5de91c[_0x523f('0x14')],'minutes')>moment()){return _0x3e5785(null,![],{'message':_0x523f('0x11')});}else{return utils[_0x523f('0x15')](_0x4104bc,_0x3de6fe,![],null)[_0x523f('0x7')](function(){return _0x3e5785(null,![],{'message':_0x523f('0x11')});});}}else{return _0x3e5785(null,![],{'message':_0x523f('0x11')});}}else{if(_0x3de6fe>=_0x5de91c['allowedLoginAttempts']){return utils[_0x523f('0x15')](_0x4104bc,0x0,!![],moment())['then'](function(){return _0x3e5785(null,![],{'message':_0x523f('0x11')});});}else{return utils[_0x523f('0x15')](_0x4104bc,_0x3de6fe,![],null)[_0x523f('0x7')](function(){return _0x3e5785(null,![],{'message':_0x523f('0x11')});});}}}else{return _0x3e5785(null,![],{'message':_0x523f('0x11')});}}else{if(_0x4104bc[_0x523f('0xb')]){return _0x3e5785(null,![],{'message':_0x523f('0x11')});}else if(_0x5de91c['allowedLoginAttempts']>0x0){if(_0x4104bc['blocked']){if(_0x5de91c['blockDuration']>0x0){if(moment(_0x4104bc['blockedAt'])[_0x523f('0x16')](_0x5de91c[_0x523f('0x14')],_0x523f('0x17'))>moment()){return _0x3e5785(null,![],{'message':_0x523f('0x11')});}else{return utils[_0x523f('0x15')](_0x4104bc,0x0,![],null)[_0x523f('0x7')](function(){return utils['getLicense'](_0x4104bc);})[_0x523f('0x7')](function(){return _0x3e5785(null,_0x4104bc);});}}else{return _0x3e5785(null,![],{'message':_0x523f('0x11')});}}else{return utils[_0x523f('0x15')](_0x4104bc,0x0,![],null)['then'](function(){return utils['getLicense'](_0x4104bc);})[_0x523f('0x7')](function(){return _0x3e5785(null,_0x4104bc);})['catch'](function(_0x3bcbee){return _0x3e5785(null,![],_0x3bcbee);});}}else{if(_0x4104bc[_0x523f('0xc')]){return _0x3e5785(null,![],{'message':_0x523f('0x11')});}else{return utils[_0x523f('0x18')](_0x4104bc)['then'](function(){return _0x3e5785(null,_0x4104bc);});}}}});})['catch'](function(_0x4c1136){return _0x3e5785(null,![],_0x4c1136);});}function sendServiceMail(_0xe08ca){return db['MailAccount'][_0x523f('0x19')]({'where':{'service':!![]},'attributes':['id',_0x523f('0x8'),_0x523f('0x1a')],'include':[{'model':db[_0x523f('0x1b')],'as':_0x523f('0x1c')}]})['then'](function(_0x2408c9){if(!_0x2408c9){throw new Error(_0x523f('0x1d'));}var _0x46c40c={'tls':{'rejectUnauthorized':![]}};if(_0x2408c9[_0x523f('0x1c')]['service']){_0x46c40c[_0x523f('0x1e')]=_0x2408c9[_0x523f('0x1c')]['service'];}else{_0x46c40c[_0x523f('0x1f')]=_0x2408c9[_0x523f('0x1c')][_0x523f('0x1f')];_0x46c40c['port']=_0x2408c9[_0x523f('0x1c')][_0x523f('0x20')];_0x46c40c[_0x523f('0x21')]=_0x2408c9['Smtp']['secure'];}if(_0x2408c9[_0x523f('0x1c')][_0x523f('0x22')]){_0x46c40c[_0x523f('0x23')]={'user':_0x2408c9[_0x523f('0x1c')][_0x523f('0xf')],'pass':_0x2408c9['Smtp'][_0x523f('0x24')]};}var _0x212984={'account':_0x46c40c,'message':_[_0x523f('0x25')]({'from':util[_0x523f('0x26')](_0x523f('0x27'),_0x2408c9['name'],_0x2408c9[_0x523f('0x1a')]||_0x2408c9[_0x523f('0x1c')][_0x523f('0xf')])},_0xe08ca)};return client[_0x523f('0x28')](_0x523f('0x29'),_0x212984);})['then'](function(_0x436538){if(_0x436538[_0x523f('0x2a')]){throw new Error(util[_0x523f('0x26')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x436538['error'][_0x523f('0x2b')]||JSON[_0x523f('0x2c')](_0x436538[_0x523f('0x2a')])));}return!![];});}function handleError(_0x128526,_0x42fc4b,_0x7d51bf){return _0x128526[_0x523f('0x2d')](_0x42fc4b||0x1f4)[_0x523f('0x2e')]({'message':_0x7d51bf?_0x7d51bf['message']||_0x7d51bf:''});}function checkPasswordPattern(_0x2b2935,_0x4db650,_0x46efe3){if(_0x46efe3){var _0x58246c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x58246c[_0x523f('0x2f')](_0x4db650)){return _0x2b2935;}else{throw new Error(_0x523f('0x30'));}}else{return _0x2b2935;}}exports['login']=function(_0x58b207,_0x14e704,_0x4c49ac){passport[_0x523f('0x12')](_0x523f('0x31'),function(_0x113986,_0x5fba17,_0x236339){var _0x4ecc92=_0x113986||_0x236339;if(_0x4ecc92){return handleError(_0x14e704,0x191,_0x4ecc92);}if(!_0x5fba17){return handleError(_0x14e704,0x194,{'message':_0x523f('0x32')});}else{var _0x21ec66={'payload':{'id':_0x5fba17['id'],'role':_0x5fba17[_0x523f('0x33')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x21ec66)[_0x523f('0x7')](function(_0x35c6fd){_0x14e704['json']({'id':_0x5fba17['id'],'token':_0x35c6fd,'statusCall':'','isAlreadyLogged':_0x5fba17['online']});});}})(_0x58b207,_0x14e704,_0x4c49ac);};exports[_0x523f('0x34')]=function(_0x2b8e13,_0x334012,_0x1c8c62){if(!_0x2b8e13[_0x523f('0x35')][_0x523f('0x1a')]){return handleError(_0x334012,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x3950e5=rs[_0x523f('0x36')]();_0x2b8e13[_0x523f('0x35')][_0x523f('0x1a')]=_0x2b8e13[_0x523f('0x35')]['email'][_0x523f('0x37')]()[_0x523f('0x38')]();var _0x30e6f0;return db[_0x523f('0x39')][_0x523f('0x6')]({'where':{'id':0x1},'attributes':[_0x523f('0x13'),_0x523f('0x14')],'raw':!![]})[_0x523f('0x7')](function(_0x5e87f6){_0x30e6f0=_0x5e87f6;return db[_0x523f('0x3a')]['find']({'where':{'email':_0x2b8e13[_0x523f('0x35')]['email']}});})[_0x523f('0x7')](function(_0x33d28b){if(!_0x33d28b){throw new Error(_0x523f('0x3b'));}if(_0x33d28b[_0x523f('0xb')]){throw new Error(_0x523f('0x3c'));}if(_0x33d28b['blocked']){if(moment(_0x33d28b['blockedAt'])['add'](_0x30e6f0[_0x523f('0x14')],_0x523f('0x17'))>moment()){throw new Error(_0x523f('0x3d'));}else{_0x33d28b['blocked']=![];_0x33d28b[_0x523f('0xd')]=null;}}_0x33d28b[_0x523f('0x3e')]=_0x3950e5;_0x33d28b['resetPasswordExpires']=Date[_0x523f('0x3f')]()+0x36ee80;return _0x33d28b[_0x523f('0x40')]();})['then'](function(){return sendServiceMail({'to':_0x2b8e13['body'][_0x523f('0x1a')],'subject':_0x523f('0x41'),'text':_0x523f('0x42')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x523f('0x43')+_0x2b8e13[_0x523f('0x44')][_0x523f('0x1f')]+_0x523f('0x45')+_0x3950e5+'\x0a\x0a'+_0x523f('0x46')});})[_0x523f('0x7')](function(){_0x334012[_0x523f('0x2d')](0xc8)[_0x523f('0x2e')]({'message':_0x523f('0x47')});})['catch'](function(_0x197b3b){return handleError(_0x334012,0x1f4,_0x197b3b);});};exports[_0x523f('0x48')]=function(_0x3d17e7,_0x4cfc2b,_0x57c34c){var _0x337557;return db[_0x523f('0x3a')]['find']({'where':{'resetPasswordToken':_0x3d17e7[_0x523f('0x49')][_0x523f('0x4a')],'resetPasswordExpires':{'$gt':Date[_0x523f('0x3f')]()}}})['then'](function(_0x3cd3ec){_0x337557=_0x3cd3ec;if(!_0x337557){throw new Error(_0x523f('0x4b'));}return db[_0x523f('0x39')][_0x523f('0x6')]({'attributes':['id',_0x523f('0x4c')]});})['then'](function(_0x2d4e4c){return checkPasswordPattern(_0x2d4e4c,_0x3d17e7[_0x523f('0x35')][_0x523f('0x9')],_0x2d4e4c[_0x523f('0x4c')]);})[_0x523f('0x7')](function(){_0x337557[_0x523f('0x9')]=_0x3d17e7['body'][_0x523f('0x9')];_0x337557[_0x523f('0x3e')]=null;_0x337557[_0x523f('0x4d')]=null;return _0x337557[_0x523f('0x40')]();})[_0x523f('0x7')](function(){_0x4cfc2b[_0x523f('0x2d')](0xc8)['send']({'message':_0x523f('0x4e')});})['catch'](function(_0x20a588){return handleError(_0x4cfc2b,0x1f4,_0x20a588);});};passport['use'](new LocalStrategy({'usernameField':_0x523f('0x8'),'passwordField':'password'},function(_0x4d09c6,_0x11ddde,_0x279c25){return localAuthenticate(db[_0x523f('0x3a')],_0x4d09c6,_0x11ddde,_0x279c25);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 68e2d60..e7bc269 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 _0x27e8=['login','forgot','/reset/:token','reset','exports','express','Router','./authLocal.controller','post'];(function(_0x55e82f,_0x490743){var _0x3fd998=function(_0x276086){while(--_0x276086){_0x55e82f['push'](_0x55e82f['shift']());}};_0x3fd998(++_0x490743);}(_0x27e8,0x1d0));var _0x827e=function(_0x4deb33,_0x83efb5){_0x4deb33=_0x4deb33-0x0;var _0x119013=_0x27e8[_0x4deb33];return _0x119013;};'use strict';var express=require(_0x827e('0x0'));var router=express[_0x827e('0x1')]();var controller=require(_0x827e('0x2'));router[_0x827e('0x3')]('/',controller[_0x827e('0x4')]);router[_0x827e('0x3')]('/forgot',controller[_0x827e('0x5')]);router[_0x827e('0x3')](_0x827e('0x6'),controller[_0x827e('0x7')]);module[_0x827e('0x8')]=router; \ No newline at end of file +var _0xde59=['express','./authLocal.controller','post','login','/forgot','forgot','/reset/:token','reset'];(function(_0x18c337,_0x2d4225){var _0x240a2a=function(_0x1d83b9){while(--_0x1d83b9){_0x18c337['push'](_0x18c337['shift']());}};_0x240a2a(++_0x2d4225);}(_0xde59,0x1e8));var _0x9de5=function(_0x4d1030,_0x258626){_0x4d1030=_0x4d1030-0x0;var _0x4f3193=_0xde59[_0x4d1030];return _0x4f3193;};'use strict';var express=require(_0x9de5('0x0'));var router=express['Router']();var controller=require(_0x9de5('0x1'));router[_0x9de5('0x2')]('/',controller[_0x9de5('0x3')]);router[_0x9de5('0x2')](_0x9de5('0x4'),controller[_0x9de5('0x5')]);router[_0x9de5('0x2')](_0x9de5('0x6'),controller[_0x9de5('0x7')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 50e1c93..219cd95 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 _0x9dc3=['sequelize','exports','STRING','INTEGER'];(function(_0x588a36,_0x5ebb45){var _0x34765f=function(_0x5d3dd3){while(--_0x5d3dd3){_0x588a36['push'](_0x588a36['shift']());}};_0x34765f(++_0x5ebb45);}(_0x9dc3,0x138));var _0x39dc=function(_0x12d4d9,_0xf42840){_0x12d4d9=_0x12d4d9-0x0;var _0x288af2=_0x9dc3[_0x12d4d9];return _0x288af2;};'use strict';var Sequelize=require(_0x39dc('0x0'));module[_0x39dc('0x1')]={'name':{'type':Sequelize[_0x39dc('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x39dc('0x2')]},'description':{'type':Sequelize[_0x39dc('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x39dc('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0x6fd1=['BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0x3fda9e,_0x4b6370){var _0x3b3671=function(_0x3a710d){while(--_0x3a710d){_0x3fda9e['push'](_0x3fda9e['shift']());}};_0x3b3671(++_0x4b6370);}(_0x6fd1,0x1b0));var _0x16fd=function(_0x1b4912,_0x3e8bb9){_0x1b4912=_0x1b4912-0x0;var _0x48cac5=_0x6fd1[_0x1b4912];return _0x48cac5;};'use strict';var Sequelize=require(_0x16fd('0x0'));module[_0x16fd('0x1')]={'name':{'type':Sequelize[_0x16fd('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x16fd('0x2')]},'status':{'type':Sequelize[_0x16fd('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x16fd('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 93a2573..c8cd841 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 _0x187b=['zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','reject','save','update','then','destroy','error','name','index','map','Automation','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','where','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','find','create','body','addConditions','Condition','ids','omit','getConditions','findOne','nolimit','addActions','Action','getActions','html-pdf','eml-format','rimraf'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0x187b,0x141));var _0xb187=function(_0x46b192,_0x57f9f8){_0x46b192=_0x46b192-0x0;var _0x3109b3=_0x187b[_0x46b192];return _0x3109b3;};'use strict';var pdf=require(_0xb187('0x0'));var emlformat=require(_0xb187('0x1'));var rimraf=require(_0xb187('0x2'));var zipdir=require(_0xb187('0x3'));var jsonpatch=require(_0xb187('0x4'));var rp=require('request-promise');var moment=require(_0xb187('0x5'));var BPromise=require(_0xb187('0x6'));var Mustache=require(_0xb187('0x7'));var util=require('util');var path=require('path');var sox=require(_0xb187('0x8'));var csv=require(_0xb187('0x9'));var ejs=require(_0xb187('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb187('0xb'));var crypto=require(_0xb187('0xc'));var jsforce=require(_0xb187('0xd'));var deskjs=require(_0xb187('0xe'));var toCsv=require(_0xb187('0x9'));var querystring=require('querystring');var Papa=require(_0xb187('0xf'));var Redis=require(_0xb187('0x10'));var authService=require(_0xb187('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb187('0x12'));var hardwareService=require(_0xb187('0x13'));var logger=require(_0xb187('0x14'))(_0xb187('0x15'));var utils=require('../../config/utils');var config=require(_0xb187('0x16'));var db=require(_0xb187('0x17'))['db'];function respondWithStatusCode(_0x4c0312,_0x59c93c){_0x59c93c=_0x59c93c||0xcc;return function(_0x4e8ebf){if(_0x4e8ebf){return _0x4c0312[_0xb187('0x18')](_0x59c93c);}return _0x4c0312[_0xb187('0x19')](_0x59c93c)[_0xb187('0x1a')]();};}function respondWithResult(_0x47738e,_0x42a981){_0x42a981=_0x42a981||0xc8;return function(_0x8e9b05){if(_0x8e9b05){return _0x47738e['status'](_0x42a981)['json'](_0x8e9b05);}};}function respondWithFilteredResult(_0x2f9005,_0x3062d5){return function(_0x50ba8d){if(_0x50ba8d){var _0x44fbab=_0x50ba8d[_0xb187('0x1b')],_0x1a0c85=_0x3062d5[_0xb187('0x1c')],_0xbe6f85=_0x3062d5['offset']+_0x3062d5[_0xb187('0x1d')],_0x140838;if(_0xbe6f85>=_0x44fbab){_0xbe6f85=_0x44fbab;_0x140838=0xc8;}else{_0x140838=0xce;}_0x2f9005['status'](_0x140838);return _0x2f9005[_0xb187('0x1e')]('Content-Range',_0x1a0c85+'-'+_0xbe6f85+'/'+_0x44fbab)['json'](_0x50ba8d);}return null;};}function patchUpdates(_0x290a80){return function(_0x428005){try{jsonpatch['apply'](_0x428005,_0x290a80,!![]);}catch(_0x48897a){return BPromise[_0xb187('0x1f')](_0x48897a);}return _0x428005[_0xb187('0x20')]();};}function saveUpdates(_0xca3b90,_0x4a773f){return function(_0x26a412){if(_0x26a412){return _0x26a412[_0xb187('0x21')](_0xca3b90)[_0xb187('0x22')](function(_0x3234cd){return _0x3234cd;});}return null;};}function removeEntity(_0x1a9839,_0x287e46){return function(_0x2f5881){if(_0x2f5881){return _0x2f5881[_0xb187('0x23')]()[_0xb187('0x22')](function(){_0x1a9839[_0xb187('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f6ecc,_0x211606){return function(_0x4276fb){if(!_0x4276fb){_0x3f6ecc[_0xb187('0x18')](0x194);}return _0x4276fb;};}function handleError(_0x3ee54f,_0x3b0f29){_0x3b0f29=_0x3b0f29||0x1f4;return function(_0x41af92){logger[_0xb187('0x24')](_0x41af92['stack']);if(_0x41af92['name']){delete _0x41af92[_0xb187('0x25')];}_0x3ee54f[_0xb187('0x19')](_0x3b0f29)['send'](_0x41af92);};}exports[_0xb187('0x26')]=function(_0x480192,_0x3e6a21){var _0x51274b={},_0x9e4058={},_0x2f04c2={'count':0x0,'rows':[]};var _0x2ac94a=_[_0xb187('0x27')](db[_0xb187('0x28')][_0xb187('0x29')],function(_0x4f47ce){return{'name':_0x4f47ce[_0xb187('0x2a')],'type':_0x4f47ce['type'][_0xb187('0x2b')]};});_0x9e4058[_0xb187('0x2c')]=_[_0xb187('0x27')](_0x2ac94a,_0xb187('0x25'));_0x9e4058[_0xb187('0x2d')]=_[_0xb187('0x2e')](_0x480192['query']);_0x9e4058[_0xb187('0x2f')]=_[_0xb187('0x30')](_0x9e4058['model'],_0x9e4058[_0xb187('0x2d')]);_0x51274b[_0xb187('0x31')]=_[_0xb187('0x30')](_0x9e4058[_0xb187('0x2c')],qs[_0xb187('0x32')](_0x480192['query']['fields']));_0x51274b[_0xb187('0x31')]=_0x51274b[_0xb187('0x31')][_0xb187('0x33')]?_0x51274b['attributes']:_0x9e4058[_0xb187('0x2c')];if(!_0x480192[_0xb187('0x2d')][_0xb187('0x34')]('nolimit')){_0x51274b[_0xb187('0x1d')]=qs[_0xb187('0x1d')](_0x480192[_0xb187('0x2d')][_0xb187('0x1d')]);_0x51274b[_0xb187('0x1c')]=qs[_0xb187('0x1c')](_0x480192['query'][_0xb187('0x1c')]);}_0x51274b[_0xb187('0x35')]=qs[_0xb187('0x36')](_0x480192[_0xb187('0x2d')][_0xb187('0x36')]);_0x51274b['where']=qs['filters'](_[_0xb187('0x37')](_0x480192[_0xb187('0x2d')],_0x9e4058['filters']));if(_0x480192['query']['filter']){_0x51274b[_0xb187('0x38')]=_[_0xb187('0x39')](_0x51274b[_0xb187('0x38')],{'$or':_['map'](_0x2ac94a,function(_0x172182){if(_0x172182[_0xb187('0x3a')]!==_0xb187('0x3b')){var _0x516981={};_0x516981[_0x172182[_0xb187('0x25')]]={'$like':'%'+_0x480192['query'][_0xb187('0x3c')]+'%'};return _0x516981;}})});}_0x51274b=_['merge']({},_0x51274b,_0x480192[_0xb187('0x3d')]);var _0xd10443={'where':_0x51274b[_0xb187('0x38')]};return db[_0xb187('0x28')][_0xb187('0x1b')](_0xd10443)[_0xb187('0x22')](function(_0x10877f){_0x2f04c2[_0xb187('0x1b')]=_0x10877f;if(_0x480192[_0xb187('0x2d')][_0xb187('0x3e')]){_0x51274b[_0xb187('0x3f')]=[{'all':!![]}];}return db['Automation'][_0xb187('0x40')](_0x51274b);})['then'](function(_0x1b2e6d){_0x2f04c2[_0xb187('0x41')]=_0x1b2e6d;return _0x2f04c2;})['then'](respondWithFilteredResult(_0x3e6a21,_0x51274b))[_0xb187('0x42')](handleError(_0x3e6a21,null));};exports['show']=function(_0x304425,_0x12568f){var _0x586b0f={'raw':![],'where':{'id':_0x304425[_0xb187('0x43')]['id']}},_0x541146={};_0x541146[_0xb187('0x2c')]=_[_0xb187('0x2e')](db['Automation'][_0xb187('0x29')]);_0x541146[_0xb187('0x2d')]=_['keys'](_0x304425[_0xb187('0x2d')]);_0x541146[_0xb187('0x2f')]=_[_0xb187('0x30')](_0x541146['model'],_0x541146[_0xb187('0x2d')]);_0x586b0f[_0xb187('0x31')]=_[_0xb187('0x30')](_0x541146[_0xb187('0x2c')],qs[_0xb187('0x32')](_0x304425[_0xb187('0x2d')][_0xb187('0x32')]));_0x586b0f['attributes']=_0x586b0f[_0xb187('0x31')]['length']?_0x586b0f[_0xb187('0x31')]:_0x541146['model'];if(_0x304425[_0xb187('0x2d')][_0xb187('0x3e')]){_0x586b0f['include']=[{'all':!![]}];}_0x586b0f=_[_0xb187('0x39')]({},_0x586b0f,_0x304425[_0xb187('0x3d')]);return db['Automation'][_0xb187('0x44')](_0x586b0f)[_0xb187('0x22')](handleEntityNotFound(_0x12568f,null))[_0xb187('0x22')](respondWithResult(_0x12568f,null))[_0xb187('0x42')](handleError(_0x12568f,null));};exports[_0xb187('0x45')]=function(_0x165d68,_0x5a077b){return db['Automation'][_0xb187('0x45')](_0x165d68['body'],{})['then'](respondWithResult(_0x5a077b,0xc9))[_0xb187('0x42')](handleError(_0x5a077b,null));};exports[_0xb187('0x21')]=function(_0x34809d,_0x49e577){if(_0x34809d[_0xb187('0x46')]['id']){delete _0x34809d['body']['id'];}return db[_0xb187('0x28')]['find']({'where':{'id':_0x34809d[_0xb187('0x43')]['id']}})[_0xb187('0x22')](handleEntityNotFound(_0x49e577,null))[_0xb187('0x22')](saveUpdates(_0x34809d['body'],null))['then'](respondWithResult(_0x49e577,null))[_0xb187('0x42')](handleError(_0x49e577,null));};exports['destroy']=function(_0x4875a6,_0x35d2d3){return db[_0xb187('0x28')]['find']({'where':{'id':_0x4875a6[_0xb187('0x43')]['id']}})[_0xb187('0x22')](handleEntityNotFound(_0x35d2d3,null))[_0xb187('0x22')](removeEntity(_0x35d2d3,null))[_0xb187('0x42')](handleError(_0x35d2d3,null));};exports[_0xb187('0x47')]=function(_0x32498d,_0x5d7ca5,_0x3c7fb0){return db[_0xb187('0x48')][_0xb187('0x44')]({'where':{'id':_0x32498d[_0xb187('0x43')]['id']}})['then'](handleEntityNotFound(_0x5d7ca5,null))[_0xb187('0x22')](function(_0x22d4a2){if(_0x22d4a2){return _0x22d4a2[_0xb187('0x47')](_0x32498d['body'][_0xb187('0x49')],_[_0xb187('0x4a')](_0x32498d[_0xb187('0x46')],['ids','id'])||{});}})['then'](respondWithResult(_0x5d7ca5,null))[_0xb187('0x42')](handleError(_0x5d7ca5,null));};exports[_0xb187('0x4b')]=function(_0x525f07,_0x555188,_0x2deb0f){var _0x383f38={};var _0x1bac93={};var _0x72ed36;var _0x26c8b0;return db[_0xb187('0x28')][_0xb187('0x4c')]({'where':{'id':_0x525f07[_0xb187('0x43')]['id']}})[_0xb187('0x22')](handleEntityNotFound(_0x555188,null))[_0xb187('0x22')](function(_0x1fe10f){if(_0x1fe10f){_0x72ed36=_0x1fe10f;_0x1bac93[_0xb187('0x2c')]=_[_0xb187('0x2e')](db[_0xb187('0x48')][_0xb187('0x29')]);_0x1bac93[_0xb187('0x2d')]=_[_0xb187('0x2e')](_0x525f07[_0xb187('0x2d')]);_0x1bac93[_0xb187('0x2f')]=_['intersection'](_0x1bac93[_0xb187('0x2c')],_0x1bac93[_0xb187('0x2d')]);_0x383f38[_0xb187('0x31')]=_[_0xb187('0x30')](_0x1bac93[_0xb187('0x2c')],qs[_0xb187('0x32')](_0x525f07[_0xb187('0x2d')][_0xb187('0x32')]));_0x383f38[_0xb187('0x31')]=_0x383f38[_0xb187('0x31')][_0xb187('0x33')]?_0x383f38[_0xb187('0x31')]:_0x1bac93[_0xb187('0x2c')];_0x383f38['order']=qs[_0xb187('0x36')](_0x525f07['query']['sort']);_0x383f38[_0xb187('0x38')]=qs[_0xb187('0x2f')](_[_0xb187('0x37')](_0x525f07[_0xb187('0x2d')],_0x1bac93[_0xb187('0x2f')]));if(_0x525f07['query'][_0xb187('0x3c')]){_0x383f38[_0xb187('0x38')]=_[_0xb187('0x39')](_0x383f38[_0xb187('0x38')],{'$or':_['map'](_0x383f38[_0xb187('0x31')],function(_0x3407f8){var _0x5008ca={};_0x5008ca[_0x3407f8]={'$like':'%'+_0x525f07[_0xb187('0x2d')]['filter']+'%'};return _0x5008ca;})});}_0x383f38=_[_0xb187('0x39')]({},_0x383f38,_0x525f07['options']);return _0x72ed36[_0xb187('0x4b')](_0x383f38);}})[_0xb187('0x22')](function(_0x4a6509){if(_0x4a6509){_0x26c8b0=_0x4a6509['length'];if(!_0x525f07[_0xb187('0x2d')][_0xb187('0x34')](_0xb187('0x4d'))){_0x383f38[_0xb187('0x1d')]=qs[_0xb187('0x1d')](_0x525f07[_0xb187('0x2d')][_0xb187('0x1d')]);_0x383f38[_0xb187('0x1c')]=qs[_0xb187('0x1c')](_0x525f07[_0xb187('0x2d')]['offset']);}return _0x72ed36[_0xb187('0x4b')](_0x383f38);}})[_0xb187('0x22')](function(_0x2d9a61){if(_0x2d9a61){return _0x2d9a61?{'count':_0x26c8b0,'rows':_0x2d9a61}:null;}})[_0xb187('0x22')](respondWithResult(_0x555188,null))[_0xb187('0x42')](handleError(_0x555188,null));};exports[_0xb187('0x4e')]=function(_0x12a550,_0x2c0dbd,_0x25f275){return db[_0xb187('0x4f')]['find']({'where':{'id':_0x12a550[_0xb187('0x43')]['id']}})['then'](handleEntityNotFound(_0x2c0dbd,null))[_0xb187('0x22')](function(_0x56d437){if(_0x56d437){return _0x56d437[_0xb187('0x4e')](_0x12a550[_0xb187('0x46')][_0xb187('0x49')],_[_0xb187('0x4a')](_0x12a550[_0xb187('0x46')],[_0xb187('0x49'),'id'])||{});}})['then'](respondWithResult(_0x2c0dbd,null))[_0xb187('0x42')](handleError(_0x2c0dbd,null));};exports[_0xb187('0x50')]=function(_0x4919b2,_0x8a9825,_0x32306e){var _0x5566c7={};var _0x2f5cb8={};var _0x5c3a9f;var _0x2e5ebb;return db[_0xb187('0x28')]['findOne']({'where':{'id':_0x4919b2[_0xb187('0x43')]['id']}})[_0xb187('0x22')](handleEntityNotFound(_0x8a9825,null))[_0xb187('0x22')](function(_0x2de968){if(_0x2de968){_0x5c3a9f=_0x2de968;_0x2f5cb8['model']=_[_0xb187('0x2e')](db[_0xb187('0x4f')][_0xb187('0x29')]);_0x2f5cb8[_0xb187('0x2d')]=_[_0xb187('0x2e')](_0x4919b2[_0xb187('0x2d')]);_0x2f5cb8[_0xb187('0x2f')]=_['intersection'](_0x2f5cb8[_0xb187('0x2c')],_0x2f5cb8[_0xb187('0x2d')]);_0x5566c7['attributes']=_[_0xb187('0x30')](_0x2f5cb8[_0xb187('0x2c')],qs[_0xb187('0x32')](_0x4919b2[_0xb187('0x2d')][_0xb187('0x32')]));_0x5566c7[_0xb187('0x31')]=_0x5566c7['attributes']['length']?_0x5566c7['attributes']:_0x2f5cb8[_0xb187('0x2c')];_0x5566c7[_0xb187('0x35')]=qs['sort'](_0x4919b2['query'][_0xb187('0x36')]);_0x5566c7[_0xb187('0x38')]=qs[_0xb187('0x2f')](_[_0xb187('0x37')](_0x4919b2[_0xb187('0x2d')],_0x2f5cb8[_0xb187('0x2f')]));if(_0x4919b2['query']['filter']){_0x5566c7[_0xb187('0x38')]=_['merge'](_0x5566c7[_0xb187('0x38')],{'$or':_[_0xb187('0x27')](_0x5566c7[_0xb187('0x31')],function(_0x344c6b){var _0x4611f7={};_0x4611f7[_0x344c6b]={'$like':'%'+_0x4919b2[_0xb187('0x2d')][_0xb187('0x3c')]+'%'};return _0x4611f7;})});}_0x5566c7=_[_0xb187('0x39')]({},_0x5566c7,_0x4919b2['options']);return _0x5c3a9f[_0xb187('0x50')](_0x5566c7);}})[_0xb187('0x22')](function(_0x5c4b59){if(_0x5c4b59){_0x2e5ebb=_0x5c4b59[_0xb187('0x33')];if(!_0x4919b2[_0xb187('0x2d')][_0xb187('0x34')](_0xb187('0x4d'))){_0x5566c7[_0xb187('0x1d')]=qs[_0xb187('0x1d')](_0x4919b2[_0xb187('0x2d')]['limit']);_0x5566c7[_0xb187('0x1c')]=qs[_0xb187('0x1c')](_0x4919b2[_0xb187('0x2d')]['offset']);}return _0x5c3a9f['getActions'](_0x5566c7);}})[_0xb187('0x22')](function(_0x20d832){if(_0x20d832){return _0x20d832?{'count':_0x2e5ebb,'rows':_0x20d832}:null;}})['then'](respondWithResult(_0x8a9825,null))[_0xb187('0x42')](handleError(_0x8a9825,null));}; \ No newline at end of file +var _0x25c5=['show','params','length','options','find','create','body','addConditions','Condition','ids','omit','findOne','getConditions','addActions','Action','getActions','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','Automation','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','rows','catch'];(function(_0x3afdef,_0x228da5){var _0x33111a=function(_0x493bd5){while(--_0x493bd5){_0x3afdef['push'](_0x3afdef['shift']());}};_0x33111a(++_0x228da5);}(_0x25c5,0x154));var _0x525c=function(_0x3efe87,_0x35ad48){_0x3efe87=_0x3efe87-0x0;var _0x56a4cc=_0x25c5[_0x3efe87];return _0x56a4cc;};'use strict';var pdf=require(_0x525c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x525c('0x1'));var zipdir=require(_0x525c('0x2'));var jsonpatch=require(_0x525c('0x3'));var rp=require(_0x525c('0x4'));var moment=require('moment');var BPromise=require(_0x525c('0x5'));var Mustache=require(_0x525c('0x6'));var util=require(_0x525c('0x7'));var path=require('path');var sox=require(_0x525c('0x8'));var csv=require(_0x525c('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x525c('0xa'));var squel=require(_0x525c('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x525c('0xc'));var toCsv=require(_0x525c('0x9'));var querystring=require(_0x525c('0xd'));var Papa=require(_0x525c('0xe'));var Redis=require('ioredis');var authService=require(_0x525c('0xf'));var qs=require(_0x525c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x525c('0x11'))(_0x525c('0x12'));var utils=require('../../config/utils');var config=require(_0x525c('0x13'));var db=require(_0x525c('0x14'))['db'];function respondWithStatusCode(_0x4eb08e,_0x2c87b2){_0x2c87b2=_0x2c87b2||0xcc;return function(_0x1e81b3){if(_0x1e81b3){return _0x4eb08e[_0x525c('0x15')](_0x2c87b2);}return _0x4eb08e[_0x525c('0x16')](_0x2c87b2)[_0x525c('0x17')]();};}function respondWithResult(_0x1d8f15,_0x1ade57){_0x1ade57=_0x1ade57||0xc8;return function(_0x294f6d){if(_0x294f6d){return _0x1d8f15[_0x525c('0x16')](_0x1ade57)[_0x525c('0x18')](_0x294f6d);}};}function respondWithFilteredResult(_0xfa7fe,_0x6ae758){return function(_0xa13dce){if(_0xa13dce){var _0xc1c30d=_0xa13dce[_0x525c('0x19')],_0x16e146=_0x6ae758['offset'],_0x533711=_0x6ae758[_0x525c('0x1a')]+_0x6ae758[_0x525c('0x1b')],_0x1a2613;if(_0x533711>=_0xc1c30d){_0x533711=_0xc1c30d;_0x1a2613=0xc8;}else{_0x1a2613=0xce;}_0xfa7fe[_0x525c('0x16')](_0x1a2613);return _0xfa7fe[_0x525c('0x1c')](_0x525c('0x1d'),_0x16e146+'-'+_0x533711+'/'+_0xc1c30d)[_0x525c('0x18')](_0xa13dce);}return null;};}function patchUpdates(_0xb6b5f6){return function(_0x271927){try{jsonpatch[_0x525c('0x1e')](_0x271927,_0xb6b5f6,!![]);}catch(_0x803421){return BPromise[_0x525c('0x1f')](_0x803421);}return _0x271927[_0x525c('0x20')]();};}function saveUpdates(_0x106c82,_0x63d05d){return function(_0x514cab){if(_0x514cab){return _0x514cab[_0x525c('0x21')](_0x106c82)[_0x525c('0x22')](function(_0x70821c){return _0x70821c;});}return null;};}function removeEntity(_0x450261,_0x19ee13){return function(_0x55be49){if(_0x55be49){return _0x55be49[_0x525c('0x23')]()[_0x525c('0x22')](function(){_0x450261[_0x525c('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a6e8c,_0x211d55){return function(_0x3a647b){if(!_0x3a647b){_0x1a6e8c['sendStatus'](0x194);}return _0x3a647b;};}function handleError(_0x24709c,_0x23eba1){_0x23eba1=_0x23eba1||0x1f4;return function(_0x3d57d0){logger[_0x525c('0x24')](_0x3d57d0['stack']);if(_0x3d57d0[_0x525c('0x25')]){delete _0x3d57d0[_0x525c('0x25')];}_0x24709c[_0x525c('0x16')](_0x23eba1)[_0x525c('0x26')](_0x3d57d0);};}exports[_0x525c('0x27')]=function(_0x3358f1,_0x167903){var _0x217880={},_0x2f7176={},_0x253db1={'count':0x0,'rows':[]};var _0x5b1aa5=_[_0x525c('0x28')](db[_0x525c('0x29')][_0x525c('0x2a')],function(_0x59be34){return{'name':_0x59be34[_0x525c('0x2b')],'type':_0x59be34[_0x525c('0x2c')][_0x525c('0x2d')]};});_0x2f7176[_0x525c('0x2e')]=_['map'](_0x5b1aa5,_0x525c('0x25'));_0x2f7176['query']=_[_0x525c('0x2f')](_0x3358f1[_0x525c('0x30')]);_0x2f7176[_0x525c('0x31')]=_['intersection'](_0x2f7176[_0x525c('0x2e')],_0x2f7176[_0x525c('0x30')]);_0x217880['attributes']=_[_0x525c('0x32')](_0x2f7176[_0x525c('0x2e')],qs[_0x525c('0x33')](_0x3358f1[_0x525c('0x30')][_0x525c('0x33')]));_0x217880[_0x525c('0x34')]=_0x217880[_0x525c('0x34')]['length']?_0x217880[_0x525c('0x34')]:_0x2f7176['model'];if(!_0x3358f1['query'][_0x525c('0x35')](_0x525c('0x36'))){_0x217880[_0x525c('0x1b')]=qs[_0x525c('0x1b')](_0x3358f1['query']['limit']);_0x217880[_0x525c('0x1a')]=qs[_0x525c('0x1a')](_0x3358f1['query']['offset']);}_0x217880[_0x525c('0x37')]=qs[_0x525c('0x38')](_0x3358f1[_0x525c('0x30')][_0x525c('0x38')]);_0x217880[_0x525c('0x39')]=qs['filters'](_[_0x525c('0x3a')](_0x3358f1[_0x525c('0x30')],_0x2f7176[_0x525c('0x31')]));if(_0x3358f1[_0x525c('0x30')][_0x525c('0x3b')]){_0x217880[_0x525c('0x39')]=_['merge'](_0x217880['where'],{'$or':_[_0x525c('0x28')](_0x5b1aa5,function(_0x467751){if(_0x467751[_0x525c('0x2c')]!=='VIRTUAL'){var _0x100c3f={};_0x100c3f[_0x467751['name']]={'$like':'%'+_0x3358f1[_0x525c('0x30')][_0x525c('0x3b')]+'%'};return _0x100c3f;}})});}_0x217880=_[_0x525c('0x3c')]({},_0x217880,_0x3358f1['options']);var _0x4b4896={'where':_0x217880[_0x525c('0x39')]};return db['Automation'][_0x525c('0x19')](_0x4b4896)[_0x525c('0x22')](function(_0x29ccb6){_0x253db1['count']=_0x29ccb6;if(_0x3358f1[_0x525c('0x30')][_0x525c('0x3d')]){_0x217880[_0x525c('0x3e')]=[{'all':!![]}];}return db[_0x525c('0x29')]['findAll'](_0x217880);})[_0x525c('0x22')](function(_0x794b7d){_0x253db1[_0x525c('0x3f')]=_0x794b7d;return _0x253db1;})[_0x525c('0x22')](respondWithFilteredResult(_0x167903,_0x217880))[_0x525c('0x40')](handleError(_0x167903,null));};exports[_0x525c('0x41')]=function(_0x17588d,_0x3dac77){var _0x4fd8fe={'raw':![],'where':{'id':_0x17588d[_0x525c('0x42')]['id']}},_0x8901fd={};_0x8901fd[_0x525c('0x2e')]=_['keys'](db[_0x525c('0x29')][_0x525c('0x2a')]);_0x8901fd[_0x525c('0x30')]=_['keys'](_0x17588d[_0x525c('0x30')]);_0x8901fd['filters']=_['intersection'](_0x8901fd[_0x525c('0x2e')],_0x8901fd[_0x525c('0x30')]);_0x4fd8fe[_0x525c('0x34')]=_['intersection'](_0x8901fd[_0x525c('0x2e')],qs[_0x525c('0x33')](_0x17588d['query'][_0x525c('0x33')]));_0x4fd8fe[_0x525c('0x34')]=_0x4fd8fe['attributes'][_0x525c('0x43')]?_0x4fd8fe[_0x525c('0x34')]:_0x8901fd[_0x525c('0x2e')];if(_0x17588d['query'][_0x525c('0x3d')]){_0x4fd8fe[_0x525c('0x3e')]=[{'all':!![]}];}_0x4fd8fe=_[_0x525c('0x3c')]({},_0x4fd8fe,_0x17588d[_0x525c('0x44')]);return db[_0x525c('0x29')][_0x525c('0x45')](_0x4fd8fe)[_0x525c('0x22')](handleEntityNotFound(_0x3dac77,null))[_0x525c('0x22')](respondWithResult(_0x3dac77,null))[_0x525c('0x40')](handleError(_0x3dac77,null));};exports[_0x525c('0x46')]=function(_0x1e59e2,_0x2d4b60){return db[_0x525c('0x29')][_0x525c('0x46')](_0x1e59e2[_0x525c('0x47')],{})[_0x525c('0x22')](respondWithResult(_0x2d4b60,0xc9))['catch'](handleError(_0x2d4b60,null));};exports[_0x525c('0x21')]=function(_0x32990f,_0x749ef4){if(_0x32990f[_0x525c('0x47')]['id']){delete _0x32990f[_0x525c('0x47')]['id'];}return db[_0x525c('0x29')]['find']({'where':{'id':_0x32990f[_0x525c('0x42')]['id']}})[_0x525c('0x22')](handleEntityNotFound(_0x749ef4,null))[_0x525c('0x22')](saveUpdates(_0x32990f[_0x525c('0x47')],null))[_0x525c('0x22')](respondWithResult(_0x749ef4,null))[_0x525c('0x40')](handleError(_0x749ef4,null));};exports[_0x525c('0x23')]=function(_0x4dd2b5,_0x59a146){return db['Automation'][_0x525c('0x45')]({'where':{'id':_0x4dd2b5[_0x525c('0x42')]['id']}})[_0x525c('0x22')](handleEntityNotFound(_0x59a146,null))[_0x525c('0x22')](removeEntity(_0x59a146,null))[_0x525c('0x40')](handleError(_0x59a146,null));};exports[_0x525c('0x48')]=function(_0x3a054d,_0x58bd85,_0x2039cd){return db[_0x525c('0x49')]['find']({'where':{'id':_0x3a054d[_0x525c('0x42')]['id']}})[_0x525c('0x22')](handleEntityNotFound(_0x58bd85,null))['then'](function(_0x38410a){if(_0x38410a){return _0x38410a[_0x525c('0x48')](_0x3a054d[_0x525c('0x47')][_0x525c('0x4a')],_[_0x525c('0x4b')](_0x3a054d['body'],['ids','id'])||{});}})[_0x525c('0x22')](respondWithResult(_0x58bd85,null))[_0x525c('0x40')](handleError(_0x58bd85,null));};exports['getConditions']=function(_0x1ea07a,_0x161bc6,_0x24248d){var _0x57d910={};var _0x5e1260={};var _0x49ec94;var _0x4e1f8d;return db[_0x525c('0x29')][_0x525c('0x4c')]({'where':{'id':_0x1ea07a['params']['id']}})[_0x525c('0x22')](handleEntityNotFound(_0x161bc6,null))[_0x525c('0x22')](function(_0x377efd){if(_0x377efd){_0x49ec94=_0x377efd;_0x5e1260[_0x525c('0x2e')]=_['keys'](db[_0x525c('0x49')][_0x525c('0x2a')]);_0x5e1260[_0x525c('0x30')]=_['keys'](_0x1ea07a[_0x525c('0x30')]);_0x5e1260['filters']=_[_0x525c('0x32')](_0x5e1260[_0x525c('0x2e')],_0x5e1260[_0x525c('0x30')]);_0x57d910[_0x525c('0x34')]=_[_0x525c('0x32')](_0x5e1260[_0x525c('0x2e')],qs[_0x525c('0x33')](_0x1ea07a['query'][_0x525c('0x33')]));_0x57d910[_0x525c('0x34')]=_0x57d910['attributes'][_0x525c('0x43')]?_0x57d910['attributes']:_0x5e1260[_0x525c('0x2e')];_0x57d910['order']=qs['sort'](_0x1ea07a[_0x525c('0x30')][_0x525c('0x38')]);_0x57d910[_0x525c('0x39')]=qs[_0x525c('0x31')](_['pick'](_0x1ea07a[_0x525c('0x30')],_0x5e1260[_0x525c('0x31')]));if(_0x1ea07a['query'][_0x525c('0x3b')]){_0x57d910[_0x525c('0x39')]=_[_0x525c('0x3c')](_0x57d910[_0x525c('0x39')],{'$or':_[_0x525c('0x28')](_0x57d910[_0x525c('0x34')],function(_0x4e4212){var _0x4497fb={};_0x4497fb[_0x4e4212]={'$like':'%'+_0x1ea07a[_0x525c('0x30')]['filter']+'%'};return _0x4497fb;})});}_0x57d910=_[_0x525c('0x3c')]({},_0x57d910,_0x1ea07a[_0x525c('0x44')]);return _0x49ec94[_0x525c('0x4d')](_0x57d910);}})[_0x525c('0x22')](function(_0x1916a6){if(_0x1916a6){_0x4e1f8d=_0x1916a6[_0x525c('0x43')];if(!_0x1ea07a[_0x525c('0x30')][_0x525c('0x35')](_0x525c('0x36'))){_0x57d910[_0x525c('0x1b')]=qs[_0x525c('0x1b')](_0x1ea07a['query'][_0x525c('0x1b')]);_0x57d910[_0x525c('0x1a')]=qs['offset'](_0x1ea07a[_0x525c('0x30')][_0x525c('0x1a')]);}return _0x49ec94[_0x525c('0x4d')](_0x57d910);}})[_0x525c('0x22')](function(_0x4280d6){if(_0x4280d6){return _0x4280d6?{'count':_0x4e1f8d,'rows':_0x4280d6}:null;}})[_0x525c('0x22')](respondWithResult(_0x161bc6,null))['catch'](handleError(_0x161bc6,null));};exports[_0x525c('0x4e')]=function(_0x171ab5,_0xf3084,_0x1cec6a){return db[_0x525c('0x4f')][_0x525c('0x45')]({'where':{'id':_0x171ab5[_0x525c('0x42')]['id']}})['then'](handleEntityNotFound(_0xf3084,null))[_0x525c('0x22')](function(_0x5f3ee4){if(_0x5f3ee4){return _0x5f3ee4[_0x525c('0x4e')](_0x171ab5[_0x525c('0x47')][_0x525c('0x4a')],_['omit'](_0x171ab5[_0x525c('0x47')],[_0x525c('0x4a'),'id'])||{});}})[_0x525c('0x22')](respondWithResult(_0xf3084,null))['catch'](handleError(_0xf3084,null));};exports[_0x525c('0x50')]=function(_0x2c0d54,_0x261f12,_0x5915dc){var _0xfff09e={};var _0x1543c6={};var _0x33be79;var _0x506442;return db[_0x525c('0x29')][_0x525c('0x4c')]({'where':{'id':_0x2c0d54[_0x525c('0x42')]['id']}})[_0x525c('0x22')](handleEntityNotFound(_0x261f12,null))['then'](function(_0x61e03c){if(_0x61e03c){_0x33be79=_0x61e03c;_0x1543c6[_0x525c('0x2e')]=_[_0x525c('0x2f')](db[_0x525c('0x4f')][_0x525c('0x2a')]);_0x1543c6[_0x525c('0x30')]=_['keys'](_0x2c0d54['query']);_0x1543c6['filters']=_[_0x525c('0x32')](_0x1543c6[_0x525c('0x2e')],_0x1543c6[_0x525c('0x30')]);_0xfff09e['attributes']=_['intersection'](_0x1543c6['model'],qs['fields'](_0x2c0d54[_0x525c('0x30')][_0x525c('0x33')]));_0xfff09e[_0x525c('0x34')]=_0xfff09e[_0x525c('0x34')][_0x525c('0x43')]?_0xfff09e[_0x525c('0x34')]:_0x1543c6[_0x525c('0x2e')];_0xfff09e[_0x525c('0x37')]=qs[_0x525c('0x38')](_0x2c0d54[_0x525c('0x30')]['sort']);_0xfff09e[_0x525c('0x39')]=qs[_0x525c('0x31')](_[_0x525c('0x3a')](_0x2c0d54[_0x525c('0x30')],_0x1543c6[_0x525c('0x31')]));if(_0x2c0d54['query'][_0x525c('0x3b')]){_0xfff09e[_0x525c('0x39')]=_[_0x525c('0x3c')](_0xfff09e['where'],{'$or':_[_0x525c('0x28')](_0xfff09e['attributes'],function(_0x642ac9){var _0x3c8de9={};_0x3c8de9[_0x642ac9]={'$like':'%'+_0x2c0d54['query']['filter']+'%'};return _0x3c8de9;})});}_0xfff09e=_[_0x525c('0x3c')]({},_0xfff09e,_0x2c0d54['options']);return _0x33be79[_0x525c('0x50')](_0xfff09e);}})[_0x525c('0x22')](function(_0x4913a6){if(_0x4913a6){_0x506442=_0x4913a6[_0x525c('0x43')];if(!_0x2c0d54[_0x525c('0x30')]['hasOwnProperty']('nolimit')){_0xfff09e[_0x525c('0x1b')]=qs['limit'](_0x2c0d54['query'][_0x525c('0x1b')]);_0xfff09e[_0x525c('0x1a')]=qs[_0x525c('0x1a')](_0x2c0d54[_0x525c('0x30')][_0x525c('0x1a')]);}return _0x33be79[_0x525c('0x50')](_0xfff09e);}})['then'](function(_0x43624e){if(_0x43624e){return _0x43624e?{'count':_0x506442,'rows':_0x43624e}:null;}})[_0x525c('0x22')](respondWithResult(_0x261f12,null))[_0x525c('0x40')](handleError(_0x261f12,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index ea3e664..97872e1 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 _0x657b=['util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./automation.attributes','define','Automation','tools_automations','lodash'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x657b,0x77));var _0xb657=function(_0x2a7c36,_0x5564fe){_0x2a7c36=_0x2a7c36-0x0;var _0x2e677e=_0x657b[_0x2a7c36];return _0x2e677e;};'use strict';var _=require(_0xb657('0x0'));var util=require(_0xb657('0x1'));var logger=require(_0xb657('0x2'))('api');var moment=require(_0xb657('0x3'));var BPromise=require(_0xb657('0x4'));var rp=require(_0xb657('0x5'));var fs=require('fs');var path=require(_0xb657('0x6'));var rimraf=require('rimraf');var config=require(_0xb657('0x7'));var attributes=require(_0xb657('0x8'));module['exports']=function(_0x2fc1f3,_0x4acd01){return _0x2fc1f3[_0xb657('0x9')](_0xb657('0xa'),attributes,{'tableName':_0xb657('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1a58=['bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','define','Automation','tools_automations','lodash','moment'];(function(_0x15b3a8,_0x2e2a43){var _0x2fb045=function(_0x25a70e){while(--_0x25a70e){_0x15b3a8['push'](_0x15b3a8['shift']());}};_0x2fb045(++_0x2e2a43);}(_0x1a58,0x1b6));var _0x81a5=function(_0x39a257,_0x225e7b){_0x39a257=_0x39a257-0x0;var _0x6b5e59=_0x1a58[_0x39a257];return _0x6b5e59;};'use strict';var _=require(_0x81a5('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x81a5('0x1'));var BPromise=require(_0x81a5('0x2'));var rp=require(_0x81a5('0x3'));var fs=require('fs');var path=require(_0x81a5('0x4'));var rimraf=require(_0x81a5('0x5'));var config=require(_0x81a5('0x6'));var attributes=require(_0x81a5('0x7'));module['exports']=function(_0xfdd234,_0x3ec333){return _0xfdd234[_0x81a5('0x8')](_0x81a5('0x9'),attributes,{'tableName':_0x81a5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index 065d79a..0a7a8d4 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 _0xa0cc=['Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x1fd1cf,_0x178f7a){var _0x3d6272=function(_0x5dbdb1){while(--_0x5dbdb1){_0x1fd1cf['push'](_0x1fd1cf['shift']());}};_0x3d6272(++_0x178f7a);}(_0xa0cc,0xa0));var _0xca0c=function(_0x5d9ced,_0x473407){_0x5d9ced=_0x5d9ced-0x0;var _0x2fa573=_0xa0cc[_0x5d9ced];return _0x2fa573;};'use strict';var _=require(_0xca0c('0x0'));var util=require('util');var moment=require(_0xca0c('0x1'));var BPromise=require(_0xca0c('0x2'));var rs=require(_0xca0c('0x3'));var fs=require('fs');var Redis=require(_0xca0c('0x4'));var db=require(_0xca0c('0x5'))['db'];var utils=require(_0xca0c('0x6'));var logger=require(_0xca0c('0x7'))('rpc');var config=require(_0xca0c('0x8'));var jayson=require(_0xca0c('0x9'));var client=jayson[_0xca0c('0xa')][_0xca0c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x31bda9,_0xf1d91c,_0x236d8a){return new BPromise(function(_0x1b46ca,_0x178879){return client[_0xca0c('0xc')](_0x31bda9,_0x236d8a)[_0xca0c('0xd')](function(_0x10cbfe){logger[_0xca0c('0xe')](_0xca0c('0xf'),_0xf1d91c,_0xca0c('0x10'));logger[_0xca0c('0x11')](_0xca0c('0x12'),_0xf1d91c,'request\x20sent',JSON[_0xca0c('0x13')](_0x10cbfe));if(_0x10cbfe['error']){if(_0x10cbfe[_0xca0c('0x14')][_0xca0c('0x15')]===0x1f4){logger[_0xca0c('0x14')](_0xca0c('0xf'),_0xf1d91c,_0x10cbfe[_0xca0c('0x14')][_0xca0c('0x16')]);return _0x178879(_0x10cbfe['error'][_0xca0c('0x16')]);}logger[_0xca0c('0x14')](_0xca0c('0xf'),_0xf1d91c,_0x10cbfe[_0xca0c('0x14')]['message']);return _0x1b46ca(_0x10cbfe[_0xca0c('0x14')][_0xca0c('0x16')]);}else{logger[_0xca0c('0xe')](_0xca0c('0xf'),_0xf1d91c,_0xca0c('0x10'));_0x1b46ca(_0x10cbfe[_0xca0c('0x17')][_0xca0c('0x16')]);}})[_0xca0c('0x18')](function(_0x49da8d){logger['error'](_0xca0c('0xf'),_0xf1d91c,_0x49da8d);_0x178879(_0x49da8d);});});} \ No newline at end of file +var _0x87fe=['request','then','info','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','Automation,\x20%s,\x20%s','message','result','catch','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x3a026b,_0x42af55){var _0x4a3dec=function(_0xcfea52){while(--_0xcfea52){_0x3a026b['push'](_0x3a026b['shift']());}};_0x4a3dec(++_0x42af55);}(_0x87fe,0x1ec));var _0xe87f=function(_0x4dc0c8,_0x48d51f){_0x4dc0c8=_0x4dc0c8-0x0;var _0x26bf81=_0x87fe[_0x4dc0c8];return _0x26bf81;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe87f('0x0'));var BPromise=require('bluebird');var rs=require(_0xe87f('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe87f('0x2'));var logger=require(_0xe87f('0x3'))('rpc');var config=require(_0xe87f('0x4'));var jayson=require(_0xe87f('0x5'));var client=jayson[_0xe87f('0x6')][_0xe87f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xcf6fa6,_0x383a16,_0x56f72b){return new BPromise(function(_0x28f2ae,_0x996784){return client[_0xe87f('0x8')](_0xcf6fa6,_0x56f72b)[_0xe87f('0x9')](function(_0x2f4da3){logger[_0xe87f('0xa')]('Automation,\x20%s,\x20%s',_0x383a16,_0xe87f('0xb'));logger['debug'](_0xe87f('0xc'),_0x383a16,_0xe87f('0xb'),JSON[_0xe87f('0xd')](_0x2f4da3));if(_0x2f4da3['error']){if(_0x2f4da3[_0xe87f('0xe')][_0xe87f('0xf')]===0x1f4){logger[_0xe87f('0xe')](_0xe87f('0x10'),_0x383a16,_0x2f4da3[_0xe87f('0xe')][_0xe87f('0x11')]);return _0x996784(_0x2f4da3[_0xe87f('0xe')][_0xe87f('0x11')]);}logger[_0xe87f('0xe')]('Automation,\x20%s,\x20%s',_0x383a16,_0x2f4da3[_0xe87f('0xe')]['message']);return _0x28f2ae(_0x2f4da3['error']['message']);}else{logger['info'](_0xe87f('0x10'),_0x383a16,'request\x20sent');_0x28f2ae(_0x2f4da3[_0xe87f('0x12')][_0xe87f('0x11')]);}})[_0xe87f('0x13')](function(_0x30341d){logger['error'](_0xe87f('0x10'),_0x383a16,_0x30341d);_0x996784(_0x30341d);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 6f44927..478423a 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 _0xbced=['post','create','addConditions','addActions','put','/:id','update','delete','destroy','exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index','isAuthenticated','show','/:id/conditions','getConditions','/:id/actions','getActions'];(function(_0x44e333,_0x4cdb9c){var _0x4e3f9b=function(_0x1264ed){while(--_0x1264ed){_0x44e333['push'](_0x44e333['shift']());}};_0x4e3f9b(++_0x4cdb9c);}(_0xbced,0x1d6));var _0xdbce=function(_0x56ed67,_0x52a30d){_0x56ed67=_0x56ed67-0x0;var _0x1d0b38=_0xbced[_0x56ed67];return _0x1d0b38;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xdbce('0x0'));var express=require(_0xdbce('0x1'));var router=express[_0xdbce('0x2')]();var auth=require(_0xdbce('0x3'));var interaction=require(_0xdbce('0x4'));var config=require('../../config/environment');var controller=require('./automation.controller');router[_0xdbce('0x5')]('/',auth['isAuthenticated'](),controller[_0xdbce('0x6')]);router[_0xdbce('0x5')]('/:id',auth[_0xdbce('0x7')](),controller[_0xdbce('0x8')]);router['get'](_0xdbce('0x9'),auth[_0xdbce('0x7')](),controller[_0xdbce('0xa')]);router[_0xdbce('0x5')](_0xdbce('0xb'),auth[_0xdbce('0x7')](),controller[_0xdbce('0xc')]);router[_0xdbce('0xd')]('/',auth[_0xdbce('0x7')](),controller[_0xdbce('0xe')]);router[_0xdbce('0xd')](_0xdbce('0x9'),auth[_0xdbce('0x7')](),controller[_0xdbce('0xf')]);router[_0xdbce('0xd')]('/:id/actions',auth['isAuthenticated'](),controller[_0xdbce('0x10')]);router[_0xdbce('0x11')](_0xdbce('0x12'),auth[_0xdbce('0x7')](),controller[_0xdbce('0x13')]);router[_0xdbce('0x14')](_0xdbce('0x12'),auth[_0xdbce('0x7')](),controller[_0xdbce('0x15')]);module[_0xdbce('0x16')]=router; \ No newline at end of file +var _0x207a=['getConditions','/:id/actions','create','post','/:id/conditions','addActions','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated','index'];(function(_0x4164dd,_0x16c592){var _0x39daa8=function(_0x443e48){while(--_0x443e48){_0x4164dd['push'](_0x4164dd['shift']());}};_0x39daa8(++_0x16c592);}(_0x207a,0x83));var _0xa207=function(_0x1d9d1d,_0x304752){_0x1d9d1d=_0x1d9d1d-0x0;var _0x4bf9d4=_0x207a[_0x1d9d1d];return _0x4bf9d4;};'use strict';var multer=require(_0xa207('0x0'));var util=require(_0xa207('0x1'));var path=require('path');var timeout=require(_0xa207('0x2'));var express=require(_0xa207('0x3'));var router=express['Router']();var auth=require(_0xa207('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa207('0x5'));var controller=require('./automation.controller');router[_0xa207('0x6')]('/',auth[_0xa207('0x7')](),controller[_0xa207('0x8')]);router['get']('/:id',auth[_0xa207('0x7')](),controller['show']);router[_0xa207('0x6')]('/:id/conditions',auth[_0xa207('0x7')](),controller[_0xa207('0x9')]);router[_0xa207('0x6')](_0xa207('0xa'),auth['isAuthenticated'](),controller['getActions']);router['post']('/',auth['isAuthenticated'](),controller[_0xa207('0xb')]);router[_0xa207('0xc')](_0xa207('0xd'),auth['isAuthenticated'](),controller['addConditions']);router['post'](_0xa207('0xa'),auth[_0xa207('0x7')](),controller[_0xa207('0xe')]);router['put'](_0xa207('0xf'),auth[_0xa207('0x7')](),controller[_0xa207('0x10')]);router[_0xa207('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xa207('0x12')]);module[_0xa207('0x13')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 089418f..7984e34 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 _0xbab0=['always','never','onlyIfOpen','BOOLEAN','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#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)','exports','STRING','ivr','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','ENUM'];(function(_0x1e600d,_0x3e0c42){var _0x4b53cd=function(_0x478415){while(--_0x478415){_0x1e600d['push'](_0x1e600d['shift']());}};_0x4b53cd(++_0x3e0c42);}(_0xbab0,0x194));var _0x0bab=function(_0x56df01,_0x5a578e){_0x56df01=_0x56df01-0x0;var _0x6a0b66=_0xbab0[_0x56df01];return _0x6a0b66;};'use strict';var Sequelize=require('sequelize');module[_0x0bab('0x0')]={'name':{'type':Sequelize[_0x0bab('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('ivr'),'allowNull':![],'defaultValue':_0x0bab('0x2')},'description':{'type':Sequelize[_0x0bab('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x0bab('0x3')},'limitCalls':{'type':Sequelize[_0x0bab('0x4')](0x4)[_0x0bab('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x0bab('0x6')},'dialOriginateCallerIdName':{'type':Sequelize[_0x0bab('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x0bab('0x4')](0x3)[_0x0bab('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0bab('0x7')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0bab('0x4')](0x3)[_0x0bab('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0bab('0x8')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x0bab('0x4')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0bab('0x9')},'dialBusyMaxRetry':{'type':Sequelize[_0x0bab('0x4')](0x3)[_0x0bab('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0bab('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0bab('0x4')](0x5)[_0x0bab('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0bab('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0bab('0x4')](0x3)[_0x0bab('0x5')],'defaultValue':0x3,'comment':_0x0bab('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0bab('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0bab('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0x0bab('0x4')](0x3)[_0x0bab('0x5')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x0bab('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0bab('0x1')],'defaultValue':_0x0bab('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0x0bab('0xf')](_0x0bab('0x10'),_0x0bab('0x11'),_0x0bab('0x12')),'defaultValue':_0x0bab('0x10')},'dialAMDActive':{'type':Sequelize[_0x0bab('0x13')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x0bab('0x4')](0x9)[_0x0bab('0x5')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0bab('0x14')},'dialAMDGreeting':{'type':Sequelize[_0x0bab('0x4')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0bab('0x4')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0bab('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0bab('0x4')](0x9)[_0x0bab('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x0bab('0x4')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0bab('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0bab('0x4')](0x9)[_0x0bab('0x5')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x0bab('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x0bab('0x5')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x0bab('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x0bab('0x4')](0x5)[_0x0bab('0x5')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0bab('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0x0bab('0xf')](_0x0bab('0x1a'),_0x0bab('0x1b')),'defaultValue':_0x0bab('0x1a')},'dialPrefix':{'type':Sequelize[_0x0bab('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0bab('0x4')](0x3)[_0x0bab('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0bab('0x1c')},'dialCutDigit':{'type':Sequelize[_0x0bab('0x4')](0x3)[_0x0bab('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0bab('0x1d')}}; \ No newline at end of file +var _0x0823=['Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','never','onlyIfOpen','always','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)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)'];(function(_0x127440,_0x540461){var _0x12aab9=function(_0x20435a){while(--_0x20435a){_0x127440['push'](_0x127440['shift']());}};_0x12aab9(++_0x540461);}(_0x0823,0x103));var _0x3082=function(_0x42b109,_0x1544cc){_0x42b109=_0x42b109-0x0;var _0xdfea27=_0x0823[_0x42b109];return _0xdfea27;};'use strict';var Sequelize=require(_0x3082('0x0'));module[_0x3082('0x1')]={'name':{'type':Sequelize[_0x3082('0x2')],'unique':_0x3082('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x3082('0x4')](_0x3082('0x5')),'allowNull':![],'defaultValue':_0x3082('0x5')},'description':{'type':Sequelize[_0x3082('0x2')]},'active':{'type':Sequelize[_0x3082('0x6')],'defaultValue':0x0,'comment':_0x3082('0x7')},'limitCalls':{'type':Sequelize[_0x3082('0x8')](0x4)[_0x3082('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x3082('0xa')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x3082('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x3082('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3082('0xb')},'dialCongestionMaxRetry':{'type':Sequelize[_0x3082('0x8')](0x3)[_0x3082('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3082('0xc')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x3082('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3082('0xd')},'dialBusyMaxRetry':{'type':Sequelize[_0x3082('0x8')](0x3)[_0x3082('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3082('0xe')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x3082('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3082('0xf')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x3082('0x10')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x3082('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3082('0x11')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x3082('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x3082('0x12')},'dialTimezone':{'type':Sequelize[_0x3082('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x3082('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always',_0x3082('0x13'),_0x3082('0x14')),'defaultValue':_0x3082('0x15')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x3082('0x16')},'dialAMDInitialSilence':{'type':Sequelize[_0x3082('0x8')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x3082('0x17')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x3082('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x3082('0x18')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x3082('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x3082('0x19')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x3082('0x8')](0x9)[_0x3082('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x3082('0x8')](0x9)[_0x3082('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x3082('0x1a')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x3082('0x8')](0x9)[_0x3082('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x3082('0x1b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x3082('0x8')](0x9)[_0x3082('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x3082('0x1c')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x3082('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x3082('0x1d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x3082('0x8')](0x9)[_0x3082('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x3082('0x4')](_0x3082('0x1e'),_0x3082('0x1f')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x3082('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x3082('0x8')](0x3)[_0x3082('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3082('0x20')},'dialCutDigit':{'type':Sequelize[_0x3082('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3082('0x21')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 44d1229..cce4d60 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 _0xda55=['status','end','offset','limit','set','Content-Range','apply','reject','then','destroy','IvrCampaigns','UserProfileResource','error','name','send','index','map','Campaign','type','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','merge','omit','createdAt','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getHoppers','findOne','sort','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','getHopperFinals','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','fromQuery','scheduledAt','ContactId','ListId','updatedAt','select','field','phone','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','cm_hopper','NOW()','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0xda55,0x6d));var _0x5da5=function(_0x4b53d3,_0x19db52){_0x4b53d3=_0x4b53d3-0x0;var _0x15b95d=_0xda55[_0x4b53d3];return _0x15b95d;};'use strict';var pdf=require(_0x5da5('0x0'));var emlformat=require(_0x5da5('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5da5('0x2'));var rp=require(_0x5da5('0x3'));var moment=require(_0x5da5('0x4'));var BPromise=require(_0x5da5('0x5'));var Mustache=require(_0x5da5('0x6'));var util=require('util');var path=require(_0x5da5('0x7'));var sox=require('sox');var csv=require(_0x5da5('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5da5('0x9'));var squel=require(_0x5da5('0xa'));var crypto=require(_0x5da5('0xb'));var jsforce=require(_0x5da5('0xc'));var deskjs=require(_0x5da5('0xd'));var toCsv=require(_0x5da5('0x8'));var querystring=require(_0x5da5('0xe'));var Papa=require(_0x5da5('0xf'));var Redis=require('ioredis');var authService=require(_0x5da5('0x10'));var qs=require(_0x5da5('0x11'));var as=require(_0x5da5('0x12'));var hardwareService=require(_0x5da5('0x13'));var logger=require(_0x5da5('0x14'))(_0x5da5('0x15'));var utils=require(_0x5da5('0x16'));var config=require('../../config/environment');var db=require(_0x5da5('0x17'))['db'];function respondWithStatusCode(_0x3b5ff9,_0x4f813b){_0x4f813b=_0x4f813b||0xcc;return function(_0x37aeb0){if(_0x37aeb0){return _0x3b5ff9[_0x5da5('0x18')](_0x4f813b);}return _0x3b5ff9[_0x5da5('0x19')](_0x4f813b)[_0x5da5('0x1a')]();};}function respondWithResult(_0x1877d4,_0x440b8f){_0x440b8f=_0x440b8f||0xc8;return function(_0x481562){if(_0x481562){return _0x1877d4['status'](_0x440b8f)['json'](_0x481562);}};}function respondWithFilteredResult(_0x4267cd,_0x126fc8){return function(_0x13c701){if(_0x13c701){var _0x665ce8=_0x13c701['count'],_0x11bd3=_0x126fc8[_0x5da5('0x1b')],_0x134afa=_0x126fc8[_0x5da5('0x1b')]+_0x126fc8[_0x5da5('0x1c')],_0x3aff51;if(_0x134afa>=_0x665ce8){_0x134afa=_0x665ce8;_0x3aff51=0xc8;}else{_0x3aff51=0xce;}_0x4267cd[_0x5da5('0x19')](_0x3aff51);return _0x4267cd[_0x5da5('0x1d')](_0x5da5('0x1e'),_0x11bd3+'-'+_0x134afa+'/'+_0x665ce8)['json'](_0x13c701);}return null;};}function patchUpdates(_0x1920e2){return function(_0x3766ee){try{jsonpatch[_0x5da5('0x1f')](_0x3766ee,_0x1920e2,!![]);}catch(_0x30cde5){return BPromise[_0x5da5('0x20')](_0x30cde5);}return _0x3766ee['save']();};}function saveUpdates(_0x4393d7,_0x3372fc){return function(_0x42a3cb){if(_0x42a3cb){return _0x42a3cb['update'](_0x4393d7)[_0x5da5('0x21')](function(_0x15aa62){return _0x15aa62;});}return null;};}function removeEntity(_0x20c8a6,_0x2e68d5){return function(_0xec69f2){if(_0xec69f2){return _0xec69f2[_0x5da5('0x22')]()['then'](function(){var _0x1a6bd7=_0xec69f2['get']({'plain':!![]});var _0x1b67c4=_0x5da5('0x23');return db[_0x5da5('0x24')]['destroy']({'where':{'type':_0x1b67c4,'resourceId':_0x1a6bd7['id']}})[_0x5da5('0x21')](function(){return _0xec69f2;});})[_0x5da5('0x21')](function(){_0x20c8a6[_0x5da5('0x19')](0xcc)[_0x5da5('0x1a')]();});}};}function handleEntityNotFound(_0x55d517,_0x5b0b43){return function(_0x50aadc){if(!_0x50aadc){_0x55d517[_0x5da5('0x18')](0x194);}return _0x50aadc;};}function handleError(_0x56d509,_0x4e8890){_0x4e8890=_0x4e8890||0x1f4;return function(_0x1f75f3){logger[_0x5da5('0x25')](_0x1f75f3['stack']);if(_0x1f75f3[_0x5da5('0x26')]){delete _0x1f75f3[_0x5da5('0x26')];}_0x56d509['status'](_0x4e8890)[_0x5da5('0x27')](_0x1f75f3);};}exports[_0x5da5('0x28')]=function(_0x38bb86,_0x42292d){var _0x766ed9={},_0x5734ce={},_0x3ae664={'count':0x0,'rows':[]};var _0x2e3c5d=_[_0x5da5('0x29')](db[_0x5da5('0x2a')]['rawAttributes'],function(_0x5ee7f2){return{'name':_0x5ee7f2['fieldName'],'type':_0x5ee7f2[_0x5da5('0x2b')][_0x5da5('0x2c')]};});_0x5734ce[_0x5da5('0x2d')]=_[_0x5da5('0x29')](_0x2e3c5d,'name');_0x5734ce['query']=_[_0x5da5('0x2e')](_0x38bb86['query']);_0x5734ce['filters']=_[_0x5da5('0x2f')](_0x5734ce['model'],_0x5734ce[_0x5da5('0x30')]);_0x766ed9[_0x5da5('0x31')]=_[_0x5da5('0x2f')](_0x5734ce[_0x5da5('0x2d')],qs[_0x5da5('0x32')](_0x38bb86[_0x5da5('0x30')][_0x5da5('0x32')]));_0x766ed9[_0x5da5('0x31')]=_0x766ed9['attributes'][_0x5da5('0x33')]?_0x766ed9['attributes']:_0x5734ce[_0x5da5('0x2d')];if(!_0x38bb86[_0x5da5('0x30')][_0x5da5('0x34')](_0x5da5('0x35'))){_0x766ed9[_0x5da5('0x1c')]=qs[_0x5da5('0x1c')](_0x38bb86[_0x5da5('0x30')][_0x5da5('0x1c')]);_0x766ed9[_0x5da5('0x1b')]=qs[_0x5da5('0x1b')](_0x38bb86[_0x5da5('0x30')][_0x5da5('0x1b')]);}_0x766ed9[_0x5da5('0x36')]=qs['sort'](_0x38bb86[_0x5da5('0x30')]['sort']);_0x766ed9[_0x5da5('0x37')]=qs[_0x5da5('0x38')](_[_0x5da5('0x39')](_0x38bb86[_0x5da5('0x30')],_0x5734ce['filters']));if(_0x38bb86[_0x5da5('0x30')][_0x5da5('0x3a')]){_0x766ed9[_0x5da5('0x37')]=_['merge'](_0x766ed9[_0x5da5('0x37')],{'$or':_[_0x5da5('0x29')](_0x2e3c5d,function(_0x4b8464){if(_0x4b8464[_0x5da5('0x2b')]!==_0x5da5('0x3b')){var _0xe9888e={};_0xe9888e[_0x4b8464[_0x5da5('0x26')]]={'$like':'%'+_0x38bb86[_0x5da5('0x30')][_0x5da5('0x3a')]+'%'};return _0xe9888e;}})});}_0x766ed9=_['merge']({},_0x766ed9,_0x38bb86[_0x5da5('0x3c')]);var _0x91d336={'where':_0x766ed9[_0x5da5('0x37')]};return db[_0x5da5('0x2a')][_0x5da5('0x3d')](_0x91d336)['then'](function(_0x472e9f){_0x3ae664[_0x5da5('0x3d')]=_0x472e9f;if(_0x38bb86['query'][_0x5da5('0x3e')]){_0x766ed9['include']=[{'all':!![]}];}return db['Campaign'][_0x5da5('0x3f')](_0x766ed9);})[_0x5da5('0x21')](function(_0x2f6026){_0x3ae664[_0x5da5('0x40')]=_0x2f6026;return _0x3ae664;})[_0x5da5('0x21')](respondWithFilteredResult(_0x42292d,_0x766ed9))[_0x5da5('0x41')](handleError(_0x42292d,null));};exports[_0x5da5('0x42')]=function(_0xa6af2d,_0x40cf69){var _0x2a2814={'raw':![],'where':{'id':_0xa6af2d[_0x5da5('0x43')]['id']}},_0x22d47e={};_0x22d47e[_0x5da5('0x2d')]=_[_0x5da5('0x2e')](db[_0x5da5('0x2a')][_0x5da5('0x44')]);_0x22d47e[_0x5da5('0x30')]=_[_0x5da5('0x2e')](_0xa6af2d[_0x5da5('0x30')]);_0x22d47e[_0x5da5('0x38')]=_['intersection'](_0x22d47e['model'],_0x22d47e[_0x5da5('0x30')]);_0x2a2814[_0x5da5('0x31')]=_['intersection'](_0x22d47e[_0x5da5('0x2d')],qs[_0x5da5('0x32')](_0xa6af2d[_0x5da5('0x30')][_0x5da5('0x32')]));_0x2a2814[_0x5da5('0x31')]=_0x2a2814[_0x5da5('0x31')][_0x5da5('0x33')]?_0x2a2814[_0x5da5('0x31')]:_0x22d47e[_0x5da5('0x2d')];if(_0xa6af2d[_0x5da5('0x30')]['includeAll']){_0x2a2814[_0x5da5('0x45')]=[{'all':!![]}];}_0x2a2814=_['merge']({},_0x2a2814,_0xa6af2d['options']);return db[_0x5da5('0x2a')][_0x5da5('0x46')](_0x2a2814)[_0x5da5('0x21')](handleEntityNotFound(_0x40cf69,null))[_0x5da5('0x21')](respondWithResult(_0x40cf69,null))[_0x5da5('0x41')](handleError(_0x40cf69,null));};exports[_0x5da5('0x47')]=function(_0x5aa561,_0x216d06){return db['Campaign']['create'](_0x5aa561[_0x5da5('0x48')],{})[_0x5da5('0x21')](function(_0x47ca73){var _0x419d74=_0x5aa561[_0x5da5('0x49')][_0x5da5('0x4a')]({'plain':!![]});if(!_0x419d74)throw new Error(_0x5da5('0x4b'));if(_0x419d74[_0x5da5('0x4c')]==='user'){var _0x225792=_0x47ca73['get']({'plain':!![]});var _0x535b22=_0x5da5('0x23');return db['UserProfileSection'][_0x5da5('0x46')]({'where':{'name':_0x535b22,'userProfileId':_0x419d74[_0x5da5('0x4d')]},'raw':!![]})[_0x5da5('0x21')](function(_0x1ec725){if(_0x1ec725&&_0x1ec725[_0x5da5('0x4e')]===0x0){return db[_0x5da5('0x24')]['create']({'name':_0x225792['name'],'resourceId':_0x225792['id'],'type':_0x1ec725[_0x5da5('0x26')],'sectionId':_0x1ec725['id']},{})[_0x5da5('0x21')](function(){return _0x47ca73;});}else{return _0x47ca73;}})['catch'](function(_0x4fca4c){logger[_0x5da5('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4fca4c);throw _0x4fca4c;});}return _0x47ca73;})[_0x5da5('0x21')](respondWithResult(_0x216d06,0xc9))['catch'](handleError(_0x216d06,null));};exports['clone']=function(_0x39950d,_0x323655){var _0xc2b9a5={'where':{'id':_0x39950d['params']['id']}},_0x39d428={};_0x39d428[_0x5da5('0x2d')]=_[_0x5da5('0x2e')](db[_0x5da5('0x2a')]['rawAttributes']);_0xc2b9a5[_0x5da5('0x31')]=_[_0x5da5('0x2f')](_0x39d428[_0x5da5('0x2d')],qs[_0x5da5('0x32')](_0x39950d[_0x5da5('0x30')][_0x5da5('0x32')]));_0xc2b9a5[_0x5da5('0x31')]=_0xc2b9a5[_0x5da5('0x31')][_0x5da5('0x33')]?_0xc2b9a5[_0x5da5('0x31')]:_0x39d428[_0x5da5('0x2d')];if(_0x39950d[_0x5da5('0x30')][_0x5da5('0x3e')]){_0xc2b9a5[_0x5da5('0x45')]=[{'all':!![]}];}_0xc2b9a5=_[_0x5da5('0x4f')]({},_0xc2b9a5,_0x39950d[_0x5da5('0x3c')]);return db[_0x5da5('0x2a')][_0x5da5('0x46')](_0xc2b9a5)[_0x5da5('0x21')](handleEntityNotFound(_0x323655,null))[_0x5da5('0x21')](function(_0x2c5360){if(_0x2c5360){var _0x4cc539=_0x2c5360[_0x5da5('0x4a')]({'plain':!![]});_0x4cc539=qs[_0x5da5('0x50')](_0x4cc539,['id','createdAt','updatedAt']);_0x39950d['body']=_[_0x5da5('0x50')](_0x39950d[_0x5da5('0x48')],['id',_0x5da5('0x51'),'updatedAt']);return db['Campaign'][_0x5da5('0x47')](_[_0x5da5('0x4f')](_0x4cc539,_0x39950d[_0x5da5('0x48')]),{'include':_0x39950d[_0x5da5('0x30')]['includeAll']?[{'all':!![]}]:undefined})[_0x5da5('0x21')](function(_0x3eeff3){var _0x34b4b0=_0x39950d['user'][_0x5da5('0x4a')]({'plain':!![]});if(!_0x34b4b0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x34b4b0[_0x5da5('0x4c')]===_0x5da5('0x49')){var _0x4f0e51=_0x3eeff3[_0x5da5('0x4a')]({'plain':!![]});var _0x12c983=_0x5da5('0x23');return db[_0x5da5('0x52')][_0x5da5('0x46')]({'where':{'name':_0x12c983,'userProfileId':_0x34b4b0[_0x5da5('0x4d')]},'raw':!![]})[_0x5da5('0x21')](function(_0x2f9f72){if(_0x2f9f72&&_0x2f9f72[_0x5da5('0x4e')]===0x0){return db[_0x5da5('0x24')][_0x5da5('0x47')]({'name':_0x4f0e51[_0x5da5('0x26')],'resourceId':_0x4f0e51['id'],'type':_0x2f9f72[_0x5da5('0x26')],'sectionId':_0x2f9f72['id']},{})[_0x5da5('0x21')](function(){return _0x3eeff3;});}else{return _0x3eeff3;}})[_0x5da5('0x41')](function(_0xc957b3){logger[_0x5da5('0x25')](_0x5da5('0x53'),_0xc957b3);throw _0xc957b3;});}return _0x3eeff3;});}})['then'](respondWithResult(_0x323655,0xc9))['catch'](handleError(_0x323655,null));};exports[_0x5da5('0x54')]=function(_0x35cca1,_0x4041e8){if(_0x35cca1['body']['id']){delete _0x35cca1[_0x5da5('0x48')]['id'];}return db[_0x5da5('0x2a')][_0x5da5('0x46')]({'where':{'id':_0x35cca1[_0x5da5('0x43')]['id']}})['then'](handleEntityNotFound(_0x4041e8,null))[_0x5da5('0x21')](saveUpdates(_0x35cca1['body'],null))[_0x5da5('0x21')](respondWithResult(_0x4041e8,null))[_0x5da5('0x41')](handleError(_0x4041e8,null));};exports[_0x5da5('0x22')]=function(_0x53cb6a,_0x57966d){return db[_0x5da5('0x2a')][_0x5da5('0x46')]({'where':{'id':_0x53cb6a['params']['id']}})['then'](handleEntityNotFound(_0x57966d,null))['then'](removeEntity(_0x57966d,null))[_0x5da5('0x41')](handleError(_0x57966d,null));};exports[_0x5da5('0x55')]=function(_0x2b5cd5,_0x152b61,_0x3e0904){var _0x283efe={'raw':!![],'where':{}};var _0x10e97c={};var _0xb2f3be={'count':0x0,'rows':[]};return db['Campaign'][_0x5da5('0x56')]({'where':{'id':_0x2b5cd5[_0x5da5('0x43')]['id']}})['then'](handleEntityNotFound(_0x152b61,null))['then'](function(_0x161821){if(_0x161821){_0x10e97c['model']=_[_0x5da5('0x2e')](db['CmHopper'][_0x5da5('0x44')]);_0x10e97c[_0x5da5('0x30')]=_[_0x5da5('0x2e')](_0x2b5cd5[_0x5da5('0x30')]);_0x10e97c[_0x5da5('0x38')]=_[_0x5da5('0x2f')](_0x10e97c[_0x5da5('0x2d')],_0x10e97c[_0x5da5('0x30')]);_0x283efe[_0x5da5('0x31')]=_[_0x5da5('0x2f')](_0x10e97c[_0x5da5('0x2d')],qs[_0x5da5('0x32')](_0x2b5cd5['query']['fields']));_0x283efe[_0x5da5('0x31')]=_0x283efe[_0x5da5('0x31')][_0x5da5('0x33')]?_0x283efe[_0x5da5('0x31')]:_0x10e97c['model'];if(!_0x2b5cd5['query']['hasOwnProperty'](_0x5da5('0x35'))){_0x283efe[_0x5da5('0x1c')]=qs[_0x5da5('0x1c')](_0x2b5cd5[_0x5da5('0x30')][_0x5da5('0x1c')]);_0x283efe[_0x5da5('0x1b')]=qs[_0x5da5('0x1b')](_0x2b5cd5[_0x5da5('0x30')][_0x5da5('0x1b')]);}_0x283efe[_0x5da5('0x36')]=qs[_0x5da5('0x57')](_0x2b5cd5[_0x5da5('0x30')][_0x5da5('0x57')]);_0x283efe[_0x5da5('0x37')]=qs[_0x5da5('0x38')](_[_0x5da5('0x39')](_0x2b5cd5[_0x5da5('0x30')],_0x10e97c[_0x5da5('0x38')]));_0x283efe[_0x5da5('0x37')][_0x5da5('0x58')]=_0x161821['id'];if(_0x2b5cd5[_0x5da5('0x30')]['filter']){_0x283efe[_0x5da5('0x37')]=_[_0x5da5('0x4f')](_0x283efe[_0x5da5('0x37')],{'$or':_[_0x5da5('0x29')](_0x283efe['attributes'],function(_0x488da6){var _0x2b14ca={};_0x2b14ca[_0x488da6]={'$like':'%'+_0x2b5cd5['query'][_0x5da5('0x3a')]+'%'};return _0x2b14ca;})});}_0x283efe=_[_0x5da5('0x4f')]({},_0x283efe,_0x2b5cd5[_0x5da5('0x3c')]);return db[_0x5da5('0x59')][_0x5da5('0x3d')]({'where':_0x283efe[_0x5da5('0x37')]})[_0x5da5('0x21')](function(_0x7d0ff1){_0xb2f3be[_0x5da5('0x3d')]=_0x7d0ff1;if(_0x2b5cd5['query'][_0x5da5('0x3e')]){_0x283efe['include']=[{'all':!![]}];}return db[_0x5da5('0x59')][_0x5da5('0x3f')](_0x283efe);})['then'](function(_0x280132){_0xb2f3be['rows']=_0x280132;return _0xb2f3be;});}})[_0x5da5('0x21')](respondWithFilteredResult(_0x152b61,_0x283efe))['catch'](handleError(_0x152b61,null));};exports[_0x5da5('0x5a')]=function(_0x3a4ec8,_0x2c2815,_0x358f8d){var _0x4df458={'raw':!![],'where':{}};var _0x2f6d27={};var _0x42cc38={'count':0x0,'rows':[]};return db[_0x5da5('0x2a')][_0x5da5('0x56')]({'where':{'id':_0x3a4ec8['params']['id']}})[_0x5da5('0x21')](handleEntityNotFound(_0x2c2815,null))[_0x5da5('0x21')](function(_0x4ca5cb){if(_0x4ca5cb){_0x2f6d27['model']=_[_0x5da5('0x2e')](db[_0x5da5('0x5b')][_0x5da5('0x44')]);_0x2f6d27[_0x5da5('0x30')]=_['keys'](_0x3a4ec8[_0x5da5('0x30')]);_0x2f6d27['filters']=_[_0x5da5('0x2f')](_0x2f6d27['model'],_0x2f6d27['query']);_0x4df458[_0x5da5('0x31')]=_['intersection'](_0x2f6d27['model'],qs[_0x5da5('0x32')](_0x3a4ec8[_0x5da5('0x30')][_0x5da5('0x32')]));_0x4df458[_0x5da5('0x31')]=_0x4df458[_0x5da5('0x31')][_0x5da5('0x33')]?_0x4df458[_0x5da5('0x31')]:_0x2f6d27[_0x5da5('0x2d')];if(!_0x3a4ec8['query'][_0x5da5('0x34')](_0x5da5('0x35'))){_0x4df458[_0x5da5('0x1c')]=qs[_0x5da5('0x1c')](_0x3a4ec8[_0x5da5('0x30')][_0x5da5('0x1c')]);_0x4df458[_0x5da5('0x1b')]=qs[_0x5da5('0x1b')](_0x3a4ec8[_0x5da5('0x30')][_0x5da5('0x1b')]);}_0x4df458[_0x5da5('0x36')]=qs[_0x5da5('0x57')](_0x3a4ec8[_0x5da5('0x30')][_0x5da5('0x57')]);_0x4df458[_0x5da5('0x37')]=qs[_0x5da5('0x38')](_[_0x5da5('0x39')](_0x3a4ec8[_0x5da5('0x30')],_0x2f6d27[_0x5da5('0x38')]));_0x4df458[_0x5da5('0x37')][_0x5da5('0x58')]=_0x4ca5cb['id'];if(_0x3a4ec8[_0x5da5('0x30')][_0x5da5('0x3a')]){_0x4df458[_0x5da5('0x37')]=_['merge'](_0x4df458[_0x5da5('0x37')],{'$or':_[_0x5da5('0x29')](_0x4df458['attributes'],function(_0x41986c){var _0x4f9e25={};_0x4f9e25[_0x41986c]={'$like':'%'+_0x3a4ec8[_0x5da5('0x30')][_0x5da5('0x3a')]+'%'};return _0x4f9e25;})});}_0x4df458=_[_0x5da5('0x4f')]({},_0x4df458,_0x3a4ec8[_0x5da5('0x3c')]);return db[_0x5da5('0x5b')][_0x5da5('0x3d')]({'where':_0x4df458['where']})[_0x5da5('0x21')](function(_0x319490){_0x42cc38['count']=_0x319490;if(_0x3a4ec8[_0x5da5('0x30')][_0x5da5('0x3e')]){_0x4df458['include']=[{'all':!![]}];}return db[_0x5da5('0x5b')][_0x5da5('0x3f')](_0x4df458);})[_0x5da5('0x21')](function(_0x2faa78){_0x42cc38[_0x5da5('0x40')]=_0x2faa78;return _0x42cc38;});}})[_0x5da5('0x21')](respondWithFilteredResult(_0x2c2815,_0x4df458))[_0x5da5('0x41')](handleError(_0x2c2815,null));};exports[_0x5da5('0x5c')]=function(_0x263f18,_0x2c08a0,_0x4a9d03){var _0x449fe0={'raw':!![],'where':{}};var _0x2fba9e={};var _0x2464c0={'count':0x0,'rows':[]};return db[_0x5da5('0x2a')][_0x5da5('0x56')]({'where':{'id':_0x263f18[_0x5da5('0x43')]['id']}})[_0x5da5('0x21')](handleEntityNotFound(_0x2c08a0,null))['then'](function(_0x56d98a){if(_0x56d98a){_0x2fba9e[_0x5da5('0x2d')]=_['keys'](db['CmHopperFinal'][_0x5da5('0x44')]);_0x2fba9e['query']=_[_0x5da5('0x2e')](_0x263f18['query']);_0x2fba9e[_0x5da5('0x38')]=_[_0x5da5('0x2f')](_0x2fba9e[_0x5da5('0x2d')],_0x2fba9e[_0x5da5('0x30')]);_0x449fe0['attributes']=_[_0x5da5('0x2f')](_0x2fba9e[_0x5da5('0x2d')],qs[_0x5da5('0x32')](_0x263f18[_0x5da5('0x30')][_0x5da5('0x32')]));_0x449fe0[_0x5da5('0x31')]=_0x449fe0[_0x5da5('0x31')][_0x5da5('0x33')]?_0x449fe0['attributes']:_0x2fba9e[_0x5da5('0x2d')];if(!_0x263f18[_0x5da5('0x30')]['hasOwnProperty'](_0x5da5('0x35'))){_0x449fe0[_0x5da5('0x1c')]=qs[_0x5da5('0x1c')](_0x263f18[_0x5da5('0x30')]['limit']);_0x449fe0['offset']=qs[_0x5da5('0x1b')](_0x263f18[_0x5da5('0x30')][_0x5da5('0x1b')]);}_0x449fe0[_0x5da5('0x36')]=qs[_0x5da5('0x57')](_0x263f18['query'][_0x5da5('0x57')]);_0x449fe0[_0x5da5('0x37')]=qs[_0x5da5('0x38')](_[_0x5da5('0x39')](_0x263f18[_0x5da5('0x30')],_0x2fba9e[_0x5da5('0x38')]));_0x449fe0[_0x5da5('0x37')][_0x5da5('0x58')]=_0x56d98a['id'];if(_0x263f18[_0x5da5('0x30')][_0x5da5('0x3a')]){_0x449fe0[_0x5da5('0x37')]=_[_0x5da5('0x4f')](_0x449fe0[_0x5da5('0x37')],{'$or':_[_0x5da5('0x29')](_0x449fe0[_0x5da5('0x31')],function(_0x34bdd4){var _0x28da21={};_0x28da21[_0x34bdd4]={'$like':'%'+_0x263f18[_0x5da5('0x30')][_0x5da5('0x3a')]+'%'};return _0x28da21;})});}_0x449fe0=_['merge']({},_0x449fe0,_0x263f18[_0x5da5('0x3c')]);return db['CmHopperFinal'][_0x5da5('0x3d')]({'where':_0x449fe0[_0x5da5('0x37')]})[_0x5da5('0x21')](function(_0x1fe6a0){_0x2464c0[_0x5da5('0x3d')]=_0x1fe6a0;if(_0x263f18['query'][_0x5da5('0x3e')]){_0x449fe0[_0x5da5('0x45')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x449fe0);})[_0x5da5('0x21')](function(_0x50cd17){_0x2464c0[_0x5da5('0x40')]=_0x50cd17;return _0x2464c0;});}})[_0x5da5('0x21')](respondWithFilteredResult(_0x2c08a0,_0x449fe0))[_0x5da5('0x41')](handleError(_0x2c08a0,null));};exports[_0x5da5('0x5d')]=function(_0x315e6f,_0x3611f7,_0x341587){var _0x4c16f3={'raw':!![],'where':{}};var _0x57b6e4={};var _0x4f9802={'count':0x0,'rows':[]};return db[_0x5da5('0x2a')][_0x5da5('0x56')]({'where':{'id':_0x315e6f[_0x5da5('0x43')]['id']}})['then'](handleEntityNotFound(_0x3611f7,null))[_0x5da5('0x21')](function(_0x2f5cf9){if(_0x2f5cf9){_0x57b6e4[_0x5da5('0x2d')]=_[_0x5da5('0x2e')](db[_0x5da5('0x5e')][_0x5da5('0x44')]);_0x57b6e4['query']=_[_0x5da5('0x2e')](_0x315e6f[_0x5da5('0x30')]);_0x57b6e4[_0x5da5('0x38')]=_['intersection'](_0x57b6e4['model'],_0x57b6e4[_0x5da5('0x30')]);_0x4c16f3[_0x5da5('0x31')]=_['intersection'](_0x57b6e4[_0x5da5('0x2d')],qs[_0x5da5('0x32')](_0x315e6f['query'][_0x5da5('0x32')]));_0x4c16f3['attributes']=_0x4c16f3['attributes'][_0x5da5('0x33')]?_0x4c16f3['attributes']:_0x57b6e4[_0x5da5('0x2d')];if(!_0x315e6f['query'][_0x5da5('0x34')](_0x5da5('0x35'))){_0x4c16f3['limit']=qs[_0x5da5('0x1c')](_0x315e6f[_0x5da5('0x30')][_0x5da5('0x1c')]);_0x4c16f3[_0x5da5('0x1b')]=qs['offset'](_0x315e6f['query'][_0x5da5('0x1b')]);}_0x4c16f3[_0x5da5('0x36')]=qs[_0x5da5('0x57')](_0x315e6f[_0x5da5('0x30')][_0x5da5('0x57')]);_0x4c16f3[_0x5da5('0x37')]=qs['filters'](_[_0x5da5('0x39')](_0x315e6f[_0x5da5('0x30')],_0x57b6e4[_0x5da5('0x38')]));_0x4c16f3[_0x5da5('0x37')]['CampaignId']=_0x2f5cf9['id'];if(_0x315e6f['query'][_0x5da5('0x3a')]){_0x4c16f3[_0x5da5('0x37')]=_[_0x5da5('0x4f')](_0x4c16f3['where'],{'$or':_['map'](_0x4c16f3[_0x5da5('0x31')],function(_0x5e4533){var _0x1322ac={};_0x1322ac[_0x5e4533]={'$like':'%'+_0x315e6f[_0x5da5('0x30')]['filter']+'%'};return _0x1322ac;})});}_0x4c16f3=_['merge']({},_0x4c16f3,_0x315e6f['options']);return db[_0x5da5('0x5e')]['count']({'where':_0x4c16f3[_0x5da5('0x37')]})[_0x5da5('0x21')](function(_0x24c565){_0x4f9802[_0x5da5('0x3d')]=_0x24c565;if(_0x315e6f[_0x5da5('0x30')][_0x5da5('0x3e')]){_0x4c16f3['include']=[{'all':!![]}];}return db[_0x5da5('0x5e')][_0x5da5('0x3f')](_0x4c16f3);})[_0x5da5('0x21')](function(_0x2212b1){_0x4f9802[_0x5da5('0x40')]=_0x2212b1;return _0x4f9802;});}})['then'](respondWithFilteredResult(_0x3611f7,_0x4c16f3))[_0x5da5('0x41')](handleError(_0x3611f7,null));};exports[_0x5da5('0x5f')]=function(_0x59e663,_0x51b2cb,_0x15ccd3){var _0x1971c2={};var _0x3385eb={};var _0x3822dd;var _0xe36532;return db[_0x5da5('0x2a')][_0x5da5('0x56')]({'where':{'id':_0x59e663[_0x5da5('0x43')]['id']}})[_0x5da5('0x21')](handleEntityNotFound(_0x51b2cb,null))['then'](function(_0x3514b3){if(_0x3514b3){_0x3822dd=_0x3514b3;_0x3385eb[_0x5da5('0x2d')]=_[_0x5da5('0x2e')](db['CmList'][_0x5da5('0x44')]);_0x3385eb['query']=_['keys'](_0x59e663['query']);_0x3385eb[_0x5da5('0x38')]=_[_0x5da5('0x2f')](_0x3385eb[_0x5da5('0x2d')],_0x3385eb[_0x5da5('0x30')]);_0x1971c2['attributes']=_[_0x5da5('0x2f')](_0x3385eb[_0x5da5('0x2d')],qs[_0x5da5('0x32')](_0x59e663[_0x5da5('0x30')][_0x5da5('0x32')]));_0x1971c2[_0x5da5('0x31')]=_0x1971c2[_0x5da5('0x31')]['length']?_0x1971c2[_0x5da5('0x31')]:_0x3385eb[_0x5da5('0x2d')];_0x1971c2[_0x5da5('0x36')]=qs[_0x5da5('0x57')](_0x59e663['query'][_0x5da5('0x57')]);_0x1971c2[_0x5da5('0x37')]=qs['filters'](_[_0x5da5('0x39')](_0x59e663[_0x5da5('0x30')],_0x3385eb[_0x5da5('0x38')]));if(_0x59e663[_0x5da5('0x30')]['filter']){_0x1971c2['where']=_[_0x5da5('0x4f')](_0x1971c2[_0x5da5('0x37')],{'$or':_[_0x5da5('0x29')](_0x1971c2['attributes'],function(_0x2d5eea){var _0x555728={};_0x555728[_0x2d5eea]={'$like':'%'+_0x59e663['query'][_0x5da5('0x3a')]+'%'};return _0x555728;})});}_0x1971c2=_[_0x5da5('0x4f')]({},_0x1971c2,_0x59e663[_0x5da5('0x3c')]);return _0x3822dd['getLists'](_0x1971c2);}})[_0x5da5('0x21')](function(_0x5738f4){if(_0x5738f4){_0xe36532=_0x5738f4['length'];if(!_0x59e663[_0x5da5('0x30')][_0x5da5('0x34')](_0x5da5('0x35'))){_0x1971c2['limit']=qs['limit'](_0x59e663[_0x5da5('0x30')][_0x5da5('0x1c')]);_0x1971c2['offset']=qs['offset'](_0x59e663[_0x5da5('0x30')]['offset']);}return _0x3822dd[_0x5da5('0x5f')](_0x1971c2);}})[_0x5da5('0x21')](function(_0x2eb429){if(_0x2eb429){return _0x2eb429?{'count':_0xe36532,'rows':_0x2eb429}:null;}})[_0x5da5('0x21')](respondWithResult(_0x51b2cb,null))[_0x5da5('0x41')](handleError(_0x51b2cb,null));};exports[_0x5da5('0x60')]=function(_0x4814d5,_0x17c226,_0x41e33d){var _0x2441bb,_0x1179ea;return db[_0x5da5('0x2a')][_0x5da5('0x46')]({'where':{'id':_0x4814d5[_0x5da5('0x43')]['id']}})['then'](handleEntityNotFound(_0x17c226,null))['then'](function(_0x4486b8){if(_0x4486b8){_0x1179ea=_0x4486b8;return _0x4486b8[_0x5da5('0x60')](_0x4814d5[_0x5da5('0x48')][_0x5da5('0x61')],_[_0x5da5('0x50')](_0x4814d5['body'],[_0x5da5('0x61'),'id'])||{});}return null;})[_0x5da5('0x62')](function(_0x6ba7b4){var _0x4ccfbc;_0x2441bb=_0x6ba7b4||[];var _0x45fdc3=[];if(_0x6ba7b4){for(var _0x1bee1c=0x0;_0x1bee1c<_0x6ba7b4[_0x5da5('0x33')];_0x1bee1c+=0x1){var _0x19ec84=_0x6ba7b4[_0x1bee1c][_0x5da5('0x4a')]({'plain':!![]});_0x1179ea[_0x5da5('0x63')]=_0x4814d5[_0x5da5('0x48')][_0x5da5('0x63')]?_0x4814d5[_0x5da5('0x48')][_0x5da5('0x63')]:_0x1179ea[_0x5da5('0x63')];switch(_0x1179ea['dialCheckDuplicateType']){case _0x5da5('0x64'):_0x4ccfbc=squel[_0x5da5('0x65')]()[_0x5da5('0x66')]('cm_hopper')[_0x5da5('0x67')](['phone',_0x5da5('0x68'),_0x5da5('0x69'),_0x5da5('0x6a'),'CampaignId','createdAt',_0x5da5('0x6b')],squel[_0x5da5('0x6c')]()[_0x5da5('0x6d')](_0x5da5('0x6e'),_0x5da5('0x6e'))[_0x5da5('0x6d')]('NOW()',_0x5da5('0x68'))['field']('id',_0x5da5('0x69'))[_0x5da5('0x6d')](_0x19ec84[_0x5da5('0x6f')]['toString'](),'ListId')[_0x5da5('0x6d')](_0x4814d5[_0x5da5('0x43')]['id'][_0x5da5('0x70')](),_0x5da5('0x58'))[_0x5da5('0x6d')]('NOW()','createdAt')[_0x5da5('0x6d')]('NOW()',_0x5da5('0x6b'))[_0x5da5('0x71')](_0x5da5('0x72'))[_0x5da5('0x37')](_0x5da5('0x73'))[_0x5da5('0x37')](_0x5da5('0x74'),_0x19ec84['CmListId'][_0x5da5('0x70')]())[_0x5da5('0x37')](_0x5da5('0x75'))[_0x5da5('0x37')](_0x5da5('0x76'),squel['select']()[_0x5da5('0x6d')](_0x5da5('0x77'))[_0x5da5('0x71')](_0x5da5('0x78'))[_0x5da5('0x37')]('CampaignId\x20=\x20?',_0x4814d5[_0x5da5('0x43')]['id'][_0x5da5('0x70')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x5da5('0x6d')](_0x5da5('0x79'))[_0x5da5('0x71')]('cm_hopper')[_0x5da5('0x37')](_0x5da5('0x7a'),_0x4814d5['params']['id'][_0x5da5('0x70')]())))[_0x5da5('0x70')]();break;case _0x5da5('0x7b'):_0x4ccfbc=squel[_0x5da5('0x65')]()['into'](_0x5da5('0x7c'))['fromQuery']([_0x5da5('0x6e'),_0x5da5('0x68'),'ContactId',_0x5da5('0x6a'),_0x5da5('0x58'),_0x5da5('0x51'),_0x5da5('0x6b')],squel[_0x5da5('0x6c')]()[_0x5da5('0x6d')](_0x5da5('0x6e'),_0x5da5('0x6e'))[_0x5da5('0x6d')](_0x5da5('0x7d'),_0x5da5('0x68'))[_0x5da5('0x6d')]('id',_0x5da5('0x69'))[_0x5da5('0x6d')](_0x19ec84[_0x5da5('0x6f')][_0x5da5('0x70')](),_0x5da5('0x6a'))[_0x5da5('0x6d')](_0x4814d5[_0x5da5('0x43')]['id'][_0x5da5('0x70')](),_0x5da5('0x58'))[_0x5da5('0x6d')](_0x5da5('0x7d'),_0x5da5('0x51'))[_0x5da5('0x6d')](_0x5da5('0x7d'),_0x5da5('0x6b'))[_0x5da5('0x71')](_0x5da5('0x72'))[_0x5da5('0x37')](_0x5da5('0x73'))[_0x5da5('0x37')](_0x5da5('0x74'),_0x19ec84[_0x5da5('0x6f')][_0x5da5('0x70')]())[_0x5da5('0x37')](_0x5da5('0x75'))[_0x5da5('0x37')](_0x5da5('0x76'),squel[_0x5da5('0x6c')]()['field']('COALESCE(phone,\x27\x27)')[_0x5da5('0x71')](_0x5da5('0x7c'))['where']('CampaignId\x20=\x20?',_0x4814d5[_0x5da5('0x43')]['id'][_0x5da5('0x70')]())))[_0x5da5('0x70')]();break;default:_0x4ccfbc=squel[_0x5da5('0x65')]()[_0x5da5('0x66')](_0x5da5('0x7c'))[_0x5da5('0x67')](['phone',_0x5da5('0x68'),_0x5da5('0x69'),_0x5da5('0x6a'),_0x5da5('0x58'),_0x5da5('0x51'),'updatedAt'],squel['select']()[_0x5da5('0x6d')](_0x5da5('0x6e'),'phone')['field'](_0x5da5('0x7d'),_0x5da5('0x68'))[_0x5da5('0x6d')]('id','ContactId')[_0x5da5('0x6d')](_0x19ec84[_0x5da5('0x6f')]['toString'](),'ListId')[_0x5da5('0x6d')](_0x4814d5[_0x5da5('0x43')]['id'][_0x5da5('0x70')](),_0x5da5('0x58'))[_0x5da5('0x6d')](_0x5da5('0x7d'),_0x5da5('0x51'))['field'](_0x5da5('0x7d'),'updatedAt')[_0x5da5('0x71')](_0x5da5('0x72'))[_0x5da5('0x37')](_0x5da5('0x73'))[_0x5da5('0x37')](_0x5da5('0x74'),_0x19ec84[_0x5da5('0x6f')][_0x5da5('0x70')]())[_0x5da5('0x37')](_0x5da5('0x75')))[_0x5da5('0x70')]();}_0x45fdc3['push'](db[_0x5da5('0x7e')][_0x5da5('0x30')](_0x4ccfbc));}return BPromise[_0x5da5('0x7f')](_0x45fdc3);}})['then'](function(){return _0x2441bb;})[_0x5da5('0x21')](respondWithResult(_0x17c226,null))[_0x5da5('0x41')](handleError(_0x17c226,null));};exports[_0x5da5('0x80')]=function(_0x1c1b7a,_0x1fe408,_0x121da7){return db[_0x5da5('0x2a')]['find']({'where':{'id':_0x1c1b7a['params']['id']}})[_0x5da5('0x21')](handleEntityNotFound(_0x1fe408,null))[_0x5da5('0x21')](function(_0x1fc126){if(_0x1fc126){return _0x1fc126[_0x5da5('0x80')](_0x1c1b7a['query'][_0x5da5('0x61')]);}})[_0x5da5('0x21')](function(_0x5705ab){if(_0x5705ab){return db[_0x5da5('0x59')][_0x5da5('0x22')]({'where':{'ListId':_0x1c1b7a[_0x5da5('0x30')]['ids'],'CampaignId':_0x1c1b7a[_0x5da5('0x43')]['id']}})[_0x5da5('0x21')](function(){return _0x5705ab;});}})['then'](respondWithStatusCode(_0x1fe408,null))[_0x5da5('0x41')](handleError(_0x1fe408,null));};exports[_0x5da5('0x81')]=function(_0x3dad2d,_0x11e1b7,_0x469673){var _0x4ead9d={'raw':!![],'where':{}};var _0x13b785={};var _0x255556={'count':0x0,'rows':[]};return db[_0x5da5('0x2a')][_0x5da5('0x56')]({'where':{'id':_0x3dad2d[_0x5da5('0x43')]['id']}})[_0x5da5('0x21')](handleEntityNotFound(_0x11e1b7,null))[_0x5da5('0x21')](function(_0x5471f2){if(_0x5471f2){_0x13b785['model']=_['keys'](db[_0x5da5('0x82')][_0x5da5('0x44')]);_0x13b785['query']=_[_0x5da5('0x2e')](_0x3dad2d['query']);_0x13b785['filters']=_[_0x5da5('0x2f')](_0x13b785['model'],_0x13b785[_0x5da5('0x30')]);_0x4ead9d['attributes']=_[_0x5da5('0x2f')](_0x13b785[_0x5da5('0x2d')],qs['fields'](_0x3dad2d[_0x5da5('0x30')][_0x5da5('0x32')]));_0x4ead9d[_0x5da5('0x31')]=_0x4ead9d[_0x5da5('0x31')][_0x5da5('0x33')]?_0x4ead9d[_0x5da5('0x31')]:_0x13b785['model'];if(!_0x3dad2d['query'][_0x5da5('0x34')](_0x5da5('0x35'))){_0x4ead9d['limit']=qs[_0x5da5('0x1c')](_0x3dad2d[_0x5da5('0x30')][_0x5da5('0x1c')]);_0x4ead9d['offset']=qs['offset'](_0x3dad2d['query'][_0x5da5('0x1b')]);}_0x4ead9d[_0x5da5('0x36')]=qs[_0x5da5('0x57')](_0x3dad2d[_0x5da5('0x30')]['sort']);_0x4ead9d[_0x5da5('0x37')]=qs[_0x5da5('0x38')](_[_0x5da5('0x39')](_0x3dad2d[_0x5da5('0x30')],_0x13b785['filters']));_0x4ead9d['where'][_0x5da5('0x58')]=_0x5471f2['id'];if(_0x3dad2d[_0x5da5('0x30')][_0x5da5('0x3a')]){_0x4ead9d['where']=_[_0x5da5('0x4f')](_0x4ead9d[_0x5da5('0x37')],{'$or':_['map'](_0x4ead9d['attributes'],function(_0x179867){var _0x58424b={};_0x58424b[_0x179867]={'$like':'%'+_0x3dad2d[_0x5da5('0x30')][_0x5da5('0x3a')]+'%'};return _0x58424b;})});}_0x4ead9d=_[_0x5da5('0x4f')]({},_0x4ead9d,_0x3dad2d[_0x5da5('0x3c')]);return db['CmList']['count']({'where':_0x4ead9d[_0x5da5('0x37')]})[_0x5da5('0x21')](function(_0x206b3b){_0x255556[_0x5da5('0x3d')]=_0x206b3b;if(_0x3dad2d[_0x5da5('0x30')][_0x5da5('0x3e')]){_0x4ead9d[_0x5da5('0x45')]=[{'all':!![]}];}return db[_0x5da5('0x82')]['findAll'](_0x4ead9d);})[_0x5da5('0x21')](function(_0x87baed){_0x255556['rows']=_0x87baed;return _0x255556;});}})['then'](respondWithFilteredResult(_0x11e1b7,_0x4ead9d))[_0x5da5('0x41')](handleError(_0x11e1b7,null));};exports[_0x5da5('0x83')]=function(_0x5d36fb,_0x663647,_0x4635ed){var _0x596d96,_0x104190;return db['Campaign'][_0x5da5('0x46')]({'where':{'id':_0x5d36fb[_0x5da5('0x43')]['id']}})[_0x5da5('0x21')](handleEntityNotFound(_0x663647,null))[_0x5da5('0x21')](function(_0x508643){if(_0x508643){_0x104190=_0x508643;return _0x508643[_0x5da5('0x83')](_0x5d36fb[_0x5da5('0x48')][_0x5da5('0x61')],_[_0x5da5('0x50')](_0x5d36fb['body'],[_0x5da5('0x61'),'id'])||{});}return null;})[_0x5da5('0x62')](function(_0x506704){var _0x2f94f2;_0x596d96=_0x506704||[];var _0x166b28=[];if(_0x506704){for(var _0x3c2680=0x0;_0x3c2680<_0x506704[_0x5da5('0x33')];_0x3c2680+=0x1){var _0x2372ce=_0x506704[_0x3c2680][_0x5da5('0x4a')]({'plain':!![]});_0x2f94f2=squel[_0x5da5('0x65')]()[_0x5da5('0x66')](_0x5da5('0x84'))[_0x5da5('0x67')]([_0x5da5('0x6e'),_0x5da5('0x69'),_0x5da5('0x6a'),'CampaignId','createdAt','updatedAt'],squel['select']()[_0x5da5('0x6d')](_0x5da5('0x6e'),'phone')['field']('id',_0x5da5('0x69'))['field'](_0x2372ce[_0x5da5('0x6f')][_0x5da5('0x70')](),'ListId')[_0x5da5('0x6d')](_0x5d36fb['params']['id'][_0x5da5('0x70')](),_0x5da5('0x58'))[_0x5da5('0x6d')]('NOW()','createdAt')[_0x5da5('0x6d')](_0x5da5('0x7d'),_0x5da5('0x6b'))[_0x5da5('0x71')](_0x5da5('0x72'))[_0x5da5('0x37')](_0x5da5('0x73'))[_0x5da5('0x37')](_0x5da5('0x74'),_0x2372ce[_0x5da5('0x6f')]['toString']())[_0x5da5('0x37')](_0x5da5('0x75')))[_0x5da5('0x70')]();_0x166b28['push'](db[_0x5da5('0x7e')][_0x5da5('0x30')](_0x2f94f2));}return BPromise['all'](_0x166b28);}})[_0x5da5('0x21')](function(){return _0x596d96;})['then'](respondWithResult(_0x663647,null))[_0x5da5('0x41')](handleError(_0x663647,null));};exports[_0x5da5('0x85')]=function(_0x3378aa,_0x955466,_0x37a270){return db[_0x5da5('0x2a')]['find']({'where':{'id':_0x3378aa['params']['id']}})[_0x5da5('0x21')](handleEntityNotFound(_0x955466,null))[_0x5da5('0x21')](function(_0x53f8b5){if(_0x53f8b5){return _0x53f8b5[_0x5da5('0x85')](_0x3378aa[_0x5da5('0x30')][_0x5da5('0x61')]);}})['then'](function(_0x33c78f){if(_0x33c78f){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x3378aa[_0x5da5('0x30')][_0x5da5('0x61')],'CampaignId':_0x3378aa['params']['id']}})[_0x5da5('0x21')](function(){return _0x33c78f;});}})['then'](respondWithStatusCode(_0x955466,null))[_0x5da5('0x41')](handleError(_0x955466,null));}; \ No newline at end of file +var _0xec56=['dialCheckDuplicateType','always','insert','cm_hopper','phone','ContactId','ListId','select','field','NOW()','scheduledAt','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','into','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','push','sequelize','all','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','zip-dir','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/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','index','map','Campaign','rawAttributes','fieldName','type','model','keys','query','intersection','fields','attributes','length','nolimit','order','sort','pick','filters','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','clone','createdAt','updatedAt','role','IvrCampaigns','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','hasOwnProperty','CampaignId','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','omit','ids','spread'];(function(_0x260ef1,_0x32a972){var _0x5bd4c1=function(_0x447dcb){while(--_0x447dcb){_0x260ef1['push'](_0x260ef1['shift']());}};_0x5bd4c1(++_0x32a972);}(_0xec56,0x1bd));var _0x6ec5=function(_0x537d1c,_0x3d9cd5){_0x537d1c=_0x537d1c-0x0;var _0x3beb37=_0xec56[_0x537d1c];return _0x3beb37;};'use strict';var pdf=require(_0x6ec5('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6ec5('0x1'));var jsonpatch=require(_0x6ec5('0x2'));var rp=require(_0x6ec5('0x3'));var moment=require(_0x6ec5('0x4'));var BPromise=require(_0x6ec5('0x5'));var Mustache=require(_0x6ec5('0x6'));var util=require(_0x6ec5('0x7'));var path=require(_0x6ec5('0x8'));var sox=require(_0x6ec5('0x9'));var csv=require(_0x6ec5('0xa'));var ejs=require(_0x6ec5('0xb'));var fs=require('fs');var _=require(_0x6ec5('0xc'));var squel=require(_0x6ec5('0xd'));var crypto=require(_0x6ec5('0xe'));var jsforce=require(_0x6ec5('0xf'));var deskjs=require(_0x6ec5('0x10'));var toCsv=require(_0x6ec5('0xa'));var querystring=require(_0x6ec5('0x11'));var Papa=require(_0x6ec5('0x12'));var Redis=require('ioredis');var authService=require(_0x6ec5('0x13'));var qs=require(_0x6ec5('0x14'));var as=require(_0x6ec5('0x15'));var hardwareService=require(_0x6ec5('0x16'));var logger=require(_0x6ec5('0x17'))(_0x6ec5('0x18'));var utils=require(_0x6ec5('0x19'));var config=require('../../config/environment');var db=require(_0x6ec5('0x1a'))['db'];function respondWithStatusCode(_0x1d7180,_0x2b1f61){_0x2b1f61=_0x2b1f61||0xcc;return function(_0xb04ab6){if(_0xb04ab6){return _0x1d7180[_0x6ec5('0x1b')](_0x2b1f61);}return _0x1d7180[_0x6ec5('0x1c')](_0x2b1f61)[_0x6ec5('0x1d')]();};}function respondWithResult(_0x39125b,_0x5166ad){_0x5166ad=_0x5166ad||0xc8;return function(_0x3ed07a){if(_0x3ed07a){return _0x39125b['status'](_0x5166ad)[_0x6ec5('0x1e')](_0x3ed07a);}};}function respondWithFilteredResult(_0x287542,_0x4a4e3c){return function(_0x9fc0e7){if(_0x9fc0e7){var _0xdc0b10=_0x9fc0e7[_0x6ec5('0x1f')],_0x4d09fe=_0x4a4e3c[_0x6ec5('0x20')],_0x13b725=_0x4a4e3c[_0x6ec5('0x20')]+_0x4a4e3c[_0x6ec5('0x21')],_0x3df696;if(_0x13b725>=_0xdc0b10){_0x13b725=_0xdc0b10;_0x3df696=0xc8;}else{_0x3df696=0xce;}_0x287542[_0x6ec5('0x1c')](_0x3df696);return _0x287542[_0x6ec5('0x22')](_0x6ec5('0x23'),_0x4d09fe+'-'+_0x13b725+'/'+_0xdc0b10)[_0x6ec5('0x1e')](_0x9fc0e7);}return null;};}function patchUpdates(_0x17f7a2){return function(_0x45c230){try{jsonpatch[_0x6ec5('0x24')](_0x45c230,_0x17f7a2,!![]);}catch(_0x2228dd){return BPromise[_0x6ec5('0x25')](_0x2228dd);}return _0x45c230[_0x6ec5('0x26')]();};}function saveUpdates(_0x12ba7f,_0x4abd5d){return function(_0x272532){if(_0x272532){return _0x272532[_0x6ec5('0x27')](_0x12ba7f)[_0x6ec5('0x28')](function(_0x20f5a6){return _0x20f5a6;});}return null;};}function removeEntity(_0x3fc9d7,_0x38a821){return function(_0x18243f){if(_0x18243f){return _0x18243f['destroy']()[_0x6ec5('0x28')](function(){var _0x2ecdcf=_0x18243f[_0x6ec5('0x29')]({'plain':!![]});var _0x1560c6='IvrCampaigns';return db[_0x6ec5('0x2a')][_0x6ec5('0x2b')]({'where':{'type':_0x1560c6,'resourceId':_0x2ecdcf['id']}})['then'](function(){return _0x18243f;});})[_0x6ec5('0x28')](function(){_0x3fc9d7[_0x6ec5('0x1c')](0xcc)[_0x6ec5('0x1d')]();});}};}function handleEntityNotFound(_0x5078e8,_0x1b779a){return function(_0xd0e8d7){if(!_0xd0e8d7){_0x5078e8[_0x6ec5('0x1b')](0x194);}return _0xd0e8d7;};}function handleError(_0x462488,_0x425fac){_0x425fac=_0x425fac||0x1f4;return function(_0x484847){logger[_0x6ec5('0x2c')](_0x484847[_0x6ec5('0x2d')]);if(_0x484847['name']){delete _0x484847[_0x6ec5('0x2e')];}_0x462488[_0x6ec5('0x1c')](_0x425fac)['send'](_0x484847);};}exports[_0x6ec5('0x2f')]=function(_0x3229db,_0x3bbf16){var _0xa227ff={},_0x116659={},_0x5a30ba={'count':0x0,'rows':[]};var _0x2b8c99=_[_0x6ec5('0x30')](db[_0x6ec5('0x31')][_0x6ec5('0x32')],function(_0x3e6d33){return{'name':_0x3e6d33[_0x6ec5('0x33')],'type':_0x3e6d33[_0x6ec5('0x34')]['key']};});_0x116659[_0x6ec5('0x35')]=_['map'](_0x2b8c99,_0x6ec5('0x2e'));_0x116659['query']=_[_0x6ec5('0x36')](_0x3229db[_0x6ec5('0x37')]);_0x116659['filters']=_['intersection'](_0x116659[_0x6ec5('0x35')],_0x116659[_0x6ec5('0x37')]);_0xa227ff['attributes']=_[_0x6ec5('0x38')](_0x116659[_0x6ec5('0x35')],qs['fields'](_0x3229db[_0x6ec5('0x37')][_0x6ec5('0x39')]));_0xa227ff[_0x6ec5('0x3a')]=_0xa227ff[_0x6ec5('0x3a')][_0x6ec5('0x3b')]?_0xa227ff[_0x6ec5('0x3a')]:_0x116659[_0x6ec5('0x35')];if(!_0x3229db[_0x6ec5('0x37')]['hasOwnProperty'](_0x6ec5('0x3c'))){_0xa227ff['limit']=qs[_0x6ec5('0x21')](_0x3229db[_0x6ec5('0x37')][_0x6ec5('0x21')]);_0xa227ff[_0x6ec5('0x20')]=qs[_0x6ec5('0x20')](_0x3229db[_0x6ec5('0x37')][_0x6ec5('0x20')]);}_0xa227ff[_0x6ec5('0x3d')]=qs[_0x6ec5('0x3e')](_0x3229db[_0x6ec5('0x37')][_0x6ec5('0x3e')]);_0xa227ff['where']=qs['filters'](_[_0x6ec5('0x3f')](_0x3229db['query'],_0x116659[_0x6ec5('0x40')]));if(_0x3229db[_0x6ec5('0x37')][_0x6ec5('0x41')]){_0xa227ff[_0x6ec5('0x42')]=_[_0x6ec5('0x43')](_0xa227ff[_0x6ec5('0x42')],{'$or':_[_0x6ec5('0x30')](_0x2b8c99,function(_0x5a0a8c){if(_0x5a0a8c[_0x6ec5('0x34')]!==_0x6ec5('0x44')){var _0x42b134={};_0x42b134[_0x5a0a8c[_0x6ec5('0x2e')]]={'$like':'%'+_0x3229db[_0x6ec5('0x37')][_0x6ec5('0x41')]+'%'};return _0x42b134;}})});}_0xa227ff=_[_0x6ec5('0x43')]({},_0xa227ff,_0x3229db[_0x6ec5('0x45')]);var _0x17abcb={'where':_0xa227ff['where']};return db[_0x6ec5('0x31')]['count'](_0x17abcb)[_0x6ec5('0x28')](function(_0x58bdd0){_0x5a30ba[_0x6ec5('0x1f')]=_0x58bdd0;if(_0x3229db[_0x6ec5('0x37')]['includeAll']){_0xa227ff[_0x6ec5('0x46')]=[{'all':!![]}];}return db[_0x6ec5('0x31')][_0x6ec5('0x47')](_0xa227ff);})['then'](function(_0x2ebdd7){_0x5a30ba[_0x6ec5('0x48')]=_0x2ebdd7;return _0x5a30ba;})['then'](respondWithFilteredResult(_0x3bbf16,_0xa227ff))[_0x6ec5('0x49')](handleError(_0x3bbf16,null));};exports[_0x6ec5('0x4a')]=function(_0x22e6a2,_0xb8324){var _0x43d858={'raw':![],'where':{'id':_0x22e6a2[_0x6ec5('0x4b')]['id']}},_0x3744ab={};_0x3744ab[_0x6ec5('0x35')]=_[_0x6ec5('0x36')](db[_0x6ec5('0x31')][_0x6ec5('0x32')]);_0x3744ab['query']=_[_0x6ec5('0x36')](_0x22e6a2[_0x6ec5('0x37')]);_0x3744ab[_0x6ec5('0x40')]=_[_0x6ec5('0x38')](_0x3744ab['model'],_0x3744ab[_0x6ec5('0x37')]);_0x43d858[_0x6ec5('0x3a')]=_['intersection'](_0x3744ab[_0x6ec5('0x35')],qs['fields'](_0x22e6a2[_0x6ec5('0x37')][_0x6ec5('0x39')]));_0x43d858[_0x6ec5('0x3a')]=_0x43d858[_0x6ec5('0x3a')]['length']?_0x43d858['attributes']:_0x3744ab[_0x6ec5('0x35')];if(_0x22e6a2['query'][_0x6ec5('0x4c')]){_0x43d858[_0x6ec5('0x46')]=[{'all':!![]}];}_0x43d858=_[_0x6ec5('0x43')]({},_0x43d858,_0x22e6a2[_0x6ec5('0x45')]);return db[_0x6ec5('0x31')]['find'](_0x43d858)['then'](handleEntityNotFound(_0xb8324,null))[_0x6ec5('0x28')](respondWithResult(_0xb8324,null))[_0x6ec5('0x49')](handleError(_0xb8324,null));};exports[_0x6ec5('0x4d')]=function(_0x45972a,_0x3ec67a){return db[_0x6ec5('0x31')][_0x6ec5('0x4d')](_0x45972a[_0x6ec5('0x4e')],{})[_0x6ec5('0x28')](function(_0xb3c5b4){var _0xd265c=_0x45972a[_0x6ec5('0x4f')][_0x6ec5('0x29')]({'plain':!![]});if(!_0xd265c)throw new Error(_0x6ec5('0x50'));if(_0xd265c['role']===_0x6ec5('0x4f')){var _0x51709d=_0xb3c5b4[_0x6ec5('0x29')]({'plain':!![]});var _0x1ebdf3='IvrCampaigns';return db[_0x6ec5('0x51')][_0x6ec5('0x52')]({'where':{'name':_0x1ebdf3,'userProfileId':_0xd265c['userProfileId']},'raw':!![]})[_0x6ec5('0x28')](function(_0x21a910){if(_0x21a910&&_0x21a910['autoAssociation']===0x0){return db['UserProfileResource'][_0x6ec5('0x4d')]({'name':_0x51709d['name'],'resourceId':_0x51709d['id'],'type':_0x21a910['name'],'sectionId':_0x21a910['id']},{})[_0x6ec5('0x28')](function(){return _0xb3c5b4;});}else{return _0xb3c5b4;}})[_0x6ec5('0x49')](function(_0x337608){logger[_0x6ec5('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x337608);throw _0x337608;});}return _0xb3c5b4;})[_0x6ec5('0x28')](respondWithResult(_0x3ec67a,0xc9))[_0x6ec5('0x49')](handleError(_0x3ec67a,null));};exports[_0x6ec5('0x53')]=function(_0x33ec4b,_0x9bde51){var _0x45431a={'where':{'id':_0x33ec4b[_0x6ec5('0x4b')]['id']}},_0x15c0d7={};_0x15c0d7[_0x6ec5('0x35')]=_[_0x6ec5('0x36')](db[_0x6ec5('0x31')][_0x6ec5('0x32')]);_0x45431a[_0x6ec5('0x3a')]=_['intersection'](_0x15c0d7[_0x6ec5('0x35')],qs[_0x6ec5('0x39')](_0x33ec4b['query'][_0x6ec5('0x39')]));_0x45431a[_0x6ec5('0x3a')]=_0x45431a[_0x6ec5('0x3a')][_0x6ec5('0x3b')]?_0x45431a[_0x6ec5('0x3a')]:_0x15c0d7['model'];if(_0x33ec4b['query'][_0x6ec5('0x4c')]){_0x45431a['include']=[{'all':!![]}];}_0x45431a=_[_0x6ec5('0x43')]({},_0x45431a,_0x33ec4b[_0x6ec5('0x45')]);return db[_0x6ec5('0x31')][_0x6ec5('0x52')](_0x45431a)[_0x6ec5('0x28')](handleEntityNotFound(_0x9bde51,null))['then'](function(_0xa00917){if(_0xa00917){var _0x4838a9=_0xa00917['get']({'plain':!![]});_0x4838a9=qs['omit'](_0x4838a9,['id',_0x6ec5('0x54'),_0x6ec5('0x55')]);_0x33ec4b['body']=_['omit'](_0x33ec4b[_0x6ec5('0x4e')],['id',_0x6ec5('0x54'),_0x6ec5('0x55')]);return db[_0x6ec5('0x31')][_0x6ec5('0x4d')](_['merge'](_0x4838a9,_0x33ec4b[_0x6ec5('0x4e')]),{'include':_0x33ec4b[_0x6ec5('0x37')][_0x6ec5('0x4c')]?[{'all':!![]}]:undefined})[_0x6ec5('0x28')](function(_0x156964){var _0x522966=_0x33ec4b[_0x6ec5('0x4f')][_0x6ec5('0x29')]({'plain':!![]});if(!_0x522966)throw new Error(_0x6ec5('0x50'));if(_0x522966[_0x6ec5('0x56')]===_0x6ec5('0x4f')){var _0xe8a888=_0x156964[_0x6ec5('0x29')]({'plain':!![]});var _0x13bba8=_0x6ec5('0x57');return db[_0x6ec5('0x51')][_0x6ec5('0x52')]({'where':{'name':_0x13bba8,'userProfileId':_0x522966[_0x6ec5('0x58')]},'raw':!![]})[_0x6ec5('0x28')](function(_0x131ef3){if(_0x131ef3&&_0x131ef3[_0x6ec5('0x59')]===0x0){return db[_0x6ec5('0x2a')][_0x6ec5('0x4d')]({'name':_0xe8a888['name'],'resourceId':_0xe8a888['id'],'type':_0x131ef3[_0x6ec5('0x2e')],'sectionId':_0x131ef3['id']},{})['then'](function(){return _0x156964;});}else{return _0x156964;}})[_0x6ec5('0x49')](function(_0x48e8f8){logger['error'](_0x6ec5('0x5a'),_0x48e8f8);throw _0x48e8f8;});}return _0x156964;});}})[_0x6ec5('0x28')](respondWithResult(_0x9bde51,0xc9))[_0x6ec5('0x49')](handleError(_0x9bde51,null));};exports[_0x6ec5('0x27')]=function(_0x1d4424,_0x48b5a9){if(_0x1d4424[_0x6ec5('0x4e')]['id']){delete _0x1d4424[_0x6ec5('0x4e')]['id'];}return db[_0x6ec5('0x31')][_0x6ec5('0x52')]({'where':{'id':_0x1d4424[_0x6ec5('0x4b')]['id']}})['then'](handleEntityNotFound(_0x48b5a9,null))[_0x6ec5('0x28')](saveUpdates(_0x1d4424[_0x6ec5('0x4e')],null))[_0x6ec5('0x28')](respondWithResult(_0x48b5a9,null))[_0x6ec5('0x49')](handleError(_0x48b5a9,null));};exports['destroy']=function(_0xb7e429,_0x39f48a){return db['Campaign']['find']({'where':{'id':_0xb7e429[_0x6ec5('0x4b')]['id']}})[_0x6ec5('0x28')](handleEntityNotFound(_0x39f48a,null))[_0x6ec5('0x28')](removeEntity(_0x39f48a,null))[_0x6ec5('0x49')](handleError(_0x39f48a,null));};exports[_0x6ec5('0x5b')]=function(_0x24ccbf,_0x3233ab,_0x1cc56d){var _0xdfe6c6={'raw':!![],'where':{}};var _0x4208dd={};var _0x37503f={'count':0x0,'rows':[]};return db['Campaign'][_0x6ec5('0x5c')]({'where':{'id':_0x24ccbf[_0x6ec5('0x4b')]['id']}})[_0x6ec5('0x28')](handleEntityNotFound(_0x3233ab,null))[_0x6ec5('0x28')](function(_0x480f40){if(_0x480f40){_0x4208dd[_0x6ec5('0x35')]=_[_0x6ec5('0x36')](db[_0x6ec5('0x5d')][_0x6ec5('0x32')]);_0x4208dd['query']=_[_0x6ec5('0x36')](_0x24ccbf[_0x6ec5('0x37')]);_0x4208dd[_0x6ec5('0x40')]=_['intersection'](_0x4208dd['model'],_0x4208dd[_0x6ec5('0x37')]);_0xdfe6c6[_0x6ec5('0x3a')]=_['intersection'](_0x4208dd[_0x6ec5('0x35')],qs[_0x6ec5('0x39')](_0x24ccbf[_0x6ec5('0x37')][_0x6ec5('0x39')]));_0xdfe6c6['attributes']=_0xdfe6c6[_0x6ec5('0x3a')][_0x6ec5('0x3b')]?_0xdfe6c6[_0x6ec5('0x3a')]:_0x4208dd['model'];if(!_0x24ccbf[_0x6ec5('0x37')][_0x6ec5('0x5e')](_0x6ec5('0x3c'))){_0xdfe6c6[_0x6ec5('0x21')]=qs[_0x6ec5('0x21')](_0x24ccbf[_0x6ec5('0x37')][_0x6ec5('0x21')]);_0xdfe6c6[_0x6ec5('0x20')]=qs['offset'](_0x24ccbf[_0x6ec5('0x37')][_0x6ec5('0x20')]);}_0xdfe6c6['order']=qs['sort'](_0x24ccbf[_0x6ec5('0x37')][_0x6ec5('0x3e')]);_0xdfe6c6[_0x6ec5('0x42')]=qs['filters'](_[_0x6ec5('0x3f')](_0x24ccbf[_0x6ec5('0x37')],_0x4208dd[_0x6ec5('0x40')]));_0xdfe6c6[_0x6ec5('0x42')]['CampaignId']=_0x480f40['id'];if(_0x24ccbf[_0x6ec5('0x37')][_0x6ec5('0x41')]){_0xdfe6c6[_0x6ec5('0x42')]=_[_0x6ec5('0x43')](_0xdfe6c6[_0x6ec5('0x42')],{'$or':_[_0x6ec5('0x30')](_0xdfe6c6[_0x6ec5('0x3a')],function(_0x245fe6){var _0x16b3d8={};_0x16b3d8[_0x245fe6]={'$like':'%'+_0x24ccbf['query']['filter']+'%'};return _0x16b3d8;})});}_0xdfe6c6=_[_0x6ec5('0x43')]({},_0xdfe6c6,_0x24ccbf[_0x6ec5('0x45')]);return db[_0x6ec5('0x5d')]['count']({'where':_0xdfe6c6[_0x6ec5('0x42')]})['then'](function(_0x1c6f21){_0x37503f[_0x6ec5('0x1f')]=_0x1c6f21;if(_0x24ccbf['query']['includeAll']){_0xdfe6c6[_0x6ec5('0x46')]=[{'all':!![]}];}return db[_0x6ec5('0x5d')][_0x6ec5('0x47')](_0xdfe6c6);})[_0x6ec5('0x28')](function(_0x49a787){_0x37503f[_0x6ec5('0x48')]=_0x49a787;return _0x37503f;});}})[_0x6ec5('0x28')](respondWithFilteredResult(_0x3233ab,_0xdfe6c6))[_0x6ec5('0x49')](handleError(_0x3233ab,null));};exports['getHopperHistories']=function(_0x5befa3,_0x579490,_0x3a5b21){var _0x18fbea={'raw':!![],'where':{}};var _0x2a91a9={};var _0x97c2f8={'count':0x0,'rows':[]};return db[_0x6ec5('0x31')][_0x6ec5('0x5c')]({'where':{'id':_0x5befa3[_0x6ec5('0x4b')]['id']}})['then'](handleEntityNotFound(_0x579490,null))[_0x6ec5('0x28')](function(_0x5e6fad){if(_0x5e6fad){_0x2a91a9[_0x6ec5('0x35')]=_[_0x6ec5('0x36')](db['CmHopperHistory'][_0x6ec5('0x32')]);_0x2a91a9[_0x6ec5('0x37')]=_['keys'](_0x5befa3[_0x6ec5('0x37')]);_0x2a91a9[_0x6ec5('0x40')]=_['intersection'](_0x2a91a9[_0x6ec5('0x35')],_0x2a91a9[_0x6ec5('0x37')]);_0x18fbea[_0x6ec5('0x3a')]=_['intersection'](_0x2a91a9['model'],qs[_0x6ec5('0x39')](_0x5befa3[_0x6ec5('0x37')][_0x6ec5('0x39')]));_0x18fbea[_0x6ec5('0x3a')]=_0x18fbea[_0x6ec5('0x3a')][_0x6ec5('0x3b')]?_0x18fbea[_0x6ec5('0x3a')]:_0x2a91a9[_0x6ec5('0x35')];if(!_0x5befa3[_0x6ec5('0x37')][_0x6ec5('0x5e')](_0x6ec5('0x3c'))){_0x18fbea[_0x6ec5('0x21')]=qs[_0x6ec5('0x21')](_0x5befa3['query'][_0x6ec5('0x21')]);_0x18fbea[_0x6ec5('0x20')]=qs[_0x6ec5('0x20')](_0x5befa3[_0x6ec5('0x37')]['offset']);}_0x18fbea[_0x6ec5('0x3d')]=qs['sort'](_0x5befa3[_0x6ec5('0x37')][_0x6ec5('0x3e')]);_0x18fbea[_0x6ec5('0x42')]=qs[_0x6ec5('0x40')](_[_0x6ec5('0x3f')](_0x5befa3[_0x6ec5('0x37')],_0x2a91a9[_0x6ec5('0x40')]));_0x18fbea['where'][_0x6ec5('0x5f')]=_0x5e6fad['id'];if(_0x5befa3[_0x6ec5('0x37')]['filter']){_0x18fbea[_0x6ec5('0x42')]=_[_0x6ec5('0x43')](_0x18fbea[_0x6ec5('0x42')],{'$or':_[_0x6ec5('0x30')](_0x18fbea[_0x6ec5('0x3a')],function(_0x1b94a4){var _0xfbcf6={};_0xfbcf6[_0x1b94a4]={'$like':'%'+_0x5befa3[_0x6ec5('0x37')][_0x6ec5('0x41')]+'%'};return _0xfbcf6;})});}_0x18fbea=_[_0x6ec5('0x43')]({},_0x18fbea,_0x5befa3[_0x6ec5('0x45')]);return db[_0x6ec5('0x60')][_0x6ec5('0x1f')]({'where':_0x18fbea[_0x6ec5('0x42')]})[_0x6ec5('0x28')](function(_0x5e177b){_0x97c2f8[_0x6ec5('0x1f')]=_0x5e177b;if(_0x5befa3['query'][_0x6ec5('0x4c')]){_0x18fbea[_0x6ec5('0x46')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x6ec5('0x47')](_0x18fbea);})[_0x6ec5('0x28')](function(_0x1c173b){_0x97c2f8[_0x6ec5('0x48')]=_0x1c173b;return _0x97c2f8;});}})[_0x6ec5('0x28')](respondWithFilteredResult(_0x579490,_0x18fbea))[_0x6ec5('0x49')](handleError(_0x579490,null));};exports[_0x6ec5('0x61')]=function(_0x5a7fae,_0x3a6a9a,_0x2a58f5){var _0x363b4e={'raw':!![],'where':{}};var _0x1b4fb0={};var _0x4b54cb={'count':0x0,'rows':[]};return db[_0x6ec5('0x31')][_0x6ec5('0x5c')]({'where':{'id':_0x5a7fae['params']['id']}})['then'](handleEntityNotFound(_0x3a6a9a,null))[_0x6ec5('0x28')](function(_0x2a0609){if(_0x2a0609){_0x1b4fb0['model']=_[_0x6ec5('0x36')](db['CmHopperFinal'][_0x6ec5('0x32')]);_0x1b4fb0[_0x6ec5('0x37')]=_[_0x6ec5('0x36')](_0x5a7fae[_0x6ec5('0x37')]);_0x1b4fb0[_0x6ec5('0x40')]=_[_0x6ec5('0x38')](_0x1b4fb0[_0x6ec5('0x35')],_0x1b4fb0[_0x6ec5('0x37')]);_0x363b4e['attributes']=_[_0x6ec5('0x38')](_0x1b4fb0['model'],qs[_0x6ec5('0x39')](_0x5a7fae[_0x6ec5('0x37')][_0x6ec5('0x39')]));_0x363b4e[_0x6ec5('0x3a')]=_0x363b4e['attributes']['length']?_0x363b4e['attributes']:_0x1b4fb0[_0x6ec5('0x35')];if(!_0x5a7fae[_0x6ec5('0x37')][_0x6ec5('0x5e')](_0x6ec5('0x3c'))){_0x363b4e[_0x6ec5('0x21')]=qs['limit'](_0x5a7fae[_0x6ec5('0x37')]['limit']);_0x363b4e[_0x6ec5('0x20')]=qs[_0x6ec5('0x20')](_0x5a7fae[_0x6ec5('0x37')][_0x6ec5('0x20')]);}_0x363b4e['order']=qs[_0x6ec5('0x3e')](_0x5a7fae[_0x6ec5('0x37')][_0x6ec5('0x3e')]);_0x363b4e[_0x6ec5('0x42')]=qs[_0x6ec5('0x40')](_[_0x6ec5('0x3f')](_0x5a7fae['query'],_0x1b4fb0['filters']));_0x363b4e[_0x6ec5('0x42')][_0x6ec5('0x5f')]=_0x2a0609['id'];if(_0x5a7fae[_0x6ec5('0x37')][_0x6ec5('0x41')]){_0x363b4e[_0x6ec5('0x42')]=_[_0x6ec5('0x43')](_0x363b4e[_0x6ec5('0x42')],{'$or':_[_0x6ec5('0x30')](_0x363b4e[_0x6ec5('0x3a')],function(_0x391d39){var _0x57dd40={};_0x57dd40[_0x391d39]={'$like':'%'+_0x5a7fae[_0x6ec5('0x37')][_0x6ec5('0x41')]+'%'};return _0x57dd40;})});}_0x363b4e=_[_0x6ec5('0x43')]({},_0x363b4e,_0x5a7fae[_0x6ec5('0x45')]);return db['CmHopperFinal']['count']({'where':_0x363b4e[_0x6ec5('0x42')]})[_0x6ec5('0x28')](function(_0x57bf12){_0x4b54cb[_0x6ec5('0x1f')]=_0x57bf12;if(_0x5a7fae[_0x6ec5('0x37')][_0x6ec5('0x4c')]){_0x363b4e['include']=[{'all':!![]}];}return db[_0x6ec5('0x62')][_0x6ec5('0x47')](_0x363b4e);})['then'](function(_0x351941){_0x4b54cb['rows']=_0x351941;return _0x4b54cb;});}})['then'](respondWithFilteredResult(_0x3a6a9a,_0x363b4e))['catch'](handleError(_0x3a6a9a,null));};exports[_0x6ec5('0x63')]=function(_0x2ec313,_0x15fbea,_0x5c00c7){var _0x3f38ff={'raw':!![],'where':{}};var _0x28f3f2={};var _0x4711bd={'count':0x0,'rows':[]};return db[_0x6ec5('0x31')]['findOne']({'where':{'id':_0x2ec313[_0x6ec5('0x4b')]['id']}})[_0x6ec5('0x28')](handleEntityNotFound(_0x15fbea,null))[_0x6ec5('0x28')](function(_0x5b517c){if(_0x5b517c){_0x28f3f2[_0x6ec5('0x35')]=_[_0x6ec5('0x36')](db[_0x6ec5('0x64')][_0x6ec5('0x32')]);_0x28f3f2[_0x6ec5('0x37')]=_['keys'](_0x2ec313[_0x6ec5('0x37')]);_0x28f3f2[_0x6ec5('0x40')]=_[_0x6ec5('0x38')](_0x28f3f2[_0x6ec5('0x35')],_0x28f3f2[_0x6ec5('0x37')]);_0x3f38ff[_0x6ec5('0x3a')]=_[_0x6ec5('0x38')](_0x28f3f2[_0x6ec5('0x35')],qs[_0x6ec5('0x39')](_0x2ec313[_0x6ec5('0x37')][_0x6ec5('0x39')]));_0x3f38ff['attributes']=_0x3f38ff['attributes'][_0x6ec5('0x3b')]?_0x3f38ff[_0x6ec5('0x3a')]:_0x28f3f2[_0x6ec5('0x35')];if(!_0x2ec313['query'][_0x6ec5('0x5e')](_0x6ec5('0x3c'))){_0x3f38ff[_0x6ec5('0x21')]=qs[_0x6ec5('0x21')](_0x2ec313['query'][_0x6ec5('0x21')]);_0x3f38ff[_0x6ec5('0x20')]=qs['offset'](_0x2ec313[_0x6ec5('0x37')][_0x6ec5('0x20')]);}_0x3f38ff[_0x6ec5('0x3d')]=qs[_0x6ec5('0x3e')](_0x2ec313[_0x6ec5('0x37')][_0x6ec5('0x3e')]);_0x3f38ff[_0x6ec5('0x42')]=qs[_0x6ec5('0x40')](_[_0x6ec5('0x3f')](_0x2ec313[_0x6ec5('0x37')],_0x28f3f2[_0x6ec5('0x40')]));_0x3f38ff[_0x6ec5('0x42')][_0x6ec5('0x5f')]=_0x5b517c['id'];if(_0x2ec313[_0x6ec5('0x37')]['filter']){_0x3f38ff[_0x6ec5('0x42')]=_['merge'](_0x3f38ff[_0x6ec5('0x42')],{'$or':_[_0x6ec5('0x30')](_0x3f38ff[_0x6ec5('0x3a')],function(_0x3531bb){var _0x503b36={};_0x503b36[_0x3531bb]={'$like':'%'+_0x2ec313[_0x6ec5('0x37')]['filter']+'%'};return _0x503b36;})});}_0x3f38ff=_[_0x6ec5('0x43')]({},_0x3f38ff,_0x2ec313[_0x6ec5('0x45')]);return db[_0x6ec5('0x64')]['count']({'where':_0x3f38ff[_0x6ec5('0x42')]})[_0x6ec5('0x28')](function(_0x5d3f68){_0x4711bd[_0x6ec5('0x1f')]=_0x5d3f68;if(_0x2ec313['query'][_0x6ec5('0x4c')]){_0x3f38ff[_0x6ec5('0x46')]=[{'all':!![]}];}return db[_0x6ec5('0x64')]['findAll'](_0x3f38ff);})[_0x6ec5('0x28')](function(_0x83453e){_0x4711bd[_0x6ec5('0x48')]=_0x83453e;return _0x4711bd;});}})[_0x6ec5('0x28')](respondWithFilteredResult(_0x15fbea,_0x3f38ff))['catch'](handleError(_0x15fbea,null));};exports[_0x6ec5('0x65')]=function(_0x5d9639,_0x1c4a38,_0x1b9e0d){var _0x227438={};var _0x31ef77={};var _0x56ffc1;var _0x51d321;return db[_0x6ec5('0x31')][_0x6ec5('0x5c')]({'where':{'id':_0x5d9639[_0x6ec5('0x4b')]['id']}})[_0x6ec5('0x28')](handleEntityNotFound(_0x1c4a38,null))[_0x6ec5('0x28')](function(_0x55fa60){if(_0x55fa60){_0x56ffc1=_0x55fa60;_0x31ef77[_0x6ec5('0x35')]=_[_0x6ec5('0x36')](db[_0x6ec5('0x66')][_0x6ec5('0x32')]);_0x31ef77[_0x6ec5('0x37')]=_[_0x6ec5('0x36')](_0x5d9639[_0x6ec5('0x37')]);_0x31ef77[_0x6ec5('0x40')]=_[_0x6ec5('0x38')](_0x31ef77[_0x6ec5('0x35')],_0x31ef77[_0x6ec5('0x37')]);_0x227438[_0x6ec5('0x3a')]=_[_0x6ec5('0x38')](_0x31ef77[_0x6ec5('0x35')],qs[_0x6ec5('0x39')](_0x5d9639[_0x6ec5('0x37')]['fields']));_0x227438['attributes']=_0x227438[_0x6ec5('0x3a')][_0x6ec5('0x3b')]?_0x227438[_0x6ec5('0x3a')]:_0x31ef77[_0x6ec5('0x35')];_0x227438[_0x6ec5('0x3d')]=qs[_0x6ec5('0x3e')](_0x5d9639[_0x6ec5('0x37')][_0x6ec5('0x3e')]);_0x227438[_0x6ec5('0x42')]=qs[_0x6ec5('0x40')](_[_0x6ec5('0x3f')](_0x5d9639[_0x6ec5('0x37')],_0x31ef77[_0x6ec5('0x40')]));if(_0x5d9639[_0x6ec5('0x37')][_0x6ec5('0x41')]){_0x227438['where']=_[_0x6ec5('0x43')](_0x227438[_0x6ec5('0x42')],{'$or':_[_0x6ec5('0x30')](_0x227438[_0x6ec5('0x3a')],function(_0x1604ee){var _0x2dc668={};_0x2dc668[_0x1604ee]={'$like':'%'+_0x5d9639[_0x6ec5('0x37')][_0x6ec5('0x41')]+'%'};return _0x2dc668;})});}_0x227438=_[_0x6ec5('0x43')]({},_0x227438,_0x5d9639['options']);return _0x56ffc1[_0x6ec5('0x65')](_0x227438);}})[_0x6ec5('0x28')](function(_0x6fb129){if(_0x6fb129){_0x51d321=_0x6fb129['length'];if(!_0x5d9639[_0x6ec5('0x37')][_0x6ec5('0x5e')]('nolimit')){_0x227438['limit']=qs['limit'](_0x5d9639[_0x6ec5('0x37')][_0x6ec5('0x21')]);_0x227438['offset']=qs[_0x6ec5('0x20')](_0x5d9639['query'][_0x6ec5('0x20')]);}return _0x56ffc1[_0x6ec5('0x65')](_0x227438);}})['then'](function(_0x2dd3f7){if(_0x2dd3f7){return _0x2dd3f7?{'count':_0x51d321,'rows':_0x2dd3f7}:null;}})[_0x6ec5('0x28')](respondWithResult(_0x1c4a38,null))[_0x6ec5('0x49')](handleError(_0x1c4a38,null));};exports[_0x6ec5('0x67')]=function(_0x15e720,_0x40099c,_0x13f7b5){var _0x2512e9,_0x15df52;return db[_0x6ec5('0x31')][_0x6ec5('0x52')]({'where':{'id':_0x15e720['params']['id']}})[_0x6ec5('0x28')](handleEntityNotFound(_0x40099c,null))['then'](function(_0x27d5ec){if(_0x27d5ec){_0x15df52=_0x27d5ec;return _0x27d5ec[_0x6ec5('0x67')](_0x15e720[_0x6ec5('0x4e')]['ids'],_[_0x6ec5('0x68')](_0x15e720['body'],[_0x6ec5('0x69'),'id'])||{});}return null;})[_0x6ec5('0x6a')](function(_0x27a167){var _0x3bb33b;_0x2512e9=_0x27a167||[];var _0x2570c8=[];if(_0x27a167){for(var _0x281565=0x0;_0x281565<_0x27a167['length'];_0x281565+=0x1){var _0x4320b0=_0x27a167[_0x281565]['get']({'plain':!![]});_0x15df52[_0x6ec5('0x6b')]=_0x15e720[_0x6ec5('0x4e')][_0x6ec5('0x6b')]?_0x15e720[_0x6ec5('0x4e')]['dialCheckDuplicateType']:_0x15df52[_0x6ec5('0x6b')];switch(_0x15df52[_0x6ec5('0x6b')]){case _0x6ec5('0x6c'):_0x3bb33b=squel[_0x6ec5('0x6d')]()['into'](_0x6ec5('0x6e'))['fromQuery']([_0x6ec5('0x6f'),'scheduledAt',_0x6ec5('0x70'),_0x6ec5('0x71'),_0x6ec5('0x5f'),_0x6ec5('0x54'),_0x6ec5('0x55')],squel[_0x6ec5('0x72')]()[_0x6ec5('0x73')]('phone',_0x6ec5('0x6f'))[_0x6ec5('0x73')](_0x6ec5('0x74'),_0x6ec5('0x75'))[_0x6ec5('0x73')]('id',_0x6ec5('0x70'))[_0x6ec5('0x73')](_0x4320b0[_0x6ec5('0x76')]['toString'](),'ListId')[_0x6ec5('0x73')](_0x15e720['params']['id'][_0x6ec5('0x77')](),_0x6ec5('0x5f'))[_0x6ec5('0x73')]('NOW()',_0x6ec5('0x54'))['field'](_0x6ec5('0x74'),_0x6ec5('0x55'))[_0x6ec5('0x78')](_0x6ec5('0x79'))['where'](_0x6ec5('0x7a'))['where']('ListId\x20=\x20?',_0x4320b0['CmListId'][_0x6ec5('0x77')]())[_0x6ec5('0x42')]('phone\x20IS\x20NOT\x20NULL')[_0x6ec5('0x42')](_0x6ec5('0x7b'),squel[_0x6ec5('0x72')]()['field']('COALESCE(calleridnum,\x27\x27)')[_0x6ec5('0x78')](_0x6ec5('0x7c'))[_0x6ec5('0x42')](_0x6ec5('0x7d'),_0x15e720[_0x6ec5('0x4b')]['id'][_0x6ec5('0x77')]()))[_0x6ec5('0x42')](_0x6ec5('0x7b'),squel[_0x6ec5('0x72')]()['field'](_0x6ec5('0x7e'))[_0x6ec5('0x78')](_0x6ec5('0x6e'))['where']('CampaignId\x20=\x20?',_0x15e720[_0x6ec5('0x4b')]['id'][_0x6ec5('0x77')]())))[_0x6ec5('0x77')]();break;case _0x6ec5('0x7f'):_0x3bb33b=squel[_0x6ec5('0x6d')]()[_0x6ec5('0x80')](_0x6ec5('0x6e'))['fromQuery'](['phone','scheduledAt','ContactId','ListId',_0x6ec5('0x5f'),'createdAt',_0x6ec5('0x55')],squel[_0x6ec5('0x72')]()[_0x6ec5('0x73')](_0x6ec5('0x6f'),'phone')[_0x6ec5('0x73')](_0x6ec5('0x74'),_0x6ec5('0x75'))['field']('id','ContactId')[_0x6ec5('0x73')](_0x4320b0[_0x6ec5('0x76')][_0x6ec5('0x77')](),_0x6ec5('0x71'))['field'](_0x15e720[_0x6ec5('0x4b')]['id'][_0x6ec5('0x77')](),_0x6ec5('0x5f'))[_0x6ec5('0x73')]('NOW()','createdAt')['field'](_0x6ec5('0x74'),_0x6ec5('0x55'))[_0x6ec5('0x78')](_0x6ec5('0x79'))[_0x6ec5('0x42')](_0x6ec5('0x7a'))['where'](_0x6ec5('0x81'),_0x4320b0['CmListId'][_0x6ec5('0x77')]())[_0x6ec5('0x42')]('phone\x20IS\x20NOT\x20NULL')[_0x6ec5('0x42')](_0x6ec5('0x7b'),squel[_0x6ec5('0x72')]()[_0x6ec5('0x73')]('COALESCE(phone,\x27\x27)')[_0x6ec5('0x78')](_0x6ec5('0x6e'))['where'](_0x6ec5('0x7d'),_0x15e720[_0x6ec5('0x4b')]['id'][_0x6ec5('0x77')]())))[_0x6ec5('0x77')]();break;default:_0x3bb33b=squel[_0x6ec5('0x6d')]()['into'](_0x6ec5('0x6e'))['fromQuery']([_0x6ec5('0x6f'),_0x6ec5('0x75'),'ContactId',_0x6ec5('0x71'),_0x6ec5('0x5f'),'createdAt','updatedAt'],squel[_0x6ec5('0x72')]()[_0x6ec5('0x73')](_0x6ec5('0x6f'),'phone')[_0x6ec5('0x73')](_0x6ec5('0x74'),_0x6ec5('0x75'))[_0x6ec5('0x73')]('id',_0x6ec5('0x70'))[_0x6ec5('0x73')](_0x4320b0[_0x6ec5('0x76')][_0x6ec5('0x77')](),_0x6ec5('0x71'))[_0x6ec5('0x73')](_0x15e720[_0x6ec5('0x4b')]['id'][_0x6ec5('0x77')](),_0x6ec5('0x5f'))[_0x6ec5('0x73')](_0x6ec5('0x74'),_0x6ec5('0x54'))[_0x6ec5('0x73')](_0x6ec5('0x74'),_0x6ec5('0x55'))[_0x6ec5('0x78')]('cm_contacts')['where'](_0x6ec5('0x7a'))[_0x6ec5('0x42')](_0x6ec5('0x81'),_0x4320b0['CmListId'][_0x6ec5('0x77')]())[_0x6ec5('0x42')](_0x6ec5('0x82')))[_0x6ec5('0x77')]();}_0x2570c8[_0x6ec5('0x83')](db[_0x6ec5('0x84')][_0x6ec5('0x37')](_0x3bb33b));}return BPromise[_0x6ec5('0x85')](_0x2570c8);}})[_0x6ec5('0x28')](function(){return _0x2512e9;})[_0x6ec5('0x28')](respondWithResult(_0x40099c,null))[_0x6ec5('0x49')](handleError(_0x40099c,null));};exports['removeLists']=function(_0x93d730,_0x539477,_0x30fdeb){return db['Campaign'][_0x6ec5('0x52')]({'where':{'id':_0x93d730[_0x6ec5('0x4b')]['id']}})[_0x6ec5('0x28')](handleEntityNotFound(_0x539477,null))['then'](function(_0x17399e){if(_0x17399e){return _0x17399e['removeLists'](_0x93d730[_0x6ec5('0x37')][_0x6ec5('0x69')]);}})[_0x6ec5('0x28')](function(_0x52e7cb){if(_0x52e7cb){return db[_0x6ec5('0x5d')][_0x6ec5('0x2b')]({'where':{'ListId':_0x93d730[_0x6ec5('0x37')]['ids'],'CampaignId':_0x93d730[_0x6ec5('0x4b')]['id']}})[_0x6ec5('0x28')](function(){return _0x52e7cb;});}})[_0x6ec5('0x28')](respondWithStatusCode(_0x539477,null))[_0x6ec5('0x49')](handleError(_0x539477,null));};exports[_0x6ec5('0x86')]=function(_0x12a252,_0x5f4ad1,_0x21b69e){var _0x4c550f={'raw':!![],'where':{}};var _0x2e14c9={};var _0x10e4d7={'count':0x0,'rows':[]};return db[_0x6ec5('0x31')][_0x6ec5('0x5c')]({'where':{'id':_0x12a252[_0x6ec5('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5f4ad1,null))['then'](function(_0x4fb9c7){if(_0x4fb9c7){_0x2e14c9['model']=_[_0x6ec5('0x36')](db['CmList']['rawAttributes']);_0x2e14c9['query']=_[_0x6ec5('0x36')](_0x12a252[_0x6ec5('0x37')]);_0x2e14c9[_0x6ec5('0x40')]=_['intersection'](_0x2e14c9['model'],_0x2e14c9['query']);_0x4c550f[_0x6ec5('0x3a')]=_['intersection'](_0x2e14c9[_0x6ec5('0x35')],qs[_0x6ec5('0x39')](_0x12a252['query'][_0x6ec5('0x39')]));_0x4c550f[_0x6ec5('0x3a')]=_0x4c550f[_0x6ec5('0x3a')][_0x6ec5('0x3b')]?_0x4c550f[_0x6ec5('0x3a')]:_0x2e14c9['model'];if(!_0x12a252[_0x6ec5('0x37')]['hasOwnProperty'](_0x6ec5('0x3c'))){_0x4c550f[_0x6ec5('0x21')]=qs['limit'](_0x12a252[_0x6ec5('0x37')][_0x6ec5('0x21')]);_0x4c550f[_0x6ec5('0x20')]=qs[_0x6ec5('0x20')](_0x12a252['query'][_0x6ec5('0x20')]);}_0x4c550f['order']=qs[_0x6ec5('0x3e')](_0x12a252[_0x6ec5('0x37')][_0x6ec5('0x3e')]);_0x4c550f[_0x6ec5('0x42')]=qs[_0x6ec5('0x40')](_[_0x6ec5('0x3f')](_0x12a252[_0x6ec5('0x37')],_0x2e14c9[_0x6ec5('0x40')]));_0x4c550f[_0x6ec5('0x42')][_0x6ec5('0x5f')]=_0x4fb9c7['id'];if(_0x12a252[_0x6ec5('0x37')]['filter']){_0x4c550f['where']=_[_0x6ec5('0x43')](_0x4c550f[_0x6ec5('0x42')],{'$or':_[_0x6ec5('0x30')](_0x4c550f[_0x6ec5('0x3a')],function(_0x4c8fcd){var _0x96a4f9={};_0x96a4f9[_0x4c8fcd]={'$like':'%'+_0x12a252[_0x6ec5('0x37')][_0x6ec5('0x41')]+'%'};return _0x96a4f9;})});}_0x4c550f=_[_0x6ec5('0x43')]({},_0x4c550f,_0x12a252[_0x6ec5('0x45')]);return db['CmList']['count']({'where':_0x4c550f[_0x6ec5('0x42')]})[_0x6ec5('0x28')](function(_0x5e9bdb){_0x10e4d7[_0x6ec5('0x1f')]=_0x5e9bdb;if(_0x12a252[_0x6ec5('0x37')]['includeAll']){_0x4c550f[_0x6ec5('0x46')]=[{'all':!![]}];}return db[_0x6ec5('0x66')][_0x6ec5('0x47')](_0x4c550f);})['then'](function(_0x5d164f){_0x10e4d7[_0x6ec5('0x48')]=_0x5d164f;return _0x10e4d7;});}})[_0x6ec5('0x28')](respondWithFilteredResult(_0x5f4ad1,_0x4c550f))[_0x6ec5('0x49')](handleError(_0x5f4ad1,null));};exports[_0x6ec5('0x87')]=function(_0x2d1a4a,_0x48ba54,_0x5d2684){var _0x26971a,_0x44f6ad;return db[_0x6ec5('0x31')][_0x6ec5('0x52')]({'where':{'id':_0x2d1a4a[_0x6ec5('0x4b')]['id']}})[_0x6ec5('0x28')](handleEntityNotFound(_0x48ba54,null))[_0x6ec5('0x28')](function(_0x41169d){if(_0x41169d){_0x44f6ad=_0x41169d;return _0x41169d[_0x6ec5('0x87')](_0x2d1a4a['body'][_0x6ec5('0x69')],_[_0x6ec5('0x68')](_0x2d1a4a[_0x6ec5('0x4e')],['ids','id'])||{});}return null;})[_0x6ec5('0x6a')](function(_0x13a6c0){var _0x42ddd0;_0x26971a=_0x13a6c0||[];var _0x363e6a=[];if(_0x13a6c0){for(var _0x40beb9=0x0;_0x40beb9<_0x13a6c0[_0x6ec5('0x3b')];_0x40beb9+=0x1){var _0xf7f4f=_0x13a6c0[_0x40beb9][_0x6ec5('0x29')]({'plain':!![]});_0x42ddd0=squel[_0x6ec5('0x6d')]()[_0x6ec5('0x80')](_0x6ec5('0x88'))['fromQuery']([_0x6ec5('0x6f'),_0x6ec5('0x70'),_0x6ec5('0x71'),_0x6ec5('0x5f'),_0x6ec5('0x54'),'updatedAt'],squel[_0x6ec5('0x72')]()['field'](_0x6ec5('0x6f'),'phone')[_0x6ec5('0x73')]('id',_0x6ec5('0x70'))[_0x6ec5('0x73')](_0xf7f4f[_0x6ec5('0x76')][_0x6ec5('0x77')](),'ListId')[_0x6ec5('0x73')](_0x2d1a4a['params']['id']['toString'](),_0x6ec5('0x5f'))[_0x6ec5('0x73')](_0x6ec5('0x74'),'createdAt')[_0x6ec5('0x73')](_0x6ec5('0x74'),'updatedAt')['from']('cm_contacts')['where'](_0x6ec5('0x7a'))[_0x6ec5('0x42')](_0x6ec5('0x81'),_0xf7f4f[_0x6ec5('0x76')][_0x6ec5('0x77')]())['where'](_0x6ec5('0x82')))['toString']();_0x363e6a[_0x6ec5('0x83')](db['sequelize']['query'](_0x42ddd0));}return BPromise[_0x6ec5('0x85')](_0x363e6a);}})[_0x6ec5('0x28')](function(){return _0x26971a;})['then'](respondWithResult(_0x48ba54,null))[_0x6ec5('0x49')](handleError(_0x48ba54,null));};exports[_0x6ec5('0x89')]=function(_0x18e882,_0x2a4356,_0x51d75d){return db[_0x6ec5('0x31')][_0x6ec5('0x52')]({'where':{'id':_0x18e882[_0x6ec5('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2a4356,null))[_0x6ec5('0x28')](function(_0x312d2f){if(_0x312d2f){return _0x312d2f['removeBlackLists'](_0x18e882[_0x6ec5('0x37')]['ids']);}})['then'](function(_0x3cadea){if(_0x3cadea){return db[_0x6ec5('0x64')][_0x6ec5('0x2b')]({'where':{'ListId':_0x18e882[_0x6ec5('0x37')]['ids'],'CampaignId':_0x18e882[_0x6ec5('0x4b')]['id']}})[_0x6ec5('0x28')](function(){return _0x3cadea;});}})['then'](respondWithStatusCode(_0x2a4356,null))[_0x6ec5('0x49')](handleError(_0x2a4356,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 460e797..5970303 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 _0x6e9c=['../../config/environment','./campaign.attributes','define','Campaign','lodash','../../config/logger','api','moment','bluebird'];(function(_0x42e53e,_0x2ccbce){var _0x49d424=function(_0x49c5a6){while(--_0x49c5a6){_0x42e53e['push'](_0x42e53e['shift']());}};_0x49d424(++_0x2ccbce);}(_0x6e9c,0xa6));var _0xc6e9=function(_0x28b4d3,_0x2a68c0){_0x28b4d3=_0x28b4d3-0x0;var _0xbcb80e=_0x6e9c[_0x28b4d3];return _0xbcb80e;};'use strict';var _=require(_0xc6e9('0x0'));var util=require('util');var logger=require(_0xc6e9('0x1'))(_0xc6e9('0x2'));var moment=require(_0xc6e9('0x3'));var BPromise=require(_0xc6e9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc6e9('0x5'));var attributes=require(_0xc6e9('0x6'));module['exports']=function(_0x5ebca8,_0x562e90){return _0x5ebca8[_0xc6e9('0x7')](_0xc6e9('0x8'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdbe1=['path','../../config/environment','./campaign.attributes','exports','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x296897,_0x4d23ea){var _0x2b44ab=function(_0xdf90d8){while(--_0xdf90d8){_0x296897['push'](_0x296897['shift']());}};_0x2b44ab(++_0x4d23ea);}(_0xdbe1,0x16f));var _0x1dbe=function(_0x40661c,_0x57fb16){_0x40661c=_0x40661c-0x0;var _0x3c3046=_0xdbe1[_0x40661c];return _0x3c3046;};'use strict';var _=require(_0x1dbe('0x0'));var util=require(_0x1dbe('0x1'));var logger=require(_0x1dbe('0x2'))(_0x1dbe('0x3'));var moment=require(_0x1dbe('0x4'));var BPromise=require(_0x1dbe('0x5'));var rp=require(_0x1dbe('0x6'));var fs=require('fs');var path=require(_0x1dbe('0x7'));var rimraf=require('rimraf');var config=require(_0x1dbe('0x8'));var attributes=require(_0x1dbe('0x9'));module[_0x1dbe('0xa')]=function(_0x6251c2,_0x19d512){return _0x6251c2['define']('Campaign',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 bfec5e2..c3ed9bb 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 _0x9957=['catch','GetCampaign','findAll','raw','options','where','attributes','limit','map','include','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Campaign,\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);});});}exports[_0x7995('0x18')]=function(_0x291317){var _0x1e1415=this;return new Promise(function(_0x37a7d4,_0x4faa60){return db['Campaign'][_0x7995('0x19')]({'raw':_0x291317['options']?_0x291317['options'][_0x7995('0x1a')]===undefined?!![]:![]:!![],'where':_0x291317[_0x7995('0x1b')]?_0x291317['options'][_0x7995('0x1c')]||null:null,'attributes':_0x291317['options']?_0x291317['options'][_0x7995('0x1d')]||null:null,'limit':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')][_0x7995('0x1e')]||null:null,'include':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')]['include']?_[_0x7995('0x1f')](_0x291317[_0x7995('0x1b')][_0x7995('0x20')],function(_0x285437){return{'model':db[_0x285437[_0x7995('0x21')]],'as':_0x285437['as'],'attributes':_0x285437[_0x7995('0x1d')],'include':_0x285437[_0x7995('0x20')]?_[_0x7995('0x1f')](_0x285437['include'],function(_0x39df42){return{'model':db[_0x39df42[_0x7995('0x21')]],'as':_0x39df42['as'],'attributes':_0x39df42[_0x7995('0x1d')],'include':_0x39df42[_0x7995('0x20')]?_[_0x7995('0x1f')](_0x39df42[_0x7995('0x20')],function(_0x56691a){return{'model':db[_0x56691a[_0x7995('0x21')]],'as':_0x56691a['as'],'attributes':_0x56691a['attributes']};}):[]};}):[]};}):[]:[]})[_0x7995('0xc')](function(_0x49bc7e){logger[_0x7995('0xd')](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')]('GetCampaign',_0x291317,JSON[_0x7995('0x12')](_0x49bc7e));_0x37a7d4(_0x49bc7e);})['catch'](function(_0x456a28){logger[_0x7995('0x13')](_0x7995('0x18'),_0x456a28['message'],_0x291317);_0x4faa60(_0x1e1415['error'](0x1f4,_0x456a28['message']));});});}; \ No newline at end of file +var _0x9957=['catch','GetCampaign','findAll','raw','options','where','attributes','limit','map','include','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x387335,_0x1dbb1a){var _0x18bb1c=function(_0x2fdc5a){while(--_0x2fdc5a){_0x387335['push'](_0x387335['shift']());}};_0x18bb1c(++_0x1dbb1a);}(_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 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']('Campaign,\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);});});}exports[_0x7995('0x18')]=function(_0x291317){var _0x1e1415=this;return new Promise(function(_0x37a7d4,_0x4faa60){return db['Campaign'][_0x7995('0x19')]({'raw':_0x291317['options']?_0x291317['options'][_0x7995('0x1a')]===undefined?!![]:![]:!![],'where':_0x291317[_0x7995('0x1b')]?_0x291317['options'][_0x7995('0x1c')]||null:null,'attributes':_0x291317['options']?_0x291317['options'][_0x7995('0x1d')]||null:null,'limit':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')][_0x7995('0x1e')]||null:null,'include':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')]['include']?_[_0x7995('0x1f')](_0x291317[_0x7995('0x1b')][_0x7995('0x20')],function(_0x285437){return{'model':db[_0x285437[_0x7995('0x21')]],'as':_0x285437['as'],'attributes':_0x285437[_0x7995('0x1d')],'include':_0x285437[_0x7995('0x20')]?_[_0x7995('0x1f')](_0x285437['include'],function(_0x39df42){return{'model':db[_0x39df42[_0x7995('0x21')]],'as':_0x39df42['as'],'attributes':_0x39df42[_0x7995('0x1d')],'include':_0x39df42[_0x7995('0x20')]?_[_0x7995('0x1f')](_0x39df42[_0x7995('0x20')],function(_0x56691a){return{'model':db[_0x56691a[_0x7995('0x21')]],'as':_0x56691a['as'],'attributes':_0x56691a['attributes']};}):[]};}):[]};}):[]:[]})[_0x7995('0xc')](function(_0x49bc7e){logger[_0x7995('0xd')](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')]('GetCampaign',_0x291317,JSON[_0x7995('0x12')](_0x49bc7e));_0x37a7d4(_0x49bc7e);})['catch'](function(_0x456a28){logger[_0x7995('0x13')](_0x7995('0x18'),_0x456a28['message'],_0x291317);_0x4faa60(_0x1e1415['error'](0x1f4,_0x456a28['message']));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 3971885..e50c774 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 _0x609a=['/:id/hopper_black','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','put','delete','destroy','removeLists','removeBlackLists','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals'];(function(_0x809c3,_0x4ebf8b){var _0x4b3365=function(_0x3e8b83){while(--_0x3e8b83){_0x809c3['push'](_0x809c3['shift']());}};_0x4b3365(++_0x4ebf8b);}(_0x609a,0x1ec));var _0xa609=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x609a[_0x21a9d9];return _0x46adce;};'use strict';var multer=require(_0xa609('0x0'));var util=require(_0xa609('0x1'));var path=require(_0xa609('0x2'));var timeout=require(_0xa609('0x3'));var express=require(_0xa609('0x4'));var router=express[_0xa609('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xa609('0x6'));var config=require('../../config/environment');var controller=require(_0xa609('0x7'));router[_0xa609('0x8')]('/',auth[_0xa609('0x9')](),controller[_0xa609('0xa')]);router[_0xa609('0x8')](_0xa609('0xb'),auth[_0xa609('0x9')](),controller[_0xa609('0xc')]);router[_0xa609('0x8')](_0xa609('0xd'),auth[_0xa609('0x9')](),controller[_0xa609('0xe')]);router['get'](_0xa609('0xf'),auth['isAuthenticated'](),controller[_0xa609('0x10')]);router[_0xa609('0x8')](_0xa609('0x11'),auth[_0xa609('0x9')](),controller['getHopperFinals']);router[_0xa609('0x8')](_0xa609('0x12'),auth[_0xa609('0x9')](),controller['getHopperBlacks']);router[_0xa609('0x8')](_0xa609('0x13'),auth[_0xa609('0x9')](),controller[_0xa609('0x14')]);router[_0xa609('0x8')](_0xa609('0x15'),auth[_0xa609('0x9')](),controller[_0xa609('0x16')]);router[_0xa609('0x17')]('/',auth[_0xa609('0x9')](),controller[_0xa609('0x18')]);router['post'](_0xa609('0x19'),auth[_0xa609('0x9')](),controller[_0xa609('0x1a')]);router[_0xa609('0x17')](_0xa609('0x13'),auth[_0xa609('0x9')](),controller[_0xa609('0x1b')]);router[_0xa609('0x17')](_0xa609('0x15'),auth[_0xa609('0x9')](),controller[_0xa609('0x1c')]);router[_0xa609('0x1d')](_0xa609('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xa609('0x1e')](_0xa609('0xb'),auth[_0xa609('0x9')](),controller[_0xa609('0x1f')]);router[_0xa609('0x1e')](_0xa609('0x13'),auth['isAuthenticated'](),controller[_0xa609('0x20')]);router[_0xa609('0x1e')]('/:id/blacklists',auth[_0xa609('0x9')](),controller[_0xa609('0x21')]);module['exports']=router; \ No newline at end of file +var _0xf960=['getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addLists','addBlackLists','put','update','delete','destroy','exports','multer','path','express','Router','../../components/interaction/service','get','isAuthenticated','index','/:id','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/lists'];(function(_0x1ac6f3,_0x40a1ed){var _0x3dc511=function(_0x4986f5){while(--_0x4986f5){_0x1ac6f3['push'](_0x1ac6f3['shift']());}};_0x3dc511(++_0x40a1ed);}(_0xf960,0x193));var _0x0f96=function(_0x36436d,_0x20292c){_0x36436d=_0x36436d-0x0;var _0x34615d=_0xf960[_0x36436d];return _0x34615d;};'use strict';var multer=require(_0x0f96('0x0'));var util=require('util');var path=require(_0x0f96('0x1'));var timeout=require('connect-timeout');var express=require(_0x0f96('0x2'));var router=express[_0x0f96('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0f96('0x4'));var config=require('../../config/environment');var controller=require('./campaign.controller');router[_0x0f96('0x5')]('/',auth[_0x0f96('0x6')](),controller[_0x0f96('0x7')]);router[_0x0f96('0x5')](_0x0f96('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x0f96('0x5')](_0x0f96('0x9'),auth[_0x0f96('0x6')](),controller[_0x0f96('0xa')]);router[_0x0f96('0x5')](_0x0f96('0xb'),auth['isAuthenticated'](),controller[_0x0f96('0xc')]);router['get'](_0x0f96('0xd'),auth['isAuthenticated'](),controller[_0x0f96('0xe')]);router[_0x0f96('0x5')](_0x0f96('0xf'),auth[_0x0f96('0x6')](),controller['getHopperBlacks']);router[_0x0f96('0x5')](_0x0f96('0x10'),auth[_0x0f96('0x6')](),controller[_0x0f96('0x11')]);router['get'](_0x0f96('0x12'),auth[_0x0f96('0x6')](),controller[_0x0f96('0x13')]);router[_0x0f96('0x14')]('/',auth[_0x0f96('0x6')](),controller[_0x0f96('0x15')]);router['post'](_0x0f96('0x16'),auth['isAuthenticated'](),controller['clone']);router[_0x0f96('0x14')](_0x0f96('0x10'),auth[_0x0f96('0x6')](),controller[_0x0f96('0x17')]);router[_0x0f96('0x14')](_0x0f96('0x12'),auth[_0x0f96('0x6')](),controller[_0x0f96('0x18')]);router[_0x0f96('0x19')](_0x0f96('0x8'),auth[_0x0f96('0x6')](),controller[_0x0f96('0x1a')]);router[_0x0f96('0x1b')](_0x0f96('0x8'),auth['isAuthenticated'](),controller[_0x0f96('0x1c')]);router[_0x0f96('0x1b')](_0x0f96('0x10'),auth[_0x0f96('0x6')](),controller['removeLists']);router[_0x0f96('0x1b')](_0x0f96('0x12'),auth[_0x0f96('0x6')](),controller['removeBlackLists']);module[_0x0f96('0x1d')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index bcea098..652af6b 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 _0x6c94=['sequelize','exports','STRING','TEXT','VIRTUAL','key'];(function(_0x4b8bb3,_0x3decb0){var _0x31df17=function(_0x56a301){while(--_0x56a301){_0x4b8bb3['push'](_0x4b8bb3['shift']());}};_0x31df17(++_0x3decb0);}(_0x6c94,0x13e));var _0x46c9=function(_0x18b67b,_0x1ca89e){_0x18b67b=_0x18b67b-0x0;var _0x3c333d=_0x6c94[_0x18b67b];return _0x3c333d;};'use strict';var Sequelize=require(_0x46c9('0x0'));module[_0x46c9('0x1')]={'key':{'type':Sequelize[_0x46c9('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x46c9('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x46c9('0x2')]},'name':{'type':Sequelize[_0x46c9('0x4')],'get':function(){return this['getDataValue'](_0x46c9('0x5'));}}}; \ No newline at end of file +var _0x7aaf=['getDataValue','key','sequelize','exports','STRING'];(function(_0x2cf37b,_0x29ad6e){var _0x5b944e=function(_0x123f3d){while(--_0x123f3d){_0x2cf37b['push'](_0x2cf37b['shift']());}};_0x5b944e(++_0x29ad6e);}(_0x7aaf,0xbb));var _0xf7aa=function(_0x2bf706,_0x366989){_0x2bf706=_0x2bf706-0x0;var _0x59f9dc=_0x7aaf[_0x2bf706];return _0x59f9dc;};'use strict';var Sequelize=require(_0xf7aa('0x0'));module[_0xf7aa('0x1')]={'key':{'type':Sequelize[_0xf7aa('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xf7aa('0x3')](_0xf7aa('0x4'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 7ec8ad9..caade56 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 _0xa9e0=['filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','include','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','end','error','name','send','index','map','CannedAnswer','rawAttributes','type','key','model','query','keys'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');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 db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){var _0x38e7c4=_0x588269[_0x0a9e('0x21')]({'plain':!![]});var _0x4abc77=_0x0a9e('0x22');return db[_0x0a9e('0x23')][_0x0a9e('0x20')]({'where':{'type':_0x4abc77,'resourceId':_0x38e7c4['id']}})[_0x0a9e('0x1f')](function(){return _0x588269;});})[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x24')]();});}};}function handleEntityNotFound(_0x5ea472,_0x59181e){return function(_0x197ec0){if(!_0x197ec0){_0x5ea472[_0x0a9e('0x14')](0x194);}return _0x197ec0;};}function handleError(_0x40c424,_0x33161b){_0x33161b=_0x33161b||0x1f4;return function(_0x526cf3){logger[_0x0a9e('0x25')](_0x526cf3['stack']);if(_0x526cf3[_0x0a9e('0x26')]){delete _0x526cf3['name'];}_0x40c424[_0x0a9e('0x15')](_0x33161b)[_0x0a9e('0x27')](_0x526cf3);};}exports[_0x0a9e('0x28')]=function(_0x14433c,_0x140511){var _0x1538a4={},_0x11c3b6={},_0x14de77={'count':0x0,'rows':[]};var _0x5a101a=_[_0x0a9e('0x29')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')],function(_0x2ec755){return{'name':_0x2ec755['fieldName'],'type':_0x2ec755[_0x0a9e('0x2c')][_0x0a9e('0x2d')]};});_0x11c3b6[_0x0a9e('0x2e')]=_[_0x0a9e('0x29')](_0x5a101a,_0x0a9e('0x26'));_0x11c3b6[_0x0a9e('0x2f')]=_[_0x0a9e('0x30')](_0x14433c[_0x0a9e('0x2f')]);_0x11c3b6[_0x0a9e('0x31')]=_['intersection'](_0x11c3b6[_0x0a9e('0x2e')],_0x11c3b6['query']);_0x1538a4[_0x0a9e('0x32')]=_[_0x0a9e('0x33')](_0x11c3b6[_0x0a9e('0x2e')],qs[_0x0a9e('0x34')](_0x14433c[_0x0a9e('0x2f')]['fields']));_0x1538a4[_0x0a9e('0x32')]=_0x1538a4[_0x0a9e('0x32')][_0x0a9e('0x35')]?_0x1538a4[_0x0a9e('0x32')]:_0x11c3b6[_0x0a9e('0x2e')];if(!_0x14433c[_0x0a9e('0x2f')][_0x0a9e('0x36')](_0x0a9e('0x37'))){_0x1538a4['limit']=qs[_0x0a9e('0x38')](_0x14433c['query'][_0x0a9e('0x38')]);_0x1538a4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x14433c[_0x0a9e('0x2f')]['offset']);}_0x1538a4[_0x0a9e('0x39')]=qs[_0x0a9e('0x3a')](_0x14433c[_0x0a9e('0x2f')][_0x0a9e('0x3a')]);_0x1538a4['where']=qs['filters'](_[_0x0a9e('0x3b')](_0x14433c['query'],_0x11c3b6[_0x0a9e('0x31')]));if(_0x14433c[_0x0a9e('0x2f')][_0x0a9e('0x3c')]){_0x1538a4[_0x0a9e('0x3d')]=_['merge'](_0x1538a4[_0x0a9e('0x3d')],{'$or':_[_0x0a9e('0x29')](_0x5a101a,function(_0x3cae){if(_0x3cae['type']!==_0x0a9e('0x3e')){var _0x1a180b={};_0x1a180b[_0x3cae[_0x0a9e('0x26')]]={'$like':'%'+_0x14433c['query']['filter']+'%'};return _0x1a180b;}})});}_0x1538a4=_[_0x0a9e('0x3f')]({},_0x1538a4,_0x14433c[_0x0a9e('0x40')]);var _0x5adda1={'where':_0x1538a4[_0x0a9e('0x3d')]};return db[_0x0a9e('0x2a')][_0x0a9e('0x17')](_0x5adda1)[_0x0a9e('0x1f')](function(_0x4b38d9){_0x14de77['count']=_0x4b38d9;if(_0x14433c[_0x0a9e('0x2f')][_0x0a9e('0x41')]){_0x1538a4['include']=[{'all':!![]}];}return db[_0x0a9e('0x2a')][_0x0a9e('0x42')](_0x1538a4);})[_0x0a9e('0x1f')](function(_0x5b4f5e){_0x14de77[_0x0a9e('0x43')]=_0x5b4f5e;return _0x14de77;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x140511,_0x1538a4))[_0x0a9e('0x44')](handleError(_0x140511,null));};exports[_0x0a9e('0x45')]=function(_0x13cb1f,_0xeaa5e5){var _0x2881b3={'raw':!![],'where':{'id':_0x13cb1f[_0x0a9e('0x46')]['id']}},_0x45a9b8={};_0x45a9b8[_0x0a9e('0x2e')]=_[_0x0a9e('0x30')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x45a9b8[_0x0a9e('0x2f')]=_[_0x0a9e('0x30')](_0x13cb1f['query']);_0x45a9b8['filters']=_[_0x0a9e('0x33')](_0x45a9b8[_0x0a9e('0x2e')],_0x45a9b8[_0x0a9e('0x2f')]);_0x2881b3[_0x0a9e('0x32')]=_[_0x0a9e('0x33')](_0x45a9b8[_0x0a9e('0x2e')],qs[_0x0a9e('0x34')](_0x13cb1f[_0x0a9e('0x2f')][_0x0a9e('0x34')]));_0x2881b3[_0x0a9e('0x32')]=_0x2881b3[_0x0a9e('0x32')][_0x0a9e('0x35')]?_0x2881b3['attributes']:_0x45a9b8[_0x0a9e('0x2e')];if(_0x13cb1f[_0x0a9e('0x2f')][_0x0a9e('0x41')]){_0x2881b3[_0x0a9e('0x47')]=[{'all':!![]}];}_0x2881b3=_[_0x0a9e('0x3f')]({},_0x2881b3,_0x13cb1f[_0x0a9e('0x40')]);return db[_0x0a9e('0x2a')][_0x0a9e('0x48')](_0x2881b3)['then'](handleEntityNotFound(_0xeaa5e5,null))[_0x0a9e('0x1f')](respondWithResult(_0xeaa5e5,null))['catch'](handleError(_0xeaa5e5,null));};exports[_0x0a9e('0x1e')]=function(_0x476688,_0x8d6dd1){if(_0x476688['body']['id']){delete _0x476688[_0x0a9e('0x49')]['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x48')]({'where':{'id':_0x476688[_0x0a9e('0x46')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x8d6dd1,null))[_0x0a9e('0x1f')](saveUpdates(_0x476688[_0x0a9e('0x49')],null))['then'](respondWithResult(_0x8d6dd1,null))[_0x0a9e('0x44')](handleError(_0x8d6dd1,null));};exports[_0x0a9e('0x20')]=function(_0x1b5e80,_0x16f976){return db[_0x0a9e('0x2a')][_0x0a9e('0x48')]({'where':{'id':_0x1b5e80[_0x0a9e('0x46')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x16f976,null))[_0x0a9e('0x1f')](removeEntity(_0x16f976,null))['catch'](handleError(_0x16f976,null));};exports[_0x0a9e('0x4a')]=function(_0x3fe430,_0x4f7240){var _0x4ae14b={'key':_0x3fe430['body'][_0x0a9e('0x2d')]};if(_0x3fe430[_0x0a9e('0x49')][_0x0a9e('0x4b')]){_0x4ae14b[_0x0a9e('0x4b')]=_0x3fe430[_0x0a9e('0x49')][_0x0a9e('0x4b')];}else if(_0x3fe430[_0x0a9e('0x49')][_0x0a9e('0x4c')]){_0x4ae14b['SmsAccountId']=_0x3fe430['body']['SmsAccountId'];}else if(_0x3fe430[_0x0a9e('0x49')][_0x0a9e('0x4d')]){_0x4ae14b[_0x0a9e('0x4d')]=_0x3fe430['body'][_0x0a9e('0x4d')];}else if(_0x3fe430[_0x0a9e('0x49')]['ChatWebsiteId']){_0x4ae14b['ChatWebsiteId']=_0x3fe430[_0x0a9e('0x49')]['ChatWebsiteId'];}return db[_0x0a9e('0x2a')]['find']({'where':_0x4ae14b})[_0x0a9e('0x1f')](function(_0x3c20b2){if(_0x3c20b2){throw new db[(_0x0a9e('0x4e'))]['ValidationError'](_0x0a9e('0x4f'));}return db[_0x0a9e('0x2a')]['create'](_0x3fe430['body']);})[_0x0a9e('0x1f')](function(_0x3aedd0){var _0x49c095=_0x3fe430[_0x0a9e('0x50')]['get']({'plain':!![]});if(!_0x49c095)throw new Error(_0x0a9e('0x51'));if(_0x49c095['role']===_0x0a9e('0x50')){var _0x4a6deb=_0x3aedd0['get']({'plain':!![]});return db['UserProfileSection'][_0x0a9e('0x48')]({'where':{'name':'CannedAnswers','userProfileId':_0x49c095[_0x0a9e('0x52')]},'raw':!![]})[_0x0a9e('0x1f')](function(_0x3cfd00){if(_0x3cfd00&&_0x3cfd00[_0x0a9e('0x53')]===0x0){return db[_0x0a9e('0x23')][_0x0a9e('0x4a')]({'name':_0x4a6deb[_0x0a9e('0x26')],'resourceId':_0x4a6deb['id'],'type':_0x3cfd00[_0x0a9e('0x26')],'sectionId':_0x3cfd00['id']},{})['then'](function(){return _0x3aedd0;});}else{return _0x3aedd0;}})[_0x0a9e('0x44')](function(_0x121cef){logger[_0x0a9e('0x25')](_0x0a9e('0x54'),_0x121cef);throw _0x121cef;});}return _0x3aedd0;})[_0x0a9e('0x1f')](respondWithResult(_0x4f7240,0xc9))[_0x0a9e('0x44')](handleError(_0x4f7240,null));}; \ No newline at end of file +var _0xa9e0=['filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','include','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','end','error','name','send','index','map','CannedAnswer','rawAttributes','type','key','model','query','keys'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');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 db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){var _0x38e7c4=_0x588269[_0x0a9e('0x21')]({'plain':!![]});var _0x4abc77=_0x0a9e('0x22');return db[_0x0a9e('0x23')][_0x0a9e('0x20')]({'where':{'type':_0x4abc77,'resourceId':_0x38e7c4['id']}})[_0x0a9e('0x1f')](function(){return _0x588269;});})[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x24')]();});}};}function handleEntityNotFound(_0x5ea472,_0x59181e){return function(_0x197ec0){if(!_0x197ec0){_0x5ea472[_0x0a9e('0x14')](0x194);}return _0x197ec0;};}function handleError(_0x40c424,_0x33161b){_0x33161b=_0x33161b||0x1f4;return function(_0x526cf3){logger[_0x0a9e('0x25')](_0x526cf3['stack']);if(_0x526cf3[_0x0a9e('0x26')]){delete _0x526cf3['name'];}_0x40c424[_0x0a9e('0x15')](_0x33161b)[_0x0a9e('0x27')](_0x526cf3);};}exports[_0x0a9e('0x28')]=function(_0x14433c,_0x140511){var _0x1538a4={},_0x11c3b6={},_0x14de77={'count':0x0,'rows':[]};var _0x5a101a=_[_0x0a9e('0x29')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')],function(_0x2ec755){return{'name':_0x2ec755['fieldName'],'type':_0x2ec755[_0x0a9e('0x2c')][_0x0a9e('0x2d')]};});_0x11c3b6[_0x0a9e('0x2e')]=_[_0x0a9e('0x29')](_0x5a101a,_0x0a9e('0x26'));_0x11c3b6[_0x0a9e('0x2f')]=_[_0x0a9e('0x30')](_0x14433c[_0x0a9e('0x2f')]);_0x11c3b6[_0x0a9e('0x31')]=_['intersection'](_0x11c3b6[_0x0a9e('0x2e')],_0x11c3b6['query']);_0x1538a4[_0x0a9e('0x32')]=_[_0x0a9e('0x33')](_0x11c3b6[_0x0a9e('0x2e')],qs[_0x0a9e('0x34')](_0x14433c[_0x0a9e('0x2f')]['fields']));_0x1538a4[_0x0a9e('0x32')]=_0x1538a4[_0x0a9e('0x32')][_0x0a9e('0x35')]?_0x1538a4[_0x0a9e('0x32')]:_0x11c3b6[_0x0a9e('0x2e')];if(!_0x14433c[_0x0a9e('0x2f')][_0x0a9e('0x36')](_0x0a9e('0x37'))){_0x1538a4['limit']=qs[_0x0a9e('0x38')](_0x14433c['query'][_0x0a9e('0x38')]);_0x1538a4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x14433c[_0x0a9e('0x2f')]['offset']);}_0x1538a4[_0x0a9e('0x39')]=qs[_0x0a9e('0x3a')](_0x14433c[_0x0a9e('0x2f')][_0x0a9e('0x3a')]);_0x1538a4['where']=qs['filters'](_[_0x0a9e('0x3b')](_0x14433c['query'],_0x11c3b6[_0x0a9e('0x31')]));if(_0x14433c[_0x0a9e('0x2f')][_0x0a9e('0x3c')]){_0x1538a4[_0x0a9e('0x3d')]=_['merge'](_0x1538a4[_0x0a9e('0x3d')],{'$or':_[_0x0a9e('0x29')](_0x5a101a,function(_0x3cae){if(_0x3cae['type']!==_0x0a9e('0x3e')){var _0x1a180b={};_0x1a180b[_0x3cae[_0x0a9e('0x26')]]={'$like':'%'+_0x14433c['query']['filter']+'%'};return _0x1a180b;}})});}_0x1538a4=_[_0x0a9e('0x3f')]({},_0x1538a4,_0x14433c[_0x0a9e('0x40')]);var _0x5adda1={'where':_0x1538a4[_0x0a9e('0x3d')]};return db[_0x0a9e('0x2a')][_0x0a9e('0x17')](_0x5adda1)[_0x0a9e('0x1f')](function(_0x4b38d9){_0x14de77['count']=_0x4b38d9;if(_0x14433c[_0x0a9e('0x2f')][_0x0a9e('0x41')]){_0x1538a4['include']=[{'all':!![]}];}return db[_0x0a9e('0x2a')][_0x0a9e('0x42')](_0x1538a4);})[_0x0a9e('0x1f')](function(_0x5b4f5e){_0x14de77[_0x0a9e('0x43')]=_0x5b4f5e;return _0x14de77;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x140511,_0x1538a4))[_0x0a9e('0x44')](handleError(_0x140511,null));};exports[_0x0a9e('0x45')]=function(_0x13cb1f,_0xeaa5e5){var _0x2881b3={'raw':!![],'where':{'id':_0x13cb1f[_0x0a9e('0x46')]['id']}},_0x45a9b8={};_0x45a9b8[_0x0a9e('0x2e')]=_[_0x0a9e('0x30')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x45a9b8[_0x0a9e('0x2f')]=_[_0x0a9e('0x30')](_0x13cb1f['query']);_0x45a9b8['filters']=_[_0x0a9e('0x33')](_0x45a9b8[_0x0a9e('0x2e')],_0x45a9b8[_0x0a9e('0x2f')]);_0x2881b3[_0x0a9e('0x32')]=_[_0x0a9e('0x33')](_0x45a9b8[_0x0a9e('0x2e')],qs[_0x0a9e('0x34')](_0x13cb1f[_0x0a9e('0x2f')][_0x0a9e('0x34')]));_0x2881b3[_0x0a9e('0x32')]=_0x2881b3[_0x0a9e('0x32')][_0x0a9e('0x35')]?_0x2881b3['attributes']:_0x45a9b8[_0x0a9e('0x2e')];if(_0x13cb1f[_0x0a9e('0x2f')][_0x0a9e('0x41')]){_0x2881b3[_0x0a9e('0x47')]=[{'all':!![]}];}_0x2881b3=_[_0x0a9e('0x3f')]({},_0x2881b3,_0x13cb1f[_0x0a9e('0x40')]);return db[_0x0a9e('0x2a')][_0x0a9e('0x48')](_0x2881b3)['then'](handleEntityNotFound(_0xeaa5e5,null))[_0x0a9e('0x1f')](respondWithResult(_0xeaa5e5,null))['catch'](handleError(_0xeaa5e5,null));};exports[_0x0a9e('0x1e')]=function(_0x476688,_0x8d6dd1){if(_0x476688['body']['id']){delete _0x476688[_0x0a9e('0x49')]['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x48')]({'where':{'id':_0x476688[_0x0a9e('0x46')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x8d6dd1,null))[_0x0a9e('0x1f')](saveUpdates(_0x476688[_0x0a9e('0x49')],null))['then'](respondWithResult(_0x8d6dd1,null))[_0x0a9e('0x44')](handleError(_0x8d6dd1,null));};exports[_0x0a9e('0x20')]=function(_0x1b5e80,_0x16f976){return db[_0x0a9e('0x2a')][_0x0a9e('0x48')]({'where':{'id':_0x1b5e80[_0x0a9e('0x46')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x16f976,null))[_0x0a9e('0x1f')](removeEntity(_0x16f976,null))['catch'](handleError(_0x16f976,null));};exports[_0x0a9e('0x4a')]=function(_0x3fe430,_0x4f7240){var _0x4ae14b={'key':_0x3fe430['body'][_0x0a9e('0x2d')]};if(_0x3fe430[_0x0a9e('0x49')][_0x0a9e('0x4b')]){_0x4ae14b[_0x0a9e('0x4b')]=_0x3fe430[_0x0a9e('0x49')][_0x0a9e('0x4b')];}else if(_0x3fe430[_0x0a9e('0x49')][_0x0a9e('0x4c')]){_0x4ae14b['SmsAccountId']=_0x3fe430['body']['SmsAccountId'];}else if(_0x3fe430[_0x0a9e('0x49')][_0x0a9e('0x4d')]){_0x4ae14b[_0x0a9e('0x4d')]=_0x3fe430['body'][_0x0a9e('0x4d')];}else if(_0x3fe430[_0x0a9e('0x49')]['ChatWebsiteId']){_0x4ae14b['ChatWebsiteId']=_0x3fe430[_0x0a9e('0x49')]['ChatWebsiteId'];}return db[_0x0a9e('0x2a')]['find']({'where':_0x4ae14b})[_0x0a9e('0x1f')](function(_0x3c20b2){if(_0x3c20b2){throw new db[(_0x0a9e('0x4e'))]['ValidationError'](_0x0a9e('0x4f'));}return db[_0x0a9e('0x2a')]['create'](_0x3fe430['body']);})[_0x0a9e('0x1f')](function(_0x3aedd0){var _0x49c095=_0x3fe430[_0x0a9e('0x50')]['get']({'plain':!![]});if(!_0x49c095)throw new Error(_0x0a9e('0x51'));if(_0x49c095['role']===_0x0a9e('0x50')){var _0x4a6deb=_0x3aedd0['get']({'plain':!![]});return db['UserProfileSection'][_0x0a9e('0x48')]({'where':{'name':'CannedAnswers','userProfileId':_0x49c095[_0x0a9e('0x52')]},'raw':!![]})[_0x0a9e('0x1f')](function(_0x3cfd00){if(_0x3cfd00&&_0x3cfd00[_0x0a9e('0x53')]===0x0){return db[_0x0a9e('0x23')][_0x0a9e('0x4a')]({'name':_0x4a6deb[_0x0a9e('0x26')],'resourceId':_0x4a6deb['id'],'type':_0x3cfd00[_0x0a9e('0x26')],'sectionId':_0x3cfd00['id']},{})['then'](function(){return _0x3aedd0;});}else{return _0x3aedd0;}})[_0x0a9e('0x44')](function(_0x121cef){logger[_0x0a9e('0x25')](_0x0a9e('0x54'),_0x121cef);throw _0x121cef;});}return _0x3aedd0;})[_0x0a9e('0x1f')](respondWithResult(_0x4f7240,0xc9))[_0x0a9e('0x44')](handleError(_0x4f7240,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 9a86e9e..ba17887 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 _0xfba8=['exports','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xfba8,0x118));var _0x8fba=function(_0x360f4c,_0x57dee1){_0x360f4c=_0x360f4c-0x0;var _0x257b09=_0xfba8[_0x360f4c];return _0x257b09;};'use strict';var _=require(_0x8fba('0x0'));var util=require(_0x8fba('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x8fba('0x2'));var rp=require(_0x8fba('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8fba('0x4'));var config=require(_0x8fba('0x5'));var attributes=require('./cannedAnswer.attributes');module[_0x8fba('0x6')]=function(_0x30a0d3,_0x44aa55){return _0x30a0d3['define'](_0x8fba('0x7'),attributes,{'tableName':_0x8fba('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8fba('0x9'),'collate':_0x8fba('0xa')});}; \ No newline at end of file +var _0xca99=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer','utf8mb4','lodash'];(function(_0x469e4d,_0x1dd304){var _0x39499e=function(_0x1d3c49){while(--_0x1d3c49){_0x469e4d['push'](_0x469e4d['shift']());}};_0x39499e(++_0x1dd304);}(_0xca99,0x1c6));var _0x9ca9=function(_0x47c89e,_0x18692c){_0x47c89e=_0x47c89e-0x0;var _0x1de51e=_0xca99[_0x47c89e];return _0x1de51e;};'use strict';var _=require(_0x9ca9('0x0'));var util=require(_0x9ca9('0x1'));var logger=require(_0x9ca9('0x2'))(_0x9ca9('0x3'));var moment=require(_0x9ca9('0x4'));var BPromise=require(_0x9ca9('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9ca9('0x6'));var rimraf=require(_0x9ca9('0x7'));var config=require(_0x9ca9('0x8'));var attributes=require(_0x9ca9('0x9'));module['exports']=function(_0x4dd8b7,_0x4e5608){return _0x4dd8b7[_0x9ca9('0xa')](_0x9ca9('0xb'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9ca9('0xc'),'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 bc1b241..cf59113 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 _0x4d24=['CannedAnswer,\x20%s,\x20%s','message','catch','lodash','util','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x41f02c,_0x16a69e){var _0x367e7f=function(_0x2ac4c1){while(--_0x2ac4c1){_0x41f02c['push'](_0x41f02c['shift']());}};_0x367e7f(++_0x16a69e);}(_0x4d24,0x153));var _0x44d2=function(_0x293bfb,_0x4e07b5){_0x293bfb=_0x293bfb-0x0;var _0x1537be=_0x4d24[_0x293bfb];return _0x1537be;};'use strict';var _=require(_0x44d2('0x0'));var util=require(_0x44d2('0x1'));var moment=require('moment');var BPromise=require(_0x44d2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x44d2('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x44d2('0x4'));var logger=require('../../config/logger')(_0x44d2('0x5'));var config=require(_0x44d2('0x6'));var jayson=require(_0x44d2('0x7'));var client=jayson[_0x44d2('0x8')][_0x44d2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4aa6cb,_0x5bc897,_0x4a5712){return new BPromise(function(_0x1e533b,_0x481fb2){return client[_0x44d2('0xa')](_0x4aa6cb,_0x4a5712)['then'](function(_0x3ebfdc){logger[_0x44d2('0xb')]('CannedAnswer,\x20%s,\x20%s',_0x5bc897,'request\x20sent');logger[_0x44d2('0xc')](_0x44d2('0xd'),_0x5bc897,_0x44d2('0xe'),JSON[_0x44d2('0xf')](_0x3ebfdc));if(_0x3ebfdc['error']){if(_0x3ebfdc[_0x44d2('0x10')][_0x44d2('0x11')]===0x1f4){logger['error'](_0x44d2('0x12'),_0x5bc897,_0x3ebfdc['error'][_0x44d2('0x13')]);return _0x481fb2(_0x3ebfdc[_0x44d2('0x10')][_0x44d2('0x13')]);}logger[_0x44d2('0x10')](_0x44d2('0x12'),_0x5bc897,_0x3ebfdc[_0x44d2('0x10')][_0x44d2('0x13')]);return _0x1e533b(_0x3ebfdc[_0x44d2('0x10')][_0x44d2('0x13')]);}else{logger['info'](_0x44d2('0x12'),_0x5bc897,_0x44d2('0xe'));_0x1e533b(_0x3ebfdc['result'][_0x44d2('0x13')]);}})[_0x44d2('0x14')](function(_0x32dfbb){logger[_0x44d2('0x10')](_0x44d2('0x12'),_0x5bc897,_0x32dfbb);_0x481fb2(_0x32dfbb);});});} \ No newline at end of file +var _0x1f67=['CannedAnswer,\x20%s,\x20%s,\x20%s','stringify','error','code','CannedAnswer,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug'];(function(_0x598bbd,_0x23af34){var _0x1a04ac=function(_0xb23f20){while(--_0xb23f20){_0x598bbd['push'](_0x598bbd['shift']());}};_0x1a04ac(++_0x23af34);}(_0x1f67,0x1c9));var _0x71f6=function(_0x40ec5a,_0x1aa8d0){_0x40ec5a=_0x40ec5a-0x0;var _0x1a2887=_0x1f67[_0x40ec5a];return _0x1a2887;};'use strict';var _=require(_0x71f6('0x0'));var util=require('util');var moment=require(_0x71f6('0x1'));var BPromise=require(_0x71f6('0x2'));var rs=require(_0x71f6('0x3'));var fs=require('fs');var Redis=require(_0x71f6('0x4'));var db=require(_0x71f6('0x5'))['db'];var utils=require(_0x71f6('0x6'));var logger=require(_0x71f6('0x7'))(_0x71f6('0x8'));var config=require(_0x71f6('0x9'));var jayson=require(_0x71f6('0xa'));var client=jayson[_0x71f6('0xb')][_0x71f6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x21fa96,_0x30c429,_0x37ef04){return new BPromise(function(_0x556d83,_0x2156e0){return client[_0x71f6('0xd')](_0x21fa96,_0x37ef04)[_0x71f6('0xe')](function(_0x1ad42c){logger[_0x71f6('0xf')]('CannedAnswer,\x20%s,\x20%s',_0x30c429,_0x71f6('0x10'));logger[_0x71f6('0x11')](_0x71f6('0x12'),_0x30c429,_0x71f6('0x10'),JSON[_0x71f6('0x13')](_0x1ad42c));if(_0x1ad42c[_0x71f6('0x14')]){if(_0x1ad42c[_0x71f6('0x14')][_0x71f6('0x15')]===0x1f4){logger[_0x71f6('0x14')](_0x71f6('0x16'),_0x30c429,_0x1ad42c[_0x71f6('0x14')][_0x71f6('0x17')]);return _0x2156e0(_0x1ad42c[_0x71f6('0x14')][_0x71f6('0x17')]);}logger['error'](_0x71f6('0x16'),_0x30c429,_0x1ad42c[_0x71f6('0x14')][_0x71f6('0x17')]);return _0x556d83(_0x1ad42c[_0x71f6('0x14')][_0x71f6('0x17')]);}else{logger[_0x71f6('0xf')]('CannedAnswer,\x20%s,\x20%s',_0x30c429,_0x71f6('0x10'));_0x556d83(_0x1ad42c['result'][_0x71f6('0x17')]);}})[_0x71f6('0x18')](function(_0x2eef00){logger['error'](_0x71f6('0x16'),_0x30c429,_0x2eef00);_0x2156e0(_0x2eef00);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index a4586f4..34d2e5b 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 _0xe408=['show','post','create','put','update','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./cannedAnswer.controller','get','index','/:id','isAuthenticated'];(function(_0x5471ec,_0x1ce81a){var _0x121d4c=function(_0xefb655){while(--_0xefb655){_0x5471ec['push'](_0x5471ec['shift']());}};_0x121d4c(++_0x1ce81a);}(_0xe408,0x19d));var _0x8e40=function(_0x541260,_0x4c7f2e){_0x541260=_0x541260-0x0;var _0x1dd2b5=_0xe408[_0x541260];return _0x1dd2b5;};'use strict';var multer=require(_0x8e40('0x0'));var util=require(_0x8e40('0x1'));var path=require(_0x8e40('0x2'));var timeout=require(_0x8e40('0x3'));var express=require('express');var router=express[_0x8e40('0x4')]();var auth=require(_0x8e40('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8e40('0x6'));var controller=require(_0x8e40('0x7'));router[_0x8e40('0x8')]('/',auth['isAuthenticated'](),controller[_0x8e40('0x9')]);router[_0x8e40('0x8')](_0x8e40('0xa'),auth[_0x8e40('0xb')](),controller[_0x8e40('0xc')]);router[_0x8e40('0xd')]('/',auth[_0x8e40('0xb')](),controller[_0x8e40('0xe')]);router[_0x8e40('0xf')](_0x8e40('0xa'),auth[_0x8e40('0xb')](),controller[_0x8e40('0x10')]);router['delete'](_0x8e40('0xa'),auth[_0x8e40('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xc796=['create','put','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','/:id','isAuthenticated','show','post'];(function(_0x10cc95,_0x5847e7){var _0x159007=function(_0x293081){while(--_0x293081){_0x10cc95['push'](_0x10cc95['shift']());}};_0x159007(++_0x5847e7);}(_0xc796,0x15b));var _0x6c79=function(_0x5f42f1,_0x956be5){_0x5f42f1=_0x5f42f1-0x0;var _0x5534ee=_0xc796[_0x5f42f1];return _0x5534ee;};'use strict';var multer=require(_0x6c79('0x0'));var util=require(_0x6c79('0x1'));var path=require('path');var timeout=require(_0x6c79('0x2'));var express=require(_0x6c79('0x3'));var router=express[_0x6c79('0x4')]();var auth=require(_0x6c79('0x5'));var interaction=require(_0x6c79('0x6'));var config=require(_0x6c79('0x7'));var controller=require(_0x6c79('0x8'));router[_0x6c79('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6c79('0x9')](_0x6c79('0xa'),auth[_0x6c79('0xb')](),controller[_0x6c79('0xc')]);router[_0x6c79('0xd')]('/',auth[_0x6c79('0xb')](),controller[_0x6c79('0xe')]);router[_0x6c79('0xf')](_0x6c79('0xa'),auth[_0x6c79('0xb')](),controller[_0x6c79('0x10')]);router[_0x6c79('0x11')](_0x6c79('0xa'),auth[_0x6c79('0xb')](),controller['destroy']);module[_0x6c79('0x12')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 902937c..e92af66 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 _0x9b43=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0xd55f7e,_0x123c56){var _0x5d3c61=function(_0x3aa938){while(--_0x3aa938){_0xd55f7e['push'](_0xd55f7e['shift']());}};_0x5d3c61(++_0x123c56);}(_0x9b43,0x1b2));var _0x39b4=function(_0x3d721f,_0x11c558){_0x3d721f=_0x3d721f-0x0;var _0x5d675c=_0x9b43[_0x3d721f];return _0x5d675c;};'use strict';var Sequelize=require(_0x39b4('0x0'));module['exports']={'calldate':{'type':Sequelize[_0x39b4('0x1')],'allowNull':![],'defaultValue':_0x39b4('0x2')},'clid':{'type':Sequelize[_0x39b4('0x3')]},'src':{'type':Sequelize[_0x39b4('0x3')]},'dst':{'type':Sequelize[_0x39b4('0x3')]},'dcontext':{'type':Sequelize[_0x39b4('0x3')]},'channel':{'type':Sequelize[_0x39b4('0x3')]},'dstchannel':{'type':Sequelize[_0x39b4('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x39b4('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x39b4('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x39b4('0x3')]},'amaflags':{'type':Sequelize[_0x39b4('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x39b4('0x3')]},'userfield':{'type':Sequelize[_0x39b4('0x3')]},'uniqueid':{'type':Sequelize[_0x39b4('0x3')]},'linkedid':{'type':Sequelize[_0x39b4('0x3')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x39b4('0x3')]},'type':{'type':Sequelize[_0x39b4('0x3')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9dd0=['sequelize','exports','DATE','STRING','INTEGER'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x9dd0,0xf0));var _0x09dd=function(_0x10c49a,_0x4065fd){_0x10c49a=_0x10c49a-0x0;var _0x581ddf=_0x9dd0[_0x10c49a];return _0x581ddf;};'use strict';var Sequelize=require(_0x09dd('0x0'));module[_0x09dd('0x1')]={'calldate':{'type':Sequelize[_0x09dd('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x09dd('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x09dd('0x3')]},'channel':{'type':Sequelize[_0x09dd('0x3')]},'dstchannel':{'type':Sequelize[_0x09dd('0x3')]},'lastapp':{'type':Sequelize[_0x09dd('0x3')]},'lastdata':{'type':Sequelize[_0x09dd('0x3')]},'duration':{'type':Sequelize[_0x09dd('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x09dd('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x09dd('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x09dd('0x3')]},'uniqueid':{'type':Sequelize[_0x09dd('0x3')]},'linkedid':{'type':Sequelize[_0x09dd('0x3')]},'sequence':{'type':Sequelize[_0x09dd('0x3')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x09dd('0x3')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 6b3352e..57fc9b8 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 _0x863a=['count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','Cdr','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','length','includeAll','find','body','update','eml-format','rimraf','fast-json-patch','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x1837b6,_0x30f93d){var _0x5618c8=function(_0x484576){while(--_0x484576){_0x1837b6['push'](_0x1837b6['shift']());}};_0x5618c8(++_0x30f93d);}(_0x863a,0x107));var _0xa863=function(_0x38f85a,_0x130f3a){_0x38f85a=_0x38f85a-0x0;var _0x18e2f0=_0x863a[_0x38f85a];return _0x18e2f0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa863('0x0'));var rimraf=require(_0xa863('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa863('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa863('0x3'));var path=require(_0xa863('0x4'));var sox=require(_0xa863('0x5'));var csv=require(_0xa863('0x6'));var ejs=require(_0xa863('0x7'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa863('0x8'));var jsforce=require(_0xa863('0x9'));var deskjs=require(_0xa863('0xa'));var toCsv=require('to-csv');var querystring=require(_0xa863('0xb'));var Papa=require(_0xa863('0xc'));var Redis=require(_0xa863('0xd'));var authService=require(_0xa863('0xe'));var qs=require(_0xa863('0xf'));var as=require(_0xa863('0x10'));var hardwareService=require(_0xa863('0x11'));var logger=require('../../config/logger')(_0xa863('0x12'));var utils=require(_0xa863('0x13'));var config=require(_0xa863('0x14'));var db=require(_0xa863('0x15'))['db'];function respondWithStatusCode(_0x4f57e2,_0x4b8255){_0x4b8255=_0x4b8255||0xcc;return function(_0x392f89){if(_0x392f89){return _0x4f57e2[_0xa863('0x16')](_0x4b8255);}return _0x4f57e2[_0xa863('0x17')](_0x4b8255)[_0xa863('0x18')]();};}function respondWithResult(_0x2053d2,_0x3f05da){_0x3f05da=_0x3f05da||0xc8;return function(_0x3769f6){if(_0x3769f6){return _0x2053d2[_0xa863('0x17')](_0x3f05da)['json'](_0x3769f6);}};}function respondWithFilteredResult(_0x10e738,_0xf3336c){return function(_0x4b085f){if(_0x4b085f){var _0x887f61=_0x4b085f[_0xa863('0x19')],_0x582ac0=_0xf3336c[_0xa863('0x1a')],_0x2c408d=_0xf3336c[_0xa863('0x1a')]+_0xf3336c[_0xa863('0x1b')],_0x3b1519;if(_0x2c408d>=_0x887f61){_0x2c408d=_0x887f61;_0x3b1519=0xc8;}else{_0x3b1519=0xce;}_0x10e738['status'](_0x3b1519);return _0x10e738[_0xa863('0x1c')](_0xa863('0x1d'),_0x582ac0+'-'+_0x2c408d+'/'+_0x887f61)['json'](_0x4b085f);}return null;};}function patchUpdates(_0xac8ca0){return function(_0x42b1b7){try{jsonpatch[_0xa863('0x1e')](_0x42b1b7,_0xac8ca0,!![]);}catch(_0x392bcf){return BPromise[_0xa863('0x1f')](_0x392bcf);}return _0x42b1b7[_0xa863('0x20')]();};}function saveUpdates(_0x23bfeb,_0x45a20b){return function(_0x1906a2){if(_0x1906a2){return _0x1906a2['update'](_0x23bfeb)[_0xa863('0x21')](function(_0x4c62bc){return _0x4c62bc;});}return null;};}function removeEntity(_0x20f6ff,_0x1da0db){return function(_0x49b54a){if(_0x49b54a){return _0x49b54a[_0xa863('0x22')]()[_0xa863('0x21')](function(){_0x20f6ff[_0xa863('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24a6b1,_0x247c72){return function(_0x1a15a8){if(!_0x1a15a8){_0x24a6b1['sendStatus'](0x194);}return _0x1a15a8;};}function handleError(_0xe17dd9,_0x42b735){_0x42b735=_0x42b735||0x1f4;return function(_0x2a7801){logger[_0xa863('0x23')](_0x2a7801[_0xa863('0x24')]);if(_0x2a7801[_0xa863('0x25')]){delete _0x2a7801[_0xa863('0x25')];}_0xe17dd9[_0xa863('0x17')](_0x42b735)[_0xa863('0x26')](_0x2a7801);};}exports[_0xa863('0x27')]=function(_0x34565f,_0x502e41){var _0x295594={},_0x339a91={},_0x479f56={'count':0x0,'rows':[]};var _0x94acb8=_['map'](db[_0xa863('0x28')][_0xa863('0x29')],function(_0x2fad56){return{'name':_0x2fad56[_0xa863('0x2a')],'type':_0x2fad56[_0xa863('0x2b')][_0xa863('0x2c')]};});_0x339a91[_0xa863('0x2d')]=_[_0xa863('0x2e')](_0x94acb8,'name');_0x339a91['query']=_[_0xa863('0x2f')](_0x34565f[_0xa863('0x30')]);_0x339a91['filters']=_[_0xa863('0x31')](_0x339a91[_0xa863('0x2d')],_0x339a91[_0xa863('0x30')]);_0x295594[_0xa863('0x32')]=_[_0xa863('0x31')](_0x339a91[_0xa863('0x2d')],qs[_0xa863('0x33')](_0x34565f[_0xa863('0x30')][_0xa863('0x33')]));_0x295594[_0xa863('0x32')]=_0x295594[_0xa863('0x32')]['length']?_0x295594['attributes']:_0x339a91[_0xa863('0x2d')];if(!_0x34565f['query'][_0xa863('0x34')](_0xa863('0x35'))){_0x295594[_0xa863('0x1b')]=qs['limit'](_0x34565f[_0xa863('0x30')][_0xa863('0x1b')]);_0x295594['offset']=qs[_0xa863('0x1a')](_0x34565f['query'][_0xa863('0x1a')]);}_0x295594['order']=qs[_0xa863('0x36')](_0x34565f[_0xa863('0x30')][_0xa863('0x36')]);_0x295594[_0xa863('0x37')]=qs[_0xa863('0x38')](_[_0xa863('0x39')](_0x34565f['query'],_0x339a91['filters']));if(_0x34565f[_0xa863('0x30')][_0xa863('0x3a')]){_0x295594[_0xa863('0x37')]=_[_0xa863('0x3b')](_0x295594['where'],{'$or':_[_0xa863('0x2e')](_0x94acb8,function(_0x4801e8){if(_0x4801e8[_0xa863('0x2b')]!==_0xa863('0x3c')){var _0x1abb8b={};_0x1abb8b[_0x4801e8[_0xa863('0x25')]]={'$like':'%'+_0x34565f[_0xa863('0x30')][_0xa863('0x3a')]+'%'};return _0x1abb8b;}})});}_0x295594=_[_0xa863('0x3b')]({},_0x295594,_0x34565f[_0xa863('0x3d')]);var _0x4349ac={'where':_0x295594['where']};return db['Cdr'][_0xa863('0x19')](_0x4349ac)[_0xa863('0x21')](function(_0x2f9461){_0x479f56['count']=_0x2f9461;if(_0x34565f[_0xa863('0x30')]['includeAll']){_0x295594[_0xa863('0x3e')]=[{'all':!![]}];}return db[_0xa863('0x28')][_0xa863('0x3f')](_0x295594);})[_0xa863('0x21')](function(_0x2afa3f){_0x479f56['rows']=_0x2afa3f;return _0x479f56;})['then'](respondWithFilteredResult(_0x502e41,_0x295594))[_0xa863('0x40')](handleError(_0x502e41,null));};exports[_0xa863('0x41')]=function(_0x4c0ec5,_0x386abb){var _0x478389={'raw':!![],'where':{'id':_0x4c0ec5[_0xa863('0x42')]['id']}},_0x3407e4={};_0x3407e4[_0xa863('0x2d')]=_[_0xa863('0x2f')](db['Cdr'][_0xa863('0x29')]);_0x3407e4[_0xa863('0x30')]=_[_0xa863('0x2f')](_0x4c0ec5[_0xa863('0x30')]);_0x3407e4[_0xa863('0x38')]=_[_0xa863('0x31')](_0x3407e4[_0xa863('0x2d')],_0x3407e4[_0xa863('0x30')]);_0x478389[_0xa863('0x32')]=_['intersection'](_0x3407e4[_0xa863('0x2d')],qs['fields'](_0x4c0ec5[_0xa863('0x30')][_0xa863('0x33')]));_0x478389[_0xa863('0x32')]=_0x478389[_0xa863('0x32')][_0xa863('0x43')]?_0x478389[_0xa863('0x32')]:_0x3407e4['model'];if(_0x4c0ec5['query'][_0xa863('0x44')]){_0x478389['include']=[{'all':!![]}];}_0x478389=_[_0xa863('0x3b')]({},_0x478389,_0x4c0ec5[_0xa863('0x3d')]);return db[_0xa863('0x28')][_0xa863('0x45')](_0x478389)[_0xa863('0x21')](handleEntityNotFound(_0x386abb,null))[_0xa863('0x21')](respondWithResult(_0x386abb,null))['catch'](handleError(_0x386abb,null));};exports['create']=function(_0x3efaae,_0x404391){return db['Cdr']['create'](_0x3efaae[_0xa863('0x46')],{})[_0xa863('0x21')](respondWithResult(_0x404391,0xc9))[_0xa863('0x40')](handleError(_0x404391,null));};exports[_0xa863('0x47')]=function(_0x3faf07,_0x409ae6){if(_0x3faf07[_0xa863('0x46')]['id']){delete _0x3faf07[_0xa863('0x46')]['id'];}return db[_0xa863('0x28')][_0xa863('0x45')]({'where':{'id':_0x3faf07[_0xa863('0x42')]['id']}})[_0xa863('0x21')](handleEntityNotFound(_0x409ae6,null))[_0xa863('0x21')](saveUpdates(_0x3faf07[_0xa863('0x46')],null))['then'](respondWithResult(_0x409ae6,null))[_0xa863('0x40')](handleError(_0x409ae6,null));};exports[_0xa863('0x22')]=function(_0x48799b,_0x343f97){return db[_0xa863('0x28')][_0xa863('0x45')]({'where':{'id':_0x48799b[_0xa863('0x42')]['id']}})[_0xa863('0x21')](handleEntityNotFound(_0x343f97,null))[_0xa863('0x21')](removeEntity(_0x343f97,null))[_0xa863('0x40')](handleError(_0x343f97,null));};exports['describe']=function(_0x45c224,_0x10cb3e){return db['Cdr']['describe']()[_0xa863('0x21')](respondWithResult(_0x10cb3e,null))[_0xa863('0x40')](handleError(_0x10cb3e,null));}; \ No newline at end of file +var _0xf402=['find','catch','create','body','update','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','count','offset','limit','reject','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','filter','where','VIRTUAL','options','Cdr','include','rows','show','params','length','merge'];(function(_0x479160,_0x3ab560){var _0x47ac6d=function(_0x3f7314){while(--_0x3f7314){_0x479160['push'](_0x479160['shift']());}};_0x47ac6d(++_0x3ab560);}(_0xf402,0x90));var _0x2f40=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xf402[_0x618414];return _0x21c19a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2f40('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2f40('0x1'));var jsonpatch=require(_0x2f40('0x2'));var rp=require(_0x2f40('0x3'));var moment=require(_0x2f40('0x4'));var BPromise=require(_0x2f40('0x5'));var Mustache=require(_0x2f40('0x6'));var util=require(_0x2f40('0x7'));var path=require('path');var sox=require(_0x2f40('0x8'));var csv=require('to-csv');var ejs=require(_0x2f40('0x9'));var fs=require('fs');var _=require(_0x2f40('0xa'));var squel=require('squel');var crypto=require(_0x2f40('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x2f40('0xc'));var toCsv=require(_0x2f40('0xd'));var querystring=require(_0x2f40('0xe'));var Papa=require(_0x2f40('0xf'));var Redis=require(_0x2f40('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2f40('0x11'));var hardwareService=require(_0x2f40('0x12'));var logger=require(_0x2f40('0x13'))(_0x2f40('0x14'));var utils=require(_0x2f40('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c6bb6,_0xa9d328){_0xa9d328=_0xa9d328||0xcc;return function(_0x294fcf){if(_0x294fcf){return _0x1c6bb6[_0x2f40('0x16')](_0xa9d328);}return _0x1c6bb6[_0x2f40('0x17')](_0xa9d328)[_0x2f40('0x18')]();};}function respondWithResult(_0x37c992,_0x37b3e4){_0x37b3e4=_0x37b3e4||0xc8;return function(_0xa0f712){if(_0xa0f712){return _0x37c992[_0x2f40('0x17')](_0x37b3e4)[_0x2f40('0x19')](_0xa0f712);}};}function respondWithFilteredResult(_0x44826a,_0x5d9773){return function(_0x468db9){if(_0x468db9){var _0x3c1b8b=_0x468db9[_0x2f40('0x1a')],_0xea33fe=_0x5d9773[_0x2f40('0x1b')],_0x2b6ed8=_0x5d9773[_0x2f40('0x1b')]+_0x5d9773[_0x2f40('0x1c')],_0x57cbc2;if(_0x2b6ed8>=_0x3c1b8b){_0x2b6ed8=_0x3c1b8b;_0x57cbc2=0xc8;}else{_0x57cbc2=0xce;}_0x44826a[_0x2f40('0x17')](_0x57cbc2);return _0x44826a['set']('Content-Range',_0xea33fe+'-'+_0x2b6ed8+'/'+_0x3c1b8b)[_0x2f40('0x19')](_0x468db9);}return null;};}function patchUpdates(_0x3e340b){return function(_0x5db3e1){try{jsonpatch['apply'](_0x5db3e1,_0x3e340b,!![]);}catch(_0x12353b){return BPromise[_0x2f40('0x1d')](_0x12353b);}return _0x5db3e1['save']();};}function saveUpdates(_0x28ed7f,_0xffa613){return function(_0x2359fc){if(_0x2359fc){return _0x2359fc['update'](_0x28ed7f)[_0x2f40('0x1e')](function(_0x305d00){return _0x305d00;});}return null;};}function removeEntity(_0x4251d9,_0x1b8d90){return function(_0x57947f){if(_0x57947f){return _0x57947f[_0x2f40('0x1f')]()[_0x2f40('0x1e')](function(){_0x4251d9[_0x2f40('0x17')](0xcc)[_0x2f40('0x18')]();});}};}function handleEntityNotFound(_0x365524,_0x3ca3bd){return function(_0x61a0a){if(!_0x61a0a){_0x365524[_0x2f40('0x16')](0x194);}return _0x61a0a;};}function handleError(_0x4a8741,_0x42739b){_0x42739b=_0x42739b||0x1f4;return function(_0x2606af){logger[_0x2f40('0x20')](_0x2606af[_0x2f40('0x21')]);if(_0x2606af['name']){delete _0x2606af[_0x2f40('0x22')];}_0x4a8741['status'](_0x42739b)[_0x2f40('0x23')](_0x2606af);};}exports[_0x2f40('0x24')]=function(_0x2ab370,_0x378296){var _0x15cc99={},_0x870a81={},_0x6ea18d={'count':0x0,'rows':[]};var _0x35a96b=_[_0x2f40('0x25')](db['Cdr'][_0x2f40('0x26')],function(_0x18e0ee){return{'name':_0x18e0ee[_0x2f40('0x27')],'type':_0x18e0ee[_0x2f40('0x28')][_0x2f40('0x29')]};});_0x870a81[_0x2f40('0x2a')]=_[_0x2f40('0x25')](_0x35a96b,'name');_0x870a81[_0x2f40('0x2b')]=_[_0x2f40('0x2c')](_0x2ab370['query']);_0x870a81[_0x2f40('0x2d')]=_['intersection'](_0x870a81[_0x2f40('0x2a')],_0x870a81['query']);_0x15cc99['attributes']=_[_0x2f40('0x2e')](_0x870a81[_0x2f40('0x2a')],qs[_0x2f40('0x2f')](_0x2ab370['query'][_0x2f40('0x2f')]));_0x15cc99['attributes']=_0x15cc99[_0x2f40('0x30')]['length']?_0x15cc99[_0x2f40('0x30')]:_0x870a81[_0x2f40('0x2a')];if(!_0x2ab370[_0x2f40('0x2b')][_0x2f40('0x31')](_0x2f40('0x32'))){_0x15cc99['limit']=qs[_0x2f40('0x1c')](_0x2ab370[_0x2f40('0x2b')][_0x2f40('0x1c')]);_0x15cc99[_0x2f40('0x1b')]=qs[_0x2f40('0x1b')](_0x2ab370[_0x2f40('0x2b')][_0x2f40('0x1b')]);}_0x15cc99['order']=qs[_0x2f40('0x33')](_0x2ab370[_0x2f40('0x2b')][_0x2f40('0x33')]);_0x15cc99['where']=qs[_0x2f40('0x2d')](_['pick'](_0x2ab370[_0x2f40('0x2b')],_0x870a81['filters']));if(_0x2ab370[_0x2f40('0x2b')][_0x2f40('0x34')]){_0x15cc99['where']=_['merge'](_0x15cc99[_0x2f40('0x35')],{'$or':_['map'](_0x35a96b,function(_0x311b11){if(_0x311b11[_0x2f40('0x28')]!==_0x2f40('0x36')){var _0x1f442e={};_0x1f442e[_0x311b11['name']]={'$like':'%'+_0x2ab370[_0x2f40('0x2b')][_0x2f40('0x34')]+'%'};return _0x1f442e;}})});}_0x15cc99=_['merge']({},_0x15cc99,_0x2ab370[_0x2f40('0x37')]);var _0x448d18={'where':_0x15cc99[_0x2f40('0x35')]};return db[_0x2f40('0x38')][_0x2f40('0x1a')](_0x448d18)[_0x2f40('0x1e')](function(_0x3ca799){_0x6ea18d[_0x2f40('0x1a')]=_0x3ca799;if(_0x2ab370[_0x2f40('0x2b')]['includeAll']){_0x15cc99[_0x2f40('0x39')]=[{'all':!![]}];}return db[_0x2f40('0x38')]['findAll'](_0x15cc99);})[_0x2f40('0x1e')](function(_0x3b67a7){_0x6ea18d[_0x2f40('0x3a')]=_0x3b67a7;return _0x6ea18d;})[_0x2f40('0x1e')](respondWithFilteredResult(_0x378296,_0x15cc99))['catch'](handleError(_0x378296,null));};exports[_0x2f40('0x3b')]=function(_0xcd9a73,_0x46ef25){var _0x45288b={'raw':!![],'where':{'id':_0xcd9a73[_0x2f40('0x3c')]['id']}},_0x54ccd9={};_0x54ccd9[_0x2f40('0x2a')]=_[_0x2f40('0x2c')](db[_0x2f40('0x38')]['rawAttributes']);_0x54ccd9[_0x2f40('0x2b')]=_['keys'](_0xcd9a73['query']);_0x54ccd9[_0x2f40('0x2d')]=_[_0x2f40('0x2e')](_0x54ccd9['model'],_0x54ccd9['query']);_0x45288b[_0x2f40('0x30')]=_[_0x2f40('0x2e')](_0x54ccd9[_0x2f40('0x2a')],qs[_0x2f40('0x2f')](_0xcd9a73[_0x2f40('0x2b')][_0x2f40('0x2f')]));_0x45288b[_0x2f40('0x30')]=_0x45288b[_0x2f40('0x30')][_0x2f40('0x3d')]?_0x45288b[_0x2f40('0x30')]:_0x54ccd9[_0x2f40('0x2a')];if(_0xcd9a73['query']['includeAll']){_0x45288b[_0x2f40('0x39')]=[{'all':!![]}];}_0x45288b=_[_0x2f40('0x3e')]({},_0x45288b,_0xcd9a73[_0x2f40('0x37')]);return db[_0x2f40('0x38')][_0x2f40('0x3f')](_0x45288b)['then'](handleEntityNotFound(_0x46ef25,null))['then'](respondWithResult(_0x46ef25,null))[_0x2f40('0x40')](handleError(_0x46ef25,null));};exports[_0x2f40('0x41')]=function(_0x4fee84,_0x2e98b4){return db[_0x2f40('0x38')]['create'](_0x4fee84[_0x2f40('0x42')],{})[_0x2f40('0x1e')](respondWithResult(_0x2e98b4,0xc9))['catch'](handleError(_0x2e98b4,null));};exports[_0x2f40('0x43')]=function(_0x216b27,_0xce81d8){if(_0x216b27['body']['id']){delete _0x216b27[_0x2f40('0x42')]['id'];}return db['Cdr']['find']({'where':{'id':_0x216b27[_0x2f40('0x3c')]['id']}})[_0x2f40('0x1e')](handleEntityNotFound(_0xce81d8,null))[_0x2f40('0x1e')](saveUpdates(_0x216b27['body'],null))[_0x2f40('0x1e')](respondWithResult(_0xce81d8,null))[_0x2f40('0x40')](handleError(_0xce81d8,null));};exports[_0x2f40('0x1f')]=function(_0x4f6f80,_0x321f5f){return db['Cdr'][_0x2f40('0x3f')]({'where':{'id':_0x4f6f80[_0x2f40('0x3c')]['id']}})[_0x2f40('0x1e')](handleEntityNotFound(_0x321f5f,null))[_0x2f40('0x1e')](removeEntity(_0x321f5f,null))[_0x2f40('0x40')](handleError(_0x321f5f,null));};exports[_0x2f40('0x44')]=function(_0x400848,_0x2efc8c){return db[_0x2f40('0x38')][_0x2f40('0x44')]()[_0x2f40('0x1e')](respondWithResult(_0x2efc8c,null))[_0x2f40('0x40')](handleError(_0x2efc8c,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 7eb4659..b9ee71c 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 _0x4888=['./cdr.attributes','exports','define','calldate','disposition','dst','src','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x130496,_0x4a1a42){var _0x48fb0b=function(_0x43df32){while(--_0x43df32){_0x130496['push'](_0x130496['shift']());}};_0x48fb0b(++_0x4a1a42);}(_0x4888,0x198));var _0x8488=function(_0x278646,_0x25736a){_0x278646=_0x278646-0x0;var _0x1bba75=_0x4888[_0x278646];return _0x1bba75;};'use strict';var _=require('lodash');var util=require(_0x8488('0x0'));var logger=require(_0x8488('0x1'))(_0x8488('0x2'));var moment=require(_0x8488('0x3'));var BPromise=require(_0x8488('0x4'));var rp=require(_0x8488('0x5'));var fs=require('fs');var path=require(_0x8488('0x6'));var rimraf=require('rimraf');var config=require(_0x8488('0x7'));var attributes=require(_0x8488('0x8'));module[_0x8488('0x9')]=function(_0x421292,_0x326887){return _0x421292[_0x8488('0xa')]('Cdr',attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':'accountcode','fields':['accountcode']},{'name':_0x8488('0xb'),'fields':[_0x8488('0xb')]},{'name':'disposition','fields':[_0x8488('0xc')]},{'name':_0x8488('0xd'),'fields':[_0x8488('0xd')]},{'name':_0x8488('0xe'),'fields':['src']},{'name':_0x8488('0xf'),'fields':[_0x8488('0xf')]}],'timestamps':![]});}; \ No newline at end of file +var _0x5496=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./cdr.attributes','define','cdr','accountcode','calldate','disposition','dst','src','uniqueid','lodash'];(function(_0x4a250f,_0x716943){var _0x3c8f41=function(_0x59d8d6){while(--_0x59d8d6){_0x4a250f['push'](_0x4a250f['shift']());}};_0x3c8f41(++_0x716943);}(_0x5496,0x175));var _0x6549=function(_0x9c0ca4,_0x14ba28){_0x9c0ca4=_0x9c0ca4-0x0;var _0x234bf8=_0x5496[_0x9c0ca4];return _0x234bf8;};'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')]('Cdr',attributes,{'tableName':_0x6549('0xa'),'paranoid':![],'indexes':[{'name':_0x6549('0xb'),'fields':[_0x6549('0xb')]},{'name':'calldate','fields':[_0x6549('0xc')]},{'name':_0x6549('0xd'),'fields':[_0x6549('0xd')]},{'name':_0x6549('0xe'),'fields':[_0x6549('0xe')]},{'name':_0x6549('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x6549('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 69fbb9c..aeb247c 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 _0xdd64=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x39ef0e,_0x1dd6b9){var _0x1b96e6=function(_0x295028){while(--_0x295028){_0x39ef0e['push'](_0x39ef0e['shift']());}};_0x1b96e6(++_0x1dd6b9);}(_0xdd64,0x1d6));var _0x4dd6=function(_0x463d52,_0x47971d){_0x463d52=_0x463d52-0x0;var _0x524593=_0xdd64[_0x463d52];return _0x524593;};'use strict';var _=require(_0x4dd6('0x0'));var util=require(_0x4dd6('0x1'));var moment=require(_0x4dd6('0x2'));var BPromise=require('bluebird');var rs=require(_0x4dd6('0x3'));var fs=require('fs');var Redis=require(_0x4dd6('0x4'));var db=require(_0x4dd6('0x5'))['db'];var utils=require(_0x4dd6('0x6'));var logger=require(_0x4dd6('0x7'))(_0x4dd6('0x8'));var config=require(_0x4dd6('0x9'));var jayson=require(_0x4dd6('0xa'));var client=jayson[_0x4dd6('0xb')][_0x4dd6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x84e6db,_0x2f27d1,_0x2f928f){return new BPromise(function(_0x707aec,_0x5c5283){return client['request'](_0x84e6db,_0x2f928f)[_0x4dd6('0xd')](function(_0x35a325){logger['info'](_0x4dd6('0xe'),_0x2f27d1,_0x4dd6('0xf'));logger[_0x4dd6('0x10')](_0x4dd6('0x11'),_0x2f27d1,_0x4dd6('0xf'),JSON[_0x4dd6('0x12')](_0x35a325));if(_0x35a325[_0x4dd6('0x13')]){if(_0x35a325[_0x4dd6('0x13')][_0x4dd6('0x14')]===0x1f4){logger[_0x4dd6('0x13')]('Cdr,\x20%s,\x20%s',_0x2f27d1,_0x35a325[_0x4dd6('0x13')][_0x4dd6('0x15')]);return _0x5c5283(_0x35a325[_0x4dd6('0x13')][_0x4dd6('0x15')]);}logger['error'](_0x4dd6('0xe'),_0x2f27d1,_0x35a325[_0x4dd6('0x13')][_0x4dd6('0x15')]);return _0x707aec(_0x35a325[_0x4dd6('0x13')][_0x4dd6('0x15')]);}else{logger[_0x4dd6('0x16')](_0x4dd6('0xe'),_0x2f27d1,_0x4dd6('0xf'));_0x707aec(_0x35a325[_0x4dd6('0x17')][_0x4dd6('0x15')]);}})[_0x4dd6('0x18')](function(_0xbd1d3a){logger[_0x4dd6('0x13')](_0x4dd6('0xe'),_0x2f27d1,_0xbd1d3a);_0x5c5283(_0xbd1d3a);});});} \ No newline at end of file +var _0x48ee=['Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','randomstring','ioredis','../../config/logger','../../config/environment','client','request','info'];(function(_0x20f3da,_0xbcf23b){var _0x2f11fc=function(_0x2e26a8){while(--_0x2e26a8){_0x20f3da['push'](_0x20f3da['shift']());}};_0x2f11fc(++_0xbcf23b);}(_0x48ee,0x1c2));var _0xe48e=function(_0x260048,_0x51ed37){_0x260048=_0x260048-0x0;var _0x462569=_0x48ee[_0x260048];return _0x462569;};'use strict';var _=require(_0xe48e('0x0'));var util=require(_0xe48e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe48e('0x2'));var fs=require('fs');var Redis=require(_0xe48e('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe48e('0x4'))('rpc');var config=require(_0xe48e('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xe48e('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1812bb,_0x1cf82c,_0x559937){return new BPromise(function(_0x32a6b8,_0x4784a1){return client[_0xe48e('0x7')](_0x1812bb,_0x559937)['then'](function(_0x51e3b8){logger[_0xe48e('0x8')](_0xe48e('0x9'),_0x1cf82c,_0xe48e('0xa'));logger[_0xe48e('0xb')](_0xe48e('0xc'),_0x1cf82c,'request\x20sent',JSON[_0xe48e('0xd')](_0x51e3b8));if(_0x51e3b8[_0xe48e('0xe')]){if(_0x51e3b8[_0xe48e('0xe')]['code']===0x1f4){logger[_0xe48e('0xe')]('Cdr,\x20%s,\x20%s',_0x1cf82c,_0x51e3b8[_0xe48e('0xe')][_0xe48e('0xf')]);return _0x4784a1(_0x51e3b8['error'][_0xe48e('0xf')]);}logger[_0xe48e('0xe')]('Cdr,\x20%s,\x20%s',_0x1cf82c,_0x51e3b8[_0xe48e('0xe')]['message']);return _0x32a6b8(_0x51e3b8[_0xe48e('0xe')][_0xe48e('0xf')]);}else{logger[_0xe48e('0x8')]('Cdr,\x20%s,\x20%s',_0x1cf82c,_0xe48e('0xa'));_0x32a6b8(_0x51e3b8[_0xe48e('0x10')][_0xe48e('0xf')]);}})['catch'](function(_0x219173){logger[_0xe48e('0xe')](_0xe48e('0x9'),_0x1cf82c,_0x219173);_0x4784a1(_0x219173);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 45e2cc8..7407807 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 _0x8c43=['Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','show','post','create','/:id','destroy','util','path','express'];(function(_0x132b93,_0x3d9ea8){var _0xeb147e=function(_0x278f5b){while(--_0x278f5b){_0x132b93['push'](_0x132b93['shift']());}};_0xeb147e(++_0x3d9ea8);}(_0x8c43,0x165));var _0x38c4=function(_0x288db0,_0x3c29ba){_0x288db0=_0x288db0-0x0;var _0x43e1ac=_0x8c43[_0x288db0];return _0x43e1ac;};'use strict';var multer=require('multer');var util=require(_0x38c4('0x0'));var path=require(_0x38c4('0x1'));var timeout=require('connect-timeout');var express=require(_0x38c4('0x2'));var router=express[_0x38c4('0x3')]();var auth=require(_0x38c4('0x4'));var interaction=require(_0x38c4('0x5'));var config=require('../../config/environment');var controller=require('./cdr.controller');router['get']('/',auth[_0x38c4('0x6')](),controller[_0x38c4('0x7')]);router[_0x38c4('0x8')](_0x38c4('0x9'),auth[_0x38c4('0x6')](),controller['describe']);router[_0x38c4('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x38c4('0xa')]);router[_0x38c4('0xb')]('/',auth[_0x38c4('0x6')](),controller[_0x38c4('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x38c4('0xd'),auth[_0x38c4('0x6')](),controller[_0x38c4('0xe')]);module['exports']=router; \ No newline at end of file +var _0x7fca=['path','express','Router','../../components/interaction/service','../../config/environment','./cdr.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util'];(function(_0x57ee1e,_0x3db0ba){var _0x4f7123=function(_0x42bf5f){while(--_0x42bf5f){_0x57ee1e['push'](_0x57ee1e['shift']());}};_0x4f7123(++_0x3db0ba);}(_0x7fca,0xd0));var _0xa7fc=function(_0x59fb0f,_0x409914){_0x59fb0f=_0x59fb0f-0x0;var _0x3aee13=_0x7fca[_0x59fb0f];return _0x3aee13;};'use strict';var multer=require(_0xa7fc('0x0'));var util=require(_0xa7fc('0x1'));var path=require(_0xa7fc('0x2'));var timeout=require('connect-timeout');var express=require(_0xa7fc('0x3'));var router=express[_0xa7fc('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xa7fc('0x5'));var config=require(_0xa7fc('0x6'));var controller=require(_0xa7fc('0x7'));router[_0xa7fc('0x8')]('/',auth[_0xa7fc('0x9')](),controller[_0xa7fc('0xa')]);router[_0xa7fc('0x8')](_0xa7fc('0xb'),auth[_0xa7fc('0x9')](),controller[_0xa7fc('0xc')]);router[_0xa7fc('0x8')](_0xa7fc('0xd'),auth[_0xa7fc('0x9')](),controller[_0xa7fc('0xe')]);router[_0xa7fc('0xf')]('/',auth['isAuthenticated'](),controller[_0xa7fc('0x10')]);router[_0xa7fc('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xa7fc('0x12')](_0xa7fc('0xd'),auth[_0xa7fc('0x9')](),controller[_0xa7fc('0x13')]);module[_0xa7fc('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 9d7a04f..6c9e1ab 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 _0xd15d=['TEXT','*,*,*,*','exports','STRING'];(function(_0x292c39,_0x46338b){var _0x56859d=function(_0x2a27f2){while(--_0x2a27f2){_0x292c39['push'](_0x292c39['shift']());}};_0x56859d(++_0x46338b);}(_0xd15d,0x152));var _0xdd15=function(_0x5b4e71,_0x342268){_0x5b4e71=_0x5b4e71-0x0;var _0x1693ee=_0xd15d[_0x5b4e71];return _0x1693ee;};'use strict';var Sequelize=require('sequelize');module[_0xdd15('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xdd15('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xdd15('0x2')]()},'description':{'type':Sequelize[_0xdd15('0x1')]},'interval':{'type':Sequelize[_0xdd15('0x1')],'defaultValue':_0xdd15('0x3')}}; \ No newline at end of file +var _0x4252=['exports','INTEGER','STRING','noop','TEXT','sequelize'];(function(_0x45537f,_0x210bc0){var _0x5c424c=function(_0x14efd6){while(--_0x14efd6){_0x45537f['push'](_0x45537f['shift']());}};_0x5c424c(++_0x210bc0);}(_0x4252,0x155));var _0x2425=function(_0x4c398f,_0x22baec){_0x4c398f=_0x4c398f-0x0;var _0x506853=_0x4252[_0x4c398f];return _0x506853;};'use strict';var Sequelize=require(_0x2425('0x0'));module[_0x2425('0x1')]={'priority':{'type':Sequelize[_0x2425('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x2425('0x3')],'allowNull':![],'defaultValue':_0x2425('0x4')},'appdata':{'type':Sequelize[_0x2425('0x5')]()},'description':{'type':Sequelize[_0x2425('0x3')]},'interval':{'type':Sequelize[_0x2425('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index cd112ec..c62f127 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 _0x137f=['squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','json','offset','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','model','keys','ChatApplication','query','filters','intersection','attributes','fields','length','includeAll','options','find','body','params','catch','html-pdf','eml-format','rimraf','moment','bluebird','mustache','util','path','ejs','lodash'];(function(_0x270823,_0x40a4d2){var _0x53a637=function(_0x4f04d6){while(--_0x4f04d6){_0x270823['push'](_0x270823['shift']());}};_0x53a637(++_0x40a4d2);}(_0x137f,0x95));var _0xf137=function(_0x4b8682,_0x2ea1d4){_0x4b8682=_0x4b8682-0x0;var _0x48e9cd=_0x137f[_0x4b8682];return _0x48e9cd;};'use strict';var pdf=require(_0xf137('0x0'));var emlformat=require(_0xf137('0x1'));var rimraf=require(_0xf137('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf137('0x3'));var BPromise=require(_0xf137('0x4'));var Mustache=require(_0xf137('0x5'));var util=require(_0xf137('0x6'));var path=require(_0xf137('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf137('0x8'));var fs=require('fs');var _=require(_0xf137('0x9'));var squel=require(_0xf137('0xa'));var crypto=require(_0xf137('0xb'));var jsforce=require(_0xf137('0xc'));var deskjs=require(_0xf137('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf137('0xe'));var Papa=require('papaparse');var Redis=require(_0xf137('0xf'));var authService=require(_0xf137('0x10'));var qs=require(_0xf137('0x11'));var as=require(_0xf137('0x12'));var hardwareService=require(_0xf137('0x13'));var logger=require(_0xf137('0x14'))(_0xf137('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xf137('0x16'))['db'];function respondWithStatusCode(_0x418062,_0x4a8ea9){_0x4a8ea9=_0x4a8ea9||0xcc;return function(_0x312691){if(_0x312691){return _0x418062[_0xf137('0x17')](_0x4a8ea9);}return _0x418062['status'](_0x4a8ea9)['end']();};}function respondWithResult(_0x5e2a8a,_0x27ce5d){_0x27ce5d=_0x27ce5d||0xc8;return function(_0x137317){if(_0x137317){return _0x5e2a8a[_0xf137('0x18')](_0x27ce5d)[_0xf137('0x19')](_0x137317);}};}function respondWithFilteredResult(_0x4d04a8,_0x298e2d){return function(_0x20daf6){if(_0x20daf6){var _0x13fac4=_0x20daf6['count'],_0x127110=_0x298e2d['offset'],_0x4a6774=_0x298e2d[_0xf137('0x1a')]+_0x298e2d['limit'],_0xcc4ff3;if(_0x4a6774>=_0x13fac4){_0x4a6774=_0x13fac4;_0xcc4ff3=0xc8;}else{_0xcc4ff3=0xce;}_0x4d04a8['status'](_0xcc4ff3);return _0x4d04a8['set'](_0xf137('0x1b'),_0x127110+'-'+_0x4a6774+'/'+_0x13fac4)[_0xf137('0x19')](_0x20daf6);}return null;};}function patchUpdates(_0x2f8a4c){return function(_0x16f4ee){try{jsonpatch[_0xf137('0x1c')](_0x16f4ee,_0x2f8a4c,!![]);}catch(_0x5adb30){return BPromise[_0xf137('0x1d')](_0x5adb30);}return _0x16f4ee[_0xf137('0x1e')]();};}function saveUpdates(_0x548ff2,_0x45dd6f){return function(_0x1d6db2){if(_0x1d6db2){return _0x1d6db2[_0xf137('0x1f')](_0x548ff2)['then'](function(_0xcaede8){return _0xcaede8;});}return null;};}function removeEntity(_0x4e9a2a,_0x1cee02){return function(_0x9a2536){if(_0x9a2536){return _0x9a2536[_0xf137('0x20')]()[_0xf137('0x21')](function(){_0x4e9a2a[_0xf137('0x18')](0xcc)[_0xf137('0x22')]();});}};}function handleEntityNotFound(_0x234324,_0x36d86f){return function(_0x13b71a){if(!_0x13b71a){_0x234324['sendStatus'](0x194);}return _0x13b71a;};}function handleError(_0x19a8e0,_0x1bd6bb){_0x1bd6bb=_0x1bd6bb||0x1f4;return function(_0x1cec76){logger[_0xf137('0x23')](_0x1cec76[_0xf137('0x24')]);if(_0x1cec76[_0xf137('0x25')]){delete _0x1cec76[_0xf137('0x25')];}_0x19a8e0[_0xf137('0x18')](_0x1bd6bb)['send'](_0x1cec76);};}exports['show']=function(_0x3f3e38,_0x241d1e){var _0x47e77f={'raw':!![],'where':{'id':_0x3f3e38['params']['id']}},_0x5e765a={};_0x5e765a[_0xf137('0x26')]=_[_0xf137('0x27')](db[_0xf137('0x28')]['rawAttributes']);_0x5e765a[_0xf137('0x29')]=_['keys'](_0x3f3e38['query']);_0x5e765a[_0xf137('0x2a')]=_[_0xf137('0x2b')](_0x5e765a['model'],_0x5e765a[_0xf137('0x29')]);_0x47e77f[_0xf137('0x2c')]=_[_0xf137('0x2b')](_0x5e765a[_0xf137('0x26')],qs[_0xf137('0x2d')](_0x3f3e38[_0xf137('0x29')][_0xf137('0x2d')]));_0x47e77f[_0xf137('0x2c')]=_0x47e77f[_0xf137('0x2c')][_0xf137('0x2e')]?_0x47e77f[_0xf137('0x2c')]:_0x5e765a[_0xf137('0x26')];if(_0x3f3e38[_0xf137('0x29')][_0xf137('0x2f')]){_0x47e77f['include']=[{'all':!![]}];}_0x47e77f=_['merge']({},_0x47e77f,_0x3f3e38[_0xf137('0x30')]);return db[_0xf137('0x28')][_0xf137('0x31')](_0x47e77f)[_0xf137('0x21')](handleEntityNotFound(_0x241d1e,null))['then'](respondWithResult(_0x241d1e,null))['catch'](handleError(_0x241d1e,null));};exports[_0xf137('0x1f')]=function(_0x1f054c,_0x36faea){if(_0x1f054c['body']['id']){delete _0x1f054c[_0xf137('0x32')]['id'];}return db[_0xf137('0x28')]['find']({'where':{'id':_0x1f054c[_0xf137('0x33')]['id']}})[_0xf137('0x21')](handleEntityNotFound(_0x36faea,null))['then'](saveUpdates(_0x1f054c[_0xf137('0x32')],null))[_0xf137('0x21')](respondWithResult(_0x36faea,null))[_0xf137('0x34')](handleError(_0x36faea,null));};exports['destroy']=function(_0x4469ac,_0x5512b9){return db[_0xf137('0x28')][_0xf137('0x31')]({'where':{'id':_0x4469ac[_0xf137('0x33')]['id']}})[_0xf137('0x21')](handleEntityNotFound(_0x5512b9,null))[_0xf137('0x21')](removeEntity(_0x5512b9,null))[_0xf137('0x34')](handleError(_0x5512b9,null));}; \ No newline at end of file +var _0x45e0=['apply','reject','save','update','then','destroy','name','send','params','keys','ChatApplication','rawAttributes','query','intersection','model','fields','merge','find','catch','body','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','set','Content-Range'];(function(_0x421692,_0x1f98da){var _0x126280=function(_0x289081){while(--_0x289081){_0x421692['push'](_0x421692['shift']());}};_0x126280(++_0x1f98da);}(_0x45e0,0x1d6));var _0x045e=function(_0x1211b9,_0x19157c){_0x1211b9=_0x1211b9-0x0;var _0x1f8c6f=_0x45e0[_0x1211b9];return _0x1f8c6f;};'use strict';var pdf=require(_0x045e('0x0'));var emlformat=require(_0x045e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x045e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x045e('0x3'));var moment=require(_0x045e('0x4'));var BPromise=require(_0x045e('0x5'));var Mustache=require(_0x045e('0x6'));var util=require(_0x045e('0x7'));var path=require('path');var sox=require(_0x045e('0x8'));var csv=require(_0x045e('0x9'));var ejs=require(_0x045e('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x045e('0xb'));var crypto=require('crypto');var jsforce=require(_0x045e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x045e('0x9'));var querystring=require(_0x045e('0xd'));var Papa=require('papaparse');var Redis=require(_0x045e('0xe'));var authService=require(_0x045e('0xf'));var qs=require(_0x045e('0x10'));var as=require(_0x045e('0x11'));var hardwareService=require(_0x045e('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x045e('0x13'));var config=require(_0x045e('0x14'));var db=require(_0x045e('0x15'))['db'];function respondWithStatusCode(_0x1a60a6,_0x285dc7){_0x285dc7=_0x285dc7||0xcc;return function(_0x900af8){if(_0x900af8){return _0x1a60a6[_0x045e('0x16')](_0x285dc7);}return _0x1a60a6['status'](_0x285dc7)[_0x045e('0x17')]();};}function respondWithResult(_0x560564,_0x47cb7e){_0x47cb7e=_0x47cb7e||0xc8;return function(_0x3a9047){if(_0x3a9047){return _0x560564[_0x045e('0x18')](_0x47cb7e)[_0x045e('0x19')](_0x3a9047);}};}function respondWithFilteredResult(_0x390327,_0x2644b9){return function(_0x589977){if(_0x589977){var _0xfcf1=_0x589977['count'],_0x33af07=_0x2644b9[_0x045e('0x1a')],_0x596bfc=_0x2644b9[_0x045e('0x1a')]+_0x2644b9[_0x045e('0x1b')],_0x3baf43;if(_0x596bfc>=_0xfcf1){_0x596bfc=_0xfcf1;_0x3baf43=0xc8;}else{_0x3baf43=0xce;}_0x390327[_0x045e('0x18')](_0x3baf43);return _0x390327[_0x045e('0x1c')](_0x045e('0x1d'),_0x33af07+'-'+_0x596bfc+'/'+_0xfcf1)[_0x045e('0x19')](_0x589977);}return null;};}function patchUpdates(_0x312ef6){return function(_0x30376f){try{jsonpatch[_0x045e('0x1e')](_0x30376f,_0x312ef6,!![]);}catch(_0x5fe525){return BPromise[_0x045e('0x1f')](_0x5fe525);}return _0x30376f[_0x045e('0x20')]();};}function saveUpdates(_0x78f7b,_0x252ddb){return function(_0x149ed0){if(_0x149ed0){return _0x149ed0[_0x045e('0x21')](_0x78f7b)[_0x045e('0x22')](function(_0x57c3b2){return _0x57c3b2;});}return null;};}function removeEntity(_0x57586a,_0x206ae3){return function(_0x1be875){if(_0x1be875){return _0x1be875[_0x045e('0x23')]()[_0x045e('0x22')](function(){_0x57586a[_0x045e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b810c,_0x4aa2ec){return function(_0x5581f4){if(!_0x5581f4){_0x5b810c[_0x045e('0x16')](0x194);}return _0x5581f4;};}function handleError(_0x521ac7,_0x17d72f){_0x17d72f=_0x17d72f||0x1f4;return function(_0x1ed3eb){logger['error'](_0x1ed3eb['stack']);if(_0x1ed3eb[_0x045e('0x24')]){delete _0x1ed3eb[_0x045e('0x24')];}_0x521ac7[_0x045e('0x18')](_0x17d72f)[_0x045e('0x25')](_0x1ed3eb);};}exports['show']=function(_0x5ed636,_0x334e78){var _0x57b7bb={'raw':!![],'where':{'id':_0x5ed636[_0x045e('0x26')]['id']}},_0x2d6619={};_0x2d6619['model']=_[_0x045e('0x27')](db[_0x045e('0x28')][_0x045e('0x29')]);_0x2d6619[_0x045e('0x2a')]=_[_0x045e('0x27')](_0x5ed636['query']);_0x2d6619['filters']=_[_0x045e('0x2b')](_0x2d6619['model'],_0x2d6619[_0x045e('0x2a')]);_0x57b7bb['attributes']=_['intersection'](_0x2d6619[_0x045e('0x2c')],qs[_0x045e('0x2d')](_0x5ed636[_0x045e('0x2a')][_0x045e('0x2d')]));_0x57b7bb['attributes']=_0x57b7bb['attributes']['length']?_0x57b7bb['attributes']:_0x2d6619[_0x045e('0x2c')];if(_0x5ed636[_0x045e('0x2a')]['includeAll']){_0x57b7bb['include']=[{'all':!![]}];}_0x57b7bb=_[_0x045e('0x2e')]({},_0x57b7bb,_0x5ed636['options']);return db[_0x045e('0x28')][_0x045e('0x2f')](_0x57b7bb)[_0x045e('0x22')](handleEntityNotFound(_0x334e78,null))[_0x045e('0x22')](respondWithResult(_0x334e78,null))[_0x045e('0x30')](handleError(_0x334e78,null));};exports[_0x045e('0x21')]=function(_0x263bcd,_0x4f3f60){if(_0x263bcd[_0x045e('0x31')]['id']){delete _0x263bcd[_0x045e('0x31')]['id'];}return db['ChatApplication'][_0x045e('0x2f')]({'where':{'id':_0x263bcd[_0x045e('0x26')]['id']}})[_0x045e('0x22')](handleEntityNotFound(_0x4f3f60,null))[_0x045e('0x22')](saveUpdates(_0x263bcd[_0x045e('0x31')],null))[_0x045e('0x22')](respondWithResult(_0x4f3f60,null))['catch'](handleError(_0x4f3f60,null));};exports[_0x045e('0x23')]=function(_0x4b73ed,_0x177071){return db[_0x045e('0x28')][_0x045e('0x2f')]({'where':{'id':_0x4b73ed[_0x045e('0x26')]['id']}})[_0x045e('0x22')](handleEntityNotFound(_0x177071,null))['then'](removeEntity(_0x177071,null))['catch'](handleError(_0x177071,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 9269caf..6fa084b 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 _0xa9e0=['define','ChatApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_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':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0a9e('0xb')});}; \ No newline at end of file +var _0xa9e0=['define','ChatApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0a9e('0xb')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 5e02a03..cb05f64 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 _0xe7b3=['then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xe7b3,0xd2));var _0x3e7b=function(_0x57a6df,_0xccf0c5){_0x57a6df=_0x57a6df-0x0;var _0x241c38=_0xe7b3[_0x57a6df];return _0x241c38;};'use strict';var _=require(_0x3e7b('0x0'));var util=require('util');var moment=require(_0x3e7b('0x1'));var BPromise=require(_0x3e7b('0x2'));var rs=require(_0x3e7b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3e7b('0x4'));var logger=require(_0x3e7b('0x5'))(_0x3e7b('0x6'));var config=require(_0x3e7b('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3e7b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x377900,_0x5b7b99,_0x2bba8b){return new BPromise(function(_0x386a4b,_0x1bf4ce){return client[_0x3e7b('0x9')](_0x377900,_0x2bba8b)[_0x3e7b('0xa')](function(_0x49b0ac){logger[_0x3e7b('0xb')](_0x3e7b('0xc'),_0x5b7b99,_0x3e7b('0xd'));logger[_0x3e7b('0xe')](_0x3e7b('0xf'),_0x5b7b99,_0x3e7b('0xd'),JSON[_0x3e7b('0x10')](_0x49b0ac));if(_0x49b0ac[_0x3e7b('0x11')]){if(_0x49b0ac[_0x3e7b('0x11')]['code']===0x1f4){logger['error'](_0x3e7b('0xc'),_0x5b7b99,_0x49b0ac[_0x3e7b('0x11')][_0x3e7b('0x12')]);return _0x1bf4ce(_0x49b0ac['error'][_0x3e7b('0x12')]);}logger[_0x3e7b('0x11')](_0x3e7b('0xc'),_0x5b7b99,_0x49b0ac[_0x3e7b('0x11')]['message']);return _0x386a4b(_0x49b0ac['error'][_0x3e7b('0x12')]);}else{logger[_0x3e7b('0xb')](_0x3e7b('0xc'),_0x5b7b99,_0x3e7b('0xd'));_0x386a4b(_0x49b0ac['result'][_0x3e7b('0x12')]);}})[_0x3e7b('0x13')](function(_0x12e967){logger['error'](_0x3e7b('0xc'),_0x5b7b99,_0x12e967);_0x1bf4ce(_0x12e967);});});} \ No newline at end of file +var _0x4211=['message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','code','error','ChatApplication,\x20%s,\x20%s'];(function(_0x5eb1c9,_0x102260){var _0x4cfcd8=function(_0x498727){while(--_0x498727){_0x5eb1c9['push'](_0x5eb1c9['shift']());}};_0x4cfcd8(++_0x102260);}(_0x4211,0x120));var _0x1421=function(_0x3dcea5,_0x1a4bfc){_0x3dcea5=_0x3dcea5-0x0;var _0x30333a=_0x4211[_0x3dcea5];return _0x30333a;};'use strict';var _=require(_0x1421('0x0'));var util=require(_0x1421('0x1'));var moment=require(_0x1421('0x2'));var BPromise=require(_0x1421('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1421('0x4'));var db=require(_0x1421('0x5'))['db'];var utils=require(_0x1421('0x6'));var logger=require('../../config/logger')(_0x1421('0x7'));var config=require('../../config/environment');var jayson=require(_0x1421('0x8'));var client=jayson[_0x1421('0x9')][_0x1421('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3dcd28,_0x214766,_0x3438a2){return new BPromise(function(_0x480f02,_0x49013c){return client['request'](_0x3dcd28,_0x3438a2)[_0x1421('0xb')](function(_0x4c28b2){logger[_0x1421('0xc')]('ChatApplication,\x20%s,\x20%s',_0x214766,_0x1421('0xd'));logger[_0x1421('0xe')](_0x1421('0xf'),_0x214766,_0x1421('0xd'),JSON[_0x1421('0x10')](_0x4c28b2));if(_0x4c28b2['error']){if(_0x4c28b2['error'][_0x1421('0x11')]===0x1f4){logger[_0x1421('0x12')](_0x1421('0x13'),_0x214766,_0x4c28b2[_0x1421('0x12')]['message']);return _0x49013c(_0x4c28b2[_0x1421('0x12')]['message']);}logger[_0x1421('0x12')](_0x1421('0x13'),_0x214766,_0x4c28b2['error'][_0x1421('0x14')]);return _0x480f02(_0x4c28b2[_0x1421('0x12')][_0x1421('0x14')]);}else{logger[_0x1421('0xc')]('ChatApplication,\x20%s,\x20%s',_0x214766,_0x1421('0xd'));_0x480f02(_0x4c28b2[_0x1421('0x15')][_0x1421('0x14')]);}})['catch'](function(_0x353d10){logger[_0x1421('0x12')]('ChatApplication,\x20%s,\x20%s',_0x214766,_0x353d10);_0x49013c(_0x353d10);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index b22e740..79c982b 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 _0xe613=['show','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated'];(function(_0x229f4,_0x2ae27f){var _0x32f980=function(_0x30ecb1){while(--_0x30ecb1){_0x229f4['push'](_0x229f4['shift']());}};_0x32f980(++_0x2ae27f);}(_0xe613,0x15b));var _0x3e61=function(_0x3be398,_0x4f0b0e){_0x3be398=_0x3be398-0x0;var _0x459104=_0xe613[_0x3be398];return _0x459104;};'use strict';var multer=require(_0x3e61('0x0'));var util=require(_0x3e61('0x1'));var path=require(_0x3e61('0x2'));var timeout=require(_0x3e61('0x3'));var express=require(_0x3e61('0x4'));var router=express[_0x3e61('0x5')]();var auth=require(_0x3e61('0x6'));var interaction=require(_0x3e61('0x7'));var config=require(_0x3e61('0x8'));var controller=require(_0x3e61('0x9'));router[_0x3e61('0xa')](_0x3e61('0xb'),auth[_0x3e61('0xc')](),controller[_0x3e61('0xd')]);router[_0x3e61('0xe')](_0x3e61('0xb'),auth[_0x3e61('0xc')](),controller[_0x3e61('0xf')]);router[_0x3e61('0x10')](_0x3e61('0xb'),auth['isAuthenticated'](),controller[_0x3e61('0x11')]);module['exports']=router; \ No newline at end of file +var _0x613e=['isAuthenticated','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','show','put'];(function(_0x38a032,_0x90ea7c){var _0x33ca9a=function(_0x919601){while(--_0x919601){_0x38a032['push'](_0x38a032['shift']());}};_0x33ca9a(++_0x90ea7c);}(_0x613e,0x115));var _0xe613=function(_0x1f6836,_0x25e729){_0x1f6836=_0x1f6836-0x0;var _0x1dbb0b=_0x613e[_0x1f6836];return _0x1dbb0b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe613('0x0'));var timeout=require(_0xe613('0x1'));var express=require(_0xe613('0x2'));var router=express[_0xe613('0x3')]();var auth=require(_0xe613('0x4'));var interaction=require(_0xe613('0x5'));var config=require(_0xe613('0x6'));var controller=require(_0xe613('0x7'));router[_0xe613('0x8')](_0xe613('0x9'),auth['isAuthenticated'](),controller[_0xe613('0xa')]);router[_0xe613('0xb')](_0xe613('0x9'),auth[_0xe613('0xc')](),controller[_0xe613('0xd')]);router[_0xe613('0xe')](_0xe613('0x9'),auth[_0xe613('0xc')](),controller[_0xe613('0xf')]);module[_0xe613('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 016ce5a..a2705ec 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 _0x3ab9=['STRING'];(function(_0x11b09c,_0x3070a5){var _0x3670ab=function(_0x1d9982){while(--_0x1d9982){_0x11b09c['push'](_0x11b09c['shift']());}};_0x3670ab(++_0x3070a5);}(_0x3ab9,0xb4));var _0x93ab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3ab9[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x93ab('0x0')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x1afb=['BOOLEAN','STRING'];(function(_0x4df1f5,_0x39c6d2){var _0x56585b=function(_0x287b6e){while(--_0x287b6e){_0x4df1f5['push'](_0x4df1f5['shift']());}};_0x56585b(++_0x39c6d2);}(_0x1afb,0x179));var _0xb1af=function(_0x285c52,_0x106da3){_0x285c52=_0x285c52-0x0;var _0x3684a2=_0x1afb[_0x285c52];return _0x3684a2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb1af('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0xb1af('0x0')]},'write':{'type':Sequelize[_0xb1af('0x1')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 637f632..ab0acab 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 _0x52e9=['test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','destroy','name','send','index','map','ChatGroup','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','length','find','create','body','update','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','getMembers','findOne','User','removeMembers','ChatGroupId','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','defaults','localhost','./chatGroup.socket','jayson/promise','client','http'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x52e9,0x193));var _0x952e=function(_0x5914d1,_0x269a3d){_0x5914d1=_0x5914d1-0x0;var _0xb010cb=_0x52e9[_0x5914d1];return _0xb010cb;};'use strict';var pdf=require(_0x952e('0x0'));var emlformat=require(_0x952e('0x1'));var rimraf=require(_0x952e('0x2'));var zipdir=require(_0x952e('0x3'));var jsonpatch=require(_0x952e('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x952e('0x5'));var Mustache=require('mustache');var util=require(_0x952e('0x6'));var path=require('path');var sox=require(_0x952e('0x7'));var csv=require(_0x952e('0x8'));var ejs=require(_0x952e('0x9'));var fs=require('fs');var _=require(_0x952e('0xa'));var squel=require('squel');var crypto=require(_0x952e('0xb'));var jsforce=require(_0x952e('0xc'));var deskjs=require(_0x952e('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x952e('0xe'));var authService=require(_0x952e('0xf'));var qs=require(_0x952e('0x10'));var as=require(_0x952e('0x11'));var hardwareService=require(_0x952e('0x12'));var logger=require('../../config/logger')(_0x952e('0x13'));var utils=require(_0x952e('0x14'));var config=require(_0x952e('0x15'));var db=require('../../mysqldb')['db'];config[_0x952e('0x16')]=_[_0x952e('0x17')](config['redis'],{'host':_0x952e('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x952e('0x19'))['register'](socket);var jayson=require(_0x952e('0x1a'));var client=jayson[_0x952e('0x1b')][_0x952e('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x15d340,_0x4386e8,_0x5b190b){if(_0x5b190b){var _0x5c0970=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5c0970[_0x952e('0x1d')](_0x4386e8)){return _0x15d340;}else{throw new db[(_0x952e('0x1e'))][(_0x952e('0x1f'))](_0x952e('0x20'));}}else{return _0x15d340;}}function respondWithRpcPromise(_0x3769bf,_0x1fccda,_0x3095ae,_0x4a5729){return new BPromise(function(_0x340581,_0x5089dd){var _0x5d4633=_0x4a5729||client;return _0x5d4633[_0x952e('0x21')](_0x3769bf,_0x3095ae)[_0x952e('0x22')](function(_0x4f7856){logger[_0x952e('0x23')](_0x952e('0x24'),_0x1fccda,_0x952e('0x25'));logger['debug'](_0x952e('0x26'),_0x1fccda,_0x952e('0x25'),JSON[_0x952e('0x27')](_0x4f7856));if(_0x4f7856[_0x952e('0x28')]){if(_0x4f7856[_0x952e('0x28')][_0x952e('0x29')]===0x1f4){logger[_0x952e('0x28')]('ChatGroup,\x20%s,\x20%s',_0x1fccda,_0x4f7856[_0x952e('0x28')][_0x952e('0x2a')]);return _0x5089dd(_0x4f7856[_0x952e('0x28')][_0x952e('0x2a')]);}logger[_0x952e('0x28')](_0x952e('0x24'),_0x1fccda,_0x4f7856[_0x952e('0x28')][_0x952e('0x2a')]);return _0x340581(_0x4f7856['error']['message']);}else{logger[_0x952e('0x23')]('ChatGroup,\x20%s,\x20%s',_0x1fccda,'request\x20sent');_0x340581(_0x4f7856[_0x952e('0x2b')][_0x952e('0x2a')]);}})['catch'](function(_0x58949b){logger[_0x952e('0x28')](_0x952e('0x24'),_0x1fccda,_0x58949b);_0x5089dd(_0x58949b);});});}function respondWithStatusCode(_0x5cb39d,_0x22ca10){_0x22ca10=_0x22ca10||0xcc;return function(_0x4451b6){if(_0x4451b6){return _0x5cb39d[_0x952e('0x2c')](_0x22ca10);}return _0x5cb39d[_0x952e('0x2d')](_0x22ca10)[_0x952e('0x2e')]();};}function respondWithResult(_0x44915a,_0x1144b4){_0x1144b4=_0x1144b4||0xc8;return function(_0x243d3f){if(_0x243d3f){return _0x44915a[_0x952e('0x2d')](_0x1144b4)[_0x952e('0x2f')](_0x243d3f);}};}function respondWithFilteredResult(_0x448080,_0x1741e5){return function(_0x13ed85){if(_0x13ed85){var _0x59ca20=_0x13ed85[_0x952e('0x30')],_0x1a863c=_0x1741e5['offset'],_0x5ef56d=_0x1741e5[_0x952e('0x31')]+_0x1741e5[_0x952e('0x32')],_0x56697a;if(_0x5ef56d>=_0x59ca20){_0x5ef56d=_0x59ca20;_0x56697a=0xc8;}else{_0x56697a=0xce;}_0x448080['status'](_0x56697a);return _0x448080['set'](_0x952e('0x33'),_0x1a863c+'-'+_0x5ef56d+'/'+_0x59ca20)[_0x952e('0x2f')](_0x13ed85);}return null;};}function patchUpdates(_0x38de64){return function(_0x435606){try{jsonpatch[_0x952e('0x34')](_0x435606,_0x38de64,!![]);}catch(_0x13ee87){return BPromise[_0x952e('0x35')](_0x13ee87);}return _0x435606[_0x952e('0x36')]();};}function saveUpdates(_0x294765,_0x487b1f){return function(_0x342190){if(_0x342190){return _0x342190['update'](_0x294765)[_0x952e('0x22')](function(_0x3e288a){return _0x3e288a;});}return null;};}function removeEntity(_0x114d2d,_0x49ba5d){return function(_0x48e51c){if(_0x48e51c){return _0x48e51c[_0x952e('0x37')]()[_0x952e('0x22')](function(){_0x114d2d['status'](0xcc)[_0x952e('0x2e')]();});}};}function handleEntityNotFound(_0x153026,_0x4ede97){return function(_0x1843c2){if(!_0x1843c2){_0x153026[_0x952e('0x2c')](0x194);}return _0x1843c2;};}function handleError(_0x233a1f,_0x565995){_0x565995=_0x565995||0x1f4;return function(_0xcd8b35){logger[_0x952e('0x28')](_0xcd8b35['stack']);if(_0xcd8b35['name']){delete _0xcd8b35[_0x952e('0x38')];}_0x233a1f[_0x952e('0x2d')](_0x565995)[_0x952e('0x39')](_0xcd8b35);};}exports[_0x952e('0x3a')]=function(_0x30b6b4,_0x4cf004){var _0x878e75={},_0x546bc7={},_0x5d63ad={'count':0x0,'rows':[]};var _0x29a87c=_[_0x952e('0x3b')](db[_0x952e('0x3c')][_0x952e('0x3d')],function(_0x51bc04){return{'name':_0x51bc04[_0x952e('0x3e')],'type':_0x51bc04['type'][_0x952e('0x3f')]};});_0x546bc7[_0x952e('0x40')]=_[_0x952e('0x3b')](_0x29a87c,_0x952e('0x38'));_0x546bc7[_0x952e('0x41')]=_[_0x952e('0x42')](_0x30b6b4['query']);_0x546bc7['filters']=_['intersection'](_0x546bc7[_0x952e('0x40')],_0x546bc7[_0x952e('0x41')]);_0x878e75['attributes']=_[_0x952e('0x43')](_0x546bc7[_0x952e('0x40')],qs[_0x952e('0x44')](_0x30b6b4[_0x952e('0x41')][_0x952e('0x44')]));_0x878e75[_0x952e('0x45')]=_0x878e75['attributes']['length']?_0x878e75[_0x952e('0x45')]:_0x546bc7[_0x952e('0x40')];if(!_0x30b6b4[_0x952e('0x41')][_0x952e('0x46')](_0x952e('0x47'))){_0x878e75[_0x952e('0x32')]=qs[_0x952e('0x32')](_0x30b6b4['query'][_0x952e('0x32')]);_0x878e75['offset']=qs[_0x952e('0x31')](_0x30b6b4['query'][_0x952e('0x31')]);}_0x878e75[_0x952e('0x48')]=qs[_0x952e('0x49')](_0x30b6b4[_0x952e('0x41')][_0x952e('0x49')]);_0x878e75[_0x952e('0x4a')]=qs[_0x952e('0x4b')](_[_0x952e('0x4c')](_0x30b6b4[_0x952e('0x41')],_0x546bc7[_0x952e('0x4b')]));if(_0x30b6b4[_0x952e('0x41')][_0x952e('0x4d')]){_0x878e75[_0x952e('0x4a')]=_['merge'](_0x878e75['where'],{'$or':_['map'](_0x29a87c,function(_0x2a43e3){if(_0x2a43e3['type']!==_0x952e('0x4e')){var _0x1363ab={};_0x1363ab[_0x2a43e3[_0x952e('0x38')]]={'$like':'%'+_0x30b6b4[_0x952e('0x41')][_0x952e('0x4d')]+'%'};return _0x1363ab;}})});}_0x878e75=_[_0x952e('0x4f')]({},_0x878e75,_0x30b6b4[_0x952e('0x50')]);var _0xeb14ee={'where':_0x878e75[_0x952e('0x4a')]};return db['ChatGroup'][_0x952e('0x30')](_0xeb14ee)[_0x952e('0x22')](function(_0x394b99){_0x5d63ad['count']=_0x394b99;if(_0x30b6b4['query']['includeAll']){_0x878e75[_0x952e('0x51')]=[{'all':!![]}];}return db[_0x952e('0x3c')][_0x952e('0x52')](_0x878e75);})['then'](function(_0x37c4a7){_0x5d63ad[_0x952e('0x53')]=_0x37c4a7;return _0x5d63ad;})['then'](respondWithFilteredResult(_0x4cf004,_0x878e75))[_0x952e('0x54')](handleError(_0x4cf004,null));};exports[_0x952e('0x55')]=function(_0x10a4c6,_0x5bbd95){var _0x120f51={'raw':!![],'where':{'id':_0x10a4c6[_0x952e('0x56')]['id']}},_0x5f2263={};_0x5f2263[_0x952e('0x40')]=_[_0x952e('0x42')](db[_0x952e('0x3c')][_0x952e('0x3d')]);_0x5f2263[_0x952e('0x41')]=_[_0x952e('0x42')](_0x10a4c6[_0x952e('0x41')]);_0x5f2263[_0x952e('0x4b')]=_['intersection'](_0x5f2263[_0x952e('0x40')],_0x5f2263[_0x952e('0x41')]);_0x120f51[_0x952e('0x45')]=_[_0x952e('0x43')](_0x5f2263['model'],qs['fields'](_0x10a4c6['query']['fields']));_0x120f51[_0x952e('0x45')]=_0x120f51[_0x952e('0x45')][_0x952e('0x57')]?_0x120f51[_0x952e('0x45')]:_0x5f2263['model'];if(_0x10a4c6[_0x952e('0x41')]['includeAll']){_0x120f51[_0x952e('0x51')]=[{'all':!![]}];}_0x120f51=_[_0x952e('0x4f')]({},_0x120f51,_0x10a4c6[_0x952e('0x50')]);return db[_0x952e('0x3c')][_0x952e('0x58')](_0x120f51)[_0x952e('0x22')](handleEntityNotFound(_0x5bbd95,null))['then'](respondWithResult(_0x5bbd95,null))[_0x952e('0x54')](handleError(_0x5bbd95,null));};exports['create']=function(_0x30561a,_0x2b29a8){return db['ChatGroup'][_0x952e('0x59')](_0x30561a[_0x952e('0x5a')],{})[_0x952e('0x22')](respondWithResult(_0x2b29a8,0xc9))[_0x952e('0x54')](handleError(_0x2b29a8,null));};exports[_0x952e('0x5b')]=function(_0x4e43a1,_0x5727cf){if(_0x4e43a1[_0x952e('0x5a')]['id']){delete _0x4e43a1[_0x952e('0x5a')]['id'];}return db['ChatGroup'][_0x952e('0x58')]({'where':{'id':_0x4e43a1['params']['id']}})[_0x952e('0x22')](handleEntityNotFound(_0x5727cf,null))[_0x952e('0x22')](saveUpdates(_0x4e43a1[_0x952e('0x5a')],null))[_0x952e('0x22')](respondWithResult(_0x5727cf,null))['catch'](handleError(_0x5727cf,null));};exports['destroy']=function(_0x16d420,_0x9c69f9){return db['ChatGroup']['find']({'where':{'id':_0x16d420[_0x952e('0x56')]['id']}})['then'](handleEntityNotFound(_0x9c69f9,null))[_0x952e('0x22')](removeEntity(_0x9c69f9,null))[_0x952e('0x54')](handleError(_0x9c69f9,null));};exports[_0x952e('0x5c')]=function(_0x63a219,_0x43868a){return db[_0x952e('0x3c')][_0x952e('0x5c')]()['then'](respondWithResult(_0x43868a,null))[_0x952e('0x54')](handleError(_0x43868a,null));};exports[_0x952e('0x5d')]=function(_0x5cac88,_0x11f7e1,_0x476e8e){return db[_0x952e('0x5e')][_0x952e('0x30')]({'where':{'ChatGroupId':_0x5cac88[_0x952e('0x56')]['id'],'ToId':_0x5cac88[_0x952e('0x5f')]['id'],'read':![]}})[_0x952e('0x22')](function(_0x155561){return{'id':_[_0x952e('0x60')](_0x5cac88[_0x952e('0x56')]['id']),'count':_0x155561};})[_0x952e('0x22')](respondWithResult(_0x11f7e1,null))[_0x952e('0x54')](handleError(_0x11f7e1,null));};exports[_0x952e('0x61')]=function(_0x4b6ed3,_0x21befa,_0xa4594e){return db[_0x952e('0x3c')]['find']({'where':{'id':_0x4b6ed3[_0x952e('0x56')]['id']}})['then'](handleEntityNotFound(_0x21befa,null))['then'](function(_0x1a18bd){if(_0x1a18bd){return _0x1a18bd['addMembers'](_0x4b6ed3['body'][_0x952e('0x62')],_['omit'](_0x4b6ed3[_0x952e('0x5a')],[_0x952e('0x62'),'id'])||{});}})[_0x952e('0x22')](respondWithResult(_0x21befa,null))[_0x952e('0x54')](handleError(_0x21befa,null));};exports[_0x952e('0x63')]=function(_0x469003,_0x4f1e56,_0x546bf3){var _0x111245={};var _0x2700a9={};var _0x36b831;var _0x56c23a;return db[_0x952e('0x3c')][_0x952e('0x64')]({'where':{'id':_0x469003['params']['id']}})['then'](handleEntityNotFound(_0x4f1e56,null))[_0x952e('0x22')](function(_0x24af5f){if(_0x24af5f){_0x36b831=_0x24af5f;_0x2700a9[_0x952e('0x40')]=_[_0x952e('0x42')](db[_0x952e('0x65')][_0x952e('0x3d')]);_0x2700a9[_0x952e('0x41')]=_['keys'](_0x469003[_0x952e('0x41')]);_0x2700a9[_0x952e('0x4b')]=_[_0x952e('0x43')](_0x2700a9[_0x952e('0x40')],_0x2700a9[_0x952e('0x41')]);_0x111245[_0x952e('0x45')]=_[_0x952e('0x43')](_0x2700a9[_0x952e('0x40')],qs['fields'](_0x469003['query'][_0x952e('0x44')]));_0x111245[_0x952e('0x45')]=_0x111245[_0x952e('0x45')][_0x952e('0x57')]?_0x111245['attributes']:_0x2700a9[_0x952e('0x40')];_0x111245[_0x952e('0x48')]=qs[_0x952e('0x49')](_0x469003[_0x952e('0x41')][_0x952e('0x49')]);_0x111245['where']=qs[_0x952e('0x4b')](_['pick'](_0x469003[_0x952e('0x41')],_0x2700a9[_0x952e('0x4b')]));if(_0x469003['query'][_0x952e('0x4d')]){_0x111245['where']=_[_0x952e('0x4f')](_0x111245[_0x952e('0x4a')],{'$or':_['map'](_0x111245[_0x952e('0x45')],function(_0xf21db7){var _0x33a3f6={};_0x33a3f6[_0xf21db7]={'$like':'%'+_0x469003['query'][_0x952e('0x4d')]+'%'};return _0x33a3f6;})});}_0x111245=_[_0x952e('0x4f')]({},_0x111245,_0x469003['options']);return _0x36b831['getMembers'](_0x111245);}})[_0x952e('0x22')](function(_0x55e37f){if(_0x55e37f){_0x56c23a=_0x55e37f[_0x952e('0x57')];if(!_0x469003[_0x952e('0x41')][_0x952e('0x46')](_0x952e('0x47'))){_0x111245[_0x952e('0x32')]=qs[_0x952e('0x32')](_0x469003[_0x952e('0x41')][_0x952e('0x32')]);_0x111245['offset']=qs[_0x952e('0x31')](_0x469003[_0x952e('0x41')][_0x952e('0x31')]);}return _0x36b831['getMembers'](_0x111245);}})[_0x952e('0x22')](function(_0x111419){if(_0x111419){return _0x111419?{'count':_0x56c23a,'rows':_0x111419}:null;}})[_0x952e('0x22')](respondWithResult(_0x4f1e56,null))[_0x952e('0x54')](handleError(_0x4f1e56,null));};exports[_0x952e('0x66')]=function(_0x692e09,_0x4b5183,_0x1e84aa){return db['ChatGroup'][_0x952e('0x58')]({'where':{'id':_0x692e09[_0x952e('0x56')]['id']}})[_0x952e('0x22')](handleEntityNotFound(_0x4b5183,null))['then'](function(_0x688730){if(_0x688730){return _0x688730['removeMembers'](_0x692e09[_0x952e('0x41')][_0x952e('0x62')]);}})['then'](respondWithStatusCode(_0x4b5183,null))[_0x952e('0x54')](handleError(_0x4b5183,null));};exports['addMessage']=function(_0x559b57,_0xdcb2d6,_0x1cee00){if(_0x559b57[_0x952e('0x5a')]['id']){delete _0x559b57[_0x952e('0x5a')]['id'];}return db[_0x952e('0x3c')]['find']({'where':{'id':_0x559b57[_0x952e('0x56')]['id']}})[_0x952e('0x22')](handleEntityNotFound(_0xdcb2d6,null))[_0x952e('0x22')](function(_0x14c585){if(_0x14c585){_0x559b57[_0x952e('0x5a')][_0x952e('0x67')]=_0x14c585['id'];return db['ChatInternalMessage']['create'](_0x559b57[_0x952e('0x5a')]);}})[_0x952e('0x22')](respondWithResult(_0xdcb2d6,null))[_0x952e('0x54')](handleError(_0xdcb2d6,null));};exports[_0x952e('0x68')]=function(_0x1cb0b4,_0x47577c,_0x46a2b9){var _0x5e62f0={};var _0x47fecc={};var _0x1dad35;var _0x21ef65;return db['ChatGroup'][_0x952e('0x64')]({'where':{'id':_0x1cb0b4['params']['id']}})[_0x952e('0x22')](handleEntityNotFound(_0x47577c,null))[_0x952e('0x22')](function(_0x584b76){if(_0x584b76){_0x1dad35=_0x584b76;_0x47fecc[_0x952e('0x40')]=_[_0x952e('0x42')](db[_0x952e('0x5e')]['rawAttributes']);_0x47fecc[_0x952e('0x41')]=_[_0x952e('0x42')](_0x1cb0b4['query']);_0x47fecc['filters']=_[_0x952e('0x43')](_0x47fecc[_0x952e('0x40')],_0x47fecc[_0x952e('0x41')]);_0x5e62f0[_0x952e('0x45')]=_[_0x952e('0x43')](_0x47fecc[_0x952e('0x40')],qs[_0x952e('0x44')](_0x1cb0b4['query'][_0x952e('0x44')]));_0x5e62f0[_0x952e('0x45')]=_0x5e62f0[_0x952e('0x45')]['length']?_0x5e62f0[_0x952e('0x45')]:_0x47fecc['model'];_0x5e62f0[_0x952e('0x48')]=qs[_0x952e('0x49')](_0x1cb0b4[_0x952e('0x41')][_0x952e('0x49')]);_0x5e62f0[_0x952e('0x4a')]=qs[_0x952e('0x4b')](_[_0x952e('0x4c')](_0x1cb0b4[_0x952e('0x41')],_0x47fecc[_0x952e('0x4b')]));if(_0x1cb0b4[_0x952e('0x41')][_0x952e('0x4d')]){_0x5e62f0[_0x952e('0x4a')]=_[_0x952e('0x4f')](_0x5e62f0[_0x952e('0x4a')],{'$or':_['map'](_0x5e62f0['attributes'],function(_0x4d97af){var _0x686798={};_0x686798[_0x4d97af]={'$like':'%'+_0x1cb0b4[_0x952e('0x41')]['filter']+'%'};return _0x686798;})});}if(_0x1cb0b4['query'][_0x952e('0x69')]){var _0x4ad79e=_0x1cb0b4[_0x952e('0x41')][_0x952e('0x69')]['split'](',');var _0x322797={};_0x322797[_0x4ad79e[0x0]]={'$gte':moment(_0x4ad79e[0x1])[_0x952e('0x6a')](_0x952e('0x6b'))};_0x5e62f0[_0x952e('0x4a')]=_[_0x952e('0x4f')](_0x5e62f0[_0x952e('0x4a')],_0x322797);}_0x5e62f0=_['merge']({},_0x5e62f0,_0x1cb0b4[_0x952e('0x50')]);return _0x1dad35[_0x952e('0x68')](_0x5e62f0);}})[_0x952e('0x22')](function(_0x33a559){if(_0x33a559){_0x21ef65=_0x33a559[_0x952e('0x57')];if(!_0x1cb0b4[_0x952e('0x41')]['hasOwnProperty'](_0x952e('0x47'))){_0x5e62f0[_0x952e('0x32')]=qs[_0x952e('0x32')](_0x1cb0b4[_0x952e('0x41')][_0x952e('0x32')]);_0x5e62f0['offset']=qs['offset'](_0x1cb0b4['query'][_0x952e('0x31')]);}return _0x1dad35['getMessages'](_0x5e62f0);}})[_0x952e('0x22')](function(_0x17ca59){if(_0x17ca59){return _0x17ca59?{'count':_0x21ef65,'rows':_0x17ca59}:null;}})[_0x952e('0x22')](respondWithResult(_0x47577c,null))[_0x952e('0x54')](handleError(_0x47577c,null));}; \ No newline at end of file +var _0x944f=['show','params','keys','options','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','omit','getMembers','findOne','User','ids','addMessage','ChatGroupId','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','html-pdf','rimraf','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','socket.io-emitter','./chatGroup.socket','register','jayson/promise','client','http','test','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~!@#$%^&-_=+[{]}.','request','then','info','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','end','stack','name','index','map','ChatGroup','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','includeAll','include','rows'];(function(_0x4d75ad,_0x3b2fa0){var _0x1c850b=function(_0x35851e){while(--_0x35851e){_0x4d75ad['push'](_0x4d75ad['shift']());}};_0x1c850b(++_0x3b2fa0);}(_0x944f,0x159));var _0xf944=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0x944f[_0xaa0309];return _0x5de7ce;};'use strict';var pdf=require(_0xf944('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf944('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf944('0x2'));var Mustache=require(_0xf944('0x3'));var util=require(_0xf944('0x4'));var path=require('path');var sox=require(_0xf944('0x5'));var csv=require(_0xf944('0x6'));var ejs=require(_0xf944('0x7'));var fs=require('fs');var _=require(_0xf944('0x8'));var squel=require(_0xf944('0x9'));var crypto=require(_0xf944('0xa'));var jsforce=require(_0xf944('0xb'));var deskjs=require(_0xf944('0xc'));var toCsv=require('to-csv');var querystring=require(_0xf944('0xd'));var Papa=require(_0xf944('0xe'));var Redis=require('ioredis');var authService=require(_0xf944('0xf'));var qs=require(_0xf944('0x10'));var as=require(_0xf944('0x11'));var hardwareService=require(_0xf944('0x12'));var logger=require(_0xf944('0x13'))('api');var utils=require(_0xf944('0x14'));var config=require(_0xf944('0x15'));var db=require('../../mysqldb')['db'];config[_0xf944('0x16')]=_['defaults'](config[_0xf944('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xf944('0x17'))(new Redis(config[_0xf944('0x16')]));require(_0xf944('0x18'))[_0xf944('0x19')](socket);var jayson=require(_0xf944('0x1a'));var client=jayson[_0xf944('0x1b')][_0xf944('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x18a635,_0x1701db,_0x47913a){if(_0x47913a){var _0x50821d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x50821d[_0xf944('0x1d')](_0x1701db)){return _0x18a635;}else{throw new db['Sequelize'][(_0xf944('0x1e'))](_0xf944('0x1f'));}}else{return _0x18a635;}}function respondWithRpcPromise(_0x78996c,_0x39dafd,_0x178b4f,_0x2a74ef){return new BPromise(function(_0x140290,_0x1af732){var _0x321280=_0x2a74ef||client;return _0x321280[_0xf944('0x20')](_0x78996c,_0x178b4f)[_0xf944('0x21')](function(_0x4b833c){logger[_0xf944('0x22')](_0xf944('0x23'),_0x39dafd,'request\x20sent');logger[_0xf944('0x24')](_0xf944('0x25'),_0x39dafd,'request\x20sent',JSON[_0xf944('0x26')](_0x4b833c));if(_0x4b833c[_0xf944('0x27')]){if(_0x4b833c[_0xf944('0x27')]['code']===0x1f4){logger[_0xf944('0x27')]('ChatGroup,\x20%s,\x20%s',_0x39dafd,_0x4b833c[_0xf944('0x27')][_0xf944('0x28')]);return _0x1af732(_0x4b833c['error'][_0xf944('0x28')]);}logger[_0xf944('0x27')](_0xf944('0x23'),_0x39dafd,_0x4b833c['error'][_0xf944('0x28')]);return _0x140290(_0x4b833c['error'][_0xf944('0x28')]);}else{logger[_0xf944('0x22')](_0xf944('0x23'),_0x39dafd,'request\x20sent');_0x140290(_0x4b833c[_0xf944('0x29')][_0xf944('0x28')]);}})[_0xf944('0x2a')](function(_0xb71188){logger['error'](_0xf944('0x23'),_0x39dafd,_0xb71188);_0x1af732(_0xb71188);});});}function respondWithStatusCode(_0xfaf817,_0x57303a){_0x57303a=_0x57303a||0xcc;return function(_0x2f991b){if(_0x2f991b){return _0xfaf817[_0xf944('0x2b')](_0x57303a);}return _0xfaf817['status'](_0x57303a)['end']();};}function respondWithResult(_0x4cea50,_0xdb05e3){_0xdb05e3=_0xdb05e3||0xc8;return function(_0x2908e6){if(_0x2908e6){return _0x4cea50[_0xf944('0x2c')](_0xdb05e3)[_0xf944('0x2d')](_0x2908e6);}};}function respondWithFilteredResult(_0x28c6dc,_0x1a5c6a){return function(_0xb3b994){if(_0xb3b994){var _0x190837=_0xb3b994[_0xf944('0x2e')],_0x467f72=_0x1a5c6a[_0xf944('0x2f')],_0x432607=_0x1a5c6a['offset']+_0x1a5c6a[_0xf944('0x30')],_0x1b381e;if(_0x432607>=_0x190837){_0x432607=_0x190837;_0x1b381e=0xc8;}else{_0x1b381e=0xce;}_0x28c6dc['status'](_0x1b381e);return _0x28c6dc[_0xf944('0x31')](_0xf944('0x32'),_0x467f72+'-'+_0x432607+'/'+_0x190837)[_0xf944('0x2d')](_0xb3b994);}return null;};}function patchUpdates(_0x3d08e5){return function(_0x1227c5){try{jsonpatch['apply'](_0x1227c5,_0x3d08e5,!![]);}catch(_0x22c06b){return BPromise[_0xf944('0x33')](_0x22c06b);}return _0x1227c5[_0xf944('0x34')]();};}function saveUpdates(_0x411932,_0x2a6d5f){return function(_0x136404){if(_0x136404){return _0x136404[_0xf944('0x35')](_0x411932)[_0xf944('0x21')](function(_0x396dc2){return _0x396dc2;});}return null;};}function removeEntity(_0x4fa917,_0x43954e){return function(_0xa86888){if(_0xa86888){return _0xa86888[_0xf944('0x36')]()[_0xf944('0x21')](function(){_0x4fa917[_0xf944('0x2c')](0xcc)[_0xf944('0x37')]();});}};}function handleEntityNotFound(_0x4c4969,_0x157ee5){return function(_0xd871cd){if(!_0xd871cd){_0x4c4969[_0xf944('0x2b')](0x194);}return _0xd871cd;};}function handleError(_0x11ceeb,_0x35b2de){_0x35b2de=_0x35b2de||0x1f4;return function(_0x4c1843){logger[_0xf944('0x27')](_0x4c1843[_0xf944('0x38')]);if(_0x4c1843[_0xf944('0x39')]){delete _0x4c1843[_0xf944('0x39')];}_0x11ceeb[_0xf944('0x2c')](_0x35b2de)['send'](_0x4c1843);};}exports[_0xf944('0x3a')]=function(_0x1592ce,_0x3885ea){var _0x263351={},_0x256079={},_0x1f86ae={'count':0x0,'rows':[]};var _0x575335=_[_0xf944('0x3b')](db[_0xf944('0x3c')][_0xf944('0x3d')],function(_0x2b1683){return{'name':_0x2b1683[_0xf944('0x3e')],'type':_0x2b1683[_0xf944('0x3f')]['key']};});_0x256079[_0xf944('0x40')]=_['map'](_0x575335,'name');_0x256079[_0xf944('0x41')]=_['keys'](_0x1592ce[_0xf944('0x41')]);_0x256079[_0xf944('0x42')]=_[_0xf944('0x43')](_0x256079[_0xf944('0x40')],_0x256079['query']);_0x263351[_0xf944('0x44')]=_[_0xf944('0x43')](_0x256079[_0xf944('0x40')],qs[_0xf944('0x45')](_0x1592ce[_0xf944('0x41')][_0xf944('0x45')]));_0x263351[_0xf944('0x44')]=_0x263351[_0xf944('0x44')][_0xf944('0x46')]?_0x263351[_0xf944('0x44')]:_0x256079['model'];if(!_0x1592ce['query'][_0xf944('0x47')](_0xf944('0x48'))){_0x263351[_0xf944('0x30')]=qs[_0xf944('0x30')](_0x1592ce[_0xf944('0x41')][_0xf944('0x30')]);_0x263351[_0xf944('0x2f')]=qs['offset'](_0x1592ce['query'][_0xf944('0x2f')]);}_0x263351[_0xf944('0x49')]=qs[_0xf944('0x4a')](_0x1592ce[_0xf944('0x41')]['sort']);_0x263351['where']=qs['filters'](_[_0xf944('0x4b')](_0x1592ce[_0xf944('0x41')],_0x256079[_0xf944('0x42')]));if(_0x1592ce[_0xf944('0x41')][_0xf944('0x4c')]){_0x263351['where']=_[_0xf944('0x4d')](_0x263351[_0xf944('0x4e')],{'$or':_[_0xf944('0x3b')](_0x575335,function(_0x4a06d9){if(_0x4a06d9[_0xf944('0x3f')]!==_0xf944('0x4f')){var _0x2b2046={};_0x2b2046[_0x4a06d9[_0xf944('0x39')]]={'$like':'%'+_0x1592ce[_0xf944('0x41')][_0xf944('0x4c')]+'%'};return _0x2b2046;}})});}_0x263351=_[_0xf944('0x4d')]({},_0x263351,_0x1592ce['options']);var _0x455f87={'where':_0x263351[_0xf944('0x4e')]};return db[_0xf944('0x3c')][_0xf944('0x2e')](_0x455f87)['then'](function(_0x1f4e55){_0x1f86ae[_0xf944('0x2e')]=_0x1f4e55;if(_0x1592ce[_0xf944('0x41')][_0xf944('0x50')]){_0x263351[_0xf944('0x51')]=[{'all':!![]}];}return db['ChatGroup']['findAll'](_0x263351);})[_0xf944('0x21')](function(_0x34d2f1){_0x1f86ae[_0xf944('0x52')]=_0x34d2f1;return _0x1f86ae;})[_0xf944('0x21')](respondWithFilteredResult(_0x3885ea,_0x263351))[_0xf944('0x2a')](handleError(_0x3885ea,null));};exports[_0xf944('0x53')]=function(_0x1f0181,_0x14a785){var _0x324c27={'raw':!![],'where':{'id':_0x1f0181[_0xf944('0x54')]['id']}},_0xc4ebd6={};_0xc4ebd6[_0xf944('0x40')]=_[_0xf944('0x55')](db[_0xf944('0x3c')][_0xf944('0x3d')]);_0xc4ebd6[_0xf944('0x41')]=_[_0xf944('0x55')](_0x1f0181[_0xf944('0x41')]);_0xc4ebd6[_0xf944('0x42')]=_['intersection'](_0xc4ebd6[_0xf944('0x40')],_0xc4ebd6[_0xf944('0x41')]);_0x324c27[_0xf944('0x44')]=_['intersection'](_0xc4ebd6[_0xf944('0x40')],qs[_0xf944('0x45')](_0x1f0181[_0xf944('0x41')]['fields']));_0x324c27[_0xf944('0x44')]=_0x324c27[_0xf944('0x44')][_0xf944('0x46')]?_0x324c27[_0xf944('0x44')]:_0xc4ebd6[_0xf944('0x40')];if(_0x1f0181['query']['includeAll']){_0x324c27[_0xf944('0x51')]=[{'all':!![]}];}_0x324c27=_[_0xf944('0x4d')]({},_0x324c27,_0x1f0181[_0xf944('0x56')]);return db['ChatGroup'][_0xf944('0x57')](_0x324c27)[_0xf944('0x21')](handleEntityNotFound(_0x14a785,null))[_0xf944('0x21')](respondWithResult(_0x14a785,null))[_0xf944('0x2a')](handleError(_0x14a785,null));};exports['create']=function(_0x3db3d6,_0xf963c4){return db[_0xf944('0x3c')][_0xf944('0x58')](_0x3db3d6[_0xf944('0x59')],{})[_0xf944('0x21')](respondWithResult(_0xf963c4,0xc9))[_0xf944('0x2a')](handleError(_0xf963c4,null));};exports[_0xf944('0x35')]=function(_0xaeded0,_0x13b947){if(_0xaeded0[_0xf944('0x59')]['id']){delete _0xaeded0[_0xf944('0x59')]['id'];}return db[_0xf944('0x3c')]['find']({'where':{'id':_0xaeded0[_0xf944('0x54')]['id']}})[_0xf944('0x21')](handleEntityNotFound(_0x13b947,null))[_0xf944('0x21')](saveUpdates(_0xaeded0[_0xf944('0x59')],null))[_0xf944('0x21')](respondWithResult(_0x13b947,null))[_0xf944('0x2a')](handleError(_0x13b947,null));};exports['destroy']=function(_0x2cac5c,_0x15ef5b){return db[_0xf944('0x3c')][_0xf944('0x57')]({'where':{'id':_0x2cac5c['params']['id']}})[_0xf944('0x21')](handleEntityNotFound(_0x15ef5b,null))['then'](removeEntity(_0x15ef5b,null))['catch'](handleError(_0x15ef5b,null));};exports[_0xf944('0x5a')]=function(_0x461f7c,_0x48c692){return db[_0xf944('0x3c')]['describe']()[_0xf944('0x21')](respondWithResult(_0x48c692,null))[_0xf944('0x2a')](handleError(_0x48c692,null));};exports[_0xf944('0x5b')]=function(_0x2cfd71,_0x138b4d,_0x2d5593){return db[_0xf944('0x5c')][_0xf944('0x2e')]({'where':{'ChatGroupId':_0x2cfd71[_0xf944('0x54')]['id'],'ToId':_0x2cfd71[_0xf944('0x5d')]['id'],'read':![]}})[_0xf944('0x21')](function(_0x2075fc){return{'id':_[_0xf944('0x5e')](_0x2cfd71[_0xf944('0x54')]['id']),'count':_0x2075fc};})['then'](respondWithResult(_0x138b4d,null))[_0xf944('0x2a')](handleError(_0x138b4d,null));};exports[_0xf944('0x5f')]=function(_0x45bffa,_0x590153,_0x5d5c8c){return db['ChatGroup'][_0xf944('0x57')]({'where':{'id':_0x45bffa[_0xf944('0x54')]['id']}})['then'](handleEntityNotFound(_0x590153,null))[_0xf944('0x21')](function(_0x58f2ba){if(_0x58f2ba){return _0x58f2ba[_0xf944('0x5f')](_0x45bffa[_0xf944('0x59')]['ids'],_[_0xf944('0x60')](_0x45bffa[_0xf944('0x59')],['ids','id'])||{});}})[_0xf944('0x21')](respondWithResult(_0x590153,null))[_0xf944('0x2a')](handleError(_0x590153,null));};exports[_0xf944('0x61')]=function(_0x132809,_0x430c4c,_0x33750c){var _0x30e5e7={};var _0x4aa9a0={};var _0x537ded;var _0x2debc1;return db[_0xf944('0x3c')][_0xf944('0x62')]({'where':{'id':_0x132809[_0xf944('0x54')]['id']}})[_0xf944('0x21')](handleEntityNotFound(_0x430c4c,null))['then'](function(_0x1339c4){if(_0x1339c4){_0x537ded=_0x1339c4;_0x4aa9a0[_0xf944('0x40')]=_[_0xf944('0x55')](db[_0xf944('0x63')][_0xf944('0x3d')]);_0x4aa9a0[_0xf944('0x41')]=_[_0xf944('0x55')](_0x132809[_0xf944('0x41')]);_0x4aa9a0[_0xf944('0x42')]=_[_0xf944('0x43')](_0x4aa9a0['model'],_0x4aa9a0[_0xf944('0x41')]);_0x30e5e7['attributes']=_[_0xf944('0x43')](_0x4aa9a0[_0xf944('0x40')],qs[_0xf944('0x45')](_0x132809[_0xf944('0x41')][_0xf944('0x45')]));_0x30e5e7[_0xf944('0x44')]=_0x30e5e7['attributes'][_0xf944('0x46')]?_0x30e5e7[_0xf944('0x44')]:_0x4aa9a0[_0xf944('0x40')];_0x30e5e7[_0xf944('0x49')]=qs[_0xf944('0x4a')](_0x132809[_0xf944('0x41')][_0xf944('0x4a')]);_0x30e5e7[_0xf944('0x4e')]=qs[_0xf944('0x42')](_[_0xf944('0x4b')](_0x132809[_0xf944('0x41')],_0x4aa9a0[_0xf944('0x42')]));if(_0x132809['query'][_0xf944('0x4c')]){_0x30e5e7[_0xf944('0x4e')]=_[_0xf944('0x4d')](_0x30e5e7[_0xf944('0x4e')],{'$or':_[_0xf944('0x3b')](_0x30e5e7[_0xf944('0x44')],function(_0x5421a2){var _0x2586ee={};_0x2586ee[_0x5421a2]={'$like':'%'+_0x132809['query']['filter']+'%'};return _0x2586ee;})});}_0x30e5e7=_[_0xf944('0x4d')]({},_0x30e5e7,_0x132809[_0xf944('0x56')]);return _0x537ded[_0xf944('0x61')](_0x30e5e7);}})['then'](function(_0x2be43d){if(_0x2be43d){_0x2debc1=_0x2be43d[_0xf944('0x46')];if(!_0x132809[_0xf944('0x41')][_0xf944('0x47')](_0xf944('0x48'))){_0x30e5e7[_0xf944('0x30')]=qs[_0xf944('0x30')](_0x132809['query'][_0xf944('0x30')]);_0x30e5e7[_0xf944('0x2f')]=qs[_0xf944('0x2f')](_0x132809[_0xf944('0x41')]['offset']);}return _0x537ded[_0xf944('0x61')](_0x30e5e7);}})[_0xf944('0x21')](function(_0x1fb77d){if(_0x1fb77d){return _0x1fb77d?{'count':_0x2debc1,'rows':_0x1fb77d}:null;}})[_0xf944('0x21')](respondWithResult(_0x430c4c,null))['catch'](handleError(_0x430c4c,null));};exports['removeMembers']=function(_0x73caf7,_0x4e1326,_0x170c9b){return db['ChatGroup'][_0xf944('0x57')]({'where':{'id':_0x73caf7[_0xf944('0x54')]['id']}})[_0xf944('0x21')](handleEntityNotFound(_0x4e1326,null))[_0xf944('0x21')](function(_0x27b9ef){if(_0x27b9ef){return _0x27b9ef['removeMembers'](_0x73caf7['query'][_0xf944('0x64')]);}})['then'](respondWithStatusCode(_0x4e1326,null))['catch'](handleError(_0x4e1326,null));};exports[_0xf944('0x65')]=function(_0x300aaa,_0x1871b0,_0x450869){if(_0x300aaa[_0xf944('0x59')]['id']){delete _0x300aaa[_0xf944('0x59')]['id'];}return db[_0xf944('0x3c')][_0xf944('0x57')]({'where':{'id':_0x300aaa[_0xf944('0x54')]['id']}})[_0xf944('0x21')](handleEntityNotFound(_0x1871b0,null))[_0xf944('0x21')](function(_0x3a3646){if(_0x3a3646){_0x300aaa['body'][_0xf944('0x66')]=_0x3a3646['id'];return db[_0xf944('0x5c')]['create'](_0x300aaa[_0xf944('0x59')]);}})[_0xf944('0x21')](respondWithResult(_0x1871b0,null))['catch'](handleError(_0x1871b0,null));};exports[_0xf944('0x67')]=function(_0x2f25de,_0x26c70e,_0x3076fd){var _0x2a4afb={};var _0x172950={};var _0x3c8dd0;var _0x4d9e1d;return db['ChatGroup'][_0xf944('0x62')]({'where':{'id':_0x2f25de[_0xf944('0x54')]['id']}})[_0xf944('0x21')](handleEntityNotFound(_0x26c70e,null))['then'](function(_0x413f73){if(_0x413f73){_0x3c8dd0=_0x413f73;_0x172950[_0xf944('0x40')]=_[_0xf944('0x55')](db[_0xf944('0x5c')][_0xf944('0x3d')]);_0x172950['query']=_[_0xf944('0x55')](_0x2f25de[_0xf944('0x41')]);_0x172950['filters']=_[_0xf944('0x43')](_0x172950[_0xf944('0x40')],_0x172950[_0xf944('0x41')]);_0x2a4afb[_0xf944('0x44')]=_[_0xf944('0x43')](_0x172950[_0xf944('0x40')],qs[_0xf944('0x45')](_0x2f25de[_0xf944('0x41')][_0xf944('0x45')]));_0x2a4afb['attributes']=_0x2a4afb[_0xf944('0x44')]['length']?_0x2a4afb[_0xf944('0x44')]:_0x172950[_0xf944('0x40')];_0x2a4afb[_0xf944('0x49')]=qs[_0xf944('0x4a')](_0x2f25de[_0xf944('0x41')][_0xf944('0x4a')]);_0x2a4afb[_0xf944('0x4e')]=qs[_0xf944('0x42')](_[_0xf944('0x4b')](_0x2f25de['query'],_0x172950['filters']));if(_0x2f25de['query']['filter']){_0x2a4afb['where']=_[_0xf944('0x4d')](_0x2a4afb[_0xf944('0x4e')],{'$or':_[_0xf944('0x3b')](_0x2a4afb[_0xf944('0x44')],function(_0x5742d6){var _0x24a139={};_0x24a139[_0x5742d6]={'$like':'%'+_0x2f25de[_0xf944('0x41')]['filter']+'%'};return _0x24a139;})});}if(_0x2f25de[_0xf944('0x41')]['$gte']){var _0xe62e1f=_0x2f25de[_0xf944('0x41')][_0xf944('0x68')][_0xf944('0x69')](',');var _0x3d6aac={};_0x3d6aac[_0xe62e1f[0x0]]={'$gte':moment(_0xe62e1f[0x1])['format'](_0xf944('0x6a'))};_0x2a4afb[_0xf944('0x4e')]=_[_0xf944('0x4d')](_0x2a4afb[_0xf944('0x4e')],_0x3d6aac);}_0x2a4afb=_['merge']({},_0x2a4afb,_0x2f25de[_0xf944('0x56')]);return _0x3c8dd0[_0xf944('0x67')](_0x2a4afb);}})[_0xf944('0x21')](function(_0x283ce6){if(_0x283ce6){_0x4d9e1d=_0x283ce6[_0xf944('0x46')];if(!_0x2f25de[_0xf944('0x41')][_0xf944('0x47')](_0xf944('0x48'))){_0x2a4afb[_0xf944('0x30')]=qs['limit'](_0x2f25de[_0xf944('0x41')][_0xf944('0x30')]);_0x2a4afb[_0xf944('0x2f')]=qs[_0xf944('0x2f')](_0x2f25de[_0xf944('0x41')][_0xf944('0x2f')]);}return _0x3c8dd0[_0xf944('0x67')](_0x2a4afb);}})[_0xf944('0x21')](function(_0x2b2b55){if(_0x2b2b55){return _0x2b2b55?{'count':_0x4d9e1d,'rows':_0x2b2b55}:null;}})[_0xf944('0x21')](respondWithResult(_0x26c70e,null))['catch'](handleError(_0x26c70e,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index acbacd6..99ae737 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 _0xdb28=['ChatGroup','setMaxListeners','update','remove','emit','exports','events','../../mysqldb'];(function(_0x3dea19,_0x1e0b54){var _0x4439f7=function(_0x482472){while(--_0x482472){_0x3dea19['push'](_0x3dea19['shift']());}};_0x4439f7(++_0x1e0b54);}(_0xdb28,0x106));var _0x8db2=function(_0x130258,_0x1a1e2f){_0x130258=_0x130258-0x0;var _0x58c403=_0xdb28[_0x130258];return _0x58c403;};'use strict';var EventEmitter=require(_0x8db2('0x0'));var ChatGroup=require(_0x8db2('0x1'))['db'][_0x8db2('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x8db2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8db2('0x4'),'afterDestroy':_0x8db2('0x5')};function emitEvent(_0xfcf49f){return function(_0x4426fe,_0x11109e,_0x52bf99){ChatGroupEvents[_0x8db2('0x6')](_0xfcf49f+':'+_0x4426fe['id'],_0x4426fe);ChatGroupEvents[_0x8db2('0x6')](_0xfcf49f,_0x4426fe);_0x52bf99(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x8db2('0x7')]=ChatGroupEvents; \ No newline at end of file +var _0xdb28=['ChatGroup','setMaxListeners','update','remove','emit','exports','events','../../mysqldb'];(function(_0x4a140b,_0x28dedd){var _0x22a5fc=function(_0x42a7fc){while(--_0x42a7fc){_0x4a140b['push'](_0x4a140b['shift']());}};_0x22a5fc(++_0x28dedd);}(_0xdb28,0x106));var _0x8db2=function(_0x41a308,_0x58ba17){_0x41a308=_0x41a308-0x0;var _0x4fbab2=_0xdb28[_0x41a308];return _0x4fbab2;};'use strict';var EventEmitter=require(_0x8db2('0x0'));var ChatGroup=require(_0x8db2('0x1'))['db'][_0x8db2('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x8db2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8db2('0x4'),'afterDestroy':_0x8db2('0x5')};function emitEvent(_0xfcf49f){return function(_0x4426fe,_0x11109e,_0x52bf99){ChatGroupEvents[_0x8db2('0x6')](_0xfcf49f+':'+_0x4426fe['id'],_0x4426fe);ChatGroupEvents[_0x8db2('0x6')](_0xfcf49f,_0x4426fe);_0x52bf99(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x8db2('0x7')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index d1aea9b..2101205 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 _0x35d0=['moment','bluebird','request-promise','path','rimraf','./chatGroup.attributes','exports','ChatGroup','chat_groups','lodash','util','api'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0x35d0,0xf9));var _0x035d=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0x35d0[_0x432fca];return _0x3adba4;};'use strict';var _=require(_0x035d('0x0'));var util=require(_0x035d('0x1'));var logger=require('../../config/logger')(_0x035d('0x2'));var moment=require(_0x035d('0x3'));var BPromise=require(_0x035d('0x4'));var rp=require(_0x035d('0x5'));var fs=require('fs');var path=require(_0x035d('0x6'));var rimraf=require(_0x035d('0x7'));var config=require('../../config/environment');var attributes=require(_0x035d('0x8'));module[_0x035d('0x9')]=function(_0x3e6d36,_0x3f5f0d){return _0x3e6d36['define'](_0x035d('0xa'),attributes,{'tableName':_0x035d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6108=['../../config/logger','api','moment','path','rimraf','exports','define','chat_groups','lodash'];(function(_0x58c20f,_0x4cdb1b){var _0x3b0318=function(_0x36fa84){while(--_0x36fa84){_0x58c20f['push'](_0x58c20f['shift']());}};_0x3b0318(++_0x4cdb1b);}(_0x6108,0xbc));var _0x8610=function(_0x1b7559,_0x7a08a7){_0x1b7559=_0x1b7559-0x0;var _0x1b1784=_0x6108[_0x1b7559];return _0x1b1784;};'use strict';var _=require(_0x8610('0x0'));var util=require('util');var logger=require(_0x8610('0x1'))(_0x8610('0x2'));var moment=require(_0x8610('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8610('0x4'));var rimraf=require(_0x8610('0x5'));var config=require('../../config/environment');var attributes=require('./chatGroup.attributes');module[_0x8610('0x6')]=function(_0x1ca62b,_0x28a680){return _0x1ca62b[_0x8610('0x7')]('ChatGroup',attributes,{'tableName':_0x8610('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index 2fcd85d..aae35a1 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 _0xc795=['../../config/logger','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1f6e37,_0x560390){var _0x3d17ad=function(_0x23a623){while(--_0x23a623){_0x1f6e37['push'](_0x1f6e37['shift']());}};_0x3d17ad(++_0x560390);}(_0xc795,0xbc));var _0x5c79=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xc795[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x5c79('0x0'));var util=require(_0x5c79('0x1'));var moment=require(_0x5c79('0x2'));var BPromise=require(_0x5c79('0x3'));var rs=require(_0x5c79('0x4'));var fs=require('fs');var Redis=require(_0x5c79('0x5'));var db=require(_0x5c79('0x6'))['db'];var utils=require(_0x5c79('0x7'));var logger=require(_0x5c79('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5c79('0x9'));var client=jayson[_0x5c79('0xa')][_0x5c79('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x5c79('0xc')],{'host':_0x5c79('0xd'),'port':0x18eb});var socket=require(_0x5c79('0xe'))(new Redis(config[_0x5c79('0xc')]));require('./chatGroup.socket')[_0x5c79('0xf')](socket);function respondWithRpcPromise(_0x4c6439,_0x1a307e,_0xc3f58c){return new BPromise(function(_0x49cf38,_0xcf58a2){return client[_0x5c79('0x10')](_0x4c6439,_0xc3f58c)['then'](function(_0x1da914){logger['info'](_0x5c79('0x11'),_0x1a307e,_0x5c79('0x12'));logger[_0x5c79('0x13')](_0x5c79('0x14'),_0x1a307e,_0x5c79('0x12'),JSON[_0x5c79('0x15')](_0x1da914));if(_0x1da914[_0x5c79('0x16')]){if(_0x1da914[_0x5c79('0x16')][_0x5c79('0x17')]===0x1f4){logger[_0x5c79('0x16')]('ChatGroup,\x20%s,\x20%s',_0x1a307e,_0x1da914[_0x5c79('0x16')]['message']);return _0xcf58a2(_0x1da914[_0x5c79('0x16')][_0x5c79('0x18')]);}logger[_0x5c79('0x16')](_0x5c79('0x11'),_0x1a307e,_0x1da914[_0x5c79('0x16')][_0x5c79('0x18')]);return _0x49cf38(_0x1da914['error'][_0x5c79('0x18')]);}else{logger[_0x5c79('0x19')](_0x5c79('0x11'),_0x1a307e,_0x5c79('0x12'));_0x49cf38(_0x1da914[_0x5c79('0x1a')][_0x5c79('0x18')]);}})[_0x5c79('0x1b')](function(_0x14a92c){logger[_0x5c79('0x16')]('ChatGroup,\x20%s,\x20%s',_0x1a307e,_0x14a92c);_0xcf58a2(_0x14a92c);});});} \ No newline at end of file +var _0xaea0=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatGroup.socket','register','request','then','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','code','error','message','ChatGroup,\x20%s,\x20%s','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xaea0,0x1c9));var _0x0aea=function(_0x4a96ca,_0x13754e){_0x4a96ca=_0x4a96ca-0x0;var _0x2aed48=_0xaea0[_0x4a96ca];return _0x2aed48;};'use strict';var _=require(_0x0aea('0x0'));var util=require(_0x0aea('0x1'));var moment=require(_0x0aea('0x2'));var BPromise=require(_0x0aea('0x3'));var rs=require(_0x0aea('0x4'));var fs=require('fs');var Redis=require(_0x0aea('0x5'));var db=require(_0x0aea('0x6'))['db'];var utils=require(_0x0aea('0x7'));var logger=require(_0x0aea('0x8'))(_0x0aea('0x9'));var config=require(_0x0aea('0xa'));var jayson=require(_0x0aea('0xb'));var client=jayson[_0x0aea('0xc')][_0x0aea('0xd')]({'port':0x232a});config[_0x0aea('0xe')]=_[_0x0aea('0xf')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0aea('0x10'))(new Redis(config[_0x0aea('0xe')]));require(_0x0aea('0x11'))[_0x0aea('0x12')](socket);function respondWithRpcPromise(_0x39704a,_0x4336d4,_0x5a79dc){return new BPromise(function(_0x1abe33,_0xe1752f){return client[_0x0aea('0x13')](_0x39704a,_0x5a79dc)[_0x0aea('0x14')](function(_0x562a8c){logger['info']('ChatGroup,\x20%s,\x20%s',_0x4336d4,_0x0aea('0x15'));logger[_0x0aea('0x16')](_0x0aea('0x17'),_0x4336d4,_0x0aea('0x15'),JSON[_0x0aea('0x18')](_0x562a8c));if(_0x562a8c['error']){if(_0x562a8c['error'][_0x0aea('0x19')]===0x1f4){logger[_0x0aea('0x1a')]('ChatGroup,\x20%s,\x20%s',_0x4336d4,_0x562a8c[_0x0aea('0x1a')][_0x0aea('0x1b')]);return _0xe1752f(_0x562a8c[_0x0aea('0x1a')]['message']);}logger[_0x0aea('0x1a')](_0x0aea('0x1c'),_0x4336d4,_0x562a8c['error'][_0x0aea('0x1b')]);return _0x1abe33(_0x562a8c[_0x0aea('0x1a')][_0x0aea('0x1b')]);}else{logger[_0x0aea('0x1d')](_0x0aea('0x1c'),_0x4336d4,_0x0aea('0x15'));_0x1abe33(_0x562a8c['result'][_0x0aea('0x1b')]);}})[_0x0aea('0x1e')](function(_0x598e42){logger[_0x0aea('0x1a')](_0x0aea('0x1c'),_0x4336d4,_0x598e42);_0xe1752f(_0x598e42);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 3770614..37e4831 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 _0xa891=['length','chatGroup:','./chatGroup.events','save','update','emit','removeListener','register'];(function(_0x4966f2,_0x364a49){var _0x4ba4d5=function(_0xe5d292){while(--_0xe5d292){_0x4966f2['push'](_0x4966f2['shift']());}};_0x4ba4d5(++_0x364a49);}(_0xa891,0xea));var _0x1a89=function(_0x2d185b,_0x49d0d0){_0x2d185b=_0x2d185b-0x0;var _0xd12b3b=_0xa891[_0x2d185b];return _0xd12b3b;};'use strict';var ChatGroupEvents=require(_0x1a89('0x0'));var events=[_0x1a89('0x1'),'remove',_0x1a89('0x2')];function createListener(_0x3efa53,_0x4b524a){return function(_0x5ae592){_0x4b524a[_0x1a89('0x3')](_0x3efa53,_0x5ae592);};}function removeListener(_0x35238e,_0x4b776c){return function(){ChatGroupEvents[_0x1a89('0x4')](_0x35238e,_0x4b776c);};}exports[_0x1a89('0x5')]=function(_0x4782b6){for(var _0x385274=0x0,_0x53ef0a=events[_0x1a89('0x6')];_0x385274<_0x53ef0a;_0x385274++){var _0x4d7b26=events[_0x385274];var _0x243673=createListener(_0x1a89('0x7')+_0x4d7b26,_0x4782b6);ChatGroupEvents['on'](_0x4d7b26,_0x243673);}}; \ No newline at end of file +var _0x99f6=['emit','removeListener','register','chatGroup:','./chatGroup.events','save','update'];(function(_0x1e3dfc,_0x2f7dce){var _0x3ce057=function(_0x29bc25){while(--_0x29bc25){_0x1e3dfc['push'](_0x1e3dfc['shift']());}};_0x3ce057(++_0x2f7dce);}(_0x99f6,0x66));var _0x699f=function(_0x345f08,_0x43ec54){_0x345f08=_0x345f08-0x0;var _0x4f8bc1=_0x99f6[_0x345f08];return _0x4f8bc1;};'use strict';var ChatGroupEvents=require(_0x699f('0x0'));var events=[_0x699f('0x1'),'remove',_0x699f('0x2')];function createListener(_0x1c5055,_0x414ec0){return function(_0x24c29){_0x414ec0[_0x699f('0x3')](_0x1c5055,_0x24c29);};}function removeListener(_0x17c5c4,_0x4fdd79){return function(){ChatGroupEvents[_0x699f('0x4')](_0x17c5c4,_0x4fdd79);};}exports[_0x699f('0x5')]=function(_0x47fe0d){for(var _0x366f4a=0x0,_0x3a8fce=events['length'];_0x366f4a<_0x3a8fce;_0x366f4a++){var _0x9951f0=events[_0x366f4a];var _0x682765=createListener(_0x699f('0x6')+_0x9951f0,_0x47fe0d);ChatGroupEvents['on'](_0x9951f0,_0x682765);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index cde15f0..44dc620 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 _0x0270=['../../components/interaction/service','../../config/environment','./chatGroup.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','getMessages','create','post','addMembers','/:id/messages','addMessage','put','delete','destroy','removeMembers','exports','multer','connect-timeout','express','Router','../../components/auth/service'];(function(_0x2b98d4,_0x1de753){var _0x76ce5b=function(_0x5bfe11){while(--_0x5bfe11){_0x2b98d4['push'](_0x2b98d4['shift']());}};_0x76ce5b(++_0x1de753);}(_0x0270,0x1db));var _0x0027=function(_0x29e070,_0x1c1805){_0x29e070=_0x29e070-0x0;var _0x54fa78=_0x0270[_0x29e070];return _0x54fa78;};'use strict';var multer=require(_0x0027('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0027('0x1'));var express=require(_0x0027('0x2'));var router=express[_0x0027('0x3')]();var auth=require(_0x0027('0x4'));var interaction=require(_0x0027('0x5'));var config=require(_0x0027('0x6'));var controller=require(_0x0027('0x7'));router[_0x0027('0x8')]('/',auth['isAuthenticated'](),controller[_0x0027('0x9')]);router[_0x0027('0x8')](_0x0027('0xa'),auth[_0x0027('0xb')](),controller[_0x0027('0xc')]);router['get'](_0x0027('0xd'),auth[_0x0027('0xb')](),controller[_0x0027('0xe')]);router['get'](_0x0027('0xf'),auth[_0x0027('0xb')](),controller[_0x0027('0x10')]);router[_0x0027('0x8')](_0x0027('0x11'),auth[_0x0027('0xb')](),controller[_0x0027('0x12')]);router[_0x0027('0x8')]('/:id/messages',auth[_0x0027('0xb')](),controller[_0x0027('0x13')]);router['post']('/',auth[_0x0027('0xb')](),controller[_0x0027('0x14')]);router[_0x0027('0x15')](_0x0027('0x11'),auth[_0x0027('0xb')](),controller[_0x0027('0x16')]);router[_0x0027('0x15')](_0x0027('0x17'),auth[_0x0027('0xb')](),controller[_0x0027('0x18')]);router[_0x0027('0x19')]('/:id',auth[_0x0027('0xb')](),controller['update']);router[_0x0027('0x1a')](_0x0027('0xd'),auth[_0x0027('0xb')](),controller[_0x0027('0x1b')]);router['delete'](_0x0027('0x11'),auth[_0x0027('0xb')](),controller[_0x0027('0x1c')]);module[_0x0027('0x1d')]=router; \ No newline at end of file +var _0x2bbe=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/unread','getMembers','post','create','/:id/members','addMembers','addMessage','put','update','delete','removeMembers','multer'];(function(_0x36b037,_0x2b234e){var _0x409194=function(_0xddc9dc){while(--_0xddc9dc){_0x36b037['push'](_0x36b037['shift']());}};_0x409194(++_0x2b234e);}(_0x2bbe,0x1da));var _0xe2bb=function(_0x59c63d,_0x3ec663){_0x59c63d=_0x59c63d-0x0;var _0x309f26=_0x2bbe[_0x59c63d];return _0x309f26;};'use strict';var multer=require(_0xe2bb('0x0'));var util=require(_0xe2bb('0x1'));var path=require(_0xe2bb('0x2'));var timeout=require(_0xe2bb('0x3'));var express=require('express');var router=express[_0xe2bb('0x4')]();var auth=require(_0xe2bb('0x5'));var interaction=require(_0xe2bb('0x6'));var config=require(_0xe2bb('0x7'));var controller=require('./chatGroup.controller');router[_0xe2bb('0x8')]('/',auth[_0xe2bb('0x9')](),controller[_0xe2bb('0xa')]);router[_0xe2bb('0x8')]('/describe',auth[_0xe2bb('0x9')](),controller[_0xe2bb('0xb')]);router[_0xe2bb('0x8')](_0xe2bb('0xc'),auth['isAuthenticated'](),controller[_0xe2bb('0xd')]);router[_0xe2bb('0x8')](_0xe2bb('0xe'),auth['isAuthenticated'](),controller['getUnread']);router['get']('/:id/members',auth[_0xe2bb('0x9')](),controller[_0xe2bb('0xf')]);router[_0xe2bb('0x8')]('/:id/messages',auth[_0xe2bb('0x9')](),controller['getMessages']);router[_0xe2bb('0x10')]('/',auth['isAuthenticated'](),controller[_0xe2bb('0x11')]);router[_0xe2bb('0x10')](_0xe2bb('0x12'),auth[_0xe2bb('0x9')](),controller[_0xe2bb('0x13')]);router[_0xe2bb('0x10')]('/:id/messages',auth[_0xe2bb('0x9')](),controller[_0xe2bb('0x14')]);router[_0xe2bb('0x15')]('/:id',auth[_0xe2bb('0x9')](),controller[_0xe2bb('0x16')]);router[_0xe2bb('0x17')]('/:id',auth[_0xe2bb('0x9')](),controller['destroy']);router['delete']('/:id/members',auth[_0xe2bb('0x9')](),controller[_0xe2bb('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index d79ca6d..8e26ef3 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 _0x00ba=['BOOLEAN','INTEGER','ENUM','star','STRING','DATE','TEXT','long','out','sequelize','exports'];(function(_0x392346,_0x127469){var _0x20866=function(_0x3ee3be){while(--_0x3ee3be){_0x392346['push'](_0x392346['shift']());}};_0x20866(++_0x127469);}(_0x00ba,0x1ed));var _0xa00b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x00ba[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xa00b('0x0'));module[_0xa00b('0x1')]={'closed':{'type':Sequelize[_0xa00b('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xa00b('0x3')]},'ratingType':{'type':Sequelize[_0xa00b('0x4')](_0xa00b('0x5'),'thumb'),'defaultValue':_0xa00b('0x5')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0xa00b('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xa00b('0x7')]},'disposition':{'type':Sequelize[_0xa00b('0x6')]},'note':{'type':Sequelize[_0xa00b('0x6')]},'browserName':{'type':Sequelize[_0xa00b('0x6')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xa00b('0x6')]},'osVersion':{'type':Sequelize[_0xa00b('0x6')]},'deviceModel':{'type':Sequelize[_0xa00b('0x6')]},'deviceVendor':{'type':Sequelize[_0xa00b('0x6')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0xa00b('0x8')]},'customerIp':{'type':Sequelize[_0xa00b('0x6')]},'formData':{'type':Sequelize[_0xa00b('0x8')](_0xa00b('0x9'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0xa00b('0x7')]},'lastMsgDirection':{'type':Sequelize[_0xa00b('0x4')]('in',_0xa00b('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xa00b('0x6')]},'customerPort':{'type':Sequelize[_0xa00b('0x6')]}}; \ No newline at end of file +var _0xdb34=['sequelize','INTEGER','ENUM','thumb','TEXT','STRING','long','DATE','out'];(function(_0x55749d,_0x30b18b){var _0x23edaf=function(_0x29088e){while(--_0x29088e){_0x55749d['push'](_0x55749d['shift']());}};_0x23edaf(++_0x30b18b);}(_0xdb34,0x90));var _0x4db3=function(_0x4d4e37,_0x183b97){_0x4d4e37=_0x4d4e37-0x0;var _0x3b7e2c=_0xdb34[_0x4d4e37];return _0x3b7e2c;};'use strict';var Sequelize=require(_0x4db3('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x4db3('0x1')]},'ratingType':{'type':Sequelize[_0x4db3('0x2')]('star',_0x4db3('0x3')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x4db3('0x4')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x4db3('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x4db3('0x5')]},'note':{'type':Sequelize[_0x4db3('0x5')]},'browserName':{'type':Sequelize[_0x4db3('0x5')]},'browserVersion':{'type':Sequelize[_0x4db3('0x5')]},'osName':{'type':Sequelize[_0x4db3('0x5')]},'osVersion':{'type':Sequelize[_0x4db3('0x5')]},'deviceModel':{'type':Sequelize[_0x4db3('0x5')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x4db3('0x4')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x4db3('0x4')](_0x4db3('0x6'))},'read1stAt':{'type':Sequelize[_0x4db3('0x7')]},'lastMsgAt':{'type':Sequelize[_0x4db3('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x4db3('0x2')]('in',_0x4db3('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x4db3('0x5')]},'customerPort':{'type':Sequelize[_0x4db3('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 9759b4d..b6d0f6d 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 _0xd96b=['find','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','$substring','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','forEach','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','keys','some','compact','isEmpty','ChatWebsiteId','concat','createdAt','parse','$gte','$lte','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','clone','DESC','t.id\x20IN\x20?','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','sequelize','count','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','show','includeAll','include','create','params','describe','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','disposition','AbandonInteraction','attachmentUpload','file','originalname','filename','mimetype','Attachment','attachmentDownload','findOne','closed','Unauthorized','download','join','root','basename','close','mailTranscript','server/files/chat/upload/','now','ChatMessage','Messages','ChatWebsite','format','%s%d','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','agentAlias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','ChatInteractionId','findAll','rows','options','includeAgent','addTags','spread','emit','chatInteractionTags:save','removeTags','server','tmp','files','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','mkdirSync','40px','\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\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\x20\x20\x20\x20\x20\x20\x20','\x0a\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\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20','Chat','YYYY-MM-DD','Account','Owner','YYYY-MM-DD\x20HH:mm:ss','closedAt','browserName','osName','referer','customerPort','N.A.','tail','existsSync','pipe','createWriteStream','out','renderFile','views','downloadInteraction.html','transcript-','log','err','unlinkSync','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','client','http','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~!@#$%^&-_=+[{]}.','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','status','offset','limit','set','Content-Range','json','apply','save','update','then','end','sendStatus','stack','name','send','fullname','TagIds','Tags','split','push','map','ChatInteraction','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','expr','parseSearch','search','sqlOperator','conditions'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xd96b,0xc0));var _0xbd96=function(_0x5f370a,_0x40d712){_0x5f370a=_0x5f370a-0x0;var _0x3b5a7f=_0xd96b[_0x5f370a];return _0x3b5a7f;};'use strict';var pdf=require(_0xbd96('0x0'));var emlformat=require(_0xbd96('0x1'));var rimraf=require(_0xbd96('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbd96('0x3'));var rp=require(_0xbd96('0x4'));var moment=require(_0xbd96('0x5'));var BPromise=require(_0xbd96('0x6'));var Mustache=require(_0xbd96('0x7'));var util=require(_0xbd96('0x8'));var path=require(_0xbd96('0x9'));var sox=require(_0xbd96('0xa'));var csv=require(_0xbd96('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xbd96('0xc'));var squel=require(_0xbd96('0xd'));var crypto=require('crypto');var jsforce=require(_0xbd96('0xe'));var deskjs=require(_0xbd96('0xf'));var toCsv=require(_0xbd96('0xb'));var querystring=require(_0xbd96('0x10'));var Papa=require(_0xbd96('0x11'));var Redis=require(_0xbd96('0x12'));var authService=require(_0xbd96('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xbd96('0x14'));var hardwareService=require(_0xbd96('0x15'));var logger=require(_0xbd96('0x16'))(_0xbd96('0x17'));var utils=require(_0xbd96('0x18'));var config=require(_0xbd96('0x19'));var db=require(_0xbd96('0x1a'))['db'];config['redis']=_['defaults'](config[_0xbd96('0x1b')],{'host':_0xbd96('0x1c'),'port':0x18eb});var socket=require(_0xbd96('0x1d'))(new Redis(config['redis']));require(_0xbd96('0x1e'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232b});var client9004=jayson[_0xbd96('0x1f')][_0xbd96('0x20')]({'port':0x232c});function checkPasswordPattern(_0x185206,_0x5b33f4,_0x39cc5f){if(_0x39cc5f){var _0x50497d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x50497d['test'](_0x5b33f4)){return _0x185206;}else{throw new db['Sequelize'][(_0xbd96('0x21'))](_0xbd96('0x22'));}}else{return _0x185206;}}function respondWithRpcPromise(_0x4b03f0,_0x38359d,_0x1f6617,_0x1947ed){return new BPromise(function(_0x6c8e9e,_0x1851ba){var _0x16d010=_0x1947ed||client;return _0x16d010['request'](_0x4b03f0,_0x1f6617)['then'](function(_0x1d22a6){logger[_0xbd96('0x23')](_0xbd96('0x24'),_0x38359d,_0xbd96('0x25'));logger[_0xbd96('0x26')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x38359d,'request\x20sent',JSON[_0xbd96('0x27')](_0x1d22a6));if(_0x1d22a6[_0xbd96('0x28')]){if(_0x1d22a6[_0xbd96('0x28')][_0xbd96('0x29')]===0x1f4){logger['error'](_0xbd96('0x24'),_0x38359d,_0x1d22a6[_0xbd96('0x28')][_0xbd96('0x2a')]);return _0x1851ba(_0x1d22a6['error']['message']);}logger[_0xbd96('0x28')](_0xbd96('0x24'),_0x38359d,_0x1d22a6[_0xbd96('0x28')][_0xbd96('0x2a')]);return _0x6c8e9e(_0x1d22a6[_0xbd96('0x28')][_0xbd96('0x2a')]);}else{logger[_0xbd96('0x23')](_0xbd96('0x24'),_0x38359d,_0xbd96('0x25'));_0x6c8e9e(_0x1d22a6[_0xbd96('0x2b')][_0xbd96('0x2a')]);}})[_0xbd96('0x2c')](function(_0x1df95d){logger[_0xbd96('0x28')](_0xbd96('0x24'),_0x38359d,_0x1df95d);_0x1851ba(_0x1df95d);});});}function respondWithStatusCode(_0x407b71,_0x13ab2a){_0x13ab2a=_0x13ab2a||0xcc;return function(_0x50eabc){if(_0x50eabc){return _0x407b71['sendStatus'](_0x13ab2a);}return _0x407b71[_0xbd96('0x2d')](_0x13ab2a)['end']();};}function respondWithResult(_0x3125a0,_0xcb7416){_0xcb7416=_0xcb7416||0xc8;return function(_0x4b3aa5){if(_0x4b3aa5){return _0x3125a0[_0xbd96('0x2d')](_0xcb7416)['json'](_0x4b3aa5);}};}function respondWithFilteredResult(_0x5d46a2,_0x1ed609){return function(_0x355f9a){if(_0x355f9a){var _0x595364=_0x355f9a['count'],_0x27ae48=_0x1ed609[_0xbd96('0x2e')],_0x32de76=_0x1ed609[_0xbd96('0x2e')]+_0x1ed609[_0xbd96('0x2f')],_0x53081b;if(_0x32de76>=_0x595364){_0x32de76=_0x595364;_0x53081b=0xc8;}else{_0x53081b=0xce;}_0x5d46a2[_0xbd96('0x2d')](_0x53081b);return _0x5d46a2[_0xbd96('0x30')](_0xbd96('0x31'),_0x27ae48+'-'+_0x32de76+'/'+_0x595364)[_0xbd96('0x32')](_0x355f9a);}return null;};}function patchUpdates(_0x372d94){return function(_0x528d98){try{jsonpatch[_0xbd96('0x33')](_0x528d98,_0x372d94,!![]);}catch(_0x575423){return BPromise['reject'](_0x575423);}return _0x528d98[_0xbd96('0x34')]();};}function saveUpdates(_0x2f4ce5,_0x1f1eb9){return function(_0x1648a9){if(_0x1648a9){return _0x1648a9[_0xbd96('0x35')](_0x2f4ce5)[_0xbd96('0x36')](function(_0x2b9ce3){return _0x2b9ce3;});}return null;};}function removeEntity(_0x40ea8c,_0x102786){return function(_0x5d0931){if(_0x5d0931){return _0x5d0931['destroy']()[_0xbd96('0x36')](function(){_0x40ea8c['status'](0xcc)[_0xbd96('0x37')]();});}};}function handleEntityNotFound(_0xd47dca,_0x55de01){return function(_0x108d47){if(!_0x108d47){_0xd47dca[_0xbd96('0x38')](0x194);}return _0x108d47;};}function handleError(_0x29841b,_0x350482){_0x350482=_0x350482||0x1f4;return function(_0x587bf8){logger[_0xbd96('0x28')](_0x587bf8[_0xbd96('0x39')]);if(_0x587bf8[_0xbd96('0x3a')]){delete _0x587bf8[_0xbd96('0x3a')];}_0x29841b['status'](_0x350482)[_0xbd96('0x3b')](_0x587bf8);};}function getInteractionUsers(_0x461cf0,_0x3c3340){return new BPromise(function(_0x1954a2,_0x1ff962){try{if(_0x3c3340[_0x461cf0['id']]){_0x461cf0['Users']=_['map'](_0x3c3340[_0x461cf0['id']],function(_0x22db2b){return{'id':_0x22db2b['id'],'fullname':_0x22db2b[_0xbd96('0x3c')]};});}}catch(_0x3371ba){_0x1ff962(_0x3371ba);}_0x1954a2(_0x461cf0);});}function getInteractionTags(_0x33c11b,_0x1d3678){return new BPromise(function(_0x5d279e,_0x4e1e0a){try{if(_0x33c11b[_0xbd96('0x3d')]){_0x33c11b[_0xbd96('0x3e')]=[];_0x33c11b[_0xbd96('0x3d')][_0xbd96('0x3f')](',')['forEach'](function(_0x35592c){_0x33c11b['Tags'][_0xbd96('0x40')](_0x1d3678[_0x35592c]);});}delete _0x33c11b[_0xbd96('0x3d')];}catch(_0x4544ea){_0x4e1e0a(_0x4544ea);}_0x5d279e(_0x33c11b);});}function updateChatInteraction(_0x537d2c,_0x35c295,_0x1e94bd){return new BPromise(function(_0x176a44,_0x122672){return getInteractionUsers(_0x537d2c,_0x1e94bd)['then'](function(_0x942dda){return getInteractionTags(_0x942dda,_0x35c295);})['then'](function(_0x35c13c){_0x176a44(_0x35c13c);})[_0xbd96('0x2c')](function(_0xe1b7a5){_0x122672(_0xe1b7a5);});});}exports['index']=function(_0x4ffd48,_0x5e6f63){var _0x4a0f31={},_0x188d8a={},_0x38d7b9={'count':0x0,'rows':[]};var _0x2afdb1=_[_0xbd96('0x41')](db[_0xbd96('0x42')][_0xbd96('0x43')],function(_0xf638b6){return{'name':_0xf638b6[_0xbd96('0x44')],'type':_0xf638b6[_0xbd96('0x45')][_0xbd96('0x46')]};});_0x188d8a[_0xbd96('0x47')]=_[_0xbd96('0x41')](_0x2afdb1,_0xbd96('0x3a'));_0x188d8a['query']=_['keys'](_0x4ffd48[_0xbd96('0x48')]);_0x188d8a[_0xbd96('0x49')]=_[_0xbd96('0x4a')](_0x188d8a[_0xbd96('0x47')],_0x188d8a[_0xbd96('0x48')]);_0x4a0f31[_0xbd96('0x4b')]=_[_0xbd96('0x4a')](_0x188d8a[_0xbd96('0x47')],qs[_0xbd96('0x4c')](_0x4ffd48[_0xbd96('0x48')]['fields']));_0x4a0f31['attributes']=_0x4a0f31[_0xbd96('0x4b')][_0xbd96('0x4d')]?_0x4a0f31[_0xbd96('0x4b')]:_0x188d8a[_0xbd96('0x47')];if(!_0x4ffd48[_0xbd96('0x48')][_0xbd96('0x4e')](_0xbd96('0x4f'))){_0x4a0f31[_0xbd96('0x2f')]=qs[_0xbd96('0x2f')](_0x4ffd48['query'][_0xbd96('0x2f')]);_0x4a0f31[_0xbd96('0x2e')]=qs['offset'](_0x4ffd48['query']['offset']);}_0x4a0f31[_0xbd96('0x50')]=qs['sort'](_0x4ffd48[_0xbd96('0x48')][_0xbd96('0x51')]);_0x4a0f31[_0xbd96('0x52')]=qs[_0xbd96('0x49')](_[_0xbd96('0x53')](_0x4ffd48[_0xbd96('0x48')],_0x188d8a[_0xbd96('0x49')]));var _0x2d47eb=[];var _0x2ab59e=squel[_0xbd96('0x54')]()[_0xbd96('0x55')]('id')[_0xbd96('0x55')](_0xbd96('0x3a'))[_0xbd96('0x55')](_0xbd96('0x56'))[_0xbd96('0x57')](_0xbd96('0x58'));var _0x242d76=squel[_0xbd96('0x54')]()[_0xbd96('0x55')](_0xbd96('0x59'))[_0xbd96('0x55')](_0xbd96('0x5a'))[_0xbd96('0x55')](_0xbd96('0x5b'))[_0xbd96('0x57')](_0xbd96('0x5c'),'ui')[_0xbd96('0x5d')](_0xbd96('0x5e'),'u',_0xbd96('0x5f'));var _0x5bb0c1=squel['select']()[_0xbd96('0x57')](_0xbd96('0x60'),'i')[_0xbd96('0x5d')](_0xbd96('0x61'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xbd96('0x5d')]('users','o',_0xbd96('0x62'))['left_join'](_0xbd96('0x63'),'a',_0xbd96('0x64'))[_0xbd96('0x5d')](_0xbd96('0x65'),'me','me.ChatInteractionId\x20=\x20i.id')[_0xbd96('0x5d')](_0xbd96('0x66'),'it',_0xbd96('0x67'))[_0xbd96('0x5d')](_0xbd96('0x58'),'t','t.id\x20=\x20it.TagId');var _0x12d5b8=squel[_0xbd96('0x68')]();var _0x52d7ae=[];var _0x34ef03=squel['expr']();var _0x26740b;if(_0x4ffd48[_0xbd96('0x48')]['search']){_0x26740b=as[_0xbd96('0x69')](_0x4ffd48['query'][_0xbd96('0x6a')]);var _0x1b5a52=_0x26740b[_0xbd96('0x6b')];for(var _0x276b4d=0x0;_0x276b4d<_0x26740b[_0xbd96('0x6c')][_0xbd96('0x4d')];_0x276b4d++){var _0x583a98=_0x26740b[_0xbd96('0x6c')][_0x276b4d];var _0xac49b1='i';var _0x348a70=_[_0xbd96('0x6d')](_0x2afdb1,[_0xbd96('0x3a'),_0x583a98[_0xbd96('0x55')]]);if(!_0x348a70){switch(_0x583a98[_0xbd96('0x55')]){case _0xbd96('0x6e'):if(_0x583a98['value']==0x1){_0x5bb0c1[_0xbd96('0x6f')]('`'+_0x583a98['field']+_0xbd96('0x70'));}else{_0x5bb0c1['having']('`'+_0x583a98['field']+_0xbd96('0x71'));}break;case _0xbd96('0x72'):if(_0x583a98['operator']===_0xbd96('0x73')){if(_0x583a98[_0xbd96('0x74')][_0xbd96('0x3f')]('\x20')[_0xbd96('0x4d')]>0x1){_0x12d5b8[_0x1b5a52]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x583a98[_0xbd96('0x74')]),null);}else{var _0x34b629='%'+_0x583a98['value']+'%';_0x12d5b8[_0x1b5a52](_0xbd96('0x75'),_0x34b629,_0x34b629,_0x34b629);}}else{_0x348a70=_[_0xbd96('0x6d')](_0x2afdb1,[_0xbd96('0x3a'),_0xbd96('0x76')]);_0x583a98[_0xbd96('0x55')]=_0xbd96('0x76');_0x502873=as[_0xbd96('0x77')](_0xac49b1,_0x348a70[_0xbd96('0x45')],_0x583a98);_0x12d5b8[_0x1b5a52](_0x502873[_0xbd96('0x78')],_0x502873[_0xbd96('0x74')][_0xbd96('0x79')],_0x502873[_0xbd96('0x74')]['end']);}break;case _0xbd96('0x7a'):var _0x5363d6=_0x583a98['value'][_0xbd96('0x3f')](',')['map'](function(_0xfe421){return Number(_0xfe421);});_0x5363d6[_0xbd96('0x7b')](function(_0xbd4086){_0x34ef03['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xbd4086+',%');});_0x52d7ae=_[_0xbd96('0x7c')](_0x52d7ae,_0x5363d6);break;case _0xbd96('0x7d'):if(_0x583a98[_0xbd96('0x7e')]===_0xbd96('0x73')){_0x12d5b8[_0x1b5a52](_0xbd96('0x7f'),'%'+_0x583a98['value']+'%',null);}else{_0x348a70=_['find'](_0x2afdb1,[_0xbd96('0x3a'),_0xbd96('0x80')]);_0x583a98['field']=_0xbd96('0x80');_0x502873=as[_0xbd96('0x77')](_0xac49b1,_0x348a70[_0xbd96('0x45')],_0x583a98);_0x12d5b8[_0x1b5a52](_0x502873[_0xbd96('0x78')],_0x502873[_0xbd96('0x74')]['start'],_0x502873['value'][_0xbd96('0x37')]);}break;case _0xbd96('0x81'):_0x502873=as['buildExpression']('me',null,_0x583a98);_0x12d5b8[_0x1b5a52](_0x502873[_0xbd96('0x78')],_0x502873[_0xbd96('0x74')][_0xbd96('0x79')],_0x502873[_0xbd96('0x74')][_0xbd96('0x37')]);break;}}else{var _0x502873=as[_0xbd96('0x77')](_0xac49b1,_0x348a70['type'],_0x583a98);_0x12d5b8[_0x1b5a52](_0x502873[_0xbd96('0x78')],_0x502873[_0xbd96('0x74')][_0xbd96('0x79')],_0x502873[_0xbd96('0x74')][_0xbd96('0x37')]);}}}else{var _0x31bfe4=_(_0x4ffd48[_0xbd96('0x48')])[_0xbd96('0x82')]()[_0xbd96('0x41')](function(_0x50931f){return _[_0xbd96('0x83')](_0x2afdb1,[_0xbd96('0x3a'),_0x50931f])?_0x50931f:undefined;})[_0xbd96('0x84')]()[_0xbd96('0x74')]();if(!_[_0xbd96('0x85')](_0x31bfe4)){_0x31bfe4[_0xbd96('0x7b')](function(_0x363d2a){if(_0x363d2a===_0xbd96('0x86')){_0x5bb0c1[_0xbd96('0x52')]('i.ChatWebsiteId\x20IN\x20?',[][_0xbd96('0x87')](_0x4ffd48[_0xbd96('0x48')][_0x363d2a]));}else if(_0x363d2a===_0xbd96('0x88')){var _0x14e9b0=JSON[_0xbd96('0x89')](_0x4ffd48[_0xbd96('0x48')][_0x363d2a])[_0xbd96('0x8a')];var _0x594557=JSON[_0xbd96('0x89')](_0x4ffd48[_0xbd96('0x48')][_0x363d2a])[_0xbd96('0x8b')];_0x5bb0c1['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x14e9b0,_0x594557);}else{if(_0x4ffd48['query'][_0x363d2a]==='null'){_0x5bb0c1[_0xbd96('0x52')]('i.'+_0x363d2a+_0xbd96('0x8c'));}else{_0x5bb0c1[_0xbd96('0x52')]('i.'+_0x363d2a+_0xbd96('0x8d'),_0x4ffd48[_0xbd96('0x48')][_0x363d2a]);}}});}if(_0x4ffd48['query'][_0xbd96('0x8e')]){if(_0x4ffd48['query'][_0xbd96('0x8e')]==0x1){_0x5bb0c1[_0xbd96('0x6f')](_0xbd96('0x8f'));}else{_0x5bb0c1['having']('`unreadMessages`\x20>\x200');}}if(_0x4ffd48[_0xbd96('0x48')][_0xbd96('0x90')]){_0x52d7ae=_['isArray'](_0x4ffd48['query'][_0xbd96('0x90')])?_0x4ffd48[_0xbd96('0x48')][_0xbd96('0x90')]:new Array(_0x4ffd48['query'][_0xbd96('0x90')]);_0x52d7ae[_0xbd96('0x7b')](function(_0x803cf5){_0x34ef03['or'](_0xbd96('0x91'),'%,'+_0x803cf5+',%');});}if(_0x4ffd48['query']['filter']){var _0x3a8808=_0x4ffd48[_0xbd96('0x48')][_0xbd96('0x92')][_0xbd96('0x93')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0xbd96('0x94'));if(qs[_0xbd96('0x95')](_0x3a8808)){_0x12d5b8['or'](_0xbd96('0x96'),_0x3a8808+'%');}else{_0x12d5b8['or'](_0xbd96('0x97'),qs[_0xbd96('0x98')](_0x3a8808))['or'](_0xbd96('0x99'),_0x3a8808+'%');}}}_0x5bb0c1[_0xbd96('0x52')](_0x12d5b8);_0x5bb0c1['group'](_0xbd96('0x9a'));var _0x1223ac={'type':db[_0xbd96('0x9b')][_0xbd96('0x9c')][_0xbd96('0x9d')],'raw':!![]};var _0x44cf1f=_0x5bb0c1[_0xbd96('0x9e')]();_0x44cf1f[_0xbd96('0x55')]('i.id');_0x44cf1f['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xbd96('0x6e'));if(_0x4a0f31[_0xbd96('0x50')]){_0x4a0f31[_0xbd96('0x50')]['forEach'](function(_0x553a9f){_0x5bb0c1[_0xbd96('0x50')]('i.'+_0x553a9f[0x0],_0x553a9f[0x1]===_0xbd96('0x9f')?![]:!![]);});}if(!_[_0xbd96('0x85')](_0x52d7ae)){_0x5bb0c1['having'](_0x34ef03);_0x44cf1f[_0xbd96('0x52')](_0xbd96('0xa0'),_0x52d7ae);}BPromise['resolve']()[_0xbd96('0x36')](function(){if(!_0x26740b&&_0x4ffd48[_0xbd96('0x48')][_0xbd96('0x86')])return;return _0x4ffd48[_0xbd96('0xa1')][_0xbd96('0xa2')]({'attributes':['id'],'raw':!![]})[_0xbd96('0x36')](function(_0x2870be){if(_[_0xbd96('0x85')](_0x2870be)){_0x44cf1f['where'](_0xbd96('0xa3'));_0x5bb0c1['where'](_0xbd96('0xa3'));}else{_0x44cf1f[_0xbd96('0x52')](_0xbd96('0xa4'),_['map'](_0x2870be,'id'));_0x5bb0c1['where']('i.ChatWebsiteId\x20IN\x20?',_[_0xbd96('0x41')](_0x2870be,'id'));}});})[_0xbd96('0x36')](function(){db[_0xbd96('0xa5')][_0xbd96('0x48')](_0x44cf1f['toString'](),_0x1223ac)[_0xbd96('0x36')](function(_0x11064b){_0x38d7b9[_0xbd96('0xa6')]=_0x11064b['length'];if(_0x38d7b9[_0xbd96('0xa6')]===0x0)return[];return db[_0xbd96('0xa5')][_0xbd96('0x48')](_0x2ab59e[_0xbd96('0xa7')](),_0x1223ac)[_0xbd96('0x36')](function(_0x4ea6b8){_0x2d47eb=_[_0xbd96('0xa8')](_0x4ea6b8,'id');_0x1223ac=_[_0xbd96('0xa9')](_0x1223ac,{'model':db[_0xbd96('0x42')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4ffd48['query'][_0xbd96('0x4c')]){_0x4a0f31[_0xbd96('0x4b')][_0xbd96('0x7b')](function(_0x139868){_0x5bb0c1['field']('i.'+_0x139868);});}else{_0x5bb0c1[_0xbd96('0x55')](_0xbd96('0xaa'),'unreadMessages');_0x5bb0c1['field'](_0xbd96('0xab'),_0xbd96('0xac'));_0x5bb0c1[_0xbd96('0x55')]('a.mandatoryDisposition',_0xbd96('0xad'));_0x5bb0c1[_0xbd96('0x55')](_0xbd96('0xae'));_0x5bb0c1[_0xbd96('0x55')](_0xbd96('0xaf'),_0xbd96('0xb0'));_0x5bb0c1['field'](_0xbd96('0xb1'),_0xbd96('0xb2'));_0x5bb0c1['field'](_0xbd96('0xb3'),'Contact.email');_0x5bb0c1[_0xbd96('0x55')](_0xbd96('0xb4'),_0xbd96('0xb5'));_0x5bb0c1[_0xbd96('0x55')](_0xbd96('0xb6'),_0xbd96('0xb7'));_0x5bb0c1[_0xbd96('0x55')](_0xbd96('0xb8'),'Contact.fax');_0x5bb0c1[_0xbd96('0x55')](_0xbd96('0xb9'),_0xbd96('0xba'));_0x5bb0c1[_0xbd96('0x55')](_0xbd96('0xbb'),_0xbd96('0xbc'));_0x5bb0c1['field'](_0xbd96('0xbd'),_0xbd96('0x3d'));}_0x5bb0c1['limit'](_0x4a0f31[_0xbd96('0x2f')]);_0x5bb0c1['offset'](_0x4a0f31['offset']);return db[_0xbd96('0xa5')][_0xbd96('0x48')](_0x5bb0c1[_0xbd96('0xa7')](),_0x1223ac);})[_0xbd96('0x36')](function(_0x3be097){_0x242d76[_0xbd96('0x52')](_0xbd96('0xbe'),_[_0xbd96('0x41')](_0x3be097,'id'));return db[_0xbd96('0xa5')][_0xbd96('0x48')](_0x242d76[_0xbd96('0xa7')](),_0x1223ac)[_0xbd96('0x36')](function(_0x683f90){var _0x401dab=_[_0xbd96('0xbf')](_0x683f90,'ChatInteractionId');var _0x3ad62c=[];_0x3be097[_0xbd96('0x7b')](function(_0x92aa42){_0x3ad62c[_0xbd96('0x40')](updateChatInteraction(_0x92aa42,_0x2d47eb,_0x401dab));});return BPromise['all'](_0x3ad62c);});});})[_0xbd96('0x36')](function(_0x26f022){_0x38d7b9['rows']=_0x26f022;return _0x38d7b9;})[_0xbd96('0x36')](respondWithFilteredResult(_0x5e6f63,_0x4a0f31));})[_0xbd96('0x2c')](handleError(_0x5e6f63,null));};exports[_0xbd96('0xc0')]=function(_0x29227f,_0x31da6a){var _0x5b5ed2={'raw':![],'where':{'id':_0x29227f['params']['id']}},_0x31bb0c={};_0x31bb0c[_0xbd96('0x47')]=_[_0xbd96('0x82')](db[_0xbd96('0x42')][_0xbd96('0x43')]);_0x31bb0c[_0xbd96('0x48')]=_['keys'](_0x29227f['query']);_0x31bb0c['filters']=_['intersection'](_0x31bb0c[_0xbd96('0x47')],_0x31bb0c[_0xbd96('0x48')]);_0x5b5ed2[_0xbd96('0x4b')]=_[_0xbd96('0x4a')](_0x31bb0c[_0xbd96('0x47')],qs[_0xbd96('0x4c')](_0x29227f[_0xbd96('0x48')][_0xbd96('0x4c')]));_0x5b5ed2[_0xbd96('0x4b')]=_0x5b5ed2[_0xbd96('0x4b')][_0xbd96('0x4d')]?_0x5b5ed2[_0xbd96('0x4b')]:_0x31bb0c[_0xbd96('0x47')];if(_0x29227f[_0xbd96('0x48')][_0xbd96('0xc1')]){_0x5b5ed2[_0xbd96('0xc2')]=[{'all':!![]}];}_0x5b5ed2=_['merge']({},_0x5b5ed2,_0x29227f['options']);return db[_0xbd96('0x42')][_0xbd96('0x6d')](_0x5b5ed2)[_0xbd96('0x36')](handleEntityNotFound(_0x31da6a,null))[_0xbd96('0x36')](respondWithResult(_0x31da6a,null))[_0xbd96('0x2c')](handleError(_0x31da6a,null));};exports['create']=function(_0x3b1544,_0x15a749){return db[_0xbd96('0x42')][_0xbd96('0xc3')](_0x3b1544[_0xbd96('0x81')],{})[_0xbd96('0x36')](respondWithResult(_0x15a749,0xc9))[_0xbd96('0x2c')](handleError(_0x15a749,null));};exports[_0xbd96('0x35')]=function(_0x227fbd,_0x7312b){if(_0x227fbd[_0xbd96('0x81')]['id']){delete _0x227fbd[_0xbd96('0x81')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x227fbd[_0xbd96('0xc4')]['id']}})[_0xbd96('0x36')](handleEntityNotFound(_0x7312b,null))[_0xbd96('0x36')](saveUpdates(_0x227fbd[_0xbd96('0x81')],null))[_0xbd96('0x36')](respondWithResult(_0x7312b,null))[_0xbd96('0x2c')](handleError(_0x7312b,null));};exports['destroy']=function(_0x449e65,_0x4d9f9a){return db[_0xbd96('0x42')][_0xbd96('0x6d')]({'where':{'id':_0x449e65[_0xbd96('0xc4')]['id']}})[_0xbd96('0x36')](handleEntityNotFound(_0x4d9f9a,null))['then'](removeEntity(_0x4d9f9a,null))[_0xbd96('0x2c')](handleError(_0x4d9f9a,null));};exports[_0xbd96('0xc5')]=function(_0x4c6558,_0xca36c6){return db['ChatInteraction'][_0xbd96('0xc5')]()[_0xbd96('0x36')](respondWithResult(_0xca36c6,null))['catch'](handleError(_0xca36c6,null));};exports['customUpdate']=function(_0x4d21a1,_0x4653f7){if(_0x4d21a1[_0xbd96('0x81')]['id']){delete _0x4d21a1['body']['id'];}return db['ChatInteraction'][_0xbd96('0x6d')]({'where':{'id':_0x4d21a1['params']['id']}})[_0xbd96('0x36')](handleEntityNotFound(_0x4653f7,null))[_0xbd96('0x36')](saveUpdates(_0x4d21a1[_0xbd96('0x81')],null))[_0xbd96('0x36')](respondWithResult(_0x4653f7,null))[_0xbd96('0x2c')](handleError(_0x4653f7,null));};exports['abandon']=function(_0x6bb426,_0x1efbb0,_0x147b39){if(_0x6bb426['body']['id']){delete _0x6bb426[_0xbd96('0x81')]['id'];}return db[_0xbd96('0x42')][_0xbd96('0x6d')]({'where':{'id':_0x6bb426[_0xbd96('0xc4')]['id']}})[_0xbd96('0x36')](function(_0x27b877){if(!_0x27b877){logger['error'](_0xbd96('0xc6'),_0xbd96('0xc7'),0x194,_0xbd96('0xc8'));_0x1efbb0[_0xbd96('0x38')](0x194);}else{if(_0x27b877[_0xbd96('0x80')]){throw new db[(_0xbd96('0x9b'))][(_0xbd96('0x21'))](_0xbd96('0xc9'));}}return _0x27b877;})['then'](function(_0x3817ec){if(_0x3817ec){return _0x3817ec[_0xbd96('0x35')]({'closed':_0x6bb426[_0xbd96('0x81')]['closed'],'disposition':_0x6bb426['body'][_0xbd96('0xca')]})['then'](function(_0x2978b6){return _0x2978b6;});}})[_0xbd96('0x36')](function(_0x13531f){return respondWithRpcPromise(_0xbd96('0xcb'),_0xbd96('0xc7'),_0x6bb426[_0xbd96('0x81')],client9004);})[_0xbd96('0x36')](respondWithResult(_0x1efbb0,null))['catch'](handleError(_0x1efbb0,null));};exports[_0xbd96('0xcc')]=function(_0x59a5a6,_0x33ec46,_0x1fcf8a){_0x59a5a6['body'][_0xbd96('0x3a')]=_0x59a5a6[_0xbd96('0xcd')][_0xbd96('0xce')];_0x59a5a6[_0xbd96('0x81')]['basename']=_0x59a5a6['file'][_0xbd96('0xcf')];_0x59a5a6[_0xbd96('0x81')]['type']=_0x59a5a6['file'][_0xbd96('0xd0')];return db[_0xbd96('0xd1')]['create'](_0x59a5a6['body'])[_0xbd96('0x36')](respondWithResult(_0x33ec46,0xc9))[_0xbd96('0x2c')](handleError(_0x33ec46,null));};exports[_0xbd96('0xd2')]=function(_0x513ef9,_0x484d14,_0x104562){return db[_0xbd96('0x42')][_0xbd96('0xd3')]({'where':{'id':_0x513ef9['params']['id']},'raw':!![]})[_0xbd96('0x36')](handleEntityNotFound(_0x484d14,null))[_0xbd96('0x36')](function(_0x4fd654){if(_0x4fd654){if(_0x4fd654[_0xbd96('0xd4')]){return _0x484d14[_0xbd96('0x2d')](0x193)[_0xbd96('0x32')]({'status':0x193,'message':_0xbd96('0xd5')});}return db[_0xbd96('0xd1')][_0xbd96('0xd3')]({'where':{'id':_0x513ef9[_0xbd96('0x48')]['attachId']},'raw':!![]})[_0xbd96('0x36')](handleEntityNotFound(_0x484d14,null));}})['then'](function(_0x35a324){if(_0x35a324){return _0x484d14[_0xbd96('0xd6')](path[_0xbd96('0xd7')](config[_0xbd96('0xd8')],'server/files/attachments/',_0x35a324[_0xbd96('0xd9')]));}})['catch'](handleError(_0x484d14,null));};exports[_0xbd96('0xda')]=function(_0x2eba1a,_0x408397){var _0x4403f6=null;var _0x1fc596=null;var _0x555e39=null;var _0x2b57dd=null;if(_0x2eba1a[_0xbd96('0x81')]['id']){delete _0x2eba1a['body']['id'];}if(_0x2eba1a[_0xbd96('0x81')][_0xbd96('0xdb')]){_0x2b57dd=path[_0xbd96('0xd7')](config['root'],_0xbd96('0xdc'),util['format']('transcript-%s.txt',Date[_0xbd96('0xdd')]()));_0x2eba1a[_0xbd96('0x81')]['pathTranscript']=_0x2b57dd;}return db[_0xbd96('0x42')]['find']({'where':{'id':_0x2eba1a[_0xbd96('0xc4')]['id']},'include':[{'model':db[_0xbd96('0xde')],'as':_0xbd96('0xdf'),'include':[{'model':db[_0xbd96('0x7d')],'as':_0xbd96('0x7d')}]}]})['then'](handleEntityNotFound(_0x408397,null))[_0xbd96('0x36')](saveUpdates(_0x2eba1a[_0xbd96('0x81')],null))[_0xbd96('0x36')](function(_0x1433e9){if(_0x1433e9){_0x4403f6=_0x1433e9;return db[_0xbd96('0xe0')][_0xbd96('0x6d')]({'where':{'id':_0x4403f6[_0xbd96('0x86')]}});}})[_0xbd96('0x36')](function(_0x1f931c){if(_0x1f931c){_0x555e39=_0x1f931c;return db['CmContact'][_0xbd96('0x6d')]({'where':{'id':_0x4403f6[_0xbd96('0x76')]}});}})[_0xbd96('0x36')](function(_0x82ab01){if(_0x82ab01){_0x1fc596=_0x82ab01;if(_0x2b57dd){var _0x6e6c12=null;for(var _0x2f020b=0x1;_0x2f020b<_0x4403f6[_0xbd96('0xdf')][_0xbd96('0x4d')];++_0x2f020b){_0x6e6c12=_0x4403f6[_0xbd96('0xdf')][_0x2f020b];var _0x1c7474=_0x6e6c12[_0xbd96('0x80')]?util[_0xbd96('0xe1')](_0xbd96('0xe2'),_0x555e39['agentAlias'],_0x6e6c12['UserId']):_0xbd96('0xe3');var _0x2af777=_0x2eba1a[_0xbd96('0x81')][_0xbd96('0xe4')]||util[_0xbd96('0xe1')](_0xbd96('0xe2'),_0xbd96('0xe5'),_0x6e6c12[_0xbd96('0x76')]);switch(_0x555e39[_0xbd96('0xe6')]){case _0xbd96('0xe7'):_0x1c7474=_0x6e6c12[_0xbd96('0x80')]?util['format']('%s%d',_0x555e39['agentAlias'],_0x6e6c12[_0xbd96('0x80')]):_0xbd96('0xe3');break;case _0xbd96('0xe8'):_0x1c7474=_0x6e6c12['UserId']?_0x6e6c12[_0xbd96('0x7d')][_0xbd96('0xe9')]||_0x6e6c12[_0xbd96('0x7d')][_0xbd96('0x3c')]:'System';break;case _0xbd96('0xea'):_0x1c7474=_0x6e6c12['UserId']?_0x6e6c12[_0xbd96('0x7d')][_0xbd96('0x3c')]:'System';break;default:_0x1c7474=_0x6e6c12['UserId']?util[_0xbd96('0xe1')](_0xbd96('0xe2'),_0x555e39[_0xbd96('0xeb')],_0x6e6c12['UserId']):_0xbd96('0xe3');}var _0x1410f4=util[_0xbd96('0xe1')](_0xbd96('0xec'),moment(_0x6e6c12[_0xbd96('0x88')])[_0xbd96('0xe1')](_0xbd96('0xed')),_0x6e6c12[_0xbd96('0xee')]==='in'?_0x2af777:_0x1c7474,_0x6e6c12['body']);if(!_0x6e6c12[_0xbd96('0xef')]){fs['appendFileSync'](_0x2b57dd,_0x1410f4);}}return db['MailAccount'][_0xbd96('0xd3')]({'where':{'service':!![]},'include':[{'model':db[_0xbd96('0xf0')],'as':_0xbd96('0xf1'),'raw':!![]}]});}}})['then'](function(_0x251822){if(_0x251822&&_0x251822[_0xbd96('0xf1')]&&_0x2eba1a['body']){var _0x543b5c={'tls':{'rejectUnauthorized':![]}};if(_0x251822['Smtp'][_0xbd96('0xf2')]){_0x543b5c[_0xbd96('0xf2')]=_0x251822[_0xbd96('0xf1')][_0xbd96('0xf2')];}else{_0x543b5c[_0xbd96('0xf3')]=_0x251822[_0xbd96('0xf1')][_0xbd96('0xf3')];_0x543b5c[_0xbd96('0xf4')]=_0x251822[_0xbd96('0xf1')][_0xbd96('0xf4')];_0x543b5c['secure']=_0x251822['Smtp'][_0xbd96('0xf5')];}if(_0x251822['Smtp'][_0xbd96('0xf6')]){_0x543b5c[_0xbd96('0xf7')]={'user':_0x251822[_0xbd96('0xf1')][_0xbd96('0xa1')],'pass':_0x251822[_0xbd96('0xf1')][_0xbd96('0xf8')]};}return respondWithRpcPromise(_0xbd96('0xf9'),_0xbd96('0xfa'),{'account':_0x543b5c,'message':{'from':util['format'](_0xbd96('0xfb'),_0x251822[_0xbd96('0x3a')],_0x251822['email']||_0x251822[_0xbd96('0xf1')][_0xbd96('0xa1')]),'to':_0x2eba1a[_0xbd96('0x81')][_0xbd96('0xdb')],'subject':_0xbd96('0xfc'),'text':util['format'](_0xbd96('0xfd'),_0x2eba1a[_0xbd96('0x81')]['mailTranscript']),'attachments':[{'path':_0x2b57dd}]}})['then'](function(){return _0x4403f6;})['catch'](function(_0x520fc2){console[_0xbd96('0x28')](_0x520fc2);});}else{return _0x4403f6;}})[_0xbd96('0x36')](respondWithStatusCode(_0x408397,0xc8))['catch'](handleError(_0x408397,null));};exports['addMessage']=function(_0x5c6e7d,_0x48084d,_0x3090df){return db[_0xbd96('0xde')][_0xbd96('0x6d')]({'where':{'id':_0x5c6e7d[_0xbd96('0xc4')]['id']}})[_0xbd96('0x36')](handleEntityNotFound(_0x48084d,null))['then'](function(_0x1ed266){if(_0x1ed266){return _0x1ed266[_0xbd96('0xfe')](_0x5c6e7d[_0xbd96('0x81')][_0xbd96('0xff')],_['omit'](_0x5c6e7d['body'],['ids','id'])||{});}})[_0xbd96('0x36')](respondWithResult(_0x48084d,null))['catch'](handleError(_0x48084d,null));};exports['getMessages']=function(_0x54b583,_0x18ab92,_0x44ba77){var _0x1df74a={'raw':![],'where':{}};var _0xd829e2={};var _0xde043={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xbd96('0xd3')]({'where':{'id':_0x54b583['params']['id']}})[_0xbd96('0x36')](handleEntityNotFound(_0x18ab92,null))['then'](function(_0x246c79){if(_0x246c79){_0xd829e2[_0xbd96('0x47')]=_[_0xbd96('0x82')](db[_0xbd96('0xde')][_0xbd96('0x43')]);_0xd829e2[_0xbd96('0x48')]=_['keys'](_0x54b583[_0xbd96('0x48')]);_0xd829e2['filters']=_[_0xbd96('0x4a')](_0xd829e2[_0xbd96('0x47')],_0xd829e2['query']);_0x1df74a[_0xbd96('0x4b')]=_[_0xbd96('0x4a')](_0xd829e2[_0xbd96('0x47')],qs[_0xbd96('0x4c')](_0x54b583[_0xbd96('0x48')][_0xbd96('0x4c')]));_0x1df74a[_0xbd96('0x4b')]=_0x1df74a[_0xbd96('0x4b')][_0xbd96('0x4d')]?_0x1df74a[_0xbd96('0x4b')]:_0xd829e2['model'];if(!_0x54b583[_0xbd96('0x48')]['hasOwnProperty'](_0xbd96('0x4f'))){_0x1df74a[_0xbd96('0x2f')]=qs[_0xbd96('0x2f')](_0x54b583[_0xbd96('0x48')]['limit']);_0x1df74a[_0xbd96('0x2e')]=qs[_0xbd96('0x2e')](_0x54b583[_0xbd96('0x48')]['offset']);}_0x1df74a['order']=qs[_0xbd96('0x51')](_0x54b583[_0xbd96('0x48')][_0xbd96('0x51')]);_0x1df74a['where']=qs['filters'](_[_0xbd96('0x53')](_0x54b583[_0xbd96('0x48')],_0xd829e2['filters']));_0x1df74a[_0xbd96('0x52')][_0xbd96('0x100')]=_0x246c79['id'];if(_0x54b583['query'][_0xbd96('0x92')]){_0x1df74a[_0xbd96('0x52')]=_[_0xbd96('0xa9')](_0x1df74a['where'],{'$or':_['map'](_0x1df74a[_0xbd96('0x4b')],function(_0x4a1ecb){var _0x4eec7d={};_0x4eec7d[_0x4a1ecb]={'$like':'%'+_0x54b583[_0xbd96('0x48')]['filter']+'%'};return _0x4eec7d;})});}if(_0x54b583[_0xbd96('0x48')][_0xbd96('0x8a')]){var _0x5d0979=_0x54b583['query'][_0xbd96('0x8a')][_0xbd96('0x3f')](',');var _0x4a2316={};_0x4a2316[_0x5d0979[0x0]]={'$gte':moment(_0x5d0979[0x1])[_0xbd96('0xe1')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1df74a[_0xbd96('0x52')]=_[_0xbd96('0xa9')](_0x1df74a[_0xbd96('0x52')],_0x4a2316);}_0x1df74a=_['merge']({},_0x1df74a,_0x54b583['options']);return db[_0xbd96('0xde')]['count']({'where':_0x1df74a[_0xbd96('0x52')]})[_0xbd96('0x36')](function(_0x387ae3){_0xde043['count']=_0x387ae3;if(_0x54b583[_0xbd96('0x48')][_0xbd96('0xc1')]){_0x1df74a[_0xbd96('0xc2')]=[{'all':!![]}];}return db[_0xbd96('0xde')][_0xbd96('0x101')](_0x1df74a);})[_0xbd96('0x36')](function(_0x3088a3){_0xde043[_0xbd96('0x102')]=_0x3088a3;return _0xde043;});}})[_0xbd96('0x36')](respondWithFilteredResult(_0x18ab92,_0x1df74a))[_0xbd96('0x2c')](handleError(_0x18ab92,null));};exports['getMyMessages']=function(_0x42661e,_0xa394f0,_0xf990eb){var _0x9bcf0f={'where':{}},_0x16d77={},_0x14b6c3={'count':0x0,'rows':[]};return db[_0xbd96('0x42')][_0xbd96('0xd3')]({'where':{'id':_0x42661e[_0xbd96('0xc4')]['id']}})[_0xbd96('0x36')](handleEntityNotFound(_0xa394f0,null))[_0xbd96('0x36')](function(_0x1524b2){if(_0x1524b2){_0x16d77[_0xbd96('0x47')]=_[_0xbd96('0x82')](db[_0xbd96('0xde')][_0xbd96('0x43')]);_0x16d77[_0xbd96('0x48')]=_['keys'](_0x42661e[_0xbd96('0x48')]);_0x16d77[_0xbd96('0x49')]=_['intersection'](_0x16d77[_0xbd96('0x47')],_0x16d77[_0xbd96('0x48')]);_0x9bcf0f['attributes']=_[_0xbd96('0x4a')](_0x16d77['model'],qs['fields'](_0x42661e[_0xbd96('0x48')][_0xbd96('0x4c')]));_0x9bcf0f[_0xbd96('0x4b')]=_0x9bcf0f[_0xbd96('0x4b')][_0xbd96('0x4d')]?_0x9bcf0f[_0xbd96('0x4b')]:_0x16d77['model'];if(!_0x42661e[_0xbd96('0x48')][_0xbd96('0x4e')]('nolimit')){_0x9bcf0f[_0xbd96('0x2f')]=qs['limit'](_0x42661e['query'][_0xbd96('0x2f')]);_0x9bcf0f[_0xbd96('0x2e')]=qs[_0xbd96('0x2e')](_0x42661e[_0xbd96('0x48')][_0xbd96('0x2e')]);}_0x9bcf0f[_0xbd96('0x50')]=qs[_0xbd96('0x51')](_0x42661e[_0xbd96('0x48')]['sort']);_0x9bcf0f[_0xbd96('0x52')]=qs[_0xbd96('0x49')](_[_0xbd96('0x53')](_0x42661e[_0xbd96('0x48')],_0x16d77['filters']));_0x9bcf0f[_0xbd96('0x52')][_0xbd96('0x100')]=_0x1524b2['id'];if(_0x42661e[_0xbd96('0x48')]['filter']){_0x9bcf0f[_0xbd96('0x52')]=_['merge'](_0x9bcf0f[_0xbd96('0x52')],{'$or':_['map'](_0x9bcf0f['attributes'],function(_0x1da98e){var _0x24514c={};_0x24514c[_0x1da98e]={'$like':'%'+_0x42661e[_0xbd96('0x48')][_0xbd96('0x92')]+'%'};return _0x24514c;})});}_0x9bcf0f[_0xbd96('0x52')][_0xbd96('0xef')]=![];if(_0x42661e['query']['id']){_0x9bcf0f[_0xbd96('0x52')]['id']={'$gt':_0x42661e[_0xbd96('0x48')]['id']};}_0x9bcf0f=_[_0xbd96('0xa9')]({},_0x9bcf0f,_0x42661e[_0xbd96('0x103')]);return db[_0xbd96('0xde')][_0xbd96('0xa6')]({'where':_0x9bcf0f['where']})['then'](function(_0x97826c){_0x14b6c3[_0xbd96('0xa6')]=_0x97826c;_0x9bcf0f[_0xbd96('0xc2')]=[];if(_0x42661e[_0xbd96('0x48')][_0xbd96('0x104')]){_0x9bcf0f['include'][_0xbd96('0x40')]({'model':db[_0xbd96('0x7d')],'as':_0xbd96('0x7d'),'attributes':['id',_0xbd96('0x3c'),_0xbd96('0xe9')]});}if(_0x42661e[_0xbd96('0x48')][_0xbd96('0xc1')]){_0x9bcf0f[_0xbd96('0xc2')]=[{'all':!![]}];}return db[_0xbd96('0xde')][_0xbd96('0x101')](_0x9bcf0f);})[_0xbd96('0x36')](function(_0x4511d9){_0x14b6c3[_0xbd96('0x102')]=_0x4511d9;return _0x14b6c3;});}})[_0xbd96('0x36')](respondWithFilteredResult(_0xa394f0,_0x9bcf0f))['catch'](handleError(_0xa394f0,null));};exports[_0xbd96('0x105')]=function(_0xbd55c8,_0x36655c,_0x31cf87){return db['ChatInteraction']['find']({'where':{'id':_0xbd55c8['params']['id']}})[_0xbd96('0x36')](handleEntityNotFound(_0x36655c,null))['then'](function(_0x4a2399){if(_0x4a2399){return _0x4a2399['setTags'](_0xbd55c8['body']['ids'],_['omit'](_0xbd55c8[_0xbd96('0x81')],[_0xbd96('0xff'),'id'])||{})[_0xbd96('0x106')](function(){return db[_0xbd96('0x7a')]['findAll']({'attributes':['id',_0xbd96('0x3a'),_0xbd96('0x56')],'where':{'id':_0xbd55c8[_0xbd96('0x81')][_0xbd96('0xff')]}});})[_0xbd96('0x36')](function(_0x3c4a0e){socket[_0xbd96('0x107')](_0xbd96('0x108'),{'id':Number(_0xbd55c8[_0xbd96('0xc4')]['id']),'tags':_0x3c4a0e||[]});return{'id':Number(_0xbd55c8[_0xbd96('0xc4')]['id']),'tags':_0x3c4a0e||[]};});}})[_0xbd96('0x36')](respondWithResult(_0x36655c,null))['catch'](handleError(_0x36655c,null));};exports[_0xbd96('0x109')]=function(_0x160a47,_0x5be858,_0x5f169b){return db[_0xbd96('0x42')]['find']({'where':{'id':_0x160a47[_0xbd96('0xc4')]['id']}})[_0xbd96('0x36')](handleEntityNotFound(_0x5be858,null))['then'](function(_0x55cf97){if(_0x55cf97){return _0x55cf97[_0xbd96('0x109')](_0x160a47[_0xbd96('0x48')][_0xbd96('0xff')]);}})[_0xbd96('0x36')](respondWithStatusCode(_0x5be858,null))['catch'](handleError(_0x5be858,null));};exports['download']=function(_0x4e1af6,_0x1cbd2d){var _0x473c10=moment()['unix']()[_0xbd96('0xa7')]();var _0x44de5f=path[_0xbd96('0xd7')](config[_0xbd96('0xd8')],_0xbd96('0x10a'),'files',_0xbd96('0x10b'));var _0xa1bd5a=path[_0xbd96('0xd7')](config[_0xbd96('0xd8')],_0xbd96('0x10a'),_0xbd96('0x10c'),_0xbd96('0x10d'));var _0xc4baf4=path[_0xbd96('0xd7')](_0x44de5f,_0x473c10);var _0x246d32=util[_0xbd96('0xe1')](_0xbd96('0x10e'),_0x4e1af6[_0xbd96('0xc4')]['id'],_0x473c10);var _0x54af9b=path['join'](_0x44de5f,_0x246d32);var _0x518eeb=[];_0x518eeb['push']({'model':db[_0xbd96('0x7d')],'as':_0xbd96('0x7d'),'attributes':['id',_0xbd96('0x3c')],'raw':!![]});_0x518eeb[_0xbd96('0x40')]({'model':db[_0xbd96('0x10f')],'as':_0xbd96('0x72'),'attributes':['id',_0xbd96('0x110'),_0xbd96('0x111')],'raw':!![]});if(_0x4e1af6[_0xbd96('0x48')][_0xbd96('0x10d')]){_0x518eeb['push']({'model':db[_0xbd96('0xd1')],'as':_0xbd96('0xd1'),'raw':!![]});}var _0x2cf299=[{'model':db[_0xbd96('0xde')],'as':'Messages','attributes':['id',_0xbd96('0x81'),_0xbd96('0x88'),_0xbd96('0xee'),'secret',_0xbd96('0x8e')],'include':_0x518eeb}];_0x2cf299['push']({'model':db[_0xbd96('0xe0')],'as':'Account','attributes':['id','name']});_0x2cf299[_0xbd96('0x40')]({'model':db['User'],'as':'Owner','attributes':['id',_0xbd96('0x3c')]});return db['ChatInteraction'][_0xbd96('0x6d')]({'where':{'id':_0x4e1af6[_0xbd96('0xc4')]['id']},'include':_0x2cf299})[_0xbd96('0x36')](handleEntityNotFound(_0x1cbd2d,null))[_0xbd96('0x36')](function(_0x5bcb95){if(_0x5bcb95){var _0x4d471f=_0x5bcb95['get']({'plain':!![]});fs[_0xbd96('0x112')](_0xc4baf4);var _0x509919={'format':'A4','border':'10px','header':{'height':_0xbd96('0x113'),'contents':{'first':_0xbd96('0x114')}},'footer':{'height':'30px','contents':{'default':util[_0xbd96('0xe1')](_0xbd96('0x115'),util[_0xbd96('0xe1')]('%s\x20#%d',_0xbd96('0x116'),_0x4d471f['id']),moment()[_0xbd96('0xe1')](_0xbd96('0x117'))[_0xbd96('0xa7')]())}}};var _0x51fc71={'channel':_0xbd96('0x116'),'account':_0x4d471f[_0xbd96('0x118')][_0xbd96('0x3a')],'agent':_0x4d471f[_0xbd96('0x119')]?_0x4d471f['Owner'][_0xbd96('0x3c')]:'N.A.','createdAt':moment(_0x4d471f['createdAt'])[_0xbd96('0xe1')](_0xbd96('0x11a'))[_0xbd96('0xa7')](),'closedAt':_0x4d471f[_0xbd96('0xd4')]?moment(_0x4d471f[_0xbd96('0x11b')])['format'](_0xbd96('0x11a'))[_0xbd96('0xa7')]():'','disposition':_0x4d471f[_0xbd96('0xca')],'chatInfo':{'browser':_0x4d471f[_0xbd96('0x11c')],'os':_0x4d471f[_0xbd96('0x11d')],'referer':_0x4d471f[_0xbd96('0x11e')],'customerIp':_0x4d471f['customerIp'],'customerPort':_0x4d471f[_0xbd96('0x11f')]?_0x4d471f[_0xbd96('0x11f')]:_0xbd96('0x120')},'messages':_(_0x4d471f[_0xbd96('0xdf')])[_0xbd96('0x121')]()[_0xbd96('0x92')]({'secret':![]})['map'](function(_0x5e7d94){if(_0x5e7d94[_0xbd96('0xd1')]){var _0x1c3071=path[_0xbd96('0xd7')](_0xa1bd5a,_0x5e7d94[_0xbd96('0xd1')]['basename']);if(fs[_0xbd96('0x122')](_0x1c3071)){fs['createReadStream'](_0x1c3071)[_0xbd96('0x123')](fs[_0xbd96('0x124')](path['join'](_0xc4baf4,_0x5e7d94['Attachment'][_0xbd96('0xd9')])));}}return{'date':moment(_0x5e7d94['createdAt'])[_0xbd96('0xe1')](_0xbd96('0x11a'))[_0xbd96('0xa7')](),'sender':_0x5e7d94['direction']===_0xbd96('0x125')?_0x5e7d94[_0xbd96('0x7d')]?_0x5e7d94[_0xbd96('0x7d')][_0xbd96('0x3c')]:_0xbd96('0xe3'):_0x5e7d94[_0xbd96('0x72')][_0xbd96('0x110')]+(_0x5e7d94[_0xbd96('0x72')]['lastName']?'\x20'+_0x5e7d94['Contact'][_0xbd96('0x111')]:''),'body':_0x5e7d94['Attachment']?_0x5e7d94[_0xbd96('0xd1')]['basename']:_0x5e7d94[_0xbd96('0x81')],'direction':_0x5e7d94[_0xbd96('0xee')]===_0xbd96('0x125')?'A':'C','secret':_0x5e7d94[_0xbd96('0xef')],'read':_0x5e7d94[_0xbd96('0x8e')],'attachment':_0x5e7d94[_0xbd96('0xd1')]};})[_0xbd96('0x74')]()};return ejs[_0xbd96('0x126')](path[_0xbd96('0xd7')](config['root'],_0xbd96('0x10a'),_0xbd96('0x127'),_0xbd96('0x128')),{'interaction':_0x51fc71})[_0xbd96('0x36')](function(_0x4a49d2){return new BPromise(function(_0x240181,_0x1e683d){pdf['create'](_0x4a49d2,_0x509919)['toFile'](path[_0xbd96('0xd7')](_0xc4baf4,_0xbd96('0x129')+_0x4d471f['id']+'-'+_0x473c10+'.pdf'),function(_0x5e928f,_0x5cfb70){if(_0x5e928f)return _0x1e683d(_0x5e928f);_0x240181(_0x5cfb70);});});})[_0xbd96('0x36')](function(){return new BPromise(function(_0x578cc6,_0x1a3301){zipdir(_0xc4baf4,{'saveTo':_0x54af9b},function(_0x3aa7c9,_0x37a5d7){if(_0x3aa7c9)return _0x1a3301(_0x3aa7c9);return _0x578cc6(_0x37a5d7);});})['then'](function(){return new BPromise(function(_0x190c6b,_0x4c1f06){rimraf(_0xc4baf4,function(_0xcd372b){if(_0xcd372b)_0x4c1f06(_0xcd372b);return _0x190c6b();});});})[_0xbd96('0x36')](function(){return _0x1cbd2d[_0xbd96('0xd6')](_0x54af9b,_0x246d32,function(_0x5f3746){if(_0x5f3746){console[_0xbd96('0x12a')](_0xbd96('0x12b'),_0x5f3746);}else{fs[_0xbd96('0x12c')](_0x54af9b);}});});});}else{return _0x1cbd2d[_0xbd96('0x38')](0xc8);}})['catch'](handleError(_0x1cbd2d,null));}; \ No newline at end of file +var _0x3159=['getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','QueryTypes','SELECT','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','isEmpty','t.id\x20IN\x20?','resolve','ChatWebsiteId','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','show','params','options','create','describe','customUpdate','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','Interaction\x20already\x20assigned','closed','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','findOne','Unauthorized','attachId','download','join','close','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','ChatMessage','Messages','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','SendMail','\x22%s\x22\x20<%s>','email','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','mailTranscript','addMessage','ids','omit','YYYY-MM-DD\x20HH:mm:ss','includeAll','include','findAll','rows','includeAgent','addTags','setTags','spread','emit','removeTags','unix','root','server','files','tmp','firstName','lastName','ChatWebsite','Owner','get','mkdirSync','40px','\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\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\x20\x20\x20\x20\x20\x20\x20','30px','\x0a\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\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20','Chat','YYYY-MM-DD','Account','N.A.','disposition','osName','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','Contact','out','renderFile','views','downloadInteraction.html','transcript-','.pdf','err','unlinkSync','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','ChatInteraction,\x20%s,\x20%s','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','status','end','json','count','offset','limit','set','apply','reject','save','update','destroy','sendStatus','stack','name','send','Users','map','TagIds','Tags','split','forEach','push','ChatInteraction','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','users','chat_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','it.ChatInteractionId\x20=\x20i.id','expr','parseSearch','search','sqlOperator','conditions','length','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','i.ChatWebsiteId\x20IN\x20?','concat','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)'];(function(_0x46047e,_0x362c9b){var _0x10995c=function(_0x5214a8){while(--_0x5214a8){_0x46047e['push'](_0x46047e['shift']());}};_0x10995c(++_0x362c9b);}(_0x3159,0x98));var _0x9315=function(_0x5165b3,_0x27ae41){_0x5165b3=_0x5165b3-0x0;var _0xedb39c=_0x3159[_0x5165b3];return _0xedb39c;};'use strict';var pdf=require(_0x9315('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9315('0x1'));var zipdir=require(_0x9315('0x2'));var jsonpatch=require(_0x9315('0x3'));var rp=require(_0x9315('0x4'));var moment=require(_0x9315('0x5'));var BPromise=require(_0x9315('0x6'));var Mustache=require(_0x9315('0x7'));var util=require('util');var path=require(_0x9315('0x8'));var sox=require(_0x9315('0x9'));var csv=require(_0x9315('0xa'));var ejs=require(_0x9315('0xb'));var fs=require('fs');var _=require(_0x9315('0xc'));var squel=require(_0x9315('0xd'));var crypto=require(_0x9315('0xe'));var jsforce=require(_0x9315('0xf'));var deskjs=require(_0x9315('0x10'));var toCsv=require(_0x9315('0xa'));var querystring=require(_0x9315('0x11'));var Papa=require(_0x9315('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9315('0x13'));var logger=require(_0x9315('0x14'))(_0x9315('0x15'));var utils=require(_0x9315('0x16'));var config=require(_0x9315('0x17'));var db=require(_0x9315('0x18'))['db'];config[_0x9315('0x19')]=_[_0x9315('0x1a')](config['redis'],{'host':_0x9315('0x1b'),'port':0x18eb});var socket=require(_0x9315('0x1c'))(new Redis(config[_0x9315('0x19')]));require(_0x9315('0x1d'))[_0x9315('0x1e')](socket);var jayson=require(_0x9315('0x1f'));var client=jayson[_0x9315('0x20')][_0x9315('0x21')]({'port':0x232b});var client9004=jayson[_0x9315('0x20')][_0x9315('0x21')]({'port':0x232c});function checkPasswordPattern(_0x1eb115,_0x8af88b,_0x1ba54e){if(_0x1ba54e){var _0x37a13f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x37a13f[_0x9315('0x22')](_0x8af88b)){return _0x1eb115;}else{throw new db[(_0x9315('0x23'))][(_0x9315('0x24'))](_0x9315('0x25'));}}else{return _0x1eb115;}}function respondWithRpcPromise(_0x217e88,_0x5122c8,_0x11b407,_0x55d1c8){return new BPromise(function(_0x1128eb,_0x40b188){var _0x32db77=_0x55d1c8||client;return _0x32db77['request'](_0x217e88,_0x11b407)[_0x9315('0x26')](function(_0x2f4875){logger['info'](_0x9315('0x27'),_0x5122c8,'request\x20sent');logger['debug'](_0x9315('0x28'),_0x5122c8,_0x9315('0x29'),JSON[_0x9315('0x2a')](_0x2f4875));if(_0x2f4875[_0x9315('0x2b')]){if(_0x2f4875[_0x9315('0x2b')][_0x9315('0x2c')]===0x1f4){logger[_0x9315('0x2b')]('ChatInteraction,\x20%s,\x20%s',_0x5122c8,_0x2f4875[_0x9315('0x2b')]['message']);return _0x40b188(_0x2f4875['error'][_0x9315('0x2d')]);}logger[_0x9315('0x2b')](_0x9315('0x27'),_0x5122c8,_0x2f4875[_0x9315('0x2b')][_0x9315('0x2d')]);return _0x1128eb(_0x2f4875[_0x9315('0x2b')][_0x9315('0x2d')]);}else{logger[_0x9315('0x2e')]('ChatInteraction,\x20%s,\x20%s',_0x5122c8,_0x9315('0x29'));_0x1128eb(_0x2f4875['result'][_0x9315('0x2d')]);}})[_0x9315('0x2f')](function(_0x22fcfd){logger[_0x9315('0x2b')]('ChatInteraction,\x20%s,\x20%s',_0x5122c8,_0x22fcfd);_0x40b188(_0x22fcfd);});});}function respondWithStatusCode(_0xd36ec9,_0x139393){_0x139393=_0x139393||0xcc;return function(_0x144fbb){if(_0x144fbb){return _0xd36ec9['sendStatus'](_0x139393);}return _0xd36ec9[_0x9315('0x30')](_0x139393)[_0x9315('0x31')]();};}function respondWithResult(_0x11cb25,_0x4c81af){_0x4c81af=_0x4c81af||0xc8;return function(_0x50cebc){if(_0x50cebc){return _0x11cb25['status'](_0x4c81af)[_0x9315('0x32')](_0x50cebc);}};}function respondWithFilteredResult(_0x169112,_0x334db7){return function(_0x1ec654){if(_0x1ec654){var _0x49a6f1=_0x1ec654[_0x9315('0x33')],_0x4a2b3f=_0x334db7['offset'],_0x16538a=_0x334db7[_0x9315('0x34')]+_0x334db7[_0x9315('0x35')],_0x508b8e;if(_0x16538a>=_0x49a6f1){_0x16538a=_0x49a6f1;_0x508b8e=0xc8;}else{_0x508b8e=0xce;}_0x169112[_0x9315('0x30')](_0x508b8e);return _0x169112[_0x9315('0x36')]('Content-Range',_0x4a2b3f+'-'+_0x16538a+'/'+_0x49a6f1)[_0x9315('0x32')](_0x1ec654);}return null;};}function patchUpdates(_0x4fdb36){return function(_0x5369c9){try{jsonpatch[_0x9315('0x37')](_0x5369c9,_0x4fdb36,!![]);}catch(_0x2d4753){return BPromise[_0x9315('0x38')](_0x2d4753);}return _0x5369c9[_0x9315('0x39')]();};}function saveUpdates(_0xc7d61c,_0x1acb5e){return function(_0x57fb85){if(_0x57fb85){return _0x57fb85[_0x9315('0x3a')](_0xc7d61c)['then'](function(_0x530366){return _0x530366;});}return null;};}function removeEntity(_0x1a766a,_0xd2e72f){return function(_0xc60f63){if(_0xc60f63){return _0xc60f63[_0x9315('0x3b')]()[_0x9315('0x26')](function(){_0x1a766a[_0x9315('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe39711,_0x3617da){return function(_0x4cd4bb){if(!_0x4cd4bb){_0xe39711[_0x9315('0x3c')](0x194);}return _0x4cd4bb;};}function handleError(_0x40fd07,_0x20b991){_0x20b991=_0x20b991||0x1f4;return function(_0x2fa17b){logger['error'](_0x2fa17b[_0x9315('0x3d')]);if(_0x2fa17b[_0x9315('0x3e')]){delete _0x2fa17b[_0x9315('0x3e')];}_0x40fd07[_0x9315('0x30')](_0x20b991)[_0x9315('0x3f')](_0x2fa17b);};}function getInteractionUsers(_0x3758b5,_0x4f1953){return new BPromise(function(_0xbc31bd,_0x55a05b){try{if(_0x4f1953[_0x3758b5['id']]){_0x3758b5[_0x9315('0x40')]=_[_0x9315('0x41')](_0x4f1953[_0x3758b5['id']],function(_0xc3c550){return{'id':_0xc3c550['id'],'fullname':_0xc3c550['fullname']};});}}catch(_0x3c6e91){_0x55a05b(_0x3c6e91);}_0xbc31bd(_0x3758b5);});}function getInteractionTags(_0x4e841e,_0x730010){return new BPromise(function(_0x2526af,_0x15eb59){try{if(_0x4e841e[_0x9315('0x42')]){_0x4e841e[_0x9315('0x43')]=[];_0x4e841e[_0x9315('0x42')][_0x9315('0x44')](',')[_0x9315('0x45')](function(_0x41c67d){_0x4e841e[_0x9315('0x43')][_0x9315('0x46')](_0x730010[_0x41c67d]);});}delete _0x4e841e[_0x9315('0x42')];}catch(_0x304ee7){_0x15eb59(_0x304ee7);}_0x2526af(_0x4e841e);});}function updateChatInteraction(_0xbd2286,_0x15c584,_0x143aae){return new BPromise(function(_0x502751,_0x4ef6f5){return getInteractionUsers(_0xbd2286,_0x143aae)[_0x9315('0x26')](function(_0x33d234){return getInteractionTags(_0x33d234,_0x15c584);})['then'](function(_0x5cdc67){_0x502751(_0x5cdc67);})[_0x9315('0x2f')](function(_0x15bda2){_0x4ef6f5(_0x15bda2);});});}exports['index']=function(_0x10830d,_0x4a693a){var _0x4e66ff={},_0x4ba713={},_0x390e6f={'count':0x0,'rows':[]};var _0x5da445=_[_0x9315('0x41')](db[_0x9315('0x47')][_0x9315('0x48')],function(_0x4c42ae){return{'name':_0x4c42ae[_0x9315('0x49')],'type':_0x4c42ae[_0x9315('0x4a')]['key']};});_0x4ba713[_0x9315('0x4b')]=_[_0x9315('0x41')](_0x5da445,_0x9315('0x3e'));_0x4ba713[_0x9315('0x4c')]=_[_0x9315('0x4d')](_0x10830d[_0x9315('0x4c')]);_0x4ba713[_0x9315('0x4e')]=_[_0x9315('0x4f')](_0x4ba713[_0x9315('0x4b')],_0x4ba713['query']);_0x4e66ff['attributes']=_['intersection'](_0x4ba713['model'],qs['fields'](_0x10830d[_0x9315('0x4c')][_0x9315('0x50')]));_0x4e66ff['attributes']=_0x4e66ff[_0x9315('0x51')]['length']?_0x4e66ff[_0x9315('0x51')]:_0x4ba713[_0x9315('0x4b')];if(!_0x10830d[_0x9315('0x4c')][_0x9315('0x52')](_0x9315('0x53'))){_0x4e66ff[_0x9315('0x35')]=qs[_0x9315('0x35')](_0x10830d['query'][_0x9315('0x35')]);_0x4e66ff[_0x9315('0x34')]=qs[_0x9315('0x34')](_0x10830d[_0x9315('0x4c')][_0x9315('0x34')]);}_0x4e66ff['order']=qs[_0x9315('0x54')](_0x10830d[_0x9315('0x4c')][_0x9315('0x54')]);_0x4e66ff[_0x9315('0x55')]=qs['filters'](_[_0x9315('0x56')](_0x10830d['query'],_0x4ba713[_0x9315('0x4e')]));var _0x5b3654=[];var _0x2be1fa=squel[_0x9315('0x57')]()['field']('id')['field'](_0x9315('0x3e'))[_0x9315('0x58')](_0x9315('0x59'))[_0x9315('0x5a')](_0x9315('0x5b'));var _0xdc27b7=squel['select']()[_0x9315('0x58')](_0x9315('0x5c'))[_0x9315('0x58')](_0x9315('0x5d'))[_0x9315('0x58')](_0x9315('0x5e'))['from']('user_has_chat_interactions','ui')['left_join'](_0x9315('0x5f'),'u','u.id\x20=\x20ui.UserId');var _0x20d1d5=squel['select']()[_0x9315('0x5a')](_0x9315('0x60'),'i')[_0x9315('0x61')](_0x9315('0x62'),'c',_0x9315('0x63'))[_0x9315('0x61')](_0x9315('0x5f'),'o',_0x9315('0x64'))[_0x9315('0x61')]('chat_websites','a','a.id\x20=\x20i.ChatWebsiteId')['left_join']('chat_messages','me','me.ChatInteractionId\x20=\x20i.id')['left_join']('chat_interaction_has_tags','it',_0x9315('0x65'))[_0x9315('0x61')](_0x9315('0x5b'),'t','t.id\x20=\x20it.TagId');var _0x276d87=squel[_0x9315('0x66')]();var _0x175f19=[];var _0x1bf6bc=squel['expr']();var _0x9a033e;if(_0x10830d[_0x9315('0x4c')]['search']){_0x9a033e=as[_0x9315('0x67')](_0x10830d[_0x9315('0x4c')][_0x9315('0x68')]);var _0x17cfc9=_0x9a033e[_0x9315('0x69')];for(var _0x3b71b6=0x0;_0x3b71b6<_0x9a033e[_0x9315('0x6a')][_0x9315('0x6b')];_0x3b71b6++){var _0x3cf460=_0x9a033e['conditions'][_0x3b71b6];var _0xd6e620='i';var _0x93d5a6=_[_0x9315('0x6c')](_0x5da445,['name',_0x3cf460[_0x9315('0x58')]]);if(!_0x93d5a6){switch(_0x3cf460['field']){case _0x9315('0x6d'):if(_0x3cf460[_0x9315('0x6e')]==0x1){_0x20d1d5['having']('`'+_0x3cf460['field']+_0x9315('0x6f'));}else{_0x20d1d5[_0x9315('0x70')]('`'+_0x3cf460[_0x9315('0x58')]+_0x9315('0x71'));}break;case'Contact':if(_0x3cf460[_0x9315('0x72')]===_0x9315('0x73')){if(_0x3cf460[_0x9315('0x6e')][_0x9315('0x44')]('\x20')[_0x9315('0x6b')]>0x1){_0x276d87[_0x17cfc9](_0x9315('0x74'),qs['getFullTextValue'](_0x3cf460['value']),null);}else{var _0x2775b9='%'+_0x3cf460[_0x9315('0x6e')]+'%';_0x276d87[_0x17cfc9](_0x9315('0x75'),_0x2775b9,_0x2775b9,_0x2775b9);}}else{_0x93d5a6=_[_0x9315('0x6c')](_0x5da445,[_0x9315('0x3e'),_0x9315('0x76')]);_0x3cf460['field']=_0x9315('0x76');_0x5258e2=as[_0x9315('0x77')](_0xd6e620,_0x93d5a6[_0x9315('0x4a')],_0x3cf460);_0x276d87[_0x17cfc9](_0x5258e2[_0x9315('0x78')],_0x5258e2[_0x9315('0x6e')][_0x9315('0x79')],_0x5258e2[_0x9315('0x6e')][_0x9315('0x31')]);}break;case _0x9315('0x7a'):var _0xac9384=_0x3cf460[_0x9315('0x6e')][_0x9315('0x44')](',')[_0x9315('0x41')](function(_0x2e2bfe){return Number(_0x2e2bfe);});_0xac9384[_0x9315('0x45')](function(_0x222447){_0x1bf6bc['or'](_0x9315('0x7b'),'%,'+_0x222447+',%');});_0x175f19=_['union'](_0x175f19,_0xac9384);break;case _0x9315('0x7c'):if(_0x3cf460[_0x9315('0x72')]===_0x9315('0x73')){_0x276d87[_0x17cfc9](_0x9315('0x7d'),'%'+_0x3cf460[_0x9315('0x6e')]+'%',null);}else{_0x93d5a6=_[_0x9315('0x6c')](_0x5da445,['name',_0x9315('0x7e')]);_0x3cf460['field']=_0x9315('0x7e');_0x5258e2=as[_0x9315('0x77')](_0xd6e620,_0x93d5a6[_0x9315('0x4a')],_0x3cf460);_0x276d87[_0x17cfc9](_0x5258e2[_0x9315('0x78')],_0x5258e2[_0x9315('0x6e')]['start'],_0x5258e2[_0x9315('0x6e')][_0x9315('0x31')]);}break;case _0x9315('0x7f'):_0x5258e2=as[_0x9315('0x77')]('me',null,_0x3cf460);_0x276d87[_0x17cfc9](_0x5258e2[_0x9315('0x78')],_0x5258e2[_0x9315('0x6e')]['start'],_0x5258e2['value'][_0x9315('0x31')]);break;}}else{var _0x5258e2=as['buildExpression'](_0xd6e620,_0x93d5a6['type'],_0x3cf460);_0x276d87[_0x17cfc9](_0x5258e2[_0x9315('0x78')],_0x5258e2[_0x9315('0x6e')][_0x9315('0x79')],_0x5258e2[_0x9315('0x6e')][_0x9315('0x31')]);}}}else{var _0x2e63be=_(_0x10830d[_0x9315('0x4c')])[_0x9315('0x4d')]()[_0x9315('0x41')](function(_0x5ebc1a){return _[_0x9315('0x80')](_0x5da445,[_0x9315('0x3e'),_0x5ebc1a])?_0x5ebc1a:undefined;})[_0x9315('0x81')]()[_0x9315('0x6e')]();if(!_['isEmpty'](_0x2e63be)){_0x2e63be[_0x9315('0x45')](function(_0x3e9043){if(_0x3e9043==='ChatWebsiteId'){_0x20d1d5[_0x9315('0x55')](_0x9315('0x82'),[][_0x9315('0x83')](_0x10830d[_0x9315('0x4c')][_0x3e9043]));}else if(_0x3e9043==='createdAt'){var _0xf54f7=JSON[_0x9315('0x84')](_0x10830d['query'][_0x3e9043])[_0x9315('0x85')];var _0xe6fc87=JSON[_0x9315('0x84')](_0x10830d[_0x9315('0x4c')][_0x3e9043])[_0x9315('0x86')];_0x20d1d5[_0x9315('0x55')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0xf54f7,_0xe6fc87);}else{if(_0x10830d[_0x9315('0x4c')][_0x3e9043]===_0x9315('0x87')){_0x20d1d5['where']('i.'+_0x3e9043+_0x9315('0x88'));}else{_0x20d1d5[_0x9315('0x55')]('i.'+_0x3e9043+_0x9315('0x89'),_0x10830d[_0x9315('0x4c')][_0x3e9043]);}}});}if(_0x10830d[_0x9315('0x4c')][_0x9315('0x8a')]){if(_0x10830d[_0x9315('0x4c')][_0x9315('0x8a')]==0x1){_0x20d1d5[_0x9315('0x70')](_0x9315('0x8b'));}else{_0x20d1d5[_0x9315('0x70')](_0x9315('0x8c'));}}if(_0x10830d[_0x9315('0x4c')][_0x9315('0x8d')]){_0x175f19=_['isArray'](_0x10830d[_0x9315('0x4c')][_0x9315('0x8d')])?_0x10830d[_0x9315('0x4c')]['tag']:new Array(_0x10830d[_0x9315('0x4c')][_0x9315('0x8d')]);_0x175f19[_0x9315('0x45')](function(_0x3d49bb){_0x1bf6bc['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3d49bb+',%');});}if(_0x10830d['query'][_0x9315('0x8e')]){var _0x26d530=_0x10830d[_0x9315('0x4c')][_0x9315('0x8e')]['replace']('\x5c','\x5c\x5c')[_0x9315('0x8f')]('\x27\x27',_0x9315('0x90'));if(qs[_0x9315('0x91')](_0x26d530)){_0x276d87['or'](_0x9315('0x92'),_0x26d530+'%');}else{_0x276d87['or'](_0x9315('0x93'),qs[_0x9315('0x94')](_0x26d530))['or'](_0x9315('0x95'),_0x26d530+'%');}}}_0x20d1d5[_0x9315('0x55')](_0x276d87);_0x20d1d5['group']('i.id');var _0xd31f95={'type':db[_0x9315('0x23')][_0x9315('0x96')][_0x9315('0x97')],'raw':!![]};var _0x16f0aa=_0x20d1d5['clone']();_0x16f0aa[_0x9315('0x58')](_0x9315('0x98'));_0x16f0aa[_0x9315('0x58')](_0x9315('0x99'),_0x9315('0x6d'));if(_0x4e66ff[_0x9315('0x9a')]){_0x4e66ff[_0x9315('0x9a')][_0x9315('0x45')](function(_0x90d8d4){_0x20d1d5[_0x9315('0x9a')]('i.'+_0x90d8d4[0x0],_0x90d8d4[0x1]===_0x9315('0x9b')?![]:!![]);});}if(!_[_0x9315('0x9c')](_0x175f19)){_0x20d1d5[_0x9315('0x70')](_0x1bf6bc);_0x16f0aa['where'](_0x9315('0x9d'),_0x175f19);}BPromise[_0x9315('0x9e')]()[_0x9315('0x26')](function(){if(!_0x9a033e&&_0x10830d[_0x9315('0x4c')][_0x9315('0x9f')])return;return _0x10830d[_0x9315('0xa0')][_0x9315('0xa1')]({'attributes':['id'],'raw':!![]})[_0x9315('0x26')](function(_0x534504){if(_['isEmpty'](_0x534504)){_0x16f0aa[_0x9315('0x55')](_0x9315('0xa2'));_0x20d1d5[_0x9315('0x55')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x16f0aa[_0x9315('0x55')](_0x9315('0x82'),_[_0x9315('0x41')](_0x534504,'id'));_0x20d1d5[_0x9315('0x55')]('i.ChatWebsiteId\x20IN\x20?',_[_0x9315('0x41')](_0x534504,'id'));}});})['then'](function(){db[_0x9315('0xa3')]['query'](_0x16f0aa['toString'](),_0xd31f95)[_0x9315('0x26')](function(_0x1aa34c){_0x390e6f[_0x9315('0x33')]=_0x1aa34c[_0x9315('0x6b')];if(_0x390e6f[_0x9315('0x33')]===0x0)return[];return db[_0x9315('0xa3')][_0x9315('0x4c')](_0x2be1fa[_0x9315('0xa4')](),_0xd31f95)['then'](function(_0x54006b){_0x5b3654=_[_0x9315('0xa5')](_0x54006b,'id');_0xd31f95=_[_0x9315('0xa6')](_0xd31f95,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x10830d[_0x9315('0x4c')][_0x9315('0x50')]){_0x4e66ff['attributes']['forEach'](function(_0x3416d0){_0x20d1d5[_0x9315('0x58')]('i.'+_0x3416d0);});}else{_0x20d1d5[_0x9315('0x58')](_0x9315('0x99'),'unreadMessages');_0x20d1d5['field'](_0x9315('0xa7'),'Account.key');_0x20d1d5[_0x9315('0x58')](_0x9315('0xa8'),_0x9315('0xa9'));_0x20d1d5['field'](_0x9315('0xaa'));_0x20d1d5[_0x9315('0x58')](_0x9315('0xab'),_0x9315('0xac'));_0x20d1d5[_0x9315('0x58')](_0x9315('0xad'),_0x9315('0xae'));_0x20d1d5[_0x9315('0x58')]('c.email',_0x9315('0xaf'));_0x20d1d5[_0x9315('0x58')](_0x9315('0xb0'),'Contact.phone');_0x20d1d5[_0x9315('0x58')](_0x9315('0xb1'),'Contact.mobile');_0x20d1d5['field'](_0x9315('0xb2'),_0x9315('0xb3'));_0x20d1d5['field'](_0x9315('0xb4'),_0x9315('0xb5'));_0x20d1d5[_0x9315('0x58')](_0x9315('0xb6'),_0x9315('0xb7'));_0x20d1d5[_0x9315('0x58')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x9315('0x42'));}_0x20d1d5[_0x9315('0x35')](_0x4e66ff['limit']);_0x20d1d5[_0x9315('0x34')](_0x4e66ff[_0x9315('0x34')]);return db[_0x9315('0xa3')][_0x9315('0x4c')](_0x20d1d5[_0x9315('0xa4')](),_0xd31f95);})['then'](function(_0x475e52){_0xdc27b7[_0x9315('0x55')](_0x9315('0xb8'),_[_0x9315('0x41')](_0x475e52,'id'));return db['sequelize']['query'](_0xdc27b7['toString'](),_0xd31f95)[_0x9315('0x26')](function(_0x55e7f9){var _0x153d40=_[_0x9315('0xb9')](_0x55e7f9,_0x9315('0xba'));var _0x8c93d5=[];_0x475e52['forEach'](function(_0x26c7f0){_0x8c93d5[_0x9315('0x46')](updateChatInteraction(_0x26c7f0,_0x5b3654,_0x153d40));});return BPromise['all'](_0x8c93d5);});});})[_0x9315('0x26')](function(_0x4fdbf3){_0x390e6f['rows']=_0x4fdbf3;return _0x390e6f;})[_0x9315('0x26')](respondWithFilteredResult(_0x4a693a,_0x4e66ff));})[_0x9315('0x2f')](handleError(_0x4a693a,null));};exports[_0x9315('0xbb')]=function(_0x26f36e,_0x4597f9){var _0x17326c={'raw':![],'where':{'id':_0x26f36e[_0x9315('0xbc')]['id']}},_0x12eff0={};_0x12eff0['model']=_['keys'](db[_0x9315('0x47')]['rawAttributes']);_0x12eff0['query']=_[_0x9315('0x4d')](_0x26f36e['query']);_0x12eff0[_0x9315('0x4e')]=_[_0x9315('0x4f')](_0x12eff0[_0x9315('0x4b')],_0x12eff0[_0x9315('0x4c')]);_0x17326c['attributes']=_[_0x9315('0x4f')](_0x12eff0[_0x9315('0x4b')],qs[_0x9315('0x50')](_0x26f36e[_0x9315('0x4c')][_0x9315('0x50')]));_0x17326c[_0x9315('0x51')]=_0x17326c[_0x9315('0x51')][_0x9315('0x6b')]?_0x17326c[_0x9315('0x51')]:_0x12eff0[_0x9315('0x4b')];if(_0x26f36e[_0x9315('0x4c')]['includeAll']){_0x17326c['include']=[{'all':!![]}];}_0x17326c=_[_0x9315('0xa6')]({},_0x17326c,_0x26f36e[_0x9315('0xbd')]);return db[_0x9315('0x47')][_0x9315('0x6c')](_0x17326c)[_0x9315('0x26')](handleEntityNotFound(_0x4597f9,null))[_0x9315('0x26')](respondWithResult(_0x4597f9,null))[_0x9315('0x2f')](handleError(_0x4597f9,null));};exports['create']=function(_0x4945f3,_0x30fdaf){return db['ChatInteraction'][_0x9315('0xbe')](_0x4945f3['body'],{})[_0x9315('0x26')](respondWithResult(_0x30fdaf,0xc9))['catch'](handleError(_0x30fdaf,null));};exports[_0x9315('0x3a')]=function(_0x284b31,_0x48b908){if(_0x284b31[_0x9315('0x7f')]['id']){delete _0x284b31['body']['id'];}return db['ChatInteraction'][_0x9315('0x6c')]({'where':{'id':_0x284b31[_0x9315('0xbc')]['id']}})[_0x9315('0x26')](handleEntityNotFound(_0x48b908,null))['then'](saveUpdates(_0x284b31['body'],null))[_0x9315('0x26')](respondWithResult(_0x48b908,null))[_0x9315('0x2f')](handleError(_0x48b908,null));};exports[_0x9315('0x3b')]=function(_0x1a6424,_0x1062bf){return db['ChatInteraction'][_0x9315('0x6c')]({'where':{'id':_0x1a6424[_0x9315('0xbc')]['id']}})['then'](handleEntityNotFound(_0x1062bf,null))[_0x9315('0x26')](removeEntity(_0x1062bf,null))[_0x9315('0x2f')](handleError(_0x1062bf,null));};exports[_0x9315('0xbf')]=function(_0xe749d6,_0x5f354a){return db['ChatInteraction'][_0x9315('0xbf')]()[_0x9315('0x26')](respondWithResult(_0x5f354a,null))[_0x9315('0x2f')](handleError(_0x5f354a,null));};exports[_0x9315('0xc0')]=function(_0x3b07ee,_0x57b3f7){if(_0x3b07ee[_0x9315('0x7f')]['id']){delete _0x3b07ee[_0x9315('0x7f')]['id'];}return db[_0x9315('0x47')][_0x9315('0x6c')]({'where':{'id':_0x3b07ee[_0x9315('0xbc')]['id']}})[_0x9315('0x26')](handleEntityNotFound(_0x57b3f7,null))[_0x9315('0x26')](saveUpdates(_0x3b07ee[_0x9315('0x7f')],null))['then'](respondWithResult(_0x57b3f7,null))['catch'](handleError(_0x57b3f7,null));};exports['abandon']=function(_0x1be778,_0x1a28a7,_0x4ad0ee){if(_0x1be778[_0x9315('0x7f')]['id']){delete _0x1be778[_0x9315('0x7f')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x1be778['params']['id']}})[_0x9315('0x26')](function(_0x165bd1){if(!_0x165bd1){logger[_0x9315('0x2b')](_0x9315('0xc1'),_0x9315('0xc2'),0x194,'entity\x20not\x20found');_0x1a28a7[_0x9315('0x3c')](0x194);}else{if(_0x165bd1[_0x9315('0x7e')]){throw new db['Sequelize'][(_0x9315('0x24'))](_0x9315('0xc3'));}}return _0x165bd1;})['then'](function(_0x26c313){if(_0x26c313){return _0x26c313[_0x9315('0x3a')]({'closed':_0x1be778[_0x9315('0x7f')][_0x9315('0xc4')],'disposition':_0x1be778['body']['disposition']})[_0x9315('0x26')](function(_0x3b0b37){return _0x3b0b37;});}})['then'](function(_0x4d67ba){return respondWithRpcPromise('AbandonInteraction','abandon',_0x1be778['body'],client9004);})[_0x9315('0x26')](respondWithResult(_0x1a28a7,null))[_0x9315('0x2f')](handleError(_0x1a28a7,null));};exports[_0x9315('0xc5')]=function(_0xfecefe,_0xd6b84c,_0xa1a5af){_0xfecefe[_0x9315('0x7f')][_0x9315('0x3e')]=_0xfecefe[_0x9315('0xc6')][_0x9315('0xc7')];_0xfecefe['body'][_0x9315('0xc8')]=_0xfecefe[_0x9315('0xc6')][_0x9315('0xc9')];_0xfecefe['body'][_0x9315('0x4a')]=_0xfecefe[_0x9315('0xc6')][_0x9315('0xca')];return db[_0x9315('0xcb')][_0x9315('0xbe')](_0xfecefe[_0x9315('0x7f')])[_0x9315('0x26')](respondWithResult(_0xd6b84c,0xc9))[_0x9315('0x2f')](handleError(_0xd6b84c,null));};exports[_0x9315('0xcc')]=function(_0x2839b7,_0x5af39c,_0x2f6bb6){return db[_0x9315('0x47')][_0x9315('0xcd')]({'where':{'id':_0x2839b7[_0x9315('0xbc')]['id']},'raw':!![]})[_0x9315('0x26')](handleEntityNotFound(_0x5af39c,null))[_0x9315('0x26')](function(_0x29912d){if(_0x29912d){if(_0x29912d[_0x9315('0xc4')]){return _0x5af39c[_0x9315('0x30')](0x193)['json']({'status':0x193,'message':_0x9315('0xce')});}return db[_0x9315('0xcb')]['findOne']({'where':{'id':_0x2839b7['query'][_0x9315('0xcf')]},'raw':!![]})[_0x9315('0x26')](handleEntityNotFound(_0x5af39c,null));}})['then'](function(_0x16db19){if(_0x16db19){return _0x5af39c[_0x9315('0xd0')](path[_0x9315('0xd1')](config['root'],'server/files/attachments/',_0x16db19['basename']));}})['catch'](handleError(_0x5af39c,null));};exports[_0x9315('0xd2')]=function(_0x50edfe,_0x50d24f){var _0x16e3aa=null;var _0x563156=null;var _0x2d3c6a=null;var _0x5a51d0=null;if(_0x50edfe[_0x9315('0x7f')]['id']){delete _0x50edfe[_0x9315('0x7f')]['id'];}if(_0x50edfe['body']['mailTranscript']){_0x5a51d0=path[_0x9315('0xd1')](config['root'],_0x9315('0xd3'),util[_0x9315('0xd4')](_0x9315('0xd5'),Date[_0x9315('0xd6')]()));_0x50edfe[_0x9315('0x7f')][_0x9315('0xd7')]=_0x5a51d0;}return db['ChatInteraction'][_0x9315('0x6c')]({'where':{'id':_0x50edfe[_0x9315('0xbc')]['id']},'include':[{'model':db[_0x9315('0xd8')],'as':'Messages','include':[{'model':db['User'],'as':_0x9315('0x7c')}]}]})[_0x9315('0x26')](handleEntityNotFound(_0x50d24f,null))[_0x9315('0x26')](saveUpdates(_0x50edfe[_0x9315('0x7f')],null))[_0x9315('0x26')](function(_0x4a2237){if(_0x4a2237){_0x16e3aa=_0x4a2237;return db['ChatWebsite']['find']({'where':{'id':_0x16e3aa[_0x9315('0x9f')]}});}})[_0x9315('0x26')](function(_0xd55f62){if(_0xd55f62){_0x2d3c6a=_0xd55f62;return db['CmContact']['find']({'where':{'id':_0x16e3aa[_0x9315('0x76')]}});}})[_0x9315('0x26')](function(_0x4f819e){if(_0x4f819e){_0x563156=_0x4f819e;if(_0x5a51d0){var _0x4aa2ef=null;for(var _0x37becb=0x1;_0x37becb<_0x16e3aa[_0x9315('0xd9')][_0x9315('0x6b')];++_0x37becb){_0x4aa2ef=_0x16e3aa['Messages'][_0x37becb];var _0x197d34=_0x4aa2ef[_0x9315('0x7e')]?util['format'](_0x9315('0xda'),_0x2d3c6a[_0x9315('0xdb')],_0x4aa2ef['UserId']):_0x9315('0xdc');var _0x129455=_0x50edfe[_0x9315('0x7f')][_0x9315('0xdd')]||util['format'](_0x9315('0xda'),_0x9315('0xde'),_0x4aa2ef[_0x9315('0x76')]);switch(_0x2d3c6a[_0x9315('0xdf')]){case _0x9315('0xe0'):_0x197d34=_0x4aa2ef['UserId']?util[_0x9315('0xd4')](_0x9315('0xda'),_0x2d3c6a[_0x9315('0xdb')],_0x4aa2ef['UserId']):_0x9315('0xdc');break;case _0x9315('0xe1'):_0x197d34=_0x4aa2ef['UserId']?_0x4aa2ef['User'][_0x9315('0xe2')]||_0x4aa2ef[_0x9315('0x7c')][_0x9315('0xe3')]:'System';break;case _0x9315('0xe4'):_0x197d34=_0x4aa2ef['UserId']?_0x4aa2ef['User'][_0x9315('0xe3')]:'System';break;default:_0x197d34=_0x4aa2ef[_0x9315('0x7e')]?util['format'](_0x9315('0xda'),_0x2d3c6a['agentAlias'],_0x4aa2ef[_0x9315('0x7e')]):'System';}var _0x271016=util['format'](_0x9315('0xe5'),moment(_0x4aa2ef[_0x9315('0xe6')])[_0x9315('0xd4')](_0x9315('0xe7')),_0x4aa2ef[_0x9315('0xe8')]==='in'?_0x129455:_0x197d34,_0x4aa2ef['body']);if(!_0x4aa2ef[_0x9315('0xe9')]){fs[_0x9315('0xea')](_0x5a51d0,_0x271016);}}return db[_0x9315('0xeb')][_0x9315('0xcd')]({'where':{'service':!![]},'include':[{'model':db[_0x9315('0xec')],'as':_0x9315('0xed'),'raw':!![]}]});}}})['then'](function(_0x2ebfb0){if(_0x2ebfb0&&_0x2ebfb0[_0x9315('0xed')]&&_0x50edfe['body']){var _0x391efa={'tls':{'rejectUnauthorized':![]}};if(_0x2ebfb0['Smtp'][_0x9315('0xee')]){_0x391efa[_0x9315('0xee')]=_0x2ebfb0['Smtp'][_0x9315('0xee')];}else{_0x391efa[_0x9315('0xef')]=_0x2ebfb0[_0x9315('0xed')][_0x9315('0xef')];_0x391efa[_0x9315('0xf0')]=_0x2ebfb0[_0x9315('0xed')][_0x9315('0xf0')];_0x391efa[_0x9315('0xf1')]=_0x2ebfb0[_0x9315('0xed')][_0x9315('0xf1')];}if(_0x2ebfb0[_0x9315('0xed')][_0x9315('0xf2')]){_0x391efa[_0x9315('0xf3')]={'user':_0x2ebfb0['Smtp'][_0x9315('0xa0')],'pass':_0x2ebfb0[_0x9315('0xed')]['pass']};}return respondWithRpcPromise(_0x9315('0xf4'),'sendMail',{'account':_0x391efa,'message':{'from':util[_0x9315('0xd4')](_0x9315('0xf5'),_0x2ebfb0['name'],_0x2ebfb0[_0x9315('0xf6')]||_0x2ebfb0[_0x9315('0xed')]['user']),'to':_0x50edfe['body']['mailTranscript'],'subject':'Mail\x20Transcript','text':util['format'](_0x9315('0xf7'),_0x50edfe[_0x9315('0x7f')][_0x9315('0xf8')]),'attachments':[{'path':_0x5a51d0}]}})[_0x9315('0x26')](function(){return _0x16e3aa;})[_0x9315('0x2f')](function(_0x3d3521){console['error'](_0x3d3521);});}else{return _0x16e3aa;}})[_0x9315('0x26')](respondWithStatusCode(_0x50d24f,0xc8))['catch'](handleError(_0x50d24f,null));};exports[_0x9315('0xf9')]=function(_0x101276,_0x274147,_0x21ff23){return db[_0x9315('0xd8')][_0x9315('0x6c')]({'where':{'id':_0x101276[_0x9315('0xbc')]['id']}})[_0x9315('0x26')](handleEntityNotFound(_0x274147,null))[_0x9315('0x26')](function(_0x46ad87){if(_0x46ad87){return _0x46ad87[_0x9315('0xf9')](_0x101276[_0x9315('0x7f')][_0x9315('0xfa')],_[_0x9315('0xfb')](_0x101276['body'],[_0x9315('0xfa'),'id'])||{});}})[_0x9315('0x26')](respondWithResult(_0x274147,null))['catch'](handleError(_0x274147,null));};exports['getMessages']=function(_0x29f95c,_0x4c324c,_0xbed4c4){var _0x443139={'raw':![],'where':{}};var _0x189d50={};var _0x208750={'count':0x0,'rows':[]};return db[_0x9315('0x47')][_0x9315('0xcd')]({'where':{'id':_0x29f95c[_0x9315('0xbc')]['id']}})[_0x9315('0x26')](handleEntityNotFound(_0x4c324c,null))[_0x9315('0x26')](function(_0x5bb896){if(_0x5bb896){_0x189d50[_0x9315('0x4b')]=_[_0x9315('0x4d')](db[_0x9315('0xd8')]['rawAttributes']);_0x189d50[_0x9315('0x4c')]=_[_0x9315('0x4d')](_0x29f95c[_0x9315('0x4c')]);_0x189d50[_0x9315('0x4e')]=_[_0x9315('0x4f')](_0x189d50[_0x9315('0x4b')],_0x189d50[_0x9315('0x4c')]);_0x443139[_0x9315('0x51')]=_[_0x9315('0x4f')](_0x189d50[_0x9315('0x4b')],qs[_0x9315('0x50')](_0x29f95c['query'][_0x9315('0x50')]));_0x443139[_0x9315('0x51')]=_0x443139['attributes']['length']?_0x443139[_0x9315('0x51')]:_0x189d50[_0x9315('0x4b')];if(!_0x29f95c[_0x9315('0x4c')][_0x9315('0x52')](_0x9315('0x53'))){_0x443139[_0x9315('0x35')]=qs['limit'](_0x29f95c['query'][_0x9315('0x35')]);_0x443139[_0x9315('0x34')]=qs[_0x9315('0x34')](_0x29f95c['query'][_0x9315('0x34')]);}_0x443139['order']=qs[_0x9315('0x54')](_0x29f95c['query'][_0x9315('0x54')]);_0x443139[_0x9315('0x55')]=qs[_0x9315('0x4e')](_['pick'](_0x29f95c['query'],_0x189d50[_0x9315('0x4e')]));_0x443139['where'][_0x9315('0xba')]=_0x5bb896['id'];if(_0x29f95c[_0x9315('0x4c')][_0x9315('0x8e')]){_0x443139[_0x9315('0x55')]=_[_0x9315('0xa6')](_0x443139[_0x9315('0x55')],{'$or':_[_0x9315('0x41')](_0x443139['attributes'],function(_0x30fa65){var _0x468e03={};_0x468e03[_0x30fa65]={'$like':'%'+_0x29f95c[_0x9315('0x4c')][_0x9315('0x8e')]+'%'};return _0x468e03;})});}if(_0x29f95c[_0x9315('0x4c')][_0x9315('0x85')]){var _0x1463d1=_0x29f95c[_0x9315('0x4c')][_0x9315('0x85')][_0x9315('0x44')](',');var _0x542a21={};_0x542a21[_0x1463d1[0x0]]={'$gte':moment(_0x1463d1[0x1])[_0x9315('0xd4')](_0x9315('0xfc'))};_0x443139['where']=_[_0x9315('0xa6')](_0x443139[_0x9315('0x55')],_0x542a21);}_0x443139=_['merge']({},_0x443139,_0x29f95c[_0x9315('0xbd')]);return db[_0x9315('0xd8')]['count']({'where':_0x443139['where']})['then'](function(_0x54a893){_0x208750[_0x9315('0x33')]=_0x54a893;if(_0x29f95c[_0x9315('0x4c')][_0x9315('0xfd')]){_0x443139[_0x9315('0xfe')]=[{'all':!![]}];}return db['ChatMessage'][_0x9315('0xff')](_0x443139);})[_0x9315('0x26')](function(_0x41dcdf){_0x208750[_0x9315('0x100')]=_0x41dcdf;return _0x208750;});}})['then'](respondWithFilteredResult(_0x4c324c,_0x443139))[_0x9315('0x2f')](handleError(_0x4c324c,null));};exports['getMyMessages']=function(_0x9c6c78,_0x5421f3,_0x2c5bc2){var _0x39ef8d={'where':{}},_0x5f0f76={},_0x16e43d={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x9315('0xcd')]({'where':{'id':_0x9c6c78[_0x9315('0xbc')]['id']}})[_0x9315('0x26')](handleEntityNotFound(_0x5421f3,null))[_0x9315('0x26')](function(_0x47c966){if(_0x47c966){_0x5f0f76['model']=_['keys'](db[_0x9315('0xd8')]['rawAttributes']);_0x5f0f76['query']=_[_0x9315('0x4d')](_0x9c6c78[_0x9315('0x4c')]);_0x5f0f76['filters']=_['intersection'](_0x5f0f76[_0x9315('0x4b')],_0x5f0f76[_0x9315('0x4c')]);_0x39ef8d[_0x9315('0x51')]=_[_0x9315('0x4f')](_0x5f0f76[_0x9315('0x4b')],qs[_0x9315('0x50')](_0x9c6c78[_0x9315('0x4c')][_0x9315('0x50')]));_0x39ef8d[_0x9315('0x51')]=_0x39ef8d[_0x9315('0x51')][_0x9315('0x6b')]?_0x39ef8d[_0x9315('0x51')]:_0x5f0f76['model'];if(!_0x9c6c78['query'][_0x9315('0x52')](_0x9315('0x53'))){_0x39ef8d[_0x9315('0x35')]=qs[_0x9315('0x35')](_0x9c6c78['query'][_0x9315('0x35')]);_0x39ef8d[_0x9315('0x34')]=qs['offset'](_0x9c6c78[_0x9315('0x4c')][_0x9315('0x34')]);}_0x39ef8d['order']=qs[_0x9315('0x54')](_0x9c6c78[_0x9315('0x4c')]['sort']);_0x39ef8d[_0x9315('0x55')]=qs[_0x9315('0x4e')](_['pick'](_0x9c6c78['query'],_0x5f0f76['filters']));_0x39ef8d[_0x9315('0x55')]['ChatInteractionId']=_0x47c966['id'];if(_0x9c6c78[_0x9315('0x4c')]['filter']){_0x39ef8d[_0x9315('0x55')]=_[_0x9315('0xa6')](_0x39ef8d[_0x9315('0x55')],{'$or':_[_0x9315('0x41')](_0x39ef8d[_0x9315('0x51')],function(_0xbe2ff4){var _0x58a1b4={};_0x58a1b4[_0xbe2ff4]={'$like':'%'+_0x9c6c78[_0x9315('0x4c')]['filter']+'%'};return _0x58a1b4;})});}_0x39ef8d[_0x9315('0x55')]['secret']=![];if(_0x9c6c78['query']['id']){_0x39ef8d['where']['id']={'$gt':_0x9c6c78[_0x9315('0x4c')]['id']};}_0x39ef8d=_[_0x9315('0xa6')]({},_0x39ef8d,_0x9c6c78[_0x9315('0xbd')]);return db['ChatMessage'][_0x9315('0x33')]({'where':_0x39ef8d['where']})[_0x9315('0x26')](function(_0x2656db){_0x16e43d[_0x9315('0x33')]=_0x2656db;_0x39ef8d['include']=[];if(_0x9c6c78[_0x9315('0x4c')][_0x9315('0x101')]){_0x39ef8d[_0x9315('0xfe')]['push']({'model':db[_0x9315('0x7c')],'as':_0x9315('0x7c'),'attributes':['id','fullname','alias']});}if(_0x9c6c78[_0x9315('0x4c')]['includeAll']){_0x39ef8d['include']=[{'all':!![]}];}return db[_0x9315('0xd8')][_0x9315('0xff')](_0x39ef8d);})[_0x9315('0x26')](function(_0x25f042){_0x16e43d[_0x9315('0x100')]=_0x25f042;return _0x16e43d;});}})[_0x9315('0x26')](respondWithFilteredResult(_0x5421f3,_0x39ef8d))[_0x9315('0x2f')](handleError(_0x5421f3,null));};exports[_0x9315('0x102')]=function(_0x525df7,_0x2a212d,_0x44dbab){return db[_0x9315('0x47')]['find']({'where':{'id':_0x525df7[_0x9315('0xbc')]['id']}})[_0x9315('0x26')](handleEntityNotFound(_0x2a212d,null))[_0x9315('0x26')](function(_0x47f7fd){if(_0x47f7fd){return _0x47f7fd[_0x9315('0x103')](_0x525df7['body'][_0x9315('0xfa')],_[_0x9315('0xfb')](_0x525df7[_0x9315('0x7f')],[_0x9315('0xfa'),'id'])||{})[_0x9315('0x104')](function(){return db[_0x9315('0x7a')][_0x9315('0xff')]({'attributes':['id',_0x9315('0x3e'),_0x9315('0x59')],'where':{'id':_0x525df7['body'][_0x9315('0xfa')]}});})[_0x9315('0x26')](function(_0x16d227){socket[_0x9315('0x105')]('chatInteractionTags:save',{'id':Number(_0x525df7['params']['id']),'tags':_0x16d227||[]});return{'id':Number(_0x525df7[_0x9315('0xbc')]['id']),'tags':_0x16d227||[]};});}})[_0x9315('0x26')](respondWithResult(_0x2a212d,null))[_0x9315('0x2f')](handleError(_0x2a212d,null));};exports[_0x9315('0x106')]=function(_0x518e26,_0x3d10e0,_0x274ca4){return db[_0x9315('0x47')]['find']({'where':{'id':_0x518e26[_0x9315('0xbc')]['id']}})['then'](handleEntityNotFound(_0x3d10e0,null))[_0x9315('0x26')](function(_0xebc3f1){if(_0xebc3f1){return _0xebc3f1[_0x9315('0x106')](_0x518e26[_0x9315('0x4c')][_0x9315('0xfa')]);}})['then'](respondWithStatusCode(_0x3d10e0,null))[_0x9315('0x2f')](handleError(_0x3d10e0,null));};exports['download']=function(_0x116a93,_0x7ac35){var _0x268bdc=moment()[_0x9315('0x107')]()[_0x9315('0xa4')]();var _0x48eee0=path['join'](config[_0x9315('0x108')],_0x9315('0x109'),_0x9315('0x10a'),_0x9315('0x10b'));var _0x1a0677=path[_0x9315('0xd1')](config[_0x9315('0x108')],_0x9315('0x109'),_0x9315('0x10a'),'attachments');var _0x4ea27d=path[_0x9315('0xd1')](_0x48eee0,_0x268bdc);var _0x8af5d0=util['format']('transcript-%d-%s.zip',_0x116a93[_0x9315('0xbc')]['id'],_0x268bdc);var _0x4bf8ab=path[_0x9315('0xd1')](_0x48eee0,_0x8af5d0);var _0x31e6d5=[];_0x31e6d5[_0x9315('0x46')]({'model':db[_0x9315('0x7c')],'as':_0x9315('0x7c'),'attributes':['id',_0x9315('0xe3')],'raw':!![]});_0x31e6d5['push']({'model':db['CmContact'],'as':'Contact','attributes':['id',_0x9315('0x10c'),_0x9315('0x10d')],'raw':!![]});if(_0x116a93[_0x9315('0x4c')]['attachments']){_0x31e6d5[_0x9315('0x46')]({'model':db['Attachment'],'as':_0x9315('0xcb'),'raw':!![]});}var _0x3daaa9=[{'model':db[_0x9315('0xd8')],'as':'Messages','attributes':['id',_0x9315('0x7f'),'createdAt','direction',_0x9315('0xe9'),'read'],'include':_0x31e6d5}];_0x3daaa9[_0x9315('0x46')]({'model':db[_0x9315('0x10e')],'as':'Account','attributes':['id',_0x9315('0x3e')]});_0x3daaa9[_0x9315('0x46')]({'model':db[_0x9315('0x7c')],'as':_0x9315('0x10f'),'attributes':['id',_0x9315('0xe3')]});return db['ChatInteraction'][_0x9315('0x6c')]({'where':{'id':_0x116a93[_0x9315('0xbc')]['id']},'include':_0x3daaa9})['then'](handleEntityNotFound(_0x7ac35,null))[_0x9315('0x26')](function(_0x39a423){if(_0x39a423){var _0x47aac1=_0x39a423[_0x9315('0x110')]({'plain':!![]});fs[_0x9315('0x111')](_0x4ea27d);var _0x501bc4={'format':'A4','border':'10px','header':{'height':_0x9315('0x112'),'contents':{'first':_0x9315('0x113')}},'footer':{'height':_0x9315('0x114'),'contents':{'default':util[_0x9315('0xd4')](_0x9315('0x115'),util[_0x9315('0xd4')]('%s\x20#%d',_0x9315('0x116'),_0x47aac1['id']),moment()['format'](_0x9315('0x117'))['toString']())}}};var _0x5c3e28={'channel':_0x9315('0x116'),'account':_0x47aac1[_0x9315('0x118')][_0x9315('0x3e')],'agent':_0x47aac1[_0x9315('0x10f')]?_0x47aac1[_0x9315('0x10f')]['fullname']:_0x9315('0x119'),'createdAt':moment(_0x47aac1['createdAt'])['format'](_0x9315('0xfc'))[_0x9315('0xa4')](),'closedAt':_0x47aac1['closed']?moment(_0x47aac1['closedAt'])['format'](_0x9315('0xfc'))[_0x9315('0xa4')]():'','disposition':_0x47aac1[_0x9315('0x11a')],'chatInfo':{'browser':_0x47aac1['browserName'],'os':_0x47aac1[_0x9315('0x11b')],'referer':_0x47aac1['referer'],'customerIp':_0x47aac1[_0x9315('0x11c')],'customerPort':_0x47aac1['customerPort']?_0x47aac1[_0x9315('0x11d')]:'N.A.'},'messages':_(_0x47aac1[_0x9315('0xd9')])[_0x9315('0x11e')]()[_0x9315('0x8e')]({'secret':![]})[_0x9315('0x41')](function(_0x572a8a){if(_0x572a8a[_0x9315('0xcb')]){var _0x3f0a75=path['join'](_0x1a0677,_0x572a8a['Attachment'][_0x9315('0xc8')]);if(fs[_0x9315('0x11f')](_0x3f0a75)){fs[_0x9315('0x120')](_0x3f0a75)[_0x9315('0x121')](fs[_0x9315('0x122')](path[_0x9315('0xd1')](_0x4ea27d,_0x572a8a[_0x9315('0xcb')][_0x9315('0xc8')])));}}return{'date':moment(_0x572a8a['createdAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x9315('0xa4')](),'sender':_0x572a8a[_0x9315('0xe8')]==='out'?_0x572a8a[_0x9315('0x7c')]?_0x572a8a[_0x9315('0x7c')][_0x9315('0xe3')]:'System':_0x572a8a['Contact']['firstName']+(_0x572a8a[_0x9315('0x123')][_0x9315('0x10d')]?'\x20'+_0x572a8a[_0x9315('0x123')][_0x9315('0x10d')]:''),'body':_0x572a8a['Attachment']?_0x572a8a['Attachment']['basename']:_0x572a8a[_0x9315('0x7f')],'direction':_0x572a8a[_0x9315('0xe8')]===_0x9315('0x124')?'A':'C','secret':_0x572a8a['secret'],'read':_0x572a8a['read'],'attachment':_0x572a8a[_0x9315('0xcb')]};})[_0x9315('0x6e')]()};return ejs[_0x9315('0x125')](path[_0x9315('0xd1')](config[_0x9315('0x108')],_0x9315('0x109'),_0x9315('0x126'),_0x9315('0x127')),{'interaction':_0x5c3e28})[_0x9315('0x26')](function(_0x18e7ec){return new BPromise(function(_0xb7ca23,_0x36da2){pdf[_0x9315('0xbe')](_0x18e7ec,_0x501bc4)['toFile'](path[_0x9315('0xd1')](_0x4ea27d,_0x9315('0x128')+_0x47aac1['id']+'-'+_0x268bdc+_0x9315('0x129')),function(_0x58f910,_0x50d758){if(_0x58f910)return _0x36da2(_0x58f910);_0xb7ca23(_0x50d758);});});})['then'](function(){return new BPromise(function(_0x142ea9,_0x8fffbc){zipdir(_0x4ea27d,{'saveTo':_0x4bf8ab},function(_0xc59383,_0x2e14c3){if(_0xc59383)return _0x8fffbc(_0xc59383);return _0x142ea9(_0x2e14c3);});})[_0x9315('0x26')](function(){return new BPromise(function(_0xa83760,_0x2762c1){rimraf(_0x4ea27d,function(_0x34e08c){if(_0x34e08c)_0x2762c1(_0x34e08c);return _0xa83760();});});})[_0x9315('0x26')](function(){return _0x7ac35[_0x9315('0xd0')](_0x4bf8ab,_0x8af5d0,function(_0x55069d){if(_0x55069d){console['log'](_0x9315('0x12a'),_0x55069d);}else{fs[_0x9315('0x12b')](_0x4bf8ab);}});});});}else{return _0x7ac35[_0x9315('0x3c')](0xc8);}})[_0x9315('0x2f')](handleError(_0x7ac35,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 484bb87..ea18e66 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 _0xbe5d=['getUsers','Users','map','findAll','setDataValue','unreadMessages','emit','catch','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0xbe5d,0x90));var _0xdbe5=function(_0x516ac4,_0x8b2375){_0x516ac4=_0x516ac4-0x0;var _0x35c675=_0xbe5d[_0x516ac4];return _0x35c675;};'use strict';var EventEmitter=require(_0xdbe5('0x0'));var ChatInteraction=require(_0xdbe5('0x1'))['db'][_0xdbe5('0x2')];var ChatMessage=require(_0xdbe5('0x1'))['db'][_0xdbe5('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xdbe5('0x4')](0x0);var events={'afterCreate':_0xdbe5('0x5'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x19b663){return function(_0x26da9a,_0x16045f,_0x21ca46){_0x26da9a[_0xdbe5('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x221f07){_0x26da9a['setDataValue'](_0xdbe5('0x7'),_0x221f07[_0xdbe5('0x8')](function(_0x48a24c){return{'id':_0x48a24c['id']};}));return ChatMessage[_0xdbe5('0x9')]({'where':{'ChatInteractionId':_0x26da9a['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x6c0073){_0x26da9a[_0xdbe5('0xa')](_0xdbe5('0xb'),_0x6c0073['length']);ChatInteractionEvents[_0xdbe5('0xc')](_0x19b663+':'+_0x26da9a['id'],_0x26da9a);ChatInteractionEvents[_0xdbe5('0xc')](_0x19b663,_0x26da9a);_0x21ca46(null);})[_0xdbe5('0xd')](_0x21ca46(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xdbe5('0xe')]=ChatInteractionEvents; \ No newline at end of file +var _0x19ae=['setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','getUsers','then'];(function(_0x510b98,_0x4c4cbb){var _0x45e775=function(_0x29ec11){while(--_0x29ec11){_0x510b98['push'](_0x510b98['shift']());}};_0x45e775(++_0x4c4cbb);}(_0x19ae,0x99));var _0xe19a=function(_0x5520c9,_0x1b6f65){_0x5520c9=_0x5520c9-0x0;var _0x5307e1=_0x19ae[_0x5520c9];return _0x5307e1;};'use strict';var EventEmitter=require(_0xe19a('0x0'));var ChatInteraction=require(_0xe19a('0x1'))['db']['ChatInteraction'];var ChatMessage=require('../../mysqldb')['db'][_0xe19a('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xe19a('0x3')](0x0);var events={'afterCreate':_0xe19a('0x4'),'afterUpdate':_0xe19a('0x5'),'afterDestroy':_0xe19a('0x6')};function emitEvent(_0x116f31){return function(_0x3e2752,_0x1c1062,_0x2149ca){_0x3e2752[_0xe19a('0x7')]({'attributes':['id'],'raw':!![]})[_0xe19a('0x8')](function(_0x1b76e8){_0x3e2752[_0xe19a('0x9')](_0xe19a('0xa'),_0x1b76e8[_0xe19a('0xb')](function(_0x2bd840){return{'id':_0x2bd840['id']};}));return ChatMessage[_0xe19a('0xc')]({'where':{'ChatInteractionId':_0x3e2752['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe19a('0x8')](function(_0x5a3aa1){_0x3e2752[_0xe19a('0x9')](_0xe19a('0xd'),_0x5a3aa1[_0xe19a('0xe')]);ChatInteractionEvents['emit'](_0x116f31+':'+_0x3e2752['id'],_0x3e2752);ChatInteractionEvents[_0xe19a('0xf')](_0x116f31,_0x3e2752);_0x2149ca(null);})[_0xe19a('0x10')](_0x2149ca(null));};}for(var e in events){if(events[_0xe19a('0x11')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 0fcd7ae..9f38459 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 _0x7c51=['closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','ChatInteraction','chat_interactions','changed','closed'];(function(_0x79bb,_0x202cb7){var _0x6a890=function(_0x2ff27){while(--_0x2ff27){_0x79bb['push'](_0x79bb['shift']());}};_0x6a890(++_0x202cb7);}(_0x7c51,0x8c));var _0x17c5=function(_0x56281d,_0x15339e){_0x56281d=_0x56281d-0x0;var _0x535b12=_0x7c51[_0x56281d];return _0x535b12;};'use strict';var _=require(_0x17c5('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x17c5('0x1'));var moment=require(_0x17c5('0x2'));var BPromise=require(_0x17c5('0x3'));var rp=require(_0x17c5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x17c5('0x5'));var config=require(_0x17c5('0x6'));var attributes=require('./chatInteraction.attributes');module[_0x17c5('0x7')]=function(_0x33ea9a,_0x51c9dc){return _0x33ea9a[_0x17c5('0x8')](_0x17c5('0x9'),attributes,{'tableName':_0x17c5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1a9fd9,_0x8daa9c,_0x3c1098){if(_0x1a9fd9[_0x17c5('0xb')](_0x17c5('0xc'))){_0x1a9fd9[_0x17c5('0xd')]=moment()['format'](_0x17c5('0xe'));}_0x3c1098(null,_0x1a9fd9);}},'charset':_0x17c5('0xf'),'collate':_0x17c5('0x10')});}; \ No newline at end of file +var _0x6c39=['closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','chat_interactions','changed','closed'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x6c39,0xbf));var _0x96c3=function(_0x2390bd,_0x212fbd){_0x2390bd=_0x2390bd-0x0;var _0x3a969d=_0x6c39[_0x2390bd];return _0x3a969d;};'use strict';var _=require('lodash');var util=require(_0x96c3('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x96c3('0x1'));var BPromise=require(_0x96c3('0x2'));var rp=require(_0x96c3('0x3'));var fs=require('fs');var path=require(_0x96c3('0x4'));var rimraf=require(_0x96c3('0x5'));var config=require(_0x96c3('0x6'));var attributes=require(_0x96c3('0x7'));module[_0x96c3('0x8')]=function(_0x14e656,_0x27fa86){return _0x14e656[_0x96c3('0x9')]('ChatInteraction',attributes,{'tableName':_0x96c3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2628a0,_0x1c69a6,_0xed018){if(_0x2628a0[_0x96c3('0xb')](_0x96c3('0xc'))){_0x2628a0[_0x96c3('0xd')]=moment()['format'](_0x96c3('0xe'));}_0xed018(null,_0x2628a0);}},'charset':_0x96c3('0xf'),'collate':_0x96c3('0x10')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 0360b5c..8fbd085 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 _0xd442=['UpdateChatInteraction','update','body','options','where','attributes','limit','debug','AddTagsToChatInteraction','ChatInteraction','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','then','ChatInteraction,\x20%s,\x20%s','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','result','catch'];(function(_0x585010,_0x2af1ad){var _0x494d1a=function(_0x383f7e){while(--_0x383f7e){_0x585010['push'](_0x585010['shift']());}};_0x494d1a(++_0x2af1ad);}(_0xd442,0x157));var _0x2d44=function(_0x5a6235,_0x27692e){_0x5a6235=_0x5a6235-0x0;var _0xab27d7=_0xd442[_0x5a6235];return _0xab27d7;};'use strict';var _=require(_0x2d44('0x0'));var util=require(_0x2d44('0x1'));var moment=require(_0x2d44('0x2'));var BPromise=require(_0x2d44('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2d44('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2d44('0x5'));var logger=require(_0x2d44('0x6'))(_0x2d44('0x7'));var config=require(_0x2d44('0x8'));var jayson=require(_0x2d44('0x9'));var client=jayson[_0x2d44('0xa')][_0x2d44('0xb')]({'port':0x232a});config[_0x2d44('0xc')]=_['defaults'](config[_0x2d44('0xc')],{'host':_0x2d44('0xd'),'port':0x18eb});var socket=require(_0x2d44('0xe'))(new Redis(config[_0x2d44('0xc')]));require('./chatInteraction.socket')[_0x2d44('0xf')](socket);function respondWithRpcPromise(_0xbe0452,_0x40b55b,_0x2c0e3e){return new BPromise(function(_0x94339d,_0x553868){return client['request'](_0xbe0452,_0x2c0e3e)[_0x2d44('0x10')](function(_0x4156d3){logger['info'](_0x2d44('0x11'),_0x40b55b,'request\x20sent');logger['debug'](_0x2d44('0x12'),_0x40b55b,'request\x20sent',JSON[_0x2d44('0x13')](_0x4156d3));if(_0x4156d3[_0x2d44('0x14')]){if(_0x4156d3['error']['code']===0x1f4){logger[_0x2d44('0x14')](_0x2d44('0x11'),_0x40b55b,_0x4156d3[_0x2d44('0x14')][_0x2d44('0x15')]);return _0x553868(_0x4156d3[_0x2d44('0x14')][_0x2d44('0x15')]);}logger[_0x2d44('0x14')](_0x2d44('0x11'),_0x40b55b,_0x4156d3['error'][_0x2d44('0x15')]);return _0x94339d(_0x4156d3[_0x2d44('0x14')][_0x2d44('0x15')]);}else{logger[_0x2d44('0x16')](_0x2d44('0x11'),_0x40b55b,_0x2d44('0x17'));_0x94339d(_0x4156d3[_0x2d44('0x18')][_0x2d44('0x15')]);}})[_0x2d44('0x19')](function(_0x16bc05){logger[_0x2d44('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x40b55b,_0x16bc05);_0x553868(_0x16bc05);});});}exports[_0x2d44('0x1a')]=function(_0x3f40c7){var _0x2b291d=this;return new Promise(function(_0x44fe1a,_0x21775d){return db['ChatInteraction'][_0x2d44('0x1b')](_0x3f40c7[_0x2d44('0x1c')],{'raw':_0x3f40c7['options']?_0x3f40c7[_0x2d44('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f40c7[_0x2d44('0x1d')]?_0x3f40c7[_0x2d44('0x1d')][_0x2d44('0x1e')]||null:null,'attributes':_0x3f40c7[_0x2d44('0x1d')]?_0x3f40c7[_0x2d44('0x1d')][_0x2d44('0x1f')]||null:null,'limit':_0x3f40c7[_0x2d44('0x1d')]?_0x3f40c7[_0x2d44('0x1d')][_0x2d44('0x20')]||null:null})[_0x2d44('0x10')](function(_0x51a794){logger[_0x2d44('0x16')]('UpdateChatInteraction',_0x3f40c7);logger[_0x2d44('0x21')]('UpdateChatInteraction',_0x3f40c7,JSON[_0x2d44('0x13')](_0x51a794));_0x44fe1a(_0x51a794);})['catch'](function(_0x5ac36a){logger[_0x2d44('0x14')](_0x2d44('0x1a'),_0x5ac36a['message'],_0x3f40c7);_0x21775d(_0x2b291d[_0x2d44('0x14')](0x1f4,_0x5ac36a[_0x2d44('0x15')]));});});};exports[_0x2d44('0x22')]=function(_0x1b5515){return new Promise(function(_0x490b4f,_0x216422){return db[_0x2d44('0x23')]['find']({'where':_0x1b5515['options']?_0x1b5515[_0x2d44('0x1d')][_0x2d44('0x1e')]||null:null})['then'](function(_0x5b326e){if(_0x5b326e){return _0x5b326e[_0x2d44('0x24')](_0x1b5515[_0x2d44('0x1c')][_0x2d44('0x25')],_[_0x2d44('0x26')](_0x1b5515['body'],[_0x2d44('0x25'),'id'])||{});}})[_0x2d44('0x27')](function(_0x2e3091){logger[_0x2d44('0x16')](_0x2d44('0x28'),_0x1b5515);logger[_0x2d44('0x21')]('AddTags',_0x1b5515,JSON[_0x2d44('0x13')](_0x2e3091));_0x490b4f(_0x2e3091);})[_0x2d44('0x19')](function(_0x14ddf1){logger[_0x2d44('0x14')](_0x2d44('0x28'),_0x14ddf1[_0x2d44('0x15')],_0x1b5515);_0x216422(_this['error'](0x1f4,_0x14ddf1[_0x2d44('0x15')]));});});}; \ No newline at end of file +var _0x8e59=['error','code','message','UpdateChatInteraction','update','body','options','raw','where','attributes','catch','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x8e59,0x90));var _0x98e5=function(_0x197b3d,_0x205351){_0x197b3d=_0x197b3d-0x0;var _0x2fbbf7=_0x8e59[_0x197b3d];return _0x2fbbf7;};'use strict';var _=require(_0x98e5('0x0'));var util=require(_0x98e5('0x1'));var moment=require('moment');var BPromise=require(_0x98e5('0x2'));var rs=require(_0x98e5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x98e5('0x4'))['db'];var utils=require(_0x98e5('0x5'));var logger=require(_0x98e5('0x6'))('rpc');var config=require(_0x98e5('0x7'));var jayson=require(_0x98e5('0x8'));var client=jayson[_0x98e5('0x9')][_0x98e5('0xa')]({'port':0x232a});config['redis']=_[_0x98e5('0xb')](config[_0x98e5('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x98e5('0xd'))(new Redis(config['redis']));require(_0x98e5('0xe'))[_0x98e5('0xf')](socket);function respondWithRpcPromise(_0x23633c,_0x32e7e1,_0x3dbcc7){return new BPromise(function(_0x39741e,_0x278ba9){return client[_0x98e5('0x10')](_0x23633c,_0x3dbcc7)[_0x98e5('0x11')](function(_0x54627f){logger[_0x98e5('0x12')](_0x98e5('0x13'),_0x32e7e1,_0x98e5('0x14'));logger[_0x98e5('0x15')](_0x98e5('0x16'),_0x32e7e1,_0x98e5('0x14'),JSON[_0x98e5('0x17')](_0x54627f));if(_0x54627f[_0x98e5('0x18')]){if(_0x54627f['error'][_0x98e5('0x19')]===0x1f4){logger[_0x98e5('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x32e7e1,_0x54627f[_0x98e5('0x18')][_0x98e5('0x1a')]);return _0x278ba9(_0x54627f[_0x98e5('0x18')][_0x98e5('0x1a')]);}logger[_0x98e5('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x32e7e1,_0x54627f[_0x98e5('0x18')]['message']);return _0x39741e(_0x54627f[_0x98e5('0x18')][_0x98e5('0x1a')]);}else{logger[_0x98e5('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x32e7e1,_0x98e5('0x14'));_0x39741e(_0x54627f['result'][_0x98e5('0x1a')]);}})['catch'](function(_0x2b96ca){logger['error'](_0x98e5('0x13'),_0x32e7e1,_0x2b96ca);_0x278ba9(_0x2b96ca);});});}exports[_0x98e5('0x1b')]=function(_0x3272f3){var _0x1ab250=this;return new Promise(function(_0x272962,_0x4001b0){return db['ChatInteraction'][_0x98e5('0x1c')](_0x3272f3[_0x98e5('0x1d')],{'raw':_0x3272f3[_0x98e5('0x1e')]?_0x3272f3['options'][_0x98e5('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3272f3[_0x98e5('0x1e')]?_0x3272f3[_0x98e5('0x1e')][_0x98e5('0x20')]||null:null,'attributes':_0x3272f3[_0x98e5('0x1e')]?_0x3272f3[_0x98e5('0x1e')][_0x98e5('0x21')]||null:null,'limit':_0x3272f3[_0x98e5('0x1e')]?_0x3272f3[_0x98e5('0x1e')]['limit']||null:null})['then'](function(_0xa86877){logger[_0x98e5('0x12')](_0x98e5('0x1b'),_0x3272f3);logger[_0x98e5('0x15')](_0x98e5('0x1b'),_0x3272f3,JSON[_0x98e5('0x17')](_0xa86877));_0x272962(_0xa86877);})[_0x98e5('0x22')](function(_0xd273f){logger[_0x98e5('0x18')]('UpdateChatInteraction',_0xd273f[_0x98e5('0x1a')],_0x3272f3);_0x4001b0(_0x1ab250[_0x98e5('0x18')](0x1f4,_0xd273f['message']));});});};exports[_0x98e5('0x23')]=function(_0xd44c32){return new Promise(function(_0x514eb8,_0x56761b){return db['ChatInteraction'][_0x98e5('0x24')]({'where':_0xd44c32[_0x98e5('0x1e')]?_0xd44c32['options'][_0x98e5('0x20')]||null:null})[_0x98e5('0x11')](function(_0x24395c){if(_0x24395c){return _0x24395c[_0x98e5('0x25')](_0xd44c32[_0x98e5('0x1d')][_0x98e5('0x26')],_[_0x98e5('0x27')](_0xd44c32[_0x98e5('0x1d')],[_0x98e5('0x26'),'id'])||{});}})[_0x98e5('0x28')](function(_0x127f7c){logger[_0x98e5('0x12')](_0x98e5('0x29'),_0xd44c32);logger[_0x98e5('0x15')](_0x98e5('0x29'),_0xd44c32,JSON[_0x98e5('0x17')](_0x127f7c));_0x514eb8(_0x127f7c);})['catch'](function(_0x1024b8){logger[_0x98e5('0x18')](_0x98e5('0x29'),_0x1024b8[_0x98e5('0x1a')],_0xd44c32);_0x56761b(_this[_0x98e5('0x18')](0x1f4,_0x1024b8[_0x98e5('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 5b6517b..15062ec 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 _0xfb67=['register','length','chatInteraction:','save','remove','emit','removeListener'];(function(_0x534c5f,_0x39f329){var _0x7404e2=function(_0x9f62e8){while(--_0x9f62e8){_0x534c5f['push'](_0x534c5f['shift']());}};_0x7404e2(++_0x39f329);}(_0xfb67,0x17d));var _0x7fb6=function(_0x44f142,_0x2775a3){_0x44f142=_0x44f142-0x0;var _0x198642=_0xfb67[_0x44f142];return _0x198642;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x7fb6('0x0'),_0x7fb6('0x1'),'update'];function createListener(_0x7e1827,_0x2e4d96){return function(_0x1cd659){_0x2e4d96[_0x7fb6('0x2')](_0x7e1827,_0x1cd659);};}function removeListener(_0xb63f18,_0x148dc0){return function(){ChatInteractionEvents[_0x7fb6('0x3')](_0xb63f18,_0x148dc0);};}exports[_0x7fb6('0x4')]=function(_0x263a7d){for(var _0x39b8cf=0x0,_0x393d09=events[_0x7fb6('0x5')];_0x39b8cf<_0x393d09;_0x39b8cf++){var _0x593bc2=events[_0x39b8cf];var _0x270130=createListener(_0x7fb6('0x6')+_0x593bc2,_0x263a7d);ChatInteractionEvents['on'](_0x593bc2,_0x270130);}}; \ No newline at end of file +var _0x8a31=['remove','update','emit','length','chatInteraction:','save'];(function(_0x2ba29f,_0x13981a){var _0x120bd1=function(_0x28f34d){while(--_0x28f34d){_0x2ba29f['push'](_0x2ba29f['shift']());}};_0x120bd1(++_0x13981a);}(_0x8a31,0xa1));var _0x18a3=function(_0x2d9c6a,_0x59393d){_0x2d9c6a=_0x2d9c6a-0x0;var _0xf3c918=_0x8a31[_0x2d9c6a];return _0xf3c918;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x18a3('0x0'),_0x18a3('0x1'),_0x18a3('0x2')];function createListener(_0x12419b,_0x577036){return function(_0xc6cdfa){_0x577036[_0x18a3('0x3')](_0x12419b,_0xc6cdfa);};}function removeListener(_0x417bc1,_0x3ffbdc){return function(){ChatInteractionEvents['removeListener'](_0x417bc1,_0x3ffbdc);};}exports['register']=function(_0x38d2e2){for(var _0x2d5c23=0x0,_0x909b9c=events[_0x18a3('0x4')];_0x2d5c23<_0x909b9c;_0x2d5c23++){var _0x579339=events[_0x2d5c23];var _0x2bec04=createListener(_0x18a3('0x5')+_0x579339,_0x38d2e2);ChatInteractionEvents['on'](_0x579339,_0x2bec04);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index a1f676a..4dae038 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 _0xd13a=['../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','getMyMessages','/:id/download','download','post','create','diskStorage','root','server/files/attachments/','format','%s-%s','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/custom_update','/:id/abandon','abandon','close','delete','chatinteraction:destroy','removeTags','exports','multer','util','connect-timeout','express','Router'];(function(_0xe99dad,_0x371bfe){var _0x156518=function(_0x5d4535){while(--_0x5d4535){_0xe99dad['push'](_0xe99dad['shift']());}};_0x156518(++_0x371bfe);}(_0xd13a,0xff));var _0xad13=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0xd13a[_0x3ab9ee];return _0x82ee88;};'use strict';var multer=require(_0xad13('0x0'));var util=require(_0xad13('0x1'));var path=require('path');var timeout=require(_0xad13('0x2'));var express=require(_0xad13('0x3'));var router=express[_0xad13('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xad13('0x5'));var config=require(_0xad13('0x6'));var controller=require(_0xad13('0x7'));router[_0xad13('0x8')]('/',auth[_0xad13('0x9')](),controller[_0xad13('0xa')]);router[_0xad13('0x8')](_0xad13('0xb'),auth['isAuthenticated'](),controller[_0xad13('0xc')]);router[_0xad13('0x8')](_0xad13('0xd'),auth['isChatInteractionAuthorized'](),controller['show']);router[_0xad13('0x8')](_0xad13('0xe'),auth[_0xad13('0xf')](),controller[_0xad13('0x10')]);router[_0xad13('0x8')](_0xad13('0x11'),auth[_0xad13('0x9')](),controller[_0xad13('0x12')]);router[_0xad13('0x8')]('/:id/my_messages',auth[_0xad13('0xf')](),controller[_0xad13('0x13')]);router[_0xad13('0x8')](_0xad13('0x14'),auth[_0xad13('0x9')](),controller[_0xad13('0x15')]);router[_0xad13('0x16')]('/',auth[_0xad13('0x9')](),controller[_0xad13('0x17')]);var upload=multer({'storage':multer[_0xad13('0x18')]({'destination':function(_0x2091ae,_0x18c518,_0x371c5f){_0x371c5f(null,path['join'](config[_0xad13('0x19')],_0xad13('0x1a')));},'filename':function(_0x20bbee,_0x12e7a4,_0x1899b8){_0x1899b8(null,util[_0xad13('0x1b')](_0xad13('0x1c'),Date['now'](),_0x12e7a4[_0xad13('0x1d')][_0xad13('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xad13('0x16')](_0xad13('0x1f'),upload[_0xad13('0x20')](_0xad13('0x21')),controller[_0xad13('0x22')]);router[_0xad13('0x16')](_0xad13('0x11'),auth['isChatInteractionAuthorized'](),controller[_0xad13('0x23')]);router[_0xad13('0x16')](_0xad13('0x24'),auth['isAuthenticated'](),interaction[_0xad13('0x25')](_0xad13('0x26'),_0xad13('0x27')),controller[_0xad13('0x28')]);router[_0xad13('0x29')](_0xad13('0xd'),auth[_0xad13('0x9')](),interaction['tracked'](_0xad13('0x26'),_0xad13('0x2a')),controller[_0xad13('0x2b')]);router[_0xad13('0x29')](_0xad13('0x2c'),controller['customUpdate']);router[_0xad13('0x29')](_0xad13('0x2d'),auth[_0xad13('0xf')](),controller[_0xad13('0x2e')]);router[_0xad13('0x29')]('/:id/close',controller[_0xad13('0x2f')]);router[_0xad13('0x30')](_0xad13('0xd'),auth['isAuthenticated'](),interaction[_0xad13('0x25')](_0xad13('0x26'),_0xad13('0x31')),controller['destroy']);router[_0xad13('0x30')](_0xad13('0x24'),auth[_0xad13('0x9')](),controller[_0xad13('0x32')]);module[_0xad13('0x33')]=router; \ No newline at end of file +var _0x508b=['express','Router','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','download','post','create','join','server/files/attachments/','%s-%s','now','originalname','file','attachmentUpload','addMessage','tracked','chat','chatinteraction:addtags','addTags','put','/:id/custom_update','customUpdate','abandon','/:id/close','delete','chatinteraction:destroy','destroy','/:id/tags','removeTags','multer','path','connect-timeout'];(function(_0x5a6146,_0x53ffe8){var _0xab931d=function(_0x5ddeee){while(--_0x5ddeee){_0x5a6146['push'](_0x5a6146['shift']());}};_0xab931d(++_0x53ffe8);}(_0x508b,0x16d));var _0xb508=function(_0x53955c,_0x1400fd){_0x53955c=_0x53955c-0x0;var _0x591b50=_0x508b[_0x53955c];return _0x591b50;};'use strict';var multer=require(_0xb508('0x0'));var util=require('util');var path=require(_0xb508('0x1'));var timeout=require(_0xb508('0x2'));var express=require(_0xb508('0x3'));var router=express[_0xb508('0x4')]();var auth=require(_0xb508('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb508('0x6'));var controller=require(_0xb508('0x7'));router[_0xb508('0x8')]('/',auth[_0xb508('0x9')](),controller[_0xb508('0xa')]);router[_0xb508('0x8')](_0xb508('0xb'),auth[_0xb508('0x9')](),controller['describe']);router['get'](_0xb508('0xc'),auth[_0xb508('0xd')](),controller[_0xb508('0xe')]);router[_0xb508('0x8')](_0xb508('0xf'),auth[_0xb508('0xd')](),controller[_0xb508('0x10')]);router[_0xb508('0x8')](_0xb508('0x11'),auth['isAuthenticated'](),controller[_0xb508('0x12')]);router['get'](_0xb508('0x13'),auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router['get'](_0xb508('0x14'),auth[_0xb508('0x9')](),controller[_0xb508('0x15')]);router[_0xb508('0x16')]('/',auth[_0xb508('0x9')](),controller[_0xb508('0x17')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4b86b1,_0x289738,_0x43e3f1){_0x43e3f1(null,path[_0xb508('0x18')](config['root'],_0xb508('0x19')));},'filename':function(_0x382f04,_0x1e898f,_0x4a4b73){_0x4a4b73(null,util['format'](_0xb508('0x1a'),Date[_0xb508('0x1b')](),_0x1e898f[_0xb508('0x1c')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xb508('0x16')]('/:id/attachment_upload',upload['single'](_0xb508('0x1d')),controller[_0xb508('0x1e')]);router[_0xb508('0x16')](_0xb508('0x11'),auth[_0xb508('0xd')](),controller[_0xb508('0x1f')]);router[_0xb508('0x16')]('/:id/tags',auth[_0xb508('0x9')](),interaction[_0xb508('0x20')](_0xb508('0x21'),_0xb508('0x22')),controller[_0xb508('0x23')]);router[_0xb508('0x24')](_0xb508('0xc'),auth[_0xb508('0x9')](),interaction['tracked'](_0xb508('0x21'),'chatinteraction:update'),controller['update']);router[_0xb508('0x24')](_0xb508('0x25'),controller[_0xb508('0x26')]);router[_0xb508('0x24')]('/:id/abandon',auth[_0xb508('0xd')](),controller[_0xb508('0x27')]);router[_0xb508('0x24')](_0xb508('0x28'),controller['close']);router[_0xb508('0x29')](_0xb508('0xc'),auth['isAuthenticated'](),interaction[_0xb508('0x20')]('chat',_0xb508('0x2a')),controller[_0xb508('0x2b')]);router[_0xb508('0x29')](_0xb508('0x2c'),auth['isAuthenticated'](),controller[_0xb508('0x2d')]);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 f82b3b9..0691778 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 _0x2ef3=['sequelize','exports','TEXT','medium','BOOLEAN','INTEGER'];(function(_0x55bc0d,_0x3273cd){var _0x2f73f9=function(_0xd13639){while(--_0xd13639){_0x55bc0d['push'](_0x55bc0d['shift']());}};_0x2f73f9(++_0x3273cd);}(_0x2ef3,0xba));var _0x32ef=function(_0x4ef9c5,_0x130ff2){_0x4ef9c5=_0x4ef9c5-0x0;var _0x493264=_0x2ef3[_0x4ef9c5];return _0x493264;};'use strict';var Sequelize=require(_0x32ef('0x0'));module[_0x32ef('0x1')]={'body':{'type':Sequelize[_0x32ef('0x2')](_0x32ef('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x32ef('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x32ef('0x5')]}}; \ No newline at end of file +var _0x57ca=['exports','TEXT','BOOLEAN','INTEGER'];(function(_0x26b3f5,_0x50b577){var _0x4bab57=function(_0x2d9926){while(--_0x2d9926){_0x26b3f5['push'](_0x26b3f5['shift']());}};_0x4bab57(++_0x50b577);}(_0x57ca,0x108));var _0xa57c=function(_0x215d67,_0x30e253){_0x215d67=_0x215d67-0x0;var _0x5af104=_0x57ca[_0x215d67];return _0x5af104;};'use strict';var Sequelize=require('sequelize');module[_0xa57c('0x0')]={'body':{'type':Sequelize[_0xa57c('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xa57c('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xa57c('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index aa53139..438979c 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 _0x904f=['body','describe','messages','lastMessageAt','lastMessage','format','User','agent','admin','user','role','userpic','online','lastLoginAt','allowmessenger','-online','VoiceQueue','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','./chatInternalMessage.socket','register','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','attributes','intersection','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','keys','fields','length','find','create'];(function(_0x28aee8,_0x317fd1){var _0x337b2d=function(_0x3b9371){while(--_0x3b9371){_0x28aee8['push'](_0x28aee8['shift']());}};_0x337b2d(++_0x317fd1);}(_0x904f,0xfe));var _0xf904=function(_0x195553,_0x2f49da){_0x195553=_0x195553-0x0;var _0x2259e3=_0x904f[_0x195553];return _0x2259e3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf904('0x0'));var rimraf=require(_0xf904('0x1'));var zipdir=require(_0xf904('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf904('0x3'));var moment=require(_0xf904('0x4'));var BPromise=require(_0xf904('0x5'));var Mustache=require(_0xf904('0x6'));var util=require(_0xf904('0x7'));var path=require(_0xf904('0x8'));var sox=require('sox');var csv=require(_0xf904('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf904('0xa'));var squel=require(_0xf904('0xb'));var crypto=require('crypto');var jsforce=require(_0xf904('0xc'));var deskjs=require(_0xf904('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf904('0xe'));var Redis=require(_0xf904('0xf'));var authService=require(_0xf904('0x10'));var qs=require(_0xf904('0x11'));var as=require(_0xf904('0x12'));var hardwareService=require(_0xf904('0x13'));var logger=require(_0xf904('0x14'))(_0xf904('0x15'));var utils=require(_0xf904('0x16'));var config=require(_0xf904('0x17'));var db=require(_0xf904('0x18'))['db'];config[_0xf904('0x19')]=_['defaults'](config[_0xf904('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf904('0x19')]));require(_0xf904('0x1a'))[_0xf904('0x1b')](socket);function respondWithStatusCode(_0xde5871,_0x4eb5d1){_0x4eb5d1=_0x4eb5d1||0xcc;return function(_0x1d24e6){if(_0x1d24e6){return _0xde5871[_0xf904('0x1c')](_0x4eb5d1);}return _0xde5871[_0xf904('0x1d')](_0x4eb5d1)[_0xf904('0x1e')]();};}function respondWithResult(_0x5f10d9,_0x3dd106){_0x3dd106=_0x3dd106||0xc8;return function(_0x220982){if(_0x220982){return _0x5f10d9[_0xf904('0x1d')](_0x3dd106)[_0xf904('0x1f')](_0x220982);}};}function respondWithFilteredResult(_0x4dc25d,_0x2fa333){return function(_0x5ee42e){if(_0x5ee42e){var _0x2e33f5=_0x5ee42e[_0xf904('0x20')],_0x472196=_0x2fa333[_0xf904('0x21')],_0x4599a5=_0x2fa333[_0xf904('0x21')]+_0x2fa333[_0xf904('0x22')],_0x5e5593;if(_0x4599a5>=_0x2e33f5){_0x4599a5=_0x2e33f5;_0x5e5593=0xc8;}else{_0x5e5593=0xce;}_0x4dc25d[_0xf904('0x1d')](_0x5e5593);return _0x4dc25d[_0xf904('0x23')]('Content-Range',_0x472196+'-'+_0x4599a5+'/'+_0x2e33f5)[_0xf904('0x1f')](_0x5ee42e);}return null;};}function patchUpdates(_0x4e09d0){return function(_0x1192dd){try{jsonpatch[_0xf904('0x24')](_0x1192dd,_0x4e09d0,!![]);}catch(_0x3977fd){return BPromise[_0xf904('0x25')](_0x3977fd);}return _0x1192dd[_0xf904('0x26')]();};}function saveUpdates(_0x1e9307,_0xa2d3a2){return function(_0x55f1c8){if(_0x55f1c8){return _0x55f1c8[_0xf904('0x27')](_0x1e9307)['then'](function(_0x52ef11){return _0x52ef11;});}return null;};}function removeEntity(_0x5756e4,_0x1bcda4){return function(_0xb56565){if(_0xb56565){return _0xb56565[_0xf904('0x28')]()[_0xf904('0x29')](function(){_0x5756e4[_0xf904('0x1d')](0xcc)[_0xf904('0x1e')]();});}};}function handleEntityNotFound(_0x1f4c0c,_0x3bbc35){return function(_0x55615e){if(!_0x55615e){_0x1f4c0c['sendStatus'](0x194);}return _0x55615e;};}function handleError(_0x3de453,_0x2fc9fd){_0x2fc9fd=_0x2fc9fd||0x1f4;return function(_0x413f12){logger[_0xf904('0x2a')](_0x413f12[_0xf904('0x2b')]);if(_0x413f12[_0xf904('0x2c')]){delete _0x413f12['name'];}_0x3de453[_0xf904('0x1d')](_0x2fc9fd)[_0xf904('0x2d')](_0x413f12);};}exports[_0xf904('0x2e')]=function(_0xae3aef,_0x1e9125){var _0x5f0c64={},_0x935a95={},_0xbfe297={'count':0x0,'rows':[]};var _0x3063fb=_[_0xf904('0x2f')](db[_0xf904('0x30')][_0xf904('0x31')],function(_0x174b37){return{'name':_0x174b37[_0xf904('0x32')],'type':_0x174b37[_0xf904('0x33')][_0xf904('0x34')]};});_0x935a95[_0xf904('0x35')]=_[_0xf904('0x2f')](_0x3063fb,'name');_0x935a95[_0xf904('0x36')]=_['keys'](_0xae3aef[_0xf904('0x36')]);_0x935a95['filters']=_['intersection'](_0x935a95['model'],_0x935a95[_0xf904('0x36')]);_0x5f0c64[_0xf904('0x37')]=_[_0xf904('0x38')](_0x935a95['model'],qs['fields'](_0xae3aef[_0xf904('0x36')]['fields']));_0x5f0c64['attributes']=_0x5f0c64[_0xf904('0x37')]['length']?_0x5f0c64[_0xf904('0x37')]:_0x935a95[_0xf904('0x35')];if(!_0xae3aef[_0xf904('0x36')][_0xf904('0x39')](_0xf904('0x3a'))){_0x5f0c64[_0xf904('0x22')]=qs[_0xf904('0x22')](_0xae3aef[_0xf904('0x36')][_0xf904('0x22')]);_0x5f0c64[_0xf904('0x21')]=qs[_0xf904('0x21')](_0xae3aef[_0xf904('0x36')]['offset']);}_0x5f0c64[_0xf904('0x3b')]=qs[_0xf904('0x3c')](_0xae3aef[_0xf904('0x36')][_0xf904('0x3c')]);_0x5f0c64['where']=qs[_0xf904('0x3d')](_[_0xf904('0x3e')](_0xae3aef[_0xf904('0x36')],_0x935a95[_0xf904('0x3d')]));if(_0xae3aef[_0xf904('0x36')][_0xf904('0x3f')]){_0x5f0c64[_0xf904('0x40')]=_['merge'](_0x5f0c64[_0xf904('0x40')],{'$or':_['map'](_0x3063fb,function(_0x3fb590){if(_0x3fb590[_0xf904('0x33')]!==_0xf904('0x41')){var _0x339441={};_0x339441[_0x3fb590[_0xf904('0x2c')]]={'$like':'%'+_0xae3aef[_0xf904('0x36')][_0xf904('0x3f')]+'%'};return _0x339441;}})});}_0x5f0c64=_[_0xf904('0x42')]({},_0x5f0c64,_0xae3aef[_0xf904('0x43')]);var _0x54f236={'where':_0x5f0c64[_0xf904('0x40')]};return db[_0xf904('0x30')][_0xf904('0x20')](_0x54f236)[_0xf904('0x29')](function(_0xa11286){_0xbfe297[_0xf904('0x20')]=_0xa11286;if(_0xae3aef['query'][_0xf904('0x44')]){_0x5f0c64[_0xf904('0x45')]=[{'all':!![]}];}return db[_0xf904('0x30')][_0xf904('0x46')](_0x5f0c64);})[_0xf904('0x29')](function(_0x27346c){_0xbfe297[_0xf904('0x47')]=_0x27346c;return _0xbfe297;})[_0xf904('0x29')](respondWithFilteredResult(_0x1e9125,_0x5f0c64))[_0xf904('0x48')](handleError(_0x1e9125,null));};exports['show']=function(_0x1b9ede,_0x39f5fc){var _0x3b111c={'raw':!![],'where':{'id':_0x1b9ede[_0xf904('0x49')]['id']}},_0x3f43c1={};_0x3f43c1[_0xf904('0x35')]=_['keys'](db['ChatInternalMessage'][_0xf904('0x31')]);_0x3f43c1[_0xf904('0x36')]=_[_0xf904('0x4a')](_0x1b9ede[_0xf904('0x36')]);_0x3f43c1['filters']=_[_0xf904('0x38')](_0x3f43c1['model'],_0x3f43c1[_0xf904('0x36')]);_0x3b111c[_0xf904('0x37')]=_['intersection'](_0x3f43c1[_0xf904('0x35')],qs[_0xf904('0x4b')](_0x1b9ede['query'][_0xf904('0x4b')]));_0x3b111c[_0xf904('0x37')]=_0x3b111c[_0xf904('0x37')][_0xf904('0x4c')]?_0x3b111c['attributes']:_0x3f43c1[_0xf904('0x35')];if(_0x1b9ede['query']['includeAll']){_0x3b111c['include']=[{'all':!![]}];}_0x3b111c=_[_0xf904('0x42')]({},_0x3b111c,_0x1b9ede['options']);return db[_0xf904('0x30')][_0xf904('0x4d')](_0x3b111c)[_0xf904('0x29')](handleEntityNotFound(_0x39f5fc,null))['then'](respondWithResult(_0x39f5fc,null))[_0xf904('0x48')](handleError(_0x39f5fc,null));};exports[_0xf904('0x4e')]=function(_0x21c675,_0x200ff4){return db[_0xf904('0x30')][_0xf904('0x4e')](_0x21c675[_0xf904('0x4f')],{})[_0xf904('0x29')](respondWithResult(_0x200ff4,0xc9))[_0xf904('0x48')](handleError(_0x200ff4,null));};exports[_0xf904('0x27')]=function(_0x47e390,_0x51a1a3){if(_0x47e390['body']['id']){delete _0x47e390[_0xf904('0x4f')]['id'];}return db[_0xf904('0x30')][_0xf904('0x4d')]({'where':{'id':_0x47e390[_0xf904('0x49')]['id']}})[_0xf904('0x29')](handleEntityNotFound(_0x51a1a3,null))[_0xf904('0x29')](saveUpdates(_0x47e390[_0xf904('0x4f')],null))['then'](respondWithResult(_0x51a1a3,null))[_0xf904('0x48')](handleError(_0x51a1a3,null));};exports[_0xf904('0x28')]=function(_0x49b521,_0x3020aa){return db['ChatInternalMessage']['find']({'where':{'id':_0x49b521['params']['id']}})[_0xf904('0x29')](handleEntityNotFound(_0x3020aa,null))['then'](removeEntity(_0x3020aa,null))[_0xf904('0x48')](handleError(_0x3020aa,null));};exports[_0xf904('0x50')]=function(_0x3f08da,_0x2f77d8){return db[_0xf904('0x30')]['describe']()[_0xf904('0x29')](respondWithResult(_0x2f77d8,null))[_0xf904('0x48')](handleError(_0x2f77d8,null));};function wrapUser(_0x49691c){return function(_0x192da4){var _0x7f8838=_0x49691c['get']({'plain':!![]});_0x7f8838[_0xf904('0x51')]=[];if(_0x192da4){_0x7f8838[_0xf904('0x52')]=_0x192da4['createdAt'];_0x7f8838[_0xf904('0x53')]=_0x192da4;}else{_0x7f8838['lastMessageAt']=moment(0x0)[_0xf904('0x54')]('YYYY-MM-DD\x20HH:mm:ss');_0x7f8838[_0xf904('0x53')]={};}return _0x7f8838;};}exports['getUsers']=function(_0x29a299,_0x4d48db,_0xb0ba98){var _0xd60c22=[];return db[_0xf904('0x55')][_0xf904('0x46')]({'where':{'role':[_0xf904('0x56'),_0xf904('0x57'),_0xf904('0x58')]},'attributes':['id','fullname',_0xf904('0x2c'),_0xf904('0x59'),_0xf904('0x5a'),'internal',_0xf904('0x5b'),_0xf904('0x5c'),_0xf904('0x5d'),'showWebBar'],'order':qs[_0xf904('0x3c')](_0xf904('0x5e')),'include':[{'model':db[_0xf904('0x5f')],'as':_0xf904('0x60'),'attributes':['id',_0xf904('0x2c'),_0xf904('0x33')],'through':{'attributes':[]}}]})['then'](function(_0x56f1dd){if(_0x56f1dd){var _0x21a64e=_0x29a299[_0xf904('0x58')][_0xf904('0x61')]({'plain':!![]});if(!_0x21a64e)throw new Error(_0xf904('0x62'));if(_0x21a64e[_0xf904('0x59')]===_0xf904('0x58')){return db[_0xf904('0x63')][_0xf904('0x4d')]({'where':{'name':'Agents','userProfileId':_0x21a64e[_0xf904('0x64')]},'raw':!![]})[_0xf904('0x29')](function(_0x4edccc){if(_0x4edccc){if(_0x4edccc[_0xf904('0x65')]===0x0){return db[_0xf904('0x66')][_0xf904('0x46')]({'where':{'sectionId':_0x4edccc['id']},'raw':!![]})[_0xf904('0x29')](function(_0x32ae2e){var _0xf03dc1=[];if(_[_0xf904('0x67')](_0x32ae2e)){_0xf03dc1=_['filter'](_0x56f1dd,function(_0x579f4a){if(_0x579f4a[_0xf904('0x59')]!==_0xf904('0x56')){return _0x579f4a;}});return _0xf03dc1;}else{for(var _0x42842b=0x0;_0x42842b<_0x56f1dd[_0xf904('0x4c')];_0x42842b++){var _0x441518=_0x56f1dd[_0x42842b];if(_0x441518['role']==='agent'){var _0x24f4a0=_[_0xf904('0x4d')](_0x32ae2e,function(_0x3da0c2){return _0x3da0c2[_0xf904('0x68')]===_0x441518['id'];});if(_0x24f4a0)_0xf03dc1[_0xf904('0x69')](_0x441518);}else{_0xf03dc1[_0xf904('0x69')](_0x441518);}}return _0xf03dc1;}});}else{return _0x56f1dd;}}else{var _0xa6cb30=_[_0xf904('0x3f')](_0x56f1dd,function(_0x4d8d0c){if(_0x4d8d0c['role']!==_0xf904('0x56')){return _0x4d8d0c;}});return _0xa6cb30;}});}else{return _0x56f1dd;}}})['then'](function(_0x515ef2){var _0x26b51a=[];if(_0x515ef2){_0xd60c22=_0x515ef2;for(var _0x59ad94=0x0;_0x59ad94<_0x515ef2[_0xf904('0x4c')];_0x59ad94+=0x1){_0xd60c22[_0x59ad94][_0xf904('0x51')]=[];_0x26b51a[_0xf904('0x69')](db['ChatInternalMessage'][_0xf904('0x4d')]({'where':{'FromId':[_0x29a299[_0xf904('0x58')]['id'],_0x515ef2[_0x59ad94]['id']],'ToId':[_0x29a299['user']['id'],_0x515ef2[_0x59ad94]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0xf904('0x6a'),_0xf904('0x6b'),_0xf904('0x6c'),_0xf904('0x4f')],'order':qs[_0xf904('0x3c')](_0xf904('0x6d')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x515ef2[_0x59ad94])));}return BPromise[_0xf904('0x6e')](_0x26b51a);}return[];})[_0xf904('0x29')](function(_0x12f3d7){return{'rows':_0x12f3d7,'count':_0x12f3d7[_0xf904('0x4c')]};})['then'](respondWithResult(_0x4d48db,null))[_0xf904('0x48')](handleError(_0x4d48db,null));}; \ No newline at end of file +var _0xd7e4=['save','then','name','send','index','map','ChatInternalMessage','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','count','include','findAll','rows','show','params','rawAttributes','includeAll','options','find','catch','create','body','destroy','get','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','agent','admin','user','role','userpic','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','messages','createdAt','FromId','ToId','-createdAt','all','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','redis','socket.io-emitter','register','sendStatus','status','end','offset','limit','set','Content-Range','reject'];(function(_0x5b34c0,_0x3ad403){var _0x242bd3=function(_0x51d0ce){while(--_0x51d0ce){_0x5b34c0['push'](_0x5b34c0['shift']());}};_0x242bd3(++_0x3ad403);}(_0xd7e4,0xac));var _0x4d7e=function(_0x8bb855,_0x54e4c3){_0x8bb855=_0x8bb855-0x0;var _0x238faf=_0xd7e4[_0x8bb855];return _0x238faf;};'use strict';var pdf=require(_0x4d7e('0x0'));var emlformat=require(_0x4d7e('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4d7e('0x2'));var rp=require(_0x4d7e('0x3'));var moment=require(_0x4d7e('0x4'));var BPromise=require(_0x4d7e('0x5'));var Mustache=require(_0x4d7e('0x6'));var util=require(_0x4d7e('0x7'));var path=require(_0x4d7e('0x8'));var sox=require(_0x4d7e('0x9'));var csv=require('to-csv');var ejs=require(_0x4d7e('0xa'));var fs=require('fs');var _=require(_0x4d7e('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4d7e('0xc'));var toCsv=require(_0x4d7e('0xd'));var querystring=require(_0x4d7e('0xe'));var Papa=require('papaparse');var Redis=require(_0x4d7e('0xf'));var authService=require(_0x4d7e('0x10'));var qs=require(_0x4d7e('0x11'));var as=require(_0x4d7e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4d7e('0x13'))(_0x4d7e('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x4d7e('0x15')]=_['defaults'](config[_0x4d7e('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x4d7e('0x16'))(new Redis(config[_0x4d7e('0x15')]));require('./chatInternalMessage.socket')[_0x4d7e('0x17')](socket);function respondWithStatusCode(_0x4ccf77,_0x19379b){_0x19379b=_0x19379b||0xcc;return function(_0x5e3102){if(_0x5e3102){return _0x4ccf77[_0x4d7e('0x18')](_0x19379b);}return _0x4ccf77[_0x4d7e('0x19')](_0x19379b)[_0x4d7e('0x1a')]();};}function respondWithResult(_0x4e164a,_0x83e3e0){_0x83e3e0=_0x83e3e0||0xc8;return function(_0x163f1b){if(_0x163f1b){return _0x4e164a[_0x4d7e('0x19')](_0x83e3e0)['json'](_0x163f1b);}};}function respondWithFilteredResult(_0xf6cd81,_0x448a4e){return function(_0x56109c){if(_0x56109c){var _0x4bc988=_0x56109c['count'],_0x3112b1=_0x448a4e[_0x4d7e('0x1b')],_0x50a9e5=_0x448a4e[_0x4d7e('0x1b')]+_0x448a4e[_0x4d7e('0x1c')],_0x5bb1a0;if(_0x50a9e5>=_0x4bc988){_0x50a9e5=_0x4bc988;_0x5bb1a0=0xc8;}else{_0x5bb1a0=0xce;}_0xf6cd81['status'](_0x5bb1a0);return _0xf6cd81[_0x4d7e('0x1d')](_0x4d7e('0x1e'),_0x3112b1+'-'+_0x50a9e5+'/'+_0x4bc988)['json'](_0x56109c);}return null;};}function patchUpdates(_0x28cfd5){return function(_0x254898){try{jsonpatch['apply'](_0x254898,_0x28cfd5,!![]);}catch(_0x36ad0e){return BPromise[_0x4d7e('0x1f')](_0x36ad0e);}return _0x254898[_0x4d7e('0x20')]();};}function saveUpdates(_0x4618f3,_0x3f3956){return function(_0x349665){if(_0x349665){return _0x349665['update'](_0x4618f3)[_0x4d7e('0x21')](function(_0x1ded22){return _0x1ded22;});}return null;};}function removeEntity(_0x4c3f1a,_0x2e580b){return function(_0x438840){if(_0x438840){return _0x438840['destroy']()[_0x4d7e('0x21')](function(){_0x4c3f1a[_0x4d7e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x75cb0,_0x415635){return function(_0x4508c5){if(!_0x4508c5){_0x75cb0['sendStatus'](0x194);}return _0x4508c5;};}function handleError(_0x3491ab,_0x2086a3){_0x2086a3=_0x2086a3||0x1f4;return function(_0x5abc1c){logger['error'](_0x5abc1c['stack']);if(_0x5abc1c[_0x4d7e('0x22')]){delete _0x5abc1c[_0x4d7e('0x22')];}_0x3491ab[_0x4d7e('0x19')](_0x2086a3)[_0x4d7e('0x23')](_0x5abc1c);};}exports[_0x4d7e('0x24')]=function(_0x38eabc,_0x3a722){var _0x2fe7cd={},_0x44ecf1={},_0x3ac0dc={'count':0x0,'rows':[]};var _0x5c8b01=_[_0x4d7e('0x25')](db[_0x4d7e('0x26')]['rawAttributes'],function(_0x4ad38f){return{'name':_0x4ad38f[_0x4d7e('0x27')],'type':_0x4ad38f[_0x4d7e('0x28')][_0x4d7e('0x29')]};});_0x44ecf1[_0x4d7e('0x2a')]=_['map'](_0x5c8b01,'name');_0x44ecf1[_0x4d7e('0x2b')]=_[_0x4d7e('0x2c')](_0x38eabc[_0x4d7e('0x2b')]);_0x44ecf1[_0x4d7e('0x2d')]=_[_0x4d7e('0x2e')](_0x44ecf1[_0x4d7e('0x2a')],_0x44ecf1[_0x4d7e('0x2b')]);_0x2fe7cd[_0x4d7e('0x2f')]=_[_0x4d7e('0x2e')](_0x44ecf1[_0x4d7e('0x2a')],qs['fields'](_0x38eabc['query'][_0x4d7e('0x30')]));_0x2fe7cd[_0x4d7e('0x2f')]=_0x2fe7cd['attributes'][_0x4d7e('0x31')]?_0x2fe7cd[_0x4d7e('0x2f')]:_0x44ecf1['model'];if(!_0x38eabc[_0x4d7e('0x2b')][_0x4d7e('0x32')](_0x4d7e('0x33'))){_0x2fe7cd[_0x4d7e('0x1c')]=qs[_0x4d7e('0x1c')](_0x38eabc[_0x4d7e('0x2b')][_0x4d7e('0x1c')]);_0x2fe7cd[_0x4d7e('0x1b')]=qs[_0x4d7e('0x1b')](_0x38eabc['query'][_0x4d7e('0x1b')]);}_0x2fe7cd['order']=qs[_0x4d7e('0x34')](_0x38eabc[_0x4d7e('0x2b')][_0x4d7e('0x34')]);_0x2fe7cd[_0x4d7e('0x35')]=qs[_0x4d7e('0x2d')](_['pick'](_0x38eabc[_0x4d7e('0x2b')],_0x44ecf1[_0x4d7e('0x2d')]));if(_0x38eabc['query'][_0x4d7e('0x36')]){_0x2fe7cd[_0x4d7e('0x35')]=_[_0x4d7e('0x37')](_0x2fe7cd[_0x4d7e('0x35')],{'$or':_[_0x4d7e('0x25')](_0x5c8b01,function(_0x2df0d9){if(_0x2df0d9[_0x4d7e('0x28')]!=='VIRTUAL'){var _0x243342={};_0x243342[_0x2df0d9[_0x4d7e('0x22')]]={'$like':'%'+_0x38eabc['query'][_0x4d7e('0x36')]+'%'};return _0x243342;}})});}_0x2fe7cd=_[_0x4d7e('0x37')]({},_0x2fe7cd,_0x38eabc['options']);var _0x2625ec={'where':_0x2fe7cd[_0x4d7e('0x35')]};return db[_0x4d7e('0x26')]['count'](_0x2625ec)[_0x4d7e('0x21')](function(_0x5c395f){_0x3ac0dc[_0x4d7e('0x38')]=_0x5c395f;if(_0x38eabc[_0x4d7e('0x2b')]['includeAll']){_0x2fe7cd[_0x4d7e('0x39')]=[{'all':!![]}];}return db[_0x4d7e('0x26')][_0x4d7e('0x3a')](_0x2fe7cd);})[_0x4d7e('0x21')](function(_0x240937){_0x3ac0dc[_0x4d7e('0x3b')]=_0x240937;return _0x3ac0dc;})[_0x4d7e('0x21')](respondWithFilteredResult(_0x3a722,_0x2fe7cd))['catch'](handleError(_0x3a722,null));};exports[_0x4d7e('0x3c')]=function(_0x239b92,_0x9819eb){var _0x931cca={'raw':!![],'where':{'id':_0x239b92[_0x4d7e('0x3d')]['id']}},_0x376cd0={};_0x376cd0[_0x4d7e('0x2a')]=_[_0x4d7e('0x2c')](db[_0x4d7e('0x26')][_0x4d7e('0x3e')]);_0x376cd0['query']=_[_0x4d7e('0x2c')](_0x239b92['query']);_0x376cd0[_0x4d7e('0x2d')]=_[_0x4d7e('0x2e')](_0x376cd0[_0x4d7e('0x2a')],_0x376cd0[_0x4d7e('0x2b')]);_0x931cca[_0x4d7e('0x2f')]=_[_0x4d7e('0x2e')](_0x376cd0['model'],qs['fields'](_0x239b92[_0x4d7e('0x2b')]['fields']));_0x931cca[_0x4d7e('0x2f')]=_0x931cca[_0x4d7e('0x2f')][_0x4d7e('0x31')]?_0x931cca[_0x4d7e('0x2f')]:_0x376cd0[_0x4d7e('0x2a')];if(_0x239b92['query'][_0x4d7e('0x3f')]){_0x931cca[_0x4d7e('0x39')]=[{'all':!![]}];}_0x931cca=_[_0x4d7e('0x37')]({},_0x931cca,_0x239b92[_0x4d7e('0x40')]);return db[_0x4d7e('0x26')][_0x4d7e('0x41')](_0x931cca)[_0x4d7e('0x21')](handleEntityNotFound(_0x9819eb,null))[_0x4d7e('0x21')](respondWithResult(_0x9819eb,null))[_0x4d7e('0x42')](handleError(_0x9819eb,null));};exports[_0x4d7e('0x43')]=function(_0x15cb71,_0xec8c84){return db['ChatInternalMessage'][_0x4d7e('0x43')](_0x15cb71[_0x4d7e('0x44')],{})['then'](respondWithResult(_0xec8c84,0xc9))[_0x4d7e('0x42')](handleError(_0xec8c84,null));};exports['update']=function(_0x595f7f,_0x3d479c){if(_0x595f7f[_0x4d7e('0x44')]['id']){delete _0x595f7f['body']['id'];}return db[_0x4d7e('0x26')][_0x4d7e('0x41')]({'where':{'id':_0x595f7f[_0x4d7e('0x3d')]['id']}})[_0x4d7e('0x21')](handleEntityNotFound(_0x3d479c,null))[_0x4d7e('0x21')](saveUpdates(_0x595f7f[_0x4d7e('0x44')],null))[_0x4d7e('0x21')](respondWithResult(_0x3d479c,null))[_0x4d7e('0x42')](handleError(_0x3d479c,null));};exports[_0x4d7e('0x45')]=function(_0x42b14a,_0x177269){return db['ChatInternalMessage'][_0x4d7e('0x41')]({'where':{'id':_0x42b14a[_0x4d7e('0x3d')]['id']}})[_0x4d7e('0x21')](handleEntityNotFound(_0x177269,null))[_0x4d7e('0x21')](removeEntity(_0x177269,null))['catch'](handleError(_0x177269,null));};exports['describe']=function(_0x1c71b6,_0x2a5c21){return db[_0x4d7e('0x26')]['describe']()['then'](respondWithResult(_0x2a5c21,null))['catch'](handleError(_0x2a5c21,null));};function wrapUser(_0x3d8876){return function(_0x485e56){var _0x3efff6=_0x3d8876[_0x4d7e('0x46')]({'plain':!![]});_0x3efff6['messages']=[];if(_0x485e56){_0x3efff6[_0x4d7e('0x47')]=_0x485e56['createdAt'];_0x3efff6['lastMessage']=_0x485e56;}else{_0x3efff6[_0x4d7e('0x47')]=moment(0x0)[_0x4d7e('0x48')](_0x4d7e('0x49'));_0x3efff6[_0x4d7e('0x4a')]={};}return _0x3efff6;};}exports[_0x4d7e('0x4b')]=function(_0x3e4011,_0x972e25,_0x2b8095){var _0x4b38c7=[];return db['User'][_0x4d7e('0x3a')]({'where':{'role':[_0x4d7e('0x4c'),_0x4d7e('0x4d'),_0x4d7e('0x4e')]},'attributes':['id','fullname',_0x4d7e('0x22'),_0x4d7e('0x4f'),_0x4d7e('0x50'),'internal',_0x4d7e('0x51'),_0x4d7e('0x52'),_0x4d7e('0x53'),_0x4d7e('0x54')],'order':qs[_0x4d7e('0x34')](_0x4d7e('0x55')),'include':[{'model':db[_0x4d7e('0x56')],'as':'VoiceQueues','attributes':['id',_0x4d7e('0x22'),_0x4d7e('0x28')],'through':{'attributes':[]}}]})[_0x4d7e('0x21')](function(_0x3bb2f0){if(_0x3bb2f0){var _0x3244d1=_0x3e4011['user'][_0x4d7e('0x46')]({'plain':!![]});if(!_0x3244d1)throw new Error(_0x4d7e('0x57'));if(_0x3244d1[_0x4d7e('0x4f')]==='user'){return db[_0x4d7e('0x58')][_0x4d7e('0x41')]({'where':{'name':_0x4d7e('0x59'),'userProfileId':_0x3244d1[_0x4d7e('0x5a')]},'raw':!![]})['then'](function(_0x3e0cb4){if(_0x3e0cb4){if(_0x3e0cb4[_0x4d7e('0x5b')]===0x0){return db[_0x4d7e('0x5c')][_0x4d7e('0x3a')]({'where':{'sectionId':_0x3e0cb4['id']},'raw':!![]})[_0x4d7e('0x21')](function(_0x346dc2){var _0x17e186=[];if(_[_0x4d7e('0x5d')](_0x346dc2)){_0x17e186=_[_0x4d7e('0x36')](_0x3bb2f0,function(_0x3bbf9a){if(_0x3bbf9a[_0x4d7e('0x4f')]!==_0x4d7e('0x4c')){return _0x3bbf9a;}});return _0x17e186;}else{for(var _0xeb6ee0=0x0;_0xeb6ee0<_0x3bb2f0[_0x4d7e('0x31')];_0xeb6ee0++){var _0x7ee11=_0x3bb2f0[_0xeb6ee0];if(_0x7ee11[_0x4d7e('0x4f')]===_0x4d7e('0x4c')){var _0x5532c7=_[_0x4d7e('0x41')](_0x346dc2,function(_0x2e03c2){return _0x2e03c2[_0x4d7e('0x5e')]===_0x7ee11['id'];});if(_0x5532c7)_0x17e186[_0x4d7e('0x5f')](_0x7ee11);}else{_0x17e186[_0x4d7e('0x5f')](_0x7ee11);}}return _0x17e186;}});}else{return _0x3bb2f0;}}else{var _0x564599=_[_0x4d7e('0x36')](_0x3bb2f0,function(_0x5d5272){if(_0x5d5272[_0x4d7e('0x4f')]!==_0x4d7e('0x4c')){return _0x5d5272;}});return _0x564599;}});}else{return _0x3bb2f0;}}})[_0x4d7e('0x21')](function(_0x33f2c6){var _0x3de8fa=[];if(_0x33f2c6){_0x4b38c7=_0x33f2c6;for(var _0x3e8f3c=0x0;_0x3e8f3c<_0x33f2c6[_0x4d7e('0x31')];_0x3e8f3c+=0x1){_0x4b38c7[_0x3e8f3c][_0x4d7e('0x60')]=[];_0x3de8fa[_0x4d7e('0x5f')](db['ChatInternalMessage'][_0x4d7e('0x41')]({'where':{'FromId':[_0x3e4011[_0x4d7e('0x4e')]['id'],_0x33f2c6[_0x3e8f3c]['id']],'ToId':[_0x3e4011[_0x4d7e('0x4e')]['id'],_0x33f2c6[_0x3e8f3c]['id']],'ChatGroupId':null},'attributes':['id',_0x4d7e('0x61'),_0x4d7e('0x62'),_0x4d7e('0x63'),'read',_0x4d7e('0x44')],'order':qs[_0x4d7e('0x34')](_0x4d7e('0x64')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x4d7e('0x21')](wrapUser(_0x33f2c6[_0x3e8f3c])));}return BPromise[_0x4d7e('0x65')](_0x3de8fa);}return[];})[_0x4d7e('0x21')](function(_0x551aa0){return{'rows':_0x551aa0,'count':_0x551aa0['length']};})[_0x4d7e('0x21')](respondWithResult(_0x972e25,null))['catch'](handleError(_0x972e25,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 9c562a8..37cac34 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 _0xac3d=['emit','hook','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x2a94d8,_0x47d4fe){var _0xe1f74d=function(_0x1c5735){while(--_0x1c5735){_0x2a94d8['push'](_0x2a94d8['shift']());}};_0xe1f74d(++_0x47d4fe);}(_0xac3d,0x92));var _0xdac3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xac3d[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xdac3('0x0'));var ChatInternalMessage=require(_0xdac3('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xdac3('0x2')](0x0);var events={'afterCreate':_0xdac3('0x3'),'afterUpdate':_0xdac3('0x4'),'afterDestroy':_0xdac3('0x5')};function emitEvent(_0x13f3b1){return function(_0x3ba5ab,_0x8dbbda,_0x1293ff){ChatInternalMessageEvents['emit'](_0x13f3b1+':'+_0x3ba5ab['id'],_0x3ba5ab);ChatInternalMessageEvents[_0xdac3('0x6')](_0x13f3b1,_0x3ba5ab);_0x1293ff(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0xdac3('0x7')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0x4989=['exports','events','setMaxListeners','save','update','remove','emit','hook'];(function(_0x40e5d9,_0x36f0ce){var _0x4c395d=function(_0x113725){while(--_0x113725){_0x40e5d9['push'](_0x40e5d9['shift']());}};_0x4c395d(++_0x36f0ce);}(_0x4989,0x79));var _0x9498=function(_0x30f87a,_0x2cce5a){_0x30f87a=_0x30f87a-0x0;var _0x3a8efc=_0x4989[_0x30f87a];return _0x3a8efc;};'use strict';var EventEmitter=require(_0x9498('0x0'));var ChatInternalMessage=require('../../mysqldb')['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x9498('0x1')](0x0);var events={'afterCreate':_0x9498('0x2'),'afterUpdate':_0x9498('0x3'),'afterDestroy':_0x9498('0x4')};function emitEvent(_0x5953c0){return function(_0x55fabb,_0x84ed1b,_0x47922b){ChatInternalMessageEvents[_0x9498('0x5')](_0x5953c0+':'+_0x55fabb['id'],_0x55fabb);ChatInternalMessageEvents[_0x9498('0x5')](_0x5953c0,_0x55fabb);_0x47922b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x9498('0x6')](e,emitEvent(event));}}module[_0x9498('0x7')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 13760bf..e03a26a 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 _0x4fc2=['lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./chatInternalMessage.attributes','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x2ff063,_0xf98de3){var _0x402698=function(_0x54b412){while(--_0x54b412){_0x2ff063['push'](_0x2ff063['shift']());}};_0x402698(++_0xf98de3);}(_0x4fc2,0x111));var _0x24fc=function(_0x542185,_0x325852){_0x542185=_0x542185-0x0;var _0x2504b3=_0x4fc2[_0x542185];return _0x2504b3;};'use strict';var _=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var logger=require(_0x24fc('0x2'))(_0x24fc('0x3'));var moment=require('moment');var BPromise=require(_0x24fc('0x4'));var rp=require(_0x24fc('0x5'));var fs=require('fs');var path=require(_0x24fc('0x6'));var rimraf=require('rimraf');var config=require(_0x24fc('0x7'));var attributes=require(_0x24fc('0x8'));module['exports']=function(_0x26fcc6,_0x12d602){return _0x26fcc6['define'](_0x24fc('0x9'),attributes,{'tableName':_0x24fc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x24fc('0xb'),'collate':_0x24fc('0xc')});}; \ No newline at end of file +var _0xb7e7=['ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','define'];(function(_0x174880,_0x4eef6a){var _0x43e998=function(_0x2bf163){while(--_0x2bf163){_0x174880['push'](_0x174880['shift']());}};_0x43e998(++_0x4eef6a);}(_0xb7e7,0x121));var _0x7b7e=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0xb7e7[_0xd1d19a];return _0x52a79d;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7b7e('0x9'),'collate':_0x7b7e('0xa')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 2ae9268..c00bdc1 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 _0xecbe=['lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','./chatInternalMessage.socket','register','request','then','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','ChatInternalMessage,\x20%s,\x20%s','message','result','catch'];(function(_0x4f76bd,_0x5f00f7){var _0x49da14=function(_0x1ccc74){while(--_0x1ccc74){_0x4f76bd['push'](_0x4f76bd['shift']());}};_0x49da14(++_0x5f00f7);}(_0xecbe,0xe6));var _0xeecb=function(_0x1c0fc3,_0x3537bb){_0x1c0fc3=_0x1c0fc3-0x0;var _0x338237=_0xecbe[_0x1c0fc3];return _0x338237;};'use strict';var _=require(_0xeecb('0x0'));var util=require(_0xeecb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xeecb('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeecb('0x3'))['db'];var utils=require(_0xeecb('0x4'));var logger=require(_0xeecb('0x5'))(_0xeecb('0x6'));var config=require('../../config/environment');var jayson=require(_0xeecb('0x7'));var client=jayson['client'][_0xeecb('0x8')]({'port':0x232a});config[_0xeecb('0x9')]=_[_0xeecb('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeecb('0x9')]));require(_0xeecb('0xb'))[_0xeecb('0xc')](socket);function respondWithRpcPromise(_0x20aedf,_0x429121,_0x4fc77b){return new BPromise(function(_0x341f00,_0x151f4b){return client[_0xeecb('0xd')](_0x20aedf,_0x4fc77b)[_0xeecb('0xe')](function(_0x29b55a){logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x429121,_0xeecb('0xf'));logger['debug'](_0xeecb('0x10'),_0x429121,_0xeecb('0xf'),JSON[_0xeecb('0x11')](_0x29b55a));if(_0x29b55a[_0xeecb('0x12')]){if(_0x29b55a[_0xeecb('0x12')]['code']===0x1f4){logger[_0xeecb('0x12')](_0xeecb('0x13'),_0x429121,_0x29b55a[_0xeecb('0x12')]['message']);return _0x151f4b(_0x29b55a['error'][_0xeecb('0x14')]);}logger[_0xeecb('0x12')](_0xeecb('0x13'),_0x429121,_0x29b55a['error'][_0xeecb('0x14')]);return _0x341f00(_0x29b55a[_0xeecb('0x12')][_0xeecb('0x14')]);}else{logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x429121,_0xeecb('0xf'));_0x341f00(_0x29b55a[_0xeecb('0x15')]['message']);}})[_0xeecb('0x16')](function(_0x2c81e0){logger[_0xeecb('0x12')](_0xeecb('0x13'),_0x429121,_0x2c81e0);_0x151f4b(_0x2c81e0);});});} \ No newline at end of file +var _0xee60=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash'];(function(_0x12aa1e,_0x53ca2e){var _0x54e21f=function(_0x9be99){while(--_0x9be99){_0x12aa1e['push'](_0x12aa1e['shift']());}};_0x54e21f(++_0x53ca2e);}(_0xee60,0x9b));var _0x0ee6=function(_0x58e9a8,_0x58862c){_0x58e9a8=_0x58e9a8-0x0;var _0x18949b=_0xee60[_0x58e9a8];return _0x18949b;};'use strict';var _=require(_0x0ee6('0x0'));var util=require(_0x0ee6('0x1'));var moment=require(_0x0ee6('0x2'));var BPromise=require('bluebird');var rs=require(_0x0ee6('0x3'));var fs=require('fs');var Redis=require(_0x0ee6('0x4'));var db=require(_0x0ee6('0x5'))['db'];var utils=require(_0x0ee6('0x6'));var logger=require(_0x0ee6('0x7'))('rpc');var config=require(_0x0ee6('0x8'));var jayson=require(_0x0ee6('0x9'));var client=jayson['client'][_0x0ee6('0xa')]({'port':0x232a});config[_0x0ee6('0xb')]=_[_0x0ee6('0xc')](config[_0x0ee6('0xb')],{'host':_0x0ee6('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0x0ee6('0xe')](socket);function respondWithRpcPromise(_0x4d124c,_0x358579,_0x407079){return new BPromise(function(_0x28c3ad,_0x2feb23){return client[_0x0ee6('0xf')](_0x4d124c,_0x407079)[_0x0ee6('0x10')](function(_0x194560){logger[_0x0ee6('0x11')](_0x0ee6('0x12'),_0x358579,_0x0ee6('0x13'));logger[_0x0ee6('0x14')](_0x0ee6('0x15'),_0x358579,_0x0ee6('0x13'),JSON[_0x0ee6('0x16')](_0x194560));if(_0x194560[_0x0ee6('0x17')]){if(_0x194560[_0x0ee6('0x17')]['code']===0x1f4){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x358579,_0x194560[_0x0ee6('0x17')]['message']);return _0x2feb23(_0x194560['error']['message']);}logger[_0x0ee6('0x17')](_0x0ee6('0x12'),_0x358579,_0x194560[_0x0ee6('0x17')][_0x0ee6('0x18')]);return _0x28c3ad(_0x194560[_0x0ee6('0x17')][_0x0ee6('0x18')]);}else{logger[_0x0ee6('0x11')](_0x0ee6('0x12'),_0x358579,'request\x20sent');_0x28c3ad(_0x194560['result'][_0x0ee6('0x18')]);}})[_0x0ee6('0x19')](function(_0x508c47){logger[_0x0ee6('0x17')](_0x0ee6('0x12'),_0x358579,_0x508c47);_0x2feb23(_0x508c47);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 153c509..8a048cb 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 _0xee11=['length','./chatInternalMessage.events','update','emit','removeListener'];(function(_0x5ad8ba,_0x5c2680){var _0x4fd3fb=function(_0x1f90eb){while(--_0x1f90eb){_0x5ad8ba['push'](_0x5ad8ba['shift']());}};_0x4fd3fb(++_0x5c2680);}(_0xee11,0x146));var _0x1ee1=function(_0x129a57,_0x330d03){_0x129a57=_0x129a57-0x0;var _0xa7147c=_0xee11[_0x129a57];return _0xa7147c;};'use strict';var ChatInternalMessageEvents=require(_0x1ee1('0x0'));var events=['save','remove',_0x1ee1('0x1')];function createListener(_0x1a6844,_0x3a1711){return function(_0x1eb386){_0x3a1711[_0x1ee1('0x2')](_0x1a6844,_0x1eb386);};}function removeListener(_0x14d420,_0x3eb96f){return function(){ChatInternalMessageEvents[_0x1ee1('0x3')](_0x14d420,_0x3eb96f);};}exports['register']=function(_0x1322a7){for(var _0x6be72f=0x0,_0x3fdb3b=events[_0x1ee1('0x4')];_0x6be72f<_0x3fdb3b;_0x6be72f++){var _0x356919=events[_0x6be72f];var _0x47f984=createListener('chatInternalMessage:'+_0x356919,_0x1322a7);ChatInternalMessageEvents['on'](_0x356919,_0x47f984);}}; \ No newline at end of file +var _0x43b1=['emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove'];(function(_0x520bd1,_0x3f1896){var _0x43fb23=function(_0x29b825){while(--_0x29b825){_0x520bd1['push'](_0x520bd1['shift']());}};_0x43fb23(++_0x3f1896);}(_0x43b1,0x7d));var _0x143b=function(_0x57782d,_0x19b7bc){_0x57782d=_0x57782d-0x0;var _0x412914=_0x43b1[_0x57782d];return _0x412914;};'use strict';var ChatInternalMessageEvents=require(_0x143b('0x0'));var events=[_0x143b('0x1'),_0x143b('0x2'),'update'];function createListener(_0xb377ea,_0x4976d0){return function(_0x1e1282){_0x4976d0[_0x143b('0x3')](_0xb377ea,_0x1e1282);};}function removeListener(_0x223e86,_0x1552bc){return function(){ChatInternalMessageEvents[_0x143b('0x4')](_0x223e86,_0x1552bc);};}exports[_0x143b('0x5')]=function(_0x4be3bc){for(var _0x263d20=0x0,_0x2236ae=events[_0x143b('0x6')];_0x263d20<_0x2236ae;_0x263d20++){var _0x519333=events[_0x263d20];var _0x453a09=createListener(_0x143b('0x7')+_0x519333,_0x4be3bc);ChatInternalMessageEvents['on'](_0x519333,_0x453a09);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index ade7f40..7aa7131 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 _0xe706=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x14b5bc,_0x578a32){var _0x43333d=function(_0x27e40f){while(--_0x27e40f){_0x14b5bc['push'](_0x14b5bc['shift']());}};_0x43333d(++_0x578a32);}(_0xe706,0xa3));var _0x6e70=function(_0x515d8d,_0x5a7b53){_0x515d8d=_0x515d8d-0x0;var _0x296990=_0xe706[_0x515d8d];return _0x296990;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var auth=require(_0x6e70('0x5'));var interaction=require(_0x6e70('0x6'));var config=require(_0x6e70('0x7'));var controller=require(_0x6e70('0x8'));router[_0x6e70('0x9')]('/',auth[_0x6e70('0xa')](),controller[_0x6e70('0xb')]);router[_0x6e70('0x9')](_0x6e70('0xc'),auth[_0x6e70('0xa')](),controller[_0x6e70('0xd')]);router[_0x6e70('0x9')](_0x6e70('0xe'),auth[_0x6e70('0xa')](),controller[_0x6e70('0xf')]);router[_0x6e70('0x9')](_0x6e70('0x10'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x11')]);router[_0x6e70('0x12')]('/',auth[_0x6e70('0xa')](),controller[_0x6e70('0x13')]);router['put']('/:id',controller[_0x6e70('0x14')]);router[_0x6e70('0x15')](_0x6e70('0x10'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x16')]);module[_0x6e70('0x17')]=router; \ No newline at end of file +var _0xb7e7=['exports','multer','path','express','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','/describe','isAuthenticated','/users','getUsers','/:id','post','create','put','update','delete'];(function(_0x11c846,_0x1474f5){var _0x42baa2=function(_0x3fdd76){while(--_0x3fdd76){_0x11c846['push'](_0x11c846['shift']());}};_0x42baa2(++_0x1474f5);}(_0xb7e7,0x121));var _0x7b7e=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0xb7e7[_0x68ee8b];return _0x5148f7;};'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 auth=require(_0x7b7e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x7b7e('0x4'));var controller=require(_0x7b7e('0x5'));router[_0x7b7e('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7b7e('0x6')](_0x7b7e('0x7'),auth[_0x7b7e('0x8')](),controller['describe']);router[_0x7b7e('0x6')](_0x7b7e('0x9'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0x6')](_0x7b7e('0xb'),auth[_0x7b7e('0x8')](),controller['show']);router[_0x7b7e('0xc')]('/',auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0xe')](_0x7b7e('0xb'),controller[_0x7b7e('0xf')]);router[_0x7b7e('0x10')](_0x7b7e('0xb'),auth[_0x7b7e('0x8')](),controller['destroy']);module[_0x7b7e('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index a8f2276..b185bd9 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 _0x2765=['sequelize','exports','TEXT','BOOLEAN','ENUM','out','DATE'];(function(_0x8aafcb,_0x333254){var _0x280dbe=function(_0xe7e7a9){while(--_0xe7e7a9){_0x8aafcb['push'](_0x8aafcb['shift']());}};_0x280dbe(++_0x333254);}(_0x2765,0xf5));var _0x5276=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x2765[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0x5276('0x0'));module[_0x5276('0x1')]={'body':{'type':Sequelize[_0x5276('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x5276('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x5276('0x4')]('in',_0x5276('0x5')),'defaultValue':_0x5276('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x5276('0x6')]}}; \ No newline at end of file +var _0xb663=['sequelize','exports','TEXT','medium','ENUM','out','DATE'];(function(_0x1fe2e8,_0x947821){var _0x3383c0=function(_0x5a4d4b){while(--_0x5a4d4b){_0x1fe2e8['push'](_0x1fe2e8['shift']());}};_0x3383c0(++_0x947821);}(_0xb663,0xd2));var _0x3b66=function(_0x22e133,_0x527287){_0x22e133=_0x22e133-0x0;var _0x3455ca=_0xb663[_0x22e133];return _0x3455ca;};'use strict';var Sequelize=require(_0x3b66('0x0'));module[_0x3b66('0x1')]={'body':{'type':Sequelize[_0x3b66('0x2')](_0x3b66('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x3b66('0x4')]('in',_0x3b66('0x5')),'defaultValue':_0x3b66('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x3b66('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 5ca9591..edf27a4 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 _0x65ad=['limit','sort','pick','filter','where','type','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','length','include','create','body','destroy','find','describe','chat-interactions','accept','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','ChatInteraction','isNil','read1stAt','interaction','role','stringify','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','EventManager','parse','formData','chat','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','event','rejectmessage','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','Sequelize','ValidationError','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','count','offset','set','Content-Range','json','reject','update','end','sendStatus','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','nolimit'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x65ad,0x1a6));var _0xd65a=function(_0x5de49c,_0x2264ee){_0x5de49c=_0x5de49c-0x0;var _0x415afc=_0x65ad[_0x5de49c];return _0x415afc;};'use strict';var pdf=require(_0xd65a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd65a('0x1'));var zipdir=require(_0xd65a('0x2'));var jsonpatch=require(_0xd65a('0x3'));var rp=require(_0xd65a('0x4'));var moment=require('moment');var BPromise=require(_0xd65a('0x5'));var Mustache=require(_0xd65a('0x6'));var util=require(_0xd65a('0x7'));var path=require('path');var sox=require(_0xd65a('0x8'));var csv=require(_0xd65a('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xd65a('0xa'));var crypto=require('crypto');var jsforce=require(_0xd65a('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xd65a('0x9'));var querystring=require(_0xd65a('0xc'));var Papa=require(_0xd65a('0xd'));var Redis=require(_0xd65a('0xe'));var authService=require(_0xd65a('0xf'));var qs=require(_0xd65a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd65a('0x11'));var logger=require(_0xd65a('0x12'))(_0xd65a('0x13'));var utils=require('../../config/utils');var config=require(_0xd65a('0x14'));var db=require(_0xd65a('0x15'))['db'];config['redis']=_[_0xd65a('0x16')](config[_0xd65a('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xd65a('0x18'))(new Redis(config[_0xd65a('0x17')]));require(_0xd65a('0x19'))[_0xd65a('0x1a')](socket);var jayson=require(_0xd65a('0x1b'));var client=jayson[_0xd65a('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0xd65a('0x1c')][_0xd65a('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x3bed2d,_0x1e8499,_0x312f24){if(_0x312f24){var _0x4456c0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4456c0['test'](_0x1e8499)){return _0x3bed2d;}else{throw new db[(_0xd65a('0x1e'))][(_0xd65a('0x1f'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x3bed2d;}}function respondWithRpcPromise(_0x19adcc,_0x174178,_0xd55467,_0x47521c){return new BPromise(function(_0x40641c,_0x19f5c7){var _0x253564=_0x47521c||client;return _0x253564[_0xd65a('0x20')](_0x19adcc,_0xd55467)[_0xd65a('0x21')](function(_0x506314){logger[_0xd65a('0x22')](_0xd65a('0x23'),_0x174178,_0xd65a('0x24'));logger[_0xd65a('0x25')](_0xd65a('0x26'),_0x174178,_0xd65a('0x24'),JSON['stringify'](_0x506314));if(_0x506314[_0xd65a('0x27')]){if(_0x506314[_0xd65a('0x27')][_0xd65a('0x28')]===0x1f4){logger[_0xd65a('0x27')](_0xd65a('0x23'),_0x174178,_0x506314[_0xd65a('0x27')]['message']);return _0x19f5c7(_0x506314[_0xd65a('0x27')]['message']);}logger[_0xd65a('0x27')](_0xd65a('0x23'),_0x174178,_0x506314[_0xd65a('0x27')][_0xd65a('0x29')]);return _0x40641c(_0x506314[_0xd65a('0x27')][_0xd65a('0x29')]);}else{logger[_0xd65a('0x22')](_0xd65a('0x23'),_0x174178,_0xd65a('0x24'));_0x40641c(_0x506314[_0xd65a('0x2a')][_0xd65a('0x29')]);}})[_0xd65a('0x2b')](function(_0x4b3e20){logger[_0xd65a('0x27')](_0xd65a('0x23'),_0x174178,_0x4b3e20);_0x19f5c7(_0x4b3e20);});});}function respondWithStatusCode(_0x2de982,_0x4575ff){_0x4575ff=_0x4575ff||0xcc;return function(_0x57da9e){if(_0x57da9e){return _0x2de982['sendStatus'](_0x4575ff);}return _0x2de982[_0xd65a('0x2c')](_0x4575ff)['end']();};}function respondWithResult(_0x245304,_0x45d579){_0x45d579=_0x45d579||0xc8;return function(_0x1f6465){if(_0x1f6465){return _0x245304[_0xd65a('0x2c')](_0x45d579)['json'](_0x1f6465);}};}function respondWithFilteredResult(_0x3e03ac,_0x44c68d){return function(_0x11f730){if(_0x11f730){var _0x1bcd33=_0x11f730[_0xd65a('0x2d')],_0x275cb4=_0x44c68d[_0xd65a('0x2e')],_0x26a34a=_0x44c68d[_0xd65a('0x2e')]+_0x44c68d['limit'],_0x348dee;if(_0x26a34a>=_0x1bcd33){_0x26a34a=_0x1bcd33;_0x348dee=0xc8;}else{_0x348dee=0xce;}_0x3e03ac[_0xd65a('0x2c')](_0x348dee);return _0x3e03ac[_0xd65a('0x2f')](_0xd65a('0x30'),_0x275cb4+'-'+_0x26a34a+'/'+_0x1bcd33)[_0xd65a('0x31')](_0x11f730);}return null;};}function patchUpdates(_0x3229f6){return function(_0x15a82f){try{jsonpatch['apply'](_0x15a82f,_0x3229f6,!![]);}catch(_0x585525){return BPromise[_0xd65a('0x32')](_0x585525);}return _0x15a82f['save']();};}function saveUpdates(_0x133098,_0x5b1b41){return function(_0x13c572){if(_0x13c572){return _0x13c572[_0xd65a('0x33')](_0x133098)['then'](function(_0x42d5d3){return _0x42d5d3;});}return null;};}function removeEntity(_0x359c83,_0x489892){return function(_0x5b07b7){if(_0x5b07b7){return _0x5b07b7['destroy']()['then'](function(){_0x359c83[_0xd65a('0x2c')](0xcc)[_0xd65a('0x34')]();});}};}function handleEntityNotFound(_0x5a84b1,_0x1de899){return function(_0x47aceb){if(!_0x47aceb){_0x5a84b1[_0xd65a('0x35')](0x194);}return _0x47aceb;};}function handleError(_0x403bcb,_0x500c66){_0x500c66=_0x500c66||0x1f4;return function(_0x58c180){logger['error'](_0x58c180[_0xd65a('0x36')]);if(_0x58c180[_0xd65a('0x37')]){delete _0x58c180[_0xd65a('0x37')];}_0x403bcb[_0xd65a('0x2c')](_0x500c66)[_0xd65a('0x38')](_0x58c180);};}exports[_0xd65a('0x39')]=function(_0x1044cf,_0x3b905b){var _0x5c610e={},_0x2086fc={},_0x4b1b6f={'count':0x0,'rows':[]};var _0x4b59e2=_[_0xd65a('0x3a')](db[_0xd65a('0x3b')][_0xd65a('0x3c')],function(_0x129755){return{'name':_0x129755[_0xd65a('0x3d')],'type':_0x129755['type'][_0xd65a('0x3e')]};});_0x2086fc['model']=_[_0xd65a('0x3a')](_0x4b59e2,'name');_0x2086fc[_0xd65a('0x3f')]=_['keys'](_0x1044cf[_0xd65a('0x3f')]);_0x2086fc[_0xd65a('0x40')]=_[_0xd65a('0x41')](_0x2086fc[_0xd65a('0x42')],_0x2086fc[_0xd65a('0x3f')]);_0x5c610e[_0xd65a('0x43')]=_[_0xd65a('0x41')](_0x2086fc[_0xd65a('0x42')],qs[_0xd65a('0x44')](_0x1044cf['query']['fields']));_0x5c610e[_0xd65a('0x43')]=_0x5c610e[_0xd65a('0x43')]['length']?_0x5c610e[_0xd65a('0x43')]:_0x2086fc[_0xd65a('0x42')];if(!_0x1044cf[_0xd65a('0x3f')]['hasOwnProperty'](_0xd65a('0x45'))){_0x5c610e[_0xd65a('0x46')]=qs[_0xd65a('0x46')](_0x1044cf[_0xd65a('0x3f')]['limit']);_0x5c610e['offset']=qs[_0xd65a('0x2e')](_0x1044cf[_0xd65a('0x3f')]['offset']);}_0x5c610e['order']=qs[_0xd65a('0x47')](_0x1044cf['query'][_0xd65a('0x47')]);_0x5c610e['where']=qs[_0xd65a('0x40')](_[_0xd65a('0x48')](_0x1044cf[_0xd65a('0x3f')],_0x2086fc[_0xd65a('0x40')]));if(_0x1044cf['query'][_0xd65a('0x49')]){_0x5c610e[_0xd65a('0x4a')]=_['merge'](_0x5c610e[_0xd65a('0x4a')],{'$or':_[_0xd65a('0x3a')](_0x4b59e2,function(_0x413ea0){if(_0x413ea0[_0xd65a('0x4b')]!==_0xd65a('0x4c')){var _0x2ae718={};_0x2ae718[_0x413ea0[_0xd65a('0x37')]]={'$like':'%'+_0x1044cf[_0xd65a('0x3f')]['filter']+'%'};return _0x2ae718;}})});}_0x5c610e=_[_0xd65a('0x4d')]({},_0x5c610e,_0x1044cf[_0xd65a('0x4e')]);var _0x121acb={'where':_0x5c610e[_0xd65a('0x4a')]};return db['ChatMessage'][_0xd65a('0x2d')](_0x121acb)[_0xd65a('0x21')](function(_0x2c4f44){_0x4b1b6f[_0xd65a('0x2d')]=_0x2c4f44;if(_0x1044cf[_0xd65a('0x3f')][_0xd65a('0x4f')]){_0x5c610e['include']=[{'all':!![]}];}return db[_0xd65a('0x3b')][_0xd65a('0x50')](_0x5c610e);})['then'](function(_0x47898a){_0x4b1b6f[_0xd65a('0x51')]=_0x47898a;return _0x4b1b6f;})[_0xd65a('0x21')](respondWithFilteredResult(_0x3b905b,_0x5c610e))[_0xd65a('0x2b')](handleError(_0x3b905b,null));};exports[_0xd65a('0x52')]=function(_0x4ad562,_0x59a01a){var _0xd20b99={'raw':!![],'where':{'id':_0x4ad562[_0xd65a('0x53')]['id']}},_0x2ab712={};_0x2ab712[_0xd65a('0x42')]=_['keys'](db[_0xd65a('0x3b')][_0xd65a('0x3c')]);_0x2ab712[_0xd65a('0x3f')]=_['keys'](_0x4ad562['query']);_0x2ab712['filters']=_[_0xd65a('0x41')](_0x2ab712[_0xd65a('0x42')],_0x2ab712[_0xd65a('0x3f')]);_0xd20b99[_0xd65a('0x43')]=_['intersection'](_0x2ab712[_0xd65a('0x42')],qs[_0xd65a('0x44')](_0x4ad562[_0xd65a('0x3f')][_0xd65a('0x44')]));_0xd20b99[_0xd65a('0x43')]=_0xd20b99[_0xd65a('0x43')][_0xd65a('0x54')]?_0xd20b99[_0xd65a('0x43')]:_0x2ab712['model'];if(_0x4ad562[_0xd65a('0x3f')]['includeAll']){_0xd20b99[_0xd65a('0x55')]=[{'all':!![]}];}_0xd20b99=_[_0xd65a('0x4d')]({},_0xd20b99,_0x4ad562['options']);return db[_0xd65a('0x3b')]['find'](_0xd20b99)['then'](handleEntityNotFound(_0x59a01a,null))[_0xd65a('0x21')](respondWithResult(_0x59a01a,null))[_0xd65a('0x2b')](handleError(_0x59a01a,null));};exports[_0xd65a('0x56')]=function(_0x421d65,_0x1fd6af){return db['ChatMessage'][_0xd65a('0x56')](_0x421d65[_0xd65a('0x57')],{})[_0xd65a('0x21')](respondWithResult(_0x1fd6af,0xc9))[_0xd65a('0x2b')](handleError(_0x1fd6af,null));};exports[_0xd65a('0x33')]=function(_0x5869ec,_0x504dd6){if(_0x5869ec['body']['id']){delete _0x5869ec[_0xd65a('0x57')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x5869ec[_0xd65a('0x53')]['id']}})[_0xd65a('0x21')](handleEntityNotFound(_0x504dd6,null))[_0xd65a('0x21')](saveUpdates(_0x5869ec[_0xd65a('0x57')],null))['then'](respondWithResult(_0x504dd6,null))['catch'](handleError(_0x504dd6,null));};exports[_0xd65a('0x58')]=function(_0x3fc4da,_0x56e26b){return db['ChatMessage'][_0xd65a('0x59')]({'where':{'id':_0x3fc4da['params']['id']}})['then'](handleEntityNotFound(_0x56e26b,null))[_0xd65a('0x21')](removeEntity(_0x56e26b,null))[_0xd65a('0x2b')](handleError(_0x56e26b,null));};exports[_0xd65a('0x5a')]=function(_0x37e663,_0x4aa30a){return db[_0xd65a('0x3b')][_0xd65a('0x5a')]()['then'](respondWithResult(_0x4aa30a,null))[_0xd65a('0x2b')](handleError(_0x4aa30a,null));};var interaction_log=require(_0xd65a('0x12'))(_0xd65a('0x5b'));exports[_0xd65a('0x5c')]=function(_0x30e139,_0x2264d0,_0x253a22){var _0x137df6={'channel':'chat'};if(_0x30e139[_0xd65a('0x57')]['id']){delete _0x30e139[_0xd65a('0x57')]['id'];}_0x30e139[_0xd65a('0x57')]['read']=!![];_0x30e139[_0xd65a('0x57')]['readAt']=moment()[_0xd65a('0x5d')](_0xd65a('0x5e'));_0x30e139[_0xd65a('0x57')][_0xd65a('0x5f')]=_0x30e139[_0xd65a('0x57')][_0xd65a('0x5f')]||_0x30e139[_0xd65a('0x60')]['id'];return db[_0xd65a('0x3b')][_0xd65a('0x59')]({'where':{'id':_0x30e139[_0xd65a('0x53')]['id'],'UserId':null},'include':[{'model':db[_0xd65a('0x61')],'as':_0xd65a('0x62')}]})[_0xd65a('0x21')](handleEntityNotFound(_0x2264d0,null))[_0xd65a('0x21')](saveUpdates(_0x30e139['body'],null))['then'](function(_0x2d212b){if(_0x2d212b){_0x137df6[_0xd65a('0x29')]=_0x2d212b[_0xd65a('0x63')]({'plain':!![]});return db[_0xd65a('0x64')][_0xd65a('0x59')]({'where':{'id':_0x2d212b['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x2264d0,null))['then'](function(_0x2b43d0){if(_0x2b43d0){return _0x2b43d0[_0xd65a('0x33')]({'UserId':_0x30e139[_0xd65a('0x57')]['UserId'],'read1stAt':_[_0xd65a('0x65')](_0x2b43d0[_0xd65a('0x66')])?moment()[_0xd65a('0x5d')](_0xd65a('0x5e')):undefined});}return null;})['then'](function(_0x5ab4a9){if(_0x5ab4a9){_0x137df6[_0xd65a('0x67')]=_0x5ab4a9[_0xd65a('0x63')]({'plain':!![]});interaction_log[_0xd65a('0x22')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x30e139[_0xd65a('0x60')]['id'],_0x30e139[_0xd65a('0x60')]['name'],_0x30e139[_0xd65a('0x60')][_0xd65a('0x68')],_0x137df6['interaction']['id'],_0x30e139['body']?JSON[_0xd65a('0x69')](_0x30e139[_0xd65a('0x57')]):_0xd65a('0x6a'));return respondWithRpcPromise(_0xd65a('0x6b'),_0xd65a('0x6c'),_0x137df6);}return null;})['then'](function(_0x438d14){if(_0x438d14){if(_0x30e139[_0xd65a('0x57')][_0xd65a('0x6d')]){_0x137df6[_0xd65a('0x29')][_0xd65a('0x6e')]=util[_0xd65a('0x5d')](_0xd65a('0x6f'),_0x30e139['user'][_0xd65a('0x37')]);_0x137df6[_0xd65a('0x29')][_0xd65a('0x70')]=_0x137df6[_0xd65a('0x70')];_0x137df6[_0xd65a('0x29')]['event']=_0xd65a('0x5c');return respondWithRpcPromise('EventManager',_0xd65a('0x71'),{'event':'acceptmessage','message':_[_0xd65a('0x4d')](_0x137df6[_0xd65a('0x29')],JSON[_0xd65a('0x72')](_0x137df6[_0xd65a('0x67')][_0xd65a('0x73')]))},client9002)[_0xd65a('0x21')](function(){return _0x137df6;});}return _0x137df6;}return null;})[_0xd65a('0x21')](respondWithResult(_0x2264d0,null))[_0xd65a('0x2b')](handleError(_0x2264d0,null));};var interaction_log=require(_0xd65a('0x12'))(_0xd65a('0x5b'));exports[_0xd65a('0x32')]=function(_0x2598d6,_0x49e1dd,_0x1b6901){var _0x17d3bb={'agent':{},'channel':_0xd65a('0x74')};if(_0x2598d6[_0xd65a('0x57')]['id']){delete _0x2598d6[_0xd65a('0x57')]['id'];}_0x2598d6[_0xd65a('0x57')][_0xd65a('0x5f')]=_0x2598d6[_0xd65a('0x57')][_0xd65a('0x5f')]||_0x2598d6[_0xd65a('0x60')]['id'];_0x17d3bb['agent']['id']=_0x2598d6[_0xd65a('0x57')][_0xd65a('0x5f')];return db[_0xd65a('0x3b')][_0xd65a('0x59')]({'where':{'id':_0x2598d6[_0xd65a('0x53')]['id'],'UserId':null}})[_0xd65a('0x21')](handleEntityNotFound(_0x49e1dd,null))[_0xd65a('0x21')](function(_0x14f493){if(_0x14f493){_0x17d3bb[_0xd65a('0x29')]=_0x14f493[_0xd65a('0x63')]({'plain':!![]});return db[_0xd65a('0x64')][_0xd65a('0x59')]({'where':{'id':_0x14f493[_0xd65a('0x75')]}});}return null;})[_0xd65a('0x21')](handleEntityNotFound(_0x49e1dd,null))[_0xd65a('0x21')](function(_0x5448f3){if(_0x5448f3){_0x17d3bb['interaction']=_0x5448f3[_0xd65a('0x63')]({'plain':!![]});interaction_log['info'](_0xd65a('0x76'),_0x2598d6['user']['id'],_0x2598d6[_0xd65a('0x60')][_0xd65a('0x37')],_0x2598d6[_0xd65a('0x60')][_0xd65a('0x68')],_0x17d3bb[_0xd65a('0x67')]['id'],_0x2598d6[_0xd65a('0x57')]?JSON[_0xd65a('0x69')](_0x2598d6[_0xd65a('0x57')]):_0xd65a('0x6a'));return respondWithRpcPromise(_0xd65a('0x77'),_0xd65a('0x78'),_0x17d3bb);}return null;})['then'](function(_0x230880){if(_0x230880){_0x230880[_0xd65a('0x29')][_0xd65a('0x6e')]=util[_0xd65a('0x5d')](_0xd65a('0x6f'),_0x2598d6['user']['name']);_0x230880[_0xd65a('0x29')]['channel']=_0x17d3bb['channel'];_0x230880[_0xd65a('0x29')][_0xd65a('0x79')]='reject';respondWithRpcPromise(_0xd65a('0x71'),_0xd65a('0x71'),{'event':_0xd65a('0x7a'),'message':_0x230880['message']},client9002);return _0x17d3bb;}return null;})['then'](respondWithResult(_0x49e1dd,null))[_0xd65a('0x2b')](handleError(_0x49e1dd,null));}; \ No newline at end of file +var _0xfce7=['RejectMessage','rejectmessage','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','sendStatus','status','end','json','count','offset','limit','set','reject','save','update','stack','name','send','index','ChatMessage','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','create','body','destroy','find','describe','../../config/logger','chat-interactions','accept','chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact','Contact','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfce7,0x7c));var _0x7fce=function(_0x5e8d3e,_0x18ed2e){_0x5e8d3e=_0x5e8d3e-0x0;var _0x1348c0=_0xfce7[_0x5e8d3e];return _0x1348c0;};'use strict';var pdf=require(_0x7fce('0x0'));var emlformat=require(_0x7fce('0x1'));var rimraf=require(_0x7fce('0x2'));var zipdir=require(_0x7fce('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7fce('0x4'));var moment=require('moment');var BPromise=require(_0x7fce('0x5'));var Mustache=require(_0x7fce('0x6'));var util=require(_0x7fce('0x7'));var path=require(_0x7fce('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7fce('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7fce('0xa'));var crypto=require(_0x7fce('0xb'));var jsforce=require(_0x7fce('0xc'));var deskjs=require(_0x7fce('0xd'));var toCsv=require(_0x7fce('0xe'));var querystring=require(_0x7fce('0xf'));var Papa=require(_0x7fce('0x10'));var Redis=require(_0x7fce('0x11'));var authService=require(_0x7fce('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7fce('0x13'));var logger=require('../../config/logger')(_0x7fce('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x7fce('0x15')]=_[_0x7fce('0x16')](config[_0x7fce('0x15')],{'host':_0x7fce('0x17'),'port':0x18eb});var socket=require(_0x7fce('0x18'))(new Redis(config[_0x7fce('0x15')]));require(_0x7fce('0x19'))['register'](socket);var jayson=require(_0x7fce('0x1a'));var client=jayson[_0x7fce('0x1b')][_0x7fce('0x1c')]({'port':0x232c});var client9002=jayson[_0x7fce('0x1b')][_0x7fce('0x1c')]({'port':0x232a});function checkPasswordPattern(_0xa03f76,_0x12b1a5,_0x3e779f){if(_0x3e779f){var _0x2d253a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2d253a[_0x7fce('0x1d')](_0x12b1a5)){return _0xa03f76;}else{throw new db[(_0x7fce('0x1e'))][(_0x7fce('0x1f'))](_0x7fce('0x20'));}}else{return _0xa03f76;}}function respondWithRpcPromise(_0x2e98b4,_0x4792cb,_0x5a9656,_0x4fe797){return new BPromise(function(_0x246f92,_0x1603bf){var _0x35f106=_0x4fe797||client;return _0x35f106[_0x7fce('0x21')](_0x2e98b4,_0x5a9656)[_0x7fce('0x22')](function(_0x595716){logger[_0x7fce('0x23')](_0x7fce('0x24'),_0x4792cb,_0x7fce('0x25'));logger[_0x7fce('0x26')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x4792cb,_0x7fce('0x25'),JSON['stringify'](_0x595716));if(_0x595716[_0x7fce('0x27')]){if(_0x595716[_0x7fce('0x27')][_0x7fce('0x28')]===0x1f4){logger['error'](_0x7fce('0x24'),_0x4792cb,_0x595716[_0x7fce('0x27')][_0x7fce('0x29')]);return _0x1603bf(_0x595716[_0x7fce('0x27')][_0x7fce('0x29')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x4792cb,_0x595716[_0x7fce('0x27')]['message']);return _0x246f92(_0x595716['error'][_0x7fce('0x29')]);}else{logger[_0x7fce('0x23')](_0x7fce('0x24'),_0x4792cb,_0x7fce('0x25'));_0x246f92(_0x595716[_0x7fce('0x2a')][_0x7fce('0x29')]);}})['catch'](function(_0x1305d3){logger['error'](_0x7fce('0x24'),_0x4792cb,_0x1305d3);_0x1603bf(_0x1305d3);});});}function respondWithStatusCode(_0x3cb8e8,_0x393515){_0x393515=_0x393515||0xcc;return function(_0x29f1b8){if(_0x29f1b8){return _0x3cb8e8[_0x7fce('0x2b')](_0x393515);}return _0x3cb8e8[_0x7fce('0x2c')](_0x393515)[_0x7fce('0x2d')]();};}function respondWithResult(_0xa7b196,_0x11e849){_0x11e849=_0x11e849||0xc8;return function(_0x13b1bf){if(_0x13b1bf){return _0xa7b196[_0x7fce('0x2c')](_0x11e849)[_0x7fce('0x2e')](_0x13b1bf);}};}function respondWithFilteredResult(_0x34ebd3,_0x217060){return function(_0x5d27a1){if(_0x5d27a1){var _0x193fe7=_0x5d27a1[_0x7fce('0x2f')],_0x38cd3d=_0x217060[_0x7fce('0x30')],_0x34ffcc=_0x217060[_0x7fce('0x30')]+_0x217060[_0x7fce('0x31')],_0xf9b636;if(_0x34ffcc>=_0x193fe7){_0x34ffcc=_0x193fe7;_0xf9b636=0xc8;}else{_0xf9b636=0xce;}_0x34ebd3[_0x7fce('0x2c')](_0xf9b636);return _0x34ebd3[_0x7fce('0x32')]('Content-Range',_0x38cd3d+'-'+_0x34ffcc+'/'+_0x193fe7)[_0x7fce('0x2e')](_0x5d27a1);}return null;};}function patchUpdates(_0x2609b7){return function(_0x5281a1){try{jsonpatch['apply'](_0x5281a1,_0x2609b7,!![]);}catch(_0x17bf93){return BPromise[_0x7fce('0x33')](_0x17bf93);}return _0x5281a1[_0x7fce('0x34')]();};}function saveUpdates(_0x4e4fdb,_0x475c72){return function(_0x21c1e8){if(_0x21c1e8){return _0x21c1e8[_0x7fce('0x35')](_0x4e4fdb)[_0x7fce('0x22')](function(_0x12c934){return _0x12c934;});}return null;};}function removeEntity(_0x2065c4,_0x303614){return function(_0x5ea64e){if(_0x5ea64e){return _0x5ea64e['destroy']()[_0x7fce('0x22')](function(){_0x2065c4[_0x7fce('0x2c')](0xcc)[_0x7fce('0x2d')]();});}};}function handleEntityNotFound(_0x539c27,_0x211862){return function(_0xe7a9cb){if(!_0xe7a9cb){_0x539c27[_0x7fce('0x2b')](0x194);}return _0xe7a9cb;};}function handleError(_0x267db3,_0x5dbe53){_0x5dbe53=_0x5dbe53||0x1f4;return function(_0x2bfc03){logger[_0x7fce('0x27')](_0x2bfc03[_0x7fce('0x36')]);if(_0x2bfc03['name']){delete _0x2bfc03[_0x7fce('0x37')];}_0x267db3['status'](_0x5dbe53)[_0x7fce('0x38')](_0x2bfc03);};}exports[_0x7fce('0x39')]=function(_0x371649,_0x231861){var _0x35c86d={},_0x14eb65={},_0x2216fb={'count':0x0,'rows':[]};var _0x5b1361=_['map'](db[_0x7fce('0x3a')][_0x7fce('0x3b')],function(_0x5953f3){return{'name':_0x5953f3[_0x7fce('0x3c')],'type':_0x5953f3[_0x7fce('0x3d')]['key']};});_0x14eb65['model']=_['map'](_0x5b1361,_0x7fce('0x37'));_0x14eb65[_0x7fce('0x3e')]=_[_0x7fce('0x3f')](_0x371649[_0x7fce('0x3e')]);_0x14eb65[_0x7fce('0x40')]=_['intersection'](_0x14eb65[_0x7fce('0x41')],_0x14eb65[_0x7fce('0x3e')]);_0x35c86d[_0x7fce('0x42')]=_[_0x7fce('0x43')](_0x14eb65[_0x7fce('0x41')],qs[_0x7fce('0x44')](_0x371649[_0x7fce('0x3e')][_0x7fce('0x44')]));_0x35c86d[_0x7fce('0x42')]=_0x35c86d[_0x7fce('0x42')][_0x7fce('0x45')]?_0x35c86d['attributes']:_0x14eb65[_0x7fce('0x41')];if(!_0x371649[_0x7fce('0x3e')][_0x7fce('0x46')]('nolimit')){_0x35c86d['limit']=qs['limit'](_0x371649[_0x7fce('0x3e')][_0x7fce('0x31')]);_0x35c86d['offset']=qs[_0x7fce('0x30')](_0x371649['query']['offset']);}_0x35c86d[_0x7fce('0x47')]=qs[_0x7fce('0x48')](_0x371649['query'][_0x7fce('0x48')]);_0x35c86d[_0x7fce('0x49')]=qs[_0x7fce('0x40')](_[_0x7fce('0x4a')](_0x371649[_0x7fce('0x3e')],_0x14eb65[_0x7fce('0x40')]));if(_0x371649[_0x7fce('0x3e')][_0x7fce('0x4b')]){_0x35c86d[_0x7fce('0x49')]=_[_0x7fce('0x4c')](_0x35c86d['where'],{'$or':_['map'](_0x5b1361,function(_0x377e52){if(_0x377e52[_0x7fce('0x3d')]!==_0x7fce('0x4d')){var _0x3c1090={};_0x3c1090[_0x377e52[_0x7fce('0x37')]]={'$like':'%'+_0x371649[_0x7fce('0x3e')][_0x7fce('0x4b')]+'%'};return _0x3c1090;}})});}_0x35c86d=_['merge']({},_0x35c86d,_0x371649[_0x7fce('0x4e')]);var _0x5d09f5={'where':_0x35c86d[_0x7fce('0x49')]};return db['ChatMessage'][_0x7fce('0x2f')](_0x5d09f5)[_0x7fce('0x22')](function(_0x3f036f){_0x2216fb[_0x7fce('0x2f')]=_0x3f036f;if(_0x371649[_0x7fce('0x3e')][_0x7fce('0x4f')]){_0x35c86d['include']=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x35c86d);})[_0x7fce('0x22')](function(_0x239398){_0x2216fb[_0x7fce('0x50')]=_0x239398;return _0x2216fb;})[_0x7fce('0x22')](respondWithFilteredResult(_0x231861,_0x35c86d))[_0x7fce('0x51')](handleError(_0x231861,null));};exports[_0x7fce('0x52')]=function(_0x33149b,_0x470700){var _0x578d58={'raw':!![],'where':{'id':_0x33149b[_0x7fce('0x53')]['id']}},_0x3e9176={};_0x3e9176[_0x7fce('0x41')]=_[_0x7fce('0x3f')](db[_0x7fce('0x3a')]['rawAttributes']);_0x3e9176['query']=_[_0x7fce('0x3f')](_0x33149b[_0x7fce('0x3e')]);_0x3e9176[_0x7fce('0x40')]=_[_0x7fce('0x43')](_0x3e9176[_0x7fce('0x41')],_0x3e9176[_0x7fce('0x3e')]);_0x578d58[_0x7fce('0x42')]=_['intersection'](_0x3e9176[_0x7fce('0x41')],qs[_0x7fce('0x44')](_0x33149b[_0x7fce('0x3e')][_0x7fce('0x44')]));_0x578d58[_0x7fce('0x42')]=_0x578d58[_0x7fce('0x42')][_0x7fce('0x45')]?_0x578d58[_0x7fce('0x42')]:_0x3e9176[_0x7fce('0x41')];if(_0x33149b[_0x7fce('0x3e')]['includeAll']){_0x578d58['include']=[{'all':!![]}];}_0x578d58=_[_0x7fce('0x4c')]({},_0x578d58,_0x33149b[_0x7fce('0x4e')]);return db[_0x7fce('0x3a')]['find'](_0x578d58)[_0x7fce('0x22')](handleEntityNotFound(_0x470700,null))[_0x7fce('0x22')](respondWithResult(_0x470700,null))[_0x7fce('0x51')](handleError(_0x470700,null));};exports[_0x7fce('0x54')]=function(_0x488c12,_0x36c0a7){return db[_0x7fce('0x3a')]['create'](_0x488c12['body'],{})[_0x7fce('0x22')](respondWithResult(_0x36c0a7,0xc9))[_0x7fce('0x51')](handleError(_0x36c0a7,null));};exports[_0x7fce('0x35')]=function(_0x937818,_0x4af9c0){if(_0x937818[_0x7fce('0x55')]['id']){delete _0x937818[_0x7fce('0x55')]['id'];}return db[_0x7fce('0x3a')]['find']({'where':{'id':_0x937818[_0x7fce('0x53')]['id']}})[_0x7fce('0x22')](handleEntityNotFound(_0x4af9c0,null))[_0x7fce('0x22')](saveUpdates(_0x937818[_0x7fce('0x55')],null))[_0x7fce('0x22')](respondWithResult(_0x4af9c0,null))[_0x7fce('0x51')](handleError(_0x4af9c0,null));};exports[_0x7fce('0x56')]=function(_0x131574,_0x44496b){return db[_0x7fce('0x3a')][_0x7fce('0x57')]({'where':{'id':_0x131574[_0x7fce('0x53')]['id']}})[_0x7fce('0x22')](handleEntityNotFound(_0x44496b,null))[_0x7fce('0x22')](removeEntity(_0x44496b,null))['catch'](handleError(_0x44496b,null));};exports[_0x7fce('0x58')]=function(_0x192de2,_0x44079f){return db[_0x7fce('0x3a')][_0x7fce('0x58')]()[_0x7fce('0x22')](respondWithResult(_0x44079f,null))[_0x7fce('0x51')](handleError(_0x44079f,null));};var interaction_log=require(_0x7fce('0x59'))(_0x7fce('0x5a'));exports[_0x7fce('0x5b')]=function(_0x59ca35,_0x54fce4,_0x185131){var _0x3bfb06={'channel':_0x7fce('0x5c')};if(_0x59ca35[_0x7fce('0x55')]['id']){delete _0x59ca35[_0x7fce('0x55')]['id'];}_0x59ca35[_0x7fce('0x55')]['read']=!![];_0x59ca35[_0x7fce('0x55')][_0x7fce('0x5d')]=moment()[_0x7fce('0x5e')](_0x7fce('0x5f'));_0x59ca35[_0x7fce('0x55')][_0x7fce('0x60')]=_0x59ca35[_0x7fce('0x55')][_0x7fce('0x60')]||_0x59ca35['user']['id'];return db[_0x7fce('0x3a')]['find']({'where':{'id':_0x59ca35['params']['id'],'UserId':null},'include':[{'model':db[_0x7fce('0x61')],'as':_0x7fce('0x62')}]})[_0x7fce('0x22')](handleEntityNotFound(_0x54fce4,null))[_0x7fce('0x22')](saveUpdates(_0x59ca35[_0x7fce('0x55')],null))[_0x7fce('0x22')](function(_0x5e92a1){if(_0x5e92a1){_0x3bfb06[_0x7fce('0x29')]=_0x5e92a1[_0x7fce('0x63')]({'plain':!![]});return db[_0x7fce('0x64')]['find']({'where':{'id':_0x5e92a1[_0x7fce('0x65')]}});}return null;})[_0x7fce('0x22')](handleEntityNotFound(_0x54fce4,null))[_0x7fce('0x22')](function(_0x507290){if(_0x507290){return _0x507290['update']({'UserId':_0x59ca35[_0x7fce('0x55')]['UserId'],'read1stAt':_[_0x7fce('0x66')](_0x507290[_0x7fce('0x67')])?moment()[_0x7fce('0x5e')](_0x7fce('0x5f')):undefined});}return null;})['then'](function(_0x1f285c){if(_0x1f285c){_0x3bfb06[_0x7fce('0x68')]=_0x1f285c['get']({'plain':!![]});interaction_log[_0x7fce('0x23')](_0x7fce('0x69'),_0x59ca35[_0x7fce('0x6a')]['id'],_0x59ca35[_0x7fce('0x6a')]['name'],_0x59ca35[_0x7fce('0x6a')]['role'],_0x3bfb06[_0x7fce('0x68')]['id'],_0x59ca35[_0x7fce('0x55')]?JSON['stringify'](_0x59ca35['body']):_0x7fce('0x6b'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x3bfb06);}return null;})[_0x7fce('0x22')](function(_0x4cfdc5){if(_0x4cfdc5){if(_0x59ca35[_0x7fce('0x55')][_0x7fce('0x6c')]){_0x3bfb06['message'][_0x7fce('0x6d')]=util[_0x7fce('0x5e')](_0x7fce('0x6e'),_0x59ca35[_0x7fce('0x6a')][_0x7fce('0x37')]);_0x3bfb06['message']['channel']=_0x3bfb06[_0x7fce('0x6f')];_0x3bfb06[_0x7fce('0x29')][_0x7fce('0x70')]=_0x7fce('0x5b');return respondWithRpcPromise(_0x7fce('0x71'),_0x7fce('0x71'),{'event':_0x7fce('0x72'),'message':_[_0x7fce('0x4c')](_0x3bfb06[_0x7fce('0x29')],JSON[_0x7fce('0x73')](_0x3bfb06[_0x7fce('0x68')][_0x7fce('0x74')]))},client9002)[_0x7fce('0x22')](function(){return _0x3bfb06;});}return _0x3bfb06;}return null;})[_0x7fce('0x22')](respondWithResult(_0x54fce4,null))[_0x7fce('0x51')](handleError(_0x54fce4,null));};var interaction_log=require(_0x7fce('0x59'))('chat-interactions');exports[_0x7fce('0x33')]=function(_0xf5f3f8,_0x900a93,_0x51f9d1){var _0x5e55d6={'agent':{},'channel':_0x7fce('0x5c')};if(_0xf5f3f8[_0x7fce('0x55')]['id']){delete _0xf5f3f8[_0x7fce('0x55')]['id'];}_0xf5f3f8[_0x7fce('0x55')][_0x7fce('0x60')]=_0xf5f3f8[_0x7fce('0x55')][_0x7fce('0x60')]||_0xf5f3f8[_0x7fce('0x6a')]['id'];_0x5e55d6['agent']['id']=_0xf5f3f8[_0x7fce('0x55')]['UserId'];return db[_0x7fce('0x3a')][_0x7fce('0x57')]({'where':{'id':_0xf5f3f8[_0x7fce('0x53')]['id'],'UserId':null}})[_0x7fce('0x22')](handleEntityNotFound(_0x900a93,null))[_0x7fce('0x22')](function(_0x23257e){if(_0x23257e){_0x5e55d6[_0x7fce('0x29')]=_0x23257e[_0x7fce('0x63')]({'plain':!![]});return db[_0x7fce('0x64')][_0x7fce('0x57')]({'where':{'id':_0x23257e[_0x7fce('0x65')]}});}return null;})[_0x7fce('0x22')](handleEntityNotFound(_0x900a93,null))[_0x7fce('0x22')](function(_0x828635){if(_0x828635){_0x5e55d6[_0x7fce('0x68')]=_0x828635['get']({'plain':!![]});interaction_log[_0x7fce('0x23')](_0x7fce('0x75'),_0xf5f3f8[_0x7fce('0x6a')]['id'],_0xf5f3f8['user']['name'],_0xf5f3f8[_0x7fce('0x6a')][_0x7fce('0x76')],_0x5e55d6[_0x7fce('0x68')]['id'],_0xf5f3f8['body']?JSON[_0x7fce('0x77')](_0xf5f3f8['body']):'null');return respondWithRpcPromise(_0x7fce('0x78'),'rejectMessage',_0x5e55d6);}return null;})[_0x7fce('0x22')](function(_0x545bd5){if(_0x545bd5){_0x545bd5[_0x7fce('0x29')][_0x7fce('0x6d')]=util[_0x7fce('0x5e')]('SIP/%s',_0xf5f3f8[_0x7fce('0x6a')][_0x7fce('0x37')]);_0x545bd5['message'][_0x7fce('0x6f')]=_0x5e55d6[_0x7fce('0x6f')];_0x545bd5[_0x7fce('0x29')][_0x7fce('0x70')]=_0x7fce('0x33');respondWithRpcPromise('EventManager',_0x7fce('0x71'),{'event':_0x7fce('0x79'),'message':_0x545bd5[_0x7fce('0x29')]},client9002);return _0x5e55d6;}return null;})[_0x7fce('0x22')](respondWithResult(_0x900a93,null))['catch'](handleError(_0x900a93,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 7b32849..a5c536e 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 _0xd226=['emit','hook','events','../../mysqldb','ChatMessage','setMaxListeners','update','remove'];(function(_0x30c2dc,_0x3fb903){var _0x43da45=function(_0x222e31){while(--_0x222e31){_0x30c2dc['push'](_0x30c2dc['shift']());}};_0x43da45(++_0x3fb903);}(_0xd226,0xe2));var _0x6d22=function(_0x376579,_0x4a6a93){_0x376579=_0x376579-0x0;var _0x522be4=_0xd226[_0x376579];return _0x522be4;};'use strict';var EventEmitter=require(_0x6d22('0x0'));var ChatMessage=require(_0x6d22('0x1'))['db'][_0x6d22('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x6d22('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6d22('0x4'),'afterDestroy':_0x6d22('0x5')};function emitEvent(_0x182b0d){return function(_0x53349f,_0x165447,_0x48fc8a){ChatMessageEvents[_0x6d22('0x6')](_0x182b0d+':'+_0x53349f['id'],_0x53349f);ChatMessageEvents[_0x6d22('0x6')](_0x182b0d,_0x53349f);_0x48fc8a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x6d22('0x7')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file +var _0xe45f=['ChatMessage','save','remove','emit','hasOwnProperty','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe45f,0x14a));var _0xfe45=function(_0x8abbaf,_0x182889){_0x8abbaf=_0x8abbaf-0x0;var _0x45fea4=_0xe45f[_0x8abbaf];return _0x45fea4;};'use strict';var EventEmitter=require('events');var ChatMessage=require('../../mysqldb')['db'][_0xfe45('0x0')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfe45('0x1'),'afterUpdate':'update','afterDestroy':_0xfe45('0x2')};function emitEvent(_0x1e05ea){return function(_0x25558a,_0x3eac20,_0x523da1){ChatMessageEvents[_0xfe45('0x3')](_0x1e05ea+':'+_0x25558a['id'],_0x25558a);ChatMessageEvents[_0xfe45('0x3')](_0x1e05ea,_0x25558a);_0x523da1(null);};}for(var e in events){if(events[_0xfe45('0x4')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0xfe45('0x5')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index b794a24..b2f458c 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 _0x295b=['rimraf','../../config/environment','./chatMessage.attributes','exports','define','body','FULLTEXT','models','toLowerCase','out','secret','isNil','ChatInteraction','ChatInteractionId','then','update','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x295b,0x165));var _0xb295=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0x295b[_0x5cb1af];return _0x8d7940;};'use strict';var _=require(_0xb295('0x0'));var util=require(_0xb295('0x1'));var logger=require('../../config/logger')(_0xb295('0x2'));var moment=require(_0xb295('0x3'));var BPromise=require(_0xb295('0x4'));var rp=require(_0xb295('0x5'));var fs=require('fs');var path=require(_0xb295('0x6'));var rimraf=require(_0xb295('0x7'));var config=require(_0xb295('0x8'));var attributes=require(_0xb295('0x9'));module[_0xb295('0xa')]=function(_0x2c3f0e,_0x33356a){return _0x2c3f0e[_0xb295('0xb')]('ChatMessage',attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0xb295('0xc')],'type':_0xb295('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1eca65,_0x555bc6,_0x5d8853){var _0x18271c=_0x2c3f0e[_0xb295('0xe')];var _0x2540a9=_0x1eca65['get']({'plain':!![]});if(_0x2540a9['direction'][_0xb295('0xf')]()==='in'||_0x2540a9['direction'][_0xb295('0xf')]()===_0xb295('0x10')&&!_0x2540a9[_0xb295('0x11')]&&!_[_0xb295('0x12')](_0x2540a9['UserId'])){_0x18271c[_0xb295('0x13')]['findOne']({'where':{'id':_0x2540a9[_0xb295('0x14')]}})[_0xb295('0x15')](function(_0x3d581c){if(_0x3d581c){_0x3d581c[_0xb295('0x16')]({'lastMsgAt':_0x2540a9['createdAt'],'lastMsgDirection':_0x2540a9['direction'][_0xb295('0xf')]()});}})['catch'](function(_0x3d3455){console[_0xb295('0x17')](_0x3d3455);});}_0x5d8853();}},'charset':_0xb295('0x18'),'collate':_0xb295('0x19')});}; \ No newline at end of file +var _0x89cb=['utf8mb4_unicode_ci','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','fti_chat_messages','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','catch','error','utf8mb4'];(function(_0x32974a,_0xd71e64){var _0x29fb8b=function(_0x5f207d){while(--_0x5f207d){_0x32974a['push'](_0x32974a['shift']());}};_0x29fb8b(++_0xd71e64);}(_0x89cb,0x10f));var _0xb89c=function(_0x543314,_0x5359c6){_0x543314=_0x543314-0x0;var _0x179d86=_0x89cb[_0x543314];return _0x179d86;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb89c('0x0'))('api');var moment=require(_0xb89c('0x1'));var BPromise=require(_0xb89c('0x2'));var rp=require(_0xb89c('0x3'));var fs=require('fs');var path=require(_0xb89c('0x4'));var rimraf=require(_0xb89c('0x5'));var config=require(_0xb89c('0x6'));var attributes=require(_0xb89c('0x7'));module[_0xb89c('0x8')]=function(_0x324807,_0x2e40ba){return _0x324807[_0xb89c('0x9')]('ChatMessage',attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0xb89c('0xa'),'fields':['body'],'type':_0xb89c('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xdb1996,_0x648897,_0x3e8c3b){var _0x29c8aa=_0x324807[_0xb89c('0xc')];var _0x396763=_0xdb1996[_0xb89c('0xd')]({'plain':!![]});if(_0x396763[_0xb89c('0xe')][_0xb89c('0xf')]()==='in'||_0x396763[_0xb89c('0xe')][_0xb89c('0xf')]()===_0xb89c('0x10')&&!_0x396763['secret']&&!_[_0xb89c('0x11')](_0x396763[_0xb89c('0x12')])){_0x29c8aa[_0xb89c('0x13')][_0xb89c('0x14')]({'where':{'id':_0x396763[_0xb89c('0x15')]}})[_0xb89c('0x16')](function(_0x58ef4e){if(_0x58ef4e){_0x58ef4e['update']({'lastMsgAt':_0x396763['createdAt'],'lastMsgDirection':_0x396763[_0xb89c('0xe')][_0xb89c('0xf')]()});}})[_0xb89c('0x17')](function(_0x180f35){console[_0xb89c('0x18')](_0x180f35);});}_0x3e8c3b();}},'charset':_0xb89c('0x19'),'collate':_0xb89c('0x1a')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index f9f29c2..fd7cbbe 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 _0x11a7=['code','ChatMessage,\x20%s,\x20%s','message','result','body','options','CreateChatMessage','catch','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5a5395,_0x5361f6){var _0x4da43d=function(_0x149941){while(--_0x149941){_0x5a5395['push'](_0x5a5395['shift']());}};_0x4da43d(++_0x5361f6);}(_0x11a7,0x152));var _0x711a=function(_0x5c8811,_0x4f77d5){_0x5c8811=_0x5c8811-0x0;var _0x2c0941=_0x11a7[_0x5c8811];return _0x2c0941;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x711a('0x0'));var BPromise=require(_0x711a('0x1'));var rs=require(_0x711a('0x2'));var fs=require('fs');var Redis=require(_0x711a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x711a('0x4'));var logger=require('../../config/logger')(_0x711a('0x5'));var config=require('../../config/environment');var jayson=require(_0x711a('0x6'));var client=jayson['client'][_0x711a('0x7')]({'port':0x232a});config[_0x711a('0x8')]=_[_0x711a('0x9')](config[_0x711a('0x8')],{'host':_0x711a('0xa'),'port':0x18eb});var socket=require(_0x711a('0xb'))(new Redis(config[_0x711a('0x8')]));require(_0x711a('0xc'))[_0x711a('0xd')](socket);function respondWithRpcPromise(_0xdb4b52,_0xa4c5fb,_0x59c8bb){return new BPromise(function(_0x47e38e,_0xe1bed7){return client[_0x711a('0xe')](_0xdb4b52,_0x59c8bb)[_0x711a('0xf')](function(_0x299eaa){logger[_0x711a('0x10')]('ChatMessage,\x20%s,\x20%s',_0xa4c5fb,_0x711a('0x11'));logger[_0x711a('0x12')](_0x711a('0x13'),_0xa4c5fb,_0x711a('0x11'),JSON[_0x711a('0x14')](_0x299eaa));if(_0x299eaa[_0x711a('0x15')]){if(_0x299eaa[_0x711a('0x15')][_0x711a('0x16')]===0x1f4){logger[_0x711a('0x15')](_0x711a('0x17'),_0xa4c5fb,_0x299eaa[_0x711a('0x15')]['message']);return _0xe1bed7(_0x299eaa[_0x711a('0x15')][_0x711a('0x18')]);}logger['error'](_0x711a('0x17'),_0xa4c5fb,_0x299eaa[_0x711a('0x15')][_0x711a('0x18')]);return _0x47e38e(_0x299eaa[_0x711a('0x15')][_0x711a('0x18')]);}else{logger[_0x711a('0x10')](_0x711a('0x17'),_0xa4c5fb,'request\x20sent');_0x47e38e(_0x299eaa[_0x711a('0x19')][_0x711a('0x18')]);}})['catch'](function(_0x314fb7){logger['error'](_0x711a('0x17'),_0xa4c5fb,_0x314fb7);_0xe1bed7(_0x314fb7);});});}exports['CreateChatMessage']=function(_0x3efa4e){var _0x38290a=this;return new Promise(function(_0x3c2d3b,_0x67ceef){return db['ChatMessage']['create'](_0x3efa4e[_0x711a('0x1a')],{'raw':_0x3efa4e['options']?_0x3efa4e[_0x711a('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x711a('0xf')](function(_0x1eb49c){logger['info']('CreateChatMessage',_0x3efa4e);logger['debug'](_0x711a('0x1c'),_0x3efa4e,JSON[_0x711a('0x14')](_0x1eb49c));_0x3c2d3b(_0x1eb49c);})[_0x711a('0x1d')](function(_0x3fb141){logger[_0x711a('0x15')]('CreateChatMessage',_0x3fb141['message'],_0x3efa4e);_0x67ceef(_0x38290a[_0x711a('0x15')](0x1f4,_0x3fb141[_0x711a('0x18')]));});});}; \ No newline at end of file +var _0x8464=['./chatMessage.socket','request','info','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','CreateChatMessage','ChatMessage','options','then','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter'];(function(_0x24ee80,_0x253d46){var _0x34f1a8=function(_0x8ddf7f){while(--_0x8ddf7f){_0x24ee80['push'](_0x24ee80['shift']());}};_0x34f1a8(++_0x253d46);}(_0x8464,0x1df));var _0x4846=function(_0x124614,_0x5392b){_0x124614=_0x124614-0x0;var _0x301b96=_0x8464[_0x124614];return _0x301b96;};'use strict';var _=require(_0x4846('0x0'));var util=require(_0x4846('0x1'));var moment=require(_0x4846('0x2'));var BPromise=require(_0x4846('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4846('0x4'));var db=require(_0x4846('0x5'))['db'];var utils=require(_0x4846('0x6'));var logger=require(_0x4846('0x7'))(_0x4846('0x8'));var config=require(_0x4846('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4846('0xa')][_0x4846('0xb')]({'port':0x232a});config['redis']=_[_0x4846('0xc')](config[_0x4846('0xd')],{'host':_0x4846('0xe'),'port':0x18eb});var socket=require(_0x4846('0xf'))(new Redis(config[_0x4846('0xd')]));require(_0x4846('0x10'))['register'](socket);function respondWithRpcPromise(_0x49ad5e,_0x1055c2,_0xfffb97){return new BPromise(function(_0x17da0c,_0x2792ee){return client[_0x4846('0x11')](_0x49ad5e,_0xfffb97)['then'](function(_0x1fdb6a){logger[_0x4846('0x12')]('ChatMessage,\x20%s,\x20%s',_0x1055c2,_0x4846('0x13'));logger['debug'](_0x4846('0x14'),_0x1055c2,_0x4846('0x13'),JSON[_0x4846('0x15')](_0x1fdb6a));if(_0x1fdb6a[_0x4846('0x16')]){if(_0x1fdb6a[_0x4846('0x16')][_0x4846('0x17')]===0x1f4){logger[_0x4846('0x16')](_0x4846('0x18'),_0x1055c2,_0x1fdb6a[_0x4846('0x16')][_0x4846('0x19')]);return _0x2792ee(_0x1fdb6a[_0x4846('0x16')]['message']);}logger[_0x4846('0x16')](_0x4846('0x18'),_0x1055c2,_0x1fdb6a['error'][_0x4846('0x19')]);return _0x17da0c(_0x1fdb6a[_0x4846('0x16')][_0x4846('0x19')]);}else{logger[_0x4846('0x12')](_0x4846('0x18'),_0x1055c2,_0x4846('0x13'));_0x17da0c(_0x1fdb6a[_0x4846('0x1a')][_0x4846('0x19')]);}})[_0x4846('0x1b')](function(_0x5734ff){logger[_0x4846('0x16')]('ChatMessage,\x20%s,\x20%s',_0x1055c2,_0x5734ff);_0x2792ee(_0x5734ff);});});}exports[_0x4846('0x1c')]=function(_0x3a8edd){var _0x7758ff=this;return new Promise(function(_0x1aad03,_0x380351){return db[_0x4846('0x1d')]['create'](_0x3a8edd['body'],{'raw':_0x3a8edd[_0x4846('0x1e')]?_0x3a8edd[_0x4846('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0x4846('0x1f')](function(_0x4e38c1){logger[_0x4846('0x12')](_0x4846('0x1c'),_0x3a8edd);logger[_0x4846('0x20')]('CreateChatMessage',_0x3a8edd,JSON[_0x4846('0x15')](_0x4e38c1));_0x1aad03(_0x4e38c1);})[_0x4846('0x1b')](function(_0x37c0f3){logger[_0x4846('0x16')]('CreateChatMessage',_0x37c0f3[_0x4846('0x19')],_0x3a8edd);_0x380351(_0x7758ff[_0x4846('0x16')](0x1f4,_0x37c0f3['message']));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index b7f7421..92303a3 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 _0x5f2f=['remove','update','emit','removeListener','register','length','chatMessage:','./chatMessage.events','save'];(function(_0x36856f,_0x98b59e){var _0x43ac52=function(_0x36bc47){while(--_0x36bc47){_0x36856f['push'](_0x36856f['shift']());}};_0x43ac52(++_0x98b59e);}(_0x5f2f,0x73));var _0xf5f2=function(_0x531381,_0x5ab2de){_0x531381=_0x531381-0x0;var _0x76b83d=_0x5f2f[_0x531381];return _0x76b83d;};'use strict';var ChatMessageEvents=require(_0xf5f2('0x0'));var events=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3')];function createListener(_0x1172dd,_0x174bc7){return function(_0x3c72ee){_0x174bc7[_0xf5f2('0x4')](_0x1172dd,_0x3c72ee);};}function removeListener(_0x501fbd,_0x4854b6){return function(){ChatMessageEvents[_0xf5f2('0x5')](_0x501fbd,_0x4854b6);};}exports[_0xf5f2('0x6')]=function(_0xad7f65){for(var _0x3eebf6=0x0,_0x3133bc=events[_0xf5f2('0x7')];_0x3eebf6<_0x3133bc;_0x3eebf6++){var _0x5907aa=events[_0x3eebf6];var _0x466882=createListener(_0xf5f2('0x8')+_0x5907aa,_0xad7f65);ChatMessageEvents['on'](_0x5907aa,_0x466882);}}; \ No newline at end of file +var _0x430c=['register','length','chatMessage:','./chatMessage.events','update','removeListener'];(function(_0x3dca82,_0x5e08fb){var _0x26c373=function(_0x580e4f){while(--_0x580e4f){_0x3dca82['push'](_0x3dca82['shift']());}};_0x26c373(++_0x5e08fb);}(_0x430c,0x1a1));var _0xc430=function(_0x3d5df9,_0x5b3623){_0x3d5df9=_0x3d5df9-0x0;var _0x50ba39=_0x430c[_0x3d5df9];return _0x50ba39;};'use strict';var ChatMessageEvents=require(_0xc430('0x0'));var events=['save','remove',_0xc430('0x1')];function createListener(_0xe2d084,_0x1d5b5e){return function(_0x503988){_0x1d5b5e['emit'](_0xe2d084,_0x503988);};}function removeListener(_0x5ccda6,_0x47d8b9){return function(){ChatMessageEvents[_0xc430('0x2')](_0x5ccda6,_0x47d8b9);};}exports[_0xc430('0x3')]=function(_0x50b256){for(var _0x42aa9c=0x0,_0x4de44f=events[_0xc430('0x4')];_0x42aa9c<_0x4de44f;_0x42aa9c++){var _0x2e51c6=events[_0x42aa9c];var _0x814a90=createListener(_0xc430('0x5')+_0x2e51c6,_0x50b256);ChatMessageEvents['on'](_0x2e51c6,_0x814a90);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 759c63c..979fee2 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 _0x550c=['/:id/reject','reject','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','post','chat','create','put','update','/:id/accept','accept'];(function(_0x4d0239,_0x1367c6){var _0x46a6c1=function(_0x313c68){while(--_0x313c68){_0x4d0239['push'](_0x4d0239['shift']());}};_0x46a6c1(++_0x1367c6);}(_0x550c,0xa4));var _0xc550=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x550c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc550('0x0'));var util=require(_0xc550('0x1'));var path=require(_0xc550('0x2'));var timeout=require(_0xc550('0x3'));var express=require(_0xc550('0x4'));var router=express[_0xc550('0x5')]();var auth=require(_0xc550('0x6'));var interaction=require(_0xc550('0x7'));var config=require(_0xc550('0x8'));var controller=require('./chatMessage.controller');router[_0xc550('0x9')]('/',auth[_0xc550('0xa')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0xc550('0xb')]);router[_0xc550('0x9')](_0xc550('0xc'),auth[_0xc550('0xa')](),controller['show']);router[_0xc550('0xd')]('/',auth[_0xc550('0xa')](),interaction['tracked'](_0xc550('0xe'),'chatmessage:create'),controller[_0xc550('0xf')]);router[_0xc550('0x10')]('/:id',controller[_0xc550('0x11')]);router[_0xc550('0x10')](_0xc550('0x12'),auth[_0xc550('0xa')](),controller[_0xc550('0x13')]);router[_0xc550('0x10')](_0xc550('0x14'),auth[_0xc550('0xa')](),controller[_0xc550('0x15')]);router['delete']('/:id',auth[_0xc550('0xa')](),controller['destroy']);module[_0xc550('0x16')]=router; \ No newline at end of file +var _0x5eb3=['chat','chatmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','describe','/:id','show','post'];(function(_0x3bbbbf,_0xdcd66b){var _0x586a30=function(_0x20fbea){while(--_0x20fbea){_0x3bbbbf['push'](_0x3bbbbf['shift']());}};_0x586a30(++_0xdcd66b);}(_0x5eb3,0xeb));var _0x35eb=function(_0x38b14f,_0xd08fa8){_0x38b14f=_0x38b14f-0x0;var _0x22a324=_0x5eb3[_0x38b14f];return _0x22a324;};'use strict';var multer=require(_0x35eb('0x0'));var util=require(_0x35eb('0x1'));var path=require(_0x35eb('0x2'));var timeout=require(_0x35eb('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x35eb('0x4'));var interaction=require(_0x35eb('0x5'));var config=require(_0x35eb('0x6'));var controller=require(_0x35eb('0x7'));router[_0x35eb('0x8')]('/',auth[_0x35eb('0x9')](),controller[_0x35eb('0xa')]);router[_0x35eb('0x8')]('/describe',auth[_0x35eb('0x9')](),controller[_0x35eb('0xb')]);router[_0x35eb('0x8')](_0x35eb('0xc'),auth[_0x35eb('0x9')](),controller[_0x35eb('0xd')]);router[_0x35eb('0xe')]('/',auth[_0x35eb('0x9')](),interaction['tracked'](_0x35eb('0xf'),_0x35eb('0x10')),controller['create']);router[_0x35eb('0x11')](_0x35eb('0xc'),controller[_0x35eb('0x12')]);router[_0x35eb('0x11')](_0x35eb('0x13'),auth[_0x35eb('0x9')](),controller[_0x35eb('0x14')]);router['put'](_0x35eb('0x15'),auth['isAuthenticated'](),controller[_0x35eb('0x16')]);router[_0x35eb('0x17')](_0x35eb('0xc'),auth[_0x35eb('0x9')](),controller['destroy']);module[_0x35eb('0x18')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 2fbca65..39b4623 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 _0x904e=['sequelize','exports'];(function(_0x1a21ff,_0x4a7550){var _0x25afc1=function(_0x4a66ec){while(--_0x4a66ec){_0x1a21ff['push'](_0x1a21ff['shift']());}};_0x25afc1(++_0x4a7550);}(_0x904e,0x1dc));var _0xe904=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x904e[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0xe904('0x0'));module[_0xe904('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]}}; \ No newline at end of file +var _0x3cd1=['exports','TEXT','sequelize'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x3cd1,0x1d6));var _0x13cd=function(_0x54aaab,_0x9c1830){_0x54aaab=_0x54aaab-0x0;var _0x52d6d8=_0x3cd1[_0x54aaab];return _0x52d6d8;};'use strict';var Sequelize=require(_0x13cd('0x0'));module[_0x13cd('0x1')]={'body':{'type':Sequelize[_0x13cd('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 07adcde..7fdd28a 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 _0x560e=['describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','then','destroy','error','name','send','index','ChatOfflineMessage','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','fields','find','create','body'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x560e,0x19f));var _0xe560=function(_0x2ed632,_0x5cc598){_0x2ed632=_0x2ed632-0x0;var _0x353cab=_0x560e[_0x2ed632];return _0x353cab;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe560('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe560('0x1'));var jsonpatch=require(_0xe560('0x2'));var rp=require(_0xe560('0x3'));var moment=require(_0xe560('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe560('0x5'));var util=require('util');var path=require(_0xe560('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe560('0x7'));var fs=require('fs');var _=require(_0xe560('0x8'));var squel=require('squel');var crypto=require(_0xe560('0x9'));var jsforce=require(_0xe560('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe560('0xb'));var Papa=require(_0xe560('0xc'));var Redis=require(_0xe560('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xe560('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe560('0xf'))(_0xe560('0x10'));var utils=require(_0xe560('0x11'));var config=require(_0xe560('0x12'));var db=require(_0xe560('0x13'))['db'];function respondWithStatusCode(_0x27f48f,_0x5ecd07){_0x5ecd07=_0x5ecd07||0xcc;return function(_0x34fdfc){if(_0x34fdfc){return _0x27f48f[_0xe560('0x14')](_0x5ecd07);}return _0x27f48f[_0xe560('0x15')](_0x5ecd07)[_0xe560('0x16')]();};}function respondWithResult(_0x3f97b8,_0x5dbde4){_0x5dbde4=_0x5dbde4||0xc8;return function(_0x266c06){if(_0x266c06){return _0x3f97b8[_0xe560('0x15')](_0x5dbde4)[_0xe560('0x17')](_0x266c06);}};}function respondWithFilteredResult(_0x39a111,_0x5c2ac1){return function(_0x5292b6){if(_0x5292b6){var _0x52a8f0=_0x5292b6[_0xe560('0x18')],_0x34cd92=_0x5c2ac1['offset'],_0x5e0a33=_0x5c2ac1[_0xe560('0x19')]+_0x5c2ac1[_0xe560('0x1a')],_0x2dd5fd;if(_0x5e0a33>=_0x52a8f0){_0x5e0a33=_0x52a8f0;_0x2dd5fd=0xc8;}else{_0x2dd5fd=0xce;}_0x39a111[_0xe560('0x15')](_0x2dd5fd);return _0x39a111[_0xe560('0x1b')](_0xe560('0x1c'),_0x34cd92+'-'+_0x5e0a33+'/'+_0x52a8f0)[_0xe560('0x17')](_0x5292b6);}return null;};}function patchUpdates(_0x3d2c8e){return function(_0x180f51){try{jsonpatch['apply'](_0x180f51,_0x3d2c8e,!![]);}catch(_0x7f9323){return BPromise['reject'](_0x7f9323);}return _0x180f51[_0xe560('0x1d')]();};}function saveUpdates(_0x1c574e,_0x3ac5f6){return function(_0x243afa){if(_0x243afa){return _0x243afa['update'](_0x1c574e)[_0xe560('0x1e')](function(_0x503f1d){return _0x503f1d;});}return null;};}function removeEntity(_0x51ed85,_0x460e65){return function(_0x23187d){if(_0x23187d){return _0x23187d[_0xe560('0x1f')]()[_0xe560('0x1e')](function(){_0x51ed85[_0xe560('0x15')](0xcc)[_0xe560('0x16')]();});}};}function handleEntityNotFound(_0x44cd86,_0x2381e1){return function(_0x53889a){if(!_0x53889a){_0x44cd86['sendStatus'](0x194);}return _0x53889a;};}function handleError(_0x1be932,_0x476358){_0x476358=_0x476358||0x1f4;return function(_0x5a854d){logger[_0xe560('0x20')](_0x5a854d['stack']);if(_0x5a854d[_0xe560('0x21')]){delete _0x5a854d[_0xe560('0x21')];}_0x1be932[_0xe560('0x15')](_0x476358)[_0xe560('0x22')](_0x5a854d);};}exports[_0xe560('0x23')]=function(_0x437682,_0x5cd731){var _0x108182={},_0x3fe89e={},_0xf3c53={'count':0x0,'rows':[]};var _0x5e5193=_['map'](db[_0xe560('0x24')][_0xe560('0x25')],function(_0x4b1781){return{'name':_0x4b1781[_0xe560('0x26')],'type':_0x4b1781[_0xe560('0x27')][_0xe560('0x28')]};});_0x3fe89e[_0xe560('0x29')]=_[_0xe560('0x2a')](_0x5e5193,_0xe560('0x21'));_0x3fe89e['query']=_[_0xe560('0x2b')](_0x437682[_0xe560('0x2c')]);_0x3fe89e[_0xe560('0x2d')]=_[_0xe560('0x2e')](_0x3fe89e[_0xe560('0x29')],_0x3fe89e[_0xe560('0x2c')]);_0x108182['attributes']=_[_0xe560('0x2e')](_0x3fe89e['model'],qs['fields'](_0x437682[_0xe560('0x2c')]['fields']));_0x108182['attributes']=_0x108182[_0xe560('0x2f')][_0xe560('0x30')]?_0x108182[_0xe560('0x2f')]:_0x3fe89e['model'];if(!_0x437682[_0xe560('0x2c')][_0xe560('0x31')](_0xe560('0x32'))){_0x108182[_0xe560('0x1a')]=qs['limit'](_0x437682[_0xe560('0x2c')][_0xe560('0x1a')]);_0x108182[_0xe560('0x19')]=qs[_0xe560('0x19')](_0x437682['query'][_0xe560('0x19')]);}_0x108182[_0xe560('0x33')]=qs[_0xe560('0x34')](_0x437682['query'][_0xe560('0x34')]);_0x108182[_0xe560('0x35')]=qs['filters'](_[_0xe560('0x36')](_0x437682[_0xe560('0x2c')],_0x3fe89e['filters']));if(_0x437682[_0xe560('0x2c')]['filter']){_0x108182['where']=_[_0xe560('0x37')](_0x108182[_0xe560('0x35')],{'$or':_[_0xe560('0x2a')](_0x5e5193,function(_0x5d3f01){if(_0x5d3f01[_0xe560('0x27')]!==_0xe560('0x38')){var _0x259bd5={};_0x259bd5[_0x5d3f01['name']]={'$like':'%'+_0x437682[_0xe560('0x2c')]['filter']+'%'};return _0x259bd5;}})});}_0x108182=_[_0xe560('0x37')]({},_0x108182,_0x437682[_0xe560('0x39')]);var _0x483b6c={'where':_0x108182['where']};return db['ChatOfflineMessage']['count'](_0x483b6c)['then'](function(_0x3aaaec){_0xf3c53[_0xe560('0x18')]=_0x3aaaec;if(_0x437682['query'][_0xe560('0x3a')]){_0x108182[_0xe560('0x3b')]=[{'all':!![]}];}return db[_0xe560('0x24')][_0xe560('0x3c')](_0x108182);})[_0xe560('0x1e')](function(_0x154d6d){_0xf3c53[_0xe560('0x3d')]=_0x154d6d;return _0xf3c53;})[_0xe560('0x1e')](respondWithFilteredResult(_0x5cd731,_0x108182))[_0xe560('0x3e')](handleError(_0x5cd731,null));};exports['show']=function(_0x193f2d,_0x4f4af3){var _0xb05bdd={'raw':!![],'where':{'id':_0x193f2d[_0xe560('0x3f')]['id']}},_0x5600c1={};_0x5600c1[_0xe560('0x29')]=_[_0xe560('0x2b')](db['ChatOfflineMessage'][_0xe560('0x25')]);_0x5600c1[_0xe560('0x2c')]=_[_0xe560('0x2b')](_0x193f2d[_0xe560('0x2c')]);_0x5600c1[_0xe560('0x2d')]=_[_0xe560('0x2e')](_0x5600c1[_0xe560('0x29')],_0x5600c1[_0xe560('0x2c')]);_0xb05bdd[_0xe560('0x2f')]=_[_0xe560('0x2e')](_0x5600c1[_0xe560('0x29')],qs[_0xe560('0x40')](_0x193f2d[_0xe560('0x2c')]['fields']));_0xb05bdd[_0xe560('0x2f')]=_0xb05bdd['attributes'][_0xe560('0x30')]?_0xb05bdd[_0xe560('0x2f')]:_0x5600c1['model'];if(_0x193f2d[_0xe560('0x2c')]['includeAll']){_0xb05bdd[_0xe560('0x3b')]=[{'all':!![]}];}_0xb05bdd=_[_0xe560('0x37')]({},_0xb05bdd,_0x193f2d['options']);return db[_0xe560('0x24')][_0xe560('0x41')](_0xb05bdd)['then'](handleEntityNotFound(_0x4f4af3,null))[_0xe560('0x1e')](respondWithResult(_0x4f4af3,null))[_0xe560('0x3e')](handleError(_0x4f4af3,null));};exports[_0xe560('0x42')]=function(_0x1092a4,_0x55302f){return db[_0xe560('0x24')][_0xe560('0x42')](_0x1092a4[_0xe560('0x43')],{})[_0xe560('0x1e')](respondWithResult(_0x55302f,0xc9))[_0xe560('0x3e')](handleError(_0x55302f,null));};exports['update']=function(_0xefa55d,_0x2f6028){if(_0xefa55d[_0xe560('0x43')]['id']){delete _0xefa55d[_0xe560('0x43')]['id'];}return db[_0xe560('0x24')][_0xe560('0x41')]({'where':{'id':_0xefa55d['params']['id']}})[_0xe560('0x1e')](handleEntityNotFound(_0x2f6028,null))[_0xe560('0x1e')](saveUpdates(_0xefa55d[_0xe560('0x43')],null))[_0xe560('0x1e')](respondWithResult(_0x2f6028,null))[_0xe560('0x3e')](handleError(_0x2f6028,null));};exports[_0xe560('0x1f')]=function(_0x4c442f,_0x1c5efc){return db[_0xe560('0x24')][_0xe560('0x41')]({'where':{'id':_0x4c442f[_0xe560('0x3f')]['id']}})[_0xe560('0x1e')](handleEntityNotFound(_0x1c5efc,null))[_0xe560('0x1e')](removeEntity(_0x1c5efc,null))['catch'](handleError(_0x1c5efc,null));};exports[_0xe560('0x44')]=function(_0x4cc831,_0x45a0f5){return db[_0xe560('0x24')][_0xe560('0x44')]()[_0xe560('0x1e')](respondWithResult(_0x45a0f5,null))[_0xe560('0x3e')](handleError(_0x45a0f5,null));}; \ No newline at end of file +var _0x5a36=['merge','VIRTUAL','ChatOfflineMessage','includeAll','findAll','show','params','keys','find','catch','create','body','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','json','count','offset','Content-Range','apply','reject','update','destroy','then','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','nolimit','limit','order','sort','where','pick','filter'];(function(_0xeec31d,_0x189f0c){var _0x5915e1=function(_0x2cf944){while(--_0x2cf944){_0xeec31d['push'](_0xeec31d['shift']());}};_0x5915e1(++_0x189f0c);}(_0x5a36,0xdf));var _0x65a3=function(_0x4f6395,_0x38d77a){_0x4f6395=_0x4f6395-0x0;var _0x13dc86=_0x5a36[_0x4f6395];return _0x13dc86;};'use strict';var pdf=require(_0x65a3('0x0'));var emlformat=require(_0x65a3('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x65a3('0x2'));var jsonpatch=require(_0x65a3('0x3'));var rp=require(_0x65a3('0x4'));var moment=require(_0x65a3('0x5'));var BPromise=require(_0x65a3('0x6'));var Mustache=require(_0x65a3('0x7'));var util=require(_0x65a3('0x8'));var path=require(_0x65a3('0x9'));var sox=require(_0x65a3('0xa'));var csv=require(_0x65a3('0xb'));var ejs=require(_0x65a3('0xc'));var fs=require('fs');var _=require(_0x65a3('0xd'));var squel=require(_0x65a3('0xe'));var crypto=require(_0x65a3('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x65a3('0xb'));var querystring=require(_0x65a3('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x65a3('0x11'));var hardwareService=require(_0x65a3('0x12'));var logger=require(_0x65a3('0x13'))(_0x65a3('0x14'));var utils=require(_0x65a3('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x517420,_0x385953){_0x385953=_0x385953||0xcc;return function(_0x169715){if(_0x169715){return _0x517420[_0x65a3('0x16')](_0x385953);}return _0x517420[_0x65a3('0x17')](_0x385953)['end']();};}function respondWithResult(_0x55dd96,_0x201931){_0x201931=_0x201931||0xc8;return function(_0x4db626){if(_0x4db626){return _0x55dd96['status'](_0x201931)[_0x65a3('0x18')](_0x4db626);}};}function respondWithFilteredResult(_0xe0c6a3,_0x350a7d){return function(_0x4eaa2c){if(_0x4eaa2c){var _0x344a41=_0x4eaa2c[_0x65a3('0x19')],_0x54ffe5=_0x350a7d[_0x65a3('0x1a')],_0x1a0fad=_0x350a7d[_0x65a3('0x1a')]+_0x350a7d['limit'],_0x2a1504;if(_0x1a0fad>=_0x344a41){_0x1a0fad=_0x344a41;_0x2a1504=0xc8;}else{_0x2a1504=0xce;}_0xe0c6a3[_0x65a3('0x17')](_0x2a1504);return _0xe0c6a3['set'](_0x65a3('0x1b'),_0x54ffe5+'-'+_0x1a0fad+'/'+_0x344a41)['json'](_0x4eaa2c);}return null;};}function patchUpdates(_0x4af7a7){return function(_0x35f033){try{jsonpatch[_0x65a3('0x1c')](_0x35f033,_0x4af7a7,!![]);}catch(_0x44f4a8){return BPromise[_0x65a3('0x1d')](_0x44f4a8);}return _0x35f033['save']();};}function saveUpdates(_0x5699fd,_0x184dd0){return function(_0x5d41aa){if(_0x5d41aa){return _0x5d41aa[_0x65a3('0x1e')](_0x5699fd)['then'](function(_0x78eae4){return _0x78eae4;});}return null;};}function removeEntity(_0x4f8403,_0x555006){return function(_0x484df1){if(_0x484df1){return _0x484df1[_0x65a3('0x1f')]()[_0x65a3('0x20')](function(){_0x4f8403[_0x65a3('0x17')](0xcc)[_0x65a3('0x21')]();});}};}function handleEntityNotFound(_0x53e992,_0x53e2d3){return function(_0x5c4fba){if(!_0x5c4fba){_0x53e992[_0x65a3('0x16')](0x194);}return _0x5c4fba;};}function handleError(_0x437d27,_0x39c847){_0x39c847=_0x39c847||0x1f4;return function(_0x20aca0){logger[_0x65a3('0x22')](_0x20aca0[_0x65a3('0x23')]);if(_0x20aca0[_0x65a3('0x24')]){delete _0x20aca0[_0x65a3('0x24')];}_0x437d27[_0x65a3('0x17')](_0x39c847)[_0x65a3('0x25')](_0x20aca0);};}exports[_0x65a3('0x26')]=function(_0x24a556,_0x3dace4){var _0x587847={},_0x29a470={},_0x22b1cf={'count':0x0,'rows':[]};var _0x2f9cd2=_[_0x65a3('0x27')](db['ChatOfflineMessage'][_0x65a3('0x28')],function(_0x5bdaa2){return{'name':_0x5bdaa2[_0x65a3('0x29')],'type':_0x5bdaa2[_0x65a3('0x2a')][_0x65a3('0x2b')]};});_0x29a470[_0x65a3('0x2c')]=_['map'](_0x2f9cd2,_0x65a3('0x24'));_0x29a470[_0x65a3('0x2d')]=_['keys'](_0x24a556[_0x65a3('0x2d')]);_0x29a470[_0x65a3('0x2e')]=_['intersection'](_0x29a470[_0x65a3('0x2c')],_0x29a470[_0x65a3('0x2d')]);_0x587847[_0x65a3('0x2f')]=_[_0x65a3('0x30')](_0x29a470[_0x65a3('0x2c')],qs['fields'](_0x24a556[_0x65a3('0x2d')][_0x65a3('0x31')]));_0x587847[_0x65a3('0x2f')]=_0x587847['attributes']['length']?_0x587847[_0x65a3('0x2f')]:_0x29a470[_0x65a3('0x2c')];if(!_0x24a556[_0x65a3('0x2d')]['hasOwnProperty'](_0x65a3('0x32'))){_0x587847[_0x65a3('0x33')]=qs[_0x65a3('0x33')](_0x24a556[_0x65a3('0x2d')][_0x65a3('0x33')]);_0x587847[_0x65a3('0x1a')]=qs[_0x65a3('0x1a')](_0x24a556[_0x65a3('0x2d')][_0x65a3('0x1a')]);}_0x587847[_0x65a3('0x34')]=qs[_0x65a3('0x35')](_0x24a556[_0x65a3('0x2d')][_0x65a3('0x35')]);_0x587847[_0x65a3('0x36')]=qs[_0x65a3('0x2e')](_[_0x65a3('0x37')](_0x24a556[_0x65a3('0x2d')],_0x29a470[_0x65a3('0x2e')]));if(_0x24a556[_0x65a3('0x2d')][_0x65a3('0x38')]){_0x587847['where']=_[_0x65a3('0x39')](_0x587847[_0x65a3('0x36')],{'$or':_[_0x65a3('0x27')](_0x2f9cd2,function(_0x3341c7){if(_0x3341c7[_0x65a3('0x2a')]!==_0x65a3('0x3a')){var _0x38c847={};_0x38c847[_0x3341c7[_0x65a3('0x24')]]={'$like':'%'+_0x24a556[_0x65a3('0x2d')]['filter']+'%'};return _0x38c847;}})});}_0x587847=_[_0x65a3('0x39')]({},_0x587847,_0x24a556['options']);var _0x18e5cf={'where':_0x587847['where']};return db[_0x65a3('0x3b')]['count'](_0x18e5cf)[_0x65a3('0x20')](function(_0x212026){_0x22b1cf['count']=_0x212026;if(_0x24a556[_0x65a3('0x2d')][_0x65a3('0x3c')]){_0x587847['include']=[{'all':!![]}];}return db['ChatOfflineMessage'][_0x65a3('0x3d')](_0x587847);})['then'](function(_0x68e68c){_0x22b1cf['rows']=_0x68e68c;return _0x22b1cf;})[_0x65a3('0x20')](respondWithFilteredResult(_0x3dace4,_0x587847))['catch'](handleError(_0x3dace4,null));};exports[_0x65a3('0x3e')]=function(_0x114a46,_0x4882bb){var _0x24422b={'raw':!![],'where':{'id':_0x114a46[_0x65a3('0x3f')]['id']}},_0x533c10={};_0x533c10['model']=_[_0x65a3('0x40')](db[_0x65a3('0x3b')]['rawAttributes']);_0x533c10[_0x65a3('0x2d')]=_[_0x65a3('0x40')](_0x114a46[_0x65a3('0x2d')]);_0x533c10['filters']=_[_0x65a3('0x30')](_0x533c10[_0x65a3('0x2c')],_0x533c10[_0x65a3('0x2d')]);_0x24422b[_0x65a3('0x2f')]=_['intersection'](_0x533c10['model'],qs[_0x65a3('0x31')](_0x114a46['query'][_0x65a3('0x31')]));_0x24422b[_0x65a3('0x2f')]=_0x24422b['attributes']['length']?_0x24422b[_0x65a3('0x2f')]:_0x533c10['model'];if(_0x114a46[_0x65a3('0x2d')][_0x65a3('0x3c')]){_0x24422b['include']=[{'all':!![]}];}_0x24422b=_[_0x65a3('0x39')]({},_0x24422b,_0x114a46['options']);return db[_0x65a3('0x3b')][_0x65a3('0x41')](_0x24422b)[_0x65a3('0x20')](handleEntityNotFound(_0x4882bb,null))[_0x65a3('0x20')](respondWithResult(_0x4882bb,null))[_0x65a3('0x42')](handleError(_0x4882bb,null));};exports[_0x65a3('0x43')]=function(_0x5840f7,_0x3953cd){return db[_0x65a3('0x3b')][_0x65a3('0x43')](_0x5840f7['body'],{})['then'](respondWithResult(_0x3953cd,0xc9))[_0x65a3('0x42')](handleError(_0x3953cd,null));};exports[_0x65a3('0x1e')]=function(_0x200e31,_0x7b8196){if(_0x200e31['body']['id']){delete _0x200e31[_0x65a3('0x44')]['id'];}return db[_0x65a3('0x3b')]['find']({'where':{'id':_0x200e31[_0x65a3('0x3f')]['id']}})[_0x65a3('0x20')](handleEntityNotFound(_0x7b8196,null))[_0x65a3('0x20')](saveUpdates(_0x200e31[_0x65a3('0x44')],null))[_0x65a3('0x20')](respondWithResult(_0x7b8196,null))[_0x65a3('0x42')](handleError(_0x7b8196,null));};exports[_0x65a3('0x1f')]=function(_0x2034bd,_0x5174b7){return db[_0x65a3('0x3b')][_0x65a3('0x41')]({'where':{'id':_0x2034bd['params']['id']}})[_0x65a3('0x20')](handleEntityNotFound(_0x5174b7,null))['then'](removeEntity(_0x5174b7,null))[_0x65a3('0x42')](handleError(_0x5174b7,null));};exports[_0x65a3('0x45')]=function(_0x16f0b0,_0x1f8223){return db[_0x65a3('0x3b')]['describe']()[_0x65a3('0x20')](respondWithResult(_0x1f8223,null))[_0x65a3('0x42')](handleError(_0x1f8223,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 3b0b584..c6ea00d 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 _0xb66c=['rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x5756f8,_0x22b6d5){var _0x3bb749=function(_0x332204){while(--_0x332204){_0x5756f8['push'](_0x5756f8['shift']());}};_0x3bb749(++_0x22b6d5);}(_0xb66c,0x175));var _0xcb66=function(_0x1b1155,_0xd77c34){_0x1b1155=_0x1b1155-0x0;var _0x3b3560=_0xb66c[_0x1b1155];return _0x3b3560;};'use strict';var _=require(_0xcb66('0x0'));var util=require('util');var logger=require(_0xcb66('0x1'))('api');var moment=require(_0xcb66('0x2'));var BPromise=require(_0xcb66('0x3'));var rp=require(_0xcb66('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcb66('0x5'));var config=require(_0xcb66('0x6'));var attributes=require(_0xcb66('0x7'));module[_0xcb66('0x8')]=function(_0x5d766d,_0x518163){return _0x5d766d[_0xcb66('0x9')](_0xcb66('0xa'),attributes,{'tableName':_0xcb66('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcb66('0xc'),'collate':_0xcb66('0xd')});}; \ No newline at end of file +var _0x0b78=['moment','request-promise','rimraf','../../config/environment','./chatOfflineMessage.attributes','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','api'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x0b78,0x1ad));var _0x80b7=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x0b78[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x80b7('0x0'));var util=require(_0x80b7('0x1'));var logger=require('../../config/logger')(_0x80b7('0x2'));var moment=require(_0x80b7('0x3'));var BPromise=require('bluebird');var rp=require(_0x80b7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x80b7('0x5'));var config=require(_0x80b7('0x6'));var attributes=require(_0x80b7('0x7'));module['exports']=function(_0x49bc7f,_0x167ddd){return _0x49bc7f['define'](_0x80b7('0x8'),attributes,{'tableName':_0x80b7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x80b7('0xa'),'collate':_0x80b7('0xb')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index f2a96c5..7601a4e 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 _0xd6a4=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','http','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0xd6a4,0x16b));var _0x4d6a=function(_0x262ce1,_0x2fc207){_0x262ce1=_0x262ce1-0x0;var _0x3fa271=_0xd6a4[_0x262ce1];return _0x3fa271;};'use strict';var _=require(_0x4d6a('0x0'));var util=require(_0x4d6a('0x1'));var moment=require(_0x4d6a('0x2'));var BPromise=require(_0x4d6a('0x3'));var rs=require(_0x4d6a('0x4'));var fs=require('fs');var Redis=require(_0x4d6a('0x5'));var db=require(_0x4d6a('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4d6a('0x7'));var config=require(_0x4d6a('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4d6a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x104575,_0x30dfab,_0x13af9e){return new BPromise(function(_0x4ed4be,_0x5702d3){return client['request'](_0x104575,_0x13af9e)[_0x4d6a('0xa')](function(_0x5a3ac1){logger[_0x4d6a('0xb')](_0x4d6a('0xc'),_0x30dfab,_0x4d6a('0xd'));logger['debug'](_0x4d6a('0xe'),_0x30dfab,_0x4d6a('0xd'),JSON[_0x4d6a('0xf')](_0x5a3ac1));if(_0x5a3ac1[_0x4d6a('0x10')]){if(_0x5a3ac1[_0x4d6a('0x10')][_0x4d6a('0x11')]===0x1f4){logger[_0x4d6a('0x10')](_0x4d6a('0xc'),_0x30dfab,_0x5a3ac1['error']['message']);return _0x5702d3(_0x5a3ac1['error']['message']);}logger[_0x4d6a('0x10')](_0x4d6a('0xc'),_0x30dfab,_0x5a3ac1[_0x4d6a('0x10')]['message']);return _0x4ed4be(_0x5a3ac1[_0x4d6a('0x10')][_0x4d6a('0x12')]);}else{logger[_0x4d6a('0xb')](_0x4d6a('0xc'),_0x30dfab,'request\x20sent');_0x4ed4be(_0x5a3ac1[_0x4d6a('0x13')]['message']);}})[_0x4d6a('0x14')](function(_0x5bfdfe){logger[_0x4d6a('0x10')](_0x4d6a('0xc'),_0x30dfab,_0x5bfdfe);_0x5702d3(_0x5bfdfe);});});} \ No newline at end of file +var _0x89c0=['ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','http','request','then','info'];(function(_0x13d905,_0x4093f6){var _0x308b2f=function(_0x2baa70){while(--_0x2baa70){_0x13d905['push'](_0x13d905['shift']());}};_0x308b2f(++_0x4093f6);}(_0x89c0,0x1cf));var _0x089c=function(_0x47401f,_0xc27378){_0x47401f=_0x47401f-0x0;var _0xf605a7=_0x89c0[_0x47401f];return _0xf605a7;};'use strict';var _=require(_0x089c('0x0'));var util=require(_0x089c('0x1'));var moment=require(_0x089c('0x2'));var BPromise=require(_0x089c('0x3'));var rs=require(_0x089c('0x4'));var fs=require('fs');var Redis=require(_0x089c('0x5'));var db=require(_0x089c('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x089c('0x7'));var client=jayson['client'][_0x089c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x479936,_0x4ef6bf,_0x56508c){return new BPromise(function(_0x5417b0,_0x5cedf5){return client[_0x089c('0x9')](_0x479936,_0x56508c)[_0x089c('0xa')](function(_0x3e6c8f){logger[_0x089c('0xb')](_0x089c('0xc'),_0x4ef6bf,_0x089c('0xd'));logger[_0x089c('0xe')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x4ef6bf,'request\x20sent',JSON['stringify'](_0x3e6c8f));if(_0x3e6c8f[_0x089c('0xf')]){if(_0x3e6c8f['error'][_0x089c('0x10')]===0x1f4){logger[_0x089c('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x4ef6bf,_0x3e6c8f[_0x089c('0xf')][_0x089c('0x11')]);return _0x5cedf5(_0x3e6c8f[_0x089c('0xf')][_0x089c('0x11')]);}logger[_0x089c('0xf')](_0x089c('0xc'),_0x4ef6bf,_0x3e6c8f[_0x089c('0xf')][_0x089c('0x11')]);return _0x5417b0(_0x3e6c8f[_0x089c('0xf')]['message']);}else{logger['info'](_0x089c('0xc'),_0x4ef6bf,_0x089c('0xd'));_0x5417b0(_0x3e6c8f[_0x089c('0x12')][_0x089c('0x11')]);}})['catch'](function(_0x3033d2){logger[_0x089c('0xf')](_0x089c('0xc'),_0x4ef6bf,_0x3033d2);_0x5cedf5(_0x3033d2);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index f1931df..b919446 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 _0x19b0=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','show','post','create','put','/:id','update'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0x19b0,0xab));var _0x019b=function(_0x5cdade,_0x5b3249){_0x5cdade=_0x5cdade-0x0;var _0x1dda82=_0x19b0[_0x5cdade];return _0x1dda82;};'use strict';var multer=require(_0x019b('0x0'));var util=require(_0x019b('0x1'));var path=require(_0x019b('0x2'));var timeout=require(_0x019b('0x3'));var express=require(_0x019b('0x4'));var router=express[_0x019b('0x5')]();var auth=require(_0x019b('0x6'));var interaction=require(_0x019b('0x7'));var config=require('../../config/environment');var controller=require('./chatOfflineMessage.controller');router['get']('/',auth[_0x019b('0x8')](),controller[_0x019b('0x9')]);router[_0x019b('0xa')](_0x019b('0xb'),auth[_0x019b('0x8')](),controller['describe']);router[_0x019b('0xa')]('/:id',auth[_0x019b('0x8')](),controller[_0x019b('0xc')]);router[_0x019b('0xd')]('/',auth[_0x019b('0x8')](),controller[_0x019b('0xe')]);router[_0x019b('0xf')](_0x019b('0x10'),auth['isAuthenticated'](),controller[_0x019b('0x11')]);router[_0x019b('0x12')](_0x019b('0x10'),auth[_0x019b('0x8')](),controller[_0x019b('0x13')]);module[_0x019b('0x14')]=router; \ No newline at end of file +var _0xe1a8=['util','connect-timeout','Router','../../components/auth/service','./chatOfflineMessage.controller','get','index','isAuthenticated','describe','/:id','show','post','update','delete','destroy','multer'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xe1a8,0x16f));var _0x8e1a=function(_0x571fcb,_0x584df0){_0x571fcb=_0x571fcb-0x0;var _0x199cc5=_0xe1a8[_0x571fcb];return _0x199cc5;};'use strict';var multer=require(_0x8e1a('0x0'));var util=require(_0x8e1a('0x1'));var path=require('path');var timeout=require(_0x8e1a('0x2'));var express=require('express');var router=express[_0x8e1a('0x3')]();var auth=require(_0x8e1a('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8e1a('0x5'));router[_0x8e1a('0x6')]('/',auth['isAuthenticated'](),controller[_0x8e1a('0x7')]);router[_0x8e1a('0x6')]('/describe',auth[_0x8e1a('0x8')](),controller[_0x8e1a('0x9')]);router[_0x8e1a('0x6')](_0x8e1a('0xa'),auth['isAuthenticated'](),controller[_0x8e1a('0xb')]);router[_0x8e1a('0xc')]('/',auth[_0x8e1a('0x8')](),controller['create']);router['put']('/:id',auth[_0x8e1a('0x8')](),controller[_0x8e1a('0xd')]);router[_0x8e1a('0xe')]('/:id',auth[_0x8e1a('0x8')](),controller[_0x8e1a('0xf')]);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 0e22e07..1d4cf72 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 _0xe04c=['sequelize','exports','STRING','mouseOver','timeout','INTEGER'];(function(_0x173c14,_0x10fa24){var _0x4c4c39=function(_0x25f74f){while(--_0x25f74f){_0x173c14['push'](_0x173c14['shift']());}};_0x4c4c39(++_0x10fa24);}(_0xe04c,0xe4));var _0xce04=function(_0x16c6ef,_0x3e2d14){_0x16c6ef=_0x16c6ef-0x0;var _0x205a05=_0xe04c[_0x16c6ef];return _0x205a05;};'use strict';var Sequelize=require(_0xce04('0x0'));module[_0xce04('0x1')]={'name':{'type':Sequelize[_0xce04('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xce04('0x3'),_0xce04('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xce04('0x2')]},'timeout':{'type':Sequelize[_0xce04('0x5')]}}; \ No newline at end of file +var _0xaf03=['sequelize','STRING','ENUM','mouseOver','timeout','INTEGER'];(function(_0x149faa,_0x4633ba){var _0x482973=function(_0x586e47){while(--_0x586e47){_0x149faa['push'](_0x149faa['shift']());}};_0x482973(++_0x4633ba);}(_0xaf03,0xe4));var _0x3af0=function(_0x57460d,_0xe6d524){_0x57460d=_0x57460d-0x0;var _0x5695dd=_0xaf03[_0x57460d];return _0x5695dd;};'use strict';var Sequelize=require(_0x3af0('0x0'));module['exports']={'name':{'type':Sequelize[_0x3af0('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x3af0('0x2')](_0x3af0('0x3'),_0x3af0('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x3af0('0x1')]},'timeout':{'type':Sequelize[_0x3af0('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 4a67aa6..d6b4b68 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 _0xedd9=['offset','limit','Content-Range','reject','update','then','destroy','error','stack','send','show','params','model','keys','rawAttributes','query','intersection','attributes','fields','length','include','merge','options','find','catch','create','ChatProactiveAction','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0xedd9,0xfc));var _0x9edd=function(_0xafa7eb,_0x39a0c5){_0xafa7eb=_0xafa7eb-0x0;var _0x571ddc=_0xedd9[_0xafa7eb];return _0x571ddc;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9edd('0x0'));var rimraf=require(_0x9edd('0x1'));var zipdir=require(_0x9edd('0x2'));var jsonpatch=require(_0x9edd('0x3'));var rp=require(_0x9edd('0x4'));var moment=require(_0x9edd('0x5'));var BPromise=require(_0x9edd('0x6'));var Mustache=require(_0x9edd('0x7'));var util=require('util');var path=require(_0x9edd('0x8'));var sox=require(_0x9edd('0x9'));var csv=require(_0x9edd('0xa'));var ejs=require(_0x9edd('0xb'));var fs=require('fs');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('0xa'));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 db=require(_0x9edd('0x16'))['db'];function respondWithStatusCode(_0x25e64c,_0xfd544a){_0xfd544a=_0xfd544a||0xcc;return function(_0x287ddd){if(_0x287ddd){return _0x25e64c[_0x9edd('0x17')](_0xfd544a);}return _0x25e64c[_0x9edd('0x18')](_0xfd544a)[_0x9edd('0x19')]();};}function respondWithResult(_0x47eb64,_0x176bfa){_0x176bfa=_0x176bfa||0xc8;return function(_0x44fc7c){if(_0x44fc7c){return _0x47eb64[_0x9edd('0x18')](_0x176bfa)[_0x9edd('0x1a')](_0x44fc7c);}};}function respondWithFilteredResult(_0x13b6b6,_0x338f3c){return function(_0x1042aa){if(_0x1042aa){var _0x75a4ab=_0x1042aa[_0x9edd('0x1b')],_0x4ea60f=_0x338f3c['offset'],_0x5f5bf4=_0x338f3c[_0x9edd('0x1c')]+_0x338f3c[_0x9edd('0x1d')],_0x448996;if(_0x5f5bf4>=_0x75a4ab){_0x5f5bf4=_0x75a4ab;_0x448996=0xc8;}else{_0x448996=0xce;}_0x13b6b6[_0x9edd('0x18')](_0x448996);return _0x13b6b6['set'](_0x9edd('0x1e'),_0x4ea60f+'-'+_0x5f5bf4+'/'+_0x75a4ab)['json'](_0x1042aa);}return null;};}function patchUpdates(_0x2cdcef){return function(_0x1083e4){try{jsonpatch['apply'](_0x1083e4,_0x2cdcef,!![]);}catch(_0x498977){return BPromise[_0x9edd('0x1f')](_0x498977);}return _0x1083e4['save']();};}function saveUpdates(_0x27a95a,_0x54a03f){return function(_0x535f37){if(_0x535f37){return _0x535f37[_0x9edd('0x20')](_0x27a95a)[_0x9edd('0x21')](function(_0x4fb7bf){return _0x4fb7bf;});}return null;};}function removeEntity(_0x5823bc,_0x341d67){return function(_0x186186){if(_0x186186){return _0x186186[_0x9edd('0x22')]()['then'](function(){_0x5823bc[_0x9edd('0x18')](0xcc)[_0x9edd('0x19')]();});}};}function handleEntityNotFound(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(!_0x339a0d){_0x44a6c1['sendStatus'](0x194);}return _0x339a0d;};}function handleError(_0x46c383,_0xeaf55a){_0xeaf55a=_0xeaf55a||0x1f4;return function(_0x3a1ea5){logger[_0x9edd('0x23')](_0x3a1ea5[_0x9edd('0x24')]);if(_0x3a1ea5['name']){delete _0x3a1ea5['name'];}_0x46c383[_0x9edd('0x18')](_0xeaf55a)[_0x9edd('0x25')](_0x3a1ea5);};}exports[_0x9edd('0x26')]=function(_0x25e135,_0x3c2227){var _0x4fe471={'raw':!![],'where':{'id':_0x25e135[_0x9edd('0x27')]['id']}},_0x57a2cc={};_0x57a2cc[_0x9edd('0x28')]=_[_0x9edd('0x29')](db['ChatProactiveAction'][_0x9edd('0x2a')]);_0x57a2cc[_0x9edd('0x2b')]=_[_0x9edd('0x29')](_0x25e135[_0x9edd('0x2b')]);_0x57a2cc['filters']=_[_0x9edd('0x2c')](_0x57a2cc[_0x9edd('0x28')],_0x57a2cc[_0x9edd('0x2b')]);_0x4fe471[_0x9edd('0x2d')]=_[_0x9edd('0x2c')](_0x57a2cc[_0x9edd('0x28')],qs[_0x9edd('0x2e')](_0x25e135[_0x9edd('0x2b')][_0x9edd('0x2e')]));_0x4fe471[_0x9edd('0x2d')]=_0x4fe471[_0x9edd('0x2d')][_0x9edd('0x2f')]?_0x4fe471[_0x9edd('0x2d')]:_0x57a2cc[_0x9edd('0x28')];if(_0x25e135[_0x9edd('0x2b')]['includeAll']){_0x4fe471[_0x9edd('0x30')]=[{'all':!![]}];}_0x4fe471=_[_0x9edd('0x31')]({},_0x4fe471,_0x25e135[_0x9edd('0x32')]);return db['ChatProactiveAction'][_0x9edd('0x33')](_0x4fe471)[_0x9edd('0x21')](handleEntityNotFound(_0x3c2227,null))[_0x9edd('0x21')](respondWithResult(_0x3c2227,null))[_0x9edd('0x34')](handleError(_0x3c2227,null));};exports[_0x9edd('0x35')]=function(_0x2bc4ed,_0x473068){return db[_0x9edd('0x36')][_0x9edd('0x35')](_0x2bc4ed[_0x9edd('0x37')],{})[_0x9edd('0x21')](respondWithResult(_0x473068,0xc9))[_0x9edd('0x34')](handleError(_0x473068,null));};exports[_0x9edd('0x20')]=function(_0x14f780,_0x5757fc){if(_0x14f780[_0x9edd('0x37')]['id']){delete _0x14f780['body']['id'];}return db[_0x9edd('0x36')][_0x9edd('0x33')]({'where':{'id':_0x14f780[_0x9edd('0x27')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x5757fc,null))[_0x9edd('0x21')](saveUpdates(_0x14f780['body'],null))[_0x9edd('0x21')](respondWithResult(_0x5757fc,null))[_0x9edd('0x34')](handleError(_0x5757fc,null));};exports[_0x9edd('0x22')]=function(_0x38e9be,_0x1be77f){return db[_0x9edd('0x36')][_0x9edd('0x33')]({'where':{'id':_0x38e9be[_0x9edd('0x27')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x1be77f,null))[_0x9edd('0x21')](removeEntity(_0x1be77f,null))['catch'](handleError(_0x1be77f,null));}; \ No newline at end of file +var _0xe706=['../../config/environment','../../mysqldb','sendStatus','status','end','count','limit','set','Content-Range','apply','reject','save','update','then','stack','name','send','show','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','merge','options','find','catch','create','ChatProactiveAction','body','destroy','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x4bfc7e,_0x3d9ebe){var _0x49b522=function(_0x10f8bd){while(--_0x10f8bd){_0x4bfc7e['push'](_0x4bfc7e['shift']());}};_0x49b522(++_0x3d9ebe);}(_0xe706,0xa3));var _0x6e70=function(_0x506d83,_0x1899e9){_0x506d83=_0x506d83-0x0;var _0x335e8b=_0xe706[_0x506d83];return _0x335e8b;};'use strict';var pdf=require(_0x6e70('0x0'));var emlformat=require(_0x6e70('0x1'));var rimraf=require(_0x6e70('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6e70('0x3'));var rp=require(_0x6e70('0x4'));var moment=require(_0x6e70('0x5'));var BPromise=require(_0x6e70('0x6'));var Mustache=require(_0x6e70('0x7'));var util=require(_0x6e70('0x8'));var path=require(_0x6e70('0x9'));var sox=require(_0x6e70('0xa'));var csv=require(_0x6e70('0xb'));var ejs=require(_0x6e70('0xc'));var fs=require('fs');var _=require(_0x6e70('0xd'));var squel=require(_0x6e70('0xe'));var crypto=require(_0x6e70('0xf'));var jsforce=require(_0x6e70('0x10'));var deskjs=require(_0x6e70('0x11'));var toCsv=require(_0x6e70('0xb'));var querystring=require(_0x6e70('0x12'));var Papa=require(_0x6e70('0x13'));var Redis=require(_0x6e70('0x14'));var authService=require(_0x6e70('0x15'));var qs=require(_0x6e70('0x16'));var as=require(_0x6e70('0x17'));var hardwareService=require(_0x6e70('0x18'));var logger=require(_0x6e70('0x19'))('api');var utils=require('../../config/utils');var config=require(_0x6e70('0x1a'));var db=require(_0x6e70('0x1b'))['db'];function respondWithStatusCode(_0x18cf27,_0x27dd9b){_0x27dd9b=_0x27dd9b||0xcc;return function(_0x3b38f3){if(_0x3b38f3){return _0x18cf27[_0x6e70('0x1c')](_0x27dd9b);}return _0x18cf27[_0x6e70('0x1d')](_0x27dd9b)[_0x6e70('0x1e')]();};}function respondWithResult(_0x5dfbaa,_0x52737e){_0x52737e=_0x52737e||0xc8;return function(_0x48bc72){if(_0x48bc72){return _0x5dfbaa[_0x6e70('0x1d')](_0x52737e)['json'](_0x48bc72);}};}function respondWithFilteredResult(_0x53aed0,_0x304716){return function(_0x22c50c){if(_0x22c50c){var _0x5d9263=_0x22c50c[_0x6e70('0x1f')],_0x24f3ac=_0x304716['offset'],_0x5c3fe7=_0x304716['offset']+_0x304716[_0x6e70('0x20')],_0x2efc0f;if(_0x5c3fe7>=_0x5d9263){_0x5c3fe7=_0x5d9263;_0x2efc0f=0xc8;}else{_0x2efc0f=0xce;}_0x53aed0['status'](_0x2efc0f);return _0x53aed0[_0x6e70('0x21')](_0x6e70('0x22'),_0x24f3ac+'-'+_0x5c3fe7+'/'+_0x5d9263)['json'](_0x22c50c);}return null;};}function patchUpdates(_0x497d61){return function(_0xc238ba){try{jsonpatch[_0x6e70('0x23')](_0xc238ba,_0x497d61,!![]);}catch(_0x2368eb){return BPromise[_0x6e70('0x24')](_0x2368eb);}return _0xc238ba[_0x6e70('0x25')]();};}function saveUpdates(_0xcdf9f2,_0x1b2453){return function(_0x44a49f){if(_0x44a49f){return _0x44a49f[_0x6e70('0x26')](_0xcdf9f2)[_0x6e70('0x27')](function(_0x4a0cfe){return _0x4a0cfe;});}return null;};}function removeEntity(_0x228350,_0x344b65){return function(_0x27b294){if(_0x27b294){return _0x27b294['destroy']()[_0x6e70('0x27')](function(){_0x228350[_0x6e70('0x1d')](0xcc)[_0x6e70('0x1e')]();});}};}function handleEntityNotFound(_0x50da2c,_0x10fc91){return function(_0x538b9c){if(!_0x538b9c){_0x50da2c['sendStatus'](0x194);}return _0x538b9c;};}function handleError(_0x4e97c7,_0x41e352){_0x41e352=_0x41e352||0x1f4;return function(_0x19c5ae){logger['error'](_0x19c5ae[_0x6e70('0x28')]);if(_0x19c5ae[_0x6e70('0x29')]){delete _0x19c5ae['name'];}_0x4e97c7[_0x6e70('0x1d')](_0x41e352)[_0x6e70('0x2a')](_0x19c5ae);};}exports[_0x6e70('0x2b')]=function(_0x4a67ac,_0x54a5fe){var _0x2c4d37={'raw':!![],'where':{'id':_0x4a67ac[_0x6e70('0x2c')]['id']}},_0x3af17f={};_0x3af17f[_0x6e70('0x2d')]=_[_0x6e70('0x2e')](db['ChatProactiveAction'][_0x6e70('0x2f')]);_0x3af17f[_0x6e70('0x30')]=_[_0x6e70('0x2e')](_0x4a67ac[_0x6e70('0x30')]);_0x3af17f[_0x6e70('0x31')]=_[_0x6e70('0x32')](_0x3af17f[_0x6e70('0x2d')],_0x3af17f[_0x6e70('0x30')]);_0x2c4d37[_0x6e70('0x33')]=_[_0x6e70('0x32')](_0x3af17f['model'],qs[_0x6e70('0x34')](_0x4a67ac['query'][_0x6e70('0x34')]));_0x2c4d37['attributes']=_0x2c4d37[_0x6e70('0x33')][_0x6e70('0x35')]?_0x2c4d37[_0x6e70('0x33')]:_0x3af17f['model'];if(_0x4a67ac[_0x6e70('0x30')][_0x6e70('0x36')]){_0x2c4d37['include']=[{'all':!![]}];}_0x2c4d37=_[_0x6e70('0x37')]({},_0x2c4d37,_0x4a67ac[_0x6e70('0x38')]);return db['ChatProactiveAction'][_0x6e70('0x39')](_0x2c4d37)[_0x6e70('0x27')](handleEntityNotFound(_0x54a5fe,null))[_0x6e70('0x27')](respondWithResult(_0x54a5fe,null))[_0x6e70('0x3a')](handleError(_0x54a5fe,null));};exports[_0x6e70('0x3b')]=function(_0x1e3e76,_0x44b19d){return db[_0x6e70('0x3c')][_0x6e70('0x3b')](_0x1e3e76[_0x6e70('0x3d')],{})['then'](respondWithResult(_0x44b19d,0xc9))[_0x6e70('0x3a')](handleError(_0x44b19d,null));};exports['update']=function(_0x23cd1a,_0x3222a2){if(_0x23cd1a[_0x6e70('0x3d')]['id']){delete _0x23cd1a[_0x6e70('0x3d')]['id'];}return db[_0x6e70('0x3c')][_0x6e70('0x39')]({'where':{'id':_0x23cd1a[_0x6e70('0x2c')]['id']}})[_0x6e70('0x27')](handleEntityNotFound(_0x3222a2,null))[_0x6e70('0x27')](saveUpdates(_0x23cd1a[_0x6e70('0x3d')],null))[_0x6e70('0x27')](respondWithResult(_0x3222a2,null))[_0x6e70('0x3a')](handleError(_0x3222a2,null));};exports[_0x6e70('0x3e')]=function(_0x501b53,_0x5446a2){return db['ChatProactiveAction'][_0x6e70('0x39')]({'where':{'id':_0x501b53[_0x6e70('0x2c')]['id']}})[_0x6e70('0x27')](handleEntityNotFound(_0x5446a2,null))[_0x6e70('0x27')](removeEntity(_0x5446a2,null))[_0x6e70('0x3a')](handleError(_0x5446a2,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 91d8659..46132a5 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 _0x73cd=['rimraf','./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions','lodash','util','api','bluebird','request-promise','path'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x73cd,0x1e9));var _0xd73c=function(_0x2d284c,_0x59aa64){_0x2d284c=_0x2d284c-0x0;var _0x4f5756=_0x73cd[_0x2d284c];return _0x4f5756;};'use strict';var _=require(_0xd73c('0x0'));var util=require(_0xd73c('0x1'));var logger=require('../../config/logger')(_0xd73c('0x2'));var moment=require('moment');var BPromise=require(_0xd73c('0x3'));var rp=require(_0xd73c('0x4'));var fs=require('fs');var path=require(_0xd73c('0x5'));var rimraf=require(_0xd73c('0x6'));var config=require('../../config/environment');var attributes=require(_0xd73c('0x7'));module['exports']=function(_0x3da765,_0x8ce911){return _0x3da765[_0xd73c('0x8')](_0xd73c('0x9'),attributes,{'tableName':_0xd73c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd065=['exports','define','ChatProactiveAction','chat_proactive_actions','util','api','moment','request-promise','rimraf','../../config/environment','./chatProactiveAction.attributes'];(function(_0x43fe36,_0x3ae12b){var _0x4c44cf=function(_0x145f4f){while(--_0x145f4f){_0x43fe36['push'](_0x43fe36['shift']());}};_0x4c44cf(++_0x3ae12b);}(_0xd065,0x7d));var _0x5d06=function(_0x526f8c,_0x53ffb4){_0x526f8c=_0x526f8c-0x0;var _0x562771=_0xd065[_0x526f8c];return _0x562771;};'use strict';var _=require('lodash');var util=require(_0x5d06('0x0'));var logger=require('../../config/logger')(_0x5d06('0x1'));var moment=require(_0x5d06('0x2'));var BPromise=require('bluebird');var rp=require(_0x5d06('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5d06('0x4'));var config=require(_0x5d06('0x5'));var attributes=require(_0x5d06('0x6'));module[_0x5d06('0x7')]=function(_0x300e52,_0x438971){return _0x300e52[_0x5d06('0x8')](_0x5d06('0x9'),attributes,{'tableName':_0x5d06('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index 7e5823d..dd9f629 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 _0xa96e=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','message','info','lodash','util','bluebird','randomstring','ioredis'];(function(_0x3f70cd,_0x6bf4ed){var _0x3feb93=function(_0x4a045a){while(--_0x4a045a){_0x3f70cd['push'](_0x3f70cd['shift']());}};_0x3feb93(++_0x6bf4ed);}(_0xa96e,0x19d));var _0xea96=function(_0xcb6102,_0x301ddf){_0xcb6102=_0xcb6102-0x0;var _0x199b52=_0xa96e[_0xcb6102];return _0x199b52;};'use strict';var _=require(_0xea96('0x0'));var util=require(_0xea96('0x1'));var moment=require('moment');var BPromise=require(_0xea96('0x2'));var rs=require(_0xea96('0x3'));var fs=require('fs');var Redis=require(_0xea96('0x4'));var db=require(_0xea96('0x5'))['db'];var utils=require(_0xea96('0x6'));var logger=require('../../config/logger')(_0xea96('0x7'));var config=require(_0xea96('0x8'));var jayson=require(_0xea96('0x9'));var client=jayson[_0xea96('0xa')][_0xea96('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ca873,_0x2833a0,_0x581ed3){return new BPromise(function(_0x1e2dcf,_0xfa4aef){return client[_0xea96('0xc')](_0x3ca873,_0x581ed3)[_0xea96('0xd')](function(_0x3768e2){logger['info'](_0xea96('0xe'),_0x2833a0,_0xea96('0xf'));logger[_0xea96('0x10')](_0xea96('0x11'),_0x2833a0,_0xea96('0xf'),JSON[_0xea96('0x12')](_0x3768e2));if(_0x3768e2[_0xea96('0x13')]){if(_0x3768e2[_0xea96('0x13')]['code']===0x1f4){logger['error'](_0xea96('0xe'),_0x2833a0,_0x3768e2['error'][_0xea96('0x14')]);return _0xfa4aef(_0x3768e2['error'][_0xea96('0x14')]);}logger[_0xea96('0x13')]('ChatProactiveAction,\x20%s,\x20%s',_0x2833a0,_0x3768e2[_0xea96('0x13')][_0xea96('0x14')]);return _0x1e2dcf(_0x3768e2[_0xea96('0x13')][_0xea96('0x14')]);}else{logger[_0xea96('0x15')](_0xea96('0xe'),_0x2833a0,'request\x20sent');_0x1e2dcf(_0x3768e2['result'][_0xea96('0x14')]);}})['catch'](function(_0x55780c){logger[_0xea96('0x13')]('ChatProactiveAction,\x20%s,\x20%s',_0x2833a0,_0x55780c);_0xfa4aef(_0x55780c);});});} \ No newline at end of file +var _0xa982=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x35036f,_0x13058e){var _0x2a94a2=function(_0x446447){while(--_0x446447){_0x35036f['push'](_0x35036f['shift']());}};_0x2a94a2(++_0x13058e);}(_0xa982,0x18f));var _0x2a98=function(_0x54fbff,_0x53470e){_0x54fbff=_0x54fbff-0x0;var _0x5cf619=_0xa982[_0x54fbff];return _0x5cf619;};'use strict';var _=require(_0x2a98('0x0'));var util=require(_0x2a98('0x1'));var moment=require(_0x2a98('0x2'));var BPromise=require(_0x2a98('0x3'));var rs=require(_0x2a98('0x4'));var fs=require('fs');var Redis=require(_0x2a98('0x5'));var db=require(_0x2a98('0x6'))['db'];var utils=require(_0x2a98('0x7'));var logger=require(_0x2a98('0x8'))(_0x2a98('0x9'));var config=require(_0x2a98('0xa'));var jayson=require(_0x2a98('0xb'));var client=jayson[_0x2a98('0xc')][_0x2a98('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x46906b,_0xa34124,_0x54e299){return new BPromise(function(_0x504c57,_0x5c131b){return client[_0x2a98('0xe')](_0x46906b,_0x54e299)[_0x2a98('0xf')](function(_0x2971cc){logger[_0x2a98('0x10')](_0x2a98('0x11'),_0xa34124,'request\x20sent');logger[_0x2a98('0x12')](_0x2a98('0x13'),_0xa34124,_0x2a98('0x14'),JSON[_0x2a98('0x15')](_0x2971cc));if(_0x2971cc[_0x2a98('0x16')]){if(_0x2971cc[_0x2a98('0x16')][_0x2a98('0x17')]===0x1f4){logger[_0x2a98('0x16')]('ChatProactiveAction,\x20%s,\x20%s',_0xa34124,_0x2971cc[_0x2a98('0x16')][_0x2a98('0x18')]);return _0x5c131b(_0x2971cc[_0x2a98('0x16')][_0x2a98('0x18')]);}logger[_0x2a98('0x16')](_0x2a98('0x11'),_0xa34124,_0x2971cc[_0x2a98('0x16')][_0x2a98('0x18')]);return _0x504c57(_0x2971cc[_0x2a98('0x16')][_0x2a98('0x18')]);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0xa34124,_0x2a98('0x14'));_0x504c57(_0x2971cc[_0x2a98('0x19')][_0x2a98('0x18')]);}})[_0x2a98('0x1a')](function(_0x81f37){logger[_0x2a98('0x16')](_0x2a98('0x11'),_0xa34124,_0x81f37);_0x5c131b(_0x81f37);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index b5584b0..fcd55f8 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 _0x1b4e=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','create','put','delete','destroy','exports','multer','util','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1b4e,0x1ad));var _0xe1b4=function(_0xa8cafb,_0x44351b){_0xa8cafb=_0xa8cafb-0x0;var _0x1ec7fd=_0x1b4e[_0xa8cafb];return _0x1ec7fd;};'use strict';var multer=require(_0xe1b4('0x0'));var util=require(_0xe1b4('0x1'));var path=require(_0xe1b4('0x2'));var timeout=require(_0xe1b4('0x3'));var express=require(_0xe1b4('0x4'));var router=express['Router']();var auth=require(_0xe1b4('0x5'));var interaction=require(_0xe1b4('0x6'));var config=require(_0xe1b4('0x7'));var controller=require(_0xe1b4('0x8'));router[_0xe1b4('0x9')](_0xe1b4('0xa'),auth[_0xe1b4('0xb')](),controller[_0xe1b4('0xc')]);router['post']('/',auth[_0xe1b4('0xb')](),controller[_0xe1b4('0xd')]);router[_0xe1b4('0xe')]('/:id',auth[_0xe1b4('0xb')](),controller['update']);router[_0xe1b4('0xf')]('/:id',auth[_0xe1b4('0xb')](),controller[_0xe1b4('0x10')]);module[_0xe1b4('0x11')]=router; \ No newline at end of file +var _0x212b=['show','create','update','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated'];(function(_0x241b05,_0x169be6){var _0x177155=function(_0x10c9cc){while(--_0x10c9cc){_0x241b05['push'](_0x241b05['shift']());}};_0x177155(++_0x169be6);}(_0x212b,0x148));var _0xb212=function(_0x1a84cd,_0x5b623e){_0x1a84cd=_0x1a84cd-0x0;var _0x421019=_0x212b[_0x1a84cd];return _0x421019;};'use strict';var multer=require(_0xb212('0x0'));var util=require('util');var path=require(_0xb212('0x1'));var timeout=require(_0xb212('0x2'));var express=require(_0xb212('0x3'));var router=express[_0xb212('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xb212('0x5'));var config=require(_0xb212('0x6'));var controller=require(_0xb212('0x7'));router['get'](_0xb212('0x8'),auth[_0xb212('0x9')](),controller[_0xb212('0xa')]);router['post']('/',auth[_0xb212('0x9')](),controller[_0xb212('0xb')]);router['put'](_0xb212('0x8'),auth[_0xb212('0x9')](),controller[_0xb212('0xc')]);router['delete'](_0xb212('0x8'),auth[_0xb212('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 661a4b0..cd512bd 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 _0x20da=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','STRING'];(function(_0x12cd00,_0x8ba819){var _0x587c2a=function(_0x277363){while(--_0x277363){_0x12cd00['push'](_0x12cd00['shift']());}};_0x587c2a(++_0x8ba819);}(_0x20da,0x106));var _0xa20d=function(_0x1d7bb9,_0x1059a3){_0x1d7bb9=_0x1d7bb9-0x0;var _0x3507c7=_0x20da[_0x1d7bb9];return _0x3507c7;};'use strict';var Sequelize=require(_0xa20d('0x0'));module['exports']={'name':{'type':Sequelize[_0xa20d('0x1')],'unique':_0xa20d('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa20d('0x1')]},'timeout':{'type':Sequelize[_0xa20d('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa20d('0x4')](_0xa20d('0x5'),_0xa20d('0x6'),_0xa20d('0x7'))}}; \ No newline at end of file +var _0x9744=['INTEGER','rrmemory','roundrobin','sequelize','exports','STRING','name'];(function(_0x4b8b98,_0x178c88){var _0x1fb023=function(_0x53aa9b){while(--_0x53aa9b){_0x4b8b98['push'](_0x4b8b98['shift']());}};_0x1fb023(++_0x178c88);}(_0x9744,0x192));var _0x4974=function(_0x4948ef,_0x27b3ee){_0x4948ef=_0x4948ef-0x0;var _0x307013=_0x9744[_0x4948ef];return _0x307013;};'use strict';var Sequelize=require(_0x4974('0x0'));module[_0x4974('0x1')]={'name':{'type':Sequelize[_0x4974('0x2')],'unique':_0x4974('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4974('0x2')]},'timeout':{'type':Sequelize[_0x4974('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x4974('0x5'),'beepall',_0x4974('0x6'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index b40509e..66cb1dc 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 _0x508a=['The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','end','status','json','count','limit','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','stack','name','index','map','ChatQueue','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','ChatQueueId','UserChatQueue','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','options','addTeams','ids','Agents','online','voicePause','interface','sequelize','each','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','TeamId','all','transaction','userChatQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','./chatQueue.socket','register','jayson/promise','http','test','Sequelize','ValidationError'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x508a,0x1aa));var _0xa508=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x508a[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xa508('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa508('0x1'));var zipdir=require(_0xa508('0x2'));var jsonpatch=require(_0xa508('0x3'));var rp=require(_0xa508('0x4'));var moment=require(_0xa508('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa508('0x6'));var util=require(_0xa508('0x7'));var path=require(_0xa508('0x8'));var sox=require('sox');var csv=require(_0xa508('0x9'));var ejs=require(_0xa508('0xa'));var fs=require('fs');var _=require(_0xa508('0xb'));var squel=require('squel');var crypto=require(_0xa508('0xc'));var jsforce=require(_0xa508('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa508('0x9'));var querystring=require(_0xa508('0xe'));var Papa=require('papaparse');var Redis=require(_0xa508('0xf'));var authService=require(_0xa508('0x10'));var qs=require(_0xa508('0x11'));var as=require(_0xa508('0x12'));var hardwareService=require(_0xa508('0x13'));var logger=require('../../config/logger')(_0xa508('0x14'));var utils=require(_0xa508('0x15'));var config=require('../../config/environment');var db=require(_0xa508('0x16'))['db'];config[_0xa508('0x17')]=_[_0xa508('0x18')](config['redis'],{'host':_0xa508('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa508('0x17')]));require(_0xa508('0x1a'))[_0xa508('0x1b')](socket);var jayson=require(_0xa508('0x1c'));var client=jayson['client'][_0xa508('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x45a0bc,_0x102adb,_0xb8b8f5){if(_0xb8b8f5){var _0x5e2d7d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5e2d7d[_0xa508('0x1e')](_0x102adb)){return _0x45a0bc;}else{throw new db[(_0xa508('0x1f'))][(_0xa508('0x20'))](_0xa508('0x21'));}}else{return _0x45a0bc;}}function respondWithRpcPromise(_0x507c9f,_0x1a366f,_0x27d102,_0x5e29a8){return new BPromise(function(_0x5d345d,_0x1984ae){var _0x226024=_0x5e29a8||client;return _0x226024[_0xa508('0x22')](_0x507c9f,_0x27d102)[_0xa508('0x23')](function(_0x421874){logger[_0xa508('0x24')](_0xa508('0x25'),_0x1a366f,_0xa508('0x26'));logger['debug'](_0xa508('0x27'),_0x1a366f,_0xa508('0x26'),JSON[_0xa508('0x28')](_0x421874));if(_0x421874[_0xa508('0x29')]){if(_0x421874[_0xa508('0x29')]['code']===0x1f4){logger[_0xa508('0x29')]('ChatQueue,\x20%s,\x20%s',_0x1a366f,_0x421874[_0xa508('0x29')][_0xa508('0x2a')]);return _0x1984ae(_0x421874['error'][_0xa508('0x2a')]);}logger[_0xa508('0x29')](_0xa508('0x25'),_0x1a366f,_0x421874[_0xa508('0x29')]['message']);return _0x5d345d(_0x421874['error']['message']);}else{logger[_0xa508('0x24')](_0xa508('0x25'),_0x1a366f,_0xa508('0x26'));_0x5d345d(_0x421874[_0xa508('0x2b')][_0xa508('0x2a')]);}})[_0xa508('0x2c')](function(_0x2400ee){logger['error']('ChatQueue,\x20%s,\x20%s',_0x1a366f,_0x2400ee);_0x1984ae(_0x2400ee);});});}function respondWithStatusCode(_0x98b1c8,_0x1bca04){_0x1bca04=_0x1bca04||0xcc;return function(_0x47d93b){if(_0x47d93b){return _0x98b1c8[_0xa508('0x2d')](_0x1bca04);}return _0x98b1c8['status'](_0x1bca04)[_0xa508('0x2e')]();};}function respondWithResult(_0x44616a,_0x528ae9){_0x528ae9=_0x528ae9||0xc8;return function(_0x370518){if(_0x370518){return _0x44616a[_0xa508('0x2f')](_0x528ae9)[_0xa508('0x30')](_0x370518);}};}function respondWithFilteredResult(_0x39189d,_0x572793){return function(_0x21fa3b){if(_0x21fa3b){var _0x405baa=_0x21fa3b[_0xa508('0x31')],_0x3eb26c=_0x572793['offset'],_0x5d971d=_0x572793['offset']+_0x572793[_0xa508('0x32')],_0x2affae;if(_0x5d971d>=_0x405baa){_0x5d971d=_0x405baa;_0x2affae=0xc8;}else{_0x2affae=0xce;}_0x39189d['status'](_0x2affae);return _0x39189d['set'](_0xa508('0x33'),_0x3eb26c+'-'+_0x5d971d+'/'+_0x405baa)['json'](_0x21fa3b);}return null;};}function patchUpdates(_0x4fee73){return function(_0xb542d7){try{jsonpatch[_0xa508('0x34')](_0xb542d7,_0x4fee73,!![]);}catch(_0x4a995c){return BPromise[_0xa508('0x35')](_0x4a995c);}return _0xb542d7[_0xa508('0x36')]();};}function saveUpdates(_0x1b94ef,_0x489e27){return function(_0x4a1c45){if(_0x4a1c45){return _0x4a1c45[_0xa508('0x37')](_0x1b94ef)[_0xa508('0x23')](function(_0x2a74dc){return _0x2a74dc;});}return null;};}function removeEntity(_0x20261f,_0x2a8a43){return function(_0x3c07a1){if(_0x3c07a1){return _0x3c07a1[_0xa508('0x38')]()[_0xa508('0x23')](function(){var _0x374293=_0x3c07a1[_0xa508('0x39')]({'plain':!![]});var _0x31b526='ChatQueues';return db[_0xa508('0x3a')][_0xa508('0x38')]({'where':{'type':_0x31b526,'resourceId':_0x374293['id']}})[_0xa508('0x23')](function(){return _0x3c07a1;});})[_0xa508('0x23')](function(){_0x20261f['status'](0xcc)[_0xa508('0x2e')]();});}};}function handleEntityNotFound(_0x3de64d,_0x19019b){return function(_0x492f85){if(!_0x492f85){_0x3de64d[_0xa508('0x2d')](0x194);}return _0x492f85;};}function handleError(_0x32e235,_0xb4d205){_0xb4d205=_0xb4d205||0x1f4;return function(_0x5799de){logger['error'](_0x5799de[_0xa508('0x3b')]);if(_0x5799de[_0xa508('0x3c')]){delete _0x5799de[_0xa508('0x3c')];}_0x32e235[_0xa508('0x2f')](_0xb4d205)['send'](_0x5799de);};}exports[_0xa508('0x3d')]=function(_0x17ba28,_0x288d5f){var _0x44f78={},_0x2b383d={},_0x3438bb={'count':0x0,'rows':[]};var _0x1fdc2b=_[_0xa508('0x3e')](db[_0xa508('0x3f')][_0xa508('0x40')],function(_0x3d1e10){return{'name':_0x3d1e10[_0xa508('0x41')],'type':_0x3d1e10['type'][_0xa508('0x42')]};});_0x2b383d[_0xa508('0x43')]=_[_0xa508('0x3e')](_0x1fdc2b,_0xa508('0x3c'));_0x2b383d['query']=_[_0xa508('0x44')](_0x17ba28[_0xa508('0x45')]);_0x2b383d[_0xa508('0x46')]=_[_0xa508('0x47')](_0x2b383d[_0xa508('0x43')],_0x2b383d[_0xa508('0x45')]);_0x44f78[_0xa508('0x48')]=_[_0xa508('0x47')](_0x2b383d[_0xa508('0x43')],qs[_0xa508('0x49')](_0x17ba28[_0xa508('0x45')][_0xa508('0x49')]));_0x44f78[_0xa508('0x48')]=_0x44f78['attributes'][_0xa508('0x4a')]?_0x44f78['attributes']:_0x2b383d[_0xa508('0x43')];if(!_0x17ba28[_0xa508('0x45')][_0xa508('0x4b')](_0xa508('0x4c'))){_0x44f78[_0xa508('0x32')]=qs[_0xa508('0x32')](_0x17ba28[_0xa508('0x45')][_0xa508('0x32')]);_0x44f78['offset']=qs[_0xa508('0x4d')](_0x17ba28[_0xa508('0x45')][_0xa508('0x4d')]);}_0x44f78[_0xa508('0x4e')]=qs[_0xa508('0x4f')](_0x17ba28[_0xa508('0x45')][_0xa508('0x4f')]);_0x44f78[_0xa508('0x50')]=qs[_0xa508('0x46')](_[_0xa508('0x51')](_0x17ba28[_0xa508('0x45')],_0x2b383d[_0xa508('0x46')]));if(_0x17ba28[_0xa508('0x45')][_0xa508('0x52')]){_0x44f78[_0xa508('0x50')]=_[_0xa508('0x53')](_0x44f78[_0xa508('0x50')],{'$or':_[_0xa508('0x3e')](_0x1fdc2b,function(_0x19e5e2){if(_0x19e5e2[_0xa508('0x54')]!==_0xa508('0x55')){var _0x2c2c88={};_0x2c2c88[_0x19e5e2[_0xa508('0x3c')]]={'$like':'%'+_0x17ba28[_0xa508('0x45')][_0xa508('0x52')]+'%'};return _0x2c2c88;}})});}_0x44f78=_[_0xa508('0x53')]({},_0x44f78,_0x17ba28['options']);var _0x2f059b={'where':_0x44f78[_0xa508('0x50')]};return db[_0xa508('0x3f')][_0xa508('0x31')](_0x2f059b)[_0xa508('0x23')](function(_0x4ce080){_0x3438bb[_0xa508('0x31')]=_0x4ce080;if(_0x17ba28[_0xa508('0x45')][_0xa508('0x56')]){_0x44f78[_0xa508('0x57')]=[{'all':!![]}];}return db[_0xa508('0x3f')][_0xa508('0x58')](_0x44f78);})[_0xa508('0x23')](function(_0x5ae142){_0x3438bb[_0xa508('0x59')]=_0x5ae142;return _0x3438bb;})[_0xa508('0x23')](respondWithFilteredResult(_0x288d5f,_0x44f78))[_0xa508('0x2c')](handleError(_0x288d5f,null));};exports['show']=function(_0x2d2fc2,_0x17d419){var _0xc49c59={'raw':!![],'where':{'id':_0x2d2fc2[_0xa508('0x5a')]['id']}},_0x207902={};_0x207902[_0xa508('0x43')]=_[_0xa508('0x44')](db[_0xa508('0x3f')][_0xa508('0x40')]);_0x207902['query']=_[_0xa508('0x44')](_0x2d2fc2[_0xa508('0x45')]);_0x207902[_0xa508('0x46')]=_[_0xa508('0x47')](_0x207902['model'],_0x207902[_0xa508('0x45')]);_0xc49c59[_0xa508('0x48')]=_[_0xa508('0x47')](_0x207902['model'],qs[_0xa508('0x49')](_0x2d2fc2[_0xa508('0x45')][_0xa508('0x49')]));_0xc49c59[_0xa508('0x48')]=_0xc49c59[_0xa508('0x48')][_0xa508('0x4a')]?_0xc49c59[_0xa508('0x48')]:_0x207902[_0xa508('0x43')];if(_0x2d2fc2['query'][_0xa508('0x56')]){_0xc49c59[_0xa508('0x57')]=[{'all':!![]}];}_0xc49c59=_['merge']({},_0xc49c59,_0x2d2fc2['options']);return db['ChatQueue'][_0xa508('0x5b')](_0xc49c59)[_0xa508('0x23')](handleEntityNotFound(_0x17d419,null))[_0xa508('0x23')](respondWithResult(_0x17d419,null))['catch'](handleError(_0x17d419,null));};exports[_0xa508('0x5c')]=function(_0x45ff84,_0xb83810){return db[_0xa508('0x3f')]['create'](_0x45ff84['body'],{})[_0xa508('0x23')](function(_0x492474){var _0x1ac43d=_0x45ff84[_0xa508('0x5d')]['get']({'plain':!![]});if(!_0x1ac43d)throw new Error(_0xa508('0x5e'));if(_0x1ac43d['role']===_0xa508('0x5d')){var _0x5e9ce9=_0x492474[_0xa508('0x39')]({'plain':!![]});var _0x502379='ChatQueues';return db[_0xa508('0x5f')]['find']({'where':{'name':_0x502379,'userProfileId':_0x1ac43d[_0xa508('0x60')]},'raw':!![]})[_0xa508('0x23')](function(_0x57fede){if(_0x57fede&&_0x57fede[_0xa508('0x61')]===0x0){return db[_0xa508('0x3a')][_0xa508('0x5c')]({'name':_0x5e9ce9[_0xa508('0x3c')],'resourceId':_0x5e9ce9['id'],'type':_0x57fede[_0xa508('0x3c')],'sectionId':_0x57fede['id']},{})[_0xa508('0x23')](function(){return _0x492474;});}else{return _0x492474;}})[_0xa508('0x2c')](function(_0x1f513c){logger[_0xa508('0x29')](_0xa508('0x62'),_0x1f513c);throw _0x1f513c;});}return _0x492474;})[_0xa508('0x23')](respondWithResult(_0xb83810,0xc9))[_0xa508('0x2c')](handleError(_0xb83810,null));};exports[_0xa508('0x37')]=function(_0x1d1935,_0xebf2cb){if(_0x1d1935[_0xa508('0x63')]['id']){delete _0x1d1935[_0xa508('0x63')]['id'];}return db[_0xa508('0x3f')][_0xa508('0x5b')]({'where':{'id':_0x1d1935[_0xa508('0x5a')]['id']}})[_0xa508('0x23')](handleEntityNotFound(_0xebf2cb,null))[_0xa508('0x23')](saveUpdates(_0x1d1935[_0xa508('0x63')],null))[_0xa508('0x23')](respondWithResult(_0xebf2cb,null))['catch'](handleError(_0xebf2cb,null));};exports[_0xa508('0x38')]=function(_0x375fee,_0x3532ff){return db[_0xa508('0x3f')][_0xa508('0x5b')]({'where':{'id':_0x375fee[_0xa508('0x5a')]['id']}})[_0xa508('0x23')](handleEntityNotFound(_0x3532ff,null))[_0xa508('0x23')](removeEntity(_0x3532ff,null))['catch'](handleError(_0x3532ff,null));};exports[_0xa508('0x64')]=function(_0x242c69,_0x2b4a78){return db[_0xa508('0x3f')][_0xa508('0x64')]()[_0xa508('0x23')](respondWithResult(_0x2b4a78,null))[_0xa508('0x2c')](handleError(_0x2b4a78,null));};exports[_0xa508('0x65')]=function(_0x4be39d,_0x29d12f,_0x10ab4c){var _0x20e256={'raw':!![],'where':{}},_0x32fa93={},_0x4ce6a3;return db[_0xa508('0x3f')][_0xa508('0x66')]({'where':{'id':_0x4be39d['params']['id']}})[_0xa508('0x23')](handleEntityNotFound(_0x29d12f,null))['then'](function(_0x9dc8db){if(_0x9dc8db){_0x4ce6a3=_0x9dc8db[_0xa508('0x39')]({'plain':!![]});_0x32fa93['model']=_[_0xa508('0x44')](db['UserChatQueue'][_0xa508('0x40')]);_0x32fa93[_0xa508('0x45')]=_[_0xa508('0x44')](_0x4be39d[_0xa508('0x45')]);_0x32fa93[_0xa508('0x46')]=_[_0xa508('0x47')](_0x32fa93[_0xa508('0x43')],_0x32fa93[_0xa508('0x45')]);_0x20e256[_0xa508('0x48')]=_['intersection'](_0x32fa93[_0xa508('0x43')],qs['fields'](_0x4be39d['query'][_0xa508('0x49')]));_0x20e256[_0xa508('0x48')]=_0x20e256[_0xa508('0x48')][_0xa508('0x4a')]?_0x20e256['attributes']:_0x32fa93[_0xa508('0x43')];if(!_0x4be39d[_0xa508('0x45')]['hasOwnProperty'](_0xa508('0x4c'))){_0x20e256['limit']=qs[_0xa508('0x32')](_0x4be39d[_0xa508('0x45')][_0xa508('0x32')]);_0x20e256[_0xa508('0x4d')]=qs[_0xa508('0x4d')](_0x4be39d['query'][_0xa508('0x4d')]);}_0x20e256[_0xa508('0x4e')]=qs['sort'](_0x4be39d[_0xa508('0x45')][_0xa508('0x4f')]);_0x20e256[_0xa508('0x50')]=qs[_0xa508('0x46')](_['pick'](_0x4be39d[_0xa508('0x45')],_0x32fa93['filters']));_0x20e256[_0xa508('0x50')][_0xa508('0x67')]=_0x9dc8db['id'];if(_0x4be39d[_0xa508('0x45')][_0xa508('0x52')]){_0x20e256[_0xa508('0x50')]=_[_0xa508('0x53')](_0x20e256[_0xa508('0x50')],{'$or':_[_0xa508('0x3e')](_0x20e256['attributes'],function(_0x2f04e4){var _0x20f7a6={};_0x20f7a6[_0x2f04e4]={'$like':'%'+_0x4be39d['query']['filter']+'%'};return _0x20f7a6;})});}_0x20e256=_[_0xa508('0x53')]({},_0x20e256,_0x4be39d['options']);return db[_0xa508('0x68')][_0xa508('0x58')](_0x20e256);}})[_0xa508('0x23')](function(_0x588a12){if(_0x588a12){return db[_0xa508('0x69')][_0xa508('0x6a')]({'where':{'id':_[_0xa508('0x3e')](_0x588a12,_0xa508('0x6b')),'role':_0xa508('0x6c')},'attributes':['id',_0xa508('0x3c'),_0xa508('0x6d'),_0xa508('0x6e'),_0xa508('0x6f')]});}})[_0xa508('0x23')](function(_0x313caa){if(_0x313caa){return{'count':_0x313caa[_0xa508('0x31')],'rows':_['map'](_0x313caa[_0xa508('0x59')],function(_0x2e16a4){return{'membername':_0x2e16a4['name'],'UserId':_0x2e16a4['id'],'queue_name':_0x4ce6a3[_0xa508('0x3c')],'ChatQueueId':_0x4ce6a3['id'],'interface':util[_0xa508('0x70')](_0xa508('0x71'),_0xa508('0x72'),_0x2e16a4[_0xa508('0x3c')]),'penalty':0x0,'paused':_0x2e16a4['chatPause'],'createdAt':_0x2e16a4[_0xa508('0x6f')],'updatedAt':_0x2e16a4['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xa508('0x23')](respondWithFilteredResult(_0x29d12f,_0x20e256))[_0xa508('0x2c')](handleError(_0x29d12f,null));};exports[_0xa508('0x73')]=function(_0x3e6a56,_0x539c18,_0x2e9f33){var _0x325284={};var _0x136131={};var _0x233a2b;var _0x4b8740;return db[_0xa508('0x3f')][_0xa508('0x66')]({'where':{'id':_0x3e6a56[_0xa508('0x5a')]['id']}})[_0xa508('0x23')](handleEntityNotFound(_0x539c18,null))['then'](function(_0x3138f3){if(_0x3138f3){_0x233a2b=_0x3138f3;_0x136131['model']=_[_0xa508('0x44')](db[_0xa508('0x74')][_0xa508('0x40')]);_0x136131[_0xa508('0x45')]=_[_0xa508('0x44')](_0x3e6a56[_0xa508('0x45')]);_0x136131[_0xa508('0x46')]=_['intersection'](_0x136131[_0xa508('0x43')],_0x136131[_0xa508('0x45')]);_0x325284[_0xa508('0x48')]=_[_0xa508('0x47')](_0x136131[_0xa508('0x43')],qs['fields'](_0x3e6a56[_0xa508('0x45')]['fields']));_0x325284[_0xa508('0x48')]=_0x325284[_0xa508('0x48')][_0xa508('0x4a')]?_0x325284[_0xa508('0x48')]:_0x136131[_0xa508('0x43')];_0x325284[_0xa508('0x4e')]=qs[_0xa508('0x4f')](_0x3e6a56[_0xa508('0x45')][_0xa508('0x4f')]);_0x325284[_0xa508('0x50')]=qs[_0xa508('0x46')](_[_0xa508('0x51')](_0x3e6a56['query'],_0x136131['filters']));if(_0x3e6a56[_0xa508('0x45')][_0xa508('0x52')]){_0x325284[_0xa508('0x50')]=_[_0xa508('0x53')](_0x325284[_0xa508('0x50')],{'$or':_[_0xa508('0x3e')](_0x325284[_0xa508('0x48')],function(_0x530f34){var _0x44d56e={};_0x44d56e[_0x530f34]={'$like':'%'+_0x3e6a56['query'][_0xa508('0x52')]+'%'};return _0x44d56e;})});}_0x325284=_[_0xa508('0x53')]({},_0x325284,_0x3e6a56[_0xa508('0x75')]);return _0x233a2b['getTeams'](_0x325284);}})[_0xa508('0x23')](function(_0x229e56){if(_0x229e56){_0x4b8740=_0x229e56[_0xa508('0x4a')];if(!_0x3e6a56['query'][_0xa508('0x4b')](_0xa508('0x4c'))){_0x325284[_0xa508('0x32')]=qs[_0xa508('0x32')](_0x3e6a56[_0xa508('0x45')]['limit']);_0x325284['offset']=qs[_0xa508('0x4d')](_0x3e6a56[_0xa508('0x45')][_0xa508('0x4d')]);}return _0x233a2b['getTeams'](_0x325284);}})[_0xa508('0x23')](function(_0x335992){if(_0x335992){return _0x335992?{'count':_0x4b8740,'rows':_0x335992}:null;}})[_0xa508('0x23')](respondWithResult(_0x539c18,null))[_0xa508('0x2c')](handleError(_0x539c18,null));};exports[_0xa508('0x76')]=function(_0x4500a3,_0x32c00c,_0x2a674f){var _0x2bc9ab=_0x4500a3[_0xa508('0x63')][_0xa508('0x77')];return db[_0xa508('0x74')][_0xa508('0x58')]({'where':{'id':_0x2bc9ab},'attributes':['id'],'include':[{'model':db[_0xa508('0x69')],'as':_0xa508('0x78'),'attributes':['id',_0xa508('0x3c'),_0xa508('0x79'),_0xa508('0x7a'),_0xa508('0x7b')],'raw':!![]}]})[_0xa508('0x23')](function(_0x42be0f){if(_0x42be0f){var _0x25d3ea=_['flatMap'](_0x42be0f,function(_0x45dd7c){var _0x2b1c18=_0x45dd7c['get']({'plain':!![]});return _0x2b1c18['Agents'];});return db['ChatQueue']['find']({'where':{'id':_0x4500a3['params']['id']}})[_0xa508('0x23')](function(_0x1e55a4){return db[_0xa508('0x7c')]['transaction'](function(_0x3b7304){return _0x1e55a4['addTeams'](_0x2bc9ab,{'transaction':_0x3b7304})[_0xa508('0x23')](function(){return BPromise[_0xa508('0x7d')](_0x25d3ea,function(_0x38b5b3){return db[_0xa508('0x68')]['findOrCreate']({'where':{'UserId':_0x38b5b3['id'],'ChatQueueId':_0x4500a3[_0xa508('0x5a')]['id']},'transaction':_0x3b7304});});})[_0xa508('0x23')](function(){_0x25d3ea[_0xa508('0x7e')](function(_0x83130){socket[_0xa508('0x7f')](_0xa508('0x80'),{'UserId':_0x83130['id'],'ChatQueueId':_0x1e55a4['id']});});});});});}})[_0xa508('0x23')](respondWithStatusCode(_0x32c00c,null))[_0xa508('0x2c')](handleError(_0x32c00c,null));};exports[_0xa508('0x81')]=function(_0x2ea7da,_0x3c0926,_0x266c80){return db['Team'][_0xa508('0x58')]({'where':{'id':_0x2ea7da[_0xa508('0x45')][_0xa508('0x77')]},'attributes':['id'],'include':[{'model':db[_0xa508('0x69')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xa508('0x23')](handleEntityNotFound(_0x3c0926,null))[_0xa508('0x23')](function(_0xa96424){var _0x17384a=_[_0xa508('0x3e')](_0xa96424,'id');var _0x2f9bbd=[];var _0x4e81c5=[];var _0xd6b356=squel[_0xa508('0x82')]();_0xd6b356[_0xa508('0x83')](_0xa508('0x84'))['from'](_0xa508('0x85'),'tq')[_0xa508('0x86')](_0xa508('0x87'),'ut',_0xa508('0x88'))[_0xa508('0x50')](_0xa508('0x89'),_0x2ea7da[_0xa508('0x5a')]['id']);for(var _0x21dd8a=0x0;_0x21dd8a<_0xa96424[_0xa508('0x4a')];_0x21dd8a+=0x1){let _0x330744=_0xa96424[_0x21dd8a];for(var _0x43f78a=0x0;_0x43f78a<_0x330744['Agents'][_0xa508('0x4a')];_0x43f78a+=0x1){let _0x124b90=_0x330744[_0xa508('0x78')][_0x43f78a];var _0x23f4a7=_0xd6b356[_0xa508('0x8a')]();_0x23f4a7[_0xa508('0x50')](_0xa508('0x8b'),_0x124b90['id']);_0x4e81c5['push'](db[_0xa508('0x7c')][_0xa508('0x45')](_0x23f4a7[_0xa508('0x8c')](),{'type':db['sequelize'][_0xa508('0x8d')][_0xa508('0x8e')]})['then'](function(_0x174763){if(_0x174763[_0xa508('0x4a')]===0x1){return _0x124b90['id'];}else{var _0x2aac9c=_['every'](_[_0xa508('0x3e')](_0x174763,_0xa508('0x8f')),function(_0x4e8154){return _['includes'](_0x17384a,_0x4e8154);});if(_0x2aac9c){return _0x124b90['id'];}}}));}}return BPromise[_0xa508('0x90')](_0x4e81c5)[_0xa508('0x23')](function(_0x517444){_0x2f9bbd=_(_0x2f9bbd)['union'](_0x517444)['compact']()['value']();return db['ChatQueue'][_0xa508('0x5b')]({'where':{'id':_0x2ea7da[_0xa508('0x5a')]['id']}})[_0xa508('0x23')](function(_0x399a07){return db['sequelize'][_0xa508('0x91')](function(_0x330927){return _0x399a07[_0xa508('0x81')](_0x2ea7da[_0xa508('0x45')][_0xa508('0x77')],{'transaction':_0x330927})[_0xa508('0x23')](function(){if(!_['isEmpty'](_0x2f9bbd)){return _0x399a07['removeAgents'](_0x2f9bbd,{'transaction':_0x330927});}})[_0xa508('0x23')](function(){_0x2f9bbd[_0xa508('0x7e')](function(_0x3457b4){socket['emit'](_0xa508('0x92'),{'UserId':_0x3457b4,'ChatQueueId':_0x399a07['id']});});});});});});})[_0xa508('0x23')](respondWithStatusCode(_0x3c0926,null))[_0xa508('0x2c')](handleError(_0x3c0926,null));};exports[_0xa508('0x93')]=function(_0x9df793,_0x2cdfc4,_0x42bd13){return db[_0xa508('0x3f')]['find']({'where':{'id':_0x9df793[_0xa508('0x5a')]['id']}})[_0xa508('0x23')](handleEntityNotFound(_0x2cdfc4,null))[_0xa508('0x23')](function(_0x4021cc){if(_0x4021cc){return _0x4021cc[_0xa508('0x93')](_0x9df793['body'][_0xa508('0x77')],_[_0xa508('0x94')](_0x9df793[_0xa508('0x63')],[_0xa508('0x77'),'id'])||{})[_0xa508('0x95')](function(_0x4ef478){for(var _0x57fc87=0x0;_0x57fc87<_0x9df793[_0xa508('0x63')][_0xa508('0x77')][_0xa508('0x4a')];_0x57fc87+=0x1){socket[_0xa508('0x7f')](_0xa508('0x80'),{'UserId':_0x9df793[_0xa508('0x63')][_0xa508('0x77')][_0x57fc87],'ChatQueueId':_0x9df793[_0xa508('0x5a')]['id']});}return _0x4ef478;});}})[_0xa508('0x23')](respondWithResult(_0x2cdfc4,null))[_0xa508('0x2c')](handleError(_0x2cdfc4,null));};exports[_0xa508('0x96')]=function(_0x2527f8,_0x12fd80,_0x334050){return db['ChatQueue'][_0xa508('0x5b')]({'where':{'id':_0x2527f8[_0xa508('0x5a')]['id']}})['then'](handleEntityNotFound(_0x12fd80,null))[_0xa508('0x23')](function(_0x625927){if(_0x625927){return _0x625927['removeAgents'](_0x2527f8['query']['ids'])[_0xa508('0x23')](function(){if(_[_0xa508('0x97')](_0x2527f8[_0xa508('0x45')]['ids'])){for(var _0x53a6c8=0x0;_0x53a6c8<_0x2527f8[_0xa508('0x45')]['ids'][_0xa508('0x4a')];_0x53a6c8+=0x1){socket['emit'](_0xa508('0x92'),{'UserId':Number(_0x2527f8['query'][_0xa508('0x77')][_0x53a6c8]),'ChatQueueId':Number(_0x2527f8[_0xa508('0x5a')]['id'])});}}else{socket['emit'](_0xa508('0x92'),{'UserId':Number(_0x2527f8[_0xa508('0x45')][_0xa508('0x77')]),'ChatQueueId':Number(_0x2527f8[_0xa508('0x5a')]['id'])});}});}})[_0xa508('0x23')](respondWithStatusCode(_0x12fd80,null))['catch'](handleError(_0x12fd80,null));};exports[_0xa508('0x98')]=function(_0x1d79e4,_0x4b41b5,_0x16bd02){var _0x365de4={};var _0x1df88c={};var _0x585d15;var _0x5888b7;return db[_0xa508('0x3f')][_0xa508('0x66')]({'where':{'id':_0x1d79e4[_0xa508('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4b41b5,null))[_0xa508('0x23')](function(_0x2663ce){if(_0x2663ce){_0x585d15=_0x2663ce;_0x1df88c[_0xa508('0x43')]=_['keys'](db[_0xa508('0x69')]['rawAttributes']);_0x1df88c[_0xa508('0x45')]=_['keys'](_0x1d79e4[_0xa508('0x45')]);_0x1df88c[_0xa508('0x46')]=_[_0xa508('0x47')](_0x1df88c['model'],_0x1df88c[_0xa508('0x45')]);_0x365de4[_0xa508('0x48')]=_['intersection'](_0x1df88c[_0xa508('0x43')],qs[_0xa508('0x49')](_0x1d79e4[_0xa508('0x45')][_0xa508('0x49')]));_0x365de4[_0xa508('0x48')]=_0x365de4[_0xa508('0x48')][_0xa508('0x4a')]?_0x365de4[_0xa508('0x48')]:_0x1df88c[_0xa508('0x43')];_0x365de4[_0xa508('0x4e')]=qs[_0xa508('0x4f')](_0x1d79e4[_0xa508('0x45')]['sort']);_0x365de4[_0xa508('0x50')]=qs[_0xa508('0x46')](_[_0xa508('0x51')](_0x1d79e4[_0xa508('0x45')],_0x1df88c[_0xa508('0x46')]));if(_0x1d79e4[_0xa508('0x45')][_0xa508('0x52')]){_0x365de4[_0xa508('0x50')]=_[_0xa508('0x53')](_0x365de4['where'],{'$or':_[_0xa508('0x3e')](_0x365de4[_0xa508('0x48')],function(_0xce0856){var _0x551232={};_0x551232[_0xce0856]={'$like':'%'+_0x1d79e4['query']['filter']+'%'};return _0x551232;})});}_0x365de4=_[_0xa508('0x53')]({},_0x365de4,_0x1d79e4['options']);return _0x585d15['getAgents'](_0x365de4);}})[_0xa508('0x23')](function(_0x1a1c30){if(_0x1a1c30){_0x5888b7=_0x1a1c30[_0xa508('0x4a')];if(!_0x1d79e4[_0xa508('0x45')][_0xa508('0x4b')](_0xa508('0x4c'))){_0x365de4['limit']=qs['limit'](_0x1d79e4[_0xa508('0x45')]['limit']);_0x365de4[_0xa508('0x4d')]=qs[_0xa508('0x4d')](_0x1d79e4[_0xa508('0x45')][_0xa508('0x4d')]);}return _0x585d15[_0xa508('0x98')](_0x365de4);}})[_0xa508('0x23')](function(_0x57f67b){if(_0x57f67b){return _0x57f67b?{'count':_0x5888b7,'rows':_0x57f67b}:null;}})['then'](respondWithResult(_0x4b41b5,null))['catch'](handleError(_0x4b41b5,null));}; \ No newline at end of file +var _0x8c8b=['sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','filters','pick','filter','where','VIRTUAL','merge','options','ChatQueue','includeAll','include','rows','catch','show','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','findOne','sort','ChatQueueId','UserChatQueue','findAll','findAndCountAll','UserId','agent','chatPause','updatedAt','format','SIP','createdAt','getTeams','Team','User','voicePause','interface','flatMap','Agents','transaction','addTeams','each','findOrCreate','removeTeams','ids','select','field','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','every','TeamId','includes','all','union','value','isEmpty','removeAgents','forEach','emit','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','getAgents','html-pdf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','register','jayson/promise','client','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','end','status','count','offset','limit','set','json','reject','save','update','destroy','get','ChatQueues','UserProfileResource'];(function(_0x3c9c4d,_0x1a2ef0){var _0x189ec2=function(_0x4d0b38){while(--_0x4d0b38){_0x3c9c4d['push'](_0x3c9c4d['shift']());}};_0x189ec2(++_0x1a2ef0);}(_0x8c8b,0x106));var _0xb8c8=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x8c8b[_0x2641f9];return _0x585741;};'use strict';var pdf=require(_0xb8c8('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb8c8('0x1'));var jsonpatch=require(_0xb8c8('0x2'));var rp=require(_0xb8c8('0x3'));var moment=require(_0xb8c8('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb8c8('0x5'));var path=require(_0xb8c8('0x6'));var sox=require(_0xb8c8('0x7'));var csv=require(_0xb8c8('0x8'));var ejs=require(_0xb8c8('0x9'));var fs=require('fs');var _=require(_0xb8c8('0xa'));var squel=require(_0xb8c8('0xb'));var crypto=require(_0xb8c8('0xc'));var jsforce=require(_0xb8c8('0xd'));var deskjs=require(_0xb8c8('0xe'));var toCsv=require(_0xb8c8('0x8'));var querystring=require('querystring');var Papa=require(_0xb8c8('0xf'));var Redis=require(_0xb8c8('0x10'));var authService=require(_0xb8c8('0x11'));var qs=require(_0xb8c8('0x12'));var as=require(_0xb8c8('0x13'));var hardwareService=require(_0xb8c8('0x14'));var logger=require(_0xb8c8('0x15'))(_0xb8c8('0x16'));var utils=require(_0xb8c8('0x17'));var config=require(_0xb8c8('0x18'));var db=require(_0xb8c8('0x19'))['db'];config[_0xb8c8('0x1a')]=_['defaults'](config[_0xb8c8('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xb8c8('0x1b'))(new Redis(config[_0xb8c8('0x1a')]));require('./chatQueue.socket')[_0xb8c8('0x1c')](socket);var jayson=require(_0xb8c8('0x1d'));var client=jayson[_0xb8c8('0x1e')]['http']({'port':0x232a});function checkPasswordPattern(_0x198719,_0x3f7396,_0x1c12c2){if(_0x1c12c2){var _0x1feec2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1feec2['test'](_0x3f7396)){return _0x198719;}else{throw new db[(_0xb8c8('0x1f'))][(_0xb8c8('0x20'))](_0xb8c8('0x21'));}}else{return _0x198719;}}function respondWithRpcPromise(_0x45ed3a,_0x4d6129,_0x321493,_0x25c387){return new BPromise(function(_0x31886c,_0x3510ee){var _0x34f348=_0x25c387||client;return _0x34f348[_0xb8c8('0x22')](_0x45ed3a,_0x321493)[_0xb8c8('0x23')](function(_0x1d6bba){logger[_0xb8c8('0x24')](_0xb8c8('0x25'),_0x4d6129,_0xb8c8('0x26'));logger[_0xb8c8('0x27')](_0xb8c8('0x28'),_0x4d6129,_0xb8c8('0x26'),JSON[_0xb8c8('0x29')](_0x1d6bba));if(_0x1d6bba['error']){if(_0x1d6bba[_0xb8c8('0x2a')][_0xb8c8('0x2b')]===0x1f4){logger[_0xb8c8('0x2a')](_0xb8c8('0x25'),_0x4d6129,_0x1d6bba[_0xb8c8('0x2a')]['message']);return _0x3510ee(_0x1d6bba[_0xb8c8('0x2a')]['message']);}logger['error'](_0xb8c8('0x25'),_0x4d6129,_0x1d6bba[_0xb8c8('0x2a')][_0xb8c8('0x2c')]);return _0x31886c(_0x1d6bba[_0xb8c8('0x2a')][_0xb8c8('0x2c')]);}else{logger['info'](_0xb8c8('0x25'),_0x4d6129,_0xb8c8('0x26'));_0x31886c(_0x1d6bba[_0xb8c8('0x2d')][_0xb8c8('0x2c')]);}})['catch'](function(_0x3c4b44){logger[_0xb8c8('0x2a')]('ChatQueue,\x20%s,\x20%s',_0x4d6129,_0x3c4b44);_0x3510ee(_0x3c4b44);});});}function respondWithStatusCode(_0x2814ed,_0x9c9563){_0x9c9563=_0x9c9563||0xcc;return function(_0x2ee78c){if(_0x2ee78c){return _0x2814ed['sendStatus'](_0x9c9563);}return _0x2814ed['status'](_0x9c9563)[_0xb8c8('0x2e')]();};}function respondWithResult(_0x8af579,_0x481171){_0x481171=_0x481171||0xc8;return function(_0x90eca8){if(_0x90eca8){return _0x8af579[_0xb8c8('0x2f')](_0x481171)['json'](_0x90eca8);}};}function respondWithFilteredResult(_0x3211c3,_0x4bd15f){return function(_0x3f50c9){if(_0x3f50c9){var _0xcccbee=_0x3f50c9[_0xb8c8('0x30')],_0x169c9f=_0x4bd15f[_0xb8c8('0x31')],_0x236347=_0x4bd15f[_0xb8c8('0x31')]+_0x4bd15f[_0xb8c8('0x32')],_0x107de0;if(_0x236347>=_0xcccbee){_0x236347=_0xcccbee;_0x107de0=0xc8;}else{_0x107de0=0xce;}_0x3211c3['status'](_0x107de0);return _0x3211c3[_0xb8c8('0x33')]('Content-Range',_0x169c9f+'-'+_0x236347+'/'+_0xcccbee)[_0xb8c8('0x34')](_0x3f50c9);}return null;};}function patchUpdates(_0x1141a8){return function(_0x28d36f){try{jsonpatch['apply'](_0x28d36f,_0x1141a8,!![]);}catch(_0x38debc){return BPromise[_0xb8c8('0x35')](_0x38debc);}return _0x28d36f[_0xb8c8('0x36')]();};}function saveUpdates(_0x8b8b6,_0x13fbf3){return function(_0x3819b2){if(_0x3819b2){return _0x3819b2[_0xb8c8('0x37')](_0x8b8b6)[_0xb8c8('0x23')](function(_0x257c4c){return _0x257c4c;});}return null;};}function removeEntity(_0x2c66fb,_0x4fd08c){return function(_0x361c9b){if(_0x361c9b){return _0x361c9b[_0xb8c8('0x38')]()[_0xb8c8('0x23')](function(){var _0x2ee0df=_0x361c9b[_0xb8c8('0x39')]({'plain':!![]});var _0x45dbeb=_0xb8c8('0x3a');return db[_0xb8c8('0x3b')]['destroy']({'where':{'type':_0x45dbeb,'resourceId':_0x2ee0df['id']}})[_0xb8c8('0x23')](function(){return _0x361c9b;});})['then'](function(){_0x2c66fb[_0xb8c8('0x2f')](0xcc)[_0xb8c8('0x2e')]();});}};}function handleEntityNotFound(_0x3d99cf,_0xaef897){return function(_0x2cd6b6){if(!_0x2cd6b6){_0x3d99cf[_0xb8c8('0x3c')](0x194);}return _0x2cd6b6;};}function handleError(_0x519385,_0xa1e08e){_0xa1e08e=_0xa1e08e||0x1f4;return function(_0x11b8ed){logger[_0xb8c8('0x2a')](_0x11b8ed[_0xb8c8('0x3d')]);if(_0x11b8ed[_0xb8c8('0x3e')]){delete _0x11b8ed['name'];}_0x519385['status'](_0xa1e08e)[_0xb8c8('0x3f')](_0x11b8ed);};}exports[_0xb8c8('0x40')]=function(_0x3702d6,_0x3360a3){var _0x243cd6={},_0x11a6cb={},_0x44756a={'count':0x0,'rows':[]};var _0x3e8667=_[_0xb8c8('0x41')](db['ChatQueue'][_0xb8c8('0x42')],function(_0x4923e4){return{'name':_0x4923e4[_0xb8c8('0x43')],'type':_0x4923e4[_0xb8c8('0x44')][_0xb8c8('0x45')]};});_0x11a6cb[_0xb8c8('0x46')]=_[_0xb8c8('0x41')](_0x3e8667,_0xb8c8('0x3e'));_0x11a6cb[_0xb8c8('0x47')]=_[_0xb8c8('0x48')](_0x3702d6[_0xb8c8('0x47')]);_0x11a6cb['filters']=_[_0xb8c8('0x49')](_0x11a6cb[_0xb8c8('0x46')],_0x11a6cb[_0xb8c8('0x47')]);_0x243cd6[_0xb8c8('0x4a')]=_[_0xb8c8('0x49')](_0x11a6cb[_0xb8c8('0x46')],qs[_0xb8c8('0x4b')](_0x3702d6[_0xb8c8('0x47')][_0xb8c8('0x4b')]));_0x243cd6[_0xb8c8('0x4a')]=_0x243cd6[_0xb8c8('0x4a')][_0xb8c8('0x4c')]?_0x243cd6[_0xb8c8('0x4a')]:_0x11a6cb[_0xb8c8('0x46')];if(!_0x3702d6[_0xb8c8('0x47')][_0xb8c8('0x4d')](_0xb8c8('0x4e'))){_0x243cd6['limit']=qs['limit'](_0x3702d6[_0xb8c8('0x47')][_0xb8c8('0x32')]);_0x243cd6[_0xb8c8('0x31')]=qs[_0xb8c8('0x31')](_0x3702d6[_0xb8c8('0x47')][_0xb8c8('0x31')]);}_0x243cd6[_0xb8c8('0x4f')]=qs['sort'](_0x3702d6[_0xb8c8('0x47')]['sort']);_0x243cd6['where']=qs[_0xb8c8('0x50')](_[_0xb8c8('0x51')](_0x3702d6[_0xb8c8('0x47')],_0x11a6cb[_0xb8c8('0x50')]));if(_0x3702d6['query'][_0xb8c8('0x52')]){_0x243cd6[_0xb8c8('0x53')]=_['merge'](_0x243cd6[_0xb8c8('0x53')],{'$or':_['map'](_0x3e8667,function(_0x4f2d5c){if(_0x4f2d5c['type']!==_0xb8c8('0x54')){var _0x231765={};_0x231765[_0x4f2d5c['name']]={'$like':'%'+_0x3702d6[_0xb8c8('0x47')]['filter']+'%'};return _0x231765;}})});}_0x243cd6=_[_0xb8c8('0x55')]({},_0x243cd6,_0x3702d6[_0xb8c8('0x56')]);var _0x3978e2={'where':_0x243cd6['where']};return db[_0xb8c8('0x57')][_0xb8c8('0x30')](_0x3978e2)['then'](function(_0x3ccaeb){_0x44756a[_0xb8c8('0x30')]=_0x3ccaeb;if(_0x3702d6[_0xb8c8('0x47')][_0xb8c8('0x58')]){_0x243cd6[_0xb8c8('0x59')]=[{'all':!![]}];}return db[_0xb8c8('0x57')]['findAll'](_0x243cd6);})[_0xb8c8('0x23')](function(_0x4d4304){_0x44756a[_0xb8c8('0x5a')]=_0x4d4304;return _0x44756a;})['then'](respondWithFilteredResult(_0x3360a3,_0x243cd6))[_0xb8c8('0x5b')](handleError(_0x3360a3,null));};exports[_0xb8c8('0x5c')]=function(_0x420ed7,_0x49320a){var _0x4d4504={'raw':!![],'where':{'id':_0x420ed7['params']['id']}},_0x11865d={};_0x11865d[_0xb8c8('0x46')]=_['keys'](db[_0xb8c8('0x57')][_0xb8c8('0x42')]);_0x11865d['query']=_[_0xb8c8('0x48')](_0x420ed7[_0xb8c8('0x47')]);_0x11865d[_0xb8c8('0x50')]=_[_0xb8c8('0x49')](_0x11865d[_0xb8c8('0x46')],_0x11865d[_0xb8c8('0x47')]);_0x4d4504[_0xb8c8('0x4a')]=_[_0xb8c8('0x49')](_0x11865d['model'],qs[_0xb8c8('0x4b')](_0x420ed7[_0xb8c8('0x47')]['fields']));_0x4d4504[_0xb8c8('0x4a')]=_0x4d4504[_0xb8c8('0x4a')][_0xb8c8('0x4c')]?_0x4d4504[_0xb8c8('0x4a')]:_0x11865d[_0xb8c8('0x46')];if(_0x420ed7[_0xb8c8('0x47')]['includeAll']){_0x4d4504['include']=[{'all':!![]}];}_0x4d4504=_[_0xb8c8('0x55')]({},_0x4d4504,_0x420ed7[_0xb8c8('0x56')]);return db[_0xb8c8('0x57')]['find'](_0x4d4504)[_0xb8c8('0x23')](handleEntityNotFound(_0x49320a,null))[_0xb8c8('0x23')](respondWithResult(_0x49320a,null))[_0xb8c8('0x5b')](handleError(_0x49320a,null));};exports[_0xb8c8('0x5d')]=function(_0x8a929a,_0x1f88d2){return db[_0xb8c8('0x57')][_0xb8c8('0x5d')](_0x8a929a['body'],{})['then'](function(_0x41ed5e){var _0xff3489=_0x8a929a[_0xb8c8('0x5e')][_0xb8c8('0x39')]({'plain':!![]});if(!_0xff3489)throw new Error(_0xb8c8('0x5f'));if(_0xff3489[_0xb8c8('0x60')]===_0xb8c8('0x5e')){var _0x5af85b=_0x41ed5e[_0xb8c8('0x39')]({'plain':!![]});var _0x1a233b=_0xb8c8('0x3a');return db[_0xb8c8('0x61')][_0xb8c8('0x62')]({'where':{'name':_0x1a233b,'userProfileId':_0xff3489[_0xb8c8('0x63')]},'raw':!![]})[_0xb8c8('0x23')](function(_0x342cf3){if(_0x342cf3&&_0x342cf3[_0xb8c8('0x64')]===0x0){return db[_0xb8c8('0x3b')][_0xb8c8('0x5d')]({'name':_0x5af85b['name'],'resourceId':_0x5af85b['id'],'type':_0x342cf3[_0xb8c8('0x3e')],'sectionId':_0x342cf3['id']},{})[_0xb8c8('0x23')](function(){return _0x41ed5e;});}else{return _0x41ed5e;}})[_0xb8c8('0x5b')](function(_0x26372f){logger[_0xb8c8('0x2a')](_0xb8c8('0x65'),_0x26372f);throw _0x26372f;});}return _0x41ed5e;})[_0xb8c8('0x23')](respondWithResult(_0x1f88d2,0xc9))[_0xb8c8('0x5b')](handleError(_0x1f88d2,null));};exports[_0xb8c8('0x37')]=function(_0x48805f,_0x1bc468){if(_0x48805f[_0xb8c8('0x66')]['id']){delete _0x48805f['body']['id'];}return db[_0xb8c8('0x57')]['find']({'where':{'id':_0x48805f[_0xb8c8('0x67')]['id']}})[_0xb8c8('0x23')](handleEntityNotFound(_0x1bc468,null))[_0xb8c8('0x23')](saveUpdates(_0x48805f[_0xb8c8('0x66')],null))[_0xb8c8('0x23')](respondWithResult(_0x1bc468,null))['catch'](handleError(_0x1bc468,null));};exports['destroy']=function(_0x1f73ee,_0x58f2b1){return db[_0xb8c8('0x57')][_0xb8c8('0x62')]({'where':{'id':_0x1f73ee[_0xb8c8('0x67')]['id']}})[_0xb8c8('0x23')](handleEntityNotFound(_0x58f2b1,null))[_0xb8c8('0x23')](removeEntity(_0x58f2b1,null))['catch'](handleError(_0x58f2b1,null));};exports['describe']=function(_0x56703b,_0x2e7b0f){return db['ChatQueue'][_0xb8c8('0x68')]()[_0xb8c8('0x23')](respondWithResult(_0x2e7b0f,null))['catch'](handleError(_0x2e7b0f,null));};exports[_0xb8c8('0x69')]=function(_0x41bea0,_0x53cda7,_0x2f49fd){var _0xdeacb1={'raw':!![],'where':{}},_0x1d69c7={},_0x612ec2;return db[_0xb8c8('0x57')][_0xb8c8('0x6a')]({'where':{'id':_0x41bea0['params']['id']}})[_0xb8c8('0x23')](handleEntityNotFound(_0x53cda7,null))[_0xb8c8('0x23')](function(_0x22ff9c){if(_0x22ff9c){_0x612ec2=_0x22ff9c[_0xb8c8('0x39')]({'plain':!![]});_0x1d69c7[_0xb8c8('0x46')]=_[_0xb8c8('0x48')](db['UserChatQueue']['rawAttributes']);_0x1d69c7['query']=_[_0xb8c8('0x48')](_0x41bea0[_0xb8c8('0x47')]);_0x1d69c7[_0xb8c8('0x50')]=_[_0xb8c8('0x49')](_0x1d69c7[_0xb8c8('0x46')],_0x1d69c7[_0xb8c8('0x47')]);_0xdeacb1[_0xb8c8('0x4a')]=_[_0xb8c8('0x49')](_0x1d69c7[_0xb8c8('0x46')],qs[_0xb8c8('0x4b')](_0x41bea0[_0xb8c8('0x47')][_0xb8c8('0x4b')]));_0xdeacb1['attributes']=_0xdeacb1[_0xb8c8('0x4a')][_0xb8c8('0x4c')]?_0xdeacb1['attributes']:_0x1d69c7['model'];if(!_0x41bea0[_0xb8c8('0x47')][_0xb8c8('0x4d')](_0xb8c8('0x4e'))){_0xdeacb1['limit']=qs[_0xb8c8('0x32')](_0x41bea0['query'][_0xb8c8('0x32')]);_0xdeacb1[_0xb8c8('0x31')]=qs[_0xb8c8('0x31')](_0x41bea0[_0xb8c8('0x47')][_0xb8c8('0x31')]);}_0xdeacb1['order']=qs[_0xb8c8('0x6b')](_0x41bea0[_0xb8c8('0x47')][_0xb8c8('0x6b')]);_0xdeacb1['where']=qs['filters'](_[_0xb8c8('0x51')](_0x41bea0[_0xb8c8('0x47')],_0x1d69c7[_0xb8c8('0x50')]));_0xdeacb1[_0xb8c8('0x53')][_0xb8c8('0x6c')]=_0x22ff9c['id'];if(_0x41bea0[_0xb8c8('0x47')][_0xb8c8('0x52')]){_0xdeacb1[_0xb8c8('0x53')]=_[_0xb8c8('0x55')](_0xdeacb1[_0xb8c8('0x53')],{'$or':_[_0xb8c8('0x41')](_0xdeacb1[_0xb8c8('0x4a')],function(_0x520aa9){var _0x4c2215={};_0x4c2215[_0x520aa9]={'$like':'%'+_0x41bea0[_0xb8c8('0x47')][_0xb8c8('0x52')]+'%'};return _0x4c2215;})});}_0xdeacb1=_[_0xb8c8('0x55')]({},_0xdeacb1,_0x41bea0['options']);return db[_0xb8c8('0x6d')][_0xb8c8('0x6e')](_0xdeacb1);}})[_0xb8c8('0x23')](function(_0x3f6deb){if(_0x3f6deb){return db['User'][_0xb8c8('0x6f')]({'where':{'id':_['map'](_0x3f6deb,_0xb8c8('0x70')),'role':_0xb8c8('0x71')},'attributes':['id','name',_0xb8c8('0x72'),_0xb8c8('0x73'),'createdAt']});}})[_0xb8c8('0x23')](function(_0x2db1cd){if(_0x2db1cd){return{'count':_0x2db1cd[_0xb8c8('0x30')],'rows':_[_0xb8c8('0x41')](_0x2db1cd['rows'],function(_0xf7de92){return{'membername':_0xf7de92[_0xb8c8('0x3e')],'UserId':_0xf7de92['id'],'queue_name':_0x612ec2[_0xb8c8('0x3e')],'ChatQueueId':_0x612ec2['id'],'interface':util[_0xb8c8('0x74')]('%s/%s',_0xb8c8('0x75'),_0xf7de92['name']),'penalty':0x0,'paused':_0xf7de92[_0xb8c8('0x72')],'createdAt':_0xf7de92[_0xb8c8('0x76')],'updatedAt':_0xf7de92[_0xb8c8('0x73')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x53cda7,_0xdeacb1))[_0xb8c8('0x5b')](handleError(_0x53cda7,null));};exports[_0xb8c8('0x77')]=function(_0x35dea4,_0x6e871e,_0x1a2dd2){var _0x297dc9={};var _0x42a505={};var _0x34c03f;var _0x3b2252;return db[_0xb8c8('0x57')][_0xb8c8('0x6a')]({'where':{'id':_0x35dea4[_0xb8c8('0x67')]['id']}})['then'](handleEntityNotFound(_0x6e871e,null))['then'](function(_0x23f5cb){if(_0x23f5cb){_0x34c03f=_0x23f5cb;_0x42a505[_0xb8c8('0x46')]=_[_0xb8c8('0x48')](db[_0xb8c8('0x78')]['rawAttributes']);_0x42a505[_0xb8c8('0x47')]=_[_0xb8c8('0x48')](_0x35dea4[_0xb8c8('0x47')]);_0x42a505[_0xb8c8('0x50')]=_[_0xb8c8('0x49')](_0x42a505[_0xb8c8('0x46')],_0x42a505[_0xb8c8('0x47')]);_0x297dc9['attributes']=_[_0xb8c8('0x49')](_0x42a505['model'],qs[_0xb8c8('0x4b')](_0x35dea4[_0xb8c8('0x47')][_0xb8c8('0x4b')]));_0x297dc9[_0xb8c8('0x4a')]=_0x297dc9['attributes'][_0xb8c8('0x4c')]?_0x297dc9['attributes']:_0x42a505[_0xb8c8('0x46')];_0x297dc9['order']=qs['sort'](_0x35dea4[_0xb8c8('0x47')][_0xb8c8('0x6b')]);_0x297dc9[_0xb8c8('0x53')]=qs[_0xb8c8('0x50')](_[_0xb8c8('0x51')](_0x35dea4['query'],_0x42a505['filters']));if(_0x35dea4[_0xb8c8('0x47')][_0xb8c8('0x52')]){_0x297dc9[_0xb8c8('0x53')]=_['merge'](_0x297dc9['where'],{'$or':_[_0xb8c8('0x41')](_0x297dc9[_0xb8c8('0x4a')],function(_0x272d21){var _0xef8f66={};_0xef8f66[_0x272d21]={'$like':'%'+_0x35dea4[_0xb8c8('0x47')]['filter']+'%'};return _0xef8f66;})});}_0x297dc9=_[_0xb8c8('0x55')]({},_0x297dc9,_0x35dea4[_0xb8c8('0x56')]);return _0x34c03f['getTeams'](_0x297dc9);}})[_0xb8c8('0x23')](function(_0x54746c){if(_0x54746c){_0x3b2252=_0x54746c[_0xb8c8('0x4c')];if(!_0x35dea4[_0xb8c8('0x47')][_0xb8c8('0x4d')](_0xb8c8('0x4e'))){_0x297dc9[_0xb8c8('0x32')]=qs[_0xb8c8('0x32')](_0x35dea4['query'][_0xb8c8('0x32')]);_0x297dc9[_0xb8c8('0x31')]=qs[_0xb8c8('0x31')](_0x35dea4[_0xb8c8('0x47')][_0xb8c8('0x31')]);}return _0x34c03f[_0xb8c8('0x77')](_0x297dc9);}})[_0xb8c8('0x23')](function(_0x5d3127){if(_0x5d3127){return _0x5d3127?{'count':_0x3b2252,'rows':_0x5d3127}:null;}})[_0xb8c8('0x23')](respondWithResult(_0x6e871e,null))[_0xb8c8('0x5b')](handleError(_0x6e871e,null));};exports['addTeams']=function(_0x5b279d,_0x3f30f5,_0x59e8ba){var _0x1db647=_0x5b279d[_0xb8c8('0x66')]['ids'];return db[_0xb8c8('0x78')]['findAll']({'where':{'id':_0x1db647},'attributes':['id'],'include':[{'model':db[_0xb8c8('0x79')],'as':'Agents','attributes':['id','name','online',_0xb8c8('0x7a'),_0xb8c8('0x7b')],'raw':!![]}]})[_0xb8c8('0x23')](function(_0xca09b){if(_0xca09b){var _0x2fca50=_[_0xb8c8('0x7c')](_0xca09b,function(_0x2abe6b){var _0x3f79d6=_0x2abe6b[_0xb8c8('0x39')]({'plain':!![]});return _0x3f79d6[_0xb8c8('0x7d')];});return db[_0xb8c8('0x57')][_0xb8c8('0x62')]({'where':{'id':_0x5b279d[_0xb8c8('0x67')]['id']}})[_0xb8c8('0x23')](function(_0x4ac6da){return db['sequelize'][_0xb8c8('0x7e')](function(_0x1aa412){return _0x4ac6da[_0xb8c8('0x7f')](_0x1db647,{'transaction':_0x1aa412})[_0xb8c8('0x23')](function(){return BPromise[_0xb8c8('0x80')](_0x2fca50,function(_0x150265){return db[_0xb8c8('0x6d')][_0xb8c8('0x81')]({'where':{'UserId':_0x150265['id'],'ChatQueueId':_0x5b279d[_0xb8c8('0x67')]['id']},'transaction':_0x1aa412});});})[_0xb8c8('0x23')](function(){_0x2fca50['forEach'](function(_0x4e71d4){socket['emit']('userChatQueue:save',{'UserId':_0x4e71d4['id'],'ChatQueueId':_0x4ac6da['id']});});});});});}})[_0xb8c8('0x23')](respondWithStatusCode(_0x3f30f5,null))['catch'](handleError(_0x3f30f5,null));};exports[_0xb8c8('0x82')]=function(_0x51e7f,_0x5daa7b,_0x3dd5a6){return db['Team']['findAll']({'where':{'id':_0x51e7f[_0xb8c8('0x47')][_0xb8c8('0x83')]},'attributes':['id'],'include':[{'model':db[_0xb8c8('0x79')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5daa7b,null))[_0xb8c8('0x23')](function(_0x230662){var _0x15af5a=_[_0xb8c8('0x41')](_0x230662,'id');var _0x2dd5ae=[];var _0x4f13da=[];var _0x81c769=squel[_0xb8c8('0x84')]();_0x81c769[_0xb8c8('0x85')]('tq.TeamId')[_0xb8c8('0x86')](_0xb8c8('0x87'),'tq')[_0xb8c8('0x88')]('user_has_teams','ut',_0xb8c8('0x89'))['where'](_0xb8c8('0x8a'),_0x51e7f[_0xb8c8('0x67')]['id']);for(var _0x5dbbf0=0x0;_0x5dbbf0<_0x230662[_0xb8c8('0x4c')];_0x5dbbf0+=0x1){let _0x4714cd=_0x230662[_0x5dbbf0];for(var _0x24b4c7=0x0;_0x24b4c7<_0x4714cd[_0xb8c8('0x7d')][_0xb8c8('0x4c')];_0x24b4c7+=0x1){let _0x33d7d9=_0x4714cd[_0xb8c8('0x7d')][_0x24b4c7];var _0x3917fe=_0x81c769[_0xb8c8('0x8b')]();_0x3917fe['where'](_0xb8c8('0x8c'),_0x33d7d9['id']);_0x4f13da[_0xb8c8('0x8d')](db[_0xb8c8('0x8e')][_0xb8c8('0x47')](_0x3917fe[_0xb8c8('0x8f')](),{'type':db[_0xb8c8('0x8e')][_0xb8c8('0x90')]['SELECT']})[_0xb8c8('0x23')](function(_0x4f96fb){if(_0x4f96fb['length']===0x1){return _0x33d7d9['id'];}else{var _0x181ead=_[_0xb8c8('0x91')](_[_0xb8c8('0x41')](_0x4f96fb,_0xb8c8('0x92')),function(_0x3a4b13){return _[_0xb8c8('0x93')](_0x15af5a,_0x3a4b13);});if(_0x181ead){return _0x33d7d9['id'];}}}));}}return BPromise[_0xb8c8('0x94')](_0x4f13da)['then'](function(_0x550c6e){_0x2dd5ae=_(_0x2dd5ae)[_0xb8c8('0x95')](_0x550c6e)['compact']()[_0xb8c8('0x96')]();return db[_0xb8c8('0x57')][_0xb8c8('0x62')]({'where':{'id':_0x51e7f[_0xb8c8('0x67')]['id']}})[_0xb8c8('0x23')](function(_0x35815b){return db['sequelize'][_0xb8c8('0x7e')](function(_0x2e8ab1){return _0x35815b[_0xb8c8('0x82')](_0x51e7f['query'][_0xb8c8('0x83')],{'transaction':_0x2e8ab1})[_0xb8c8('0x23')](function(){if(!_[_0xb8c8('0x97')](_0x2dd5ae)){return _0x35815b[_0xb8c8('0x98')](_0x2dd5ae,{'transaction':_0x2e8ab1});}})['then'](function(){_0x2dd5ae[_0xb8c8('0x99')](function(_0x40094f){socket[_0xb8c8('0x9a')](_0xb8c8('0x9b'),{'UserId':_0x40094f,'ChatQueueId':_0x35815b['id']});});});});});});})[_0xb8c8('0x23')](respondWithStatusCode(_0x5daa7b,null))[_0xb8c8('0x5b')](handleError(_0x5daa7b,null));};exports[_0xb8c8('0x9c')]=function(_0x268607,_0xb8037a,_0x2f9552){return db[_0xb8c8('0x57')]['find']({'where':{'id':_0x268607['params']['id']}})[_0xb8c8('0x23')](handleEntityNotFound(_0xb8037a,null))[_0xb8c8('0x23')](function(_0x39db10){if(_0x39db10){return _0x39db10[_0xb8c8('0x9c')](_0x268607[_0xb8c8('0x66')]['ids'],_[_0xb8c8('0x9d')](_0x268607[_0xb8c8('0x66')],[_0xb8c8('0x83'),'id'])||{})[_0xb8c8('0x9e')](function(_0x383a26){for(var _0x4a9a07=0x0;_0x4a9a07<_0x268607['body'][_0xb8c8('0x83')][_0xb8c8('0x4c')];_0x4a9a07+=0x1){socket['emit'](_0xb8c8('0x9f'),{'UserId':_0x268607[_0xb8c8('0x66')][_0xb8c8('0x83')][_0x4a9a07],'ChatQueueId':_0x268607['params']['id']});}return _0x383a26;});}})[_0xb8c8('0x23')](respondWithResult(_0xb8037a,null))[_0xb8c8('0x5b')](handleError(_0xb8037a,null));};exports['removeAgents']=function(_0x31e4ff,_0x44bc3c,_0x16768e){return db[_0xb8c8('0x57')][_0xb8c8('0x62')]({'where':{'id':_0x31e4ff[_0xb8c8('0x67')]['id']}})[_0xb8c8('0x23')](handleEntityNotFound(_0x44bc3c,null))[_0xb8c8('0x23')](function(_0x69d0d6){if(_0x69d0d6){return _0x69d0d6[_0xb8c8('0x98')](_0x31e4ff['query']['ids'])[_0xb8c8('0x23')](function(){if(_['isArray'](_0x31e4ff[_0xb8c8('0x47')][_0xb8c8('0x83')])){for(var _0x279327=0x0;_0x279327<_0x31e4ff[_0xb8c8('0x47')][_0xb8c8('0x83')][_0xb8c8('0x4c')];_0x279327+=0x1){socket[_0xb8c8('0x9a')](_0xb8c8('0x9b'),{'UserId':Number(_0x31e4ff[_0xb8c8('0x47')]['ids'][_0x279327]),'ChatQueueId':Number(_0x31e4ff[_0xb8c8('0x67')]['id'])});}}else{socket[_0xb8c8('0x9a')](_0xb8c8('0x9b'),{'UserId':Number(_0x31e4ff['query'][_0xb8c8('0x83')]),'ChatQueueId':Number(_0x31e4ff[_0xb8c8('0x67')]['id'])});}});}})[_0xb8c8('0x23')](respondWithStatusCode(_0x44bc3c,null))[_0xb8c8('0x5b')](handleError(_0x44bc3c,null));};exports[_0xb8c8('0xa0')]=function(_0x1a76c5,_0x2c1706,_0x50c640){var _0x2d2ea0={};var _0x3be7af={};var _0x4ceedd;var _0x24893a;return db[_0xb8c8('0x57')][_0xb8c8('0x6a')]({'where':{'id':_0x1a76c5[_0xb8c8('0x67')]['id']}})[_0xb8c8('0x23')](handleEntityNotFound(_0x2c1706,null))['then'](function(_0x452059){if(_0x452059){_0x4ceedd=_0x452059;_0x3be7af[_0xb8c8('0x46')]=_['keys'](db[_0xb8c8('0x79')]['rawAttributes']);_0x3be7af[_0xb8c8('0x47')]=_['keys'](_0x1a76c5[_0xb8c8('0x47')]);_0x3be7af[_0xb8c8('0x50')]=_['intersection'](_0x3be7af[_0xb8c8('0x46')],_0x3be7af[_0xb8c8('0x47')]);_0x2d2ea0['attributes']=_[_0xb8c8('0x49')](_0x3be7af[_0xb8c8('0x46')],qs[_0xb8c8('0x4b')](_0x1a76c5[_0xb8c8('0x47')][_0xb8c8('0x4b')]));_0x2d2ea0['attributes']=_0x2d2ea0[_0xb8c8('0x4a')][_0xb8c8('0x4c')]?_0x2d2ea0[_0xb8c8('0x4a')]:_0x3be7af[_0xb8c8('0x46')];_0x2d2ea0[_0xb8c8('0x4f')]=qs['sort'](_0x1a76c5[_0xb8c8('0x47')][_0xb8c8('0x6b')]);_0x2d2ea0[_0xb8c8('0x53')]=qs[_0xb8c8('0x50')](_['pick'](_0x1a76c5[_0xb8c8('0x47')],_0x3be7af[_0xb8c8('0x50')]));if(_0x1a76c5[_0xb8c8('0x47')][_0xb8c8('0x52')]){_0x2d2ea0['where']=_['merge'](_0x2d2ea0['where'],{'$or':_[_0xb8c8('0x41')](_0x2d2ea0[_0xb8c8('0x4a')],function(_0x5a3fea){var _0x2d4da7={};_0x2d4da7[_0x5a3fea]={'$like':'%'+_0x1a76c5['query']['filter']+'%'};return _0x2d4da7;})});}_0x2d2ea0=_[_0xb8c8('0x55')]({},_0x2d2ea0,_0x1a76c5[_0xb8c8('0x56')]);return _0x4ceedd[_0xb8c8('0xa0')](_0x2d2ea0);}})[_0xb8c8('0x23')](function(_0x22d158){if(_0x22d158){_0x24893a=_0x22d158[_0xb8c8('0x4c')];if(!_0x1a76c5[_0xb8c8('0x47')]['hasOwnProperty'](_0xb8c8('0x4e'))){_0x2d2ea0['limit']=qs[_0xb8c8('0x32')](_0x1a76c5[_0xb8c8('0x47')]['limit']);_0x2d2ea0[_0xb8c8('0x31')]=qs[_0xb8c8('0x31')](_0x1a76c5[_0xb8c8('0x47')][_0xb8c8('0x31')]);}return _0x4ceedd[_0xb8c8('0xa0')](_0x2d2ea0);}})[_0xb8c8('0x23')](function(_0x1caacc){if(_0x1caacc){return _0x1caacc?{'count':_0x24893a,'rows':_0x1caacc}:null;}})[_0xb8c8('0x23')](respondWithResult(_0x2c1706,null))[_0xb8c8('0x5b')](handleError(_0x2c1706,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index edb14dd..7121578 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 _0xbaf0=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatQueue'];(function(_0x35d2d6,_0x14e944){var _0x1637d5=function(_0x327b04){while(--_0x327b04){_0x35d2d6['push'](_0x35d2d6['shift']());}};_0x1637d5(++_0x14e944);}(_0xbaf0,0x12a));var _0x0baf=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xbaf0[_0x432682];return _0x463d05;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x0baf('0x0'))['db'][_0x0baf('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x0baf('0x2')](0x0);var events={'afterCreate':_0x0baf('0x3'),'afterUpdate':_0x0baf('0x4'),'afterDestroy':_0x0baf('0x5')};function emitEvent(_0x5a3e42){return function(_0x232cc7,_0x1c383e,_0x2d3fa5){ChatQueueEvents[_0x0baf('0x6')](_0x5a3e42+':'+_0x232cc7['id'],_0x232cc7);ChatQueueEvents[_0x0baf('0x6')](_0x5a3e42,_0x232cc7);_0x2d3fa5(null);};}for(var e in events){if(events[_0x0baf('0x7')](e)){var event=events[e];ChatQueue[_0x0baf('0x8')](e,emitEvent(event));}}module[_0x0baf('0x9')]=ChatQueueEvents; \ No newline at end of file +var _0x5f2f=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update'];(function(_0x49d984,_0x49f753){var _0x57400f=function(_0x327f13){while(--_0x327f13){_0x49d984['push'](_0x49d984['shift']());}};_0x57400f(++_0x49f753);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2b2c1c,_0x39a1ce){_0x2b2c1c=_0x2b2c1c-0x0;var _0x110566=_0x5f2f[_0x2b2c1c];return _0x110566;};'use strict';var EventEmitter=require(_0xf5f2('0x0'));var ChatQueue=require(_0xf5f2('0x1'))['db'][_0xf5f2('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xf5f2('0x3')](0x0);var events={'afterCreate':_0xf5f2('0x4'),'afterUpdate':_0xf5f2('0x5'),'afterDestroy':_0xf5f2('0x6')};function emitEvent(_0x107cf){return function(_0x501fbd,_0x4854b6,_0x1665c7){ChatQueueEvents[_0xf5f2('0x7')](_0x107cf+':'+_0x501fbd['id'],_0x501fbd);ChatQueueEvents[_0xf5f2('0x7')](_0x107cf,_0x501fbd);_0x1665c7(null);};}for(var e in events){if(events[_0xf5f2('0x8')](e)){var event=events[e];ChatQueue[_0xf5f2('0x9')](e,emitEvent(event));}}module[_0xf5f2('0xa')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index c0c46ed..3c24005 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 _0x7b99=['./chatQueue.attributes','exports','define','chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x111c17,_0x275184){var _0x5ff50a=function(_0x4ebc34){while(--_0x4ebc34){_0x111c17['push'](_0x111c17['shift']());}};_0x5ff50a(++_0x275184);}(_0x7b99,0x16f));var _0x97b9=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x7b99[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0x97b9('0x0'));var util=require(_0x97b9('0x1'));var logger=require(_0x97b9('0x2'))(_0x97b9('0x3'));var moment=require(_0x97b9('0x4'));var BPromise=require(_0x97b9('0x5'));var rp=require(_0x97b9('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x97b9('0x7'));module[_0x97b9('0x8')]=function(_0x3d3adf,_0x446e83){return _0x3d3adf[_0x97b9('0x9')]('ChatQueue',attributes,{'tableName':_0x97b9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2739=['exports','define','chat_queues','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x961d05,_0x34327f){var _0x4a6038=function(_0xeba369){while(--_0xeba369){_0x961d05['push'](_0x961d05['shift']());}};_0x4a6038(++_0x34327f);}(_0x2739,0xdf));var _0x9273=function(_0x20f17b,_0x1e2cca){_0x20f17b=_0x20f17b-0x0;var _0x1723aa=_0x2739[_0x20f17b];return _0x1723aa;};'use strict';var _=require('lodash');var util=require(_0x9273('0x0'));var logger=require(_0x9273('0x1'))(_0x9273('0x2'));var moment=require(_0x9273('0x3'));var BPromise=require('bluebird');var rp=require(_0x9273('0x4'));var fs=require('fs');var path=require(_0x9273('0x5'));var rimraf=require(_0x9273('0x6'));var config=require(_0x9273('0x7'));var attributes=require('./chatQueue.attributes');module[_0x9273('0x8')]=function(_0x14e840,_0x159cf1){return _0x14e840[_0x9273('0x9')]('ChatQueue',attributes,{'tableName':_0x9273('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 08876af..490460a 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 _0xe1aa=['then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','attributes','limit','include','model','map','ShowChatQueue','find','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','localhost','./chatQueue.socket','request'];(function(_0x29fcce,_0x233d18){var _0x4f7dc8=function(_0x44fc27){while(--_0x44fc27){_0x29fcce['push'](_0x29fcce['shift']());}};_0x4f7dc8(++_0x233d18);}(_0xe1aa,0xfc));var _0xae1a=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xe1aa[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0xae1a('0x0'));var util=require(_0xae1a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xae1a('0x2'));var fs=require('fs');var Redis=require(_0xae1a('0x3'));var db=require(_0xae1a('0x4'))['db'];var utils=require(_0xae1a('0x5'));var logger=require(_0xae1a('0x6'))('rpc');var config=require(_0xae1a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xae1a('0x8')][_0xae1a('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0xae1a('0xa')],{'host':_0xae1a('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xae1a('0xa')]));require(_0xae1a('0xc'))['register'](socket);function respondWithRpcPromise(_0x22bb87,_0x31abc0,_0x39efce){return new BPromise(function(_0xcd51ac,_0x4a648b){return client[_0xae1a('0xd')](_0x22bb87,_0x39efce)[_0xae1a('0xe')](function(_0x54722b){logger[_0xae1a('0xf')](_0xae1a('0x10'),_0x31abc0,_0xae1a('0x11'));logger[_0xae1a('0x12')](_0xae1a('0x13'),_0x31abc0,_0xae1a('0x11'),JSON[_0xae1a('0x14')](_0x54722b));if(_0x54722b[_0xae1a('0x15')]){if(_0x54722b[_0xae1a('0x15')][_0xae1a('0x16')]===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x31abc0,_0x54722b['error']['message']);return _0x4a648b(_0x54722b[_0xae1a('0x15')][_0xae1a('0x17')]);}logger[_0xae1a('0x15')](_0xae1a('0x10'),_0x31abc0,_0x54722b[_0xae1a('0x15')]['message']);return _0xcd51ac(_0x54722b[_0xae1a('0x15')][_0xae1a('0x17')]);}else{logger['info'](_0xae1a('0x10'),_0x31abc0,_0xae1a('0x11'));_0xcd51ac(_0x54722b[_0xae1a('0x18')][_0xae1a('0x17')]);}})[_0xae1a('0x19')](function(_0x28ad91){logger[_0xae1a('0x15')](_0xae1a('0x10'),_0x31abc0,_0x28ad91);_0x4a648b(_0x28ad91);});});}exports[_0xae1a('0x1a')]=function(_0xd7bb55){var _0x49a8af=this;return new Promise(function(_0x2493d5,_0x112604){return db[_0xae1a('0x1b')][_0xae1a('0x1c')]({'raw':_0xd7bb55[_0xae1a('0x1d')]?_0xd7bb55['options'][_0xae1a('0x1e')]===undefined?!![]:![]:!![],'where':_0xd7bb55[_0xae1a('0x1d')]?_0xd7bb55[_0xae1a('0x1d')]['where']||null:null,'attributes':_0xd7bb55[_0xae1a('0x1d')]?_0xd7bb55[_0xae1a('0x1d')][_0xae1a('0x1f')]||null:null,'limit':_0xd7bb55[_0xae1a('0x1d')]?_0xd7bb55[_0xae1a('0x1d')][_0xae1a('0x20')]||null:null,'include':_0xd7bb55['options']?_0xd7bb55[_0xae1a('0x1d')]['include']?_['map'](_0xd7bb55[_0xae1a('0x1d')][_0xae1a('0x21')],function(_0x3907c6){return{'model':db[_0x3907c6[_0xae1a('0x22')]],'as':_0x3907c6['as'],'attributes':_0x3907c6[_0xae1a('0x1f')],'include':_0x3907c6['include']?_[_0xae1a('0x23')](_0x3907c6[_0xae1a('0x21')],function(_0x29ed55){return{'model':db[_0x29ed55['model']],'as':_0x29ed55['as'],'attributes':_0x29ed55['attributes'],'include':_0x29ed55['include']?_[_0xae1a('0x23')](_0x29ed55[_0xae1a('0x21')],function(_0x536ddd){return{'model':db[_0x536ddd['model']],'as':_0x536ddd['as'],'attributes':_0x536ddd[_0xae1a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xae1a('0xe')](function(_0x127d6d){logger[_0xae1a('0xf')](_0xae1a('0x1a'),_0xd7bb55);logger[_0xae1a('0x12')](_0xae1a('0x1a'),_0xd7bb55,JSON['stringify'](_0x127d6d));_0x2493d5(_0x127d6d);})['catch'](function(_0x1d0626){logger[_0xae1a('0x15')](_0xae1a('0x1a'),_0x1d0626['message'],_0xd7bb55);_0x112604(_0x49a8af[_0xae1a('0x15')](0x1f4,_0x1d0626[_0xae1a('0x17')]));});});};exports[_0xae1a('0x24')]=function(_0x59ad9e){var _0x2dcf41=this;return new Promise(function(_0x10d50b,_0x5b75a0){return db[_0xae1a('0x1b')][_0xae1a('0x25')]({'raw':_0x59ad9e[_0xae1a('0x1d')]?_0x59ad9e[_0xae1a('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x59ad9e['options']?_0x59ad9e['options']['where']||null:null,'attributes':_0x59ad9e[_0xae1a('0x1d')]?_0x59ad9e['options'][_0xae1a('0x1f')]||null:null,'include':_0x59ad9e['options']?_0x59ad9e['options'][_0xae1a('0x21')]?_[_0xae1a('0x23')](_0x59ad9e[_0xae1a('0x1d')]['include'],function(_0x412791){return{'model':db[_0x412791[_0xae1a('0x22')]],'as':_0x412791['as'],'attributes':_0x412791[_0xae1a('0x1f')],'include':_0x412791[_0xae1a('0x21')]?_['map'](_0x412791['include'],function(_0x564dc0){return{'model':db[_0x564dc0[_0xae1a('0x22')]],'as':_0x564dc0['as'],'attributes':_0x564dc0[_0xae1a('0x1f')],'include':_0x564dc0['include']?_[_0xae1a('0x23')](_0x564dc0[_0xae1a('0x21')],function(_0x283148){return{'model':db[_0x283148[_0xae1a('0x22')]],'as':_0x283148['as'],'attributes':_0x283148['attributes']};}):[]};}):[]};}):[]:[]})[_0xae1a('0xe')](function(_0x5068ca){logger[_0xae1a('0xf')](_0xae1a('0x24'),_0x59ad9e);logger[_0xae1a('0x12')](_0xae1a('0x24'),_0x59ad9e,JSON[_0xae1a('0x14')](_0x5068ca));_0x10d50b(_0x5068ca);})[_0xae1a('0x19')](function(_0x331dc8){logger['error'](_0xae1a('0x24'),_0x331dc8[_0xae1a('0x17')],_0x59ad9e);_0x5b75a0(_0x2dcf41[_0xae1a('0x15')](0x1f4,_0x331dc8[_0xae1a('0x17')]));});});}; \ No newline at end of file +var _0x6da1=['info','ChatQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','ChatQueue','findAll','raw','options','attributes','limit','map','model','GetChatQueue','find','where','include','ShowChatQueue','debug','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','request','then'];(function(_0x1aa166,_0x5c3230){var _0x41b24f=function(_0x4bff0e){while(--_0x4bff0e){_0x1aa166['push'](_0x1aa166['shift']());}};_0x41b24f(++_0x5c3230);}(_0x6da1,0x1b8));var _0x16da=function(_0x329664,_0x130748){_0x329664=_0x329664-0x0;var _0x4e346e=_0x6da1[_0x329664];return _0x4e346e;};'use strict';var _=require('lodash');var util=require(_0x16da('0x0'));var moment=require('moment');var BPromise=require(_0x16da('0x1'));var rs=require(_0x16da('0x2'));var fs=require('fs');var Redis=require(_0x16da('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x16da('0x4'));var logger=require(_0x16da('0x5'))('rpc');var config=require(_0x16da('0x6'));var jayson=require(_0x16da('0x7'));var client=jayson[_0x16da('0x8')]['http']({'port':0x232a});config['redis']=_[_0x16da('0x9')](config[_0x16da('0xa')],{'host':_0x16da('0xb'),'port':0x18eb});var socket=require(_0x16da('0xc'))(new Redis(config['redis']));require(_0x16da('0xd'))['register'](socket);function respondWithRpcPromise(_0x710e8b,_0x3cc67c,_0x3f4156){return new BPromise(function(_0xc7cc9e,_0x40691d){return client[_0x16da('0xe')](_0x710e8b,_0x3f4156)[_0x16da('0xf')](function(_0x4445ec){logger[_0x16da('0x10')](_0x16da('0x11'),_0x3cc67c,_0x16da('0x12'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x3cc67c,'request\x20sent',JSON[_0x16da('0x13')](_0x4445ec));if(_0x4445ec[_0x16da('0x14')]){if(_0x4445ec[_0x16da('0x14')]['code']===0x1f4){logger[_0x16da('0x14')](_0x16da('0x11'),_0x3cc67c,_0x4445ec[_0x16da('0x14')]['message']);return _0x40691d(_0x4445ec[_0x16da('0x14')][_0x16da('0x15')]);}logger[_0x16da('0x14')](_0x16da('0x11'),_0x3cc67c,_0x4445ec['error'][_0x16da('0x15')]);return _0xc7cc9e(_0x4445ec[_0x16da('0x14')][_0x16da('0x15')]);}else{logger[_0x16da('0x10')](_0x16da('0x11'),_0x3cc67c,_0x16da('0x12'));_0xc7cc9e(_0x4445ec[_0x16da('0x16')][_0x16da('0x15')]);}})[_0x16da('0x17')](function(_0x29f984){logger[_0x16da('0x14')](_0x16da('0x11'),_0x3cc67c,_0x29f984);_0x40691d(_0x29f984);});});}exports['GetChatQueue']=function(_0x8915b8){var _0x7fa60a=this;return new Promise(function(_0x3ea075,_0x931671){return db[_0x16da('0x18')][_0x16da('0x19')]({'raw':_0x8915b8['options']?_0x8915b8['options'][_0x16da('0x1a')]===undefined?!![]:![]:!![],'where':_0x8915b8[_0x16da('0x1b')]?_0x8915b8[_0x16da('0x1b')]['where']||null:null,'attributes':_0x8915b8[_0x16da('0x1b')]?_0x8915b8[_0x16da('0x1b')][_0x16da('0x1c')]||null:null,'limit':_0x8915b8[_0x16da('0x1b')]?_0x8915b8[_0x16da('0x1b')][_0x16da('0x1d')]||null:null,'include':_0x8915b8[_0x16da('0x1b')]?_0x8915b8['options']['include']?_[_0x16da('0x1e')](_0x8915b8[_0x16da('0x1b')]['include'],function(_0xc73885){return{'model':db[_0xc73885[_0x16da('0x1f')]],'as':_0xc73885['as'],'attributes':_0xc73885[_0x16da('0x1c')],'include':_0xc73885['include']?_[_0x16da('0x1e')](_0xc73885['include'],function(_0x5da6bc){return{'model':db[_0x5da6bc[_0x16da('0x1f')]],'as':_0x5da6bc['as'],'attributes':_0x5da6bc[_0x16da('0x1c')],'include':_0x5da6bc['include']?_[_0x16da('0x1e')](_0x5da6bc['include'],function(_0x52cad8){return{'model':db[_0x52cad8['model']],'as':_0x52cad8['as'],'attributes':_0x52cad8[_0x16da('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x16da('0xf')](function(_0x22e103){logger['info'](_0x16da('0x20'),_0x8915b8);logger['debug'](_0x16da('0x20'),_0x8915b8,JSON['stringify'](_0x22e103));_0x3ea075(_0x22e103);})[_0x16da('0x17')](function(_0x49fe85){logger['error']('GetChatQueue',_0x49fe85[_0x16da('0x15')],_0x8915b8);_0x931671(_0x7fa60a[_0x16da('0x14')](0x1f4,_0x49fe85[_0x16da('0x15')]));});});};exports['ShowChatQueue']=function(_0x185340){var _0x2a8387=this;return new Promise(function(_0x25faed,_0x357199){return db[_0x16da('0x18')][_0x16da('0x21')]({'raw':_0x185340[_0x16da('0x1b')]?_0x185340['options'][_0x16da('0x1a')]===undefined?!![]:![]:!![],'where':_0x185340[_0x16da('0x1b')]?_0x185340[_0x16da('0x1b')][_0x16da('0x22')]||null:null,'attributes':_0x185340[_0x16da('0x1b')]?_0x185340[_0x16da('0x1b')][_0x16da('0x1c')]||null:null,'include':_0x185340[_0x16da('0x1b')]?_0x185340['options'][_0x16da('0x23')]?_['map'](_0x185340[_0x16da('0x1b')]['include'],function(_0x5f0c0d){return{'model':db[_0x5f0c0d[_0x16da('0x1f')]],'as':_0x5f0c0d['as'],'attributes':_0x5f0c0d[_0x16da('0x1c')],'include':_0x5f0c0d[_0x16da('0x23')]?_[_0x16da('0x1e')](_0x5f0c0d[_0x16da('0x23')],function(_0x2bfa6a){return{'model':db[_0x2bfa6a[_0x16da('0x1f')]],'as':_0x2bfa6a['as'],'attributes':_0x2bfa6a[_0x16da('0x1c')],'include':_0x2bfa6a[_0x16da('0x23')]?_['map'](_0x2bfa6a[_0x16da('0x23')],function(_0x243e69){return{'model':db[_0x243e69[_0x16da('0x1f')]],'as':_0x243e69['as'],'attributes':_0x243e69[_0x16da('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x163cf4){logger[_0x16da('0x10')](_0x16da('0x24'),_0x185340);logger[_0x16da('0x25')](_0x16da('0x24'),_0x185340,JSON['stringify'](_0x163cf4));_0x25faed(_0x163cf4);})[_0x16da('0x17')](function(_0x462b43){logger[_0x16da('0x14')](_0x16da('0x24'),_0x462b43[_0x16da('0x15')],_0x185340);_0x357199(_0x2a8387[_0x16da('0x14')](0x1f4,_0x462b43[_0x16da('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index eb68706..b6e4f65 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 _0x0b0e=['chatQueue:','./chatQueue.events','remove','emit','removeListener','register'];(function(_0x137a9d,_0x59e646){var _0x41ea65=function(_0x4e1be1){while(--_0x4e1be1){_0x137a9d['push'](_0x137a9d['shift']());}};_0x41ea65(++_0x59e646);}(_0x0b0e,0x187));var _0xe0b0=function(_0x466a1a,_0x37933b){_0x466a1a=_0x466a1a-0x0;var _0x577165=_0x0b0e[_0x466a1a];return _0x577165;};'use strict';var ChatQueueEvents=require(_0xe0b0('0x0'));var events=['save',_0xe0b0('0x1'),'update'];function createListener(_0x7e5a8a,_0xdf715e){return function(_0x3b5e2b){_0xdf715e[_0xe0b0('0x2')](_0x7e5a8a,_0x3b5e2b);};}function removeListener(_0x28040c,_0x38a058){return function(){ChatQueueEvents[_0xe0b0('0x3')](_0x28040c,_0x38a058);};}exports[_0xe0b0('0x4')]=function(_0x30e20d){for(var _0x28e40f=0x0,_0x219b1c=events['length'];_0x28e40f<_0x219b1c;_0x28e40f++){var _0x50be7f=events[_0x28e40f];var _0x11effc=createListener(_0xe0b0('0x5')+_0x50be7f,_0x30e20d);ChatQueueEvents['on'](_0x50be7f,_0x11effc);}}; \ No newline at end of file +var _0xb10b=['emit','removeListener','register','chatQueue:','./chatQueue.events','remove','update'];(function(_0x3c1ca2,_0x3428ae){var _0x310c01=function(_0x1e25a2){while(--_0x1e25a2){_0x3c1ca2['push'](_0x3c1ca2['shift']());}};_0x310c01(++_0x3428ae);}(_0xb10b,0x12a));var _0xbb10=function(_0xf4d05,_0x5e601f){_0xf4d05=_0xf4d05-0x0;var _0x47c971=_0xb10b[_0xf4d05];return _0x47c971;};'use strict';var ChatQueueEvents=require(_0xbb10('0x0'));var events=['save',_0xbb10('0x1'),_0xbb10('0x2')];function createListener(_0x1dcb08,_0x4d688c){return function(_0x4541ae){_0x4d688c[_0xbb10('0x3')](_0x1dcb08,_0x4541ae);};}function removeListener(_0x460981,_0x22320e){return function(){ChatQueueEvents[_0xbb10('0x4')](_0x460981,_0x22320e);};}exports[_0xbb10('0x5')]=function(_0x481979){for(var _0x328583=0x0,_0x3cdd53=events['length'];_0x328583<_0x3cdd53;_0x328583++){var _0x1b9e94=events[_0x328583];var _0x3fb675=createListener(_0xbb10('0x6')+_0x1b9e94,_0x481979);ChatQueueEvents['on'](_0x1b9e94,_0x3fb675);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 6ceca7f..4f5757e 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 _0x68fc=['connect-timeout','express','Router','../../components/auth/service','./chatQueue.controller','get','index','/describe','describe','/:id','isAuthenticated','show','/:id/members','getMembers','getTeams','getAgents','post','create','addTeams','addAgents','update','delete','destroy','/:id/teams','removeTeams','removeAgents','exports','multer','path'];(function(_0x32506f,_0x373192){var _0x1e6b33=function(_0x473209){while(--_0x473209){_0x32506f['push'](_0x32506f['shift']());}};_0x1e6b33(++_0x373192);}(_0x68fc,0x15a));var _0xc68f=function(_0x2485d7,_0x59b943){_0x2485d7=_0x2485d7-0x0;var _0x5d768e=_0x68fc[_0x2485d7];return _0x5d768e;};'use strict';var multer=require(_0xc68f('0x0'));var util=require('util');var path=require(_0xc68f('0x1'));var timeout=require(_0xc68f('0x2'));var express=require(_0xc68f('0x3'));var router=express[_0xc68f('0x4')]();var auth=require(_0xc68f('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc68f('0x6'));router[_0xc68f('0x7')]('/',auth['isAuthenticated'](),controller[_0xc68f('0x8')]);router[_0xc68f('0x7')](_0xc68f('0x9'),auth['isAuthenticated'](),controller[_0xc68f('0xa')]);router[_0xc68f('0x7')](_0xc68f('0xb'),auth[_0xc68f('0xc')](),controller[_0xc68f('0xd')]);router[_0xc68f('0x7')](_0xc68f('0xe'),auth[_0xc68f('0xc')](),controller[_0xc68f('0xf')]);router['get']('/:id/teams',auth[_0xc68f('0xc')](),controller[_0xc68f('0x10')]);router[_0xc68f('0x7')]('/:id/users',auth[_0xc68f('0xc')](),controller[_0xc68f('0x11')]);router[_0xc68f('0x12')]('/',auth[_0xc68f('0xc')](),controller[_0xc68f('0x13')]);router['post']('/:id/teams',auth[_0xc68f('0xc')](),controller[_0xc68f('0x14')]);router[_0xc68f('0x12')]('/:id/users',auth[_0xc68f('0xc')](),controller[_0xc68f('0x15')]);router['put'](_0xc68f('0xb'),auth[_0xc68f('0xc')](),controller[_0xc68f('0x16')]);router[_0xc68f('0x17')](_0xc68f('0xb'),auth[_0xc68f('0xc')](),controller[_0xc68f('0x18')]);router[_0xc68f('0x17')](_0xc68f('0x19'),auth[_0xc68f('0xc')](),controller[_0xc68f('0x1a')]);router[_0xc68f('0x17')]('/:id/users',auth[_0xc68f('0xc')](),controller[_0xc68f('0x1b')]);module[_0xc68f('0x1c')]=router; \ No newline at end of file +var _0xe1fc=['exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./chatQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/members','/:id/teams','getAgents','create','post','addTeams','/:id/users','addAgents','update','delete','removeTeams'];(function(_0x3e6c9e,_0x51d44e){var _0x5b2d96=function(_0x44e432){while(--_0x44e432){_0x3e6c9e['push'](_0x3e6c9e['shift']());}};_0x5b2d96(++_0x51d44e);}(_0xe1fc,0xd9));var _0xce1f=function(_0x2a8860,_0x2da926){_0x2a8860=_0x2a8860-0x0;var _0x2f47a4=_0xe1fc[_0x2a8860];return _0x2f47a4;};'use strict';var multer=require(_0xce1f('0x0'));var util=require(_0xce1f('0x1'));var path=require(_0xce1f('0x2'));var timeout=require('connect-timeout');var express=require(_0xce1f('0x3'));var router=express[_0xce1f('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xce1f('0x5'));var config=require(_0xce1f('0x6'));var controller=require(_0xce1f('0x7'));router['get']('/',auth[_0xce1f('0x8')](),controller[_0xce1f('0x9')]);router[_0xce1f('0xa')](_0xce1f('0xb'),auth[_0xce1f('0x8')](),controller[_0xce1f('0xc')]);router['get'](_0xce1f('0xd'),auth['isAuthenticated'](),controller[_0xce1f('0xe')]);router[_0xce1f('0xa')](_0xce1f('0xf'),auth[_0xce1f('0x8')](),controller['getMembers']);router['get'](_0xce1f('0x10'),auth[_0xce1f('0x8')](),controller['getTeams']);router[_0xce1f('0xa')]('/:id/users',auth[_0xce1f('0x8')](),controller[_0xce1f('0x11')]);router['post']('/',auth[_0xce1f('0x8')](),controller[_0xce1f('0x12')]);router[_0xce1f('0x13')]('/:id/teams',auth[_0xce1f('0x8')](),controller[_0xce1f('0x14')]);router[_0xce1f('0x13')](_0xce1f('0x15'),auth[_0xce1f('0x8')](),controller[_0xce1f('0x16')]);router['put']('/:id',auth[_0xce1f('0x8')](),controller[_0xce1f('0x17')]);router[_0xce1f('0x18')](_0xce1f('0xd'),auth[_0xce1f('0x8')](),controller['destroy']);router[_0xce1f('0x18')](_0xce1f('0x10'),auth[_0xce1f('0x8')](),controller[_0xce1f('0x19')]);router[_0xce1f('0x18')](_0xce1f('0x15'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xce1f('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 53332d2..b94e59f 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 _0xc91f=['sequelize','exports','STRING','DATE','moment'];(function(_0x2d90cb,_0x58f1e1){var _0x3dfa5a=function(_0x5f0e3f){while(--_0x5f0e3f){_0x2d90cb['push'](_0x2d90cb['shift']());}};_0x3dfa5a(++_0x58f1e1);}(_0xc91f,0x1b2));var _0xfc91=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc91f[_0x321bb2];return _0x9c12ed;};'use strict';var moment=require(_0xfc91('0x0'));var Sequelize=require(_0xfc91('0x1'));module[_0xfc91('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xfc91('0x3')]},'joinAt':{'type':Sequelize[_0xfc91('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xfc91('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x150a=['DATE','exports','STRING'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x150a,0x15d));var _0xa150=function(_0x5e32a3,_0x2e9cc7){_0x5e32a3=_0x5e32a3-0x0;var _0x5c91d9=_0x150a[_0x5e32a3];return _0x5c91d9;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xa150('0x0')]={'uniqueid':{'type':Sequelize[_0xa150('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xa150('0x2')]},'acceptAt':{'type':Sequelize[_0xa150('0x2')]},'exitAt':{'type':Sequelize[_0xa150('0x2')]},'reason':{'type':Sequelize[_0xa150('0x1')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 41628c2..e766337 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 _0xb408=['length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','show','params','include','find','catch','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','json','apply','save','update','then','stack','name','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x3523d3,_0x40fe52){var _0x1c4153=function(_0x4d4562){while(--_0x4d4562){_0x3523d3['push'](_0x3523d3['shift']());}};_0x1c4153(++_0x40fe52);}(_0xb408,0xae));var _0x8b40=function(_0x778a34,_0xb4f3d3){_0x778a34=_0x778a34-0x0;var _0x4b956f=_0xb408[_0x778a34];return _0x4b956f;};'use strict';var pdf=require(_0x8b40('0x0'));var emlformat=require(_0x8b40('0x1'));var rimraf=require(_0x8b40('0x2'));var zipdir=require(_0x8b40('0x3'));var jsonpatch=require(_0x8b40('0x4'));var rp=require(_0x8b40('0x5'));var moment=require(_0x8b40('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x8b40('0x7'));var util=require(_0x8b40('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x8b40('0x9'));var ejs=require(_0x8b40('0xa'));var fs=require('fs');var _=require(_0x8b40('0xb'));var squel=require(_0x8b40('0xc'));var crypto=require(_0x8b40('0xd'));var jsforce=require(_0x8b40('0xe'));var deskjs=require(_0x8b40('0xf'));var toCsv=require(_0x8b40('0x9'));var querystring=require('querystring');var Papa=require(_0x8b40('0x10'));var Redis=require(_0x8b40('0x11'));var authService=require(_0x8b40('0x12'));var qs=require(_0x8b40('0x13'));var as=require(_0x8b40('0x14'));var hardwareService=require(_0x8b40('0x15'));var logger=require(_0x8b40('0x16'))(_0x8b40('0x17'));var utils=require(_0x8b40('0x18'));var config=require(_0x8b40('0x19'));var db=require(_0x8b40('0x1a'))['db'];function respondWithStatusCode(_0xadff1f,_0x5e769a){_0x5e769a=_0x5e769a||0xcc;return function(_0x1021d2){if(_0x1021d2){return _0xadff1f[_0x8b40('0x1b')](_0x5e769a);}return _0xadff1f[_0x8b40('0x1c')](_0x5e769a)[_0x8b40('0x1d')]();};}function respondWithResult(_0x109035,_0x1c2e90){_0x1c2e90=_0x1c2e90||0xc8;return function(_0x11a6e4){if(_0x11a6e4){return _0x109035[_0x8b40('0x1c')](_0x1c2e90)['json'](_0x11a6e4);}};}function respondWithFilteredResult(_0x5dcdb8,_0x5dd01f){return function(_0x285436){if(_0x285436){var _0x43f122=_0x285436[_0x8b40('0x1e')],_0x361ec0=_0x5dd01f[_0x8b40('0x1f')],_0x16eed0=_0x5dd01f['offset']+_0x5dd01f['limit'],_0x4b08b2;if(_0x16eed0>=_0x43f122){_0x16eed0=_0x43f122;_0x4b08b2=0xc8;}else{_0x4b08b2=0xce;}_0x5dcdb8[_0x8b40('0x1c')](_0x4b08b2);return _0x5dcdb8[_0x8b40('0x20')](_0x8b40('0x21'),_0x361ec0+'-'+_0x16eed0+'/'+_0x43f122)[_0x8b40('0x22')](_0x285436);}return null;};}function patchUpdates(_0xbb38f9){return function(_0x45b7e9){try{jsonpatch[_0x8b40('0x23')](_0x45b7e9,_0xbb38f9,!![]);}catch(_0x38faa6){return BPromise['reject'](_0x38faa6);}return _0x45b7e9[_0x8b40('0x24')]();};}function saveUpdates(_0x26cb21,_0x4f146e){return function(_0x3010a2){if(_0x3010a2){return _0x3010a2[_0x8b40('0x25')](_0x26cb21)[_0x8b40('0x26')](function(_0x879716){return _0x879716;});}return null;};}function removeEntity(_0x24dc17,_0x2eaec8){return function(_0x3d71b2){if(_0x3d71b2){return _0x3d71b2['destroy']()[_0x8b40('0x26')](function(){_0x24dc17[_0x8b40('0x1c')](0xcc)[_0x8b40('0x1d')]();});}};}function handleEntityNotFound(_0x50b551,_0x437619){return function(_0x4b1666){if(!_0x4b1666){_0x50b551[_0x8b40('0x1b')](0x194);}return _0x4b1666;};}function handleError(_0x5b1724,_0xff2347){_0xff2347=_0xff2347||0x1f4;return function(_0x27e5f1){logger['error'](_0x27e5f1[_0x8b40('0x27')]);if(_0x27e5f1['name']){delete _0x27e5f1[_0x8b40('0x28')];}_0x5b1724[_0x8b40('0x1c')](_0xff2347)['send'](_0x27e5f1);};}exports['index']=function(_0x39369b,_0x105f49){var _0x366d29={},_0xc73b87={},_0x17f92d={'count':0x0,'rows':[]};var _0x5bd079=_[_0x8b40('0x29')](db[_0x8b40('0x2a')][_0x8b40('0x2b')],function(_0xfa35e0){return{'name':_0xfa35e0[_0x8b40('0x2c')],'type':_0xfa35e0[_0x8b40('0x2d')][_0x8b40('0x2e')]};});_0xc73b87[_0x8b40('0x2f')]=_['map'](_0x5bd079,_0x8b40('0x28'));_0xc73b87[_0x8b40('0x30')]=_[_0x8b40('0x31')](_0x39369b[_0x8b40('0x30')]);_0xc73b87[_0x8b40('0x32')]=_[_0x8b40('0x33')](_0xc73b87[_0x8b40('0x2f')],_0xc73b87[_0x8b40('0x30')]);_0x366d29[_0x8b40('0x34')]=_[_0x8b40('0x33')](_0xc73b87[_0x8b40('0x2f')],qs['fields'](_0x39369b[_0x8b40('0x30')][_0x8b40('0x35')]));_0x366d29[_0x8b40('0x34')]=_0x366d29[_0x8b40('0x34')][_0x8b40('0x36')]?_0x366d29[_0x8b40('0x34')]:_0xc73b87[_0x8b40('0x2f')];if(!_0x39369b[_0x8b40('0x30')][_0x8b40('0x37')](_0x8b40('0x38'))){_0x366d29[_0x8b40('0x39')]=qs[_0x8b40('0x39')](_0x39369b[_0x8b40('0x30')][_0x8b40('0x39')]);_0x366d29[_0x8b40('0x1f')]=qs[_0x8b40('0x1f')](_0x39369b[_0x8b40('0x30')][_0x8b40('0x1f')]);}_0x366d29[_0x8b40('0x3a')]=qs[_0x8b40('0x3b')](_0x39369b[_0x8b40('0x30')][_0x8b40('0x3b')]);_0x366d29[_0x8b40('0x3c')]=qs[_0x8b40('0x32')](_[_0x8b40('0x3d')](_0x39369b['query'],_0xc73b87[_0x8b40('0x32')]));if(_0x39369b[_0x8b40('0x30')][_0x8b40('0x3e')]){_0x366d29[_0x8b40('0x3c')]=_[_0x8b40('0x3f')](_0x366d29[_0x8b40('0x3c')],{'$or':_[_0x8b40('0x29')](_0x5bd079,function(_0x226a05){if(_0x226a05[_0x8b40('0x2d')]!=='VIRTUAL'){var _0x5374a9={};_0x5374a9[_0x226a05[_0x8b40('0x28')]]={'$like':'%'+_0x39369b[_0x8b40('0x30')][_0x8b40('0x3e')]+'%'};return _0x5374a9;}})});}_0x366d29=_[_0x8b40('0x3f')]({},_0x366d29,_0x39369b[_0x8b40('0x40')]);var _0x38b049={'where':_0x366d29[_0x8b40('0x3c')]};return db[_0x8b40('0x2a')][_0x8b40('0x1e')](_0x38b049)[_0x8b40('0x26')](function(_0x7364b9){_0x17f92d[_0x8b40('0x1e')]=_0x7364b9;if(_0x39369b[_0x8b40('0x30')][_0x8b40('0x41')]){_0x366d29['include']=[{'all':!![]}];}return db[_0x8b40('0x2a')][_0x8b40('0x42')](_0x366d29);})[_0x8b40('0x26')](function(_0x167c7f){_0x17f92d[_0x8b40('0x43')]=_0x167c7f;return _0x17f92d;})['then'](respondWithFilteredResult(_0x105f49,_0x366d29))['catch'](handleError(_0x105f49,null));};exports[_0x8b40('0x44')]=function(_0x2f1701,_0xd3872a){var _0x3e9941={'raw':!![],'where':{'id':_0x2f1701[_0x8b40('0x45')]['id']}},_0xd2310c={};_0xd2310c[_0x8b40('0x2f')]=_['keys'](db[_0x8b40('0x2a')]['rawAttributes']);_0xd2310c[_0x8b40('0x30')]=_[_0x8b40('0x31')](_0x2f1701[_0x8b40('0x30')]);_0xd2310c['filters']=_[_0x8b40('0x33')](_0xd2310c[_0x8b40('0x2f')],_0xd2310c[_0x8b40('0x30')]);_0x3e9941[_0x8b40('0x34')]=_[_0x8b40('0x33')](_0xd2310c['model'],qs['fields'](_0x2f1701['query'][_0x8b40('0x35')]));_0x3e9941[_0x8b40('0x34')]=_0x3e9941[_0x8b40('0x34')][_0x8b40('0x36')]?_0x3e9941[_0x8b40('0x34')]:_0xd2310c['model'];if(_0x2f1701[_0x8b40('0x30')][_0x8b40('0x41')]){_0x3e9941[_0x8b40('0x46')]=[{'all':!![]}];}_0x3e9941=_[_0x8b40('0x3f')]({},_0x3e9941,_0x2f1701['options']);return db[_0x8b40('0x2a')][_0x8b40('0x47')](_0x3e9941)[_0x8b40('0x26')](handleEntityNotFound(_0xd3872a,null))[_0x8b40('0x26')](respondWithResult(_0xd3872a,null))[_0x8b40('0x48')](handleError(_0xd3872a,null));};exports[_0x8b40('0x49')]=function(_0x5468e3,_0x30d71e){return db[_0x8b40('0x2a')][_0x8b40('0x49')](_0x5468e3['body'],{})['then'](respondWithResult(_0x30d71e,0xc9))[_0x8b40('0x48')](handleError(_0x30d71e,null));};exports[_0x8b40('0x25')]=function(_0x327144,_0x477b35){if(_0x327144[_0x8b40('0x4a')]['id']){delete _0x327144[_0x8b40('0x4a')]['id'];}return db[_0x8b40('0x2a')][_0x8b40('0x47')]({'where':{'id':_0x327144[_0x8b40('0x45')]['id']}})[_0x8b40('0x26')](handleEntityNotFound(_0x477b35,null))[_0x8b40('0x26')](saveUpdates(_0x327144[_0x8b40('0x4a')],null))[_0x8b40('0x26')](respondWithResult(_0x477b35,null))[_0x8b40('0x48')](handleError(_0x477b35,null));};exports['destroy']=function(_0x3fb283,_0x4ac1aa){return db[_0x8b40('0x2a')][_0x8b40('0x47')]({'where':{'id':_0x3fb283[_0x8b40('0x45')]['id']}})[_0x8b40('0x26')](handleEntityNotFound(_0x4ac1aa,null))['then'](removeEntity(_0x4ac1aa,null))[_0x8b40('0x48')](handleError(_0x4ac1aa,null));};exports[_0x8b40('0x4b')]=function(_0x412084,_0x51a58a){return db[_0x8b40('0x2a')]['describe']()[_0x8b40('0x26')](respondWithResult(_0x51a58a,null))[_0x8b40('0x48')](handleError(_0x51a58a,null));}; \ No newline at end of file +var _0x2a17=['error','name','send','index','map','ChatQueueReport','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','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','api','../../config/environment','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x5e8152,_0x54b801){var _0xfa508d=function(_0x532c40){while(--_0x532c40){_0x5e8152['push'](_0x5e8152['shift']());}};_0xfa508d(++_0x54b801);}(_0x2a17,0xc1));var _0x72a1=function(_0x43b701,_0xcba309){_0x43b701=_0x43b701-0x0;var _0x153f0d=_0x2a17[_0x43b701];return _0x153f0d;};'use strict';var pdf=require(_0x72a1('0x0'));var emlformat=require(_0x72a1('0x1'));var rimraf=require(_0x72a1('0x2'));var zipdir=require(_0x72a1('0x3'));var jsonpatch=require(_0x72a1('0x4'));var rp=require(_0x72a1('0x5'));var moment=require(_0x72a1('0x6'));var BPromise=require(_0x72a1('0x7'));var Mustache=require(_0x72a1('0x8'));var util=require(_0x72a1('0x9'));var path=require('path');var sox=require(_0x72a1('0xa'));var csv=require(_0x72a1('0xb'));var ejs=require(_0x72a1('0xc'));var fs=require('fs');var _=require(_0x72a1('0xd'));var squel=require(_0x72a1('0xe'));var crypto=require('crypto');var jsforce=require(_0x72a1('0xf'));var deskjs=require(_0x72a1('0x10'));var toCsv=require('to-csv');var querystring=require(_0x72a1('0x11'));var Papa=require(_0x72a1('0x12'));var Redis=require(_0x72a1('0x13'));var authService=require(_0x72a1('0x14'));var qs=require(_0x72a1('0x15'));var as=require(_0x72a1('0x16'));var hardwareService=require(_0x72a1('0x17'));var logger=require(_0x72a1('0x18'))(_0x72a1('0x19'));var utils=require('../../config/utils');var config=require(_0x72a1('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2803a0,_0x4a8a77){_0x4a8a77=_0x4a8a77||0xcc;return function(_0x248f15){if(_0x248f15){return _0x2803a0[_0x72a1('0x1b')](_0x4a8a77);}return _0x2803a0[_0x72a1('0x1c')](_0x4a8a77)[_0x72a1('0x1d')]();};}function respondWithResult(_0x5bc617,_0x3ab8c7){_0x3ab8c7=_0x3ab8c7||0xc8;return function(_0x3b3b5f){if(_0x3b3b5f){return _0x5bc617[_0x72a1('0x1c')](_0x3ab8c7)[_0x72a1('0x1e')](_0x3b3b5f);}};}function respondWithFilteredResult(_0x2e8eae,_0x37ca6a){return function(_0x10f0c8){if(_0x10f0c8){var _0x159bfe=_0x10f0c8['count'],_0x15f993=_0x37ca6a['offset'],_0x3a89de=_0x37ca6a[_0x72a1('0x1f')]+_0x37ca6a[_0x72a1('0x20')],_0x3309d5;if(_0x3a89de>=_0x159bfe){_0x3a89de=_0x159bfe;_0x3309d5=0xc8;}else{_0x3309d5=0xce;}_0x2e8eae[_0x72a1('0x1c')](_0x3309d5);return _0x2e8eae[_0x72a1('0x21')](_0x72a1('0x22'),_0x15f993+'-'+_0x3a89de+'/'+_0x159bfe)['json'](_0x10f0c8);}return null;};}function patchUpdates(_0x366d08){return function(_0x16bf64){try{jsonpatch[_0x72a1('0x23')](_0x16bf64,_0x366d08,!![]);}catch(_0x2515b5){return BPromise[_0x72a1('0x24')](_0x2515b5);}return _0x16bf64[_0x72a1('0x25')]();};}function saveUpdates(_0x4e037b,_0x472b2b){return function(_0x2c0910){if(_0x2c0910){return _0x2c0910[_0x72a1('0x26')](_0x4e037b)[_0x72a1('0x27')](function(_0x40d0e6){return _0x40d0e6;});}return null;};}function removeEntity(_0xb2f746,_0x10bd3d){return function(_0x5df3e4){if(_0x5df3e4){return _0x5df3e4[_0x72a1('0x28')]()[_0x72a1('0x27')](function(){_0xb2f746[_0x72a1('0x1c')](0xcc)[_0x72a1('0x1d')]();});}};}function handleEntityNotFound(_0xda0f24,_0xecc215){return function(_0x571396){if(!_0x571396){_0xda0f24[_0x72a1('0x1b')](0x194);}return _0x571396;};}function handleError(_0x5540e8,_0x4394b0){_0x4394b0=_0x4394b0||0x1f4;return function(_0x299ca2){logger[_0x72a1('0x29')](_0x299ca2['stack']);if(_0x299ca2[_0x72a1('0x2a')]){delete _0x299ca2[_0x72a1('0x2a')];}_0x5540e8[_0x72a1('0x1c')](_0x4394b0)[_0x72a1('0x2b')](_0x299ca2);};}exports[_0x72a1('0x2c')]=function(_0xf96048,_0x332db7){var _0x8580bc={},_0x2b3995={},_0x5f2d57={'count':0x0,'rows':[]};var _0x388bc4=_[_0x72a1('0x2d')](db[_0x72a1('0x2e')]['rawAttributes'],function(_0x2a321d){return{'name':_0x2a321d['fieldName'],'type':_0x2a321d[_0x72a1('0x2f')][_0x72a1('0x30')]};});_0x2b3995[_0x72a1('0x31')]=_[_0x72a1('0x2d')](_0x388bc4,_0x72a1('0x2a'));_0x2b3995[_0x72a1('0x32')]=_[_0x72a1('0x33')](_0xf96048['query']);_0x2b3995[_0x72a1('0x34')]=_[_0x72a1('0x35')](_0x2b3995[_0x72a1('0x31')],_0x2b3995['query']);_0x8580bc[_0x72a1('0x36')]=_[_0x72a1('0x35')](_0x2b3995['model'],qs[_0x72a1('0x37')](_0xf96048[_0x72a1('0x32')][_0x72a1('0x37')]));_0x8580bc[_0x72a1('0x36')]=_0x8580bc[_0x72a1('0x36')][_0x72a1('0x38')]?_0x8580bc[_0x72a1('0x36')]:_0x2b3995[_0x72a1('0x31')];if(!_0xf96048['query'][_0x72a1('0x39')](_0x72a1('0x3a'))){_0x8580bc[_0x72a1('0x20')]=qs[_0x72a1('0x20')](_0xf96048[_0x72a1('0x32')][_0x72a1('0x20')]);_0x8580bc[_0x72a1('0x1f')]=qs['offset'](_0xf96048[_0x72a1('0x32')]['offset']);}_0x8580bc[_0x72a1('0x3b')]=qs[_0x72a1('0x3c')](_0xf96048[_0x72a1('0x32')]['sort']);_0x8580bc[_0x72a1('0x3d')]=qs[_0x72a1('0x34')](_['pick'](_0xf96048[_0x72a1('0x32')],_0x2b3995['filters']));if(_0xf96048[_0x72a1('0x32')][_0x72a1('0x3e')]){_0x8580bc[_0x72a1('0x3d')]=_[_0x72a1('0x3f')](_0x8580bc['where'],{'$or':_['map'](_0x388bc4,function(_0x374d75){if(_0x374d75[_0x72a1('0x2f')]!=='VIRTUAL'){var _0x4e3ab9={};_0x4e3ab9[_0x374d75[_0x72a1('0x2a')]]={'$like':'%'+_0xf96048[_0x72a1('0x32')][_0x72a1('0x3e')]+'%'};return _0x4e3ab9;}})});}_0x8580bc=_[_0x72a1('0x3f')]({},_0x8580bc,_0xf96048[_0x72a1('0x40')]);var _0x5a2a91={'where':_0x8580bc[_0x72a1('0x3d')]};return db[_0x72a1('0x2e')]['count'](_0x5a2a91)[_0x72a1('0x27')](function(_0x4ae3c2){_0x5f2d57[_0x72a1('0x41')]=_0x4ae3c2;if(_0xf96048['query'][_0x72a1('0x42')]){_0x8580bc[_0x72a1('0x43')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x72a1('0x44')](_0x8580bc);})['then'](function(_0x3ee727){_0x5f2d57[_0x72a1('0x45')]=_0x3ee727;return _0x5f2d57;})[_0x72a1('0x27')](respondWithFilteredResult(_0x332db7,_0x8580bc))[_0x72a1('0x46')](handleError(_0x332db7,null));};exports[_0x72a1('0x47')]=function(_0x2600f2,_0x446890){var _0x44e734={'raw':!![],'where':{'id':_0x2600f2[_0x72a1('0x48')]['id']}},_0x595be8={};_0x595be8[_0x72a1('0x31')]=_['keys'](db[_0x72a1('0x2e')][_0x72a1('0x49')]);_0x595be8[_0x72a1('0x32')]=_[_0x72a1('0x33')](_0x2600f2['query']);_0x595be8[_0x72a1('0x34')]=_[_0x72a1('0x35')](_0x595be8[_0x72a1('0x31')],_0x595be8[_0x72a1('0x32')]);_0x44e734[_0x72a1('0x36')]=_[_0x72a1('0x35')](_0x595be8[_0x72a1('0x31')],qs[_0x72a1('0x37')](_0x2600f2[_0x72a1('0x32')]['fields']));_0x44e734[_0x72a1('0x36')]=_0x44e734['attributes'][_0x72a1('0x38')]?_0x44e734[_0x72a1('0x36')]:_0x595be8[_0x72a1('0x31')];if(_0x2600f2[_0x72a1('0x32')]['includeAll']){_0x44e734[_0x72a1('0x43')]=[{'all':!![]}];}_0x44e734=_['merge']({},_0x44e734,_0x2600f2['options']);return db['ChatQueueReport'][_0x72a1('0x4a')](_0x44e734)['then'](handleEntityNotFound(_0x446890,null))[_0x72a1('0x27')](respondWithResult(_0x446890,null))[_0x72a1('0x46')](handleError(_0x446890,null));};exports[_0x72a1('0x4b')]=function(_0x1fac2b,_0x251e84){return db[_0x72a1('0x2e')]['create'](_0x1fac2b[_0x72a1('0x4c')],{})[_0x72a1('0x27')](respondWithResult(_0x251e84,0xc9))[_0x72a1('0x46')](handleError(_0x251e84,null));};exports[_0x72a1('0x26')]=function(_0x424edd,_0x188092){if(_0x424edd[_0x72a1('0x4c')]['id']){delete _0x424edd[_0x72a1('0x4c')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x424edd['params']['id']}})[_0x72a1('0x27')](handleEntityNotFound(_0x188092,null))[_0x72a1('0x27')](saveUpdates(_0x424edd[_0x72a1('0x4c')],null))[_0x72a1('0x27')](respondWithResult(_0x188092,null))['catch'](handleError(_0x188092,null));};exports[_0x72a1('0x28')]=function(_0x1305b9,_0x5b230b){return db[_0x72a1('0x2e')][_0x72a1('0x4a')]({'where':{'id':_0x1305b9[_0x72a1('0x48')]['id']}})[_0x72a1('0x27')](handleEntityNotFound(_0x5b230b,null))[_0x72a1('0x27')](removeEntity(_0x5b230b,null))[_0x72a1('0x46')](handleError(_0x5b230b,null));};exports[_0x72a1('0x4d')]=function(_0x3bd889,_0x403d78){return db[_0x72a1('0x2e')][_0x72a1('0x4d')]()[_0x72a1('0x27')](respondWithResult(_0x403d78,null))[_0x72a1('0x46')](handleError(_0x403d78,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 7a32811..5f23b16 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 _0x192a=['bluebird','path','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment'];(function(_0x4e12fa,_0x3b3bc9){var _0x812359=function(_0x22eb58){while(--_0x22eb58){_0x4e12fa['push'](_0x4e12fa['shift']());}};_0x812359(++_0x3b3bc9);}(_0x192a,0xe6));var _0xa192=function(_0x419d68,_0x504507){_0x419d68=_0x419d68-0x0;var _0x552c89=_0x192a[_0x419d68];return _0x552c89;};'use strict';var _=require('lodash');var util=require(_0xa192('0x0'));var logger=require(_0xa192('0x1'))(_0xa192('0x2'));var moment=require(_0xa192('0x3'));var BPromise=require(_0xa192('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa192('0x5'));var rimraf=require(_0xa192('0x6'));var config=require(_0xa192('0x7'));var attributes=require(_0xa192('0x8'));module['exports']=function(_0x448cf6,_0x32d339){return _0x448cf6[_0xa192('0x9')](_0xa192('0xa'),attributes,{'tableName':_0xa192('0xb'),'paranoid':![],'indexes':[{'name':_0xa192('0xc'),'fields':[_0xa192('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcab7=['exports','ChatQueueReport','uniqueid','lodash','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./chatQueueReport.attributes'];(function(_0x20ef90,_0x40fa5){var _0x1a7947=function(_0x5cdf3c){while(--_0x5cdf3c){_0x20ef90['push'](_0x20ef90['shift']());}};_0x1a7947(++_0x40fa5);}(_0xcab7,0x71));var _0x7cab=function(_0x58c576,_0x3df9c6){_0x58c576=_0x58c576-0x0;var _0x2677c3=_0xcab7[_0x58c576];return _0x2677c3;};'use strict';var _=require(_0x7cab('0x0'));var util=require('util');var logger=require(_0x7cab('0x1'))(_0x7cab('0x2'));var moment=require('moment');var BPromise=require(_0x7cab('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7cab('0x4'));var rimraf=require(_0x7cab('0x5'));var config=require(_0x7cab('0x6'));var attributes=require(_0x7cab('0x7'));module[_0x7cab('0x8')]=function(_0x358471,_0x4d98b5){return _0x358471['define'](_0x7cab('0x9'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7cab('0xa'),'fields':[_0x7cab('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index f497191..e31c224 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 _0xe8ee=['UpdateChatQueueReport','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','body','options','raw','where','attributes','limit'];(function(_0x436caf,_0x1718c6){var _0x465f24=function(_0x562227){while(--_0x562227){_0x436caf['push'](_0x436caf['shift']());}};_0x465f24(++_0x1718c6);}(_0xe8ee,0x141));var _0xee8e=function(_0x4350d7,_0x59124e){_0x4350d7=_0x4350d7-0x0;var _0x21727b=_0xe8ee[_0x4350d7];return _0x21727b;};'use strict';var _=require('lodash');var util=require(_0xee8e('0x0'));var moment=require('moment');var BPromise=require(_0xee8e('0x1'));var rs=require(_0xee8e('0x2'));var fs=require('fs');var Redis=require(_0xee8e('0x3'));var db=require(_0xee8e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xee8e('0x5'))(_0xee8e('0x6'));var config=require(_0xee8e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xee8e('0x8')][_0xee8e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x189adb,_0x3badb7,_0x3087ae){return new BPromise(function(_0x1e3c71,_0x3d8713){return client[_0xee8e('0xa')](_0x189adb,_0x3087ae)[_0xee8e('0xb')](function(_0x58cdff){logger[_0xee8e('0xc')](_0xee8e('0xd'),_0x3badb7,_0xee8e('0xe'));logger[_0xee8e('0xf')](_0xee8e('0x10'),_0x3badb7,_0xee8e('0xe'),JSON[_0xee8e('0x11')](_0x58cdff));if(_0x58cdff[_0xee8e('0x12')]){if(_0x58cdff['error'][_0xee8e('0x13')]===0x1f4){logger[_0xee8e('0x12')](_0xee8e('0xd'),_0x3badb7,_0x58cdff[_0xee8e('0x12')][_0xee8e('0x14')]);return _0x3d8713(_0x58cdff['error'][_0xee8e('0x14')]);}logger[_0xee8e('0x12')](_0xee8e('0xd'),_0x3badb7,_0x58cdff[_0xee8e('0x12')][_0xee8e('0x14')]);return _0x1e3c71(_0x58cdff['error']['message']);}else{logger[_0xee8e('0xc')](_0xee8e('0xd'),_0x3badb7,_0xee8e('0xe'));_0x1e3c71(_0x58cdff[_0xee8e('0x15')][_0xee8e('0x14')]);}})[_0xee8e('0x16')](function(_0x147261){logger[_0xee8e('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x3badb7,_0x147261);_0x3d8713(_0x147261);});});}exports[_0xee8e('0x17')]=function(_0x2598d6){var _0x5a1ea2=this;return new Promise(function(_0x2adc6d,_0x549d85){return db[_0xee8e('0x18')]['create'](_0x2598d6[_0xee8e('0x19')],{'raw':_0x2598d6[_0xee8e('0x1a')]?_0x2598d6['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1bb4d4){logger[_0xee8e('0xc')](_0xee8e('0x17'),_0x2598d6);logger[_0xee8e('0xf')](_0xee8e('0x17'),_0x2598d6,JSON[_0xee8e('0x11')](_0x1bb4d4));_0x2adc6d(_0x1bb4d4);})['catch'](function(_0x1534ae){logger[_0xee8e('0x12')](_0xee8e('0x17'),_0x1534ae['message'],_0x2598d6);_0x549d85(_0x5a1ea2[_0xee8e('0x12')](0x1f4,_0x1534ae[_0xee8e('0x14')]));});});};exports['UpdateChatQueueReport']=function(_0x493f4b){var _0x140909=this;return new Promise(function(_0x543a4a,_0x497966){return db[_0xee8e('0x18')]['update'](_0x493f4b[_0xee8e('0x19')],{'raw':_0x493f4b[_0xee8e('0x1a')]?_0x493f4b[_0xee8e('0x1a')][_0xee8e('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x493f4b[_0xee8e('0x1a')]?_0x493f4b[_0xee8e('0x1a')][_0xee8e('0x1c')]||null:null,'attributes':_0x493f4b[_0xee8e('0x1a')]?_0x493f4b[_0xee8e('0x1a')][_0xee8e('0x1d')]||null:null,'limit':_0x493f4b[_0xee8e('0x1a')]?_0x493f4b[_0xee8e('0x1a')][_0xee8e('0x1e')]||null:null})[_0xee8e('0xb')](function(_0x205880){logger[_0xee8e('0xc')](_0xee8e('0x1f'),_0x493f4b);logger[_0xee8e('0xf')](_0xee8e('0x1f'),_0x493f4b,JSON[_0xee8e('0x11')](_0x205880));_0x543a4a(_0x205880);})[_0xee8e('0x16')](function(_0x1da66b){logger['error'](_0xee8e('0x1f'),_0x1da66b[_0xee8e('0x14')],_0x493f4b);_0x497966(_0x140909[_0xee8e('0x12')](0x1f4,_0x1da66b[_0xee8e('0x14')]));});});}; \ No newline at end of file +var _0xa9fb=['catch','ChatQueueReport','body','options','raw','CreateChatQueueReport','stringify','UpdateChatQueueReport','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0xa9fb,0x1d9));var _0xba9f=function(_0x2a40fe,_0x5eca17){_0x2a40fe=_0x2a40fe-0x0;var _0x20c3fb=_0xa9fb[_0x2a40fe];return _0x20c3fb;};'use strict';var _=require('lodash');var util=require(_0xba9f('0x0'));var moment=require(_0xba9f('0x1'));var BPromise=require(_0xba9f('0x2'));var rs=require(_0xba9f('0x3'));var fs=require('fs');var Redis=require(_0xba9f('0x4'));var db=require(_0xba9f('0x5'))['db'];var utils=require(_0xba9f('0x6'));var logger=require(_0xba9f('0x7'))('rpc');var config=require(_0xba9f('0x8'));var jayson=require(_0xba9f('0x9'));var client=jayson[_0xba9f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x88c797,_0x112a10,_0x113878){return new BPromise(function(_0x24d616,_0x4ef4bf){return client[_0xba9f('0xb')](_0x88c797,_0x113878)[_0xba9f('0xc')](function(_0x18bed2){logger[_0xba9f('0xd')](_0xba9f('0xe'),_0x112a10,_0xba9f('0xf'));logger[_0xba9f('0x10')](_0xba9f('0x11'),_0x112a10,_0xba9f('0xf'),JSON['stringify'](_0x18bed2));if(_0x18bed2[_0xba9f('0x12')]){if(_0x18bed2[_0xba9f('0x12')][_0xba9f('0x13')]===0x1f4){logger[_0xba9f('0x12')](_0xba9f('0xe'),_0x112a10,_0x18bed2[_0xba9f('0x12')][_0xba9f('0x14')]);return _0x4ef4bf(_0x18bed2[_0xba9f('0x12')]['message']);}logger[_0xba9f('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x112a10,_0x18bed2[_0xba9f('0x12')][_0xba9f('0x14')]);return _0x24d616(_0x18bed2[_0xba9f('0x12')][_0xba9f('0x14')]);}else{logger[_0xba9f('0xd')]('ChatQueueReport,\x20%s,\x20%s',_0x112a10,_0xba9f('0xf'));_0x24d616(_0x18bed2[_0xba9f('0x15')]['message']);}})[_0xba9f('0x16')](function(_0x89548d){logger[_0xba9f('0x12')](_0xba9f('0xe'),_0x112a10,_0x89548d);_0x4ef4bf(_0x89548d);});});}exports['CreateChatQueueReport']=function(_0x744135){var _0x14df21=this;return new Promise(function(_0x4fa80e,_0x279aa3){return db[_0xba9f('0x17')]['create'](_0x744135[_0xba9f('0x18')],{'raw':_0x744135[_0xba9f('0x19')]?_0x744135[_0xba9f('0x19')][_0xba9f('0x1a')]===undefined?!![]:![]:!![]})[_0xba9f('0xc')](function(_0x813636){logger['info'](_0xba9f('0x1b'),_0x744135);logger[_0xba9f('0x10')](_0xba9f('0x1b'),_0x744135,JSON[_0xba9f('0x1c')](_0x813636));_0x4fa80e(_0x813636);})['catch'](function(_0x2e8d11){logger[_0xba9f('0x12')](_0xba9f('0x1b'),_0x2e8d11[_0xba9f('0x14')],_0x744135);_0x279aa3(_0x14df21[_0xba9f('0x12')](0x1f4,_0x2e8d11[_0xba9f('0x14')]));});});};exports[_0xba9f('0x1d')]=function(_0x5202a5){var _0xf626bc=this;return new Promise(function(_0x18e9ff,_0x57749a){return db[_0xba9f('0x17')]['update'](_0x5202a5['body'],{'raw':_0x5202a5[_0xba9f('0x19')]?_0x5202a5[_0xba9f('0x19')][_0xba9f('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5202a5['options']?_0x5202a5[_0xba9f('0x19')][_0xba9f('0x1e')]||null:null,'attributes':_0x5202a5[_0xba9f('0x19')]?_0x5202a5[_0xba9f('0x19')][_0xba9f('0x1f')]||null:null,'limit':_0x5202a5['options']?_0x5202a5[_0xba9f('0x19')][_0xba9f('0x20')]||null:null})[_0xba9f('0xc')](function(_0x5cb0b3){logger[_0xba9f('0xd')]('UpdateChatQueueReport',_0x5202a5);logger[_0xba9f('0x10')]('UpdateChatQueueReport',_0x5202a5,JSON[_0xba9f('0x1c')](_0x5cb0b3));_0x18e9ff(_0x5cb0b3);})[_0xba9f('0x16')](function(_0x4e45f4){logger['error'](_0xba9f('0x1d'),_0x4e45f4[_0xba9f('0x14')],_0x5202a5);_0x57749a(_0xf626bc[_0xba9f('0x12')](0x1f4,_0x4e45f4[_0xba9f('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index b9e0aa1..0a7475a 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 _0xbf4f=['show','create','put','update','delete','destroy','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','/describe','describe','/:id'];(function(_0x551eb1,_0x3df79c){var _0xe8e306=function(_0x51f9c5){while(--_0x51f9c5){_0x551eb1['push'](_0x551eb1['shift']());}};_0xe8e306(++_0x3df79c);}(_0xbf4f,0x123));var _0xfbf4=function(_0x3ea392,_0x59d098){_0x3ea392=_0x3ea392-0x0;var _0x160ddf=_0xbf4f[_0x3ea392];return _0x160ddf;};'use strict';var multer=require(_0xfbf4('0x0'));var util=require(_0xfbf4('0x1'));var path=require(_0xfbf4('0x2'));var timeout=require(_0xfbf4('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xfbf4('0x4'));var interaction=require(_0xfbf4('0x5'));var config=require(_0xfbf4('0x6'));var controller=require(_0xfbf4('0x7'));router[_0xfbf4('0x8')]('/',auth[_0xfbf4('0x9')](),controller['index']);router[_0xfbf4('0x8')](_0xfbf4('0xa'),auth[_0xfbf4('0x9')](),controller[_0xfbf4('0xb')]);router['get'](_0xfbf4('0xc'),auth[_0xfbf4('0x9')](),controller[_0xfbf4('0xd')]);router['post']('/',auth[_0xfbf4('0x9')](),controller[_0xfbf4('0xe')]);router[_0xfbf4('0xf')](_0xfbf4('0xc'),auth[_0xfbf4('0x9')](),controller[_0xfbf4('0x10')]);router[_0xfbf4('0x11')]('/:id',auth[_0xfbf4('0x9')](),controller[_0xfbf4('0x12')]);module['exports']=router; \ No newline at end of file +var _0x6b6d=['put','update','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create'];(function(_0x2b2150,_0x458766){var _0x392f09=function(_0x3b203e){while(--_0x3b203e){_0x2b2150['push'](_0x2b2150['shift']());}};_0x392f09(++_0x458766);}(_0x6b6d,0xd5));var _0xd6b6=function(_0x79b649,_0x2115b3){_0x79b649=_0x79b649-0x0;var _0x1af9b1=_0x6b6d[_0x79b649];return _0x1af9b1;};'use strict';var multer=require(_0xd6b6('0x0'));var util=require(_0xd6b6('0x1'));var path=require(_0xd6b6('0x2'));var timeout=require(_0xd6b6('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xd6b6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd6b6('0x5'));var controller=require('./chatQueueReport.controller');router[_0xd6b6('0x6')]('/',auth[_0xd6b6('0x7')](),controller[_0xd6b6('0x8')]);router[_0xd6b6('0x6')](_0xd6b6('0x9'),auth[_0xd6b6('0x7')](),controller[_0xd6b6('0xa')]);router['get'](_0xd6b6('0xb'),auth[_0xd6b6('0x7')](),controller[_0xd6b6('0xc')]);router[_0xd6b6('0xd')]('/',auth['isAuthenticated'](),controller[_0xd6b6('0xe')]);router[_0xd6b6('0xf')]('/:id',auth[_0xd6b6('0x7')](),controller[_0xd6b6('0x10')]);router['delete']('/:id',auth[_0xd6b6('0x7')](),controller[_0xd6b6('0x11')]);module[_0xd6b6('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 233048a..78b014d 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 _0xd908=['agent','queue','DATE','NOW','moment','sequelize','ENUM','account'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0xd908,0xfc));var _0x8d90=function(_0x3919bc,_0x448f1d){_0x3919bc=_0x3919bc-0x0;var _0x53bf2f=_0xd908[_0x3919bc];return _0x53bf2f;};'use strict';var moment=require(_0x8d90('0x0'));var Sequelize=require(_0x8d90('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x8d90('0x2')](_0x8d90('0x3'),_0x8d90('0x4'),'queue'),'allowNull':![],'defaultValue':_0x8d90('0x5')},'transferredAt':{'type':Sequelize[_0x8d90('0x6')],'allowNull':![],'defaultValue':Sequelize[_0x8d90('0x7')]}}; \ No newline at end of file +var _0x92a5=['NOW','moment','exports','STRING','ENUM','account','agent','queue','DATE'];(function(_0x5090d4,_0x1950a7){var _0x56c310=function(_0x3d3d5c){while(--_0x3d3d5c){_0x5090d4['push'](_0x5090d4['shift']());}};_0x56c310(++_0x1950a7);}(_0x92a5,0x121));var _0x592a=function(_0x8d25be,_0x5ad363){_0x8d25be=_0x8d25be-0x0;var _0x3fcb44=_0x92a5[_0x8d25be];return _0x3fcb44;};'use strict';var moment=require(_0x592a('0x0'));var Sequelize=require('sequelize');module[_0x592a('0x1')]={'uniqueid':{'type':Sequelize[_0x592a('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x592a('0x3')](_0x592a('0x4'),_0x592a('0x5'),_0x592a('0x6')),'allowNull':![],'defaultValue':_0x592a('0x6')},'transferredAt':{'type':Sequelize[_0x592a('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x592a('0x8')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index c534475..3f9155f 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 _0x748b=['describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','Content-Range','apply','reject','update','then','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','ChatTransferReport','count','includeAll','include','findAll','rows','params','model','fields','catch','create','body','find'];(function(_0x1e0b23,_0x447f13){var _0x9e049c=function(_0x41f9e3){while(--_0x41f9e3){_0x1e0b23['push'](_0x1e0b23['shift']());}};_0x9e049c(++_0x447f13);}(_0x748b,0x164));var _0xb748=function(_0x4edbff,_0x38fe37){_0x4edbff=_0x4edbff-0x0;var _0xc572fd=_0x748b[_0x4edbff];return _0xc572fd;};'use strict';var pdf=require(_0xb748('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb748('0x1'));var zipdir=require(_0xb748('0x2'));var jsonpatch=require(_0xb748('0x3'));var rp=require(_0xb748('0x4'));var moment=require('moment');var BPromise=require(_0xb748('0x5'));var Mustache=require(_0xb748('0x6'));var util=require('util');var path=require(_0xb748('0x7'));var sox=require(_0xb748('0x8'));var csv=require(_0xb748('0x9'));var ejs=require(_0xb748('0xa'));var fs=require('fs');var _=require(_0xb748('0xb'));var squel=require('squel');var crypto=require(_0xb748('0xc'));var jsforce=require(_0xb748('0xd'));var deskjs=require(_0xb748('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb748('0xf'));var Papa=require(_0xb748('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb748('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb748('0x12'))('api');var utils=require(_0xb748('0x13'));var config=require(_0xb748('0x14'));var db=require(_0xb748('0x15'))['db'];function respondWithStatusCode(_0x1d7958,_0x4a5685){_0x4a5685=_0x4a5685||0xcc;return function(_0x55740d){if(_0x55740d){return _0x1d7958[_0xb748('0x16')](_0x4a5685);}return _0x1d7958[_0xb748('0x17')](_0x4a5685)['end']();};}function respondWithResult(_0xf60ced,_0x530e14){_0x530e14=_0x530e14||0xc8;return function(_0x3c7f58){if(_0x3c7f58){return _0xf60ced[_0xb748('0x17')](_0x530e14)[_0xb748('0x18')](_0x3c7f58);}};}function respondWithFilteredResult(_0x1403df,_0x547b32){return function(_0x5d5251){if(_0x5d5251){var _0x5498e0=_0x5d5251['count'],_0x5c6b5b=_0x547b32[_0xb748('0x19')],_0x28b786=_0x547b32[_0xb748('0x19')]+_0x547b32[_0xb748('0x1a')],_0x20b99d;if(_0x28b786>=_0x5498e0){_0x28b786=_0x5498e0;_0x20b99d=0xc8;}else{_0x20b99d=0xce;}_0x1403df[_0xb748('0x17')](_0x20b99d);return _0x1403df['set'](_0xb748('0x1b'),_0x5c6b5b+'-'+_0x28b786+'/'+_0x5498e0)['json'](_0x5d5251);}return null;};}function patchUpdates(_0x449b9f){return function(_0x1c6ead){try{jsonpatch[_0xb748('0x1c')](_0x1c6ead,_0x449b9f,!![]);}catch(_0x427178){return BPromise[_0xb748('0x1d')](_0x427178);}return _0x1c6ead['save']();};}function saveUpdates(_0x17ae6c,_0x4cb402){return function(_0x89a446){if(_0x89a446){return _0x89a446[_0xb748('0x1e')](_0x17ae6c)[_0xb748('0x1f')](function(_0x3b20d1){return _0x3b20d1;});}return null;};}function removeEntity(_0x4b67bf,_0x59e260){return function(_0xed20d7){if(_0xed20d7){return _0xed20d7[_0xb748('0x20')]()[_0xb748('0x1f')](function(){_0x4b67bf['status'](0xcc)[_0xb748('0x21')]();});}};}function handleEntityNotFound(_0x47473b,_0xd280ec){return function(_0x44c2be){if(!_0x44c2be){_0x47473b['sendStatus'](0x194);}return _0x44c2be;};}function handleError(_0x4eb164,_0x5b060a){_0x5b060a=_0x5b060a||0x1f4;return function(_0x446f1b){logger['error'](_0x446f1b[_0xb748('0x22')]);if(_0x446f1b[_0xb748('0x23')]){delete _0x446f1b['name'];}_0x4eb164['status'](_0x5b060a)[_0xb748('0x24')](_0x446f1b);};}exports[_0xb748('0x25')]=function(_0x2e761a,_0x2d0156){var _0x5062ca={},_0x53c72d={},_0x1c96fc={'count':0x0,'rows':[]};var _0x5c203d=_[_0xb748('0x26')](db['ChatTransferReport'][_0xb748('0x27')],function(_0x229552){return{'name':_0x229552[_0xb748('0x28')],'type':_0x229552[_0xb748('0x29')]['key']};});_0x53c72d['model']=_[_0xb748('0x26')](_0x5c203d,'name');_0x53c72d[_0xb748('0x2a')]=_[_0xb748('0x2b')](_0x2e761a[_0xb748('0x2a')]);_0x53c72d[_0xb748('0x2c')]=_[_0xb748('0x2d')](_0x53c72d['model'],_0x53c72d[_0xb748('0x2a')]);_0x5062ca[_0xb748('0x2e')]=_[_0xb748('0x2d')](_0x53c72d['model'],qs['fields'](_0x2e761a[_0xb748('0x2a')]['fields']));_0x5062ca['attributes']=_0x5062ca[_0xb748('0x2e')][_0xb748('0x2f')]?_0x5062ca[_0xb748('0x2e')]:_0x53c72d['model'];if(!_0x2e761a['query'][_0xb748('0x30')](_0xb748('0x31'))){_0x5062ca[_0xb748('0x1a')]=qs[_0xb748('0x1a')](_0x2e761a[_0xb748('0x2a')][_0xb748('0x1a')]);_0x5062ca[_0xb748('0x19')]=qs[_0xb748('0x19')](_0x2e761a[_0xb748('0x2a')][_0xb748('0x19')]);}_0x5062ca[_0xb748('0x32')]=qs[_0xb748('0x33')](_0x2e761a[_0xb748('0x2a')][_0xb748('0x33')]);_0x5062ca['where']=qs[_0xb748('0x2c')](_[_0xb748('0x34')](_0x2e761a[_0xb748('0x2a')],_0x53c72d['filters']));if(_0x2e761a[_0xb748('0x2a')][_0xb748('0x35')]){_0x5062ca[_0xb748('0x36')]=_[_0xb748('0x37')](_0x5062ca[_0xb748('0x36')],{'$or':_['map'](_0x5c203d,function(_0x2bb2cb){if(_0x2bb2cb['type']!=='VIRTUAL'){var _0x293d16={};_0x293d16[_0x2bb2cb['name']]={'$like':'%'+_0x2e761a[_0xb748('0x2a')][_0xb748('0x35')]+'%'};return _0x293d16;}})});}_0x5062ca=_['merge']({},_0x5062ca,_0x2e761a[_0xb748('0x38')]);var _0x5ddab8={'where':_0x5062ca[_0xb748('0x36')]};return db[_0xb748('0x39')][_0xb748('0x3a')](_0x5ddab8)[_0xb748('0x1f')](function(_0x24181c){_0x1c96fc[_0xb748('0x3a')]=_0x24181c;if(_0x2e761a[_0xb748('0x2a')][_0xb748('0x3b')]){_0x5062ca[_0xb748('0x3c')]=[{'all':!![]}];}return db[_0xb748('0x39')][_0xb748('0x3d')](_0x5062ca);})[_0xb748('0x1f')](function(_0x23e331){_0x1c96fc[_0xb748('0x3e')]=_0x23e331;return _0x1c96fc;})[_0xb748('0x1f')](respondWithFilteredResult(_0x2d0156,_0x5062ca))['catch'](handleError(_0x2d0156,null));};exports['show']=function(_0x836540,_0x21d9f2){var _0x134b69={'raw':!![],'where':{'id':_0x836540[_0xb748('0x3f')]['id']}},_0x3b3ff9={};_0x3b3ff9['model']=_['keys'](db[_0xb748('0x39')][_0xb748('0x27')]);_0x3b3ff9['query']=_[_0xb748('0x2b')](_0x836540[_0xb748('0x2a')]);_0x3b3ff9[_0xb748('0x2c')]=_[_0xb748('0x2d')](_0x3b3ff9[_0xb748('0x40')],_0x3b3ff9[_0xb748('0x2a')]);_0x134b69['attributes']=_[_0xb748('0x2d')](_0x3b3ff9[_0xb748('0x40')],qs[_0xb748('0x41')](_0x836540[_0xb748('0x2a')][_0xb748('0x41')]));_0x134b69[_0xb748('0x2e')]=_0x134b69['attributes']['length']?_0x134b69[_0xb748('0x2e')]:_0x3b3ff9[_0xb748('0x40')];if(_0x836540[_0xb748('0x2a')]['includeAll']){_0x134b69[_0xb748('0x3c')]=[{'all':!![]}];}_0x134b69=_[_0xb748('0x37')]({},_0x134b69,_0x836540['options']);return db[_0xb748('0x39')]['find'](_0x134b69)[_0xb748('0x1f')](handleEntityNotFound(_0x21d9f2,null))['then'](respondWithResult(_0x21d9f2,null))[_0xb748('0x42')](handleError(_0x21d9f2,null));};exports[_0xb748('0x43')]=function(_0x29e515,_0x584c6a){return db[_0xb748('0x39')][_0xb748('0x43')](_0x29e515[_0xb748('0x44')],{})[_0xb748('0x1f')](respondWithResult(_0x584c6a,0xc9))[_0xb748('0x42')](handleError(_0x584c6a,null));};exports['update']=function(_0x4ea35f,_0x544aae){if(_0x4ea35f[_0xb748('0x44')]['id']){delete _0x4ea35f[_0xb748('0x44')]['id'];}return db[_0xb748('0x39')][_0xb748('0x45')]({'where':{'id':_0x4ea35f[_0xb748('0x3f')]['id']}})[_0xb748('0x1f')](handleEntityNotFound(_0x544aae,null))[_0xb748('0x1f')](saveUpdates(_0x4ea35f[_0xb748('0x44')],null))[_0xb748('0x1f')](respondWithResult(_0x544aae,null))[_0xb748('0x42')](handleError(_0x544aae,null));};exports[_0xb748('0x20')]=function(_0x3f1a77,_0x120352){return db[_0xb748('0x39')]['find']({'where':{'id':_0x3f1a77[_0xb748('0x3f')]['id']}})['then'](handleEntityNotFound(_0x120352,null))[_0xb748('0x1f')](removeEntity(_0x120352,null))['catch'](handleError(_0x120352,null));};exports[_0xb748('0x46')]=function(_0x88495b,_0x30298a){return db['ChatTransferReport']['describe']()[_0xb748('0x1f')](respondWithResult(_0x30298a,null))['catch'](handleError(_0x30298a,null));}; \ No newline at end of file +var _0xbede=['describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatTransferReport','includeAll','include','findAll','catch','show','find','body','params'];(function(_0x2588f9,_0x477477){var _0x3a8979=function(_0x1311ff){while(--_0x1311ff){_0x2588f9['push'](_0x2588f9['shift']());}};_0x3a8979(++_0x477477);}(_0xbede,0xdc));var _0xebed=function(_0x5b4e7e,_0x48efb9){_0x5b4e7e=_0x5b4e7e-0x0;var _0x1ecf8d=_0xbede[_0x5b4e7e];return _0x1ecf8d;};'use strict';var pdf=require(_0xebed('0x0'));var emlformat=require(_0xebed('0x1'));var rimraf=require(_0xebed('0x2'));var zipdir=require(_0xebed('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xebed('0x4'));var moment=require(_0xebed('0x5'));var BPromise=require(_0xebed('0x6'));var Mustache=require(_0xebed('0x7'));var util=require('util');var path=require(_0xebed('0x8'));var sox=require(_0xebed('0x9'));var csv=require(_0xebed('0xa'));var ejs=require(_0xebed('0xb'));var fs=require('fs');var _=require(_0xebed('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xebed('0xd'));var deskjs=require(_0xebed('0xe'));var toCsv=require(_0xebed('0xa'));var querystring=require(_0xebed('0xf'));var Papa=require(_0xebed('0x10'));var Redis=require(_0xebed('0x11'));var authService=require(_0xebed('0x12'));var qs=require(_0xebed('0x13'));var as=require(_0xebed('0x14'));var hardwareService=require(_0xebed('0x15'));var logger=require(_0xebed('0x16'))(_0xebed('0x17'));var utils=require(_0xebed('0x18'));var config=require(_0xebed('0x19'));var db=require(_0xebed('0x1a'))['db'];function respondWithStatusCode(_0x2bf900,_0x53ba95){_0x53ba95=_0x53ba95||0xcc;return function(_0x2ef002){if(_0x2ef002){return _0x2bf900[_0xebed('0x1b')](_0x53ba95);}return _0x2bf900['status'](_0x53ba95)[_0xebed('0x1c')]();};}function respondWithResult(_0x1a4fe6,_0x13509){_0x13509=_0x13509||0xc8;return function(_0x53c287){if(_0x53c287){return _0x1a4fe6[_0xebed('0x1d')](_0x13509)[_0xebed('0x1e')](_0x53c287);}};}function respondWithFilteredResult(_0x3b8bdb,_0x50d860){return function(_0x319f0b){if(_0x319f0b){var _0x30fd3d=_0x319f0b[_0xebed('0x1f')],_0x3dedca=_0x50d860[_0xebed('0x20')],_0x4374f4=_0x50d860[_0xebed('0x20')]+_0x50d860[_0xebed('0x21')],_0x5453ba;if(_0x4374f4>=_0x30fd3d){_0x4374f4=_0x30fd3d;_0x5453ba=0xc8;}else{_0x5453ba=0xce;}_0x3b8bdb[_0xebed('0x1d')](_0x5453ba);return _0x3b8bdb[_0xebed('0x22')](_0xebed('0x23'),_0x3dedca+'-'+_0x4374f4+'/'+_0x30fd3d)[_0xebed('0x1e')](_0x319f0b);}return null;};}function patchUpdates(_0x5986e3){return function(_0x1735ef){try{jsonpatch[_0xebed('0x24')](_0x1735ef,_0x5986e3,!![]);}catch(_0x278e9b){return BPromise[_0xebed('0x25')](_0x278e9b);}return _0x1735ef[_0xebed('0x26')]();};}function saveUpdates(_0x191465,_0x886785){return function(_0x458bed){if(_0x458bed){return _0x458bed[_0xebed('0x27')](_0x191465)[_0xebed('0x28')](function(_0x17792f){return _0x17792f;});}return null;};}function removeEntity(_0x4543bb,_0x336202){return function(_0x2e2a1f){if(_0x2e2a1f){return _0x2e2a1f[_0xebed('0x29')]()[_0xebed('0x28')](function(){_0x4543bb['status'](0xcc)[_0xebed('0x1c')]();});}};}function handleEntityNotFound(_0x4592a2,_0x1dbc9d){return function(_0x403616){if(!_0x403616){_0x4592a2[_0xebed('0x1b')](0x194);}return _0x403616;};}function handleError(_0xce2652,_0x3e7544){_0x3e7544=_0x3e7544||0x1f4;return function(_0x87d434){logger['error'](_0x87d434[_0xebed('0x2a')]);if(_0x87d434[_0xebed('0x2b')]){delete _0x87d434['name'];}_0xce2652[_0xebed('0x1d')](_0x3e7544)['send'](_0x87d434);};}exports[_0xebed('0x2c')]=function(_0x1355dc,_0x4ba5ba){var _0x426223={},_0x44d14d={},_0x17634a={'count':0x0,'rows':[]};var _0x1521c9=_[_0xebed('0x2d')](db['ChatTransferReport']['rawAttributes'],function(_0xd5e2fe){return{'name':_0xd5e2fe['fieldName'],'type':_0xd5e2fe[_0xebed('0x2e')]['key']};});_0x44d14d[_0xebed('0x2f')]=_[_0xebed('0x2d')](_0x1521c9,_0xebed('0x2b'));_0x44d14d[_0xebed('0x30')]=_[_0xebed('0x31')](_0x1355dc[_0xebed('0x30')]);_0x44d14d[_0xebed('0x32')]=_[_0xebed('0x33')](_0x44d14d[_0xebed('0x2f')],_0x44d14d[_0xebed('0x30')]);_0x426223[_0xebed('0x34')]=_['intersection'](_0x44d14d[_0xebed('0x2f')],qs[_0xebed('0x35')](_0x1355dc[_0xebed('0x30')][_0xebed('0x35')]));_0x426223[_0xebed('0x34')]=_0x426223['attributes'][_0xebed('0x36')]?_0x426223['attributes']:_0x44d14d[_0xebed('0x2f')];if(!_0x1355dc['query'][_0xebed('0x37')](_0xebed('0x38'))){_0x426223['limit']=qs[_0xebed('0x21')](_0x1355dc[_0xebed('0x30')]['limit']);_0x426223[_0xebed('0x20')]=qs[_0xebed('0x20')](_0x1355dc['query'][_0xebed('0x20')]);}_0x426223['order']=qs[_0xebed('0x39')](_0x1355dc[_0xebed('0x30')]['sort']);_0x426223[_0xebed('0x3a')]=qs[_0xebed('0x32')](_['pick'](_0x1355dc['query'],_0x44d14d[_0xebed('0x32')]));if(_0x1355dc[_0xebed('0x30')][_0xebed('0x3b')]){_0x426223[_0xebed('0x3a')]=_[_0xebed('0x3c')](_0x426223['where'],{'$or':_[_0xebed('0x2d')](_0x1521c9,function(_0xbf773d){if(_0xbf773d[_0xebed('0x2e')]!==_0xebed('0x3d')){var _0x5180a4={};_0x5180a4[_0xbf773d['name']]={'$like':'%'+_0x1355dc[_0xebed('0x30')][_0xebed('0x3b')]+'%'};return _0x5180a4;}})});}_0x426223=_[_0xebed('0x3c')]({},_0x426223,_0x1355dc[_0xebed('0x3e')]);var _0xe20a39={'where':_0x426223[_0xebed('0x3a')]};return db[_0xebed('0x3f')]['count'](_0xe20a39)[_0xebed('0x28')](function(_0x6db13){_0x17634a['count']=_0x6db13;if(_0x1355dc[_0xebed('0x30')][_0xebed('0x40')]){_0x426223[_0xebed('0x41')]=[{'all':!![]}];}return db[_0xebed('0x3f')][_0xebed('0x42')](_0x426223);})[_0xebed('0x28')](function(_0x5a9a43){_0x17634a['rows']=_0x5a9a43;return _0x17634a;})['then'](respondWithFilteredResult(_0x4ba5ba,_0x426223))[_0xebed('0x43')](handleError(_0x4ba5ba,null));};exports[_0xebed('0x44')]=function(_0x1b206e,_0x266ea3){var _0x1f2416={'raw':!![],'where':{'id':_0x1b206e['params']['id']}},_0x2760af={};_0x2760af[_0xebed('0x2f')]=_[_0xebed('0x31')](db[_0xebed('0x3f')]['rawAttributes']);_0x2760af[_0xebed('0x30')]=_[_0xebed('0x31')](_0x1b206e[_0xebed('0x30')]);_0x2760af[_0xebed('0x32')]=_['intersection'](_0x2760af[_0xebed('0x2f')],_0x2760af['query']);_0x1f2416['attributes']=_[_0xebed('0x33')](_0x2760af['model'],qs[_0xebed('0x35')](_0x1b206e[_0xebed('0x30')][_0xebed('0x35')]));_0x1f2416[_0xebed('0x34')]=_0x1f2416[_0xebed('0x34')][_0xebed('0x36')]?_0x1f2416[_0xebed('0x34')]:_0x2760af[_0xebed('0x2f')];if(_0x1b206e[_0xebed('0x30')][_0xebed('0x40')]){_0x1f2416[_0xebed('0x41')]=[{'all':!![]}];}_0x1f2416=_[_0xebed('0x3c')]({},_0x1f2416,_0x1b206e[_0xebed('0x3e')]);return db[_0xebed('0x3f')][_0xebed('0x45')](_0x1f2416)[_0xebed('0x28')](handleEntityNotFound(_0x266ea3,null))['then'](respondWithResult(_0x266ea3,null))[_0xebed('0x43')](handleError(_0x266ea3,null));};exports['create']=function(_0x2d29a4,_0x4f88e3){return db[_0xebed('0x3f')]['create'](_0x2d29a4[_0xebed('0x46')],{})[_0xebed('0x28')](respondWithResult(_0x4f88e3,0xc9))[_0xebed('0x43')](handleError(_0x4f88e3,null));};exports['update']=function(_0xcf0e22,_0x472fbb){if(_0xcf0e22[_0xebed('0x46')]['id']){delete _0xcf0e22['body']['id'];}return db[_0xebed('0x3f')][_0xebed('0x45')]({'where':{'id':_0xcf0e22[_0xebed('0x47')]['id']}})[_0xebed('0x28')](handleEntityNotFound(_0x472fbb,null))[_0xebed('0x28')](saveUpdates(_0xcf0e22[_0xebed('0x46')],null))[_0xebed('0x28')](respondWithResult(_0x472fbb,null))['catch'](handleError(_0x472fbb,null));};exports[_0xebed('0x29')]=function(_0xc0c1c6,_0xe00d46){return db[_0xebed('0x3f')][_0xebed('0x45')]({'where':{'id':_0xc0c1c6[_0xebed('0x47')]['id']}})[_0xebed('0x28')](handleEntityNotFound(_0xe00d46,null))['then'](removeEntity(_0xe00d46,null))[_0xebed('0x43')](handleError(_0xe00d46,null));};exports['describe']=function(_0x2d2371,_0xb650c6){return db[_0xebed('0x3f')][_0xebed('0x48')]()[_0xebed('0x28')](respondWithResult(_0xb650c6,null))['catch'](handleError(_0xb650c6,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 19d3361..d9473d6 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 _0xbcdf=['../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0xbcdf,0x8e));var _0xfbcd=function(_0x17b90c,_0x46ba51){_0x17b90c=_0x17b90c-0x0;var _0x4100d2=_0xbcdf[_0x17b90c];return _0x4100d2;};'use strict';var _=require(_0xfbcd('0x0'));var util=require('util');var logger=require(_0xfbcd('0x1'))(_0xfbcd('0x2'));var moment=require(_0xfbcd('0x3'));var BPromise=require(_0xfbcd('0x4'));var rp=require(_0xfbcd('0x5'));var fs=require('fs');var path=require(_0xfbcd('0x6'));var rimraf=require(_0xfbcd('0x7'));var config=require(_0xfbcd('0x8'));var attributes=require(_0xfbcd('0x9'));module[_0xfbcd('0xa')]=function(_0x38184f,_0x2e07b1){return _0x38184f[_0xfbcd('0xb')](_0xfbcd('0xc'),attributes,{'tableName':_0xfbcd('0xd'),'paranoid':![],'indexes':[{'name':_0xfbcd('0xe'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xcb91=['moment','bluebird','request-promise','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','uniqueid','lodash','../../config/logger'];(function(_0x5e8c32,_0x1b1f3f){var _0x595f7b=function(_0x38840e){while(--_0x38840e){_0x5e8c32['push'](_0x5e8c32['shift']());}};_0x595f7b(++_0x1b1f3f);}(_0xcb91,0x153));var _0x1cb9=function(_0x4b6778,_0x505a76){_0x4b6778=_0x4b6778-0x0;var _0x22dbb9=_0xcb91[_0x4b6778];return _0x22dbb9;};'use strict';var _=require(_0x1cb9('0x0'));var util=require('util');var logger=require(_0x1cb9('0x1'))('api');var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require(_0x1cb9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1cb9('0x5'));var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x3d8ede,_0x5a42f2){return _0x3d8ede[_0x1cb9('0x8')](_0x1cb9('0x9'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x1cb9('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index c8e0f30..1b122c5 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 _0xfb79=['error','code','message','result','catch','lodash','bluebird','ioredis','rpc','../../config/environment','jayson/promise','http','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4a6bc3,_0x4d819e){var _0x803fa9=function(_0x51ce66){while(--_0x51ce66){_0x4a6bc3['push'](_0x4a6bc3['shift']());}};_0x803fa9(++_0x4d819e);}(_0xfb79,0xd6));var _0x9fb7=function(_0x481778,_0x3591a2){_0x481778=_0x481778-0x0;var _0x180616=_0xfb79[_0x481778];return _0x180616;};'use strict';var _=require(_0x9fb7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9fb7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9fb7('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9fb7('0x3'));var config=require(_0x9fb7('0x4'));var jayson=require(_0x9fb7('0x5'));var client=jayson['client'][_0x9fb7('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2ded2a,_0xa8fda3,_0x35f995){return new BPromise(function(_0x10dd0a,_0x251f55){return client[_0x9fb7('0x7')](_0x2ded2a,_0x35f995)['then'](function(_0x1f0dc2){logger[_0x9fb7('0x8')](_0x9fb7('0x9'),_0xa8fda3,_0x9fb7('0xa'));logger[_0x9fb7('0xb')](_0x9fb7('0xc'),_0xa8fda3,_0x9fb7('0xa'),JSON[_0x9fb7('0xd')](_0x1f0dc2));if(_0x1f0dc2['error']){if(_0x1f0dc2[_0x9fb7('0xe')][_0x9fb7('0xf')]===0x1f4){logger[_0x9fb7('0xe')](_0x9fb7('0x9'),_0xa8fda3,_0x1f0dc2[_0x9fb7('0xe')]['message']);return _0x251f55(_0x1f0dc2[_0x9fb7('0xe')]['message']);}logger['error'](_0x9fb7('0x9'),_0xa8fda3,_0x1f0dc2[_0x9fb7('0xe')][_0x9fb7('0x10')]);return _0x10dd0a(_0x1f0dc2[_0x9fb7('0xe')][_0x9fb7('0x10')]);}else{logger[_0x9fb7('0x8')]('ChatTransferReport,\x20%s,\x20%s',_0xa8fda3,_0x9fb7('0xa'));_0x10dd0a(_0x1f0dc2[_0x9fb7('0x11')][_0x9fb7('0x10')]);}})[_0x9fb7('0x12')](function(_0x585273){logger[_0x9fb7('0xe')](_0x9fb7('0x9'),_0xa8fda3,_0x585273);_0x251f55(_0x585273);});});} \ No newline at end of file +var _0xbb7a=['../../config/environment','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x5d8c3a,_0x52c448){var _0x5fbe1b=function(_0x5a07b4){while(--_0x5a07b4){_0x5d8c3a['push'](_0x5d8c3a['shift']());}};_0x5fbe1b(++_0x52c448);}(_0xbb7a,0xf5));var _0xabb7=function(_0x8b1093,_0x1cd142){_0x8b1093=_0x8b1093-0x0;var _0x136b64=_0xbb7a[_0x8b1093];return _0x136b64;};'use strict';var _=require(_0xabb7('0x0'));var util=require(_0xabb7('0x1'));var moment=require('moment');var BPromise=require(_0xabb7('0x2'));var rs=require(_0xabb7('0x3'));var fs=require('fs');var Redis=require(_0xabb7('0x4'));var db=require(_0xabb7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xabb7('0x6'))(_0xabb7('0x7'));var config=require(_0xabb7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xabb7('0x9')][_0xabb7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x510e12,_0x5bd2e2,_0x184dce){return new BPromise(function(_0x50bb5e,_0x52c88f){return client[_0xabb7('0xb')](_0x510e12,_0x184dce)[_0xabb7('0xc')](function(_0x3c137b){logger[_0xabb7('0xd')](_0xabb7('0xe'),_0x5bd2e2,'request\x20sent');logger[_0xabb7('0xf')](_0xabb7('0x10'),_0x5bd2e2,_0xabb7('0x11'),JSON['stringify'](_0x3c137b));if(_0x3c137b[_0xabb7('0x12')]){if(_0x3c137b[_0xabb7('0x12')][_0xabb7('0x13')]===0x1f4){logger[_0xabb7('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x5bd2e2,_0x3c137b['error'][_0xabb7('0x14')]);return _0x52c88f(_0x3c137b['error']['message']);}logger['error'](_0xabb7('0xe'),_0x5bd2e2,_0x3c137b[_0xabb7('0x12')][_0xabb7('0x14')]);return _0x50bb5e(_0x3c137b[_0xabb7('0x12')][_0xabb7('0x14')]);}else{logger[_0xabb7('0xd')](_0xabb7('0xe'),_0x5bd2e2,'request\x20sent');_0x50bb5e(_0x3c137b[_0xabb7('0x15')][_0xabb7('0x14')]);}})[_0xabb7('0x16')](function(_0x4cba94){logger[_0xabb7('0x12')](_0xabb7('0xe'),_0x5bd2e2,_0x4cba94);_0x52c88f(_0x4cba94);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 3a5e86f..910f503 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 _0xb10b=['../../config/environment','./chatTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x414d86,_0x32abf3){var _0x4170d6=function(_0x5abcb2){while(--_0x5abcb2){_0x414d86['push'](_0x414d86['shift']());}};_0x4170d6(++_0x32abf3);}(_0xb10b,0x12a));var _0xbb10=function(_0x550e70,_0x3d9c91){_0x550e70=_0x550e70-0x0;var _0x4ac7da=_0xb10b[_0x550e70];return _0x4ac7da;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0xe')]('/',auth[_0xbb10('0x9')](),controller[_0xbb10('0xf')]);router['put']('/:id',auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router[_0xbb10('0x11')]('/:id',auth[_0xbb10('0x9')](),controller['destroy']);module[_0xbb10('0x12')]=router; \ No newline at end of file +var _0x0b0e=['multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','create','delete','exports'];(function(_0x171776,_0x5c1ab3){var _0xe169cd=function(_0x133bd6){while(--_0x133bd6){_0x171776['push'](_0x171776['shift']());}};_0xe169cd(++_0x5c1ab3);}(_0x0b0e,0x187));var _0xe0b0=function(_0x47b15f,_0x103e93){_0x47b15f=_0x47b15f-0x0;var _0x55bf25=_0x0b0e[_0x47b15f];return _0x55bf25;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var auth=require(_0xe0b0('0x4'));var interaction=require(_0xe0b0('0x5'));var config=require(_0xe0b0('0x6'));var controller=require(_0xe0b0('0x7'));router[_0xe0b0('0x8')]('/',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xa')]);router[_0xe0b0('0x8')](_0xe0b0('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xe0b0('0x8')](_0xe0b0('0xc'),auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xd')]);router['post']('/',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xe')]);router['put'](_0xe0b0('0xc'),auth[_0xe0b0('0x9')](),controller['update']);router[_0xe0b0('0xf')](_0xe0b0('0xc'),auth[_0xe0b0('0x9')](),controller['destroy']);module[_0xe0b0('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 685565b..30c94f2 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 _0x51fb=['squared','We\x20are\x20here!','Chat','Contact\x20us','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','stringify','name','text','input','email','onlineForm','parse','textarea','Comments','Leave\x20your\x20comments','getDataValue','offlineForm','setDataValue','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:','Your\x20request\x20has\x20not\x20been\x20processed.','Send','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','randomstring','exports','STRING','address','Agent','#9f946a','#ffffff','INTEGER','BOOLEAN','ENUM','rounded'];(function(_0x2866a3,_0x3fe3c5){var _0x2a9d52=function(_0x53417a){while(--_0x53417a){_0x2866a3['push'](_0x2866a3['shift']());}};_0x2a9d52(++_0x3fe3c5);}(_0x51fb,0x1c8));var _0xb51f=function(_0x1be181,_0x29d354){_0x1be181=_0x1be181-0x0;var _0x2f46d3=_0x51fb[_0x1be181];return _0x2f46d3;};'use strict';var Sequelize=require(_0xb51f('0x0'));var rs=require(_0xb51f('0x1'));module[_0xb51f('0x2')]={'name':{'type':Sequelize[_0xb51f('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xb51f('0x3')],'allowNull':![],'unique':_0xb51f('0x4')},'description':{'type':Sequelize[_0xb51f('0x3')]},'mapKey':{'type':Sequelize[_0xb51f('0x3')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':'email'},'key':{'type':Sequelize[_0xb51f('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xb51f('0x5')},'customerAlias':{'type':Sequelize[_0xb51f('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xb51f('0x3')],'allowNull':![],'defaultValue':_0xb51f('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xb51f('0x3')],'allowNull':![],'defaultValue':_0xb51f('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xb51f('0x3')],'allowNull':![],'defaultValue':_0xb51f('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xb51f('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xb51f('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xb51f('0xa')](_0xb51f('0xb'),_0xb51f('0xc')),'defaultValue':_0xb51f('0xb')},'header_online':{'type':Sequelize[_0xb51f('0x3')],'defaultValue':_0xb51f('0xd')},'start_chat_button':{'type':Sequelize[_0xb51f('0x3')],'defaultValue':_0xb51f('0xe')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0xb51f('0x3')],'defaultValue':_0xb51f('0xf')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xb51f('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xb51f('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xb51f('0x10')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0xb51f('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0xb51f('0x3')],'defaultValue':_0xb51f('0x12')},'noteTitle':{'type':Sequelize[_0xb51f('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xb51f('0x3')],'defaultValue':_0xb51f('0x13')},'closingMessage':{'type':Sequelize[_0xb51f('0x3')],'defaultValue':_0xb51f('0x14')},'closingMessageButton':{'type':Sequelize[_0xb51f('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xb51f('0x15')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xb51f('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xb51f('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xb51f('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xb51f('0x3')],'defaultValue':_0xb51f('0x16')},'ratingType':{'type':Sequelize[_0xb51f('0xa')](_0xb51f('0x17'),'thumb'),'defaultValue':_0xb51f('0x17')},'ratingStarsNumber':{'type':Sequelize[_0xb51f('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xb51f('0x10')],'defaultValue':function(){return JSON[_0xb51f('0x18')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0xb51f('0x19'),'type':_0xb51f('0x1a'),'required':!![]},'props':{'title':_0xb51f('0x19'),'helpText':''}},{'type':_0xb51f('0x1b'),'props':{'title':_0xb51f('0x1c'),'helpText':''},'config':{'required':!![],'placeholder':_0xb51f('0x1c'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xb51f('0x1d'))?JSON[_0xb51f('0x1e')](this['getDataValue']('onlineForm')):{};},'set':function(_0x363c61){return this['setDataValue'](_0xb51f('0x1d'),JSON[_0xb51f('0x18')](_0x363c61));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xb51f('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xb51f('0x1c')},'variable':null},{'type':_0xb51f('0x1f'),'config':{'placeholder':_0xb51f('0x20')},'props':{'title':'Comments','helpText':_0xb51f('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0xb51f('0x22')](_0xb51f('0x23'))?JSON[_0xb51f('0x1e')](this['getDataValue']('offlineForm')):{};},'set':function(_0x28520a){return this[_0xb51f('0x24')](_0xb51f('0x23'),JSON[_0xb51f('0x18')](_0x28520a));}},'token':{'type':Sequelize[_0xb51f('0x3')],'defaultValue':function(){return rs[_0xb51f('0x25')]();}},'autoclose':{'type':Sequelize[_0xb51f('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xb51f('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xb51f('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xb51f('0x3')]},'forwardOffline':{'type':Sequelize[_0xb51f('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0xb51f('0x3')],'defaultValue':_0xb51f('0x26')},'waitingMessage':{'type':Sequelize[_0xb51f('0x3')],'defaultValue':_0xb51f('0x27')},'offlineMessageSubject':{'type':Sequelize[_0xb51f('0x3')],'defaultValue':_0xb51f('0x28')},'offlineMessageBody':{'type':Sequelize[_0xb51f('0x3')],'defaultValue':_0xb51f('0x29')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xb51f('0x3')],'defaultValue':_0xb51f('0x2a')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xb51f('0x15')},'sendUnmanaged':{'type':Sequelize[_0xb51f('0x3')],'defaultValue':_0xb51f('0x2b')},'enableCustomerAttachment':{'type':Sequelize[_0xb51f('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xb51f('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xb51f('0x10')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'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[_0xb51f('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xb51f('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0xb51f('0x2c')},'waitForTheAssignedAgent':{'type':Sequelize[_0xb51f('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0xb51f('0x2d')},'verticalAlignment':{'type':Sequelize[_0xb51f('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xb51f('0x2e')},'defaultTitle':{'type':Sequelize[_0xb51f('0x3')]},'customerAvatar':{'type':Sequelize[_0xb51f('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0xb51f('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xb51f('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xb51f('0x3')],'allowNull':![],'defaultValue':_0xb51f('0x2f'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xb51f('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb51f('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb51f('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb51f('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xb51f('0x3')],'defaultValue':_0xb51f('0x30')},'systemAvatar':{'type':Sequelize[_0xb51f('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb51f('0x8')],'comment':_0xb51f('0x31')},'mandatoryDisposition':{'type':Sequelize[_0xb51f('0x9')],'defaultValue':![],'comment':_0xb51f('0x32'),'set':function(_0x375f06){if(!_0x375f06)this[_0xb51f('0x24')]('mandatoryDispositionPauseId',null);this[_0xb51f('0x24')](_0xb51f('0x33'),_0x375f06);}}}; \ No newline at end of file +var _0xe2c1=['alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','STRING','email','#9f946a','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','TEXT','input','name','text','getDataValue','onlineForm','parse','setDataValue','stringify','textarea','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','website_alias'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xe2c1,0x164));var _0x1e2c=function(_0x299845,_0x50817b){_0x299845=_0x299845-0x0;var _0x4f82bb=_0xe2c1[_0x299845];return _0x4f82bb;};'use strict';var Sequelize=require(_0x1e2c('0x0'));var rs=require(_0x1e2c('0x1'));module['exports']={'name':{'type':Sequelize[_0x1e2c('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x1e2c('0x2')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x1e2c('0x2')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x1e2c('0x3')},'mapKeyOffline':{'type':Sequelize[_0x1e2c('0x2')],'defaultValue':_0x1e2c('0x3')},'key':{'type':Sequelize[_0x1e2c('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x1e2c('0x2')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x1e2c('0x2')],'allowNull':![],'defaultValue':_0x1e2c('0x4'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x1e2c('0x2')],'allowNull':![],'defaultValue':_0x1e2c('0x4'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x1e2c('0x2')],'allowNull':![],'defaultValue':_0x1e2c('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x1e2c('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x1e2c('0x2')]},'animation':{'type':Sequelize[_0x1e2c('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x1e2c('0x8')](_0x1e2c('0x9'),_0x1e2c('0xa')),'defaultValue':_0x1e2c('0x9')},'header_online':{'type':Sequelize[_0x1e2c('0x2')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x1e2c('0x2')],'defaultValue':_0x1e2c('0xb')},'offline_chat_button':{'type':Sequelize[_0x1e2c('0x2')],'defaultValue':_0x1e2c('0xc')},'header_offline':{'type':Sequelize[_0x1e2c('0x2')],'defaultValue':_0x1e2c('0xd')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x1e2c('0x2')],'defaultValue':_0x1e2c('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x1e2c('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x1e2c('0x2')],'defaultValue':_0x1e2c('0xf')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x1e2c('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0x1e2c('0x2')],'defaultValue':_0x1e2c('0x11')},'noteTitle':{'type':Sequelize[_0x1e2c('0x2')],'defaultValue':_0x1e2c('0x12')},'placeholderMessage':{'type':Sequelize[_0x1e2c('0x2')],'defaultValue':_0x1e2c('0x13')},'closingMessage':{'type':Sequelize[_0x1e2c('0x2')],'defaultValue':_0x1e2c('0x14')},'closingMessageButton':{'type':Sequelize[_0x1e2c('0x2')],'defaultValue':_0x1e2c('0xc')},'skipMessageButton':{'type':Sequelize[_0x1e2c('0x2')],'defaultValue':_0x1e2c('0x15')},'conditionAgreement':{'type':Sequelize[_0x1e2c('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x1e2c('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x1e2c('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x1e2c('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x1e2c('0x2')],'defaultValue':_0x1e2c('0x16')},'ratingType':{'type':Sequelize[_0x1e2c('0x8')](_0x1e2c('0x17'),_0x1e2c('0x18')),'defaultValue':_0x1e2c('0x17')},'ratingStarsNumber':{'type':Sequelize[_0x1e2c('0x6')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x1e2c('0x19')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x1e2c('0x1a'),'variable':null,'config':{'placeholder':_0x1e2c('0x1b'),'type':_0x1e2c('0x1c'),'required':!![]},'props':{'title':_0x1e2c('0x1b'),'helpText':''}},{'type':_0x1e2c('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x1e2c('0x3'),'type':_0x1e2c('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x1e2c('0x1d')](_0x1e2c('0x1e'))?JSON[_0x1e2c('0x1f')](this['getDataValue'](_0x1e2c('0x1e'))):{};},'set':function(_0x129ac7){return this[_0x1e2c('0x20')](_0x1e2c('0x1e'),JSON[_0x1e2c('0x21')](_0x129ac7));}},'offlineForm':{'type':Sequelize[_0x1e2c('0x19')],'defaultValue':function(){return JSON[_0x1e2c('0x21')]({'items':[{'type':_0x1e2c('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x1e2c('0x3'),'type':_0x1e2c('0x3')},'variable':null},{'type':_0x1e2c('0x22'),'config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':_0x1e2c('0x23')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x1e2c('0x24'))?JSON[_0x1e2c('0x1f')](this['getDataValue']('offlineForm')):{};},'set':function(_0x10ba84){return this[_0x1e2c('0x20')]('offlineForm',JSON['stringify'](_0x10ba84));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x1e2c('0x25')]();}},'autoclose':{'type':Sequelize[_0x1e2c('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x1e2c('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x1e2c('0x2')]},'forwardOffline':{'type':Sequelize[_0x1e2c('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x1e2c('0x2')]},'waitingTitle':{'type':Sequelize[_0x1e2c('0x2')],'defaultValue':_0x1e2c('0x26')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x1e2c('0x27')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x1e2c('0x28')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x1e2c('0x29')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x1e2c('0x2')],'defaultValue':_0x1e2c('0x2a')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x1e2c('0x15')},'sendUnmanaged':{'type':Sequelize[_0x1e2c('0x2')],'defaultValue':_0x1e2c('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0x1e2c('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x1e2c('0x19')]},'showAgentAvatar':{'type':Sequelize[_0x1e2c('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x1e2c('0x2')]},'notificationTemplate':{'type':Sequelize[_0x1e2c('0x19')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x1e2c('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x1e2c('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x1e2c('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x1e2c('0x2')],'defaultValue':_0x1e2c('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0x1e2c('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x1e2c('0x2')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x1e2c('0x6')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x1e2c('0x2')],'defaultValue':_0x1e2c('0x2c')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x1e2c('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x1e2c('0x6')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x1e2c('0x2')],'allowNull':![],'defaultValue':_0x1e2c('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x1e2c('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1e2c('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x1e2c('0x2')],'defaultValue':_0x1e2c('0x2e')},'systemAvatar':{'type':Sequelize[_0x1e2c('0x19')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1e2c('0x6')],'comment':_0x1e2c('0x2f')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x5a7c56){if(!_0x5a7c56)this[_0x1e2c('0x20')](_0x1e2c('0x30'),null);this[_0x1e2c('0x20')](_0x1e2c('0x31'),_0x5a7c56);}}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 51e1f65..ec2b646 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 _0x0af1=['ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','json','offset','reject','save','update','destroy','ChatWebsites','UserProfileResource','end','stack','name','send','Pause','ChatWebsite','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','limit','order','sort','where','pick','merge','map','type','VIRTUAL','filter','count','include','findAll','show','mandatoryDispositionPause','keys','includeAll','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','describe','addDisposition','params','ChatWebsiteId','getDispositions','findOne','Disposition','nolimit','rows','removeDispositions','CannedAnswer','hasOwnProperty','removeAnswers','ids','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.png','../../config/license/util','getLicense','custom','isNil','server/files/images/logos/','join','getAvatar','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','chat','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','Contacts','DESC','Applications','List','account','applications','list','orderBy','priority','asc','contact','customerIp','headers','cf-connecting-ip','x-forwarded-for','first','firstName','lastName','x-real-port','referer','browser','version','format','unknown','%s\x20%s','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','MailAccount','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','auth','\x22%s\x22\x20<%s>','email','offlineMessageSubject','addInteraction','omit','getInteractions','Contact','fullname','internal','Tag','Tags','color','tag','getSnippet','timezone','iftime\x20%s,%s','iftime\x20%s','interval','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','Interval','Intervals','getProactiveActions','virtual','License','increment','all','readFileSync','remote','x-real-ip','replace','alignment','addApplications','sequelize','transaction','ChatApplication','bulkCreate','findAndCountAll','getApplications','addProactiveActions','getFields','online','false','onlineForm','fromKey','addAgents','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info'];(function(_0x217c2e,_0x358f06){var _0x22b7d8=function(_0x111c48){while(--_0x111c48){_0x217c2e['push'](_0x217c2e['shift']());}};_0x22b7d8(++_0x358f06);}(_0x0af1,0xf3));var _0x10af=function(_0xd30ce8,_0x3bbe58){_0xd30ce8=_0xd30ce8-0x0;var _0x14dfdd=_0x0af1[_0xd30ce8];return _0x14dfdd;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x10af('0x0'));var rimraf=require(_0x10af('0x1'));var zipdir=require(_0x10af('0x2'));var jsonpatch=require(_0x10af('0x3'));var rp=require(_0x10af('0x4'));var moment=require(_0x10af('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x10af('0x6'));var util=require('util');var path=require('path');var sox=require(_0x10af('0x7'));var csv=require(_0x10af('0x8'));var ejs=require(_0x10af('0x9'));var fs=require('fs');var _=require(_0x10af('0xa'));var squel=require('squel');var crypto=require(_0x10af('0xb'));var jsforce=require(_0x10af('0xc'));var deskjs=require(_0x10af('0xd'));var toCsv=require(_0x10af('0x8'));var querystring=require('querystring');var Papa=require(_0x10af('0xe'));var Redis=require(_0x10af('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x10af('0x10'));var as=require(_0x10af('0x11'));var hardwareService=require(_0x10af('0x12'));var logger=require(_0x10af('0x13'))('api');var utils=require(_0x10af('0x14'));var config=require(_0x10af('0x15'));var db=require('../../mysqldb')['db'];config[_0x10af('0x16')]=_[_0x10af('0x17')](config[_0x10af('0x16')],{'host':_0x10af('0x18'),'port':0x18eb});var socket=require(_0x10af('0x19'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0x10af('0x1a')](socket);var jayson=require(_0x10af('0x1b'));var client=jayson[_0x10af('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0x10af('0x1c')]['http']({'port':0x232a});var client9003=jayson[_0x10af('0x1c')]['http']({'port':0x232b});function checkPasswordPattern(_0x44952c,_0xeb7d9e,_0x54b0a0){if(_0x54b0a0){var _0x35e724=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x35e724['test'](_0xeb7d9e)){return _0x44952c;}else{throw new db[(_0x10af('0x1d'))][(_0x10af('0x1e'))](_0x10af('0x1f'));}}else{return _0x44952c;}}function respondWithRpcPromise(_0x3e3ea0,_0x5204b2,_0x3f9b00,_0xe7f7d0){return new BPromise(function(_0x224740,_0x513e4f){var _0x53fc16=_0xe7f7d0||client;return _0x53fc16[_0x10af('0x20')](_0x3e3ea0,_0x3f9b00)[_0x10af('0x21')](function(_0x6e905b){logger[_0x10af('0x22')](_0x10af('0x23'),_0x5204b2,_0x10af('0x24'));logger[_0x10af('0x25')](_0x10af('0x26'),_0x5204b2,_0x10af('0x24'),JSON[_0x10af('0x27')](_0x6e905b));if(_0x6e905b[_0x10af('0x28')]){if(_0x6e905b[_0x10af('0x28')]['code']===0x1f4){logger[_0x10af('0x28')](_0x10af('0x23'),_0x5204b2,_0x6e905b[_0x10af('0x28')][_0x10af('0x29')]);return _0x513e4f(_0x6e905b[_0x10af('0x28')][_0x10af('0x29')]);}logger[_0x10af('0x28')]('ChatWebsite,\x20%s,\x20%s',_0x5204b2,_0x6e905b[_0x10af('0x28')][_0x10af('0x29')]);return _0x224740(_0x6e905b[_0x10af('0x28')]['message']);}else{logger[_0x10af('0x22')](_0x10af('0x23'),_0x5204b2,_0x10af('0x24'));_0x224740(_0x6e905b[_0x10af('0x2a')][_0x10af('0x29')]);}})[_0x10af('0x2b')](function(_0x43a220){logger['error'](_0x10af('0x23'),_0x5204b2,_0x43a220);_0x513e4f(_0x43a220);});});}function respondWithStatusCode(_0x349d19,_0xe9f0af){_0xe9f0af=_0xe9f0af||0xcc;return function(_0x483a55){if(_0x483a55){return _0x349d19[_0x10af('0x2c')](_0xe9f0af);}return _0x349d19[_0x10af('0x2d')](_0xe9f0af)['end']();};}function respondWithResult(_0x17f7d0,_0x5dc210){_0x5dc210=_0x5dc210||0xc8;return function(_0x2ca5ef){if(_0x2ca5ef){return _0x17f7d0[_0x10af('0x2d')](_0x5dc210)[_0x10af('0x2e')](_0x2ca5ef);}};}function respondWithFilteredResult(_0x339645,_0x1469e3){return function(_0x9ac8d0){if(_0x9ac8d0){var _0x29031b=_0x9ac8d0['count'],_0x5d9aab=_0x1469e3[_0x10af('0x2f')],_0x450c03=_0x1469e3[_0x10af('0x2f')]+_0x1469e3['limit'],_0x2ebf1a;if(_0x450c03>=_0x29031b){_0x450c03=_0x29031b;_0x2ebf1a=0xc8;}else{_0x2ebf1a=0xce;}_0x339645[_0x10af('0x2d')](_0x2ebf1a);return _0x339645['set']('Content-Range',_0x5d9aab+'-'+_0x450c03+'/'+_0x29031b)[_0x10af('0x2e')](_0x9ac8d0);}return null;};}function patchUpdates(_0x4de033){return function(_0xd5b92c){try{jsonpatch['apply'](_0xd5b92c,_0x4de033,!![]);}catch(_0x388af0){return BPromise[_0x10af('0x30')](_0x388af0);}return _0xd5b92c[_0x10af('0x31')]();};}function saveUpdates(_0xc6b6ee,_0x516582){return function(_0x20a03b){if(_0x20a03b){return _0x20a03b[_0x10af('0x32')](_0xc6b6ee)[_0x10af('0x21')](function(_0x37a866){return _0x37a866;});}return null;};}function removeEntity(_0x5919f3,_0x55bbaf){return function(_0x5da662){if(_0x5da662){return _0x5da662[_0x10af('0x33')]()['then'](function(){var _0x354e6e=_0x5da662['get']({'plain':!![]});var _0x3a19a7=_0x10af('0x34');return db[_0x10af('0x35')][_0x10af('0x33')]({'where':{'type':_0x3a19a7,'resourceId':_0x354e6e['id']}})[_0x10af('0x21')](function(){return _0x5da662;});})[_0x10af('0x21')](function(){_0x5919f3[_0x10af('0x2d')](0xcc)[_0x10af('0x36')]();});}};}function handleEntityNotFound(_0x4d3e43,_0x3dc52f){return function(_0x21ad8a){if(!_0x21ad8a){_0x4d3e43[_0x10af('0x2c')](0x194);}return _0x21ad8a;};}function handleError(_0x7f4dda,_0x911e8c){_0x911e8c=_0x911e8c||0x1f4;return function(_0x450cf2){logger[_0x10af('0x28')](_0x450cf2[_0x10af('0x37')]);if(_0x450cf2[_0x10af('0x38')]){delete _0x450cf2[_0x10af('0x38')];}_0x7f4dda[_0x10af('0x2d')](_0x911e8c)[_0x10af('0x39')](_0x450cf2);};}exports['index']=function(_0x58149d,_0x21fa78){var _0x42a981={'include':[{'model':db[_0x10af('0x3a')],'as':'mandatoryDispositionPause'}]},_0x2d3650={},_0x770513={'count':0x0,'rows':[]};var _0x1bd2c1=_['map'](db[_0x10af('0x3b')][_0x10af('0x3c')],function(_0x30ebb2){return{'name':_0x30ebb2[_0x10af('0x3d')],'type':_0x30ebb2['type'][_0x10af('0x3e')]};});_0x2d3650[_0x10af('0x3f')]=_['map'](_0x1bd2c1,_0x10af('0x38'));_0x2d3650['query']=_['keys'](_0x58149d[_0x10af('0x40')]);_0x2d3650[_0x10af('0x41')]=_['intersection'](_0x2d3650[_0x10af('0x3f')],_0x2d3650[_0x10af('0x40')]);_0x42a981['attributes']=_[_0x10af('0x42')](_0x2d3650['model'],qs['fields'](_0x58149d[_0x10af('0x40')][_0x10af('0x43')]));_0x42a981[_0x10af('0x44')]=_0x42a981[_0x10af('0x44')][_0x10af('0x45')]?_0x42a981[_0x10af('0x44')]:_0x2d3650[_0x10af('0x3f')];if(!_0x58149d[_0x10af('0x40')]['hasOwnProperty']('nolimit')){_0x42a981[_0x10af('0x46')]=qs[_0x10af('0x46')](_0x58149d['query'][_0x10af('0x46')]);_0x42a981[_0x10af('0x2f')]=qs[_0x10af('0x2f')](_0x58149d[_0x10af('0x40')]['offset']);}_0x42a981[_0x10af('0x47')]=qs[_0x10af('0x48')](_0x58149d[_0x10af('0x40')][_0x10af('0x48')]);_0x42a981[_0x10af('0x49')]=qs['filters'](_[_0x10af('0x4a')](_0x58149d['query'],_0x2d3650['filters']));if(_0x58149d[_0x10af('0x40')]['filter']){_0x42a981[_0x10af('0x49')]=_[_0x10af('0x4b')](_0x42a981[_0x10af('0x49')],{'$or':_[_0x10af('0x4c')](_0x1bd2c1,function(_0x479a80){if(_0x479a80[_0x10af('0x4d')]!==_0x10af('0x4e')){var _0x2ceee3={};_0x2ceee3[_0x479a80[_0x10af('0x38')]]={'$like':'%'+_0x58149d[_0x10af('0x40')][_0x10af('0x4f')]+'%'};return _0x2ceee3;}})});}_0x42a981=_[_0x10af('0x4b')]({},_0x42a981,_0x58149d['options']);var _0x12f42d={'where':_0x42a981[_0x10af('0x49')]};return db[_0x10af('0x3b')][_0x10af('0x50')](_0x12f42d)[_0x10af('0x21')](function(_0x35dcf0){_0x770513['count']=_0x35dcf0;if(_0x58149d[_0x10af('0x40')]['includeAll']){_0x42a981[_0x10af('0x51')]=[{'all':!![]}];}return db[_0x10af('0x3b')][_0x10af('0x52')](_0x42a981);})[_0x10af('0x21')](function(_0x31ee3d){_0x770513['rows']=_0x31ee3d;return _0x770513;})[_0x10af('0x21')](respondWithFilteredResult(_0x21fa78,_0x42a981))['catch'](handleError(_0x21fa78,null));};exports[_0x10af('0x53')]=function(_0x2b833c,_0xd7229a){var _0x5a1f72={'raw':![],'where':{'id':_0x2b833c['params']['id']},'include':[{'model':db[_0x10af('0x3a')],'as':_0x10af('0x54')}]},_0x57df6c={};_0x57df6c[_0x10af('0x3f')]=_[_0x10af('0x55')](db[_0x10af('0x3b')][_0x10af('0x3c')]);_0x57df6c[_0x10af('0x40')]=_['keys'](_0x2b833c[_0x10af('0x40')]);_0x57df6c['filters']=_[_0x10af('0x42')](_0x57df6c[_0x10af('0x3f')],_0x57df6c[_0x10af('0x40')]);_0x5a1f72[_0x10af('0x44')]=_['intersection'](_0x57df6c[_0x10af('0x3f')],qs[_0x10af('0x43')](_0x2b833c[_0x10af('0x40')][_0x10af('0x43')]));_0x5a1f72['attributes']=_0x5a1f72[_0x10af('0x44')]['length']?_0x5a1f72[_0x10af('0x44')]:_0x57df6c['model'];if(_0x2b833c[_0x10af('0x40')][_0x10af('0x56')]){_0x5a1f72[_0x10af('0x51')]=[{'all':!![]}];}_0x5a1f72=_[_0x10af('0x4b')]({},_0x5a1f72,_0x2b833c[_0x10af('0x57')]);return db[_0x10af('0x3b')][_0x10af('0x58')](_0x5a1f72)['then'](handleEntityNotFound(_0xd7229a,null))[_0x10af('0x21')](respondWithResult(_0xd7229a,null))[_0x10af('0x2b')](handleError(_0xd7229a,null));};exports[_0x10af('0x59')]=function(_0xfe9355,_0x1cac46){return db[_0x10af('0x3b')][_0x10af('0x59')](_0xfe9355[_0x10af('0x5a')],{})[_0x10af('0x21')](function(_0x3ff98c){var _0xf6508e=_0xfe9355[_0x10af('0x5b')][_0x10af('0x5c')]({'plain':!![]});if(!_0xf6508e)throw new Error(_0x10af('0x5d'));if(_0xf6508e[_0x10af('0x5e')]===_0x10af('0x5b')){var _0x320b67=_0x3ff98c[_0x10af('0x5c')]({'plain':!![]});var _0x51bde5=_0x10af('0x34');return db['UserProfileSection']['find']({'where':{'name':_0x51bde5,'userProfileId':_0xf6508e[_0x10af('0x5f')]},'raw':!![]})['then'](function(_0x5a6ef9){if(_0x5a6ef9&&_0x5a6ef9[_0x10af('0x60')]===0x0){return db['UserProfileResource'][_0x10af('0x59')]({'name':_0x320b67[_0x10af('0x38')],'resourceId':_0x320b67['id'],'type':_0x5a6ef9['name'],'sectionId':_0x5a6ef9['id']},{})[_0x10af('0x21')](function(){return _0x3ff98c;});}else{return _0x3ff98c;}})[_0x10af('0x2b')](function(_0x1857e1){logger[_0x10af('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1857e1);throw _0x1857e1;});}return _0x3ff98c;})[_0x10af('0x21')](respondWithResult(_0x1cac46,0xc9))['catch'](handleError(_0x1cac46,null));};exports[_0x10af('0x32')]=function(_0x55edff,_0x31a20a){if(_0x55edff[_0x10af('0x5a')]['id']){delete _0x55edff['body']['id'];}return db[_0x10af('0x3b')][_0x10af('0x58')]({'where':{'id':_0x55edff['params']['id']},'include':[{'model':db[_0x10af('0x3a')],'as':'mandatoryDispositionPause'}]})[_0x10af('0x21')](handleEntityNotFound(_0x31a20a,null))['then'](saveUpdates(_0x55edff[_0x10af('0x5a')],null))[_0x10af('0x21')](respondWithResult(_0x31a20a,null))[_0x10af('0x2b')](handleError(_0x31a20a,null));};exports['destroy']=function(_0x485578,_0x123934){return db[_0x10af('0x3b')][_0x10af('0x58')]({'where':{'id':_0x485578['params']['id']}})[_0x10af('0x21')](handleEntityNotFound(_0x123934,null))[_0x10af('0x21')](removeEntity(_0x123934,null))['catch'](handleError(_0x123934,null));};exports['describe']=function(_0x10d108,_0x4b23c0){return db['ChatWebsite'][_0x10af('0x61')]()['then'](respondWithResult(_0x4b23c0,null))[_0x10af('0x2b')](handleError(_0x4b23c0,null));};exports[_0x10af('0x62')]=function(_0x17e88b,_0x4de343,_0x46e29c){if(_0x17e88b[_0x10af('0x5a')]['id']){delete _0x17e88b[_0x10af('0x5a')]['id'];}return db[_0x10af('0x3b')]['find']({'where':{'id':_0x17e88b[_0x10af('0x63')]['id']}})[_0x10af('0x21')](handleEntityNotFound(_0x4de343,null))[_0x10af('0x21')](function(_0x44f35f){if(_0x44f35f){_0x17e88b[_0x10af('0x5a')][_0x10af('0x64')]=_0x44f35f['id'];return db['Disposition'][_0x10af('0x59')](_0x17e88b[_0x10af('0x5a')]);}})[_0x10af('0x21')](respondWithResult(_0x4de343,null))[_0x10af('0x2b')](handleError(_0x4de343,null));};exports[_0x10af('0x65')]=function(_0x4b10cb,_0x1b8d29,_0x3a9b21){var _0x31bc31={'raw':![],'where':{}};var _0x22cc06={};var _0x3e16d6={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x10af('0x66')]({'where':{'id':_0x4b10cb[_0x10af('0x63')]['id']}})[_0x10af('0x21')](handleEntityNotFound(_0x1b8d29,null))[_0x10af('0x21')](function(_0x9950aa){if(_0x9950aa){_0x22cc06['model']=_[_0x10af('0x55')](db[_0x10af('0x67')]['rawAttributes']);_0x22cc06['query']=_[_0x10af('0x55')](_0x4b10cb[_0x10af('0x40')]);_0x22cc06[_0x10af('0x41')]=_['intersection'](_0x22cc06[_0x10af('0x3f')],_0x22cc06[_0x10af('0x40')]);_0x31bc31[_0x10af('0x44')]=_['intersection'](_0x22cc06[_0x10af('0x3f')],qs[_0x10af('0x43')](_0x4b10cb[_0x10af('0x40')][_0x10af('0x43')]));_0x31bc31['attributes']=_0x31bc31[_0x10af('0x44')]['length']?_0x31bc31[_0x10af('0x44')]:_0x22cc06[_0x10af('0x3f')];if(!_0x4b10cb['query']['hasOwnProperty'](_0x10af('0x68'))){_0x31bc31[_0x10af('0x46')]=qs[_0x10af('0x46')](_0x4b10cb[_0x10af('0x40')][_0x10af('0x46')]);_0x31bc31[_0x10af('0x2f')]=qs['offset'](_0x4b10cb[_0x10af('0x40')][_0x10af('0x2f')]);}_0x31bc31[_0x10af('0x47')]=qs['sort'](_0x4b10cb['query']['sort']);_0x31bc31['where']=qs[_0x10af('0x41')](_['pick'](_0x4b10cb[_0x10af('0x40')],_0x22cc06[_0x10af('0x41')]));_0x31bc31[_0x10af('0x49')][_0x10af('0x64')]=_0x9950aa['id'];if(_0x4b10cb[_0x10af('0x40')]['filter']){_0x31bc31['where']=_[_0x10af('0x4b')](_0x31bc31[_0x10af('0x49')],{'$or':_['map'](_0x31bc31[_0x10af('0x44')],function(_0x2aa591){var _0x170395={};_0x170395[_0x2aa591]={'$like':'%'+_0x4b10cb[_0x10af('0x40')][_0x10af('0x4f')]+'%'};return _0x170395;})});}_0x31bc31=_[_0x10af('0x4b')]({},_0x31bc31,_0x4b10cb['options']);return db[_0x10af('0x67')][_0x10af('0x50')]({'where':_0x31bc31[_0x10af('0x49')]})[_0x10af('0x21')](function(_0x185058){_0x3e16d6['count']=_0x185058;if(_0x4b10cb['query'][_0x10af('0x56')]){_0x31bc31['include']=[{'all':!![]}];}return db[_0x10af('0x67')][_0x10af('0x52')](_0x31bc31);})[_0x10af('0x21')](function(_0x3eb825){_0x3e16d6[_0x10af('0x69')]=_0x3eb825;return _0x3e16d6;});}})[_0x10af('0x21')](respondWithFilteredResult(_0x1b8d29,_0x31bc31))[_0x10af('0x2b')](handleError(_0x1b8d29,null));};exports[_0x10af('0x6a')]=function(_0x70efa5,_0x42cf33,_0x55ba15){return db[_0x10af('0x3b')][_0x10af('0x58')]({'where':{'id':_0x70efa5[_0x10af('0x63')]['id']}})[_0x10af('0x21')](handleEntityNotFound(_0x42cf33,null))[_0x10af('0x21')](function(_0x1c58fc){if(_0x1c58fc){return _0x1c58fc[_0x10af('0x6a')](_0x70efa5[_0x10af('0x40')]['ids']);}})[_0x10af('0x21')](respondWithStatusCode(_0x42cf33,null))[_0x10af('0x2b')](handleError(_0x42cf33,null));};exports['addAnswer']=function(_0x23c130,_0x567880,_0x4755ae){if(_0x23c130['body']['id']){delete _0x23c130[_0x10af('0x5a')]['id'];}return db['ChatWebsite'][_0x10af('0x58')]({'where':{'id':_0x23c130[_0x10af('0x63')]['id']}})[_0x10af('0x21')](handleEntityNotFound(_0x567880,null))[_0x10af('0x21')](function(_0x268f91){if(_0x268f91){_0x23c130[_0x10af('0x5a')][_0x10af('0x64')]=_0x268f91['id'];return db[_0x10af('0x6b')]['create'](_0x23c130[_0x10af('0x5a')]);}})[_0x10af('0x21')](respondWithResult(_0x567880,null))[_0x10af('0x2b')](handleError(_0x567880,null));};exports['getAnswers']=function(_0x7fe297,_0x5ea544,_0x1f073c){var _0x52834f={'raw':![],'where':{}};var _0x540b3c={};var _0x45a8a1={'count':0x0,'rows':[]};return db[_0x10af('0x3b')][_0x10af('0x66')]({'where':{'id':_0x7fe297[_0x10af('0x63')]['id']}})[_0x10af('0x21')](handleEntityNotFound(_0x5ea544,null))[_0x10af('0x21')](function(_0x4fcede){if(_0x4fcede){_0x540b3c[_0x10af('0x3f')]=_[_0x10af('0x55')](db['CannedAnswer'][_0x10af('0x3c')]);_0x540b3c[_0x10af('0x40')]=_['keys'](_0x7fe297[_0x10af('0x40')]);_0x540b3c['filters']=_[_0x10af('0x42')](_0x540b3c[_0x10af('0x3f')],_0x540b3c[_0x10af('0x40')]);_0x52834f[_0x10af('0x44')]=_[_0x10af('0x42')](_0x540b3c[_0x10af('0x3f')],qs['fields'](_0x7fe297['query']['fields']));_0x52834f[_0x10af('0x44')]=_0x52834f[_0x10af('0x44')]['length']?_0x52834f[_0x10af('0x44')]:_0x540b3c[_0x10af('0x3f')];if(!_0x7fe297[_0x10af('0x40')][_0x10af('0x6c')](_0x10af('0x68'))){_0x52834f[_0x10af('0x46')]=qs[_0x10af('0x46')](_0x7fe297[_0x10af('0x40')][_0x10af('0x46')]);_0x52834f[_0x10af('0x2f')]=qs['offset'](_0x7fe297[_0x10af('0x40')][_0x10af('0x2f')]);}_0x52834f['order']=qs[_0x10af('0x48')](_0x7fe297[_0x10af('0x40')]['sort']);_0x52834f[_0x10af('0x49')]=qs[_0x10af('0x41')](_['pick'](_0x7fe297[_0x10af('0x40')],_0x540b3c[_0x10af('0x41')]));_0x52834f[_0x10af('0x49')][_0x10af('0x64')]=_0x4fcede['id'];if(_0x7fe297[_0x10af('0x40')][_0x10af('0x4f')]){_0x52834f[_0x10af('0x49')]=_[_0x10af('0x4b')](_0x52834f[_0x10af('0x49')],{'$or':_[_0x10af('0x4c')](_0x52834f[_0x10af('0x44')],function(_0x59344e){var _0x4e76ce={};_0x4e76ce[_0x59344e]={'$like':'%'+_0x7fe297['query'][_0x10af('0x4f')]+'%'};return _0x4e76ce;})});}_0x52834f=_[_0x10af('0x4b')]({},_0x52834f,_0x7fe297[_0x10af('0x57')]);return db[_0x10af('0x6b')][_0x10af('0x50')]({'where':_0x52834f['where']})['then'](function(_0x4ef8f1){_0x45a8a1[_0x10af('0x50')]=_0x4ef8f1;if(_0x7fe297[_0x10af('0x40')][_0x10af('0x56')]){_0x52834f[_0x10af('0x51')]=[{'all':!![]}];}return db[_0x10af('0x6b')]['findAll'](_0x52834f);})[_0x10af('0x21')](function(_0x1e31c7){_0x45a8a1[_0x10af('0x69')]=_0x1e31c7;return _0x45a8a1;});}})[_0x10af('0x21')](respondWithFilteredResult(_0x5ea544,_0x52834f))[_0x10af('0x2b')](handleError(_0x5ea544,null));};exports[_0x10af('0x6d')]=function(_0x3f7ebf,_0x1ad4d3,_0x1c655d){return db[_0x10af('0x3b')]['find']({'where':{'id':_0x3f7ebf[_0x10af('0x63')]['id']}})[_0x10af('0x21')](handleEntityNotFound(_0x1ad4d3,null))['then'](function(_0x519c86){if(_0x519c86){return _0x519c86[_0x10af('0x6d')](_0x3f7ebf[_0x10af('0x40')][_0x10af('0x6e')]);}})[_0x10af('0x21')](respondWithStatusCode(_0x1ad4d3,null))[_0x10af('0x2b')](handleError(_0x1ad4d3,null));};exports[_0x10af('0x6f')]=function(_0x191168,_0x160463,_0x428ce6){_0x191168[_0x10af('0x5a')][_0x10af('0x70')]=_0x191168[_0x10af('0x71')][_0x10af('0x72')];return db[_0x10af('0x3b')][_0x10af('0x58')]({'where':{'id':_0x191168[_0x10af('0x63')]['id']}})[_0x10af('0x21')](handleEntityNotFound(_0x160463,null))[_0x10af('0x21')](saveUpdates(_0x191168[_0x10af('0x5a')],null))['then'](respondWithResult(_0x160463,null))[_0x10af('0x2b')](handleError(_0x160463,null));};exports[_0x10af('0x73')]=function(_0x115136,_0x55a11a,_0x34b8ea){_0x115136['body'][_0x10af('0x74')]=_0x115136['file'][_0x10af('0x72')];return db[_0x10af('0x3b')][_0x10af('0x58')]({'where':{'id':_0x115136[_0x10af('0x63')]['id']}})[_0x10af('0x21')](handleEntityNotFound(_0x55a11a,null))[_0x10af('0x21')](saveUpdates(_0x115136[_0x10af('0x5a')],null))[_0x10af('0x21')](respondWithResult(_0x55a11a,null))['catch'](handleError(_0x55a11a,null));};exports[_0x10af('0x75')]=function(_0x545bb9,_0x44cd08,_0x12fb36){_0x545bb9['body'][_0x10af('0x76')]=_0x545bb9[_0x10af('0x71')][_0x10af('0x72')];return db[_0x10af('0x3b')][_0x10af('0x58')]({'where':{'id':_0x545bb9[_0x10af('0x63')]['id']}})[_0x10af('0x21')](handleEntityNotFound(_0x44cd08,null))[_0x10af('0x21')](saveUpdates(_0x545bb9[_0x10af('0x5a')],null))[_0x10af('0x21')](respondWithResult(_0x44cd08,null))[_0x10af('0x2b')](handleError(_0x44cd08,null));};exports[_0x10af('0x77')]=function(_0x24d7ba,_0x7faaf8,_0x262277){_0x24d7ba[_0x10af('0x5a')][_0x10af('0x78')]=_0x24d7ba[_0x10af('0x71')][_0x10af('0x72')];return db[_0x10af('0x3b')][_0x10af('0x58')]({'where':{'id':_0x24d7ba[_0x10af('0x63')]['id']}})[_0x10af('0x21')](handleEntityNotFound(_0x7faaf8,null))[_0x10af('0x21')](saveUpdates(_0x24d7ba[_0x10af('0x5a')],null))[_0x10af('0x21')](respondWithResult(_0x7faaf8,null))['catch'](handleError(_0x7faaf8,null));};exports[_0x10af('0x79')]=function(_0x12172f,_0xd3c6e7,_0x3b317b){var _0x50459c=path['join'](config[_0x10af('0x7a')],_0x10af('0x7b'));var _0x465bc5={'where':{'id':_0x12172f[_0x10af('0x63')]['id']},'attributes':['id',_0x10af('0x70')],'raw':!![]};var _0x1d85f5=![];return require(_0x10af('0x7c'))[_0x10af('0x7d')]()[_0x10af('0x21')](function(_0x4e1a93){if(_0x4e1a93){_0x1d85f5=_0x4e1a93[_0x10af('0x7e')];}})[_0x10af('0x21')](function(){return db[_0x10af('0x3b')][_0x10af('0x58')](_0x465bc5);})[_0x10af('0x21')](handleEntityNotFound(_0xd3c6e7,null))[_0x10af('0x21')](function(_0x3dc75e){if(_0x3dc75e){if(!_[_0x10af('0x7f')](_0x3dc75e['sitepic'])){if(fs['existsSync'](path['join'](config[_0x10af('0x7a')],_0x10af('0x80'),_0x3dc75e[_0x10af('0x70')]))&&_0x1d85f5){_0x50459c=path[_0x10af('0x81')](config['root'],_0x10af('0x80'),_0x3dc75e['sitepic']);}}return _0xd3c6e7['download'](_0x50459c);}})[_0x10af('0x2b')](handleError(_0xd3c6e7,null));};exports[_0x10af('0x82')]=function(_0x54598a,_0x20efc7,_0x15986f){var _0x53b0b1=path['join'](config['root'],_0x10af('0x83'));var _0x95ffdd={'where':{'id':_0x54598a[_0x10af('0x63')]['id']},'attributes':['id',_0x10af('0x74')],'raw':!![]};return db[_0x10af('0x3b')]['find'](_0x95ffdd)[_0x10af('0x21')](handleEntityNotFound(_0x20efc7,null))['then'](function(_0x4a9c6d){if(_0x4a9c6d){if(!_[_0x10af('0x7f')](_0x4a9c6d[_0x10af('0x74')])){if(fs[_0x10af('0x84')](path[_0x10af('0x81')](config[_0x10af('0x7a')],_0x10af('0x85'),_0x4a9c6d[_0x10af('0x74')]))){_0x53b0b1=path['join'](config[_0x10af('0x7a')],_0x10af('0x85'),_0x4a9c6d['agentAvatar']);}}return _0x20efc7[_0x10af('0x86')](_0x53b0b1);}})[_0x10af('0x2b')](handleError(_0x20efc7,null));};exports[_0x10af('0x87')]=function(_0x56eb4d,_0x5cfbc1,_0x387a32){var _0x100eba=path[_0x10af('0x81')](config[_0x10af('0x7a')],_0x10af('0x88'));var _0x2cdca6={'where':{'id':_0x56eb4d[_0x10af('0x63')]['id']},'attributes':['id','customerAvatar',_0x10af('0x89')],'raw':!![]};return db[_0x10af('0x3b')]['find'](_0x2cdca6)[_0x10af('0x21')](handleEntityNotFound(_0x5cfbc1,null))[_0x10af('0x21')](function(_0x3e6f2f){if(_0x3e6f2f){if(!_[_0x10af('0x7f')](_0x3e6f2f['customerAvatar'])){if(fs['existsSync'](path[_0x10af('0x81')](config[_0x10af('0x7a')],_0x10af('0x85'),_0x3e6f2f[_0x10af('0x76')]))&&_0x3e6f2f[_0x10af('0x89')]){_0x100eba=path[_0x10af('0x81')](config[_0x10af('0x7a')],_0x10af('0x85'),_0x3e6f2f[_0x10af('0x76')]);}}return _0x5cfbc1[_0x10af('0x86')](_0x100eba);}})[_0x10af('0x2b')](handleError(_0x5cfbc1,null));};exports[_0x10af('0x8a')]=function(_0x5ed0ac,_0x32516a,_0x1e6408){var _0x38bf56=path[_0x10af('0x81')](config[_0x10af('0x7a')],_0x10af('0x8b'));var _0x3b71fa={'where':{'id':_0x5ed0ac[_0x10af('0x63')]['id']},'attributes':['id',_0x10af('0x78')],'raw':!![]};return db['ChatWebsite'][_0x10af('0x58')](_0x3b71fa)[_0x10af('0x21')](handleEntityNotFound(_0x32516a,null))[_0x10af('0x21')](function(_0x498543){if(_0x498543){if(!_[_0x10af('0x7f')](_0x498543[_0x10af('0x78')])){if(fs[_0x10af('0x84')](path[_0x10af('0x81')](config[_0x10af('0x7a')],'server/files/images/avatars/',_0x498543[_0x10af('0x78')]))){_0x38bf56=path['join'](config['root'],_0x10af('0x85'),_0x498543[_0x10af('0x78')]);}}return _0x32516a[_0x10af('0x86')](_0x38bf56);}})[_0x10af('0x2b')](handleError(_0x32516a,null));};exports[_0x10af('0x8c')]=function(_0x531c92,_0x38b6d3,_0x25da18){var _0x2fe004=require(_0x10af('0x8d'));var _0xf67959=new _0x2fe004();var _0x2643fa=_0xf67959['setUA'](_0x531c92['headers']['user-agent'])['getResult']();var _0x31ff6d={'body':_0x531c92['body'],'channel':_0x10af('0x8e')};var _0x20f7dc=[];var _0x3a86e4=[];var _0x20dedf={};var _0xa3e40d=![];return db[_0x10af('0x8f')][_0x10af('0x61')]()[_0x10af('0x21')](function(_0xae2db9){if(!_0xae2db9){throw new db[(_0x10af('0x1d'))][(_0x10af('0x1e'))](_0x10af('0x90'));}_0x20f7dc=_[_0x10af('0x91')](_[_0x10af('0x55')](_0xae2db9),[_0x10af('0x92'),_0x10af('0x93')]);_0x3a86e4=_[_0x10af('0x91')](_['keys'](_0xae2db9),[_0x10af('0x92'),_0x10af('0x93'),_0x10af('0x94'),_0x10af('0x95')]);if(_0x531c92[_0x10af('0x5a')]['id']){delete _0x531c92[_0x10af('0x5a')]['id'];}if(_[_0x10af('0x7f')](_0x531c92[_0x10af('0x5a')]['from'])){throw new db[(_0x10af('0x1d'))]['ValidationError'](_0x10af('0x96'));}if(_['isNil'](_0x531c92[_0x10af('0x5a')][_0x10af('0x5a')])||_0x531c92[_0x10af('0x5a')][_0x10af('0x5a')]===''){throw new db[(_0x10af('0x1d'))][(_0x10af('0x1e'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x10af('0x7f')](_0x531c92[_0x10af('0x5a')][_0x10af('0x97')])){throw new db[(_0x10af('0x1d'))][(_0x10af('0x1e'))](_0x10af('0x98')+_0x3a86e4);}if(!_[_0x10af('0x99')](_0x3a86e4,_0x531c92['body'][_0x10af('0x97')])){throw new db[(_0x10af('0x1d'))][(_0x10af('0x1e'))](_0x10af('0x9a')+_0x3a86e4);}_0x20dedf[_0x531c92[_0x10af('0x5a')][_0x10af('0x97')]]=_0x531c92[_0x10af('0x5a')][_0x10af('0x9b')];})[_0x10af('0x21')](function(){return db[_0x10af('0x3b')]['find']({'where':{'id':_0x531c92[_0x10af('0x63')]['id']},'include':[{'model':db[_0x10af('0x9c')],'as':'List','include':[{'model':db['CmContact'],'as':_0x10af('0x9d'),'where':_0x20dedf,'limit':0x1,'order':[[_0x10af('0x93'),_0x10af('0x9e')]]}]},{'model':db['ChatApplication'],'as':_0x10af('0x9f')}]});})[_0x10af('0x21')](handleEntityNotFound(_0x38b6d3,null))[_0x10af('0x21')](function(_0x4a82e8){if(_0x4a82e8&&_0x4a82e8[_0x10af('0xa0')]){_0x31ff6d[_0x10af('0xa1')]=_0x4a82e8;_0x31ff6d[_0x10af('0xa2')]=_0x4a82e8[_0x10af('0x9f')];_0x31ff6d[_0x10af('0xa3')]=_0x4a82e8[_0x10af('0xa0')];_0x31ff6d[_0x10af('0xa2')]=_[_0x10af('0xa4')](_0x31ff6d[_0x10af('0xa2')],[_0x10af('0xa5')],[_0x10af('0xa6')]);if(_0x31ff6d[_0x10af('0xa1')][_0x10af('0x9f')]){delete _0x31ff6d[_0x10af('0xa1')]['Applications'];}if(_0x31ff6d['account'][_0x10af('0xa0')]&&_0x31ff6d[_0x10af('0xa1')][_0x10af('0xa0')][_0x10af('0x9d')][_0x10af('0x45')]){return _0x31ff6d[_0x10af('0xa1')][_0x10af('0xa0')][_0x10af('0x9d')][0x0];}var _0x1a124e=_[_0x10af('0x17')](_0x531c92['body'],{'firstName':_0x531c92[_0x10af('0x5a')][_0x10af('0x9b')],'ListId':_0x4a82e8[_0x10af('0x95')]});_0x1a124e[_0x531c92[_0x10af('0x5a')]['mapKey']]=_0x531c92[_0x10af('0x5a')][_0x10af('0x9b')];return db[_0x10af('0x8f')][_0x10af('0x59')](_0x1a124e,{'fields':_0x20f7dc,'raw':!![]});}})[_0x10af('0x21')](handleEntityNotFound(_0x38b6d3,null))[_0x10af('0x21')](function(_0x4e100e){_0x31ff6d[_0x10af('0xa7')]=_0x4e100e;var _0xe5271a=_0x531c92[_0x10af('0x5a')][_0x10af('0xa8')];if(_0x531c92[_0x10af('0xa9')][_0x10af('0xaa')]){_0xe5271a=_0x531c92[_0x10af('0xa9')][_0x10af('0xaa')];}else if(_0x531c92[_0x10af('0xa9')][_0x10af('0xab')]){_0xe5271a=_[_0x10af('0xac')](_0x531c92[_0x10af('0xa9')][_0x10af('0xab')]['split'](','));}if(_0x4e100e){var _0x3f80c={'ContactId':_0x4e100e['id'],'ChatWebsiteId':_0x531c92[_0x10af('0x63')]['id'],'from':(_0x4e100e[_0x10af('0xad')]||'')+'\x20'+(_0x4e100e[_0x10af('0xae')]||''),'customerIp':_0xe5271a,'customerPort':_0x531c92[_0x10af('0xa9')][_0x10af('0xaf')]?_0x531c92[_0x10af('0xa9')]['x-real-port']:null,'referer':_0x531c92[_0x10af('0x5a')][_0x10af('0xb0')],'browserName':_0x2643fa[_0x10af('0xb1')][_0x10af('0x38')]&&_0x2643fa[_0x10af('0xb1')][_0x10af('0xb2')]?util[_0x10af('0xb3')]('%s\x20%s',_0x2643fa['browser'][_0x10af('0x38')],_0x2643fa[_0x10af('0xb1')]['version']):_0x10af('0xb4'),'browserVersion':_0x2643fa[_0x10af('0xb1')][_0x10af('0xb2')]||_0x10af('0xb4'),'osName':util[_0x10af('0xb3')](_0x10af('0xb5'),_0x2643fa['os']['name'],_0x2643fa['os'][_0x10af('0xb2')]),'osVersion':_0x2643fa['os']['version'],'deviceModel':_0x2643fa[_0x10af('0xb6')][_0x10af('0x3f')]&&_0x2643fa['device'][_0x10af('0xb7')]?util[_0x10af('0xb3')](_0x10af('0xb8'),_0x2643fa[_0x10af('0xb6')][_0x10af('0x3f')],_0x2643fa[_0x10af('0xb6')][_0x10af('0xb7')],_0x2643fa['device'][_0x10af('0x4d')]):null,'deviceVendor':_0x2643fa['device'][_0x10af('0xb7')],'deviceType':_0x2643fa['device']['type'],'formData':JSON[_0x10af('0x27')](_0x531c92[_0x10af('0x5a')])};var _0x2a6416={'ChatWebsiteId':_0x531c92[_0x10af('0x63')]['id'],'closed':![]};if(_0x531c92[_0x10af('0x5a')][_0x10af('0xb9')]){_0x2a6416['threadId']=_0x531c92[_0x10af('0x5a')][_0x10af('0xb9')];return db[_0x10af('0xba')][_0x10af('0x58')]({'where':_0x2a6416})[_0x10af('0x21')](function(_0x143faa){if(_0x143faa){return[_0x143faa,![]];}_0x3f80c['threadId']=_0x531c92['body'][_0x10af('0xb9')];_0x3f80c[_0x10af('0xbb')]=_0x531c92[_0x10af('0x5a')][_0x10af('0xbb')];return db[_0x10af('0xba')]['create'](_0x3f80c)['then'](function(_0x607eb6){return[_0x607eb6,!![]];});});}_0x2a6416[_0x10af('0xbc')]=_0x4e100e['id'];if(_0x531c92[_0x10af('0x5a')][_0x10af('0xbd')]&&_0x531c92[_0x10af('0x5a')][_0x10af('0xbd')]['id']){_0x2a6416['id']=_0x531c92['body'][_0x10af('0xbd')]['id'];return db[_0x10af('0xba')][_0x10af('0x58')]({'where':_0x2a6416})[_0x10af('0x21')](function(_0x4f00bd){if(_0x4f00bd){return[_0x4f00bd,![]];}return db[_0x10af('0xba')][_0x10af('0x59')](_0x3f80c)[_0x10af('0x21')](function(_0x4cbbf3){return[_0x4cbbf3,!![]];});});}return db[_0x10af('0xba')]['create'](_0x3f80c)[_0x10af('0x21')](function(_0x2c7cdc){return[_0x2c7cdc,!![]];});}})['spread'](function(_0x447ffc,_0x1b46cf){if(_0x447ffc){_0xa3e40d=_0x1b46cf;if(!_0x1b46cf){var _0x32bf80={'from':(_0x31ff6d[_0x10af('0xa7')][_0x10af('0xad')]||'')+'\x20'+(_0x31ff6d[_0x10af('0xa7')][_0x10af('0xae')]||'')};if(_0x531c92['body']['threadId']&&_0x531c92['body'][_0x10af('0xbe')]&&_0x531c92[_0x10af('0x5a')][_0x10af('0xb9')]!=_0x531c92[_0x10af('0x5a')]['messageId']){_0x32bf80[_0x10af('0xb9')]=_0x531c92[_0x10af('0x5a')]['messageId'];}return _0x447ffc[_0x10af('0x32')](_0x32bf80);}else{return _0x447ffc;}}})[_0x10af('0x21')](function(_0xb06fe0){_0x31ff6d[_0x10af('0xbd')]=_0xb06fe0[_0x10af('0x5c')]({'plain':!![]});_0x31ff6d[_0x10af('0xbd')][_0x10af('0xbf')]=_0xa3e40d;if(_0x31ff6d[_0x10af('0xbd')][_0x10af('0xbf')]){if(_0x31ff6d['account'][_0x10af('0xc0')]){_0x31ff6d['applications'][_0x10af('0xc1')]({'id':0x0,'priority':_0x31ff6d[_0x10af('0xa2')][_0x10af('0x45')]+0x1,'app':_0x10af('0xc2'),'appdata':_0x10af('0xc3'),'interval':_0x10af('0xc4')});}}return db['ChatMessage'][_0x10af('0x59')]({'body':_0x531c92[_0x10af('0x5a')]['body'],'ChatWebsiteId':_0x531c92[_0x10af('0x63')]['id'],'ChatInteractionId':_0xb06fe0['id'],'direction':'in','ContactId':_0x31ff6d[_0x10af('0xa7')]['id'],'AttachmentId':_0x531c92[_0x10af('0x5a')]['AttachmentId']});})[_0x10af('0x21')](function(_0x4c44d1){_0x31ff6d[_0x10af('0x29')]=_0x4c44d1;if(_0x31ff6d['interaction'][_0x10af('0xc5')]){return db[_0x10af('0xc6')][_0x10af('0x58')]({'attributes':['id',_0x10af('0x38')],'where':{'id':_0x31ff6d[_0x10af('0xbd')]['UserId']}})['then'](function(_0x1bb99a){if(_0x1bb99a){_0x31ff6d[_0x10af('0xa2')]['unshift']({'id':0x0,'priority':0x0,'app':_0x10af('0xc7'),'appdata':_0x1bb99a[_0x10af('0x38')]+','+(_0x31ff6d[_0x10af('0xa1')][_0x10af('0xc8')]||0xa),'interval':'*,*,*,*'});_0x31ff6d[_0x10af('0xc9')]=!![];}return respondWithRpcPromise(_0x10af('0xca'),_0x10af('0xcb'),_0x31ff6d);});}return respondWithRpcPromise(_0x10af('0xca'),_0x10af('0xcb'),_0x31ff6d);})['then'](function(_0x129be3){respondWithRpcPromise(_0x10af('0xcc'),_0x10af('0xcc'),{'event':_0x10af('0x8c'),'message':_0x129be3},client9002);return _0x129be3;})[_0x10af('0x21')](respondWithResult(_0x38b6d3,null))[_0x10af('0x2b')](handleError(_0x38b6d3,null));};exports[_0x10af('0xcd')]=function(_0x30827e,_0x912063,_0x39b933){var _0x40175c,_0x3523d2,_0xc72d5;var _0x3035e9=[];var _0x180124=[];var _0x869dfa={};return db[_0x10af('0x8f')]['describe']()['then'](function(_0x35b936){if(!_0x35b936){throw new db[(_0x10af('0x1d'))][(_0x10af('0x1e'))]('no\x20available\x20attributes');}_0x180124=_['difference'](_[_0x10af('0x55')](_0x35b936),[_0x10af('0x92'),'updatedAt']);_0x3035e9=_[_0x10af('0x91')](_[_0x10af('0x55')](_0x35b936),[_0x10af('0x92'),_0x10af('0x93'),_0x10af('0x94'),_0x10af('0x95')]);if(_0x30827e[_0x10af('0x5a')]['id']){delete _0x30827e[_0x10af('0x5a')]['id'];}if(_[_0x10af('0x7f')](_0x30827e[_0x10af('0x5a')][_0x10af('0x9b')])){throw _0x912063[_0x10af('0x2d')](0x1f4)[_0x10af('0x39')](new db[(_0x10af('0x1d'))][(_0x10af('0x1e'))]('from\x20is\x20mandatory'));}if(_['isNil'](_0x30827e[_0x10af('0x5a')][_0x10af('0x5a')])||_0x30827e['body'][_0x10af('0x5a')]===''){throw _0x912063['status'](0x1f4)[_0x10af('0x39')](new db[(_0x10af('0x1d'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x10af('0x7f')](_0x30827e[_0x10af('0x5a')][_0x10af('0xce')])){throw _0x912063['status'](0x1f4)[_0x10af('0x39')](new db[(_0x10af('0x1d'))][(_0x10af('0x1e'))](_0x10af('0xcf')+_0x3035e9));}if(!_[_0x10af('0x99')](_0x3035e9,_0x30827e[_0x10af('0x5a')][_0x10af('0xce')])){throw _0x912063[_0x10af('0x2d')](0x1f4)[_0x10af('0x39')](new db['Sequelize'][(_0x10af('0x1e'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3035e9));}_0x869dfa[_0x30827e[_0x10af('0x5a')][_0x10af('0xce')]]=_0x30827e[_0x10af('0x5a')][_0x10af('0x9b')];})[_0x10af('0x21')](function(){return db[_0x10af('0x3b')][_0x10af('0x58')]({'where':{'id':_0x30827e[_0x10af('0x63')]['id']},'include':[{'model':db['CmList'],'as':_0x10af('0xa0')}]});})[_0x10af('0x21')](handleEntityNotFound(_0x912063,null))[_0x10af('0x21')](function(_0x467a9f){if(_0x467a9f&&_0x467a9f['List']){_0x3523d2=_0x467a9f;var _0x4f7dbf=_[_0x10af('0x17')](_0x30827e[_0x10af('0x5a')],{'firstName':_0x30827e['body']['from'],'phone':_0x30827e[_0x10af('0x5a')][_0x10af('0x9b')],'ListId':_0x467a9f['ListId']});_0x4f7dbf[_0x30827e['body'][_0x10af('0xce')]]=_0x30827e[_0x10af('0x5a')][_0x10af('0x9b')];return db[_0x10af('0x8f')][_0x10af('0xd0')]({'where':_0x869dfa,'defaults':_0x4f7dbf});}})['spread'](function(_0x253faa){if(_0x253faa){_0xc72d5=_0x253faa;var _0x4a30fd=fs['readFileSync'](path['join'](config['root'],_0x10af('0xd1')),_0x10af('0xd2'));var _0x2fb912=ejs[_0x10af('0xd3')](_0x4a30fd,{'body':_[_0x10af('0xd4')](_0x30827e[_0x10af('0x5a')][_0x10af('0x5a')]),'bodyTitle':_0x3523d2[_0x10af('0xd5')]});return db[_0x10af('0xd6')][_0x10af('0x59')]({'body':_0x2fb912,'ContactId':_0x253faa['id'],'ChatWebsiteId':_0x3523d2['id']});}})[_0x10af('0x21')](function(_0xf1ee1d){if(_0xf1ee1d){_0x40175c=_0xf1ee1d;return db[_0x10af('0xd7')][_0x10af('0x66')]({'where':{'service':!![]},'include':[{'model':db[_0x10af('0xd8')],'as':'Smtp','raw':!![]}]});}})[_0x10af('0x21')](function(_0x2db29c){if(_0x2db29c&&_0x2db29c[_0x10af('0xd9')]&&_0x3523d2[_0x10af('0xda')]){var _0x84a04a={'tls':{'rejectUnauthorized':![]}};if(_0x2db29c['Smtp']['service']){_0x84a04a[_0x10af('0xdb')]=_0x2db29c['Smtp'][_0x10af('0xdb')];}else{_0x84a04a[_0x10af('0xdc')]=_0x2db29c[_0x10af('0xd9')][_0x10af('0xdc')];_0x84a04a[_0x10af('0xdd')]=_0x2db29c[_0x10af('0xd9')][_0x10af('0xdd')];_0x84a04a['secure']=_0x2db29c[_0x10af('0xd9')]['secure'];}if(_0x2db29c[_0x10af('0xd9')]['authentication']){_0x84a04a[_0x10af('0xde')]={'user':_0x2db29c[_0x10af('0xd9')][_0x10af('0x5b')],'pass':_0x2db29c['Smtp']['pass']};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x84a04a,'message':{'from':util[_0x10af('0xb3')](_0x10af('0xdf'),_0x2db29c[_0x10af('0x38')],_0x2db29c[_0x10af('0xe0')]||_0x2db29c['Smtp'][_0x10af('0x5b')]),'to':_0x3523d2['forwardOfflineAddress'],'subject':_0x3523d2[_0x10af('0xe1')],'text':_0x40175c['body']}},client9003)[_0x10af('0x21')](function(){return _0x40175c;})[_0x10af('0x2b')](function(_0x4eca2c){console[_0x10af('0x28')](_0x4eca2c);});}})[_0x10af('0x21')](function(){if(_0x40175c){return _0x40175c;}})[_0x10af('0x21')](respondWithResult(_0x912063,null))[_0x10af('0x2b')](handleError(_0x912063,null));};exports['addInteraction']=function(_0x1c6fb2,_0x520807,_0x2b2bbf){return db[_0x10af('0xba')][_0x10af('0x58')]({'where':{'id':_0x1c6fb2[_0x10af('0x63')]['id']}})[_0x10af('0x21')](handleEntityNotFound(_0x520807,null))[_0x10af('0x21')](function(_0x3bf194){if(_0x3bf194){return _0x3bf194[_0x10af('0xe2')](_0x1c6fb2[_0x10af('0x5a')]['ids'],_[_0x10af('0xe3')](_0x1c6fb2[_0x10af('0x5a')],[_0x10af('0x6e'),'id'])||{});}})['then'](respondWithResult(_0x520807,null))[_0x10af('0x2b')](handleError(_0x520807,null));};exports[_0x10af('0xe4')]=function(_0x1e3e85,_0x86387b,_0x626c0f){var _0x17503d={'raw':![],'where':{}};var _0x23730b={};var _0x5c0ed8={'count':0x0,'rows':[]};return db[_0x10af('0x3b')]['findOne']({'where':{'id':_0x1e3e85[_0x10af('0x63')]['id']}})[_0x10af('0x21')](handleEntityNotFound(_0x86387b,null))[_0x10af('0x21')](function(_0xc87504){if(_0xc87504){_0x23730b[_0x10af('0x3f')]=_[_0x10af('0x55')](db['ChatInteraction'][_0x10af('0x3c')]);_0x23730b['query']=_['keys'](_0x1e3e85[_0x10af('0x40')]);_0x23730b[_0x10af('0x41')]=_['intersection'](_0x23730b[_0x10af('0x3f')],_0x23730b['query']);_0x17503d[_0x10af('0x44')]=_['intersection'](_0x23730b['model'],qs['fields'](_0x1e3e85[_0x10af('0x40')]['fields']));_0x17503d[_0x10af('0x44')]=_0x17503d[_0x10af('0x44')][_0x10af('0x45')]?_0x17503d['attributes']:_0x23730b[_0x10af('0x3f')];if(!_0x1e3e85[_0x10af('0x40')][_0x10af('0x6c')](_0x10af('0x68'))){_0x17503d[_0x10af('0x46')]=qs['limit'](_0x1e3e85[_0x10af('0x40')][_0x10af('0x46')]);_0x17503d['offset']=qs[_0x10af('0x2f')](_0x1e3e85[_0x10af('0x40')][_0x10af('0x2f')]);}_0x17503d[_0x10af('0x47')]=qs[_0x10af('0x48')](_0x1e3e85['query'][_0x10af('0x48')]);_0x17503d[_0x10af('0x49')]=qs[_0x10af('0x41')](_[_0x10af('0x4a')](_0x1e3e85[_0x10af('0x40')],_0x23730b[_0x10af('0x41')]));_0x17503d['where'][_0x10af('0x64')]=_0xc87504['id'];if(_0x1e3e85[_0x10af('0x40')][_0x10af('0x4f')]){_0x17503d[_0x10af('0x49')]=_[_0x10af('0x4b')](_0x17503d[_0x10af('0x49')],{'$or':_['map'](_0x17503d['attributes'],function(_0x574890){var _0x2f8f14={};_0x2f8f14[_0x574890]={'$like':'%'+_0x1e3e85['query'][_0x10af('0x4f')]+'%'};return _0x2f8f14;})});}_0x17503d=_['merge']({},_0x17503d,_0x1e3e85['options']);return db[_0x10af('0xba')][_0x10af('0x50')]({'where':_0x17503d[_0x10af('0x49')]})[_0x10af('0x21')](function(_0x42995b){_0x5c0ed8[_0x10af('0x50')]=_0x42995b;if(_0x1e3e85[_0x10af('0x40')][_0x10af('0x56')]){_0x17503d[_0x10af('0x51')]=[{'model':db[_0x10af('0x8f')],'as':_0x10af('0xe5'),'required':![]},{'model':db[_0x10af('0xc6')],'as':'Owner','attributes':[_0x10af('0x38'),_0x10af('0xe6'),_0x10af('0xe7')],'required':![]},{'model':db[_0x10af('0xe8')],'as':_0x10af('0xe9'),'attributes':['id',_0x10af('0x38'),_0x10af('0xea')],'where':_0x1e3e85[_0x10af('0x40')][_0x10af('0xeb')]?{'id':_0x1e3e85[_0x10af('0x40')][_0x10af('0xeb')]}:undefined,'required':_0x1e3e85['query'][_0x10af('0xeb')]?!![]:![]}];}return db[_0x10af('0xba')][_0x10af('0x52')](_0x17503d);})[_0x10af('0x21')](function(_0x203e1b){_0x5c0ed8[_0x10af('0x69')]=_0x203e1b;return _0x5c0ed8;});}})[_0x10af('0x21')](respondWithFilteredResult(_0x86387b,_0x17503d))[_0x10af('0x2b')](handleError(_0x86387b,null));};function iftimePromise(_0xae1b6a,_0x57b00f){return respondWithRpcPromise('Command',_0x10af('0xec'),{'command':_0x57b00f[_0x10af('0xed')]?util[_0x10af('0xb3')](_0x10af('0xee'),_0xae1b6a['interval'],_0x57b00f[_0x10af('0xed')]):util['format'](_0x10af('0xef'),_0xae1b6a[_0x10af('0xf0')])},client9002)[_0x10af('0x21')](function(_0xc4fd5c){var _0x3a19c4=_0xc4fd5c&&_0xc4fd5c['indexOf'](_0x10af('0xf1'))>=0x0?!![]:![];logger[_0x10af('0x22')](_0x10af('0xf2'),_0x57b00f['id'],_0xae1b6a['id'],_0xae1b6a[_0x10af('0xf0')],_0x3a19c4?_0x10af('0xf3'):_0x10af('0xf4'),_0x57b00f[_0x10af('0xed')]?_0x57b00f[_0x10af('0xed')]:_0x10af('0xf5'));return _0x3a19c4;})['catch'](function(_0x2060fd){logger['error'](_0x10af('0xf2'),_0x57b00f['id'],_0xae1b6a['id'],_0xae1b6a[_0x10af('0xf0')],util['inspect'](_0x2060fd,{'showHidden':![],'depth':null}),_0x57b00f['timezone']?_0x57b00f[_0x10af('0xed')]:_0x10af('0xf5'));return![];});}exports[_0x10af('0xec')]=function(_0x2bfbf5,_0x108e45,_0x4b82b3){var _0x4f0de1=0x0;var _0x2e1478=0x0;var _0x5ef305=![];var _0x2f56ab;var _0x3d5267;return db['ChatWebsite'][_0x10af('0x58')]({'where':{'id':_0x2bfbf5[_0x10af('0x63')]['id']},'include':[{'model':db['Interval'],'as':_0x10af('0xf6'),'include':[{'model':db[_0x10af('0xf6')],'as':_0x10af('0xf7'),'attributes':['id','interval'],'raw':!![]}]}]})[_0x10af('0x21')](handleEntityNotFound(_0x108e45,null))['then'](function(_0x39265c){if(_0x39265c){_0x2f56ab=_0x39265c;return _0x39265c[_0x10af('0xf8')]({'raw':!![]});}})[_0x10af('0x21')](function(_0x1e565e){if(_0x2f56ab){if(_0x1e565e){_0x3d5267=_0x1e565e;}}return require('../../config/license/util')[_0x10af('0x7d')]();})[_0x10af('0x21')](function(_0x761be7){if(_0x761be7){_0x2e1478=_0x761be7[_0x10af('0xf9')];_0x5ef305=_0x761be7[_0x10af('0x7e')];}})[_0x10af('0x21')](function(){return db['ChatInteraction'][_0x10af('0x50')]({'where':{'closed':![]}});})[_0x10af('0x21')](function(_0x687300){_0x4f0de1=_0x687300;if(_0x2e1478&&_0x687300>_0x2e1478){return db[_0x10af('0xfa')][_0x10af('0x66')]({'where':{'id':0x1}})[_0x10af('0x21')](function(_0x205b40){if(_0x205b40){_0x205b40[_0x10af('0xfb')]('chatLicenseExceeded');}});}})[_0x10af('0x21')](function(){if(_0x2f56ab[_0x10af('0xf6')]&&_0x2f56ab[_0x10af('0xf6')][_0x10af('0xf7')]){var _0x252455=[];for(var _0x410335=0x0;_0x410335<_0x2f56ab[_0x10af('0xf6')][_0x10af('0xf7')][_0x10af('0x45')];_0x410335++){var _0x3e33d3=_0x2f56ab[_0x10af('0xf6')]['Intervals'][_0x410335][_0x10af('0x5c')]({'plain':!![]});_0x252455[_0x10af('0xc1')](iftimePromise(_0x3e33d3,_0x2f56ab));}return BPromise[_0x10af('0xfc')](_0x252455)[_0x10af('0x21')](function(_0x3f3d90){return _['some'](_0x3f3d90);});}else{return!![];}})[_0x10af('0x21')](function(_0x13c974){var _0x1d2ad3=fs[_0x10af('0xfd')](path[_0x10af('0x81')](config[_0x10af('0x7a')],'server/files/chat/iframe.js'),_0x10af('0xd2'));var _0x187ea9={'remote':_0x2f56ab[_0x10af('0xfe')],'query':querystring[_0x10af('0x27')](_[_0x10af('0x4b')](_0x2f56ab[_0x10af('0x5c')]({'plain':!![]}),{'customerIp':_0x2bfbf5[_0x10af('0xa9')][_0x10af('0xab')]||_0x2bfbf5['headers'][_0x10af('0xff')]||_0x2bfbf5['connection']['remoteAddress']||_0x2bfbf5['ip'],'referer':_0x2bfbf5['headers'][_0x10af('0xb0')],'openedInteractions':_0x4f0de1,'maxInteractions':_0x2e1478,'virtual':_0x5ef305[_0x10af('0xf9')],'online':_0x13c974,'custom':_0x5ef305}))[_0x10af('0x100')](/'/g,'\x5c\x27')};_0x108e45['send'](ejs['render'](Mustache['render'](_0x1d2ad3,_0x187ea9),{'proactiveActions':_0x3d5267,'alignment':_0x2f56ab[_0x10af('0x101')],'verticalAlignment':_0x2f56ab['verticalAlignment'],'div_color':_0x2f56ab['color'],'text_color':_0x2f56ab['textColor']}));})[_0x10af('0x2b')](handleError(_0x108e45,null));};exports[_0x10af('0x102')]=function(_0x59cddf,_0x933fed,_0x32bc0b){return db[_0x10af('0x3b')][_0x10af('0x66')]({'where':{'id':_0x59cddf[_0x10af('0x63')]['id']}})[_0x10af('0x21')](handleEntityNotFound(_0x933fed,null))[_0x10af('0x21')](function(_0x2a7653){if(_0x2a7653){return db[_0x10af('0x103')][_0x10af('0x104')](function(_0x5a9213){return db[_0x10af('0x105')][_0x10af('0x33')]({'where':{'ChatWebsiteId':_0x59cddf[_0x10af('0x63')]['id']},'transaction':_0x5a9213})['then'](function(_0x44322f){var _0x4238ee=_['map'](_0x59cddf[_0x10af('0x5a')],function(_0x36cfe3){_0x36cfe3[_0x10af('0x64')]=_0x59cddf[_0x10af('0x63')]['id'];return _0x36cfe3;});return db['ChatApplication'][_0x10af('0x106')](_0x4238ee,{'transaction':_0x5a9213});});})[_0x10af('0x21')](function(){return db[_0x10af('0x105')][_0x10af('0x107')]({'where':{'ChatWebsiteId':_0x59cddf[_0x10af('0x63')]['id']},'order':_0x10af('0xa5')});});}})[_0x10af('0x21')](respondWithResult(_0x933fed,null))[_0x10af('0x2b')](handleError(_0x933fed,null));};exports[_0x10af('0x108')]=function(_0x23064f,_0x3459f7,_0xa0fe28){var _0x28778b={};var _0x409a41={};var _0x324067;var _0x369614;return db[_0x10af('0x3b')][_0x10af('0x66')]({'where':{'id':_0x23064f['params']['id']}})[_0x10af('0x21')](handleEntityNotFound(_0x3459f7,null))[_0x10af('0x21')](function(_0x415a45){if(_0x415a45){_0x324067=_0x415a45;_0x409a41['model']=_[_0x10af('0x55')](db[_0x10af('0x105')][_0x10af('0x3c')]);_0x409a41['query']=_[_0x10af('0x55')](_0x23064f['query']);_0x409a41[_0x10af('0x41')]=_[_0x10af('0x42')](_0x409a41['model'],_0x409a41['query']);_0x28778b[_0x10af('0x44')]=_[_0x10af('0x42')](_0x409a41['model'],qs[_0x10af('0x43')](_0x23064f[_0x10af('0x40')]['fields']));_0x28778b[_0x10af('0x44')]=_0x28778b[_0x10af('0x44')]['length']?_0x28778b[_0x10af('0x44')]:_0x409a41['model'];_0x28778b['order']=qs[_0x10af('0x48')](_0x23064f['query'][_0x10af('0x48')]);_0x28778b['where']=qs[_0x10af('0x41')](_[_0x10af('0x4a')](_0x23064f[_0x10af('0x40')],_0x409a41['filters']));if(_0x23064f[_0x10af('0x40')]['filter']){_0x28778b['where']=_['merge'](_0x28778b[_0x10af('0x49')],{'$or':_[_0x10af('0x4c')](_0x28778b[_0x10af('0x44')],function(_0x80805d){var _0x141a92={};_0x141a92[_0x80805d]={'$like':'%'+_0x23064f[_0x10af('0x40')]['filter']+'%'};return _0x141a92;})});}_0x28778b=_['merge']({},_0x28778b,_0x23064f[_0x10af('0x57')]);return _0x324067[_0x10af('0x108')](_0x28778b);}})['then'](function(_0x59dc36){if(_0x59dc36){_0x369614=_0x59dc36[_0x10af('0x45')];if(!_0x23064f['query'][_0x10af('0x6c')](_0x10af('0x68'))){_0x28778b[_0x10af('0x46')]=qs[_0x10af('0x46')](_0x23064f['query'][_0x10af('0x46')]);_0x28778b[_0x10af('0x2f')]=qs['offset'](_0x23064f['query']['offset']);}return _0x324067[_0x10af('0x108')](_0x28778b);}})[_0x10af('0x21')](function(_0x2b6730){if(_0x2b6730){return _0x2b6730?{'count':_0x369614,'rows':_0x2b6730}:null;}})[_0x10af('0x21')](respondWithResult(_0x3459f7,null))[_0x10af('0x2b')](handleError(_0x3459f7,null));};exports[_0x10af('0x109')]=function(_0x16d04c,_0x21b291,_0x490790){return db['chatProactiveAction'][_0x10af('0x58')]({'where':{'id':_0x16d04c[_0x10af('0x63')]['id']}})[_0x10af('0x21')](handleEntityNotFound(_0x21b291,null))[_0x10af('0x21')](function(_0xe439f2){if(_0xe439f2){return _0xe439f2[_0x10af('0x109')](_0x16d04c[_0x10af('0x5a')]['ids'],_[_0x10af('0xe3')](_0x16d04c[_0x10af('0x5a')],['ids','id'])||{});}})[_0x10af('0x21')](respondWithResult(_0x21b291,null))[_0x10af('0x2b')](handleError(_0x21b291,null));};exports[_0x10af('0xf8')]=function(_0x3c2065,_0xc555dc,_0x545d83){var _0x18d37b={};var _0x206045={};var _0x18a087;var _0x28f913;return db[_0x10af('0x3b')][_0x10af('0x66')]({'where':{'id':_0x3c2065[_0x10af('0x63')]['id']}})['then'](handleEntityNotFound(_0xc555dc,null))[_0x10af('0x21')](function(_0x68e1e8){if(_0x68e1e8){_0x18a087=_0x68e1e8;_0x206045['model']=_['keys'](db['ChatProactiveAction'][_0x10af('0x3c')]);_0x206045[_0x10af('0x40')]=_['keys'](_0x3c2065[_0x10af('0x40')]);_0x206045[_0x10af('0x41')]=_[_0x10af('0x42')](_0x206045[_0x10af('0x3f')],_0x206045['query']);_0x18d37b['attributes']=_[_0x10af('0x42')](_0x206045[_0x10af('0x3f')],qs['fields'](_0x3c2065[_0x10af('0x40')][_0x10af('0x43')]));_0x18d37b['attributes']=_0x18d37b[_0x10af('0x44')]['length']?_0x18d37b[_0x10af('0x44')]:_0x206045[_0x10af('0x3f')];_0x18d37b[_0x10af('0x47')]=qs[_0x10af('0x48')](_0x3c2065[_0x10af('0x40')]['sort']);_0x18d37b[_0x10af('0x49')]=qs[_0x10af('0x41')](_['pick'](_0x3c2065[_0x10af('0x40')],_0x206045[_0x10af('0x41')]));if(_0x3c2065[_0x10af('0x40')][_0x10af('0x4f')]){_0x18d37b['where']=_[_0x10af('0x4b')](_0x18d37b['where'],{'$or':_['map'](_0x18d37b[_0x10af('0x44')],function(_0x30eaea){var _0x18147d={};_0x18147d[_0x30eaea]={'$like':'%'+_0x3c2065['query'][_0x10af('0x4f')]+'%'};return _0x18147d;})});}_0x18d37b=_[_0x10af('0x4b')]({},_0x18d37b,_0x3c2065[_0x10af('0x57')]);return _0x18a087[_0x10af('0xf8')](_0x18d37b);}})['then'](function(_0x17cfa1){if(_0x17cfa1){_0x28f913=_0x17cfa1[_0x10af('0x45')];if(!_0x3c2065['query'][_0x10af('0x6c')]('nolimit')){_0x18d37b[_0x10af('0x46')]=qs['limit'](_0x3c2065[_0x10af('0x40')][_0x10af('0x46')]);_0x18d37b[_0x10af('0x2f')]=qs[_0x10af('0x2f')](_0x3c2065[_0x10af('0x40')][_0x10af('0x2f')]);}return _0x18a087['getProactiveActions'](_0x18d37b);}})[_0x10af('0x21')](function(_0x5df175){if(_0x5df175){return _0x5df175?{'count':_0x28f913,'rows':_0x5df175}:null;}})[_0x10af('0x21')](respondWithResult(_0xc555dc,null))['catch'](handleError(_0xc555dc,null));};exports[_0x10af('0x10a')]=function(_0xf5485a,_0x5af00e,_0x448096){var _0x42f635=_0xf5485a['query'][_0x10af('0x10b')]===_0x10af('0x10c')?'offlineForm':_0x10af('0x10d');return db['ChatWebsite']['find']({'attributes':['id',_0x42f635],'where':{'id':_0xf5485a['params']['id']}})[_0x10af('0x21')](handleEntityNotFound(_0x5af00e,null))[_0x10af('0x21')](function(_0xa21df9){if(_0xa21df9){var _0x372821=_0xa21df9[_0x42f635];var _0xbc1f5d=_0x372821&&_0x372821['items']?_0x372821['items']:[];_0x5af00e[_0x10af('0x39')]({'fromKey':_['isNil'](_0x372821[_0x10af('0x10e')])?undefined:_0x372821[_0x10af('0x10e')],'count':_0xbc1f5d[_0x10af('0x45')],'rows':_0xbc1f5d});}})['catch'](handleError(_0x5af00e,null));};exports['getOfflineMessages']=function(_0x3adf84,_0x4278d6,_0x9cd1cf){var _0x8986bb={'raw':![],'where':{}};var _0x24ef7c={};var _0x134565={'count':0x0,'rows':[]};return db[_0x10af('0x3b')][_0x10af('0x66')]({'where':{'id':_0x3adf84['params']['id']}})['then'](handleEntityNotFound(_0x4278d6,null))['then'](function(_0x37e5af){if(_0x37e5af){_0x24ef7c[_0x10af('0x3f')]=_[_0x10af('0x55')](db[_0x10af('0xd6')][_0x10af('0x3c')]);_0x24ef7c[_0x10af('0x40')]=_[_0x10af('0x55')](_0x3adf84[_0x10af('0x40')]);_0x24ef7c[_0x10af('0x41')]=_[_0x10af('0x42')](_0x24ef7c['model'],_0x24ef7c[_0x10af('0x40')]);_0x8986bb[_0x10af('0x44')]=_[_0x10af('0x42')](_0x24ef7c[_0x10af('0x3f')],qs[_0x10af('0x43')](_0x3adf84[_0x10af('0x40')][_0x10af('0x43')]));_0x8986bb['attributes']=_0x8986bb[_0x10af('0x44')]['length']?_0x8986bb[_0x10af('0x44')]:_0x24ef7c[_0x10af('0x3f')];if(!_0x3adf84['query'][_0x10af('0x6c')]('nolimit')){_0x8986bb[_0x10af('0x46')]=qs[_0x10af('0x46')](_0x3adf84[_0x10af('0x40')][_0x10af('0x46')]);_0x8986bb[_0x10af('0x2f')]=qs[_0x10af('0x2f')](_0x3adf84[_0x10af('0x40')][_0x10af('0x2f')]);}_0x8986bb[_0x10af('0x47')]=qs[_0x10af('0x48')](_0x3adf84[_0x10af('0x40')][_0x10af('0x48')]);_0x8986bb[_0x10af('0x49')]=qs[_0x10af('0x41')](_['pick'](_0x3adf84[_0x10af('0x40')],_0x24ef7c[_0x10af('0x41')]));_0x8986bb[_0x10af('0x49')]['ChatWebsiteId']=_0x37e5af['id'];if(_0x3adf84[_0x10af('0x40')][_0x10af('0x4f')]){_0x8986bb[_0x10af('0x49')]=_['merge'](_0x8986bb[_0x10af('0x49')],{'$or':_[_0x10af('0x4c')](_0x8986bb[_0x10af('0x44')],function(_0xe033fb){var _0x5621c7={};_0x5621c7[_0xe033fb]={'$like':'%'+_0x3adf84['query'][_0x10af('0x4f')]+'%'};return _0x5621c7;})});}_0x8986bb=_['merge']({},_0x8986bb,_0x3adf84[_0x10af('0x57')]);return db[_0x10af('0xd6')][_0x10af('0x50')]({'where':_0x8986bb[_0x10af('0x49')]})[_0x10af('0x21')](function(_0xf4cff4){_0x134565['count']=_0xf4cff4;if(_0x3adf84[_0x10af('0x40')]['includeAll']){_0x8986bb[_0x10af('0x51')]=[{'all':!![]}];}else{_0x8986bb[_0x10af('0x51')]=[{'model':db[_0x10af('0x8f')],'as':_0x10af('0xe5'),'required':![]}];}return db[_0x10af('0xd6')][_0x10af('0x52')](_0x8986bb);})['then'](function(_0x1f24a8){_0x134565[_0x10af('0x69')]=_0x1f24a8;return _0x134565;});}})[_0x10af('0x21')](respondWithFilteredResult(_0x4278d6,_0x8986bb))[_0x10af('0x2b')](handleError(_0x4278d6,null));};exports[_0x10af('0x10f')]=function(_0x4a1fd4,_0x28593a,_0x383451){return db[_0x10af('0x3b')]['find']({'where':{'id':_0x4a1fd4['params']['id']}})[_0x10af('0x21')](handleEntityNotFound(_0x28593a,null))['then'](function(_0x30255b){if(_0x30255b){return _0x30255b[_0x10af('0x10f')](_0x4a1fd4[_0x10af('0x5a')][_0x10af('0x6e')],_['omit'](_0x4a1fd4['body'],[_0x10af('0x6e'),'id'])||{})['spread'](function(_0x572b3e){for(var _0x290e6a=0x0;_0x290e6a<_0x4a1fd4[_0x10af('0x5a')][_0x10af('0x6e')][_0x10af('0x45')];_0x290e6a+=0x1){socket['emit'](_0x10af('0x110'),{'UserId':_0x4a1fd4[_0x10af('0x5a')]['ids'][_0x290e6a],'ChatWebsiteId':_0x4a1fd4[_0x10af('0x63')]['id']});}return _0x572b3e;});}})[_0x10af('0x21')](respondWithResult(_0x28593a,null))[_0x10af('0x2b')](handleError(_0x28593a,null));};exports[_0x10af('0x111')]=function(_0x47db82,_0x286ea3,_0x52e9de){return db[_0x10af('0x3b')][_0x10af('0x58')]({'where':{'id':_0x47db82['params']['id']}})[_0x10af('0x21')](handleEntityNotFound(_0x286ea3,null))[_0x10af('0x21')](function(_0x1ca3c4){if(_0x1ca3c4){return _0x1ca3c4[_0x10af('0x111')](_0x47db82[_0x10af('0x40')]['ids'])[_0x10af('0x21')](function(){if(_[_0x10af('0x112')](_0x47db82[_0x10af('0x40')][_0x10af('0x6e')])){for(var _0x267101=0x0;_0x267101<_0x47db82['query'][_0x10af('0x6e')][_0x10af('0x45')];_0x267101+=0x1){socket[_0x10af('0x113')](_0x10af('0x114'),{'UserId':Number(_0x47db82['query'][_0x10af('0x6e')][_0x267101]),'ChatWebsiteId':Number(_0x47db82[_0x10af('0x63')]['id'])});}}else{socket[_0x10af('0x113')](_0x10af('0x114'),{'UserId':Number(_0x47db82[_0x10af('0x40')]['ids']),'ChatWebsiteId':Number(_0x47db82[_0x10af('0x63')]['id'])});}});}})['then'](respondWithStatusCode(_0x286ea3,null))[_0x10af('0x2b')](handleError(_0x286ea3,null));};exports[_0x10af('0x115')]=function(_0x569c0f,_0x52d9c5,_0x10bf18){var _0x5134f6={};var _0x1dd8b6={};var _0x503435;var _0x4d4219;return db[_0x10af('0x3b')][_0x10af('0x66')]({'where':{'id':_0x569c0f[_0x10af('0x63')]['id']}})[_0x10af('0x21')](handleEntityNotFound(_0x52d9c5,null))[_0x10af('0x21')](function(_0x8a7224){if(_0x8a7224){_0x503435=_0x8a7224;_0x1dd8b6[_0x10af('0x3f')]=_['keys'](db[_0x10af('0xc6')][_0x10af('0x3c')]);_0x1dd8b6['query']=_['keys'](_0x569c0f[_0x10af('0x40')]);_0x1dd8b6[_0x10af('0x41')]=_[_0x10af('0x42')](_0x1dd8b6[_0x10af('0x3f')],_0x1dd8b6[_0x10af('0x40')]);_0x5134f6[_0x10af('0x44')]=_[_0x10af('0x42')](_0x1dd8b6[_0x10af('0x3f')],qs[_0x10af('0x43')](_0x569c0f[_0x10af('0x40')][_0x10af('0x43')]));_0x5134f6[_0x10af('0x44')]=_0x5134f6[_0x10af('0x44')][_0x10af('0x45')]?_0x5134f6[_0x10af('0x44')]:_0x1dd8b6[_0x10af('0x3f')];_0x5134f6[_0x10af('0x47')]=qs[_0x10af('0x48')](_0x569c0f[_0x10af('0x40')][_0x10af('0x48')]);_0x5134f6['where']=qs[_0x10af('0x41')](_[_0x10af('0x4a')](_0x569c0f[_0x10af('0x40')],_0x1dd8b6['filters']));if(_0x569c0f[_0x10af('0x40')][_0x10af('0x4f')]){_0x5134f6['where']=_['merge'](_0x5134f6[_0x10af('0x49')],{'$or':_[_0x10af('0x4c')](_0x5134f6[_0x10af('0x44')],function(_0x5dd062){var _0x4a0479={};_0x4a0479[_0x5dd062]={'$like':'%'+_0x569c0f['query'][_0x10af('0x4f')]+'%'};return _0x4a0479;})});}_0x5134f6=_[_0x10af('0x4b')]({},_0x5134f6,_0x569c0f[_0x10af('0x57')]);return _0x503435[_0x10af('0x115')](_0x5134f6);}})['then'](function(_0x5ef05a){if(_0x5ef05a){_0x4d4219=_0x5ef05a['length'];if(!_0x569c0f[_0x10af('0x40')]['hasOwnProperty'](_0x10af('0x68'))){_0x5134f6[_0x10af('0x46')]=qs[_0x10af('0x46')](_0x569c0f[_0x10af('0x40')]['limit']);_0x5134f6['offset']=qs[_0x10af('0x2f')](_0x569c0f[_0x10af('0x40')][_0x10af('0x2f')]);}return _0x503435[_0x10af('0x115')](_0x5134f6);}})[_0x10af('0x21')](function(_0x301bcb){if(_0x301bcb){return _0x301bcb?{'count':_0x4d4219,'rows':_0x301bcb}:null;}})['then'](respondWithResult(_0x52d9c5,null))[_0x10af('0x2b')](handleError(_0x52d9c5,null));}; \ No newline at end of file +var _0xc85d=['sendStatus','status','end','json','offset','limit','Content-Range','reject','save','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','count','include','rows','params','fields','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','ChatWebsiteId','Disposition','getDispositions','findOne','pick','findAll','removeDispositions','ids','getAnswers','CannedAnswer','removeAnswers','addLogo','sitepic','file','addAvatar','agentAvatar','filename','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.png','../../config/license/util','getLicense','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','headers','user-agent','getResult','chat','describe','no\x20available\x20attributes','createdAt','difference','updatedAt','CompanyId','ListId','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','CmContact','Contacts','ChatApplication','Applications','applications','list','orderBy','priority','asc','account','customerIp','cf-connecting-ip','x-forwarded-for','first','split','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','contact','firstName','messageId','created','autoclose','push','close','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','offline','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','server/files/templates/chatOfflineMessage.ejs','utf8','render','offlineMessageBody','ChatOfflineMessage','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','SendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','tag','Command','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','getSnippet','Interval','Intervals','virtual','custom','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.js','remote','x-real-ip','connection','remoteAddress','verticalAlignment','color','transaction','getApplications','addProactiveActions','ChatProactiveAction','getProactiveActions','getFields','online','offlineForm','onlineForm','items','fromKey','getOfflineMessages','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','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','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','catch'];(function(_0x629df1,_0x4ebff9){var _0x4537df=function(_0x718b88){while(--_0x718b88){_0x629df1['push'](_0x629df1['shift']());}};_0x4537df(++_0x4ebff9);}(_0xc85d,0xea));var _0xdc85=function(_0x368fb9,_0x1a9895){_0x368fb9=_0x368fb9-0x0;var _0x4892fb=_0xc85d[_0x368fb9];return _0x4892fb;};'use strict';var pdf=require(_0xdc85('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xdc85('0x1'));var zipdir=require(_0xdc85('0x2'));var jsonpatch=require(_0xdc85('0x3'));var rp=require(_0xdc85('0x4'));var moment=require(_0xdc85('0x5'));var BPromise=require(_0xdc85('0x6'));var Mustache=require('mustache');var util=require(_0xdc85('0x7'));var path=require(_0xdc85('0x8'));var sox=require(_0xdc85('0x9'));var csv=require(_0xdc85('0xa'));var ejs=require(_0xdc85('0xb'));var fs=require('fs');var _=require(_0xdc85('0xc'));var squel=require(_0xdc85('0xd'));var crypto=require('crypto');var jsforce=require(_0xdc85('0xe'));var deskjs=require(_0xdc85('0xf'));var toCsv=require(_0xdc85('0xa'));var querystring=require(_0xdc85('0x10'));var Papa=require(_0xdc85('0x11'));var Redis=require(_0xdc85('0x12'));var authService=require(_0xdc85('0x13'));var qs=require(_0xdc85('0x14'));var as=require(_0xdc85('0x15'));var hardwareService=require(_0xdc85('0x16'));var logger=require(_0xdc85('0x17'))(_0xdc85('0x18'));var utils=require(_0xdc85('0x19'));var config=require(_0xdc85('0x1a'));var db=require(_0xdc85('0x1b'))['db'];config['redis']=_[_0xdc85('0x1c')](config[_0xdc85('0x1d')],{'host':_0xdc85('0x1e'),'port':0x18eb});var socket=require(_0xdc85('0x1f'))(new Redis(config['redis']));require(_0xdc85('0x20'))[_0xdc85('0x21')](socket);var jayson=require(_0xdc85('0x22'));var client=jayson[_0xdc85('0x23')][_0xdc85('0x24')]({'port':0x232c});var client9002=jayson[_0xdc85('0x23')]['http']({'port':0x232a});var client9003=jayson[_0xdc85('0x23')][_0xdc85('0x24')]({'port':0x232b});function checkPasswordPattern(_0x4fbe4b,_0x131b9c,_0x4ec924){if(_0x4ec924){var _0x53f968=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x53f968[_0xdc85('0x25')](_0x131b9c)){return _0x4fbe4b;}else{throw new db[(_0xdc85('0x26'))][(_0xdc85('0x27'))](_0xdc85('0x28'));}}else{return _0x4fbe4b;}}function respondWithRpcPromise(_0x35081d,_0xd1b7fc,_0x298214,_0x1f9fb0){return new BPromise(function(_0x53ce39,_0x22f1ab){var _0x43de1f=_0x1f9fb0||client;return _0x43de1f[_0xdc85('0x29')](_0x35081d,_0x298214)[_0xdc85('0x2a')](function(_0x20ad58){logger[_0xdc85('0x2b')]('ChatWebsite,\x20%s,\x20%s',_0xd1b7fc,'request\x20sent');logger[_0xdc85('0x2c')](_0xdc85('0x2d'),_0xd1b7fc,'request\x20sent',JSON[_0xdc85('0x2e')](_0x20ad58));if(_0x20ad58['error']){if(_0x20ad58[_0xdc85('0x2f')][_0xdc85('0x30')]===0x1f4){logger[_0xdc85('0x2f')](_0xdc85('0x31'),_0xd1b7fc,_0x20ad58['error'][_0xdc85('0x32')]);return _0x22f1ab(_0x20ad58['error'][_0xdc85('0x32')]);}logger[_0xdc85('0x2f')](_0xdc85('0x31'),_0xd1b7fc,_0x20ad58[_0xdc85('0x2f')]['message']);return _0x53ce39(_0x20ad58[_0xdc85('0x2f')][_0xdc85('0x32')]);}else{logger['info'](_0xdc85('0x31'),_0xd1b7fc,'request\x20sent');_0x53ce39(_0x20ad58['result'][_0xdc85('0x32')]);}})[_0xdc85('0x33')](function(_0x3f5c16){logger[_0xdc85('0x2f')](_0xdc85('0x31'),_0xd1b7fc,_0x3f5c16);_0x22f1ab(_0x3f5c16);});});}function respondWithStatusCode(_0x546478,_0x29baad){_0x29baad=_0x29baad||0xcc;return function(_0x370c14){if(_0x370c14){return _0x546478[_0xdc85('0x34')](_0x29baad);}return _0x546478[_0xdc85('0x35')](_0x29baad)[_0xdc85('0x36')]();};}function respondWithResult(_0xfa31cd,_0x2afabc){_0x2afabc=_0x2afabc||0xc8;return function(_0x1b4e16){if(_0x1b4e16){return _0xfa31cd[_0xdc85('0x35')](_0x2afabc)[_0xdc85('0x37')](_0x1b4e16);}};}function respondWithFilteredResult(_0x2087ae,_0x3a0939){return function(_0x1bd0e9){if(_0x1bd0e9){var _0x10b05a=_0x1bd0e9['count'],_0x218f0c=_0x3a0939['offset'],_0x486e9b=_0x3a0939[_0xdc85('0x38')]+_0x3a0939[_0xdc85('0x39')],_0x4819e9;if(_0x486e9b>=_0x10b05a){_0x486e9b=_0x10b05a;_0x4819e9=0xc8;}else{_0x4819e9=0xce;}_0x2087ae[_0xdc85('0x35')](_0x4819e9);return _0x2087ae['set'](_0xdc85('0x3a'),_0x218f0c+'-'+_0x486e9b+'/'+_0x10b05a)['json'](_0x1bd0e9);}return null;};}function patchUpdates(_0x12a781){return function(_0x324f55){try{jsonpatch['apply'](_0x324f55,_0x12a781,!![]);}catch(_0x20f7fb){return BPromise[_0xdc85('0x3b')](_0x20f7fb);}return _0x324f55[_0xdc85('0x3c')]();};}function saveUpdates(_0xc76d4c,_0x595d3c){return function(_0x3009ac){if(_0x3009ac){return _0x3009ac[_0xdc85('0x3d')](_0xc76d4c)[_0xdc85('0x2a')](function(_0x1ec9e9){return _0x1ec9e9;});}return null;};}function removeEntity(_0x18bb3f,_0x1baede){return function(_0x4b60ed){if(_0x4b60ed){return _0x4b60ed[_0xdc85('0x3e')]()[_0xdc85('0x2a')](function(){var _0x1eafe4=_0x4b60ed[_0xdc85('0x3f')]({'plain':!![]});var _0x374da2=_0xdc85('0x40');return db[_0xdc85('0x41')][_0xdc85('0x3e')]({'where':{'type':_0x374da2,'resourceId':_0x1eafe4['id']}})[_0xdc85('0x2a')](function(){return _0x4b60ed;});})[_0xdc85('0x2a')](function(){_0x18bb3f['status'](0xcc)[_0xdc85('0x36')]();});}};}function handleEntityNotFound(_0x1af92e,_0x195fa6){return function(_0x50f5aa){if(!_0x50f5aa){_0x1af92e[_0xdc85('0x34')](0x194);}return _0x50f5aa;};}function handleError(_0x21e565,_0x58a616){_0x58a616=_0x58a616||0x1f4;return function(_0x162415){logger[_0xdc85('0x2f')](_0x162415[_0xdc85('0x42')]);if(_0x162415['name']){delete _0x162415[_0xdc85('0x43')];}_0x21e565['status'](_0x58a616)['send'](_0x162415);};}exports['index']=function(_0x5ef446,_0x23c01d){var _0xed2478={'include':[{'model':db['Pause'],'as':_0xdc85('0x44')}]},_0x640ab6={},_0x569f18={'count':0x0,'rows':[]};var _0x4da7e9=_['map'](db[_0xdc85('0x45')][_0xdc85('0x46')],function(_0x2002d5){return{'name':_0x2002d5[_0xdc85('0x47')],'type':_0x2002d5[_0xdc85('0x48')]['key']};});_0x640ab6['model']=_[_0xdc85('0x49')](_0x4da7e9,_0xdc85('0x43'));_0x640ab6[_0xdc85('0x4a')]=_[_0xdc85('0x4b')](_0x5ef446[_0xdc85('0x4a')]);_0x640ab6[_0xdc85('0x4c')]=_[_0xdc85('0x4d')](_0x640ab6[_0xdc85('0x4e')],_0x640ab6['query']);_0xed2478['attributes']=_[_0xdc85('0x4d')](_0x640ab6[_0xdc85('0x4e')],qs['fields'](_0x5ef446['query']['fields']));_0xed2478[_0xdc85('0x4f')]=_0xed2478[_0xdc85('0x4f')][_0xdc85('0x50')]?_0xed2478[_0xdc85('0x4f')]:_0x640ab6[_0xdc85('0x4e')];if(!_0x5ef446[_0xdc85('0x4a')][_0xdc85('0x51')](_0xdc85('0x52'))){_0xed2478[_0xdc85('0x39')]=qs['limit'](_0x5ef446[_0xdc85('0x4a')][_0xdc85('0x39')]);_0xed2478[_0xdc85('0x38')]=qs[_0xdc85('0x38')](_0x5ef446[_0xdc85('0x4a')][_0xdc85('0x38')]);}_0xed2478[_0xdc85('0x53')]=qs['sort'](_0x5ef446['query'][_0xdc85('0x54')]);_0xed2478[_0xdc85('0x55')]=qs[_0xdc85('0x4c')](_['pick'](_0x5ef446[_0xdc85('0x4a')],_0x640ab6[_0xdc85('0x4c')]));if(_0x5ef446[_0xdc85('0x4a')]['filter']){_0xed2478['where']=_[_0xdc85('0x56')](_0xed2478[_0xdc85('0x55')],{'$or':_[_0xdc85('0x49')](_0x4da7e9,function(_0x26bacb){if(_0x26bacb[_0xdc85('0x48')]!==_0xdc85('0x57')){var _0x2a7251={};_0x2a7251[_0x26bacb[_0xdc85('0x43')]]={'$like':'%'+_0x5ef446[_0xdc85('0x4a')][_0xdc85('0x58')]+'%'};return _0x2a7251;}})});}_0xed2478=_[_0xdc85('0x56')]({},_0xed2478,_0x5ef446[_0xdc85('0x59')]);var _0x4791b6={'where':_0xed2478[_0xdc85('0x55')]};return db[_0xdc85('0x45')][_0xdc85('0x5a')](_0x4791b6)[_0xdc85('0x2a')](function(_0x1877ab){_0x569f18[_0xdc85('0x5a')]=_0x1877ab;if(_0x5ef446['query']['includeAll']){_0xed2478[_0xdc85('0x5b')]=[{'all':!![]}];}return db[_0xdc85('0x45')]['findAll'](_0xed2478);})['then'](function(_0x30b8ef){_0x569f18[_0xdc85('0x5c')]=_0x30b8ef;return _0x569f18;})[_0xdc85('0x2a')](respondWithFilteredResult(_0x23c01d,_0xed2478))[_0xdc85('0x33')](handleError(_0x23c01d,null));};exports['show']=function(_0x48ed5f,_0x1842a5){var _0x2c0002={'raw':![],'where':{'id':_0x48ed5f[_0xdc85('0x5d')]['id']},'include':[{'model':db['Pause'],'as':_0xdc85('0x44')}]},_0x161c54={};_0x161c54[_0xdc85('0x4e')]=_[_0xdc85('0x4b')](db[_0xdc85('0x45')][_0xdc85('0x46')]);_0x161c54[_0xdc85('0x4a')]=_['keys'](_0x48ed5f[_0xdc85('0x4a')]);_0x161c54[_0xdc85('0x4c')]=_[_0xdc85('0x4d')](_0x161c54[_0xdc85('0x4e')],_0x161c54[_0xdc85('0x4a')]);_0x2c0002['attributes']=_[_0xdc85('0x4d')](_0x161c54[_0xdc85('0x4e')],qs[_0xdc85('0x5e')](_0x48ed5f[_0xdc85('0x4a')][_0xdc85('0x5e')]));_0x2c0002['attributes']=_0x2c0002[_0xdc85('0x4f')]['length']?_0x2c0002[_0xdc85('0x4f')]:_0x161c54[_0xdc85('0x4e')];if(_0x48ed5f[_0xdc85('0x4a')][_0xdc85('0x5f')]){_0x2c0002['include']=[{'all':!![]}];}_0x2c0002=_[_0xdc85('0x56')]({},_0x2c0002,_0x48ed5f[_0xdc85('0x59')]);return db['ChatWebsite'][_0xdc85('0x60')](_0x2c0002)[_0xdc85('0x2a')](handleEntityNotFound(_0x1842a5,null))['then'](respondWithResult(_0x1842a5,null))[_0xdc85('0x33')](handleError(_0x1842a5,null));};exports[_0xdc85('0x61')]=function(_0x5c5f4b,_0x38dff5){return db[_0xdc85('0x45')][_0xdc85('0x61')](_0x5c5f4b[_0xdc85('0x62')],{})[_0xdc85('0x2a')](function(_0x493332){var _0x44388c=_0x5c5f4b[_0xdc85('0x63')]['get']({'plain':!![]});if(!_0x44388c)throw new Error(_0xdc85('0x64'));if(_0x44388c[_0xdc85('0x65')]==='user'){var _0x463851=_0x493332[_0xdc85('0x3f')]({'plain':!![]});var _0x34ca66=_0xdc85('0x40');return db['UserProfileSection'][_0xdc85('0x60')]({'where':{'name':_0x34ca66,'userProfileId':_0x44388c['userProfileId']},'raw':!![]})[_0xdc85('0x2a')](function(_0x9f8e7e){if(_0x9f8e7e&&_0x9f8e7e[_0xdc85('0x66')]===0x0){return db[_0xdc85('0x41')][_0xdc85('0x61')]({'name':_0x463851[_0xdc85('0x43')],'resourceId':_0x463851['id'],'type':_0x9f8e7e['name'],'sectionId':_0x9f8e7e['id']},{})[_0xdc85('0x2a')](function(){return _0x493332;});}else{return _0x493332;}})['catch'](function(_0x816a1f){logger[_0xdc85('0x2f')](_0xdc85('0x67'),_0x816a1f);throw _0x816a1f;});}return _0x493332;})[_0xdc85('0x2a')](respondWithResult(_0x38dff5,0xc9))['catch'](handleError(_0x38dff5,null));};exports[_0xdc85('0x3d')]=function(_0x24c1a7,_0x30aa28){if(_0x24c1a7[_0xdc85('0x62')]['id']){delete _0x24c1a7['body']['id'];}return db[_0xdc85('0x45')][_0xdc85('0x60')]({'where':{'id':_0x24c1a7['params']['id']},'include':[{'model':db['Pause'],'as':_0xdc85('0x44')}]})[_0xdc85('0x2a')](handleEntityNotFound(_0x30aa28,null))[_0xdc85('0x2a')](saveUpdates(_0x24c1a7[_0xdc85('0x62')],null))[_0xdc85('0x2a')](respondWithResult(_0x30aa28,null))['catch'](handleError(_0x30aa28,null));};exports[_0xdc85('0x3e')]=function(_0x1cc1b8,_0x1ef63a){return db['ChatWebsite'][_0xdc85('0x60')]({'where':{'id':_0x1cc1b8[_0xdc85('0x5d')]['id']}})[_0xdc85('0x2a')](handleEntityNotFound(_0x1ef63a,null))[_0xdc85('0x2a')](removeEntity(_0x1ef63a,null))[_0xdc85('0x33')](handleError(_0x1ef63a,null));};exports['describe']=function(_0x133fd3,_0x473dcf){return db[_0xdc85('0x45')]['describe']()[_0xdc85('0x2a')](respondWithResult(_0x473dcf,null))[_0xdc85('0x33')](handleError(_0x473dcf,null));};exports['addDisposition']=function(_0x358772,_0x355680,_0x51937f){if(_0x358772['body']['id']){delete _0x358772[_0xdc85('0x62')]['id'];}return db[_0xdc85('0x45')][_0xdc85('0x60')]({'where':{'id':_0x358772['params']['id']}})[_0xdc85('0x2a')](handleEntityNotFound(_0x355680,null))[_0xdc85('0x2a')](function(_0x188eee){if(_0x188eee){_0x358772['body'][_0xdc85('0x68')]=_0x188eee['id'];return db[_0xdc85('0x69')][_0xdc85('0x61')](_0x358772[_0xdc85('0x62')]);}})['then'](respondWithResult(_0x355680,null))[_0xdc85('0x33')](handleError(_0x355680,null));};exports[_0xdc85('0x6a')]=function(_0x16d675,_0x422e75,_0x17679f){var _0xda9306={'raw':![],'where':{}};var _0x3538a7={};var _0x5c95a9={'count':0x0,'rows':[]};return db[_0xdc85('0x45')][_0xdc85('0x6b')]({'where':{'id':_0x16d675[_0xdc85('0x5d')]['id']}})[_0xdc85('0x2a')](handleEntityNotFound(_0x422e75,null))[_0xdc85('0x2a')](function(_0x13b4b0){if(_0x13b4b0){_0x3538a7[_0xdc85('0x4e')]=_[_0xdc85('0x4b')](db[_0xdc85('0x69')][_0xdc85('0x46')]);_0x3538a7['query']=_[_0xdc85('0x4b')](_0x16d675[_0xdc85('0x4a')]);_0x3538a7[_0xdc85('0x4c')]=_[_0xdc85('0x4d')](_0x3538a7['model'],_0x3538a7[_0xdc85('0x4a')]);_0xda9306[_0xdc85('0x4f')]=_[_0xdc85('0x4d')](_0x3538a7['model'],qs['fields'](_0x16d675['query'][_0xdc85('0x5e')]));_0xda9306[_0xdc85('0x4f')]=_0xda9306[_0xdc85('0x4f')][_0xdc85('0x50')]?_0xda9306['attributes']:_0x3538a7[_0xdc85('0x4e')];if(!_0x16d675[_0xdc85('0x4a')]['hasOwnProperty'](_0xdc85('0x52'))){_0xda9306['limit']=qs[_0xdc85('0x39')](_0x16d675['query']['limit']);_0xda9306['offset']=qs[_0xdc85('0x38')](_0x16d675['query'][_0xdc85('0x38')]);}_0xda9306[_0xdc85('0x53')]=qs[_0xdc85('0x54')](_0x16d675[_0xdc85('0x4a')][_0xdc85('0x54')]);_0xda9306[_0xdc85('0x55')]=qs[_0xdc85('0x4c')](_[_0xdc85('0x6c')](_0x16d675['query'],_0x3538a7[_0xdc85('0x4c')]));_0xda9306[_0xdc85('0x55')][_0xdc85('0x68')]=_0x13b4b0['id'];if(_0x16d675['query'][_0xdc85('0x58')]){_0xda9306[_0xdc85('0x55')]=_[_0xdc85('0x56')](_0xda9306[_0xdc85('0x55')],{'$or':_['map'](_0xda9306[_0xdc85('0x4f')],function(_0x5bf1c2){var _0x1b3280={};_0x1b3280[_0x5bf1c2]={'$like':'%'+_0x16d675['query'][_0xdc85('0x58')]+'%'};return _0x1b3280;})});}_0xda9306=_[_0xdc85('0x56')]({},_0xda9306,_0x16d675['options']);return db[_0xdc85('0x69')][_0xdc85('0x5a')]({'where':_0xda9306['where']})[_0xdc85('0x2a')](function(_0x242719){_0x5c95a9[_0xdc85('0x5a')]=_0x242719;if(_0x16d675['query']['includeAll']){_0xda9306['include']=[{'all':!![]}];}return db[_0xdc85('0x69')][_0xdc85('0x6d')](_0xda9306);})['then'](function(_0x35dbd0){_0x5c95a9['rows']=_0x35dbd0;return _0x5c95a9;});}})['then'](respondWithFilteredResult(_0x422e75,_0xda9306))[_0xdc85('0x33')](handleError(_0x422e75,null));};exports[_0xdc85('0x6e')]=function(_0x120ee4,_0x474ff6,_0x2265e8){return db[_0xdc85('0x45')][_0xdc85('0x60')]({'where':{'id':_0x120ee4['params']['id']}})[_0xdc85('0x2a')](handleEntityNotFound(_0x474ff6,null))[_0xdc85('0x2a')](function(_0x50cf5d){if(_0x50cf5d){return _0x50cf5d['removeDispositions'](_0x120ee4[_0xdc85('0x4a')][_0xdc85('0x6f')]);}})[_0xdc85('0x2a')](respondWithStatusCode(_0x474ff6,null))[_0xdc85('0x33')](handleError(_0x474ff6,null));};exports['addAnswer']=function(_0x4bdcfd,_0x22b042,_0x350072){if(_0x4bdcfd[_0xdc85('0x62')]['id']){delete _0x4bdcfd[_0xdc85('0x62')]['id'];}return db[_0xdc85('0x45')][_0xdc85('0x60')]({'where':{'id':_0x4bdcfd[_0xdc85('0x5d')]['id']}})[_0xdc85('0x2a')](handleEntityNotFound(_0x22b042,null))[_0xdc85('0x2a')](function(_0x48be58){if(_0x48be58){_0x4bdcfd['body'][_0xdc85('0x68')]=_0x48be58['id'];return db['CannedAnswer']['create'](_0x4bdcfd[_0xdc85('0x62')]);}})[_0xdc85('0x2a')](respondWithResult(_0x22b042,null))[_0xdc85('0x33')](handleError(_0x22b042,null));};exports[_0xdc85('0x70')]=function(_0x378376,_0x49a8bd,_0x17f255){var _0x38c4b6={'raw':![],'where':{}};var _0x2d9343={};var _0x618def={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xdc85('0x6b')]({'where':{'id':_0x378376[_0xdc85('0x5d')]['id']}})[_0xdc85('0x2a')](handleEntityNotFound(_0x49a8bd,null))[_0xdc85('0x2a')](function(_0x4446e4){if(_0x4446e4){_0x2d9343[_0xdc85('0x4e')]=_['keys'](db[_0xdc85('0x71')]['rawAttributes']);_0x2d9343[_0xdc85('0x4a')]=_[_0xdc85('0x4b')](_0x378376[_0xdc85('0x4a')]);_0x2d9343[_0xdc85('0x4c')]=_[_0xdc85('0x4d')](_0x2d9343['model'],_0x2d9343[_0xdc85('0x4a')]);_0x38c4b6[_0xdc85('0x4f')]=_[_0xdc85('0x4d')](_0x2d9343[_0xdc85('0x4e')],qs[_0xdc85('0x5e')](_0x378376[_0xdc85('0x4a')][_0xdc85('0x5e')]));_0x38c4b6['attributes']=_0x38c4b6['attributes'][_0xdc85('0x50')]?_0x38c4b6[_0xdc85('0x4f')]:_0x2d9343['model'];if(!_0x378376[_0xdc85('0x4a')]['hasOwnProperty']('nolimit')){_0x38c4b6[_0xdc85('0x39')]=qs['limit'](_0x378376['query'][_0xdc85('0x39')]);_0x38c4b6[_0xdc85('0x38')]=qs[_0xdc85('0x38')](_0x378376[_0xdc85('0x4a')]['offset']);}_0x38c4b6[_0xdc85('0x53')]=qs['sort'](_0x378376['query'][_0xdc85('0x54')]);_0x38c4b6[_0xdc85('0x55')]=qs[_0xdc85('0x4c')](_['pick'](_0x378376[_0xdc85('0x4a')],_0x2d9343[_0xdc85('0x4c')]));_0x38c4b6['where'][_0xdc85('0x68')]=_0x4446e4['id'];if(_0x378376[_0xdc85('0x4a')][_0xdc85('0x58')]){_0x38c4b6[_0xdc85('0x55')]=_[_0xdc85('0x56')](_0x38c4b6['where'],{'$or':_[_0xdc85('0x49')](_0x38c4b6[_0xdc85('0x4f')],function(_0x1275fd){var _0x44e51b={};_0x44e51b[_0x1275fd]={'$like':'%'+_0x378376['query']['filter']+'%'};return _0x44e51b;})});}_0x38c4b6=_['merge']({},_0x38c4b6,_0x378376[_0xdc85('0x59')]);return db[_0xdc85('0x71')]['count']({'where':_0x38c4b6[_0xdc85('0x55')]})['then'](function(_0x3fd8fd){_0x618def[_0xdc85('0x5a')]=_0x3fd8fd;if(_0x378376[_0xdc85('0x4a')][_0xdc85('0x5f')]){_0x38c4b6[_0xdc85('0x5b')]=[{'all':!![]}];}return db['CannedAnswer'][_0xdc85('0x6d')](_0x38c4b6);})['then'](function(_0x52cfac){_0x618def[_0xdc85('0x5c')]=_0x52cfac;return _0x618def;});}})[_0xdc85('0x2a')](respondWithFilteredResult(_0x49a8bd,_0x38c4b6))[_0xdc85('0x33')](handleError(_0x49a8bd,null));};exports[_0xdc85('0x72')]=function(_0x332b15,_0x31581d,_0x506c36){return db[_0xdc85('0x45')][_0xdc85('0x60')]({'where':{'id':_0x332b15['params']['id']}})[_0xdc85('0x2a')](handleEntityNotFound(_0x31581d,null))[_0xdc85('0x2a')](function(_0x42c922){if(_0x42c922){return _0x42c922[_0xdc85('0x72')](_0x332b15[_0xdc85('0x4a')][_0xdc85('0x6f')]);}})[_0xdc85('0x2a')](respondWithStatusCode(_0x31581d,null))[_0xdc85('0x33')](handleError(_0x31581d,null));};exports[_0xdc85('0x73')]=function(_0x282ecb,_0x5b53c5,_0x39f780){_0x282ecb[_0xdc85('0x62')][_0xdc85('0x74')]=_0x282ecb[_0xdc85('0x75')]['filename'];return db[_0xdc85('0x45')][_0xdc85('0x60')]({'where':{'id':_0x282ecb[_0xdc85('0x5d')]['id']}})[_0xdc85('0x2a')](handleEntityNotFound(_0x5b53c5,null))[_0xdc85('0x2a')](saveUpdates(_0x282ecb[_0xdc85('0x62')],null))['then'](respondWithResult(_0x5b53c5,null))['catch'](handleError(_0x5b53c5,null));};exports[_0xdc85('0x76')]=function(_0x467550,_0x3fc661,_0x1b7f84){_0x467550[_0xdc85('0x62')][_0xdc85('0x77')]=_0x467550[_0xdc85('0x75')][_0xdc85('0x78')];return db[_0xdc85('0x45')]['find']({'where':{'id':_0x467550[_0xdc85('0x5d')]['id']}})[_0xdc85('0x2a')](handleEntityNotFound(_0x3fc661,null))[_0xdc85('0x2a')](saveUpdates(_0x467550[_0xdc85('0x62')],null))[_0xdc85('0x2a')](respondWithResult(_0x3fc661,null))[_0xdc85('0x33')](handleError(_0x3fc661,null));};exports['addCustomerAvatar']=function(_0xb61266,_0x4cd8b3,_0x485bad){_0xb61266[_0xdc85('0x62')]['customerAvatar']=_0xb61266[_0xdc85('0x75')][_0xdc85('0x78')];return db['ChatWebsite']['find']({'where':{'id':_0xb61266[_0xdc85('0x5d')]['id']}})['then'](handleEntityNotFound(_0x4cd8b3,null))[_0xdc85('0x2a')](saveUpdates(_0xb61266[_0xdc85('0x62')],null))[_0xdc85('0x2a')](respondWithResult(_0x4cd8b3,null))[_0xdc85('0x33')](handleError(_0x4cd8b3,null));};exports[_0xdc85('0x79')]=function(_0x1a11e5,_0x1d2be2,_0x4c2abf){_0x1a11e5[_0xdc85('0x62')][_0xdc85('0x7a')]=_0x1a11e5[_0xdc85('0x75')][_0xdc85('0x78')];return db['ChatWebsite']['find']({'where':{'id':_0x1a11e5[_0xdc85('0x5d')]['id']}})[_0xdc85('0x2a')](handleEntityNotFound(_0x1d2be2,null))[_0xdc85('0x2a')](saveUpdates(_0x1a11e5[_0xdc85('0x62')],null))[_0xdc85('0x2a')](respondWithResult(_0x1d2be2,null))[_0xdc85('0x33')](handleError(_0x1d2be2,null));};exports[_0xdc85('0x7b')]=function(_0x1245fd,_0x3c1fcd,_0x3c449a){var _0x1796e6=path[_0xdc85('0x7c')](config[_0xdc85('0x7d')],_0xdc85('0x7e'));var _0x5e5e4a={'where':{'id':_0x1245fd['params']['id']},'attributes':['id',_0xdc85('0x74')],'raw':!![]};var _0x5d62c7=![];return require(_0xdc85('0x7f'))[_0xdc85('0x80')]()[_0xdc85('0x2a')](function(_0x119081){if(_0x119081){_0x5d62c7=_0x119081['custom'];}})['then'](function(){return db['ChatWebsite']['find'](_0x5e5e4a);})[_0xdc85('0x2a')](handleEntityNotFound(_0x3c1fcd,null))['then'](function(_0x335064){if(_0x335064){if(!_[_0xdc85('0x81')](_0x335064[_0xdc85('0x74')])){if(fs[_0xdc85('0x82')](path[_0xdc85('0x7c')](config['root'],_0xdc85('0x83'),_0x335064[_0xdc85('0x74')]))&&_0x5d62c7){_0x1796e6=path['join'](config[_0xdc85('0x7d')],_0xdc85('0x83'),_0x335064['sitepic']);}}return _0x3c1fcd[_0xdc85('0x84')](_0x1796e6);}})[_0xdc85('0x33')](handleError(_0x3c1fcd,null));};exports[_0xdc85('0x85')]=function(_0x1af16f,_0x4b100,_0x53d6d1){var _0x38d899=path[_0xdc85('0x7c')](config[_0xdc85('0x7d')],_0xdc85('0x86'));var _0x45c7a3={'where':{'id':_0x1af16f[_0xdc85('0x5d')]['id']},'attributes':['id',_0xdc85('0x77')],'raw':!![]};return db[_0xdc85('0x45')][_0xdc85('0x60')](_0x45c7a3)[_0xdc85('0x2a')](handleEntityNotFound(_0x4b100,null))[_0xdc85('0x2a')](function(_0x27d325){if(_0x27d325){if(!_[_0xdc85('0x81')](_0x27d325[_0xdc85('0x77')])){if(fs[_0xdc85('0x82')](path[_0xdc85('0x7c')](config[_0xdc85('0x7d')],'server/files/images/avatars/',_0x27d325[_0xdc85('0x77')]))){_0x38d899=path[_0xdc85('0x7c')](config[_0xdc85('0x7d')],_0xdc85('0x87'),_0x27d325[_0xdc85('0x77')]);}}return _0x4b100[_0xdc85('0x84')](_0x38d899);}})[_0xdc85('0x33')](handleError(_0x4b100,null));};exports[_0xdc85('0x88')]=function(_0x1753c8,_0x58697f,_0x2c9e50){var _0x30d631=path[_0xdc85('0x7c')](config[_0xdc85('0x7d')],_0xdc85('0x89'));var _0x571dd6={'where':{'id':_0x1753c8[_0xdc85('0x5d')]['id']},'attributes':['id',_0xdc85('0x8a'),_0xdc85('0x8b')],'raw':!![]};return db[_0xdc85('0x45')][_0xdc85('0x60')](_0x571dd6)[_0xdc85('0x2a')](handleEntityNotFound(_0x58697f,null))[_0xdc85('0x2a')](function(_0x4d57d5){if(_0x4d57d5){if(!_[_0xdc85('0x81')](_0x4d57d5[_0xdc85('0x8a')])){if(fs[_0xdc85('0x82')](path[_0xdc85('0x7c')](config['root'],_0xdc85('0x87'),_0x4d57d5[_0xdc85('0x8a')]))&&_0x4d57d5[_0xdc85('0x8b')]){_0x30d631=path['join'](config[_0xdc85('0x7d')],_0xdc85('0x87'),_0x4d57d5[_0xdc85('0x8a')]);}}return _0x58697f['download'](_0x30d631);}})[_0xdc85('0x33')](handleError(_0x58697f,null));};exports['getSystemAvatar']=function(_0xf43b89,_0x5e2046,_0x53d04c){var _0x9b08e7=path[_0xdc85('0x7c')](config[_0xdc85('0x7d')],_0xdc85('0x8c'));var _0x147471={'where':{'id':_0xf43b89[_0xdc85('0x5d')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xdc85('0x45')][_0xdc85('0x60')](_0x147471)[_0xdc85('0x2a')](handleEntityNotFound(_0x5e2046,null))[_0xdc85('0x2a')](function(_0x396a84){if(_0x396a84){if(!_['isNil'](_0x396a84[_0xdc85('0x7a')])){if(fs[_0xdc85('0x82')](path[_0xdc85('0x7c')](config[_0xdc85('0x7d')],_0xdc85('0x87'),_0x396a84[_0xdc85('0x7a')]))){_0x9b08e7=path[_0xdc85('0x7c')](config[_0xdc85('0x7d')],_0xdc85('0x87'),_0x396a84[_0xdc85('0x7a')]);}}return _0x5e2046[_0xdc85('0x84')](_0x9b08e7);}})['catch'](handleError(_0x5e2046,null));};exports[_0xdc85('0x8d')]=function(_0xa66e64,_0x5a8faa,_0x446c3e){var _0x152966=require('user-agent-parser');var _0x416ef1=new _0x152966();var _0x4d9f51=_0x416ef1['setUA'](_0xa66e64[_0xdc85('0x8e')][_0xdc85('0x8f')])[_0xdc85('0x90')]();var _0x3db55b={'body':_0xa66e64[_0xdc85('0x62')],'channel':_0xdc85('0x91')};var _0x29678a=[];var _0xe69873=[];var _0x83327c={};var _0x4b7691=![];return db['CmContact'][_0xdc85('0x92')]()['then'](function(_0x237f90){if(!_0x237f90){throw new db[(_0xdc85('0x26'))][(_0xdc85('0x27'))](_0xdc85('0x93'));}_0x29678a=_['difference'](_[_0xdc85('0x4b')](_0x237f90),[_0xdc85('0x94'),'updatedAt']);_0xe69873=_[_0xdc85('0x95')](_[_0xdc85('0x4b')](_0x237f90),[_0xdc85('0x94'),_0xdc85('0x96'),_0xdc85('0x97'),_0xdc85('0x98')]);if(_0xa66e64['body']['id']){delete _0xa66e64[_0xdc85('0x62')]['id'];}if(_[_0xdc85('0x81')](_0xa66e64[_0xdc85('0x62')]['from'])){throw new db[(_0xdc85('0x26'))][(_0xdc85('0x27'))](_0xdc85('0x99'));}if(_[_0xdc85('0x81')](_0xa66e64[_0xdc85('0x62')]['body'])||_0xa66e64[_0xdc85('0x62')]['body']===''){throw new db['Sequelize']['ValidationError'](_0xdc85('0x9a'));}if(_[_0xdc85('0x81')](_0xa66e64['body'][_0xdc85('0x9b')])){throw new db[(_0xdc85('0x26'))][(_0xdc85('0x27'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xe69873);}if(!_['includes'](_0xe69873,_0xa66e64[_0xdc85('0x62')][_0xdc85('0x9b')])){throw new db[(_0xdc85('0x26'))]['ValidationError'](_0xdc85('0x9c')+_0xe69873);}_0x83327c[_0xa66e64[_0xdc85('0x62')][_0xdc85('0x9b')]]=_0xa66e64[_0xdc85('0x62')][_0xdc85('0x9d')];})[_0xdc85('0x2a')](function(){return db['ChatWebsite'][_0xdc85('0x60')]({'where':{'id':_0xa66e64[_0xdc85('0x5d')]['id']},'include':[{'model':db[_0xdc85('0x9e')],'as':_0xdc85('0x9f'),'include':[{'model':db[_0xdc85('0xa0')],'as':_0xdc85('0xa1'),'where':_0x83327c,'limit':0x1,'order':[[_0xdc85('0x96'),'DESC']]}]},{'model':db[_0xdc85('0xa2')],'as':_0xdc85('0xa3')}]});})[_0xdc85('0x2a')](handleEntityNotFound(_0x5a8faa,null))[_0xdc85('0x2a')](function(_0x10fff6){if(_0x10fff6&&_0x10fff6[_0xdc85('0x9f')]){_0x3db55b['account']=_0x10fff6;_0x3db55b[_0xdc85('0xa4')]=_0x10fff6[_0xdc85('0xa3')];_0x3db55b[_0xdc85('0xa5')]=_0x10fff6[_0xdc85('0x9f')];_0x3db55b[_0xdc85('0xa4')]=_[_0xdc85('0xa6')](_0x3db55b[_0xdc85('0xa4')],[_0xdc85('0xa7')],[_0xdc85('0xa8')]);if(_0x3db55b[_0xdc85('0xa9')][_0xdc85('0xa3')]){delete _0x3db55b[_0xdc85('0xa9')][_0xdc85('0xa3')];}if(_0x3db55b[_0xdc85('0xa9')][_0xdc85('0x9f')]&&_0x3db55b[_0xdc85('0xa9')][_0xdc85('0x9f')][_0xdc85('0xa1')]['length']){return _0x3db55b[_0xdc85('0xa9')][_0xdc85('0x9f')][_0xdc85('0xa1')][0x0];}var _0x25d4a7=_[_0xdc85('0x1c')](_0xa66e64[_0xdc85('0x62')],{'firstName':_0xa66e64[_0xdc85('0x62')][_0xdc85('0x9d')],'ListId':_0x10fff6[_0xdc85('0x98')]});_0x25d4a7[_0xa66e64['body'][_0xdc85('0x9b')]]=_0xa66e64[_0xdc85('0x62')]['from'];return db[_0xdc85('0xa0')]['create'](_0x25d4a7,{'fields':_0x29678a,'raw':!![]});}})[_0xdc85('0x2a')](handleEntityNotFound(_0x5a8faa,null))['then'](function(_0x315238){_0x3db55b['contact']=_0x315238;var _0x4e3e5b=_0xa66e64[_0xdc85('0x62')][_0xdc85('0xaa')];if(_0xa66e64['headers'][_0xdc85('0xab')]){_0x4e3e5b=_0xa66e64[_0xdc85('0x8e')][_0xdc85('0xab')];}else if(_0xa66e64[_0xdc85('0x8e')][_0xdc85('0xac')]){_0x4e3e5b=_[_0xdc85('0xad')](_0xa66e64['headers'][_0xdc85('0xac')][_0xdc85('0xae')](','));}if(_0x315238){var _0x5f092b={'ContactId':_0x315238['id'],'ChatWebsiteId':_0xa66e64[_0xdc85('0x5d')]['id'],'from':(_0x315238['firstName']||'')+'\x20'+(_0x315238['lastName']||''),'customerIp':_0x4e3e5b,'customerPort':_0xa66e64[_0xdc85('0x8e')]['x-real-port']?_0xa66e64['headers']['x-real-port']:null,'referer':_0xa66e64[_0xdc85('0x62')]['referer'],'browserName':_0x4d9f51[_0xdc85('0xaf')][_0xdc85('0x43')]&&_0x4d9f51['browser'][_0xdc85('0xb0')]?util[_0xdc85('0xb1')](_0xdc85('0xb2'),_0x4d9f51[_0xdc85('0xaf')][_0xdc85('0x43')],_0x4d9f51['browser'][_0xdc85('0xb0')]):'unknown','browserVersion':_0x4d9f51[_0xdc85('0xaf')][_0xdc85('0xb0')]||_0xdc85('0xb3'),'osName':util[_0xdc85('0xb1')](_0xdc85('0xb2'),_0x4d9f51['os']['name'],_0x4d9f51['os'][_0xdc85('0xb0')]),'osVersion':_0x4d9f51['os'][_0xdc85('0xb0')],'deviceModel':_0x4d9f51['device'][_0xdc85('0x4e')]&&_0x4d9f51[_0xdc85('0xb4')][_0xdc85('0xb5')]?util[_0xdc85('0xb1')](_0xdc85('0xb6'),_0x4d9f51['device'][_0xdc85('0x4e')],_0x4d9f51[_0xdc85('0xb4')][_0xdc85('0xb5')],_0x4d9f51[_0xdc85('0xb4')]['type']):null,'deviceVendor':_0x4d9f51[_0xdc85('0xb4')][_0xdc85('0xb5')],'deviceType':_0x4d9f51[_0xdc85('0xb4')]['type'],'formData':JSON[_0xdc85('0x2e')](_0xa66e64[_0xdc85('0x62')])};var _0x288c50={'ChatWebsiteId':_0xa66e64['params']['id'],'closed':![]};if(_0xa66e64[_0xdc85('0x62')][_0xdc85('0xb7')]){_0x288c50[_0xdc85('0xb7')]=_0xa66e64[_0xdc85('0x62')][_0xdc85('0xb7')];return db[_0xdc85('0xb8')]['find']({'where':_0x288c50})[_0xdc85('0x2a')](function(_0x490270){if(_0x490270){return[_0x490270,![]];}_0x5f092b['threadId']=_0xa66e64[_0xdc85('0x62')][_0xdc85('0xb7')];_0x5f092b[_0xdc85('0xb9')]=_0xa66e64[_0xdc85('0x62')]['externalUrl'];return db[_0xdc85('0xb8')][_0xdc85('0x61')](_0x5f092b)[_0xdc85('0x2a')](function(_0x52ce27){return[_0x52ce27,!![]];});});}_0x288c50[_0xdc85('0xba')]=_0x315238['id'];if(_0xa66e64[_0xdc85('0x62')][_0xdc85('0xbb')]&&_0xa66e64[_0xdc85('0x62')][_0xdc85('0xbb')]['id']){_0x288c50['id']=_0xa66e64[_0xdc85('0x62')][_0xdc85('0xbb')]['id'];return db['ChatInteraction'][_0xdc85('0x60')]({'where':_0x288c50})[_0xdc85('0x2a')](function(_0x52100f){if(_0x52100f){return[_0x52100f,![]];}return db['ChatInteraction'][_0xdc85('0x61')](_0x5f092b)['then'](function(_0x79b4b6){return[_0x79b4b6,!![]];});});}return db['ChatInteraction'][_0xdc85('0x61')](_0x5f092b)[_0xdc85('0x2a')](function(_0x37b54a){return[_0x37b54a,!![]];});}})[_0xdc85('0xbc')](function(_0x1c1f51,_0x2fd7eb){if(_0x1c1f51){_0x4b7691=_0x2fd7eb;if(!_0x2fd7eb){var _0x49eaf0={'from':(_0x3db55b[_0xdc85('0xbd')][_0xdc85('0xbe')]||'')+'\x20'+(_0x3db55b[_0xdc85('0xbd')]['lastName']||'')};if(_0xa66e64[_0xdc85('0x62')][_0xdc85('0xb7')]&&_0xa66e64['body'][_0xdc85('0xbf')]&&_0xa66e64['body'][_0xdc85('0xb7')]!=_0xa66e64[_0xdc85('0x62')][_0xdc85('0xbf')]){_0x49eaf0[_0xdc85('0xb7')]=_0xa66e64[_0xdc85('0x62')][_0xdc85('0xbf')];}return _0x1c1f51[_0xdc85('0x3d')](_0x49eaf0);}else{return _0x1c1f51;}}})['then'](function(_0x2ffd62){_0x3db55b['interaction']=_0x2ffd62[_0xdc85('0x3f')]({'plain':!![]});_0x3db55b[_0xdc85('0xbb')][_0xdc85('0xc0')]=_0x4b7691;if(_0x3db55b[_0xdc85('0xbb')]['created']){if(_0x3db55b['account'][_0xdc85('0xc1')]){_0x3db55b[_0xdc85('0xa4')][_0xdc85('0xc2')]({'id':0x0,'priority':_0x3db55b[_0xdc85('0xa4')][_0xdc85('0x50')]+0x1,'app':_0xdc85('0xc3'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db['ChatMessage'][_0xdc85('0x61')]({'body':_0xa66e64['body'][_0xdc85('0x62')],'ChatWebsiteId':_0xa66e64[_0xdc85('0x5d')]['id'],'ChatInteractionId':_0x2ffd62['id'],'direction':'in','ContactId':_0x3db55b['contact']['id'],'AttachmentId':_0xa66e64['body'][_0xdc85('0xc4')]});})[_0xdc85('0x2a')](function(_0x1e8643){_0x3db55b[_0xdc85('0x32')]=_0x1e8643;if(_0x3db55b['interaction'][_0xdc85('0xc5')]){return db[_0xdc85('0xc6')][_0xdc85('0x60')]({'attributes':['id',_0xdc85('0x43')],'where':{'id':_0x3db55b[_0xdc85('0xbb')][_0xdc85('0xc5')]}})[_0xdc85('0x2a')](function(_0x3062d3){if(_0x3062d3){_0x3db55b['applications'][_0xdc85('0xc7')]({'id':0x0,'priority':0x0,'app':_0xdc85('0xc8'),'appdata':_0x3062d3['name']+','+(_0x3db55b[_0xdc85('0xa9')][_0xdc85('0xc9')]||0xa),'interval':_0xdc85('0xca')});_0x3db55b[_0xdc85('0xcb')]=!![];}return respondWithRpcPromise(_0xdc85('0xcc'),'startRouting',_0x3db55b);});}return respondWithRpcPromise(_0xdc85('0xcc'),_0xdc85('0xcd'),_0x3db55b);})['then'](function(_0x19cf8d){respondWithRpcPromise(_0xdc85('0xce'),_0xdc85('0xce'),{'event':_0xdc85('0x8d'),'message':_0x19cf8d},client9002);return _0x19cf8d;})[_0xdc85('0x2a')](respondWithResult(_0x5a8faa,null))[_0xdc85('0x33')](handleError(_0x5a8faa,null));};exports[_0xdc85('0xcf')]=function(_0x39a610,_0x185809,_0x351df6){var _0x36114e,_0xd7b61d,_0x13485d;var _0x3ad160=[];var _0xaaad5c=[];var _0xf7fb58={};return db['CmContact'][_0xdc85('0x92')]()[_0xdc85('0x2a')](function(_0x4ac7d4){if(!_0x4ac7d4){throw new db[(_0xdc85('0x26'))]['ValidationError'](_0xdc85('0x93'));}_0xaaad5c=_['difference'](_[_0xdc85('0x4b')](_0x4ac7d4),[_0xdc85('0x94'),_0xdc85('0x96')]);_0x3ad160=_['difference'](_[_0xdc85('0x4b')](_0x4ac7d4),['createdAt',_0xdc85('0x96'),_0xdc85('0x97'),_0xdc85('0x98')]);if(_0x39a610[_0xdc85('0x62')]['id']){delete _0x39a610['body']['id'];}if(_[_0xdc85('0x81')](_0x39a610[_0xdc85('0x62')][_0xdc85('0x9d')])){throw _0x185809['status'](0x1f4)[_0xdc85('0xd0')](new db[(_0xdc85('0x26'))][(_0xdc85('0x27'))](_0xdc85('0x99')));}if(_[_0xdc85('0x81')](_0x39a610['body'][_0xdc85('0x62')])||_0x39a610[_0xdc85('0x62')]['body']===''){throw _0x185809[_0xdc85('0x35')](0x1f4)['send'](new db[(_0xdc85('0x26'))][(_0xdc85('0x27'))](_0xdc85('0x9a')));}if(_[_0xdc85('0x81')](_0x39a610[_0xdc85('0x62')][_0xdc85('0xd1')])){throw _0x185809['status'](0x1f4)['send'](new db[(_0xdc85('0x26'))][(_0xdc85('0x27'))](_0xdc85('0xd2')+_0x3ad160));}if(!_['includes'](_0x3ad160,_0x39a610[_0xdc85('0x62')][_0xdc85('0xd1')])){throw _0x185809[_0xdc85('0x35')](0x1f4)['send'](new db[(_0xdc85('0x26'))][(_0xdc85('0x27'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3ad160));}_0xf7fb58[_0x39a610['body'][_0xdc85('0xd1')]]=_0x39a610[_0xdc85('0x62')][_0xdc85('0x9d')];})['then'](function(){return db['ChatWebsite'][_0xdc85('0x60')]({'where':{'id':_0x39a610[_0xdc85('0x5d')]['id']},'include':[{'model':db['CmList'],'as':'List'}]});})[_0xdc85('0x2a')](handleEntityNotFound(_0x185809,null))[_0xdc85('0x2a')](function(_0x216b79){if(_0x216b79&&_0x216b79[_0xdc85('0x9f')]){_0xd7b61d=_0x216b79;var _0x2df432=_[_0xdc85('0x1c')](_0x39a610['body'],{'firstName':_0x39a610[_0xdc85('0x62')][_0xdc85('0x9d')],'phone':_0x39a610['body'][_0xdc85('0x9d')],'ListId':_0x216b79[_0xdc85('0x98')]});_0x2df432[_0x39a610[_0xdc85('0x62')][_0xdc85('0xd1')]]=_0x39a610[_0xdc85('0x62')]['from'];return db[_0xdc85('0xa0')]['findOrCreate']({'where':_0xf7fb58,'defaults':_0x2df432});}})[_0xdc85('0xbc')](function(_0x25ddd6){if(_0x25ddd6){_0x13485d=_0x25ddd6;var _0x5b0afb=fs['readFileSync'](path[_0xdc85('0x7c')](config[_0xdc85('0x7d')],_0xdc85('0xd3')),_0xdc85('0xd4'));var _0x2b659e=ejs[_0xdc85('0xd5')](_0x5b0afb,{'body':_['toPairs'](_0x39a610['body'][_0xdc85('0x62')]),'bodyTitle':_0xd7b61d[_0xdc85('0xd6')]});return db[_0xdc85('0xd7')][_0xdc85('0x61')]({'body':_0x2b659e,'ContactId':_0x25ddd6['id'],'ChatWebsiteId':_0xd7b61d['id']});}})[_0xdc85('0x2a')](function(_0x1fdae4){if(_0x1fdae4){_0x36114e=_0x1fdae4;return db[_0xdc85('0xd8')][_0xdc85('0x6b')]({'where':{'service':!![]},'include':[{'model':db[_0xdc85('0xd9')],'as':'Smtp','raw':!![]}]});}})[_0xdc85('0x2a')](function(_0x35ff71){if(_0x35ff71&&_0x35ff71[_0xdc85('0xda')]&&_0xd7b61d['forwardOfflineAddress']){var _0x5257e9={'tls':{'rejectUnauthorized':![]}};if(_0x35ff71['Smtp']['service']){_0x5257e9[_0xdc85('0xdb')]=_0x35ff71[_0xdc85('0xda')][_0xdc85('0xdb')];}else{_0x5257e9[_0xdc85('0xdc')]=_0x35ff71[_0xdc85('0xda')][_0xdc85('0xdc')];_0x5257e9[_0xdc85('0xdd')]=_0x35ff71[_0xdc85('0xda')][_0xdc85('0xdd')];_0x5257e9[_0xdc85('0xde')]=_0x35ff71[_0xdc85('0xda')]['secure'];}if(_0x35ff71[_0xdc85('0xda')][_0xdc85('0xdf')]){_0x5257e9[_0xdc85('0xe0')]={'user':_0x35ff71[_0xdc85('0xda')]['user'],'pass':_0x35ff71[_0xdc85('0xda')]['pass']};}return respondWithRpcPromise(_0xdc85('0xe1'),'sendMail',{'account':_0x5257e9,'message':{'from':util[_0xdc85('0xb1')](_0xdc85('0xe2'),_0x35ff71[_0xdc85('0x43')],_0x35ff71[_0xdc85('0xe3')]||_0x35ff71[_0xdc85('0xda')]['user']),'to':_0xd7b61d[_0xdc85('0xe4')],'subject':_0xd7b61d[_0xdc85('0xe5')],'text':_0x36114e[_0xdc85('0x62')]}},client9003)[_0xdc85('0x2a')](function(){return _0x36114e;})[_0xdc85('0x33')](function(_0x1c3dcc){console[_0xdc85('0x2f')](_0x1c3dcc);});}})['then'](function(){if(_0x36114e){return _0x36114e;}})[_0xdc85('0x2a')](respondWithResult(_0x185809,null))[_0xdc85('0x33')](handleError(_0x185809,null));};exports[_0xdc85('0xe6')]=function(_0x2b5603,_0x1663dd,_0x19af3c){return db[_0xdc85('0xb8')][_0xdc85('0x60')]({'where':{'id':_0x2b5603['params']['id']}})[_0xdc85('0x2a')](handleEntityNotFound(_0x1663dd,null))['then'](function(_0x1313c0){if(_0x1313c0){return _0x1313c0['addInteraction'](_0x2b5603[_0xdc85('0x62')][_0xdc85('0x6f')],_[_0xdc85('0xe7')](_0x2b5603['body'],[_0xdc85('0x6f'),'id'])||{});}})[_0xdc85('0x2a')](respondWithResult(_0x1663dd,null))[_0xdc85('0x33')](handleError(_0x1663dd,null));};exports[_0xdc85('0xe8')]=function(_0x5f2d2e,_0x5d633e,_0x3e0d71){var _0x2eec60={'raw':![],'where':{}};var _0x5680d9={};var _0x46934f={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x5f2d2e[_0xdc85('0x5d')]['id']}})[_0xdc85('0x2a')](handleEntityNotFound(_0x5d633e,null))[_0xdc85('0x2a')](function(_0x41bc81){if(_0x41bc81){_0x5680d9[_0xdc85('0x4e')]=_[_0xdc85('0x4b')](db[_0xdc85('0xb8')]['rawAttributes']);_0x5680d9[_0xdc85('0x4a')]=_['keys'](_0x5f2d2e[_0xdc85('0x4a')]);_0x5680d9[_0xdc85('0x4c')]=_[_0xdc85('0x4d')](_0x5680d9[_0xdc85('0x4e')],_0x5680d9[_0xdc85('0x4a')]);_0x2eec60[_0xdc85('0x4f')]=_['intersection'](_0x5680d9[_0xdc85('0x4e')],qs[_0xdc85('0x5e')](_0x5f2d2e[_0xdc85('0x4a')][_0xdc85('0x5e')]));_0x2eec60['attributes']=_0x2eec60[_0xdc85('0x4f')][_0xdc85('0x50')]?_0x2eec60[_0xdc85('0x4f')]:_0x5680d9['model'];if(!_0x5f2d2e[_0xdc85('0x4a')][_0xdc85('0x51')](_0xdc85('0x52'))){_0x2eec60[_0xdc85('0x39')]=qs[_0xdc85('0x39')](_0x5f2d2e['query']['limit']);_0x2eec60[_0xdc85('0x38')]=qs[_0xdc85('0x38')](_0x5f2d2e[_0xdc85('0x4a')][_0xdc85('0x38')]);}_0x2eec60[_0xdc85('0x53')]=qs[_0xdc85('0x54')](_0x5f2d2e[_0xdc85('0x4a')]['sort']);_0x2eec60[_0xdc85('0x55')]=qs['filters'](_['pick'](_0x5f2d2e[_0xdc85('0x4a')],_0x5680d9['filters']));_0x2eec60[_0xdc85('0x55')][_0xdc85('0x68')]=_0x41bc81['id'];if(_0x5f2d2e[_0xdc85('0x4a')]['filter']){_0x2eec60[_0xdc85('0x55')]=_[_0xdc85('0x56')](_0x2eec60[_0xdc85('0x55')],{'$or':_['map'](_0x2eec60[_0xdc85('0x4f')],function(_0x2adf10){var _0x2a865f={};_0x2a865f[_0x2adf10]={'$like':'%'+_0x5f2d2e[_0xdc85('0x4a')][_0xdc85('0x58')]+'%'};return _0x2a865f;})});}_0x2eec60=_[_0xdc85('0x56')]({},_0x2eec60,_0x5f2d2e[_0xdc85('0x59')]);return db[_0xdc85('0xb8')][_0xdc85('0x5a')]({'where':_0x2eec60[_0xdc85('0x55')]})['then'](function(_0x1bb742){_0x46934f[_0xdc85('0x5a')]=_0x1bb742;if(_0x5f2d2e['query'][_0xdc85('0x5f')]){_0x2eec60[_0xdc85('0x5b')]=[{'model':db[_0xdc85('0xa0')],'as':_0xdc85('0xe9'),'required':![]},{'model':db[_0xdc85('0xc6')],'as':_0xdc85('0xea'),'attributes':['name',_0xdc85('0xeb'),_0xdc85('0xec')],'required':![]},{'model':db[_0xdc85('0xed')],'as':_0xdc85('0xee'),'attributes':['id',_0xdc85('0x43'),'color'],'where':_0x5f2d2e[_0xdc85('0x4a')][_0xdc85('0xef')]?{'id':_0x5f2d2e[_0xdc85('0x4a')][_0xdc85('0xef')]}:undefined,'required':_0x5f2d2e[_0xdc85('0x4a')]['tag']?!![]:![]}];}return db[_0xdc85('0xb8')]['findAll'](_0x2eec60);})[_0xdc85('0x2a')](function(_0x1c1e7b){_0x46934f['rows']=_0x1c1e7b;return _0x46934f;});}})['then'](respondWithFilteredResult(_0x5d633e,_0x2eec60))[_0xdc85('0x33')](handleError(_0x5d633e,null));};function iftimePromise(_0x13e39e,_0x3075e2){return respondWithRpcPromise(_0xdc85('0xf0'),'getSnippet',{'command':_0x3075e2[_0xdc85('0xf1')]?util['format'](_0xdc85('0xf2'),_0x13e39e[_0xdc85('0xf3')],_0x3075e2[_0xdc85('0xf1')]):util['format'](_0xdc85('0xf4'),_0x13e39e['interval'])},client9002)['then'](function(_0x57c5d8){var _0x5b90ab=_0x57c5d8&&_0x57c5d8[_0xdc85('0xf5')]('true')>=0x0?!![]:![];logger[_0xdc85('0x2b')](_0xdc85('0xf6'),_0x3075e2['id'],_0x13e39e['id'],_0x13e39e[_0xdc85('0xf3')],_0x5b90ab?_0xdc85('0xf7'):_0xdc85('0xf8'),_0x3075e2[_0xdc85('0xf1')]?_0x3075e2[_0xdc85('0xf1')]:_0xdc85('0xf9'));return _0x5b90ab;})[_0xdc85('0x33')](function(_0x3ca5c1){logger[_0xdc85('0x2f')](_0xdc85('0xf6'),_0x3075e2['id'],_0x13e39e['id'],_0x13e39e[_0xdc85('0xf3')],util[_0xdc85('0xfa')](_0x3ca5c1,{'showHidden':![],'depth':null}),_0x3075e2['timezone']?_0x3075e2['timezone']:_0xdc85('0xf9'));return![];});}exports[_0xdc85('0xfb')]=function(_0x6b42ed,_0x40a60f,_0x55db33){var _0x536738=0x0;var _0x1f27be=0x0;var _0x376a7f=![];var _0x83677d;var _0x5d31fc;return db['ChatWebsite'][_0xdc85('0x60')]({'where':{'id':_0x6b42ed[_0xdc85('0x5d')]['id']},'include':[{'model':db['Interval'],'as':_0xdc85('0xfc'),'include':[{'model':db[_0xdc85('0xfc')],'as':_0xdc85('0xfd'),'attributes':['id','interval'],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x40a60f,null))[_0xdc85('0x2a')](function(_0x3a553c){if(_0x3a553c){_0x83677d=_0x3a553c;return _0x3a553c['getProactiveActions']({'raw':!![]});}})[_0xdc85('0x2a')](function(_0x2a1105){if(_0x83677d){if(_0x2a1105){_0x5d31fc=_0x2a1105;}}return require(_0xdc85('0x7f'))[_0xdc85('0x80')]();})[_0xdc85('0x2a')](function(_0x389306){if(_0x389306){_0x1f27be=_0x389306[_0xdc85('0xfe')];_0x376a7f=_0x389306[_0xdc85('0xff')];}})[_0xdc85('0x2a')](function(){return db['ChatInteraction'][_0xdc85('0x5a')]({'where':{'closed':![]}});})[_0xdc85('0x2a')](function(_0x4add19){_0x536738=_0x4add19;if(_0x1f27be&&_0x4add19>_0x1f27be){return db['License'][_0xdc85('0x6b')]({'where':{'id':0x1}})['then'](function(_0x2783d5){if(_0x2783d5){_0x2783d5[_0xdc85('0x100')](_0xdc85('0x101'));}});}})[_0xdc85('0x2a')](function(){if(_0x83677d[_0xdc85('0xfc')]&&_0x83677d['Interval'][_0xdc85('0xfd')]){var _0x5a7d4b=[];for(var _0x2fe09f=0x0;_0x2fe09f<_0x83677d[_0xdc85('0xfc')]['Intervals'][_0xdc85('0x50')];_0x2fe09f++){var _0x1ec9e4=_0x83677d[_0xdc85('0xfc')]['Intervals'][_0x2fe09f]['get']({'plain':!![]});_0x5a7d4b['push'](iftimePromise(_0x1ec9e4,_0x83677d));}return BPromise[_0xdc85('0x102')](_0x5a7d4b)[_0xdc85('0x2a')](function(_0x426c0a){return _[_0xdc85('0x103')](_0x426c0a);});}else{return!![];}})['then'](function(_0x60e5b2){var _0x494edd=fs['readFileSync'](path[_0xdc85('0x7c')](config[_0xdc85('0x7d')],_0xdc85('0x104')),_0xdc85('0xd4'));var _0x56446d={'remote':_0x83677d[_0xdc85('0x105')],'query':querystring[_0xdc85('0x2e')](_[_0xdc85('0x56')](_0x83677d[_0xdc85('0x3f')]({'plain':!![]}),{'customerIp':_0x6b42ed[_0xdc85('0x8e')][_0xdc85('0xac')]||_0x6b42ed[_0xdc85('0x8e')][_0xdc85('0x106')]||_0x6b42ed[_0xdc85('0x107')][_0xdc85('0x108')]||_0x6b42ed['ip'],'referer':_0x6b42ed['headers']['referer'],'openedInteractions':_0x536738,'maxInteractions':_0x1f27be,'virtual':_0x376a7f[_0xdc85('0xfe')],'online':_0x60e5b2,'custom':_0x376a7f}))['replace'](/'/g,'\x5c\x27')};_0x40a60f[_0xdc85('0xd0')](ejs['render'](Mustache[_0xdc85('0xd5')](_0x494edd,_0x56446d),{'proactiveActions':_0x5d31fc,'alignment':_0x83677d['alignment'],'verticalAlignment':_0x83677d[_0xdc85('0x109')],'div_color':_0x83677d[_0xdc85('0x10a')],'text_color':_0x83677d['textColor']}));})[_0xdc85('0x33')](handleError(_0x40a60f,null));};exports['addApplications']=function(_0x5d5e2e,_0x47d9da,_0x39d9d9){return db['ChatWebsite'][_0xdc85('0x6b')]({'where':{'id':_0x5d5e2e[_0xdc85('0x5d')]['id']}})[_0xdc85('0x2a')](handleEntityNotFound(_0x47d9da,null))['then'](function(_0x366f9a){if(_0x366f9a){return db['sequelize'][_0xdc85('0x10b')](function(_0x37c685){return db['ChatApplication'][_0xdc85('0x3e')]({'where':{'ChatWebsiteId':_0x5d5e2e[_0xdc85('0x5d')]['id']},'transaction':_0x37c685})[_0xdc85('0x2a')](function(_0xf0e55c){var _0x3bf4c3=_['map'](_0x5d5e2e[_0xdc85('0x62')],function(_0x4bbb15){_0x4bbb15[_0xdc85('0x68')]=_0x5d5e2e[_0xdc85('0x5d')]['id'];return _0x4bbb15;});return db[_0xdc85('0xa2')]['bulkCreate'](_0x3bf4c3,{'transaction':_0x37c685});});})[_0xdc85('0x2a')](function(){return db[_0xdc85('0xa2')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x5d5e2e[_0xdc85('0x5d')]['id']},'order':_0xdc85('0xa7')});});}})[_0xdc85('0x2a')](respondWithResult(_0x47d9da,null))['catch'](handleError(_0x47d9da,null));};exports[_0xdc85('0x10c')]=function(_0x594d95,_0x17fd27,_0x1ed44f){var _0x2fc296={};var _0x402103={};var _0x198e23;var _0x463c1a;return db[_0xdc85('0x45')][_0xdc85('0x6b')]({'where':{'id':_0x594d95[_0xdc85('0x5d')]['id']}})['then'](handleEntityNotFound(_0x17fd27,null))['then'](function(_0x6672d6){if(_0x6672d6){_0x198e23=_0x6672d6;_0x402103[_0xdc85('0x4e')]=_[_0xdc85('0x4b')](db['ChatApplication'][_0xdc85('0x46')]);_0x402103[_0xdc85('0x4a')]=_['keys'](_0x594d95[_0xdc85('0x4a')]);_0x402103['filters']=_[_0xdc85('0x4d')](_0x402103[_0xdc85('0x4e')],_0x402103['query']);_0x2fc296['attributes']=_[_0xdc85('0x4d')](_0x402103[_0xdc85('0x4e')],qs['fields'](_0x594d95[_0xdc85('0x4a')][_0xdc85('0x5e')]));_0x2fc296[_0xdc85('0x4f')]=_0x2fc296[_0xdc85('0x4f')][_0xdc85('0x50')]?_0x2fc296[_0xdc85('0x4f')]:_0x402103[_0xdc85('0x4e')];_0x2fc296[_0xdc85('0x53')]=qs[_0xdc85('0x54')](_0x594d95[_0xdc85('0x4a')]['sort']);_0x2fc296['where']=qs[_0xdc85('0x4c')](_[_0xdc85('0x6c')](_0x594d95[_0xdc85('0x4a')],_0x402103[_0xdc85('0x4c')]));if(_0x594d95[_0xdc85('0x4a')][_0xdc85('0x58')]){_0x2fc296['where']=_[_0xdc85('0x56')](_0x2fc296[_0xdc85('0x55')],{'$or':_['map'](_0x2fc296[_0xdc85('0x4f')],function(_0x377213){var _0x15190e={};_0x15190e[_0x377213]={'$like':'%'+_0x594d95[_0xdc85('0x4a')][_0xdc85('0x58')]+'%'};return _0x15190e;})});}_0x2fc296=_[_0xdc85('0x56')]({},_0x2fc296,_0x594d95[_0xdc85('0x59')]);return _0x198e23['getApplications'](_0x2fc296);}})[_0xdc85('0x2a')](function(_0x596058){if(_0x596058){_0x463c1a=_0x596058['length'];if(!_0x594d95[_0xdc85('0x4a')]['hasOwnProperty'](_0xdc85('0x52'))){_0x2fc296[_0xdc85('0x39')]=qs['limit'](_0x594d95[_0xdc85('0x4a')][_0xdc85('0x39')]);_0x2fc296[_0xdc85('0x38')]=qs['offset'](_0x594d95[_0xdc85('0x4a')][_0xdc85('0x38')]);}return _0x198e23[_0xdc85('0x10c')](_0x2fc296);}})['then'](function(_0x1f8bfa){if(_0x1f8bfa){return _0x1f8bfa?{'count':_0x463c1a,'rows':_0x1f8bfa}:null;}})[_0xdc85('0x2a')](respondWithResult(_0x17fd27,null))[_0xdc85('0x33')](handleError(_0x17fd27,null));};exports[_0xdc85('0x10d')]=function(_0x2c0c8a,_0x3ab32d,_0x8cabde){return db['chatProactiveAction'][_0xdc85('0x60')]({'where':{'id':_0x2c0c8a['params']['id']}})['then'](handleEntityNotFound(_0x3ab32d,null))[_0xdc85('0x2a')](function(_0x3710ae){if(_0x3710ae){return _0x3710ae[_0xdc85('0x10d')](_0x2c0c8a['body']['ids'],_[_0xdc85('0xe7')](_0x2c0c8a[_0xdc85('0x62')],[_0xdc85('0x6f'),'id'])||{});}})[_0xdc85('0x2a')](respondWithResult(_0x3ab32d,null))[_0xdc85('0x33')](handleError(_0x3ab32d,null));};exports['getProactiveActions']=function(_0x4ed0e2,_0x44694b,_0x55f15d){var _0x3445ea={};var _0x7deabb={};var _0x2388a0;var _0xd4e88;return db[_0xdc85('0x45')][_0xdc85('0x6b')]({'where':{'id':_0x4ed0e2[_0xdc85('0x5d')]['id']}})[_0xdc85('0x2a')](handleEntityNotFound(_0x44694b,null))[_0xdc85('0x2a')](function(_0x3014e6){if(_0x3014e6){_0x2388a0=_0x3014e6;_0x7deabb['model']=_[_0xdc85('0x4b')](db[_0xdc85('0x10e')][_0xdc85('0x46')]);_0x7deabb['query']=_[_0xdc85('0x4b')](_0x4ed0e2[_0xdc85('0x4a')]);_0x7deabb['filters']=_['intersection'](_0x7deabb[_0xdc85('0x4e')],_0x7deabb[_0xdc85('0x4a')]);_0x3445ea[_0xdc85('0x4f')]=_['intersection'](_0x7deabb[_0xdc85('0x4e')],qs[_0xdc85('0x5e')](_0x4ed0e2[_0xdc85('0x4a')]['fields']));_0x3445ea[_0xdc85('0x4f')]=_0x3445ea[_0xdc85('0x4f')][_0xdc85('0x50')]?_0x3445ea[_0xdc85('0x4f')]:_0x7deabb['model'];_0x3445ea[_0xdc85('0x53')]=qs[_0xdc85('0x54')](_0x4ed0e2['query'][_0xdc85('0x54')]);_0x3445ea[_0xdc85('0x55')]=qs[_0xdc85('0x4c')](_[_0xdc85('0x6c')](_0x4ed0e2[_0xdc85('0x4a')],_0x7deabb[_0xdc85('0x4c')]));if(_0x4ed0e2['query'][_0xdc85('0x58')]){_0x3445ea['where']=_[_0xdc85('0x56')](_0x3445ea['where'],{'$or':_[_0xdc85('0x49')](_0x3445ea['attributes'],function(_0x23405c){var _0x4c8ba0={};_0x4c8ba0[_0x23405c]={'$like':'%'+_0x4ed0e2[_0xdc85('0x4a')]['filter']+'%'};return _0x4c8ba0;})});}_0x3445ea=_['merge']({},_0x3445ea,_0x4ed0e2['options']);return _0x2388a0[_0xdc85('0x10f')](_0x3445ea);}})[_0xdc85('0x2a')](function(_0x546551){if(_0x546551){_0xd4e88=_0x546551[_0xdc85('0x50')];if(!_0x4ed0e2['query']['hasOwnProperty'](_0xdc85('0x52'))){_0x3445ea[_0xdc85('0x39')]=qs[_0xdc85('0x39')](_0x4ed0e2[_0xdc85('0x4a')]['limit']);_0x3445ea[_0xdc85('0x38')]=qs[_0xdc85('0x38')](_0x4ed0e2['query'][_0xdc85('0x38')]);}return _0x2388a0[_0xdc85('0x10f')](_0x3445ea);}})[_0xdc85('0x2a')](function(_0x29a7de){if(_0x29a7de){return _0x29a7de?{'count':_0xd4e88,'rows':_0x29a7de}:null;}})[_0xdc85('0x2a')](respondWithResult(_0x44694b,null))['catch'](handleError(_0x44694b,null));};exports[_0xdc85('0x110')]=function(_0x8f7abc,_0x1bf658,_0x2fa67c){var _0x1cf419=_0x8f7abc['query'][_0xdc85('0x111')]==='false'?_0xdc85('0x112'):_0xdc85('0x113');return db[_0xdc85('0x45')][_0xdc85('0x60')]({'attributes':['id',_0x1cf419],'where':{'id':_0x8f7abc[_0xdc85('0x5d')]['id']}})['then'](handleEntityNotFound(_0x1bf658,null))[_0xdc85('0x2a')](function(_0x55e3e7){if(_0x55e3e7){var _0x1d6cc8=_0x55e3e7[_0x1cf419];var _0x424a96=_0x1d6cc8&&_0x1d6cc8[_0xdc85('0x114')]?_0x1d6cc8['items']:[];_0x1bf658[_0xdc85('0xd0')]({'fromKey':_['isNil'](_0x1d6cc8[_0xdc85('0x115')])?undefined:_0x1d6cc8['fromKey'],'count':_0x424a96[_0xdc85('0x50')],'rows':_0x424a96});}})[_0xdc85('0x33')](handleError(_0x1bf658,null));};exports[_0xdc85('0x116')]=function(_0x312d23,_0x5422f4,_0x595513){var _0x28b7a6={'raw':![],'where':{}};var _0x37964b={};var _0x558f8c={'count':0x0,'rows':[]};return db[_0xdc85('0x45')][_0xdc85('0x6b')]({'where':{'id':_0x312d23[_0xdc85('0x5d')]['id']}})['then'](handleEntityNotFound(_0x5422f4,null))['then'](function(_0x4f8c62){if(_0x4f8c62){_0x37964b[_0xdc85('0x4e')]=_['keys'](db[_0xdc85('0xd7')][_0xdc85('0x46')]);_0x37964b[_0xdc85('0x4a')]=_['keys'](_0x312d23['query']);_0x37964b[_0xdc85('0x4c')]=_[_0xdc85('0x4d')](_0x37964b['model'],_0x37964b['query']);_0x28b7a6[_0xdc85('0x4f')]=_[_0xdc85('0x4d')](_0x37964b[_0xdc85('0x4e')],qs[_0xdc85('0x5e')](_0x312d23[_0xdc85('0x4a')][_0xdc85('0x5e')]));_0x28b7a6[_0xdc85('0x4f')]=_0x28b7a6[_0xdc85('0x4f')]['length']?_0x28b7a6[_0xdc85('0x4f')]:_0x37964b[_0xdc85('0x4e')];if(!_0x312d23[_0xdc85('0x4a')]['hasOwnProperty'](_0xdc85('0x52'))){_0x28b7a6[_0xdc85('0x39')]=qs[_0xdc85('0x39')](_0x312d23[_0xdc85('0x4a')][_0xdc85('0x39')]);_0x28b7a6[_0xdc85('0x38')]=qs['offset'](_0x312d23[_0xdc85('0x4a')][_0xdc85('0x38')]);}_0x28b7a6['order']=qs['sort'](_0x312d23[_0xdc85('0x4a')][_0xdc85('0x54')]);_0x28b7a6[_0xdc85('0x55')]=qs[_0xdc85('0x4c')](_[_0xdc85('0x6c')](_0x312d23['query'],_0x37964b['filters']));_0x28b7a6[_0xdc85('0x55')][_0xdc85('0x68')]=_0x4f8c62['id'];if(_0x312d23[_0xdc85('0x4a')][_0xdc85('0x58')]){_0x28b7a6[_0xdc85('0x55')]=_[_0xdc85('0x56')](_0x28b7a6[_0xdc85('0x55')],{'$or':_[_0xdc85('0x49')](_0x28b7a6[_0xdc85('0x4f')],function(_0x5caecc){var _0x2658b0={};_0x2658b0[_0x5caecc]={'$like':'%'+_0x312d23[_0xdc85('0x4a')]['filter']+'%'};return _0x2658b0;})});}_0x28b7a6=_[_0xdc85('0x56')]({},_0x28b7a6,_0x312d23[_0xdc85('0x59')]);return db['ChatOfflineMessage'][_0xdc85('0x5a')]({'where':_0x28b7a6['where']})[_0xdc85('0x2a')](function(_0x5b7c26){_0x558f8c[_0xdc85('0x5a')]=_0x5b7c26;if(_0x312d23['query'][_0xdc85('0x5f')]){_0x28b7a6[_0xdc85('0x5b')]=[{'all':!![]}];}else{_0x28b7a6['include']=[{'model':db[_0xdc85('0xa0')],'as':_0xdc85('0xe9'),'required':![]}];}return db[_0xdc85('0xd7')][_0xdc85('0x6d')](_0x28b7a6);})[_0xdc85('0x2a')](function(_0x2ea8af){_0x558f8c[_0xdc85('0x5c')]=_0x2ea8af;return _0x558f8c;});}})[_0xdc85('0x2a')](respondWithFilteredResult(_0x5422f4,_0x28b7a6))[_0xdc85('0x33')](handleError(_0x5422f4,null));};exports[_0xdc85('0x117')]=function(_0x26fb03,_0x1f894d,_0x5bc08d){return db[_0xdc85('0x45')][_0xdc85('0x60')]({'where':{'id':_0x26fb03[_0xdc85('0x5d')]['id']}})[_0xdc85('0x2a')](handleEntityNotFound(_0x1f894d,null))[_0xdc85('0x2a')](function(_0x374d50){if(_0x374d50){return _0x374d50['addAgents'](_0x26fb03[_0xdc85('0x62')][_0xdc85('0x6f')],_[_0xdc85('0xe7')](_0x26fb03['body'],['ids','id'])||{})[_0xdc85('0xbc')](function(_0x4d0db0){for(var _0x30e972=0x0;_0x30e972<_0x26fb03[_0xdc85('0x62')][_0xdc85('0x6f')][_0xdc85('0x50')];_0x30e972+=0x1){socket[_0xdc85('0x118')](_0xdc85('0x119'),{'UserId':_0x26fb03['body'][_0xdc85('0x6f')][_0x30e972],'ChatWebsiteId':_0x26fb03['params']['id']});}return _0x4d0db0;});}})['then'](respondWithResult(_0x1f894d,null))[_0xdc85('0x33')](handleError(_0x1f894d,null));};exports[_0xdc85('0x11a')]=function(_0x22de04,_0x52624,_0x14dcdb){return db[_0xdc85('0x45')][_0xdc85('0x60')]({'where':{'id':_0x22de04[_0xdc85('0x5d')]['id']}})[_0xdc85('0x2a')](handleEntityNotFound(_0x52624,null))[_0xdc85('0x2a')](function(_0x8978cc){if(_0x8978cc){return _0x8978cc[_0xdc85('0x11a')](_0x22de04[_0xdc85('0x4a')][_0xdc85('0x6f')])['then'](function(){if(_[_0xdc85('0x11b')](_0x22de04[_0xdc85('0x4a')][_0xdc85('0x6f')])){for(var _0x36aae5=0x0;_0x36aae5<_0x22de04[_0xdc85('0x4a')][_0xdc85('0x6f')][_0xdc85('0x50')];_0x36aae5+=0x1){socket[_0xdc85('0x118')](_0xdc85('0x11c'),{'UserId':Number(_0x22de04['query']['ids'][_0x36aae5]),'ChatWebsiteId':Number(_0x22de04['params']['id'])});}}else{socket['emit'](_0xdc85('0x11c'),{'UserId':Number(_0x22de04[_0xdc85('0x4a')][_0xdc85('0x6f')]),'ChatWebsiteId':Number(_0x22de04['params']['id'])});}});}})[_0xdc85('0x2a')](respondWithStatusCode(_0x52624,null))[_0xdc85('0x33')](handleError(_0x52624,null));};exports[_0xdc85('0x11d')]=function(_0x44bae6,_0x160ab6,_0xb2d8b9){var _0x31ff21={};var _0x34dffe={};var _0x13dbd8;var _0x5a085f;return db[_0xdc85('0x45')][_0xdc85('0x6b')]({'where':{'id':_0x44bae6[_0xdc85('0x5d')]['id']}})[_0xdc85('0x2a')](handleEntityNotFound(_0x160ab6,null))[_0xdc85('0x2a')](function(_0x22ccbe){if(_0x22ccbe){_0x13dbd8=_0x22ccbe;_0x34dffe[_0xdc85('0x4e')]=_[_0xdc85('0x4b')](db[_0xdc85('0xc6')]['rawAttributes']);_0x34dffe[_0xdc85('0x4a')]=_[_0xdc85('0x4b')](_0x44bae6[_0xdc85('0x4a')]);_0x34dffe[_0xdc85('0x4c')]=_[_0xdc85('0x4d')](_0x34dffe[_0xdc85('0x4e')],_0x34dffe[_0xdc85('0x4a')]);_0x31ff21[_0xdc85('0x4f')]=_[_0xdc85('0x4d')](_0x34dffe[_0xdc85('0x4e')],qs[_0xdc85('0x5e')](_0x44bae6['query'][_0xdc85('0x5e')]));_0x31ff21[_0xdc85('0x4f')]=_0x31ff21[_0xdc85('0x4f')][_0xdc85('0x50')]?_0x31ff21[_0xdc85('0x4f')]:_0x34dffe[_0xdc85('0x4e')];_0x31ff21['order']=qs['sort'](_0x44bae6[_0xdc85('0x4a')]['sort']);_0x31ff21[_0xdc85('0x55')]=qs['filters'](_[_0xdc85('0x6c')](_0x44bae6['query'],_0x34dffe[_0xdc85('0x4c')]));if(_0x44bae6[_0xdc85('0x4a')][_0xdc85('0x58')]){_0x31ff21[_0xdc85('0x55')]=_[_0xdc85('0x56')](_0x31ff21[_0xdc85('0x55')],{'$or':_[_0xdc85('0x49')](_0x31ff21['attributes'],function(_0x1b5fbd){var _0x50c1d7={};_0x50c1d7[_0x1b5fbd]={'$like':'%'+_0x44bae6[_0xdc85('0x4a')][_0xdc85('0x58')]+'%'};return _0x50c1d7;})});}_0x31ff21=_[_0xdc85('0x56')]({},_0x31ff21,_0x44bae6['options']);return _0x13dbd8['getAgents'](_0x31ff21);}})[_0xdc85('0x2a')](function(_0x2cf3a3){if(_0x2cf3a3){_0x5a085f=_0x2cf3a3['length'];if(!_0x44bae6['query'][_0xdc85('0x51')](_0xdc85('0x52'))){_0x31ff21[_0xdc85('0x39')]=qs['limit'](_0x44bae6['query'][_0xdc85('0x39')]);_0x31ff21[_0xdc85('0x38')]=qs[_0xdc85('0x38')](_0x44bae6[_0xdc85('0x4a')][_0xdc85('0x38')]);}return _0x13dbd8[_0xdc85('0x11d')](_0x31ff21);}})['then'](function(_0x5da912){if(_0x5da912){return _0x5da912?{'count':_0x5a085f,'rows':_0x5da912}:null;}})['then'](respondWithResult(_0x160ab6,null))[_0xdc85('0x33')](handleError(_0x160ab6,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index f5f4402..24229a6 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 _0x5447=['exports','events','ChatWebsite','setMaxListeners','update','emit','hasOwnProperty','hook'];(function(_0x34b463,_0x10a35b){var _0x4868ea=function(_0x1f39ba){while(--_0x1f39ba){_0x34b463['push'](_0x34b463['shift']());}};_0x4868ea(++_0x10a35b);}(_0x5447,0xf1));var _0x7544=function(_0x5b29b3,_0x18714f){_0x5b29b3=_0x5b29b3-0x0;var _0x30a1e2=_0x5447[_0x5b29b3];return _0x30a1e2;};'use strict';var EventEmitter=require(_0x7544('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x7544('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x7544('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7544('0x3'),'afterDestroy':'remove'};function emitEvent(_0x6e3582){return function(_0x2b18eb,_0xe47f97,_0x340bda){ChatWebsiteEvents[_0x7544('0x4')](_0x6e3582+':'+_0x2b18eb['id'],_0x2b18eb);ChatWebsiteEvents[_0x7544('0x4')](_0x6e3582,_0x2b18eb);_0x340bda(null);};}for(var e in events){if(events[_0x7544('0x5')](e)){var event=events[e];ChatWebsite[_0x7544('0x6')](e,emitEvent(event));}}module[_0x7544('0x7')]=ChatWebsiteEvents; \ No newline at end of file +var _0x008c=['save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatWebsite','setMaxListeners'];(function(_0x499571,_0x5b281a){var _0xc0e247=function(_0x217936){while(--_0x217936){_0x499571['push'](_0x499571['shift']());}};_0xc0e247(++_0x5b281a);}(_0x008c,0x188));var _0xc008=function(_0x2fdce0,_0x496242){_0x2fdce0=_0x2fdce0-0x0;var _0x36f07e=_0x008c[_0x2fdce0];return _0x36f07e;};'use strict';var EventEmitter=require(_0xc008('0x0'));var ChatWebsite=require(_0xc008('0x1'))['db'][_0xc008('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xc008('0x3')](0x0);var events={'afterCreate':_0xc008('0x4'),'afterUpdate':'update','afterDestroy':_0xc008('0x5')};function emitEvent(_0x47063f){return function(_0x10b33c,_0x163bd9,_0x1cbe76){ChatWebsiteEvents[_0xc008('0x6')](_0x47063f+':'+_0x10b33c['id'],_0x10b33c);ChatWebsiteEvents[_0xc008('0x6')](_0x47063f,_0x10b33c);_0x1cbe76(null);};}for(var e in events){if(events[_0xc008('0x7')](e)){var event=events[e];ChatWebsite[_0xc008('0x8')](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 bd710c1..ee7b113 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 _0x702d=['exports','define','ChatWebsite','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x42ae93,_0x2920ec){var _0x48f09f=function(_0xc1c0e4){while(--_0xc1c0e4){_0x42ae93['push'](_0x42ae93['shift']());}};_0x48f09f(++_0x2920ec);}(_0x702d,0x147));var _0xd702=function(_0x33c001,_0x3e915d){_0x33c001=_0x33c001-0x0;var _0x8ac9fa=_0x702d[_0x33c001];return _0x8ac9fa;};'use strict';var _=require(_0xd702('0x0'));var util=require(_0xd702('0x1'));var logger=require(_0xd702('0x2'))(_0xd702('0x3'));var moment=require(_0xd702('0x4'));var BPromise=require('bluebird');var rp=require(_0xd702('0x5'));var fs=require('fs');var path=require(_0xd702('0x6'));var rimraf=require(_0xd702('0x7'));var config=require(_0xd702('0x8'));var attributes=require('./chatWebsite.attributes');module[_0xd702('0x9')]=function(_0x544e94,_0x1aecfc){return _0x544e94[_0xd702('0xa')](_0xd702('0xb'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa45c=['request-promise','rimraf','exports','define','chat_websites','lodash','util','moment'];(function(_0x3a34e8,_0x9b14df){var _0x353cd8=function(_0x3a9127){while(--_0x3a9127){_0x3a34e8['push'](_0x3a34e8['shift']());}};_0x353cd8(++_0x9b14df);}(_0xa45c,0x6d));var _0xca45=function(_0x56e0ef,_0x19be43){_0x56e0ef=_0x56e0ef-0x0;var _0x587f8c=_0xa45c[_0x56e0ef];return _0x587f8c;};'use strict';var _=require(_0xca45('0x0'));var util=require(_0xca45('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xca45('0x2'));var BPromise=require('bluebird');var rp=require(_0xca45('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xca45('0x4'));var config=require('../../config/environment');var attributes=require('./chatWebsite.attributes');module[_0xca45('0x5')]=function(_0x3803d6,_0x18d789){return _0x3803d6[_0xca45('0x6')]('ChatWebsite',attributes,{'tableName':_0xca45('0x7'),'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 e1494da..49e9d18 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 _0x5f2f=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash'];(function(_0x558403,_0x35e2c0){var _0x1ef965=function(_0x247541){while(--_0x247541){_0x558403['push'](_0x558403['shift']());}};_0x1ef965(++_0x35e2c0);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4ad51a,_0x3bf1cd){_0x4ad51a=_0x4ad51a-0x0;var _0x3d714f=_0x5f2f[_0x4ad51a];return _0x3d714f;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});config[_0xf5f2('0xc')]=_[_0xf5f2('0xd')](config['redis'],{'host':_0xf5f2('0xe'),'port':0x18eb});var socket=require(_0xf5f2('0xf'))(new Redis(config[_0xf5f2('0xc')]));require('./chatWebsite.socket')[_0xf5f2('0x10')](socket);function respondWithRpcPromise(_0x15dd7c,_0x218ae3,_0x4e0e6b){return new BPromise(function(_0x977a59,_0x4ebbbe){return client['request'](_0x15dd7c,_0x4e0e6b)[_0xf5f2('0x11')](function(_0x151aba){logger['info'](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));logger[_0xf5f2('0x14')](_0xf5f2('0x15'),_0x218ae3,_0xf5f2('0x13'),JSON[_0xf5f2('0x16')](_0x151aba));if(_0x151aba['error']){if(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x18')]===0x1f4){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')]['message']);return _0x4ebbbe(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);return _0x977a59(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}else{logger[_0xf5f2('0x1a')](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));_0x977a59(_0x151aba[_0xf5f2('0x1b')][_0xf5f2('0x19')]);}})[_0xf5f2('0x1c')](function(_0x3cf5ea){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x3cf5ea);_0x4ebbbe(_0x3cf5ea);});});} \ No newline at end of file +var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','ChatWebsite,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','lodash','util','moment'];(function(_0x9edfd5,_0x286486){var _0x330738=function(_0x4aceb3){while(--_0x4aceb3){_0x9edfd5['push'](_0x9edfd5['shift']());}};_0x330738(++_0x286486);}(_0x2ef3,0xba));var _0x32ef=function(_0x3e5838,_0x558bf4){_0x3e5838=_0x3e5838-0x0;var _0x1d9fe8=_0x2ef3[_0x3e5838];return _0x1d9fe8;};'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});config[_0x32ef('0xa')]=_[_0x32ef('0xb')](config[_0x32ef('0xa')],{'host':_0x32ef('0xc'),'port':0x18eb});var socket=require(_0x32ef('0xd'))(new Redis(config[_0x32ef('0xa')]));require(_0x32ef('0xe'))[_0x32ef('0xf')](socket);function respondWithRpcPromise(_0x28275c,_0x77df79,_0x56eb42){return new BPromise(function(_0x5780e9,_0x401d0b){return client[_0x32ef('0x10')](_0x28275c,_0x56eb42)[_0x32ef('0x11')](function(_0x1499c2){logger['info'](_0x32ef('0x12'),_0x77df79,'request\x20sent');logger[_0x32ef('0x13')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x77df79,_0x32ef('0x14'),JSON[_0x32ef('0x15')](_0x1499c2));if(_0x1499c2['error']){if(_0x1499c2['error'][_0x32ef('0x16')]===0x1f4){logger['error'](_0x32ef('0x12'),_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x401d0b(_0x1499c2[_0x32ef('0x17')]['message']);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x5780e9(_0x1499c2[_0x32ef('0x17')]['message']);}else{logger['info'](_0x32ef('0x12'),_0x77df79,_0x32ef('0x14'));_0x5780e9(_0x1499c2[_0x32ef('0x19')]['message']);}})[_0x32ef('0x1a')](function(_0x33e230){logger['error'](_0x32ef('0x12'),_0x77df79,_0x33e230);_0x401d0b(_0x33e230);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index e044ae9..7fb4630 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 _0x5f2f=['remove','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x58ffb3,_0x5b67aa){var _0x4d8ddd=function(_0x240ca8){while(--_0x240ca8){_0x58ffb3['push'](_0x58ffb3['shift']());}};_0x4d8ddd(++_0x5b67aa);}(_0x5f2f,0x73));var _0xf5f2=function(_0x228d47,_0x1ffae4){_0x228d47=_0x228d47-0x0;var _0x266bc6=_0x5f2f[_0x228d47];return _0x266bc6;};'use strict';var ChatWebsiteEvents=require(_0xf5f2('0x0'));var events=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3')];function createListener(_0x1172dd,_0x174bc7){return function(_0x3c72ee){_0x174bc7[_0xf5f2('0x4')](_0x1172dd,_0x3c72ee);};}function removeListener(_0x501fbd,_0x4854b6){return function(){ChatWebsiteEvents[_0xf5f2('0x5')](_0x501fbd,_0x4854b6);};}exports[_0xf5f2('0x6')]=function(_0xad7f65){for(var _0x3eebf6=0x0,_0x3133bc=events[_0xf5f2('0x7')];_0x3eebf6<_0x3133bc;_0x3eebf6++){var _0x5907aa=events[_0x3eebf6];var _0x466882=createListener(_0xf5f2('0x8')+_0x5907aa,_0xad7f65);ChatWebsiteEvents['on'](_0x5907aa,_0x466882);}}; \ No newline at end of file +var _0xb10b=['emit','removeListener','register','chatWebsite:','./chatWebsite.events','remove','update'];(function(_0xf4add4,_0x5b9cc1){var _0x1c42fb=function(_0x2674c1){while(--_0x2674c1){_0xf4add4['push'](_0xf4add4['shift']());}};_0x1c42fb(++_0x5b9cc1);}(_0xb10b,0x12a));var _0xbb10=function(_0x85fbb2,_0x55d447){_0x85fbb2=_0x85fbb2-0x0;var _0x2c94e5=_0xb10b[_0x85fbb2];return _0x2c94e5;};'use strict';var ChatWebsiteEvents=require(_0xbb10('0x0'));var events=['save',_0xbb10('0x1'),_0xbb10('0x2')];function createListener(_0x1dcb08,_0x4d688c){return function(_0x4541ae){_0x4d688c[_0xbb10('0x3')](_0x1dcb08,_0x4541ae);};}function removeListener(_0x460981,_0x22320e){return function(){ChatWebsiteEvents[_0xbb10('0x4')](_0x460981,_0x22320e);};}exports[_0xbb10('0x5')]=function(_0x481979){for(var _0x328583=0x0,_0x3cdd53=events['length'];_0x328583<_0x3cdd53;_0x328583++){var _0x1b9e94=events[_0x328583];var _0x3fb675=createListener(_0xbb10('0x6')+_0x1b9e94,_0x481979);ChatWebsiteEvents['on'](_0x1b9e94,_0x3fb675);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 978479a..fb17204 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 _0x3cde=['server/files/images/logos/','format','%s-%s','now','/:id/logo','single','file','originalname','/:id/avatar','addAvatar','join','server/files/images/avatars/','addCustomerAvatar','/:id/system_avatar','/:id/notify','notify','/:id/offline','offline','/:id/interactions','addInteraction','addAgents','put','/:id','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','/describe','isAuthenticated','describe','show','/:id/dispositions','getDispositions','getLogo','/:id/customer_avatar','getCustomerAvatar','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','diskStorage','root'];(function(_0x20fb2c,_0x59a53c){var _0x58a638=function(_0x47f643){while(--_0x47f643){_0x20fb2c['push'](_0x20fb2c['shift']());}};_0x58a638(++_0x59a53c);}(_0x3cde,0x1d5));var _0xe3cd=function(_0x332881,_0x4002ca){_0x332881=_0x332881-0x0;var _0x3292b8=_0x3cde[_0x332881];return _0x3292b8;};'use strict';var multer=require(_0xe3cd('0x0'));var util=require(_0xe3cd('0x1'));var path=require(_0xe3cd('0x2'));var timeout=require(_0xe3cd('0x3'));var express=require('express');var router=express[_0xe3cd('0x4')]();var auth=require(_0xe3cd('0x5'));var interaction=require(_0xe3cd('0x6'));var config=require(_0xe3cd('0x7'));var controller=require(_0xe3cd('0x8'));router[_0xe3cd('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe3cd('0x9')](_0xe3cd('0xa'),auth[_0xe3cd('0xb')](),controller[_0xe3cd('0xc')]);router[_0xe3cd('0x9')]('/:id',auth[_0xe3cd('0xb')](),controller[_0xe3cd('0xd')]);router[_0xe3cd('0x9')](_0xe3cd('0xe'),auth[_0xe3cd('0xb')](),controller[_0xe3cd('0xf')]);router[_0xe3cd('0x9')]('/:id/canned_answers',auth[_0xe3cd('0xb')](),controller['getAnswers']);router[_0xe3cd('0x9')]('/:id/logo',controller[_0xe3cd('0x10')]);router[_0xe3cd('0x9')]('/:id/avatar',controller['getAvatar']);router['get'](_0xe3cd('0x11'),controller[_0xe3cd('0x12')]);router[_0xe3cd('0x9')]('/:id/system_avatar',controller['getSystemAvatar']);router[_0xe3cd('0x9')]('/:id/interactions',auth[_0xe3cd('0xb')](),controller['getInteractions']);router['get'](_0xe3cd('0x13'),controller['getSnippet']);router['get'](_0xe3cd('0x14'),auth[_0xe3cd('0xb')](),controller[_0xe3cd('0x15')]);router[_0xe3cd('0x9')](_0xe3cd('0x16'),auth['isAuthenticated'](),controller[_0xe3cd('0x17')]);router['get'](_0xe3cd('0x18'),controller[_0xe3cd('0x19')]);router[_0xe3cd('0x9')]('/:id/offline_messages',auth[_0xe3cd('0xb')](),controller[_0xe3cd('0x1a')]);router[_0xe3cd('0x9')](_0xe3cd('0x1b'),auth[_0xe3cd('0xb')](),controller[_0xe3cd('0x1c')]);router[_0xe3cd('0x1d')]('/',auth[_0xe3cd('0xb')](),controller[_0xe3cd('0x1e')]);router['post']('/:id/dispositions',auth[_0xe3cd('0xb')](),controller[_0xe3cd('0x1f')]);router[_0xe3cd('0x1d')](_0xe3cd('0x20'),auth[_0xe3cd('0xb')](),controller['addAnswer']);var upload=multer({'storage':multer[_0xe3cd('0x21')]({'destination':function(_0x1e858a,_0x55bfde,_0x3c520d){_0x3c520d(null,path['join'](config[_0xe3cd('0x22')],_0xe3cd('0x23')));},'filename':function(_0x3c0342,_0x1161ba,_0x11ef63){_0x11ef63(null,util[_0xe3cd('0x24')](_0xe3cd('0x25'),Date[_0xe3cd('0x26')](),_0x1161ba['originalname']));}})});router['post'](_0xe3cd('0x27'),upload[_0xe3cd('0x28')](_0xe3cd('0x29')),controller['addLogo']);var upload=multer({'storage':multer[_0xe3cd('0x21')]({'destination':function(_0x131ae8,_0x2dbe1a,_0xddb773){_0xddb773(null,path['join'](config[_0xe3cd('0x22')],'server/files/images/avatars/'));},'filename':function(_0x21a2a4,_0x494be7,_0x225ad3){_0x225ad3(null,util[_0xe3cd('0x24')](_0xe3cd('0x25'),Date[_0xe3cd('0x26')](),_0x494be7[_0xe3cd('0x2a')]));}})});router[_0xe3cd('0x1d')](_0xe3cd('0x2b'),upload[_0xe3cd('0x28')](_0xe3cd('0x29')),controller[_0xe3cd('0x2c')]);var upload=multer({'storage':multer[_0xe3cd('0x21')]({'destination':function(_0x59d585,_0x13bc3c,_0x2689e3){_0x2689e3(null,path[_0xe3cd('0x2d')](config['root'],_0xe3cd('0x2e')));},'filename':function(_0xcb9799,_0xfd238e,_0x38c87d){_0x38c87d(null,util[_0xe3cd('0x24')](_0xe3cd('0x25'),Date[_0xe3cd('0x26')](),_0xfd238e['originalname']));}})});router[_0xe3cd('0x1d')]('/:id/customer_avatar',upload['single']('file'),controller[_0xe3cd('0x2f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4cce3c,_0x5653ac,_0x397c90){_0x397c90(null,path[_0xe3cd('0x2d')](config[_0xe3cd('0x22')],_0xe3cd('0x2e')));},'filename':function(_0x1dbfd5,_0x4a6cff,_0x1bbc82){_0x1bbc82(null,util[_0xe3cd('0x24')](_0xe3cd('0x25'),Date[_0xe3cd('0x26')](),_0x4a6cff[_0xe3cd('0x2a')]));}})});router[_0xe3cd('0x1d')](_0xe3cd('0x30'),upload[_0xe3cd('0x28')]('file'),controller['addSystemAvatar']);router[_0xe3cd('0x1d')](_0xe3cd('0x31'),controller[_0xe3cd('0x32')]);router[_0xe3cd('0x1d')](_0xe3cd('0x33'),controller[_0xe3cd('0x34')]);router[_0xe3cd('0x1d')](_0xe3cd('0x35'),auth[_0xe3cd('0xb')](),controller[_0xe3cd('0x36')]);router[_0xe3cd('0x1d')](_0xe3cd('0x14'),auth['isAuthenticated'](),controller['addApplications']);router[_0xe3cd('0x1d')](_0xe3cd('0x16'),auth[_0xe3cd('0xb')](),controller['addProactiveActions']);router['post']('/:id/users',auth[_0xe3cd('0xb')](),controller[_0xe3cd('0x37')]);router[_0xe3cd('0x38')](_0xe3cd('0x39'),auth['isAuthenticated'](),controller['update']);router[_0xe3cd('0x3a')](_0xe3cd('0x39'),auth[_0xe3cd('0xb')](),controller[_0xe3cd('0x3b')]);router[_0xe3cd('0x3a')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xe3cd('0x3c')]);router[_0xe3cd('0x3a')](_0xe3cd('0x20'),auth[_0xe3cd('0xb')](),controller[_0xe3cd('0x3d')]);router[_0xe3cd('0x3a')](_0xe3cd('0x1b'),auth[_0xe3cd('0xb')](),controller[_0xe3cd('0x3e')]);module['exports']=router; \ No newline at end of file +var _0x07bc=['getDispositions','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','getFields','getOfflineMessages','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','/:id/canned_answers','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','single','file','server/files/images/avatars/','originalname','addAvatar','addCustomerAvatar','addSystemAvatar','notify','offline','addInteraction','addApplications','addProactiveActions','addAgents','update','delete','removeDispositions','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x24b15d,_0x468927){var _0x5117b4=function(_0x27ee5f){while(--_0x27ee5f){_0x24b15d['push'](_0x24b15d['shift']());}};_0x5117b4(++_0x468927);}(_0x07bc,0xf4));var _0xc07b=function(_0x2c2f25,_0x92057e){_0x2c2f25=_0x2c2f25-0x0;var _0x3c15a3=_0x07bc[_0x2c2f25];return _0x3c15a3;};'use strict';var multer=require(_0xc07b('0x0'));var util=require(_0xc07b('0x1'));var path=require(_0xc07b('0x2'));var timeout=require(_0xc07b('0x3'));var express=require(_0xc07b('0x4'));var router=express[_0xc07b('0x5')]();var auth=require(_0xc07b('0x6'));var interaction=require(_0xc07b('0x7'));var config=require(_0xc07b('0x8'));var controller=require(_0xc07b('0x9'));router[_0xc07b('0xa')]('/',auth['isAuthenticated'](),controller[_0xc07b('0xb')]);router[_0xc07b('0xa')](_0xc07b('0xc'),auth[_0xc07b('0xd')](),controller[_0xc07b('0xe')]);router[_0xc07b('0xa')](_0xc07b('0xf'),auth[_0xc07b('0xd')](),controller['show']);router['get']('/:id/dispositions',auth[_0xc07b('0xd')](),controller[_0xc07b('0x10')]);router['get']('/:id/canned_answers',auth[_0xc07b('0xd')](),controller['getAnswers']);router[_0xc07b('0xa')](_0xc07b('0x11'),controller[_0xc07b('0x12')]);router[_0xc07b('0xa')](_0xc07b('0x13'),controller['getAvatar']);router[_0xc07b('0xa')](_0xc07b('0x14'),controller[_0xc07b('0x15')]);router[_0xc07b('0xa')](_0xc07b('0x16'),controller[_0xc07b('0x17')]);router['get'](_0xc07b('0x18'),auth['isAuthenticated'](),controller[_0xc07b('0x19')]);router[_0xc07b('0xa')]('/:id/snippet',controller[_0xc07b('0x1a')]);router[_0xc07b('0xa')](_0xc07b('0x1b'),auth[_0xc07b('0xd')](),controller[_0xc07b('0x1c')]);router[_0xc07b('0xa')](_0xc07b('0x1d'),auth['isAuthenticated'](),controller[_0xc07b('0x1e')]);router[_0xc07b('0xa')]('/:id/fields',controller[_0xc07b('0x1f')]);router[_0xc07b('0xa')]('/:id/offline_messages',auth['isAuthenticated'](),controller[_0xc07b('0x20')]);router[_0xc07b('0xa')](_0xc07b('0x21'),auth[_0xc07b('0xd')](),controller[_0xc07b('0x22')]);router[_0xc07b('0x23')]('/',auth[_0xc07b('0xd')](),controller[_0xc07b('0x24')]);router[_0xc07b('0x23')](_0xc07b('0x25'),auth['isAuthenticated'](),controller[_0xc07b('0x26')]);router[_0xc07b('0x23')](_0xc07b('0x27'),auth[_0xc07b('0xd')](),controller[_0xc07b('0x28')]);var upload=multer({'storage':multer[_0xc07b('0x29')]({'destination':function(_0xceade8,_0x196cf8,_0x4c2dc1){_0x4c2dc1(null,path[_0xc07b('0x2a')](config[_0xc07b('0x2b')],_0xc07b('0x2c')));},'filename':function(_0x42a588,_0x2c7e72,_0x508ee7){_0x508ee7(null,util[_0xc07b('0x2d')](_0xc07b('0x2e'),Date[_0xc07b('0x2f')](),_0x2c7e72['originalname']));}})});router[_0xc07b('0x23')](_0xc07b('0x11'),upload[_0xc07b('0x30')](_0xc07b('0x31')),controller['addLogo']);var upload=multer({'storage':multer[_0xc07b('0x29')]({'destination':function(_0x5cbef3,_0x1f8d2d,_0x11efa0){_0x11efa0(null,path[_0xc07b('0x2a')](config['root'],_0xc07b('0x32')));},'filename':function(_0x353280,_0x2560d3,_0x1d5198){_0x1d5198(null,util['format'](_0xc07b('0x2e'),Date['now'](),_0x2560d3[_0xc07b('0x33')]));}})});router[_0xc07b('0x23')](_0xc07b('0x13'),upload[_0xc07b('0x30')](_0xc07b('0x31')),controller[_0xc07b('0x34')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2682b7,_0x9fef91,_0x5ac6bc){_0x5ac6bc(null,path['join'](config[_0xc07b('0x2b')],_0xc07b('0x32')));},'filename':function(_0x4c542b,_0x5cb07e,_0x47293d){_0x47293d(null,util[_0xc07b('0x2d')](_0xc07b('0x2e'),Date[_0xc07b('0x2f')](),_0x5cb07e[_0xc07b('0x33')]));}})});router[_0xc07b('0x23')](_0xc07b('0x14'),upload['single'](_0xc07b('0x31')),controller[_0xc07b('0x35')]);var upload=multer({'storage':multer[_0xc07b('0x29')]({'destination':function(_0x478c27,_0x46616b,_0x43daad){_0x43daad(null,path['join'](config[_0xc07b('0x2b')],'server/files/images/avatars/'));},'filename':function(_0x52c7d6,_0x58a98c,_0x52fb93){_0x52fb93(null,util[_0xc07b('0x2d')](_0xc07b('0x2e'),Date[_0xc07b('0x2f')](),_0x58a98c[_0xc07b('0x33')]));}})});router[_0xc07b('0x23')]('/:id/system_avatar',upload[_0xc07b('0x30')](_0xc07b('0x31')),controller[_0xc07b('0x36')]);router[_0xc07b('0x23')]('/:id/notify',controller[_0xc07b('0x37')]);router['post']('/:id/offline',controller[_0xc07b('0x38')]);router[_0xc07b('0x23')]('/:id/interactions',auth[_0xc07b('0xd')](),controller[_0xc07b('0x39')]);router[_0xc07b('0x23')](_0xc07b('0x1b'),auth[_0xc07b('0xd')](),controller[_0xc07b('0x3a')]);router[_0xc07b('0x23')](_0xc07b('0x1d'),auth[_0xc07b('0xd')](),controller[_0xc07b('0x3b')]);router[_0xc07b('0x23')]('/:id/users',auth['isAuthenticated'](),controller[_0xc07b('0x3c')]);router['put'](_0xc07b('0xf'),auth[_0xc07b('0xd')](),controller[_0xc07b('0x3d')]);router[_0xc07b('0x3e')](_0xc07b('0xf'),auth[_0xc07b('0xd')](),controller['destroy']);router['delete'](_0xc07b('0x25'),auth[_0xc07b('0xd')](),controller[_0xc07b('0x3f')]);router[_0xc07b('0x3e')]('/:id/canned_answers',auth[_0xc07b('0xd')](),controller['removeAnswers']);router[_0xc07b('0x3e')](_0xc07b('0x21'),auth[_0xc07b('0xd')](),controller['removeAgents']);module[_0xc07b('0x40')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 60cbb88..ca2eee2 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 _0x0d58=['STRING','exports','name'];(function(_0x15474c,_0x21bb03){var _0x28e0da=function(_0x5a8d3a){while(--_0x5a8d3a){_0x15474c['push'](_0x15474c['shift']());}};_0x28e0da(++_0x21bb03);}(_0x0d58,0xeb));var _0x80d5=function(_0x48c2ae,_0x4cea90){_0x48c2ae=_0x48c2ae-0x0;var _0x8f7531=_0x0d58[_0x48c2ae];return _0x8f7531;};'use strict';var Sequelize=require('sequelize');module[_0x80d5('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x80d5('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x80d5('0x2')]},'companyId':{'type':Sequelize[_0x80d5('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x80d5('0x2')]},'fax':{'type':Sequelize[_0x80d5('0x2')]},'type':{'type':Sequelize[_0x80d5('0x2')]},'street':{'type':Sequelize[_0x80d5('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x80d5('0x2')]},'country':{'type':Sequelize[_0x80d5('0x2')]},'email':{'type':Sequelize[_0x80d5('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x80d5('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x80d5('0x2')]},'sCity':{'type':Sequelize[_0x80d5('0x2')]},'sCountry':{'type':Sequelize[_0x80d5('0x2')]},'description':{'type':Sequelize[_0x80d5('0x2')]}}; \ No newline at end of file +var _0xf52c=['name','STRING','exports'];(function(_0x1f938d,_0x4f54e){var _0x1aad0c=function(_0x79e464){while(--_0x79e464){_0x1f938d['push'](_0x1f938d['shift']());}};_0x1aad0c(++_0x4f54e);}(_0xf52c,0x13a));var _0xcf52=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf52c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xcf52('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xcf52('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0xcf52('0x2')]},'website':{'type':Sequelize[_0xcf52('0x2')]},'phone':{'type':Sequelize[_0xcf52('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xcf52('0x2')]},'street':{'type':Sequelize[_0xcf52('0x2')]},'postalCode':{'type':Sequelize[_0xcf52('0x2')]},'city':{'type':Sequelize[_0xcf52('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xcf52('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xcf52('0x2')]},'sStreet':{'type':Sequelize[_0xcf52('0x2')]},'sPostalCode':{'type':Sequelize[_0xcf52('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xcf52('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index dadf932..886e7cc 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 _0x291e=['options','includeAll','findAll','rows','catch','show','rawAttributes','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','body','params','addContacts','CmContact','ids','omit','getContacts','findOne','pick','map','html-pdf','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','reject','save','update','then','destroy','Companies','UserProfileResource','stack','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','filter'];(function(_0x420e87,_0x5aedd0){var _0xadf5c2=function(_0x117400){while(--_0x117400){_0x420e87['push'](_0x420e87['shift']());}};_0xadf5c2(++_0x5aedd0);}(_0x291e,0xc4));var _0xe291=function(_0x4114dc,_0x44f750){_0x4114dc=_0x4114dc-0x0;var _0x45b98d=_0x291e[_0x4114dc];return _0x45b98d;};'use strict';var pdf=require(_0xe291('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe291('0x1'));var rp=require(_0xe291('0x2'));var moment=require('moment');var BPromise=require(_0xe291('0x3'));var Mustache=require(_0xe291('0x4'));var util=require('util');var path=require(_0xe291('0x5'));var sox=require('sox');var csv=require(_0xe291('0x6'));var ejs=require(_0xe291('0x7'));var fs=require('fs');var _=require(_0xe291('0x8'));var squel=require(_0xe291('0x9'));var crypto=require('crypto');var jsforce=require(_0xe291('0xa'));var deskjs=require(_0xe291('0xb'));var toCsv=require(_0xe291('0x6'));var querystring=require(_0xe291('0xc'));var Papa=require('papaparse');var Redis=require(_0xe291('0xd'));var authService=require(_0xe291('0xe'));var qs=require(_0xe291('0xf'));var as=require(_0xe291('0x10'));var hardwareService=require(_0xe291('0x11'));var logger=require(_0xe291('0x12'))(_0xe291('0x13'));var utils=require(_0xe291('0x14'));var config=require(_0xe291('0x15'));var db=require(_0xe291('0x16'))['db'];function respondWithStatusCode(_0x489aae,_0x1b776b){_0x1b776b=_0x1b776b||0xcc;return function(_0x245589){if(_0x245589){return _0x489aae[_0xe291('0x17')](_0x1b776b);}return _0x489aae[_0xe291('0x18')](_0x1b776b)[_0xe291('0x19')]();};}function respondWithResult(_0x3047c2,_0x5c4ca0){_0x5c4ca0=_0x5c4ca0||0xc8;return function(_0x5dfd52){if(_0x5dfd52){return _0x3047c2[_0xe291('0x18')](_0x5c4ca0)[_0xe291('0x1a')](_0x5dfd52);}};}function respondWithFilteredResult(_0x1ac52a,_0x2588c6){return function(_0x51be64){if(_0x51be64){var _0x1aaf88=_0x51be64[_0xe291('0x1b')],_0x55c981=_0x2588c6[_0xe291('0x1c')],_0x242ab3=_0x2588c6[_0xe291('0x1c')]+_0x2588c6[_0xe291('0x1d')],_0x455e09;if(_0x242ab3>=_0x1aaf88){_0x242ab3=_0x1aaf88;_0x455e09=0xc8;}else{_0x455e09=0xce;}_0x1ac52a[_0xe291('0x18')](_0x455e09);return _0x1ac52a[_0xe291('0x1e')]('Content-Range',_0x55c981+'-'+_0x242ab3+'/'+_0x1aaf88)[_0xe291('0x1a')](_0x51be64);}return null;};}function patchUpdates(_0xb08a1e){return function(_0x3485c1){try{jsonpatch['apply'](_0x3485c1,_0xb08a1e,!![]);}catch(_0x5e3308){return BPromise[_0xe291('0x1f')](_0x5e3308);}return _0x3485c1[_0xe291('0x20')]();};}function saveUpdates(_0x550d96,_0x44e788){return function(_0x4324ff){if(_0x4324ff){return _0x4324ff[_0xe291('0x21')](_0x550d96)[_0xe291('0x22')](function(_0x3a3014){return _0x3a3014;});}return null;};}function removeEntity(_0x5545cc,_0x2b73f4){return function(_0x1f5d6c){if(_0x1f5d6c){return _0x1f5d6c[_0xe291('0x23')]()[_0xe291('0x22')](function(){var _0xda321b=_0x1f5d6c['get']({'plain':!![]});var _0x381258=_0xe291('0x24');return db[_0xe291('0x25')]['destroy']({'where':{'type':_0x381258,'resourceId':_0xda321b['id']}})[_0xe291('0x22')](function(){return _0x1f5d6c;});})['then'](function(){_0x5545cc[_0xe291('0x18')](0xcc)[_0xe291('0x19')]();});}};}function handleEntityNotFound(_0x132e68,_0x51c8ec){return function(_0x27b2c2){if(!_0x27b2c2){_0x132e68['sendStatus'](0x194);}return _0x27b2c2;};}function handleError(_0x552e0a,_0x1580db){_0x1580db=_0x1580db||0x1f4;return function(_0x3c1eff){logger['error'](_0x3c1eff[_0xe291('0x26')]);if(_0x3c1eff[_0xe291('0x27')]){delete _0x3c1eff[_0xe291('0x27')];}_0x552e0a['status'](_0x1580db)[_0xe291('0x28')](_0x3c1eff);};}exports[_0xe291('0x29')]=function(_0x2957d3,_0x2274e7){var _0x38e28c={},_0x4fa276={},_0x5117b1={'count':0x0,'rows':[]};return db[_0xe291('0x2a')][_0xe291('0x2b')]()[_0xe291('0x22')](function(_0x568b33){_0x4fa276[_0xe291('0x2c')]=_[_0xe291('0x2d')](_0x568b33);_0x4fa276['query']=_[_0xe291('0x2d')](_0x2957d3[_0xe291('0x2e')]);_0x4fa276[_0xe291('0x2f')]=_[_0xe291('0x30')](_0x4fa276['model'],_0x4fa276[_0xe291('0x2e')]);_0x38e28c[_0xe291('0x31')]=_[_0xe291('0x30')](_0x4fa276['model'],qs['fields'](_0x2957d3['query'][_0xe291('0x32')]));_0x38e28c['attributes']=_0x38e28c[_0xe291('0x31')][_0xe291('0x33')]?_0x38e28c[_0xe291('0x31')]:_0x4fa276[_0xe291('0x2c')];if(!_0x2957d3[_0xe291('0x2e')][_0xe291('0x34')](_0xe291('0x35'))){_0x38e28c[_0xe291('0x1d')]=qs[_0xe291('0x1d')](_0x2957d3['query'][_0xe291('0x1d')]);_0x38e28c[_0xe291('0x1c')]=qs[_0xe291('0x1c')](_0x2957d3[_0xe291('0x2e')][_0xe291('0x1c')]);}_0x38e28c[_0xe291('0x36')]=qs[_0xe291('0x37')](_0x2957d3['query']['sort']);_0x38e28c[_0xe291('0x38')]=qs['filters'](_['pick'](_0x2957d3['query'],_0x4fa276[_0xe291('0x2f')]));if(_0x2957d3['query']['filter']){_0x38e28c[_0xe291('0x38')]=_[_0xe291('0x39')](_0x38e28c['where'],{'$or':_['map'](_0x38e28c[_0xe291('0x31')],function(_0x3fba6e){var _0x371dc8={};_0x371dc8[_0x3fba6e]={'$like':'%'+_0x2957d3[_0xe291('0x2e')][_0xe291('0x3a')]+'%'};return _0x371dc8;})});}_0x38e28c=_[_0xe291('0x39')]({},_0x38e28c,_0x2957d3[_0xe291('0x3b')]);var _0x355432={'where':_0x38e28c[_0xe291('0x38')]};return db[_0xe291('0x2a')][_0xe291('0x1b')](_0x355432)['then'](function(_0x54ba6f){_0x5117b1[_0xe291('0x1b')]=_0x54ba6f;if(_0x2957d3[_0xe291('0x2e')][_0xe291('0x3c')]){_0x38e28c['include']=[{'all':!![]}];}return db['CmCompany'][_0xe291('0x3d')](_0x38e28c);})[_0xe291('0x22')](function(_0x52854f){_0x5117b1[_0xe291('0x3e')]=_0x52854f;return _0x5117b1;})[_0xe291('0x22')](respondWithFilteredResult(_0x2274e7,_0x38e28c))[_0xe291('0x3f')](handleError(_0x2274e7,null));})[_0xe291('0x3f')](handleError(_0x2274e7,null));};exports[_0xe291('0x40')]=function(_0x1096e9,_0x32fd72){var _0x2c7a4f={'raw':![],'where':{'id':_0x1096e9['params']['id']}},_0x212a15={};_0x212a15[_0xe291('0x2c')]=_[_0xe291('0x2d')](db[_0xe291('0x2a')][_0xe291('0x41')]);_0x212a15[_0xe291('0x2e')]=_[_0xe291('0x2d')](_0x1096e9[_0xe291('0x2e')]);_0x212a15['filters']=_[_0xe291('0x30')](_0x212a15['model'],_0x212a15[_0xe291('0x2e')]);_0x2c7a4f[_0xe291('0x31')]=_['intersection'](_0x212a15['model'],qs[_0xe291('0x32')](_0x1096e9[_0xe291('0x2e')][_0xe291('0x32')]));_0x2c7a4f[_0xe291('0x31')]=_0x2c7a4f[_0xe291('0x31')][_0xe291('0x33')]?_0x2c7a4f[_0xe291('0x31')]:_0x212a15[_0xe291('0x2c')];if(_0x1096e9[_0xe291('0x2e')][_0xe291('0x3c')]){_0x2c7a4f['include']=[{'all':!![]}];}_0x2c7a4f=_['merge']({},_0x2c7a4f,_0x1096e9['options']);return db['CmCompany'][_0xe291('0x42')](_0x2c7a4f)['then'](handleEntityNotFound(_0x32fd72,null))['then'](respondWithResult(_0x32fd72,null))[_0xe291('0x3f')](handleError(_0x32fd72,null));};exports[_0xe291('0x43')]=function(_0x84ac31,_0x2712d9){return db[_0xe291('0x2a')][_0xe291('0x43')](_0x84ac31['body'],{})[_0xe291('0x22')](function(_0x4545ea){var _0x59354b=_0x84ac31[_0xe291('0x44')][_0xe291('0x45')]({'plain':!![]});if(!_0x59354b)throw new Error(_0xe291('0x46'));if(_0x59354b[_0xe291('0x47')]===_0xe291('0x44')){var _0x40ac00=_0x4545ea['get']({'plain':!![]});var _0x52944d=_0xe291('0x24');return db['UserProfileSection']['find']({'where':{'name':_0x52944d,'userProfileId':_0x59354b[_0xe291('0x48')]},'raw':!![]})['then'](function(_0x51bf63){if(_0x51bf63&&_0x51bf63[_0xe291('0x49')]===0x0){return db[_0xe291('0x25')][_0xe291('0x43')]({'name':_0x40ac00[_0xe291('0x27')],'resourceId':_0x40ac00['id'],'type':_0x51bf63[_0xe291('0x27')],'sectionId':_0x51bf63['id']},{})[_0xe291('0x22')](function(){return _0x4545ea;});}else{return _0x4545ea;}})[_0xe291('0x3f')](function(_0x92f1c){logger[_0xe291('0x4a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x92f1c);throw _0x92f1c;});}return _0x4545ea;})[_0xe291('0x22')](respondWithResult(_0x2712d9,0xc9))[_0xe291('0x3f')](handleError(_0x2712d9,null));};exports[_0xe291('0x21')]=function(_0x405842,_0x547e04){if(_0x405842[_0xe291('0x4b')]['id']){delete _0x405842[_0xe291('0x4b')]['id'];}return db[_0xe291('0x2a')][_0xe291('0x42')]({'where':{'id':_0x405842[_0xe291('0x4c')]['id']}})['then'](handleEntityNotFound(_0x547e04,null))[_0xe291('0x22')](saveUpdates(_0x405842[_0xe291('0x4b')],null))['then'](respondWithResult(_0x547e04,null))[_0xe291('0x3f')](handleError(_0x547e04,null));};exports[_0xe291('0x23')]=function(_0x5f393a,_0x2a21fd){return db[_0xe291('0x2a')][_0xe291('0x42')]({'where':{'id':_0x5f393a[_0xe291('0x4c')]['id']}})[_0xe291('0x22')](handleEntityNotFound(_0x2a21fd,null))[_0xe291('0x22')](removeEntity(_0x2a21fd,null))[_0xe291('0x3f')](handleError(_0x2a21fd,null));};exports[_0xe291('0x2b')]=function(_0x2a13c2,_0x25f482){return db[_0xe291('0x2a')]['describe']()[_0xe291('0x22')](respondWithResult(_0x25f482,null))[_0xe291('0x3f')](handleError(_0x25f482,null));};exports[_0xe291('0x4d')]=function(_0x2f43e7,_0x278718,_0x245daf){return db[_0xe291('0x4e')][_0xe291('0x42')]({'where':{'id':_0x2f43e7[_0xe291('0x4c')]['id']}})[_0xe291('0x22')](handleEntityNotFound(_0x278718,null))[_0xe291('0x22')](function(_0x58bc6a){if(_0x58bc6a){return _0x58bc6a[_0xe291('0x4d')](_0x2f43e7['body'][_0xe291('0x4f')],_[_0xe291('0x50')](_0x2f43e7['body'],['ids','id'])||{});}})[_0xe291('0x22')](respondWithResult(_0x278718,null))[_0xe291('0x3f')](handleError(_0x278718,null));};exports[_0xe291('0x51')]=function(_0x418fc5,_0x54366b,_0x23fca0){var _0x435c67={};var _0x2115c3={};var _0x760003;var _0x1051d7;return db['CmCompany'][_0xe291('0x52')]({'where':{'id':_0x418fc5[_0xe291('0x4c')]['id']}})[_0xe291('0x22')](handleEntityNotFound(_0x54366b,null))[_0xe291('0x22')](function(_0x4739bd){if(_0x4739bd){_0x760003=_0x4739bd;_0x2115c3[_0xe291('0x2c')]=_[_0xe291('0x2d')](db[_0xe291('0x4e')][_0xe291('0x41')]);_0x2115c3[_0xe291('0x2e')]=_['keys'](_0x418fc5[_0xe291('0x2e')]);_0x2115c3['filters']=_['intersection'](_0x2115c3[_0xe291('0x2c')],_0x2115c3['query']);_0x435c67[_0xe291('0x31')]=_[_0xe291('0x30')](_0x2115c3['model'],qs['fields'](_0x418fc5['query'][_0xe291('0x32')]));_0x435c67[_0xe291('0x31')]=_0x435c67[_0xe291('0x31')]['length']?_0x435c67[_0xe291('0x31')]:_0x2115c3[_0xe291('0x2c')];_0x435c67['order']=qs['sort'](_0x418fc5[_0xe291('0x2e')][_0xe291('0x37')]);_0x435c67[_0xe291('0x38')]=qs[_0xe291('0x2f')](_[_0xe291('0x53')](_0x418fc5['query'],_0x2115c3[_0xe291('0x2f')]));if(_0x418fc5[_0xe291('0x2e')][_0xe291('0x3a')]){_0x435c67[_0xe291('0x38')]=_['merge'](_0x435c67[_0xe291('0x38')],{'$or':_[_0xe291('0x54')](_0x435c67[_0xe291('0x31')],function(_0xa0d30a){var _0x780f1d={};_0x780f1d[_0xa0d30a]={'$like':'%'+_0x418fc5['query'][_0xe291('0x3a')]+'%'};return _0x780f1d;})});}_0x435c67=_[_0xe291('0x39')]({},_0x435c67,_0x418fc5['options']);return _0x760003[_0xe291('0x51')](_0x435c67);}})[_0xe291('0x22')](function(_0x22eab5){if(_0x22eab5){_0x1051d7=_0x22eab5[_0xe291('0x33')];if(!_0x418fc5['query'][_0xe291('0x34')](_0xe291('0x35'))){_0x435c67[_0xe291('0x1d')]=qs['limit'](_0x418fc5['query'][_0xe291('0x1d')]);_0x435c67[_0xe291('0x1c')]=qs['offset'](_0x418fc5[_0xe291('0x2e')][_0xe291('0x1c')]);}return _0x760003['getContacts'](_0x435c67);}})['then'](function(_0x4780cc){if(_0x4780cc){return _0x4780cc?{'count':_0x1051d7,'rows':_0x4780cc}:null;}})[_0xe291('0x22')](respondWithResult(_0x54366b,null))[_0xe291('0x3f')](handleError(_0x54366b,null));}; \ No newline at end of file +var _0x1f4c=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','where','map','filter','options','count','findAll','rows','catch','show','includeAll','include','merge','find','create','body','user','Companies','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addContacts','CmContact','omit','ids','getContacts','findOne','rawAttributes','order','html-pdf','eml-format','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','set','Content-Range','reject','update','destroy','then','get','UserProfileResource','error','stack','name','index','CmCompany','describe','model','query'];(function(_0x436abc,_0x9b04f5){var _0x32e9a0=function(_0x498361){while(--_0x498361){_0x436abc['push'](_0x436abc['shift']());}};_0x32e9a0(++_0x9b04f5);}(_0x1f4c,0x127));var _0xc1f4=function(_0x4fe6ed,_0x8372c1){_0x4fe6ed=_0x4fe6ed-0x0;var _0x29029d=_0x1f4c[_0x4fe6ed];return _0x29029d;};'use strict';var pdf=require(_0xc1f4('0x0'));var emlformat=require(_0xc1f4('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc1f4('0x2'));var Mustache=require(_0xc1f4('0x3'));var util=require(_0xc1f4('0x4'));var path=require(_0xc1f4('0x5'));var sox=require(_0xc1f4('0x6'));var csv=require(_0xc1f4('0x7'));var ejs=require(_0xc1f4('0x8'));var fs=require('fs');var _=require(_0xc1f4('0x9'));var squel=require(_0xc1f4('0xa'));var crypto=require(_0xc1f4('0xb'));var jsforce=require(_0xc1f4('0xc'));var deskjs=require(_0xc1f4('0xd'));var toCsv=require(_0xc1f4('0x7'));var querystring=require(_0xc1f4('0xe'));var Papa=require(_0xc1f4('0xf'));var Redis=require(_0xc1f4('0x10'));var authService=require(_0xc1f4('0x11'));var qs=require(_0xc1f4('0x12'));var as=require(_0xc1f4('0x13'));var hardwareService=require(_0xc1f4('0x14'));var logger=require(_0xc1f4('0x15'))('api');var utils=require(_0xc1f4('0x16'));var config=require('../../config/environment');var db=require(_0xc1f4('0x17'))['db'];function respondWithStatusCode(_0x466167,_0x244f87){_0x244f87=_0x244f87||0xcc;return function(_0x43c9df){if(_0x43c9df){return _0x466167[_0xc1f4('0x18')](_0x244f87);}return _0x466167[_0xc1f4('0x19')](_0x244f87)[_0xc1f4('0x1a')]();};}function respondWithResult(_0x804760,_0x5c5975){_0x5c5975=_0x5c5975||0xc8;return function(_0x30893f){if(_0x30893f){return _0x804760[_0xc1f4('0x19')](_0x5c5975)[_0xc1f4('0x1b')](_0x30893f);}};}function respondWithFilteredResult(_0x531e48,_0x3bdb0c){return function(_0x3c373b){if(_0x3c373b){var _0x5eacf8=_0x3c373b['count'],_0x2f4b98=_0x3bdb0c[_0xc1f4('0x1c')],_0x454ba5=_0x3bdb0c['offset']+_0x3bdb0c['limit'],_0x2663ee;if(_0x454ba5>=_0x5eacf8){_0x454ba5=_0x5eacf8;_0x2663ee=0xc8;}else{_0x2663ee=0xce;}_0x531e48[_0xc1f4('0x19')](_0x2663ee);return _0x531e48[_0xc1f4('0x1d')](_0xc1f4('0x1e'),_0x2f4b98+'-'+_0x454ba5+'/'+_0x5eacf8)[_0xc1f4('0x1b')](_0x3c373b);}return null;};}function patchUpdates(_0x38d9f3){return function(_0xf90f8c){try{jsonpatch['apply'](_0xf90f8c,_0x38d9f3,!![]);}catch(_0x3c6a4d){return BPromise[_0xc1f4('0x1f')](_0x3c6a4d);}return _0xf90f8c['save']();};}function saveUpdates(_0x5dda42,_0x3fb0d9){return function(_0x738563){if(_0x738563){return _0x738563[_0xc1f4('0x20')](_0x5dda42)['then'](function(_0x146d99){return _0x146d99;});}return null;};}function removeEntity(_0x25bfcf,_0x4bb8d3){return function(_0x29977d){if(_0x29977d){return _0x29977d[_0xc1f4('0x21')]()[_0xc1f4('0x22')](function(){var _0x560177=_0x29977d[_0xc1f4('0x23')]({'plain':!![]});var _0x3ad76b='Companies';return db[_0xc1f4('0x24')]['destroy']({'where':{'type':_0x3ad76b,'resourceId':_0x560177['id']}})[_0xc1f4('0x22')](function(){return _0x29977d;});})['then'](function(){_0x25bfcf[_0xc1f4('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4628e3,_0x3ced83){return function(_0x180d28){if(!_0x180d28){_0x4628e3[_0xc1f4('0x18')](0x194);}return _0x180d28;};}function handleError(_0x3a2c79,_0x5a775c){_0x5a775c=_0x5a775c||0x1f4;return function(_0x172583){logger[_0xc1f4('0x25')](_0x172583[_0xc1f4('0x26')]);if(_0x172583['name']){delete _0x172583[_0xc1f4('0x27')];}_0x3a2c79[_0xc1f4('0x19')](_0x5a775c)['send'](_0x172583);};}exports[_0xc1f4('0x28')]=function(_0x17e4b5,_0x2c222b){var _0x4534c8={},_0xe53580={},_0x27b710={'count':0x0,'rows':[]};return db[_0xc1f4('0x29')][_0xc1f4('0x2a')]()[_0xc1f4('0x22')](function(_0x46f731){_0xe53580[_0xc1f4('0x2b')]=_['keys'](_0x46f731);_0xe53580[_0xc1f4('0x2c')]=_[_0xc1f4('0x2d')](_0x17e4b5[_0xc1f4('0x2c')]);_0xe53580[_0xc1f4('0x2e')]=_[_0xc1f4('0x2f')](_0xe53580[_0xc1f4('0x2b')],_0xe53580[_0xc1f4('0x2c')]);_0x4534c8[_0xc1f4('0x30')]=_['intersection'](_0xe53580['model'],qs['fields'](_0x17e4b5['query'][_0xc1f4('0x31')]));_0x4534c8[_0xc1f4('0x30')]=_0x4534c8[_0xc1f4('0x30')][_0xc1f4('0x32')]?_0x4534c8[_0xc1f4('0x30')]:_0xe53580['model'];if(!_0x17e4b5['query'][_0xc1f4('0x33')](_0xc1f4('0x34'))){_0x4534c8[_0xc1f4('0x35')]=qs[_0xc1f4('0x35')](_0x17e4b5['query']['limit']);_0x4534c8['offset']=qs[_0xc1f4('0x1c')](_0x17e4b5[_0xc1f4('0x2c')]['offset']);}_0x4534c8['order']=qs[_0xc1f4('0x36')](_0x17e4b5['query'][_0xc1f4('0x36')]);_0x4534c8['where']=qs[_0xc1f4('0x2e')](_[_0xc1f4('0x37')](_0x17e4b5[_0xc1f4('0x2c')],_0xe53580[_0xc1f4('0x2e')]));if(_0x17e4b5[_0xc1f4('0x2c')]['filter']){_0x4534c8[_0xc1f4('0x38')]=_['merge'](_0x4534c8[_0xc1f4('0x38')],{'$or':_[_0xc1f4('0x39')](_0x4534c8[_0xc1f4('0x30')],function(_0x379f07){var _0x45b06c={};_0x45b06c[_0x379f07]={'$like':'%'+_0x17e4b5[_0xc1f4('0x2c')][_0xc1f4('0x3a')]+'%'};return _0x45b06c;})});}_0x4534c8=_['merge']({},_0x4534c8,_0x17e4b5[_0xc1f4('0x3b')]);var _0x6c8ae6={'where':_0x4534c8[_0xc1f4('0x38')]};return db[_0xc1f4('0x29')][_0xc1f4('0x3c')](_0x6c8ae6)[_0xc1f4('0x22')](function(_0x57e85f){_0x27b710[_0xc1f4('0x3c')]=_0x57e85f;if(_0x17e4b5['query']['includeAll']){_0x4534c8['include']=[{'all':!![]}];}return db[_0xc1f4('0x29')][_0xc1f4('0x3d')](_0x4534c8);})['then'](function(_0x29e014){_0x27b710[_0xc1f4('0x3e')]=_0x29e014;return _0x27b710;})[_0xc1f4('0x22')](respondWithFilteredResult(_0x2c222b,_0x4534c8))[_0xc1f4('0x3f')](handleError(_0x2c222b,null));})[_0xc1f4('0x3f')](handleError(_0x2c222b,null));};exports[_0xc1f4('0x40')]=function(_0x23a3da,_0x47b482){var _0x1ac1d1={'raw':![],'where':{'id':_0x23a3da['params']['id']}},_0x573988={};_0x573988[_0xc1f4('0x2b')]=_['keys'](db[_0xc1f4('0x29')]['rawAttributes']);_0x573988[_0xc1f4('0x2c')]=_['keys'](_0x23a3da[_0xc1f4('0x2c')]);_0x573988[_0xc1f4('0x2e')]=_['intersection'](_0x573988[_0xc1f4('0x2b')],_0x573988[_0xc1f4('0x2c')]);_0x1ac1d1[_0xc1f4('0x30')]=_[_0xc1f4('0x2f')](_0x573988[_0xc1f4('0x2b')],qs['fields'](_0x23a3da[_0xc1f4('0x2c')][_0xc1f4('0x31')]));_0x1ac1d1[_0xc1f4('0x30')]=_0x1ac1d1['attributes'][_0xc1f4('0x32')]?_0x1ac1d1[_0xc1f4('0x30')]:_0x573988['model'];if(_0x23a3da[_0xc1f4('0x2c')][_0xc1f4('0x41')]){_0x1ac1d1[_0xc1f4('0x42')]=[{'all':!![]}];}_0x1ac1d1=_[_0xc1f4('0x43')]({},_0x1ac1d1,_0x23a3da[_0xc1f4('0x3b')]);return db[_0xc1f4('0x29')][_0xc1f4('0x44')](_0x1ac1d1)[_0xc1f4('0x22')](handleEntityNotFound(_0x47b482,null))['then'](respondWithResult(_0x47b482,null))[_0xc1f4('0x3f')](handleError(_0x47b482,null));};exports[_0xc1f4('0x45')]=function(_0x2e3164,_0x47dda2){return db[_0xc1f4('0x29')][_0xc1f4('0x45')](_0x2e3164[_0xc1f4('0x46')],{})[_0xc1f4('0x22')](function(_0x3fdb68){var _0x23b72e=_0x2e3164[_0xc1f4('0x47')][_0xc1f4('0x23')]({'plain':!![]});if(!_0x23b72e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x23b72e['role']===_0xc1f4('0x47')){var _0x42b1cd=_0x3fdb68[_0xc1f4('0x23')]({'plain':!![]});var _0x262260=_0xc1f4('0x48');return db['UserProfileSection'][_0xc1f4('0x44')]({'where':{'name':_0x262260,'userProfileId':_0x23b72e[_0xc1f4('0x49')]},'raw':!![]})[_0xc1f4('0x22')](function(_0x193c57){if(_0x193c57&&_0x193c57[_0xc1f4('0x4a')]===0x0){return db['UserProfileResource'][_0xc1f4('0x45')]({'name':_0x42b1cd[_0xc1f4('0x27')],'resourceId':_0x42b1cd['id'],'type':_0x193c57[_0xc1f4('0x27')],'sectionId':_0x193c57['id']},{})[_0xc1f4('0x22')](function(){return _0x3fdb68;});}else{return _0x3fdb68;}})[_0xc1f4('0x3f')](function(_0x2c8605){logger[_0xc1f4('0x25')](_0xc1f4('0x4b'),_0x2c8605);throw _0x2c8605;});}return _0x3fdb68;})[_0xc1f4('0x22')](respondWithResult(_0x47dda2,0xc9))['catch'](handleError(_0x47dda2,null));};exports[_0xc1f4('0x20')]=function(_0x4401a2,_0x118f1c){if(_0x4401a2['body']['id']){delete _0x4401a2[_0xc1f4('0x46')]['id'];}return db[_0xc1f4('0x29')][_0xc1f4('0x44')]({'where':{'id':_0x4401a2['params']['id']}})[_0xc1f4('0x22')](handleEntityNotFound(_0x118f1c,null))[_0xc1f4('0x22')](saveUpdates(_0x4401a2[_0xc1f4('0x46')],null))['then'](respondWithResult(_0x118f1c,null))[_0xc1f4('0x3f')](handleError(_0x118f1c,null));};exports[_0xc1f4('0x21')]=function(_0x51ca9d,_0xf8a9e6){return db[_0xc1f4('0x29')][_0xc1f4('0x44')]({'where':{'id':_0x51ca9d[_0xc1f4('0x4c')]['id']}})[_0xc1f4('0x22')](handleEntityNotFound(_0xf8a9e6,null))['then'](removeEntity(_0xf8a9e6,null))['catch'](handleError(_0xf8a9e6,null));};exports[_0xc1f4('0x2a')]=function(_0x43ff78,_0x51695f){return db['CmCompany'][_0xc1f4('0x2a')]()[_0xc1f4('0x22')](respondWithResult(_0x51695f,null))[_0xc1f4('0x3f')](handleError(_0x51695f,null));};exports[_0xc1f4('0x4d')]=function(_0x258285,_0x41d226,_0x304d21){return db[_0xc1f4('0x4e')]['find']({'where':{'id':_0x258285[_0xc1f4('0x4c')]['id']}})[_0xc1f4('0x22')](handleEntityNotFound(_0x41d226,null))[_0xc1f4('0x22')](function(_0x4dfb4d){if(_0x4dfb4d){return _0x4dfb4d[_0xc1f4('0x4d')](_0x258285[_0xc1f4('0x46')]['ids'],_[_0xc1f4('0x4f')](_0x258285[_0xc1f4('0x46')],[_0xc1f4('0x50'),'id'])||{});}})[_0xc1f4('0x22')](respondWithResult(_0x41d226,null))[_0xc1f4('0x3f')](handleError(_0x41d226,null));};exports[_0xc1f4('0x51')]=function(_0x55aaff,_0xaffe0f,_0x51714a){var _0x499599={};var _0x5eb9d3={};var _0x12ada6;var _0x4ee898;return db[_0xc1f4('0x29')][_0xc1f4('0x52')]({'where':{'id':_0x55aaff[_0xc1f4('0x4c')]['id']}})[_0xc1f4('0x22')](handleEntityNotFound(_0xaffe0f,null))['then'](function(_0x4f0995){if(_0x4f0995){_0x12ada6=_0x4f0995;_0x5eb9d3[_0xc1f4('0x2b')]=_[_0xc1f4('0x2d')](db[_0xc1f4('0x4e')][_0xc1f4('0x53')]);_0x5eb9d3['query']=_[_0xc1f4('0x2d')](_0x55aaff[_0xc1f4('0x2c')]);_0x5eb9d3[_0xc1f4('0x2e')]=_[_0xc1f4('0x2f')](_0x5eb9d3[_0xc1f4('0x2b')],_0x5eb9d3[_0xc1f4('0x2c')]);_0x499599[_0xc1f4('0x30')]=_[_0xc1f4('0x2f')](_0x5eb9d3['model'],qs[_0xc1f4('0x31')](_0x55aaff[_0xc1f4('0x2c')][_0xc1f4('0x31')]));_0x499599['attributes']=_0x499599[_0xc1f4('0x30')][_0xc1f4('0x32')]?_0x499599[_0xc1f4('0x30')]:_0x5eb9d3[_0xc1f4('0x2b')];_0x499599[_0xc1f4('0x54')]=qs[_0xc1f4('0x36')](_0x55aaff[_0xc1f4('0x2c')][_0xc1f4('0x36')]);_0x499599['where']=qs[_0xc1f4('0x2e')](_['pick'](_0x55aaff[_0xc1f4('0x2c')],_0x5eb9d3[_0xc1f4('0x2e')]));if(_0x55aaff[_0xc1f4('0x2c')]['filter']){_0x499599[_0xc1f4('0x38')]=_[_0xc1f4('0x43')](_0x499599[_0xc1f4('0x38')],{'$or':_['map'](_0x499599[_0xc1f4('0x30')],function(_0x5b1e34){var _0x415650={};_0x415650[_0x5b1e34]={'$like':'%'+_0x55aaff[_0xc1f4('0x2c')][_0xc1f4('0x3a')]+'%'};return _0x415650;})});}_0x499599=_[_0xc1f4('0x43')]({},_0x499599,_0x55aaff[_0xc1f4('0x3b')]);return _0x12ada6[_0xc1f4('0x51')](_0x499599);}})[_0xc1f4('0x22')](function(_0x42d05a){if(_0x42d05a){_0x4ee898=_0x42d05a[_0xc1f4('0x32')];if(!_0x55aaff[_0xc1f4('0x2c')][_0xc1f4('0x33')](_0xc1f4('0x34'))){_0x499599[_0xc1f4('0x35')]=qs['limit'](_0x55aaff[_0xc1f4('0x2c')]['limit']);_0x499599[_0xc1f4('0x1c')]=qs['offset'](_0x55aaff[_0xc1f4('0x2c')][_0xc1f4('0x1c')]);}return _0x12ada6['getContacts'](_0x499599);}})[_0xc1f4('0x22')](function(_0x2beaa1){if(_0x2beaa1){return _0x2beaa1?{'count':_0x4ee898,'rows':_0x2beaa1}:null;}})[_0xc1f4('0x22')](respondWithResult(_0xaffe0f,null))[_0xc1f4('0x3f')](handleError(_0xaffe0f,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 3269523..b7bb1a0 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 _0xde6c=['cm_companies','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmCompany.attributes'];(function(_0x228b7c,_0x26c319){var _0x196297=function(_0x3a2c99){while(--_0x3a2c99){_0x228b7c['push'](_0x228b7c['shift']());}};_0x196297(++_0x26c319);}(_0xde6c,0x119));var _0xcde6=function(_0xf8769b,_0xb5b74e){_0xf8769b=_0xf8769b-0x0;var _0x197c18=_0xde6c[_0xf8769b];return _0x197c18;};'use strict';var _=require(_0xcde6('0x0'));var util=require(_0xcde6('0x1'));var logger=require('../../config/logger')(_0xcde6('0x2'));var moment=require(_0xcde6('0x3'));var BPromise=require(_0xcde6('0x4'));var rp=require(_0xcde6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcde6('0x6'));var config=require(_0xcde6('0x7'));var attributes=require(_0xcde6('0x8'));module['exports']=function(_0x430ed4,_0xed7d8d){return _0x430ed4['define']('CmCompany',attributes,{'tableName':_0xcde6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x446c=['lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','cm_companies'];(function(_0x442835,_0x1d33ea){var _0x640d87=function(_0x436841){while(--_0x436841){_0x442835['push'](_0x442835['shift']());}};_0x640d87(++_0x1d33ea);}(_0x446c,0x156));var _0xc446=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0x446c[_0x2f1762];return _0x8ab21;};'use strict';var _=require(_0xc446('0x0'));var util=require(_0xc446('0x1'));var logger=require(_0xc446('0x2'))(_0xc446('0x3'));var moment=require('moment');var BPromise=require(_0xc446('0x4'));var rp=require(_0xc446('0x5'));var fs=require('fs');var path=require(_0xc446('0x6'));var rimraf=require('rimraf');var config=require(_0xc446('0x7'));var attributes=require('./cmCompany.attributes');module['exports']=function(_0x115a9e,_0x235050){return _0x115a9e['define']('CmCompany',attributes,{'tableName':_0xc446('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index ab5172f..60dac0d 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 _0x6029=['message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x6029,0x183));var _0x9602=function(_0x30f016,_0x9170ce){_0x30f016=_0x30f016-0x0;var _0x12f876=_0x6029[_0x30f016];return _0x12f876;};'use strict';var _=require(_0x9602('0x0'));var util=require(_0x9602('0x1'));var moment=require(_0x9602('0x2'));var BPromise=require('bluebird');var rs=require(_0x9602('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9602('0x4'))['db'];var utils=require(_0x9602('0x5'));var logger=require(_0x9602('0x6'))(_0x9602('0x7'));var config=require(_0x9602('0x8'));var jayson=require(_0x9602('0x9'));var client=jayson[_0x9602('0xa')][_0x9602('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24b2a8,_0x477f6f,_0x4c7aa9){return new BPromise(function(_0x282b6c,_0x1d9299){return client[_0x9602('0xc')](_0x24b2a8,_0x4c7aa9)[_0x9602('0xd')](function(_0x1c6076){logger[_0x9602('0xe')](_0x9602('0xf'),_0x477f6f,_0x9602('0x10'));logger[_0x9602('0x11')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x477f6f,'request\x20sent',JSON[_0x9602('0x12')](_0x1c6076));if(_0x1c6076['error']){if(_0x1c6076[_0x9602('0x13')][_0x9602('0x14')]===0x1f4){logger[_0x9602('0x13')](_0x9602('0xf'),_0x477f6f,_0x1c6076[_0x9602('0x13')][_0x9602('0x15')]);return _0x1d9299(_0x1c6076['error']['message']);}logger[_0x9602('0x13')](_0x9602('0xf'),_0x477f6f,_0x1c6076[_0x9602('0x13')][_0x9602('0x15')]);return _0x282b6c(_0x1c6076['error'][_0x9602('0x15')]);}else{logger[_0x9602('0xe')](_0x9602('0xf'),_0x477f6f,'request\x20sent');_0x282b6c(_0x1c6076[_0x9602('0x16')][_0x9602('0x15')]);}})[_0x9602('0x17')](function(_0x57b5d6){logger[_0x9602('0x13')]('CmCompany,\x20%s,\x20%s',_0x477f6f,_0x57b5d6);_0x1d9299(_0x57b5d6);});});} \ No newline at end of file +var _0x021a=['CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','moment','bluebird','../../config/utils','../../config/logger','rpc','client','http','request','then'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x021a,0x97));var _0xa021=function(_0x3fd073,_0x32931f){_0x3fd073=_0x3fd073-0x0;var _0x40d7b1=_0x021a[_0x3fd073];return _0x40d7b1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa021('0x0'));var BPromise=require(_0xa021('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa021('0x2'));var logger=require(_0xa021('0x3'))(_0xa021('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa021('0x5')][_0xa021('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x386634,_0x53c4ec,_0x19f52c){return new BPromise(function(_0x1488ce,_0x4eabcd){return client[_0xa021('0x7')](_0x386634,_0x19f52c)[_0xa021('0x8')](function(_0x2587a1){logger['info'](_0xa021('0x9'),_0x53c4ec,'request\x20sent');logger[_0xa021('0xa')](_0xa021('0xb'),_0x53c4ec,'request\x20sent',JSON[_0xa021('0xc')](_0x2587a1));if(_0x2587a1[_0xa021('0xd')]){if(_0x2587a1[_0xa021('0xd')][_0xa021('0xe')]===0x1f4){logger['error']('CmCompany,\x20%s,\x20%s',_0x53c4ec,_0x2587a1['error'][_0xa021('0xf')]);return _0x4eabcd(_0x2587a1[_0xa021('0xd')][_0xa021('0xf')]);}logger['error']('CmCompany,\x20%s,\x20%s',_0x53c4ec,_0x2587a1[_0xa021('0xd')][_0xa021('0xf')]);return _0x1488ce(_0x2587a1[_0xa021('0xd')][_0xa021('0xf')]);}else{logger[_0xa021('0x10')]('CmCompany,\x20%s,\x20%s',_0x53c4ec,_0xa021('0x11'));_0x1488ce(_0x2587a1[_0xa021('0x12')]['message']);}})[_0xa021('0x13')](function(_0x4b88f9){logger['error'](_0xa021('0x9'),_0x53c4ec,_0x4b88f9);_0x4eabcd(_0x4b88f9);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index b467ef2..ba5f038 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 _0x4325=['util','connect-timeout','express','Router','../../config/environment','./cmCompany.controller','get','index','isAuthenticated','/:id','show','post','create','addContacts','put','update','delete','destroy','multer'];(function(_0x53dc44,_0x202f17){var _0x42482d=function(_0x5b575b){while(--_0x5b575b){_0x53dc44['push'](_0x53dc44['shift']());}};_0x42482d(++_0x202f17);}(_0x4325,0x1da));var _0x5432=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x4325[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require(_0x5432('0x0'));var util=require(_0x5432('0x1'));var path=require('path');var timeout=require(_0x5432('0x2'));var express=require(_0x5432('0x3'));var router=express[_0x5432('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5432('0x5'));var controller=require(_0x5432('0x6'));router[_0x5432('0x7')]('/',auth['isAuthenticated'](),controller[_0x5432('0x8')]);router[_0x5432('0x7')]('/describe',auth[_0x5432('0x9')](),controller['describe']);router[_0x5432('0x7')](_0x5432('0xa'),auth[_0x5432('0x9')](),controller[_0x5432('0xb')]);router[_0x5432('0x7')]('/:id/contacts',auth[_0x5432('0x9')](),controller['getContacts']);router[_0x5432('0xc')]('/',auth[_0x5432('0x9')](),controller[_0x5432('0xd')]);router[_0x5432('0xc')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x5432('0xe')]);router[_0x5432('0xf')]('/:id',auth[_0x5432('0x9')](),controller[_0x5432('0x10')]);router[_0x5432('0x11')](_0x5432('0xa'),auth[_0x5432('0x9')](),controller[_0x5432('0x12')]);module['exports']=router; \ No newline at end of file +var _0x4bd3=['/describe','get','/:id','show','/:id/contacts','getContacts','post','create','update','delete','destroy','exports','multer','path','connect-timeout','../../components/interaction/service','../../config/environment','./cmCompany.controller','isAuthenticated','index'];(function(_0x224f65,_0x4750bf){var _0x3f921c=function(_0x1b5f64){while(--_0x1b5f64){_0x224f65['push'](_0x224f65['shift']());}};_0x3f921c(++_0x4750bf);}(_0x4bd3,0x174));var _0x34bd=function(_0x401ced,_0x170b0a){_0x401ced=_0x401ced-0x0;var _0x3f3c0f=_0x4bd3[_0x401ced];return _0x3f3c0f;};'use strict';var multer=require(_0x34bd('0x0'));var util=require('util');var path=require(_0x34bd('0x1'));var timeout=require(_0x34bd('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x34bd('0x3'));var config=require(_0x34bd('0x4'));var controller=require(_0x34bd('0x5'));router['get']('/',auth[_0x34bd('0x6')](),controller[_0x34bd('0x7')]);router['get'](_0x34bd('0x8'),auth[_0x34bd('0x6')](),controller['describe']);router[_0x34bd('0x9')](_0x34bd('0xa'),auth[_0x34bd('0x6')](),controller[_0x34bd('0xb')]);router[_0x34bd('0x9')](_0x34bd('0xc'),auth['isAuthenticated'](),controller[_0x34bd('0xd')]);router[_0x34bd('0xe')]('/',auth[_0x34bd('0x6')](),controller[_0x34bd('0xf')]);router['post']('/:id/contacts',auth[_0x34bd('0x6')](),controller['addContacts']);router['put'](_0x34bd('0xa'),auth[_0x34bd('0x6')](),controller[_0x34bd('0x10')]);router[_0x34bd('0x11')](_0x34bd('0xa'),auth[_0x34bd('0x6')](),controller[_0x34bd('0x12')]);module[_0x34bd('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 98341b3..31356bd 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 _0xa921=['NOW','lodash','sequelize','exports','STRING','INTEGER','UNSIGNED','DATE'];(function(_0x4cc82d,_0x36b332){var _0x260db9=function(_0x585f75){while(--_0x585f75){_0x4cc82d['push'](_0x4cc82d['shift']());}};_0x260db9(++_0x36b332);}(_0xa921,0xd9));var _0x1a92=function(_0x14753f,_0x5c6226){_0x14753f=_0x14753f-0x0;var _0x502ef5=_0xa921[_0x14753f];return _0x502ef5;};'use strict';var _=require(_0x1a92('0x0'));var Sequelize=require(_0x1a92('0x1'));module[_0x1a92('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x1a92('0x3')]},'street':{'type':Sequelize[_0x1a92('0x3')]},'postalCode':{'type':Sequelize[_0x1a92('0x3')]},'city':{'type':Sequelize[_0x1a92('0x3')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x1a92('0x3')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x1a92('0x3')]},'mobile':{'type':Sequelize[_0x1a92('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x1a92('0x3')]},'url':{'type':Sequelize[_0x1a92('0x3')]},'facebook':{'type':Sequelize[_0x1a92('0x3')]},'fb_data':{'type':Sequelize[_0x1a92('0x3')]},'twitter':{'type':Sequelize[_0x1a92('0x3')]},'skype':{'type':Sequelize[_0x1a92('0x3')]},'teams':{'type':Sequelize[_0x1a92('0x3')]},'viber':{'type':Sequelize[_0x1a92('0x3')]},'line':{'type':Sequelize[_0x1a92('0x3')]},'wechat':{'type':Sequelize[_0x1a92('0x3')]},'telegram':{'type':Sequelize[_0x1a92('0x3')]},'UserId':{'type':Sequelize[_0x1a92('0x4')]},'priority':{'type':Sequelize[_0x1a92('0x4')](0x2)[_0x1a92('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x1a92('0x6')],'defaultValue':Sequelize[_0x1a92('0x7')]}}; \ No newline at end of file +var _0x2ec4=['exports','STRING','TEXT','INTEGER','DATE','lodash','sequelize'];(function(_0x2f71d1,_0x165981){var _0x310a83=function(_0x227556){while(--_0x227556){_0x2f71d1['push'](_0x2f71d1['shift']());}};_0x310a83(++_0x165981);}(_0x2ec4,0xde));var _0x42ec=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x2ec4[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0x42ec('0x0'));var Sequelize=require(_0x42ec('0x1'));module[_0x42ec('0x2')]={'firstName':{'type':Sequelize[_0x42ec('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x42ec('0x3')]},'street':{'type':Sequelize[_0x42ec('0x3')]},'postalCode':{'type':Sequelize[_0x42ec('0x3')]},'city':{'type':Sequelize[_0x42ec('0x3')]},'country':{'type':Sequelize[_0x42ec('0x3')]},'dateOfBirth':{'type':Sequelize[_0x42ec('0x3')]},'description':{'type':Sequelize[_0x42ec('0x4')]},'phone':{'type':Sequelize[_0x42ec('0x3')]},'mobile':{'type':Sequelize[_0x42ec('0x3')]},'fax':{'type':Sequelize[_0x42ec('0x3')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x42ec('0x3')]},'facebook':{'type':Sequelize[_0x42ec('0x3')]},'fb_data':{'type':Sequelize[_0x42ec('0x3')]},'twitter':{'type':Sequelize[_0x42ec('0x3')]},'skype':{'type':Sequelize[_0x42ec('0x3')]},'teams':{'type':Sequelize[_0x42ec('0x3')]},'viber':{'type':Sequelize[_0x42ec('0x3')]},'line':{'type':Sequelize[_0x42ec('0x3')]},'wechat':{'type':Sequelize[_0x42ec('0x3')]},'telegram':{'type':Sequelize[_0x42ec('0x3')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0x42ec('0x5')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x42ec('0x6')],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 7858573..c459438 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 _0x3748=['push','CmCustomField','findOne','trimStart','all','type','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','select','field','color','from','tools_tags','cm_contacts','left_join','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','conditions','find','Tag','value','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','and','fieldType','datetime','castTo','DATE','buildExpression','text','start','filter','Contact','isEmpty','ListId','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','isArray','tag','replace','\x27\x27\x27\x27','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','DESC','having','resolve','some','user','getLists','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','sequelize','toString','merge','fields','c.firstName','c.lastName','c.phone','c.fax','c.email','c.deletedAt','TagIds','Tags','rows','catch','params','tags','startsWith','displayName','columnName','alias','values','body','get','mergeWith','join','info','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatMessage','MailMessage','MailInteraction','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','each','duplicates','findOrCreate','spread','error','$and','findAll','omit','format','cf_%d','setFields','toParam','phone','getTags','model','rawAttributes','pick','options','setTags','ids','getHoppers','ContactId','includeAll','include','getHopperHistories','getHopperFinals','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_keys','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','filename','chmodSync','0777','fork','pid','upload','file','meta','import','agent','binding','socket_timestamp','../../components/import/cm/csv2','stringify','message','exit','html-pdf','rimraf','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./cmContact.socket','register','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','CmContact','describe','keys','cf_'];(function(_0x4ab768,_0x585ba3){var _0xafc975=function(_0x3c199e){while(--_0x3c199e){_0x4ab768['push'](_0x4ab768['shift']());}};_0xafc975(++_0x585ba3);}(_0x3748,0xbb));var _0x8374=function(_0xb4c987,_0x541730){_0xb4c987=_0xb4c987-0x0;var _0x1b69ca=_0x3748[_0xb4c987];return _0x1b69ca;};'use strict';var pdf=require(_0x8374('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8374('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8374('0x2'));var moment=require('moment');var BPromise=require(_0x8374('0x3'));var Mustache=require(_0x8374('0x4'));var util=require(_0x8374('0x5'));var path=require(_0x8374('0x6'));var sox=require('sox');var csv=require(_0x8374('0x7'));var ejs=require(_0x8374('0x8'));var fs=require('fs');var _=require(_0x8374('0x9'));var squel=require(_0x8374('0xa'));var crypto=require(_0x8374('0xb'));var jsforce=require(_0x8374('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8374('0x7'));var querystring=require(_0x8374('0xd'));var Papa=require(_0x8374('0xe'));var Redis=require('ioredis');var authService=require(_0x8374('0xf'));var qs=require(_0x8374('0x10'));var as=require(_0x8374('0x11'));var hardwareService=require(_0x8374('0x12'));var logger=require('../../config/logger')(_0x8374('0x13'));var utils=require(_0x8374('0x14'));var config=require(_0x8374('0x15'));var db=require(_0x8374('0x16'))['db'];config[_0x8374('0x17')]=_[_0x8374('0x18')](config[_0x8374('0x17')],{'host':_0x8374('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8374('0x17')]));require(_0x8374('0x1a'))[_0x8374('0x1b')](socket);function respondWithStatusCode(_0x2f4c28,_0x58a432){_0x58a432=_0x58a432||0xcc;return function(_0x17efe0){if(_0x17efe0){return _0x2f4c28[_0x8374('0x1c')](_0x58a432);}return _0x2f4c28[_0x8374('0x1d')](_0x58a432)[_0x8374('0x1e')]();};}function respondWithResult(_0x24043e,_0xf29180){_0xf29180=_0xf29180||0xc8;return function(_0x3bc489){if(_0x3bc489){return _0x24043e[_0x8374('0x1d')](_0xf29180)[_0x8374('0x1f')](_0x3bc489);}};}function respondWithFilteredResult(_0x521526,_0x37798a){return function(_0x909d){if(_0x909d){var _0x412f6e=_0x909d[_0x8374('0x20')],_0x5d117a=_0x37798a['offset'],_0x3661eb=_0x37798a[_0x8374('0x21')]+_0x37798a['limit'],_0x657057;if(_0x3661eb>=_0x412f6e){_0x3661eb=_0x412f6e;_0x657057=0xc8;}else{_0x657057=0xce;}_0x521526[_0x8374('0x1d')](_0x657057);return _0x521526[_0x8374('0x22')](_0x8374('0x23'),_0x5d117a+'-'+_0x3661eb+'/'+_0x412f6e)[_0x8374('0x1f')](_0x909d);}return null;};}function patchUpdates(_0x5e2885){return function(_0x68d46a){try{jsonpatch[_0x8374('0x24')](_0x68d46a,_0x5e2885,!![]);}catch(_0x467150){return BPromise[_0x8374('0x25')](_0x467150);}return _0x68d46a['save']();};}function saveUpdates(_0x186d2e,_0x1a3569){return function(_0x20e99f){if(_0x20e99f){return _0x20e99f[_0x8374('0x26')](_0x186d2e)[_0x8374('0x27')](function(_0xabd73f){return _0xabd73f;});}return null;};}function removeEntity(_0xf68870,_0xc310a6){return function(_0x2ce93c){if(_0x2ce93c){return _0x2ce93c[_0x8374('0x28')]()[_0x8374('0x27')](function(){_0xf68870[_0x8374('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18c26f,_0x52fc51){return function(_0x20e8b0){if(!_0x20e8b0){_0x18c26f[_0x8374('0x1c')](0x194);}return _0x20e8b0;};}function handleError(_0x1e1dc9,_0x1593e0){_0x1593e0=_0x1593e0||0x1f4;return function(_0x5b36e5){logger['error'](_0x5b36e5[_0x8374('0x29')]);if(_0x5b36e5[_0x8374('0x2a')]){delete _0x5b36e5[_0x8374('0x2a')];}_0x1e1dc9[_0x8374('0x1d')](_0x1593e0)[_0x8374('0x2b')](_0x5b36e5);};}exports[_0x8374('0x2c')]=function(_0x130ff9,_0x1d9401){var _0x32f013={},_0x3695e2={},_0x3d5601={'count':0x0,'rows':[]};return db[_0x8374('0x2d')][_0x8374('0x2e')]()[_0x8374('0x27')](function(_0x28774c){var _0x121b16=[];for(var _0x2f3bcd=0x0;_0x2f3bcd0x1){_0x275cc4['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x8374('0x6b')](_0x263935),null);}else{if(qs[_0x8374('0x6c')](_0x263935)){_0x275cc4['or'](_0x8374('0x6d'),_0x263935+'%');_0x275cc4['or'](_0x8374('0x6e'),_0x263935+'%');_0x275cc4['or'](_0x8374('0x6f'),_0x263935+'%');_0x275cc4['or'](_0x8374('0x70'),_0x263935+'%');}else if(qs[_0x8374('0x71')](_0x263935)){_0x275cc4['or'](_0x8374('0x72'),_0x263935+'%');}else{_0x275cc4['or'](_0x8374('0x73'),'%'+_0x263935+'%');_0x275cc4['or'](_0x8374('0x74'),'%'+_0x263935+'%');_0x275cc4['or'](_0x8374('0x72'),'%'+_0x263935+'%');}}}}_0x31882b['where'](_0x275cc4);_0x31882b[_0x8374('0x75')](_0x8374('0x76'));var _0x1ae854={'type':db[_0x8374('0x77')][_0x8374('0x78')][_0x8374('0x79')],'raw':!![]};var _0x11fafc=_0x31882b[_0x8374('0x7a')]()[_0x8374('0x43')](_0x8374('0x76'));if(_0x32f013[_0x8374('0x3f')]){_0x32f013['order'][_0x8374('0x55')](function(_0x29131d){_0x31882b[_0x8374('0x3f')]('c.'+_0x29131d[0x0],_0x29131d[0x1]===_0x8374('0x7b')?![]:!![]);});}if(!_[_0x8374('0x62')](_0x482b39)){_0x31882b[_0x8374('0x7c')](_0x354dea);_0x11fafc[_0x8374('0x41')]('t.id\x20IN\x20?',_0x482b39);}BPromise[_0x8374('0x7d')]()[_0x8374('0x27')](function(){if(_0x407d78&&!_[_0x8374('0x7e')](_0x407d78['conditions'],[_0x8374('0x43'),_0x8374('0x57')])){return _0x130ff9[_0x8374('0x7f')][_0x8374('0x80')]({'attributes':['id'],'raw':!![]})[_0x8374('0x27')](function(_0x52cc43){if(_['isEmpty'](_0x52cc43)){_0x11fafc[_0x8374('0x41')](_0x8374('0x81'));_0x31882b[_0x8374('0x41')](_0x8374('0x81'));}else{_0x11fafc[_0x8374('0x41')](_0x8374('0x82'),_[_0x8374('0x54')](_0x52cc43,'id'));_0x31882b['where'](_0x8374('0x82'),_[_0x8374('0x54')](_0x52cc43,'id'));}});}else{return;}})['then'](function(){db[_0x8374('0x83')][_0x8374('0x37')](_0x11fafc[_0x8374('0x84')](),_0x1ae854)[_0x8374('0x27')](function(_0x431c8f){_0x3d5601[_0x8374('0x20')]=_0x431c8f[_0x8374('0x3b')];if(_0x3d5601[_0x8374('0x20')]===0x0)return[];return db[_0x8374('0x83')][_0x8374('0x37')](_0x3dc596['toString'](),_0x1ae854);})['then'](function(_0xc0eaa7){_0x8c2b7a=_['keyBy'](_0xc0eaa7,'id');_0x1ae854=_[_0x8374('0x85')](_0x1ae854,{'model':db[_0x8374('0x2d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x130ff9['query'][_0x8374('0x86')]){_0x32f013[_0x8374('0x3a')][_0x8374('0x55')](function(_0x268f5f){_0x31882b[_0x8374('0x43')]('c.'+_0x268f5f);});}else{_0x31882b[_0x8374('0x43')](_0x8374('0x76'));_0x31882b['field'](_0x8374('0x87'));_0x31882b['field'](_0x8374('0x88'));_0x31882b[_0x8374('0x43')](_0x8374('0x89'));_0x31882b[_0x8374('0x43')]('c.mobile');_0x31882b['field'](_0x8374('0x8a'));_0x31882b[_0x8374('0x43')](_0x8374('0x8b'));_0x31882b[_0x8374('0x43')]('c.ListId');_0x31882b[_0x8374('0x43')](_0x8374('0x8c'));_0x31882b[_0x8374('0x43')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x8374('0x8d'));}if(_0x32f013[_0x8374('0x3e')])_0x31882b[_0x8374('0x3e')](_0x32f013[_0x8374('0x3e')]);if(_0x32f013['offset'])_0x31882b[_0x8374('0x21')](_0x32f013['offset']);return db['sequelize'][_0x8374('0x37')](_0x31882b[_0x8374('0x84')](),_0x1ae854);})['then'](function(_0x33f2aa){_0x33f2aa[_0x8374('0x55')](function(_0x2dfc4e){if(_0x2dfc4e[_0x8374('0x8d')]){_0x2dfc4e[_0x8374('0x8e')]=[];_0x2dfc4e[_0x8374('0x8d')][_0x8374('0x53')](',')[_0x8374('0x55')](function(_0x5d3757){_0x2dfc4e[_0x8374('0x8e')][_0x8374('0x31')](_0x8c2b7a[_0x5d3757]);});}delete _0x2dfc4e[_0x8374('0x8d')];});_0x3d5601[_0x8374('0x8f')]=_0x33f2aa;return _0x3d5601;})[_0x8374('0x27')](respondWithFilteredResult(_0x1d9401,_0x32f013));});})[_0x8374('0x90')](handleError(_0x1d9401,null));};exports[_0x8374('0x28')]=function(_0x1f6e4f,_0x2ef718){return db[_0x8374('0x2d')][_0x8374('0x50')]({'where':{'id':_0x1f6e4f[_0x8374('0x91')]['id']}})[_0x8374('0x27')](handleEntityNotFound(_0x2ef718,null))[_0x8374('0x27')](removeEntity(_0x2ef718,null))['catch'](handleError(_0x2ef718,null));};exports[_0x8374('0x2e')]=function(_0xed6035,_0x3d4e50){return db['CmContact'][_0x8374('0x2e')]()[_0x8374('0x27')](function(_0x2a6b93){delete _0x2a6b93[_0x8374('0x92')];for(var _0x5e1369=0x0;_0x5e1369=_0x5bb3c2){_0x3c31fb=_0x5bb3c2;_0x54fd0a=0xc8;}else{_0x54fd0a=0xce;}_0x389cfc[_0x73f2('0x1d')](_0x54fd0a);return _0x389cfc[_0x73f2('0x20')](_0x73f2('0x21'),_0x518a6f+'-'+_0x3c31fb+'/'+_0x5bb3c2)[_0x73f2('0x22')](_0x147407);}return null;};}function patchUpdates(_0x5aadcf){return function(_0x35a62c){try{jsonpatch[_0x73f2('0x23')](_0x35a62c,_0x5aadcf,!![]);}catch(_0x310318){return BPromise[_0x73f2('0x24')](_0x310318);}return _0x35a62c[_0x73f2('0x25')]();};}function saveUpdates(_0xea3dcc,_0x5dd5b2){return function(_0x382c76){if(_0x382c76){return _0x382c76[_0x73f2('0x26')](_0xea3dcc)[_0x73f2('0x27')](function(_0x266b82){return _0x266b82;});}return null;};}function removeEntity(_0x51921a,_0x44d7cf){return function(_0x1bce16){if(_0x1bce16){return _0x1bce16[_0x73f2('0x28')]()[_0x73f2('0x27')](function(){_0x51921a[_0x73f2('0x1d')](0xcc)[_0x73f2('0x1c')]();});}};}function handleEntityNotFound(_0x268493,_0x1f3cb5){return function(_0x259ee3){if(!_0x259ee3){_0x268493[_0x73f2('0x29')](0x194);}return _0x259ee3;};}function handleError(_0x8646e2,_0x35b86a){_0x35b86a=_0x35b86a||0x1f4;return function(_0x49c20e){logger[_0x73f2('0x2a')](_0x49c20e[_0x73f2('0x2b')]);if(_0x49c20e[_0x73f2('0x2c')]){delete _0x49c20e[_0x73f2('0x2c')];}_0x8646e2[_0x73f2('0x1d')](_0x35b86a)[_0x73f2('0x2d')](_0x49c20e);};}exports[_0x73f2('0x2e')]=function(_0x3994e8,_0x4fd428){var _0xaf5e1={},_0x3f42c3={},_0x369d4e={'count':0x0,'rows':[]};return db[_0x73f2('0x2f')]['describe']()['then'](function(_0x2e6e5a){var _0x6a7977=[];for(var _0x2cbef5=0x0;_0x2cbef50x1){_0x390867['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x73f2('0x72')](_0x3ab593),null);}else{if(qs['isNumeric'](_0x3ab593)){_0x390867['or'](_0x73f2('0x73'),_0x3ab593+'%');_0x390867['or'](_0x73f2('0x74'),_0x3ab593+'%');_0x390867['or']('c.mobile\x20LIKE\x20?',_0x3ab593+'%');_0x390867['or'](_0x73f2('0x75'),_0x3ab593+'%');}else if(qs[_0x73f2('0x76')](_0x3ab593)){_0x390867['or'](_0x73f2('0x77'),_0x3ab593+'%');}else{_0x390867['or'](_0x73f2('0x78'),'%'+_0x3ab593+'%');_0x390867['or'](_0x73f2('0x79'),'%'+_0x3ab593+'%');_0x390867['or']('c.email\x20LIKE\x20?','%'+_0x3ab593+'%');}}}}_0xbac6dd[_0x73f2('0x46')](_0x390867);_0xbac6dd['group']('c.id');var _0x27938f={'type':db[_0x73f2('0x7a')][_0x73f2('0x7b')][_0x73f2('0x7c')],'raw':!![]};var _0xbe908c=_0xbac6dd['clone']()[_0x73f2('0x48')](_0x73f2('0x7d'));if(_0xaf5e1['order']){_0xaf5e1[_0x73f2('0x44')]['forEach'](function(_0x32f407){_0xbac6dd['order']('c.'+_0x32f407[0x0],_0x32f407[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x527beb)){_0xbac6dd['having'](_0x17633f);_0xbe908c[_0x73f2('0x46')](_0x73f2('0x7e'),_0x527beb);}BPromise['resolve']()[_0x73f2('0x27')](function(){if(_0x6b0e44&&!_['some'](_0x6b0e44[_0x73f2('0x56')],['field',_0x73f2('0x7f')])){return _0x3994e8[_0x73f2('0x80')][_0x73f2('0x81')]({'attributes':['id'],'raw':!![]})[_0x73f2('0x27')](function(_0x3f89c5){if(_['isEmpty'](_0x3f89c5)){_0xbe908c[_0x73f2('0x46')](_0x73f2('0x82'));_0xbac6dd['where'](_0x73f2('0x82'));}else{_0xbe908c[_0x73f2('0x46')](_0x73f2('0x6b'),_[_0x73f2('0x5a')](_0x3f89c5,'id'));_0xbac6dd[_0x73f2('0x46')](_0x73f2('0x6b'),_[_0x73f2('0x5a')](_0x3f89c5,'id'));}});}else{return;}})['then'](function(){db[_0x73f2('0x83')][_0x73f2('0x3c')](_0xbe908c[_0x73f2('0x84')](),_0x27938f)[_0x73f2('0x27')](function(_0x14c194){_0x369d4e[_0x73f2('0x1e')]=_0x14c194['length'];if(_0x369d4e['count']===0x0)return[];return db[_0x73f2('0x83')][_0x73f2('0x3c')](_0x554db3[_0x73f2('0x84')](),_0x27938f);})[_0x73f2('0x27')](function(_0x4368d6){_0x52786d=_[_0x73f2('0x85')](_0x4368d6,'id');_0x27938f=_[_0x73f2('0x86')](_0x27938f,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3994e8[_0x73f2('0x3c')][_0x73f2('0x40')]){_0xaf5e1[_0x73f2('0x3f')]['forEach'](function(_0x1b27a9){_0xbac6dd[_0x73f2('0x48')]('c.'+_0x1b27a9);});}else{_0xbac6dd[_0x73f2('0x48')](_0x73f2('0x7d'));_0xbac6dd[_0x73f2('0x48')](_0x73f2('0x87'));_0xbac6dd[_0x73f2('0x48')]('c.lastName');_0xbac6dd[_0x73f2('0x48')]('c.phone');_0xbac6dd['field']('c.mobile');_0xbac6dd['field'](_0x73f2('0x88'));_0xbac6dd['field'](_0x73f2('0x89'));_0xbac6dd['field'](_0x73f2('0x8a'));_0xbac6dd['field'](_0x73f2('0x8b'));_0xbac6dd[_0x73f2('0x48')](_0x73f2('0x8c'),_0x73f2('0x8d'));}if(_0xaf5e1[_0x73f2('0x43')])_0xbac6dd[_0x73f2('0x43')](_0xaf5e1[_0x73f2('0x43')]);if(_0xaf5e1[_0x73f2('0x1f')])_0xbac6dd[_0x73f2('0x1f')](_0xaf5e1[_0x73f2('0x1f')]);return db['sequelize'][_0x73f2('0x3c')](_0xbac6dd[_0x73f2('0x84')](),_0x27938f);})[_0x73f2('0x27')](function(_0x2406f2){_0x2406f2[_0x73f2('0x5b')](function(_0x498a92){if(_0x498a92[_0x73f2('0x8d')]){_0x498a92[_0x73f2('0x8e')]=[];_0x498a92['TagIds'][_0x73f2('0x59')](',')[_0x73f2('0x5b')](function(_0x818241){_0x498a92[_0x73f2('0x8e')][_0x73f2('0x34')](_0x52786d[_0x818241]);});}delete _0x498a92[_0x73f2('0x8d')];});_0x369d4e[_0x73f2('0x8f')]=_0x2406f2;return _0x369d4e;})[_0x73f2('0x27')](respondWithFilteredResult(_0x4fd428,_0xaf5e1));});})[_0x73f2('0x90')](handleError(_0x4fd428,null));};exports[_0x73f2('0x28')]=function(_0x90e13b,_0x50fc74){return db[_0x73f2('0x2f')][_0x73f2('0x57')]({'where':{'id':_0x90e13b[_0x73f2('0x91')]['id']}})[_0x73f2('0x27')](handleEntityNotFound(_0x50fc74,null))[_0x73f2('0x27')](removeEntity(_0x50fc74,null))[_0x73f2('0x90')](handleError(_0x50fc74,null));};exports[_0x73f2('0x92')]=function(_0x281cec,_0x174bc6){return db['CmContact'][_0x73f2('0x92')]()[_0x73f2('0x27')](function(_0x2f64a5){delete _0x2f64a5[_0x73f2('0x93')];for(var _0x46236b=0x0;_0x46236b{}\s\\|]/g,'-');_0x1f692b(null,util['format'](_0xaa41('0x20'),path[_0xaa41('0x21')](_0x2bf794[_0xaa41('0x22')],path[_0xaa41('0x23')](_0x2bf794[_0xaa41('0x22')])),Date['now'](),path[_0xaa41('0x23')](_0x2bf794[_0xaa41('0x22')])));}})});router[_0xaa41('0x14')](_0xaa41('0x24'),upload[_0xaa41('0x25')](_0xaa41('0x26')),controller['uploadCsv']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x16aec5,_0x527cac,_0x493a10){_0x493a10(null,path[_0xaa41('0x1c')](config['root'],'server/files/tmp'));},'filename':function(_0x2d0ac0,_0x9c8c21,_0x392214){_0x9c8c21[_0xaa41('0x22')]=_0x9c8c21[_0xaa41('0x22')][_0xaa41('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x392214(null,util['format'](_0xaa41('0x20'),path[_0xaa41('0x21')](_0x9c8c21[_0xaa41('0x22')],path[_0xaa41('0x23')](_0x9c8c21[_0xaa41('0x22')])),Date[_0xaa41('0x27')](),path[_0xaa41('0x23')](_0x9c8c21[_0xaa41('0x22')])));}})});router['post'](_0xaa41('0x28'),upload['single']('file'),controller[_0xaa41('0x29')]);router[_0xaa41('0x14')]('/upload/:id',auth[_0xaa41('0xc')](),controller[_0xaa41('0x2a')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xaa41('0x2b')]);router[_0xaa41('0x2c')](_0xaa41('0x2d'),auth[_0xaa41('0xc')](),controller['destroy']);module[_0xaa41('0x2e')]=router; \ No newline at end of file +var _0x814b=['uploadCsv','root','server/files/tmp','/upload','/upload/:id','import','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./cmContact.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/tags','getTags','/:id/hoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','post','/merge','merge','create','/create_many','bulkCreate','setTags','diskStorage','join','originalname','format','%s-%s%s','basename','extname','now','/csv','single','file'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x814b,0x1a2));var _0xb814=function(_0x5a125c,_0x155fa2){_0x5a125c=_0x5a125c-0x0;var _0x4c70af=_0x814b[_0x5a125c];return _0x4c70af;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xb814('0x6'));var config=require(_0xb814('0x7'));var controller=require(_0xb814('0x8'));router[_0xb814('0x9')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0xb')]);router['get'](_0xb814('0xc'),auth[_0xb814('0xa')](),controller['describe']);router[_0xb814('0x9')](_0xb814('0xd'),auth[_0xb814('0xa')](),controller[_0xb814('0xe')]);router[_0xb814('0x9')](_0xb814('0xf'),auth[_0xb814('0xa')](),controller[_0xb814('0x10')]);router[_0xb814('0x9')](_0xb814('0x11'),auth[_0xb814('0xa')](),controller['getHoppers']);router[_0xb814('0x9')]('/:id/hopper_histories',auth[_0xb814('0xa')](),controller[_0xb814('0x12')]);router[_0xb814('0x9')](_0xb814('0x13'),auth[_0xb814('0xa')](),controller[_0xb814('0x14')]);router[_0xb814('0x9')](_0xb814('0x15'),auth[_0xb814('0xa')](),controller[_0xb814('0x16')]);router[_0xb814('0x17')](_0xb814('0x18'),auth[_0xb814('0xa')](),controller[_0xb814('0x19')]);router[_0xb814('0x17')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0x1a')]);router[_0xb814('0x17')](_0xb814('0x1b'),auth[_0xb814('0xa')](),controller[_0xb814('0x1c')]);router['post'](_0xb814('0xf'),auth['isAuthenticated'](),controller[_0xb814('0x1d')]);var upload=multer({'storage':multer[_0xb814('0x1e')]({'destination':function(_0x4c3007,_0x4b55a7,_0x55d63c){_0x55d63c(null,path[_0xb814('0x1f')](config['root'],'server/files/tmp'));},'filename':function(_0xb684ea,_0x24211d,_0x25b6b6){_0x24211d['originalname']=_0x24211d[_0xb814('0x20')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x25b6b6(null,util[_0xb814('0x21')](_0xb814('0x22'),path[_0xb814('0x23')](_0x24211d[_0xb814('0x20')],path[_0xb814('0x24')](_0x24211d[_0xb814('0x20')])),Date[_0xb814('0x25')](),path['extname'](_0x24211d[_0xb814('0x20')])));}})});router['post'](_0xb814('0x26'),upload[_0xb814('0x27')](_0xb814('0x28')),controller[_0xb814('0x29')]);var upload=multer({'storage':multer[_0xb814('0x1e')]({'destination':function(_0xb9e57d,_0x3d836c,_0x5755ea){_0x5755ea(null,path[_0xb814('0x1f')](config[_0xb814('0x2a')],_0xb814('0x2b')));},'filename':function(_0x349394,_0x32ed56,_0x1d5965){_0x32ed56[_0xb814('0x20')]=_0x32ed56[_0xb814('0x20')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1d5965(null,util[_0xb814('0x21')](_0xb814('0x22'),path['basename'](_0x32ed56[_0xb814('0x20')],path[_0xb814('0x24')](_0x32ed56[_0xb814('0x20')])),Date['now'](),path[_0xb814('0x24')](_0x32ed56[_0xb814('0x20')])));}})});router['post'](_0xb814('0x2c'),upload['single'](_0xb814('0x28')),controller['upload']);router['post'](_0xb814('0x2d'),auth['isAuthenticated'](),controller[_0xb814('0x2e')]);router[_0xb814('0x2f')](_0xb814('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xb814('0x30')](_0xb814('0xd'),auth['isAuthenticated'](),controller[_0xb814('0x31')]);module[_0xb814('0x32')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index d97ea5c..3a8ee1e 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 _0x8707=['getDataValue','alias','STRING','TEXT','long','parse','values','setDataValue','stringify','BOOLEAN','sequelize','lodash','exports','VIRTUAL'];(function(_0x43de74,_0xda0cfb){var _0x6b464d=function(_0x55acae){while(--_0x55acae){_0x43de74['push'](_0x43de74['shift']());}};_0x6b464d(++_0xda0cfb);}(_0x8707,0x1f4));var _0x7870=function(_0x3ac127,_0x4629f0){_0x3ac127=_0x3ac127-0x0;var _0xf2a7db=_0x8707[_0x3ac127];return _0xf2a7db;};'use strict';var Sequelize=require(_0x7870('0x0'));var _=require(_0x7870('0x1'));module[_0x7870('0x2')]={'name':{'type':Sequelize[_0x7870('0x3')],'get':function(_0x1ede9b){return this[_0x7870('0x4')](_0x7870('0x5'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x2f65ca){this['setDataValue'](_0x7870('0x5'),_0x2f65ca?_0x2f65ca:this[_0x7870('0x4')]('name'));}},'type':{'type':Sequelize[_0x7870('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0x7870('0x7')](_0x7870('0x8')),'get':function(){if(this['getDataValue']('type')==='select'){return JSON[_0x7870('0x9')](this['getDataValue'](_0x7870('0xa')));}else{return this[_0x7870('0x4')](_0x7870('0xa'));}},'set':function(_0x4626e3){if(Array['isArray'](_0x4626e3)){this[_0x7870('0xb')]('values',JSON[_0x7870('0xc')](_0x4626e3));}else{this[_0x7870('0xb')]('values',_0x4626e3);}}},'required':{'type':Sequelize[_0x7870('0xd')],'defaultValue':![]}}; \ No newline at end of file +var _0x794e=['stringify','BOOLEAN','sequelize','lodash','exports','getDataValue','alias','STRING','setDataValue','name','TEXT','long','type','select','parse','values'];(function(_0x260f99,_0xe12763){var _0x137adc=function(_0x2368ab){while(--_0x2368ab){_0x260f99['push'](_0x260f99['shift']());}};_0x137adc(++_0xe12763);}(_0x794e,0x182));var _0xe794=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x794e[_0x138adb];return _0x1b27f2;};'use strict';var Sequelize=require(_0xe794('0x0'));var _=require(_0xe794('0x1'));module[_0xe794('0x2')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x50fbee){return this[_0xe794('0x3')](_0xe794('0x4'));}},'alias':{'type':Sequelize[_0xe794('0x5')],'allowNull':![],'set':function(_0x36bf72){this[_0xe794('0x6')](_0xe794('0x4'),_0x36bf72?_0x36bf72:this['getDataValue'](_0xe794('0x7')));}},'type':{'type':Sequelize[_0xe794('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0xe794('0x8')](_0xe794('0x9')),'get':function(){if(this[_0xe794('0x3')](_0xe794('0xa'))===_0xe794('0xb')){return JSON[_0xe794('0xc')](this[_0xe794('0x3')](_0xe794('0xd')));}else{return this[_0xe794('0x3')](_0xe794('0xd'));}},'set':function(_0xc7ef29){if(Array['isArray'](_0xc7ef29)){this['setDataValue']('values',JSON[_0xe794('0xe')](_0xc7ef29));}else{this['setDataValue'](_0xe794('0xd'),_0xc7ef29);}}},'required':{'type':Sequelize[_0xe794('0xf')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 31f4e1b..6e28f82 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 _0x4466=['where','filters','pick','filter','merge','VIRTUAL','options','include','CmCustomField','findAll','rows','catch','show','includeAll','find','body','params','create','sequelize','transaction','TEXT','Sequelize','number','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','ejs','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort'];(function(_0x986c5a,_0xd6224e){var _0x2606db=function(_0x520043){while(--_0x520043){_0x986c5a['push'](_0x986c5a['shift']());}};_0x2606db(++_0xd6224e);}(_0x4466,0x70));var _0x6446=function(_0x1e9287,_0x37f584){_0x1e9287=_0x1e9287-0x0;var _0x44342e=_0x4466[_0x1e9287];return _0x44342e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6446('0x0'));var rimraf=require(_0x6446('0x1'));var zipdir=require(_0x6446('0x2'));var jsonpatch=require(_0x6446('0x3'));var rp=require(_0x6446('0x4'));var moment=require(_0x6446('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6446('0x6'));var path=require(_0x6446('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6446('0x8'));var fs=require('fs');var _=require(_0x6446('0x9'));var squel=require('squel');var crypto=require(_0x6446('0xa'));var jsforce=require(_0x6446('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x6446('0xc'));var querystring=require(_0x6446('0xd'));var Papa=require(_0x6446('0xe'));var Redis=require(_0x6446('0xf'));var authService=require(_0x6446('0x10'));var qs=require(_0x6446('0x11'));var as=require(_0x6446('0x12'));var hardwareService=require(_0x6446('0x13'));var logger=require(_0x6446('0x14'))(_0x6446('0x15'));var utils=require(_0x6446('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1109b5,_0x11b7a0){_0x11b7a0=_0x11b7a0||0xcc;return function(_0x36cc59){if(_0x36cc59){return _0x1109b5[_0x6446('0x17')](_0x11b7a0);}return _0x1109b5[_0x6446('0x18')](_0x11b7a0)[_0x6446('0x19')]();};}function respondWithResult(_0x9f8df6,_0x51ebf4){_0x51ebf4=_0x51ebf4||0xc8;return function(_0x9930f3){if(_0x9930f3){return _0x9f8df6['status'](_0x51ebf4)[_0x6446('0x1a')](_0x9930f3);}};}function respondWithFilteredResult(_0xc075f4,_0x4243f){return function(_0x69b38){if(_0x69b38){var _0x8fcaa1=_0x69b38[_0x6446('0x1b')],_0x2a2003=_0x4243f[_0x6446('0x1c')],_0x1c18dc=_0x4243f[_0x6446('0x1c')]+_0x4243f[_0x6446('0x1d')],_0xbdc615;if(_0x1c18dc>=_0x8fcaa1){_0x1c18dc=_0x8fcaa1;_0xbdc615=0xc8;}else{_0xbdc615=0xce;}_0xc075f4[_0x6446('0x18')](_0xbdc615);return _0xc075f4[_0x6446('0x1e')](_0x6446('0x1f'),_0x2a2003+'-'+_0x1c18dc+'/'+_0x8fcaa1)[_0x6446('0x1a')](_0x69b38);}return null;};}function patchUpdates(_0x40fd91){return function(_0x5906cb){try{jsonpatch[_0x6446('0x20')](_0x5906cb,_0x40fd91,!![]);}catch(_0x532e15){return BPromise[_0x6446('0x21')](_0x532e15);}return _0x5906cb['save']();};}function saveUpdates(_0x593ad0,_0x6bddfb){return function(_0x53b952){if(_0x53b952){return _0x53b952[_0x6446('0x22')](_0x593ad0)[_0x6446('0x23')](function(_0x194df0){return _0x194df0;});}return null;};}function removeEntity(_0x19e5d1,_0x321dc6){return function(_0x443524){if(_0x443524){return _0x443524[_0x6446('0x24')]()[_0x6446('0x23')](function(){_0x19e5d1[_0x6446('0x18')](0xcc)[_0x6446('0x19')]();});}};}function handleEntityNotFound(_0x41f53b,_0x1cb02a){return function(_0x5b28ea){if(!_0x5b28ea){_0x41f53b[_0x6446('0x17')](0x194);}return _0x5b28ea;};}function handleError(_0x2c516e,_0x583728){_0x583728=_0x583728||0x1f4;return function(_0x2b0e42){logger[_0x6446('0x25')](_0x2b0e42[_0x6446('0x26')]);if(_0x2b0e42[_0x6446('0x27')]){delete _0x2b0e42[_0x6446('0x27')];}_0x2c516e[_0x6446('0x18')](_0x583728)[_0x6446('0x28')](_0x2b0e42);};}exports[_0x6446('0x29')]=function(_0x48337a,_0x1bb265){var _0xbba5cd={},_0x4e69d3={},_0x4ed154={'count':0x0,'rows':[]};var _0x3e24fe=_[_0x6446('0x2a')](db['CmCustomField']['rawAttributes'],function(_0x26c638){return{'name':_0x26c638['fieldName'],'type':_0x26c638[_0x6446('0x2b')]['key']};});_0x4e69d3[_0x6446('0x2c')]=_['differenceBy'](_[_0x6446('0x2a')](_0x3e24fe,_0x6446('0x27')),[_0x6446('0x27')]);_0x4e69d3[_0x6446('0x2d')]=_[_0x6446('0x2e')](_0x48337a[_0x6446('0x2d')]);_0x4e69d3['filters']=_[_0x6446('0x2f')](_0x4e69d3[_0x6446('0x2c')],_0x4e69d3['query']);_0xbba5cd[_0x6446('0x30')]=_[_0x6446('0x2f')](_0x4e69d3[_0x6446('0x2c')],qs[_0x6446('0x31')](_0x48337a['query'][_0x6446('0x31')]));_0xbba5cd[_0x6446('0x30')]=_0xbba5cd['attributes'][_0x6446('0x32')]?_0xbba5cd[_0x6446('0x30')]:_0x4e69d3[_0x6446('0x2c')];if(!_0x48337a[_0x6446('0x2d')][_0x6446('0x33')]('nolimit')){_0xbba5cd['limit']=qs[_0x6446('0x1d')](_0x48337a[_0x6446('0x2d')][_0x6446('0x1d')]);_0xbba5cd['offset']=qs[_0x6446('0x1c')](_0x48337a['query']['offset']);}_0xbba5cd[_0x6446('0x34')]=qs[_0x6446('0x35')](_0x48337a[_0x6446('0x2d')][_0x6446('0x35')]);_0xbba5cd[_0x6446('0x36')]=qs[_0x6446('0x37')](_[_0x6446('0x38')](_0x48337a[_0x6446('0x2d')],_0x4e69d3['filters']));if(_0x48337a['query'][_0x6446('0x39')]){_0xbba5cd[_0x6446('0x36')]=_[_0x6446('0x3a')](_0xbba5cd['where'],{'$or':_[_0x6446('0x2a')](_0x3e24fe,function(_0x4de301){if(_0x4de301[_0x6446('0x2b')]!==_0x6446('0x3b')){var _0x5044b3={};_0x5044b3[_0x4de301[_0x6446('0x27')]]={'$like':'%'+_0x48337a['query']['filter']+'%'};return _0x5044b3;}})});}_0xbba5cd=_['merge']({},_0xbba5cd,_0x48337a[_0x6446('0x3c')]);var _0x232c68={'where':_0xbba5cd[_0x6446('0x36')]};return db['CmCustomField'][_0x6446('0x1b')](_0x232c68)[_0x6446('0x23')](function(_0x276c55){_0x4ed154[_0x6446('0x1b')]=_0x276c55;if(_0x48337a[_0x6446('0x2d')]['includeAll']){_0xbba5cd[_0x6446('0x3d')]=[{'all':!![]}];}return db[_0x6446('0x3e')][_0x6446('0x3f')](_0xbba5cd);})[_0x6446('0x23')](function(_0x3c6c8a){_0x4ed154[_0x6446('0x40')]=_0x3c6c8a;return _0x4ed154;})[_0x6446('0x23')](respondWithFilteredResult(_0x1bb265,_0xbba5cd))[_0x6446('0x41')](handleError(_0x1bb265,null));};exports[_0x6446('0x42')]=function(_0x54fb2a,_0xd0e673){var _0x4fe5e3={'raw':!![],'where':{'id':_0x54fb2a['params']['id']}},_0x32f918={};_0x32f918[_0x6446('0x2c')]=_[_0x6446('0x2e')](db['CmCustomField']['rawAttributes']);_0x32f918[_0x6446('0x2d')]=_[_0x6446('0x2e')](_0x54fb2a[_0x6446('0x2d')]);_0x32f918['filters']=_[_0x6446('0x2f')](_0x32f918[_0x6446('0x2c')],_0x32f918['query']);_0x4fe5e3['attributes']=_[_0x6446('0x2f')](_0x32f918[_0x6446('0x2c')],qs[_0x6446('0x31')](_0x54fb2a[_0x6446('0x2d')][_0x6446('0x31')]));_0x4fe5e3[_0x6446('0x30')]=_0x4fe5e3[_0x6446('0x30')][_0x6446('0x32')]?_0x4fe5e3[_0x6446('0x30')]:_0x32f918[_0x6446('0x2c')];if(_0x54fb2a[_0x6446('0x2d')][_0x6446('0x43')]){_0x4fe5e3[_0x6446('0x3d')]=[{'all':!![]}];}_0x4fe5e3=_[_0x6446('0x3a')]({},_0x4fe5e3,_0x54fb2a['options']);return db[_0x6446('0x3e')][_0x6446('0x44')](_0x4fe5e3)['then'](handleEntityNotFound(_0xd0e673,null))['then'](respondWithResult(_0xd0e673,null))[_0x6446('0x41')](handleError(_0xd0e673,null));};exports[_0x6446('0x22')]=function(_0x488130,_0x2a4809){if(_0x488130[_0x6446('0x45')]['id']){delete _0x488130['body']['id'];}return db['CmCustomField']['find']({'where':{'id':_0x488130[_0x6446('0x46')]['id']}})['then'](handleEntityNotFound(_0x2a4809,null))[_0x6446('0x23')](saveUpdates(_0x488130[_0x6446('0x45')],null))[_0x6446('0x23')](respondWithResult(_0x2a4809,null))['catch'](handleError(_0x2a4809,null));};exports[_0x6446('0x24')]=function(_0x2f04bc,_0x425458){return db['CmCustomField'][_0x6446('0x44')]({'where':{'id':_0x2f04bc[_0x6446('0x46')]['id']}})[_0x6446('0x23')](handleEntityNotFound(_0x425458,null))[_0x6446('0x23')](removeEntity(_0x425458,null))[_0x6446('0x41')](handleError(_0x425458,null));};exports[_0x6446('0x47')]=function(_0x4e7ade,_0x33ab1f){var _0x39e383;return db[_0x6446('0x48')][_0x6446('0x49')](function(_0x3342be){return db['CmCustomField'][_0x6446('0x47')](_0x4e7ade[_0x6446('0x45')],{'transaction':_0x3342be})[_0x6446('0x23')](function(_0x2b5885){_0x39e383=_0x2b5885;var _0x1e0065={'type':db['Sequelize'][_0x6446('0x4a')],'transaction':_0x3342be};switch(_0x4e7ade['body'][_0x6446('0x2b')]){case'text':_0x1e0065[_0x6446('0x2b')]=db[_0x6446('0x4b')][_0x6446('0x4a')];break;case _0x6446('0x4c'):_0x1e0065[_0x6446('0x2b')]=db[_0x6446('0x4b')][_0x6446('0x4d')];break;case'switch':_0x1e0065['type']=db[_0x6446('0x4b')][_0x6446('0x4e')];_0x1e0065[_0x6446('0x4f')]=![];break;default:}return db[_0x6446('0x48')][_0x6446('0x50')][_0x6446('0x51')](_0x6446('0x52'),util['format']('cf_%d',_0x39e383['id']),_0x1e0065);})[_0x6446('0x23')](function(){return _0x39e383;});})['then'](respondWithResult(_0x33ab1f,0xc9))[_0x6446('0x41')](handleError(_0x33ab1f,null));}; \ No newline at end of file +var _0x965a=['reject','save','update','then','destroy','error','stack','name','send','index','map','fieldName','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','merge','CmCustomField','includeAll','include','findAll','rows','show','params','rawAttributes','options','find','catch','body','create','sequelize','transaction','TEXT','text','number','Sequelize','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','json','apply'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x965a,0x147));var _0xa965=function(_0x2bf01c,_0x14f18d){_0x2bf01c=_0x2bf01c-0x0;var _0x2aef0f=_0x965a[_0x2bf01c];return _0x2aef0f;};'use strict';var pdf=require(_0xa965('0x0'));var emlformat=require(_0xa965('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa965('0x2'));var jsonpatch=require(_0xa965('0x3'));var rp=require(_0xa965('0x4'));var moment=require('moment');var BPromise=require(_0xa965('0x5'));var Mustache=require('mustache');var util=require(_0xa965('0x6'));var path=require(_0xa965('0x7'));var sox=require(_0xa965('0x8'));var csv=require(_0xa965('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa965('0xa'));var squel=require(_0xa965('0xb'));var crypto=require(_0xa965('0xc'));var jsforce=require(_0xa965('0xd'));var deskjs=require(_0xa965('0xe'));var toCsv=require(_0xa965('0x9'));var querystring=require(_0xa965('0xf'));var Papa=require(_0xa965('0x10'));var Redis=require(_0xa965('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xa965('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa965('0x13'));var logger=require(_0xa965('0x14'))(_0xa965('0x15'));var utils=require(_0xa965('0x16'));var config=require('../../config/environment');var db=require(_0xa965('0x17'))['db'];function respondWithStatusCode(_0x550f8a,_0x4fc137){_0x4fc137=_0x4fc137||0xcc;return function(_0x3b6ae5){if(_0x3b6ae5){return _0x550f8a[_0xa965('0x18')](_0x4fc137);}return _0x550f8a[_0xa965('0x19')](_0x4fc137)['end']();};}function respondWithResult(_0x225bfb,_0x36c56b){_0x36c56b=_0x36c56b||0xc8;return function(_0x5abf83){if(_0x5abf83){return _0x225bfb['status'](_0x36c56b)['json'](_0x5abf83);}};}function respondWithFilteredResult(_0x27d91a,_0x5c8989){return function(_0x3eb82f){if(_0x3eb82f){var _0x29b95e=_0x3eb82f[_0xa965('0x1a')],_0x5b46b4=_0x5c8989[_0xa965('0x1b')],_0x31aa41=_0x5c8989[_0xa965('0x1b')]+_0x5c8989[_0xa965('0x1c')],_0x232b30;if(_0x31aa41>=_0x29b95e){_0x31aa41=_0x29b95e;_0x232b30=0xc8;}else{_0x232b30=0xce;}_0x27d91a[_0xa965('0x19')](_0x232b30);return _0x27d91a[_0xa965('0x1d')](_0xa965('0x1e'),_0x5b46b4+'-'+_0x31aa41+'/'+_0x29b95e)[_0xa965('0x1f')](_0x3eb82f);}return null;};}function patchUpdates(_0x2b87bf){return function(_0x391635){try{jsonpatch[_0xa965('0x20')](_0x391635,_0x2b87bf,!![]);}catch(_0x8a1925){return BPromise[_0xa965('0x21')](_0x8a1925);}return _0x391635[_0xa965('0x22')]();};}function saveUpdates(_0x2cd21a,_0x8ad4e3){return function(_0x3c13d8){if(_0x3c13d8){return _0x3c13d8[_0xa965('0x23')](_0x2cd21a)[_0xa965('0x24')](function(_0x488be6){return _0x488be6;});}return null;};}function removeEntity(_0x42ebb6,_0x30edb3){return function(_0x37e4c4){if(_0x37e4c4){return _0x37e4c4[_0xa965('0x25')]()[_0xa965('0x24')](function(){_0x42ebb6[_0xa965('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40116f,_0x485970){return function(_0x7e49c3){if(!_0x7e49c3){_0x40116f[_0xa965('0x18')](0x194);}return _0x7e49c3;};}function handleError(_0x19f902,_0x3d4e76){_0x3d4e76=_0x3d4e76||0x1f4;return function(_0x1f1da7){logger[_0xa965('0x26')](_0x1f1da7[_0xa965('0x27')]);if(_0x1f1da7[_0xa965('0x28')]){delete _0x1f1da7[_0xa965('0x28')];}_0x19f902[_0xa965('0x19')](_0x3d4e76)[_0xa965('0x29')](_0x1f1da7);};}exports[_0xa965('0x2a')]=function(_0x15faa9,_0x138463){var _0x5c0864={},_0x54402c={},_0x4bac29={'count':0x0,'rows':[]};var _0x57dc6c=_[_0xa965('0x2b')](db['CmCustomField']['rawAttributes'],function(_0x503350){return{'name':_0x503350[_0xa965('0x2c')],'type':_0x503350['type']['key']};});_0x54402c[_0xa965('0x2d')]=_[_0xa965('0x2e')](_['map'](_0x57dc6c,'name'),[_0xa965('0x28')]);_0x54402c[_0xa965('0x2f')]=_[_0xa965('0x30')](_0x15faa9[_0xa965('0x2f')]);_0x54402c[_0xa965('0x31')]=_[_0xa965('0x32')](_0x54402c[_0xa965('0x2d')],_0x54402c['query']);_0x5c0864[_0xa965('0x33')]=_[_0xa965('0x32')](_0x54402c['model'],qs[_0xa965('0x34')](_0x15faa9[_0xa965('0x2f')][_0xa965('0x34')]));_0x5c0864[_0xa965('0x33')]=_0x5c0864[_0xa965('0x33')][_0xa965('0x35')]?_0x5c0864[_0xa965('0x33')]:_0x54402c['model'];if(!_0x15faa9[_0xa965('0x2f')][_0xa965('0x36')](_0xa965('0x37'))){_0x5c0864[_0xa965('0x1c')]=qs[_0xa965('0x1c')](_0x15faa9[_0xa965('0x2f')]['limit']);_0x5c0864[_0xa965('0x1b')]=qs[_0xa965('0x1b')](_0x15faa9['query'][_0xa965('0x1b')]);}_0x5c0864[_0xa965('0x38')]=qs[_0xa965('0x39')](_0x15faa9['query'][_0xa965('0x39')]);_0x5c0864[_0xa965('0x3a')]=qs[_0xa965('0x31')](_['pick'](_0x15faa9[_0xa965('0x2f')],_0x54402c[_0xa965('0x31')]));if(_0x15faa9['query'][_0xa965('0x3b')]){_0x5c0864[_0xa965('0x3a')]=_['merge'](_0x5c0864[_0xa965('0x3a')],{'$or':_[_0xa965('0x2b')](_0x57dc6c,function(_0x1d6340){if(_0x1d6340[_0xa965('0x3c')]!==_0xa965('0x3d')){var _0x222625={};_0x222625[_0x1d6340['name']]={'$like':'%'+_0x15faa9['query'][_0xa965('0x3b')]+'%'};return _0x222625;}})});}_0x5c0864=_[_0xa965('0x3e')]({},_0x5c0864,_0x15faa9['options']);var _0x3637ab={'where':_0x5c0864[_0xa965('0x3a')]};return db[_0xa965('0x3f')]['count'](_0x3637ab)[_0xa965('0x24')](function(_0x285737){_0x4bac29['count']=_0x285737;if(_0x15faa9[_0xa965('0x2f')][_0xa965('0x40')]){_0x5c0864[_0xa965('0x41')]=[{'all':!![]}];}return db[_0xa965('0x3f')][_0xa965('0x42')](_0x5c0864);})[_0xa965('0x24')](function(_0x58f518){_0x4bac29[_0xa965('0x43')]=_0x58f518;return _0x4bac29;})[_0xa965('0x24')](respondWithFilteredResult(_0x138463,_0x5c0864))['catch'](handleError(_0x138463,null));};exports[_0xa965('0x44')]=function(_0xf5bd78,_0x399a6e){var _0xf9c51a={'raw':!![],'where':{'id':_0xf5bd78[_0xa965('0x45')]['id']}},_0x178876={};_0x178876[_0xa965('0x2d')]=_[_0xa965('0x30')](db[_0xa965('0x3f')][_0xa965('0x46')]);_0x178876['query']=_[_0xa965('0x30')](_0xf5bd78[_0xa965('0x2f')]);_0x178876[_0xa965('0x31')]=_['intersection'](_0x178876['model'],_0x178876['query']);_0xf9c51a[_0xa965('0x33')]=_[_0xa965('0x32')](_0x178876[_0xa965('0x2d')],qs[_0xa965('0x34')](_0xf5bd78[_0xa965('0x2f')][_0xa965('0x34')]));_0xf9c51a[_0xa965('0x33')]=_0xf9c51a[_0xa965('0x33')]['length']?_0xf9c51a['attributes']:_0x178876[_0xa965('0x2d')];if(_0xf5bd78[_0xa965('0x2f')][_0xa965('0x40')]){_0xf9c51a[_0xa965('0x41')]=[{'all':!![]}];}_0xf9c51a=_[_0xa965('0x3e')]({},_0xf9c51a,_0xf5bd78[_0xa965('0x47')]);return db[_0xa965('0x3f')][_0xa965('0x48')](_0xf9c51a)['then'](handleEntityNotFound(_0x399a6e,null))['then'](respondWithResult(_0x399a6e,null))[_0xa965('0x49')](handleError(_0x399a6e,null));};exports[_0xa965('0x23')]=function(_0x69558d,_0x4ea77f){if(_0x69558d[_0xa965('0x4a')]['id']){delete _0x69558d[_0xa965('0x4a')]['id'];}return db[_0xa965('0x3f')]['find']({'where':{'id':_0x69558d['params']['id']}})[_0xa965('0x24')](handleEntityNotFound(_0x4ea77f,null))['then'](saveUpdates(_0x69558d[_0xa965('0x4a')],null))[_0xa965('0x24')](respondWithResult(_0x4ea77f,null))['catch'](handleError(_0x4ea77f,null));};exports[_0xa965('0x25')]=function(_0xb3efa0,_0x13d39e){return db[_0xa965('0x3f')]['find']({'where':{'id':_0xb3efa0[_0xa965('0x45')]['id']}})[_0xa965('0x24')](handleEntityNotFound(_0x13d39e,null))['then'](removeEntity(_0x13d39e,null))[_0xa965('0x49')](handleError(_0x13d39e,null));};exports[_0xa965('0x4b')]=function(_0x336b37,_0x2f43bb){var _0x1c6ffb;return db[_0xa965('0x4c')][_0xa965('0x4d')](function(_0x40cddc){return db[_0xa965('0x3f')][_0xa965('0x4b')](_0x336b37[_0xa965('0x4a')],{'transaction':_0x40cddc})[_0xa965('0x24')](function(_0x1495ca){_0x1c6ffb=_0x1495ca;var _0x5cfa16={'type':db['Sequelize'][_0xa965('0x4e')],'transaction':_0x40cddc};switch(_0x336b37[_0xa965('0x4a')][_0xa965('0x3c')]){case _0xa965('0x4f'):_0x5cfa16[_0xa965('0x3c')]=db['Sequelize']['TEXT'];break;case _0xa965('0x50'):_0x5cfa16['type']=db[_0xa965('0x51')][_0xa965('0x52')];break;case _0xa965('0x53'):_0x5cfa16[_0xa965('0x3c')]=db[_0xa965('0x51')][_0xa965('0x54')];_0x5cfa16[_0xa965('0x55')]=![];break;default:}return db[_0xa965('0x4c')][_0xa965('0x56')][_0xa965('0x57')](_0xa965('0x58'),util[_0xa965('0x59')]('cf_%d',_0x1c6ffb['id']),_0x5cfa16);})[_0xa965('0x24')](function(){return _0x1c6ffb;});})['then'](respondWithResult(_0x2f43bb,0xc9))[_0xa965('0x49')](handleError(_0x2f43bb,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 2f868db..3a048ca 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 _0xa107=['request-promise','path','rimraf','../../config/environment','exports','define','CmCustomField','cm_custom_fields','lodash','../../config/logger','api','moment','bluebird'];(function(_0xdc37a1,_0x53ebb9){var _0x99b4fe=function(_0x2811e3){while(--_0x2811e3){_0xdc37a1['push'](_0xdc37a1['shift']());}};_0x99b4fe(++_0x53ebb9);}(_0xa107,0x7d));var _0x7a10=function(_0xdcc54f,_0x1669d9){_0xdcc54f=_0xdcc54f-0x0;var _0xe013b6=_0xa107[_0xdcc54f];return _0xe013b6;};'use strict';var _=require(_0x7a10('0x0'));var util=require('util');var logger=require(_0x7a10('0x1'))(_0x7a10('0x2'));var moment=require(_0x7a10('0x3'));var BPromise=require(_0x7a10('0x4'));var rp=require(_0x7a10('0x5'));var fs=require('fs');var path=require(_0x7a10('0x6'));var rimraf=require(_0x7a10('0x7'));var config=require(_0x7a10('0x8'));var attributes=require('./cmCustomField.attributes');module[_0x7a10('0x9')]=function(_0x5ee65b,_0x310b4b){return _0x5ee65b[_0x7a10('0xa')](_0x7a10('0xb'),attributes,{'tableName':_0x7a10('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x79a3=['./cmCustomField.attributes','exports','lodash','../../config/logger','api','bluebird','../../config/environment'];(function(_0x353c36,_0x1ccc04){var _0x321cec=function(_0x30bcd4){while(--_0x30bcd4){_0x353c36['push'](_0x353c36['shift']());}};_0x321cec(++_0x1ccc04);}(_0x79a3,0x80));var _0x379a=function(_0x4a7abe,_0x186572){_0x4a7abe=_0x4a7abe-0x0;var _0x263d13=_0x79a3[_0x4a7abe];return _0x263d13;};'use strict';var _=require(_0x379a('0x0'));var util=require('util');var logger=require(_0x379a('0x1'))(_0x379a('0x2'));var moment=require('moment');var BPromise=require(_0x379a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x379a('0x4'));var attributes=require(_0x379a('0x5'));module[_0x379a('0x6')]=function(_0x14907a,_0x9e6da6){return _0x14907a['define']('CmCustomField',attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 9856a8a..0683e30 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 _0xadb8=['CmCustomField,\x20%s,\x20%s','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x2d81bf,_0x434185){var _0x373f49=function(_0x1544b2){while(--_0x1544b2){_0x2d81bf['push'](_0x2d81bf['shift']());}};_0x373f49(++_0x434185);}(_0xadb8,0x1d0));var _0x8adb=function(_0x585f40,_0x4a3091){_0x585f40=_0x585f40-0x0;var _0x44fc86=_0xadb8[_0x585f40];return _0x44fc86;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8adb('0x0'));var BPromise=require('bluebird');var rs=require(_0x8adb('0x1'));var fs=require('fs');var Redis=require(_0x8adb('0x2'));var db=require(_0x8adb('0x3'))['db'];var utils=require(_0x8adb('0x4'));var logger=require(_0x8adb('0x5'))(_0x8adb('0x6'));var config=require(_0x8adb('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8adb('0x8')][_0x8adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x9f435,_0x2bebfe,_0x271bed){return new BPromise(function(_0x16b932,_0x27d994){return client['request'](_0x9f435,_0x271bed)['then'](function(_0x58ad1a){logger[_0x8adb('0xa')]('CmCustomField,\x20%s,\x20%s',_0x2bebfe,'request\x20sent');logger['debug'](_0x8adb('0xb'),_0x2bebfe,_0x8adb('0xc'),JSON[_0x8adb('0xd')](_0x58ad1a));if(_0x58ad1a[_0x8adb('0xe')]){if(_0x58ad1a[_0x8adb('0xe')][_0x8adb('0xf')]===0x1f4){logger[_0x8adb('0xe')](_0x8adb('0x10'),_0x2bebfe,_0x58ad1a[_0x8adb('0xe')][_0x8adb('0x11')]);return _0x27d994(_0x58ad1a['error']['message']);}logger['error'](_0x8adb('0x10'),_0x2bebfe,_0x58ad1a['error'][_0x8adb('0x11')]);return _0x16b932(_0x58ad1a[_0x8adb('0xe')][_0x8adb('0x11')]);}else{logger['info'](_0x8adb('0x10'),_0x2bebfe,_0x8adb('0xc'));_0x16b932(_0x58ad1a[_0x8adb('0x12')][_0x8adb('0x11')]);}})[_0x8adb('0x13')](function(_0x13659c){logger['error'](_0x8adb('0x10'),_0x2bebfe,_0x13659c);_0x27d994(_0x13659c);});});} \ No newline at end of file +var _0x7a2c=['error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','CmCustomField,\x20%s,\x20%s','debug','request\x20sent','stringify'];(function(_0x48ef1e,_0x3147f9){var _0x159d4f=function(_0x2f70dc){while(--_0x2f70dc){_0x48ef1e['push'](_0x48ef1e['shift']());}};_0x159d4f(++_0x3147f9);}(_0x7a2c,0x17b));var _0xc7a2=function(_0x33131f,_0x365960){_0x33131f=_0x33131f-0x0;var _0x17b3b8=_0x7a2c[_0x33131f];return _0x17b3b8;};'use strict';var _=require(_0xc7a2('0x0'));var util=require('util');var moment=require(_0xc7a2('0x1'));var BPromise=require(_0xc7a2('0x2'));var rs=require(_0xc7a2('0x3'));var fs=require('fs');var Redis=require(_0xc7a2('0x4'));var db=require(_0xc7a2('0x5'))['db'];var utils=require(_0xc7a2('0x6'));var logger=require(_0xc7a2('0x7'))(_0xc7a2('0x8'));var config=require('../../config/environment');var jayson=require(_0xc7a2('0x9'));var client=jayson[_0xc7a2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x481430,_0x48773c,_0x1dd150){return new BPromise(function(_0x3de428,_0x3f0573){return client[_0xc7a2('0xb')](_0x481430,_0x1dd150)['then'](function(_0x38518b){logger[_0xc7a2('0xc')](_0xc7a2('0xd'),_0x48773c,'request\x20sent');logger[_0xc7a2('0xe')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x48773c,_0xc7a2('0xf'),JSON[_0xc7a2('0x10')](_0x38518b));if(_0x38518b[_0xc7a2('0x11')]){if(_0x38518b['error'][_0xc7a2('0x12')]===0x1f4){logger[_0xc7a2('0x11')](_0xc7a2('0xd'),_0x48773c,_0x38518b['error'][_0xc7a2('0x13')]);return _0x3f0573(_0x38518b[_0xc7a2('0x11')][_0xc7a2('0x13')]);}logger[_0xc7a2('0x11')](_0xc7a2('0xd'),_0x48773c,_0x38518b[_0xc7a2('0x11')][_0xc7a2('0x13')]);return _0x3de428(_0x38518b[_0xc7a2('0x11')][_0xc7a2('0x13')]);}else{logger[_0xc7a2('0xc')](_0xc7a2('0xd'),_0x48773c,_0xc7a2('0xf'));_0x3de428(_0x38518b[_0xc7a2('0x14')][_0xc7a2('0x13')]);}})[_0xc7a2('0x15')](function(_0x506396){logger[_0xc7a2('0x11')]('CmCustomField,\x20%s,\x20%s',_0x48773c,_0x506396);_0x3f0573(_0x506396);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 3d6f1db..841b8b8 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 _0xf05b=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','post','create','put','update','delete','/:id','destroy','exports','multer','path'];(function(_0x5b6164,_0x12e0bf){var _0x440cfa=function(_0x2ee796){while(--_0x2ee796){_0x5b6164['push'](_0x5b6164['shift']());}};_0x440cfa(++_0x12e0bf);}(_0xf05b,0x1b6));var _0xbf05=function(_0x3af61c,_0x25ae99){_0x3af61c=_0x3af61c-0x0;var _0x5477b7=_0xf05b[_0x3af61c];return _0x5477b7;};'use strict';var multer=require(_0xbf05('0x0'));var util=require('util');var path=require(_0xbf05('0x1'));var timeout=require(_0xbf05('0x2'));var express=require(_0xbf05('0x3'));var router=express[_0xbf05('0x4')]();var auth=require(_0xbf05('0x5'));var interaction=require(_0xbf05('0x6'));var config=require(_0xbf05('0x7'));var controller=require(_0xbf05('0x8'));router[_0xbf05('0x9')]('/',auth[_0xbf05('0xa')](),controller[_0xbf05('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0xbf05('0xc')]('/',auth[_0xbf05('0xa')](),controller[_0xbf05('0xd')]);router[_0xbf05('0xe')]('/:id',auth[_0xbf05('0xa')](),controller[_0xbf05('0xf')]);router[_0xbf05('0x10')](_0xbf05('0x11'),auth[_0xbf05('0xa')](),controller[_0xbf05('0x12')]);module[_0xbf05('0x13')]=router; \ No newline at end of file +var _0xb6c4=['multer','path','express','Router','../../components/auth/service','../../components/interaction/service','./cmCustomField.controller','get','isAuthenticated','index','/:id','show','put','update','destroy'];(function(_0x47ddfa,_0xea7d22){var _0xc96b54=function(_0x6704cb){while(--_0x6704cb){_0x47ddfa['push'](_0x47ddfa['shift']());}};_0xc96b54(++_0xea7d22);}(_0xb6c4,0xe1));var _0x4b6c=function(_0x34e462,_0x4df7ee){_0x34e462=_0x34e462-0x0;var _0x1b2db5=_0xb6c4[_0x34e462];return _0x1b2db5;};'use strict';var multer=require(_0x4b6c('0x0'));var util=require('util');var path=require(_0x4b6c('0x1'));var timeout=require('connect-timeout');var express=require(_0x4b6c('0x2'));var router=express[_0x4b6c('0x3')]();var auth=require(_0x4b6c('0x4'));var interaction=require(_0x4b6c('0x5'));var config=require('../../config/environment');var controller=require(_0x4b6c('0x6'));router[_0x4b6c('0x7')]('/',auth[_0x4b6c('0x8')](),controller[_0x4b6c('0x9')]);router[_0x4b6c('0x7')](_0x4b6c('0xa'),auth[_0x4b6c('0x8')](),controller[_0x4b6c('0xb')]);router['post']('/',auth[_0x4b6c('0x8')](),controller['create']);router[_0x4b6c('0xc')](_0x4b6c('0xa'),auth['isAuthenticated'](),controller[_0x4b6c('0xd')]);router['delete']('/:id',auth[_0x4b6c('0x8')](),controller[_0x4b6c('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 0093d8c..4b970aa 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 _0xab4d=['contactListQueue','moment','sequelize','exports','STRING','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','DATE','UNSIGNED','BOOLEAN'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xab4d,0x1ae));var _0xdab4=function(_0x12a2a6,_0x374ff1){_0x12a2a6=_0x12a2a6-0x0;var _0x1754ae=_0xab4d[_0x12a2a6];return _0x1754ae;};'use strict';var moment=require(_0xdab4('0x0'));var Sequelize=require(_0xdab4('0x1'));module[_0xdab4('0x2')]={'phone':{'type':Sequelize[_0xdab4('0x3')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0xdab4('0x4')](_0xdab4('0x5'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xdab4('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xdab4('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xdab4('0x7')]},'priority':{'type':Sequelize[_0xdab4('0x6')](0x2)[_0xdab4('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xdab4('0x9')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xdab4('0x6')],'unique':_0xdab4('0xa')},'ListId':{'type':Sequelize[_0xdab4('0x6')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0xdab4('0x6')]},'VoiceQueueId':{'type':Sequelize[_0xdab4('0x6')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0xdab4('0x6')]}}; \ No newline at end of file +var _0xd58c=['UNSIGNED','contactListQueue','moment','sequelize','exports','BOOLEAN','format','INTEGER','STRING'];(function(_0xaf326d,_0xc3a37c){var _0x4aacda=function(_0x48d257){while(--_0x48d257){_0xaf326d['push'](_0xaf326d['shift']());}};_0x4aacda(++_0xc3a37c);}(_0xd58c,0xb6));var _0xcd58=function(_0x53881f,_0x4f7cda){_0x53881f=_0x53881f-0x0;var _0x553a91=_0xd58c[_0x53881f];return _0x553a91;};'use strict';var moment=require(_0xcd58('0x0'));var Sequelize=require(_0xcd58('0x1'));module[_0xcd58('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0xcd58('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0xcd58('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0xcd58('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xcd58('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xcd58('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xcd58('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xcd58('0x6')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xcd58('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xcd58('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xcd58('0x5')],'unique':_0xcd58('0x8')},'ListId':{'type':Sequelize[_0xcd58('0x5')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0xcd58('0x5')]},'VoiceQueueId':{'type':Sequelize[_0xcd58('0x5')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0xcd58('0x5')]}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 87125ad..ffeff00 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 _0xa239=['CmHopper','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','concat','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','catch','show','find','create','body','describe','destroy','params','VoiceQueueId','CampaignId','VoiceQueue','createdAt','state','statedesc','deleted','campaign','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','queue','ivr','CmContact','ContactId','lastName','isNil','firstName','calleridname','finally','getPreview','getVoiceQueues','outbound','dialOrderByScheduledAt','transaction','direction','isEmpty','hopperIds','scheduledAt','DESC','ASC','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','priority','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','LOCK','UPDATE','Contact','CmCompany','Company','CmList','dialActive','getOpenContacts','preview','isNumber','error','CmHopper,\x20%s,\x20%s,\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','update','then','name','send','map'];(function(_0x4c8ffa,_0x432d3d){var _0x3622bc=function(_0x5855e4){while(--_0x5855e4){_0x4c8ffa['push'](_0x4c8ffa['shift']());}};_0x3622bc(++_0x432d3d);}(_0xa239,0xfc));var _0x9a23=function(_0x3888bb,_0x20aec2){_0x3888bb=_0x3888bb-0x0;var _0x5749ab=_0xa239[_0x3888bb];return _0x5749ab;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9a23('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9a23('0x1'));var jsonpatch=require(_0x9a23('0x2'));var rp=require(_0x9a23('0x3'));var moment=require(_0x9a23('0x4'));var BPromise=require(_0x9a23('0x5'));var Mustache=require(_0x9a23('0x6'));var util=require(_0x9a23('0x7'));var path=require(_0x9a23('0x8'));var sox=require(_0x9a23('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x9a23('0xa'));var crypto=require('crypto');var jsforce=require(_0x9a23('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x9a23('0xc'));var querystring=require(_0x9a23('0xd'));var Papa=require(_0x9a23('0xe'));var Redis=require(_0x9a23('0xf'));var authService=require(_0x9a23('0x10'));var qs=require(_0x9a23('0x11'));var as=require(_0x9a23('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9a23('0x13'))(_0x9a23('0x14'));var utils=require(_0x9a23('0x15'));var config=require(_0x9a23('0x16'));var db=require(_0x9a23('0x17'))['db'];function respondWithStatusCode(_0x4cd019,_0x17fb15){_0x17fb15=_0x17fb15||0xcc;return function(_0x4e6fd3){if(_0x4e6fd3){return _0x4cd019[_0x9a23('0x18')](_0x17fb15);}return _0x4cd019[_0x9a23('0x19')](_0x17fb15)[_0x9a23('0x1a')]();};}function respondWithResult(_0x16ed00,_0x59bf36){_0x59bf36=_0x59bf36||0xc8;return function(_0xc5a569){if(_0xc5a569){return _0x16ed00[_0x9a23('0x19')](_0x59bf36)['json'](_0xc5a569);}};}function respondWithFilteredResult(_0x4cae2b,_0x3e3de2){return function(_0x4195b5){if(_0x4195b5){var _0x579382=_0x4195b5[_0x9a23('0x1b')],_0x2ecbbf=_0x3e3de2[_0x9a23('0x1c')],_0x84985d=_0x3e3de2[_0x9a23('0x1c')]+_0x3e3de2[_0x9a23('0x1d')],_0x28ca7d;if(_0x84985d>=_0x579382){_0x84985d=_0x579382;_0x28ca7d=0xc8;}else{_0x28ca7d=0xce;}_0x4cae2b[_0x9a23('0x19')](_0x28ca7d);return _0x4cae2b[_0x9a23('0x1e')](_0x9a23('0x1f'),_0x2ecbbf+'-'+_0x84985d+'/'+_0x579382)[_0x9a23('0x20')](_0x4195b5);}return null;};}function patchUpdates(_0x5687c1){return function(_0x374db6){try{jsonpatch[_0x9a23('0x21')](_0x374db6,_0x5687c1,!![]);}catch(_0x4b6eca){return BPromise[_0x9a23('0x22')](_0x4b6eca);}return _0x374db6['save']();};}function saveUpdates(_0x2525e7,_0xac50a5){return function(_0x19abb0){if(_0x19abb0){return _0x19abb0[_0x9a23('0x23')](_0x2525e7)[_0x9a23('0x24')](function(_0x32145d){return _0x32145d;});}return null;};}function removeEntity(_0x5cc686,_0x2c5b1c){return function(_0x18fbb8){if(_0x18fbb8){return _0x18fbb8['destroy']()[_0x9a23('0x24')](function(){_0x5cc686[_0x9a23('0x19')](0xcc)[_0x9a23('0x1a')]();});}};}function handleEntityNotFound(_0x265c31,_0x17d93e){return function(_0x4ec648){if(!_0x4ec648){_0x265c31['sendStatus'](0x194);}return _0x4ec648;};}function handleError(_0x39cf7b,_0x2b9445){_0x2b9445=_0x2b9445||0x1f4;return function(_0x33ee46){logger['error'](_0x33ee46['stack']);if(_0x33ee46['name']){delete _0x33ee46[_0x9a23('0x25')];}_0x39cf7b[_0x9a23('0x19')](_0x2b9445)[_0x9a23('0x26')](_0x33ee46);};}exports['index']=function(_0x3a1d9d,_0x516e72){var _0x426c45={},_0x4857d5={},_0x51c885={'count':0x0,'rows':[]};var _0x27b15d=_[_0x9a23('0x27')](db[_0x9a23('0x28')][_0x9a23('0x29')],function(_0x1d606d){return{'name':_0x1d606d[_0x9a23('0x2a')],'type':_0x1d606d[_0x9a23('0x2b')][_0x9a23('0x2c')]};});_0x4857d5[_0x9a23('0x2d')]=_[_0x9a23('0x27')](_0x27b15d,_0x9a23('0x25'));_0x4857d5[_0x9a23('0x2e')]=_[_0x9a23('0x2f')](_0x3a1d9d['query']);_0x4857d5[_0x9a23('0x30')]=_[_0x9a23('0x31')](_0x4857d5[_0x9a23('0x2d')],_0x4857d5['query']);_0x4857d5[_0x9a23('0x30')]=_[_0x9a23('0x32')](_0x4857d5[_0x9a23('0x30')],['$and',_0x9a23('0x33'),_0x9a23('0x34'),_0x9a23('0x35'),_0x9a23('0x36'),_0x9a23('0x37'),_0x9a23('0x38'),_0x9a23('0x39'),_0x9a23('0x3a'),'$between',_0x9a23('0x3b'),_0x9a23('0x3c'),_0x9a23('0x3d'),_0x9a23('0x3e'),_0x9a23('0x3f'),_0x9a23('0x40'),_0x9a23('0x41'),_0x9a23('0x3e'),_0x9a23('0x42'),_0x9a23('0x43'),_0x9a23('0x44'),'$any']);_0x426c45['attributes']=_[_0x9a23('0x31')](_0x4857d5[_0x9a23('0x2d')],qs[_0x9a23('0x45')](_0x3a1d9d[_0x9a23('0x2e')]['fields']));_0x426c45[_0x9a23('0x46')]=_0x426c45[_0x9a23('0x46')][_0x9a23('0x47')]?_0x426c45[_0x9a23('0x46')]:_0x4857d5[_0x9a23('0x2d')];if(!_0x3a1d9d['query'][_0x9a23('0x48')](_0x9a23('0x49'))){_0x426c45[_0x9a23('0x1d')]=qs[_0x9a23('0x1d')](_0x3a1d9d[_0x9a23('0x2e')][_0x9a23('0x1d')]);_0x426c45['offset']=qs[_0x9a23('0x1c')](_0x3a1d9d[_0x9a23('0x2e')][_0x9a23('0x1c')]);}_0x426c45[_0x9a23('0x4a')]=qs[_0x9a23('0x4b')](_0x3a1d9d[_0x9a23('0x2e')][_0x9a23('0x4b')]);_0x426c45[_0x9a23('0x4c')]=qs[_0x9a23('0x30')](_[_0x9a23('0x4d')](_0x3a1d9d[_0x9a23('0x2e')],_0x4857d5[_0x9a23('0x30')]));if(_0x3a1d9d[_0x9a23('0x2e')]['filter']){_0x426c45[_0x9a23('0x4c')]=_[_0x9a23('0x4e')](_0x426c45[_0x9a23('0x4c')],{'$or':_['map'](_0x27b15d,function(_0x1d36fa){if(_0x1d36fa[_0x9a23('0x2b')]!=='VIRTUAL'){var _0x482327={};_0x482327[_0x1d36fa[_0x9a23('0x25')]]={'$like':'%'+_0x3a1d9d[_0x9a23('0x2e')][_0x9a23('0x4f')]+'%'};return _0x482327;}})});}_0x426c45=_[_0x9a23('0x4e')]({},_0x426c45,_0x3a1d9d[_0x9a23('0x50')]);var _0x2653b5={'where':_0x426c45[_0x9a23('0x4c')]};return db['CmHopper'][_0x9a23('0x1b')](_0x2653b5)[_0x9a23('0x24')](function(_0x348a63){_0x51c885[_0x9a23('0x1b')]=_0x348a63;if(_0x3a1d9d['query'][_0x9a23('0x51')]){_0x426c45[_0x9a23('0x52')]=[{'all':!![]}];}return db['CmHopper'][_0x9a23('0x53')](_0x426c45);})[_0x9a23('0x24')](function(_0xec3c5f){_0x51c885['rows']=_0xec3c5f;return _0x51c885;})[_0x9a23('0x24')](respondWithFilteredResult(_0x516e72,_0x426c45))[_0x9a23('0x54')](handleError(_0x516e72,null));};exports[_0x9a23('0x55')]=function(_0x13b5c0,_0x269d62){var _0x24b7b1={'raw':!![],'where':{'id':_0x13b5c0['params']['id']}},_0x41c3d7={};_0x41c3d7[_0x9a23('0x2d')]=_[_0x9a23('0x2f')](db[_0x9a23('0x28')][_0x9a23('0x29')]);_0x41c3d7[_0x9a23('0x2e')]=_[_0x9a23('0x2f')](_0x13b5c0[_0x9a23('0x2e')]);_0x41c3d7[_0x9a23('0x30')]=_[_0x9a23('0x31')](_0x41c3d7['model'],_0x41c3d7[_0x9a23('0x2e')]);_0x24b7b1['attributes']=_[_0x9a23('0x31')](_0x41c3d7[_0x9a23('0x2d')],qs[_0x9a23('0x45')](_0x13b5c0[_0x9a23('0x2e')][_0x9a23('0x45')]));_0x24b7b1[_0x9a23('0x46')]=_0x24b7b1[_0x9a23('0x46')]['length']?_0x24b7b1[_0x9a23('0x46')]:_0x41c3d7[_0x9a23('0x2d')];if(_0x13b5c0[_0x9a23('0x2e')][_0x9a23('0x51')]){_0x24b7b1['include']=[{'all':!![]}];}_0x24b7b1=_[_0x9a23('0x4e')]({},_0x24b7b1,_0x13b5c0['options']);return db['CmHopper'][_0x9a23('0x56')](_0x24b7b1)[_0x9a23('0x24')](handleEntityNotFound(_0x269d62,null))['then'](respondWithResult(_0x269d62,null))[_0x9a23('0x54')](handleError(_0x269d62,null));};exports['create']=function(_0x2b2a7a,_0x184a80){return db['CmHopper'][_0x9a23('0x57')](_0x2b2a7a[_0x9a23('0x58')],{})['then'](respondWithResult(_0x184a80,0xc9))['catch'](handleError(_0x184a80,null));};exports[_0x9a23('0x23')]=function(_0x499cfe,_0x29b521){if(_0x499cfe[_0x9a23('0x58')]['id']){delete _0x499cfe['body']['id'];}return db[_0x9a23('0x28')][_0x9a23('0x56')]({'where':{'id':_0x499cfe['params']['id']}})[_0x9a23('0x24')](handleEntityNotFound(_0x29b521,null))[_0x9a23('0x24')](saveUpdates(_0x499cfe[_0x9a23('0x58')],null))[_0x9a23('0x24')](respondWithResult(_0x29b521,null))[_0x9a23('0x54')](handleError(_0x29b521,null));};exports[_0x9a23('0x59')]=function(_0x21b155,_0x313535){return db[_0x9a23('0x28')][_0x9a23('0x59')]()[_0x9a23('0x24')](respondWithResult(_0x313535,null))['catch'](handleError(_0x313535,null));};exports[_0x9a23('0x5a')]=function(_0x33af02,_0x4bb531){var _0xcbe299;return db[_0x9a23('0x28')][_0x9a23('0x56')]({'where':{'id':_0x33af02[_0x9a23('0x5b')]['id']}})[_0x9a23('0x24')](handleEntityNotFound(_0x4bb531,null))[_0x9a23('0x24')](function(_0x44f8eb){if(_0x44f8eb){return _0x44f8eb[_0x9a23('0x5a')]()['then'](function(_0x314376){return _0x314376;});}})[_0x9a23('0x24')](function(_0x36c7ad){_0xcbe299=_0x36c7ad;if(_0x36c7ad){if(_0x36c7ad[_0x9a23('0x5c')]||_0x36c7ad[_0x9a23('0x5d')]){return db[_0x36c7ad[_0x9a23('0x5c')]?_0x9a23('0x5e'):'Campaign']['find']({'where':{'id':_0x36c7ad[_0x9a23('0x5c')]?_0x36c7ad['VoiceQueueId']:_0x36c7ad['CampaignId']},'attributes':['id',_0x9a23('0x25')],'raw':!![]});}}})[_0x9a23('0x24')](function(_0x55c5f1){var _0x1396a6={};if(_0x55c5f1){_['merge'](_0x1396a6,_['omit'](_0xcbe299['dataValues'],[_0x9a23('0x5f'),'updatedAt','id']));_0x1396a6[_0x9a23('0x60')]=0x15;_0x1396a6[_0x9a23('0x61')]=_0x9a23('0x62');_0x1396a6[_0x9a23('0x63')]=_0x55c5f1[_0x9a23('0x25')];_0x1396a6[_0x9a23('0x64')]=_0x33af02[_0x9a23('0x65')][_0x9a23('0x25')];_0x1396a6[_0x9a23('0x66')]=_0x33af02[_0x9a23('0x65')]['id'];_0x1396a6['deleted']=!![];_0x1396a6[_0x9a23('0x67')]=moment()[_0x9a23('0x68')](_0x9a23('0x69'));_0x1396a6['calleridnum']=_0xcbe299[_0x9a23('0x6a')];_0x1396a6[_0x9a23('0x6b')]=_0xcbe299['VoiceQueueId']?_0x9a23('0x6c'):_0x9a23('0x6d');return db[_0x9a23('0x6e')][_0x9a23('0x56')]({'where':{'id':_0x1396a6[_0x9a23('0x6f')]},'attributes':['firstName',_0x9a23('0x70')]})[_0x9a23('0x24')](function(_0x1a2375){if(!_[_0x9a23('0x71')](_0x4bb531)&&!_['isNil'](_0x1a2375[_0x9a23('0x72')])){_0x1396a6['calleridname']=_0x1a2375[_0x9a23('0x72')];if(!_[_0x9a23('0x71')](_0x1a2375['lastName'])){_0x1396a6[_0x9a23('0x73')]+='\x20'+_0x1a2375[_0x9a23('0x70')];}}})[_0x9a23('0x74')](function(){return db['CmHopperFinal']['create'](_0x1396a6);});}})[_0x9a23('0x24')](function(){return _0x4bb531[_0x9a23('0x19')](0xcc)[_0x9a23('0x1a')]();})[_0x9a23('0x54')](handleError(_0x4bb531,null));};exports[_0x9a23('0x75')]=function(_0x5568b1,_0x3af5c9,_0x532ed5){var _0x4d8d1d=[];return db[_0x9a23('0x6e')][_0x9a23('0x59')]()[_0x9a23('0x24')](function(_0x151927){_0x4d8d1d=_[_0x9a23('0x2f')](_0x151927);return _0x5568b1[_0x9a23('0x65')][_0x9a23('0x76')]({'where':{'type':_0x9a23('0x77'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x9a23('0x78')],'raw':!![]});})['then'](function(_0x44843c){if(_0x44843c&&_0x44843c['length']){return db['sequelize'][_0x9a23('0x79')](function(_0x1e39a9){var _0x30cd59={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x9a23('0x69'))},'VoiceQueueId':{'$in':_[_0x9a23('0x27')](_0x44843c,'id')},'$or':[{'UserId':null},{'UserId':_0x5568b1[_0x9a23('0x65')]['id']}]};var _0x58ed31=[];if(_0x5568b1['body']['direction']&&_0x5568b1['body'][_0x9a23('0x7a')]==='prev'){if(!_[_0x9a23('0x7b')](_0x5568b1['body'][_0x9a23('0x7c')])){_0x30cd59['id']={'$in':_0x5568b1[_0x9a23('0x58')][_0x9a23('0x7c')]};}_0x58ed31=[['priority','ASC'],[_0x9a23('0x7d'),_0x44843c[0x0][_0x9a23('0x78')]==='ASC'?_0x9a23('0x7e'):_0x9a23('0x7f')],db[_0x9a23('0x80')][_0x9a23('0x81')](_0x9a23('0x82')),['id',_0x9a23('0x7e')]];}else{if(!_['isEmpty'](_0x5568b1[_0x9a23('0x58')]['hopperIds'])){_0x30cd59['id']={'$notIn':_0x5568b1[_0x9a23('0x58')][_0x9a23('0x7c')]};}_0x58ed31=[[_0x9a23('0x83'),_0x9a23('0x7e')],['scheduledAt',_0x44843c[0x0][_0x9a23('0x78')]],db['sequelize'][_0x9a23('0x81')](_0x9a23('0x84')),['id','ASC']];}return db[_0x9a23('0x28')][_0x9a23('0x85')]({'attributes':['id','scheduledat'],'where':_0x30cd59,'order':_0x58ed31,'transaction':_0x1e39a9,'lock':_0x1e39a9[_0x9a23('0x86')][_0x9a23('0x87')],'include':[{'model':db[_0x9a23('0x6e')],'as':_0x9a23('0x88'),'attributes':_0x4d8d1d,'include':[{'model':db[_0x9a23('0x89')],'as':_0x9a23('0x8a'),'attributes':['id',_0x9a23('0x25')]}]},{'model':db[_0x9a23('0x8b')],'as':'List','attributes':['id',_0x9a23('0x25')]},{'model':db[_0x9a23('0x5e')],'as':'Queue','attributes':['id','name',_0x9a23('0x8c')]}]})[_0x9a23('0x24')](function(_0x54db1d){if(_0x54db1d){return _0x54db1d[_0x9a23('0x23')]({'UserId':_0x5568b1[_0x9a23('0x65')]['id']},{'transaction':_0x1e39a9});}});});}})['then'](handleEntityNotFound(_0x3af5c9,null))[_0x9a23('0x24')](respondWithResult(_0x3af5c9,null))[_0x9a23('0x54')](handleError(_0x3af5c9,null));};exports[_0x9a23('0x8d')]=function(_0x2f8808,_0x2fe271,_0x2b477f){return _0x2f8808[_0x9a23('0x65')][_0x9a23('0x76')]({'where':{'type':_0x9a23('0x77'),'dialActive':!![],'dialMethod':_0x9a23('0x8e')},'attributes':['id'],'raw':!![]})[_0x9a23('0x24')](function(_0x1e0940){if(_0x1e0940&&_0x1e0940[_0x9a23('0x47')]){return db[_0x9a23('0x28')][_0x9a23('0x1b')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x9a23('0x68')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x9a23('0x27')](_0x1e0940,'id')},'$or':[{'UserId':null},{'UserId':_0x2f8808[_0x9a23('0x65')]['id']}]}});}return 0x0;})[_0x9a23('0x24')](function(_0xadeeeb){if(!_[_0x9a23('0x71')](_0xadeeeb)&&_[_0x9a23('0x8f')](_0xadeeeb)){return _0x2fe271[_0x9a23('0x19')](0xc8)[_0x9a23('0x20')]({'contacts':_0xadeeeb});}else{logger[_0x9a23('0x90')](_0x9a23('0x91'),_0x9a23('0x8d'),0x194,'entity\x20not\x20found');_0x2fe271[_0x9a23('0x18')](0x194);}})['catch'](handleError(_0x2fe271,null));}; \ No newline at end of file +var _0xc401=['$notILike','$overlap','$contains','$any','attributes','fields','nolimit','limit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','CmHopper','findAll','rows','show','params','length','find','catch','create','body','update','describe','VoiceQueueId','CampaignId','Campaign','dataValues','updatedAt','state','statedesc','deleted','campaign','user','UserId','deletedat','YYYY-MM-DD\x20HH:mm:ss','campaigntype','ivr','CmContact','ContactId','isNil','firstName','calleridname','lastName','finally','CmHopperFinal','getPreview','getVoiceQueues','outbound','dialOrderByScheduledAt','sequelize','transaction','format','direction','prev','isEmpty','hopperIds','priority','ASC','DESC','COALESCE(CmHopper.UserId,\x200)\x20ASC','scheduledAt','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','LOCK','UPDATE','Contact','Company','List','VoiceQueue','dialActive','preview','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','concat','$and','$or','$gt','$gte','$lt','$ne','$not','$between','$notBetween','$in','$like','$notLike'];(function(_0xcfc913,_0xf4e2cd){var _0x2a5de1=function(_0x40b05d){while(--_0x40b05d){_0xcfc913['push'](_0xcfc913['shift']());}};_0x2a5de1(++_0xf4e2cd);}(_0xc401,0xe6));var _0x1c40=function(_0x4843ac,_0x3d25e7){_0x4843ac=_0x4843ac-0x0;var _0x14e72f=_0xc401[_0x4843ac];return _0x14e72f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1c40('0x0'));var rimraf=require(_0x1c40('0x1'));var zipdir=require(_0x1c40('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1c40('0x3'));var moment=require(_0x1c40('0x4'));var BPromise=require(_0x1c40('0x5'));var Mustache=require('mustache');var util=require(_0x1c40('0x6'));var path=require(_0x1c40('0x7'));var sox=require(_0x1c40('0x8'));var csv=require('to-csv');var ejs=require(_0x1c40('0x9'));var fs=require('fs');var _=require(_0x1c40('0xa'));var squel=require(_0x1c40('0xb'));var crypto=require('crypto');var jsforce=require(_0x1c40('0xc'));var deskjs=require(_0x1c40('0xd'));var toCsv=require(_0x1c40('0xe'));var querystring=require(_0x1c40('0xf'));var Papa=require(_0x1c40('0x10'));var Redis=require(_0x1c40('0x11'));var authService=require(_0x1c40('0x12'));var qs=require(_0x1c40('0x13'));var as=require(_0x1c40('0x14'));var hardwareService=require(_0x1c40('0x15'));var logger=require('../../config/logger')(_0x1c40('0x16'));var utils=require(_0x1c40('0x17'));var config=require('../../config/environment');var db=require(_0x1c40('0x18'))['db'];function respondWithStatusCode(_0x2c21fc,_0x46272e){_0x46272e=_0x46272e||0xcc;return function(_0xcd3803){if(_0xcd3803){return _0x2c21fc[_0x1c40('0x19')](_0x46272e);}return _0x2c21fc[_0x1c40('0x1a')](_0x46272e)[_0x1c40('0x1b')]();};}function respondWithResult(_0x342d45,_0x853d76){_0x853d76=_0x853d76||0xc8;return function(_0x40fa0b){if(_0x40fa0b){return _0x342d45[_0x1c40('0x1a')](_0x853d76)[_0x1c40('0x1c')](_0x40fa0b);}};}function respondWithFilteredResult(_0x240e4,_0x5dd312){return function(_0x2a2db7){if(_0x2a2db7){var _0x16d75c=_0x2a2db7[_0x1c40('0x1d')],_0x39cc96=_0x5dd312['offset'],_0x38eb44=_0x5dd312[_0x1c40('0x1e')]+_0x5dd312['limit'],_0x203c45;if(_0x38eb44>=_0x16d75c){_0x38eb44=_0x16d75c;_0x203c45=0xc8;}else{_0x203c45=0xce;}_0x240e4[_0x1c40('0x1a')](_0x203c45);return _0x240e4[_0x1c40('0x1f')](_0x1c40('0x20'),_0x39cc96+'-'+_0x38eb44+'/'+_0x16d75c)['json'](_0x2a2db7);}return null;};}function patchUpdates(_0x4cb4d5){return function(_0x48aa19){try{jsonpatch[_0x1c40('0x21')](_0x48aa19,_0x4cb4d5,!![]);}catch(_0x43ff56){return BPromise[_0x1c40('0x22')](_0x43ff56);}return _0x48aa19['save']();};}function saveUpdates(_0x4ec206,_0x7bf9ec){return function(_0x13e597){if(_0x13e597){return _0x13e597['update'](_0x4ec206)['then'](function(_0x408f1c){return _0x408f1c;});}return null;};}function removeEntity(_0x303add,_0x5ab0a1){return function(_0x263f2c){if(_0x263f2c){return _0x263f2c[_0x1c40('0x23')]()[_0x1c40('0x24')](function(){_0x303add[_0x1c40('0x1a')](0xcc)[_0x1c40('0x1b')]();});}};}function handleEntityNotFound(_0x50d83b,_0x4bbedd){return function(_0x5289b7){if(!_0x5289b7){_0x50d83b[_0x1c40('0x19')](0x194);}return _0x5289b7;};}function handleError(_0x24204e,_0x37e535){_0x37e535=_0x37e535||0x1f4;return function(_0x45f7ad){logger[_0x1c40('0x25')](_0x45f7ad[_0x1c40('0x26')]);if(_0x45f7ad['name']){delete _0x45f7ad[_0x1c40('0x27')];}_0x24204e[_0x1c40('0x1a')](_0x37e535)[_0x1c40('0x28')](_0x45f7ad);};}exports[_0x1c40('0x29')]=function(_0xfb7429,_0x132906){var _0x25dabb={},_0x53888e={},_0x1cafe8={'count':0x0,'rows':[]};var _0x13f8be=_[_0x1c40('0x2a')](db['CmHopper'][_0x1c40('0x2b')],function(_0x239f2c){return{'name':_0x239f2c[_0x1c40('0x2c')],'type':_0x239f2c[_0x1c40('0x2d')]['key']};});_0x53888e[_0x1c40('0x2e')]=_[_0x1c40('0x2a')](_0x13f8be,_0x1c40('0x27'));_0x53888e[_0x1c40('0x2f')]=_[_0x1c40('0x30')](_0xfb7429[_0x1c40('0x2f')]);_0x53888e[_0x1c40('0x31')]=_[_0x1c40('0x32')](_0x53888e[_0x1c40('0x2e')],_0x53888e[_0x1c40('0x2f')]);_0x53888e[_0x1c40('0x31')]=_[_0x1c40('0x33')](_0x53888e[_0x1c40('0x31')],[_0x1c40('0x34'),_0x1c40('0x35'),_0x1c40('0x36'),_0x1c40('0x37'),_0x1c40('0x38'),'$lte',_0x1c40('0x39'),'$eq',_0x1c40('0x3a'),_0x1c40('0x3b'),_0x1c40('0x3c'),_0x1c40('0x3d'),'$notIn',_0x1c40('0x3e'),_0x1c40('0x3f'),'$iLike',_0x1c40('0x40'),_0x1c40('0x3e'),_0x1c40('0x41'),_0x1c40('0x42'),'$contained',_0x1c40('0x43')]);_0x25dabb[_0x1c40('0x44')]=_['intersection'](_0x53888e[_0x1c40('0x2e')],qs[_0x1c40('0x45')](_0xfb7429[_0x1c40('0x2f')]['fields']));_0x25dabb[_0x1c40('0x44')]=_0x25dabb['attributes']['length']?_0x25dabb[_0x1c40('0x44')]:_0x53888e[_0x1c40('0x2e')];if(!_0xfb7429['query']['hasOwnProperty'](_0x1c40('0x46'))){_0x25dabb[_0x1c40('0x47')]=qs[_0x1c40('0x47')](_0xfb7429[_0x1c40('0x2f')][_0x1c40('0x47')]);_0x25dabb[_0x1c40('0x1e')]=qs[_0x1c40('0x1e')](_0xfb7429[_0x1c40('0x2f')][_0x1c40('0x1e')]);}_0x25dabb['order']=qs['sort'](_0xfb7429[_0x1c40('0x2f')][_0x1c40('0x48')]);_0x25dabb['where']=qs[_0x1c40('0x31')](_[_0x1c40('0x49')](_0xfb7429[_0x1c40('0x2f')],_0x53888e[_0x1c40('0x31')]));if(_0xfb7429['query'][_0x1c40('0x4a')]){_0x25dabb[_0x1c40('0x4b')]=_['merge'](_0x25dabb[_0x1c40('0x4b')],{'$or':_[_0x1c40('0x2a')](_0x13f8be,function(_0x4398ae){if(_0x4398ae[_0x1c40('0x2d')]!==_0x1c40('0x4c')){var _0x8c2703={};_0x8c2703[_0x4398ae[_0x1c40('0x27')]]={'$like':'%'+_0xfb7429[_0x1c40('0x2f')]['filter']+'%'};return _0x8c2703;}})});}_0x25dabb=_[_0x1c40('0x4d')]({},_0x25dabb,_0xfb7429[_0x1c40('0x4e')]);var _0x1b0549={'where':_0x25dabb[_0x1c40('0x4b')]};return db['CmHopper'][_0x1c40('0x1d')](_0x1b0549)[_0x1c40('0x24')](function(_0x558d00){_0x1cafe8[_0x1c40('0x1d')]=_0x558d00;if(_0xfb7429[_0x1c40('0x2f')][_0x1c40('0x4f')]){_0x25dabb[_0x1c40('0x50')]=[{'all':!![]}];}return db[_0x1c40('0x51')][_0x1c40('0x52')](_0x25dabb);})[_0x1c40('0x24')](function(_0x1a38fd){_0x1cafe8[_0x1c40('0x53')]=_0x1a38fd;return _0x1cafe8;})[_0x1c40('0x24')](respondWithFilteredResult(_0x132906,_0x25dabb))['catch'](handleError(_0x132906,null));};exports[_0x1c40('0x54')]=function(_0x362fce,_0x5514d4){var _0xb68ce8={'raw':!![],'where':{'id':_0x362fce[_0x1c40('0x55')]['id']}},_0x45e742={};_0x45e742['model']=_['keys'](db[_0x1c40('0x51')][_0x1c40('0x2b')]);_0x45e742[_0x1c40('0x2f')]=_['keys'](_0x362fce['query']);_0x45e742[_0x1c40('0x31')]=_['intersection'](_0x45e742[_0x1c40('0x2e')],_0x45e742[_0x1c40('0x2f')]);_0xb68ce8[_0x1c40('0x44')]=_[_0x1c40('0x32')](_0x45e742['model'],qs[_0x1c40('0x45')](_0x362fce[_0x1c40('0x2f')][_0x1c40('0x45')]));_0xb68ce8[_0x1c40('0x44')]=_0xb68ce8[_0x1c40('0x44')][_0x1c40('0x56')]?_0xb68ce8[_0x1c40('0x44')]:_0x45e742['model'];if(_0x362fce[_0x1c40('0x2f')][_0x1c40('0x4f')]){_0xb68ce8['include']=[{'all':!![]}];}_0xb68ce8=_[_0x1c40('0x4d')]({},_0xb68ce8,_0x362fce[_0x1c40('0x4e')]);return db[_0x1c40('0x51')][_0x1c40('0x57')](_0xb68ce8)[_0x1c40('0x24')](handleEntityNotFound(_0x5514d4,null))['then'](respondWithResult(_0x5514d4,null))[_0x1c40('0x58')](handleError(_0x5514d4,null));};exports[_0x1c40('0x59')]=function(_0x165dfc,_0x1f080a){return db[_0x1c40('0x51')][_0x1c40('0x59')](_0x165dfc[_0x1c40('0x5a')],{})[_0x1c40('0x24')](respondWithResult(_0x1f080a,0xc9))[_0x1c40('0x58')](handleError(_0x1f080a,null));};exports[_0x1c40('0x5b')]=function(_0x476b30,_0xe641d9){if(_0x476b30['body']['id']){delete _0x476b30['body']['id'];}return db['CmHopper'][_0x1c40('0x57')]({'where':{'id':_0x476b30[_0x1c40('0x55')]['id']}})[_0x1c40('0x24')](handleEntityNotFound(_0xe641d9,null))[_0x1c40('0x24')](saveUpdates(_0x476b30['body'],null))[_0x1c40('0x24')](respondWithResult(_0xe641d9,null))[_0x1c40('0x58')](handleError(_0xe641d9,null));};exports[_0x1c40('0x5c')]=function(_0x554e63,_0x48e640){return db[_0x1c40('0x51')][_0x1c40('0x5c')]()[_0x1c40('0x24')](respondWithResult(_0x48e640,null))[_0x1c40('0x58')](handleError(_0x48e640,null));};exports[_0x1c40('0x23')]=function(_0x51dd77,_0x5eca2b){var _0x494619;return db[_0x1c40('0x51')][_0x1c40('0x57')]({'where':{'id':_0x51dd77['params']['id']}})[_0x1c40('0x24')](handleEntityNotFound(_0x5eca2b,null))[_0x1c40('0x24')](function(_0x362531){if(_0x362531){return _0x362531[_0x1c40('0x23')]()[_0x1c40('0x24')](function(_0x567bfa){return _0x567bfa;});}})[_0x1c40('0x24')](function(_0x3a782){_0x494619=_0x3a782;if(_0x3a782){if(_0x3a782[_0x1c40('0x5d')]||_0x3a782[_0x1c40('0x5e')]){return db[_0x3a782[_0x1c40('0x5d')]?'VoiceQueue':_0x1c40('0x5f')][_0x1c40('0x57')]({'where':{'id':_0x3a782[_0x1c40('0x5d')]?_0x3a782[_0x1c40('0x5d')]:_0x3a782['CampaignId']},'attributes':['id','name'],'raw':!![]});}}})['then'](function(_0x1619d2){var _0x422821={};if(_0x1619d2){_[_0x1c40('0x4d')](_0x422821,_['omit'](_0x494619[_0x1c40('0x60')],['createdAt',_0x1c40('0x61'),'id']));_0x422821[_0x1c40('0x62')]=0x15;_0x422821[_0x1c40('0x63')]=_0x1c40('0x64');_0x422821[_0x1c40('0x65')]=_0x1619d2[_0x1c40('0x27')];_0x422821['membername']=_0x51dd77[_0x1c40('0x66')][_0x1c40('0x27')];_0x422821[_0x1c40('0x67')]=_0x51dd77[_0x1c40('0x66')]['id'];_0x422821['deleted']=!![];_0x422821[_0x1c40('0x68')]=moment()['format'](_0x1c40('0x69'));_0x422821['calleridnum']=_0x494619['phone'];_0x422821[_0x1c40('0x6a')]=_0x494619['VoiceQueueId']?'queue':_0x1c40('0x6b');return db[_0x1c40('0x6c')][_0x1c40('0x57')]({'where':{'id':_0x422821[_0x1c40('0x6d')]},'attributes':['firstName','lastName']})[_0x1c40('0x24')](function(_0x286cc3){if(!_['isNil'](_0x5eca2b)&&!_[_0x1c40('0x6e')](_0x286cc3[_0x1c40('0x6f')])){_0x422821[_0x1c40('0x70')]=_0x286cc3[_0x1c40('0x6f')];if(!_[_0x1c40('0x6e')](_0x286cc3[_0x1c40('0x71')])){_0x422821[_0x1c40('0x70')]+='\x20'+_0x286cc3[_0x1c40('0x71')];}}})[_0x1c40('0x72')](function(){return db[_0x1c40('0x73')][_0x1c40('0x59')](_0x422821);});}})[_0x1c40('0x24')](function(){return _0x5eca2b[_0x1c40('0x1a')](0xcc)[_0x1c40('0x1b')]();})[_0x1c40('0x58')](handleError(_0x5eca2b,null));};exports[_0x1c40('0x74')]=function(_0x4f4abe,_0xff097f,_0x2046e0){var _0x100278=[];return db['CmContact'][_0x1c40('0x5c')]()['then'](function(_0x568afb){_0x100278=_[_0x1c40('0x30')](_0x568afb);return _0x4f4abe['user'][_0x1c40('0x75')]({'where':{'type':_0x1c40('0x76'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x1c40('0x77')],'raw':!![]});})[_0x1c40('0x24')](function(_0x31931c){if(_0x31931c&&_0x31931c[_0x1c40('0x56')]){return db[_0x1c40('0x78')][_0x1c40('0x79')](function(_0x500281){var _0x50619a={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x1c40('0x7a')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_['map'](_0x31931c,'id')},'$or':[{'UserId':null},{'UserId':_0x4f4abe['user']['id']}]};var _0x16f1d2=[];if(_0x4f4abe['body']['direction']&&_0x4f4abe[_0x1c40('0x5a')][_0x1c40('0x7b')]===_0x1c40('0x7c')){if(!_[_0x1c40('0x7d')](_0x4f4abe[_0x1c40('0x5a')][_0x1c40('0x7e')])){_0x50619a['id']={'$in':_0x4f4abe[_0x1c40('0x5a')]['hopperIds']};}_0x16f1d2=[[_0x1c40('0x7f'),_0x1c40('0x80')],['scheduledAt',_0x31931c[0x0][_0x1c40('0x77')]===_0x1c40('0x80')?_0x1c40('0x81'):'ASC'],db[_0x1c40('0x78')]['literal'](_0x1c40('0x82')),['id',_0x1c40('0x81')]];}else{if(!_['isEmpty'](_0x4f4abe[_0x1c40('0x5a')][_0x1c40('0x7e')])){_0x50619a['id']={'$notIn':_0x4f4abe[_0x1c40('0x5a')][_0x1c40('0x7e')]};}_0x16f1d2=[['priority',_0x1c40('0x81')],[_0x1c40('0x83'),_0x31931c[0x0][_0x1c40('0x77')]],db[_0x1c40('0x78')][_0x1c40('0x84')](_0x1c40('0x85')),['id','ASC']];}return db[_0x1c40('0x51')][_0x1c40('0x86')]({'attributes':['id','scheduledat'],'where':_0x50619a,'order':_0x16f1d2,'transaction':_0x500281,'lock':_0x500281[_0x1c40('0x87')][_0x1c40('0x88')],'include':[{'model':db[_0x1c40('0x6c')],'as':_0x1c40('0x89'),'attributes':_0x100278,'include':[{'model':db['CmCompany'],'as':_0x1c40('0x8a'),'attributes':['id','name']}]},{'model':db['CmList'],'as':_0x1c40('0x8b'),'attributes':['id',_0x1c40('0x27')]},{'model':db[_0x1c40('0x8c')],'as':'Queue','attributes':['id','name',_0x1c40('0x8d')]}]})[_0x1c40('0x24')](function(_0x29edfc){if(_0x29edfc){return _0x29edfc[_0x1c40('0x5b')]({'UserId':_0x4f4abe[_0x1c40('0x66')]['id']},{'transaction':_0x500281});}});});}})[_0x1c40('0x24')](handleEntityNotFound(_0xff097f,null))[_0x1c40('0x24')](respondWithResult(_0xff097f,null))['catch'](handleError(_0xff097f,null));};exports['getOpenContacts']=function(_0x452e77,_0x251253,_0x219470){return _0x452e77[_0x1c40('0x66')][_0x1c40('0x75')]({'where':{'type':_0x1c40('0x76'),'dialActive':!![],'dialMethod':_0x1c40('0x8e')},'attributes':['id'],'raw':!![]})[_0x1c40('0x24')](function(_0x4003f0){if(_0x4003f0&&_0x4003f0[_0x1c40('0x56')]){return db[_0x1c40('0x51')][_0x1c40('0x1d')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x1c40('0x7a')](_0x1c40('0x69'))},'VoiceQueueId':{'$in':_['map'](_0x4003f0,'id')},'$or':[{'UserId':null},{'UserId':_0x452e77[_0x1c40('0x66')]['id']}]}});}return 0x0;})[_0x1c40('0x24')](function(_0x50c0d6){if(!_['isNil'](_0x50c0d6)&&_[_0x1c40('0x8f')](_0x50c0d6)){return _0x251253[_0x1c40('0x1a')](0xc8)[_0x1c40('0x1c')]({'contacts':_0x50c0d6});}else{logger[_0x1c40('0x25')](_0x1c40('0x90'),_0x1c40('0x91'),0x194,_0x1c40('0x92'));_0x251253[_0x1c40('0x19')](0x194);}})['catch'](handleError(_0x251253,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index f145daf..4c84c71 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 _0x5d11=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','cm_hopper','scheduledat','phone','priority','util'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0x5d11,0x1b2));var _0x15d1=function(_0x2efe4f,_0x35b3d9){_0x2efe4f=_0x2efe4f-0x0;var _0x251e7e=_0x5d11[_0x2efe4f];return _0x251e7e;};'use strict';var _=require('lodash');var util=require(_0x15d1('0x0'));var logger=require(_0x15d1('0x1'))(_0x15d1('0x2'));var moment=require(_0x15d1('0x3'));var BPromise=require(_0x15d1('0x4'));var rp=require(_0x15d1('0x5'));var fs=require('fs');var path=require(_0x15d1('0x6'));var rimraf=require(_0x15d1('0x7'));var config=require(_0x15d1('0x8'));var attributes=require('./cmHopper.attributes');module[_0x15d1('0x9')]=function(_0x18af67,_0x5c5189){return _0x18af67[_0x15d1('0xa')]('CmHopper',attributes,{'tableName':_0x15d1('0xb'),'paranoid':![],'indexes':[{'name':_0x15d1('0xc'),'fields':[_0x15d1('0xc')]},{'name':'phone','fields':[_0x15d1('0xd')]},{'name':'priority','fields':[_0x15d1('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb3b6=['api','bluebird','request-promise','path','rimraf','./cmHopper.attributes','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger'];(function(_0x5d402e,_0x5ce315){var _0x3e08e2=function(_0x16ae39){while(--_0x16ae39){_0x5d402e['push'](_0x5d402e['shift']());}};_0x3e08e2(++_0x5ce315);}(_0xb3b6,0x147));var _0x6b3b=function(_0x3a1d90,_0x23a409){_0x3a1d90=_0x3a1d90-0x0;var _0x5c9818=_0xb3b6[_0x3a1d90];return _0x5c9818;};'use strict';var _=require(_0x6b3b('0x0'));var util=require(_0x6b3b('0x1'));var logger=require(_0x6b3b('0x2'))(_0x6b3b('0x3'));var moment=require('moment');var BPromise=require(_0x6b3b('0x4'));var rp=require(_0x6b3b('0x5'));var fs=require('fs');var path=require(_0x6b3b('0x6'));var rimraf=require(_0x6b3b('0x7'));var config=require('../../config/environment');var attributes=require(_0x6b3b('0x8'));module['exports']=function(_0x4d53c6,_0x1be51a){return _0x4d53c6[_0x6b3b('0x9')](_0x6b3b('0xa'),attributes,{'tableName':_0x6b3b('0xb'),'paranoid':![],'indexes':[{'name':'scheduledat','fields':[_0x6b3b('0xc')]},{'name':_0x6b3b('0xd'),'fields':[_0x6b3b('0xd')]},{'name':_0x6b3b('0xe'),'fields':[_0x6b3b('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 036fe5b..2de3b08 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 _0x67d3=['transaction','UPDATE','Contact','keys','length','all','GetContactDialer','MoveContactManagedDialer','CmHopperFinal','COUNT','literal','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','contactsRescheduled','CountReScheduled','GetContactRecallMe','order','UserId','LOCK','push','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','limit','include','map','model','stringify','ShowCmHopper','find','CreateCmHopper','create','body','UpdateCmHopper','update','debug','DestroyCmHopper','destroy','CmContact','sequelize'];(function(_0x156512,_0x2f8019){var _0x3e73f2=function(_0x3d6838){while(--_0x3d6838){_0x156512['push'](_0x156512['shift']());}};_0x3e73f2(++_0x2f8019);}(_0x67d3,0x150));var _0x367d=function(_0x299e56,_0x3b63c8){_0x299e56=_0x299e56-0x0;var _0x1924f5=_0x67d3[_0x299e56];return _0x1924f5;};'use strict';var _=require('lodash');var util=require(_0x367d('0x0'));var moment=require('moment');var BPromise=require(_0x367d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x367d('0x2'));var db=require(_0x367d('0x3'))['db'];var utils=require(_0x367d('0x4'));var logger=require(_0x367d('0x5'))(_0x367d('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x367d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2c6b62,_0x2ca00f,_0x22e9bf){return new BPromise(function(_0x195aa7,_0x38447f){return client[_0x367d('0x8')](_0x2c6b62,_0x22e9bf)[_0x367d('0x9')](function(_0x1116c3){logger[_0x367d('0xa')](_0x367d('0xb'),_0x2ca00f,_0x367d('0xc'));logger['debug']('CmHopper,\x20%s,\x20%s,\x20%s',_0x2ca00f,_0x367d('0xc'),JSON['stringify'](_0x1116c3));if(_0x1116c3[_0x367d('0xd')]){if(_0x1116c3[_0x367d('0xd')][_0x367d('0xe')]===0x1f4){logger[_0x367d('0xd')]('CmHopper,\x20%s,\x20%s',_0x2ca00f,_0x1116c3['error']['message']);return _0x38447f(_0x1116c3[_0x367d('0xd')]['message']);}logger[_0x367d('0xd')]('CmHopper,\x20%s,\x20%s',_0x2ca00f,_0x1116c3[_0x367d('0xd')][_0x367d('0xf')]);return _0x195aa7(_0x1116c3[_0x367d('0xd')][_0x367d('0xf')]);}else{logger[_0x367d('0xa')]('CmHopper,\x20%s,\x20%s',_0x2ca00f,_0x367d('0xc'));_0x195aa7(_0x1116c3[_0x367d('0x10')]['message']);}})[_0x367d('0x11')](function(_0x3c014e){logger[_0x367d('0xd')](_0x367d('0xb'),_0x2ca00f,_0x3c014e);_0x38447f(_0x3c014e);});});}exports[_0x367d('0x12')]=function(_0x4093f3){var _0x43325b=this;return new Promise(function(_0x33e6a5,_0x31da15){return db[_0x367d('0x13')][_0x367d('0x14')]({'raw':_0x4093f3[_0x367d('0x15')]?_0x4093f3[_0x367d('0x15')][_0x367d('0x16')]===undefined?!![]:![]:!![],'where':_0x4093f3[_0x367d('0x15')]?_0x4093f3[_0x367d('0x15')][_0x367d('0x17')]||null:null,'attributes':_0x4093f3[_0x367d('0x15')]?_0x4093f3[_0x367d('0x15')][_0x367d('0x18')]||null:null,'limit':_0x4093f3[_0x367d('0x15')]?_0x4093f3[_0x367d('0x15')][_0x367d('0x19')]||null:null,'include':_0x4093f3[_0x367d('0x15')]?_0x4093f3[_0x367d('0x15')][_0x367d('0x1a')]?_[_0x367d('0x1b')](_0x4093f3[_0x367d('0x15')]['include'],function(_0x4d0044){return{'model':db[_0x4d0044[_0x367d('0x1c')]],'as':_0x4d0044['as'],'attributes':_0x4d0044[_0x367d('0x18')],'include':_0x4d0044[_0x367d('0x1a')]?_['map'](_0x4d0044[_0x367d('0x1a')],function(_0x3cae1d){return{'model':db[_0x3cae1d[_0x367d('0x1c')]],'as':_0x3cae1d['as'],'attributes':_0x3cae1d[_0x367d('0x18')],'include':_0x3cae1d[_0x367d('0x1a')]?_[_0x367d('0x1b')](_0x3cae1d[_0x367d('0x1a')],function(_0x342a16){return{'model':db[_0x342a16[_0x367d('0x1c')]],'as':_0x342a16['as'],'attributes':_0x342a16[_0x367d('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1e7b16){logger[_0x367d('0xa')](_0x367d('0x12'),_0x4093f3);logger['debug'](_0x367d('0x12'),_0x4093f3,JSON[_0x367d('0x1d')](_0x1e7b16));_0x33e6a5(_0x1e7b16);})['catch'](function(_0x4b32e4){logger[_0x367d('0xd')](_0x367d('0x12'),_0x4b32e4[_0x367d('0xf')],_0x4093f3);_0x31da15(_0x43325b[_0x367d('0xd')](0x1f4,_0x4b32e4['message']));});});};exports[_0x367d('0x1e')]=function(_0xe2e98d){var _0x580bc8=this;return new Promise(function(_0x5af247,_0x2c3fec){return db['CmHopper'][_0x367d('0x1f')]({'raw':_0xe2e98d[_0x367d('0x15')]?_0xe2e98d['options'][_0x367d('0x16')]===undefined?!![]:![]:!![],'where':_0xe2e98d[_0x367d('0x15')]?_0xe2e98d[_0x367d('0x15')][_0x367d('0x17')]||null:null,'attributes':_0xe2e98d[_0x367d('0x15')]?_0xe2e98d[_0x367d('0x15')]['attributes']||null:null,'include':_0xe2e98d[_0x367d('0x15')]?_0xe2e98d[_0x367d('0x15')][_0x367d('0x1a')]?_[_0x367d('0x1b')](_0xe2e98d[_0x367d('0x15')]['include'],function(_0x50913a){return{'model':db[_0x50913a[_0x367d('0x1c')]],'as':_0x50913a['as'],'attributes':_0x50913a[_0x367d('0x18')],'include':_0x50913a[_0x367d('0x1a')]?_[_0x367d('0x1b')](_0x50913a[_0x367d('0x1a')],function(_0x1509b0){return{'model':db[_0x1509b0['model']],'as':_0x1509b0['as'],'attributes':_0x1509b0['attributes'],'include':_0x1509b0[_0x367d('0x1a')]?_[_0x367d('0x1b')](_0x1509b0[_0x367d('0x1a')],function(_0x49eb25){return{'model':db[_0x49eb25[_0x367d('0x1c')]],'as':_0x49eb25['as'],'attributes':_0x49eb25[_0x367d('0x18')]};}):[]};}):[]};}):[]:[]})[_0x367d('0x9')](function(_0x480e51){logger[_0x367d('0xa')]('ShowCmHopper',_0xe2e98d);logger['debug']('ShowCmHopper',_0xe2e98d,JSON[_0x367d('0x1d')](_0x480e51));_0x5af247(_0x480e51);})[_0x367d('0x11')](function(_0x508d2c){logger['error']('ShowCmHopper',_0x508d2c[_0x367d('0xf')],_0xe2e98d);_0x2c3fec(_0x580bc8['error'](0x1f4,_0x508d2c[_0x367d('0xf')]));});});};exports[_0x367d('0x20')]=function(_0xf4cf23){var _0x44b023=this;return new Promise(function(_0x25b998,_0xe5ee5){return db[_0x367d('0x13')][_0x367d('0x21')](_0xf4cf23[_0x367d('0x22')],{'raw':_0xf4cf23[_0x367d('0x15')]?_0xf4cf23[_0x367d('0x15')][_0x367d('0x16')]===undefined?!![]:![]:!![]})[_0x367d('0x9')](function(_0x2450ce){logger['info'](_0x367d('0x20'),_0xf4cf23);logger['debug'](_0x367d('0x20'),_0xf4cf23,JSON[_0x367d('0x1d')](_0x2450ce));_0x25b998(_0x2450ce);})[_0x367d('0x11')](function(_0xf2fea5){logger[_0x367d('0xd')](_0x367d('0x20'),_0xf2fea5[_0x367d('0xf')],_0xf4cf23);_0xe5ee5(_0x44b023[_0x367d('0xd')](0x1f4,_0xf2fea5[_0x367d('0xf')]));});});};exports[_0x367d('0x23')]=function(_0x2ce5a5){var _0x1aa1c6=this;return new Promise(function(_0x52c291,_0x392739){return db[_0x367d('0x13')][_0x367d('0x24')](_0x2ce5a5[_0x367d('0x22')],{'raw':_0x2ce5a5[_0x367d('0x15')]?_0x2ce5a5[_0x367d('0x15')][_0x367d('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ce5a5[_0x367d('0x15')]?_0x2ce5a5[_0x367d('0x15')][_0x367d('0x17')]||null:null,'attributes':_0x2ce5a5['options']?_0x2ce5a5[_0x367d('0x15')]['attributes']||null:null,'limit':_0x2ce5a5[_0x367d('0x15')]?_0x2ce5a5['options']['limit']||null:null})[_0x367d('0x9')](function(_0xc00fb6){logger[_0x367d('0xa')](_0x367d('0x23'),_0x2ce5a5);logger[_0x367d('0x25')](_0x367d('0x23'),_0x2ce5a5,JSON['stringify'](_0xc00fb6));_0x52c291(_0xc00fb6);})[_0x367d('0x11')](function(_0x266c1e){logger['error'](_0x367d('0x23'),_0x266c1e[_0x367d('0xf')],_0x2ce5a5);_0x392739(_0x1aa1c6[_0x367d('0xd')](0x1f4,_0x266c1e[_0x367d('0xf')]));});});};exports[_0x367d('0x26')]=function(_0x46974c){var _0x3338fd=this;return new Promise(function(_0x59bcf9,_0xebd4e2){return db['CmHopper'][_0x367d('0x27')]({'where':_0x46974c['options']?_0x46974c['options'][_0x367d('0x17')]||null:null})[_0x367d('0x9')](function(_0x426e6b){logger['info'](_0x367d('0x26'),_0x46974c);logger[_0x367d('0x25')](_0x367d('0x26'),_0x46974c,JSON[_0x367d('0x1d')](_0x426e6b));_0x59bcf9(_0x426e6b);})[_0x367d('0x11')](function(_0x5d7eb1){logger[_0x367d('0xd')]('DestroyCmHopper',_0x5d7eb1['message'],_0x46974c);_0xebd4e2(_0x3338fd['error'](0x1f4,_0x5d7eb1[_0x367d('0xf')]));});});};exports['GetContactDialer']=function(_0x3bb840){var _0x172232=this;return new Promise(function(_0x5dcb22,_0x2fabb2){return db[_0x367d('0x28')]['describe']()[_0x367d('0x9')](function(_0x4a5c37){return db[_0x367d('0x29')][_0x367d('0x2a')](function(_0x47fb77){return db[_0x367d('0x13')][_0x367d('0x14')]({'where':_0x3bb840['options']?_0x3bb840[_0x367d('0x15')][_0x367d('0x17')]||null:null,'attributes':_0x3bb840[_0x367d('0x15')]?_0x3bb840['options'][_0x367d('0x18')]||null:null,'limit':_0x3bb840[_0x367d('0x15')]?_0x3bb840[_0x367d('0x15')]['limit']||null:null,'order':_0x3bb840[_0x367d('0x15')]?_0x3bb840[_0x367d('0x15')]['order']||null:null,'transaction':_0x47fb77,'lock':_0x47fb77['LOCK'][_0x367d('0x2b')],'include':[{'model':db[_0x367d('0x28')],'as':_0x367d('0x2c'),'attributes':_[_0x367d('0x2d')](_0x4a5c37)}]})['then'](function(_0x1736ba){var _0x59c0db=[];for(var _0x1ab596=0x0;_0x1ab596<_0x1736ba[_0x367d('0x2e')];_0x1ab596+=0x1){_0x59c0db['push'](_0x1736ba[_0x1ab596][_0x367d('0x24')](_0x3bb840[_0x367d('0x22')],{'transaction':_0x47fb77}));}return BPromise[_0x367d('0x2f')](_0x59c0db);});})[_0x367d('0x9')](function(_0x3f344b){logger[_0x367d('0xa')](_0x367d('0x30'),_0x3bb840);logger[_0x367d('0x25')]('GetContactDialer',_0x3bb840,JSON[_0x367d('0x1d')](_0x3f344b));_0x5dcb22(_0x3f344b);})[_0x367d('0x11')](function(_0x4b0628){logger[_0x367d('0xd')](_0x367d('0x30'),_0x4b0628[_0x367d('0xf')],_0x3bb840);_0x2fabb2(_0x172232[_0x367d('0xd')](0x1f4,_0x4b0628[_0x367d('0xf')]));});});});};exports[_0x367d('0x31')]=function(_0x2b0cb2){var _0x46f219=this;return new Promise(function(_0x2e8004,_0x49a166){return db['sequelize']['transaction'](function(_0x212a7d){return db[_0x367d('0x32')]['create'](_0x2b0cb2[_0x367d('0x22')],{'raw':_0x2b0cb2[_0x367d('0x15')]?_0x2b0cb2[_0x367d('0x15')][_0x367d('0x16')]===undefined?!![]:![]:!![],'transaction':_0x212a7d})[_0x367d('0x9')](function(){return db[_0x367d('0x13')][_0x367d('0x27')]({'where':_0x2b0cb2[_0x367d('0x15')]?_0x2b0cb2[_0x367d('0x15')][_0x367d('0x17')]||null:null,'transaction':_0x212a7d});});})[_0x367d('0x9')](function(_0x5c8b62){logger[_0x367d('0xa')]('MoveContactManagedDialer',_0x2b0cb2);logger[_0x367d('0x25')](_0x367d('0x31'),_0x2b0cb2,JSON[_0x367d('0x1d')](_0x5c8b62));_0x2e8004(_0x5c8b62);})['catch'](function(_0x170b66){logger['error'](_0x367d('0x31'),_0x170b66[_0x367d('0xf')],_0x2b0cb2);_0x49a166(_0x46f219['error'](0x1f4,_0x170b66['message']));});});};exports['CountReScheduled']=function(_0x1b334b){var _0x1f567d=this;return new Promise(function(_0x4a9998,_0x402a88){return db[_0x367d('0x13')][_0x367d('0x14')]({'raw':_0x1b334b[_0x367d('0x15')]?_0x1b334b[_0x367d('0x15')][_0x367d('0x16')]===undefined?!![]:![]:!![],'where':_0x1b334b[_0x367d('0x15')]?_0x1b334b['options'][_0x367d('0x17')]||null:null,'attributes':[[db[_0x367d('0x29')]['fn'](_0x367d('0x33'),db['sequelize']['fn']('IF',db[_0x367d('0x29')][_0x367d('0x34')]('`scheduledat`\x20>=\x20'+util[_0x367d('0x35')](_0x367d('0x36'),moment()[_0x367d('0x35')](_0x367d('0x37')))+'\x20,\x201,\x20null'))),_0x367d('0x38')]]})[_0x367d('0x9')](function(_0x4e855f){logger[_0x367d('0xa')](_0x367d('0x39'),_0x1b334b);logger['debug'](_0x367d('0x39'),_0x1b334b,JSON[_0x367d('0x1d')](_0x4e855f));_0x4a9998(_0x4e855f);})[_0x367d('0x11')](function(_0x8b99aa){logger[_0x367d('0xd')](_0x367d('0x39'),_0x8b99aa[_0x367d('0xf')],_0x1b334b);_0x402a88(_0x1f567d['error'](0x1f4,_0x8b99aa[_0x367d('0xf')]));});});};exports[_0x367d('0x3a')]=function(_0x395702){var _0x1918a2=this;return new Promise(function(_0x3cfd1e,_0x243989){return db['CmContact']['describe']()[_0x367d('0x9')](function(_0x300c0c){return db[_0x367d('0x29')]['transaction'](function(_0x6ddf18){return db[_0x367d('0x13')]['findAll']({'where':_0x395702['options']?_0x395702[_0x367d('0x15')][_0x367d('0x17')]||null:null,'attributes':_0x395702[_0x367d('0x15')]?_0x395702[_0x367d('0x15')][_0x367d('0x18')]||null:null,'limit':0x1,'order':_0x395702[_0x367d('0x15')]?_0x395702[_0x367d('0x15')][_0x367d('0x3b')]||null:null,'group':db[_0x367d('0x13')][_0x367d('0x3c')],'transaction':_0x6ddf18,'lock':_0x6ddf18[_0x367d('0x3d')][_0x367d('0x2b')],'include':_0x395702['options']?_0x395702[_0x367d('0x15')]['include']?_[_0x367d('0x1b')](_0x395702[_0x367d('0x15')][_0x367d('0x1a')],function(_0x4251fb){return{'model':db[_0x4251fb[_0x367d('0x1c')]],'as':_0x4251fb['as'],'attributes':_0x4251fb[_0x367d('0x18')],'include':_0x4251fb[_0x367d('0x1a')]?_[_0x367d('0x1b')](_0x4251fb[_0x367d('0x1a')],function(_0x3520b2){return{'model':db[_0x3520b2[_0x367d('0x1c')]],'as':_0x3520b2['as'],'attributes':_0x3520b2[_0x367d('0x18')],'include':_0x3520b2[_0x367d('0x1a')]?_[_0x367d('0x1b')](_0x3520b2['include'],function(_0x23e8d1){return{'model':db[_0x23e8d1[_0x367d('0x1c')]],'as':_0x23e8d1['as'],'attributes':_0x23e8d1[_0x367d('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x306dd7){var _0x4b674f=[];for(var _0x23d38a=0x0;_0x23d38a<_0x306dd7['length'];_0x23d38a+=0x1){_0x4b674f[_0x367d('0x3e')](_0x306dd7[_0x23d38a][_0x367d('0x24')](_0x395702[_0x367d('0x22')],{'transaction':_0x6ddf18}));}return BPromise['all'](_0x4b674f);});})[_0x367d('0x9')](function(_0x59520a){logger[_0x367d('0xa')]('GetContactRecallMe',_0x395702);logger[_0x367d('0x25')](_0x367d('0x3a'),_0x395702,JSON['stringify'](_0x59520a));_0x3cfd1e(_0x59520a);})[_0x367d('0x11')](function(_0x59e1f6){logger[_0x367d('0xd')]('GetContactRecallMe',_0x59e1f6[_0x367d('0xf')],_0x395702);_0x243989(_0x1918a2[_0x367d('0xd')](0x1f4,_0x59e1f6[_0x367d('0xf')]));});});});}; \ No newline at end of file +var _0x5d98=['Contact','keys','push','update','all','MoveContactManagedDialer','sequelize','CmHopperFinal','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','\x20,\x201,\x20null','describe','length','GetContactRecallMe','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','CmHopper,\x20%s,\x20%s','request\x20sent','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetCmHopper','CmHopper','findAll','options','where','limit','include','map','attributes','model','debug','catch','ShowCmHopper','find','CreateCmHopper','create','raw','UpdateCmHopper','body','DestroyCmHopper','destroy','GetContactDialer','transaction','order','LOCK','UPDATE','CmContact'];(function(_0x44d0b5,_0x4b4ac6){var _0x3d84b7=function(_0x34a47c){while(--_0x34a47c){_0x44d0b5['push'](_0x44d0b5['shift']());}};_0x3d84b7(++_0x4b4ac6);}(_0x5d98,0x15c));var _0x85d9=function(_0x480287,_0x551796){_0x480287=_0x480287-0x0;var _0x4e0a84=_0x5d98[_0x480287];return _0x4e0a84;};'use strict';var _=require(_0x85d9('0x0'));var util=require(_0x85d9('0x1'));var moment=require(_0x85d9('0x2'));var BPromise=require('bluebird');var rs=require(_0x85d9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x85d9('0x4'))['db'];var utils=require(_0x85d9('0x5'));var logger=require(_0x85d9('0x6'))(_0x85d9('0x7'));var config=require(_0x85d9('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x85d9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x160625,_0x4d3435,_0x3d75eb){return new BPromise(function(_0x4c64a4,_0x25949a){return client[_0x85d9('0xa')](_0x160625,_0x3d75eb)[_0x85d9('0xb')](function(_0x113fce){logger['info'](_0x85d9('0xc'),_0x4d3435,_0x85d9('0xd'));logger['debug'](_0x85d9('0xe'),_0x4d3435,_0x85d9('0xd'),JSON[_0x85d9('0xf')](_0x113fce));if(_0x113fce[_0x85d9('0x10')]){if(_0x113fce[_0x85d9('0x10')][_0x85d9('0x11')]===0x1f4){logger[_0x85d9('0x10')](_0x85d9('0xc'),_0x4d3435,_0x113fce[_0x85d9('0x10')][_0x85d9('0x12')]);return _0x25949a(_0x113fce['error']['message']);}logger[_0x85d9('0x10')](_0x85d9('0xc'),_0x4d3435,_0x113fce[_0x85d9('0x10')]['message']);return _0x4c64a4(_0x113fce[_0x85d9('0x10')][_0x85d9('0x12')]);}else{logger[_0x85d9('0x13')]('CmHopper,\x20%s,\x20%s',_0x4d3435,'request\x20sent');_0x4c64a4(_0x113fce[_0x85d9('0x14')][_0x85d9('0x12')]);}})['catch'](function(_0x9e11e8){logger[_0x85d9('0x10')](_0x85d9('0xc'),_0x4d3435,_0x9e11e8);_0x25949a(_0x9e11e8);});});}exports[_0x85d9('0x15')]=function(_0x14f9cd){var _0xc8d86c=this;return new Promise(function(_0x15bb4c,_0x133fb2){return db[_0x85d9('0x16')][_0x85d9('0x17')]({'raw':_0x14f9cd[_0x85d9('0x18')]?_0x14f9cd[_0x85d9('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x14f9cd[_0x85d9('0x18')]?_0x14f9cd[_0x85d9('0x18')][_0x85d9('0x19')]||null:null,'attributes':_0x14f9cd['options']?_0x14f9cd[_0x85d9('0x18')]['attributes']||null:null,'limit':_0x14f9cd[_0x85d9('0x18')]?_0x14f9cd[_0x85d9('0x18')][_0x85d9('0x1a')]||null:null,'include':_0x14f9cd[_0x85d9('0x18')]?_0x14f9cd[_0x85d9('0x18')][_0x85d9('0x1b')]?_[_0x85d9('0x1c')](_0x14f9cd[_0x85d9('0x18')]['include'],function(_0x44a3fd){return{'model':db[_0x44a3fd['model']],'as':_0x44a3fd['as'],'attributes':_0x44a3fd[_0x85d9('0x1d')],'include':_0x44a3fd[_0x85d9('0x1b')]?_[_0x85d9('0x1c')](_0x44a3fd[_0x85d9('0x1b')],function(_0x2becd9){return{'model':db[_0x2becd9[_0x85d9('0x1e')]],'as':_0x2becd9['as'],'attributes':_0x2becd9[_0x85d9('0x1d')],'include':_0x2becd9[_0x85d9('0x1b')]?_['map'](_0x2becd9['include'],function(_0x1cd5c7){return{'model':db[_0x1cd5c7[_0x85d9('0x1e')]],'as':_0x1cd5c7['as'],'attributes':_0x1cd5c7['attributes']};}):[]};}):[]};}):[]:[]})[_0x85d9('0xb')](function(_0x4bb873){logger[_0x85d9('0x13')](_0x85d9('0x15'),_0x14f9cd);logger[_0x85d9('0x1f')](_0x85d9('0x15'),_0x14f9cd,JSON['stringify'](_0x4bb873));_0x15bb4c(_0x4bb873);})[_0x85d9('0x20')](function(_0xfc8738){logger[_0x85d9('0x10')](_0x85d9('0x15'),_0xfc8738[_0x85d9('0x12')],_0x14f9cd);_0x133fb2(_0xc8d86c[_0x85d9('0x10')](0x1f4,_0xfc8738['message']));});});};exports[_0x85d9('0x21')]=function(_0x47b3b8){var _0x33997e=this;return new Promise(function(_0x9d9e68,_0x4390d7){return db[_0x85d9('0x16')][_0x85d9('0x22')]({'raw':_0x47b3b8[_0x85d9('0x18')]?_0x47b3b8[_0x85d9('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x47b3b8[_0x85d9('0x18')]?_0x47b3b8[_0x85d9('0x18')][_0x85d9('0x19')]||null:null,'attributes':_0x47b3b8[_0x85d9('0x18')]?_0x47b3b8[_0x85d9('0x18')][_0x85d9('0x1d')]||null:null,'include':_0x47b3b8[_0x85d9('0x18')]?_0x47b3b8[_0x85d9('0x18')][_0x85d9('0x1b')]?_['map'](_0x47b3b8[_0x85d9('0x18')][_0x85d9('0x1b')],function(_0x59e1b0){return{'model':db[_0x59e1b0[_0x85d9('0x1e')]],'as':_0x59e1b0['as'],'attributes':_0x59e1b0[_0x85d9('0x1d')],'include':_0x59e1b0[_0x85d9('0x1b')]?_[_0x85d9('0x1c')](_0x59e1b0['include'],function(_0x3cc7c2){return{'model':db[_0x3cc7c2[_0x85d9('0x1e')]],'as':_0x3cc7c2['as'],'attributes':_0x3cc7c2[_0x85d9('0x1d')],'include':_0x3cc7c2[_0x85d9('0x1b')]?_[_0x85d9('0x1c')](_0x3cc7c2[_0x85d9('0x1b')],function(_0x3ee581){return{'model':db[_0x3ee581[_0x85d9('0x1e')]],'as':_0x3ee581['as'],'attributes':_0x3ee581[_0x85d9('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x85d9('0xb')](function(_0x226f79){logger[_0x85d9('0x13')](_0x85d9('0x21'),_0x47b3b8);logger[_0x85d9('0x1f')](_0x85d9('0x21'),_0x47b3b8,JSON[_0x85d9('0xf')](_0x226f79));_0x9d9e68(_0x226f79);})[_0x85d9('0x20')](function(_0x15b807){logger[_0x85d9('0x10')](_0x85d9('0x21'),_0x15b807[_0x85d9('0x12')],_0x47b3b8);_0x4390d7(_0x33997e[_0x85d9('0x10')](0x1f4,_0x15b807['message']));});});};exports[_0x85d9('0x23')]=function(_0x5234f9){var _0x47ab82=this;return new Promise(function(_0x4d38ef,_0x23c4ed){return db[_0x85d9('0x16')][_0x85d9('0x24')](_0x5234f9['body'],{'raw':_0x5234f9[_0x85d9('0x18')]?_0x5234f9['options'][_0x85d9('0x25')]===undefined?!![]:![]:!![]})['then'](function(_0x30f82f){logger[_0x85d9('0x13')](_0x85d9('0x23'),_0x5234f9);logger[_0x85d9('0x1f')](_0x85d9('0x23'),_0x5234f9,JSON['stringify'](_0x30f82f));_0x4d38ef(_0x30f82f);})[_0x85d9('0x20')](function(_0x244f43){logger[_0x85d9('0x10')](_0x85d9('0x23'),_0x244f43['message'],_0x5234f9);_0x23c4ed(_0x47ab82[_0x85d9('0x10')](0x1f4,_0x244f43[_0x85d9('0x12')]));});});};exports[_0x85d9('0x26')]=function(_0x325a2e){var _0x1288c7=this;return new Promise(function(_0x290ec8,_0x3ac0d0){return db[_0x85d9('0x16')]['update'](_0x325a2e[_0x85d9('0x27')],{'raw':_0x325a2e[_0x85d9('0x18')]?_0x325a2e[_0x85d9('0x18')][_0x85d9('0x25')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x325a2e['options']?_0x325a2e['options'][_0x85d9('0x19')]||null:null,'attributes':_0x325a2e[_0x85d9('0x18')]?_0x325a2e[_0x85d9('0x18')][_0x85d9('0x1d')]||null:null,'limit':_0x325a2e[_0x85d9('0x18')]?_0x325a2e['options'][_0x85d9('0x1a')]||null:null})[_0x85d9('0xb')](function(_0x2ad66e){logger[_0x85d9('0x13')]('UpdateCmHopper',_0x325a2e);logger[_0x85d9('0x1f')]('UpdateCmHopper',_0x325a2e,JSON['stringify'](_0x2ad66e));_0x290ec8(_0x2ad66e);})[_0x85d9('0x20')](function(_0xc8af9f){logger[_0x85d9('0x10')]('UpdateCmHopper',_0xc8af9f['message'],_0x325a2e);_0x3ac0d0(_0x1288c7[_0x85d9('0x10')](0x1f4,_0xc8af9f['message']));});});};exports[_0x85d9('0x28')]=function(_0x409941){var _0x4c6a7f=this;return new Promise(function(_0xbb4eed,_0x56015c){return db['CmHopper'][_0x85d9('0x29')]({'where':_0x409941[_0x85d9('0x18')]?_0x409941[_0x85d9('0x18')]['where']||null:null})[_0x85d9('0xb')](function(_0x76ab0f){logger[_0x85d9('0x13')](_0x85d9('0x28'),_0x409941);logger['debug'](_0x85d9('0x28'),_0x409941,JSON[_0x85d9('0xf')](_0x76ab0f));_0xbb4eed(_0x76ab0f);})[_0x85d9('0x20')](function(_0x55fb77){logger[_0x85d9('0x10')](_0x85d9('0x28'),_0x55fb77[_0x85d9('0x12')],_0x409941);_0x56015c(_0x4c6a7f['error'](0x1f4,_0x55fb77['message']));});});};exports[_0x85d9('0x2a')]=function(_0x3b8d60){var _0x5a8a91=this;return new Promise(function(_0x19a98e,_0x12bf5a){return db['CmContact']['describe']()[_0x85d9('0xb')](function(_0x38c0b3){return db['sequelize'][_0x85d9('0x2b')](function(_0x22810d){return db[_0x85d9('0x16')][_0x85d9('0x17')]({'where':_0x3b8d60[_0x85d9('0x18')]?_0x3b8d60[_0x85d9('0x18')][_0x85d9('0x19')]||null:null,'attributes':_0x3b8d60[_0x85d9('0x18')]?_0x3b8d60[_0x85d9('0x18')][_0x85d9('0x1d')]||null:null,'limit':_0x3b8d60[_0x85d9('0x18')]?_0x3b8d60[_0x85d9('0x18')]['limit']||null:null,'order':_0x3b8d60[_0x85d9('0x18')]?_0x3b8d60['options'][_0x85d9('0x2c')]||null:null,'transaction':_0x22810d,'lock':_0x22810d[_0x85d9('0x2d')][_0x85d9('0x2e')],'include':[{'model':db[_0x85d9('0x2f')],'as':_0x85d9('0x30'),'attributes':_[_0x85d9('0x31')](_0x38c0b3)}]})[_0x85d9('0xb')](function(_0x8d3ac8){var _0xeeee9=[];for(var _0x3355bf=0x0;_0x3355bf<_0x8d3ac8['length'];_0x3355bf+=0x1){_0xeeee9[_0x85d9('0x32')](_0x8d3ac8[_0x3355bf][_0x85d9('0x33')](_0x3b8d60[_0x85d9('0x27')],{'transaction':_0x22810d}));}return BPromise[_0x85d9('0x34')](_0xeeee9);});})[_0x85d9('0xb')](function(_0x514178){logger[_0x85d9('0x13')](_0x85d9('0x2a'),_0x3b8d60);logger[_0x85d9('0x1f')]('GetContactDialer',_0x3b8d60,JSON[_0x85d9('0xf')](_0x514178));_0x19a98e(_0x514178);})[_0x85d9('0x20')](function(_0x7f9c66){logger['error']('GetContactDialer',_0x7f9c66['message'],_0x3b8d60);_0x12bf5a(_0x5a8a91[_0x85d9('0x10')](0x1f4,_0x7f9c66['message']));});});});};exports[_0x85d9('0x35')]=function(_0x3a7020){var _0x4d5e09=this;return new Promise(function(_0x346f6d,_0x147d83){return db[_0x85d9('0x36')]['transaction'](function(_0x580e74){return db[_0x85d9('0x37')][_0x85d9('0x24')](_0x3a7020[_0x85d9('0x27')],{'raw':_0x3a7020[_0x85d9('0x18')]?_0x3a7020[_0x85d9('0x18')][_0x85d9('0x25')]===undefined?!![]:![]:!![],'transaction':_0x580e74})[_0x85d9('0xb')](function(){return db[_0x85d9('0x16')][_0x85d9('0x29')]({'where':_0x3a7020['options']?_0x3a7020['options'][_0x85d9('0x19')]||null:null,'transaction':_0x580e74});});})[_0x85d9('0xb')](function(_0x339375){logger[_0x85d9('0x13')]('MoveContactManagedDialer',_0x3a7020);logger[_0x85d9('0x1f')]('MoveContactManagedDialer',_0x3a7020,JSON[_0x85d9('0xf')](_0x339375));_0x346f6d(_0x339375);})[_0x85d9('0x20')](function(_0x45f073){logger['error']('MoveContactManagedDialer',_0x45f073['message'],_0x3a7020);_0x147d83(_0x4d5e09[_0x85d9('0x10')](0x1f4,_0x45f073['message']));});});};exports[_0x85d9('0x38')]=function(_0x24f19c){var _0x54a567=this;return new Promise(function(_0x497442,_0x355b9a){return db[_0x85d9('0x16')][_0x85d9('0x17')]({'raw':_0x24f19c[_0x85d9('0x18')]?_0x24f19c[_0x85d9('0x18')][_0x85d9('0x25')]===undefined?!![]:![]:!![],'where':_0x24f19c['options']?_0x24f19c[_0x85d9('0x18')][_0x85d9('0x19')]||null:null,'attributes':[[db[_0x85d9('0x36')]['fn'](_0x85d9('0x39'),db[_0x85d9('0x36')]['fn']('IF',db['sequelize'][_0x85d9('0x3a')](_0x85d9('0x3b')+util[_0x85d9('0x3c')](_0x85d9('0x3d'),moment()[_0x85d9('0x3c')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x85d9('0x3e')))),'contactsRescheduled']]})[_0x85d9('0xb')](function(_0x419015){logger['info'](_0x85d9('0x38'),_0x24f19c);logger[_0x85d9('0x1f')](_0x85d9('0x38'),_0x24f19c,JSON[_0x85d9('0xf')](_0x419015));_0x497442(_0x419015);})[_0x85d9('0x20')](function(_0x1f4d25){logger[_0x85d9('0x10')](_0x85d9('0x38'),_0x1f4d25['message'],_0x24f19c);_0x355b9a(_0x54a567['error'](0x1f4,_0x1f4d25[_0x85d9('0x12')]));});});};exports['GetContactRecallMe']=function(_0x2e99de){var _0xb780d0=this;return new Promise(function(_0x2bc8de,_0x104ff7){return db[_0x85d9('0x2f')][_0x85d9('0x3f')]()[_0x85d9('0xb')](function(_0x1cd8a8){return db[_0x85d9('0x36')][_0x85d9('0x2b')](function(_0x22363b){return db['CmHopper'][_0x85d9('0x17')]({'where':_0x2e99de['options']?_0x2e99de[_0x85d9('0x18')]['where']||null:null,'attributes':_0x2e99de[_0x85d9('0x18')]?_0x2e99de[_0x85d9('0x18')]['attributes']||null:null,'limit':0x1,'order':_0x2e99de[_0x85d9('0x18')]?_0x2e99de[_0x85d9('0x18')][_0x85d9('0x2c')]||null:null,'group':db[_0x85d9('0x16')]['UserId'],'transaction':_0x22363b,'lock':_0x22363b[_0x85d9('0x2d')][_0x85d9('0x2e')],'include':_0x2e99de['options']?_0x2e99de[_0x85d9('0x18')]['include']?_[_0x85d9('0x1c')](_0x2e99de['options'][_0x85d9('0x1b')],function(_0x9d1f52){return{'model':db[_0x9d1f52[_0x85d9('0x1e')]],'as':_0x9d1f52['as'],'attributes':_0x9d1f52[_0x85d9('0x1d')],'include':_0x9d1f52[_0x85d9('0x1b')]?_[_0x85d9('0x1c')](_0x9d1f52[_0x85d9('0x1b')],function(_0x3161cc){return{'model':db[_0x3161cc[_0x85d9('0x1e')]],'as':_0x3161cc['as'],'attributes':_0x3161cc[_0x85d9('0x1d')],'include':_0x3161cc[_0x85d9('0x1b')]?_[_0x85d9('0x1c')](_0x3161cc[_0x85d9('0x1b')],function(_0x9bab46){return{'model':db[_0x9bab46['model']],'as':_0x9bab46['as'],'attributes':_0x9bab46[_0x85d9('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x85d9('0xb')](function(_0x26aa09){var _0x2cc1c0=[];for(var _0x417200=0x0;_0x417200<_0x26aa09[_0x85d9('0x40')];_0x417200+=0x1){_0x2cc1c0[_0x85d9('0x32')](_0x26aa09[_0x417200]['update'](_0x2e99de[_0x85d9('0x27')],{'transaction':_0x22363b}));}return BPromise['all'](_0x2cc1c0);});})['then'](function(_0x44f7ae){logger[_0x85d9('0x13')](_0x85d9('0x41'),_0x2e99de);logger[_0x85d9('0x1f')]('GetContactRecallMe',_0x2e99de,JSON[_0x85d9('0xf')](_0x44f7ae));_0x2bc8de(_0x44f7ae);})['catch'](function(_0x2b381b){logger['error']('GetContactRecallMe',_0x2b381b[_0x85d9('0x12')],_0x2e99de);_0x104ff7(_0xb780d0['error'](0x1f4,_0x2b381b[_0x85d9('0x12')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 1b13728..5bed79e 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 _0xb703=['../../config/environment','./cmHopper.controller','get','isAuthenticated','index','/describe','describe','/opencontacts','getOpenContacts','/:id','show','post','create','/preview','getPreview','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0xb703,0xeb));var _0x3b70=function(_0x1be6fd,_0x1d70a4){_0x1be6fd=_0x1be6fd-0x0;var _0x3ec8f6=_0xb703[_0x1be6fd];return _0x3ec8f6;};'use strict';var multer=require(_0x3b70('0x0'));var util=require(_0x3b70('0x1'));var path=require(_0x3b70('0x2'));var timeout=require(_0x3b70('0x3'));var express=require(_0x3b70('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3b70('0x5'));var controller=require(_0x3b70('0x6'));router[_0x3b70('0x7')]('/',auth[_0x3b70('0x8')](),controller[_0x3b70('0x9')]);router[_0x3b70('0x7')](_0x3b70('0xa'),auth[_0x3b70('0x8')](),controller[_0x3b70('0xb')]);router[_0x3b70('0x7')](_0x3b70('0xc'),auth['isAuthenticated'](),controller[_0x3b70('0xd')]);router['get'](_0x3b70('0xe'),auth[_0x3b70('0x8')](),controller[_0x3b70('0xf')]);router[_0x3b70('0x10')]('/',auth[_0x3b70('0x8')](),controller[_0x3b70('0x11')]);router['post'](_0x3b70('0x12'),auth[_0x3b70('0x8')](),controller[_0x3b70('0x13')]);router[_0x3b70('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x3b70('0x15')]);router['delete'](_0x3b70('0xe'),auth['isAuthenticated'](),controller[_0x3b70('0x16')]);module[_0x3b70('0x17')]=router; \ No newline at end of file +var _0xb60d=['get','isAuthenticated','/describe','/opencontacts','getOpenContacts','show','create','/preview','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','./cmHopper.controller'];(function(_0x3f255e,_0x20c7be){var _0x2a58bf=function(_0x830732){while(--_0x830732){_0x3f255e['push'](_0x3f255e['shift']());}};_0x2a58bf(++_0x20c7be);}(_0xb60d,0x86));var _0xdb60=function(_0x3ccead,_0x49434c){_0x3ccead=_0x3ccead-0x0;var _0x3ba7c8=_0xb60d[_0x3ccead];return _0x3ba7c8;};'use strict';var multer=require(_0xdb60('0x0'));var util=require(_0xdb60('0x1'));var path=require(_0xdb60('0x2'));var timeout=require(_0xdb60('0x3'));var express=require(_0xdb60('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xdb60('0x5'));router[_0xdb60('0x6')]('/',auth[_0xdb60('0x7')](),controller['index']);router['get'](_0xdb60('0x8'),auth[_0xdb60('0x7')](),controller['describe']);router[_0xdb60('0x6')](_0xdb60('0x9'),auth[_0xdb60('0x7')](),controller[_0xdb60('0xa')]);router[_0xdb60('0x6')]('/:id',auth['isAuthenticated'](),controller[_0xdb60('0xb')]);router['post']('/',auth[_0xdb60('0x7')](),controller[_0xdb60('0xc')]);router['post'](_0xdb60('0xd'),auth[_0xdb60('0x7')](),controller['getPreview']);router[_0xdb60('0xe')](_0xdb60('0xf'),auth[_0xdb60('0x7')](),controller[_0xdb60('0x10')]);router[_0xdb60('0x11')](_0xdb60('0xf'),auth[_0xdb60('0x7')](),controller[_0xdb60('0x12')]);module[_0xdb60('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 1db4d42..84cf700 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 _0x9364=['INTEGER','contactListQueue','exports'];(function(_0x2ca9d4,_0x51d5c6){var _0x258956=function(_0x47a0e5){while(--_0x47a0e5){_0x2ca9d4['push'](_0x2ca9d4['shift']());}};_0x258956(++_0x51d5c6);}(_0x9364,0x95));var _0x4936=function(_0x55a5fa,_0xfb8852){_0x55a5fa=_0x55a5fa-0x0;var _0x4e7dbf=_0x9364[_0x55a5fa];return _0x4e7dbf;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x4936('0x0')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x4936('0x1')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x4936('0x1')],'unique':_0x4936('0x2')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x4936('0x2')}}; \ No newline at end of file +var _0xaad0=['STRING','INTEGER','contactListQueue','moment','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaad0,0xc9));var _0x0aad=function(_0x2a0fc4,_0x2eaf74){_0x2a0fc4=_0x2a0fc4-0x0;var _0x531d00=_0xaad0[_0x2a0fc4];return _0x531d00;};'use strict';var moment=require(_0x0aad('0x0'));var Sequelize=require(_0x0aad('0x1'));module[_0x0aad('0x2')]={'phone':{'type':Sequelize[_0x0aad('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x0aad('0x4')],'unique':_0x0aad('0x5')},'ListId':{'type':Sequelize[_0x0aad('0x4')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x0aad('0x5')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 0647373..0918149 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 _0x6b1b=['update','body','catch','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','apply','reject','destroy','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','CmHopperBlack','includeAll','include','findAll','rows','show','params','keys','length','find'];(function(_0x383f5b,_0x4b8046){var _0x4eac1b=function(_0x4ac071){while(--_0x4ac071){_0x383f5b['push'](_0x383f5b['shift']());}};_0x4eac1b(++_0x4b8046);}(_0x6b1b,0x1e7));var _0xb6b1=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0x6b1b[_0x5b78e8];return _0xf2c321;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb6b1('0x0'));var rimraf=require(_0xb6b1('0x1'));var zipdir=require(_0xb6b1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb6b1('0x3'));var moment=require(_0xb6b1('0x4'));var BPromise=require(_0xb6b1('0x5'));var Mustache=require(_0xb6b1('0x6'));var util=require(_0xb6b1('0x7'));var path=require(_0xb6b1('0x8'));var sox=require(_0xb6b1('0x9'));var csv=require(_0xb6b1('0xa'));var ejs=require(_0xb6b1('0xb'));var fs=require('fs');var _=require(_0xb6b1('0xc'));var squel=require(_0xb6b1('0xd'));var crypto=require('crypto');var jsforce=require(_0xb6b1('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb6b1('0xf'));var Papa=require('papaparse');var Redis=require(_0xb6b1('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb6b1('0x11'))(_0xb6b1('0x12'));var utils=require('../../config/utils');var config=require(_0xb6b1('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c5837,_0x406dce){_0x406dce=_0x406dce||0xcc;return function(_0x2e5256){if(_0x2e5256){return _0x5c5837[_0xb6b1('0x14')](_0x406dce);}return _0x5c5837[_0xb6b1('0x15')](_0x406dce)[_0xb6b1('0x16')]();};}function respondWithResult(_0x18f6b5,_0x360fc7){_0x360fc7=_0x360fc7||0xc8;return function(_0x429d0d){if(_0x429d0d){return _0x18f6b5[_0xb6b1('0x15')](_0x360fc7)[_0xb6b1('0x17')](_0x429d0d);}};}function respondWithFilteredResult(_0x2629db,_0x14fef6){return function(_0x4f770a){if(_0x4f770a){var _0x57572a=_0x4f770a[_0xb6b1('0x18')],_0x513207=_0x14fef6[_0xb6b1('0x19')],_0x51f25f=_0x14fef6[_0xb6b1('0x19')]+_0x14fef6[_0xb6b1('0x1a')],_0xee229d;if(_0x51f25f>=_0x57572a){_0x51f25f=_0x57572a;_0xee229d=0xc8;}else{_0xee229d=0xce;}_0x2629db[_0xb6b1('0x15')](_0xee229d);return _0x2629db['set']('Content-Range',_0x513207+'-'+_0x51f25f+'/'+_0x57572a)[_0xb6b1('0x17')](_0x4f770a);}return null;};}function patchUpdates(_0x15456d){return function(_0x16d969){try{jsonpatch[_0xb6b1('0x1b')](_0x16d969,_0x15456d,!![]);}catch(_0x45d9e6){return BPromise[_0xb6b1('0x1c')](_0x45d9e6);}return _0x16d969['save']();};}function saveUpdates(_0x4e132a,_0x43312e){return function(_0x1067ea){if(_0x1067ea){return _0x1067ea['update'](_0x4e132a)['then'](function(_0xfc247a){return _0xfc247a;});}return null;};}function removeEntity(_0x5c8529,_0x509c55){return function(_0x232157){if(_0x232157){return _0x232157[_0xb6b1('0x1d')]()[_0xb6b1('0x1e')](function(){_0x5c8529[_0xb6b1('0x15')](0xcc)[_0xb6b1('0x16')]();});}};}function handleEntityNotFound(_0x3d0864,_0x1eb1b2){return function(_0x3b1ff7){if(!_0x3b1ff7){_0x3d0864[_0xb6b1('0x14')](0x194);}return _0x3b1ff7;};}function handleError(_0x20066f,_0x5069cd){_0x5069cd=_0x5069cd||0x1f4;return function(_0x214cd0){logger['error'](_0x214cd0[_0xb6b1('0x1f')]);if(_0x214cd0['name']){delete _0x214cd0[_0xb6b1('0x20')];}_0x20066f['status'](_0x5069cd)[_0xb6b1('0x21')](_0x214cd0);};}exports[_0xb6b1('0x22')]=function(_0xac4256,_0x178401){var _0x13e841={},_0x188627={},_0x3e0915={'count':0x0,'rows':[]};var _0xd3c6da=_[_0xb6b1('0x23')](db['CmHopperBlack'][_0xb6b1('0x24')],function(_0x548f3f){return{'name':_0x548f3f[_0xb6b1('0x25')],'type':_0x548f3f[_0xb6b1('0x26')][_0xb6b1('0x27')]};});_0x188627[_0xb6b1('0x28')]=_[_0xb6b1('0x23')](_0xd3c6da,_0xb6b1('0x20'));_0x188627[_0xb6b1('0x29')]=_['keys'](_0xac4256[_0xb6b1('0x29')]);_0x188627[_0xb6b1('0x2a')]=_[_0xb6b1('0x2b')](_0x188627['model'],_0x188627[_0xb6b1('0x29')]);_0x13e841[_0xb6b1('0x2c')]=_['intersection'](_0x188627[_0xb6b1('0x28')],qs[_0xb6b1('0x2d')](_0xac4256[_0xb6b1('0x29')][_0xb6b1('0x2d')]));_0x13e841[_0xb6b1('0x2c')]=_0x13e841[_0xb6b1('0x2c')]['length']?_0x13e841[_0xb6b1('0x2c')]:_0x188627[_0xb6b1('0x28')];if(!_0xac4256['query'][_0xb6b1('0x2e')]('nolimit')){_0x13e841[_0xb6b1('0x1a')]=qs[_0xb6b1('0x1a')](_0xac4256[_0xb6b1('0x29')][_0xb6b1('0x1a')]);_0x13e841[_0xb6b1('0x19')]=qs[_0xb6b1('0x19')](_0xac4256['query'][_0xb6b1('0x19')]);}_0x13e841[_0xb6b1('0x2f')]=qs[_0xb6b1('0x30')](_0xac4256[_0xb6b1('0x29')]['sort']);_0x13e841['where']=qs['filters'](_[_0xb6b1('0x31')](_0xac4256[_0xb6b1('0x29')],_0x188627[_0xb6b1('0x2a')]));if(_0xac4256[_0xb6b1('0x29')][_0xb6b1('0x32')]){_0x13e841[_0xb6b1('0x33')]=_[_0xb6b1('0x34')](_0x13e841[_0xb6b1('0x33')],{'$or':_[_0xb6b1('0x23')](_0xd3c6da,function(_0x25d6a2){if(_0x25d6a2[_0xb6b1('0x26')]!==_0xb6b1('0x35')){var _0x5b8a57={};_0x5b8a57[_0x25d6a2[_0xb6b1('0x20')]]={'$like':'%'+_0xac4256[_0xb6b1('0x29')][_0xb6b1('0x32')]+'%'};return _0x5b8a57;}})});}_0x13e841=_[_0xb6b1('0x34')]({},_0x13e841,_0xac4256[_0xb6b1('0x36')]);var _0x1dc258={'where':_0x13e841[_0xb6b1('0x33')]};return db[_0xb6b1('0x37')][_0xb6b1('0x18')](_0x1dc258)[_0xb6b1('0x1e')](function(_0x44a61a){_0x3e0915['count']=_0x44a61a;if(_0xac4256[_0xb6b1('0x29')][_0xb6b1('0x38')]){_0x13e841[_0xb6b1('0x39')]=[{'all':!![]}];}return db[_0xb6b1('0x37')][_0xb6b1('0x3a')](_0x13e841);})[_0xb6b1('0x1e')](function(_0x27808b){_0x3e0915[_0xb6b1('0x3b')]=_0x27808b;return _0x3e0915;})['then'](respondWithFilteredResult(_0x178401,_0x13e841))['catch'](handleError(_0x178401,null));};exports[_0xb6b1('0x3c')]=function(_0x19853f,_0x1f43fe){var _0x541eb5={'raw':!![],'where':{'id':_0x19853f[_0xb6b1('0x3d')]['id']}},_0x8d1ba8={};_0x8d1ba8[_0xb6b1('0x28')]=_[_0xb6b1('0x3e')](db[_0xb6b1('0x37')][_0xb6b1('0x24')]);_0x8d1ba8[_0xb6b1('0x29')]=_[_0xb6b1('0x3e')](_0x19853f['query']);_0x8d1ba8[_0xb6b1('0x2a')]=_['intersection'](_0x8d1ba8[_0xb6b1('0x28')],_0x8d1ba8[_0xb6b1('0x29')]);_0x541eb5[_0xb6b1('0x2c')]=_[_0xb6b1('0x2b')](_0x8d1ba8[_0xb6b1('0x28')],qs[_0xb6b1('0x2d')](_0x19853f['query'][_0xb6b1('0x2d')]));_0x541eb5[_0xb6b1('0x2c')]=_0x541eb5['attributes'][_0xb6b1('0x3f')]?_0x541eb5['attributes']:_0x8d1ba8[_0xb6b1('0x28')];if(_0x19853f[_0xb6b1('0x29')][_0xb6b1('0x38')]){_0x541eb5[_0xb6b1('0x39')]=[{'all':!![]}];}_0x541eb5=_[_0xb6b1('0x34')]({},_0x541eb5,_0x19853f[_0xb6b1('0x36')]);return db[_0xb6b1('0x37')][_0xb6b1('0x40')](_0x541eb5)[_0xb6b1('0x1e')](handleEntityNotFound(_0x1f43fe,null))['then'](respondWithResult(_0x1f43fe,null))['catch'](handleError(_0x1f43fe,null));};exports[_0xb6b1('0x41')]=function(_0x2c00fb,_0x5959ca){if(_0x2c00fb[_0xb6b1('0x42')]['id']){delete _0x2c00fb[_0xb6b1('0x42')]['id'];}return db[_0xb6b1('0x37')][_0xb6b1('0x40')]({'where':{'id':_0x2c00fb[_0xb6b1('0x3d')]['id']}})['then'](handleEntityNotFound(_0x5959ca,null))[_0xb6b1('0x1e')](saveUpdates(_0x2c00fb[_0xb6b1('0x42')],null))[_0xb6b1('0x1e')](respondWithResult(_0x5959ca,null))[_0xb6b1('0x43')](handleError(_0x5959ca,null));};exports['destroy']=function(_0x5bfd0e,_0x20e93b){return db['CmHopperBlack'][_0xb6b1('0x40')]({'where':{'id':_0x5bfd0e[_0xb6b1('0x3d')]['id']}})['then'](handleEntityNotFound(_0x20e93b,null))[_0xb6b1('0x1e')](removeEntity(_0x20e93b,null))['catch'](handleError(_0x20e93b,null));};exports[_0xb6b1('0x44')]=function(_0x7d4763,_0xbd7cec){return db[_0xb6b1('0x37')][_0xb6b1('0x44')]()[_0xb6b1('0x1e')](respondWithResult(_0xbd7cec,null))[_0xb6b1('0x43')](handleError(_0xbd7cec,null));}; \ No newline at end of file +var _0x2d07=['sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','findAll','rows','catch','find','body','describe','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x58aa78,_0x17c8bd){var _0x9675fa=function(_0x5adc29){while(--_0x5adc29){_0x58aa78['push'](_0x58aa78['shift']());}};_0x9675fa(++_0x17c8bd);}(_0x2d07,0x13a));var _0x72d0=function(_0x2d2258,_0x2ce510){_0x2d2258=_0x2d2258-0x0;var _0x18e155=_0x2d07[_0x2d2258];return _0x18e155;};'use strict';var pdf=require(_0x72d0('0x0'));var emlformat=require(_0x72d0('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x72d0('0x2'));var jsonpatch=require(_0x72d0('0x3'));var rp=require('request-promise');var moment=require(_0x72d0('0x4'));var BPromise=require(_0x72d0('0x5'));var Mustache=require(_0x72d0('0x6'));var util=require(_0x72d0('0x7'));var path=require(_0x72d0('0x8'));var sox=require(_0x72d0('0x9'));var csv=require('to-csv');var ejs=require(_0x72d0('0xa'));var fs=require('fs');var _=require(_0x72d0('0xb'));var squel=require(_0x72d0('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x72d0('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x72d0('0xe'));var authService=require(_0x72d0('0xf'));var qs=require(_0x72d0('0x10'));var as=require(_0x72d0('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x72d0('0x12'));var config=require(_0x72d0('0x13'));var db=require(_0x72d0('0x14'))['db'];function respondWithStatusCode(_0x110012,_0x262274){_0x262274=_0x262274||0xcc;return function(_0x4fdaf7){if(_0x4fdaf7){return _0x110012[_0x72d0('0x15')](_0x262274);}return _0x110012[_0x72d0('0x16')](_0x262274)[_0x72d0('0x17')]();};}function respondWithResult(_0x4f2343,_0x183dc7){_0x183dc7=_0x183dc7||0xc8;return function(_0xe75447){if(_0xe75447){return _0x4f2343[_0x72d0('0x16')](_0x183dc7)[_0x72d0('0x18')](_0xe75447);}};}function respondWithFilteredResult(_0x19b3e7,_0xea1112){return function(_0x50c274){if(_0x50c274){var _0x1e2089=_0x50c274[_0x72d0('0x19')],_0x197179=_0xea1112[_0x72d0('0x1a')],_0x1ea03f=_0xea1112[_0x72d0('0x1a')]+_0xea1112[_0x72d0('0x1b')],_0x1ff740;if(_0x1ea03f>=_0x1e2089){_0x1ea03f=_0x1e2089;_0x1ff740=0xc8;}else{_0x1ff740=0xce;}_0x19b3e7[_0x72d0('0x16')](_0x1ff740);return _0x19b3e7['set'](_0x72d0('0x1c'),_0x197179+'-'+_0x1ea03f+'/'+_0x1e2089)[_0x72d0('0x18')](_0x50c274);}return null;};}function patchUpdates(_0x2cd4aa){return function(_0x3b23c6){try{jsonpatch[_0x72d0('0x1d')](_0x3b23c6,_0x2cd4aa,!![]);}catch(_0x1adbc1){return BPromise['reject'](_0x1adbc1);}return _0x3b23c6[_0x72d0('0x1e')]();};}function saveUpdates(_0x5c905a,_0x4cbdf1){return function(_0x57e7c8){if(_0x57e7c8){return _0x57e7c8[_0x72d0('0x1f')](_0x5c905a)[_0x72d0('0x20')](function(_0x55764b){return _0x55764b;});}return null;};}function removeEntity(_0xf8c7,_0x30cb19){return function(_0x47d89a){if(_0x47d89a){return _0x47d89a[_0x72d0('0x21')]()[_0x72d0('0x20')](function(){_0xf8c7['status'](0xcc)[_0x72d0('0x17')]();});}};}function handleEntityNotFound(_0x1c39e3,_0x350184){return function(_0x5b7034){if(!_0x5b7034){_0x1c39e3[_0x72d0('0x15')](0x194);}return _0x5b7034;};}function handleError(_0x50f263,_0x37634e){_0x37634e=_0x37634e||0x1f4;return function(_0x5115e0){logger['error'](_0x5115e0[_0x72d0('0x22')]);if(_0x5115e0[_0x72d0('0x23')]){delete _0x5115e0[_0x72d0('0x23')];}_0x50f263[_0x72d0('0x16')](_0x37634e)[_0x72d0('0x24')](_0x5115e0);};}exports[_0x72d0('0x25')]=function(_0x10d27e,_0x4e6093){var _0x2ff68a={},_0x4d8340={},_0x20b9d={'count':0x0,'rows':[]};var _0x15b196=_[_0x72d0('0x26')](db[_0x72d0('0x27')][_0x72d0('0x28')],function(_0x4d4790){return{'name':_0x4d4790[_0x72d0('0x29')],'type':_0x4d4790[_0x72d0('0x2a')]['key']};});_0x4d8340[_0x72d0('0x2b')]=_[_0x72d0('0x26')](_0x15b196,_0x72d0('0x23'));_0x4d8340['query']=_[_0x72d0('0x2c')](_0x10d27e[_0x72d0('0x2d')]);_0x4d8340['filters']=_[_0x72d0('0x2e')](_0x4d8340['model'],_0x4d8340[_0x72d0('0x2d')]);_0x2ff68a[_0x72d0('0x2f')]=_[_0x72d0('0x2e')](_0x4d8340[_0x72d0('0x2b')],qs[_0x72d0('0x30')](_0x10d27e[_0x72d0('0x2d')][_0x72d0('0x30')]));_0x2ff68a[_0x72d0('0x2f')]=_0x2ff68a[_0x72d0('0x2f')][_0x72d0('0x31')]?_0x2ff68a[_0x72d0('0x2f')]:_0x4d8340[_0x72d0('0x2b')];if(!_0x10d27e['query'][_0x72d0('0x32')](_0x72d0('0x33'))){_0x2ff68a[_0x72d0('0x1b')]=qs[_0x72d0('0x1b')](_0x10d27e[_0x72d0('0x2d')][_0x72d0('0x1b')]);_0x2ff68a[_0x72d0('0x1a')]=qs[_0x72d0('0x1a')](_0x10d27e['query'][_0x72d0('0x1a')]);}_0x2ff68a[_0x72d0('0x34')]=qs['sort'](_0x10d27e['query'][_0x72d0('0x35')]);_0x2ff68a[_0x72d0('0x36')]=qs[_0x72d0('0x37')](_[_0x72d0('0x38')](_0x10d27e[_0x72d0('0x2d')],_0x4d8340[_0x72d0('0x37')]));if(_0x10d27e[_0x72d0('0x2d')][_0x72d0('0x39')]){_0x2ff68a[_0x72d0('0x36')]=_[_0x72d0('0x3a')](_0x2ff68a[_0x72d0('0x36')],{'$or':_[_0x72d0('0x26')](_0x15b196,function(_0x34bd0f){if(_0x34bd0f[_0x72d0('0x2a')]!=='VIRTUAL'){var _0x5266d2={};_0x5266d2[_0x34bd0f[_0x72d0('0x23')]]={'$like':'%'+_0x10d27e[_0x72d0('0x2d')]['filter']+'%'};return _0x5266d2;}})});}_0x2ff68a=_[_0x72d0('0x3a')]({},_0x2ff68a,_0x10d27e[_0x72d0('0x3b')]);var _0x519e8a={'where':_0x2ff68a[_0x72d0('0x36')]};return db[_0x72d0('0x27')][_0x72d0('0x19')](_0x519e8a)['then'](function(_0x2c97ee){_0x20b9d['count']=_0x2c97ee;if(_0x10d27e['query'][_0x72d0('0x3c')]){_0x2ff68a['include']=[{'all':!![]}];}return db[_0x72d0('0x27')][_0x72d0('0x3d')](_0x2ff68a);})[_0x72d0('0x20')](function(_0x3700d2){_0x20b9d[_0x72d0('0x3e')]=_0x3700d2;return _0x20b9d;})['then'](respondWithFilteredResult(_0x4e6093,_0x2ff68a))[_0x72d0('0x3f')](handleError(_0x4e6093,null));};exports['show']=function(_0x2dd3c2,_0x84c4c4){var _0x398a01={'raw':!![],'where':{'id':_0x2dd3c2['params']['id']}},_0x453bc2={};_0x453bc2[_0x72d0('0x2b')]=_[_0x72d0('0x2c')](db[_0x72d0('0x27')][_0x72d0('0x28')]);_0x453bc2[_0x72d0('0x2d')]=_['keys'](_0x2dd3c2['query']);_0x453bc2[_0x72d0('0x37')]=_[_0x72d0('0x2e')](_0x453bc2['model'],_0x453bc2[_0x72d0('0x2d')]);_0x398a01[_0x72d0('0x2f')]=_['intersection'](_0x453bc2[_0x72d0('0x2b')],qs[_0x72d0('0x30')](_0x2dd3c2[_0x72d0('0x2d')][_0x72d0('0x30')]));_0x398a01[_0x72d0('0x2f')]=_0x398a01[_0x72d0('0x2f')][_0x72d0('0x31')]?_0x398a01[_0x72d0('0x2f')]:_0x453bc2[_0x72d0('0x2b')];if(_0x2dd3c2[_0x72d0('0x2d')]['includeAll']){_0x398a01['include']=[{'all':!![]}];}_0x398a01=_[_0x72d0('0x3a')]({},_0x398a01,_0x2dd3c2['options']);return db['CmHopperBlack'][_0x72d0('0x40')](_0x398a01)[_0x72d0('0x20')](handleEntityNotFound(_0x84c4c4,null))['then'](respondWithResult(_0x84c4c4,null))[_0x72d0('0x3f')](handleError(_0x84c4c4,null));};exports[_0x72d0('0x1f')]=function(_0x44a5f6,_0x4bb465){if(_0x44a5f6['body']['id']){delete _0x44a5f6[_0x72d0('0x41')]['id'];}return db['CmHopperBlack'][_0x72d0('0x40')]({'where':{'id':_0x44a5f6['params']['id']}})[_0x72d0('0x20')](handleEntityNotFound(_0x4bb465,null))[_0x72d0('0x20')](saveUpdates(_0x44a5f6[_0x72d0('0x41')],null))[_0x72d0('0x20')](respondWithResult(_0x4bb465,null))[_0x72d0('0x3f')](handleError(_0x4bb465,null));};exports[_0x72d0('0x21')]=function(_0xcfeb4c,_0x197455){return db[_0x72d0('0x27')][_0x72d0('0x40')]({'where':{'id':_0xcfeb4c['params']['id']}})[_0x72d0('0x20')](handleEntityNotFound(_0x197455,null))[_0x72d0('0x20')](removeEntity(_0x197455,null))['catch'](handleError(_0x197455,null));};exports[_0x72d0('0x42')]=function(_0x4ab2bd,_0x2082bf){return db['CmHopperBlack']['describe']()[_0x72d0('0x20')](respondWithResult(_0x2082bf,null))[_0x72d0('0x3f')](handleError(_0x2082bf,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 6095f80..1131841 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 _0xe92d=['api','bluebird','request-promise','path','rimraf','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','lodash','../../config/logger'];(function(_0x36d57f,_0x2f9118){var _0x3f93fb=function(_0x567b58){while(--_0x567b58){_0x36d57f['push'](_0x36d57f['shift']());}};_0x3f93fb(++_0x2f9118);}(_0xe92d,0xa6));var _0xde92=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xe92d[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0xde92('0x0'));var util=require('util');var logger=require(_0xde92('0x1'))(_0xde92('0x2'));var moment=require('moment');var BPromise=require(_0xde92('0x3'));var rp=require(_0xde92('0x4'));var fs=require('fs');var path=require(_0xde92('0x5'));var rimraf=require(_0xde92('0x6'));var config=require('../../config/environment');var attributes=require(_0xde92('0x7'));module[_0xde92('0x8')]=function(_0x1caf80,_0x44019d){return _0x1caf80[_0xde92('0x9')](_0xde92('0xa'),attributes,{'tableName':_0xde92('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0e8e=['api','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','CmHopperBlack','cm_hopper_black','lodash','util'];(function(_0x22166c,_0x4e40fc){var _0x218b04=function(_0x1df10e){while(--_0x1df10e){_0x22166c['push'](_0x22166c['shift']());}};_0x218b04(++_0x4e40fc);}(_0x0e8e,0x132));var _0xe0e8=function(_0x4b538a,_0x4afb6c){_0x4b538a=_0x4b538a-0x0;var _0x5a7da0=_0x0e8e[_0x4b538a];return _0x5a7da0;};'use strict';var _=require(_0xe0e8('0x0'));var util=require(_0xe0e8('0x1'));var logger=require('../../config/logger')(_0xe0e8('0x2'));var moment=require('moment');var BPromise=require(_0xe0e8('0x3'));var rp=require(_0xe0e8('0x4'));var fs=require('fs');var path=require(_0xe0e8('0x5'));var rimraf=require(_0xe0e8('0x6'));var config=require(_0xe0e8('0x7'));var attributes=require(_0xe0e8('0x8'));module['exports']=function(_0x535087,_0x23576a){return _0x535087['define'](_0xe0e8('0x9'),attributes,{'tableName':_0xe0e8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index 16bc075..9b3b46e 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 _0x11f4=['request','then','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','where','include','map','model','attributes','info','UpdateCmHopperBlack','update','body','raw','limit','DestroyCmHopperBlack','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','jayson/promise','client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x11f4,0xcf));var _0x411f=function(_0x320415,_0x1c3ced){_0x320415=_0x320415-0x0;var _0x3b0628=_0x11f4[_0x320415];return _0x3b0628;};'use strict';var _=require(_0x411f('0x0'));var util=require(_0x411f('0x1'));var moment=require(_0x411f('0x2'));var BPromise=require(_0x411f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x411f('0x4'))['db'];var utils=require(_0x411f('0x5'));var logger=require('../../config/logger')(_0x411f('0x6'));var config=require('../../config/environment');var jayson=require(_0x411f('0x7'));var client=jayson[_0x411f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x467208,_0x10cc34,_0x26ea2f){return new BPromise(function(_0x8a16ab,_0x4030b2){return client[_0x411f('0x9')](_0x467208,_0x26ea2f)[_0x411f('0xa')](function(_0x1a5ce6){logger['info'](_0x411f('0xb'),_0x10cc34,_0x411f('0xc'));logger[_0x411f('0xd')](_0x411f('0xe'),_0x10cc34,_0x411f('0xc'),JSON[_0x411f('0xf')](_0x1a5ce6));if(_0x1a5ce6[_0x411f('0x10')]){if(_0x1a5ce6[_0x411f('0x10')]['code']===0x1f4){logger['error'](_0x411f('0xb'),_0x10cc34,_0x1a5ce6[_0x411f('0x10')][_0x411f('0x11')]);return _0x4030b2(_0x1a5ce6[_0x411f('0x10')][_0x411f('0x11')]);}logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x10cc34,_0x1a5ce6[_0x411f('0x10')]['message']);return _0x8a16ab(_0x1a5ce6['error'][_0x411f('0x11')]);}else{logger['info'](_0x411f('0xb'),_0x10cc34,_0x411f('0xc'));_0x8a16ab(_0x1a5ce6[_0x411f('0x12')][_0x411f('0x11')]);}})[_0x411f('0x13')](function(_0x3ef483){logger[_0x411f('0x10')](_0x411f('0xb'),_0x10cc34,_0x3ef483);_0x4030b2(_0x3ef483);});});}exports[_0x411f('0x14')]=function(_0x4234b7){var _0x471d70=this;return new Promise(function(_0x51ba25,_0x2422a4){return db[_0x411f('0x15')][_0x411f('0x16')]({'raw':_0x4234b7[_0x411f('0x17')]?_0x4234b7[_0x411f('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x4234b7[_0x411f('0x17')]?_0x4234b7[_0x411f('0x17')][_0x411f('0x18')]||null:null,'attributes':_0x4234b7[_0x411f('0x17')]?_0x4234b7[_0x411f('0x17')]['attributes']||null:null,'limit':_0x4234b7[_0x411f('0x17')]?_0x4234b7[_0x411f('0x17')]['limit']||null:null,'include':_0x4234b7[_0x411f('0x17')]?_0x4234b7['options'][_0x411f('0x19')]?_[_0x411f('0x1a')](_0x4234b7['options']['include'],function(_0x3e5f6e){return{'model':db[_0x3e5f6e[_0x411f('0x1b')]],'as':_0x3e5f6e['as'],'attributes':_0x3e5f6e[_0x411f('0x1c')],'include':_0x3e5f6e[_0x411f('0x19')]?_[_0x411f('0x1a')](_0x3e5f6e[_0x411f('0x19')],function(_0x583d41){return{'model':db[_0x583d41[_0x411f('0x1b')]],'as':_0x583d41['as'],'attributes':_0x583d41[_0x411f('0x1c')],'include':_0x583d41[_0x411f('0x19')]?_[_0x411f('0x1a')](_0x583d41[_0x411f('0x19')],function(_0x3c5288){return{'model':db[_0x3c5288[_0x411f('0x1b')]],'as':_0x3c5288['as'],'attributes':_0x3c5288['attributes']};}):[]};}):[]};}):[]:[]})[_0x411f('0xa')](function(_0x164a13){logger[_0x411f('0x1d')](_0x411f('0x14'),_0x4234b7);logger['debug']('GetCmHopperBlack',_0x4234b7,JSON['stringify'](_0x164a13));_0x51ba25(_0x164a13);})[_0x411f('0x13')](function(_0x5876ea){logger[_0x411f('0x10')](_0x411f('0x14'),_0x5876ea[_0x411f('0x11')],_0x4234b7);_0x2422a4(_0x471d70[_0x411f('0x10')](0x1f4,_0x5876ea[_0x411f('0x11')]));});});};exports[_0x411f('0x1e')]=function(_0x351620){var _0x1b59a9=this;return new Promise(function(_0x2d78d7,_0x1134eb){return db[_0x411f('0x15')][_0x411f('0x1f')](_0x351620[_0x411f('0x20')],{'raw':_0x351620[_0x411f('0x17')]?_0x351620[_0x411f('0x17')][_0x411f('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x351620[_0x411f('0x17')]?_0x351620[_0x411f('0x17')]['where']||null:null,'attributes':_0x351620[_0x411f('0x17')]?_0x351620[_0x411f('0x17')][_0x411f('0x1c')]||null:null,'limit':_0x351620[_0x411f('0x17')]?_0x351620['options'][_0x411f('0x22')]||null:null})[_0x411f('0xa')](function(_0x3e5533){logger[_0x411f('0x1d')](_0x411f('0x1e'),_0x351620);logger[_0x411f('0xd')](_0x411f('0x1e'),_0x351620,JSON[_0x411f('0xf')](_0x3e5533));_0x2d78d7(_0x3e5533);})[_0x411f('0x13')](function(_0x2393e4){logger[_0x411f('0x10')](_0x411f('0x1e'),_0x2393e4[_0x411f('0x11')],_0x351620);_0x1134eb(_0x1b59a9[_0x411f('0x10')](0x1f4,_0x2393e4[_0x411f('0x11')]));});});};exports[_0x411f('0x23')]=function(_0x337379){var _0x5ce3ca=this;return new Promise(function(_0x47250d,_0x2f0533){return db[_0x411f('0x15')]['destroy']({'where':_0x337379[_0x411f('0x17')]?_0x337379[_0x411f('0x17')]['where']||null:null})[_0x411f('0xa')](function(_0x281c3e){logger[_0x411f('0x1d')]('DestroyCmHopperBlack',_0x337379);logger[_0x411f('0xd')](_0x411f('0x23'),_0x337379,JSON[_0x411f('0xf')](_0x281c3e));_0x47250d(_0x281c3e);})[_0x411f('0x13')](function(_0xb6378a){logger['error'](_0x411f('0x23'),_0xb6378a['message'],_0x337379);_0x2f0533(_0x5ce3ca[_0x411f('0x10')](0x1f4,_0xb6378a['message']));});});}; \ No newline at end of file +var _0x9ba6=['raw','DestroyCmHopperBlack','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetCmHopperBlack','CmHopperBlack','findAll','options','where','attributes','limit','include','map','model','then','debug','catch','UpdateCmHopperBlack','update','body'];(function(_0xf852,_0x4ddd76){var _0x5b2550=function(_0x4811b1){while(--_0x4811b1){_0xf852['push'](_0xf852['shift']());}};_0x5b2550(++_0x4ddd76);}(_0x9ba6,0x9a));var _0x69ba=function(_0x27dc77,_0x5a8ac5){_0x27dc77=_0x27dc77-0x0;var _0x26d0fa=_0x9ba6[_0x27dc77];return _0x26d0fa;};'use strict';var _=require('lodash');var util=require(_0x69ba('0x0'));var moment=require(_0x69ba('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x69ba('0x2'));var db=require(_0x69ba('0x3'))['db'];var utils=require(_0x69ba('0x4'));var logger=require(_0x69ba('0x5'))('rpc');var config=require(_0x69ba('0x6'));var jayson=require(_0x69ba('0x7'));var client=jayson[_0x69ba('0x8')][_0x69ba('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x14cc85,_0xd48be1,_0xae6c99){return new BPromise(function(_0x14d035,_0x53412e){return client[_0x69ba('0xa')](_0x14cc85,_0xae6c99)['then'](function(_0x16909a){logger[_0x69ba('0xb')](_0x69ba('0xc'),_0xd48be1,_0x69ba('0xd'));logger['debug'](_0x69ba('0xe'),_0xd48be1,_0x69ba('0xd'),JSON[_0x69ba('0xf')](_0x16909a));if(_0x16909a[_0x69ba('0x10')]){if(_0x16909a[_0x69ba('0x10')][_0x69ba('0x11')]===0x1f4){logger[_0x69ba('0x10')](_0x69ba('0xc'),_0xd48be1,_0x16909a[_0x69ba('0x10')][_0x69ba('0x12')]);return _0x53412e(_0x16909a[_0x69ba('0x10')][_0x69ba('0x12')]);}logger['error'](_0x69ba('0xc'),_0xd48be1,_0x16909a[_0x69ba('0x10')][_0x69ba('0x12')]);return _0x14d035(_0x16909a[_0x69ba('0x10')]['message']);}else{logger['info'](_0x69ba('0xc'),_0xd48be1,_0x69ba('0xd'));_0x14d035(_0x16909a[_0x69ba('0x13')][_0x69ba('0x12')]);}})['catch'](function(_0x1afb35){logger[_0x69ba('0x10')](_0x69ba('0xc'),_0xd48be1,_0x1afb35);_0x53412e(_0x1afb35);});});}exports[_0x69ba('0x14')]=function(_0x1021cd){var _0x526edb=this;return new Promise(function(_0x4b9375,_0x17a85d){return db[_0x69ba('0x15')][_0x69ba('0x16')]({'raw':_0x1021cd[_0x69ba('0x17')]?_0x1021cd['options']['raw']===undefined?!![]:![]:!![],'where':_0x1021cd['options']?_0x1021cd[_0x69ba('0x17')][_0x69ba('0x18')]||null:null,'attributes':_0x1021cd[_0x69ba('0x17')]?_0x1021cd[_0x69ba('0x17')][_0x69ba('0x19')]||null:null,'limit':_0x1021cd[_0x69ba('0x17')]?_0x1021cd[_0x69ba('0x17')][_0x69ba('0x1a')]||null:null,'include':_0x1021cd[_0x69ba('0x17')]?_0x1021cd['options'][_0x69ba('0x1b')]?_[_0x69ba('0x1c')](_0x1021cd['options'][_0x69ba('0x1b')],function(_0x5896ac){return{'model':db[_0x5896ac[_0x69ba('0x1d')]],'as':_0x5896ac['as'],'attributes':_0x5896ac[_0x69ba('0x19')],'include':_0x5896ac[_0x69ba('0x1b')]?_[_0x69ba('0x1c')](_0x5896ac[_0x69ba('0x1b')],function(_0x32fb9c){return{'model':db[_0x32fb9c[_0x69ba('0x1d')]],'as':_0x32fb9c['as'],'attributes':_0x32fb9c[_0x69ba('0x19')],'include':_0x32fb9c[_0x69ba('0x1b')]?_[_0x69ba('0x1c')](_0x32fb9c['include'],function(_0x2ced51){return{'model':db[_0x2ced51[_0x69ba('0x1d')]],'as':_0x2ced51['as'],'attributes':_0x2ced51[_0x69ba('0x19')]};}):[]};}):[]};}):[]:[]})[_0x69ba('0x1e')](function(_0x100e2b){logger[_0x69ba('0xb')]('GetCmHopperBlack',_0x1021cd);logger[_0x69ba('0x1f')]('GetCmHopperBlack',_0x1021cd,JSON['stringify'](_0x100e2b));_0x4b9375(_0x100e2b);})[_0x69ba('0x20')](function(_0x243b6a){logger[_0x69ba('0x10')](_0x69ba('0x14'),_0x243b6a[_0x69ba('0x12')],_0x1021cd);_0x17a85d(_0x526edb[_0x69ba('0x10')](0x1f4,_0x243b6a[_0x69ba('0x12')]));});});};exports[_0x69ba('0x21')]=function(_0x47edd1){var _0x105a0d=this;return new Promise(function(_0x4c58c5,_0x30f1c4){return db[_0x69ba('0x15')][_0x69ba('0x22')](_0x47edd1[_0x69ba('0x23')],{'raw':_0x47edd1[_0x69ba('0x17')]?_0x47edd1[_0x69ba('0x17')][_0x69ba('0x24')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x47edd1[_0x69ba('0x17')]?_0x47edd1[_0x69ba('0x17')]['where']||null:null,'attributes':_0x47edd1[_0x69ba('0x17')]?_0x47edd1[_0x69ba('0x17')]['attributes']||null:null,'limit':_0x47edd1['options']?_0x47edd1[_0x69ba('0x17')][_0x69ba('0x1a')]||null:null})[_0x69ba('0x1e')](function(_0x1facbe){logger['info'](_0x69ba('0x21'),_0x47edd1);logger['debug'](_0x69ba('0x21'),_0x47edd1,JSON[_0x69ba('0xf')](_0x1facbe));_0x4c58c5(_0x1facbe);})['catch'](function(_0x4111f6){logger[_0x69ba('0x10')](_0x69ba('0x21'),_0x4111f6[_0x69ba('0x12')],_0x47edd1);_0x30f1c4(_0x105a0d[_0x69ba('0x10')](0x1f4,_0x4111f6[_0x69ba('0x12')]));});});};exports[_0x69ba('0x25')]=function(_0xad34cf){var _0x351f67=this;return new Promise(function(_0x43a1a5,_0x136d01){return db['CmHopperBlack']['destroy']({'where':_0xad34cf[_0x69ba('0x17')]?_0xad34cf['options'][_0x69ba('0x18')]||null:null})[_0x69ba('0x1e')](function(_0x125452){logger[_0x69ba('0xb')]('DestroyCmHopperBlack',_0xad34cf);logger[_0x69ba('0x1f')](_0x69ba('0x25'),_0xad34cf,JSON[_0x69ba('0xf')](_0x125452));_0x43a1a5(_0x125452);})['catch'](function(_0xfb01a4){logger[_0x69ba('0x10')](_0x69ba('0x25'),_0xfb01a4[_0x69ba('0x12')],_0xad34cf);_0x136d01(_0x351f67[_0x69ba('0x10')](0x1f4,_0xfb01a4[_0x69ba('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 0a8ab95..3fa9c4b 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 _0x0e85=['update','delete','destroy','exports','multer','util','connect-timeout','express','../../config/environment','get','isAuthenticated','index','describe','/:id','show'];(function(_0x269b10,_0x1f9bb6){var _0x4b8d6c=function(_0x3426b0){while(--_0x3426b0){_0x269b10['push'](_0x269b10['shift']());}};_0x4b8d6c(++_0x1f9bb6);}(_0x0e85,0x7c));var _0x50e8=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0x0e85[_0x556927];return _0x5f1235;};'use strict';var multer=require(_0x50e8('0x0'));var util=require(_0x50e8('0x1'));var path=require('path');var timeout=require(_0x50e8('0x2'));var express=require(_0x50e8('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x50e8('0x4'));var controller=require('./cmHopperBlack.controller');router[_0x50e8('0x5')]('/',auth[_0x50e8('0x6')](),controller[_0x50e8('0x7')]);router[_0x50e8('0x5')]('/describe',auth[_0x50e8('0x6')](),controller[_0x50e8('0x8')]);router[_0x50e8('0x5')](_0x50e8('0x9'),auth[_0x50e8('0x6')](),controller[_0x50e8('0xa')]);router['put'](_0x50e8('0x9'),auth[_0x50e8('0x6')](),controller[_0x50e8('0xb')]);router[_0x50e8('0xc')](_0x50e8('0x9'),auth[_0x50e8('0x6')](),controller[_0x50e8('0xd')]);module[_0x50e8('0xe')]=router; \ No newline at end of file +var _0xda55=['../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','put','update','delete','destroy','exports','multer','util','express','Router','../../components/auth/service'];(function(_0x47cd9e,_0x9c04a1){var _0x3125dc=function(_0x409930){while(--_0x409930){_0x47cd9e['push'](_0x47cd9e['shift']());}};_0x3125dc(++_0x9c04a1);}(_0xda55,0x6d));var _0x5da5=function(_0xee4c5f,_0x1bf72d){_0xee4c5f=_0xee4c5f-0x0;var _0x5accbc=_0xda55[_0xee4c5f];return _0x5accbc;};'use strict';var multer=require(_0x5da5('0x0'));var util=require(_0x5da5('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5da5('0x2'));var router=express[_0x5da5('0x3')]();var auth=require(_0x5da5('0x4'));var interaction=require(_0x5da5('0x5'));var config=require(_0x5da5('0x6'));var controller=require('./cmHopperBlack.controller');router[_0x5da5('0x7')]('/',auth['isAuthenticated'](),controller[_0x5da5('0x8')]);router['get'](_0x5da5('0x9'),auth[_0x5da5('0xa')](),controller[_0x5da5('0xb')]);router[_0x5da5('0x7')](_0x5da5('0xc'),auth[_0x5da5('0xa')](),controller[_0x5da5('0xd')]);router[_0x5da5('0xe')]('/:id',auth[_0x5da5('0xa')](),controller[_0x5da5('0xf')]);router[_0x5da5('0x10')](_0x5da5('0xc'),auth[_0x5da5('0xa')](),controller[_0x5da5('0x11')]);module[_0x5da5('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index ee68dfc..1db91e4 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 _0x8745=['dispositionat','BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE','getDataValue','seconds','setDataValue'];(function(_0x283b3d,_0x14f588){var _0x5608f9=function(_0x59e002){while(--_0x59e002){_0x283b3d['push'](_0x283b3d['shift']());}};_0x5608f9(++_0x14f588);}(_0x8745,0x136));var _0x5874=function(_0xb4eda8,_0x386fb6){_0xb4eda8=_0xb4eda8-0x0;var _0x2337b8=_0x8745[_0xb4eda8];return _0x2337b8;};'use strict';var Sequelize=require(_0x5874('0x0'));var moment=require(_0x5874('0x1'));module[_0x5874('0x2')]={'state':{'type':Sequelize[_0x5874('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x5874('0x4')]},'scheduledat':{'type':Sequelize[_0x5874('0x5')]},'countbusyretry':{'type':Sequelize[_0x5874('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5874('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x5874('0x4')]},'calleridnum':{'type':Sequelize[_0x5874('0x4')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x5874('0x5')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x5874('0x5')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x5874('0x5')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x5874('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x5874('0x4')]},'reason':{'type':Sequelize[_0x5874('0x4')]},'disposition':{'type':Sequelize[_0x5874('0x4')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x22424e){var _0xd945a9=this[_0x5874('0x6')]('endtime');if(_0xd945a9&&_0x22424e){this['setDataValue']('followuptime',moment(_0x22424e)['diff'](moment(_0xd945a9),_0x5874('0x7')));}return this[_0x5874('0x8')](_0x5874('0x9'),_0x22424e);}},'amd':{'type':Sequelize[_0x5874('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0x5874('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x5874('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x5874('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x5874('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5874('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5874('0x5')]},'deleted':{'type':Sequelize[_0x5874('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x5874('0x5')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0xd2e3=['exports','STRING','DATE','INTEGER','endtime','setDataValue','followuptime','seconds','dispositionat','BOOLEAN','sequelize'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xd2e3,0x1e3));var _0x3d2e=function(_0x43693a,_0xf5d86b){_0x43693a=_0x43693a-0x0;var _0x5eece8=_0xd2e3[_0x43693a];return _0x5eece8;};'use strict';var Sequelize=require(_0x3d2e('0x0'));var moment=require('moment');module[_0x3d2e('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x3d2e('0x2')]},'scheduledat':{'type':Sequelize[_0x3d2e('0x3')]},'countbusyretry':{'type':Sequelize[_0x3d2e('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x3d2e('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x3d2e('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x3d2e('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x3d2e('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x3d2e('0x2')]},'originatecalleridname':{'type':Sequelize[_0x3d2e('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x3d2e('0x2')]},'starttime':{'type':Sequelize[_0x3d2e('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x3d2e('0x3')]},'droptime':{'type':Sequelize[_0x3d2e('0x3')]},'endtime':{'type':Sequelize[_0x3d2e('0x3')]},'ringtime':{'type':Sequelize[_0x3d2e('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x3d2e('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x3d2e('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x3d2e('0x2')]},'campaign':{'type':Sequelize[_0x3d2e('0x2')]},'campaigntype':{'type':Sequelize[_0x3d2e('0x2')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x3d2e('0x2')]},'disposition':{'type':Sequelize[_0x3d2e('0x2')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x14778f){var _0x7e0d36=this['getDataValue'](_0x3d2e('0x5'));if(_0x7e0d36&&_0x14778f){this[_0x3d2e('0x6')](_0x3d2e('0x7'),moment(_0x14778f)['diff'](moment(_0x7e0d36),_0x3d2e('0x8')));}return this[_0x3d2e('0x6')](_0x3d2e('0x9'),_0x14778f);}},'amd':{'type':Sequelize[_0x3d2e('0xa')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x3d2e('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x3d2e('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x3d2e('0x3')]},'callback':{'type':Sequelize[_0x3d2e('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0x3d2e('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x3d2e('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index b5bac08..ff71d92 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 _0xac75=['options','describe','body','find','countContactsQueueCampaignHopperFinal','params','sequelize','COUNT','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','abandonedContacts','reCallContacts','answeringMachine','noSuchContacts','busyContacts','`state`\x20=\x2019,\x201,\x20null','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','select','field','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','updatedAt','from','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','state\x20=\x204','moveContactsIvrCampaignHopperFinal','Campaign','CampaignId','state','group','checkContactHopper','CmHopper','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','squel','crypto','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','json','save','update','then','destroy','sendStatus','stack','name','send','CmHopperFinal','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','keys'];(function(_0x31acb7,_0x160876){var _0x41754a=function(_0xca8647){while(--_0xca8647){_0x31acb7['push'](_0x31acb7['shift']());}};_0x41754a(++_0x160876);}(_0xac75,0x12e));var _0x5ac7=function(_0x45476d,_0x5deaa4){_0x45476d=_0x45476d-0x0;var _0x19873b=_0xac75[_0x45476d];return _0x19873b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5ac7('0x0'));var rimraf=require(_0x5ac7('0x1'));var zipdir=require(_0x5ac7('0x2'));var jsonpatch=require(_0x5ac7('0x3'));var rp=require(_0x5ac7('0x4'));var moment=require(_0x5ac7('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5ac7('0x6'));var util=require(_0x5ac7('0x7'));var path=require(_0x5ac7('0x8'));var sox=require(_0x5ac7('0x9'));var csv=require('to-csv');var ejs=require(_0x5ac7('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5ac7('0xb'));var crypto=require(_0x5ac7('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5ac7('0xd'));var querystring=require(_0x5ac7('0xe'));var Papa=require(_0x5ac7('0xf'));var Redis=require('ioredis');var authService=require(_0x5ac7('0x10'));var qs=require(_0x5ac7('0x11'));var as=require(_0x5ac7('0x12'));var hardwareService=require(_0x5ac7('0x13'));var logger=require(_0x5ac7('0x14'))(_0x5ac7('0x15'));var utils=require(_0x5ac7('0x16'));var config=require(_0x5ac7('0x17'));var db=require(_0x5ac7('0x18'))['db'];function respondWithStatusCode(_0x48fac5,_0x30f0d0){_0x30f0d0=_0x30f0d0||0xcc;return function(_0x382b5e){if(_0x382b5e){return _0x48fac5['sendStatus'](_0x30f0d0);}return _0x48fac5[_0x5ac7('0x19')](_0x30f0d0)[_0x5ac7('0x1a')]();};}function respondWithResult(_0x32d964,_0x2de23c){_0x2de23c=_0x2de23c||0xc8;return function(_0xd68951){if(_0xd68951){return _0x32d964['status'](_0x2de23c)['json'](_0xd68951);}};}function respondWithFilteredResult(_0x40c8ac,_0x441c2a){return function(_0x24b3f0){if(_0x24b3f0){var _0x1e7079=_0x24b3f0[_0x5ac7('0x1b')],_0x3b308a=_0x441c2a[_0x5ac7('0x1c')],_0x157496=_0x441c2a[_0x5ac7('0x1c')]+_0x441c2a[_0x5ac7('0x1d')],_0x1a1053;if(_0x157496>=_0x1e7079){_0x157496=_0x1e7079;_0x1a1053=0xc8;}else{_0x1a1053=0xce;}_0x40c8ac[_0x5ac7('0x19')](_0x1a1053);return _0x40c8ac[_0x5ac7('0x1e')]('Content-Range',_0x3b308a+'-'+_0x157496+'/'+_0x1e7079)[_0x5ac7('0x1f')](_0x24b3f0);}return null;};}function patchUpdates(_0x4a9538){return function(_0x82596c){try{jsonpatch['apply'](_0x82596c,_0x4a9538,!![]);}catch(_0x5216f5){return BPromise['reject'](_0x5216f5);}return _0x82596c[_0x5ac7('0x20')]();};}function saveUpdates(_0x1ae31f,_0x24e118){return function(_0xb7f9a2){if(_0xb7f9a2){return _0xb7f9a2[_0x5ac7('0x21')](_0x1ae31f)[_0x5ac7('0x22')](function(_0x387af8){return _0x387af8;});}return null;};}function removeEntity(_0x4acfd5,_0x2146b7){return function(_0x566f7e){if(_0x566f7e){return _0x566f7e[_0x5ac7('0x23')]()[_0x5ac7('0x22')](function(){_0x4acfd5[_0x5ac7('0x19')](0xcc)[_0x5ac7('0x1a')]();});}};}function handleEntityNotFound(_0x239fc7,_0x3a4625){return function(_0x2239e5){if(!_0x2239e5){_0x239fc7[_0x5ac7('0x24')](0x194);}return _0x2239e5;};}function handleError(_0x39d9ca,_0x2dc646){_0x2dc646=_0x2dc646||0x1f4;return function(_0x149090){logger['error'](_0x149090[_0x5ac7('0x25')]);if(_0x149090[_0x5ac7('0x26')]){delete _0x149090[_0x5ac7('0x26')];}_0x39d9ca[_0x5ac7('0x19')](_0x2dc646)[_0x5ac7('0x27')](_0x149090);};}exports['index']=function(_0x3982bd,_0x4db3da){var _0x326c21={},_0x571876={},_0x2e2643={'count':0x0,'rows':[]};var _0x27d1e4=_['map'](db[_0x5ac7('0x28')]['rawAttributes'],function(_0x1b0769){return{'name':_0x1b0769[_0x5ac7('0x29')],'type':_0x1b0769[_0x5ac7('0x2a')][_0x5ac7('0x2b')]};});_0x571876[_0x5ac7('0x2c')]=_[_0x5ac7('0x2d')](_0x27d1e4,_0x5ac7('0x26'));_0x571876[_0x5ac7('0x2e')]=_['keys'](_0x3982bd['query']);_0x571876[_0x5ac7('0x2f')]=_[_0x5ac7('0x30')](_0x571876['model'],_0x571876[_0x5ac7('0x2e')]);_0x326c21[_0x5ac7('0x31')]=_[_0x5ac7('0x30')](_0x571876[_0x5ac7('0x2c')],qs['fields'](_0x3982bd['query'][_0x5ac7('0x32')]));_0x326c21[_0x5ac7('0x31')]=_0x326c21[_0x5ac7('0x31')][_0x5ac7('0x33')]?_0x326c21[_0x5ac7('0x31')]:_0x571876['model'];if(!_0x3982bd[_0x5ac7('0x2e')][_0x5ac7('0x34')](_0x5ac7('0x35'))){_0x326c21[_0x5ac7('0x1d')]=qs[_0x5ac7('0x1d')](_0x3982bd[_0x5ac7('0x2e')][_0x5ac7('0x1d')]);_0x326c21['offset']=qs[_0x5ac7('0x1c')](_0x3982bd['query'][_0x5ac7('0x1c')]);}_0x326c21[_0x5ac7('0x36')]=qs[_0x5ac7('0x37')](_0x3982bd[_0x5ac7('0x2e')][_0x5ac7('0x37')]);_0x326c21['where']=qs['filters'](_['pick'](_0x3982bd[_0x5ac7('0x2e')],_0x571876['filters']));if(_0x3982bd['query']['filter']){_0x326c21[_0x5ac7('0x38')]=_[_0x5ac7('0x39')](_0x326c21[_0x5ac7('0x38')],{'$or':_[_0x5ac7('0x2d')](_0x27d1e4,function(_0x7c544a){if(_0x7c544a['type']!==_0x5ac7('0x3a')){var _0x127f6c={};_0x127f6c[_0x7c544a[_0x5ac7('0x26')]]={'$like':'%'+_0x3982bd[_0x5ac7('0x2e')][_0x5ac7('0x3b')]+'%'};return _0x127f6c;}})});}_0x326c21=_['merge']({},_0x326c21,_0x3982bd['options']);var _0x51206c={'where':_0x326c21['where']};return db['CmHopperFinal'][_0x5ac7('0x1b')](_0x51206c)[_0x5ac7('0x22')](function(_0x2816e9){_0x2e2643[_0x5ac7('0x1b')]=_0x2816e9;if(_0x3982bd[_0x5ac7('0x2e')][_0x5ac7('0x3c')]){_0x326c21[_0x5ac7('0x3d')]=[{'all':!![]}];}return db[_0x5ac7('0x28')][_0x5ac7('0x3e')](_0x326c21);})[_0x5ac7('0x22')](function(_0x44c204){_0x2e2643[_0x5ac7('0x3f')]=_0x44c204;return _0x2e2643;})[_0x5ac7('0x22')](respondWithFilteredResult(_0x4db3da,_0x326c21))[_0x5ac7('0x40')](handleError(_0x4db3da,null));};exports[_0x5ac7('0x41')]=function(_0x161906,_0x521a44){var _0x1359b2={'raw':!![],'where':{'id':_0x161906['params']['id']}},_0x1240d7={};_0x1240d7[_0x5ac7('0x2c')]=_[_0x5ac7('0x42')](db[_0x5ac7('0x28')]['rawAttributes']);_0x1240d7['query']=_[_0x5ac7('0x42')](_0x161906['query']);_0x1240d7['filters']=_['intersection'](_0x1240d7[_0x5ac7('0x2c')],_0x1240d7['query']);_0x1359b2[_0x5ac7('0x31')]=_[_0x5ac7('0x30')](_0x1240d7['model'],qs[_0x5ac7('0x32')](_0x161906[_0x5ac7('0x2e')][_0x5ac7('0x32')]));_0x1359b2['attributes']=_0x1359b2['attributes'][_0x5ac7('0x33')]?_0x1359b2[_0x5ac7('0x31')]:_0x1240d7[_0x5ac7('0x2c')];if(_0x161906[_0x5ac7('0x2e')][_0x5ac7('0x3c')]){_0x1359b2['include']=[{'all':!![]}];}_0x1359b2=_[_0x5ac7('0x39')]({},_0x1359b2,_0x161906[_0x5ac7('0x43')]);return db[_0x5ac7('0x28')]['find'](_0x1359b2)[_0x5ac7('0x22')](handleEntityNotFound(_0x521a44,null))[_0x5ac7('0x22')](respondWithResult(_0x521a44,null))[_0x5ac7('0x40')](handleError(_0x521a44,null));};exports['describe']=function(_0x22f1f6,_0x444402){return db[_0x5ac7('0x28')][_0x5ac7('0x44')]()[_0x5ac7('0x22')](respondWithResult(_0x444402,null))[_0x5ac7('0x40')](handleError(_0x444402,null));};exports[_0x5ac7('0x21')]=function(_0x2bc85d,_0x56dc15){if(_0x2bc85d[_0x5ac7('0x45')]['uniqueid']){delete _0x2bc85d['body']['uniqueid'];}return db['CmHopperFinal'][_0x5ac7('0x46')]({'where':{'uniqueid':_0x2bc85d['params']['id']}})[_0x5ac7('0x22')](handleEntityNotFound(_0x56dc15,null))[_0x5ac7('0x22')](saveUpdates(_0x2bc85d[_0x5ac7('0x45')],null))[_0x5ac7('0x22')](respondWithResult(_0x56dc15,null))[_0x5ac7('0x40')](handleError(_0x56dc15,null));};exports[_0x5ac7('0x47')]=function(_0x5ae034,_0x1e6ce5,_0x44c335){return db[_0x5ac7('0x28')][_0x5ac7('0x3e')]({'raw':![],'where':{'VoiceQueueId':_0x5ae034[_0x5ac7('0x48')]['id']},'attributes':[[db[_0x5ac7('0x49')]['fn'](_0x5ac7('0x4a'),db[_0x5ac7('0x49')]['fn']('IF',db['sequelize'][_0x5ac7('0x4b')]('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db[_0x5ac7('0x49')]['fn'](_0x5ac7('0x4a'),db[_0x5ac7('0x49')]['fn']('IF',db[_0x5ac7('0x49')]['literal'](_0x5ac7('0x4c')))),_0x5ac7('0x4d')],[db[_0x5ac7('0x49')]['fn'](_0x5ac7('0x4a'),db['sequelize']['fn']('IF',db[_0x5ac7('0x49')]['literal'](_0x5ac7('0x4e')))),'busyContacts'],[db[_0x5ac7('0x49')]['fn'](_0x5ac7('0x4a'),db[_0x5ac7('0x49')]['fn']('IF',db['sequelize'][_0x5ac7('0x4b')](_0x5ac7('0x4f')))),_0x5ac7('0x50')],[db[_0x5ac7('0x49')]['fn'](_0x5ac7('0x4a'),db[_0x5ac7('0x49')]['fn']('IF',db[_0x5ac7('0x49')][_0x5ac7('0x4b')](_0x5ac7('0x51')))),_0x5ac7('0x52')],[db[_0x5ac7('0x49')]['fn'](_0x5ac7('0x4a'),db[_0x5ac7('0x49')]['fn']('IF',db[_0x5ac7('0x49')][_0x5ac7('0x4b')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x5ac7('0x53')],[db[_0x5ac7('0x49')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x5ac7('0x49')][_0x5ac7('0x4b')]('`state`\x20=\x2022,\x201,\x20null'))),_0x5ac7('0x54')],[db[_0x5ac7('0x49')]['fn'](_0x5ac7('0x4a'),db[_0x5ac7('0x49')]['fn']('IF',db['sequelize'][_0x5ac7('0x4b')]('`state`\x20=\x2019,\x201,\x20null'))),_0x5ac7('0x55')]]})['then'](handleEntityNotFound(_0x1e6ce5,null))['then'](respondWithResult(_0x1e6ce5,null))[_0x5ac7('0x40')](handleError(_0x1e6ce5,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x1f6e5b,_0x7c41b0,_0x191225){return db[_0x5ac7('0x28')]['findAll']({'raw':![],'where':{'CampaignId':_0x1f6e5b[_0x5ac7('0x48')]['id']},'attributes':[[db[_0x5ac7('0x49')]['fn'](_0x5ac7('0x4a'),db[_0x5ac7('0x49')]['fn']('IF',db['sequelize'][_0x5ac7('0x4b')]('`state`\x20=\x200,\x201,\x20null'))),_0x5ac7('0x56')],[db['sequelize']['fn'](_0x5ac7('0x4a'),db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x203,\x201,\x20null'))),_0x5ac7('0x4d')],[db[_0x5ac7('0x49')]['fn'](_0x5ac7('0x4a'),db['sequelize']['fn']('IF',db[_0x5ac7('0x49')][_0x5ac7('0x4b')](_0x5ac7('0x4e')))),_0x5ac7('0x57')],[db[_0x5ac7('0x49')]['fn']('COUNT',db[_0x5ac7('0x49')]['fn']('IF',db[_0x5ac7('0x49')][_0x5ac7('0x4b')]('`state`\x20=\x208,\x201,\x20null'))),'congestionContacts'],[db[_0x5ac7('0x49')]['fn'](_0x5ac7('0x4a'),db[_0x5ac7('0x49')]['fn']('IF',db[_0x5ac7('0x49')][_0x5ac7('0x4b')](_0x5ac7('0x51')))),_0x5ac7('0x52')],[db[_0x5ac7('0x49')]['fn']('COUNT',db[_0x5ac7('0x49')]['fn']('IF',db[_0x5ac7('0x49')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x5ac7('0x53')],[db[_0x5ac7('0x49')]['fn'](_0x5ac7('0x4a'),db[_0x5ac7('0x49')]['fn']('IF',db[_0x5ac7('0x49')][_0x5ac7('0x4b')]('`state`\x20=\x2022,\x201,\x20null'))),'reCallContacts'],[db['sequelize']['fn'](_0x5ac7('0x4a'),db['sequelize']['fn']('IF',db[_0x5ac7('0x49')][_0x5ac7('0x4b')](_0x5ac7('0x58')))),_0x5ac7('0x55')]]})[_0x5ac7('0x22')](handleEntityNotFound(_0x7c41b0,null))[_0x5ac7('0x22')](respondWithResult(_0x7c41b0,null))[_0x5ac7('0x40')](handleError(_0x7c41b0,null));};exports[_0x5ac7('0x59')]=function(_0x582ad4,_0x31c89c,_0x2d1473){return db['VoiceQueue'][_0x5ac7('0x46')]({'where':{'id':_0x582ad4[_0x5ac7('0x48')]['id']}})['then'](handleEntityNotFound(_0x31c89c,null))[_0x5ac7('0x22')](function(_0xf9473){var _0x1933d9;if(_0xf9473){_0x1933d9=squel[_0x5ac7('0x5a')]()[_0x5ac7('0x5b')](_0x5ac7('0x5c'))[_0x5ac7('0x5d')]([_0x5ac7('0x5e'),_0x5ac7('0x5f'),_0x5ac7('0x60'),_0x5ac7('0x61'),_0x5ac7('0x62'),_0x5ac7('0x63'),'updatedAt'],squel[_0x5ac7('0x64')]()[_0x5ac7('0x65')]('ANY_VALUE(calleridnum)',_0x5ac7('0x5e'))[_0x5ac7('0x65')](_0x5ac7('0x66'),'scheduledAt')[_0x5ac7('0x65')](_0x5ac7('0x67'),_0x5ac7('0x60'))[_0x5ac7('0x65')](_0x5ac7('0x68'),'ListId')[_0x5ac7('0x65')](_0x5ac7('0x69'),'VoiceQueueId')[_0x5ac7('0x65')]('NOW()','createdAt')[_0x5ac7('0x65')](_0x5ac7('0x66'),_0x5ac7('0x6a'))[_0x5ac7('0x6b')]('cm_hopper_final')[_0x5ac7('0x38')](_0x5ac7('0x6c'),_0x582ad4['params']['id'][_0x5ac7('0x6d')]())['where'](_0x5ac7('0x6e'),_0x582ad4['body']['state']['toString']())[_0x5ac7('0x38')](_0x5ac7('0x6f'))['where'](_0x5ac7('0x70'),squel[_0x5ac7('0x64')]()[_0x5ac7('0x65')](_0x5ac7('0x5e'))[_0x5ac7('0x6b')](_0x5ac7('0x5c'))['where']('VoiceQueueId\x20=\x20?',_0x582ad4[_0x5ac7('0x48')]['id'][_0x5ac7('0x6d')]()))[_0x5ac7('0x38')](_0x5ac7('0x70'),squel[_0x5ac7('0x64')]()[_0x5ac7('0x65')](_0x5ac7('0x71'))[_0x5ac7('0x6b')](_0x5ac7('0x72'))[_0x5ac7('0x38')](_0x5ac7('0x6c'),_0x582ad4[_0x5ac7('0x48')]['id'][_0x5ac7('0x6d')]())[_0x5ac7('0x38')](_0x5ac7('0x73')))['group'](_0x5ac7('0x60')))[_0x5ac7('0x6d')]();return db[_0x5ac7('0x49')]['query'](_0x1933d9);}return[];})[_0x5ac7('0x22')](respondWithResult(_0x31c89c,null))['catch'](handleError(_0x31c89c,null));};exports[_0x5ac7('0x74')]=function(_0xb5ff05,_0x26b555,_0x3a8252){return db[_0x5ac7('0x75')][_0x5ac7('0x46')]({'where':{'id':_0xb5ff05[_0x5ac7('0x48')]['id']}})['then'](handleEntityNotFound(_0x26b555,null))['then'](function(_0x5436cf){var _0x1a8533;if(_0x5436cf){_0x1a8533=squel[_0x5ac7('0x5a')]()[_0x5ac7('0x5b')](_0x5ac7('0x5c'))[_0x5ac7('0x5d')]([_0x5ac7('0x5e'),_0x5ac7('0x5f'),_0x5ac7('0x60'),_0x5ac7('0x61'),_0x5ac7('0x76'),_0x5ac7('0x63'),_0x5ac7('0x6a')],squel[_0x5ac7('0x64')]()[_0x5ac7('0x65')]('ANY_VALUE(calleridnum)','phone')[_0x5ac7('0x65')](_0x5ac7('0x66'),_0x5ac7('0x5f'))[_0x5ac7('0x65')](_0x5ac7('0x67'),_0x5ac7('0x60'))['field'](_0x5ac7('0x68'),_0x5ac7('0x61'))['field']('ANY_VALUE(CampaignId)',_0x5ac7('0x76'))[_0x5ac7('0x65')](_0x5ac7('0x66'),_0x5ac7('0x63'))[_0x5ac7('0x65')]('NOW()',_0x5ac7('0x6a'))[_0x5ac7('0x6b')]('cm_hopper_final')[_0x5ac7('0x38')]('CampaignId\x20=\x20?',_0xb5ff05[_0x5ac7('0x48')]['id']['toString']())[_0x5ac7('0x38')](_0x5ac7('0x6e'),_0xb5ff05[_0x5ac7('0x45')][_0x5ac7('0x77')][_0x5ac7('0x6d')]())[_0x5ac7('0x38')](_0x5ac7('0x6f'))[_0x5ac7('0x38')](_0x5ac7('0x70'),squel[_0x5ac7('0x64')]()[_0x5ac7('0x65')](_0x5ac7('0x5e'))[_0x5ac7('0x6b')](_0x5ac7('0x5c'))['where']('CampaignId\x20=\x20?',_0xb5ff05['params']['id']['toString']()))[_0x5ac7('0x38')](_0x5ac7('0x70'),squel[_0x5ac7('0x64')]()['field'](_0x5ac7('0x71'))[_0x5ac7('0x6b')]('cm_hopper_final')[_0x5ac7('0x38')]('CampaignId\x20=\x20?',_0xb5ff05[_0x5ac7('0x48')]['id'][_0x5ac7('0x6d')]())['where'](_0x5ac7('0x73')))[_0x5ac7('0x78')]('ContactId'))[_0x5ac7('0x6d')]();return db[_0x5ac7('0x49')][_0x5ac7('0x2e')](_0x1a8533);}return[];})[_0x5ac7('0x22')](respondWithResult(_0x26b555,null))[_0x5ac7('0x40')](handleError(_0x26b555,null));};exports[_0x5ac7('0x79')]=function(_0x413405,_0x3ead4c,_0x49b8b0){return db[_0x5ac7('0x7a')]['findOne']({'where':{'VoiceQueueId':_0x413405[_0x5ac7('0x45')]['VoiceQueueId'],'CampaignId':_0x413405[_0x5ac7('0x45')][_0x5ac7('0x76')],'ContactId':_0x413405[_0x5ac7('0x45')][_0x5ac7('0x60')]}})[_0x5ac7('0x22')](handleEntityNotFound(_0x3ead4c,null))[_0x5ac7('0x22')](function(_0xb14869){if(_0xb14869){return _0xb14869;}return null;})['then'](respondWithResult(_0x3ead4c,null))[_0x5ac7('0x40')](handleError(_0x3ead4c,null));}; \ No newline at end of file +var _0x9ee5=['end','json','offset','limit','set','Content-Range','reject','save','error','name','send','index','CmHopperFinal','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','count','then','includeAll','include','findAll','rows','catch','show','describe','update','uniqueid','body','find','params','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','noSuchContacts','dropContacts','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','phone','NOW()','ANY_VALUE(ContactId)','ListId','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper','state\x20=\x204','Campaign','CampaignId','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum','group','CmHopper','findOne','VoiceQueueId','html-pdf','eml-format','zip-dir','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','sendStatus','status'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9ee5,0xe8));var _0x59ee=function(_0xa9cc2c,_0x5bf493){_0xa9cc2c=_0xa9cc2c-0x0;var _0x4816a4=_0x9ee5[_0xa9cc2c];return _0x4816a4;};'use strict';var pdf=require(_0x59ee('0x0'));var emlformat=require(_0x59ee('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x59ee('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x59ee('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x59ee('0x4'));var util=require(_0x59ee('0x5'));var path=require(_0x59ee('0x6'));var sox=require(_0x59ee('0x7'));var csv=require('to-csv');var ejs=require(_0x59ee('0x8'));var fs=require('fs');var _=require(_0x59ee('0x9'));var squel=require(_0x59ee('0xa'));var crypto=require(_0x59ee('0xb'));var jsforce=require(_0x59ee('0xc'));var deskjs=require(_0x59ee('0xd'));var toCsv=require(_0x59ee('0xe'));var querystring=require('querystring');var Papa=require(_0x59ee('0xf'));var Redis=require(_0x59ee('0x10'));var authService=require(_0x59ee('0x11'));var qs=require(_0x59ee('0x12'));var as=require(_0x59ee('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x59ee('0x14'));var utils=require('../../config/utils');var config=require(_0x59ee('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x480679,_0x801761){_0x801761=_0x801761||0xcc;return function(_0x207fd6){if(_0x207fd6){return _0x480679[_0x59ee('0x16')](_0x801761);}return _0x480679[_0x59ee('0x17')](_0x801761)[_0x59ee('0x18')]();};}function respondWithResult(_0x109f5a,_0x18855e){_0x18855e=_0x18855e||0xc8;return function(_0x11806d){if(_0x11806d){return _0x109f5a['status'](_0x18855e)[_0x59ee('0x19')](_0x11806d);}};}function respondWithFilteredResult(_0x334616,_0xb494c1){return function(_0x1c3591){if(_0x1c3591){var _0x1d3187=_0x1c3591['count'],_0x4deea3=_0xb494c1[_0x59ee('0x1a')],_0xb684ad=_0xb494c1[_0x59ee('0x1a')]+_0xb494c1[_0x59ee('0x1b')],_0x11a0d1;if(_0xb684ad>=_0x1d3187){_0xb684ad=_0x1d3187;_0x11a0d1=0xc8;}else{_0x11a0d1=0xce;}_0x334616['status'](_0x11a0d1);return _0x334616[_0x59ee('0x1c')](_0x59ee('0x1d'),_0x4deea3+'-'+_0xb684ad+'/'+_0x1d3187)[_0x59ee('0x19')](_0x1c3591);}return null;};}function patchUpdates(_0x415d0d){return function(_0x1f349e){try{jsonpatch['apply'](_0x1f349e,_0x415d0d,!![]);}catch(_0x39d1c3){return BPromise[_0x59ee('0x1e')](_0x39d1c3);}return _0x1f349e[_0x59ee('0x1f')]();};}function saveUpdates(_0x4fb64c,_0x2c977b){return function(_0x7e743){if(_0x7e743){return _0x7e743['update'](_0x4fb64c)['then'](function(_0x836c6){return _0x836c6;});}return null;};}function removeEntity(_0x12f209,_0xf72fd8){return function(_0x3f987d){if(_0x3f987d){return _0x3f987d['destroy']()['then'](function(){_0x12f209[_0x59ee('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5548bf,_0x341e2c){return function(_0x327d4c){if(!_0x327d4c){_0x5548bf['sendStatus'](0x194);}return _0x327d4c;};}function handleError(_0x5c199c,_0x4de0e2){_0x4de0e2=_0x4de0e2||0x1f4;return function(_0x1fe888){logger[_0x59ee('0x20')](_0x1fe888['stack']);if(_0x1fe888[_0x59ee('0x21')]){delete _0x1fe888[_0x59ee('0x21')];}_0x5c199c['status'](_0x4de0e2)[_0x59ee('0x22')](_0x1fe888);};}exports[_0x59ee('0x23')]=function(_0x5c53cf,_0x124116){var _0x29084d={},_0x3f4f57={},_0x3b2bea={'count':0x0,'rows':[]};var _0x13e05c=_['map'](db[_0x59ee('0x24')][_0x59ee('0x25')],function(_0x42bd6e){return{'name':_0x42bd6e[_0x59ee('0x26')],'type':_0x42bd6e[_0x59ee('0x27')][_0x59ee('0x28')]};});_0x3f4f57[_0x59ee('0x29')]=_[_0x59ee('0x2a')](_0x13e05c,_0x59ee('0x21'));_0x3f4f57[_0x59ee('0x2b')]=_[_0x59ee('0x2c')](_0x5c53cf[_0x59ee('0x2b')]);_0x3f4f57[_0x59ee('0x2d')]=_[_0x59ee('0x2e')](_0x3f4f57[_0x59ee('0x29')],_0x3f4f57['query']);_0x29084d[_0x59ee('0x2f')]=_['intersection'](_0x3f4f57[_0x59ee('0x29')],qs[_0x59ee('0x30')](_0x5c53cf[_0x59ee('0x2b')][_0x59ee('0x30')]));_0x29084d[_0x59ee('0x2f')]=_0x29084d[_0x59ee('0x2f')][_0x59ee('0x31')]?_0x29084d[_0x59ee('0x2f')]:_0x3f4f57[_0x59ee('0x29')];if(!_0x5c53cf['query']['hasOwnProperty'](_0x59ee('0x32'))){_0x29084d[_0x59ee('0x1b')]=qs['limit'](_0x5c53cf[_0x59ee('0x2b')][_0x59ee('0x1b')]);_0x29084d[_0x59ee('0x1a')]=qs[_0x59ee('0x1a')](_0x5c53cf[_0x59ee('0x2b')][_0x59ee('0x1a')]);}_0x29084d['order']=qs[_0x59ee('0x33')](_0x5c53cf[_0x59ee('0x2b')][_0x59ee('0x33')]);_0x29084d[_0x59ee('0x34')]=qs[_0x59ee('0x2d')](_[_0x59ee('0x35')](_0x5c53cf[_0x59ee('0x2b')],_0x3f4f57[_0x59ee('0x2d')]));if(_0x5c53cf[_0x59ee('0x2b')][_0x59ee('0x36')]){_0x29084d[_0x59ee('0x34')]=_[_0x59ee('0x37')](_0x29084d[_0x59ee('0x34')],{'$or':_[_0x59ee('0x2a')](_0x13e05c,function(_0x109f0f){if(_0x109f0f[_0x59ee('0x27')]!==_0x59ee('0x38')){var _0x3e065a={};_0x3e065a[_0x109f0f['name']]={'$like':'%'+_0x5c53cf[_0x59ee('0x2b')]['filter']+'%'};return _0x3e065a;}})});}_0x29084d=_[_0x59ee('0x37')]({},_0x29084d,_0x5c53cf[_0x59ee('0x39')]);var _0x55ba2c={'where':_0x29084d['where']};return db[_0x59ee('0x24')][_0x59ee('0x3a')](_0x55ba2c)[_0x59ee('0x3b')](function(_0x4ea619){_0x3b2bea[_0x59ee('0x3a')]=_0x4ea619;if(_0x5c53cf[_0x59ee('0x2b')][_0x59ee('0x3c')]){_0x29084d[_0x59ee('0x3d')]=[{'all':!![]}];}return db[_0x59ee('0x24')][_0x59ee('0x3e')](_0x29084d);})[_0x59ee('0x3b')](function(_0x4ee600){_0x3b2bea[_0x59ee('0x3f')]=_0x4ee600;return _0x3b2bea;})[_0x59ee('0x3b')](respondWithFilteredResult(_0x124116,_0x29084d))[_0x59ee('0x40')](handleError(_0x124116,null));};exports[_0x59ee('0x41')]=function(_0x52ce31,_0x13bb92){var _0x148b25={'raw':!![],'where':{'id':_0x52ce31['params']['id']}},_0x208d1f={};_0x208d1f[_0x59ee('0x29')]=_['keys'](db[_0x59ee('0x24')]['rawAttributes']);_0x208d1f['query']=_[_0x59ee('0x2c')](_0x52ce31[_0x59ee('0x2b')]);_0x208d1f[_0x59ee('0x2d')]=_[_0x59ee('0x2e')](_0x208d1f[_0x59ee('0x29')],_0x208d1f[_0x59ee('0x2b')]);_0x148b25[_0x59ee('0x2f')]=_[_0x59ee('0x2e')](_0x208d1f[_0x59ee('0x29')],qs[_0x59ee('0x30')](_0x52ce31[_0x59ee('0x2b')][_0x59ee('0x30')]));_0x148b25['attributes']=_0x148b25[_0x59ee('0x2f')][_0x59ee('0x31')]?_0x148b25[_0x59ee('0x2f')]:_0x208d1f[_0x59ee('0x29')];if(_0x52ce31['query']['includeAll']){_0x148b25[_0x59ee('0x3d')]=[{'all':!![]}];}_0x148b25=_[_0x59ee('0x37')]({},_0x148b25,_0x52ce31[_0x59ee('0x39')]);return db['CmHopperFinal']['find'](_0x148b25)[_0x59ee('0x3b')](handleEntityNotFound(_0x13bb92,null))[_0x59ee('0x3b')](respondWithResult(_0x13bb92,null))[_0x59ee('0x40')](handleError(_0x13bb92,null));};exports[_0x59ee('0x42')]=function(_0x2bdbd3,_0x67534f){return db[_0x59ee('0x24')][_0x59ee('0x42')]()[_0x59ee('0x3b')](respondWithResult(_0x67534f,null))['catch'](handleError(_0x67534f,null));};exports[_0x59ee('0x43')]=function(_0x1d2be6,_0x42bea1){if(_0x1d2be6['body'][_0x59ee('0x44')]){delete _0x1d2be6[_0x59ee('0x45')][_0x59ee('0x44')];}return db['CmHopperFinal'][_0x59ee('0x46')]({'where':{'uniqueid':_0x1d2be6[_0x59ee('0x47')]['id']}})['then'](handleEntityNotFound(_0x42bea1,null))[_0x59ee('0x3b')](saveUpdates(_0x1d2be6[_0x59ee('0x45')],null))[_0x59ee('0x3b')](respondWithResult(_0x42bea1,null))['catch'](handleError(_0x42bea1,null));};exports[_0x59ee('0x48')]=function(_0x50c7ee,_0x40a9f4,_0x13bc3e){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'VoiceQueueId':_0x50c7ee['params']['id']},'attributes':[[db[_0x59ee('0x49')]['fn'](_0x59ee('0x4a'),db[_0x59ee('0x49')]['fn']('IF',db[_0x59ee('0x49')]['literal']('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db[_0x59ee('0x49')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x59ee('0x49')][_0x59ee('0x4b')](_0x59ee('0x4c')))),_0x59ee('0x4d')],[db[_0x59ee('0x49')]['fn'](_0x59ee('0x4a'),db[_0x59ee('0x49')]['fn']('IF',db[_0x59ee('0x49')][_0x59ee('0x4b')](_0x59ee('0x4e')))),_0x59ee('0x4f')],[db['sequelize']['fn'](_0x59ee('0x4a'),db['sequelize']['fn']('IF',db[_0x59ee('0x49')]['literal'](_0x59ee('0x50')))),_0x59ee('0x51')],[db[_0x59ee('0x49')]['fn'](_0x59ee('0x4a'),db[_0x59ee('0x49')]['fn']('IF',db['sequelize'][_0x59ee('0x4b')]('`state`\x20=\x2010\x20,\x201,\x20null'))),'dropContacts'],[db['sequelize']['fn'](_0x59ee('0x4a'),db[_0x59ee('0x49')]['fn']('IF',db[_0x59ee('0x49')][_0x59ee('0x4b')](_0x59ee('0x52')))),_0x59ee('0x53')],[db[_0x59ee('0x49')]['fn'](_0x59ee('0x4a'),db[_0x59ee('0x49')]['fn']('IF',db[_0x59ee('0x49')][_0x59ee('0x4b')]('`state`\x20=\x2022,\x201,\x20null'))),_0x59ee('0x54')],[db[_0x59ee('0x49')]['fn'](_0x59ee('0x4a'),db['sequelize']['fn']('IF',db[_0x59ee('0x49')][_0x59ee('0x4b')](_0x59ee('0x55')))),_0x59ee('0x56')]]})[_0x59ee('0x3b')](handleEntityNotFound(_0x40a9f4,null))[_0x59ee('0x3b')](respondWithResult(_0x40a9f4,null))[_0x59ee('0x40')](handleError(_0x40a9f4,null));};exports[_0x59ee('0x57')]=function(_0x259545,_0x2d623a,_0x578d03){return db[_0x59ee('0x24')][_0x59ee('0x3e')]({'raw':![],'where':{'CampaignId':_0x259545[_0x59ee('0x47')]['id']},'attributes':[[db[_0x59ee('0x49')]['fn'](_0x59ee('0x4a'),db[_0x59ee('0x49')]['fn']('IF',db[_0x59ee('0x49')]['literal']('`state`\x20=\x200,\x201,\x20null'))),_0x59ee('0x58')],[db[_0x59ee('0x49')]['fn'](_0x59ee('0x4a'),db[_0x59ee('0x49')]['fn']('IF',db[_0x59ee('0x49')][_0x59ee('0x4b')](_0x59ee('0x4c')))),'noAnswerContacts'],[db[_0x59ee('0x49')]['fn'](_0x59ee('0x4a'),db['sequelize']['fn']('IF',db[_0x59ee('0x49')][_0x59ee('0x4b')]('`state`\x20=\x205,\x201,\x20null'))),'busyContacts'],[db[_0x59ee('0x49')]['fn'](_0x59ee('0x4a'),db['sequelize']['fn']('IF',db[_0x59ee('0x49')]['literal'](_0x59ee('0x50')))),_0x59ee('0x51')],[db[_0x59ee('0x49')]['fn'](_0x59ee('0x4a'),db[_0x59ee('0x49')]['fn']('IF',db[_0x59ee('0x49')][_0x59ee('0x4b')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x59ee('0x59')],[db[_0x59ee('0x49')]['fn'](_0x59ee('0x4a'),db['sequelize']['fn']('IF',db[_0x59ee('0x49')][_0x59ee('0x4b')](_0x59ee('0x52')))),_0x59ee('0x53')],[db[_0x59ee('0x49')]['fn']('COUNT',db[_0x59ee('0x49')]['fn']('IF',db[_0x59ee('0x49')]['literal'](_0x59ee('0x5a')))),_0x59ee('0x54')],[db['sequelize']['fn']('COUNT',db[_0x59ee('0x49')]['fn']('IF',db[_0x59ee('0x49')][_0x59ee('0x4b')](_0x59ee('0x55')))),_0x59ee('0x56')]]})[_0x59ee('0x3b')](handleEntityNotFound(_0x2d623a,null))['then'](respondWithResult(_0x2d623a,null))[_0x59ee('0x40')](handleError(_0x2d623a,null));};exports[_0x59ee('0x5b')]=function(_0x4c6780,_0xd38382,_0x484fe5){return db[_0x59ee('0x5c')][_0x59ee('0x46')]({'where':{'id':_0x4c6780['params']['id']}})[_0x59ee('0x3b')](handleEntityNotFound(_0xd38382,null))[_0x59ee('0x3b')](function(_0x1dd48d){var _0xb61ffe;if(_0x1dd48d){_0xb61ffe=squel[_0x59ee('0x5d')]()[_0x59ee('0x5e')]('cm_hopper')[_0x59ee('0x5f')](['phone',_0x59ee('0x60'),_0x59ee('0x61'),'ListId','VoiceQueueId',_0x59ee('0x62'),_0x59ee('0x63')],squel[_0x59ee('0x64')]()[_0x59ee('0x65')](_0x59ee('0x66'),_0x59ee('0x67'))['field'](_0x59ee('0x68'),_0x59ee('0x60'))[_0x59ee('0x65')](_0x59ee('0x69'),'ContactId')['field']('ANY_VALUE(ListId)',_0x59ee('0x6a'))[_0x59ee('0x65')](_0x59ee('0x6b'),'VoiceQueueId')['field'](_0x59ee('0x68'),_0x59ee('0x62'))[_0x59ee('0x65')](_0x59ee('0x68'),_0x59ee('0x63'))[_0x59ee('0x6c')](_0x59ee('0x6d'))[_0x59ee('0x34')](_0x59ee('0x6e'),_0x4c6780[_0x59ee('0x47')]['id'][_0x59ee('0x6f')]())[_0x59ee('0x34')](_0x59ee('0x70'),_0x4c6780[_0x59ee('0x45')][_0x59ee('0x71')][_0x59ee('0x6f')]())[_0x59ee('0x34')](_0x59ee('0x72'))[_0x59ee('0x34')](_0x59ee('0x73'),squel[_0x59ee('0x64')]()['field'](_0x59ee('0x67'))[_0x59ee('0x6c')](_0x59ee('0x74'))[_0x59ee('0x34')](_0x59ee('0x6e'),_0x4c6780[_0x59ee('0x47')]['id'][_0x59ee('0x6f')]()))[_0x59ee('0x34')](_0x59ee('0x73'),squel['select']()['field']('calleridnum')[_0x59ee('0x6c')](_0x59ee('0x6d'))[_0x59ee('0x34')](_0x59ee('0x6e'),_0x4c6780[_0x59ee('0x47')]['id']['toString']())[_0x59ee('0x34')](_0x59ee('0x75')))['group'](_0x59ee('0x61')))[_0x59ee('0x6f')]();return db['sequelize'][_0x59ee('0x2b')](_0xb61ffe);}return[];})['then'](respondWithResult(_0xd38382,null))[_0x59ee('0x40')](handleError(_0xd38382,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0xbac0a7,_0x37a2cd,_0x67c9f9){return db[_0x59ee('0x76')][_0x59ee('0x46')]({'where':{'id':_0xbac0a7[_0x59ee('0x47')]['id']}})['then'](handleEntityNotFound(_0x37a2cd,null))[_0x59ee('0x3b')](function(_0x45cf44){var _0x21011e;if(_0x45cf44){_0x21011e=squel[_0x59ee('0x5d')]()[_0x59ee('0x5e')]('cm_hopper')[_0x59ee('0x5f')]([_0x59ee('0x67'),'scheduledAt',_0x59ee('0x61'),_0x59ee('0x6a'),_0x59ee('0x77'),_0x59ee('0x62'),_0x59ee('0x63')],squel[_0x59ee('0x64')]()[_0x59ee('0x65')](_0x59ee('0x66'),_0x59ee('0x67'))['field'](_0x59ee('0x68'),_0x59ee('0x60'))[_0x59ee('0x65')]('ANY_VALUE(ContactId)',_0x59ee('0x61'))['field'](_0x59ee('0x78'),_0x59ee('0x6a'))[_0x59ee('0x65')](_0x59ee('0x79'),'CampaignId')[_0x59ee('0x65')]('NOW()','createdAt')[_0x59ee('0x65')](_0x59ee('0x68'),_0x59ee('0x63'))[_0x59ee('0x6c')](_0x59ee('0x6d'))[_0x59ee('0x34')](_0x59ee('0x7a'),_0xbac0a7['params']['id'][_0x59ee('0x6f')]())[_0x59ee('0x34')](_0x59ee('0x70'),_0xbac0a7[_0x59ee('0x45')][_0x59ee('0x71')][_0x59ee('0x6f')]())[_0x59ee('0x34')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x59ee('0x34')](_0x59ee('0x73'),squel[_0x59ee('0x64')]()[_0x59ee('0x65')](_0x59ee('0x67'))[_0x59ee('0x6c')]('cm_hopper')[_0x59ee('0x34')](_0x59ee('0x7a'),_0xbac0a7['params']['id'][_0x59ee('0x6f')]()))[_0x59ee('0x34')](_0x59ee('0x73'),squel['select']()[_0x59ee('0x65')](_0x59ee('0x7b'))['from']('cm_hopper_final')[_0x59ee('0x34')](_0x59ee('0x7a'),_0xbac0a7[_0x59ee('0x47')]['id']['toString']())[_0x59ee('0x34')](_0x59ee('0x75')))[_0x59ee('0x7c')]('ContactId'))[_0x59ee('0x6f')]();return db[_0x59ee('0x49')]['query'](_0x21011e);}return[];})[_0x59ee('0x3b')](respondWithResult(_0x37a2cd,null))[_0x59ee('0x40')](handleError(_0x37a2cd,null));};exports['checkContactHopper']=function(_0x518d59,_0x178b12,_0x39ea03){return db[_0x59ee('0x7d')][_0x59ee('0x7e')]({'where':{'VoiceQueueId':_0x518d59['body'][_0x59ee('0x7f')],'CampaignId':_0x518d59[_0x59ee('0x45')][_0x59ee('0x77')],'ContactId':_0x518d59['body']['ContactId']}})[_0x59ee('0x3b')](handleEntityNotFound(_0x178b12,null))[_0x59ee('0x3b')](function(_0x4f2573){if(_0x4f2573){return _0x4f2573;}return null;})[_0x59ee('0x3b')](respondWithResult(_0x178b12,null))['catch'](handleError(_0x178b12,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 9637afe..5cea386 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 _0x5cbb=['./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0x5cbb,0xc7));var _0xb5cb=function(_0x200c4a,_0x570d03){_0x200c4a=_0x200c4a-0x0;var _0x5d235a=_0x5cbb[_0x200c4a];return _0x5d235a;};'use strict';var _=require(_0xb5cb('0x0'));var util=require(_0xb5cb('0x1'));var logger=require(_0xb5cb('0x2'))(_0xb5cb('0x3'));var moment=require(_0xb5cb('0x4'));var BPromise=require(_0xb5cb('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb5cb('0x6'));var rimraf=require(_0xb5cb('0x7'));var config=require(_0xb5cb('0x8'));var attributes=require(_0xb5cb('0x9'));module[_0xb5cb('0xa')]=function(_0x52e336,_0x17a60c){return _0x52e336[_0xb5cb('0xb')](_0xb5cb('0xc'),attributes,{'tableName':_0xb5cb('0xd'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0xb5cb('0xe')]},{'name':_0xb5cb('0xf'),'fields':[_0xb5cb('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5612=['calleridnum','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final'];(function(_0x499d15,_0x5376c1){var _0x189291=function(_0x52884f){while(--_0x52884f){_0x499d15['push'](_0x499d15['shift']());}};_0x189291(++_0x5376c1);}(_0x5612,0x134));var _0x2561=function(_0x302d1a,_0x387081){_0x302d1a=_0x302d1a-0x0;var _0xd82ca=_0x5612[_0x302d1a];return _0xd82ca;};'use strict';var _=require(_0x2561('0x0'));var util=require(_0x2561('0x1'));var logger=require(_0x2561('0x2'))(_0x2561('0x3'));var moment=require(_0x2561('0x4'));var BPromise=require(_0x2561('0x5'));var rp=require(_0x2561('0x6'));var fs=require('fs');var path=require(_0x2561('0x7'));var rimraf=require(_0x2561('0x8'));var config=require(_0x2561('0x9'));var attributes=require(_0x2561('0xa'));module[_0x2561('0xb')]=function(_0x408148,_0x2bd4ba){return _0x408148[_0x2561('0xc')](_0x2561('0xd'),attributes,{'tableName':_0x2561('0xe'),'paranoid':![],'indexes':[{'name':_0x2561('0xf'),'fields':[_0x2561('0xf')]},{'name':_0x2561('0x10'),'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 68c58fe..a49763b 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 _0xa512=['catch','CreateCmHopperFinal','CmHopperFinal','create','body','options','raw','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','debug','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','CmHopperFinal,\x20%s,\x20%s','message','info','result'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0xa512,0x18f));var _0x2a51=function(_0x488818,_0x17c6de){_0x488818=_0x488818-0x0;var _0x30783c=_0xa512[_0x488818];return _0x30783c;};'use strict';var _=require('lodash');var util=require(_0x2a51('0x0'));var moment=require(_0x2a51('0x1'));var BPromise=require(_0x2a51('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2a51('0x3'));var db=require(_0x2a51('0x4'))['db'];var utils=require(_0x2a51('0x5'));var logger=require('../../config/logger')(_0x2a51('0x6'));var config=require(_0x2a51('0x7'));var jayson=require(_0x2a51('0x8'));var client=jayson[_0x2a51('0x9')][_0x2a51('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32113a,_0x884e8e,_0x18c08f){return new BPromise(function(_0x2eb3dc,_0x1c104b){return client['request'](_0x32113a,_0x18c08f)[_0x2a51('0xb')](function(_0x4c4be5){logger['info']('CmHopperFinal,\x20%s,\x20%s',_0x884e8e,'request\x20sent');logger[_0x2a51('0xc')](_0x2a51('0xd'),_0x884e8e,_0x2a51('0xe'),JSON[_0x2a51('0xf')](_0x4c4be5));if(_0x4c4be5[_0x2a51('0x10')]){if(_0x4c4be5[_0x2a51('0x10')]['code']===0x1f4){logger[_0x2a51('0x10')](_0x2a51('0x11'),_0x884e8e,_0x4c4be5[_0x2a51('0x10')]['message']);return _0x1c104b(_0x4c4be5[_0x2a51('0x10')][_0x2a51('0x12')]);}logger[_0x2a51('0x10')](_0x2a51('0x11'),_0x884e8e,_0x4c4be5[_0x2a51('0x10')][_0x2a51('0x12')]);return _0x2eb3dc(_0x4c4be5['error']['message']);}else{logger[_0x2a51('0x13')]('CmHopperFinal,\x20%s,\x20%s',_0x884e8e,_0x2a51('0xe'));_0x2eb3dc(_0x4c4be5[_0x2a51('0x14')][_0x2a51('0x12')]);}})[_0x2a51('0x15')](function(_0x4ca614){logger[_0x2a51('0x10')](_0x2a51('0x11'),_0x884e8e,_0x4ca614);_0x1c104b(_0x4ca614);});});}exports[_0x2a51('0x16')]=function(_0x26ccea){var _0x549202=this;return new Promise(function(_0x4af3e9,_0x1b115b){return db[_0x2a51('0x17')][_0x2a51('0x18')](_0x26ccea[_0x2a51('0x19')],{'raw':_0x26ccea[_0x2a51('0x1a')]?_0x26ccea[_0x2a51('0x1a')][_0x2a51('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x493d2c){logger[_0x2a51('0x13')](_0x2a51('0x16'),_0x26ccea);logger[_0x2a51('0xc')](_0x2a51('0x16'),_0x26ccea,JSON[_0x2a51('0xf')](_0x493d2c));_0x4af3e9(_0x493d2c);})[_0x2a51('0x15')](function(_0x460c7d){logger[_0x2a51('0x10')](_0x2a51('0x16'),_0x460c7d[_0x2a51('0x12')],_0x26ccea);_0x1b115b(_0x549202['error'](0x1f4,_0x460c7d[_0x2a51('0x12')]));});});}; \ No newline at end of file +var _0x0d4e=['code','message','result','CreateCmHopperFinal','CmHopperFinal','create','body','options','raw','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','request\x20sent','debug','CmHopperFinal,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x541dde,_0x1416c8){var _0x39ae07=function(_0x4322a9){while(--_0x4322a9){_0x541dde['push'](_0x541dde['shift']());}};_0x39ae07(++_0x1416c8);}(_0x0d4e,0x1ca));var _0xe0d4=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x0d4e[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0xe0d4('0x0'));var util=require(_0xe0d4('0x1'));var moment=require(_0xe0d4('0x2'));var BPromise=require(_0xe0d4('0x3'));var rs=require(_0xe0d4('0x4'));var fs=require('fs');var Redis=require(_0xe0d4('0x5'));var db=require(_0xe0d4('0x6'))['db'];var utils=require(_0xe0d4('0x7'));var logger=require(_0xe0d4('0x8'))('rpc');var config=require(_0xe0d4('0x9'));var jayson=require(_0xe0d4('0xa'));var client=jayson[_0xe0d4('0xb')][_0xe0d4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x54a11f,_0x4a2a87,_0x312e09){return new BPromise(function(_0x1ba14d,_0x151e51){return client[_0xe0d4('0xd')](_0x54a11f,_0x312e09)[_0xe0d4('0xe')](function(_0x11aa34){logger[_0xe0d4('0xf')](_0xe0d4('0x10'),_0x4a2a87,_0xe0d4('0x11'));logger[_0xe0d4('0x12')](_0xe0d4('0x13'),_0x4a2a87,_0xe0d4('0x11'),JSON[_0xe0d4('0x14')](_0x11aa34));if(_0x11aa34['error']){if(_0x11aa34[_0xe0d4('0x15')][_0xe0d4('0x16')]===0x1f4){logger[_0xe0d4('0x15')](_0xe0d4('0x10'),_0x4a2a87,_0x11aa34[_0xe0d4('0x15')][_0xe0d4('0x17')]);return _0x151e51(_0x11aa34[_0xe0d4('0x15')][_0xe0d4('0x17')]);}logger[_0xe0d4('0x15')](_0xe0d4('0x10'),_0x4a2a87,_0x11aa34[_0xe0d4('0x15')][_0xe0d4('0x17')]);return _0x1ba14d(_0x11aa34[_0xe0d4('0x15')][_0xe0d4('0x17')]);}else{logger[_0xe0d4('0xf')]('CmHopperFinal,\x20%s,\x20%s',_0x4a2a87,_0xe0d4('0x11'));_0x1ba14d(_0x11aa34[_0xe0d4('0x18')][_0xe0d4('0x17')]);}})['catch'](function(_0x4d0f7c){logger[_0xe0d4('0x15')](_0xe0d4('0x10'),_0x4a2a87,_0x4d0f7c);_0x151e51(_0x4d0f7c);});});}exports[_0xe0d4('0x19')]=function(_0x174bfa){var _0x55e3c2=this;return new Promise(function(_0x58bd0a,_0x2a4463){return db[_0xe0d4('0x1a')][_0xe0d4('0x1b')](_0x174bfa[_0xe0d4('0x1c')],{'raw':_0x174bfa[_0xe0d4('0x1d')]?_0x174bfa['options'][_0xe0d4('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x533a85){logger[_0xe0d4('0xf')](_0xe0d4('0x19'),_0x174bfa);logger[_0xe0d4('0x12')]('CreateCmHopperFinal',_0x174bfa,JSON[_0xe0d4('0x14')](_0x533a85));_0x58bd0a(_0x533a85);})[_0xe0d4('0x1f')](function(_0x7e5713){logger[_0xe0d4('0x15')](_0xe0d4('0x19'),_0x7e5713[_0xe0d4('0x17')],_0x174bfa);_0x2a4463(_0x55e3c2[_0xe0d4('0x15')](0x1f4,_0x7e5713[_0xe0d4('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 01cac68..e65c7c8 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 _0x95f2=['countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','update','exports','util','express','Router','../../components/auth/service','get','isAuthenticated','describe','/:id','/voice/queue/countAttributes/:id'];(function(_0x3d7fa1,_0x340c0e){var _0x4f5e46=function(_0x587608){while(--_0x587608){_0x3d7fa1['push'](_0x3d7fa1['shift']());}};_0x4f5e46(++_0x340c0e);}(_0x95f2,0x105));var _0x295f=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x95f2[_0x2c7618];return _0x5ce3f0;};'use strict';var multer=require('multer');var util=require(_0x295f('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x295f('0x1'));var router=express[_0x295f('0x2')]();var auth=require(_0x295f('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmHopperFinal.controller');router[_0x295f('0x4')]('/',auth[_0x295f('0x5')](),controller['index']);router[_0x295f('0x4')]('/describe',auth['isAuthenticated'](),controller[_0x295f('0x6')]);router['get'](_0x295f('0x7'),auth[_0x295f('0x5')](),controller['show']);router[_0x295f('0x4')](_0x295f('0x8'),auth['isAuthenticated'](),controller['countContactsQueueCampaignHopperFinal']);router['get']('/campaign/countAttributes/:id',auth[_0x295f('0x5')](),controller[_0x295f('0x9')]);router[_0x295f('0xa')](_0x295f('0xb'),auth[_0x295f('0x5')](),controller[_0x295f('0xc')]);router[_0x295f('0xa')]('/voice/campaign/moveContacts/:id',auth[_0x295f('0x5')](),controller[_0x295f('0xd')]);router['post'](_0x295f('0xe'),auth['isAuthenticated'](),controller[_0x295f('0xf')]);router['put'](_0x295f('0x7'),auth[_0x295f('0x5')](),controller[_0x295f('0x10')]);module[_0x295f('0x11')]=router; \ No newline at end of file +var _0xfa64=['describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','put','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated'];(function(_0x491866,_0x50af03){var _0x4bf694=function(_0x574355){while(--_0x574355){_0x491866['push'](_0x491866['shift']());}};_0x4bf694(++_0x50af03);}(_0xfa64,0x12d));var _0x4fa6=function(_0x91cfbb,_0x12875f){_0x91cfbb=_0x91cfbb-0x0;var _0x54e612=_0xfa64[_0x91cfbb];return _0x54e612;};'use strict';var multer=require(_0x4fa6('0x0'));var util=require(_0x4fa6('0x1'));var path=require(_0x4fa6('0x2'));var timeout=require(_0x4fa6('0x3'));var express=require(_0x4fa6('0x4'));var router=express['Router']();var auth=require(_0x4fa6('0x5'));var interaction=require(_0x4fa6('0x6'));var config=require(_0x4fa6('0x7'));var controller=require('./cmHopperFinal.controller');router[_0x4fa6('0x8')]('/',auth['isAuthenticated'](),controller[_0x4fa6('0x9')]);router[_0x4fa6('0x8')]('/describe',auth[_0x4fa6('0xa')](),controller[_0x4fa6('0xb')]);router['get'](_0x4fa6('0xc'),auth[_0x4fa6('0xa')](),controller[_0x4fa6('0xd')]);router[_0x4fa6('0x8')](_0x4fa6('0xe'),auth[_0x4fa6('0xa')](),controller[_0x4fa6('0xf')]);router[_0x4fa6('0x8')](_0x4fa6('0x10'),auth[_0x4fa6('0xa')](),controller['countContactsIvrCampaignHopperFinal']);router[_0x4fa6('0x11')](_0x4fa6('0x12'),auth['isAuthenticated'](),controller[_0x4fa6('0x13')]);router[_0x4fa6('0x11')](_0x4fa6('0x14'),auth[_0x4fa6('0xa')](),controller[_0x4fa6('0x15')]);router[_0x4fa6('0x11')](_0x4fa6('0x16'),auth[_0x4fa6('0xa')](),controller['checkContactHopper']);router[_0x4fa6('0x17')](_0x4fa6('0xc'),auth[_0x4fa6('0xa')](),controller['update']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 6af56e3..d8ba494 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 _0xd934=['STRING','DATE','BOOLEAN','sequelize','exports','INTEGER'];(function(_0x24b0c1,_0x45742c){var _0x5b52f9=function(_0x4be6a8){while(--_0x4be6a8){_0x24b0c1['push'](_0x24b0c1['shift']());}};_0x5b52f9(++_0x45742c);}(_0xd934,0xab));var _0x4d93=function(_0x36bc72,_0x385d4d){_0x36bc72=_0x36bc72-0x0;var _0x57d02b=_0xd934[_0x36bc72];return _0x57d02b;};'use strict';var Sequelize=require(_0x4d93('0x0'));module[_0x4d93('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x4d93('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x4d93('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x4d93('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x4d93('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x4d93('0x3')]},'originatecalleridname':{'type':Sequelize[_0x4d93('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x4d93('0x3')]},'starttime':{'type':Sequelize[_0x4d93('0x4')]},'responsetime':{'type':Sequelize[_0x4d93('0x4')]},'answertime':{'type':Sequelize[_0x4d93('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x4d93('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x4d93('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x4d93('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x4d93('0x3')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x4d93('0x3')]},'amd':{'type':Sequelize[_0x4d93('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x4d93('0x5')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x4d93('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x4d93('0x4')]},'recallme':{'type':Sequelize[_0x4d93('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x4d93('0x4')]},'edited':{'type':Sequelize[_0x4d93('0x5')],'defaultValue':![]}}; \ No newline at end of file +var _0x26c0=['sequelize','exports','INTEGER','STRING','DATE','BOOLEAN'];(function(_0x256d6a,_0x2f002f){var _0x460058=function(_0x195be7){while(--_0x195be7){_0x256d6a['push'](_0x256d6a['shift']());}};_0x460058(++_0x2f002f);}(_0x26c0,0x168));var _0x026c=function(_0x3d8c9e,_0x386755){_0x3d8c9e=_0x3d8c9e-0x0;var _0x145a4e=_0x26c0[_0x3d8c9e];return _0x145a4e;};'use strict';var Sequelize=require(_0x026c('0x0'));module[_0x026c('0x1')]={'state':{'type':Sequelize[_0x026c('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x026c('0x3')]},'scheduledat':{'type':Sequelize[_0x026c('0x4')]},'countbusyretry':{'type':Sequelize[_0x026c('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x026c('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x026c('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x026c('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x026c('0x3')]},'originatecalleridname':{'type':Sequelize[_0x026c('0x3')]},'calleridnum':{'type':Sequelize[_0x026c('0x3')]},'calleridname':{'type':Sequelize[_0x026c('0x3')]},'starttime':{'type':Sequelize[_0x026c('0x4')]},'responsetime':{'type':Sequelize[_0x026c('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x026c('0x4')]},'endtime':{'type':Sequelize[_0x026c('0x4')]},'ringtime':{'type':Sequelize[_0x026c('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x026c('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x026c('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x026c('0x3')]},'campaign':{'type':Sequelize[_0x026c('0x3')]},'campaigntype':{'type':Sequelize[_0x026c('0x3')]},'membername':{'type':Sequelize[_0x026c('0x3')]},'reason':{'type':Sequelize[_0x026c('0x3')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x026c('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x026c('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x026c('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x026c('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0x026c('0x4')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index c6a6065..4d0e919 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 _0x5f11=['CmHopperHistory','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','create','body','describe','uniqueid','find','html-pdf','eml-format','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','index','map'];(function(_0x29551f,_0x7326d6){var _0x2f2a22=function(_0x17202e){while(--_0x17202e){_0x29551f['push'](_0x29551f['shift']());}};_0x2f2a22(++_0x7326d6);}(_0x5f11,0x1dd));var _0x15f1=function(_0x21479e,_0x472542){_0x21479e=_0x21479e-0x0;var _0x25ec41=_0x5f11[_0x21479e];return _0x25ec41;};'use strict';var pdf=require(_0x15f1('0x0'));var emlformat=require(_0x15f1('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x15f1('0x2'));var moment=require(_0x15f1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x15f1('0x4'));var util=require(_0x15f1('0x5'));var path=require(_0x15f1('0x6'));var sox=require(_0x15f1('0x7'));var csv=require(_0x15f1('0x8'));var ejs=require(_0x15f1('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x15f1('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x15f1('0xb'));var toCsv=require(_0x15f1('0x8'));var querystring=require(_0x15f1('0xc'));var Papa=require(_0x15f1('0xd'));var Redis=require('ioredis');var authService=require(_0x15f1('0xe'));var qs=require(_0x15f1('0xf'));var as=require(_0x15f1('0x10'));var hardwareService=require(_0x15f1('0x11'));var logger=require(_0x15f1('0x12'))(_0x15f1('0x13'));var utils=require(_0x15f1('0x14'));var config=require('../../config/environment');var db=require(_0x15f1('0x15'))['db'];function respondWithStatusCode(_0x3a5287,_0x29489d){_0x29489d=_0x29489d||0xcc;return function(_0xaabe49){if(_0xaabe49){return _0x3a5287[_0x15f1('0x16')](_0x29489d);}return _0x3a5287[_0x15f1('0x17')](_0x29489d)[_0x15f1('0x18')]();};}function respondWithResult(_0x543019,_0x4a42f8){_0x4a42f8=_0x4a42f8||0xc8;return function(_0xf75d10){if(_0xf75d10){return _0x543019[_0x15f1('0x17')](_0x4a42f8)[_0x15f1('0x19')](_0xf75d10);}};}function respondWithFilteredResult(_0x36f88e,_0x507ca3){return function(_0xc2c216){if(_0xc2c216){var _0x13edeb=_0xc2c216[_0x15f1('0x1a')],_0x5583f9=_0x507ca3[_0x15f1('0x1b')],_0x59a23f=_0x507ca3[_0x15f1('0x1b')]+_0x507ca3[_0x15f1('0x1c')],_0x47e84b;if(_0x59a23f>=_0x13edeb){_0x59a23f=_0x13edeb;_0x47e84b=0xc8;}else{_0x47e84b=0xce;}_0x36f88e[_0x15f1('0x17')](_0x47e84b);return _0x36f88e[_0x15f1('0x1d')](_0x15f1('0x1e'),_0x5583f9+'-'+_0x59a23f+'/'+_0x13edeb)['json'](_0xc2c216);}return null;};}function patchUpdates(_0x457c6d){return function(_0x5c853d){try{jsonpatch['apply'](_0x5c853d,_0x457c6d,!![]);}catch(_0x3553bf){return BPromise[_0x15f1('0x1f')](_0x3553bf);}return _0x5c853d[_0x15f1('0x20')]();};}function saveUpdates(_0x56022c,_0x4a48e4){return function(_0x44c373){if(_0x44c373){return _0x44c373[_0x15f1('0x21')](_0x56022c)[_0x15f1('0x22')](function(_0x455ade){return _0x455ade;});}return null;};}function removeEntity(_0x245b00,_0x572d36){return function(_0x3c45b2){if(_0x3c45b2){return _0x3c45b2[_0x15f1('0x23')]()[_0x15f1('0x22')](function(){_0x245b00[_0x15f1('0x17')](0xcc)[_0x15f1('0x18')]();});}};}function handleEntityNotFound(_0x504d82,_0x384553){return function(_0x50bf12){if(!_0x50bf12){_0x504d82[_0x15f1('0x16')](0x194);}return _0x50bf12;};}function handleError(_0x57b798,_0x589f2d){_0x589f2d=_0x589f2d||0x1f4;return function(_0x21ebd6){logger[_0x15f1('0x24')](_0x21ebd6[_0x15f1('0x25')]);if(_0x21ebd6[_0x15f1('0x26')]){delete _0x21ebd6[_0x15f1('0x26')];}_0x57b798[_0x15f1('0x17')](_0x589f2d)['send'](_0x21ebd6);};}exports[_0x15f1('0x27')]=function(_0x203953,_0x46da80){var _0x19995c={},_0x38e63d={},_0x76d57d={'count':0x0,'rows':[]};var _0x3f4d25=_[_0x15f1('0x28')](db[_0x15f1('0x29')][_0x15f1('0x2a')],function(_0x337e9a){return{'name':_0x337e9a[_0x15f1('0x2b')],'type':_0x337e9a[_0x15f1('0x2c')][_0x15f1('0x2d')]};});_0x38e63d[_0x15f1('0x2e')]=_[_0x15f1('0x28')](_0x3f4d25,'name');_0x38e63d[_0x15f1('0x2f')]=_[_0x15f1('0x30')](_0x203953[_0x15f1('0x2f')]);_0x38e63d[_0x15f1('0x31')]=_[_0x15f1('0x32')](_0x38e63d['model'],_0x38e63d[_0x15f1('0x2f')]);_0x19995c[_0x15f1('0x33')]=_[_0x15f1('0x32')](_0x38e63d[_0x15f1('0x2e')],qs[_0x15f1('0x34')](_0x203953[_0x15f1('0x2f')][_0x15f1('0x34')]));_0x19995c[_0x15f1('0x33')]=_0x19995c[_0x15f1('0x33')][_0x15f1('0x35')]?_0x19995c[_0x15f1('0x33')]:_0x38e63d['model'];if(!_0x203953['query'][_0x15f1('0x36')](_0x15f1('0x37'))){_0x19995c[_0x15f1('0x1c')]=qs[_0x15f1('0x1c')](_0x203953[_0x15f1('0x2f')][_0x15f1('0x1c')]);_0x19995c[_0x15f1('0x1b')]=qs[_0x15f1('0x1b')](_0x203953[_0x15f1('0x2f')][_0x15f1('0x1b')]);}_0x19995c['order']=qs['sort'](_0x203953[_0x15f1('0x2f')][_0x15f1('0x38')]);_0x19995c[_0x15f1('0x39')]=qs['filters'](_[_0x15f1('0x3a')](_0x203953[_0x15f1('0x2f')],_0x38e63d['filters']));if(_0x203953[_0x15f1('0x2f')][_0x15f1('0x3b')]){_0x19995c[_0x15f1('0x39')]=_['merge'](_0x19995c['where'],{'$or':_[_0x15f1('0x28')](_0x3f4d25,function(_0xda1ad1){if(_0xda1ad1[_0x15f1('0x2c')]!==_0x15f1('0x3c')){var _0x1dfbf2={};_0x1dfbf2[_0xda1ad1['name']]={'$like':'%'+_0x203953[_0x15f1('0x2f')]['filter']+'%'};return _0x1dfbf2;}})});}_0x19995c=_[_0x15f1('0x3d')]({},_0x19995c,_0x203953[_0x15f1('0x3e')]);var _0x35bc71={'where':_0x19995c['where']};return db[_0x15f1('0x29')][_0x15f1('0x1a')](_0x35bc71)[_0x15f1('0x22')](function(_0x35eac9){_0x76d57d[_0x15f1('0x1a')]=_0x35eac9;if(_0x203953['query'][_0x15f1('0x3f')]){_0x19995c[_0x15f1('0x40')]=[{'all':!![]}];}return db[_0x15f1('0x29')][_0x15f1('0x41')](_0x19995c);})[_0x15f1('0x22')](function(_0x107871){_0x76d57d['rows']=_0x107871;return _0x76d57d;})[_0x15f1('0x22')](respondWithFilteredResult(_0x46da80,_0x19995c))[_0x15f1('0x42')](handleError(_0x46da80,null));};exports[_0x15f1('0x43')]=function(_0x275fbc,_0x3066d4){var _0x52ee27={'raw':!![],'where':{'id':_0x275fbc[_0x15f1('0x44')]['id']}},_0xe295cb={};_0xe295cb['model']=_[_0x15f1('0x30')](db[_0x15f1('0x29')][_0x15f1('0x2a')]);_0xe295cb['query']=_[_0x15f1('0x30')](_0x275fbc['query']);_0xe295cb[_0x15f1('0x31')]=_['intersection'](_0xe295cb[_0x15f1('0x2e')],_0xe295cb['query']);_0x52ee27[_0x15f1('0x33')]=_[_0x15f1('0x32')](_0xe295cb[_0x15f1('0x2e')],qs[_0x15f1('0x34')](_0x275fbc['query'][_0x15f1('0x34')]));_0x52ee27[_0x15f1('0x33')]=_0x52ee27[_0x15f1('0x33')][_0x15f1('0x35')]?_0x52ee27['attributes']:_0xe295cb[_0x15f1('0x2e')];if(_0x275fbc['query'][_0x15f1('0x3f')]){_0x52ee27[_0x15f1('0x40')]=[{'all':!![]}];}_0x52ee27=_[_0x15f1('0x3d')]({},_0x52ee27,_0x275fbc[_0x15f1('0x3e')]);return db[_0x15f1('0x29')]['find'](_0x52ee27)[_0x15f1('0x22')](handleEntityNotFound(_0x3066d4,null))['then'](respondWithResult(_0x3066d4,null))[_0x15f1('0x42')](handleError(_0x3066d4,null));};exports[_0x15f1('0x45')]=function(_0x58f26e,_0x1287b3){return db[_0x15f1('0x29')][_0x15f1('0x45')](_0x58f26e[_0x15f1('0x46')],{})[_0x15f1('0x22')](respondWithResult(_0x1287b3,0xc9))['catch'](handleError(_0x1287b3,null));};exports[_0x15f1('0x47')]=function(_0x310e62,_0x1030de){return db[_0x15f1('0x29')]['describe']()['then'](respondWithResult(_0x1030de,null))[_0x15f1('0x42')](handleError(_0x1030de,null));};exports[_0x15f1('0x21')]=function(_0x206b13,_0xb46433){if(_0x206b13[_0x15f1('0x46')][_0x15f1('0x48')]){delete _0x206b13[_0x15f1('0x46')][_0x15f1('0x48')];}return db[_0x15f1('0x29')][_0x15f1('0x49')]({'where':{'uniqueid':_0x206b13[_0x15f1('0x44')]['id']}})[_0x15f1('0x22')](handleEntityNotFound(_0xb46433,null))[_0x15f1('0x22')](saveUpdates(_0x206b13[_0x15f1('0x46')],null))['then'](respondWithResult(_0xb46433,null))[_0x15f1('0x42')](handleError(_0xb46433,null));}; \ No newline at end of file +var _0xfc03=['update','then','destroy','stack','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','include','findAll','params','length','includeAll','find','create','body','catch','describe','uniqueid','html-pdf','eml-format','rimraf','zip-dir','bluebird','util','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save'];(function(_0x4c54a8,_0x1e6218){var _0x4e9d4d=function(_0x4529fc){while(--_0x4529fc){_0x4c54a8['push'](_0x4c54a8['shift']());}};_0x4e9d4d(++_0x1e6218);}(_0xfc03,0xb3));var _0x3fc0=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0xfc03[_0x599f41];return _0x2e4d58;};'use strict';var pdf=require(_0x3fc0('0x0'));var emlformat=require(_0x3fc0('0x1'));var rimraf=require(_0x3fc0('0x2'));var zipdir=require(_0x3fc0('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3fc0('0x4'));var Mustache=require('mustache');var util=require(_0x3fc0('0x5'));var path=require('path');var sox=require(_0x3fc0('0x6'));var csv=require(_0x3fc0('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3fc0('0x8'));var squel=require(_0x3fc0('0x9'));var crypto=require('crypto');var jsforce=require(_0x3fc0('0xa'));var deskjs=require(_0x3fc0('0xb'));var toCsv=require(_0x3fc0('0x7'));var querystring=require(_0x3fc0('0xc'));var Papa=require(_0x3fc0('0xd'));var Redis=require(_0x3fc0('0xe'));var authService=require(_0x3fc0('0xf'));var qs=require(_0x3fc0('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3fc0('0x11'))(_0x3fc0('0x12'));var utils=require(_0x3fc0('0x13'));var config=require('../../config/environment');var db=require(_0x3fc0('0x14'))['db'];function respondWithStatusCode(_0x380cb1,_0x4d6a28){_0x4d6a28=_0x4d6a28||0xcc;return function(_0x291373){if(_0x291373){return _0x380cb1[_0x3fc0('0x15')](_0x4d6a28);}return _0x380cb1[_0x3fc0('0x16')](_0x4d6a28)[_0x3fc0('0x17')]();};}function respondWithResult(_0x569305,_0x2c0ae9){_0x2c0ae9=_0x2c0ae9||0xc8;return function(_0x1d7afb){if(_0x1d7afb){return _0x569305['status'](_0x2c0ae9)[_0x3fc0('0x18')](_0x1d7afb);}};}function respondWithFilteredResult(_0x266daf,_0x68c7f7){return function(_0x261f28){if(_0x261f28){var _0x3e6e86=_0x261f28[_0x3fc0('0x19')],_0x479310=_0x68c7f7[_0x3fc0('0x1a')],_0x468bd6=_0x68c7f7[_0x3fc0('0x1a')]+_0x68c7f7[_0x3fc0('0x1b')],_0x4df900;if(_0x468bd6>=_0x3e6e86){_0x468bd6=_0x3e6e86;_0x4df900=0xc8;}else{_0x4df900=0xce;}_0x266daf[_0x3fc0('0x16')](_0x4df900);return _0x266daf['set'](_0x3fc0('0x1c'),_0x479310+'-'+_0x468bd6+'/'+_0x3e6e86)[_0x3fc0('0x18')](_0x261f28);}return null;};}function patchUpdates(_0xe1869d){return function(_0x5b5e99){try{jsonpatch[_0x3fc0('0x1d')](_0x5b5e99,_0xe1869d,!![]);}catch(_0xdd501c){return BPromise['reject'](_0xdd501c);}return _0x5b5e99[_0x3fc0('0x1e')]();};}function saveUpdates(_0x187329,_0x2162c9){return function(_0x521d5d){if(_0x521d5d){return _0x521d5d[_0x3fc0('0x1f')](_0x187329)[_0x3fc0('0x20')](function(_0x1cfad4){return _0x1cfad4;});}return null;};}function removeEntity(_0x2d2da0,_0x5861bc){return function(_0x113504){if(_0x113504){return _0x113504[_0x3fc0('0x21')]()['then'](function(){_0x2d2da0[_0x3fc0('0x16')](0xcc)[_0x3fc0('0x17')]();});}};}function handleEntityNotFound(_0x5b3dc6,_0x7a3e1c){return function(_0x455fba){if(!_0x455fba){_0x5b3dc6[_0x3fc0('0x15')](0x194);}return _0x455fba;};}function handleError(_0x636c4c,_0x58ea74){_0x58ea74=_0x58ea74||0x1f4;return function(_0x19d453){logger['error'](_0x19d453[_0x3fc0('0x22')]);if(_0x19d453[_0x3fc0('0x23')]){delete _0x19d453[_0x3fc0('0x23')];}_0x636c4c[_0x3fc0('0x16')](_0x58ea74)[_0x3fc0('0x24')](_0x19d453);};}exports[_0x3fc0('0x25')]=function(_0x180aeb,_0x3ce28e){var _0x5b81a7={},_0xdefa6d={},_0x3e50ec={'count':0x0,'rows':[]};var _0x3f8fb0=_[_0x3fc0('0x26')](db[_0x3fc0('0x27')][_0x3fc0('0x28')],function(_0x2edc87){return{'name':_0x2edc87[_0x3fc0('0x29')],'type':_0x2edc87[_0x3fc0('0x2a')]['key']};});_0xdefa6d[_0x3fc0('0x2b')]=_[_0x3fc0('0x26')](_0x3f8fb0,_0x3fc0('0x23'));_0xdefa6d[_0x3fc0('0x2c')]=_[_0x3fc0('0x2d')](_0x180aeb[_0x3fc0('0x2c')]);_0xdefa6d['filters']=_[_0x3fc0('0x2e')](_0xdefa6d[_0x3fc0('0x2b')],_0xdefa6d[_0x3fc0('0x2c')]);_0x5b81a7[_0x3fc0('0x2f')]=_['intersection'](_0xdefa6d['model'],qs[_0x3fc0('0x30')](_0x180aeb[_0x3fc0('0x2c')][_0x3fc0('0x30')]));_0x5b81a7[_0x3fc0('0x2f')]=_0x5b81a7[_0x3fc0('0x2f')]['length']?_0x5b81a7[_0x3fc0('0x2f')]:_0xdefa6d[_0x3fc0('0x2b')];if(!_0x180aeb['query'][_0x3fc0('0x31')](_0x3fc0('0x32'))){_0x5b81a7[_0x3fc0('0x1b')]=qs['limit'](_0x180aeb[_0x3fc0('0x2c')][_0x3fc0('0x1b')]);_0x5b81a7['offset']=qs['offset'](_0x180aeb[_0x3fc0('0x2c')][_0x3fc0('0x1a')]);}_0x5b81a7[_0x3fc0('0x33')]=qs['sort'](_0x180aeb[_0x3fc0('0x2c')][_0x3fc0('0x34')]);_0x5b81a7['where']=qs['filters'](_['pick'](_0x180aeb[_0x3fc0('0x2c')],_0xdefa6d[_0x3fc0('0x35')]));if(_0x180aeb[_0x3fc0('0x2c')][_0x3fc0('0x36')]){_0x5b81a7['where']=_[_0x3fc0('0x37')](_0x5b81a7[_0x3fc0('0x38')],{'$or':_['map'](_0x3f8fb0,function(_0x1b7977){if(_0x1b7977[_0x3fc0('0x2a')]!==_0x3fc0('0x39')){var _0x16fb4c={};_0x16fb4c[_0x1b7977[_0x3fc0('0x23')]]={'$like':'%'+_0x180aeb[_0x3fc0('0x2c')]['filter']+'%'};return _0x16fb4c;}})});}_0x5b81a7=_[_0x3fc0('0x37')]({},_0x5b81a7,_0x180aeb[_0x3fc0('0x3a')]);var _0xe8ffc0={'where':_0x5b81a7['where']};return db[_0x3fc0('0x27')][_0x3fc0('0x19')](_0xe8ffc0)[_0x3fc0('0x20')](function(_0x476744){_0x3e50ec[_0x3fc0('0x19')]=_0x476744;if(_0x180aeb[_0x3fc0('0x2c')]['includeAll']){_0x5b81a7[_0x3fc0('0x3b')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x3fc0('0x3c')](_0x5b81a7);})['then'](function(_0x2bc597){_0x3e50ec['rows']=_0x2bc597;return _0x3e50ec;})['then'](respondWithFilteredResult(_0x3ce28e,_0x5b81a7))['catch'](handleError(_0x3ce28e,null));};exports['show']=function(_0x2007a9,_0x5dc950){var _0x2671b4={'raw':!![],'where':{'id':_0x2007a9[_0x3fc0('0x3d')]['id']}},_0x540303={};_0x540303[_0x3fc0('0x2b')]=_[_0x3fc0('0x2d')](db[_0x3fc0('0x27')]['rawAttributes']);_0x540303[_0x3fc0('0x2c')]=_[_0x3fc0('0x2d')](_0x2007a9[_0x3fc0('0x2c')]);_0x540303['filters']=_[_0x3fc0('0x2e')](_0x540303[_0x3fc0('0x2b')],_0x540303[_0x3fc0('0x2c')]);_0x2671b4[_0x3fc0('0x2f')]=_[_0x3fc0('0x2e')](_0x540303[_0x3fc0('0x2b')],qs['fields'](_0x2007a9['query']['fields']));_0x2671b4['attributes']=_0x2671b4['attributes'][_0x3fc0('0x3e')]?_0x2671b4[_0x3fc0('0x2f')]:_0x540303[_0x3fc0('0x2b')];if(_0x2007a9[_0x3fc0('0x2c')][_0x3fc0('0x3f')]){_0x2671b4[_0x3fc0('0x3b')]=[{'all':!![]}];}_0x2671b4=_[_0x3fc0('0x37')]({},_0x2671b4,_0x2007a9[_0x3fc0('0x3a')]);return db['CmHopperHistory'][_0x3fc0('0x40')](_0x2671b4)['then'](handleEntityNotFound(_0x5dc950,null))[_0x3fc0('0x20')](respondWithResult(_0x5dc950,null))['catch'](handleError(_0x5dc950,null));};exports[_0x3fc0('0x41')]=function(_0xf8aa9,_0x408bf3){return db[_0x3fc0('0x27')]['create'](_0xf8aa9[_0x3fc0('0x42')],{})['then'](respondWithResult(_0x408bf3,0xc9))[_0x3fc0('0x43')](handleError(_0x408bf3,null));};exports[_0x3fc0('0x44')]=function(_0x21d4a9,_0x57ab63){return db['CmHopperHistory'][_0x3fc0('0x44')]()[_0x3fc0('0x20')](respondWithResult(_0x57ab63,null))[_0x3fc0('0x43')](handleError(_0x57ab63,null));};exports[_0x3fc0('0x1f')]=function(_0x41f55e,_0x3d78e5){if(_0x41f55e[_0x3fc0('0x42')][_0x3fc0('0x45')]){delete _0x41f55e['body'][_0x3fc0('0x45')];}return db[_0x3fc0('0x27')][_0x3fc0('0x40')]({'where':{'uniqueid':_0x41f55e[_0x3fc0('0x3d')]['id']}})[_0x3fc0('0x20')](handleEntityNotFound(_0x3d78e5,null))['then'](saveUpdates(_0x41f55e[_0x3fc0('0x42')],null))[_0x3fc0('0x20')](respondWithResult(_0x3d78e5,null))[_0x3fc0('0x43')](handleError(_0x3d78e5,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 6ea384b..b780c5b 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 _0xaacb=['request-promise','path','../../config/environment','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','util','../../config/logger','api'];(function(_0x5b1418,_0x90525e){var _0x295e54=function(_0x2cb1bc){while(--_0x2cb1bc){_0x5b1418['push'](_0x5b1418['shift']());}};_0x295e54(++_0x90525e);}(_0xaacb,0xb1));var _0xbaac=function(_0x2eef8c,_0x15a03d){_0x2eef8c=_0x2eef8c-0x0;var _0x1bec99=_0xaacb[_0x2eef8c];return _0x1bec99;};'use strict';var _=require('lodash');var util=require(_0xbaac('0x0'));var logger=require(_0xbaac('0x1'))(_0xbaac('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbaac('0x3'));var fs=require('fs');var path=require(_0xbaac('0x4'));var rimraf=require('rimraf');var config=require(_0xbaac('0x5'));var attributes=require('./cmHopperHistory.attributes');module[_0xbaac('0x6')]=function(_0x45ceed,_0x4169db){return _0x45ceed[_0xbaac('0x7')](_0xbaac('0x8'),attributes,{'tableName':_0xbaac('0x9'),'paranoid':![],'indexes':[{'name':_0xbaac('0xa'),'fields':[_0xbaac('0xa')]},{'name':_0xbaac('0xb'),'fields':[_0xbaac('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4d49=['exports','define','CmHopperHistory','cm_hopper_history','endtime','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x519e05,_0x1e9493){var _0x1b42ab=function(_0x5e542c){while(--_0x5e542c){_0x519e05['push'](_0x519e05['shift']());}};_0x1b42ab(++_0x1e9493);}(_0x4d49,0x17e));var _0x94d4=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x4d49[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x94d4('0x0'));var util=require(_0x94d4('0x1'));var logger=require(_0x94d4('0x2'))(_0x94d4('0x3'));var moment=require(_0x94d4('0x4'));var BPromise=require(_0x94d4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x94d4('0x6'));var rimraf=require(_0x94d4('0x7'));var config=require('../../config/environment');var attributes=require('./cmHopperHistory.attributes');module[_0x94d4('0x8')]=function(_0x2edad4,_0x275509){return _0x2edad4[_0x94d4('0x9')](_0x94d4('0xa'),attributes,{'tableName':_0x94d4('0xb'),'paranoid':![],'indexes':[{'name':_0x94d4('0xc'),'fields':['endtime']},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 9a84ae9..9264615 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 _0xf4eb=['col','predictiveIntervalTotalCalls','literal','predictiveIntervalAnsweredCalls','COUNT','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','where','campaign','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x208,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','name','`state`\x20=\x204,\x201,\x20null','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','CreateCmHopperHistory','CmHopperHistory','create','body','raw','AvgHandleTime','findAll','options','sequelize'];(function(_0x472072,_0x5add18){var _0x38ca35=function(_0x197592){while(--_0x197592){_0x472072['push'](_0x472072['shift']());}};_0x38ca35(++_0x5add18);}(_0xf4eb,0xec));var _0xbf4e=function(_0x44b721,_0x3f6d73){_0x44b721=_0x44b721-0x0;var _0x494b7a=_0xf4eb[_0x44b721];return _0x494b7a;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('CmHopperHistory,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});}exports[_0xbf4e('0x13')]=function(_0x577c27){var _0x5db03f=this;return new Promise(function(_0x566ec3,_0x4f8762){return db[_0xbf4e('0x14')][_0xbf4e('0x15')](_0x577c27[_0xbf4e('0x16')],{'raw':_0x577c27['options']?_0x577c27['options'][_0xbf4e('0x17')]===undefined?!![]:![]:!![]})[_0xbf4e('0x9')](function(_0x3be138){logger[_0xbf4e('0xa')](_0xbf4e('0x13'),_0x577c27);logger[_0xbf4e('0xd')](_0xbf4e('0x13'),_0x577c27,JSON[_0xbf4e('0xe')](_0x3be138));_0x566ec3(_0x3be138);})[_0xbf4e('0x12')](function(_0x376832){logger[_0xbf4e('0xf')]('CreateCmHopperHistory',_0x376832[_0xbf4e('0x11')],_0x577c27);_0x4f8762(_0x5db03f[_0xbf4e('0xf')](0x1f4,_0x376832['message']));});});};exports[_0xbf4e('0x18')]=function(_0x30994d){var _0x114412=this;return new Promise(function(_0x1bda8b,_0x3a5d72){return db['CmHopperHistory'][_0xbf4e('0x19')]({'raw':_0x30994d[_0xbf4e('0x1a')]?_0x30994d[_0xbf4e('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x30994d[_0xbf4e('0x1a')]?_0x30994d['options']['where']||null:null,'attributes':[[db[_0xbf4e('0x1b')]['fn']('COUNT',db[_0xbf4e('0x1b')][_0xbf4e('0x1c')]('id')),_0xbf4e('0x1d')],[db[_0xbf4e('0x1b')]['fn']('COUNT',db[_0xbf4e('0x1b')]['fn']('IF',db[_0xbf4e('0x1b')][_0xbf4e('0x1e')]('`state`\x20=\x204,\x201,\x20null'))),_0xbf4e('0x1f')],[db['sequelize']['fn'](_0xbf4e('0x20'),db[_0xbf4e('0x1b')]['fn']('IF',db[_0xbf4e('0x1b')]['literal'](_0xbf4e('0x21')))),_0xbf4e('0x22')],[db[_0xbf4e('0x1b')]['fn'](_0xbf4e('0x20'),db[_0xbf4e('0x1b')]['fn']('IF',db[_0xbf4e('0x1b')]['literal'](_0xbf4e('0x23')))),_0xbf4e('0x24')],[db['sequelize']['fn'](_0xbf4e('0x25'),db[_0xbf4e('0x1b')]['fn']('IF',db['sequelize'][_0xbf4e('0x1e')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0xbf4e('0x26')],[db['sequelize']['fn'](_0xbf4e('0x25'),db[_0xbf4e('0x1b')]['fn']('IF',db[_0xbf4e('0x1b')]['literal'](_0xbf4e('0x27')))),_0xbf4e('0x28')]]})[_0xbf4e('0x9')](function(_0x29d6aa){logger[_0xbf4e('0xa')](_0xbf4e('0x18'),_0x30994d);logger['debug'](_0xbf4e('0x18'),_0x30994d,JSON[_0xbf4e('0xe')](_0x29d6aa));_0x1bda8b(_0x29d6aa);})[_0xbf4e('0x12')](function(_0x3bba55){logger[_0xbf4e('0xf')]('AvgHandleTime',_0x3bba55['message'],_0x30994d);_0x3a5d72(_0x114412['error'](0x1f4,_0x3bba55['message']));});});};exports[_0xbf4e('0x29')]=function(_0x17a1a1){var _0x91b52f=this;return new Promise(function(_0x2693ba,_0x22ddde){return db[_0xbf4e('0x14')][_0xbf4e('0x19')]({'raw':_0x17a1a1[_0xbf4e('0x1a')]?_0x17a1a1[_0xbf4e('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x17a1a1['options']?_0x17a1a1[_0xbf4e('0x1a')][_0xbf4e('0x2a')]||null:null,'attributes':[[_0xbf4e('0x2b'),'name'],[db[_0xbf4e('0x1b')]['fn']('COUNT',db[_0xbf4e('0x1b')]['fn']('IF',db[_0xbf4e('0x1b')][_0xbf4e('0x1e')](_0xbf4e('0x2c')))),'outboundNoSuchCallsDay'],[db[_0xbf4e('0x1b')]['fn'](_0xbf4e('0x20'),db[_0xbf4e('0x1b')]['fn']('IF',db[_0xbf4e('0x1b')]['literal'](_0xbf4e('0x2d')))),_0xbf4e('0x2e')],[db[_0xbf4e('0x1b')]['fn'](_0xbf4e('0x20'),db[_0xbf4e('0x1b')]['fn']('IF',db[_0xbf4e('0x1b')][_0xbf4e('0x1e')]('`state`\x20=\x204,\x201,\x20null'))),_0xbf4e('0x2f')],[db[_0xbf4e('0x1b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xbf4e('0x1b')][_0xbf4e('0x1e')]('`state`\x20=\x205,\x201,\x20null'))),'outboundBusyCallsDay'],[db[_0xbf4e('0x1b')]['fn'](_0xbf4e('0x20'),db[_0xbf4e('0x1b')]['fn']('IF',db[_0xbf4e('0x1b')][_0xbf4e('0x1e')](_0xbf4e('0x30')))),'outboundCongestionCallsDay'],[db[_0xbf4e('0x1b')]['fn'](_0xbf4e('0x20'),db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xbf4e('0x31')],[db['sequelize']['fn'](_0xbf4e('0x20'),db[_0xbf4e('0x1b')]['fn']('IF',db['sequelize']['literal'](_0xbf4e('0x32')))),_0xbf4e('0x33')],[db[_0xbf4e('0x1b')]['fn'](_0xbf4e('0x20'),db[_0xbf4e('0x1b')]['fn']('IF',db['sequelize'][_0xbf4e('0x1e')](_0xbf4e('0x34')))),_0xbf4e('0x35')],[db[_0xbf4e('0x1b')]['fn'](_0xbf4e('0x20'),db[_0xbf4e('0x1b')]['fn']('IF',db[_0xbf4e('0x1b')][_0xbf4e('0x1e')]('`state`\x20=\x2013,\x201,\x20null'))),_0xbf4e('0x36')],[db[_0xbf4e('0x1b')]['fn'](_0xbf4e('0x20'),db[_0xbf4e('0x1b')]['fn']('IF',db[_0xbf4e('0x1b')][_0xbf4e('0x1e')](_0xbf4e('0x37')))),_0xbf4e('0x38')],[db[_0xbf4e('0x1b')]['fn'](_0xbf4e('0x20'),db[_0xbf4e('0x1b')]['fn']('IF',db[_0xbf4e('0x1b')][_0xbf4e('0x1e')](_0xbf4e('0x39')))),_0xbf4e('0x3a')],[db[_0xbf4e('0x1b')]['fn'](_0xbf4e('0x20'),db['sequelize']['fn']('IF',db[_0xbf4e('0x1b')][_0xbf4e('0x1e')](_0xbf4e('0x3b')))),'outboundAnswerAgiCallsDay'],[db[_0xbf4e('0x1b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xbf4e('0x1b')][_0xbf4e('0x1e')]('`state`\x20=\x2020,\x201,\x20null'))),_0xbf4e('0x3a')],[db[_0xbf4e('0x1b')]['fn'](_0xbf4e('0x20'),db[_0xbf4e('0x1b')]['fn']('IF',db[_0xbf4e('0x1b')][_0xbf4e('0x1e')](_0xbf4e('0x3c')))),_0xbf4e('0x3d')]],'group':[_0xbf4e('0x2b')]})[_0xbf4e('0x9')](function(_0x271ad2){logger['info']('GetVoiceQueueHopperHistory',_0x17a1a1);logger[_0xbf4e('0xd')](_0xbf4e('0x29'),_0x17a1a1,JSON[_0xbf4e('0xe')](_0x271ad2));_0x2693ba(_0x271ad2);})['catch'](function(_0x339ce6){logger[_0xbf4e('0xf')]('GetVoiceQueueHopperHistory',_0x339ce6['message'],_0x17a1a1);_0x22ddde(_0x91b52f[_0xbf4e('0xf')](0x1f4,_0x339ce6['message']));});});};exports['GetCampaignHopperHistory']=function(_0x424f41){var _0x3dd51a=this;return new Promise(function(_0x73ca86,_0x43cfd7){return db[_0xbf4e('0x14')]['findAll']({'raw':_0x424f41[_0xbf4e('0x1a')]?_0x424f41['options'][_0xbf4e('0x17')]===undefined?!![]:![]:!![],'where':_0x424f41['options']?_0x424f41[_0xbf4e('0x1a')]['where']||null:null,'attributes':[[_0xbf4e('0x2b'),_0xbf4e('0x3e')],[db[_0xbf4e('0x1b')]['fn'](_0xbf4e('0x20'),db[_0xbf4e('0x1b')]['col']('id')),'ivrTotalCallsDays'],[db['sequelize']['fn']('COUNT',db[_0xbf4e('0x1b')]['fn']('IF',db[_0xbf4e('0x1b')]['literal'](_0xbf4e('0x3f')))),_0xbf4e('0x40')]],'group':[_0xbf4e('0x2b')]})[_0xbf4e('0x9')](function(_0x17c2e1){logger[_0xbf4e('0xa')](_0xbf4e('0x41'),_0x424f41);logger['debug'](_0xbf4e('0x41'),_0x424f41,JSON[_0xbf4e('0xe')](_0x17c2e1));_0x73ca86(_0x17c2e1);})[_0xbf4e('0x12')](function(_0x5e548a){logger['error'](_0xbf4e('0x41'),_0x5e548a[_0xbf4e('0x11')],_0x424f41);_0x43cfd7(_0x3dd51a[_0xbf4e('0xf')](0x1f4,_0x5e548a['message']));});});}; \ No newline at end of file +var _0x6f7a=['outboundCongestionCallsDay','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundReCallsDay','campaign','GetCampaignHopperHistory','ivrTotalCallsDays','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperHistory,\x20%s,\x20%s','message','request\x20sent','result','catch','CmHopperHistory','body','options','raw','CreateCmHopperHistory','AvgHandleTime','where','sequelize','col','predictiveIntervalTotalCalls','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','findAll','name','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null'];(function(_0x4adfef,_0x138890){var _0x21bcf2=function(_0xbb492d){while(--_0xbb492d){_0x4adfef['push'](_0x4adfef['shift']());}};_0x21bcf2(++_0x138890);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x39dc68,_0x1c7cbb){_0x39dc68=_0x39dc68-0x0;var _0x315053=_0x6f7a[_0x39dc68];return _0x315053;};'use strict';var _=require(_0xa6f7('0x0'));var util=require(_0xa6f7('0x1'));var moment=require(_0xa6f7('0x2'));var BPromise=require(_0xa6f7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa6f7('0x4'));var db=require(_0xa6f7('0x5'))['db'];var utils=require(_0xa6f7('0x6'));var logger=require(_0xa6f7('0x7'))(_0xa6f7('0x8'));var config=require(_0xa6f7('0x9'));var jayson=require(_0xa6f7('0xa'));var client=jayson[_0xa6f7('0xb')][_0xa6f7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x335aaa,_0x1a06d1,_0x481a8c){return new BPromise(function(_0x4b4f9e,_0x30f2a7){return client[_0xa6f7('0xd')](_0x335aaa,_0x481a8c)[_0xa6f7('0xe')](function(_0x362404){logger[_0xa6f7('0xf')]('CmHopperHistory,\x20%s,\x20%s',_0x1a06d1,'request\x20sent');logger[_0xa6f7('0x10')](_0xa6f7('0x11'),_0x1a06d1,'request\x20sent',JSON[_0xa6f7('0x12')](_0x362404));if(_0x362404['error']){if(_0x362404[_0xa6f7('0x13')][_0xa6f7('0x14')]===0x1f4){logger[_0xa6f7('0x13')](_0xa6f7('0x15'),_0x1a06d1,_0x362404['error'][_0xa6f7('0x16')]);return _0x30f2a7(_0x362404['error'][_0xa6f7('0x16')]);}logger[_0xa6f7('0x13')](_0xa6f7('0x15'),_0x1a06d1,_0x362404['error'][_0xa6f7('0x16')]);return _0x4b4f9e(_0x362404['error'][_0xa6f7('0x16')]);}else{logger['info'](_0xa6f7('0x15'),_0x1a06d1,_0xa6f7('0x17'));_0x4b4f9e(_0x362404[_0xa6f7('0x18')]['message']);}})[_0xa6f7('0x19')](function(_0x22635e){logger[_0xa6f7('0x13')](_0xa6f7('0x15'),_0x1a06d1,_0x22635e);_0x30f2a7(_0x22635e);});});}exports['CreateCmHopperHistory']=function(_0x4a8827){var _0xba7755=this;return new Promise(function(_0x5298ba,_0x378967){return db[_0xa6f7('0x1a')]['create'](_0x4a8827[_0xa6f7('0x1b')],{'raw':_0x4a8827[_0xa6f7('0x1c')]?_0x4a8827[_0xa6f7('0x1c')][_0xa6f7('0x1d')]===undefined?!![]:![]:!![]})[_0xa6f7('0xe')](function(_0x1aa8dc){logger['info'](_0xa6f7('0x1e'),_0x4a8827);logger[_0xa6f7('0x10')]('CreateCmHopperHistory',_0x4a8827,JSON['stringify'](_0x1aa8dc));_0x5298ba(_0x1aa8dc);})['catch'](function(_0x1de6c9){logger[_0xa6f7('0x13')]('CreateCmHopperHistory',_0x1de6c9['message'],_0x4a8827);_0x378967(_0xba7755['error'](0x1f4,_0x1de6c9[_0xa6f7('0x16')]));});});};exports[_0xa6f7('0x1f')]=function(_0x28263e){var _0x5baaa9=this;return new Promise(function(_0x484874,_0x2f4907){return db['CmHopperHistory']['findAll']({'raw':_0x28263e[_0xa6f7('0x1c')]?_0x28263e['options'][_0xa6f7('0x1d')]===undefined?!![]:![]:!![],'where':_0x28263e[_0xa6f7('0x1c')]?_0x28263e[_0xa6f7('0x1c')][_0xa6f7('0x20')]||null:null,'attributes':[[db[_0xa6f7('0x21')]['fn']('COUNT',db['sequelize'][_0xa6f7('0x22')]('id')),_0xa6f7('0x23')],[db['sequelize']['fn'](_0xa6f7('0x24'),db[_0xa6f7('0x21')]['fn']('IF',db[_0xa6f7('0x21')][_0xa6f7('0x25')](_0xa6f7('0x26')))),_0xa6f7('0x27')],[db[_0xa6f7('0x21')]['fn'](_0xa6f7('0x24'),db[_0xa6f7('0x21')]['fn']('IF',db[_0xa6f7('0x21')][_0xa6f7('0x25')](_0xa6f7('0x28')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0xa6f7('0x21')]['fn'](_0xa6f7('0x24'),db['sequelize']['fn']('IF',db[_0xa6f7('0x21')][_0xa6f7('0x25')]('`state`\x20=\x2011,\x201,\x20null'))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0xa6f7('0x21')]['fn'](_0xa6f7('0x29'),db[_0xa6f7('0x21')]['fn']('IF',db[_0xa6f7('0x21')][_0xa6f7('0x25')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),'predictiveIntervalAvgHoldtime'],[db[_0xa6f7('0x21')]['fn']('AVG',db[_0xa6f7('0x21')]['fn']('IF',db[_0xa6f7('0x21')][_0xa6f7('0x25')](_0xa6f7('0x2a')))),_0xa6f7('0x2b')]]})[_0xa6f7('0xe')](function(_0x4d2d38){logger[_0xa6f7('0xf')](_0xa6f7('0x1f'),_0x28263e);logger[_0xa6f7('0x10')]('AvgHandleTime',_0x28263e,JSON[_0xa6f7('0x12')](_0x4d2d38));_0x484874(_0x4d2d38);})['catch'](function(_0x1170c4){logger[_0xa6f7('0x13')](_0xa6f7('0x1f'),_0x1170c4['message'],_0x28263e);_0x2f4907(_0x5baaa9[_0xa6f7('0x13')](0x1f4,_0x1170c4[_0xa6f7('0x16')]));});});};exports[_0xa6f7('0x2c')]=function(_0x37b833){var _0x14444c=this;return new Promise(function(_0x28490e,_0x4a28a7){return db[_0xa6f7('0x1a')][_0xa6f7('0x2d')]({'raw':_0x37b833[_0xa6f7('0x1c')]?_0x37b833[_0xa6f7('0x1c')][_0xa6f7('0x1d')]===undefined?!![]:![]:!![],'where':_0x37b833[_0xa6f7('0x1c')]?_0x37b833[_0xa6f7('0x1c')][_0xa6f7('0x20')]||null:null,'attributes':[['campaign',_0xa6f7('0x2e')],[db[_0xa6f7('0x21')]['fn'](_0xa6f7('0x24'),db['sequelize']['fn']('IF',db[_0xa6f7('0x21')][_0xa6f7('0x25')]('`state`\x20=\x200,\x201,\x20null'))),_0xa6f7('0x2f')],[db[_0xa6f7('0x21')]['fn'](_0xa6f7('0x24'),db[_0xa6f7('0x21')]['fn']('IF',db[_0xa6f7('0x21')]['literal'](_0xa6f7('0x30')))),_0xa6f7('0x31')],[db[_0xa6f7('0x21')]['fn'](_0xa6f7('0x24'),db[_0xa6f7('0x21')]['fn']('IF',db[_0xa6f7('0x21')][_0xa6f7('0x25')](_0xa6f7('0x26')))),'outboundAnswerCallsDay'],[db['sequelize']['fn'](_0xa6f7('0x24'),db[_0xa6f7('0x21')]['fn']('IF',db[_0xa6f7('0x21')][_0xa6f7('0x25')](_0xa6f7('0x32')))),_0xa6f7('0x33')],[db[_0xa6f7('0x21')]['fn'](_0xa6f7('0x24'),db[_0xa6f7('0x21')]['fn']('IF',db[_0xa6f7('0x21')]['literal'](_0xa6f7('0x34')))),_0xa6f7('0x35')],[db['sequelize']['fn'](_0xa6f7('0x24'),db[_0xa6f7('0x21')]['fn']('IF',db[_0xa6f7('0x21')][_0xa6f7('0x25')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xa6f7('0x36')],[db['sequelize']['fn']('COUNT',db[_0xa6f7('0x21')]['fn']('IF',db[_0xa6f7('0x21')][_0xa6f7('0x25')](_0xa6f7('0x37')))),_0xa6f7('0x38')],[db[_0xa6f7('0x21')]['fn'](_0xa6f7('0x24'),db['sequelize']['fn']('IF',db[_0xa6f7('0x21')][_0xa6f7('0x25')]('`state`\x20=\x2012,\x201,\x20null'))),_0xa6f7('0x39')],[db[_0xa6f7('0x21')]['fn'](_0xa6f7('0x24'),db['sequelize']['fn']('IF',db[_0xa6f7('0x21')]['literal'](_0xa6f7('0x3a')))),_0xa6f7('0x3b')],[db[_0xa6f7('0x21')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xa6f7('0x21')]['literal'](_0xa6f7('0x3c')))),'outboundOriginateFailureCallsDay'],[db['sequelize']['fn'](_0xa6f7('0x24'),db[_0xa6f7('0x21')]['fn']('IF',db[_0xa6f7('0x21')][_0xa6f7('0x25')](_0xa6f7('0x3d')))),_0xa6f7('0x3e')],[db['sequelize']['fn'](_0xa6f7('0x24'),db[_0xa6f7('0x21')]['fn']('IF',db['sequelize'][_0xa6f7('0x25')]('`state`\x20=\x2016,\x201,\x20null'))),_0xa6f7('0x3f')],[db['sequelize']['fn']('COUNT',db[_0xa6f7('0x21')]['fn']('IF',db[_0xa6f7('0x21')][_0xa6f7('0x25')](_0xa6f7('0x40')))),_0xa6f7('0x3e')],[db['sequelize']['fn'](_0xa6f7('0x24'),db[_0xa6f7('0x21')]['fn']('IF',db['sequelize'][_0xa6f7('0x25')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0xa6f7('0x41')]],'group':[_0xa6f7('0x42')]})[_0xa6f7('0xe')](function(_0x55369a){logger[_0xa6f7('0xf')]('GetVoiceQueueHopperHistory',_0x37b833);logger[_0xa6f7('0x10')](_0xa6f7('0x2c'),_0x37b833,JSON[_0xa6f7('0x12')](_0x55369a));_0x28490e(_0x55369a);})[_0xa6f7('0x19')](function(_0xa6bff9){logger['error']('GetVoiceQueueHopperHistory',_0xa6bff9[_0xa6f7('0x16')],_0x37b833);_0x4a28a7(_0x14444c[_0xa6f7('0x13')](0x1f4,_0xa6bff9[_0xa6f7('0x16')]));});});};exports[_0xa6f7('0x43')]=function(_0x5931e9){var _0x9d901e=this;return new Promise(function(_0x2105dd,_0x14d841){return db[_0xa6f7('0x1a')][_0xa6f7('0x2d')]({'raw':_0x5931e9[_0xa6f7('0x1c')]?_0x5931e9['options'][_0xa6f7('0x1d')]===undefined?!![]:![]:!![],'where':_0x5931e9[_0xa6f7('0x1c')]?_0x5931e9[_0xa6f7('0x1c')]['where']||null:null,'attributes':[[_0xa6f7('0x42'),_0xa6f7('0x2e')],[db[_0xa6f7('0x21')]['fn'](_0xa6f7('0x24'),db['sequelize']['col']('id')),_0xa6f7('0x44')],[db[_0xa6f7('0x21')]['fn'](_0xa6f7('0x24'),db[_0xa6f7('0x21')]['fn']('IF',db[_0xa6f7('0x21')][_0xa6f7('0x25')](_0xa6f7('0x26')))),'ivrAnswerCallsDay']],'group':[_0xa6f7('0x42')]})[_0xa6f7('0xe')](function(_0x2f131c){logger[_0xa6f7('0xf')](_0xa6f7('0x43'),_0x5931e9);logger[_0xa6f7('0x10')](_0xa6f7('0x43'),_0x5931e9,JSON[_0xa6f7('0x12')](_0x2f131c));_0x2105dd(_0x2f131c);})[_0xa6f7('0x19')](function(_0x186956){logger[_0xa6f7('0x13')]('GetCampaignHopperHistory',_0x186956[_0xa6f7('0x16')],_0x5931e9);_0x14d841(_0x9d901e['error'](0x1f4,_0x186956[_0xa6f7('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 5f6e420..baac312 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 _0xd417=['exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','show','create','put','/:id','update'];(function(_0x4f99c4,_0x542e4e){var _0x2408ba=function(_0x5c1f5e){while(--_0x5c1f5e){_0x4f99c4['push'](_0x4f99c4['shift']());}};_0x2408ba(++_0x542e4e);}(_0xd417,0x188));var _0x7d41=function(_0x1b22a5,_0x340775){_0x1b22a5=_0x1b22a5-0x0;var _0x3b8b5a=_0xd417[_0x1b22a5];return _0x3b8b5a;};'use strict';var multer=require('multer');var util=require(_0x7d41('0x0'));var path=require(_0x7d41('0x1'));var timeout=require(_0x7d41('0x2'));var express=require(_0x7d41('0x3'));var router=express['Router']();var auth=require(_0x7d41('0x4'));var interaction=require(_0x7d41('0x5'));var config=require(_0x7d41('0x6'));var controller=require('./cmHopperHistory.controller');router[_0x7d41('0x7')]('/',auth[_0x7d41('0x8')](),controller[_0x7d41('0x9')]);router['get'](_0x7d41('0xa'),auth[_0x7d41('0x8')](),controller['describe']);router[_0x7d41('0x7')]('/:id',auth[_0x7d41('0x8')](),controller[_0x7d41('0xb')]);router['post']('/',auth[_0x7d41('0x8')](),controller[_0x7d41('0xc')]);router[_0x7d41('0xd')](_0x7d41('0xe'),auth[_0x7d41('0x8')](),controller[_0x7d41('0xf')]);module[_0x7d41('0x10')]=router; \ No newline at end of file +var _0x810c=['/:id','post','create','update','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe'];(function(_0x5e4278,_0x53ed71){var _0x2b35fe=function(_0x172b6f){while(--_0x172b6f){_0x5e4278['push'](_0x5e4278['shift']());}};_0x2b35fe(++_0x53ed71);}(_0x810c,0x16d));var _0xc810=function(_0x20679c,_0x57b5ff){_0x20679c=_0x20679c-0x0;var _0x53d3bb=_0x810c[_0x20679c];return _0x53d3bb;};'use strict';var multer=require(_0xc810('0x0'));var util=require(_0xc810('0x1'));var path=require('path');var timeout=require(_0xc810('0x2'));var express=require(_0xc810('0x3'));var router=express[_0xc810('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xc810('0x5'));var config=require(_0xc810('0x6'));var controller=require('./cmHopperHistory.controller');router[_0xc810('0x7')]('/',auth[_0xc810('0x8')](),controller['index']);router[_0xc810('0x7')](_0xc810('0x9'),auth[_0xc810('0x8')](),controller['describe']);router['get'](_0xc810('0xa'),auth[_0xc810('0x8')](),controller['show']);router[_0xc810('0xb')]('/',auth[_0xc810('0x8')](),controller[_0xc810('0xc')]);router['put'](_0xc810('0xa'),auth[_0xc810('0x8')](),controller[_0xc810('0xd')]);module[_0xc810('0xe')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index a487d7c..ccc5118 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 _0x8a3a=['exports','STRING','name','sequelize'];(function(_0x271060,_0x3f86b1){var _0x40540b=function(_0x1735a7){while(--_0x1735a7){_0x271060['push'](_0x271060['shift']());}};_0x40540b(++_0x3f86b1);}(_0x8a3a,0x77));var _0xa8a3=function(_0x1921df,_0x536d53){_0x1921df=_0x1921df-0x0;var _0x38483d=_0x8a3a[_0x1921df];return _0x38483d;};'use strict';var Sequelize=require(_0xa8a3('0x0'));module[_0xa8a3('0x1')]={'name':{'type':Sequelize[_0xa8a3('0x2')],'unique':_0xa8a3('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0xa8a3('0x2')]}}; \ No newline at end of file +var _0xd3e0=['exports','STRING','sequelize'];(function(_0x53b53e,_0x498437){var _0xbb6179=function(_0x3975eb){while(--_0x3975eb){_0x53b53e['push'](_0x53b53e['shift']());}};_0xbb6179(++_0x498437);}(_0xd3e0,0x19a));var _0x0d3e=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xd3e0[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0x0d3e('0x0'));module[_0x0d3e('0x1')]={'name':{'type':Sequelize[_0x0d3e('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x0d3e('0x2')]},'dialPrefix':{'type':Sequelize[_0x0d3e('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 8bd9f53..8b7270a 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 _0xa9e0=['addAgents','spread','removeAgents','emit','userCmList:remove','getAgents','User','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','CmList','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','length','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ListId','findOne','Disposition','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','each','omit','success','errors','message','CmCustomField','CustomFields','concat','format','cf_%d','nolimit','raw','getContacts','isEmpty','now','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','addCustomField','sequelize','transaction','addCustomFields','TEXT','text','Sequelize','number','INTEGER','switch','defaultValue','queryInterface','cm_contacts','cf_%s','getCustomFields','findAndCountAll'];(function(_0x4d03db,_0x42ce22){var _0x30281a=function(_0x3f8d14){while(--_0x3f8d14){_0x4d03db['push'](_0x4d03db['shift']());}};_0x30281a(++_0x42ce22);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');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 db=require(_0x0a9e('0x13'))['db'];config[_0x0a9e('0x14')]=_[_0x0a9e('0x15')](config[_0x0a9e('0x14')],{'host':_0x0a9e('0x16'),'port':0x18eb});var socket=require(_0x0a9e('0x17'))(new Redis(config['redis']));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);function respondWithStatusCode(_0x2b4227,_0x281129){_0x281129=_0x281129||0xcc;return function(_0x44dcfd){if(_0x44dcfd){return _0x2b4227[_0x0a9e('0x1a')](_0x281129);}return _0x2b4227['status'](_0x281129)[_0x0a9e('0x1b')]();};}function respondWithResult(_0x5d0880,_0x1985b6){_0x1985b6=_0x1985b6||0xc8;return function(_0x519dfd){if(_0x519dfd){return _0x5d0880[_0x0a9e('0x1c')](_0x1985b6)[_0x0a9e('0x1d')](_0x519dfd);}};}function respondWithFilteredResult(_0x48f32d,_0x225616){return function(_0x5a0a06){if(_0x5a0a06){var _0x459eb1=_0x5a0a06[_0x0a9e('0x1e')],_0x478723=_0x225616[_0x0a9e('0x1f')],_0x106033=_0x225616[_0x0a9e('0x1f')]+_0x225616[_0x0a9e('0x20')],_0x205fd6;if(_0x106033>=_0x459eb1){_0x106033=_0x459eb1;_0x205fd6=0xc8;}else{_0x205fd6=0xce;}_0x48f32d[_0x0a9e('0x1c')](_0x205fd6);return _0x48f32d[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x478723+'-'+_0x106033+'/'+_0x459eb1)[_0x0a9e('0x1d')](_0x5a0a06);}return null;};}function patchUpdates(_0x4bb1e3){return function(_0x2c3407){try{jsonpatch[_0x0a9e('0x23')](_0x2c3407,_0x4bb1e3,!![]);}catch(_0x53682f){return BPromise[_0x0a9e('0x24')](_0x53682f);}return _0x2c3407['save']();};}function saveUpdates(_0x588269,_0x3a02e1){return function(_0x432e56){if(_0x432e56){return _0x432e56[_0x0a9e('0x25')](_0x588269)[_0x0a9e('0x26')](function(_0x4abc77){return _0x4abc77;});}return null;};}function removeEntity(_0xfb6e48,_0x2fb0e4){return function(_0x3b45bc){if(_0x3b45bc){return _0x3b45bc[_0x0a9e('0x27')]()[_0x0a9e('0x26')](function(){var _0x42ac8f=_0x3b45bc[_0x0a9e('0x28')]({'plain':!![]});var _0x5ea472='Lists';return db[_0x0a9e('0x29')][_0x0a9e('0x27')]({'where':{'type':_0x5ea472,'resourceId':_0x42ac8f['id']}})[_0x0a9e('0x26')](function(){return _0x3b45bc;});})[_0x0a9e('0x26')](function(){_0xfb6e48['status'](0xcc)[_0x0a9e('0x1b')]();});}};}function handleEntityNotFound(_0x479bc4,_0x45a1e7){return function(_0x5bfb33){if(!_0x5bfb33){_0x479bc4[_0x0a9e('0x1a')](0x194);}return _0x5bfb33;};}function handleError(_0x34dc65,_0x25fba9){_0x25fba9=_0x25fba9||0x1f4;return function(_0x14433c){logger[_0x0a9e('0x2a')](_0x14433c[_0x0a9e('0x2b')]);if(_0x14433c[_0x0a9e('0x2c')]){delete _0x14433c[_0x0a9e('0x2c')];}_0x34dc65['status'](_0x25fba9)[_0x0a9e('0x2d')](_0x14433c);};}exports[_0x0a9e('0x2e')]=function(_0x2b1f27,_0x2ec755){var _0x5c877d={},_0x15b200={},_0x40e7a3={'count':0x0,'rows':[]};var _0x1843b2=_[_0x0a9e('0x2f')](db[_0x0a9e('0x30')][_0x0a9e('0x31')],function(_0x296f41){return{'name':_0x296f41[_0x0a9e('0x32')],'type':_0x296f41[_0x0a9e('0x33')]['key']};});_0x15b200[_0x0a9e('0x34')]=_['map'](_0x1843b2,_0x0a9e('0x2c'));_0x15b200[_0x0a9e('0x35')]=_[_0x0a9e('0x36')](_0x2b1f27[_0x0a9e('0x35')]);_0x15b200[_0x0a9e('0x37')]=_['intersection'](_0x15b200[_0x0a9e('0x34')],_0x15b200[_0x0a9e('0x35')]);_0x5c877d[_0x0a9e('0x38')]=_[_0x0a9e('0x39')](_0x15b200[_0x0a9e('0x34')],qs[_0x0a9e('0x3a')](_0x2b1f27[_0x0a9e('0x35')][_0x0a9e('0x3a')]));_0x5c877d['attributes']=_0x5c877d[_0x0a9e('0x38')]['length']?_0x5c877d[_0x0a9e('0x38')]:_0x15b200[_0x0a9e('0x34')];if(!_0x2b1f27[_0x0a9e('0x35')][_0x0a9e('0x3b')]('nolimit')){_0x5c877d[_0x0a9e('0x20')]=qs[_0x0a9e('0x20')](_0x2b1f27[_0x0a9e('0x35')][_0x0a9e('0x20')]);_0x5c877d['offset']=qs['offset'](_0x2b1f27[_0x0a9e('0x35')]['offset']);}_0x5c877d[_0x0a9e('0x3c')]=qs[_0x0a9e('0x3d')](_0x2b1f27[_0x0a9e('0x35')][_0x0a9e('0x3d')]);_0x5c877d['where']=qs[_0x0a9e('0x37')](_[_0x0a9e('0x3e')](_0x2b1f27[_0x0a9e('0x35')],_0x15b200['filters']));if(_0x2b1f27[_0x0a9e('0x35')][_0x0a9e('0x3f')]){_0x5c877d[_0x0a9e('0x40')]=_['merge'](_0x5c877d['where'],{'$or':_[_0x0a9e('0x2f')](_0x1843b2,function(_0x40d766){if(_0x40d766['type']!==_0x0a9e('0x41')){var _0x419125={};_0x419125[_0x40d766[_0x0a9e('0x2c')]]={'$like':'%'+_0x2b1f27[_0x0a9e('0x35')]['filter']+'%'};return _0x419125;}})});}_0x5c877d=_['merge']({},_0x5c877d,_0x2b1f27[_0x0a9e('0x42')]);var _0x45b3d0={'where':_0x5c877d['where']};return db[_0x0a9e('0x30')][_0x0a9e('0x1e')](_0x45b3d0)[_0x0a9e('0x26')](function(_0x5b4f5e){_0x40e7a3[_0x0a9e('0x1e')]=_0x5b4f5e;if(_0x2b1f27[_0x0a9e('0x35')][_0x0a9e('0x43')]){_0x5c877d[_0x0a9e('0x44')]=[{'all':!![]}];}return db[_0x0a9e('0x30')][_0x0a9e('0x45')](_0x5c877d);})[_0x0a9e('0x26')](function(_0x45a9b8){_0x40e7a3[_0x0a9e('0x46')]=_0x45a9b8;return _0x40e7a3;})[_0x0a9e('0x26')](respondWithFilteredResult(_0x2ec755,_0x5c877d))[_0x0a9e('0x47')](handleError(_0x2ec755,null));};exports[_0x0a9e('0x48')]=function(_0x1a7bce,_0x11ca30){var _0x37f6cc={'raw':![],'where':{'id':_0x1a7bce['params']['id']}},_0x4d04c8={};_0x4d04c8[_0x0a9e('0x34')]=_[_0x0a9e('0x36')](db[_0x0a9e('0x30')][_0x0a9e('0x31')]);_0x4d04c8[_0x0a9e('0x35')]=_[_0x0a9e('0x36')](_0x1a7bce[_0x0a9e('0x35')]);_0x4d04c8[_0x0a9e('0x37')]=_[_0x0a9e('0x39')](_0x4d04c8[_0x0a9e('0x34')],_0x4d04c8[_0x0a9e('0x35')]);_0x37f6cc[_0x0a9e('0x38')]=_['intersection'](_0x4d04c8[_0x0a9e('0x34')],qs[_0x0a9e('0x3a')](_0x1a7bce[_0x0a9e('0x35')][_0x0a9e('0x3a')]));_0x37f6cc[_0x0a9e('0x38')]=_0x37f6cc[_0x0a9e('0x38')][_0x0a9e('0x49')]?_0x37f6cc[_0x0a9e('0x38')]:_0x4d04c8['model'];if(_0x1a7bce[_0x0a9e('0x35')]['includeAll']){_0x37f6cc[_0x0a9e('0x44')]=[{'all':!![]}];}_0x37f6cc=_[_0x0a9e('0x4a')]({},_0x37f6cc,_0x1a7bce[_0x0a9e('0x42')]);return db['CmList'][_0x0a9e('0x4b')](_0x37f6cc)[_0x0a9e('0x26')](handleEntityNotFound(_0x11ca30,null))[_0x0a9e('0x26')](respondWithResult(_0x11ca30,null))[_0x0a9e('0x47')](handleError(_0x11ca30,null));};exports[_0x0a9e('0x4c')]=function(_0x37be73,_0x45bf7f){return db['CmList'][_0x0a9e('0x4c')](_0x37be73[_0x0a9e('0x4d')],{})[_0x0a9e('0x26')](function(_0x16f976){var _0x409789=_0x37be73[_0x0a9e('0x4e')][_0x0a9e('0x28')]({'plain':!![]});if(!_0x409789)throw new Error(_0x0a9e('0x4f'));if(_0x409789[_0x0a9e('0x50')]==='user'){var _0xe401a=_0x16f976[_0x0a9e('0x28')]({'plain':!![]});var _0x4f7240='Lists';return db['UserProfileSection'][_0x0a9e('0x4b')]({'where':{'name':_0x4f7240,'userProfileId':_0x409789[_0x0a9e('0x51')]},'raw':!![]})[_0x0a9e('0x26')](function(_0x11545a){if(_0x11545a&&_0x11545a[_0x0a9e('0x52')]===0x0){return db[_0x0a9e('0x29')][_0x0a9e('0x4c')]({'name':_0xe401a[_0x0a9e('0x2c')],'resourceId':_0xe401a['id'],'type':_0x11545a['name'],'sectionId':_0x11545a['id']},{})['then'](function(){return _0x16f976;});}else{return _0x16f976;}})['catch'](function(_0x39d77d){logger[_0x0a9e('0x2a')](_0x0a9e('0x53'),_0x39d77d);throw _0x39d77d;});}return _0x16f976;})['then'](respondWithResult(_0x45bf7f,0xc9))[_0x0a9e('0x47')](handleError(_0x45bf7f,null));};exports[_0x0a9e('0x25')]=function(_0x53d113,_0x5a88da){if(_0x53d113[_0x0a9e('0x4d')]['id']){delete _0x53d113['body']['id'];}return db[_0x0a9e('0x30')]['find']({'where':{'id':_0x53d113[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x26')](handleEntityNotFound(_0x5a88da,null))[_0x0a9e('0x26')](saveUpdates(_0x53d113['body'],null))[_0x0a9e('0x26')](respondWithResult(_0x5a88da,null))[_0x0a9e('0x47')](handleError(_0x5a88da,null));};exports['destroy']=function(_0x50f687,_0x128aa6){return db[_0x0a9e('0x30')]['find']({'where':{'id':_0x50f687[_0x0a9e('0x54')]['id']}})['then'](handleEntityNotFound(_0x128aa6,null))[_0x0a9e('0x26')](removeEntity(_0x128aa6,null))['catch'](handleError(_0x128aa6,null));};exports[_0x0a9e('0x55')]=function(_0x4a6deb,_0x5da27d){return db['CmList'][_0x0a9e('0x55')]()['then'](respondWithResult(_0x5da27d,null))[_0x0a9e('0x47')](handleError(_0x5da27d,null));};exports[_0x0a9e('0x56')]=function(_0x3cfd00,_0x19b4df,_0x232830){if(_0x3cfd00[_0x0a9e('0x4d')]['id']){delete _0x3cfd00[_0x0a9e('0x4d')]['id'];}return db[_0x0a9e('0x30')]['find']({'where':{'id':_0x3cfd00[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x26')](handleEntityNotFound(_0x19b4df,null))[_0x0a9e('0x26')](function(_0x30c491){if(_0x30c491){_0x3cfd00[_0x0a9e('0x4d')][_0x0a9e('0x57')]=_0x30c491['id'];return db['Disposition'][_0x0a9e('0x4c')](_0x3cfd00[_0x0a9e('0x4d')]);}})['then'](respondWithResult(_0x19b4df,null))[_0x0a9e('0x47')](handleError(_0x19b4df,null));};exports['getDispositions']=function(_0x20c668,_0x5ba1f9,_0x4b3c1a){var _0x5674ee={'raw':![],'where':{}};var _0x273cb5={};var _0x49d231={'count':0x0,'rows':[]};return db[_0x0a9e('0x30')][_0x0a9e('0x58')]({'where':{'id':_0x20c668[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x26')](handleEntityNotFound(_0x5ba1f9,null))[_0x0a9e('0x26')](function(_0x26d7db){if(_0x26d7db){_0x273cb5['model']=_[_0x0a9e('0x36')](db['Disposition'][_0x0a9e('0x31')]);_0x273cb5[_0x0a9e('0x35')]=_[_0x0a9e('0x36')](_0x20c668['query']);_0x273cb5[_0x0a9e('0x37')]=_[_0x0a9e('0x39')](_0x273cb5[_0x0a9e('0x34')],_0x273cb5[_0x0a9e('0x35')]);_0x5674ee['attributes']=_[_0x0a9e('0x39')](_0x273cb5[_0x0a9e('0x34')],qs['fields'](_0x20c668[_0x0a9e('0x35')][_0x0a9e('0x3a')]));_0x5674ee[_0x0a9e('0x38')]=_0x5674ee[_0x0a9e('0x38')][_0x0a9e('0x49')]?_0x5674ee['attributes']:_0x273cb5[_0x0a9e('0x34')];if(!_0x20c668[_0x0a9e('0x35')][_0x0a9e('0x3b')]('nolimit')){_0x5674ee[_0x0a9e('0x20')]=qs['limit'](_0x20c668['query'][_0x0a9e('0x20')]);_0x5674ee[_0x0a9e('0x1f')]=qs[_0x0a9e('0x1f')](_0x20c668[_0x0a9e('0x35')][_0x0a9e('0x1f')]);}_0x5674ee[_0x0a9e('0x3c')]=qs[_0x0a9e('0x3d')](_0x20c668[_0x0a9e('0x35')][_0x0a9e('0x3d')]);_0x5674ee[_0x0a9e('0x40')]=qs[_0x0a9e('0x37')](_[_0x0a9e('0x3e')](_0x20c668[_0x0a9e('0x35')],_0x273cb5[_0x0a9e('0x37')]));_0x5674ee[_0x0a9e('0x40')][_0x0a9e('0x57')]=_0x26d7db['id'];if(_0x20c668[_0x0a9e('0x35')][_0x0a9e('0x3f')]){_0x5674ee['where']=_[_0x0a9e('0x4a')](_0x5674ee[_0x0a9e('0x40')],{'$or':_[_0x0a9e('0x2f')](_0x5674ee['attributes'],function(_0x1148a1){var _0x30944e={};_0x30944e[_0x1148a1]={'$like':'%'+_0x20c668['query'][_0x0a9e('0x3f')]+'%'};return _0x30944e;})});}_0x5674ee=_[_0x0a9e('0x4a')]({},_0x5674ee,_0x20c668[_0x0a9e('0x42')]);return db[_0x0a9e('0x59')][_0x0a9e('0x1e')]({'where':_0x5674ee['where']})['then'](function(_0x4a2438){_0x49d231[_0x0a9e('0x1e')]=_0x4a2438;if(_0x20c668[_0x0a9e('0x35')][_0x0a9e('0x43')]){_0x5674ee[_0x0a9e('0x44')]=[{'all':!![]}];}return db[_0x0a9e('0x59')][_0x0a9e('0x45')](_0x5674ee);})[_0x0a9e('0x26')](function(_0x1a0677){_0x49d231['rows']=_0x1a0677;return _0x49d231;});}})[_0x0a9e('0x26')](respondWithFilteredResult(_0x5ba1f9,_0x5674ee))[_0x0a9e('0x47')](handleError(_0x5ba1f9,null));};exports[_0x0a9e('0x5a')]=function(_0x4a4fc7,_0x2bdc44,_0x583b2e){return db[_0x0a9e('0x30')][_0x0a9e('0x4b')]({'where':{'id':_0x4a4fc7['params']['id']}})[_0x0a9e('0x26')](handleEntityNotFound(_0x2bdc44,null))[_0x0a9e('0x26')](function(_0x2cc7a7){if(_0x2cc7a7){return _0x2cc7a7[_0x0a9e('0x5a')](_0x4a4fc7['query'][_0x0a9e('0x5b')]);}})[_0x0a9e('0x26')](respondWithStatusCode(_0x2bdc44,null))[_0x0a9e('0x47')](handleError(_0x2bdc44,null));};exports[_0x0a9e('0x5c')]=function(_0x5b7fc3,_0x109ccb,_0x3d91db){return db[_0x0a9e('0x30')][_0x0a9e('0x4b')]({'where':{'id':_0x5b7fc3['params']['id']}})[_0x0a9e('0x26')](handleEntityNotFound(_0x109ccb,null))[_0x0a9e('0x26')](function(_0x30a4c7){if(_0x30a4c7){var _0xf410e5=[];var _0x332367={'success':[],'errors':[]};return db[_0x0a9e('0x5d')][_0x0a9e('0x55')]()[_0x0a9e('0x26')](function(_0x1a7b03){if(_0x5b7fc3[_0x0a9e('0x4d')][_0x0a9e('0x5e')]&&_[_0x0a9e('0x5f')](_0x5b7fc3[_0x0a9e('0x4d')][_0x0a9e('0x5e')])){if(_0x5b7fc3['body'][_0x0a9e('0x5e')][_0x0a9e('0x49')]){_0x5b7fc3[_0x0a9e('0x4d')]['tags']=_0x5b7fc3[_0x0a9e('0x4d')][_0x0a9e('0x5e')][_0x0a9e('0x60')](';')+';';}else{_0x5b7fc3[_0x0a9e('0x4d')]['tags']=null;}}else{_0x5b7fc3['body'][_0x0a9e('0x5e')]=null;}if(_0x5b7fc3[_0x0a9e('0x4d')]&&_['isArray'](_0x5b7fc3[_0x0a9e('0x4d')])){for(var _0x53a6a1=0x0;_0x53a6a1<_0x5b7fc3[_0x0a9e('0x4d')][_0x0a9e('0x49')];_0x53a6a1+=0x1){_0x5b7fc3['body'][_0x53a6a1][_0x0a9e('0x57')]=_0x5b7fc3[_0x0a9e('0x54')]['id'];_0xf410e5[_0x0a9e('0x61')](_0x5b7fc3[_0x0a9e('0x4d')][_0x53a6a1]);}return BPromise[_0x0a9e('0x62')](_0xf410e5,function(_0x1f42a0){return db[_0x0a9e('0x5d')]['create'](_[_0x0a9e('0x63')](_0x1f42a0,[_0x0a9e('0x5b'),'id'])||{},{'fields':_[_0x0a9e('0x36')](_0x1a7b03),'raw':!![]})[_0x0a9e('0x26')](function(_0x492543){_0x332367[_0x0a9e('0x64')][_0x0a9e('0x61')](_0x492543['dataValues']);})[_0x0a9e('0x47')](function(_0x5b7940){_0x332367[_0x0a9e('0x65')][_0x0a9e('0x61')]({'data':_0x1f42a0,'error':_0x5b7940[_0x0a9e('0x66')]});});})[_0x0a9e('0x26')](function(_0x5af453){return _0x332367;})['catch'](function(_0x353384){return _0x353384;});}else{_0x109ccb[_0x0a9e('0x1c')](0x190)[_0x0a9e('0x1d')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0x0a9e('0x26')](respondWithResult(_0x109ccb,null))[_0x0a9e('0x47')](handleError(_0x109ccb,null));};exports['getContacts']=function(_0x4e46b2,_0xf0a802,_0x56acca){var _0x5ea541;return db['CmList'][_0x0a9e('0x4b')]({'where':{'id':_0x4e46b2[_0x0a9e('0x54')]['id']},'include':[{'model':db[_0x0a9e('0x67')],'as':_0x0a9e('0x68')}]})[_0x0a9e('0x26')](handleEntityNotFound(_0xf0a802,null))[_0x0a9e('0x26')](function(_0x5a8854){if(_0x5a8854){_0x5ea541=_0x5a8854;return db[_0x0a9e('0x5d')]['rawAttributes'];}})[_0x0a9e('0x26')](function(_0x2aabab){if(_0x2aabab){var _0x18ad56={};var _0x4566b0={};_0x4566b0['model']=_[_0x0a9e('0x69')](_[_0x0a9e('0x36')](_0x2aabab),_[_0x0a9e('0x2f')](_0x5ea541['CustomFields'],function(_0xb6e411){return util[_0x0a9e('0x6a')](_0x0a9e('0x6b'),_0xb6e411['id']);}));_0x4566b0[_0x0a9e('0x35')]=_[_0x0a9e('0x36')](_0x4e46b2[_0x0a9e('0x35')]);_0x4566b0[_0x0a9e('0x37')]=_[_0x0a9e('0x39')](_0x4566b0['model'],_0x4566b0[_0x0a9e('0x35')]);_0x18ad56[_0x0a9e('0x38')]=_['intersection'](_0x4566b0[_0x0a9e('0x34')],qs[_0x0a9e('0x3a')](_0x4e46b2[_0x0a9e('0x35')]['fields']));_0x18ad56[_0x0a9e('0x38')]=_0x18ad56['attributes'][_0x0a9e('0x49')]?_0x18ad56[_0x0a9e('0x38')]:_0x4566b0[_0x0a9e('0x34')];if(!_0x4e46b2[_0x0a9e('0x35')][_0x0a9e('0x3b')](_0x0a9e('0x6c'))){_0x18ad56[_0x0a9e('0x20')]=qs[_0x0a9e('0x20')](_0x4e46b2['query'][_0x0a9e('0x20')]);_0x18ad56[_0x0a9e('0x1f')]=qs[_0x0a9e('0x1f')](_0x4e46b2[_0x0a9e('0x35')][_0x0a9e('0x1f')]);}_0x18ad56[_0x0a9e('0x3c')]=qs[_0x0a9e('0x3d')](_0x4e46b2[_0x0a9e('0x35')][_0x0a9e('0x3d')]);_0x18ad56[_0x0a9e('0x40')]=qs[_0x0a9e('0x37')](_[_0x0a9e('0x3e')](_0x4e46b2[_0x0a9e('0x35')],_0x4566b0['filters']));_0x18ad56[_0x0a9e('0x6d')]=!![];if(_0x4e46b2[_0x0a9e('0x35')][_0x0a9e('0x3f')]){_0x18ad56[_0x0a9e('0x40')]=_[_0x0a9e('0x4a')](_0x18ad56['where'],{'$or':_[_0x0a9e('0x2f')](_0x18ad56[_0x0a9e('0x38')],function(_0x5ce99d){var _0x23b447={};_0x23b447[_0x5ce99d]={'$like':'%'+_0x4e46b2['query'][_0x0a9e('0x3f')]+'%'};return _0x23b447;})});}_0x18ad56=_[_0x0a9e('0x4a')]({},_0x18ad56,_0x4e46b2[_0x0a9e('0x42')]);return _0x5ea541[_0x0a9e('0x6e')](_0x18ad56);}})['then'](respondWithResult(_0xf0a802,null))[_0x0a9e('0x47')](handleError(_0xf0a802,null));};exports['getContactsCsv']=function(_0x2ec396,_0x3d0a77,_0x5e5b89){var _0x231c6a;return db[_0x0a9e('0x30')][_0x0a9e('0x4b')]({'where':{'id':_0x2ec396['params']['id']},'include':[{'model':db['CmCustomField'],'as':_0x0a9e('0x68')}]})[_0x0a9e('0x26')](handleEntityNotFound(_0x3d0a77,null))[_0x0a9e('0x26')](function(_0x413190){if(_0x413190){_0x231c6a=_0x413190;return db[_0x0a9e('0x5d')][_0x0a9e('0x31')];}})[_0x0a9e('0x26')](function(_0x3c75b9){if(_0x3c75b9){var _0x3f8124={};var _0x586510={};_0x586510[_0x0a9e('0x34')]=_['concat'](_[_0x0a9e('0x36')](_0x3c75b9),_[_0x0a9e('0x2f')](_0x231c6a[_0x0a9e('0x68')],function(_0x28ce92){return util[_0x0a9e('0x6a')]('cf_%d',_0x28ce92['id']);}));_0x586510[_0x0a9e('0x35')]=_[_0x0a9e('0x36')](_0x2ec396[_0x0a9e('0x35')]);_0x586510[_0x0a9e('0x37')]=_[_0x0a9e('0x39')](_0x586510['model'],_0x586510['query']);_0x3f8124[_0x0a9e('0x38')]=_['intersection'](_0x586510[_0x0a9e('0x34')],qs[_0x0a9e('0x3a')](_0x2ec396[_0x0a9e('0x35')][_0x0a9e('0x3a')]));_0x3f8124[_0x0a9e('0x38')]=_0x3f8124[_0x0a9e('0x38')]['length']?_0x3f8124['attributes']:_0x586510[_0x0a9e('0x34')];if(!_0x2ec396['query'][_0x0a9e('0x3b')]('nolimit')){_0x3f8124[_0x0a9e('0x20')]=qs['limit'](_0x2ec396['query'][_0x0a9e('0x20')]);_0x3f8124[_0x0a9e('0x1f')]=qs['offset'](_0x2ec396[_0x0a9e('0x35')][_0x0a9e('0x1f')]);}_0x3f8124[_0x0a9e('0x3c')]=qs[_0x0a9e('0x3d')](_0x2ec396[_0x0a9e('0x35')]['sort']);_0x3f8124['where']=qs[_0x0a9e('0x37')](_[_0x0a9e('0x3e')](_0x2ec396[_0x0a9e('0x35')],_0x586510[_0x0a9e('0x37')]));_0x3f8124[_0x0a9e('0x6d')]=!![];if(_0x2ec396['query'][_0x0a9e('0x3f')]){_0x3f8124[_0x0a9e('0x40')]=_['merge'](_0x3f8124[_0x0a9e('0x40')],{'$or':_[_0x0a9e('0x2f')](_0x3f8124[_0x0a9e('0x38')],function(_0x2427d5){var _0x23b25b={};_0x23b25b[_0x2427d5]={'$like':'%'+_0x2ec396[_0x0a9e('0x35')][_0x0a9e('0x3f')]+'%'};return _0x23b25b;})});}_0x3f8124=_[_0x0a9e('0x4a')]({},_0x3f8124,_0x2ec396[_0x0a9e('0x42')]);return _0x231c6a[_0x0a9e('0x6e')](_0x3f8124);}})['then'](function(_0x1065a7){if(!_[_0x0a9e('0x6f')](_0x1065a7)){var _0x2ada60=toCsv(_0x1065a7);var _0x1c4232=Date[_0x0a9e('0x70')]();fs['writeFileSync'](util['format'](_0x0a9e('0x71'),_0x231c6a['id'],_0x1c4232),_0x2ada60);_0x3d0a77[_0x0a9e('0x72')](_0x0a9e('0x73'),_0x0a9e('0x74')+util[_0x0a9e('0x6a')]('list_%d_%s.csv',_0x231c6a['id'],_0x1c4232));_0x3d0a77[_0x0a9e('0x72')](_0x0a9e('0x75'),_0x0a9e('0x76'));return _0x3d0a77['download'](util[_0x0a9e('0x6a')]('/tmp/list_%d_%s.csv',_0x231c6a['id'],_0x1c4232));}else{return _0x3d0a77[_0x0a9e('0x1a')](0xcc);}})['catch'](handleError(_0x3d0a77,null));};exports[_0x0a9e('0x77')]=function(_0x42b833,_0xe339b1,_0x5c500c){var _0xc9529d;delete _0x42b833['body']['id'];return db[_0x0a9e('0x30')][_0x0a9e('0x58')]({'where':{'id':_0x42b833[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x26')](handleEntityNotFound(_0xe339b1,null))[_0x0a9e('0x26')](function(_0x1bee04){if(_0x1bee04){return db[_0x0a9e('0x78')][_0x0a9e('0x79')](function(_0x2aaf07){return db[_0x0a9e('0x67')][_0x0a9e('0x4c')](_0x42b833[_0x0a9e('0x4d')],{'transaction':_0x2aaf07})[_0x0a9e('0x26')](function(_0x399def){_0xc9529d=_0x399def;return _0x1bee04[_0x0a9e('0x7a')](_0x399def,{'transaction':_0x2aaf07});})[_0x0a9e('0x26')](function(){var _0x5b93dd={'type':db['Sequelize'][_0x0a9e('0x7b')],'transaction':_0x2aaf07};switch(_0x42b833['body'][_0x0a9e('0x33')]){case _0x0a9e('0x7c'):_0x5b93dd['type']=db[_0x0a9e('0x7d')][_0x0a9e('0x7b')];break;case _0x0a9e('0x7e'):_0x5b93dd[_0x0a9e('0x33')]=db['Sequelize'][_0x0a9e('0x7f')];break;case _0x0a9e('0x80'):_0x5b93dd[_0x0a9e('0x33')]=db[_0x0a9e('0x7d')]['BOOLEAN'];_0x5b93dd[_0x0a9e('0x81')]=![];break;default:}return db[_0x0a9e('0x78')][_0x0a9e('0x82')]['addColumn'](_0x0a9e('0x83'),util[_0x0a9e('0x6a')](_0x0a9e('0x84'),_0xc9529d['id']),_0x5b93dd);})['then'](function(){return _0xc9529d;});});}})[_0x0a9e('0x26')](respondWithResult(_0xe339b1,null))[_0x0a9e('0x47')](handleError(_0xe339b1,null));};exports[_0x0a9e('0x85')]=function(_0x1a7f58,_0x2394d3,_0x555780){var _0x3211d2={};var _0x289e65={};var _0x4795ae;var _0x3bab3e;return db[_0x0a9e('0x30')][_0x0a9e('0x58')]({'where':{'id':_0x1a7f58['params']['id']}})['then'](handleEntityNotFound(_0x2394d3,null))['then'](function(_0x1015aa){if(_0x1015aa){_0x4795ae=_0x1015aa;_0x289e65[_0x0a9e('0x34')]=_['keys'](db[_0x0a9e('0x67')][_0x0a9e('0x31')]);_0x289e65[_0x0a9e('0x35')]=_['keys'](_0x1a7f58[_0x0a9e('0x35')]);_0x289e65[_0x0a9e('0x37')]=_[_0x0a9e('0x39')](_0x289e65[_0x0a9e('0x34')],_0x289e65[_0x0a9e('0x35')]);_0x3211d2[_0x0a9e('0x38')]=_[_0x0a9e('0x39')](_0x289e65[_0x0a9e('0x34')],qs[_0x0a9e('0x3a')](_0x1a7f58['query'][_0x0a9e('0x3a')]));_0x3211d2['attributes']=_0x3211d2[_0x0a9e('0x38')][_0x0a9e('0x49')]?_0x3211d2[_0x0a9e('0x38')]:_0x289e65[_0x0a9e('0x34')];_0x3211d2[_0x0a9e('0x3c')]=qs[_0x0a9e('0x3d')](_0x1a7f58['query'][_0x0a9e('0x3d')]);_0x3211d2[_0x0a9e('0x40')]=qs[_0x0a9e('0x37')](_[_0x0a9e('0x3e')](_0x1a7f58['query'],_0x289e65[_0x0a9e('0x37')]));_0x3211d2[_0x0a9e('0x40')]=_[_0x0a9e('0x4a')](_0x3211d2[_0x0a9e('0x40')],{'$or':[{'ListId':_0x1015aa['id']},{'ListId':null}]});if(_0x1a7f58[_0x0a9e('0x35')][_0x0a9e('0x3f')]){_0x3211d2[_0x0a9e('0x40')]=_[_0x0a9e('0x4a')](_0x3211d2[_0x0a9e('0x40')],{'$or':_[_0x0a9e('0x2f')](_0x3211d2['attributes'],function(_0x2272bc){var _0x88b25f={};_0x88b25f[_0x2272bc]={'$like':'%'+_0x1a7f58[_0x0a9e('0x35')][_0x0a9e('0x3f')]+'%'};return _0x88b25f;})});}_0x3211d2=_[_0x0a9e('0x4a')]({},_0x3211d2,_0x1a7f58[_0x0a9e('0x42')]);return db[_0x0a9e('0x67')][_0x0a9e('0x86')](_0x3211d2);}})['then'](respondWithResult(_0x2394d3,null))[_0x0a9e('0x47')](handleError(_0x2394d3,null));};exports[_0x0a9e('0x87')]=function(_0x1a9ef1,_0x5c65fc,_0x1402c7){return db[_0x0a9e('0x30')][_0x0a9e('0x4b')]({'where':{'id':_0x1a9ef1[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x26')](handleEntityNotFound(_0x5c65fc,null))[_0x0a9e('0x26')](function(_0x424f1b){if(_0x424f1b){return _0x424f1b[_0x0a9e('0x87')](_0x1a9ef1[_0x0a9e('0x4d')][_0x0a9e('0x5b')],_['omit'](_0x1a9ef1[_0x0a9e('0x4d')],[_0x0a9e('0x5b'),'id'])||{})[_0x0a9e('0x88')](function(_0x3db98f){for(var _0x2b624e=0x0;_0x2b624e<_0x1a9ef1[_0x0a9e('0x4d')]['ids'][_0x0a9e('0x49')];_0x2b624e+=0x1){socket['emit']('userCmList:save',{'UserId':_0x1a9ef1['body'][_0x0a9e('0x5b')][_0x2b624e],'CmListId':_0x1a9ef1[_0x0a9e('0x54')]['id']});}return _0x3db98f;});}})[_0x0a9e('0x26')](respondWithResult(_0x5c65fc,null))[_0x0a9e('0x47')](handleError(_0x5c65fc,null));};exports['removeAgents']=function(_0x4156a5,_0x309fa9,_0x3ddbc7){return db[_0x0a9e('0x30')][_0x0a9e('0x4b')]({'where':{'id':_0x4156a5['params']['id']}})['then'](handleEntityNotFound(_0x309fa9,null))[_0x0a9e('0x26')](function(_0x33bcb2){if(_0x33bcb2){return _0x33bcb2[_0x0a9e('0x89')](_0x4156a5['query'][_0x0a9e('0x5b')])[_0x0a9e('0x26')](function(){if(_[_0x0a9e('0x5f')](_0x4156a5['query'][_0x0a9e('0x5b')])){for(var _0x2bf85d=0x0;_0x2bf85d<_0x4156a5[_0x0a9e('0x35')]['ids'][_0x0a9e('0x49')];_0x2bf85d+=0x1){socket[_0x0a9e('0x8a')](_0x0a9e('0x8b'),{'UserId':Number(_0x4156a5['query']['ids'][_0x2bf85d]),'CmListId':Number(_0x4156a5['params']['id'])});}}else{socket[_0x0a9e('0x8a')](_0x0a9e('0x8b'),{'UserId':Number(_0x4156a5[_0x0a9e('0x35')][_0x0a9e('0x5b')]),'CmListId':Number(_0x4156a5['params']['id'])});}});}})[_0x0a9e('0x26')](respondWithStatusCode(_0x309fa9,null))['catch'](handleError(_0x309fa9,null));};exports[_0x0a9e('0x8c')]=function(_0x2ff2ab,_0x242f23,_0x57f673){var _0x33b4b3={};var _0x33a26c={};var _0xb8a476;var _0x580dd6;return db[_0x0a9e('0x30')]['findOne']({'where':{'id':_0x2ff2ab[_0x0a9e('0x54')]['id']}})['then'](handleEntityNotFound(_0x242f23,null))[_0x0a9e('0x26')](function(_0x57b7d4){if(_0x57b7d4){_0xb8a476=_0x57b7d4;_0x33a26c[_0x0a9e('0x34')]=_[_0x0a9e('0x36')](db[_0x0a9e('0x8d')][_0x0a9e('0x31')]);_0x33a26c[_0x0a9e('0x35')]=_[_0x0a9e('0x36')](_0x2ff2ab[_0x0a9e('0x35')]);_0x33a26c['filters']=_[_0x0a9e('0x39')](_0x33a26c[_0x0a9e('0x34')],_0x33a26c['query']);_0x33b4b3[_0x0a9e('0x38')]=_[_0x0a9e('0x39')](_0x33a26c['model'],qs[_0x0a9e('0x3a')](_0x2ff2ab[_0x0a9e('0x35')][_0x0a9e('0x3a')]));_0x33b4b3['attributes']=_0x33b4b3[_0x0a9e('0x38')][_0x0a9e('0x49')]?_0x33b4b3[_0x0a9e('0x38')]:_0x33a26c[_0x0a9e('0x34')];_0x33b4b3[_0x0a9e('0x3c')]=qs[_0x0a9e('0x3d')](_0x2ff2ab[_0x0a9e('0x35')][_0x0a9e('0x3d')]);_0x33b4b3[_0x0a9e('0x40')]=qs[_0x0a9e('0x37')](_['pick'](_0x2ff2ab[_0x0a9e('0x35')],_0x33a26c['filters']));if(_0x2ff2ab[_0x0a9e('0x35')][_0x0a9e('0x3f')]){_0x33b4b3[_0x0a9e('0x40')]=_[_0x0a9e('0x4a')](_0x33b4b3[_0x0a9e('0x40')],{'$or':_[_0x0a9e('0x2f')](_0x33b4b3['attributes'],function(_0x119708){var _0x469035={};_0x469035[_0x119708]={'$like':'%'+_0x2ff2ab[_0x0a9e('0x35')]['filter']+'%'};return _0x469035;})});}_0x33b4b3=_[_0x0a9e('0x4a')]({},_0x33b4b3,_0x2ff2ab[_0x0a9e('0x42')]);return _0xb8a476[_0x0a9e('0x8c')](_0x33b4b3);}})[_0x0a9e('0x26')](function(_0x31e1e0){if(_0x31e1e0){_0x580dd6=_0x31e1e0[_0x0a9e('0x49')];if(!_0x2ff2ab[_0x0a9e('0x35')]['hasOwnProperty'](_0x0a9e('0x6c'))){_0x33b4b3[_0x0a9e('0x20')]=qs[_0x0a9e('0x20')](_0x2ff2ab[_0x0a9e('0x35')][_0x0a9e('0x20')]);_0x33b4b3[_0x0a9e('0x1f')]=qs[_0x0a9e('0x1f')](_0x2ff2ab['query']['offset']);}return _0xb8a476[_0x0a9e('0x8c')](_0x33b4b3);}})[_0x0a9e('0x26')](function(_0x1f4929){if(_0x1f4929){return _0x1f4929?{'count':_0x580dd6,'rows':_0x1f4929}:null;}})[_0x0a9e('0x26')](respondWithResult(_0x242f23,null))[_0x0a9e('0x47')](handleError(_0x242f23,null));}; \ No newline at end of file +var _0xedd9=['end','json','count','offset','Content-Range','apply','save','update','then','destroy','get','error','stack','name','send','index','map','CmList','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','include','rows','catch','show','params','length','includeAll','find','create','body','user','role','Lists','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','getDispositions','Disposition','findAll','removeDispositions','addContacts','CmContact','tags','isArray','join','push','omit','ids','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','concat','cf_%d','raw','getContactsCsv','CustomFields','format','isEmpty','now','writeFileSync','setHeader','Content-disposition','list_%d_%s.csv','Content-type','download','/tmp/list_%d_%s.csv','addCustomField','addCustomFields','Sequelize','TEXT','text','number','INTEGER','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','findOne','findAndCountAll','addAgents','spread','userCmList:save','removeAgents','emit','userCmList:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status'];(function(_0xdc9e46,_0x47d0af){var _0x51f79a=function(_0x188237){while(--_0x188237){_0xdc9e46['push'](_0xdc9e46['shift']());}};_0x51f79a(++_0x47d0af);}(_0xedd9,0xfc));var _0x9edd=function(_0x4561b5,_0x16fab1){_0x4561b5=_0x4561b5-0x0;var _0x966cdc=_0xedd9[_0x4561b5];return _0x966cdc;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9edd('0x0'));var rimraf=require(_0x9edd('0x1'));var zipdir=require(_0x9edd('0x2'));var jsonpatch=require(_0x9edd('0x3'));var rp=require(_0x9edd('0x4'));var moment=require(_0x9edd('0x5'));var BPromise=require(_0x9edd('0x6'));var Mustache=require(_0x9edd('0x7'));var util=require('util');var path=require(_0x9edd('0x8'));var sox=require(_0x9edd('0x9'));var csv=require(_0x9edd('0xa'));var ejs=require(_0x9edd('0xb'));var fs=require('fs');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('0xa'));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 db=require(_0x9edd('0x16'))['db'];config[_0x9edd('0x17')]=_[_0x9edd('0x18')](config[_0x9edd('0x17')],{'host':_0x9edd('0x19'),'port':0x18eb});var socket=require(_0x9edd('0x1a'))(new Redis(config[_0x9edd('0x17')]));require('./cmList.socket')[_0x9edd('0x1b')](socket);function respondWithStatusCode(_0x44fc7c,_0x891832){_0x891832=_0x891832||0xcc;return function(_0x4d9a7){if(_0x4d9a7){return _0x44fc7c[_0x9edd('0x1c')](_0x891832);}return _0x44fc7c[_0x9edd('0x1d')](_0x891832)[_0x9edd('0x1e')]();};}function respondWithResult(_0x75a4ab,_0x4ea60f){_0x4ea60f=_0x4ea60f||0xc8;return function(_0x5f5bf4){if(_0x5f5bf4){return _0x75a4ab[_0x9edd('0x1d')](_0x4ea60f)[_0x9edd('0x1f')](_0x5f5bf4);}};}function respondWithFilteredResult(_0x5acf65,_0x1b54c0){return function(_0x35f454){if(_0x35f454){var _0x40ba32=_0x35f454[_0x9edd('0x20')],_0x4d8f33=_0x1b54c0[_0x9edd('0x21')],_0x43dc70=_0x1b54c0['offset']+_0x1b54c0['limit'],_0x5d879c;if(_0x43dc70>=_0x40ba32){_0x43dc70=_0x40ba32;_0x5d879c=0xc8;}else{_0x5d879c=0xce;}_0x5acf65[_0x9edd('0x1d')](_0x5d879c);return _0x5acf65['set'](_0x9edd('0x22'),_0x4d8f33+'-'+_0x43dc70+'/'+_0x40ba32)['json'](_0x35f454);}return null;};}function patchUpdates(_0x535f37){return function(_0x356751){try{jsonpatch[_0x9edd('0x23')](_0x356751,_0x535f37,!![]);}catch(_0x4fb7bf){return BPromise['reject'](_0x4fb7bf);}return _0x356751[_0x9edd('0x24')]();};}function saveUpdates(_0x186186,_0x477878){return function(_0x542172){if(_0x542172){return _0x542172[_0x9edd('0x25')](_0x186186)[_0x9edd('0x26')](function(_0x44a6c1){return _0x44a6c1;});}return null;};}function removeEntity(_0x2ca65f,_0x339a0d){return function(_0x4c75d2){if(_0x4c75d2){return _0x4c75d2[_0x9edd('0x27')]()[_0x9edd('0x26')](function(){var _0x3a1ea5=_0x4c75d2[_0x9edd('0x28')]({'plain':!![]});var _0x310a4d='Lists';return db['UserProfileResource'][_0x9edd('0x27')]({'where':{'type':_0x310a4d,'resourceId':_0x3a1ea5['id']}})[_0x9edd('0x26')](function(){return _0x4c75d2;});})[_0x9edd('0x26')](function(){_0x2ca65f[_0x9edd('0x1d')](0xcc)[_0x9edd('0x1e')]();});}};}function handleEntityNotFound(_0x4fe471,_0x57a2cc){return function(_0x214d0a){if(!_0x214d0a){_0x4fe471[_0x9edd('0x1c')](0x194);}return _0x214d0a;};}function handleError(_0x1c762c,_0x52746a){_0x52746a=_0x52746a||0x1f4;return function(_0x238b22){logger[_0x9edd('0x29')](_0x238b22[_0x9edd('0x2a')]);if(_0x238b22[_0x9edd('0x2b')]){delete _0x238b22['name'];}_0x1c762c[_0x9edd('0x1d')](_0x52746a)[_0x9edd('0x2c')](_0x238b22);};}exports[_0x9edd('0x2d')]=function(_0x12c1bc,_0xbbf08f){var _0x42e664={},_0x209aba={},_0x1fba7b={'count':0x0,'rows':[]};var _0x19b6c1=_[_0x9edd('0x2e')](db[_0x9edd('0x2f')][_0x9edd('0x30')],function(_0x6907a5){return{'name':_0x6907a5[_0x9edd('0x31')],'type':_0x6907a5[_0x9edd('0x32')]['key']};});_0x209aba[_0x9edd('0x33')]=_[_0x9edd('0x2e')](_0x19b6c1,_0x9edd('0x2b'));_0x209aba['query']=_[_0x9edd('0x34')](_0x12c1bc[_0x9edd('0x35')]);_0x209aba[_0x9edd('0x36')]=_[_0x9edd('0x37')](_0x209aba[_0x9edd('0x33')],_0x209aba[_0x9edd('0x35')]);_0x42e664[_0x9edd('0x38')]=_[_0x9edd('0x37')](_0x209aba[_0x9edd('0x33')],qs[_0x9edd('0x39')](_0x12c1bc[_0x9edd('0x35')][_0x9edd('0x39')]));_0x42e664[_0x9edd('0x38')]=_0x42e664[_0x9edd('0x38')]['length']?_0x42e664[_0x9edd('0x38')]:_0x209aba['model'];if(!_0x12c1bc[_0x9edd('0x35')][_0x9edd('0x3a')](_0x9edd('0x3b'))){_0x42e664[_0x9edd('0x3c')]=qs[_0x9edd('0x3c')](_0x12c1bc['query'][_0x9edd('0x3c')]);_0x42e664[_0x9edd('0x21')]=qs[_0x9edd('0x21')](_0x12c1bc[_0x9edd('0x35')][_0x9edd('0x21')]);}_0x42e664[_0x9edd('0x3d')]=qs[_0x9edd('0x3e')](_0x12c1bc[_0x9edd('0x35')][_0x9edd('0x3e')]);_0x42e664[_0x9edd('0x3f')]=qs['filters'](_[_0x9edd('0x40')](_0x12c1bc['query'],_0x209aba[_0x9edd('0x36')]));if(_0x12c1bc['query'][_0x9edd('0x41')]){_0x42e664[_0x9edd('0x3f')]=_[_0x9edd('0x42')](_0x42e664['where'],{'$or':_[_0x9edd('0x2e')](_0x19b6c1,function(_0xcbd0ef){if(_0xcbd0ef[_0x9edd('0x32')]!=='VIRTUAL'){var _0x1b5a43={};_0x1b5a43[_0xcbd0ef['name']]={'$like':'%'+_0x12c1bc[_0x9edd('0x35')][_0x9edd('0x41')]+'%'};return _0x1b5a43;}})});}_0x42e664=_['merge']({},_0x42e664,_0x12c1bc[_0x9edd('0x43')]);var _0x40fdfb={'where':_0x42e664[_0x9edd('0x3f')]};return db[_0x9edd('0x2f')]['count'](_0x40fdfb)[_0x9edd('0x26')](function(_0x5bbdf8){_0x1fba7b[_0x9edd('0x20')]=_0x5bbdf8;if(_0x12c1bc[_0x9edd('0x35')]['includeAll']){_0x42e664[_0x9edd('0x44')]=[{'all':!![]}];}return db['CmList']['findAll'](_0x42e664);})[_0x9edd('0x26')](function(_0x9cab86){_0x1fba7b[_0x9edd('0x45')]=_0x9cab86;return _0x1fba7b;})[_0x9edd('0x26')](respondWithFilteredResult(_0xbbf08f,_0x42e664))[_0x9edd('0x46')](handleError(_0xbbf08f,null));};exports[_0x9edd('0x47')]=function(_0x3ff512,_0x75efbe){var _0x18c149={'raw':![],'where':{'id':_0x3ff512[_0x9edd('0x48')]['id']}},_0x2b081a={};_0x2b081a[_0x9edd('0x33')]=_[_0x9edd('0x34')](db[_0x9edd('0x2f')][_0x9edd('0x30')]);_0x2b081a['query']=_[_0x9edd('0x34')](_0x3ff512[_0x9edd('0x35')]);_0x2b081a[_0x9edd('0x36')]=_[_0x9edd('0x37')](_0x2b081a[_0x9edd('0x33')],_0x2b081a[_0x9edd('0x35')]);_0x18c149[_0x9edd('0x38')]=_['intersection'](_0x2b081a['model'],qs['fields'](_0x3ff512[_0x9edd('0x35')]['fields']));_0x18c149[_0x9edd('0x38')]=_0x18c149[_0x9edd('0x38')][_0x9edd('0x49')]?_0x18c149[_0x9edd('0x38')]:_0x2b081a[_0x9edd('0x33')];if(_0x3ff512['query'][_0x9edd('0x4a')]){_0x18c149[_0x9edd('0x44')]=[{'all':!![]}];}_0x18c149=_[_0x9edd('0x42')]({},_0x18c149,_0x3ff512['options']);return db[_0x9edd('0x2f')][_0x9edd('0x4b')](_0x18c149)[_0x9edd('0x26')](handleEntityNotFound(_0x75efbe,null))[_0x9edd('0x26')](respondWithResult(_0x75efbe,null))[_0x9edd('0x46')](handleError(_0x75efbe,null));};exports[_0x9edd('0x4c')]=function(_0x4d4f33,_0x441e4a){return db[_0x9edd('0x2f')]['create'](_0x4d4f33[_0x9edd('0x4d')],{})[_0x9edd('0x26')](function(_0x4bb324){var _0x2bd089=_0x4d4f33[_0x9edd('0x4e')][_0x9edd('0x28')]({'plain':!![]});if(!_0x2bd089)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2bd089[_0x9edd('0x4f')]===_0x9edd('0x4e')){var _0x317a60=_0x4bb324[_0x9edd('0x28')]({'plain':!![]});var _0x53f6e3=_0x9edd('0x50');return db[_0x9edd('0x51')][_0x9edd('0x4b')]({'where':{'name':_0x53f6e3,'userProfileId':_0x2bd089['userProfileId']},'raw':!![]})[_0x9edd('0x26')](function(_0x21f6ce){if(_0x21f6ce&&_0x21f6ce['autoAssociation']===0x0){return db[_0x9edd('0x52')]['create']({'name':_0x317a60[_0x9edd('0x2b')],'resourceId':_0x317a60['id'],'type':_0x21f6ce[_0x9edd('0x2b')],'sectionId':_0x21f6ce['id']},{})[_0x9edd('0x26')](function(){return _0x4bb324;});}else{return _0x4bb324;}})[_0x9edd('0x46')](function(_0x1e3c19){logger[_0x9edd('0x29')](_0x9edd('0x53'),_0x1e3c19);throw _0x1e3c19;});}return _0x4bb324;})[_0x9edd('0x26')](respondWithResult(_0x441e4a,0xc9))[_0x9edd('0x46')](handleError(_0x441e4a,null));};exports[_0x9edd('0x25')]=function(_0x31272d,_0x5a3b1d){if(_0x31272d[_0x9edd('0x4d')]['id']){delete _0x31272d[_0x9edd('0x4d')]['id'];}return db[_0x9edd('0x2f')]['find']({'where':{'id':_0x31272d[_0x9edd('0x48')]['id']}})['then'](handleEntityNotFound(_0x5a3b1d,null))['then'](saveUpdates(_0x31272d['body'],null))[_0x9edd('0x26')](respondWithResult(_0x5a3b1d,null))[_0x9edd('0x46')](handleError(_0x5a3b1d,null));};exports[_0x9edd('0x27')]=function(_0x35ddb3,_0x48a900){return db['CmList']['find']({'where':{'id':_0x35ddb3[_0x9edd('0x48')]['id']}})[_0x9edd('0x26')](handleEntityNotFound(_0x48a900,null))[_0x9edd('0x26')](removeEntity(_0x48a900,null))[_0x9edd('0x46')](handleError(_0x48a900,null));};exports[_0x9edd('0x54')]=function(_0x41ec97,_0x25906c){return db[_0x9edd('0x2f')]['describe']()[_0x9edd('0x26')](respondWithResult(_0x25906c,null))['catch'](handleError(_0x25906c,null));};exports[_0x9edd('0x55')]=function(_0x6a1cfc,_0x4b7e68,_0x22b91a){if(_0x6a1cfc[_0x9edd('0x4d')]['id']){delete _0x6a1cfc[_0x9edd('0x4d')]['id'];}return db['CmList'][_0x9edd('0x4b')]({'where':{'id':_0x6a1cfc[_0x9edd('0x48')]['id']}})[_0x9edd('0x26')](handleEntityNotFound(_0x4b7e68,null))[_0x9edd('0x26')](function(_0x1720b1){if(_0x1720b1){_0x6a1cfc[_0x9edd('0x4d')]['ListId']=_0x1720b1['id'];return db['Disposition'][_0x9edd('0x4c')](_0x6a1cfc['body']);}})[_0x9edd('0x26')](respondWithResult(_0x4b7e68,null))[_0x9edd('0x46')](handleError(_0x4b7e68,null));};exports[_0x9edd('0x56')]=function(_0x17d2f2,_0x5df1d7,_0x21ead2){var _0x507cce={'raw':![],'where':{}};var _0x3e5dca={};var _0x344692={'count':0x0,'rows':[]};return db[_0x9edd('0x2f')]['findOne']({'where':{'id':_0x17d2f2[_0x9edd('0x48')]['id']}})['then'](handleEntityNotFound(_0x5df1d7,null))[_0x9edd('0x26')](function(_0x4e1eda){if(_0x4e1eda){_0x3e5dca['model']=_[_0x9edd('0x34')](db['Disposition'][_0x9edd('0x30')]);_0x3e5dca[_0x9edd('0x35')]=_[_0x9edd('0x34')](_0x17d2f2['query']);_0x3e5dca[_0x9edd('0x36')]=_[_0x9edd('0x37')](_0x3e5dca[_0x9edd('0x33')],_0x3e5dca[_0x9edd('0x35')]);_0x507cce[_0x9edd('0x38')]=_['intersection'](_0x3e5dca['model'],qs[_0x9edd('0x39')](_0x17d2f2[_0x9edd('0x35')]['fields']));_0x507cce['attributes']=_0x507cce['attributes'][_0x9edd('0x49')]?_0x507cce['attributes']:_0x3e5dca['model'];if(!_0x17d2f2[_0x9edd('0x35')][_0x9edd('0x3a')]('nolimit')){_0x507cce[_0x9edd('0x3c')]=qs[_0x9edd('0x3c')](_0x17d2f2[_0x9edd('0x35')]['limit']);_0x507cce[_0x9edd('0x21')]=qs['offset'](_0x17d2f2[_0x9edd('0x35')][_0x9edd('0x21')]);}_0x507cce['order']=qs[_0x9edd('0x3e')](_0x17d2f2[_0x9edd('0x35')]['sort']);_0x507cce[_0x9edd('0x3f')]=qs[_0x9edd('0x36')](_[_0x9edd('0x40')](_0x17d2f2[_0x9edd('0x35')],_0x3e5dca['filters']));_0x507cce[_0x9edd('0x3f')]['ListId']=_0x4e1eda['id'];if(_0x17d2f2[_0x9edd('0x35')][_0x9edd('0x41')]){_0x507cce[_0x9edd('0x3f')]=_['merge'](_0x507cce[_0x9edd('0x3f')],{'$or':_[_0x9edd('0x2e')](_0x507cce[_0x9edd('0x38')],function(_0x383cb9){var _0x25626a={};_0x25626a[_0x383cb9]={'$like':'%'+_0x17d2f2[_0x9edd('0x35')][_0x9edd('0x41')]+'%'};return _0x25626a;})});}_0x507cce=_['merge']({},_0x507cce,_0x17d2f2['options']);return db[_0x9edd('0x57')][_0x9edd('0x20')]({'where':_0x507cce[_0x9edd('0x3f')]})[_0x9edd('0x26')](function(_0x1e2126){_0x344692['count']=_0x1e2126;if(_0x17d2f2[_0x9edd('0x35')][_0x9edd('0x4a')]){_0x507cce[_0x9edd('0x44')]=[{'all':!![]}];}return db['Disposition'][_0x9edd('0x58')](_0x507cce);})[_0x9edd('0x26')](function(_0x4b1c12){_0x344692[_0x9edd('0x45')]=_0x4b1c12;return _0x344692;});}})[_0x9edd('0x26')](respondWithFilteredResult(_0x5df1d7,_0x507cce))['catch'](handleError(_0x5df1d7,null));};exports[_0x9edd('0x59')]=function(_0x1e2de6,_0x566be7,_0x3f08ac){return db['CmList']['find']({'where':{'id':_0x1e2de6[_0x9edd('0x48')]['id']}})[_0x9edd('0x26')](handleEntityNotFound(_0x566be7,null))[_0x9edd('0x26')](function(_0x5b56c7){if(_0x5b56c7){return _0x5b56c7[_0x9edd('0x59')](_0x1e2de6[_0x9edd('0x35')]['ids']);}})[_0x9edd('0x26')](respondWithStatusCode(_0x566be7,null))[_0x9edd('0x46')](handleError(_0x566be7,null));};exports[_0x9edd('0x5a')]=function(_0x1ad198,_0x54ac71,_0x5e68db){return db[_0x9edd('0x2f')]['find']({'where':{'id':_0x1ad198[_0x9edd('0x48')]['id']}})[_0x9edd('0x26')](handleEntityNotFound(_0x54ac71,null))[_0x9edd('0x26')](function(_0x3cfd35){if(_0x3cfd35){var _0x195921=[];var _0x4786f8={'success':[],'errors':[]};return db[_0x9edd('0x5b')][_0x9edd('0x54')]()[_0x9edd('0x26')](function(_0x554241){if(_0x1ad198[_0x9edd('0x4d')][_0x9edd('0x5c')]&&_[_0x9edd('0x5d')](_0x1ad198[_0x9edd('0x4d')][_0x9edd('0x5c')])){if(_0x1ad198[_0x9edd('0x4d')][_0x9edd('0x5c')]['length']){_0x1ad198[_0x9edd('0x4d')][_0x9edd('0x5c')]=_0x1ad198['body'][_0x9edd('0x5c')][_0x9edd('0x5e')](';')+';';}else{_0x1ad198['body'][_0x9edd('0x5c')]=null;}}else{_0x1ad198[_0x9edd('0x4d')][_0x9edd('0x5c')]=null;}if(_0x1ad198['body']&&_[_0x9edd('0x5d')](_0x1ad198[_0x9edd('0x4d')])){for(var _0x3f04d3=0x0;_0x3f04d3<_0x1ad198['body']['length'];_0x3f04d3+=0x1){_0x1ad198['body'][_0x3f04d3]['ListId']=_0x1ad198[_0x9edd('0x48')]['id'];_0x195921[_0x9edd('0x5f')](_0x1ad198[_0x9edd('0x4d')][_0x3f04d3]);}return BPromise['each'](_0x195921,function(_0x53e141){return db['CmContact'][_0x9edd('0x4c')](_[_0x9edd('0x60')](_0x53e141,[_0x9edd('0x61'),'id'])||{},{'fields':_[_0x9edd('0x34')](_0x554241),'raw':!![]})[_0x9edd('0x26')](function(_0x18b25e){_0x4786f8[_0x9edd('0x62')][_0x9edd('0x5f')](_0x18b25e[_0x9edd('0x63')]);})[_0x9edd('0x46')](function(_0x2523b5){_0x4786f8[_0x9edd('0x64')]['push']({'data':_0x53e141,'error':_0x2523b5[_0x9edd('0x65')]});});})[_0x9edd('0x26')](function(_0x33b5dc){return _0x4786f8;})[_0x9edd('0x46')](function(_0x104afc){return _0x104afc;});}else{_0x54ac71[_0x9edd('0x1d')](0x190)[_0x9edd('0x1f')]({'message':_0x9edd('0x66')});}});}})['then'](respondWithResult(_0x54ac71,null))['catch'](handleError(_0x54ac71,null));};exports[_0x9edd('0x67')]=function(_0x4ec836,_0x35950b,_0x4a685e){var _0x21c35f;return db[_0x9edd('0x2f')]['find']({'where':{'id':_0x4ec836[_0x9edd('0x48')]['id']},'include':[{'model':db[_0x9edd('0x68')],'as':'CustomFields'}]})[_0x9edd('0x26')](handleEntityNotFound(_0x35950b,null))[_0x9edd('0x26')](function(_0x42d546){if(_0x42d546){_0x21c35f=_0x42d546;return db[_0x9edd('0x5b')][_0x9edd('0x30')];}})['then'](function(_0x33a077){if(_0x33a077){var _0x3ff07e={};var _0x3ec531={};_0x3ec531[_0x9edd('0x33')]=_[_0x9edd('0x69')](_['keys'](_0x33a077),_['map'](_0x21c35f['CustomFields'],function(_0x50316a){return util['format'](_0x9edd('0x6a'),_0x50316a['id']);}));_0x3ec531['query']=_['keys'](_0x4ec836[_0x9edd('0x35')]);_0x3ec531[_0x9edd('0x36')]=_[_0x9edd('0x37')](_0x3ec531[_0x9edd('0x33')],_0x3ec531[_0x9edd('0x35')]);_0x3ff07e[_0x9edd('0x38')]=_[_0x9edd('0x37')](_0x3ec531[_0x9edd('0x33')],qs[_0x9edd('0x39')](_0x4ec836[_0x9edd('0x35')]['fields']));_0x3ff07e[_0x9edd('0x38')]=_0x3ff07e[_0x9edd('0x38')][_0x9edd('0x49')]?_0x3ff07e[_0x9edd('0x38')]:_0x3ec531[_0x9edd('0x33')];if(!_0x4ec836[_0x9edd('0x35')][_0x9edd('0x3a')](_0x9edd('0x3b'))){_0x3ff07e['limit']=qs['limit'](_0x4ec836[_0x9edd('0x35')][_0x9edd('0x3c')]);_0x3ff07e[_0x9edd('0x21')]=qs[_0x9edd('0x21')](_0x4ec836[_0x9edd('0x35')][_0x9edd('0x21')]);}_0x3ff07e[_0x9edd('0x3d')]=qs[_0x9edd('0x3e')](_0x4ec836[_0x9edd('0x35')][_0x9edd('0x3e')]);_0x3ff07e[_0x9edd('0x3f')]=qs[_0x9edd('0x36')](_[_0x9edd('0x40')](_0x4ec836[_0x9edd('0x35')],_0x3ec531['filters']));_0x3ff07e[_0x9edd('0x6b')]=!![];if(_0x4ec836[_0x9edd('0x35')]['filter']){_0x3ff07e[_0x9edd('0x3f')]=_[_0x9edd('0x42')](_0x3ff07e[_0x9edd('0x3f')],{'$or':_[_0x9edd('0x2e')](_0x3ff07e['attributes'],function(_0x3429b6){var _0x398c34={};_0x398c34[_0x3429b6]={'$like':'%'+_0x4ec836[_0x9edd('0x35')][_0x9edd('0x41')]+'%'};return _0x398c34;})});}_0x3ff07e=_[_0x9edd('0x42')]({},_0x3ff07e,_0x4ec836['options']);return _0x21c35f[_0x9edd('0x67')](_0x3ff07e);}})[_0x9edd('0x26')](respondWithResult(_0x35950b,null))[_0x9edd('0x46')](handleError(_0x35950b,null));};exports[_0x9edd('0x6c')]=function(_0xa8d944,_0x59927d,_0x4d0734){var _0x2f8ce1;return db['CmList'][_0x9edd('0x4b')]({'where':{'id':_0xa8d944['params']['id']},'include':[{'model':db[_0x9edd('0x68')],'as':_0x9edd('0x6d')}]})[_0x9edd('0x26')](handleEntityNotFound(_0x59927d,null))[_0x9edd('0x26')](function(_0x2c7245){if(_0x2c7245){_0x2f8ce1=_0x2c7245;return db[_0x9edd('0x5b')]['rawAttributes'];}})[_0x9edd('0x26')](function(_0x33beb7){if(_0x33beb7){var _0x3aae72={};var _0x39d6dd={};_0x39d6dd[_0x9edd('0x33')]=_[_0x9edd('0x69')](_[_0x9edd('0x34')](_0x33beb7),_[_0x9edd('0x2e')](_0x2f8ce1['CustomFields'],function(_0x195088){return util[_0x9edd('0x6e')](_0x9edd('0x6a'),_0x195088['id']);}));_0x39d6dd[_0x9edd('0x35')]=_[_0x9edd('0x34')](_0xa8d944[_0x9edd('0x35')]);_0x39d6dd[_0x9edd('0x36')]=_[_0x9edd('0x37')](_0x39d6dd[_0x9edd('0x33')],_0x39d6dd[_0x9edd('0x35')]);_0x3aae72[_0x9edd('0x38')]=_[_0x9edd('0x37')](_0x39d6dd[_0x9edd('0x33')],qs[_0x9edd('0x39')](_0xa8d944[_0x9edd('0x35')][_0x9edd('0x39')]));_0x3aae72[_0x9edd('0x38')]=_0x3aae72[_0x9edd('0x38')][_0x9edd('0x49')]?_0x3aae72[_0x9edd('0x38')]:_0x39d6dd[_0x9edd('0x33')];if(!_0xa8d944['query'][_0x9edd('0x3a')]('nolimit')){_0x3aae72['limit']=qs[_0x9edd('0x3c')](_0xa8d944[_0x9edd('0x35')][_0x9edd('0x3c')]);_0x3aae72[_0x9edd('0x21')]=qs[_0x9edd('0x21')](_0xa8d944[_0x9edd('0x35')][_0x9edd('0x21')]);}_0x3aae72[_0x9edd('0x3d')]=qs[_0x9edd('0x3e')](_0xa8d944[_0x9edd('0x35')]['sort']);_0x3aae72[_0x9edd('0x3f')]=qs[_0x9edd('0x36')](_['pick'](_0xa8d944['query'],_0x39d6dd[_0x9edd('0x36')]));_0x3aae72[_0x9edd('0x6b')]=!![];if(_0xa8d944[_0x9edd('0x35')][_0x9edd('0x41')]){_0x3aae72['where']=_['merge'](_0x3aae72[_0x9edd('0x3f')],{'$or':_['map'](_0x3aae72[_0x9edd('0x38')],function(_0x24a9d1){var _0x3e2404={};_0x3e2404[_0x24a9d1]={'$like':'%'+_0xa8d944['query']['filter']+'%'};return _0x3e2404;})});}_0x3aae72=_['merge']({},_0x3aae72,_0xa8d944[_0x9edd('0x43')]);return _0x2f8ce1[_0x9edd('0x67')](_0x3aae72);}})[_0x9edd('0x26')](function(_0x5bfbfd){if(!_[_0x9edd('0x6f')](_0x5bfbfd)){var _0x402574=toCsv(_0x5bfbfd);var _0x4f12b9=Date[_0x9edd('0x70')]();fs[_0x9edd('0x71')](util['format']('/tmp/list_%d_%s.csv',_0x2f8ce1['id'],_0x4f12b9),_0x402574);_0x59927d[_0x9edd('0x72')](_0x9edd('0x73'),'attachment;\x20filename='+util[_0x9edd('0x6e')](_0x9edd('0x74'),_0x2f8ce1['id'],_0x4f12b9));_0x59927d['setHeader'](_0x9edd('0x75'),'text/csv');return _0x59927d[_0x9edd('0x76')](util[_0x9edd('0x6e')](_0x9edd('0x77'),_0x2f8ce1['id'],_0x4f12b9));}else{return _0x59927d[_0x9edd('0x1c')](0xcc);}})[_0x9edd('0x46')](handleError(_0x59927d,null));};exports[_0x9edd('0x78')]=function(_0x58bc3c,_0x2fe810,_0x22aa2b){var _0x68047e;delete _0x58bc3c['body']['id'];return db[_0x9edd('0x2f')]['findOne']({'where':{'id':_0x58bc3c[_0x9edd('0x48')]['id']}})[_0x9edd('0x26')](handleEntityNotFound(_0x2fe810,null))[_0x9edd('0x26')](function(_0x41b0ea){if(_0x41b0ea){return db['sequelize']['transaction'](function(_0x4e9242){return db[_0x9edd('0x68')][_0x9edd('0x4c')](_0x58bc3c[_0x9edd('0x4d')],{'transaction':_0x4e9242})['then'](function(_0x41a761){_0x68047e=_0x41a761;return _0x41b0ea[_0x9edd('0x79')](_0x41a761,{'transaction':_0x4e9242});})[_0x9edd('0x26')](function(){var _0xb66eaf={'type':db[_0x9edd('0x7a')][_0x9edd('0x7b')],'transaction':_0x4e9242};switch(_0x58bc3c['body']['type']){case _0x9edd('0x7c'):_0xb66eaf[_0x9edd('0x32')]=db[_0x9edd('0x7a')]['TEXT'];break;case _0x9edd('0x7d'):_0xb66eaf[_0x9edd('0x32')]=db[_0x9edd('0x7a')][_0x9edd('0x7e')];break;case'switch':_0xb66eaf[_0x9edd('0x32')]=db['Sequelize'][_0x9edd('0x7f')];_0xb66eaf[_0x9edd('0x80')]=![];break;default:}return db[_0x9edd('0x81')][_0x9edd('0x82')][_0x9edd('0x83')]('cm_contacts',util[_0x9edd('0x6e')]('cf_%s',_0x68047e['id']),_0xb66eaf);})[_0x9edd('0x26')](function(){return _0x68047e;});});}})['then'](respondWithResult(_0x2fe810,null))[_0x9edd('0x46')](handleError(_0x2fe810,null));};exports['getCustomFields']=function(_0x363c5c,_0x96e3d7,_0x3bc495){var _0x575377={};var _0x244dce={};var _0x7512ea;var _0x1c5038;return db[_0x9edd('0x2f')][_0x9edd('0x84')]({'where':{'id':_0x363c5c[_0x9edd('0x48')]['id']}})[_0x9edd('0x26')](handleEntityNotFound(_0x96e3d7,null))[_0x9edd('0x26')](function(_0x365b27){if(_0x365b27){_0x7512ea=_0x365b27;_0x244dce[_0x9edd('0x33')]=_[_0x9edd('0x34')](db[_0x9edd('0x68')][_0x9edd('0x30')]);_0x244dce[_0x9edd('0x35')]=_[_0x9edd('0x34')](_0x363c5c[_0x9edd('0x35')]);_0x244dce[_0x9edd('0x36')]=_[_0x9edd('0x37')](_0x244dce[_0x9edd('0x33')],_0x244dce[_0x9edd('0x35')]);_0x575377[_0x9edd('0x38')]=_[_0x9edd('0x37')](_0x244dce['model'],qs[_0x9edd('0x39')](_0x363c5c['query'][_0x9edd('0x39')]));_0x575377[_0x9edd('0x38')]=_0x575377[_0x9edd('0x38')][_0x9edd('0x49')]?_0x575377[_0x9edd('0x38')]:_0x244dce['model'];_0x575377[_0x9edd('0x3d')]=qs['sort'](_0x363c5c[_0x9edd('0x35')][_0x9edd('0x3e')]);_0x575377[_0x9edd('0x3f')]=qs[_0x9edd('0x36')](_[_0x9edd('0x40')](_0x363c5c[_0x9edd('0x35')],_0x244dce['filters']));_0x575377[_0x9edd('0x3f')]=_[_0x9edd('0x42')](_0x575377['where'],{'$or':[{'ListId':_0x365b27['id']},{'ListId':null}]});if(_0x363c5c['query']['filter']){_0x575377['where']=_[_0x9edd('0x42')](_0x575377[_0x9edd('0x3f')],{'$or':_[_0x9edd('0x2e')](_0x575377[_0x9edd('0x38')],function(_0x239774){var _0x229a92={};_0x229a92[_0x239774]={'$like':'%'+_0x363c5c[_0x9edd('0x35')][_0x9edd('0x41')]+'%'};return _0x229a92;})});}_0x575377=_[_0x9edd('0x42')]({},_0x575377,_0x363c5c[_0x9edd('0x43')]);return db['CmCustomField'][_0x9edd('0x85')](_0x575377);}})['then'](respondWithResult(_0x96e3d7,null))['catch'](handleError(_0x96e3d7,null));};exports[_0x9edd('0x86')]=function(_0x2dafd2,_0x35e9b9,_0x42a142){return db[_0x9edd('0x2f')]['find']({'where':{'id':_0x2dafd2[_0x9edd('0x48')]['id']}})[_0x9edd('0x26')](handleEntityNotFound(_0x35e9b9,null))[_0x9edd('0x26')](function(_0x181469){if(_0x181469){return _0x181469['addAgents'](_0x2dafd2[_0x9edd('0x4d')][_0x9edd('0x61')],_[_0x9edd('0x60')](_0x2dafd2[_0x9edd('0x4d')],[_0x9edd('0x61'),'id'])||{})[_0x9edd('0x87')](function(_0x55052b){for(var _0x9ff2d3=0x0;_0x9ff2d3<_0x2dafd2[_0x9edd('0x4d')][_0x9edd('0x61')][_0x9edd('0x49')];_0x9ff2d3+=0x1){socket['emit'](_0x9edd('0x88'),{'UserId':_0x2dafd2[_0x9edd('0x4d')][_0x9edd('0x61')][_0x9ff2d3],'CmListId':_0x2dafd2[_0x9edd('0x48')]['id']});}return _0x55052b;});}})[_0x9edd('0x26')](respondWithResult(_0x35e9b9,null))[_0x9edd('0x46')](handleError(_0x35e9b9,null));};exports[_0x9edd('0x89')]=function(_0x39e3b3,_0x4a3955,_0x4a19a0){return db['CmList'][_0x9edd('0x4b')]({'where':{'id':_0x39e3b3[_0x9edd('0x48')]['id']}})[_0x9edd('0x26')](handleEntityNotFound(_0x4a3955,null))[_0x9edd('0x26')](function(_0x223c42){if(_0x223c42){return _0x223c42[_0x9edd('0x89')](_0x39e3b3[_0x9edd('0x35')][_0x9edd('0x61')])[_0x9edd('0x26')](function(){if(_[_0x9edd('0x5d')](_0x39e3b3['query'][_0x9edd('0x61')])){for(var _0x56dc7e=0x0;_0x56dc7e<_0x39e3b3['query'][_0x9edd('0x61')][_0x9edd('0x49')];_0x56dc7e+=0x1){socket[_0x9edd('0x8a')]('userCmList:remove',{'UserId':Number(_0x39e3b3['query']['ids'][_0x56dc7e]),'CmListId':Number(_0x39e3b3['params']['id'])});}}else{socket['emit'](_0x9edd('0x8b'),{'UserId':Number(_0x39e3b3[_0x9edd('0x35')][_0x9edd('0x61')]),'CmListId':Number(_0x39e3b3['params']['id'])});}});}})[_0x9edd('0x26')](respondWithStatusCode(_0x4a3955,null))[_0x9edd('0x46')](handleError(_0x4a3955,null));};exports[_0x9edd('0x8c')]=function(_0x557156,_0x2c2f00,_0x4afe0b){var _0x16a1c8={};var _0x1a2376={};var _0xc84fb7;var _0x259d33;return db['CmList'][_0x9edd('0x84')]({'where':{'id':_0x557156[_0x9edd('0x48')]['id']}})['then'](handleEntityNotFound(_0x2c2f00,null))[_0x9edd('0x26')](function(_0x36e825){if(_0x36e825){_0xc84fb7=_0x36e825;_0x1a2376[_0x9edd('0x33')]=_[_0x9edd('0x34')](db['User'][_0x9edd('0x30')]);_0x1a2376[_0x9edd('0x35')]=_[_0x9edd('0x34')](_0x557156[_0x9edd('0x35')]);_0x1a2376[_0x9edd('0x36')]=_[_0x9edd('0x37')](_0x1a2376[_0x9edd('0x33')],_0x1a2376['query']);_0x16a1c8[_0x9edd('0x38')]=_['intersection'](_0x1a2376[_0x9edd('0x33')],qs[_0x9edd('0x39')](_0x557156['query'][_0x9edd('0x39')]));_0x16a1c8[_0x9edd('0x38')]=_0x16a1c8[_0x9edd('0x38')]['length']?_0x16a1c8[_0x9edd('0x38')]:_0x1a2376[_0x9edd('0x33')];_0x16a1c8[_0x9edd('0x3d')]=qs['sort'](_0x557156[_0x9edd('0x35')]['sort']);_0x16a1c8[_0x9edd('0x3f')]=qs[_0x9edd('0x36')](_[_0x9edd('0x40')](_0x557156[_0x9edd('0x35')],_0x1a2376['filters']));if(_0x557156['query'][_0x9edd('0x41')]){_0x16a1c8[_0x9edd('0x3f')]=_[_0x9edd('0x42')](_0x16a1c8[_0x9edd('0x3f')],{'$or':_[_0x9edd('0x2e')](_0x16a1c8['attributes'],function(_0x1a1938){var _0x235762={};_0x235762[_0x1a1938]={'$like':'%'+_0x557156[_0x9edd('0x35')][_0x9edd('0x41')]+'%'};return _0x235762;})});}_0x16a1c8=_[_0x9edd('0x42')]({},_0x16a1c8,_0x557156[_0x9edd('0x43')]);return _0xc84fb7[_0x9edd('0x8c')](_0x16a1c8);}})[_0x9edd('0x26')](function(_0x3173fa){if(_0x3173fa){_0x259d33=_0x3173fa[_0x9edd('0x49')];if(!_0x557156[_0x9edd('0x35')][_0x9edd('0x3a')](_0x9edd('0x3b'))){_0x16a1c8['limit']=qs[_0x9edd('0x3c')](_0x557156[_0x9edd('0x35')][_0x9edd('0x3c')]);_0x16a1c8[_0x9edd('0x21')]=qs['offset'](_0x557156[_0x9edd('0x35')][_0x9edd('0x21')]);}return _0xc84fb7[_0x9edd('0x8c')](_0x16a1c8);}})['then'](function(_0x910adf){if(_0x910adf){return _0x910adf?{'count':_0x259d33,'rows':_0x910adf}:null;}})['then'](respondWithResult(_0x2c2f00,null))['catch'](handleError(_0x2c2f00,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index cd174e6..005723a 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 _0x5954=['save','update','remove','emit','hook','events','../../mysqldb','setMaxListeners'];(function(_0x5e6a4f,_0x19cbcc){var _0x3073b7=function(_0x302af3){while(--_0x302af3){_0x5e6a4f['push'](_0x5e6a4f['shift']());}};_0x3073b7(++_0x19cbcc);}(_0x5954,0x95));var _0x4595=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x5954[_0x42cae2];return _0x5f256f;};'use strict';var EventEmitter=require(_0x4595('0x0'));var CmList=require(_0x4595('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0x4595('0x2')](0x0);var events={'afterCreate':_0x4595('0x3'),'afterUpdate':_0x4595('0x4'),'afterDestroy':_0x4595('0x5')};function emitEvent(_0x369024){return function(_0x11ecb6,_0x15e149,_0x11bd50){CmListEvents['emit'](_0x369024+':'+_0x11ecb6['id'],_0x11ecb6);CmListEvents[_0x4595('0x6')](_0x369024,_0x11ecb6);_0x11bd50(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x4595('0x7')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file +var _0xe07c=['remove','emit','hook','exports','events','../../mysqldb','setMaxListeners','update'];(function(_0x51639a,_0x35f006){var _0x3abae4=function(_0x89b35e){while(--_0x89b35e){_0x51639a['push'](_0x51639a['shift']());}};_0x3abae4(++_0x35f006);}(_0xe07c,0x1ec));var _0xce07=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xe07c[_0x25e7cb];return _0x375d92;};'use strict';var EventEmitter=require(_0xce07('0x0'));var CmList=require(_0xce07('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0xce07('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xce07('0x3'),'afterDestroy':_0xce07('0x4')};function emitEvent(_0x26ba53){return function(_0x4108c8,_0x4a683e,_0x1fca11){CmListEvents['emit'](_0x26ba53+':'+_0x4108c8['id'],_0x4108c8);CmListEvents[_0xce07('0x5')](_0x26ba53,_0x4108c8);_0x1fca11(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xce07('0x6')](e,emitEvent(event));}}module[_0xce07('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 30681b0..6d6b23c 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 _0x4aff=['exports','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes'];(function(_0x2a7b50,_0x545d55){var _0x4224c9=function(_0x2b96f6){while(--_0x2b96f6){_0x2a7b50['push'](_0x2a7b50['shift']());}};_0x4224c9(++_0x545d55);}(_0x4aff,0x9b));var _0xf4af=function(_0x1fb6ff,_0x474709){_0x1fb6ff=_0x1fb6ff-0x0;var _0x339f61=_0x4aff[_0x1fb6ff];return _0x339f61;};'use strict';var _=require(_0xf4af('0x0'));var util=require(_0xf4af('0x1'));var logger=require(_0xf4af('0x2'))('api');var moment=require(_0xf4af('0x3'));var BPromise=require(_0xf4af('0x4'));var rp=require(_0xf4af('0x5'));var fs=require('fs');var path=require(_0xf4af('0x6'));var rimraf=require(_0xf4af('0x7'));var config=require(_0xf4af('0x8'));var attributes=require(_0xf4af('0x9'));module[_0xf4af('0xa')]=function(_0x262fd5,_0x4ece9f){return _0x262fd5['define']('CmList',attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa7e4=['exports','define','cm_lists','lodash','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x327e44,_0x5c0af8){var _0x4dd23b=function(_0x5a22e9){while(--_0x5a22e9){_0x327e44['push'](_0x327e44['shift']());}};_0x4dd23b(++_0x5c0af8);}(_0xa7e4,0x19d));var _0x4a7e=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xa7e4[_0x565ed7];return _0x183ad7;};'use strict';var _=require(_0x4a7e('0x0'));var util=require('util');var logger=require(_0x4a7e('0x1'))(_0x4a7e('0x2'));var moment=require(_0x4a7e('0x3'));var BPromise=require('bluebird');var rp=require(_0x4a7e('0x4'));var fs=require('fs');var path=require(_0x4a7e('0x5'));var rimraf=require(_0x4a7e('0x6'));var config=require('../../config/environment');var attributes=require('./cmList.attributes');module[_0x4a7e('0x7')]=function(_0x52c219,_0x3be72b){return _0x52c219[_0x4a7e('0x8')]('CmList',attributes,{'tableName':_0x4a7e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 0218641..1bce8ab 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 _0xd02d=['error','code','CmList,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./cmList.socket','register','then','info','request\x20sent','debug','stringify'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xd02d,0xf8));var _0xdd02=function(_0x203112,_0x27050b){_0x203112=_0x203112-0x0;var _0x112c74=_0xd02d[_0x203112];return _0x112c74;};'use strict';var _=require(_0xdd02('0x0'));var util=require(_0xdd02('0x1'));var moment=require(_0xdd02('0x2'));var BPromise=require(_0xdd02('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdd02('0x4'));var db=require(_0xdd02('0x5'))['db'];var utils=require(_0xdd02('0x6'));var logger=require(_0xdd02('0x7'))(_0xdd02('0x8'));var config=require('../../config/environment');var jayson=require(_0xdd02('0x9'));var client=jayson[_0xdd02('0xa')][_0xdd02('0xb')]({'port':0x232a});config[_0xdd02('0xc')]=_[_0xdd02('0xd')](config[_0xdd02('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xdd02('0xe'))(new Redis(config['redis']));require(_0xdd02('0xf'))[_0xdd02('0x10')](socket);function respondWithRpcPromise(_0x352b54,_0x4e3943,_0x168da2){return new BPromise(function(_0x7b9b27,_0x22c429){return client['request'](_0x352b54,_0x168da2)[_0xdd02('0x11')](function(_0x5c9a49){logger[_0xdd02('0x12')]('CmList,\x20%s,\x20%s',_0x4e3943,_0xdd02('0x13'));logger[_0xdd02('0x14')]('CmList,\x20%s,\x20%s,\x20%s',_0x4e3943,'request\x20sent',JSON[_0xdd02('0x15')](_0x5c9a49));if(_0x5c9a49[_0xdd02('0x16')]){if(_0x5c9a49[_0xdd02('0x16')][_0xdd02('0x17')]===0x1f4){logger['error'](_0xdd02('0x18'),_0x4e3943,_0x5c9a49['error']['message']);return _0x22c429(_0x5c9a49[_0xdd02('0x16')]['message']);}logger[_0xdd02('0x16')]('CmList,\x20%s,\x20%s',_0x4e3943,_0x5c9a49[_0xdd02('0x16')]['message']);return _0x7b9b27(_0x5c9a49[_0xdd02('0x16')][_0xdd02('0x19')]);}else{logger[_0xdd02('0x12')](_0xdd02('0x18'),_0x4e3943,_0xdd02('0x13'));_0x7b9b27(_0x5c9a49[_0xdd02('0x1a')][_0xdd02('0x19')]);}})['catch'](function(_0x3385e1){logger[_0xdd02('0x16')]('CmList,\x20%s,\x20%s',_0x4e3943,_0x3385e1);_0x22c429(_0x3385e1);});});} \ No newline at end of file +var _0xc8db=['request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./cmList.socket','request','info','CmList,\x20%s,\x20%s','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x182c4f,_0x462193){var _0x4cea55=function(_0x1f5f81){while(--_0x1f5f81){_0x182c4f['push'](_0x182c4f['shift']());}};_0x4cea55(++_0x462193);}(_0xc8db,0x1e8));var _0xbc8d=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xc8db[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xbc8d('0x0'));var util=require(_0xbc8d('0x1'));var moment=require(_0xbc8d('0x2'));var BPromise=require(_0xbc8d('0x3'));var rs=require(_0xbc8d('0x4'));var fs=require('fs');var Redis=require(_0xbc8d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xbc8d('0x6'));var logger=require(_0xbc8d('0x7'))(_0xbc8d('0x8'));var config=require(_0xbc8d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xbc8d('0xa')][_0xbc8d('0xb')]({'port':0x232a});config[_0xbc8d('0xc')]=_['defaults'](config[_0xbc8d('0xc')],{'host':_0xbc8d('0xd'),'port':0x18eb});var socket=require(_0xbc8d('0xe'))(new Redis(config[_0xbc8d('0xc')]));require(_0xbc8d('0xf'))['register'](socket);function respondWithRpcPromise(_0x2bfe65,_0x236e87,_0x1629c9){return new BPromise(function(_0x36c799,_0x12b19e){return client[_0xbc8d('0x10')](_0x2bfe65,_0x1629c9)['then'](function(_0x1e4df7){logger[_0xbc8d('0x11')](_0xbc8d('0x12'),_0x236e87,'request\x20sent');logger[_0xbc8d('0x13')](_0xbc8d('0x14'),_0x236e87,'request\x20sent',JSON[_0xbc8d('0x15')](_0x1e4df7));if(_0x1e4df7[_0xbc8d('0x16')]){if(_0x1e4df7[_0xbc8d('0x16')][_0xbc8d('0x17')]===0x1f4){logger['error'](_0xbc8d('0x12'),_0x236e87,_0x1e4df7[_0xbc8d('0x16')][_0xbc8d('0x18')]);return _0x12b19e(_0x1e4df7[_0xbc8d('0x16')][_0xbc8d('0x18')]);}logger[_0xbc8d('0x16')]('CmList,\x20%s,\x20%s',_0x236e87,_0x1e4df7[_0xbc8d('0x16')][_0xbc8d('0x18')]);return _0x36c799(_0x1e4df7[_0xbc8d('0x16')][_0xbc8d('0x18')]);}else{logger[_0xbc8d('0x11')](_0xbc8d('0x12'),_0x236e87,_0xbc8d('0x19'));_0x36c799(_0x1e4df7['result'][_0xbc8d('0x18')]);}})[_0xbc8d('0x1a')](function(_0xab3675){logger[_0xbc8d('0x16')](_0xbc8d('0x12'),_0x236e87,_0xab3675);_0x12b19e(_0xab3675);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 1f5dafe..7a591ee 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 _0xf8de=['save','remove','emit','removeListener','register','cmList:'];(function(_0xbcf992,_0x2aaa38){var _0x307081=function(_0x11abf6){while(--_0x11abf6){_0xbcf992['push'](_0xbcf992['shift']());}};_0x307081(++_0x2aaa38);}(_0xf8de,0x1d4));var _0xef8d=function(_0x5d66e0,_0x4c1a1b){_0x5d66e0=_0x5d66e0-0x0;var _0x1dd982=_0xf8de[_0x5d66e0];return _0x1dd982;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0xef8d('0x0'),_0xef8d('0x1'),'update'];function createListener(_0x1b57df,_0x55d0e7){return function(_0x3651ec){_0x55d0e7[_0xef8d('0x2')](_0x1b57df,_0x3651ec);};}function removeListener(_0x3cdc6d,_0x58851e){return function(){CmListEvents[_0xef8d('0x3')](_0x3cdc6d,_0x58851e);};}exports[_0xef8d('0x4')]=function(_0x586e39){for(var _0x2ba6b9=0x0,_0x52d5f2=events['length'];_0x2ba6b9<_0x52d5f2;_0x2ba6b9++){var _0x1f4163=events[_0x2ba6b9];var _0x3e74f1=createListener(_0xef8d('0x5')+_0x1f4163,_0x586e39);CmListEvents['on'](_0x1f4163,_0x3e74f1);}}; \ No newline at end of file +var _0x6c65=['./cmList.events','save','remove','update','emit','removeListener','register','length'];(function(_0x344e94,_0x57fd66){var _0x37bdf8=function(_0x138163){while(--_0x138163){_0x344e94['push'](_0x344e94['shift']());}};_0x37bdf8(++_0x57fd66);}(_0x6c65,0x78));var _0x56c6=function(_0x5c431c,_0x3f1b8c){_0x5c431c=_0x5c431c-0x0;var _0x3ce6fb=_0x6c65[_0x5c431c];return _0x3ce6fb;};'use strict';var CmListEvents=require(_0x56c6('0x0'));var events=[_0x56c6('0x1'),_0x56c6('0x2'),_0x56c6('0x3')];function createListener(_0x1bebff,_0x3f6d26){return function(_0x57c6ff){_0x3f6d26[_0x56c6('0x4')](_0x1bebff,_0x57c6ff);};}function removeListener(_0x4321ef,_0x3f532d){return function(){CmListEvents[_0x56c6('0x5')](_0x4321ef,_0x3f532d);};}exports[_0x56c6('0x6')]=function(_0x4fd1f2){for(var _0x309a6c=0x0,_0x2f7d43=events[_0x56c6('0x7')];_0x309a6c<_0x2f7d43;_0x309a6c++){var _0x3123cb=events[_0x309a6c];var _0x2422a9=createListener('cmList:'+_0x3123cb,_0x4fd1f2);CmListEvents['on'](_0x3123cb,_0x2422a9);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 5dbb131..1f6f531 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 _0x4ca0=['put','/:id','update','delete','destroy','removeDispositions','removeAgents','multer','util','path','connect-timeout','express','../../config/environment','./cmList.controller','isAuthenticated','index','get','/describe','describe','/:id/dispositions','/:id/contacts','/:id/contacts/csv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','addContacts','addAgents'];(function(_0x45c473,_0x35582e){var _0x580c97=function(_0x494ba1){while(--_0x494ba1){_0x45c473['push'](_0x45c473['shift']());}};_0x580c97(++_0x35582e);}(_0x4ca0,0x7f));var _0x04ca=function(_0x4df69e,_0x5131d5){_0x4df69e=_0x4df69e-0x0;var _0x1f9041=_0x4ca0[_0x4df69e];return _0x1f9041;};'use strict';var multer=require(_0x04ca('0x0'));var util=require(_0x04ca('0x1'));var path=require(_0x04ca('0x2'));var timeout=require(_0x04ca('0x3'));var express=require(_0x04ca('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x04ca('0x5'));var controller=require(_0x04ca('0x6'));router['get']('/',auth[_0x04ca('0x7')](),controller[_0x04ca('0x8')]);router[_0x04ca('0x9')](_0x04ca('0xa'),auth['isAuthenticated'](),controller[_0x04ca('0xb')]);router[_0x04ca('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x04ca('0xc'),auth[_0x04ca('0x7')](),controller['getDispositions']);router[_0x04ca('0x9')](_0x04ca('0xd'),auth[_0x04ca('0x7')](),controller['getContacts']);router[_0x04ca('0x9')](_0x04ca('0xe'),auth[_0x04ca('0x7')](),controller['getContactsCsv']);router[_0x04ca('0x9')](_0x04ca('0xf'),auth['isAuthenticated'](),controller[_0x04ca('0x10')]);router[_0x04ca('0x9')](_0x04ca('0x11'),auth[_0x04ca('0x7')](),controller[_0x04ca('0x12')]);router[_0x04ca('0x13')]('/',auth[_0x04ca('0x7')](),controller[_0x04ca('0x14')]);router[_0x04ca('0x13')]('/:id/dispositions',auth[_0x04ca('0x7')](),controller['addDisposition']);router['post'](_0x04ca('0xd'),auth['isAuthenticated'](),controller[_0x04ca('0x15')]);router[_0x04ca('0x13')](_0x04ca('0xf'),auth[_0x04ca('0x7')](),controller['addCustomField']);router[_0x04ca('0x13')](_0x04ca('0x11'),auth[_0x04ca('0x7')](),controller[_0x04ca('0x16')]);router[_0x04ca('0x17')](_0x04ca('0x18'),auth[_0x04ca('0x7')](),controller[_0x04ca('0x19')]);router[_0x04ca('0x1a')](_0x04ca('0x18'),auth[_0x04ca('0x7')](),controller[_0x04ca('0x1b')]);router[_0x04ca('0x1a')]('/:id/dispositions',auth[_0x04ca('0x7')](),controller[_0x04ca('0x1c')]);router[_0x04ca('0x1a')](_0x04ca('0x11'),auth[_0x04ca('0x7')](),controller[_0x04ca('0x1d')]);module['exports']=router; \ No newline at end of file +var _0x958f=['connect-timeout','Router','../../components/interaction/service','../../config/environment','./cmList.controller','isAuthenticated','get','describe','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','/:id/fields','getAgents','post','create','addCustomField','addAgents','put','update','delete','destroy','removeDispositions','/:id/users','removeAgents','exports','multer','path'];(function(_0x5c52c6,_0x54cee7){var _0x286b8f=function(_0x42dd50){while(--_0x42dd50){_0x5c52c6['push'](_0x5c52c6['shift']());}};_0x286b8f(++_0x54cee7);}(_0x958f,0x99));var _0xf958=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x958f[_0x2be8c2];return _0x97f531;};'use strict';var multer=require(_0xf958('0x0'));var util=require('util');var path=require(_0xf958('0x1'));var timeout=require(_0xf958('0x2'));var express=require('express');var router=express[_0xf958('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xf958('0x4'));var config=require(_0xf958('0x5'));var controller=require(_0xf958('0x6'));router['get']('/',auth[_0xf958('0x7')](),controller['index']);router[_0xf958('0x8')]('/describe',auth[_0xf958('0x7')](),controller[_0xf958('0x9')]);router[_0xf958('0x8')](_0xf958('0xa'),auth[_0xf958('0x7')](),controller[_0xf958('0xb')]);router['get'](_0xf958('0xc'),auth[_0xf958('0x7')](),controller[_0xf958('0xd')]);router[_0xf958('0x8')](_0xf958('0xe'),auth[_0xf958('0x7')](),controller[_0xf958('0xf')]);router['get'](_0xf958('0x10'),auth[_0xf958('0x7')](),controller['getContactsCsv']);router[_0xf958('0x8')](_0xf958('0x11'),auth[_0xf958('0x7')](),controller['getCustomFields']);router['get']('/:id/users',auth[_0xf958('0x7')](),controller[_0xf958('0x12')]);router[_0xf958('0x13')]('/',auth[_0xf958('0x7')](),controller[_0xf958('0x14')]);router[_0xf958('0x13')](_0xf958('0xc'),auth[_0xf958('0x7')](),controller['addDisposition']);router[_0xf958('0x13')](_0xf958('0xe'),auth[_0xf958('0x7')](),controller['addContacts']);router[_0xf958('0x13')]('/:id/fields',auth['isAuthenticated'](),controller[_0xf958('0x15')]);router[_0xf958('0x13')]('/:id/users',auth[_0xf958('0x7')](),controller[_0xf958('0x16')]);router[_0xf958('0x17')](_0xf958('0xa'),auth[_0xf958('0x7')](),controller[_0xf958('0x18')]);router[_0xf958('0x19')](_0xf958('0xa'),auth[_0xf958('0x7')](),controller[_0xf958('0x1a')]);router['delete'](_0xf958('0xc'),auth[_0xf958('0x7')](),controller[_0xf958('0x1b')]);router[_0xf958('0x19')](_0xf958('0x1c'),auth[_0xf958('0x7')](),controller[_0xf958('0x1d')]);module[_0xf958('0x1e')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 12e73c9..e5e0ff5 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 _0x9957=['field','STRING','sequelize','exports','VIRTUAL'];(function(_0x4ff6a7,_0x3024d2){var _0x132beb=function(_0x562725){while(--_0x562725){_0x4ff6a7['push'](_0x4ff6a7['shift']());}};_0x132beb(++_0x3024d2);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'get':function(_0x10a05d){return this['getDataValue'](_0x7995('0x3'));}},'field':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0x9957=['field','STRING','sequelize','exports','VIRTUAL'];(function(_0xf10f17,_0x430c2d){var _0x754071=function(_0x2f3530){while(--_0x2f3530){_0xf10f17['push'](_0xf10f17['shift']());}};_0x754071(++_0x430c2d);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'get':function(_0x10a05d){return this['getDataValue'](_0x7995('0x3'));}},'field':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x7995('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 12e7fc6..9a40479 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 _0x32d3=['moment','bluebird','mustache','path','to-csv','ejs','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','set','Content-Range','reject','update','then','destroy','error','stack','name','send','body','find','params','catch','Condition','html-pdf','request-promise'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x32d3,0xee));var _0x332d=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x32d3[_0x501510];return _0x1e6ee5;};'use strict';var pdf=require(_0x332d('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x332d('0x1'));var moment=require(_0x332d('0x2'));var BPromise=require(_0x332d('0x3'));var Mustache=require(_0x332d('0x4'));var util=require('util');var path=require(_0x332d('0x5'));var sox=require('sox');var csv=require(_0x332d('0x6'));var ejs=require(_0x332d('0x7'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x332d('0x8'));var jsforce=require(_0x332d('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x332d('0x6'));var querystring=require('querystring');var Papa=require(_0x332d('0xa'));var Redis=require(_0x332d('0xb'));var authService=require(_0x332d('0xc'));var qs=require(_0x332d('0xd'));var as=require(_0x332d('0xe'));var hardwareService=require(_0x332d('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0x332d('0x10'));var config=require(_0x332d('0x11'));var db=require(_0x332d('0x12'))['db'];function respondWithStatusCode(_0x1dcdfc,_0x40a446){_0x40a446=_0x40a446||0xcc;return function(_0xc71fba){if(_0xc71fba){return _0x1dcdfc[_0x332d('0x13')](_0x40a446);}return _0x1dcdfc['status'](_0x40a446)[_0x332d('0x14')]();};}function respondWithResult(_0x22acf3,_0x3db576){_0x3db576=_0x3db576||0xc8;return function(_0x528377){if(_0x528377){return _0x22acf3[_0x332d('0x15')](_0x3db576)[_0x332d('0x16')](_0x528377);}};}function respondWithFilteredResult(_0x3ea9fd,_0x1a4330){return function(_0x118a6d){if(_0x118a6d){var _0x2896a9=_0x118a6d['count'],_0x5092ca=_0x1a4330[_0x332d('0x17')],_0x9bc1a7=_0x1a4330[_0x332d('0x17')]+_0x1a4330[_0x332d('0x18')],_0x4ba0bb;if(_0x9bc1a7>=_0x2896a9){_0x9bc1a7=_0x2896a9;_0x4ba0bb=0xc8;}else{_0x4ba0bb=0xce;}_0x3ea9fd[_0x332d('0x15')](_0x4ba0bb);return _0x3ea9fd[_0x332d('0x19')](_0x332d('0x1a'),_0x5092ca+'-'+_0x9bc1a7+'/'+_0x2896a9)[_0x332d('0x16')](_0x118a6d);}return null;};}function patchUpdates(_0x16a855){return function(_0x566903){try{jsonpatch['apply'](_0x566903,_0x16a855,!![]);}catch(_0x1cf11a){return BPromise[_0x332d('0x1b')](_0x1cf11a);}return _0x566903['save']();};}function saveUpdates(_0x1d42d2,_0x46b208){return function(_0x1983e9){if(_0x1983e9){return _0x1983e9[_0x332d('0x1c')](_0x1d42d2)[_0x332d('0x1d')](function(_0x57fb75){return _0x57fb75;});}return null;};}function removeEntity(_0x4abf52,_0x56aee9){return function(_0x14fa2f){if(_0x14fa2f){return _0x14fa2f[_0x332d('0x1e')]()[_0x332d('0x1d')](function(){_0x4abf52[_0x332d('0x15')](0xcc)[_0x332d('0x14')]();});}};}function handleEntityNotFound(_0x237fa4,_0x12a398){return function(_0x3b32f0){if(!_0x3b32f0){_0x237fa4[_0x332d('0x13')](0x194);}return _0x3b32f0;};}function handleError(_0x2724ee,_0x5263d4){_0x5263d4=_0x5263d4||0x1f4;return function(_0x176d00){logger[_0x332d('0x1f')](_0x176d00[_0x332d('0x20')]);if(_0x176d00[_0x332d('0x21')]){delete _0x176d00[_0x332d('0x21')];}_0x2724ee[_0x332d('0x15')](_0x5263d4)[_0x332d('0x22')](_0x176d00);};}exports[_0x332d('0x1c')]=function(_0x1e8c3e,_0x46b5ab){if(_0x1e8c3e[_0x332d('0x23')]['id']){delete _0x1e8c3e['body']['id'];}return db['Condition'][_0x332d('0x24')]({'where':{'id':_0x1e8c3e[_0x332d('0x25')]['id']}})[_0x332d('0x1d')](handleEntityNotFound(_0x46b5ab,null))['then'](saveUpdates(_0x1e8c3e[_0x332d('0x23')],null))[_0x332d('0x1d')](respondWithResult(_0x46b5ab,null))[_0x332d('0x26')](handleError(_0x46b5ab,null));};exports[_0x332d('0x1e')]=function(_0xbb7d2d,_0x4e8d37){return db[_0x332d('0x27')][_0x332d('0x24')]({'where':{'id':_0xbb7d2d[_0x332d('0x25')]['id']}})[_0x332d('0x1d')](handleEntityNotFound(_0x4e8d37,null))[_0x332d('0x1d')](removeEntity(_0x4e8d37,null))['catch'](handleError(_0x4e8d37,null));}; \ No newline at end of file +var _0x5862=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','body','Condition','find','params','catch','html-pdf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','squel','jsforce','desk.js'];(function(_0x336543,_0x1e81fc){var _0x287048=function(_0x3b1799){while(--_0x3b1799){_0x336543['push'](_0x336543['shift']());}};_0x287048(++_0x1e81fc);}(_0x5862,0x137));var _0x2586=function(_0xe2da70,_0xd31c8a){_0xe2da70=_0xe2da70-0x0;var _0x32564f=_0x5862[_0xe2da70];return _0x32564f;};'use strict';var pdf=require(_0x2586('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2586('0x1'));var jsonpatch=require(_0x2586('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2586('0x3'));var Mustache=require(_0x2586('0x4'));var util=require(_0x2586('0x5'));var path=require('path');var sox=require(_0x2586('0x6'));var csv=require('to-csv');var ejs=require(_0x2586('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2586('0x8'));var crypto=require('crypto');var jsforce=require(_0x2586('0x9'));var deskjs=require(_0x2586('0xa'));var toCsv=require('to-csv');var querystring=require(_0x2586('0xb'));var Papa=require(_0x2586('0xc'));var Redis=require(_0x2586('0xd'));var authService=require(_0x2586('0xe'));var qs=require(_0x2586('0xf'));var as=require(_0x2586('0x10'));var hardwareService=require(_0x2586('0x11'));var logger=require(_0x2586('0x12'))(_0x2586('0x13'));var utils=require(_0x2586('0x14'));var config=require(_0x2586('0x15'));var db=require(_0x2586('0x16'))['db'];function respondWithStatusCode(_0x492df4,_0x4acb80){_0x4acb80=_0x4acb80||0xcc;return function(_0x24dc9b){if(_0x24dc9b){return _0x492df4[_0x2586('0x17')](_0x4acb80);}return _0x492df4[_0x2586('0x18')](_0x4acb80)['end']();};}function respondWithResult(_0x5c7e29,_0x182ecf){_0x182ecf=_0x182ecf||0xc8;return function(_0x24d634){if(_0x24d634){return _0x5c7e29[_0x2586('0x18')](_0x182ecf)[_0x2586('0x19')](_0x24d634);}};}function respondWithFilteredResult(_0x39601d,_0xc5e527){return function(_0x304cfc){if(_0x304cfc){var _0x372998=_0x304cfc[_0x2586('0x1a')],_0x48c9c6=_0xc5e527[_0x2586('0x1b')],_0x265133=_0xc5e527[_0x2586('0x1b')]+_0xc5e527[_0x2586('0x1c')],_0x4cdf84;if(_0x265133>=_0x372998){_0x265133=_0x372998;_0x4cdf84=0xc8;}else{_0x4cdf84=0xce;}_0x39601d[_0x2586('0x18')](_0x4cdf84);return _0x39601d[_0x2586('0x1d')](_0x2586('0x1e'),_0x48c9c6+'-'+_0x265133+'/'+_0x372998)[_0x2586('0x19')](_0x304cfc);}return null;};}function patchUpdates(_0x1c1fe1){return function(_0x1a352f){try{jsonpatch[_0x2586('0x1f')](_0x1a352f,_0x1c1fe1,!![]);}catch(_0x816513){return BPromise['reject'](_0x816513);}return _0x1a352f[_0x2586('0x20')]();};}function saveUpdates(_0x32b808,_0x5d84f7){return function(_0x1ec9d7){if(_0x1ec9d7){return _0x1ec9d7[_0x2586('0x21')](_0x32b808)[_0x2586('0x22')](function(_0x1a171f){return _0x1a171f;});}return null;};}function removeEntity(_0x691bfc,_0xf0bc4f){return function(_0x3f3625){if(_0x3f3625){return _0x3f3625[_0x2586('0x23')]()['then'](function(){_0x691bfc['status'](0xcc)[_0x2586('0x24')]();});}};}function handleEntityNotFound(_0x417809,_0x233bbc){return function(_0x3c66f8){if(!_0x3c66f8){_0x417809['sendStatus'](0x194);}return _0x3c66f8;};}function handleError(_0x4a8dfa,_0x498c89){_0x498c89=_0x498c89||0x1f4;return function(_0x489d51){logger[_0x2586('0x25')](_0x489d51[_0x2586('0x26')]);if(_0x489d51['name']){delete _0x489d51[_0x2586('0x27')];}_0x4a8dfa[_0x2586('0x18')](_0x498c89)[_0x2586('0x28')](_0x489d51);};}exports[_0x2586('0x21')]=function(_0x4006e2,_0x2eb14c){if(_0x4006e2[_0x2586('0x29')]['id']){delete _0x4006e2[_0x2586('0x29')]['id'];}return db[_0x2586('0x2a')][_0x2586('0x2b')]({'where':{'id':_0x4006e2[_0x2586('0x2c')]['id']}})[_0x2586('0x22')](handleEntityNotFound(_0x2eb14c,null))['then'](saveUpdates(_0x4006e2[_0x2586('0x29')],null))['then'](respondWithResult(_0x2eb14c,null))[_0x2586('0x2d')](handleError(_0x2eb14c,null));};exports[_0x2586('0x23')]=function(_0x200a08,_0x5bee60){return db[_0x2586('0x2a')][_0x2586('0x2b')]({'where':{'id':_0x200a08[_0x2586('0x2c')]['id']}})[_0x2586('0x22')](handleEntityNotFound(_0x5bee60,null))[_0x2586('0x22')](removeEntity(_0x5bee60,null))['catch'](handleError(_0x5bee60,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 3cf57f3..58df0de 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 _0x4ecc=['util','../../config/logger','moment','request-promise','rimraf','./condition.attributes','exports','Condition','tools_conditions','lodash'];(function(_0x493a89,_0x2f5fac){var _0x5be45c=function(_0x1147ed){while(--_0x1147ed){_0x493a89['push'](_0x493a89['shift']());}};_0x5be45c(++_0x2f5fac);}(_0x4ecc,0x18f));var _0xc4ec=function(_0x58afd5,_0x534a48){_0x58afd5=_0x58afd5-0x0;var _0x3e503b=_0x4ecc[_0x58afd5];return _0x3e503b;};'use strict';var _=require(_0xc4ec('0x0'));var util=require(_0xc4ec('0x1'));var logger=require(_0xc4ec('0x2'))('api');var moment=require(_0xc4ec('0x3'));var BPromise=require('bluebird');var rp=require(_0xc4ec('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc4ec('0x5'));var config=require('../../config/environment');var attributes=require(_0xc4ec('0x6'));module[_0xc4ec('0x7')]=function(_0x77edf8,_0x3373f8){return _0x77edf8['define'](_0xc4ec('0x8'),attributes,{'tableName':_0xc4ec('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x75ac=['request-promise','rimraf','../../config/environment','./condition.attributes','exports','lodash','util','../../config/logger','moment','bluebird'];(function(_0x7c2ba6,_0xbd642c){var _0xf78db1=function(_0x23085a){while(--_0x23085a){_0x7c2ba6['push'](_0x7c2ba6['shift']());}};_0xf78db1(++_0xbd642c);}(_0x75ac,0x145));var _0xc75a=function(_0x34325b,_0x5e5afe){_0x34325b=_0x34325b-0x0;var _0x3da348=_0x75ac[_0x34325b];return _0x3da348;};'use strict';var _=require(_0xc75a('0x0'));var util=require(_0xc75a('0x1'));var logger=require(_0xc75a('0x2'))('api');var moment=require(_0xc75a('0x3'));var BPromise=require(_0xc75a('0x4'));var rp=require(_0xc75a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc75a('0x6'));var config=require(_0xc75a('0x7'));var attributes=require(_0xc75a('0x8'));module[_0xc75a('0x9')]=function(_0x3cd42f,_0x342a57){return _0x3cd42f['define']('Condition',attributes,{'tableName':'tools_conditions','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 0796761..39d197f 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 _0xa18b=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s'];(function(_0x5b834c,_0x3a2de5){var _0x490517=function(_0x464fae){while(--_0x464fae){_0x5b834c['push'](_0x5b834c['shift']());}};_0x490517(++_0x3a2de5);}(_0xa18b,0x14b));var _0xba18=function(_0x75b25d,_0x3fbae3){_0x75b25d=_0x75b25d-0x0;var _0x3400de=_0xa18b[_0x75b25d];return _0x3400de;};'use strict';var _=require(_0xba18('0x0'));var util=require(_0xba18('0x1'));var moment=require(_0xba18('0x2'));var BPromise=require(_0xba18('0x3'));var rs=require(_0xba18('0x4'));var fs=require('fs');var Redis=require(_0xba18('0x5'));var db=require(_0xba18('0x6'))['db'];var utils=require(_0xba18('0x7'));var logger=require(_0xba18('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xba18('0x9'));var client=jayson[_0xba18('0xa')][_0xba18('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x51a696,_0x10af8a,_0x1ff539){return new BPromise(function(_0x2a955f,_0x3f30da){return client[_0xba18('0xc')](_0x51a696,_0x1ff539)[_0xba18('0xd')](function(_0x20f5bf){logger[_0xba18('0xe')](_0xba18('0xf'),_0x10af8a,_0xba18('0x10'));logger[_0xba18('0x11')](_0xba18('0x12'),_0x10af8a,_0xba18('0x10'),JSON[_0xba18('0x13')](_0x20f5bf));if(_0x20f5bf[_0xba18('0x14')]){if(_0x20f5bf[_0xba18('0x14')][_0xba18('0x15')]===0x1f4){logger[_0xba18('0x14')](_0xba18('0xf'),_0x10af8a,_0x20f5bf[_0xba18('0x14')][_0xba18('0x16')]);return _0x3f30da(_0x20f5bf['error'][_0xba18('0x16')]);}logger[_0xba18('0x14')]('Condition,\x20%s,\x20%s',_0x10af8a,_0x20f5bf['error'][_0xba18('0x16')]);return _0x2a955f(_0x20f5bf[_0xba18('0x14')][_0xba18('0x16')]);}else{logger[_0xba18('0xe')](_0xba18('0xf'),_0x10af8a,_0xba18('0x10'));_0x2a955f(_0x20f5bf[_0xba18('0x17')][_0xba18('0x16')]);}})[_0xba18('0x18')](function(_0x23bcc9){logger[_0xba18('0x14')](_0xba18('0xf'),_0x10af8a,_0x23bcc9);_0x3f30da(_0x23bcc9);});});} \ No newline at end of file +var _0xe022=['stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','Condition,\x20%s,\x20%s,\x20%s'];(function(_0x56aef6,_0x46dafa){var _0x53f63f=function(_0x2c029e){while(--_0x2c029e){_0x56aef6['push'](_0x56aef6['shift']());}};_0x53f63f(++_0x46dafa);}(_0xe022,0x90));var _0x2e02=function(_0x47fb1b,_0x4cc3ae){_0x47fb1b=_0x47fb1b-0x0;var _0x315a54=_0xe022[_0x47fb1b];return _0x315a54;};'use strict';var _=require('lodash');var util=require(_0x2e02('0x0'));var moment=require(_0x2e02('0x1'));var BPromise=require(_0x2e02('0x2'));var rs=require(_0x2e02('0x3'));var fs=require('fs');var Redis=require(_0x2e02('0x4'));var db=require(_0x2e02('0x5'))['db'];var utils=require(_0x2e02('0x6'));var logger=require(_0x2e02('0x7'))('rpc');var config=require(_0x2e02('0x8'));var jayson=require(_0x2e02('0x9'));var client=jayson['client'][_0x2e02('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f51ae,_0x29c447,_0x16f621){return new BPromise(function(_0x3116e2,_0x2372fc){return client[_0x2e02('0xb')](_0x4f51ae,_0x16f621)[_0x2e02('0xc')](function(_0x28c8ff){logger[_0x2e02('0xd')](_0x2e02('0xe'),_0x29c447,_0x2e02('0xf'));logger['debug'](_0x2e02('0x10'),_0x29c447,_0x2e02('0xf'),JSON[_0x2e02('0x11')](_0x28c8ff));if(_0x28c8ff['error']){if(_0x28c8ff[_0x2e02('0x12')][_0x2e02('0x13')]===0x1f4){logger[_0x2e02('0x12')](_0x2e02('0xe'),_0x29c447,_0x28c8ff[_0x2e02('0x12')][_0x2e02('0x14')]);return _0x2372fc(_0x28c8ff['error'][_0x2e02('0x14')]);}logger[_0x2e02('0x12')]('Condition,\x20%s,\x20%s',_0x29c447,_0x28c8ff['error'][_0x2e02('0x14')]);return _0x3116e2(_0x28c8ff[_0x2e02('0x12')]['message']);}else{logger[_0x2e02('0xd')](_0x2e02('0xe'),_0x29c447,_0x2e02('0xf'));_0x3116e2(_0x28c8ff[_0x2e02('0x15')][_0x2e02('0x14')]);}})[_0x2e02('0x16')](function(_0x21d1a6){logger[_0x2e02('0x12')](_0x2e02('0xe'),_0x29c447,_0x21d1a6);_0x2372fc(_0x21d1a6);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 49d1722..13e75b7 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 _0x5e09=['update','delete','isAuthenticated','destroy','exports','path','connect-timeout','express','../../components/interaction/service','./condition.controller','put','/:id'];(function(_0x4b8ecc,_0x4cd01c){var _0x48c1b9=function(_0x308aa3){while(--_0x308aa3){_0x4b8ecc['push'](_0x4b8ecc['shift']());}};_0x48c1b9(++_0x4cd01c);}(_0x5e09,0x89));var _0x95e0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5e09[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x95e0('0x0'));var timeout=require(_0x95e0('0x1'));var express=require(_0x95e0('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x95e0('0x3'));var config=require('../../config/environment');var controller=require(_0x95e0('0x4'));router[_0x95e0('0x5')](_0x95e0('0x6'),auth['isAuthenticated'](),controller[_0x95e0('0x7')]);router[_0x95e0('0x8')](_0x95e0('0x6'),auth[_0x95e0('0x9')](),controller[_0x95e0('0xa')]);module[_0x95e0('0xb')]=router; \ No newline at end of file +var _0x4c50=['../../components/interaction/service','../../config/environment','put','/:id','isAuthenticated','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x36cd09,_0x2d5e2f){var _0x18fd1a=function(_0x3d042c){while(--_0x3d042c){_0x36cd09['push'](_0x36cd09['shift']());}};_0x18fd1a(++_0x2d5e2f);}(_0x4c50,0xda));var _0x04c5=function(_0x48cb05,_0x15c5cd){_0x48cb05=_0x48cb05-0x0;var _0x583520=_0x4c50[_0x48cb05];return _0x583520;};'use strict';var multer=require(_0x04c5('0x0'));var util=require(_0x04c5('0x1'));var path=require(_0x04c5('0x2'));var timeout=require(_0x04c5('0x3'));var express=require(_0x04c5('0x4'));var router=express[_0x04c5('0x5')]();var auth=require(_0x04c5('0x6'));var interaction=require(_0x04c5('0x7'));var config=require(_0x04c5('0x8'));var controller=require('./condition.controller');router[_0x04c5('0x9')](_0x04c5('0xa'),auth[_0x04c5('0xb')](),controller['update']);router[_0x04c5('0xc')](_0x04c5('0xa'),auth[_0x04c5('0xb')](),controller[_0x04c5('0xd')]);module[_0x04c5('0xe')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 488537a..a136dce 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 _0xcb04=['STRING','name','sequelize','exports'];(function(_0x23921c,_0x3b3ad2){var _0x1f96f5=function(_0x1ac820){while(--_0x1ac820){_0x23921c['push'](_0x23921c['shift']());}};_0x1f96f5(++_0x3b3ad2);}(_0xcb04,0x9a));var _0x4cb0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xcb04[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x4cb0('0x0'));module[_0x4cb0('0x1')]={'name':{'type':Sequelize[_0x4cb0('0x2')],'allowNull':![],'unique':_0x4cb0('0x3')},'description':{'type':Sequelize[_0x4cb0('0x2')]}}; \ No newline at end of file +var _0x5334=['sequelize','exports','STRING','name'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x5334,0x84));var _0x4533=function(_0x2da632,_0x405709){_0x2da632=_0x2da632-0x0;var _0x3b66a1=_0x5334[_0x2da632];return _0x3b66a1;};'use strict';var Sequelize=require(_0x4533('0x0'));module[_0x4533('0x1')]={'name':{'type':Sequelize[_0x4533('0x2')],'allowNull':![],'unique':_0x4533('0x3')},'description':{'type':Sequelize[_0x4533('0x2')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 49e009f..d805db0 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 _0x43f5=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','body','role','UserProfileSection','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','getItems','DashboardItem','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','api','../../config/utils','defaults','redis','localhost','./dashboard.socket','register','end','status','json','offset','limit','set','Content-Range','apply','reject','save','then','destroy','get','CustomDashboards','UserProfileResource','sendStatus','error','name','send','map','Dashboard','rawAttributes','key','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','catch','show','params','keys','find','create'];(function(_0x19f5d8,_0x3de4ba){var _0x2367b2=function(_0x2f754c){while(--_0x2f754c){_0x19f5d8['push'](_0x19f5d8['shift']());}};_0x2367b2(++_0x3de4ba);}(_0x43f5,0x9d));var _0x543f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x43f5[_0x321bb2];return _0x9c12ed;};'use strict';var pdf=require(_0x543f('0x0'));var emlformat=require(_0x543f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x543f('0x2'));var jsonpatch=require(_0x543f('0x3'));var rp=require(_0x543f('0x4'));var moment=require('moment');var BPromise=require(_0x543f('0x5'));var Mustache=require(_0x543f('0x6'));var util=require(_0x543f('0x7'));var path=require(_0x543f('0x8'));var sox=require(_0x543f('0x9'));var csv=require(_0x543f('0xa'));var ejs=require(_0x543f('0xb'));var fs=require('fs');var _=require(_0x543f('0xc'));var squel=require('squel');var crypto=require(_0x543f('0xd'));var jsforce=require(_0x543f('0xe'));var deskjs=require(_0x543f('0xf'));var toCsv=require(_0x543f('0xa'));var querystring=require(_0x543f('0x10'));var Papa=require('papaparse');var Redis=require(_0x543f('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x543f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x543f('0x13'));var utils=require(_0x543f('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0x543f('0x15')](config[_0x543f('0x16')],{'host':_0x543f('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x543f('0x16')]));require(_0x543f('0x18'))[_0x543f('0x19')](socket);function respondWithStatusCode(_0x4b7ffb,_0x2fadd7){_0x2fadd7=_0x2fadd7||0xcc;return function(_0x3026ad){if(_0x3026ad){return _0x4b7ffb['sendStatus'](_0x2fadd7);}return _0x4b7ffb['status'](_0x2fadd7)[_0x543f('0x1a')]();};}function respondWithResult(_0x5e879d,_0x17b54c){_0x17b54c=_0x17b54c||0xc8;return function(_0x3f85cd){if(_0x3f85cd){return _0x5e879d[_0x543f('0x1b')](_0x17b54c)[_0x543f('0x1c')](_0x3f85cd);}};}function respondWithFilteredResult(_0x4f796f,_0x7a522d){return function(_0x404775){if(_0x404775){var _0x212219=_0x404775['count'],_0x8294e2=_0x7a522d['offset'],_0x3264bd=_0x7a522d[_0x543f('0x1d')]+_0x7a522d[_0x543f('0x1e')],_0x1402f1;if(_0x3264bd>=_0x212219){_0x3264bd=_0x212219;_0x1402f1=0xc8;}else{_0x1402f1=0xce;}_0x4f796f[_0x543f('0x1b')](_0x1402f1);return _0x4f796f[_0x543f('0x1f')](_0x543f('0x20'),_0x8294e2+'-'+_0x3264bd+'/'+_0x212219)['json'](_0x404775);}return null;};}function patchUpdates(_0xc39bce){return function(_0x367d50){try{jsonpatch[_0x543f('0x21')](_0x367d50,_0xc39bce,!![]);}catch(_0x559a21){return BPromise[_0x543f('0x22')](_0x559a21);}return _0x367d50[_0x543f('0x23')]();};}function saveUpdates(_0xd3a0a1,_0x4fa1cc){return function(_0x375e7d){if(_0x375e7d){return _0x375e7d['update'](_0xd3a0a1)[_0x543f('0x24')](function(_0x49701c){return _0x49701c;});}return null;};}function removeEntity(_0x3914d3,_0x5a9bc1){return function(_0x45f567){if(_0x45f567){return _0x45f567[_0x543f('0x25')]()[_0x543f('0x24')](function(){var _0x165ec7=_0x45f567[_0x543f('0x26')]({'plain':!![]});var _0x1a1b51=_0x543f('0x27');return db[_0x543f('0x28')][_0x543f('0x25')]({'where':{'type':_0x1a1b51,'resourceId':_0x165ec7['id']}})[_0x543f('0x24')](function(){return _0x45f567;});})[_0x543f('0x24')](function(){_0x3914d3[_0x543f('0x1b')](0xcc)[_0x543f('0x1a')]();});}};}function handleEntityNotFound(_0x4f7730,_0x983e45){return function(_0x1f0a2c){if(!_0x1f0a2c){_0x4f7730[_0x543f('0x29')](0x194);}return _0x1f0a2c;};}function handleError(_0x252c28,_0x1c0495){_0x1c0495=_0x1c0495||0x1f4;return function(_0x7f9c7b){logger[_0x543f('0x2a')](_0x7f9c7b['stack']);if(_0x7f9c7b[_0x543f('0x2b')]){delete _0x7f9c7b[_0x543f('0x2b')];}_0x252c28['status'](_0x1c0495)[_0x543f('0x2c')](_0x7f9c7b);};}exports['index']=function(_0x5ede7b,_0x1fcfda){var _0xa35162={},_0x2db279={},_0x5eb3da={'count':0x0,'rows':[]};var _0xec78aa=_[_0x543f('0x2d')](db[_0x543f('0x2e')][_0x543f('0x2f')],function(_0xead81d){return{'name':_0xead81d['fieldName'],'type':_0xead81d['type'][_0x543f('0x30')]};});_0x2db279['model']=_[_0x543f('0x2d')](_0xec78aa,'name');_0x2db279[_0x543f('0x31')]=_['keys'](_0x5ede7b[_0x543f('0x31')]);_0x2db279[_0x543f('0x32')]=_[_0x543f('0x33')](_0x2db279['model'],_0x2db279[_0x543f('0x31')]);_0xa35162['attributes']=_[_0x543f('0x33')](_0x2db279[_0x543f('0x34')],qs[_0x543f('0x35')](_0x5ede7b[_0x543f('0x31')][_0x543f('0x35')]));_0xa35162[_0x543f('0x36')]=_0xa35162[_0x543f('0x36')][_0x543f('0x37')]?_0xa35162[_0x543f('0x36')]:_0x2db279['model'];if(!_0x5ede7b[_0x543f('0x31')]['hasOwnProperty'](_0x543f('0x38'))){_0xa35162[_0x543f('0x1e')]=qs[_0x543f('0x1e')](_0x5ede7b['query']['limit']);_0xa35162['offset']=qs[_0x543f('0x1d')](_0x5ede7b[_0x543f('0x31')][_0x543f('0x1d')]);}_0xa35162[_0x543f('0x39')]=qs['sort'](_0x5ede7b[_0x543f('0x31')][_0x543f('0x3a')]);_0xa35162[_0x543f('0x3b')]=qs[_0x543f('0x32')](_[_0x543f('0x3c')](_0x5ede7b['query'],_0x2db279[_0x543f('0x32')]));if(_0x5ede7b[_0x543f('0x31')][_0x543f('0x3d')]){_0xa35162[_0x543f('0x3b')]=_['merge'](_0xa35162[_0x543f('0x3b')],{'$or':_[_0x543f('0x2d')](_0xec78aa,function(_0x327957){if(_0x327957['type']!==_0x543f('0x3e')){var _0x38fb13={};_0x38fb13[_0x327957[_0x543f('0x2b')]]={'$like':'%'+_0x5ede7b['query'][_0x543f('0x3d')]+'%'};return _0x38fb13;}})});}_0xa35162=_[_0x543f('0x3f')]({},_0xa35162,_0x5ede7b[_0x543f('0x40')]);var _0x15bad6={'where':_0xa35162[_0x543f('0x3b')]};return db[_0x543f('0x2e')][_0x543f('0x41')](_0x15bad6)[_0x543f('0x24')](function(_0x485743){_0x5eb3da[_0x543f('0x41')]=_0x485743;if(_0x5ede7b['query'][_0x543f('0x42')]){_0xa35162[_0x543f('0x43')]=[{'all':!![]}];}return db[_0x543f('0x2e')][_0x543f('0x44')](_0xa35162);})[_0x543f('0x24')](function(_0x40c734){_0x5eb3da['rows']=_0x40c734;return _0x5eb3da;})[_0x543f('0x24')](respondWithFilteredResult(_0x1fcfda,_0xa35162))[_0x543f('0x45')](handleError(_0x1fcfda,null));};exports[_0x543f('0x46')]=function(_0x2b6aa1,_0x372c09){var _0x343cb6={'raw':![],'where':{'id':_0x2b6aa1[_0x543f('0x47')]['id']}},_0x476d4b={};_0x476d4b[_0x543f('0x34')]=_[_0x543f('0x48')](db[_0x543f('0x2e')][_0x543f('0x2f')]);_0x476d4b[_0x543f('0x31')]=_[_0x543f('0x48')](_0x2b6aa1[_0x543f('0x31')]);_0x476d4b['filters']=_[_0x543f('0x33')](_0x476d4b[_0x543f('0x34')],_0x476d4b[_0x543f('0x31')]);_0x343cb6[_0x543f('0x36')]=_['intersection'](_0x476d4b[_0x543f('0x34')],qs[_0x543f('0x35')](_0x2b6aa1['query'][_0x543f('0x35')]));_0x343cb6[_0x543f('0x36')]=_0x343cb6['attributes'][_0x543f('0x37')]?_0x343cb6[_0x543f('0x36')]:_0x476d4b[_0x543f('0x34')];if(_0x2b6aa1['query']['includeAll']){_0x343cb6[_0x543f('0x43')]=[{'all':!![]}];}_0x343cb6=_[_0x543f('0x3f')]({},_0x343cb6,_0x2b6aa1[_0x543f('0x40')]);return db[_0x543f('0x2e')][_0x543f('0x49')](_0x343cb6)[_0x543f('0x24')](handleEntityNotFound(_0x372c09,null))[_0x543f('0x24')](respondWithResult(_0x372c09,null))[_0x543f('0x45')](handleError(_0x372c09,null));};exports[_0x543f('0x4a')]=function(_0xb7146e,_0x30ba75){return db[_0x543f('0x2e')][_0x543f('0x4a')](_0xb7146e['body'],{})[_0x543f('0x24')](function(_0x2b0b4b){var _0xe4d1e3=_0xb7146e[_0x543f('0x4b')][_0x543f('0x26')]({'plain':!![]});if(!_0xe4d1e3)throw new Error(_0x543f('0x4c'));if(_0xe4d1e3['role']==='user'){var _0x5601cc=_0x2b0b4b[_0x543f('0x26')]({'plain':!![]});var _0x27c831=_0x543f('0x27');return db['UserProfileSection'][_0x543f('0x49')]({'where':{'name':_0x27c831,'userProfileId':_0xe4d1e3[_0x543f('0x4d')]},'raw':!![]})[_0x543f('0x24')](function(_0x2b8db9){if(_0x2b8db9&&_0x2b8db9['autoAssociation']===0x0){return db[_0x543f('0x28')]['create']({'name':_0x5601cc[_0x543f('0x2b')],'resourceId':_0x5601cc['id'],'type':_0x2b8db9[_0x543f('0x2b')],'sectionId':_0x2b8db9['id']},{})[_0x543f('0x24')](function(){return _0x2b0b4b;});}else{return _0x2b0b4b;}})[_0x543f('0x45')](function(_0x32a0dc){logger[_0x543f('0x2a')](_0x543f('0x4e'),_0x32a0dc);throw _0x32a0dc;});}return _0x2b0b4b;})[_0x543f('0x24')](respondWithResult(_0x30ba75,0xc9))['catch'](handleError(_0x30ba75,null));};exports['clone']=function(_0x3b2fd4,_0x1dbb0d){var _0x305f97={'where':{'id':_0x3b2fd4[_0x543f('0x47')]['id']}},_0x25915a={};_0x25915a[_0x543f('0x34')]=_[_0x543f('0x48')](db[_0x543f('0x2e')][_0x543f('0x2f')]);_0x305f97[_0x543f('0x36')]=_['intersection'](_0x25915a[_0x543f('0x34')],qs[_0x543f('0x35')](_0x3b2fd4[_0x543f('0x31')][_0x543f('0x35')]));_0x305f97[_0x543f('0x36')]=_0x305f97[_0x543f('0x36')][_0x543f('0x37')]?_0x305f97[_0x543f('0x36')]:_0x25915a[_0x543f('0x34')];if(_0x3b2fd4[_0x543f('0x31')][_0x543f('0x42')]){_0x305f97[_0x543f('0x43')]=[{'all':!![]}];}_0x305f97=_[_0x543f('0x3f')]({},_0x305f97,_0x3b2fd4[_0x543f('0x40')]);return db['Dashboard'][_0x543f('0x49')](_0x305f97)['then'](handleEntityNotFound(_0x1dbb0d,null))[_0x543f('0x24')](function(_0xa1cdf8){if(_0xa1cdf8){var _0x5efe80=_0xa1cdf8[_0x543f('0x26')]({'plain':!![]});_0x5efe80=qs[_0x543f('0x4f')](_0x5efe80,['id',_0x543f('0x50'),_0x543f('0x51')]);_0x3b2fd4[_0x543f('0x52')]=_[_0x543f('0x4f')](_0x3b2fd4['body'],['id',_0x543f('0x50'),'updatedAt']);return db[_0x543f('0x2e')]['create'](_[_0x543f('0x3f')](_0x5efe80,_0x3b2fd4['body']),{'include':_0x3b2fd4[_0x543f('0x31')]['includeAll']?[{'all':!![]}]:undefined})[_0x543f('0x24')](function(_0x373d85){var _0x5f1b1e=_0x3b2fd4['user'][_0x543f('0x26')]({'plain':!![]});if(!_0x5f1b1e)throw new Error(_0x543f('0x4c'));if(_0x5f1b1e[_0x543f('0x53')]===_0x543f('0x4b')){var _0xa1aa2f=_0x373d85[_0x543f('0x26')]({'plain':!![]});var _0x401480=_0x543f('0x27');return db[_0x543f('0x54')][_0x543f('0x49')]({'where':{'name':_0x401480,'userProfileId':_0x5f1b1e[_0x543f('0x4d')]},'raw':!![]})['then'](function(_0x3267cd){if(_0x3267cd&&_0x3267cd['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0xa1aa2f['name'],'resourceId':_0xa1aa2f['id'],'type':_0x3267cd[_0x543f('0x2b')],'sectionId':_0x3267cd['id']},{})[_0x543f('0x24')](function(){return _0x373d85;});}else{return _0x373d85;}})[_0x543f('0x45')](function(_0x4c34d1){logger[_0x543f('0x2a')](_0x543f('0x4e'),_0x4c34d1);throw _0x4c34d1;});}return _0x373d85;});}})[_0x543f('0x24')](respondWithResult(_0x1dbb0d,0xc9))['catch'](handleError(_0x1dbb0d,null));};exports['update']=function(_0xd3b705,_0x5b0fbb){if(_0xd3b705[_0x543f('0x52')]['id']){delete _0xd3b705['body']['id'];}return db[_0x543f('0x2e')][_0x543f('0x49')]({'where':{'id':_0xd3b705[_0x543f('0x47')]['id']}})[_0x543f('0x24')](handleEntityNotFound(_0x5b0fbb,null))['then'](saveUpdates(_0xd3b705[_0x543f('0x52')],null))[_0x543f('0x24')](respondWithResult(_0x5b0fbb,null))[_0x543f('0x45')](handleError(_0x5b0fbb,null));};exports[_0x543f('0x25')]=function(_0x56f254,_0x243488){return db[_0x543f('0x2e')]['find']({'where':{'id':_0x56f254['params']['id']}})[_0x543f('0x24')](handleEntityNotFound(_0x243488,null))[_0x543f('0x24')](removeEntity(_0x243488,null))['catch'](handleError(_0x243488,null));};function widgetAttributes(_0x35cdcf){try{switch(_0x35cdcf[_0x543f('0x55')]){case _0x543f('0x56'):return[{'name':_0x543f('0x57'),'value':_0x35cdcf[_0x543f('0x57')]||(_0x35cdcf[_0x543f('0x58')]&&_0x35cdcf['attrs'][0x0]?_0x35cdcf[_0x543f('0x58')][0x0][_0x543f('0x59')]:undefined)||_0x543f('0x5a')}];case _0x543f('0x5b'):return[{'name':'attrPath','value':_0x35cdcf[_0x543f('0x5c')]||(_0x35cdcf[_0x543f('0x58')]&&_0x35cdcf[_0x543f('0x58')][0x0]?_0x35cdcf[_0x543f('0x58')][0x0][_0x543f('0x59')]:undefined)||''}];case'clock':return[{'name':_0x543f('0x5d'),'value':_0x35cdcf[_0x543f('0x5d')]||(_0x35cdcf[_0x543f('0x58')]&&_0x35cdcf[_0x543f('0x58')][0x0]?_0x35cdcf[_0x543f('0x58')][0x0][_0x543f('0x59')]:undefined)||_0x543f('0x5e')},{'name':'attrTimezone','value':_0x35cdcf[_0x543f('0x5f')]||(_0x35cdcf['attrs']&&_0x35cdcf[_0x543f('0x58')][0x1]?_0x35cdcf[_0x543f('0x58')][0x1][_0x543f('0x59')]:undefined)||_0x543f('0x60')},{'name':_0x543f('0x61'),'value':_0x35cdcf[_0x543f('0x61')]||(_0x35cdcf[_0x543f('0x58')]&&_0x35cdcf[_0x543f('0x58')][0x2]?_0x35cdcf[_0x543f('0x58')][0x2]['value']:undefined)||0xc}];case _0x543f('0x62'):return[{'name':_0x543f('0x63'),'value':_0x35cdcf[_0x543f('0x63')]||(_0x35cdcf[_0x543f('0x58')]&&_0x35cdcf[_0x543f('0x58')][0x0]?_0x35cdcf[_0x543f('0x58')][0x0][_0x543f('0x59')]:undefined)||'total'},{'name':_0x543f('0x64'),'value':_0x35cdcf[_0x543f('0x64')]||(_0x35cdcf['attrs']&&_0x35cdcf[_0x543f('0x58')][0x1]?_0x35cdcf['attrs'][0x1][_0x543f('0x59')]:undefined)||[]},{'name':'attrFontSize','value':_0x35cdcf['attrFontSize']||(_0x35cdcf[_0x543f('0x58')]&&_0x35cdcf[_0x543f('0x58')][0x2]?_0x35cdcf[_0x543f('0x58')][0x2]['value']:undefined)||0x14}];case _0x543f('0x65'):case _0x543f('0x66'):return[{'name':'attrSerie1','value':_0x35cdcf[_0x543f('0x67')]||(_0x35cdcf[_0x543f('0x58')]&&_0x35cdcf['attrs'][0x0]?_0x35cdcf[_0x543f('0x58')][0x0][_0x543f('0x59')]:undefined)||_0x543f('0x68')},{'name':_0x543f('0x69'),'value':_0x35cdcf[_0x543f('0x69')]||(_0x35cdcf[_0x543f('0x58')]&&_0x35cdcf[_0x543f('0x58')][0x1]?_0x35cdcf[_0x543f('0x58')][0x1][_0x543f('0x59')]:undefined)||null},{'name':_0x543f('0x6a'),'value':_0x35cdcf['attrSerie3']||(_0x35cdcf[_0x543f('0x58')]&&_0x35cdcf[_0x543f('0x58')][0x2]?_0x35cdcf[_0x543f('0x58')][0x2][_0x543f('0x59')]:undefined)||null},{'name':_0x543f('0x64'),'value':_0x35cdcf['attrVoiceQueues']||(_0x35cdcf[_0x543f('0x58')]&&_0x35cdcf[_0x543f('0x58')][0x3]?_0x35cdcf['attrs'][0x3][_0x543f('0x59')]:undefined)||[]}];case _0x543f('0x6b'):return[{'name':_0x543f('0x6c'),'type':_0x35cdcf[_0x543f('0x6d')]||(_0x35cdcf[_0x543f('0x58')]&&_0x35cdcf['attrs'][0x0]?_0x35cdcf['attrs'][0x0][_0x543f('0x55')]:undefined)||null,'value':_0x35cdcf[_0x543f('0x6c')]||(_0x35cdcf[_0x543f('0x58')]&&_0x35cdcf[_0x543f('0x58')][0x0]?_0x35cdcf['attrs'][0x0][_0x543f('0x59')]:undefined)||null},{'name':_0x543f('0x6e'),'value':_0x35cdcf[_0x543f('0x6e')]||(_0x35cdcf[_0x543f('0x58')]&&_0x35cdcf[_0x543f('0x58')][0x1]?_0x35cdcf['attrs'][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x1b3bb0){logger[_0x543f('0x2a')](_0x543f('0x6f'),JSON[_0x543f('0x70')](_0x1b3bb0));return[];}}exports[_0x543f('0x71')]=function(_0x44d27c,_0x2291eb,_0x3c65bb){if(_0x44d27c[_0x543f('0x52')]['id']){delete _0x44d27c[_0x543f('0x52')]['id'];}return db['Dashboard'][_0x543f('0x49')]({'where':{'id':_0x44d27c[_0x543f('0x47')]['id']}})['then'](handleEntityNotFound(_0x2291eb,null))[_0x543f('0x24')](function(_0x40a517){if(_0x40a517){_0x44d27c['body']['DashboardId']=_0x40a517['id'];_0x44d27c[_0x543f('0x52')][_0x543f('0x58')]=widgetAttributes(_0x44d27c[_0x543f('0x52')]);return db['DashboardItem'][_0x543f('0x4a')](_0x44d27c[_0x543f('0x52')]);}})[_0x543f('0x24')](respondWithResult(_0x2291eb,null))[_0x543f('0x45')](handleError(_0x2291eb,null));};exports[_0x543f('0x72')]=function(_0x129ee3,_0x17da15,_0x505633){var _0x194100={};var _0x1d31aa={};var _0x3b9805;var _0x1d35c9;return db[_0x543f('0x2e')]['findOne']({'where':{'id':_0x129ee3[_0x543f('0x47')]['id']}})[_0x543f('0x24')](handleEntityNotFound(_0x17da15,null))['then'](function(_0x393b6d){if(_0x393b6d){_0x3b9805=_0x393b6d;_0x1d31aa[_0x543f('0x34')]=_[_0x543f('0x48')](db[_0x543f('0x73')]['rawAttributes']);_0x1d31aa[_0x543f('0x31')]=_[_0x543f('0x48')](_0x129ee3[_0x543f('0x31')]);_0x1d31aa[_0x543f('0x32')]=_[_0x543f('0x33')](_0x1d31aa[_0x543f('0x34')],_0x1d31aa[_0x543f('0x31')]);_0x194100[_0x543f('0x36')]=_[_0x543f('0x33')](_0x1d31aa[_0x543f('0x34')],qs[_0x543f('0x35')](_0x129ee3[_0x543f('0x31')]['fields']));_0x194100[_0x543f('0x36')]=_0x194100[_0x543f('0x36')][_0x543f('0x37')]?_0x194100[_0x543f('0x36')]:_0x1d31aa[_0x543f('0x34')];_0x194100[_0x543f('0x39')]=qs['sort'](_0x129ee3['query'][_0x543f('0x3a')]);_0x194100[_0x543f('0x3b')]=qs['filters'](_[_0x543f('0x3c')](_0x129ee3[_0x543f('0x31')],_0x1d31aa['filters']));if(_0x129ee3['query'][_0x543f('0x3d')]){_0x194100['where']=_[_0x543f('0x3f')](_0x194100['where'],{'$or':_['map'](_0x194100[_0x543f('0x36')],function(_0x49b009){var _0x381267={};_0x381267[_0x49b009]={'$like':'%'+_0x129ee3[_0x543f('0x31')][_0x543f('0x3d')]+'%'};return _0x381267;})});}_0x194100=_[_0x543f('0x3f')]({},_0x194100,_0x129ee3[_0x543f('0x40')]);return _0x3b9805[_0x543f('0x72')](_0x194100);}})[_0x543f('0x24')](function(_0x4c9ea0){if(_0x4c9ea0){_0x1d35c9=_0x4c9ea0[_0x543f('0x37')];if(!_0x129ee3[_0x543f('0x31')]['hasOwnProperty']('nolimit')){_0x194100[_0x543f('0x1e')]=qs['limit'](_0x129ee3[_0x543f('0x31')][_0x543f('0x1e')]);_0x194100[_0x543f('0x1d')]=qs[_0x543f('0x1d')](_0x129ee3[_0x543f('0x31')][_0x543f('0x1d')]);}return _0x3b9805[_0x543f('0x72')](_0x194100);}})[_0x543f('0x24')](function(_0x27786d){if(_0x27786d){return _0x27786d?{'count':_0x1d35c9,'rows':_0x27786d}:null;}})[_0x543f('0x24')](respondWithResult(_0x17da15,null))['catch'](handleError(_0x17da15,null));}; \ No newline at end of file +var _0x76a3=['attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','DashboardId','DashboardItem','getItems','findOne','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./dashboard.socket','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','then','destroy','get','CustomDashboards','UserProfileResource','error','name','index','Dashboard','fieldName','type','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','userProfileId','autoAssociation','clone','rawAttributes','omit','createdAt','updatedAt','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','iframe','attrUrl','attrs','value','attrPath','clock','attrHourFormat','HH:mm:ss'];(function(_0x5198ed,_0x50303b){var _0x2a702c=function(_0x9282ed){while(--_0x9282ed){_0x5198ed['push'](_0x5198ed['shift']());}};_0x2a702c(++_0x50303b);}(_0x76a3,0xf8));var _0x376a=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0x76a3[_0x20c9b2];return _0x2c6030;};'use strict';var pdf=require(_0x376a('0x0'));var emlformat=require(_0x376a('0x1'));var rimraf=require(_0x376a('0x2'));var zipdir=require(_0x376a('0x3'));var jsonpatch=require(_0x376a('0x4'));var rp=require(_0x376a('0x5'));var moment=require(_0x376a('0x6'));var BPromise=require(_0x376a('0x7'));var Mustache=require(_0x376a('0x8'));var util=require(_0x376a('0x9'));var path=require('path');var sox=require('sox');var csv=require(_0x376a('0xa'));var ejs=require(_0x376a('0xb'));var fs=require('fs');var _=require(_0x376a('0xc'));var squel=require(_0x376a('0xd'));var crypto=require('crypto');var jsforce=require(_0x376a('0xe'));var deskjs=require(_0x376a('0xf'));var toCsv=require(_0x376a('0xa'));var querystring=require(_0x376a('0x10'));var Papa=require(_0x376a('0x11'));var Redis=require(_0x376a('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x376a('0x13'));var logger=require(_0x376a('0x14'))('api');var utils=require(_0x376a('0x15'));var config=require('../../config/environment');var db=require(_0x376a('0x16'))['db'];config[_0x376a('0x17')]=_['defaults'](config[_0x376a('0x17')],{'host':_0x376a('0x18'),'port':0x18eb});var socket=require(_0x376a('0x19'))(new Redis(config['redis']));require(_0x376a('0x1a'))['register'](socket);function respondWithStatusCode(_0x33ad40,_0x457027){_0x457027=_0x457027||0xcc;return function(_0x19579e){if(_0x19579e){return _0x33ad40[_0x376a('0x1b')](_0x457027);}return _0x33ad40[_0x376a('0x1c')](_0x457027)[_0x376a('0x1d')]();};}function respondWithResult(_0x3f5409,_0x2ec88c){_0x2ec88c=_0x2ec88c||0xc8;return function(_0x5aa90c){if(_0x5aa90c){return _0x3f5409[_0x376a('0x1c')](_0x2ec88c)[_0x376a('0x1e')](_0x5aa90c);}};}function respondWithFilteredResult(_0x53f3c0,_0x2a3c5b){return function(_0x20768d){if(_0x20768d){var _0x2dff31=_0x20768d[_0x376a('0x1f')],_0xa29966=_0x2a3c5b['offset'],_0x2519d4=_0x2a3c5b[_0x376a('0x20')]+_0x2a3c5b['limit'],_0x52bfea;if(_0x2519d4>=_0x2dff31){_0x2519d4=_0x2dff31;_0x52bfea=0xc8;}else{_0x52bfea=0xce;}_0x53f3c0[_0x376a('0x1c')](_0x52bfea);return _0x53f3c0[_0x376a('0x21')](_0x376a('0x22'),_0xa29966+'-'+_0x2519d4+'/'+_0x2dff31)[_0x376a('0x1e')](_0x20768d);}return null;};}function patchUpdates(_0x3220a6){return function(_0x5d12fa){try{jsonpatch[_0x376a('0x23')](_0x5d12fa,_0x3220a6,!![]);}catch(_0x1e9071){return BPromise[_0x376a('0x24')](_0x1e9071);}return _0x5d12fa['save']();};}function saveUpdates(_0x4adf3d,_0x3159b6){return function(_0x2eb45f){if(_0x2eb45f){return _0x2eb45f['update'](_0x4adf3d)[_0x376a('0x25')](function(_0x2b1a35){return _0x2b1a35;});}return null;};}function removeEntity(_0x44b960,_0x12f812){return function(_0x5be541){if(_0x5be541){return _0x5be541[_0x376a('0x26')]()[_0x376a('0x25')](function(){var _0x512950=_0x5be541[_0x376a('0x27')]({'plain':!![]});var _0x146c7c=_0x376a('0x28');return db[_0x376a('0x29')][_0x376a('0x26')]({'where':{'type':_0x146c7c,'resourceId':_0x512950['id']}})[_0x376a('0x25')](function(){return _0x5be541;});})['then'](function(){_0x44b960['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x177396,_0x2adf9f){return function(_0x192502){if(!_0x192502){_0x177396[_0x376a('0x1b')](0x194);}return _0x192502;};}function handleError(_0x9c0b73,_0x54d340){_0x54d340=_0x54d340||0x1f4;return function(_0x46cb76){logger[_0x376a('0x2a')](_0x46cb76['stack']);if(_0x46cb76['name']){delete _0x46cb76[_0x376a('0x2b')];}_0x9c0b73[_0x376a('0x1c')](_0x54d340)['send'](_0x46cb76);};}exports[_0x376a('0x2c')]=function(_0x47f3dd,_0x4dd751){var _0x4c6828={},_0x301bf6={},_0x11c65f={'count':0x0,'rows':[]};var _0x1f8b8b=_['map'](db[_0x376a('0x2d')]['rawAttributes'],function(_0x54ef7b){return{'name':_0x54ef7b[_0x376a('0x2e')],'type':_0x54ef7b[_0x376a('0x2f')]['key']};});_0x301bf6[_0x376a('0x30')]=_['map'](_0x1f8b8b,_0x376a('0x2b'));_0x301bf6['query']=_[_0x376a('0x31')](_0x47f3dd[_0x376a('0x32')]);_0x301bf6['filters']=_[_0x376a('0x33')](_0x301bf6[_0x376a('0x30')],_0x301bf6['query']);_0x4c6828[_0x376a('0x34')]=_[_0x376a('0x33')](_0x301bf6[_0x376a('0x30')],qs[_0x376a('0x35')](_0x47f3dd['query'][_0x376a('0x35')]));_0x4c6828[_0x376a('0x34')]=_0x4c6828['attributes'][_0x376a('0x36')]?_0x4c6828['attributes']:_0x301bf6[_0x376a('0x30')];if(!_0x47f3dd[_0x376a('0x32')][_0x376a('0x37')](_0x376a('0x38'))){_0x4c6828[_0x376a('0x39')]=qs[_0x376a('0x39')](_0x47f3dd['query'][_0x376a('0x39')]);_0x4c6828['offset']=qs[_0x376a('0x20')](_0x47f3dd[_0x376a('0x32')][_0x376a('0x20')]);}_0x4c6828[_0x376a('0x3a')]=qs[_0x376a('0x3b')](_0x47f3dd[_0x376a('0x32')]['sort']);_0x4c6828[_0x376a('0x3c')]=qs['filters'](_[_0x376a('0x3d')](_0x47f3dd['query'],_0x301bf6[_0x376a('0x3e')]));if(_0x47f3dd['query'][_0x376a('0x3f')]){_0x4c6828['where']=_[_0x376a('0x40')](_0x4c6828[_0x376a('0x3c')],{'$or':_['map'](_0x1f8b8b,function(_0x4c48ed){if(_0x4c48ed['type']!==_0x376a('0x41')){var _0xafef3e={};_0xafef3e[_0x4c48ed[_0x376a('0x2b')]]={'$like':'%'+_0x47f3dd['query'][_0x376a('0x3f')]+'%'};return _0xafef3e;}})});}_0x4c6828=_[_0x376a('0x40')]({},_0x4c6828,_0x47f3dd[_0x376a('0x42')]);var _0x45c420={'where':_0x4c6828[_0x376a('0x3c')]};return db['Dashboard'][_0x376a('0x1f')](_0x45c420)[_0x376a('0x25')](function(_0x26328d){_0x11c65f[_0x376a('0x1f')]=_0x26328d;if(_0x47f3dd[_0x376a('0x32')][_0x376a('0x43')]){_0x4c6828[_0x376a('0x44')]=[{'all':!![]}];}return db[_0x376a('0x2d')][_0x376a('0x45')](_0x4c6828);})[_0x376a('0x25')](function(_0xb02cf0){_0x11c65f[_0x376a('0x46')]=_0xb02cf0;return _0x11c65f;})[_0x376a('0x25')](respondWithFilteredResult(_0x4dd751,_0x4c6828))[_0x376a('0x47')](handleError(_0x4dd751,null));};exports[_0x376a('0x48')]=function(_0xf09782,_0x390f33){var _0x3bbae6={'raw':![],'where':{'id':_0xf09782[_0x376a('0x49')]['id']}},_0x3cf7c2={};_0x3cf7c2[_0x376a('0x30')]=_[_0x376a('0x31')](db[_0x376a('0x2d')]['rawAttributes']);_0x3cf7c2['query']=_[_0x376a('0x31')](_0xf09782[_0x376a('0x32')]);_0x3cf7c2[_0x376a('0x3e')]=_[_0x376a('0x33')](_0x3cf7c2[_0x376a('0x30')],_0x3cf7c2[_0x376a('0x32')]);_0x3bbae6[_0x376a('0x34')]=_['intersection'](_0x3cf7c2[_0x376a('0x30')],qs['fields'](_0xf09782[_0x376a('0x32')]['fields']));_0x3bbae6[_0x376a('0x34')]=_0x3bbae6[_0x376a('0x34')][_0x376a('0x36')]?_0x3bbae6['attributes']:_0x3cf7c2[_0x376a('0x30')];if(_0xf09782[_0x376a('0x32')]['includeAll']){_0x3bbae6[_0x376a('0x44')]=[{'all':!![]}];}_0x3bbae6=_['merge']({},_0x3bbae6,_0xf09782[_0x376a('0x42')]);return db[_0x376a('0x2d')][_0x376a('0x4a')](_0x3bbae6)[_0x376a('0x25')](handleEntityNotFound(_0x390f33,null))[_0x376a('0x25')](respondWithResult(_0x390f33,null))['catch'](handleError(_0x390f33,null));};exports[_0x376a('0x4b')]=function(_0xb381db,_0xd009ab){return db['Dashboard']['create'](_0xb381db[_0x376a('0x4c')],{})[_0x376a('0x25')](function(_0x473bd3){var _0x2a7639=_0xb381db['user']['get']({'plain':!![]});if(!_0x2a7639)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2a7639['role']==='user'){var _0x2329a7=_0x473bd3[_0x376a('0x27')]({'plain':!![]});var _0x214bed=_0x376a('0x28');return db['UserProfileSection'][_0x376a('0x4a')]({'where':{'name':_0x214bed,'userProfileId':_0x2a7639[_0x376a('0x4d')]},'raw':!![]})[_0x376a('0x25')](function(_0x54d2c6){if(_0x54d2c6&&_0x54d2c6[_0x376a('0x4e')]===0x0){return db[_0x376a('0x29')]['create']({'name':_0x2329a7[_0x376a('0x2b')],'resourceId':_0x2329a7['id'],'type':_0x54d2c6['name'],'sectionId':_0x54d2c6['id']},{})[_0x376a('0x25')](function(){return _0x473bd3;});}else{return _0x473bd3;}})['catch'](function(_0x4103c0){logger[_0x376a('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4103c0);throw _0x4103c0;});}return _0x473bd3;})[_0x376a('0x25')](respondWithResult(_0xd009ab,0xc9))[_0x376a('0x47')](handleError(_0xd009ab,null));};exports[_0x376a('0x4f')]=function(_0x4cb8ec,_0x580388){var _0x2da5fd={'where':{'id':_0x4cb8ec[_0x376a('0x49')]['id']}},_0x3445c3={};_0x3445c3[_0x376a('0x30')]=_[_0x376a('0x31')](db[_0x376a('0x2d')][_0x376a('0x50')]);_0x2da5fd['attributes']=_[_0x376a('0x33')](_0x3445c3['model'],qs['fields'](_0x4cb8ec['query']['fields']));_0x2da5fd['attributes']=_0x2da5fd[_0x376a('0x34')]['length']?_0x2da5fd[_0x376a('0x34')]:_0x3445c3[_0x376a('0x30')];if(_0x4cb8ec[_0x376a('0x32')][_0x376a('0x43')]){_0x2da5fd[_0x376a('0x44')]=[{'all':!![]}];}_0x2da5fd=_[_0x376a('0x40')]({},_0x2da5fd,_0x4cb8ec[_0x376a('0x42')]);return db[_0x376a('0x2d')][_0x376a('0x4a')](_0x2da5fd)[_0x376a('0x25')](handleEntityNotFound(_0x580388,null))[_0x376a('0x25')](function(_0x3f2289){if(_0x3f2289){var _0xa97d3d=_0x3f2289[_0x376a('0x27')]({'plain':!![]});_0xa97d3d=qs[_0x376a('0x51')](_0xa97d3d,['id',_0x376a('0x52'),'updatedAt']);_0x4cb8ec[_0x376a('0x4c')]=_[_0x376a('0x51')](_0x4cb8ec['body'],['id',_0x376a('0x52'),_0x376a('0x53')]);return db[_0x376a('0x2d')]['create'](_['merge'](_0xa97d3d,_0x4cb8ec[_0x376a('0x4c')]),{'include':_0x4cb8ec[_0x376a('0x32')][_0x376a('0x43')]?[{'all':!![]}]:undefined})['then'](function(_0x17af1f){var _0x4ce5e0=_0x4cb8ec[_0x376a('0x54')][_0x376a('0x27')]({'plain':!![]});if(!_0x4ce5e0)throw new Error(_0x376a('0x55'));if(_0x4ce5e0[_0x376a('0x56')]===_0x376a('0x54')){var _0x411413=_0x17af1f[_0x376a('0x27')]({'plain':!![]});var _0xe4bf0c=_0x376a('0x28');return db[_0x376a('0x57')][_0x376a('0x4a')]({'where':{'name':_0xe4bf0c,'userProfileId':_0x4ce5e0[_0x376a('0x4d')]},'raw':!![]})[_0x376a('0x25')](function(_0x5054b8){if(_0x5054b8&&_0x5054b8[_0x376a('0x4e')]===0x0){return db[_0x376a('0x29')][_0x376a('0x4b')]({'name':_0x411413[_0x376a('0x2b')],'resourceId':_0x411413['id'],'type':_0x5054b8[_0x376a('0x2b')],'sectionId':_0x5054b8['id']},{})[_0x376a('0x25')](function(){return _0x17af1f;});}else{return _0x17af1f;}})[_0x376a('0x47')](function(_0xe7f7dc){logger['error'](_0x376a('0x58'),_0xe7f7dc);throw _0xe7f7dc;});}return _0x17af1f;});}})[_0x376a('0x25')](respondWithResult(_0x580388,0xc9))[_0x376a('0x47')](handleError(_0x580388,null));};exports['update']=function(_0x1bc5af,_0x4cccc1){if(_0x1bc5af[_0x376a('0x4c')]['id']){delete _0x1bc5af[_0x376a('0x4c')]['id'];}return db[_0x376a('0x2d')][_0x376a('0x4a')]({'where':{'id':_0x1bc5af[_0x376a('0x49')]['id']}})[_0x376a('0x25')](handleEntityNotFound(_0x4cccc1,null))[_0x376a('0x25')](saveUpdates(_0x1bc5af[_0x376a('0x4c')],null))[_0x376a('0x25')](respondWithResult(_0x4cccc1,null))[_0x376a('0x47')](handleError(_0x4cccc1,null));};exports['destroy']=function(_0x479924,_0x3578f6){return db['Dashboard'][_0x376a('0x4a')]({'where':{'id':_0x479924['params']['id']}})[_0x376a('0x25')](handleEntityNotFound(_0x3578f6,null))[_0x376a('0x25')](removeEntity(_0x3578f6,null))['catch'](handleError(_0x3578f6,null));};function widgetAttributes(_0x49b759){try{switch(_0x49b759[_0x376a('0x2f')]){case _0x376a('0x59'):return[{'name':_0x376a('0x5a'),'value':_0x49b759[_0x376a('0x5a')]||(_0x49b759['attrs']&&_0x49b759['attrs'][0x0]?_0x49b759[_0x376a('0x5b')][0x0][_0x376a('0x5c')]:undefined)||'https://'}];case'custom':return[{'name':_0x376a('0x5d'),'value':_0x49b759[_0x376a('0x5d')]||(_0x49b759['attrs']&&_0x49b759['attrs'][0x0]?_0x49b759[_0x376a('0x5b')][0x0][_0x376a('0x5c')]:undefined)||''}];case _0x376a('0x5e'):return[{'name':'attrHourFormat','value':_0x49b759[_0x376a('0x5f')]||(_0x49b759[_0x376a('0x5b')]&&_0x49b759['attrs'][0x0]?_0x49b759[_0x376a('0x5b')][0x0][_0x376a('0x5c')]:undefined)||_0x376a('0x60')},{'name':'attrTimezone','value':_0x49b759[_0x376a('0x61')]||(_0x49b759[_0x376a('0x5b')]&&_0x49b759[_0x376a('0x5b')][0x1]?_0x49b759['attrs'][0x1][_0x376a('0x5c')]:undefined)||_0x376a('0x62')},{'name':'attrFontSize','value':_0x49b759[_0x376a('0x63')]||(_0x49b759[_0x376a('0x5b')]&&_0x49b759[_0x376a('0x5b')][0x2]?_0x49b759[_0x376a('0x5b')][0x2][_0x376a('0x5c')]:undefined)||0xc}];case _0x376a('0x64'):return[{'name':_0x376a('0x65'),'value':_0x49b759[_0x376a('0x65')]||(_0x49b759[_0x376a('0x5b')]&&_0x49b759[_0x376a('0x5b')][0x0]?_0x49b759['attrs'][0x0][_0x376a('0x5c')]:undefined)||_0x376a('0x66')},{'name':_0x376a('0x67'),'value':_0x49b759[_0x376a('0x67')]||(_0x49b759[_0x376a('0x5b')]&&_0x49b759['attrs'][0x1]?_0x49b759[_0x376a('0x5b')][0x1][_0x376a('0x5c')]:undefined)||[]},{'name':_0x376a('0x63'),'value':_0x49b759[_0x376a('0x63')]||(_0x49b759[_0x376a('0x5b')]&&_0x49b759[_0x376a('0x5b')][0x2]?_0x49b759[_0x376a('0x5b')][0x2]['value']:undefined)||0x14}];case'multibar-chart':case'pie-chart':return[{'name':'attrSerie1','value':_0x49b759[_0x376a('0x68')]||(_0x49b759['attrs']&&_0x49b759[_0x376a('0x5b')][0x0]?_0x49b759[_0x376a('0x5b')][0x0][_0x376a('0x5c')]:undefined)||_0x376a('0x66')},{'name':_0x376a('0x69'),'value':_0x49b759[_0x376a('0x69')]||(_0x49b759[_0x376a('0x5b')]&&_0x49b759[_0x376a('0x5b')][0x1]?_0x49b759[_0x376a('0x5b')][0x1][_0x376a('0x5c')]:undefined)||null},{'name':_0x376a('0x6a'),'value':_0x49b759[_0x376a('0x6a')]||(_0x49b759[_0x376a('0x5b')]&&_0x49b759[_0x376a('0x5b')][0x2]?_0x49b759[_0x376a('0x5b')][0x2][_0x376a('0x5c')]:undefined)||null},{'name':_0x376a('0x67'),'value':_0x49b759[_0x376a('0x67')]||(_0x49b759[_0x376a('0x5b')]&&_0x49b759[_0x376a('0x5b')][0x3]?_0x49b759[_0x376a('0x5b')][0x3][_0x376a('0x5c')]:undefined)||[]}];case _0x376a('0x6b'):return[{'name':'attrReport','type':_0x49b759['reportType']||(_0x49b759[_0x376a('0x5b')]&&_0x49b759['attrs'][0x0]?_0x49b759[_0x376a('0x5b')][0x0][_0x376a('0x2f')]:undefined)||null,'value':_0x49b759[_0x376a('0x6c')]||(_0x49b759[_0x376a('0x5b')]&&_0x49b759['attrs'][0x0]?_0x49b759[_0x376a('0x5b')][0x0][_0x376a('0x5c')]:undefined)||null},{'name':_0x376a('0x6d'),'value':_0x49b759[_0x376a('0x6d')]||(_0x49b759[_0x376a('0x5b')]&&_0x49b759['attrs'][0x1]?_0x49b759[_0x376a('0x5b')][0x1][_0x376a('0x5c')]:undefined)||0x0}];default:return[];}}catch(_0x3afb7d){logger[_0x376a('0x2a')](_0x376a('0x6e'),JSON['stringify'](_0x3afb7d));return[];}}exports['addItem']=function(_0x228f73,_0x3fd733,_0x21d0eb){if(_0x228f73[_0x376a('0x4c')]['id']){delete _0x228f73[_0x376a('0x4c')]['id'];}return db[_0x376a('0x2d')]['find']({'where':{'id':_0x228f73[_0x376a('0x49')]['id']}})[_0x376a('0x25')](handleEntityNotFound(_0x3fd733,null))[_0x376a('0x25')](function(_0x425817){if(_0x425817){_0x228f73[_0x376a('0x4c')][_0x376a('0x6f')]=_0x425817['id'];_0x228f73[_0x376a('0x4c')][_0x376a('0x5b')]=widgetAttributes(_0x228f73['body']);return db[_0x376a('0x70')][_0x376a('0x4b')](_0x228f73[_0x376a('0x4c')]);}})[_0x376a('0x25')](respondWithResult(_0x3fd733,null))['catch'](handleError(_0x3fd733,null));};exports[_0x376a('0x71')]=function(_0x267fcf,_0x3b5c11,_0x4c85aa){var _0x3eb09f={};var _0x530155={};var _0x4685e0;var _0x4526b7;return db[_0x376a('0x2d')][_0x376a('0x72')]({'where':{'id':_0x267fcf['params']['id']}})['then'](handleEntityNotFound(_0x3b5c11,null))[_0x376a('0x25')](function(_0x747556){if(_0x747556){_0x4685e0=_0x747556;_0x530155[_0x376a('0x30')]=_['keys'](db[_0x376a('0x70')][_0x376a('0x50')]);_0x530155[_0x376a('0x32')]=_['keys'](_0x267fcf[_0x376a('0x32')]);_0x530155[_0x376a('0x3e')]=_[_0x376a('0x33')](_0x530155[_0x376a('0x30')],_0x530155[_0x376a('0x32')]);_0x3eb09f[_0x376a('0x34')]=_[_0x376a('0x33')](_0x530155[_0x376a('0x30')],qs['fields'](_0x267fcf[_0x376a('0x32')]['fields']));_0x3eb09f[_0x376a('0x34')]=_0x3eb09f[_0x376a('0x34')]['length']?_0x3eb09f[_0x376a('0x34')]:_0x530155[_0x376a('0x30')];_0x3eb09f[_0x376a('0x3a')]=qs['sort'](_0x267fcf[_0x376a('0x32')][_0x376a('0x3b')]);_0x3eb09f[_0x376a('0x3c')]=qs['filters'](_['pick'](_0x267fcf[_0x376a('0x32')],_0x530155[_0x376a('0x3e')]));if(_0x267fcf[_0x376a('0x32')][_0x376a('0x3f')]){_0x3eb09f[_0x376a('0x3c')]=_[_0x376a('0x40')](_0x3eb09f[_0x376a('0x3c')],{'$or':_['map'](_0x3eb09f[_0x376a('0x34')],function(_0x2b0aa4){var _0x46e4a3={};_0x46e4a3[_0x2b0aa4]={'$like':'%'+_0x267fcf['query']['filter']+'%'};return _0x46e4a3;})});}_0x3eb09f=_[_0x376a('0x40')]({},_0x3eb09f,_0x267fcf[_0x376a('0x42')]);return _0x4685e0[_0x376a('0x71')](_0x3eb09f);}})[_0x376a('0x25')](function(_0x347153){if(_0x347153){_0x4526b7=_0x347153[_0x376a('0x36')];if(!_0x267fcf['query'][_0x376a('0x37')](_0x376a('0x38'))){_0x3eb09f['limit']=qs[_0x376a('0x39')](_0x267fcf[_0x376a('0x32')]['limit']);_0x3eb09f[_0x376a('0x20')]=qs[_0x376a('0x20')](_0x267fcf[_0x376a('0x32')]['offset']);}return _0x4685e0[_0x376a('0x71')](_0x3eb09f);}})['then'](function(_0xdc9952){if(_0xdc9952){return _0xdc9952?{'count':_0x4526b7,'rows':_0xdc9952}:null;}})[_0x376a('0x25')](respondWithResult(_0x3b5c11,null))[_0x376a('0x47')](handleError(_0x3b5c11,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 57c51a8..edba0ef 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 _0xbf46=['Dashboard','save','remove','emit','events','../../mysqldb'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xbf46,0xe2));var _0x6bf4=function(_0x2563f7,_0x4daa86){_0x2563f7=_0x2563f7-0x0;var _0x4d65fd=_0xbf46[_0x2563f7];return _0x4d65fd;};'use strict';var EventEmitter=require(_0x6bf4('0x0'));var Dashboard=require(_0x6bf4('0x1'))['db'][_0x6bf4('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6bf4('0x3'),'afterUpdate':'update','afterDestroy':_0x6bf4('0x4')};function emitEvent(_0x4b2f37){return function(_0x300e65,_0x506964,_0x12af0f){DashboardEvents[_0x6bf4('0x5')](_0x4b2f37+':'+_0x300e65['id'],_0x300e65);DashboardEvents['emit'](_0x4b2f37,_0x300e65);_0x12af0f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file +var _0xa0da=['exports','events','../../mysqldb','Dashboard','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x560d31,_0x9a1440){var _0x62f798=function(_0xeec944){while(--_0xeec944){_0x560d31['push'](_0x560d31['shift']());}};_0x62f798(++_0x9a1440);}(_0xa0da,0x1ae));var _0xaa0d=function(_0x5c09e1,_0x5dd43d){_0x5c09e1=_0x5c09e1-0x0;var _0x1b6f85=_0xa0da[_0x5c09e1];return _0x1b6f85;};'use strict';var EventEmitter=require(_0xaa0d('0x0'));var Dashboard=require(_0xaa0d('0x1'))['db'][_0xaa0d('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xaa0d('0x3')](0x0);var events={'afterCreate':_0xaa0d('0x4'),'afterUpdate':_0xaa0d('0x5'),'afterDestroy':_0xaa0d('0x6')};function emitEvent(_0x22ac75){return function(_0x32c7da,_0x4f5e3,_0x26d9c7){DashboardEvents[_0xaa0d('0x7')](_0x22ac75+':'+_0x32c7da['id'],_0x32c7da);DashboardEvents[_0xaa0d('0x7')](_0x22ac75,_0x32c7da);_0x26d9c7(null);};}for(var e in events){if(events[_0xaa0d('0x8')](e)){var event=events[e];Dashboard[_0xaa0d('0x9')](e,emitEvent(event));}}module[_0xaa0d('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 c5f9e22..a8d8343 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 _0x94af=['./dashboard.attributes','exports','define','dashboards','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2dbf6d,_0x1ed975){var _0x269475=function(_0x217213){while(--_0x217213){_0x2dbf6d['push'](_0x2dbf6d['shift']());}};_0x269475(++_0x1ed975);}(_0x94af,0x190));var _0xf94a=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0x94af[_0x36dfbd];return _0x4ecad9;};'use strict';var _=require(_0xf94a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf94a('0x1'));var moment=require(_0xf94a('0x2'));var BPromise=require(_0xf94a('0x3'));var rp=require(_0xf94a('0x4'));var fs=require('fs');var path=require(_0xf94a('0x5'));var rimraf=require(_0xf94a('0x6'));var config=require(_0xf94a('0x7'));var attributes=require(_0xf94a('0x8'));module[_0xf94a('0x9')]=function(_0x3606d2,_0x3c6acf){return _0x3606d2[_0xf94a('0xa')]('Dashboard',attributes,{'tableName':_0xf94a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa6fd=['./dashboard.attributes','define','Dashboard','dashboards','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x959512,_0x65fc21){var _0x1db93f=function(_0x4e972e){while(--_0x4e972e){_0x959512['push'](_0x959512['shift']());}};_0x1db93f(++_0x65fc21);}(_0xa6fd,0x122));var _0xda6f=function(_0x123d3d,_0x114ea5){_0x123d3d=_0x123d3d-0x0;var _0x5707bf=_0xa6fd[_0x123d3d];return _0x5707bf;};'use strict';var _=require(_0xda6f('0x0'));var util=require(_0xda6f('0x1'));var logger=require(_0xda6f('0x2'))(_0xda6f('0x3'));var moment=require(_0xda6f('0x4'));var BPromise=require(_0xda6f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xda6f('0x6'));var rimraf=require(_0xda6f('0x7'));var config=require(_0xda6f('0x8'));var attributes=require(_0xda6f('0x9'));module['exports']=function(_0x51e403,_0xd26425){return _0x51e403[_0xda6f('0xa')](_0xda6f('0xb'),attributes,{'tableName':_0xda6f('0xc'),'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 fb25428..6b6d052 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 _0x0abf=['rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./dashboard.socket','register','request','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x527924,_0x17c9e3){var _0x27d6a3=function(_0x1d1c6e){while(--_0x1d1c6e){_0x527924['push'](_0x527924['shift']());}};_0x27d6a3(++_0x17c9e3);}(_0x0abf,0x13f));var _0xf0ab=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x0abf[_0x2b4411];return _0x8e41ef;};'use strict';var _=require('lodash');var util=require(_0xf0ab('0x0'));var moment=require(_0xf0ab('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf0ab('0x2'));var db=require(_0xf0ab('0x3'))['db'];var utils=require(_0xf0ab('0x4'));var logger=require('../../config/logger')(_0xf0ab('0x5'));var config=require(_0xf0ab('0x6'));var jayson=require(_0xf0ab('0x7'));var client=jayson[_0xf0ab('0x8')][_0xf0ab('0x9')]({'port':0x232a});config['redis']=_[_0xf0ab('0xa')](config[_0xf0ab('0xb')],{'host':_0xf0ab('0xc'),'port':0x18eb});var socket=require(_0xf0ab('0xd'))(new Redis(config[_0xf0ab('0xb')]));require(_0xf0ab('0xe'))[_0xf0ab('0xf')](socket);function respondWithRpcPromise(_0x341cc0,_0x3e545f,_0x3781f9){return new BPromise(function(_0x48f5db,_0x5d7a9d){return client[_0xf0ab('0x10')](_0x341cc0,_0x3781f9)['then'](function(_0x193c0c){logger[_0xf0ab('0x11')](_0xf0ab('0x12'),_0x3e545f,_0xf0ab('0x13'));logger[_0xf0ab('0x14')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x3e545f,_0xf0ab('0x13'),JSON[_0xf0ab('0x15')](_0x193c0c));if(_0x193c0c[_0xf0ab('0x16')]){if(_0x193c0c[_0xf0ab('0x16')][_0xf0ab('0x17')]===0x1f4){logger['error'](_0xf0ab('0x12'),_0x3e545f,_0x193c0c['error']['message']);return _0x5d7a9d(_0x193c0c[_0xf0ab('0x16')]['message']);}logger[_0xf0ab('0x16')](_0xf0ab('0x12'),_0x3e545f,_0x193c0c[_0xf0ab('0x16')][_0xf0ab('0x18')]);return _0x48f5db(_0x193c0c[_0xf0ab('0x16')][_0xf0ab('0x18')]);}else{logger[_0xf0ab('0x11')]('Dashboard,\x20%s,\x20%s',_0x3e545f,'request\x20sent');_0x48f5db(_0x193c0c[_0xf0ab('0x19')][_0xf0ab('0x18')]);}})[_0xf0ab('0x1a')](function(_0x514b15){logger['error'](_0xf0ab('0x12'),_0x3e545f,_0x514b15);_0x5d7a9d(_0x514b15);});});} \ No newline at end of file +var _0x986e=['request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','error','message','info','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','request','then','Dashboard,\x20%s,\x20%s'];(function(_0x49a57c,_0x2eb02c){var _0x4e0316=function(_0x37e2e5){while(--_0x37e2e5){_0x49a57c['push'](_0x49a57c['shift']());}};_0x4e0316(++_0x2eb02c);}(_0x986e,0xb4));var _0xe986=function(_0x3d1b70,_0xf0ef7){_0x3d1b70=_0x3d1b70-0x0;var _0x300efc=_0x986e[_0x3d1b70];return _0x300efc;};'use strict';var _=require(_0xe986('0x0'));var util=require(_0xe986('0x1'));var moment=require(_0xe986('0x2'));var BPromise=require(_0xe986('0x3'));var rs=require(_0xe986('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe986('0x5'))['db'];var utils=require(_0xe986('0x6'));var logger=require(_0xe986('0x7'))(_0xe986('0x8'));var config=require('../../config/environment');var jayson=require(_0xe986('0x9'));var client=jayson[_0xe986('0xa')][_0xe986('0xb')]({'port':0x232a});config[_0xe986('0xc')]=_[_0xe986('0xd')](config[_0xe986('0xc')],{'host':_0xe986('0xe'),'port':0x18eb});var socket=require(_0xe986('0xf'))(new Redis(config['redis']));require(_0xe986('0x10'))['register'](socket);function respondWithRpcPromise(_0x5b761c,_0x22bf10,_0x35020d){return new BPromise(function(_0x57eaa2,_0x30da2c){return client[_0xe986('0x11')](_0x5b761c,_0x35020d)[_0xe986('0x12')](function(_0x4deac6){logger['info'](_0xe986('0x13'),_0x22bf10,_0xe986('0x14'));logger['debug'](_0xe986('0x15'),_0x22bf10,_0xe986('0x14'),JSON['stringify'](_0x4deac6));if(_0x4deac6[_0xe986('0x16')]){if(_0x4deac6[_0xe986('0x16')]['code']===0x1f4){logger['error'](_0xe986('0x13'),_0x22bf10,_0x4deac6[_0xe986('0x16')][_0xe986('0x17')]);return _0x30da2c(_0x4deac6['error'][_0xe986('0x17')]);}logger['error'](_0xe986('0x13'),_0x22bf10,_0x4deac6['error'][_0xe986('0x17')]);return _0x57eaa2(_0x4deac6[_0xe986('0x16')][_0xe986('0x17')]);}else{logger[_0xe986('0x18')]('Dashboard,\x20%s,\x20%s',_0x22bf10,_0xe986('0x14'));_0x57eaa2(_0x4deac6['result'][_0xe986('0x17')]);}})['catch'](function(_0x1cf019){logger[_0xe986('0x16')](_0xe986('0x13'),_0x22bf10,_0x1cf019);_0x30da2c(_0x1cf019);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index c280a58..8f29e33 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 _0x22d2=['register','length','dashboard:','./dashboard.events','save','remove','emit','removeListener'];(function(_0x40f4cc,_0x432f55){var _0x458315=function(_0xcfda5e){while(--_0xcfda5e){_0x40f4cc['push'](_0x40f4cc['shift']());}};_0x458315(++_0x432f55);}(_0x22d2,0x1db));var _0x222d=function(_0x8dd165,_0x192721){_0x8dd165=_0x8dd165-0x0;var _0x57fb03=_0x22d2[_0x8dd165];return _0x57fb03;};'use strict';var DashboardEvents=require(_0x222d('0x0'));var events=[_0x222d('0x1'),_0x222d('0x2'),'update'];function createListener(_0x55418f,_0x44e22d){return function(_0x4f7fcc){_0x44e22d[_0x222d('0x3')](_0x55418f,_0x4f7fcc);};}function removeListener(_0x49515d,_0x466002){return function(){DashboardEvents[_0x222d('0x4')](_0x49515d,_0x466002);};}exports[_0x222d('0x5')]=function(_0xbbeee9){for(var _0x2709e8=0x0,_0x13733=events[_0x222d('0x6')];_0x2709e8<_0x13733;_0x2709e8++){var _0x2089b2=events[_0x2709e8];var _0x31df9c=createListener(_0x222d('0x7')+_0x2089b2,_0xbbeee9);DashboardEvents['on'](_0x2089b2,_0x31df9c);}}; \ No newline at end of file +var _0xd4d9=['register','length','./dashboard.events','save','update','emit','removeListener'];(function(_0x1b3808,_0x2bc224){var _0x426e3c=function(_0x5b23c2){while(--_0x5b23c2){_0x1b3808['push'](_0x1b3808['shift']());}};_0x426e3c(++_0x2bc224);}(_0xd4d9,0xb1));var _0x9d4d=function(_0x2a7a0e,_0x217e41){_0x2a7a0e=_0x2a7a0e-0x0;var _0x3eaeaf=_0xd4d9[_0x2a7a0e];return _0x3eaeaf;};'use strict';var DashboardEvents=require(_0x9d4d('0x0'));var events=[_0x9d4d('0x1'),'remove',_0x9d4d('0x2')];function createListener(_0x533ed9,_0x31f04e){return function(_0x583029){_0x31f04e[_0x9d4d('0x3')](_0x533ed9,_0x583029);};}function removeListener(_0x473ceb,_0x8869b){return function(){DashboardEvents[_0x9d4d('0x4')](_0x473ceb,_0x8869b);};}exports[_0x9d4d('0x5')]=function(_0x51d5ef){for(var _0x305046=0x0,_0x13a73e=events[_0x9d4d('0x6')];_0x305046<_0x13a73e;_0x305046++){var _0x28f4df=events[_0x305046];var _0x122e9a=createListener('dashboard:'+_0x28f4df,_0x51d5ef);DashboardEvents['on'](_0x28f4df,_0x122e9a);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 973f8cd..91a2709 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 _0xa9e0=['/:id','/:id/items','post','create','/:id/clone','addItem','put','update','delete','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated'];(function(_0x4eb2c1,_0x3bd8c5){var _0x5a7ed4=function(_0x263235){while(--_0x263235){_0x4eb2c1['push'](_0x4eb2c1['shift']());}};_0x5a7ed4(++_0x3bd8c5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'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 auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['show']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['getItems']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xb')](_0x0a9e('0xd'),auth[_0x0a9e('0x8')](),controller['clone']);router['post']('/:id/items',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')]('/:id',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x12')]);module[_0x0a9e('0x13')]=router; \ No newline at end of file +var _0xa9e0=['/:id','/:id/items','post','create','/:id/clone','addItem','put','update','delete','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated'];(function(_0x115783,_0x24a17b){var _0x5b67b0=function(_0x377b9b){while(--_0x377b9b){_0x115783['push'](_0x115783['shift']());}};_0x5b67b0(++_0x24a17b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'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 auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['show']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['getItems']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xb')](_0x0a9e('0xd'),auth[_0x0a9e('0x8')](),controller['clone']);router['post']('/:id/items',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')]('/:id',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x12')]);module[_0x0a9e('0x13')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 251174a..6bd2555 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 _0x8884=['long','attrs','setDataValue','stringify','INTEGER','#ffffff','sequelize','exports','STRING'];(function(_0x947465,_0x18f488){var _0x2c3e1b=function(_0x5a34cc){while(--_0x5a34cc){_0x947465['push'](_0x947465['shift']());}};_0x2c3e1b(++_0x18f488);}(_0x8884,0xe7));var _0x4888=function(_0x1b00c3,_0x4057a7){_0x1b00c3=_0x1b00c3-0x0;var _0x1f07e2=_0x8884[_0x1b00c3];return _0x1f07e2;};'use strict';var Sequelize=require(_0x4888('0x0'));var squel=require('squel');var _=require('lodash');module[_0x4888('0x1')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x4888('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x4888('0x3')),'get':function(){try{return JSON['parse'](this['getDataValue'](_0x4888('0x4')));}catch(_0x33973e){return[];}},'set':function(_0xc03da2){try{this[_0x4888('0x5')](_0x4888('0x4'),JSON[_0x4888('0x6')](_0xc03da2));}catch(_0x279028){this[_0x4888('0x5')](_0x4888('0x4'),JSON[_0x4888('0x6')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x4888('0x7')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x4888('0x7')]},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize[_0x4888('0x2')],'allowNull':![],'defaultValue':_0x4888('0x8'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x4888('0x2')]}}; \ No newline at end of file +var _0xf6e3=['STRING','long','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','sequelize','squel','exports'];(function(_0xab2fa1,_0x65e0c6){var _0x33c287=function(_0x3016aa){while(--_0x3016aa){_0xab2fa1['push'](_0xab2fa1['shift']());}};_0x33c287(++_0x65e0c6);}(_0xf6e3,0x17e));var _0x3f6e=function(_0x3b5ff0,_0x318256){_0x3b5ff0=_0x3b5ff0-0x0;var _0x5be497=_0xf6e3[_0x3b5ff0];return _0x5be497;};'use strict';var Sequelize=require(_0x3f6e('0x0'));var squel=require(_0x3f6e('0x1'));var _=require('lodash');module[_0x3f6e('0x2')]={'title':{'type':Sequelize[_0x3f6e('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x3f6e('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x3f6e('0x4')),'get':function(){try{return JSON['parse'](this['getDataValue'](_0x3f6e('0x5')));}catch(_0x44853b){return[];}},'set':function(_0x41dd85){try{this[_0x3f6e('0x6')](_0x3f6e('0x5'),JSON['stringify'](_0x41dd85));}catch(_0x2483b3){this['setDataValue']('attrs',JSON[_0x3f6e('0x7')]([]));}}},'sizeX':{'type':Sequelize[_0x3f6e('0x8')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x3f6e('0x8')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x3f6e('0x8')]},'col':{'type':Sequelize[_0x3f6e('0x8')]},'background':{'type':Sequelize[_0x3f6e('0x3')],'allowNull':![],'defaultValue':_0x3f6e('0x9'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3f6e('0xa'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 8cc3dd6..66f339e 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 _0x3504=['lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','status','end','json','offset','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','show','params','model','keys','DashboardItem','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','options','find','catch','type','iframe','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','create','body','update','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs'];(function(_0x44a64f,_0x38475c){var _0x52024b=function(_0x2cd055){while(--_0x2cd055){_0x44a64f['push'](_0x44a64f['shift']());}};_0x52024b(++_0x38475c);}(_0x3504,0xfb));var _0x4350=function(_0x11e92f,_0x44ac05){_0x11e92f=_0x11e92f-0x0;var _0x2ecc8c=_0x3504[_0x11e92f];return _0x2ecc8c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4350('0x0'));var rimraf=require(_0x4350('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4350('0x2'));var rp=require(_0x4350('0x3'));var moment=require(_0x4350('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4350('0x5'));var util=require(_0x4350('0x6'));var path=require(_0x4350('0x7'));var sox=require('sox');var csv=require(_0x4350('0x8'));var ejs=require(_0x4350('0x9'));var fs=require('fs');var _=require(_0x4350('0xa'));var squel=require(_0x4350('0xb'));var crypto=require(_0x4350('0xc'));var jsforce=require(_0x4350('0xd'));var deskjs=require(_0x4350('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4350('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4350('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4350('0x11'));var hardwareService=require(_0x4350('0x12'));var logger=require(_0x4350('0x13'))(_0x4350('0x14'));var utils=require('../../config/utils');var config=require(_0x4350('0x15'));var db=require(_0x4350('0x16'))['db'];config[_0x4350('0x17')]=_[_0x4350('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4350('0x19'))(new Redis(config['redis']));require(_0x4350('0x1a'))[_0x4350('0x1b')](socket);function respondWithStatusCode(_0x2faddd,_0x53d271){_0x53d271=_0x53d271||0xcc;return function(_0x1cefb6){if(_0x1cefb6){return _0x2faddd['sendStatus'](_0x53d271);}return _0x2faddd[_0x4350('0x1c')](_0x53d271)[_0x4350('0x1d')]();};}function respondWithResult(_0x449f46,_0xb3d87b){_0xb3d87b=_0xb3d87b||0xc8;return function(_0x892202){if(_0x892202){return _0x449f46[_0x4350('0x1c')](_0xb3d87b)[_0x4350('0x1e')](_0x892202);}};}function respondWithFilteredResult(_0xfa5551,_0x18bd91){return function(_0xf9977e){if(_0xf9977e){var _0x17f226=_0xf9977e['count'],_0x21037b=_0x18bd91[_0x4350('0x1f')],_0x261796=_0x18bd91['offset']+_0x18bd91['limit'],_0x45aaea;if(_0x261796>=_0x17f226){_0x261796=_0x17f226;_0x45aaea=0xc8;}else{_0x45aaea=0xce;}_0xfa5551[_0x4350('0x1c')](_0x45aaea);return _0xfa5551['set'](_0x4350('0x20'),_0x21037b+'-'+_0x261796+'/'+_0x17f226)[_0x4350('0x1e')](_0xf9977e);}return null;};}function patchUpdates(_0x1f3069){return function(_0x26ce7f){try{jsonpatch[_0x4350('0x21')](_0x26ce7f,_0x1f3069,!![]);}catch(_0x10ac5a){return BPromise[_0x4350('0x22')](_0x10ac5a);}return _0x26ce7f[_0x4350('0x23')]();};}function saveUpdates(_0x574de2,_0x7e251){return function(_0x546a44){if(_0x546a44){return _0x546a44['update'](_0x574de2)[_0x4350('0x24')](function(_0x1cae4f){return _0x1cae4f;});}return null;};}function removeEntity(_0x387832,_0x22c30d){return function(_0x11a779){if(_0x11a779){return _0x11a779[_0x4350('0x25')]()[_0x4350('0x24')](function(){_0x387832[_0x4350('0x1c')](0xcc)[_0x4350('0x1d')]();});}};}function handleEntityNotFound(_0xefd5bd,_0x38ffca){return function(_0x305aa0){if(!_0x305aa0){_0xefd5bd['sendStatus'](0x194);}return _0x305aa0;};}function handleError(_0x500584,_0x16e188){_0x16e188=_0x16e188||0x1f4;return function(_0xcaa029){logger[_0x4350('0x26')](_0xcaa029[_0x4350('0x27')]);if(_0xcaa029[_0x4350('0x28')]){delete _0xcaa029[_0x4350('0x28')];}_0x500584['status'](_0x16e188)[_0x4350('0x29')](_0xcaa029);};}exports[_0x4350('0x2a')]=function(_0x4ccc7b,_0xca26d0){var _0x571b32={'raw':![],'where':{'id':_0x4ccc7b[_0x4350('0x2b')]['id']}},_0x1df8fa={};_0x1df8fa[_0x4350('0x2c')]=_[_0x4350('0x2d')](db[_0x4350('0x2e')][_0x4350('0x2f')]);_0x1df8fa[_0x4350('0x30')]=_['keys'](_0x4ccc7b['query']);_0x1df8fa[_0x4350('0x31')]=_[_0x4350('0x32')](_0x1df8fa[_0x4350('0x2c')],_0x1df8fa['query']);_0x571b32[_0x4350('0x33')]=_[_0x4350('0x32')](_0x1df8fa[_0x4350('0x2c')],qs[_0x4350('0x34')](_0x4ccc7b[_0x4350('0x30')][_0x4350('0x34')]));_0x571b32[_0x4350('0x33')]=_0x571b32[_0x4350('0x33')][_0x4350('0x35')]?_0x571b32[_0x4350('0x33')]:_0x1df8fa['model'];if(_0x4ccc7b['query'][_0x4350('0x36')]){_0x571b32[_0x4350('0x37')]=[{'all':!![]}];}_0x571b32=_['merge']({},_0x571b32,_0x4ccc7b[_0x4350('0x38')]);return db[_0x4350('0x2e')][_0x4350('0x39')](_0x571b32)[_0x4350('0x24')](handleEntityNotFound(_0xca26d0,null))['then'](respondWithResult(_0xca26d0,null))['catch'](handleError(_0xca26d0,null));};exports[_0x4350('0x25')]=function(_0x214f98,_0x2b9d05){return db[_0x4350('0x2e')][_0x4350('0x39')]({'where':{'id':_0x214f98[_0x4350('0x2b')]['id']}})[_0x4350('0x24')](handleEntityNotFound(_0x2b9d05,null))['then'](removeEntity(_0x2b9d05,null))[_0x4350('0x3a')](handleError(_0x2b9d05,null));};function widgetAttributes(_0x3f9868){try{switch(_0x3f9868[_0x4350('0x3b')]){case _0x4350('0x3c'):return[{'name':_0x4350('0x3d'),'value':_0x3f9868['attrUrl']||(_0x3f9868[_0x4350('0x3e')]&&_0x3f9868[_0x4350('0x3e')][0x0]?_0x3f9868['attrs'][0x0][_0x4350('0x3f')]:undefined)||'https://'}];case _0x4350('0x40'):return[{'name':_0x4350('0x41'),'value':_0x3f9868[_0x4350('0x41')]||(_0x3f9868['attrs']&&_0x3f9868[_0x4350('0x3e')][0x0]?_0x3f9868[_0x4350('0x3e')][0x0][_0x4350('0x3f')]:undefined)||''}];case _0x4350('0x42'):return[{'name':'attrHourFormat','value':_0x3f9868[_0x4350('0x43')]||(_0x3f9868['attrs']&&_0x3f9868['attrs'][0x0]?_0x3f9868[_0x4350('0x3e')][0x0]['value']:undefined)||_0x4350('0x44')},{'name':_0x4350('0x45'),'value':_0x3f9868[_0x4350('0x45')]||(_0x3f9868[_0x4350('0x3e')]&&_0x3f9868[_0x4350('0x3e')][0x1]?_0x3f9868[_0x4350('0x3e')][0x1][_0x4350('0x3f')]:undefined)||_0x4350('0x46')},{'name':_0x4350('0x47'),'value':_0x3f9868['attrFontSize']||(_0x3f9868[_0x4350('0x3e')]&&_0x3f9868['attrs'][0x2]?_0x3f9868[_0x4350('0x3e')][0x2][_0x4350('0x3f')]:undefined)||0xc}];case _0x4350('0x48'):return[{'name':_0x4350('0x49'),'value':_0x3f9868['attrMetric']||(_0x3f9868[_0x4350('0x3e')]&&_0x3f9868[_0x4350('0x3e')][0x0]?_0x3f9868[_0x4350('0x3e')][0x0][_0x4350('0x3f')]:undefined)||_0x4350('0x4a')},{'name':_0x4350('0x4b'),'value':_0x3f9868[_0x4350('0x4b')]||(_0x3f9868[_0x4350('0x3e')]&&_0x3f9868['attrs'][0x1]?_0x3f9868['attrs'][0x1][_0x4350('0x3f')]:undefined)||[]},{'name':_0x4350('0x47'),'value':_0x3f9868['attrFontSize']||(_0x3f9868[_0x4350('0x3e')]&&_0x3f9868['attrs'][0x2]?_0x3f9868['attrs'][0x2][_0x4350('0x3f')]:undefined)||0x14}];case _0x4350('0x4c'):case'pie-chart':return[{'name':'attrSerie1','value':_0x3f9868['attrSerie1']||(_0x3f9868[_0x4350('0x3e')]&&_0x3f9868[_0x4350('0x3e')][0x0]?_0x3f9868[_0x4350('0x3e')][0x0][_0x4350('0x3f')]:undefined)||_0x4350('0x4a')},{'name':_0x4350('0x4d'),'value':_0x3f9868['attrSerie2']||(_0x3f9868['attrs']&&_0x3f9868['attrs'][0x1]?_0x3f9868['attrs'][0x1][_0x4350('0x3f')]:undefined)||null},{'name':'attrSerie3','value':_0x3f9868[_0x4350('0x4e')]||(_0x3f9868[_0x4350('0x3e')]&&_0x3f9868[_0x4350('0x3e')][0x2]?_0x3f9868[_0x4350('0x3e')][0x2][_0x4350('0x3f')]:undefined)||null},{'name':_0x4350('0x4b'),'value':_0x3f9868[_0x4350('0x4b')]||(_0x3f9868[_0x4350('0x3e')]&&_0x3f9868[_0x4350('0x3e')][0x3]?_0x3f9868[_0x4350('0x3e')][0x3][_0x4350('0x3f')]:undefined)||[]}];case _0x4350('0x4f'):return[{'name':_0x4350('0x50'),'type':_0x3f9868[_0x4350('0x51')]||(_0x3f9868[_0x4350('0x3e')]&&_0x3f9868[_0x4350('0x3e')][0x0]?_0x3f9868['attrs'][0x0][_0x4350('0x3b')]:undefined)||null,'value':_0x3f9868[_0x4350('0x50')]||(_0x3f9868[_0x4350('0x3e')]&&_0x3f9868[_0x4350('0x3e')][0x0]?_0x3f9868[_0x4350('0x3e')][0x0][_0x4350('0x3f')]:undefined)||null},{'name':'attrRefresh','value':_0x3f9868[_0x4350('0x52')]||(_0x3f9868[_0x4350('0x3e')]&&_0x3f9868[_0x4350('0x3e')][0x1]?_0x3f9868[_0x4350('0x3e')][0x1][_0x4350('0x3f')]:undefined)||0x0}];default:return[];}}catch(_0x6a4fec){logger['error'](_0x4350('0x53'),JSON['stringify'](_0x6a4fec));return[];}}exports[_0x4350('0x54')]=function(_0x4a2442,_0x5d3a98){if(_0x4a2442['body']){_0x4a2442[_0x4350('0x55')][_0x4350('0x3e')]=widgetAttributes(_0x4a2442[_0x4350('0x55')]);}return db['DashboardItem'][_0x4350('0x54')](_0x4a2442[_0x4350('0x55')],{})['then'](respondWithResult(_0x5d3a98,0xc9))[_0x4350('0x3a')](handleError(_0x5d3a98,null));};exports[_0x4350('0x56')]=function(_0x174095,_0xd44c40){if(_0x174095[_0x4350('0x55')]['id']){delete _0x174095[_0x4350('0x55')]['id'];}_0x174095[_0x4350('0x55')][_0x4350('0x3e')]=widgetAttributes(_0x174095['body']);return db['DashboardItem'][_0x4350('0x39')]({'where':{'id':_0x174095['params']['id']}})[_0x4350('0x24')](handleEntityNotFound(_0xd44c40,null))[_0x4350('0x24')](saveUpdates(_0x174095[_0x4350('0x55')],null))[_0x4350('0x24')](respondWithResult(_0xd44c40,null))[_0x4350('0x3a')](handleError(_0xd44c40,null));}; \ No newline at end of file +var _0x9566=['count','limit','status','set','reject','save','update','then','destroy','error','stack','name','show','params','keys','DashboardItem','rawAttributes','query','filters','model','fields','attributes','length','include','merge','options','find','catch','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','0.00','counter','attrMetric','attrVoiceQueues','attrFontSize','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','stringify','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','end','json'];(function(_0x1b8f5a,_0x57c154){var _0x594189=function(_0x15b277){while(--_0x15b277){_0x1b8f5a['push'](_0x1b8f5a['shift']());}};_0x594189(++_0x57c154);}(_0x9566,0x8f));var _0x6956=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x9566[_0x59ee6f];return _0x4c0979;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6956('0x0'));var rimraf=require(_0x6956('0x1'));var zipdir=require(_0x6956('0x2'));var jsonpatch=require(_0x6956('0x3'));var rp=require(_0x6956('0x4'));var moment=require(_0x6956('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6956('0x6'));var util=require(_0x6956('0x7'));var path=require(_0x6956('0x8'));var sox=require('sox');var csv=require(_0x6956('0x9'));var ejs=require(_0x6956('0xa'));var fs=require('fs');var _=require(_0x6956('0xb'));var squel=require(_0x6956('0xc'));var crypto=require(_0x6956('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6956('0xe'));var toCsv=require(_0x6956('0x9'));var querystring=require('querystring');var Papa=require(_0x6956('0xf'));var Redis=require(_0x6956('0x10'));var authService=require(_0x6956('0x11'));var qs=require(_0x6956('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6956('0x13'));var logger=require(_0x6956('0x14'))(_0x6956('0x15'));var utils=require(_0x6956('0x16'));var config=require(_0x6956('0x17'));var db=require('../../mysqldb')['db'];config[_0x6956('0x18')]=_[_0x6956('0x19')](config[_0x6956('0x18')],{'host':_0x6956('0x1a'),'port':0x18eb});var socket=require(_0x6956('0x1b'))(new Redis(config[_0x6956('0x18')]));require(_0x6956('0x1c'))[_0x6956('0x1d')](socket);function respondWithStatusCode(_0x19e7f7,_0x2807b7){_0x2807b7=_0x2807b7||0xcc;return function(_0x157134){if(_0x157134){return _0x19e7f7[_0x6956('0x1e')](_0x2807b7);}return _0x19e7f7['status'](_0x2807b7)[_0x6956('0x1f')]();};}function respondWithResult(_0x1d48e9,_0x363665){_0x363665=_0x363665||0xc8;return function(_0x4a50a5){if(_0x4a50a5){return _0x1d48e9['status'](_0x363665)[_0x6956('0x20')](_0x4a50a5);}};}function respondWithFilteredResult(_0x4f4581,_0x58f781){return function(_0x4f54a9){if(_0x4f54a9){var _0x5b622b=_0x4f54a9[_0x6956('0x21')],_0x4d5bbd=_0x58f781['offset'],_0x41bae5=_0x58f781['offset']+_0x58f781[_0x6956('0x22')],_0x82283b;if(_0x41bae5>=_0x5b622b){_0x41bae5=_0x5b622b;_0x82283b=0xc8;}else{_0x82283b=0xce;}_0x4f4581[_0x6956('0x23')](_0x82283b);return _0x4f4581[_0x6956('0x24')]('Content-Range',_0x4d5bbd+'-'+_0x41bae5+'/'+_0x5b622b)['json'](_0x4f54a9);}return null;};}function patchUpdates(_0x36a613){return function(_0x1823c9){try{jsonpatch['apply'](_0x1823c9,_0x36a613,!![]);}catch(_0x37f7f7){return BPromise[_0x6956('0x25')](_0x37f7f7);}return _0x1823c9[_0x6956('0x26')]();};}function saveUpdates(_0x328b1f,_0x3875a6){return function(_0x17bedd){if(_0x17bedd){return _0x17bedd[_0x6956('0x27')](_0x328b1f)[_0x6956('0x28')](function(_0xf1f3a2){return _0xf1f3a2;});}return null;};}function removeEntity(_0x54fdb5,_0x4cfac1){return function(_0x461d44){if(_0x461d44){return _0x461d44[_0x6956('0x29')]()['then'](function(){_0x54fdb5[_0x6956('0x23')](0xcc)[_0x6956('0x1f')]();});}};}function handleEntityNotFound(_0x5020a0,_0x31800b){return function(_0x5f09cb){if(!_0x5f09cb){_0x5020a0[_0x6956('0x1e')](0x194);}return _0x5f09cb;};}function handleError(_0x1b28fc,_0xf85976){_0xf85976=_0xf85976||0x1f4;return function(_0x26aa9c){logger[_0x6956('0x2a')](_0x26aa9c[_0x6956('0x2b')]);if(_0x26aa9c[_0x6956('0x2c')]){delete _0x26aa9c['name'];}_0x1b28fc[_0x6956('0x23')](_0xf85976)['send'](_0x26aa9c);};}exports[_0x6956('0x2d')]=function(_0x5708bd,_0x110dbe){var _0x1bfd21={'raw':![],'where':{'id':_0x5708bd[_0x6956('0x2e')]['id']}},_0x1a8d78={};_0x1a8d78['model']=_[_0x6956('0x2f')](db[_0x6956('0x30')][_0x6956('0x31')]);_0x1a8d78[_0x6956('0x32')]=_[_0x6956('0x2f')](_0x5708bd[_0x6956('0x32')]);_0x1a8d78[_0x6956('0x33')]=_['intersection'](_0x1a8d78[_0x6956('0x34')],_0x1a8d78[_0x6956('0x32')]);_0x1bfd21['attributes']=_['intersection'](_0x1a8d78[_0x6956('0x34')],qs[_0x6956('0x35')](_0x5708bd[_0x6956('0x32')][_0x6956('0x35')]));_0x1bfd21[_0x6956('0x36')]=_0x1bfd21[_0x6956('0x36')][_0x6956('0x37')]?_0x1bfd21['attributes']:_0x1a8d78[_0x6956('0x34')];if(_0x5708bd[_0x6956('0x32')]['includeAll']){_0x1bfd21[_0x6956('0x38')]=[{'all':!![]}];}_0x1bfd21=_[_0x6956('0x39')]({},_0x1bfd21,_0x5708bd[_0x6956('0x3a')]);return db[_0x6956('0x30')][_0x6956('0x3b')](_0x1bfd21)[_0x6956('0x28')](handleEntityNotFound(_0x110dbe,null))[_0x6956('0x28')](respondWithResult(_0x110dbe,null))[_0x6956('0x3c')](handleError(_0x110dbe,null));};exports[_0x6956('0x29')]=function(_0x4ca299,_0x573fcd){return db['DashboardItem'][_0x6956('0x3b')]({'where':{'id':_0x4ca299[_0x6956('0x2e')]['id']}})[_0x6956('0x28')](handleEntityNotFound(_0x573fcd,null))['then'](removeEntity(_0x573fcd,null))[_0x6956('0x3c')](handleError(_0x573fcd,null));};function widgetAttributes(_0x3878e8){try{switch(_0x3878e8[_0x6956('0x3d')]){case _0x6956('0x3e'):return[{'name':_0x6956('0x3f'),'value':_0x3878e8[_0x6956('0x3f')]||(_0x3878e8[_0x6956('0x40')]&&_0x3878e8[_0x6956('0x40')][0x0]?_0x3878e8[_0x6956('0x40')][0x0][_0x6956('0x41')]:undefined)||_0x6956('0x42')}];case _0x6956('0x43'):return[{'name':_0x6956('0x44'),'value':_0x3878e8[_0x6956('0x44')]||(_0x3878e8[_0x6956('0x40')]&&_0x3878e8[_0x6956('0x40')][0x0]?_0x3878e8[_0x6956('0x40')][0x0][_0x6956('0x41')]:undefined)||''}];case _0x6956('0x45'):return[{'name':_0x6956('0x46'),'value':_0x3878e8['attrHourFormat']||(_0x3878e8[_0x6956('0x40')]&&_0x3878e8[_0x6956('0x40')][0x0]?_0x3878e8[_0x6956('0x40')][0x0]['value']:undefined)||_0x6956('0x47')},{'name':'attrTimezone','value':_0x3878e8['attrTimezone']||(_0x3878e8['attrs']&&_0x3878e8[_0x6956('0x40')][0x1]?_0x3878e8[_0x6956('0x40')][0x1][_0x6956('0x41')]:undefined)||_0x6956('0x48')},{'name':'attrFontSize','value':_0x3878e8['attrFontSize']||(_0x3878e8[_0x6956('0x40')]&&_0x3878e8[_0x6956('0x40')][0x2]?_0x3878e8[_0x6956('0x40')][0x2][_0x6956('0x41')]:undefined)||0xc}];case _0x6956('0x49'):return[{'name':_0x6956('0x4a'),'value':_0x3878e8['attrMetric']||(_0x3878e8[_0x6956('0x40')]&&_0x3878e8[_0x6956('0x40')][0x0]?_0x3878e8[_0x6956('0x40')][0x0]['value']:undefined)||'total'},{'name':_0x6956('0x4b'),'value':_0x3878e8[_0x6956('0x4b')]||(_0x3878e8['attrs']&&_0x3878e8[_0x6956('0x40')][0x1]?_0x3878e8['attrs'][0x1][_0x6956('0x41')]:undefined)||[]},{'name':_0x6956('0x4c'),'value':_0x3878e8[_0x6956('0x4c')]||(_0x3878e8[_0x6956('0x40')]&&_0x3878e8[_0x6956('0x40')][0x2]?_0x3878e8[_0x6956('0x40')][0x2][_0x6956('0x41')]:undefined)||0x14}];case _0x6956('0x4d'):case _0x6956('0x4e'):return[{'name':_0x6956('0x4f'),'value':_0x3878e8[_0x6956('0x4f')]||(_0x3878e8[_0x6956('0x40')]&&_0x3878e8['attrs'][0x0]?_0x3878e8[_0x6956('0x40')][0x0][_0x6956('0x41')]:undefined)||'total'},{'name':_0x6956('0x50'),'value':_0x3878e8[_0x6956('0x50')]||(_0x3878e8[_0x6956('0x40')]&&_0x3878e8[_0x6956('0x40')][0x1]?_0x3878e8[_0x6956('0x40')][0x1][_0x6956('0x41')]:undefined)||null},{'name':'attrSerie3','value':_0x3878e8[_0x6956('0x51')]||(_0x3878e8[_0x6956('0x40')]&&_0x3878e8['attrs'][0x2]?_0x3878e8[_0x6956('0x40')][0x2][_0x6956('0x41')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x3878e8[_0x6956('0x4b')]||(_0x3878e8[_0x6956('0x40')]&&_0x3878e8[_0x6956('0x40')][0x3]?_0x3878e8[_0x6956('0x40')][0x3][_0x6956('0x41')]:undefined)||[]}];case _0x6956('0x52'):return[{'name':'attrReport','type':_0x3878e8['reportType']||(_0x3878e8[_0x6956('0x40')]&&_0x3878e8[_0x6956('0x40')][0x0]?_0x3878e8['attrs'][0x0][_0x6956('0x3d')]:undefined)||null,'value':_0x3878e8[_0x6956('0x53')]||(_0x3878e8['attrs']&&_0x3878e8[_0x6956('0x40')][0x0]?_0x3878e8[_0x6956('0x40')][0x0][_0x6956('0x41')]:undefined)||null},{'name':'attrRefresh','value':_0x3878e8[_0x6956('0x54')]||(_0x3878e8[_0x6956('0x40')]&&_0x3878e8[_0x6956('0x40')][0x1]?_0x3878e8[_0x6956('0x40')][0x1][_0x6956('0x41')]:undefined)||0x0}];default:return[];}}catch(_0xef3140){logger[_0x6956('0x2a')]('widgetAttributes:\x20%s',JSON[_0x6956('0x55')](_0xef3140));return[];}}exports[_0x6956('0x56')]=function(_0x2dd893,_0x246310){if(_0x2dd893['body']){_0x2dd893[_0x6956('0x57')][_0x6956('0x40')]=widgetAttributes(_0x2dd893[_0x6956('0x57')]);}return db[_0x6956('0x30')][_0x6956('0x56')](_0x2dd893['body'],{})['then'](respondWithResult(_0x246310,0xc9))[_0x6956('0x3c')](handleError(_0x246310,null));};exports[_0x6956('0x27')]=function(_0x3a83a3,_0x38085e){if(_0x3a83a3[_0x6956('0x57')]['id']){delete _0x3a83a3['body']['id'];}_0x3a83a3[_0x6956('0x57')][_0x6956('0x40')]=widgetAttributes(_0x3a83a3[_0x6956('0x57')]);return db[_0x6956('0x30')][_0x6956('0x3b')]({'where':{'id':_0x3a83a3['params']['id']}})['then'](handleEntityNotFound(_0x38085e,null))['then'](saveUpdates(_0x3a83a3[_0x6956('0x57')],null))[_0x6956('0x28')](respondWithResult(_0x38085e,null))[_0x6956('0x3c')](handleError(_0x38085e,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index ce1b5d0..73b1c11 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 _0x15b2=['DashboardItem','setMaxListeners','update','emit','hook','events'];(function(_0x35d59c,_0x341ef9){var _0x18cd27=function(_0x16a9c4){while(--_0x16a9c4){_0x35d59c['push'](_0x35d59c['shift']());}};_0x18cd27(++_0x341ef9);}(_0x15b2,0xa1));var _0x215b=function(_0x307fcf,_0x394370){_0x307fcf=_0x307fcf-0x0;var _0x35522f=_0x15b2[_0x307fcf];return _0x35522f;};'use strict';var EventEmitter=require(_0x215b('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0x215b('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x215b('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x215b('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3e2f33){return function(_0x52da90,_0x58b6b3,_0x477e21){DashboardItemEvents['emit'](_0x3e2f33+':'+_0x52da90['id'],_0x52da90);DashboardItemEvents[_0x215b('0x4')](_0x3e2f33,_0x52da90);_0x477e21(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0x215b('0x5')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file +var _0x53f9=['update','remove','emit','hasOwnProperty','hook','events','DashboardItem','setMaxListeners','save'];(function(_0xc541fa,_0x887c14){var _0x3c2c11=function(_0x1d736d){while(--_0x1d736d){_0xc541fa['push'](_0xc541fa['shift']());}};_0x3c2c11(++_0x887c14);}(_0x53f9,0xf8));var _0x953f=function(_0x58a4b5,_0x182439){_0x58a4b5=_0x58a4b5-0x0;var _0x51821d=_0x53f9[_0x58a4b5];return _0x51821d;};'use strict';var EventEmitter=require(_0x953f('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0x953f('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x953f('0x2')](0x0);var events={'afterCreate':_0x953f('0x3'),'afterUpdate':_0x953f('0x4'),'afterDestroy':_0x953f('0x5')};function emitEvent(_0x1bcef5){return function(_0x341fb3,_0x241ca2,_0x13b8b6){DashboardItemEvents[_0x953f('0x6')](_0x1bcef5+':'+_0x341fb3['id'],_0x341fb3);DashboardItemEvents[_0x953f('0x6')](_0x1bcef5,_0x341fb3);_0x13b8b6(null);};}for(var e in events){if(events[_0x953f('0x7')](e)){var event=events[e];DashboardItem[_0x953f('0x8')](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 6279a2f..d13e1c2 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 _0xb544=['rimraf','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','util','moment','bluebird','request-promise','path'];(function(_0xd8c9eb,_0x23b19e){var _0x5eb349=function(_0x15109a){while(--_0x15109a){_0xd8c9eb['push'](_0xd8c9eb['shift']());}};_0x5eb349(++_0x23b19e);}(_0xb544,0x1ea));var _0x4b54=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xb544[_0xfae23b];return _0x200640;};'use strict';var _=require('lodash');var util=require(_0x4b54('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x4b54('0x1'));var BPromise=require(_0x4b54('0x2'));var rp=require(_0x4b54('0x3'));var fs=require('fs');var path=require(_0x4b54('0x4'));var rimraf=require(_0x4b54('0x5'));var config=require(_0x4b54('0x6'));var attributes=require(_0x4b54('0x7'));module[_0x4b54('0x8')]=function(_0x20190a,_0x357113){return _0x20190a[_0x4b54('0x9')](_0x4b54('0xa'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xddb7=['../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5ab49c,_0x311ea9){var _0x98dad7=function(_0x3c6520){while(--_0x3c6520){_0x5ab49c['push'](_0x5ab49c['shift']());}};_0x98dad7(++_0x311ea9);}(_0xddb7,0x105));var _0x7ddb=function(_0x2b9532,_0x4b530d){_0x2b9532=_0x2b9532-0x0;var _0x6d7158=_0xddb7[_0x2b9532];return _0x6d7158;};'use strict';var _=require(_0x7ddb('0x0'));var util=require(_0x7ddb('0x1'));var logger=require(_0x7ddb('0x2'))(_0x7ddb('0x3'));var moment=require(_0x7ddb('0x4'));var BPromise=require(_0x7ddb('0x5'));var rp=require(_0x7ddb('0x6'));var fs=require('fs');var path=require(_0x7ddb('0x7'));var rimraf=require(_0x7ddb('0x8'));var config=require(_0x7ddb('0x9'));var attributes=require(_0x7ddb('0xa'));module[_0x7ddb('0xb')]=function(_0x7bb460,_0x1d644e){return _0x7bb460[_0x7ddb('0xc')](_0x7ddb('0xd'),attributes,{'tableName':_0x7ddb('0xe'),'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 e453e7b..b5158eb 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 _0x3e6e=['DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','DashboardItem,\x20%s,\x20%s','message','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./dashboardItem.socket','request','then','info','request\x20sent'];(function(_0xcf7d1e,_0x1b00ad){var _0x42b2cb=function(_0x4c5c9b){while(--_0x4c5c9b){_0xcf7d1e['push'](_0xcf7d1e['shift']());}};_0x42b2cb(++_0x1b00ad);}(_0x3e6e,0x14b));var _0xe3e6=function(_0x5ca753,_0x4b1a27){_0x5ca753=_0x5ca753-0x0;var _0x210db3=_0x3e6e[_0x5ca753];return _0x210db3;};'use strict';var _=require('lodash');var util=require(_0xe3e6('0x0'));var moment=require(_0xe3e6('0x1'));var BPromise=require('bluebird');var rs=require(_0xe3e6('0x2'));var fs=require('fs');var Redis=require(_0xe3e6('0x3'));var db=require(_0xe3e6('0x4'))['db'];var utils=require(_0xe3e6('0x5'));var logger=require(_0xe3e6('0x6'))(_0xe3e6('0x7'));var config=require(_0xe3e6('0x8'));var jayson=require(_0xe3e6('0x9'));var client=jayson[_0xe3e6('0xa')][_0xe3e6('0xb')]({'port':0x232a});config[_0xe3e6('0xc')]=_[_0xe3e6('0xd')](config['redis'],{'host':_0xe3e6('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe3e6('0xc')]));require(_0xe3e6('0xf'))['register'](socket);function respondWithRpcPromise(_0x187e20,_0x320629,_0xb897d9){return new BPromise(function(_0x2e5546,_0x17d32f){return client[_0xe3e6('0x10')](_0x187e20,_0xb897d9)[_0xe3e6('0x11')](function(_0xa4d5ed){logger[_0xe3e6('0x12')]('DashboardItem,\x20%s,\x20%s',_0x320629,_0xe3e6('0x13'));logger['debug'](_0xe3e6('0x14'),_0x320629,_0xe3e6('0x13'),JSON[_0xe3e6('0x15')](_0xa4d5ed));if(_0xa4d5ed[_0xe3e6('0x16')]){if(_0xa4d5ed[_0xe3e6('0x16')][_0xe3e6('0x17')]===0x1f4){logger[_0xe3e6('0x16')](_0xe3e6('0x18'),_0x320629,_0xa4d5ed[_0xe3e6('0x16')]['message']);return _0x17d32f(_0xa4d5ed[_0xe3e6('0x16')][_0xe3e6('0x19')]);}logger[_0xe3e6('0x16')]('DashboardItem,\x20%s,\x20%s',_0x320629,_0xa4d5ed[_0xe3e6('0x16')][_0xe3e6('0x19')]);return _0x2e5546(_0xa4d5ed[_0xe3e6('0x16')][_0xe3e6('0x19')]);}else{logger[_0xe3e6('0x12')](_0xe3e6('0x18'),_0x320629,_0xe3e6('0x13'));_0x2e5546(_0xa4d5ed[_0xe3e6('0x1a')]['message']);}})['catch'](function(_0x31457d){logger[_0xe3e6('0x16')](_0xe3e6('0x18'),_0x320629,_0x31457d);_0x17d32f(_0x31457d);});});} \ No newline at end of file +var _0x757e=['../../config/logger','client','redis','defaults','localhost','request','then','DashboardItem,\x20%s,\x20%s','request\x20sent','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x576e2b,_0x328953){var _0x46461a=function(_0xce4d9e){while(--_0xce4d9e){_0x576e2b['push'](_0x576e2b['shift']());}};_0x46461a(++_0x328953);}(_0x757e,0x101));var _0xe757=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x757e[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xe757('0x0'));var util=require(_0xe757('0x1'));var moment=require(_0xe757('0x2'));var BPromise=require(_0xe757('0x3'));var rs=require(_0xe757('0x4'));var fs=require('fs');var Redis=require(_0xe757('0x5'));var db=require(_0xe757('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xe757('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe757('0x8')]['http']({'port':0x232a});config[_0xe757('0x9')]=_[_0xe757('0xa')](config[_0xe757('0x9')],{'host':_0xe757('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe757('0x9')]));require('./dashboardItem.socket')['register'](socket);function respondWithRpcPromise(_0x56e211,_0x401959,_0x5b8c03){return new BPromise(function(_0x359b66,_0x508719){return client[_0xe757('0xc')](_0x56e211,_0x5b8c03)[_0xe757('0xd')](function(_0x3dfab9){logger['info'](_0xe757('0xe'),_0x401959,_0xe757('0xf'));logger['debug'](_0xe757('0x10'),_0x401959,_0xe757('0xf'),JSON[_0xe757('0x11')](_0x3dfab9));if(_0x3dfab9[_0xe757('0x12')]){if(_0x3dfab9['error'][_0xe757('0x13')]===0x1f4){logger['error'](_0xe757('0xe'),_0x401959,_0x3dfab9[_0xe757('0x12')][_0xe757('0x14')]);return _0x508719(_0x3dfab9[_0xe757('0x12')]['message']);}logger[_0xe757('0x12')](_0xe757('0xe'),_0x401959,_0x3dfab9['error'][_0xe757('0x14')]);return _0x359b66(_0x3dfab9[_0xe757('0x12')][_0xe757('0x14')]);}else{logger[_0xe757('0x15')]('DashboardItem,\x20%s,\x20%s',_0x401959,'request\x20sent');_0x359b66(_0x3dfab9[_0xe757('0x16')]['message']);}})[_0xe757('0x17')](function(_0x32fea0){logger['error']('DashboardItem,\x20%s,\x20%s',_0x401959,_0x32fea0);_0x508719(_0x32fea0);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index b892853..4d4b73a 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 _0x17cb=['update','length','dashboardItem:','save','remove'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x17cb,0x17a));var _0xb17c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x17cb[_0x321bb2];return _0x9c12ed;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0xb17c('0x0'),_0xb17c('0x1'),_0xb17c('0x2')];function createListener(_0x2f2579,_0x53206b){return function(_0x5f3171){_0x53206b['emit'](_0x2f2579,_0x5f3171);};}function removeListener(_0x11d40f,_0x3301d9){return function(){DashboardItemEvents['removeListener'](_0x11d40f,_0x3301d9);};}exports['register']=function(_0x5e4200){for(var _0x4bb16e=0x0,_0x2da6b1=events[_0xb17c('0x3')];_0x4bb16e<_0x2da6b1;_0x4bb16e++){var _0x5d913b=events[_0x4bb16e];var _0x381668=createListener(_0xb17c('0x4')+_0x5d913b,_0x5e4200);DashboardItemEvents['on'](_0x5d913b,_0x381668);}}; \ No newline at end of file +var _0x5cf3=['emit','removeListener','register','length','./dashboardItem.events','save','remove','update'];(function(_0x14be1b,_0x41fc1a){var _0x1e441d=function(_0x5858c1){while(--_0x5858c1){_0x14be1b['push'](_0x14be1b['shift']());}};_0x1e441d(++_0x41fc1a);}(_0x5cf3,0xe4));var _0x35cf=function(_0x550a61,_0x1c5d8c){_0x550a61=_0x550a61-0x0;var _0x248bfc=_0x5cf3[_0x550a61];return _0x248bfc;};'use strict';var DashboardItemEvents=require(_0x35cf('0x0'));var events=[_0x35cf('0x1'),_0x35cf('0x2'),_0x35cf('0x3')];function createListener(_0x1206e4,_0x2d2b95){return function(_0x536fb4){_0x2d2b95[_0x35cf('0x4')](_0x1206e4,_0x536fb4);};}function removeListener(_0x7ae0ff,_0x54be9b){return function(){DashboardItemEvents[_0x35cf('0x5')](_0x7ae0ff,_0x54be9b);};}exports[_0x35cf('0x6')]=function(_0x2ad533){for(var _0x5483=0x0,_0x1c8f66=events[_0x35cf('0x7')];_0x5483<_0x1c8f66;_0x5483++){var _0xf2ba63=events[_0x5483];var _0x29a0c7=createListener('dashboardItem:'+_0xf2ba63,_0x2ad533);DashboardItemEvents['on'](_0xf2ba63,_0x29a0c7);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index d8bd2b2..1bb1521 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 _0xf2ca=['destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','/:id','isAuthenticated','show','post','create','put','delete'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x3b5049,_0x495a94){_0x3b5049=_0x3b5049-0x0;var _0x12454e=_0xf2ca[_0x3b5049];return _0x12454e;};'use strict';var multer=require(_0xaf2c('0x0'));var util=require(_0xaf2c('0x1'));var path=require(_0xaf2c('0x2'));var timeout=require('connect-timeout');var express=require(_0xaf2c('0x3'));var router=express[_0xaf2c('0x4')]();var auth=require(_0xaf2c('0x5'));var interaction=require(_0xaf2c('0x6'));var config=require(_0xaf2c('0x7'));var controller=require(_0xaf2c('0x8'));router['get'](_0xaf2c('0x9'),auth[_0xaf2c('0xa')](),controller[_0xaf2c('0xb')]);router[_0xaf2c('0xc')]('/',auth['isAuthenticated'](),controller[_0xaf2c('0xd')]);router[_0xaf2c('0xe')]('/:id',auth[_0xaf2c('0xa')](),controller['update']);router[_0xaf2c('0xf')]('/:id',auth[_0xaf2c('0xa')](),controller[_0xaf2c('0x10')]);module[_0xaf2c('0x11')]=router; \ No newline at end of file +var _0xe2fe=['put','update','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','/:id','isAuthenticated','post'];(function(_0xe9270,_0x36ce64){var _0x479fa2=function(_0x276814){while(--_0x276814){_0xe9270['push'](_0xe9270['shift']());}};_0x479fa2(++_0x36ce64);}(_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 auth=require(_0xee2f('0x3'));var interaction=require(_0xee2f('0x4'));var config=require(_0xee2f('0x5'));var controller=require(_0xee2f('0x6'));router['get'](_0xee2f('0x7'),auth[_0xee2f('0x8')](),controller['show']);router[_0xee2f('0x9')]('/',auth[_0xee2f('0x8')](),controller['create']);router[_0xee2f('0xa')]('/:id',auth[_0xee2f('0x8')](),controller[_0xee2f('0xb')]);router['delete'](_0xee2f('0x7'),auth[_0xee2f('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index bbdcf6b..fa5c92d 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 _0x96c8=['sequelize','exports','STRING'];(function(_0x3e49fc,_0x447775){var _0x1bfd0d=function(_0x2eb0b8){while(--_0x2eb0b8){_0x3e49fc['push'](_0x3e49fc['shift']());}};_0x1bfd0d(++_0x447775);}(_0x96c8,0x192));var _0x896c=function(_0xe28951,_0x3405e1){_0xe28951=_0xe28951-0x0;var _0x5b11bd=_0x96c8[_0xe28951];return _0x5b11bd;};'use strict';var Sequelize=require(_0x896c('0x0'));module[_0x896c('0x1')]={'name':{'type':Sequelize[_0x896c('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x00ec=['STRING','sequelize','exports'];(function(_0x1ed116,_0x23bc80){var _0x574066=function(_0x424f9e){while(--_0x424f9e){_0x1ed116['push'](_0x1ed116['shift']());}};_0x574066(++_0x23bc80);}(_0x00ec,0x133));var _0xc00e=function(_0xe0e53b,_0x243a2f){_0xe0e53b=_0xe0e53b-0x0;var _0x4781bc=_0x00ec[_0xe0e53b];return _0x4781bc;};'use strict';var Sequelize=require(_0xc00e('0x0'));module[_0xc00e('0x1')]={'name':{'type':Sequelize[_0xc00e('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index ab3c1af..353215e 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 _0x032e=['Disposition','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','fields','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','error','html-pdf','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','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','json','count','offset','limit','set','Content-Range','save','update','then','destroy','get','Dispositions','end','stack','name'];(function(_0xfb896b,_0x459d6b){var _0x5b48e7=function(_0x11397a){while(--_0x11397a){_0xfb896b['push'](_0xfb896b['shift']());}};_0x5b48e7(++_0x459d6b);}(_0x032e,0x124));var _0xe032=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x032e[_0x311c35];return _0x5cc50c;};'use strict';var pdf=require(_0xe032('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe032('0x1'));var zipdir=require(_0xe032('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe032('0x3'));var BPromise=require(_0xe032('0x4'));var Mustache=require(_0xe032('0x5'));var util=require(_0xe032('0x6'));var path=require(_0xe032('0x7'));var sox=require(_0xe032('0x8'));var csv=require(_0xe032('0x9'));var ejs=require(_0xe032('0xa'));var fs=require('fs');var _=require(_0xe032('0xb'));var squel=require(_0xe032('0xc'));var crypto=require(_0xe032('0xd'));var jsforce=require(_0xe032('0xe'));var deskjs=require(_0xe032('0xf'));var toCsv=require(_0xe032('0x9'));var querystring=require(_0xe032('0x10'));var Papa=require(_0xe032('0x11'));var Redis=require(_0xe032('0x12'));var authService=require(_0xe032('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe032('0x14'));var hardwareService=require(_0xe032('0x15'));var logger=require(_0xe032('0x16'))(_0xe032('0x17'));var utils=require(_0xe032('0x18'));var config=require(_0xe032('0x19'));var db=require(_0xe032('0x1a'))['db'];function respondWithStatusCode(_0x5bcb5b,_0x646979){_0x646979=_0x646979||0xcc;return function(_0x266d71){if(_0x266d71){return _0x5bcb5b[_0xe032('0x1b')](_0x646979);}return _0x5bcb5b[_0xe032('0x1c')](_0x646979)['end']();};}function respondWithResult(_0x311592,_0x2e267b){_0x2e267b=_0x2e267b||0xc8;return function(_0x176547){if(_0x176547){return _0x311592[_0xe032('0x1c')](_0x2e267b)[_0xe032('0x1d')](_0x176547);}};}function respondWithFilteredResult(_0x3d92cb,_0x2bf528){return function(_0x4da5b7){if(_0x4da5b7){var _0x231c35=_0x4da5b7[_0xe032('0x1e')],_0x749018=_0x2bf528[_0xe032('0x1f')],_0x36fb7c=_0x2bf528['offset']+_0x2bf528[_0xe032('0x20')],_0x3b57d3;if(_0x36fb7c>=_0x231c35){_0x36fb7c=_0x231c35;_0x3b57d3=0xc8;}else{_0x3b57d3=0xce;}_0x3d92cb[_0xe032('0x1c')](_0x3b57d3);return _0x3d92cb[_0xe032('0x21')](_0xe032('0x22'),_0x749018+'-'+_0x36fb7c+'/'+_0x231c35)[_0xe032('0x1d')](_0x4da5b7);}return null;};}function patchUpdates(_0x5721ce){return function(_0x4b644b){try{jsonpatch['apply'](_0x4b644b,_0x5721ce,!![]);}catch(_0x15475c){return BPromise['reject'](_0x15475c);}return _0x4b644b[_0xe032('0x23')]();};}function saveUpdates(_0x4608e4,_0x3f0257){return function(_0x2aa342){if(_0x2aa342){return _0x2aa342[_0xe032('0x24')](_0x4608e4)[_0xe032('0x25')](function(_0x136f5d){return _0x136f5d;});}return null;};}function removeEntity(_0x5a7b53,_0x32f8b6){return function(_0x866c81){if(_0x866c81){return _0x866c81[_0xe032('0x26')]()[_0xe032('0x25')](function(){var _0x2ca592=_0x866c81[_0xe032('0x27')]({'plain':!![]});var _0x22831a=_0xe032('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x22831a,'resourceId':_0x2ca592['id']}})['then'](function(){return _0x866c81;});})[_0xe032('0x25')](function(){_0x5a7b53[_0xe032('0x1c')](0xcc)[_0xe032('0x29')]();});}};}function handleEntityNotFound(_0x2a56e5,_0x2bfe8f){return function(_0x200671){if(!_0x200671){_0x2a56e5[_0xe032('0x1b')](0x194);}return _0x200671;};}function handleError(_0x2b6ffa,_0x4dcbf1){_0x4dcbf1=_0x4dcbf1||0x1f4;return function(_0x1ac20b){logger['error'](_0x1ac20b[_0xe032('0x2a')]);if(_0x1ac20b[_0xe032('0x2b')]){delete _0x1ac20b[_0xe032('0x2b')];}_0x2b6ffa[_0xe032('0x1c')](_0x4dcbf1)['send'](_0x1ac20b);};}exports['index']=function(_0x3e2575,_0x38e7ea){var _0x469290={},_0xae116e={},_0x4e8b72={'count':0x0,'rows':[]};var _0x541aa8=_['map'](db[_0xe032('0x2c')][_0xe032('0x2d')],function(_0x5518ac){return{'name':_0x5518ac[_0xe032('0x2e')],'type':_0x5518ac['type'][_0xe032('0x2f')]};});_0xae116e[_0xe032('0x30')]=_[_0xe032('0x31')](_0x541aa8,_0xe032('0x2b'));_0xae116e[_0xe032('0x32')]=_['keys'](_0x3e2575[_0xe032('0x32')]);_0xae116e[_0xe032('0x33')]=_[_0xe032('0x34')](_0xae116e[_0xe032('0x30')],_0xae116e['query']);_0x469290[_0xe032('0x35')]=_['intersection'](_0xae116e[_0xe032('0x30')],qs['fields'](_0x3e2575[_0xe032('0x32')]['fields']));_0x469290[_0xe032('0x35')]=_0x469290['attributes'][_0xe032('0x36')]?_0x469290[_0xe032('0x35')]:_0xae116e['model'];if(!_0x3e2575[_0xe032('0x32')][_0xe032('0x37')](_0xe032('0x38'))){_0x469290[_0xe032('0x20')]=qs['limit'](_0x3e2575[_0xe032('0x32')]['limit']);_0x469290[_0xe032('0x1f')]=qs[_0xe032('0x1f')](_0x3e2575['query'][_0xe032('0x1f')]);}_0x469290[_0xe032('0x39')]=qs['sort'](_0x3e2575[_0xe032('0x32')][_0xe032('0x3a')]);_0x469290[_0xe032('0x3b')]=qs[_0xe032('0x33')](_[_0xe032('0x3c')](_0x3e2575[_0xe032('0x32')],_0xae116e[_0xe032('0x33')]));if(_0x3e2575[_0xe032('0x32')][_0xe032('0x3d')]){_0x469290[_0xe032('0x3b')]=_[_0xe032('0x3e')](_0x469290[_0xe032('0x3b')],{'$or':_[_0xe032('0x31')](_0x541aa8,function(_0x28ba5d){if(_0x28ba5d[_0xe032('0x3f')]!==_0xe032('0x40')){var _0x2d3d0b={};_0x2d3d0b[_0x28ba5d['name']]={'$like':'%'+_0x3e2575[_0xe032('0x32')]['filter']+'%'};return _0x2d3d0b;}})});}_0x469290=_[_0xe032('0x3e')]({},_0x469290,_0x3e2575[_0xe032('0x41')]);var _0x2f2afc={'where':_0x469290[_0xe032('0x3b')]};return db[_0xe032('0x2c')]['count'](_0x2f2afc)[_0xe032('0x25')](function(_0x55688b){_0x4e8b72[_0xe032('0x1e')]=_0x55688b;if(_0x3e2575['query'][_0xe032('0x42')]){_0x469290[_0xe032('0x43')]=[{'all':!![]}];}return db[_0xe032('0x2c')][_0xe032('0x44')](_0x469290);})['then'](function(_0x477360){_0x4e8b72['rows']=_0x477360;return _0x4e8b72;})[_0xe032('0x25')](respondWithFilteredResult(_0x38e7ea,_0x469290))[_0xe032('0x45')](handleError(_0x38e7ea,null));};exports[_0xe032('0x46')]=function(_0xe572b6,_0x4b58eb){var _0x513b0c={'raw':!![],'where':{'id':_0xe572b6[_0xe032('0x47')]['id']}},_0x45345d={};_0x45345d['model']=_[_0xe032('0x48')](db[_0xe032('0x2c')][_0xe032('0x2d')]);_0x45345d[_0xe032('0x32')]=_[_0xe032('0x48')](_0xe572b6['query']);_0x45345d[_0xe032('0x33')]=_[_0xe032('0x34')](_0x45345d[_0xe032('0x30')],_0x45345d[_0xe032('0x32')]);_0x513b0c[_0xe032('0x35')]=_[_0xe032('0x34')](_0x45345d[_0xe032('0x30')],qs[_0xe032('0x49')](_0xe572b6['query']['fields']));_0x513b0c[_0xe032('0x35')]=_0x513b0c['attributes'][_0xe032('0x36')]?_0x513b0c[_0xe032('0x35')]:_0x45345d[_0xe032('0x30')];if(_0xe572b6[_0xe032('0x32')][_0xe032('0x42')]){_0x513b0c[_0xe032('0x43')]=[{'all':!![]}];}_0x513b0c=_[_0xe032('0x3e')]({},_0x513b0c,_0xe572b6[_0xe032('0x41')]);return db[_0xe032('0x2c')]['find'](_0x513b0c)[_0xe032('0x25')](handleEntityNotFound(_0x4b58eb,null))['then'](respondWithResult(_0x4b58eb,null))['catch'](handleError(_0x4b58eb,null));};exports[_0xe032('0x4a')]=function(_0x2583e9,_0x62bfc8){return db[_0xe032('0x2c')]['create'](_0x2583e9[_0xe032('0x4b')],{})[_0xe032('0x25')](function(_0xdfdbd6){var _0x39ffb7=_0x2583e9[_0xe032('0x4c')][_0xe032('0x27')]({'plain':!![]});if(!_0x39ffb7)throw new Error(_0xe032('0x4d'));if(_0x39ffb7['role']===_0xe032('0x4c')){var _0x3463ee=_0xdfdbd6['get']({'plain':!![]});var _0x39c554=_0xe032('0x28');return db[_0xe032('0x4e')][_0xe032('0x4f')]({'where':{'name':_0x39c554,'userProfileId':_0x39ffb7[_0xe032('0x50')]},'raw':!![]})[_0xe032('0x25')](function(_0x24b013){if(_0x24b013&&_0x24b013[_0xe032('0x51')]===0x0){return db[_0xe032('0x52')][_0xe032('0x4a')]({'name':_0x3463ee[_0xe032('0x2b')],'resourceId':_0x3463ee['id'],'type':_0x24b013[_0xe032('0x2b')],'sectionId':_0x24b013['id']},{})[_0xe032('0x25')](function(){return _0xdfdbd6;});}else{return _0xdfdbd6;}})[_0xe032('0x45')](function(_0x4eabfc){logger[_0xe032('0x53')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4eabfc);throw _0x4eabfc;});}return _0xdfdbd6;})[_0xe032('0x25')](respondWithResult(_0x62bfc8,0xc9))[_0xe032('0x45')](handleError(_0x62bfc8,null));};exports[_0xe032('0x24')]=function(_0x11ae58,_0x41289d){if(_0x11ae58[_0xe032('0x4b')]['id']){delete _0x11ae58[_0xe032('0x4b')]['id'];}return db[_0xe032('0x2c')][_0xe032('0x4f')]({'where':{'id':_0x11ae58[_0xe032('0x47')]['id']}})[_0xe032('0x25')](handleEntityNotFound(_0x41289d,null))['then'](saveUpdates(_0x11ae58[_0xe032('0x4b')],null))[_0xe032('0x25')](respondWithResult(_0x41289d,null))['catch'](handleError(_0x41289d,null));};exports[_0xe032('0x26')]=function(_0x4e0dc7,_0x39b878){return db[_0xe032('0x2c')][_0xe032('0x4f')]({'where':{'id':_0x4e0dc7[_0xe032('0x47')]['id']}})[_0xe032('0x25')](handleEntityNotFound(_0x39b878,null))['then'](removeEntity(_0x39b878,null))[_0xe032('0x45')](handleError(_0x39b878,null));}; \ No newline at end of file +var _0x3435=['options','Disposition','includeAll','include','findAll','rows','show','params','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','then','get','Dispositions','destroy','end','error','name','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x1013c9,_0x4faef3){var _0x134ad2=function(_0x178227){while(--_0x178227){_0x1013c9['push'](_0x1013c9['shift']());}};_0x134ad2(++_0x4faef3);}(_0x3435,0xfa));var _0x5343=function(_0x5d860f,_0x467498){_0x5d860f=_0x5d860f-0x0;var _0x236490=_0x3435[_0x5d860f];return _0x236490;};'use strict';var pdf=require(_0x5343('0x0'));var emlformat=require(_0x5343('0x1'));var rimraf=require(_0x5343('0x2'));var zipdir=require(_0x5343('0x3'));var jsonpatch=require(_0x5343('0x4'));var rp=require(_0x5343('0x5'));var moment=require('moment');var BPromise=require(_0x5343('0x6'));var Mustache=require(_0x5343('0x7'));var util=require('util');var path=require('path');var sox=require(_0x5343('0x8'));var csv=require(_0x5343('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x5343('0xa'));var crypto=require(_0x5343('0xb'));var jsforce=require(_0x5343('0xc'));var deskjs=require(_0x5343('0xd'));var toCsv=require(_0x5343('0x9'));var querystring=require('querystring');var Papa=require(_0x5343('0xe'));var Redis=require('ioredis');var authService=require(_0x5343('0xf'));var qs=require(_0x5343('0x10'));var as=require(_0x5343('0x11'));var hardwareService=require(_0x5343('0x12'));var logger=require(_0x5343('0x13'))('api');var utils=require(_0x5343('0x14'));var config=require(_0x5343('0x15'));var db=require(_0x5343('0x16'))['db'];function respondWithStatusCode(_0x5f1724,_0x2ddeb7){_0x2ddeb7=_0x2ddeb7||0xcc;return function(_0x5f473f){if(_0x5f473f){return _0x5f1724[_0x5343('0x17')](_0x2ddeb7);}return _0x5f1724[_0x5343('0x18')](_0x2ddeb7)['end']();};}function respondWithResult(_0x392797,_0x4cdfae){_0x4cdfae=_0x4cdfae||0xc8;return function(_0x13066f){if(_0x13066f){return _0x392797[_0x5343('0x18')](_0x4cdfae)[_0x5343('0x19')](_0x13066f);}};}function respondWithFilteredResult(_0x65e827,_0x4dbff1){return function(_0x446e90){if(_0x446e90){var _0x588a96=_0x446e90[_0x5343('0x1a')],_0x1df724=_0x4dbff1[_0x5343('0x1b')],_0x3f27fb=_0x4dbff1[_0x5343('0x1b')]+_0x4dbff1['limit'],_0x45cade;if(_0x3f27fb>=_0x588a96){_0x3f27fb=_0x588a96;_0x45cade=0xc8;}else{_0x45cade=0xce;}_0x65e827[_0x5343('0x18')](_0x45cade);return _0x65e827[_0x5343('0x1c')](_0x5343('0x1d'),_0x1df724+'-'+_0x3f27fb+'/'+_0x588a96)['json'](_0x446e90);}return null;};}function patchUpdates(_0x1eb3bd){return function(_0x399eec){try{jsonpatch[_0x5343('0x1e')](_0x399eec,_0x1eb3bd,!![]);}catch(_0x2f1b48){return BPromise[_0x5343('0x1f')](_0x2f1b48);}return _0x399eec[_0x5343('0x20')]();};}function saveUpdates(_0x132505,_0x40ba38){return function(_0x35d41d){if(_0x35d41d){return _0x35d41d['update'](_0x132505)[_0x5343('0x21')](function(_0x3da777){return _0x3da777;});}return null;};}function removeEntity(_0x5c2d6f,_0x42f92d){return function(_0xd95a5b){if(_0xd95a5b){return _0xd95a5b['destroy']()[_0x5343('0x21')](function(){var _0x130a9f=_0xd95a5b[_0x5343('0x22')]({'plain':!![]});var _0x380aae=_0x5343('0x23');return db['UserProfileResource'][_0x5343('0x24')]({'where':{'type':_0x380aae,'resourceId':_0x130a9f['id']}})[_0x5343('0x21')](function(){return _0xd95a5b;});})['then'](function(){_0x5c2d6f[_0x5343('0x18')](0xcc)[_0x5343('0x25')]();});}};}function handleEntityNotFound(_0x1ab5eb,_0x5e4344){return function(_0x539f0b){if(!_0x539f0b){_0x1ab5eb[_0x5343('0x17')](0x194);}return _0x539f0b;};}function handleError(_0x5871de,_0x14d05a){_0x14d05a=_0x14d05a||0x1f4;return function(_0x5e4b38){logger[_0x5343('0x26')](_0x5e4b38['stack']);if(_0x5e4b38['name']){delete _0x5e4b38[_0x5343('0x27')];}_0x5871de[_0x5343('0x18')](_0x14d05a)['send'](_0x5e4b38);};}exports['index']=function(_0x1202bb,_0x5d0853){var _0x2ed8c9={},_0x47d49a={},_0x5c689e={'count':0x0,'rows':[]};var _0x6316d3=_['map'](db['Disposition'][_0x5343('0x28')],function(_0x250788){return{'name':_0x250788[_0x5343('0x29')],'type':_0x250788[_0x5343('0x2a')]['key']};});_0x47d49a['model']=_[_0x5343('0x2b')](_0x6316d3,_0x5343('0x27'));_0x47d49a[_0x5343('0x2c')]=_[_0x5343('0x2d')](_0x1202bb[_0x5343('0x2c')]);_0x47d49a[_0x5343('0x2e')]=_[_0x5343('0x2f')](_0x47d49a[_0x5343('0x30')],_0x47d49a[_0x5343('0x2c')]);_0x2ed8c9[_0x5343('0x31')]=_[_0x5343('0x2f')](_0x47d49a[_0x5343('0x30')],qs['fields'](_0x1202bb['query'][_0x5343('0x32')]));_0x2ed8c9[_0x5343('0x31')]=_0x2ed8c9['attributes'][_0x5343('0x33')]?_0x2ed8c9['attributes']:_0x47d49a[_0x5343('0x30')];if(!_0x1202bb[_0x5343('0x2c')][_0x5343('0x34')](_0x5343('0x35'))){_0x2ed8c9['limit']=qs['limit'](_0x1202bb[_0x5343('0x2c')]['limit']);_0x2ed8c9[_0x5343('0x1b')]=qs[_0x5343('0x1b')](_0x1202bb['query'][_0x5343('0x1b')]);}_0x2ed8c9['order']=qs['sort'](_0x1202bb[_0x5343('0x2c')][_0x5343('0x36')]);_0x2ed8c9[_0x5343('0x37')]=qs[_0x5343('0x2e')](_['pick'](_0x1202bb['query'],_0x47d49a['filters']));if(_0x1202bb['query'][_0x5343('0x38')]){_0x2ed8c9[_0x5343('0x37')]=_[_0x5343('0x39')](_0x2ed8c9[_0x5343('0x37')],{'$or':_[_0x5343('0x2b')](_0x6316d3,function(_0x35abc5){if(_0x35abc5[_0x5343('0x2a')]!=='VIRTUAL'){var _0x42c8a5={};_0x42c8a5[_0x35abc5['name']]={'$like':'%'+_0x1202bb[_0x5343('0x2c')][_0x5343('0x38')]+'%'};return _0x42c8a5;}})});}_0x2ed8c9=_[_0x5343('0x39')]({},_0x2ed8c9,_0x1202bb[_0x5343('0x3a')]);var _0x849368={'where':_0x2ed8c9[_0x5343('0x37')]};return db[_0x5343('0x3b')]['count'](_0x849368)[_0x5343('0x21')](function(_0x52c521){_0x5c689e[_0x5343('0x1a')]=_0x52c521;if(_0x1202bb[_0x5343('0x2c')][_0x5343('0x3c')]){_0x2ed8c9[_0x5343('0x3d')]=[{'all':!![]}];}return db[_0x5343('0x3b')][_0x5343('0x3e')](_0x2ed8c9);})[_0x5343('0x21')](function(_0x4fcbd8){_0x5c689e[_0x5343('0x3f')]=_0x4fcbd8;return _0x5c689e;})[_0x5343('0x21')](respondWithFilteredResult(_0x5d0853,_0x2ed8c9))['catch'](handleError(_0x5d0853,null));};exports[_0x5343('0x40')]=function(_0x16c880,_0x4c576d){var _0x53c3c7={'raw':!![],'where':{'id':_0x16c880[_0x5343('0x41')]['id']}},_0x3ec252={};_0x3ec252[_0x5343('0x30')]=_['keys'](db[_0x5343('0x3b')][_0x5343('0x28')]);_0x3ec252[_0x5343('0x2c')]=_[_0x5343('0x2d')](_0x16c880[_0x5343('0x2c')]);_0x3ec252[_0x5343('0x2e')]=_[_0x5343('0x2f')](_0x3ec252['model'],_0x3ec252[_0x5343('0x2c')]);_0x53c3c7[_0x5343('0x31')]=_[_0x5343('0x2f')](_0x3ec252[_0x5343('0x30')],qs[_0x5343('0x32')](_0x16c880[_0x5343('0x2c')][_0x5343('0x32')]));_0x53c3c7[_0x5343('0x31')]=_0x53c3c7[_0x5343('0x31')][_0x5343('0x33')]?_0x53c3c7[_0x5343('0x31')]:_0x3ec252[_0x5343('0x30')];if(_0x16c880[_0x5343('0x2c')][_0x5343('0x3c')]){_0x53c3c7[_0x5343('0x3d')]=[{'all':!![]}];}_0x53c3c7=_['merge']({},_0x53c3c7,_0x16c880[_0x5343('0x3a')]);return db[_0x5343('0x3b')]['find'](_0x53c3c7)[_0x5343('0x21')](handleEntityNotFound(_0x4c576d,null))[_0x5343('0x21')](respondWithResult(_0x4c576d,null))[_0x5343('0x42')](handleError(_0x4c576d,null));};exports[_0x5343('0x43')]=function(_0x194316,_0x5bf69c){return db[_0x5343('0x3b')]['create'](_0x194316['body'],{})[_0x5343('0x21')](function(_0x115410){var _0x10329c=_0x194316[_0x5343('0x44')]['get']({'plain':!![]});if(!_0x10329c)throw new Error(_0x5343('0x45'));if(_0x10329c[_0x5343('0x46')]===_0x5343('0x44')){var _0xb2cc07=_0x115410[_0x5343('0x22')]({'plain':!![]});var _0x43a792=_0x5343('0x23');return db[_0x5343('0x47')][_0x5343('0x48')]({'where':{'name':_0x43a792,'userProfileId':_0x10329c[_0x5343('0x49')]},'raw':!![]})['then'](function(_0x1cbf7c){if(_0x1cbf7c&&_0x1cbf7c[_0x5343('0x4a')]===0x0){return db[_0x5343('0x4b')][_0x5343('0x43')]({'name':_0xb2cc07[_0x5343('0x27')],'resourceId':_0xb2cc07['id'],'type':_0x1cbf7c[_0x5343('0x27')],'sectionId':_0x1cbf7c['id']},{})[_0x5343('0x21')](function(){return _0x115410;});}else{return _0x115410;}})[_0x5343('0x42')](function(_0x3b3c64){logger[_0x5343('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3b3c64);throw _0x3b3c64;});}return _0x115410;})[_0x5343('0x21')](respondWithResult(_0x5bf69c,0xc9))['catch'](handleError(_0x5bf69c,null));};exports['update']=function(_0x32f2bf,_0x3f8f32){if(_0x32f2bf[_0x5343('0x4c')]['id']){delete _0x32f2bf[_0x5343('0x4c')]['id'];}return db[_0x5343('0x3b')]['find']({'where':{'id':_0x32f2bf[_0x5343('0x41')]['id']}})['then'](handleEntityNotFound(_0x3f8f32,null))[_0x5343('0x21')](saveUpdates(_0x32f2bf['body'],null))[_0x5343('0x21')](respondWithResult(_0x3f8f32,null))['catch'](handleError(_0x3f8f32,null));};exports[_0x5343('0x24')]=function(_0x309cbe,_0x39e76d){return db[_0x5343('0x3b')][_0x5343('0x48')]({'where':{'id':_0x309cbe['params']['id']}})[_0x5343('0x21')](handleEntityNotFound(_0x39e76d,null))[_0x5343('0x21')](removeEntity(_0x39e76d,null))[_0x5343('0x42')](handleError(_0x39e76d,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index c0837c2..fae1dfe 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 _0x9785=['./disposition.attributes','exports','Disposition','tools_dispositions','ListId','name_chat','name','name_mail','name_sms','SmsAccountId','FaxAccountId','name_openchannel','OpenchannelAccountId','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x54b062,_0x264bb5){var _0x255e41=function(_0x3c7e6f){while(--_0x3c7e6f){_0x54b062['push'](_0x54b062['shift']());}};_0x255e41(++_0x264bb5);}(_0x9785,0x133));var _0x5978=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0x9785[_0x3e112d];return _0x531c31;};'use strict';var _=require(_0x5978('0x0'));var util=require(_0x5978('0x1'));var logger=require('../../config/logger')(_0x5978('0x2'));var moment=require(_0x5978('0x3'));var BPromise=require(_0x5978('0x4'));var rp=require(_0x5978('0x5'));var fs=require('fs');var path=require(_0x5978('0x6'));var rimraf=require(_0x5978('0x7'));var config=require('../../config/environment');var attributes=require(_0x5978('0x8'));module[_0x5978('0x9')]=function(_0x4b66a3,_0x4bdafa){return _0x4b66a3['define'](_0x5978('0xa'),attributes,{'tableName':_0x5978('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':['name',_0x5978('0xc')]},{'unique':!![],'name':_0x5978('0xd'),'fields':[_0x5978('0xe'),'ChatWebsiteId']},{'unique':!![],'name':_0x5978('0xf'),'fields':[_0x5978('0xe'),'MailAccountId']},{'unique':!![],'name':_0x5978('0x10'),'fields':[_0x5978('0xe'),_0x5978('0x11')]},{'unique':!![],'name':'name_fax','fields':['name',_0x5978('0x12')]},{'unique':!![],'name':_0x5978('0x13'),'fields':['name',_0x5978('0x14')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1b80=['name_chat','ChatWebsiteId','name_mail','name','MailAccountId','name_sms','SmsAccountId','name_fax','name_openchannel','OpenchannelAccountId','util','api','bluebird','path','rimraf','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','ListId'];(function(_0x120207,_0x598472){var _0x1faa90=function(_0x1287c5){while(--_0x1287c5){_0x120207['push'](_0x120207['shift']());}};_0x1faa90(++_0x598472);}(_0x1b80,0xe6));var _0x01b8=function(_0x334cd5,_0x31db0b){_0x334cd5=_0x334cd5-0x0;var _0x3f5cda=_0x1b80[_0x334cd5];return _0x3f5cda;};'use strict';var _=require('lodash');var util=require(_0x01b8('0x0'));var logger=require('../../config/logger')(_0x01b8('0x1'));var moment=require('moment');var BPromise=require(_0x01b8('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x01b8('0x3'));var rimraf=require(_0x01b8('0x4'));var config=require('../../config/environment');var attributes=require(_0x01b8('0x5'));module[_0x01b8('0x6')]=function(_0x371558,_0x45351b){return _0x371558[_0x01b8('0x7')](_0x01b8('0x8'),attributes,{'tableName':_0x01b8('0x9'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x01b8('0xa'),'fields':['name',_0x01b8('0xb')]},{'unique':!![],'name':_0x01b8('0xc'),'fields':['name',_0x01b8('0xd')]},{'unique':!![],'name':_0x01b8('0xe'),'fields':[_0x01b8('0xf'),_0x01b8('0x10')]},{'unique':!![],'name':_0x01b8('0x11'),'fields':[_0x01b8('0xf'),_0x01b8('0x12')]},{'unique':!![],'name':_0x01b8('0x13'),'fields':['name','FaxAccountId']},{'unique':!![],'name':_0x01b8('0x14'),'fields':[_0x01b8('0xf'),_0x01b8('0x15')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 18fdd6b..eb68219 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 _0x952b=['../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','Disposition,\x20%s,\x20%s','debug','Disposition,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x5b27da,_0x4a6532){var _0x3254f4=function(_0x4194c6){while(--_0x4194c6){_0x5b27da['push'](_0x5b27da['shift']());}};_0x3254f4(++_0x4a6532);}(_0x952b,0xd7));var _0xb952=function(_0x2c73c6,_0x28332b){_0x2c73c6=_0x2c73c6-0x0;var _0x2e203c=_0x952b[_0x2c73c6];return _0x2e203c;};'use strict';var _=require(_0xb952('0x0'));var util=require('util');var moment=require(_0xb952('0x1'));var BPromise=require(_0xb952('0x2'));var rs=require(_0xb952('0x3'));var fs=require('fs');var Redis=require(_0xb952('0x4'));var db=require(_0xb952('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb952('0x6'));var config=require(_0xb952('0x7'));var jayson=require(_0xb952('0x8'));var client=jayson[_0xb952('0x9')][_0xb952('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52ce14,_0x2ba973,_0x58ab24){return new BPromise(function(_0x20bf88,_0x23b06f){return client['request'](_0x52ce14,_0x58ab24)[_0xb952('0xb')](function(_0x140b48){logger[_0xb952('0xc')](_0xb952('0xd'),_0x2ba973,'request\x20sent');logger[_0xb952('0xe')](_0xb952('0xf'),_0x2ba973,_0xb952('0x10'),JSON['stringify'](_0x140b48));if(_0x140b48[_0xb952('0x11')]){if(_0x140b48[_0xb952('0x11')][_0xb952('0x12')]===0x1f4){logger[_0xb952('0x11')](_0xb952('0xd'),_0x2ba973,_0x140b48[_0xb952('0x11')][_0xb952('0x13')]);return _0x23b06f(_0x140b48['error'][_0xb952('0x13')]);}logger[_0xb952('0x11')](_0xb952('0xd'),_0x2ba973,_0x140b48[_0xb952('0x11')]['message']);return _0x20bf88(_0x140b48[_0xb952('0x11')][_0xb952('0x13')]);}else{logger[_0xb952('0xc')](_0xb952('0xd'),_0x2ba973,'request\x20sent');_0x20bf88(_0x140b48['result'][_0xb952('0x13')]);}})['catch'](function(_0x16f2da){logger[_0xb952('0x11')](_0xb952('0xd'),_0x2ba973,_0x16f2da);_0x23b06f(_0x16f2da);});});} \ No newline at end of file +var _0x2e44=['then','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request'];(function(_0x1814d9,_0x538add){var _0x8bfc84=function(_0x36e1af){while(--_0x36e1af){_0x1814d9['push'](_0x1814d9['shift']());}};_0x8bfc84(++_0x538add);}(_0x2e44,0xb3));var _0x42e4=function(_0x2ecf03,_0x2adccf){_0x2ecf03=_0x2ecf03-0x0;var _0x4418ab=_0x2e44[_0x2ecf03];return _0x4418ab;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x42e4('0x0'));var BPromise=require(_0x42e4('0x1'));var rs=require(_0x42e4('0x2'));var fs=require('fs');var Redis=require(_0x42e4('0x3'));var db=require(_0x42e4('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x42e4('0x5'))(_0x42e4('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x42e4('0x7')][_0x42e4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1c63ed,_0x16a04e,_0x438004){return new BPromise(function(_0x1df65b,_0x492f54){return client[_0x42e4('0x9')](_0x1c63ed,_0x438004)[_0x42e4('0xa')](function(_0x301b29){logger[_0x42e4('0xb')](_0x42e4('0xc'),_0x16a04e,_0x42e4('0xd'));logger[_0x42e4('0xe')]('Disposition,\x20%s,\x20%s,\x20%s',_0x16a04e,_0x42e4('0xd'),JSON[_0x42e4('0xf')](_0x301b29));if(_0x301b29['error']){if(_0x301b29[_0x42e4('0x10')][_0x42e4('0x11')]===0x1f4){logger[_0x42e4('0x10')](_0x42e4('0xc'),_0x16a04e,_0x301b29['error'][_0x42e4('0x12')]);return _0x492f54(_0x301b29[_0x42e4('0x10')]['message']);}logger[_0x42e4('0x10')]('Disposition,\x20%s,\x20%s',_0x16a04e,_0x301b29[_0x42e4('0x10')][_0x42e4('0x12')]);return _0x1df65b(_0x301b29['error'][_0x42e4('0x12')]);}else{logger[_0x42e4('0xb')](_0x42e4('0xc'),_0x16a04e,_0x42e4('0xd'));_0x1df65b(_0x301b29[_0x42e4('0x13')]['message']);}})[_0x42e4('0x14')](function(_0x1957ed){logger[_0x42e4('0x10')](_0x42e4('0xc'),_0x16a04e,_0x1957ed);_0x492f54(_0x1957ed);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index 414d777..225a948 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 _0x8a5c=['create','put','update','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show'];(function(_0x1c7d2d,_0x8763c5){var _0x230323=function(_0x2ba914){while(--_0x2ba914){_0x1c7d2d['push'](_0x1c7d2d['shift']());}};_0x230323(++_0x8763c5);}(_0x8a5c,0x136));var _0xc8a5=function(_0x320da1,_0x55c0f7){_0x320da1=_0x320da1-0x0;var _0x3ecba5=_0x8a5c[_0x320da1];return _0x3ecba5;};'use strict';var multer=require(_0xc8a5('0x0'));var util=require(_0xc8a5('0x1'));var path=require(_0xc8a5('0x2'));var timeout=require(_0xc8a5('0x3'));var express=require(_0xc8a5('0x4'));var router=express[_0xc8a5('0x5')]();var auth=require(_0xc8a5('0x6'));var interaction=require(_0xc8a5('0x7'));var config=require(_0xc8a5('0x8'));var controller=require('./disposition.controller');router[_0xc8a5('0x9')]('/',auth[_0xc8a5('0xa')](),controller['index']);router[_0xc8a5('0x9')](_0xc8a5('0xb'),auth[_0xc8a5('0xa')](),controller[_0xc8a5('0xc')]);router['post']('/',auth[_0xc8a5('0xa')](),controller[_0xc8a5('0xd')]);router[_0xc8a5('0xe')](_0xc8a5('0xb'),auth[_0xc8a5('0xa')](),controller[_0xc8a5('0xf')]);router[_0xc8a5('0x10')](_0xc8a5('0xb'),auth[_0xc8a5('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x5d0a=['../../components/interaction/service','./disposition.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service'];(function(_0x159dc3,_0x52ca80){var _0x2a9e2f=function(_0x49f14e){while(--_0x49f14e){_0x159dc3['push'](_0x159dc3['shift']());}};_0x2a9e2f(++_0x52ca80);}(_0x5d0a,0x175));var _0xa5d0=function(_0x1b0f82,_0x4a1892){_0x1b0f82=_0x1b0f82-0x0;var _0x58d37d=_0x5d0a[_0x1b0f82];return _0x58d37d;};'use strict';var multer=require(_0xa5d0('0x0'));var util=require('util');var path=require(_0xa5d0('0x1'));var timeout=require('connect-timeout');var express=require(_0xa5d0('0x2'));var router=express[_0xa5d0('0x3')]();var auth=require(_0xa5d0('0x4'));var interaction=require(_0xa5d0('0x5'));var config=require('../../config/environment');var controller=require(_0xa5d0('0x6'));router[_0xa5d0('0x7')]('/',auth[_0xa5d0('0x8')](),controller[_0xa5d0('0x9')]);router[_0xa5d0('0x7')](_0xa5d0('0xa'),auth[_0xa5d0('0x8')](),controller[_0xa5d0('0xb')]);router[_0xa5d0('0xc')]('/',auth[_0xa5d0('0x8')](),controller[_0xa5d0('0xd')]);router['put'](_0xa5d0('0xa'),auth[_0xa5d0('0x8')](),controller[_0xa5d0('0xe')]);router[_0xa5d0('0xf')](_0xa5d0('0xa'),auth[_0xa5d0('0x8')](),controller[_0xa5d0('0x10')]);module[_0xa5d0('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 7c59171..c81220b 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 _0xf914=['DADHI','KHOMP','TEXT','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','2400','4800','7200','9600','12000','14400','v17,v27,v29','INTEGER','SIP','IAX'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xf914,0x132));var _0x4f91=function(_0x12b449,_0x2b8a36){_0x12b449=_0x12b449-0x0;var _0x4e3784=_0xf914[_0x12b449];return _0x4e3784;};'use strict';var Sequelize=require(_0x4f91('0x0'));module[_0x4f91('0x1')]={'name':{'type':Sequelize[_0x4f91('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x4f91('0x2')]},'ecm':{'type':Sequelize[_0x4f91('0x3')](_0x4f91('0x4'),'no'),'defaultValue':_0x4f91('0x4')},'headerinfo':{'type':Sequelize[_0x4f91('0x2')],'defaultValue':_0x4f91('0x5')},'localstationid':{'type':Sequelize[_0x4f91('0x2')],'unique':'localstationid'},'minrate':{'type':Sequelize[_0x4f91('0x3')](_0x4f91('0x6'),_0x4f91('0x7'),_0x4f91('0x8'),_0x4f91('0x9'),_0x4f91('0xa'),'14400'),'defaultValue':_0x4f91('0x7')},'maxrate':{'type':Sequelize[_0x4f91('0x3')]('2400','4800',_0x4f91('0x8'),_0x4f91('0x9'),_0x4f91('0xa'),_0x4f91('0xb')),'defaultValue':_0x4f91('0xb')},'modem':{'type':Sequelize[_0x4f91('0x2')],'defaultValue':_0x4f91('0xc')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x4f91('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x4f91('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x4f91('0x3')](_0x4f91('0xe'),_0x4f91('0xf'),_0x4f91('0x10'),_0x4f91('0x11')),'defaultValue':_0x4f91('0xe')},'key':{'type':Sequelize[_0x4f91('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x4f91('0x12')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x4f91('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x4f91('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4f91('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4f91('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4f91('0xd')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x4f91('0x14'),'set':function(_0x5a90f1){if(!_0x5a90f1)this[_0x4f91('0x15')]('mandatoryDispositionPauseId',null);this[_0x4f91('0x15')](_0x4f91('0x16'),_0x5a90f1);}}}; \ No newline at end of file +var _0x2fd7=['mandatoryDisposition','sequelize','STRING','ENUM','yes','localstationid','4800','7200','9600','14400','2400','12000','v17,v27,v29','INTEGER','SIP','DADHI','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId'];(function(_0x1c526f,_0xad84c7){var _0x14f246=function(_0x5ea5a4){while(--_0x5ea5a4){_0x1c526f['push'](_0x1c526f['shift']());}};_0x14f246(++_0xad84c7);}(_0x2fd7,0x8b));var _0x72fd=function(_0x134e22,_0x28220c){_0x134e22=_0x134e22-0x0;var _0x5d700e=_0x2fd7[_0x134e22];return _0x5d700e;};'use strict';var Sequelize=require(_0x72fd('0x0'));module['exports']={'name':{'type':Sequelize[_0x72fd('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x72fd('0x1')]},'ecm':{'type':Sequelize[_0x72fd('0x2')](_0x72fd('0x3'),'no'),'defaultValue':_0x72fd('0x3')},'headerinfo':{'type':Sequelize[_0x72fd('0x1')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0x72fd('0x1')],'unique':_0x72fd('0x4')},'minrate':{'type':Sequelize[_0x72fd('0x2')]('2400',_0x72fd('0x5'),_0x72fd('0x6'),_0x72fd('0x7'),'12000',_0x72fd('0x8')),'defaultValue':_0x72fd('0x5')},'maxrate':{'type':Sequelize[_0x72fd('0x2')](_0x72fd('0x9'),'4800',_0x72fd('0x6'),_0x72fd('0x7'),_0x72fd('0xa'),'14400'),'defaultValue':_0x72fd('0x8')},'modem':{'type':Sequelize[_0x72fd('0x1')],'defaultValue':_0x72fd('0xb')},'gateway':{'type':Sequelize[_0x72fd('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x72fd('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x72fd('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x72fd('0x2')](_0x72fd('0xd'),'IAX',_0x72fd('0xe'),'KHOMP'),'defaultValue':_0x72fd('0xd')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x72fd('0xf')],'defaultValue':function(){return _0x72fd('0x10');}},'notificationSound':{'type':Sequelize[_0x72fd('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x72fd('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x72fd('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x72fd('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x72fd('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x72fd('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0x72fd('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x72fd('0x11')],'defaultValue':![],'comment':_0x72fd('0x13'),'set':function(_0x2536d2){if(!_0x2536d2)this[_0x72fd('0x14')](_0x72fd('0x15'),null);this['setDataValue'](_0x72fd('0x16'),_0x2536d2);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index d5e7431..6c6414f 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 _0xc337=['catch','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','name','send','mandatoryDispositionPause','FaxAccount','rawAttributes','fieldName','type','key','map','query','filters','intersection','attributes','model','fields','length','nolimit','order','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','Pause','keys','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','describe','addDisposition','FaxAccountId','getDispositions','findOne','Disposition','hasOwnProperty','sort','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','Contact','User','Owner','fullname','Tag','Tags','tag','addApplications','sequelize','transaction','FaxApplication','findAndCountAll','getApplications','context','from-voip-provider','localstationid','app','system','description','Fax\x20Extension','priority','appdata','Answer','push','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','modem','t38timeout','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','bulkCreate','tech','updatedAt','TrunkId','findById','getMessages','FaxMessage','format','YYYY-MM-DD\x20HH:mm:ss','CmContact','Contacts','DESC','attachments','join','root','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','List','ListId','Send\x20Fax\x20failed','out','filename','Contact\x20not\x20found','spread','ContactId','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','addAgents','emit','removeAgents','isArray','userFaxAccount:remove','getAgents','html-pdf','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','test','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~!@#$%^&-_=+[{]}.','then','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','FaxAccount,\x20%s,\x20%s'];(function(_0xd42f98,_0x30dba4){var _0x2a57bb=function(_0x45427e){while(--_0x45427e){_0xd42f98['push'](_0xd42f98['shift']());}};_0x2a57bb(++_0x30dba4);}(_0xc337,0x150));var _0x7c33=function(_0x36b36e,_0x8ddc0){_0x36b36e=_0x36b36e-0x0;var _0x5e44b6=_0xc337[_0x36b36e];return _0x5e44b6;};'use strict';var pdf=require(_0x7c33('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7c33('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7c33('0x2'));var rp=require(_0x7c33('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7c33('0x4'));var util=require(_0x7c33('0x5'));var path=require(_0x7c33('0x6'));var sox=require(_0x7c33('0x7'));var csv=require(_0x7c33('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x7c33('0x9'));var crypto=require(_0x7c33('0xa'));var jsforce=require(_0x7c33('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7c33('0xc'));var Papa=require(_0x7c33('0xd'));var Redis=require(_0x7c33('0xe'));var authService=require(_0x7c33('0xf'));var qs=require(_0x7c33('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7c33('0x11'));var logger=require('../../config/logger')(_0x7c33('0x12'));var utils=require(_0x7c33('0x13'));var config=require(_0x7c33('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x7c33('0x15')](config['redis'],{'host':_0x7c33('0x16'),'port':0x18eb});var socket=require(_0x7c33('0x17'))(new Redis(config['redis']));require('./faxAccount.socket')[_0x7c33('0x18')](socket);var jayson=require(_0x7c33('0x19'));var client=jayson[_0x7c33('0x1a')][_0x7c33('0x1b')]({'port':0x232c});var client9002=jayson[_0x7c33('0x1a')][_0x7c33('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x4747de,_0x20dba5,_0x3a1aba){if(_0x3a1aba){var _0x3c31f6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3c31f6[_0x7c33('0x1c')](_0x20dba5)){return _0x4747de;}else{throw new db['Sequelize'][(_0x7c33('0x1d'))](_0x7c33('0x1e'));}}else{return _0x4747de;}}function respondWithRpcPromise(_0x57199d,_0x2b2137,_0x4e17ad,_0x5f37fe){return new BPromise(function(_0x555613,_0x22b675){var _0x557722=_0x5f37fe||client;return _0x557722['request'](_0x57199d,_0x4e17ad)[_0x7c33('0x1f')](function(_0x14fd26){logger[_0x7c33('0x20')]('FaxAccount,\x20%s,\x20%s',_0x2b2137,_0x7c33('0x21'));logger[_0x7c33('0x22')](_0x7c33('0x23'),_0x2b2137,_0x7c33('0x21'),JSON[_0x7c33('0x24')](_0x14fd26));if(_0x14fd26['error']){if(_0x14fd26[_0x7c33('0x25')]['code']===0x1f4){logger[_0x7c33('0x25')]('FaxAccount,\x20%s,\x20%s',_0x2b2137,_0x14fd26[_0x7c33('0x25')][_0x7c33('0x26')]);return _0x22b675(_0x14fd26['error'][_0x7c33('0x26')]);}logger[_0x7c33('0x25')]('FaxAccount,\x20%s,\x20%s',_0x2b2137,_0x14fd26[_0x7c33('0x25')][_0x7c33('0x26')]);return _0x555613(_0x14fd26[_0x7c33('0x25')][_0x7c33('0x26')]);}else{logger[_0x7c33('0x20')](_0x7c33('0x27'),_0x2b2137,_0x7c33('0x21'));_0x555613(_0x14fd26['result']['message']);}})[_0x7c33('0x28')](function(_0x3565fc){logger[_0x7c33('0x25')](_0x7c33('0x27'),_0x2b2137,_0x3565fc);_0x22b675(_0x3565fc);});});}function respondWithStatusCode(_0x401670,_0x456f9a){_0x456f9a=_0x456f9a||0xcc;return function(_0x1b6e92){if(_0x1b6e92){return _0x401670[_0x7c33('0x29')](_0x456f9a);}return _0x401670['status'](_0x456f9a)[_0x7c33('0x2a')]();};}function respondWithResult(_0x3894f6,_0x26bf6e){_0x26bf6e=_0x26bf6e||0xc8;return function(_0x167ab2){if(_0x167ab2){return _0x3894f6['status'](_0x26bf6e)[_0x7c33('0x2b')](_0x167ab2);}};}function respondWithFilteredResult(_0x33d9ee,_0x2945ef){return function(_0xc53b5b){if(_0xc53b5b){var _0x33aa0c=_0xc53b5b[_0x7c33('0x2c')],_0x44deaa=_0x2945ef['offset'],_0x550fd0=_0x2945ef[_0x7c33('0x2d')]+_0x2945ef[_0x7c33('0x2e')],_0x47d495;if(_0x550fd0>=_0x33aa0c){_0x550fd0=_0x33aa0c;_0x47d495=0xc8;}else{_0x47d495=0xce;}_0x33d9ee[_0x7c33('0x2f')](_0x47d495);return _0x33d9ee[_0x7c33('0x30')](_0x7c33('0x31'),_0x44deaa+'-'+_0x550fd0+'/'+_0x33aa0c)[_0x7c33('0x2b')](_0xc53b5b);}return null;};}function patchUpdates(_0x45be0a){return function(_0x4b5110){try{jsonpatch[_0x7c33('0x32')](_0x4b5110,_0x45be0a,!![]);}catch(_0x192b6f){return BPromise[_0x7c33('0x33')](_0x192b6f);}return _0x4b5110[_0x7c33('0x34')]();};}function saveUpdates(_0x365b02,_0x1b1e4b){return function(_0x345c6f){if(_0x345c6f){return _0x345c6f[_0x7c33('0x35')](_0x365b02)[_0x7c33('0x1f')](function(_0x545ea4){return _0x545ea4;});}return null;};}function removeEntity(_0x2264f4,_0x147025){return function(_0x15da99){if(_0x15da99){return _0x15da99[_0x7c33('0x36')]()['then'](function(){var _0x121582=_0x15da99[_0x7c33('0x37')]({'plain':!![]});var _0x44f43d=_0x7c33('0x38');return db[_0x7c33('0x39')][_0x7c33('0x36')]({'where':{'type':_0x44f43d,'resourceId':_0x121582['id']}})[_0x7c33('0x1f')](function(){return _0x15da99;});})[_0x7c33('0x1f')](function(){_0x2264f4['status'](0xcc)[_0x7c33('0x2a')]();});}};}function handleEntityNotFound(_0x1b7e23,_0x1a63f5){return function(_0x291eed){if(!_0x291eed){_0x1b7e23['sendStatus'](0x194);}return _0x291eed;};}function handleError(_0x27e166,_0x481505){_0x481505=_0x481505||0x1f4;return function(_0x78421a){logger[_0x7c33('0x25')](_0x78421a['stack']);if(_0x78421a['name']){delete _0x78421a[_0x7c33('0x3a')];}_0x27e166[_0x7c33('0x2f')](_0x481505)[_0x7c33('0x3b')](_0x78421a);};}exports['index']=function(_0x49c38a,_0x77940e){var _0x3a8361={'include':[{'model':db['Pause'],'as':_0x7c33('0x3c')}]},_0x46ea6e={},_0x582a2f={'count':0x0,'rows':[]};var _0x29f83f=_['map'](db[_0x7c33('0x3d')][_0x7c33('0x3e')],function(_0xe3e70e){return{'name':_0xe3e70e[_0x7c33('0x3f')],'type':_0xe3e70e[_0x7c33('0x40')][_0x7c33('0x41')]};});_0x46ea6e['model']=_[_0x7c33('0x42')](_0x29f83f,_0x7c33('0x3a'));_0x46ea6e[_0x7c33('0x43')]=_['keys'](_0x49c38a[_0x7c33('0x43')]);_0x46ea6e[_0x7c33('0x44')]=_[_0x7c33('0x45')](_0x46ea6e['model'],_0x46ea6e[_0x7c33('0x43')]);_0x3a8361[_0x7c33('0x46')]=_['intersection'](_0x46ea6e[_0x7c33('0x47')],qs['fields'](_0x49c38a[_0x7c33('0x43')][_0x7c33('0x48')]));_0x3a8361[_0x7c33('0x46')]=_0x3a8361[_0x7c33('0x46')][_0x7c33('0x49')]?_0x3a8361['attributes']:_0x46ea6e['model'];if(!_0x49c38a['query']['hasOwnProperty'](_0x7c33('0x4a'))){_0x3a8361[_0x7c33('0x2e')]=qs[_0x7c33('0x2e')](_0x49c38a['query'][_0x7c33('0x2e')]);_0x3a8361[_0x7c33('0x2d')]=qs['offset'](_0x49c38a[_0x7c33('0x43')][_0x7c33('0x2d')]);}_0x3a8361[_0x7c33('0x4b')]=qs['sort'](_0x49c38a[_0x7c33('0x43')]['sort']);_0x3a8361[_0x7c33('0x4c')]=qs['filters'](_[_0x7c33('0x4d')](_0x49c38a[_0x7c33('0x43')],_0x46ea6e[_0x7c33('0x44')]));if(_0x49c38a[_0x7c33('0x43')][_0x7c33('0x4e')]){_0x3a8361[_0x7c33('0x4c')]=_[_0x7c33('0x4f')](_0x3a8361['where'],{'$or':_[_0x7c33('0x42')](_0x29f83f,function(_0x2e31bd){if(_0x2e31bd[_0x7c33('0x40')]!=='VIRTUAL'){var _0x2fe7bc={};_0x2fe7bc[_0x2e31bd['name']]={'$like':'%'+_0x49c38a['query'][_0x7c33('0x4e')]+'%'};return _0x2fe7bc;}})});}_0x3a8361=_['merge']({},_0x3a8361,_0x49c38a[_0x7c33('0x50')]);var _0x91b0d4={'where':_0x3a8361[_0x7c33('0x4c')]};return db[_0x7c33('0x3d')]['count'](_0x91b0d4)['then'](function(_0x19c176){_0x582a2f[_0x7c33('0x2c')]=_0x19c176;if(_0x49c38a[_0x7c33('0x43')][_0x7c33('0x51')]){_0x3a8361[_0x7c33('0x52')]=[{'all':!![]}];}return db[_0x7c33('0x3d')][_0x7c33('0x53')](_0x3a8361);})[_0x7c33('0x1f')](function(_0x30b51e){_0x582a2f[_0x7c33('0x54')]=_0x30b51e;return _0x582a2f;})[_0x7c33('0x1f')](respondWithFilteredResult(_0x77940e,_0x3a8361))['catch'](handleError(_0x77940e,null));};exports[_0x7c33('0x55')]=function(_0x46b286,_0x26ff6f){var _0x35c0de={'raw':![],'where':{'id':_0x46b286[_0x7c33('0x56')]['id']},'include':[{'model':db[_0x7c33('0x57')],'as':_0x7c33('0x3c')}]},_0x4f45a3={};_0x4f45a3[_0x7c33('0x47')]=_[_0x7c33('0x58')](db[_0x7c33('0x3d')]['rawAttributes']);_0x4f45a3[_0x7c33('0x43')]=_[_0x7c33('0x58')](_0x46b286[_0x7c33('0x43')]);_0x4f45a3['filters']=_[_0x7c33('0x45')](_0x4f45a3[_0x7c33('0x47')],_0x4f45a3[_0x7c33('0x43')]);_0x35c0de[_0x7c33('0x46')]=_[_0x7c33('0x45')](_0x4f45a3[_0x7c33('0x47')],qs[_0x7c33('0x48')](_0x46b286['query'][_0x7c33('0x48')]));_0x35c0de[_0x7c33('0x46')]=_0x35c0de[_0x7c33('0x46')][_0x7c33('0x49')]?_0x35c0de['attributes']:_0x4f45a3[_0x7c33('0x47')];if(_0x46b286[_0x7c33('0x43')][_0x7c33('0x51')]){_0x35c0de[_0x7c33('0x52')]=[{'all':!![]}];}_0x35c0de=_[_0x7c33('0x4f')]({},_0x35c0de,_0x46b286[_0x7c33('0x50')]);return db[_0x7c33('0x3d')]['find'](_0x35c0de)[_0x7c33('0x1f')](handleEntityNotFound(_0x26ff6f,null))[_0x7c33('0x1f')](respondWithResult(_0x26ff6f,null))[_0x7c33('0x28')](handleError(_0x26ff6f,null));};exports[_0x7c33('0x59')]=function(_0x4058f7,_0x26b44c){return db['FaxAccount'][_0x7c33('0x59')](_0x4058f7[_0x7c33('0x5a')],{})[_0x7c33('0x1f')](function(_0x1c1a90){var _0x3797bb=_0x4058f7[_0x7c33('0x5b')][_0x7c33('0x37')]({'plain':!![]});if(!_0x3797bb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3797bb[_0x7c33('0x5c')]==='user'){var _0x15c8f1=_0x1c1a90[_0x7c33('0x37')]({'plain':!![]});var _0x4f2599=_0x7c33('0x38');return db[_0x7c33('0x5d')][_0x7c33('0x5e')]({'where':{'name':_0x4f2599,'userProfileId':_0x3797bb[_0x7c33('0x5f')]},'raw':!![]})[_0x7c33('0x1f')](function(_0x5ad69e){if(_0x5ad69e&&_0x5ad69e[_0x7c33('0x60')]===0x0){return db['UserProfileResource'][_0x7c33('0x59')]({'name':_0x15c8f1[_0x7c33('0x3a')],'resourceId':_0x15c8f1['id'],'type':_0x5ad69e[_0x7c33('0x3a')],'sectionId':_0x5ad69e['id']},{})['then'](function(){return _0x1c1a90;});}else{return _0x1c1a90;}})[_0x7c33('0x28')](function(_0x3f5740){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3f5740);throw _0x3f5740;});}return _0x1c1a90;})[_0x7c33('0x1f')](respondWithResult(_0x26b44c,0xc9))[_0x7c33('0x28')](handleError(_0x26b44c,null));};exports[_0x7c33('0x35')]=function(_0x29c35c,_0x691d88){if(_0x29c35c[_0x7c33('0x5a')]['id']){delete _0x29c35c[_0x7c33('0x5a')]['id'];}return db[_0x7c33('0x3d')]['find']({'where':{'id':_0x29c35c['params']['id']},'include':[{'model':db['Pause'],'as':_0x7c33('0x3c')}]})[_0x7c33('0x1f')](handleEntityNotFound(_0x691d88,null))[_0x7c33('0x1f')](saveUpdates(_0x29c35c[_0x7c33('0x5a')],null))['then'](respondWithResult(_0x691d88,null))['catch'](handleError(_0x691d88,null));};exports[_0x7c33('0x36')]=function(_0x3163bf,_0x119ae7){return db[_0x7c33('0x3d')]['find']({'where':{'id':_0x3163bf['params']['id']}})[_0x7c33('0x1f')](handleEntityNotFound(_0x119ae7,null))[_0x7c33('0x1f')](removeEntity(_0x119ae7,null))[_0x7c33('0x28')](handleError(_0x119ae7,null));};exports[_0x7c33('0x61')]=function(_0xf92715,_0x1ff9f0){return db[_0x7c33('0x3d')][_0x7c33('0x61')]()['then'](respondWithResult(_0x1ff9f0,null))[_0x7c33('0x28')](handleError(_0x1ff9f0,null));};exports[_0x7c33('0x62')]=function(_0x56681f,_0x5eadd5,_0x423574){if(_0x56681f[_0x7c33('0x5a')]['id']){delete _0x56681f[_0x7c33('0x5a')]['id'];}return db[_0x7c33('0x3d')][_0x7c33('0x5e')]({'where':{'id':_0x56681f[_0x7c33('0x56')]['id']}})[_0x7c33('0x1f')](handleEntityNotFound(_0x5eadd5,null))['then'](function(_0x3c9762){if(_0x3c9762){_0x56681f[_0x7c33('0x5a')][_0x7c33('0x63')]=_0x3c9762['id'];return db['Disposition']['create'](_0x56681f['body']);}})[_0x7c33('0x1f')](respondWithResult(_0x5eadd5,null))[_0x7c33('0x28')](handleError(_0x5eadd5,null));};exports[_0x7c33('0x64')]=function(_0x349782,_0x29d64a,_0x2c451a){var _0x42c8a7={'raw':![],'where':{}};var _0x3c7d28={};var _0x3fcd79={'count':0x0,'rows':[]};return db['FaxAccount'][_0x7c33('0x65')]({'where':{'id':_0x349782[_0x7c33('0x56')]['id']}})[_0x7c33('0x1f')](handleEntityNotFound(_0x29d64a,null))[_0x7c33('0x1f')](function(_0x49dd5a){if(_0x49dd5a){_0x3c7d28['model']=_[_0x7c33('0x58')](db[_0x7c33('0x66')]['rawAttributes']);_0x3c7d28[_0x7c33('0x43')]=_[_0x7c33('0x58')](_0x349782['query']);_0x3c7d28['filters']=_['intersection'](_0x3c7d28[_0x7c33('0x47')],_0x3c7d28[_0x7c33('0x43')]);_0x42c8a7['attributes']=_[_0x7c33('0x45')](_0x3c7d28['model'],qs[_0x7c33('0x48')](_0x349782[_0x7c33('0x43')][_0x7c33('0x48')]));_0x42c8a7['attributes']=_0x42c8a7[_0x7c33('0x46')][_0x7c33('0x49')]?_0x42c8a7[_0x7c33('0x46')]:_0x3c7d28[_0x7c33('0x47')];if(!_0x349782[_0x7c33('0x43')][_0x7c33('0x67')](_0x7c33('0x4a'))){_0x42c8a7[_0x7c33('0x2e')]=qs[_0x7c33('0x2e')](_0x349782[_0x7c33('0x43')][_0x7c33('0x2e')]);_0x42c8a7[_0x7c33('0x2d')]=qs['offset'](_0x349782[_0x7c33('0x43')][_0x7c33('0x2d')]);}_0x42c8a7[_0x7c33('0x4b')]=qs[_0x7c33('0x68')](_0x349782[_0x7c33('0x43')][_0x7c33('0x68')]);_0x42c8a7[_0x7c33('0x4c')]=qs[_0x7c33('0x44')](_[_0x7c33('0x4d')](_0x349782[_0x7c33('0x43')],_0x3c7d28[_0x7c33('0x44')]));_0x42c8a7['where'][_0x7c33('0x63')]=_0x49dd5a['id'];if(_0x349782[_0x7c33('0x43')][_0x7c33('0x4e')]){_0x42c8a7[_0x7c33('0x4c')]=_['merge'](_0x42c8a7[_0x7c33('0x4c')],{'$or':_[_0x7c33('0x42')](_0x42c8a7[_0x7c33('0x46')],function(_0x1df42b){var _0x511741={};_0x511741[_0x1df42b]={'$like':'%'+_0x349782[_0x7c33('0x43')][_0x7c33('0x4e')]+'%'};return _0x511741;})});}_0x42c8a7=_[_0x7c33('0x4f')]({},_0x42c8a7,_0x349782[_0x7c33('0x50')]);return db['Disposition']['count']({'where':_0x42c8a7[_0x7c33('0x4c')]})[_0x7c33('0x1f')](function(_0x2d86fd){_0x3fcd79[_0x7c33('0x2c')]=_0x2d86fd;if(_0x349782[_0x7c33('0x43')]['includeAll']){_0x42c8a7['include']=[{'all':!![]}];}return db['Disposition'][_0x7c33('0x53')](_0x42c8a7);})[_0x7c33('0x1f')](function(_0x273a2e){_0x3fcd79['rows']=_0x273a2e;return _0x3fcd79;});}})[_0x7c33('0x1f')](respondWithFilteredResult(_0x29d64a,_0x42c8a7))[_0x7c33('0x28')](handleError(_0x29d64a,null));};exports[_0x7c33('0x69')]=function(_0x43f3bb,_0x1f6b43,_0x319be5){return db[_0x7c33('0x3d')][_0x7c33('0x5e')]({'where':{'id':_0x43f3bb['params']['id']}})[_0x7c33('0x1f')](handleEntityNotFound(_0x1f6b43,null))['then'](function(_0x4fe5a9){if(_0x4fe5a9){return _0x4fe5a9[_0x7c33('0x69')](_0x43f3bb[_0x7c33('0x43')][_0x7c33('0x6a')]);}})[_0x7c33('0x1f')](respondWithStatusCode(_0x1f6b43,null))[_0x7c33('0x28')](handleError(_0x1f6b43,null));};exports['addAnswer']=function(_0x4d7ba1,_0xa30811,_0x4b3fe5){if(_0x4d7ba1[_0x7c33('0x5a')]['id']){delete _0x4d7ba1[_0x7c33('0x5a')]['id'];}return db[_0x7c33('0x3d')][_0x7c33('0x5e')]({'where':{'id':_0x4d7ba1[_0x7c33('0x56')]['id']}})[_0x7c33('0x1f')](handleEntityNotFound(_0xa30811,null))['then'](function(_0x3f45fc){if(_0x3f45fc){_0x4d7ba1['body']['FaxAccountId']=_0x3f45fc['id'];return db[_0x7c33('0x6b')][_0x7c33('0x59')](_0x4d7ba1[_0x7c33('0x5a')]);}})[_0x7c33('0x1f')](respondWithResult(_0xa30811,null))[_0x7c33('0x28')](handleError(_0xa30811,null));};exports[_0x7c33('0x6c')]=function(_0x565f60,_0x49c256,_0xb9ca0f){var _0x54b07b={'raw':![],'where':{}};var _0xe1edd={};var _0x1c6e84={'count':0x0,'rows':[]};return db[_0x7c33('0x3d')][_0x7c33('0x65')]({'where':{'id':_0x565f60[_0x7c33('0x56')]['id']}})[_0x7c33('0x1f')](handleEntityNotFound(_0x49c256,null))['then'](function(_0xab1b92){if(_0xab1b92){_0xe1edd[_0x7c33('0x47')]=_[_0x7c33('0x58')](db[_0x7c33('0x6b')]['rawAttributes']);_0xe1edd[_0x7c33('0x43')]=_[_0x7c33('0x58')](_0x565f60['query']);_0xe1edd[_0x7c33('0x44')]=_[_0x7c33('0x45')](_0xe1edd['model'],_0xe1edd[_0x7c33('0x43')]);_0x54b07b[_0x7c33('0x46')]=_['intersection'](_0xe1edd[_0x7c33('0x47')],qs['fields'](_0x565f60[_0x7c33('0x43')][_0x7c33('0x48')]));_0x54b07b['attributes']=_0x54b07b['attributes'][_0x7c33('0x49')]?_0x54b07b[_0x7c33('0x46')]:_0xe1edd['model'];if(!_0x565f60[_0x7c33('0x43')][_0x7c33('0x67')]('nolimit')){_0x54b07b[_0x7c33('0x2e')]=qs[_0x7c33('0x2e')](_0x565f60[_0x7c33('0x43')][_0x7c33('0x2e')]);_0x54b07b['offset']=qs[_0x7c33('0x2d')](_0x565f60[_0x7c33('0x43')][_0x7c33('0x2d')]);}_0x54b07b['order']=qs[_0x7c33('0x68')](_0x565f60[_0x7c33('0x43')][_0x7c33('0x68')]);_0x54b07b['where']=qs[_0x7c33('0x44')](_[_0x7c33('0x4d')](_0x565f60['query'],_0xe1edd[_0x7c33('0x44')]));_0x54b07b['where'][_0x7c33('0x63')]=_0xab1b92['id'];if(_0x565f60[_0x7c33('0x43')][_0x7c33('0x4e')]){_0x54b07b[_0x7c33('0x4c')]=_[_0x7c33('0x4f')](_0x54b07b['where'],{'$or':_[_0x7c33('0x42')](_0x54b07b[_0x7c33('0x46')],function(_0x18ab5c){var _0x1a5407={};_0x1a5407[_0x18ab5c]={'$like':'%'+_0x565f60[_0x7c33('0x43')][_0x7c33('0x4e')]+'%'};return _0x1a5407;})});}_0x54b07b=_[_0x7c33('0x4f')]({},_0x54b07b,_0x565f60[_0x7c33('0x50')]);return db[_0x7c33('0x6b')][_0x7c33('0x2c')]({'where':_0x54b07b[_0x7c33('0x4c')]})[_0x7c33('0x1f')](function(_0x37fce9){_0x1c6e84[_0x7c33('0x2c')]=_0x37fce9;if(_0x565f60[_0x7c33('0x43')][_0x7c33('0x51')]){_0x54b07b['include']=[{'all':!![]}];}return db[_0x7c33('0x6b')][_0x7c33('0x53')](_0x54b07b);})['then'](function(_0x4b7f4c){_0x1c6e84['rows']=_0x4b7f4c;return _0x1c6e84;});}})['then'](respondWithFilteredResult(_0x49c256,_0x54b07b))[_0x7c33('0x28')](handleError(_0x49c256,null));};exports['removeAnswers']=function(_0x49ca6a,_0x1b79bb,_0x5f3622){return db[_0x7c33('0x3d')][_0x7c33('0x5e')]({'where':{'id':_0x49ca6a['params']['id']}})['then'](handleEntityNotFound(_0x1b79bb,null))[_0x7c33('0x1f')](function(_0x5cc846){if(_0x5cc846){return _0x5cc846[_0x7c33('0x6d')](_0x49ca6a['query'][_0x7c33('0x6a')]);}})[_0x7c33('0x1f')](respondWithStatusCode(_0x1b79bb,null))['catch'](handleError(_0x1b79bb,null));};exports[_0x7c33('0x6e')]=function(_0x23bed0,_0x73b952,_0x132cde){return db[_0x7c33('0x6f')][_0x7c33('0x5e')]({'where':{'id':_0x23bed0['params']['id']}})[_0x7c33('0x1f')](handleEntityNotFound(_0x73b952,null))[_0x7c33('0x1f')](function(_0x36cc57){if(_0x36cc57){return _0x36cc57['addInteraction'](_0x23bed0[_0x7c33('0x5a')][_0x7c33('0x6a')],_[_0x7c33('0x70')](_0x23bed0[_0x7c33('0x5a')],[_0x7c33('0x6a'),'id'])||{});}})[_0x7c33('0x1f')](respondWithResult(_0x73b952,null))[_0x7c33('0x28')](handleError(_0x73b952,null));};exports[_0x7c33('0x71')]=function(_0x10629e,_0x4b47d0,_0x6228ef){var _0x3a767b={'raw':![],'where':{}};var _0x1c2051={};var _0x40c57={'count':0x0,'rows':[]};return db[_0x7c33('0x3d')]['findOne']({'where':{'id':_0x10629e['params']['id']}})[_0x7c33('0x1f')](handleEntityNotFound(_0x4b47d0,null))[_0x7c33('0x1f')](function(_0x1d374e){if(_0x1d374e){_0x1c2051[_0x7c33('0x47')]=_['keys'](db[_0x7c33('0x6f')]['rawAttributes']);_0x1c2051[_0x7c33('0x43')]=_[_0x7c33('0x58')](_0x10629e[_0x7c33('0x43')]);_0x1c2051[_0x7c33('0x44')]=_[_0x7c33('0x45')](_0x1c2051[_0x7c33('0x47')],_0x1c2051['query']);_0x3a767b[_0x7c33('0x46')]=_[_0x7c33('0x45')](_0x1c2051[_0x7c33('0x47')],qs[_0x7c33('0x48')](_0x10629e['query']['fields']));_0x3a767b[_0x7c33('0x46')]=_0x3a767b[_0x7c33('0x46')][_0x7c33('0x49')]?_0x3a767b[_0x7c33('0x46')]:_0x1c2051[_0x7c33('0x47')];if(!_0x10629e['query'][_0x7c33('0x67')](_0x7c33('0x4a'))){_0x3a767b[_0x7c33('0x2e')]=qs[_0x7c33('0x2e')](_0x10629e['query'][_0x7c33('0x2e')]);_0x3a767b[_0x7c33('0x2d')]=qs[_0x7c33('0x2d')](_0x10629e[_0x7c33('0x43')][_0x7c33('0x2d')]);}_0x3a767b[_0x7c33('0x4b')]=qs[_0x7c33('0x68')](_0x10629e['query'][_0x7c33('0x68')]);_0x3a767b[_0x7c33('0x4c')]=qs['filters'](_[_0x7c33('0x4d')](_0x10629e[_0x7c33('0x43')],_0x1c2051['filters']));_0x3a767b[_0x7c33('0x4c')][_0x7c33('0x63')]=_0x1d374e['id'];if(_0x10629e[_0x7c33('0x43')]['filter']){_0x3a767b[_0x7c33('0x4c')]=_['merge'](_0x3a767b[_0x7c33('0x4c')],{'$or':_[_0x7c33('0x42')](_0x3a767b[_0x7c33('0x46')],function(_0x699e7c){var _0x3ffede={};_0x3ffede[_0x699e7c]={'$like':'%'+_0x10629e[_0x7c33('0x43')][_0x7c33('0x4e')]+'%'};return _0x3ffede;})});}_0x3a767b=_[_0x7c33('0x4f')]({},_0x3a767b,_0x10629e[_0x7c33('0x50')]);return db[_0x7c33('0x6f')][_0x7c33('0x2c')]({'where':_0x3a767b['where']})[_0x7c33('0x1f')](function(_0x4eac35){_0x40c57[_0x7c33('0x2c')]=_0x4eac35;if(_0x10629e[_0x7c33('0x43')]['includeAll']){_0x3a767b['include']=[{'model':db['CmContact'],'as':_0x7c33('0x72'),'required':![]},{'model':db[_0x7c33('0x73')],'as':_0x7c33('0x74'),'attributes':[_0x7c33('0x3a'),_0x7c33('0x75'),'internal'],'required':![]},{'model':db[_0x7c33('0x76')],'as':_0x7c33('0x77'),'attributes':['id','name','color'],'where':_0x10629e[_0x7c33('0x43')][_0x7c33('0x78')]?{'id':_0x10629e[_0x7c33('0x43')]['tag']}:undefined,'required':_0x10629e[_0x7c33('0x43')][_0x7c33('0x78')]?!![]:![]}];}return db[_0x7c33('0x6f')][_0x7c33('0x53')](_0x3a767b);})[_0x7c33('0x1f')](function(_0x42bfeb){_0x40c57[_0x7c33('0x54')]=_0x42bfeb;return _0x40c57;});}})[_0x7c33('0x1f')](respondWithFilteredResult(_0x4b47d0,_0x3a767b))[_0x7c33('0x28')](handleError(_0x4b47d0,null));};exports[_0x7c33('0x79')]=function(_0x2deca6,_0x3c49d5,_0x5e104a){return db[_0x7c33('0x3d')][_0x7c33('0x65')]({'where':{'id':_0x2deca6[_0x7c33('0x56')]['id']}})[_0x7c33('0x1f')](handleEntityNotFound(_0x3c49d5,null))[_0x7c33('0x1f')](function(_0x37f257){if(_0x37f257){return db[_0x7c33('0x7a')][_0x7c33('0x7b')](function(_0x5c2d16){return db['FaxApplication']['destroy']({'where':{'FaxAccountId':_0x2deca6['params']['id']},'transaction':_0x5c2d16})[_0x7c33('0x1f')](function(_0x17b8d4){var _0x378315=_[_0x7c33('0x42')](_0x2deca6[_0x7c33('0x5a')],function(_0x45f8d4){_0x45f8d4[_0x7c33('0x63')]=_0x2deca6[_0x7c33('0x56')]['id'];return _0x45f8d4;});return db[_0x7c33('0x7c')]['bulkCreate'](_0x378315,{'transaction':_0x5c2d16});});})[_0x7c33('0x1f')](function(){return db[_0x7c33('0x7c')][_0x7c33('0x7d')]({'where':{'FaxAccountId':_0x2deca6['params']['id']},'order':'priority'});});}})[_0x7c33('0x1f')](respondWithResult(_0x3c49d5,null))['catch'](handleError(_0x3c49d5,null));};exports['getApplications']=function(_0x36e705,_0x23f4ef,_0x5505a7){var _0x56ecd6={};var _0x1d959d={};var _0xb7ec63;var _0x3baba7;return db[_0x7c33('0x3d')][_0x7c33('0x65')]({'where':{'id':_0x36e705[_0x7c33('0x56')]['id']}})[_0x7c33('0x1f')](handleEntityNotFound(_0x23f4ef,null))['then'](function(_0x213e26){if(_0x213e26){_0xb7ec63=_0x213e26;_0x1d959d['model']=_[_0x7c33('0x58')](db[_0x7c33('0x7c')][_0x7c33('0x3e')]);_0x1d959d[_0x7c33('0x43')]=_[_0x7c33('0x58')](_0x36e705['query']);_0x1d959d[_0x7c33('0x44')]=_[_0x7c33('0x45')](_0x1d959d[_0x7c33('0x47')],_0x1d959d[_0x7c33('0x43')]);_0x56ecd6[_0x7c33('0x46')]=_[_0x7c33('0x45')](_0x1d959d[_0x7c33('0x47')],qs[_0x7c33('0x48')](_0x36e705[_0x7c33('0x43')][_0x7c33('0x48')]));_0x56ecd6[_0x7c33('0x46')]=_0x56ecd6[_0x7c33('0x46')][_0x7c33('0x49')]?_0x56ecd6['attributes']:_0x1d959d[_0x7c33('0x47')];_0x56ecd6[_0x7c33('0x4b')]=qs['sort'](_0x36e705['query'][_0x7c33('0x68')]);_0x56ecd6['where']=qs[_0x7c33('0x44')](_[_0x7c33('0x4d')](_0x36e705[_0x7c33('0x43')],_0x1d959d[_0x7c33('0x44')]));if(_0x36e705[_0x7c33('0x43')][_0x7c33('0x4e')]){_0x56ecd6['where']=_[_0x7c33('0x4f')](_0x56ecd6['where'],{'$or':_['map'](_0x56ecd6[_0x7c33('0x46')],function(_0xbe8607){var _0x2e3377={};_0x2e3377[_0xbe8607]={'$like':'%'+_0x36e705[_0x7c33('0x43')][_0x7c33('0x4e')]+'%'};return _0x2e3377;})});}_0x56ecd6=_[_0x7c33('0x4f')]({},_0x56ecd6,_0x36e705[_0x7c33('0x50')]);return _0xb7ec63[_0x7c33('0x7e')](_0x56ecd6);}})[_0x7c33('0x1f')](function(_0x415c77){if(_0x415c77){_0x3baba7=_0x415c77[_0x7c33('0x49')];if(!_0x36e705['query'][_0x7c33('0x67')](_0x7c33('0x4a'))){_0x56ecd6[_0x7c33('0x2e')]=qs[_0x7c33('0x2e')](_0x36e705[_0x7c33('0x43')][_0x7c33('0x2e')]);_0x56ecd6['offset']=qs[_0x7c33('0x2d')](_0x36e705[_0x7c33('0x43')]['offset']);}return _0xb7ec63[_0x7c33('0x7e')](_0x56ecd6);}})[_0x7c33('0x1f')](function(_0x38aec4){if(_0x38aec4){return _0x38aec4?{'count':_0x3baba7,'rows':_0x38aec4}:null;}})['then'](respondWithResult(_0x23f4ef,null))[_0x7c33('0x28')](handleError(_0x23f4ef,null));};function Extension(_0x6e780f,_0x57fef5,_0x432f7b,_0x31e98a){this[_0x7c33('0x7f')]=_0x7c33('0x80');this['exten']=_0x6e780f[_0x7c33('0x81')];this[_0x7c33('0x82')]=_0x31e98a;this[_0x7c33('0x40')]=_0x7c33('0x83');this[_0x7c33('0x84')]=_0x7c33('0x85');this[_0x7c33('0x63')]=_0x6e780f['id'];this[_0x7c33('0x86')]=_0x57fef5;this[_0x7c33('0x87')]=_0x432f7b;}function createExtensionsReciveFax(_0x5ae69d){var _0x3eb97b=0x1;var _0x33e05b=[];_0x33e05b['push'](new Extension(_0x5ae69d,_0x3eb97b,'',_0x7c33('0x88')));_0x3eb97b+=0x1;_0x33e05b[_0x7c33('0x89')](new Extension(_0x5ae69d,_0x3eb97b,_0x7c33('0x8a'),_0x7c33('0x8b')));_0x3eb97b+=0x1;for(var _0x477b59 in _0x5ae69d){if(_0x5ae69d['hasOwnProperty'](_0x477b59)&&(_0x477b59===_0x7c33('0x8c')||_0x477b59===_0x7c33('0x81')||_0x477b59===_0x7c33('0x8d')||_0x477b59===_0x7c33('0x8e')||_0x477b59==='headerinfo'||_0x477b59==='maxrate'||_0x477b59==='minrate'||_0x477b59===_0x7c33('0x8f')||_0x477b59===_0x7c33('0x90'))){_0x33e05b[_0x7c33('0x89')](new Extension(_0x5ae69d,_0x3eb97b,'FAXOPT('+_0x477b59+')='+_0x5ae69d[_0x477b59],_0x7c33('0x8b')));_0x3eb97b+=0x1;}}_0x33e05b[_0x7c33('0x89')](new Extension(_0x5ae69d,_0x3eb97b,'6','Wait'));_0x3eb97b+=0x1;_0x33e05b['push'](new Extension(_0x5ae69d,_0x3eb97b,_0x7c33('0x91'),_0x7c33('0x92')));_0x3eb97b=0x0;return _0x33e05b;}exports[_0x7c33('0x93')]=function(_0x2156ce,_0x370516,_0x806192){var _0x32c0c3;return db[_0x7c33('0x7a')][_0x7c33('0x7b')](function(_0x99ec41){return db['FaxAccount'][_0x7c33('0x59')](_0x2156ce['body'],{'transaction':_0x99ec41})[_0x7c33('0x1f')](function(_0x42c6e3){_0x32c0c3=_0x42c6e3[_0x7c33('0x37')]({'plain':!![]});return db[_0x7c33('0x94')]['bulkCreate'](createExtensionsReciveFax(_0x32c0c3),{'transaction':_0x99ec41});});})['then'](function(){return _0x32c0c3;})[_0x7c33('0x1f')](respondWithResult(_0x370516,null))[_0x7c33('0x28')](handleError(_0x370516,null));};exports[_0x7c33('0x95')]=function(_0x2fba71,_0x3d67fb,_0x3f5d01){var _0x39a1b7;return db[_0x7c33('0x7a')][_0x7c33('0x7b')](function(_0x3473a2){return db[_0x7c33('0x3d')]['update'](_0x2fba71[_0x7c33('0x5a')],{'where':{'id':_0x2fba71[_0x7c33('0x5a')]['id']},'transaction':_0x3473a2})[_0x7c33('0x1f')](function(_0x1fb6dd){return db[_0x7c33('0x94')][_0x7c33('0x36')]({'where':{'FaxAccountId':_0x2fba71[_0x7c33('0x5a')]['id']},'transaction':_0x3473a2})['then'](function(_0x3918c7){return db[_0x7c33('0x94')][_0x7c33('0x96')](createExtensionsReciveFax(_['omit'](_0x2fba71[_0x7c33('0x5a')],[_0x7c33('0x97'),_0x7c33('0x41'),'createdAt',_0x7c33('0x98'),_0x7c33('0x99'),'ListId'])),{'transaction':_0x3473a2});});});})[_0x7c33('0x1f')](function(){return db[_0x7c33('0x3d')][_0x7c33('0x9a')](_0x2fba71[_0x7c33('0x5a')]['id']);})['then'](respondWithResult(_0x3d67fb,null))[_0x7c33('0x28')](handleError(_0x3d67fb,null));};exports[_0x7c33('0x9b')]=function(_0x59fe24,_0x5b2dbf,_0x6b0bba){var _0x1cbcd9={'raw':!![],'where':{}};var _0x3d7561={};var _0x2f9693={'count':0x0,'rows':[]};return db['FaxAccount'][_0x7c33('0x65')]({'where':{'id':_0x59fe24[_0x7c33('0x56')]['id']}})['then'](handleEntityNotFound(_0x5b2dbf,null))[_0x7c33('0x1f')](function(_0x72a7c1){if(_0x72a7c1){_0x3d7561[_0x7c33('0x47')]=_['keys'](db[_0x7c33('0x9c')][_0x7c33('0x3e')]);_0x3d7561[_0x7c33('0x43')]=_[_0x7c33('0x58')](_0x59fe24[_0x7c33('0x43')]);_0x3d7561['filters']=_[_0x7c33('0x45')](_0x3d7561[_0x7c33('0x47')],_0x3d7561['query']);_0x1cbcd9[_0x7c33('0x46')]=_[_0x7c33('0x45')](_0x3d7561[_0x7c33('0x47')],qs[_0x7c33('0x48')](_0x59fe24[_0x7c33('0x43')]['fields']));_0x1cbcd9[_0x7c33('0x46')]=_0x1cbcd9[_0x7c33('0x46')]['length']?_0x1cbcd9[_0x7c33('0x46')]:_0x3d7561[_0x7c33('0x47')];if(!_0x59fe24[_0x7c33('0x43')][_0x7c33('0x67')](_0x7c33('0x4a'))){_0x1cbcd9[_0x7c33('0x2e')]=qs[_0x7c33('0x2e')](_0x59fe24[_0x7c33('0x43')]['limit']);_0x1cbcd9[_0x7c33('0x2d')]=qs['offset'](_0x59fe24[_0x7c33('0x43')][_0x7c33('0x2d')]);}_0x1cbcd9[_0x7c33('0x4b')]=qs[_0x7c33('0x68')](_0x59fe24[_0x7c33('0x43')][_0x7c33('0x68')]);_0x1cbcd9[_0x7c33('0x4c')]=qs['filters'](_[_0x7c33('0x4d')](_0x59fe24[_0x7c33('0x43')],_0x3d7561['filters']));_0x1cbcd9['where'][_0x7c33('0x63')]=_0x72a7c1['id'];if(_0x59fe24['query'][_0x7c33('0x4e')]){_0x1cbcd9[_0x7c33('0x4c')]=_[_0x7c33('0x4f')](_0x1cbcd9[_0x7c33('0x4c')],{'$or':_[_0x7c33('0x42')](_0x1cbcd9[_0x7c33('0x46')],function(_0xf36600){var _0x22ff77={};_0x22ff77[_0xf36600]={'$like':'%'+_0x59fe24[_0x7c33('0x43')]['filter']+'%'};return _0x22ff77;})});}if(_0x59fe24[_0x7c33('0x43')]['$gte']){var _0xdd9b44=_0x59fe24[_0x7c33('0x43')]['$gte']['split'](',');var _0xebdf3={};_0xebdf3[_0xdd9b44[0x0]]={'$gte':moment(_0xdd9b44[0x1])[_0x7c33('0x9d')](_0x7c33('0x9e'))};_0x1cbcd9[_0x7c33('0x4c')]=_[_0x7c33('0x4f')](_0x1cbcd9[_0x7c33('0x4c')],_0xebdf3);}_0x1cbcd9=_[_0x7c33('0x4f')]({},_0x1cbcd9,_0x59fe24['options']);return db['FaxMessage'][_0x7c33('0x2c')]({'where':_0x1cbcd9['where']})[_0x7c33('0x1f')](function(_0x4becd4){_0x2f9693[_0x7c33('0x2c')]=_0x4becd4;if(_0x59fe24[_0x7c33('0x43')][_0x7c33('0x51')]){_0x1cbcd9['include']=[{'all':!![]}];}return db[_0x7c33('0x9c')][_0x7c33('0x53')](_0x1cbcd9);})[_0x7c33('0x1f')](function(_0xba1e97){_0x2f9693[_0x7c33('0x54')]=_0xba1e97;return _0x2f9693;});}})[_0x7c33('0x1f')](respondWithFilteredResult(_0x5b2dbf,_0x1cbcd9))['catch'](handleError(_0x5b2dbf,null));};exports[_0x7c33('0x3b')]=function(_0x424e59,_0x2a7aa8,_0xdcd6fc){var _0x29fd53,_0x2b4b6d={},_0x2fccc4;if(_0x424e59['body']['to']){_0x2fccc4=_0x424e59['body']['to'][0x0];}return db[_0x7c33('0x3d')][_0x7c33('0x5e')]({'where':{'id':_0x424e59[_0x7c33('0x56')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x7c33('0x9f')],'as':_0x7c33('0xa0'),'where':{'fax':_0x2fccc4},'limit':0x1,'order':[[_0x7c33('0x98'),_0x7c33('0xa1')]]}]}]})['then'](handleEntityNotFound(_0x2a7aa8,null))[_0x7c33('0x1f')](function(_0x518811){_0x29fd53=_0x518811;if(_0x424e59[_0x7c33('0x5a')]['attachments']&&_0x424e59[_0x7c33('0x5a')]['attachments'][_0x7c33('0x49')]){for(var _0x18544f=0x0;_0x18544f<_0x424e59[_0x7c33('0x5a')][_0x7c33('0xa2')][_0x7c33('0x49')];_0x18544f+=0x1){_0x424e59[_0x7c33('0x5a')][_0x7c33('0xa2')][_0x18544f]={'filename':_0x424e59['body'][_0x7c33('0xa2')][_0x18544f][_0x7c33('0x3a')],'id':_0x424e59[_0x7c33('0x5a')][_0x7c33('0xa2')][_0x18544f]['id'],'path':path[_0x7c33('0xa3')](config[_0x7c33('0xa4')],'server/files/attachments',_0x424e59[_0x7c33('0x5a')][_0x7c33('0xa2')][_0x18544f][_0x7c33('0xa5')])};}}return respondWithRpcPromise(_0x7c33('0xa6'),_0x7c33('0xa6'),{'FaxAccountId':_[_0x7c33('0xa7')](_0x424e59[_0x7c33('0x56')]['id'])?undefined:_0x424e59[_0x7c33('0x56')]['id'],'path':_[_0x7c33('0xa7')](_0x424e59[_0x7c33('0x5a')]['attachments'][0x0][_0x7c33('0x6')])?undefined:_0x424e59['body'][_0x7c33('0xa2')][0x0][_0x7c33('0x6')],'fax':_[_0x7c33('0xa7')](_0x424e59['body']['to'][0x0])?undefined:_0x424e59['body']['to'][0x0]},client9002);})['then'](function(){if(_0x29fd53){if(_[_0x7c33('0xa7')](_0x424e59['body'][_0x7c33('0xa8')])){_0x424e59[_0x7c33('0x5a')][_0x7c33('0xa8')]=util[_0x7c33('0x9d')](_0x7c33('0xa9'),_0x29fd53['name'],_0x29fd53['fax']);}if(_0x29fd53[_0x7c33('0xaa')]){if(_0x29fd53[_0x7c33('0xaa')][_0x7c33('0xa0')]['length']){return _0x29fd53[_0x7c33('0xaa')]['Contacts'][0x0];}else{return db[_0x7c33('0x9f')]['create'](_[_0x7c33('0x15')](_0x424e59[_0x7c33('0x5a')],{'firstName':_0x424e59[_0x7c33('0x5a')]['to'][0x0],'phone':_0x424e59[_0x7c33('0x5a')]['to'][0x0],'fax':_0x424e59['body']['to'][0x0],'ListId':_0x29fd53[_0x7c33('0xab')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0x7c33('0xac'));}})[_0x7c33('0x1f')](function(_0xfae51e){if(_0xfae51e){return db['FaxInteraction'][_0x7c33('0x5e')]({'where':{'ContactId':_0xfae51e['id'],'closed':![],'FaxAccountId':_0x29fd53['id']}})[_0x7c33('0x1f')](function(_0x2054ec){if(_0x2054ec){return[_0x2054ec,![]];}return db[_0x7c33('0x6f')][_0x7c33('0x59')]({'UserId':_0x424e59[_0x7c33('0x5b')]['id'],'ContactId':_0xfae51e['id'],'FaxAccountId':_0x29fd53['id'],'fax':_0x424e59['body']['to'][0x0],'firstMsgDirection':_0x7c33('0xad'),'Messages':[_[_0x7c33('0x4f')](_0x424e59['body'],{'read':![],'body':_0x424e59[_0x7c33('0x5a')][_0x7c33('0xa2')][0x0][_0x7c33('0xae')],'FaxAccountId':_0x29fd53['id'],'UserId':_0x424e59[_0x7c33('0x5b')]['id'],'ContactId':_0xfae51e['id'],'AttachmentId':_0x424e59['body']['attachments'][0x0]['id']})]},{'include':[{'model':db[_0x7c33('0x9c')],'as':'Messages'}]})[_0x7c33('0x1f')](function(_0x522dcc){return[_0x522dcc,!![]];});});}else{throw new Error(_0x7c33('0xaf'));}})[_0x7c33('0xb0')](function(_0x179abe,_0x1bf2f2){if(_0x1bf2f2){return _0x179abe;}return db[_0x7c33('0x9c')][_0x7c33('0x59')]({'direction':_0x7c33('0xad'),'read':![],'body':_0x424e59[_0x7c33('0x5a')][_0x7c33('0xa2')][0x0]['filename'],'FaxAccountId':_0x29fd53['id'],'FaxInteractionId':_0x179abe['id'],'UserId':_0x424e59[_0x7c33('0x5b')]['id'],'ContactId':_0x179abe[_0x7c33('0xb1')],'AttachmentId':_0x424e59['body'][_0x7c33('0xa2')][0x0]['id']})[_0x7c33('0x1f')](function(_0x45b11d){_0x179abe[_0x7c33('0xb2')]['Messages']=[];_0x179abe[_0x7c33('0xb2')][_0x7c33('0xb3')][_0x7c33('0x89')](_0x45b11d[_0x7c33('0xb2')]);return _0x179abe;});})['then'](function(_0x128bdc){respondWithRpcPromise(_0x7c33('0xb4'),_0x7c33('0xb4'),{'FaxAccountId':_[_0x7c33('0xa7')](_0x424e59[_0x7c33('0x56')]['id'])?undefined:_0x424e59[_0x7c33('0x56')]['id'],'path':_[_0x7c33('0xa7')](_0x424e59[_0x7c33('0x5a')][_0x7c33('0xa2')][0x0]['path'])?undefined:_0x424e59[_0x7c33('0x5a')][_0x7c33('0xa2')][0x0][_0x7c33('0x6')],'fax':_[_0x7c33('0xa7')](_0x424e59['body']['to'][0x0])?undefined:_0x424e59[_0x7c33('0x5a')]['to'][0x0],'AttachmentId':_0x424e59[_0x7c33('0x5a')][_0x7c33('0xa2')][0x0]['id']},client9002)[_0x7c33('0x1f')](function(_0x37a234){logger['info'](_0x7c33('0xb5'),_0x37a234);})['catch'](function(_0x3bf2f7){logger[_0x7c33('0x20')](_0x7c33('0xb5'),_0x3bf2f7);});return _0x128bdc;})[_0x7c33('0x1f')](respondWithResult(_0x2a7aa8,null))['catch'](handleError(_0x2a7aa8,null));};exports[_0x7c33('0xb6')]=function(_0x185680,_0x57b7a3,_0x2e47f4){return db[_0x7c33('0x3d')][_0x7c33('0x5e')]({'where':{'id':_0x185680[_0x7c33('0x56')]['id']}})[_0x7c33('0x1f')](handleEntityNotFound(_0x57b7a3,null))[_0x7c33('0x1f')](function(_0x30397e){if(_0x30397e){return _0x30397e[_0x7c33('0xb6')](_0x185680[_0x7c33('0x5a')][_0x7c33('0x6a')],_['omit'](_0x185680[_0x7c33('0x5a')],[_0x7c33('0x6a'),'id'])||{})[_0x7c33('0xb0')](function(_0x3d3dd4){for(var _0x519543=0x0;_0x519543<_0x185680[_0x7c33('0x5a')][_0x7c33('0x6a')][_0x7c33('0x49')];_0x519543+=0x1){socket[_0x7c33('0xb7')]('userFaxAccount:save',{'UserId':_0x185680[_0x7c33('0x5a')][_0x7c33('0x6a')][_0x519543],'FaxAccountId':_0x185680[_0x7c33('0x56')]['id']});}return _0x3d3dd4;});}})['then'](respondWithResult(_0x57b7a3,null))[_0x7c33('0x28')](handleError(_0x57b7a3,null));};exports[_0x7c33('0xb8')]=function(_0x4bce1b,_0x394a50,_0x16b47a){return db[_0x7c33('0x3d')][_0x7c33('0x5e')]({'where':{'id':_0x4bce1b['params']['id']}})[_0x7c33('0x1f')](handleEntityNotFound(_0x394a50,null))[_0x7c33('0x1f')](function(_0x20da1f){if(_0x20da1f){return _0x20da1f[_0x7c33('0xb8')](_0x4bce1b['query'][_0x7c33('0x6a')])[_0x7c33('0x1f')](function(){if(_[_0x7c33('0xb9')](_0x4bce1b[_0x7c33('0x43')][_0x7c33('0x6a')])){for(var _0x19114e=0x0;_0x19114e<_0x4bce1b[_0x7c33('0x43')][_0x7c33('0x6a')][_0x7c33('0x49')];_0x19114e+=0x1){socket['emit'](_0x7c33('0xba'),{'UserId':Number(_0x4bce1b[_0x7c33('0x43')][_0x7c33('0x6a')][_0x19114e]),'FaxAccountId':Number(_0x4bce1b[_0x7c33('0x56')]['id'])});}}else{socket['emit']('userFaxAccount:remove',{'UserId':Number(_0x4bce1b['query'][_0x7c33('0x6a')]),'FaxAccountId':Number(_0x4bce1b[_0x7c33('0x56')]['id'])});}});}})[_0x7c33('0x1f')](respondWithStatusCode(_0x394a50,null))[_0x7c33('0x28')](handleError(_0x394a50,null));};exports['getAgents']=function(_0x3c8698,_0x80bec9,_0x3a5a5a){var _0x234bcf={};var _0x70edcd={};var _0x1823d6;var _0x2228ac;return db[_0x7c33('0x3d')][_0x7c33('0x65')]({'where':{'id':_0x3c8698[_0x7c33('0x56')]['id']}})['then'](handleEntityNotFound(_0x80bec9,null))[_0x7c33('0x1f')](function(_0x5e69a6){if(_0x5e69a6){_0x1823d6=_0x5e69a6;_0x70edcd[_0x7c33('0x47')]=_[_0x7c33('0x58')](db[_0x7c33('0x73')]['rawAttributes']);_0x70edcd[_0x7c33('0x43')]=_[_0x7c33('0x58')](_0x3c8698[_0x7c33('0x43')]);_0x70edcd[_0x7c33('0x44')]=_[_0x7c33('0x45')](_0x70edcd[_0x7c33('0x47')],_0x70edcd['query']);_0x234bcf[_0x7c33('0x46')]=_[_0x7c33('0x45')](_0x70edcd[_0x7c33('0x47')],qs[_0x7c33('0x48')](_0x3c8698[_0x7c33('0x43')][_0x7c33('0x48')]));_0x234bcf['attributes']=_0x234bcf[_0x7c33('0x46')][_0x7c33('0x49')]?_0x234bcf['attributes']:_0x70edcd[_0x7c33('0x47')];_0x234bcf[_0x7c33('0x4b')]=qs[_0x7c33('0x68')](_0x3c8698[_0x7c33('0x43')]['sort']);_0x234bcf[_0x7c33('0x4c')]=qs['filters'](_[_0x7c33('0x4d')](_0x3c8698['query'],_0x70edcd[_0x7c33('0x44')]));if(_0x3c8698['query'][_0x7c33('0x4e')]){_0x234bcf[_0x7c33('0x4c')]=_['merge'](_0x234bcf['where'],{'$or':_[_0x7c33('0x42')](_0x234bcf[_0x7c33('0x46')],function(_0x49f507){var _0x341245={};_0x341245[_0x49f507]={'$like':'%'+_0x3c8698[_0x7c33('0x43')][_0x7c33('0x4e')]+'%'};return _0x341245;})});}_0x234bcf=_[_0x7c33('0x4f')]({},_0x234bcf,_0x3c8698[_0x7c33('0x50')]);return _0x1823d6[_0x7c33('0xbb')](_0x234bcf);}})[_0x7c33('0x1f')](function(_0x19fcb9){if(_0x19fcb9){_0x2228ac=_0x19fcb9[_0x7c33('0x49')];if(!_0x3c8698[_0x7c33('0x43')][_0x7c33('0x67')]('nolimit')){_0x234bcf[_0x7c33('0x2e')]=qs['limit'](_0x3c8698[_0x7c33('0x43')]['limit']);_0x234bcf['offset']=qs[_0x7c33('0x2d')](_0x3c8698[_0x7c33('0x43')]['offset']);}return _0x1823d6['getAgents'](_0x234bcf);}})[_0x7c33('0x1f')](function(_0x1360d0){if(_0x1360d0){return _0x1360d0?{'count':_0x2228ac,'rows':_0x1360d0}:null;}})[_0x7c33('0x1f')](respondWithResult(_0x80bec9,null))[_0x7c33('0x28')](handleError(_0x80bec9,null));}; \ No newline at end of file +var _0xef02=['app','description','priority','appdata','push','Answer','CDR(type)=inbound-fax','ecm','localstationid','gateway','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','FAXOPT(','Set','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','sequelize','update','tech','createdAt','updatedAt','TrunkId','findById','getMessages','$gte','split','format','FaxMessage','List','CmContact','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','Contacts','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','localhost','register','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','sendStatus','end','json','offset','limit','status','Content-Range','apply','save','destroy','FaxAccounts','stack','name','index','Pause','mandatoryDispositionPause','FaxAccount','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','options','count','includeAll','include','rows','catch','params','fields','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','rawAttributes','merge','removeDispositions','addAnswer','CannedAnswer','order','pick','findAll','ids','addInteraction','FaxInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','transaction','FaxApplication','bulkCreate','findAndCountAll','getApplications'];(function(_0x589d9f,_0x58c3a6){var _0x184242=function(_0x4c4c88){while(--_0x4c4c88){_0x589d9f['push'](_0x589d9f['shift']());}};_0x184242(++_0x58c3a6);}(_0xef02,0x1c1));var _0x2ef0=function(_0x1d94d1,_0x347bb8){_0x1d94d1=_0x1d94d1-0x0;var _0x23c397=_0xef02[_0x1d94d1];return _0x23c397;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2ef0('0x0'));var rimraf=require(_0x2ef0('0x1'));var zipdir=require(_0x2ef0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2ef0('0x3'));var BPromise=require(_0x2ef0('0x4'));var Mustache=require('mustache');var util=require(_0x2ef0('0x5'));var path=require(_0x2ef0('0x6'));var sox=require(_0x2ef0('0x7'));var csv=require(_0x2ef0('0x8'));var ejs=require(_0x2ef0('0x9'));var fs=require('fs');var _=require(_0x2ef0('0xa'));var squel=require(_0x2ef0('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2ef0('0xc'));var toCsv=require(_0x2ef0('0x8'));var querystring=require(_0x2ef0('0xd'));var Papa=require('papaparse');var Redis=require(_0x2ef0('0xe'));var authService=require(_0x2ef0('0xf'));var qs=require(_0x2ef0('0x10'));var as=require(_0x2ef0('0x11'));var hardwareService=require(_0x2ef0('0x12'));var logger=require('../../config/logger')(_0x2ef0('0x13'));var utils=require('../../config/utils');var config=require(_0x2ef0('0x14'));var db=require(_0x2ef0('0x15'))['db'];config[_0x2ef0('0x16')]=_[_0x2ef0('0x17')](config[_0x2ef0('0x16')],{'host':_0x2ef0('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2ef0('0x16')]));require('./faxAccount.socket')[_0x2ef0('0x19')](socket);var jayson=require(_0x2ef0('0x1a'));var client=jayson[_0x2ef0('0x1b')][_0x2ef0('0x1c')]({'port':0x232c});var client9002=jayson[_0x2ef0('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x3e81de,_0x53eee1,_0x43c072){if(_0x43c072){var _0x20c6b2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x20c6b2['test'](_0x53eee1)){return _0x3e81de;}else{throw new db[(_0x2ef0('0x1d'))][(_0x2ef0('0x1e'))](_0x2ef0('0x1f'));}}else{return _0x3e81de;}}function respondWithRpcPromise(_0xd2b2b6,_0x5c98b8,_0x44b91f,_0x22e670){return new BPromise(function(_0x54a24b,_0x2aa1c8){var _0x4a980=_0x22e670||client;return _0x4a980[_0x2ef0('0x20')](_0xd2b2b6,_0x44b91f)[_0x2ef0('0x21')](function(_0x4a2a2a){logger[_0x2ef0('0x22')](_0x2ef0('0x23'),_0x5c98b8,_0x2ef0('0x24'));logger[_0x2ef0('0x25')](_0x2ef0('0x26'),_0x5c98b8,_0x2ef0('0x24'),JSON[_0x2ef0('0x27')](_0x4a2a2a));if(_0x4a2a2a[_0x2ef0('0x28')]){if(_0x4a2a2a[_0x2ef0('0x28')]['code']===0x1f4){logger[_0x2ef0('0x28')](_0x2ef0('0x23'),_0x5c98b8,_0x4a2a2a['error']['message']);return _0x2aa1c8(_0x4a2a2a[_0x2ef0('0x28')]['message']);}logger[_0x2ef0('0x28')](_0x2ef0('0x23'),_0x5c98b8,_0x4a2a2a[_0x2ef0('0x28')][_0x2ef0('0x29')]);return _0x54a24b(_0x4a2a2a[_0x2ef0('0x28')][_0x2ef0('0x29')]);}else{logger[_0x2ef0('0x22')]('FaxAccount,\x20%s,\x20%s',_0x5c98b8,'request\x20sent');_0x54a24b(_0x4a2a2a['result'][_0x2ef0('0x29')]);}})['catch'](function(_0x424d57){logger[_0x2ef0('0x28')](_0x2ef0('0x23'),_0x5c98b8,_0x424d57);_0x2aa1c8(_0x424d57);});});}function respondWithStatusCode(_0x1ba017,_0x59ebfb){_0x59ebfb=_0x59ebfb||0xcc;return function(_0x1b2964){if(_0x1b2964){return _0x1ba017[_0x2ef0('0x2a')](_0x59ebfb);}return _0x1ba017['status'](_0x59ebfb)[_0x2ef0('0x2b')]();};}function respondWithResult(_0x468bb5,_0x57d4ea){_0x57d4ea=_0x57d4ea||0xc8;return function(_0x4044f0){if(_0x4044f0){return _0x468bb5['status'](_0x57d4ea)[_0x2ef0('0x2c')](_0x4044f0);}};}function respondWithFilteredResult(_0x2bb7e4,_0xfff047){return function(_0x41699d){if(_0x41699d){var _0x45d142=_0x41699d['count'],_0x52bd61=_0xfff047[_0x2ef0('0x2d')],_0x261066=_0xfff047[_0x2ef0('0x2d')]+_0xfff047[_0x2ef0('0x2e')],_0x5e5d39;if(_0x261066>=_0x45d142){_0x261066=_0x45d142;_0x5e5d39=0xc8;}else{_0x5e5d39=0xce;}_0x2bb7e4[_0x2ef0('0x2f')](_0x5e5d39);return _0x2bb7e4['set'](_0x2ef0('0x30'),_0x52bd61+'-'+_0x261066+'/'+_0x45d142)[_0x2ef0('0x2c')](_0x41699d);}return null;};}function patchUpdates(_0x1fc20e){return function(_0x4c8366){try{jsonpatch[_0x2ef0('0x31')](_0x4c8366,_0x1fc20e,!![]);}catch(_0x1ab2a0){return BPromise['reject'](_0x1ab2a0);}return _0x4c8366[_0x2ef0('0x32')]();};}function saveUpdates(_0x15ceeb,_0x2560c8){return function(_0x50757b){if(_0x50757b){return _0x50757b['update'](_0x15ceeb)[_0x2ef0('0x21')](function(_0x6b0cba){return _0x6b0cba;});}return null;};}function removeEntity(_0x1fe901,_0x11067a){return function(_0x81de5f){if(_0x81de5f){return _0x81de5f[_0x2ef0('0x33')]()[_0x2ef0('0x21')](function(){var _0x528ade=_0x81de5f['get']({'plain':!![]});var _0x39d87c=_0x2ef0('0x34');return db['UserProfileResource']['destroy']({'where':{'type':_0x39d87c,'resourceId':_0x528ade['id']}})[_0x2ef0('0x21')](function(){return _0x81de5f;});})[_0x2ef0('0x21')](function(){_0x1fe901[_0x2ef0('0x2f')](0xcc)[_0x2ef0('0x2b')]();});}};}function handleEntityNotFound(_0x3c2b17,_0x4fb006){return function(_0x4d874a){if(!_0x4d874a){_0x3c2b17[_0x2ef0('0x2a')](0x194);}return _0x4d874a;};}function handleError(_0x4fe639,_0xae20a6){_0xae20a6=_0xae20a6||0x1f4;return function(_0x5b117c){logger[_0x2ef0('0x28')](_0x5b117c[_0x2ef0('0x35')]);if(_0x5b117c[_0x2ef0('0x36')]){delete _0x5b117c[_0x2ef0('0x36')];}_0x4fe639[_0x2ef0('0x2f')](_0xae20a6)['send'](_0x5b117c);};}exports[_0x2ef0('0x37')]=function(_0x49a9d2,_0x47435f){var _0x428ff9={'include':[{'model':db[_0x2ef0('0x38')],'as':_0x2ef0('0x39')}]},_0x46e1ee={},_0x359997={'count':0x0,'rows':[]};var _0x2d7bbf=_['map'](db[_0x2ef0('0x3a')]['rawAttributes'],function(_0x1a5f20){return{'name':_0x1a5f20[_0x2ef0('0x3b')],'type':_0x1a5f20[_0x2ef0('0x3c')][_0x2ef0('0x3d')]};});_0x46e1ee[_0x2ef0('0x3e')]=_[_0x2ef0('0x3f')](_0x2d7bbf,_0x2ef0('0x36'));_0x46e1ee[_0x2ef0('0x40')]=_[_0x2ef0('0x41')](_0x49a9d2['query']);_0x46e1ee[_0x2ef0('0x42')]=_[_0x2ef0('0x43')](_0x46e1ee['model'],_0x46e1ee[_0x2ef0('0x40')]);_0x428ff9[_0x2ef0('0x44')]=_[_0x2ef0('0x43')](_0x46e1ee[_0x2ef0('0x3e')],qs['fields'](_0x49a9d2[_0x2ef0('0x40')]['fields']));_0x428ff9[_0x2ef0('0x44')]=_0x428ff9['attributes'][_0x2ef0('0x45')]?_0x428ff9['attributes']:_0x46e1ee[_0x2ef0('0x3e')];if(!_0x49a9d2[_0x2ef0('0x40')][_0x2ef0('0x46')](_0x2ef0('0x47'))){_0x428ff9['limit']=qs[_0x2ef0('0x2e')](_0x49a9d2['query'][_0x2ef0('0x2e')]);_0x428ff9[_0x2ef0('0x2d')]=qs['offset'](_0x49a9d2[_0x2ef0('0x40')][_0x2ef0('0x2d')]);}_0x428ff9['order']=qs[_0x2ef0('0x48')](_0x49a9d2[_0x2ef0('0x40')][_0x2ef0('0x48')]);_0x428ff9[_0x2ef0('0x49')]=qs[_0x2ef0('0x42')](_['pick'](_0x49a9d2['query'],_0x46e1ee[_0x2ef0('0x42')]));if(_0x49a9d2[_0x2ef0('0x40')][_0x2ef0('0x4a')]){_0x428ff9[_0x2ef0('0x49')]=_['merge'](_0x428ff9[_0x2ef0('0x49')],{'$or':_['map'](_0x2d7bbf,function(_0x2a8699){if(_0x2a8699[_0x2ef0('0x3c')]!==_0x2ef0('0x4b')){var _0x51b23f={};_0x51b23f[_0x2a8699[_0x2ef0('0x36')]]={'$like':'%'+_0x49a9d2[_0x2ef0('0x40')]['filter']+'%'};return _0x51b23f;}})});}_0x428ff9=_['merge']({},_0x428ff9,_0x49a9d2[_0x2ef0('0x4c')]);var _0x51fafa={'where':_0x428ff9[_0x2ef0('0x49')]};return db[_0x2ef0('0x3a')]['count'](_0x51fafa)[_0x2ef0('0x21')](function(_0x3c8a38){_0x359997[_0x2ef0('0x4d')]=_0x3c8a38;if(_0x49a9d2[_0x2ef0('0x40')][_0x2ef0('0x4e')]){_0x428ff9[_0x2ef0('0x4f')]=[{'all':!![]}];}return db[_0x2ef0('0x3a')]['findAll'](_0x428ff9);})[_0x2ef0('0x21')](function(_0x21504a){_0x359997[_0x2ef0('0x50')]=_0x21504a;return _0x359997;})['then'](respondWithFilteredResult(_0x47435f,_0x428ff9))[_0x2ef0('0x51')](handleError(_0x47435f,null));};exports['show']=function(_0x50dea8,_0x1c8f62){var _0x15a876={'raw':![],'where':{'id':_0x50dea8[_0x2ef0('0x52')]['id']},'include':[{'model':db[_0x2ef0('0x38')],'as':_0x2ef0('0x39')}]},_0x3bb345={};_0x3bb345['model']=_[_0x2ef0('0x41')](db[_0x2ef0('0x3a')]['rawAttributes']);_0x3bb345[_0x2ef0('0x40')]=_['keys'](_0x50dea8[_0x2ef0('0x40')]);_0x3bb345[_0x2ef0('0x42')]=_[_0x2ef0('0x43')](_0x3bb345['model'],_0x3bb345[_0x2ef0('0x40')]);_0x15a876[_0x2ef0('0x44')]=_[_0x2ef0('0x43')](_0x3bb345[_0x2ef0('0x3e')],qs[_0x2ef0('0x53')](_0x50dea8[_0x2ef0('0x40')][_0x2ef0('0x53')]));_0x15a876[_0x2ef0('0x44')]=_0x15a876['attributes'][_0x2ef0('0x45')]?_0x15a876['attributes']:_0x3bb345[_0x2ef0('0x3e')];if(_0x50dea8[_0x2ef0('0x40')][_0x2ef0('0x4e')]){_0x15a876[_0x2ef0('0x4f')]=[{'all':!![]}];}_0x15a876=_['merge']({},_0x15a876,_0x50dea8[_0x2ef0('0x4c')]);return db[_0x2ef0('0x3a')][_0x2ef0('0x54')](_0x15a876)[_0x2ef0('0x21')](handleEntityNotFound(_0x1c8f62,null))[_0x2ef0('0x21')](respondWithResult(_0x1c8f62,null))[_0x2ef0('0x51')](handleError(_0x1c8f62,null));};exports[_0x2ef0('0x55')]=function(_0x1d1f55,_0x130b62){return db['FaxAccount']['create'](_0x1d1f55['body'],{})[_0x2ef0('0x21')](function(_0x1be294){var _0x40f60f=_0x1d1f55[_0x2ef0('0x56')][_0x2ef0('0x57')]({'plain':!![]});if(!_0x40f60f)throw new Error(_0x2ef0('0x58'));if(_0x40f60f['role']===_0x2ef0('0x56')){var _0x141edd=_0x1be294[_0x2ef0('0x57')]({'plain':!![]});var _0x39c010=_0x2ef0('0x34');return db[_0x2ef0('0x59')][_0x2ef0('0x54')]({'where':{'name':_0x39c010,'userProfileId':_0x40f60f['userProfileId']},'raw':!![]})[_0x2ef0('0x21')](function(_0x3a26ba){if(_0x3a26ba&&_0x3a26ba[_0x2ef0('0x5a')]===0x0){return db[_0x2ef0('0x5b')]['create']({'name':_0x141edd[_0x2ef0('0x36')],'resourceId':_0x141edd['id'],'type':_0x3a26ba[_0x2ef0('0x36')],'sectionId':_0x3a26ba['id']},{})[_0x2ef0('0x21')](function(){return _0x1be294;});}else{return _0x1be294;}})[_0x2ef0('0x51')](function(_0x516eb3){logger[_0x2ef0('0x28')](_0x2ef0('0x5c'),_0x516eb3);throw _0x516eb3;});}return _0x1be294;})['then'](respondWithResult(_0x130b62,0xc9))[_0x2ef0('0x51')](handleError(_0x130b62,null));};exports['update']=function(_0x58225e,_0x29414c){if(_0x58225e['body']['id']){delete _0x58225e[_0x2ef0('0x5d')]['id'];}return db[_0x2ef0('0x3a')][_0x2ef0('0x54')]({'where':{'id':_0x58225e[_0x2ef0('0x52')]['id']},'include':[{'model':db[_0x2ef0('0x38')],'as':_0x2ef0('0x39')}]})[_0x2ef0('0x21')](handleEntityNotFound(_0x29414c,null))['then'](saveUpdates(_0x58225e[_0x2ef0('0x5d')],null))[_0x2ef0('0x21')](respondWithResult(_0x29414c,null))[_0x2ef0('0x51')](handleError(_0x29414c,null));};exports['destroy']=function(_0x547931,_0xce92d1){return db[_0x2ef0('0x3a')]['find']({'where':{'id':_0x547931['params']['id']}})[_0x2ef0('0x21')](handleEntityNotFound(_0xce92d1,null))[_0x2ef0('0x21')](removeEntity(_0xce92d1,null))[_0x2ef0('0x51')](handleError(_0xce92d1,null));};exports[_0x2ef0('0x5e')]=function(_0x3bb796,_0x1cd5f0){return db[_0x2ef0('0x3a')][_0x2ef0('0x5e')]()[_0x2ef0('0x21')](respondWithResult(_0x1cd5f0,null))[_0x2ef0('0x51')](handleError(_0x1cd5f0,null));};exports[_0x2ef0('0x5f')]=function(_0x24313d,_0x1fe5d4,_0x3bc22f){if(_0x24313d[_0x2ef0('0x5d')]['id']){delete _0x24313d[_0x2ef0('0x5d')]['id'];}return db[_0x2ef0('0x3a')][_0x2ef0('0x54')]({'where':{'id':_0x24313d[_0x2ef0('0x52')]['id']}})[_0x2ef0('0x21')](handleEntityNotFound(_0x1fe5d4,null))[_0x2ef0('0x21')](function(_0x448179){if(_0x448179){_0x24313d[_0x2ef0('0x5d')][_0x2ef0('0x60')]=_0x448179['id'];return db[_0x2ef0('0x61')][_0x2ef0('0x55')](_0x24313d[_0x2ef0('0x5d')]);}})['then'](respondWithResult(_0x1fe5d4,null))[_0x2ef0('0x51')](handleError(_0x1fe5d4,null));};exports[_0x2ef0('0x62')]=function(_0x19562b,_0x489f80,_0x3996e2){var _0xc07eaa={'raw':![],'where':{}};var _0x511a86={};var _0x2c7df2={'count':0x0,'rows':[]};return db[_0x2ef0('0x3a')][_0x2ef0('0x63')]({'where':{'id':_0x19562b[_0x2ef0('0x52')]['id']}})[_0x2ef0('0x21')](handleEntityNotFound(_0x489f80,null))[_0x2ef0('0x21')](function(_0x3cb18b){if(_0x3cb18b){_0x511a86['model']=_[_0x2ef0('0x41')](db[_0x2ef0('0x61')][_0x2ef0('0x64')]);_0x511a86[_0x2ef0('0x40')]=_['keys'](_0x19562b[_0x2ef0('0x40')]);_0x511a86[_0x2ef0('0x42')]=_[_0x2ef0('0x43')](_0x511a86[_0x2ef0('0x3e')],_0x511a86['query']);_0xc07eaa[_0x2ef0('0x44')]=_[_0x2ef0('0x43')](_0x511a86[_0x2ef0('0x3e')],qs[_0x2ef0('0x53')](_0x19562b[_0x2ef0('0x40')]['fields']));_0xc07eaa[_0x2ef0('0x44')]=_0xc07eaa[_0x2ef0('0x44')][_0x2ef0('0x45')]?_0xc07eaa['attributes']:_0x511a86[_0x2ef0('0x3e')];if(!_0x19562b[_0x2ef0('0x40')][_0x2ef0('0x46')](_0x2ef0('0x47'))){_0xc07eaa[_0x2ef0('0x2e')]=qs[_0x2ef0('0x2e')](_0x19562b['query'][_0x2ef0('0x2e')]);_0xc07eaa[_0x2ef0('0x2d')]=qs[_0x2ef0('0x2d')](_0x19562b['query'][_0x2ef0('0x2d')]);}_0xc07eaa['order']=qs[_0x2ef0('0x48')](_0x19562b[_0x2ef0('0x40')][_0x2ef0('0x48')]);_0xc07eaa[_0x2ef0('0x49')]=qs[_0x2ef0('0x42')](_['pick'](_0x19562b[_0x2ef0('0x40')],_0x511a86[_0x2ef0('0x42')]));_0xc07eaa[_0x2ef0('0x49')][_0x2ef0('0x60')]=_0x3cb18b['id'];if(_0x19562b[_0x2ef0('0x40')][_0x2ef0('0x4a')]){_0xc07eaa[_0x2ef0('0x49')]=_[_0x2ef0('0x65')](_0xc07eaa[_0x2ef0('0x49')],{'$or':_[_0x2ef0('0x3f')](_0xc07eaa[_0x2ef0('0x44')],function(_0x3c7631){var _0x2ae4b7={};_0x2ae4b7[_0x3c7631]={'$like':'%'+_0x19562b[_0x2ef0('0x40')][_0x2ef0('0x4a')]+'%'};return _0x2ae4b7;})});}_0xc07eaa=_[_0x2ef0('0x65')]({},_0xc07eaa,_0x19562b[_0x2ef0('0x4c')]);return db[_0x2ef0('0x61')][_0x2ef0('0x4d')]({'where':_0xc07eaa[_0x2ef0('0x49')]})[_0x2ef0('0x21')](function(_0x1181b0){_0x2c7df2[_0x2ef0('0x4d')]=_0x1181b0;if(_0x19562b[_0x2ef0('0x40')]['includeAll']){_0xc07eaa['include']=[{'all':!![]}];}return db[_0x2ef0('0x61')]['findAll'](_0xc07eaa);})['then'](function(_0x4d048b){_0x2c7df2[_0x2ef0('0x50')]=_0x4d048b;return _0x2c7df2;});}})[_0x2ef0('0x21')](respondWithFilteredResult(_0x489f80,_0xc07eaa))['catch'](handleError(_0x489f80,null));};exports[_0x2ef0('0x66')]=function(_0x261f0f,_0x1c3e28,_0x406fdc){return db[_0x2ef0('0x3a')][_0x2ef0('0x54')]({'where':{'id':_0x261f0f[_0x2ef0('0x52')]['id']}})[_0x2ef0('0x21')](handleEntityNotFound(_0x1c3e28,null))[_0x2ef0('0x21')](function(_0x51022e){if(_0x51022e){return _0x51022e[_0x2ef0('0x66')](_0x261f0f[_0x2ef0('0x40')]['ids']);}})[_0x2ef0('0x21')](respondWithStatusCode(_0x1c3e28,null))[_0x2ef0('0x51')](handleError(_0x1c3e28,null));};exports[_0x2ef0('0x67')]=function(_0x35af53,_0x5fdf0d,_0xb46644){if(_0x35af53[_0x2ef0('0x5d')]['id']){delete _0x35af53['body']['id'];}return db['FaxAccount']['find']({'where':{'id':_0x35af53['params']['id']}})[_0x2ef0('0x21')](handleEntityNotFound(_0x5fdf0d,null))[_0x2ef0('0x21')](function(_0x2623cc){if(_0x2623cc){_0x35af53[_0x2ef0('0x5d')]['FaxAccountId']=_0x2623cc['id'];return db[_0x2ef0('0x68')][_0x2ef0('0x55')](_0x35af53[_0x2ef0('0x5d')]);}})['then'](respondWithResult(_0x5fdf0d,null))[_0x2ef0('0x51')](handleError(_0x5fdf0d,null));};exports['getAnswers']=function(_0x35e703,_0x52387b,_0x52cc6b){var _0x135117={'raw':![],'where':{}};var _0x6be85f={};var _0x1ac66a={'count':0x0,'rows':[]};return db[_0x2ef0('0x3a')][_0x2ef0('0x63')]({'where':{'id':_0x35e703[_0x2ef0('0x52')]['id']}})['then'](handleEntityNotFound(_0x52387b,null))[_0x2ef0('0x21')](function(_0x4f44d4){if(_0x4f44d4){_0x6be85f[_0x2ef0('0x3e')]=_['keys'](db['CannedAnswer']['rawAttributes']);_0x6be85f['query']=_['keys'](_0x35e703[_0x2ef0('0x40')]);_0x6be85f['filters']=_[_0x2ef0('0x43')](_0x6be85f[_0x2ef0('0x3e')],_0x6be85f[_0x2ef0('0x40')]);_0x135117['attributes']=_[_0x2ef0('0x43')](_0x6be85f[_0x2ef0('0x3e')],qs[_0x2ef0('0x53')](_0x35e703[_0x2ef0('0x40')][_0x2ef0('0x53')]));_0x135117['attributes']=_0x135117[_0x2ef0('0x44')]['length']?_0x135117[_0x2ef0('0x44')]:_0x6be85f[_0x2ef0('0x3e')];if(!_0x35e703[_0x2ef0('0x40')][_0x2ef0('0x46')](_0x2ef0('0x47'))){_0x135117[_0x2ef0('0x2e')]=qs[_0x2ef0('0x2e')](_0x35e703[_0x2ef0('0x40')][_0x2ef0('0x2e')]);_0x135117['offset']=qs[_0x2ef0('0x2d')](_0x35e703[_0x2ef0('0x40')][_0x2ef0('0x2d')]);}_0x135117[_0x2ef0('0x69')]=qs['sort'](_0x35e703[_0x2ef0('0x40')][_0x2ef0('0x48')]);_0x135117[_0x2ef0('0x49')]=qs[_0x2ef0('0x42')](_[_0x2ef0('0x6a')](_0x35e703['query'],_0x6be85f[_0x2ef0('0x42')]));_0x135117[_0x2ef0('0x49')][_0x2ef0('0x60')]=_0x4f44d4['id'];if(_0x35e703[_0x2ef0('0x40')]['filter']){_0x135117['where']=_['merge'](_0x135117[_0x2ef0('0x49')],{'$or':_[_0x2ef0('0x3f')](_0x135117[_0x2ef0('0x44')],function(_0x17b149){var _0x4ed877={};_0x4ed877[_0x17b149]={'$like':'%'+_0x35e703['query'][_0x2ef0('0x4a')]+'%'};return _0x4ed877;})});}_0x135117=_['merge']({},_0x135117,_0x35e703['options']);return db[_0x2ef0('0x68')]['count']({'where':_0x135117['where']})[_0x2ef0('0x21')](function(_0x388de8){_0x1ac66a[_0x2ef0('0x4d')]=_0x388de8;if(_0x35e703[_0x2ef0('0x40')][_0x2ef0('0x4e')]){_0x135117[_0x2ef0('0x4f')]=[{'all':!![]}];}return db['CannedAnswer'][_0x2ef0('0x6b')](_0x135117);})[_0x2ef0('0x21')](function(_0x134a7e){_0x1ac66a[_0x2ef0('0x50')]=_0x134a7e;return _0x1ac66a;});}})[_0x2ef0('0x21')](respondWithFilteredResult(_0x52387b,_0x135117))[_0x2ef0('0x51')](handleError(_0x52387b,null));};exports['removeAnswers']=function(_0x3fb815,_0x40e79e,_0x537b85){return db[_0x2ef0('0x3a')][_0x2ef0('0x54')]({'where':{'id':_0x3fb815[_0x2ef0('0x52')]['id']}})[_0x2ef0('0x21')](handleEntityNotFound(_0x40e79e,null))[_0x2ef0('0x21')](function(_0x3229a4){if(_0x3229a4){return _0x3229a4['removeAnswers'](_0x3fb815['query'][_0x2ef0('0x6c')]);}})['then'](respondWithStatusCode(_0x40e79e,null))[_0x2ef0('0x51')](handleError(_0x40e79e,null));};exports[_0x2ef0('0x6d')]=function(_0x3cd30c,_0x25fb94,_0x144794){return db[_0x2ef0('0x6e')][_0x2ef0('0x54')]({'where':{'id':_0x3cd30c[_0x2ef0('0x52')]['id']}})[_0x2ef0('0x21')](handleEntityNotFound(_0x25fb94,null))[_0x2ef0('0x21')](function(_0x13bc5b){if(_0x13bc5b){return _0x13bc5b['addInteraction'](_0x3cd30c['body'][_0x2ef0('0x6c')],_[_0x2ef0('0x6f')](_0x3cd30c[_0x2ef0('0x5d')],[_0x2ef0('0x6c'),'id'])||{});}})[_0x2ef0('0x21')](respondWithResult(_0x25fb94,null))[_0x2ef0('0x51')](handleError(_0x25fb94,null));};exports[_0x2ef0('0x70')]=function(_0x26402e,_0x3d5202,_0x30b4c3){var _0x23b688={'raw':![],'where':{}};var _0x381536={};var _0x23440d={'count':0x0,'rows':[]};return db[_0x2ef0('0x3a')][_0x2ef0('0x63')]({'where':{'id':_0x26402e[_0x2ef0('0x52')]['id']}})[_0x2ef0('0x21')](handleEntityNotFound(_0x3d5202,null))['then'](function(_0x8ab5d5){if(_0x8ab5d5){_0x381536[_0x2ef0('0x3e')]=_['keys'](db[_0x2ef0('0x6e')][_0x2ef0('0x64')]);_0x381536[_0x2ef0('0x40')]=_['keys'](_0x26402e[_0x2ef0('0x40')]);_0x381536[_0x2ef0('0x42')]=_[_0x2ef0('0x43')](_0x381536[_0x2ef0('0x3e')],_0x381536[_0x2ef0('0x40')]);_0x23b688[_0x2ef0('0x44')]=_[_0x2ef0('0x43')](_0x381536[_0x2ef0('0x3e')],qs[_0x2ef0('0x53')](_0x26402e['query'][_0x2ef0('0x53')]));_0x23b688[_0x2ef0('0x44')]=_0x23b688[_0x2ef0('0x44')][_0x2ef0('0x45')]?_0x23b688[_0x2ef0('0x44')]:_0x381536[_0x2ef0('0x3e')];if(!_0x26402e[_0x2ef0('0x40')][_0x2ef0('0x46')](_0x2ef0('0x47'))){_0x23b688[_0x2ef0('0x2e')]=qs[_0x2ef0('0x2e')](_0x26402e[_0x2ef0('0x40')][_0x2ef0('0x2e')]);_0x23b688[_0x2ef0('0x2d')]=qs[_0x2ef0('0x2d')](_0x26402e[_0x2ef0('0x40')][_0x2ef0('0x2d')]);}_0x23b688[_0x2ef0('0x69')]=qs[_0x2ef0('0x48')](_0x26402e[_0x2ef0('0x40')][_0x2ef0('0x48')]);_0x23b688[_0x2ef0('0x49')]=qs[_0x2ef0('0x42')](_[_0x2ef0('0x6a')](_0x26402e[_0x2ef0('0x40')],_0x381536[_0x2ef0('0x42')]));_0x23b688[_0x2ef0('0x49')][_0x2ef0('0x60')]=_0x8ab5d5['id'];if(_0x26402e[_0x2ef0('0x40')][_0x2ef0('0x4a')]){_0x23b688[_0x2ef0('0x49')]=_['merge'](_0x23b688[_0x2ef0('0x49')],{'$or':_[_0x2ef0('0x3f')](_0x23b688['attributes'],function(_0x3e960d){var _0x4ddf86={};_0x4ddf86[_0x3e960d]={'$like':'%'+_0x26402e['query'][_0x2ef0('0x4a')]+'%'};return _0x4ddf86;})});}_0x23b688=_['merge']({},_0x23b688,_0x26402e['options']);return db[_0x2ef0('0x6e')][_0x2ef0('0x4d')]({'where':_0x23b688[_0x2ef0('0x49')]})[_0x2ef0('0x21')](function(_0x1b581a){_0x23440d[_0x2ef0('0x4d')]=_0x1b581a;if(_0x26402e['query']['includeAll']){_0x23b688['include']=[{'model':db['CmContact'],'as':_0x2ef0('0x71'),'required':![]},{'model':db['User'],'as':_0x2ef0('0x72'),'attributes':[_0x2ef0('0x36'),_0x2ef0('0x73'),_0x2ef0('0x74')],'required':![]},{'model':db[_0x2ef0('0x75')],'as':_0x2ef0('0x76'),'attributes':['id','name',_0x2ef0('0x77')],'where':_0x26402e[_0x2ef0('0x40')]['tag']?{'id':_0x26402e[_0x2ef0('0x40')][_0x2ef0('0x78')]}:undefined,'required':_0x26402e[_0x2ef0('0x40')]['tag']?!![]:![]}];}return db[_0x2ef0('0x6e')]['findAll'](_0x23b688);})[_0x2ef0('0x21')](function(_0xb7003b){_0x23440d[_0x2ef0('0x50')]=_0xb7003b;return _0x23440d;});}})['then'](respondWithFilteredResult(_0x3d5202,_0x23b688))[_0x2ef0('0x51')](handleError(_0x3d5202,null));};exports[_0x2ef0('0x79')]=function(_0xdf1be8,_0x122673,_0x1e6963){return db[_0x2ef0('0x3a')][_0x2ef0('0x63')]({'where':{'id':_0xdf1be8[_0x2ef0('0x52')]['id']}})[_0x2ef0('0x21')](handleEntityNotFound(_0x122673,null))[_0x2ef0('0x21')](function(_0x276e5e){if(_0x276e5e){return db['sequelize'][_0x2ef0('0x7a')](function(_0x4ff09f){return db['FaxApplication'][_0x2ef0('0x33')]({'where':{'FaxAccountId':_0xdf1be8[_0x2ef0('0x52')]['id']},'transaction':_0x4ff09f})[_0x2ef0('0x21')](function(_0x4fdf1e){var _0x99f361=_[_0x2ef0('0x3f')](_0xdf1be8[_0x2ef0('0x5d')],function(_0x216dc8){_0x216dc8[_0x2ef0('0x60')]=_0xdf1be8[_0x2ef0('0x52')]['id'];return _0x216dc8;});return db[_0x2ef0('0x7b')][_0x2ef0('0x7c')](_0x99f361,{'transaction':_0x4ff09f});});})[_0x2ef0('0x21')](function(){return db['FaxApplication'][_0x2ef0('0x7d')]({'where':{'FaxAccountId':_0xdf1be8[_0x2ef0('0x52')]['id']},'order':'priority'});});}})[_0x2ef0('0x21')](respondWithResult(_0x122673,null))[_0x2ef0('0x51')](handleError(_0x122673,null));};exports[_0x2ef0('0x7e')]=function(_0x379c36,_0x52ae6e,_0x5d972f){var _0x59173b={};var _0x4603bc={};var _0x177fa0;var _0x1f67a1;return db['FaxAccount'][_0x2ef0('0x63')]({'where':{'id':_0x379c36[_0x2ef0('0x52')]['id']}})[_0x2ef0('0x21')](handleEntityNotFound(_0x52ae6e,null))[_0x2ef0('0x21')](function(_0x3047b0){if(_0x3047b0){_0x177fa0=_0x3047b0;_0x4603bc[_0x2ef0('0x3e')]=_['keys'](db[_0x2ef0('0x7b')]['rawAttributes']);_0x4603bc[_0x2ef0('0x40')]=_[_0x2ef0('0x41')](_0x379c36[_0x2ef0('0x40')]);_0x4603bc['filters']=_[_0x2ef0('0x43')](_0x4603bc[_0x2ef0('0x3e')],_0x4603bc[_0x2ef0('0x40')]);_0x59173b['attributes']=_[_0x2ef0('0x43')](_0x4603bc[_0x2ef0('0x3e')],qs[_0x2ef0('0x53')](_0x379c36[_0x2ef0('0x40')]['fields']));_0x59173b[_0x2ef0('0x44')]=_0x59173b[_0x2ef0('0x44')]['length']?_0x59173b[_0x2ef0('0x44')]:_0x4603bc[_0x2ef0('0x3e')];_0x59173b[_0x2ef0('0x69')]=qs[_0x2ef0('0x48')](_0x379c36['query'][_0x2ef0('0x48')]);_0x59173b[_0x2ef0('0x49')]=qs['filters'](_[_0x2ef0('0x6a')](_0x379c36[_0x2ef0('0x40')],_0x4603bc['filters']));if(_0x379c36[_0x2ef0('0x40')][_0x2ef0('0x4a')]){_0x59173b['where']=_[_0x2ef0('0x65')](_0x59173b[_0x2ef0('0x49')],{'$or':_[_0x2ef0('0x3f')](_0x59173b[_0x2ef0('0x44')],function(_0x84bf07){var _0x982d39={};_0x982d39[_0x84bf07]={'$like':'%'+_0x379c36['query'][_0x2ef0('0x4a')]+'%'};return _0x982d39;})});}_0x59173b=_['merge']({},_0x59173b,_0x379c36[_0x2ef0('0x4c')]);return _0x177fa0[_0x2ef0('0x7e')](_0x59173b);}})['then'](function(_0x2bd79a){if(_0x2bd79a){_0x1f67a1=_0x2bd79a[_0x2ef0('0x45')];if(!_0x379c36['query']['hasOwnProperty'](_0x2ef0('0x47'))){_0x59173b[_0x2ef0('0x2e')]=qs[_0x2ef0('0x2e')](_0x379c36[_0x2ef0('0x40')][_0x2ef0('0x2e')]);_0x59173b[_0x2ef0('0x2d')]=qs[_0x2ef0('0x2d')](_0x379c36[_0x2ef0('0x40')][_0x2ef0('0x2d')]);}return _0x177fa0[_0x2ef0('0x7e')](_0x59173b);}})[_0x2ef0('0x21')](function(_0x46c325){if(_0x46c325){return _0x46c325?{'count':_0x1f67a1,'rows':_0x46c325}:null;}})['then'](respondWithResult(_0x52ae6e,null))[_0x2ef0('0x51')](handleError(_0x52ae6e,null));};function Extension(_0x4c63dd,_0x2fde3c,_0x37b1ea,_0x8cef17){this['context']='from-voip-provider';this['exten']=_0x4c63dd['localstationid'];this[_0x2ef0('0x7f')]=_0x8cef17;this[_0x2ef0('0x3c')]='system';this[_0x2ef0('0x80')]='Fax\x20Extension';this[_0x2ef0('0x60')]=_0x4c63dd['id'];this[_0x2ef0('0x81')]=_0x2fde3c;this[_0x2ef0('0x82')]=_0x37b1ea;}function createExtensionsReciveFax(_0x1094c9){var _0x4d7820=0x1;var _0xf7c2fe=[];_0xf7c2fe[_0x2ef0('0x83')](new Extension(_0x1094c9,_0x4d7820,'',_0x2ef0('0x84')));_0x4d7820+=0x1;_0xf7c2fe['push'](new Extension(_0x1094c9,_0x4d7820,_0x2ef0('0x85'),'Set'));_0x4d7820+=0x1;for(var _0x4d4f8f in _0x1094c9){if(_0x1094c9[_0x2ef0('0x46')](_0x4d4f8f)&&(_0x4d4f8f===_0x2ef0('0x86')||_0x4d4f8f===_0x2ef0('0x87')||_0x4d4f8f===_0x2ef0('0x88')||_0x4d4f8f===_0x2ef0('0x89')||_0x4d4f8f===_0x2ef0('0x8a')||_0x4d4f8f===_0x2ef0('0x8b')||_0x4d4f8f===_0x2ef0('0x8c')||_0x4d4f8f===_0x2ef0('0x8d')||_0x4d4f8f===_0x2ef0('0x8e'))){_0xf7c2fe[_0x2ef0('0x83')](new Extension(_0x1094c9,_0x4d7820,_0x2ef0('0x8f')+_0x4d4f8f+')='+_0x1094c9[_0x4d4f8f],_0x2ef0('0x90')));_0x4d7820+=0x1;}}_0xf7c2fe[_0x2ef0('0x83')](new Extension(_0x1094c9,_0x4d7820,'6','Wait'));_0x4d7820+=0x1;_0xf7c2fe[_0x2ef0('0x83')](new Extension(_0x1094c9,_0x4d7820,_0x2ef0('0x91'),_0x2ef0('0x92')));_0x4d7820=0x0;return _0xf7c2fe;}exports[_0x2ef0('0x93')]=function(_0x59876b,_0x466790,_0x319138){var _0x47331d;return db['sequelize']['transaction'](function(_0x36f8e4){return db[_0x2ef0('0x3a')][_0x2ef0('0x55')](_0x59876b[_0x2ef0('0x5d')],{'transaction':_0x36f8e4})['then'](function(_0x2d3ddf){_0x47331d=_0x2d3ddf['get']({'plain':!![]});return db[_0x2ef0('0x94')]['bulkCreate'](createExtensionsReciveFax(_0x47331d),{'transaction':_0x36f8e4});});})['then'](function(){return _0x47331d;})[_0x2ef0('0x21')](respondWithResult(_0x466790,null))['catch'](handleError(_0x466790,null));};exports[_0x2ef0('0x95')]=function(_0x446321,_0x239695,_0x3f2e04){var _0x4d1f15;return db[_0x2ef0('0x96')][_0x2ef0('0x7a')](function(_0x426106){return db['FaxAccount'][_0x2ef0('0x97')](_0x446321[_0x2ef0('0x5d')],{'where':{'id':_0x446321[_0x2ef0('0x5d')]['id']},'transaction':_0x426106})[_0x2ef0('0x21')](function(_0x39a0cb){return db[_0x2ef0('0x94')][_0x2ef0('0x33')]({'where':{'FaxAccountId':_0x446321[_0x2ef0('0x5d')]['id']},'transaction':_0x426106})['then'](function(_0x352d9c){return db['VoiceExtension'][_0x2ef0('0x7c')](createExtensionsReciveFax(_[_0x2ef0('0x6f')](_0x446321['body'],[_0x2ef0('0x98'),_0x2ef0('0x3d'),_0x2ef0('0x99'),_0x2ef0('0x9a'),_0x2ef0('0x9b'),'ListId'])),{'transaction':_0x426106});});});})[_0x2ef0('0x21')](function(){return db[_0x2ef0('0x3a')][_0x2ef0('0x9c')](_0x446321[_0x2ef0('0x5d')]['id']);})[_0x2ef0('0x21')](respondWithResult(_0x239695,null))[_0x2ef0('0x51')](handleError(_0x239695,null));};exports[_0x2ef0('0x9d')]=function(_0x334d1d,_0x5e935e,_0x9829e2){var _0x3e7691={'raw':!![],'where':{}};var _0xa050ab={};var _0x3dcad5={'count':0x0,'rows':[]};return db[_0x2ef0('0x3a')][_0x2ef0('0x63')]({'where':{'id':_0x334d1d[_0x2ef0('0x52')]['id']}})['then'](handleEntityNotFound(_0x5e935e,null))['then'](function(_0x1f09d8){if(_0x1f09d8){_0xa050ab[_0x2ef0('0x3e')]=_[_0x2ef0('0x41')](db['FaxMessage']['rawAttributes']);_0xa050ab[_0x2ef0('0x40')]=_[_0x2ef0('0x41')](_0x334d1d['query']);_0xa050ab[_0x2ef0('0x42')]=_[_0x2ef0('0x43')](_0xa050ab[_0x2ef0('0x3e')],_0xa050ab[_0x2ef0('0x40')]);_0x3e7691['attributes']=_[_0x2ef0('0x43')](_0xa050ab[_0x2ef0('0x3e')],qs[_0x2ef0('0x53')](_0x334d1d[_0x2ef0('0x40')]['fields']));_0x3e7691[_0x2ef0('0x44')]=_0x3e7691[_0x2ef0('0x44')][_0x2ef0('0x45')]?_0x3e7691['attributes']:_0xa050ab['model'];if(!_0x334d1d['query'][_0x2ef0('0x46')](_0x2ef0('0x47'))){_0x3e7691[_0x2ef0('0x2e')]=qs['limit'](_0x334d1d['query'][_0x2ef0('0x2e')]);_0x3e7691[_0x2ef0('0x2d')]=qs['offset'](_0x334d1d['query'][_0x2ef0('0x2d')]);}_0x3e7691[_0x2ef0('0x69')]=qs[_0x2ef0('0x48')](_0x334d1d[_0x2ef0('0x40')]['sort']);_0x3e7691[_0x2ef0('0x49')]=qs[_0x2ef0('0x42')](_['pick'](_0x334d1d[_0x2ef0('0x40')],_0xa050ab[_0x2ef0('0x42')]));_0x3e7691['where'][_0x2ef0('0x60')]=_0x1f09d8['id'];if(_0x334d1d[_0x2ef0('0x40')]['filter']){_0x3e7691[_0x2ef0('0x49')]=_[_0x2ef0('0x65')](_0x3e7691[_0x2ef0('0x49')],{'$or':_[_0x2ef0('0x3f')](_0x3e7691[_0x2ef0('0x44')],function(_0x35061f){var _0x17e4a9={};_0x17e4a9[_0x35061f]={'$like':'%'+_0x334d1d[_0x2ef0('0x40')][_0x2ef0('0x4a')]+'%'};return _0x17e4a9;})});}if(_0x334d1d[_0x2ef0('0x40')][_0x2ef0('0x9e')]){var _0x5250c6=_0x334d1d[_0x2ef0('0x40')][_0x2ef0('0x9e')][_0x2ef0('0x9f')](',');var _0x33b80d={};_0x33b80d[_0x5250c6[0x0]]={'$gte':moment(_0x5250c6[0x1])[_0x2ef0('0xa0')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3e7691[_0x2ef0('0x49')]=_[_0x2ef0('0x65')](_0x3e7691[_0x2ef0('0x49')],_0x33b80d);}_0x3e7691=_[_0x2ef0('0x65')]({},_0x3e7691,_0x334d1d[_0x2ef0('0x4c')]);return db[_0x2ef0('0xa1')][_0x2ef0('0x4d')]({'where':_0x3e7691[_0x2ef0('0x49')]})[_0x2ef0('0x21')](function(_0x155b55){_0x3dcad5[_0x2ef0('0x4d')]=_0x155b55;if(_0x334d1d[_0x2ef0('0x40')]['includeAll']){_0x3e7691[_0x2ef0('0x4f')]=[{'all':!![]}];}return db[_0x2ef0('0xa1')]['findAll'](_0x3e7691);})[_0x2ef0('0x21')](function(_0x3e60d1){_0x3dcad5['rows']=_0x3e60d1;return _0x3dcad5;});}})[_0x2ef0('0x21')](respondWithFilteredResult(_0x5e935e,_0x3e7691))[_0x2ef0('0x51')](handleError(_0x5e935e,null));};exports['send']=function(_0x4752a2,_0x3cde90,_0x1eed63){var _0x22cad1,_0x4c3969={},_0xb5e3a6;if(_0x4752a2[_0x2ef0('0x5d')]['to']){_0xb5e3a6=_0x4752a2[_0x2ef0('0x5d')]['to'][0x0];}return db[_0x2ef0('0x3a')][_0x2ef0('0x54')]({'where':{'id':_0x4752a2[_0x2ef0('0x52')]['id']},'include':[{'model':db['CmList'],'as':_0x2ef0('0xa2'),'include':[{'model':db[_0x2ef0('0xa3')],'as':'Contacts','where':{'fax':_0xb5e3a6},'limit':0x1,'order':[[_0x2ef0('0x9a'),_0x2ef0('0xa4')]]}]}]})[_0x2ef0('0x21')](handleEntityNotFound(_0x3cde90,null))[_0x2ef0('0x21')](function(_0x1e9aea){_0x22cad1=_0x1e9aea;if(_0x4752a2[_0x2ef0('0x5d')][_0x2ef0('0xa5')]&&_0x4752a2[_0x2ef0('0x5d')]['attachments'][_0x2ef0('0x45')]){for(var _0x579276=0x0;_0x579276<_0x4752a2[_0x2ef0('0x5d')][_0x2ef0('0xa5')][_0x2ef0('0x45')];_0x579276+=0x1){_0x4752a2[_0x2ef0('0x5d')][_0x2ef0('0xa5')][_0x579276]={'filename':_0x4752a2[_0x2ef0('0x5d')]['attachments'][_0x579276][_0x2ef0('0x36')],'id':_0x4752a2[_0x2ef0('0x5d')][_0x2ef0('0xa5')][_0x579276]['id'],'path':path[_0x2ef0('0xa6')](config[_0x2ef0('0xa7')],_0x2ef0('0xa8'),_0x4752a2['body'][_0x2ef0('0xa5')][_0x579276][_0x2ef0('0xa9')])};}}return respondWithRpcPromise(_0x2ef0('0xaa'),'CheckAfterSend',{'FaxAccountId':_['isNil'](_0x4752a2[_0x2ef0('0x52')]['id'])?undefined:_0x4752a2[_0x2ef0('0x52')]['id'],'path':_[_0x2ef0('0xab')](_0x4752a2[_0x2ef0('0x5d')]['attachments'][0x0][_0x2ef0('0x6')])?undefined:_0x4752a2[_0x2ef0('0x5d')][_0x2ef0('0xa5')][0x0][_0x2ef0('0x6')],'fax':_[_0x2ef0('0xab')](_0x4752a2['body']['to'][0x0])?undefined:_0x4752a2[_0x2ef0('0x5d')]['to'][0x0]},client9002);})[_0x2ef0('0x21')](function(){if(_0x22cad1){if(_['isNil'](_0x4752a2[_0x2ef0('0x5d')]['from'])){_0x4752a2['body'][_0x2ef0('0xac')]=util['format']('\x22%s\x22\x20<%s>',_0x22cad1[_0x2ef0('0x36')],_0x22cad1['fax']);}if(_0x22cad1[_0x2ef0('0xa2')]){if(_0x22cad1['List']['Contacts'][_0x2ef0('0x45')]){return _0x22cad1['List'][_0x2ef0('0xad')][0x0];}else{return db['CmContact'][_0x2ef0('0x55')](_[_0x2ef0('0x17')](_0x4752a2[_0x2ef0('0x5d')],{'firstName':_0x4752a2['body']['to'][0x0],'phone':_0x4752a2[_0x2ef0('0x5d')]['to'][0x0],'fax':_0x4752a2[_0x2ef0('0x5d')]['to'][0x0],'ListId':_0x22cad1['ListId']}));}}else{throw new Error(_0x2ef0('0xae'));}}else{throw new Error(_0x2ef0('0xaf'));}})[_0x2ef0('0x21')](function(_0x13d465){if(_0x13d465){return db[_0x2ef0('0x6e')][_0x2ef0('0x54')]({'where':{'ContactId':_0x13d465['id'],'closed':![],'FaxAccountId':_0x22cad1['id']}})['then'](function(_0x2bcbe5){if(_0x2bcbe5){return[_0x2bcbe5,![]];}return db[_0x2ef0('0x6e')][_0x2ef0('0x55')]({'UserId':_0x4752a2['user']['id'],'ContactId':_0x13d465['id'],'FaxAccountId':_0x22cad1['id'],'fax':_0x4752a2['body']['to'][0x0],'firstMsgDirection':_0x2ef0('0xb0'),'Messages':[_[_0x2ef0('0x65')](_0x4752a2[_0x2ef0('0x5d')],{'read':![],'body':_0x4752a2[_0x2ef0('0x5d')][_0x2ef0('0xa5')][0x0][_0x2ef0('0xb1')],'FaxAccountId':_0x22cad1['id'],'UserId':_0x4752a2[_0x2ef0('0x56')]['id'],'ContactId':_0x13d465['id'],'AttachmentId':_0x4752a2[_0x2ef0('0x5d')][_0x2ef0('0xa5')][0x0]['id']})]},{'include':[{'model':db[_0x2ef0('0xa1')],'as':_0x2ef0('0xb2')}]})[_0x2ef0('0x21')](function(_0x172c64){return[_0x172c64,!![]];});});}else{throw new Error(_0x2ef0('0xb3'));}})[_0x2ef0('0xb4')](function(_0x129717,_0x25d1ca){if(_0x25d1ca){return _0x129717;}return db[_0x2ef0('0xa1')][_0x2ef0('0x55')]({'direction':_0x2ef0('0xb0'),'read':![],'body':_0x4752a2[_0x2ef0('0x5d')][_0x2ef0('0xa5')][0x0][_0x2ef0('0xb1')],'FaxAccountId':_0x22cad1['id'],'FaxInteractionId':_0x129717['id'],'UserId':_0x4752a2[_0x2ef0('0x56')]['id'],'ContactId':_0x129717[_0x2ef0('0xb5')],'AttachmentId':_0x4752a2[_0x2ef0('0x5d')][_0x2ef0('0xa5')][0x0]['id']})[_0x2ef0('0x21')](function(_0x88eb2b){_0x129717['dataValues'][_0x2ef0('0xb2')]=[];_0x129717[_0x2ef0('0xb6')][_0x2ef0('0xb2')][_0x2ef0('0x83')](_0x88eb2b[_0x2ef0('0xb6')]);return _0x129717;});})[_0x2ef0('0x21')](function(_0x5c29a0){respondWithRpcPromise('SendFax',_0x2ef0('0xb7'),{'FaxAccountId':_['isNil'](_0x4752a2['params']['id'])?undefined:_0x4752a2[_0x2ef0('0x52')]['id'],'path':_[_0x2ef0('0xab')](_0x4752a2[_0x2ef0('0x5d')]['attachments'][0x0][_0x2ef0('0x6')])?undefined:_0x4752a2['body'][_0x2ef0('0xa5')][0x0][_0x2ef0('0x6')],'fax':_[_0x2ef0('0xab')](_0x4752a2[_0x2ef0('0x5d')]['to'][0x0])?undefined:_0x4752a2[_0x2ef0('0x5d')]['to'][0x0],'AttachmentId':_0x4752a2['body'][_0x2ef0('0xa5')][0x0]['id']},client9002)[_0x2ef0('0x21')](function(_0x4b222e){logger['info'](_0x2ef0('0xb8'),_0x4b222e);})[_0x2ef0('0x51')](function(_0x36aaf3){logger['info'](_0x2ef0('0xb8'),_0x36aaf3);});return _0x5c29a0;})[_0x2ef0('0x21')](respondWithResult(_0x3cde90,null))[_0x2ef0('0x51')](handleError(_0x3cde90,null));};exports[_0x2ef0('0xb9')]=function(_0x3f0b8d,_0x61889,_0x57da16){return db[_0x2ef0('0x3a')][_0x2ef0('0x54')]({'where':{'id':_0x3f0b8d[_0x2ef0('0x52')]['id']}})['then'](handleEntityNotFound(_0x61889,null))[_0x2ef0('0x21')](function(_0x58f91c){if(_0x58f91c){return _0x58f91c[_0x2ef0('0xb9')](_0x3f0b8d['body']['ids'],_[_0x2ef0('0x6f')](_0x3f0b8d[_0x2ef0('0x5d')],['ids','id'])||{})[_0x2ef0('0xb4')](function(_0x2b72ac){for(var _0x19079b=0x0;_0x19079b<_0x3f0b8d[_0x2ef0('0x5d')]['ids'][_0x2ef0('0x45')];_0x19079b+=0x1){socket['emit'](_0x2ef0('0xba'),{'UserId':_0x3f0b8d[_0x2ef0('0x5d')][_0x2ef0('0x6c')][_0x19079b],'FaxAccountId':_0x3f0b8d[_0x2ef0('0x52')]['id']});}return _0x2b72ac;});}})[_0x2ef0('0x21')](respondWithResult(_0x61889,null))[_0x2ef0('0x51')](handleError(_0x61889,null));};exports[_0x2ef0('0xbb')]=function(_0x52eb42,_0x2b524a,_0x33858e){return db[_0x2ef0('0x3a')][_0x2ef0('0x54')]({'where':{'id':_0x52eb42['params']['id']}})[_0x2ef0('0x21')](handleEntityNotFound(_0x2b524a,null))['then'](function(_0x4b9e17){if(_0x4b9e17){return _0x4b9e17['removeAgents'](_0x52eb42[_0x2ef0('0x40')][_0x2ef0('0x6c')])[_0x2ef0('0x21')](function(){if(_[_0x2ef0('0xbc')](_0x52eb42[_0x2ef0('0x40')][_0x2ef0('0x6c')])){for(var _0x5eee58=0x0;_0x5eee58<_0x52eb42[_0x2ef0('0x40')][_0x2ef0('0x6c')][_0x2ef0('0x45')];_0x5eee58+=0x1){socket[_0x2ef0('0xbd')](_0x2ef0('0xbe'),{'UserId':Number(_0x52eb42['query'][_0x2ef0('0x6c')][_0x5eee58]),'FaxAccountId':Number(_0x52eb42[_0x2ef0('0x52')]['id'])});}}else{socket[_0x2ef0('0xbd')](_0x2ef0('0xbe'),{'UserId':Number(_0x52eb42['query'][_0x2ef0('0x6c')]),'FaxAccountId':Number(_0x52eb42['params']['id'])});}});}})[_0x2ef0('0x21')](respondWithStatusCode(_0x2b524a,null))['catch'](handleError(_0x2b524a,null));};exports[_0x2ef0('0xbf')]=function(_0x7eddaf,_0x1b568b,_0x5ee6ba){var _0x1af7a3={};var _0x1935a2={};var _0x1d245a;var _0x37827a;return db[_0x2ef0('0x3a')][_0x2ef0('0x63')]({'where':{'id':_0x7eddaf['params']['id']}})[_0x2ef0('0x21')](handleEntityNotFound(_0x1b568b,null))[_0x2ef0('0x21')](function(_0x5cae0a){if(_0x5cae0a){_0x1d245a=_0x5cae0a;_0x1935a2[_0x2ef0('0x3e')]=_[_0x2ef0('0x41')](db['User'][_0x2ef0('0x64')]);_0x1935a2[_0x2ef0('0x40')]=_[_0x2ef0('0x41')](_0x7eddaf['query']);_0x1935a2[_0x2ef0('0x42')]=_[_0x2ef0('0x43')](_0x1935a2[_0x2ef0('0x3e')],_0x1935a2[_0x2ef0('0x40')]);_0x1af7a3[_0x2ef0('0x44')]=_['intersection'](_0x1935a2['model'],qs[_0x2ef0('0x53')](_0x7eddaf[_0x2ef0('0x40')]['fields']));_0x1af7a3[_0x2ef0('0x44')]=_0x1af7a3[_0x2ef0('0x44')][_0x2ef0('0x45')]?_0x1af7a3[_0x2ef0('0x44')]:_0x1935a2['model'];_0x1af7a3[_0x2ef0('0x69')]=qs['sort'](_0x7eddaf['query'][_0x2ef0('0x48')]);_0x1af7a3[_0x2ef0('0x49')]=qs['filters'](_[_0x2ef0('0x6a')](_0x7eddaf[_0x2ef0('0x40')],_0x1935a2[_0x2ef0('0x42')]));if(_0x7eddaf['query'][_0x2ef0('0x4a')]){_0x1af7a3[_0x2ef0('0x49')]=_['merge'](_0x1af7a3[_0x2ef0('0x49')],{'$or':_[_0x2ef0('0x3f')](_0x1af7a3['attributes'],function(_0x2183a9){var _0xe3164e={};_0xe3164e[_0x2183a9]={'$like':'%'+_0x7eddaf[_0x2ef0('0x40')][_0x2ef0('0x4a')]+'%'};return _0xe3164e;})});}_0x1af7a3=_[_0x2ef0('0x65')]({},_0x1af7a3,_0x7eddaf[_0x2ef0('0x4c')]);return _0x1d245a['getAgents'](_0x1af7a3);}})[_0x2ef0('0x21')](function(_0x5479f0){if(_0x5479f0){_0x37827a=_0x5479f0[_0x2ef0('0x45')];if(!_0x7eddaf[_0x2ef0('0x40')]['hasOwnProperty'](_0x2ef0('0x47'))){_0x1af7a3[_0x2ef0('0x2e')]=qs[_0x2ef0('0x2e')](_0x7eddaf[_0x2ef0('0x40')][_0x2ef0('0x2e')]);_0x1af7a3[_0x2ef0('0x2d')]=qs[_0x2ef0('0x2d')](_0x7eddaf['query'][_0x2ef0('0x2d')]);}return _0x1d245a[_0x2ef0('0xbf')](_0x1af7a3);}})['then'](function(_0x18ce1a){if(_0x18ce1a){return _0x18ce1a?{'count':_0x37827a,'rows':_0x18ce1a}:null;}})[_0x2ef0('0x21')](respondWithResult(_0x1b568b,null))['catch'](handleError(_0x1b568b,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 6602395..3ee2013 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 _0x16db=['emit','hasOwnProperty','hook','events','../../mysqldb','FaxAccount','save','update'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x16db,0xa3));var _0xb16d=function(_0x14fd10,_0x207b9a){_0x14fd10=_0x14fd10-0x0;var _0x323483=_0x16db[_0x14fd10];return _0x323483;};'use strict';var EventEmitter=require(_0xb16d('0x0'));var FaxAccount=require(_0xb16d('0x1'))['db'][_0xb16d('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb16d('0x3'),'afterUpdate':_0xb16d('0x4'),'afterDestroy':'remove'};function emitEvent(_0x180765){return function(_0x176d63,_0x18e5ab,_0x5af853){FaxAccountEvents[_0xb16d('0x5')](_0x180765+':'+_0x176d63['id'],_0x176d63);FaxAccountEvents[_0xb16d('0x5')](_0x180765,_0x176d63);_0x5af853(null);};}for(var e in events){if(events[_0xb16d('0x6')](e)){var event=events[e];FaxAccount[_0xb16d('0x7')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file +var _0xe3b8=['FaxAccount','setMaxListeners','update','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x1d1d09,_0x504d77){var _0x8827e=function(_0x4f3128){while(--_0x4f3128){_0x1d1d09['push'](_0x1d1d09['shift']());}};_0x8827e(++_0x504d77);}(_0xe3b8,0x137));var _0x8e3b=function(_0x55340b,_0x5f05b4){_0x55340b=_0x55340b-0x0;var _0x56df4e=_0xe3b8[_0x55340b];return _0x56df4e;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0x8e3b('0x0'))['db'][_0x8e3b('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x8e3b('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8e3b('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3b2671){return function(_0x3371e8,_0x1d3b3a,_0x73c1b5){FaxAccountEvents[_0x8e3b('0x4')](_0x3b2671+':'+_0x3371e8['id'],_0x3371e8);FaxAccountEvents[_0x8e3b('0x4')](_0x3b2671,_0x3371e8);_0x73c1b5(null);};}for(var e in events){if(events[_0x8e3b('0x5')](e)){var event=events[e];FaxAccount[_0x8e3b('0x6')](e,emitEvent(event));}}module[_0x8e3b('0x7')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index c271ede..767bdea 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 _0x5ea8=['bluebird','request-promise','path','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','util','api','moment'];(function(_0x44b424,_0x1fe242){var _0x16d49a=function(_0x510a82){while(--_0x510a82){_0x44b424['push'](_0x44b424['shift']());}};_0x16d49a(++_0x1fe242);}(_0x5ea8,0x75));var _0x85ea=function(_0xae98ad,_0x21b924){_0xae98ad=_0xae98ad-0x0;var _0xee47ec=_0x5ea8[_0xae98ad];return _0xee47ec;};'use strict';var _=require('lodash');var util=require(_0x85ea('0x0'));var logger=require('../../config/logger')(_0x85ea('0x1'));var moment=require(_0x85ea('0x2'));var BPromise=require(_0x85ea('0x3'));var rp=require(_0x85ea('0x4'));var fs=require('fs');var path=require(_0x85ea('0x5'));var rimraf=require('rimraf');var config=require(_0x85ea('0x6'));var attributes=require(_0x85ea('0x7'));module[_0x85ea('0x8')]=function(_0xe71457,_0x14f12c){return _0xe71457[_0x85ea('0x9')](_0x85ea('0xa'),attributes,{'tableName':_0x85ea('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xddce=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','lodash'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xddce,0x99));var _0xeddc=function(_0x32b316,_0x1b8f03){_0x32b316=_0x32b316-0x0;var _0x236ecd=_0xddce[_0x32b316];return _0x236ecd;};'use strict';var _=require(_0xeddc('0x0'));var util=require(_0xeddc('0x1'));var logger=require(_0xeddc('0x2'))(_0xeddc('0x3'));var moment=require(_0xeddc('0x4'));var BPromise=require(_0xeddc('0x5'));var rp=require(_0xeddc('0x6'));var fs=require('fs');var path=require(_0xeddc('0x7'));var rimraf=require(_0xeddc('0x8'));var config=require('../../config/environment');var attributes=require(_0xeddc('0x9'));module[_0xeddc('0xa')]=function(_0x4d51c5,_0xfc485b){return _0x4d51c5[_0xeddc('0xb')](_0xeddc('0xc'),attributes,{'tableName':_0xeddc('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 b1225c7..a8e6878 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 _0x260f=['message','FaxAccount,\x20%s,\x20%s','info','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','include','map','attributes','NotifyFaxAccount','fax','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','body','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','from','find','account','CmList','List','Contacts','DESC','FaxApplication','get','Applications','list','applications','orderBy','priority','length','defaults','create','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose','close','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','User','name','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xdda14e,_0x5b972b){var _0x50ca9b=function(_0x39db89){while(--_0x39db89){_0xdda14e['push'](_0xdda14e['shift']());}};_0x50ca9b(++_0x5b972b);}(_0x260f,0xfd));var _0xf260=function(_0x44957f,_0x2e8abc){_0x44957f=_0x44957f-0x0;var _0x555a2b=_0x260f[_0x44957f];return _0x555a2b;};'use strict';var _=require(_0xf260('0x0'));var util=require(_0xf260('0x1'));var moment=require('moment');var BPromise=require(_0xf260('0x2'));var rs=require(_0xf260('0x3'));var fs=require('fs');var Redis=require(_0xf260('0x4'));var db=require(_0xf260('0x5'))['db'];var utils=require(_0xf260('0x6'));var logger=require(_0xf260('0x7'))(_0xf260('0x8'));var config=require(_0xf260('0x9'));var jayson=require(_0xf260('0xa'));var client=jayson[_0xf260('0xb')][_0xf260('0xc')]({'port':0x232c});config['redis']=_['defaults'](config[_0xf260('0xd')],{'host':_0xf260('0xe'),'port':0x18eb});var socket=require(_0xf260('0xf'))(new Redis(config[_0xf260('0xd')]));require(_0xf260('0x10'))[_0xf260('0x11')](socket);function respondWithRpcPromise(_0x5d35d2,_0x900621,_0x19e711){return new BPromise(function(_0x1af9a4,_0x595122){return client[_0xf260('0x12')](_0x5d35d2,_0x19e711)[_0xf260('0x13')](function(_0x16d609){logger['info']('FaxAccount,\x20%s,\x20%s',_0x900621,_0xf260('0x14'));logger[_0xf260('0x15')](_0xf260('0x16'),_0x900621,_0xf260('0x14'),JSON[_0xf260('0x17')](_0x16d609));if(_0x16d609[_0xf260('0x18')]){if(_0x16d609[_0xf260('0x18')][_0xf260('0x19')]===0x1f4){logger[_0xf260('0x18')]('FaxAccount,\x20%s,\x20%s',_0x900621,_0x16d609[_0xf260('0x18')][_0xf260('0x1a')]);return _0x595122(_0x16d609[_0xf260('0x18')][_0xf260('0x1a')]);}logger[_0xf260('0x18')](_0xf260('0x1b'),_0x900621,_0x16d609['error'][_0xf260('0x1a')]);return _0x1af9a4(_0x16d609['error']['message']);}else{logger[_0xf260('0x1c')](_0xf260('0x1b'),_0x900621,_0xf260('0x14'));_0x1af9a4(_0x16d609['result'][_0xf260('0x1a')]);}})[_0xf260('0x1d')](function(_0x21c4b2){logger[_0xf260('0x18')](_0xf260('0x1b'),_0x900621,_0x21c4b2);_0x595122(_0x21c4b2);});});}exports[_0xf260('0x1e')]=function(_0x439d01){var _0x1c4013=this;return new Promise(function(_0x33ad61,_0x17de7f){return db[_0xf260('0x1f')][_0xf260('0x20')]({'raw':_0x439d01[_0xf260('0x21')]?_0x439d01['options'][_0xf260('0x22')]===undefined?!![]:![]:!![],'where':_0x439d01[_0xf260('0x21')]?_0x439d01[_0xf260('0x21')][_0xf260('0x23')]||null:null,'attributes':_0x439d01['options']?_0x439d01[_0xf260('0x21')]['attributes']||null:null,'limit':_0x439d01['options']?_0x439d01[_0xf260('0x21')]['limit']||null:null,'include':_0x439d01[_0xf260('0x21')]?_0x439d01[_0xf260('0x21')][_0xf260('0x24')]?_[_0xf260('0x25')](_0x439d01[_0xf260('0x21')][_0xf260('0x24')],function(_0x5c3332){return{'model':db[_0x5c3332['model']],'as':_0x5c3332['as'],'attributes':_0x5c3332[_0xf260('0x26')],'include':_0x5c3332[_0xf260('0x24')]?_['map'](_0x5c3332[_0xf260('0x24')],function(_0x4ebf16){return{'model':db[_0x4ebf16['model']],'as':_0x4ebf16['as'],'attributes':_0x4ebf16[_0xf260('0x26')],'include':_0x4ebf16['include']?_['map'](_0x4ebf16['include'],function(_0x223563){return{'model':db[_0x223563['model']],'as':_0x223563['as'],'attributes':_0x223563[_0xf260('0x26')]};}):[]};}):[]};}):[]:[]})[_0xf260('0x13')](function(_0x179b2f){logger[_0xf260('0x1c')](_0xf260('0x1e'),_0x439d01);logger[_0xf260('0x15')](_0xf260('0x1e'),_0x439d01,JSON[_0xf260('0x17')](_0x179b2f));_0x33ad61(_0x179b2f);})[_0xf260('0x1d')](function(_0x537e50){logger[_0xf260('0x18')](_0xf260('0x1e'),_0x537e50[_0xf260('0x1a')],_0x439d01);_0x17de7f(_0x1c4013[_0xf260('0x18')](0x1f4,_0x537e50['message']));});});};exports[_0xf260('0x27')]=function(_0x1242be,_0x1a6c15,_0x80471a){var _0x497c45=this;return new Promise(function(_0x4b5400,_0x23e89c){var _0x1f38f0={'body':_0x1242be['body'],'channel':_0xf260('0x28')};var _0x5bd7ee=[];var _0xc97820=[];var _0x5d2796={};return db[_0xf260('0x29')]['describe']()[_0xf260('0x13')](function(_0xc9f29c){if(!_0xc9f29c){throw new db[(_0xf260('0x2a'))][(_0xf260('0x2b'))](_0xf260('0x2c'));}_0x5bd7ee=_[_0xf260('0x2d')](_[_0xf260('0x2e')](_0xc9f29c),[_0xf260('0x2f'),_0xf260('0x30')]);_0xc97820=_['difference'](_[_0xf260('0x2e')](_0xc9f29c),[_0xf260('0x2f'),_0xf260('0x30'),_0xf260('0x31'),_0xf260('0x32')]);if(_0x1242be[_0xf260('0x33')]['id']){delete _0x1242be[_0xf260('0x33')]['id'];}if(_[_0xf260('0x34')](_0x1242be[_0xf260('0x33')]['from'])){throw new db[(_0xf260('0x2a'))]['ValidationError'](_0xf260('0x35'));}if(_[_0xf260('0x34')](_0x1242be['body'][_0xf260('0x33')])||_0x1242be['body']['body']===''){throw new db[(_0xf260('0x2a'))]['ValidationError'](_0xf260('0x36'));}if(_[_0xf260('0x34')](_0x1242be['body'][_0xf260('0x37')])){throw new db[(_0xf260('0x2a'))]['ValidationError'](_0xf260('0x38')+_0xc97820);}if(!_['includes'](_0xc97820,_0x1242be[_0xf260('0x33')][_0xf260('0x37')])){throw new db['Sequelize'][(_0xf260('0x2b'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xc97820);}_0x5d2796[_0x1242be['body'][_0xf260('0x37')]]=_0x1242be[_0xf260('0x33')][_0xf260('0x39')];})[_0xf260('0x13')](function(){return db[_0xf260('0x1f')][_0xf260('0x3a')]({'where':{'id':_0x1242be[_0xf260('0x3b')]['id']},'include':[{'model':db[_0xf260('0x3c')],'as':_0xf260('0x3d'),'include':[{'model':db['CmContact'],'as':_0xf260('0x3e'),'where':_0x5d2796,'limit':0x1,'order':[['updatedAt',_0xf260('0x3f')]]}]},{'model':db[_0xf260('0x40')],'as':'Applications'}]});})[_0xf260('0x13')](function(_0x2d0a38){if(_0x2d0a38&&_0x2d0a38[_0xf260('0x3d')]){var _0x1a9650=_0x2d0a38[_0xf260('0x41')]({'plain':!![]});_0x1f38f0[_0xf260('0x3b')]=_0x1a9650;_0x1f38f0['applications']=_0x1a9650[_0xf260('0x42')];_0x1f38f0[_0xf260('0x43')]=_0x1a9650[_0xf260('0x3d')];_0x1f38f0[_0xf260('0x44')]=_[_0xf260('0x45')](_0x1f38f0[_0xf260('0x44')],[_0xf260('0x46')],['asc']);if(_0x1f38f0[_0xf260('0x3b')][_0xf260('0x42')]){delete _0x1f38f0[_0xf260('0x3b')][_0xf260('0x42')];}if(_0x1f38f0[_0xf260('0x3b')]['List']&&_0x1f38f0['account']['List'][_0xf260('0x3e')][_0xf260('0x47')]){return _0x1f38f0['account'][_0xf260('0x3d')]['Contacts'][0x0];}var _0xf0b2b5=_[_0xf260('0x48')](_0x1242be[_0xf260('0x33')],{'firstName':_0x1242be[_0xf260('0x33')][_0xf260('0x39')],'ListId':_0x1a9650[_0xf260('0x32')]});_0xf0b2b5[_0x1242be['body']['mapKey']]=_0x1242be[_0xf260('0x33')][_0xf260('0x39')];return db[_0xf260('0x29')][_0xf260('0x49')](_0xf0b2b5,{'fields':_0x5bd7ee,'raw':!![]});}})[_0xf260('0x13')](function(_0x4c0fa7){_0x1f38f0[_0xf260('0x4a')]=_0x4c0fa7;if(_0x4c0fa7){var _0x552c20={'ContactId':_0x4c0fa7['id'],'FaxAccountId':_0x1242be[_0xf260('0x3b')]['id'],'fax':_0x4c0fa7[_0xf260('0x28')]};return db[_0xf260('0x4b')][_0xf260('0x3a')]({'where':{'ContactId':_0x4c0fa7['id'],'closed':![],'FaxAccountId':_0x1242be[_0xf260('0x3b')]['id']}})[_0xf260('0x13')](function(_0x41fca8){if(_0x41fca8){return[_0x41fca8,![]];}return db[_0xf260('0x4b')][_0xf260('0x49')](_0x552c20)[_0xf260('0x13')](function(_0x13c85f){return[_0x13c85f,!![]];});});}else{throw new Error(_0xf260('0x4c'));}})[_0xf260('0x4d')](function(_0x1a8d2e,_0x4fa526){var _0x387381=_0x1a8d2e['get']({'plain':!![]});if(_0x4fa526){if(_0x1f38f0[_0xf260('0x3b')][_0xf260('0x4e')]){_0x1f38f0[_0xf260('0x44')]['push']({'id':0x0,'priority':_0x1f38f0['applications']['length']+0x1,'app':_0xf260('0x4f'),'appdata':'unmanaged','interval':_0xf260('0x50')});}_0x387381[_0xf260('0x51')]=!![];}else{_0x387381['created']=![];}_0x1f38f0[_0xf260('0x52')]=_0x387381;return db[_0xf260('0x53')][_0xf260('0x49')]({'body':_0x1242be['body'][_0xf260('0x33')],'FaxAccountId':_0x1242be[_0xf260('0x3b')]['id'],'FaxInteractionId':_0x1a8d2e['id'],'direction':'in','ContactId':_0x1a8d2e[_0xf260('0x54')],'AttachmentId':_0x1242be['body'][_0xf260('0x55')]});})[_0xf260('0x13')](function(_0x1151ab){_0x1f38f0[_0xf260('0x1a')]=_0x1151ab;if(_0x1f38f0[_0xf260('0x52')][_0xf260('0x56')]){return db[_0xf260('0x57')][_0xf260('0x3a')]({'attributes':['id',_0xf260('0x58')],'where':{'id':_0x1f38f0['interaction'][_0xf260('0x56')]}})[_0xf260('0x13')](function(_0xb8d6f7){if(_0xb8d6f7){_0x1f38f0[_0xf260('0x44')]['unshift']({'id':0x0,'priority':0x0,'app':_0xf260('0x59'),'appdata':_0xb8d6f7[_0xf260('0x58')]+','+(_0x1f38f0['account'][_0xf260('0x5a')]||0xa),'interval':_0xf260('0x50')});}return respondWithRpcPromise(_0xf260('0x5b'),_0xf260('0x5c'),_0x1f38f0);});}return respondWithRpcPromise(_0xf260('0x5b'),_0xf260('0x5c'),_0x1f38f0);})[_0xf260('0x13')](function(_0x227fa4){_0x4b5400(_0x227fa4);})['catch'](function(_0x13096e){_0x23e89c(_0x497c45[_0xf260('0x18')](0x1f4,_0x13096e[_0xf260('0x1a')]));});});}; \ No newline at end of file +var _0x385f=['body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','account','CmList','Contacts','DESC','FaxApplication','Applications','applications','list','List','orderBy','priority','asc','length','defaults','FaxInteraction','find','create','Contact\x20not\x20found','spread','get','push','close','unmanaged','*,*,*,*','created','interaction','ContactId','User','UserId','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','message','FaxAccount','findAll','options','raw','where','attributes','limit','include','map','model','stringify','catch','NotifyFaxAccount','body','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','keys','CompanyId','isNil','from','Sequelize','from\x20is\x20mandatory'];(function(_0x8ceea,_0x42823e){var _0x4432c5=function(_0x4f7544){while(--_0x4f7544){_0x8ceea['push'](_0x8ceea['shift']());}};_0x4432c5(++_0x42823e);}(_0x385f,0x7d));var _0xf385=function(_0x2b8077,_0x453634){_0x2b8077=_0x2b8077-0x0;var _0x308091=_0x385f[_0x2b8077];return _0x308091;};'use strict';var _=require(_0xf385('0x0'));var util=require(_0xf385('0x1'));var moment=require(_0xf385('0x2'));var BPromise=require(_0xf385('0x3'));var rs=require(_0xf385('0x4'));var fs=require('fs');var Redis=require(_0xf385('0x5'));var db=require(_0xf385('0x6'))['db'];var utils=require(_0xf385('0x7'));var logger=require(_0xf385('0x8'))(_0xf385('0x9'));var config=require(_0xf385('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xf385('0xb')][_0xf385('0xc')]({'port':0x232c});config['redis']=_['defaults'](config[_0xf385('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf385('0xd')]));require(_0xf385('0xe'))[_0xf385('0xf')](socket);function respondWithRpcPromise(_0x4c9a2a,_0xed55b0,_0x38a8cd){return new BPromise(function(_0x153fb6,_0x223e22){return client[_0xf385('0x10')](_0x4c9a2a,_0x38a8cd)[_0xf385('0x11')](function(_0x4a999f){logger[_0xf385('0x12')](_0xf385('0x13'),_0xed55b0,_0xf385('0x14'));logger[_0xf385('0x15')](_0xf385('0x16'),_0xed55b0,_0xf385('0x14'),JSON['stringify'](_0x4a999f));if(_0x4a999f[_0xf385('0x17')]){if(_0x4a999f[_0xf385('0x17')]['code']===0x1f4){logger[_0xf385('0x17')](_0xf385('0x13'),_0xed55b0,_0x4a999f['error'][_0xf385('0x18')]);return _0x223e22(_0x4a999f[_0xf385('0x17')]['message']);}logger[_0xf385('0x17')](_0xf385('0x13'),_0xed55b0,_0x4a999f[_0xf385('0x17')][_0xf385('0x18')]);return _0x153fb6(_0x4a999f[_0xf385('0x17')][_0xf385('0x18')]);}else{logger['info'](_0xf385('0x13'),_0xed55b0,_0xf385('0x14'));_0x153fb6(_0x4a999f['result'][_0xf385('0x18')]);}})['catch'](function(_0x31bcba){logger[_0xf385('0x17')](_0xf385('0x13'),_0xed55b0,_0x31bcba);_0x223e22(_0x31bcba);});});}exports['GetFaxAccount']=function(_0x4dd78f){var _0x5df0ca=this;return new Promise(function(_0x26ac55,_0xf63403){return db[_0xf385('0x19')][_0xf385('0x1a')]({'raw':_0x4dd78f[_0xf385('0x1b')]?_0x4dd78f[_0xf385('0x1b')][_0xf385('0x1c')]===undefined?!![]:![]:!![],'where':_0x4dd78f[_0xf385('0x1b')]?_0x4dd78f['options'][_0xf385('0x1d')]||null:null,'attributes':_0x4dd78f[_0xf385('0x1b')]?_0x4dd78f['options'][_0xf385('0x1e')]||null:null,'limit':_0x4dd78f[_0xf385('0x1b')]?_0x4dd78f[_0xf385('0x1b')][_0xf385('0x1f')]||null:null,'include':_0x4dd78f[_0xf385('0x1b')]?_0x4dd78f[_0xf385('0x1b')][_0xf385('0x20')]?_[_0xf385('0x21')](_0x4dd78f[_0xf385('0x1b')]['include'],function(_0x541bc6){return{'model':db[_0x541bc6[_0xf385('0x22')]],'as':_0x541bc6['as'],'attributes':_0x541bc6['attributes'],'include':_0x541bc6[_0xf385('0x20')]?_['map'](_0x541bc6[_0xf385('0x20')],function(_0x2d4d3e){return{'model':db[_0x2d4d3e['model']],'as':_0x2d4d3e['as'],'attributes':_0x2d4d3e['attributes'],'include':_0x2d4d3e['include']?_['map'](_0x2d4d3e[_0xf385('0x20')],function(_0x5794fa){return{'model':db[_0x5794fa[_0xf385('0x22')]],'as':_0x5794fa['as'],'attributes':_0x5794fa[_0xf385('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf385('0x11')](function(_0x1ae1e9){logger[_0xf385('0x12')]('GetFaxAccount',_0x4dd78f);logger[_0xf385('0x15')]('GetFaxAccount',_0x4dd78f,JSON[_0xf385('0x23')](_0x1ae1e9));_0x26ac55(_0x1ae1e9);})[_0xf385('0x24')](function(_0x13de9e){logger['error']('GetFaxAccount',_0x13de9e[_0xf385('0x18')],_0x4dd78f);_0xf63403(_0x5df0ca[_0xf385('0x17')](0x1f4,_0x13de9e[_0xf385('0x18')]));});});};exports[_0xf385('0x25')]=function(_0x7df389,_0x3eca07,_0x55e2fb){var _0x1baa9d=this;return new Promise(function(_0x407517,_0x45dc92){var _0x4d9c58={'body':_0x7df389[_0xf385('0x26')],'channel':'fax'};var _0x59835e=[];var _0x178fee=[];var _0x3f2a64={};return db[_0xf385('0x27')]['describe']()[_0xf385('0x11')](function(_0x2e6e22){if(!_0x2e6e22){throw new db['Sequelize'][(_0xf385('0x28'))](_0xf385('0x29'));}_0x59835e=_[_0xf385('0x2a')](_['keys'](_0x2e6e22),[_0xf385('0x2b'),_0xf385('0x2c')]);_0x178fee=_['difference'](_[_0xf385('0x2d')](_0x2e6e22),[_0xf385('0x2b'),_0xf385('0x2c'),_0xf385('0x2e'),'ListId']);if(_0x7df389[_0xf385('0x26')]['id']){delete _0x7df389[_0xf385('0x26')]['id'];}if(_[_0xf385('0x2f')](_0x7df389[_0xf385('0x26')][_0xf385('0x30')])){throw new db[(_0xf385('0x31'))][(_0xf385('0x28'))](_0xf385('0x32'));}if(_[_0xf385('0x2f')](_0x7df389[_0xf385('0x26')][_0xf385('0x26')])||_0x7df389[_0xf385('0x26')][_0xf385('0x26')]===''){throw new db[(_0xf385('0x31'))]['ValidationError'](_0xf385('0x33'));}if(_[_0xf385('0x2f')](_0x7df389[_0xf385('0x26')]['mapKey'])){throw new db[(_0xf385('0x31'))][(_0xf385('0x28'))](_0xf385('0x34')+_0x178fee);}if(!_['includes'](_0x178fee,_0x7df389['body'][_0xf385('0x35')])){throw new db[(_0xf385('0x31'))][(_0xf385('0x28'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x178fee);}_0x3f2a64[_0x7df389[_0xf385('0x26')][_0xf385('0x35')]]=_0x7df389[_0xf385('0x26')][_0xf385('0x30')];})['then'](function(){return db[_0xf385('0x19')]['find']({'where':{'id':_0x7df389[_0xf385('0x36')]['id']},'include':[{'model':db[_0xf385('0x37')],'as':'List','include':[{'model':db[_0xf385('0x27')],'as':_0xf385('0x38'),'where':_0x3f2a64,'limit':0x1,'order':[[_0xf385('0x2c'),_0xf385('0x39')]]}]},{'model':db[_0xf385('0x3a')],'as':_0xf385('0x3b')}]});})[_0xf385('0x11')](function(_0x26f655){if(_0x26f655&&_0x26f655['List']){var _0x2a662e=_0x26f655['get']({'plain':!![]});_0x4d9c58[_0xf385('0x36')]=_0x2a662e;_0x4d9c58[_0xf385('0x3c')]=_0x2a662e['Applications'];_0x4d9c58[_0xf385('0x3d')]=_0x2a662e[_0xf385('0x3e')];_0x4d9c58[_0xf385('0x3c')]=_[_0xf385('0x3f')](_0x4d9c58['applications'],[_0xf385('0x40')],[_0xf385('0x41')]);if(_0x4d9c58['account'][_0xf385('0x3b')]){delete _0x4d9c58['account'][_0xf385('0x3b')];}if(_0x4d9c58[_0xf385('0x36')]['List']&&_0x4d9c58[_0xf385('0x36')][_0xf385('0x3e')][_0xf385('0x38')][_0xf385('0x42')]){return _0x4d9c58['account'][_0xf385('0x3e')][_0xf385('0x38')][0x0];}var _0x4bbaaf=_[_0xf385('0x43')](_0x7df389[_0xf385('0x26')],{'firstName':_0x7df389[_0xf385('0x26')][_0xf385('0x30')],'ListId':_0x2a662e['ListId']});_0x4bbaaf[_0x7df389['body']['mapKey']]=_0x7df389[_0xf385('0x26')][_0xf385('0x30')];return db['CmContact']['create'](_0x4bbaaf,{'fields':_0x59835e,'raw':!![]});}})[_0xf385('0x11')](function(_0x496802){_0x4d9c58['contact']=_0x496802;if(_0x496802){var _0x37d465={'ContactId':_0x496802['id'],'FaxAccountId':_0x7df389[_0xf385('0x36')]['id'],'fax':_0x496802['fax']};return db[_0xf385('0x44')][_0xf385('0x45')]({'where':{'ContactId':_0x496802['id'],'closed':![],'FaxAccountId':_0x7df389[_0xf385('0x36')]['id']}})[_0xf385('0x11')](function(_0x352050){if(_0x352050){return[_0x352050,![]];}return db[_0xf385('0x44')][_0xf385('0x46')](_0x37d465)[_0xf385('0x11')](function(_0x241333){return[_0x241333,!![]];});});}else{throw new Error(_0xf385('0x47'));}})[_0xf385('0x48')](function(_0x5df64d,_0x529ffb){var _0x4f00bb=_0x5df64d[_0xf385('0x49')]({'plain':!![]});if(_0x529ffb){if(_0x4d9c58[_0xf385('0x36')]['autoclose']){_0x4d9c58['applications'][_0xf385('0x4a')]({'id':0x0,'priority':_0x4d9c58['applications'][_0xf385('0x42')]+0x1,'app':_0xf385('0x4b'),'appdata':_0xf385('0x4c'),'interval':_0xf385('0x4d')});}_0x4f00bb[_0xf385('0x4e')]=!![];}else{_0x4f00bb[_0xf385('0x4e')]=![];}_0x4d9c58[_0xf385('0x4f')]=_0x4f00bb;return db['FaxMessage']['create']({'body':_0x7df389[_0xf385('0x26')][_0xf385('0x26')],'FaxAccountId':_0x7df389['account']['id'],'FaxInteractionId':_0x5df64d['id'],'direction':'in','ContactId':_0x5df64d[_0xf385('0x50')],'AttachmentId':_0x7df389[_0xf385('0x26')]['AttachmentId']});})[_0xf385('0x11')](function(_0x4c8298){_0x4d9c58[_0xf385('0x18')]=_0x4c8298;if(_0x4d9c58[_0xf385('0x4f')]['UserId']){return db[_0xf385('0x51')][_0xf385('0x45')]({'attributes':['id','name'],'where':{'id':_0x4d9c58['interaction'][_0xf385('0x52')]}})['then'](function(_0x2f2822){if(_0x2f2822){_0x4d9c58['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xf385('0x53'),'appdata':_0x2f2822[_0xf385('0x54')]+','+(_0x4d9c58[_0xf385('0x36')][_0xf385('0x55')]||0xa),'interval':_0xf385('0x4d')});}return respondWithRpcPromise('Start','startRouting',_0x4d9c58);});}return respondWithRpcPromise(_0xf385('0x56'),_0xf385('0x57'),_0x4d9c58);})[_0xf385('0x11')](function(_0x104519){_0x407517(_0x104519);})[_0xf385('0x24')](function(_0x3efacd){_0x45dc92(_0x1baa9d[_0xf385('0x17')](0x1f4,_0x3efacd[_0xf385('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index f5f89ca..0ff1c16 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 _0x5496=['faxAccount:','./faxAccount.events','save','remove','update','removeListener'];(function(_0x24ba04,_0x1c4298){var _0x50448=function(_0x1a5934){while(--_0x1a5934){_0x24ba04['push'](_0x24ba04['shift']());}};_0x50448(++_0x1c4298);}(_0x5496,0x175));var _0x6549=function(_0x33ddf8,_0x127b88){_0x33ddf8=_0x33ddf8-0x0;var _0xf6d811=_0x5496[_0x33ddf8];return _0xf6d811;};'use strict';var FaxAccountEvents=require(_0x6549('0x0'));var events=[_0x6549('0x1'),_0x6549('0x2'),_0x6549('0x3')];function createListener(_0x465fee,_0x4b616a){return function(_0x21585c){_0x4b616a['emit'](_0x465fee,_0x21585c);};}function removeListener(_0x2d2155,_0x8112c5){return function(){FaxAccountEvents[_0x6549('0x4')](_0x2d2155,_0x8112c5);};}exports['register']=function(_0x5a4658){for(var _0x43cb17=0x0,_0x1d8cea=events['length'];_0x43cb17<_0x1d8cea;_0x43cb17++){var _0x1ca8fc=events[_0x43cb17];var _0x3442c3=createListener(_0x6549('0x5')+_0x1ca8fc,_0x5a4658);FaxAccountEvents['on'](_0x1ca8fc,_0x3442c3);}}; \ No newline at end of file +var _0x5496=['faxAccount:','./faxAccount.events','save','remove','update','removeListener'];(function(_0x7d83e5,_0x3ef5b4){var _0x6555e4=function(_0x23cdab){while(--_0x23cdab){_0x7d83e5['push'](_0x7d83e5['shift']());}};_0x6555e4(++_0x3ef5b4);}(_0x5496,0x175));var _0x6549=function(_0xdd4fdd,_0x27f49d){_0xdd4fdd=_0xdd4fdd-0x0;var _0x405a92=_0x5496[_0xdd4fdd];return _0x405a92;};'use strict';var FaxAccountEvents=require(_0x6549('0x0'));var events=[_0x6549('0x1'),_0x6549('0x2'),_0x6549('0x3')];function createListener(_0x465fee,_0x4b616a){return function(_0x21585c){_0x4b616a['emit'](_0x465fee,_0x21585c);};}function removeListener(_0x2d2155,_0x8112c5){return function(){FaxAccountEvents[_0x6549('0x4')](_0x2d2155,_0x8112c5);};}exports['register']=function(_0x5a4658){for(var _0x43cb17=0x0,_0x1d8cea=events['length'];_0x43cb17<_0x1d8cea;_0x43cb17++){var _0x1ca8fc=events[_0x43cb17];var _0x3442c3=createListener(_0x6549('0x5')+_0x1ca8fc,_0x5a4658);FaxAccountEvents['on'](_0x1ca8fc,_0x3442c3);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 59f2747..ac27856 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 _0xc4a7=['../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','isAuthenticated','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','/:id/users','post','addAnswer','addApplications','/addaccountapplications','/:id/send','send','update','delete','/:id','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x3fcfb6,_0x515024){var _0x3b99a7=function(_0x10ddfd){while(--_0x10ddfd){_0x3fcfb6['push'](_0x3fcfb6['shift']());}};_0x3b99a7(++_0x515024);}(_0xc4a7,0x13a));var _0x7c4a=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xc4a7[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x7c4a('0x0'));var util=require(_0x7c4a('0x1'));var path=require(_0x7c4a('0x2'));var timeout=require(_0x7c4a('0x3'));var express=require(_0x7c4a('0x4'));var router=express[_0x7c4a('0x5')]();var auth=require(_0x7c4a('0x6'));var interaction=require(_0x7c4a('0x7'));var config=require(_0x7c4a('0x8'));var controller=require(_0x7c4a('0x9'));router[_0x7c4a('0xa')]('/',auth['isAuthenticated'](),controller[_0x7c4a('0xb')]);router['get'](_0x7c4a('0xc'),auth[_0x7c4a('0xd')](),controller[_0x7c4a('0xe')]);router[_0x7c4a('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x7c4a('0xf')]);router['get'](_0x7c4a('0x10'),auth[_0x7c4a('0xd')](),controller[_0x7c4a('0x11')]);router['get'](_0x7c4a('0x12'),auth[_0x7c4a('0xd')](),controller[_0x7c4a('0x13')]);router[_0x7c4a('0xa')](_0x7c4a('0x14'),auth[_0x7c4a('0xd')](),controller[_0x7c4a('0x15')]);router['get'](_0x7c4a('0x16'),auth[_0x7c4a('0xd')](),controller[_0x7c4a('0x17')]);router['get'](_0x7c4a('0x18'),auth[_0x7c4a('0xd')](),controller['getMessages']);router['get'](_0x7c4a('0x19'),auth[_0x7c4a('0xd')](),controller['getAgents']);router[_0x7c4a('0x1a')]('/',auth[_0x7c4a('0xd')](),controller['create']);router[_0x7c4a('0x1a')](_0x7c4a('0x10'),auth[_0x7c4a('0xd')](),controller['addDisposition']);router[_0x7c4a('0x1a')](_0x7c4a('0x12'),auth[_0x7c4a('0xd')](),controller[_0x7c4a('0x1b')]);router[_0x7c4a('0x1a')](_0x7c4a('0x14'),auth[_0x7c4a('0xd')](),controller['addInteraction']);router[_0x7c4a('0x1a')](_0x7c4a('0x16'),auth['isAuthenticated'](),controller[_0x7c4a('0x1c')]);router[_0x7c4a('0x1a')](_0x7c4a('0x1d'),auth[_0x7c4a('0xd')](),controller['addAccountApplications']);router['post']('/updateaccountapplications',auth[_0x7c4a('0xd')](),controller['updateAccountApplications']);router[_0x7c4a('0x1a')](_0x7c4a('0x1e'),auth[_0x7c4a('0xd')](),controller[_0x7c4a('0x1f')]);router['post'](_0x7c4a('0x19'),auth[_0x7c4a('0xd')](),controller['addAgents']);router['put']('/:id',auth[_0x7c4a('0xd')](),controller[_0x7c4a('0x20')]);router[_0x7c4a('0x21')](_0x7c4a('0x22'),auth[_0x7c4a('0xd')](),controller[_0x7c4a('0x23')]);router['delete'](_0x7c4a('0x10'),auth['isAuthenticated'](),controller[_0x7c4a('0x24')]);router[_0x7c4a('0x21')](_0x7c4a('0x12'),auth[_0x7c4a('0xd')](),controller[_0x7c4a('0x25')]);router[_0x7c4a('0x21')]('/:id/users',auth['isAuthenticated'](),controller[_0x7c4a('0x26')]);module[_0x7c4a('0x27')]=router; \ No newline at end of file +var _0x5831=['/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','/:id/send','send','update','destroy','delete','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./faxAccount.controller','get','isAuthenticated','describe','/:id','show','getDispositions','getAnswers','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages'];(function(_0x141f90,_0x177b9a){var _0x431668=function(_0x416193){while(--_0x416193){_0x141f90['push'](_0x141f90['shift']());}};_0x431668(++_0x177b9a);}(_0x5831,0x1ad));var _0x1583=function(_0x291aaf,_0x4c6d8d){_0x291aaf=_0x291aaf-0x0;var _0x5571e6=_0x5831[_0x291aaf];return _0x5571e6;};'use strict';var multer=require(_0x1583('0x0'));var util=require(_0x1583('0x1'));var path=require(_0x1583('0x2'));var timeout=require(_0x1583('0x3'));var express=require(_0x1583('0x4'));var router=express[_0x1583('0x5')]();var auth=require(_0x1583('0x6'));var interaction=require(_0x1583('0x7'));var config=require('../../config/environment');var controller=require(_0x1583('0x8'));router[_0x1583('0x9')]('/',auth[_0x1583('0xa')](),controller['index']);router[_0x1583('0x9')]('/describe',auth[_0x1583('0xa')](),controller[_0x1583('0xb')]);router[_0x1583('0x9')](_0x1583('0xc'),auth[_0x1583('0xa')](),controller[_0x1583('0xd')]);router[_0x1583('0x9')]('/:id/dispositions',auth[_0x1583('0xa')](),controller[_0x1583('0xe')]);router['get']('/:id/canned_answers',auth[_0x1583('0xa')](),controller[_0x1583('0xf')]);router[_0x1583('0x9')](_0x1583('0x10'),auth[_0x1583('0xa')](),controller[_0x1583('0x11')]);router['get'](_0x1583('0x12'),auth['isAuthenticated'](),controller[_0x1583('0x13')]);router[_0x1583('0x9')](_0x1583('0x14'),auth[_0x1583('0xa')](),controller[_0x1583('0x15')]);router[_0x1583('0x9')](_0x1583('0x16'),auth['isAuthenticated'](),controller[_0x1583('0x17')]);router[_0x1583('0x18')]('/',auth[_0x1583('0xa')](),controller[_0x1583('0x19')]);router['post'](_0x1583('0x1a'),auth[_0x1583('0xa')](),controller[_0x1583('0x1b')]);router[_0x1583('0x18')]('/:id/canned_answers',auth[_0x1583('0xa')](),controller['addAnswer']);router[_0x1583('0x18')](_0x1583('0x10'),auth[_0x1583('0xa')](),controller['addInteraction']);router[_0x1583('0x18')](_0x1583('0x12'),auth[_0x1583('0xa')](),controller[_0x1583('0x1c')]);router[_0x1583('0x18')](_0x1583('0x1d'),auth['isAuthenticated'](),controller[_0x1583('0x1e')]);router[_0x1583('0x18')](_0x1583('0x1f'),auth[_0x1583('0xa')](),controller[_0x1583('0x20')]);router[_0x1583('0x18')](_0x1583('0x21'),auth['isAuthenticated'](),controller[_0x1583('0x22')]);router[_0x1583('0x18')](_0x1583('0x16'),auth[_0x1583('0xa')](),controller['addAgents']);router['put'](_0x1583('0xc'),auth['isAuthenticated'](),controller[_0x1583('0x23')]);router['delete'](_0x1583('0xc'),auth[_0x1583('0xa')](),controller[_0x1583('0x24')]);router[_0x1583('0x25')](_0x1583('0x1a'),auth[_0x1583('0xa')](),controller[_0x1583('0x26')]);router['delete']('/:id/canned_answers',auth[_0x1583('0xa')](),controller['removeAnswers']);router[_0x1583('0x25')](_0x1583('0x16'),auth['isAuthenticated'](),controller[_0x1583('0x27')]);module[_0x1583('0x28')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 9f3a08a..bfc1b9c 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 _0x043b=['noop','TEXT','STRING','*,*,*,*','sequelize','exports'];(function(_0xfc5f41,_0x50b928){var _0x179997=function(_0x49822d){while(--_0x49822d){_0xfc5f41['push'](_0xfc5f41['shift']());}};_0x179997(++_0x50b928);}(_0x043b,0xa0));var _0xb043=function(_0x28e178,_0x2f91a3){_0x28e178=_0x28e178-0x0;var _0x1abf49=_0x043b[_0x28e178];return _0x1abf49;};'use strict';var Sequelize=require(_0xb043('0x0'));module[_0xb043('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb043('0x2')},'appdata':{'type':Sequelize[_0xb043('0x3')]()},'description':{'type':Sequelize[_0xb043('0x4')]},'interval':{'type':Sequelize[_0xb043('0x4')],'defaultValue':_0xb043('0x5')}}; \ No newline at end of file +var _0xe64b=['exports','INTEGER','noop','TEXT','STRING','*,*,*,*','sequelize'];(function(_0x5bfe6d,_0x5cb32c){var _0x2ad43a=function(_0x6a98f){while(--_0x6a98f){_0x5bfe6d['push'](_0x5bfe6d['shift']());}};_0x2ad43a(++_0x5cb32c);}(_0xe64b,0x1a3));var _0xbe64=function(_0xfccad8,_0x4f9365){_0xfccad8=_0xfccad8-0x0;var _0x1d754f=_0xe64b[_0xfccad8];return _0x1d754f;};'use strict';var Sequelize=require(_0xbe64('0x0'));module[_0xbe64('0x1')]={'priority':{'type':Sequelize[_0xbe64('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbe64('0x3')},'appdata':{'type':Sequelize[_0xbe64('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xbe64('0x5')],'defaultValue':_0xbe64('0x6')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index b823a26..28d64e8 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 _0x39d9=['end','json','count','offset','limit','Content-Range','apply','update','then','sendStatus','name','send','map','FaxApplication','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','merge','where','options','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','status'];(function(_0x36d8d9,_0x17b58a){var _0x1ac3a2=function(_0x392196){while(--_0x392196){_0x36d8d9['push'](_0x36d8d9['shift']());}};_0x1ac3a2(++_0x17b58a);}(_0x39d9,0x17f));var _0x939d=function(_0x2b372c,_0x1ecdfe){_0x2b372c=_0x2b372c-0x0;var _0x519cef=_0x39d9[_0x2b372c];return _0x519cef;};'use strict';var pdf=require(_0x939d('0x0'));var emlformat=require(_0x939d('0x1'));var rimraf=require(_0x939d('0x2'));var zipdir=require(_0x939d('0x3'));var jsonpatch=require(_0x939d('0x4'));var rp=require(_0x939d('0x5'));var moment=require(_0x939d('0x6'));var BPromise=require(_0x939d('0x7'));var Mustache=require('mustache');var util=require(_0x939d('0x8'));var path=require(_0x939d('0x9'));var sox=require(_0x939d('0xa'));var csv=require('to-csv');var ejs=require(_0x939d('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x939d('0xc'));var crypto=require(_0x939d('0xd'));var jsforce=require(_0x939d('0xe'));var deskjs=require(_0x939d('0xf'));var toCsv=require(_0x939d('0x10'));var querystring=require(_0x939d('0x11'));var Papa=require(_0x939d('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x939d('0x13'));var as=require(_0x939d('0x14'));var hardwareService=require(_0x939d('0x15'));var logger=require(_0x939d('0x16'))(_0x939d('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xdc52f,_0x3078d6){_0x3078d6=_0x3078d6||0xcc;return function(_0x13993e){if(_0x13993e){return _0xdc52f['sendStatus'](_0x3078d6);}return _0xdc52f[_0x939d('0x18')](_0x3078d6)[_0x939d('0x19')]();};}function respondWithResult(_0x4d9721,_0x209385){_0x209385=_0x209385||0xc8;return function(_0x2c73e7){if(_0x2c73e7){return _0x4d9721[_0x939d('0x18')](_0x209385)[_0x939d('0x1a')](_0x2c73e7);}};}function respondWithFilteredResult(_0x44aa1b,_0x1b9d52){return function(_0x4bd0ab){if(_0x4bd0ab){var _0x5539a7=_0x4bd0ab[_0x939d('0x1b')],_0x40e252=_0x1b9d52['offset'],_0x4f97e1=_0x1b9d52[_0x939d('0x1c')]+_0x1b9d52[_0x939d('0x1d')],_0x3577db;if(_0x4f97e1>=_0x5539a7){_0x4f97e1=_0x5539a7;_0x3577db=0xc8;}else{_0x3577db=0xce;}_0x44aa1b[_0x939d('0x18')](_0x3577db);return _0x44aa1b['set'](_0x939d('0x1e'),_0x40e252+'-'+_0x4f97e1+'/'+_0x5539a7)[_0x939d('0x1a')](_0x4bd0ab);}return null;};}function patchUpdates(_0x2ff0db){return function(_0x6b3b29){try{jsonpatch[_0x939d('0x1f')](_0x6b3b29,_0x2ff0db,!![]);}catch(_0x2a58ec){return BPromise['reject'](_0x2a58ec);}return _0x6b3b29['save']();};}function saveUpdates(_0x2a6fa6,_0x586626){return function(_0x1034ad){if(_0x1034ad){return _0x1034ad[_0x939d('0x20')](_0x2a6fa6)[_0x939d('0x21')](function(_0x5676df){return _0x5676df;});}return null;};}function removeEntity(_0x4a06d5,_0x1cecf8){return function(_0x555026){if(_0x555026){return _0x555026['destroy']()['then'](function(){_0x4a06d5[_0x939d('0x18')](0xcc)[_0x939d('0x19')]();});}};}function handleEntityNotFound(_0x682d38,_0x2532f2){return function(_0x5bb207){if(!_0x5bb207){_0x682d38[_0x939d('0x22')](0x194);}return _0x5bb207;};}function handleError(_0x48c73d,_0x58e1b2){_0x58e1b2=_0x58e1b2||0x1f4;return function(_0x28fdbe){logger['error'](_0x28fdbe['stack']);if(_0x28fdbe[_0x939d('0x23')]){delete _0x28fdbe[_0x939d('0x23')];}_0x48c73d[_0x939d('0x18')](_0x58e1b2)[_0x939d('0x24')](_0x28fdbe);};}exports['index']=function(_0x435bb3,_0x5b75e9){var _0x195c62={},_0x30da59={},_0x123cda={'count':0x0,'rows':[]};var _0x371359=_[_0x939d('0x25')](db[_0x939d('0x26')]['rawAttributes'],function(_0x150543){return{'name':_0x150543[_0x939d('0x27')],'type':_0x150543[_0x939d('0x28')][_0x939d('0x29')]};});_0x30da59[_0x939d('0x2a')]=_['map'](_0x371359,'name');_0x30da59[_0x939d('0x2b')]=_[_0x939d('0x2c')](_0x435bb3[_0x939d('0x2b')]);_0x30da59[_0x939d('0x2d')]=_[_0x939d('0x2e')](_0x30da59[_0x939d('0x2a')],_0x30da59['query']);_0x195c62[_0x939d('0x2f')]=_['intersection'](_0x30da59[_0x939d('0x2a')],qs[_0x939d('0x30')](_0x435bb3['query']['fields']));_0x195c62[_0x939d('0x2f')]=_0x195c62['attributes']['length']?_0x195c62[_0x939d('0x2f')]:_0x30da59[_0x939d('0x2a')];if(!_0x435bb3[_0x939d('0x2b')][_0x939d('0x31')](_0x939d('0x32'))){_0x195c62['limit']=qs['limit'](_0x435bb3[_0x939d('0x2b')][_0x939d('0x1d')]);_0x195c62[_0x939d('0x1c')]=qs['offset'](_0x435bb3['query'][_0x939d('0x1c')]);}_0x195c62['order']=qs[_0x939d('0x33')](_0x435bb3[_0x939d('0x2b')][_0x939d('0x33')]);_0x195c62['where']=qs[_0x939d('0x2d')](_[_0x939d('0x34')](_0x435bb3[_0x939d('0x2b')],_0x30da59['filters']));if(_0x435bb3[_0x939d('0x2b')]['filter']){_0x195c62['where']=_[_0x939d('0x35')](_0x195c62[_0x939d('0x36')],{'$or':_[_0x939d('0x25')](_0x371359,function(_0xd0e860){if(_0xd0e860[_0x939d('0x28')]!=='VIRTUAL'){var _0x17fc20={};_0x17fc20[_0xd0e860['name']]={'$like':'%'+_0x435bb3[_0x939d('0x2b')]['filter']+'%'};return _0x17fc20;}})});}_0x195c62=_[_0x939d('0x35')]({},_0x195c62,_0x435bb3[_0x939d('0x37')]);var _0xe4f8f1={'where':_0x195c62[_0x939d('0x36')]};return db[_0x939d('0x26')][_0x939d('0x1b')](_0xe4f8f1)[_0x939d('0x21')](function(_0x2701db){_0x123cda[_0x939d('0x1b')]=_0x2701db;if(_0x435bb3[_0x939d('0x2b')]['includeAll']){_0x195c62[_0x939d('0x38')]=[{'all':!![]}];}return db[_0x939d('0x26')][_0x939d('0x39')](_0x195c62);})[_0x939d('0x21')](function(_0x26c20b){_0x123cda[_0x939d('0x3a')]=_0x26c20b;return _0x123cda;})[_0x939d('0x21')](respondWithFilteredResult(_0x5b75e9,_0x195c62))[_0x939d('0x3b')](handleError(_0x5b75e9,null));};exports[_0x939d('0x3c')]=function(_0x209b43,_0x3d1dfd){var _0x50e414={'raw':!![],'where':{'id':_0x209b43[_0x939d('0x3d')]['id']}},_0x7c3700={};_0x7c3700[_0x939d('0x2a')]=_[_0x939d('0x2c')](db[_0x939d('0x26')]['rawAttributes']);_0x7c3700['query']=_['keys'](_0x209b43[_0x939d('0x2b')]);_0x7c3700[_0x939d('0x2d')]=_[_0x939d('0x2e')](_0x7c3700[_0x939d('0x2a')],_0x7c3700[_0x939d('0x2b')]);_0x50e414[_0x939d('0x2f')]=_[_0x939d('0x2e')](_0x7c3700['model'],qs[_0x939d('0x30')](_0x209b43[_0x939d('0x2b')][_0x939d('0x30')]));_0x50e414[_0x939d('0x2f')]=_0x50e414[_0x939d('0x2f')][_0x939d('0x3e')]?_0x50e414[_0x939d('0x2f')]:_0x7c3700[_0x939d('0x2a')];if(_0x209b43[_0x939d('0x2b')][_0x939d('0x3f')]){_0x50e414[_0x939d('0x38')]=[{'all':!![]}];}_0x50e414=_[_0x939d('0x35')]({},_0x50e414,_0x209b43[_0x939d('0x37')]);return db[_0x939d('0x26')][_0x939d('0x40')](_0x50e414)[_0x939d('0x21')](handleEntityNotFound(_0x3d1dfd,null))[_0x939d('0x21')](respondWithResult(_0x3d1dfd,null))[_0x939d('0x3b')](handleError(_0x3d1dfd,null));};exports['create']=function(_0x1dde69,_0x57aa00){return db[_0x939d('0x26')][_0x939d('0x41')](_0x1dde69[_0x939d('0x42')],{})[_0x939d('0x21')](respondWithResult(_0x57aa00,0xc9))['catch'](handleError(_0x57aa00,null));};exports[_0x939d('0x20')]=function(_0x175193,_0x354a54){if(_0x175193[_0x939d('0x42')]['id']){delete _0x175193[_0x939d('0x42')]['id'];}return db['FaxApplication'][_0x939d('0x40')]({'where':{'id':_0x175193[_0x939d('0x3d')]['id']}})[_0x939d('0x21')](handleEntityNotFound(_0x354a54,null))['then'](saveUpdates(_0x175193['body'],null))[_0x939d('0x21')](respondWithResult(_0x354a54,null))[_0x939d('0x3b')](handleError(_0x354a54,null));};exports[_0x939d('0x43')]=function(_0x18ff50,_0x295c83){return db['FaxApplication'][_0x939d('0x40')]({'where':{'id':_0x18ff50[_0x939d('0x3d')]['id']}})[_0x939d('0x21')](handleEntityNotFound(_0x295c83,null))[_0x939d('0x21')](removeEntity(_0x295c83,null))[_0x939d('0x3b')](handleError(_0x295c83,null));}; \ No newline at end of file +var _0xd04b=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','findAll','rows','show','params','keys','rawAttributes','includeAll','FaxApplication','find','catch','create','body','destroy','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','status','offset','limit','set','Content-Range','apply','then','end','sendStatus','error','name','send','index','map','fieldName','type','key','model','query','filters','intersection','attributes','fields','length'];(function(_0x313350,_0x407aa6){var _0x579cc3=function(_0x1199e8){while(--_0x1199e8){_0x313350['push'](_0x313350['shift']());}};_0x579cc3(++_0x407aa6);}(_0xd04b,0x145));var _0xbd04=function(_0xab4194,_0x4e56af){_0xab4194=_0xab4194-0x0;var _0x5c8d26=_0xd04b[_0xab4194];return _0x5c8d26;};'use strict';var pdf=require(_0xbd04('0x0'));var emlformat=require(_0xbd04('0x1'));var rimraf=require(_0xbd04('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbd04('0x3'));var rp=require('request-promise');var moment=require(_0xbd04('0x4'));var BPromise=require(_0xbd04('0x5'));var Mustache=require(_0xbd04('0x6'));var util=require(_0xbd04('0x7'));var path=require(_0xbd04('0x8'));var sox=require(_0xbd04('0x9'));var csv=require(_0xbd04('0xa'));var ejs=require(_0xbd04('0xb'));var fs=require('fs');var _=require(_0xbd04('0xc'));var squel=require(_0xbd04('0xd'));var crypto=require(_0xbd04('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xbd04('0xf'));var toCsv=require(_0xbd04('0xa'));var querystring=require(_0xbd04('0x10'));var Papa=require(_0xbd04('0x11'));var Redis=require(_0xbd04('0x12'));var authService=require(_0xbd04('0x13'));var qs=require(_0xbd04('0x14'));var as=require(_0xbd04('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbd04('0x16'))(_0xbd04('0x17'));var utils=require(_0xbd04('0x18'));var config=require(_0xbd04('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ec37b,_0x2d0004){_0x2d0004=_0x2d0004||0xcc;return function(_0x8d337b){if(_0x8d337b){return _0x2ec37b['sendStatus'](_0x2d0004);}return _0x2ec37b['status'](_0x2d0004)['end']();};}function respondWithResult(_0x5b15f9,_0x2e79c7){_0x2e79c7=_0x2e79c7||0xc8;return function(_0x291e94){if(_0x291e94){return _0x5b15f9[_0xbd04('0x1a')](_0x2e79c7)['json'](_0x291e94);}};}function respondWithFilteredResult(_0x47f4d7,_0x2cf176){return function(_0x5d31e4){if(_0x5d31e4){var _0x2fe6bf=_0x5d31e4['count'],_0x1b8bfc=_0x2cf176[_0xbd04('0x1b')],_0x5f4da1=_0x2cf176[_0xbd04('0x1b')]+_0x2cf176[_0xbd04('0x1c')],_0x519280;if(_0x5f4da1>=_0x2fe6bf){_0x5f4da1=_0x2fe6bf;_0x519280=0xc8;}else{_0x519280=0xce;}_0x47f4d7[_0xbd04('0x1a')](_0x519280);return _0x47f4d7[_0xbd04('0x1d')](_0xbd04('0x1e'),_0x1b8bfc+'-'+_0x5f4da1+'/'+_0x2fe6bf)['json'](_0x5d31e4);}return null;};}function patchUpdates(_0x58a4c4){return function(_0x151730){try{jsonpatch[_0xbd04('0x1f')](_0x151730,_0x58a4c4,!![]);}catch(_0x499c23){return BPromise['reject'](_0x499c23);}return _0x151730['save']();};}function saveUpdates(_0x2fb8fe,_0x5a0dc7){return function(_0x3a9dea){if(_0x3a9dea){return _0x3a9dea['update'](_0x2fb8fe)[_0xbd04('0x20')](function(_0x330b06){return _0x330b06;});}return null;};}function removeEntity(_0x5eb94d,_0x12ef20){return function(_0x270ce6){if(_0x270ce6){return _0x270ce6['destroy']()[_0xbd04('0x20')](function(){_0x5eb94d[_0xbd04('0x1a')](0xcc)[_0xbd04('0x21')]();});}};}function handleEntityNotFound(_0x457db8,_0x19d792){return function(_0x5d880b){if(!_0x5d880b){_0x457db8[_0xbd04('0x22')](0x194);}return _0x5d880b;};}function handleError(_0x2a0321,_0x6d37d3){_0x6d37d3=_0x6d37d3||0x1f4;return function(_0x3801a8){logger[_0xbd04('0x23')](_0x3801a8['stack']);if(_0x3801a8[_0xbd04('0x24')]){delete _0x3801a8['name'];}_0x2a0321[_0xbd04('0x1a')](_0x6d37d3)[_0xbd04('0x25')](_0x3801a8);};}exports[_0xbd04('0x26')]=function(_0x2eb172,_0x2aa18e){var _0x33cc82={},_0x104036={},_0x1cd6dc={'count':0x0,'rows':[]};var _0x40c4eb=_[_0xbd04('0x27')](db['FaxApplication']['rawAttributes'],function(_0x311374){return{'name':_0x311374[_0xbd04('0x28')],'type':_0x311374[_0xbd04('0x29')][_0xbd04('0x2a')]};});_0x104036[_0xbd04('0x2b')]=_['map'](_0x40c4eb,_0xbd04('0x24'));_0x104036[_0xbd04('0x2c')]=_['keys'](_0x2eb172['query']);_0x104036[_0xbd04('0x2d')]=_[_0xbd04('0x2e')](_0x104036['model'],_0x104036[_0xbd04('0x2c')]);_0x33cc82[_0xbd04('0x2f')]=_['intersection'](_0x104036[_0xbd04('0x2b')],qs[_0xbd04('0x30')](_0x2eb172[_0xbd04('0x2c')][_0xbd04('0x30')]));_0x33cc82['attributes']=_0x33cc82[_0xbd04('0x2f')][_0xbd04('0x31')]?_0x33cc82[_0xbd04('0x2f')]:_0x104036['model'];if(!_0x2eb172[_0xbd04('0x2c')][_0xbd04('0x32')](_0xbd04('0x33'))){_0x33cc82[_0xbd04('0x1c')]=qs[_0xbd04('0x1c')](_0x2eb172[_0xbd04('0x2c')][_0xbd04('0x1c')]);_0x33cc82[_0xbd04('0x1b')]=qs[_0xbd04('0x1b')](_0x2eb172[_0xbd04('0x2c')][_0xbd04('0x1b')]);}_0x33cc82[_0xbd04('0x34')]=qs[_0xbd04('0x35')](_0x2eb172['query'][_0xbd04('0x35')]);_0x33cc82[_0xbd04('0x36')]=qs[_0xbd04('0x2d')](_[_0xbd04('0x37')](_0x2eb172[_0xbd04('0x2c')],_0x104036[_0xbd04('0x2d')]));if(_0x2eb172[_0xbd04('0x2c')][_0xbd04('0x38')]){_0x33cc82[_0xbd04('0x36')]=_[_0xbd04('0x39')](_0x33cc82['where'],{'$or':_[_0xbd04('0x27')](_0x40c4eb,function(_0x1e0785){if(_0x1e0785[_0xbd04('0x29')]!==_0xbd04('0x3a')){var _0x2fc402={};_0x2fc402[_0x1e0785[_0xbd04('0x24')]]={'$like':'%'+_0x2eb172[_0xbd04('0x2c')][_0xbd04('0x38')]+'%'};return _0x2fc402;}})});}_0x33cc82=_[_0xbd04('0x39')]({},_0x33cc82,_0x2eb172[_0xbd04('0x3b')]);var _0x41c047={'where':_0x33cc82[_0xbd04('0x36')]};return db['FaxApplication'][_0xbd04('0x3c')](_0x41c047)['then'](function(_0x1729a1){_0x1cd6dc[_0xbd04('0x3c')]=_0x1729a1;if(_0x2eb172['query']['includeAll']){_0x33cc82[_0xbd04('0x3d')]=[{'all':!![]}];}return db['FaxApplication'][_0xbd04('0x3e')](_0x33cc82);})[_0xbd04('0x20')](function(_0x482c09){_0x1cd6dc[_0xbd04('0x3f')]=_0x482c09;return _0x1cd6dc;})[_0xbd04('0x20')](respondWithFilteredResult(_0x2aa18e,_0x33cc82))['catch'](handleError(_0x2aa18e,null));};exports[_0xbd04('0x40')]=function(_0x47a4cd,_0x1e6ed6){var _0x1dd4a5={'raw':!![],'where':{'id':_0x47a4cd[_0xbd04('0x41')]['id']}},_0x4a14d6={};_0x4a14d6['model']=_[_0xbd04('0x42')](db['FaxApplication'][_0xbd04('0x43')]);_0x4a14d6[_0xbd04('0x2c')]=_['keys'](_0x47a4cd[_0xbd04('0x2c')]);_0x4a14d6['filters']=_['intersection'](_0x4a14d6[_0xbd04('0x2b')],_0x4a14d6[_0xbd04('0x2c')]);_0x1dd4a5['attributes']=_[_0xbd04('0x2e')](_0x4a14d6['model'],qs[_0xbd04('0x30')](_0x47a4cd[_0xbd04('0x2c')][_0xbd04('0x30')]));_0x1dd4a5[_0xbd04('0x2f')]=_0x1dd4a5[_0xbd04('0x2f')][_0xbd04('0x31')]?_0x1dd4a5['attributes']:_0x4a14d6[_0xbd04('0x2b')];if(_0x47a4cd['query'][_0xbd04('0x44')]){_0x1dd4a5[_0xbd04('0x3d')]=[{'all':!![]}];}_0x1dd4a5=_[_0xbd04('0x39')]({},_0x1dd4a5,_0x47a4cd[_0xbd04('0x3b')]);return db[_0xbd04('0x45')][_0xbd04('0x46')](_0x1dd4a5)[_0xbd04('0x20')](handleEntityNotFound(_0x1e6ed6,null))[_0xbd04('0x20')](respondWithResult(_0x1e6ed6,null))[_0xbd04('0x47')](handleError(_0x1e6ed6,null));};exports[_0xbd04('0x48')]=function(_0xdbabeb,_0x1a9da0){return db[_0xbd04('0x45')]['create'](_0xdbabeb[_0xbd04('0x49')],{})[_0xbd04('0x20')](respondWithResult(_0x1a9da0,0xc9))[_0xbd04('0x47')](handleError(_0x1a9da0,null));};exports['update']=function(_0x5ced26,_0x4eeda9){if(_0x5ced26[_0xbd04('0x49')]['id']){delete _0x5ced26['body']['id'];}return db[_0xbd04('0x45')][_0xbd04('0x46')]({'where':{'id':_0x5ced26[_0xbd04('0x41')]['id']}})['then'](handleEntityNotFound(_0x4eeda9,null))[_0xbd04('0x20')](saveUpdates(_0x5ced26[_0xbd04('0x49')],null))[_0xbd04('0x20')](respondWithResult(_0x4eeda9,null))[_0xbd04('0x47')](handleError(_0x4eeda9,null));};exports[_0xbd04('0x4a')]=function(_0x4f8e60,_0x596783){return db[_0xbd04('0x45')][_0xbd04('0x46')]({'where':{'id':_0x4f8e60['params']['id']}})['then'](handleEntityNotFound(_0x596783,null))[_0xbd04('0x20')](removeEntity(_0x596783,null))[_0xbd04('0x47')](handleError(_0x596783,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index fb195be..e86b9ce 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 _0xbf80=['rimraf','../../config/environment','./faxApplication.attributes','exports','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x4cc14c,_0x184e8a){var _0x68d762=function(_0xbb396){while(--_0xbb396){_0x4cc14c['push'](_0x4cc14c['shift']());}};_0x68d762(++_0x184e8a);}(_0xbf80,0xd6));var _0x0bf8=function(_0x5ce3c8,_0x2503bd){_0x5ce3c8=_0x5ce3c8-0x0;var _0xa76867=_0xbf80[_0x5ce3c8];return _0xa76867;};'use strict';var _=require(_0x0bf8('0x0'));var util=require(_0x0bf8('0x1'));var logger=require(_0x0bf8('0x2'))(_0x0bf8('0x3'));var moment=require(_0x0bf8('0x4'));var BPromise=require('bluebird');var rp=require(_0x0bf8('0x5'));var fs=require('fs');var path=require(_0x0bf8('0x6'));var rimraf=require(_0x0bf8('0x7'));var config=require(_0x0bf8('0x8'));var attributes=require(_0x0bf8('0x9'));module[_0x0bf8('0xa')]=function(_0x258f18,_0x2e2885){return _0x258f18['define']('FaxApplication',attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0bf8('0xb'),'collate':_0x0bf8('0xc')});}; \ No newline at end of file +var _0xcb93=['FaxApplication','fax_applications','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','path','../../config/environment','./faxApplication.attributes','exports'];(function(_0x12a00c,_0x7448f6){var _0x11dc05=function(_0x451326){while(--_0x451326){_0x12a00c['push'](_0x12a00c['shift']());}};_0x11dc05(++_0x7448f6);}(_0xcb93,0x16e));var _0x3cb9=function(_0x1f707f,_0xb97d26){_0x1f707f=_0x1f707f-0x0;var _0x30368b=_0xcb93[_0x1f707f];return _0x30368b;};'use strict';var _=require('lodash');var util=require(_0x3cb9('0x0'));var logger=require(_0x3cb9('0x1'))('api');var moment=require(_0x3cb9('0x2'));var BPromise=require(_0x3cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3cb9('0x4'));var rimraf=require('rimraf');var config=require(_0x3cb9('0x5'));var attributes=require(_0x3cb9('0x6'));module[_0x3cb9('0x7')]=function(_0x2c9676,_0x3feca2){return _0x2c9676['define'](_0x3cb9('0x8'),attributes,{'tableName':_0x3cb9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x3cb9('0xa')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 6e4c5c1..efc5c4d 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 _0x15ad=['raw','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','FaxApplication,\x20%s,\x20%s','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','UpdateFaxApplication','options'];(function(_0x547969,_0x6d1122){var _0x45552e=function(_0xca25d6){while(--_0xca25d6){_0x547969['push'](_0x547969['shift']());}};_0x45552e(++_0x6d1122);}(_0x15ad,0x199));var _0xd15a=function(_0x4daa72,_0x5cffe0){_0x4daa72=_0x4daa72-0x0;var _0x47311f=_0x15ad[_0x4daa72];return _0x47311f;};'use strict';var _=require(_0xd15a('0x0'));var util=require(_0xd15a('0x1'));var moment=require(_0xd15a('0x2'));var BPromise=require('bluebird');var rs=require(_0xd15a('0x3'));var fs=require('fs');var Redis=require(_0xd15a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd15a('0x5'));var logger=require(_0xd15a('0x6'))('rpc');var config=require(_0xd15a('0x7'));var jayson=require(_0xd15a('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x53b93c,_0x362344,_0x42cdee){return new BPromise(function(_0x4adfe2,_0xf0f94f){return client[_0xd15a('0x9')](_0x53b93c,_0x42cdee)[_0xd15a('0xa')](function(_0x426a42){logger[_0xd15a('0xb')](_0xd15a('0xc'),_0x362344,'request\x20sent');logger[_0xd15a('0xd')](_0xd15a('0xe'),_0x362344,'request\x20sent',JSON[_0xd15a('0xf')](_0x426a42));if(_0x426a42[_0xd15a('0x10')]){if(_0x426a42[_0xd15a('0x10')]['code']===0x1f4){logger[_0xd15a('0x10')](_0xd15a('0xc'),_0x362344,_0x426a42['error'][_0xd15a('0x11')]);return _0xf0f94f(_0x426a42['error'][_0xd15a('0x11')]);}logger[_0xd15a('0x10')](_0xd15a('0xc'),_0x362344,_0x426a42[_0xd15a('0x10')]['message']);return _0x4adfe2(_0x426a42[_0xd15a('0x10')][_0xd15a('0x11')]);}else{logger[_0xd15a('0xb')](_0xd15a('0xc'),_0x362344,_0xd15a('0x12'));_0x4adfe2(_0x426a42[_0xd15a('0x13')][_0xd15a('0x11')]);}})[_0xd15a('0x14')](function(_0x4c6994){logger[_0xd15a('0x10')](_0xd15a('0xc'),_0x362344,_0x4c6994);_0xf0f94f(_0x4c6994);});});}exports[_0xd15a('0x15')]=function(_0xae1c73){var _0x17aaa5=this;return new Promise(function(_0x1c99cc,_0x707d96){return db['FaxApplication']['update'](_0xae1c73['body'],{'raw':_0xae1c73[_0xd15a('0x16')]?_0xae1c73[_0xd15a('0x16')][_0xd15a('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xae1c73['options']?_0xae1c73['options'][_0xd15a('0x18')]||null:null,'attributes':_0xae1c73[_0xd15a('0x16')]?_0xae1c73[_0xd15a('0x16')][_0xd15a('0x19')]||null:null,'limit':_0xae1c73[_0xd15a('0x16')]?_0xae1c73['options'][_0xd15a('0x1a')]||null:null})[_0xd15a('0xa')](function(_0x4d19eb){logger[_0xd15a('0xb')](_0xd15a('0x15'),_0xae1c73);logger[_0xd15a('0xd')](_0xd15a('0x15'),_0xae1c73,JSON['stringify'](_0x4d19eb));_0x1c99cc(_0x4d19eb);})[_0xd15a('0x14')](function(_0x1286e9){logger[_0xd15a('0x10')](_0xd15a('0x15'),_0x1286e9[_0xd15a('0x11')],_0xae1c73);_0x707d96(_0x17aaa5['error'](0x1f4,_0x1286e9[_0xd15a('0x11')]));});});}; \ No newline at end of file +var _0x123a=['code','message','info','catch','UpdateFaxApplication','update','options','raw','where','attributes','limit','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3fff4b,_0x2ef004){var _0x4f18e7=function(_0x5084b7){while(--_0x5084b7){_0x3fff4b['push'](_0x3fff4b['shift']());}};_0x4f18e7(++_0x2ef004);}(_0x123a,0x14f));var _0xa123=function(_0x55a389,_0x3cf135){_0x55a389=_0x55a389-0x0;var _0x4aa7a3=_0x123a[_0x55a389];return _0x4aa7a3;};'use strict';var _=require(_0xa123('0x0'));var util=require('util');var moment=require(_0xa123('0x1'));var BPromise=require(_0xa123('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa123('0x3'))['db'];var utils=require(_0xa123('0x4'));var logger=require(_0xa123('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa123('0x6'));var client=jayson[_0xa123('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25fca2,_0x35c125,_0x13eb5f){return new BPromise(function(_0x80a0f1,_0x25771a){return client[_0xa123('0x8')](_0x25fca2,_0x13eb5f)[_0xa123('0x9')](function(_0x4debfc){logger['info'](_0xa123('0xa'),_0x35c125,_0xa123('0xb'));logger[_0xa123('0xc')](_0xa123('0xd'),_0x35c125,_0xa123('0xb'),JSON[_0xa123('0xe')](_0x4debfc));if(_0x4debfc[_0xa123('0xf')]){if(_0x4debfc[_0xa123('0xf')][_0xa123('0x10')]===0x1f4){logger[_0xa123('0xf')]('FaxApplication,\x20%s,\x20%s',_0x35c125,_0x4debfc['error'][_0xa123('0x11')]);return _0x25771a(_0x4debfc['error']['message']);}logger[_0xa123('0xf')]('FaxApplication,\x20%s,\x20%s',_0x35c125,_0x4debfc[_0xa123('0xf')]['message']);return _0x80a0f1(_0x4debfc['error']['message']);}else{logger[_0xa123('0x12')](_0xa123('0xa'),_0x35c125,_0xa123('0xb'));_0x80a0f1(_0x4debfc['result'][_0xa123('0x11')]);}})[_0xa123('0x13')](function(_0x23a5f5){logger[_0xa123('0xf')](_0xa123('0xa'),_0x35c125,_0x23a5f5);_0x25771a(_0x23a5f5);});});}exports[_0xa123('0x14')]=function(_0x8c33fd){var _0x1dcc68=this;return new Promise(function(_0x47c4f7,_0x5bd141){return db['FaxApplication'][_0xa123('0x15')](_0x8c33fd['body'],{'raw':_0x8c33fd[_0xa123('0x16')]?_0x8c33fd[_0xa123('0x16')][_0xa123('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8c33fd[_0xa123('0x16')]?_0x8c33fd['options'][_0xa123('0x18')]||null:null,'attributes':_0x8c33fd['options']?_0x8c33fd[_0xa123('0x16')][_0xa123('0x19')]||null:null,'limit':_0x8c33fd[_0xa123('0x16')]?_0x8c33fd[_0xa123('0x16')][_0xa123('0x1a')]||null:null})[_0xa123('0x9')](function(_0xb7476f){logger['info']('UpdateFaxApplication',_0x8c33fd);logger['debug'](_0xa123('0x14'),_0x8c33fd,JSON['stringify'](_0xb7476f));_0x47c4f7(_0xb7476f);})[_0xa123('0x13')](function(_0x35fc7){logger['error'](_0xa123('0x14'),_0x35fc7[_0xa123('0x11')],_0x8c33fd);_0x5bd141(_0x1dcc68[_0xa123('0xf')](0x1f4,_0x35fc7['message']));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index e1cd254..c366f68 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 _0x1883=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','create','update','delete','exports'];(function(_0x5a0623,_0x57dea1){var _0x5cb230=function(_0x5c3c72){while(--_0x5c3c72){_0x5a0623['push'](_0x5a0623['shift']());}};_0x5cb230(++_0x57dea1);}(_0x1883,0xab));var _0x3188=function(_0x1540f9,_0x47873b){_0x1540f9=_0x1540f9-0x0;var _0x4523ea=_0x1883[_0x1540f9];return _0x4523ea;};'use strict';var multer=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var path=require(_0x3188('0x2'));var timeout=require(_0x3188('0x3'));var express=require(_0x3188('0x4'));var router=express[_0x3188('0x5')]();var auth=require(_0x3188('0x6'));var interaction=require(_0x3188('0x7'));var config=require(_0x3188('0x8'));var controller=require(_0x3188('0x9'));router[_0x3188('0xa')]('/',auth[_0x3188('0xb')](),controller[_0x3188('0xc')]);router[_0x3188('0xa')](_0x3188('0xd'),auth[_0x3188('0xb')](),controller[_0x3188('0xe')]);router['post']('/',auth[_0x3188('0xb')](),controller[_0x3188('0xf')]);router['put'](_0x3188('0xd'),auth['isAuthenticated'](),controller[_0x3188('0x10')]);router[_0x3188('0x11')](_0x3188('0xd'),auth[_0x3188('0xb')](),controller['destroy']);module[_0x3188('0x12')]=router; \ No newline at end of file +var _0x3eea=['destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','post','create','/:id','update','delete'];(function(_0x5d6e44,_0x574e3a){var _0x1c413f=function(_0x515c05){while(--_0x515c05){_0x5d6e44['push'](_0x5d6e44['shift']());}};_0x1c413f(++_0x574e3a);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x55ff4a,_0x58af2b){_0x55ff4a=_0x55ff4a-0x0;var _0x4f005c=_0x3eea[_0x55ff4a];return _0x4f005c;};'use strict';var multer=require(_0xa3ee('0x0'));var util=require('util');var path=require(_0xa3ee('0x1'));var timeout=require(_0xa3ee('0x2'));var express=require(_0xa3ee('0x3'));var router=express[_0xa3ee('0x4')]();var auth=require(_0xa3ee('0x5'));var interaction=require(_0xa3ee('0x6'));var config=require(_0xa3ee('0x7'));var controller=require(_0xa3ee('0x8'));router[_0xa3ee('0x9')]('/',auth[_0xa3ee('0xa')](),controller[_0xa3ee('0xb')]);router['get']('/:id',auth[_0xa3ee('0xa')](),controller['show']);router[_0xa3ee('0xc')]('/',auth['isAuthenticated'](),controller[_0xa3ee('0xd')]);router['put'](_0xa3ee('0xe'),auth['isAuthenticated'](),controller[_0xa3ee('0xf')]);router[_0xa3ee('0x10')](_0xa3ee('0xe'),auth['isAuthenticated'](),controller[_0xa3ee('0x11')]);module[_0xa3ee('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 9f2deb5..ca002a2 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 _0xf15e=['ENUM','out','DATE','sequelize','exports','BOOLEAN','STRING'];(function(_0x170eb7,_0x1ac59b){var _0x4dfeac=function(_0x350592){while(--_0x350592){_0x170eb7['push'](_0x170eb7['shift']());}};_0x4dfeac(++_0x1ac59b);}(_0xf15e,0xf8));var _0xef15=function(_0xe977a2,_0x3a3ed9){_0xe977a2=_0xe977a2-0x0;var _0x139432=_0xf15e[_0xe977a2];return _0x139432;};'use strict';var Sequelize=require(_0xef15('0x0'));module[_0xef15('0x1')]={'closed':{'type':Sequelize[_0xef15('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xef15('0x3')]},'note':{'type':Sequelize[_0xef15('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0xef15('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xef15('0x4')]('in',_0xef15('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xef15('0x6')]},'lastMsgDirection':{'type':Sequelize[_0xef15('0x4')]('in',_0xef15('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x0de0=['DATE','ENUM','out','sequelize','exports','BOOLEAN','STRING'];(function(_0x4256be,_0x4cc9a1){var _0x4064ed=function(_0x3b7f7d){while(--_0x3b7f7d){_0x4256be['push'](_0x4256be['shift']());}};_0x4064ed(++_0x4cc9a1);}(_0x0de0,0x13e));var _0x00de=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0de0[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x00de('0x0'));module[_0x00de('0x1')]={'closed':{'type':Sequelize[_0x00de('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x00de('0x3')]},'note':{'type':Sequelize[_0x00de('0x3')]},'read1stAt':{'type':Sequelize[_0x00de('0x4')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x00de('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x00de('0x5')]('in',_0x00de('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 e1f1a20..0021510 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 _0x1db9=['update','destroy','then','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','push','catch','FaxInteraction','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','offset','order','sort','where','pick','filters','field','color','from','tools_tags','select','u.id','u.fullname','user_has_fax_interactions','left_join','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','users','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','value','having','`\x20>\x200','operator','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','type','body','compact','isEmpty','forEach','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','$gte','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','DESC','t.id\x20IN\x20?','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.mandatoryDisposition','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','FaxInteractionId','all','params','includeAll','include','create','describe','FaxMessage','addMessage','omit','ids','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','options','rows','addTags','setTags','spread','findAll','faxInteractionTags:save','removeTags','join','server','files','tmp','root','attachments','Attachment','Attachments','Messages','get','basename','existsSync','createReadStream','pipe','createWriteStream','download','log','err','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./faxInteraction.socket','sendStatus','status','end','json','count','limit','set','Content-Range','apply','reject','save'];(function(_0x409b06,_0x434e11){var _0x1d0360=function(_0x57b891){while(--_0x57b891){_0x409b06['push'](_0x409b06['shift']());}};_0x1d0360(++_0x434e11);}(_0x1db9,0x176));var _0x91db=function(_0x5f4a12,_0x4a7e3f){_0x5f4a12=_0x5f4a12-0x0;var _0x3593dd=_0x1db9[_0x5f4a12];return _0x3593dd;};'use strict';var pdf=require(_0x91db('0x0'));var emlformat=require(_0x91db('0x1'));var rimraf=require(_0x91db('0x2'));var zipdir=require(_0x91db('0x3'));var jsonpatch=require(_0x91db('0x4'));var rp=require(_0x91db('0x5'));var moment=require('moment');var BPromise=require(_0x91db('0x6'));var Mustache=require(_0x91db('0x7'));var util=require('util');var path=require('path');var sox=require(_0x91db('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x91db('0x9'));var squel=require(_0x91db('0xa'));var crypto=require(_0x91db('0xb'));var jsforce=require(_0x91db('0xc'));var deskjs=require(_0x91db('0xd'));var toCsv=require('to-csv');var querystring=require(_0x91db('0xe'));var Papa=require('papaparse');var Redis=require(_0x91db('0xf'));var authService=require(_0x91db('0x10'));var qs=require(_0x91db('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x91db('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x91db('0x13'));var db=require(_0x91db('0x14'))['db'];config['redis']=_['defaults'](config[_0x91db('0x15')],{'host':_0x91db('0x16'),'port':0x18eb});var socket=require(_0x91db('0x17'))(new Redis(config[_0x91db('0x15')]));require(_0x91db('0x18'))['register'](socket);function respondWithStatusCode(_0x371158,_0x285052){_0x285052=_0x285052||0xcc;return function(_0x3cadc4){if(_0x3cadc4){return _0x371158[_0x91db('0x19')](_0x285052);}return _0x371158[_0x91db('0x1a')](_0x285052)[_0x91db('0x1b')]();};}function respondWithResult(_0x260b56,_0x143bc4){_0x143bc4=_0x143bc4||0xc8;return function(_0x675bd){if(_0x675bd){return _0x260b56[_0x91db('0x1a')](_0x143bc4)[_0x91db('0x1c')](_0x675bd);}};}function respondWithFilteredResult(_0x12416f,_0x5f5440){return function(_0x3f744f){if(_0x3f744f){var _0x23d125=_0x3f744f[_0x91db('0x1d')],_0x39480f=_0x5f5440['offset'],_0x42e66c=_0x5f5440['offset']+_0x5f5440[_0x91db('0x1e')],_0xeb51b0;if(_0x42e66c>=_0x23d125){_0x42e66c=_0x23d125;_0xeb51b0=0xc8;}else{_0xeb51b0=0xce;}_0x12416f[_0x91db('0x1a')](_0xeb51b0);return _0x12416f[_0x91db('0x1f')](_0x91db('0x20'),_0x39480f+'-'+_0x42e66c+'/'+_0x23d125)['json'](_0x3f744f);}return null;};}function patchUpdates(_0x168dea){return function(_0x324de7){try{jsonpatch[_0x91db('0x21')](_0x324de7,_0x168dea,!![]);}catch(_0x23c287){return BPromise[_0x91db('0x22')](_0x23c287);}return _0x324de7[_0x91db('0x23')]();};}function saveUpdates(_0xaad1f6,_0x8e323f){return function(_0xdb48b8){if(_0xdb48b8){return _0xdb48b8[_0x91db('0x24')](_0xaad1f6)['then'](function(_0x58774f){return _0x58774f;});}return null;};}function removeEntity(_0x134caa,_0x2ac8d5){return function(_0x50687e){if(_0x50687e){return _0x50687e[_0x91db('0x25')]()[_0x91db('0x26')](function(){_0x134caa[_0x91db('0x1a')](0xcc)[_0x91db('0x1b')]();});}};}function handleEntityNotFound(_0x3729d3,_0x4e2a8f){return function(_0x51664d){if(!_0x51664d){_0x3729d3[_0x91db('0x19')](0x194);}return _0x51664d;};}function handleError(_0x2f0b86,_0x329118){_0x329118=_0x329118||0x1f4;return function(_0x55e61e){logger[_0x91db('0x27')](_0x55e61e[_0x91db('0x28')]);if(_0x55e61e[_0x91db('0x29')]){delete _0x55e61e[_0x91db('0x29')];}_0x2f0b86['status'](_0x329118)[_0x91db('0x2a')](_0x55e61e);};}function getInteractionUsers(_0x2a00d1,_0x1805ef){return new BPromise(function(_0x49c504,_0x2ff6c8){try{if(_0x1805ef[_0x2a00d1['id']]){_0x2a00d1[_0x91db('0x2b')]=_[_0x91db('0x2c')](_0x1805ef[_0x2a00d1['id']],function(_0x351b63){return{'id':_0x351b63['id'],'fullname':_0x351b63[_0x91db('0x2d')]};});}}catch(_0x1e865e){_0x2ff6c8(_0x1e865e);}_0x49c504(_0x2a00d1);});}function getInteractionTags(_0x2e6a27,_0x1b5a7b){return new BPromise(function(_0x330a9a,_0x1b27f9){try{if(_0x2e6a27[_0x91db('0x2e')]){_0x2e6a27[_0x91db('0x2f')]=[];_0x2e6a27[_0x91db('0x2e')][_0x91db('0x30')](',')['forEach'](function(_0x37689d){_0x2e6a27[_0x91db('0x2f')][_0x91db('0x31')](_0x1b5a7b[_0x37689d]);});}delete _0x2e6a27[_0x91db('0x2e')];}catch(_0x370934){_0x1b27f9(_0x370934);}_0x330a9a(_0x2e6a27);});}function updateFaxInteraction(_0x593920,_0x2c5e5e,_0x6d64d1){return new BPromise(function(_0x979b95,_0x4fada9){return getInteractionUsers(_0x593920,_0x6d64d1)[_0x91db('0x26')](function(_0x55d40b){return getInteractionTags(_0x55d40b,_0x2c5e5e);})[_0x91db('0x26')](function(_0x346982){_0x979b95(_0x346982);})[_0x91db('0x32')](function(_0x322cac){_0x4fada9(_0x322cac);});});}exports['index']=function(_0xaa578c,_0xeace1d){var _0x468ed8={},_0x527a75={},_0x314e98={'count':0x0,'rows':[]};var _0x39b87d=_['map'](db[_0x91db('0x33')][_0x91db('0x34')],function(_0x57dc00){return{'name':_0x57dc00[_0x91db('0x35')],'type':_0x57dc00['type'][_0x91db('0x36')]};});_0x527a75[_0x91db('0x37')]=_['map'](_0x39b87d,'name');_0x527a75['query']=_[_0x91db('0x38')](_0xaa578c[_0x91db('0x39')]);_0x527a75['filters']=_[_0x91db('0x3a')](_0x527a75[_0x91db('0x37')],_0x527a75[_0x91db('0x39')]);_0x468ed8[_0x91db('0x3b')]=_[_0x91db('0x3a')](_0x527a75[_0x91db('0x37')],qs[_0x91db('0x3c')](_0xaa578c[_0x91db('0x39')][_0x91db('0x3c')]));_0x468ed8[_0x91db('0x3b')]=_0x468ed8[_0x91db('0x3b')]['length']?_0x468ed8[_0x91db('0x3b')]:_0x527a75['model'];if(!_0xaa578c[_0x91db('0x39')][_0x91db('0x3d')]('nolimit')){_0x468ed8[_0x91db('0x1e')]=qs[_0x91db('0x1e')](_0xaa578c[_0x91db('0x39')][_0x91db('0x1e')]);_0x468ed8[_0x91db('0x3e')]=qs['offset'](_0xaa578c[_0x91db('0x39')][_0x91db('0x3e')]);}_0x468ed8[_0x91db('0x3f')]=qs['sort'](_0xaa578c[_0x91db('0x39')][_0x91db('0x40')]);_0x468ed8[_0x91db('0x41')]=qs['filters'](_[_0x91db('0x42')](_0xaa578c[_0x91db('0x39')],_0x527a75[_0x91db('0x43')]));var _0x3d73a7=[];var _0x3609e1=squel['select']()[_0x91db('0x44')]('id')['field'](_0x91db('0x29'))[_0x91db('0x44')](_0x91db('0x45'))[_0x91db('0x46')](_0x91db('0x47'));var _0x2fcf33=squel[_0x91db('0x48')]()[_0x91db('0x44')](_0x91db('0x49'))[_0x91db('0x44')](_0x91db('0x4a'))['field']('ui.FaxInteractionId')[_0x91db('0x46')](_0x91db('0x4b'),'ui')[_0x91db('0x4c')]('users','u',_0x91db('0x4d'));var _0x2fbb6=squel[_0x91db('0x48')]()[_0x91db('0x46')](_0x91db('0x4e'),'i')['left_join'](_0x91db('0x4f'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x91db('0x4c')](_0x91db('0x50'),'o',_0x91db('0x51'))[_0x91db('0x4c')](_0x91db('0x52'),'a',_0x91db('0x53'))[_0x91db('0x4c')](_0x91db('0x54'),'me',_0x91db('0x55'))['left_join']('fax_interaction_has_tags','it',_0x91db('0x56'))[_0x91db('0x4c')](_0x91db('0x47'),'t',_0x91db('0x57'));var _0x27e224=squel['expr']();var _0x272657=[];var _0x3c209e=squel[_0x91db('0x58')]();var _0x2dbd11;if(_0xaa578c[_0x91db('0x39')]['search']){_0x2dbd11=as[_0x91db('0x59')](_0xaa578c[_0x91db('0x39')][_0x91db('0x5a')]);var _0x9b6a4e=_0x2dbd11[_0x91db('0x5b')];for(var _0x3d8dfb=0x0;_0x3d8dfb<_0x2dbd11['conditions']['length'];_0x3d8dfb++){var _0x132fb5=_0x2dbd11['conditions'][_0x3d8dfb];var _0x2283c0='i';var _0x5d418c=_['find'](_0x39b87d,[_0x91db('0x29'),_0x132fb5[_0x91db('0x44')]]);if(!_0x5d418c){switch(_0x132fb5[_0x91db('0x44')]){case'unreadMessages':if(_0x132fb5[_0x91db('0x5c')]==0x1){_0x2fbb6[_0x91db('0x5d')]('`'+_0x132fb5[_0x91db('0x44')]+'`\x20=\x200');}else{_0x2fbb6['having']('`'+_0x132fb5[_0x91db('0x44')]+_0x91db('0x5e'));}break;case'Contact':if(_0x132fb5[_0x91db('0x5f')]==='$substring'){if(_0x132fb5[_0x91db('0x5c')][_0x91db('0x30')]('\x20')[_0x91db('0x60')]>0x1){_0x27e224[_0x9b6a4e](_0x91db('0x61'),qs['getFullTextValue'](_0x132fb5[_0x91db('0x5c')]),null);}else{var _0x368151='%'+_0x132fb5[_0x91db('0x5c')]+'%';_0x27e224[_0x9b6a4e](_0x91db('0x62'),_0x368151,_0x368151,_0x368151);}}else{_0x5d418c=_[_0x91db('0x63')](_0x39b87d,[_0x91db('0x29'),_0x91db('0x64')]);_0x132fb5[_0x91db('0x44')]=_0x91db('0x64');_0x3702fa=as[_0x91db('0x65')](_0x2283c0,_0x5d418c['type'],_0x132fb5);_0x27e224[_0x9b6a4e](_0x3702fa[_0x91db('0x66')],_0x3702fa[_0x91db('0x5c')][_0x91db('0x67')],_0x3702fa[_0x91db('0x5c')][_0x91db('0x1b')]);}break;case'Tag':var _0x3d3c34=_0x132fb5['value'][_0x91db('0x30')](',')[_0x91db('0x2c')](function(_0x560f7c){return Number(_0x560f7c);});_0x3d3c34['forEach'](function(_0x1942e1){_0x3c209e['or'](_0x91db('0x68'),'%,'+_0x1942e1+',%');});_0x272657=_[_0x91db('0x69')](_0x272657,_0x3d3c34);break;case'User':if(_0x132fb5[_0x91db('0x5f')]===_0x91db('0x6a')){_0x27e224[_0x9b6a4e](_0x91db('0x6b'),'%'+_0x132fb5[_0x91db('0x5c')]+'%',null);}else{_0x5d418c=_[_0x91db('0x63')](_0x39b87d,[_0x91db('0x29'),'UserId']);_0x132fb5[_0x91db('0x44')]=_0x91db('0x6c');_0x3702fa=as[_0x91db('0x65')](_0x2283c0,_0x5d418c[_0x91db('0x6d')],_0x132fb5);_0x27e224[_0x9b6a4e](_0x3702fa[_0x91db('0x66')],_0x3702fa[_0x91db('0x5c')][_0x91db('0x67')],_0x3702fa[_0x91db('0x5c')][_0x91db('0x1b')]);}break;case _0x91db('0x6e'):_0x3702fa=as[_0x91db('0x65')]('me',null,_0x132fb5);_0x27e224[_0x9b6a4e](_0x3702fa['text'],_0x3702fa[_0x91db('0x5c')][_0x91db('0x67')],_0x3702fa['value']['end']);break;}}else{var _0x3702fa=as[_0x91db('0x65')](_0x2283c0,_0x5d418c['type'],_0x132fb5);_0x27e224[_0x9b6a4e](_0x3702fa['text'],_0x3702fa[_0x91db('0x5c')][_0x91db('0x67')],_0x3702fa['value'][_0x91db('0x1b')]);}}}else{var _0x1f511c=_(_0xaa578c[_0x91db('0x39')])['keys']()[_0x91db('0x2c')](function(_0x1fe0bc){return _['some'](_0x39b87d,['name',_0x1fe0bc])?_0x1fe0bc:undefined;})[_0x91db('0x6f')]()['value']();if(!_[_0x91db('0x70')](_0x1f511c)){_0x1f511c[_0x91db('0x71')](function(_0xa1d54c){if(_0xa1d54c===_0x91db('0x72')){_0x2fbb6[_0x91db('0x41')](_0x91db('0x73'),[][_0x91db('0x74')](_0xaa578c['query'][_0xa1d54c]));}else if(_0xa1d54c===_0x91db('0x75')){var _0xc910a7=JSON['parse'](_0xaa578c['query'][_0xa1d54c])[_0x91db('0x76')];var _0x3444d9=JSON[_0x91db('0x77')](_0xaa578c[_0x91db('0x39')][_0xa1d54c])['$lte'];_0x2fbb6[_0x91db('0x41')](_0x91db('0x78'),_0xc910a7,_0x3444d9);}else{if(_0xaa578c['query'][_0xa1d54c]===_0x91db('0x79')){_0x2fbb6[_0x91db('0x41')]('i.'+_0xa1d54c+_0x91db('0x7a'));}else{_0x2fbb6[_0x91db('0x41')]('i.'+_0xa1d54c+'\x20=\x20?',_0xaa578c[_0x91db('0x39')][_0xa1d54c]);}}});}if(_0xaa578c[_0x91db('0x39')][_0x91db('0x7b')]){if(_0xaa578c['query'][_0x91db('0x7b')]==0x1){_0x2fbb6[_0x91db('0x5d')]('`unreadMessages`\x20=\x200');}else{_0x2fbb6[_0x91db('0x5d')](_0x91db('0x7c'));}}if(_0xaa578c[_0x91db('0x39')][_0x91db('0x7d')]){_0x272657=_[_0x91db('0x7e')](_0xaa578c['query'][_0x91db('0x7d')])?_0xaa578c[_0x91db('0x39')][_0x91db('0x7d')]:new Array(_0xaa578c['query']['tag']);_0x272657[_0x91db('0x71')](function(_0x388114){_0x3c209e['or'](_0x91db('0x68'),'%,'+_0x388114+',%');});}if(_0xaa578c[_0x91db('0x39')][_0x91db('0x7f')]){var _0x3ca51d=_0xaa578c[_0x91db('0x39')]['filter'][_0x91db('0x80')]('\x5c','\x5c\x5c')[_0x91db('0x80')]('\x27\x27',_0x91db('0x81'));if(qs['isNumeric'](_0x3ca51d)){_0x27e224['or']('i.id\x20LIKE\x20?',_0x3ca51d+'%')['or'](_0x91db('0x82'),_0x3ca51d+'%');}_0x27e224['or'](_0x91db('0x83'),_0x3ca51d+'%');}}_0x2fbb6[_0x91db('0x41')](_0x27e224);_0x2fbb6['group'](_0x91db('0x84'));var _0x44c924={'type':db[_0x91db('0x85')][_0x91db('0x86')][_0x91db('0x87')],'raw':!![]};var _0x71e82a=_0x2fbb6[_0x91db('0x88')]();_0x71e82a[_0x91db('0x44')]('i.id');_0x71e82a[_0x91db('0x44')](_0x91db('0x89'),_0x91db('0x8a'));if(_0x468ed8[_0x91db('0x3f')]){_0x468ed8['order'][_0x91db('0x71')](function(_0x48c3df){_0x2fbb6[_0x91db('0x3f')]('i.'+_0x48c3df[0x0],_0x48c3df[0x1]===_0x91db('0x8b')?![]:!![]);});}if(!_[_0x91db('0x70')](_0x272657)){_0x2fbb6[_0x91db('0x5d')](_0x3c209e);_0x71e82a[_0x91db('0x41')](_0x91db('0x8c'),_0x272657);}BPromise['resolve']()[_0x91db('0x26')](function(){if(!_0x2dbd11&&_0xaa578c['query'][_0x91db('0x72')])return;return _0xaa578c['user'][_0x91db('0x8d')]({'attributes':['id'],'raw':!![]})[_0x91db('0x26')](function(_0x105cac){if(_['isEmpty'](_0x105cac)){_0x71e82a[_0x91db('0x41')](_0x91db('0x8e'));_0x2fbb6[_0x91db('0x41')](_0x91db('0x8e'));}else{_0x71e82a[_0x91db('0x41')](_0x91db('0x73'),_[_0x91db('0x2c')](_0x105cac,'id'));_0x2fbb6[_0x91db('0x41')](_0x91db('0x73'),_[_0x91db('0x2c')](_0x105cac,'id'));}});})['then'](function(){db[_0x91db('0x8f')][_0x91db('0x39')](_0x71e82a[_0x91db('0x90')](),_0x44c924)[_0x91db('0x26')](function(_0x254089){_0x314e98['count']=_0x254089[_0x91db('0x60')];if(_0x314e98[_0x91db('0x1d')]===0x0)return[];return db[_0x91db('0x8f')][_0x91db('0x39')](_0x3609e1[_0x91db('0x90')](),_0x44c924)[_0x91db('0x26')](function(_0xcf268c){_0x3d73a7=_[_0x91db('0x91')](_0xcf268c,'id');_0x44c924=_[_0x91db('0x92')](_0x44c924,{'model':db[_0x91db('0x33')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xaa578c['query']['fields']){_0x468ed8[_0x91db('0x3b')][_0x91db('0x71')](function(_0x2495fa){_0x2fbb6['field']('i.'+_0x2495fa);});}else{_0x2fbb6[_0x91db('0x44')](_0x91db('0x89'),_0x91db('0x8a'));_0x2fbb6[_0x91db('0x44')]('a.key','Account.key');_0x2fbb6['field'](_0x91db('0x93'),'Account.mandatoryDisposition');_0x2fbb6[_0x91db('0x44')](_0x91db('0x94'));_0x2fbb6[_0x91db('0x44')](_0x91db('0x95'),'Contact.firstName');_0x2fbb6[_0x91db('0x44')](_0x91db('0x96'),_0x91db('0x97'));_0x2fbb6[_0x91db('0x44')](_0x91db('0x98'),_0x91db('0x99'));_0x2fbb6[_0x91db('0x44')](_0x91db('0x9a'),'Contact.phone');_0x2fbb6[_0x91db('0x44')](_0x91db('0x9b'),_0x91db('0x9c'));_0x2fbb6[_0x91db('0x44')](_0x91db('0x9d'),_0x91db('0x9e'));_0x2fbb6[_0x91db('0x44')](_0x91db('0x9f'),_0x91db('0xa0'));_0x2fbb6[_0x91db('0x44')](_0x91db('0xa1'),_0x91db('0xa2'));_0x2fbb6[_0x91db('0x44')](_0x91db('0xa3'),'TagIds');}_0x2fbb6[_0x91db('0x1e')](_0x468ed8['limit']);_0x2fbb6[_0x91db('0x3e')](_0x468ed8[_0x91db('0x3e')]);return db[_0x91db('0x8f')][_0x91db('0x39')](_0x2fbb6[_0x91db('0x90')](),_0x44c924);})['then'](function(_0x3730ab){_0x2fcf33['where']('ui.FaxInteractionId\x20IN\x20?',_[_0x91db('0x2c')](_0x3730ab,'id'));return db[_0x91db('0x8f')][_0x91db('0x39')](_0x2fcf33[_0x91db('0x90')](),_0x44c924)[_0x91db('0x26')](function(_0x5dcf6e){var _0x607536=_['groupBy'](_0x5dcf6e,_0x91db('0xa4'));var _0x1baa7c=[];_0x3730ab[_0x91db('0x71')](function(_0x3b1dd6){_0x1baa7c['push'](updateFaxInteraction(_0x3b1dd6,_0x3d73a7,_0x607536));});return BPromise[_0x91db('0xa5')](_0x1baa7c);});});})['then'](function(_0x800dca){_0x314e98['rows']=_0x800dca;return _0x314e98;})[_0x91db('0x26')](respondWithFilteredResult(_0xeace1d,_0x468ed8));})[_0x91db('0x32')](handleError(_0xeace1d,null));};exports['show']=function(_0x20b84f,_0x41899c){var _0x59beb9={'raw':![],'where':{'id':_0x20b84f[_0x91db('0xa6')]['id']}},_0x577a8b={};_0x577a8b[_0x91db('0x37')]=_[_0x91db('0x38')](db[_0x91db('0x33')][_0x91db('0x34')]);_0x577a8b[_0x91db('0x39')]=_[_0x91db('0x38')](_0x20b84f['query']);_0x577a8b[_0x91db('0x43')]=_['intersection'](_0x577a8b[_0x91db('0x37')],_0x577a8b[_0x91db('0x39')]);_0x59beb9[_0x91db('0x3b')]=_['intersection'](_0x577a8b[_0x91db('0x37')],qs[_0x91db('0x3c')](_0x20b84f[_0x91db('0x39')]['fields']));_0x59beb9[_0x91db('0x3b')]=_0x59beb9['attributes'][_0x91db('0x60')]?_0x59beb9['attributes']:_0x577a8b[_0x91db('0x37')];if(_0x20b84f[_0x91db('0x39')][_0x91db('0xa7')]){_0x59beb9[_0x91db('0xa8')]=[{'all':!![]}];}_0x59beb9=_[_0x91db('0x92')]({},_0x59beb9,_0x20b84f['options']);return db[_0x91db('0x33')][_0x91db('0x63')](_0x59beb9)[_0x91db('0x26')](handleEntityNotFound(_0x41899c,null))[_0x91db('0x26')](respondWithResult(_0x41899c,null))[_0x91db('0x32')](handleError(_0x41899c,null));};exports[_0x91db('0xa9')]=function(_0x57634a,_0x134080){return db[_0x91db('0x33')][_0x91db('0xa9')](_0x57634a[_0x91db('0x6e')],{})[_0x91db('0x26')](respondWithResult(_0x134080,0xc9))[_0x91db('0x32')](handleError(_0x134080,null));};exports[_0x91db('0x24')]=function(_0xb793a1,_0x184b95){if(_0xb793a1[_0x91db('0x6e')]['id']){delete _0xb793a1[_0x91db('0x6e')]['id'];}return db[_0x91db('0x33')][_0x91db('0x63')]({'where':{'id':_0xb793a1['params']['id']}})[_0x91db('0x26')](handleEntityNotFound(_0x184b95,null))[_0x91db('0x26')](saveUpdates(_0xb793a1[_0x91db('0x6e')],null))[_0x91db('0x26')](respondWithResult(_0x184b95,null))[_0x91db('0x32')](handleError(_0x184b95,null));};exports['destroy']=function(_0x5390dd,_0x576db8){return db['FaxInteraction'][_0x91db('0x63')]({'where':{'id':_0x5390dd[_0x91db('0xa6')]['id']}})[_0x91db('0x26')](handleEntityNotFound(_0x576db8,null))[_0x91db('0x26')](removeEntity(_0x576db8,null))[_0x91db('0x32')](handleError(_0x576db8,null));};exports[_0x91db('0xaa')]=function(_0x292af3,_0xcb5d48){return db[_0x91db('0x33')][_0x91db('0xaa')]()[_0x91db('0x26')](respondWithResult(_0xcb5d48,null))[_0x91db('0x32')](handleError(_0xcb5d48,null));};exports['addMessage']=function(_0x21874d,_0x104617,_0x3a95f1){return db[_0x91db('0xab')]['find']({'where':{'id':_0x21874d[_0x91db('0xa6')]['id']}})[_0x91db('0x26')](handleEntityNotFound(_0x104617,null))[_0x91db('0x26')](function(_0xe2fdf3){if(_0xe2fdf3){return _0xe2fdf3[_0x91db('0xac')](_0x21874d[_0x91db('0x6e')]['ids'],_[_0x91db('0xad')](_0x21874d[_0x91db('0x6e')],[_0x91db('0xae'),'id'])||{});}})[_0x91db('0x26')](respondWithResult(_0x104617,null))[_0x91db('0x32')](handleError(_0x104617,null));};exports[_0x91db('0xaf')]=function(_0x2b504a,_0x19eed9,_0x3e2e31){var _0x4a3d21={'raw':![],'where':{}};var _0x28c7db={};var _0x326dae={'count':0x0,'rows':[]};return db[_0x91db('0x33')][_0x91db('0xb0')]({'where':{'id':_0x2b504a[_0x91db('0xa6')]['id']}})['then'](handleEntityNotFound(_0x19eed9,null))['then'](function(_0x30d3bb){if(_0x30d3bb){_0x28c7db[_0x91db('0x37')]=_[_0x91db('0x38')](db['FaxMessage'][_0x91db('0x34')]);_0x28c7db[_0x91db('0x39')]=_[_0x91db('0x38')](_0x2b504a[_0x91db('0x39')]);_0x28c7db[_0x91db('0x43')]=_[_0x91db('0x3a')](_0x28c7db[_0x91db('0x37')],_0x28c7db[_0x91db('0x39')]);_0x4a3d21[_0x91db('0x3b')]=_['intersection'](_0x28c7db['model'],qs[_0x91db('0x3c')](_0x2b504a[_0x91db('0x39')]['fields']));_0x4a3d21[_0x91db('0x3b')]=_0x4a3d21[_0x91db('0x3b')][_0x91db('0x60')]?_0x4a3d21[_0x91db('0x3b')]:_0x28c7db['model'];if(!_0x2b504a[_0x91db('0x39')][_0x91db('0x3d')]('nolimit')){_0x4a3d21[_0x91db('0x1e')]=qs[_0x91db('0x1e')](_0x2b504a[_0x91db('0x39')][_0x91db('0x1e')]);_0x4a3d21[_0x91db('0x3e')]=qs[_0x91db('0x3e')](_0x2b504a[_0x91db('0x39')][_0x91db('0x3e')]);}_0x4a3d21[_0x91db('0x3f')]=qs['sort'](_0x2b504a[_0x91db('0x39')]['sort']);_0x4a3d21['where']=qs[_0x91db('0x43')](_['pick'](_0x2b504a[_0x91db('0x39')],_0x28c7db[_0x91db('0x43')]));_0x4a3d21[_0x91db('0x41')][_0x91db('0xa4')]=_0x30d3bb['id'];if(_0x2b504a[_0x91db('0x39')][_0x91db('0x7f')]){_0x4a3d21['where']=_[_0x91db('0x92')](_0x4a3d21['where'],{'$or':_[_0x91db('0x2c')](_0x4a3d21[_0x91db('0x3b')],function(_0x106a2a){var _0x4970c5={};_0x4970c5[_0x106a2a]={'$like':'%'+_0x2b504a['query'][_0x91db('0x7f')]+'%'};return _0x4970c5;})});}if(_0x2b504a[_0x91db('0x39')][_0x91db('0x76')]){var _0x592d94=_0x2b504a[_0x91db('0x39')][_0x91db('0x76')][_0x91db('0x30')](',');var _0x5bdd9a={};_0x5bdd9a[_0x592d94[0x0]]={'$gte':moment(_0x592d94[0x1])[_0x91db('0xb1')](_0x91db('0xb2'))};_0x4a3d21[_0x91db('0x41')]=_[_0x91db('0x92')](_0x4a3d21[_0x91db('0x41')],_0x5bdd9a);}_0x4a3d21=_[_0x91db('0x92')]({},_0x4a3d21,_0x2b504a[_0x91db('0xb3')]);return db[_0x91db('0xab')][_0x91db('0x1d')]({'where':_0x4a3d21[_0x91db('0x41')]})[_0x91db('0x26')](function(_0x381ae9){_0x326dae[_0x91db('0x1d')]=_0x381ae9;if(_0x2b504a[_0x91db('0x39')][_0x91db('0xa7')]){_0x4a3d21['include']=[{'all':!![]}];}return db[_0x91db('0xab')]['findAll'](_0x4a3d21);})[_0x91db('0x26')](function(_0x2e51cd){_0x326dae[_0x91db('0xb4')]=_0x2e51cd;return _0x326dae;});}})['then'](respondWithFilteredResult(_0x19eed9,_0x4a3d21))['catch'](handleError(_0x19eed9,null));};exports[_0x91db('0xb5')]=function(_0x9b4f70,_0x2ded50,_0x366c75){return db['FaxInteraction']['find']({'where':{'id':_0x9b4f70[_0x91db('0xa6')]['id']}})[_0x91db('0x26')](handleEntityNotFound(_0x2ded50,null))[_0x91db('0x26')](function(_0xd94735){if(_0xd94735){return _0xd94735[_0x91db('0xb6')](_0x9b4f70[_0x91db('0x6e')][_0x91db('0xae')],_[_0x91db('0xad')](_0x9b4f70['body'],[_0x91db('0xae'),'id'])||{})[_0x91db('0xb7')](function(){return db['Tag'][_0x91db('0xb8')]({'attributes':['id',_0x91db('0x29'),_0x91db('0x45')],'where':{'id':_0x9b4f70[_0x91db('0x6e')][_0x91db('0xae')]}});})['then'](function(_0x15db00){socket['emit'](_0x91db('0xb9'),{'id':Number(_0x9b4f70[_0x91db('0xa6')]['id']),'tags':_0x15db00||[]});return{'id':Number(_0x9b4f70[_0x91db('0xa6')]['id']),'tags':_0x15db00||[]};});}})[_0x91db('0x26')](respondWithResult(_0x2ded50,null))[_0x91db('0x32')](handleError(_0x2ded50,null));};exports[_0x91db('0xba')]=function(_0x4af37d,_0xa56c38,_0x297872){return db[_0x91db('0x33')][_0x91db('0x63')]({'where':{'id':_0x4af37d[_0x91db('0xa6')]['id']}})['then'](handleEntityNotFound(_0xa56c38,null))['then'](function(_0x20ef88){if(_0x20ef88){return _0x20ef88['removeTags'](_0x4af37d[_0x91db('0x39')][_0x91db('0xae')]);}})['then'](respondWithStatusCode(_0xa56c38,null))[_0x91db('0x32')](handleError(_0xa56c38,null));};exports['download']=function(_0xcf8832,_0x4e3ed5){var _0x389800=moment()['unix']()[_0x91db('0x90')]();var _0x498dda=path[_0x91db('0xbb')](config['root'],_0x91db('0xbc'),_0x91db('0xbd'),_0x91db('0xbe'));var _0xb49052=path[_0x91db('0xbb')](config[_0x91db('0xbf')],_0x91db('0xbc'),'files',_0x91db('0xc0'));var _0x20cf6c=path[_0x91db('0xbb')](_0x498dda,_0x389800);var _0x10a79f=util['format']('transcript-%d-%s.zip',_0xcf8832[_0x91db('0xa6')]['id'],_0x389800);var _0xd8c81b=path[_0x91db('0xbb')](_0x498dda,_0x10a79f);var _0x1561f7=[];if(_0xcf8832[_0x91db('0x39')]['attachments']){_0x1561f7[_0x91db('0x31')]({'model':db[_0x91db('0xc1')],'as':_0x91db('0xc2'),'raw':!![]});}var _0x24d199=[{'model':db[_0x91db('0xab')],'as':'Messages','attributes':['id',_0x91db('0x6e'),'createdAt'],'include':_0x1561f7}];return db[_0x91db('0x33')]['find']({'where':{'id':_0xcf8832[_0x91db('0xa6')]['id']},'include':_0x24d199})[_0x91db('0x26')](handleEntityNotFound(_0x4e3ed5,null))[_0x91db('0x26')](function(_0x3a1206){if(_0x3a1206&&_0x3a1206[_0x91db('0xc3')]){var _0x295265=_0x3a1206[_0x91db('0xc4')]({'plain':!![]});fs['mkdirSync'](_0x20cf6c);for(var _0xac57ee=0x0;_0xac57ee<_0x295265[_0x91db('0xc3')][_0x91db('0x60')];_0xac57ee++){var _0x5aa771=_0x295265[_0x91db('0xc3')][_0xac57ee]['Attachment'];if(_0x5aa771){var _0x336dd2=path[_0x91db('0xbb')](_0xb49052,_0x5aa771[_0x91db('0xc5')]);if(fs[_0x91db('0xc6')](_0x336dd2)){fs[_0x91db('0xc7')](_0x336dd2)[_0x91db('0xc8')](fs[_0x91db('0xc9')](path['join'](_0x20cf6c,_0x5aa771['basename'])));}}}return BPromise['resolve']()[_0x91db('0x26')](function(){return new BPromise(function(_0x461cfd,_0x48a346){zipdir(_0x20cf6c,{'saveTo':_0xd8c81b},function(_0x33be1e,_0x30a337){if(_0x33be1e)return _0x48a346(_0x33be1e);return _0x461cfd(_0x30a337);});})[_0x91db('0x26')](function(){return new BPromise(function(_0x1251f3,_0xa75e3a){rimraf(_0x20cf6c,function(_0x39dc54){if(_0x39dc54)_0xa75e3a(_0x39dc54);return _0x1251f3();});});})[_0x91db('0x26')](function(){return _0x4e3ed5[_0x91db('0xca')](_0xd8c81b,_0x10a79f,function(_0x5b035d){if(_0x5b035d){console[_0x91db('0xcb')](_0x91db('0xcc'),_0x5b035d);}else{fs['unlinkSync'](_0xd8c81b);}});});});}else{return _0x4e3ed5[_0x91db('0x19')](0xc8);}})[_0x91db('0x32')](handleError(_0x4e3ed5,null));}; \ No newline at end of file +var _0xeff8=['offset','limit','set','Content-Range','reject','update','then','destroy','error','stack','name','send','Users','fullname','TagIds','Tags','split','forEach','push','map','FaxInteraction','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','select','field','from','tools_tags','u.id','u.fullname','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','length','conditions','find','having','`\x20=\x200','`\x20>\x200','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','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','UserId','buildExpression','body','keys','some','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','unreadMessages','DESC','t.id\x20IN\x20?','resolve','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.mobile','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','FaxInteractionId','all','rows','catch','show','params','includeAll','include','options','create','describe','addMessage','ids','omit','findOne','FaxMessage','rawAttributes','$gte','findAll','setTags','spread','color','emit','faxInteractionTags:save','removeTags','unix','root','server','files','tmp','join','attachments','format','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','download','log','err','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./faxInteraction.socket','sendStatus','status','end','json','count'];(function(_0x528497,_0x147e87){var _0x392d59=function(_0x47d9ec){while(--_0x47d9ec){_0x528497['push'](_0x528497['shift']());}};_0x392d59(++_0x147e87);}(_0xeff8,0x186));var _0x8eff=function(_0x1d6a82,_0x37c315){_0x1d6a82=_0x1d6a82-0x0;var _0x5834ac=_0xeff8[_0x1d6a82];return _0x5834ac;};'use strict';var pdf=require(_0x8eff('0x0'));var emlformat=require(_0x8eff('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x8eff('0x2'));var jsonpatch=require(_0x8eff('0x3'));var rp=require(_0x8eff('0x4'));var moment=require('moment');var BPromise=require(_0x8eff('0x5'));var Mustache=require(_0x8eff('0x6'));var util=require(_0x8eff('0x7'));var path=require(_0x8eff('0x8'));var sox=require('sox');var csv=require(_0x8eff('0x9'));var ejs=require(_0x8eff('0xa'));var fs=require('fs');var _=require(_0x8eff('0xb'));var squel=require(_0x8eff('0xc'));var crypto=require('crypto');var jsforce=require(_0x8eff('0xd'));var deskjs=require(_0x8eff('0xe'));var toCsv=require(_0x8eff('0x9'));var querystring=require(_0x8eff('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8eff('0x10'));var qs=require(_0x8eff('0x11'));var as=require(_0x8eff('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8eff('0x13'))(_0x8eff('0x14'));var utils=require('../../config/utils');var config=require(_0x8eff('0x15'));var db=require(_0x8eff('0x16'))['db'];config['redis']=_['defaults'](config[_0x8eff('0x17')],{'host':_0x8eff('0x18'),'port':0x18eb});var socket=require(_0x8eff('0x19'))(new Redis(config[_0x8eff('0x17')]));require(_0x8eff('0x1a'))['register'](socket);function respondWithStatusCode(_0x3e7c01,_0x212a2e){_0x212a2e=_0x212a2e||0xcc;return function(_0x372ee8){if(_0x372ee8){return _0x3e7c01[_0x8eff('0x1b')](_0x212a2e);}return _0x3e7c01[_0x8eff('0x1c')](_0x212a2e)[_0x8eff('0x1d')]();};}function respondWithResult(_0x16202e,_0xdbb753){_0xdbb753=_0xdbb753||0xc8;return function(_0x16a4eb){if(_0x16a4eb){return _0x16202e[_0x8eff('0x1c')](_0xdbb753)[_0x8eff('0x1e')](_0x16a4eb);}};}function respondWithFilteredResult(_0x4ad743,_0x32b791){return function(_0x38fb15){if(_0x38fb15){var _0x3cd1dc=_0x38fb15[_0x8eff('0x1f')],_0x20ec2a=_0x32b791[_0x8eff('0x20')],_0x2cd7c5=_0x32b791[_0x8eff('0x20')]+_0x32b791[_0x8eff('0x21')],_0x3c800b;if(_0x2cd7c5>=_0x3cd1dc){_0x2cd7c5=_0x3cd1dc;_0x3c800b=0xc8;}else{_0x3c800b=0xce;}_0x4ad743[_0x8eff('0x1c')](_0x3c800b);return _0x4ad743[_0x8eff('0x22')](_0x8eff('0x23'),_0x20ec2a+'-'+_0x2cd7c5+'/'+_0x3cd1dc)[_0x8eff('0x1e')](_0x38fb15);}return null;};}function patchUpdates(_0xdbb7b5){return function(_0x183a53){try{jsonpatch['apply'](_0x183a53,_0xdbb7b5,!![]);}catch(_0x1ca2e6){return BPromise[_0x8eff('0x24')](_0x1ca2e6);}return _0x183a53['save']();};}function saveUpdates(_0x1c4ad3,_0x5ea31f){return function(_0x2fe360){if(_0x2fe360){return _0x2fe360[_0x8eff('0x25')](_0x1c4ad3)[_0x8eff('0x26')](function(_0x59cc32){return _0x59cc32;});}return null;};}function removeEntity(_0x1ee09c,_0x4e891c){return function(_0x179814){if(_0x179814){return _0x179814[_0x8eff('0x27')]()['then'](function(){_0x1ee09c[_0x8eff('0x1c')](0xcc)[_0x8eff('0x1d')]();});}};}function handleEntityNotFound(_0x40404b,_0x3b698b){return function(_0xd60d94){if(!_0xd60d94){_0x40404b[_0x8eff('0x1b')](0x194);}return _0xd60d94;};}function handleError(_0x6359df,_0x2e8067){_0x2e8067=_0x2e8067||0x1f4;return function(_0x516173){logger[_0x8eff('0x28')](_0x516173[_0x8eff('0x29')]);if(_0x516173[_0x8eff('0x2a')]){delete _0x516173[_0x8eff('0x2a')];}_0x6359df[_0x8eff('0x1c')](_0x2e8067)[_0x8eff('0x2b')](_0x516173);};}function getInteractionUsers(_0x4cc146,_0x4ed3b8){return new BPromise(function(_0x44dcdb,_0x472b19){try{if(_0x4ed3b8[_0x4cc146['id']]){_0x4cc146[_0x8eff('0x2c')]=_['map'](_0x4ed3b8[_0x4cc146['id']],function(_0x2ebf3a){return{'id':_0x2ebf3a['id'],'fullname':_0x2ebf3a[_0x8eff('0x2d')]};});}}catch(_0x229e0d){_0x472b19(_0x229e0d);}_0x44dcdb(_0x4cc146);});}function getInteractionTags(_0x1da0fa,_0x25b98e){return new BPromise(function(_0x2c5727,_0x141bd7){try{if(_0x1da0fa[_0x8eff('0x2e')]){_0x1da0fa[_0x8eff('0x2f')]=[];_0x1da0fa[_0x8eff('0x2e')][_0x8eff('0x30')](',')[_0x8eff('0x31')](function(_0x5e0ecb){_0x1da0fa[_0x8eff('0x2f')][_0x8eff('0x32')](_0x25b98e[_0x5e0ecb]);});}delete _0x1da0fa[_0x8eff('0x2e')];}catch(_0x7da1fb){_0x141bd7(_0x7da1fb);}_0x2c5727(_0x1da0fa);});}function updateFaxInteraction(_0x50f211,_0x1f2240,_0x32fd3c){return new BPromise(function(_0x4c4220,_0x4e1256){return getInteractionUsers(_0x50f211,_0x32fd3c)[_0x8eff('0x26')](function(_0x271d64){return getInteractionTags(_0x271d64,_0x1f2240);})['then'](function(_0x50dfc3){_0x4c4220(_0x50dfc3);})['catch'](function(_0x315691){_0x4e1256(_0x315691);});});}exports['index']=function(_0x45d9d4,_0x59c9cc){var _0x2bb00f={},_0x3f7002={},_0x1a7493={'count':0x0,'rows':[]};var _0x1dcab3=_[_0x8eff('0x33')](db[_0x8eff('0x34')]['rawAttributes'],function(_0xd95908){return{'name':_0xd95908['fieldName'],'type':_0xd95908[_0x8eff('0x35')]['key']};});_0x3f7002[_0x8eff('0x36')]=_[_0x8eff('0x33')](_0x1dcab3,_0x8eff('0x2a'));_0x3f7002[_0x8eff('0x37')]=_['keys'](_0x45d9d4[_0x8eff('0x37')]);_0x3f7002[_0x8eff('0x38')]=_[_0x8eff('0x39')](_0x3f7002['model'],_0x3f7002[_0x8eff('0x37')]);_0x2bb00f[_0x8eff('0x3a')]=_[_0x8eff('0x39')](_0x3f7002[_0x8eff('0x36')],qs[_0x8eff('0x3b')](_0x45d9d4[_0x8eff('0x37')][_0x8eff('0x3b')]));_0x2bb00f[_0x8eff('0x3a')]=_0x2bb00f[_0x8eff('0x3a')]['length']?_0x2bb00f['attributes']:_0x3f7002[_0x8eff('0x36')];if(!_0x45d9d4[_0x8eff('0x37')][_0x8eff('0x3c')](_0x8eff('0x3d'))){_0x2bb00f[_0x8eff('0x21')]=qs[_0x8eff('0x21')](_0x45d9d4[_0x8eff('0x37')]['limit']);_0x2bb00f[_0x8eff('0x20')]=qs[_0x8eff('0x20')](_0x45d9d4['query'][_0x8eff('0x20')]);}_0x2bb00f[_0x8eff('0x3e')]=qs[_0x8eff('0x3f')](_0x45d9d4[_0x8eff('0x37')][_0x8eff('0x3f')]);_0x2bb00f[_0x8eff('0x40')]=qs[_0x8eff('0x38')](_[_0x8eff('0x41')](_0x45d9d4[_0x8eff('0x37')],_0x3f7002['filters']));var _0x37f376=[];var _0x27a8c9=squel[_0x8eff('0x42')]()[_0x8eff('0x43')]('id')[_0x8eff('0x43')]('name')[_0x8eff('0x43')]('color')[_0x8eff('0x44')](_0x8eff('0x45'));var _0x1e9d99=squel[_0x8eff('0x42')]()['field'](_0x8eff('0x46'))[_0x8eff('0x43')](_0x8eff('0x47'))['field']('ui.FaxInteractionId')[_0x8eff('0x44')](_0x8eff('0x48'),'ui')[_0x8eff('0x49')](_0x8eff('0x4a'),'u',_0x8eff('0x4b'));var _0x4819dc=squel[_0x8eff('0x42')]()['from'](_0x8eff('0x4c'),'i')[_0x8eff('0x49')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join']('users','o','o.id\x20=\x20i.UserId')['left_join'](_0x8eff('0x4d'),'a',_0x8eff('0x4e'))[_0x8eff('0x49')](_0x8eff('0x4f'),'me',_0x8eff('0x50'))[_0x8eff('0x49')](_0x8eff('0x51'),'it',_0x8eff('0x52'))[_0x8eff('0x49')](_0x8eff('0x45'),'t','t.id\x20=\x20it.TagId');var _0x11e53c=squel['expr']();var _0x295464=[];var _0x10c10d=squel[_0x8eff('0x53')]();var _0x26d252;if(_0x45d9d4[_0x8eff('0x37')][_0x8eff('0x54')]){_0x26d252=as[_0x8eff('0x55')](_0x45d9d4[_0x8eff('0x37')][_0x8eff('0x54')]);var _0x19bff6=_0x26d252[_0x8eff('0x56')];for(var _0x452f7a=0x0;_0x452f7a<_0x26d252['conditions'][_0x8eff('0x57')];_0x452f7a++){var _0x38d88d=_0x26d252[_0x8eff('0x58')][_0x452f7a];var _0xe703af='i';var _0x3de247=_[_0x8eff('0x59')](_0x1dcab3,[_0x8eff('0x2a'),_0x38d88d[_0x8eff('0x43')]]);if(!_0x3de247){switch(_0x38d88d[_0x8eff('0x43')]){case'unreadMessages':if(_0x38d88d['value']==0x1){_0x4819dc[_0x8eff('0x5a')]('`'+_0x38d88d[_0x8eff('0x43')]+_0x8eff('0x5b'));}else{_0x4819dc[_0x8eff('0x5a')]('`'+_0x38d88d[_0x8eff('0x43')]+_0x8eff('0x5c'));}break;case'Contact':if(_0x38d88d[_0x8eff('0x5d')]===_0x8eff('0x5e')){if(_0x38d88d[_0x8eff('0x5f')]['split']('\x20')[_0x8eff('0x57')]>0x1){_0x11e53c[_0x19bff6](_0x8eff('0x60'),qs[_0x8eff('0x61')](_0x38d88d[_0x8eff('0x5f')]),null);}else{var _0x549e88='%'+_0x38d88d[_0x8eff('0x5f')]+'%';_0x11e53c[_0x19bff6](_0x8eff('0x62'),_0x549e88,_0x549e88,_0x549e88);}}else{_0x3de247=_[_0x8eff('0x59')](_0x1dcab3,[_0x8eff('0x2a'),_0x8eff('0x63')]);_0x38d88d[_0x8eff('0x43')]=_0x8eff('0x63');_0x4b9723=as['buildExpression'](_0xe703af,_0x3de247[_0x8eff('0x35')],_0x38d88d);_0x11e53c[_0x19bff6](_0x4b9723[_0x8eff('0x64')],_0x4b9723[_0x8eff('0x5f')][_0x8eff('0x65')],_0x4b9723[_0x8eff('0x5f')]['end']);}break;case _0x8eff('0x66'):var _0x16b968=_0x38d88d[_0x8eff('0x5f')]['split'](',')[_0x8eff('0x33')](function(_0x4aca10){return Number(_0x4aca10);});_0x16b968[_0x8eff('0x31')](function(_0x172c6c){_0x10c10d['or'](_0x8eff('0x67'),'%,'+_0x172c6c+',%');});_0x295464=_[_0x8eff('0x68')](_0x295464,_0x16b968);break;case _0x8eff('0x69'):if(_0x38d88d[_0x8eff('0x5d')]===_0x8eff('0x5e')){_0x11e53c[_0x19bff6]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x38d88d['value']+'%',null);}else{_0x3de247=_[_0x8eff('0x59')](_0x1dcab3,['name',_0x8eff('0x6a')]);_0x38d88d[_0x8eff('0x43')]=_0x8eff('0x6a');_0x4b9723=as[_0x8eff('0x6b')](_0xe703af,_0x3de247[_0x8eff('0x35')],_0x38d88d);_0x11e53c[_0x19bff6](_0x4b9723['text'],_0x4b9723[_0x8eff('0x5f')][_0x8eff('0x65')],_0x4b9723[_0x8eff('0x5f')][_0x8eff('0x1d')]);}break;case _0x8eff('0x6c'):_0x4b9723=as[_0x8eff('0x6b')]('me',null,_0x38d88d);_0x11e53c[_0x19bff6](_0x4b9723['text'],_0x4b9723[_0x8eff('0x5f')]['start'],_0x4b9723[_0x8eff('0x5f')][_0x8eff('0x1d')]);break;}}else{var _0x4b9723=as[_0x8eff('0x6b')](_0xe703af,_0x3de247[_0x8eff('0x35')],_0x38d88d);_0x11e53c[_0x19bff6](_0x4b9723[_0x8eff('0x64')],_0x4b9723[_0x8eff('0x5f')][_0x8eff('0x65')],_0x4b9723[_0x8eff('0x5f')][_0x8eff('0x1d')]);}}}else{var _0x1fdb1e=_(_0x45d9d4['query'])[_0x8eff('0x6d')]()['map'](function(_0x57878e){return _[_0x8eff('0x6e')](_0x1dcab3,[_0x8eff('0x2a'),_0x57878e])?_0x57878e:undefined;})['compact']()[_0x8eff('0x5f')]();if(!_[_0x8eff('0x6f')](_0x1fdb1e)){_0x1fdb1e['forEach'](function(_0x31d711){if(_0x31d711===_0x8eff('0x70')){_0x4819dc['where'](_0x8eff('0x71'),[][_0x8eff('0x72')](_0x45d9d4[_0x8eff('0x37')][_0x31d711]));}else if(_0x31d711===_0x8eff('0x73')){var _0x26b4f0=JSON[_0x8eff('0x74')](_0x45d9d4[_0x8eff('0x37')][_0x31d711])['$gte'];var _0x479a4b=JSON[_0x8eff('0x74')](_0x45d9d4[_0x8eff('0x37')][_0x31d711])[_0x8eff('0x75')];_0x4819dc[_0x8eff('0x40')](_0x8eff('0x76'),_0x26b4f0,_0x479a4b);}else{if(_0x45d9d4[_0x8eff('0x37')][_0x31d711]===_0x8eff('0x77')){_0x4819dc['where']('i.'+_0x31d711+'\x20IS\x20NULL');}else{_0x4819dc[_0x8eff('0x40')]('i.'+_0x31d711+'\x20=\x20?',_0x45d9d4['query'][_0x31d711]);}}});}if(_0x45d9d4['query'][_0x8eff('0x78')]){if(_0x45d9d4[_0x8eff('0x37')][_0x8eff('0x78')]==0x1){_0x4819dc[_0x8eff('0x5a')](_0x8eff('0x79'));}else{_0x4819dc[_0x8eff('0x5a')](_0x8eff('0x7a'));}}if(_0x45d9d4[_0x8eff('0x37')]['tag']){_0x295464=_[_0x8eff('0x7b')](_0x45d9d4['query'][_0x8eff('0x7c')])?_0x45d9d4[_0x8eff('0x37')][_0x8eff('0x7c')]:new Array(_0x45d9d4[_0x8eff('0x37')][_0x8eff('0x7c')]);_0x295464[_0x8eff('0x31')](function(_0x570728){_0x10c10d['or'](_0x8eff('0x67'),'%,'+_0x570728+',%');});}if(_0x45d9d4['query'][_0x8eff('0x7d')]){var _0x2b5f93=_0x45d9d4[_0x8eff('0x37')][_0x8eff('0x7d')][_0x8eff('0x7e')]('\x5c','\x5c\x5c')[_0x8eff('0x7e')]('\x27\x27',_0x8eff('0x7f'));if(qs[_0x8eff('0x80')](_0x2b5f93)){_0x11e53c['or'](_0x8eff('0x81'),_0x2b5f93+'%')['or']('i.fax\x20LIKE\x20?',_0x2b5f93+'%');}_0x11e53c['or'](_0x8eff('0x82'),_0x2b5f93+'%');}}_0x4819dc[_0x8eff('0x40')](_0x11e53c);_0x4819dc[_0x8eff('0x83')](_0x8eff('0x84'));var _0xa5816d={'type':db[_0x8eff('0x85')][_0x8eff('0x86')][_0x8eff('0x87')],'raw':!![]};var _0x3350b8=_0x4819dc[_0x8eff('0x88')]();_0x3350b8['field']('i.id');_0x3350b8['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x8eff('0x89'));if(_0x2bb00f[_0x8eff('0x3e')]){_0x2bb00f[_0x8eff('0x3e')][_0x8eff('0x31')](function(_0x3deec9){_0x4819dc[_0x8eff('0x3e')]('i.'+_0x3deec9[0x0],_0x3deec9[0x1]===_0x8eff('0x8a')?![]:!![]);});}if(!_['isEmpty'](_0x295464)){_0x4819dc[_0x8eff('0x5a')](_0x10c10d);_0x3350b8[_0x8eff('0x40')](_0x8eff('0x8b'),_0x295464);}BPromise[_0x8eff('0x8c')]()['then'](function(){if(!_0x26d252&&_0x45d9d4[_0x8eff('0x37')][_0x8eff('0x70')])return;return _0x45d9d4['user'][_0x8eff('0x8d')]({'attributes':['id'],'raw':!![]})[_0x8eff('0x26')](function(_0x34c787){if(_['isEmpty'](_0x34c787)){_0x3350b8['where']('i.FaxAccountId\x20IS\x20NULL');_0x4819dc[_0x8eff('0x40')](_0x8eff('0x8e'));}else{_0x3350b8[_0x8eff('0x40')](_0x8eff('0x71'),_[_0x8eff('0x33')](_0x34c787,'id'));_0x4819dc[_0x8eff('0x40')](_0x8eff('0x71'),_[_0x8eff('0x33')](_0x34c787,'id'));}});})[_0x8eff('0x26')](function(){db[_0x8eff('0x8f')][_0x8eff('0x37')](_0x3350b8['toString'](),_0xa5816d)[_0x8eff('0x26')](function(_0x5201c2){_0x1a7493[_0x8eff('0x1f')]=_0x5201c2[_0x8eff('0x57')];if(_0x1a7493['count']===0x0)return[];return db[_0x8eff('0x8f')]['query'](_0x27a8c9[_0x8eff('0x90')](),_0xa5816d)[_0x8eff('0x26')](function(_0x26ebce){_0x37f376=_[_0x8eff('0x91')](_0x26ebce,'id');_0xa5816d=_[_0x8eff('0x92')](_0xa5816d,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x45d9d4[_0x8eff('0x37')][_0x8eff('0x3b')]){_0x2bb00f[_0x8eff('0x3a')][_0x8eff('0x31')](function(_0x30c321){_0x4819dc[_0x8eff('0x43')]('i.'+_0x30c321);});}else{_0x4819dc[_0x8eff('0x43')](_0x8eff('0x93'),_0x8eff('0x89'));_0x4819dc[_0x8eff('0x43')](_0x8eff('0x94'),'Account.key');_0x4819dc[_0x8eff('0x43')](_0x8eff('0x95'),_0x8eff('0x96'));_0x4819dc[_0x8eff('0x43')](_0x8eff('0x97'));_0x4819dc['field'](_0x8eff('0x98'),_0x8eff('0x99'));_0x4819dc['field']('c.lastName',_0x8eff('0x9a'));_0x4819dc[_0x8eff('0x43')](_0x8eff('0x9b'),_0x8eff('0x9c'));_0x4819dc[_0x8eff('0x43')](_0x8eff('0x9d'),'Contact.phone');_0x4819dc[_0x8eff('0x43')]('c.mobile',_0x8eff('0x9e'));_0x4819dc[_0x8eff('0x43')]('c.fax',_0x8eff('0x9f'));_0x4819dc['field']('o.fullname',_0x8eff('0xa0'));_0x4819dc['field'](_0x8eff('0xa1'),_0x8eff('0xa2'));_0x4819dc['field'](_0x8eff('0xa3'),_0x8eff('0x2e'));}_0x4819dc['limit'](_0x2bb00f[_0x8eff('0x21')]);_0x4819dc[_0x8eff('0x20')](_0x2bb00f[_0x8eff('0x20')]);return db[_0x8eff('0x8f')][_0x8eff('0x37')](_0x4819dc[_0x8eff('0x90')](),_0xa5816d);})[_0x8eff('0x26')](function(_0xc2f264){_0x1e9d99[_0x8eff('0x40')]('ui.FaxInteractionId\x20IN\x20?',_['map'](_0xc2f264,'id'));return db['sequelize'][_0x8eff('0x37')](_0x1e9d99[_0x8eff('0x90')](),_0xa5816d)[_0x8eff('0x26')](function(_0x5d3448){var _0xe8557f=_[_0x8eff('0xa4')](_0x5d3448,_0x8eff('0xa5'));var _0x196002=[];_0xc2f264[_0x8eff('0x31')](function(_0x1b748e){_0x196002['push'](updateFaxInteraction(_0x1b748e,_0x37f376,_0xe8557f));});return BPromise[_0x8eff('0xa6')](_0x196002);});});})['then'](function(_0x2db50b){_0x1a7493[_0x8eff('0xa7')]=_0x2db50b;return _0x1a7493;})[_0x8eff('0x26')](respondWithFilteredResult(_0x59c9cc,_0x2bb00f));})[_0x8eff('0xa8')](handleError(_0x59c9cc,null));};exports[_0x8eff('0xa9')]=function(_0x30b929,_0x476701){var _0x54ad86={'raw':![],'where':{'id':_0x30b929[_0x8eff('0xaa')]['id']}},_0x290fa2={};_0x290fa2[_0x8eff('0x36')]=_[_0x8eff('0x6d')](db[_0x8eff('0x34')]['rawAttributes']);_0x290fa2[_0x8eff('0x37')]=_[_0x8eff('0x6d')](_0x30b929[_0x8eff('0x37')]);_0x290fa2['filters']=_['intersection'](_0x290fa2[_0x8eff('0x36')],_0x290fa2[_0x8eff('0x37')]);_0x54ad86[_0x8eff('0x3a')]=_['intersection'](_0x290fa2[_0x8eff('0x36')],qs['fields'](_0x30b929['query'][_0x8eff('0x3b')]));_0x54ad86[_0x8eff('0x3a')]=_0x54ad86[_0x8eff('0x3a')][_0x8eff('0x57')]?_0x54ad86[_0x8eff('0x3a')]:_0x290fa2[_0x8eff('0x36')];if(_0x30b929[_0x8eff('0x37')][_0x8eff('0xab')]){_0x54ad86[_0x8eff('0xac')]=[{'all':!![]}];}_0x54ad86=_[_0x8eff('0x92')]({},_0x54ad86,_0x30b929[_0x8eff('0xad')]);return db[_0x8eff('0x34')]['find'](_0x54ad86)[_0x8eff('0x26')](handleEntityNotFound(_0x476701,null))[_0x8eff('0x26')](respondWithResult(_0x476701,null))[_0x8eff('0xa8')](handleError(_0x476701,null));};exports[_0x8eff('0xae')]=function(_0x134946,_0x4e4713){return db[_0x8eff('0x34')][_0x8eff('0xae')](_0x134946[_0x8eff('0x6c')],{})[_0x8eff('0x26')](respondWithResult(_0x4e4713,0xc9))['catch'](handleError(_0x4e4713,null));};exports['update']=function(_0x339451,_0x111056){if(_0x339451[_0x8eff('0x6c')]['id']){delete _0x339451[_0x8eff('0x6c')]['id'];}return db['FaxInteraction'][_0x8eff('0x59')]({'where':{'id':_0x339451[_0x8eff('0xaa')]['id']}})[_0x8eff('0x26')](handleEntityNotFound(_0x111056,null))[_0x8eff('0x26')](saveUpdates(_0x339451[_0x8eff('0x6c')],null))[_0x8eff('0x26')](respondWithResult(_0x111056,null))[_0x8eff('0xa8')](handleError(_0x111056,null));};exports[_0x8eff('0x27')]=function(_0x8ff7ed,_0x4ff42c){return db[_0x8eff('0x34')]['find']({'where':{'id':_0x8ff7ed[_0x8eff('0xaa')]['id']}})[_0x8eff('0x26')](handleEntityNotFound(_0x4ff42c,null))[_0x8eff('0x26')](removeEntity(_0x4ff42c,null))['catch'](handleError(_0x4ff42c,null));};exports[_0x8eff('0xaf')]=function(_0x4ff258,_0x1dba3f){return db[_0x8eff('0x34')]['describe']()[_0x8eff('0x26')](respondWithResult(_0x1dba3f,null))[_0x8eff('0xa8')](handleError(_0x1dba3f,null));};exports[_0x8eff('0xb0')]=function(_0x7a867b,_0x181171,_0xd76532){return db['FaxMessage'][_0x8eff('0x59')]({'where':{'id':_0x7a867b[_0x8eff('0xaa')]['id']}})[_0x8eff('0x26')](handleEntityNotFound(_0x181171,null))['then'](function(_0x765111){if(_0x765111){return _0x765111[_0x8eff('0xb0')](_0x7a867b['body'][_0x8eff('0xb1')],_[_0x8eff('0xb2')](_0x7a867b[_0x8eff('0x6c')],[_0x8eff('0xb1'),'id'])||{});}})['then'](respondWithResult(_0x181171,null))[_0x8eff('0xa8')](handleError(_0x181171,null));};exports['getMessages']=function(_0x359fc6,_0x39545d,_0x3d217c){var _0x239f79={'raw':![],'where':{}};var _0x4830a5={};var _0x2721f5={'count':0x0,'rows':[]};return db['FaxInteraction'][_0x8eff('0xb3')]({'where':{'id':_0x359fc6[_0x8eff('0xaa')]['id']}})[_0x8eff('0x26')](handleEntityNotFound(_0x39545d,null))[_0x8eff('0x26')](function(_0x35e749){if(_0x35e749){_0x4830a5['model']=_[_0x8eff('0x6d')](db[_0x8eff('0xb4')][_0x8eff('0xb5')]);_0x4830a5[_0x8eff('0x37')]=_[_0x8eff('0x6d')](_0x359fc6[_0x8eff('0x37')]);_0x4830a5[_0x8eff('0x38')]=_[_0x8eff('0x39')](_0x4830a5['model'],_0x4830a5[_0x8eff('0x37')]);_0x239f79[_0x8eff('0x3a')]=_['intersection'](_0x4830a5['model'],qs[_0x8eff('0x3b')](_0x359fc6['query']['fields']));_0x239f79[_0x8eff('0x3a')]=_0x239f79[_0x8eff('0x3a')]['length']?_0x239f79[_0x8eff('0x3a')]:_0x4830a5[_0x8eff('0x36')];if(!_0x359fc6[_0x8eff('0x37')]['hasOwnProperty'](_0x8eff('0x3d'))){_0x239f79[_0x8eff('0x21')]=qs['limit'](_0x359fc6[_0x8eff('0x37')][_0x8eff('0x21')]);_0x239f79[_0x8eff('0x20')]=qs['offset'](_0x359fc6['query']['offset']);}_0x239f79[_0x8eff('0x3e')]=qs[_0x8eff('0x3f')](_0x359fc6[_0x8eff('0x37')][_0x8eff('0x3f')]);_0x239f79[_0x8eff('0x40')]=qs[_0x8eff('0x38')](_[_0x8eff('0x41')](_0x359fc6[_0x8eff('0x37')],_0x4830a5[_0x8eff('0x38')]));_0x239f79[_0x8eff('0x40')][_0x8eff('0xa5')]=_0x35e749['id'];if(_0x359fc6['query']['filter']){_0x239f79[_0x8eff('0x40')]=_[_0x8eff('0x92')](_0x239f79[_0x8eff('0x40')],{'$or':_[_0x8eff('0x33')](_0x239f79[_0x8eff('0x3a')],function(_0x1a86ad){var _0x3505a2={};_0x3505a2[_0x1a86ad]={'$like':'%'+_0x359fc6[_0x8eff('0x37')][_0x8eff('0x7d')]+'%'};return _0x3505a2;})});}if(_0x359fc6['query'][_0x8eff('0xb6')]){var _0x2fea7d=_0x359fc6[_0x8eff('0x37')][_0x8eff('0xb6')][_0x8eff('0x30')](',');var _0x51017a={};_0x51017a[_0x2fea7d[0x0]]={'$gte':moment(_0x2fea7d[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x239f79[_0x8eff('0x40')]=_[_0x8eff('0x92')](_0x239f79[_0x8eff('0x40')],_0x51017a);}_0x239f79=_[_0x8eff('0x92')]({},_0x239f79,_0x359fc6[_0x8eff('0xad')]);return db['FaxMessage'][_0x8eff('0x1f')]({'where':_0x239f79['where']})['then'](function(_0x422796){_0x2721f5[_0x8eff('0x1f')]=_0x422796;if(_0x359fc6[_0x8eff('0x37')]['includeAll']){_0x239f79[_0x8eff('0xac')]=[{'all':!![]}];}return db[_0x8eff('0xb4')][_0x8eff('0xb7')](_0x239f79);})[_0x8eff('0x26')](function(_0x27a3be){_0x2721f5[_0x8eff('0xa7')]=_0x27a3be;return _0x2721f5;});}})['then'](respondWithFilteredResult(_0x39545d,_0x239f79))[_0x8eff('0xa8')](handleError(_0x39545d,null));};exports['addTags']=function(_0x156e33,_0x109165,_0xbdcc8f){return db[_0x8eff('0x34')][_0x8eff('0x59')]({'where':{'id':_0x156e33[_0x8eff('0xaa')]['id']}})['then'](handleEntityNotFound(_0x109165,null))['then'](function(_0x2a5adc){if(_0x2a5adc){return _0x2a5adc[_0x8eff('0xb8')](_0x156e33[_0x8eff('0x6c')][_0x8eff('0xb1')],_[_0x8eff('0xb2')](_0x156e33['body'],[_0x8eff('0xb1'),'id'])||{})[_0x8eff('0xb9')](function(){return db[_0x8eff('0x66')]['findAll']({'attributes':['id','name',_0x8eff('0xba')],'where':{'id':_0x156e33[_0x8eff('0x6c')][_0x8eff('0xb1')]}});})[_0x8eff('0x26')](function(_0x210ae8){socket[_0x8eff('0xbb')](_0x8eff('0xbc'),{'id':Number(_0x156e33[_0x8eff('0xaa')]['id']),'tags':_0x210ae8||[]});return{'id':Number(_0x156e33['params']['id']),'tags':_0x210ae8||[]};});}})['then'](respondWithResult(_0x109165,null))[_0x8eff('0xa8')](handleError(_0x109165,null));};exports[_0x8eff('0xbd')]=function(_0x1d2328,_0x331339,_0x1bd6ba){return db[_0x8eff('0x34')][_0x8eff('0x59')]({'where':{'id':_0x1d2328['params']['id']}})[_0x8eff('0x26')](handleEntityNotFound(_0x331339,null))[_0x8eff('0x26')](function(_0x5f0d34){if(_0x5f0d34){return _0x5f0d34[_0x8eff('0xbd')](_0x1d2328[_0x8eff('0x37')][_0x8eff('0xb1')]);}})['then'](respondWithStatusCode(_0x331339,null))['catch'](handleError(_0x331339,null));};exports['download']=function(_0xae8a5e,_0x374b82){var _0x4d1ea3=moment()[_0x8eff('0xbe')]()[_0x8eff('0x90')]();var _0x477ece=path['join'](config[_0x8eff('0xbf')],_0x8eff('0xc0'),_0x8eff('0xc1'),_0x8eff('0xc2'));var _0xcfe826=path[_0x8eff('0xc3')](config[_0x8eff('0xbf')],_0x8eff('0xc0'),_0x8eff('0xc1'),_0x8eff('0xc4'));var _0x2985f2=path[_0x8eff('0xc3')](_0x477ece,_0x4d1ea3);var _0x5b004f=util[_0x8eff('0xc5')](_0x8eff('0xc6'),_0xae8a5e[_0x8eff('0xaa')]['id'],_0x4d1ea3);var _0x3a48fe=path[_0x8eff('0xc3')](_0x477ece,_0x5b004f);var _0x3dc53c=[];if(_0xae8a5e['query'][_0x8eff('0xc4')]){_0x3dc53c[_0x8eff('0x32')]({'model':db[_0x8eff('0xc7')],'as':'Attachments','raw':!![]});}var _0x491901=[{'model':db[_0x8eff('0xb4')],'as':'Messages','attributes':['id','body',_0x8eff('0x73')],'include':_0x3dc53c}];return db[_0x8eff('0x34')][_0x8eff('0x59')]({'where':{'id':_0xae8a5e[_0x8eff('0xaa')]['id']},'include':_0x491901})[_0x8eff('0x26')](handleEntityNotFound(_0x374b82,null))[_0x8eff('0x26')](function(_0x1d9e31){if(_0x1d9e31&&_0x1d9e31[_0x8eff('0xc8')]){var _0x4ae304=_0x1d9e31[_0x8eff('0xc9')]({'plain':!![]});fs[_0x8eff('0xca')](_0x2985f2);for(var _0x3d32c8=0x0;_0x3d32c8<_0x4ae304[_0x8eff('0xc8')]['length'];_0x3d32c8++){var _0x14ab78=_0x4ae304[_0x8eff('0xc8')][_0x3d32c8][_0x8eff('0xc7')];if(_0x14ab78){var _0x283212=path[_0x8eff('0xc3')](_0xcfe826,_0x14ab78[_0x8eff('0xcb')]);if(fs[_0x8eff('0xcc')](_0x283212)){fs[_0x8eff('0xcd')](_0x283212)[_0x8eff('0xce')](fs[_0x8eff('0xcf')](path[_0x8eff('0xc3')](_0x2985f2,_0x14ab78[_0x8eff('0xcb')])));}}}return BPromise[_0x8eff('0x8c')]()[_0x8eff('0x26')](function(){return new BPromise(function(_0x2e9b3c,_0x32cf13){zipdir(_0x2985f2,{'saveTo':_0x3a48fe},function(_0x41b934,_0x137ebd){if(_0x41b934)return _0x32cf13(_0x41b934);return _0x2e9b3c(_0x137ebd);});})[_0x8eff('0x26')](function(){return new BPromise(function(_0x110573,_0x547502){rimraf(_0x2985f2,function(_0x4a2c0a){if(_0x4a2c0a)_0x547502(_0x4a2c0a);return _0x110573();});});})[_0x8eff('0x26')](function(){return _0x374b82[_0x8eff('0xd0')](_0x3a48fe,_0x5b004f,function(_0x383262){if(_0x383262){console[_0x8eff('0xd1')](_0x8eff('0xd2'),_0x383262);}else{fs['unlinkSync'](_0x3a48fe);}});});});}else{return _0x374b82[_0x8eff('0x1b')](0xc8);}})[_0x8eff('0xa8')](handleError(_0x374b82,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 56a9076..ef6afe8 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 _0x326f=['../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','then','setDataValue','Users','unreadMessages','length','emit','hasOwnProperty','exports','events'];(function(_0x5d3a45,_0x2d43fc){var _0x189d9f=function(_0x3e6834){while(--_0x3e6834){_0x5d3a45['push'](_0x5d3a45['shift']());}};_0x189d9f(++_0x2d43fc);}(_0x326f,0xd1));var _0xf326=function(_0x172ecd,_0x515c6f){_0x172ecd=_0x172ecd-0x0;var _0x3aa6f7=_0x326f[_0x172ecd];return _0x3aa6f7;};'use strict';var EventEmitter=require(_0xf326('0x0'));var FaxInteraction=require('../../mysqldb')['db']['FaxInteraction'];var FaxMessage=require(_0xf326('0x1'))['db'][_0xf326('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xf326('0x3')](0x0);var events={'afterCreate':_0xf326('0x4'),'afterUpdate':_0xf326('0x5'),'afterDestroy':_0xf326('0x6')};function emitEvent(_0x9445c6){return function(_0xf1c243,_0x1b5a56,_0x3ace29){_0xf1c243['getUsers']({'attributes':['id'],'raw':!![]})[_0xf326('0x7')](function(_0x3851eb){_0xf1c243[_0xf326('0x8')](_0xf326('0x9'),_0x3851eb['map'](function(_0x4c206c){return{'id':_0x4c206c['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0xf1c243['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf326('0x7')](function(_0x1fc80e){_0xf1c243[_0xf326('0x8')](_0xf326('0xa'),_0x1fc80e[_0xf326('0xb')]);FaxInteractionEvents['emit'](_0x9445c6+':'+_0xf1c243['id'],_0xf1c243);FaxInteractionEvents[_0xf326('0xc')](_0x9445c6,_0xf1c243);_0x3ace29(null);})['catch'](_0x3ace29(null));};}for(var e in events){if(events[_0xf326('0xd')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0xf326('0xe')]=FaxInteractionEvents; \ No newline at end of file +var _0x2ef3=['remove','then','setDataValue','Users','map','findAll','emit','catch','hasOwnProperty','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','update'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2ef3,0xba));var _0x32ef=function(_0x508e71,_0x3c757e){_0x508e71=_0x508e71-0x0;var _0x5c547b=_0x2ef3[_0x508e71];return _0x5c547b;};'use strict';var EventEmitter=require(_0x32ef('0x0'));var FaxInteraction=require(_0x32ef('0x1'))['db'][_0x32ef('0x2')];var FaxMessage=require(_0x32ef('0x1'))['db'][_0x32ef('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x32ef('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x32ef('0x5'),'afterDestroy':_0x32ef('0x6')};function emitEvent(_0x524ab6){return function(_0x402857,_0x37dd1d,_0x4c8104){_0x402857['getUsers']({'attributes':['id'],'raw':!![]})[_0x32ef('0x7')](function(_0x4bfcf8){_0x402857[_0x32ef('0x8')](_0x32ef('0x9'),_0x4bfcf8[_0x32ef('0xa')](function(_0x298066){return{'id':_0x298066['id']};}));return FaxMessage[_0x32ef('0xb')]({'where':{'FaxInteractionId':_0x402857['id'],'direction':'in','read':![]},'raw':!![]});})[_0x32ef('0x7')](function(_0x28275c){_0x402857[_0x32ef('0x8')]('unreadMessages',_0x28275c['length']);FaxInteractionEvents[_0x32ef('0xc')](_0x524ab6+':'+_0x402857['id'],_0x402857);FaxInteractionEvents[_0x32ef('0xc')](_0x524ab6,_0x402857);_0x4c8104(null);})[_0x32ef('0xd')](_0x4c8104(null));};}for(var e in events){if(events[_0x32ef('0xe')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x32ef('0xf')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index e1403c6..23b1d5f 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 _0x08f6=['fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','FaxInteraction'];(function(_0x35f575,_0x469a87){var _0x1dc07f=function(_0x36cd8c){while(--_0x36cd8c){_0x35f575['push'](_0x35f575['shift']());}};_0x1dc07f(++_0x469a87);}(_0x08f6,0x16b));var _0x608f=function(_0x5d4f12,_0x11e67c){_0x5d4f12=_0x5d4f12-0x0;var _0x4eb577=_0x08f6[_0x5d4f12];return _0x4eb577;};'use strict';var _=require(_0x608f('0x0'));var util=require('util');var logger=require(_0x608f('0x1'))(_0x608f('0x2'));var moment=require(_0x608f('0x3'));var BPromise=require(_0x608f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x608f('0x5'));var rimraf=require(_0x608f('0x6'));var config=require(_0x608f('0x7'));var attributes=require('./faxInteraction.attributes');module[_0x608f('0x8')]=function(_0x3958d4,_0x4ea6a4){return _0x3958d4[_0x608f('0x9')](_0x608f('0xa'),attributes,{'tableName':_0x608f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x44c758,_0x3a3834,_0x9b4a65){if(_0x44c758[_0x608f('0xc')](_0x608f('0xd'))){_0x44c758[_0x608f('0xe')]=moment()[_0x608f('0xf')](_0x608f('0x10'));}_0x9b4a65(null,_0x44c758);}}});}; \ No newline at end of file +var _0x75be=['changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./faxInteraction.attributes','define','FaxInteraction','fax_interactions'];(function(_0x420f0f,_0x4ea27d){var _0x2b6c2b=function(_0x287073){while(--_0x287073){_0x420f0f['push'](_0x420f0f['shift']());}};_0x2b6c2b(++_0x4ea27d);}(_0x75be,0x114));var _0xe75b=function(_0x365a88,_0xb8d7bd){_0x365a88=_0x365a88-0x0;var _0x17d498=_0x75be[_0x365a88];return _0x17d498;};'use strict';var _=require(_0xe75b('0x0'));var util=require(_0xe75b('0x1'));var logger=require(_0xe75b('0x2'))(_0xe75b('0x3'));var moment=require(_0xe75b('0x4'));var BPromise=require('bluebird');var rp=require(_0xe75b('0x5'));var fs=require('fs');var path=require(_0xe75b('0x6'));var rimraf=require(_0xe75b('0x7'));var config=require('../../config/environment');var attributes=require(_0xe75b('0x8'));module['exports']=function(_0x3f1ef8,_0x159e50){return _0x3f1ef8[_0xe75b('0x9')](_0xe75b('0xa'),attributes,{'tableName':_0xe75b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2d79d1,_0x12c6e5,_0x4c578a){if(_0x2d79d1[_0xe75b('0xc')](_0xe75b('0xd'))){_0x2d79d1['closedAt']=moment()[_0xe75b('0xe')](_0xe75b('0xf'));}_0x4c578a(null,_0x2d79d1);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 19b5ff5..bb60e60 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 _0x551d=['spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','redis','socket.io-emitter','./faxInteraction.socket','request','then','FaxInteraction,\x20%s,\x20%s','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','where','attributes','limit','info','debug','AddTagsToFaxInteraction','find','addTags','ids','omit'];(function(_0xde0d5a,_0x3be83b){var _0x49adae=function(_0x4bf0b9){while(--_0x4bf0b9){_0xde0d5a['push'](_0xde0d5a['shift']());}};_0x49adae(++_0x3be83b);}(_0x551d,0x1e2));var _0xd551=function(_0x4f3b2d,_0x3bbf46){_0x4f3b2d=_0x4f3b2d-0x0;var _0x3dddfa=_0x551d[_0x4f3b2d];return _0x3dddfa;};'use strict';var _=require(_0xd551('0x0'));var util=require(_0xd551('0x1'));var moment=require(_0xd551('0x2'));var BPromise=require(_0xd551('0x3'));var rs=require(_0xd551('0x4'));var fs=require('fs');var Redis=require(_0xd551('0x5'));var db=require(_0xd551('0x6'))['db'];var utils=require(_0xd551('0x7'));var logger=require(_0xd551('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd551('0x9'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xd551('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xd551('0xb'))(new Redis(config['redis']));require(_0xd551('0xc'))['register'](socket);function respondWithRpcPromise(_0x27c85c,_0x3bf411,_0x5af968){return new BPromise(function(_0x48af92,_0x164500){return client[_0xd551('0xd')](_0x27c85c,_0x5af968)[_0xd551('0xe')](function(_0x522369){logger['info'](_0xd551('0xf'),_0x3bf411,'request\x20sent');logger['debug'](_0xd551('0x10'),_0x3bf411,_0xd551('0x11'),JSON[_0xd551('0x12')](_0x522369));if(_0x522369[_0xd551('0x13')]){if(_0x522369['error']['code']===0x1f4){logger[_0xd551('0x13')](_0xd551('0xf'),_0x3bf411,_0x522369[_0xd551('0x13')][_0xd551('0x14')]);return _0x164500(_0x522369['error'][_0xd551('0x14')]);}logger[_0xd551('0x13')]('FaxInteraction,\x20%s,\x20%s',_0x3bf411,_0x522369['error'][_0xd551('0x14')]);return _0x48af92(_0x522369[_0xd551('0x13')]['message']);}else{logger['info'](_0xd551('0xf'),_0x3bf411,'request\x20sent');_0x48af92(_0x522369[_0xd551('0x15')][_0xd551('0x14')]);}})[_0xd551('0x16')](function(_0xc3c43a){logger[_0xd551('0x13')]('FaxInteraction,\x20%s,\x20%s',_0x3bf411,_0xc3c43a);_0x164500(_0xc3c43a);});});}exports[_0xd551('0x17')]=function(_0x4ac63c){var _0x255e3a=this;return new Promise(function(_0x3085b1,_0x12096f){return db[_0xd551('0x18')][_0xd551('0x19')](_0x4ac63c[_0xd551('0x1a')],{'raw':_0x4ac63c['options']?_0x4ac63c['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ac63c['options']?_0x4ac63c[_0xd551('0x1b')][_0xd551('0x1c')]||null:null,'attributes':_0x4ac63c[_0xd551('0x1b')]?_0x4ac63c[_0xd551('0x1b')][_0xd551('0x1d')]||null:null,'limit':_0x4ac63c['options']?_0x4ac63c[_0xd551('0x1b')][_0xd551('0x1e')]||null:null})[_0xd551('0xe')](function(_0x359c77){logger[_0xd551('0x1f')](_0xd551('0x17'),_0x4ac63c);logger[_0xd551('0x20')](_0xd551('0x17'),_0x4ac63c,JSON[_0xd551('0x12')](_0x359c77));_0x3085b1(_0x359c77);})[_0xd551('0x16')](function(_0x1ea73a){logger[_0xd551('0x13')](_0xd551('0x17'),_0x1ea73a[_0xd551('0x14')],_0x4ac63c);_0x12096f(_0x255e3a[_0xd551('0x13')](0x1f4,_0x1ea73a[_0xd551('0x14')]));});});};exports[_0xd551('0x21')]=function(_0x5f156a){return new Promise(function(_0x390cef,_0x1abbb7){return db[_0xd551('0x18')][_0xd551('0x22')]({'where':_0x5f156a['options']?_0x5f156a['options']['where']||null:null})[_0xd551('0xe')](function(_0x17b986){if(_0x17b986){return _0x17b986[_0xd551('0x23')](_0x5f156a['body'][_0xd551('0x24')],_[_0xd551('0x25')](_0x5f156a[_0xd551('0x1a')],[_0xd551('0x24'),'id'])||{});}})[_0xd551('0x26')](function(_0xa6196f){logger['info'](_0xd551('0x27'),_0x5f156a);logger['debug'](_0xd551('0x27'),_0x5f156a,JSON[_0xd551('0x12')](_0xa6196f));_0x390cef(_0xa6196f);})[_0xd551('0x16')](function(_0x4454a1){logger[_0xd551('0x13')](_0xd551('0x27'),_0x4454a1['message'],_0x5f156a);_0x1abbb7(_this[_0xd551('0x13')](0x1f4,_0x4454a1[_0xd551('0x14')]));});});}; \ No newline at end of file +var _0xfe6f=['register','request','then','info','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','FaxInteraction,\x20%s,\x20%s','message','result','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','attributes','limit','stringify','AddTagsToFaxInteraction','find','addTags','omit','spread','AddTags','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','redis','defaults','localhost'];(function(_0x1f3f30,_0x2e4f50){var _0x1f7c5f=function(_0x154b55){while(--_0x154b55){_0x1f3f30['push'](_0x1f3f30['shift']());}};_0x1f7c5f(++_0x2e4f50);}(_0xfe6f,0x1ad));var _0xffe6=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xfe6f[_0x484e36];return _0xafc85d;};'use strict';var _=require(_0xffe6('0x0'));var util=require('util');var moment=require(_0xffe6('0x1'));var BPromise=require('bluebird');var rs=require(_0xffe6('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xffe6('0x3'))['db'];var utils=require(_0xffe6('0x4'));var logger=require(_0xffe6('0x5'))('rpc');var config=require(_0xffe6('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xffe6('0x7')]['http']({'port':0x232a});config[_0xffe6('0x8')]=_[_0xffe6('0x9')](config[_0xffe6('0x8')],{'host':_0xffe6('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xffe6('0x8')]));require('./faxInteraction.socket')[_0xffe6('0xb')](socket);function respondWithRpcPromise(_0x4b8897,_0x255b65,_0x220fd3){return new BPromise(function(_0x23abec,_0x1741be){return client[_0xffe6('0xc')](_0x4b8897,_0x220fd3)[_0xffe6('0xd')](function(_0x49e1ad){logger[_0xffe6('0xe')]('FaxInteraction,\x20%s,\x20%s',_0x255b65,_0xffe6('0xf'));logger[_0xffe6('0x10')](_0xffe6('0x11'),_0x255b65,_0xffe6('0xf'),JSON['stringify'](_0x49e1ad));if(_0x49e1ad[_0xffe6('0x12')]){if(_0x49e1ad[_0xffe6('0x12')][_0xffe6('0x13')]===0x1f4){logger[_0xffe6('0x12')](_0xffe6('0x14'),_0x255b65,_0x49e1ad['error'][_0xffe6('0x15')]);return _0x1741be(_0x49e1ad['error'][_0xffe6('0x15')]);}logger[_0xffe6('0x12')]('FaxInteraction,\x20%s,\x20%s',_0x255b65,_0x49e1ad[_0xffe6('0x12')][_0xffe6('0x15')]);return _0x23abec(_0x49e1ad[_0xffe6('0x12')][_0xffe6('0x15')]);}else{logger[_0xffe6('0xe')](_0xffe6('0x14'),_0x255b65,_0xffe6('0xf'));_0x23abec(_0x49e1ad[_0xffe6('0x16')][_0xffe6('0x15')]);}})['catch'](function(_0x1c1fc8){logger[_0xffe6('0x12')](_0xffe6('0x14'),_0x255b65,_0x1c1fc8);_0x1741be(_0x1c1fc8);});});}exports[_0xffe6('0x17')]=function(_0x45d61a){var _0x306aed=this;return new Promise(function(_0x4170f4,_0x3dbe6d){return db[_0xffe6('0x18')][_0xffe6('0x19')](_0x45d61a[_0xffe6('0x1a')],{'raw':_0x45d61a[_0xffe6('0x1b')]?_0x45d61a[_0xffe6('0x1b')][_0xffe6('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45d61a[_0xffe6('0x1b')]?_0x45d61a[_0xffe6('0x1b')][_0xffe6('0x1d')]||null:null,'attributes':_0x45d61a[_0xffe6('0x1b')]?_0x45d61a[_0xffe6('0x1b')][_0xffe6('0x1e')]||null:null,'limit':_0x45d61a[_0xffe6('0x1b')]?_0x45d61a[_0xffe6('0x1b')][_0xffe6('0x1f')]||null:null})[_0xffe6('0xd')](function(_0x3f4023){logger[_0xffe6('0xe')](_0xffe6('0x17'),_0x45d61a);logger[_0xffe6('0x10')](_0xffe6('0x17'),_0x45d61a,JSON[_0xffe6('0x20')](_0x3f4023));_0x4170f4(_0x3f4023);})['catch'](function(_0x492a08){logger['error']('UpdateFaxInteraction',_0x492a08[_0xffe6('0x15')],_0x45d61a);_0x3dbe6d(_0x306aed[_0xffe6('0x12')](0x1f4,_0x492a08[_0xffe6('0x15')]));});});};exports[_0xffe6('0x21')]=function(_0x1e6022){return new Promise(function(_0x3078e7,_0x15d735){return db[_0xffe6('0x18')][_0xffe6('0x22')]({'where':_0x1e6022[_0xffe6('0x1b')]?_0x1e6022[_0xffe6('0x1b')]['where']||null:null})[_0xffe6('0xd')](function(_0xeed5c){if(_0xeed5c){return _0xeed5c[_0xffe6('0x23')](_0x1e6022[_0xffe6('0x1a')]['ids'],_[_0xffe6('0x24')](_0x1e6022[_0xffe6('0x1a')],['ids','id'])||{});}})[_0xffe6('0x25')](function(_0x144bec){logger[_0xffe6('0xe')]('AddTags',_0x1e6022);logger[_0xffe6('0x10')](_0xffe6('0x26'),_0x1e6022,JSON[_0xffe6('0x20')](_0x144bec));_0x3078e7(_0x144bec);})[_0xffe6('0x27')](function(_0x48b753){logger[_0xffe6('0x12')](_0xffe6('0x26'),_0x48b753[_0xffe6('0x15')],_0x1e6022);_0x15d735(_this[_0xffe6('0x12')](0x1f4,_0x48b753[_0xffe6('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 155af72..79bcac5 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 _0xe02d=['emit','removeListener','faxInteraction:','./faxInteraction.events','save'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xe02d,0x71));var _0xde02=function(_0x54c9ba,_0x3cea45){_0x54c9ba=_0x54c9ba-0x0;var _0xfd2aa1=_0xe02d[_0x54c9ba];return _0xfd2aa1;};'use strict';var FaxInteractionEvents=require(_0xde02('0x0'));var events=[_0xde02('0x1'),'remove','update'];function createListener(_0x2b10ad,_0x6be93e){return function(_0x2aa2ec){_0x6be93e[_0xde02('0x2')](_0x2b10ad,_0x2aa2ec);};}function removeListener(_0x2df2c5,_0x1fa759){return function(){FaxInteractionEvents[_0xde02('0x3')](_0x2df2c5,_0x1fa759);};}exports['register']=function(_0x2a7581){for(var _0x325a93=0x0,_0x3be94f=events['length'];_0x325a93<_0x3be94f;_0x325a93++){var _0x53663b=events[_0x325a93];var _0x14b927=createListener(_0xde02('0x4')+_0x53663b,_0x2a7581);FaxInteractionEvents['on'](_0x53663b,_0x14b927);}}; \ No newline at end of file +var _0x0e7a=['removeListener','register','faxInteraction:','./faxInteraction.events','save','remove','emit'];(function(_0x1ca627,_0x37ab46){var _0x5af705=function(_0x2a7a7d){while(--_0x2a7a7d){_0x1ca627['push'](_0x1ca627['shift']());}};_0x5af705(++_0x37ab46);}(_0x0e7a,0x1f4));var _0xa0e7=function(_0x1ce20f,_0x1e0e71){_0x1ce20f=_0x1ce20f-0x0;var _0x2458a4=_0x0e7a[_0x1ce20f];return _0x2458a4;};'use strict';var FaxInteractionEvents=require(_0xa0e7('0x0'));var events=[_0xa0e7('0x1'),_0xa0e7('0x2'),'update'];function createListener(_0x45aa81,_0x261602){return function(_0x15dac6){_0x261602[_0xa0e7('0x3')](_0x45aa81,_0x15dac6);};}function removeListener(_0x14021e,_0x41d1ec){return function(){FaxInteractionEvents[_0xa0e7('0x4')](_0x14021e,_0x41d1ec);};}exports[_0xa0e7('0x5')]=function(_0x339201){for(var _0x13a731=0x0,_0x1f87d9=events['length'];_0x13a731<_0x1f87d9;_0x13a731++){var _0x137668=events[_0x13a731];var _0x7183f9=createListener(_0xa0e7('0x6')+_0x137668,_0x339201);FaxInteractionEvents['on'](_0x137668,_0x7183f9);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index e5eb82b..7b8ac9a 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 _0x2c2b=['addMessage','tracked','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','update','faxinteraction:destroy','delete','/:id/tags','removeTags','exports','util','path','connect-timeout','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post'];(function(_0x2effcc,_0x33bb50){var _0x58e626=function(_0x4f10ec){while(--_0x4f10ec){_0x2effcc['push'](_0x2effcc['shift']());}};_0x58e626(++_0x33bb50);}(_0x2c2b,0x1b1));var _0xb2c2=function(_0x38b255,_0x3fd343){_0x38b255=_0x38b255-0x0;var _0x26f9bb=_0x2c2b[_0x38b255];return _0x26f9bb;};'use strict';var multer=require('multer');var util=require(_0xb2c2('0x0'));var path=require(_0xb2c2('0x1'));var timeout=require(_0xb2c2('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xb2c2('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xb2c2('0x4'));var controller=require('./faxInteraction.controller');router['get']('/',auth[_0xb2c2('0x5')](),controller[_0xb2c2('0x6')]);router[_0xb2c2('0x7')](_0xb2c2('0x8'),auth[_0xb2c2('0x5')](),controller[_0xb2c2('0x9')]);router[_0xb2c2('0x7')](_0xb2c2('0xa'),auth[_0xb2c2('0x5')](),controller[_0xb2c2('0xb')]);router[_0xb2c2('0x7')](_0xb2c2('0xc'),auth[_0xb2c2('0x5')](),controller[_0xb2c2('0xd')]);router[_0xb2c2('0x7')](_0xb2c2('0xe'),auth[_0xb2c2('0x5')](),controller[_0xb2c2('0xf')]);router[_0xb2c2('0x10')]('/',auth[_0xb2c2('0x5')](),controller['create']);router[_0xb2c2('0x10')](_0xb2c2('0xc'),auth[_0xb2c2('0x5')](),controller[_0xb2c2('0x11')]);router[_0xb2c2('0x10')]('/:id/tags',auth[_0xb2c2('0x5')](),interaction[_0xb2c2('0x12')](_0xb2c2('0x13'),_0xb2c2('0x14')),controller[_0xb2c2('0x15')]);router[_0xb2c2('0x16')](_0xb2c2('0xa'),auth['isAuthenticated'](),interaction[_0xb2c2('0x12')](_0xb2c2('0x13'),_0xb2c2('0x17')),controller[_0xb2c2('0x18')]);router['delete'](_0xb2c2('0xa'),auth[_0xb2c2('0x5')](),interaction[_0xb2c2('0x12')](_0xb2c2('0x13'),_0xb2c2('0x19')),controller['destroy']);router[_0xb2c2('0x1a')](_0xb2c2('0x1b'),auth[_0xb2c2('0x5')](),controller[_0xb2c2('0x1c')]);module[_0xb2c2('0x1d')]=router; \ No newline at end of file +var _0xc459=['fax','faxinteraction:addtags','addTags','put','/:id','faxinteraction:update','delete','removeTags','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','isAuthenticated','index','/describe','get','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked'];(function(_0x46c03d,_0x1a3cba){var _0x4fe95=function(_0x1ae924){while(--_0x1ae924){_0x46c03d['push'](_0x46c03d['shift']());}};_0x4fe95(++_0x1a3cba);}(_0xc459,0x1d9));var _0x9c45=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc459[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x9c45('0x0'));var path=require('path');var timeout=require(_0x9c45('0x1'));var express=require('express');var router=express[_0x9c45('0x2')]();var auth=require(_0x9c45('0x3'));var interaction=require(_0x9c45('0x4'));var config=require(_0x9c45('0x5'));var controller=require(_0x9c45('0x6'));router['get']('/',auth[_0x9c45('0x7')](),controller[_0x9c45('0x8')]);router['get'](_0x9c45('0x9'),auth[_0x9c45('0x7')](),controller['describe']);router[_0x9c45('0xa')]('/:id',auth[_0x9c45('0x7')](),controller['show']);router[_0x9c45('0xa')](_0x9c45('0xb'),auth[_0x9c45('0x7')](),controller[_0x9c45('0xc')]);router[_0x9c45('0xa')](_0x9c45('0xd'),auth[_0x9c45('0x7')](),controller[_0x9c45('0xe')]);router[_0x9c45('0xf')]('/',auth[_0x9c45('0x7')](),controller[_0x9c45('0x10')]);router[_0x9c45('0xf')]('/:id/messages',auth[_0x9c45('0x7')](),controller[_0x9c45('0x11')]);router[_0x9c45('0xf')](_0x9c45('0x12'),auth[_0x9c45('0x7')](),interaction[_0x9c45('0x13')](_0x9c45('0x14'),_0x9c45('0x15')),controller[_0x9c45('0x16')]);router[_0x9c45('0x17')](_0x9c45('0x18'),auth[_0x9c45('0x7')](),interaction[_0x9c45('0x13')]('fax',_0x9c45('0x19')),controller['update']);router[_0x9c45('0x1a')](_0x9c45('0x18'),auth['isAuthenticated'](),interaction[_0x9c45('0x13')](_0x9c45('0x14'),'faxinteraction:destroy'),controller['destroy']);router[_0x9c45('0x1a')]('/:id/tags',auth[_0x9c45('0x7')](),controller[_0x9c45('0x1b')]);module[_0x9c45('0x1c')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index d31470a..289a3d9 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 _0x8876=['exports','TEXT','BOOLEAN','out','DATE','sequelize'];(function(_0x23bf40,_0xf05f78){var _0x33ca5c=function(_0x261581){while(--_0x261581){_0x23bf40['push'](_0x23bf40['shift']());}};_0x33ca5c(++_0xf05f78);}(_0x8876,0x119));var _0x6887=function(_0x472953,_0x427012){_0x472953=_0x472953-0x0;var _0x1a29d4=_0x8876[_0x472953];return _0x1a29d4;};'use strict';var Sequelize=require(_0x6887('0x0'));module[_0x6887('0x1')]={'body':{'type':Sequelize[_0x6887('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x6887('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x6887('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x6887('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x6887('0x5')]}}; \ No newline at end of file +var _0xa815=['TEXT','medium','BOOLEAN','out','DATE','sequelize'];(function(_0x5ad966,_0x81eaa5){var _0xf8874e=function(_0x1f0bd0){while(--_0x1f0bd0){_0x5ad966['push'](_0x5ad966['shift']());}};_0xf8874e(++_0x81eaa5);}(_0xa815,0x12b));var _0x5a81=function(_0x45c0f7,_0x3b1c07){_0x45c0f7=_0x45c0f7-0x0;var _0x56cb13=_0xa815[_0x45c0f7];return _0x56cb13;};'use strict';var Sequelize=require(_0x5a81('0x0'));module['exports']={'body':{'type':Sequelize[_0x5a81('0x1')](_0x5a81('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x5a81('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x5a81('0x4')),'defaultValue':_0x5a81('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x5a81('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0x5a81('0x5')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 8b7e579..320e032 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 _0xa9e0=['format','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','stringify','null','AcceptMessage','acceptMessage','interface','channel','event','agent','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','EventManager','rejectmessage','create','findOne','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','join','server','files','attachments','Attachment','download','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','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~!@#$%^&-_=+[{]}.','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','index','map','rawAttributes','fieldName','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','name','options','FaxMessage','includeAll','include','findAll','rows','show','intersection','find','body','params','describe','../../config/logger','fax-interactions','accept','fax','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','FaxInteraction','isNil','read1stAt'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');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 db=require(_0x0a9e('0x13'))['db'];config[_0x0a9e('0x14')]=_[_0x0a9e('0x15')](config[_0x0a9e('0x14')],{'host':_0x0a9e('0x16'),'port':0x18eb});var socket=require(_0x0a9e('0x17'))(new Redis(config['redis']));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson[_0x0a9e('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x22dccb,_0x5d0880,_0x1985b6){if(_0x1985b6){var _0x519dfd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x519dfd[_0x0a9e('0x1d')](_0x5d0880)){return _0x22dccb;}else{throw new db[(_0x0a9e('0x1e'))]['ValidationError'](_0x0a9e('0x1f'));}}else{return _0x22dccb;}}function respondWithRpcPromise(_0x5a0a06,_0x459eb1,_0x478723,_0x106033){return new BPromise(function(_0x205fd6,_0x31b1ca){var _0x2eb11f=_0x106033||client;return _0x2eb11f[_0x0a9e('0x20')](_0x5a0a06,_0x478723)[_0x0a9e('0x21')](function(_0x1314ae){logger[_0x0a9e('0x22')](_0x0a9e('0x23'),_0x459eb1,_0x0a9e('0x24'));logger['debug'](_0x0a9e('0x25'),_0x459eb1,_0x0a9e('0x24'),JSON['stringify'](_0x1314ae));if(_0x1314ae[_0x0a9e('0x26')]){if(_0x1314ae['error']['code']===0x1f4){logger[_0x0a9e('0x26')](_0x0a9e('0x23'),_0x459eb1,_0x1314ae[_0x0a9e('0x26')][_0x0a9e('0x27')]);return _0x31b1ca(_0x1314ae['error'][_0x0a9e('0x27')]);}logger[_0x0a9e('0x26')](_0x0a9e('0x23'),_0x459eb1,_0x1314ae[_0x0a9e('0x26')][_0x0a9e('0x27')]);return _0x205fd6(_0x1314ae[_0x0a9e('0x26')][_0x0a9e('0x27')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x459eb1,_0x0a9e('0x24'));_0x205fd6(_0x1314ae[_0x0a9e('0x28')][_0x0a9e('0x27')]);}})[_0x0a9e('0x29')](function(_0x526cf3){logger[_0x0a9e('0x26')]('FaxMessage,\x20%s,\x20%s',_0x459eb1,_0x526cf3);_0x31b1ca(_0x526cf3);});});}function respondWithStatusCode(_0x45a1e7,_0x5bfb33){_0x5bfb33=_0x5bfb33||0xcc;return function(_0x1dc186){if(_0x1dc186){return _0x45a1e7[_0x0a9e('0x2a')](_0x5bfb33);}return _0x45a1e7[_0x0a9e('0x2b')](_0x5bfb33)[_0x0a9e('0x2c')]();};}function respondWithResult(_0x140511,_0x1538a4){_0x1538a4=_0x1538a4||0xc8;return function(_0x11c3b6){if(_0x11c3b6){return _0x140511[_0x0a9e('0x2b')](_0x1538a4)['json'](_0x11c3b6);}};}function respondWithFilteredResult(_0x3652a7,_0x468813){return function(_0x2b1f27){if(_0x2b1f27){var _0x2ec755=_0x2b1f27[_0x0a9e('0x2d')],_0x5c877d=_0x468813[_0x0a9e('0x2e')],_0x15b200=_0x468813[_0x0a9e('0x2e')]+_0x468813[_0x0a9e('0x2f')],_0x40e7a3;if(_0x15b200>=_0x2ec755){_0x15b200=_0x2ec755;_0x40e7a3=0xc8;}else{_0x40e7a3=0xce;}_0x3652a7[_0x0a9e('0x2b')](_0x40e7a3);return _0x3652a7[_0x0a9e('0x30')](_0x0a9e('0x31'),_0x5c877d+'-'+_0x15b200+'/'+_0x2ec755)['json'](_0x2b1f27);}return null;};}function patchUpdates(_0x426950){return function(_0x5d1e0e){try{jsonpatch[_0x0a9e('0x32')](_0x5d1e0e,_0x426950,!![]);}catch(_0x3ae878){return BPromise[_0x0a9e('0x33')](_0x3ae878);}return _0x5d1e0e[_0x0a9e('0x34')]();};}function saveUpdates(_0x25ce3a,_0x5180f1){return function(_0x66c1d2){if(_0x66c1d2){return _0x66c1d2[_0x0a9e('0x35')](_0x25ce3a)[_0x0a9e('0x21')](function(_0x2da5c0){return _0x2da5c0;});}return null;};}function removeEntity(_0x2b45ea,_0x409319){return function(_0x332d35){if(_0x332d35){return _0x332d35[_0x0a9e('0x36')]()['then'](function(){_0x2b45ea[_0x0a9e('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cc7a0,_0x14b13f){return function(_0x2b7e7f){if(!_0x2b7e7f){_0x2cc7a0[_0x0a9e('0x2a')](0x194);}return _0x2b7e7f;};}function handleError(_0x567193,_0x191e91){_0x191e91=_0x191e91||0x1f4;return function(_0xd1836d){logger[_0x0a9e('0x26')](_0xd1836d[_0x0a9e('0x37')]);if(_0xd1836d['name']){delete _0xd1836d['name'];}_0x567193[_0x0a9e('0x2b')](_0x191e91)['send'](_0xd1836d);};}exports[_0x0a9e('0x38')]=function(_0x3d9717,_0x381c37){var _0x1ef87a={},_0x4f41ae={},_0x31916f={'count':0x0,'rows':[]};var _0x3bfce8=_[_0x0a9e('0x39')](db['FaxMessage'][_0x0a9e('0x3a')],function(_0x1a180b){return{'name':_0x1a180b[_0x0a9e('0x3b')],'type':_0x1a180b['type']['key']};});_0x4f41ae[_0x0a9e('0x3c')]=_[_0x0a9e('0x39')](_0x3bfce8,'name');_0x4f41ae[_0x0a9e('0x3d')]=_[_0x0a9e('0x3e')](_0x3d9717[_0x0a9e('0x3d')]);_0x4f41ae[_0x0a9e('0x3f')]=_['intersection'](_0x4f41ae['model'],_0x4f41ae[_0x0a9e('0x3d')]);_0x1ef87a[_0x0a9e('0x40')]=_['intersection'](_0x4f41ae[_0x0a9e('0x3c')],qs[_0x0a9e('0x41')](_0x3d9717[_0x0a9e('0x3d')]['fields']));_0x1ef87a[_0x0a9e('0x40')]=_0x1ef87a[_0x0a9e('0x40')][_0x0a9e('0x42')]?_0x1ef87a[_0x0a9e('0x40')]:_0x4f41ae[_0x0a9e('0x3c')];if(!_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x43')](_0x0a9e('0x44'))){_0x1ef87a[_0x0a9e('0x2f')]=qs[_0x0a9e('0x2f')](_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x2f')]);_0x1ef87a[_0x0a9e('0x2e')]=qs[_0x0a9e('0x2e')](_0x3d9717[_0x0a9e('0x3d')]['offset']);}_0x1ef87a['order']=qs[_0x0a9e('0x45')](_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x45')]);_0x1ef87a[_0x0a9e('0x46')]=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x47')](_0x3d9717[_0x0a9e('0x3d')],_0x4f41ae[_0x0a9e('0x3f')]));if(_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x48')]){_0x1ef87a[_0x0a9e('0x46')]=_[_0x0a9e('0x49')](_0x1ef87a['where'],{'$or':_[_0x0a9e('0x39')](_0x3bfce8,function(_0x138b8b){if(_0x138b8b[_0x0a9e('0x4a')]!==_0x0a9e('0x4b')){var _0x2e8caf={};_0x2e8caf[_0x138b8b[_0x0a9e('0x4c')]]={'$like':'%'+_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x48')]+'%'};return _0x2e8caf;}})});}_0x1ef87a=_['merge']({},_0x1ef87a,_0x3d9717[_0x0a9e('0x4d')]);var _0x48fd45={'where':_0x1ef87a[_0x0a9e('0x46')]};return db[_0x0a9e('0x4e')][_0x0a9e('0x2d')](_0x48fd45)['then'](function(_0x14bec2){_0x31916f[_0x0a9e('0x2d')]=_0x14bec2;if(_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x4f')]){_0x1ef87a[_0x0a9e('0x50')]=[{'all':!![]}];}return db[_0x0a9e('0x4e')][_0x0a9e('0x51')](_0x1ef87a);})['then'](function(_0x13f44d){_0x31916f[_0x0a9e('0x52')]=_0x13f44d;return _0x31916f;})[_0x0a9e('0x21')](respondWithFilteredResult(_0x381c37,_0x1ef87a))[_0x0a9e('0x29')](handleError(_0x381c37,null));};exports[_0x0a9e('0x53')]=function(_0x992c77,_0x6054ee){var _0x19383e={'raw':!![],'where':{'id':_0x992c77['params']['id']}},_0x34febd={};_0x34febd[_0x0a9e('0x3c')]=_[_0x0a9e('0x3e')](db['FaxMessage']['rawAttributes']);_0x34febd['query']=_[_0x0a9e('0x3e')](_0x992c77[_0x0a9e('0x3d')]);_0x34febd[_0x0a9e('0x3f')]=_[_0x0a9e('0x54')](_0x34febd[_0x0a9e('0x3c')],_0x34febd[_0x0a9e('0x3d')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x54')](_0x34febd['model'],qs['fields'](_0x992c77['query'][_0x0a9e('0x41')]));_0x19383e[_0x0a9e('0x40')]=_0x19383e[_0x0a9e('0x40')]['length']?_0x19383e[_0x0a9e('0x40')]:_0x34febd[_0x0a9e('0x3c')];if(_0x992c77['query']['includeAll']){_0x19383e[_0x0a9e('0x50')]=[{'all':!![]}];}_0x19383e=_['merge']({},_0x19383e,_0x992c77[_0x0a9e('0x4d')]);return db['FaxMessage'][_0x0a9e('0x55')](_0x19383e)[_0x0a9e('0x21')](handleEntityNotFound(_0x6054ee,null))[_0x0a9e('0x21')](respondWithResult(_0x6054ee,null))['catch'](handleError(_0x6054ee,null));};exports[_0x0a9e('0x35')]=function(_0x1bf38a,_0x508b47){if(_0x1bf38a['body']['id']){delete _0x1bf38a[_0x0a9e('0x56')]['id'];}return db[_0x0a9e('0x4e')]['find']({'where':{'id':_0x1bf38a[_0x0a9e('0x57')]['id']}})['then'](handleEntityNotFound(_0x508b47,null))[_0x0a9e('0x21')](saveUpdates(_0x1bf38a['body'],null))[_0x0a9e('0x21')](respondWithResult(_0x508b47,null))['catch'](handleError(_0x508b47,null));};exports['destroy']=function(_0x5df0ad,_0x2da03c){return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x5df0ad[_0x0a9e('0x57')]['id']}})[_0x0a9e('0x21')](handleEntityNotFound(_0x2da03c,null))[_0x0a9e('0x21')](removeEntity(_0x2da03c,null))[_0x0a9e('0x29')](handleError(_0x2da03c,null));};exports[_0x0a9e('0x58')]=function(_0xd10662,_0x28d814){return db['FaxMessage'][_0x0a9e('0x58')]()[_0x0a9e('0x21')](respondWithResult(_0x28d814,null))[_0x0a9e('0x29')](handleError(_0x28d814,null));};var interaction_log=require(_0x0a9e('0x59'))(_0x0a9e('0x5a'));exports[_0x0a9e('0x5b')]=function(_0x5d86e9,_0x956fbe,_0x26bc80){var _0x5239ef={'channel':_0x0a9e('0x5c')};if(_0x5d86e9['body']['id']){delete _0x5d86e9[_0x0a9e('0x56')]['id'];}_0x5d86e9['body']['read']=!![];_0x5d86e9['body'][_0x0a9e('0x5d')]=moment()['format'](_0x0a9e('0x5e'));_0x5d86e9[_0x0a9e('0x56')][_0x0a9e('0x5f')]=_0x5d86e9[_0x0a9e('0x56')][_0x0a9e('0x5f')]||_0x5d86e9[_0x0a9e('0x60')]['id'];return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x5d86e9['params']['id'],'UserId':null},'include':[{'model':db[_0x0a9e('0x61')],'as':_0x0a9e('0x62')}]})[_0x0a9e('0x21')](handleEntityNotFound(_0x956fbe,null))['then'](saveUpdates(_0x5d86e9[_0x0a9e('0x56')],null))[_0x0a9e('0x21')](function(_0x119677){if(_0x119677){_0x5239ef[_0x0a9e('0x27')]=_0x119677['get']({'plain':!![]});return db[_0x0a9e('0x63')][_0x0a9e('0x55')]({'where':{'id':_0x119677['FaxInteractionId']}});}return null;})[_0x0a9e('0x21')](handleEntityNotFound(_0x956fbe,null))[_0x0a9e('0x21')](function(_0x88dcbf){if(_0x88dcbf){return _0x88dcbf[_0x0a9e('0x35')]({'UserId':_0x5d86e9[_0x0a9e('0x56')]['UserId'],'read1stAt':_[_0x0a9e('0x64')](_0x88dcbf[_0x0a9e('0x65')])?moment()[_0x0a9e('0x66')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x0a9e('0x21')](function(_0x4f1e60){if(_0x4f1e60){_0x5239ef['interaction']=_0x4f1e60[_0x0a9e('0x67')]({'plain':!![]});interaction_log[_0x0a9e('0x22')](_0x0a9e('0x68'),_0x5d86e9[_0x0a9e('0x60')]['id'],_0x5d86e9[_0x0a9e('0x60')][_0x0a9e('0x4c')],_0x5d86e9[_0x0a9e('0x60')][_0x0a9e('0x69')],_0x5239ef[_0x0a9e('0x6a')]['id'],_0x5d86e9[_0x0a9e('0x56')]?JSON[_0x0a9e('0x6b')](_0x5d86e9[_0x0a9e('0x56')]):_0x0a9e('0x6c'));return respondWithRpcPromise(_0x0a9e('0x6d'),_0x0a9e('0x6e'),_0x5239ef);}return null;})[_0x0a9e('0x21')](function(_0x2a28c0){if(_0x2a28c0){if(_0x5d86e9[_0x0a9e('0x56')]['manual']){_0x5239ef[_0x0a9e('0x27')][_0x0a9e('0x6f')]=util[_0x0a9e('0x66')]('SIP/%s',_0x5d86e9[_0x0a9e('0x60')][_0x0a9e('0x4c')]);_0x5239ef['message'][_0x0a9e('0x70')]=_0x5239ef[_0x0a9e('0x70')];_0x5239ef[_0x0a9e('0x27')][_0x0a9e('0x71')]=_0x0a9e('0x5b');return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_0x5239ef[_0x0a9e('0x27')]},client9002)[_0x0a9e('0x21')](function(){return _0x5239ef;});}return _0x5239ef;}return null;})[_0x0a9e('0x21')](respondWithResult(_0x956fbe,null))[_0x0a9e('0x29')](handleError(_0x956fbe,null));};var interaction_log=require(_0x0a9e('0x59'))(_0x0a9e('0x5a'));exports[_0x0a9e('0x33')]=function(_0x1a0677,_0x5512d1,_0x235f8f){var _0xcbc8b2={'agent':{},'channel':_0x0a9e('0x5c')};if(_0x1a0677['body']['id']){delete _0x1a0677[_0x0a9e('0x56')]['id'];}_0x1a0677['body'][_0x0a9e('0x5f')]=_0x1a0677[_0x0a9e('0x56')]['UserId']||_0x1a0677[_0x0a9e('0x60')]['id'];_0xcbc8b2[_0x0a9e('0x72')]['id']=_0x1a0677[_0x0a9e('0x56')][_0x0a9e('0x5f')];return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x1a0677[_0x0a9e('0x57')]['id'],'UserId':null}})[_0x0a9e('0x21')](handleEntityNotFound(_0x5512d1,null))[_0x0a9e('0x21')](function(_0x5b7fc3){if(_0x5b7fc3){_0xcbc8b2[_0x0a9e('0x27')]=_0x5b7fc3[_0x0a9e('0x67')]({'plain':!![]});return db[_0x0a9e('0x63')][_0x0a9e('0x55')]({'where':{'id':_0x5b7fc3['FaxInteractionId']}});}return null;})[_0x0a9e('0x21')](handleEntityNotFound(_0x5512d1,null))[_0x0a9e('0x21')](function(_0x30a4c7){if(_0x30a4c7){_0xcbc8b2[_0x0a9e('0x6a')]=_0x30a4c7[_0x0a9e('0x67')]({'plain':!![]});interaction_log[_0x0a9e('0x22')](_0x0a9e('0x73'),_0x1a0677[_0x0a9e('0x60')]['id'],_0x1a0677[_0x0a9e('0x60')][_0x0a9e('0x4c')],_0x1a0677[_0x0a9e('0x60')][_0x0a9e('0x69')],_0xcbc8b2[_0x0a9e('0x6a')]['id'],_0x1a0677[_0x0a9e('0x56')]?JSON['stringify'](_0x1a0677[_0x0a9e('0x56')]):_0x0a9e('0x6c'));return respondWithRpcPromise(_0x0a9e('0x74'),'rejectMessage',_0xcbc8b2);}return null;})[_0x0a9e('0x21')](function(_0x33dda0){if(_0x33dda0){_0x33dda0[_0x0a9e('0x27')][_0x0a9e('0x6f')]=util['format']('SIP/%s',_0x1a0677[_0x0a9e('0x60')][_0x0a9e('0x4c')]);_0x33dda0['message'][_0x0a9e('0x70')]=_0xcbc8b2['channel'];_0x33dda0[_0x0a9e('0x27')][_0x0a9e('0x71')]='reject';respondWithRpcPromise(_0x0a9e('0x75'),_0x0a9e('0x75'),{'event':_0x0a9e('0x76'),'message':_0x33dda0[_0x0a9e('0x27')]},client9002);return _0xcbc8b2;}return null;})[_0x0a9e('0x21')](respondWithResult(_0x5512d1,null))[_0x0a9e('0x29')](handleError(_0x5512d1,null));};exports[_0x0a9e('0x77')]=function(_0x482ca2,_0x2973d3){var _0x3ca9b9;return db[_0x0a9e('0x4e')][_0x0a9e('0x77')](_0x482ca2['body'],{})[_0x0a9e('0x21')](function(_0xf0db1){_0x3ca9b9=_0xf0db1;return db['CmContact'][_0x0a9e('0x78')]({'where':{'id':_0x3ca9b9['ContactId']}});})[_0x0a9e('0x21')](function(_0x2bb25a){if(_[_0x0a9e('0x64')](_0x2bb25a)){return;}else{_0x3ca9b9[_0x0a9e('0x5c')]=_0x2bb25a['fax'];return db['Attachment'][_0x0a9e('0x78')]({'where':{'id':_0x3ca9b9[_0x0a9e('0x79')]}});}})[_0x0a9e('0x21')](function(_0x5ac73d){return respondWithRpcPromise(_0x0a9e('0x7a'),_0x0a9e('0x7a'),{'FaxAccountId':_['isNil'](_0x482ca2['body'])?undefined:_0x482ca2[_0x0a9e('0x56')]['FaxAccountId'],'path':_['isNil'](_0x5ac73d)?undefined:util['format'](_0x0a9e('0x7b'),_0x5ac73d[_0x0a9e('0x7c')]),'fax':_[_0x0a9e('0x64')](_0x3ca9b9[_0x0a9e('0x5c')])?undefined:_0x3ca9b9[_0x0a9e('0x5c')],'AttachmentId':_0x3ca9b9[_0x0a9e('0x79')]},client9002);})['then'](respondWithResult(_0x2973d3,0xc9))[_0x0a9e('0x29')](handleError(_0x2973d3,null));};exports['download']=function(_0x2871c1,_0x2aabab){var _0x18ad56=path[_0x0a9e('0x7d')](config['root'],_0x0a9e('0x7e'),_0x0a9e('0x7f'),_0x0a9e('0x80'));return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x2871c1[_0x0a9e('0x57')]['id']},'include':[{'model':db[_0x0a9e('0x81')],'as':_0x0a9e('0x81')}]})[_0x0a9e('0x21')](handleEntityNotFound(_0x2aabab,null))[_0x0a9e('0x21')](function(_0x32b9bd){if(_0x32b9bd){return _0x2aabab[_0x0a9e('0x82')](path['join'](_0x18ad56,_0x32b9bd[_0x0a9e('0x81')][_0x0a9e('0x7c')]));}})['catch'](handleError(_0x2aabab,null));}; \ No newline at end of file +var _0xa9e0=['format','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','stringify','null','AcceptMessage','acceptMessage','interface','channel','event','agent','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','EventManager','rejectmessage','create','findOne','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','join','server','files','attachments','Attachment','download','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','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~!@#$%^&-_=+[{]}.','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','index','map','rawAttributes','fieldName','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','name','options','FaxMessage','includeAll','include','findAll','rows','show','intersection','find','body','params','describe','../../config/logger','fax-interactions','accept','fax','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','FaxInteraction','isNil','read1stAt'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');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 db=require(_0x0a9e('0x13'))['db'];config[_0x0a9e('0x14')]=_[_0x0a9e('0x15')](config[_0x0a9e('0x14')],{'host':_0x0a9e('0x16'),'port':0x18eb});var socket=require(_0x0a9e('0x17'))(new Redis(config['redis']));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson[_0x0a9e('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x22dccb,_0x5d0880,_0x1985b6){if(_0x1985b6){var _0x519dfd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x519dfd[_0x0a9e('0x1d')](_0x5d0880)){return _0x22dccb;}else{throw new db[(_0x0a9e('0x1e'))]['ValidationError'](_0x0a9e('0x1f'));}}else{return _0x22dccb;}}function respondWithRpcPromise(_0x5a0a06,_0x459eb1,_0x478723,_0x106033){return new BPromise(function(_0x205fd6,_0x31b1ca){var _0x2eb11f=_0x106033||client;return _0x2eb11f[_0x0a9e('0x20')](_0x5a0a06,_0x478723)[_0x0a9e('0x21')](function(_0x1314ae){logger[_0x0a9e('0x22')](_0x0a9e('0x23'),_0x459eb1,_0x0a9e('0x24'));logger['debug'](_0x0a9e('0x25'),_0x459eb1,_0x0a9e('0x24'),JSON['stringify'](_0x1314ae));if(_0x1314ae[_0x0a9e('0x26')]){if(_0x1314ae['error']['code']===0x1f4){logger[_0x0a9e('0x26')](_0x0a9e('0x23'),_0x459eb1,_0x1314ae[_0x0a9e('0x26')][_0x0a9e('0x27')]);return _0x31b1ca(_0x1314ae['error'][_0x0a9e('0x27')]);}logger[_0x0a9e('0x26')](_0x0a9e('0x23'),_0x459eb1,_0x1314ae[_0x0a9e('0x26')][_0x0a9e('0x27')]);return _0x205fd6(_0x1314ae[_0x0a9e('0x26')][_0x0a9e('0x27')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x459eb1,_0x0a9e('0x24'));_0x205fd6(_0x1314ae[_0x0a9e('0x28')][_0x0a9e('0x27')]);}})[_0x0a9e('0x29')](function(_0x526cf3){logger[_0x0a9e('0x26')]('FaxMessage,\x20%s,\x20%s',_0x459eb1,_0x526cf3);_0x31b1ca(_0x526cf3);});});}function respondWithStatusCode(_0x45a1e7,_0x5bfb33){_0x5bfb33=_0x5bfb33||0xcc;return function(_0x1dc186){if(_0x1dc186){return _0x45a1e7[_0x0a9e('0x2a')](_0x5bfb33);}return _0x45a1e7[_0x0a9e('0x2b')](_0x5bfb33)[_0x0a9e('0x2c')]();};}function respondWithResult(_0x140511,_0x1538a4){_0x1538a4=_0x1538a4||0xc8;return function(_0x11c3b6){if(_0x11c3b6){return _0x140511[_0x0a9e('0x2b')](_0x1538a4)['json'](_0x11c3b6);}};}function respondWithFilteredResult(_0x3652a7,_0x468813){return function(_0x2b1f27){if(_0x2b1f27){var _0x2ec755=_0x2b1f27[_0x0a9e('0x2d')],_0x5c877d=_0x468813[_0x0a9e('0x2e')],_0x15b200=_0x468813[_0x0a9e('0x2e')]+_0x468813[_0x0a9e('0x2f')],_0x40e7a3;if(_0x15b200>=_0x2ec755){_0x15b200=_0x2ec755;_0x40e7a3=0xc8;}else{_0x40e7a3=0xce;}_0x3652a7[_0x0a9e('0x2b')](_0x40e7a3);return _0x3652a7[_0x0a9e('0x30')](_0x0a9e('0x31'),_0x5c877d+'-'+_0x15b200+'/'+_0x2ec755)['json'](_0x2b1f27);}return null;};}function patchUpdates(_0x426950){return function(_0x5d1e0e){try{jsonpatch[_0x0a9e('0x32')](_0x5d1e0e,_0x426950,!![]);}catch(_0x3ae878){return BPromise[_0x0a9e('0x33')](_0x3ae878);}return _0x5d1e0e[_0x0a9e('0x34')]();};}function saveUpdates(_0x25ce3a,_0x5180f1){return function(_0x66c1d2){if(_0x66c1d2){return _0x66c1d2[_0x0a9e('0x35')](_0x25ce3a)[_0x0a9e('0x21')](function(_0x2da5c0){return _0x2da5c0;});}return null;};}function removeEntity(_0x2b45ea,_0x409319){return function(_0x332d35){if(_0x332d35){return _0x332d35[_0x0a9e('0x36')]()['then'](function(){_0x2b45ea[_0x0a9e('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cc7a0,_0x14b13f){return function(_0x2b7e7f){if(!_0x2b7e7f){_0x2cc7a0[_0x0a9e('0x2a')](0x194);}return _0x2b7e7f;};}function handleError(_0x567193,_0x191e91){_0x191e91=_0x191e91||0x1f4;return function(_0xd1836d){logger[_0x0a9e('0x26')](_0xd1836d[_0x0a9e('0x37')]);if(_0xd1836d['name']){delete _0xd1836d['name'];}_0x567193[_0x0a9e('0x2b')](_0x191e91)['send'](_0xd1836d);};}exports[_0x0a9e('0x38')]=function(_0x3d9717,_0x381c37){var _0x1ef87a={},_0x4f41ae={},_0x31916f={'count':0x0,'rows':[]};var _0x3bfce8=_[_0x0a9e('0x39')](db['FaxMessage'][_0x0a9e('0x3a')],function(_0x1a180b){return{'name':_0x1a180b[_0x0a9e('0x3b')],'type':_0x1a180b['type']['key']};});_0x4f41ae[_0x0a9e('0x3c')]=_[_0x0a9e('0x39')](_0x3bfce8,'name');_0x4f41ae[_0x0a9e('0x3d')]=_[_0x0a9e('0x3e')](_0x3d9717[_0x0a9e('0x3d')]);_0x4f41ae[_0x0a9e('0x3f')]=_['intersection'](_0x4f41ae['model'],_0x4f41ae[_0x0a9e('0x3d')]);_0x1ef87a[_0x0a9e('0x40')]=_['intersection'](_0x4f41ae[_0x0a9e('0x3c')],qs[_0x0a9e('0x41')](_0x3d9717[_0x0a9e('0x3d')]['fields']));_0x1ef87a[_0x0a9e('0x40')]=_0x1ef87a[_0x0a9e('0x40')][_0x0a9e('0x42')]?_0x1ef87a[_0x0a9e('0x40')]:_0x4f41ae[_0x0a9e('0x3c')];if(!_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x43')](_0x0a9e('0x44'))){_0x1ef87a[_0x0a9e('0x2f')]=qs[_0x0a9e('0x2f')](_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x2f')]);_0x1ef87a[_0x0a9e('0x2e')]=qs[_0x0a9e('0x2e')](_0x3d9717[_0x0a9e('0x3d')]['offset']);}_0x1ef87a['order']=qs[_0x0a9e('0x45')](_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x45')]);_0x1ef87a[_0x0a9e('0x46')]=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x47')](_0x3d9717[_0x0a9e('0x3d')],_0x4f41ae[_0x0a9e('0x3f')]));if(_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x48')]){_0x1ef87a[_0x0a9e('0x46')]=_[_0x0a9e('0x49')](_0x1ef87a['where'],{'$or':_[_0x0a9e('0x39')](_0x3bfce8,function(_0x138b8b){if(_0x138b8b[_0x0a9e('0x4a')]!==_0x0a9e('0x4b')){var _0x2e8caf={};_0x2e8caf[_0x138b8b[_0x0a9e('0x4c')]]={'$like':'%'+_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x48')]+'%'};return _0x2e8caf;}})});}_0x1ef87a=_['merge']({},_0x1ef87a,_0x3d9717[_0x0a9e('0x4d')]);var _0x48fd45={'where':_0x1ef87a[_0x0a9e('0x46')]};return db[_0x0a9e('0x4e')][_0x0a9e('0x2d')](_0x48fd45)['then'](function(_0x14bec2){_0x31916f[_0x0a9e('0x2d')]=_0x14bec2;if(_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x4f')]){_0x1ef87a[_0x0a9e('0x50')]=[{'all':!![]}];}return db[_0x0a9e('0x4e')][_0x0a9e('0x51')](_0x1ef87a);})['then'](function(_0x13f44d){_0x31916f[_0x0a9e('0x52')]=_0x13f44d;return _0x31916f;})[_0x0a9e('0x21')](respondWithFilteredResult(_0x381c37,_0x1ef87a))[_0x0a9e('0x29')](handleError(_0x381c37,null));};exports[_0x0a9e('0x53')]=function(_0x992c77,_0x6054ee){var _0x19383e={'raw':!![],'where':{'id':_0x992c77['params']['id']}},_0x34febd={};_0x34febd[_0x0a9e('0x3c')]=_[_0x0a9e('0x3e')](db['FaxMessage']['rawAttributes']);_0x34febd['query']=_[_0x0a9e('0x3e')](_0x992c77[_0x0a9e('0x3d')]);_0x34febd[_0x0a9e('0x3f')]=_[_0x0a9e('0x54')](_0x34febd[_0x0a9e('0x3c')],_0x34febd[_0x0a9e('0x3d')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x54')](_0x34febd['model'],qs['fields'](_0x992c77['query'][_0x0a9e('0x41')]));_0x19383e[_0x0a9e('0x40')]=_0x19383e[_0x0a9e('0x40')]['length']?_0x19383e[_0x0a9e('0x40')]:_0x34febd[_0x0a9e('0x3c')];if(_0x992c77['query']['includeAll']){_0x19383e[_0x0a9e('0x50')]=[{'all':!![]}];}_0x19383e=_['merge']({},_0x19383e,_0x992c77[_0x0a9e('0x4d')]);return db['FaxMessage'][_0x0a9e('0x55')](_0x19383e)[_0x0a9e('0x21')](handleEntityNotFound(_0x6054ee,null))[_0x0a9e('0x21')](respondWithResult(_0x6054ee,null))['catch'](handleError(_0x6054ee,null));};exports[_0x0a9e('0x35')]=function(_0x1bf38a,_0x508b47){if(_0x1bf38a['body']['id']){delete _0x1bf38a[_0x0a9e('0x56')]['id'];}return db[_0x0a9e('0x4e')]['find']({'where':{'id':_0x1bf38a[_0x0a9e('0x57')]['id']}})['then'](handleEntityNotFound(_0x508b47,null))[_0x0a9e('0x21')](saveUpdates(_0x1bf38a['body'],null))[_0x0a9e('0x21')](respondWithResult(_0x508b47,null))['catch'](handleError(_0x508b47,null));};exports['destroy']=function(_0x5df0ad,_0x2da03c){return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x5df0ad[_0x0a9e('0x57')]['id']}})[_0x0a9e('0x21')](handleEntityNotFound(_0x2da03c,null))[_0x0a9e('0x21')](removeEntity(_0x2da03c,null))[_0x0a9e('0x29')](handleError(_0x2da03c,null));};exports[_0x0a9e('0x58')]=function(_0xd10662,_0x28d814){return db['FaxMessage'][_0x0a9e('0x58')]()[_0x0a9e('0x21')](respondWithResult(_0x28d814,null))[_0x0a9e('0x29')](handleError(_0x28d814,null));};var interaction_log=require(_0x0a9e('0x59'))(_0x0a9e('0x5a'));exports[_0x0a9e('0x5b')]=function(_0x5d86e9,_0x956fbe,_0x26bc80){var _0x5239ef={'channel':_0x0a9e('0x5c')};if(_0x5d86e9['body']['id']){delete _0x5d86e9[_0x0a9e('0x56')]['id'];}_0x5d86e9['body']['read']=!![];_0x5d86e9['body'][_0x0a9e('0x5d')]=moment()['format'](_0x0a9e('0x5e'));_0x5d86e9[_0x0a9e('0x56')][_0x0a9e('0x5f')]=_0x5d86e9[_0x0a9e('0x56')][_0x0a9e('0x5f')]||_0x5d86e9[_0x0a9e('0x60')]['id'];return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x5d86e9['params']['id'],'UserId':null},'include':[{'model':db[_0x0a9e('0x61')],'as':_0x0a9e('0x62')}]})[_0x0a9e('0x21')](handleEntityNotFound(_0x956fbe,null))['then'](saveUpdates(_0x5d86e9[_0x0a9e('0x56')],null))[_0x0a9e('0x21')](function(_0x119677){if(_0x119677){_0x5239ef[_0x0a9e('0x27')]=_0x119677['get']({'plain':!![]});return db[_0x0a9e('0x63')][_0x0a9e('0x55')]({'where':{'id':_0x119677['FaxInteractionId']}});}return null;})[_0x0a9e('0x21')](handleEntityNotFound(_0x956fbe,null))[_0x0a9e('0x21')](function(_0x88dcbf){if(_0x88dcbf){return _0x88dcbf[_0x0a9e('0x35')]({'UserId':_0x5d86e9[_0x0a9e('0x56')]['UserId'],'read1stAt':_[_0x0a9e('0x64')](_0x88dcbf[_0x0a9e('0x65')])?moment()[_0x0a9e('0x66')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x0a9e('0x21')](function(_0x4f1e60){if(_0x4f1e60){_0x5239ef['interaction']=_0x4f1e60[_0x0a9e('0x67')]({'plain':!![]});interaction_log[_0x0a9e('0x22')](_0x0a9e('0x68'),_0x5d86e9[_0x0a9e('0x60')]['id'],_0x5d86e9[_0x0a9e('0x60')][_0x0a9e('0x4c')],_0x5d86e9[_0x0a9e('0x60')][_0x0a9e('0x69')],_0x5239ef[_0x0a9e('0x6a')]['id'],_0x5d86e9[_0x0a9e('0x56')]?JSON[_0x0a9e('0x6b')](_0x5d86e9[_0x0a9e('0x56')]):_0x0a9e('0x6c'));return respondWithRpcPromise(_0x0a9e('0x6d'),_0x0a9e('0x6e'),_0x5239ef);}return null;})[_0x0a9e('0x21')](function(_0x2a28c0){if(_0x2a28c0){if(_0x5d86e9[_0x0a9e('0x56')]['manual']){_0x5239ef[_0x0a9e('0x27')][_0x0a9e('0x6f')]=util[_0x0a9e('0x66')]('SIP/%s',_0x5d86e9[_0x0a9e('0x60')][_0x0a9e('0x4c')]);_0x5239ef['message'][_0x0a9e('0x70')]=_0x5239ef[_0x0a9e('0x70')];_0x5239ef[_0x0a9e('0x27')][_0x0a9e('0x71')]=_0x0a9e('0x5b');return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_0x5239ef[_0x0a9e('0x27')]},client9002)[_0x0a9e('0x21')](function(){return _0x5239ef;});}return _0x5239ef;}return null;})[_0x0a9e('0x21')](respondWithResult(_0x956fbe,null))[_0x0a9e('0x29')](handleError(_0x956fbe,null));};var interaction_log=require(_0x0a9e('0x59'))(_0x0a9e('0x5a'));exports[_0x0a9e('0x33')]=function(_0x1a0677,_0x5512d1,_0x235f8f){var _0xcbc8b2={'agent':{},'channel':_0x0a9e('0x5c')};if(_0x1a0677['body']['id']){delete _0x1a0677[_0x0a9e('0x56')]['id'];}_0x1a0677['body'][_0x0a9e('0x5f')]=_0x1a0677[_0x0a9e('0x56')]['UserId']||_0x1a0677[_0x0a9e('0x60')]['id'];_0xcbc8b2[_0x0a9e('0x72')]['id']=_0x1a0677[_0x0a9e('0x56')][_0x0a9e('0x5f')];return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x1a0677[_0x0a9e('0x57')]['id'],'UserId':null}})[_0x0a9e('0x21')](handleEntityNotFound(_0x5512d1,null))[_0x0a9e('0x21')](function(_0x5b7fc3){if(_0x5b7fc3){_0xcbc8b2[_0x0a9e('0x27')]=_0x5b7fc3[_0x0a9e('0x67')]({'plain':!![]});return db[_0x0a9e('0x63')][_0x0a9e('0x55')]({'where':{'id':_0x5b7fc3['FaxInteractionId']}});}return null;})[_0x0a9e('0x21')](handleEntityNotFound(_0x5512d1,null))[_0x0a9e('0x21')](function(_0x30a4c7){if(_0x30a4c7){_0xcbc8b2[_0x0a9e('0x6a')]=_0x30a4c7[_0x0a9e('0x67')]({'plain':!![]});interaction_log[_0x0a9e('0x22')](_0x0a9e('0x73'),_0x1a0677[_0x0a9e('0x60')]['id'],_0x1a0677[_0x0a9e('0x60')][_0x0a9e('0x4c')],_0x1a0677[_0x0a9e('0x60')][_0x0a9e('0x69')],_0xcbc8b2[_0x0a9e('0x6a')]['id'],_0x1a0677[_0x0a9e('0x56')]?JSON['stringify'](_0x1a0677[_0x0a9e('0x56')]):_0x0a9e('0x6c'));return respondWithRpcPromise(_0x0a9e('0x74'),'rejectMessage',_0xcbc8b2);}return null;})[_0x0a9e('0x21')](function(_0x33dda0){if(_0x33dda0){_0x33dda0[_0x0a9e('0x27')][_0x0a9e('0x6f')]=util['format']('SIP/%s',_0x1a0677[_0x0a9e('0x60')][_0x0a9e('0x4c')]);_0x33dda0['message'][_0x0a9e('0x70')]=_0xcbc8b2['channel'];_0x33dda0[_0x0a9e('0x27')][_0x0a9e('0x71')]='reject';respondWithRpcPromise(_0x0a9e('0x75'),_0x0a9e('0x75'),{'event':_0x0a9e('0x76'),'message':_0x33dda0[_0x0a9e('0x27')]},client9002);return _0xcbc8b2;}return null;})[_0x0a9e('0x21')](respondWithResult(_0x5512d1,null))[_0x0a9e('0x29')](handleError(_0x5512d1,null));};exports[_0x0a9e('0x77')]=function(_0x482ca2,_0x2973d3){var _0x3ca9b9;return db[_0x0a9e('0x4e')][_0x0a9e('0x77')](_0x482ca2['body'],{})[_0x0a9e('0x21')](function(_0xf0db1){_0x3ca9b9=_0xf0db1;return db['CmContact'][_0x0a9e('0x78')]({'where':{'id':_0x3ca9b9['ContactId']}});})[_0x0a9e('0x21')](function(_0x2bb25a){if(_[_0x0a9e('0x64')](_0x2bb25a)){return;}else{_0x3ca9b9[_0x0a9e('0x5c')]=_0x2bb25a['fax'];return db['Attachment'][_0x0a9e('0x78')]({'where':{'id':_0x3ca9b9[_0x0a9e('0x79')]}});}})[_0x0a9e('0x21')](function(_0x5ac73d){return respondWithRpcPromise(_0x0a9e('0x7a'),_0x0a9e('0x7a'),{'FaxAccountId':_['isNil'](_0x482ca2['body'])?undefined:_0x482ca2[_0x0a9e('0x56')]['FaxAccountId'],'path':_['isNil'](_0x5ac73d)?undefined:util['format'](_0x0a9e('0x7b'),_0x5ac73d[_0x0a9e('0x7c')]),'fax':_[_0x0a9e('0x64')](_0x3ca9b9[_0x0a9e('0x5c')])?undefined:_0x3ca9b9[_0x0a9e('0x5c')],'AttachmentId':_0x3ca9b9[_0x0a9e('0x79')]},client9002);})['then'](respondWithResult(_0x2973d3,0xc9))[_0x0a9e('0x29')](handleError(_0x2973d3,null));};exports['download']=function(_0x2871c1,_0x2aabab){var _0x18ad56=path[_0x0a9e('0x7d')](config['root'],_0x0a9e('0x7e'),_0x0a9e('0x7f'),_0x0a9e('0x80'));return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x2871c1[_0x0a9e('0x57')]['id']},'include':[{'model':db[_0x0a9e('0x81')],'as':_0x0a9e('0x81')}]})[_0x0a9e('0x21')](handleEntityNotFound(_0x2aabab,null))[_0x0a9e('0x21')](function(_0x32b9bd){if(_0x32b9bd){return _0x2aabab[_0x0a9e('0x82')](path['join'](_0x18ad56,_0x32b9bd[_0x0a9e('0x81')][_0x0a9e('0x7c')]));}})['catch'](handleError(_0x2aabab,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index d8f490d..1abb0bc 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 _0x34e8=['emit','hasOwnProperty','exports','events','../../mysqldb','FaxMessage','setMaxListeners','update','remove'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x34e8,0x12c));var _0x834e=function(_0x150157,_0x4747ff){_0x150157=_0x150157-0x0;var _0x2f0654=_0x34e8[_0x150157];return _0x2f0654;};'use strict';var EventEmitter=require(_0x834e('0x0'));var FaxMessage=require(_0x834e('0x1'))['db'][_0x834e('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x834e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x834e('0x4'),'afterDestroy':_0x834e('0x5')};function emitEvent(_0x472111){return function(_0x31bf20,_0x289ef2,_0x19a3e0){FaxMessageEvents[_0x834e('0x6')](_0x472111+':'+_0x31bf20['id'],_0x31bf20);FaxMessageEvents['emit'](_0x472111,_0x31bf20);_0x19a3e0(null);};}for(var e in events){if(events[_0x834e('0x7')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x834e('0x8')]=FaxMessageEvents; \ No newline at end of file +var _0x34e8=['emit','hasOwnProperty','exports','events','../../mysqldb','FaxMessage','setMaxListeners','update','remove'];(function(_0x58dc25,_0x49b9d5){var _0x21b0a7=function(_0x38a186){while(--_0x38a186){_0x58dc25['push'](_0x58dc25['shift']());}};_0x21b0a7(++_0x49b9d5);}(_0x34e8,0x12c));var _0x834e=function(_0x4b5458,_0x4f6e17){_0x4b5458=_0x4b5458-0x0;var _0x29bab3=_0x34e8[_0x4b5458];return _0x29bab3;};'use strict';var EventEmitter=require(_0x834e('0x0'));var FaxMessage=require(_0x834e('0x1'))['db'][_0x834e('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x834e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x834e('0x4'),'afterDestroy':_0x834e('0x5')};function emitEvent(_0x472111){return function(_0x31bf20,_0x289ef2,_0x19a3e0){FaxMessageEvents[_0x834e('0x6')](_0x472111+':'+_0x31bf20['id'],_0x31bf20);FaxMessageEvents['emit'](_0x472111,_0x31bf20);_0x19a3e0(null);};}for(var e in events){if(events[_0x834e('0x7')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x834e('0x8')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index afa65b2..8b1ac5f 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 _0x9a5f=['path','rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','get','direction','toLowerCase','isNil','findOne','then','update','createdAt','catch','utf8mb4_unicode_ci','util','../../config/logger','bluebird','request-promise'];(function(_0x1697e7,_0x518399){var _0x2ac25a=function(_0x2d8c1c){while(--_0x2d8c1c){_0x1697e7['push'](_0x1697e7['shift']());}};_0x2ac25a(++_0x518399);}(_0x9a5f,0x1ac));var _0xf9a5=function(_0x3e1555,_0xd901c2){_0x3e1555=_0x3e1555-0x0;var _0x14824b=_0x9a5f[_0x3e1555];return _0x14824b;};'use strict';var _=require('lodash');var util=require(_0xf9a5('0x0'));var logger=require(_0xf9a5('0x1'))('api');var moment=require('moment');var BPromise=require(_0xf9a5('0x2'));var rp=require(_0xf9a5('0x3'));var fs=require('fs');var path=require(_0xf9a5('0x4'));var rimraf=require(_0xf9a5('0x5'));var config=require(_0xf9a5('0x6'));var attributes=require(_0xf9a5('0x7'));module[_0xf9a5('0x8')]=function(_0xb4d4ad,_0x186c4c){return _0xb4d4ad[_0xf9a5('0x9')](_0xf9a5('0xa'),attributes,{'tableName':_0xf9a5('0xb'),'paranoid':![],'indexes':[{'name':_0xf9a5('0xc'),'fields':[_0xf9a5('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x383402,_0x4bed57,_0x2a806e){var _0x1d869b=_0xb4d4ad['models'];var _0x318e16=_0x383402[_0xf9a5('0xe')]({'plain':!![]});if(_0x318e16[_0xf9a5('0xf')][_0xf9a5('0x10')]()==='in'||_0x318e16[_0xf9a5('0xf')][_0xf9a5('0x10')]()==='out'&&!_0x318e16['secret']&&!_[_0xf9a5('0x11')](_0x318e16['UserId'])){_0x1d869b['FaxInteraction'][_0xf9a5('0x12')]({'where':{'id':_0x318e16['FaxInteractionId']}})[_0xf9a5('0x13')](function(_0xd30646){if(_0xd30646){_0xd30646[_0xf9a5('0x14')]({'lastMsgAt':_0x318e16[_0xf9a5('0x15')],'lastMsgDirection':_0x318e16[_0xf9a5('0xf')][_0xf9a5('0x10')]()});}})[_0xf9a5('0x16')](function(_0x3fb9d0){console['error'](_0x3fb9d0);});}_0x2a806e();}},'charset':'utf8mb4','collate':_0xf9a5('0x17')});}; \ No newline at end of file +var _0xf7b0=['FaxInteraction','findOne','FaxInteractionId','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','direction','toLowerCase','out','isNil','UserId'];(function(_0x3b5049,_0x495a94){var _0x12454e=function(_0x3988d3){while(--_0x3988d3){_0x3b5049['push'](_0x3b5049['shift']());}};_0x12454e(++_0x495a94);}(_0xf7b0,0x182));var _0x0f7b=function(_0xe3bb4c,_0x21a5b4){_0xe3bb4c=_0xe3bb4c-0x0;var _0x20b531=_0xf7b0[_0xe3bb4c];return _0x20b531;};'use strict';var _=require('lodash');var util=require(_0x0f7b('0x0'));var logger=require(_0x0f7b('0x1'))(_0x0f7b('0x2'));var moment=require('moment');var BPromise=require(_0x0f7b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0f7b('0x4'));var rimraf=require(_0x0f7b('0x5'));var config=require(_0x0f7b('0x6'));var attributes=require('./faxMessage.attributes');module[_0x0f7b('0x7')]=function(_0x57196f,_0x38a893){return _0x57196f[_0x0f7b('0x8')](_0x0f7b('0x9'),attributes,{'tableName':_0x0f7b('0xa'),'paranoid':![],'indexes':[{'name':_0x0f7b('0xb'),'fields':[_0x0f7b('0xc')],'type':_0x0f7b('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x42ac23,_0x19343b,_0x45b3d5){var _0x7a7bf8=_0x57196f['models'];var _0x46850c=_0x42ac23['get']({'plain':!![]});if(_0x46850c[_0x0f7b('0xe')][_0x0f7b('0xf')]()==='in'||_0x46850c['direction'][_0x0f7b('0xf')]()===_0x0f7b('0x10')&&!_0x46850c['secret']&&!_[_0x0f7b('0x11')](_0x46850c[_0x0f7b('0x12')])){_0x7a7bf8[_0x0f7b('0x13')][_0x0f7b('0x14')]({'where':{'id':_0x46850c[_0x0f7b('0x15')]}})['then'](function(_0xa35bcd){if(_0xa35bcd){_0xa35bcd[_0x0f7b('0x16')]({'lastMsgAt':_0x46850c[_0x0f7b('0x17')],'lastMsgDirection':_0x46850c[_0x0f7b('0xe')][_0x0f7b('0xf')]()});}})['catch'](function(_0x16cf36){console[_0x0f7b('0x18')](_0x16cf36);});}_0x45b3d5();}},'charset':_0x0f7b('0x19'),'collate':_0x0f7b('0x1a')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 78cff64..9977d3c 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 _0xb356=['info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','body','then','CreateFaxMessage','debug','UpdateFaxMessage','update','options','raw','where','limit','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','./faxMessage.socket','register','request'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xb356,0x15d));var _0x6b35=function(_0x5e9e7b,_0xb598ca){_0x5e9e7b=_0x5e9e7b-0x0;var _0x4eb7f0=_0xb356[_0x5e9e7b];return _0x4eb7f0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6b35('0x0'));var BPromise=require('bluebird');var rs=require(_0x6b35('0x1'));var fs=require('fs');var Redis=require(_0x6b35('0x2'));var db=require(_0x6b35('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x6b35('0x4'))(_0x6b35('0x5'));var config=require(_0x6b35('0x6'));var jayson=require(_0x6b35('0x7'));var client=jayson[_0x6b35('0x8')]['http']({'port':0x232a});config['redis']=_[_0x6b35('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6b35('0xa')]));require(_0x6b35('0xb'))[_0x6b35('0xc')](socket);function respondWithRpcPromise(_0x403c7b,_0x22bc94,_0x28e0a7){return new BPromise(function(_0x1fb426,_0x5d80a5){return client[_0x6b35('0xd')](_0x403c7b,_0x28e0a7)['then'](function(_0x25b776){logger[_0x6b35('0xe')](_0x6b35('0xf'),_0x22bc94,_0x6b35('0x10'));logger['debug'](_0x6b35('0x11'),_0x22bc94,'request\x20sent',JSON[_0x6b35('0x12')](_0x25b776));if(_0x25b776[_0x6b35('0x13')]){if(_0x25b776['error']['code']===0x1f4){logger[_0x6b35('0x13')](_0x6b35('0xf'),_0x22bc94,_0x25b776['error'][_0x6b35('0x14')]);return _0x5d80a5(_0x25b776[_0x6b35('0x13')][_0x6b35('0x14')]);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x22bc94,_0x25b776['error'][_0x6b35('0x14')]);return _0x1fb426(_0x25b776[_0x6b35('0x13')][_0x6b35('0x14')]);}else{logger[_0x6b35('0xe')]('FaxMessage,\x20%s,\x20%s',_0x22bc94,_0x6b35('0x10'));_0x1fb426(_0x25b776[_0x6b35('0x15')][_0x6b35('0x14')]);}})[_0x6b35('0x16')](function(_0x54a06e){logger[_0x6b35('0x13')]('FaxMessage,\x20%s,\x20%s',_0x22bc94,_0x54a06e);_0x5d80a5(_0x54a06e);});});}exports['CreateFaxMessage']=function(_0x555f7d){var _0x152391=this;return new Promise(function(_0x4c322a,_0x268ccb){return db['FaxMessage']['create'](_0x555f7d[_0x6b35('0x17')],{'raw':_0x555f7d['options']?_0x555f7d['options']['raw']===undefined?!![]:![]:!![]})[_0x6b35('0x18')](function(_0x5e5f0c){logger[_0x6b35('0xe')](_0x6b35('0x19'),_0x555f7d);logger[_0x6b35('0x1a')](_0x6b35('0x19'),_0x555f7d,JSON['stringify'](_0x5e5f0c));_0x4c322a(_0x5e5f0c);})[_0x6b35('0x16')](function(_0x4b06f6){logger[_0x6b35('0x13')](_0x6b35('0x19'),_0x4b06f6['message'],_0x555f7d);_0x268ccb(_0x152391[_0x6b35('0x13')](0x1f4,_0x4b06f6[_0x6b35('0x14')]));});});};exports[_0x6b35('0x1b')]=function(_0x41f132){var _0x25e159=this;return new Promise(function(_0x3edeac,_0x30e71f){return db['FaxMessage'][_0x6b35('0x1c')](_0x41f132[_0x6b35('0x17')],{'raw':_0x41f132[_0x6b35('0x1d')]?_0x41f132[_0x6b35('0x1d')][_0x6b35('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x41f132[_0x6b35('0x1d')]?_0x41f132['options'][_0x6b35('0x1f')]||null:null,'attributes':_0x41f132[_0x6b35('0x1d')]?_0x41f132[_0x6b35('0x1d')]['attributes']||null:null,'limit':_0x41f132[_0x6b35('0x1d')]?_0x41f132['options'][_0x6b35('0x20')]||null:null})[_0x6b35('0x18')](function(_0x1d34a1){logger['info'](_0x6b35('0x1b'),_0x41f132);logger[_0x6b35('0x1a')](_0x6b35('0x1b'),_0x41f132,JSON['stringify'](_0x1d34a1));_0x3edeac(_0x1d34a1);})[_0x6b35('0x16')](function(_0x1417f7){logger[_0x6b35('0x13')](_0x6b35('0x1b'),_0x1417f7[_0x6b35('0x14')],_0x41f132);_0x30e71f(_0x25e159[_0x6b35('0x13')](0x1f4,_0x1417f7['message']));});});}; \ No newline at end of file +var _0x5ac2=['info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateFaxMessage','FaxMessage','body','options','UpdateFaxMessage','raw','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','request','then'];(function(_0x2cc3ba,_0x411af2){var _0x311175=function(_0xd3c3e){while(--_0xd3c3e){_0x2cc3ba['push'](_0x2cc3ba['shift']());}};_0x311175(++_0x411af2);}(_0x5ac2,0x1b5));var _0x25ac=function(_0x41f044,_0x51de66){_0x41f044=_0x41f044-0x0;var _0x19b6b1=_0x5ac2[_0x41f044];return _0x19b6b1;};'use strict';var _=require(_0x25ac('0x0'));var util=require(_0x25ac('0x1'));var moment=require(_0x25ac('0x2'));var BPromise=require(_0x25ac('0x3'));var rs=require(_0x25ac('0x4'));var fs=require('fs');var Redis=require(_0x25ac('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x25ac('0x6'));var logger=require('../../config/logger')(_0x25ac('0x7'));var config=require(_0x25ac('0x8'));var jayson=require(_0x25ac('0x9'));var client=jayson[_0x25ac('0xa')]['http']({'port':0x232a});config[_0x25ac('0xb')]=_[_0x25ac('0xc')](config[_0x25ac('0xb')],{'host':_0x25ac('0xd'),'port':0x18eb});var socket=require(_0x25ac('0xe'))(new Redis(config[_0x25ac('0xb')]));require(_0x25ac('0xf'))[_0x25ac('0x10')](socket);function respondWithRpcPromise(_0x3a4525,_0x44aa6d,_0x13df43){return new BPromise(function(_0xcc7720,_0x413d1b){return client[_0x25ac('0x11')](_0x3a4525,_0x13df43)[_0x25ac('0x12')](function(_0x5760eb){logger[_0x25ac('0x13')](_0x25ac('0x14'),_0x44aa6d,_0x25ac('0x15'));logger[_0x25ac('0x16')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x44aa6d,_0x25ac('0x15'),JSON[_0x25ac('0x17')](_0x5760eb));if(_0x5760eb['error']){if(_0x5760eb[_0x25ac('0x18')][_0x25ac('0x19')]===0x1f4){logger['error'](_0x25ac('0x14'),_0x44aa6d,_0x5760eb['error']['message']);return _0x413d1b(_0x5760eb['error'][_0x25ac('0x1a')]);}logger['error'](_0x25ac('0x14'),_0x44aa6d,_0x5760eb['error']['message']);return _0xcc7720(_0x5760eb[_0x25ac('0x18')][_0x25ac('0x1a')]);}else{logger[_0x25ac('0x13')](_0x25ac('0x14'),_0x44aa6d,'request\x20sent');_0xcc7720(_0x5760eb[_0x25ac('0x1b')]['message']);}})[_0x25ac('0x1c')](function(_0x229d04){logger[_0x25ac('0x18')](_0x25ac('0x14'),_0x44aa6d,_0x229d04);_0x413d1b(_0x229d04);});});}exports[_0x25ac('0x1d')]=function(_0x4dd904){var _0x1e48aa=this;return new Promise(function(_0x16bdc0,_0xf42e37){return db[_0x25ac('0x1e')]['create'](_0x4dd904[_0x25ac('0x1f')],{'raw':_0x4dd904[_0x25ac('0x20')]?_0x4dd904['options']['raw']===undefined?!![]:![]:!![]})[_0x25ac('0x12')](function(_0xb35abd){logger[_0x25ac('0x13')](_0x25ac('0x1d'),_0x4dd904);logger[_0x25ac('0x16')](_0x25ac('0x1d'),_0x4dd904,JSON[_0x25ac('0x17')](_0xb35abd));_0x16bdc0(_0xb35abd);})['catch'](function(_0x4e4f8a){logger[_0x25ac('0x18')](_0x25ac('0x1d'),_0x4e4f8a['message'],_0x4dd904);_0xf42e37(_0x1e48aa[_0x25ac('0x18')](0x1f4,_0x4e4f8a[_0x25ac('0x1a')]));});});};exports[_0x25ac('0x21')]=function(_0x4a7027){var _0x54591f=this;return new Promise(function(_0x1edb5f,_0x146e64){return db[_0x25ac('0x1e')]['update'](_0x4a7027[_0x25ac('0x1f')],{'raw':_0x4a7027[_0x25ac('0x20')]?_0x4a7027[_0x25ac('0x20')][_0x25ac('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a7027[_0x25ac('0x20')]?_0x4a7027[_0x25ac('0x20')][_0x25ac('0x23')]||null:null,'attributes':_0x4a7027[_0x25ac('0x20')]?_0x4a7027[_0x25ac('0x20')][_0x25ac('0x24')]||null:null,'limit':_0x4a7027[_0x25ac('0x20')]?_0x4a7027[_0x25ac('0x20')][_0x25ac('0x25')]||null:null})[_0x25ac('0x12')](function(_0x52ef11){logger['info']('UpdateFaxMessage',_0x4a7027);logger[_0x25ac('0x16')]('UpdateFaxMessage',_0x4a7027,JSON[_0x25ac('0x17')](_0x52ef11));_0x1edb5f(_0x52ef11);})[_0x25ac('0x1c')](function(_0x5212fa){logger[_0x25ac('0x18')]('UpdateFaxMessage',_0x5212fa[_0x25ac('0x1a')],_0x4a7027);_0x146e64(_0x54591f[_0x25ac('0x18')](0x1f4,_0x5212fa[_0x25ac('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 47fb48d..bfb9dea 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 _0xa9e0=['register','length','faxMessage:','./faxMessage.events','save','remove','emit','removeListener'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'use strict';var FaxMessageEvents=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(){FaxMessageEvents[_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);FaxMessageEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','faxMessage:','./faxMessage.events','save','remove','emit','removeListener'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'use strict';var FaxMessageEvents=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(){FaxMessageEvents[_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);FaxMessageEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index fd2a1c4..5ee15ff 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 _0xbe2d=['/:id/reject','reject','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','describe','/:id','show','/:id/download','download','tracked','fax','faxmessage:create','create','update','put','/:id/accept'];(function(_0x468c3c,_0x7f60af){var _0x2a8c3e=function(_0x361b5d){while(--_0x361b5d){_0x468c3c['push'](_0x468c3c['shift']());}};_0x2a8c3e(++_0x7f60af);}(_0xbe2d,0x17b));var _0xdbe2=function(_0x4475a1,_0x360982){_0x4475a1=_0x4475a1-0x0;var _0x5245ed=_0xbe2d[_0x4475a1];return _0x5245ed;};'use strict';var multer=require(_0xdbe2('0x0'));var util=require('util');var path=require(_0xdbe2('0x1'));var timeout=require(_0xdbe2('0x2'));var express=require(_0xdbe2('0x3'));var router=express[_0xdbe2('0x4')]();var auth=require(_0xdbe2('0x5'));var interaction=require(_0xdbe2('0x6'));var config=require('../../config/environment');var controller=require('./faxMessage.controller');router[_0xdbe2('0x7')]('/',auth[_0xdbe2('0x8')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0xdbe2('0x9')]);router[_0xdbe2('0x7')](_0xdbe2('0xa'),auth[_0xdbe2('0x8')](),controller[_0xdbe2('0xb')]);router[_0xdbe2('0x7')](_0xdbe2('0xc'),auth['isAuthenticated'](),controller[_0xdbe2('0xd')]);router['post']('/',auth[_0xdbe2('0x8')](),interaction[_0xdbe2('0xe')](_0xdbe2('0xf'),_0xdbe2('0x10')),controller[_0xdbe2('0x11')]);router['put'](_0xdbe2('0xa'),auth[_0xdbe2('0x8')](),controller[_0xdbe2('0x12')]);router[_0xdbe2('0x13')](_0xdbe2('0x14'),auth[_0xdbe2('0x8')](),controller['accept']);router[_0xdbe2('0x13')](_0xdbe2('0x15'),auth[_0xdbe2('0x8')](),controller[_0xdbe2('0x16')]);router[_0xdbe2('0x17')]('/:id',auth['isAuthenticated'](),controller[_0xdbe2('0x18')]);module['exports']=router; \ No newline at end of file +var _0x6e00=['describe','/:id','show','/:id/download','post','tracked','fax','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./faxMessage.controller','get','isAuthenticated','/describe'];(function(_0x6901ba,_0x15bf48){var _0x31e922=function(_0x3fd94e){while(--_0x3fd94e){_0x6901ba['push'](_0x6901ba['shift']());}};_0x31e922(++_0x15bf48);}(_0x6e00,0xb9));var _0x06e0=function(_0x4a8ad5,_0x293fe9){_0x4a8ad5=_0x4a8ad5-0x0;var _0x26be56=_0x6e00[_0x4a8ad5];return _0x26be56;};'use strict';var multer=require(_0x06e0('0x0'));var util=require(_0x06e0('0x1'));var path=require(_0x06e0('0x2'));var timeout=require(_0x06e0('0x3'));var express=require(_0x06e0('0x4'));var router=express[_0x06e0('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x06e0('0x6'));var config=require('../../config/environment');var controller=require(_0x06e0('0x7'));router[_0x06e0('0x8')]('/',auth[_0x06e0('0x9')](),controller['index']);router[_0x06e0('0x8')](_0x06e0('0xa'),auth[_0x06e0('0x9')](),controller[_0x06e0('0xb')]);router[_0x06e0('0x8')](_0x06e0('0xc'),auth[_0x06e0('0x9')](),controller[_0x06e0('0xd')]);router[_0x06e0('0x8')](_0x06e0('0xe'),auth[_0x06e0('0x9')](),controller['download']);router[_0x06e0('0xf')]('/',auth['isAuthenticated'](),interaction[_0x06e0('0x10')](_0x06e0('0x11'),'faxmessage:create'),controller[_0x06e0('0x12')]);router[_0x06e0('0x13')](_0x06e0('0xc'),auth[_0x06e0('0x9')](),controller[_0x06e0('0x14')]);router[_0x06e0('0x13')](_0x06e0('0x15'),auth['isAuthenticated'](),controller[_0x06e0('0x16')]);router[_0x06e0('0x13')](_0x06e0('0x17'),auth['isAuthenticated'](),controller[_0x06e0('0x18')]);router[_0x06e0('0x19')]('/:id',auth[_0x06e0('0x9')](),controller[_0x06e0('0x1a')]);module[_0x06e0('0x1b')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index e254cbd..8d33be0 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 _0xe7f3=['roundrobin','sequelize','STRING','INTEGER','ENUM','rrmemory','beepall'];(function(_0x5de304,_0x2167f6){var _0x12d53e=function(_0x2b9ee2){while(--_0x2b9ee2){_0x5de304['push'](_0x5de304['shift']());}};_0x12d53e(++_0x2167f6);}(_0xe7f3,0x16d));var _0x3e7f=function(_0x29ae55,_0x227f9c){_0x29ae55=_0x29ae55-0x0;var _0x42d09b=_0xe7f3[_0x29ae55];return _0x42d09b;};'use strict';var Sequelize=require(_0x3e7f('0x0'));module['exports']={'name':{'type':Sequelize[_0x3e7f('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3e7f('0x1')]},'timeout':{'type':Sequelize[_0x3e7f('0x2')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3e7f('0x3')](_0x3e7f('0x4'),_0x3e7f('0x5'),_0x3e7f('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x3e7f('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x33e5=['rrmemory','beepall','sequelize','exports','STRING','ENUM'];(function(_0x33d64c,_0x1baa26){var _0x555058=function(_0x464916){while(--_0x464916){_0x33d64c['push'](_0x33d64c['shift']());}};_0x555058(++_0x1baa26);}(_0x33e5,0x13a));var _0x533e=function(_0x1d05b2,_0x49f329){_0x1d05b2=_0x1d05b2-0x0;var _0x31ce7c=_0x33e5[_0x1d05b2];return _0x31ce7c;};'use strict';var Sequelize=require(_0x533e('0x0'));module[_0x533e('0x1')]={'name':{'type':Sequelize[_0x533e('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x533e('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x533e('0x3')](_0x533e('0x4'),_0x533e('0x5'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index 6633869..b15897a 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 _0x7382=['destroy','UserProfileResource','end','error','stack','name','send','index','map','FaxQueue','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserFaxQueue','FaxQueueId','User','findAndCountAll','UserId','faxPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','Team','ids','Agents','online','flatMap','sequelize','addTeams','each','forEach','userFaxQueue:save','removeTeams','select','field','from','team_has_fax_queues','join','user_has_teams','clone','ut.UserId\x20=\x20?','QueryTypes','SELECT','every','TeamId','compact','value','transaction','isEmpty','removeAgents','emit','userFaxQueue:remove','addAgents','spread','isArray','getAgents','eml-format','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','count','offset','limit','set','Content-Range','json','reject','save','update','then'];(function(_0x3ab928,_0x2b990b){var _0xf47692=function(_0x311b8e){while(--_0x311b8e){_0x3ab928['push'](_0x3ab928['shift']());}};_0xf47692(++_0x2b990b);}(_0x7382,0x1f2));var _0x2738=function(_0x58c59d,_0x4ef22f){_0x58c59d=_0x58c59d-0x0;var _0x463922=_0x7382[_0x58c59d];return _0x463922;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2738('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2738('0x1'));var rp=require('request-promise');var moment=require(_0x2738('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x2738('0x3'));var util=require(_0x2738('0x4'));var path=require('path');var sox=require(_0x2738('0x5'));var csv=require(_0x2738('0x6'));var ejs=require(_0x2738('0x7'));var fs=require('fs');var _=require(_0x2738('0x8'));var squel=require('squel');var crypto=require(_0x2738('0x9'));var jsforce=require(_0x2738('0xa'));var deskjs=require(_0x2738('0xb'));var toCsv=require(_0x2738('0x6'));var querystring=require(_0x2738('0xc'));var Papa=require('papaparse');var Redis=require(_0x2738('0xd'));var authService=require(_0x2738('0xe'));var qs=require(_0x2738('0xf'));var as=require(_0x2738('0x10'));var hardwareService=require(_0x2738('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x2738('0x12'));var db=require(_0x2738('0x13'))['db'];config[_0x2738('0x14')]=_[_0x2738('0x15')](config[_0x2738('0x14')],{'host':_0x2738('0x16'),'port':0x18eb});var socket=require(_0x2738('0x17'))(new Redis(config[_0x2738('0x14')]));require(_0x2738('0x18'))[_0x2738('0x19')](socket);function respondWithStatusCode(_0x4584f8,_0x1d2de7){_0x1d2de7=_0x1d2de7||0xcc;return function(_0x5af8b6){if(_0x5af8b6){return _0x4584f8[_0x2738('0x1a')](_0x1d2de7);}return _0x4584f8[_0x2738('0x1b')](_0x1d2de7)['end']();};}function respondWithResult(_0x4cde16,_0x1542b6){_0x1542b6=_0x1542b6||0xc8;return function(_0x3a728e){if(_0x3a728e){return _0x4cde16[_0x2738('0x1b')](_0x1542b6)['json'](_0x3a728e);}};}function respondWithFilteredResult(_0x2abc3d,_0x1f3962){return function(_0x38e8d8){if(_0x38e8d8){var _0x2ab61b=_0x38e8d8[_0x2738('0x1c')],_0x19d331=_0x1f3962[_0x2738('0x1d')],_0x4a0f1e=_0x1f3962[_0x2738('0x1d')]+_0x1f3962[_0x2738('0x1e')],_0x43cab3;if(_0x4a0f1e>=_0x2ab61b){_0x4a0f1e=_0x2ab61b;_0x43cab3=0xc8;}else{_0x43cab3=0xce;}_0x2abc3d[_0x2738('0x1b')](_0x43cab3);return _0x2abc3d[_0x2738('0x1f')](_0x2738('0x20'),_0x19d331+'-'+_0x4a0f1e+'/'+_0x2ab61b)[_0x2738('0x21')](_0x38e8d8);}return null;};}function patchUpdates(_0x514e45){return function(_0x2bf857){try{jsonpatch['apply'](_0x2bf857,_0x514e45,!![]);}catch(_0x45e7c9){return BPromise[_0x2738('0x22')](_0x45e7c9);}return _0x2bf857[_0x2738('0x23')]();};}function saveUpdates(_0x36b4bb,_0x532cb8){return function(_0x524a2c){if(_0x524a2c){return _0x524a2c[_0x2738('0x24')](_0x36b4bb)[_0x2738('0x25')](function(_0x1637bb){return _0x1637bb;});}return null;};}function removeEntity(_0x476c38,_0x509c92){return function(_0x26f554){if(_0x26f554){return _0x26f554[_0x2738('0x26')]()[_0x2738('0x25')](function(){var _0x241a81=_0x26f554['get']({'plain':!![]});var _0x4bb15e='FaxQueues';return db[_0x2738('0x27')][_0x2738('0x26')]({'where':{'type':_0x4bb15e,'resourceId':_0x241a81['id']}})['then'](function(){return _0x26f554;});})[_0x2738('0x25')](function(){_0x476c38[_0x2738('0x1b')](0xcc)[_0x2738('0x28')]();});}};}function handleEntityNotFound(_0x4c6f5c,_0x229a81){return function(_0x33882b){if(!_0x33882b){_0x4c6f5c[_0x2738('0x1a')](0x194);}return _0x33882b;};}function handleError(_0x301f66,_0xbfa426){_0xbfa426=_0xbfa426||0x1f4;return function(_0x263ebd){logger[_0x2738('0x29')](_0x263ebd[_0x2738('0x2a')]);if(_0x263ebd[_0x2738('0x2b')]){delete _0x263ebd['name'];}_0x301f66['status'](_0xbfa426)[_0x2738('0x2c')](_0x263ebd);};}exports[_0x2738('0x2d')]=function(_0x5df70b,_0x587f7b){var _0xc1b1e7={},_0xa0a62c={},_0x3ad0f7={'count':0x0,'rows':[]};var _0x1f416f=_[_0x2738('0x2e')](db[_0x2738('0x2f')][_0x2738('0x30')],function(_0x4d800d){return{'name':_0x4d800d[_0x2738('0x31')],'type':_0x4d800d['type']['key']};});_0xa0a62c[_0x2738('0x32')]=_[_0x2738('0x2e')](_0x1f416f,_0x2738('0x2b'));_0xa0a62c[_0x2738('0x33')]=_[_0x2738('0x34')](_0x5df70b['query']);_0xa0a62c[_0x2738('0x35')]=_[_0x2738('0x36')](_0xa0a62c[_0x2738('0x32')],_0xa0a62c[_0x2738('0x33')]);_0xc1b1e7[_0x2738('0x37')]=_[_0x2738('0x36')](_0xa0a62c[_0x2738('0x32')],qs[_0x2738('0x38')](_0x5df70b[_0x2738('0x33')][_0x2738('0x38')]));_0xc1b1e7[_0x2738('0x37')]=_0xc1b1e7[_0x2738('0x37')][_0x2738('0x39')]?_0xc1b1e7[_0x2738('0x37')]:_0xa0a62c[_0x2738('0x32')];if(!_0x5df70b[_0x2738('0x33')][_0x2738('0x3a')](_0x2738('0x3b'))){_0xc1b1e7[_0x2738('0x1e')]=qs[_0x2738('0x1e')](_0x5df70b[_0x2738('0x33')][_0x2738('0x1e')]);_0xc1b1e7[_0x2738('0x1d')]=qs[_0x2738('0x1d')](_0x5df70b[_0x2738('0x33')][_0x2738('0x1d')]);}_0xc1b1e7[_0x2738('0x3c')]=qs[_0x2738('0x3d')](_0x5df70b[_0x2738('0x33')][_0x2738('0x3d')]);_0xc1b1e7[_0x2738('0x3e')]=qs[_0x2738('0x35')](_[_0x2738('0x3f')](_0x5df70b[_0x2738('0x33')],_0xa0a62c['filters']));if(_0x5df70b[_0x2738('0x33')]['filter']){_0xc1b1e7[_0x2738('0x3e')]=_[_0x2738('0x40')](_0xc1b1e7[_0x2738('0x3e')],{'$or':_[_0x2738('0x2e')](_0x1f416f,function(_0x183760){if(_0x183760[_0x2738('0x41')]!=='VIRTUAL'){var _0x15b2cf={};_0x15b2cf[_0x183760['name']]={'$like':'%'+_0x5df70b[_0x2738('0x33')][_0x2738('0x42')]+'%'};return _0x15b2cf;}})});}_0xc1b1e7=_[_0x2738('0x40')]({},_0xc1b1e7,_0x5df70b[_0x2738('0x43')]);var _0x223e9a={'where':_0xc1b1e7['where']};return db[_0x2738('0x2f')][_0x2738('0x1c')](_0x223e9a)['then'](function(_0x31d16b){_0x3ad0f7[_0x2738('0x1c')]=_0x31d16b;if(_0x5df70b['query'][_0x2738('0x44')]){_0xc1b1e7[_0x2738('0x45')]=[{'all':!![]}];}return db[_0x2738('0x2f')][_0x2738('0x46')](_0xc1b1e7);})[_0x2738('0x25')](function(_0x58d84d){_0x3ad0f7[_0x2738('0x47')]=_0x58d84d;return _0x3ad0f7;})[_0x2738('0x25')](respondWithFilteredResult(_0x587f7b,_0xc1b1e7))[_0x2738('0x48')](handleError(_0x587f7b,null));};exports[_0x2738('0x49')]=function(_0x1440d6,_0x34d90a){var _0x53c96f={'raw':!![],'where':{'id':_0x1440d6[_0x2738('0x4a')]['id']}},_0xf13400={};_0xf13400[_0x2738('0x32')]=_[_0x2738('0x34')](db[_0x2738('0x2f')][_0x2738('0x30')]);_0xf13400[_0x2738('0x33')]=_[_0x2738('0x34')](_0x1440d6[_0x2738('0x33')]);_0xf13400[_0x2738('0x35')]=_[_0x2738('0x36')](_0xf13400['model'],_0xf13400[_0x2738('0x33')]);_0x53c96f['attributes']=_[_0x2738('0x36')](_0xf13400[_0x2738('0x32')],qs['fields'](_0x1440d6[_0x2738('0x33')]['fields']));_0x53c96f['attributes']=_0x53c96f['attributes'][_0x2738('0x39')]?_0x53c96f[_0x2738('0x37')]:_0xf13400[_0x2738('0x32')];if(_0x1440d6['query']['includeAll']){_0x53c96f[_0x2738('0x45')]=[{'all':!![]}];}_0x53c96f=_['merge']({},_0x53c96f,_0x1440d6[_0x2738('0x43')]);return db[_0x2738('0x2f')][_0x2738('0x4b')](_0x53c96f)['then'](handleEntityNotFound(_0x34d90a,null))[_0x2738('0x25')](respondWithResult(_0x34d90a,null))[_0x2738('0x48')](handleError(_0x34d90a,null));};exports[_0x2738('0x4c')]=function(_0x44edeb,_0x26e12a){return db[_0x2738('0x2f')]['create'](_0x44edeb[_0x2738('0x4d')],{})[_0x2738('0x25')](function(_0x1911bd){var _0x9b1a54=_0x44edeb[_0x2738('0x4e')][_0x2738('0x4f')]({'plain':!![]});if(!_0x9b1a54)throw new Error(_0x2738('0x50'));if(_0x9b1a54[_0x2738('0x51')]===_0x2738('0x4e')){var _0x34967a=_0x1911bd['get']({'plain':!![]});var _0x576399='FaxQueues';return db['UserProfileSection'][_0x2738('0x4b')]({'where':{'name':_0x576399,'userProfileId':_0x9b1a54[_0x2738('0x52')]},'raw':!![]})[_0x2738('0x25')](function(_0x5c6ae5){if(_0x5c6ae5&&_0x5c6ae5[_0x2738('0x53')]===0x0){return db[_0x2738('0x27')][_0x2738('0x4c')]({'name':_0x34967a['name'],'resourceId':_0x34967a['id'],'type':_0x5c6ae5['name'],'sectionId':_0x5c6ae5['id']},{})['then'](function(){return _0x1911bd;});}else{return _0x1911bd;}})[_0x2738('0x48')](function(_0x3d20ec){logger[_0x2738('0x29')](_0x2738('0x54'),_0x3d20ec);throw _0x3d20ec;});}return _0x1911bd;})[_0x2738('0x25')](respondWithResult(_0x26e12a,0xc9))[_0x2738('0x48')](handleError(_0x26e12a,null));};exports[_0x2738('0x24')]=function(_0x3f16b0,_0x2698b3){if(_0x3f16b0['body']['id']){delete _0x3f16b0[_0x2738('0x4d')]['id'];}return db[_0x2738('0x2f')]['find']({'where':{'id':_0x3f16b0[_0x2738('0x4a')]['id']}})[_0x2738('0x25')](handleEntityNotFound(_0x2698b3,null))[_0x2738('0x25')](saveUpdates(_0x3f16b0[_0x2738('0x4d')],null))['then'](respondWithResult(_0x2698b3,null))[_0x2738('0x48')](handleError(_0x2698b3,null));};exports[_0x2738('0x26')]=function(_0x5e0ac7,_0x1c2d17){return db[_0x2738('0x2f')]['find']({'where':{'id':_0x5e0ac7[_0x2738('0x4a')]['id']}})[_0x2738('0x25')](handleEntityNotFound(_0x1c2d17,null))[_0x2738('0x25')](removeEntity(_0x1c2d17,null))[_0x2738('0x48')](handleError(_0x1c2d17,null));};exports[_0x2738('0x55')]=function(_0x40469d,_0x32ae05){return db['FaxQueue'][_0x2738('0x55')]()[_0x2738('0x25')](respondWithResult(_0x32ae05,null))[_0x2738('0x48')](handleError(_0x32ae05,null));};exports[_0x2738('0x56')]=function(_0x4a49a4,_0xbecf45,_0x2012bf){var _0x145e36={'raw':!![],'where':{}},_0x3a5289={},_0x45903e;return db[_0x2738('0x2f')][_0x2738('0x57')]({'where':{'id':_0x4a49a4[_0x2738('0x4a')]['id']}})[_0x2738('0x25')](handleEntityNotFound(_0xbecf45,null))[_0x2738('0x25')](function(_0xb18d6d){if(_0xb18d6d){_0x45903e=_0xb18d6d[_0x2738('0x4f')]({'plain':!![]});_0x3a5289[_0x2738('0x32')]=_['keys'](db[_0x2738('0x58')][_0x2738('0x30')]);_0x3a5289['query']=_[_0x2738('0x34')](_0x4a49a4[_0x2738('0x33')]);_0x3a5289[_0x2738('0x35')]=_[_0x2738('0x36')](_0x3a5289[_0x2738('0x32')],_0x3a5289[_0x2738('0x33')]);_0x145e36[_0x2738('0x37')]=_['intersection'](_0x3a5289['model'],qs[_0x2738('0x38')](_0x4a49a4[_0x2738('0x33')][_0x2738('0x38')]));_0x145e36[_0x2738('0x37')]=_0x145e36[_0x2738('0x37')][_0x2738('0x39')]?_0x145e36[_0x2738('0x37')]:_0x3a5289['model'];if(!_0x4a49a4['query'][_0x2738('0x3a')](_0x2738('0x3b'))){_0x145e36['limit']=qs['limit'](_0x4a49a4[_0x2738('0x33')]['limit']);_0x145e36[_0x2738('0x1d')]=qs[_0x2738('0x1d')](_0x4a49a4['query'][_0x2738('0x1d')]);}_0x145e36['order']=qs[_0x2738('0x3d')](_0x4a49a4[_0x2738('0x33')][_0x2738('0x3d')]);_0x145e36[_0x2738('0x3e')]=qs[_0x2738('0x35')](_[_0x2738('0x3f')](_0x4a49a4[_0x2738('0x33')],_0x3a5289[_0x2738('0x35')]));_0x145e36[_0x2738('0x3e')][_0x2738('0x59')]=_0xb18d6d['id'];if(_0x4a49a4['query'][_0x2738('0x42')]){_0x145e36[_0x2738('0x3e')]=_[_0x2738('0x40')](_0x145e36['where'],{'$or':_[_0x2738('0x2e')](_0x145e36['attributes'],function(_0x482bc3){var _0x53cceb={};_0x53cceb[_0x482bc3]={'$like':'%'+_0x4a49a4['query'][_0x2738('0x42')]+'%'};return _0x53cceb;})});}_0x145e36=_['merge']({},_0x145e36,_0x4a49a4['options']);return db[_0x2738('0x58')][_0x2738('0x46')](_0x145e36);}})['then'](function(_0x488114){if(_0x488114){return db[_0x2738('0x5a')][_0x2738('0x5b')]({'where':{'id':_[_0x2738('0x2e')](_0x488114,_0x2738('0x5c')),'role':'agent'},'attributes':['id','name',_0x2738('0x5d'),'updatedAt',_0x2738('0x5e')]});}})[_0x2738('0x25')](function(_0x39c866){if(_0x39c866){return{'count':_0x39c866['count'],'rows':_['map'](_0x39c866[_0x2738('0x47')],function(_0x5a3a5c){return{'membername':_0x5a3a5c[_0x2738('0x2b')],'UserId':_0x5a3a5c['id'],'queue_name':_0x45903e[_0x2738('0x2b')],'FaxQueueId':_0x45903e['id'],'interface':util[_0x2738('0x5f')](_0x2738('0x60'),_0x2738('0x61'),_0x5a3a5c[_0x2738('0x2b')]),'penalty':0x0,'paused':_0x5a3a5c[_0x2738('0x5d')],'createdAt':_0x5a3a5c[_0x2738('0x5e')],'updatedAt':_0x5a3a5c[_0x2738('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2738('0x25')](respondWithFilteredResult(_0xbecf45,_0x145e36))['catch'](handleError(_0xbecf45,null));};exports[_0x2738('0x63')]=function(_0xbe51a0,_0x39efb9,_0x152bc6){var _0x47919a={};var _0x5393d7={};var _0x23a425;var _0x12f249;return db['FaxQueue']['findOne']({'where':{'id':_0xbe51a0['params']['id']}})[_0x2738('0x25')](handleEntityNotFound(_0x39efb9,null))[_0x2738('0x25')](function(_0x31e28d){if(_0x31e28d){_0x23a425=_0x31e28d;_0x5393d7[_0x2738('0x32')]=_[_0x2738('0x34')](db[_0x2738('0x64')][_0x2738('0x30')]);_0x5393d7['query']=_['keys'](_0xbe51a0[_0x2738('0x33')]);_0x5393d7['filters']=_[_0x2738('0x36')](_0x5393d7['model'],_0x5393d7['query']);_0x47919a[_0x2738('0x37')]=_[_0x2738('0x36')](_0x5393d7[_0x2738('0x32')],qs[_0x2738('0x38')](_0xbe51a0[_0x2738('0x33')][_0x2738('0x38')]));_0x47919a[_0x2738('0x37')]=_0x47919a[_0x2738('0x37')][_0x2738('0x39')]?_0x47919a[_0x2738('0x37')]:_0x5393d7[_0x2738('0x32')];_0x47919a['order']=qs[_0x2738('0x3d')](_0xbe51a0['query']['sort']);_0x47919a[_0x2738('0x3e')]=qs[_0x2738('0x35')](_[_0x2738('0x3f')](_0xbe51a0[_0x2738('0x33')],_0x5393d7[_0x2738('0x35')]));if(_0xbe51a0[_0x2738('0x33')][_0x2738('0x42')]){_0x47919a[_0x2738('0x3e')]=_[_0x2738('0x40')](_0x47919a['where'],{'$or':_[_0x2738('0x2e')](_0x47919a[_0x2738('0x37')],function(_0x5d41b5){var _0x4054c5={};_0x4054c5[_0x5d41b5]={'$like':'%'+_0xbe51a0[_0x2738('0x33')][_0x2738('0x42')]+'%'};return _0x4054c5;})});}_0x47919a=_['merge']({},_0x47919a,_0xbe51a0[_0x2738('0x43')]);return _0x23a425['getTeams'](_0x47919a);}})[_0x2738('0x25')](function(_0x405159){if(_0x405159){_0x12f249=_0x405159['length'];if(!_0xbe51a0[_0x2738('0x33')][_0x2738('0x3a')](_0x2738('0x3b'))){_0x47919a[_0x2738('0x1e')]=qs[_0x2738('0x1e')](_0xbe51a0[_0x2738('0x33')][_0x2738('0x1e')]);_0x47919a[_0x2738('0x1d')]=qs['offset'](_0xbe51a0[_0x2738('0x33')][_0x2738('0x1d')]);}return _0x23a425[_0x2738('0x63')](_0x47919a);}})[_0x2738('0x25')](function(_0x264786){if(_0x264786){return _0x264786?{'count':_0x12f249,'rows':_0x264786}:null;}})[_0x2738('0x25')](respondWithResult(_0x39efb9,null))[_0x2738('0x48')](handleError(_0x39efb9,null));};exports['addTeams']=function(_0x29d26,_0xfd8ba8,_0x5755cb){var _0x1a1c9=_0x29d26['body'][_0x2738('0x65')];return db[_0x2738('0x64')][_0x2738('0x46')]({'where':{'id':_0x1a1c9},'attributes':['id'],'include':[{'model':db[_0x2738('0x5a')],'as':_0x2738('0x66'),'attributes':['id','name',_0x2738('0x67'),'voicePause','interface'],'raw':!![]}]})[_0x2738('0x25')](function(_0x4bc80e){if(_0x4bc80e){var _0x5ec464=_[_0x2738('0x68')](_0x4bc80e,function(_0xbc1cce){var _0x44617e=_0xbc1cce[_0x2738('0x4f')]({'plain':!![]});return _0x44617e[_0x2738('0x66')];});return db['FaxQueue']['find']({'where':{'id':_0x29d26['params']['id']}})[_0x2738('0x25')](function(_0x59d86f){return db[_0x2738('0x69')]['transaction'](function(_0x5935d2){return _0x59d86f[_0x2738('0x6a')](_0x1a1c9,{'transaction':_0x5935d2})[_0x2738('0x25')](function(){return BPromise[_0x2738('0x6b')](_0x5ec464,function(_0x5f4240){return db['UserFaxQueue']['findOrCreate']({'where':{'UserId':_0x5f4240['id'],'FaxQueueId':_0x29d26[_0x2738('0x4a')]['id']},'transaction':_0x5935d2});});})[_0x2738('0x25')](function(){_0x5ec464[_0x2738('0x6c')](function(_0x497e07){socket['emit'](_0x2738('0x6d'),{'UserId':_0x497e07['id'],'FaxQueueId':_0x59d86f['id']});});});});});}})['then'](respondWithStatusCode(_0xfd8ba8,null))['catch'](handleError(_0xfd8ba8,null));};exports[_0x2738('0x6e')]=function(_0x48420f,_0x50ca5e,_0xbd9e9d){return db[_0x2738('0x64')][_0x2738('0x46')]({'where':{'id':_0x48420f['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x2738('0x5a')],'as':_0x2738('0x66'),'attributes':['id'],'raw':!![]}]})[_0x2738('0x25')](handleEntityNotFound(_0x50ca5e,null))[_0x2738('0x25')](function(_0x220e68){var _0x1c4630=_[_0x2738('0x2e')](_0x220e68,'id');var _0x25cb32=[];var _0x4ed53f=[];var _0xa00a51=squel[_0x2738('0x6f')]();_0xa00a51[_0x2738('0x70')]('tq.TeamId')[_0x2738('0x71')](_0x2738('0x72'),'tq')[_0x2738('0x73')](_0x2738('0x74'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where']('FaxQueueId\x20=\x20?',_0x48420f[_0x2738('0x4a')]['id']);for(var _0x492635=0x0;_0x492635<_0x220e68[_0x2738('0x39')];_0x492635+=0x1){let _0x4120c0=_0x220e68[_0x492635];for(var _0x1a2b91=0x0;_0x1a2b91<_0x4120c0[_0x2738('0x66')]['length'];_0x1a2b91+=0x1){let _0x1d4c4b=_0x4120c0[_0x2738('0x66')][_0x1a2b91];var _0x1d5bc0=_0xa00a51[_0x2738('0x75')]();_0x1d5bc0[_0x2738('0x3e')](_0x2738('0x76'),_0x1d4c4b['id']);_0x4ed53f['push'](db[_0x2738('0x69')][_0x2738('0x33')](_0x1d5bc0['toString'](),{'type':db[_0x2738('0x69')][_0x2738('0x77')][_0x2738('0x78')]})['then'](function(_0x2efdd5){if(_0x2efdd5[_0x2738('0x39')]===0x1){return _0x1d4c4b['id'];}else{var _0x366d96=_[_0x2738('0x79')](_[_0x2738('0x2e')](_0x2efdd5,_0x2738('0x7a')),function(_0x2e8d35){return _['includes'](_0x1c4630,_0x2e8d35);});if(_0x366d96){return _0x1d4c4b['id'];}}}));}}return BPromise['all'](_0x4ed53f)[_0x2738('0x25')](function(_0xe97c2c){_0x25cb32=_(_0x25cb32)['union'](_0xe97c2c)[_0x2738('0x7b')]()[_0x2738('0x7c')]();return db[_0x2738('0x2f')][_0x2738('0x4b')]({'where':{'id':_0x48420f['params']['id']}})[_0x2738('0x25')](function(_0x49c8d7){return db[_0x2738('0x69')][_0x2738('0x7d')](function(_0x1ce4c0){return _0x49c8d7[_0x2738('0x6e')](_0x48420f[_0x2738('0x33')][_0x2738('0x65')],{'transaction':_0x1ce4c0})['then'](function(){if(!_[_0x2738('0x7e')](_0x25cb32)){return _0x49c8d7[_0x2738('0x7f')](_0x25cb32,{'transaction':_0x1ce4c0});}})[_0x2738('0x25')](function(){_0x25cb32[_0x2738('0x6c')](function(_0x4e6b59){socket[_0x2738('0x80')](_0x2738('0x81'),{'UserId':_0x4e6b59,'FaxQueueId':_0x49c8d7['id']});});});});});});})['then'](respondWithStatusCode(_0x50ca5e,null))[_0x2738('0x48')](handleError(_0x50ca5e,null));};exports['addAgents']=function(_0x2e4835,_0x3b4947,_0x527366){return db['FaxQueue'][_0x2738('0x4b')]({'where':{'id':_0x2e4835['params']['id']}})[_0x2738('0x25')](handleEntityNotFound(_0x3b4947,null))[_0x2738('0x25')](function(_0x4e7fb8){if(_0x4e7fb8){return _0x4e7fb8[_0x2738('0x82')](_0x2e4835[_0x2738('0x4d')][_0x2738('0x65')],_['omit'](_0x2e4835[_0x2738('0x4d')],[_0x2738('0x65'),'id'])||{})[_0x2738('0x83')](function(_0x415214){for(var _0xaa271d=0x0;_0xaa271d<_0x2e4835[_0x2738('0x4d')][_0x2738('0x65')][_0x2738('0x39')];_0xaa271d+=0x1){socket[_0x2738('0x80')](_0x2738('0x6d'),{'UserId':_0x2e4835[_0x2738('0x4d')]['ids'][_0xaa271d],'FaxQueueId':_0x2e4835[_0x2738('0x4a')]['id']});}return _0x415214;});}})[_0x2738('0x25')](respondWithResult(_0x3b4947,null))[_0x2738('0x48')](handleError(_0x3b4947,null));};exports[_0x2738('0x7f')]=function(_0x2dd648,_0x437e72,_0x390d0d){return db['FaxQueue'][_0x2738('0x4b')]({'where':{'id':_0x2dd648[_0x2738('0x4a')]['id']}})[_0x2738('0x25')](handleEntityNotFound(_0x437e72,null))[_0x2738('0x25')](function(_0x39c5f7){if(_0x39c5f7){return _0x39c5f7[_0x2738('0x7f')](_0x2dd648[_0x2738('0x33')][_0x2738('0x65')])[_0x2738('0x25')](function(){if(_[_0x2738('0x84')](_0x2dd648[_0x2738('0x33')]['ids'])){for(var _0x4896d9=0x0;_0x4896d9<_0x2dd648['query'][_0x2738('0x65')][_0x2738('0x39')];_0x4896d9+=0x1){socket[_0x2738('0x80')](_0x2738('0x81'),{'UserId':Number(_0x2dd648['query']['ids'][_0x4896d9]),'FaxQueueId':Number(_0x2dd648[_0x2738('0x4a')]['id'])});}}else{socket[_0x2738('0x80')]('userFaxQueue:remove',{'UserId':Number(_0x2dd648[_0x2738('0x33')][_0x2738('0x65')]),'FaxQueueId':Number(_0x2dd648[_0x2738('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0x437e72,null))[_0x2738('0x48')](handleError(_0x437e72,null));};exports[_0x2738('0x85')]=function(_0x2cf72b,_0x2c6a6f,_0x2f4f45){var _0xb8a3cf={};var _0x4bf36e={};var _0x398d98;var _0x1b9faa;return db[_0x2738('0x2f')][_0x2738('0x57')]({'where':{'id':_0x2cf72b['params']['id']}})[_0x2738('0x25')](handleEntityNotFound(_0x2c6a6f,null))['then'](function(_0x21d846){if(_0x21d846){_0x398d98=_0x21d846;_0x4bf36e[_0x2738('0x32')]=_[_0x2738('0x34')](db[_0x2738('0x5a')][_0x2738('0x30')]);_0x4bf36e[_0x2738('0x33')]=_[_0x2738('0x34')](_0x2cf72b['query']);_0x4bf36e[_0x2738('0x35')]=_['intersection'](_0x4bf36e[_0x2738('0x32')],_0x4bf36e[_0x2738('0x33')]);_0xb8a3cf[_0x2738('0x37')]=_[_0x2738('0x36')](_0x4bf36e[_0x2738('0x32')],qs[_0x2738('0x38')](_0x2cf72b[_0x2738('0x33')]['fields']));_0xb8a3cf[_0x2738('0x37')]=_0xb8a3cf[_0x2738('0x37')][_0x2738('0x39')]?_0xb8a3cf[_0x2738('0x37')]:_0x4bf36e[_0x2738('0x32')];_0xb8a3cf[_0x2738('0x3c')]=qs[_0x2738('0x3d')](_0x2cf72b[_0x2738('0x33')][_0x2738('0x3d')]);_0xb8a3cf[_0x2738('0x3e')]=qs[_0x2738('0x35')](_[_0x2738('0x3f')](_0x2cf72b[_0x2738('0x33')],_0x4bf36e[_0x2738('0x35')]));if(_0x2cf72b[_0x2738('0x33')][_0x2738('0x42')]){_0xb8a3cf[_0x2738('0x3e')]=_['merge'](_0xb8a3cf['where'],{'$or':_[_0x2738('0x2e')](_0xb8a3cf[_0x2738('0x37')],function(_0x804592){var _0x567dda={};_0x567dda[_0x804592]={'$like':'%'+_0x2cf72b['query'][_0x2738('0x42')]+'%'};return _0x567dda;})});}_0xb8a3cf=_[_0x2738('0x40')]({},_0xb8a3cf,_0x2cf72b['options']);return _0x398d98[_0x2738('0x85')](_0xb8a3cf);}})['then'](function(_0x348e2d){if(_0x348e2d){_0x1b9faa=_0x348e2d['length'];if(!_0x2cf72b[_0x2738('0x33')]['hasOwnProperty'](_0x2738('0x3b'))){_0xb8a3cf[_0x2738('0x1e')]=qs[_0x2738('0x1e')](_0x2cf72b['query']['limit']);_0xb8a3cf[_0x2738('0x1d')]=qs[_0x2738('0x1d')](_0x2cf72b[_0x2738('0x33')]['offset']);}return _0x398d98[_0x2738('0x85')](_0xb8a3cf);}})[_0x2738('0x25')](function(_0x548abf){if(_0x548abf){return _0x548abf?{'count':_0x1b9faa,'rows':_0x548abf}:null;}})[_0x2738('0x25')](respondWithResult(_0x2c6a6f,null))[_0x2738('0x48')](handleError(_0x2c6a6f,null));}; \ No newline at end of file +var _0x9458=['userFaxQueue:save','removeTeams','select','field','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','ids','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','update','then','destroy','get','FaxQueues','UserProfileResource','error','stack','name','send','index','map','FaxQueue','rawAttributes','key','query','keys','filters','intersection','attributes','fields','length','model','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','show','params','includeAll','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserFaxQueue','hasOwnProperty','FaxQueueId','options','User','findAndCountAll','UserId','faxPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','Team','addTeams','Agents','online','interface','sequelize','transaction','each','findOrCreate','forEach','emit'];(function(_0x3e510c,_0x294640){var _0x1003f4=function(_0x25aa38){while(--_0x25aa38){_0x3e510c['push'](_0x3e510c['shift']());}};_0x1003f4(++_0x294640);}(_0x9458,0x1b8));var _0x8945=function(_0x15e143,_0x90ba16){_0x15e143=_0x15e143-0x0;var _0x458d93=_0x9458[_0x15e143];return _0x458d93;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x8945('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8945('0x1'));var moment=require('moment');var BPromise=require(_0x8945('0x2'));var Mustache=require(_0x8945('0x3'));var util=require(_0x8945('0x4'));var path=require(_0x8945('0x5'));var sox=require(_0x8945('0x6'));var csv=require(_0x8945('0x7'));var ejs=require(_0x8945('0x8'));var fs=require('fs');var _=require(_0x8945('0x9'));var squel=require(_0x8945('0xa'));var crypto=require(_0x8945('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x8945('0xc'));var toCsv=require(_0x8945('0x7'));var querystring=require(_0x8945('0xd'));var Papa=require(_0x8945('0xe'));var Redis=require(_0x8945('0xf'));var authService=require(_0x8945('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8945('0x11'));var hardwareService=require(_0x8945('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x8945('0x13'));var config=require('../../config/environment');var db=require(_0x8945('0x14'))['db'];config[_0x8945('0x15')]=_[_0x8945('0x16')](config[_0x8945('0x15')],{'host':_0x8945('0x17'),'port':0x18eb});var socket=require(_0x8945('0x18'))(new Redis(config['redis']));require(_0x8945('0x19'))[_0x8945('0x1a')](socket);function respondWithStatusCode(_0x57a68b,_0x4305f0){_0x4305f0=_0x4305f0||0xcc;return function(_0x2a4116){if(_0x2a4116){return _0x57a68b[_0x8945('0x1b')](_0x4305f0);}return _0x57a68b[_0x8945('0x1c')](_0x4305f0)[_0x8945('0x1d')]();};}function respondWithResult(_0x442241,_0x5e9e50){_0x5e9e50=_0x5e9e50||0xc8;return function(_0x5e49cf){if(_0x5e49cf){return _0x442241[_0x8945('0x1c')](_0x5e9e50)['json'](_0x5e49cf);}};}function respondWithFilteredResult(_0x4eac0d,_0x308f54){return function(_0x55aacf){if(_0x55aacf){var _0x4bd38f=_0x55aacf[_0x8945('0x1e')],_0x387ef2=_0x308f54[_0x8945('0x1f')],_0x1fe38f=_0x308f54[_0x8945('0x1f')]+_0x308f54[_0x8945('0x20')],_0x38d181;if(_0x1fe38f>=_0x4bd38f){_0x1fe38f=_0x4bd38f;_0x38d181=0xc8;}else{_0x38d181=0xce;}_0x4eac0d[_0x8945('0x1c')](_0x38d181);return _0x4eac0d[_0x8945('0x21')](_0x8945('0x22'),_0x387ef2+'-'+_0x1fe38f+'/'+_0x4bd38f)[_0x8945('0x23')](_0x55aacf);}return null;};}function patchUpdates(_0x234d63){return function(_0xc0aad5){try{jsonpatch[_0x8945('0x24')](_0xc0aad5,_0x234d63,!![]);}catch(_0x5e167d){return BPromise['reject'](_0x5e167d);}return _0xc0aad5['save']();};}function saveUpdates(_0x5046b1,_0x25ede5){return function(_0x2761eb){if(_0x2761eb){return _0x2761eb[_0x8945('0x25')](_0x5046b1)[_0x8945('0x26')](function(_0xfecf2a){return _0xfecf2a;});}return null;};}function removeEntity(_0x5e69c,_0x31a7ec){return function(_0x52a9ba){if(_0x52a9ba){return _0x52a9ba[_0x8945('0x27')]()[_0x8945('0x26')](function(){var _0x27d231=_0x52a9ba[_0x8945('0x28')]({'plain':!![]});var _0x3709c3=_0x8945('0x29');return db[_0x8945('0x2a')][_0x8945('0x27')]({'where':{'type':_0x3709c3,'resourceId':_0x27d231['id']}})[_0x8945('0x26')](function(){return _0x52a9ba;});})[_0x8945('0x26')](function(){_0x5e69c[_0x8945('0x1c')](0xcc)[_0x8945('0x1d')]();});}};}function handleEntityNotFound(_0x52523a,_0x40f6c5){return function(_0x55cc6c){if(!_0x55cc6c){_0x52523a[_0x8945('0x1b')](0x194);}return _0x55cc6c;};}function handleError(_0x4afd08,_0xd5f709){_0xd5f709=_0xd5f709||0x1f4;return function(_0x435c2a){logger[_0x8945('0x2b')](_0x435c2a[_0x8945('0x2c')]);if(_0x435c2a['name']){delete _0x435c2a[_0x8945('0x2d')];}_0x4afd08[_0x8945('0x1c')](_0xd5f709)[_0x8945('0x2e')](_0x435c2a);};}exports[_0x8945('0x2f')]=function(_0x476788,_0x44d620){var _0x28fe7f={},_0x2d4d80={},_0x3a094b={'count':0x0,'rows':[]};var _0x3f9f6c=_[_0x8945('0x30')](db[_0x8945('0x31')][_0x8945('0x32')],function(_0x4bf762){return{'name':_0x4bf762['fieldName'],'type':_0x4bf762['type'][_0x8945('0x33')]};});_0x2d4d80['model']=_['map'](_0x3f9f6c,_0x8945('0x2d'));_0x2d4d80[_0x8945('0x34')]=_[_0x8945('0x35')](_0x476788['query']);_0x2d4d80[_0x8945('0x36')]=_[_0x8945('0x37')](_0x2d4d80['model'],_0x2d4d80[_0x8945('0x34')]);_0x28fe7f[_0x8945('0x38')]=_[_0x8945('0x37')](_0x2d4d80['model'],qs['fields'](_0x476788['query'][_0x8945('0x39')]));_0x28fe7f['attributes']=_0x28fe7f[_0x8945('0x38')][_0x8945('0x3a')]?_0x28fe7f[_0x8945('0x38')]:_0x2d4d80[_0x8945('0x3b')];if(!_0x476788[_0x8945('0x34')]['hasOwnProperty'](_0x8945('0x3c'))){_0x28fe7f['limit']=qs[_0x8945('0x20')](_0x476788[_0x8945('0x34')][_0x8945('0x20')]);_0x28fe7f[_0x8945('0x1f')]=qs['offset'](_0x476788[_0x8945('0x34')][_0x8945('0x1f')]);}_0x28fe7f[_0x8945('0x3d')]=qs[_0x8945('0x3e')](_0x476788[_0x8945('0x34')][_0x8945('0x3e')]);_0x28fe7f[_0x8945('0x3f')]=qs[_0x8945('0x36')](_[_0x8945('0x40')](_0x476788[_0x8945('0x34')],_0x2d4d80[_0x8945('0x36')]));if(_0x476788[_0x8945('0x34')][_0x8945('0x41')]){_0x28fe7f[_0x8945('0x3f')]=_[_0x8945('0x42')](_0x28fe7f[_0x8945('0x3f')],{'$or':_[_0x8945('0x30')](_0x3f9f6c,function(_0x4637e1){if(_0x4637e1['type']!==_0x8945('0x43')){var _0x5e7340={};_0x5e7340[_0x4637e1[_0x8945('0x2d')]]={'$like':'%'+_0x476788[_0x8945('0x34')][_0x8945('0x41')]+'%'};return _0x5e7340;}})});}_0x28fe7f=_[_0x8945('0x42')]({},_0x28fe7f,_0x476788['options']);var _0x389566={'where':_0x28fe7f[_0x8945('0x3f')]};return db['FaxQueue'][_0x8945('0x1e')](_0x389566)[_0x8945('0x26')](function(_0x36e41d){_0x3a094b[_0x8945('0x1e')]=_0x36e41d;if(_0x476788[_0x8945('0x34')]['includeAll']){_0x28fe7f[_0x8945('0x44')]=[{'all':!![]}];}return db['FaxQueue'][_0x8945('0x45')](_0x28fe7f);})['then'](function(_0x15b657){_0x3a094b[_0x8945('0x46')]=_0x15b657;return _0x3a094b;})[_0x8945('0x26')](respondWithFilteredResult(_0x44d620,_0x28fe7f))['catch'](handleError(_0x44d620,null));};exports[_0x8945('0x47')]=function(_0x1ca86e,_0x29b26d){var _0x558b2c={'raw':!![],'where':{'id':_0x1ca86e[_0x8945('0x48')]['id']}},_0x333da1={};_0x333da1['model']=_[_0x8945('0x35')](db['FaxQueue']['rawAttributes']);_0x333da1[_0x8945('0x34')]=_[_0x8945('0x35')](_0x1ca86e[_0x8945('0x34')]);_0x333da1['filters']=_[_0x8945('0x37')](_0x333da1[_0x8945('0x3b')],_0x333da1[_0x8945('0x34')]);_0x558b2c[_0x8945('0x38')]=_[_0x8945('0x37')](_0x333da1[_0x8945('0x3b')],qs['fields'](_0x1ca86e[_0x8945('0x34')]['fields']));_0x558b2c[_0x8945('0x38')]=_0x558b2c[_0x8945('0x38')][_0x8945('0x3a')]?_0x558b2c[_0x8945('0x38')]:_0x333da1[_0x8945('0x3b')];if(_0x1ca86e['query'][_0x8945('0x49')]){_0x558b2c['include']=[{'all':!![]}];}_0x558b2c=_[_0x8945('0x42')]({},_0x558b2c,_0x1ca86e['options']);return db['FaxQueue'][_0x8945('0x4a')](_0x558b2c)[_0x8945('0x26')](handleEntityNotFound(_0x29b26d,null))['then'](respondWithResult(_0x29b26d,null))[_0x8945('0x4b')](handleError(_0x29b26d,null));};exports[_0x8945('0x4c')]=function(_0x4cb19c,_0x2d702a){return db['FaxQueue']['create'](_0x4cb19c[_0x8945('0x4d')],{})[_0x8945('0x26')](function(_0x5c6867){var _0x3afaa3=_0x4cb19c['user'][_0x8945('0x28')]({'plain':!![]});if(!_0x3afaa3)throw new Error(_0x8945('0x4e'));if(_0x3afaa3['role']==='user'){var _0x4a5a4d=_0x5c6867['get']({'plain':!![]});var _0x287af2=_0x8945('0x29');return db['UserProfileSection'][_0x8945('0x4a')]({'where':{'name':_0x287af2,'userProfileId':_0x3afaa3['userProfileId']},'raw':!![]})['then'](function(_0x393a28){if(_0x393a28&&_0x393a28['autoAssociation']===0x0){return db[_0x8945('0x2a')]['create']({'name':_0x4a5a4d[_0x8945('0x2d')],'resourceId':_0x4a5a4d['id'],'type':_0x393a28[_0x8945('0x2d')],'sectionId':_0x393a28['id']},{})['then'](function(){return _0x5c6867;});}else{return _0x5c6867;}})[_0x8945('0x4b')](function(_0x1c02ba){logger[_0x8945('0x2b')](_0x8945('0x4f'),_0x1c02ba);throw _0x1c02ba;});}return _0x5c6867;})['then'](respondWithResult(_0x2d702a,0xc9))[_0x8945('0x4b')](handleError(_0x2d702a,null));};exports[_0x8945('0x25')]=function(_0x3fb10b,_0x34fa85){if(_0x3fb10b['body']['id']){delete _0x3fb10b['body']['id'];}return db[_0x8945('0x31')][_0x8945('0x4a')]({'where':{'id':_0x3fb10b[_0x8945('0x48')]['id']}})[_0x8945('0x26')](handleEntityNotFound(_0x34fa85,null))[_0x8945('0x26')](saveUpdates(_0x3fb10b[_0x8945('0x4d')],null))[_0x8945('0x26')](respondWithResult(_0x34fa85,null))[_0x8945('0x4b')](handleError(_0x34fa85,null));};exports[_0x8945('0x27')]=function(_0x54bd37,_0x3e024a){return db[_0x8945('0x31')][_0x8945('0x4a')]({'where':{'id':_0x54bd37['params']['id']}})[_0x8945('0x26')](handleEntityNotFound(_0x3e024a,null))[_0x8945('0x26')](removeEntity(_0x3e024a,null))[_0x8945('0x4b')](handleError(_0x3e024a,null));};exports[_0x8945('0x50')]=function(_0x18a8a9,_0x3d970e){return db[_0x8945('0x31')][_0x8945('0x50')]()[_0x8945('0x26')](respondWithResult(_0x3d970e,null))[_0x8945('0x4b')](handleError(_0x3d970e,null));};exports[_0x8945('0x51')]=function(_0x3f41a0,_0x4bc9c9,_0x54b042){var _0x6da7be={'raw':!![],'where':{}},_0x117bce={},_0x3a1748;return db[_0x8945('0x31')][_0x8945('0x52')]({'where':{'id':_0x3f41a0[_0x8945('0x48')]['id']}})[_0x8945('0x26')](handleEntityNotFound(_0x4bc9c9,null))['then'](function(_0x2f4b52){if(_0x2f4b52){_0x3a1748=_0x2f4b52['get']({'plain':!![]});_0x117bce['model']=_[_0x8945('0x35')](db[_0x8945('0x53')][_0x8945('0x32')]);_0x117bce['query']=_[_0x8945('0x35')](_0x3f41a0[_0x8945('0x34')]);_0x117bce[_0x8945('0x36')]=_['intersection'](_0x117bce['model'],_0x117bce['query']);_0x6da7be[_0x8945('0x38')]=_['intersection'](_0x117bce[_0x8945('0x3b')],qs['fields'](_0x3f41a0[_0x8945('0x34')][_0x8945('0x39')]));_0x6da7be['attributes']=_0x6da7be[_0x8945('0x38')][_0x8945('0x3a')]?_0x6da7be[_0x8945('0x38')]:_0x117bce['model'];if(!_0x3f41a0[_0x8945('0x34')][_0x8945('0x54')](_0x8945('0x3c'))){_0x6da7be[_0x8945('0x20')]=qs['limit'](_0x3f41a0['query']['limit']);_0x6da7be[_0x8945('0x1f')]=qs[_0x8945('0x1f')](_0x3f41a0['query'][_0x8945('0x1f')]);}_0x6da7be[_0x8945('0x3d')]=qs[_0x8945('0x3e')](_0x3f41a0[_0x8945('0x34')][_0x8945('0x3e')]);_0x6da7be[_0x8945('0x3f')]=qs[_0x8945('0x36')](_[_0x8945('0x40')](_0x3f41a0['query'],_0x117bce[_0x8945('0x36')]));_0x6da7be[_0x8945('0x3f')][_0x8945('0x55')]=_0x2f4b52['id'];if(_0x3f41a0['query'][_0x8945('0x41')]){_0x6da7be[_0x8945('0x3f')]=_[_0x8945('0x42')](_0x6da7be[_0x8945('0x3f')],{'$or':_[_0x8945('0x30')](_0x6da7be[_0x8945('0x38')],function(_0x441c63){var _0x435b5a={};_0x435b5a[_0x441c63]={'$like':'%'+_0x3f41a0[_0x8945('0x34')][_0x8945('0x41')]+'%'};return _0x435b5a;})});}_0x6da7be=_[_0x8945('0x42')]({},_0x6da7be,_0x3f41a0[_0x8945('0x56')]);return db[_0x8945('0x53')]['findAll'](_0x6da7be);}})[_0x8945('0x26')](function(_0x59fa8c){if(_0x59fa8c){return db[_0x8945('0x57')][_0x8945('0x58')]({'where':{'id':_['map'](_0x59fa8c,_0x8945('0x59')),'role':'agent'},'attributes':['id',_0x8945('0x2d'),_0x8945('0x5a'),_0x8945('0x5b'),'createdAt']});}})[_0x8945('0x26')](function(_0x4c685d){if(_0x4c685d){return{'count':_0x4c685d[_0x8945('0x1e')],'rows':_[_0x8945('0x30')](_0x4c685d[_0x8945('0x46')],function(_0x5924c6){return{'membername':_0x5924c6[_0x8945('0x2d')],'UserId':_0x5924c6['id'],'queue_name':_0x3a1748[_0x8945('0x2d')],'FaxQueueId':_0x3a1748['id'],'interface':util[_0x8945('0x5c')](_0x8945('0x5d'),_0x8945('0x5e'),_0x5924c6[_0x8945('0x2d')]),'penalty':0x0,'paused':_0x5924c6[_0x8945('0x5a')],'createdAt':_0x5924c6[_0x8945('0x5f')],'updatedAt':_0x5924c6[_0x8945('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8945('0x26')](respondWithFilteredResult(_0x4bc9c9,_0x6da7be))['catch'](handleError(_0x4bc9c9,null));};exports[_0x8945('0x60')]=function(_0xb49364,_0x4cc95f,_0x24246f){var _0x57b8ed={};var _0x2a9f79={};var _0x3c300f;var _0x1969c1;return db[_0x8945('0x31')][_0x8945('0x52')]({'where':{'id':_0xb49364[_0x8945('0x48')]['id']}})[_0x8945('0x26')](handleEntityNotFound(_0x4cc95f,null))[_0x8945('0x26')](function(_0x112d0a){if(_0x112d0a){_0x3c300f=_0x112d0a;_0x2a9f79[_0x8945('0x3b')]=_[_0x8945('0x35')](db[_0x8945('0x61')][_0x8945('0x32')]);_0x2a9f79['query']=_['keys'](_0xb49364[_0x8945('0x34')]);_0x2a9f79[_0x8945('0x36')]=_[_0x8945('0x37')](_0x2a9f79[_0x8945('0x3b')],_0x2a9f79['query']);_0x57b8ed[_0x8945('0x38')]=_['intersection'](_0x2a9f79[_0x8945('0x3b')],qs[_0x8945('0x39')](_0xb49364[_0x8945('0x34')][_0x8945('0x39')]));_0x57b8ed['attributes']=_0x57b8ed['attributes']['length']?_0x57b8ed[_0x8945('0x38')]:_0x2a9f79['model'];_0x57b8ed['order']=qs[_0x8945('0x3e')](_0xb49364[_0x8945('0x34')][_0x8945('0x3e')]);_0x57b8ed[_0x8945('0x3f')]=qs[_0x8945('0x36')](_[_0x8945('0x40')](_0xb49364[_0x8945('0x34')],_0x2a9f79['filters']));if(_0xb49364['query'][_0x8945('0x41')]){_0x57b8ed[_0x8945('0x3f')]=_[_0x8945('0x42')](_0x57b8ed[_0x8945('0x3f')],{'$or':_[_0x8945('0x30')](_0x57b8ed[_0x8945('0x38')],function(_0x48c80b){var _0x49999d={};_0x49999d[_0x48c80b]={'$like':'%'+_0xb49364[_0x8945('0x34')][_0x8945('0x41')]+'%'};return _0x49999d;})});}_0x57b8ed=_[_0x8945('0x42')]({},_0x57b8ed,_0xb49364[_0x8945('0x56')]);return _0x3c300f[_0x8945('0x60')](_0x57b8ed);}})[_0x8945('0x26')](function(_0x3be07e){if(_0x3be07e){_0x1969c1=_0x3be07e[_0x8945('0x3a')];if(!_0xb49364[_0x8945('0x34')]['hasOwnProperty'](_0x8945('0x3c'))){_0x57b8ed['limit']=qs[_0x8945('0x20')](_0xb49364[_0x8945('0x34')][_0x8945('0x20')]);_0x57b8ed['offset']=qs['offset'](_0xb49364[_0x8945('0x34')]['offset']);}return _0x3c300f['getTeams'](_0x57b8ed);}})[_0x8945('0x26')](function(_0x2b6258){if(_0x2b6258){return _0x2b6258?{'count':_0x1969c1,'rows':_0x2b6258}:null;}})[_0x8945('0x26')](respondWithResult(_0x4cc95f,null))[_0x8945('0x4b')](handleError(_0x4cc95f,null));};exports[_0x8945('0x62')]=function(_0x334927,_0x57a113,_0x47e26a){var _0x5b0dbd=_0x334927[_0x8945('0x4d')]['ids'];return db['Team'][_0x8945('0x45')]({'where':{'id':_0x5b0dbd},'attributes':['id'],'include':[{'model':db[_0x8945('0x57')],'as':_0x8945('0x63'),'attributes':['id',_0x8945('0x2d'),_0x8945('0x64'),'voicePause',_0x8945('0x65')],'raw':!![]}]})[_0x8945('0x26')](function(_0x24292a){if(_0x24292a){var _0x2a1977=_['flatMap'](_0x24292a,function(_0x311a28){var _0x22dd5a=_0x311a28[_0x8945('0x28')]({'plain':!![]});return _0x22dd5a[_0x8945('0x63')];});return db[_0x8945('0x31')][_0x8945('0x4a')]({'where':{'id':_0x334927[_0x8945('0x48')]['id']}})[_0x8945('0x26')](function(_0x231a99){return db[_0x8945('0x66')][_0x8945('0x67')](function(_0x11284b){return _0x231a99['addTeams'](_0x5b0dbd,{'transaction':_0x11284b})['then'](function(){return BPromise[_0x8945('0x68')](_0x2a1977,function(_0x9498f9){return db[_0x8945('0x53')][_0x8945('0x69')]({'where':{'UserId':_0x9498f9['id'],'FaxQueueId':_0x334927['params']['id']},'transaction':_0x11284b});});})[_0x8945('0x26')](function(){_0x2a1977[_0x8945('0x6a')](function(_0x97d106){socket[_0x8945('0x6b')](_0x8945('0x6c'),{'UserId':_0x97d106['id'],'FaxQueueId':_0x231a99['id']});});});});});}})[_0x8945('0x26')](respondWithStatusCode(_0x57a113,null))['catch'](handleError(_0x57a113,null));};exports[_0x8945('0x6d')]=function(_0x444c92,_0x37e80f,_0x409e08){return db['Team']['findAll']({'where':{'id':_0x444c92[_0x8945('0x34')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8945('0x63'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x37e80f,null))[_0x8945('0x26')](function(_0x4d0327){var _0x53a797=_['map'](_0x4d0327,'id');var _0x27f714=[];var _0xa4890b=[];var _0x27f509=squel[_0x8945('0x6e')]();_0x27f509[_0x8945('0x6f')](_0x8945('0x70'))[_0x8945('0x71')]('team_has_fax_queues','tq')['join'](_0x8945('0x72'),'ut',_0x8945('0x73'))['where'](_0x8945('0x74'),_0x444c92[_0x8945('0x48')]['id']);for(var _0x2d7d2d=0x0;_0x2d7d2d<_0x4d0327[_0x8945('0x3a')];_0x2d7d2d+=0x1){let _0x411988=_0x4d0327[_0x2d7d2d];for(var _0x18adc2=0x0;_0x18adc2<_0x411988[_0x8945('0x63')][_0x8945('0x3a')];_0x18adc2+=0x1){let _0x191ed4=_0x411988[_0x8945('0x63')][_0x18adc2];var _0x417690=_0x27f509[_0x8945('0x75')]();_0x417690[_0x8945('0x3f')](_0x8945('0x76'),_0x191ed4['id']);_0xa4890b[_0x8945('0x77')](db[_0x8945('0x66')][_0x8945('0x34')](_0x417690['toString'](),{'type':db[_0x8945('0x66')][_0x8945('0x78')][_0x8945('0x79')]})[_0x8945('0x26')](function(_0x3038fd){if(_0x3038fd[_0x8945('0x3a')]===0x1){return _0x191ed4['id'];}else{var _0x26830a=_[_0x8945('0x7a')](_[_0x8945('0x30')](_0x3038fd,_0x8945('0x7b')),function(_0x30a084){return _[_0x8945('0x7c')](_0x53a797,_0x30a084);});if(_0x26830a){return _0x191ed4['id'];}}}));}}return BPromise[_0x8945('0x7d')](_0xa4890b)[_0x8945('0x26')](function(_0x2b24a3){_0x27f714=_(_0x27f714)[_0x8945('0x7e')](_0x2b24a3)[_0x8945('0x7f')]()['value']();return db[_0x8945('0x31')][_0x8945('0x4a')]({'where':{'id':_0x444c92['params']['id']}})[_0x8945('0x26')](function(_0x330c82){return db['sequelize']['transaction'](function(_0x38167f){return _0x330c82[_0x8945('0x6d')](_0x444c92[_0x8945('0x34')][_0x8945('0x80')],{'transaction':_0x38167f})[_0x8945('0x26')](function(){if(!_[_0x8945('0x81')](_0x27f714)){return _0x330c82[_0x8945('0x82')](_0x27f714,{'transaction':_0x38167f});}})[_0x8945('0x26')](function(){_0x27f714[_0x8945('0x6a')](function(_0x487521){socket['emit'](_0x8945('0x83'),{'UserId':_0x487521,'FaxQueueId':_0x330c82['id']});});});});});});})[_0x8945('0x26')](respondWithStatusCode(_0x37e80f,null))[_0x8945('0x4b')](handleError(_0x37e80f,null));};exports[_0x8945('0x84')]=function(_0x23827a,_0x563226,_0x48285c){return db['FaxQueue']['find']({'where':{'id':_0x23827a[_0x8945('0x48')]['id']}})[_0x8945('0x26')](handleEntityNotFound(_0x563226,null))[_0x8945('0x26')](function(_0x157934){if(_0x157934){return _0x157934[_0x8945('0x84')](_0x23827a[_0x8945('0x4d')][_0x8945('0x80')],_[_0x8945('0x85')](_0x23827a[_0x8945('0x4d')],[_0x8945('0x80'),'id'])||{})[_0x8945('0x86')](function(_0x165c5f){for(var _0x49d262=0x0;_0x49d262<_0x23827a[_0x8945('0x4d')][_0x8945('0x80')][_0x8945('0x3a')];_0x49d262+=0x1){socket[_0x8945('0x6b')]('userFaxQueue:save',{'UserId':_0x23827a[_0x8945('0x4d')]['ids'][_0x49d262],'FaxQueueId':_0x23827a[_0x8945('0x48')]['id']});}return _0x165c5f;});}})[_0x8945('0x26')](respondWithResult(_0x563226,null))[_0x8945('0x4b')](handleError(_0x563226,null));};exports[_0x8945('0x82')]=function(_0x4cdbf4,_0x31a077,_0x37ba5d){return db['FaxQueue'][_0x8945('0x4a')]({'where':{'id':_0x4cdbf4[_0x8945('0x48')]['id']}})[_0x8945('0x26')](handleEntityNotFound(_0x31a077,null))[_0x8945('0x26')](function(_0x35b245){if(_0x35b245){return _0x35b245['removeAgents'](_0x4cdbf4[_0x8945('0x34')][_0x8945('0x80')])[_0x8945('0x26')](function(){if(_[_0x8945('0x87')](_0x4cdbf4[_0x8945('0x34')][_0x8945('0x80')])){for(var _0x302a22=0x0;_0x302a22<_0x4cdbf4[_0x8945('0x34')][_0x8945('0x80')][_0x8945('0x3a')];_0x302a22+=0x1){socket['emit']('userFaxQueue:remove',{'UserId':Number(_0x4cdbf4[_0x8945('0x34')][_0x8945('0x80')][_0x302a22]),'FaxQueueId':Number(_0x4cdbf4[_0x8945('0x48')]['id'])});}}else{socket[_0x8945('0x6b')](_0x8945('0x83'),{'UserId':Number(_0x4cdbf4['query'][_0x8945('0x80')]),'FaxQueueId':Number(_0x4cdbf4['params']['id'])});}});}})[_0x8945('0x26')](respondWithStatusCode(_0x31a077,null))['catch'](handleError(_0x31a077,null));};exports[_0x8945('0x88')]=function(_0x4d3c38,_0x4de03d,_0x35309d){var _0x219d8d={};var _0x36e01d={};var _0x39d2f7;var _0x5d67f6;return db[_0x8945('0x31')][_0x8945('0x52')]({'where':{'id':_0x4d3c38[_0x8945('0x48')]['id']}})[_0x8945('0x26')](handleEntityNotFound(_0x4de03d,null))[_0x8945('0x26')](function(_0x1c3450){if(_0x1c3450){_0x39d2f7=_0x1c3450;_0x36e01d[_0x8945('0x3b')]=_[_0x8945('0x35')](db[_0x8945('0x57')]['rawAttributes']);_0x36e01d['query']=_[_0x8945('0x35')](_0x4d3c38[_0x8945('0x34')]);_0x36e01d[_0x8945('0x36')]=_[_0x8945('0x37')](_0x36e01d['model'],_0x36e01d[_0x8945('0x34')]);_0x219d8d['attributes']=_[_0x8945('0x37')](_0x36e01d['model'],qs[_0x8945('0x39')](_0x4d3c38[_0x8945('0x34')][_0x8945('0x39')]));_0x219d8d[_0x8945('0x38')]=_0x219d8d['attributes'][_0x8945('0x3a')]?_0x219d8d['attributes']:_0x36e01d[_0x8945('0x3b')];_0x219d8d[_0x8945('0x3d')]=qs[_0x8945('0x3e')](_0x4d3c38['query'][_0x8945('0x3e')]);_0x219d8d[_0x8945('0x3f')]=qs[_0x8945('0x36')](_[_0x8945('0x40')](_0x4d3c38[_0x8945('0x34')],_0x36e01d[_0x8945('0x36')]));if(_0x4d3c38[_0x8945('0x34')][_0x8945('0x41')]){_0x219d8d[_0x8945('0x3f')]=_['merge'](_0x219d8d[_0x8945('0x3f')],{'$or':_[_0x8945('0x30')](_0x219d8d[_0x8945('0x38')],function(_0x25f1e5){var _0x44056e={};_0x44056e[_0x25f1e5]={'$like':'%'+_0x4d3c38[_0x8945('0x34')][_0x8945('0x41')]+'%'};return _0x44056e;})});}_0x219d8d=_[_0x8945('0x42')]({},_0x219d8d,_0x4d3c38[_0x8945('0x56')]);return _0x39d2f7[_0x8945('0x88')](_0x219d8d);}})[_0x8945('0x26')](function(_0x25155f){if(_0x25155f){_0x5d67f6=_0x25155f[_0x8945('0x3a')];if(!_0x4d3c38[_0x8945('0x34')][_0x8945('0x54')](_0x8945('0x3c'))){_0x219d8d['limit']=qs[_0x8945('0x20')](_0x4d3c38[_0x8945('0x34')][_0x8945('0x20')]);_0x219d8d['offset']=qs[_0x8945('0x1f')](_0x4d3c38[_0x8945('0x34')][_0x8945('0x1f')]);}return _0x39d2f7[_0x8945('0x88')](_0x219d8d);}})[_0x8945('0x26')](function(_0x28e1cd){if(_0x28e1cd){return _0x28e1cd?{'count':_0x5d67f6,'rows':_0x28e1cd}:null;}})['then'](respondWithResult(_0x4de03d,null))[_0x8945('0x4b')](handleError(_0x4de03d,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 89b6396..2f5ebd8 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 _0x43ae=['save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','FaxQueue','setMaxListeners'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x43ae,0x196));var _0xe43a=function(_0x4cc4b1,_0x4894de){_0x4cc4b1=_0x4cc4b1-0x0;var _0x54292f=_0x43ae[_0x4cc4b1];return _0x54292f;};'use strict';var EventEmitter=require(_0xe43a('0x0'));var FaxQueue=require(_0xe43a('0x1'))['db'][_0xe43a('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xe43a('0x3')](0x0);var events={'afterCreate':_0xe43a('0x4'),'afterUpdate':_0xe43a('0x5'),'afterDestroy':_0xe43a('0x6')};function emitEvent(_0x556e30){return function(_0x485fe3,_0xf144af,_0x3487ed){FaxQueueEvents[_0xe43a('0x7')](_0x556e30+':'+_0x485fe3['id'],_0x485fe3);FaxQueueEvents[_0xe43a('0x7')](_0x556e30,_0x485fe3);_0x3487ed(null);};}for(var e in events){if(events[_0xe43a('0x8')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0xe43a('0x9')]=FaxQueueEvents; \ No newline at end of file +var _0x340f=['FaxQueue','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x340f,0x155));var _0xf340=function(_0x28e998,_0x2cd28d){_0x28e998=_0x28e998-0x0;var _0x22f431=_0x340f[_0x28e998];return _0x22f431;};'use strict';var EventEmitter=require(_0xf340('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0xf340('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf340('0x2'),'afterUpdate':_0xf340('0x3'),'afterDestroy':_0xf340('0x4')};function emitEvent(_0x244b00){return function(_0x39896c,_0x38d7a4,_0x2a4cdf){FaxQueueEvents[_0xf340('0x5')](_0x244b00+':'+_0x39896c['id'],_0x39896c);FaxQueueEvents[_0xf340('0x5')](_0x244b00,_0x39896c);_0x2a4cdf(null);};}for(var e in events){if(events[_0xf340('0x6')](e)){var event=events[e];FaxQueue[_0xf340('0x7')](e,emitEvent(event));}}module[_0xf340('0x8')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index bc55c8a..04f6909 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 _0x8792=['lodash','api','moment','path','rimraf','../../config/environment','./faxQueue.attributes','define','FaxQueue','fax_queues'];(function(_0x1a4a89,_0xbfe766){var _0x45e039=function(_0xa5fc69){while(--_0xa5fc69){_0x1a4a89['push'](_0x1a4a89['shift']());}};_0x45e039(++_0xbfe766);}(_0x8792,0x19a));var _0x2879=function(_0x1898f4,_0x13e234){_0x1898f4=_0x1898f4-0x0;var _0x388a76=_0x8792[_0x1898f4];return _0x388a76;};'use strict';var _=require(_0x2879('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2879('0x1'));var moment=require(_0x2879('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2879('0x3'));var rimraf=require(_0x2879('0x4'));var config=require(_0x2879('0x5'));var attributes=require(_0x2879('0x6'));module['exports']=function(_0x513ae7,_0x3174de){return _0x513ae7[_0x2879('0x7')](_0x2879('0x8'),attributes,{'tableName':_0x2879('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe10c=['fax_queues','lodash','util','../../config/logger','api','moment','request-promise','path','exports','define','FaxQueue'];(function(_0x4358b5,_0xebca06){var _0x4c3a8e=function(_0x3da827){while(--_0x3da827){_0x4358b5['push'](_0x4358b5['shift']());}};_0x4c3a8e(++_0xebca06);}(_0xe10c,0x182));var _0xce10=function(_0x56ae3f,_0x2e0b4a){_0x56ae3f=_0x56ae3f-0x0;var _0x568d76=_0xe10c[_0x56ae3f];return _0x568d76;};'use strict';var _=require(_0xce10('0x0'));var util=require(_0xce10('0x1'));var logger=require(_0xce10('0x2'))(_0xce10('0x3'));var moment=require(_0xce10('0x4'));var BPromise=require('bluebird');var rp=require(_0xce10('0x5'));var fs=require('fs');var path=require(_0xce10('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./faxQueue.attributes');module[_0xce10('0x7')]=function(_0x1f1bff,_0x388caa){return _0x1f1bff[_0xce10('0x8')](_0xce10('0x9'),attributes,{'tableName':_0xce10('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index 154c647..0311b21 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 _0x7d5b=['client','http','redis','localhost','socket.io-emitter','register','request','then','debug','request\x20sent','error','code','FaxQueue,\x20%s,\x20%s','message','info','result','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','limit','include','model','map','stringify','catch','ShowFaxQueue','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3bd497,_0x37d7a8){var _0x32f967=function(_0x1b84ba){while(--_0x1b84ba){_0x3bd497['push'](_0x3bd497['shift']());}};_0x32f967(++_0x37d7a8);}(_0x7d5b,0xb6));var _0xb7d5=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x7d5b[_0x164eca];return _0x2ce562;};'use strict';var _=require('lodash');var util=require(_0xb7d5('0x0'));var moment=require(_0xb7d5('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb7d5('0x2'));var db=require(_0xb7d5('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xb7d5('0x4'))(_0xb7d5('0x5'));var config=require(_0xb7d5('0x6'));var jayson=require(_0xb7d5('0x7'));var client=jayson[_0xb7d5('0x8')][_0xb7d5('0x9')]({'port':0x232a});config[_0xb7d5('0xa')]=_['defaults'](config[_0xb7d5('0xa')],{'host':_0xb7d5('0xb'),'port':0x18eb});var socket=require(_0xb7d5('0xc'))(new Redis(config['redis']));require('./faxQueue.socket')[_0xb7d5('0xd')](socket);function respondWithRpcPromise(_0x56eea7,_0x32185d,_0x3f5631){return new BPromise(function(_0x576c7a,_0x5b8e27){return client[_0xb7d5('0xe')](_0x56eea7,_0x3f5631)[_0xb7d5('0xf')](function(_0x442df7){logger['info']('FaxQueue,\x20%s,\x20%s',_0x32185d,'request\x20sent');logger[_0xb7d5('0x10')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x32185d,_0xb7d5('0x11'),JSON['stringify'](_0x442df7));if(_0x442df7[_0xb7d5('0x12')]){if(_0x442df7['error'][_0xb7d5('0x13')]===0x1f4){logger[_0xb7d5('0x12')](_0xb7d5('0x14'),_0x32185d,_0x442df7[_0xb7d5('0x12')][_0xb7d5('0x15')]);return _0x5b8e27(_0x442df7[_0xb7d5('0x12')]['message']);}logger[_0xb7d5('0x12')]('FaxQueue,\x20%s,\x20%s',_0x32185d,_0x442df7[_0xb7d5('0x12')][_0xb7d5('0x15')]);return _0x576c7a(_0x442df7['error'][_0xb7d5('0x15')]);}else{logger[_0xb7d5('0x16')]('FaxQueue,\x20%s,\x20%s',_0x32185d,'request\x20sent');_0x576c7a(_0x442df7[_0xb7d5('0x17')][_0xb7d5('0x15')]);}})['catch'](function(_0x312d00){logger['error'](_0xb7d5('0x14'),_0x32185d,_0x312d00);_0x5b8e27(_0x312d00);});});}exports[_0xb7d5('0x18')]=function(_0x2c947a){var _0x54b4d1=this;return new Promise(function(_0x105627,_0xfc1f2a){return db[_0xb7d5('0x19')][_0xb7d5('0x1a')]({'raw':_0x2c947a[_0xb7d5('0x1b')]?_0x2c947a['options'][_0xb7d5('0x1c')]===undefined?!![]:![]:!![],'where':_0x2c947a[_0xb7d5('0x1b')]?_0x2c947a['options'][_0xb7d5('0x1d')]||null:null,'attributes':_0x2c947a[_0xb7d5('0x1b')]?_0x2c947a['options'][_0xb7d5('0x1e')]||null:null,'limit':_0x2c947a['options']?_0x2c947a[_0xb7d5('0x1b')][_0xb7d5('0x1f')]||null:null,'include':_0x2c947a['options']?_0x2c947a[_0xb7d5('0x1b')][_0xb7d5('0x20')]?_['map'](_0x2c947a[_0xb7d5('0x1b')][_0xb7d5('0x20')],function(_0x312e2f){return{'model':db[_0x312e2f[_0xb7d5('0x21')]],'as':_0x312e2f['as'],'attributes':_0x312e2f[_0xb7d5('0x1e')],'include':_0x312e2f[_0xb7d5('0x20')]?_['map'](_0x312e2f[_0xb7d5('0x20')],function(_0x5e44a1){return{'model':db[_0x5e44a1[_0xb7d5('0x21')]],'as':_0x5e44a1['as'],'attributes':_0x5e44a1[_0xb7d5('0x1e')],'include':_0x5e44a1['include']?_[_0xb7d5('0x22')](_0x5e44a1[_0xb7d5('0x20')],function(_0x4ccd3f){return{'model':db[_0x4ccd3f[_0xb7d5('0x21')]],'as':_0x4ccd3f['as'],'attributes':_0x4ccd3f[_0xb7d5('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xb7d5('0xf')](function(_0x5afa28){logger[_0xb7d5('0x16')](_0xb7d5('0x18'),_0x2c947a);logger[_0xb7d5('0x10')](_0xb7d5('0x18'),_0x2c947a,JSON[_0xb7d5('0x23')](_0x5afa28));_0x105627(_0x5afa28);})[_0xb7d5('0x24')](function(_0x768131){logger[_0xb7d5('0x12')]('GetFaxQueue',_0x768131['message'],_0x2c947a);_0xfc1f2a(_0x54b4d1[_0xb7d5('0x12')](0x1f4,_0x768131[_0xb7d5('0x15')]));});});};exports[_0xb7d5('0x25')]=function(_0x207892){var _0x30f5ae=this;return new Promise(function(_0x1d79fb,_0x293114){return db['FaxQueue']['find']({'raw':_0x207892[_0xb7d5('0x1b')]?_0x207892[_0xb7d5('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x207892['options']?_0x207892[_0xb7d5('0x1b')]['where']||null:null,'attributes':_0x207892['options']?_0x207892[_0xb7d5('0x1b')][_0xb7d5('0x1e')]||null:null,'include':_0x207892[_0xb7d5('0x1b')]?_0x207892[_0xb7d5('0x1b')][_0xb7d5('0x20')]?_[_0xb7d5('0x22')](_0x207892['options'][_0xb7d5('0x20')],function(_0x41c8a1){return{'model':db[_0x41c8a1[_0xb7d5('0x21')]],'as':_0x41c8a1['as'],'attributes':_0x41c8a1[_0xb7d5('0x1e')],'include':_0x41c8a1[_0xb7d5('0x20')]?_[_0xb7d5('0x22')](_0x41c8a1[_0xb7d5('0x20')],function(_0x488fc1){return{'model':db[_0x488fc1[_0xb7d5('0x21')]],'as':_0x488fc1['as'],'attributes':_0x488fc1['attributes'],'include':_0x488fc1['include']?_['map'](_0x488fc1[_0xb7d5('0x20')],function(_0x441d6c){return{'model':db[_0x441d6c[_0xb7d5('0x21')]],'as':_0x441d6c['as'],'attributes':_0x441d6c[_0xb7d5('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xb7d5('0xf')](function(_0xb8b425){logger[_0xb7d5('0x16')](_0xb7d5('0x25'),_0x207892);logger['debug']('ShowFaxQueue',_0x207892,JSON[_0xb7d5('0x23')](_0xb8b425));_0x1d79fb(_0xb8b425);})[_0xb7d5('0x24')](function(_0x3b508f){logger[_0xb7d5('0x12')](_0xb7d5('0x25'),_0x3b508f[_0xb7d5('0x15')],_0x207892);_0x293114(_0x30f5ae[_0xb7d5('0x12')](0x1f4,_0x3b508f[_0xb7d5('0x15')]));});});}; \ No newline at end of file +var _0x9f13=['http','defaults','redis','localhost','socket.io-emitter','register','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowFaxQueue','FaxQueue','find','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x2922b,_0x375752){var _0x430b40=function(_0x612c79){while(--_0x612c79){_0x2922b['push'](_0x2922b['shift']());}};_0x430b40(++_0x375752);}(_0x9f13,0xc3));var _0x39f1=function(_0x1b453f,_0x17520b){_0x1b453f=_0x1b453f-0x0;var _0x581714=_0x9f13[_0x1b453f];return _0x581714;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x39f1('0x0'));var BPromise=require(_0x39f1('0x1'));var rs=require(_0x39f1('0x2'));var fs=require('fs');var Redis=require(_0x39f1('0x3'));var db=require(_0x39f1('0x4'))['db'];var utils=require(_0x39f1('0x5'));var logger=require(_0x39f1('0x6'))(_0x39f1('0x7'));var config=require('../../config/environment');var jayson=require(_0x39f1('0x8'));var client=jayson[_0x39f1('0x9')][_0x39f1('0xa')]({'port':0x232a});config['redis']=_[_0x39f1('0xb')](config[_0x39f1('0xc')],{'host':_0x39f1('0xd'),'port':0x18eb});var socket=require(_0x39f1('0xe'))(new Redis(config['redis']));require('./faxQueue.socket')[_0x39f1('0xf')](socket);function respondWithRpcPromise(_0x58b0a5,_0x3a5df9,_0x17fde7){return new BPromise(function(_0x14dd07,_0x172204){return client['request'](_0x58b0a5,_0x17fde7)[_0x39f1('0x10')](function(_0x13f9d2){logger[_0x39f1('0x11')](_0x39f1('0x12'),_0x3a5df9,_0x39f1('0x13'));logger[_0x39f1('0x14')](_0x39f1('0x15'),_0x3a5df9,_0x39f1('0x13'),JSON[_0x39f1('0x16')](_0x13f9d2));if(_0x13f9d2[_0x39f1('0x17')]){if(_0x13f9d2[_0x39f1('0x17')][_0x39f1('0x18')]===0x1f4){logger[_0x39f1('0x17')]('FaxQueue,\x20%s,\x20%s',_0x3a5df9,_0x13f9d2[_0x39f1('0x17')][_0x39f1('0x19')]);return _0x172204(_0x13f9d2[_0x39f1('0x17')][_0x39f1('0x19')]);}logger[_0x39f1('0x17')]('FaxQueue,\x20%s,\x20%s',_0x3a5df9,_0x13f9d2[_0x39f1('0x17')]['message']);return _0x14dd07(_0x13f9d2[_0x39f1('0x17')]['message']);}else{logger[_0x39f1('0x11')]('FaxQueue,\x20%s,\x20%s',_0x3a5df9,'request\x20sent');_0x14dd07(_0x13f9d2[_0x39f1('0x1a')][_0x39f1('0x19')]);}})[_0x39f1('0x1b')](function(_0x14deab){logger[_0x39f1('0x17')]('FaxQueue,\x20%s,\x20%s',_0x3a5df9,_0x14deab);_0x172204(_0x14deab);});});}exports[_0x39f1('0x1c')]=function(_0x3312d3){var _0x4a8d03=this;return new Promise(function(_0x306da5,_0x2479e2){return db['FaxQueue'][_0x39f1('0x1d')]({'raw':_0x3312d3[_0x39f1('0x1e')]?_0x3312d3[_0x39f1('0x1e')][_0x39f1('0x1f')]===undefined?!![]:![]:!![],'where':_0x3312d3[_0x39f1('0x1e')]?_0x3312d3[_0x39f1('0x1e')][_0x39f1('0x20')]||null:null,'attributes':_0x3312d3[_0x39f1('0x1e')]?_0x3312d3[_0x39f1('0x1e')][_0x39f1('0x21')]||null:null,'limit':_0x3312d3[_0x39f1('0x1e')]?_0x3312d3[_0x39f1('0x1e')][_0x39f1('0x22')]||null:null,'include':_0x3312d3[_0x39f1('0x1e')]?_0x3312d3['options'][_0x39f1('0x23')]?_[_0x39f1('0x24')](_0x3312d3[_0x39f1('0x1e')][_0x39f1('0x23')],function(_0x46d51f){return{'model':db[_0x46d51f[_0x39f1('0x25')]],'as':_0x46d51f['as'],'attributes':_0x46d51f[_0x39f1('0x21')],'include':_0x46d51f[_0x39f1('0x23')]?_['map'](_0x46d51f[_0x39f1('0x23')],function(_0xa6acb9){return{'model':db[_0xa6acb9[_0x39f1('0x25')]],'as':_0xa6acb9['as'],'attributes':_0xa6acb9[_0x39f1('0x21')],'include':_0xa6acb9[_0x39f1('0x23')]?_[_0x39f1('0x24')](_0xa6acb9[_0x39f1('0x23')],function(_0x1a02ee){return{'model':db[_0x1a02ee[_0x39f1('0x25')]],'as':_0x1a02ee['as'],'attributes':_0x1a02ee['attributes']};}):[]};}):[]};}):[]:[]})[_0x39f1('0x10')](function(_0x27f42f){logger[_0x39f1('0x11')](_0x39f1('0x1c'),_0x3312d3);logger[_0x39f1('0x14')]('GetFaxQueue',_0x3312d3,JSON[_0x39f1('0x16')](_0x27f42f));_0x306da5(_0x27f42f);})['catch'](function(_0x26fa42){logger['error'](_0x39f1('0x1c'),_0x26fa42['message'],_0x3312d3);_0x2479e2(_0x4a8d03[_0x39f1('0x17')](0x1f4,_0x26fa42[_0x39f1('0x19')]));});});};exports[_0x39f1('0x26')]=function(_0x225a48){var _0x57a63e=this;return new Promise(function(_0x4c4deb,_0x35b27d){return db[_0x39f1('0x27')][_0x39f1('0x28')]({'raw':_0x225a48[_0x39f1('0x1e')]?_0x225a48['options'][_0x39f1('0x1f')]===undefined?!![]:![]:!![],'where':_0x225a48[_0x39f1('0x1e')]?_0x225a48[_0x39f1('0x1e')][_0x39f1('0x20')]||null:null,'attributes':_0x225a48[_0x39f1('0x1e')]?_0x225a48[_0x39f1('0x1e')][_0x39f1('0x21')]||null:null,'include':_0x225a48[_0x39f1('0x1e')]?_0x225a48['options']['include']?_['map'](_0x225a48[_0x39f1('0x1e')][_0x39f1('0x23')],function(_0x2e7324){return{'model':db[_0x2e7324[_0x39f1('0x25')]],'as':_0x2e7324['as'],'attributes':_0x2e7324[_0x39f1('0x21')],'include':_0x2e7324[_0x39f1('0x23')]?_[_0x39f1('0x24')](_0x2e7324[_0x39f1('0x23')],function(_0x207eeb){return{'model':db[_0x207eeb['model']],'as':_0x207eeb['as'],'attributes':_0x207eeb[_0x39f1('0x21')],'include':_0x207eeb[_0x39f1('0x23')]?_['map'](_0x207eeb['include'],function(_0x2b9ba4){return{'model':db[_0x2b9ba4['model']],'as':_0x2b9ba4['as'],'attributes':_0x2b9ba4[_0x39f1('0x21')]};}):[]};}):[]};}):[]:[]})[_0x39f1('0x10')](function(_0x38e858){logger[_0x39f1('0x11')](_0x39f1('0x26'),_0x225a48);logger[_0x39f1('0x14')](_0x39f1('0x26'),_0x225a48,JSON[_0x39f1('0x16')](_0x38e858));_0x4c4deb(_0x38e858);})[_0x39f1('0x1b')](function(_0x4569b2){logger['error']('ShowFaxQueue',_0x4569b2[_0x39f1('0x19')],_0x225a48);_0x35b27d(_0x57a63e[_0x39f1('0x17')](0x1f4,_0x4569b2[_0x39f1('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 2a4e25a..dfeadef 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 _0x0477=['emit','removeListener','register','length','faxQueue:','./faxQueue.events','save','remove','update'];(function(_0x3f0553,_0x4282b2){var _0x13a7ba=function(_0x377a69){while(--_0x377a69){_0x3f0553['push'](_0x3f0553['shift']());}};_0x13a7ba(++_0x4282b2);}(_0x0477,0x1d0));var _0x7047=function(_0x3f3f06,_0x581e5b){_0x3f3f06=_0x3f3f06-0x0;var _0x140feb=_0x0477[_0x3f3f06];return _0x140feb;};'use strict';var FaxQueueEvents=require(_0x7047('0x0'));var events=[_0x7047('0x1'),_0x7047('0x2'),_0x7047('0x3')];function createListener(_0x279969,_0x1af31d){return function(_0x3d1c3a){_0x1af31d[_0x7047('0x4')](_0x279969,_0x3d1c3a);};}function removeListener(_0xe3cd9b,_0xee54d4){return function(){FaxQueueEvents[_0x7047('0x5')](_0xe3cd9b,_0xee54d4);};}exports[_0x7047('0x6')]=function(_0xde6cb7){for(var _0x12ed34=0x0,_0x2ef2d1=events[_0x7047('0x7')];_0x12ed34<_0x2ef2d1;_0x12ed34++){var _0x382e8a=events[_0x12ed34];var _0x1bdb81=createListener(_0x7047('0x8')+_0x382e8a,_0xde6cb7);FaxQueueEvents['on'](_0x382e8a,_0x1bdb81);}}; \ No newline at end of file +var _0x9bb7=['length','faxQueue:','./faxQueue.events','save','remove','update','removeListener'];(function(_0x4b03c9,_0x17ce03){var _0x161ba2=function(_0xb952db){while(--_0xb952db){_0x4b03c9['push'](_0x4b03c9['shift']());}};_0x161ba2(++_0x17ce03);}(_0x9bb7,0x1f3));var _0x79bb=function(_0x57a9e5,_0x5009df){_0x57a9e5=_0x57a9e5-0x0;var _0x36d39e=_0x9bb7[_0x57a9e5];return _0x36d39e;};'use strict';var FaxQueueEvents=require(_0x79bb('0x0'));var events=[_0x79bb('0x1'),_0x79bb('0x2'),_0x79bb('0x3')];function createListener(_0x49eb32,_0x38d2b5){return function(_0x3524d0){_0x38d2b5['emit'](_0x49eb32,_0x3524d0);};}function removeListener(_0x1e339c,_0x358088){return function(){FaxQueueEvents[_0x79bb('0x4')](_0x1e339c,_0x358088);};}exports['register']=function(_0x114fbd){for(var _0x175d61=0x0,_0x195f54=events[_0x79bb('0x5')];_0x175d61<_0x195f54;_0x175d61++){var _0x47fe41=events[_0x175d61];var _0x4de943=createListener(_0x79bb('0x6')+_0x47fe41,_0x114fbd);FaxQueueEvents['on'](_0x47fe41,_0x4de943);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 03770de..fcad3a1 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 _0xbaf0=['create','addAgents','put','delete','destroy','removeTeams','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post'];(function(_0x435850,_0x32aa47){var _0x5453e4=function(_0x17b32a){while(--_0x17b32a){_0x435850['push'](_0x435850['shift']());}};_0x5453e4(++_0x32aa47);}(_0xbaf0,0x12a));var _0x0baf=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbaf0[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var auth=require(_0x0baf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0baf('0x6'));var controller=require(_0x0baf('0x7'));router[_0x0baf('0x8')]('/',auth[_0x0baf('0x9')](),controller[_0x0baf('0xa')]);router[_0x0baf('0x8')](_0x0baf('0xb'),auth[_0x0baf('0x9')](),controller[_0x0baf('0xc')]);router['get'](_0x0baf('0xd'),auth['isAuthenticated'](),controller[_0x0baf('0xe')]);router[_0x0baf('0x8')](_0x0baf('0xf'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x10')]);router[_0x0baf('0x8')](_0x0baf('0x11'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x8')](_0x0baf('0x13'),auth['isAuthenticated'](),controller['getAgents']);router[_0x0baf('0x14')]('/',auth[_0x0baf('0x9')](),controller[_0x0baf('0x15')]);router[_0x0baf('0x14')]('/:id/teams',auth[_0x0baf('0x9')](),controller['addTeams']);router[_0x0baf('0x14')](_0x0baf('0x13'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x16')]);router[_0x0baf('0x17')](_0x0baf('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x0baf('0x18')](_0x0baf('0xd'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x19')]);router[_0x0baf('0x18')](_0x0baf('0x11'),auth['isAuthenticated'](),controller[_0x0baf('0x1a')]);router[_0x0baf('0x18')](_0x0baf('0x13'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x1b')]);module[_0x0baf('0x1c')]=router; \ No newline at end of file +var _0xbaf0=['create','addAgents','put','delete','destroy','removeTeams','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post'];(function(_0x327e57,_0x3342a1){var _0x3279f6=function(_0x70ed4d){while(--_0x70ed4d){_0x327e57['push'](_0x327e57['shift']());}};_0x3279f6(++_0x3342a1);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'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 auth=require(_0x0baf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0baf('0x6'));var controller=require(_0x0baf('0x7'));router[_0x0baf('0x8')]('/',auth[_0x0baf('0x9')](),controller[_0x0baf('0xa')]);router[_0x0baf('0x8')](_0x0baf('0xb'),auth[_0x0baf('0x9')](),controller[_0x0baf('0xc')]);router['get'](_0x0baf('0xd'),auth['isAuthenticated'](),controller[_0x0baf('0xe')]);router[_0x0baf('0x8')](_0x0baf('0xf'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x10')]);router[_0x0baf('0x8')](_0x0baf('0x11'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x8')](_0x0baf('0x13'),auth['isAuthenticated'](),controller['getAgents']);router[_0x0baf('0x14')]('/',auth[_0x0baf('0x9')](),controller[_0x0baf('0x15')]);router[_0x0baf('0x14')]('/:id/teams',auth[_0x0baf('0x9')](),controller['addTeams']);router[_0x0baf('0x14')](_0x0baf('0x13'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x16')]);router[_0x0baf('0x17')](_0x0baf('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x0baf('0x18')](_0x0baf('0xd'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x19')]);router[_0x0baf('0x18')](_0x0baf('0x11'),auth['isAuthenticated'](),controller[_0x0baf('0x1a')]);router[_0x0baf('0x18')](_0x0baf('0x13'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x1b')]);module[_0x0baf('0x1c')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index ecd3df4..50ddd65 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 _0xe766=['exports','STRING','DATE','sequelize'];(function(_0x2d344f,_0x25fa84){var _0x2e796b=function(_0x10466a){while(--_0x10466a){_0x2d344f['push'](_0x2d344f['shift']());}};_0x2e796b(++_0x25fa84);}(_0xe766,0xa7));var _0x6e76=function(_0x19df8e,_0xc8482){_0x19df8e=_0x19df8e-0x0;var _0x378598=_0xe766[_0x19df8e];return _0x378598;};'use strict';var moment=require('moment');var Sequelize=require(_0x6e76('0x0'));module[_0x6e76('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x6e76('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x6e76('0x3')]},'exitAt':{'type':Sequelize[_0x6e76('0x3')]},'reason':{'type':Sequelize[_0x6e76('0x2')]}}; \ No newline at end of file +var _0xb04c=['exports','STRING','DATE','sequelize'];(function(_0xfcbcb8,_0x35bf6b){var _0x1b1f97=function(_0x51e11d){while(--_0x51e11d){_0xfcbcb8['push'](_0xfcbcb8['shift']());}};_0x1b1f97(++_0x35bf6b);}(_0xb04c,0x187));var _0xcb04=function(_0x8f0e7f,_0xcdec27){_0x8f0e7f=_0x8f0e7f-0x0;var _0x24ae23=_0xb04c[_0x8f0e7f];return _0x24ae23;};'use strict';var moment=require('moment');var Sequelize=require(_0xcb04('0x0'));module[_0xcb04('0x1')]={'uniqueid':{'type':Sequelize[_0xcb04('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xcb04('0x2')]},'joinAt':{'type':Sequelize[_0xcb04('0x3')]},'leaveAt':{'type':Sequelize[_0xcb04('0x3')]},'acceptAt':{'type':Sequelize[_0xcb04('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index eb13eda..842f230 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 _0xa4c0=['rows','catch','show','params','keys','rawAttributes','filters','length','includeAll','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','status','count','offset','limit','Content-Range','apply','reject','update','then','destroy','sendStatus','error','name','send','map','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','FaxQueueReport','include'];(function(_0x1f7c00,_0x5a5de8){var _0x2d25c9=function(_0x19fd3f){while(--_0x19fd3f){_0x1f7c00['push'](_0x1f7c00['shift']());}};_0x2d25c9(++_0x5a5de8);}(_0xa4c0,0x1aa));var _0x0a4c=function(_0x1fddb0,_0xbc027c){_0x1fddb0=_0x1fddb0-0x0;var _0x503f30=_0xa4c0[_0x1fddb0];return _0x503f30;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0a4c('0x0'));var rimraf=require(_0x0a4c('0x1'));var zipdir=require(_0x0a4c('0x2'));var jsonpatch=require(_0x0a4c('0x3'));var rp=require(_0x0a4c('0x4'));var moment=require('moment');var BPromise=require(_0x0a4c('0x5'));var Mustache=require(_0x0a4c('0x6'));var util=require('util');var path=require(_0x0a4c('0x7'));var sox=require(_0x0a4c('0x8'));var csv=require(_0x0a4c('0x9'));var ejs=require(_0x0a4c('0xa'));var fs=require('fs');var _=require(_0x0a4c('0xb'));var squel=require(_0x0a4c('0xc'));var crypto=require(_0x0a4c('0xd'));var jsforce=require(_0x0a4c('0xe'));var deskjs=require(_0x0a4c('0xf'));var toCsv=require(_0x0a4c('0x9'));var querystring=require(_0x0a4c('0x10'));var Papa=require(_0x0a4c('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0a4c('0x12'));var as=require(_0x0a4c('0x13'));var hardwareService=require(_0x0a4c('0x14'));var logger=require('../../config/logger')(_0x0a4c('0x15'));var utils=require(_0x0a4c('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x537cb3,_0x558376){_0x558376=_0x558376||0xcc;return function(_0x56b10f){if(_0x56b10f){return _0x537cb3['sendStatus'](_0x558376);}return _0x537cb3['status'](_0x558376)['end']();};}function respondWithResult(_0x302a6e,_0x562a24){_0x562a24=_0x562a24||0xc8;return function(_0x5ebf55){if(_0x5ebf55){return _0x302a6e[_0x0a4c('0x17')](_0x562a24)['json'](_0x5ebf55);}};}function respondWithFilteredResult(_0x3229ff,_0x1c8ed9){return function(_0xccac80){if(_0xccac80){var _0x2ab318=_0xccac80[_0x0a4c('0x18')],_0x4626e2=_0x1c8ed9['offset'],_0x5d8e24=_0x1c8ed9[_0x0a4c('0x19')]+_0x1c8ed9[_0x0a4c('0x1a')],_0x52fe92;if(_0x5d8e24>=_0x2ab318){_0x5d8e24=_0x2ab318;_0x52fe92=0xc8;}else{_0x52fe92=0xce;}_0x3229ff[_0x0a4c('0x17')](_0x52fe92);return _0x3229ff['set'](_0x0a4c('0x1b'),_0x4626e2+'-'+_0x5d8e24+'/'+_0x2ab318)['json'](_0xccac80);}return null;};}function patchUpdates(_0x3c54e9){return function(_0x3b0633){try{jsonpatch[_0x0a4c('0x1c')](_0x3b0633,_0x3c54e9,!![]);}catch(_0x385f0c){return BPromise[_0x0a4c('0x1d')](_0x385f0c);}return _0x3b0633['save']();};}function saveUpdates(_0x29c742,_0x152622){return function(_0x503c4c){if(_0x503c4c){return _0x503c4c[_0x0a4c('0x1e')](_0x29c742)[_0x0a4c('0x1f')](function(_0x1aaa7c){return _0x1aaa7c;});}return null;};}function removeEntity(_0xf57a3e,_0x1f72ac){return function(_0x325c08){if(_0x325c08){return _0x325c08[_0x0a4c('0x20')]()[_0x0a4c('0x1f')](function(){_0xf57a3e[_0x0a4c('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d4848,_0x25e0fa){return function(_0x4c6f67){if(!_0x4c6f67){_0x4d4848[_0x0a4c('0x21')](0x194);}return _0x4c6f67;};}function handleError(_0x55a362,_0x9f7f9b){_0x9f7f9b=_0x9f7f9b||0x1f4;return function(_0x54b5aa){logger[_0x0a4c('0x22')](_0x54b5aa['stack']);if(_0x54b5aa['name']){delete _0x54b5aa[_0x0a4c('0x23')];}_0x55a362['status'](_0x9f7f9b)[_0x0a4c('0x24')](_0x54b5aa);};}exports['index']=function(_0x466dcd,_0x51bae1){var _0x3103d4={},_0x2fc24d={},_0x2b5106={'count':0x0,'rows':[]};var _0x4f31e1=_[_0x0a4c('0x25')](db['FaxQueueReport']['rawAttributes'],function(_0x364ec0){return{'name':_0x364ec0[_0x0a4c('0x26')],'type':_0x364ec0[_0x0a4c('0x27')][_0x0a4c('0x28')]};});_0x2fc24d[_0x0a4c('0x29')]=_['map'](_0x4f31e1,'name');_0x2fc24d[_0x0a4c('0x2a')]=_['keys'](_0x466dcd['query']);_0x2fc24d['filters']=_[_0x0a4c('0x2b')](_0x2fc24d[_0x0a4c('0x29')],_0x2fc24d[_0x0a4c('0x2a')]);_0x3103d4[_0x0a4c('0x2c')]=_[_0x0a4c('0x2b')](_0x2fc24d[_0x0a4c('0x29')],qs[_0x0a4c('0x2d')](_0x466dcd['query'][_0x0a4c('0x2d')]));_0x3103d4[_0x0a4c('0x2c')]=_0x3103d4[_0x0a4c('0x2c')]['length']?_0x3103d4[_0x0a4c('0x2c')]:_0x2fc24d[_0x0a4c('0x29')];if(!_0x466dcd[_0x0a4c('0x2a')][_0x0a4c('0x2e')](_0x0a4c('0x2f'))){_0x3103d4[_0x0a4c('0x1a')]=qs[_0x0a4c('0x1a')](_0x466dcd[_0x0a4c('0x2a')][_0x0a4c('0x1a')]);_0x3103d4[_0x0a4c('0x19')]=qs[_0x0a4c('0x19')](_0x466dcd[_0x0a4c('0x2a')][_0x0a4c('0x19')]);}_0x3103d4[_0x0a4c('0x30')]=qs[_0x0a4c('0x31')](_0x466dcd[_0x0a4c('0x2a')]['sort']);_0x3103d4[_0x0a4c('0x32')]=qs['filters'](_[_0x0a4c('0x33')](_0x466dcd[_0x0a4c('0x2a')],_0x2fc24d['filters']));if(_0x466dcd[_0x0a4c('0x2a')][_0x0a4c('0x34')]){_0x3103d4[_0x0a4c('0x32')]=_['merge'](_0x3103d4[_0x0a4c('0x32')],{'$or':_['map'](_0x4f31e1,function(_0x31abcb){if(_0x31abcb[_0x0a4c('0x27')]!==_0x0a4c('0x35')){var _0x14dced={};_0x14dced[_0x31abcb[_0x0a4c('0x23')]]={'$like':'%'+_0x466dcd[_0x0a4c('0x2a')][_0x0a4c('0x34')]+'%'};return _0x14dced;}})});}_0x3103d4=_[_0x0a4c('0x36')]({},_0x3103d4,_0x466dcd['options']);var _0xe52666={'where':_0x3103d4['where']};return db[_0x0a4c('0x37')]['count'](_0xe52666)[_0x0a4c('0x1f')](function(_0x546237){_0x2b5106[_0x0a4c('0x18')]=_0x546237;if(_0x466dcd[_0x0a4c('0x2a')]['includeAll']){_0x3103d4[_0x0a4c('0x38')]=[{'all':!![]}];}return db[_0x0a4c('0x37')]['findAll'](_0x3103d4);})[_0x0a4c('0x1f')](function(_0x197938){_0x2b5106[_0x0a4c('0x39')]=_0x197938;return _0x2b5106;})[_0x0a4c('0x1f')](respondWithFilteredResult(_0x51bae1,_0x3103d4))[_0x0a4c('0x3a')](handleError(_0x51bae1,null));};exports[_0x0a4c('0x3b')]=function(_0x55aac1,_0x386d36){var _0x35ae8a={'raw':!![],'where':{'id':_0x55aac1[_0x0a4c('0x3c')]['id']}},_0x2f439b={};_0x2f439b[_0x0a4c('0x29')]=_[_0x0a4c('0x3d')](db[_0x0a4c('0x37')][_0x0a4c('0x3e')]);_0x2f439b[_0x0a4c('0x2a')]=_[_0x0a4c('0x3d')](_0x55aac1[_0x0a4c('0x2a')]);_0x2f439b[_0x0a4c('0x3f')]=_[_0x0a4c('0x2b')](_0x2f439b[_0x0a4c('0x29')],_0x2f439b[_0x0a4c('0x2a')]);_0x35ae8a[_0x0a4c('0x2c')]=_[_0x0a4c('0x2b')](_0x2f439b[_0x0a4c('0x29')],qs['fields'](_0x55aac1[_0x0a4c('0x2a')][_0x0a4c('0x2d')]));_0x35ae8a['attributes']=_0x35ae8a['attributes'][_0x0a4c('0x40')]?_0x35ae8a[_0x0a4c('0x2c')]:_0x2f439b['model'];if(_0x55aac1[_0x0a4c('0x2a')][_0x0a4c('0x41')]){_0x35ae8a[_0x0a4c('0x38')]=[{'all':!![]}];}_0x35ae8a=_[_0x0a4c('0x36')]({},_0x35ae8a,_0x55aac1['options']);return db[_0x0a4c('0x37')][_0x0a4c('0x42')](_0x35ae8a)[_0x0a4c('0x1f')](handleEntityNotFound(_0x386d36,null))['then'](respondWithResult(_0x386d36,null))['catch'](handleError(_0x386d36,null));};exports['create']=function(_0x101b67,_0x18a28c){return db['FaxQueueReport']['create'](_0x101b67['body'],{})[_0x0a4c('0x1f')](respondWithResult(_0x18a28c,0xc9))[_0x0a4c('0x3a')](handleError(_0x18a28c,null));};exports[_0x0a4c('0x1e')]=function(_0x2e18b2,_0x4e05ac){if(_0x2e18b2[_0x0a4c('0x43')]['id']){delete _0x2e18b2['body']['id'];}return db[_0x0a4c('0x37')][_0x0a4c('0x42')]({'where':{'id':_0x2e18b2[_0x0a4c('0x3c')]['id']}})['then'](handleEntityNotFound(_0x4e05ac,null))[_0x0a4c('0x1f')](saveUpdates(_0x2e18b2[_0x0a4c('0x43')],null))['then'](respondWithResult(_0x4e05ac,null))[_0x0a4c('0x3a')](handleError(_0x4e05ac,null));};exports[_0x0a4c('0x20')]=function(_0x4b21bb,_0x48f48f){return db[_0x0a4c('0x37')][_0x0a4c('0x42')]({'where':{'id':_0x4b21bb['params']['id']}})[_0x0a4c('0x1f')](handleEntityNotFound(_0x48f48f,null))['then'](removeEntity(_0x48f48f,null))['catch'](handleError(_0x48f48f,null));};exports[_0x0a4c('0x44')]=function(_0x1b977b,_0x302905){return db[_0x0a4c('0x37')]['describe']()[_0x0a4c('0x1f')](respondWithResult(_0x302905,null))['catch'](handleError(_0x302905,null));}; \ No newline at end of file +var _0xe503=['request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','status','offset','limit','set','json','apply','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','FaxQueueReport','rawAttributes','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','count','include','findAll','rows','show','includeAll','options','catch','create','body','find','params','describe','html-pdf','eml-format','fast-json-patch'];(function(_0x258dc2,_0x18328a){var _0x33f14d=function(_0x53f007){while(--_0x53f007){_0x258dc2['push'](_0x258dc2['shift']());}};_0x33f14d(++_0x18328a);}(_0xe503,0x1bf));var _0x3e50=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xe503[_0x36dfbd];return _0x4ecad9;};'use strict';var pdf=require(_0x3e50('0x0'));var emlformat=require(_0x3e50('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3e50('0x2'));var rp=require(_0x3e50('0x3'));var moment=require(_0x3e50('0x4'));var BPromise=require(_0x3e50('0x5'));var Mustache=require(_0x3e50('0x6'));var util=require(_0x3e50('0x7'));var path=require(_0x3e50('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3e50('0x9'));var fs=require('fs');var _=require(_0x3e50('0xa'));var squel=require(_0x3e50('0xb'));var crypto=require(_0x3e50('0xc'));var jsforce=require(_0x3e50('0xd'));var deskjs=require(_0x3e50('0xe'));var toCsv=require(_0x3e50('0xf'));var querystring=require(_0x3e50('0x10'));var Papa=require(_0x3e50('0x11'));var Redis=require('ioredis');var authService=require(_0x3e50('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x3e50('0x13'));var hardwareService=require(_0x3e50('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x3e50('0x15'));var config=require(_0x3e50('0x16'));var db=require(_0x3e50('0x17'))['db'];function respondWithStatusCode(_0xefeca3,_0xc46d71){_0xc46d71=_0xc46d71||0xcc;return function(_0xe3877a){if(_0xe3877a){return _0xefeca3['sendStatus'](_0xc46d71);}return _0xefeca3[_0x3e50('0x18')](_0xc46d71)['end']();};}function respondWithResult(_0x44c26f,_0x4495ce){_0x4495ce=_0x4495ce||0xc8;return function(_0x5178b6){if(_0x5178b6){return _0x44c26f['status'](_0x4495ce)['json'](_0x5178b6);}};}function respondWithFilteredResult(_0x7a6e33,_0x15153d){return function(_0x18dfd7){if(_0x18dfd7){var _0x14ddd3=_0x18dfd7['count'],_0x7ca4e6=_0x15153d['offset'],_0x585df6=_0x15153d[_0x3e50('0x19')]+_0x15153d[_0x3e50('0x1a')],_0x30d6f7;if(_0x585df6>=_0x14ddd3){_0x585df6=_0x14ddd3;_0x30d6f7=0xc8;}else{_0x30d6f7=0xce;}_0x7a6e33[_0x3e50('0x18')](_0x30d6f7);return _0x7a6e33[_0x3e50('0x1b')]('Content-Range',_0x7ca4e6+'-'+_0x585df6+'/'+_0x14ddd3)[_0x3e50('0x1c')](_0x18dfd7);}return null;};}function patchUpdates(_0x51f51c){return function(_0x24b01f){try{jsonpatch[_0x3e50('0x1d')](_0x24b01f,_0x51f51c,!![]);}catch(_0x2d8f8a){return BPromise['reject'](_0x2d8f8a);}return _0x24b01f[_0x3e50('0x1e')]();};}function saveUpdates(_0x345dbd,_0xf153f){return function(_0x2f4d45){if(_0x2f4d45){return _0x2f4d45[_0x3e50('0x1f')](_0x345dbd)[_0x3e50('0x20')](function(_0x1a3285){return _0x1a3285;});}return null;};}function removeEntity(_0x4c4b09,_0x4025f2){return function(_0x3da7b8){if(_0x3da7b8){return _0x3da7b8[_0x3e50('0x21')]()[_0x3e50('0x20')](function(){_0x4c4b09[_0x3e50('0x18')](0xcc)[_0x3e50('0x22')]();});}};}function handleEntityNotFound(_0x2c277e,_0x3313a9){return function(_0x451a07){if(!_0x451a07){_0x2c277e[_0x3e50('0x23')](0x194);}return _0x451a07;};}function handleError(_0x1c59f5,_0x45c4f8){_0x45c4f8=_0x45c4f8||0x1f4;return function(_0x57e2f0){logger[_0x3e50('0x24')](_0x57e2f0[_0x3e50('0x25')]);if(_0x57e2f0[_0x3e50('0x26')]){delete _0x57e2f0[_0x3e50('0x26')];}_0x1c59f5[_0x3e50('0x18')](_0x45c4f8)[_0x3e50('0x27')](_0x57e2f0);};}exports[_0x3e50('0x28')]=function(_0x1237ba,_0x700f5d){var _0x289983={},_0x9620b1={},_0x33aa88={'count':0x0,'rows':[]};var _0xaaf6b3=_['map'](db[_0x3e50('0x29')][_0x3e50('0x2a')],function(_0x73ca83){return{'name':_0x73ca83['fieldName'],'type':_0x73ca83['type']['key']};});_0x9620b1[_0x3e50('0x2b')]=_[_0x3e50('0x2c')](_0xaaf6b3,_0x3e50('0x26'));_0x9620b1[_0x3e50('0x2d')]=_[_0x3e50('0x2e')](_0x1237ba[_0x3e50('0x2d')]);_0x9620b1['filters']=_[_0x3e50('0x2f')](_0x9620b1['model'],_0x9620b1[_0x3e50('0x2d')]);_0x289983[_0x3e50('0x30')]=_[_0x3e50('0x2f')](_0x9620b1[_0x3e50('0x2b')],qs[_0x3e50('0x31')](_0x1237ba['query'][_0x3e50('0x31')]));_0x289983[_0x3e50('0x30')]=_0x289983[_0x3e50('0x30')][_0x3e50('0x32')]?_0x289983['attributes']:_0x9620b1[_0x3e50('0x2b')];if(!_0x1237ba[_0x3e50('0x2d')][_0x3e50('0x33')](_0x3e50('0x34'))){_0x289983[_0x3e50('0x1a')]=qs[_0x3e50('0x1a')](_0x1237ba[_0x3e50('0x2d')][_0x3e50('0x1a')]);_0x289983[_0x3e50('0x19')]=qs[_0x3e50('0x19')](_0x1237ba[_0x3e50('0x2d')][_0x3e50('0x19')]);}_0x289983[_0x3e50('0x35')]=qs['sort'](_0x1237ba[_0x3e50('0x2d')][_0x3e50('0x36')]);_0x289983[_0x3e50('0x37')]=qs[_0x3e50('0x38')](_[_0x3e50('0x39')](_0x1237ba[_0x3e50('0x2d')],_0x9620b1[_0x3e50('0x38')]));if(_0x1237ba[_0x3e50('0x2d')]['filter']){_0x289983[_0x3e50('0x37')]=_[_0x3e50('0x3a')](_0x289983[_0x3e50('0x37')],{'$or':_[_0x3e50('0x2c')](_0xaaf6b3,function(_0x268ee9){if(_0x268ee9[_0x3e50('0x3b')]!==_0x3e50('0x3c')){var _0x36de13={};_0x36de13[_0x268ee9['name']]={'$like':'%'+_0x1237ba[_0x3e50('0x2d')][_0x3e50('0x3d')]+'%'};return _0x36de13;}})});}_0x289983=_[_0x3e50('0x3a')]({},_0x289983,_0x1237ba['options']);var _0x1c89dc={'where':_0x289983[_0x3e50('0x37')]};return db[_0x3e50('0x29')][_0x3e50('0x3e')](_0x1c89dc)[_0x3e50('0x20')](function(_0x49017f){_0x33aa88['count']=_0x49017f;if(_0x1237ba[_0x3e50('0x2d')]['includeAll']){_0x289983[_0x3e50('0x3f')]=[{'all':!![]}];}return db[_0x3e50('0x29')][_0x3e50('0x40')](_0x289983);})['then'](function(_0x299482){_0x33aa88[_0x3e50('0x41')]=_0x299482;return _0x33aa88;})[_0x3e50('0x20')](respondWithFilteredResult(_0x700f5d,_0x289983))['catch'](handleError(_0x700f5d,null));};exports[_0x3e50('0x42')]=function(_0x5daf55,_0x19e779){var _0x255094={'raw':!![],'where':{'id':_0x5daf55['params']['id']}},_0xf2fbdd={};_0xf2fbdd['model']=_[_0x3e50('0x2e')](db[_0x3e50('0x29')]['rawAttributes']);_0xf2fbdd[_0x3e50('0x2d')]=_[_0x3e50('0x2e')](_0x5daf55[_0x3e50('0x2d')]);_0xf2fbdd[_0x3e50('0x38')]=_['intersection'](_0xf2fbdd[_0x3e50('0x2b')],_0xf2fbdd[_0x3e50('0x2d')]);_0x255094[_0x3e50('0x30')]=_[_0x3e50('0x2f')](_0xf2fbdd['model'],qs[_0x3e50('0x31')](_0x5daf55['query']['fields']));_0x255094['attributes']=_0x255094[_0x3e50('0x30')]['length']?_0x255094[_0x3e50('0x30')]:_0xf2fbdd[_0x3e50('0x2b')];if(_0x5daf55['query'][_0x3e50('0x43')]){_0x255094['include']=[{'all':!![]}];}_0x255094=_['merge']({},_0x255094,_0x5daf55[_0x3e50('0x44')]);return db[_0x3e50('0x29')]['find'](_0x255094)[_0x3e50('0x20')](handleEntityNotFound(_0x19e779,null))['then'](respondWithResult(_0x19e779,null))[_0x3e50('0x45')](handleError(_0x19e779,null));};exports[_0x3e50('0x46')]=function(_0x581d9b,_0x272e8a){return db[_0x3e50('0x29')][_0x3e50('0x46')](_0x581d9b[_0x3e50('0x47')],{})['then'](respondWithResult(_0x272e8a,0xc9))[_0x3e50('0x45')](handleError(_0x272e8a,null));};exports[_0x3e50('0x1f')]=function(_0x51b8a6,_0x2ca581){if(_0x51b8a6[_0x3e50('0x47')]['id']){delete _0x51b8a6[_0x3e50('0x47')]['id'];}return db[_0x3e50('0x29')]['find']({'where':{'id':_0x51b8a6['params']['id']}})['then'](handleEntityNotFound(_0x2ca581,null))['then'](saveUpdates(_0x51b8a6[_0x3e50('0x47')],null))[_0x3e50('0x20')](respondWithResult(_0x2ca581,null))[_0x3e50('0x45')](handleError(_0x2ca581,null));};exports[_0x3e50('0x21')]=function(_0x2fedfc,_0x426316){return db[_0x3e50('0x29')][_0x3e50('0x48')]({'where':{'id':_0x2fedfc[_0x3e50('0x49')]['id']}})['then'](handleEntityNotFound(_0x426316,null))[_0x3e50('0x20')](removeEntity(_0x426316,null))['catch'](handleError(_0x426316,null));};exports[_0x3e50('0x4a')]=function(_0x173617,_0x463cd5){return db[_0x3e50('0x29')][_0x3e50('0x4a')]()[_0x3e50('0x20')](respondWithResult(_0x463cd5,null))[_0x3e50('0x45')](handleError(_0x463cd5,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 0314da3..fad6374 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 _0xcc82=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','report_fax_queue','uniqueid'];(function(_0x4a7269,_0x887887){var _0xc7154=function(_0x3fb2c1){while(--_0x3fb2c1){_0x4a7269['push'](_0x4a7269['shift']());}};_0xc7154(++_0x887887);}(_0xcc82,0xd2));var _0x2cc8=function(_0x3d38ae,_0x51102b){_0x3d38ae=_0x3d38ae-0x0;var _0x3757ee=_0xcc82[_0x3d38ae];return _0x3757ee;};'use strict';var _=require(_0x2cc8('0x0'));var util=require('util');var logger=require(_0x2cc8('0x1'))(_0x2cc8('0x2'));var moment=require(_0x2cc8('0x3'));var BPromise=require(_0x2cc8('0x4'));var rp=require(_0x2cc8('0x5'));var fs=require('fs');var path=require(_0x2cc8('0x6'));var rimraf=require(_0x2cc8('0x7'));var config=require(_0x2cc8('0x8'));var attributes=require(_0x2cc8('0x9'));module[_0x2cc8('0xa')]=function(_0x5b31a8,_0x7e6e19){return _0x5b31a8[_0x2cc8('0xb')]('FaxQueueReport',attributes,{'tableName':_0x2cc8('0xc'),'paranoid':![],'indexes':[{'name':_0x2cc8('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xbde6=['path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xbde6,0xe4));var _0x6bde=function(_0x398f8f,_0x1d9a9e){_0x398f8f=_0x398f8f-0x0;var _0xe9a48f=_0xbde6[_0x398f8f];return _0xe9a48f;};'use strict';var _=require(_0x6bde('0x0'));var util=require(_0x6bde('0x1'));var logger=require(_0x6bde('0x2'))(_0x6bde('0x3'));var moment=require(_0x6bde('0x4'));var BPromise=require(_0x6bde('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6bde('0x6'));var rimraf=require(_0x6bde('0x7'));var config=require(_0x6bde('0x8'));var attributes=require(_0x6bde('0x9'));module[_0x6bde('0xa')]=function(_0x367d2c,_0x862255){return _0x367d2c['define'](_0x6bde('0xb'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x6bde('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 4f170ee..681d168 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 _0x1aa8=['limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','FaxQueueReport,\x20%s,\x20%s','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','UpdateFaxQueueReport','update','where','attributes'];(function(_0x5e4a6d,_0x2c080b){var _0x29d1fa=function(_0x1aea7){while(--_0x1aea7){_0x5e4a6d['push'](_0x5e4a6d['shift']());}};_0x29d1fa(++_0x2c080b);}(_0x1aa8,0x109));var _0x81aa=function(_0x121f0a,_0x38d0a6){_0x121f0a=_0x121f0a-0x0;var _0x47afc8=_0x1aa8[_0x121f0a];return _0x47afc8;};'use strict';var _=require(_0x81aa('0x0'));var util=require(_0x81aa('0x1'));var moment=require(_0x81aa('0x2'));var BPromise=require(_0x81aa('0x3'));var rs=require(_0x81aa('0x4'));var fs=require('fs');var Redis=require(_0x81aa('0x5'));var db=require(_0x81aa('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x81aa('0x7'));var jayson=require(_0x81aa('0x8'));var client=jayson[_0x81aa('0x9')][_0x81aa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4850eb,_0x50cadd,_0x1b3e9d){return new BPromise(function(_0xb776a2,_0x36a082){return client[_0x81aa('0xb')](_0x4850eb,_0x1b3e9d)[_0x81aa('0xc')](function(_0x4a6989){logger[_0x81aa('0xd')]('FaxQueueReport,\x20%s,\x20%s',_0x50cadd,_0x81aa('0xe'));logger[_0x81aa('0xf')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x50cadd,_0x81aa('0xe'),JSON[_0x81aa('0x10')](_0x4a6989));if(_0x4a6989[_0x81aa('0x11')]){if(_0x4a6989[_0x81aa('0x11')]['code']===0x1f4){logger['error'](_0x81aa('0x12'),_0x50cadd,_0x4a6989[_0x81aa('0x11')][_0x81aa('0x13')]);return _0x36a082(_0x4a6989['error'][_0x81aa('0x13')]);}logger[_0x81aa('0x11')](_0x81aa('0x12'),_0x50cadd,_0x4a6989[_0x81aa('0x11')][_0x81aa('0x13')]);return _0xb776a2(_0x4a6989[_0x81aa('0x11')][_0x81aa('0x13')]);}else{logger['info']('FaxQueueReport,\x20%s,\x20%s',_0x50cadd,_0x81aa('0xe'));_0xb776a2(_0x4a6989[_0x81aa('0x14')]['message']);}})[_0x81aa('0x15')](function(_0x8ea6da){logger[_0x81aa('0x11')](_0x81aa('0x12'),_0x50cadd,_0x8ea6da);_0x36a082(_0x8ea6da);});});}exports[_0x81aa('0x16')]=function(_0x5a0aa4){var _0x59e31e=this;return new Promise(function(_0x311517,_0x493c55){return db[_0x81aa('0x17')][_0x81aa('0x18')](_0x5a0aa4[_0x81aa('0x19')],{'raw':_0x5a0aa4[_0x81aa('0x1a')]?_0x5a0aa4[_0x81aa('0x1a')][_0x81aa('0x1b')]===undefined?!![]:![]:!![]})[_0x81aa('0xc')](function(_0x1c1087){logger[_0x81aa('0xd')](_0x81aa('0x16'),_0x5a0aa4);logger[_0x81aa('0xf')](_0x81aa('0x16'),_0x5a0aa4,JSON[_0x81aa('0x10')](_0x1c1087));_0x311517(_0x1c1087);})[_0x81aa('0x15')](function(_0x931e6e){logger[_0x81aa('0x11')]('CreateFaxQueueReport',_0x931e6e[_0x81aa('0x13')],_0x5a0aa4);_0x493c55(_0x59e31e[_0x81aa('0x11')](0x1f4,_0x931e6e['message']));});});};exports[_0x81aa('0x1c')]=function(_0x27a1ab){var _0x20d7ac=this;return new Promise(function(_0x173e90,_0x1e4c45){return db[_0x81aa('0x17')][_0x81aa('0x1d')](_0x27a1ab[_0x81aa('0x19')],{'raw':_0x27a1ab[_0x81aa('0x1a')]?_0x27a1ab[_0x81aa('0x1a')][_0x81aa('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27a1ab[_0x81aa('0x1a')]?_0x27a1ab['options'][_0x81aa('0x1e')]||null:null,'attributes':_0x27a1ab[_0x81aa('0x1a')]?_0x27a1ab[_0x81aa('0x1a')][_0x81aa('0x1f')]||null:null,'limit':_0x27a1ab[_0x81aa('0x1a')]?_0x27a1ab[_0x81aa('0x1a')][_0x81aa('0x20')]||null:null})[_0x81aa('0xc')](function(_0x27772a){logger['info'](_0x81aa('0x1c'),_0x27a1ab);logger[_0x81aa('0xf')](_0x81aa('0x1c'),_0x27a1ab,JSON[_0x81aa('0x10')](_0x27772a));_0x173e90(_0x27772a);})[_0x81aa('0x15')](function(_0x171f8d){logger[_0x81aa('0x11')](_0x81aa('0x1c'),_0x171f8d['message'],_0x27a1ab);_0x1e4c45(_0x20d7ac[_0x81aa('0x11')](0x1f4,_0x171f8d['message']));});});}; \ No newline at end of file +var _0xb671=['stringify','catch','UpdateFaxQueueReport','update','raw','where','attributes','limit','lodash','moment','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client','http','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','CreateFaxQueueReport','FaxQueueReport','body','options','then'];(function(_0x595e7a,_0x531396){var _0x35c438=function(_0x128a1c){while(--_0x128a1c){_0x595e7a['push'](_0x595e7a['shift']());}};_0x35c438(++_0x531396);}(_0xb671,0xd3));var _0x1b67=function(_0x4c9eab,_0x27eb33){_0x4c9eab=_0x4c9eab-0x0;var _0x44f843=_0xb671[_0x4c9eab];return _0x44f843;};'use strict';var _=require(_0x1b67('0x0'));var util=require('util');var moment=require(_0x1b67('0x1'));var BPromise=require(_0x1b67('0x2'));var rs=require(_0x1b67('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1b67('0x4'))('rpc');var config=require(_0x1b67('0x5'));var jayson=require(_0x1b67('0x6'));var client=jayson[_0x1b67('0x7')][_0x1b67('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x34b398,_0x50e235,_0x4ee086){return new BPromise(function(_0x1a4423,_0x1df4e3){return client['request'](_0x34b398,_0x4ee086)['then'](function(_0x518844){logger['info'](_0x1b67('0x9'),_0x50e235,_0x1b67('0xa'));logger[_0x1b67('0xb')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x50e235,_0x1b67('0xa'),JSON['stringify'](_0x518844));if(_0x518844[_0x1b67('0xc')]){if(_0x518844[_0x1b67('0xc')]['code']===0x1f4){logger[_0x1b67('0xc')](_0x1b67('0x9'),_0x50e235,_0x518844['error'][_0x1b67('0xd')]);return _0x1df4e3(_0x518844[_0x1b67('0xc')][_0x1b67('0xd')]);}logger['error'](_0x1b67('0x9'),_0x50e235,_0x518844['error']['message']);return _0x1a4423(_0x518844[_0x1b67('0xc')]['message']);}else{logger[_0x1b67('0xe')]('FaxQueueReport,\x20%s,\x20%s',_0x50e235,_0x1b67('0xa'));_0x1a4423(_0x518844[_0x1b67('0xf')][_0x1b67('0xd')]);}})['catch'](function(_0x234489){logger[_0x1b67('0xc')]('FaxQueueReport,\x20%s,\x20%s',_0x50e235,_0x234489);_0x1df4e3(_0x234489);});});}exports[_0x1b67('0x10')]=function(_0x584748){var _0x3b862d=this;return new Promise(function(_0x348837,_0x4ca278){return db[_0x1b67('0x11')]['create'](_0x584748[_0x1b67('0x12')],{'raw':_0x584748[_0x1b67('0x13')]?_0x584748[_0x1b67('0x13')]['raw']===undefined?!![]:![]:!![]})[_0x1b67('0x14')](function(_0x595128){logger[_0x1b67('0xe')](_0x1b67('0x10'),_0x584748);logger[_0x1b67('0xb')](_0x1b67('0x10'),_0x584748,JSON[_0x1b67('0x15')](_0x595128));_0x348837(_0x595128);})[_0x1b67('0x16')](function(_0x51288d){logger[_0x1b67('0xc')]('CreateFaxQueueReport',_0x51288d[_0x1b67('0xd')],_0x584748);_0x4ca278(_0x3b862d[_0x1b67('0xc')](0x1f4,_0x51288d[_0x1b67('0xd')]));});});};exports[_0x1b67('0x17')]=function(_0x257056){var _0x54d48b=this;return new Promise(function(_0x5b3432,_0x172e4f){return db[_0x1b67('0x11')][_0x1b67('0x18')](_0x257056[_0x1b67('0x12')],{'raw':_0x257056[_0x1b67('0x13')]?_0x257056[_0x1b67('0x13')][_0x1b67('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x257056[_0x1b67('0x13')]?_0x257056[_0x1b67('0x13')][_0x1b67('0x1a')]||null:null,'attributes':_0x257056[_0x1b67('0x13')]?_0x257056[_0x1b67('0x13')][_0x1b67('0x1b')]||null:null,'limit':_0x257056[_0x1b67('0x13')]?_0x257056[_0x1b67('0x13')][_0x1b67('0x1c')]||null:null})[_0x1b67('0x14')](function(_0x3b5fcb){logger[_0x1b67('0xe')]('UpdateFaxQueueReport',_0x257056);logger['debug'](_0x1b67('0x17'),_0x257056,JSON[_0x1b67('0x15')](_0x3b5fcb));_0x5b3432(_0x3b5fcb);})['catch'](function(_0x2b4c18){logger[_0x1b67('0xc')]('UpdateFaxQueueReport',_0x2b4c18[_0x1b67('0xd')],_0x257056);_0x172e4f(_0x54d48b[_0x1b67('0xc')](0x1f4,_0x2b4c18['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index d60e259..2cae901 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 _0xcce1=['util','path','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','create','put','update','delete','destroy'];(function(_0x48a96f,_0x530059){var _0x3ff3ef=function(_0x286059){while(--_0x286059){_0x48a96f['push'](_0x48a96f['shift']());}};_0x3ff3ef(++_0x530059);}(_0xcce1,0xa0));var _0x1cce=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xcce1[_0x1b828b];return _0x98da1a;};'use strict';var multer=require('multer');var util=require(_0x1cce('0x0'));var path=require(_0x1cce('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1cce('0x2')]();var auth=require(_0x1cce('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x1cce('0x4'));var controller=require('./faxQueueReport.controller');router[_0x1cce('0x5')]('/',auth[_0x1cce('0x6')](),controller[_0x1cce('0x7')]);router[_0x1cce('0x5')]('/describe',auth[_0x1cce('0x6')](),controller[_0x1cce('0x8')]);router[_0x1cce('0x5')](_0x1cce('0x9'),auth[_0x1cce('0x6')](),controller[_0x1cce('0xa')]);router['post']('/',auth[_0x1cce('0x6')](),controller[_0x1cce('0xb')]);router[_0x1cce('0xc')](_0x1cce('0x9'),auth[_0x1cce('0x6')](),controller[_0x1cce('0xd')]);router[_0x1cce('0xe')]('/:id',auth[_0x1cce('0x6')](),controller[_0x1cce('0xf')]);module['exports']=router; \ No newline at end of file +var _0x1622=['/:id','isAuthenticated','post','create','put','delete','exports','multer','util','express','Router','../../components/auth/service','../../config/environment','./faxQueueReport.controller','get','index','/describe','describe'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x1622,0x73));var _0x2162=function(_0x4a7bf9,_0x35a7f3){_0x4a7bf9=_0x4a7bf9-0x0;var _0x58845a=_0x1622[_0x4a7bf9];return _0x58845a;};'use strict';var multer=require(_0x2162('0x0'));var util=require(_0x2162('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2162('0x2'));var router=express[_0x2162('0x3')]();var auth=require(_0x2162('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2162('0x5'));var controller=require(_0x2162('0x6'));router[_0x2162('0x7')]('/',auth['isAuthenticated'](),controller[_0x2162('0x8')]);router[_0x2162('0x7')](_0x2162('0x9'),auth['isAuthenticated'](),controller[_0x2162('0xa')]);router[_0x2162('0x7')](_0x2162('0xb'),auth[_0x2162('0xc')](),controller['show']);router[_0x2162('0xd')]('/',auth[_0x2162('0xc')](),controller[_0x2162('0xe')]);router[_0x2162('0xf')](_0x2162('0xb'),auth[_0x2162('0xc')](),controller['update']);router[_0x2162('0x10')](_0x2162('0xb'),auth[_0x2162('0xc')](),controller['destroy']);module[_0x2162('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 9df7ec0..2c8cfa9 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 _0x4f36=['DATE','NOW','moment','exports','STRING','account','agent','queue'];(function(_0x23b075,_0x128db1){var _0x5a7577=function(_0x3f6a4c){while(--_0x3f6a4c){_0x23b075['push'](_0x23b075['shift']());}};_0x5a7577(++_0x128db1);}(_0x4f36,0x172));var _0x64f3=function(_0x338f73,_0x1945c8){_0x338f73=_0x338f73-0x0;var _0x163fdf=_0x4f36[_0x338f73];return _0x163fdf;};'use strict';var moment=require(_0x64f3('0x0'));var Sequelize=require('sequelize');module[_0x64f3('0x1')]={'uniqueid':{'type':Sequelize[_0x64f3('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x64f3('0x3'),_0x64f3('0x4'),_0x64f3('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0x64f3('0x6')],'allowNull':![],'defaultValue':Sequelize[_0x64f3('0x7')]}}; \ No newline at end of file +var _0xa603=['DATE','NOW','moment','sequelize','exports','STRING','ENUM','account','queue'];(function(_0x32af57,_0x2c98ed){var _0x7a88c=function(_0x2115ba){while(--_0x2115ba){_0x32af57['push'](_0x32af57['shift']());}};_0x7a88c(++_0x2c98ed);}(_0xa603,0x1b2));var _0x3a60=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xa603[_0x19950b];return _0x3c6b41;};'use strict';var moment=require(_0x3a60('0x0'));var Sequelize=require(_0x3a60('0x1'));module[_0x3a60('0x2')]={'uniqueid':{'type':Sequelize[_0x3a60('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x3a60('0x4')](_0x3a60('0x5'),'agent',_0x3a60('0x6')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0x3a60('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x3a60('0x8')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index d0d4a99..796a0f8 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 _0x5935=['order','sort','where','merge','type','VIRTUAL','filter','options','count','include','findAll','rows','params','includeAll','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','set','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','FaxTransferReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit'];(function(_0x55188b,_0xe1ab94){var _0x4e427e=function(_0x110f7c){while(--_0x110f7c){_0x55188b['push'](_0x55188b['shift']());}};_0x4e427e(++_0xe1ab94);}(_0x5935,0xeb));var _0x5593=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x5935[_0x18ab2a];return _0x16dcee;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5593('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5593('0x1'));var jsonpatch=require(_0x5593('0x2'));var rp=require(_0x5593('0x3'));var moment=require(_0x5593('0x4'));var BPromise=require(_0x5593('0x5'));var Mustache=require(_0x5593('0x6'));var util=require('util');var path=require(_0x5593('0x7'));var sox=require(_0x5593('0x8'));var csv=require(_0x5593('0x9'));var ejs=require(_0x5593('0xa'));var fs=require('fs');var _=require(_0x5593('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5593('0xc'));var deskjs=require(_0x5593('0xd'));var toCsv=require(_0x5593('0x9'));var querystring=require(_0x5593('0xe'));var Papa=require(_0x5593('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5593('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5593('0x11'));var logger=require('../../config/logger')(_0x5593('0x12'));var utils=require(_0x5593('0x13'));var config=require(_0x5593('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18839d,_0x38fa4b){_0x38fa4b=_0x38fa4b||0xcc;return function(_0x2d5f91){if(_0x2d5f91){return _0x18839d[_0x5593('0x15')](_0x38fa4b);}return _0x18839d[_0x5593('0x16')](_0x38fa4b)[_0x5593('0x17')]();};}function respondWithResult(_0x5e8816,_0x1927f6){_0x1927f6=_0x1927f6||0xc8;return function(_0x546d73){if(_0x546d73){return _0x5e8816[_0x5593('0x16')](_0x1927f6)[_0x5593('0x18')](_0x546d73);}};}function respondWithFilteredResult(_0x541a34,_0x1f1d75){return function(_0x2b1c4b){if(_0x2b1c4b){var _0x589e58=_0x2b1c4b['count'],_0x2880f8=_0x1f1d75[_0x5593('0x19')],_0x1b1bc0=_0x1f1d75[_0x5593('0x19')]+_0x1f1d75[_0x5593('0x1a')],_0xfddc37;if(_0x1b1bc0>=_0x589e58){_0x1b1bc0=_0x589e58;_0xfddc37=0xc8;}else{_0xfddc37=0xce;}_0x541a34[_0x5593('0x16')](_0xfddc37);return _0x541a34[_0x5593('0x1b')]('Content-Range',_0x2880f8+'-'+_0x1b1bc0+'/'+_0x589e58)[_0x5593('0x18')](_0x2b1c4b);}return null;};}function patchUpdates(_0x20393f){return function(_0x46bafd){try{jsonpatch[_0x5593('0x1c')](_0x46bafd,_0x20393f,!![]);}catch(_0xde10b1){return BPromise[_0x5593('0x1d')](_0xde10b1);}return _0x46bafd[_0x5593('0x1e')]();};}function saveUpdates(_0x3ff2b6,_0x433a96){return function(_0x4a86bc){if(_0x4a86bc){return _0x4a86bc[_0x5593('0x1f')](_0x3ff2b6)['then'](function(_0x281a54){return _0x281a54;});}return null;};}function removeEntity(_0x419317,_0x258393){return function(_0x4e8f63){if(_0x4e8f63){return _0x4e8f63[_0x5593('0x20')]()[_0x5593('0x21')](function(){_0x419317[_0x5593('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c28dc,_0x40884f){return function(_0x2cd531){if(!_0x2cd531){_0x5c28dc['sendStatus'](0x194);}return _0x2cd531;};}function handleError(_0x2980cc,_0xf84426){_0xf84426=_0xf84426||0x1f4;return function(_0x5ea3f0){logger[_0x5593('0x22')](_0x5ea3f0[_0x5593('0x23')]);if(_0x5ea3f0[_0x5593('0x24')]){delete _0x5ea3f0[_0x5593('0x24')];}_0x2980cc[_0x5593('0x16')](_0xf84426)[_0x5593('0x25')](_0x5ea3f0);};}exports[_0x5593('0x26')]=function(_0x465857,_0x1b39d3){var _0x27e3db={},_0x197654={},_0x337ad4={'count':0x0,'rows':[]};var _0x458518=_[_0x5593('0x27')](db[_0x5593('0x28')][_0x5593('0x29')],function(_0x4a6631){return{'name':_0x4a6631[_0x5593('0x2a')],'type':_0x4a6631['type'][_0x5593('0x2b')]};});_0x197654[_0x5593('0x2c')]=_[_0x5593('0x27')](_0x458518,_0x5593('0x24'));_0x197654[_0x5593('0x2d')]=_[_0x5593('0x2e')](_0x465857[_0x5593('0x2d')]);_0x197654[_0x5593('0x2f')]=_[_0x5593('0x30')](_0x197654[_0x5593('0x2c')],_0x197654[_0x5593('0x2d')]);_0x27e3db[_0x5593('0x31')]=_[_0x5593('0x30')](_0x197654[_0x5593('0x2c')],qs[_0x5593('0x32')](_0x465857[_0x5593('0x2d')][_0x5593('0x32')]));_0x27e3db[_0x5593('0x31')]=_0x27e3db[_0x5593('0x31')][_0x5593('0x33')]?_0x27e3db[_0x5593('0x31')]:_0x197654[_0x5593('0x2c')];if(!_0x465857[_0x5593('0x2d')]['hasOwnProperty'](_0x5593('0x34'))){_0x27e3db[_0x5593('0x1a')]=qs[_0x5593('0x1a')](_0x465857[_0x5593('0x2d')][_0x5593('0x1a')]);_0x27e3db[_0x5593('0x19')]=qs[_0x5593('0x19')](_0x465857[_0x5593('0x2d')][_0x5593('0x19')]);}_0x27e3db[_0x5593('0x35')]=qs[_0x5593('0x36')](_0x465857[_0x5593('0x2d')][_0x5593('0x36')]);_0x27e3db['where']=qs[_0x5593('0x2f')](_['pick'](_0x465857[_0x5593('0x2d')],_0x197654[_0x5593('0x2f')]));if(_0x465857[_0x5593('0x2d')]['filter']){_0x27e3db[_0x5593('0x37')]=_[_0x5593('0x38')](_0x27e3db[_0x5593('0x37')],{'$or':_[_0x5593('0x27')](_0x458518,function(_0xe2225f){if(_0xe2225f[_0x5593('0x39')]!==_0x5593('0x3a')){var _0x50881d={};_0x50881d[_0xe2225f[_0x5593('0x24')]]={'$like':'%'+_0x465857['query'][_0x5593('0x3b')]+'%'};return _0x50881d;}})});}_0x27e3db=_[_0x5593('0x38')]({},_0x27e3db,_0x465857[_0x5593('0x3c')]);var _0x3b3984={'where':_0x27e3db[_0x5593('0x37')]};return db[_0x5593('0x28')][_0x5593('0x3d')](_0x3b3984)[_0x5593('0x21')](function(_0x28568d){_0x337ad4[_0x5593('0x3d')]=_0x28568d;if(_0x465857[_0x5593('0x2d')]['includeAll']){_0x27e3db[_0x5593('0x3e')]=[{'all':!![]}];}return db[_0x5593('0x28')][_0x5593('0x3f')](_0x27e3db);})[_0x5593('0x21')](function(_0x2bd5a0){_0x337ad4[_0x5593('0x40')]=_0x2bd5a0;return _0x337ad4;})[_0x5593('0x21')](respondWithFilteredResult(_0x1b39d3,_0x27e3db))['catch'](handleError(_0x1b39d3,null));};exports['show']=function(_0x16aeb1,_0x168a85){var _0x3d852f={'raw':!![],'where':{'id':_0x16aeb1[_0x5593('0x41')]['id']}},_0x6836df={};_0x6836df[_0x5593('0x2c')]=_[_0x5593('0x2e')](db[_0x5593('0x28')][_0x5593('0x29')]);_0x6836df[_0x5593('0x2d')]=_[_0x5593('0x2e')](_0x16aeb1[_0x5593('0x2d')]);_0x6836df[_0x5593('0x2f')]=_[_0x5593('0x30')](_0x6836df[_0x5593('0x2c')],_0x6836df[_0x5593('0x2d')]);_0x3d852f['attributes']=_[_0x5593('0x30')](_0x6836df[_0x5593('0x2c')],qs[_0x5593('0x32')](_0x16aeb1['query']['fields']));_0x3d852f[_0x5593('0x31')]=_0x3d852f[_0x5593('0x31')][_0x5593('0x33')]?_0x3d852f[_0x5593('0x31')]:_0x6836df['model'];if(_0x16aeb1[_0x5593('0x2d')][_0x5593('0x42')]){_0x3d852f['include']=[{'all':!![]}];}_0x3d852f=_[_0x5593('0x38')]({},_0x3d852f,_0x16aeb1['options']);return db[_0x5593('0x28')][_0x5593('0x43')](_0x3d852f)['then'](handleEntityNotFound(_0x168a85,null))['then'](respondWithResult(_0x168a85,null))[_0x5593('0x44')](handleError(_0x168a85,null));};exports['create']=function(_0x143e18,_0x1dea06){return db[_0x5593('0x28')][_0x5593('0x45')](_0x143e18[_0x5593('0x46')],{})[_0x5593('0x21')](respondWithResult(_0x1dea06,0xc9))[_0x5593('0x44')](handleError(_0x1dea06,null));};exports[_0x5593('0x1f')]=function(_0x3ec061,_0x42db43){if(_0x3ec061['body']['id']){delete _0x3ec061[_0x5593('0x46')]['id'];}return db[_0x5593('0x28')][_0x5593('0x43')]({'where':{'id':_0x3ec061[_0x5593('0x41')]['id']}})[_0x5593('0x21')](handleEntityNotFound(_0x42db43,null))[_0x5593('0x21')](saveUpdates(_0x3ec061[_0x5593('0x46')],null))[_0x5593('0x21')](respondWithResult(_0x42db43,null))[_0x5593('0x44')](handleError(_0x42db43,null));};exports[_0x5593('0x20')]=function(_0x55cd6e,_0x8b5d21){return db[_0x5593('0x28')][_0x5593('0x43')]({'where':{'id':_0x55cd6e[_0x5593('0x41')]['id']}})[_0x5593('0x21')](handleEntityNotFound(_0x8b5d21,null))[_0x5593('0x21')](removeEntity(_0x8b5d21,null))[_0x5593('0x44')](handleError(_0x8b5d21,null));};exports[_0x5593('0x47')]=function(_0x16d13b,_0x3e5b24){return db[_0x5593('0x28')][_0x5593('0x47')]()['then'](respondWithResult(_0x3e5b24,null))[_0x5593('0x44')](handleError(_0x3e5b24,null));}; \ No newline at end of file +var _0x061f=['reject','save','destroy','then','sendStatus','error','name','send','index','FaxTransferReport','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','catch','merge','find','create','update','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply'];(function(_0x39681d,_0x305788){var _0x424477=function(_0x1fc299){while(--_0x1fc299){_0x39681d['push'](_0x39681d['shift']());}};_0x424477(++_0x305788);}(_0x061f,0xbe));var _0xf061=function(_0x40c43e,_0x39b774){_0x40c43e=_0x40c43e-0x0;var _0x2daf17=_0x061f[_0x40c43e];return _0x2daf17;};'use strict';var pdf=require(_0xf061('0x0'));var emlformat=require(_0xf061('0x1'));var rimraf=require(_0xf061('0x2'));var zipdir=require(_0xf061('0x3'));var jsonpatch=require(_0xf061('0x4'));var rp=require('request-promise');var moment=require(_0xf061('0x5'));var BPromise=require(_0xf061('0x6'));var Mustache=require('mustache');var util=require(_0xf061('0x7'));var path=require(_0xf061('0x8'));var sox=require(_0xf061('0x9'));var csv=require(_0xf061('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf061('0xb'));var squel=require(_0xf061('0xc'));var crypto=require(_0xf061('0xd'));var jsforce=require(_0xf061('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf061('0xf'));var Redis=require('ioredis');var authService=require(_0xf061('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xf061('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf061('0x12'))(_0xf061('0x13'));var utils=require(_0xf061('0x14'));var config=require(_0xf061('0x15'));var db=require(_0xf061('0x16'))['db'];function respondWithStatusCode(_0x4f3e27,_0x2a881a){_0x2a881a=_0x2a881a||0xcc;return function(_0x2c1bb4){if(_0x2c1bb4){return _0x4f3e27['sendStatus'](_0x2a881a);}return _0x4f3e27[_0xf061('0x17')](_0x2a881a)[_0xf061('0x18')]();};}function respondWithResult(_0xf62013,_0x18ce50){_0x18ce50=_0x18ce50||0xc8;return function(_0x39e3ac){if(_0x39e3ac){return _0xf62013[_0xf061('0x17')](_0x18ce50)[_0xf061('0x19')](_0x39e3ac);}};}function respondWithFilteredResult(_0x266095,_0x2428ee){return function(_0x252432){if(_0x252432){var _0x30a2a5=_0x252432[_0xf061('0x1a')],_0x41df6b=_0x2428ee['offset'],_0xe41702=_0x2428ee[_0xf061('0x1b')]+_0x2428ee[_0xf061('0x1c')],_0x4829fe;if(_0xe41702>=_0x30a2a5){_0xe41702=_0x30a2a5;_0x4829fe=0xc8;}else{_0x4829fe=0xce;}_0x266095[_0xf061('0x17')](_0x4829fe);return _0x266095[_0xf061('0x1d')](_0xf061('0x1e'),_0x41df6b+'-'+_0xe41702+'/'+_0x30a2a5)[_0xf061('0x19')](_0x252432);}return null;};}function patchUpdates(_0x8a1c26){return function(_0x5751f1){try{jsonpatch[_0xf061('0x1f')](_0x5751f1,_0x8a1c26,!![]);}catch(_0x376f18){return BPromise[_0xf061('0x20')](_0x376f18);}return _0x5751f1[_0xf061('0x21')]();};}function saveUpdates(_0x4c2dcf,_0x130f7a){return function(_0x48b821){if(_0x48b821){return _0x48b821['update'](_0x4c2dcf)['then'](function(_0x7f7b8e){return _0x7f7b8e;});}return null;};}function removeEntity(_0xf72e57,_0x5c3ca1){return function(_0x1aa19c){if(_0x1aa19c){return _0x1aa19c[_0xf061('0x22')]()[_0xf061('0x23')](function(){_0xf72e57[_0xf061('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c0782,_0x42e81e){return function(_0x1bf0c1){if(!_0x1bf0c1){_0x3c0782[_0xf061('0x24')](0x194);}return _0x1bf0c1;};}function handleError(_0x16dbef,_0x2767a1){_0x2767a1=_0x2767a1||0x1f4;return function(_0x29f4eb){logger[_0xf061('0x25')](_0x29f4eb['stack']);if(_0x29f4eb[_0xf061('0x26')]){delete _0x29f4eb['name'];}_0x16dbef[_0xf061('0x17')](_0x2767a1)[_0xf061('0x27')](_0x29f4eb);};}exports[_0xf061('0x28')]=function(_0x2c32c4,_0x14c427){var _0x2711b9={},_0x29f59b={},_0x1b350c={'count':0x0,'rows':[]};var _0x368023=_['map'](db[_0xf061('0x29')][_0xf061('0x2a')],function(_0x160a16){return{'name':_0x160a16[_0xf061('0x2b')],'type':_0x160a16[_0xf061('0x2c')][_0xf061('0x2d')]};});_0x29f59b['model']=_[_0xf061('0x2e')](_0x368023,'name');_0x29f59b[_0xf061('0x2f')]=_[_0xf061('0x30')](_0x2c32c4[_0xf061('0x2f')]);_0x29f59b['filters']=_[_0xf061('0x31')](_0x29f59b[_0xf061('0x32')],_0x29f59b[_0xf061('0x2f')]);_0x2711b9[_0xf061('0x33')]=_[_0xf061('0x31')](_0x29f59b[_0xf061('0x32')],qs[_0xf061('0x34')](_0x2c32c4[_0xf061('0x2f')][_0xf061('0x34')]));_0x2711b9[_0xf061('0x33')]=_0x2711b9[_0xf061('0x33')][_0xf061('0x35')]?_0x2711b9[_0xf061('0x33')]:_0x29f59b[_0xf061('0x32')];if(!_0x2c32c4['query']['hasOwnProperty'](_0xf061('0x36'))){_0x2711b9['limit']=qs[_0xf061('0x1c')](_0x2c32c4[_0xf061('0x2f')][_0xf061('0x1c')]);_0x2711b9[_0xf061('0x1b')]=qs[_0xf061('0x1b')](_0x2c32c4['query'][_0xf061('0x1b')]);}_0x2711b9[_0xf061('0x37')]=qs['sort'](_0x2c32c4[_0xf061('0x2f')][_0xf061('0x38')]);_0x2711b9['where']=qs[_0xf061('0x39')](_[_0xf061('0x3a')](_0x2c32c4[_0xf061('0x2f')],_0x29f59b['filters']));if(_0x2c32c4[_0xf061('0x2f')][_0xf061('0x3b')]){_0x2711b9[_0xf061('0x3c')]=_['merge'](_0x2711b9[_0xf061('0x3c')],{'$or':_[_0xf061('0x2e')](_0x368023,function(_0x5da85c){if(_0x5da85c[_0xf061('0x2c')]!==_0xf061('0x3d')){var _0x189242={};_0x189242[_0x5da85c[_0xf061('0x26')]]={'$like':'%'+_0x2c32c4[_0xf061('0x2f')]['filter']+'%'};return _0x189242;}})});}_0x2711b9=_['merge']({},_0x2711b9,_0x2c32c4[_0xf061('0x3e')]);var _0x531943={'where':_0x2711b9['where']};return db[_0xf061('0x29')]['count'](_0x531943)['then'](function(_0x19901a){_0x1b350c[_0xf061('0x1a')]=_0x19901a;if(_0x2c32c4[_0xf061('0x2f')][_0xf061('0x3f')]){_0x2711b9[_0xf061('0x40')]=[{'all':!![]}];}return db['FaxTransferReport'][_0xf061('0x41')](_0x2711b9);})[_0xf061('0x23')](function(_0x50f6a0){_0x1b350c['rows']=_0x50f6a0;return _0x1b350c;})[_0xf061('0x23')](respondWithFilteredResult(_0x14c427,_0x2711b9))[_0xf061('0x42')](handleError(_0x14c427,null));};exports['show']=function(_0x26d447,_0x1db6f9){var _0x5e95ae={'raw':!![],'where':{'id':_0x26d447['params']['id']}},_0x45e683={};_0x45e683['model']=_[_0xf061('0x30')](db[_0xf061('0x29')]['rawAttributes']);_0x45e683[_0xf061('0x2f')]=_['keys'](_0x26d447[_0xf061('0x2f')]);_0x45e683[_0xf061('0x39')]=_[_0xf061('0x31')](_0x45e683[_0xf061('0x32')],_0x45e683['query']);_0x5e95ae['attributes']=_[_0xf061('0x31')](_0x45e683['model'],qs[_0xf061('0x34')](_0x26d447['query'][_0xf061('0x34')]));_0x5e95ae['attributes']=_0x5e95ae[_0xf061('0x33')]['length']?_0x5e95ae[_0xf061('0x33')]:_0x45e683[_0xf061('0x32')];if(_0x26d447[_0xf061('0x2f')][_0xf061('0x3f')]){_0x5e95ae[_0xf061('0x40')]=[{'all':!![]}];}_0x5e95ae=_[_0xf061('0x43')]({},_0x5e95ae,_0x26d447[_0xf061('0x3e')]);return db[_0xf061('0x29')][_0xf061('0x44')](_0x5e95ae)[_0xf061('0x23')](handleEntityNotFound(_0x1db6f9,null))[_0xf061('0x23')](respondWithResult(_0x1db6f9,null))[_0xf061('0x42')](handleError(_0x1db6f9,null));};exports[_0xf061('0x45')]=function(_0x4c2c88,_0x14dc1d){return db['FaxTransferReport'][_0xf061('0x45')](_0x4c2c88['body'],{})[_0xf061('0x23')](respondWithResult(_0x14dc1d,0xc9))[_0xf061('0x42')](handleError(_0x14dc1d,null));};exports[_0xf061('0x46')]=function(_0x279b0c,_0xcdd501){if(_0x279b0c['body']['id']){delete _0x279b0c[_0xf061('0x47')]['id'];}return db[_0xf061('0x29')][_0xf061('0x44')]({'where':{'id':_0x279b0c['params']['id']}})['then'](handleEntityNotFound(_0xcdd501,null))[_0xf061('0x23')](saveUpdates(_0x279b0c[_0xf061('0x47')],null))['then'](respondWithResult(_0xcdd501,null))[_0xf061('0x42')](handleError(_0xcdd501,null));};exports[_0xf061('0x22')]=function(_0x4eb316,_0x5ba1bc){return db[_0xf061('0x29')]['find']({'where':{'id':_0x4eb316[_0xf061('0x48')]['id']}})[_0xf061('0x23')](handleEntityNotFound(_0x5ba1bc,null))[_0xf061('0x23')](removeEntity(_0x5ba1bc,null))[_0xf061('0x42')](handleError(_0x5ba1bc,null));};exports[_0xf061('0x49')]=function(_0x22cc61,_0x544c18){return db['FaxTransferReport'][_0xf061('0x49')]()[_0xf061('0x23')](respondWithResult(_0x544c18,null))['catch'](handleError(_0x544c18,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index c38f6b4..e09dbed 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 _0x32e4=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash'];(function(_0x4095aa,_0x55abf7){var _0x5273f0=function(_0x5acb91){while(--_0x5acb91){_0x4095aa['push'](_0x4095aa['shift']());}};_0x5273f0(++_0x55abf7);}(_0x32e4,0x6f));var _0x432e=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x32e4[_0x273c39];return _0x46d6b5;};'use strict';var _=require(_0x432e('0x0'));var util=require('util');var logger=require(_0x432e('0x1'))(_0x432e('0x2'));var moment=require(_0x432e('0x3'));var BPromise=require(_0x432e('0x4'));var rp=require(_0x432e('0x5'));var fs=require('fs');var path=require(_0x432e('0x6'));var rimraf=require('rimraf');var config=require(_0x432e('0x7'));var attributes=require(_0x432e('0x8'));module[_0x432e('0x9')]=function(_0x2f76a2,_0x2dba10){return _0x2f76a2[_0x432e('0xa')](_0x432e('0xb'),attributes,{'tableName':_0x432e('0xc'),'paranoid':![],'indexes':[{'name':_0x432e('0xd'),'fields':[_0x432e('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2d81=['util','../../config/logger','bluebird','request-promise','path','rimraf','./faxTransferReport.attributes','exports','uniqueid'];(function(_0x2da78a,_0x2258df){var _0x558100=function(_0x32a789){while(--_0x32a789){_0x2da78a['push'](_0x2da78a['shift']());}};_0x558100(++_0x2258df);}(_0x2d81,0xcf));var _0x12d8=function(_0x44a306,_0x358f17){_0x44a306=_0x44a306-0x0;var _0xb3bc60=_0x2d81[_0x44a306];return _0xb3bc60;};'use strict';var _=require('lodash');var util=require(_0x12d8('0x0'));var logger=require(_0x12d8('0x1'))('api');var moment=require('moment');var BPromise=require(_0x12d8('0x2'));var rp=require(_0x12d8('0x3'));var fs=require('fs');var path=require(_0x12d8('0x4'));var rimraf=require(_0x12d8('0x5'));var config=require('../../config/environment');var attributes=require(_0x12d8('0x6'));module[_0x12d8('0x7')]=function(_0x1c769c,_0x12819a){return _0x1c769c['define']('FaxTransferReport',attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x12d8('0x8'),'fields':[_0x12d8('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 2176390..116126b 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 _0x235d=['message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3884b4,_0x4364f8){var _0x77882c=function(_0xbe3c31){while(--_0xbe3c31){_0x3884b4['push'](_0x3884b4['shift']());}};_0x77882c(++_0x4364f8);}(_0x235d,0x99));var _0xd235=function(_0x2c963d,_0x46d929){_0x2c963d=_0x2c963d-0x0;var _0x790a23=_0x235d[_0x2c963d];return _0x790a23;};'use strict';var _=require(_0xd235('0x0'));var util=require(_0xd235('0x1'));var moment=require(_0xd235('0x2'));var BPromise=require('bluebird');var rs=require(_0xd235('0x3'));var fs=require('fs');var Redis=require(_0xd235('0x4'));var db=require(_0xd235('0x5'))['db'];var utils=require(_0xd235('0x6'));var logger=require(_0xd235('0x7'))(_0xd235('0x8'));var config=require(_0xd235('0x9'));var jayson=require(_0xd235('0xa'));var client=jayson[_0xd235('0xb')][_0xd235('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1cd0de,_0x70419b,_0x5912f7){return new BPromise(function(_0x4ea952,_0x524d2d){return client[_0xd235('0xd')](_0x1cd0de,_0x5912f7)[_0xd235('0xe')](function(_0x3f10a1){logger[_0xd235('0xf')](_0xd235('0x10'),_0x70419b,_0xd235('0x11'));logger[_0xd235('0x12')](_0xd235('0x13'),_0x70419b,'request\x20sent',JSON[_0xd235('0x14')](_0x3f10a1));if(_0x3f10a1['error']){if(_0x3f10a1[_0xd235('0x15')]['code']===0x1f4){logger[_0xd235('0x15')](_0xd235('0x10'),_0x70419b,_0x3f10a1[_0xd235('0x15')][_0xd235('0x16')]);return _0x524d2d(_0x3f10a1[_0xd235('0x15')][_0xd235('0x16')]);}logger[_0xd235('0x15')](_0xd235('0x10'),_0x70419b,_0x3f10a1[_0xd235('0x15')]['message']);return _0x4ea952(_0x3f10a1['error'][_0xd235('0x16')]);}else{logger['info'](_0xd235('0x10'),_0x70419b,_0xd235('0x11'));_0x4ea952(_0x3f10a1[_0xd235('0x17')]['message']);}})[_0xd235('0x18')](function(_0x3949d6){logger['error'](_0xd235('0x10'),_0x70419b,_0x3949d6);_0x524d2d(_0x3949d6);});});} \ No newline at end of file +var _0x556a=['FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x556a,0x101));var _0xa556=function(_0x167dae,_0x5e0e0e){_0x167dae=_0x167dae-0x0;var _0x45fb6c=_0x556a[_0x167dae];return _0x45fb6c;};'use strict';var _=require(_0xa556('0x0'));var util=require(_0xa556('0x1'));var moment=require(_0xa556('0x2'));var BPromise=require(_0xa556('0x3'));var rs=require(_0xa556('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa556('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa556('0x6'))(_0xa556('0x7'));var config=require(_0xa556('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa556('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5930ed,_0x476685,_0x812be9){return new BPromise(function(_0x435cb7,_0x280b66){return client['request'](_0x5930ed,_0x812be9)['then'](function(_0x3cc9e4){logger[_0xa556('0xa')](_0xa556('0xb'),_0x476685,_0xa556('0xc'));logger['debug'](_0xa556('0xd'),_0x476685,_0xa556('0xc'),JSON[_0xa556('0xe')](_0x3cc9e4));if(_0x3cc9e4[_0xa556('0xf')]){if(_0x3cc9e4['error']['code']===0x1f4){logger[_0xa556('0xf')](_0xa556('0xb'),_0x476685,_0x3cc9e4['error'][_0xa556('0x10')]);return _0x280b66(_0x3cc9e4[_0xa556('0xf')][_0xa556('0x10')]);}logger[_0xa556('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0x476685,_0x3cc9e4['error'][_0xa556('0x10')]);return _0x435cb7(_0x3cc9e4[_0xa556('0xf')][_0xa556('0x10')]);}else{logger[_0xa556('0xa')]('FaxTransferReport,\x20%s,\x20%s',_0x476685,_0xa556('0xc'));_0x435cb7(_0x3cc9e4['result'][_0xa556('0x10')]);}})[_0xa556('0x11')](function(_0x32cf80){logger[_0xa556('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0x476685,_0x32cf80);_0x280b66(_0x32cf80);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 63fd491..c71be4a 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 _0x03f3=['Router','../../components/auth/service','../../components/interaction/service','./faxTransferReport.controller','isAuthenticated','index','get','describe','show','put','/:id','update','delete','exports','path','express'];(function(_0x3e48af,_0x37a1b2){var _0x1556d4=function(_0x3009a1){while(--_0x3009a1){_0x3e48af['push'](_0x3e48af['shift']());}};_0x1556d4(++_0x37a1b2);}(_0x03f3,0x7e));var _0x303f=function(_0x2e81f4,_0x44f46a){_0x2e81f4=_0x2e81f4-0x0;var _0x198f70=_0x03f3[_0x2e81f4];return _0x198f70;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x303f('0x0'));var timeout=require('connect-timeout');var express=require(_0x303f('0x1'));var router=express[_0x303f('0x2')]();var auth=require(_0x303f('0x3'));var interaction=require(_0x303f('0x4'));var config=require('../../config/environment');var controller=require(_0x303f('0x5'));router['get']('/',auth[_0x303f('0x6')](),controller[_0x303f('0x7')]);router[_0x303f('0x8')]('/describe',auth[_0x303f('0x6')](),controller[_0x303f('0x9')]);router[_0x303f('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x303f('0xa')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x303f('0xb')](_0x303f('0xc'),auth[_0x303f('0x6')](),controller[_0x303f('0xd')]);router[_0x303f('0xe')](_0x303f('0xc'),auth[_0x303f('0x6')](),controller['destroy']);module[_0x303f('0xf')]=router; \ No newline at end of file +var _0x69e4=['destroy','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','index','/describe','describe','/:id','isAuthenticated','show','create','update','delete'];(function(_0x2225f0,_0x55bb98){var _0x44270f=function(_0xdfba04){while(--_0xdfba04){_0x2225f0['push'](_0x2225f0['shift']());}};_0x44270f(++_0x55bb98);}(_0x69e4,0x121));var _0x469e=function(_0x271a95,_0x4d2a07){_0x271a95=_0x271a95-0x0;var _0x3fa489=_0x69e4[_0x271a95];return _0x3fa489;};'use strict';var multer=require(_0x469e('0x0'));var util=require(_0x469e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x469e('0x2'));var router=express['Router']();var auth=require(_0x469e('0x3'));var interaction=require(_0x469e('0x4'));var config=require(_0x469e('0x5'));var controller=require(_0x469e('0x6'));router[_0x469e('0x7')]('/',auth['isAuthenticated'](),controller[_0x469e('0x8')]);router[_0x469e('0x7')](_0x469e('0x9'),auth['isAuthenticated'](),controller[_0x469e('0xa')]);router[_0x469e('0x7')](_0x469e('0xb'),auth[_0x469e('0xc')](),controller[_0x469e('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x469e('0xe')]);router['put'](_0x469e('0xb'),auth[_0x469e('0xc')](),controller[_0x469e('0xf')]);router[_0x469e('0x10')](_0x469e('0xb'),auth[_0x469e('0xc')](),controller[_0x469e('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 4605e20..5eccc02 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 _0x5fc3=['get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intDeskAccount.controller'];(function(_0x11a6bd,_0x526e61){var _0x120525=function(_0x41617a){while(--_0x41617a){_0x11a6bd['push'](_0x11a6bd['shift']());}};_0x120525(++_0x526e61);}(_0x5fc3,0xa8));var _0x35fc=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0x5fc3[_0x397cfb];return _0x15fed9;};'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 auth=require(_0x35fc('0x5'));var interaction=require(_0x35fc('0x6'));var config=require('../../config/environment');var controller=require(_0x35fc('0x7'));router[_0x35fc('0x8')]('/',auth[_0x35fc('0x9')](),controller['index']);router['get'](_0x35fc('0xa'),auth['isAuthenticated'](),controller[_0x35fc('0xb')]);router[_0x35fc('0x8')](_0x35fc('0xc'),auth[_0x35fc('0x9')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x8')](_0x35fc('0xe'),auth['isAuthenticated'](),controller[_0x35fc('0xf')]);router[_0x35fc('0x10')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x11')]);router[_0x35fc('0x10')]('/:id/configurations',auth[_0x35fc('0x9')](),controller[_0x35fc('0x12')]);router['put']('/:id',auth[_0x35fc('0x9')](),controller['update']);router[_0x35fc('0x13')](_0x35fc('0xa'),auth[_0x35fc('0x9')](),controller[_0x35fc('0x14')]);module[_0x35fc('0x15')]=router; \ No newline at end of file +var _0x7d9f=['get','/:id','show','isAuthenticated','/:id/fields','post','create','addConfiguration','put','update','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller'];(function(_0x411e71,_0xf9652){var _0x226ae3=function(_0x1339f6){while(--_0x1339f6){_0x411e71['push'](_0x411e71['shift']());}};_0x226ae3(++_0xf9652);}(_0x7d9f,0x15c));var _0xf7d9=function(_0x4b4dd0,_0x4b7586){_0x4b4dd0=_0x4b4dd0-0x0;var _0x42da25=_0x7d9f[_0x4b4dd0];return _0x42da25;};'use strict';var multer=require(_0xf7d9('0x0'));var util=require(_0xf7d9('0x1'));var path=require(_0xf7d9('0x2'));var timeout=require(_0xf7d9('0x3'));var express=require(_0xf7d9('0x4'));var router=express['Router']();var auth=require(_0xf7d9('0x5'));var interaction=require(_0xf7d9('0x6'));var config=require(_0xf7d9('0x7'));var controller=require(_0xf7d9('0x8'));router[_0xf7d9('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf7d9('0x9')](_0xf7d9('0xa'),auth['isAuthenticated'](),controller[_0xf7d9('0xb')]);router[_0xf7d9('0x9')]('/:id/configurations',auth[_0xf7d9('0xc')](),controller['getConfigurations']);router[_0xf7d9('0x9')](_0xf7d9('0xd'),auth['isAuthenticated'](),controller['getFields']);router[_0xf7d9('0xe')]('/',auth[_0xf7d9('0xc')](),controller[_0xf7d9('0xf')]);router['post']('/:id/configurations',auth[_0xf7d9('0xc')](),controller[_0xf7d9('0x10')]);router[_0xf7d9('0x11')](_0xf7d9('0xa'),auth['isAuthenticated'](),controller[_0xf7d9('0x12')]);router[_0xf7d9('0x13')](_0xf7d9('0xa'),auth[_0xf7d9('0xc')](),controller['destroy']);module[_0xf7d9('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 83c4d6a..481ffd9 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 _0xa0a7=['exports','STRING','ENUM','basic','integrationTab','newTab'];(function(_0x2ff5c6,_0x248fe2){var _0x5605f2=function(_0xc4a69){while(--_0xc4a69){_0x2ff5c6['push'](_0x2ff5c6['shift']());}};_0x5605f2(++_0x248fe2);}(_0xa0a7,0xea));var _0x7a0a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa0a7[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module[_0x7a0a('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7a0a('0x1')]},'username':{'type':Sequelize[_0x7a0a('0x1')]},'remoteUri':{'type':Sequelize[_0x7a0a('0x1')]},'authType':{'type':Sequelize[_0x7a0a('0x2')](_0x7a0a('0x3')),'defaultValue':_0x7a0a('0x3')},'password':{'type':Sequelize[_0x7a0a('0x1')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0x7a0a('0x1')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0x7a0a('0x1')]},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x7a0a('0x2')](_0x7a0a('0x4'),_0x7a0a('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xd352=['ENUM','basic','integrationTab','exports','STRING'];(function(_0x572e0d,_0x1711cd){var _0x1c1e51=function(_0x5b8a8e){while(--_0x5b8a8e){_0x572e0d['push'](_0x572e0d['shift']());}};_0x1c1e51(++_0x1711cd);}(_0xd352,0x1b6));var _0x2d35=function(_0x1f7ce8,_0x10f80f){_0x1f7ce8=_0x1f7ce8-0x0;var _0x53b4fa=_0xd352[_0x1f7ce8];return _0x53b4fa;};'use strict';var Sequelize=require('sequelize');module[_0x2d35('0x0')]={'name':{'type':Sequelize[_0x2d35('0x1')]},'description':{'type':Sequelize[_0x2d35('0x1')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x2d35('0x1')]},'authType':{'type':Sequelize[_0x2d35('0x2')](_0x2d35('0x3')),'defaultValue':_0x2d35('0x3')},'password':{'type':Sequelize[_0x2d35('0x1')]},'consumerKey':{'type':Sequelize[_0x2d35('0x1')]},'consumerSecret':{'type':Sequelize[_0x2d35('0x1')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0x2d35('0x1')]},'serverUrl':{'type':Sequelize[_0x2d35('0x1')]},'type':{'type':Sequelize['ENUM'](_0x2d35('0x4'),'newTab'),'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 9251f25..9d407b0 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 _0x977d=['save','update','destroy','sendStatus','name','send','index','map','DeskAccount','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','options','includeAll','include','rows','show','params','find','create','body','findOne','DeskConfiguration','length','pick','getConfigurations','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','DeskField','getFields','priority','remoteUri','authType','username','password','consumerSecret','token','tokenSecret','slice','lastIndexOf','format','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','%s:%s','toString','base64','_embedded','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','html-pdf','eml-format','zip-dir','moment','bluebird','mustache','util','path','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','DeskAccount,\x20%s,\x20%s','debug','error','code','message','request\x20sent','result','catch','status','end','json','count','offset','limit','set','Content-Range','apply','reject'];(function(_0x49a6ea,_0x4b268d){var _0x4ea1bf=function(_0x42e1fd){while(--_0x42e1fd){_0x49a6ea['push'](_0x49a6ea['shift']());}};_0x4ea1bf(++_0x4b268d);}(_0x977d,0xc7));var _0xd977=function(_0x3b93bd,_0x208466){_0x3b93bd=_0x3b93bd-0x0;var _0x58e83e=_0x977d[_0x3b93bd];return _0x58e83e;};'use strict';var pdf=require(_0xd977('0x0'));var emlformat=require(_0xd977('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd977('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd977('0x3'));var BPromise=require(_0xd977('0x4'));var Mustache=require(_0xd977('0x5'));var util=require(_0xd977('0x6'));var path=require(_0xd977('0x7'));var sox=require('sox');var csv=require(_0xd977('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xd977('0x9'));var squel=require(_0xd977('0xa'));var crypto=require('crypto');var jsforce=require(_0xd977('0xb'));var deskjs=require(_0xd977('0xc'));var toCsv=require(_0xd977('0x8'));var querystring=require(_0xd977('0xd'));var Papa=require(_0xd977('0xe'));var Redis=require('ioredis');var authService=require(_0xd977('0xf'));var qs=require(_0xd977('0x10'));var as=require(_0xd977('0x11'));var hardwareService=require(_0xd977('0x12'));var logger=require(_0xd977('0x13'))(_0xd977('0x14'));var utils=require(_0xd977('0x15'));var config=require(_0xd977('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0xd977('0x17'));var jayson=require(_0xd977('0x18'));var client=jayson[_0xd977('0x19')][_0xd977('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x5d9e14,_0xa85470,_0x2dd4bf){if(_0x2dd4bf){var _0x274f50=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x274f50[_0xd977('0x1b')](_0xa85470)){return _0x5d9e14;}else{throw new db[(_0xd977('0x1c'))][(_0xd977('0x1d'))](_0xd977('0x1e'));}}else{return _0x5d9e14;}}function respondWithRpcPromise(_0x1fa7d3,_0x1a3ad7,_0x5a7ace,_0x274701){return new BPromise(function(_0x470bc6,_0x4f551a){var _0x24bb7d=_0x274701||client;return _0x24bb7d['request'](_0x1fa7d3,_0x5a7ace)[_0xd977('0x1f')](function(_0x203195){logger[_0xd977('0x20')](_0xd977('0x21'),_0x1a3ad7,'request\x20sent');logger[_0xd977('0x22')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x1a3ad7,'request\x20sent',JSON['stringify'](_0x203195));if(_0x203195[_0xd977('0x23')]){if(_0x203195[_0xd977('0x23')][_0xd977('0x24')]===0x1f4){logger[_0xd977('0x23')]('DeskAccount,\x20%s,\x20%s',_0x1a3ad7,_0x203195[_0xd977('0x23')]['message']);return _0x4f551a(_0x203195[_0xd977('0x23')][_0xd977('0x25')]);}logger['error'](_0xd977('0x21'),_0x1a3ad7,_0x203195[_0xd977('0x23')][_0xd977('0x25')]);return _0x470bc6(_0x203195[_0xd977('0x23')][_0xd977('0x25')]);}else{logger[_0xd977('0x20')]('DeskAccount,\x20%s,\x20%s',_0x1a3ad7,_0xd977('0x26'));_0x470bc6(_0x203195[_0xd977('0x27')][_0xd977('0x25')]);}})[_0xd977('0x28')](function(_0x152b65){logger[_0xd977('0x23')]('DeskAccount,\x20%s,\x20%s',_0x1a3ad7,_0x152b65);_0x4f551a(_0x152b65);});});}function respondWithStatusCode(_0x3039b3,_0x3e08ab){_0x3e08ab=_0x3e08ab||0xcc;return function(_0x2a2020){if(_0x2a2020){return _0x3039b3['sendStatus'](_0x3e08ab);}return _0x3039b3[_0xd977('0x29')](_0x3e08ab)[_0xd977('0x2a')]();};}function respondWithResult(_0x5649e2,_0x4ba53b){_0x4ba53b=_0x4ba53b||0xc8;return function(_0x3b896f){if(_0x3b896f){return _0x5649e2[_0xd977('0x29')](_0x4ba53b)[_0xd977('0x2b')](_0x3b896f);}};}function respondWithFilteredResult(_0x4e48be,_0x5422c9){return function(_0x379dde){if(_0x379dde){var _0xdce7db=_0x379dde[_0xd977('0x2c')],_0x5e7175=_0x5422c9[_0xd977('0x2d')],_0xd3db0=_0x5422c9[_0xd977('0x2d')]+_0x5422c9[_0xd977('0x2e')],_0x108767;if(_0xd3db0>=_0xdce7db){_0xd3db0=_0xdce7db;_0x108767=0xc8;}else{_0x108767=0xce;}_0x4e48be[_0xd977('0x29')](_0x108767);return _0x4e48be[_0xd977('0x2f')](_0xd977('0x30'),_0x5e7175+'-'+_0xd3db0+'/'+_0xdce7db)[_0xd977('0x2b')](_0x379dde);}return null;};}function patchUpdates(_0x1b86fd){return function(_0xaa63f5){try{jsonpatch[_0xd977('0x31')](_0xaa63f5,_0x1b86fd,!![]);}catch(_0x181cb9){return BPromise[_0xd977('0x32')](_0x181cb9);}return _0xaa63f5[_0xd977('0x33')]();};}function saveUpdates(_0x29b5cf,_0x1f6e84){return function(_0x2aa308){if(_0x2aa308){return _0x2aa308[_0xd977('0x34')](_0x29b5cf)[_0xd977('0x1f')](function(_0x1b7dbb){return _0x1b7dbb;});}return null;};}function removeEntity(_0xe4110,_0x3123ce){return function(_0xf5d2bc){if(_0xf5d2bc){return _0xf5d2bc[_0xd977('0x35')]()['then'](function(){_0xe4110[_0xd977('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c5543,_0x216124){return function(_0x2649c6){if(!_0x2649c6){_0x3c5543[_0xd977('0x36')](0x194);}return _0x2649c6;};}function handleError(_0x503ecc,_0x4a6dde){_0x4a6dde=_0x4a6dde||0x1f4;return function(_0x31e3a6){logger['error'](_0x31e3a6['stack']);if(_0x31e3a6[_0xd977('0x37')]){delete _0x31e3a6[_0xd977('0x37')];}_0x503ecc[_0xd977('0x29')](_0x4a6dde)[_0xd977('0x38')](_0x31e3a6);};}exports[_0xd977('0x39')]=function(_0x13a516,_0x5d9732){var _0x5bf51a={},_0x57a3c4={},_0x21c76f={'count':0x0,'rows':[]};var _0x535eae=_[_0xd977('0x3a')](db[_0xd977('0x3b')][_0xd977('0x3c')],function(_0x2dc8d7){return{'name':_0x2dc8d7[_0xd977('0x3d')],'type':_0x2dc8d7[_0xd977('0x3e')]['key']};});_0x57a3c4[_0xd977('0x3f')]=_[_0xd977('0x3a')](_0x535eae,_0xd977('0x37'));_0x57a3c4[_0xd977('0x40')]=_[_0xd977('0x41')](_0x13a516[_0xd977('0x40')]);_0x57a3c4[_0xd977('0x42')]=_['intersection'](_0x57a3c4[_0xd977('0x3f')],_0x57a3c4['query']);_0x5bf51a[_0xd977('0x43')]=_[_0xd977('0x44')](_0x57a3c4[_0xd977('0x3f')],qs[_0xd977('0x45')](_0x13a516[_0xd977('0x40')][_0xd977('0x45')]));_0x5bf51a['attributes']=_0x5bf51a[_0xd977('0x43')]['length']?_0x5bf51a[_0xd977('0x43')]:_0x57a3c4[_0xd977('0x3f')];if(!_0x13a516[_0xd977('0x40')][_0xd977('0x46')](_0xd977('0x47'))){_0x5bf51a['limit']=qs['limit'](_0x13a516[_0xd977('0x40')][_0xd977('0x2e')]);_0x5bf51a['offset']=qs[_0xd977('0x2d')](_0x13a516[_0xd977('0x40')][_0xd977('0x2d')]);}_0x5bf51a[_0xd977('0x48')]=qs[_0xd977('0x49')](_0x13a516[_0xd977('0x40')][_0xd977('0x49')]);_0x5bf51a[_0xd977('0x4a')]=qs[_0xd977('0x42')](_['pick'](_0x13a516['query'],_0x57a3c4['filters']));if(_0x13a516['query']['filter']){_0x5bf51a['where']=_['merge'](_0x5bf51a['where'],{'$or':_[_0xd977('0x3a')](_0x535eae,function(_0x2aa709){if(_0x2aa709[_0xd977('0x3e')]!==_0xd977('0x4b')){var _0x40b411={};_0x40b411[_0x2aa709['name']]={'$like':'%'+_0x13a516[_0xd977('0x40')][_0xd977('0x4c')]+'%'};return _0x40b411;}})});}_0x5bf51a=_[_0xd977('0x4d')]({},_0x5bf51a,_0x13a516[_0xd977('0x4e')]);var _0x528c27={'where':_0x5bf51a['where']};return db[_0xd977('0x3b')]['count'](_0x528c27)[_0xd977('0x1f')](function(_0x3ee6ae){_0x21c76f[_0xd977('0x2c')]=_0x3ee6ae;if(_0x13a516[_0xd977('0x40')][_0xd977('0x4f')]){_0x5bf51a[_0xd977('0x50')]=[{'all':!![]}];}return db[_0xd977('0x3b')]['findAll'](_0x5bf51a);})[_0xd977('0x1f')](function(_0x130fe8){_0x21c76f[_0xd977('0x51')]=_0x130fe8;return _0x21c76f;})[_0xd977('0x1f')](respondWithFilteredResult(_0x5d9732,_0x5bf51a))['catch'](handleError(_0x5d9732,null));};exports[_0xd977('0x52')]=function(_0x5ae650,_0x57528d){var _0x5c3cb5={'raw':![],'where':{'id':_0x5ae650[_0xd977('0x53')]['id']}},_0x3db283={};_0x3db283[_0xd977('0x3f')]=_[_0xd977('0x41')](db['DeskAccount']['rawAttributes']);_0x3db283[_0xd977('0x40')]=_[_0xd977('0x41')](_0x5ae650[_0xd977('0x40')]);_0x3db283[_0xd977('0x42')]=_[_0xd977('0x44')](_0x3db283[_0xd977('0x3f')],_0x3db283['query']);_0x5c3cb5[_0xd977('0x43')]=_[_0xd977('0x44')](_0x3db283[_0xd977('0x3f')],qs[_0xd977('0x45')](_0x5ae650[_0xd977('0x40')][_0xd977('0x45')]));_0x5c3cb5['attributes']=_0x5c3cb5['attributes']['length']?_0x5c3cb5[_0xd977('0x43')]:_0x3db283['model'];if(_0x5ae650['query'][_0xd977('0x4f')]){_0x5c3cb5[_0xd977('0x50')]=[{'all':!![]}];}_0x5c3cb5=_[_0xd977('0x4d')]({},_0x5c3cb5,_0x5ae650['options']);return db['DeskAccount'][_0xd977('0x54')](_0x5c3cb5)[_0xd977('0x1f')](handleEntityNotFound(_0x57528d,null))[_0xd977('0x1f')](respondWithResult(_0x57528d,null))[_0xd977('0x28')](handleError(_0x57528d,null));};exports['create']=function(_0x268990,_0x55f63e){return db['DeskAccount'][_0xd977('0x55')](_0x268990[_0xd977('0x56')],{})[_0xd977('0x1f')](respondWithResult(_0x55f63e,0xc9))['catch'](handleError(_0x55f63e,null));};exports[_0xd977('0x34')]=function(_0x50830c,_0xb833e0){if(_0x50830c[_0xd977('0x56')]['id']){delete _0x50830c[_0xd977('0x56')]['id'];}return db[_0xd977('0x3b')][_0xd977('0x54')]({'where':{'id':_0x50830c[_0xd977('0x53')]['id']}})[_0xd977('0x1f')](handleEntityNotFound(_0xb833e0,null))[_0xd977('0x1f')](saveUpdates(_0x50830c[_0xd977('0x56')],null))['then'](respondWithResult(_0xb833e0,null))[_0xd977('0x28')](handleError(_0xb833e0,null));};exports[_0xd977('0x35')]=function(_0x273fc4,_0x14e76d){return db[_0xd977('0x3b')][_0xd977('0x54')]({'where':{'id':_0x273fc4[_0xd977('0x53')]['id']}})[_0xd977('0x1f')](handleEntityNotFound(_0x14e76d,null))['then'](removeEntity(_0x14e76d,null))[_0xd977('0x28')](handleError(_0x14e76d,null));};exports['getConfigurations']=function(_0x5027c0,_0x25182e,_0x28f63e){var _0x1e70c7={};var _0x4840ee={};var _0x1b80d8;var _0x35f8ff;return db[_0xd977('0x3b')][_0xd977('0x57')]({'where':{'id':_0x5027c0[_0xd977('0x53')]['id']}})[_0xd977('0x1f')](handleEntityNotFound(_0x25182e,null))[_0xd977('0x1f')](function(_0x4b9c31){if(_0x4b9c31){_0x1b80d8=_0x4b9c31;_0x4840ee[_0xd977('0x3f')]=_['keys'](db[_0xd977('0x58')][_0xd977('0x3c')]);_0x4840ee[_0xd977('0x40')]=_[_0xd977('0x41')](_0x5027c0[_0xd977('0x40')]);_0x4840ee[_0xd977('0x42')]=_['intersection'](_0x4840ee[_0xd977('0x3f')],_0x4840ee[_0xd977('0x40')]);_0x1e70c7[_0xd977('0x43')]=_[_0xd977('0x44')](_0x4840ee[_0xd977('0x3f')],qs[_0xd977('0x45')](_0x5027c0[_0xd977('0x40')][_0xd977('0x45')]));_0x1e70c7[_0xd977('0x43')]=_0x1e70c7[_0xd977('0x43')][_0xd977('0x59')]?_0x1e70c7['attributes']:_0x4840ee[_0xd977('0x3f')];_0x1e70c7['order']=qs['sort'](_0x5027c0[_0xd977('0x40')][_0xd977('0x49')]);_0x1e70c7['where']=qs[_0xd977('0x42')](_[_0xd977('0x5a')](_0x5027c0['query'],_0x4840ee[_0xd977('0x42')]));if(_0x5027c0[_0xd977('0x40')][_0xd977('0x4c')]){_0x1e70c7['where']=_['merge'](_0x1e70c7[_0xd977('0x4a')],{'$or':_['map'](_0x1e70c7[_0xd977('0x43')],function(_0x4c1e74){var _0xd60d90={};_0xd60d90[_0x4c1e74]={'$like':'%'+_0x5027c0['query'][_0xd977('0x4c')]+'%'};return _0xd60d90;})});}_0x1e70c7=_[_0xd977('0x4d')]({},_0x1e70c7,_0x5027c0['options']);return _0x1b80d8[_0xd977('0x5b')](_0x1e70c7);}})['then'](function(_0x54cc88){if(_0x54cc88){_0x35f8ff=_0x54cc88[_0xd977('0x59')];if(!_0x5027c0[_0xd977('0x40')][_0xd977('0x46')](_0xd977('0x47'))){_0x1e70c7[_0xd977('0x2e')]=qs['limit'](_0x5027c0['query']['limit']);_0x1e70c7[_0xd977('0x2d')]=qs[_0xd977('0x2d')](_0x5027c0[_0xd977('0x40')][_0xd977('0x2d')]);}return _0x1b80d8[_0xd977('0x5b')](_0x1e70c7);}})[_0xd977('0x1f')](function(_0x3137a0){if(_0x3137a0){return _0x3137a0?{'count':_0x35f8ff,'rows':_0x3137a0}:null;}})[_0xd977('0x1f')](respondWithResult(_0x25182e,null))[_0xd977('0x28')](handleError(_0x25182e,null));};exports['addConfiguration']=function(_0x593f08,_0x4b9baa,_0x3dd9b9){if(_0x593f08[_0xd977('0x56')]['id']){delete _0x593f08[_0xd977('0x56')]['id'];}return db['DeskAccount'][_0xd977('0x57')]({'where':{'id':_0x593f08[_0xd977('0x53')]['id']}})['then'](handleEntityNotFound(_0x4b9baa,null))[_0xd977('0x1f')](function(_0x2e8429){if(_0x2e8429){_0x593f08['body'][_0xd977('0x5c')]=_0x2e8429['id'];_0x593f08['body'][_0xd977('0x5d')]=integrations[_0xd977('0x5e')](_0x593f08[_0xd977('0x56')]['channel'],_0x593f08[_0xd977('0x56')][_0xd977('0x3e')]);_0x593f08['body'][_0xd977('0x5f')]=integrations[_0xd977('0x60')](_0x593f08[_0xd977('0x56')][_0xd977('0x61')],_0x593f08['body'][_0xd977('0x3e')]);return db[_0xd977('0x58')][_0xd977('0x55')](_0x593f08[_0xd977('0x56')],{'include':[{'model':db[_0xd977('0x62')],'as':_0xd977('0x5d')},{'model':db[_0xd977('0x62')],'as':_0xd977('0x5f')}]});}return null;})[_0xd977('0x1f')](respondWithResult(_0x4b9baa,null))[_0xd977('0x28')](handleError(_0x4b9baa,null));};exports[_0xd977('0x63')]=function(_0x5cb4fa,_0x5928bd,_0x388bad){var _0x589146=[{'name':_0xd977('0x64'),'label':_0xd977('0x64'),'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 _0x5576dd='';return db[_0xd977('0x3b')][_0xd977('0x57')]({'where':{'id':_0x5cb4fa[_0xd977('0x53')]['id']},'attributes':['id',_0xd977('0x65'),_0xd977('0x66'),_0xd977('0x67'),_0xd977('0x68'),'consumerKey',_0xd977('0x69'),_0xd977('0x6a'),_0xd977('0x6b')]})[_0xd977('0x1f')](handleEntityNotFound(_0x5928bd,null))[_0xd977('0x1f')](function(_0x571126){if(_0x571126){_0x5576dd=_0x571126[_0xd977('0x65')];var _0x45bcbb=_0x5576dd[_0xd977('0x6c')](-0x1);if(_0x45bcbb==='/'){_0x5576dd=_0x5576dd['substring'](0x0,_0x5576dd[_0xd977('0x6d')](_0x45bcbb));}var _0x54c020={'method':'GET','uri':util[_0xd977('0x6e')](_0xd977('0x6f'),_0x5576dd),'headers':{'Content-Type':_0xd977('0x70'),'Accept':_0xd977('0x70')},'json':!![]};if(_0x571126[_0xd977('0x66')]===_0xd977('0x71')){_0x54c020[_0xd977('0x72')][_0xd977('0x73')]=util['format'](_0xd977('0x74'),new Buffer(util[_0xd977('0x6e')](_0xd977('0x75'),_0x571126[_0xd977('0x67')],_0x571126[_0xd977('0x68')]))[_0xd977('0x76')](_0xd977('0x77')));}return rp(_0x54c020)[_0xd977('0x1f')](function(_0x15a79c){return _0x589146['concat'](_['map'](_0x15a79c[_0xd977('0x78')]['entries'],function(_0x16fd96){return{'id':_0x16fd96[_0xd977('0x37')],'name':_0x16fd96[_0xd977('0x37')],'type':_0x16fd96['type'],'active':_0x16fd96['active'],'label':_0x16fd96['label'],'custom':!![]};}));});}})[_0xd977('0x1f')](function(_0x5720e0){return{'count':_0x5720e0[_0xd977('0x59')],'rows':_0x5720e0};})[_0xd977('0x1f')](respondWithResult(_0x5928bd,null))[_0xd977('0x28')](function(_0x11a820){var _0x5b5935=_0x5cb4fa[_0xd977('0x40')][_0xd977('0x1b')]?0x1f4:_0x11a820[_0xd977('0x79')]||0x1f4;logger['error'](_0xd977('0x7a'),_0xd977('0x63'),_0x5b5935,JSON[_0xd977('0x7b')](_0x11a820));delete _0x11a820[_0xd977('0x37')];if(_0x5b5935===0x191){_0x5b5935=0x190;}_0x5928bd[_0xd977('0x29')](_0x5b5935)[_0xd977('0x38')](_0x5cb4fa[_0xd977('0x40')][_0xd977('0x1b')]?{'message':_0xd977('0x7c'),'statusCode':_0x11a820['statusCode']}:_0x11a820);});}; \ No newline at end of file +var _0x397a=['catch','status','count','offset','Content-Range','json','apply','reject','save','update','end','sendStatus','name','send','map','DeskAccount','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','find','create','body','destroy','params','getConfigurations','findOne','DeskConfiguration','order','addConfiguration','AccountId','Subjects','Descriptions','channel','DeskField','getFields','priority','remoteUri','authType','consumerKey','consumerSecret','token','tokenSecret','slice','substring','GET','format','application/json','basic','headers','Basic\x20%s','%s:%s','username','password','_embedded','active','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','html-pdf','eml-format','rimraf','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','Sequelize','request','then','request\x20sent','debug','stringify','error','DeskAccount,\x20%s,\x20%s','message','info','result'];(function(_0x474715,_0x533133){var _0x41e4b5=function(_0x4153cf){while(--_0x4153cf){_0x474715['push'](_0x474715['shift']());}};_0x41e4b5(++_0x533133);}(_0x397a,0xc7));var _0xa397=function(_0x162086,_0x22bab3){_0x162086=_0x162086-0x0;var _0x17d85d=_0x397a[_0x162086];return _0x17d85d;};'use strict';var pdf=require(_0xa397('0x0'));var emlformat=require(_0xa397('0x1'));var rimraf=require(_0xa397('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa397('0x3'));var util=require(_0xa397('0x4'));var path=require(_0xa397('0x5'));var sox=require(_0xa397('0x6'));var csv=require(_0xa397('0x7'));var ejs=require(_0xa397('0x8'));var fs=require('fs');var _=require(_0xa397('0x9'));var squel=require(_0xa397('0xa'));var crypto=require('crypto');var jsforce=require(_0xa397('0xb'));var deskjs=require(_0xa397('0xc'));var toCsv=require(_0xa397('0x7'));var querystring=require(_0xa397('0xd'));var Papa=require(_0xa397('0xe'));var Redis=require(_0xa397('0xf'));var authService=require(_0xa397('0x10'));var qs=require(_0xa397('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa397('0x12'));var logger=require(_0xa397('0x13'))(_0xa397('0x14'));var utils=require(_0xa397('0x15'));var config=require(_0xa397('0x16'));var db=require(_0xa397('0x17'))['db'];var integrations=require(_0xa397('0x18'));var jayson=require(_0xa397('0x19'));var client=jayson[_0xa397('0x1a')][_0xa397('0x1b')]({'port':0x232a});function checkPasswordPattern(_0xada686,_0x3b9656,_0x3662c4){if(_0x3662c4){var _0xf1f697=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xf1f697['test'](_0x3b9656)){return _0xada686;}else{throw new db[(_0xa397('0x1c'))]['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~!@#$%^&-_=+[{]}.');}}else{return _0xada686;}}function respondWithRpcPromise(_0x799b11,_0x11ec19,_0x2575f1,_0x32f94c){return new BPromise(function(_0x2adca4,_0x4c16b0){var _0x306c9f=_0x32f94c||client;return _0x306c9f[_0xa397('0x1d')](_0x799b11,_0x2575f1)[_0xa397('0x1e')](function(_0x18b1e3){logger['info']('DeskAccount,\x20%s,\x20%s',_0x11ec19,_0xa397('0x1f'));logger[_0xa397('0x20')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x11ec19,_0xa397('0x1f'),JSON[_0xa397('0x21')](_0x18b1e3));if(_0x18b1e3[_0xa397('0x22')]){if(_0x18b1e3[_0xa397('0x22')]['code']===0x1f4){logger[_0xa397('0x22')](_0xa397('0x23'),_0x11ec19,_0x18b1e3['error'][_0xa397('0x24')]);return _0x4c16b0(_0x18b1e3[_0xa397('0x22')]['message']);}logger[_0xa397('0x22')](_0xa397('0x23'),_0x11ec19,_0x18b1e3[_0xa397('0x22')]['message']);return _0x2adca4(_0x18b1e3['error'][_0xa397('0x24')]);}else{logger[_0xa397('0x25')](_0xa397('0x23'),_0x11ec19,_0xa397('0x1f'));_0x2adca4(_0x18b1e3[_0xa397('0x26')][_0xa397('0x24')]);}})[_0xa397('0x27')](function(_0x4faacb){logger['error'](_0xa397('0x23'),_0x11ec19,_0x4faacb);_0x4c16b0(_0x4faacb);});});}function respondWithStatusCode(_0x11becd,_0x566bdb){_0x566bdb=_0x566bdb||0xcc;return function(_0x4f4dba){if(_0x4f4dba){return _0x11becd['sendStatus'](_0x566bdb);}return _0x11becd[_0xa397('0x28')](_0x566bdb)['end']();};}function respondWithResult(_0x28e89b,_0x462874){_0x462874=_0x462874||0xc8;return function(_0x166a8f){if(_0x166a8f){return _0x28e89b['status'](_0x462874)['json'](_0x166a8f);}};}function respondWithFilteredResult(_0x214566,_0x2644a7){return function(_0x2061ca){if(_0x2061ca){var _0x3511d4=_0x2061ca[_0xa397('0x29')],_0x592d53=_0x2644a7[_0xa397('0x2a')],_0x13a4d8=_0x2644a7['offset']+_0x2644a7['limit'],_0x5de0cf;if(_0x13a4d8>=_0x3511d4){_0x13a4d8=_0x3511d4;_0x5de0cf=0xc8;}else{_0x5de0cf=0xce;}_0x214566['status'](_0x5de0cf);return _0x214566['set'](_0xa397('0x2b'),_0x592d53+'-'+_0x13a4d8+'/'+_0x3511d4)[_0xa397('0x2c')](_0x2061ca);}return null;};}function patchUpdates(_0x43e915){return function(_0x43e864){try{jsonpatch[_0xa397('0x2d')](_0x43e864,_0x43e915,!![]);}catch(_0x23c026){return BPromise[_0xa397('0x2e')](_0x23c026);}return _0x43e864[_0xa397('0x2f')]();};}function saveUpdates(_0x469922,_0x5ebd7a){return function(_0x299eab){if(_0x299eab){return _0x299eab[_0xa397('0x30')](_0x469922)[_0xa397('0x1e')](function(_0x5bc5c8){return _0x5bc5c8;});}return null;};}function removeEntity(_0x56e614,_0x17b308){return function(_0x188094){if(_0x188094){return _0x188094['destroy']()[_0xa397('0x1e')](function(){_0x56e614['status'](0xcc)[_0xa397('0x31')]();});}};}function handleEntityNotFound(_0x1736c8,_0x1076c2){return function(_0x225e4e){if(!_0x225e4e){_0x1736c8[_0xa397('0x32')](0x194);}return _0x225e4e;};}function handleError(_0x2b167b,_0x16faf3){_0x16faf3=_0x16faf3||0x1f4;return function(_0x2e9c58){logger[_0xa397('0x22')](_0x2e9c58['stack']);if(_0x2e9c58[_0xa397('0x33')]){delete _0x2e9c58[_0xa397('0x33')];}_0x2b167b[_0xa397('0x28')](_0x16faf3)[_0xa397('0x34')](_0x2e9c58);};}exports['index']=function(_0x429758,_0x152fb5){var _0x4dd6a2={},_0x3c3e2d={},_0x4d63ff={'count':0x0,'rows':[]};var _0x2bce27=_[_0xa397('0x35')](db[_0xa397('0x36')][_0xa397('0x37')],function(_0x33e9bc){return{'name':_0x33e9bc['fieldName'],'type':_0x33e9bc[_0xa397('0x38')][_0xa397('0x39')]};});_0x3c3e2d[_0xa397('0x3a')]=_[_0xa397('0x35')](_0x2bce27,'name');_0x3c3e2d[_0xa397('0x3b')]=_[_0xa397('0x3c')](_0x429758[_0xa397('0x3b')]);_0x3c3e2d['filters']=_[_0xa397('0x3d')](_0x3c3e2d[_0xa397('0x3a')],_0x3c3e2d[_0xa397('0x3b')]);_0x4dd6a2[_0xa397('0x3e')]=_[_0xa397('0x3d')](_0x3c3e2d[_0xa397('0x3a')],qs[_0xa397('0x3f')](_0x429758[_0xa397('0x3b')][_0xa397('0x3f')]));_0x4dd6a2['attributes']=_0x4dd6a2[_0xa397('0x3e')][_0xa397('0x40')]?_0x4dd6a2[_0xa397('0x3e')]:_0x3c3e2d['model'];if(!_0x429758[_0xa397('0x3b')][_0xa397('0x41')](_0xa397('0x42'))){_0x4dd6a2[_0xa397('0x43')]=qs[_0xa397('0x43')](_0x429758[_0xa397('0x3b')][_0xa397('0x43')]);_0x4dd6a2[_0xa397('0x2a')]=qs[_0xa397('0x2a')](_0x429758[_0xa397('0x3b')][_0xa397('0x2a')]);}_0x4dd6a2['order']=qs[_0xa397('0x44')](_0x429758[_0xa397('0x3b')][_0xa397('0x44')]);_0x4dd6a2[_0xa397('0x45')]=qs[_0xa397('0x46')](_[_0xa397('0x47')](_0x429758[_0xa397('0x3b')],_0x3c3e2d['filters']));if(_0x429758['query'][_0xa397('0x48')]){_0x4dd6a2[_0xa397('0x45')]=_[_0xa397('0x49')](_0x4dd6a2[_0xa397('0x45')],{'$or':_[_0xa397('0x35')](_0x2bce27,function(_0x2a6342){if(_0x2a6342['type']!==_0xa397('0x4a')){var _0x1441df={};_0x1441df[_0x2a6342[_0xa397('0x33')]]={'$like':'%'+_0x429758['query'][_0xa397('0x48')]+'%'};return _0x1441df;}})});}_0x4dd6a2=_[_0xa397('0x49')]({},_0x4dd6a2,_0x429758[_0xa397('0x4b')]);var _0x287a50={'where':_0x4dd6a2[_0xa397('0x45')]};return db[_0xa397('0x36')]['count'](_0x287a50)[_0xa397('0x1e')](function(_0x2f133c){_0x4d63ff[_0xa397('0x29')]=_0x2f133c;if(_0x429758[_0xa397('0x3b')][_0xa397('0x4c')]){_0x4dd6a2[_0xa397('0x4d')]=[{'all':!![]}];}return db['DeskAccount'][_0xa397('0x4e')](_0x4dd6a2);})['then'](function(_0x28d8a0){_0x4d63ff['rows']=_0x28d8a0;return _0x4d63ff;})[_0xa397('0x1e')](respondWithFilteredResult(_0x152fb5,_0x4dd6a2))[_0xa397('0x27')](handleError(_0x152fb5,null));};exports[_0xa397('0x4f')]=function(_0x2b3387,_0x103685){var _0x2bd658={'raw':![],'where':{'id':_0x2b3387['params']['id']}},_0x1e5a10={};_0x1e5a10[_0xa397('0x3a')]=_[_0xa397('0x3c')](db['DeskAccount'][_0xa397('0x37')]);_0x1e5a10[_0xa397('0x3b')]=_['keys'](_0x2b3387[_0xa397('0x3b')]);_0x1e5a10[_0xa397('0x46')]=_[_0xa397('0x3d')](_0x1e5a10[_0xa397('0x3a')],_0x1e5a10[_0xa397('0x3b')]);_0x2bd658[_0xa397('0x3e')]=_['intersection'](_0x1e5a10[_0xa397('0x3a')],qs[_0xa397('0x3f')](_0x2b3387[_0xa397('0x3b')][_0xa397('0x3f')]));_0x2bd658['attributes']=_0x2bd658[_0xa397('0x3e')][_0xa397('0x40')]?_0x2bd658[_0xa397('0x3e')]:_0x1e5a10['model'];if(_0x2b3387[_0xa397('0x3b')][_0xa397('0x4c')]){_0x2bd658[_0xa397('0x4d')]=[{'all':!![]}];}_0x2bd658=_['merge']({},_0x2bd658,_0x2b3387[_0xa397('0x4b')]);return db[_0xa397('0x36')][_0xa397('0x50')](_0x2bd658)[_0xa397('0x1e')](handleEntityNotFound(_0x103685,null))[_0xa397('0x1e')](respondWithResult(_0x103685,null))[_0xa397('0x27')](handleError(_0x103685,null));};exports[_0xa397('0x51')]=function(_0xa896e1,_0x303c51){return db['DeskAccount']['create'](_0xa896e1[_0xa397('0x52')],{})[_0xa397('0x1e')](respondWithResult(_0x303c51,0xc9))[_0xa397('0x27')](handleError(_0x303c51,null));};exports[_0xa397('0x30')]=function(_0x225294,_0x3e7cc7){if(_0x225294[_0xa397('0x52')]['id']){delete _0x225294['body']['id'];}return db[_0xa397('0x36')][_0xa397('0x50')]({'where':{'id':_0x225294['params']['id']}})[_0xa397('0x1e')](handleEntityNotFound(_0x3e7cc7,null))[_0xa397('0x1e')](saveUpdates(_0x225294[_0xa397('0x52')],null))[_0xa397('0x1e')](respondWithResult(_0x3e7cc7,null))[_0xa397('0x27')](handleError(_0x3e7cc7,null));};exports[_0xa397('0x53')]=function(_0x4ccded,_0x2b640d){return db['DeskAccount']['find']({'where':{'id':_0x4ccded[_0xa397('0x54')]['id']}})[_0xa397('0x1e')](handleEntityNotFound(_0x2b640d,null))[_0xa397('0x1e')](removeEntity(_0x2b640d,null))[_0xa397('0x27')](handleError(_0x2b640d,null));};exports[_0xa397('0x55')]=function(_0x5aadaf,_0x55512a,_0x292a68){var _0x14ac56={};var _0x4080a5={};var _0xae0417;var _0x3ccb76;return db[_0xa397('0x36')][_0xa397('0x56')]({'where':{'id':_0x5aadaf[_0xa397('0x54')]['id']}})[_0xa397('0x1e')](handleEntityNotFound(_0x55512a,null))[_0xa397('0x1e')](function(_0x5c4dfb){if(_0x5c4dfb){_0xae0417=_0x5c4dfb;_0x4080a5[_0xa397('0x3a')]=_['keys'](db[_0xa397('0x57')]['rawAttributes']);_0x4080a5[_0xa397('0x3b')]=_[_0xa397('0x3c')](_0x5aadaf[_0xa397('0x3b')]);_0x4080a5[_0xa397('0x46')]=_[_0xa397('0x3d')](_0x4080a5[_0xa397('0x3a')],_0x4080a5[_0xa397('0x3b')]);_0x14ac56[_0xa397('0x3e')]=_['intersection'](_0x4080a5[_0xa397('0x3a')],qs[_0xa397('0x3f')](_0x5aadaf['query'][_0xa397('0x3f')]));_0x14ac56['attributes']=_0x14ac56[_0xa397('0x3e')]['length']?_0x14ac56['attributes']:_0x4080a5['model'];_0x14ac56[_0xa397('0x58')]=qs[_0xa397('0x44')](_0x5aadaf[_0xa397('0x3b')]['sort']);_0x14ac56['where']=qs[_0xa397('0x46')](_[_0xa397('0x47')](_0x5aadaf['query'],_0x4080a5['filters']));if(_0x5aadaf[_0xa397('0x3b')][_0xa397('0x48')]){_0x14ac56[_0xa397('0x45')]=_[_0xa397('0x49')](_0x14ac56[_0xa397('0x45')],{'$or':_[_0xa397('0x35')](_0x14ac56[_0xa397('0x3e')],function(_0x2e9dc7){var _0x3d0086={};_0x3d0086[_0x2e9dc7]={'$like':'%'+_0x5aadaf[_0xa397('0x3b')][_0xa397('0x48')]+'%'};return _0x3d0086;})});}_0x14ac56=_[_0xa397('0x49')]({},_0x14ac56,_0x5aadaf[_0xa397('0x4b')]);return _0xae0417[_0xa397('0x55')](_0x14ac56);}})[_0xa397('0x1e')](function(_0x399818){if(_0x399818){_0x3ccb76=_0x399818[_0xa397('0x40')];if(!_0x5aadaf[_0xa397('0x3b')][_0xa397('0x41')](_0xa397('0x42'))){_0x14ac56[_0xa397('0x43')]=qs[_0xa397('0x43')](_0x5aadaf['query'][_0xa397('0x43')]);_0x14ac56[_0xa397('0x2a')]=qs[_0xa397('0x2a')](_0x5aadaf[_0xa397('0x3b')][_0xa397('0x2a')]);}return _0xae0417[_0xa397('0x55')](_0x14ac56);}})['then'](function(_0x10b488){if(_0x10b488){return _0x10b488?{'count':_0x3ccb76,'rows':_0x10b488}:null;}})[_0xa397('0x1e')](respondWithResult(_0x55512a,null))[_0xa397('0x27')](handleError(_0x55512a,null));};exports[_0xa397('0x59')]=function(_0x213072,_0x11d91f,_0x383d2e){if(_0x213072[_0xa397('0x52')]['id']){delete _0x213072[_0xa397('0x52')]['id'];}return db[_0xa397('0x36')][_0xa397('0x56')]({'where':{'id':_0x213072[_0xa397('0x54')]['id']}})[_0xa397('0x1e')](handleEntityNotFound(_0x11d91f,null))['then'](function(_0x380a33){if(_0x380a33){_0x213072[_0xa397('0x52')][_0xa397('0x5a')]=_0x380a33['id'];_0x213072[_0xa397('0x52')][_0xa397('0x5b')]=integrations['getSubjects'](_0x213072[_0xa397('0x52')]['channel'],_0x213072['body'][_0xa397('0x38')]);_0x213072[_0xa397('0x52')][_0xa397('0x5c')]=integrations['getDescriptions'](_0x213072[_0xa397('0x52')][_0xa397('0x5d')],_0x213072['body'][_0xa397('0x38')]);return db[_0xa397('0x57')][_0xa397('0x51')](_0x213072[_0xa397('0x52')],{'include':[{'model':db[_0xa397('0x5e')],'as':_0xa397('0x5b')},{'model':db[_0xa397('0x5e')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x11d91f,null))[_0xa397('0x27')](handleError(_0x11d91f,null));};exports[_0xa397('0x5f')]=function(_0x385c22,_0x517a8d,_0x4432f8){var _0x507ec8=[{'name':_0xa397('0x60'),'label':_0xa397('0x60'),'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 _0x557485='';return db[_0xa397('0x36')][_0xa397('0x56')]({'where':{'id':_0x385c22[_0xa397('0x54')]['id']},'attributes':['id',_0xa397('0x61'),_0xa397('0x62'),'username','password',_0xa397('0x63'),_0xa397('0x64'),_0xa397('0x65'),_0xa397('0x66')]})[_0xa397('0x1e')](handleEntityNotFound(_0x517a8d,null))[_0xa397('0x1e')](function(_0xba121b){if(_0xba121b){_0x557485=_0xba121b[_0xa397('0x61')];var _0x35d58d=_0x557485[_0xa397('0x67')](-0x1);if(_0x35d58d==='/'){_0x557485=_0x557485[_0xa397('0x68')](0x0,_0x557485['lastIndexOf'](_0x35d58d));}var _0xf48319={'method':_0xa397('0x69'),'uri':util[_0xa397('0x6a')]('%s/custom_fields',_0x557485),'headers':{'Content-Type':_0xa397('0x6b'),'Accept':_0xa397('0x6b')},'json':!![]};if(_0xba121b[_0xa397('0x62')]===_0xa397('0x6c')){_0xf48319[_0xa397('0x6d')]['Authorization']=util['format'](_0xa397('0x6e'),new Buffer(util[_0xa397('0x6a')](_0xa397('0x6f'),_0xba121b[_0xa397('0x70')],_0xba121b[_0xa397('0x71')]))['toString']('base64'));}return rp(_0xf48319)[_0xa397('0x1e')](function(_0x39e68d){return _0x507ec8['concat'](_[_0xa397('0x35')](_0x39e68d[_0xa397('0x72')]['entries'],function(_0x4a711d){return{'id':_0x4a711d['name'],'name':_0x4a711d[_0xa397('0x33')],'type':_0x4a711d['type'],'active':_0x4a711d[_0xa397('0x73')],'label':_0x4a711d[_0xa397('0x74')],'custom':!![]};}));});}})[_0xa397('0x1e')](function(_0x878fe2){return{'count':_0x878fe2[_0xa397('0x40')],'rows':_0x878fe2};})[_0xa397('0x1e')](respondWithResult(_0x517a8d,null))[_0xa397('0x27')](function(_0x35cf43){var _0x167a1a=_0x385c22['query']['test']?0x1f4:_0x35cf43[_0xa397('0x75')]||0x1f4;logger[_0xa397('0x22')](_0xa397('0x76'),_0xa397('0x5f'),_0x167a1a,JSON[_0xa397('0x21')](_0x35cf43));delete _0x35cf43[_0xa397('0x33')];if(_0x167a1a===0x191){_0x167a1a=0x190;}_0x517a8d[_0xa397('0x28')](_0x167a1a)['send'](_0x385c22[_0xa397('0x3b')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x35cf43[_0xa397('0x75')]}:_0x35cf43);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 847993f..fda5e64 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 _0xf9e2=['./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x5b3e67,_0x234179){var _0x87ed59=function(_0x40776b){while(--_0x40776b){_0x5b3e67['push'](_0x5b3e67['shift']());}};_0x87ed59(++_0x234179);}(_0xf9e2,0x1c0));var _0x2f9e=function(_0x24350e,_0x362358){_0x24350e=_0x24350e-0x0;var _0x53ea7c=_0xf9e2[_0x24350e];return _0x53ea7c;};'use strict';var _=require(_0x2f9e('0x0'));var util=require(_0x2f9e('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2f9e('0x2'));var BPromise=require(_0x2f9e('0x3'));var rp=require(_0x2f9e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2f9e('0x5'));var config=require(_0x2f9e('0x6'));var attributes=require(_0x2f9e('0x7'));var integrations=require(_0x2f9e('0x8'));module[_0x2f9e('0x9')]=function(_0x1a582f,_0xd87b7a){return _0x1a582f[_0x2f9e('0xa')](_0x2f9e('0xb'),attributes,{'tableName':_0x2f9e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcd28=['lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','define','DeskAccount','int_desk_accounts'];(function(_0x59e203,_0x11054a){var _0x5e6692=function(_0x1c3a16){while(--_0x1c3a16){_0x59e203['push'](_0x59e203['shift']());}};_0x5e6692(++_0x11054a);}(_0xcd28,0x1c7));var _0x8cd2=function(_0x191f33,_0x4dc1f4){_0x191f33=_0x191f33-0x0;var _0x453311=_0xcd28[_0x191f33];return _0x453311;};'use strict';var _=require(_0x8cd2('0x0'));var util=require(_0x8cd2('0x1'));var logger=require(_0x8cd2('0x2'))(_0x8cd2('0x3'));var moment=require('moment');var BPromise=require(_0x8cd2('0x4'));var rp=require(_0x8cd2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8cd2('0x6'));var config=require(_0x8cd2('0x7'));var attributes=require(_0x8cd2('0x8'));var integrations=require(_0x8cd2('0x9'));module['exports']=function(_0x4be221,_0x4e711e){return _0x4be221[_0x8cd2('0xa')](_0x8cd2('0xb'),attributes,{'tableName':_0x8cd2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index 1df885e..3bbf940 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 _0x77f2=['options','raw','where','limit','include','model','attributes','map','info','GetDeskAccount','ShowDeskAccount','find','catch','lodash','util','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','DeskAccount','findAll'];(function(_0x21a354,_0x298ad9){var _0x35bc98=function(_0xcf3583){while(--_0xcf3583){_0x21a354['push'](_0x21a354['shift']());}};_0x35bc98(++_0x298ad9);}(_0x77f2,0x199));var _0x277f=function(_0x21e79a,_0x5a7990){_0x21e79a=_0x21e79a-0x0;var _0x506c02=_0x77f2[_0x21e79a];return _0x506c02;};'use strict';var _=require(_0x277f('0x0'));var util=require(_0x277f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x277f('0x2'))['db'];var utils=require(_0x277f('0x3'));var logger=require(_0x277f('0x4'))(_0x277f('0x5'));var config=require(_0x277f('0x6'));var jayson=require(_0x277f('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x226109,_0x117ac9,_0x1912d1){return new BPromise(function(_0x1302cb,_0x5df1c9){return client['request'](_0x226109,_0x1912d1)[_0x277f('0x8')](function(_0x3445b4){logger['info'](_0x277f('0x9'),_0x117ac9,_0x277f('0xa'));logger[_0x277f('0xb')](_0x277f('0xc'),_0x117ac9,_0x277f('0xa'),JSON[_0x277f('0xd')](_0x3445b4));if(_0x3445b4['error']){if(_0x3445b4[_0x277f('0xe')][_0x277f('0xf')]===0x1f4){logger[_0x277f('0xe')](_0x277f('0x9'),_0x117ac9,_0x3445b4[_0x277f('0xe')][_0x277f('0x10')]);return _0x5df1c9(_0x3445b4[_0x277f('0xe')][_0x277f('0x10')]);}logger[_0x277f('0xe')](_0x277f('0x9'),_0x117ac9,_0x3445b4[_0x277f('0xe')][_0x277f('0x10')]);return _0x1302cb(_0x3445b4[_0x277f('0xe')][_0x277f('0x10')]);}else{logger['info']('DeskAccount,\x20%s,\x20%s',_0x117ac9,_0x277f('0xa'));_0x1302cb(_0x3445b4[_0x277f('0x11')][_0x277f('0x10')]);}})['catch'](function(_0x5dc8aa){logger[_0x277f('0xe')](_0x277f('0x9'),_0x117ac9,_0x5dc8aa);_0x5df1c9(_0x5dc8aa);});});}exports['GetDeskAccount']=function(_0x49063c){var _0x20bcfa=this;return new Promise(function(_0x554701,_0x5aa209){return db[_0x277f('0x12')][_0x277f('0x13')]({'raw':_0x49063c[_0x277f('0x14')]?_0x49063c[_0x277f('0x14')][_0x277f('0x15')]===undefined?!![]:![]:!![],'where':_0x49063c[_0x277f('0x14')]?_0x49063c[_0x277f('0x14')][_0x277f('0x16')]||null:null,'attributes':_0x49063c['options']?_0x49063c['options']['attributes']||null:null,'limit':_0x49063c[_0x277f('0x14')]?_0x49063c[_0x277f('0x14')][_0x277f('0x17')]||null:null,'include':_0x49063c['options']?_0x49063c['options'][_0x277f('0x18')]?_['map'](_0x49063c[_0x277f('0x14')][_0x277f('0x18')],function(_0x3c8018){return{'model':db[_0x3c8018['model']],'as':_0x3c8018['as'],'attributes':_0x3c8018['attributes'],'include':_0x3c8018['include']?_['map'](_0x3c8018[_0x277f('0x18')],function(_0x57bc2b){return{'model':db[_0x57bc2b[_0x277f('0x19')]],'as':_0x57bc2b['as'],'attributes':_0x57bc2b[_0x277f('0x1a')],'include':_0x57bc2b[_0x277f('0x18')]?_[_0x277f('0x1b')](_0x57bc2b['include'],function(_0xd1821e){return{'model':db[_0xd1821e['model']],'as':_0xd1821e['as'],'attributes':_0xd1821e[_0x277f('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x277f('0x8')](function(_0x520d94){logger[_0x277f('0x1c')]('GetDeskAccount',_0x49063c);logger['debug'](_0x277f('0x1d'),_0x49063c,JSON['stringify'](_0x520d94));_0x554701(_0x520d94);})['catch'](function(_0x1676d4){logger[_0x277f('0xe')](_0x277f('0x1d'),_0x1676d4[_0x277f('0x10')],_0x49063c);_0x5aa209(_0x20bcfa[_0x277f('0xe')](0x1f4,_0x1676d4[_0x277f('0x10')]));});});};exports[_0x277f('0x1e')]=function(_0x5a72e7){var _0xcf2637=this;return new Promise(function(_0x35b4b8,_0x1acc3b){return db[_0x277f('0x12')][_0x277f('0x1f')]({'raw':_0x5a72e7[_0x277f('0x14')]?_0x5a72e7[_0x277f('0x14')][_0x277f('0x15')]===undefined?!![]:![]:!![],'where':_0x5a72e7['options']?_0x5a72e7[_0x277f('0x14')][_0x277f('0x16')]||null:null,'attributes':_0x5a72e7[_0x277f('0x14')]?_0x5a72e7[_0x277f('0x14')][_0x277f('0x1a')]||null:null,'include':_0x5a72e7['options']?_0x5a72e7[_0x277f('0x14')][_0x277f('0x18')]?_[_0x277f('0x1b')](_0x5a72e7['options'][_0x277f('0x18')],function(_0x1b962f){return{'model':db[_0x1b962f[_0x277f('0x19')]],'as':_0x1b962f['as'],'attributes':_0x1b962f[_0x277f('0x1a')],'include':_0x1b962f[_0x277f('0x18')]?_[_0x277f('0x1b')](_0x1b962f['include'],function(_0x2bb2f7){return{'model':db[_0x2bb2f7[_0x277f('0x19')]],'as':_0x2bb2f7['as'],'attributes':_0x2bb2f7['attributes'],'include':_0x2bb2f7[_0x277f('0x18')]?_[_0x277f('0x1b')](_0x2bb2f7['include'],function(_0x20a22c){return{'model':db[_0x20a22c['model']],'as':_0x20a22c['as'],'attributes':_0x20a22c['attributes']};}):[]};}):[]};}):[]:[]})[_0x277f('0x8')](function(_0x30f15e){logger[_0x277f('0x1c')](_0x277f('0x1e'),_0x5a72e7);logger[_0x277f('0xb')]('ShowDeskAccount',_0x5a72e7,JSON[_0x277f('0xd')](_0x30f15e));_0x35b4b8(_0x30f15e);})[_0x277f('0x20')](function(_0x1b4300){logger[_0x277f('0xe')]('ShowDeskAccount',_0x1b4300[_0x277f('0x10')],_0x5a72e7);_0x1acc3b(_0xcf2637['error'](0x1f4,_0x1b4300[_0x277f('0x10')]));});});}; \ No newline at end of file +var _0x70d5=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','findAll','options','raw','attributes','limit','include','map','model','GetDeskAccount','debug','ShowDeskAccount','DeskAccount','find','where','moment','bluebird','randomstring','ioredis'];(function(_0x1ecdc3,_0x3095e1){var _0x3af46c=function(_0x1cc793){while(--_0x1cc793){_0x1ecdc3['push'](_0x1ecdc3['shift']());}};_0x3af46c(++_0x3095e1);}(_0x70d5,0x1f4));var _0x570d=function(_0x2a8860,_0x2da926){_0x2a8860=_0x2a8860-0x0;var _0x2f47a4=_0x70d5[_0x2a8860];return _0x2f47a4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x570d('0x0'));var BPromise=require(_0x570d('0x1'));var rs=require(_0x570d('0x2'));var fs=require('fs');var Redis=require(_0x570d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x570d('0x4'));var logger=require(_0x570d('0x5'))(_0x570d('0x6'));var config=require(_0x570d('0x7'));var jayson=require(_0x570d('0x8'));var client=jayson[_0x570d('0x9')][_0x570d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5586f8,_0x523e62,_0x4e7f03){return new BPromise(function(_0x4209ef,_0x3c051b){return client[_0x570d('0xb')](_0x5586f8,_0x4e7f03)[_0x570d('0xc')](function(_0x90e89f){logger[_0x570d('0xd')](_0x570d('0xe'),_0x523e62,_0x570d('0xf'));logger['debug'](_0x570d('0x10'),_0x523e62,_0x570d('0xf'),JSON[_0x570d('0x11')](_0x90e89f));if(_0x90e89f['error']){if(_0x90e89f[_0x570d('0x12')]['code']===0x1f4){logger[_0x570d('0x12')](_0x570d('0xe'),_0x523e62,_0x90e89f[_0x570d('0x12')][_0x570d('0x13')]);return _0x3c051b(_0x90e89f[_0x570d('0x12')][_0x570d('0x13')]);}logger[_0x570d('0x12')]('DeskAccount,\x20%s,\x20%s',_0x523e62,_0x90e89f[_0x570d('0x12')][_0x570d('0x13')]);return _0x4209ef(_0x90e89f[_0x570d('0x12')][_0x570d('0x13')]);}else{logger[_0x570d('0xd')](_0x570d('0xe'),_0x523e62,'request\x20sent');_0x4209ef(_0x90e89f[_0x570d('0x14')][_0x570d('0x13')]);}})[_0x570d('0x15')](function(_0x513d16){logger[_0x570d('0x12')](_0x570d('0xe'),_0x523e62,_0x513d16);_0x3c051b(_0x513d16);});});}exports['GetDeskAccount']=function(_0x3ce873){var _0x1b174e=this;return new Promise(function(_0x27d31c,_0x59987b){return db['DeskAccount'][_0x570d('0x16')]({'raw':_0x3ce873[_0x570d('0x17')]?_0x3ce873['options'][_0x570d('0x18')]===undefined?!![]:![]:!![],'where':_0x3ce873[_0x570d('0x17')]?_0x3ce873[_0x570d('0x17')]['where']||null:null,'attributes':_0x3ce873[_0x570d('0x17')]?_0x3ce873[_0x570d('0x17')][_0x570d('0x19')]||null:null,'limit':_0x3ce873[_0x570d('0x17')]?_0x3ce873[_0x570d('0x17')][_0x570d('0x1a')]||null:null,'include':_0x3ce873[_0x570d('0x17')]?_0x3ce873[_0x570d('0x17')][_0x570d('0x1b')]?_[_0x570d('0x1c')](_0x3ce873['options']['include'],function(_0x29a1cf){return{'model':db[_0x29a1cf[_0x570d('0x1d')]],'as':_0x29a1cf['as'],'attributes':_0x29a1cf[_0x570d('0x19')],'include':_0x29a1cf[_0x570d('0x1b')]?_[_0x570d('0x1c')](_0x29a1cf[_0x570d('0x1b')],function(_0x4aa331){return{'model':db[_0x4aa331['model']],'as':_0x4aa331['as'],'attributes':_0x4aa331[_0x570d('0x19')],'include':_0x4aa331['include']?_[_0x570d('0x1c')](_0x4aa331[_0x570d('0x1b')],function(_0x10b157){return{'model':db[_0x10b157[_0x570d('0x1d')]],'as':_0x10b157['as'],'attributes':_0x10b157[_0x570d('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1d8acb){logger[_0x570d('0xd')](_0x570d('0x1e'),_0x3ce873);logger[_0x570d('0x1f')](_0x570d('0x1e'),_0x3ce873,JSON[_0x570d('0x11')](_0x1d8acb));_0x27d31c(_0x1d8acb);})['catch'](function(_0x5c0815){logger[_0x570d('0x12')](_0x570d('0x1e'),_0x5c0815[_0x570d('0x13')],_0x3ce873);_0x59987b(_0x1b174e[_0x570d('0x12')](0x1f4,_0x5c0815['message']));});});};exports[_0x570d('0x20')]=function(_0xb26a07){var _0xba3e70=this;return new Promise(function(_0x2aa19f,_0x2df113){return db[_0x570d('0x21')][_0x570d('0x22')]({'raw':_0xb26a07[_0x570d('0x17')]?_0xb26a07[_0x570d('0x17')][_0x570d('0x18')]===undefined?!![]:![]:!![],'where':_0xb26a07[_0x570d('0x17')]?_0xb26a07[_0x570d('0x17')][_0x570d('0x23')]||null:null,'attributes':_0xb26a07[_0x570d('0x17')]?_0xb26a07[_0x570d('0x17')][_0x570d('0x19')]||null:null,'include':_0xb26a07['options']?_0xb26a07['options'][_0x570d('0x1b')]?_[_0x570d('0x1c')](_0xb26a07[_0x570d('0x17')]['include'],function(_0x324c25){return{'model':db[_0x324c25[_0x570d('0x1d')]],'as':_0x324c25['as'],'attributes':_0x324c25[_0x570d('0x19')],'include':_0x324c25[_0x570d('0x1b')]?_['map'](_0x324c25['include'],function(_0x27c2af){return{'model':db[_0x27c2af['model']],'as':_0x27c2af['as'],'attributes':_0x27c2af['attributes'],'include':_0x27c2af[_0x570d('0x1b')]?_[_0x570d('0x1c')](_0x27c2af[_0x570d('0x1b')],function(_0x14c39f){return{'model':db[_0x14c39f[_0x570d('0x1d')]],'as':_0x14c39f['as'],'attributes':_0x14c39f[_0x570d('0x19')]};}):[]};}):[]};}):[]:[]})[_0x570d('0xc')](function(_0x1d9e05){logger[_0x570d('0xd')](_0x570d('0x20'),_0xb26a07);logger[_0x570d('0x1f')]('ShowDeskAccount',_0xb26a07,JSON['stringify'](_0x1d9e05));_0x2aa19f(_0x1d9e05);})[_0x570d('0x15')](function(_0xc58469){logger[_0x570d('0x12')]('ShowDeskAccount',_0xc58469[_0x570d('0x13')],_0xb26a07);_0x2df113(_0xba3e70['error'](0x1f4,_0xc58469[_0x570d('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 10e076a..0844ebc 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 _0xc1c6=['post','setTags','put','/:id','update','delete','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags'];(function(_0x2f643d,_0x588451){var _0x2410af=function(_0x241ef1){while(--_0x241ef1){_0x2f643d['push'](_0x2f643d['shift']());}};_0x2410af(++_0x588451);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x3fa0d1,_0x2f96d2){_0x3fa0d1=_0x3fa0d1-0x0;var _0x2464a9=_0xc1c6[_0x3fa0d1];return _0x2464a9;};'use strict';var multer=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var path=require(_0x6c1c('0x2'));var timeout=require('connect-timeout');var express=require(_0x6c1c('0x3'));var router=express['Router']();var auth=require(_0x6c1c('0x4'));var interaction=require(_0x6c1c('0x5'));var config=require(_0x6c1c('0x6'));var controller=require('./intDeskConfiguration.controller');router['get']('/',auth[_0x6c1c('0x7')](),controller['index']);router[_0x6c1c('0x8')]('/:id',auth[_0x6c1c('0x7')](),controller[_0x6c1c('0x9')]);router[_0x6c1c('0x8')](_0x6c1c('0xa'),auth['isAuthenticated'](),controller[_0x6c1c('0xb')]);router[_0x6c1c('0x8')]('/:id/subjects',auth[_0x6c1c('0x7')](),controller[_0x6c1c('0xc')]);router[_0x6c1c('0x8')](_0x6c1c('0xd'),auth['isAuthenticated'](),controller[_0x6c1c('0xe')]);router[_0x6c1c('0x8')](_0x6c1c('0xf'),auth['isAuthenticated'](),controller[_0x6c1c('0x10')]);router[_0x6c1c('0x11')]('/',auth[_0x6c1c('0x7')](),controller['create']);router[_0x6c1c('0x11')]('/:id/tags',auth[_0x6c1c('0x7')](),controller[_0x6c1c('0x12')]);router[_0x6c1c('0x13')](_0x6c1c('0x14'),auth[_0x6c1c('0x7')](),controller[_0x6c1c('0x15')]);router[_0x6c1c('0x16')](_0x6c1c('0x14'),auth[_0x6c1c('0x7')](),controller['destroy']);module[_0x6c1c('0x17')]=router; \ No newline at end of file +var _0x7b84=['../../components/interaction/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','getTags','create','post','/:id/tags','update','delete','destroy','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x448bab,_0x25517b){var _0x5dc534=function(_0x2196ba){while(--_0x2196ba){_0x448bab['push'](_0x448bab['shift']());}};_0x5dc534(++_0x25517b);}(_0x7b84,0x167));var _0x47b8=function(_0x543d07,_0x7cc989){_0x543d07=_0x543d07-0x0;var _0x3a48a0=_0x7b84[_0x543d07];return _0x3a48a0;};'use strict';var multer=require(_0x47b8('0x0'));var util=require(_0x47b8('0x1'));var path=require(_0x47b8('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x47b8('0x3')]();var auth=require(_0x47b8('0x4'));var interaction=require(_0x47b8('0x5'));var config=require(_0x47b8('0x6'));var controller=require(_0x47b8('0x7'));router[_0x47b8('0x8')]('/',auth[_0x47b8('0x9')](),controller[_0x47b8('0xa')]);router[_0x47b8('0x8')](_0x47b8('0xb'),auth[_0x47b8('0x9')](),controller[_0x47b8('0xc')]);router[_0x47b8('0x8')](_0x47b8('0xd'),auth[_0x47b8('0x9')](),controller[_0x47b8('0xe')]);router[_0x47b8('0x8')](_0x47b8('0xf'),auth[_0x47b8('0x9')](),controller['getSubjects']);router['get'](_0x47b8('0x10'),auth[_0x47b8('0x9')](),controller[_0x47b8('0x11')]);router[_0x47b8('0x8')]('/:id/tags',auth[_0x47b8('0x9')](),controller[_0x47b8('0x12')]);router['post']('/',auth[_0x47b8('0x9')](),controller[_0x47b8('0x13')]);router[_0x47b8('0x14')](_0x47b8('0x15'),auth[_0x47b8('0x9')](),controller['setTags']);router['put'](_0x47b8('0xb'),auth['isAuthenticated'](),controller[_0x47b8('0x16')]);router[_0x47b8('0x17')](_0x47b8('0xb'),auth[_0x47b8('0x9')](),controller[_0x47b8('0x18')]);module[_0x47b8('0x19')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 8b0c6d0..13095d5 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 _0x3b2b=['exports','STRING'];(function(_0x3b84a8,_0xd456ed){var _0x2c020d=function(_0x46b9e3){while(--_0x46b9e3){_0x3b84a8['push'](_0x3b84a8['shift']());}};_0x2c020d(++_0xd456ed);}(_0x3b2b,0x132));var _0xb3b2=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x3b2b[_0x30ae5e];return _0x1f2e93;};'use strict';var Sequelize=require('sequelize');module[_0xb3b2('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb3b2('0x1')]}}; \ No newline at end of file +var _0x184a=['STRING','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x184a,0xfd));var _0xa184=function(_0x58866a,_0x192c67){_0x58866a=_0x58866a-0x0;var _0x4bdfaf=_0x184a[_0x58866a];return _0x4bdfaf;};'use strict';var Sequelize=require(_0xa184('0x0'));module[_0xa184('0x1')]={'name':{'type':Sequelize[_0xa184('0x2')]},'description':{'type':Sequelize[_0xa184('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 4d147e8..ad72afd 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 _0x6e61=['sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','DeskConfiguration,\x20%s,\x20%s','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','destroy','then','stack','name','send','index','map','type','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','filter','where','VIRTUAL','merge','options','DeskConfiguration','count','includeAll','include','findAll','show','params','rawAttributes','find','create','update','body','getFields','findOne','DeskField','pick','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','setTags','ids','html-pdf','rimraf','request-promise','mustache','util'];(function(_0x47aa12,_0x5d00aa){var _0x5f1eb2=function(_0x4c8464){while(--_0x4c8464){_0x47aa12['push'](_0x47aa12['shift']());}};_0x5f1eb2(++_0x5d00aa);}(_0x6e61,0x1db));var _0x16e6=function(_0x16b33f,_0x1e933f){_0x16b33f=_0x16b33f-0x0;var _0x27c5e0=_0x6e61[_0x16b33f];return _0x27c5e0;};'use strict';var pdf=require(_0x16e6('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x16e6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x16e6('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x16e6('0x3'));var util=require(_0x16e6('0x4'));var path=require('path');var sox=require(_0x16e6('0x5'));var csv=require(_0x16e6('0x6'));var ejs=require(_0x16e6('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x16e6('0x8'));var crypto=require(_0x16e6('0x9'));var jsforce=require(_0x16e6('0xa'));var deskjs=require(_0x16e6('0xb'));var toCsv=require(_0x16e6('0x6'));var querystring=require(_0x16e6('0xc'));var Papa=require(_0x16e6('0xd'));var Redis=require(_0x16e6('0xe'));var authService=require(_0x16e6('0xf'));var qs=require(_0x16e6('0x10'));var as=require(_0x16e6('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x16e6('0x12'))(_0x16e6('0x13'));var utils=require(_0x16e6('0x14'));var config=require(_0x16e6('0x15'));var db=require('../../mysqldb')['db'];var jayson=require(_0x16e6('0x16'));var client=jayson['client'][_0x16e6('0x17')]({'port':0x232a});function checkPasswordPattern(_0x44a825,_0x516c7a,_0x48e23c){if(_0x48e23c){var _0x208691=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x208691['test'](_0x516c7a)){return _0x44a825;}else{throw new db[(_0x16e6('0x18'))][(_0x16e6('0x19'))](_0x16e6('0x1a'));}}else{return _0x44a825;}}function respondWithRpcPromise(_0x5046ff,_0x37f7f2,_0x5e6375,_0x43c6e7){return new BPromise(function(_0x28c3fc,_0x4778e9){var _0x975e7c=_0x43c6e7||client;return _0x975e7c[_0x16e6('0x1b')](_0x5046ff,_0x5e6375)['then'](function(_0x3cce99){logger[_0x16e6('0x1c')](_0x16e6('0x1d'),_0x37f7f2,'request\x20sent');logger[_0x16e6('0x1e')](_0x16e6('0x1f'),_0x37f7f2,_0x16e6('0x20'),JSON[_0x16e6('0x21')](_0x3cce99));if(_0x3cce99['error']){if(_0x3cce99[_0x16e6('0x22')][_0x16e6('0x23')]===0x1f4){logger['error'](_0x16e6('0x1d'),_0x37f7f2,_0x3cce99['error'][_0x16e6('0x24')]);return _0x4778e9(_0x3cce99[_0x16e6('0x22')][_0x16e6('0x24')]);}logger[_0x16e6('0x22')]('DeskConfiguration,\x20%s,\x20%s',_0x37f7f2,_0x3cce99[_0x16e6('0x22')][_0x16e6('0x24')]);return _0x28c3fc(_0x3cce99[_0x16e6('0x22')][_0x16e6('0x24')]);}else{logger[_0x16e6('0x1c')](_0x16e6('0x1d'),_0x37f7f2,'request\x20sent');_0x28c3fc(_0x3cce99[_0x16e6('0x25')][_0x16e6('0x24')]);}})[_0x16e6('0x26')](function(_0x717ea2){logger['error'](_0x16e6('0x1d'),_0x37f7f2,_0x717ea2);_0x4778e9(_0x717ea2);});});}function respondWithStatusCode(_0x13ef28,_0x1a4b91){_0x1a4b91=_0x1a4b91||0xcc;return function(_0x2a32aa){if(_0x2a32aa){return _0x13ef28[_0x16e6('0x27')](_0x1a4b91);}return _0x13ef28[_0x16e6('0x28')](_0x1a4b91)[_0x16e6('0x29')]();};}function respondWithResult(_0x42d3c4,_0x6e38c){_0x6e38c=_0x6e38c||0xc8;return function(_0x11cece){if(_0x11cece){return _0x42d3c4['status'](_0x6e38c)[_0x16e6('0x2a')](_0x11cece);}};}function respondWithFilteredResult(_0x330045,_0x31d2f3){return function(_0x392abf){if(_0x392abf){var _0x5ea3a9=_0x392abf['count'],_0x5f332b=_0x31d2f3[_0x16e6('0x2b')],_0x420b06=_0x31d2f3[_0x16e6('0x2b')]+_0x31d2f3[_0x16e6('0x2c')],_0x147a61;if(_0x420b06>=_0x5ea3a9){_0x420b06=_0x5ea3a9;_0x147a61=0xc8;}else{_0x147a61=0xce;}_0x330045['status'](_0x147a61);return _0x330045['set'](_0x16e6('0x2d'),_0x5f332b+'-'+_0x420b06+'/'+_0x5ea3a9)[_0x16e6('0x2a')](_0x392abf);}return null;};}function patchUpdates(_0x4ef9ac){return function(_0x1a2464){try{jsonpatch[_0x16e6('0x2e')](_0x1a2464,_0x4ef9ac,!![]);}catch(_0x5005cc){return BPromise[_0x16e6('0x2f')](_0x5005cc);}return _0x1a2464['save']();};}function saveUpdates(_0x106944,_0x1a26eb){return function(_0xfba1c2){if(_0xfba1c2){return _0xfba1c2['update'](_0x106944)['then'](function(_0x42f8b5){return _0x42f8b5;});}return null;};}function removeEntity(_0x5d0d35,_0x451a2e){return function(_0x4bf0f9){if(_0x4bf0f9){return _0x4bf0f9[_0x16e6('0x30')]()[_0x16e6('0x31')](function(){_0x5d0d35['status'](0xcc)[_0x16e6('0x29')]();});}};}function handleEntityNotFound(_0x2d47e2,_0x3e7370){return function(_0x2b507e){if(!_0x2b507e){_0x2d47e2[_0x16e6('0x27')](0x194);}return _0x2b507e;};}function handleError(_0x3acd65,_0x634ab9){_0x634ab9=_0x634ab9||0x1f4;return function(_0x82db2f){logger[_0x16e6('0x22')](_0x82db2f[_0x16e6('0x32')]);if(_0x82db2f[_0x16e6('0x33')]){delete _0x82db2f[_0x16e6('0x33')];}_0x3acd65[_0x16e6('0x28')](_0x634ab9)[_0x16e6('0x34')](_0x82db2f);};}exports[_0x16e6('0x35')]=function(_0x246c21,_0x2a4e27){var _0x4b1817={},_0x4d2495={},_0x45180e={'count':0x0,'rows':[]};var _0x4abaab=_[_0x16e6('0x36')](db['DeskConfiguration']['rawAttributes'],function(_0x3be42f){return{'name':_0x3be42f['fieldName'],'type':_0x3be42f[_0x16e6('0x37')][_0x16e6('0x38')]};});_0x4d2495['model']=_[_0x16e6('0x36')](_0x4abaab,_0x16e6('0x33'));_0x4d2495[_0x16e6('0x39')]=_[_0x16e6('0x3a')](_0x246c21[_0x16e6('0x39')]);_0x4d2495[_0x16e6('0x3b')]=_[_0x16e6('0x3c')](_0x4d2495[_0x16e6('0x3d')],_0x4d2495[_0x16e6('0x39')]);_0x4b1817['attributes']=_[_0x16e6('0x3c')](_0x4d2495[_0x16e6('0x3d')],qs[_0x16e6('0x3e')](_0x246c21['query'][_0x16e6('0x3e')]));_0x4b1817[_0x16e6('0x3f')]=_0x4b1817[_0x16e6('0x3f')][_0x16e6('0x40')]?_0x4b1817['attributes']:_0x4d2495['model'];if(!_0x246c21['query']['hasOwnProperty'](_0x16e6('0x41'))){_0x4b1817['limit']=qs[_0x16e6('0x2c')](_0x246c21[_0x16e6('0x39')][_0x16e6('0x2c')]);_0x4b1817['offset']=qs[_0x16e6('0x2b')](_0x246c21[_0x16e6('0x39')][_0x16e6('0x2b')]);}_0x4b1817[_0x16e6('0x42')]=qs[_0x16e6('0x43')](_0x246c21[_0x16e6('0x39')][_0x16e6('0x43')]);_0x4b1817['where']=qs['filters'](_['pick'](_0x246c21[_0x16e6('0x39')],_0x4d2495[_0x16e6('0x3b')]));if(_0x246c21[_0x16e6('0x39')][_0x16e6('0x44')]){_0x4b1817[_0x16e6('0x45')]=_['merge'](_0x4b1817[_0x16e6('0x45')],{'$or':_[_0x16e6('0x36')](_0x4abaab,function(_0x159583){if(_0x159583[_0x16e6('0x37')]!==_0x16e6('0x46')){var _0x5400ee={};_0x5400ee[_0x159583['name']]={'$like':'%'+_0x246c21[_0x16e6('0x39')][_0x16e6('0x44')]+'%'};return _0x5400ee;}})});}_0x4b1817=_[_0x16e6('0x47')]({},_0x4b1817,_0x246c21[_0x16e6('0x48')]);var _0x7a2a3={'where':_0x4b1817[_0x16e6('0x45')]};return db[_0x16e6('0x49')][_0x16e6('0x4a')](_0x7a2a3)['then'](function(_0x443e43){_0x45180e[_0x16e6('0x4a')]=_0x443e43;if(_0x246c21['query'][_0x16e6('0x4b')]){_0x4b1817[_0x16e6('0x4c')]=[{'all':!![]}];}return db[_0x16e6('0x49')][_0x16e6('0x4d')](_0x4b1817);})[_0x16e6('0x31')](function(_0x227256){_0x45180e['rows']=_0x227256;return _0x45180e;})['then'](respondWithFilteredResult(_0x2a4e27,_0x4b1817))[_0x16e6('0x26')](handleError(_0x2a4e27,null));};exports[_0x16e6('0x4e')]=function(_0x59413c,_0x29a41a){var _0x3f3241={'raw':![],'where':{'id':_0x59413c[_0x16e6('0x4f')]['id']}},_0x2dd19f={};_0x2dd19f[_0x16e6('0x3d')]=_['keys'](db[_0x16e6('0x49')][_0x16e6('0x50')]);_0x2dd19f['query']=_['keys'](_0x59413c[_0x16e6('0x39')]);_0x2dd19f[_0x16e6('0x3b')]=_[_0x16e6('0x3c')](_0x2dd19f[_0x16e6('0x3d')],_0x2dd19f[_0x16e6('0x39')]);_0x3f3241[_0x16e6('0x3f')]=_['intersection'](_0x2dd19f[_0x16e6('0x3d')],qs['fields'](_0x59413c['query'][_0x16e6('0x3e')]));_0x3f3241[_0x16e6('0x3f')]=_0x3f3241['attributes']['length']?_0x3f3241[_0x16e6('0x3f')]:_0x2dd19f[_0x16e6('0x3d')];if(_0x59413c[_0x16e6('0x39')]['includeAll']){_0x3f3241[_0x16e6('0x4c')]=[{'all':!![]}];}_0x3f3241=_[_0x16e6('0x47')]({},_0x3f3241,_0x59413c[_0x16e6('0x48')]);return db[_0x16e6('0x49')][_0x16e6('0x51')](_0x3f3241)[_0x16e6('0x31')](handleEntityNotFound(_0x29a41a,null))[_0x16e6('0x31')](respondWithResult(_0x29a41a,null))[_0x16e6('0x26')](handleError(_0x29a41a,null));};exports[_0x16e6('0x52')]=function(_0x305de1,_0x57961c){return db[_0x16e6('0x49')]['create'](_0x305de1['body'],{})[_0x16e6('0x31')](respondWithResult(_0x57961c,0xc9))[_0x16e6('0x26')](handleError(_0x57961c,null));};exports[_0x16e6('0x53')]=function(_0x3528d9,_0x2f204f){if(_0x3528d9[_0x16e6('0x54')]['id']){delete _0x3528d9[_0x16e6('0x54')]['id'];}return db[_0x16e6('0x49')][_0x16e6('0x51')]({'where':{'id':_0x3528d9[_0x16e6('0x4f')]['id']}})[_0x16e6('0x31')](handleEntityNotFound(_0x2f204f,null))[_0x16e6('0x31')](saveUpdates(_0x3528d9[_0x16e6('0x54')],null))['then'](respondWithResult(_0x2f204f,null))[_0x16e6('0x26')](handleError(_0x2f204f,null));};exports[_0x16e6('0x30')]=function(_0x43cc58,_0x34c2c7){return db[_0x16e6('0x49')][_0x16e6('0x51')]({'where':{'id':_0x43cc58[_0x16e6('0x4f')]['id']}})['then'](handleEntityNotFound(_0x34c2c7,null))[_0x16e6('0x31')](removeEntity(_0x34c2c7,null))[_0x16e6('0x26')](handleError(_0x34c2c7,null));};exports[_0x16e6('0x55')]=function(_0x489235,_0x1c965c,_0x57c549){var _0x1dd316={};var _0x15f456={};var _0x4d38b6;var _0x5dd39f;return db[_0x16e6('0x49')][_0x16e6('0x56')]({'where':{'id':_0x489235[_0x16e6('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1c965c,null))[_0x16e6('0x31')](function(_0x1b44a8){if(_0x1b44a8){_0x4d38b6=_0x1b44a8;_0x15f456[_0x16e6('0x3d')]=_['keys'](db[_0x16e6('0x57')]['rawAttributes']);_0x15f456[_0x16e6('0x39')]=_[_0x16e6('0x3a')](_0x489235[_0x16e6('0x39')]);_0x15f456[_0x16e6('0x3b')]=_[_0x16e6('0x3c')](_0x15f456[_0x16e6('0x3d')],_0x15f456['query']);_0x1dd316['attributes']=_[_0x16e6('0x3c')](_0x15f456['model'],qs['fields'](_0x489235['query'][_0x16e6('0x3e')]));_0x1dd316[_0x16e6('0x3f')]=_0x1dd316['attributes']['length']?_0x1dd316['attributes']:_0x15f456[_0x16e6('0x3d')];_0x1dd316['order']=qs['sort'](_0x489235[_0x16e6('0x39')][_0x16e6('0x43')]);_0x1dd316[_0x16e6('0x45')]=qs[_0x16e6('0x3b')](_[_0x16e6('0x58')](_0x489235[_0x16e6('0x39')],_0x15f456[_0x16e6('0x3b')]));if(_0x489235['query'][_0x16e6('0x44')]){_0x1dd316[_0x16e6('0x45')]=_[_0x16e6('0x47')](_0x1dd316[_0x16e6('0x45')],{'$or':_[_0x16e6('0x36')](_0x1dd316[_0x16e6('0x3f')],function(_0x4a1375){var _0x82e3c6={};_0x82e3c6[_0x4a1375]={'$like':'%'+_0x489235['query'][_0x16e6('0x44')]+'%'};return _0x82e3c6;})});}_0x1dd316=_[_0x16e6('0x47')]({},_0x1dd316,_0x489235[_0x16e6('0x48')]);return _0x4d38b6[_0x16e6('0x55')](_0x1dd316);}})['then'](function(_0x5b97c7){if(_0x5b97c7){_0x5dd39f=_0x5b97c7[_0x16e6('0x40')];if(!_0x489235[_0x16e6('0x39')][_0x16e6('0x59')](_0x16e6('0x41'))){_0x1dd316[_0x16e6('0x2c')]=qs[_0x16e6('0x2c')](_0x489235[_0x16e6('0x39')][_0x16e6('0x2c')]);_0x1dd316['offset']=qs['offset'](_0x489235[_0x16e6('0x39')]['offset']);}return _0x4d38b6[_0x16e6('0x55')](_0x1dd316);}})['then'](function(_0x77898c){if(_0x77898c){return _0x77898c?{'count':_0x5dd39f,'rows':_0x77898c}:null;}})[_0x16e6('0x31')](respondWithResult(_0x1c965c,null))['catch'](handleError(_0x1c965c,null));};exports['getSubjects']=function(_0x36a33b,_0x369b7b,_0x221181){var _0xb6a867={};var _0x353375={};var _0x35b586;var _0x37070d;return db[_0x16e6('0x49')][_0x16e6('0x56')]({'where':{'id':_0x36a33b[_0x16e6('0x4f')]['id']}})[_0x16e6('0x31')](handleEntityNotFound(_0x369b7b,null))[_0x16e6('0x31')](function(_0x4db2bb){if(_0x4db2bb){_0x35b586=_0x4db2bb;_0x353375[_0x16e6('0x3d')]=_[_0x16e6('0x3a')](db[_0x16e6('0x57')][_0x16e6('0x50')]);_0x353375['query']=_[_0x16e6('0x3a')](_0x36a33b[_0x16e6('0x39')]);_0x353375['filters']=_[_0x16e6('0x3c')](_0x353375[_0x16e6('0x3d')],_0x353375[_0x16e6('0x39')]);_0xb6a867[_0x16e6('0x3f')]=_[_0x16e6('0x3c')](_0x353375['model'],qs[_0x16e6('0x3e')](_0x36a33b[_0x16e6('0x39')][_0x16e6('0x3e')]));_0xb6a867[_0x16e6('0x3f')]=_0xb6a867[_0x16e6('0x3f')]['length']?_0xb6a867[_0x16e6('0x3f')]:_0x353375[_0x16e6('0x3d')];_0xb6a867['order']=qs[_0x16e6('0x43')](_0x36a33b[_0x16e6('0x39')][_0x16e6('0x43')]);_0xb6a867['where']=qs[_0x16e6('0x3b')](_[_0x16e6('0x58')](_0x36a33b[_0x16e6('0x39')],_0x353375[_0x16e6('0x3b')]));if(_0x36a33b['query'][_0x16e6('0x44')]){_0xb6a867[_0x16e6('0x45')]=_[_0x16e6('0x47')](_0xb6a867[_0x16e6('0x45')],{'$or':_['map'](_0xb6a867[_0x16e6('0x3f')],function(_0x351b73){var _0x38c1ab={};_0x38c1ab[_0x351b73]={'$like':'%'+_0x36a33b[_0x16e6('0x39')][_0x16e6('0x44')]+'%'};return _0x38c1ab;})});}_0xb6a867=_[_0x16e6('0x47')]({},_0xb6a867,_0x36a33b['options']);return _0x35b586[_0x16e6('0x5a')](_0xb6a867);}})[_0x16e6('0x31')](function(_0x2da978){if(_0x2da978){_0x37070d=_0x2da978[_0x16e6('0x40')];if(!_0x36a33b[_0x16e6('0x39')][_0x16e6('0x59')](_0x16e6('0x41'))){_0xb6a867[_0x16e6('0x2c')]=qs[_0x16e6('0x2c')](_0x36a33b[_0x16e6('0x39')][_0x16e6('0x2c')]);_0xb6a867[_0x16e6('0x2b')]=qs[_0x16e6('0x2b')](_0x36a33b['query']['offset']);}return _0x35b586[_0x16e6('0x5a')](_0xb6a867);}})['then'](function(_0xe1ec93){if(_0xe1ec93){return _0xe1ec93?{'count':_0x37070d,'rows':_0xe1ec93}:null;}})[_0x16e6('0x31')](respondWithResult(_0x369b7b,null))[_0x16e6('0x26')](handleError(_0x369b7b,null));};exports[_0x16e6('0x5b')]=function(_0x467be4,_0xdeea18,_0x500a39){var _0x3c78de={};var _0x4efeac={};var _0x5eb645;var _0x23fd1b;return db[_0x16e6('0x49')][_0x16e6('0x56')]({'where':{'id':_0x467be4[_0x16e6('0x4f')]['id']}})[_0x16e6('0x31')](handleEntityNotFound(_0xdeea18,null))[_0x16e6('0x31')](function(_0x47f340){if(_0x47f340){_0x5eb645=_0x47f340;_0x4efeac['model']=_['keys'](db[_0x16e6('0x57')][_0x16e6('0x50')]);_0x4efeac[_0x16e6('0x39')]=_[_0x16e6('0x3a')](_0x467be4[_0x16e6('0x39')]);_0x4efeac[_0x16e6('0x3b')]=_[_0x16e6('0x3c')](_0x4efeac[_0x16e6('0x3d')],_0x4efeac['query']);_0x3c78de[_0x16e6('0x3f')]=_[_0x16e6('0x3c')](_0x4efeac[_0x16e6('0x3d')],qs['fields'](_0x467be4[_0x16e6('0x39')][_0x16e6('0x3e')]));_0x3c78de['attributes']=_0x3c78de[_0x16e6('0x3f')][_0x16e6('0x40')]?_0x3c78de[_0x16e6('0x3f')]:_0x4efeac[_0x16e6('0x3d')];_0x3c78de[_0x16e6('0x42')]=qs[_0x16e6('0x43')](_0x467be4[_0x16e6('0x39')][_0x16e6('0x43')]);_0x3c78de['where']=qs[_0x16e6('0x3b')](_[_0x16e6('0x58')](_0x467be4[_0x16e6('0x39')],_0x4efeac['filters']));if(_0x467be4[_0x16e6('0x39')]['filter']){_0x3c78de[_0x16e6('0x45')]=_['merge'](_0x3c78de[_0x16e6('0x45')],{'$or':_['map'](_0x3c78de[_0x16e6('0x3f')],function(_0x1495a2){var _0x269cc6={};_0x269cc6[_0x1495a2]={'$like':'%'+_0x467be4[_0x16e6('0x39')][_0x16e6('0x44')]+'%'};return _0x269cc6;})});}_0x3c78de=_['merge']({},_0x3c78de,_0x467be4[_0x16e6('0x48')]);return _0x5eb645[_0x16e6('0x5b')](_0x3c78de);}})[_0x16e6('0x31')](function(_0x14106e){if(_0x14106e){_0x23fd1b=_0x14106e[_0x16e6('0x40')];if(!_0x467be4[_0x16e6('0x39')][_0x16e6('0x59')](_0x16e6('0x41'))){_0x3c78de[_0x16e6('0x2c')]=qs[_0x16e6('0x2c')](_0x467be4['query'][_0x16e6('0x2c')]);_0x3c78de[_0x16e6('0x2b')]=qs[_0x16e6('0x2b')](_0x467be4['query'][_0x16e6('0x2b')]);}return _0x5eb645[_0x16e6('0x5b')](_0x3c78de);}})['then'](function(_0x704dfe){if(_0x704dfe){return _0x704dfe?{'count':_0x23fd1b,'rows':_0x704dfe}:null;}})['then'](respondWithResult(_0xdeea18,null))[_0x16e6('0x26')](handleError(_0xdeea18,null));};exports[_0x16e6('0x5c')]=function(_0x32e984,_0x2c7b05,_0xd565bc){var _0x1abc9={};var _0x59bf6c={};var _0x295644;var _0x36058a;return db[_0x16e6('0x49')][_0x16e6('0x56')]({'where':{'id':_0x32e984[_0x16e6('0x4f')]['id']}})[_0x16e6('0x31')](handleEntityNotFound(_0x2c7b05,null))[_0x16e6('0x31')](function(_0x3e339a){if(_0x3e339a){_0x295644=_0x3e339a;_0x59bf6c[_0x16e6('0x3d')]=_['keys'](db[_0x16e6('0x5d')]['rawAttributes']);_0x59bf6c[_0x16e6('0x39')]=_['keys'](_0x32e984[_0x16e6('0x39')]);_0x59bf6c[_0x16e6('0x3b')]=_[_0x16e6('0x3c')](_0x59bf6c[_0x16e6('0x3d')],_0x59bf6c[_0x16e6('0x39')]);_0x1abc9[_0x16e6('0x3f')]=_[_0x16e6('0x3c')](_0x59bf6c['model'],qs[_0x16e6('0x3e')](_0x32e984[_0x16e6('0x39')]['fields']));_0x1abc9[_0x16e6('0x3f')]=_0x1abc9[_0x16e6('0x3f')][_0x16e6('0x40')]?_0x1abc9['attributes']:_0x59bf6c[_0x16e6('0x3d')];_0x1abc9['order']=qs[_0x16e6('0x43')](_0x32e984[_0x16e6('0x39')][_0x16e6('0x43')]);_0x1abc9[_0x16e6('0x45')]=qs[_0x16e6('0x3b')](_[_0x16e6('0x58')](_0x32e984[_0x16e6('0x39')],_0x59bf6c['filters']));if(_0x32e984[_0x16e6('0x39')]['filter']){_0x1abc9['where']=_[_0x16e6('0x47')](_0x1abc9['where'],{'$or':_[_0x16e6('0x36')](_0x1abc9[_0x16e6('0x3f')],function(_0xef8191){var _0x16ab0d={};_0x16ab0d[_0xef8191]={'$like':'%'+_0x32e984['query'][_0x16e6('0x44')]+'%'};return _0x16ab0d;})});}_0x1abc9=_['merge']({},_0x1abc9,_0x32e984['options']);return _0x295644[_0x16e6('0x5c')](_0x1abc9);}})[_0x16e6('0x31')](function(_0x59fdf0){if(_0x59fdf0){_0x36058a=_0x59fdf0[_0x16e6('0x40')];if(!_0x32e984[_0x16e6('0x39')]['hasOwnProperty'](_0x16e6('0x41'))){_0x1abc9[_0x16e6('0x2c')]=qs[_0x16e6('0x2c')](_0x32e984[_0x16e6('0x39')][_0x16e6('0x2c')]);_0x1abc9['offset']=qs[_0x16e6('0x2b')](_0x32e984[_0x16e6('0x39')]['offset']);}return _0x295644[_0x16e6('0x5c')](_0x1abc9);}})[_0x16e6('0x31')](function(_0x1654f1){if(_0x1654f1){return _0x1654f1?{'count':_0x36058a,'rows':_0x1654f1}:null;}})['then'](respondWithResult(_0x2c7b05,null))[_0x16e6('0x26')](handleError(_0x2c7b05,null));};exports[_0x16e6('0x5e')]=function(_0x55c6f4,_0x3e4179,_0x4d0258){if(_0x55c6f4[_0x16e6('0x54')]['id']){delete _0x55c6f4['body']['id'];}return db[_0x16e6('0x49')][_0x16e6('0x56')]({'where':{'id':_0x55c6f4[_0x16e6('0x4f')]['id']}})[_0x16e6('0x31')](handleEntityNotFound(_0x3e4179,null))['then'](function(_0x22e12f){if(_0x22e12f){return _0x22e12f[_0x16e6('0x5e')](_0x55c6f4[_0x16e6('0x54')][_0x16e6('0x5f')]||[]);}return null;})[_0x16e6('0x31')](respondWithResult(_0x3e4179,null))['catch'](handleError(_0x3e4179,null));}; \ No newline at end of file +var _0xfe17=['result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','DeskConfiguration','rawAttributes','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','type','filter','merge','options','includeAll','findAll','rows','show','params','include','create','body','find','getFields','findOne','DeskField','pick','getSubjects','getDescriptions','getTags','setTags','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','ValidationError','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x4064a5,_0x15662d){var _0xf7b4f0=function(_0x224d89){while(--_0x224d89){_0x4064a5['push'](_0x4064a5['shift']());}};_0xf7b4f0(++_0x15662d);}(_0xfe17,0x1b5));var _0x7fe1=function(_0x3e0dda,_0x358363){_0x3e0dda=_0x3e0dda-0x0;var _0x29976b=_0xfe17[_0x3e0dda];return _0x29976b;};'use strict';var pdf=require(_0x7fe1('0x0'));var emlformat=require(_0x7fe1('0x1'));var rimraf=require(_0x7fe1('0x2'));var zipdir=require(_0x7fe1('0x3'));var jsonpatch=require(_0x7fe1('0x4'));var rp=require(_0x7fe1('0x5'));var moment=require(_0x7fe1('0x6'));var BPromise=require(_0x7fe1('0x7'));var Mustache=require(_0x7fe1('0x8'));var util=require(_0x7fe1('0x9'));var path=require(_0x7fe1('0xa'));var sox=require(_0x7fe1('0xb'));var csv=require(_0x7fe1('0xc'));var ejs=require(_0x7fe1('0xd'));var fs=require('fs');var _=require(_0x7fe1('0xe'));var squel=require(_0x7fe1('0xf'));var crypto=require(_0x7fe1('0x10'));var jsforce=require(_0x7fe1('0x11'));var deskjs=require('desk.js');var toCsv=require(_0x7fe1('0xc'));var querystring=require('querystring');var Papa=require(_0x7fe1('0x12'));var Redis=require('ioredis');var authService=require(_0x7fe1('0x13'));var qs=require(_0x7fe1('0x14'));var as=require(_0x7fe1('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7fe1('0x16'))('api');var utils=require(_0x7fe1('0x17'));var config=require(_0x7fe1('0x18'));var db=require(_0x7fe1('0x19'))['db'];var jayson=require(_0x7fe1('0x1a'));var client=jayson[_0x7fe1('0x1b')][_0x7fe1('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x272382,_0x2d58b7,_0x25ce23){if(_0x25ce23){var _0xa3c620=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xa3c620[_0x7fe1('0x1d')](_0x2d58b7)){return _0x272382;}else{throw new db['Sequelize'][(_0x7fe1('0x1e'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x272382;}}function respondWithRpcPromise(_0x4b72c8,_0x145b5d,_0x4cdcf2,_0x58c626){return new BPromise(function(_0x3d3a37,_0x305708){var _0x3175e3=_0x58c626||client;return _0x3175e3['request'](_0x4b72c8,_0x4cdcf2)['then'](function(_0x3fd6d6){logger[_0x7fe1('0x1f')](_0x7fe1('0x20'),_0x145b5d,_0x7fe1('0x21'));logger['debug']('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x145b5d,_0x7fe1('0x21'),JSON[_0x7fe1('0x22')](_0x3fd6d6));if(_0x3fd6d6[_0x7fe1('0x23')]){if(_0x3fd6d6['error'][_0x7fe1('0x24')]===0x1f4){logger['error'](_0x7fe1('0x20'),_0x145b5d,_0x3fd6d6['error'][_0x7fe1('0x25')]);return _0x305708(_0x3fd6d6[_0x7fe1('0x23')][_0x7fe1('0x25')]);}logger[_0x7fe1('0x23')](_0x7fe1('0x20'),_0x145b5d,_0x3fd6d6['error']['message']);return _0x3d3a37(_0x3fd6d6['error'][_0x7fe1('0x25')]);}else{logger[_0x7fe1('0x1f')](_0x7fe1('0x20'),_0x145b5d,_0x7fe1('0x21'));_0x3d3a37(_0x3fd6d6[_0x7fe1('0x26')]['message']);}})[_0x7fe1('0x27')](function(_0x4ce3d4){logger[_0x7fe1('0x23')](_0x7fe1('0x20'),_0x145b5d,_0x4ce3d4);_0x305708(_0x4ce3d4);});});}function respondWithStatusCode(_0x40ece2,_0x3ed8a2){_0x3ed8a2=_0x3ed8a2||0xcc;return function(_0x33fa6a){if(_0x33fa6a){return _0x40ece2[_0x7fe1('0x28')](_0x3ed8a2);}return _0x40ece2[_0x7fe1('0x29')](_0x3ed8a2)[_0x7fe1('0x2a')]();};}function respondWithResult(_0x4f79fa,_0xee347e){_0xee347e=_0xee347e||0xc8;return function(_0x24077b){if(_0x24077b){return _0x4f79fa['status'](_0xee347e)[_0x7fe1('0x2b')](_0x24077b);}};}function respondWithFilteredResult(_0x3f2ac8,_0x4b50bd){return function(_0x48e003){if(_0x48e003){var _0x2241b9=_0x48e003[_0x7fe1('0x2c')],_0x48d7c3=_0x4b50bd[_0x7fe1('0x2d')],_0x52dd4c=_0x4b50bd[_0x7fe1('0x2d')]+_0x4b50bd['limit'],_0x1cfaeb;if(_0x52dd4c>=_0x2241b9){_0x52dd4c=_0x2241b9;_0x1cfaeb=0xc8;}else{_0x1cfaeb=0xce;}_0x3f2ac8[_0x7fe1('0x29')](_0x1cfaeb);return _0x3f2ac8[_0x7fe1('0x2e')](_0x7fe1('0x2f'),_0x48d7c3+'-'+_0x52dd4c+'/'+_0x2241b9)[_0x7fe1('0x2b')](_0x48e003);}return null;};}function patchUpdates(_0x5afdf4){return function(_0x3e6c82){try{jsonpatch['apply'](_0x3e6c82,_0x5afdf4,!![]);}catch(_0x209c85){return BPromise[_0x7fe1('0x30')](_0x209c85);}return _0x3e6c82[_0x7fe1('0x31')]();};}function saveUpdates(_0x378a28,_0x2e7f45){return function(_0xf819a2){if(_0xf819a2){return _0xf819a2[_0x7fe1('0x32')](_0x378a28)[_0x7fe1('0x33')](function(_0x4c412f){return _0x4c412f;});}return null;};}function removeEntity(_0x1e9875,_0x485243){return function(_0x56be01){if(_0x56be01){return _0x56be01[_0x7fe1('0x34')]()[_0x7fe1('0x33')](function(){_0x1e9875[_0x7fe1('0x29')](0xcc)[_0x7fe1('0x2a')]();});}};}function handleEntityNotFound(_0x4f5a8b,_0x39bd8f){return function(_0x5d75a2){if(!_0x5d75a2){_0x4f5a8b[_0x7fe1('0x28')](0x194);}return _0x5d75a2;};}function handleError(_0x564308,_0x296fed){_0x296fed=_0x296fed||0x1f4;return function(_0x259d71){logger['error'](_0x259d71[_0x7fe1('0x35')]);if(_0x259d71[_0x7fe1('0x36')]){delete _0x259d71[_0x7fe1('0x36')];}_0x564308[_0x7fe1('0x29')](_0x296fed)[_0x7fe1('0x37')](_0x259d71);};}exports[_0x7fe1('0x38')]=function(_0x69e781,_0x3df95f){var _0x49f19e={},_0x169323={},_0x4f3b58={'count':0x0,'rows':[]};var _0x3a64e5=_['map'](db[_0x7fe1('0x39')][_0x7fe1('0x3a')],function(_0x446355){return{'name':_0x446355['fieldName'],'type':_0x446355['type']['key']};});_0x169323[_0x7fe1('0x3b')]=_[_0x7fe1('0x3c')](_0x3a64e5,_0x7fe1('0x36'));_0x169323[_0x7fe1('0x3d')]=_[_0x7fe1('0x3e')](_0x69e781['query']);_0x169323['filters']=_[_0x7fe1('0x3f')](_0x169323[_0x7fe1('0x3b')],_0x169323[_0x7fe1('0x3d')]);_0x49f19e[_0x7fe1('0x40')]=_[_0x7fe1('0x3f')](_0x169323['model'],qs[_0x7fe1('0x41')](_0x69e781[_0x7fe1('0x3d')][_0x7fe1('0x41')]));_0x49f19e[_0x7fe1('0x40')]=_0x49f19e[_0x7fe1('0x40')][_0x7fe1('0x42')]?_0x49f19e[_0x7fe1('0x40')]:_0x169323[_0x7fe1('0x3b')];if(!_0x69e781['query'][_0x7fe1('0x43')](_0x7fe1('0x44'))){_0x49f19e['limit']=qs[_0x7fe1('0x45')](_0x69e781[_0x7fe1('0x3d')][_0x7fe1('0x45')]);_0x49f19e[_0x7fe1('0x2d')]=qs[_0x7fe1('0x2d')](_0x69e781['query'][_0x7fe1('0x2d')]);}_0x49f19e[_0x7fe1('0x46')]=qs[_0x7fe1('0x47')](_0x69e781['query'][_0x7fe1('0x47')]);_0x49f19e[_0x7fe1('0x48')]=qs['filters'](_['pick'](_0x69e781[_0x7fe1('0x3d')],_0x169323[_0x7fe1('0x49')]));if(_0x69e781[_0x7fe1('0x3d')]['filter']){_0x49f19e[_0x7fe1('0x48')]=_['merge'](_0x49f19e[_0x7fe1('0x48')],{'$or':_[_0x7fe1('0x3c')](_0x3a64e5,function(_0x3b9833){if(_0x3b9833[_0x7fe1('0x4a')]!=='VIRTUAL'){var _0x10645e={};_0x10645e[_0x3b9833[_0x7fe1('0x36')]]={'$like':'%'+_0x69e781[_0x7fe1('0x3d')][_0x7fe1('0x4b')]+'%'};return _0x10645e;}})});}_0x49f19e=_[_0x7fe1('0x4c')]({},_0x49f19e,_0x69e781[_0x7fe1('0x4d')]);var _0x39c57e={'where':_0x49f19e[_0x7fe1('0x48')]};return db['DeskConfiguration']['count'](_0x39c57e)[_0x7fe1('0x33')](function(_0x2aeadd){_0x4f3b58[_0x7fe1('0x2c')]=_0x2aeadd;if(_0x69e781[_0x7fe1('0x3d')][_0x7fe1('0x4e')]){_0x49f19e['include']=[{'all':!![]}];}return db[_0x7fe1('0x39')][_0x7fe1('0x4f')](_0x49f19e);})[_0x7fe1('0x33')](function(_0x5a095b){_0x4f3b58[_0x7fe1('0x50')]=_0x5a095b;return _0x4f3b58;})[_0x7fe1('0x33')](respondWithFilteredResult(_0x3df95f,_0x49f19e))[_0x7fe1('0x27')](handleError(_0x3df95f,null));};exports[_0x7fe1('0x51')]=function(_0x5152ef,_0x30a47d){var _0x4b1922={'raw':![],'where':{'id':_0x5152ef[_0x7fe1('0x52')]['id']}},_0x2acbf0={};_0x2acbf0[_0x7fe1('0x3b')]=_['keys'](db['DeskConfiguration'][_0x7fe1('0x3a')]);_0x2acbf0[_0x7fe1('0x3d')]=_[_0x7fe1('0x3e')](_0x5152ef[_0x7fe1('0x3d')]);_0x2acbf0['filters']=_[_0x7fe1('0x3f')](_0x2acbf0[_0x7fe1('0x3b')],_0x2acbf0['query']);_0x4b1922[_0x7fe1('0x40')]=_[_0x7fe1('0x3f')](_0x2acbf0[_0x7fe1('0x3b')],qs[_0x7fe1('0x41')](_0x5152ef[_0x7fe1('0x3d')][_0x7fe1('0x41')]));_0x4b1922[_0x7fe1('0x40')]=_0x4b1922[_0x7fe1('0x40')]['length']?_0x4b1922[_0x7fe1('0x40')]:_0x2acbf0[_0x7fe1('0x3b')];if(_0x5152ef[_0x7fe1('0x3d')][_0x7fe1('0x4e')]){_0x4b1922[_0x7fe1('0x53')]=[{'all':!![]}];}_0x4b1922=_[_0x7fe1('0x4c')]({},_0x4b1922,_0x5152ef['options']);return db['DeskConfiguration']['find'](_0x4b1922)[_0x7fe1('0x33')](handleEntityNotFound(_0x30a47d,null))[_0x7fe1('0x33')](respondWithResult(_0x30a47d,null))['catch'](handleError(_0x30a47d,null));};exports['create']=function(_0x1bb86c,_0x2a961f){return db[_0x7fe1('0x39')][_0x7fe1('0x54')](_0x1bb86c[_0x7fe1('0x55')],{})[_0x7fe1('0x33')](respondWithResult(_0x2a961f,0xc9))[_0x7fe1('0x27')](handleError(_0x2a961f,null));};exports[_0x7fe1('0x32')]=function(_0x3a3845,_0x2b1210){if(_0x3a3845[_0x7fe1('0x55')]['id']){delete _0x3a3845['body']['id'];}return db['DeskConfiguration'][_0x7fe1('0x56')]({'where':{'id':_0x3a3845['params']['id']}})[_0x7fe1('0x33')](handleEntityNotFound(_0x2b1210,null))[_0x7fe1('0x33')](saveUpdates(_0x3a3845[_0x7fe1('0x55')],null))[_0x7fe1('0x33')](respondWithResult(_0x2b1210,null))['catch'](handleError(_0x2b1210,null));};exports['destroy']=function(_0x550f59,_0xdf92e4){return db[_0x7fe1('0x39')][_0x7fe1('0x56')]({'where':{'id':_0x550f59['params']['id']}})[_0x7fe1('0x33')](handleEntityNotFound(_0xdf92e4,null))[_0x7fe1('0x33')](removeEntity(_0xdf92e4,null))[_0x7fe1('0x27')](handleError(_0xdf92e4,null));};exports[_0x7fe1('0x57')]=function(_0x4f786f,_0x1d2ee3,_0x37019d){var _0xdc2afa={};var _0x239c91={};var _0x2d6d9c;var _0x157126;return db[_0x7fe1('0x39')][_0x7fe1('0x58')]({'where':{'id':_0x4f786f['params']['id']}})[_0x7fe1('0x33')](handleEntityNotFound(_0x1d2ee3,null))[_0x7fe1('0x33')](function(_0x11f1ea){if(_0x11f1ea){_0x2d6d9c=_0x11f1ea;_0x239c91[_0x7fe1('0x3b')]=_[_0x7fe1('0x3e')](db[_0x7fe1('0x59')][_0x7fe1('0x3a')]);_0x239c91[_0x7fe1('0x3d')]=_[_0x7fe1('0x3e')](_0x4f786f['query']);_0x239c91[_0x7fe1('0x49')]=_[_0x7fe1('0x3f')](_0x239c91[_0x7fe1('0x3b')],_0x239c91[_0x7fe1('0x3d')]);_0xdc2afa[_0x7fe1('0x40')]=_[_0x7fe1('0x3f')](_0x239c91[_0x7fe1('0x3b')],qs[_0x7fe1('0x41')](_0x4f786f['query']['fields']));_0xdc2afa[_0x7fe1('0x40')]=_0xdc2afa[_0x7fe1('0x40')][_0x7fe1('0x42')]?_0xdc2afa[_0x7fe1('0x40')]:_0x239c91[_0x7fe1('0x3b')];_0xdc2afa['order']=qs[_0x7fe1('0x47')](_0x4f786f[_0x7fe1('0x3d')][_0x7fe1('0x47')]);_0xdc2afa[_0x7fe1('0x48')]=qs[_0x7fe1('0x49')](_[_0x7fe1('0x5a')](_0x4f786f[_0x7fe1('0x3d')],_0x239c91[_0x7fe1('0x49')]));if(_0x4f786f[_0x7fe1('0x3d')][_0x7fe1('0x4b')]){_0xdc2afa[_0x7fe1('0x48')]=_['merge'](_0xdc2afa[_0x7fe1('0x48')],{'$or':_['map'](_0xdc2afa['attributes'],function(_0x505656){var _0x35dc99={};_0x35dc99[_0x505656]={'$like':'%'+_0x4f786f[_0x7fe1('0x3d')][_0x7fe1('0x4b')]+'%'};return _0x35dc99;})});}_0xdc2afa=_[_0x7fe1('0x4c')]({},_0xdc2afa,_0x4f786f[_0x7fe1('0x4d')]);return _0x2d6d9c[_0x7fe1('0x57')](_0xdc2afa);}})['then'](function(_0xf56d36){if(_0xf56d36){_0x157126=_0xf56d36[_0x7fe1('0x42')];if(!_0x4f786f[_0x7fe1('0x3d')][_0x7fe1('0x43')](_0x7fe1('0x44'))){_0xdc2afa[_0x7fe1('0x45')]=qs[_0x7fe1('0x45')](_0x4f786f['query']['limit']);_0xdc2afa[_0x7fe1('0x2d')]=qs[_0x7fe1('0x2d')](_0x4f786f['query']['offset']);}return _0x2d6d9c[_0x7fe1('0x57')](_0xdc2afa);}})[_0x7fe1('0x33')](function(_0x106986){if(_0x106986){return _0x106986?{'count':_0x157126,'rows':_0x106986}:null;}})[_0x7fe1('0x33')](respondWithResult(_0x1d2ee3,null))['catch'](handleError(_0x1d2ee3,null));};exports[_0x7fe1('0x5b')]=function(_0x5e5f64,_0x74da85,_0x10151c){var _0x546902={};var _0x922158={};var _0x5339da;var _0x3fac49;return db[_0x7fe1('0x39')][_0x7fe1('0x58')]({'where':{'id':_0x5e5f64[_0x7fe1('0x52')]['id']}})[_0x7fe1('0x33')](handleEntityNotFound(_0x74da85,null))[_0x7fe1('0x33')](function(_0x16da11){if(_0x16da11){_0x5339da=_0x16da11;_0x922158[_0x7fe1('0x3b')]=_[_0x7fe1('0x3e')](db[_0x7fe1('0x59')][_0x7fe1('0x3a')]);_0x922158[_0x7fe1('0x3d')]=_[_0x7fe1('0x3e')](_0x5e5f64[_0x7fe1('0x3d')]);_0x922158[_0x7fe1('0x49')]=_[_0x7fe1('0x3f')](_0x922158[_0x7fe1('0x3b')],_0x922158[_0x7fe1('0x3d')]);_0x546902[_0x7fe1('0x40')]=_[_0x7fe1('0x3f')](_0x922158['model'],qs[_0x7fe1('0x41')](_0x5e5f64[_0x7fe1('0x3d')][_0x7fe1('0x41')]));_0x546902[_0x7fe1('0x40')]=_0x546902[_0x7fe1('0x40')][_0x7fe1('0x42')]?_0x546902[_0x7fe1('0x40')]:_0x922158['model'];_0x546902[_0x7fe1('0x46')]=qs[_0x7fe1('0x47')](_0x5e5f64['query'][_0x7fe1('0x47')]);_0x546902[_0x7fe1('0x48')]=qs[_0x7fe1('0x49')](_[_0x7fe1('0x5a')](_0x5e5f64[_0x7fe1('0x3d')],_0x922158[_0x7fe1('0x49')]));if(_0x5e5f64[_0x7fe1('0x3d')]['filter']){_0x546902[_0x7fe1('0x48')]=_['merge'](_0x546902[_0x7fe1('0x48')],{'$or':_[_0x7fe1('0x3c')](_0x546902[_0x7fe1('0x40')],function(_0x4ef81a){var _0x1c7242={};_0x1c7242[_0x4ef81a]={'$like':'%'+_0x5e5f64[_0x7fe1('0x3d')][_0x7fe1('0x4b')]+'%'};return _0x1c7242;})});}_0x546902=_[_0x7fe1('0x4c')]({},_0x546902,_0x5e5f64[_0x7fe1('0x4d')]);return _0x5339da['getSubjects'](_0x546902);}})[_0x7fe1('0x33')](function(_0x29e7a5){if(_0x29e7a5){_0x3fac49=_0x29e7a5[_0x7fe1('0x42')];if(!_0x5e5f64[_0x7fe1('0x3d')][_0x7fe1('0x43')]('nolimit')){_0x546902[_0x7fe1('0x45')]=qs[_0x7fe1('0x45')](_0x5e5f64['query'][_0x7fe1('0x45')]);_0x546902[_0x7fe1('0x2d')]=qs['offset'](_0x5e5f64['query'][_0x7fe1('0x2d')]);}return _0x5339da['getSubjects'](_0x546902);}})[_0x7fe1('0x33')](function(_0x324b87){if(_0x324b87){return _0x324b87?{'count':_0x3fac49,'rows':_0x324b87}:null;}})[_0x7fe1('0x33')](respondWithResult(_0x74da85,null))[_0x7fe1('0x27')](handleError(_0x74da85,null));};exports[_0x7fe1('0x5c')]=function(_0x54d5fd,_0x52972e,_0x4ca45c){var _0x17bf93={};var _0x216bc9={};var _0x336957;var _0x157327;return db[_0x7fe1('0x39')][_0x7fe1('0x58')]({'where':{'id':_0x54d5fd[_0x7fe1('0x52')]['id']}})[_0x7fe1('0x33')](handleEntityNotFound(_0x52972e,null))[_0x7fe1('0x33')](function(_0x3065c3){if(_0x3065c3){_0x336957=_0x3065c3;_0x216bc9[_0x7fe1('0x3b')]=_['keys'](db[_0x7fe1('0x59')][_0x7fe1('0x3a')]);_0x216bc9['query']=_['keys'](_0x54d5fd[_0x7fe1('0x3d')]);_0x216bc9['filters']=_[_0x7fe1('0x3f')](_0x216bc9[_0x7fe1('0x3b')],_0x216bc9['query']);_0x17bf93[_0x7fe1('0x40')]=_[_0x7fe1('0x3f')](_0x216bc9[_0x7fe1('0x3b')],qs[_0x7fe1('0x41')](_0x54d5fd['query'][_0x7fe1('0x41')]));_0x17bf93[_0x7fe1('0x40')]=_0x17bf93[_0x7fe1('0x40')][_0x7fe1('0x42')]?_0x17bf93[_0x7fe1('0x40')]:_0x216bc9[_0x7fe1('0x3b')];_0x17bf93[_0x7fe1('0x46')]=qs[_0x7fe1('0x47')](_0x54d5fd[_0x7fe1('0x3d')][_0x7fe1('0x47')]);_0x17bf93['where']=qs[_0x7fe1('0x49')](_[_0x7fe1('0x5a')](_0x54d5fd['query'],_0x216bc9['filters']));if(_0x54d5fd[_0x7fe1('0x3d')][_0x7fe1('0x4b')]){_0x17bf93[_0x7fe1('0x48')]=_['merge'](_0x17bf93['where'],{'$or':_['map'](_0x17bf93[_0x7fe1('0x40')],function(_0x4ea75f){var _0x100eb2={};_0x100eb2[_0x4ea75f]={'$like':'%'+_0x54d5fd['query']['filter']+'%'};return _0x100eb2;})});}_0x17bf93=_['merge']({},_0x17bf93,_0x54d5fd[_0x7fe1('0x4d')]);return _0x336957[_0x7fe1('0x5c')](_0x17bf93);}})['then'](function(_0x1dfc1f){if(_0x1dfc1f){_0x157327=_0x1dfc1f[_0x7fe1('0x42')];if(!_0x54d5fd[_0x7fe1('0x3d')][_0x7fe1('0x43')](_0x7fe1('0x44'))){_0x17bf93[_0x7fe1('0x45')]=qs[_0x7fe1('0x45')](_0x54d5fd[_0x7fe1('0x3d')]['limit']);_0x17bf93[_0x7fe1('0x2d')]=qs['offset'](_0x54d5fd['query'][_0x7fe1('0x2d')]);}return _0x336957['getDescriptions'](_0x17bf93);}})[_0x7fe1('0x33')](function(_0x23c21c){if(_0x23c21c){return _0x23c21c?{'count':_0x157327,'rows':_0x23c21c}:null;}})[_0x7fe1('0x33')](respondWithResult(_0x52972e,null))[_0x7fe1('0x27')](handleError(_0x52972e,null));};exports[_0x7fe1('0x5d')]=function(_0x2a6770,_0x1eaef1,_0x422423){var _0x3a87cf={};var _0x27f9e3={};var _0x408a02;var _0x4afe37;return db[_0x7fe1('0x39')][_0x7fe1('0x58')]({'where':{'id':_0x2a6770[_0x7fe1('0x52')]['id']}})[_0x7fe1('0x33')](handleEntityNotFound(_0x1eaef1,null))[_0x7fe1('0x33')](function(_0x245255){if(_0x245255){_0x408a02=_0x245255;_0x27f9e3[_0x7fe1('0x3b')]=_[_0x7fe1('0x3e')](db['Tag'][_0x7fe1('0x3a')]);_0x27f9e3[_0x7fe1('0x3d')]=_['keys'](_0x2a6770[_0x7fe1('0x3d')]);_0x27f9e3[_0x7fe1('0x49')]=_[_0x7fe1('0x3f')](_0x27f9e3[_0x7fe1('0x3b')],_0x27f9e3[_0x7fe1('0x3d')]);_0x3a87cf[_0x7fe1('0x40')]=_[_0x7fe1('0x3f')](_0x27f9e3['model'],qs[_0x7fe1('0x41')](_0x2a6770[_0x7fe1('0x3d')]['fields']));_0x3a87cf[_0x7fe1('0x40')]=_0x3a87cf['attributes'][_0x7fe1('0x42')]?_0x3a87cf['attributes']:_0x27f9e3[_0x7fe1('0x3b')];_0x3a87cf[_0x7fe1('0x46')]=qs[_0x7fe1('0x47')](_0x2a6770[_0x7fe1('0x3d')][_0x7fe1('0x47')]);_0x3a87cf[_0x7fe1('0x48')]=qs['filters'](_[_0x7fe1('0x5a')](_0x2a6770['query'],_0x27f9e3[_0x7fe1('0x49')]));if(_0x2a6770[_0x7fe1('0x3d')][_0x7fe1('0x4b')]){_0x3a87cf[_0x7fe1('0x48')]=_['merge'](_0x3a87cf[_0x7fe1('0x48')],{'$or':_[_0x7fe1('0x3c')](_0x3a87cf[_0x7fe1('0x40')],function(_0x19262d){var _0x54c197={};_0x54c197[_0x19262d]={'$like':'%'+_0x2a6770[_0x7fe1('0x3d')][_0x7fe1('0x4b')]+'%'};return _0x54c197;})});}_0x3a87cf=_[_0x7fe1('0x4c')]({},_0x3a87cf,_0x2a6770['options']);return _0x408a02['getTags'](_0x3a87cf);}})[_0x7fe1('0x33')](function(_0x32a64e){if(_0x32a64e){_0x4afe37=_0x32a64e['length'];if(!_0x2a6770['query'][_0x7fe1('0x43')](_0x7fe1('0x44'))){_0x3a87cf[_0x7fe1('0x45')]=qs[_0x7fe1('0x45')](_0x2a6770[_0x7fe1('0x3d')][_0x7fe1('0x45')]);_0x3a87cf[_0x7fe1('0x2d')]=qs['offset'](_0x2a6770[_0x7fe1('0x3d')][_0x7fe1('0x2d')]);}return _0x408a02[_0x7fe1('0x5d')](_0x3a87cf);}})['then'](function(_0x23c4f4){if(_0x23c4f4){return _0x23c4f4?{'count':_0x4afe37,'rows':_0x23c4f4}:null;}})[_0x7fe1('0x33')](respondWithResult(_0x1eaef1,null))[_0x7fe1('0x27')](handleError(_0x1eaef1,null));};exports[_0x7fe1('0x5e')]=function(_0x22b8ef,_0x50403f,_0x4d5e25){if(_0x22b8ef['body']['id']){delete _0x22b8ef[_0x7fe1('0x55')]['id'];}return db[_0x7fe1('0x39')][_0x7fe1('0x58')]({'where':{'id':_0x22b8ef[_0x7fe1('0x52')]['id']}})[_0x7fe1('0x33')](handleEntityNotFound(_0x50403f,null))[_0x7fe1('0x33')](function(_0x55089b){if(_0x55089b){return _0x55089b[_0x7fe1('0x5e')](_0x22b8ef['body']['ids']||[]);}return null;})['then'](respondWithResult(_0x50403f,null))[_0x7fe1('0x27')](handleError(_0x50403f,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index fd0edd3..d0e94d5 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 _0x442b=['int_desk_configurations','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x16fd53,_0x3fefd8){var _0x38170d=function(_0xce0449){while(--_0xce0449){_0x16fd53['push'](_0x16fd53['shift']());}};_0x38170d(++_0x3fefd8);}(_0x442b,0x173));var _0xb442=function(_0x126c89,_0x4fbcdb){_0x126c89=_0x126c89-0x0;var _0x12b494=_0x442b[_0x126c89];return _0x12b494;};'use strict';var _=require(_0xb442('0x0'));var util=require('util');var logger=require(_0xb442('0x1'))(_0xb442('0x2'));var moment=require(_0xb442('0x3'));var BPromise=require('bluebird');var rp=require(_0xb442('0x4'));var fs=require('fs');var path=require(_0xb442('0x5'));var rimraf=require(_0xb442('0x6'));var config=require(_0xb442('0x7'));var attributes=require('./intDeskConfiguration.attributes');module[_0xb442('0x8')]=function(_0x49d215,_0x47a100){return _0x49d215['define']('DeskConfiguration',attributes,{'tableName':_0xb442('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1a38=['request-promise','rimraf','../../config/environment','define','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x169e22,_0x2faf76){var _0x5214b6=function(_0x1b243e){while(--_0x1b243e){_0x169e22['push'](_0x169e22['shift']());}};_0x5214b6(++_0x2faf76);}(_0x1a38,0xed));var _0x81a3=function(_0x5a7112,_0x1f9492){_0x5a7112=_0x5a7112-0x0;var _0x3147f7=_0x1a38[_0x5a7112];return _0x3147f7;};'use strict';var _=require(_0x81a3('0x0'));var util=require(_0x81a3('0x1'));var logger=require(_0x81a3('0x2'))(_0x81a3('0x3'));var moment=require(_0x81a3('0x4'));var BPromise=require('bluebird');var rp=require(_0x81a3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x81a3('0x6'));var config=require(_0x81a3('0x7'));var attributes=require('./intDeskConfiguration.attributes');module['exports']=function(_0x49968d,_0x4b1610){return _0x49968d[_0x81a3('0x8')](_0x81a3('0x9'),attributes,{'tableName':_0x81a3('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 75b1d83..7024e32 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 _0x1ddc=['util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x49fc7d,_0x49f721){var _0x3a2b63=function(_0x5df972){while(--_0x5df972){_0x49fc7d['push'](_0x49fc7d['shift']());}};_0x3a2b63(++_0x49f721);}(_0x1ddc,0x6e));var _0xc1dd=function(_0x2ef523,_0x5b123c){_0x2ef523=_0x2ef523-0x0;var _0x4544eb=_0x1ddc[_0x2ef523];return _0x4544eb;};'use strict';var _=require('lodash');var util=require(_0xc1dd('0x0'));var moment=require(_0xc1dd('0x1'));var BPromise=require(_0xc1dd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc1dd('0x3'));var db=require(_0xc1dd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc1dd('0x5'))(_0xc1dd('0x6'));var config=require('../../config/environment');var jayson=require(_0xc1dd('0x7'));var client=jayson[_0xc1dd('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3938ff,_0x25c543,_0x593de5){return new BPromise(function(_0x54819b,_0x411452){return client[_0xc1dd('0x9')](_0x3938ff,_0x593de5)[_0xc1dd('0xa')](function(_0x217d07){logger['info'](_0xc1dd('0xb'),_0x25c543,_0xc1dd('0xc'));logger[_0xc1dd('0xd')](_0xc1dd('0xe'),_0x25c543,'request\x20sent',JSON[_0xc1dd('0xf')](_0x217d07));if(_0x217d07[_0xc1dd('0x10')]){if(_0x217d07[_0xc1dd('0x10')][_0xc1dd('0x11')]===0x1f4){logger[_0xc1dd('0x10')](_0xc1dd('0xb'),_0x25c543,_0x217d07[_0xc1dd('0x10')][_0xc1dd('0x12')]);return _0x411452(_0x217d07[_0xc1dd('0x10')][_0xc1dd('0x12')]);}logger[_0xc1dd('0x10')]('DeskConfiguration,\x20%s,\x20%s',_0x25c543,_0x217d07[_0xc1dd('0x10')][_0xc1dd('0x12')]);return _0x54819b(_0x217d07[_0xc1dd('0x10')][_0xc1dd('0x12')]);}else{logger[_0xc1dd('0x13')]('DeskConfiguration,\x20%s,\x20%s',_0x25c543,_0xc1dd('0xc'));_0x54819b(_0x217d07[_0xc1dd('0x14')][_0xc1dd('0x12')]);}})[_0xc1dd('0x15')](function(_0x5815d3){logger['error'](_0xc1dd('0xb'),_0x25c543,_0x5815d3);_0x411452(_0x5815d3);});});} \ No newline at end of file +var _0x710e=['result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x478f9d,_0x5db8f6){var _0x51683e=function(_0x318245){while(--_0x318245){_0x478f9d['push'](_0x478f9d['shift']());}};_0x51683e(++_0x5db8f6);}(_0x710e,0xb6));var _0xe710=function(_0x50dee3,_0x4b838a){_0x50dee3=_0x50dee3-0x0;var _0x368f50=_0x710e[_0x50dee3];return _0x368f50;};'use strict';var _=require(_0xe710('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe710('0x1'));var rs=require(_0xe710('0x2'));var fs=require('fs');var Redis=require(_0xe710('0x3'));var db=require(_0xe710('0x4'))['db'];var utils=require(_0xe710('0x5'));var logger=require('../../config/logger')(_0xe710('0x6'));var config=require(_0xe710('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe710('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x302291,_0x205db2,_0x211a33){return new BPromise(function(_0xf86a0f,_0x19ab1d){return client['request'](_0x302291,_0x211a33)['then'](function(_0x58d510){logger[_0xe710('0x9')](_0xe710('0xa'),_0x205db2,_0xe710('0xb'));logger[_0xe710('0xc')](_0xe710('0xd'),_0x205db2,_0xe710('0xb'),JSON[_0xe710('0xe')](_0x58d510));if(_0x58d510[_0xe710('0xf')]){if(_0x58d510[_0xe710('0xf')][_0xe710('0x10')]===0x1f4){logger[_0xe710('0xf')](_0xe710('0xa'),_0x205db2,_0x58d510[_0xe710('0xf')]['message']);return _0x19ab1d(_0x58d510['error'][_0xe710('0x11')]);}logger[_0xe710('0xf')](_0xe710('0xa'),_0x205db2,_0x58d510[_0xe710('0xf')][_0xe710('0x11')]);return _0xf86a0f(_0x58d510[_0xe710('0xf')]['message']);}else{logger[_0xe710('0x9')](_0xe710('0xa'),_0x205db2,_0xe710('0xb'));_0xf86a0f(_0x58d510[_0xe710('0x12')][_0xe710('0x11')]);}})[_0xe710('0x13')](function(_0x39bdf7){logger[_0xe710('0xf')](_0xe710('0xa'),_0x205db2,_0x39bdf7);_0x19ab1d(_0x39bdf7);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index e9241cb..ebefc42 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 _0x39e0=['multer','path','connect-timeout','express','../../config/environment','./intDeskField.controller','isAuthenticated','index','get','/:id','show','post','put','update','delete','destroy','exports'];(function(_0x109e34,_0x49d0ca){var _0x9f129d=function(_0x4c1040){while(--_0x4c1040){_0x109e34['push'](_0x109e34['shift']());}};_0x9f129d(++_0x49d0ca);}(_0x39e0,0x132));var _0x039e=function(_0x1f41b6,_0x1363cf){_0x1f41b6=_0x1f41b6-0x0;var _0x5ac1bc=_0x39e0[_0x1f41b6];return _0x5ac1bc;};'use strict';var multer=require(_0x039e('0x0'));var util=require('util');var path=require(_0x039e('0x1'));var timeout=require(_0x039e('0x2'));var express=require(_0x039e('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x039e('0x4'));var controller=require(_0x039e('0x5'));router['get']('/',auth[_0x039e('0x6')](),controller[_0x039e('0x7')]);router[_0x039e('0x8')](_0x039e('0x9'),auth['isAuthenticated'](),controller[_0x039e('0xa')]);router[_0x039e('0xb')]('/',auth[_0x039e('0x6')](),controller['create']);router[_0x039e('0xc')](_0x039e('0x9'),auth[_0x039e('0x6')](),controller[_0x039e('0xd')]);router[_0x039e('0xe')](_0x039e('0x9'),auth[_0x039e('0x6')](),controller[_0x039e('0xf')]);module[_0x039e('0x10')]=router; \ No newline at end of file +var _0x0bca=['index','get','show','post','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','isAuthenticated'];(function(_0x6794ac,_0x7f90e2){var _0x4dfed4=function(_0x1865e9){while(--_0x1865e9){_0x6794ac['push'](_0x6794ac['shift']());}};_0x4dfed4(++_0x7f90e2);}(_0x0bca,0x88));var _0xa0bc=function(_0x423f1c,_0x2adb8c){_0x423f1c=_0x423f1c-0x0;var _0xebed4c=_0x0bca[_0x423f1c];return _0xebed4c;};'use strict';var multer=require(_0xa0bc('0x0'));var util=require(_0xa0bc('0x1'));var path=require(_0xa0bc('0x2'));var timeout=require(_0xa0bc('0x3'));var express=require(_0xa0bc('0x4'));var router=express[_0xa0bc('0x5')]();var auth=require(_0xa0bc('0x6'));var interaction=require(_0xa0bc('0x7'));var config=require(_0xa0bc('0x8'));var controller=require(_0xa0bc('0x9'));router['get']('/',auth[_0xa0bc('0xa')](),controller[_0xa0bc('0xb')]);router[_0xa0bc('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xa0bc('0xd')]);router[_0xa0bc('0xe')]('/',auth[_0xa0bc('0xa')](),controller[_0xa0bc('0xf')]);router[_0xa0bc('0x10')](_0xa0bc('0x11'),auth[_0xa0bc('0xa')](),controller[_0xa0bc('0x12')]);router['delete']('/:id',auth[_0xa0bc('0xa')](),controller[_0xa0bc('0x13')]);module[_0xa0bc('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index dd5b9d3..4a125d4 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 _0x4660=['variable','STRING','customVariable','BOOLEAN','exports','ENUM','string'];(function(_0x233855,_0x2de003){var _0xba66da=function(_0xd41bc5){while(--_0xd41bc5){_0x233855['push'](_0x233855['shift']());}};_0xba66da(++_0x2de003);}(_0x4660,0xa5));var _0x0466=function(_0x1138ea,_0x4cc8fa){_0x1138ea=_0x1138ea-0x0;var _0x5d046f=_0x4660[_0x1138ea];return _0x5d046f;};'use strict';var Sequelize=require('sequelize');module[_0x0466('0x0')]={'type':{'type':Sequelize[_0x0466('0x1')](_0x0466('0x2'),_0x0466('0x3'),'customVariable','keyValue'),'defaultValue':'string'},'content':{'type':Sequelize[_0x0466('0x4')]},'key':{'type':Sequelize[_0x0466('0x4')]},'keyType':{'type':Sequelize[_0x0466('0x1')](_0x0466('0x2'),_0x0466('0x3'),_0x0466('0x5'))},'keyContent':{'type':Sequelize[_0x0466('0x4')]},'idField':{'type':Sequelize[_0x0466('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x0466('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0466('0x4')]}}; \ No newline at end of file +var _0xd279=['ENUM','string','variable','keyValue','STRING','customVariable','BOOLEAN','exports'];(function(_0x17ae45,_0x4f0b7f){var _0x44fe7e=function(_0x3dc322){while(--_0x3dc322){_0x17ae45['push'](_0x17ae45['shift']());}};_0x44fe7e(++_0x4f0b7f);}(_0xd279,0x67));var _0x9d27=function(_0x4e57a2,_0x585b61){_0x4e57a2=_0x4e57a2-0x0;var _0x31d79f=_0xd279[_0x4e57a2];return _0x31d79f;};'use strict';var Sequelize=require('sequelize');module[_0x9d27('0x0')]={'type':{'type':Sequelize[_0x9d27('0x1')](_0x9d27('0x2'),_0x9d27('0x3'),'customVariable',_0x9d27('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x9d27('0x5')]},'key':{'type':Sequelize[_0x9d27('0x5')]},'keyType':{'type':Sequelize['ENUM']('string',_0x9d27('0x3'),_0x9d27('0x6'))},'keyContent':{'type':Sequelize[_0x9d27('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x9d27('0x5')]},'customField':{'type':Sequelize[_0x9d27('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9d27('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 283520f..efeb446 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 _0x4c6d=['fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','show','params','include','find','catch','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','name','index','map','DeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection'];(function(_0x6ab3ca,_0x45b406){var _0x5e5eb3=function(_0x4fa309){while(--_0x4fa309){_0x6ab3ca['push'](_0x6ab3ca['shift']());}};_0x5e5eb3(++_0x45b406);}(_0x4c6d,0x1d0));var _0xd4c6=function(_0x467b5e,_0x595d42){_0x467b5e=_0x467b5e-0x0;var _0x53a792=_0x4c6d[_0x467b5e];return _0x53a792;};'use strict';var pdf=require(_0xd4c6('0x0'));var emlformat=require(_0xd4c6('0x1'));var rimraf=require(_0xd4c6('0x2'));var zipdir=require(_0xd4c6('0x3'));var jsonpatch=require(_0xd4c6('0x4'));var rp=require('request-promise');var moment=require(_0xd4c6('0x5'));var BPromise=require(_0xd4c6('0x6'));var Mustache=require(_0xd4c6('0x7'));var util=require('util');var path=require(_0xd4c6('0x8'));var sox=require(_0xd4c6('0x9'));var csv=require('to-csv');var ejs=require(_0xd4c6('0xa'));var fs=require('fs');var _=require(_0xd4c6('0xb'));var squel=require(_0xd4c6('0xc'));var crypto=require('crypto');var jsforce=require(_0xd4c6('0xd'));var deskjs=require(_0xd4c6('0xe'));var toCsv=require(_0xd4c6('0xf'));var querystring=require('querystring');var Papa=require(_0xd4c6('0x10'));var Redis=require(_0xd4c6('0x11'));var authService=require(_0xd4c6('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd4c6('0x13'));var hardwareService=require(_0xd4c6('0x14'));var logger=require(_0xd4c6('0x15'))(_0xd4c6('0x16'));var utils=require(_0xd4c6('0x17'));var config=require(_0xd4c6('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x52bbc9,_0x35b902){_0x35b902=_0x35b902||0xcc;return function(_0x489171){if(_0x489171){return _0x52bbc9[_0xd4c6('0x19')](_0x35b902);}return _0x52bbc9[_0xd4c6('0x1a')](_0x35b902)[_0xd4c6('0x1b')]();};}function respondWithResult(_0x2424c3,_0x3a2143){_0x3a2143=_0x3a2143||0xc8;return function(_0x384a98){if(_0x384a98){return _0x2424c3[_0xd4c6('0x1a')](_0x3a2143)['json'](_0x384a98);}};}function respondWithFilteredResult(_0x4b60ee,_0x11e6c2){return function(_0x3deb85){if(_0x3deb85){var _0x25e1fb=_0x3deb85[_0xd4c6('0x1c')],_0x25204d=_0x11e6c2['offset'],_0x3cb95c=_0x11e6c2[_0xd4c6('0x1d')]+_0x11e6c2[_0xd4c6('0x1e')],_0x3da1f4;if(_0x3cb95c>=_0x25e1fb){_0x3cb95c=_0x25e1fb;_0x3da1f4=0xc8;}else{_0x3da1f4=0xce;}_0x4b60ee[_0xd4c6('0x1a')](_0x3da1f4);return _0x4b60ee[_0xd4c6('0x1f')](_0xd4c6('0x20'),_0x25204d+'-'+_0x3cb95c+'/'+_0x25e1fb)['json'](_0x3deb85);}return null;};}function patchUpdates(_0x1e9e80){return function(_0x2a05fe){try{jsonpatch[_0xd4c6('0x21')](_0x2a05fe,_0x1e9e80,!![]);}catch(_0x4b3323){return BPromise[_0xd4c6('0x22')](_0x4b3323);}return _0x2a05fe[_0xd4c6('0x23')]();};}function saveUpdates(_0x1fc526,_0x3b1658){return function(_0x48dbf8){if(_0x48dbf8){return _0x48dbf8[_0xd4c6('0x24')](_0x1fc526)['then'](function(_0x37f552){return _0x37f552;});}return null;};}function removeEntity(_0x150e28,_0x2750c9){return function(_0x222813){if(_0x222813){return _0x222813[_0xd4c6('0x25')]()[_0xd4c6('0x26')](function(){_0x150e28[_0xd4c6('0x1a')](0xcc)[_0xd4c6('0x1b')]();});}};}function handleEntityNotFound(_0x155cb3,_0x466330){return function(_0x1ebb17){if(!_0x1ebb17){_0x155cb3[_0xd4c6('0x19')](0x194);}return _0x1ebb17;};}function handleError(_0x4e4b76,_0x582326){_0x582326=_0x582326||0x1f4;return function(_0x2f7309){logger[_0xd4c6('0x27')](_0x2f7309['stack']);if(_0x2f7309[_0xd4c6('0x28')]){delete _0x2f7309[_0xd4c6('0x28')];}_0x4e4b76[_0xd4c6('0x1a')](_0x582326)['send'](_0x2f7309);};}exports[_0xd4c6('0x29')]=function(_0x30276c,_0x5614f3){var _0x406ed0={},_0x8ce066={},_0x25ea15={'count':0x0,'rows':[]};var _0x488e7e=_[_0xd4c6('0x2a')](db[_0xd4c6('0x2b')][_0xd4c6('0x2c')],function(_0x4270d5){return{'name':_0x4270d5[_0xd4c6('0x2d')],'type':_0x4270d5[_0xd4c6('0x2e')][_0xd4c6('0x2f')]};});_0x8ce066[_0xd4c6('0x30')]=_[_0xd4c6('0x2a')](_0x488e7e,_0xd4c6('0x28'));_0x8ce066[_0xd4c6('0x31')]=_[_0xd4c6('0x32')](_0x30276c[_0xd4c6('0x31')]);_0x8ce066[_0xd4c6('0x33')]=_['intersection'](_0x8ce066[_0xd4c6('0x30')],_0x8ce066[_0xd4c6('0x31')]);_0x406ed0[_0xd4c6('0x34')]=_[_0xd4c6('0x35')](_0x8ce066['model'],qs['fields'](_0x30276c['query'][_0xd4c6('0x36')]));_0x406ed0[_0xd4c6('0x34')]=_0x406ed0[_0xd4c6('0x34')][_0xd4c6('0x37')]?_0x406ed0[_0xd4c6('0x34')]:_0x8ce066[_0xd4c6('0x30')];if(!_0x30276c[_0xd4c6('0x31')]['hasOwnProperty'](_0xd4c6('0x38'))){_0x406ed0[_0xd4c6('0x1e')]=qs[_0xd4c6('0x1e')](_0x30276c['query'][_0xd4c6('0x1e')]);_0x406ed0[_0xd4c6('0x1d')]=qs[_0xd4c6('0x1d')](_0x30276c['query'][_0xd4c6('0x1d')]);}_0x406ed0[_0xd4c6('0x39')]=qs[_0xd4c6('0x3a')](_0x30276c[_0xd4c6('0x31')]['sort']);_0x406ed0[_0xd4c6('0x3b')]=qs[_0xd4c6('0x33')](_[_0xd4c6('0x3c')](_0x30276c[_0xd4c6('0x31')],_0x8ce066[_0xd4c6('0x33')]));if(_0x30276c['query'][_0xd4c6('0x3d')]){_0x406ed0[_0xd4c6('0x3b')]=_[_0xd4c6('0x3e')](_0x406ed0[_0xd4c6('0x3b')],{'$or':_[_0xd4c6('0x2a')](_0x488e7e,function(_0x2cdb9d){if(_0x2cdb9d['type']!==_0xd4c6('0x3f')){var _0x3e9e92={};_0x3e9e92[_0x2cdb9d[_0xd4c6('0x28')]]={'$like':'%'+_0x30276c['query'][_0xd4c6('0x3d')]+'%'};return _0x3e9e92;}})});}_0x406ed0=_[_0xd4c6('0x3e')]({},_0x406ed0,_0x30276c[_0xd4c6('0x40')]);var _0x35f2f7={'where':_0x406ed0[_0xd4c6('0x3b')]};return db[_0xd4c6('0x2b')][_0xd4c6('0x1c')](_0x35f2f7)[_0xd4c6('0x26')](function(_0x2e1768){_0x25ea15['count']=_0x2e1768;if(_0x30276c[_0xd4c6('0x31')]['includeAll']){_0x406ed0['include']=[{'all':!![]}];}return db[_0xd4c6('0x2b')][_0xd4c6('0x41')](_0x406ed0);})[_0xd4c6('0x26')](function(_0x3960ca){_0x25ea15[_0xd4c6('0x42')]=_0x3960ca;return _0x25ea15;})['then'](respondWithFilteredResult(_0x5614f3,_0x406ed0))['catch'](handleError(_0x5614f3,null));};exports[_0xd4c6('0x43')]=function(_0x26b038,_0x32eb6a){var _0x14ee8f={'raw':!![],'where':{'id':_0x26b038[_0xd4c6('0x44')]['id']}},_0x4f6310={};_0x4f6310['model']=_[_0xd4c6('0x32')](db[_0xd4c6('0x2b')][_0xd4c6('0x2c')]);_0x4f6310['query']=_[_0xd4c6('0x32')](_0x26b038[_0xd4c6('0x31')]);_0x4f6310[_0xd4c6('0x33')]=_[_0xd4c6('0x35')](_0x4f6310[_0xd4c6('0x30')],_0x4f6310[_0xd4c6('0x31')]);_0x14ee8f[_0xd4c6('0x34')]=_[_0xd4c6('0x35')](_0x4f6310[_0xd4c6('0x30')],qs['fields'](_0x26b038[_0xd4c6('0x31')][_0xd4c6('0x36')]));_0x14ee8f[_0xd4c6('0x34')]=_0x14ee8f['attributes'][_0xd4c6('0x37')]?_0x14ee8f[_0xd4c6('0x34')]:_0x4f6310[_0xd4c6('0x30')];if(_0x26b038['query']['includeAll']){_0x14ee8f[_0xd4c6('0x45')]=[{'all':!![]}];}_0x14ee8f=_[_0xd4c6('0x3e')]({},_0x14ee8f,_0x26b038[_0xd4c6('0x40')]);return db['DeskField'][_0xd4c6('0x46')](_0x14ee8f)[_0xd4c6('0x26')](handleEntityNotFound(_0x32eb6a,null))[_0xd4c6('0x26')](respondWithResult(_0x32eb6a,null))[_0xd4c6('0x47')](handleError(_0x32eb6a,null));};exports[_0xd4c6('0x48')]=function(_0x1ae91b,_0x5dbdc5){return db[_0xd4c6('0x2b')][_0xd4c6('0x48')](_0x1ae91b[_0xd4c6('0x49')],{})[_0xd4c6('0x26')](respondWithResult(_0x5dbdc5,0xc9))[_0xd4c6('0x47')](handleError(_0x5dbdc5,null));};exports[_0xd4c6('0x24')]=function(_0x34fb42,_0x3e75ce){if(_0x34fb42['body']['id']){delete _0x34fb42['body']['id'];}return db[_0xd4c6('0x2b')][_0xd4c6('0x46')]({'where':{'id':_0x34fb42[_0xd4c6('0x44')]['id']}})['then'](handleEntityNotFound(_0x3e75ce,null))[_0xd4c6('0x26')](saveUpdates(_0x34fb42[_0xd4c6('0x49')],null))[_0xd4c6('0x26')](respondWithResult(_0x3e75ce,null))['catch'](handleError(_0x3e75ce,null));};exports[_0xd4c6('0x25')]=function(_0xa6bd55,_0x17193f){return db[_0xd4c6('0x2b')]['find']({'where':{'id':_0xa6bd55[_0xd4c6('0x44')]['id']}})[_0xd4c6('0x26')](handleEntityNotFound(_0x17193f,null))[_0xd4c6('0x26')](removeEntity(_0x17193f,null))[_0xd4c6('0x47')](handleError(_0x17193f,null));}; \ No newline at end of file +var _0x34e8=['squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','sendStatus','error','stack','index','fieldName','type','model','map','name','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','VIRTUAL','options','DeskField','includeAll','findAll','rows','show','rawAttributes','include','merge','find','catch','create','body','params','destroy','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs'];(function(_0x520db8,_0x4606b5){var _0x4e658b=function(_0x7453d0){while(--_0x7453d0){_0x520db8['push'](_0x520db8['shift']());}};_0x4e658b(++_0x4606b5);}(_0x34e8,0x12c));var _0x834e=function(_0x59b518,_0x313dae){_0x59b518=_0x59b518-0x0;var _0x3d0224=_0x34e8[_0x59b518];return _0x3d0224;};'use strict';var pdf=require(_0x834e('0x0'));var emlformat=require(_0x834e('0x1'));var rimraf=require(_0x834e('0x2'));var zipdir=require(_0x834e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x834e('0x4'));var moment=require(_0x834e('0x5'));var BPromise=require(_0x834e('0x6'));var Mustache=require(_0x834e('0x7'));var util=require(_0x834e('0x8'));var path=require(_0x834e('0x9'));var sox=require(_0x834e('0xa'));var csv=require('to-csv');var ejs=require(_0x834e('0xb'));var fs=require('fs');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('0x10'));var querystring=require(_0x834e('0x11'));var Papa=require(_0x834e('0x12'));var Redis=require(_0x834e('0x13'));var authService=require(_0x834e('0x14'));var qs=require(_0x834e('0x15'));var as=require(_0x834e('0x16'));var hardwareService=require(_0x834e('0x17'));var logger=require(_0x834e('0x18'))(_0x834e('0x19'));var utils=require(_0x834e('0x1a'));var config=require(_0x834e('0x1b'));var db=require(_0x834e('0x1c'))['db'];function respondWithStatusCode(_0x538bb3,_0x5e5b6d){_0x5e5b6d=_0x5e5b6d||0xcc;return function(_0x6cd9b9){if(_0x6cd9b9){return _0x538bb3['sendStatus'](_0x5e5b6d);}return _0x538bb3[_0x834e('0x1d')](_0x5e5b6d)[_0x834e('0x1e')]();};}function respondWithResult(_0x28e659,_0x21cc0a){_0x21cc0a=_0x21cc0a||0xc8;return function(_0x50e860){if(_0x50e860){return _0x28e659[_0x834e('0x1d')](_0x21cc0a)[_0x834e('0x1f')](_0x50e860);}};}function respondWithFilteredResult(_0x57274a,_0x316205){return function(_0x4a9cdc){if(_0x4a9cdc){var _0x38a8cd=_0x4a9cdc[_0x834e('0x20')],_0x36d443=_0x316205[_0x834e('0x21')],_0x478afe=_0x316205['offset']+_0x316205[_0x834e('0x22')],_0x43ac41;if(_0x478afe>=_0x38a8cd){_0x478afe=_0x38a8cd;_0x43ac41=0xc8;}else{_0x43ac41=0xce;}_0x57274a[_0x834e('0x1d')](_0x43ac41);return _0x57274a[_0x834e('0x23')](_0x834e('0x24'),_0x36d443+'-'+_0x478afe+'/'+_0x38a8cd)[_0x834e('0x1f')](_0x4a9cdc);}return null;};}function patchUpdates(_0x254677){return function(_0x1dd214){try{jsonpatch['apply'](_0x1dd214,_0x254677,!![]);}catch(_0x2545b4){return BPromise[_0x834e('0x25')](_0x2545b4);}return _0x1dd214[_0x834e('0x26')]();};}function saveUpdates(_0x325a99,_0x4ab05d){return function(_0x45a630){if(_0x45a630){return _0x45a630[_0x834e('0x27')](_0x325a99)['then'](function(_0x1b4bdf){return _0x1b4bdf;});}return null;};}function removeEntity(_0x28d687,_0x8d406e){return function(_0x5c55ca){if(_0x5c55ca){return _0x5c55ca['destroy']()[_0x834e('0x28')](function(){_0x28d687[_0x834e('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25ee1d,_0x1dc1e0){return function(_0x58f4fd){if(!_0x58f4fd){_0x25ee1d[_0x834e('0x29')](0x194);}return _0x58f4fd;};}function handleError(_0x2e1983,_0x338636){_0x338636=_0x338636||0x1f4;return function(_0x561cd2){logger[_0x834e('0x2a')](_0x561cd2[_0x834e('0x2b')]);if(_0x561cd2['name']){delete _0x561cd2['name'];}_0x2e1983[_0x834e('0x1d')](_0x338636)['send'](_0x561cd2);};}exports[_0x834e('0x2c')]=function(_0x3f1b0b,_0x3db026){var _0x2cc2eb={},_0x3cd928={},_0x130cc5={'count':0x0,'rows':[]};var _0x491919=_['map'](db['DeskField']['rawAttributes'],function(_0x2c7a8d){return{'name':_0x2c7a8d[_0x834e('0x2d')],'type':_0x2c7a8d[_0x834e('0x2e')]['key']};});_0x3cd928[_0x834e('0x2f')]=_[_0x834e('0x30')](_0x491919,_0x834e('0x31'));_0x3cd928[_0x834e('0x32')]=_[_0x834e('0x33')](_0x3f1b0b[_0x834e('0x32')]);_0x3cd928[_0x834e('0x34')]=_[_0x834e('0x35')](_0x3cd928[_0x834e('0x2f')],_0x3cd928['query']);_0x2cc2eb[_0x834e('0x36')]=_['intersection'](_0x3cd928[_0x834e('0x2f')],qs[_0x834e('0x37')](_0x3f1b0b[_0x834e('0x32')][_0x834e('0x37')]));_0x2cc2eb[_0x834e('0x36')]=_0x2cc2eb[_0x834e('0x36')][_0x834e('0x38')]?_0x2cc2eb[_0x834e('0x36')]:_0x3cd928[_0x834e('0x2f')];if(!_0x3f1b0b[_0x834e('0x32')]['hasOwnProperty'](_0x834e('0x39'))){_0x2cc2eb[_0x834e('0x22')]=qs[_0x834e('0x22')](_0x3f1b0b[_0x834e('0x32')]['limit']);_0x2cc2eb[_0x834e('0x21')]=qs[_0x834e('0x21')](_0x3f1b0b['query']['offset']);}_0x2cc2eb['order']=qs[_0x834e('0x3a')](_0x3f1b0b[_0x834e('0x32')][_0x834e('0x3a')]);_0x2cc2eb[_0x834e('0x3b')]=qs[_0x834e('0x34')](_[_0x834e('0x3c')](_0x3f1b0b['query'],_0x3cd928[_0x834e('0x34')]));if(_0x3f1b0b['query'][_0x834e('0x3d')]){_0x2cc2eb[_0x834e('0x3b')]=_['merge'](_0x2cc2eb[_0x834e('0x3b')],{'$or':_[_0x834e('0x30')](_0x491919,function(_0x491c28){if(_0x491c28['type']!==_0x834e('0x3e')){var _0xd0d43a={};_0xd0d43a[_0x491c28[_0x834e('0x31')]]={'$like':'%'+_0x3f1b0b[_0x834e('0x32')][_0x834e('0x3d')]+'%'};return _0xd0d43a;}})});}_0x2cc2eb=_['merge']({},_0x2cc2eb,_0x3f1b0b[_0x834e('0x3f')]);var _0x548d1d={'where':_0x2cc2eb['where']};return db[_0x834e('0x40')]['count'](_0x548d1d)[_0x834e('0x28')](function(_0x1ba66d){_0x130cc5[_0x834e('0x20')]=_0x1ba66d;if(_0x3f1b0b[_0x834e('0x32')][_0x834e('0x41')]){_0x2cc2eb['include']=[{'all':!![]}];}return db[_0x834e('0x40')][_0x834e('0x42')](_0x2cc2eb);})[_0x834e('0x28')](function(_0x58c5fb){_0x130cc5[_0x834e('0x43')]=_0x58c5fb;return _0x130cc5;})[_0x834e('0x28')](respondWithFilteredResult(_0x3db026,_0x2cc2eb))['catch'](handleError(_0x3db026,null));};exports[_0x834e('0x44')]=function(_0x59932f,_0x2ebfb6){var _0x585335={'raw':!![],'where':{'id':_0x59932f['params']['id']}},_0x4a18bb={};_0x4a18bb[_0x834e('0x2f')]=_[_0x834e('0x33')](db[_0x834e('0x40')][_0x834e('0x45')]);_0x4a18bb[_0x834e('0x32')]=_[_0x834e('0x33')](_0x59932f[_0x834e('0x32')]);_0x4a18bb['filters']=_[_0x834e('0x35')](_0x4a18bb['model'],_0x4a18bb[_0x834e('0x32')]);_0x585335['attributes']=_[_0x834e('0x35')](_0x4a18bb['model'],qs[_0x834e('0x37')](_0x59932f[_0x834e('0x32')]['fields']));_0x585335[_0x834e('0x36')]=_0x585335[_0x834e('0x36')][_0x834e('0x38')]?_0x585335[_0x834e('0x36')]:_0x4a18bb[_0x834e('0x2f')];if(_0x59932f[_0x834e('0x32')][_0x834e('0x41')]){_0x585335[_0x834e('0x46')]=[{'all':!![]}];}_0x585335=_[_0x834e('0x47')]({},_0x585335,_0x59932f[_0x834e('0x3f')]);return db['DeskField'][_0x834e('0x48')](_0x585335)[_0x834e('0x28')](handleEntityNotFound(_0x2ebfb6,null))['then'](respondWithResult(_0x2ebfb6,null))[_0x834e('0x49')](handleError(_0x2ebfb6,null));};exports[_0x834e('0x4a')]=function(_0x25b035,_0x2112d5){return db[_0x834e('0x40')][_0x834e('0x4a')](_0x25b035['body'],{})['then'](respondWithResult(_0x2112d5,0xc9))[_0x834e('0x49')](handleError(_0x2112d5,null));};exports[_0x834e('0x27')]=function(_0x30568e,_0x40ff5a){if(_0x30568e[_0x834e('0x4b')]['id']){delete _0x30568e[_0x834e('0x4b')]['id'];}return db[_0x834e('0x40')][_0x834e('0x48')]({'where':{'id':_0x30568e[_0x834e('0x4c')]['id']}})[_0x834e('0x28')](handleEntityNotFound(_0x40ff5a,null))[_0x834e('0x28')](saveUpdates(_0x30568e[_0x834e('0x4b')],null))[_0x834e('0x28')](respondWithResult(_0x40ff5a,null))[_0x834e('0x49')](handleError(_0x40ff5a,null));};exports[_0x834e('0x4d')]=function(_0x1a3855,_0x3df078){return db[_0x834e('0x40')][_0x834e('0x48')]({'where':{'id':_0x1a3855[_0x834e('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3df078,null))[_0x834e('0x28')](removeEntity(_0x3df078,null))[_0x834e('0x49')](handleError(_0x3df078,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 46e54de..3419182 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 _0x1732=['int_desk_fields','desk_unique_index','idField','FieldId','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','DeskField'];(function(_0x5a7e78,_0x400b57){var _0xa8d4a1=function(_0x486659){while(--_0x486659){_0x5a7e78['push'](_0x5a7e78['shift']());}};_0xa8d4a1(++_0x400b57);}(_0x1732,0x9a));var _0x2173=function(_0x165efb,_0x1f1541){_0x165efb=_0x165efb-0x0;var _0x5b706e=_0x1732[_0x165efb];return _0x5b706e;};'use strict';var _=require(_0x2173('0x0'));var util=require('util');var logger=require(_0x2173('0x1'))('api');var moment=require(_0x2173('0x2'));var BPromise=require(_0x2173('0x3'));var rp=require(_0x2173('0x4'));var fs=require('fs');var path=require(_0x2173('0x5'));var rimraf=require(_0x2173('0x6'));var config=require(_0x2173('0x7'));var attributes=require('./intDeskField.attributes');module[_0x2173('0x8')]=function(_0x183ec8,_0x1eebdd){return _0x183ec8[_0x2173('0x9')](_0x2173('0xa'),attributes,{'tableName':_0x2173('0xb'),'paranoid':![],'indexes':[{'name':_0x2173('0xc'),'fields':[_0x2173('0xd'),_0x2173('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfad7=['moment','bluebird','request-promise','path','rimraf','./intDeskField.attributes','exports','define','DeskField','desk_unique_index','FieldId','lodash','util','../../config/logger','api'];(function(_0x228728,_0x565d23){var _0x1982ee=function(_0x339990){while(--_0x339990){_0x228728['push'](_0x228728['shift']());}};_0x1982ee(++_0x565d23);}(_0xfad7,0x1a0));var _0x7fad=function(_0x1b81e3,_0x4b9fa6){_0x1b81e3=_0x1b81e3-0x0;var _0x2195aa=_0xfad7[_0x1b81e3];return _0x2195aa;};'use strict';var _=require(_0x7fad('0x0'));var util=require(_0x7fad('0x1'));var logger=require(_0x7fad('0x2'))(_0x7fad('0x3'));var moment=require(_0x7fad('0x4'));var BPromise=require(_0x7fad('0x5'));var rp=require(_0x7fad('0x6'));var fs=require('fs');var path=require(_0x7fad('0x7'));var rimraf=require(_0x7fad('0x8'));var config=require('../../config/environment');var attributes=require(_0x7fad('0x9'));module[_0x7fad('0xa')]=function(_0xdf9302,_0x2fc5f2){return _0xdf9302[_0x7fad('0xb')](_0x7fad('0xc'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0x7fad('0xd'),'fields':['idField',_0x7fad('0xe')],'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 1fe63bf..d471aa9 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 _0x4d13=['result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x1f8ce7,_0x42ca24){var _0x3c868c=function(_0x3f3769){while(--_0x3f3769){_0x1f8ce7['push'](_0x1f8ce7['shift']());}};_0x3c868c(++_0x42ca24);}(_0x4d13,0x1d0));var _0x34d1=function(_0x106460,_0x540a68){_0x106460=_0x106460-0x0;var _0x31f4c6=_0x4d13[_0x106460];return _0x31f4c6;};'use strict';var _=require(_0x34d1('0x0'));var util=require(_0x34d1('0x1'));var moment=require(_0x34d1('0x2'));var BPromise=require(_0x34d1('0x3'));var rs=require(_0x34d1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x34d1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x34d1('0x6'))(_0x34d1('0x7'));var config=require(_0x34d1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x34d1('0x9')][_0x34d1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6f8cac,_0xb52467,_0x24b724){return new BPromise(function(_0x538598,_0x10dca1){return client[_0x34d1('0xb')](_0x6f8cac,_0x24b724)[_0x34d1('0xc')](function(_0x572774){logger[_0x34d1('0xd')](_0x34d1('0xe'),_0xb52467,_0x34d1('0xf'));logger['debug'](_0x34d1('0x10'),_0xb52467,'request\x20sent',JSON[_0x34d1('0x11')](_0x572774));if(_0x572774[_0x34d1('0x12')]){if(_0x572774[_0x34d1('0x12')]['code']===0x1f4){logger[_0x34d1('0x12')](_0x34d1('0xe'),_0xb52467,_0x572774[_0x34d1('0x12')][_0x34d1('0x13')]);return _0x10dca1(_0x572774['error'][_0x34d1('0x13')]);}logger['error'](_0x34d1('0xe'),_0xb52467,_0x572774['error'][_0x34d1('0x13')]);return _0x538598(_0x572774[_0x34d1('0x12')][_0x34d1('0x13')]);}else{logger[_0x34d1('0xd')](_0x34d1('0xe'),_0xb52467,'request\x20sent');_0x538598(_0x572774[_0x34d1('0x14')][_0x34d1('0x13')]);}})[_0x34d1('0x15')](function(_0x5ca587){logger[_0x34d1('0x12')]('DeskField,\x20%s,\x20%s',_0xb52467,_0x5ca587);_0x10dca1(_0x5ca587);});});} \ No newline at end of file +var _0xa82e=['DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x28669c,_0x1f62c4){var _0x4a3af6=function(_0x3e25d5){while(--_0x3e25d5){_0x28669c['push'](_0x28669c['shift']());}};_0x4a3af6(++_0x1f62c4);}(_0xa82e,0x9c));var _0xea82=function(_0x2ae29d,_0x56deb5){_0x2ae29d=_0x2ae29d-0x0;var _0x37cf81=_0xa82e[_0x2ae29d];return _0x37cf81;};'use strict';var _=require(_0xea82('0x0'));var util=require('util');var moment=require(_0xea82('0x1'));var BPromise=require('bluebird');var rs=require(_0xea82('0x2'));var fs=require('fs');var Redis=require(_0xea82('0x3'));var db=require(_0xea82('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xea82('0x5'))('rpc');var config=require(_0xea82('0x6'));var jayson=require(_0xea82('0x7'));var client=jayson[_0xea82('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d684e,_0x506d9a,_0x64a35a){return new BPromise(function(_0xa8b725,_0xbb726e){return client[_0xea82('0x9')](_0x5d684e,_0x64a35a)[_0xea82('0xa')](function(_0xe55825){logger[_0xea82('0xb')](_0xea82('0xc'),_0x506d9a,_0xea82('0xd'));logger[_0xea82('0xe')](_0xea82('0xf'),_0x506d9a,_0xea82('0xd'),JSON[_0xea82('0x10')](_0xe55825));if(_0xe55825[_0xea82('0x11')]){if(_0xe55825[_0xea82('0x11')]['code']===0x1f4){logger['error'](_0xea82('0xc'),_0x506d9a,_0xe55825['error'][_0xea82('0x12')]);return _0xbb726e(_0xe55825[_0xea82('0x11')][_0xea82('0x12')]);}logger['error'](_0xea82('0xc'),_0x506d9a,_0xe55825['error'][_0xea82('0x12')]);return _0xa8b725(_0xe55825[_0xea82('0x11')][_0xea82('0x12')]);}else{logger[_0xea82('0xb')](_0xea82('0xc'),_0x506d9a,_0xea82('0xd'));_0xa8b725(_0xe55825[_0xea82('0x13')][_0xea82('0x12')]);}})[_0xea82('0x14')](function(_0x4bbb06){logger[_0xea82('0x11')](_0xea82('0xc'),_0x506d9a,_0x4bbb06);_0xbb726e(_0x4bbb06);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 70edc65..9365ce5 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 _0xb50b=['/:id/fields','getFields','post','create','addConfiguration','update','delete','exports','multer','util','path','connect-timeout','express','Router','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb50b,0x71));var _0xbb50=function(_0x3c59fc,_0x10dbd2){_0x3c59fc=_0x3c59fc-0x0;var _0x2b78d4=_0xb50b[_0x3c59fc];return _0x2b78d4;};'use strict';var multer=require(_0xbb50('0x0'));var util=require(_0xbb50('0x1'));var path=require(_0xbb50('0x2'));var timeout=require(_0xbb50('0x3'));var express=require(_0xbb50('0x4'));var router=express[_0xbb50('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbb50('0x6'));router[_0xbb50('0x7')]('/',auth[_0xbb50('0x8')](),controller[_0xbb50('0x9')]);router[_0xbb50('0x7')](_0xbb50('0xa'),auth[_0xbb50('0x8')](),controller['show']);router[_0xbb50('0x7')](_0xbb50('0xb'),auth['isAuthenticated'](),controller[_0xbb50('0xc')]);router[_0xbb50('0x7')](_0xbb50('0xd'),auth[_0xbb50('0x8')](),controller[_0xbb50('0xe')]);router[_0xbb50('0xf')]('/',auth[_0xbb50('0x8')](),controller[_0xbb50('0x10')]);router[_0xbb50('0xf')](_0xbb50('0xb'),auth[_0xbb50('0x8')](),controller[_0xbb50('0x11')]);router['put'](_0xbb50('0xa'),auth[_0xbb50('0x8')](),controller[_0xbb50('0x12')]);router[_0xbb50('0x13')](_0xbb50('0xa'),auth[_0xbb50('0x8')](),controller['destroy']);module[_0xbb50('0x14')]=router; \ No newline at end of file +var _0xda1f=['Router','../../components/auth/service','../../components/interaction/service','./intDynamics365Account.controller','isAuthenticated','get','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','put','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x118439,_0x1907d9){var _0x209b67=function(_0x51e946){while(--_0x51e946){_0x118439['push'](_0x118439['shift']());}};_0x209b67(++_0x1907d9);}(_0xda1f,0xb8));var _0xfda1=function(_0x24c5f9,_0x2cd6e6){_0x24c5f9=_0x24c5f9-0x0;var _0xa5d0b0=_0xda1f[_0x24c5f9];return _0xa5d0b0;};'use strict';var multer=require(_0xfda1('0x0'));var util=require(_0xfda1('0x1'));var path=require(_0xfda1('0x2'));var timeout=require(_0xfda1('0x3'));var express=require(_0xfda1('0x4'));var router=express[_0xfda1('0x5')]();var auth=require(_0xfda1('0x6'));var interaction=require(_0xfda1('0x7'));var config=require('../../config/environment');var controller=require(_0xfda1('0x8'));router['get']('/',auth[_0xfda1('0x9')](),controller['index']);router[_0xfda1('0xa')](_0xfda1('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xfda1('0xa')](_0xfda1('0xc'),auth[_0xfda1('0x9')](),controller[_0xfda1('0xd')]);router[_0xfda1('0xa')](_0xfda1('0xe'),auth[_0xfda1('0x9')](),controller[_0xfda1('0xf')]);router[_0xfda1('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xfda1('0x10')](_0xfda1('0xc'),auth[_0xfda1('0x9')](),controller['addConfiguration']);router[_0xfda1('0x11')](_0xfda1('0xb'),auth['isAuthenticated'](),controller[_0xfda1('0x12')]);router[_0xfda1('0x13')](_0xfda1('0xb'),auth[_0xfda1('0x9')](),controller[_0xfda1('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 14d9316..41d7a86 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 _0xefe2=['exports','STRING'];(function(_0x4eebd1,_0x1c4b74){var _0x3db9b3=function(_0x36d3e1){while(--_0x36d3e1){_0x4eebd1['push'](_0x4eebd1['shift']());}};_0x3db9b3(++_0x1c4b74);}(_0xefe2,0x112));var _0x2efe=function(_0x20b58b,_0x329485){_0x20b58b=_0x20b58b-0x0;var _0xc10533=_0xefe2[_0x20b58b];return _0xc10533;};'use strict';var Sequelize=require('sequelize');module[_0x2efe('0x0')]={'name':{'type':Sequelize[_0x2efe('0x1')]},'username':{'type':Sequelize[_0x2efe('0x1')]},'password':{'type':Sequelize[_0x2efe('0x1')]},'remoteUri':{'type':Sequelize[_0x2efe('0x1')]},'tenantId':{'type':Sequelize[_0x2efe('0x1')]},'clientId':{'type':Sequelize[_0x2efe('0x1')]},'clientSecret':{'type':Sequelize[_0x2efe('0x1')]},'serverUrl':{'type':Sequelize[_0x2efe('0x1')]},'description':{'type':Sequelize[_0x2efe('0x1')]}}; \ No newline at end of file +var _0xe2dc=['sequelize','exports','STRING'];(function(_0x4ed37d,_0x1a84c9){var _0x4fb2c5=function(_0x5c9013){while(--_0x5c9013){_0x4ed37d['push'](_0x4ed37d['shift']());}};_0x4fb2c5(++_0x1a84c9);}(_0xe2dc,0x1ef));var _0xce2d=function(_0x2aa851,_0x54c41b){_0x2aa851=_0x2aa851-0x0;var _0x2070bb=_0xe2dc[_0x2aa851];return _0x2070bb;};'use strict';var Sequelize=require(_0xce2d('0x0'));module[_0xce2d('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xce2d('0x2')]},'remoteUri':{'type':Sequelize[_0xce2d('0x2')]},'tenantId':{'type':Sequelize[_0xce2d('0x2')]},'clientId':{'type':Sequelize[_0xce2d('0x2')]},'clientSecret':{'type':Sequelize[_0xce2d('0x2')]},'serverUrl':{'type':Sequelize[_0xce2d('0x2')]},'description':{'type':Sequelize[_0xce2d('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 5b947c5..a5e919d 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 _0xc3a1=['msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridtype','owneridyominame','primarycontactidname','productidname','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','slainvokedidname','slaname','socialprofileidname','subjectidname','ticketnumber','utcconversiontimezonecode','versionnumber','password','remoteUri','tenantId','clientSecret','slice','substring','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','clientId','username','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','lastIndexOf','BooleanAttributeMetadata','all','DoubleAttributeMetadata','BigIntAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','concat','statusCode','Wrong\x20credentials',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Label','UserLocalizedLabel','Value','DisplayName',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','rimraf','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','code','Dynamics365Account,\x20%s,\x20%s','message','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','rawAttributes','fieldName','key','model','map','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','filter','type','VIRTUAL','merge','options','Dynamics365Account','count','include','findAll','rows','catch','params','includeAll','find','create','body','getConfigurations','findOne','Dynamics365Configuration','pick','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','Dynamics365Field','ticketType','Incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','phonenumber','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','exchangerate','firstresponsebykpiidname','influencescore','lastonholdtime','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname'];(function(_0xe900c,_0x218dd1){var _0xd9ff51=function(_0x439b0){while(--_0x439b0){_0xe900c['push'](_0xe900c['shift']());}};_0xd9ff51(++_0x218dd1);}(_0xc3a1,0x11d));var _0x1c3a=function(_0x504708,_0x160b34){_0x504708=_0x504708-0x0;var _0xed8ce9=_0xc3a1[_0x504708];return _0xed8ce9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1c3a('0x0'));var rimraf=require(_0x1c3a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1c3a('0x2'));var moment=require(_0x1c3a('0x3'));var BPromise=require(_0x1c3a('0x4'));var Mustache=require('mustache');var util=require(_0x1c3a('0x5'));var path=require('path');var sox=require(_0x1c3a('0x6'));var csv=require(_0x1c3a('0x7'));var ejs=require(_0x1c3a('0x8'));var fs=require('fs');var _=require(_0x1c3a('0x9'));var squel=require(_0x1c3a('0xa'));var crypto=require(_0x1c3a('0xb'));var jsforce=require(_0x1c3a('0xc'));var deskjs=require(_0x1c3a('0xd'));var toCsv=require(_0x1c3a('0x7'));var querystring=require(_0x1c3a('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1c3a('0xf'));var qs=require(_0x1c3a('0x10'));var as=require(_0x1c3a('0x11'));var hardwareService=require(_0x1c3a('0x12'));var logger=require(_0x1c3a('0x13'))('api');var utils=require(_0x1c3a('0x14'));var config=require(_0x1c3a('0x15'));var db=require(_0x1c3a('0x16'))['db'];var integrations=require(_0x1c3a('0x17'));var jayson=require(_0x1c3a('0x18'));var client=jayson['client'][_0x1c3a('0x19')]({'port':0x232a});function checkPasswordPattern(_0x28501e,_0x55541c,_0x2fe5e0){if(_0x2fe5e0){var _0x286374=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x286374[_0x1c3a('0x1a')](_0x55541c)){return _0x28501e;}else{throw new db[(_0x1c3a('0x1b'))][(_0x1c3a('0x1c'))](_0x1c3a('0x1d'));}}else{return _0x28501e;}}function respondWithRpcPromise(_0x2bd52c,_0x118193,_0x5ac663,_0x56a13a){return new BPromise(function(_0x1e9fa1,_0x2d0e1a){var _0x38685b=_0x56a13a||client;return _0x38685b[_0x1c3a('0x1e')](_0x2bd52c,_0x5ac663)[_0x1c3a('0x1f')](function(_0x353819){logger[_0x1c3a('0x20')]('Dynamics365Account,\x20%s,\x20%s',_0x118193,_0x1c3a('0x21'));logger[_0x1c3a('0x22')](_0x1c3a('0x23'),_0x118193,_0x1c3a('0x21'),JSON['stringify'](_0x353819));if(_0x353819[_0x1c3a('0x24')]){if(_0x353819[_0x1c3a('0x24')][_0x1c3a('0x25')]===0x1f4){logger['error'](_0x1c3a('0x26'),_0x118193,_0x353819[_0x1c3a('0x24')][_0x1c3a('0x27')]);return _0x2d0e1a(_0x353819[_0x1c3a('0x24')][_0x1c3a('0x27')]);}logger[_0x1c3a('0x24')]('Dynamics365Account,\x20%s,\x20%s',_0x118193,_0x353819['error'][_0x1c3a('0x27')]);return _0x1e9fa1(_0x353819[_0x1c3a('0x24')][_0x1c3a('0x27')]);}else{logger[_0x1c3a('0x20')]('Dynamics365Account,\x20%s,\x20%s',_0x118193,_0x1c3a('0x21'));_0x1e9fa1(_0x353819['result'][_0x1c3a('0x27')]);}})['catch'](function(_0x4e7dfd){logger[_0x1c3a('0x24')](_0x1c3a('0x26'),_0x118193,_0x4e7dfd);_0x2d0e1a(_0x4e7dfd);});});}function respondWithStatusCode(_0x1de1c7,_0x41ddff){_0x41ddff=_0x41ddff||0xcc;return function(_0x251d84){if(_0x251d84){return _0x1de1c7[_0x1c3a('0x28')](_0x41ddff);}return _0x1de1c7[_0x1c3a('0x29')](_0x41ddff)[_0x1c3a('0x2a')]();};}function respondWithResult(_0xecdcda,_0x2f3b0c){_0x2f3b0c=_0x2f3b0c||0xc8;return function(_0xc4a6a4){if(_0xc4a6a4){return _0xecdcda[_0x1c3a('0x29')](_0x2f3b0c)[_0x1c3a('0x2b')](_0xc4a6a4);}};}function respondWithFilteredResult(_0x412eab,_0x3e7a30){return function(_0x5e1df2){if(_0x5e1df2){var _0x2c6013=_0x5e1df2['count'],_0x213edb=_0x3e7a30[_0x1c3a('0x2c')],_0x427fc8=_0x3e7a30[_0x1c3a('0x2c')]+_0x3e7a30[_0x1c3a('0x2d')],_0x570f98;if(_0x427fc8>=_0x2c6013){_0x427fc8=_0x2c6013;_0x570f98=0xc8;}else{_0x570f98=0xce;}_0x412eab['status'](_0x570f98);return _0x412eab[_0x1c3a('0x2e')](_0x1c3a('0x2f'),_0x213edb+'-'+_0x427fc8+'/'+_0x2c6013)[_0x1c3a('0x2b')](_0x5e1df2);}return null;};}function patchUpdates(_0x165dea){return function(_0x525b41){try{jsonpatch[_0x1c3a('0x30')](_0x525b41,_0x165dea,!![]);}catch(_0x21973c){return BPromise[_0x1c3a('0x31')](_0x21973c);}return _0x525b41[_0x1c3a('0x32')]();};}function saveUpdates(_0x2ef61d,_0x12c099){return function(_0x40932d){if(_0x40932d){return _0x40932d[_0x1c3a('0x33')](_0x2ef61d)['then'](function(_0x3d0448){return _0x3d0448;});}return null;};}function removeEntity(_0x3861d5,_0x4e9839){return function(_0x12bf0b){if(_0x12bf0b){return _0x12bf0b[_0x1c3a('0x34')]()[_0x1c3a('0x1f')](function(){_0x3861d5[_0x1c3a('0x29')](0xcc)[_0x1c3a('0x2a')]();});}};}function handleEntityNotFound(_0x70bc65,_0x457193){return function(_0x1b61bd){if(!_0x1b61bd){_0x70bc65[_0x1c3a('0x28')](0x194);}return _0x1b61bd;};}function handleError(_0xe6ae30,_0x514bfd){_0x514bfd=_0x514bfd||0x1f4;return function(_0x486ed5){logger[_0x1c3a('0x24')](_0x486ed5[_0x1c3a('0x35')]);if(_0x486ed5[_0x1c3a('0x36')]){delete _0x486ed5[_0x1c3a('0x36')];}_0xe6ae30[_0x1c3a('0x29')](_0x514bfd)[_0x1c3a('0x37')](_0x486ed5);};}exports[_0x1c3a('0x38')]=function(_0x175831,_0x436bd3){var _0x16bafe={},_0x5b1c70={},_0xddf554={'count':0x0,'rows':[]};var _0xae2403=_['map'](db['Dynamics365Account'][_0x1c3a('0x39')],function(_0x8f959){return{'name':_0x8f959[_0x1c3a('0x3a')],'type':_0x8f959['type'][_0x1c3a('0x3b')]};});_0x5b1c70[_0x1c3a('0x3c')]=_[_0x1c3a('0x3d')](_0xae2403,_0x1c3a('0x36'));_0x5b1c70['query']=_[_0x1c3a('0x3e')](_0x175831[_0x1c3a('0x3f')]);_0x5b1c70['filters']=_[_0x1c3a('0x40')](_0x5b1c70[_0x1c3a('0x3c')],_0x5b1c70[_0x1c3a('0x3f')]);_0x16bafe[_0x1c3a('0x41')]=_['intersection'](_0x5b1c70[_0x1c3a('0x3c')],qs['fields'](_0x175831[_0x1c3a('0x3f')][_0x1c3a('0x42')]));_0x16bafe[_0x1c3a('0x41')]=_0x16bafe[_0x1c3a('0x41')][_0x1c3a('0x43')]?_0x16bafe[_0x1c3a('0x41')]:_0x5b1c70[_0x1c3a('0x3c')];if(!_0x175831[_0x1c3a('0x3f')]['hasOwnProperty'](_0x1c3a('0x44'))){_0x16bafe['limit']=qs[_0x1c3a('0x2d')](_0x175831[_0x1c3a('0x3f')][_0x1c3a('0x2d')]);_0x16bafe['offset']=qs[_0x1c3a('0x2c')](_0x175831['query'][_0x1c3a('0x2c')]);}_0x16bafe[_0x1c3a('0x45')]=qs[_0x1c3a('0x46')](_0x175831[_0x1c3a('0x3f')][_0x1c3a('0x46')]);_0x16bafe[_0x1c3a('0x47')]=qs['filters'](_['pick'](_0x175831[_0x1c3a('0x3f')],_0x5b1c70[_0x1c3a('0x48')]));if(_0x175831[_0x1c3a('0x3f')][_0x1c3a('0x49')]){_0x16bafe['where']=_['merge'](_0x16bafe[_0x1c3a('0x47')],{'$or':_[_0x1c3a('0x3d')](_0xae2403,function(_0x360ea9){if(_0x360ea9[_0x1c3a('0x4a')]!==_0x1c3a('0x4b')){var _0x36fdb4={};_0x36fdb4[_0x360ea9[_0x1c3a('0x36')]]={'$like':'%'+_0x175831[_0x1c3a('0x3f')]['filter']+'%'};return _0x36fdb4;}})});}_0x16bafe=_[_0x1c3a('0x4c')]({},_0x16bafe,_0x175831[_0x1c3a('0x4d')]);var _0xa5a061={'where':_0x16bafe[_0x1c3a('0x47')]};return db[_0x1c3a('0x4e')][_0x1c3a('0x4f')](_0xa5a061)[_0x1c3a('0x1f')](function(_0x523846){_0xddf554[_0x1c3a('0x4f')]=_0x523846;if(_0x175831[_0x1c3a('0x3f')]['includeAll']){_0x16bafe[_0x1c3a('0x50')]=[{'all':!![]}];}return db['Dynamics365Account'][_0x1c3a('0x51')](_0x16bafe);})['then'](function(_0x496767){_0xddf554[_0x1c3a('0x52')]=_0x496767;return _0xddf554;})[_0x1c3a('0x1f')](respondWithFilteredResult(_0x436bd3,_0x16bafe))[_0x1c3a('0x53')](handleError(_0x436bd3,null));};exports['show']=function(_0x461230,_0x2f7ba2){var _0x46b7bf={'raw':![],'where':{'id':_0x461230[_0x1c3a('0x54')]['id']}},_0x43a691={};_0x43a691[_0x1c3a('0x3c')]=_[_0x1c3a('0x3e')](db[_0x1c3a('0x4e')][_0x1c3a('0x39')]);_0x43a691['query']=_[_0x1c3a('0x3e')](_0x461230[_0x1c3a('0x3f')]);_0x43a691[_0x1c3a('0x48')]=_['intersection'](_0x43a691[_0x1c3a('0x3c')],_0x43a691[_0x1c3a('0x3f')]);_0x46b7bf[_0x1c3a('0x41')]=_[_0x1c3a('0x40')](_0x43a691['model'],qs['fields'](_0x461230[_0x1c3a('0x3f')]['fields']));_0x46b7bf['attributes']=_0x46b7bf[_0x1c3a('0x41')]['length']?_0x46b7bf['attributes']:_0x43a691['model'];if(_0x461230[_0x1c3a('0x3f')][_0x1c3a('0x55')]){_0x46b7bf['include']=[{'all':!![]}];}_0x46b7bf=_['merge']({},_0x46b7bf,_0x461230['options']);return db['Dynamics365Account'][_0x1c3a('0x56')](_0x46b7bf)[_0x1c3a('0x1f')](handleEntityNotFound(_0x2f7ba2,null))['then'](respondWithResult(_0x2f7ba2,null))[_0x1c3a('0x53')](handleError(_0x2f7ba2,null));};exports[_0x1c3a('0x57')]=function(_0x58f80a,_0x1b5b78){return db['Dynamics365Account']['create'](_0x58f80a[_0x1c3a('0x58')],{})['then'](respondWithResult(_0x1b5b78,0xc9))[_0x1c3a('0x53')](handleError(_0x1b5b78,null));};exports[_0x1c3a('0x33')]=function(_0x1c2930,_0x2832ad){if(_0x1c2930['body']['id']){delete _0x1c2930[_0x1c3a('0x58')]['id'];}return db['Dynamics365Account']['find']({'where':{'id':_0x1c2930[_0x1c3a('0x54')]['id']}})['then'](handleEntityNotFound(_0x2832ad,null))[_0x1c3a('0x1f')](saveUpdates(_0x1c2930[_0x1c3a('0x58')],null))['then'](respondWithResult(_0x2832ad,null))[_0x1c3a('0x53')](handleError(_0x2832ad,null));};exports[_0x1c3a('0x34')]=function(_0x28de50,_0x3e5085){return db[_0x1c3a('0x4e')][_0x1c3a('0x56')]({'where':{'id':_0x28de50[_0x1c3a('0x54')]['id']}})[_0x1c3a('0x1f')](handleEntityNotFound(_0x3e5085,null))[_0x1c3a('0x1f')](removeEntity(_0x3e5085,null))[_0x1c3a('0x53')](handleError(_0x3e5085,null));};exports[_0x1c3a('0x59')]=function(_0x515f9f,_0x6230eb,_0x18e824){var _0xbf0280={};var _0x345565={};var _0x327b16;var _0x5a44aa;return db['Dynamics365Account'][_0x1c3a('0x5a')]({'where':{'id':_0x515f9f['params']['id']}})[_0x1c3a('0x1f')](handleEntityNotFound(_0x6230eb,null))['then'](function(_0x2653c0){if(_0x2653c0){_0x327b16=_0x2653c0;_0x345565[_0x1c3a('0x3c')]=_['keys'](db[_0x1c3a('0x5b')][_0x1c3a('0x39')]);_0x345565[_0x1c3a('0x3f')]=_['keys'](_0x515f9f[_0x1c3a('0x3f')]);_0x345565['filters']=_[_0x1c3a('0x40')](_0x345565[_0x1c3a('0x3c')],_0x345565[_0x1c3a('0x3f')]);_0xbf0280[_0x1c3a('0x41')]=_[_0x1c3a('0x40')](_0x345565[_0x1c3a('0x3c')],qs[_0x1c3a('0x42')](_0x515f9f['query'][_0x1c3a('0x42')]));_0xbf0280['attributes']=_0xbf0280[_0x1c3a('0x41')][_0x1c3a('0x43')]?_0xbf0280[_0x1c3a('0x41')]:_0x345565[_0x1c3a('0x3c')];_0xbf0280[_0x1c3a('0x45')]=qs[_0x1c3a('0x46')](_0x515f9f[_0x1c3a('0x3f')][_0x1c3a('0x46')]);_0xbf0280['where']=qs['filters'](_[_0x1c3a('0x5c')](_0x515f9f[_0x1c3a('0x3f')],_0x345565[_0x1c3a('0x48')]));if(_0x515f9f[_0x1c3a('0x3f')][_0x1c3a('0x49')]){_0xbf0280[_0x1c3a('0x47')]=_[_0x1c3a('0x4c')](_0xbf0280[_0x1c3a('0x47')],{'$or':_[_0x1c3a('0x3d')](_0xbf0280[_0x1c3a('0x41')],function(_0x2be308){var _0x1c2f9a={};_0x1c2f9a[_0x2be308]={'$like':'%'+_0x515f9f[_0x1c3a('0x3f')]['filter']+'%'};return _0x1c2f9a;})});}_0xbf0280=_['merge']({},_0xbf0280,_0x515f9f['options']);return _0x327b16[_0x1c3a('0x59')](_0xbf0280);}})[_0x1c3a('0x1f')](function(_0x5a84a4){if(_0x5a84a4){_0x5a44aa=_0x5a84a4[_0x1c3a('0x43')];if(!_0x515f9f['query'][_0x1c3a('0x5d')](_0x1c3a('0x44'))){_0xbf0280['limit']=qs['limit'](_0x515f9f['query'][_0x1c3a('0x2d')]);_0xbf0280[_0x1c3a('0x2c')]=qs[_0x1c3a('0x2c')](_0x515f9f[_0x1c3a('0x3f')][_0x1c3a('0x2c')]);}return _0x327b16[_0x1c3a('0x59')](_0xbf0280);}})['then'](function(_0x23ceef){if(_0x23ceef){return _0x23ceef?{'count':_0x5a44aa,'rows':_0x23ceef}:null;}})[_0x1c3a('0x1f')](respondWithResult(_0x6230eb,null))[_0x1c3a('0x53')](handleError(_0x6230eb,null));};exports[_0x1c3a('0x5e')]=function(_0x405e20,_0x3624d2,_0x49f397){if(_0x405e20[_0x1c3a('0x58')]['id']){delete _0x405e20['body']['id'];}return db[_0x1c3a('0x4e')][_0x1c3a('0x5a')]({'where':{'id':_0x405e20[_0x1c3a('0x54')]['id']}})[_0x1c3a('0x1f')](handleEntityNotFound(_0x3624d2,null))[_0x1c3a('0x1f')](function(_0x27c010){if(_0x27c010){_0x405e20['body'][_0x1c3a('0x5f')]=_0x27c010['id'];_0x405e20[_0x1c3a('0x58')][_0x1c3a('0x60')]=integrations[_0x1c3a('0x61')](_0x405e20[_0x1c3a('0x58')][_0x1c3a('0x62')],_0x405e20[_0x1c3a('0x58')]['type']);_0x405e20[_0x1c3a('0x58')][_0x1c3a('0x63')]=integrations['getDescriptions'](_0x405e20[_0x1c3a('0x58')]['channel'],_0x405e20['body'][_0x1c3a('0x4a')]);return db['Dynamics365Configuration'][_0x1c3a('0x57')](_0x405e20['body'],{'include':[{'model':db[_0x1c3a('0x64')],'as':_0x1c3a('0x60')},{'model':db[_0x1c3a('0x64')],'as':_0x1c3a('0x63')}]});}return null;})[_0x1c3a('0x1f')](respondWithResult(_0x3624d2,null))[_0x1c3a('0x53')](handleError(_0x3624d2,null));};exports['getFields']=function(_0x3f37eb,_0x4692b1,_0x3bc01c){var _0x288450=_0x3f37eb[_0x1c3a('0x3f')][_0x1c3a('0x65')];var _0xfe2214=_0x288450==='incident'?_0x1c3a('0x66'):_0x1c3a('0x67');var _0x8f5630='';var _0x101a3e='';var _0x315384='';var _0x2e7639='';var _0x4fc490='';var _0x9286af='';var _0x43779e='';var _0x39cd8a='';var _0x6b8047=[_0x1c3a('0x68'),_0x1c3a('0x69'),_0x1c3a('0x6a'),_0x1c3a('0x6b'),_0x1c3a('0x6c'),'subject',_0x1c3a('0x6d'),'regardingobjectid',_0x1c3a('0x6e'),_0x1c3a('0x6f')];var _0x513ffb=[_0x1c3a('0x70'),_0x1c3a('0x71'),_0x1c3a('0x72'),_0x1c3a('0x73'),'contactidname',_0x1c3a('0x74'),_0x1c3a('0x75'),_0x1c3a('0x76'),_0x1c3a('0x77'),_0x1c3a('0x78'),_0x1c3a('0x79'),'createdbyyominame','createdon',_0x1c3a('0x7a'),_0x1c3a('0x7b'),_0x1c3a('0x7c'),_0x1c3a('0x7d'),_0x1c3a('0x7e'),_0x1c3a('0x7f'),_0x1c3a('0x80'),_0x1c3a('0x81'),_0x1c3a('0x82'),'escalatedon',_0x1c3a('0x83'),_0x1c3a('0x84'),'followupby','importsequencenumber',_0x1c3a('0x85'),'kbarticleidname',_0x1c3a('0x86'),'masteridname',_0x1c3a('0x87'),_0x1c3a('0x88'),_0x1c3a('0x89'),_0x1c3a('0x8a'),_0x1c3a('0x8b'),_0x1c3a('0x8c'),'modifiedonbehalfbyyominame',_0x1c3a('0x8d'),_0x1c3a('0x8e'),_0x1c3a('0x8f'),'onholdtime',_0x1c3a('0x90'),'owneridname',_0x1c3a('0x91'),_0x1c3a('0x92'),'parentcaseidname',_0x1c3a('0x93'),'primarycontactidyominame','prioritycodename',_0x1c3a('0x94'),'productserialnumber',_0x1c3a('0x95'),_0x1c3a('0x96'),_0x1c3a('0x97'),_0x1c3a('0x98'),_0x1c3a('0x99'),'sentimentvalue',_0x1c3a('0x9a'),_0x1c3a('0x9b'),_0x1c3a('0x9c'),'statecode','statuscode',_0x1c3a('0x9d'),_0x1c3a('0x9e'),'timezoneruleversionnumber','transactioncurrencyidname','traversedpath',_0x1c3a('0x9f'),_0x1c3a('0xa0')];var _0x29c5fd=_0x6b8047['concat'](_0x513ffb);return db[_0x1c3a('0x4e')][_0x1c3a('0x5a')]({'where':{'id':_0x3f37eb['params']['id']},'attributes':['id','username',_0x1c3a('0xa1'),_0x1c3a('0xa2'),_0x1c3a('0xa3'),'clientId',_0x1c3a('0xa4')]})[_0x1c3a('0x1f')](handleEntityNotFound(_0x4692b1,null))[_0x1c3a('0x1f')](function(_0x424336){if(_0x424336){_0x39cd8a=_0x424336[_0x1c3a('0xa2')];var _0x4daf6d=_0x39cd8a[_0x1c3a('0xa5')](-0x1);if(_0x4daf6d==='/'){_0x39cd8a=_0x39cd8a[_0x1c3a('0xa6')](0x0,_0x39cd8a['lastIndexOf'](_0x4daf6d));}_0x43779e=util['format'](_0x1c3a('0xa7'),_0x39cd8a);var _0x55a6a4={'method':_0x1c3a('0xa8'),'uri':_0x1c3a('0xa9')+_0x424336['tenantId']+'/oauth2/token','form':{'client_id':_0x424336[_0x1c3a('0xaa')],'resource':_0x39cd8a,'username':_0x424336[_0x1c3a('0xab')],'password':_0x424336['password'],'grant_type':'password','client_secret':_0x424336[_0x1c3a('0xa4')]},'json':!![]};return rp(_0x55a6a4);}})['then'](function(_0x5c6a94){_0x9286af=_0x5c6a94[_0x1c3a('0xac')];var _0x56a555={'method':_0x1c3a('0xad'),'uri':encodeURI(_0x43779e+_0x1c3a('0xae')+_0xfe2214+'\x27'),'headers':{'Authorization':_0x1c3a('0xaf')+_0x9286af,'If-None-Match':null,'OData-Version':_0x1c3a('0xb0')},'json':!![]};return rp(_0x56a555);})[_0x1c3a('0x1f')](function(_0x23eac9){var _0x247fdf=_0x23eac9[_0x1c3a('0xb1')][0x0];var _0x1beda2=_0x247fdf[_0x1c3a('0xb2')];var _0x4cf8b4={'method':_0x1c3a('0xad'),'uri':_0x43779e+_0x1c3a('0xb3')+_0x1beda2+_0x1c3a('0xb4'),'headers':{'Authorization':'Bearer\x20'+_0x9286af,'If-None-Match':null,'OData-Version':_0x1c3a('0xb0')},'json':!![]};return rp(_0x4cf8b4);})[_0x1c3a('0x1f')](function(_0x42316d){_0x8f5630=_0x42316d;_0x101a3e=_0x8f5630['Attributes'];_0x101a3e=_[_0x1c3a('0xb5')](_0x101a3e,function(_0x36830b){return!_0x29c5fd[_0x1c3a('0xb6')](_0x36830b[_0x1c3a('0xb7')]);});var _0x3540c8=[];var _0x347f44=[];_0x101a3e[_0x1c3a('0xb8')](function(_0x4c6c10){if(_0x4c6c10['@odata.type']){var _0xc7a518=_0x4c6c10[_0x1c3a('0xb9')][_0x1c3a('0xa6')](_0x4c6c10[_0x1c3a('0xb9')]['lastIndexOf']('.')+0x1);if(_0xc7a518===_0x1c3a('0xba')){_0x3540c8[_0x1c3a('0xbb')](getSelectList(_0x43779e,_0x288450,_0x347f44,_0x8f5630[_0x1c3a('0xb2')],_0x4c6c10['MetadataId'],_0x9286af));}}});return Promise['all'](_0x3540c8);})[_0x1c3a('0x1f')](function(_0xdd4910){_0x315384=_0xdd4910[0x0];var _0x46b770=[];var _0x5c20ba=[];_0x101a3e[_0x1c3a('0xb8')](function(_0x11585c){if(!_['isNil'](_0x11585c[_0x1c3a('0xb9')])){var _0x5f5a03=_0x11585c[_0x1c3a('0xb9')][_0x1c3a('0xa6')](_0x11585c[_0x1c3a('0xb9')][_0x1c3a('0xbc')]('.')+0x1);if(_0x5f5a03===_0x1c3a('0xbd')){_0x46b770['push'](getBooleanList(_0x43779e,_0x288450,_0x5c20ba,_0x8f5630[_0x1c3a('0xb2')],_0x11585c[_0x1c3a('0xb2')],_0x9286af));}}});return Promise[_0x1c3a('0xbe')](_0x46b770);})['then'](function(_0x5a82f5){_0x2e7639=_0x5a82f5[0x0];var _0x4892a3=[];var _0x5f0633=[];_0x101a3e[_0x1c3a('0xb8')](function(_0x1beb0e){if(_0x1beb0e[_0x1c3a('0xb9')]){var _0x3eb93e=_0x1beb0e[_0x1c3a('0xb9')][_0x1c3a('0xa6')](_0x1beb0e[_0x1c3a('0xb9')][_0x1c3a('0xbc')]('.')+0x1);if(_0x3eb93e==='StringAttributeMetadata'||_0x3eb93e===_0x1c3a('0xbf')||_0x3eb93e===_0x1c3a('0xc0')||_0x3eb93e==='IntegerAttributeMetadata'||_0x3eb93e==='MemoAttributeMetadata'||_0x3eb93e===_0x1c3a('0xc1')||_0x3eb93e==='StatusAttributeMetadata'||_0x3eb93e===_0x1c3a('0xc2')||_0x3eb93e===_0x1c3a('0xc3')||_0x3eb93e===_0x1c3a('0xc4')){_0x4892a3['push'](getInputList(_0x43779e,_0x288450,_0x3eb93e,_0x5f0633,_0x8f5630['MetadataId'],_0x1beb0e[_0x1c3a('0xb2')],_0x9286af));}}});return Promise[_0x1c3a('0xbe')](_0x4892a3);})[_0x1c3a('0x1f')](function(_0x44dcb2){_0x4fc490=_0x44dcb2[0x0];var _0x27253f=_0x315384[_0x1c3a('0xc5')](_0x2e7639)[_0x1c3a('0xc5')](_0x4fc490);var _0x576f93={'count':_0x27253f[_0x1c3a('0x43')],'rows':_0x27253f};return _0x576f93;})[_0x1c3a('0x1f')](respondWithResult(_0x4692b1,null))[_0x1c3a('0x53')](function(_0x49541c){var _0x2da754=_0x3f37eb[_0x1c3a('0x3f')][_0x1c3a('0x1a')]?0x1f4:_0x49541c[_0x1c3a('0xc6')]||0x1f4;logger[_0x1c3a('0x24')](_0x49541c[_0x1c3a('0x35')]);delete _0x49541c['name'];if(_0x2da754===0x191){_0x2da754=0x190;}_0x4692b1[_0x1c3a('0x29')](_0x2da754)[_0x1c3a('0x37')](_0x3f37eb['query'][_0x1c3a('0x1a')]?{'message':_0x1c3a('0xc7'),'statusCode':_0x49541c['statusCode']}:_0x49541c);});};function getSelectList(_0x370524,_0x445514,_0x4fb10e,_0x1b9ebc,_0x3478ff,_0x2d8cb5){var _0x5448ef={'method':_0x1c3a('0xad'),'uri':_0x370524+'EntityDefinitions('+_0x1b9ebc+')/Attributes('+_0x3478ff+_0x1c3a('0xc8')+_0x1c3a('0xc9'),'headers':{'Authorization':_0x1c3a('0xaf')+_0x2d8cb5,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5448ef)[_0x1c3a('0x1f')](function(_0x5b849a){var _0x3f47d1=[];var _0x90a4f6=_0x5b849a[_0x1c3a('0xca')]['Options'];_0x90a4f6[_0x1c3a('0xb8')](function(_0x583be3){_0x3f47d1['push']({'name':_0x583be3[_0x1c3a('0xcb')][_0x1c3a('0xcc')]['Label'],'value':String(_0x583be3[_0x1c3a('0xcd')])});});var _0x15571c={'id':_0x445514+'_'+_0x5b849a[_0x1c3a('0xb7')],'name':_0x5b849a[_0x1c3a('0xce')][_0x1c3a('0xcc')][_0x1c3a('0xcb')],'custom':![],'options':_0x3f47d1};_0x4fb10e['push'](_0x15571c);return _0x4fb10e;});}function getBooleanList(_0x40a953,_0x2da778,_0x820e8c,_0x91384f,_0x2fa147,_0x3966ac){var _0x59a141={'method':'GET','uri':_0x40a953+_0x1c3a('0xb3')+_0x91384f+_0x1c3a('0xcf')+_0x2fa147+_0x1c3a('0xd0'),'headers':{'Authorization':_0x1c3a('0xaf')+_0x3966ac,'If-None-Match':null,'OData-Version':_0x1c3a('0xb0')},'json':!![]};return rp(_0x59a141)[_0x1c3a('0x1f')](function(_0x31d6f9){var _0x8ef7e=[];_0x8ef7e['push']({'name':_0x31d6f9[_0x1c3a('0xca')][_0x1c3a('0xd1')]['Label'][_0x1c3a('0xcc')][_0x1c3a('0xcb')],'value':'true'},{'name':_0x31d6f9[_0x1c3a('0xca')]['FalseOption'][_0x1c3a('0xcb')][_0x1c3a('0xcc')][_0x1c3a('0xcb')],'value':_0x1c3a('0xd2')});var _0x4591c9={'id':_0x2da778+'_'+_0x31d6f9[_0x1c3a('0xb7')],'name':_0x31d6f9[_0x1c3a('0xce')][_0x1c3a('0xcc')][_0x1c3a('0xcb')],'custom':![],'options':_0x8ef7e};_0x820e8c[_0x1c3a('0xbb')](_0x4591c9);return _0x820e8c;});}function getInputList(_0x1e5a70,_0x264c7f,_0x227e3b,_0x4fbf6f,_0x3d80bb,_0x49c983,_0x244d67){var _0x28654a={'method':_0x1c3a('0xad'),'uri':_0x1e5a70+_0x1c3a('0xb3')+_0x3d80bb+_0x1c3a('0xcf')+_0x49c983+_0x1c3a('0xd3')+_0x227e3b+_0x1c3a('0xd4'),'headers':{'Authorization':_0x1c3a('0xaf')+_0x244d67,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x28654a)[_0x1c3a('0x1f')](function(_0x208b2a){var _0x2afaa9={'id':_0x264c7f+'_'+_0x208b2a[_0x1c3a('0xb7')],'name':_0x208b2a[_0x1c3a('0xce')][_0x1c3a('0xcc')]?_0x208b2a['DisplayName'][_0x1c3a('0xcc')][_0x1c3a('0xcb')]:_0x208b2a[_0x1c3a('0xb7')],'custom':![],'options':[]};_0x4fbf6f[_0x1c3a('0xbb')](_0x2afaa9);return _0x4fbf6f;});} \ No newline at end of file +var _0x2ce9=['contractidname','createdbyexternalpartyname','createdbyname','createdbyyominame','createdonbehalfbyname','createdonbehalfbyyominame','customeridtype','emailaddress','entitlementidname','entityimage_timestamp','escalatedon','firstresponsebykpiidname','followupby','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','prioritycodename','productserialnumber','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','transactioncurrencyidname','utcconversiontimezonecode','versionnumber','remoteUri','tenantId','clientId','clientSecret','slice','substring','lastIndexOf','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','/oauth2/token','username','access_token','Bearer\x20','value','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','4.0','Attributes','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','MetadataId','all','isNil','BooleanAttributeMetadata','push','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','concat','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Label','UserLocalizedLabel','Value','DisplayName','TrueOption','true','FalseOption','false','?$select=DisplayName,LogicalName','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','Dynamics365Account,\x20%s,\x20%s','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','json','count','offset','limit','set','apply','reject','save','destroy','end','stack','name','send','index','rawAttributes','type','key','map','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','filter','merge','Dynamics365Account','includeAll','findAll','show','params','length','include','options','find','create','body','update','Dynamics365Configuration','pick','getConfigurations','hasOwnProperty','findOne','AccountId','Subjects','Descriptions','getDescriptions','channel','Dynamics365Field','getFields','incident','Incident','PhoneCall','title','description','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','accountidname','accountidyominame','billedserviceunits','contractdetailidname'];(function(_0x10d02a,_0x3890d2){var _0x516dbe=function(_0x490af0){while(--_0x490af0){_0x10d02a['push'](_0x10d02a['shift']());}};_0x516dbe(++_0x3890d2);}(_0x2ce9,0x65));var _0x92ce=function(_0x3cea78,_0x4a6751){_0x3cea78=_0x3cea78-0x0;var _0x33b66b=_0x2ce9[_0x3cea78];return _0x33b66b;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x92ce('0x0'));var zipdir=require(_0x92ce('0x1'));var jsonpatch=require(_0x92ce('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x92ce('0x3'));var Mustache=require(_0x92ce('0x4'));var util=require('util');var path=require(_0x92ce('0x5'));var sox=require('sox');var csv=require(_0x92ce('0x6'));var ejs=require(_0x92ce('0x7'));var fs=require('fs');var _=require(_0x92ce('0x8'));var squel=require(_0x92ce('0x9'));var crypto=require(_0x92ce('0xa'));var jsforce=require(_0x92ce('0xb'));var deskjs=require(_0x92ce('0xc'));var toCsv=require('to-csv');var querystring=require(_0x92ce('0xd'));var Papa=require('papaparse');var Redis=require(_0x92ce('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x92ce('0xf'));var logger=require(_0x92ce('0x10'))(_0x92ce('0x11'));var utils=require('../../config/utils');var config=require(_0x92ce('0x12'));var db=require('../../mysqldb')['db'];var integrations=require(_0x92ce('0x13'));var jayson=require(_0x92ce('0x14'));var client=jayson[_0x92ce('0x15')][_0x92ce('0x16')]({'port':0x232a});function checkPasswordPattern(_0x308106,_0x29e062,_0x3378de){if(_0x3378de){var _0x3367a5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3367a5[_0x92ce('0x17')](_0x29e062)){return _0x308106;}else{throw new db[(_0x92ce('0x18'))][(_0x92ce('0x19'))](_0x92ce('0x1a'));}}else{return _0x308106;}}function respondWithRpcPromise(_0xdc8921,_0xc339d7,_0x1da0ef,_0x319caf){return new BPromise(function(_0x10088e,_0x4d6ad5){var _0x2bdb19=_0x319caf||client;return _0x2bdb19[_0x92ce('0x1b')](_0xdc8921,_0x1da0ef)[_0x92ce('0x1c')](function(_0x46f465){logger['info'](_0x92ce('0x1d'),_0xc339d7,'request\x20sent');logger[_0x92ce('0x1e')](_0x92ce('0x1f'),_0xc339d7,_0x92ce('0x20'),JSON[_0x92ce('0x21')](_0x46f465));if(_0x46f465[_0x92ce('0x22')]){if(_0x46f465['error'][_0x92ce('0x23')]===0x1f4){logger[_0x92ce('0x22')](_0x92ce('0x1d'),_0xc339d7,_0x46f465[_0x92ce('0x22')]['message']);return _0x4d6ad5(_0x46f465['error'][_0x92ce('0x24')]);}logger[_0x92ce('0x22')]('Dynamics365Account,\x20%s,\x20%s',_0xc339d7,_0x46f465['error'][_0x92ce('0x24')]);return _0x10088e(_0x46f465['error'][_0x92ce('0x24')]);}else{logger[_0x92ce('0x25')]('Dynamics365Account,\x20%s,\x20%s',_0xc339d7,_0x92ce('0x20'));_0x10088e(_0x46f465[_0x92ce('0x26')]['message']);}})[_0x92ce('0x27')](function(_0x1dae3b){logger[_0x92ce('0x22')]('Dynamics365Account,\x20%s,\x20%s',_0xc339d7,_0x1dae3b);_0x4d6ad5(_0x1dae3b);});});}function respondWithStatusCode(_0x56ab0f,_0x569efb){_0x569efb=_0x569efb||0xcc;return function(_0x5eda79){if(_0x5eda79){return _0x56ab0f[_0x92ce('0x28')](_0x569efb);}return _0x56ab0f[_0x92ce('0x29')](_0x569efb)['end']();};}function respondWithResult(_0x45a326,_0x2ace96){_0x2ace96=_0x2ace96||0xc8;return function(_0x1c923d){if(_0x1c923d){return _0x45a326[_0x92ce('0x29')](_0x2ace96)[_0x92ce('0x2a')](_0x1c923d);}};}function respondWithFilteredResult(_0x289c07,_0xaf1108){return function(_0x17a20b){if(_0x17a20b){var _0x459ca4=_0x17a20b[_0x92ce('0x2b')],_0x258bb2=_0xaf1108[_0x92ce('0x2c')],_0x1d9ced=_0xaf1108[_0x92ce('0x2c')]+_0xaf1108[_0x92ce('0x2d')],_0x3d8f68;if(_0x1d9ced>=_0x459ca4){_0x1d9ced=_0x459ca4;_0x3d8f68=0xc8;}else{_0x3d8f68=0xce;}_0x289c07['status'](_0x3d8f68);return _0x289c07[_0x92ce('0x2e')]('Content-Range',_0x258bb2+'-'+_0x1d9ced+'/'+_0x459ca4)[_0x92ce('0x2a')](_0x17a20b);}return null;};}function patchUpdates(_0x1f4253){return function(_0x4edbfb){try{jsonpatch[_0x92ce('0x2f')](_0x4edbfb,_0x1f4253,!![]);}catch(_0x3dc17b){return BPromise[_0x92ce('0x30')](_0x3dc17b);}return _0x4edbfb[_0x92ce('0x31')]();};}function saveUpdates(_0xbdd9d4,_0x478f2e){return function(_0x56358e){if(_0x56358e){return _0x56358e['update'](_0xbdd9d4)['then'](function(_0x2e564e){return _0x2e564e;});}return null;};}function removeEntity(_0x2e7bb,_0x42ab69){return function(_0x33c070){if(_0x33c070){return _0x33c070[_0x92ce('0x32')]()[_0x92ce('0x1c')](function(){_0x2e7bb['status'](0xcc)[_0x92ce('0x33')]();});}};}function handleEntityNotFound(_0x14c10a,_0x1b971f){return function(_0x1d5228){if(!_0x1d5228){_0x14c10a['sendStatus'](0x194);}return _0x1d5228;};}function handleError(_0x431c95,_0x136b6f){_0x136b6f=_0x136b6f||0x1f4;return function(_0x28ac0a){logger[_0x92ce('0x22')](_0x28ac0a[_0x92ce('0x34')]);if(_0x28ac0a[_0x92ce('0x35')]){delete _0x28ac0a[_0x92ce('0x35')];}_0x431c95[_0x92ce('0x29')](_0x136b6f)[_0x92ce('0x36')](_0x28ac0a);};}exports[_0x92ce('0x37')]=function(_0x334959,_0x5f2a34){var _0xbc3c52={},_0x235d77={},_0x1382d1={'count':0x0,'rows':[]};var _0x51de8c=_['map'](db['Dynamics365Account'][_0x92ce('0x38')],function(_0x528f51){return{'name':_0x528f51['fieldName'],'type':_0x528f51[_0x92ce('0x39')][_0x92ce('0x3a')]};});_0x235d77['model']=_[_0x92ce('0x3b')](_0x51de8c,'name');_0x235d77[_0x92ce('0x3c')]=_[_0x92ce('0x3d')](_0x334959['query']);_0x235d77[_0x92ce('0x3e')]=_[_0x92ce('0x3f')](_0x235d77[_0x92ce('0x40')],_0x235d77['query']);_0xbc3c52[_0x92ce('0x41')]=_[_0x92ce('0x3f')](_0x235d77[_0x92ce('0x40')],qs[_0x92ce('0x42')](_0x334959[_0x92ce('0x3c')]['fields']));_0xbc3c52[_0x92ce('0x41')]=_0xbc3c52[_0x92ce('0x41')]['length']?_0xbc3c52[_0x92ce('0x41')]:_0x235d77[_0x92ce('0x40')];if(!_0x334959['query']['hasOwnProperty'](_0x92ce('0x43'))){_0xbc3c52[_0x92ce('0x2d')]=qs[_0x92ce('0x2d')](_0x334959[_0x92ce('0x3c')]['limit']);_0xbc3c52[_0x92ce('0x2c')]=qs[_0x92ce('0x2c')](_0x334959[_0x92ce('0x3c')][_0x92ce('0x2c')]);}_0xbc3c52[_0x92ce('0x44')]=qs['sort'](_0x334959[_0x92ce('0x3c')][_0x92ce('0x45')]);_0xbc3c52[_0x92ce('0x46')]=qs[_0x92ce('0x3e')](_['pick'](_0x334959[_0x92ce('0x3c')],_0x235d77[_0x92ce('0x3e')]));if(_0x334959[_0x92ce('0x3c')][_0x92ce('0x47')]){_0xbc3c52[_0x92ce('0x46')]=_[_0x92ce('0x48')](_0xbc3c52[_0x92ce('0x46')],{'$or':_['map'](_0x51de8c,function(_0x256d2d){if(_0x256d2d[_0x92ce('0x39')]!=='VIRTUAL'){var _0x36afb4={};_0x36afb4[_0x256d2d[_0x92ce('0x35')]]={'$like':'%'+_0x334959['query'][_0x92ce('0x47')]+'%'};return _0x36afb4;}})});}_0xbc3c52=_['merge']({},_0xbc3c52,_0x334959['options']);var _0xf54f5={'where':_0xbc3c52[_0x92ce('0x46')]};return db[_0x92ce('0x49')][_0x92ce('0x2b')](_0xf54f5)[_0x92ce('0x1c')](function(_0x8e7c75){_0x1382d1[_0x92ce('0x2b')]=_0x8e7c75;if(_0x334959['query'][_0x92ce('0x4a')]){_0xbc3c52['include']=[{'all':!![]}];}return db[_0x92ce('0x49')][_0x92ce('0x4b')](_0xbc3c52);})[_0x92ce('0x1c')](function(_0x3da276){_0x1382d1['rows']=_0x3da276;return _0x1382d1;})[_0x92ce('0x1c')](respondWithFilteredResult(_0x5f2a34,_0xbc3c52))[_0x92ce('0x27')](handleError(_0x5f2a34,null));};exports[_0x92ce('0x4c')]=function(_0x4a4f0f,_0x4c22dd){var _0x18e3b6={'raw':![],'where':{'id':_0x4a4f0f[_0x92ce('0x4d')]['id']}},_0x3cd04a={};_0x3cd04a[_0x92ce('0x40')]=_[_0x92ce('0x3d')](db['Dynamics365Account']['rawAttributes']);_0x3cd04a[_0x92ce('0x3c')]=_[_0x92ce('0x3d')](_0x4a4f0f[_0x92ce('0x3c')]);_0x3cd04a[_0x92ce('0x3e')]=_[_0x92ce('0x3f')](_0x3cd04a[_0x92ce('0x40')],_0x3cd04a[_0x92ce('0x3c')]);_0x18e3b6[_0x92ce('0x41')]=_[_0x92ce('0x3f')](_0x3cd04a['model'],qs[_0x92ce('0x42')](_0x4a4f0f[_0x92ce('0x3c')][_0x92ce('0x42')]));_0x18e3b6[_0x92ce('0x41')]=_0x18e3b6[_0x92ce('0x41')][_0x92ce('0x4e')]?_0x18e3b6[_0x92ce('0x41')]:_0x3cd04a[_0x92ce('0x40')];if(_0x4a4f0f[_0x92ce('0x3c')][_0x92ce('0x4a')]){_0x18e3b6[_0x92ce('0x4f')]=[{'all':!![]}];}_0x18e3b6=_[_0x92ce('0x48')]({},_0x18e3b6,_0x4a4f0f[_0x92ce('0x50')]);return db['Dynamics365Account'][_0x92ce('0x51')](_0x18e3b6)[_0x92ce('0x1c')](handleEntityNotFound(_0x4c22dd,null))[_0x92ce('0x1c')](respondWithResult(_0x4c22dd,null))[_0x92ce('0x27')](handleError(_0x4c22dd,null));};exports[_0x92ce('0x52')]=function(_0x554031,_0x2084f5){return db[_0x92ce('0x49')][_0x92ce('0x52')](_0x554031[_0x92ce('0x53')],{})[_0x92ce('0x1c')](respondWithResult(_0x2084f5,0xc9))[_0x92ce('0x27')](handleError(_0x2084f5,null));};exports[_0x92ce('0x54')]=function(_0x32f9b5,_0x253792){if(_0x32f9b5['body']['id']){delete _0x32f9b5[_0x92ce('0x53')]['id'];}return db['Dynamics365Account'][_0x92ce('0x51')]({'where':{'id':_0x32f9b5[_0x92ce('0x4d')]['id']}})['then'](handleEntityNotFound(_0x253792,null))[_0x92ce('0x1c')](saveUpdates(_0x32f9b5[_0x92ce('0x53')],null))[_0x92ce('0x1c')](respondWithResult(_0x253792,null))[_0x92ce('0x27')](handleError(_0x253792,null));};exports[_0x92ce('0x32')]=function(_0x14b397,_0x8ba05c){return db[_0x92ce('0x49')]['find']({'where':{'id':_0x14b397[_0x92ce('0x4d')]['id']}})[_0x92ce('0x1c')](handleEntityNotFound(_0x8ba05c,null))[_0x92ce('0x1c')](removeEntity(_0x8ba05c,null))['catch'](handleError(_0x8ba05c,null));};exports['getConfigurations']=function(_0x18e5c4,_0x10dc63,_0x281856){var _0x32434f={};var _0x344955={};var _0x4101ef;var _0x3b8268;return db[_0x92ce('0x49')]['findOne']({'where':{'id':_0x18e5c4['params']['id']}})[_0x92ce('0x1c')](handleEntityNotFound(_0x10dc63,null))['then'](function(_0x4fd4f8){if(_0x4fd4f8){_0x4101ef=_0x4fd4f8;_0x344955[_0x92ce('0x40')]=_['keys'](db[_0x92ce('0x55')][_0x92ce('0x38')]);_0x344955[_0x92ce('0x3c')]=_[_0x92ce('0x3d')](_0x18e5c4[_0x92ce('0x3c')]);_0x344955[_0x92ce('0x3e')]=_[_0x92ce('0x3f')](_0x344955[_0x92ce('0x40')],_0x344955[_0x92ce('0x3c')]);_0x32434f[_0x92ce('0x41')]=_[_0x92ce('0x3f')](_0x344955[_0x92ce('0x40')],qs[_0x92ce('0x42')](_0x18e5c4['query'][_0x92ce('0x42')]));_0x32434f['attributes']=_0x32434f[_0x92ce('0x41')][_0x92ce('0x4e')]?_0x32434f[_0x92ce('0x41')]:_0x344955[_0x92ce('0x40')];_0x32434f[_0x92ce('0x44')]=qs[_0x92ce('0x45')](_0x18e5c4[_0x92ce('0x3c')]['sort']);_0x32434f[_0x92ce('0x46')]=qs[_0x92ce('0x3e')](_[_0x92ce('0x56')](_0x18e5c4[_0x92ce('0x3c')],_0x344955['filters']));if(_0x18e5c4['query'][_0x92ce('0x47')]){_0x32434f[_0x92ce('0x46')]=_[_0x92ce('0x48')](_0x32434f[_0x92ce('0x46')],{'$or':_[_0x92ce('0x3b')](_0x32434f[_0x92ce('0x41')],function(_0x15baeb){var _0x4e36e6={};_0x4e36e6[_0x15baeb]={'$like':'%'+_0x18e5c4['query']['filter']+'%'};return _0x4e36e6;})});}_0x32434f=_['merge']({},_0x32434f,_0x18e5c4[_0x92ce('0x50')]);return _0x4101ef[_0x92ce('0x57')](_0x32434f);}})[_0x92ce('0x1c')](function(_0x20fac0){if(_0x20fac0){_0x3b8268=_0x20fac0[_0x92ce('0x4e')];if(!_0x18e5c4['query'][_0x92ce('0x58')](_0x92ce('0x43'))){_0x32434f[_0x92ce('0x2d')]=qs[_0x92ce('0x2d')](_0x18e5c4[_0x92ce('0x3c')][_0x92ce('0x2d')]);_0x32434f['offset']=qs[_0x92ce('0x2c')](_0x18e5c4[_0x92ce('0x3c')][_0x92ce('0x2c')]);}return _0x4101ef[_0x92ce('0x57')](_0x32434f);}})[_0x92ce('0x1c')](function(_0x17a6a0){if(_0x17a6a0){return _0x17a6a0?{'count':_0x3b8268,'rows':_0x17a6a0}:null;}})[_0x92ce('0x1c')](respondWithResult(_0x10dc63,null))[_0x92ce('0x27')](handleError(_0x10dc63,null));};exports['addConfiguration']=function(_0x3f83ea,_0x3b96d8,_0x5837df){if(_0x3f83ea[_0x92ce('0x53')]['id']){delete _0x3f83ea[_0x92ce('0x53')]['id'];}return db['Dynamics365Account'][_0x92ce('0x59')]({'where':{'id':_0x3f83ea[_0x92ce('0x4d')]['id']}})[_0x92ce('0x1c')](handleEntityNotFound(_0x3b96d8,null))[_0x92ce('0x1c')](function(_0x5a94ca){if(_0x5a94ca){_0x3f83ea[_0x92ce('0x53')][_0x92ce('0x5a')]=_0x5a94ca['id'];_0x3f83ea[_0x92ce('0x53')][_0x92ce('0x5b')]=integrations['getSubjects'](_0x3f83ea[_0x92ce('0x53')]['channel'],_0x3f83ea['body']['type']);_0x3f83ea['body'][_0x92ce('0x5c')]=integrations[_0x92ce('0x5d')](_0x3f83ea['body'][_0x92ce('0x5e')],_0x3f83ea[_0x92ce('0x53')][_0x92ce('0x39')]);return db['Dynamics365Configuration']['create'](_0x3f83ea[_0x92ce('0x53')],{'include':[{'model':db[_0x92ce('0x5f')],'as':_0x92ce('0x5b')},{'model':db['Dynamics365Field'],'as':'Descriptions'}]});}return null;})[_0x92ce('0x1c')](respondWithResult(_0x3b96d8,null))['catch'](handleError(_0x3b96d8,null));};exports[_0x92ce('0x60')]=function(_0x1ba559,_0x56c5a6,_0x1ef4a2){var _0x2c15fd=_0x1ba559[_0x92ce('0x3c')]['ticketType'];var _0x440bce=_0x2c15fd===_0x92ce('0x61')?_0x92ce('0x62'):_0x92ce('0x63');var _0x31f31d='';var _0x29cdc0='';var _0x1ccad8='';var _0x350400='';var _0x5480fa='';var _0x355cbe='';var _0x181afa='';var _0x543a45='';var _0x357896=[_0x92ce('0x64'),_0x92ce('0x65'),'customerid',_0x92ce('0x66'),_0x92ce('0x67'),_0x92ce('0x68'),_0x92ce('0x69'),_0x92ce('0x6a'),_0x92ce('0x6b'),'phonecall_activity_parties'];var _0x48d5ef=[_0x92ce('0x6c'),_0x92ce('0x6d'),'actualserviceunits',_0x92ce('0x6e'),'contactidname','contactidyominame',_0x92ce('0x6f'),_0x92ce('0x70'),_0x92ce('0x71'),'createdbyexternalpartyyominame',_0x92ce('0x72'),_0x92ce('0x73'),'createdon',_0x92ce('0x74'),_0x92ce('0x75'),'customeridname',_0x92ce('0x76'),'customeridyominame',_0x92ce('0x77'),_0x92ce('0x78'),_0x92ce('0x79'),'entityimage_url',_0x92ce('0x7a'),'exchangerate',_0x92ce('0x7b'),_0x92ce('0x7c'),'importsequencenumber',_0x92ce('0x7d'),_0x92ce('0x7e'),_0x92ce('0x7f'),_0x92ce('0x80'),_0x92ce('0x81'),_0x92ce('0x82'),_0x92ce('0x83'),_0x92ce('0x84'),_0x92ce('0x85'),_0x92ce('0x86'),_0x92ce('0x87'),_0x92ce('0x88'),_0x92ce('0x89'),_0x92ce('0x8a'),_0x92ce('0x8b'),_0x92ce('0x8c'),_0x92ce('0x8d'),_0x92ce('0x8e'),_0x92ce('0x8f'),_0x92ce('0x90'),_0x92ce('0x91'),'primarycontactidyominame',_0x92ce('0x92'),'productidname',_0x92ce('0x93'),'resolveby',_0x92ce('0x94'),_0x92ce('0x95'),_0x92ce('0x96'),_0x92ce('0x97'),_0x92ce('0x98'),_0x92ce('0x99'),'slaname',_0x92ce('0x9a'),_0x92ce('0x9b'),_0x92ce('0x9c'),_0x92ce('0x9d'),_0x92ce('0x9e'),'timezoneruleversionnumber',_0x92ce('0x9f'),'traversedpath',_0x92ce('0xa0'),_0x92ce('0xa1')];var _0x10bc3d=_0x357896['concat'](_0x48d5ef);return db[_0x92ce('0x49')]['findOne']({'where':{'id':_0x1ba559['params']['id']},'attributes':['id','username','password',_0x92ce('0xa2'),_0x92ce('0xa3'),_0x92ce('0xa4'),_0x92ce('0xa5')]})[_0x92ce('0x1c')](handleEntityNotFound(_0x56c5a6,null))[_0x92ce('0x1c')](function(_0x1bf70b){if(_0x1bf70b){_0x543a45=_0x1bf70b['remoteUri'];var _0x27aa67=_0x543a45[_0x92ce('0xa6')](-0x1);if(_0x27aa67==='/'){_0x543a45=_0x543a45[_0x92ce('0xa7')](0x0,_0x543a45[_0x92ce('0xa8')](_0x27aa67));}_0x181afa=util['format'](_0x92ce('0xa9'),_0x543a45);var _0x4b6ea2={'method':_0x92ce('0xaa'),'uri':_0x92ce('0xab')+_0x1bf70b[_0x92ce('0xa3')]+_0x92ce('0xac'),'form':{'client_id':_0x1bf70b[_0x92ce('0xa4')],'resource':_0x543a45,'username':_0x1bf70b[_0x92ce('0xad')],'password':_0x1bf70b['password'],'grant_type':'password','client_secret':_0x1bf70b[_0x92ce('0xa5')]},'json':!![]};return rp(_0x4b6ea2);}})[_0x92ce('0x1c')](function(_0x142192){_0x355cbe=_0x142192[_0x92ce('0xae')];var _0xdd3e59={'method':'GET','uri':encodeURI(_0x181afa+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x440bce+'\x27'),'headers':{'Authorization':_0x92ce('0xaf')+_0x355cbe,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0xdd3e59);})['then'](function(_0x5c3c39){var _0x28887d=_0x5c3c39[_0x92ce('0xb0')][0x0];var _0x1b98dc=_0x28887d['MetadataId'];var _0x561cf9={'method':_0x92ce('0xb1'),'uri':_0x181afa+_0x92ce('0xb2')+_0x1b98dc+_0x92ce('0xb3'),'headers':{'Authorization':'Bearer\x20'+_0x355cbe,'If-None-Match':null,'OData-Version':_0x92ce('0xb4')},'json':!![]};return rp(_0x561cf9);})[_0x92ce('0x1c')](function(_0x45f054){_0x31f31d=_0x45f054;_0x29cdc0=_0x31f31d[_0x92ce('0xb5')];_0x29cdc0=_[_0x92ce('0xb6')](_0x29cdc0,function(_0x3af85a){return!_0x10bc3d[_0x92ce('0xb7')](_0x3af85a[_0x92ce('0xb8')]);});var _0x57da8f=[];var _0x1081a5=[];_0x29cdc0[_0x92ce('0xb9')](function(_0x1907f4){if(_0x1907f4[_0x92ce('0xba')]){var _0x12112d=_0x1907f4[_0x92ce('0xba')]['substring'](_0x1907f4[_0x92ce('0xba')][_0x92ce('0xa8')]('.')+0x1);if(_0x12112d===_0x92ce('0xbb')){_0x57da8f['push'](getSelectList(_0x181afa,_0x2c15fd,_0x1081a5,_0x31f31d['MetadataId'],_0x1907f4[_0x92ce('0xbc')],_0x355cbe));}}});return Promise[_0x92ce('0xbd')](_0x57da8f);})[_0x92ce('0x1c')](function(_0x176ea0){_0x1ccad8=_0x176ea0[0x0];var _0x2be433=[];var _0x533a11=[];_0x29cdc0[_0x92ce('0xb9')](function(_0x2de7f6){if(!_[_0x92ce('0xbe')](_0x2de7f6[_0x92ce('0xba')])){var _0x26a8c5=_0x2de7f6[_0x92ce('0xba')][_0x92ce('0xa7')](_0x2de7f6[_0x92ce('0xba')][_0x92ce('0xa8')]('.')+0x1);if(_0x26a8c5===_0x92ce('0xbf')){_0x2be433[_0x92ce('0xc0')](getBooleanList(_0x181afa,_0x2c15fd,_0x533a11,_0x31f31d[_0x92ce('0xbc')],_0x2de7f6['MetadataId'],_0x355cbe));}}});return Promise['all'](_0x2be433);})[_0x92ce('0x1c')](function(_0xd76f60){_0x350400=_0xd76f60[0x0];var _0x1b02d8=[];var _0x44834c=[];_0x29cdc0[_0x92ce('0xb9')](function(_0x572e0e){if(_0x572e0e['@odata.type']){var _0x5c1962=_0x572e0e[_0x92ce('0xba')][_0x92ce('0xa7')](_0x572e0e['@odata.type'][_0x92ce('0xa8')]('.')+0x1);if(_0x5c1962==='StringAttributeMetadata'||_0x5c1962==='DoubleAttributeMetadata'||_0x5c1962==='BigIntAttributeMetadata'||_0x5c1962===_0x92ce('0xc1')||_0x5c1962===_0x92ce('0xc2')||_0x5c1962==='DateTimeAttributeMetadata'||_0x5c1962===_0x92ce('0xc3')||_0x5c1962==='EntityNameAttributeMetadata'||_0x5c1962===_0x92ce('0xc4')||_0x5c1962===_0x92ce('0xc5')){_0x1b02d8[_0x92ce('0xc0')](getInputList(_0x181afa,_0x2c15fd,_0x5c1962,_0x44834c,_0x31f31d[_0x92ce('0xbc')],_0x572e0e[_0x92ce('0xbc')],_0x355cbe));}}});return Promise[_0x92ce('0xbd')](_0x1b02d8);})['then'](function(_0x11bdec){_0x5480fa=_0x11bdec[0x0];var _0x55f47c=_0x1ccad8[_0x92ce('0xc6')](_0x350400)[_0x92ce('0xc6')](_0x5480fa);var _0x141c63={'count':_0x55f47c[_0x92ce('0x4e')],'rows':_0x55f47c};return _0x141c63;})[_0x92ce('0x1c')](respondWithResult(_0x56c5a6,null))[_0x92ce('0x27')](function(_0x32a528){var _0x53c473=_0x1ba559[_0x92ce('0x3c')][_0x92ce('0x17')]?0x1f4:_0x32a528[_0x92ce('0xc7')]||0x1f4;logger[_0x92ce('0x22')](_0x32a528[_0x92ce('0x34')]);delete _0x32a528[_0x92ce('0x35')];if(_0x53c473===0x191){_0x53c473=0x190;}_0x56c5a6['status'](_0x53c473)[_0x92ce('0x36')](_0x1ba559[_0x92ce('0x3c')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x32a528[_0x92ce('0xc7')]}:_0x32a528);});};function getSelectList(_0x5d04b7,_0x27dc75,_0x4905a3,_0x4cc292,_0x1d032b,_0x553222){var _0x27bc90={'method':_0x92ce('0xb1'),'uri':_0x5d04b7+_0x92ce('0xb2')+_0x4cc292+_0x92ce('0xc8')+_0x1d032b+_0x92ce('0xc9')+_0x92ce('0xca'),'headers':{'Authorization':_0x92ce('0xaf')+_0x553222,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x27bc90)[_0x92ce('0x1c')](function(_0x4c911f){var _0x1ad116=[];var _0x357241=_0x4c911f[_0x92ce('0xcb')]['Options'];_0x357241[_0x92ce('0xb9')](function(_0x40b1db){_0x1ad116['push']({'name':_0x40b1db[_0x92ce('0xcc')][_0x92ce('0xcd')]['Label'],'value':String(_0x40b1db[_0x92ce('0xce')])});});var _0x57b556={'id':_0x27dc75+'_'+_0x4c911f[_0x92ce('0xb8')],'name':_0x4c911f[_0x92ce('0xcf')][_0x92ce('0xcd')]['Label'],'custom':![],'options':_0x1ad116};_0x4905a3[_0x92ce('0xc0')](_0x57b556);return _0x4905a3;});}function getBooleanList(_0x4939b6,_0x57c546,_0x686534,_0x2e5b16,_0x33249f,_0x1f2b3c){var _0x1e596d={'method':_0x92ce('0xb1'),'uri':_0x4939b6+'EntityDefinitions('+_0x2e5b16+_0x92ce('0xc8')+_0x33249f+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0x92ce('0xaf')+_0x1f2b3c,'If-None-Match':null,'OData-Version':_0x92ce('0xb4')},'json':!![]};return rp(_0x1e596d)[_0x92ce('0x1c')](function(_0x33a121){var _0x5f0d77=[];_0x5f0d77[_0x92ce('0xc0')]({'name':_0x33a121[_0x92ce('0xcb')][_0x92ce('0xd0')][_0x92ce('0xcc')][_0x92ce('0xcd')][_0x92ce('0xcc')],'value':_0x92ce('0xd1')},{'name':_0x33a121[_0x92ce('0xcb')][_0x92ce('0xd2')]['Label'][_0x92ce('0xcd')][_0x92ce('0xcc')],'value':_0x92ce('0xd3')});var _0x24ca46={'id':_0x57c546+'_'+_0x33a121[_0x92ce('0xb8')],'name':_0x33a121[_0x92ce('0xcf')][_0x92ce('0xcd')][_0x92ce('0xcc')],'custom':![],'options':_0x5f0d77};_0x686534[_0x92ce('0xc0')](_0x24ca46);return _0x686534;});}function getInputList(_0x93b7e7,_0x262084,_0x3e2de7,_0x14b9e0,_0x5b4630,_0x3c922e,_0x134c67){var _0x5d4344={'method':_0x92ce('0xb1'),'uri':_0x93b7e7+_0x92ce('0xb2')+_0x5b4630+_0x92ce('0xc8')+_0x3c922e+')/Microsoft.Dynamics.CRM.'+_0x3e2de7+_0x92ce('0xd4'),'headers':{'Authorization':_0x92ce('0xaf')+_0x134c67,'If-None-Match':null,'OData-Version':_0x92ce('0xb4')},'json':!![]};return rp(_0x5d4344)['then'](function(_0x2869ad){var _0x26dd14={'id':_0x262084+'_'+_0x2869ad[_0x92ce('0xb8')],'name':_0x2869ad[_0x92ce('0xcf')]['UserLocalizedLabel']?_0x2869ad['DisplayName']['UserLocalizedLabel'][_0x92ce('0xcc')]:_0x2869ad['LogicalName'],'custom':![],'options':[]};_0x14b9e0[_0x92ce('0xc0')](_0x26dd14);return _0x14b9e0;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 85694aa..340cab7 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 _0x1669=['request-promise','path','rimraf','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','Dynamics365Account','lodash','util','../../config/logger','bluebird'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x1669,0xf9));var _0x9166=function(_0x4c522c,_0x39664d){_0x4c522c=_0x4c522c-0x0;var _0x1ebfa8=_0x1669[_0x4c522c];return _0x1ebfa8;};'use strict';var _=require(_0x9166('0x0'));var util=require(_0x9166('0x1'));var logger=require(_0x9166('0x2'))('api');var moment=require('moment');var BPromise=require(_0x9166('0x3'));var rp=require(_0x9166('0x4'));var fs=require('fs');var path=require(_0x9166('0x5'));var rimraf=require(_0x9166('0x6'));var config=require('../../config/environment');var attributes=require(_0x9166('0x7'));var integrations=require(_0x9166('0x8'));module[_0x9166('0x9')]=function(_0x40d1c3,_0x4c8980){return _0x40d1c3['define'](_0x9166('0xa'),attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x91a6=['api','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','int_dynamics365_accounts','util'];(function(_0x50798b,_0x22ccf8){var _0x4b1d26=function(_0x26107f){while(--_0x26107f){_0x50798b['push'](_0x50798b['shift']());}};_0x4b1d26(++_0x22ccf8);}(_0x91a6,0x77));var _0x691a=function(_0x45407e,_0x47b4e9){_0x45407e=_0x45407e-0x0;var _0x3087fe=_0x91a6[_0x45407e];return _0x3087fe;};'use strict';var _=require('lodash');var util=require(_0x691a('0x0'));var logger=require('../../config/logger')(_0x691a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x691a('0x2'));var config=require(_0x691a('0x3'));var attributes=require('./intDynamics365Account.attributes');var integrations=require(_0x691a('0x4'));module[_0x691a('0x5')]=function(_0x3d66a9,_0x1a6d7a){return _0x3d66a9[_0x691a('0x6')]('Dynamics365Account',attributes,{'tableName':_0x691a('0x7'),'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 8612893..82ba033 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 _0xcf98=['find','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','Dynamics365Account,\x20%s,\x20%s','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','attributes','limit','include','model','map'];(function(_0x5eaa24,_0x551639){var _0x34eb10=function(_0xaf2689){while(--_0xaf2689){_0x5eaa24['push'](_0x5eaa24['shift']());}};_0x34eb10(++_0x551639);}(_0xcf98,0x8d));var _0x8cf9=function(_0x4b3048,_0x45f4fb){_0x4b3048=_0x4b3048-0x0;var _0x229c4f=_0xcf98[_0x4b3048];return _0x229c4f;};'use strict';var _=require('lodash');var util=require(_0x8cf9('0x0'));var moment=require(_0x8cf9('0x1'));var BPromise=require(_0x8cf9('0x2'));var rs=require(_0x8cf9('0x3'));var fs=require('fs');var Redis=require(_0x8cf9('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8cf9('0x5'))(_0x8cf9('0x6'));var config=require(_0x8cf9('0x7'));var jayson=require(_0x8cf9('0x8'));var client=jayson[_0x8cf9('0x9')][_0x8cf9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x23114d,_0x29fb1e,_0x11c3b5){return new BPromise(function(_0x136309,_0x7d48dc){return client['request'](_0x23114d,_0x11c3b5)[_0x8cf9('0xb')](function(_0x982c65){logger['info'](_0x8cf9('0xc'),_0x29fb1e,'request\x20sent');logger[_0x8cf9('0xd')](_0x8cf9('0xe'),_0x29fb1e,_0x8cf9('0xf'),JSON[_0x8cf9('0x10')](_0x982c65));if(_0x982c65[_0x8cf9('0x11')]){if(_0x982c65[_0x8cf9('0x11')][_0x8cf9('0x12')]===0x1f4){logger['error'](_0x8cf9('0xc'),_0x29fb1e,_0x982c65['error']['message']);return _0x7d48dc(_0x982c65['error'][_0x8cf9('0x13')]);}logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x29fb1e,_0x982c65[_0x8cf9('0x11')][_0x8cf9('0x13')]);return _0x136309(_0x982c65[_0x8cf9('0x11')]['message']);}else{logger[_0x8cf9('0x14')](_0x8cf9('0xc'),_0x29fb1e,'request\x20sent');_0x136309(_0x982c65[_0x8cf9('0x15')][_0x8cf9('0x13')]);}})[_0x8cf9('0x16')](function(_0x46a573){logger[_0x8cf9('0x11')](_0x8cf9('0xc'),_0x29fb1e,_0x46a573);_0x7d48dc(_0x46a573);});});}exports[_0x8cf9('0x17')]=function(_0x21efd3){var _0x309866=this;return new Promise(function(_0x3a13b7,_0x873fec){return db[_0x8cf9('0x18')][_0x8cf9('0x19')]({'raw':_0x21efd3[_0x8cf9('0x1a')]?_0x21efd3[_0x8cf9('0x1a')][_0x8cf9('0x1b')]===undefined?!![]:![]:!![],'where':_0x21efd3['options']?_0x21efd3['options'][_0x8cf9('0x1c')]||null:null,'attributes':_0x21efd3['options']?_0x21efd3[_0x8cf9('0x1a')][_0x8cf9('0x1d')]||null:null,'limit':_0x21efd3[_0x8cf9('0x1a')]?_0x21efd3[_0x8cf9('0x1a')][_0x8cf9('0x1e')]||null:null,'include':_0x21efd3[_0x8cf9('0x1a')]?_0x21efd3[_0x8cf9('0x1a')][_0x8cf9('0x1f')]?_['map'](_0x21efd3[_0x8cf9('0x1a')]['include'],function(_0x5be3ae){return{'model':db[_0x5be3ae[_0x8cf9('0x20')]],'as':_0x5be3ae['as'],'attributes':_0x5be3ae[_0x8cf9('0x1d')],'include':_0x5be3ae['include']?_[_0x8cf9('0x21')](_0x5be3ae['include'],function(_0x4d07fa){return{'model':db[_0x4d07fa[_0x8cf9('0x20')]],'as':_0x4d07fa['as'],'attributes':_0x4d07fa[_0x8cf9('0x1d')],'include':_0x4d07fa['include']?_[_0x8cf9('0x21')](_0x4d07fa[_0x8cf9('0x1f')],function(_0x170414){return{'model':db[_0x170414[_0x8cf9('0x20')]],'as':_0x170414['as'],'attributes':_0x170414[_0x8cf9('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x53b580){logger[_0x8cf9('0x14')](_0x8cf9('0x17'),_0x21efd3);logger[_0x8cf9('0xd')](_0x8cf9('0x17'),_0x21efd3,JSON[_0x8cf9('0x10')](_0x53b580));_0x3a13b7(_0x53b580);})[_0x8cf9('0x16')](function(_0x13fa60){logger[_0x8cf9('0x11')](_0x8cf9('0x17'),_0x13fa60['message'],_0x21efd3);_0x873fec(_0x309866['error'](0x1f4,_0x13fa60[_0x8cf9('0x13')]));});});};exports['ShowDynamics365Account']=function(_0x2716c8){var _0x2c2e6e=this;return new Promise(function(_0x2bbd81,_0x443ca1){return db['Dynamics365Account'][_0x8cf9('0x22')]({'raw':_0x2716c8[_0x8cf9('0x1a')]?_0x2716c8[_0x8cf9('0x1a')][_0x8cf9('0x1b')]===undefined?!![]:![]:!![],'where':_0x2716c8[_0x8cf9('0x1a')]?_0x2716c8[_0x8cf9('0x1a')][_0x8cf9('0x1c')]||null:null,'attributes':_0x2716c8['options']?_0x2716c8['options'][_0x8cf9('0x1d')]||null:null,'include':_0x2716c8[_0x8cf9('0x1a')]?_0x2716c8[_0x8cf9('0x1a')][_0x8cf9('0x1f')]?_[_0x8cf9('0x21')](_0x2716c8[_0x8cf9('0x1a')]['include'],function(_0x288990){return{'model':db[_0x288990[_0x8cf9('0x20')]],'as':_0x288990['as'],'attributes':_0x288990[_0x8cf9('0x1d')],'include':_0x288990[_0x8cf9('0x1f')]?_[_0x8cf9('0x21')](_0x288990[_0x8cf9('0x1f')],function(_0x1d37a3){return{'model':db[_0x1d37a3[_0x8cf9('0x20')]],'as':_0x1d37a3['as'],'attributes':_0x1d37a3['attributes'],'include':_0x1d37a3[_0x8cf9('0x1f')]?_[_0x8cf9('0x21')](_0x1d37a3[_0x8cf9('0x1f')],function(_0x4b9cb8){return{'model':db[_0x4b9cb8[_0x8cf9('0x20')]],'as':_0x4b9cb8['as'],'attributes':_0x4b9cb8['attributes']};}):[]};}):[]};}):[]:[]})[_0x8cf9('0xb')](function(_0x5a8c30){logger[_0x8cf9('0x14')]('ShowDynamics365Account',_0x2716c8);logger[_0x8cf9('0xd')]('ShowDynamics365Account',_0x2716c8,JSON[_0x8cf9('0x10')](_0x5a8c30));_0x2bbd81(_0x5a8c30);})['catch'](function(_0x4f318c){logger[_0x8cf9('0x11')]('ShowDynamics365Account',_0x4f318c[_0x8cf9('0x13')],_0x2716c8);_0x443ca1(_0x2c2e6e['error'](0x1f4,_0x4f318c[_0x8cf9('0x13')]));});});}; \ No newline at end of file +var _0x5a43=['randomstring','ioredis','../../mysqldb','jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','limit','include','model','map','attributes','debug','stringify','ShowDynamics365Account','find','lodash','util','moment','bluebird'];(function(_0x252d58,_0x431067){var _0xc5e6ed=function(_0x532c2d){while(--_0x532c2d){_0x252d58['push'](_0x252d58['shift']());}};_0xc5e6ed(++_0x431067);}(_0x5a43,0xf1));var _0x35a4=function(_0x934839,_0x591172){_0x934839=_0x934839-0x0;var _0x20855d=_0x5a43[_0x934839];return _0x20855d;};'use strict';var _=require(_0x35a4('0x0'));var util=require(_0x35a4('0x1'));var moment=require(_0x35a4('0x2'));var BPromise=require(_0x35a4('0x3'));var rs=require(_0x35a4('0x4'));var fs=require('fs');var Redis=require(_0x35a4('0x5'));var db=require(_0x35a4('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x35a4('0x7'));var client=jayson[_0x35a4('0x8')][_0x35a4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1b2bf2,_0x384a3e,_0xa4665e){return new BPromise(function(_0x4cc7a3,_0x38e68f){return client[_0x35a4('0xa')](_0x1b2bf2,_0xa4665e)[_0x35a4('0xb')](function(_0x3e23d6){logger[_0x35a4('0xc')](_0x35a4('0xd'),_0x384a3e,'request\x20sent');logger['debug']('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x384a3e,_0x35a4('0xe'),JSON['stringify'](_0x3e23d6));if(_0x3e23d6[_0x35a4('0xf')]){if(_0x3e23d6[_0x35a4('0xf')][_0x35a4('0x10')]===0x1f4){logger['error'](_0x35a4('0xd'),_0x384a3e,_0x3e23d6[_0x35a4('0xf')][_0x35a4('0x11')]);return _0x38e68f(_0x3e23d6[_0x35a4('0xf')]['message']);}logger[_0x35a4('0xf')](_0x35a4('0xd'),_0x384a3e,_0x3e23d6['error'][_0x35a4('0x11')]);return _0x4cc7a3(_0x3e23d6['error'][_0x35a4('0x11')]);}else{logger[_0x35a4('0xc')](_0x35a4('0xd'),_0x384a3e,_0x35a4('0xe'));_0x4cc7a3(_0x3e23d6[_0x35a4('0x12')][_0x35a4('0x11')]);}})[_0x35a4('0x13')](function(_0x26a97e){logger[_0x35a4('0xf')]('Dynamics365Account,\x20%s,\x20%s',_0x384a3e,_0x26a97e);_0x38e68f(_0x26a97e);});});}exports[_0x35a4('0x14')]=function(_0x41b56c){var _0x199ef3=this;return new Promise(function(_0x61f568,_0x46cc80){return db[_0x35a4('0x15')][_0x35a4('0x16')]({'raw':_0x41b56c[_0x35a4('0x17')]?_0x41b56c['options'][_0x35a4('0x18')]===undefined?!![]:![]:!![],'where':_0x41b56c['options']?_0x41b56c['options'][_0x35a4('0x19')]||null:null,'attributes':_0x41b56c[_0x35a4('0x17')]?_0x41b56c[_0x35a4('0x17')]['attributes']||null:null,'limit':_0x41b56c[_0x35a4('0x17')]?_0x41b56c[_0x35a4('0x17')][_0x35a4('0x1a')]||null:null,'include':_0x41b56c['options']?_0x41b56c[_0x35a4('0x17')][_0x35a4('0x1b')]?_['map'](_0x41b56c[_0x35a4('0x17')][_0x35a4('0x1b')],function(_0x34fc8d){return{'model':db[_0x34fc8d[_0x35a4('0x1c')]],'as':_0x34fc8d['as'],'attributes':_0x34fc8d['attributes'],'include':_0x34fc8d['include']?_[_0x35a4('0x1d')](_0x34fc8d['include'],function(_0x469728){return{'model':db[_0x469728[_0x35a4('0x1c')]],'as':_0x469728['as'],'attributes':_0x469728[_0x35a4('0x1e')],'include':_0x469728[_0x35a4('0x1b')]?_[_0x35a4('0x1d')](_0x469728[_0x35a4('0x1b')],function(_0x503719){return{'model':db[_0x503719['model']],'as':_0x503719['as'],'attributes':_0x503719['attributes']};}):[]};}):[]};}):[]:[]})[_0x35a4('0xb')](function(_0x69b73e){logger['info']('GetDynamics365Account',_0x41b56c);logger[_0x35a4('0x1f')](_0x35a4('0x14'),_0x41b56c,JSON[_0x35a4('0x20')](_0x69b73e));_0x61f568(_0x69b73e);})[_0x35a4('0x13')](function(_0x5d3313){logger['error']('GetDynamics365Account',_0x5d3313['message'],_0x41b56c);_0x46cc80(_0x199ef3[_0x35a4('0xf')](0x1f4,_0x5d3313[_0x35a4('0x11')]));});});};exports[_0x35a4('0x21')]=function(_0x1da508){var _0x2e1985=this;return new Promise(function(_0x160bb5,_0x2e6d5d){return db[_0x35a4('0x15')][_0x35a4('0x22')]({'raw':_0x1da508[_0x35a4('0x17')]?_0x1da508[_0x35a4('0x17')][_0x35a4('0x18')]===undefined?!![]:![]:!![],'where':_0x1da508[_0x35a4('0x17')]?_0x1da508[_0x35a4('0x17')][_0x35a4('0x19')]||null:null,'attributes':_0x1da508[_0x35a4('0x17')]?_0x1da508['options'][_0x35a4('0x1e')]||null:null,'include':_0x1da508[_0x35a4('0x17')]?_0x1da508[_0x35a4('0x17')]['include']?_[_0x35a4('0x1d')](_0x1da508[_0x35a4('0x17')][_0x35a4('0x1b')],function(_0x48245c){return{'model':db[_0x48245c['model']],'as':_0x48245c['as'],'attributes':_0x48245c[_0x35a4('0x1e')],'include':_0x48245c['include']?_[_0x35a4('0x1d')](_0x48245c[_0x35a4('0x1b')],function(_0x274237){return{'model':db[_0x274237['model']],'as':_0x274237['as'],'attributes':_0x274237['attributes'],'include':_0x274237[_0x35a4('0x1b')]?_[_0x35a4('0x1d')](_0x274237[_0x35a4('0x1b')],function(_0x55510a){return{'model':db[_0x55510a[_0x35a4('0x1c')]],'as':_0x55510a['as'],'attributes':_0x55510a[_0x35a4('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x35a4('0xb')](function(_0x368330){logger['info']('ShowDynamics365Account',_0x1da508);logger[_0x35a4('0x1f')](_0x35a4('0x21'),_0x1da508,JSON[_0x35a4('0x20')](_0x368330));_0x160bb5(_0x368330);})[_0x35a4('0x13')](function(_0xba030a){logger['error'](_0x35a4('0x21'),_0xba030a['message'],_0x1da508);_0x2e6d5d(_0x2e1985[_0x35a4('0xf')](0x1f4,_0xba030a['message']));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 0a691b4..c0e054e 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 _0xee88=['util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','multer'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xee88,0x1d3));var _0x8ee8=function(_0x5eebd7,_0x2853c9){_0x5eebd7=_0x5eebd7-0x0;var _0x391fe8=_0xee88[_0x5eebd7];return _0x391fe8;};'use strict';var multer=require(_0x8ee8('0x0'));var util=require(_0x8ee8('0x1'));var path=require(_0x8ee8('0x2'));var timeout=require('connect-timeout');var express=require(_0x8ee8('0x3'));var router=express[_0x8ee8('0x4')]();var auth=require(_0x8ee8('0x5'));var interaction=require(_0x8ee8('0x6'));var config=require(_0x8ee8('0x7'));var controller=require(_0x8ee8('0x8'));router[_0x8ee8('0x9')]('/',auth['isAuthenticated'](),controller[_0x8ee8('0xa')]);router[_0x8ee8('0x9')](_0x8ee8('0xb'),auth[_0x8ee8('0xc')](),controller[_0x8ee8('0xd')]);router[_0x8ee8('0x9')](_0x8ee8('0xe'),auth[_0x8ee8('0xc')](),controller[_0x8ee8('0xf')]);router[_0x8ee8('0x9')]('/:id/subjects',auth[_0x8ee8('0xc')](),controller[_0x8ee8('0x10')]);router['get'](_0x8ee8('0x11'),auth['isAuthenticated'](),controller[_0x8ee8('0x12')]);router[_0x8ee8('0x13')]('/',auth[_0x8ee8('0xc')](),controller[_0x8ee8('0x14')]);router[_0x8ee8('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x8ee8('0x16')]);router[_0x8ee8('0x17')](_0x8ee8('0xb'),auth[_0x8ee8('0xc')](),controller[_0x8ee8('0x18')]);module[_0x8ee8('0x19')]=router; \ No newline at end of file +var _0xb079=['post','create','put','delete','destroy','exports','multer','util','connect-timeout','express','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','index','/:id','isAuthenticated','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions'];(function(_0x1c016b,_0x2bda7e){var _0x46842d=function(_0x359c33){while(--_0x359c33){_0x1c016b['push'](_0x1c016b['shift']());}};_0x46842d(++_0x2bda7e);}(_0xb079,0x166));var _0x9b07=function(_0x234cda,_0x1b0761){_0x234cda=_0x234cda-0x0;var _0xe5eec7=_0xb079[_0x234cda];return _0xe5eec7;};'use strict';var multer=require(_0x9b07('0x0'));var util=require(_0x9b07('0x1'));var path=require('path');var timeout=require(_0x9b07('0x2'));var express=require(_0x9b07('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x9b07('0x4'));var config=require(_0x9b07('0x5'));var controller=require(_0x9b07('0x6'));router[_0x9b07('0x7')]('/',auth['isAuthenticated'](),controller[_0x9b07('0x8')]);router[_0x9b07('0x7')](_0x9b07('0x9'),auth[_0x9b07('0xa')](),controller['show']);router[_0x9b07('0x7')](_0x9b07('0xb'),auth['isAuthenticated'](),controller[_0x9b07('0xc')]);router[_0x9b07('0x7')](_0x9b07('0xd'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x9b07('0x7')](_0x9b07('0xe'),auth[_0x9b07('0xa')](),controller[_0x9b07('0xf')]);router[_0x9b07('0x10')]('/',auth[_0x9b07('0xa')](),controller[_0x9b07('0x11')]);router[_0x9b07('0x12')](_0x9b07('0x9'),auth[_0x9b07('0xa')](),controller['update']);router[_0x9b07('0x13')](_0x9b07('0x9'),auth[_0x9b07('0xa')](),controller[_0x9b07('0x14')]);module[_0x9b07('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 3226136..1e786ab 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 _0x9759=['STRING','ENUM','phonecall','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x9759,0x1db));var _0x9975=function(_0x272575,_0x11fd1f){_0x272575=_0x272575-0x0;var _0x200ce6=_0x9759[_0x272575];return _0x200ce6;};'use strict';var Sequelize=require('sequelize');module[_0x9975('0x0')]={'name':{'type':Sequelize[_0x9975('0x1')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x9975('0x2')]('incident',_0x9975('0x3')),'defaultValue':'incident'}}; \ No newline at end of file +var _0x712f=['phonecall','incident','sequelize','STRING','ENUM'];(function(_0x27153b,_0x32efeb){var _0x399933=function(_0x58348f){while(--_0x58348f){_0x27153b['push'](_0x27153b['shift']());}};_0x399933(++_0x32efeb);}(_0x712f,0xed));var _0xf712=function(_0x1c5b48,_0x2c3999){_0x1c5b48=_0x1c5b48-0x0;var _0x4e4404=_0x712f[_0x1c5b48];return _0x4e4404;};'use strict';var Sequelize=require(_0xf712('0x0'));module['exports']={'name':{'type':Sequelize[_0xf712('0x1')]},'description':{'type':Sequelize[_0xf712('0x1')]},'ticketType':{'type':Sequelize[_0xf712('0x2')]('incident',_0xf712('0x3')),'defaultValue':_0xf712('0x4')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 5ab8ac6..ded2d49 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 _0xdf6c=['keys','filters','intersection','fields','attributes','hasOwnProperty','limit','order','sort','where','merge','VIRTUAL','filter','options','Dynamics365Configuration','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','destroy','findOne','pick','getFields','nolimit','Dynamics365Field','getSubjects','getDescriptions','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','lodash','squel','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','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','info','Dynamics365Configuration,\x20%s,\x20%s','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','status','end','json','count','offset','set','reject','update','then','sendStatus','stack','name','send','index','map','rawAttributes','type','key','model','query'];(function(_0x5b5cde,_0x1f7c5f){var _0x364ad2=function(_0x4a1172){while(--_0x4a1172){_0x5b5cde['push'](_0x5b5cde['shift']());}};_0x364ad2(++_0x1f7c5f);}(_0xdf6c,0x7e));var _0xcdf6=function(_0x32ced2,_0x78b21f){_0x32ced2=_0x32ced2-0x0;var _0x44622c=_0xdf6c[_0x32ced2];return _0x44622c;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xcdf6('0x0'));var zipdir=require(_0xcdf6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcdf6('0x2'));var moment=require(_0xcdf6('0x3'));var BPromise=require(_0xcdf6('0x4'));var Mustache=require(_0xcdf6('0x5'));var util=require('util');var path=require('path');var sox=require(_0xcdf6('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xcdf6('0x7'));var squel=require(_0xcdf6('0x8'));var crypto=require('crypto');var jsforce=require(_0xcdf6('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xcdf6('0xa'));var querystring=require(_0xcdf6('0xb'));var Papa=require(_0xcdf6('0xc'));var Redis=require(_0xcdf6('0xd'));var authService=require(_0xcdf6('0xe'));var qs=require(_0xcdf6('0xf'));var as=require(_0xcdf6('0x10'));var hardwareService=require(_0xcdf6('0x11'));var logger=require(_0xcdf6('0x12'))(_0xcdf6('0x13'));var utils=require(_0xcdf6('0x14'));var config=require(_0xcdf6('0x15'));var db=require(_0xcdf6('0x16'))['db'];var jayson=require(_0xcdf6('0x17'));var client=jayson[_0xcdf6('0x18')][_0xcdf6('0x19')]({'port':0x232a});function checkPasswordPattern(_0x249326,_0x5ad0f6,_0x3f860c){if(_0x3f860c){var _0x26bb55=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x26bb55[_0xcdf6('0x1a')](_0x5ad0f6)){return _0x249326;}else{throw new db[(_0xcdf6('0x1b'))][(_0xcdf6('0x1c'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x249326;}}function respondWithRpcPromise(_0x2c138e,_0x6e0e60,_0x21897d,_0x55a20a){return new BPromise(function(_0x207b01,_0x49fb02){var _0x1d31b3=_0x55a20a||client;return _0x1d31b3['request'](_0x2c138e,_0x21897d)['then'](function(_0x3d87d4){logger[_0xcdf6('0x1d')](_0xcdf6('0x1e'),_0x6e0e60,'request\x20sent');logger['debug'](_0xcdf6('0x1f'),_0x6e0e60,_0xcdf6('0x20'),JSON[_0xcdf6('0x21')](_0x3d87d4));if(_0x3d87d4['error']){if(_0x3d87d4[_0xcdf6('0x22')][_0xcdf6('0x23')]===0x1f4){logger[_0xcdf6('0x22')]('Dynamics365Configuration,\x20%s,\x20%s',_0x6e0e60,_0x3d87d4[_0xcdf6('0x22')]['message']);return _0x49fb02(_0x3d87d4['error'][_0xcdf6('0x24')]);}logger[_0xcdf6('0x22')](_0xcdf6('0x1e'),_0x6e0e60,_0x3d87d4[_0xcdf6('0x22')][_0xcdf6('0x24')]);return _0x207b01(_0x3d87d4[_0xcdf6('0x22')][_0xcdf6('0x24')]);}else{logger[_0xcdf6('0x1d')]('Dynamics365Configuration,\x20%s,\x20%s',_0x6e0e60,_0xcdf6('0x20'));_0x207b01(_0x3d87d4[_0xcdf6('0x25')]['message']);}})['catch'](function(_0x18415e){logger['error'](_0xcdf6('0x1e'),_0x6e0e60,_0x18415e);_0x49fb02(_0x18415e);});});}function respondWithStatusCode(_0x4e545b,_0x565843){_0x565843=_0x565843||0xcc;return function(_0x256e01){if(_0x256e01){return _0x4e545b['sendStatus'](_0x565843);}return _0x4e545b[_0xcdf6('0x26')](_0x565843)[_0xcdf6('0x27')]();};}function respondWithResult(_0x7f905,_0x453fd5){_0x453fd5=_0x453fd5||0xc8;return function(_0x4037fe){if(_0x4037fe){return _0x7f905[_0xcdf6('0x26')](_0x453fd5)[_0xcdf6('0x28')](_0x4037fe);}};}function respondWithFilteredResult(_0x3256f9,_0x40747a){return function(_0xc61c66){if(_0xc61c66){var _0x83bf95=_0xc61c66[_0xcdf6('0x29')],_0x44421a=_0x40747a['offset'],_0x1bf87d=_0x40747a[_0xcdf6('0x2a')]+_0x40747a['limit'],_0x17bb7d;if(_0x1bf87d>=_0x83bf95){_0x1bf87d=_0x83bf95;_0x17bb7d=0xc8;}else{_0x17bb7d=0xce;}_0x3256f9[_0xcdf6('0x26')](_0x17bb7d);return _0x3256f9[_0xcdf6('0x2b')]('Content-Range',_0x44421a+'-'+_0x1bf87d+'/'+_0x83bf95)['json'](_0xc61c66);}return null;};}function patchUpdates(_0x58fffa){return function(_0x52331b){try{jsonpatch['apply'](_0x52331b,_0x58fffa,!![]);}catch(_0x576187){return BPromise[_0xcdf6('0x2c')](_0x576187);}return _0x52331b['save']();};}function saveUpdates(_0x4fb482,_0x4fd29e){return function(_0x332659){if(_0x332659){return _0x332659[_0xcdf6('0x2d')](_0x4fb482)[_0xcdf6('0x2e')](function(_0x205ebe){return _0x205ebe;});}return null;};}function removeEntity(_0x23fea3,_0x1a6289){return function(_0x506154){if(_0x506154){return _0x506154['destroy']()[_0xcdf6('0x2e')](function(){_0x23fea3[_0xcdf6('0x26')](0xcc)[_0xcdf6('0x27')]();});}};}function handleEntityNotFound(_0x240fc2,_0x47614c){return function(_0x43b0e2){if(!_0x43b0e2){_0x240fc2[_0xcdf6('0x2f')](0x194);}return _0x43b0e2;};}function handleError(_0x421e41,_0x331faa){_0x331faa=_0x331faa||0x1f4;return function(_0x169b7a){logger[_0xcdf6('0x22')](_0x169b7a[_0xcdf6('0x30')]);if(_0x169b7a[_0xcdf6('0x31')]){delete _0x169b7a[_0xcdf6('0x31')];}_0x421e41[_0xcdf6('0x26')](_0x331faa)[_0xcdf6('0x32')](_0x169b7a);};}exports[_0xcdf6('0x33')]=function(_0xdb8b00,_0x58f6fd){var _0x45b6b3={},_0x496e7e={},_0x11cc17={'count':0x0,'rows':[]};var _0x428060=_[_0xcdf6('0x34')](db['Dynamics365Configuration'][_0xcdf6('0x35')],function(_0x16f9ad){return{'name':_0x16f9ad['fieldName'],'type':_0x16f9ad[_0xcdf6('0x36')][_0xcdf6('0x37')]};});_0x496e7e[_0xcdf6('0x38')]=_[_0xcdf6('0x34')](_0x428060,'name');_0x496e7e[_0xcdf6('0x39')]=_[_0xcdf6('0x3a')](_0xdb8b00[_0xcdf6('0x39')]);_0x496e7e[_0xcdf6('0x3b')]=_[_0xcdf6('0x3c')](_0x496e7e[_0xcdf6('0x38')],_0x496e7e['query']);_0x45b6b3['attributes']=_['intersection'](_0x496e7e[_0xcdf6('0x38')],qs[_0xcdf6('0x3d')](_0xdb8b00['query']['fields']));_0x45b6b3['attributes']=_0x45b6b3['attributes']['length']?_0x45b6b3[_0xcdf6('0x3e')]:_0x496e7e[_0xcdf6('0x38')];if(!_0xdb8b00[_0xcdf6('0x39')][_0xcdf6('0x3f')]('nolimit')){_0x45b6b3[_0xcdf6('0x40')]=qs[_0xcdf6('0x40')](_0xdb8b00['query'][_0xcdf6('0x40')]);_0x45b6b3[_0xcdf6('0x2a')]=qs[_0xcdf6('0x2a')](_0xdb8b00['query'][_0xcdf6('0x2a')]);}_0x45b6b3[_0xcdf6('0x41')]=qs[_0xcdf6('0x42')](_0xdb8b00['query'][_0xcdf6('0x42')]);_0x45b6b3[_0xcdf6('0x43')]=qs['filters'](_['pick'](_0xdb8b00[_0xcdf6('0x39')],_0x496e7e['filters']));if(_0xdb8b00[_0xcdf6('0x39')]['filter']){_0x45b6b3[_0xcdf6('0x43')]=_[_0xcdf6('0x44')](_0x45b6b3[_0xcdf6('0x43')],{'$or':_[_0xcdf6('0x34')](_0x428060,function(_0xd46efd){if(_0xd46efd[_0xcdf6('0x36')]!==_0xcdf6('0x45')){var _0x426fb6={};_0x426fb6[_0xd46efd[_0xcdf6('0x31')]]={'$like':'%'+_0xdb8b00[_0xcdf6('0x39')][_0xcdf6('0x46')]+'%'};return _0x426fb6;}})});}_0x45b6b3=_[_0xcdf6('0x44')]({},_0x45b6b3,_0xdb8b00[_0xcdf6('0x47')]);var _0x13ef05={'where':_0x45b6b3[_0xcdf6('0x43')]};return db[_0xcdf6('0x48')][_0xcdf6('0x29')](_0x13ef05)[_0xcdf6('0x2e')](function(_0x12a321){_0x11cc17[_0xcdf6('0x29')]=_0x12a321;if(_0xdb8b00[_0xcdf6('0x39')][_0xcdf6('0x49')]){_0x45b6b3[_0xcdf6('0x4a')]=[{'all':!![]}];}return db[_0xcdf6('0x48')][_0xcdf6('0x4b')](_0x45b6b3);})[_0xcdf6('0x2e')](function(_0x4e8f46){_0x11cc17[_0xcdf6('0x4c')]=_0x4e8f46;return _0x11cc17;})['then'](respondWithFilteredResult(_0x58f6fd,_0x45b6b3))[_0xcdf6('0x4d')](handleError(_0x58f6fd,null));};exports[_0xcdf6('0x4e')]=function(_0x3fe4c7,_0x446ee1){var _0x55f040={'raw':![],'where':{'id':_0x3fe4c7['params']['id']}},_0x472e4d={};_0x472e4d[_0xcdf6('0x38')]=_[_0xcdf6('0x3a')](db['Dynamics365Configuration'][_0xcdf6('0x35')]);_0x472e4d[_0xcdf6('0x39')]=_[_0xcdf6('0x3a')](_0x3fe4c7[_0xcdf6('0x39')]);_0x472e4d[_0xcdf6('0x3b')]=_[_0xcdf6('0x3c')](_0x472e4d['model'],_0x472e4d[_0xcdf6('0x39')]);_0x55f040['attributes']=_['intersection'](_0x472e4d['model'],qs[_0xcdf6('0x3d')](_0x3fe4c7[_0xcdf6('0x39')][_0xcdf6('0x3d')]));_0x55f040[_0xcdf6('0x3e')]=_0x55f040[_0xcdf6('0x3e')][_0xcdf6('0x4f')]?_0x55f040['attributes']:_0x472e4d['model'];if(_0x3fe4c7[_0xcdf6('0x39')]['includeAll']){_0x55f040[_0xcdf6('0x4a')]=[{'all':!![]}];}_0x55f040=_[_0xcdf6('0x44')]({},_0x55f040,_0x3fe4c7[_0xcdf6('0x47')]);return db['Dynamics365Configuration'][_0xcdf6('0x50')](_0x55f040)[_0xcdf6('0x2e')](handleEntityNotFound(_0x446ee1,null))[_0xcdf6('0x2e')](respondWithResult(_0x446ee1,null))['catch'](handleError(_0x446ee1,null));};exports[_0xcdf6('0x51')]=function(_0xeb7449,_0x3712eb){return db[_0xcdf6('0x48')][_0xcdf6('0x51')](_0xeb7449[_0xcdf6('0x52')],{})['then'](respondWithResult(_0x3712eb,0xc9))['catch'](handleError(_0x3712eb,null));};exports['update']=function(_0x5dab8b,_0x42312f){if(_0x5dab8b[_0xcdf6('0x52')]['id']){delete _0x5dab8b[_0xcdf6('0x52')]['id'];}return db[_0xcdf6('0x48')][_0xcdf6('0x50')]({'where':{'id':_0x5dab8b[_0xcdf6('0x53')]['id']}})['then'](handleEntityNotFound(_0x42312f,null))['then'](saveUpdates(_0x5dab8b['body'],null))[_0xcdf6('0x2e')](respondWithResult(_0x42312f,null))[_0xcdf6('0x4d')](handleError(_0x42312f,null));};exports[_0xcdf6('0x54')]=function(_0x5a789d,_0x5198f5){return db[_0xcdf6('0x48')][_0xcdf6('0x50')]({'where':{'id':_0x5a789d['params']['id']}})['then'](handleEntityNotFound(_0x5198f5,null))[_0xcdf6('0x2e')](removeEntity(_0x5198f5,null))[_0xcdf6('0x4d')](handleError(_0x5198f5,null));};exports['getFields']=function(_0xbcb56a,_0x49e6aa,_0x5d0da4){var _0x57bbc7={};var _0x3dda3a={};var _0x4eeff1;var _0x489140;return db[_0xcdf6('0x48')][_0xcdf6('0x55')]({'where':{'id':_0xbcb56a['params']['id']}})[_0xcdf6('0x2e')](handleEntityNotFound(_0x49e6aa,null))['then'](function(_0x5481f4){if(_0x5481f4){_0x4eeff1=_0x5481f4;_0x3dda3a[_0xcdf6('0x38')]=_['keys'](db['Dynamics365Field'][_0xcdf6('0x35')]);_0x3dda3a[_0xcdf6('0x39')]=_[_0xcdf6('0x3a')](_0xbcb56a[_0xcdf6('0x39')]);_0x3dda3a[_0xcdf6('0x3b')]=_['intersection'](_0x3dda3a[_0xcdf6('0x38')],_0x3dda3a[_0xcdf6('0x39')]);_0x57bbc7['attributes']=_[_0xcdf6('0x3c')](_0x3dda3a[_0xcdf6('0x38')],qs[_0xcdf6('0x3d')](_0xbcb56a[_0xcdf6('0x39')][_0xcdf6('0x3d')]));_0x57bbc7[_0xcdf6('0x3e')]=_0x57bbc7[_0xcdf6('0x3e')][_0xcdf6('0x4f')]?_0x57bbc7[_0xcdf6('0x3e')]:_0x3dda3a[_0xcdf6('0x38')];_0x57bbc7['order']=qs[_0xcdf6('0x42')](_0xbcb56a[_0xcdf6('0x39')]['sort']);_0x57bbc7[_0xcdf6('0x43')]=qs['filters'](_[_0xcdf6('0x56')](_0xbcb56a['query'],_0x3dda3a[_0xcdf6('0x3b')]));if(_0xbcb56a[_0xcdf6('0x39')][_0xcdf6('0x46')]){_0x57bbc7[_0xcdf6('0x43')]=_[_0xcdf6('0x44')](_0x57bbc7['where'],{'$or':_[_0xcdf6('0x34')](_0x57bbc7[_0xcdf6('0x3e')],function(_0x430536){var _0x53b462={};_0x53b462[_0x430536]={'$like':'%'+_0xbcb56a['query'][_0xcdf6('0x46')]+'%'};return _0x53b462;})});}_0x57bbc7=_[_0xcdf6('0x44')]({},_0x57bbc7,_0xbcb56a[_0xcdf6('0x47')]);return _0x4eeff1[_0xcdf6('0x57')](_0x57bbc7);}})['then'](function(_0x5a5cf7){if(_0x5a5cf7){_0x489140=_0x5a5cf7[_0xcdf6('0x4f')];if(!_0xbcb56a[_0xcdf6('0x39')][_0xcdf6('0x3f')](_0xcdf6('0x58'))){_0x57bbc7['limit']=qs[_0xcdf6('0x40')](_0xbcb56a[_0xcdf6('0x39')]['limit']);_0x57bbc7[_0xcdf6('0x2a')]=qs['offset'](_0xbcb56a[_0xcdf6('0x39')][_0xcdf6('0x2a')]);}return _0x4eeff1[_0xcdf6('0x57')](_0x57bbc7);}})[_0xcdf6('0x2e')](function(_0x2fbbc6){if(_0x2fbbc6){return _0x2fbbc6?{'count':_0x489140,'rows':_0x2fbbc6}:null;}})['then'](respondWithResult(_0x49e6aa,null))[_0xcdf6('0x4d')](handleError(_0x49e6aa,null));};exports['getSubjects']=function(_0x5f128b,_0x399f13,_0x1123af){var _0x1e6020={};var _0x32ad87={};var _0x27a59b;var _0x4ee271;return db[_0xcdf6('0x48')]['findOne']({'where':{'id':_0x5f128b[_0xcdf6('0x53')]['id']}})[_0xcdf6('0x2e')](handleEntityNotFound(_0x399f13,null))[_0xcdf6('0x2e')](function(_0x9c734d){if(_0x9c734d){_0x27a59b=_0x9c734d;_0x32ad87[_0xcdf6('0x38')]=_[_0xcdf6('0x3a')](db[_0xcdf6('0x59')][_0xcdf6('0x35')]);_0x32ad87[_0xcdf6('0x39')]=_[_0xcdf6('0x3a')](_0x5f128b[_0xcdf6('0x39')]);_0x32ad87[_0xcdf6('0x3b')]=_[_0xcdf6('0x3c')](_0x32ad87['model'],_0x32ad87[_0xcdf6('0x39')]);_0x1e6020[_0xcdf6('0x3e')]=_[_0xcdf6('0x3c')](_0x32ad87['model'],qs[_0xcdf6('0x3d')](_0x5f128b[_0xcdf6('0x39')][_0xcdf6('0x3d')]));_0x1e6020[_0xcdf6('0x3e')]=_0x1e6020['attributes']['length']?_0x1e6020[_0xcdf6('0x3e')]:_0x32ad87[_0xcdf6('0x38')];_0x1e6020['order']=qs['sort'](_0x5f128b[_0xcdf6('0x39')][_0xcdf6('0x42')]);_0x1e6020[_0xcdf6('0x43')]=qs[_0xcdf6('0x3b')](_[_0xcdf6('0x56')](_0x5f128b['query'],_0x32ad87[_0xcdf6('0x3b')]));if(_0x5f128b[_0xcdf6('0x39')]['filter']){_0x1e6020['where']=_['merge'](_0x1e6020['where'],{'$or':_[_0xcdf6('0x34')](_0x1e6020[_0xcdf6('0x3e')],function(_0x34ad43){var _0x4e1c1c={};_0x4e1c1c[_0x34ad43]={'$like':'%'+_0x5f128b[_0xcdf6('0x39')][_0xcdf6('0x46')]+'%'};return _0x4e1c1c;})});}_0x1e6020=_[_0xcdf6('0x44')]({},_0x1e6020,_0x5f128b[_0xcdf6('0x47')]);return _0x27a59b[_0xcdf6('0x5a')](_0x1e6020);}})['then'](function(_0x1e99b1){if(_0x1e99b1){_0x4ee271=_0x1e99b1['length'];if(!_0x5f128b['query']['hasOwnProperty'](_0xcdf6('0x58'))){_0x1e6020['limit']=qs[_0xcdf6('0x40')](_0x5f128b[_0xcdf6('0x39')][_0xcdf6('0x40')]);_0x1e6020[_0xcdf6('0x2a')]=qs[_0xcdf6('0x2a')](_0x5f128b[_0xcdf6('0x39')][_0xcdf6('0x2a')]);}return _0x27a59b[_0xcdf6('0x5a')](_0x1e6020);}})[_0xcdf6('0x2e')](function(_0x91abb0){if(_0x91abb0){return _0x91abb0?{'count':_0x4ee271,'rows':_0x91abb0}:null;}})[_0xcdf6('0x2e')](respondWithResult(_0x399f13,null))[_0xcdf6('0x4d')](handleError(_0x399f13,null));};exports[_0xcdf6('0x5b')]=function(_0x3309da,_0x4ced77,_0x4c8943){var _0x2e40f3={};var _0x3df585={};var _0x253ede;var _0x3ad7d9;return db[_0xcdf6('0x48')][_0xcdf6('0x55')]({'where':{'id':_0x3309da[_0xcdf6('0x53')]['id']}})[_0xcdf6('0x2e')](handleEntityNotFound(_0x4ced77,null))[_0xcdf6('0x2e')](function(_0x166dde){if(_0x166dde){_0x253ede=_0x166dde;_0x3df585[_0xcdf6('0x38')]=_[_0xcdf6('0x3a')](db[_0xcdf6('0x59')]['rawAttributes']);_0x3df585[_0xcdf6('0x39')]=_[_0xcdf6('0x3a')](_0x3309da[_0xcdf6('0x39')]);_0x3df585[_0xcdf6('0x3b')]=_[_0xcdf6('0x3c')](_0x3df585[_0xcdf6('0x38')],_0x3df585['query']);_0x2e40f3[_0xcdf6('0x3e')]=_[_0xcdf6('0x3c')](_0x3df585['model'],qs[_0xcdf6('0x3d')](_0x3309da[_0xcdf6('0x39')][_0xcdf6('0x3d')]));_0x2e40f3[_0xcdf6('0x3e')]=_0x2e40f3[_0xcdf6('0x3e')][_0xcdf6('0x4f')]?_0x2e40f3[_0xcdf6('0x3e')]:_0x3df585['model'];_0x2e40f3[_0xcdf6('0x41')]=qs[_0xcdf6('0x42')](_0x3309da[_0xcdf6('0x39')][_0xcdf6('0x42')]);_0x2e40f3['where']=qs[_0xcdf6('0x3b')](_['pick'](_0x3309da['query'],_0x3df585[_0xcdf6('0x3b')]));if(_0x3309da['query'][_0xcdf6('0x46')]){_0x2e40f3[_0xcdf6('0x43')]=_[_0xcdf6('0x44')](_0x2e40f3['where'],{'$or':_[_0xcdf6('0x34')](_0x2e40f3[_0xcdf6('0x3e')],function(_0xd9ad21){var _0x2eee2c={};_0x2eee2c[_0xd9ad21]={'$like':'%'+_0x3309da[_0xcdf6('0x39')][_0xcdf6('0x46')]+'%'};return _0x2eee2c;})});}_0x2e40f3=_[_0xcdf6('0x44')]({},_0x2e40f3,_0x3309da[_0xcdf6('0x47')]);return _0x253ede[_0xcdf6('0x5b')](_0x2e40f3);}})['then'](function(_0xebfe45){if(_0xebfe45){_0x3ad7d9=_0xebfe45['length'];if(!_0x3309da['query'][_0xcdf6('0x3f')](_0xcdf6('0x58'))){_0x2e40f3[_0xcdf6('0x40')]=qs[_0xcdf6('0x40')](_0x3309da[_0xcdf6('0x39')][_0xcdf6('0x40')]);_0x2e40f3[_0xcdf6('0x2a')]=qs[_0xcdf6('0x2a')](_0x3309da['query']['offset']);}return _0x253ede[_0xcdf6('0x5b')](_0x2e40f3);}})['then'](function(_0xbf2770){if(_0xbf2770){return _0xbf2770?{'count':_0x3ad7d9,'rows':_0xbf2770}:null;}})[_0xcdf6('0x2e')](respondWithResult(_0x4ced77,null))['catch'](handleError(_0x4ced77,null));}; \ No newline at end of file +var _0x1ba3=['type','VIRTUAL','filter','merge','options','Dynamics365Configuration','includeAll','include','findAll','catch','params','rawAttributes','keys','create','body','find','findOne','Dynamics365Field','pick','getFields','nolimit','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','status','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','end','sendStatus','name','send','index','map','model','query','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters'];(function(_0x42fd29,_0x3461ba){var _0x544f1f=function(_0x189203){while(--_0x189203){_0x42fd29['push'](_0x42fd29['shift']());}};_0x544f1f(++_0x3461ba);}(_0x1ba3,0x197));var _0x31ba=function(_0x102b0c,_0x33dee4){_0x102b0c=_0x102b0c-0x0;var _0x9b15ca=_0x1ba3[_0x102b0c];return _0x9b15ca;};'use strict';var pdf=require(_0x31ba('0x0'));var emlformat=require(_0x31ba('0x1'));var rimraf=require(_0x31ba('0x2'));var zipdir=require(_0x31ba('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x31ba('0x4'));var moment=require(_0x31ba('0x5'));var BPromise=require(_0x31ba('0x6'));var Mustache=require(_0x31ba('0x7'));var util=require(_0x31ba('0x8'));var path=require(_0x31ba('0x9'));var sox=require(_0x31ba('0xa'));var csv=require(_0x31ba('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x31ba('0xc'));var squel=require(_0x31ba('0xd'));var crypto=require(_0x31ba('0xe'));var jsforce=require(_0x31ba('0xf'));var deskjs=require(_0x31ba('0x10'));var toCsv=require(_0x31ba('0xb'));var querystring=require(_0x31ba('0x11'));var Papa=require(_0x31ba('0x12'));var Redis=require(_0x31ba('0x13'));var authService=require(_0x31ba('0x14'));var qs=require(_0x31ba('0x15'));var as=require(_0x31ba('0x16'));var hardwareService=require(_0x31ba('0x17'));var logger=require(_0x31ba('0x18'))(_0x31ba('0x19'));var utils=require(_0x31ba('0x1a'));var config=require(_0x31ba('0x1b'));var db=require(_0x31ba('0x1c'))['db'];var jayson=require(_0x31ba('0x1d'));var client=jayson['client'][_0x31ba('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x2244ad,_0x172470,_0x5dcd7b){if(_0x5dcd7b){var _0x306ef0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x306ef0[_0x31ba('0x1f')](_0x172470)){return _0x2244ad;}else{throw new db['Sequelize']['ValidationError'](_0x31ba('0x20'));}}else{return _0x2244ad;}}function respondWithRpcPromise(_0x26556c,_0x2ade70,_0xa90bfb,_0x2418cb){return new BPromise(function(_0x233838,_0x340ae8){var _0x5edeaa=_0x2418cb||client;return _0x5edeaa['request'](_0x26556c,_0xa90bfb)[_0x31ba('0x21')](function(_0x4dd3f0){logger['info'](_0x31ba('0x22'),_0x2ade70,_0x31ba('0x23'));logger[_0x31ba('0x24')](_0x31ba('0x25'),_0x2ade70,_0x31ba('0x23'),JSON[_0x31ba('0x26')](_0x4dd3f0));if(_0x4dd3f0[_0x31ba('0x27')]){if(_0x4dd3f0[_0x31ba('0x27')][_0x31ba('0x28')]===0x1f4){logger[_0x31ba('0x27')](_0x31ba('0x22'),_0x2ade70,_0x4dd3f0[_0x31ba('0x27')][_0x31ba('0x29')]);return _0x340ae8(_0x4dd3f0[_0x31ba('0x27')][_0x31ba('0x29')]);}logger[_0x31ba('0x27')](_0x31ba('0x22'),_0x2ade70,_0x4dd3f0[_0x31ba('0x27')][_0x31ba('0x29')]);return _0x233838(_0x4dd3f0['error'][_0x31ba('0x29')]);}else{logger[_0x31ba('0x2a')](_0x31ba('0x22'),_0x2ade70,_0x31ba('0x23'));_0x233838(_0x4dd3f0[_0x31ba('0x2b')][_0x31ba('0x29')]);}})['catch'](function(_0xeee4e2){logger[_0x31ba('0x27')](_0x31ba('0x22'),_0x2ade70,_0xeee4e2);_0x340ae8(_0xeee4e2);});});}function respondWithStatusCode(_0x638196,_0x85c286){_0x85c286=_0x85c286||0xcc;return function(_0x1e5af8){if(_0x1e5af8){return _0x638196['sendStatus'](_0x85c286);}return _0x638196[_0x31ba('0x2c')](_0x85c286)['end']();};}function respondWithResult(_0x3323df,_0x3cc57a){_0x3cc57a=_0x3cc57a||0xc8;return function(_0x546836){if(_0x546836){return _0x3323df[_0x31ba('0x2c')](_0x3cc57a)[_0x31ba('0x2d')](_0x546836);}};}function respondWithFilteredResult(_0x3ca1f3,_0x4e54d5){return function(_0x17afc7){if(_0x17afc7){var _0x3b77ef=_0x17afc7[_0x31ba('0x2e')],_0x41c295=_0x4e54d5[_0x31ba('0x2f')],_0x328423=_0x4e54d5['offset']+_0x4e54d5['limit'],_0x56fc29;if(_0x328423>=_0x3b77ef){_0x328423=_0x3b77ef;_0x56fc29=0xc8;}else{_0x56fc29=0xce;}_0x3ca1f3[_0x31ba('0x2c')](_0x56fc29);return _0x3ca1f3[_0x31ba('0x30')](_0x31ba('0x31'),_0x41c295+'-'+_0x328423+'/'+_0x3b77ef)['json'](_0x17afc7);}return null;};}function patchUpdates(_0x490c4c){return function(_0x186e33){try{jsonpatch[_0x31ba('0x32')](_0x186e33,_0x490c4c,!![]);}catch(_0x39df92){return BPromise[_0x31ba('0x33')](_0x39df92);}return _0x186e33[_0x31ba('0x34')]();};}function saveUpdates(_0x5b79fe,_0x436af1){return function(_0x3ea19a){if(_0x3ea19a){return _0x3ea19a[_0x31ba('0x35')](_0x5b79fe)[_0x31ba('0x21')](function(_0xc3732d){return _0xc3732d;});}return null;};}function removeEntity(_0x2a10c8,_0x2b1a5d){return function(_0x3eabe4){if(_0x3eabe4){return _0x3eabe4[_0x31ba('0x36')]()['then'](function(){_0x2a10c8[_0x31ba('0x2c')](0xcc)[_0x31ba('0x37')]();});}};}function handleEntityNotFound(_0x53e194,_0xa272ad){return function(_0x1cc206){if(!_0x1cc206){_0x53e194[_0x31ba('0x38')](0x194);}return _0x1cc206;};}function handleError(_0x4461dd,_0x263c40){_0x263c40=_0x263c40||0x1f4;return function(_0xb1eead){logger[_0x31ba('0x27')](_0xb1eead['stack']);if(_0xb1eead['name']){delete _0xb1eead[_0x31ba('0x39')];}_0x4461dd[_0x31ba('0x2c')](_0x263c40)[_0x31ba('0x3a')](_0xb1eead);};}exports[_0x31ba('0x3b')]=function(_0x376e13,_0x2cef96){var _0x107480={},_0x1a74e6={},_0x22d79f={'count':0x0,'rows':[]};var _0x3e18c6=_[_0x31ba('0x3c')](db['Dynamics365Configuration']['rawAttributes'],function(_0x313728){return{'name':_0x313728['fieldName'],'type':_0x313728['type']['key']};});_0x1a74e6[_0x31ba('0x3d')]=_[_0x31ba('0x3c')](_0x3e18c6,_0x31ba('0x39'));_0x1a74e6[_0x31ba('0x3e')]=_['keys'](_0x376e13['query']);_0x1a74e6['filters']=_[_0x31ba('0x3f')](_0x1a74e6['model'],_0x1a74e6[_0x31ba('0x3e')]);_0x107480[_0x31ba('0x40')]=_[_0x31ba('0x3f')](_0x1a74e6[_0x31ba('0x3d')],qs[_0x31ba('0x41')](_0x376e13['query'][_0x31ba('0x41')]));_0x107480[_0x31ba('0x40')]=_0x107480[_0x31ba('0x40')][_0x31ba('0x42')]?_0x107480[_0x31ba('0x40')]:_0x1a74e6[_0x31ba('0x3d')];if(!_0x376e13[_0x31ba('0x3e')][_0x31ba('0x43')]('nolimit')){_0x107480[_0x31ba('0x44')]=qs[_0x31ba('0x44')](_0x376e13[_0x31ba('0x3e')][_0x31ba('0x44')]);_0x107480[_0x31ba('0x2f')]=qs[_0x31ba('0x2f')](_0x376e13[_0x31ba('0x3e')]['offset']);}_0x107480[_0x31ba('0x45')]=qs[_0x31ba('0x46')](_0x376e13[_0x31ba('0x3e')][_0x31ba('0x46')]);_0x107480[_0x31ba('0x47')]=qs[_0x31ba('0x48')](_['pick'](_0x376e13[_0x31ba('0x3e')],_0x1a74e6['filters']));if(_0x376e13[_0x31ba('0x3e')]['filter']){_0x107480[_0x31ba('0x47')]=_['merge'](_0x107480[_0x31ba('0x47')],{'$or':_[_0x31ba('0x3c')](_0x3e18c6,function(_0x1323ca){if(_0x1323ca[_0x31ba('0x49')]!==_0x31ba('0x4a')){var _0x54ce5d={};_0x54ce5d[_0x1323ca[_0x31ba('0x39')]]={'$like':'%'+_0x376e13[_0x31ba('0x3e')][_0x31ba('0x4b')]+'%'};return _0x54ce5d;}})});}_0x107480=_[_0x31ba('0x4c')]({},_0x107480,_0x376e13[_0x31ba('0x4d')]);var _0x4b45cc={'where':_0x107480[_0x31ba('0x47')]};return db[_0x31ba('0x4e')][_0x31ba('0x2e')](_0x4b45cc)[_0x31ba('0x21')](function(_0x37be18){_0x22d79f[_0x31ba('0x2e')]=_0x37be18;if(_0x376e13[_0x31ba('0x3e')][_0x31ba('0x4f')]){_0x107480[_0x31ba('0x50')]=[{'all':!![]}];}return db[_0x31ba('0x4e')][_0x31ba('0x51')](_0x107480);})[_0x31ba('0x21')](function(_0x5a4b3f){_0x22d79f['rows']=_0x5a4b3f;return _0x22d79f;})[_0x31ba('0x21')](respondWithFilteredResult(_0x2cef96,_0x107480))[_0x31ba('0x52')](handleError(_0x2cef96,null));};exports['show']=function(_0x3e4c0a,_0x37f950){var _0x184aa1={'raw':![],'where':{'id':_0x3e4c0a[_0x31ba('0x53')]['id']}},_0x163bb9={};_0x163bb9[_0x31ba('0x3d')]=_['keys'](db[_0x31ba('0x4e')][_0x31ba('0x54')]);_0x163bb9['query']=_[_0x31ba('0x55')](_0x3e4c0a[_0x31ba('0x3e')]);_0x163bb9[_0x31ba('0x48')]=_[_0x31ba('0x3f')](_0x163bb9[_0x31ba('0x3d')],_0x163bb9[_0x31ba('0x3e')]);_0x184aa1[_0x31ba('0x40')]=_[_0x31ba('0x3f')](_0x163bb9[_0x31ba('0x3d')],qs[_0x31ba('0x41')](_0x3e4c0a['query'][_0x31ba('0x41')]));_0x184aa1[_0x31ba('0x40')]=_0x184aa1[_0x31ba('0x40')][_0x31ba('0x42')]?_0x184aa1[_0x31ba('0x40')]:_0x163bb9[_0x31ba('0x3d')];if(_0x3e4c0a[_0x31ba('0x3e')][_0x31ba('0x4f')]){_0x184aa1['include']=[{'all':!![]}];}_0x184aa1=_[_0x31ba('0x4c')]({},_0x184aa1,_0x3e4c0a[_0x31ba('0x4d')]);return db[_0x31ba('0x4e')]['find'](_0x184aa1)['then'](handleEntityNotFound(_0x37f950,null))[_0x31ba('0x21')](respondWithResult(_0x37f950,null))[_0x31ba('0x52')](handleError(_0x37f950,null));};exports[_0x31ba('0x56')]=function(_0x408574,_0x48bfc6){return db['Dynamics365Configuration'][_0x31ba('0x56')](_0x408574[_0x31ba('0x57')],{})[_0x31ba('0x21')](respondWithResult(_0x48bfc6,0xc9))[_0x31ba('0x52')](handleError(_0x48bfc6,null));};exports[_0x31ba('0x35')]=function(_0x464b25,_0x2d8453){if(_0x464b25[_0x31ba('0x57')]['id']){delete _0x464b25[_0x31ba('0x57')]['id'];}return db[_0x31ba('0x4e')][_0x31ba('0x58')]({'where':{'id':_0x464b25[_0x31ba('0x53')]['id']}})[_0x31ba('0x21')](handleEntityNotFound(_0x2d8453,null))[_0x31ba('0x21')](saveUpdates(_0x464b25[_0x31ba('0x57')],null))[_0x31ba('0x21')](respondWithResult(_0x2d8453,null))[_0x31ba('0x52')](handleError(_0x2d8453,null));};exports['destroy']=function(_0x37f082,_0x173e3c){return db[_0x31ba('0x4e')]['find']({'where':{'id':_0x37f082[_0x31ba('0x53')]['id']}})[_0x31ba('0x21')](handleEntityNotFound(_0x173e3c,null))[_0x31ba('0x21')](removeEntity(_0x173e3c,null))['catch'](handleError(_0x173e3c,null));};exports['getFields']=function(_0x350d5e,_0x2d05ca,_0x4d9461){var _0x418316={};var _0x16b200={};var _0x90f4f6;var _0x40abe4;return db['Dynamics365Configuration'][_0x31ba('0x59')]({'where':{'id':_0x350d5e[_0x31ba('0x53')]['id']}})[_0x31ba('0x21')](handleEntityNotFound(_0x2d05ca,null))[_0x31ba('0x21')](function(_0xef9296){if(_0xef9296){_0x90f4f6=_0xef9296;_0x16b200[_0x31ba('0x3d')]=_[_0x31ba('0x55')](db[_0x31ba('0x5a')][_0x31ba('0x54')]);_0x16b200[_0x31ba('0x3e')]=_[_0x31ba('0x55')](_0x350d5e[_0x31ba('0x3e')]);_0x16b200['filters']=_[_0x31ba('0x3f')](_0x16b200[_0x31ba('0x3d')],_0x16b200['query']);_0x418316[_0x31ba('0x40')]=_['intersection'](_0x16b200[_0x31ba('0x3d')],qs[_0x31ba('0x41')](_0x350d5e[_0x31ba('0x3e')][_0x31ba('0x41')]));_0x418316[_0x31ba('0x40')]=_0x418316[_0x31ba('0x40')]['length']?_0x418316['attributes']:_0x16b200[_0x31ba('0x3d')];_0x418316[_0x31ba('0x45')]=qs[_0x31ba('0x46')](_0x350d5e['query'][_0x31ba('0x46')]);_0x418316[_0x31ba('0x47')]=qs['filters'](_[_0x31ba('0x5b')](_0x350d5e[_0x31ba('0x3e')],_0x16b200[_0x31ba('0x48')]));if(_0x350d5e[_0x31ba('0x3e')][_0x31ba('0x4b')]){_0x418316[_0x31ba('0x47')]=_[_0x31ba('0x4c')](_0x418316['where'],{'$or':_[_0x31ba('0x3c')](_0x418316[_0x31ba('0x40')],function(_0x597166){var _0x508be4={};_0x508be4[_0x597166]={'$like':'%'+_0x350d5e[_0x31ba('0x3e')][_0x31ba('0x4b')]+'%'};return _0x508be4;})});}_0x418316=_[_0x31ba('0x4c')]({},_0x418316,_0x350d5e['options']);return _0x90f4f6[_0x31ba('0x5c')](_0x418316);}})[_0x31ba('0x21')](function(_0x1238a1){if(_0x1238a1){_0x40abe4=_0x1238a1[_0x31ba('0x42')];if(!_0x350d5e['query'][_0x31ba('0x43')](_0x31ba('0x5d'))){_0x418316[_0x31ba('0x44')]=qs[_0x31ba('0x44')](_0x350d5e[_0x31ba('0x3e')][_0x31ba('0x44')]);_0x418316[_0x31ba('0x2f')]=qs[_0x31ba('0x2f')](_0x350d5e[_0x31ba('0x3e')][_0x31ba('0x2f')]);}return _0x90f4f6[_0x31ba('0x5c')](_0x418316);}})['then'](function(_0x53c519){if(_0x53c519){return _0x53c519?{'count':_0x40abe4,'rows':_0x53c519}:null;}})['then'](respondWithResult(_0x2d05ca,null))[_0x31ba('0x52')](handleError(_0x2d05ca,null));};exports[_0x31ba('0x5e')]=function(_0x2572d7,_0x451f3e,_0x281446){var _0x5d8e91={};var _0x2dc1d0={};var _0x1dcd24;var _0x5c4702;return db[_0x31ba('0x4e')]['findOne']({'where':{'id':_0x2572d7[_0x31ba('0x53')]['id']}})[_0x31ba('0x21')](handleEntityNotFound(_0x451f3e,null))[_0x31ba('0x21')](function(_0x3f2a49){if(_0x3f2a49){_0x1dcd24=_0x3f2a49;_0x2dc1d0[_0x31ba('0x3d')]=_['keys'](db[_0x31ba('0x5a')][_0x31ba('0x54')]);_0x2dc1d0[_0x31ba('0x3e')]=_[_0x31ba('0x55')](_0x2572d7['query']);_0x2dc1d0['filters']=_[_0x31ba('0x3f')](_0x2dc1d0['model'],_0x2dc1d0[_0x31ba('0x3e')]);_0x5d8e91[_0x31ba('0x40')]=_['intersection'](_0x2dc1d0[_0x31ba('0x3d')],qs['fields'](_0x2572d7[_0x31ba('0x3e')]['fields']));_0x5d8e91[_0x31ba('0x40')]=_0x5d8e91['attributes']['length']?_0x5d8e91[_0x31ba('0x40')]:_0x2dc1d0['model'];_0x5d8e91['order']=qs['sort'](_0x2572d7['query']['sort']);_0x5d8e91[_0x31ba('0x47')]=qs[_0x31ba('0x48')](_[_0x31ba('0x5b')](_0x2572d7['query'],_0x2dc1d0[_0x31ba('0x48')]));if(_0x2572d7[_0x31ba('0x3e')][_0x31ba('0x4b')]){_0x5d8e91[_0x31ba('0x47')]=_[_0x31ba('0x4c')](_0x5d8e91['where'],{'$or':_[_0x31ba('0x3c')](_0x5d8e91[_0x31ba('0x40')],function(_0x38572e){var _0x2efa22={};_0x2efa22[_0x38572e]={'$like':'%'+_0x2572d7[_0x31ba('0x3e')][_0x31ba('0x4b')]+'%'};return _0x2efa22;})});}_0x5d8e91=_['merge']({},_0x5d8e91,_0x2572d7['options']);return _0x1dcd24[_0x31ba('0x5e')](_0x5d8e91);}})['then'](function(_0x5257ed){if(_0x5257ed){_0x5c4702=_0x5257ed['length'];if(!_0x2572d7['query'][_0x31ba('0x43')](_0x31ba('0x5d'))){_0x5d8e91[_0x31ba('0x44')]=qs[_0x31ba('0x44')](_0x2572d7[_0x31ba('0x3e')][_0x31ba('0x44')]);_0x5d8e91[_0x31ba('0x2f')]=qs['offset'](_0x2572d7[_0x31ba('0x3e')][_0x31ba('0x2f')]);}return _0x1dcd24[_0x31ba('0x5e')](_0x5d8e91);}})[_0x31ba('0x21')](function(_0x54db13){if(_0x54db13){return _0x54db13?{'count':_0x5c4702,'rows':_0x54db13}:null;}})['then'](respondWithResult(_0x451f3e,null))['catch'](handleError(_0x451f3e,null));};exports['getDescriptions']=function(_0xf84b9f,_0x7483f9,_0x3cc2ec){var _0x34edb0={};var _0x4852a9={};var _0x2848f1;var _0x1749ae;return db[_0x31ba('0x4e')][_0x31ba('0x59')]({'where':{'id':_0xf84b9f[_0x31ba('0x53')]['id']}})[_0x31ba('0x21')](handleEntityNotFound(_0x7483f9,null))[_0x31ba('0x21')](function(_0x327a2f){if(_0x327a2f){_0x2848f1=_0x327a2f;_0x4852a9[_0x31ba('0x3d')]=_['keys'](db[_0x31ba('0x5a')][_0x31ba('0x54')]);_0x4852a9[_0x31ba('0x3e')]=_[_0x31ba('0x55')](_0xf84b9f['query']);_0x4852a9[_0x31ba('0x48')]=_[_0x31ba('0x3f')](_0x4852a9['model'],_0x4852a9[_0x31ba('0x3e')]);_0x34edb0['attributes']=_[_0x31ba('0x3f')](_0x4852a9[_0x31ba('0x3d')],qs[_0x31ba('0x41')](_0xf84b9f['query'][_0x31ba('0x41')]));_0x34edb0[_0x31ba('0x40')]=_0x34edb0[_0x31ba('0x40')][_0x31ba('0x42')]?_0x34edb0['attributes']:_0x4852a9['model'];_0x34edb0[_0x31ba('0x45')]=qs['sort'](_0xf84b9f[_0x31ba('0x3e')]['sort']);_0x34edb0['where']=qs[_0x31ba('0x48')](_['pick'](_0xf84b9f['query'],_0x4852a9['filters']));if(_0xf84b9f[_0x31ba('0x3e')][_0x31ba('0x4b')]){_0x34edb0['where']=_['merge'](_0x34edb0['where'],{'$or':_[_0x31ba('0x3c')](_0x34edb0['attributes'],function(_0x20cdf9){var _0xa02685={};_0xa02685[_0x20cdf9]={'$like':'%'+_0xf84b9f[_0x31ba('0x3e')]['filter']+'%'};return _0xa02685;})});}_0x34edb0=_[_0x31ba('0x4c')]({},_0x34edb0,_0xf84b9f[_0x31ba('0x4d')]);return _0x2848f1[_0x31ba('0x5f')](_0x34edb0);}})[_0x31ba('0x21')](function(_0x308f89){if(_0x308f89){_0x1749ae=_0x308f89[_0x31ba('0x42')];if(!_0xf84b9f[_0x31ba('0x3e')][_0x31ba('0x43')]('nolimit')){_0x34edb0[_0x31ba('0x44')]=qs[_0x31ba('0x44')](_0xf84b9f[_0x31ba('0x3e')][_0x31ba('0x44')]);_0x34edb0['offset']=qs[_0x31ba('0x2f')](_0xf84b9f[_0x31ba('0x3e')][_0x31ba('0x2f')]);}return _0x2848f1[_0x31ba('0x5f')](_0x34edb0);}})[_0x31ba('0x21')](function(_0x342b65){if(_0x342b65){return _0x342b65?{'count':_0x1749ae,'rows':_0x342b65}:null;}})[_0x31ba('0x21')](respondWithResult(_0x7483f9,null))['catch'](handleError(_0x7483f9,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index d846bab..ca808b7 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 _0xd0a8=['./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xd0a8,0x115));var _0x8d0a=function(_0x206173,_0x42d6ad){_0x206173=_0x206173-0x0;var _0xfca352=_0xd0a8[_0x206173];return _0xfca352;};'use strict';var _=require(_0x8d0a('0x0'));var util=require(_0x8d0a('0x1'));var logger=require('../../config/logger')(_0x8d0a('0x2'));var moment=require(_0x8d0a('0x3'));var BPromise=require(_0x8d0a('0x4'));var rp=require(_0x8d0a('0x5'));var fs=require('fs');var path=require(_0x8d0a('0x6'));var rimraf=require(_0x8d0a('0x7'));var config=require(_0x8d0a('0x8'));var attributes=require(_0x8d0a('0x9'));module[_0x8d0a('0xa')]=function(_0x4a72af,_0x389e4f){return _0x4a72af[_0x8d0a('0xb')](_0x8d0a('0xc'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0724=['path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','Dynamics365Configuration','util','../../config/logger','moment','bluebird'];(function(_0xbb6cce,_0x1f30bf){var _0xfc3dc6=function(_0x2d185f){while(--_0x2d185f){_0xbb6cce['push'](_0xbb6cce['shift']());}};_0xfc3dc6(++_0x1f30bf);}(_0x0724,0x100));var _0x4072=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x0724[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x4072('0x0'));var logger=require(_0x4072('0x1'))('api');var moment=require(_0x4072('0x2'));var BPromise=require(_0x4072('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4072('0x4'));var rimraf=require(_0x4072('0x5'));var config=require(_0x4072('0x6'));var attributes=require(_0x4072('0x7'));module[_0x4072('0x8')]=function(_0x23b3e5,_0x4e83d0){return _0x23b3e5['define'](_0x4072('0x9'),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 8ff2b53..60a7da4 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 _0x400c=['then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x3135f3,_0x1d0c1a){var _0x5b91a3=function(_0x49cee6){while(--_0x49cee6){_0x3135f3['push'](_0x3135f3['shift']());}};_0x5b91a3(++_0x1d0c1a);}(_0x400c,0xc7));var _0xc400=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x400c[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require(_0xc400('0x0'));var util=require('util');var moment=require(_0xc400('0x1'));var BPromise=require(_0xc400('0x2'));var rs=require(_0xc400('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc400('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc400('0x5'))(_0xc400('0x6'));var config=require(_0xc400('0x7'));var jayson=require(_0xc400('0x8'));var client=jayson[_0xc400('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f6a31,_0x35b6de,_0x34afce){return new BPromise(function(_0x4186b3,_0x1be1c2){return client[_0xc400('0xa')](_0x2f6a31,_0x34afce)[_0xc400('0xb')](function(_0x2cf167){logger['info'](_0xc400('0xc'),_0x35b6de,_0xc400('0xd'));logger[_0xc400('0xe')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x35b6de,_0xc400('0xd'),JSON['stringify'](_0x2cf167));if(_0x2cf167[_0xc400('0xf')]){if(_0x2cf167[_0xc400('0xf')][_0xc400('0x10')]===0x1f4){logger[_0xc400('0xf')](_0xc400('0xc'),_0x35b6de,_0x2cf167[_0xc400('0xf')][_0xc400('0x11')]);return _0x1be1c2(_0x2cf167[_0xc400('0xf')][_0xc400('0x11')]);}logger['error'](_0xc400('0xc'),_0x35b6de,_0x2cf167[_0xc400('0xf')]['message']);return _0x4186b3(_0x2cf167[_0xc400('0xf')]['message']);}else{logger[_0xc400('0x12')](_0xc400('0xc'),_0x35b6de,_0xc400('0xd'));_0x4186b3(_0x2cf167[_0xc400('0x13')]['message']);}})[_0xc400('0x14')](function(_0x4b64e1){logger[_0xc400('0xf')](_0xc400('0xc'),_0x35b6de,_0x4b64e1);_0x1be1c2(_0x4b64e1);});});} \ No newline at end of file +var _0x2a17=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash'];(function(_0x111edc,_0x3d9527){var _0x37b299=function(_0x4e43f3){while(--_0x4e43f3){_0x111edc['push'](_0x111edc['shift']());}};_0x37b299(++_0x3d9527);}(_0x2a17,0x197));var _0x72a1=function(_0x2185d1,_0x2f3a0b){_0x2185d1=_0x2185d1-0x0;var _0x49f05b=_0x2a17[_0x2185d1];return _0x49f05b;};'use strict';var _=require(_0x72a1('0x0'));var util=require(_0x72a1('0x1'));var moment=require('moment');var BPromise=require(_0x72a1('0x2'));var rs=require(_0x72a1('0x3'));var fs=require('fs');var Redis=require(_0x72a1('0x4'));var db=require(_0x72a1('0x5'))['db'];var utils=require(_0x72a1('0x6'));var logger=require('../../config/logger')(_0x72a1('0x7'));var config=require(_0x72a1('0x8'));var jayson=require(_0x72a1('0x9'));var client=jayson[_0x72a1('0xa')][_0x72a1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xfc5828,_0x2d8ff7,_0x1b83a9){return new BPromise(function(_0x47b5f0,_0xda6858){return client[_0x72a1('0xc')](_0xfc5828,_0x1b83a9)[_0x72a1('0xd')](function(_0x58a231){logger[_0x72a1('0xe')](_0x72a1('0xf'),_0x2d8ff7,_0x72a1('0x10'));logger[_0x72a1('0x11')](_0x72a1('0x12'),_0x2d8ff7,_0x72a1('0x10'),JSON[_0x72a1('0x13')](_0x58a231));if(_0x58a231[_0x72a1('0x14')]){if(_0x58a231['error'][_0x72a1('0x15')]===0x1f4){logger['error'](_0x72a1('0xf'),_0x2d8ff7,_0x58a231[_0x72a1('0x14')][_0x72a1('0x16')]);return _0xda6858(_0x58a231[_0x72a1('0x14')]['message']);}logger[_0x72a1('0x14')](_0x72a1('0xf'),_0x2d8ff7,_0x58a231['error'][_0x72a1('0x16')]);return _0x47b5f0(_0x58a231[_0x72a1('0x14')]['message']);}else{logger[_0x72a1('0xe')](_0x72a1('0xf'),_0x2d8ff7,_0x72a1('0x10'));_0x47b5f0(_0x58a231['result'][_0x72a1('0x16')]);}})[_0x72a1('0x17')](function(_0x2ce0af){logger[_0x72a1('0x14')](_0x72a1('0xf'),_0x2d8ff7,_0x2ce0af);_0xda6858(_0x2ce0af);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 5451f55..4552d28 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 _0xe130=['isAuthenticated','index','/:id','create','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intDynamics365Field.controller','get'];(function(_0x34497d,_0x307c7b){var _0x3e5277=function(_0x4cfae2){while(--_0x4cfae2){_0x34497d['push'](_0x34497d['shift']());}};_0x3e5277(++_0x307c7b);}(_0xe130,0x127));var _0x0e13=function(_0x125913,_0x3becdd){_0x125913=_0x125913-0x0;var _0x5a49d1=_0xe130[_0x125913];return _0x5a49d1;};'use strict';var multer=require(_0x0e13('0x0'));var util=require(_0x0e13('0x1'));var path=require('path');var timeout=require(_0x0e13('0x2'));var express=require(_0x0e13('0x3'));var router=express[_0x0e13('0x4')]();var auth=require(_0x0e13('0x5'));var interaction=require(_0x0e13('0x6'));var config=require('../../config/environment');var controller=require(_0x0e13('0x7'));router[_0x0e13('0x8')]('/',auth[_0x0e13('0x9')](),controller[_0x0e13('0xa')]);router['get'](_0x0e13('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x0e13('0x9')](),controller[_0x0e13('0xc')]);router['put']('/:id',auth[_0x0e13('0x9')](),controller[_0x0e13('0xd')]);router[_0x0e13('0xe')](_0x0e13('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x0e13('0xf')]=router; \ No newline at end of file +var _0x579c=['index','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated'];(function(_0xe91462,_0x5a1950){var _0x8c7ea9=function(_0x12e338){while(--_0x12e338){_0xe91462['push'](_0xe91462['shift']());}};_0x8c7ea9(++_0x5a1950);}(_0x579c,0xda));var _0xc579=function(_0x5a17da,_0x3701a6){_0x5a17da=_0x5a17da-0x0;var _0x696ca7=_0x579c[_0x5a17da];return _0x696ca7;};'use strict';var multer=require(_0xc579('0x0'));var util=require(_0xc579('0x1'));var path=require(_0xc579('0x2'));var timeout=require(_0xc579('0x3'));var express=require(_0xc579('0x4'));var router=express['Router']();var auth=require(_0xc579('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc579('0x6'));var controller=require(_0xc579('0x7'));router[_0xc579('0x8')]('/',auth[_0xc579('0x9')](),controller[_0xc579('0xa')]);router[_0xc579('0x8')](_0xc579('0xb'),auth['isAuthenticated'](),controller[_0xc579('0xc')]);router[_0xc579('0xd')]('/',auth[_0xc579('0x9')](),controller[_0xc579('0xe')]);router[_0xc579('0xf')](_0xc579('0xb'),auth[_0xc579('0x9')](),controller[_0xc579('0x10')]);router['delete'](_0xc579('0xb'),auth[_0xc579('0x9')](),controller[_0xc579('0x11')]);module[_0xc579('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 a2a3508..33ff98e 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 _0x7a28=['customVariable','keyValue','STRING','ENUM','variable','BOOLEAN','exports','string'];(function(_0x5122ee,_0x2b8b2c){var _0xe734c9=function(_0x2faf6f){while(--_0x2faf6f){_0x5122ee['push'](_0x5122ee['shift']());}};_0xe734c9(++_0x2b8b2c);}(_0x7a28,0x176));var _0x87a2=function(_0xca05fe,_0x2c8ebd){_0xca05fe=_0xca05fe-0x0;var _0x416635=_0x7a28[_0xca05fe];return _0x416635;};'use strict';var Sequelize=require('sequelize');module[_0x87a2('0x0')]={'type':{'type':Sequelize['ENUM'](_0x87a2('0x1'),'variable',_0x87a2('0x2'),_0x87a2('0x3')),'defaultValue':_0x87a2('0x1')},'content':{'type':Sequelize[_0x87a2('0x4')]},'key':{'type':Sequelize[_0x87a2('0x4')]},'keyType':{'type':Sequelize[_0x87a2('0x5')](_0x87a2('0x1'),_0x87a2('0x6'),_0x87a2('0x2'))},'keyContent':{'type':Sequelize[_0x87a2('0x4')]},'idField':{'type':Sequelize[_0x87a2('0x4')]},'nameField':{'type':Sequelize[_0x87a2('0x4')]},'customField':{'type':Sequelize[_0x87a2('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x87a2('0x4')]}}; \ No newline at end of file +var _0xa391=['variable','customVariable','keyValue','STRING','ENUM','BOOLEAN','exports','string'];(function(_0x2f5fea,_0x3ba2c0){var _0x36fe14=function(_0x3bbfc0){while(--_0x3bbfc0){_0x2f5fea['push'](_0x2f5fea['shift']());}};_0x36fe14(++_0x3ba2c0);}(_0xa391,0x1ee));var _0x1a39=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xa391[_0x2235bf];return _0x4c3a64;};'use strict';var Sequelize=require('sequelize');module[_0x1a39('0x0')]={'type':{'type':Sequelize['ENUM'](_0x1a39('0x1'),_0x1a39('0x2'),_0x1a39('0x3'),_0x1a39('0x4')),'defaultValue':_0x1a39('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x1a39('0x5')]},'keyType':{'type':Sequelize[_0x1a39('0x6')](_0x1a39('0x1'),_0x1a39('0x2'),_0x1a39('0x3'))},'keyContent':{'type':Sequelize[_0x1a39('0x5')]},'idField':{'type':Sequelize[_0x1a39('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x1a39('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index f9ab30b..7d17dab 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 _0x0b78=['sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','Dynamics365Field','includeAll','include','rows','catch','params','length','options','find','create','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x0b78,0x1d6));var _0x80b7=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x0b78[_0x4b369d];return _0x571a98;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x80b7('0x0'));var rimraf=require(_0x80b7('0x1'));var zipdir=require(_0x80b7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x80b7('0x3'));var moment=require(_0x80b7('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x80b7('0x5'));var sox=require(_0x80b7('0x6'));var csv=require(_0x80b7('0x7'));var ejs=require(_0x80b7('0x8'));var fs=require('fs');var _=require(_0x80b7('0x9'));var squel=require(_0x80b7('0xa'));var crypto=require('crypto');var jsforce=require(_0x80b7('0xb'));var deskjs=require(_0x80b7('0xc'));var toCsv=require(_0x80b7('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x80b7('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x80b7('0xe'));var as=require(_0x80b7('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x80b7('0x10'))(_0x80b7('0x11'));var utils=require(_0x80b7('0x12'));var config=require(_0x80b7('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a09c5,_0x3ac007){_0x3ac007=_0x3ac007||0xcc;return function(_0x1bbe9f){if(_0x1bbe9f){return _0x4a09c5[_0x80b7('0x14')](_0x3ac007);}return _0x4a09c5[_0x80b7('0x15')](_0x3ac007)[_0x80b7('0x16')]();};}function respondWithResult(_0x1b62ac,_0x3d71a0){_0x3d71a0=_0x3d71a0||0xc8;return function(_0x32cecc){if(_0x32cecc){return _0x1b62ac[_0x80b7('0x15')](_0x3d71a0)['json'](_0x32cecc);}};}function respondWithFilteredResult(_0x5b52a6,_0x5c64df){return function(_0x57e428){if(_0x57e428){var _0x2c6bff=_0x57e428[_0x80b7('0x17')],_0x459f67=_0x5c64df[_0x80b7('0x18')],_0x289c93=_0x5c64df[_0x80b7('0x18')]+_0x5c64df[_0x80b7('0x19')],_0x1e0d8f;if(_0x289c93>=_0x2c6bff){_0x289c93=_0x2c6bff;_0x1e0d8f=0xc8;}else{_0x1e0d8f=0xce;}_0x5b52a6[_0x80b7('0x15')](_0x1e0d8f);return _0x5b52a6[_0x80b7('0x1a')](_0x80b7('0x1b'),_0x459f67+'-'+_0x289c93+'/'+_0x2c6bff)[_0x80b7('0x1c')](_0x57e428);}return null;};}function patchUpdates(_0x196948){return function(_0x51b329){try{jsonpatch[_0x80b7('0x1d')](_0x51b329,_0x196948,!![]);}catch(_0xa1d6c6){return BPromise[_0x80b7('0x1e')](_0xa1d6c6);}return _0x51b329[_0x80b7('0x1f')]();};}function saveUpdates(_0x1524be,_0x3ebdd6){return function(_0x220133){if(_0x220133){return _0x220133[_0x80b7('0x20')](_0x1524be)[_0x80b7('0x21')](function(_0x9cf6aa){return _0x9cf6aa;});}return null;};}function removeEntity(_0x234ec8,_0x1ef249){return function(_0x53046f){if(_0x53046f){return _0x53046f['destroy']()[_0x80b7('0x21')](function(){_0x234ec8[_0x80b7('0x15')](0xcc)[_0x80b7('0x16')]();});}};}function handleEntityNotFound(_0x5e8093,_0x9fccdc){return function(_0x390d8a){if(!_0x390d8a){_0x5e8093[_0x80b7('0x14')](0x194);}return _0x390d8a;};}function handleError(_0x352226,_0x45d558){_0x45d558=_0x45d558||0x1f4;return function(_0x397e34){logger[_0x80b7('0x22')](_0x397e34[_0x80b7('0x23')]);if(_0x397e34[_0x80b7('0x24')]){delete _0x397e34[_0x80b7('0x24')];}_0x352226[_0x80b7('0x15')](_0x45d558)['send'](_0x397e34);};}exports[_0x80b7('0x25')]=function(_0x26a341,_0x6fbf86){var _0x28b85a={},_0x3fc028={},_0x238fee={'count':0x0,'rows':[]};var _0x3a5f27=_[_0x80b7('0x26')](db['Dynamics365Field'][_0x80b7('0x27')],function(_0x23958b){return{'name':_0x23958b[_0x80b7('0x28')],'type':_0x23958b[_0x80b7('0x29')][_0x80b7('0x2a')]};});_0x3fc028['model']=_[_0x80b7('0x26')](_0x3a5f27,_0x80b7('0x24'));_0x3fc028[_0x80b7('0x2b')]=_[_0x80b7('0x2c')](_0x26a341[_0x80b7('0x2b')]);_0x3fc028[_0x80b7('0x2d')]=_[_0x80b7('0x2e')](_0x3fc028['model'],_0x3fc028[_0x80b7('0x2b')]);_0x28b85a[_0x80b7('0x2f')]=_['intersection'](_0x3fc028[_0x80b7('0x30')],qs[_0x80b7('0x31')](_0x26a341[_0x80b7('0x2b')][_0x80b7('0x31')]));_0x28b85a[_0x80b7('0x2f')]=_0x28b85a[_0x80b7('0x2f')]['length']?_0x28b85a[_0x80b7('0x2f')]:_0x3fc028[_0x80b7('0x30')];if(!_0x26a341[_0x80b7('0x2b')]['hasOwnProperty'](_0x80b7('0x32'))){_0x28b85a[_0x80b7('0x19')]=qs[_0x80b7('0x19')](_0x26a341['query'][_0x80b7('0x19')]);_0x28b85a[_0x80b7('0x18')]=qs[_0x80b7('0x18')](_0x26a341[_0x80b7('0x2b')][_0x80b7('0x18')]);}_0x28b85a[_0x80b7('0x33')]=qs[_0x80b7('0x34')](_0x26a341[_0x80b7('0x2b')]['sort']);_0x28b85a['where']=qs[_0x80b7('0x2d')](_[_0x80b7('0x35')](_0x26a341[_0x80b7('0x2b')],_0x3fc028[_0x80b7('0x2d')]));if(_0x26a341['query']['filter']){_0x28b85a[_0x80b7('0x36')]=_[_0x80b7('0x37')](_0x28b85a[_0x80b7('0x36')],{'$or':_[_0x80b7('0x26')](_0x3a5f27,function(_0x5d5ae6){if(_0x5d5ae6[_0x80b7('0x29')]!==_0x80b7('0x38')){var _0x5ed725={};_0x5ed725[_0x5d5ae6[_0x80b7('0x24')]]={'$like':'%'+_0x26a341['query'][_0x80b7('0x39')]+'%'};return _0x5ed725;}})});}_0x28b85a=_['merge']({},_0x28b85a,_0x26a341['options']);var _0x166df9={'where':_0x28b85a[_0x80b7('0x36')]};return db[_0x80b7('0x3a')][_0x80b7('0x17')](_0x166df9)['then'](function(_0x5efede){_0x238fee[_0x80b7('0x17')]=_0x5efede;if(_0x26a341['query'][_0x80b7('0x3b')]){_0x28b85a[_0x80b7('0x3c')]=[{'all':!![]}];}return db['Dynamics365Field']['findAll'](_0x28b85a);})[_0x80b7('0x21')](function(_0x269c5e){_0x238fee[_0x80b7('0x3d')]=_0x269c5e;return _0x238fee;})['then'](respondWithFilteredResult(_0x6fbf86,_0x28b85a))[_0x80b7('0x3e')](handleError(_0x6fbf86,null));};exports['show']=function(_0x498124,_0x2a135d){var _0x1b2fda={'raw':!![],'where':{'id':_0x498124[_0x80b7('0x3f')]['id']}},_0x1b1b68={};_0x1b1b68[_0x80b7('0x30')]=_[_0x80b7('0x2c')](db[_0x80b7('0x3a')][_0x80b7('0x27')]);_0x1b1b68[_0x80b7('0x2b')]=_[_0x80b7('0x2c')](_0x498124[_0x80b7('0x2b')]);_0x1b1b68[_0x80b7('0x2d')]=_['intersection'](_0x1b1b68[_0x80b7('0x30')],_0x1b1b68[_0x80b7('0x2b')]);_0x1b2fda[_0x80b7('0x2f')]=_[_0x80b7('0x2e')](_0x1b1b68[_0x80b7('0x30')],qs[_0x80b7('0x31')](_0x498124[_0x80b7('0x2b')][_0x80b7('0x31')]));_0x1b2fda[_0x80b7('0x2f')]=_0x1b2fda[_0x80b7('0x2f')][_0x80b7('0x40')]?_0x1b2fda['attributes']:_0x1b1b68[_0x80b7('0x30')];if(_0x498124['query'][_0x80b7('0x3b')]){_0x1b2fda[_0x80b7('0x3c')]=[{'all':!![]}];}_0x1b2fda=_[_0x80b7('0x37')]({},_0x1b2fda,_0x498124[_0x80b7('0x41')]);return db['Dynamics365Field'][_0x80b7('0x42')](_0x1b2fda)[_0x80b7('0x21')](handleEntityNotFound(_0x2a135d,null))['then'](respondWithResult(_0x2a135d,null))[_0x80b7('0x3e')](handleError(_0x2a135d,null));};exports[_0x80b7('0x43')]=function(_0x5d9e48,_0x818328){return db[_0x80b7('0x3a')]['create'](_0x5d9e48['body'],{})[_0x80b7('0x21')](respondWithResult(_0x818328,0xc9))[_0x80b7('0x3e')](handleError(_0x818328,null));};exports[_0x80b7('0x20')]=function(_0x29bee7,_0x28729c){if(_0x29bee7[_0x80b7('0x44')]['id']){delete _0x29bee7[_0x80b7('0x44')]['id'];}return db['Dynamics365Field']['find']({'where':{'id':_0x29bee7['params']['id']}})['then'](handleEntityNotFound(_0x28729c,null))['then'](saveUpdates(_0x29bee7['body'],null))[_0x80b7('0x21')](respondWithResult(_0x28729c,null))[_0x80b7('0x3e')](handleError(_0x28729c,null));};exports[_0x80b7('0x45')]=function(_0x52b61f,_0x3aab8e){return db[_0x80b7('0x3a')][_0x80b7('0x42')]({'where':{'id':_0x52b61f['params']['id']}})[_0x80b7('0x21')](handleEntityNotFound(_0x3aab8e,null))['then'](removeEntity(_0x3aab8e,null))[_0x80b7('0x3e')](handleError(_0x3aab8e,null));}; \ No newline at end of file +var _0xdb8b=['nolimit','order','sort','pick','filter','where','merge','count','include','findAll','rows','show','params','keys','Dynamics365Field','includeAll','find','catch','create','body','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','end','status','json','offset','limit','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x519c88,_0xb84103){var _0x4668d7=function(_0x596c2c){while(--_0x596c2c){_0x519c88['push'](_0x519c88['shift']());}};_0x4668d7(++_0xb84103);}(_0xdb8b,0x1c4));var _0xbdb8=function(_0x12cab0,_0x2e739b){_0x12cab0=_0x12cab0-0x0;var _0x1adeb4=_0xdb8b[_0x12cab0];return _0x1adeb4;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbdb8('0x0'));var rimraf=require(_0xbdb8('0x1'));var zipdir=require(_0xbdb8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbdb8('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbdb8('0x4'));var util=require(_0xbdb8('0x5'));var path=require(_0xbdb8('0x6'));var sox=require(_0xbdb8('0x7'));var csv=require('to-csv');var ejs=require(_0xbdb8('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xbdb8('0x9'));var crypto=require(_0xbdb8('0xa'));var jsforce=require(_0xbdb8('0xb'));var deskjs=require(_0xbdb8('0xc'));var toCsv=require(_0xbdb8('0xd'));var querystring=require(_0xbdb8('0xe'));var Papa=require('papaparse');var Redis=require(_0xbdb8('0xf'));var authService=require(_0xbdb8('0x10'));var qs=require(_0xbdb8('0x11'));var as=require(_0xbdb8('0x12'));var hardwareService=require(_0xbdb8('0x13'));var logger=require(_0xbdb8('0x14'))(_0xbdb8('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xbdb8('0x16'))['db'];function respondWithStatusCode(_0x5e0107,_0x74d1a){_0x74d1a=_0x74d1a||0xcc;return function(_0x5ad84f){if(_0x5ad84f){return _0x5e0107[_0xbdb8('0x17')](_0x74d1a);}return _0x5e0107['status'](_0x74d1a)[_0xbdb8('0x18')]();};}function respondWithResult(_0x1cdbb6,_0x1e8888){_0x1e8888=_0x1e8888||0xc8;return function(_0x407bd0){if(_0x407bd0){return _0x1cdbb6[_0xbdb8('0x19')](_0x1e8888)[_0xbdb8('0x1a')](_0x407bd0);}};}function respondWithFilteredResult(_0x12bc92,_0x207187){return function(_0x149568){if(_0x149568){var _0xcf6e71=_0x149568['count'],_0x3d583b=_0x207187[_0xbdb8('0x1b')],_0x1985cb=_0x207187[_0xbdb8('0x1b')]+_0x207187[_0xbdb8('0x1c')],_0x29b2f7;if(_0x1985cb>=_0xcf6e71){_0x1985cb=_0xcf6e71;_0x29b2f7=0xc8;}else{_0x29b2f7=0xce;}_0x12bc92['status'](_0x29b2f7);return _0x12bc92['set'](_0xbdb8('0x1d'),_0x3d583b+'-'+_0x1985cb+'/'+_0xcf6e71)['json'](_0x149568);}return null;};}function patchUpdates(_0x37177b){return function(_0x303557){try{jsonpatch[_0xbdb8('0x1e')](_0x303557,_0x37177b,!![]);}catch(_0x442393){return BPromise[_0xbdb8('0x1f')](_0x442393);}return _0x303557[_0xbdb8('0x20')]();};}function saveUpdates(_0x21c9bf,_0x437095){return function(_0x3cc214){if(_0x3cc214){return _0x3cc214[_0xbdb8('0x21')](_0x21c9bf)[_0xbdb8('0x22')](function(_0x3febb9){return _0x3febb9;});}return null;};}function removeEntity(_0x51c4c3,_0x25b131){return function(_0x2074e0){if(_0x2074e0){return _0x2074e0[_0xbdb8('0x23')]()[_0xbdb8('0x22')](function(){_0x51c4c3[_0xbdb8('0x19')](0xcc)[_0xbdb8('0x18')]();});}};}function handleEntityNotFound(_0x9c0aa0,_0x2a31e6){return function(_0x50c6db){if(!_0x50c6db){_0x9c0aa0[_0xbdb8('0x17')](0x194);}return _0x50c6db;};}function handleError(_0x5cd628,_0x167edd){_0x167edd=_0x167edd||0x1f4;return function(_0x2b3d5e){logger['error'](_0x2b3d5e[_0xbdb8('0x24')]);if(_0x2b3d5e[_0xbdb8('0x25')]){delete _0x2b3d5e['name'];}_0x5cd628[_0xbdb8('0x19')](_0x167edd)[_0xbdb8('0x26')](_0x2b3d5e);};}exports[_0xbdb8('0x27')]=function(_0x46fa77,_0x3dedcb){var _0x2fe157={},_0x325233={},_0x593db0={'count':0x0,'rows':[]};var _0x3c3138=_['map'](db['Dynamics365Field'][_0xbdb8('0x28')],function(_0xdb9223){return{'name':_0xdb9223[_0xbdb8('0x29')],'type':_0xdb9223[_0xbdb8('0x2a')]['key']};});_0x325233[_0xbdb8('0x2b')]=_[_0xbdb8('0x2c')](_0x3c3138,_0xbdb8('0x25'));_0x325233[_0xbdb8('0x2d')]=_['keys'](_0x46fa77[_0xbdb8('0x2d')]);_0x325233[_0xbdb8('0x2e')]=_[_0xbdb8('0x2f')](_0x325233[_0xbdb8('0x2b')],_0x325233[_0xbdb8('0x2d')]);_0x2fe157[_0xbdb8('0x30')]=_[_0xbdb8('0x2f')](_0x325233['model'],qs[_0xbdb8('0x31')](_0x46fa77[_0xbdb8('0x2d')]['fields']));_0x2fe157['attributes']=_0x2fe157[_0xbdb8('0x30')][_0xbdb8('0x32')]?_0x2fe157[_0xbdb8('0x30')]:_0x325233['model'];if(!_0x46fa77[_0xbdb8('0x2d')][_0xbdb8('0x33')](_0xbdb8('0x34'))){_0x2fe157[_0xbdb8('0x1c')]=qs['limit'](_0x46fa77[_0xbdb8('0x2d')]['limit']);_0x2fe157['offset']=qs[_0xbdb8('0x1b')](_0x46fa77[_0xbdb8('0x2d')]['offset']);}_0x2fe157[_0xbdb8('0x35')]=qs['sort'](_0x46fa77[_0xbdb8('0x2d')][_0xbdb8('0x36')]);_0x2fe157['where']=qs[_0xbdb8('0x2e')](_[_0xbdb8('0x37')](_0x46fa77[_0xbdb8('0x2d')],_0x325233[_0xbdb8('0x2e')]));if(_0x46fa77['query'][_0xbdb8('0x38')]){_0x2fe157[_0xbdb8('0x39')]=_[_0xbdb8('0x3a')](_0x2fe157['where'],{'$or':_['map'](_0x3c3138,function(_0x2cf995){if(_0x2cf995[_0xbdb8('0x2a')]!=='VIRTUAL'){var _0x47e678={};_0x47e678[_0x2cf995['name']]={'$like':'%'+_0x46fa77[_0xbdb8('0x2d')][_0xbdb8('0x38')]+'%'};return _0x47e678;}})});}_0x2fe157=_[_0xbdb8('0x3a')]({},_0x2fe157,_0x46fa77['options']);var _0x314368={'where':_0x2fe157[_0xbdb8('0x39')]};return db['Dynamics365Field']['count'](_0x314368)[_0xbdb8('0x22')](function(_0x2dac96){_0x593db0[_0xbdb8('0x3b')]=_0x2dac96;if(_0x46fa77[_0xbdb8('0x2d')]['includeAll']){_0x2fe157[_0xbdb8('0x3c')]=[{'all':!![]}];}return db['Dynamics365Field'][_0xbdb8('0x3d')](_0x2fe157);})['then'](function(_0x439615){_0x593db0[_0xbdb8('0x3e')]=_0x439615;return _0x593db0;})['then'](respondWithFilteredResult(_0x3dedcb,_0x2fe157))['catch'](handleError(_0x3dedcb,null));};exports[_0xbdb8('0x3f')]=function(_0x581443,_0x7c9cf6){var _0x3006a1={'raw':!![],'where':{'id':_0x581443[_0xbdb8('0x40')]['id']}},_0x5705bf={};_0x5705bf[_0xbdb8('0x2b')]=_[_0xbdb8('0x41')](db[_0xbdb8('0x42')][_0xbdb8('0x28')]);_0x5705bf[_0xbdb8('0x2d')]=_[_0xbdb8('0x41')](_0x581443['query']);_0x5705bf['filters']=_[_0xbdb8('0x2f')](_0x5705bf[_0xbdb8('0x2b')],_0x5705bf[_0xbdb8('0x2d')]);_0x3006a1['attributes']=_[_0xbdb8('0x2f')](_0x5705bf[_0xbdb8('0x2b')],qs[_0xbdb8('0x31')](_0x581443[_0xbdb8('0x2d')][_0xbdb8('0x31')]));_0x3006a1[_0xbdb8('0x30')]=_0x3006a1[_0xbdb8('0x30')][_0xbdb8('0x32')]?_0x3006a1['attributes']:_0x5705bf[_0xbdb8('0x2b')];if(_0x581443[_0xbdb8('0x2d')][_0xbdb8('0x43')]){_0x3006a1[_0xbdb8('0x3c')]=[{'all':!![]}];}_0x3006a1=_[_0xbdb8('0x3a')]({},_0x3006a1,_0x581443['options']);return db[_0xbdb8('0x42')][_0xbdb8('0x44')](_0x3006a1)[_0xbdb8('0x22')](handleEntityNotFound(_0x7c9cf6,null))['then'](respondWithResult(_0x7c9cf6,null))[_0xbdb8('0x45')](handleError(_0x7c9cf6,null));};exports[_0xbdb8('0x46')]=function(_0xb0ad22,_0x517070){return db[_0xbdb8('0x42')][_0xbdb8('0x46')](_0xb0ad22[_0xbdb8('0x47')],{})[_0xbdb8('0x22')](respondWithResult(_0x517070,0xc9))['catch'](handleError(_0x517070,null));};exports[_0xbdb8('0x21')]=function(_0x537395,_0x36da0f){if(_0x537395['body']['id']){delete _0x537395[_0xbdb8('0x47')]['id'];}return db[_0xbdb8('0x42')][_0xbdb8('0x44')]({'where':{'id':_0x537395[_0xbdb8('0x40')]['id']}})['then'](handleEntityNotFound(_0x36da0f,null))[_0xbdb8('0x22')](saveUpdates(_0x537395[_0xbdb8('0x47')],null))[_0xbdb8('0x22')](respondWithResult(_0x36da0f,null))[_0xbdb8('0x45')](handleError(_0x36da0f,null));};exports[_0xbdb8('0x23')]=function(_0x594b05,_0x1881cf){return db[_0xbdb8('0x42')]['find']({'where':{'id':_0x594b05[_0xbdb8('0x40')]['id']}})[_0xbdb8('0x22')](handleEntityNotFound(_0x1881cf,null))[_0xbdb8('0x22')](removeEntity(_0x1881cf,null))['catch'](handleError(_0x1881cf,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index acf27db..ccf815a 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 _0xd1ef=['dynamics365_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0xd1ef,0xe3));var _0xfd1e=function(_0x10876d,_0x469942){_0x10876d=_0x10876d-0x0;var _0x633fc5=_0xd1ef[_0x10876d];return _0x633fc5;};'use strict';var _=require(_0xfd1e('0x0'));var util=require(_0xfd1e('0x1'));var logger=require(_0xfd1e('0x2'))(_0xfd1e('0x3'));var moment=require(_0xfd1e('0x4'));var BPromise=require(_0xfd1e('0x5'));var rp=require(_0xfd1e('0x6'));var fs=require('fs');var path=require(_0xfd1e('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfd1e('0x8'));module[_0xfd1e('0x9')]=function(_0xda161d,_0x49b129){return _0xda161d[_0xfd1e('0xa')](_0xfd1e('0xb'),attributes,{'tableName':_0xfd1e('0xc'),'paranoid':![],'indexes':[{'name':_0xfd1e('0xd'),'fields':[_0xfd1e('0xe'),_0xfd1e('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xeea4=['exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes'];(function(_0xdbc7fd,_0x3c6e13){var _0x1f7c91=function(_0x213cc0){while(--_0x213cc0){_0xdbc7fd['push'](_0xdbc7fd['shift']());}};_0x1f7c91(++_0x3c6e13);}(_0xeea4,0x85));var _0x4eea=function(_0x2c0de3,_0x19226d){_0x2c0de3=_0x2c0de3-0x0;var _0x1a652e=_0xeea4[_0x2c0de3];return _0x1a652e;};'use strict';var _=require(_0x4eea('0x0'));var util=require(_0x4eea('0x1'));var logger=require(_0x4eea('0x2'))(_0x4eea('0x3'));var moment=require(_0x4eea('0x4'));var BPromise=require(_0x4eea('0x5'));var rp=require(_0x4eea('0x6'));var fs=require('fs');var path=require(_0x4eea('0x7'));var rimraf=require(_0x4eea('0x8'));var config=require(_0x4eea('0x9'));var attributes=require(_0x4eea('0xa'));module[_0x4eea('0xb')]=function(_0x4f942e,_0xe5dd79){return _0x4f942e[_0x4eea('0xc')](_0x4eea('0xd'),attributes,{'tableName':_0x4eea('0xe'),'paranoid':![],'indexes':[{'name':_0x4eea('0xf'),'fields':[_0x4eea('0x10'),_0x4eea('0x11')],'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 3fd7473..7abdd70 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 _0x82c4=['randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x30bd4d,_0x50eb60){var _0x306915=function(_0x5ae782){while(--_0x5ae782){_0x30bd4d['push'](_0x30bd4d['shift']());}};_0x306915(++_0x50eb60);}(_0x82c4,0x1ca));var _0x482c=function(_0x2fda4b,_0x27f574){_0x2fda4b=_0x2fda4b-0x0;var _0x14061e=_0x82c4[_0x2fda4b];return _0x14061e;};'use strict';var _=require(_0x482c('0x0'));var util=require(_0x482c('0x1'));var moment=require(_0x482c('0x2'));var BPromise=require(_0x482c('0x3'));var rs=require(_0x482c('0x4'));var fs=require('fs');var Redis=require(_0x482c('0x5'));var db=require(_0x482c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x482c('0x7'))('rpc');var config=require(_0x482c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x482c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xfdb92,_0x32a503,_0x35cdab){return new BPromise(function(_0x1c10f2,_0x3846d8){return client['request'](_0xfdb92,_0x35cdab)[_0x482c('0xa')](function(_0x135cc1){logger[_0x482c('0xb')](_0x482c('0xc'),_0x32a503,_0x482c('0xd'));logger[_0x482c('0xe')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x32a503,_0x482c('0xd'),JSON[_0x482c('0xf')](_0x135cc1));if(_0x135cc1[_0x482c('0x10')]){if(_0x135cc1['error'][_0x482c('0x11')]===0x1f4){logger[_0x482c('0x10')](_0x482c('0xc'),_0x32a503,_0x135cc1['error']['message']);return _0x3846d8(_0x135cc1[_0x482c('0x10')][_0x482c('0x12')]);}logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x32a503,_0x135cc1[_0x482c('0x10')][_0x482c('0x12')]);return _0x1c10f2(_0x135cc1[_0x482c('0x10')][_0x482c('0x12')]);}else{logger[_0x482c('0xb')](_0x482c('0xc'),_0x32a503,_0x482c('0xd'));_0x1c10f2(_0x135cc1[_0x482c('0x13')][_0x482c('0x12')]);}})[_0x482c('0x14')](function(_0x363403){logger[_0x482c('0x10')]('Dynamics365Field,\x20%s,\x20%s',_0x32a503,_0x363403);_0x3846d8(_0x363403);});});} \ No newline at end of file +var _0xab00=['error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Dynamics365Field,\x20%s,\x20%s','stringify'];(function(_0x3bc4db,_0x2bb927){var _0x51205e=function(_0x1123e7){while(--_0x1123e7){_0x3bc4db['push'](_0x3bc4db['shift']());}};_0x51205e(++_0x2bb927);}(_0xab00,0x1b9));var _0x0ab0=function(_0x37adb4,_0x91607c){_0x37adb4=_0x37adb4-0x0;var _0x317fc8=_0xab00[_0x37adb4];return _0x317fc8;};'use strict';var _=require(_0x0ab0('0x0'));var util=require(_0x0ab0('0x1'));var moment=require(_0x0ab0('0x2'));var BPromise=require('bluebird');var rs=require(_0x0ab0('0x3'));var fs=require('fs');var Redis=require(_0x0ab0('0x4'));var db=require(_0x0ab0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0ab0('0x6'))('rpc');var config=require(_0x0ab0('0x7'));var jayson=require(_0x0ab0('0x8'));var client=jayson[_0x0ab0('0x9')][_0x0ab0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x363359,_0x25742b,_0x59fb03){return new BPromise(function(_0x3e934d,_0x2cbb53){return client['request'](_0x363359,_0x59fb03)[_0x0ab0('0xb')](function(_0x4f4a28){logger[_0x0ab0('0xc')](_0x0ab0('0xd'),_0x25742b,'request\x20sent');logger['debug']('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x25742b,'request\x20sent',JSON[_0x0ab0('0xe')](_0x4f4a28));if(_0x4f4a28['error']){if(_0x4f4a28[_0x0ab0('0xf')][_0x0ab0('0x10')]===0x1f4){logger['error'](_0x0ab0('0xd'),_0x25742b,_0x4f4a28[_0x0ab0('0xf')][_0x0ab0('0x11')]);return _0x2cbb53(_0x4f4a28[_0x0ab0('0xf')][_0x0ab0('0x11')]);}logger[_0x0ab0('0xf')](_0x0ab0('0xd'),_0x25742b,_0x4f4a28[_0x0ab0('0xf')][_0x0ab0('0x11')]);return _0x3e934d(_0x4f4a28[_0x0ab0('0xf')][_0x0ab0('0x11')]);}else{logger[_0x0ab0('0xc')]('Dynamics365Field,\x20%s,\x20%s',_0x25742b,'request\x20sent');_0x3e934d(_0x4f4a28['result'][_0x0ab0('0x11')]);}})[_0x0ab0('0x12')](function(_0x2f594b){logger['error'](_0x0ab0('0xd'),_0x25742b,_0x2f594b);_0x2cbb53(_0x2f594b);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index dedac61..7105fd8 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 _0x2a2b=['delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put'];(function(_0x2e1fd2,_0x505ef7){var _0x451843=function(_0x2d29ea){while(--_0x2d29ea){_0x2e1fd2['push'](_0x2e1fd2['shift']());}};_0x451843(++_0x505ef7);}(_0x2a2b,0xf4));var _0xb2a2=function(_0x13b9dd,_0x3791fe){_0x13b9dd=_0x13b9dd-0x0;var _0x4aa4fc=_0x2a2b[_0x13b9dd];return _0x4aa4fc;};'use strict';var multer=require('multer');var util=require(_0xb2a2('0x0'));var path=require(_0xb2a2('0x1'));var timeout=require(_0xb2a2('0x2'));var express=require(_0xb2a2('0x3'));var router=express[_0xb2a2('0x4')]();var auth=require(_0xb2a2('0x5'));var interaction=require(_0xb2a2('0x6'));var config=require('../../config/environment');var controller=require('./intFreshdeskAccount.controller');router[_0xb2a2('0x7')]('/',auth[_0xb2a2('0x8')](),controller[_0xb2a2('0x9')]);router['get'](_0xb2a2('0xa'),auth[_0xb2a2('0x8')](),controller[_0xb2a2('0xb')]);router['get'](_0xb2a2('0xc'),auth['isAuthenticated'](),controller[_0xb2a2('0xd')]);router[_0xb2a2('0x7')](_0xb2a2('0xe'),auth[_0xb2a2('0x8')](),controller[_0xb2a2('0xf')]);router[_0xb2a2('0x10')]('/',auth[_0xb2a2('0x8')](),controller[_0xb2a2('0x11')]);router[_0xb2a2('0x10')]('/:id/configurations',auth[_0xb2a2('0x8')](),controller[_0xb2a2('0x12')]);router[_0xb2a2('0x13')]('/:id',auth[_0xb2a2('0x8')](),controller['update']);router[_0xb2a2('0x14')]('/:id',auth[_0xb2a2('0x8')](),controller[_0xb2a2('0x15')]);module['exports']=router; \ No newline at end of file +var _0x056c=['/:id/fields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intFreshdeskAccount.controller','isAuthenticated','index','get','/:id','/:id/configurations','getConfigurations'];(function(_0x579f9b,_0xe3bbf5){var _0x48cb98=function(_0xafa6b5){while(--_0xafa6b5){_0x579f9b['push'](_0x579f9b['shift']());}};_0x48cb98(++_0xe3bbf5);}(_0x056c,0x1a1));var _0xc056=function(_0x57004c,_0x510722){_0x57004c=_0x57004c-0x0;var _0x3af11b=_0x056c[_0x57004c];return _0x3af11b;};'use strict';var multer=require(_0xc056('0x0'));var util=require(_0xc056('0x1'));var path=require(_0xc056('0x2'));var timeout=require(_0xc056('0x3'));var express=require(_0xc056('0x4'));var router=express[_0xc056('0x5')]();var auth=require(_0xc056('0x6'));var interaction=require(_0xc056('0x7'));var config=require('../../config/environment');var controller=require(_0xc056('0x8'));router['get']('/',auth[_0xc056('0x9')](),controller[_0xc056('0xa')]);router[_0xc056('0xb')](_0xc056('0xc'),auth[_0xc056('0x9')](),controller['show']);router[_0xc056('0xb')](_0xc056('0xd'),auth['isAuthenticated'](),controller[_0xc056('0xe')]);router['get'](_0xc056('0xf'),auth[_0xc056('0x9')](),controller['getFields']);router[_0xc056('0x10')]('/',auth[_0xc056('0x9')](),controller[_0xc056('0x11')]);router[_0xc056('0x10')](_0xc056('0xd'),auth[_0xc056('0x9')](),controller[_0xc056('0x12')]);router[_0xc056('0x13')](_0xc056('0xc'),auth[_0xc056('0x9')](),controller[_0xc056('0x14')]);router[_0xc056('0x15')](_0xc056('0xc'),auth[_0xc056('0x9')](),controller[_0xc056('0x16')]);module[_0xc056('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 25d70d1..10f8608 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 _0x0b0e=['STRING','username','remoteUri','sequelize'];(function(_0x58be10,_0x444566){var _0x548f8e=function(_0x145619){while(--_0x145619){_0x58be10['push'](_0x58be10['shift']());}};_0x548f8e(++_0x444566);}(_0x0b0e,0x187));var _0xe0b0=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0x0b0e[_0x2261ce];return _0x524640;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'name':{'type':Sequelize[_0xe0b0('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xe0b0('0x1')],'unique':_0xe0b0('0x2')},'apiKey':{'type':Sequelize[_0xe0b0('0x1')]},'remoteUri':{'type':Sequelize[_0xe0b0('0x1')],'unique':_0xe0b0('0x3')},'serverUrl':{'type':Sequelize[_0xe0b0('0x1')]}}; \ No newline at end of file +var _0x68fd=['remoteUri','sequelize','STRING','username'];(function(_0x3f6c96,_0x82d07c){var _0x10bdb4=function(_0x280f9c){while(--_0x280f9c){_0x3f6c96['push'](_0x3f6c96['shift']());}};_0x10bdb4(++_0x82d07c);}(_0x68fd,0x1e9));var _0xd68f=function(_0x1654cd,_0x47919c){_0x1654cd=_0x1654cd-0x0;var _0x40668e=_0x68fd[_0x1654cd];return _0x40668e;};'use strict';var Sequelize=require(_0xd68f('0x0'));module['exports']={'name':{'type':Sequelize[_0xd68f('0x1')]},'description':{'type':Sequelize[_0xd68f('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0xd68f('0x2')},'apiKey':{'type':Sequelize[_0xd68f('0x1')]},'remoteUri':{'type':Sequelize[_0xd68f('0x1')],'unique':_0xd68f('0x3')},'serverUrl':{'type':Sequelize[_0xd68f('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index a33861a..c93a7f8 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 _0x449c=['mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','http','Sequelize','request','then','info','request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskAccount,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','name','send','index','map','FreshdeskAccount','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','rawAttributes','find','create','body','params','getConfigurations','findOne','FreshdeskConfiguration','AccountId','Subjects','getSubjects','channel','FreshdeskField','Descriptions','remoteUri','apiKey','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','toString','base64','requester','subject','agent','description','group','source','ticket_type','company','remove','includes','custom_dropdown','label','default','choices','capitalize','test','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','statusCode','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x449c,0x100));var _0xc449=function(_0x5480fd,_0x46600d){_0x5480fd=_0x5480fd-0x0;var _0x2ec312=_0x449c[_0x5480fd];return _0x2ec312;};'use strict';var pdf=require(_0xc449('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc449('0x1'));var jsonpatch=require(_0xc449('0x2'));var rp=require(_0xc449('0x3'));var moment=require(_0xc449('0x4'));var BPromise=require(_0xc449('0x5'));var Mustache=require(_0xc449('0x6'));var util=require(_0xc449('0x7'));var path=require(_0xc449('0x8'));var sox=require(_0xc449('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xc449('0xa'));var squel=require(_0xc449('0xb'));var crypto=require(_0xc449('0xc'));var jsforce=require(_0xc449('0xd'));var deskjs=require(_0xc449('0xe'));var toCsv=require(_0xc449('0xf'));var querystring=require(_0xc449('0x10'));var Papa=require(_0xc449('0x11'));var Redis=require(_0xc449('0x12'));var authService=require(_0xc449('0x13'));var qs=require(_0xc449('0x14'));var as=require(_0xc449('0x15'));var hardwareService=require(_0xc449('0x16'));var logger=require(_0xc449('0x17'))(_0xc449('0x18'));var utils=require(_0xc449('0x19'));var config=require(_0xc449('0x1a'));var db=require(_0xc449('0x1b'))['db'];var integrations=require(_0xc449('0x1c'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc449('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x2d4382,_0x3d499e,_0x885208){if(_0x885208){var _0x4ed9f9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4ed9f9['test'](_0x3d499e)){return _0x2d4382;}else{throw new db[(_0xc449('0x1e'))]['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~!@#$%^&-_=+[{]}.');}}else{return _0x2d4382;}}function respondWithRpcPromise(_0x3fd2c7,_0x363407,_0x35b13a,_0x393648){return new BPromise(function(_0x453f86,_0x342577){var _0x2a8286=_0x393648||client;return _0x2a8286[_0xc449('0x1f')](_0x3fd2c7,_0x35b13a)[_0xc449('0x20')](function(_0x18fdbb){logger[_0xc449('0x21')]('FreshdeskAccount,\x20%s,\x20%s',_0x363407,_0xc449('0x22'));logger['debug'](_0xc449('0x23'),_0x363407,_0xc449('0x22'),JSON[_0xc449('0x24')](_0x18fdbb));if(_0x18fdbb[_0xc449('0x25')]){if(_0x18fdbb[_0xc449('0x25')][_0xc449('0x26')]===0x1f4){logger[_0xc449('0x25')](_0xc449('0x27'),_0x363407,_0x18fdbb[_0xc449('0x25')][_0xc449('0x28')]);return _0x342577(_0x18fdbb[_0xc449('0x25')][_0xc449('0x28')]);}logger['error'](_0xc449('0x27'),_0x363407,_0x18fdbb[_0xc449('0x25')][_0xc449('0x28')]);return _0x453f86(_0x18fdbb[_0xc449('0x25')][_0xc449('0x28')]);}else{logger['info'](_0xc449('0x27'),_0x363407,_0xc449('0x22'));_0x453f86(_0x18fdbb[_0xc449('0x29')][_0xc449('0x28')]);}})[_0xc449('0x2a')](function(_0x56f723){logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x363407,_0x56f723);_0x342577(_0x56f723);});});}function respondWithStatusCode(_0x40da5f,_0x4ceed3){_0x4ceed3=_0x4ceed3||0xcc;return function(_0x3ad59c){if(_0x3ad59c){return _0x40da5f[_0xc449('0x2b')](_0x4ceed3);}return _0x40da5f['status'](_0x4ceed3)[_0xc449('0x2c')]();};}function respondWithResult(_0x30de67,_0x421082){_0x421082=_0x421082||0xc8;return function(_0x36c3d9){if(_0x36c3d9){return _0x30de67[_0xc449('0x2d')](_0x421082)[_0xc449('0x2e')](_0x36c3d9);}};}function respondWithFilteredResult(_0x49dcea,_0x1a0b7a){return function(_0x310caa){if(_0x310caa){var _0x4a38e6=_0x310caa[_0xc449('0x2f')],_0x33798a=_0x1a0b7a['offset'],_0x438b33=_0x1a0b7a[_0xc449('0x30')]+_0x1a0b7a[_0xc449('0x31')],_0x502785;if(_0x438b33>=_0x4a38e6){_0x438b33=_0x4a38e6;_0x502785=0xc8;}else{_0x502785=0xce;}_0x49dcea[_0xc449('0x2d')](_0x502785);return _0x49dcea[_0xc449('0x32')](_0xc449('0x33'),_0x33798a+'-'+_0x438b33+'/'+_0x4a38e6)[_0xc449('0x2e')](_0x310caa);}return null;};}function patchUpdates(_0x3722ea){return function(_0x23958f){try{jsonpatch['apply'](_0x23958f,_0x3722ea,!![]);}catch(_0x39fa83){return BPromise[_0xc449('0x34')](_0x39fa83);}return _0x23958f[_0xc449('0x35')]();};}function saveUpdates(_0xc8b1d0,_0x2f7bdc){return function(_0x544b99){if(_0x544b99){return _0x544b99[_0xc449('0x36')](_0xc8b1d0)[_0xc449('0x20')](function(_0x4d274e){return _0x4d274e;});}return null;};}function removeEntity(_0x38f898,_0x2a96e1){return function(_0x10fdf3){if(_0x10fdf3){return _0x10fdf3[_0xc449('0x37')]()[_0xc449('0x20')](function(){_0x38f898['status'](0xcc)[_0xc449('0x2c')]();});}};}function handleEntityNotFound(_0x768e61,_0x4b03d0){return function(_0x2aeb47){if(!_0x2aeb47){_0x768e61[_0xc449('0x2b')](0x194);}return _0x2aeb47;};}function handleError(_0x2c8295,_0xe4d91d){_0xe4d91d=_0xe4d91d||0x1f4;return function(_0x19b822){logger[_0xc449('0x25')](_0x19b822['stack']);if(_0x19b822[_0xc449('0x38')]){delete _0x19b822[_0xc449('0x38')];}_0x2c8295[_0xc449('0x2d')](_0xe4d91d)[_0xc449('0x39')](_0x19b822);};}exports[_0xc449('0x3a')]=function(_0xb8ea94,_0x42b4f6){var _0x5f4942={},_0x1fc9c4={},_0x4b14c5={'count':0x0,'rows':[]};var _0x3222d9=_[_0xc449('0x3b')](db[_0xc449('0x3c')]['rawAttributes'],function(_0x34c21c){return{'name':_0x34c21c[_0xc449('0x3d')],'type':_0x34c21c[_0xc449('0x3e')]['key']};});_0x1fc9c4[_0xc449('0x3f')]=_[_0xc449('0x3b')](_0x3222d9,'name');_0x1fc9c4[_0xc449('0x40')]=_[_0xc449('0x41')](_0xb8ea94['query']);_0x1fc9c4[_0xc449('0x42')]=_[_0xc449('0x43')](_0x1fc9c4[_0xc449('0x3f')],_0x1fc9c4['query']);_0x5f4942[_0xc449('0x44')]=_[_0xc449('0x43')](_0x1fc9c4[_0xc449('0x3f')],qs[_0xc449('0x45')](_0xb8ea94[_0xc449('0x40')]['fields']));_0x5f4942[_0xc449('0x44')]=_0x5f4942[_0xc449('0x44')][_0xc449('0x46')]?_0x5f4942[_0xc449('0x44')]:_0x1fc9c4[_0xc449('0x3f')];if(!_0xb8ea94[_0xc449('0x40')][_0xc449('0x47')](_0xc449('0x48'))){_0x5f4942[_0xc449('0x31')]=qs[_0xc449('0x31')](_0xb8ea94['query'][_0xc449('0x31')]);_0x5f4942[_0xc449('0x30')]=qs[_0xc449('0x30')](_0xb8ea94[_0xc449('0x40')][_0xc449('0x30')]);}_0x5f4942[_0xc449('0x49')]=qs[_0xc449('0x4a')](_0xb8ea94[_0xc449('0x40')][_0xc449('0x4a')]);_0x5f4942[_0xc449('0x4b')]=qs['filters'](_[_0xc449('0x4c')](_0xb8ea94[_0xc449('0x40')],_0x1fc9c4['filters']));if(_0xb8ea94[_0xc449('0x40')][_0xc449('0x4d')]){_0x5f4942[_0xc449('0x4b')]=_[_0xc449('0x4e')](_0x5f4942[_0xc449('0x4b')],{'$or':_[_0xc449('0x3b')](_0x3222d9,function(_0x551fcd){if(_0x551fcd[_0xc449('0x3e')]!==_0xc449('0x4f')){var _0x260c51={};_0x260c51[_0x551fcd[_0xc449('0x38')]]={'$like':'%'+_0xb8ea94[_0xc449('0x40')][_0xc449('0x4d')]+'%'};return _0x260c51;}})});}_0x5f4942=_[_0xc449('0x4e')]({},_0x5f4942,_0xb8ea94[_0xc449('0x50')]);var _0x41381={'where':_0x5f4942[_0xc449('0x4b')]};return db[_0xc449('0x3c')][_0xc449('0x2f')](_0x41381)[_0xc449('0x20')](function(_0x2965c5){_0x4b14c5[_0xc449('0x2f')]=_0x2965c5;if(_0xb8ea94[_0xc449('0x40')][_0xc449('0x51')]){_0x5f4942[_0xc449('0x52')]=[{'all':!![]}];}return db['FreshdeskAccount'][_0xc449('0x53')](_0x5f4942);})['then'](function(_0x3197f7){_0x4b14c5[_0xc449('0x54')]=_0x3197f7;return _0x4b14c5;})[_0xc449('0x20')](respondWithFilteredResult(_0x42b4f6,_0x5f4942))['catch'](handleError(_0x42b4f6,null));};exports[_0xc449('0x55')]=function(_0x2985c5,_0x40543b){var _0x4ad37a={'raw':![],'where':{'id':_0x2985c5['params']['id']}},_0x3b46f8={};_0x3b46f8[_0xc449('0x3f')]=_[_0xc449('0x41')](db[_0xc449('0x3c')][_0xc449('0x56')]);_0x3b46f8[_0xc449('0x40')]=_[_0xc449('0x41')](_0x2985c5[_0xc449('0x40')]);_0x3b46f8[_0xc449('0x42')]=_[_0xc449('0x43')](_0x3b46f8[_0xc449('0x3f')],_0x3b46f8[_0xc449('0x40')]);_0x4ad37a['attributes']=_[_0xc449('0x43')](_0x3b46f8[_0xc449('0x3f')],qs[_0xc449('0x45')](_0x2985c5['query'][_0xc449('0x45')]));_0x4ad37a[_0xc449('0x44')]=_0x4ad37a['attributes']['length']?_0x4ad37a['attributes']:_0x3b46f8[_0xc449('0x3f')];if(_0x2985c5['query'][_0xc449('0x51')]){_0x4ad37a[_0xc449('0x52')]=[{'all':!![]}];}_0x4ad37a=_[_0xc449('0x4e')]({},_0x4ad37a,_0x2985c5[_0xc449('0x50')]);return db['FreshdeskAccount'][_0xc449('0x57')](_0x4ad37a)['then'](handleEntityNotFound(_0x40543b,null))[_0xc449('0x20')](respondWithResult(_0x40543b,null))[_0xc449('0x2a')](handleError(_0x40543b,null));};exports[_0xc449('0x58')]=function(_0x5c1b7d,_0x814e37){return db[_0xc449('0x3c')]['create'](_0x5c1b7d[_0xc449('0x59')],{})[_0xc449('0x20')](respondWithResult(_0x814e37,0xc9))['catch'](handleError(_0x814e37,null));};exports[_0xc449('0x36')]=function(_0x423186,_0x190aef){if(_0x423186[_0xc449('0x59')]['id']){delete _0x423186['body']['id'];}return db[_0xc449('0x3c')][_0xc449('0x57')]({'where':{'id':_0x423186[_0xc449('0x5a')]['id']}})[_0xc449('0x20')](handleEntityNotFound(_0x190aef,null))[_0xc449('0x20')](saveUpdates(_0x423186['body'],null))[_0xc449('0x20')](respondWithResult(_0x190aef,null))[_0xc449('0x2a')](handleError(_0x190aef,null));};exports['destroy']=function(_0x1eda98,_0x2115be){return db[_0xc449('0x3c')][_0xc449('0x57')]({'where':{'id':_0x1eda98['params']['id']}})[_0xc449('0x20')](handleEntityNotFound(_0x2115be,null))[_0xc449('0x20')](removeEntity(_0x2115be,null))['catch'](handleError(_0x2115be,null));};exports[_0xc449('0x5b')]=function(_0x188414,_0x29450c,_0x29fc71){var _0x5709e6={};var _0x40fd98={};var _0x418ef2;var _0x2b2427;return db['FreshdeskAccount'][_0xc449('0x5c')]({'where':{'id':_0x188414[_0xc449('0x5a')]['id']}})[_0xc449('0x20')](handleEntityNotFound(_0x29450c,null))['then'](function(_0x20348e){if(_0x20348e){_0x418ef2=_0x20348e;_0x40fd98['model']=_['keys'](db[_0xc449('0x5d')][_0xc449('0x56')]);_0x40fd98['query']=_[_0xc449('0x41')](_0x188414[_0xc449('0x40')]);_0x40fd98[_0xc449('0x42')]=_[_0xc449('0x43')](_0x40fd98[_0xc449('0x3f')],_0x40fd98[_0xc449('0x40')]);_0x5709e6['attributes']=_[_0xc449('0x43')](_0x40fd98[_0xc449('0x3f')],qs[_0xc449('0x45')](_0x188414[_0xc449('0x40')][_0xc449('0x45')]));_0x5709e6[_0xc449('0x44')]=_0x5709e6[_0xc449('0x44')][_0xc449('0x46')]?_0x5709e6[_0xc449('0x44')]:_0x40fd98[_0xc449('0x3f')];_0x5709e6[_0xc449('0x49')]=qs[_0xc449('0x4a')](_0x188414[_0xc449('0x40')]['sort']);_0x5709e6[_0xc449('0x4b')]=qs[_0xc449('0x42')](_['pick'](_0x188414['query'],_0x40fd98[_0xc449('0x42')]));if(_0x188414[_0xc449('0x40')]['filter']){_0x5709e6['where']=_[_0xc449('0x4e')](_0x5709e6[_0xc449('0x4b')],{'$or':_['map'](_0x5709e6[_0xc449('0x44')],function(_0xd0a69){var _0x1a1fdd={};_0x1a1fdd[_0xd0a69]={'$like':'%'+_0x188414[_0xc449('0x40')][_0xc449('0x4d')]+'%'};return _0x1a1fdd;})});}_0x5709e6=_[_0xc449('0x4e')]({},_0x5709e6,_0x188414[_0xc449('0x50')]);return _0x418ef2[_0xc449('0x5b')](_0x5709e6);}})[_0xc449('0x20')](function(_0xe0832d){if(_0xe0832d){_0x2b2427=_0xe0832d['length'];if(!_0x188414[_0xc449('0x40')][_0xc449('0x47')](_0xc449('0x48'))){_0x5709e6[_0xc449('0x31')]=qs[_0xc449('0x31')](_0x188414[_0xc449('0x40')][_0xc449('0x31')]);_0x5709e6[_0xc449('0x30')]=qs[_0xc449('0x30')](_0x188414[_0xc449('0x40')][_0xc449('0x30')]);}return _0x418ef2['getConfigurations'](_0x5709e6);}})[_0xc449('0x20')](function(_0x1b09c4){if(_0x1b09c4){return _0x1b09c4?{'count':_0x2b2427,'rows':_0x1b09c4}:null;}})['then'](respondWithResult(_0x29450c,null))[_0xc449('0x2a')](handleError(_0x29450c,null));};exports['addConfiguration']=function(_0x266514,_0x3079ed,_0x4136d6){if(_0x266514['body']['id']){delete _0x266514[_0xc449('0x59')]['id'];}return db['FreshdeskAccount'][_0xc449('0x5c')]({'where':{'id':_0x266514[_0xc449('0x5a')]['id']}})[_0xc449('0x20')](handleEntityNotFound(_0x3079ed,null))[_0xc449('0x20')](function(_0x20b051){if(_0x20b051){_0x266514[_0xc449('0x59')][_0xc449('0x5e')]=_0x20b051['id'];_0x266514[_0xc449('0x59')][_0xc449('0x5f')]=integrations[_0xc449('0x60')](_0x266514['body']['channel'],_0x266514[_0xc449('0x59')][_0xc449('0x3e')]);_0x266514[_0xc449('0x59')]['Descriptions']=integrations['getDescriptions'](_0x266514[_0xc449('0x59')][_0xc449('0x61')],_0x266514[_0xc449('0x59')][_0xc449('0x3e')]);return db[_0xc449('0x5d')][_0xc449('0x58')](_0x266514[_0xc449('0x59')],{'include':[{'model':db[_0xc449('0x62')],'as':_0xc449('0x5f')},{'model':db[_0xc449('0x62')],'as':_0xc449('0x63')}]});}return null;})['then'](respondWithResult(_0x3079ed,null))[_0xc449('0x2a')](handleError(_0x3079ed,null));};exports['getFields']=function(_0x10e88d,_0x1ed226,_0xeee900){var _0x161abf='';return db[_0xc449('0x3c')][_0xc449('0x5c')]({'where':{'id':_0x10e88d[_0xc449('0x5a')]['id']},'attributes':['id',_0xc449('0x64'),_0xc449('0x65')]})[_0xc449('0x20')](handleEntityNotFound(_0x1ed226,null))['then'](function(_0x45fffd){if(_0x45fffd){_0x161abf=_0x45fffd['remoteUri'];var _0x9eb25d=_0x161abf['slice'](-0x1);if(_0x9eb25d==='/'){_0x161abf=_0x161abf[_0xc449('0x66')](0x0,_0x161abf[_0xc449('0x67')](_0x9eb25d));}return rp({'method':_0xc449('0x68'),'uri':util[_0xc449('0x69')](_0xc449('0x6a'),_0x161abf,_0xc449('0x6b')),'headers':{'Authorization':util[_0xc449('0x69')](_0xc449('0x6c'),new Buffer(util[_0xc449('0x69')]('%s:X',_0x45fffd[_0xc449('0x65')]))[_0xc449('0x6d')](_0xc449('0x6e')))},'json':!![]});}})[_0xc449('0x20')](function(_0x5d8d97){if(_0x5d8d97){var _0x2af277=[_0xc449('0x6f'),_0xc449('0x70'),_0xc449('0x71'),_0xc449('0x72'),_0xc449('0x2d'),'priority',_0xc449('0x73'),_0xc449('0x74'),_0xc449('0x75'),_0xc449('0x73'),_0xc449('0x76')];_[_0xc449('0x77')](_0x5d8d97,function(_0xf40f71){return _0x2af277[_0xc449('0x78')](_0xf40f71[_0xc449('0x38')])||!_0xf40f71['default']&&_0xf40f71[_0xc449('0x3e')]!=='custom_text'&&_0xf40f71[_0xc449('0x3e')]!==_0xc449('0x79');});return{'count':_0x5d8d97[_0xc449('0x46')],'rows':_[_0xc449('0x3b')](_0x5d8d97,function(_0x2839c2){return{'id':_0x2839c2[_0xc449('0x38')],'name':_0x2839c2[_0xc449('0x7a')],'custom':!_0x2839c2[_0xc449('0x7b')],'options':_0x2839c2['choices']?_[_0xc449('0x3b')](_0x2839c2[_0xc449('0x7c')],function(_0x5dd641){return{'name':_[_0xc449('0x7d')](_0x5dd641),'value':_0x5dd641};}):[]};})};}})[_0xc449('0x20')](respondWithResult(_0x1ed226,null))[_0xc449('0x2a')](function(_0x35c107){var _0x8b0be1=_0x10e88d[_0xc449('0x40')][_0xc449('0x7e')]?0x1f4:_0x35c107['statusCode']||0x1f4;logger[_0xc449('0x25')](_0xc449('0x7f'),_0xc449('0x80'),_0x8b0be1,JSON[_0xc449('0x24')](_0x35c107));delete _0x35c107['name'];if(_0x8b0be1===0x191){_0x8b0be1=0x190;}_0x1ed226[_0xc449('0x2d')](_0x8b0be1)[_0xc449('0x39')](_0x10e88d[_0xc449('0x40')]['test']?{'message':_0xc449('0x81'),'statusCode':_0x35c107[_0xc449('0x82')]}:_0x35c107);});}; \ No newline at end of file +var _0xc85f=['merge','options','include','findAll','rows','show','params','includeAll','find','create','body','findOne','FreshdeskConfiguration','pick','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','remoteUri','apiKey','slice','substring','lastIndexOf','format','%s/%s','api/v2/ticket_fields','%s:X','requester','subject','agent','description','group','source','remove','includes','custom_dropdown','label','default','choices','capitalize','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','send','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','ValidationError','then','info','FreshdeskAccount,\x20%s,\x20%s','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','count','offset','set','apply','update','destroy','end','stack','name','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter'];(function(_0x3e0e08,_0x135913){var _0xbc9025=function(_0x5ada79){while(--_0x5ada79){_0x3e0e08['push'](_0x3e0e08['shift']());}};_0xbc9025(++_0x135913);}(_0xc85f,0x132));var _0xfc85=function(_0x437da0,_0x41fb2b){_0x437da0=_0x437da0-0x0;var _0x2faa1f=_0xc85f[_0x437da0];return _0x2faa1f;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xfc85('0x0'));var zipdir=require(_0xfc85('0x1'));var jsonpatch=require(_0xfc85('0x2'));var rp=require(_0xfc85('0x3'));var moment=require(_0xfc85('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xfc85('0x5'));var util=require(_0xfc85('0x6'));var path=require(_0xfc85('0x7'));var sox=require(_0xfc85('0x8'));var csv=require(_0xfc85('0x9'));var ejs=require(_0xfc85('0xa'));var fs=require('fs');var _=require(_0xfc85('0xb'));var squel=require(_0xfc85('0xc'));var crypto=require('crypto');var jsforce=require(_0xfc85('0xd'));var deskjs=require(_0xfc85('0xe'));var toCsv=require(_0xfc85('0x9'));var querystring=require('querystring');var Papa=require(_0xfc85('0xf'));var Redis=require(_0xfc85('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xfc85('0x11'));var as=require(_0xfc85('0x12'));var hardwareService=require(_0xfc85('0x13'));var logger=require(_0xfc85('0x14'))(_0xfc85('0x15'));var utils=require(_0xfc85('0x16'));var config=require(_0xfc85('0x17'));var db=require(_0xfc85('0x18'))['db'];var integrations=require(_0xfc85('0x19'));var jayson=require(_0xfc85('0x1a'));var client=jayson[_0xfc85('0x1b')][_0xfc85('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x5a5050,_0x2d6629,_0x43c0c5){if(_0x43c0c5){var _0x30f81b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x30f81b[_0xfc85('0x1d')](_0x2d6629)){return _0x5a5050;}else{throw new db[(_0xfc85('0x1e'))][(_0xfc85('0x1f'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x5a5050;}}function respondWithRpcPromise(_0x44474f,_0x538e0d,_0x1a04b5,_0x3e3a64){return new BPromise(function(_0x378e75,_0x41230f){var _0x9932a=_0x3e3a64||client;return _0x9932a['request'](_0x44474f,_0x1a04b5)[_0xfc85('0x20')](function(_0x355d53){logger[_0xfc85('0x21')](_0xfc85('0x22'),_0x538e0d,'request\x20sent');logger[_0xfc85('0x23')](_0xfc85('0x24'),_0x538e0d,_0xfc85('0x25'),JSON[_0xfc85('0x26')](_0x355d53));if(_0x355d53[_0xfc85('0x27')]){if(_0x355d53['error'][_0xfc85('0x28')]===0x1f4){logger[_0xfc85('0x27')](_0xfc85('0x22'),_0x538e0d,_0x355d53['error'][_0xfc85('0x29')]);return _0x41230f(_0x355d53[_0xfc85('0x27')][_0xfc85('0x29')]);}logger[_0xfc85('0x27')](_0xfc85('0x22'),_0x538e0d,_0x355d53[_0xfc85('0x27')][_0xfc85('0x29')]);return _0x378e75(_0x355d53[_0xfc85('0x27')]['message']);}else{logger['info'](_0xfc85('0x22'),_0x538e0d,_0xfc85('0x25'));_0x378e75(_0x355d53[_0xfc85('0x2a')][_0xfc85('0x29')]);}})[_0xfc85('0x2b')](function(_0x5cf2cb){logger[_0xfc85('0x27')](_0xfc85('0x22'),_0x538e0d,_0x5cf2cb);_0x41230f(_0x5cf2cb);});});}function respondWithStatusCode(_0x1d94b3,_0x34ab2d){_0x34ab2d=_0x34ab2d||0xcc;return function(_0x53ee42){if(_0x53ee42){return _0x1d94b3[_0xfc85('0x2c')](_0x34ab2d);}return _0x1d94b3[_0xfc85('0x2d')](_0x34ab2d)['end']();};}function respondWithResult(_0x46db92,_0xe49127){_0xe49127=_0xe49127||0xc8;return function(_0x2ac1af){if(_0x2ac1af){return _0x46db92[_0xfc85('0x2d')](_0xe49127)[_0xfc85('0x2e')](_0x2ac1af);}};}function respondWithFilteredResult(_0x454a9c,_0x23c2f6){return function(_0xc0f838){if(_0xc0f838){var _0x393a3b=_0xc0f838[_0xfc85('0x2f')],_0x1892bc=_0x23c2f6['offset'],_0x2a7480=_0x23c2f6[_0xfc85('0x30')]+_0x23c2f6['limit'],_0x184d7e;if(_0x2a7480>=_0x393a3b){_0x2a7480=_0x393a3b;_0x184d7e=0xc8;}else{_0x184d7e=0xce;}_0x454a9c[_0xfc85('0x2d')](_0x184d7e);return _0x454a9c[_0xfc85('0x31')]('Content-Range',_0x1892bc+'-'+_0x2a7480+'/'+_0x393a3b)['json'](_0xc0f838);}return null;};}function patchUpdates(_0x34ed69){return function(_0x3bdad7){try{jsonpatch[_0xfc85('0x32')](_0x3bdad7,_0x34ed69,!![]);}catch(_0x5bd1ed){return BPromise['reject'](_0x5bd1ed);}return _0x3bdad7['save']();};}function saveUpdates(_0x450ee3,_0x343963){return function(_0x57d3d5){if(_0x57d3d5){return _0x57d3d5[_0xfc85('0x33')](_0x450ee3)['then'](function(_0x3cd472){return _0x3cd472;});}return null;};}function removeEntity(_0x5aed0d,_0x4b54e6){return function(_0x459e88){if(_0x459e88){return _0x459e88[_0xfc85('0x34')]()['then'](function(){_0x5aed0d[_0xfc85('0x2d')](0xcc)[_0xfc85('0x35')]();});}};}function handleEntityNotFound(_0x295ecb,_0x2b0022){return function(_0xd3d99c){if(!_0xd3d99c){_0x295ecb[_0xfc85('0x2c')](0x194);}return _0xd3d99c;};}function handleError(_0x4d0f36,_0x2ed685){_0x2ed685=_0x2ed685||0x1f4;return function(_0x10dae5){logger[_0xfc85('0x27')](_0x10dae5[_0xfc85('0x36')]);if(_0x10dae5[_0xfc85('0x37')]){delete _0x10dae5['name'];}_0x4d0f36[_0xfc85('0x2d')](_0x2ed685)['send'](_0x10dae5);};}exports[_0xfc85('0x38')]=function(_0x128532,_0x51e7b9){var _0x1cd166={},_0xf551f={},_0x5d81ad={'count':0x0,'rows':[]};var _0x4e3ef4=_[_0xfc85('0x39')](db[_0xfc85('0x3a')][_0xfc85('0x3b')],function(_0x343800){return{'name':_0x343800[_0xfc85('0x3c')],'type':_0x343800[_0xfc85('0x3d')][_0xfc85('0x3e')]};});_0xf551f[_0xfc85('0x3f')]=_['map'](_0x4e3ef4,'name');_0xf551f[_0xfc85('0x40')]=_[_0xfc85('0x41')](_0x128532[_0xfc85('0x40')]);_0xf551f[_0xfc85('0x42')]=_[_0xfc85('0x43')](_0xf551f[_0xfc85('0x3f')],_0xf551f[_0xfc85('0x40')]);_0x1cd166[_0xfc85('0x44')]=_[_0xfc85('0x43')](_0xf551f['model'],qs[_0xfc85('0x45')](_0x128532[_0xfc85('0x40')][_0xfc85('0x45')]));_0x1cd166[_0xfc85('0x44')]=_0x1cd166[_0xfc85('0x44')][_0xfc85('0x46')]?_0x1cd166[_0xfc85('0x44')]:_0xf551f[_0xfc85('0x3f')];if(!_0x128532[_0xfc85('0x40')][_0xfc85('0x47')](_0xfc85('0x48'))){_0x1cd166[_0xfc85('0x49')]=qs['limit'](_0x128532[_0xfc85('0x40')][_0xfc85('0x49')]);_0x1cd166[_0xfc85('0x30')]=qs[_0xfc85('0x30')](_0x128532[_0xfc85('0x40')][_0xfc85('0x30')]);}_0x1cd166[_0xfc85('0x4a')]=qs[_0xfc85('0x4b')](_0x128532[_0xfc85('0x40')]['sort']);_0x1cd166[_0xfc85('0x4c')]=qs[_0xfc85('0x42')](_['pick'](_0x128532[_0xfc85('0x40')],_0xf551f[_0xfc85('0x42')]));if(_0x128532['query'][_0xfc85('0x4d')]){_0x1cd166[_0xfc85('0x4c')]=_['merge'](_0x1cd166['where'],{'$or':_[_0xfc85('0x39')](_0x4e3ef4,function(_0x22f6f9){if(_0x22f6f9[_0xfc85('0x3d')]!=='VIRTUAL'){var _0x56498e={};_0x56498e[_0x22f6f9[_0xfc85('0x37')]]={'$like':'%'+_0x128532[_0xfc85('0x40')]['filter']+'%'};return _0x56498e;}})});}_0x1cd166=_[_0xfc85('0x4e')]({},_0x1cd166,_0x128532[_0xfc85('0x4f')]);var _0x35d49f={'where':_0x1cd166[_0xfc85('0x4c')]};return db[_0xfc85('0x3a')][_0xfc85('0x2f')](_0x35d49f)[_0xfc85('0x20')](function(_0xa18325){_0x5d81ad['count']=_0xa18325;if(_0x128532[_0xfc85('0x40')]['includeAll']){_0x1cd166[_0xfc85('0x50')]=[{'all':!![]}];}return db[_0xfc85('0x3a')][_0xfc85('0x51')](_0x1cd166);})[_0xfc85('0x20')](function(_0x45691b){_0x5d81ad[_0xfc85('0x52')]=_0x45691b;return _0x5d81ad;})[_0xfc85('0x20')](respondWithFilteredResult(_0x51e7b9,_0x1cd166))[_0xfc85('0x2b')](handleError(_0x51e7b9,null));};exports[_0xfc85('0x53')]=function(_0x537be3,_0x1da10c){var _0x427f9c={'raw':![],'where':{'id':_0x537be3[_0xfc85('0x54')]['id']}},_0x195db2={};_0x195db2['model']=_['keys'](db[_0xfc85('0x3a')][_0xfc85('0x3b')]);_0x195db2[_0xfc85('0x40')]=_[_0xfc85('0x41')](_0x537be3[_0xfc85('0x40')]);_0x195db2[_0xfc85('0x42')]=_[_0xfc85('0x43')](_0x195db2['model'],_0x195db2[_0xfc85('0x40')]);_0x427f9c[_0xfc85('0x44')]=_[_0xfc85('0x43')](_0x195db2[_0xfc85('0x3f')],qs[_0xfc85('0x45')](_0x537be3['query'][_0xfc85('0x45')]));_0x427f9c[_0xfc85('0x44')]=_0x427f9c['attributes'][_0xfc85('0x46')]?_0x427f9c[_0xfc85('0x44')]:_0x195db2['model'];if(_0x537be3[_0xfc85('0x40')][_0xfc85('0x55')]){_0x427f9c[_0xfc85('0x50')]=[{'all':!![]}];}_0x427f9c=_[_0xfc85('0x4e')]({},_0x427f9c,_0x537be3[_0xfc85('0x4f')]);return db[_0xfc85('0x3a')][_0xfc85('0x56')](_0x427f9c)[_0xfc85('0x20')](handleEntityNotFound(_0x1da10c,null))[_0xfc85('0x20')](respondWithResult(_0x1da10c,null))['catch'](handleError(_0x1da10c,null));};exports[_0xfc85('0x57')]=function(_0x117dd6,_0x368022){return db[_0xfc85('0x3a')][_0xfc85('0x57')](_0x117dd6['body'],{})[_0xfc85('0x20')](respondWithResult(_0x368022,0xc9))[_0xfc85('0x2b')](handleError(_0x368022,null));};exports['update']=function(_0x244231,_0x204cc0){if(_0x244231[_0xfc85('0x58')]['id']){delete _0x244231[_0xfc85('0x58')]['id'];}return db[_0xfc85('0x3a')][_0xfc85('0x56')]({'where':{'id':_0x244231['params']['id']}})[_0xfc85('0x20')](handleEntityNotFound(_0x204cc0,null))[_0xfc85('0x20')](saveUpdates(_0x244231['body'],null))['then'](respondWithResult(_0x204cc0,null))[_0xfc85('0x2b')](handleError(_0x204cc0,null));};exports[_0xfc85('0x34')]=function(_0x47e10b,_0x31bb1d){return db[_0xfc85('0x3a')][_0xfc85('0x56')]({'where':{'id':_0x47e10b['params']['id']}})[_0xfc85('0x20')](handleEntityNotFound(_0x31bb1d,null))[_0xfc85('0x20')](removeEntity(_0x31bb1d,null))['catch'](handleError(_0x31bb1d,null));};exports['getConfigurations']=function(_0x487ea2,_0x2140e1,_0x271c33){var _0x49b701={};var _0xcf5cc={};var _0x4fa3d6;var _0x25b7f2;return db[_0xfc85('0x3a')][_0xfc85('0x59')]({'where':{'id':_0x487ea2[_0xfc85('0x54')]['id']}})[_0xfc85('0x20')](handleEntityNotFound(_0x2140e1,null))['then'](function(_0xdc8b37){if(_0xdc8b37){_0x4fa3d6=_0xdc8b37;_0xcf5cc[_0xfc85('0x3f')]=_[_0xfc85('0x41')](db[_0xfc85('0x5a')][_0xfc85('0x3b')]);_0xcf5cc['query']=_[_0xfc85('0x41')](_0x487ea2[_0xfc85('0x40')]);_0xcf5cc['filters']=_[_0xfc85('0x43')](_0xcf5cc[_0xfc85('0x3f')],_0xcf5cc[_0xfc85('0x40')]);_0x49b701[_0xfc85('0x44')]=_[_0xfc85('0x43')](_0xcf5cc[_0xfc85('0x3f')],qs[_0xfc85('0x45')](_0x487ea2['query'][_0xfc85('0x45')]));_0x49b701[_0xfc85('0x44')]=_0x49b701[_0xfc85('0x44')][_0xfc85('0x46')]?_0x49b701[_0xfc85('0x44')]:_0xcf5cc[_0xfc85('0x3f')];_0x49b701[_0xfc85('0x4a')]=qs[_0xfc85('0x4b')](_0x487ea2['query'][_0xfc85('0x4b')]);_0x49b701[_0xfc85('0x4c')]=qs[_0xfc85('0x42')](_[_0xfc85('0x5b')](_0x487ea2[_0xfc85('0x40')],_0xcf5cc[_0xfc85('0x42')]));if(_0x487ea2[_0xfc85('0x40')][_0xfc85('0x4d')]){_0x49b701[_0xfc85('0x4c')]=_['merge'](_0x49b701['where'],{'$or':_['map'](_0x49b701[_0xfc85('0x44')],function(_0xbf5a10){var _0x2e28a9={};_0x2e28a9[_0xbf5a10]={'$like':'%'+_0x487ea2[_0xfc85('0x40')]['filter']+'%'};return _0x2e28a9;})});}_0x49b701=_[_0xfc85('0x4e')]({},_0x49b701,_0x487ea2['options']);return _0x4fa3d6[_0xfc85('0x5c')](_0x49b701);}})['then'](function(_0x2f1ab6){if(_0x2f1ab6){_0x25b7f2=_0x2f1ab6['length'];if(!_0x487ea2[_0xfc85('0x40')][_0xfc85('0x47')]('nolimit')){_0x49b701[_0xfc85('0x49')]=qs[_0xfc85('0x49')](_0x487ea2[_0xfc85('0x40')][_0xfc85('0x49')]);_0x49b701[_0xfc85('0x30')]=qs[_0xfc85('0x30')](_0x487ea2[_0xfc85('0x40')][_0xfc85('0x30')]);}return _0x4fa3d6[_0xfc85('0x5c')](_0x49b701);}})[_0xfc85('0x20')](function(_0x598823){if(_0x598823){return _0x598823?{'count':_0x25b7f2,'rows':_0x598823}:null;}})[_0xfc85('0x20')](respondWithResult(_0x2140e1,null))[_0xfc85('0x2b')](handleError(_0x2140e1,null));};exports[_0xfc85('0x5d')]=function(_0x56bb41,_0x22b513,_0x47279f){if(_0x56bb41[_0xfc85('0x58')]['id']){delete _0x56bb41[_0xfc85('0x58')]['id'];}return db[_0xfc85('0x3a')][_0xfc85('0x59')]({'where':{'id':_0x56bb41[_0xfc85('0x54')]['id']}})['then'](handleEntityNotFound(_0x22b513,null))['then'](function(_0x2e25d3){if(_0x2e25d3){_0x56bb41[_0xfc85('0x58')][_0xfc85('0x5e')]=_0x2e25d3['id'];_0x56bb41[_0xfc85('0x58')][_0xfc85('0x5f')]=integrations[_0xfc85('0x60')](_0x56bb41['body'][_0xfc85('0x61')],_0x56bb41['body']['type']);_0x56bb41[_0xfc85('0x58')][_0xfc85('0x62')]=integrations[_0xfc85('0x63')](_0x56bb41[_0xfc85('0x58')][_0xfc85('0x61')],_0x56bb41[_0xfc85('0x58')][_0xfc85('0x3d')]);return db[_0xfc85('0x5a')]['create'](_0x56bb41[_0xfc85('0x58')],{'include':[{'model':db[_0xfc85('0x64')],'as':_0xfc85('0x5f')},{'model':db['FreshdeskField'],'as':_0xfc85('0x62')}]});}return null;})[_0xfc85('0x20')](respondWithResult(_0x22b513,null))[_0xfc85('0x2b')](handleError(_0x22b513,null));};exports['getFields']=function(_0x42d9f4,_0x20b02a,_0x5b5078){var _0x5f0b71='';return db[_0xfc85('0x3a')][_0xfc85('0x59')]({'where':{'id':_0x42d9f4[_0xfc85('0x54')]['id']},'attributes':['id',_0xfc85('0x65'),_0xfc85('0x66')]})[_0xfc85('0x20')](handleEntityNotFound(_0x20b02a,null))['then'](function(_0x3ebcfe){if(_0x3ebcfe){_0x5f0b71=_0x3ebcfe[_0xfc85('0x65')];var _0x3042f1=_0x5f0b71[_0xfc85('0x67')](-0x1);if(_0x3042f1==='/'){_0x5f0b71=_0x5f0b71[_0xfc85('0x68')](0x0,_0x5f0b71[_0xfc85('0x69')](_0x3042f1));}return rp({'method':'GET','uri':util[_0xfc85('0x6a')](_0xfc85('0x6b'),_0x5f0b71,_0xfc85('0x6c')),'headers':{'Authorization':util[_0xfc85('0x6a')]('Basic\x20%s',new Buffer(util[_0xfc85('0x6a')](_0xfc85('0x6d'),_0x3ebcfe['apiKey']))['toString']('base64'))},'json':!![]});}})['then'](function(_0x3a8244){if(_0x3a8244){var _0x36e70d=[_0xfc85('0x6e'),_0xfc85('0x6f'),_0xfc85('0x70'),_0xfc85('0x71'),_0xfc85('0x2d'),'priority',_0xfc85('0x72'),_0xfc85('0x73'),'ticket_type','group','company'];_[_0xfc85('0x74')](_0x3a8244,function(_0x430589){return _0x36e70d[_0xfc85('0x75')](_0x430589[_0xfc85('0x37')])||!_0x430589['default']&&_0x430589[_0xfc85('0x3d')]!=='custom_text'&&_0x430589[_0xfc85('0x3d')]!==_0xfc85('0x76');});return{'count':_0x3a8244['length'],'rows':_[_0xfc85('0x39')](_0x3a8244,function(_0x4c3c15){return{'id':_0x4c3c15[_0xfc85('0x37')],'name':_0x4c3c15[_0xfc85('0x77')],'custom':!_0x4c3c15[_0xfc85('0x78')],'options':_0x4c3c15[_0xfc85('0x79')]?_['map'](_0x4c3c15[_0xfc85('0x79')],function(_0x1cc74a){return{'name':_[_0xfc85('0x7a')](_0x1cc74a),'value':_0x1cc74a};}):[]};})};}})['then'](respondWithResult(_0x20b02a,null))[_0xfc85('0x2b')](function(_0x2ab46e){var _0x5948fc=_0x42d9f4[_0xfc85('0x40')][_0xfc85('0x1d')]?0x1f4:_0x2ab46e[_0xfc85('0x7b')]||0x1f4;logger[_0xfc85('0x27')](_0xfc85('0x7c'),_0xfc85('0x7d'),_0x5948fc,JSON[_0xfc85('0x26')](_0x2ab46e));delete _0x2ab46e[_0xfc85('0x37')];if(_0x5948fc===0x191){_0x5948fc=0x190;}_0x20b02a[_0xfc85('0x2d')](_0x5948fc)[_0xfc85('0x7e')](_0x42d9f4[_0xfc85('0x40')][_0xfc85('0x1d')]?{'message':_0xfc85('0x7f'),'statusCode':_0x2ab46e['statusCode']}:_0x2ab46e);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 10d116c..a5eb3be 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 _0xb2f0=['rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','define','FreshdeskAccount','int_freshdesk_accounts','../../config/logger','api','bluebird'];(function(_0x43b75b,_0x703896){var _0x23d38b=function(_0x2bda32){while(--_0x2bda32){_0x43b75b['push'](_0x43b75b['shift']());}};_0x23d38b(++_0x703896);}(_0xb2f0,0x147));var _0x0b2f=function(_0x2ca8a1,_0x424ef2){_0x2ca8a1=_0x2ca8a1-0x0;var _0x46ed4a=_0xb2f0[_0x2ca8a1];return _0x46ed4a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0b2f('0x0'))(_0x0b2f('0x1'));var moment=require('moment');var BPromise=require(_0x0b2f('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0b2f('0x3'));var config=require(_0x0b2f('0x4'));var attributes=require(_0x0b2f('0x5'));var integrations=require(_0x0b2f('0x6'));module['exports']=function(_0x55f69e,_0x2b2201){return _0x55f69e[_0x0b2f('0x7')](_0x0b2f('0x8'),attributes,{'tableName':_0x0b2f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb8e4=['path','rimraf','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x23f4df,_0x5a941e){var _0x4b5960=function(_0x2778d5){while(--_0x2778d5){_0x23f4df['push'](_0x23f4df['shift']());}};_0x4b5960(++_0x5a941e);}(_0xb8e4,0x1f1));var _0x4b8e=function(_0x449563,_0x552684){_0x449563=_0x449563-0x0;var _0x2047b7=_0xb8e4[_0x449563];return _0x2047b7;};'use strict';var _=require(_0x4b8e('0x0'));var util=require(_0x4b8e('0x1'));var logger=require(_0x4b8e('0x2'))(_0x4b8e('0x3'));var moment=require(_0x4b8e('0x4'));var BPromise=require(_0x4b8e('0x5'));var rp=require(_0x4b8e('0x6'));var fs=require('fs');var path=require(_0x4b8e('0x7'));var rimraf=require(_0x4b8e('0x8'));var config=require('../../config/environment');var attributes=require(_0x4b8e('0x9'));var integrations=require(_0x4b8e('0xa'));module[_0x4b8e('0xb')]=function(_0x518669,_0x28abd3){return _0x518669['define'](_0x4b8e('0xc'),attributes,{'tableName':_0x4b8e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index 1425a00..623c2cd 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 _0xa2ca=['stringify','error','message','result','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes','include','map','model','catch','ShowFreshdeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s'];(function(_0x27ae6b,_0x366a6f){var _0x758a3b=function(_0x24c36c){while(--_0x24c36c){_0x27ae6b['push'](_0x27ae6b['shift']());}};_0x758a3b(++_0x366a6f);}(_0xa2ca,0x16f));var _0xaa2c=function(_0x10917c,_0x53e1d2){_0x10917c=_0x10917c-0x0;var _0x337877=_0xa2ca[_0x10917c];return _0x337877;};'use strict';var _=require(_0xaa2c('0x0'));var util=require(_0xaa2c('0x1'));var moment=require(_0xaa2c('0x2'));var BPromise=require(_0xaa2c('0x3'));var rs=require(_0xaa2c('0x4'));var fs=require('fs');var Redis=require(_0xaa2c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xaa2c('0x6'));var logger=require(_0xaa2c('0x7'))('rpc');var config=require(_0xaa2c('0x8'));var jayson=require(_0xaa2c('0x9'));var client=jayson[_0xaa2c('0xa')][_0xaa2c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16255b,_0x1b6a66,_0x25b4d0){return new BPromise(function(_0x34bbeb,_0x559fd9){return client['request'](_0x16255b,_0x25b4d0)[_0xaa2c('0xc')](function(_0x1c883d){logger[_0xaa2c('0xd')](_0xaa2c('0xe'),_0x1b6a66,_0xaa2c('0xf'));logger[_0xaa2c('0x10')](_0xaa2c('0x11'),_0x1b6a66,_0xaa2c('0xf'),JSON[_0xaa2c('0x12')](_0x1c883d));if(_0x1c883d[_0xaa2c('0x13')]){if(_0x1c883d[_0xaa2c('0x13')]['code']===0x1f4){logger[_0xaa2c('0x13')](_0xaa2c('0xe'),_0x1b6a66,_0x1c883d[_0xaa2c('0x13')][_0xaa2c('0x14')]);return _0x559fd9(_0x1c883d['error'][_0xaa2c('0x14')]);}logger[_0xaa2c('0x13')](_0xaa2c('0xe'),_0x1b6a66,_0x1c883d[_0xaa2c('0x13')][_0xaa2c('0x14')]);return _0x34bbeb(_0x1c883d[_0xaa2c('0x13')]['message']);}else{logger['info'](_0xaa2c('0xe'),_0x1b6a66,'request\x20sent');_0x34bbeb(_0x1c883d[_0xaa2c('0x15')][_0xaa2c('0x14')]);}})['catch'](function(_0x200e52){logger[_0xaa2c('0x13')](_0xaa2c('0xe'),_0x1b6a66,_0x200e52);_0x559fd9(_0x200e52);});});}exports[_0xaa2c('0x16')]=function(_0x414212){var _0xd0d833=this;return new Promise(function(_0x5ede1b,_0x3c333f){return db[_0xaa2c('0x17')][_0xaa2c('0x18')]({'raw':_0x414212[_0xaa2c('0x19')]?_0x414212[_0xaa2c('0x19')][_0xaa2c('0x1a')]===undefined?!![]:![]:!![],'where':_0x414212['options']?_0x414212[_0xaa2c('0x19')][_0xaa2c('0x1b')]||null:null,'attributes':_0x414212[_0xaa2c('0x19')]?_0x414212['options'][_0xaa2c('0x1c')]||null:null,'limit':_0x414212[_0xaa2c('0x19')]?_0x414212[_0xaa2c('0x19')]['limit']||null:null,'include':_0x414212[_0xaa2c('0x19')]?_0x414212[_0xaa2c('0x19')][_0xaa2c('0x1d')]?_[_0xaa2c('0x1e')](_0x414212[_0xaa2c('0x19')][_0xaa2c('0x1d')],function(_0xe7fc87){return{'model':db[_0xe7fc87['model']],'as':_0xe7fc87['as'],'attributes':_0xe7fc87['attributes'],'include':_0xe7fc87['include']?_[_0xaa2c('0x1e')](_0xe7fc87['include'],function(_0x55be8e){return{'model':db[_0x55be8e[_0xaa2c('0x1f')]],'as':_0x55be8e['as'],'attributes':_0x55be8e[_0xaa2c('0x1c')],'include':_0x55be8e['include']?_[_0xaa2c('0x1e')](_0x55be8e[_0xaa2c('0x1d')],function(_0xdb485){return{'model':db[_0xdb485[_0xaa2c('0x1f')]],'as':_0xdb485['as'],'attributes':_0xdb485['attributes']};}):[]};}):[]};}):[]:[]})[_0xaa2c('0xc')](function(_0x3df322){logger[_0xaa2c('0xd')](_0xaa2c('0x16'),_0x414212);logger[_0xaa2c('0x10')](_0xaa2c('0x16'),_0x414212,JSON['stringify'](_0x3df322));_0x5ede1b(_0x3df322);})[_0xaa2c('0x20')](function(_0x17dba4){logger[_0xaa2c('0x13')](_0xaa2c('0x16'),_0x17dba4['message'],_0x414212);_0x3c333f(_0xd0d833[_0xaa2c('0x13')](0x1f4,_0x17dba4[_0xaa2c('0x14')]));});});};exports[_0xaa2c('0x21')]=function(_0x388735){var _0x3bd1c7=this;return new Promise(function(_0x5b39f9,_0x2d7b69){return db[_0xaa2c('0x17')][_0xaa2c('0x22')]({'raw':_0x388735[_0xaa2c('0x19')]?_0x388735[_0xaa2c('0x19')][_0xaa2c('0x1a')]===undefined?!![]:![]:!![],'where':_0x388735[_0xaa2c('0x19')]?_0x388735[_0xaa2c('0x19')][_0xaa2c('0x1b')]||null:null,'attributes':_0x388735['options']?_0x388735['options'][_0xaa2c('0x1c')]||null:null,'include':_0x388735['options']?_0x388735['options'][_0xaa2c('0x1d')]?_[_0xaa2c('0x1e')](_0x388735[_0xaa2c('0x19')]['include'],function(_0x23849b){return{'model':db[_0x23849b[_0xaa2c('0x1f')]],'as':_0x23849b['as'],'attributes':_0x23849b['attributes'],'include':_0x23849b[_0xaa2c('0x1d')]?_['map'](_0x23849b[_0xaa2c('0x1d')],function(_0x13e6b0){return{'model':db[_0x13e6b0['model']],'as':_0x13e6b0['as'],'attributes':_0x13e6b0[_0xaa2c('0x1c')],'include':_0x13e6b0[_0xaa2c('0x1d')]?_['map'](_0x13e6b0[_0xaa2c('0x1d')],function(_0x46fd7f){return{'model':db[_0x46fd7f[_0xaa2c('0x1f')]],'as':_0x46fd7f['as'],'attributes':_0x46fd7f[_0xaa2c('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4147f6){logger['info'](_0xaa2c('0x21'),_0x388735);logger['debug'](_0xaa2c('0x21'),_0x388735,JSON[_0xaa2c('0x12')](_0x4147f6));_0x5b39f9(_0x4147f6);})['catch'](function(_0x52fb9b){logger['error'](_0xaa2c('0x21'),_0x52fb9b[_0xaa2c('0x14')],_0x388735);_0x2d7b69(_0x3bd1c7[_0xaa2c('0x13')](0x1f4,_0x52fb9b[_0xaa2c('0x14')]));});});}; \ No newline at end of file +var _0x11ea=['FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','FreshdeskAccount,\x20%s,\x20%s','message','catch','GetFreshdeskAccount','findAll','options','raw','where','include','attributes','map','model','ShowFreshdeskAccount','FreshdeskAccount','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug'];(function(_0x33f8fe,_0x59f623){var _0x323e30=function(_0x6b0e56){while(--_0x6b0e56){_0x33f8fe['push'](_0x33f8fe['shift']());}};_0x323e30(++_0x59f623);}(_0x11ea,0x100));var _0xa11e=function(_0x5bf22d,_0x212bd8){_0x5bf22d=_0x5bf22d-0x0;var _0x226fc4=_0x11ea[_0x5bf22d];return _0x226fc4;};'use strict';var _=require('lodash');var util=require(_0xa11e('0x0'));var moment=require(_0xa11e('0x1'));var BPromise=require(_0xa11e('0x2'));var rs=require(_0xa11e('0x3'));var fs=require('fs');var Redis=require(_0xa11e('0x4'));var db=require(_0xa11e('0x5'))['db'];var utils=require(_0xa11e('0x6'));var logger=require('../../config/logger')(_0xa11e('0x7'));var config=require(_0xa11e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa11e('0x9')][_0xa11e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41e511,_0x311b07,_0x1c9ba7){return new BPromise(function(_0x4bab0a,_0xded66c){return client[_0xa11e('0xb')](_0x41e511,_0x1c9ba7)[_0xa11e('0xc')](function(_0x3affc0){logger[_0xa11e('0xd')]('FreshdeskAccount,\x20%s,\x20%s',_0x311b07,_0xa11e('0xe'));logger[_0xa11e('0xf')](_0xa11e('0x10'),_0x311b07,_0xa11e('0xe'),JSON[_0xa11e('0x11')](_0x3affc0));if(_0x3affc0[_0xa11e('0x12')]){if(_0x3affc0[_0xa11e('0x12')]['code']===0x1f4){logger[_0xa11e('0x12')](_0xa11e('0x13'),_0x311b07,_0x3affc0[_0xa11e('0x12')][_0xa11e('0x14')]);return _0xded66c(_0x3affc0['error'][_0xa11e('0x14')]);}logger['error'](_0xa11e('0x13'),_0x311b07,_0x3affc0[_0xa11e('0x12')][_0xa11e('0x14')]);return _0x4bab0a(_0x3affc0[_0xa11e('0x12')][_0xa11e('0x14')]);}else{logger[_0xa11e('0xd')](_0xa11e('0x13'),_0x311b07,_0xa11e('0xe'));_0x4bab0a(_0x3affc0['result'][_0xa11e('0x14')]);}})[_0xa11e('0x15')](function(_0x2f1a73){logger[_0xa11e('0x12')](_0xa11e('0x13'),_0x311b07,_0x2f1a73);_0xded66c(_0x2f1a73);});});}exports[_0xa11e('0x16')]=function(_0x558a75){var _0x5d18a4=this;return new Promise(function(_0x55f222,_0xbb4e13){return db['FreshdeskAccount'][_0xa11e('0x17')]({'raw':_0x558a75[_0xa11e('0x18')]?_0x558a75[_0xa11e('0x18')][_0xa11e('0x19')]===undefined?!![]:![]:!![],'where':_0x558a75[_0xa11e('0x18')]?_0x558a75['options'][_0xa11e('0x1a')]||null:null,'attributes':_0x558a75[_0xa11e('0x18')]?_0x558a75[_0xa11e('0x18')]['attributes']||null:null,'limit':_0x558a75[_0xa11e('0x18')]?_0x558a75['options']['limit']||null:null,'include':_0x558a75[_0xa11e('0x18')]?_0x558a75['options']['include']?_['map'](_0x558a75[_0xa11e('0x18')][_0xa11e('0x1b')],function(_0x33f6ba){return{'model':db[_0x33f6ba['model']],'as':_0x33f6ba['as'],'attributes':_0x33f6ba[_0xa11e('0x1c')],'include':_0x33f6ba['include']?_[_0xa11e('0x1d')](_0x33f6ba[_0xa11e('0x1b')],function(_0xd684b9){return{'model':db[_0xd684b9['model']],'as':_0xd684b9['as'],'attributes':_0xd684b9[_0xa11e('0x1c')],'include':_0xd684b9[_0xa11e('0x1b')]?_[_0xa11e('0x1d')](_0xd684b9[_0xa11e('0x1b')],function(_0x16ad90){return{'model':db[_0x16ad90[_0xa11e('0x1e')]],'as':_0x16ad90['as'],'attributes':_0x16ad90['attributes']};}):[]};}):[]};}):[]:[]})[_0xa11e('0xc')](function(_0x11b95b){logger[_0xa11e('0xd')](_0xa11e('0x16'),_0x558a75);logger[_0xa11e('0xf')](_0xa11e('0x16'),_0x558a75,JSON[_0xa11e('0x11')](_0x11b95b));_0x55f222(_0x11b95b);})[_0xa11e('0x15')](function(_0x37c377){logger[_0xa11e('0x12')]('GetFreshdeskAccount',_0x37c377[_0xa11e('0x14')],_0x558a75);_0xbb4e13(_0x5d18a4['error'](0x1f4,_0x37c377[_0xa11e('0x14')]));});});};exports[_0xa11e('0x1f')]=function(_0x199cd6){var _0x524731=this;return new Promise(function(_0x23777b,_0x391500){return db[_0xa11e('0x20')][_0xa11e('0x21')]({'raw':_0x199cd6[_0xa11e('0x18')]?_0x199cd6[_0xa11e('0x18')][_0xa11e('0x19')]===undefined?!![]:![]:!![],'where':_0x199cd6[_0xa11e('0x18')]?_0x199cd6[_0xa11e('0x18')]['where']||null:null,'attributes':_0x199cd6[_0xa11e('0x18')]?_0x199cd6[_0xa11e('0x18')][_0xa11e('0x1c')]||null:null,'include':_0x199cd6['options']?_0x199cd6['options'][_0xa11e('0x1b')]?_[_0xa11e('0x1d')](_0x199cd6[_0xa11e('0x18')][_0xa11e('0x1b')],function(_0x23b4f7){return{'model':db[_0x23b4f7[_0xa11e('0x1e')]],'as':_0x23b4f7['as'],'attributes':_0x23b4f7[_0xa11e('0x1c')],'include':_0x23b4f7[_0xa11e('0x1b')]?_[_0xa11e('0x1d')](_0x23b4f7[_0xa11e('0x1b')],function(_0x2bb278){return{'model':db[_0x2bb278[_0xa11e('0x1e')]],'as':_0x2bb278['as'],'attributes':_0x2bb278['attributes'],'include':_0x2bb278[_0xa11e('0x1b')]?_[_0xa11e('0x1d')](_0x2bb278[_0xa11e('0x1b')],function(_0xb25f){return{'model':db[_0xb25f[_0xa11e('0x1e')]],'as':_0xb25f['as'],'attributes':_0xb25f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x446dae){logger[_0xa11e('0xd')]('ShowFreshdeskAccount',_0x199cd6);logger['debug']('ShowFreshdeskAccount',_0x199cd6,JSON['stringify'](_0x446dae));_0x23777b(_0x446dae);})[_0xa11e('0x15')](function(_0x6201a4){logger[_0xa11e('0x12')](_0xa11e('0x1f'),_0x6201a4['message'],_0x199cd6);_0x391500(_0x524731[_0xa11e('0x12')](0x1f4,_0x6201a4[_0xa11e('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index d8a0876..146c99c 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 _0x076f=['delete','/:id','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','isAuthenticated','index','show','get','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','create','post','setTags','put'];(function(_0x278892,_0x24e66a){var _0x2db21c=function(_0x31b1d5){while(--_0x31b1d5){_0x278892['push'](_0x278892['shift']());}};_0x2db21c(++_0x24e66a);}(_0x076f,0x1d7));var _0xf076=function(_0x184aaa,_0x4b4b18){_0x184aaa=_0x184aaa-0x0;var _0xd574fb=_0x076f[_0x184aaa];return _0xd574fb;};'use strict';var multer=require(_0xf076('0x0'));var util=require(_0xf076('0x1'));var path=require(_0xf076('0x2'));var timeout=require(_0xf076('0x3'));var express=require(_0xf076('0x4'));var router=express['Router']();var auth=require(_0xf076('0x5'));var interaction=require(_0xf076('0x6'));var config=require(_0xf076('0x7'));var controller=require(_0xf076('0x8'));router['get']('/',auth[_0xf076('0x9')](),controller[_0xf076('0xa')]);router['get']('/:id',auth[_0xf076('0x9')](),controller[_0xf076('0xb')]);router[_0xf076('0xc')](_0xf076('0xd'),auth['isAuthenticated'](),controller[_0xf076('0xe')]);router['get']('/:id/subjects',auth[_0xf076('0x9')](),controller[_0xf076('0xf')]);router['get'](_0xf076('0x10'),auth[_0xf076('0x9')](),controller[_0xf076('0x11')]);router['get'](_0xf076('0x12'),auth['isAuthenticated'](),controller['getTags']);router['post']('/',auth[_0xf076('0x9')](),controller[_0xf076('0x13')]);router[_0xf076('0x14')](_0xf076('0x12'),auth[_0xf076('0x9')](),controller[_0xf076('0x15')]);router[_0xf076('0x16')]('/:id',auth[_0xf076('0x9')](),controller['update']);router[_0xf076('0x17')](_0xf076('0x18'),auth[_0xf076('0x9')](),controller['destroy']);module[_0xf076('0x19')]=router; \ No newline at end of file +var _0x3eb0=['../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','/:id/descriptions','getDescriptions','getTags','post','create','setTags','put','update','destroy','multer','path','connect-timeout','Router','../../components/auth/service'];(function(_0x287ed0,_0x619ac0){var _0x101be1=function(_0x1ccdea){while(--_0x1ccdea){_0x287ed0['push'](_0x287ed0['shift']());}};_0x101be1(++_0x619ac0);}(_0x3eb0,0xeb));var _0x03eb=function(_0x12a24a,_0x4625d5){_0x12a24a=_0x12a24a-0x0;var _0xd16fb8=_0x3eb0[_0x12a24a];return _0xd16fb8;};'use strict';var multer=require(_0x03eb('0x0'));var util=require('util');var path=require(_0x03eb('0x1'));var timeout=require(_0x03eb('0x2'));var express=require('express');var router=express[_0x03eb('0x3')]();var auth=require(_0x03eb('0x4'));var interaction=require(_0x03eb('0x5'));var config=require(_0x03eb('0x6'));var controller=require(_0x03eb('0x7'));router[_0x03eb('0x8')]('/',auth[_0x03eb('0x9')](),controller[_0x03eb('0xa')]);router[_0x03eb('0x8')](_0x03eb('0xb'),auth[_0x03eb('0x9')](),controller[_0x03eb('0xc')]);router[_0x03eb('0x8')](_0x03eb('0xd'),auth['isAuthenticated'](),controller['getFields']);router[_0x03eb('0x8')](_0x03eb('0xe'),auth[_0x03eb('0x9')](),controller['getSubjects']);router['get'](_0x03eb('0xf'),auth[_0x03eb('0x9')](),controller[_0x03eb('0x10')]);router[_0x03eb('0x8')]('/:id/tags',auth[_0x03eb('0x9')](),controller[_0x03eb('0x11')]);router[_0x03eb('0x12')]('/',auth[_0x03eb('0x9')](),controller[_0x03eb('0x13')]);router[_0x03eb('0x12')]('/:id/tags',auth[_0x03eb('0x9')](),controller[_0x03eb('0x14')]);router[_0x03eb('0x15')](_0x03eb('0xb'),auth[_0x03eb('0x9')](),controller[_0x03eb('0x16')]);router['delete'](_0x03eb('0xb'),auth['isAuthenticated'](),controller[_0x03eb('0x17')]);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 1ac81c6..c44b434 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 _0x88e0=['sequelize','exports','STRING'];(function(_0x8cd8da,_0x13ce25){var _0x5c59f2=function(_0x134cc1){while(--_0x134cc1){_0x8cd8da['push'](_0x8cd8da['shift']());}};_0x5c59f2(++_0x13ce25);}(_0x88e0,0x1f2));var _0x088e=function(_0x272764,_0x1d2b95){_0x272764=_0x272764-0x0;var _0x29a5a5=_0x88e0[_0x272764];return _0x29a5a5;};'use strict';var Sequelize=require(_0x088e('0x0'));module[_0x088e('0x1')]={'name':{'type':Sequelize[_0x088e('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2ee8=['exports','STRING','sequelize'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x2ee8,0x1c4));var _0x82ee=function(_0x2b22f8,_0x3f3ce8){_0x2b22f8=_0x2b22f8-0x0;var _0x146dd2=_0x2ee8[_0x2b22f8];return _0x146dd2;};'use strict';var Sequelize=require(_0x82ee('0x0'));module[_0x82ee('0x1')]={'name':{'type':Sequelize[_0x82ee('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 7dc4e86..a75933a 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 _0x34dc=['path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','result','catch','sendStatus','status','count','offset','limit','set','Content-Range','json','reject','save','update','destroy','end','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','findAll','rows','show','params','include','options','find','create','body','findOne','FreshdeskField','getFields','getSubjects','getDescriptions','getTags','Tag','ids','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util'];(function(_0xe8bb8,_0x2e2fab){var _0x307a14=function(_0x3587f0){while(--_0x3587f0){_0xe8bb8['push'](_0xe8bb8['shift']());}};_0x307a14(++_0x2e2fab);}(_0x34dc,0x124));var _0xc34d=function(_0x22040f,_0x378f4b){_0x22040f=_0x22040f-0x0;var _0x589aac=_0x34dc[_0x22040f];return _0x589aac;};'use strict';var pdf=require(_0xc34d('0x0'));var emlformat=require(_0xc34d('0x1'));var rimraf=require(_0xc34d('0x2'));var zipdir=require(_0xc34d('0x3'));var jsonpatch=require(_0xc34d('0x4'));var rp=require(_0xc34d('0x5'));var moment=require('moment');var BPromise=require(_0xc34d('0x6'));var Mustache=require('mustache');var util=require(_0xc34d('0x7'));var path=require(_0xc34d('0x8'));var sox=require('sox');var csv=require(_0xc34d('0x9'));var ejs=require(_0xc34d('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc34d('0xb'));var crypto=require(_0xc34d('0xc'));var jsforce=require(_0xc34d('0xd'));var deskjs=require(_0xc34d('0xe'));var toCsv=require(_0xc34d('0x9'));var querystring=require(_0xc34d('0xf'));var Papa=require(_0xc34d('0x10'));var Redis=require(_0xc34d('0x11'));var authService=require(_0xc34d('0x12'));var qs=require(_0xc34d('0x13'));var as=require(_0xc34d('0x14'));var hardwareService=require(_0xc34d('0x15'));var logger=require(_0xc34d('0x16'))(_0xc34d('0x17'));var utils=require(_0xc34d('0x18'));var config=require('../../config/environment');var db=require(_0xc34d('0x19'))['db'];var jayson=require(_0xc34d('0x1a'));var client=jayson['client'][_0xc34d('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x5b6813,_0x1a447c,_0x19295c){if(_0x19295c){var _0x2c5ea7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2c5ea7[_0xc34d('0x1c')](_0x1a447c)){return _0x5b6813;}else{throw new db['Sequelize']['ValidationError'](_0xc34d('0x1d'));}}else{return _0x5b6813;}}function respondWithRpcPromise(_0x385034,_0x44fc2a,_0x193163,_0x334e06){return new BPromise(function(_0x22c286,_0x2a8dcf){var _0x12595f=_0x334e06||client;return _0x12595f[_0xc34d('0x1e')](_0x385034,_0x193163)[_0xc34d('0x1f')](function(_0x5d556b){logger[_0xc34d('0x20')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x44fc2a,_0xc34d('0x21'));logger[_0xc34d('0x22')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x44fc2a,_0xc34d('0x21'),JSON[_0xc34d('0x23')](_0x5d556b));if(_0x5d556b['error']){if(_0x5d556b[_0xc34d('0x24')][_0xc34d('0x25')]===0x1f4){logger[_0xc34d('0x24')](_0xc34d('0x26'),_0x44fc2a,_0x5d556b[_0xc34d('0x24')][_0xc34d('0x27')]);return _0x2a8dcf(_0x5d556b[_0xc34d('0x24')][_0xc34d('0x27')]);}logger[_0xc34d('0x24')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x44fc2a,_0x5d556b['error'][_0xc34d('0x27')]);return _0x22c286(_0x5d556b['error'][_0xc34d('0x27')]);}else{logger['info'](_0xc34d('0x26'),_0x44fc2a,'request\x20sent');_0x22c286(_0x5d556b[_0xc34d('0x28')][_0xc34d('0x27')]);}})[_0xc34d('0x29')](function(_0x18f0cf){logger['error'](_0xc34d('0x26'),_0x44fc2a,_0x18f0cf);_0x2a8dcf(_0x18f0cf);});});}function respondWithStatusCode(_0x4e4ab6,_0x3843e7){_0x3843e7=_0x3843e7||0xcc;return function(_0x4371d5){if(_0x4371d5){return _0x4e4ab6[_0xc34d('0x2a')](_0x3843e7);}return _0x4e4ab6[_0xc34d('0x2b')](_0x3843e7)['end']();};}function respondWithResult(_0x341b74,_0x2d506){_0x2d506=_0x2d506||0xc8;return function(_0xe25ed4){if(_0xe25ed4){return _0x341b74[_0xc34d('0x2b')](_0x2d506)['json'](_0xe25ed4);}};}function respondWithFilteredResult(_0x346e95,_0x2d0488){return function(_0x5b2f0d){if(_0x5b2f0d){var _0x561ea9=_0x5b2f0d[_0xc34d('0x2c')],_0x46f767=_0x2d0488['offset'],_0x1a5740=_0x2d0488[_0xc34d('0x2d')]+_0x2d0488[_0xc34d('0x2e')],_0x4f78d3;if(_0x1a5740>=_0x561ea9){_0x1a5740=_0x561ea9;_0x4f78d3=0xc8;}else{_0x4f78d3=0xce;}_0x346e95[_0xc34d('0x2b')](_0x4f78d3);return _0x346e95[_0xc34d('0x2f')](_0xc34d('0x30'),_0x46f767+'-'+_0x1a5740+'/'+_0x561ea9)[_0xc34d('0x31')](_0x5b2f0d);}return null;};}function patchUpdates(_0x5907d2){return function(_0x5aed8e){try{jsonpatch['apply'](_0x5aed8e,_0x5907d2,!![]);}catch(_0x4e8975){return BPromise[_0xc34d('0x32')](_0x4e8975);}return _0x5aed8e[_0xc34d('0x33')]();};}function saveUpdates(_0x589164,_0x97baaa){return function(_0x4f208a){if(_0x4f208a){return _0x4f208a[_0xc34d('0x34')](_0x589164)[_0xc34d('0x1f')](function(_0x278fae){return _0x278fae;});}return null;};}function removeEntity(_0x59fe6f,_0x5ab0b1){return function(_0x338a79){if(_0x338a79){return _0x338a79[_0xc34d('0x35')]()[_0xc34d('0x1f')](function(){_0x59fe6f[_0xc34d('0x2b')](0xcc)[_0xc34d('0x36')]();});}};}function handleEntityNotFound(_0x12ac8d,_0x5ec711){return function(_0x103ba6){if(!_0x103ba6){_0x12ac8d[_0xc34d('0x2a')](0x194);}return _0x103ba6;};}function handleError(_0x12d0a0,_0x4901d4){_0x4901d4=_0x4901d4||0x1f4;return function(_0x411ad5){logger[_0xc34d('0x24')](_0x411ad5[_0xc34d('0x37')]);if(_0x411ad5['name']){delete _0x411ad5[_0xc34d('0x38')];}_0x12d0a0[_0xc34d('0x2b')](_0x4901d4)[_0xc34d('0x39')](_0x411ad5);};}exports[_0xc34d('0x3a')]=function(_0x4453cb,_0x3cf285){var _0x4f6735={},_0x208b90={},_0x2369e9={'count':0x0,'rows':[]};var _0x57eed2=_[_0xc34d('0x3b')](db[_0xc34d('0x3c')][_0xc34d('0x3d')],function(_0x373d50){return{'name':_0x373d50[_0xc34d('0x3e')],'type':_0x373d50[_0xc34d('0x3f')][_0xc34d('0x40')]};});_0x208b90[_0xc34d('0x41')]=_[_0xc34d('0x3b')](_0x57eed2,_0xc34d('0x38'));_0x208b90[_0xc34d('0x42')]=_[_0xc34d('0x43')](_0x4453cb[_0xc34d('0x42')]);_0x208b90[_0xc34d('0x44')]=_[_0xc34d('0x45')](_0x208b90[_0xc34d('0x41')],_0x208b90[_0xc34d('0x42')]);_0x4f6735['attributes']=_[_0xc34d('0x45')](_0x208b90[_0xc34d('0x41')],qs[_0xc34d('0x46')](_0x4453cb[_0xc34d('0x42')]['fields']));_0x4f6735[_0xc34d('0x47')]=_0x4f6735[_0xc34d('0x47')][_0xc34d('0x48')]?_0x4f6735[_0xc34d('0x47')]:_0x208b90['model'];if(!_0x4453cb[_0xc34d('0x42')][_0xc34d('0x49')](_0xc34d('0x4a'))){_0x4f6735[_0xc34d('0x2e')]=qs[_0xc34d('0x2e')](_0x4453cb['query'][_0xc34d('0x2e')]);_0x4f6735[_0xc34d('0x2d')]=qs[_0xc34d('0x2d')](_0x4453cb[_0xc34d('0x42')][_0xc34d('0x2d')]);}_0x4f6735[_0xc34d('0x4b')]=qs[_0xc34d('0x4c')](_0x4453cb['query'][_0xc34d('0x4c')]);_0x4f6735['where']=qs[_0xc34d('0x44')](_[_0xc34d('0x4d')](_0x4453cb['query'],_0x208b90[_0xc34d('0x44')]));if(_0x4453cb[_0xc34d('0x42')][_0xc34d('0x4e')]){_0x4f6735[_0xc34d('0x4f')]=_[_0xc34d('0x50')](_0x4f6735[_0xc34d('0x4f')],{'$or':_[_0xc34d('0x3b')](_0x57eed2,function(_0x52373d){if(_0x52373d[_0xc34d('0x3f')]!==_0xc34d('0x51')){var _0x210524={};_0x210524[_0x52373d['name']]={'$like':'%'+_0x4453cb[_0xc34d('0x42')]['filter']+'%'};return _0x210524;}})});}_0x4f6735=_['merge']({},_0x4f6735,_0x4453cb['options']);var _0x49fb1f={'where':_0x4f6735[_0xc34d('0x4f')]};return db['FreshdeskConfiguration'][_0xc34d('0x2c')](_0x49fb1f)['then'](function(_0x4d18fc){_0x2369e9['count']=_0x4d18fc;if(_0x4453cb[_0xc34d('0x42')][_0xc34d('0x52')]){_0x4f6735['include']=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0xc34d('0x53')](_0x4f6735);})[_0xc34d('0x1f')](function(_0x120b7f){_0x2369e9[_0xc34d('0x54')]=_0x120b7f;return _0x2369e9;})[_0xc34d('0x1f')](respondWithFilteredResult(_0x3cf285,_0x4f6735))['catch'](handleError(_0x3cf285,null));};exports[_0xc34d('0x55')]=function(_0x567dde,_0x548a1d){var _0x8ec193={'raw':![],'where':{'id':_0x567dde[_0xc34d('0x56')]['id']}},_0x124bc7={};_0x124bc7[_0xc34d('0x41')]=_[_0xc34d('0x43')](db[_0xc34d('0x3c')][_0xc34d('0x3d')]);_0x124bc7[_0xc34d('0x42')]=_[_0xc34d('0x43')](_0x567dde[_0xc34d('0x42')]);_0x124bc7[_0xc34d('0x44')]=_[_0xc34d('0x45')](_0x124bc7[_0xc34d('0x41')],_0x124bc7[_0xc34d('0x42')]);_0x8ec193[_0xc34d('0x47')]=_[_0xc34d('0x45')](_0x124bc7[_0xc34d('0x41')],qs[_0xc34d('0x46')](_0x567dde[_0xc34d('0x42')][_0xc34d('0x46')]));_0x8ec193['attributes']=_0x8ec193[_0xc34d('0x47')]['length']?_0x8ec193['attributes']:_0x124bc7[_0xc34d('0x41')];if(_0x567dde['query'][_0xc34d('0x52')]){_0x8ec193[_0xc34d('0x57')]=[{'all':!![]}];}_0x8ec193=_[_0xc34d('0x50')]({},_0x8ec193,_0x567dde[_0xc34d('0x58')]);return db[_0xc34d('0x3c')][_0xc34d('0x59')](_0x8ec193)['then'](handleEntityNotFound(_0x548a1d,null))[_0xc34d('0x1f')](respondWithResult(_0x548a1d,null))[_0xc34d('0x29')](handleError(_0x548a1d,null));};exports[_0xc34d('0x5a')]=function(_0x180686,_0xff27d){return db[_0xc34d('0x3c')][_0xc34d('0x5a')](_0x180686[_0xc34d('0x5b')],{})[_0xc34d('0x1f')](respondWithResult(_0xff27d,0xc9))[_0xc34d('0x29')](handleError(_0xff27d,null));};exports[_0xc34d('0x34')]=function(_0x13dd10,_0x2de3b5){if(_0x13dd10[_0xc34d('0x5b')]['id']){delete _0x13dd10[_0xc34d('0x5b')]['id'];}return db[_0xc34d('0x3c')]['find']({'where':{'id':_0x13dd10['params']['id']}})[_0xc34d('0x1f')](handleEntityNotFound(_0x2de3b5,null))[_0xc34d('0x1f')](saveUpdates(_0x13dd10[_0xc34d('0x5b')],null))[_0xc34d('0x1f')](respondWithResult(_0x2de3b5,null))[_0xc34d('0x29')](handleError(_0x2de3b5,null));};exports['destroy']=function(_0x16ad2b,_0x1bca57){return db[_0xc34d('0x3c')][_0xc34d('0x59')]({'where':{'id':_0x16ad2b[_0xc34d('0x56')]['id']}})[_0xc34d('0x1f')](handleEntityNotFound(_0x1bca57,null))[_0xc34d('0x1f')](removeEntity(_0x1bca57,null))[_0xc34d('0x29')](handleError(_0x1bca57,null));};exports['getFields']=function(_0xc94563,_0x1e14d3,_0x12580b){var _0x67161d={};var _0x10e066={};var _0x471d9f;var _0x28f7ef;return db[_0xc34d('0x3c')][_0xc34d('0x5c')]({'where':{'id':_0xc94563['params']['id']}})['then'](handleEntityNotFound(_0x1e14d3,null))['then'](function(_0x4f289a){if(_0x4f289a){_0x471d9f=_0x4f289a;_0x10e066['model']=_[_0xc34d('0x43')](db[_0xc34d('0x5d')][_0xc34d('0x3d')]);_0x10e066[_0xc34d('0x42')]=_['keys'](_0xc94563[_0xc34d('0x42')]);_0x10e066[_0xc34d('0x44')]=_[_0xc34d('0x45')](_0x10e066[_0xc34d('0x41')],_0x10e066['query']);_0x67161d[_0xc34d('0x47')]=_[_0xc34d('0x45')](_0x10e066[_0xc34d('0x41')],qs[_0xc34d('0x46')](_0xc94563[_0xc34d('0x42')][_0xc34d('0x46')]));_0x67161d['attributes']=_0x67161d['attributes'][_0xc34d('0x48')]?_0x67161d[_0xc34d('0x47')]:_0x10e066[_0xc34d('0x41')];_0x67161d[_0xc34d('0x4b')]=qs[_0xc34d('0x4c')](_0xc94563[_0xc34d('0x42')][_0xc34d('0x4c')]);_0x67161d[_0xc34d('0x4f')]=qs[_0xc34d('0x44')](_[_0xc34d('0x4d')](_0xc94563[_0xc34d('0x42')],_0x10e066[_0xc34d('0x44')]));if(_0xc94563[_0xc34d('0x42')][_0xc34d('0x4e')]){_0x67161d[_0xc34d('0x4f')]=_[_0xc34d('0x50')](_0x67161d[_0xc34d('0x4f')],{'$or':_[_0xc34d('0x3b')](_0x67161d[_0xc34d('0x47')],function(_0x3367c0){var _0x443c51={};_0x443c51[_0x3367c0]={'$like':'%'+_0xc94563['query'][_0xc34d('0x4e')]+'%'};return _0x443c51;})});}_0x67161d=_['merge']({},_0x67161d,_0xc94563['options']);return _0x471d9f['getFields'](_0x67161d);}})[_0xc34d('0x1f')](function(_0x16eda6){if(_0x16eda6){_0x28f7ef=_0x16eda6[_0xc34d('0x48')];if(!_0xc94563[_0xc34d('0x42')][_0xc34d('0x49')]('nolimit')){_0x67161d[_0xc34d('0x2e')]=qs['limit'](_0xc94563['query'][_0xc34d('0x2e')]);_0x67161d[_0xc34d('0x2d')]=qs['offset'](_0xc94563[_0xc34d('0x42')][_0xc34d('0x2d')]);}return _0x471d9f[_0xc34d('0x5e')](_0x67161d);}})[_0xc34d('0x1f')](function(_0x240694){if(_0x240694){return _0x240694?{'count':_0x28f7ef,'rows':_0x240694}:null;}})[_0xc34d('0x1f')](respondWithResult(_0x1e14d3,null))[_0xc34d('0x29')](handleError(_0x1e14d3,null));};exports[_0xc34d('0x5f')]=function(_0xe7e864,_0x52c661,_0x103923){var _0x129dd8={};var _0x2fe2d8={};var _0x509796;var _0x3ba851;return db[_0xc34d('0x3c')][_0xc34d('0x5c')]({'where':{'id':_0xe7e864[_0xc34d('0x56')]['id']}})[_0xc34d('0x1f')](handleEntityNotFound(_0x52c661,null))['then'](function(_0x3f1042){if(_0x3f1042){_0x509796=_0x3f1042;_0x2fe2d8[_0xc34d('0x41')]=_[_0xc34d('0x43')](db[_0xc34d('0x5d')][_0xc34d('0x3d')]);_0x2fe2d8[_0xc34d('0x42')]=_[_0xc34d('0x43')](_0xe7e864[_0xc34d('0x42')]);_0x2fe2d8[_0xc34d('0x44')]=_[_0xc34d('0x45')](_0x2fe2d8['model'],_0x2fe2d8[_0xc34d('0x42')]);_0x129dd8[_0xc34d('0x47')]=_[_0xc34d('0x45')](_0x2fe2d8[_0xc34d('0x41')],qs[_0xc34d('0x46')](_0xe7e864[_0xc34d('0x42')][_0xc34d('0x46')]));_0x129dd8[_0xc34d('0x47')]=_0x129dd8[_0xc34d('0x47')][_0xc34d('0x48')]?_0x129dd8[_0xc34d('0x47')]:_0x2fe2d8[_0xc34d('0x41')];_0x129dd8[_0xc34d('0x4b')]=qs[_0xc34d('0x4c')](_0xe7e864['query'][_0xc34d('0x4c')]);_0x129dd8['where']=qs['filters'](_[_0xc34d('0x4d')](_0xe7e864[_0xc34d('0x42')],_0x2fe2d8[_0xc34d('0x44')]));if(_0xe7e864[_0xc34d('0x42')][_0xc34d('0x4e')]){_0x129dd8[_0xc34d('0x4f')]=_['merge'](_0x129dd8[_0xc34d('0x4f')],{'$or':_[_0xc34d('0x3b')](_0x129dd8[_0xc34d('0x47')],function(_0x1c8afb){var _0x2c3308={};_0x2c3308[_0x1c8afb]={'$like':'%'+_0xe7e864[_0xc34d('0x42')]['filter']+'%'};return _0x2c3308;})});}_0x129dd8=_[_0xc34d('0x50')]({},_0x129dd8,_0xe7e864[_0xc34d('0x58')]);return _0x509796['getSubjects'](_0x129dd8);}})[_0xc34d('0x1f')](function(_0x1508c0){if(_0x1508c0){_0x3ba851=_0x1508c0[_0xc34d('0x48')];if(!_0xe7e864[_0xc34d('0x42')][_0xc34d('0x49')](_0xc34d('0x4a'))){_0x129dd8[_0xc34d('0x2e')]=qs[_0xc34d('0x2e')](_0xe7e864[_0xc34d('0x42')][_0xc34d('0x2e')]);_0x129dd8[_0xc34d('0x2d')]=qs['offset'](_0xe7e864['query'][_0xc34d('0x2d')]);}return _0x509796['getSubjects'](_0x129dd8);}})[_0xc34d('0x1f')](function(_0x21a58a){if(_0x21a58a){return _0x21a58a?{'count':_0x3ba851,'rows':_0x21a58a}:null;}})['then'](respondWithResult(_0x52c661,null))[_0xc34d('0x29')](handleError(_0x52c661,null));};exports[_0xc34d('0x60')]=function(_0x42c3c7,_0x1d0e01,_0x3eb2c7){var _0x545ad4={};var _0x42cac6={};var _0x27eae7;var _0x2eb021;return db[_0xc34d('0x3c')][_0xc34d('0x5c')]({'where':{'id':_0x42c3c7[_0xc34d('0x56')]['id']}})[_0xc34d('0x1f')](handleEntityNotFound(_0x1d0e01,null))[_0xc34d('0x1f')](function(_0x56df08){if(_0x56df08){_0x27eae7=_0x56df08;_0x42cac6[_0xc34d('0x41')]=_[_0xc34d('0x43')](db[_0xc34d('0x5d')][_0xc34d('0x3d')]);_0x42cac6[_0xc34d('0x42')]=_['keys'](_0x42c3c7['query']);_0x42cac6[_0xc34d('0x44')]=_[_0xc34d('0x45')](_0x42cac6['model'],_0x42cac6[_0xc34d('0x42')]);_0x545ad4[_0xc34d('0x47')]=_[_0xc34d('0x45')](_0x42cac6['model'],qs[_0xc34d('0x46')](_0x42c3c7[_0xc34d('0x42')][_0xc34d('0x46')]));_0x545ad4['attributes']=_0x545ad4[_0xc34d('0x47')][_0xc34d('0x48')]?_0x545ad4[_0xc34d('0x47')]:_0x42cac6[_0xc34d('0x41')];_0x545ad4[_0xc34d('0x4b')]=qs['sort'](_0x42c3c7['query'][_0xc34d('0x4c')]);_0x545ad4[_0xc34d('0x4f')]=qs[_0xc34d('0x44')](_[_0xc34d('0x4d')](_0x42c3c7['query'],_0x42cac6[_0xc34d('0x44')]));if(_0x42c3c7[_0xc34d('0x42')]['filter']){_0x545ad4[_0xc34d('0x4f')]=_[_0xc34d('0x50')](_0x545ad4['where'],{'$or':_[_0xc34d('0x3b')](_0x545ad4['attributes'],function(_0xf6af55){var _0x1c525e={};_0x1c525e[_0xf6af55]={'$like':'%'+_0x42c3c7[_0xc34d('0x42')][_0xc34d('0x4e')]+'%'};return _0x1c525e;})});}_0x545ad4=_[_0xc34d('0x50')]({},_0x545ad4,_0x42c3c7[_0xc34d('0x58')]);return _0x27eae7[_0xc34d('0x60')](_0x545ad4);}})[_0xc34d('0x1f')](function(_0x27e0e9){if(_0x27e0e9){_0x2eb021=_0x27e0e9['length'];if(!_0x42c3c7[_0xc34d('0x42')][_0xc34d('0x49')](_0xc34d('0x4a'))){_0x545ad4[_0xc34d('0x2e')]=qs[_0xc34d('0x2e')](_0x42c3c7[_0xc34d('0x42')][_0xc34d('0x2e')]);_0x545ad4[_0xc34d('0x2d')]=qs['offset'](_0x42c3c7['query'][_0xc34d('0x2d')]);}return _0x27eae7[_0xc34d('0x60')](_0x545ad4);}})[_0xc34d('0x1f')](function(_0x1a608a){if(_0x1a608a){return _0x1a608a?{'count':_0x2eb021,'rows':_0x1a608a}:null;}})[_0xc34d('0x1f')](respondWithResult(_0x1d0e01,null))[_0xc34d('0x29')](handleError(_0x1d0e01,null));};exports[_0xc34d('0x61')]=function(_0x1e0848,_0x10c277,_0x3f4ad0){var _0x2b6646={};var _0x524a8d={};var _0x599e5a;var _0x4c2255;return db[_0xc34d('0x3c')][_0xc34d('0x5c')]({'where':{'id':_0x1e0848[_0xc34d('0x56')]['id']}})[_0xc34d('0x1f')](handleEntityNotFound(_0x10c277,null))[_0xc34d('0x1f')](function(_0x1ac5dd){if(_0x1ac5dd){_0x599e5a=_0x1ac5dd;_0x524a8d[_0xc34d('0x41')]=_['keys'](db[_0xc34d('0x62')][_0xc34d('0x3d')]);_0x524a8d[_0xc34d('0x42')]=_['keys'](_0x1e0848['query']);_0x524a8d[_0xc34d('0x44')]=_['intersection'](_0x524a8d[_0xc34d('0x41')],_0x524a8d[_0xc34d('0x42')]);_0x2b6646['attributes']=_[_0xc34d('0x45')](_0x524a8d[_0xc34d('0x41')],qs[_0xc34d('0x46')](_0x1e0848['query'][_0xc34d('0x46')]));_0x2b6646[_0xc34d('0x47')]=_0x2b6646[_0xc34d('0x47')]['length']?_0x2b6646[_0xc34d('0x47')]:_0x524a8d[_0xc34d('0x41')];_0x2b6646[_0xc34d('0x4b')]=qs[_0xc34d('0x4c')](_0x1e0848['query'][_0xc34d('0x4c')]);_0x2b6646[_0xc34d('0x4f')]=qs[_0xc34d('0x44')](_[_0xc34d('0x4d')](_0x1e0848[_0xc34d('0x42')],_0x524a8d['filters']));if(_0x1e0848['query'][_0xc34d('0x4e')]){_0x2b6646[_0xc34d('0x4f')]=_['merge'](_0x2b6646['where'],{'$or':_['map'](_0x2b6646['attributes'],function(_0x4208c7){var _0x4e39f3={};_0x4e39f3[_0x4208c7]={'$like':'%'+_0x1e0848[_0xc34d('0x42')]['filter']+'%'};return _0x4e39f3;})});}_0x2b6646=_[_0xc34d('0x50')]({},_0x2b6646,_0x1e0848[_0xc34d('0x58')]);return _0x599e5a[_0xc34d('0x61')](_0x2b6646);}})[_0xc34d('0x1f')](function(_0x3d887d){if(_0x3d887d){_0x4c2255=_0x3d887d['length'];if(!_0x1e0848[_0xc34d('0x42')][_0xc34d('0x49')]('nolimit')){_0x2b6646[_0xc34d('0x2e')]=qs[_0xc34d('0x2e')](_0x1e0848[_0xc34d('0x42')][_0xc34d('0x2e')]);_0x2b6646[_0xc34d('0x2d')]=qs['offset'](_0x1e0848[_0xc34d('0x42')]['offset']);}return _0x599e5a['getTags'](_0x2b6646);}})[_0xc34d('0x1f')](function(_0x209030){if(_0x209030){return _0x209030?{'count':_0x4c2255,'rows':_0x209030}:null;}})['then'](respondWithResult(_0x10c277,null))[_0xc34d('0x29')](handleError(_0x10c277,null));};exports['setTags']=function(_0x331e7b,_0x4f9868,_0x3f60c7){if(_0x331e7b[_0xc34d('0x5b')]['id']){delete _0x331e7b[_0xc34d('0x5b')]['id'];}return db[_0xc34d('0x3c')][_0xc34d('0x5c')]({'where':{'id':_0x331e7b[_0xc34d('0x56')]['id']}})['then'](handleEntityNotFound(_0x4f9868,null))[_0xc34d('0x1f')](function(_0x1681f3){if(_0x1681f3){return _0x1681f3['setTags'](_0x331e7b['body'][_0xc34d('0x63')]||[]);}return null;})['then'](respondWithResult(_0x4f9868,null))[_0xc34d('0x29')](handleError(_0x4f9868,null));}; \ No newline at end of file +var _0x56d6=['VIRTUAL','merge','includeAll','rows','show','params','length','include','create','body','find','getFields','FreshdeskField','sort','options','getSubjects','findOne','order','getDescriptions','getTags','Tag','setTags','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','stack','name','index','map','FreshdeskConfiguration','rawAttributes','fieldName','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','filters','pick','filter','where','type'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x56d6,0x18e));var _0x656d=function(_0x4bd1d8,_0x3db38a){_0x4bd1d8=_0x4bd1d8-0x0;var _0x1c9997=_0x56d6[_0x4bd1d8];return _0x1c9997;};'use strict';var pdf=require(_0x656d('0x0'));var emlformat=require(_0x656d('0x1'));var rimraf=require(_0x656d('0x2'));var zipdir=require(_0x656d('0x3'));var jsonpatch=require(_0x656d('0x4'));var rp=require(_0x656d('0x5'));var moment=require('moment');var BPromise=require(_0x656d('0x6'));var Mustache=require(_0x656d('0x7'));var util=require(_0x656d('0x8'));var path=require(_0x656d('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x656d('0xa'));var fs=require('fs');var _=require(_0x656d('0xb'));var squel=require(_0x656d('0xc'));var crypto=require('crypto');var jsforce=require(_0x656d('0xd'));var deskjs=require(_0x656d('0xe'));var toCsv=require(_0x656d('0xf'));var querystring=require(_0x656d('0x10'));var Papa=require('papaparse');var Redis=require(_0x656d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x656d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x656d('0x13'));var logger=require(_0x656d('0x14'))('api');var utils=require(_0x656d('0x15'));var config=require(_0x656d('0x16'));var db=require(_0x656d('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x656d('0x18')][_0x656d('0x19')]({'port':0x232a});function checkPasswordPattern(_0x595e6c,_0x17826b,_0x3aeae9){if(_0x3aeae9){var _0x3e7e27=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3e7e27[_0x656d('0x1a')](_0x17826b)){return _0x595e6c;}else{throw new db['Sequelize']['ValidationError'](_0x656d('0x1b'));}}else{return _0x595e6c;}}function respondWithRpcPromise(_0x467df6,_0x4760e9,_0x25e2f6,_0x4beb24){return new BPromise(function(_0xcf8ce3,_0x1bf932){var _0x55982b=_0x4beb24||client;return _0x55982b['request'](_0x467df6,_0x25e2f6)[_0x656d('0x1c')](function(_0x3cdbe5){logger[_0x656d('0x1d')](_0x656d('0x1e'),_0x4760e9,_0x656d('0x1f'));logger[_0x656d('0x20')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x4760e9,_0x656d('0x1f'),JSON[_0x656d('0x21')](_0x3cdbe5));if(_0x3cdbe5['error']){if(_0x3cdbe5[_0x656d('0x22')][_0x656d('0x23')]===0x1f4){logger[_0x656d('0x22')](_0x656d('0x1e'),_0x4760e9,_0x3cdbe5[_0x656d('0x22')][_0x656d('0x24')]);return _0x1bf932(_0x3cdbe5[_0x656d('0x22')][_0x656d('0x24')]);}logger[_0x656d('0x22')](_0x656d('0x1e'),_0x4760e9,_0x3cdbe5[_0x656d('0x22')][_0x656d('0x24')]);return _0xcf8ce3(_0x3cdbe5[_0x656d('0x22')][_0x656d('0x24')]);}else{logger['info'](_0x656d('0x1e'),_0x4760e9,_0x656d('0x1f'));_0xcf8ce3(_0x3cdbe5[_0x656d('0x25')]['message']);}})[_0x656d('0x26')](function(_0x4d0396){logger[_0x656d('0x22')](_0x656d('0x1e'),_0x4760e9,_0x4d0396);_0x1bf932(_0x4d0396);});});}function respondWithStatusCode(_0x521d71,_0x11117c){_0x11117c=_0x11117c||0xcc;return function(_0xc3f0d3){if(_0xc3f0d3){return _0x521d71[_0x656d('0x27')](_0x11117c);}return _0x521d71[_0x656d('0x28')](_0x11117c)[_0x656d('0x29')]();};}function respondWithResult(_0x156950,_0x48b33d){_0x48b33d=_0x48b33d||0xc8;return function(_0x773757){if(_0x773757){return _0x156950[_0x656d('0x28')](_0x48b33d)[_0x656d('0x2a')](_0x773757);}};}function respondWithFilteredResult(_0x5687c6,_0x56c9c2){return function(_0x473383){if(_0x473383){var _0x13cbdf=_0x473383[_0x656d('0x2b')],_0x4a5bb3=_0x56c9c2[_0x656d('0x2c')],_0x1957ea=_0x56c9c2[_0x656d('0x2c')]+_0x56c9c2[_0x656d('0x2d')],_0x2863a7;if(_0x1957ea>=_0x13cbdf){_0x1957ea=_0x13cbdf;_0x2863a7=0xc8;}else{_0x2863a7=0xce;}_0x5687c6[_0x656d('0x28')](_0x2863a7);return _0x5687c6[_0x656d('0x2e')](_0x656d('0x2f'),_0x4a5bb3+'-'+_0x1957ea+'/'+_0x13cbdf)[_0x656d('0x2a')](_0x473383);}return null;};}function patchUpdates(_0x5f3147){return function(_0x2e818c){try{jsonpatch[_0x656d('0x30')](_0x2e818c,_0x5f3147,!![]);}catch(_0x58b0ab){return BPromise[_0x656d('0x31')](_0x58b0ab);}return _0x2e818c['save']();};}function saveUpdates(_0x39b953,_0x35fbc6){return function(_0x330a06){if(_0x330a06){return _0x330a06[_0x656d('0x32')](_0x39b953)[_0x656d('0x1c')](function(_0x5347c4){return _0x5347c4;});}return null;};}function removeEntity(_0x33eae9,_0x454859){return function(_0x2a690b){if(_0x2a690b){return _0x2a690b[_0x656d('0x33')]()['then'](function(){_0x33eae9[_0x656d('0x28')](0xcc)[_0x656d('0x29')]();});}};}function handleEntityNotFound(_0x4b3045,_0x1650bf){return function(_0x1d6d63){if(!_0x1d6d63){_0x4b3045[_0x656d('0x27')](0x194);}return _0x1d6d63;};}function handleError(_0x2ea7fe,_0x335c86){_0x335c86=_0x335c86||0x1f4;return function(_0xaf17f){logger['error'](_0xaf17f[_0x656d('0x34')]);if(_0xaf17f[_0x656d('0x35')]){delete _0xaf17f['name'];}_0x2ea7fe[_0x656d('0x28')](_0x335c86)['send'](_0xaf17f);};}exports[_0x656d('0x36')]=function(_0x3c8d7e,_0x1d9ff0){var _0x40a262={},_0x44ffa7={},_0x18cf2a={'count':0x0,'rows':[]};var _0x3290ff=_[_0x656d('0x37')](db[_0x656d('0x38')][_0x656d('0x39')],function(_0x5d474b){return{'name':_0x5d474b[_0x656d('0x3a')],'type':_0x5d474b['type']['key']};});_0x44ffa7['model']=_['map'](_0x3290ff,_0x656d('0x35'));_0x44ffa7[_0x656d('0x3b')]=_[_0x656d('0x3c')](_0x3c8d7e['query']);_0x44ffa7['filters']=_[_0x656d('0x3d')](_0x44ffa7[_0x656d('0x3e')],_0x44ffa7[_0x656d('0x3b')]);_0x40a262['attributes']=_[_0x656d('0x3d')](_0x44ffa7[_0x656d('0x3e')],qs[_0x656d('0x3f')](_0x3c8d7e['query'][_0x656d('0x3f')]));_0x40a262[_0x656d('0x40')]=_0x40a262[_0x656d('0x40')]['length']?_0x40a262['attributes']:_0x44ffa7[_0x656d('0x3e')];if(!_0x3c8d7e['query'][_0x656d('0x41')](_0x656d('0x42'))){_0x40a262['limit']=qs['limit'](_0x3c8d7e[_0x656d('0x3b')]['limit']);_0x40a262[_0x656d('0x2c')]=qs['offset'](_0x3c8d7e[_0x656d('0x3b')][_0x656d('0x2c')]);}_0x40a262['order']=qs['sort'](_0x3c8d7e['query']['sort']);_0x40a262['where']=qs[_0x656d('0x43')](_[_0x656d('0x44')](_0x3c8d7e['query'],_0x44ffa7[_0x656d('0x43')]));if(_0x3c8d7e[_0x656d('0x3b')][_0x656d('0x45')]){_0x40a262[_0x656d('0x46')]=_['merge'](_0x40a262['where'],{'$or':_[_0x656d('0x37')](_0x3290ff,function(_0x151ae8){if(_0x151ae8[_0x656d('0x47')]!==_0x656d('0x48')){var _0x38919c={};_0x38919c[_0x151ae8[_0x656d('0x35')]]={'$like':'%'+_0x3c8d7e[_0x656d('0x3b')][_0x656d('0x45')]+'%'};return _0x38919c;}})});}_0x40a262=_[_0x656d('0x49')]({},_0x40a262,_0x3c8d7e['options']);var _0x149b12={'where':_0x40a262['where']};return db[_0x656d('0x38')][_0x656d('0x2b')](_0x149b12)[_0x656d('0x1c')](function(_0x2b7584){_0x18cf2a[_0x656d('0x2b')]=_0x2b7584;if(_0x3c8d7e['query'][_0x656d('0x4a')]){_0x40a262['include']=[{'all':!![]}];}return db[_0x656d('0x38')]['findAll'](_0x40a262);})[_0x656d('0x1c')](function(_0x37ed3c){_0x18cf2a[_0x656d('0x4b')]=_0x37ed3c;return _0x18cf2a;})['then'](respondWithFilteredResult(_0x1d9ff0,_0x40a262))[_0x656d('0x26')](handleError(_0x1d9ff0,null));};exports[_0x656d('0x4c')]=function(_0x39ce3c,_0x56d4d2){var _0xcbf35a={'raw':![],'where':{'id':_0x39ce3c[_0x656d('0x4d')]['id']}},_0x432299={};_0x432299[_0x656d('0x3e')]=_[_0x656d('0x3c')](db['FreshdeskConfiguration']['rawAttributes']);_0x432299[_0x656d('0x3b')]=_[_0x656d('0x3c')](_0x39ce3c[_0x656d('0x3b')]);_0x432299[_0x656d('0x43')]=_[_0x656d('0x3d')](_0x432299[_0x656d('0x3e')],_0x432299[_0x656d('0x3b')]);_0xcbf35a['attributes']=_[_0x656d('0x3d')](_0x432299[_0x656d('0x3e')],qs['fields'](_0x39ce3c['query'][_0x656d('0x3f')]));_0xcbf35a[_0x656d('0x40')]=_0xcbf35a[_0x656d('0x40')][_0x656d('0x4e')]?_0xcbf35a[_0x656d('0x40')]:_0x432299[_0x656d('0x3e')];if(_0x39ce3c[_0x656d('0x3b')][_0x656d('0x4a')]){_0xcbf35a[_0x656d('0x4f')]=[{'all':!![]}];}_0xcbf35a=_['merge']({},_0xcbf35a,_0x39ce3c['options']);return db[_0x656d('0x38')]['find'](_0xcbf35a)['then'](handleEntityNotFound(_0x56d4d2,null))[_0x656d('0x1c')](respondWithResult(_0x56d4d2,null))[_0x656d('0x26')](handleError(_0x56d4d2,null));};exports[_0x656d('0x50')]=function(_0x2a875e,_0x32ec3d){return db['FreshdeskConfiguration']['create'](_0x2a875e['body'],{})[_0x656d('0x1c')](respondWithResult(_0x32ec3d,0xc9))[_0x656d('0x26')](handleError(_0x32ec3d,null));};exports[_0x656d('0x32')]=function(_0x50e4a9,_0x378c90){if(_0x50e4a9[_0x656d('0x51')]['id']){delete _0x50e4a9['body']['id'];}return db[_0x656d('0x38')][_0x656d('0x52')]({'where':{'id':_0x50e4a9['params']['id']}})[_0x656d('0x1c')](handleEntityNotFound(_0x378c90,null))[_0x656d('0x1c')](saveUpdates(_0x50e4a9[_0x656d('0x51')],null))[_0x656d('0x1c')](respondWithResult(_0x378c90,null))[_0x656d('0x26')](handleError(_0x378c90,null));};exports[_0x656d('0x33')]=function(_0xe1b578,_0x24f9ff){return db[_0x656d('0x38')][_0x656d('0x52')]({'where':{'id':_0xe1b578[_0x656d('0x4d')]['id']}})['then'](handleEntityNotFound(_0x24f9ff,null))[_0x656d('0x1c')](removeEntity(_0x24f9ff,null))[_0x656d('0x26')](handleError(_0x24f9ff,null));};exports[_0x656d('0x53')]=function(_0x2e3a36,_0x516cbd,_0x36bcfe){var _0x4795c5={};var _0x11d09b={};var _0x27d57a;var _0x5c4b1d;return db[_0x656d('0x38')]['findOne']({'where':{'id':_0x2e3a36['params']['id']}})['then'](handleEntityNotFound(_0x516cbd,null))[_0x656d('0x1c')](function(_0x41559c){if(_0x41559c){_0x27d57a=_0x41559c;_0x11d09b[_0x656d('0x3e')]=_['keys'](db[_0x656d('0x54')][_0x656d('0x39')]);_0x11d09b['query']=_[_0x656d('0x3c')](_0x2e3a36[_0x656d('0x3b')]);_0x11d09b[_0x656d('0x43')]=_['intersection'](_0x11d09b[_0x656d('0x3e')],_0x11d09b[_0x656d('0x3b')]);_0x4795c5[_0x656d('0x40')]=_[_0x656d('0x3d')](_0x11d09b['model'],qs[_0x656d('0x3f')](_0x2e3a36[_0x656d('0x3b')][_0x656d('0x3f')]));_0x4795c5[_0x656d('0x40')]=_0x4795c5[_0x656d('0x40')]['length']?_0x4795c5[_0x656d('0x40')]:_0x11d09b[_0x656d('0x3e')];_0x4795c5['order']=qs[_0x656d('0x55')](_0x2e3a36[_0x656d('0x3b')]['sort']);_0x4795c5[_0x656d('0x46')]=qs[_0x656d('0x43')](_[_0x656d('0x44')](_0x2e3a36[_0x656d('0x3b')],_0x11d09b['filters']));if(_0x2e3a36[_0x656d('0x3b')][_0x656d('0x45')]){_0x4795c5[_0x656d('0x46')]=_[_0x656d('0x49')](_0x4795c5[_0x656d('0x46')],{'$or':_[_0x656d('0x37')](_0x4795c5[_0x656d('0x40')],function(_0x29734f){var _0x3f7911={};_0x3f7911[_0x29734f]={'$like':'%'+_0x2e3a36[_0x656d('0x3b')][_0x656d('0x45')]+'%'};return _0x3f7911;})});}_0x4795c5=_[_0x656d('0x49')]({},_0x4795c5,_0x2e3a36[_0x656d('0x56')]);return _0x27d57a[_0x656d('0x53')](_0x4795c5);}})[_0x656d('0x1c')](function(_0x596f82){if(_0x596f82){_0x5c4b1d=_0x596f82[_0x656d('0x4e')];if(!_0x2e3a36[_0x656d('0x3b')][_0x656d('0x41')](_0x656d('0x42'))){_0x4795c5[_0x656d('0x2d')]=qs[_0x656d('0x2d')](_0x2e3a36[_0x656d('0x3b')][_0x656d('0x2d')]);_0x4795c5[_0x656d('0x2c')]=qs['offset'](_0x2e3a36[_0x656d('0x3b')]['offset']);}return _0x27d57a[_0x656d('0x53')](_0x4795c5);}})['then'](function(_0x536298){if(_0x536298){return _0x536298?{'count':_0x5c4b1d,'rows':_0x536298}:null;}})[_0x656d('0x1c')](respondWithResult(_0x516cbd,null))[_0x656d('0x26')](handleError(_0x516cbd,null));};exports[_0x656d('0x57')]=function(_0x42dada,_0x2b1298,_0xcaf79c){var _0xbd19b4={};var _0x317312={};var _0x59c7a2;var _0x47b799;return db[_0x656d('0x38')][_0x656d('0x58')]({'where':{'id':_0x42dada[_0x656d('0x4d')]['id']}})[_0x656d('0x1c')](handleEntityNotFound(_0x2b1298,null))[_0x656d('0x1c')](function(_0x4af4cb){if(_0x4af4cb){_0x59c7a2=_0x4af4cb;_0x317312[_0x656d('0x3e')]=_[_0x656d('0x3c')](db['FreshdeskField']['rawAttributes']);_0x317312[_0x656d('0x3b')]=_[_0x656d('0x3c')](_0x42dada[_0x656d('0x3b')]);_0x317312[_0x656d('0x43')]=_[_0x656d('0x3d')](_0x317312[_0x656d('0x3e')],_0x317312[_0x656d('0x3b')]);_0xbd19b4[_0x656d('0x40')]=_['intersection'](_0x317312[_0x656d('0x3e')],qs[_0x656d('0x3f')](_0x42dada[_0x656d('0x3b')][_0x656d('0x3f')]));_0xbd19b4['attributes']=_0xbd19b4['attributes'][_0x656d('0x4e')]?_0xbd19b4['attributes']:_0x317312['model'];_0xbd19b4[_0x656d('0x59')]=qs[_0x656d('0x55')](_0x42dada[_0x656d('0x3b')][_0x656d('0x55')]);_0xbd19b4['where']=qs[_0x656d('0x43')](_[_0x656d('0x44')](_0x42dada[_0x656d('0x3b')],_0x317312[_0x656d('0x43')]));if(_0x42dada[_0x656d('0x3b')]['filter']){_0xbd19b4[_0x656d('0x46')]=_[_0x656d('0x49')](_0xbd19b4[_0x656d('0x46')],{'$or':_[_0x656d('0x37')](_0xbd19b4['attributes'],function(_0x6b9fd7){var _0x42268a={};_0x42268a[_0x6b9fd7]={'$like':'%'+_0x42dada[_0x656d('0x3b')]['filter']+'%'};return _0x42268a;})});}_0xbd19b4=_[_0x656d('0x49')]({},_0xbd19b4,_0x42dada[_0x656d('0x56')]);return _0x59c7a2[_0x656d('0x57')](_0xbd19b4);}})[_0x656d('0x1c')](function(_0x3fd9ef){if(_0x3fd9ef){_0x47b799=_0x3fd9ef['length'];if(!_0x42dada[_0x656d('0x3b')][_0x656d('0x41')](_0x656d('0x42'))){_0xbd19b4[_0x656d('0x2d')]=qs[_0x656d('0x2d')](_0x42dada[_0x656d('0x3b')][_0x656d('0x2d')]);_0xbd19b4['offset']=qs[_0x656d('0x2c')](_0x42dada[_0x656d('0x3b')]['offset']);}return _0x59c7a2[_0x656d('0x57')](_0xbd19b4);}})[_0x656d('0x1c')](function(_0x5a8824){if(_0x5a8824){return _0x5a8824?{'count':_0x47b799,'rows':_0x5a8824}:null;}})['then'](respondWithResult(_0x2b1298,null))['catch'](handleError(_0x2b1298,null));};exports[_0x656d('0x5a')]=function(_0x1ec2ec,_0x248f9b,_0x2badd4){var _0x508bc3={};var _0x145d4a={};var _0xe97882;var _0x16575b;return db[_0x656d('0x38')][_0x656d('0x58')]({'where':{'id':_0x1ec2ec['params']['id']}})['then'](handleEntityNotFound(_0x248f9b,null))['then'](function(_0x236e1f){if(_0x236e1f){_0xe97882=_0x236e1f;_0x145d4a['model']=_[_0x656d('0x3c')](db[_0x656d('0x54')][_0x656d('0x39')]);_0x145d4a[_0x656d('0x3b')]=_['keys'](_0x1ec2ec['query']);_0x145d4a['filters']=_['intersection'](_0x145d4a['model'],_0x145d4a[_0x656d('0x3b')]);_0x508bc3['attributes']=_[_0x656d('0x3d')](_0x145d4a['model'],qs[_0x656d('0x3f')](_0x1ec2ec['query'][_0x656d('0x3f')]));_0x508bc3[_0x656d('0x40')]=_0x508bc3[_0x656d('0x40')][_0x656d('0x4e')]?_0x508bc3[_0x656d('0x40')]:_0x145d4a[_0x656d('0x3e')];_0x508bc3['order']=qs[_0x656d('0x55')](_0x1ec2ec[_0x656d('0x3b')][_0x656d('0x55')]);_0x508bc3[_0x656d('0x46')]=qs[_0x656d('0x43')](_[_0x656d('0x44')](_0x1ec2ec[_0x656d('0x3b')],_0x145d4a['filters']));if(_0x1ec2ec[_0x656d('0x3b')]['filter']){_0x508bc3[_0x656d('0x46')]=_[_0x656d('0x49')](_0x508bc3['where'],{'$or':_[_0x656d('0x37')](_0x508bc3[_0x656d('0x40')],function(_0x108786){var _0xa218e5={};_0xa218e5[_0x108786]={'$like':'%'+_0x1ec2ec[_0x656d('0x3b')][_0x656d('0x45')]+'%'};return _0xa218e5;})});}_0x508bc3=_[_0x656d('0x49')]({},_0x508bc3,_0x1ec2ec[_0x656d('0x56')]);return _0xe97882[_0x656d('0x5a')](_0x508bc3);}})[_0x656d('0x1c')](function(_0x176bc4){if(_0x176bc4){_0x16575b=_0x176bc4[_0x656d('0x4e')];if(!_0x1ec2ec[_0x656d('0x3b')][_0x656d('0x41')](_0x656d('0x42'))){_0x508bc3[_0x656d('0x2d')]=qs[_0x656d('0x2d')](_0x1ec2ec['query'][_0x656d('0x2d')]);_0x508bc3['offset']=qs['offset'](_0x1ec2ec['query'][_0x656d('0x2c')]);}return _0xe97882[_0x656d('0x5a')](_0x508bc3);}})[_0x656d('0x1c')](function(_0x198b1b){if(_0x198b1b){return _0x198b1b?{'count':_0x16575b,'rows':_0x198b1b}:null;}})[_0x656d('0x1c')](respondWithResult(_0x248f9b,null))[_0x656d('0x26')](handleError(_0x248f9b,null));};exports[_0x656d('0x5b')]=function(_0x72087,_0x48868a,_0x36941a){var _0x548493={};var _0x4e4506={};var _0x1776b7;var _0x4893d5;return db[_0x656d('0x38')][_0x656d('0x58')]({'where':{'id':_0x72087[_0x656d('0x4d')]['id']}})[_0x656d('0x1c')](handleEntityNotFound(_0x48868a,null))['then'](function(_0x28b193){if(_0x28b193){_0x1776b7=_0x28b193;_0x4e4506['model']=_[_0x656d('0x3c')](db[_0x656d('0x5c')][_0x656d('0x39')]);_0x4e4506[_0x656d('0x3b')]=_[_0x656d('0x3c')](_0x72087[_0x656d('0x3b')]);_0x4e4506[_0x656d('0x43')]=_[_0x656d('0x3d')](_0x4e4506['model'],_0x4e4506[_0x656d('0x3b')]);_0x548493[_0x656d('0x40')]=_[_0x656d('0x3d')](_0x4e4506[_0x656d('0x3e')],qs[_0x656d('0x3f')](_0x72087[_0x656d('0x3b')][_0x656d('0x3f')]));_0x548493[_0x656d('0x40')]=_0x548493[_0x656d('0x40')]['length']?_0x548493[_0x656d('0x40')]:_0x4e4506['model'];_0x548493[_0x656d('0x59')]=qs[_0x656d('0x55')](_0x72087[_0x656d('0x3b')][_0x656d('0x55')]);_0x548493[_0x656d('0x46')]=qs[_0x656d('0x43')](_[_0x656d('0x44')](_0x72087['query'],_0x4e4506[_0x656d('0x43')]));if(_0x72087['query'][_0x656d('0x45')]){_0x548493['where']=_[_0x656d('0x49')](_0x548493[_0x656d('0x46')],{'$or':_['map'](_0x548493['attributes'],function(_0x2f3485){var _0x5e4c5f={};_0x5e4c5f[_0x2f3485]={'$like':'%'+_0x72087[_0x656d('0x3b')][_0x656d('0x45')]+'%'};return _0x5e4c5f;})});}_0x548493=_[_0x656d('0x49')]({},_0x548493,_0x72087[_0x656d('0x56')]);return _0x1776b7['getTags'](_0x548493);}})[_0x656d('0x1c')](function(_0x4202de){if(_0x4202de){_0x4893d5=_0x4202de[_0x656d('0x4e')];if(!_0x72087['query'][_0x656d('0x41')](_0x656d('0x42'))){_0x548493[_0x656d('0x2d')]=qs['limit'](_0x72087[_0x656d('0x3b')][_0x656d('0x2d')]);_0x548493['offset']=qs[_0x656d('0x2c')](_0x72087['query']['offset']);}return _0x1776b7[_0x656d('0x5b')](_0x548493);}})['then'](function(_0x35e259){if(_0x35e259){return _0x35e259?{'count':_0x4893d5,'rows':_0x35e259}:null;}})[_0x656d('0x1c')](respondWithResult(_0x48868a,null))[_0x656d('0x26')](handleError(_0x48868a,null));};exports[_0x656d('0x5d')]=function(_0x55495c,_0x4a6623,_0x201156){if(_0x55495c[_0x656d('0x51')]['id']){delete _0x55495c[_0x656d('0x51')]['id'];}return db['FreshdeskConfiguration'][_0x656d('0x58')]({'where':{'id':_0x55495c[_0x656d('0x4d')]['id']}})[_0x656d('0x1c')](handleEntityNotFound(_0x4a6623,null))[_0x656d('0x1c')](function(_0x504864){if(_0x504864){return _0x504864[_0x656d('0x5d')](_0x55495c['body']['ids']||[]);}return null;})[_0x656d('0x1c')](respondWithResult(_0x4a6623,null))['catch'](handleError(_0x4a6623,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 1fc8edf..73718ed 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 _0xa02b=['define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./intFreshdeskConfiguration.attributes','exports'];(function(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0xa02b,0x1a3));var _0xba02=function(_0x1a8ff0,_0x20788d){_0x1a8ff0=_0x1a8ff0-0x0;var _0x3588bf=_0xa02b[_0x1a8ff0];return _0x3588bf;};'use strict';var _=require(_0xba02('0x0'));var util=require(_0xba02('0x1'));var logger=require('../../config/logger')(_0xba02('0x2'));var moment=require(_0xba02('0x3'));var BPromise=require(_0xba02('0x4'));var rp=require(_0xba02('0x5'));var fs=require('fs');var path=require(_0xba02('0x6'));var rimraf=require(_0xba02('0x7'));var config=require('../../config/environment');var attributes=require(_0xba02('0x8'));module[_0xba02('0x9')]=function(_0x47023f,_0x1d2279){return _0x47023f[_0xba02('0xa')](_0xba02('0xb'),attributes,{'tableName':_0xba02('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x334b=['../../config/logger','api','moment','request-promise','path','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util'];(function(_0xa4add2,_0x407e7f){var _0x461167=function(_0x7064d){while(--_0x7064d){_0xa4add2['push'](_0xa4add2['shift']());}};_0x461167(++_0x407e7f);}(_0x334b,0x1c5));var _0xb334=function(_0x16b328,_0x1534b7){_0x16b328=_0x16b328-0x0;var _0x163849=_0x334b[_0x16b328];return _0x163849;};'use strict';var _=require(_0xb334('0x0'));var util=require(_0xb334('0x1'));var logger=require(_0xb334('0x2'))(_0xb334('0x3'));var moment=require(_0xb334('0x4'));var BPromise=require('bluebird');var rp=require(_0xb334('0x5'));var fs=require('fs');var path=require(_0xb334('0x6'));var rimraf=require('rimraf');var config=require(_0xb334('0x7'));var attributes=require(_0xb334('0x8'));module[_0xb334('0x9')]=function(_0x59475e,_0x1e83f3){return _0x59475e[_0xb334('0xa')](_0xb334('0xb'),attributes,{'tableName':_0xb334('0xc'),'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 cbc33b4..2810838 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 _0xbda2=['jayson/promise','client','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x126c42,_0x40ba18){var _0x5d2e76=function(_0x12769a){while(--_0x12769a){_0x126c42['push'](_0x126c42['shift']());}};_0x5d2e76(++_0x40ba18);}(_0xbda2,0x10c));var _0x2bda=function(_0xcd5b10,_0x89f494){_0xcd5b10=_0xcd5b10-0x0;var _0x44b0dd=_0xbda2[_0xcd5b10];return _0x44b0dd;};'use strict';var _=require(_0x2bda('0x0'));var util=require(_0x2bda('0x1'));var moment=require(_0x2bda('0x2'));var BPromise=require(_0x2bda('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2bda('0x4'));var db=require(_0x2bda('0x5'))['db'];var utils=require(_0x2bda('0x6'));var logger=require(_0x2bda('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2bda('0x8'));var client=jayson[_0x2bda('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ae5cd,_0x3f436c,_0x12ebd6){return new BPromise(function(_0x2cdb44,_0x16d2d9){return client[_0x2bda('0xa')](_0x1ae5cd,_0x12ebd6)[_0x2bda('0xb')](function(_0x57ef90){logger[_0x2bda('0xc')](_0x2bda('0xd'),_0x3f436c,_0x2bda('0xe'));logger[_0x2bda('0xf')](_0x2bda('0x10'),_0x3f436c,_0x2bda('0xe'),JSON[_0x2bda('0x11')](_0x57ef90));if(_0x57ef90[_0x2bda('0x12')]){if(_0x57ef90[_0x2bda('0x12')][_0x2bda('0x13')]===0x1f4){logger['error'](_0x2bda('0xd'),_0x3f436c,_0x57ef90[_0x2bda('0x12')][_0x2bda('0x14')]);return _0x16d2d9(_0x57ef90['error'][_0x2bda('0x14')]);}logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x3f436c,_0x57ef90[_0x2bda('0x12')]['message']);return _0x2cdb44(_0x57ef90[_0x2bda('0x12')]['message']);}else{logger[_0x2bda('0xc')](_0x2bda('0xd'),_0x3f436c,'request\x20sent');_0x2cdb44(_0x57ef90[_0x2bda('0x15')][_0x2bda('0x14')]);}})[_0x2bda('0x16')](function(_0x194384){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x3f436c,_0x194384);_0x16d2d9(_0x194384);});});} \ No newline at end of file +var _0x8509=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug'];(function(_0x32157b,_0x312103){var _0x15bf8f=function(_0x243b7a){while(--_0x243b7a){_0x32157b['push'](_0x32157b['shift']());}};_0x15bf8f(++_0x312103);}(_0x8509,0xf6));var _0x9850=function(_0x2401e6,_0x2248d7){_0x2401e6=_0x2401e6-0x0;var _0xf06a43=_0x8509[_0x2401e6];return _0xf06a43;};'use strict';var _=require(_0x9850('0x0'));var util=require(_0x9850('0x1'));var moment=require(_0x9850('0x2'));var BPromise=require(_0x9850('0x3'));var rs=require(_0x9850('0x4'));var fs=require('fs');var Redis=require(_0x9850('0x5'));var db=require(_0x9850('0x6'))['db'];var utils=require(_0x9850('0x7'));var logger=require(_0x9850('0x8'))('rpc');var config=require(_0x9850('0x9'));var jayson=require(_0x9850('0xa'));var client=jayson[_0x9850('0xb')][_0x9850('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2a9e02,_0x269c8f,_0x3109ae){return new BPromise(function(_0x49a9ff,_0x43369e){return client[_0x9850('0xd')](_0x2a9e02,_0x3109ae)[_0x9850('0xe')](function(_0x38f219){logger[_0x9850('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x269c8f,_0x9850('0x10'));logger[_0x9850('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x269c8f,'request\x20sent',JSON[_0x9850('0x12')](_0x38f219));if(_0x38f219['error']){if(_0x38f219[_0x9850('0x13')][_0x9850('0x14')]===0x1f4){logger[_0x9850('0x13')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x269c8f,_0x38f219[_0x9850('0x13')][_0x9850('0x15')]);return _0x43369e(_0x38f219[_0x9850('0x13')][_0x9850('0x15')]);}logger[_0x9850('0x13')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x269c8f,_0x38f219[_0x9850('0x13')]['message']);return _0x49a9ff(_0x38f219['error'][_0x9850('0x15')]);}else{logger[_0x9850('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x269c8f,_0x9850('0x10'));_0x49a9ff(_0x38f219[_0x9850('0x16')][_0x9850('0x15')]);}})[_0x9850('0x17')](function(_0x484de2){logger[_0x9850('0x13')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x269c8f,_0x484de2);_0x43369e(_0x484de2);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index c90c4eb..48bc3f5 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 _0xedd9=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','post','create','put','delete','/:id','destroy','exports'];(function(_0x367e5b,_0x5721e4){var _0x4b909e=function(_0x22c6a4){while(--_0x22c6a4){_0x367e5b['push'](_0x367e5b['shift']());}};_0x4b909e(++_0x5721e4);}(_0xedd9,0xfc));var _0x9edd=function(_0x4dd92d,_0x37b8c2){_0x4dd92d=_0x4dd92d-0x0;var _0x471c48=_0xedd9[_0x4dd92d];return _0x471c48;};'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 auth=require(_0x9edd('0x5'));var interaction=require(_0x9edd('0x6'));var config=require(_0x9edd('0x7'));var controller=require('./intFreshdeskField.controller');router[_0x9edd('0x8')]('/',auth[_0x9edd('0x9')](),controller[_0x9edd('0xa')]);router[_0x9edd('0x8')]('/:id',auth[_0x9edd('0x9')](),controller['show']);router[_0x9edd('0xb')]('/',auth[_0x9edd('0x9')](),controller[_0x9edd('0xc')]);router[_0x9edd('0xd')]('/:id',auth[_0x9edd('0x9')](),controller['update']);router[_0x9edd('0xe')](_0x9edd('0xf'),auth['isAuthenticated'](),controller[_0x9edd('0x10')]);module[_0x9edd('0x11')]=router; \ No newline at end of file +var _0x34e8=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports'];(function(_0xf48cce,_0x3531e4){var _0x2a5c38=function(_0x22a454){while(--_0x22a454){_0xf48cce['push'](_0xf48cce['shift']());}};_0x2a5c38(++_0x3531e4);}(_0x34e8,0x12c));var _0x834e=function(_0x584708,_0x3f0472){_0x584708=_0x584708-0x0;var _0x35fb49=_0x34e8[_0x584708];return _0x35fb49;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var auth=require(_0x834e('0x5'));var interaction=require(_0x834e('0x6'));var config=require(_0x834e('0x7'));var controller=require(_0x834e('0x8'));router[_0x834e('0x9')]('/',auth[_0x834e('0xa')](),controller['index']);router[_0x834e('0x9')]('/:id',auth[_0x834e('0xa')](),controller[_0x834e('0xb')]);router[_0x834e('0xc')]('/',auth[_0x834e('0xa')](),controller[_0x834e('0xd')]);router[_0x834e('0xe')](_0x834e('0xf'),auth[_0x834e('0xa')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')](_0x834e('0xf'),auth[_0x834e('0xa')](),controller[_0x834e('0x12')]);module[_0x834e('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index d442d9b..da693cc 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 _0x425d=['sequelize','ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x425d,0x1e0));var _0xd425=function(_0x4629ed,_0x59ef85){_0x4629ed=_0x4629ed-0x0;var _0x52ca04=_0x425d[_0x4629ed];return _0x52ca04;};'use strict';var Sequelize=require(_0xd425('0x0'));module['exports']={'type':{'type':Sequelize[_0xd425('0x1')](_0xd425('0x2'),_0xd425('0x3'),_0xd425('0x4'),_0xd425('0x5')),'defaultValue':_0xd425('0x2')},'content':{'type':Sequelize[_0xd425('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xd425('0x1')](_0xd425('0x2'),_0xd425('0x3'),_0xd425('0x4'))},'keyContent':{'type':Sequelize[_0xd425('0x6')]},'idField':{'type':Sequelize[_0xd425('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xd425('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd425('0x6')]}}; \ No newline at end of file +var _0x1a6b=['keyValue','string','STRING','BOOLEAN','sequelize','exports','ENUM','variable','customVariable'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1a6b,0x94));var _0xb1a6=function(_0x68f50a,_0x19aece){_0x68f50a=_0x68f50a-0x0;var _0x5a4e14=_0x1a6b[_0x68f50a];return _0x5a4e14;};'use strict';var Sequelize=require(_0xb1a6('0x0'));module[_0xb1a6('0x1')]={'type':{'type':Sequelize[_0xb1a6('0x2')]('string',_0xb1a6('0x3'),_0xb1a6('0x4'),_0xb1a6('0x5')),'defaultValue':_0xb1a6('0x6')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xb1a6('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xb1a6('0x6'),_0xb1a6('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xb1a6('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xb1a6('0x7')]},'customField':{'type':Sequelize[_0xb1a6('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 5db4d85..c4372fd 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 _0x2aa2=['include','findAll','rows','show','catch','create','body','find','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','end','error','name','index','map','FreshdeskField','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll'];(function(_0xeeed05,_0x4f17d8){var _0x20e488=function(_0x2807cf){while(--_0x2807cf){_0xeeed05['push'](_0xeeed05['shift']());}};_0x20e488(++_0x4f17d8);}(_0x2aa2,0xa3));var _0x22aa=function(_0xc0cb13,_0x158574){_0xc0cb13=_0xc0cb13-0x0;var _0x1b7697=_0x2aa2[_0xc0cb13];return _0x1b7697;};'use strict';var pdf=require(_0x22aa('0x0'));var emlformat=require(_0x22aa('0x1'));var rimraf=require(_0x22aa('0x2'));var zipdir=require(_0x22aa('0x3'));var jsonpatch=require(_0x22aa('0x4'));var rp=require('request-promise');var moment=require(_0x22aa('0x5'));var BPromise=require(_0x22aa('0x6'));var Mustache=require('mustache');var util=require(_0x22aa('0x7'));var path=require(_0x22aa('0x8'));var sox=require(_0x22aa('0x9'));var csv=require(_0x22aa('0xa'));var ejs=require(_0x22aa('0xb'));var fs=require('fs');var _=require(_0x22aa('0xc'));var squel=require('squel');var crypto=require(_0x22aa('0xd'));var jsforce=require(_0x22aa('0xe'));var deskjs=require(_0x22aa('0xf'));var toCsv=require('to-csv');var querystring=require(_0x22aa('0x10'));var Papa=require(_0x22aa('0x11'));var Redis=require(_0x22aa('0x12'));var authService=require(_0x22aa('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x22aa('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x22aa('0x15'))(_0x22aa('0x16'));var utils=require(_0x22aa('0x17'));var config=require(_0x22aa('0x18'));var db=require(_0x22aa('0x19'))['db'];function respondWithStatusCode(_0x22f959,_0x3443ce){_0x3443ce=_0x3443ce||0xcc;return function(_0x28b6e6){if(_0x28b6e6){return _0x22f959[_0x22aa('0x1a')](_0x3443ce);}return _0x22f959[_0x22aa('0x1b')](_0x3443ce)['end']();};}function respondWithResult(_0x480457,_0x6e3f7f){_0x6e3f7f=_0x6e3f7f||0xc8;return function(_0x5650c4){if(_0x5650c4){return _0x480457['status'](_0x6e3f7f)['json'](_0x5650c4);}};}function respondWithFilteredResult(_0x2b4d4b,_0x5bb27e){return function(_0x189fb8){if(_0x189fb8){var _0x11348a=_0x189fb8[_0x22aa('0x1c')],_0x5ee006=_0x5bb27e[_0x22aa('0x1d')],_0x27d7a8=_0x5bb27e[_0x22aa('0x1d')]+_0x5bb27e[_0x22aa('0x1e')],_0x5e43d6;if(_0x27d7a8>=_0x11348a){_0x27d7a8=_0x11348a;_0x5e43d6=0xc8;}else{_0x5e43d6=0xce;}_0x2b4d4b[_0x22aa('0x1b')](_0x5e43d6);return _0x2b4d4b[_0x22aa('0x1f')](_0x22aa('0x20'),_0x5ee006+'-'+_0x27d7a8+'/'+_0x11348a)[_0x22aa('0x21')](_0x189fb8);}return null;};}function patchUpdates(_0x42083a){return function(_0x2e0701){try{jsonpatch['apply'](_0x2e0701,_0x42083a,!![]);}catch(_0x6d5f7d){return BPromise[_0x22aa('0x22')](_0x6d5f7d);}return _0x2e0701[_0x22aa('0x23')]();};}function saveUpdates(_0x201252,_0x1cd45d){return function(_0x1118bd){if(_0x1118bd){return _0x1118bd[_0x22aa('0x24')](_0x201252)[_0x22aa('0x25')](function(_0x2f6f5d){return _0x2f6f5d;});}return null;};}function removeEntity(_0x4de8ca,_0x1b0d0d){return function(_0x12f1fd){if(_0x12f1fd){return _0x12f1fd[_0x22aa('0x26')]()[_0x22aa('0x25')](function(){_0x4de8ca['status'](0xcc)[_0x22aa('0x27')]();});}};}function handleEntityNotFound(_0x4535ae,_0x1b390a){return function(_0x67dc41){if(!_0x67dc41){_0x4535ae['sendStatus'](0x194);}return _0x67dc41;};}function handleError(_0x7ec8d7,_0x5dc50e){_0x5dc50e=_0x5dc50e||0x1f4;return function(_0x3d5c80){logger[_0x22aa('0x28')](_0x3d5c80['stack']);if(_0x3d5c80[_0x22aa('0x29')]){delete _0x3d5c80[_0x22aa('0x29')];}_0x7ec8d7[_0x22aa('0x1b')](_0x5dc50e)['send'](_0x3d5c80);};}exports[_0x22aa('0x2a')]=function(_0x459e53,_0x2ce1c5){var _0x58ff0f={},_0x31dacb={},_0x4e7368={'count':0x0,'rows':[]};var _0x2f30f5=_[_0x22aa('0x2b')](db[_0x22aa('0x2c')][_0x22aa('0x2d')],function(_0xc1de8f){return{'name':_0xc1de8f[_0x22aa('0x2e')],'type':_0xc1de8f['type'][_0x22aa('0x2f')]};});_0x31dacb[_0x22aa('0x30')]=_[_0x22aa('0x2b')](_0x2f30f5,'name');_0x31dacb['query']=_[_0x22aa('0x31')](_0x459e53[_0x22aa('0x32')]);_0x31dacb[_0x22aa('0x33')]=_[_0x22aa('0x34')](_0x31dacb[_0x22aa('0x30')],_0x31dacb[_0x22aa('0x32')]);_0x58ff0f[_0x22aa('0x35')]=_['intersection'](_0x31dacb['model'],qs[_0x22aa('0x36')](_0x459e53[_0x22aa('0x32')][_0x22aa('0x36')]));_0x58ff0f[_0x22aa('0x35')]=_0x58ff0f[_0x22aa('0x35')][_0x22aa('0x37')]?_0x58ff0f[_0x22aa('0x35')]:_0x31dacb[_0x22aa('0x30')];if(!_0x459e53[_0x22aa('0x32')][_0x22aa('0x38')](_0x22aa('0x39'))){_0x58ff0f[_0x22aa('0x1e')]=qs[_0x22aa('0x1e')](_0x459e53[_0x22aa('0x32')][_0x22aa('0x1e')]);_0x58ff0f[_0x22aa('0x1d')]=qs[_0x22aa('0x1d')](_0x459e53[_0x22aa('0x32')][_0x22aa('0x1d')]);}_0x58ff0f[_0x22aa('0x3a')]=qs[_0x22aa('0x3b')](_0x459e53[_0x22aa('0x32')][_0x22aa('0x3b')]);_0x58ff0f[_0x22aa('0x3c')]=qs[_0x22aa('0x33')](_[_0x22aa('0x3d')](_0x459e53[_0x22aa('0x32')],_0x31dacb[_0x22aa('0x33')]));if(_0x459e53['query'][_0x22aa('0x3e')]){_0x58ff0f[_0x22aa('0x3c')]=_[_0x22aa('0x3f')](_0x58ff0f['where'],{'$or':_[_0x22aa('0x2b')](_0x2f30f5,function(_0x78eae8){if(_0x78eae8[_0x22aa('0x40')]!==_0x22aa('0x41')){var _0xb98bd6={};_0xb98bd6[_0x78eae8[_0x22aa('0x29')]]={'$like':'%'+_0x459e53[_0x22aa('0x32')][_0x22aa('0x3e')]+'%'};return _0xb98bd6;}})});}_0x58ff0f=_[_0x22aa('0x3f')]({},_0x58ff0f,_0x459e53[_0x22aa('0x42')]);var _0x5764ea={'where':_0x58ff0f['where']};return db[_0x22aa('0x2c')][_0x22aa('0x1c')](_0x5764ea)['then'](function(_0x100423){_0x4e7368[_0x22aa('0x1c')]=_0x100423;if(_0x459e53['query'][_0x22aa('0x43')]){_0x58ff0f[_0x22aa('0x44')]=[{'all':!![]}];}return db[_0x22aa('0x2c')][_0x22aa('0x45')](_0x58ff0f);})[_0x22aa('0x25')](function(_0x1cfab7){_0x4e7368[_0x22aa('0x46')]=_0x1cfab7;return _0x4e7368;})['then'](respondWithFilteredResult(_0x2ce1c5,_0x58ff0f))['catch'](handleError(_0x2ce1c5,null));};exports[_0x22aa('0x47')]=function(_0x18a370,_0x4a9319){var _0x346b6a={'raw':!![],'where':{'id':_0x18a370['params']['id']}},_0x5245be={};_0x5245be[_0x22aa('0x30')]=_[_0x22aa('0x31')](db[_0x22aa('0x2c')]['rawAttributes']);_0x5245be['query']=_[_0x22aa('0x31')](_0x18a370['query']);_0x5245be['filters']=_['intersection'](_0x5245be[_0x22aa('0x30')],_0x5245be[_0x22aa('0x32')]);_0x346b6a[_0x22aa('0x35')]=_['intersection'](_0x5245be[_0x22aa('0x30')],qs[_0x22aa('0x36')](_0x18a370['query']['fields']));_0x346b6a[_0x22aa('0x35')]=_0x346b6a[_0x22aa('0x35')][_0x22aa('0x37')]?_0x346b6a['attributes']:_0x5245be[_0x22aa('0x30')];if(_0x18a370['query']['includeAll']){_0x346b6a[_0x22aa('0x44')]=[{'all':!![]}];}_0x346b6a=_['merge']({},_0x346b6a,_0x18a370[_0x22aa('0x42')]);return db[_0x22aa('0x2c')]['find'](_0x346b6a)[_0x22aa('0x25')](handleEntityNotFound(_0x4a9319,null))['then'](respondWithResult(_0x4a9319,null))[_0x22aa('0x48')](handleError(_0x4a9319,null));};exports['create']=function(_0x4cb824,_0x2f67da){return db[_0x22aa('0x2c')][_0x22aa('0x49')](_0x4cb824[_0x22aa('0x4a')],{})['then'](respondWithResult(_0x2f67da,0xc9))[_0x22aa('0x48')](handleError(_0x2f67da,null));};exports['update']=function(_0x408c66,_0x1b0682){if(_0x408c66[_0x22aa('0x4a')]['id']){delete _0x408c66[_0x22aa('0x4a')]['id'];}return db[_0x22aa('0x2c')][_0x22aa('0x4b')]({'where':{'id':_0x408c66[_0x22aa('0x4c')]['id']}})[_0x22aa('0x25')](handleEntityNotFound(_0x1b0682,null))[_0x22aa('0x25')](saveUpdates(_0x408c66[_0x22aa('0x4a')],null))[_0x22aa('0x25')](respondWithResult(_0x1b0682,null))[_0x22aa('0x48')](handleError(_0x1b0682,null));};exports[_0x22aa('0x26')]=function(_0x58b18c,_0x147b47){return db[_0x22aa('0x2c')][_0x22aa('0x4b')]({'where':{'id':_0x58b18c[_0x22aa('0x4c')]['id']}})[_0x22aa('0x25')](handleEntityNotFound(_0x147b47,null))[_0x22aa('0x25')](removeEntity(_0x147b47,null))[_0x22aa('0x48')](handleError(_0x147b47,null));}; \ No newline at end of file +var _0x4216=['length','includeAll','include','find','create','body','params','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','FreshdeskField','findAll','catch','show','keys','intersection'];(function(_0x30c373,_0x81778d){var _0x20bf19=function(_0xaaf17a){while(--_0xaaf17a){_0x30c373['push'](_0x30c373['shift']());}};_0x20bf19(++_0x81778d);}(_0x4216,0x9b));var _0x6421=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4216[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0x6421('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x6421('0x1'));var zipdir=require(_0x6421('0x2'));var jsonpatch=require(_0x6421('0x3'));var rp=require(_0x6421('0x4'));var moment=require(_0x6421('0x5'));var BPromise=require(_0x6421('0x6'));var Mustache=require(_0x6421('0x7'));var util=require('util');var path=require('path');var sox=require(_0x6421('0x8'));var csv=require(_0x6421('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6421('0xa'));var squel=require(_0x6421('0xb'));var crypto=require(_0x6421('0xc'));var jsforce=require(_0x6421('0xd'));var deskjs=require(_0x6421('0xe'));var toCsv=require(_0x6421('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6421('0xf'));var authService=require(_0x6421('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6421('0x11'));var hardwareService=require(_0x6421('0x12'));var logger=require(_0x6421('0x13'))(_0x6421('0x14'));var utils=require('../../config/utils');var config=require(_0x6421('0x15'));var db=require(_0x6421('0x16'))['db'];function respondWithStatusCode(_0x3d9d20,_0x4ad303){_0x4ad303=_0x4ad303||0xcc;return function(_0x2dc0b3){if(_0x2dc0b3){return _0x3d9d20[_0x6421('0x17')](_0x4ad303);}return _0x3d9d20[_0x6421('0x18')](_0x4ad303)[_0x6421('0x19')]();};}function respondWithResult(_0x2601cf,_0x11d232){_0x11d232=_0x11d232||0xc8;return function(_0x351f35){if(_0x351f35){return _0x2601cf[_0x6421('0x18')](_0x11d232)[_0x6421('0x1a')](_0x351f35);}};}function respondWithFilteredResult(_0x445dfb,_0x1aee33){return function(_0x405191){if(_0x405191){var _0x40e349=_0x405191[_0x6421('0x1b')],_0xd83160=_0x1aee33[_0x6421('0x1c')],_0xbe9229=_0x1aee33[_0x6421('0x1c')]+_0x1aee33[_0x6421('0x1d')],_0x5e4b4d;if(_0xbe9229>=_0x40e349){_0xbe9229=_0x40e349;_0x5e4b4d=0xc8;}else{_0x5e4b4d=0xce;}_0x445dfb[_0x6421('0x18')](_0x5e4b4d);return _0x445dfb[_0x6421('0x1e')](_0x6421('0x1f'),_0xd83160+'-'+_0xbe9229+'/'+_0x40e349)[_0x6421('0x1a')](_0x405191);}return null;};}function patchUpdates(_0x3c626a){return function(_0x3b0148){try{jsonpatch['apply'](_0x3b0148,_0x3c626a,!![]);}catch(_0x52d167){return BPromise[_0x6421('0x20')](_0x52d167);}return _0x3b0148['save']();};}function saveUpdates(_0x166329,_0x4f4713){return function(_0x20446a){if(_0x20446a){return _0x20446a[_0x6421('0x21')](_0x166329)[_0x6421('0x22')](function(_0x5a206f){return _0x5a206f;});}return null;};}function removeEntity(_0x6172df,_0x48eeeb){return function(_0x3323d3){if(_0x3323d3){return _0x3323d3[_0x6421('0x23')]()['then'](function(){_0x6172df[_0x6421('0x18')](0xcc)[_0x6421('0x19')]();});}};}function handleEntityNotFound(_0x10c635,_0x4ccbcd){return function(_0x5e6c06){if(!_0x5e6c06){_0x10c635[_0x6421('0x17')](0x194);}return _0x5e6c06;};}function handleError(_0x3e453e,_0x34efa9){_0x34efa9=_0x34efa9||0x1f4;return function(_0x4b2a07){logger[_0x6421('0x24')](_0x4b2a07[_0x6421('0x25')]);if(_0x4b2a07['name']){delete _0x4b2a07[_0x6421('0x26')];}_0x3e453e[_0x6421('0x18')](_0x34efa9)[_0x6421('0x27')](_0x4b2a07);};}exports[_0x6421('0x28')]=function(_0x1f0149,_0x11167b){var _0x1e52e2={},_0x5d718b={},_0x5ec7f6={'count':0x0,'rows':[]};var _0x5a3f16=_[_0x6421('0x29')](db['FreshdeskField'][_0x6421('0x2a')],function(_0xd98781){return{'name':_0xd98781[_0x6421('0x2b')],'type':_0xd98781[_0x6421('0x2c')][_0x6421('0x2d')]};});_0x5d718b[_0x6421('0x2e')]=_['map'](_0x5a3f16,'name');_0x5d718b[_0x6421('0x2f')]=_['keys'](_0x1f0149['query']);_0x5d718b[_0x6421('0x30')]=_['intersection'](_0x5d718b['model'],_0x5d718b[_0x6421('0x2f')]);_0x1e52e2[_0x6421('0x31')]=_['intersection'](_0x5d718b[_0x6421('0x2e')],qs[_0x6421('0x32')](_0x1f0149[_0x6421('0x2f')][_0x6421('0x32')]));_0x1e52e2['attributes']=_0x1e52e2[_0x6421('0x31')]['length']?_0x1e52e2[_0x6421('0x31')]:_0x5d718b['model'];if(!_0x1f0149['query'][_0x6421('0x33')](_0x6421('0x34'))){_0x1e52e2['limit']=qs[_0x6421('0x1d')](_0x1f0149[_0x6421('0x2f')][_0x6421('0x1d')]);_0x1e52e2['offset']=qs['offset'](_0x1f0149[_0x6421('0x2f')]['offset']);}_0x1e52e2[_0x6421('0x35')]=qs[_0x6421('0x36')](_0x1f0149[_0x6421('0x2f')][_0x6421('0x36')]);_0x1e52e2[_0x6421('0x37')]=qs[_0x6421('0x30')](_[_0x6421('0x38')](_0x1f0149[_0x6421('0x2f')],_0x5d718b[_0x6421('0x30')]));if(_0x1f0149[_0x6421('0x2f')][_0x6421('0x39')]){_0x1e52e2['where']=_[_0x6421('0x3a')](_0x1e52e2['where'],{'$or':_[_0x6421('0x29')](_0x5a3f16,function(_0x19d8d9){if(_0x19d8d9[_0x6421('0x2c')]!==_0x6421('0x3b')){var _0x2d33e6={};_0x2d33e6[_0x19d8d9[_0x6421('0x26')]]={'$like':'%'+_0x1f0149[_0x6421('0x2f')][_0x6421('0x39')]+'%'};return _0x2d33e6;}})});}_0x1e52e2=_[_0x6421('0x3a')]({},_0x1e52e2,_0x1f0149[_0x6421('0x3c')]);var _0x2a9fd7={'where':_0x1e52e2[_0x6421('0x37')]};return db[_0x6421('0x3d')][_0x6421('0x1b')](_0x2a9fd7)[_0x6421('0x22')](function(_0x4261af){_0x5ec7f6[_0x6421('0x1b')]=_0x4261af;if(_0x1f0149[_0x6421('0x2f')]['includeAll']){_0x1e52e2['include']=[{'all':!![]}];}return db['FreshdeskField'][_0x6421('0x3e')](_0x1e52e2);})[_0x6421('0x22')](function(_0x8f980e){_0x5ec7f6['rows']=_0x8f980e;return _0x5ec7f6;})[_0x6421('0x22')](respondWithFilteredResult(_0x11167b,_0x1e52e2))[_0x6421('0x3f')](handleError(_0x11167b,null));};exports[_0x6421('0x40')]=function(_0x52ed5a,_0x5a8091){var _0x273850={'raw':!![],'where':{'id':_0x52ed5a['params']['id']}},_0x10510e={};_0x10510e[_0x6421('0x2e')]=_[_0x6421('0x41')](db['FreshdeskField'][_0x6421('0x2a')]);_0x10510e[_0x6421('0x2f')]=_[_0x6421('0x41')](_0x52ed5a[_0x6421('0x2f')]);_0x10510e[_0x6421('0x30')]=_[_0x6421('0x42')](_0x10510e[_0x6421('0x2e')],_0x10510e[_0x6421('0x2f')]);_0x273850[_0x6421('0x31')]=_[_0x6421('0x42')](_0x10510e[_0x6421('0x2e')],qs[_0x6421('0x32')](_0x52ed5a['query'][_0x6421('0x32')]));_0x273850[_0x6421('0x31')]=_0x273850['attributes'][_0x6421('0x43')]?_0x273850[_0x6421('0x31')]:_0x10510e[_0x6421('0x2e')];if(_0x52ed5a[_0x6421('0x2f')][_0x6421('0x44')]){_0x273850[_0x6421('0x45')]=[{'all':!![]}];}_0x273850=_[_0x6421('0x3a')]({},_0x273850,_0x52ed5a[_0x6421('0x3c')]);return db[_0x6421('0x3d')][_0x6421('0x46')](_0x273850)[_0x6421('0x22')](handleEntityNotFound(_0x5a8091,null))[_0x6421('0x22')](respondWithResult(_0x5a8091,null))[_0x6421('0x3f')](handleError(_0x5a8091,null));};exports[_0x6421('0x47')]=function(_0x267f15,_0x4f2f77){return db['FreshdeskField']['create'](_0x267f15['body'],{})[_0x6421('0x22')](respondWithResult(_0x4f2f77,0xc9))[_0x6421('0x3f')](handleError(_0x4f2f77,null));};exports['update']=function(_0xacf636,_0x3692db){if(_0xacf636[_0x6421('0x48')]['id']){delete _0xacf636[_0x6421('0x48')]['id'];}return db[_0x6421('0x3d')][_0x6421('0x46')]({'where':{'id':_0xacf636[_0x6421('0x49')]['id']}})[_0x6421('0x22')](handleEntityNotFound(_0x3692db,null))['then'](saveUpdates(_0xacf636['body'],null))[_0x6421('0x22')](respondWithResult(_0x3692db,null))['catch'](handleError(_0x3692db,null));};exports[_0x6421('0x23')]=function(_0xf70613,_0x2f249f){return db[_0x6421('0x3d')]['find']({'where':{'id':_0xf70613[_0x6421('0x49')]['id']}})['then'](handleEntityNotFound(_0x2f249f,null))[_0x6421('0x22')](removeEntity(_0x2f249f,null))[_0x6421('0x3f')](handleError(_0x2f249f,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index c091680..882bba1 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 _0x9137=['int_freshdesk_fields','freshdesk_unique_index','FieldId','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x9137,0xdb));var _0x7913=function(_0x2725cb,_0x4af1c9){_0x2725cb=_0x2725cb-0x0;var _0xf4bac1=_0x9137[_0x2725cb];return _0xf4bac1;};'use strict';var _=require(_0x7913('0x0'));var util=require('util');var logger=require(_0x7913('0x1'))('api');var moment=require(_0x7913('0x2'));var BPromise=require(_0x7913('0x3'));var rp=require(_0x7913('0x4'));var fs=require('fs');var path=require(_0x7913('0x5'));var rimraf=require(_0x7913('0x6'));var config=require('../../config/environment');var attributes=require('./intFreshdeskField.attributes');module[_0x7913('0x7')]=function(_0x466f0e,_0x566fb6){return _0x466f0e[_0x7913('0x8')]('FreshdeskField',attributes,{'tableName':_0x7913('0x9'),'paranoid':![],'indexes':[{'name':_0x7913('0xa'),'fields':['idField',_0x7913('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7e23=['freshdesk_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','request-promise','rimraf','./intFreshdeskField.attributes','define','FreshdeskField','int_freshdesk_fields'];(function(_0x308ba0,_0x4d73bf){var _0x5bdc1b=function(_0x448134){while(--_0x448134){_0x308ba0['push'](_0x308ba0['shift']());}};_0x5bdc1b(++_0x4d73bf);}(_0x7e23,0x129));var _0x37e2=function(_0x3d3fa9,_0x39728d){_0x3d3fa9=_0x3d3fa9-0x0;var _0x3463c1=_0x7e23[_0x3d3fa9];return _0x3463c1;};'use strict';var _=require(_0x37e2('0x0'));var util=require(_0x37e2('0x1'));var logger=require('../../config/logger')(_0x37e2('0x2'));var moment=require(_0x37e2('0x3'));var BPromise=require(_0x37e2('0x4'));var rp=require(_0x37e2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x37e2('0x6'));var config=require('../../config/environment');var attributes=require(_0x37e2('0x7'));module['exports']=function(_0x4ad1a1,_0x393417){return _0x4ad1a1[_0x37e2('0x8')](_0x37e2('0x9'),attributes,{'tableName':_0x37e2('0xa'),'paranoid':![],'indexes':[{'name':_0x37e2('0xb'),'fields':[_0x37e2('0xc'),_0x37e2('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index de16d99..1eef404 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 _0xb10b=['stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskField,\x20%s,\x20%s','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x545c3e,_0x817076){var _0x4f118e=function(_0x41f18b){while(--_0x41f18b){_0x545c3e['push'](_0x545c3e['shift']());}};_0x4f118e(++_0x817076);}(_0xb10b,0x12a));var _0xbb10=function(_0x40ba7c,_0x3622f5){_0x40ba7c=_0x40ba7c-0x0;var _0x59b6b6=_0xb10b[_0x40ba7c];return _0x59b6b6;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});} \ No newline at end of file +var _0x7a54=['info','FreshdeskField,\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(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x7a54,0x106));var _0x47a5=function(_0x3bb163,_0x559566){_0x3bb163=_0x3bb163-0x0;var _0x5ec317=_0x7a54[_0x3bb163];return _0x5ec317;};'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')]('FreshdeskField,\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/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index bf4cc54..7338e92 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 _0x43d0=['index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated'];(function(_0x2e1657,_0x4c330d){var _0x5e2b4f=function(_0x357ef0){while(--_0x357ef0){_0x2e1657['push'](_0x2e1657['shift']());}};_0x5e2b4f(++_0x4c330d);}(_0x43d0,0xef));var _0x043d=function(_0xe6e78c,_0x582369){_0xe6e78c=_0xe6e78c-0x0;var _0x2a09c8=_0x43d0[_0xe6e78c];return _0x2a09c8;};'use strict';var multer=require(_0x043d('0x0'));var util=require(_0x043d('0x1'));var path=require(_0x043d('0x2'));var timeout=require(_0x043d('0x3'));var express=require(_0x043d('0x4'));var router=express[_0x043d('0x5')]();var auth=require(_0x043d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x043d('0x7'));var controller=require(_0x043d('0x8'));router[_0x043d('0x9')]('/',auth[_0x043d('0xa')](),controller[_0x043d('0xb')]);router[_0x043d('0x9')]('/:id',auth[_0x043d('0xa')](),controller[_0x043d('0xc')]);router[_0x043d('0x9')](_0x043d('0xd'),auth[_0x043d('0xa')](),controller[_0x043d('0xe')]);router[_0x043d('0x9')](_0x043d('0xf'),auth[_0x043d('0xa')](),controller[_0x043d('0x10')]);router[_0x043d('0x11')]('/',auth[_0x043d('0xa')](),controller[_0x043d('0x12')]);router[_0x043d('0x11')](_0x043d('0xd'),auth[_0x043d('0xa')](),controller['addConfiguration']);router[_0x043d('0x13')](_0x043d('0x14'),auth[_0x043d('0xa')](),controller[_0x043d('0x15')]);router[_0x043d('0x16')](_0x043d('0x14'),auth[_0x043d('0xa')](),controller[_0x043d('0x17')]);module[_0x043d('0x18')]=router; \ No newline at end of file +var _0x8bd5=['../../config/environment','./intFreshsalesAccount.controller','get','index','isAuthenticated','getConfigurations','post','addConfiguration','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service'];(function(_0x34f7d1,_0x3495b5){var _0x4cdd94=function(_0xcbb513){while(--_0xcbb513){_0x34f7d1['push'](_0x34f7d1['shift']());}};_0x4cdd94(++_0x3495b5);}(_0x8bd5,0x13d));var _0x58bd=function(_0x57e54e,_0x8af779){_0x57e54e=_0x57e54e-0x0;var _0x8a342a=_0x8bd5[_0x57e54e];return _0x8a342a;};'use strict';var multer=require(_0x58bd('0x0'));var util=require(_0x58bd('0x1'));var path=require(_0x58bd('0x2'));var timeout=require(_0x58bd('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x58bd('0x4'));var interaction=require(_0x58bd('0x5'));var config=require(_0x58bd('0x6'));var controller=require(_0x58bd('0x7'));router[_0x58bd('0x8')]('/',auth['isAuthenticated'](),controller[_0x58bd('0x9')]);router['get']('/:id',auth[_0x58bd('0xa')](),controller['show']);router[_0x58bd('0x8')]('/:id/configurations',auth[_0x58bd('0xa')](),controller[_0x58bd('0xb')]);router[_0x58bd('0x8')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth[_0x58bd('0xa')](),controller['create']);router[_0x58bd('0xc')]('/:id/configurations',auth[_0x58bd('0xa')](),controller[_0x58bd('0xd')]);router[_0x58bd('0xe')](_0x58bd('0xf'),auth[_0x58bd('0xa')](),controller[_0x58bd('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x58bd('0x11')]);module[_0x58bd('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index a8825a0..3903824 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 _0xb5fb=['sequelize','exports','STRING','username','remoteUri'];(function(_0x447ef1,_0x374cd2){var _0x3d72ec=function(_0x3e10b){while(--_0x3e10b){_0x447ef1['push'](_0x447ef1['shift']());}};_0x3d72ec(++_0x374cd2);}(_0xb5fb,0x172));var _0xbb5f=function(_0x2192ae,_0x197b1e){_0x2192ae=_0x2192ae-0x0;var _0x5d8404=_0xb5fb[_0x2192ae];return _0x5d8404;};'use strict';var Sequelize=require(_0xbb5f('0x0'));module[_0xbb5f('0x1')]={'name':{'type':Sequelize[_0xbb5f('0x2')]},'description':{'type':Sequelize[_0xbb5f('0x2')]},'username':{'type':Sequelize[_0xbb5f('0x2')],'unique':_0xbb5f('0x3')},'apiKey':{'type':Sequelize[_0xbb5f('0x2')]},'remoteUri':{'type':Sequelize[_0xbb5f('0x2')],'unique':_0xbb5f('0x4')},'serverUrl':{'type':Sequelize[_0xbb5f('0x2')]}}; \ No newline at end of file +var _0xcf3d=['exports','STRING','username','remoteUri','sequelize'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xcf3d,0x19e));var _0xdcf3=function(_0x17c8d2,_0x284ad6){_0x17c8d2=_0x17c8d2-0x0;var _0xc88187=_0xcf3d[_0x17c8d2];return _0xc88187;};'use strict';var Sequelize=require(_0xdcf3('0x0'));module[_0xdcf3('0x1')]={'name':{'type':Sequelize[_0xdcf3('0x2')]},'description':{'type':Sequelize[_0xdcf3('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xdcf3('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xdcf3('0x2')],'unique':_0xdcf3('0x4')},'serverUrl':{'type':Sequelize[_0xdcf3('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index d6d6ec8..d2ff762 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 _0xd3dc=['destroy','getConfigurations','findOne','FreshsalesConfiguration','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','Subjects','FreshsalesField','getFields','username','apiKey','remoteUri','substring','format','Token\x20token=','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','test','ValidationError','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','then','stack','name','index','map','FreshsalesAccount','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','update','body'];(function(_0x992fd0,_0x53feeb){var _0x5a4785=function(_0x15e995){while(--_0x15e995){_0x992fd0['push'](_0x992fd0['shift']());}};_0x5a4785(++_0x53feeb);}(_0xd3dc,0x1d7));var _0xcd3d=function(_0x49067e,_0x19ecb2){_0x49067e=_0x49067e-0x0;var _0x11dde6=_0xd3dc[_0x49067e];return _0x11dde6;};'use strict';var pdf=require(_0xcd3d('0x0'));var emlformat=require(_0xcd3d('0x1'));var rimraf=require(_0xcd3d('0x2'));var zipdir=require(_0xcd3d('0x3'));var jsonpatch=require(_0xcd3d('0x4'));var rp=require(_0xcd3d('0x5'));var moment=require(_0xcd3d('0x6'));var BPromise=require(_0xcd3d('0x7'));var Mustache=require(_0xcd3d('0x8'));var util=require('util');var path=require(_0xcd3d('0x9'));var sox=require(_0xcd3d('0xa'));var csv=require('to-csv');var ejs=require(_0xcd3d('0xb'));var fs=require('fs');var _=require(_0xcd3d('0xc'));var squel=require(_0xcd3d('0xd'));var crypto=require(_0xcd3d('0xe'));var jsforce=require(_0xcd3d('0xf'));var deskjs=require(_0xcd3d('0x10'));var toCsv=require('to-csv');var querystring=require(_0xcd3d('0x11'));var Papa=require('papaparse');var Redis=require(_0xcd3d('0x12'));var authService=require(_0xcd3d('0x13'));var qs=require(_0xcd3d('0x14'));var as=require(_0xcd3d('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xcd3d('0x16'));var utils=require('../../config/utils');var config=require(_0xcd3d('0x17'));var db=require(_0xcd3d('0x18'))['db'];var integrations=require(_0xcd3d('0x19'));var jayson=require(_0xcd3d('0x1a'));var client=jayson['client'][_0xcd3d('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x53b8cf,_0x11180b,_0x27ebd8){if(_0x27ebd8){var _0x389c91=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x389c91[_0xcd3d('0x1c')](_0x11180b)){return _0x53b8cf;}else{throw new db['Sequelize'][(_0xcd3d('0x1d'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x53b8cf;}}function respondWithRpcPromise(_0x57cf70,_0x5bf461,_0x1add0e,_0x2efa7d){return new BPromise(function(_0x437ad8,_0x5dea97){var _0x3b764a=_0x2efa7d||client;return _0x3b764a['request'](_0x57cf70,_0x1add0e)['then'](function(_0x5710ee){logger[_0xcd3d('0x1e')](_0xcd3d('0x1f'),_0x5bf461,_0xcd3d('0x20'));logger[_0xcd3d('0x21')](_0xcd3d('0x22'),_0x5bf461,_0xcd3d('0x20'),JSON[_0xcd3d('0x23')](_0x5710ee));if(_0x5710ee['error']){if(_0x5710ee[_0xcd3d('0x24')][_0xcd3d('0x25')]===0x1f4){logger[_0xcd3d('0x24')](_0xcd3d('0x1f'),_0x5bf461,_0x5710ee[_0xcd3d('0x24')][_0xcd3d('0x26')]);return _0x5dea97(_0x5710ee['error'][_0xcd3d('0x26')]);}logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x5bf461,_0x5710ee[_0xcd3d('0x24')][_0xcd3d('0x26')]);return _0x437ad8(_0x5710ee[_0xcd3d('0x24')][_0xcd3d('0x26')]);}else{logger[_0xcd3d('0x1e')](_0xcd3d('0x1f'),_0x5bf461,_0xcd3d('0x20'));_0x437ad8(_0x5710ee[_0xcd3d('0x27')][_0xcd3d('0x26')]);}})['catch'](function(_0x1e0d05){logger[_0xcd3d('0x24')](_0xcd3d('0x1f'),_0x5bf461,_0x1e0d05);_0x5dea97(_0x1e0d05);});});}function respondWithStatusCode(_0x978efd,_0x3f3798){_0x3f3798=_0x3f3798||0xcc;return function(_0x4c2c7f){if(_0x4c2c7f){return _0x978efd[_0xcd3d('0x28')](_0x3f3798);}return _0x978efd[_0xcd3d('0x29')](_0x3f3798)[_0xcd3d('0x2a')]();};}function respondWithResult(_0x4a4c33,_0x4359de){_0x4359de=_0x4359de||0xc8;return function(_0x1a7251){if(_0x1a7251){return _0x4a4c33['status'](_0x4359de)[_0xcd3d('0x2b')](_0x1a7251);}};}function respondWithFilteredResult(_0x4957ce,_0x2ac63c){return function(_0x55719b){if(_0x55719b){var _0x3c5be3=_0x55719b[_0xcd3d('0x2c')],_0xe1ec91=_0x2ac63c[_0xcd3d('0x2d')],_0x568450=_0x2ac63c['offset']+_0x2ac63c[_0xcd3d('0x2e')],_0x4086a0;if(_0x568450>=_0x3c5be3){_0x568450=_0x3c5be3;_0x4086a0=0xc8;}else{_0x4086a0=0xce;}_0x4957ce['status'](_0x4086a0);return _0x4957ce['set'](_0xcd3d('0x2f'),_0xe1ec91+'-'+_0x568450+'/'+_0x3c5be3)[_0xcd3d('0x2b')](_0x55719b);}return null;};}function patchUpdates(_0x37dcc9){return function(_0x51d540){try{jsonpatch[_0xcd3d('0x30')](_0x51d540,_0x37dcc9,!![]);}catch(_0x456bf0){return BPromise[_0xcd3d('0x31')](_0x456bf0);}return _0x51d540[_0xcd3d('0x32')]();};}function saveUpdates(_0x3e712c,_0x3a776a){return function(_0x217b2d){if(_0x217b2d){return _0x217b2d['update'](_0x3e712c)['then'](function(_0x2b2238){return _0x2b2238;});}return null;};}function removeEntity(_0x29cc01,_0x1e6b0a){return function(_0x4e0911){if(_0x4e0911){return _0x4e0911['destroy']()[_0xcd3d('0x33')](function(){_0x29cc01['status'](0xcc)[_0xcd3d('0x2a')]();});}};}function handleEntityNotFound(_0xcc4df7,_0x113a5a){return function(_0x49d3bd){if(!_0x49d3bd){_0xcc4df7[_0xcd3d('0x28')](0x194);}return _0x49d3bd;};}function handleError(_0x5ae1ca,_0x46f945){_0x46f945=_0x46f945||0x1f4;return function(_0x2f66eb){logger[_0xcd3d('0x24')](_0x2f66eb[_0xcd3d('0x34')]);if(_0x2f66eb[_0xcd3d('0x35')]){delete _0x2f66eb[_0xcd3d('0x35')];}_0x5ae1ca[_0xcd3d('0x29')](_0x46f945)['send'](_0x2f66eb);};}exports[_0xcd3d('0x36')]=function(_0x488fd7,_0x1d0c8b){var _0x256a26={},_0xc16d69={},_0x595b22={'count':0x0,'rows':[]};var _0x182bd9=_[_0xcd3d('0x37')](db[_0xcd3d('0x38')][_0xcd3d('0x39')],function(_0x1358df){return{'name':_0x1358df['fieldName'],'type':_0x1358df[_0xcd3d('0x3a')][_0xcd3d('0x3b')]};});_0xc16d69[_0xcd3d('0x3c')]=_[_0xcd3d('0x37')](_0x182bd9,'name');_0xc16d69[_0xcd3d('0x3d')]=_[_0xcd3d('0x3e')](_0x488fd7['query']);_0xc16d69[_0xcd3d('0x3f')]=_[_0xcd3d('0x40')](_0xc16d69[_0xcd3d('0x3c')],_0xc16d69[_0xcd3d('0x3d')]);_0x256a26['attributes']=_['intersection'](_0xc16d69[_0xcd3d('0x3c')],qs['fields'](_0x488fd7[_0xcd3d('0x3d')][_0xcd3d('0x41')]));_0x256a26[_0xcd3d('0x42')]=_0x256a26[_0xcd3d('0x42')][_0xcd3d('0x43')]?_0x256a26['attributes']:_0xc16d69[_0xcd3d('0x3c')];if(!_0x488fd7[_0xcd3d('0x3d')][_0xcd3d('0x44')](_0xcd3d('0x45'))){_0x256a26[_0xcd3d('0x2e')]=qs['limit'](_0x488fd7[_0xcd3d('0x3d')][_0xcd3d('0x2e')]);_0x256a26[_0xcd3d('0x2d')]=qs[_0xcd3d('0x2d')](_0x488fd7[_0xcd3d('0x3d')][_0xcd3d('0x2d')]);}_0x256a26[_0xcd3d('0x46')]=qs[_0xcd3d('0x47')](_0x488fd7[_0xcd3d('0x3d')]['sort']);_0x256a26[_0xcd3d('0x48')]=qs[_0xcd3d('0x3f')](_[_0xcd3d('0x49')](_0x488fd7[_0xcd3d('0x3d')],_0xc16d69[_0xcd3d('0x3f')]));if(_0x488fd7['query'][_0xcd3d('0x4a')]){_0x256a26[_0xcd3d('0x48')]=_[_0xcd3d('0x4b')](_0x256a26[_0xcd3d('0x48')],{'$or':_[_0xcd3d('0x37')](_0x182bd9,function(_0x335ab1){if(_0x335ab1[_0xcd3d('0x3a')]!==_0xcd3d('0x4c')){var _0x44526={};_0x44526[_0x335ab1[_0xcd3d('0x35')]]={'$like':'%'+_0x488fd7[_0xcd3d('0x3d')][_0xcd3d('0x4a')]+'%'};return _0x44526;}})});}_0x256a26=_[_0xcd3d('0x4b')]({},_0x256a26,_0x488fd7[_0xcd3d('0x4d')]);var _0x532efe={'where':_0x256a26[_0xcd3d('0x48')]};return db[_0xcd3d('0x38')][_0xcd3d('0x2c')](_0x532efe)['then'](function(_0x4d5b75){_0x595b22[_0xcd3d('0x2c')]=_0x4d5b75;if(_0x488fd7['query'][_0xcd3d('0x4e')]){_0x256a26[_0xcd3d('0x4f')]=[{'all':!![]}];}return db['FreshsalesAccount'][_0xcd3d('0x50')](_0x256a26);})[_0xcd3d('0x33')](function(_0x4a31bf){_0x595b22[_0xcd3d('0x51')]=_0x4a31bf;return _0x595b22;})['then'](respondWithFilteredResult(_0x1d0c8b,_0x256a26))[_0xcd3d('0x52')](handleError(_0x1d0c8b,null));};exports[_0xcd3d('0x53')]=function(_0xcbdf86,_0x1f35b0){var _0x4fb237={'raw':![],'where':{'id':_0xcbdf86[_0xcd3d('0x54')]['id']}},_0x36b6d6={};_0x36b6d6[_0xcd3d('0x3c')]=_[_0xcd3d('0x3e')](db[_0xcd3d('0x38')][_0xcd3d('0x39')]);_0x36b6d6[_0xcd3d('0x3d')]=_[_0xcd3d('0x3e')](_0xcbdf86[_0xcd3d('0x3d')]);_0x36b6d6[_0xcd3d('0x3f')]=_['intersection'](_0x36b6d6[_0xcd3d('0x3c')],_0x36b6d6[_0xcd3d('0x3d')]);_0x4fb237[_0xcd3d('0x42')]=_[_0xcd3d('0x40')](_0x36b6d6[_0xcd3d('0x3c')],qs[_0xcd3d('0x41')](_0xcbdf86[_0xcd3d('0x3d')]['fields']));_0x4fb237['attributes']=_0x4fb237['attributes'][_0xcd3d('0x43')]?_0x4fb237[_0xcd3d('0x42')]:_0x36b6d6[_0xcd3d('0x3c')];if(_0xcbdf86[_0xcd3d('0x3d')][_0xcd3d('0x4e')]){_0x4fb237[_0xcd3d('0x4f')]=[{'all':!![]}];}_0x4fb237=_['merge']({},_0x4fb237,_0xcbdf86[_0xcd3d('0x4d')]);return db['FreshsalesAccount'][_0xcd3d('0x55')](_0x4fb237)[_0xcd3d('0x33')](handleEntityNotFound(_0x1f35b0,null))[_0xcd3d('0x33')](respondWithResult(_0x1f35b0,null))['catch'](handleError(_0x1f35b0,null));};exports[_0xcd3d('0x56')]=function(_0x2ddd39,_0x3e8147){return db[_0xcd3d('0x38')][_0xcd3d('0x56')](_0x2ddd39['body'],{})[_0xcd3d('0x33')](respondWithResult(_0x3e8147,0xc9))[_0xcd3d('0x52')](handleError(_0x3e8147,null));};exports[_0xcd3d('0x57')]=function(_0x44d6c1,_0x377c56){if(_0x44d6c1[_0xcd3d('0x58')]['id']){delete _0x44d6c1['body']['id'];}return db[_0xcd3d('0x38')][_0xcd3d('0x55')]({'where':{'id':_0x44d6c1[_0xcd3d('0x54')]['id']}})[_0xcd3d('0x33')](handleEntityNotFound(_0x377c56,null))[_0xcd3d('0x33')](saveUpdates(_0x44d6c1[_0xcd3d('0x58')],null))[_0xcd3d('0x33')](respondWithResult(_0x377c56,null))[_0xcd3d('0x52')](handleError(_0x377c56,null));};exports[_0xcd3d('0x59')]=function(_0xcecb07,_0x40b0bd){return db[_0xcd3d('0x38')][_0xcd3d('0x55')]({'where':{'id':_0xcecb07[_0xcd3d('0x54')]['id']}})[_0xcd3d('0x33')](handleEntityNotFound(_0x40b0bd,null))[_0xcd3d('0x33')](removeEntity(_0x40b0bd,null))[_0xcd3d('0x52')](handleError(_0x40b0bd,null));};exports[_0xcd3d('0x5a')]=function(_0x293f60,_0x3bf371,_0x5765fb){var _0x2c7a76={};var _0x22aca4={};var _0x2c8e8d;var _0x175d2f;return db[_0xcd3d('0x38')][_0xcd3d('0x5b')]({'where':{'id':_0x293f60[_0xcd3d('0x54')]['id']}})[_0xcd3d('0x33')](handleEntityNotFound(_0x3bf371,null))[_0xcd3d('0x33')](function(_0x6ef084){if(_0x6ef084){_0x2c8e8d=_0x6ef084;_0x22aca4[_0xcd3d('0x3c')]=_[_0xcd3d('0x3e')](db[_0xcd3d('0x5c')][_0xcd3d('0x39')]);_0x22aca4[_0xcd3d('0x3d')]=_['keys'](_0x293f60[_0xcd3d('0x3d')]);_0x22aca4[_0xcd3d('0x3f')]=_[_0xcd3d('0x40')](_0x22aca4[_0xcd3d('0x3c')],_0x22aca4['query']);_0x2c7a76['attributes']=_[_0xcd3d('0x40')](_0x22aca4[_0xcd3d('0x3c')],qs[_0xcd3d('0x41')](_0x293f60[_0xcd3d('0x3d')][_0xcd3d('0x41')]));_0x2c7a76['attributes']=_0x2c7a76[_0xcd3d('0x42')][_0xcd3d('0x43')]?_0x2c7a76[_0xcd3d('0x42')]:_0x22aca4['model'];_0x2c7a76[_0xcd3d('0x46')]=qs[_0xcd3d('0x47')](_0x293f60['query']['sort']);_0x2c7a76['where']=qs[_0xcd3d('0x3f')](_[_0xcd3d('0x49')](_0x293f60['query'],_0x22aca4['filters']));if(_0x293f60[_0xcd3d('0x3d')][_0xcd3d('0x4a')]){_0x2c7a76[_0xcd3d('0x48')]=_[_0xcd3d('0x4b')](_0x2c7a76[_0xcd3d('0x48')],{'$or':_[_0xcd3d('0x37')](_0x2c7a76[_0xcd3d('0x42')],function(_0xe4975d){var _0x4e1131={};_0x4e1131[_0xe4975d]={'$like':'%'+_0x293f60[_0xcd3d('0x3d')][_0xcd3d('0x4a')]+'%'};return _0x4e1131;})});}_0x2c7a76=_['merge']({},_0x2c7a76,_0x293f60[_0xcd3d('0x4d')]);return _0x2c8e8d[_0xcd3d('0x5a')](_0x2c7a76);}})[_0xcd3d('0x33')](function(_0x20bc8c){if(_0x20bc8c){_0x175d2f=_0x20bc8c[_0xcd3d('0x43')];if(!_0x293f60['query']['hasOwnProperty'](_0xcd3d('0x45'))){_0x2c7a76[_0xcd3d('0x2e')]=qs[_0xcd3d('0x2e')](_0x293f60['query'][_0xcd3d('0x2e')]);_0x2c7a76[_0xcd3d('0x2d')]=qs[_0xcd3d('0x2d')](_0x293f60[_0xcd3d('0x3d')][_0xcd3d('0x2d')]);}return _0x2c8e8d[_0xcd3d('0x5a')](_0x2c7a76);}})[_0xcd3d('0x33')](function(_0x418bb8){if(_0x418bb8){return _0x418bb8?{'count':_0x175d2f,'rows':_0x418bb8}:null;}})[_0xcd3d('0x33')](respondWithResult(_0x3bf371,null))[_0xcd3d('0x52')](handleError(_0x3bf371,null));};exports[_0xcd3d('0x5d')]=function(_0x5a1a6f,_0x5868e3,_0x4b79f0){if(_0x5a1a6f[_0xcd3d('0x58')]['id']){delete _0x5a1a6f['body']['id'];}return db[_0xcd3d('0x38')][_0xcd3d('0x5b')]({'where':{'id':_0x5a1a6f[_0xcd3d('0x54')]['id']}})[_0xcd3d('0x33')](handleEntityNotFound(_0x5868e3,null))[_0xcd3d('0x33')](function(_0x18e202){if(_0x18e202){_0x5a1a6f['body'][_0xcd3d('0x5e')]=_0x18e202['id'];_0x5a1a6f[_0xcd3d('0x58')]['Subjects']=integrations[_0xcd3d('0x5f')](_0x5a1a6f[_0xcd3d('0x58')][_0xcd3d('0x60')],_0x5a1a6f[_0xcd3d('0x58')]['type']);_0x5a1a6f[_0xcd3d('0x58')][_0xcd3d('0x61')]=integrations[_0xcd3d('0x62')](_0x5a1a6f['body'][_0xcd3d('0x60')],_0x5a1a6f[_0xcd3d('0x58')][_0xcd3d('0x3a')]);return db[_0xcd3d('0x5c')][_0xcd3d('0x56')](_0x5a1a6f[_0xcd3d('0x58')],{'include':[{'model':db['FreshsalesField'],'as':_0xcd3d('0x63')},{'model':db[_0xcd3d('0x64')],'as':'Descriptions'}]});}return null;})[_0xcd3d('0x33')](respondWithResult(_0x5868e3,null))[_0xcd3d('0x52')](handleError(_0x5868e3,null));};exports[_0xcd3d('0x65')]=function(_0x5cb26b,_0x18676b,_0x2416f2){var _0x581e83='';var _0x1040b7='';return db[_0xcd3d('0x38')][_0xcd3d('0x5b')]({'where':{'id':_0x5cb26b[_0xcd3d('0x54')]['id']},'attributes':['id',_0xcd3d('0x66'),'remoteUri',_0xcd3d('0x67')]})[_0xcd3d('0x33')](handleEntityNotFound(_0x18676b,null))[_0xcd3d('0x33')](function(_0x212d4b){if(_0x212d4b){_0x1040b7=_0x212d4b[_0xcd3d('0x66')];_0x581e83=_0x212d4b['remoteUri'];var _0x7a0367=_0x212d4b[_0xcd3d('0x68')]['slice'](-0x1);if(_0x7a0367==='/'){_0x581e83=_0x581e83[_0xcd3d('0x69')](0x0,_0x581e83['lastIndexOf'](_0x7a0367));}return rp({'method':'GET','uri':util[_0xcd3d('0x6a')]('%s%s',_0x581e83,'/api/selector/owners'),'headers':{'Authorization':_0xcd3d('0x6b')+_0x212d4b['apiKey']},'json':!![]});}})[_0xcd3d('0x33')](function(_0xc6e0ed){if(_0xc6e0ed){var _0x2044ee=_0xc6e0ed['users'];var _0x2bee25=![];var _0x1b48b4=null;for(_0x1b48b4=0x0;_0x1b48b4<_0x2044ee[_0xcd3d('0x43')];_0x1b48b4++){if(_0x2044ee[_0x1b48b4]['email']===_0x1040b7){_0x2bee25=!![];}}if(_0x2bee25){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0xcd3d('0x33')](respondWithResult(_0x18676b,null))[_0xcd3d('0x52')](function(_0x58a4df){var _0x246648=_0x5cb26b[_0xcd3d('0x3d')]['test']?0x1f4:_0x58a4df[_0xcd3d('0x6c')]||0x1f4;logger[_0xcd3d('0x24')](_0xcd3d('0x6d'),_0xcd3d('0x65'),_0x246648,JSON[_0xcd3d('0x23')](_0x58a4df));delete _0x58a4df[_0xcd3d('0x35')];if(_0x246648===0x191){_0x246648=0x190;}_0x18676b[_0xcd3d('0x29')](_0x246648)[_0xcd3d('0x6e')](_0x5cb26b[_0xcd3d('0x3d')][_0xcd3d('0x1c')]?{'message':_0xcd3d('0x6f'),'statusCode':_0x58a4df[_0xcd3d('0x6c')]}:_0x58a4df);});}; \ No newline at end of file +var _0xfd40=['FreshsalesConfiguration','hasOwnProperty','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','channel','FreshsalesField','getFields','username','apiKey','remoteUri','slice','substring','lastIndexOf','GET','%s%s','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','request\x20sent','debug','stringify','error','code','FreshsalesAccount,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','length','nolimit','order','sort','filters','pick','filter','where','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','fields','merge','find','create','body','getConfigurations','findOne'];(function(_0x3935d7,_0x39958f){var _0x2ca73e=function(_0x4a6c5d){while(--_0x4a6c5d){_0x3935d7['push'](_0x3935d7['shift']());}};_0x2ca73e(++_0x39958f);}(_0xfd40,0x182));var _0x0fd4=function(_0x495408,_0x18eaef){_0x495408=_0x495408-0x0;var _0x4ebd7c=_0xfd40[_0x495408];return _0x4ebd7c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0fd4('0x0'));var rimraf=require(_0x0fd4('0x1'));var zipdir=require(_0x0fd4('0x2'));var jsonpatch=require(_0x0fd4('0x3'));var rp=require(_0x0fd4('0x4'));var moment=require(_0x0fd4('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0fd4('0x6'));var util=require(_0x0fd4('0x7'));var path=require(_0x0fd4('0x8'));var sox=require(_0x0fd4('0x9'));var csv=require(_0x0fd4('0xa'));var ejs=require(_0x0fd4('0xb'));var fs=require('fs');var _=require(_0x0fd4('0xc'));var squel=require('squel');var crypto=require(_0x0fd4('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0fd4('0xe'));var toCsv=require(_0x0fd4('0xa'));var querystring=require(_0x0fd4('0xf'));var Papa=require(_0x0fd4('0x10'));var Redis=require(_0x0fd4('0x11'));var authService=require(_0x0fd4('0x12'));var qs=require(_0x0fd4('0x13'));var as=require(_0x0fd4('0x14'));var hardwareService=require(_0x0fd4('0x15'));var logger=require(_0x0fd4('0x16'))(_0x0fd4('0x17'));var utils=require(_0x0fd4('0x18'));var config=require(_0x0fd4('0x19'));var db=require(_0x0fd4('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x0fd4('0x1b'));var client=jayson[_0x0fd4('0x1c')]['http']({'port':0x232a});function checkPasswordPattern(_0x531bea,_0x586ef4,_0x5dc9e2){if(_0x5dc9e2){var _0x2b8889=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2b8889['test'](_0x586ef4)){return _0x531bea;}else{throw new db[(_0x0fd4('0x1d'))][(_0x0fd4('0x1e'))](_0x0fd4('0x1f'));}}else{return _0x531bea;}}function respondWithRpcPromise(_0x176d4b,_0x5f4b1e,_0x5c21f1,_0x25d96f){return new BPromise(function(_0x1e220a,_0x2b058e){var _0x49200c=_0x25d96f||client;return _0x49200c['request'](_0x176d4b,_0x5c21f1)[_0x0fd4('0x20')](function(_0x42089f){logger[_0x0fd4('0x21')]('FreshsalesAccount,\x20%s,\x20%s',_0x5f4b1e,_0x0fd4('0x22'));logger[_0x0fd4('0x23')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x5f4b1e,_0x0fd4('0x22'),JSON[_0x0fd4('0x24')](_0x42089f));if(_0x42089f[_0x0fd4('0x25')]){if(_0x42089f[_0x0fd4('0x25')][_0x0fd4('0x26')]===0x1f4){logger[_0x0fd4('0x25')](_0x0fd4('0x27'),_0x5f4b1e,_0x42089f['error'][_0x0fd4('0x28')]);return _0x2b058e(_0x42089f[_0x0fd4('0x25')]['message']);}logger['error'](_0x0fd4('0x27'),_0x5f4b1e,_0x42089f[_0x0fd4('0x25')][_0x0fd4('0x28')]);return _0x1e220a(_0x42089f['error'][_0x0fd4('0x28')]);}else{logger['info']('FreshsalesAccount,\x20%s,\x20%s',_0x5f4b1e,_0x0fd4('0x22'));_0x1e220a(_0x42089f['result'][_0x0fd4('0x28')]);}})[_0x0fd4('0x29')](function(_0x182e1b){logger[_0x0fd4('0x25')](_0x0fd4('0x27'),_0x5f4b1e,_0x182e1b);_0x2b058e(_0x182e1b);});});}function respondWithStatusCode(_0x2bf50e,_0x58a0cc){_0x58a0cc=_0x58a0cc||0xcc;return function(_0x419a92){if(_0x419a92){return _0x2bf50e[_0x0fd4('0x2a')](_0x58a0cc);}return _0x2bf50e[_0x0fd4('0x2b')](_0x58a0cc)[_0x0fd4('0x2c')]();};}function respondWithResult(_0x31f69a,_0x581ef6){_0x581ef6=_0x581ef6||0xc8;return function(_0x19e81c){if(_0x19e81c){return _0x31f69a[_0x0fd4('0x2b')](_0x581ef6)[_0x0fd4('0x2d')](_0x19e81c);}};}function respondWithFilteredResult(_0xa1ef7e,_0x146db9){return function(_0x31ba22){if(_0x31ba22){var _0x586e33=_0x31ba22[_0x0fd4('0x2e')],_0x428253=_0x146db9['offset'],_0x5c6598=_0x146db9[_0x0fd4('0x2f')]+_0x146db9[_0x0fd4('0x30')],_0x56ee41;if(_0x5c6598>=_0x586e33){_0x5c6598=_0x586e33;_0x56ee41=0xc8;}else{_0x56ee41=0xce;}_0xa1ef7e[_0x0fd4('0x2b')](_0x56ee41);return _0xa1ef7e[_0x0fd4('0x31')](_0x0fd4('0x32'),_0x428253+'-'+_0x5c6598+'/'+_0x586e33)[_0x0fd4('0x2d')](_0x31ba22);}return null;};}function patchUpdates(_0x201bd9){return function(_0x21a71d){try{jsonpatch[_0x0fd4('0x33')](_0x21a71d,_0x201bd9,!![]);}catch(_0x172716){return BPromise[_0x0fd4('0x34')](_0x172716);}return _0x21a71d[_0x0fd4('0x35')]();};}function saveUpdates(_0x1079cd,_0x1ac612){return function(_0x4b9355){if(_0x4b9355){return _0x4b9355[_0x0fd4('0x36')](_0x1079cd)['then'](function(_0x788410){return _0x788410;});}return null;};}function removeEntity(_0x39eb47,_0x206a04){return function(_0x1bed19){if(_0x1bed19){return _0x1bed19[_0x0fd4('0x37')]()[_0x0fd4('0x20')](function(){_0x39eb47['status'](0xcc)[_0x0fd4('0x2c')]();});}};}function handleEntityNotFound(_0x412511,_0x2a37b5){return function(_0xa065c2){if(!_0xa065c2){_0x412511['sendStatus'](0x194);}return _0xa065c2;};}function handleError(_0x43ac08,_0x40658c){_0x40658c=_0x40658c||0x1f4;return function(_0x42699e){logger['error'](_0x42699e[_0x0fd4('0x38')]);if(_0x42699e[_0x0fd4('0x39')]){delete _0x42699e[_0x0fd4('0x39')];}_0x43ac08[_0x0fd4('0x2b')](_0x40658c)[_0x0fd4('0x3a')](_0x42699e);};}exports[_0x0fd4('0x3b')]=function(_0x21045d,_0x295971){var _0x2ef7ac={},_0x55378f={},_0x1490d0={'count':0x0,'rows':[]};var _0xb059f4=_[_0x0fd4('0x3c')](db[_0x0fd4('0x3d')][_0x0fd4('0x3e')],function(_0x2bf90f){return{'name':_0x2bf90f[_0x0fd4('0x3f')],'type':_0x2bf90f['type'][_0x0fd4('0x40')]};});_0x55378f[_0x0fd4('0x41')]=_[_0x0fd4('0x3c')](_0xb059f4,_0x0fd4('0x39'));_0x55378f[_0x0fd4('0x42')]=_[_0x0fd4('0x43')](_0x21045d['query']);_0x55378f['filters']=_['intersection'](_0x55378f['model'],_0x55378f[_0x0fd4('0x42')]);_0x2ef7ac[_0x0fd4('0x44')]=_[_0x0fd4('0x45')](_0x55378f[_0x0fd4('0x41')],qs['fields'](_0x21045d[_0x0fd4('0x42')]['fields']));_0x2ef7ac[_0x0fd4('0x44')]=_0x2ef7ac[_0x0fd4('0x44')][_0x0fd4('0x46')]?_0x2ef7ac[_0x0fd4('0x44')]:_0x55378f[_0x0fd4('0x41')];if(!_0x21045d['query']['hasOwnProperty'](_0x0fd4('0x47'))){_0x2ef7ac[_0x0fd4('0x30')]=qs[_0x0fd4('0x30')](_0x21045d[_0x0fd4('0x42')]['limit']);_0x2ef7ac[_0x0fd4('0x2f')]=qs[_0x0fd4('0x2f')](_0x21045d[_0x0fd4('0x42')][_0x0fd4('0x2f')]);}_0x2ef7ac[_0x0fd4('0x48')]=qs[_0x0fd4('0x49')](_0x21045d['query'][_0x0fd4('0x49')]);_0x2ef7ac['where']=qs[_0x0fd4('0x4a')](_[_0x0fd4('0x4b')](_0x21045d[_0x0fd4('0x42')],_0x55378f[_0x0fd4('0x4a')]));if(_0x21045d[_0x0fd4('0x42')][_0x0fd4('0x4c')]){_0x2ef7ac[_0x0fd4('0x4d')]=_['merge'](_0x2ef7ac['where'],{'$or':_[_0x0fd4('0x3c')](_0xb059f4,function(_0x19f336){if(_0x19f336[_0x0fd4('0x4e')]!==_0x0fd4('0x4f')){var _0x46c428={};_0x46c428[_0x19f336[_0x0fd4('0x39')]]={'$like':'%'+_0x21045d[_0x0fd4('0x42')]['filter']+'%'};return _0x46c428;}})});}_0x2ef7ac=_['merge']({},_0x2ef7ac,_0x21045d[_0x0fd4('0x50')]);var _0x26d57f={'where':_0x2ef7ac[_0x0fd4('0x4d')]};return db[_0x0fd4('0x3d')][_0x0fd4('0x2e')](_0x26d57f)['then'](function(_0x3a40f1){_0x1490d0[_0x0fd4('0x2e')]=_0x3a40f1;if(_0x21045d[_0x0fd4('0x42')][_0x0fd4('0x51')]){_0x2ef7ac[_0x0fd4('0x52')]=[{'all':!![]}];}return db['FreshsalesAccount'][_0x0fd4('0x53')](_0x2ef7ac);})[_0x0fd4('0x20')](function(_0x1ab922){_0x1490d0[_0x0fd4('0x54')]=_0x1ab922;return _0x1490d0;})[_0x0fd4('0x20')](respondWithFilteredResult(_0x295971,_0x2ef7ac))['catch'](handleError(_0x295971,null));};exports[_0x0fd4('0x55')]=function(_0x55008f,_0x4191ee){var _0x1e3701={'raw':![],'where':{'id':_0x55008f[_0x0fd4('0x56')]['id']}},_0x1cd4e7={};_0x1cd4e7[_0x0fd4('0x41')]=_[_0x0fd4('0x43')](db[_0x0fd4('0x3d')]['rawAttributes']);_0x1cd4e7['query']=_['keys'](_0x55008f['query']);_0x1cd4e7['filters']=_[_0x0fd4('0x45')](_0x1cd4e7[_0x0fd4('0x41')],_0x1cd4e7['query']);_0x1e3701['attributes']=_[_0x0fd4('0x45')](_0x1cd4e7[_0x0fd4('0x41')],qs['fields'](_0x55008f[_0x0fd4('0x42')][_0x0fd4('0x57')]));_0x1e3701['attributes']=_0x1e3701[_0x0fd4('0x44')][_0x0fd4('0x46')]?_0x1e3701[_0x0fd4('0x44')]:_0x1cd4e7['model'];if(_0x55008f[_0x0fd4('0x42')]['includeAll']){_0x1e3701[_0x0fd4('0x52')]=[{'all':!![]}];}_0x1e3701=_[_0x0fd4('0x58')]({},_0x1e3701,_0x55008f[_0x0fd4('0x50')]);return db[_0x0fd4('0x3d')][_0x0fd4('0x59')](_0x1e3701)[_0x0fd4('0x20')](handleEntityNotFound(_0x4191ee,null))[_0x0fd4('0x20')](respondWithResult(_0x4191ee,null))[_0x0fd4('0x29')](handleError(_0x4191ee,null));};exports[_0x0fd4('0x5a')]=function(_0x4ba2b0,_0x5d141){return db['FreshsalesAccount'][_0x0fd4('0x5a')](_0x4ba2b0[_0x0fd4('0x5b')],{})[_0x0fd4('0x20')](respondWithResult(_0x5d141,0xc9))[_0x0fd4('0x29')](handleError(_0x5d141,null));};exports[_0x0fd4('0x36')]=function(_0x3714a8,_0x31e2ef){if(_0x3714a8['body']['id']){delete _0x3714a8[_0x0fd4('0x5b')]['id'];}return db[_0x0fd4('0x3d')][_0x0fd4('0x59')]({'where':{'id':_0x3714a8[_0x0fd4('0x56')]['id']}})['then'](handleEntityNotFound(_0x31e2ef,null))['then'](saveUpdates(_0x3714a8[_0x0fd4('0x5b')],null))[_0x0fd4('0x20')](respondWithResult(_0x31e2ef,null))[_0x0fd4('0x29')](handleError(_0x31e2ef,null));};exports[_0x0fd4('0x37')]=function(_0x193132,_0x1b6c71){return db[_0x0fd4('0x3d')][_0x0fd4('0x59')]({'where':{'id':_0x193132[_0x0fd4('0x56')]['id']}})['then'](handleEntityNotFound(_0x1b6c71,null))[_0x0fd4('0x20')](removeEntity(_0x1b6c71,null))[_0x0fd4('0x29')](handleError(_0x1b6c71,null));};exports[_0x0fd4('0x5c')]=function(_0x3b653e,_0x54105d,_0x1b86d8){var _0x17ea10={};var _0xd80281={};var _0x57e126;var _0x72af9f;return db['FreshsalesAccount'][_0x0fd4('0x5d')]({'where':{'id':_0x3b653e[_0x0fd4('0x56')]['id']}})[_0x0fd4('0x20')](handleEntityNotFound(_0x54105d,null))['then'](function(_0x2b288e){if(_0x2b288e){_0x57e126=_0x2b288e;_0xd80281[_0x0fd4('0x41')]=_[_0x0fd4('0x43')](db[_0x0fd4('0x5e')][_0x0fd4('0x3e')]);_0xd80281[_0x0fd4('0x42')]=_[_0x0fd4('0x43')](_0x3b653e['query']);_0xd80281[_0x0fd4('0x4a')]=_['intersection'](_0xd80281['model'],_0xd80281[_0x0fd4('0x42')]);_0x17ea10['attributes']=_[_0x0fd4('0x45')](_0xd80281[_0x0fd4('0x41')],qs['fields'](_0x3b653e[_0x0fd4('0x42')]['fields']));_0x17ea10[_0x0fd4('0x44')]=_0x17ea10[_0x0fd4('0x44')][_0x0fd4('0x46')]?_0x17ea10[_0x0fd4('0x44')]:_0xd80281[_0x0fd4('0x41')];_0x17ea10['order']=qs[_0x0fd4('0x49')](_0x3b653e[_0x0fd4('0x42')][_0x0fd4('0x49')]);_0x17ea10['where']=qs[_0x0fd4('0x4a')](_[_0x0fd4('0x4b')](_0x3b653e[_0x0fd4('0x42')],_0xd80281[_0x0fd4('0x4a')]));if(_0x3b653e[_0x0fd4('0x42')][_0x0fd4('0x4c')]){_0x17ea10['where']=_['merge'](_0x17ea10['where'],{'$or':_[_0x0fd4('0x3c')](_0x17ea10['attributes'],function(_0x78b96c){var _0x4ddba6={};_0x4ddba6[_0x78b96c]={'$like':'%'+_0x3b653e[_0x0fd4('0x42')][_0x0fd4('0x4c')]+'%'};return _0x4ddba6;})});}_0x17ea10=_[_0x0fd4('0x58')]({},_0x17ea10,_0x3b653e['options']);return _0x57e126['getConfigurations'](_0x17ea10);}})[_0x0fd4('0x20')](function(_0x10174c){if(_0x10174c){_0x72af9f=_0x10174c[_0x0fd4('0x46')];if(!_0x3b653e[_0x0fd4('0x42')][_0x0fd4('0x5f')](_0x0fd4('0x47'))){_0x17ea10['limit']=qs[_0x0fd4('0x30')](_0x3b653e[_0x0fd4('0x42')][_0x0fd4('0x30')]);_0x17ea10['offset']=qs[_0x0fd4('0x2f')](_0x3b653e[_0x0fd4('0x42')][_0x0fd4('0x2f')]);}return _0x57e126[_0x0fd4('0x5c')](_0x17ea10);}})[_0x0fd4('0x20')](function(_0x36f4ed){if(_0x36f4ed){return _0x36f4ed?{'count':_0x72af9f,'rows':_0x36f4ed}:null;}})[_0x0fd4('0x20')](respondWithResult(_0x54105d,null))[_0x0fd4('0x29')](handleError(_0x54105d,null));};exports[_0x0fd4('0x60')]=function(_0x13d375,_0x520260,_0x2d4a0c){if(_0x13d375[_0x0fd4('0x5b')]['id']){delete _0x13d375[_0x0fd4('0x5b')]['id'];}return db['FreshsalesAccount']['findOne']({'where':{'id':_0x13d375[_0x0fd4('0x56')]['id']}})[_0x0fd4('0x20')](handleEntityNotFound(_0x520260,null))[_0x0fd4('0x20')](function(_0x3af6b3){if(_0x3af6b3){_0x13d375['body'][_0x0fd4('0x61')]=_0x3af6b3['id'];_0x13d375[_0x0fd4('0x5b')]['Subjects']=integrations[_0x0fd4('0x62')](_0x13d375[_0x0fd4('0x5b')]['channel'],_0x13d375[_0x0fd4('0x5b')][_0x0fd4('0x4e')]);_0x13d375[_0x0fd4('0x5b')][_0x0fd4('0x63')]=integrations[_0x0fd4('0x64')](_0x13d375['body'][_0x0fd4('0x65')],_0x13d375[_0x0fd4('0x5b')][_0x0fd4('0x4e')]);return db['FreshsalesConfiguration'][_0x0fd4('0x5a')](_0x13d375[_0x0fd4('0x5b')],{'include':[{'model':db[_0x0fd4('0x66')],'as':'Subjects'},{'model':db['FreshsalesField'],'as':_0x0fd4('0x63')}]});}return null;})[_0x0fd4('0x20')](respondWithResult(_0x520260,null))[_0x0fd4('0x29')](handleError(_0x520260,null));};exports[_0x0fd4('0x67')]=function(_0x406139,_0x471c0f,_0x4b082a){var _0x3fe1de='';var _0x203704='';return db[_0x0fd4('0x3d')][_0x0fd4('0x5d')]({'where':{'id':_0x406139[_0x0fd4('0x56')]['id']},'attributes':['id',_0x0fd4('0x68'),'remoteUri',_0x0fd4('0x69')]})[_0x0fd4('0x20')](handleEntityNotFound(_0x471c0f,null))[_0x0fd4('0x20')](function(_0x261a71){if(_0x261a71){_0x203704=_0x261a71[_0x0fd4('0x68')];_0x3fe1de=_0x261a71[_0x0fd4('0x6a')];var _0x5ad9fa=_0x261a71['remoteUri'][_0x0fd4('0x6b')](-0x1);if(_0x5ad9fa==='/'){_0x3fe1de=_0x3fe1de[_0x0fd4('0x6c')](0x0,_0x3fe1de[_0x0fd4('0x6d')](_0x5ad9fa));}return rp({'method':_0x0fd4('0x6e'),'uri':util['format'](_0x0fd4('0x6f'),_0x3fe1de,'/api/selector/owners'),'headers':{'Authorization':_0x0fd4('0x70')+_0x261a71[_0x0fd4('0x69')]},'json':!![]});}})[_0x0fd4('0x20')](function(_0x142169){if(_0x142169){var _0x8260f5=_0x142169[_0x0fd4('0x71')];var _0x4669e2=![];var _0x5b935e=null;for(_0x5b935e=0x0;_0x5b935e<_0x8260f5[_0x0fd4('0x46')];_0x5b935e++){if(_0x8260f5[_0x5b935e][_0x0fd4('0x72')]===_0x203704){_0x4669e2=!![];}}if(_0x4669e2){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x0fd4('0x73')});}}})[_0x0fd4('0x20')](respondWithResult(_0x471c0f,null))[_0x0fd4('0x29')](function(_0x205758){var _0x38e3fc=_0x406139[_0x0fd4('0x42')][_0x0fd4('0x74')]?0x1f4:_0x205758[_0x0fd4('0x75')]||0x1f4;logger['error'](_0x0fd4('0x76'),_0x0fd4('0x67'),_0x38e3fc,JSON[_0x0fd4('0x24')](_0x205758));delete _0x205758[_0x0fd4('0x39')];if(_0x38e3fc===0x191){_0x38e3fc=0x190;}_0x471c0f[_0x0fd4('0x2b')](_0x38e3fc)[_0x0fd4('0x3a')](_0x406139['query'][_0x0fd4('0x74')]?{'message':_0x0fd4('0x77'),'statusCode':_0x205758[_0x0fd4('0x75')]}:_0x205758);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 2e1745b..479a4a0 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 _0x9a4d=['lodash','util','../../config/logger','api','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','define','FreshsalesAccount','int_freshsales_accounts'];(function(_0x1377c5,_0x4cca47){var _0x4fe3dc=function(_0x3fd635){while(--_0x3fd635){_0x1377c5['push'](_0x1377c5['shift']());}};_0x4fe3dc(++_0x4cca47);}(_0x9a4d,0xa8));var _0xd9a4=function(_0x10e325,_0x444af7){_0x10e325=_0x10e325-0x0;var _0x300f2c=_0x9a4d[_0x10e325];return _0x300f2c;};'use strict';var _=require(_0xd9a4('0x0'));var util=require(_0xd9a4('0x1'));var logger=require(_0xd9a4('0x2'))(_0xd9a4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd9a4('0x4'));var rimraf=require(_0xd9a4('0x5'));var config=require(_0xd9a4('0x6'));var attributes=require(_0xd9a4('0x7'));var integrations=require(_0xd9a4('0x8'));module['exports']=function(_0x2d650f,_0x3f3b61){return _0x2d650f[_0xd9a4('0x9')](_0xd9a4('0xa'),attributes,{'tableName':_0xd9a4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x315c=['define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x713a11,_0xaf9fa5){var _0x1b3879=function(_0x12b7a7){while(--_0x12b7a7){_0x713a11['push'](_0x713a11['shift']());}};_0x1b3879(++_0xaf9fa5);}(_0x315c,0xd5));var _0xc315=function(_0x15499c,_0x153259){_0x15499c=_0x15499c-0x0;var _0x3473fd=_0x315c[_0x15499c];return _0x3473fd;};'use strict';var _=require(_0xc315('0x0'));var util=require(_0xc315('0x1'));var logger=require(_0xc315('0x2'))('api');var moment=require(_0xc315('0x3'));var BPromise=require(_0xc315('0x4'));var rp=require(_0xc315('0x5'));var fs=require('fs');var path=require(_0xc315('0x6'));var rimraf=require('rimraf');var config=require(_0xc315('0x7'));var attributes=require(_0xc315('0x8'));var integrations=require(_0xc315('0x9'));module[_0xc315('0xa')]=function(_0xcd6b96,_0x14fb12){return _0xcd6b96[_0xc315('0xb')](_0xc315('0xc'),attributes,{'tableName':_0xc315('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index 550990f..0182fee 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 _0x58c9=['FreshsalesAccount','findAll','options','raw','where','attributes','include','map','model','debug','GetFreshsalesAccount','ShowFreshsalesAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x39b226,_0x52043b){var _0x2cae39=function(_0x851837){while(--_0x851837){_0x39b226['push'](_0x39b226['shift']());}};_0x2cae39(++_0x52043b);}(_0x58c9,0x1bc));var _0x958c=function(_0x51488c,_0xcf9550){_0x51488c=_0x51488c-0x0;var _0x41f8e0=_0x58c9[_0x51488c];return _0x41f8e0;};'use strict';var _=require(_0x958c('0x0'));var util=require(_0x958c('0x1'));var moment=require(_0x958c('0x2'));var BPromise=require(_0x958c('0x3'));var rs=require(_0x958c('0x4'));var fs=require('fs');var Redis=require(_0x958c('0x5'));var db=require(_0x958c('0x6'))['db'];var utils=require(_0x958c('0x7'));var logger=require(_0x958c('0x8'))(_0x958c('0x9'));var config=require(_0x958c('0xa'));var jayson=require(_0x958c('0xb'));var client=jayson[_0x958c('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x158388,_0xa44c9,_0xf10ad3){return new BPromise(function(_0x2e37a6,_0x31e668){return client[_0x958c('0xd')](_0x158388,_0xf10ad3)[_0x958c('0xe')](function(_0x128ef6){logger[_0x958c('0xf')](_0x958c('0x10'),_0xa44c9,_0x958c('0x11'));logger['debug'](_0x958c('0x12'),_0xa44c9,_0x958c('0x11'),JSON[_0x958c('0x13')](_0x128ef6));if(_0x128ef6[_0x958c('0x14')]){if(_0x128ef6[_0x958c('0x14')][_0x958c('0x15')]===0x1f4){logger[_0x958c('0x14')]('FreshsalesAccount,\x20%s,\x20%s',_0xa44c9,_0x128ef6[_0x958c('0x14')][_0x958c('0x16')]);return _0x31e668(_0x128ef6['error'][_0x958c('0x16')]);}logger[_0x958c('0x14')]('FreshsalesAccount,\x20%s,\x20%s',_0xa44c9,_0x128ef6[_0x958c('0x14')][_0x958c('0x16')]);return _0x2e37a6(_0x128ef6['error']['message']);}else{logger[_0x958c('0xf')]('FreshsalesAccount,\x20%s,\x20%s',_0xa44c9,'request\x20sent');_0x2e37a6(_0x128ef6['result'][_0x958c('0x16')]);}})[_0x958c('0x17')](function(_0x26c739){logger[_0x958c('0x14')]('FreshsalesAccount,\x20%s,\x20%s',_0xa44c9,_0x26c739);_0x31e668(_0x26c739);});});}exports['GetFreshsalesAccount']=function(_0x59f83f){var _0x537310=this;return new Promise(function(_0x4d3eed,_0x459f72){return db[_0x958c('0x18')][_0x958c('0x19')]({'raw':_0x59f83f[_0x958c('0x1a')]?_0x59f83f['options'][_0x958c('0x1b')]===undefined?!![]:![]:!![],'where':_0x59f83f[_0x958c('0x1a')]?_0x59f83f['options'][_0x958c('0x1c')]||null:null,'attributes':_0x59f83f['options']?_0x59f83f[_0x958c('0x1a')][_0x958c('0x1d')]||null:null,'limit':_0x59f83f[_0x958c('0x1a')]?_0x59f83f[_0x958c('0x1a')]['limit']||null:null,'include':_0x59f83f['options']?_0x59f83f['options'][_0x958c('0x1e')]?_[_0x958c('0x1f')](_0x59f83f[_0x958c('0x1a')]['include'],function(_0x2ff4ce){return{'model':db[_0x2ff4ce[_0x958c('0x20')]],'as':_0x2ff4ce['as'],'attributes':_0x2ff4ce[_0x958c('0x1d')],'include':_0x2ff4ce[_0x958c('0x1e')]?_[_0x958c('0x1f')](_0x2ff4ce[_0x958c('0x1e')],function(_0xe8b7f3){return{'model':db[_0xe8b7f3['model']],'as':_0xe8b7f3['as'],'attributes':_0xe8b7f3[_0x958c('0x1d')],'include':_0xe8b7f3[_0x958c('0x1e')]?_[_0x958c('0x1f')](_0xe8b7f3['include'],function(_0x595e8b){return{'model':db[_0x595e8b[_0x958c('0x20')]],'as':_0x595e8b['as'],'attributes':_0x595e8b[_0x958c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x958c('0xe')](function(_0x23e48b){logger[_0x958c('0xf')]('GetFreshsalesAccount',_0x59f83f);logger[_0x958c('0x21')](_0x958c('0x22'),_0x59f83f,JSON[_0x958c('0x13')](_0x23e48b));_0x4d3eed(_0x23e48b);})[_0x958c('0x17')](function(_0xbdb048){logger['error']('GetFreshsalesAccount',_0xbdb048[_0x958c('0x16')],_0x59f83f);_0x459f72(_0x537310[_0x958c('0x14')](0x1f4,_0xbdb048['message']));});});};exports[_0x958c('0x23')]=function(_0x4d7edb){var _0xf4f4=this;return new Promise(function(_0x4a22bd,_0x37b62f){return db['FreshsalesAccount']['find']({'raw':_0x4d7edb[_0x958c('0x1a')]?_0x4d7edb[_0x958c('0x1a')][_0x958c('0x1b')]===undefined?!![]:![]:!![],'where':_0x4d7edb[_0x958c('0x1a')]?_0x4d7edb['options'][_0x958c('0x1c')]||null:null,'attributes':_0x4d7edb[_0x958c('0x1a')]?_0x4d7edb[_0x958c('0x1a')][_0x958c('0x1d')]||null:null,'include':_0x4d7edb[_0x958c('0x1a')]?_0x4d7edb[_0x958c('0x1a')][_0x958c('0x1e')]?_[_0x958c('0x1f')](_0x4d7edb[_0x958c('0x1a')][_0x958c('0x1e')],function(_0x2823cd){return{'model':db[_0x2823cd['model']],'as':_0x2823cd['as'],'attributes':_0x2823cd[_0x958c('0x1d')],'include':_0x2823cd[_0x958c('0x1e')]?_[_0x958c('0x1f')](_0x2823cd[_0x958c('0x1e')],function(_0x12ad51){return{'model':db[_0x12ad51[_0x958c('0x20')]],'as':_0x12ad51['as'],'attributes':_0x12ad51[_0x958c('0x1d')],'include':_0x12ad51['include']?_[_0x958c('0x1f')](_0x12ad51['include'],function(_0x20c1c3){return{'model':db[_0x20c1c3[_0x958c('0x20')]],'as':_0x20c1c3['as'],'attributes':_0x20c1c3[_0x958c('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x122190){logger['info'](_0x958c('0x23'),_0x4d7edb);logger['debug'](_0x958c('0x23'),_0x4d7edb,JSON[_0x958c('0x13')](_0x122190));_0x4a22bd(_0x122190);})[_0x958c('0x17')](function(_0x4a27e2){logger[_0x958c('0x14')](_0x958c('0x23'),_0x4a27e2[_0x958c('0x16')],_0x4d7edb);_0x37b62f(_0xf4f4['error'](0x1f4,_0x4a27e2[_0x958c('0x16')]));});});}; \ No newline at end of file +var _0x09d2=['info','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesAccount,\x20%s,\x20%s','message','result','catch','findAll','options','raw','where','attributes','limit','include','map','model','GetFreshsalesAccount','ShowFreshsalesAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x09d2,0x1d2));var _0x209d=function(_0x379926,_0x4c8831){_0x379926=_0x379926-0x0;var _0x334dc0=_0x09d2[_0x379926];return _0x334dc0;};'use strict';var _=require(_0x209d('0x0'));var util=require(_0x209d('0x1'));var moment=require(_0x209d('0x2'));var BPromise=require(_0x209d('0x3'));var rs=require(_0x209d('0x4'));var fs=require('fs');var Redis=require(_0x209d('0x5'));var db=require(_0x209d('0x6'))['db'];var utils=require(_0x209d('0x7'));var logger=require(_0x209d('0x8'))(_0x209d('0x9'));var config=require('../../config/environment');var jayson=require(_0x209d('0xa'));var client=jayson[_0x209d('0xb')][_0x209d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x204ab9,_0xc141e6,_0x5b460d){return new BPromise(function(_0x49cd7a,_0x306753){return client[_0x209d('0xd')](_0x204ab9,_0x5b460d)[_0x209d('0xe')](function(_0x48c52d){logger[_0x209d('0xf')]('FreshsalesAccount,\x20%s,\x20%s',_0xc141e6,_0x209d('0x10'));logger[_0x209d('0x11')](_0x209d('0x12'),_0xc141e6,_0x209d('0x10'),JSON[_0x209d('0x13')](_0x48c52d));if(_0x48c52d[_0x209d('0x14')]){if(_0x48c52d[_0x209d('0x14')][_0x209d('0x15')]===0x1f4){logger[_0x209d('0x14')](_0x209d('0x16'),_0xc141e6,_0x48c52d[_0x209d('0x14')][_0x209d('0x17')]);return _0x306753(_0x48c52d['error'][_0x209d('0x17')]);}logger[_0x209d('0x14')](_0x209d('0x16'),_0xc141e6,_0x48c52d['error']['message']);return _0x49cd7a(_0x48c52d[_0x209d('0x14')]['message']);}else{logger['info'](_0x209d('0x16'),_0xc141e6,_0x209d('0x10'));_0x49cd7a(_0x48c52d[_0x209d('0x18')]['message']);}})[_0x209d('0x19')](function(_0xe0721){logger[_0x209d('0x14')](_0x209d('0x16'),_0xc141e6,_0xe0721);_0x306753(_0xe0721);});});}exports['GetFreshsalesAccount']=function(_0x2cdf73){var _0x437f76=this;return new Promise(function(_0x38aa09,_0x51dd2e){return db['FreshsalesAccount'][_0x209d('0x1a')]({'raw':_0x2cdf73['options']?_0x2cdf73[_0x209d('0x1b')][_0x209d('0x1c')]===undefined?!![]:![]:!![],'where':_0x2cdf73[_0x209d('0x1b')]?_0x2cdf73[_0x209d('0x1b')][_0x209d('0x1d')]||null:null,'attributes':_0x2cdf73[_0x209d('0x1b')]?_0x2cdf73[_0x209d('0x1b')][_0x209d('0x1e')]||null:null,'limit':_0x2cdf73[_0x209d('0x1b')]?_0x2cdf73[_0x209d('0x1b')][_0x209d('0x1f')]||null:null,'include':_0x2cdf73[_0x209d('0x1b')]?_0x2cdf73[_0x209d('0x1b')][_0x209d('0x20')]?_[_0x209d('0x21')](_0x2cdf73[_0x209d('0x1b')][_0x209d('0x20')],function(_0x291105){return{'model':db[_0x291105[_0x209d('0x22')]],'as':_0x291105['as'],'attributes':_0x291105[_0x209d('0x1e')],'include':_0x291105[_0x209d('0x20')]?_['map'](_0x291105[_0x209d('0x20')],function(_0x44ef65){return{'model':db[_0x44ef65['model']],'as':_0x44ef65['as'],'attributes':_0x44ef65[_0x209d('0x1e')],'include':_0x44ef65['include']?_[_0x209d('0x21')](_0x44ef65[_0x209d('0x20')],function(_0x38a65d){return{'model':db[_0x38a65d[_0x209d('0x22')]],'as':_0x38a65d['as'],'attributes':_0x38a65d[_0x209d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x209d('0xe')](function(_0x5399e3){logger[_0x209d('0xf')](_0x209d('0x23'),_0x2cdf73);logger['debug'](_0x209d('0x23'),_0x2cdf73,JSON[_0x209d('0x13')](_0x5399e3));_0x38aa09(_0x5399e3);})[_0x209d('0x19')](function(_0x28750e){logger[_0x209d('0x14')](_0x209d('0x23'),_0x28750e['message'],_0x2cdf73);_0x51dd2e(_0x437f76['error'](0x1f4,_0x28750e[_0x209d('0x17')]));});});};exports['ShowFreshsalesAccount']=function(_0x3a69da){var _0x5d590b=this;return new Promise(function(_0x1fbdba,_0x148d1a){return db['FreshsalesAccount']['find']({'raw':_0x3a69da[_0x209d('0x1b')]?_0x3a69da[_0x209d('0x1b')][_0x209d('0x1c')]===undefined?!![]:![]:!![],'where':_0x3a69da[_0x209d('0x1b')]?_0x3a69da['options'][_0x209d('0x1d')]||null:null,'attributes':_0x3a69da[_0x209d('0x1b')]?_0x3a69da['options']['attributes']||null:null,'include':_0x3a69da[_0x209d('0x1b')]?_0x3a69da['options'][_0x209d('0x20')]?_[_0x209d('0x21')](_0x3a69da[_0x209d('0x1b')][_0x209d('0x20')],function(_0x431c62){return{'model':db[_0x431c62[_0x209d('0x22')]],'as':_0x431c62['as'],'attributes':_0x431c62[_0x209d('0x1e')],'include':_0x431c62['include']?_[_0x209d('0x21')](_0x431c62[_0x209d('0x20')],function(_0xc6318e){return{'model':db[_0xc6318e[_0x209d('0x22')]],'as':_0xc6318e['as'],'attributes':_0xc6318e[_0x209d('0x1e')],'include':_0xc6318e[_0x209d('0x20')]?_[_0x209d('0x21')](_0xc6318e[_0x209d('0x20')],function(_0x3ad4cb){return{'model':db[_0x3ad4cb[_0x209d('0x22')]],'as':_0x3ad4cb['as'],'attributes':_0x3ad4cb[_0x209d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x209d('0xe')](function(_0x12663e){logger['info'](_0x209d('0x24'),_0x3a69da);logger['debug'](_0x209d('0x24'),_0x3a69da,JSON[_0x209d('0x13')](_0x12663e));_0x1fbdba(_0x12663e);})[_0x209d('0x19')](function(_0x507c4c){logger['error'](_0x209d('0x24'),_0x507c4c[_0x209d('0x17')],_0x3a69da);_0x148d1a(_0x5d590b[_0x209d('0x14')](0x1f4,_0x507c4c[_0x209d('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 5cc8606..26d88fd 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 _0xf394=['../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','/:id','/:id/subjects','getSubjects','getDescriptions','/:id/fields','getFields','create','put','update','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x583d59,_0x22970f){var _0x36d531=function(_0x554688){while(--_0x554688){_0x583d59['push'](_0x583d59['shift']());}};_0x36d531(++_0x22970f);}(_0xf394,0xa9));var _0x4f39=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xf394[_0x465028];return _0xb783d4;};'use strict';var multer=require(_0x4f39('0x0'));var util=require(_0x4f39('0x1'));var path=require(_0x4f39('0x2'));var timeout=require(_0x4f39('0x3'));var express=require(_0x4f39('0x4'));var router=express[_0x4f39('0x5')]();var auth=require(_0x4f39('0x6'));var interaction=require(_0x4f39('0x7'));var config=require(_0x4f39('0x8'));var controller=require(_0x4f39('0x9'));router[_0x4f39('0xa')]('/',auth[_0x4f39('0xb')](),controller['index']);router[_0x4f39('0xa')](_0x4f39('0xc'),auth[_0x4f39('0xb')](),controller['show']);router[_0x4f39('0xa')](_0x4f39('0xd'),auth[_0x4f39('0xb')](),controller[_0x4f39('0xe')]);router[_0x4f39('0xa')]('/:id/descriptions',auth[_0x4f39('0xb')](),controller[_0x4f39('0xf')]);router['get'](_0x4f39('0x10'),auth[_0x4f39('0xb')](),controller[_0x4f39('0x11')]);router['post']('/',auth[_0x4f39('0xb')](),controller[_0x4f39('0x12')]);router[_0x4f39('0x13')](_0x4f39('0xc'),auth['isAuthenticated'](),controller[_0x4f39('0x14')]);router['delete'](_0x4f39('0xc'),auth[_0x4f39('0xb')](),controller[_0x4f39('0x15')]);module['exports']=router; \ No newline at end of file +var _0x9641=['show','/:id/subjects','getDescriptions','/:id/fields','post','put','update','delete','destroy','multer','util','path','Router','../../components/auth/service','../../config/environment','./intFreshsalesConfiguration.controller','isAuthenticated','index','get','/:id'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0x9641,0x6d));var _0x1964=function(_0xb83ec2,_0x18e73b){_0xb83ec2=_0xb83ec2-0x0;var _0x4d2fbf=_0x9641[_0xb83ec2];return _0x4d2fbf;};'use strict';var multer=require(_0x1964('0x0'));var util=require(_0x1964('0x1'));var path=require(_0x1964('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1964('0x3')]();var auth=require(_0x1964('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1964('0x5'));var controller=require(_0x1964('0x6'));router['get']('/',auth[_0x1964('0x7')](),controller[_0x1964('0x8')]);router[_0x1964('0x9')](_0x1964('0xa'),auth['isAuthenticated'](),controller[_0x1964('0xb')]);router[_0x1964('0x9')](_0x1964('0xc'),auth[_0x1964('0x7')](),controller['getSubjects']);router['get']('/:id/descriptions',auth['isAuthenticated'](),controller[_0x1964('0xd')]);router[_0x1964('0x9')](_0x1964('0xe'),auth[_0x1964('0x7')](),controller['getFields']);router[_0x1964('0xf')]('/',auth[_0x1964('0x7')](),controller['create']);router[_0x1964('0x10')](_0x1964('0xa'),auth[_0x1964('0x7')](),controller[_0x1964('0x11')]);router[_0x1964('0x12')](_0x1964('0xa'),auth[_0x1964('0x7')](),controller[_0x1964('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 0dddfc3..aee966b 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 _0xc412=['STRING','sequelize'];(function(_0x18776f,_0x3dd61d){var _0x3c521f=function(_0x119b67){while(--_0x119b67){_0x18776f['push'](_0x18776f['shift']());}};_0x3c521f(++_0x3dd61d);}(_0xc412,0x1a3));var _0x2c41=function(_0x5b1ed1,_0x4f96e0){_0x5b1ed1=_0x5b1ed1-0x0;var _0x3f6aa3=_0xc412[_0x5b1ed1];return _0x3f6aa3;};'use strict';var Sequelize=require(_0x2c41('0x0'));module['exports']={'name':{'type':Sequelize[_0x2c41('0x1')]},'description':{'type':Sequelize[_0x2c41('0x1')]}}; \ No newline at end of file +var _0x5910=['STRING'];(function(_0x4057a9,_0x491c6f){var _0x4c2a4b=function(_0xa034bf){while(--_0xa034bf){_0x4057a9['push'](_0x4057a9['shift']());}};_0x4c2a4b(++_0x491c6f);}(_0x5910,0x170));var _0x0591=function(_0x4b8598,_0x5ca257){_0x4b8598=_0x4b8598-0x0;var _0x27240b=_0x5910[_0x4b8598];return _0x27240b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0591('0x0')]},'description':{'type':Sequelize[_0x0591('0x0')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 00e39eb..06e74a1 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 _0x8d0a=['mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','status','json','limit','set','Content-Range','save','then','destroy','end','name','index','map','FreshsalesConfiguration','rawAttributes','type','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','params','find','catch','create','update','body','getSubjects','findOne','order','pick','getDescriptions','FreshsalesField','getFields','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird'];(function(_0x139e4c,_0x324f74){var _0x52eede=function(_0x50793c){while(--_0x50793c){_0x139e4c['push'](_0x139e4c['shift']());}};_0x52eede(++_0x324f74);}(_0x8d0a,0x172));var _0xa8d0=function(_0x477c2c,_0x1ada41){_0x477c2c=_0x477c2c-0x0;var _0x7c8050=_0x8d0a[_0x477c2c];return _0x7c8050;};'use strict';var pdf=require(_0xa8d0('0x0'));var emlformat=require(_0xa8d0('0x1'));var rimraf=require(_0xa8d0('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa8d0('0x3'));var rp=require(_0xa8d0('0x4'));var moment=require('moment');var BPromise=require(_0xa8d0('0x5'));var Mustache=require(_0xa8d0('0x6'));var util=require(_0xa8d0('0x7'));var path=require('path');var sox=require(_0xa8d0('0x8'));var csv=require(_0xa8d0('0x9'));var ejs=require(_0xa8d0('0xa'));var fs=require('fs');var _=require(_0xa8d0('0xb'));var squel=require(_0xa8d0('0xc'));var crypto=require(_0xa8d0('0xd'));var jsforce=require(_0xa8d0('0xe'));var deskjs=require(_0xa8d0('0xf'));var toCsv=require(_0xa8d0('0x9'));var querystring=require(_0xa8d0('0x10'));var Papa=require(_0xa8d0('0x11'));var Redis=require(_0xa8d0('0x12'));var authService=require(_0xa8d0('0x13'));var qs=require(_0xa8d0('0x14'));var as=require(_0xa8d0('0x15'));var hardwareService=require(_0xa8d0('0x16'));var logger=require(_0xa8d0('0x17'))(_0xa8d0('0x18'));var utils=require(_0xa8d0('0x19'));var config=require(_0xa8d0('0x1a'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0xa8d0('0x1b')][_0xa8d0('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x572d64,_0x5cd54b,_0x16093f){if(_0x16093f){var _0x2af6fc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2af6fc[_0xa8d0('0x1d')](_0x5cd54b)){return _0x572d64;}else{throw new db[(_0xa8d0('0x1e'))][(_0xa8d0('0x1f'))](_0xa8d0('0x20'));}}else{return _0x572d64;}}function respondWithRpcPromise(_0x192b0a,_0x1daf70,_0x2871cb,_0x238e85){return new BPromise(function(_0xfa19ee,_0x575f69){var _0x728809=_0x238e85||client;return _0x728809[_0xa8d0('0x21')](_0x192b0a,_0x2871cb)['then'](function(_0x3e1dc6){logger[_0xa8d0('0x22')](_0xa8d0('0x23'),_0x1daf70,_0xa8d0('0x24'));logger[_0xa8d0('0x25')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x1daf70,_0xa8d0('0x24'),JSON[_0xa8d0('0x26')](_0x3e1dc6));if(_0x3e1dc6[_0xa8d0('0x27')]){if(_0x3e1dc6[_0xa8d0('0x27')][_0xa8d0('0x28')]===0x1f4){logger[_0xa8d0('0x27')](_0xa8d0('0x23'),_0x1daf70,_0x3e1dc6['error'][_0xa8d0('0x29')]);return _0x575f69(_0x3e1dc6[_0xa8d0('0x27')][_0xa8d0('0x29')]);}logger[_0xa8d0('0x27')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x1daf70,_0x3e1dc6[_0xa8d0('0x27')][_0xa8d0('0x29')]);return _0xfa19ee(_0x3e1dc6[_0xa8d0('0x27')][_0xa8d0('0x29')]);}else{logger['info'](_0xa8d0('0x23'),_0x1daf70,_0xa8d0('0x24'));_0xfa19ee(_0x3e1dc6[_0xa8d0('0x2a')][_0xa8d0('0x29')]);}})['catch'](function(_0x35b4a6){logger[_0xa8d0('0x27')](_0xa8d0('0x23'),_0x1daf70,_0x35b4a6);_0x575f69(_0x35b4a6);});});}function respondWithStatusCode(_0x507d18,_0x34c0bf){_0x34c0bf=_0x34c0bf||0xcc;return function(_0x5f5dfb){if(_0x5f5dfb){return _0x507d18[_0xa8d0('0x2b')](_0x34c0bf);}return _0x507d18[_0xa8d0('0x2c')](_0x34c0bf)['end']();};}function respondWithResult(_0x5d7292,_0x216045){_0x216045=_0x216045||0xc8;return function(_0x5d9a04){if(_0x5d9a04){return _0x5d7292[_0xa8d0('0x2c')](_0x216045)[_0xa8d0('0x2d')](_0x5d9a04);}};}function respondWithFilteredResult(_0x3cc8fd,_0x460fae){return function(_0x3ceaa9){if(_0x3ceaa9){var _0x5a5079=_0x3ceaa9['count'],_0x221c6e=_0x460fae['offset'],_0x356892=_0x460fae['offset']+_0x460fae[_0xa8d0('0x2e')],_0x13de71;if(_0x356892>=_0x5a5079){_0x356892=_0x5a5079;_0x13de71=0xc8;}else{_0x13de71=0xce;}_0x3cc8fd[_0xa8d0('0x2c')](_0x13de71);return _0x3cc8fd[_0xa8d0('0x2f')](_0xa8d0('0x30'),_0x221c6e+'-'+_0x356892+'/'+_0x5a5079)[_0xa8d0('0x2d')](_0x3ceaa9);}return null;};}function patchUpdates(_0x3bc7b5){return function(_0x3f6fb9){try{jsonpatch['apply'](_0x3f6fb9,_0x3bc7b5,!![]);}catch(_0x1fa36f){return BPromise['reject'](_0x1fa36f);}return _0x3f6fb9[_0xa8d0('0x31')]();};}function saveUpdates(_0x538e51,_0x4ea42b){return function(_0x54bc61){if(_0x54bc61){return _0x54bc61['update'](_0x538e51)[_0xa8d0('0x32')](function(_0x25b7b1){return _0x25b7b1;});}return null;};}function removeEntity(_0x5e2334,_0x576534){return function(_0x2b4897){if(_0x2b4897){return _0x2b4897[_0xa8d0('0x33')]()[_0xa8d0('0x32')](function(){_0x5e2334[_0xa8d0('0x2c')](0xcc)[_0xa8d0('0x34')]();});}};}function handleEntityNotFound(_0x4d7f6d,_0x491efc){return function(_0x128a0c){if(!_0x128a0c){_0x4d7f6d[_0xa8d0('0x2b')](0x194);}return _0x128a0c;};}function handleError(_0x431d49,_0x43c9f0){_0x43c9f0=_0x43c9f0||0x1f4;return function(_0x40ccb6){logger[_0xa8d0('0x27')](_0x40ccb6['stack']);if(_0x40ccb6[_0xa8d0('0x35')]){delete _0x40ccb6[_0xa8d0('0x35')];}_0x431d49[_0xa8d0('0x2c')](_0x43c9f0)['send'](_0x40ccb6);};}exports[_0xa8d0('0x36')]=function(_0x29eb82,_0x285f08){var _0x424a1d={},_0x2a6359={},_0x5b79f8={'count':0x0,'rows':[]};var _0x133d39=_[_0xa8d0('0x37')](db[_0xa8d0('0x38')][_0xa8d0('0x39')],function(_0x3563a9){return{'name':_0x3563a9['fieldName'],'type':_0x3563a9[_0xa8d0('0x3a')]['key']};});_0x2a6359[_0xa8d0('0x3b')]=_[_0xa8d0('0x37')](_0x133d39,_0xa8d0('0x35'));_0x2a6359['query']=_[_0xa8d0('0x3c')](_0x29eb82[_0xa8d0('0x3d')]);_0x2a6359[_0xa8d0('0x3e')]=_['intersection'](_0x2a6359[_0xa8d0('0x3b')],_0x2a6359[_0xa8d0('0x3d')]);_0x424a1d[_0xa8d0('0x3f')]=_[_0xa8d0('0x40')](_0x2a6359[_0xa8d0('0x3b')],qs[_0xa8d0('0x41')](_0x29eb82[_0xa8d0('0x3d')][_0xa8d0('0x41')]));_0x424a1d[_0xa8d0('0x3f')]=_0x424a1d['attributes'][_0xa8d0('0x42')]?_0x424a1d[_0xa8d0('0x3f')]:_0x2a6359[_0xa8d0('0x3b')];if(!_0x29eb82[_0xa8d0('0x3d')][_0xa8d0('0x43')](_0xa8d0('0x44'))){_0x424a1d[_0xa8d0('0x2e')]=qs[_0xa8d0('0x2e')](_0x29eb82[_0xa8d0('0x3d')]['limit']);_0x424a1d[_0xa8d0('0x45')]=qs['offset'](_0x29eb82[_0xa8d0('0x3d')][_0xa8d0('0x45')]);}_0x424a1d['order']=qs[_0xa8d0('0x46')](_0x29eb82['query'][_0xa8d0('0x46')]);_0x424a1d[_0xa8d0('0x47')]=qs[_0xa8d0('0x3e')](_['pick'](_0x29eb82['query'],_0x2a6359[_0xa8d0('0x3e')]));if(_0x29eb82[_0xa8d0('0x3d')][_0xa8d0('0x48')]){_0x424a1d[_0xa8d0('0x47')]=_[_0xa8d0('0x49')](_0x424a1d[_0xa8d0('0x47')],{'$or':_[_0xa8d0('0x37')](_0x133d39,function(_0x309503){if(_0x309503['type']!==_0xa8d0('0x4a')){var _0x593206={};_0x593206[_0x309503[_0xa8d0('0x35')]]={'$like':'%'+_0x29eb82['query'][_0xa8d0('0x48')]+'%'};return _0x593206;}})});}_0x424a1d=_[_0xa8d0('0x49')]({},_0x424a1d,_0x29eb82[_0xa8d0('0x4b')]);var _0x58d820={'where':_0x424a1d[_0xa8d0('0x47')]};return db[_0xa8d0('0x38')][_0xa8d0('0x4c')](_0x58d820)[_0xa8d0('0x32')](function(_0x86c7ef){_0x5b79f8[_0xa8d0('0x4c')]=_0x86c7ef;if(_0x29eb82[_0xa8d0('0x3d')][_0xa8d0('0x4d')]){_0x424a1d[_0xa8d0('0x4e')]=[{'all':!![]}];}return db[_0xa8d0('0x38')][_0xa8d0('0x4f')](_0x424a1d);})[_0xa8d0('0x32')](function(_0x2a0e19){_0x5b79f8[_0xa8d0('0x50')]=_0x2a0e19;return _0x5b79f8;})[_0xa8d0('0x32')](respondWithFilteredResult(_0x285f08,_0x424a1d))['catch'](handleError(_0x285f08,null));};exports['show']=function(_0x2e12d8,_0x15f801){var _0x3ddebe={'raw':![],'where':{'id':_0x2e12d8[_0xa8d0('0x51')]['id']}},_0x200d6a={};_0x200d6a[_0xa8d0('0x3b')]=_[_0xa8d0('0x3c')](db[_0xa8d0('0x38')][_0xa8d0('0x39')]);_0x200d6a[_0xa8d0('0x3d')]=_[_0xa8d0('0x3c')](_0x2e12d8[_0xa8d0('0x3d')]);_0x200d6a[_0xa8d0('0x3e')]=_['intersection'](_0x200d6a[_0xa8d0('0x3b')],_0x200d6a[_0xa8d0('0x3d')]);_0x3ddebe[_0xa8d0('0x3f')]=_['intersection'](_0x200d6a[_0xa8d0('0x3b')],qs[_0xa8d0('0x41')](_0x2e12d8[_0xa8d0('0x3d')][_0xa8d0('0x41')]));_0x3ddebe[_0xa8d0('0x3f')]=_0x3ddebe['attributes']['length']?_0x3ddebe[_0xa8d0('0x3f')]:_0x200d6a[_0xa8d0('0x3b')];if(_0x2e12d8[_0xa8d0('0x3d')][_0xa8d0('0x4d')]){_0x3ddebe[_0xa8d0('0x4e')]=[{'all':!![]}];}_0x3ddebe=_[_0xa8d0('0x49')]({},_0x3ddebe,_0x2e12d8[_0xa8d0('0x4b')]);return db[_0xa8d0('0x38')][_0xa8d0('0x52')](_0x3ddebe)['then'](handleEntityNotFound(_0x15f801,null))[_0xa8d0('0x32')](respondWithResult(_0x15f801,null))[_0xa8d0('0x53')](handleError(_0x15f801,null));};exports[_0xa8d0('0x54')]=function(_0x2380fb,_0x3498d7){return db['FreshsalesConfiguration'][_0xa8d0('0x54')](_0x2380fb['body'],{})[_0xa8d0('0x32')](respondWithResult(_0x3498d7,0xc9))['catch'](handleError(_0x3498d7,null));};exports[_0xa8d0('0x55')]=function(_0x4d2a2b,_0x50fa13){if(_0x4d2a2b[_0xa8d0('0x56')]['id']){delete _0x4d2a2b[_0xa8d0('0x56')]['id'];}return db[_0xa8d0('0x38')]['find']({'where':{'id':_0x4d2a2b[_0xa8d0('0x51')]['id']}})['then'](handleEntityNotFound(_0x50fa13,null))['then'](saveUpdates(_0x4d2a2b[_0xa8d0('0x56')],null))[_0xa8d0('0x32')](respondWithResult(_0x50fa13,null))[_0xa8d0('0x53')](handleError(_0x50fa13,null));};exports['destroy']=function(_0x53bf51,_0xf815b){return db[_0xa8d0('0x38')][_0xa8d0('0x52')]({'where':{'id':_0x53bf51['params']['id']}})[_0xa8d0('0x32')](handleEntityNotFound(_0xf815b,null))['then'](removeEntity(_0xf815b,null))[_0xa8d0('0x53')](handleError(_0xf815b,null));};exports[_0xa8d0('0x57')]=function(_0xcc4cdb,_0x514579,_0x2b9a12){var _0x21af6f={};var _0x433afa={};var _0x4ffaec;var _0x5ec84a;return db[_0xa8d0('0x38')][_0xa8d0('0x58')]({'where':{'id':_0xcc4cdb['params']['id']}})['then'](handleEntityNotFound(_0x514579,null))[_0xa8d0('0x32')](function(_0x12d984){if(_0x12d984){_0x4ffaec=_0x12d984;_0x433afa[_0xa8d0('0x3b')]=_['keys'](db['FreshsalesField'][_0xa8d0('0x39')]);_0x433afa['query']=_[_0xa8d0('0x3c')](_0xcc4cdb[_0xa8d0('0x3d')]);_0x433afa['filters']=_['intersection'](_0x433afa['model'],_0x433afa[_0xa8d0('0x3d')]);_0x21af6f['attributes']=_[_0xa8d0('0x40')](_0x433afa[_0xa8d0('0x3b')],qs[_0xa8d0('0x41')](_0xcc4cdb['query']['fields']));_0x21af6f['attributes']=_0x21af6f[_0xa8d0('0x3f')][_0xa8d0('0x42')]?_0x21af6f[_0xa8d0('0x3f')]:_0x433afa[_0xa8d0('0x3b')];_0x21af6f[_0xa8d0('0x59')]=qs['sort'](_0xcc4cdb[_0xa8d0('0x3d')]['sort']);_0x21af6f[_0xa8d0('0x47')]=qs['filters'](_[_0xa8d0('0x5a')](_0xcc4cdb['query'],_0x433afa[_0xa8d0('0x3e')]));if(_0xcc4cdb[_0xa8d0('0x3d')][_0xa8d0('0x48')]){_0x21af6f[_0xa8d0('0x47')]=_['merge'](_0x21af6f[_0xa8d0('0x47')],{'$or':_[_0xa8d0('0x37')](_0x21af6f['attributes'],function(_0x405702){var _0x3f7b48={};_0x3f7b48[_0x405702]={'$like':'%'+_0xcc4cdb['query'][_0xa8d0('0x48')]+'%'};return _0x3f7b48;})});}_0x21af6f=_[_0xa8d0('0x49')]({},_0x21af6f,_0xcc4cdb[_0xa8d0('0x4b')]);return _0x4ffaec[_0xa8d0('0x57')](_0x21af6f);}})['then'](function(_0x4d710d){if(_0x4d710d){_0x5ec84a=_0x4d710d[_0xa8d0('0x42')];if(!_0xcc4cdb[_0xa8d0('0x3d')][_0xa8d0('0x43')](_0xa8d0('0x44'))){_0x21af6f[_0xa8d0('0x2e')]=qs['limit'](_0xcc4cdb[_0xa8d0('0x3d')][_0xa8d0('0x2e')]);_0x21af6f[_0xa8d0('0x45')]=qs[_0xa8d0('0x45')](_0xcc4cdb[_0xa8d0('0x3d')][_0xa8d0('0x45')]);}return _0x4ffaec['getSubjects'](_0x21af6f);}})[_0xa8d0('0x32')](function(_0x138a0f){if(_0x138a0f){return _0x138a0f?{'count':_0x5ec84a,'rows':_0x138a0f}:null;}})[_0xa8d0('0x32')](respondWithResult(_0x514579,null))['catch'](handleError(_0x514579,null));};exports[_0xa8d0('0x5b')]=function(_0xa155eb,_0x1cc40f,_0x58da3b){var _0x59ff35={};var _0x39bf45={};var _0x2f005d;var _0x5dc214;return db[_0xa8d0('0x38')]['findOne']({'where':{'id':_0xa155eb['params']['id']}})['then'](handleEntityNotFound(_0x1cc40f,null))[_0xa8d0('0x32')](function(_0x3e2e94){if(_0x3e2e94){_0x2f005d=_0x3e2e94;_0x39bf45[_0xa8d0('0x3b')]=_['keys'](db[_0xa8d0('0x5c')][_0xa8d0('0x39')]);_0x39bf45[_0xa8d0('0x3d')]=_[_0xa8d0('0x3c')](_0xa155eb[_0xa8d0('0x3d')]);_0x39bf45[_0xa8d0('0x3e')]=_['intersection'](_0x39bf45[_0xa8d0('0x3b')],_0x39bf45[_0xa8d0('0x3d')]);_0x59ff35[_0xa8d0('0x3f')]=_[_0xa8d0('0x40')](_0x39bf45[_0xa8d0('0x3b')],qs[_0xa8d0('0x41')](_0xa155eb[_0xa8d0('0x3d')][_0xa8d0('0x41')]));_0x59ff35[_0xa8d0('0x3f')]=_0x59ff35[_0xa8d0('0x3f')]['length']?_0x59ff35[_0xa8d0('0x3f')]:_0x39bf45['model'];_0x59ff35[_0xa8d0('0x59')]=qs['sort'](_0xa155eb[_0xa8d0('0x3d')][_0xa8d0('0x46')]);_0x59ff35[_0xa8d0('0x47')]=qs[_0xa8d0('0x3e')](_[_0xa8d0('0x5a')](_0xa155eb[_0xa8d0('0x3d')],_0x39bf45[_0xa8d0('0x3e')]));if(_0xa155eb[_0xa8d0('0x3d')][_0xa8d0('0x48')]){_0x59ff35[_0xa8d0('0x47')]=_['merge'](_0x59ff35[_0xa8d0('0x47')],{'$or':_[_0xa8d0('0x37')](_0x59ff35[_0xa8d0('0x3f')],function(_0x3a1bcf){var _0x49df31={};_0x49df31[_0x3a1bcf]={'$like':'%'+_0xa155eb[_0xa8d0('0x3d')][_0xa8d0('0x48')]+'%'};return _0x49df31;})});}_0x59ff35=_[_0xa8d0('0x49')]({},_0x59ff35,_0xa155eb[_0xa8d0('0x4b')]);return _0x2f005d[_0xa8d0('0x5b')](_0x59ff35);}})['then'](function(_0x394306){if(_0x394306){_0x5dc214=_0x394306[_0xa8d0('0x42')];if(!_0xa155eb[_0xa8d0('0x3d')][_0xa8d0('0x43')](_0xa8d0('0x44'))){_0x59ff35[_0xa8d0('0x2e')]=qs[_0xa8d0('0x2e')](_0xa155eb['query'][_0xa8d0('0x2e')]);_0x59ff35['offset']=qs['offset'](_0xa155eb[_0xa8d0('0x3d')][_0xa8d0('0x45')]);}return _0x2f005d[_0xa8d0('0x5b')](_0x59ff35);}})['then'](function(_0xe27834){if(_0xe27834){return _0xe27834?{'count':_0x5dc214,'rows':_0xe27834}:null;}})[_0xa8d0('0x32')](respondWithResult(_0x1cc40f,null))['catch'](handleError(_0x1cc40f,null));};exports[_0xa8d0('0x5d')]=function(_0x11104b,_0x527d20,_0x26ab4c){var _0x2886c4={};var _0x2a55bf={};var _0x12ff4a;var _0x5b0b4e;return db[_0xa8d0('0x38')][_0xa8d0('0x58')]({'where':{'id':_0x11104b[_0xa8d0('0x51')]['id']}})[_0xa8d0('0x32')](handleEntityNotFound(_0x527d20,null))[_0xa8d0('0x32')](function(_0x233303){if(_0x233303){_0x12ff4a=_0x233303;_0x2a55bf['model']=_[_0xa8d0('0x3c')](db[_0xa8d0('0x5c')][_0xa8d0('0x39')]);_0x2a55bf[_0xa8d0('0x3d')]=_[_0xa8d0('0x3c')](_0x11104b['query']);_0x2a55bf[_0xa8d0('0x3e')]=_['intersection'](_0x2a55bf[_0xa8d0('0x3b')],_0x2a55bf[_0xa8d0('0x3d')]);_0x2886c4[_0xa8d0('0x3f')]=_[_0xa8d0('0x40')](_0x2a55bf['model'],qs[_0xa8d0('0x41')](_0x11104b[_0xa8d0('0x3d')]['fields']));_0x2886c4['attributes']=_0x2886c4['attributes'][_0xa8d0('0x42')]?_0x2886c4[_0xa8d0('0x3f')]:_0x2a55bf[_0xa8d0('0x3b')];_0x2886c4[_0xa8d0('0x59')]=qs[_0xa8d0('0x46')](_0x11104b[_0xa8d0('0x3d')][_0xa8d0('0x46')]);_0x2886c4['where']=qs[_0xa8d0('0x3e')](_[_0xa8d0('0x5a')](_0x11104b[_0xa8d0('0x3d')],_0x2a55bf['filters']));if(_0x11104b['query'][_0xa8d0('0x48')]){_0x2886c4['where']=_[_0xa8d0('0x49')](_0x2886c4[_0xa8d0('0x47')],{'$or':_['map'](_0x2886c4['attributes'],function(_0x31e73e){var _0x35a5c1={};_0x35a5c1[_0x31e73e]={'$like':'%'+_0x11104b[_0xa8d0('0x3d')][_0xa8d0('0x48')]+'%'};return _0x35a5c1;})});}_0x2886c4=_[_0xa8d0('0x49')]({},_0x2886c4,_0x11104b[_0xa8d0('0x4b')]);return _0x12ff4a[_0xa8d0('0x5d')](_0x2886c4);}})[_0xa8d0('0x32')](function(_0x30a66d){if(_0x30a66d){_0x5b0b4e=_0x30a66d[_0xa8d0('0x42')];if(!_0x11104b[_0xa8d0('0x3d')][_0xa8d0('0x43')](_0xa8d0('0x44'))){_0x2886c4[_0xa8d0('0x2e')]=qs['limit'](_0x11104b[_0xa8d0('0x3d')]['limit']);_0x2886c4[_0xa8d0('0x45')]=qs[_0xa8d0('0x45')](_0x11104b[_0xa8d0('0x3d')][_0xa8d0('0x45')]);}return _0x12ff4a[_0xa8d0('0x5d')](_0x2886c4);}})[_0xa8d0('0x32')](function(_0x1a9771){if(_0x1a9771){return _0x1a9771?{'count':_0x5b0b4e,'rows':_0x1a9771}:null;}})[_0xa8d0('0x32')](respondWithResult(_0x527d20,null))[_0xa8d0('0x53')](handleError(_0x527d20,null));}; \ No newline at end of file +var _0x5183=['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~!@#$%^&-_=+[{]}.','request','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','then','destroy','stack','name','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','show','body','update','find','params','getSubjects','findOne','FreshsalesField','getDescriptions','order','getFields','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client'];(function(_0x48f934,_0x37ffdb){var _0x34a02c=function(_0x54d91c){while(--_0x54d91c){_0x48f934['push'](_0x48f934['shift']());}};_0x34a02c(++_0x37ffdb);}(_0x5183,0x13e));var _0x3518=function(_0x2c9491,_0x44afb2){_0x2c9491=_0x2c9491-0x0;var _0x1aa6ab=_0x5183[_0x2c9491];return _0x1aa6ab;};'use strict';var pdf=require(_0x3518('0x0'));var emlformat=require(_0x3518('0x1'));var rimraf=require(_0x3518('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3518('0x3'));var moment=require(_0x3518('0x4'));var BPromise=require(_0x3518('0x5'));var Mustache=require(_0x3518('0x6'));var util=require('util');var path=require('path');var sox=require(_0x3518('0x7'));var csv=require(_0x3518('0x8'));var ejs=require(_0x3518('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3518('0xa'));var deskjs=require(_0x3518('0xb'));var toCsv=require(_0x3518('0x8'));var querystring=require('querystring');var Papa=require(_0x3518('0xc'));var Redis=require('ioredis');var authService=require(_0x3518('0xd'));var qs=require(_0x3518('0xe'));var as=require(_0x3518('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3518('0x10'))(_0x3518('0x11'));var utils=require('../../config/utils');var config=require(_0x3518('0x12'));var db=require(_0x3518('0x13'))['db'];var jayson=require(_0x3518('0x14'));var client=jayson[_0x3518('0x15')]['http']({'port':0x232a});function checkPasswordPattern(_0x4ec528,_0x7f5c5a,_0x44db57){if(_0x44db57){var _0x1fee8a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1fee8a['test'](_0x7f5c5a)){return _0x4ec528;}else{throw new db['Sequelize'][(_0x3518('0x16'))](_0x3518('0x17'));}}else{return _0x4ec528;}}function respondWithRpcPromise(_0x7afb31,_0x488364,_0xcd8688,_0x4ed175){return new BPromise(function(_0x1faa77,_0x30a74d){var _0x58fbb0=_0x4ed175||client;return _0x58fbb0[_0x3518('0x18')](_0x7afb31,_0xcd8688)['then'](function(_0xd24f36){logger['info'](_0x3518('0x19'),_0x488364,_0x3518('0x1a'));logger['debug'](_0x3518('0x1b'),_0x488364,_0x3518('0x1a'),JSON[_0x3518('0x1c')](_0xd24f36));if(_0xd24f36[_0x3518('0x1d')]){if(_0xd24f36[_0x3518('0x1d')]['code']===0x1f4){logger[_0x3518('0x1d')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x488364,_0xd24f36[_0x3518('0x1d')][_0x3518('0x1e')]);return _0x30a74d(_0xd24f36[_0x3518('0x1d')]['message']);}logger[_0x3518('0x1d')](_0x3518('0x19'),_0x488364,_0xd24f36[_0x3518('0x1d')][_0x3518('0x1e')]);return _0x1faa77(_0xd24f36[_0x3518('0x1d')]['message']);}else{logger[_0x3518('0x1f')](_0x3518('0x19'),_0x488364,_0x3518('0x1a'));_0x1faa77(_0xd24f36[_0x3518('0x20')][_0x3518('0x1e')]);}})[_0x3518('0x21')](function(_0x15e6bd){logger[_0x3518('0x1d')](_0x3518('0x19'),_0x488364,_0x15e6bd);_0x30a74d(_0x15e6bd);});});}function respondWithStatusCode(_0x440920,_0x19577c){_0x19577c=_0x19577c||0xcc;return function(_0x369a36){if(_0x369a36){return _0x440920[_0x3518('0x22')](_0x19577c);}return _0x440920[_0x3518('0x23')](_0x19577c)[_0x3518('0x24')]();};}function respondWithResult(_0x428b25,_0xc3cab2){_0xc3cab2=_0xc3cab2||0xc8;return function(_0x30ebce){if(_0x30ebce){return _0x428b25[_0x3518('0x23')](_0xc3cab2)[_0x3518('0x25')](_0x30ebce);}};}function respondWithFilteredResult(_0x34a6d6,_0x123230){return function(_0x41e02b){if(_0x41e02b){var _0x369d58=_0x41e02b[_0x3518('0x26')],_0x4cfaa7=_0x123230['offset'],_0x5009e3=_0x123230[_0x3518('0x27')]+_0x123230[_0x3518('0x28')],_0x3f8b72;if(_0x5009e3>=_0x369d58){_0x5009e3=_0x369d58;_0x3f8b72=0xc8;}else{_0x3f8b72=0xce;}_0x34a6d6['status'](_0x3f8b72);return _0x34a6d6[_0x3518('0x29')]('Content-Range',_0x4cfaa7+'-'+_0x5009e3+'/'+_0x369d58)[_0x3518('0x25')](_0x41e02b);}return null;};}function patchUpdates(_0x550c64){return function(_0x6f3e96){try{jsonpatch[_0x3518('0x2a')](_0x6f3e96,_0x550c64,!![]);}catch(_0x24ff1a){return BPromise[_0x3518('0x2b')](_0x24ff1a);}return _0x6f3e96[_0x3518('0x2c')]();};}function saveUpdates(_0x3e7d29,_0x47dd60){return function(_0x3088a9){if(_0x3088a9){return _0x3088a9['update'](_0x3e7d29)[_0x3518('0x2d')](function(_0x1a6ebe){return _0x1a6ebe;});}return null;};}function removeEntity(_0x313be1,_0x69275b){return function(_0x1379e8){if(_0x1379e8){return _0x1379e8[_0x3518('0x2e')]()[_0x3518('0x2d')](function(){_0x313be1[_0x3518('0x23')](0xcc)[_0x3518('0x24')]();});}};}function handleEntityNotFound(_0x12cf0a,_0x16e28b){return function(_0x34a806){if(!_0x34a806){_0x12cf0a[_0x3518('0x22')](0x194);}return _0x34a806;};}function handleError(_0x4e2a20,_0x43b574){_0x43b574=_0x43b574||0x1f4;return function(_0x2c29d0){logger[_0x3518('0x1d')](_0x2c29d0[_0x3518('0x2f')]);if(_0x2c29d0[_0x3518('0x30')]){delete _0x2c29d0[_0x3518('0x30')];}_0x4e2a20[_0x3518('0x23')](_0x43b574)['send'](_0x2c29d0);};}exports[_0x3518('0x31')]=function(_0x202328,_0x23260a){var _0x1eb308={},_0x54bab9={},_0x4cfa8c={'count':0x0,'rows':[]};var _0x391f1b=_[_0x3518('0x32')](db[_0x3518('0x33')][_0x3518('0x34')],function(_0x5b76a5){return{'name':_0x5b76a5[_0x3518('0x35')],'type':_0x5b76a5[_0x3518('0x36')][_0x3518('0x37')]};});_0x54bab9[_0x3518('0x38')]=_[_0x3518('0x32')](_0x391f1b,'name');_0x54bab9[_0x3518('0x39')]=_[_0x3518('0x3a')](_0x202328[_0x3518('0x39')]);_0x54bab9[_0x3518('0x3b')]=_[_0x3518('0x3c')](_0x54bab9[_0x3518('0x38')],_0x54bab9[_0x3518('0x39')]);_0x1eb308[_0x3518('0x3d')]=_[_0x3518('0x3c')](_0x54bab9['model'],qs[_0x3518('0x3e')](_0x202328[_0x3518('0x39')][_0x3518('0x3e')]));_0x1eb308['attributes']=_0x1eb308[_0x3518('0x3d')][_0x3518('0x3f')]?_0x1eb308['attributes']:_0x54bab9['model'];if(!_0x202328[_0x3518('0x39')][_0x3518('0x40')](_0x3518('0x41'))){_0x1eb308[_0x3518('0x28')]=qs[_0x3518('0x28')](_0x202328[_0x3518('0x39')]['limit']);_0x1eb308[_0x3518('0x27')]=qs[_0x3518('0x27')](_0x202328[_0x3518('0x39')][_0x3518('0x27')]);}_0x1eb308['order']=qs[_0x3518('0x42')](_0x202328[_0x3518('0x39')][_0x3518('0x42')]);_0x1eb308[_0x3518('0x43')]=qs[_0x3518('0x3b')](_[_0x3518('0x44')](_0x202328[_0x3518('0x39')],_0x54bab9[_0x3518('0x3b')]));if(_0x202328[_0x3518('0x39')][_0x3518('0x45')]){_0x1eb308[_0x3518('0x43')]=_[_0x3518('0x46')](_0x1eb308['where'],{'$or':_['map'](_0x391f1b,function(_0x13a76b){if(_0x13a76b['type']!=='VIRTUAL'){var _0x540297={};_0x540297[_0x13a76b[_0x3518('0x30')]]={'$like':'%'+_0x202328[_0x3518('0x39')][_0x3518('0x45')]+'%'};return _0x540297;}})});}_0x1eb308=_[_0x3518('0x46')]({},_0x1eb308,_0x202328[_0x3518('0x47')]);var _0x5ecf23={'where':_0x1eb308[_0x3518('0x43')]};return db['FreshsalesConfiguration'][_0x3518('0x26')](_0x5ecf23)[_0x3518('0x2d')](function(_0x5681e6){_0x4cfa8c['count']=_0x5681e6;if(_0x202328[_0x3518('0x39')][_0x3518('0x48')]){_0x1eb308[_0x3518('0x49')]=[{'all':!![]}];}return db[_0x3518('0x33')]['findAll'](_0x1eb308);})[_0x3518('0x2d')](function(_0x2b7d33){_0x4cfa8c['rows']=_0x2b7d33;return _0x4cfa8c;})[_0x3518('0x2d')](respondWithFilteredResult(_0x23260a,_0x1eb308))['catch'](handleError(_0x23260a,null));};exports[_0x3518('0x4a')]=function(_0x3e8236,_0x5efb90){var _0x1c2506={'raw':![],'where':{'id':_0x3e8236['params']['id']}},_0x3a619e={};_0x3a619e['model']=_[_0x3518('0x3a')](db[_0x3518('0x33')][_0x3518('0x34')]);_0x3a619e[_0x3518('0x39')]=_['keys'](_0x3e8236[_0x3518('0x39')]);_0x3a619e[_0x3518('0x3b')]=_[_0x3518('0x3c')](_0x3a619e[_0x3518('0x38')],_0x3a619e[_0x3518('0x39')]);_0x1c2506[_0x3518('0x3d')]=_[_0x3518('0x3c')](_0x3a619e['model'],qs[_0x3518('0x3e')](_0x3e8236[_0x3518('0x39')]['fields']));_0x1c2506[_0x3518('0x3d')]=_0x1c2506[_0x3518('0x3d')][_0x3518('0x3f')]?_0x1c2506['attributes']:_0x3a619e[_0x3518('0x38')];if(_0x3e8236[_0x3518('0x39')]['includeAll']){_0x1c2506['include']=[{'all':!![]}];}_0x1c2506=_[_0x3518('0x46')]({},_0x1c2506,_0x3e8236['options']);return db[_0x3518('0x33')]['find'](_0x1c2506)[_0x3518('0x2d')](handleEntityNotFound(_0x5efb90,null))[_0x3518('0x2d')](respondWithResult(_0x5efb90,null))[_0x3518('0x21')](handleError(_0x5efb90,null));};exports['create']=function(_0x23dfc1,_0x54696e){return db[_0x3518('0x33')]['create'](_0x23dfc1[_0x3518('0x4b')],{})['then'](respondWithResult(_0x54696e,0xc9))[_0x3518('0x21')](handleError(_0x54696e,null));};exports[_0x3518('0x4c')]=function(_0x4033f6,_0x666f18){if(_0x4033f6[_0x3518('0x4b')]['id']){delete _0x4033f6[_0x3518('0x4b')]['id'];}return db[_0x3518('0x33')][_0x3518('0x4d')]({'where':{'id':_0x4033f6[_0x3518('0x4e')]['id']}})[_0x3518('0x2d')](handleEntityNotFound(_0x666f18,null))[_0x3518('0x2d')](saveUpdates(_0x4033f6[_0x3518('0x4b')],null))[_0x3518('0x2d')](respondWithResult(_0x666f18,null))[_0x3518('0x21')](handleError(_0x666f18,null));};exports[_0x3518('0x2e')]=function(_0x48ffe3,_0x1ffbfe){return db['FreshsalesConfiguration'][_0x3518('0x4d')]({'where':{'id':_0x48ffe3[_0x3518('0x4e')]['id']}})[_0x3518('0x2d')](handleEntityNotFound(_0x1ffbfe,null))[_0x3518('0x2d')](removeEntity(_0x1ffbfe,null))[_0x3518('0x21')](handleError(_0x1ffbfe,null));};exports[_0x3518('0x4f')]=function(_0x4bf2af,_0x40b3cf,_0x1e0c08){var _0x3befa1={};var _0x1c137e={};var _0x5a39be;var _0x994b33;return db['FreshsalesConfiguration'][_0x3518('0x50')]({'where':{'id':_0x4bf2af[_0x3518('0x4e')]['id']}})[_0x3518('0x2d')](handleEntityNotFound(_0x40b3cf,null))[_0x3518('0x2d')](function(_0x2f8b3d){if(_0x2f8b3d){_0x5a39be=_0x2f8b3d;_0x1c137e[_0x3518('0x38')]=_[_0x3518('0x3a')](db[_0x3518('0x51')][_0x3518('0x34')]);_0x1c137e['query']=_['keys'](_0x4bf2af[_0x3518('0x39')]);_0x1c137e[_0x3518('0x3b')]=_[_0x3518('0x3c')](_0x1c137e[_0x3518('0x38')],_0x1c137e[_0x3518('0x39')]);_0x3befa1[_0x3518('0x3d')]=_[_0x3518('0x3c')](_0x1c137e[_0x3518('0x38')],qs[_0x3518('0x3e')](_0x4bf2af['query'][_0x3518('0x3e')]));_0x3befa1[_0x3518('0x3d')]=_0x3befa1[_0x3518('0x3d')][_0x3518('0x3f')]?_0x3befa1[_0x3518('0x3d')]:_0x1c137e[_0x3518('0x38')];_0x3befa1['order']=qs[_0x3518('0x42')](_0x4bf2af['query'][_0x3518('0x42')]);_0x3befa1[_0x3518('0x43')]=qs[_0x3518('0x3b')](_[_0x3518('0x44')](_0x4bf2af['query'],_0x1c137e[_0x3518('0x3b')]));if(_0x4bf2af['query']['filter']){_0x3befa1[_0x3518('0x43')]=_[_0x3518('0x46')](_0x3befa1[_0x3518('0x43')],{'$or':_[_0x3518('0x32')](_0x3befa1[_0x3518('0x3d')],function(_0x589d59){var _0x74145e={};_0x74145e[_0x589d59]={'$like':'%'+_0x4bf2af[_0x3518('0x39')][_0x3518('0x45')]+'%'};return _0x74145e;})});}_0x3befa1=_[_0x3518('0x46')]({},_0x3befa1,_0x4bf2af[_0x3518('0x47')]);return _0x5a39be['getSubjects'](_0x3befa1);}})[_0x3518('0x2d')](function(_0x3ce6ac){if(_0x3ce6ac){_0x994b33=_0x3ce6ac[_0x3518('0x3f')];if(!_0x4bf2af['query'][_0x3518('0x40')]('nolimit')){_0x3befa1['limit']=qs[_0x3518('0x28')](_0x4bf2af[_0x3518('0x39')][_0x3518('0x28')]);_0x3befa1['offset']=qs[_0x3518('0x27')](_0x4bf2af[_0x3518('0x39')][_0x3518('0x27')]);}return _0x5a39be[_0x3518('0x4f')](_0x3befa1);}})['then'](function(_0x48ff85){if(_0x48ff85){return _0x48ff85?{'count':_0x994b33,'rows':_0x48ff85}:null;}})[_0x3518('0x2d')](respondWithResult(_0x40b3cf,null))[_0x3518('0x21')](handleError(_0x40b3cf,null));};exports[_0x3518('0x52')]=function(_0x57e6cc,_0xdb81d9,_0x544b49){var _0x147db5={};var _0x269170={};var _0x1e7d2b;var _0x568b7c;return db[_0x3518('0x33')][_0x3518('0x50')]({'where':{'id':_0x57e6cc[_0x3518('0x4e')]['id']}})['then'](handleEntityNotFound(_0xdb81d9,null))[_0x3518('0x2d')](function(_0x2669c2){if(_0x2669c2){_0x1e7d2b=_0x2669c2;_0x269170['model']=_['keys'](db['FreshsalesField'][_0x3518('0x34')]);_0x269170[_0x3518('0x39')]=_['keys'](_0x57e6cc[_0x3518('0x39')]);_0x269170['filters']=_[_0x3518('0x3c')](_0x269170[_0x3518('0x38')],_0x269170[_0x3518('0x39')]);_0x147db5['attributes']=_[_0x3518('0x3c')](_0x269170[_0x3518('0x38')],qs[_0x3518('0x3e')](_0x57e6cc[_0x3518('0x39')][_0x3518('0x3e')]));_0x147db5[_0x3518('0x3d')]=_0x147db5[_0x3518('0x3d')][_0x3518('0x3f')]?_0x147db5['attributes']:_0x269170['model'];_0x147db5[_0x3518('0x53')]=qs[_0x3518('0x42')](_0x57e6cc['query'][_0x3518('0x42')]);_0x147db5[_0x3518('0x43')]=qs[_0x3518('0x3b')](_[_0x3518('0x44')](_0x57e6cc[_0x3518('0x39')],_0x269170[_0x3518('0x3b')]));if(_0x57e6cc[_0x3518('0x39')][_0x3518('0x45')]){_0x147db5[_0x3518('0x43')]=_[_0x3518('0x46')](_0x147db5[_0x3518('0x43')],{'$or':_[_0x3518('0x32')](_0x147db5[_0x3518('0x3d')],function(_0x2c0cc3){var _0x464411={};_0x464411[_0x2c0cc3]={'$like':'%'+_0x57e6cc[_0x3518('0x39')][_0x3518('0x45')]+'%'};return _0x464411;})});}_0x147db5=_[_0x3518('0x46')]({},_0x147db5,_0x57e6cc[_0x3518('0x47')]);return _0x1e7d2b[_0x3518('0x52')](_0x147db5);}})[_0x3518('0x2d')](function(_0x56d48f){if(_0x56d48f){_0x568b7c=_0x56d48f[_0x3518('0x3f')];if(!_0x57e6cc[_0x3518('0x39')][_0x3518('0x40')](_0x3518('0x41'))){_0x147db5[_0x3518('0x28')]=qs[_0x3518('0x28')](_0x57e6cc[_0x3518('0x39')][_0x3518('0x28')]);_0x147db5[_0x3518('0x27')]=qs[_0x3518('0x27')](_0x57e6cc[_0x3518('0x39')][_0x3518('0x27')]);}return _0x1e7d2b[_0x3518('0x52')](_0x147db5);}})[_0x3518('0x2d')](function(_0x24ec37){if(_0x24ec37){return _0x24ec37?{'count':_0x568b7c,'rows':_0x24ec37}:null;}})['then'](respondWithResult(_0xdb81d9,null))[_0x3518('0x21')](handleError(_0xdb81d9,null));};exports[_0x3518('0x54')]=function(_0x1ed89c,_0x443b9a,_0x912a89){var _0x57d2ae={};var _0x268e69={};var _0x460bcd;var _0x1ae3c4;return db[_0x3518('0x33')][_0x3518('0x50')]({'where':{'id':_0x1ed89c[_0x3518('0x4e')]['id']}})[_0x3518('0x2d')](handleEntityNotFound(_0x443b9a,null))[_0x3518('0x2d')](function(_0x307f44){if(_0x307f44){_0x460bcd=_0x307f44;_0x268e69['model']=_[_0x3518('0x3a')](db[_0x3518('0x51')][_0x3518('0x34')]);_0x268e69[_0x3518('0x39')]=_[_0x3518('0x3a')](_0x1ed89c[_0x3518('0x39')]);_0x268e69[_0x3518('0x3b')]=_['intersection'](_0x268e69[_0x3518('0x38')],_0x268e69['query']);_0x57d2ae[_0x3518('0x3d')]=_[_0x3518('0x3c')](_0x268e69[_0x3518('0x38')],qs['fields'](_0x1ed89c[_0x3518('0x39')][_0x3518('0x3e')]));_0x57d2ae[_0x3518('0x3d')]=_0x57d2ae[_0x3518('0x3d')][_0x3518('0x3f')]?_0x57d2ae[_0x3518('0x3d')]:_0x268e69[_0x3518('0x38')];_0x57d2ae[_0x3518('0x53')]=qs[_0x3518('0x42')](_0x1ed89c[_0x3518('0x39')][_0x3518('0x42')]);_0x57d2ae[_0x3518('0x43')]=qs[_0x3518('0x3b')](_[_0x3518('0x44')](_0x1ed89c[_0x3518('0x39')],_0x268e69['filters']));if(_0x1ed89c['query']['filter']){_0x57d2ae['where']=_[_0x3518('0x46')](_0x57d2ae[_0x3518('0x43')],{'$or':_[_0x3518('0x32')](_0x57d2ae[_0x3518('0x3d')],function(_0x5c4ce0){var _0x4a323f={};_0x4a323f[_0x5c4ce0]={'$like':'%'+_0x1ed89c['query'][_0x3518('0x45')]+'%'};return _0x4a323f;})});}_0x57d2ae=_['merge']({},_0x57d2ae,_0x1ed89c[_0x3518('0x47')]);return _0x460bcd[_0x3518('0x54')](_0x57d2ae);}})[_0x3518('0x2d')](function(_0x1b5936){if(_0x1b5936){_0x1ae3c4=_0x1b5936[_0x3518('0x3f')];if(!_0x1ed89c[_0x3518('0x39')][_0x3518('0x40')](_0x3518('0x41'))){_0x57d2ae[_0x3518('0x28')]=qs[_0x3518('0x28')](_0x1ed89c[_0x3518('0x39')][_0x3518('0x28')]);_0x57d2ae[_0x3518('0x27')]=qs[_0x3518('0x27')](_0x1ed89c[_0x3518('0x39')][_0x3518('0x27')]);}return _0x460bcd[_0x3518('0x54')](_0x57d2ae);}})[_0x3518('0x2d')](function(_0x2ec730){if(_0x2ec730){return _0x2ec730?{'count':_0x1ae3c4,'rows':_0x2ec730}:null;}})[_0x3518('0x2d')](respondWithResult(_0x443b9a,null))[_0x3518('0x21')](handleError(_0x443b9a,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 489ead1..55e0085 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 _0x5433=['path','rimraf','exports','define','int_freshsales_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x5433,0x9f));var _0x3543=function(_0x399b41,_0x387b87){_0x399b41=_0x399b41-0x0;var _0x279b96=_0x5433[_0x399b41];return _0x279b96;};'use strict';var _=require(_0x3543('0x0'));var util=require(_0x3543('0x1'));var logger=require(_0x3543('0x2'))(_0x3543('0x3'));var moment=require(_0x3543('0x4'));var BPromise=require(_0x3543('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3543('0x6'));var rimraf=require(_0x3543('0x7'));var config=require('../../config/environment');var attributes=require('./intFreshsalesConfiguration.attributes');module[_0x3543('0x8')]=function(_0x3d21be,_0x174902){return _0x3d21be[_0x3543('0x9')]('FreshsalesConfiguration',attributes,{'tableName':_0x3543('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1be1=['define','int_freshsales_configurations','../../config/logger','api','bluebird','request-promise','path','rimraf','./intFreshsalesConfiguration.attributes','exports'];(function(_0x5d7227,_0x12aebe){var _0x15ac55=function(_0x58d13e){while(--_0x58d13e){_0x5d7227['push'](_0x5d7227['shift']());}};_0x15ac55(++_0x12aebe);}(_0x1be1,0x192));var _0x11be=function(_0x42e695,_0x5f7aa){_0x42e695=_0x42e695-0x0;var _0x44844b=_0x1be1[_0x42e695];return _0x44844b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x11be('0x0'))(_0x11be('0x1'));var moment=require('moment');var BPromise=require(_0x11be('0x2'));var rp=require(_0x11be('0x3'));var fs=require('fs');var path=require(_0x11be('0x4'));var rimraf=require(_0x11be('0x5'));var config=require('../../config/environment');var attributes=require(_0x11be('0x6'));module[_0x11be('0x7')]=function(_0x11f793,_0x479719){return _0x11f793[_0x11be('0x8')]('FreshsalesConfiguration',attributes,{'tableName':_0x11be('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index 1e2cfa2..8befc07 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 _0xb9e7=['../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','FreshsalesConfiguration,\x20%s,\x20%s','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','request\x20sent','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0xb9e7,0x1df));var _0x7b9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xb9e7[_0x2576d7];return _0x16a08c;};'use strict';var _=require('lodash');var util=require(_0x7b9e('0x0'));var moment=require(_0x7b9e('0x1'));var BPromise=require(_0x7b9e('0x2'));var rs=require(_0x7b9e('0x3'));var fs=require('fs');var Redis=require(_0x7b9e('0x4'));var db=require(_0x7b9e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b9e('0x6'))(_0x7b9e('0x7'));var config=require('../../config/environment');var jayson=require(_0x7b9e('0x8'));var client=jayson['client'][_0x7b9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e7ea3,_0x14e025,_0x9b53ea){return new BPromise(function(_0x30d1d8,_0x5c358c){return client[_0x7b9e('0xa')](_0x3e7ea3,_0x9b53ea)[_0x7b9e('0xb')](function(_0xb35b20){logger['info'](_0x7b9e('0xc'),_0x14e025,'request\x20sent');logger[_0x7b9e('0xd')](_0x7b9e('0xe'),_0x14e025,'request\x20sent',JSON['stringify'](_0xb35b20));if(_0xb35b20[_0x7b9e('0xf')]){if(_0xb35b20['error'][_0x7b9e('0x10')]===0x1f4){logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x14e025,_0xb35b20['error'][_0x7b9e('0x11')]);return _0x5c358c(_0xb35b20[_0x7b9e('0xf')][_0x7b9e('0x11')]);}logger[_0x7b9e('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x14e025,_0xb35b20[_0x7b9e('0xf')][_0x7b9e('0x11')]);return _0x30d1d8(_0xb35b20[_0x7b9e('0xf')][_0x7b9e('0x11')]);}else{logger[_0x7b9e('0x12')](_0x7b9e('0xc'),_0x14e025,_0x7b9e('0x13'));_0x30d1d8(_0xb35b20[_0x7b9e('0x14')][_0x7b9e('0x11')]);}})[_0x7b9e('0x15')](function(_0x49e88c){logger[_0x7b9e('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x14e025,_0x49e88c);_0x5c358c(_0x49e88c);});});} \ No newline at end of file +var _0x7117=['request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s'];(function(_0x5ad0d7,_0x2645f8){var _0xd83bd=function(_0x33d3bd){while(--_0x33d3bd){_0x5ad0d7['push'](_0x5ad0d7['shift']());}};_0xd83bd(++_0x2645f8);}(_0x7117,0x1ec));var _0x7711=function(_0x593eb7,_0x848c41){_0x593eb7=_0x593eb7-0x0;var _0x1125bd=_0x7117[_0x593eb7];return _0x1125bd;};'use strict';var _=require(_0x7711('0x0'));var util=require(_0x7711('0x1'));var moment=require(_0x7711('0x2'));var BPromise=require(_0x7711('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7711('0x4'));var db=require(_0x7711('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7711('0x6'))('rpc');var config=require(_0x7711('0x7'));var jayson=require(_0x7711('0x8'));var client=jayson[_0x7711('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x492137,_0x56d953,_0x50acc7){return new BPromise(function(_0x390862,_0xb9cae4){return client[_0x7711('0xa')](_0x492137,_0x50acc7)[_0x7711('0xb')](function(_0x4bb5fc){logger[_0x7711('0xc')](_0x7711('0xd'),_0x56d953,_0x7711('0xe'));logger[_0x7711('0xf')](_0x7711('0x10'),_0x56d953,'request\x20sent',JSON[_0x7711('0x11')](_0x4bb5fc));if(_0x4bb5fc[_0x7711('0x12')]){if(_0x4bb5fc['error'][_0x7711('0x13')]===0x1f4){logger[_0x7711('0x12')](_0x7711('0xd'),_0x56d953,_0x4bb5fc[_0x7711('0x12')][_0x7711('0x14')]);return _0xb9cae4(_0x4bb5fc[_0x7711('0x12')]['message']);}logger[_0x7711('0x12')](_0x7711('0xd'),_0x56d953,_0x4bb5fc[_0x7711('0x12')][_0x7711('0x14')]);return _0x390862(_0x4bb5fc['error'][_0x7711('0x14')]);}else{logger[_0x7711('0xc')](_0x7711('0xd'),_0x56d953,_0x7711('0xe'));_0x390862(_0x4bb5fc[_0x7711('0x15')][_0x7711('0x14')]);}})[_0x7711('0x16')](function(_0x1a9d42){logger[_0x7711('0x12')](_0x7711('0xd'),_0x56d953,_0x1a9d42);_0xb9cae4(_0x1a9d42);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index bd0e2da..6569a1d 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 _0xedb8=['post','create','put','update','destroy','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','/:id','show'];(function(_0x202d24,_0x5e8641){var _0x2b3a8e=function(_0x4c7c4a){while(--_0x4c7c4a){_0x202d24['push'](_0x202d24['shift']());}};_0x2b3a8e(++_0x5e8641);}(_0xedb8,0xef));var _0x8edb=function(_0xd04611,_0x6f7365){_0xd04611=_0xd04611-0x0;var _0x72e2db=_0xedb8[_0xd04611];return _0x72e2db;};'use strict';var multer=require(_0x8edb('0x0'));var util=require(_0x8edb('0x1'));var path=require('path');var timeout=require(_0x8edb('0x2'));var express=require(_0x8edb('0x3'));var router=express[_0x8edb('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x8edb('0x5'));var config=require(_0x8edb('0x6'));var controller=require(_0x8edb('0x7'));router[_0x8edb('0x8')]('/',auth[_0x8edb('0x9')](),controller[_0x8edb('0xa')]);router['get'](_0x8edb('0xb'),auth['isAuthenticated'](),controller[_0x8edb('0xc')]);router[_0x8edb('0xd')]('/',auth[_0x8edb('0x9')](),controller[_0x8edb('0xe')]);router[_0x8edb('0xf')](_0x8edb('0xb'),auth['isAuthenticated'](),controller[_0x8edb('0x10')]);router['delete'](_0x8edb('0xb'),auth[_0x8edb('0x9')](),controller[_0x8edb('0x11')]);module['exports']=router; \ No newline at end of file +var _0x9e31=['exports','util','path','express','Router','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','create','put','update','delete'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x9e31,0x171));var _0x19e3=function(_0x43283d,_0x3f33d3){_0x43283d=_0x43283d-0x0;var _0xb6b775=_0x9e31[_0x43283d];return _0xb6b775;};'use strict';var multer=require('multer');var util=require(_0x19e3('0x0'));var path=require(_0x19e3('0x1'));var timeout=require('connect-timeout');var express=require(_0x19e3('0x2'));var router=express[_0x19e3('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x19e3('0x4'));var config=require(_0x19e3('0x5'));var controller=require('./intFreshsalesField.controller');router[_0x19e3('0x6')]('/',auth['isAuthenticated'](),controller[_0x19e3('0x7')]);router[_0x19e3('0x6')](_0x19e3('0x8'),auth[_0x19e3('0x9')](),controller[_0x19e3('0xa')]);router['post']('/',auth[_0x19e3('0x9')](),controller[_0x19e3('0xb')]);router[_0x19e3('0xc')](_0x19e3('0x8'),auth['isAuthenticated'](),controller[_0x19e3('0xd')]);router[_0x19e3('0xe')](_0x19e3('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x19e3('0xf')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 1d81e75..879508f 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 _0xa98d=['STRING','sequelize','ENUM','variable','customVariable','string'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa98d,0xa3));var _0xda98=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xa98d[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0xda98('0x0'));module['exports']={'type':{'type':Sequelize[_0xda98('0x1')]('string',_0xda98('0x2'),_0xda98('0x3'),'keyValue'),'defaultValue':_0xda98('0x4')},'content':{'type':Sequelize[_0xda98('0x5')]},'key':{'type':Sequelize[_0xda98('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0xda98('0x4'),_0xda98('0x2'),_0xda98('0x3'))},'keyContent':{'type':Sequelize[_0xda98('0x5')]},'idField':{'type':Sequelize[_0xda98('0x5')]},'nameField':{'type':Sequelize[_0xda98('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xda98('0x5')]}}; \ No newline at end of file +var _0xb688=['STRING','BOOLEAN','exports','ENUM','variable','customVariable','keyValue','string'];(function(_0x3daa1e,_0x8909be){var _0xe85332=function(_0x321bad){while(--_0x321bad){_0x3daa1e['push'](_0x3daa1e['shift']());}};_0xe85332(++_0x8909be);}(_0xb688,0x1b2));var _0x8b68=function(_0x5af00a,_0x3b8b9f){_0x5af00a=_0x5af00a-0x0;var _0x19a99c=_0xb688[_0x5af00a];return _0x19a99c;};'use strict';var Sequelize=require('sequelize');module[_0x8b68('0x0')]={'type':{'type':Sequelize[_0x8b68('0x1')]('string',_0x8b68('0x2'),_0x8b68('0x3'),_0x8b68('0x4')),'defaultValue':_0x8b68('0x5')},'content':{'type':Sequelize[_0x8b68('0x6')]},'key':{'type':Sequelize[_0x8b68('0x6')]},'keyType':{'type':Sequelize[_0x8b68('0x1')](_0x8b68('0x5'),'variable',_0x8b68('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x8b68('0x6')]},'customField':{'type':Sequelize[_0x8b68('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8b68('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 2172fdf..64a7ff6 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 _0x693f=['filter','VIRTUAL','merge','options','findAll','rows','catch','params','keys','include','find','create','body','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick'];(function(_0x10bf5d,_0x10a3a9){var _0x27f511=function(_0x209cf3){while(--_0x209cf3){_0x10bf5d['push'](_0x10bf5d['shift']());}};_0x27f511(++_0x10a3a9);}(_0x693f,0x9d));var _0xf693=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x693f[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0xf693('0x0'));var emlformat=require(_0xf693('0x1'));var rimraf=require(_0xf693('0x2'));var zipdir=require(_0xf693('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf693('0x4'));var moment=require(_0xf693('0x5'));var BPromise=require(_0xf693('0x6'));var Mustache=require(_0xf693('0x7'));var util=require(_0xf693('0x8'));var path=require(_0xf693('0x9'));var sox=require(_0xf693('0xa'));var csv=require('to-csv');var ejs=require(_0xf693('0xb'));var fs=require('fs');var _=require(_0xf693('0xc'));var squel=require('squel');var crypto=require(_0xf693('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf693('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf693('0xf'));var Papa=require(_0xf693('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf693('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf693('0x12'))(_0xf693('0x13'));var utils=require(_0xf693('0x14'));var config=require(_0xf693('0x15'));var db=require(_0xf693('0x16'))['db'];function respondWithStatusCode(_0x5a5a35,_0x5d0d4c){_0x5d0d4c=_0x5d0d4c||0xcc;return function(_0xd08be1){if(_0xd08be1){return _0x5a5a35[_0xf693('0x17')](_0x5d0d4c);}return _0x5a5a35['status'](_0x5d0d4c)[_0xf693('0x18')]();};}function respondWithResult(_0x1bfd8d,_0x5a5f86){_0x5a5f86=_0x5a5f86||0xc8;return function(_0x5c42f0){if(_0x5c42f0){return _0x1bfd8d[_0xf693('0x19')](_0x5a5f86)[_0xf693('0x1a')](_0x5c42f0);}};}function respondWithFilteredResult(_0xbd92c6,_0x208f32){return function(_0x36d92c){if(_0x36d92c){var _0x5541a7=_0x36d92c[_0xf693('0x1b')],_0x1d9278=_0x208f32[_0xf693('0x1c')],_0x1c0dfc=_0x208f32[_0xf693('0x1c')]+_0x208f32['limit'],_0x3c8084;if(_0x1c0dfc>=_0x5541a7){_0x1c0dfc=_0x5541a7;_0x3c8084=0xc8;}else{_0x3c8084=0xce;}_0xbd92c6['status'](_0x3c8084);return _0xbd92c6['set'](_0xf693('0x1d'),_0x1d9278+'-'+_0x1c0dfc+'/'+_0x5541a7)[_0xf693('0x1a')](_0x36d92c);}return null;};}function patchUpdates(_0x3f4d4d){return function(_0x4543a1){try{jsonpatch[_0xf693('0x1e')](_0x4543a1,_0x3f4d4d,!![]);}catch(_0x58f0f0){return BPromise[_0xf693('0x1f')](_0x58f0f0);}return _0x4543a1[_0xf693('0x20')]();};}function saveUpdates(_0x5f89c8,_0x31b887){return function(_0x1d20fc){if(_0x1d20fc){return _0x1d20fc[_0xf693('0x21')](_0x5f89c8)[_0xf693('0x22')](function(_0x38f209){return _0x38f209;});}return null;};}function removeEntity(_0x50b20e,_0x505ada){return function(_0x1188c6){if(_0x1188c6){return _0x1188c6[_0xf693('0x23')]()[_0xf693('0x22')](function(){_0x50b20e[_0xf693('0x19')](0xcc)[_0xf693('0x18')]();});}};}function handleEntityNotFound(_0x200c95,_0x5407f5){return function(_0x179e25){if(!_0x179e25){_0x200c95[_0xf693('0x17')](0x194);}return _0x179e25;};}function handleError(_0xc5c088,_0x414a3f){_0x414a3f=_0x414a3f||0x1f4;return function(_0x4840e2){logger[_0xf693('0x24')](_0x4840e2[_0xf693('0x25')]);if(_0x4840e2[_0xf693('0x26')]){delete _0x4840e2[_0xf693('0x26')];}_0xc5c088[_0xf693('0x19')](_0x414a3f)[_0xf693('0x27')](_0x4840e2);};}exports[_0xf693('0x28')]=function(_0x423cda,_0x3b3bfc){var _0x1b5f98={},_0x4ca818={},_0x79c2b9={'count':0x0,'rows':[]};var _0xaccce0=_[_0xf693('0x29')](db[_0xf693('0x2a')][_0xf693('0x2b')],function(_0x7fdc22){return{'name':_0x7fdc22[_0xf693('0x2c')],'type':_0x7fdc22[_0xf693('0x2d')]['key']};});_0x4ca818[_0xf693('0x2e')]=_[_0xf693('0x29')](_0xaccce0,_0xf693('0x26'));_0x4ca818[_0xf693('0x2f')]=_['keys'](_0x423cda['query']);_0x4ca818[_0xf693('0x30')]=_[_0xf693('0x31')](_0x4ca818['model'],_0x4ca818[_0xf693('0x2f')]);_0x1b5f98[_0xf693('0x32')]=_[_0xf693('0x31')](_0x4ca818[_0xf693('0x2e')],qs['fields'](_0x423cda[_0xf693('0x2f')][_0xf693('0x33')]));_0x1b5f98[_0xf693('0x32')]=_0x1b5f98[_0xf693('0x32')][_0xf693('0x34')]?_0x1b5f98[_0xf693('0x32')]:_0x4ca818[_0xf693('0x2e')];if(!_0x423cda[_0xf693('0x2f')]['hasOwnProperty'](_0xf693('0x35'))){_0x1b5f98[_0xf693('0x36')]=qs[_0xf693('0x36')](_0x423cda[_0xf693('0x2f')][_0xf693('0x36')]);_0x1b5f98[_0xf693('0x1c')]=qs['offset'](_0x423cda['query'][_0xf693('0x1c')]);}_0x1b5f98[_0xf693('0x37')]=qs[_0xf693('0x38')](_0x423cda['query'][_0xf693('0x38')]);_0x1b5f98[_0xf693('0x39')]=qs[_0xf693('0x30')](_[_0xf693('0x3a')](_0x423cda[_0xf693('0x2f')],_0x4ca818['filters']));if(_0x423cda[_0xf693('0x2f')][_0xf693('0x3b')]){_0x1b5f98[_0xf693('0x39')]=_['merge'](_0x1b5f98[_0xf693('0x39')],{'$or':_['map'](_0xaccce0,function(_0x424b00){if(_0x424b00[_0xf693('0x2d')]!==_0xf693('0x3c')){var _0x111ab6={};_0x111ab6[_0x424b00[_0xf693('0x26')]]={'$like':'%'+_0x423cda['query'][_0xf693('0x3b')]+'%'};return _0x111ab6;}})});}_0x1b5f98=_[_0xf693('0x3d')]({},_0x1b5f98,_0x423cda[_0xf693('0x3e')]);var _0x4033ae={'where':_0x1b5f98[_0xf693('0x39')]};return db[_0xf693('0x2a')][_0xf693('0x1b')](_0x4033ae)[_0xf693('0x22')](function(_0x3f1a7e){_0x79c2b9['count']=_0x3f1a7e;if(_0x423cda[_0xf693('0x2f')]['includeAll']){_0x1b5f98['include']=[{'all':!![]}];}return db[_0xf693('0x2a')][_0xf693('0x3f')](_0x1b5f98);})[_0xf693('0x22')](function(_0x49c2c7){_0x79c2b9[_0xf693('0x40')]=_0x49c2c7;return _0x79c2b9;})['then'](respondWithFilteredResult(_0x3b3bfc,_0x1b5f98))[_0xf693('0x41')](handleError(_0x3b3bfc,null));};exports['show']=function(_0x1bcf85,_0x204d01){var _0x3391e7={'raw':!![],'where':{'id':_0x1bcf85[_0xf693('0x42')]['id']}},_0xb597a8={};_0xb597a8['model']=_['keys'](db['FreshsalesField']['rawAttributes']);_0xb597a8[_0xf693('0x2f')]=_[_0xf693('0x43')](_0x1bcf85['query']);_0xb597a8['filters']=_['intersection'](_0xb597a8[_0xf693('0x2e')],_0xb597a8[_0xf693('0x2f')]);_0x3391e7[_0xf693('0x32')]=_[_0xf693('0x31')](_0xb597a8['model'],qs[_0xf693('0x33')](_0x1bcf85[_0xf693('0x2f')][_0xf693('0x33')]));_0x3391e7['attributes']=_0x3391e7[_0xf693('0x32')][_0xf693('0x34')]?_0x3391e7['attributes']:_0xb597a8[_0xf693('0x2e')];if(_0x1bcf85[_0xf693('0x2f')]['includeAll']){_0x3391e7[_0xf693('0x44')]=[{'all':!![]}];}_0x3391e7=_[_0xf693('0x3d')]({},_0x3391e7,_0x1bcf85['options']);return db[_0xf693('0x2a')][_0xf693('0x45')](_0x3391e7)[_0xf693('0x22')](handleEntityNotFound(_0x204d01,null))[_0xf693('0x22')](respondWithResult(_0x204d01,null))['catch'](handleError(_0x204d01,null));};exports[_0xf693('0x46')]=function(_0x3235e1,_0x1ed7f3){return db[_0xf693('0x2a')][_0xf693('0x46')](_0x3235e1[_0xf693('0x47')],{})['then'](respondWithResult(_0x1ed7f3,0xc9))[_0xf693('0x41')](handleError(_0x1ed7f3,null));};exports[_0xf693('0x21')]=function(_0xdd9852,_0x3bac5b){if(_0xdd9852[_0xf693('0x47')]['id']){delete _0xdd9852['body']['id'];}return db[_0xf693('0x2a')][_0xf693('0x45')]({'where':{'id':_0xdd9852['params']['id']}})[_0xf693('0x22')](handleEntityNotFound(_0x3bac5b,null))['then'](saveUpdates(_0xdd9852['body'],null))['then'](respondWithResult(_0x3bac5b,null))[_0xf693('0x41')](handleError(_0x3bac5b,null));};exports[_0xf693('0x23')]=function(_0x1fbe98,_0x2db7b7){return db['FreshsalesField']['find']({'where':{'id':_0x1fbe98[_0xf693('0x42')]['id']}})['then'](handleEntityNotFound(_0x2db7b7,null))[_0xf693('0x22')](removeEntity(_0x2db7b7,null))[_0xf693('0x41')](handleError(_0x2db7b7,null));}; \ No newline at end of file +var _0x8f59=['mustache','util','path','to-csv','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','FreshsalesField','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird'];(function(_0x27ab80,_0x1fbee7){var _0x5a96ab=function(_0x42a4c4){while(--_0x42a4c4){_0x27ab80['push'](_0x27ab80['shift']());}};_0x5a96ab(++_0x1fbee7);}(_0x8f59,0x11d));var _0x98f5=function(_0x2acbce,_0x1bba43){_0x2acbce=_0x2acbce-0x0;var _0x5f0461=_0x8f59[_0x2acbce];return _0x5f0461;};'use strict';var pdf=require(_0x98f5('0x0'));var emlformat=require(_0x98f5('0x1'));var rimraf=require(_0x98f5('0x2'));var zipdir=require(_0x98f5('0x3'));var jsonpatch=require(_0x98f5('0x4'));var rp=require(_0x98f5('0x5'));var moment=require('moment');var BPromise=require(_0x98f5('0x6'));var Mustache=require(_0x98f5('0x7'));var util=require(_0x98f5('0x8'));var path=require(_0x98f5('0x9'));var sox=require('sox');var csv=require(_0x98f5('0xa'));var ejs=require(_0x98f5('0xb'));var fs=require('fs');var _=require(_0x98f5('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x98f5('0xd'));var deskjs=require(_0x98f5('0xe'));var toCsv=require(_0x98f5('0xa'));var querystring=require('querystring');var Papa=require(_0x98f5('0xf'));var Redis=require(_0x98f5('0x10'));var authService=require(_0x98f5('0x11'));var qs=require(_0x98f5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x98f5('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x98f5('0x14'));var config=require(_0x98f5('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x362b4b,_0x259abe){_0x259abe=_0x259abe||0xcc;return function(_0x1f00e8){if(_0x1f00e8){return _0x362b4b[_0x98f5('0x16')](_0x259abe);}return _0x362b4b[_0x98f5('0x17')](_0x259abe)[_0x98f5('0x18')]();};}function respondWithResult(_0x5dcb5e,_0x24a7a9){_0x24a7a9=_0x24a7a9||0xc8;return function(_0xbade31){if(_0xbade31){return _0x5dcb5e['status'](_0x24a7a9)[_0x98f5('0x19')](_0xbade31);}};}function respondWithFilteredResult(_0x3d6b5c,_0xaa951a){return function(_0x4ae70d){if(_0x4ae70d){var _0x2437e7=_0x4ae70d[_0x98f5('0x1a')],_0xc7a49b=_0xaa951a[_0x98f5('0x1b')],_0x113545=_0xaa951a['offset']+_0xaa951a[_0x98f5('0x1c')],_0x5bb486;if(_0x113545>=_0x2437e7){_0x113545=_0x2437e7;_0x5bb486=0xc8;}else{_0x5bb486=0xce;}_0x3d6b5c['status'](_0x5bb486);return _0x3d6b5c[_0x98f5('0x1d')](_0x98f5('0x1e'),_0xc7a49b+'-'+_0x113545+'/'+_0x2437e7)[_0x98f5('0x19')](_0x4ae70d);}return null;};}function patchUpdates(_0x11b6d4){return function(_0xd6f409){try{jsonpatch[_0x98f5('0x1f')](_0xd6f409,_0x11b6d4,!![]);}catch(_0x484e1d){return BPromise[_0x98f5('0x20')](_0x484e1d);}return _0xd6f409['save']();};}function saveUpdates(_0xd1209d,_0x191f23){return function(_0x5deca0){if(_0x5deca0){return _0x5deca0[_0x98f5('0x21')](_0xd1209d)[_0x98f5('0x22')](function(_0x331695){return _0x331695;});}return null;};}function removeEntity(_0x10f3d6,_0x3b2d9d){return function(_0x3dc7c2){if(_0x3dc7c2){return _0x3dc7c2[_0x98f5('0x23')]()['then'](function(){_0x10f3d6[_0x98f5('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xcb10d6,_0x495889){return function(_0x44bfbb){if(!_0x44bfbb){_0xcb10d6[_0x98f5('0x16')](0x194);}return _0x44bfbb;};}function handleError(_0x106b24,_0x5c64e){_0x5c64e=_0x5c64e||0x1f4;return function(_0x3cc7de){logger[_0x98f5('0x24')](_0x3cc7de[_0x98f5('0x25')]);if(_0x3cc7de['name']){delete _0x3cc7de[_0x98f5('0x26')];}_0x106b24[_0x98f5('0x17')](_0x5c64e)['send'](_0x3cc7de);};}exports[_0x98f5('0x27')]=function(_0x18b0af,_0x5b08c2){var _0x214130={},_0x230d1b={},_0xe5a019={'count':0x0,'rows':[]};var _0x17dcb2=_[_0x98f5('0x28')](db['FreshsalesField']['rawAttributes'],function(_0x428c85){return{'name':_0x428c85[_0x98f5('0x29')],'type':_0x428c85[_0x98f5('0x2a')][_0x98f5('0x2b')]};});_0x230d1b[_0x98f5('0x2c')]=_[_0x98f5('0x28')](_0x17dcb2,'name');_0x230d1b[_0x98f5('0x2d')]=_[_0x98f5('0x2e')](_0x18b0af[_0x98f5('0x2d')]);_0x230d1b[_0x98f5('0x2f')]=_[_0x98f5('0x30')](_0x230d1b[_0x98f5('0x2c')],_0x230d1b['query']);_0x214130[_0x98f5('0x31')]=_[_0x98f5('0x30')](_0x230d1b[_0x98f5('0x2c')],qs[_0x98f5('0x32')](_0x18b0af['query'][_0x98f5('0x32')]));_0x214130[_0x98f5('0x31')]=_0x214130[_0x98f5('0x31')][_0x98f5('0x33')]?_0x214130[_0x98f5('0x31')]:_0x230d1b[_0x98f5('0x2c')];if(!_0x18b0af[_0x98f5('0x2d')][_0x98f5('0x34')](_0x98f5('0x35'))){_0x214130[_0x98f5('0x1c')]=qs[_0x98f5('0x1c')](_0x18b0af[_0x98f5('0x2d')][_0x98f5('0x1c')]);_0x214130[_0x98f5('0x1b')]=qs[_0x98f5('0x1b')](_0x18b0af[_0x98f5('0x2d')][_0x98f5('0x1b')]);}_0x214130[_0x98f5('0x36')]=qs[_0x98f5('0x37')](_0x18b0af[_0x98f5('0x2d')]['sort']);_0x214130[_0x98f5('0x38')]=qs['filters'](_['pick'](_0x18b0af[_0x98f5('0x2d')],_0x230d1b[_0x98f5('0x2f')]));if(_0x18b0af[_0x98f5('0x2d')][_0x98f5('0x39')]){_0x214130['where']=_[_0x98f5('0x3a')](_0x214130[_0x98f5('0x38')],{'$or':_[_0x98f5('0x28')](_0x17dcb2,function(_0x4f4e9d){if(_0x4f4e9d[_0x98f5('0x2a')]!==_0x98f5('0x3b')){var _0x54fa17={};_0x54fa17[_0x4f4e9d[_0x98f5('0x26')]]={'$like':'%'+_0x18b0af[_0x98f5('0x2d')][_0x98f5('0x39')]+'%'};return _0x54fa17;}})});}_0x214130=_['merge']({},_0x214130,_0x18b0af[_0x98f5('0x3c')]);var _0x3388cb={'where':_0x214130[_0x98f5('0x38')]};return db[_0x98f5('0x3d')][_0x98f5('0x1a')](_0x3388cb)['then'](function(_0x5476e8){_0xe5a019[_0x98f5('0x1a')]=_0x5476e8;if(_0x18b0af[_0x98f5('0x2d')][_0x98f5('0x3e')]){_0x214130[_0x98f5('0x3f')]=[{'all':!![]}];}return db[_0x98f5('0x3d')][_0x98f5('0x40')](_0x214130);})['then'](function(_0x4a4129){_0xe5a019[_0x98f5('0x41')]=_0x4a4129;return _0xe5a019;})[_0x98f5('0x22')](respondWithFilteredResult(_0x5b08c2,_0x214130))[_0x98f5('0x42')](handleError(_0x5b08c2,null));};exports[_0x98f5('0x43')]=function(_0x52174e,_0x49582c){var _0x2dafcd={'raw':!![],'where':{'id':_0x52174e[_0x98f5('0x44')]['id']}},_0x469d2c={};_0x469d2c[_0x98f5('0x2c')]=_['keys'](db['FreshsalesField'][_0x98f5('0x45')]);_0x469d2c[_0x98f5('0x2d')]=_[_0x98f5('0x2e')](_0x52174e['query']);_0x469d2c[_0x98f5('0x2f')]=_['intersection'](_0x469d2c[_0x98f5('0x2c')],_0x469d2c['query']);_0x2dafcd[_0x98f5('0x31')]=_[_0x98f5('0x30')](_0x469d2c[_0x98f5('0x2c')],qs['fields'](_0x52174e[_0x98f5('0x2d')][_0x98f5('0x32')]));_0x2dafcd['attributes']=_0x2dafcd[_0x98f5('0x31')][_0x98f5('0x33')]?_0x2dafcd['attributes']:_0x469d2c[_0x98f5('0x2c')];if(_0x52174e['query'][_0x98f5('0x3e')]){_0x2dafcd[_0x98f5('0x3f')]=[{'all':!![]}];}_0x2dafcd=_['merge']({},_0x2dafcd,_0x52174e['options']);return db['FreshsalesField']['find'](_0x2dafcd)[_0x98f5('0x22')](handleEntityNotFound(_0x49582c,null))['then'](respondWithResult(_0x49582c,null))[_0x98f5('0x42')](handleError(_0x49582c,null));};exports[_0x98f5('0x46')]=function(_0x1da248,_0x1573c7){return db[_0x98f5('0x3d')][_0x98f5('0x46')](_0x1da248['body'],{})[_0x98f5('0x22')](respondWithResult(_0x1573c7,0xc9))[_0x98f5('0x42')](handleError(_0x1573c7,null));};exports[_0x98f5('0x21')]=function(_0x2c3cef,_0x178867){if(_0x2c3cef[_0x98f5('0x47')]['id']){delete _0x2c3cef['body']['id'];}return db[_0x98f5('0x3d')][_0x98f5('0x48')]({'where':{'id':_0x2c3cef[_0x98f5('0x44')]['id']}})[_0x98f5('0x22')](handleEntityNotFound(_0x178867,null))['then'](saveUpdates(_0x2c3cef[_0x98f5('0x47')],null))[_0x98f5('0x22')](respondWithResult(_0x178867,null))[_0x98f5('0x42')](handleError(_0x178867,null));};exports[_0x98f5('0x23')]=function(_0x269861,_0x4da817){return db[_0x98f5('0x3d')][_0x98f5('0x48')]({'where':{'id':_0x269861['params']['id']}})[_0x98f5('0x22')](handleEntityNotFound(_0x4da817,null))['then'](removeEntity(_0x4da817,null))[_0x98f5('0x42')](handleError(_0x4da817,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index bcd671d..7a8850a 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 _0xa176=['FieldId','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField'];(function(_0x219d87,_0x1cb6f7){var _0x22823d=function(_0x5357bf){while(--_0x5357bf){_0x219d87['push'](_0x219d87['shift']());}};_0x22823d(++_0x1cb6f7);}(_0xa176,0x1dd));var _0x6a17=function(_0x19d73c,_0x569e96){_0x19d73c=_0x19d73c-0x0;var _0x23fbef=_0xa176[_0x19d73c];return _0x23fbef;};'use strict';var _=require('lodash');var util=require(_0x6a17('0x0'));var logger=require(_0x6a17('0x1'))(_0x6a17('0x2'));var moment=require(_0x6a17('0x3'));var BPromise=require(_0x6a17('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6a17('0x5'));var rimraf=require(_0x6a17('0x6'));var config=require(_0x6a17('0x7'));var attributes=require('./intFreshsalesField.attributes');module[_0x6a17('0x8')]=function(_0x3a219a,_0x12dc73){return _0x3a219a['define'](_0x6a17('0x9'),attributes,{'tableName':_0x6a17('0xa'),'paranoid':![],'indexes':[{'name':_0x6a17('0xb'),'fields':[_0x6a17('0xc'),_0x6a17('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd9dd=['FieldId','lodash','util','api','moment','bluebird','request-promise','path','rimraf','exports','define','int_freshsales_fields','freshsales_unique_index','idField'];(function(_0x2e67fc,_0x2ea8e1){var _0x4a3dbb=function(_0x27a262){while(--_0x27a262){_0x2e67fc['push'](_0x2e67fc['shift']());}};_0x4a3dbb(++_0x2ea8e1);}(_0xd9dd,0x9b));var _0xdd9d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd9dd[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xdd9d('0x0'));var util=require(_0xdd9d('0x1'));var logger=require('../../config/logger')(_0xdd9d('0x2'));var moment=require(_0xdd9d('0x3'));var BPromise=require(_0xdd9d('0x4'));var rp=require(_0xdd9d('0x5'));var fs=require('fs');var path=require(_0xdd9d('0x6'));var rimraf=require(_0xdd9d('0x7'));var config=require('../../config/environment');var attributes=require('./intFreshsalesField.attributes');module[_0xdd9d('0x8')]=function(_0x2425fa,_0x273419){return _0x2425fa[_0xdd9d('0x9')]('FreshsalesField',attributes,{'tableName':_0xdd9d('0xa'),'paranoid':![],'indexes':[{'name':_0xdd9d('0xb'),'fields':[_0xdd9d('0xc'),_0xdd9d('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index 0d6de05..63abf59 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 _0x4888=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1fccba,_0x37b6c4){var _0x1fb272=function(_0x420c97){while(--_0x420c97){_0x1fccba['push'](_0x1fccba['shift']());}};_0x1fb272(++_0x37b6c4);}(_0x4888,0x198));var _0x8488=function(_0xba96b0,_0x36e8f8){_0xba96b0=_0xba96b0-0x0;var _0xdad969=_0x4888[_0xba96b0];return _0xdad969;};'use strict';var _=require('lodash');var util=require(_0x8488('0x0'));var moment=require(_0x8488('0x1'));var BPromise=require(_0x8488('0x2'));var rs=require(_0x8488('0x3'));var fs=require('fs');var Redis=require(_0x8488('0x4'));var db=require(_0x8488('0x5'))['db'];var utils=require(_0x8488('0x6'));var logger=require('../../config/logger')(_0x8488('0x7'));var config=require(_0x8488('0x8'));var jayson=require(_0x8488('0x9'));var client=jayson[_0x8488('0xa')][_0x8488('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x19e508,_0x5250a1,_0x5b30a7){return new BPromise(function(_0x56aad0,_0x568a82){return client[_0x8488('0xc')](_0x19e508,_0x5b30a7)[_0x8488('0xd')](function(_0x542bd8){logger[_0x8488('0xe')](_0x8488('0xf'),_0x5250a1,_0x8488('0x10'));logger[_0x8488('0x11')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x5250a1,_0x8488('0x10'),JSON[_0x8488('0x12')](_0x542bd8));if(_0x542bd8[_0x8488('0x13')]){if(_0x542bd8[_0x8488('0x13')][_0x8488('0x14')]===0x1f4){logger['error'](_0x8488('0xf'),_0x5250a1,_0x542bd8[_0x8488('0x13')]['message']);return _0x568a82(_0x542bd8['error'][_0x8488('0x15')]);}logger['error'](_0x8488('0xf'),_0x5250a1,_0x542bd8['error']['message']);return _0x56aad0(_0x542bd8[_0x8488('0x13')][_0x8488('0x15')]);}else{logger[_0x8488('0xe')](_0x8488('0xf'),_0x5250a1,_0x8488('0x10'));_0x56aad0(_0x542bd8[_0x8488('0x16')][_0x8488('0x15')]);}})['catch'](function(_0x3dad45){logger[_0x8488('0x13')](_0x8488('0xf'),_0x5250a1,_0x3dad45);_0x568a82(_0x3dad45);});});} \ No newline at end of file +var _0xe808=['message','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','info','FreshsalesField,\x20%s,\x20%s','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x27c36d,_0x238965){var _0x46e34d=function(_0x319047){while(--_0x319047){_0x27c36d['push'](_0x27c36d['shift']());}};_0x46e34d(++_0x238965);}(_0xe808,0xfa));var _0x8e80=function(_0x31a844,_0x401f61){_0x31a844=_0x31a844-0x0;var _0x1d36c1=_0xe808[_0x31a844];return _0x1d36c1;};'use strict';var _=require(_0x8e80('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8e80('0x1'));var rs=require(_0x8e80('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8e80('0x3'))['db'];var utils=require(_0x8e80('0x4'));var logger=require('../../config/logger')(_0x8e80('0x5'));var config=require('../../config/environment');var jayson=require(_0x8e80('0x6'));var client=jayson[_0x8e80('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d7574,_0x4d97ad,_0x4589df){return new BPromise(function(_0x1e0bdf,_0x46f820){return client['request'](_0x3d7574,_0x4589df)['then'](function(_0x1670f1){logger[_0x8e80('0x8')](_0x8e80('0x9'),_0x4d97ad,'request\x20sent');logger[_0x8e80('0xa')](_0x8e80('0xb'),_0x4d97ad,_0x8e80('0xc'),JSON[_0x8e80('0xd')](_0x1670f1));if(_0x1670f1[_0x8e80('0xe')]){if(_0x1670f1[_0x8e80('0xe')][_0x8e80('0xf')]===0x1f4){logger['error'](_0x8e80('0x9'),_0x4d97ad,_0x1670f1[_0x8e80('0xe')][_0x8e80('0x10')]);return _0x46f820(_0x1670f1['error'][_0x8e80('0x10')]);}logger[_0x8e80('0xe')](_0x8e80('0x9'),_0x4d97ad,_0x1670f1[_0x8e80('0xe')][_0x8e80('0x10')]);return _0x1e0bdf(_0x1670f1[_0x8e80('0xe')][_0x8e80('0x10')]);}else{logger['info']('FreshsalesField,\x20%s,\x20%s',_0x4d97ad,_0x8e80('0xc'));_0x1e0bdf(_0x1670f1[_0x8e80('0x11')]['message']);}})[_0x8e80('0x12')](function(_0x2e704f){logger['error'](_0x8e80('0x9'),_0x4d97ad,_0x2e704f);_0x46f820(_0x2e704f);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index ea3db22..abc107d 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 _0xbdb9=['show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','isAuthenticated','get'];(function(_0x339f68,_0x34ac0a){var _0x4711ae=function(_0xebca25){while(--_0xebca25){_0x339f68['push'](_0x339f68['shift']());}};_0x4711ae(++_0x34ac0a);}(_0xbdb9,0xac));var _0x9bdb=function(_0x351b6b,_0x2d750f){_0x351b6b=_0x351b6b-0x0;var _0x24b5a6=_0xbdb9[_0x351b6b];return _0x24b5a6;};'use strict';var multer=require(_0x9bdb('0x0'));var util=require(_0x9bdb('0x1'));var path=require(_0x9bdb('0x2'));var timeout=require(_0x9bdb('0x3'));var express=require(_0x9bdb('0x4'));var router=express['Router']();var auth=require(_0x9bdb('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intSalesforceAccount.controller');router['get']('/',auth[_0x9bdb('0x6')](),controller['index']);router[_0x9bdb('0x7')]('/:id',auth[_0x9bdb('0x6')](),controller[_0x9bdb('0x8')]);router[_0x9bdb('0x7')](_0x9bdb('0x9'),auth[_0x9bdb('0x6')](),controller[_0x9bdb('0xa')]);router[_0x9bdb('0x7')]('/:id/fields',auth[_0x9bdb('0x6')](),controller[_0x9bdb('0xb')]);router[_0x9bdb('0xc')]('/',auth[_0x9bdb('0x6')](),controller[_0x9bdb('0xd')]);router['post']('/:id/configurations',auth[_0x9bdb('0x6')](),controller[_0x9bdb('0xe')]);router[_0x9bdb('0xf')](_0x9bdb('0x10'),auth[_0x9bdb('0x6')](),controller[_0x9bdb('0x11')]);router['delete'](_0x9bdb('0x10'),auth[_0x9bdb('0x6')](),controller[_0x9bdb('0x12')]);module[_0x9bdb('0x13')]=router; \ No newline at end of file +var _0x6fd4=['getFields','post','addConfiguration','put','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x6fd4,0x118));var _0x46fd=function(_0xf9e6c1,_0x350daa){_0xf9e6c1=_0xf9e6c1-0x0;var _0x20ba02=_0x6fd4[_0xf9e6c1];return _0x20ba02;};'use strict';var multer=require(_0x46fd('0x0'));var util=require(_0x46fd('0x1'));var path=require(_0x46fd('0x2'));var timeout=require(_0x46fd('0x3'));var express=require(_0x46fd('0x4'));var router=express['Router']();var auth=require(_0x46fd('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intSalesforceAccount.controller');router[_0x46fd('0x6')]('/',auth[_0x46fd('0x7')](),controller[_0x46fd('0x8')]);router[_0x46fd('0x6')](_0x46fd('0x9'),auth[_0x46fd('0x7')](),controller[_0x46fd('0xa')]);router['get'](_0x46fd('0xb'),auth[_0x46fd('0x7')](),controller[_0x46fd('0xc')]);router['get'](_0x46fd('0xd'),auth[_0x46fd('0x7')](),controller[_0x46fd('0xe')]);router[_0x46fd('0xf')]('/',auth[_0x46fd('0x7')](),controller['create']);router['post']('/:id/configurations',auth[_0x46fd('0x7')](),controller[_0x46fd('0x10')]);router[_0x46fd('0x11')]('/:id',auth[_0x46fd('0x7')](),controller[_0x46fd('0x12')]);router[_0x46fd('0x13')]('/:id',auth[_0x46fd('0x7')](),controller[_0x46fd('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 2e8f5a7..3bd4ca6 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 _0x7fbe=['integrationTab','newTab','STRING','username','ENUM'];(function(_0x292b51,_0x387eb5){var _0xd0b6e4=function(_0x3ac9b4){while(--_0x3ac9b4){_0x292b51['push'](_0x292b51['shift']());}};_0xd0b6e4(++_0x387eb5);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x2d7827,_0x5afb3d){_0x2d7827=_0x2d7827-0x0;var _0x2ef080=_0x7fbe[_0x2d7827];return _0x2ef080;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe7fb('0x0')]},'description':{'type':Sequelize[_0xe7fb('0x0')]},'username':{'type':Sequelize[_0xe7fb('0x0')],'unique':_0xe7fb('0x1')},'remoteUri':{'type':Sequelize[_0xe7fb('0x0')]},'password':{'type':Sequelize[_0xe7fb('0x0')]},'clientId':{'type':Sequelize[_0xe7fb('0x0')]},'clientSecret':{'type':Sequelize[_0xe7fb('0x0')]},'securityToken':{'type':Sequelize[_0xe7fb('0x0')]},'serverUrl':{'type':Sequelize[_0xe7fb('0x0')]},'type':{'type':Sequelize[_0xe7fb('0x2')](_0xe7fb('0x3'),_0xe7fb('0x4')),'defaultValue':_0xe7fb('0x3')}}; \ No newline at end of file +var _0x5fab=['username','ENUM','integrationTab','sequelize','exports','STRING'];(function(_0x4f3fe3,_0x109376){var _0x290996=function(_0x125dc6){while(--_0x125dc6){_0x4f3fe3['push'](_0x4f3fe3['shift']());}};_0x290996(++_0x109376);}(_0x5fab,0x177));var _0xb5fa=function(_0x270876,_0x50516b){_0x270876=_0x270876-0x0;var _0x1bc190=_0x5fab[_0x270876];return _0x1bc190;};'use strict';var Sequelize=require(_0xb5fa('0x0'));module[_0xb5fa('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb5fa('0x2')]},'username':{'type':Sequelize[_0xb5fa('0x2')],'unique':_0xb5fa('0x3')},'remoteUri':{'type':Sequelize[_0xb5fa('0x2')]},'password':{'type':Sequelize[_0xb5fa('0x2')]},'clientId':{'type':Sequelize[_0xb5fa('0x2')]},'clientSecret':{'type':Sequelize[_0xb5fa('0x2')]},'securityToken':{'type':Sequelize[_0xb5fa('0x2')]},'serverUrl':{'type':Sequelize[_0xb5fa('0x2')]},'type':{'type':Sequelize[_0xb5fa('0x4')]('integrationTab','newTab'),'defaultValue':_0xb5fa('0x5')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index eda48c2..5c258b9 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 _0xabce=['util','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','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~!@#$%^&-_=+[{]}.','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','count','offset','limit','Content-Range','apply','reject','save','update','stack','name','send','SalesforceAccount','map','query','keys','filters','model','attributes','intersection','length','hasOwnProperty','order','sort','pick','merge','VIRTUAL','filter','options','where','includeAll','include','rows','show','params','rawAttributes','fields','find','create','body','destroy','getConfigurations','findOne','SalesforceConfiguration','getSubjects','channel','getDescriptions','type','SalesforceField','Subjects','Descriptions','getFields','remoteUri','clientId','clientSecret','password','securityToken','slice','lastIndexOf','login','username','concat','ticketType','CallDisposition','CallDurationInSeconds','CallType','IsArchived','Priority','Status','Type','isNil','Origin','Reason','IsEscalated','SuppliedName','SuppliedCompany','remove','custom','label','picklistValues','True','true','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache'];(function(_0x286f20,_0x519022){var _0x50c51a=function(_0x17f6bd){while(--_0x17f6bd){_0x286f20['push'](_0x286f20['shift']());}};_0x50c51a(++_0x519022);}(_0xabce,0x103));var _0xeabc=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xabce[_0x411add];return _0x238242;};'use strict';var pdf=require(_0xeabc('0x0'));var emlformat=require(_0xeabc('0x1'));var rimraf=require(_0xeabc('0x2'));var zipdir=require(_0xeabc('0x3'));var jsonpatch=require(_0xeabc('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xeabc('0x5'));var Mustache=require(_0xeabc('0x6'));var util=require(_0xeabc('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xeabc('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var db=require(_0xeabc('0x18'))['db'];var integrations=require(_0xeabc('0x19'));var jayson=require(_0xeabc('0x1a'));var client=jayson[_0xeabc('0x1b')][_0xeabc('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x53df9c,_0x235c2d,_0x1319f3){if(_0x1319f3){var _0x3251c6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3251c6['test'](_0x235c2d)){return _0x53df9c;}else{throw new db['Sequelize'][(_0xeabc('0x1d'))](_0xeabc('0x1e'));}}else{return _0x53df9c;}}function respondWithRpcPromise(_0x326bac,_0x53d5cb,_0xf913d7,_0x638976){return new BPromise(function(_0x49f2d8,_0x53fe28){var _0x10fa8e=_0x638976||client;return _0x10fa8e['request'](_0x326bac,_0xf913d7)[_0xeabc('0x1f')](function(_0x1b64b9){logger[_0xeabc('0x20')](_0xeabc('0x21'),_0x53d5cb,_0xeabc('0x22'));logger[_0xeabc('0x23')](_0xeabc('0x24'),_0x53d5cb,_0xeabc('0x22'),JSON['stringify'](_0x1b64b9));if(_0x1b64b9[_0xeabc('0x25')]){if(_0x1b64b9['error'][_0xeabc('0x26')]===0x1f4){logger[_0xeabc('0x25')]('SalesforceAccount,\x20%s,\x20%s',_0x53d5cb,_0x1b64b9[_0xeabc('0x25')][_0xeabc('0x27')]);return _0x53fe28(_0x1b64b9[_0xeabc('0x25')][_0xeabc('0x27')]);}logger[_0xeabc('0x25')]('SalesforceAccount,\x20%s,\x20%s',_0x53d5cb,_0x1b64b9[_0xeabc('0x25')][_0xeabc('0x27')]);return _0x49f2d8(_0x1b64b9[_0xeabc('0x25')]['message']);}else{logger[_0xeabc('0x20')](_0xeabc('0x21'),_0x53d5cb,_0xeabc('0x22'));_0x49f2d8(_0x1b64b9[_0xeabc('0x28')]['message']);}})[_0xeabc('0x29')](function(_0x480440){logger[_0xeabc('0x25')]('SalesforceAccount,\x20%s,\x20%s',_0x53d5cb,_0x480440);_0x53fe28(_0x480440);});});}function respondWithStatusCode(_0x811f0d,_0x12acbd){_0x12acbd=_0x12acbd||0xcc;return function(_0x269621){if(_0x269621){return _0x811f0d[_0xeabc('0x2a')](_0x12acbd);}return _0x811f0d[_0xeabc('0x2b')](_0x12acbd)[_0xeabc('0x2c')]();};}function respondWithResult(_0x131722,_0x4c2693){_0x4c2693=_0x4c2693||0xc8;return function(_0x5b2934){if(_0x5b2934){return _0x131722[_0xeabc('0x2b')](_0x4c2693)['json'](_0x5b2934);}};}function respondWithFilteredResult(_0x3c1b5b,_0x2b342c){return function(_0x48fb52){if(_0x48fb52){var _0x2163e6=_0x48fb52[_0xeabc('0x2d')],_0x38572d=_0x2b342c[_0xeabc('0x2e')],_0x2b568f=_0x2b342c[_0xeabc('0x2e')]+_0x2b342c[_0xeabc('0x2f')],_0x2f8633;if(_0x2b568f>=_0x2163e6){_0x2b568f=_0x2163e6;_0x2f8633=0xc8;}else{_0x2f8633=0xce;}_0x3c1b5b[_0xeabc('0x2b')](_0x2f8633);return _0x3c1b5b['set'](_0xeabc('0x30'),_0x38572d+'-'+_0x2b568f+'/'+_0x2163e6)['json'](_0x48fb52);}return null;};}function patchUpdates(_0x2f03e8){return function(_0x2d027e){try{jsonpatch[_0xeabc('0x31')](_0x2d027e,_0x2f03e8,!![]);}catch(_0x3c606a){return BPromise[_0xeabc('0x32')](_0x3c606a);}return _0x2d027e[_0xeabc('0x33')]();};}function saveUpdates(_0x61c0af,_0x545d7f){return function(_0x78510a){if(_0x78510a){return _0x78510a[_0xeabc('0x34')](_0x61c0af)[_0xeabc('0x1f')](function(_0x4918e2){return _0x4918e2;});}return null;};}function removeEntity(_0x1e74ca,_0x3777c1){return function(_0x4492fd){if(_0x4492fd){return _0x4492fd['destroy']()[_0xeabc('0x1f')](function(){_0x1e74ca[_0xeabc('0x2b')](0xcc)[_0xeabc('0x2c')]();});}};}function handleEntityNotFound(_0x521091,_0xf98c7c){return function(_0x286203){if(!_0x286203){_0x521091['sendStatus'](0x194);}return _0x286203;};}function handleError(_0x50cca2,_0x254568){_0x254568=_0x254568||0x1f4;return function(_0x3829a9){logger['error'](_0x3829a9[_0xeabc('0x35')]);if(_0x3829a9[_0xeabc('0x36')]){delete _0x3829a9[_0xeabc('0x36')];}_0x50cca2[_0xeabc('0x2b')](_0x254568)[_0xeabc('0x37')](_0x3829a9);};}exports['index']=function(_0x353e48,_0x5b61fa){var _0x31ee7a={},_0x2bda29={},_0x311291={'count':0x0,'rows':[]};var _0x5b52c4=_['map'](db[_0xeabc('0x38')]['rawAttributes'],function(_0x113d5a){return{'name':_0x113d5a['fieldName'],'type':_0x113d5a['type']['key']};});_0x2bda29['model']=_[_0xeabc('0x39')](_0x5b52c4,'name');_0x2bda29[_0xeabc('0x3a')]=_[_0xeabc('0x3b')](_0x353e48['query']);_0x2bda29[_0xeabc('0x3c')]=_['intersection'](_0x2bda29[_0xeabc('0x3d')],_0x2bda29['query']);_0x31ee7a[_0xeabc('0x3e')]=_[_0xeabc('0x3f')](_0x2bda29[_0xeabc('0x3d')],qs['fields'](_0x353e48['query']['fields']));_0x31ee7a[_0xeabc('0x3e')]=_0x31ee7a[_0xeabc('0x3e')][_0xeabc('0x40')]?_0x31ee7a['attributes']:_0x2bda29['model'];if(!_0x353e48[_0xeabc('0x3a')][_0xeabc('0x41')]('nolimit')){_0x31ee7a[_0xeabc('0x2f')]=qs['limit'](_0x353e48[_0xeabc('0x3a')]['limit']);_0x31ee7a['offset']=qs['offset'](_0x353e48[_0xeabc('0x3a')][_0xeabc('0x2e')]);}_0x31ee7a[_0xeabc('0x42')]=qs[_0xeabc('0x43')](_0x353e48['query'][_0xeabc('0x43')]);_0x31ee7a['where']=qs[_0xeabc('0x3c')](_[_0xeabc('0x44')](_0x353e48[_0xeabc('0x3a')],_0x2bda29[_0xeabc('0x3c')]));if(_0x353e48[_0xeabc('0x3a')]['filter']){_0x31ee7a['where']=_[_0xeabc('0x45')](_0x31ee7a['where'],{'$or':_[_0xeabc('0x39')](_0x5b52c4,function(_0x2cdf59){if(_0x2cdf59['type']!==_0xeabc('0x46')){var _0x2b3c28={};_0x2b3c28[_0x2cdf59[_0xeabc('0x36')]]={'$like':'%'+_0x353e48[_0xeabc('0x3a')][_0xeabc('0x47')]+'%'};return _0x2b3c28;}})});}_0x31ee7a=_[_0xeabc('0x45')]({},_0x31ee7a,_0x353e48[_0xeabc('0x48')]);var _0x4b2fb6={'where':_0x31ee7a[_0xeabc('0x49')]};return db[_0xeabc('0x38')][_0xeabc('0x2d')](_0x4b2fb6)[_0xeabc('0x1f')](function(_0x271f8c){_0x311291[_0xeabc('0x2d')]=_0x271f8c;if(_0x353e48[_0xeabc('0x3a')][_0xeabc('0x4a')]){_0x31ee7a[_0xeabc('0x4b')]=[{'all':!![]}];}return db[_0xeabc('0x38')]['findAll'](_0x31ee7a);})[_0xeabc('0x1f')](function(_0x2e6efb){_0x311291[_0xeabc('0x4c')]=_0x2e6efb;return _0x311291;})[_0xeabc('0x1f')](respondWithFilteredResult(_0x5b61fa,_0x31ee7a))[_0xeabc('0x29')](handleError(_0x5b61fa,null));};exports[_0xeabc('0x4d')]=function(_0x268d95,_0x48df43){var _0x766743={'raw':![],'where':{'id':_0x268d95[_0xeabc('0x4e')]['id']}},_0x32e09b={};_0x32e09b[_0xeabc('0x3d')]=_[_0xeabc('0x3b')](db['SalesforceAccount'][_0xeabc('0x4f')]);_0x32e09b[_0xeabc('0x3a')]=_[_0xeabc('0x3b')](_0x268d95[_0xeabc('0x3a')]);_0x32e09b['filters']=_[_0xeabc('0x3f')](_0x32e09b[_0xeabc('0x3d')],_0x32e09b['query']);_0x766743[_0xeabc('0x3e')]=_['intersection'](_0x32e09b[_0xeabc('0x3d')],qs['fields'](_0x268d95[_0xeabc('0x3a')][_0xeabc('0x50')]));_0x766743[_0xeabc('0x3e')]=_0x766743[_0xeabc('0x3e')][_0xeabc('0x40')]?_0x766743[_0xeabc('0x3e')]:_0x32e09b[_0xeabc('0x3d')];if(_0x268d95[_0xeabc('0x3a')][_0xeabc('0x4a')]){_0x766743[_0xeabc('0x4b')]=[{'all':!![]}];}_0x766743=_['merge']({},_0x766743,_0x268d95[_0xeabc('0x48')]);return db[_0xeabc('0x38')][_0xeabc('0x51')](_0x766743)[_0xeabc('0x1f')](handleEntityNotFound(_0x48df43,null))['then'](respondWithResult(_0x48df43,null))[_0xeabc('0x29')](handleError(_0x48df43,null));};exports[_0xeabc('0x52')]=function(_0x10d56f,_0x21f972){return db['SalesforceAccount'][_0xeabc('0x52')](_0x10d56f[_0xeabc('0x53')],{})[_0xeabc('0x1f')](respondWithResult(_0x21f972,0xc9))[_0xeabc('0x29')](handleError(_0x21f972,null));};exports[_0xeabc('0x34')]=function(_0x3b5e94,_0x14c322){if(_0x3b5e94[_0xeabc('0x53')]['id']){delete _0x3b5e94[_0xeabc('0x53')]['id'];}return db['SalesforceAccount'][_0xeabc('0x51')]({'where':{'id':_0x3b5e94['params']['id']}})['then'](handleEntityNotFound(_0x14c322,null))['then'](saveUpdates(_0x3b5e94[_0xeabc('0x53')],null))[_0xeabc('0x1f')](respondWithResult(_0x14c322,null))[_0xeabc('0x29')](handleError(_0x14c322,null));};exports[_0xeabc('0x54')]=function(_0xe89728,_0x2f78f3){return db['SalesforceAccount'][_0xeabc('0x51')]({'where':{'id':_0xe89728[_0xeabc('0x4e')]['id']}})[_0xeabc('0x1f')](handleEntityNotFound(_0x2f78f3,null))[_0xeabc('0x1f')](removeEntity(_0x2f78f3,null))[_0xeabc('0x29')](handleError(_0x2f78f3,null));};exports[_0xeabc('0x55')]=function(_0x1750e9,_0x25c728,_0x5820ca){var _0x5b8370={};var _0x180e62={};var _0x340520;var _0x2c0894;return db['SalesforceAccount'][_0xeabc('0x56')]({'where':{'id':_0x1750e9['params']['id']}})['then'](handleEntityNotFound(_0x25c728,null))[_0xeabc('0x1f')](function(_0x1fca99){if(_0x1fca99){_0x340520=_0x1fca99;_0x180e62[_0xeabc('0x3d')]=_[_0xeabc('0x3b')](db[_0xeabc('0x57')][_0xeabc('0x4f')]);_0x180e62['query']=_[_0xeabc('0x3b')](_0x1750e9[_0xeabc('0x3a')]);_0x180e62[_0xeabc('0x3c')]=_[_0xeabc('0x3f')](_0x180e62[_0xeabc('0x3d')],_0x180e62[_0xeabc('0x3a')]);_0x5b8370['attributes']=_[_0xeabc('0x3f')](_0x180e62[_0xeabc('0x3d')],qs[_0xeabc('0x50')](_0x1750e9[_0xeabc('0x3a')][_0xeabc('0x50')]));_0x5b8370[_0xeabc('0x3e')]=_0x5b8370[_0xeabc('0x3e')][_0xeabc('0x40')]?_0x5b8370[_0xeabc('0x3e')]:_0x180e62['model'];_0x5b8370[_0xeabc('0x42')]=qs['sort'](_0x1750e9[_0xeabc('0x3a')][_0xeabc('0x43')]);_0x5b8370[_0xeabc('0x49')]=qs[_0xeabc('0x3c')](_[_0xeabc('0x44')](_0x1750e9[_0xeabc('0x3a')],_0x180e62[_0xeabc('0x3c')]));if(_0x1750e9[_0xeabc('0x3a')][_0xeabc('0x47')]){_0x5b8370[_0xeabc('0x49')]=_['merge'](_0x5b8370[_0xeabc('0x49')],{'$or':_[_0xeabc('0x39')](_0x5b8370[_0xeabc('0x3e')],function(_0x41cad5){var _0x5b4430={};_0x5b4430[_0x41cad5]={'$like':'%'+_0x1750e9[_0xeabc('0x3a')]['filter']+'%'};return _0x5b4430;})});}_0x5b8370=_['merge']({},_0x5b8370,_0x1750e9[_0xeabc('0x48')]);return _0x340520[_0xeabc('0x55')](_0x5b8370);}})[_0xeabc('0x1f')](function(_0x1c91e4){if(_0x1c91e4){_0x2c0894=_0x1c91e4['length'];if(!_0x1750e9['query'][_0xeabc('0x41')]('nolimit')){_0x5b8370['limit']=qs[_0xeabc('0x2f')](_0x1750e9['query']['limit']);_0x5b8370[_0xeabc('0x2e')]=qs[_0xeabc('0x2e')](_0x1750e9['query']['offset']);}return _0x340520[_0xeabc('0x55')](_0x5b8370);}})['then'](function(_0x238e2d){if(_0x238e2d){return _0x238e2d?{'count':_0x2c0894,'rows':_0x238e2d}:null;}})[_0xeabc('0x1f')](respondWithResult(_0x25c728,null))['catch'](handleError(_0x25c728,null));};exports['addConfiguration']=function(_0x24365a,_0x74f5ac,_0xd86ea7){if(_0x24365a[_0xeabc('0x53')]['id']){delete _0x24365a[_0xeabc('0x53')]['id'];}return db['SalesforceAccount']['findOne']({'where':{'id':_0x24365a[_0xeabc('0x4e')]['id']}})['then'](handleEntityNotFound(_0x74f5ac,null))[_0xeabc('0x1f')](function(_0x5086c6){if(_0x5086c6){_0x24365a[_0xeabc('0x53')]['AccountId']=_0x5086c6['id'];_0x24365a[_0xeabc('0x53')]['Subjects']=integrations[_0xeabc('0x58')](_0x24365a[_0xeabc('0x53')][_0xeabc('0x59')],_0x24365a[_0xeabc('0x53')]['type']);_0x24365a[_0xeabc('0x53')]['Descriptions']=integrations[_0xeabc('0x5a')](_0x24365a[_0xeabc('0x53')][_0xeabc('0x59')],_0x24365a[_0xeabc('0x53')][_0xeabc('0x5b')]);return db['SalesforceConfiguration'][_0xeabc('0x52')](_0x24365a[_0xeabc('0x53')],{'include':[{'model':db[_0xeabc('0x5c')],'as':_0xeabc('0x5d')},{'model':db['SalesforceField'],'as':_0xeabc('0x5e')}]});}return null;})[_0xeabc('0x1f')](respondWithResult(_0x74f5ac,null))[_0xeabc('0x29')](handleError(_0x74f5ac,null));};exports[_0xeabc('0x5f')]=function(_0x5bacbb,_0xb9b460,_0x368cd4){var _0x287f88;var _0x460520='';var _0x485040='Task';return db[_0xeabc('0x38')]['findOne']({'where':{'id':_0x5bacbb['params']['id']},'attributes':['id',_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),'username',_0xeabc('0x63'),_0xeabc('0x64')]})['then'](handleEntityNotFound(_0xb9b460,null))[_0xeabc('0x1f')](function(_0x3ddce7){if(_0x3ddce7){_0x460520=_0x3ddce7[_0xeabc('0x60')];var _0x22af87=_0x460520[_0xeabc('0x65')](-0x1);if(_0x22af87==='/'){_0x460520=_0x460520['substring'](0x0,_0x460520[_0xeabc('0x66')](_0x22af87));}_0x287f88=new jsforce['Connection']({'oauth2':{'loginUrl':_0x460520,'clientId':_0x3ddce7['clientId'],'clientSecret':_0x3ddce7['clientSecret']}});return _0x287f88[_0xeabc('0x67')](_0x3ddce7[_0xeabc('0x68')],_0x3ddce7[_0xeabc('0x63')][_0xeabc('0x69')](_0x3ddce7[_0xeabc('0x64')]));}})['then'](function(_0x39f961){if(_0x39f961){if(!_['isNil'](_0x5bacbb[_0xeabc('0x3a')][_0xeabc('0x6a')])){_0x485040=_0x5bacbb['query'][_0xeabc('0x6a')];}return _0x287f88['sobject'](_0x485040)['describe']();}})[_0xeabc('0x1f')](function(_0xa5c4ca){var _0x439a48=[_0xeabc('0x6b'),_0xeabc('0x6c'),'CallObject',_0xeabc('0x6d'),_0xeabc('0x6e'),_0xeabc('0x6f'),_0xeabc('0x70'),_0xeabc('0x71')];if(!_[_0xeabc('0x72')](_0x5bacbb[_0xeabc('0x3a')][_0xeabc('0x6a')])&&_0x5bacbb[_0xeabc('0x3a')][_0xeabc('0x6a')]==='Case'){_0x439a48=[_0xeabc('0x71'),_0xeabc('0x73'),_0xeabc('0x74'),'Status','Priority',_0xeabc('0x75'),_0xeabc('0x76'),_0xeabc('0x77')];}if(_0xa5c4ca){_[_0xeabc('0x78')](_0xa5c4ca[_0xeabc('0x50')],function(_0x5f5a47){return _0x5f5a47[_0xeabc('0x79')]===![]&&!_0x439a48['includes'](_0x5f5a47['name']);});return{'count':_0xa5c4ca[_0xeabc('0x50')][_0xeabc('0x40')],'rows':_['map'](_0xa5c4ca[_0xeabc('0x50')],function(_0x45c9c7){return{'id':_0x45c9c7[_0xeabc('0x36')],'name':_0x45c9c7[_0xeabc('0x7a')],'custom':_0x45c9c7[_0xeabc('0x79')],'options':_0x45c9c7[_0xeabc('0x7b')][_0xeabc('0x40')]>0x0?_[_0xeabc('0x39')](_0x45c9c7[_0xeabc('0x7b')],function(_0x1b0995){return{'name':_0x1b0995[_0xeabc('0x7a')],'value':_0x1b0995['value']};}):_0x45c9c7[_0xeabc('0x5b')]=='boolean'?[{'name':_0xeabc('0x7c'),'value':_0xeabc('0x7d')},{'name':_0xeabc('0x7e'),'value':_0xeabc('0x7f')}]:[]};})};}})[_0xeabc('0x1f')](respondWithResult(_0xb9b460,null))[_0xeabc('0x29')](function(_0x40f51e){var _0x22d2f1=_0x5bacbb[_0xeabc('0x3a')][_0xeabc('0x80')]?0x1f4:_0x40f51e[_0xeabc('0x81')]||0x1f4;logger['error'](_0xeabc('0x82'),_0xeabc('0x5f'),_0x22d2f1,JSON[_0xeabc('0x83')](_0x40f51e));delete _0x40f51e[_0xeabc('0x36')];if(_0x22d2f1===0x191){_0x22d2f1=0x190;}_0xb9b460['status'](_0x22d2f1)[_0xeabc('0x37')](_0x5bacbb[_0xeabc('0x3a')]['test']?{'message':_0xeabc('0x84'),'statusCode':_0x40f51e[_0xeabc('0x81')]}:_0x40f51e);});}; \ No newline at end of file +var _0x5fab=['error','code','message','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','end','name','index','map','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','includeAll','include','SalesforceAccount','findAll','rows','catch','show','rawAttributes','options','find','create','body','update','params','destroy','findOne','SalesforceConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','SalesforceField','getFields','Task','clientId','username','password','remoteUri','slice','substring','lastIndexOf','clientSecret','login','isNil','ticketType','sobject','CallDisposition','CallObject','IsArchived','Priority','Case','Type','Origin','Reason','Status','IsEscalated','SuppliedName','custom','includes','label','picklistValues','value','boolean','True','true','False','false','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','statusCode','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x143ff5,_0x4b61ee){var _0x3c1c47=function(_0x4074e1){while(--_0x4074e1){_0x143ff5['push'](_0x143ff5['shift']());}};_0x3c1c47(++_0x4b61ee);}(_0x5fab,0x177));var _0xb5fa=function(_0x3f8759,_0x3fe6fb){_0x3f8759=_0x3f8759-0x0;var _0x2d33ca=_0x5fab[_0x3f8759];return _0x2d33ca;};'use strict';var pdf=require(_0xb5fa('0x0'));var emlformat=require(_0xb5fa('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb5fa('0x2'));var jsonpatch=require(_0xb5fa('0x3'));var rp=require(_0xb5fa('0x4'));var moment=require(_0xb5fa('0x5'));var BPromise=require(_0xb5fa('0x6'));var Mustache=require(_0xb5fa('0x7'));var util=require(_0xb5fa('0x8'));var path=require(_0xb5fa('0x9'));var sox=require(_0xb5fa('0xa'));var csv=require(_0xb5fa('0xb'));var ejs=require('ejs');var fs=require('fs');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('0xb'));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 db=require(_0xb5fa('0x18'))['db'];var integrations=require(_0xb5fa('0x19'));var jayson=require('jayson/promise');var client=jayson[_0xb5fa('0x1a')][_0xb5fa('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x56e8b0,_0x116849,_0x577af0){if(_0x577af0){var _0x265992=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x265992[_0xb5fa('0x1c')](_0x116849)){return _0x56e8b0;}else{throw new db[(_0xb5fa('0x1d'))][(_0xb5fa('0x1e'))](_0xb5fa('0x1f'));}}else{return _0x56e8b0;}}function respondWithRpcPromise(_0x5371cf,_0x567f31,_0x38e964,_0x587043){return new BPromise(function(_0x31f252,_0x27c8f7){var _0x56fe10=_0x587043||client;return _0x56fe10['request'](_0x5371cf,_0x38e964)[_0xb5fa('0x20')](function(_0x1f7f05){logger[_0xb5fa('0x21')](_0xb5fa('0x22'),_0x567f31,_0xb5fa('0x23'));logger[_0xb5fa('0x24')](_0xb5fa('0x25'),_0x567f31,_0xb5fa('0x23'),JSON[_0xb5fa('0x26')](_0x1f7f05));if(_0x1f7f05[_0xb5fa('0x27')]){if(_0x1f7f05[_0xb5fa('0x27')][_0xb5fa('0x28')]===0x1f4){logger['error'](_0xb5fa('0x22'),_0x567f31,_0x1f7f05['error'][_0xb5fa('0x29')]);return _0x27c8f7(_0x1f7f05['error'][_0xb5fa('0x29')]);}logger[_0xb5fa('0x27')]('SalesforceAccount,\x20%s,\x20%s',_0x567f31,_0x1f7f05[_0xb5fa('0x27')][_0xb5fa('0x29')]);return _0x31f252(_0x1f7f05[_0xb5fa('0x27')]['message']);}else{logger[_0xb5fa('0x21')](_0xb5fa('0x22'),_0x567f31,_0xb5fa('0x23'));_0x31f252(_0x1f7f05['result'][_0xb5fa('0x29')]);}})['catch'](function(_0x106c4b){logger[_0xb5fa('0x27')](_0xb5fa('0x22'),_0x567f31,_0x106c4b);_0x27c8f7(_0x106c4b);});});}function respondWithStatusCode(_0x543edf,_0x2dbd22){_0x2dbd22=_0x2dbd22||0xcc;return function(_0x3f61cd){if(_0x3f61cd){return _0x543edf[_0xb5fa('0x2a')](_0x2dbd22);}return _0x543edf[_0xb5fa('0x2b')](_0x2dbd22)['end']();};}function respondWithResult(_0x4ec294,_0x5bdf11){_0x5bdf11=_0x5bdf11||0xc8;return function(_0x5a1c39){if(_0x5a1c39){return _0x4ec294[_0xb5fa('0x2b')](_0x5bdf11)[_0xb5fa('0x2c')](_0x5a1c39);}};}function respondWithFilteredResult(_0x12c0d4,_0x2bdf50){return function(_0x534884){if(_0x534884){var _0x3506a4=_0x534884[_0xb5fa('0x2d')],_0x358549=_0x2bdf50[_0xb5fa('0x2e')],_0x353314=_0x2bdf50[_0xb5fa('0x2e')]+_0x2bdf50[_0xb5fa('0x2f')],_0x409af9;if(_0x353314>=_0x3506a4){_0x353314=_0x3506a4;_0x409af9=0xc8;}else{_0x409af9=0xce;}_0x12c0d4[_0xb5fa('0x2b')](_0x409af9);return _0x12c0d4[_0xb5fa('0x30')](_0xb5fa('0x31'),_0x358549+'-'+_0x353314+'/'+_0x3506a4)[_0xb5fa('0x2c')](_0x534884);}return null;};}function patchUpdates(_0x3fd1fb){return function(_0x21fc7e){try{jsonpatch[_0xb5fa('0x32')](_0x21fc7e,_0x3fd1fb,!![]);}catch(_0x291938){return BPromise[_0xb5fa('0x33')](_0x291938);}return _0x21fc7e[_0xb5fa('0x34')]();};}function saveUpdates(_0x25fc7c,_0x4cba5a){return function(_0x2cc6cb){if(_0x2cc6cb){return _0x2cc6cb['update'](_0x25fc7c)['then'](function(_0x558708){return _0x558708;});}return null;};}function removeEntity(_0x1e6ba0,_0x502d57){return function(_0x3bb4de){if(_0x3bb4de){return _0x3bb4de['destroy']()['then'](function(){_0x1e6ba0[_0xb5fa('0x2b')](0xcc)[_0xb5fa('0x35')]();});}};}function handleEntityNotFound(_0x4a4bff,_0x59f41d){return function(_0x3d73c2){if(!_0x3d73c2){_0x4a4bff[_0xb5fa('0x2a')](0x194);}return _0x3d73c2;};}function handleError(_0x252421,_0x560b53){_0x560b53=_0x560b53||0x1f4;return function(_0xc9adee){logger[_0xb5fa('0x27')](_0xc9adee['stack']);if(_0xc9adee[_0xb5fa('0x36')]){delete _0xc9adee[_0xb5fa('0x36')];}_0x252421[_0xb5fa('0x2b')](_0x560b53)['send'](_0xc9adee);};}exports[_0xb5fa('0x37')]=function(_0x2c950e,_0x24ef11){var _0x55bdb7={},_0x117694={},_0x1c818f={'count':0x0,'rows':[]};var _0x1a4697=_[_0xb5fa('0x38')](db['SalesforceAccount']['rawAttributes'],function(_0x4901ad){return{'name':_0x4901ad['fieldName'],'type':_0x4901ad['type']['key']};});_0x117694[_0xb5fa('0x39')]=_['map'](_0x1a4697,_0xb5fa('0x36'));_0x117694[_0xb5fa('0x3a')]=_[_0xb5fa('0x3b')](_0x2c950e[_0xb5fa('0x3a')]);_0x117694[_0xb5fa('0x3c')]=_[_0xb5fa('0x3d')](_0x117694['model'],_0x117694['query']);_0x55bdb7['attributes']=_[_0xb5fa('0x3d')](_0x117694['model'],qs[_0xb5fa('0x3e')](_0x2c950e['query']['fields']));_0x55bdb7[_0xb5fa('0x3f')]=_0x55bdb7[_0xb5fa('0x3f')][_0xb5fa('0x40')]?_0x55bdb7[_0xb5fa('0x3f')]:_0x117694[_0xb5fa('0x39')];if(!_0x2c950e[_0xb5fa('0x3a')][_0xb5fa('0x41')](_0xb5fa('0x42'))){_0x55bdb7[_0xb5fa('0x2f')]=qs[_0xb5fa('0x2f')](_0x2c950e['query'][_0xb5fa('0x2f')]);_0x55bdb7['offset']=qs[_0xb5fa('0x2e')](_0x2c950e[_0xb5fa('0x3a')][_0xb5fa('0x2e')]);}_0x55bdb7[_0xb5fa('0x43')]=qs[_0xb5fa('0x44')](_0x2c950e[_0xb5fa('0x3a')][_0xb5fa('0x44')]);_0x55bdb7[_0xb5fa('0x45')]=qs['filters'](_[_0xb5fa('0x46')](_0x2c950e[_0xb5fa('0x3a')],_0x117694['filters']));if(_0x2c950e[_0xb5fa('0x3a')]['filter']){_0x55bdb7[_0xb5fa('0x45')]=_[_0xb5fa('0x47')](_0x55bdb7['where'],{'$or':_['map'](_0x1a4697,function(_0x2db269){if(_0x2db269[_0xb5fa('0x48')]!==_0xb5fa('0x49')){var _0x19e662={};_0x19e662[_0x2db269[_0xb5fa('0x36')]]={'$like':'%'+_0x2c950e[_0xb5fa('0x3a')][_0xb5fa('0x4a')]+'%'};return _0x19e662;}})});}_0x55bdb7=_[_0xb5fa('0x47')]({},_0x55bdb7,_0x2c950e['options']);var _0x13bf04={'where':_0x55bdb7[_0xb5fa('0x45')]};return db['SalesforceAccount'][_0xb5fa('0x2d')](_0x13bf04)[_0xb5fa('0x20')](function(_0x247999){_0x1c818f[_0xb5fa('0x2d')]=_0x247999;if(_0x2c950e[_0xb5fa('0x3a')][_0xb5fa('0x4b')]){_0x55bdb7[_0xb5fa('0x4c')]=[{'all':!![]}];}return db[_0xb5fa('0x4d')][_0xb5fa('0x4e')](_0x55bdb7);})[_0xb5fa('0x20')](function(_0xfe091){_0x1c818f[_0xb5fa('0x4f')]=_0xfe091;return _0x1c818f;})[_0xb5fa('0x20')](respondWithFilteredResult(_0x24ef11,_0x55bdb7))[_0xb5fa('0x50')](handleError(_0x24ef11,null));};exports[_0xb5fa('0x51')]=function(_0x3a39f2,_0x52f5d8){var _0x56dceb={'raw':![],'where':{'id':_0x3a39f2['params']['id']}},_0x46194d={};_0x46194d[_0xb5fa('0x39')]=_[_0xb5fa('0x3b')](db['SalesforceAccount'][_0xb5fa('0x52')]);_0x46194d[_0xb5fa('0x3a')]=_[_0xb5fa('0x3b')](_0x3a39f2[_0xb5fa('0x3a')]);_0x46194d[_0xb5fa('0x3c')]=_[_0xb5fa('0x3d')](_0x46194d['model'],_0x46194d[_0xb5fa('0x3a')]);_0x56dceb['attributes']=_[_0xb5fa('0x3d')](_0x46194d[_0xb5fa('0x39')],qs[_0xb5fa('0x3e')](_0x3a39f2['query'][_0xb5fa('0x3e')]));_0x56dceb[_0xb5fa('0x3f')]=_0x56dceb['attributes']['length']?_0x56dceb[_0xb5fa('0x3f')]:_0x46194d[_0xb5fa('0x39')];if(_0x3a39f2[_0xb5fa('0x3a')][_0xb5fa('0x4b')]){_0x56dceb[_0xb5fa('0x4c')]=[{'all':!![]}];}_0x56dceb=_[_0xb5fa('0x47')]({},_0x56dceb,_0x3a39f2[_0xb5fa('0x53')]);return db[_0xb5fa('0x4d')][_0xb5fa('0x54')](_0x56dceb)[_0xb5fa('0x20')](handleEntityNotFound(_0x52f5d8,null))[_0xb5fa('0x20')](respondWithResult(_0x52f5d8,null))[_0xb5fa('0x50')](handleError(_0x52f5d8,null));};exports[_0xb5fa('0x55')]=function(_0x2799e7,_0x23f235){return db[_0xb5fa('0x4d')][_0xb5fa('0x55')](_0x2799e7[_0xb5fa('0x56')],{})['then'](respondWithResult(_0x23f235,0xc9))[_0xb5fa('0x50')](handleError(_0x23f235,null));};exports[_0xb5fa('0x57')]=function(_0x222016,_0xd8d0ab){if(_0x222016[_0xb5fa('0x56')]['id']){delete _0x222016[_0xb5fa('0x56')]['id'];}return db[_0xb5fa('0x4d')][_0xb5fa('0x54')]({'where':{'id':_0x222016[_0xb5fa('0x58')]['id']}})[_0xb5fa('0x20')](handleEntityNotFound(_0xd8d0ab,null))['then'](saveUpdates(_0x222016['body'],null))[_0xb5fa('0x20')](respondWithResult(_0xd8d0ab,null))[_0xb5fa('0x50')](handleError(_0xd8d0ab,null));};exports[_0xb5fa('0x59')]=function(_0x5caf84,_0x441c41){return db[_0xb5fa('0x4d')][_0xb5fa('0x54')]({'where':{'id':_0x5caf84[_0xb5fa('0x58')]['id']}})[_0xb5fa('0x20')](handleEntityNotFound(_0x441c41,null))[_0xb5fa('0x20')](removeEntity(_0x441c41,null))[_0xb5fa('0x50')](handleError(_0x441c41,null));};exports['getConfigurations']=function(_0x7bcd09,_0x4611f3,_0x4afc02){var _0x31e602={};var _0x26bc03={};var _0x540295;var _0xd94224;return db[_0xb5fa('0x4d')][_0xb5fa('0x5a')]({'where':{'id':_0x7bcd09[_0xb5fa('0x58')]['id']}})[_0xb5fa('0x20')](handleEntityNotFound(_0x4611f3,null))[_0xb5fa('0x20')](function(_0x18cde9){if(_0x18cde9){_0x540295=_0x18cde9;_0x26bc03[_0xb5fa('0x39')]=_[_0xb5fa('0x3b')](db[_0xb5fa('0x5b')][_0xb5fa('0x52')]);_0x26bc03[_0xb5fa('0x3a')]=_[_0xb5fa('0x3b')](_0x7bcd09[_0xb5fa('0x3a')]);_0x26bc03[_0xb5fa('0x3c')]=_[_0xb5fa('0x3d')](_0x26bc03[_0xb5fa('0x39')],_0x26bc03[_0xb5fa('0x3a')]);_0x31e602[_0xb5fa('0x3f')]=_[_0xb5fa('0x3d')](_0x26bc03[_0xb5fa('0x39')],qs[_0xb5fa('0x3e')](_0x7bcd09['query'][_0xb5fa('0x3e')]));_0x31e602[_0xb5fa('0x3f')]=_0x31e602[_0xb5fa('0x3f')]['length']?_0x31e602[_0xb5fa('0x3f')]:_0x26bc03[_0xb5fa('0x39')];_0x31e602['order']=qs[_0xb5fa('0x44')](_0x7bcd09[_0xb5fa('0x3a')][_0xb5fa('0x44')]);_0x31e602['where']=qs['filters'](_[_0xb5fa('0x46')](_0x7bcd09[_0xb5fa('0x3a')],_0x26bc03[_0xb5fa('0x3c')]));if(_0x7bcd09['query'][_0xb5fa('0x4a')]){_0x31e602[_0xb5fa('0x45')]=_[_0xb5fa('0x47')](_0x31e602[_0xb5fa('0x45')],{'$or':_['map'](_0x31e602['attributes'],function(_0x5cec07){var _0x2cbaba={};_0x2cbaba[_0x5cec07]={'$like':'%'+_0x7bcd09[_0xb5fa('0x3a')][_0xb5fa('0x4a')]+'%'};return _0x2cbaba;})});}_0x31e602=_['merge']({},_0x31e602,_0x7bcd09[_0xb5fa('0x53')]);return _0x540295[_0xb5fa('0x5c')](_0x31e602);}})[_0xb5fa('0x20')](function(_0x42a763){if(_0x42a763){_0xd94224=_0x42a763[_0xb5fa('0x40')];if(!_0x7bcd09[_0xb5fa('0x3a')][_0xb5fa('0x41')](_0xb5fa('0x42'))){_0x31e602[_0xb5fa('0x2f')]=qs[_0xb5fa('0x2f')](_0x7bcd09[_0xb5fa('0x3a')][_0xb5fa('0x2f')]);_0x31e602[_0xb5fa('0x2e')]=qs[_0xb5fa('0x2e')](_0x7bcd09[_0xb5fa('0x3a')]['offset']);}return _0x540295[_0xb5fa('0x5c')](_0x31e602);}})['then'](function(_0x47193c){if(_0x47193c){return _0x47193c?{'count':_0xd94224,'rows':_0x47193c}:null;}})[_0xb5fa('0x20')](respondWithResult(_0x4611f3,null))[_0xb5fa('0x50')](handleError(_0x4611f3,null));};exports[_0xb5fa('0x5d')]=function(_0x339dfb,_0x56e6b0,_0x1585cd){if(_0x339dfb['body']['id']){delete _0x339dfb[_0xb5fa('0x56')]['id'];}return db[_0xb5fa('0x4d')][_0xb5fa('0x5a')]({'where':{'id':_0x339dfb[_0xb5fa('0x58')]['id']}})['then'](handleEntityNotFound(_0x56e6b0,null))['then'](function(_0x59920c){if(_0x59920c){_0x339dfb[_0xb5fa('0x56')][_0xb5fa('0x5e')]=_0x59920c['id'];_0x339dfb[_0xb5fa('0x56')][_0xb5fa('0x5f')]=integrations[_0xb5fa('0x60')](_0x339dfb[_0xb5fa('0x56')]['channel'],_0x339dfb[_0xb5fa('0x56')]['type']);_0x339dfb['body'][_0xb5fa('0x61')]=integrations['getDescriptions'](_0x339dfb['body']['channel'],_0x339dfb[_0xb5fa('0x56')]['type']);return db[_0xb5fa('0x5b')][_0xb5fa('0x55')](_0x339dfb[_0xb5fa('0x56')],{'include':[{'model':db['SalesforceField'],'as':'Subjects'},{'model':db[_0xb5fa('0x62')],'as':_0xb5fa('0x61')}]});}return null;})['then'](respondWithResult(_0x56e6b0,null))[_0xb5fa('0x50')](handleError(_0x56e6b0,null));};exports[_0xb5fa('0x63')]=function(_0x244892,_0x2aaa2c,_0x4e6432){var _0x30c1e8;var _0x32a7a9='';var _0x29273a=_0xb5fa('0x64');return db[_0xb5fa('0x4d')][_0xb5fa('0x5a')]({'where':{'id':_0x244892[_0xb5fa('0x58')]['id']},'attributes':['id','remoteUri',_0xb5fa('0x65'),'clientSecret',_0xb5fa('0x66'),_0xb5fa('0x67'),'securityToken']})[_0xb5fa('0x20')](handleEntityNotFound(_0x2aaa2c,null))[_0xb5fa('0x20')](function(_0xdc4fe4){if(_0xdc4fe4){_0x32a7a9=_0xdc4fe4[_0xb5fa('0x68')];var _0x3034b0=_0x32a7a9[_0xb5fa('0x69')](-0x1);if(_0x3034b0==='/'){_0x32a7a9=_0x32a7a9[_0xb5fa('0x6a')](0x0,_0x32a7a9[_0xb5fa('0x6b')](_0x3034b0));}_0x30c1e8=new jsforce['Connection']({'oauth2':{'loginUrl':_0x32a7a9,'clientId':_0xdc4fe4[_0xb5fa('0x65')],'clientSecret':_0xdc4fe4[_0xb5fa('0x6c')]}});return _0x30c1e8[_0xb5fa('0x6d')](_0xdc4fe4[_0xb5fa('0x66')],_0xdc4fe4['password']['concat'](_0xdc4fe4['securityToken']));}})['then'](function(_0x1c60bd){if(_0x1c60bd){if(!_[_0xb5fa('0x6e')](_0x244892[_0xb5fa('0x3a')][_0xb5fa('0x6f')])){_0x29273a=_0x244892['query']['ticketType'];}return _0x30c1e8[_0xb5fa('0x70')](_0x29273a)['describe']();}})[_0xb5fa('0x20')](function(_0x35df3c){var _0x318001=[_0xb5fa('0x71'),'CallDurationInSeconds',_0xb5fa('0x72'),'CallType',_0xb5fa('0x73'),_0xb5fa('0x74'),'Status','Type'];if(!_[_0xb5fa('0x6e')](_0x244892[_0xb5fa('0x3a')][_0xb5fa('0x6f')])&&_0x244892[_0xb5fa('0x3a')][_0xb5fa('0x6f')]===_0xb5fa('0x75')){_0x318001=[_0xb5fa('0x76'),_0xb5fa('0x77'),_0xb5fa('0x78'),_0xb5fa('0x79'),_0xb5fa('0x74'),_0xb5fa('0x7a'),_0xb5fa('0x7b'),'SuppliedCompany'];}if(_0x35df3c){_['remove'](_0x35df3c[_0xb5fa('0x3e')],function(_0x52384b){return _0x52384b[_0xb5fa('0x7c')]===![]&&!_0x318001[_0xb5fa('0x7d')](_0x52384b['name']);});return{'count':_0x35df3c[_0xb5fa('0x3e')][_0xb5fa('0x40')],'rows':_['map'](_0x35df3c[_0xb5fa('0x3e')],function(_0x3ba1d0){return{'id':_0x3ba1d0['name'],'name':_0x3ba1d0[_0xb5fa('0x7e')],'custom':_0x3ba1d0[_0xb5fa('0x7c')],'options':_0x3ba1d0[_0xb5fa('0x7f')]['length']>0x0?_['map'](_0x3ba1d0[_0xb5fa('0x7f')],function(_0x1a24a2){return{'name':_0x1a24a2[_0xb5fa('0x7e')],'value':_0x1a24a2[_0xb5fa('0x80')]};}):_0x3ba1d0[_0xb5fa('0x48')]==_0xb5fa('0x81')?[{'name':_0xb5fa('0x82'),'value':_0xb5fa('0x83')},{'name':_0xb5fa('0x84'),'value':_0xb5fa('0x85')}]:[]};})};}})['then'](respondWithResult(_0x2aaa2c,null))['catch'](function(_0x3c5563){var _0x414507=_0x244892[_0xb5fa('0x3a')][_0xb5fa('0x1c')]?0x1f4:_0x3c5563['statusCode']||0x1f4;logger[_0xb5fa('0x27')](_0xb5fa('0x86'),_0xb5fa('0x63'),_0x414507,JSON['stringify'](_0x3c5563));delete _0x3c5563[_0xb5fa('0x36')];if(_0x414507===0x191){_0x414507=0x190;}_0x2aaa2c[_0xb5fa('0x2b')](_0x414507)[_0xb5fa('0x87')](_0x244892[_0xb5fa('0x3a')]['test']?{'message':_0xb5fa('0x88'),'statusCode':_0x3c5563[_0xb5fa('0x89')]}:_0x3c5563);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 65e5e40..aa4eee8 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 _0x5913=['bluebird','path','../../config/environment','../../components/integrations/configuration','exports','define','int_salesforce_accounts','lodash','util','moment'];(function(_0x31af2d,_0x2be07c){var _0x5e02e5=function(_0x22a8ee){while(--_0x22a8ee){_0x31af2d['push'](_0x31af2d['shift']());}};_0x5e02e5(++_0x2be07c);}(_0x5913,0x101));var _0x3591=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5913[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3591('0x0'));var util=require(_0x3591('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3591('0x2'));var BPromise=require(_0x3591('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3591('0x4'));var rimraf=require('rimraf');var config=require(_0x3591('0x5'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0x3591('0x6'));module[_0x3591('0x7')]=function(_0x6c76ac,_0x1ebb03){return _0x6c76ac[_0x3591('0x8')]('SalesforceAccount',attributes,{'tableName':_0x3591('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x97b7=['SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','request-promise','path','rimraf','../../components/integrations/configuration','exports'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x97b7,0x70));var _0x797b=function(_0x59d245,_0x3ff9c9){_0x59d245=_0x59d245-0x0;var _0x58e025=_0x97b7[_0x59d245];return _0x58e025;};'use strict';var _=require(_0x797b('0x0'));var util=require(_0x797b('0x1'));var logger=require(_0x797b('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x797b('0x3'));var fs=require('fs');var path=require(_0x797b('0x4'));var rimraf=require(_0x797b('0x5'));var config=require('../../config/environment');var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0x797b('0x6'));module[_0x797b('0x7')]=function(_0x38a5ad,_0x37d799){return _0x38a5ad['define'](_0x797b('0x8'),attributes,{'tableName':_0x797b('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 c2bcc7c..17a9ea4 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 _0x5c12=['request','then','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','message','info','options','raw','attributes','include','map','model','GetSalesforceAccount','catch','ShowSalesforceAccount','SalesforceAccount','stringify','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x8b04aa,_0x3f28a1){var _0x4d216d=function(_0x50c88e){while(--_0x50c88e){_0x8b04aa['push'](_0x8b04aa['shift']());}};_0x4d216d(++_0x3f28a1);}(_0x5c12,0x188));var _0x25c1=function(_0x2b2b33,_0x56606f){_0x2b2b33=_0x2b2b33-0x0;var _0x229157=_0x5c12[_0x2b2b33];return _0x229157;};'use strict';var _=require('lodash');var util=require(_0x25c1('0x0'));var moment=require(_0x25c1('0x1'));var BPromise=require('bluebird');var rs=require(_0x25c1('0x2'));var fs=require('fs');var Redis=require(_0x25c1('0x3'));var db=require(_0x25c1('0x4'))['db'];var utils=require(_0x25c1('0x5'));var logger=require(_0x25c1('0x6'))(_0x25c1('0x7'));var config=require(_0x25c1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x25c1('0x9')][_0x25c1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x382922,_0x4ab674,_0x5c69b1){return new BPromise(function(_0x24981c,_0x3b69ba){return client[_0x25c1('0xb')](_0x382922,_0x5c69b1)[_0x25c1('0xc')](function(_0xf8363f){logger['info'](_0x25c1('0xd'),_0x4ab674,_0x25c1('0xe'));logger[_0x25c1('0xf')](_0x25c1('0x10'),_0x4ab674,_0x25c1('0xe'),JSON['stringify'](_0xf8363f));if(_0xf8363f[_0x25c1('0x11')]){if(_0xf8363f[_0x25c1('0x11')]['code']===0x1f4){logger[_0x25c1('0x11')](_0x25c1('0xd'),_0x4ab674,_0xf8363f[_0x25c1('0x11')][_0x25c1('0x12')]);return _0x3b69ba(_0xf8363f['error']['message']);}logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x4ab674,_0xf8363f[_0x25c1('0x11')][_0x25c1('0x12')]);return _0x24981c(_0xf8363f[_0x25c1('0x11')][_0x25c1('0x12')]);}else{logger[_0x25c1('0x13')]('SalesforceAccount,\x20%s,\x20%s',_0x4ab674,_0x25c1('0xe'));_0x24981c(_0xf8363f['result']['message']);}})['catch'](function(_0x284712){logger[_0x25c1('0x11')]('SalesforceAccount,\x20%s,\x20%s',_0x4ab674,_0x284712);_0x3b69ba(_0x284712);});});}exports['GetSalesforceAccount']=function(_0x61a29f){var _0x4c0d49=this;return new Promise(function(_0x7175d4,_0x23a418){return db['SalesforceAccount']['findAll']({'raw':_0x61a29f['options']?_0x61a29f[_0x25c1('0x14')][_0x25c1('0x15')]===undefined?!![]:![]:!![],'where':_0x61a29f[_0x25c1('0x14')]?_0x61a29f[_0x25c1('0x14')]['where']||null:null,'attributes':_0x61a29f[_0x25c1('0x14')]?_0x61a29f[_0x25c1('0x14')][_0x25c1('0x16')]||null:null,'limit':_0x61a29f[_0x25c1('0x14')]?_0x61a29f['options']['limit']||null:null,'include':_0x61a29f[_0x25c1('0x14')]?_0x61a29f[_0x25c1('0x14')][_0x25c1('0x17')]?_[_0x25c1('0x18')](_0x61a29f[_0x25c1('0x14')][_0x25c1('0x17')],function(_0x2ba595){return{'model':db[_0x2ba595[_0x25c1('0x19')]],'as':_0x2ba595['as'],'attributes':_0x2ba595[_0x25c1('0x16')],'include':_0x2ba595[_0x25c1('0x17')]?_[_0x25c1('0x18')](_0x2ba595[_0x25c1('0x17')],function(_0x399d72){return{'model':db[_0x399d72['model']],'as':_0x399d72['as'],'attributes':_0x399d72[_0x25c1('0x16')],'include':_0x399d72[_0x25c1('0x17')]?_[_0x25c1('0x18')](_0x399d72[_0x25c1('0x17')],function(_0x21fdb8){return{'model':db[_0x21fdb8[_0x25c1('0x19')]],'as':_0x21fdb8['as'],'attributes':_0x21fdb8['attributes']};}):[]};}):[]};}):[]:[]})[_0x25c1('0xc')](function(_0x428ce8){logger[_0x25c1('0x13')](_0x25c1('0x1a'),_0x61a29f);logger[_0x25c1('0xf')](_0x25c1('0x1a'),_0x61a29f,JSON['stringify'](_0x428ce8));_0x7175d4(_0x428ce8);})[_0x25c1('0x1b')](function(_0x478f1e){logger[_0x25c1('0x11')](_0x25c1('0x1a'),_0x478f1e[_0x25c1('0x12')],_0x61a29f);_0x23a418(_0x4c0d49[_0x25c1('0x11')](0x1f4,_0x478f1e[_0x25c1('0x12')]));});});};exports[_0x25c1('0x1c')]=function(_0x1fd4e3){var _0x23f2f6=this;return new Promise(function(_0x402f32,_0x4d9882){return db[_0x25c1('0x1d')]['find']({'raw':_0x1fd4e3['options']?_0x1fd4e3[_0x25c1('0x14')][_0x25c1('0x15')]===undefined?!![]:![]:!![],'where':_0x1fd4e3['options']?_0x1fd4e3[_0x25c1('0x14')]['where']||null:null,'attributes':_0x1fd4e3[_0x25c1('0x14')]?_0x1fd4e3['options'][_0x25c1('0x16')]||null:null,'include':_0x1fd4e3[_0x25c1('0x14')]?_0x1fd4e3[_0x25c1('0x14')][_0x25c1('0x17')]?_[_0x25c1('0x18')](_0x1fd4e3[_0x25c1('0x14')][_0x25c1('0x17')],function(_0x167477){return{'model':db[_0x167477['model']],'as':_0x167477['as'],'attributes':_0x167477[_0x25c1('0x16')],'include':_0x167477['include']?_[_0x25c1('0x18')](_0x167477['include'],function(_0x439056){return{'model':db[_0x439056[_0x25c1('0x19')]],'as':_0x439056['as'],'attributes':_0x439056[_0x25c1('0x16')],'include':_0x439056[_0x25c1('0x17')]?_[_0x25c1('0x18')](_0x439056[_0x25c1('0x17')],function(_0x35e632){return{'model':db[_0x35e632[_0x25c1('0x19')]],'as':_0x35e632['as'],'attributes':_0x35e632[_0x25c1('0x16')]};}):[]};}):[]};}):[]:[]})[_0x25c1('0xc')](function(_0x26ed98){logger[_0x25c1('0x13')](_0x25c1('0x1c'),_0x1fd4e3);logger[_0x25c1('0xf')](_0x25c1('0x1c'),_0x1fd4e3,JSON[_0x25c1('0x1e')](_0x26ed98));_0x402f32(_0x26ed98);})[_0x25c1('0x1b')](function(_0x30b1d7){logger[_0x25c1('0x11')](_0x25c1('0x1c'),_0x30b1d7['message'],_0x1fd4e3);_0x4d9882(_0x23f2f6[_0x25c1('0x11')](0x1f4,_0x30b1d7[_0x25c1('0x12')]));});});}; \ No newline at end of file +var _0xa8a8=['../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code','SalesforceAccount,\x20%s,\x20%s','message','catch','SalesforceAccount','findAll','where','options','attributes','limit','include','map','model','ShowSalesforceAccount','raw','then','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x36e4dc,_0x4cc695){var _0x303297=function(_0x33f6e9){while(--_0x33f6e9){_0x36e4dc['push'](_0x36e4dc['shift']());}};_0x303297(++_0x4cc695);}(_0xa8a8,0xec));var _0x8a8a=function(_0x578e8a,_0x5b48af){_0x578e8a=_0x578e8a-0x0;var _0x3b1c26=_0xa8a8[_0x578e8a];return _0x3b1c26;};'use strict';var _=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var moment=require(_0x8a8a('0x2'));var BPromise=require(_0x8a8a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a8a('0x4'));var db=require(_0x8a8a('0x5'))['db'];var utils=require(_0x8a8a('0x6'));var logger=require(_0x8a8a('0x7'))(_0x8a8a('0x8'));var config=require(_0x8a8a('0x9'));var jayson=require(_0x8a8a('0xa'));var client=jayson[_0x8a8a('0xb')][_0x8a8a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x315fe9,_0x1d7121,_0x8e7aa0){return new BPromise(function(_0x4225b9,_0xecaa6f){return client[_0x8a8a('0xd')](_0x315fe9,_0x8e7aa0)['then'](function(_0x576ef9){logger[_0x8a8a('0xe')]('SalesforceAccount,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'));logger[_0x8a8a('0x10')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'),JSON[_0x8a8a('0x11')](_0x576ef9));if(_0x576ef9[_0x8a8a('0x12')]){if(_0x576ef9['error'][_0x8a8a('0x13')]===0x1f4){logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x576ef9[_0x8a8a('0x12')]['message']);return _0xecaa6f(_0x576ef9[_0x8a8a('0x12')]['message']);}logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x576ef9[_0x8a8a('0x12')][_0x8a8a('0x15')]);return _0x4225b9(_0x576ef9[_0x8a8a('0x12')][_0x8a8a('0x15')]);}else{logger[_0x8a8a('0xe')]('SalesforceAccount,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'));_0x4225b9(_0x576ef9['result'][_0x8a8a('0x15')]);}})[_0x8a8a('0x16')](function(_0x46a4f4){logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x46a4f4);_0xecaa6f(_0x46a4f4);});});}exports['GetSalesforceAccount']=function(_0x9d55f9){var _0x3d165c=this;return new Promise(function(_0x262ca9,_0x2bce13){return db[_0x8a8a('0x17')][_0x8a8a('0x18')]({'raw':_0x9d55f9['options']?_0x9d55f9['options']['raw']===undefined?!![]:![]:!![],'where':_0x9d55f9['options']?_0x9d55f9['options'][_0x8a8a('0x19')]||null:null,'attributes':_0x9d55f9[_0x8a8a('0x1a')]?_0x9d55f9[_0x8a8a('0x1a')][_0x8a8a('0x1b')]||null:null,'limit':_0x9d55f9[_0x8a8a('0x1a')]?_0x9d55f9[_0x8a8a('0x1a')][_0x8a8a('0x1c')]||null:null,'include':_0x9d55f9[_0x8a8a('0x1a')]?_0x9d55f9[_0x8a8a('0x1a')][_0x8a8a('0x1d')]?_[_0x8a8a('0x1e')](_0x9d55f9[_0x8a8a('0x1a')][_0x8a8a('0x1d')],function(_0x625c1b){return{'model':db[_0x625c1b[_0x8a8a('0x1f')]],'as':_0x625c1b['as'],'attributes':_0x625c1b['attributes'],'include':_0x625c1b[_0x8a8a('0x1d')]?_[_0x8a8a('0x1e')](_0x625c1b[_0x8a8a('0x1d')],function(_0x7662e){return{'model':db[_0x7662e[_0x8a8a('0x1f')]],'as':_0x7662e['as'],'attributes':_0x7662e[_0x8a8a('0x1b')],'include':_0x7662e[_0x8a8a('0x1d')]?_['map'](_0x7662e[_0x8a8a('0x1d')],function(_0x38c1e0){return{'model':db[_0x38c1e0[_0x8a8a('0x1f')]],'as':_0x38c1e0['as'],'attributes':_0x38c1e0['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2dafcd){logger[_0x8a8a('0xe')]('GetSalesforceAccount',_0x9d55f9);logger['debug']('GetSalesforceAccount',_0x9d55f9,JSON[_0x8a8a('0x11')](_0x2dafcd));_0x262ca9(_0x2dafcd);})['catch'](function(_0x10b916){logger[_0x8a8a('0x12')]('GetSalesforceAccount',_0x10b916[_0x8a8a('0x15')],_0x9d55f9);_0x2bce13(_0x3d165c[_0x8a8a('0x12')](0x1f4,_0x10b916[_0x8a8a('0x15')]));});});};exports[_0x8a8a('0x20')]=function(_0x41802e){var _0x3d6594=this;return new Promise(function(_0x3e73b1,_0x2a2917){return db['SalesforceAccount']['find']({'raw':_0x41802e['options']?_0x41802e[_0x8a8a('0x1a')][_0x8a8a('0x21')]===undefined?!![]:![]:!![],'where':_0x41802e['options']?_0x41802e[_0x8a8a('0x1a')][_0x8a8a('0x19')]||null:null,'attributes':_0x41802e['options']?_0x41802e[_0x8a8a('0x1a')][_0x8a8a('0x1b')]||null:null,'include':_0x41802e[_0x8a8a('0x1a')]?_0x41802e['options']['include']?_[_0x8a8a('0x1e')](_0x41802e['options'][_0x8a8a('0x1d')],function(_0x3a4aa6){return{'model':db[_0x3a4aa6[_0x8a8a('0x1f')]],'as':_0x3a4aa6['as'],'attributes':_0x3a4aa6[_0x8a8a('0x1b')],'include':_0x3a4aa6[_0x8a8a('0x1d')]?_[_0x8a8a('0x1e')](_0x3a4aa6[_0x8a8a('0x1d')],function(_0x389ad1){return{'model':db[_0x389ad1[_0x8a8a('0x1f')]],'as':_0x389ad1['as'],'attributes':_0x389ad1[_0x8a8a('0x1b')],'include':_0x389ad1[_0x8a8a('0x1d')]?_[_0x8a8a('0x1e')](_0x389ad1[_0x8a8a('0x1d')],function(_0x37e644){return{'model':db[_0x37e644[_0x8a8a('0x1f')]],'as':_0x37e644['as'],'attributes':_0x37e644[_0x8a8a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8a8a('0x22')](function(_0x29d187){logger['info']('ShowSalesforceAccount',_0x41802e);logger['debug'](_0x8a8a('0x20'),_0x41802e,JSON[_0x8a8a('0x11')](_0x29d187));_0x3e73b1(_0x29d187);})[_0x8a8a('0x16')](function(_0x117a5c){logger[_0x8a8a('0x12')]('ShowSalesforceAccount',_0x117a5c['message'],_0x41802e);_0x2a2917(_0x3d6594[_0x8a8a('0x12')](0x1f4,_0x117a5c['message']));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index d1303b0..de6d86e 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 _0x8cb4=['destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update'];(function(_0x33593e,_0x22ddd3){var _0x53db1a=function(_0x499ee5){while(--_0x499ee5){_0x33593e['push'](_0x33593e['shift']());}};_0x53db1a(++_0x22ddd3);}(_0x8cb4,0x65));var _0x48cb=function(_0x181b5b,_0x534cc9){_0x181b5b=_0x181b5b-0x0;var _0x2b78e8=_0x8cb4[_0x181b5b];return _0x2b78e8;};'use strict';var multer=require(_0x48cb('0x0'));var util=require('util');var path=require(_0x48cb('0x1'));var timeout=require(_0x48cb('0x2'));var express=require(_0x48cb('0x3'));var router=express[_0x48cb('0x4')]();var auth=require(_0x48cb('0x5'));var interaction=require(_0x48cb('0x6'));var config=require(_0x48cb('0x7'));var controller=require(_0x48cb('0x8'));router[_0x48cb('0x9')]('/',auth[_0x48cb('0xa')](),controller[_0x48cb('0xb')]);router[_0x48cb('0x9')](_0x48cb('0xc'),auth[_0x48cb('0xa')](),controller[_0x48cb('0xd')]);router[_0x48cb('0x9')](_0x48cb('0xe'),auth[_0x48cb('0xa')](),controller[_0x48cb('0xf')]);router[_0x48cb('0x9')](_0x48cb('0x10'),auth[_0x48cb('0xa')](),controller[_0x48cb('0x11')]);router['get'](_0x48cb('0x12'),auth[_0x48cb('0xa')](),controller[_0x48cb('0x13')]);router[_0x48cb('0x14')]('/',auth['isAuthenticated'](),controller[_0x48cb('0x15')]);router[_0x48cb('0x16')]('/:id',auth[_0x48cb('0xa')](),controller[_0x48cb('0x17')]);router['delete'](_0x48cb('0xc'),auth[_0x48cb('0xa')](),controller[_0x48cb('0x18')]);module['exports']=router; \ No newline at end of file +var _0x5078=['/:id/descriptions','post','put','/:id','delete','destroy','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','getFields','getSubjects'];(function(_0x4e8d75,_0x400022){var _0x3329d6=function(_0x11eb89){while(--_0x11eb89){_0x4e8d75['push'](_0x4e8d75['shift']());}};_0x3329d6(++_0x400022);}(_0x5078,0x114));var _0x8507=function(_0x49ffda,_0x45ae69){_0x49ffda=_0x49ffda-0x0;var _0x3960ea=_0x5078[_0x49ffda];return _0x3960ea;};'use strict';var multer=require('multer');var util=require(_0x8507('0x0'));var path=require(_0x8507('0x1'));var timeout=require(_0x8507('0x2'));var express=require(_0x8507('0x3'));var router=express[_0x8507('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x8507('0x5'));var config=require(_0x8507('0x6'));var controller=require(_0x8507('0x7'));router[_0x8507('0x8')]('/',auth[_0x8507('0x9')](),controller['index']);router[_0x8507('0x8')]('/:id',auth[_0x8507('0x9')](),controller['show']);router[_0x8507('0x8')]('/:id/fields',auth[_0x8507('0x9')](),controller[_0x8507('0xa')]);router[_0x8507('0x8')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x8507('0xb')]);router[_0x8507('0x8')](_0x8507('0xc'),auth[_0x8507('0x9')](),controller['getDescriptions']);router[_0x8507('0xd')]('/',auth[_0x8507('0x9')](),controller['create']);router[_0x8507('0xe')](_0x8507('0xf'),auth[_0x8507('0x9')](),controller['update']);router[_0x8507('0x10')]('/:id',auth[_0x8507('0x9')](),controller[_0x8507('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index d9446a4..04e5efb 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 _0xafca=['STRING','ENUM','Task','Case','contact_lead','contact','lead','nothing'];(function(_0x29f1b5,_0x19ac42){var _0x5bcfbd=function(_0x126629){while(--_0x126629){_0x29f1b5['push'](_0x29f1b5['shift']());}};_0x5bcfbd(++_0x19ac42);}(_0xafca,0xc8));var _0xaafc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xafca[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xaafc('0x0')]},'description':{'type':Sequelize[_0xaafc('0x0')]},'ticketType':{'type':Sequelize[_0xaafc('0x1')](_0xaafc('0x2'),_0xaafc('0x3')),'defaultValue':_0xaafc('0x2')},'moduleSearch':{'type':Sequelize[_0xaafc('0x1')](_0xaafc('0x4'),_0xaafc('0x5'),_0xaafc('0x6')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0xaafc('0x1')](_0xaafc('0x7'),'contact',_0xaafc('0x6')),'defaultValue':_0xaafc('0x6')}}; \ No newline at end of file +var _0xb421=['lead','nothing','contact','sequelize','exports','STRING','ENUM','Task','Case','contact_lead'];(function(_0x225ff2,_0x385660){var _0x351894=function(_0x3c9df6){while(--_0x3c9df6){_0x225ff2['push'](_0x225ff2['shift']());}};_0x351894(++_0x385660);}(_0xb421,0x125));var _0x1b42=function(_0x59f62a,_0x28dfa2){_0x59f62a=_0x59f62a-0x0;var _0x402f07=_0xb421[_0x59f62a];return _0x402f07;};'use strict';var Sequelize=require(_0x1b42('0x0'));module[_0x1b42('0x1')]={'name':{'type':Sequelize[_0x1b42('0x2')]},'description':{'type':Sequelize[_0x1b42('0x2')]},'ticketType':{'type':Sequelize[_0x1b42('0x3')](_0x1b42('0x4'),_0x1b42('0x5')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize['ENUM'](_0x1b42('0x6'),'contact',_0x1b42('0x7')),'defaultValue':_0x1b42('0x6')},'moduleCreate':{'type':Sequelize[_0x1b42('0x3')](_0x1b42('0x8'),_0x1b42('0x9'),'lead'),'defaultValue':_0x1b42('0x7')}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 4f4c230..dbd0dd7 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 _0xfcfd=['sort','pick','filter','where','merge','type','VIRTUAL','options','SalesforceConfiguration','count','includeAll','findAll','rows','show','params','keys','include','find','create','body','getFields','findOne','order','SalesforceField','getDescriptions','html-pdf','eml-format','rimraf','fast-json-patch','moment','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','client','http','test','Sequelize','ValidationError','request','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','message','catch','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','rawAttributes','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0xfcfd,0x74));var _0xdfcf=function(_0x351ad8,_0x4e83cb){_0x351ad8=_0x351ad8-0x0;var _0x6726de=_0xfcfd[_0x351ad8];return _0x6726de;};'use strict';var pdf=require(_0xdfcf('0x0'));var emlformat=require(_0xdfcf('0x1'));var rimraf=require(_0xdfcf('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdfcf('0x3'));var rp=require('request-promise');var moment=require(_0xdfcf('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdfcf('0x5'));var util=require('util');var path=require('path');var sox=require(_0xdfcf('0x6'));var csv=require(_0xdfcf('0x7'));var ejs=require(_0xdfcf('0x8'));var fs=require('fs');var _=require(_0xdfcf('0x9'));var squel=require(_0xdfcf('0xa'));var crypto=require(_0xdfcf('0xb'));var jsforce=require(_0xdfcf('0xc'));var deskjs=require(_0xdfcf('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdfcf('0xe'));var Papa=require(_0xdfcf('0xf'));var Redis=require('ioredis');var authService=require(_0xdfcf('0x10'));var qs=require(_0xdfcf('0x11'));var as=require(_0xdfcf('0x12'));var hardwareService=require(_0xdfcf('0x13'));var logger=require('../../config/logger')(_0xdfcf('0x14'));var utils=require(_0xdfcf('0x15'));var config=require(_0xdfcf('0x16'));var db=require(_0xdfcf('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xdfcf('0x18')][_0xdfcf('0x19')]({'port':0x232a});function checkPasswordPattern(_0x58c804,_0x5decec,_0x80bf01){if(_0x80bf01){var _0x319f09=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x319f09[_0xdfcf('0x1a')](_0x5decec)){return _0x58c804;}else{throw new db[(_0xdfcf('0x1b'))][(_0xdfcf('0x1c'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x58c804;}}function respondWithRpcPromise(_0x56379a,_0x225e1f,_0x54fc07,_0x1364b9){return new BPromise(function(_0x3d9c1b,_0xb6c841){var _0x1fe433=_0x1364b9||client;return _0x1fe433[_0xdfcf('0x1d')](_0x56379a,_0x54fc07)[_0xdfcf('0x1e')](function(_0x5c0f39){logger['info'](_0xdfcf('0x1f'),_0x225e1f,_0xdfcf('0x20'));logger[_0xdfcf('0x21')](_0xdfcf('0x22'),_0x225e1f,_0xdfcf('0x20'),JSON['stringify'](_0x5c0f39));if(_0x5c0f39[_0xdfcf('0x23')]){if(_0x5c0f39[_0xdfcf('0x23')]['code']===0x1f4){logger['error'](_0xdfcf('0x1f'),_0x225e1f,_0x5c0f39[_0xdfcf('0x23')][_0xdfcf('0x24')]);return _0xb6c841(_0x5c0f39[_0xdfcf('0x23')][_0xdfcf('0x24')]);}logger[_0xdfcf('0x23')](_0xdfcf('0x1f'),_0x225e1f,_0x5c0f39[_0xdfcf('0x23')][_0xdfcf('0x24')]);return _0x3d9c1b(_0x5c0f39[_0xdfcf('0x23')]['message']);}else{logger['info'](_0xdfcf('0x1f'),_0x225e1f,_0xdfcf('0x20'));_0x3d9c1b(_0x5c0f39['result'][_0xdfcf('0x24')]);}})[_0xdfcf('0x25')](function(_0xcae80f){logger[_0xdfcf('0x23')]('SalesforceConfiguration,\x20%s,\x20%s',_0x225e1f,_0xcae80f);_0xb6c841(_0xcae80f);});});}function respondWithStatusCode(_0x28b2c0,_0x4cd4a6){_0x4cd4a6=_0x4cd4a6||0xcc;return function(_0x261f48){if(_0x261f48){return _0x28b2c0[_0xdfcf('0x26')](_0x4cd4a6);}return _0x28b2c0['status'](_0x4cd4a6)[_0xdfcf('0x27')]();};}function respondWithResult(_0x3ac8c5,_0x186059){_0x186059=_0x186059||0xc8;return function(_0x1baf88){if(_0x1baf88){return _0x3ac8c5[_0xdfcf('0x28')](_0x186059)[_0xdfcf('0x29')](_0x1baf88);}};}function respondWithFilteredResult(_0x71135e,_0x29a0e4){return function(_0x9422a6){if(_0x9422a6){var _0x1af491=_0x9422a6['count'],_0x36e89c=_0x29a0e4['offset'],_0x58a79c=_0x29a0e4[_0xdfcf('0x2a')]+_0x29a0e4[_0xdfcf('0x2b')],_0x54698e;if(_0x58a79c>=_0x1af491){_0x58a79c=_0x1af491;_0x54698e=0xc8;}else{_0x54698e=0xce;}_0x71135e[_0xdfcf('0x28')](_0x54698e);return _0x71135e[_0xdfcf('0x2c')](_0xdfcf('0x2d'),_0x36e89c+'-'+_0x58a79c+'/'+_0x1af491)['json'](_0x9422a6);}return null;};}function patchUpdates(_0x2d2330){return function(_0x6a7e0f){try{jsonpatch[_0xdfcf('0x2e')](_0x6a7e0f,_0x2d2330,!![]);}catch(_0x45383d){return BPromise[_0xdfcf('0x2f')](_0x45383d);}return _0x6a7e0f[_0xdfcf('0x30')]();};}function saveUpdates(_0x27acf1,_0x19e9ff){return function(_0x2b76d6){if(_0x2b76d6){return _0x2b76d6[_0xdfcf('0x31')](_0x27acf1)['then'](function(_0x5dc779){return _0x5dc779;});}return null;};}function removeEntity(_0x43bbe8,_0x1e35e0){return function(_0x3c0755){if(_0x3c0755){return _0x3c0755[_0xdfcf('0x32')]()[_0xdfcf('0x1e')](function(){_0x43bbe8['status'](0xcc)[_0xdfcf('0x27')]();});}};}function handleEntityNotFound(_0x234323,_0x59bf42){return function(_0x5069a6){if(!_0x5069a6){_0x234323[_0xdfcf('0x26')](0x194);}return _0x5069a6;};}function handleError(_0x527930,_0xda45b2){_0xda45b2=_0xda45b2||0x1f4;return function(_0x5ea52f){logger[_0xdfcf('0x23')](_0x5ea52f[_0xdfcf('0x33')]);if(_0x5ea52f[_0xdfcf('0x34')]){delete _0x5ea52f[_0xdfcf('0x34')];}_0x527930['status'](_0xda45b2)[_0xdfcf('0x35')](_0x5ea52f);};}exports[_0xdfcf('0x36')]=function(_0x267ad8,_0x3ac422){var _0x4b7758={},_0x1356b9={},_0x49ef8f={'count':0x0,'rows':[]};var _0x240838=_[_0xdfcf('0x37')](db['SalesforceConfiguration'][_0xdfcf('0x38')],function(_0xcc8237){return{'name':_0xcc8237['fieldName'],'type':_0xcc8237['type']['key']};});_0x1356b9[_0xdfcf('0x39')]=_[_0xdfcf('0x37')](_0x240838,'name');_0x1356b9[_0xdfcf('0x3a')]=_['keys'](_0x267ad8['query']);_0x1356b9[_0xdfcf('0x3b')]=_[_0xdfcf('0x3c')](_0x1356b9['model'],_0x1356b9['query']);_0x4b7758[_0xdfcf('0x3d')]=_[_0xdfcf('0x3c')](_0x1356b9[_0xdfcf('0x39')],qs[_0xdfcf('0x3e')](_0x267ad8[_0xdfcf('0x3a')][_0xdfcf('0x3e')]));_0x4b7758[_0xdfcf('0x3d')]=_0x4b7758[_0xdfcf('0x3d')][_0xdfcf('0x3f')]?_0x4b7758['attributes']:_0x1356b9[_0xdfcf('0x39')];if(!_0x267ad8[_0xdfcf('0x3a')][_0xdfcf('0x40')](_0xdfcf('0x41'))){_0x4b7758[_0xdfcf('0x2b')]=qs[_0xdfcf('0x2b')](_0x267ad8[_0xdfcf('0x3a')][_0xdfcf('0x2b')]);_0x4b7758['offset']=qs[_0xdfcf('0x2a')](_0x267ad8['query']['offset']);}_0x4b7758['order']=qs['sort'](_0x267ad8[_0xdfcf('0x3a')][_0xdfcf('0x42')]);_0x4b7758['where']=qs['filters'](_[_0xdfcf('0x43')](_0x267ad8[_0xdfcf('0x3a')],_0x1356b9[_0xdfcf('0x3b')]));if(_0x267ad8[_0xdfcf('0x3a')][_0xdfcf('0x44')]){_0x4b7758[_0xdfcf('0x45')]=_[_0xdfcf('0x46')](_0x4b7758[_0xdfcf('0x45')],{'$or':_[_0xdfcf('0x37')](_0x240838,function(_0x535bd2){if(_0x535bd2[_0xdfcf('0x47')]!==_0xdfcf('0x48')){var _0x9135af={};_0x9135af[_0x535bd2[_0xdfcf('0x34')]]={'$like':'%'+_0x267ad8[_0xdfcf('0x3a')][_0xdfcf('0x44')]+'%'};return _0x9135af;}})});}_0x4b7758=_[_0xdfcf('0x46')]({},_0x4b7758,_0x267ad8[_0xdfcf('0x49')]);var _0x5db3c4={'where':_0x4b7758['where']};return db[_0xdfcf('0x4a')][_0xdfcf('0x4b')](_0x5db3c4)['then'](function(_0x49ed25){_0x49ef8f[_0xdfcf('0x4b')]=_0x49ed25;if(_0x267ad8[_0xdfcf('0x3a')][_0xdfcf('0x4c')]){_0x4b7758['include']=[{'all':!![]}];}return db[_0xdfcf('0x4a')][_0xdfcf('0x4d')](_0x4b7758);})[_0xdfcf('0x1e')](function(_0x128793){_0x49ef8f[_0xdfcf('0x4e')]=_0x128793;return _0x49ef8f;})[_0xdfcf('0x1e')](respondWithFilteredResult(_0x3ac422,_0x4b7758))[_0xdfcf('0x25')](handleError(_0x3ac422,null));};exports[_0xdfcf('0x4f')]=function(_0x4bcb17,_0x30602f){var _0x1521af={'raw':![],'where':{'id':_0x4bcb17[_0xdfcf('0x50')]['id']}},_0x481c16={};_0x481c16[_0xdfcf('0x39')]=_[_0xdfcf('0x51')](db[_0xdfcf('0x4a')][_0xdfcf('0x38')]);_0x481c16[_0xdfcf('0x3a')]=_[_0xdfcf('0x51')](_0x4bcb17[_0xdfcf('0x3a')]);_0x481c16[_0xdfcf('0x3b')]=_['intersection'](_0x481c16['model'],_0x481c16['query']);_0x1521af[_0xdfcf('0x3d')]=_[_0xdfcf('0x3c')](_0x481c16[_0xdfcf('0x39')],qs['fields'](_0x4bcb17[_0xdfcf('0x3a')][_0xdfcf('0x3e')]));_0x1521af['attributes']=_0x1521af[_0xdfcf('0x3d')][_0xdfcf('0x3f')]?_0x1521af[_0xdfcf('0x3d')]:_0x481c16[_0xdfcf('0x39')];if(_0x4bcb17[_0xdfcf('0x3a')][_0xdfcf('0x4c')]){_0x1521af[_0xdfcf('0x52')]=[{'all':!![]}];}_0x1521af=_['merge']({},_0x1521af,_0x4bcb17[_0xdfcf('0x49')]);return db[_0xdfcf('0x4a')][_0xdfcf('0x53')](_0x1521af)['then'](handleEntityNotFound(_0x30602f,null))[_0xdfcf('0x1e')](respondWithResult(_0x30602f,null))[_0xdfcf('0x25')](handleError(_0x30602f,null));};exports['create']=function(_0x50d5d2,_0x255d41){return db[_0xdfcf('0x4a')][_0xdfcf('0x54')](_0x50d5d2['body'],{})[_0xdfcf('0x1e')](respondWithResult(_0x255d41,0xc9))[_0xdfcf('0x25')](handleError(_0x255d41,null));};exports['update']=function(_0xa614b7,_0xb2bc84){if(_0xa614b7[_0xdfcf('0x55')]['id']){delete _0xa614b7[_0xdfcf('0x55')]['id'];}return db[_0xdfcf('0x4a')][_0xdfcf('0x53')]({'where':{'id':_0xa614b7[_0xdfcf('0x50')]['id']}})[_0xdfcf('0x1e')](handleEntityNotFound(_0xb2bc84,null))['then'](saveUpdates(_0xa614b7[_0xdfcf('0x55')],null))[_0xdfcf('0x1e')](respondWithResult(_0xb2bc84,null))[_0xdfcf('0x25')](handleError(_0xb2bc84,null));};exports[_0xdfcf('0x32')]=function(_0x135a08,_0x4b1571){return db[_0xdfcf('0x4a')][_0xdfcf('0x53')]({'where':{'id':_0x135a08[_0xdfcf('0x50')]['id']}})['then'](handleEntityNotFound(_0x4b1571,null))[_0xdfcf('0x1e')](removeEntity(_0x4b1571,null))[_0xdfcf('0x25')](handleError(_0x4b1571,null));};exports[_0xdfcf('0x56')]=function(_0xbf4a44,_0x3b2b5b,_0x4bb40c){var _0x287686={};var _0x22cc57={};var _0x5bbd73;var _0x36d980;return db[_0xdfcf('0x4a')][_0xdfcf('0x57')]({'where':{'id':_0xbf4a44['params']['id']}})[_0xdfcf('0x1e')](handleEntityNotFound(_0x3b2b5b,null))[_0xdfcf('0x1e')](function(_0x17e097){if(_0x17e097){_0x5bbd73=_0x17e097;_0x22cc57['model']=_[_0xdfcf('0x51')](db['SalesforceField'][_0xdfcf('0x38')]);_0x22cc57[_0xdfcf('0x3a')]=_['keys'](_0xbf4a44[_0xdfcf('0x3a')]);_0x22cc57[_0xdfcf('0x3b')]=_[_0xdfcf('0x3c')](_0x22cc57['model'],_0x22cc57[_0xdfcf('0x3a')]);_0x287686[_0xdfcf('0x3d')]=_['intersection'](_0x22cc57[_0xdfcf('0x39')],qs[_0xdfcf('0x3e')](_0xbf4a44[_0xdfcf('0x3a')][_0xdfcf('0x3e')]));_0x287686[_0xdfcf('0x3d')]=_0x287686[_0xdfcf('0x3d')][_0xdfcf('0x3f')]?_0x287686[_0xdfcf('0x3d')]:_0x22cc57[_0xdfcf('0x39')];_0x287686[_0xdfcf('0x58')]=qs[_0xdfcf('0x42')](_0xbf4a44[_0xdfcf('0x3a')][_0xdfcf('0x42')]);_0x287686[_0xdfcf('0x45')]=qs[_0xdfcf('0x3b')](_[_0xdfcf('0x43')](_0xbf4a44['query'],_0x22cc57[_0xdfcf('0x3b')]));if(_0xbf4a44['query']['filter']){_0x287686[_0xdfcf('0x45')]=_[_0xdfcf('0x46')](_0x287686[_0xdfcf('0x45')],{'$or':_[_0xdfcf('0x37')](_0x287686[_0xdfcf('0x3d')],function(_0x1feeb2){var _0x4e1bb4={};_0x4e1bb4[_0x1feeb2]={'$like':'%'+_0xbf4a44[_0xdfcf('0x3a')][_0xdfcf('0x44')]+'%'};return _0x4e1bb4;})});}_0x287686=_[_0xdfcf('0x46')]({},_0x287686,_0xbf4a44[_0xdfcf('0x49')]);return _0x5bbd73[_0xdfcf('0x56')](_0x287686);}})[_0xdfcf('0x1e')](function(_0x24e071){if(_0x24e071){_0x36d980=_0x24e071['length'];if(!_0xbf4a44[_0xdfcf('0x3a')]['hasOwnProperty'](_0xdfcf('0x41'))){_0x287686[_0xdfcf('0x2b')]=qs[_0xdfcf('0x2b')](_0xbf4a44['query']['limit']);_0x287686[_0xdfcf('0x2a')]=qs[_0xdfcf('0x2a')](_0xbf4a44['query']['offset']);}return _0x5bbd73[_0xdfcf('0x56')](_0x287686);}})['then'](function(_0x40e69e){if(_0x40e69e){return _0x40e69e?{'count':_0x36d980,'rows':_0x40e69e}:null;}})[_0xdfcf('0x1e')](respondWithResult(_0x3b2b5b,null))['catch'](handleError(_0x3b2b5b,null));};exports['getSubjects']=function(_0x30eb4f,_0x155427,_0x4623e5){var _0x5f31f1={};var _0x524fa5={};var _0xcac016;var _0x44ffae;return db[_0xdfcf('0x4a')]['findOne']({'where':{'id':_0x30eb4f[_0xdfcf('0x50')]['id']}})[_0xdfcf('0x1e')](handleEntityNotFound(_0x155427,null))[_0xdfcf('0x1e')](function(_0xd14fb8){if(_0xd14fb8){_0xcac016=_0xd14fb8;_0x524fa5[_0xdfcf('0x39')]=_[_0xdfcf('0x51')](db['SalesforceField'][_0xdfcf('0x38')]);_0x524fa5[_0xdfcf('0x3a')]=_[_0xdfcf('0x51')](_0x30eb4f[_0xdfcf('0x3a')]);_0x524fa5['filters']=_[_0xdfcf('0x3c')](_0x524fa5[_0xdfcf('0x39')],_0x524fa5['query']);_0x5f31f1[_0xdfcf('0x3d')]=_[_0xdfcf('0x3c')](_0x524fa5[_0xdfcf('0x39')],qs[_0xdfcf('0x3e')](_0x30eb4f['query']['fields']));_0x5f31f1['attributes']=_0x5f31f1['attributes'][_0xdfcf('0x3f')]?_0x5f31f1[_0xdfcf('0x3d')]:_0x524fa5['model'];_0x5f31f1[_0xdfcf('0x58')]=qs[_0xdfcf('0x42')](_0x30eb4f[_0xdfcf('0x3a')]['sort']);_0x5f31f1[_0xdfcf('0x45')]=qs[_0xdfcf('0x3b')](_[_0xdfcf('0x43')](_0x30eb4f[_0xdfcf('0x3a')],_0x524fa5[_0xdfcf('0x3b')]));if(_0x30eb4f[_0xdfcf('0x3a')][_0xdfcf('0x44')]){_0x5f31f1[_0xdfcf('0x45')]=_[_0xdfcf('0x46')](_0x5f31f1[_0xdfcf('0x45')],{'$or':_[_0xdfcf('0x37')](_0x5f31f1['attributes'],function(_0x37c419){var _0x3b1a4b={};_0x3b1a4b[_0x37c419]={'$like':'%'+_0x30eb4f[_0xdfcf('0x3a')][_0xdfcf('0x44')]+'%'};return _0x3b1a4b;})});}_0x5f31f1=_[_0xdfcf('0x46')]({},_0x5f31f1,_0x30eb4f[_0xdfcf('0x49')]);return _0xcac016['getSubjects'](_0x5f31f1);}})['then'](function(_0x8d10f7){if(_0x8d10f7){_0x44ffae=_0x8d10f7[_0xdfcf('0x3f')];if(!_0x30eb4f[_0xdfcf('0x3a')][_0xdfcf('0x40')]('nolimit')){_0x5f31f1['limit']=qs[_0xdfcf('0x2b')](_0x30eb4f['query']['limit']);_0x5f31f1[_0xdfcf('0x2a')]=qs[_0xdfcf('0x2a')](_0x30eb4f[_0xdfcf('0x3a')]['offset']);}return _0xcac016['getSubjects'](_0x5f31f1);}})['then'](function(_0x5c497e){if(_0x5c497e){return _0x5c497e?{'count':_0x44ffae,'rows':_0x5c497e}:null;}})['then'](respondWithResult(_0x155427,null))[_0xdfcf('0x25')](handleError(_0x155427,null));};exports['getDescriptions']=function(_0x4878a2,_0x59d6d6,_0x11d01d){var _0x15a9c1={};var _0x4d0586={};var _0x29aa69;var _0x268c5d;return db[_0xdfcf('0x4a')][_0xdfcf('0x57')]({'where':{'id':_0x4878a2[_0xdfcf('0x50')]['id']}})[_0xdfcf('0x1e')](handleEntityNotFound(_0x59d6d6,null))[_0xdfcf('0x1e')](function(_0x21ca34){if(_0x21ca34){_0x29aa69=_0x21ca34;_0x4d0586[_0xdfcf('0x39')]=_[_0xdfcf('0x51')](db[_0xdfcf('0x59')][_0xdfcf('0x38')]);_0x4d0586[_0xdfcf('0x3a')]=_[_0xdfcf('0x51')](_0x4878a2['query']);_0x4d0586[_0xdfcf('0x3b')]=_[_0xdfcf('0x3c')](_0x4d0586['model'],_0x4d0586['query']);_0x15a9c1[_0xdfcf('0x3d')]=_[_0xdfcf('0x3c')](_0x4d0586[_0xdfcf('0x39')],qs[_0xdfcf('0x3e')](_0x4878a2[_0xdfcf('0x3a')]['fields']));_0x15a9c1[_0xdfcf('0x3d')]=_0x15a9c1[_0xdfcf('0x3d')][_0xdfcf('0x3f')]?_0x15a9c1[_0xdfcf('0x3d')]:_0x4d0586[_0xdfcf('0x39')];_0x15a9c1[_0xdfcf('0x58')]=qs['sort'](_0x4878a2[_0xdfcf('0x3a')]['sort']);_0x15a9c1[_0xdfcf('0x45')]=qs[_0xdfcf('0x3b')](_[_0xdfcf('0x43')](_0x4878a2[_0xdfcf('0x3a')],_0x4d0586[_0xdfcf('0x3b')]));if(_0x4878a2[_0xdfcf('0x3a')][_0xdfcf('0x44')]){_0x15a9c1[_0xdfcf('0x45')]=_[_0xdfcf('0x46')](_0x15a9c1[_0xdfcf('0x45')],{'$or':_[_0xdfcf('0x37')](_0x15a9c1[_0xdfcf('0x3d')],function(_0x3ecce2){var _0x598357={};_0x598357[_0x3ecce2]={'$like':'%'+_0x4878a2[_0xdfcf('0x3a')][_0xdfcf('0x44')]+'%'};return _0x598357;})});}_0x15a9c1=_['merge']({},_0x15a9c1,_0x4878a2[_0xdfcf('0x49')]);return _0x29aa69[_0xdfcf('0x5a')](_0x15a9c1);}})['then'](function(_0x112878){if(_0x112878){_0x268c5d=_0x112878[_0xdfcf('0x3f')];if(!_0x4878a2[_0xdfcf('0x3a')][_0xdfcf('0x40')](_0xdfcf('0x41'))){_0x15a9c1['limit']=qs[_0xdfcf('0x2b')](_0x4878a2['query'][_0xdfcf('0x2b')]);_0x15a9c1[_0xdfcf('0x2a')]=qs['offset'](_0x4878a2[_0xdfcf('0x3a')]['offset']);}return _0x29aa69[_0xdfcf('0x5a')](_0x15a9c1);}})[_0xdfcf('0x1e')](function(_0x4e006e){if(_0x4e006e){return _0x4e006e?{'count':_0x268c5d,'rows':_0x4e006e}:null;}})['then'](respondWithResult(_0x59d6d6,null))[_0xdfcf('0x25')](handleError(_0x59d6d6,null));}; \ No newline at end of file +var _0xe1fa=['options','count','includeAll','findAll','rows','show','params','fields','find','create','body','getFields','SalesforceField','findOne','getSubjects','getDescriptions','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','test','Sequelize','then','info','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','SalesforceConfiguration,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','set','Content-Range','reject','save','update','destroy','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge'];(function(_0x3a9661,_0x530b12){var _0x5bb119=function(_0x1278f){while(--_0x1278f){_0x3a9661['push'](_0x3a9661['shift']());}};_0x5bb119(++_0x530b12);}(_0xe1fa,0x188));var _0xae1f=function(_0x23d685,_0x49e250){_0x23d685=_0x23d685-0x0;var _0x599c12=_0xe1fa[_0x23d685];return _0x599c12;};'use strict';var pdf=require(_0xae1f('0x0'));var emlformat=require(_0xae1f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xae1f('0x2'));var jsonpatch=require(_0xae1f('0x3'));var rp=require(_0xae1f('0x4'));var moment=require(_0xae1f('0x5'));var BPromise=require(_0xae1f('0x6'));var Mustache=require(_0xae1f('0x7'));var util=require(_0xae1f('0x8'));var path=require('path');var sox=require(_0xae1f('0x9'));var csv=require(_0xae1f('0xa'));var ejs=require(_0xae1f('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xae1f('0xc'));var crypto=require(_0xae1f('0xd'));var jsforce=require(_0xae1f('0xe'));var deskjs=require(_0xae1f('0xf'));var toCsv=require(_0xae1f('0xa'));var querystring=require(_0xae1f('0x10'));var Papa=require(_0xae1f('0x11'));var Redis=require('ioredis');var authService=require(_0xae1f('0x12'));var qs=require(_0xae1f('0x13'));var as=require(_0xae1f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xae1f('0x15'))(_0xae1f('0x16'));var utils=require(_0xae1f('0x17'));var config=require(_0xae1f('0x18'));var db=require(_0xae1f('0x19'))['db'];var jayson=require(_0xae1f('0x1a'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x2a772d,_0xc5522c,_0x5284eb){if(_0x5284eb){var _0x463039=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x463039[_0xae1f('0x1b')](_0xc5522c)){return _0x2a772d;}else{throw new db[(_0xae1f('0x1c'))]['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~!@#$%^&-_=+[{]}.');}}else{return _0x2a772d;}}function respondWithRpcPromise(_0x2e008a,_0x59f8ca,_0x5bdcf7,_0x36478e){return new BPromise(function(_0x41f61e,_0x35114b){var _0x1f75ed=_0x36478e||client;return _0x1f75ed['request'](_0x2e008a,_0x5bdcf7)[_0xae1f('0x1d')](function(_0x282865){logger[_0xae1f('0x1e')]('SalesforceConfiguration,\x20%s,\x20%s',_0x59f8ca,'request\x20sent');logger[_0xae1f('0x1f')](_0xae1f('0x20'),_0x59f8ca,_0xae1f('0x21'),JSON[_0xae1f('0x22')](_0x282865));if(_0x282865[_0xae1f('0x23')]){if(_0x282865[_0xae1f('0x23')]['code']===0x1f4){logger['error'](_0xae1f('0x24'),_0x59f8ca,_0x282865[_0xae1f('0x23')][_0xae1f('0x25')]);return _0x35114b(_0x282865[_0xae1f('0x23')][_0xae1f('0x25')]);}logger[_0xae1f('0x23')]('SalesforceConfiguration,\x20%s,\x20%s',_0x59f8ca,_0x282865[_0xae1f('0x23')][_0xae1f('0x25')]);return _0x41f61e(_0x282865['error'][_0xae1f('0x25')]);}else{logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x59f8ca,_0xae1f('0x21'));_0x41f61e(_0x282865[_0xae1f('0x26')][_0xae1f('0x25')]);}})[_0xae1f('0x27')](function(_0x407a26){logger[_0xae1f('0x23')]('SalesforceConfiguration,\x20%s,\x20%s',_0x59f8ca,_0x407a26);_0x35114b(_0x407a26);});});}function respondWithStatusCode(_0x45a3de,_0xeb73e0){_0xeb73e0=_0xeb73e0||0xcc;return function(_0x5e1261){if(_0x5e1261){return _0x45a3de[_0xae1f('0x28')](_0xeb73e0);}return _0x45a3de[_0xae1f('0x29')](_0xeb73e0)[_0xae1f('0x2a')]();};}function respondWithResult(_0x438d9e,_0x2b4941){_0x2b4941=_0x2b4941||0xc8;return function(_0x14cec8){if(_0x14cec8){return _0x438d9e[_0xae1f('0x29')](_0x2b4941)[_0xae1f('0x2b')](_0x14cec8);}};}function respondWithFilteredResult(_0x3f6a33,_0x4f70fb){return function(_0x2125fb){if(_0x2125fb){var _0x2ad45b=_0x2125fb['count'],_0x5bc00d=_0x4f70fb[_0xae1f('0x2c')],_0x551f27=_0x4f70fb[_0xae1f('0x2c')]+_0x4f70fb['limit'],_0x4a8b88;if(_0x551f27>=_0x2ad45b){_0x551f27=_0x2ad45b;_0x4a8b88=0xc8;}else{_0x4a8b88=0xce;}_0x3f6a33[_0xae1f('0x29')](_0x4a8b88);return _0x3f6a33[_0xae1f('0x2d')](_0xae1f('0x2e'),_0x5bc00d+'-'+_0x551f27+'/'+_0x2ad45b)[_0xae1f('0x2b')](_0x2125fb);}return null;};}function patchUpdates(_0x5d7aa7){return function(_0x911d2c){try{jsonpatch['apply'](_0x911d2c,_0x5d7aa7,!![]);}catch(_0x195712){return BPromise[_0xae1f('0x2f')](_0x195712);}return _0x911d2c[_0xae1f('0x30')]();};}function saveUpdates(_0x1003e1,_0x5dc377){return function(_0xb95c4a){if(_0xb95c4a){return _0xb95c4a[_0xae1f('0x31')](_0x1003e1)['then'](function(_0x24073d){return _0x24073d;});}return null;};}function removeEntity(_0x59256b,_0x2b87c5){return function(_0x34d9eb){if(_0x34d9eb){return _0x34d9eb[_0xae1f('0x32')]()[_0xae1f('0x1d')](function(){_0x59256b[_0xae1f('0x29')](0xcc)[_0xae1f('0x2a')]();});}};}function handleEntityNotFound(_0x3f70f2,_0x4776f7){return function(_0x2f766a){if(!_0x2f766a){_0x3f70f2['sendStatus'](0x194);}return _0x2f766a;};}function handleError(_0x424cb2,_0x31ae56){_0x31ae56=_0x31ae56||0x1f4;return function(_0x1ebe9c){logger['error'](_0x1ebe9c[_0xae1f('0x33')]);if(_0x1ebe9c['name']){delete _0x1ebe9c[_0xae1f('0x34')];}_0x424cb2[_0xae1f('0x29')](_0x31ae56)[_0xae1f('0x35')](_0x1ebe9c);};}exports[_0xae1f('0x36')]=function(_0x56e839,_0xc09bf8){var _0x1b329c={},_0x15ca7c={},_0x36ae14={'count':0x0,'rows':[]};var _0x2948d1=_[_0xae1f('0x37')](db[_0xae1f('0x38')][_0xae1f('0x39')],function(_0x3065ff){return{'name':_0x3065ff[_0xae1f('0x3a')],'type':_0x3065ff[_0xae1f('0x3b')][_0xae1f('0x3c')]};});_0x15ca7c[_0xae1f('0x3d')]=_[_0xae1f('0x37')](_0x2948d1,_0xae1f('0x34'));_0x15ca7c[_0xae1f('0x3e')]=_[_0xae1f('0x3f')](_0x56e839[_0xae1f('0x3e')]);_0x15ca7c[_0xae1f('0x40')]=_[_0xae1f('0x41')](_0x15ca7c[_0xae1f('0x3d')],_0x15ca7c[_0xae1f('0x3e')]);_0x1b329c[_0xae1f('0x42')]=_[_0xae1f('0x41')](_0x15ca7c[_0xae1f('0x3d')],qs['fields'](_0x56e839[_0xae1f('0x3e')]['fields']));_0x1b329c[_0xae1f('0x42')]=_0x1b329c['attributes'][_0xae1f('0x43')]?_0x1b329c['attributes']:_0x15ca7c[_0xae1f('0x3d')];if(!_0x56e839[_0xae1f('0x3e')][_0xae1f('0x44')](_0xae1f('0x45'))){_0x1b329c[_0xae1f('0x46')]=qs[_0xae1f('0x46')](_0x56e839[_0xae1f('0x3e')][_0xae1f('0x46')]);_0x1b329c[_0xae1f('0x2c')]=qs['offset'](_0x56e839[_0xae1f('0x3e')][_0xae1f('0x2c')]);}_0x1b329c[_0xae1f('0x47')]=qs[_0xae1f('0x48')](_0x56e839[_0xae1f('0x3e')][_0xae1f('0x48')]);_0x1b329c[_0xae1f('0x49')]=qs[_0xae1f('0x40')](_[_0xae1f('0x4a')](_0x56e839[_0xae1f('0x3e')],_0x15ca7c[_0xae1f('0x40')]));if(_0x56e839[_0xae1f('0x3e')][_0xae1f('0x4b')]){_0x1b329c[_0xae1f('0x49')]=_['merge'](_0x1b329c[_0xae1f('0x49')],{'$or':_['map'](_0x2948d1,function(_0x330bfd){if(_0x330bfd[_0xae1f('0x3b')]!==_0xae1f('0x4c')){var _0x198106={};_0x198106[_0x330bfd[_0xae1f('0x34')]]={'$like':'%'+_0x56e839['query'][_0xae1f('0x4b')]+'%'};return _0x198106;}})});}_0x1b329c=_[_0xae1f('0x4d')]({},_0x1b329c,_0x56e839[_0xae1f('0x4e')]);var _0x1e6c9e={'where':_0x1b329c[_0xae1f('0x49')]};return db[_0xae1f('0x38')][_0xae1f('0x4f')](_0x1e6c9e)[_0xae1f('0x1d')](function(_0x3f0c26){_0x36ae14[_0xae1f('0x4f')]=_0x3f0c26;if(_0x56e839[_0xae1f('0x3e')][_0xae1f('0x50')]){_0x1b329c['include']=[{'all':!![]}];}return db['SalesforceConfiguration'][_0xae1f('0x51')](_0x1b329c);})[_0xae1f('0x1d')](function(_0x488541){_0x36ae14[_0xae1f('0x52')]=_0x488541;return _0x36ae14;})['then'](respondWithFilteredResult(_0xc09bf8,_0x1b329c))[_0xae1f('0x27')](handleError(_0xc09bf8,null));};exports[_0xae1f('0x53')]=function(_0x23e94e,_0x2cb6d8){var _0x5d4742={'raw':![],'where':{'id':_0x23e94e[_0xae1f('0x54')]['id']}},_0x4eb15c={};_0x4eb15c[_0xae1f('0x3d')]=_[_0xae1f('0x3f')](db[_0xae1f('0x38')]['rawAttributes']);_0x4eb15c[_0xae1f('0x3e')]=_[_0xae1f('0x3f')](_0x23e94e[_0xae1f('0x3e')]);_0x4eb15c['filters']=_[_0xae1f('0x41')](_0x4eb15c[_0xae1f('0x3d')],_0x4eb15c['query']);_0x5d4742[_0xae1f('0x42')]=_[_0xae1f('0x41')](_0x4eb15c[_0xae1f('0x3d')],qs[_0xae1f('0x55')](_0x23e94e['query'][_0xae1f('0x55')]));_0x5d4742[_0xae1f('0x42')]=_0x5d4742['attributes'][_0xae1f('0x43')]?_0x5d4742[_0xae1f('0x42')]:_0x4eb15c[_0xae1f('0x3d')];if(_0x23e94e[_0xae1f('0x3e')][_0xae1f('0x50')]){_0x5d4742['include']=[{'all':!![]}];}_0x5d4742=_[_0xae1f('0x4d')]({},_0x5d4742,_0x23e94e[_0xae1f('0x4e')]);return db[_0xae1f('0x38')][_0xae1f('0x56')](_0x5d4742)[_0xae1f('0x1d')](handleEntityNotFound(_0x2cb6d8,null))[_0xae1f('0x1d')](respondWithResult(_0x2cb6d8,null))[_0xae1f('0x27')](handleError(_0x2cb6d8,null));};exports[_0xae1f('0x57')]=function(_0x5796ad,_0x248fe2){return db[_0xae1f('0x38')][_0xae1f('0x57')](_0x5796ad[_0xae1f('0x58')],{})[_0xae1f('0x1d')](respondWithResult(_0x248fe2,0xc9))['catch'](handleError(_0x248fe2,null));};exports[_0xae1f('0x31')]=function(_0x33019b,_0x2985a5){if(_0x33019b[_0xae1f('0x58')]['id']){delete _0x33019b[_0xae1f('0x58')]['id'];}return db[_0xae1f('0x38')][_0xae1f('0x56')]({'where':{'id':_0x33019b['params']['id']}})[_0xae1f('0x1d')](handleEntityNotFound(_0x2985a5,null))[_0xae1f('0x1d')](saveUpdates(_0x33019b[_0xae1f('0x58')],null))[_0xae1f('0x1d')](respondWithResult(_0x2985a5,null))['catch'](handleError(_0x2985a5,null));};exports['destroy']=function(_0x292289,_0x13c78b){return db[_0xae1f('0x38')][_0xae1f('0x56')]({'where':{'id':_0x292289['params']['id']}})[_0xae1f('0x1d')](handleEntityNotFound(_0x13c78b,null))[_0xae1f('0x1d')](removeEntity(_0x13c78b,null))['catch'](handleError(_0x13c78b,null));};exports[_0xae1f('0x59')]=function(_0x5622de,_0x5c0251,_0x21b34a){var _0x2ffe0b={};var _0x3e5153={};var _0x5c5baf;var _0x484128;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x5622de[_0xae1f('0x54')]['id']}})[_0xae1f('0x1d')](handleEntityNotFound(_0x5c0251,null))[_0xae1f('0x1d')](function(_0x4a9994){if(_0x4a9994){_0x5c5baf=_0x4a9994;_0x3e5153[_0xae1f('0x3d')]=_[_0xae1f('0x3f')](db[_0xae1f('0x5a')]['rawAttributes']);_0x3e5153[_0xae1f('0x3e')]=_[_0xae1f('0x3f')](_0x5622de[_0xae1f('0x3e')]);_0x3e5153[_0xae1f('0x40')]=_[_0xae1f('0x41')](_0x3e5153['model'],_0x3e5153[_0xae1f('0x3e')]);_0x2ffe0b[_0xae1f('0x42')]=_[_0xae1f('0x41')](_0x3e5153['model'],qs['fields'](_0x5622de[_0xae1f('0x3e')]['fields']));_0x2ffe0b['attributes']=_0x2ffe0b[_0xae1f('0x42')][_0xae1f('0x43')]?_0x2ffe0b[_0xae1f('0x42')]:_0x3e5153[_0xae1f('0x3d')];_0x2ffe0b[_0xae1f('0x47')]=qs[_0xae1f('0x48')](_0x5622de['query'][_0xae1f('0x48')]);_0x2ffe0b['where']=qs[_0xae1f('0x40')](_[_0xae1f('0x4a')](_0x5622de[_0xae1f('0x3e')],_0x3e5153['filters']));if(_0x5622de[_0xae1f('0x3e')][_0xae1f('0x4b')]){_0x2ffe0b['where']=_[_0xae1f('0x4d')](_0x2ffe0b['where'],{'$or':_[_0xae1f('0x37')](_0x2ffe0b['attributes'],function(_0x20cc99){var _0x171e5f={};_0x171e5f[_0x20cc99]={'$like':'%'+_0x5622de[_0xae1f('0x3e')][_0xae1f('0x4b')]+'%'};return _0x171e5f;})});}_0x2ffe0b=_[_0xae1f('0x4d')]({},_0x2ffe0b,_0x5622de[_0xae1f('0x4e')]);return _0x5c5baf[_0xae1f('0x59')](_0x2ffe0b);}})[_0xae1f('0x1d')](function(_0x20394f){if(_0x20394f){_0x484128=_0x20394f[_0xae1f('0x43')];if(!_0x5622de['query'][_0xae1f('0x44')](_0xae1f('0x45'))){_0x2ffe0b[_0xae1f('0x46')]=qs[_0xae1f('0x46')](_0x5622de['query'][_0xae1f('0x46')]);_0x2ffe0b[_0xae1f('0x2c')]=qs[_0xae1f('0x2c')](_0x5622de[_0xae1f('0x3e')]['offset']);}return _0x5c5baf['getFields'](_0x2ffe0b);}})[_0xae1f('0x1d')](function(_0x1ea398){if(_0x1ea398){return _0x1ea398?{'count':_0x484128,'rows':_0x1ea398}:null;}})[_0xae1f('0x1d')](respondWithResult(_0x5c0251,null))[_0xae1f('0x27')](handleError(_0x5c0251,null));};exports['getSubjects']=function(_0x49e431,_0x2ca710,_0x1a771e){var _0x5b76d4={};var _0x4d3334={};var _0x5614b4;var _0x3930c1;return db[_0xae1f('0x38')][_0xae1f('0x5b')]({'where':{'id':_0x49e431[_0xae1f('0x54')]['id']}})[_0xae1f('0x1d')](handleEntityNotFound(_0x2ca710,null))[_0xae1f('0x1d')](function(_0x235b04){if(_0x235b04){_0x5614b4=_0x235b04;_0x4d3334[_0xae1f('0x3d')]=_['keys'](db[_0xae1f('0x5a')]['rawAttributes']);_0x4d3334[_0xae1f('0x3e')]=_[_0xae1f('0x3f')](_0x49e431[_0xae1f('0x3e')]);_0x4d3334[_0xae1f('0x40')]=_[_0xae1f('0x41')](_0x4d3334[_0xae1f('0x3d')],_0x4d3334[_0xae1f('0x3e')]);_0x5b76d4[_0xae1f('0x42')]=_['intersection'](_0x4d3334['model'],qs[_0xae1f('0x55')](_0x49e431[_0xae1f('0x3e')][_0xae1f('0x55')]));_0x5b76d4['attributes']=_0x5b76d4[_0xae1f('0x42')][_0xae1f('0x43')]?_0x5b76d4[_0xae1f('0x42')]:_0x4d3334[_0xae1f('0x3d')];_0x5b76d4[_0xae1f('0x47')]=qs[_0xae1f('0x48')](_0x49e431[_0xae1f('0x3e')][_0xae1f('0x48')]);_0x5b76d4[_0xae1f('0x49')]=qs[_0xae1f('0x40')](_[_0xae1f('0x4a')](_0x49e431[_0xae1f('0x3e')],_0x4d3334[_0xae1f('0x40')]));if(_0x49e431[_0xae1f('0x3e')][_0xae1f('0x4b')]){_0x5b76d4[_0xae1f('0x49')]=_[_0xae1f('0x4d')](_0x5b76d4[_0xae1f('0x49')],{'$or':_[_0xae1f('0x37')](_0x5b76d4[_0xae1f('0x42')],function(_0x593b39){var _0xd5ea35={};_0xd5ea35[_0x593b39]={'$like':'%'+_0x49e431[_0xae1f('0x3e')][_0xae1f('0x4b')]+'%'};return _0xd5ea35;})});}_0x5b76d4=_[_0xae1f('0x4d')]({},_0x5b76d4,_0x49e431[_0xae1f('0x4e')]);return _0x5614b4[_0xae1f('0x5c')](_0x5b76d4);}})['then'](function(_0x3215a3){if(_0x3215a3){_0x3930c1=_0x3215a3[_0xae1f('0x43')];if(!_0x49e431['query'][_0xae1f('0x44')](_0xae1f('0x45'))){_0x5b76d4[_0xae1f('0x46')]=qs['limit'](_0x49e431['query'][_0xae1f('0x46')]);_0x5b76d4['offset']=qs['offset'](_0x49e431[_0xae1f('0x3e')][_0xae1f('0x2c')]);}return _0x5614b4[_0xae1f('0x5c')](_0x5b76d4);}})['then'](function(_0x4f2589){if(_0x4f2589){return _0x4f2589?{'count':_0x3930c1,'rows':_0x4f2589}:null;}})[_0xae1f('0x1d')](respondWithResult(_0x2ca710,null))[_0xae1f('0x27')](handleError(_0x2ca710,null));};exports['getDescriptions']=function(_0x91c59e,_0x5c9521,_0x16043f){var _0x4b1432={};var _0x5a73c6={};var _0x5c0c12;var _0x2abc78;return db[_0xae1f('0x38')]['findOne']({'where':{'id':_0x91c59e['params']['id']}})['then'](handleEntityNotFound(_0x5c9521,null))[_0xae1f('0x1d')](function(_0x280f5e){if(_0x280f5e){_0x5c0c12=_0x280f5e;_0x5a73c6['model']=_[_0xae1f('0x3f')](db['SalesforceField'][_0xae1f('0x39')]);_0x5a73c6[_0xae1f('0x3e')]=_[_0xae1f('0x3f')](_0x91c59e['query']);_0x5a73c6['filters']=_['intersection'](_0x5a73c6['model'],_0x5a73c6[_0xae1f('0x3e')]);_0x4b1432[_0xae1f('0x42')]=_[_0xae1f('0x41')](_0x5a73c6['model'],qs[_0xae1f('0x55')](_0x91c59e[_0xae1f('0x3e')][_0xae1f('0x55')]));_0x4b1432[_0xae1f('0x42')]=_0x4b1432[_0xae1f('0x42')][_0xae1f('0x43')]?_0x4b1432['attributes']:_0x5a73c6[_0xae1f('0x3d')];_0x4b1432[_0xae1f('0x47')]=qs['sort'](_0x91c59e[_0xae1f('0x3e')][_0xae1f('0x48')]);_0x4b1432['where']=qs[_0xae1f('0x40')](_[_0xae1f('0x4a')](_0x91c59e[_0xae1f('0x3e')],_0x5a73c6[_0xae1f('0x40')]));if(_0x91c59e[_0xae1f('0x3e')][_0xae1f('0x4b')]){_0x4b1432[_0xae1f('0x49')]=_['merge'](_0x4b1432[_0xae1f('0x49')],{'$or':_['map'](_0x4b1432[_0xae1f('0x42')],function(_0x4c5b60){var _0x1d301e={};_0x1d301e[_0x4c5b60]={'$like':'%'+_0x91c59e[_0xae1f('0x3e')]['filter']+'%'};return _0x1d301e;})});}_0x4b1432=_[_0xae1f('0x4d')]({},_0x4b1432,_0x91c59e['options']);return _0x5c0c12['getDescriptions'](_0x4b1432);}})[_0xae1f('0x1d')](function(_0x197706){if(_0x197706){_0x2abc78=_0x197706[_0xae1f('0x43')];if(!_0x91c59e[_0xae1f('0x3e')]['hasOwnProperty'](_0xae1f('0x45'))){_0x4b1432[_0xae1f('0x46')]=qs['limit'](_0x91c59e['query'][_0xae1f('0x46')]);_0x4b1432['offset']=qs[_0xae1f('0x2c')](_0x91c59e[_0xae1f('0x3e')][_0xae1f('0x2c')]);}return _0x5c0c12[_0xae1f('0x5d')](_0x4b1432);}})[_0xae1f('0x1d')](function(_0x42f138){if(_0x42f138){return _0x42f138?{'count':_0x2abc78,'rows':_0x42f138}:null;}})[_0xae1f('0x1d')](respondWithResult(_0x5c9521,null))['catch'](handleError(_0x5c9521,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 2152539..6c8ee73 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 _0x719e=['api','moment','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations','util','../../config/logger'];(function(_0x163ed8,_0x24671d){var _0x1a38f5=function(_0x367419){while(--_0x367419){_0x163ed8['push'](_0x163ed8['shift']());}};_0x1a38f5(++_0x24671d);}(_0x719e,0x136));var _0xe719=function(_0x1fe14f,_0x36745d){_0x1fe14f=_0x1fe14f-0x0;var _0x4c4904=_0x719e[_0x1fe14f];return _0x4c4904;};'use strict';var _=require('lodash');var util=require(_0xe719('0x0'));var logger=require(_0xe719('0x1'))(_0xe719('0x2'));var moment=require(_0xe719('0x3'));var BPromise=require('bluebird');var rp=require(_0xe719('0x4'));var fs=require('fs');var path=require(_0xe719('0x5'));var rimraf=require(_0xe719('0x6'));var config=require(_0xe719('0x7'));var attributes=require(_0xe719('0x8'));module[_0xe719('0x9')]=function(_0x42067a,_0x364add){return _0x42067a[_0xe719('0xa')](_0xe719('0xb'),attributes,{'tableName':_0xe719('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4656=['define','int_salesforce_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intSalesforceConfiguration.attributes','exports'];(function(_0x455bbf,_0x487eb1){var _0x31cc6a=function(_0x510dd8){while(--_0x510dd8){_0x455bbf['push'](_0x455bbf['shift']());}};_0x31cc6a(++_0x487eb1);}(_0x4656,0x154));var _0x6465=function(_0x4aa838,_0x4aa14f){_0x4aa838=_0x4aa838-0x0;var _0x3abff0=_0x4656[_0x4aa838];return _0x3abff0;};'use strict';var _=require(_0x6465('0x0'));var util=require(_0x6465('0x1'));var logger=require(_0x6465('0x2'))(_0x6465('0x3'));var moment=require(_0x6465('0x4'));var BPromise=require(_0x6465('0x5'));var rp=require(_0x6465('0x6'));var fs=require('fs');var path=require(_0x6465('0x7'));var rimraf=require(_0x6465('0x8'));var config=require('../../config/environment');var attributes=require(_0x6465('0x9'));module[_0x6465('0xa')]=function(_0x320096,_0x62cdba){return _0x320096[_0x6465('0xb')]('SalesforceConfiguration',attributes,{'tableName':_0x6465('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 0115695..f48c944 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 _0x2ca3=['message','info','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','SalesforceConfiguration,\x20%s,\x20%s','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x5ea94c,_0x19937b){var _0xededd7=function(_0x27d10e){while(--_0x27d10e){_0x5ea94c['push'](_0x5ea94c['shift']());}};_0xededd7(++_0x19937b);}(_0x2ca3,0xe0));var _0x32ca=function(_0x8550ba,_0x57c10d){_0x8550ba=_0x8550ba-0x0;var _0x432399=_0x2ca3[_0x8550ba];return _0x432399;};'use strict';var _=require(_0x32ca('0x0'));var util=require('util');var moment=require(_0x32ca('0x1'));var BPromise=require(_0x32ca('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x32ca('0x3'))['db'];var utils=require(_0x32ca('0x4'));var logger=require(_0x32ca('0x5'))(_0x32ca('0x6'));var config=require(_0x32ca('0x7'));var jayson=require(_0x32ca('0x8'));var client=jayson['client'][_0x32ca('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x41dbc5,_0x1256b8,_0x300e9f){return new BPromise(function(_0x2e7ca4,_0x4f1919){return client[_0x32ca('0xa')](_0x41dbc5,_0x300e9f)[_0x32ca('0xb')](function(_0x2aa22b){logger['info'](_0x32ca('0xc'),_0x1256b8,'request\x20sent');logger[_0x32ca('0xd')](_0x32ca('0xe'),_0x1256b8,_0x32ca('0xf'),JSON[_0x32ca('0x10')](_0x2aa22b));if(_0x2aa22b['error']){if(_0x2aa22b['error']['code']===0x1f4){logger[_0x32ca('0x11')](_0x32ca('0xc'),_0x1256b8,_0x2aa22b[_0x32ca('0x11')][_0x32ca('0x12')]);return _0x4f1919(_0x2aa22b['error'][_0x32ca('0x12')]);}logger[_0x32ca('0x11')](_0x32ca('0xc'),_0x1256b8,_0x2aa22b[_0x32ca('0x11')]['message']);return _0x2e7ca4(_0x2aa22b['error'][_0x32ca('0x12')]);}else{logger[_0x32ca('0x13')](_0x32ca('0xc'),_0x1256b8,_0x32ca('0xf'));_0x2e7ca4(_0x2aa22b[_0x32ca('0x14')]['message']);}})[_0x32ca('0x15')](function(_0x1272e5){logger[_0x32ca('0x11')]('SalesforceConfiguration,\x20%s,\x20%s',_0x1256b8,_0x1272e5);_0x4f1919(_0x1272e5);});});} \ No newline at end of file +var _0xd670=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util'];(function(_0x20f7fd,_0x4e86e8){var _0x6f2143=function(_0x4e05a4){while(--_0x4e05a4){_0x20f7fd['push'](_0x20f7fd['shift']());}};_0x6f2143(++_0x4e86e8);}(_0xd670,0x1e1));var _0x0d67=function(_0x5ddd87,_0x4cee42){_0x5ddd87=_0x5ddd87-0x0;var _0x4e4161=_0xd670[_0x5ddd87];return _0x4e4161;};'use strict';var _=require(_0x0d67('0x0'));var util=require(_0x0d67('0x1'));var moment=require(_0x0d67('0x2'));var BPromise=require(_0x0d67('0x3'));var rs=require(_0x0d67('0x4'));var fs=require('fs');var Redis=require(_0x0d67('0x5'));var db=require(_0x0d67('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0d67('0x7'))(_0x0d67('0x8'));var config=require(_0x0d67('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x11c4c0,_0x13a6f2,_0x37627b){return new BPromise(function(_0xe68558,_0x3b0881){return client[_0x0d67('0xa')](_0x11c4c0,_0x37627b)[_0x0d67('0xb')](function(_0x551166){logger[_0x0d67('0xc')](_0x0d67('0xd'),_0x13a6f2,'request\x20sent');logger[_0x0d67('0xe')](_0x0d67('0xf'),_0x13a6f2,_0x0d67('0x10'),JSON[_0x0d67('0x11')](_0x551166));if(_0x551166[_0x0d67('0x12')]){if(_0x551166['error'][_0x0d67('0x13')]===0x1f4){logger[_0x0d67('0x12')](_0x0d67('0xd'),_0x13a6f2,_0x551166[_0x0d67('0x12')][_0x0d67('0x14')]);return _0x3b0881(_0x551166[_0x0d67('0x12')][_0x0d67('0x14')]);}logger['error'](_0x0d67('0xd'),_0x13a6f2,_0x551166[_0x0d67('0x12')][_0x0d67('0x14')]);return _0xe68558(_0x551166[_0x0d67('0x12')][_0x0d67('0x14')]);}else{logger[_0x0d67('0xc')](_0x0d67('0xd'),_0x13a6f2,_0x0d67('0x10'));_0xe68558(_0x551166[_0x0d67('0x15')][_0x0d67('0x14')]);}})[_0x0d67('0x16')](function(_0x4354ae){logger[_0x0d67('0x12')](_0x0d67('0xd'),_0x13a6f2,_0x4354ae);_0x3b0881(_0x4354ae);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 907c2d9..2f52b9c 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 _0x2eb2=['/:id','show','post','create','put','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','get'];(function(_0x45375e,_0x4ee1ea){var _0x1dcf1f=function(_0x127058){while(--_0x127058){_0x45375e['push'](_0x45375e['shift']());}};_0x1dcf1f(++_0x4ee1ea);}(_0x2eb2,0x19f));var _0x22eb=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0x2eb2[_0x2160a9];return _0xa88cf7;};'use strict';var multer=require('multer');var util=require(_0x22eb('0x0'));var path=require(_0x22eb('0x1'));var timeout=require(_0x22eb('0x2'));var express=require(_0x22eb('0x3'));var router=express[_0x22eb('0x4')]();var auth=require(_0x22eb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x22eb('0x6'));var controller=require('./intSalesforceField.controller');router['get']('/',auth[_0x22eb('0x7')](),controller[_0x22eb('0x8')]);router[_0x22eb('0x9')](_0x22eb('0xa'),auth[_0x22eb('0x7')](),controller[_0x22eb('0xb')]);router[_0x22eb('0xc')]('/',auth[_0x22eb('0x7')](),controller[_0x22eb('0xd')]);router[_0x22eb('0xe')](_0x22eb('0xa'),auth[_0x22eb('0x7')](),controller['update']);router[_0x22eb('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x22eb('0x10')]);module['exports']=router; \ No newline at end of file +var _0x71ab=['isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get'];(function(_0x22579f,_0x1d4e95){var _0x239c44=function(_0xd362b1){while(--_0xd362b1){_0x22579f['push'](_0x22579f['shift']());}};_0x239c44(++_0x1d4e95);}(_0x71ab,0x64));var _0xb71a=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x71ab[_0x465028];return _0xb783d4;};'use strict';var multer=require('multer');var util=require(_0xb71a('0x0'));var path=require('path');var timeout=require(_0xb71a('0x1'));var express=require('express');var router=express[_0xb71a('0x2')]();var auth=require(_0xb71a('0x3'));var interaction=require(_0xb71a('0x4'));var config=require(_0xb71a('0x5'));var controller=require(_0xb71a('0x6'));router[_0xb71a('0x7')]('/',auth[_0xb71a('0x8')](),controller[_0xb71a('0x9')]);router[_0xb71a('0x7')](_0xb71a('0xa'),auth[_0xb71a('0x8')](),controller[_0xb71a('0xb')]);router[_0xb71a('0xc')]('/',auth[_0xb71a('0x8')](),controller[_0xb71a('0xd')]);router[_0xb71a('0xe')](_0xb71a('0xa'),auth[_0xb71a('0x8')](),controller['update']);router[_0xb71a('0xf')]('/:id',auth[_0xb71a('0x8')](),controller[_0xb71a('0x10')]);module[_0xb71a('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index c72e232..1d3b789 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 _0x01e4=['sequelize','ENUM','string','customVariable','keyValue','STRING','variable'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x01e4,0x1d5));var _0x401e=function(_0x3725bd,_0x204f87){_0x3725bd=_0x3725bd-0x0;var _0x1d0404=_0x01e4[_0x3725bd];return _0x1d0404;};'use strict';var Sequelize=require(_0x401e('0x0'));module['exports']={'type':{'type':Sequelize[_0x401e('0x1')](_0x401e('0x2'),'variable',_0x401e('0x3'),_0x401e('0x4')),'defaultValue':_0x401e('0x2')},'content':{'type':Sequelize[_0x401e('0x5')]},'key':{'type':Sequelize[_0x401e('0x5')]},'keyType':{'type':Sequelize[_0x401e('0x1')](_0x401e('0x2'),_0x401e('0x6'),_0x401e('0x3'))},'keyContent':{'type':Sequelize[_0x401e('0x5')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0x401e('0x5')]}}; \ No newline at end of file +var _0xa203=['variable','exports','string','customVariable','STRING','ENUM'];(function(_0x30b00b,_0x621799){var _0x516958=function(_0xab5512){while(--_0xab5512){_0x30b00b['push'](_0x30b00b['shift']());}};_0x516958(++_0x621799);}(_0xa203,0x1ab));var _0x3a20=function(_0x3585e8,_0x53f4c7){_0x3585e8=_0x3585e8-0x0;var _0x31c7b5=_0xa203[_0x3585e8];return _0x31c7b5;};'use strict';var Sequelize=require('sequelize');module[_0x3a20('0x0')]={'type':{'type':Sequelize['ENUM'](_0x3a20('0x1'),'variable',_0x3a20('0x2'),'keyValue'),'defaultValue':_0x3a20('0x1')},'content':{'type':Sequelize[_0x3a20('0x3')]},'key':{'type':Sequelize[_0x3a20('0x3')]},'keyType':{'type':Sequelize[_0x3a20('0x4')](_0x3a20('0x1'),_0x3a20('0x5'),_0x3a20('0x2'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x3a20('0x3')]},'variableName':{'type':Sequelize[_0x3a20('0x3')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 8718ef9..7a99a34 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 _0xdb28=['json','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','SalesforceField','rawAttributes','fieldName','type','key','keys','query','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','sort','filter','merge','VIRTUAL','options','where','count','includeAll','include','findAll','rows','show','find','catch','create','body','params','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','end','status'];(function(_0x2f2e0e,_0x21a555){var _0xe1467c=function(_0x59e5b1){while(--_0x59e5b1){_0x2f2e0e['push'](_0x2f2e0e['shift']());}};_0xe1467c(++_0x21a555);}(_0xdb28,0x106));var _0x8db2=function(_0x339378,_0x527113){_0x339378=_0x339378-0x0;var _0x10f5b2=_0xdb28[_0x339378];return _0x10f5b2;};'use strict';var pdf=require(_0x8db2('0x0'));var emlformat=require(_0x8db2('0x1'));var rimraf=require(_0x8db2('0x2'));var zipdir=require(_0x8db2('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8db2('0x4'));var moment=require(_0x8db2('0x5'));var BPromise=require(_0x8db2('0x6'));var Mustache=require(_0x8db2('0x7'));var util=require(_0x8db2('0x8'));var path=require('path');var sox=require(_0x8db2('0x9'));var csv=require(_0x8db2('0xa'));var ejs=require('ejs');var fs=require('fs');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('0xa'));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 db=require(_0x8db2('0x17'))['db'];function respondWithStatusCode(_0x1349f6,_0x204f49){_0x204f49=_0x204f49||0xcc;return function(_0x37d017){if(_0x37d017){return _0x1349f6['sendStatus'](_0x204f49);}return _0x1349f6['status'](_0x204f49)[_0x8db2('0x18')]();};}function respondWithResult(_0x15e87c,_0x350d61){_0x350d61=_0x350d61||0xc8;return function(_0x1d6a15){if(_0x1d6a15){return _0x15e87c[_0x8db2('0x19')](_0x350d61)[_0x8db2('0x1a')](_0x1d6a15);}};}function respondWithFilteredResult(_0x2f177a,_0x3c96a7){return function(_0x131252){if(_0x131252){var _0x16c8c2=_0x131252['count'],_0x5489a9=_0x3c96a7[_0x8db2('0x1b')],_0x13b0f5=_0x3c96a7[_0x8db2('0x1b')]+_0x3c96a7[_0x8db2('0x1c')],_0x24da1b;if(_0x13b0f5>=_0x16c8c2){_0x13b0f5=_0x16c8c2;_0x24da1b=0xc8;}else{_0x24da1b=0xce;}_0x2f177a[_0x8db2('0x19')](_0x24da1b);return _0x2f177a[_0x8db2('0x1d')](_0x8db2('0x1e'),_0x5489a9+'-'+_0x13b0f5+'/'+_0x16c8c2)['json'](_0x131252);}return null;};}function patchUpdates(_0x5df464){return function(_0x77789){try{jsonpatch[_0x8db2('0x1f')](_0x77789,_0x5df464,!![]);}catch(_0x1310d3){return BPromise[_0x8db2('0x20')](_0x1310d3);}return _0x77789['save']();};}function saveUpdates(_0x431d60,_0x36a9ff){return function(_0x260940){if(_0x260940){return _0x260940[_0x8db2('0x21')](_0x431d60)[_0x8db2('0x22')](function(_0x597260){return _0x597260;});}return null;};}function removeEntity(_0x124467,_0x3e30e6){return function(_0x18f69c){if(_0x18f69c){return _0x18f69c[_0x8db2('0x23')]()[_0x8db2('0x22')](function(){_0x124467[_0x8db2('0x19')](0xcc)[_0x8db2('0x18')]();});}};}function handleEntityNotFound(_0x5c6614,_0x256202){return function(_0x4f6516){if(!_0x4f6516){_0x5c6614['sendStatus'](0x194);}return _0x4f6516;};}function handleError(_0x52a9ca,_0x4d923c){_0x4d923c=_0x4d923c||0x1f4;return function(_0xec8cd2){logger[_0x8db2('0x24')](_0xec8cd2[_0x8db2('0x25')]);if(_0xec8cd2[_0x8db2('0x26')]){delete _0xec8cd2[_0x8db2('0x26')];}_0x52a9ca[_0x8db2('0x19')](_0x4d923c)['send'](_0xec8cd2);};}exports[_0x8db2('0x27')]=function(_0x372311,_0x430dd5){var _0x8b7cec={},_0x483aee={},_0x2e0691={'count':0x0,'rows':[]};var _0x11f398=_[_0x8db2('0x28')](db[_0x8db2('0x29')][_0x8db2('0x2a')],function(_0x21bae5){return{'name':_0x21bae5[_0x8db2('0x2b')],'type':_0x21bae5[_0x8db2('0x2c')][_0x8db2('0x2d')]};});_0x483aee['model']=_[_0x8db2('0x28')](_0x11f398,'name');_0x483aee['query']=_[_0x8db2('0x2e')](_0x372311[_0x8db2('0x2f')]);_0x483aee[_0x8db2('0x30')]=_['intersection'](_0x483aee[_0x8db2('0x31')],_0x483aee['query']);_0x8b7cec[_0x8db2('0x32')]=_[_0x8db2('0x33')](_0x483aee[_0x8db2('0x31')],qs['fields'](_0x372311['query'][_0x8db2('0x34')]));_0x8b7cec[_0x8db2('0x32')]=_0x8b7cec['attributes']['length']?_0x8b7cec[_0x8db2('0x32')]:_0x483aee[_0x8db2('0x31')];if(!_0x372311[_0x8db2('0x2f')][_0x8db2('0x35')](_0x8db2('0x36'))){_0x8b7cec[_0x8db2('0x1c')]=qs[_0x8db2('0x1c')](_0x372311[_0x8db2('0x2f')][_0x8db2('0x1c')]);_0x8b7cec[_0x8db2('0x1b')]=qs['offset'](_0x372311[_0x8db2('0x2f')][_0x8db2('0x1b')]);}_0x8b7cec['order']=qs[_0x8db2('0x37')](_0x372311[_0x8db2('0x2f')]['sort']);_0x8b7cec['where']=qs[_0x8db2('0x30')](_['pick'](_0x372311[_0x8db2('0x2f')],_0x483aee[_0x8db2('0x30')]));if(_0x372311[_0x8db2('0x2f')][_0x8db2('0x38')]){_0x8b7cec['where']=_[_0x8db2('0x39')](_0x8b7cec['where'],{'$or':_[_0x8db2('0x28')](_0x11f398,function(_0xd550ae){if(_0xd550ae[_0x8db2('0x2c')]!==_0x8db2('0x3a')){var _0x50e88a={};_0x50e88a[_0xd550ae['name']]={'$like':'%'+_0x372311[_0x8db2('0x2f')][_0x8db2('0x38')]+'%'};return _0x50e88a;}})});}_0x8b7cec=_['merge']({},_0x8b7cec,_0x372311[_0x8db2('0x3b')]);var _0x24bcfe={'where':_0x8b7cec[_0x8db2('0x3c')]};return db['SalesforceField'][_0x8db2('0x3d')](_0x24bcfe)[_0x8db2('0x22')](function(_0x953349){_0x2e0691[_0x8db2('0x3d')]=_0x953349;if(_0x372311[_0x8db2('0x2f')][_0x8db2('0x3e')]){_0x8b7cec[_0x8db2('0x3f')]=[{'all':!![]}];}return db[_0x8db2('0x29')][_0x8db2('0x40')](_0x8b7cec);})[_0x8db2('0x22')](function(_0x21cf7c){_0x2e0691[_0x8db2('0x41')]=_0x21cf7c;return _0x2e0691;})[_0x8db2('0x22')](respondWithFilteredResult(_0x430dd5,_0x8b7cec))['catch'](handleError(_0x430dd5,null));};exports[_0x8db2('0x42')]=function(_0x2b2472,_0x5e0382){var _0x49a7ae={'raw':!![],'where':{'id':_0x2b2472['params']['id']}},_0x249c73={};_0x249c73[_0x8db2('0x31')]=_[_0x8db2('0x2e')](db[_0x8db2('0x29')][_0x8db2('0x2a')]);_0x249c73[_0x8db2('0x2f')]=_[_0x8db2('0x2e')](_0x2b2472[_0x8db2('0x2f')]);_0x249c73['filters']=_[_0x8db2('0x33')](_0x249c73[_0x8db2('0x31')],_0x249c73[_0x8db2('0x2f')]);_0x49a7ae[_0x8db2('0x32')]=_['intersection'](_0x249c73[_0x8db2('0x31')],qs[_0x8db2('0x34')](_0x2b2472[_0x8db2('0x2f')][_0x8db2('0x34')]));_0x49a7ae['attributes']=_0x49a7ae[_0x8db2('0x32')]['length']?_0x49a7ae[_0x8db2('0x32')]:_0x249c73[_0x8db2('0x31')];if(_0x2b2472[_0x8db2('0x2f')]['includeAll']){_0x49a7ae['include']=[{'all':!![]}];}_0x49a7ae=_[_0x8db2('0x39')]({},_0x49a7ae,_0x2b2472['options']);return db[_0x8db2('0x29')][_0x8db2('0x43')](_0x49a7ae)[_0x8db2('0x22')](handleEntityNotFound(_0x5e0382,null))[_0x8db2('0x22')](respondWithResult(_0x5e0382,null))[_0x8db2('0x44')](handleError(_0x5e0382,null));};exports[_0x8db2('0x45')]=function(_0x4355e2,_0xab6bdd){return db[_0x8db2('0x29')][_0x8db2('0x45')](_0x4355e2[_0x8db2('0x46')],{})[_0x8db2('0x22')](respondWithResult(_0xab6bdd,0xc9))['catch'](handleError(_0xab6bdd,null));};exports[_0x8db2('0x21')]=function(_0x2ada52,_0xdbba64){if(_0x2ada52[_0x8db2('0x46')]['id']){delete _0x2ada52['body']['id'];}return db['SalesforceField'][_0x8db2('0x43')]({'where':{'id':_0x2ada52[_0x8db2('0x47')]['id']}})[_0x8db2('0x22')](handleEntityNotFound(_0xdbba64,null))['then'](saveUpdates(_0x2ada52['body'],null))['then'](respondWithResult(_0xdbba64,null))[_0x8db2('0x44')](handleError(_0xdbba64,null));};exports[_0x8db2('0x23')]=function(_0x55c7dd,_0x383fa1){return db[_0x8db2('0x29')][_0x8db2('0x43')]({'where':{'id':_0x55c7dd[_0x8db2('0x47')]['id']}})['then'](handleEntityNotFound(_0x383fa1,null))['then'](removeEntity(_0x383fa1,null))[_0x8db2('0x44')](handleError(_0x383fa1,null));}; \ No newline at end of file +var _0xadb5=['name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','nolimit','order','sort','where','VIRTUAL','merge','options','SalesforceField','findAll','rows','catch','show','rawAttributes','fields','includeAll','include','find','create','body','update','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','limit','set','json','reject','save','then','destroy','stack'];(function(_0x5d6bd2,_0x4b1579){var _0x4ff0be=function(_0x40ceb9){while(--_0x40ceb9){_0x5d6bd2['push'](_0x5d6bd2['shift']());}};_0x4ff0be(++_0x4b1579);}(_0xadb5,0xad));var _0x5adb=function(_0x5536aa,_0x16e51f){_0x5536aa=_0x5536aa-0x0;var _0x1c5fc2=_0xadb5[_0x5536aa];return _0x1c5fc2;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5adb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5adb('0x1'));var jsonpatch=require(_0x5adb('0x2'));var rp=require(_0x5adb('0x3'));var moment=require('moment');var BPromise=require(_0x5adb('0x4'));var Mustache=require(_0x5adb('0x5'));var util=require(_0x5adb('0x6'));var path=require('path');var sox=require(_0x5adb('0x7'));var csv=require(_0x5adb('0x8'));var ejs=require(_0x5adb('0x9'));var fs=require('fs');var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x8'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var db=require(_0x5adb('0x17'))['db'];function respondWithStatusCode(_0x56012f,_0x2a0b70){_0x2a0b70=_0x2a0b70||0xcc;return function(_0x5433bf){if(_0x5433bf){return _0x56012f[_0x5adb('0x18')](_0x2a0b70);}return _0x56012f[_0x5adb('0x19')](_0x2a0b70)[_0x5adb('0x1a')]();};}function respondWithResult(_0x5c929a,_0x2a545b){_0x2a545b=_0x2a545b||0xc8;return function(_0x34af2c){if(_0x34af2c){return _0x5c929a[_0x5adb('0x19')](_0x2a545b)['json'](_0x34af2c);}};}function respondWithFilteredResult(_0x2312de,_0x518823){return function(_0x367d82){if(_0x367d82){var _0x42a482=_0x367d82[_0x5adb('0x1b')],_0x30614e=_0x518823[_0x5adb('0x1c')],_0x304784=_0x518823[_0x5adb('0x1c')]+_0x518823[_0x5adb('0x1d')],_0x1c0f97;if(_0x304784>=_0x42a482){_0x304784=_0x42a482;_0x1c0f97=0xc8;}else{_0x1c0f97=0xce;}_0x2312de['status'](_0x1c0f97);return _0x2312de[_0x5adb('0x1e')]('Content-Range',_0x30614e+'-'+_0x304784+'/'+_0x42a482)[_0x5adb('0x1f')](_0x367d82);}return null;};}function patchUpdates(_0x558f76){return function(_0x3ef465){try{jsonpatch['apply'](_0x3ef465,_0x558f76,!![]);}catch(_0x5e218c){return BPromise[_0x5adb('0x20')](_0x5e218c);}return _0x3ef465[_0x5adb('0x21')]();};}function saveUpdates(_0x438671,_0x1fd4a7){return function(_0x99bc6c){if(_0x99bc6c){return _0x99bc6c['update'](_0x438671)[_0x5adb('0x22')](function(_0x5c296e){return _0x5c296e;});}return null;};}function removeEntity(_0x4e9f16,_0x3754cc){return function(_0x379b33){if(_0x379b33){return _0x379b33[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0x4e9f16[_0x5adb('0x19')](0xcc)[_0x5adb('0x1a')]();});}};}function handleEntityNotFound(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(!_0x4b1957){_0xfd9bb9[_0x5adb('0x18')](0x194);}return _0x4b1957;};}function handleError(_0x3220cd,_0x3839fb){_0x3839fb=_0x3839fb||0x1f4;return function(_0xeb556c){logger['error'](_0xeb556c[_0x5adb('0x24')]);if(_0xeb556c[_0x5adb('0x25')]){delete _0xeb556c['name'];}_0x3220cd[_0x5adb('0x19')](_0x3839fb)[_0x5adb('0x26')](_0xeb556c);};}exports[_0x5adb('0x27')]=function(_0x55b40a,_0x13ad1d){var _0xbe21b1={},_0x3a4fca={},_0x2c64a3={'count':0x0,'rows':[]};var _0x36459b=_[_0x5adb('0x28')](db['SalesforceField']['rawAttributes'],function(_0x5d457e){return{'name':_0x5d457e[_0x5adb('0x29')],'type':_0x5d457e[_0x5adb('0x2a')][_0x5adb('0x2b')]};});_0x3a4fca[_0x5adb('0x2c')]=_[_0x5adb('0x28')](_0x36459b,'name');_0x3a4fca[_0x5adb('0x2d')]=_[_0x5adb('0x2e')](_0x55b40a[_0x5adb('0x2d')]);_0x3a4fca[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x3a4fca[_0x5adb('0x2c')],_0x3a4fca[_0x5adb('0x2d')]);_0xbe21b1[_0x5adb('0x31')]=_[_0x5adb('0x30')](_0x3a4fca[_0x5adb('0x2c')],qs['fields'](_0x55b40a[_0x5adb('0x2d')]['fields']));_0xbe21b1[_0x5adb('0x31')]=_0xbe21b1[_0x5adb('0x31')]['length']?_0xbe21b1[_0x5adb('0x31')]:_0x3a4fca[_0x5adb('0x2c')];if(!_0x55b40a[_0x5adb('0x2d')]['hasOwnProperty'](_0x5adb('0x32'))){_0xbe21b1[_0x5adb('0x1d')]=qs['limit'](_0x55b40a['query'][_0x5adb('0x1d')]);_0xbe21b1['offset']=qs[_0x5adb('0x1c')](_0x55b40a[_0x5adb('0x2d')][_0x5adb('0x1c')]);}_0xbe21b1[_0x5adb('0x33')]=qs[_0x5adb('0x34')](_0x55b40a['query'][_0x5adb('0x34')]);_0xbe21b1[_0x5adb('0x35')]=qs[_0x5adb('0x2f')](_['pick'](_0x55b40a['query'],_0x3a4fca[_0x5adb('0x2f')]));if(_0x55b40a[_0x5adb('0x2d')]['filter']){_0xbe21b1[_0x5adb('0x35')]=_['merge'](_0xbe21b1[_0x5adb('0x35')],{'$or':_['map'](_0x36459b,function(_0x11cb37){if(_0x11cb37['type']!==_0x5adb('0x36')){var _0x23a1db={};_0x23a1db[_0x11cb37['name']]={'$like':'%'+_0x55b40a[_0x5adb('0x2d')]['filter']+'%'};return _0x23a1db;}})});}_0xbe21b1=_[_0x5adb('0x37')]({},_0xbe21b1,_0x55b40a[_0x5adb('0x38')]);var _0xd5660c={'where':_0xbe21b1['where']};return db[_0x5adb('0x39')][_0x5adb('0x1b')](_0xd5660c)[_0x5adb('0x22')](function(_0x132803){_0x2c64a3[_0x5adb('0x1b')]=_0x132803;if(_0x55b40a['query']['includeAll']){_0xbe21b1['include']=[{'all':!![]}];}return db['SalesforceField'][_0x5adb('0x3a')](_0xbe21b1);})[_0x5adb('0x22')](function(_0x3a104a){_0x2c64a3[_0x5adb('0x3b')]=_0x3a104a;return _0x2c64a3;})[_0x5adb('0x22')](respondWithFilteredResult(_0x13ad1d,_0xbe21b1))[_0x5adb('0x3c')](handleError(_0x13ad1d,null));};exports[_0x5adb('0x3d')]=function(_0x3bf282,_0x478a70){var _0x53f2c6={'raw':!![],'where':{'id':_0x3bf282['params']['id']}},_0x27dbb7={};_0x27dbb7[_0x5adb('0x2c')]=_[_0x5adb('0x2e')](db[_0x5adb('0x39')][_0x5adb('0x3e')]);_0x27dbb7[_0x5adb('0x2d')]=_['keys'](_0x3bf282[_0x5adb('0x2d')]);_0x27dbb7[_0x5adb('0x2f')]=_['intersection'](_0x27dbb7[_0x5adb('0x2c')],_0x27dbb7[_0x5adb('0x2d')]);_0x53f2c6['attributes']=_[_0x5adb('0x30')](_0x27dbb7[_0x5adb('0x2c')],qs[_0x5adb('0x3f')](_0x3bf282[_0x5adb('0x2d')][_0x5adb('0x3f')]));_0x53f2c6[_0x5adb('0x31')]=_0x53f2c6[_0x5adb('0x31')]['length']?_0x53f2c6['attributes']:_0x27dbb7[_0x5adb('0x2c')];if(_0x3bf282[_0x5adb('0x2d')][_0x5adb('0x40')]){_0x53f2c6[_0x5adb('0x41')]=[{'all':!![]}];}_0x53f2c6=_['merge']({},_0x53f2c6,_0x3bf282['options']);return db[_0x5adb('0x39')][_0x5adb('0x42')](_0x53f2c6)[_0x5adb('0x22')](handleEntityNotFound(_0x478a70,null))[_0x5adb('0x22')](respondWithResult(_0x478a70,null))[_0x5adb('0x3c')](handleError(_0x478a70,null));};exports['create']=function(_0x182cbc,_0x437f52){return db['SalesforceField'][_0x5adb('0x43')](_0x182cbc[_0x5adb('0x44')],{})[_0x5adb('0x22')](respondWithResult(_0x437f52,0xc9))[_0x5adb('0x3c')](handleError(_0x437f52,null));};exports[_0x5adb('0x45')]=function(_0x3a5409,_0x39840e){if(_0x3a5409[_0x5adb('0x44')]['id']){delete _0x3a5409['body']['id'];}return db[_0x5adb('0x39')]['find']({'where':{'id':_0x3a5409['params']['id']}})['then'](handleEntityNotFound(_0x39840e,null))[_0x5adb('0x22')](saveUpdates(_0x3a5409[_0x5adb('0x44')],null))[_0x5adb('0x22')](respondWithResult(_0x39840e,null))['catch'](handleError(_0x39840e,null));};exports[_0x5adb('0x23')]=function(_0x5cbab5,_0x177a81){return db[_0x5adb('0x39')][_0x5adb('0x42')]({'where':{'id':_0x5cbab5['params']['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x177a81,null))['then'](removeEntity(_0x177a81,null))[_0x5adb('0x3c')](handleError(_0x177a81,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 74ca6a3..ae103f2 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 _0x3d11=['bluebird','request-promise','../../config/environment','exports','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment'];(function(_0x16603,_0x6ed176){var _0x36c7d1=function(_0x48afe5){while(--_0x48afe5){_0x16603['push'](_0x16603['shift']());}};_0x36c7d1(++_0x6ed176);}(_0x3d11,0x105));var _0x13d1=function(_0x2dc1a0,_0x29cf94){_0x2dc1a0=_0x2dc1a0-0x0;var _0x3d7e3d=_0x3d11[_0x2dc1a0];return _0x3d7e3d;};'use strict';var _=require(_0x13d1('0x0'));var util=require(_0x13d1('0x1'));var logger=require(_0x13d1('0x2'))(_0x13d1('0x3'));var moment=require(_0x13d1('0x4'));var BPromise=require(_0x13d1('0x5'));var rp=require(_0x13d1('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x13d1('0x7'));var attributes=require('./intSalesforceField.attributes');module[_0x13d1('0x8')]=function(_0x496e02,_0x5537ec){return _0x496e02['define'](_0x13d1('0x9'),attributes,{'tableName':_0x13d1('0xa'),'paranoid':![],'indexes':[{'name':_0x13d1('0xb'),'fields':[_0x13d1('0xc'),_0x13d1('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9ec4=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','int_salesforce_fields','idField','lodash','util','api'];(function(_0x39286f,_0x1cd75a){var _0x34a7e9=function(_0x5c8568){while(--_0x5c8568){_0x39286f['push'](_0x39286f['shift']());}};_0x34a7e9(++_0x1cd75a);}(_0x9ec4,0xda));var _0x49ec=function(_0x5339c3,_0x153681){_0x5339c3=_0x5339c3-0x0;var _0x399754=_0x9ec4[_0x5339c3];return _0x399754;};'use strict';var _=require(_0x49ec('0x0'));var util=require(_0x49ec('0x1'));var logger=require('../../config/logger')(_0x49ec('0x2'));var moment=require(_0x49ec('0x3'));var BPromise=require(_0x49ec('0x4'));var rp=require(_0x49ec('0x5'));var fs=require('fs');var path=require(_0x49ec('0x6'));var rimraf=require(_0x49ec('0x7'));var config=require(_0x49ec('0x8'));var attributes=require('./intSalesforceField.attributes');module[_0x49ec('0x9')]=function(_0x470bf0,_0x22f99d){return _0x470bf0[_0x49ec('0xa')]('SalesforceField',attributes,{'tableName':_0x49ec('0xb'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x49ec('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index 047dff3..5c579be 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 _0x5b02=['client','then','info','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x5b02,0xe9));var _0x25b0=function(_0x391318,_0x272996){_0x391318=_0x391318-0x0;var _0x3bae1d=_0x5b02[_0x391318];return _0x3bae1d;};'use strict';var _=require(_0x25b0('0x0'));var util=require(_0x25b0('0x1'));var moment=require(_0x25b0('0x2'));var BPromise=require(_0x25b0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x25b0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x25b0('0x5'))(_0x25b0('0x6'));var config=require(_0x25b0('0x7'));var jayson=require(_0x25b0('0x8'));var client=jayson[_0x25b0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d82c6,_0xd8276d,_0x49ef3a){return new BPromise(function(_0x412954,_0x4d3e71){return client['request'](_0x1d82c6,_0x49ef3a)[_0x25b0('0xa')](function(_0x45429b){logger[_0x25b0('0xb')]('SalesforceField,\x20%s,\x20%s',_0xd8276d,_0x25b0('0xc'));logger[_0x25b0('0xd')](_0x25b0('0xe'),_0xd8276d,_0x25b0('0xc'),JSON[_0x25b0('0xf')](_0x45429b));if(_0x45429b[_0x25b0('0x10')]){if(_0x45429b[_0x25b0('0x10')][_0x25b0('0x11')]===0x1f4){logger[_0x25b0('0x10')](_0x25b0('0x12'),_0xd8276d,_0x45429b[_0x25b0('0x10')][_0x25b0('0x13')]);return _0x4d3e71(_0x45429b[_0x25b0('0x10')][_0x25b0('0x13')]);}logger[_0x25b0('0x10')](_0x25b0('0x12'),_0xd8276d,_0x45429b[_0x25b0('0x10')][_0x25b0('0x13')]);return _0x412954(_0x45429b[_0x25b0('0x10')][_0x25b0('0x13')]);}else{logger[_0x25b0('0xb')]('SalesforceField,\x20%s,\x20%s',_0xd8276d,'request\x20sent');_0x412954(_0x45429b[_0x25b0('0x14')]['message']);}})[_0x25b0('0x15')](function(_0x1d009f){logger[_0x25b0('0x10')](_0x25b0('0x12'),_0xd8276d,_0x1d009f);_0x4d3e71(_0x1d009f);});});} \ No newline at end of file +var _0xe706=['http','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\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(_0xbd8732,_0x18660b){var _0x2d4549=function(_0xbb7246){while(--_0xbb7246){_0xbd8732['push'](_0xbd8732['shift']());}};_0x2d4549(++_0x18660b);}(_0xe706,0xa3));var _0x6e70=function(_0x5ddda9,_0x43e558){_0x5ddda9=_0x5ddda9-0x0;var _0x53a004=_0xe706[_0x5ddda9];return _0x53a004;};'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']('SalesforceField,\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']('SalesforceField,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 255e4bd..dbdbc12 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 _0x0fcd=['/:id/configurations','getConfigurations','/:id/fields','create','post','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','show'];(function(_0x43aaf9,_0xd6c15f){var _0x5df0db=function(_0x1fdd49){while(--_0x1fdd49){_0x43aaf9['push'](_0x43aaf9['shift']());}};_0x5df0db(++_0xd6c15f);}(_0x0fcd,0x129));var _0xd0fc=function(_0xa926a6,_0x4c4e41){_0xa926a6=_0xa926a6-0x0;var _0x525943=_0x0fcd[_0xa926a6];return _0x525943;};'use strict';var multer=require('multer');var util=require(_0xd0fc('0x0'));var path=require(_0xd0fc('0x1'));var timeout=require(_0xd0fc('0x2'));var express=require(_0xd0fc('0x3'));var router=express[_0xd0fc('0x4')]();var auth=require(_0xd0fc('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd0fc('0x6'));var controller=require(_0xd0fc('0x7'));router[_0xd0fc('0x8')]('/',auth[_0xd0fc('0x9')](),controller['index']);router[_0xd0fc('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xd0fc('0xa')]);router['get'](_0xd0fc('0xb'),auth[_0xd0fc('0x9')](),controller[_0xd0fc('0xc')]);router['get'](_0xd0fc('0xd'),auth[_0xd0fc('0x9')](),controller['getFields']);router['post']('/',auth[_0xd0fc('0x9')](),controller[_0xd0fc('0xe')]);router[_0xd0fc('0xf')]('/:id/configurations',auth[_0xd0fc('0x9')](),controller['addConfiguration']);router[_0xd0fc('0x10')](_0xd0fc('0x11'),auth['isAuthenticated'](),controller[_0xd0fc('0x12')]);router[_0xd0fc('0x13')](_0xd0fc('0x11'),auth['isAuthenticated'](),controller[_0xd0fc('0x14')]);module[_0xd0fc('0x15')]=router; \ No newline at end of file +var _0xab36=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xab36,0x1df));var _0x6ab3=function(_0x2a450d,_0x1a85c4){_0x2a450d=_0x2a450d-0x0;var _0x3639c6=_0xab36[_0x2a450d];return _0x3639c6;};'use strict';var multer=require(_0x6ab3('0x0'));var util=require(_0x6ab3('0x1'));var path=require(_0x6ab3('0x2'));var timeout=require(_0x6ab3('0x3'));var express=require(_0x6ab3('0x4'));var router=express['Router']();var auth=require(_0x6ab3('0x5'));var interaction=require(_0x6ab3('0x6'));var config=require(_0x6ab3('0x7'));var controller=require('./intServicenowAccount.controller');router[_0x6ab3('0x8')]('/',auth[_0x6ab3('0x9')](),controller[_0x6ab3('0xa')]);router[_0x6ab3('0x8')](_0x6ab3('0xb'),auth[_0x6ab3('0x9')](),controller['show']);router[_0x6ab3('0x8')](_0x6ab3('0xc'),auth['isAuthenticated'](),controller[_0x6ab3('0xd')]);router['get'](_0x6ab3('0xe'),auth[_0x6ab3('0x9')](),controller[_0x6ab3('0xf')]);router[_0x6ab3('0x10')]('/',auth[_0x6ab3('0x9')](),controller[_0x6ab3('0x11')]);router['post'](_0x6ab3('0xc'),auth['isAuthenticated'](),controller[_0x6ab3('0x12')]);router[_0x6ab3('0x13')](_0x6ab3('0xb'),auth[_0x6ab3('0x9')](),controller[_0x6ab3('0x14')]);router['delete'](_0x6ab3('0xb'),auth[_0x6ab3('0x9')](),controller[_0x6ab3('0x15')]);module[_0x6ab3('0x16')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index c12251f..082bc29 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 _0xfd55=['username','sequelize','exports','STRING'];(function(_0x1f2ba4,_0x133a89){var _0xc809f1=function(_0xc21346){while(--_0xc21346){_0x1f2ba4['push'](_0x1f2ba4['shift']());}};_0xc809f1(++_0x133a89);}(_0xfd55,0x195));var _0x5fd5=function(_0x1e5c49,_0x5a2135){_0x1e5c49=_0x1e5c49-0x0;var _0x11a8cd=_0xfd55[_0x1e5c49];return _0x11a8cd;};'use strict';var Sequelize=require(_0x5fd5('0x0'));module[_0x5fd5('0x1')]={'name':{'type':Sequelize[_0x5fd5('0x2')]},'description':{'type':Sequelize[_0x5fd5('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x5fd5('0x3')},'password':{'type':Sequelize[_0x5fd5('0x2')]},'email':{'type':Sequelize[_0x5fd5('0x2')]},'remoteUri':{'type':Sequelize[_0x5fd5('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3656=['STRING','username','remoteUri','sequelize','exports'];(function(_0x10415d,_0x498e46){var _0x36b526=function(_0x17515e){while(--_0x17515e){_0x10415d['push'](_0x10415d['shift']());}};_0x36b526(++_0x498e46);}(_0x3656,0x120));var _0x6365=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x3656[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0x6365('0x0'));module[_0x6365('0x1')]={'name':{'type':Sequelize[_0x6365('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x6365('0x3')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x6365('0x2')]},'remoteUri':{'type':Sequelize[_0x6365('0x2')],'unique':_0x6365('0x4')},'serverUrl':{'type':Sequelize[_0x6365('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 7c763bd..41dd256 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 _0x20eb=['../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','ValidationError','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','name','index','ServicenowAccount','rawAttributes','key','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','create','body','params','find','getConfigurations','ServicenowConfiguration','nolimit','AccountId','Subjects','channel','type','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','severity','category','parent','caused_by','watch_list','sys_updated_on','child_incidents','approval_history','resolved_by','user_input','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','correlation_display','delivery_task','work_start','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','assigned_to','comments','sla_due','approval','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','findOne','password','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','GET','incident?sysparm_display_value=all','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','push','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','statusCode','stack','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment'];(function(_0x416578,_0x335c45){var _0x116740=function(_0x175eab){while(--_0x175eab){_0x416578['push'](_0x416578['shift']());}};_0x116740(++_0x335c45);}(_0x20eb,0xb5));var _0xb20e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x20eb[_0x28947d];return _0x12d2ee;};'use strict';var pdf=require(_0xb20e('0x0'));var emlformat=require(_0xb20e('0x1'));var rimraf=require(_0xb20e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb20e('0x3'));var rp=require(_0xb20e('0x4'));var moment=require(_0xb20e('0x5'));var BPromise=require(_0xb20e('0x6'));var Mustache=require(_0xb20e('0x7'));var util=require(_0xb20e('0x8'));var path=require(_0xb20e('0x9'));var sox=require('sox');var csv=require(_0xb20e('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb20e('0xb'));var squel=require(_0xb20e('0xc'));var crypto=require('crypto');var jsforce=require(_0xb20e('0xd'));var deskjs=require(_0xb20e('0xe'));var toCsv=require(_0xb20e('0xa'));var querystring=require(_0xb20e('0xf'));var Papa=require(_0xb20e('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb20e('0x11'));var as=require(_0xb20e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb20e('0x13'))('api');var utils=require(_0xb20e('0x14'));var config=require(_0xb20e('0x15'));var db=require(_0xb20e('0x16'))['db'];var integrations=require(_0xb20e('0x17'));var jayson=require(_0xb20e('0x18'));var client=jayson[_0xb20e('0x19')][_0xb20e('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x12f6c6,_0xa530bc,_0x40227d){if(_0x40227d){var _0xd4ef91=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xd4ef91[_0xb20e('0x1b')](_0xa530bc)){return _0x12f6c6;}else{throw new db[(_0xb20e('0x1c'))][(_0xb20e('0x1d'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x12f6c6;}}function respondWithRpcPromise(_0x560c36,_0x2f30b7,_0x3d9efc,_0x52249f){return new BPromise(function(_0x195d28,_0x5452e1){var _0x41163d=_0x52249f||client;return _0x41163d[_0xb20e('0x1e')](_0x560c36,_0x3d9efc)[_0xb20e('0x1f')](function(_0x16bb59){logger[_0xb20e('0x20')](_0xb20e('0x21'),_0x2f30b7,_0xb20e('0x22'));logger[_0xb20e('0x23')](_0xb20e('0x24'),_0x2f30b7,_0xb20e('0x22'),JSON['stringify'](_0x16bb59));if(_0x16bb59[_0xb20e('0x25')]){if(_0x16bb59[_0xb20e('0x25')][_0xb20e('0x26')]===0x1f4){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x2f30b7,_0x16bb59[_0xb20e('0x25')][_0xb20e('0x27')]);return _0x5452e1(_0x16bb59[_0xb20e('0x25')][_0xb20e('0x27')]);}logger[_0xb20e('0x25')]('ServicenowAccount,\x20%s,\x20%s',_0x2f30b7,_0x16bb59[_0xb20e('0x25')]['message']);return _0x195d28(_0x16bb59[_0xb20e('0x25')][_0xb20e('0x27')]);}else{logger[_0xb20e('0x20')](_0xb20e('0x21'),_0x2f30b7,'request\x20sent');_0x195d28(_0x16bb59[_0xb20e('0x28')][_0xb20e('0x27')]);}})[_0xb20e('0x29')](function(_0x59bf7a){logger['error'](_0xb20e('0x21'),_0x2f30b7,_0x59bf7a);_0x5452e1(_0x59bf7a);});});}function respondWithStatusCode(_0x261624,_0x53ca5b){_0x53ca5b=_0x53ca5b||0xcc;return function(_0x5d9cb8){if(_0x5d9cb8){return _0x261624[_0xb20e('0x2a')](_0x53ca5b);}return _0x261624[_0xb20e('0x2b')](_0x53ca5b)[_0xb20e('0x2c')]();};}function respondWithResult(_0x55c6c5,_0x4c4cbd){_0x4c4cbd=_0x4c4cbd||0xc8;return function(_0x38f9c3){if(_0x38f9c3){return _0x55c6c5[_0xb20e('0x2b')](_0x4c4cbd)[_0xb20e('0x2d')](_0x38f9c3);}};}function respondWithFilteredResult(_0x123d3f,_0x3eebd3){return function(_0x36d389){if(_0x36d389){var _0x52b0cb=_0x36d389[_0xb20e('0x2e')],_0xe5b880=_0x3eebd3[_0xb20e('0x2f')],_0x46778b=_0x3eebd3[_0xb20e('0x2f')]+_0x3eebd3[_0xb20e('0x30')],_0x1eb6f8;if(_0x46778b>=_0x52b0cb){_0x46778b=_0x52b0cb;_0x1eb6f8=0xc8;}else{_0x1eb6f8=0xce;}_0x123d3f['status'](_0x1eb6f8);return _0x123d3f[_0xb20e('0x31')](_0xb20e('0x32'),_0xe5b880+'-'+_0x46778b+'/'+_0x52b0cb)[_0xb20e('0x2d')](_0x36d389);}return null;};}function patchUpdates(_0x418f2d){return function(_0x5699bc){try{jsonpatch[_0xb20e('0x33')](_0x5699bc,_0x418f2d,!![]);}catch(_0x44b191){return BPromise[_0xb20e('0x34')](_0x44b191);}return _0x5699bc['save']();};}function saveUpdates(_0x57330f,_0x321613){return function(_0x3309ea){if(_0x3309ea){return _0x3309ea[_0xb20e('0x35')](_0x57330f)[_0xb20e('0x1f')](function(_0x49b89a){return _0x49b89a;});}return null;};}function removeEntity(_0x45bafd,_0x2c09b2){return function(_0x554ba9){if(_0x554ba9){return _0x554ba9[_0xb20e('0x36')]()['then'](function(){_0x45bafd[_0xb20e('0x2b')](0xcc)[_0xb20e('0x2c')]();});}};}function handleEntityNotFound(_0x1abdf1,_0x45abed){return function(_0x4b5105){if(!_0x4b5105){_0x1abdf1[_0xb20e('0x2a')](0x194);}return _0x4b5105;};}function handleError(_0xdf7b0e,_0x51faa9){_0x51faa9=_0x51faa9||0x1f4;return function(_0x560c14){logger['error'](_0x560c14['stack']);if(_0x560c14[_0xb20e('0x37')]){delete _0x560c14[_0xb20e('0x37')];}_0xdf7b0e[_0xb20e('0x2b')](_0x51faa9)['send'](_0x560c14);};}exports[_0xb20e('0x38')]=function(_0x3b2586,_0x59c775){var _0x63e284={},_0x3bd0fe={},_0x58905a={'count':0x0,'rows':[]};var _0x57da4f=_['map'](db[_0xb20e('0x39')][_0xb20e('0x3a')],function(_0x3f8ea5){return{'name':_0x3f8ea5['fieldName'],'type':_0x3f8ea5['type'][_0xb20e('0x3b')]};});_0x3bd0fe['model']=_[_0xb20e('0x3c')](_0x57da4f,'name');_0x3bd0fe[_0xb20e('0x3d')]=_[_0xb20e('0x3e')](_0x3b2586['query']);_0x3bd0fe[_0xb20e('0x3f')]=_['intersection'](_0x3bd0fe[_0xb20e('0x40')],_0x3bd0fe[_0xb20e('0x3d')]);_0x63e284[_0xb20e('0x41')]=_[_0xb20e('0x42')](_0x3bd0fe[_0xb20e('0x40')],qs['fields'](_0x3b2586[_0xb20e('0x3d')][_0xb20e('0x43')]));_0x63e284[_0xb20e('0x41')]=_0x63e284[_0xb20e('0x41')][_0xb20e('0x44')]?_0x63e284['attributes']:_0x3bd0fe[_0xb20e('0x40')];if(!_0x3b2586[_0xb20e('0x3d')][_0xb20e('0x45')]('nolimit')){_0x63e284['limit']=qs['limit'](_0x3b2586[_0xb20e('0x3d')][_0xb20e('0x30')]);_0x63e284[_0xb20e('0x2f')]=qs[_0xb20e('0x2f')](_0x3b2586[_0xb20e('0x3d')][_0xb20e('0x2f')]);}_0x63e284[_0xb20e('0x46')]=qs[_0xb20e('0x47')](_0x3b2586[_0xb20e('0x3d')][_0xb20e('0x47')]);_0x63e284[_0xb20e('0x48')]=qs['filters'](_[_0xb20e('0x49')](_0x3b2586[_0xb20e('0x3d')],_0x3bd0fe[_0xb20e('0x3f')]));if(_0x3b2586['query'][_0xb20e('0x4a')]){_0x63e284['where']=_[_0xb20e('0x4b')](_0x63e284[_0xb20e('0x48')],{'$or':_[_0xb20e('0x3c')](_0x57da4f,function(_0x1318a7){if(_0x1318a7['type']!==_0xb20e('0x4c')){var _0x38aa37={};_0x38aa37[_0x1318a7[_0xb20e('0x37')]]={'$like':'%'+_0x3b2586[_0xb20e('0x3d')][_0xb20e('0x4a')]+'%'};return _0x38aa37;}})});}_0x63e284=_[_0xb20e('0x4b')]({},_0x63e284,_0x3b2586[_0xb20e('0x4d')]);var _0x3ccbb1={'where':_0x63e284[_0xb20e('0x48')]};return db['ServicenowAccount']['count'](_0x3ccbb1)['then'](function(_0x6ab9b7){_0x58905a[_0xb20e('0x2e')]=_0x6ab9b7;if(_0x3b2586[_0xb20e('0x3d')][_0xb20e('0x4e')]){_0x63e284[_0xb20e('0x4f')]=[{'all':!![]}];}return db['ServicenowAccount']['findAll'](_0x63e284);})[_0xb20e('0x1f')](function(_0x425d74){_0x58905a[_0xb20e('0x50')]=_0x425d74;return _0x58905a;})[_0xb20e('0x1f')](respondWithFilteredResult(_0x59c775,_0x63e284))['catch'](handleError(_0x59c775,null));};exports['show']=function(_0x4edf7e,_0x376789){var _0x5c9709={'raw':![],'where':{'id':_0x4edf7e['params']['id']}},_0x4aac81={};_0x4aac81['model']=_[_0xb20e('0x3e')](db[_0xb20e('0x39')][_0xb20e('0x3a')]);_0x4aac81['query']=_[_0xb20e('0x3e')](_0x4edf7e[_0xb20e('0x3d')]);_0x4aac81[_0xb20e('0x3f')]=_[_0xb20e('0x42')](_0x4aac81[_0xb20e('0x40')],_0x4aac81[_0xb20e('0x3d')]);_0x5c9709[_0xb20e('0x41')]=_['intersection'](_0x4aac81['model'],qs[_0xb20e('0x43')](_0x4edf7e[_0xb20e('0x3d')][_0xb20e('0x43')]));_0x5c9709['attributes']=_0x5c9709[_0xb20e('0x41')][_0xb20e('0x44')]?_0x5c9709[_0xb20e('0x41')]:_0x4aac81[_0xb20e('0x40')];if(_0x4edf7e[_0xb20e('0x3d')][_0xb20e('0x4e')]){_0x5c9709[_0xb20e('0x4f')]=[{'all':!![]}];}_0x5c9709=_[_0xb20e('0x4b')]({},_0x5c9709,_0x4edf7e[_0xb20e('0x4d')]);return db[_0xb20e('0x39')]['find'](_0x5c9709)[_0xb20e('0x1f')](handleEntityNotFound(_0x376789,null))[_0xb20e('0x1f')](respondWithResult(_0x376789,null))[_0xb20e('0x29')](handleError(_0x376789,null));};exports[_0xb20e('0x51')]=function(_0x18f806,_0x42f911){return db[_0xb20e('0x39')][_0xb20e('0x51')](_0x18f806[_0xb20e('0x52')],{})[_0xb20e('0x1f')](respondWithResult(_0x42f911,0xc9))[_0xb20e('0x29')](handleError(_0x42f911,null));};exports[_0xb20e('0x35')]=function(_0x318a2a,_0xb86b){if(_0x318a2a['body']['id']){delete _0x318a2a[_0xb20e('0x52')]['id'];}return db[_0xb20e('0x39')]['find']({'where':{'id':_0x318a2a[_0xb20e('0x53')]['id']}})[_0xb20e('0x1f')](handleEntityNotFound(_0xb86b,null))[_0xb20e('0x1f')](saveUpdates(_0x318a2a[_0xb20e('0x52')],null))['then'](respondWithResult(_0xb86b,null))[_0xb20e('0x29')](handleError(_0xb86b,null));};exports[_0xb20e('0x36')]=function(_0xaec87b,_0x40add4){return db[_0xb20e('0x39')][_0xb20e('0x54')]({'where':{'id':_0xaec87b[_0xb20e('0x53')]['id']}})[_0xb20e('0x1f')](handleEntityNotFound(_0x40add4,null))[_0xb20e('0x1f')](removeEntity(_0x40add4,null))[_0xb20e('0x29')](handleError(_0x40add4,null));};exports[_0xb20e('0x55')]=function(_0x5a85c7,_0x33d819,_0x150a89){var _0x3ce06c={};var _0x31e83f={};var _0x99eedf;var _0x47267a;return db[_0xb20e('0x39')]['findOne']({'where':{'id':_0x5a85c7['params']['id']}})[_0xb20e('0x1f')](handleEntityNotFound(_0x33d819,null))['then'](function(_0x3ba81f){if(_0x3ba81f){_0x99eedf=_0x3ba81f;_0x31e83f[_0xb20e('0x40')]=_[_0xb20e('0x3e')](db[_0xb20e('0x56')]['rawAttributes']);_0x31e83f[_0xb20e('0x3d')]=_['keys'](_0x5a85c7[_0xb20e('0x3d')]);_0x31e83f[_0xb20e('0x3f')]=_['intersection'](_0x31e83f['model'],_0x31e83f[_0xb20e('0x3d')]);_0x3ce06c[_0xb20e('0x41')]=_[_0xb20e('0x42')](_0x31e83f[_0xb20e('0x40')],qs[_0xb20e('0x43')](_0x5a85c7[_0xb20e('0x3d')][_0xb20e('0x43')]));_0x3ce06c[_0xb20e('0x41')]=_0x3ce06c[_0xb20e('0x41')][_0xb20e('0x44')]?_0x3ce06c[_0xb20e('0x41')]:_0x31e83f['model'];_0x3ce06c[_0xb20e('0x46')]=qs[_0xb20e('0x47')](_0x5a85c7[_0xb20e('0x3d')][_0xb20e('0x47')]);_0x3ce06c['where']=qs[_0xb20e('0x3f')](_[_0xb20e('0x49')](_0x5a85c7[_0xb20e('0x3d')],_0x31e83f[_0xb20e('0x3f')]));if(_0x5a85c7['query']['filter']){_0x3ce06c[_0xb20e('0x48')]=_[_0xb20e('0x4b')](_0x3ce06c['where'],{'$or':_[_0xb20e('0x3c')](_0x3ce06c[_0xb20e('0x41')],function(_0xabaf9f){var _0x20a823={};_0x20a823[_0xabaf9f]={'$like':'%'+_0x5a85c7[_0xb20e('0x3d')][_0xb20e('0x4a')]+'%'};return _0x20a823;})});}_0x3ce06c=_['merge']({},_0x3ce06c,_0x5a85c7[_0xb20e('0x4d')]);return _0x99eedf[_0xb20e('0x55')](_0x3ce06c);}})[_0xb20e('0x1f')](function(_0x49fb24){if(_0x49fb24){_0x47267a=_0x49fb24[_0xb20e('0x44')];if(!_0x5a85c7[_0xb20e('0x3d')]['hasOwnProperty'](_0xb20e('0x57'))){_0x3ce06c[_0xb20e('0x30')]=qs[_0xb20e('0x30')](_0x5a85c7[_0xb20e('0x3d')]['limit']);_0x3ce06c[_0xb20e('0x2f')]=qs[_0xb20e('0x2f')](_0x5a85c7[_0xb20e('0x3d')][_0xb20e('0x2f')]);}return _0x99eedf[_0xb20e('0x55')](_0x3ce06c);}})[_0xb20e('0x1f')](function(_0x56735a){if(_0x56735a){return _0x56735a?{'count':_0x47267a,'rows':_0x56735a}:null;}})[_0xb20e('0x1f')](respondWithResult(_0x33d819,null))[_0xb20e('0x29')](handleError(_0x33d819,null));};exports['addConfiguration']=function(_0x565e63,_0x1f2930,_0x2cb166){if(_0x565e63[_0xb20e('0x52')]['id']){delete _0x565e63[_0xb20e('0x52')]['id'];}return db[_0xb20e('0x39')]['findOne']({'where':{'id':_0x565e63[_0xb20e('0x53')]['id']}})[_0xb20e('0x1f')](handleEntityNotFound(_0x1f2930,null))['then'](function(_0x3481bd){if(_0x3481bd){_0x565e63[_0xb20e('0x52')][_0xb20e('0x58')]=_0x3481bd['id'];_0x565e63[_0xb20e('0x52')][_0xb20e('0x59')]=integrations['getSubjects'](_0x565e63[_0xb20e('0x52')][_0xb20e('0x5a')],_0x565e63[_0xb20e('0x52')][_0xb20e('0x5b')]);_0x565e63[_0xb20e('0x52')][_0xb20e('0x5c')]=integrations[_0xb20e('0x5d')](_0x565e63[_0xb20e('0x52')][_0xb20e('0x5a')],_0x565e63[_0xb20e('0x52')]['type']);return db[_0xb20e('0x56')][_0xb20e('0x51')](_0x565e63[_0xb20e('0x52')],{'include':[{'model':db['ServicenowField'],'as':_0xb20e('0x59')},{'model':db[_0xb20e('0x5e')],'as':_0xb20e('0x5c')}]});}return null;})[_0xb20e('0x1f')](respondWithResult(_0x1f2930,null))[_0xb20e('0x29')](handleError(_0x1f2930,null));};exports[_0xb20e('0x5f')]=function(_0x269a5a,_0x5c97a6,_0x485824){var _0x323c70=[_0xb20e('0x60'),_0xb20e('0x61'),_0xb20e('0x62'),_0xb20e('0x63'),_0xb20e('0x64'),_0xb20e('0x65'),_0xb20e('0x66'),_0xb20e('0x67'),_0xb20e('0x68')];var _0x58ee0c=[_0xb20e('0x69'),_0xb20e('0x60'),_0xb20e('0x6a'),_0xb20e('0x6b'),'upon_reject',_0xb20e('0x6c'),_0xb20e('0x6d'),_0xb20e('0x61'),_0xb20e('0x6e'),'number',_0xb20e('0x6f'),'sys_updated_by','opened_by',_0xb20e('0x70'),_0xb20e('0x71'),_0xb20e('0x72'),_0xb20e('0x73'),_0xb20e('0x74'),_0xb20e('0x62'),_0xb20e('0x46'),_0xb20e('0x75'),_0xb20e('0x76'),_0xb20e('0x77'),_0xb20e('0x78'),_0xb20e('0x79'),_0xb20e('0x7a'),_0xb20e('0x7b'),_0xb20e('0x7c'),'priority',_0xb20e('0x7d'),_0xb20e('0x7e'),_0xb20e('0x7f'),_0xb20e('0x80'),_0xb20e('0x81'),_0xb20e('0x82'),'group_list',_0xb20e('0x83'),_0xb20e('0x84'),_0xb20e('0x85'),_0xb20e('0x86'),_0xb20e('0x87'),_0xb20e('0x63'),_0xb20e('0x88'),_0xb20e('0x89'),'close_code',_0xb20e('0x8a'),_0xb20e('0x8b'),_0xb20e('0x8c'),'assignment_group',_0xb20e('0x8d'),_0xb20e('0x8e'),_0xb20e('0x8f'),_0xb20e('0x90'),_0xb20e('0x65'),_0xb20e('0x91'),_0xb20e('0x92'),_0xb20e('0x93'),_0xb20e('0x94'),_0xb20e('0x95'),_0xb20e('0x96'),_0xb20e('0x97'),_0xb20e('0x98'),_0xb20e('0x66'),_0xb20e('0x99'),_0xb20e('0x9a'),_0xb20e('0x9b'),_0xb20e('0x9c'),'activity_due',_0xb20e('0x9d'),'severity',_0xb20e('0x9e'),_0xb20e('0x9f'),_0xb20e('0xa0'),'comments_and_work_notes',_0xb20e('0xa1'),_0xb20e('0xa2'),_0xb20e('0xa3'),_0xb20e('0xa4'),_0xb20e('0xa5'),_0xb20e('0xa6'),_0xb20e('0xa7'),'location',_0xb20e('0x68')];var _0x5a2b49='';var _0x1ce7af='';var _0x5f50be=[];var _0x16a06f='';var _0x4e3a8a='';var _0x51b44f=[];var _0x831e8d='';var _0xe1caef='';var _0x46f46d={};var _0x4a2f8c='';return db[_0xb20e('0x39')][_0xb20e('0xa8')]({'where':{'id':_0x269a5a[_0xb20e('0x53')]['id']},'attributes':['id','username',_0xb20e('0xa9'),_0xb20e('0xaa'),_0xb20e('0xab'),_0xb20e('0xac')]})['then'](handleEntityNotFound(_0x5c97a6,null))[_0xb20e('0x1f')](function(_0x5eeb2b){if(_0x5eeb2b){_0x4a2f8c=_0x5eeb2b[_0xb20e('0xab')];var _0x397a47=_0x4a2f8c[_0xb20e('0xad')](-0x1);if(_0x397a47==='/'){_0x4a2f8c=_0x4a2f8c[_0xb20e('0xae')](0x0,_0x4a2f8c[_0xb20e('0xaf')](_0x397a47));}_0xe1caef=util[_0xb20e('0xb0')](_0xb20e('0xb1'),_0x4a2f8c);_0x831e8d=util['format']('%s/api/now/table/',_0x4a2f8c);_0x46f46d={'user':_0x5eeb2b['username'],'pass':_0x5eeb2b[_0xb20e('0xa9')]};var _0x540537={'method':_0xb20e('0xb2'),'uri':_0xe1caef+_0xb20e('0xb3'),'auth':_0x46f46d,'json':!![]};return rp(_0x540537);}})[_0xb20e('0x1f')](function(_0x10cc8f){if(_0x10cc8f['result'][_0xb20e('0x44')]>0x0){_0x5a2b49=_0x10cc8f[_0xb20e('0x28')];}console[_0xb20e('0xb4')](_0xb20e('0xb5'),_0x5a2b49);_0x51b44f=[];_0x1ce7af=Object[_0xb20e('0xb6')]([],_0x5a2b49);_[_0xb20e('0xb7')](_0x1ce7af,function(_0xad0f69){return!_0x323c70[_0xb20e('0xb8')](_0xad0f69[_0xb20e('0x37')]);});_0x1ce7af[_0xb20e('0xb9')](function(_0x2e557d){var _0x5edd4d=createFieldObject(_0x831e8d,_0x46f46d,_0x2e557d[_0xb20e('0xba')],_0x2e557d[_0xb20e('0x37')],_0x2e557d[_0xb20e('0xbb')],![]);_0x51b44f[_0xb20e('0xbc')](_0x5edd4d);});return Promise['all'](_0x51b44f);})['then'](function(_0x578801){_0x5f50be=_0x578801;_0x16a06f=Object['assign']([],_0x5a2b49);console[_0xb20e('0xb4')](_0xb20e('0xbd'),_0x5a2b49);_[_0xb20e('0xb7')](_0x16a06f,function(_0x51c0de){return _0x58ee0c['includes'](_0x51c0de[_0xb20e('0x37')]);});console[_0xb20e('0xb4')](_0xb20e('0xbe'),_0x16a06f);_0x51b44f=[];_0x16a06f['forEach'](function(_0x5dd1fb){var _0x30baa0=createFieldObject(_0x831e8d,_0x46f46d,_0x5dd1fb[_0xb20e('0xba')],_0x5dd1fb['name'],_0x5dd1fb['label'],!![]);_0x51b44f[_0xb20e('0xbc')](_0x30baa0);});return Promise['all'](_0x51b44f);})[_0xb20e('0x1f')](function(_0x3d6217){_0x4e3a8a=_0x3d6217;var _0x187696=_0x5f50be[_0xb20e('0xbf')](_0x4e3a8a);return{'count':_0x187696['length'],'rows':_0x187696};})[_0xb20e('0x1f')](respondWithResult(_0x5c97a6,null))[_0xb20e('0x29')](function(_0x1bec75){console[_0xb20e('0xb4')](_0xb20e('0xc0')+_0x1bec75);var _0xa3cbe0=_0x269a5a[_0xb20e('0x3d')]['test']?0x1f4:_0x1bec75[_0xb20e('0xc1')]||0x1f4;logger[_0xb20e('0x25')](_0x1bec75[_0xb20e('0xc2')]);delete _0x1bec75[_0xb20e('0x37')];if(_0xa3cbe0===0x191){_0xa3cbe0=0x190;}_0x5c97a6[_0xb20e('0x2b')](_0xa3cbe0)['send'](_0x269a5a[_0xb20e('0x3d')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x1bec75[_0xb20e('0xc1')]}:_0x1bec75);});};function createFieldObject(_0xfc6d48,_0x28135e,_0x4d5099,_0x2c2160,_0x142b4b,_0x1091c2){return new Promise(function(_0x4224e9,_0x567099){var _0x2ca6db={'id':_0x2c2160,'name':_0x142b4b,'custom':_0x1091c2};if(_0x4d5099===_0xb20e('0xc3')){_0x2ca6db['options']=[{'name':_0xb20e('0xc4'),'value':_0xb20e('0xc5')},{'name':_0xb20e('0xc6'),'value':_0xb20e('0xc7')}];_0x4224e9(_0x2ca6db);}else{var _0x1e7a66={'method':'GET','uri':_0xfc6d48+_0xb20e('0xc8')+_0x2c2160,'auth':_0x28135e,'json':!![]};return rp(_0x1e7a66)[_0xb20e('0x1f')](function(_0x46bbf8){var _0xf3b700=[];if(_0x46bbf8['result'][_0xb20e('0x44')]>0x0){_0x46bbf8['result']['forEach'](function(_0x480410){if(_0x480410[_0xb20e('0xc9')]===_0xb20e('0xc7')){var _0x2061e1={'name':_0x480410[_0xb20e('0xbb')],'value':_0x480410[_0xb20e('0xca')]};_0xf3b700[_0xb20e('0xbc')](_0x2061e1);}});}_0x2ca6db[_0xb20e('0x4d')]=_0xf3b700;if(_0x2ca6db[_0xb20e('0x4d')][_0xb20e('0x44')]>0x0){_0x4224e9(_0x2ca6db);}else{if(_0x1091c2==![]){_0x4224e9();}else{_0x4224e9(_0x2ca6db);}}});}});} \ No newline at end of file +var _0x31d9=['due_date','sys_mod_count','reopen_count','escalation','upon_approval','correlation_id','location','username','password','remoteUri','serverUrl','slice','lastIndexOf','format','%s/api/now/doc/table/schema/','log','incident\x20table\x20objects','assign','remove','forEach','internalType','label','push','all','TCL:\x20_object','includes','concat','ServiceNow\x20error:\x20','statusCode','Wrong\x20credentials','boolean','True','false','GET','sys_choice?sysparm_query=name=incident^element=','value','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','test','request','then','ServicenowAccount,\x20%s,\x20%s','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','query','attributes','intersection','fields','hasOwnProperty','order','sort','pick','filters','where','merge','VIRTUAL','filter','options','ServicenowAccount','includeAll','include','rows','show','params','length','find','create','body','findOne','getConfigurations','nolimit','AccountId','Subjects','getSubjects','channel','Descriptions','ServicenowConfiguration','getFields','made_sla','hold_reason','close_code','notify','severity','category','parent','caused_by','upon_reject','sys_updated_on','child_incidents','approval_history','number','sys_updated_by','opened_by','user_input','sys_created_on','state','sys_created_by','knowledge','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','approval_set','subcategory','work_notes','short_description','delivery_task','work_start','assignment_group','additional_assignee_list','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','incident_state','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','sla_due','approval','comments_and_work_notes'];(function(_0x27d443,_0x4ee5ec){var _0x21b822=function(_0x4c6296){while(--_0x4c6296){_0x27d443['push'](_0x27d443['shift']());}};_0x21b822(++_0x4ee5ec);}(_0x31d9,0xe8));var _0x931d=function(_0x1ec04a,_0x30a233){_0x1ec04a=_0x1ec04a-0x0;var _0x122324=_0x31d9[_0x1ec04a];return _0x122324;};'use strict';var pdf=require(_0x931d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x931d('0x1'));var zipdir=require(_0x931d('0x2'));var jsonpatch=require(_0x931d('0x3'));var rp=require(_0x931d('0x4'));var moment=require(_0x931d('0x5'));var BPromise=require(_0x931d('0x6'));var Mustache=require(_0x931d('0x7'));var util=require(_0x931d('0x8'));var path=require(_0x931d('0x9'));var sox=require(_0x931d('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x931d('0xb'));var crypto=require(_0x931d('0xc'));var jsforce=require(_0x931d('0xd'));var deskjs=require(_0x931d('0xe'));var toCsv=require(_0x931d('0xf'));var querystring=require(_0x931d('0x10'));var Papa=require(_0x931d('0x11'));var Redis=require('ioredis');var authService=require(_0x931d('0x12'));var qs=require(_0x931d('0x13'));var as=require(_0x931d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x931d('0x15'))(_0x931d('0x16'));var utils=require(_0x931d('0x17'));var config=require(_0x931d('0x18'));var db=require(_0x931d('0x19'))['db'];var integrations=require(_0x931d('0x1a'));var jayson=require(_0x931d('0x1b'));var client=jayson['client'][_0x931d('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x27a9c2,_0x1b6b16,_0x5e8dd9){if(_0x5e8dd9){var _0x3dd5f5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3dd5f5[_0x931d('0x1d')](_0x1b6b16)){return _0x27a9c2;}else{throw new db['Sequelize']['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x27a9c2;}}function respondWithRpcPromise(_0x56d000,_0x2010ec,_0x43911e,_0x348b30){return new BPromise(function(_0x361a0c,_0x1c5d1f){var _0x4f947e=_0x348b30||client;return _0x4f947e[_0x931d('0x1e')](_0x56d000,_0x43911e)[_0x931d('0x1f')](function(_0x23d819){logger['info'](_0x931d('0x20'),_0x2010ec,'request\x20sent');logger[_0x931d('0x21')](_0x931d('0x22'),_0x2010ec,_0x931d('0x23'),JSON[_0x931d('0x24')](_0x23d819));if(_0x23d819['error']){if(_0x23d819[_0x931d('0x25')][_0x931d('0x26')]===0x1f4){logger[_0x931d('0x25')](_0x931d('0x20'),_0x2010ec,_0x23d819['error'][_0x931d('0x27')]);return _0x1c5d1f(_0x23d819[_0x931d('0x25')][_0x931d('0x27')]);}logger[_0x931d('0x25')](_0x931d('0x20'),_0x2010ec,_0x23d819[_0x931d('0x25')][_0x931d('0x27')]);return _0x361a0c(_0x23d819['error'][_0x931d('0x27')]);}else{logger[_0x931d('0x28')](_0x931d('0x20'),_0x2010ec,'request\x20sent');_0x361a0c(_0x23d819[_0x931d('0x29')][_0x931d('0x27')]);}})[_0x931d('0x2a')](function(_0x4ed46c){logger[_0x931d('0x25')](_0x931d('0x20'),_0x2010ec,_0x4ed46c);_0x1c5d1f(_0x4ed46c);});});}function respondWithStatusCode(_0x4aa673,_0x251c87){_0x251c87=_0x251c87||0xcc;return function(_0x21b898){if(_0x21b898){return _0x4aa673[_0x931d('0x2b')](_0x251c87);}return _0x4aa673[_0x931d('0x2c')](_0x251c87)['end']();};}function respondWithResult(_0x4506cc,_0x520cd9){_0x520cd9=_0x520cd9||0xc8;return function(_0x103ae4){if(_0x103ae4){return _0x4506cc['status'](_0x520cd9)[_0x931d('0x2d')](_0x103ae4);}};}function respondWithFilteredResult(_0xb63c52,_0x562f64){return function(_0x5327fe){if(_0x5327fe){var _0x361baf=_0x5327fe[_0x931d('0x2e')],_0x5e9ba6=_0x562f64[_0x931d('0x2f')],_0x15df88=_0x562f64[_0x931d('0x2f')]+_0x562f64[_0x931d('0x30')],_0x54eb11;if(_0x15df88>=_0x361baf){_0x15df88=_0x361baf;_0x54eb11=0xc8;}else{_0x54eb11=0xce;}_0xb63c52[_0x931d('0x2c')](_0x54eb11);return _0xb63c52[_0x931d('0x31')](_0x931d('0x32'),_0x5e9ba6+'-'+_0x15df88+'/'+_0x361baf)[_0x931d('0x2d')](_0x5327fe);}return null;};}function patchUpdates(_0x200a04){return function(_0x15dbb8){try{jsonpatch[_0x931d('0x33')](_0x15dbb8,_0x200a04,!![]);}catch(_0x426080){return BPromise['reject'](_0x426080);}return _0x15dbb8[_0x931d('0x34')]();};}function saveUpdates(_0x27ec62,_0x5a5507){return function(_0x3bcd1f){if(_0x3bcd1f){return _0x3bcd1f[_0x931d('0x35')](_0x27ec62)[_0x931d('0x1f')](function(_0x7076fe){return _0x7076fe;});}return null;};}function removeEntity(_0xeb8ee0,_0x26e26c){return function(_0x293ca3){if(_0x293ca3){return _0x293ca3[_0x931d('0x36')]()[_0x931d('0x1f')](function(){_0xeb8ee0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x270543,_0x18a960){return function(_0x4b1eaf){if(!_0x4b1eaf){_0x270543[_0x931d('0x2b')](0x194);}return _0x4b1eaf;};}function handleError(_0x373a9c,_0x4aac78){_0x4aac78=_0x4aac78||0x1f4;return function(_0xb32146){logger[_0x931d('0x25')](_0xb32146[_0x931d('0x37')]);if(_0xb32146[_0x931d('0x38')]){delete _0xb32146[_0x931d('0x38')];}_0x373a9c['status'](_0x4aac78)[_0x931d('0x39')](_0xb32146);};}exports[_0x931d('0x3a')]=function(_0x205d5f,_0xb05b54){var _0x51cb7c={},_0x124ba5={},_0x571230={'count':0x0,'rows':[]};var _0x4e4ebb=_['map'](db['ServicenowAccount'][_0x931d('0x3b')],function(_0xfa59c7){return{'name':_0xfa59c7[_0x931d('0x3c')],'type':_0xfa59c7[_0x931d('0x3d')][_0x931d('0x3e')]};});_0x124ba5[_0x931d('0x3f')]=_[_0x931d('0x40')](_0x4e4ebb,'name');_0x124ba5['query']=_[_0x931d('0x41')](_0x205d5f[_0x931d('0x42')]);_0x124ba5['filters']=_['intersection'](_0x124ba5[_0x931d('0x3f')],_0x124ba5[_0x931d('0x42')]);_0x51cb7c[_0x931d('0x43')]=_[_0x931d('0x44')](_0x124ba5[_0x931d('0x3f')],qs['fields'](_0x205d5f[_0x931d('0x42')][_0x931d('0x45')]));_0x51cb7c['attributes']=_0x51cb7c[_0x931d('0x43')]['length']?_0x51cb7c[_0x931d('0x43')]:_0x124ba5[_0x931d('0x3f')];if(!_0x205d5f[_0x931d('0x42')][_0x931d('0x46')]('nolimit')){_0x51cb7c['limit']=qs[_0x931d('0x30')](_0x205d5f[_0x931d('0x42')]['limit']);_0x51cb7c[_0x931d('0x2f')]=qs[_0x931d('0x2f')](_0x205d5f['query'][_0x931d('0x2f')]);}_0x51cb7c[_0x931d('0x47')]=qs[_0x931d('0x48')](_0x205d5f['query'][_0x931d('0x48')]);_0x51cb7c['where']=qs['filters'](_[_0x931d('0x49')](_0x205d5f[_0x931d('0x42')],_0x124ba5[_0x931d('0x4a')]));if(_0x205d5f[_0x931d('0x42')]['filter']){_0x51cb7c[_0x931d('0x4b')]=_[_0x931d('0x4c')](_0x51cb7c[_0x931d('0x4b')],{'$or':_['map'](_0x4e4ebb,function(_0x2b6bc6){if(_0x2b6bc6['type']!==_0x931d('0x4d')){var _0x43ae69={};_0x43ae69[_0x2b6bc6[_0x931d('0x38')]]={'$like':'%'+_0x205d5f[_0x931d('0x42')][_0x931d('0x4e')]+'%'};return _0x43ae69;}})});}_0x51cb7c=_[_0x931d('0x4c')]({},_0x51cb7c,_0x205d5f[_0x931d('0x4f')]);var _0x5493fd={'where':_0x51cb7c[_0x931d('0x4b')]};return db[_0x931d('0x50')][_0x931d('0x2e')](_0x5493fd)[_0x931d('0x1f')](function(_0x1ce004){_0x571230[_0x931d('0x2e')]=_0x1ce004;if(_0x205d5f[_0x931d('0x42')][_0x931d('0x51')]){_0x51cb7c[_0x931d('0x52')]=[{'all':!![]}];}return db['ServicenowAccount']['findAll'](_0x51cb7c);})[_0x931d('0x1f')](function(_0x396589){_0x571230[_0x931d('0x53')]=_0x396589;return _0x571230;})[_0x931d('0x1f')](respondWithFilteredResult(_0xb05b54,_0x51cb7c))[_0x931d('0x2a')](handleError(_0xb05b54,null));};exports[_0x931d('0x54')]=function(_0x229a29,_0x1b356f){var _0x39901f={'raw':![],'where':{'id':_0x229a29[_0x931d('0x55')]['id']}},_0x304433={};_0x304433['model']=_[_0x931d('0x41')](db[_0x931d('0x50')][_0x931d('0x3b')]);_0x304433[_0x931d('0x42')]=_[_0x931d('0x41')](_0x229a29[_0x931d('0x42')]);_0x304433['filters']=_[_0x931d('0x44')](_0x304433[_0x931d('0x3f')],_0x304433['query']);_0x39901f[_0x931d('0x43')]=_[_0x931d('0x44')](_0x304433[_0x931d('0x3f')],qs['fields'](_0x229a29[_0x931d('0x42')][_0x931d('0x45')]));_0x39901f['attributes']=_0x39901f['attributes'][_0x931d('0x56')]?_0x39901f['attributes']:_0x304433[_0x931d('0x3f')];if(_0x229a29[_0x931d('0x42')]['includeAll']){_0x39901f[_0x931d('0x52')]=[{'all':!![]}];}_0x39901f=_[_0x931d('0x4c')]({},_0x39901f,_0x229a29['options']);return db[_0x931d('0x50')][_0x931d('0x57')](_0x39901f)[_0x931d('0x1f')](handleEntityNotFound(_0x1b356f,null))[_0x931d('0x1f')](respondWithResult(_0x1b356f,null))['catch'](handleError(_0x1b356f,null));};exports['create']=function(_0x2da6f6,_0x1db56f){return db[_0x931d('0x50')][_0x931d('0x58')](_0x2da6f6[_0x931d('0x59')],{})['then'](respondWithResult(_0x1db56f,0xc9))[_0x931d('0x2a')](handleError(_0x1db56f,null));};exports[_0x931d('0x35')]=function(_0x1f9fc4,_0x37cd23){if(_0x1f9fc4[_0x931d('0x59')]['id']){delete _0x1f9fc4[_0x931d('0x59')]['id'];}return db[_0x931d('0x50')]['find']({'where':{'id':_0x1f9fc4[_0x931d('0x55')]['id']}})[_0x931d('0x1f')](handleEntityNotFound(_0x37cd23,null))[_0x931d('0x1f')](saveUpdates(_0x1f9fc4[_0x931d('0x59')],null))[_0x931d('0x1f')](respondWithResult(_0x37cd23,null))['catch'](handleError(_0x37cd23,null));};exports[_0x931d('0x36')]=function(_0x245d0e,_0x55e0b7){return db[_0x931d('0x50')][_0x931d('0x57')]({'where':{'id':_0x245d0e[_0x931d('0x55')]['id']}})[_0x931d('0x1f')](handleEntityNotFound(_0x55e0b7,null))[_0x931d('0x1f')](removeEntity(_0x55e0b7,null))['catch'](handleError(_0x55e0b7,null));};exports['getConfigurations']=function(_0x514ee0,_0x1de272,_0x2a0747){var _0x4ad9b3={};var _0x13d933={};var _0x3cc0f5;var _0x40bb2c;return db[_0x931d('0x50')][_0x931d('0x5a')]({'where':{'id':_0x514ee0['params']['id']}})[_0x931d('0x1f')](handleEntityNotFound(_0x1de272,null))[_0x931d('0x1f')](function(_0x3d2613){if(_0x3d2613){_0x3cc0f5=_0x3d2613;_0x13d933[_0x931d('0x3f')]=_[_0x931d('0x41')](db['ServicenowConfiguration'][_0x931d('0x3b')]);_0x13d933[_0x931d('0x42')]=_[_0x931d('0x41')](_0x514ee0[_0x931d('0x42')]);_0x13d933[_0x931d('0x4a')]=_[_0x931d('0x44')](_0x13d933[_0x931d('0x3f')],_0x13d933['query']);_0x4ad9b3['attributes']=_[_0x931d('0x44')](_0x13d933[_0x931d('0x3f')],qs['fields'](_0x514ee0[_0x931d('0x42')][_0x931d('0x45')]));_0x4ad9b3['attributes']=_0x4ad9b3[_0x931d('0x43')]['length']?_0x4ad9b3[_0x931d('0x43')]:_0x13d933[_0x931d('0x3f')];_0x4ad9b3[_0x931d('0x47')]=qs[_0x931d('0x48')](_0x514ee0[_0x931d('0x42')][_0x931d('0x48')]);_0x4ad9b3[_0x931d('0x4b')]=qs[_0x931d('0x4a')](_[_0x931d('0x49')](_0x514ee0[_0x931d('0x42')],_0x13d933[_0x931d('0x4a')]));if(_0x514ee0[_0x931d('0x42')]['filter']){_0x4ad9b3[_0x931d('0x4b')]=_['merge'](_0x4ad9b3[_0x931d('0x4b')],{'$or':_[_0x931d('0x40')](_0x4ad9b3[_0x931d('0x43')],function(_0x4dee84){var _0x48430e={};_0x48430e[_0x4dee84]={'$like':'%'+_0x514ee0[_0x931d('0x42')][_0x931d('0x4e')]+'%'};return _0x48430e;})});}_0x4ad9b3=_[_0x931d('0x4c')]({},_0x4ad9b3,_0x514ee0[_0x931d('0x4f')]);return _0x3cc0f5[_0x931d('0x5b')](_0x4ad9b3);}})['then'](function(_0x29ef79){if(_0x29ef79){_0x40bb2c=_0x29ef79[_0x931d('0x56')];if(!_0x514ee0['query'][_0x931d('0x46')](_0x931d('0x5c'))){_0x4ad9b3[_0x931d('0x30')]=qs[_0x931d('0x30')](_0x514ee0[_0x931d('0x42')][_0x931d('0x30')]);_0x4ad9b3[_0x931d('0x2f')]=qs[_0x931d('0x2f')](_0x514ee0[_0x931d('0x42')][_0x931d('0x2f')]);}return _0x3cc0f5[_0x931d('0x5b')](_0x4ad9b3);}})['then'](function(_0xe2e064){if(_0xe2e064){return _0xe2e064?{'count':_0x40bb2c,'rows':_0xe2e064}:null;}})['then'](respondWithResult(_0x1de272,null))['catch'](handleError(_0x1de272,null));};exports['addConfiguration']=function(_0x458641,_0x54221e,_0x52cad7){if(_0x458641[_0x931d('0x59')]['id']){delete _0x458641[_0x931d('0x59')]['id'];}return db[_0x931d('0x50')][_0x931d('0x5a')]({'where':{'id':_0x458641['params']['id']}})[_0x931d('0x1f')](handleEntityNotFound(_0x54221e,null))[_0x931d('0x1f')](function(_0x1b0eb2){if(_0x1b0eb2){_0x458641[_0x931d('0x59')][_0x931d('0x5d')]=_0x1b0eb2['id'];_0x458641['body'][_0x931d('0x5e')]=integrations[_0x931d('0x5f')](_0x458641[_0x931d('0x59')][_0x931d('0x60')],_0x458641[_0x931d('0x59')][_0x931d('0x3d')]);_0x458641[_0x931d('0x59')][_0x931d('0x61')]=integrations['getDescriptions'](_0x458641['body']['channel'],_0x458641['body']['type']);return db[_0x931d('0x62')][_0x931d('0x58')](_0x458641[_0x931d('0x59')],{'include':[{'model':db['ServicenowField'],'as':_0x931d('0x5e')},{'model':db['ServicenowField'],'as':_0x931d('0x61')}]});}return null;})[_0x931d('0x1f')](respondWithResult(_0x54221e,null))[_0x931d('0x2a')](handleError(_0x54221e,null));};exports[_0x931d('0x63')]=function(_0x3090f4,_0x2b3d00,_0x21a444){var _0x1b9db1=[_0x931d('0x64'),_0x931d('0x65'),'knowledge','subcategory',_0x931d('0x66'),_0x931d('0x67'),'incident_state',_0x931d('0x68'),_0x931d('0x69')];var _0x284152=[_0x931d('0x6a'),_0x931d('0x64'),_0x931d('0x6b'),'watch_list',_0x931d('0x6c'),_0x931d('0x6d'),_0x931d('0x6e'),_0x931d('0x65'),_0x931d('0x6f'),_0x931d('0x70'),'resolved_by',_0x931d('0x71'),_0x931d('0x72'),_0x931d('0x73'),_0x931d('0x74'),'sys_domain',_0x931d('0x75'),_0x931d('0x76'),_0x931d('0x77'),_0x931d('0x47'),'calendar_stc',_0x931d('0x78'),_0x931d('0x79'),_0x931d('0x7a'),_0x931d('0x7b'),_0x931d('0x7c'),_0x931d('0x7d'),_0x931d('0x7e'),_0x931d('0x7f'),'sys_domain_path','rfc','time_worked',_0x931d('0x80'),_0x931d('0x81'),_0x931d('0x82'),_0x931d('0x83'),_0x931d('0x84'),_0x931d('0x85'),_0x931d('0x86'),'caller_id',_0x931d('0x87'),_0x931d('0x88'),_0x931d('0x89'),_0x931d('0x8a'),_0x931d('0x66'),'correlation_display',_0x931d('0x8b'),_0x931d('0x8c'),_0x931d('0x8d'),'business_stc',_0x931d('0x8e'),'description','calendar_duration',_0x931d('0x67'),_0x931d('0x8f'),_0x931d('0x90'),_0x931d('0x91'),_0x931d('0x92'),_0x931d('0x93'),_0x931d('0x94'),_0x931d('0x95'),'reopened_by',_0x931d('0x96'),_0x931d('0x97'),_0x931d('0x98'),_0x931d('0x99'),_0x931d('0x9a'),_0x931d('0x9b'),_0x931d('0x9c'),'severity','comments',_0x931d('0x9d'),_0x931d('0x9e'),_0x931d('0x9f'),_0x931d('0xa0'),_0x931d('0xa1'),_0x931d('0xa2'),'sys_tags',_0x931d('0xa3'),_0x931d('0xa4'),_0x931d('0xa5'),_0x931d('0xa6'),_0x931d('0x69')];var _0x2562c1='';var _0x52bc6a='';var _0x2dc3ae=[];var _0x24cce0='';var _0x2e7ad0='';var _0xd76a56=[];var _0x3d6f80='';var _0x146286='';var _0x5e1c3e={};var _0x22f3df='';return db[_0x931d('0x50')][_0x931d('0x5a')]({'where':{'id':_0x3090f4[_0x931d('0x55')]['id']},'attributes':['id',_0x931d('0xa7'),_0x931d('0xa8'),'email',_0x931d('0xa9'),_0x931d('0xaa')]})[_0x931d('0x1f')](handleEntityNotFound(_0x2b3d00,null))['then'](function(_0x2d1a12){if(_0x2d1a12){_0x22f3df=_0x2d1a12[_0x931d('0xa9')];var _0x4ec882=_0x22f3df[_0x931d('0xab')](-0x1);if(_0x4ec882==='/'){_0x22f3df=_0x22f3df['substring'](0x0,_0x22f3df[_0x931d('0xac')](_0x4ec882));}_0x146286=util[_0x931d('0xad')](_0x931d('0xae'),_0x22f3df);_0x3d6f80=util[_0x931d('0xad')]('%s/api/now/table/',_0x22f3df);_0x5e1c3e={'user':_0x2d1a12[_0x931d('0xa7')],'pass':_0x2d1a12[_0x931d('0xa8')]};var _0x20f938={'method':'GET','uri':_0x146286+'incident?sysparm_display_value=all','auth':_0x5e1c3e,'json':!![]};return rp(_0x20f938);}})[_0x931d('0x1f')](function(_0x4d1701){if(_0x4d1701[_0x931d('0x29')][_0x931d('0x56')]>0x0){_0x2562c1=_0x4d1701['result'];}console[_0x931d('0xaf')](_0x931d('0xb0'),_0x2562c1);_0xd76a56=[];_0x52bc6a=Object[_0x931d('0xb1')]([],_0x2562c1);_[_0x931d('0xb2')](_0x52bc6a,function(_0xdb50d8){return!_0x1b9db1['includes'](_0xdb50d8[_0x931d('0x38')]);});_0x52bc6a[_0x931d('0xb3')](function(_0x1b8821){var _0x8536f6=createFieldObject(_0x3d6f80,_0x5e1c3e,_0x1b8821[_0x931d('0xb4')],_0x1b8821[_0x931d('0x38')],_0x1b8821[_0x931d('0xb5')],![]);_0xd76a56[_0x931d('0xb6')](_0x8536f6);});return Promise[_0x931d('0xb7')](_0xd76a56);})[_0x931d('0x1f')](function(_0x1ccf9b){_0x2dc3ae=_0x1ccf9b;_0x24cce0=Object[_0x931d('0xb1')]([],_0x2562c1);console[_0x931d('0xaf')](_0x931d('0xb8'),_0x2562c1);_[_0x931d('0xb2')](_0x24cce0,function(_0x4125e5){return _0x284152[_0x931d('0xb9')](_0x4125e5['name']);});console['log']('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x24cce0);_0xd76a56=[];_0x24cce0[_0x931d('0xb3')](function(_0x87942c){var _0x53dc0d=createFieldObject(_0x3d6f80,_0x5e1c3e,_0x87942c['internalType'],_0x87942c[_0x931d('0x38')],_0x87942c['label'],!![]);_0xd76a56[_0x931d('0xb6')](_0x53dc0d);});return Promise[_0x931d('0xb7')](_0xd76a56);})['then'](function(_0x33e363){_0x2e7ad0=_0x33e363;var _0xc3baf4=_0x2dc3ae[_0x931d('0xba')](_0x2e7ad0);return{'count':_0xc3baf4[_0x931d('0x56')],'rows':_0xc3baf4};})[_0x931d('0x1f')](respondWithResult(_0x2b3d00,null))[_0x931d('0x2a')](function(_0x2160e5){console[_0x931d('0xaf')](_0x931d('0xbb')+_0x2160e5);var _0xb16c9c=_0x3090f4[_0x931d('0x42')][_0x931d('0x1d')]?0x1f4:_0x2160e5[_0x931d('0xbc')]||0x1f4;logger[_0x931d('0x25')](_0x2160e5[_0x931d('0x37')]);delete _0x2160e5[_0x931d('0x38')];if(_0xb16c9c===0x191){_0xb16c9c=0x190;}_0x2b3d00['status'](_0xb16c9c)[_0x931d('0x39')](_0x3090f4[_0x931d('0x42')][_0x931d('0x1d')]?{'message':_0x931d('0xbd'),'statusCode':_0x2160e5[_0x931d('0xbc')]}:_0x2160e5);});};function createFieldObject(_0x5e5069,_0x5711be,_0x51c85d,_0x1aaf74,_0x440d04,_0x4c5b05){return new Promise(function(_0x563af8,_0x17f126){var _0xd6b159={'id':_0x1aaf74,'name':_0x440d04,'custom':_0x4c5b05};if(_0x51c85d===_0x931d('0xbe')){_0xd6b159[_0x931d('0x4f')]=[{'name':_0x931d('0xbf'),'value':'true'},{'name':'False','value':_0x931d('0xc0')}];_0x563af8(_0xd6b159);}else{var _0x57de7c={'method':_0x931d('0xc1'),'uri':_0x5e5069+_0x931d('0xc2')+_0x1aaf74,'auth':_0x5711be,'json':!![]};return rp(_0x57de7c)[_0x931d('0x1f')](function(_0x11f17d){var _0x3e3e12=[];if(_0x11f17d[_0x931d('0x29')][_0x931d('0x56')]>0x0){_0x11f17d[_0x931d('0x29')][_0x931d('0xb3')](function(_0x173df3){if(_0x173df3['inactive']===_0x931d('0xc0')){var _0x438d05={'name':_0x173df3['label'],'value':_0x173df3[_0x931d('0xc3')]};_0x3e3e12[_0x931d('0xb6')](_0x438d05);}});}_0xd6b159[_0x931d('0x4f')]=_0x3e3e12;if(_0xd6b159[_0x931d('0x4f')][_0x931d('0x56')]>0x0){_0x563af8(_0xd6b159);}else{if(_0x4c5b05==![]){_0x563af8();}else{_0x563af8(_0xd6b159);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 5ae6e09..5c5898c 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 _0x5089=['util','api','moment','bluebird','request-promise','path','../../config/environment','../../components/integrations/configuration','exports','define','ServicenowAccount','lodash'];(function(_0x5e32f3,_0x3386c1){var _0x4d4e03=function(_0xe86f5){while(--_0xe86f5){_0x5e32f3['push'](_0x5e32f3['shift']());}};_0x4d4e03(++_0x3386c1);}(_0x5089,0x1bb));var _0x9508=function(_0x31a576,_0x424419){_0x31a576=_0x31a576-0x0;var _0x30b1d3=_0x5089[_0x31a576];return _0x30b1d3;};'use strict';var _=require(_0x9508('0x0'));var util=require(_0x9508('0x1'));var logger=require('../../config/logger')(_0x9508('0x2'));var moment=require(_0x9508('0x3'));var BPromise=require(_0x9508('0x4'));var rp=require(_0x9508('0x5'));var fs=require('fs');var path=require(_0x9508('0x6'));var rimraf=require('rimraf');var config=require(_0x9508('0x7'));var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0x9508('0x8'));module[_0x9508('0x9')]=function(_0x257318,_0x4ab3c6){return _0x257318[_0x9508('0xa')](_0x9508('0xb'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6aa7=['define','ServicenowAccount','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x2112f7,_0x460c82){var _0x2d4118=function(_0x384522){while(--_0x384522){_0x2112f7['push'](_0x2112f7['shift']());}};_0x2d4118(++_0x460c82);}(_0x6aa7,0x178));var _0x76aa=function(_0x4dc991,_0x4956b1){_0x4dc991=_0x4dc991-0x0;var _0x1b3071=_0x6aa7[_0x4dc991];return _0x1b3071;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var logger=require(_0x76aa('0x1'))(_0x76aa('0x2'));var moment=require(_0x76aa('0x3'));var BPromise=require(_0x76aa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x76aa('0x5'));var rimraf=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var attributes=require('./intServicenowAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x76aa('0x8')]=function(_0x4d53f6,_0x32dee5){return _0x4d53f6[_0x76aa('0x9')](_0x76aa('0xa'),attributes,{'tableName':'int_servicenow_accounts','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 8b48a41..d3980d5 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 _0x8b92=['map','then','GetServicenowAccount','raw','where','ShowServicenowAccount','stringify','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','ServicenowAccount,\x20%s,\x20%s','message','catch','ServicenowAccount','findAll','options','attributes','limit','include','model'];(function(_0x492253,_0x4626f1){var _0xe9d5e9=function(_0x195a11){while(--_0x195a11){_0x492253['push'](_0x492253['shift']());}};_0xe9d5e9(++_0x4626f1);}(_0x8b92,0x103));var _0x28b9=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8b92[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x28b9('0x0'));var util=require(_0x28b9('0x1'));var moment=require(_0x28b9('0x2'));var BPromise=require(_0x28b9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x28b9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x28b9('0x5'));var logger=require(_0x28b9('0x6'))(_0x28b9('0x7'));var config=require(_0x28b9('0x8'));var jayson=require(_0x28b9('0x9'));var client=jayson[_0x28b9('0xa')][_0x28b9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f7e20,_0x2defd1,_0x4a03dd){return new BPromise(function(_0x15981e,_0x2f9ef0){return client[_0x28b9('0xc')](_0x2f7e20,_0x4a03dd)['then'](function(_0x16a4c3){logger[_0x28b9('0xd')]('ServicenowAccount,\x20%s,\x20%s',_0x2defd1,_0x28b9('0xe'));logger[_0x28b9('0xf')](_0x28b9('0x10'),_0x2defd1,_0x28b9('0xe'),JSON['stringify'](_0x16a4c3));if(_0x16a4c3[_0x28b9('0x11')]){if(_0x16a4c3[_0x28b9('0x11')][_0x28b9('0x12')]===0x1f4){logger['error'](_0x28b9('0x13'),_0x2defd1,_0x16a4c3[_0x28b9('0x11')][_0x28b9('0x14')]);return _0x2f9ef0(_0x16a4c3['error'][_0x28b9('0x14')]);}logger['error'](_0x28b9('0x13'),_0x2defd1,_0x16a4c3[_0x28b9('0x11')][_0x28b9('0x14')]);return _0x15981e(_0x16a4c3[_0x28b9('0x11')][_0x28b9('0x14')]);}else{logger[_0x28b9('0xd')](_0x28b9('0x13'),_0x2defd1,_0x28b9('0xe'));_0x15981e(_0x16a4c3['result'][_0x28b9('0x14')]);}})[_0x28b9('0x15')](function(_0x11e080){logger[_0x28b9('0x11')](_0x28b9('0x13'),_0x2defd1,_0x11e080);_0x2f9ef0(_0x11e080);});});}exports['GetServicenowAccount']=function(_0x2117c7){var _0x4c00dc=this;return new Promise(function(_0x271d7e,_0xfcc67a){return db[_0x28b9('0x16')][_0x28b9('0x17')]({'raw':_0x2117c7['options']?_0x2117c7[_0x28b9('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x2117c7[_0x28b9('0x18')]?_0x2117c7[_0x28b9('0x18')]['where']||null:null,'attributes':_0x2117c7[_0x28b9('0x18')]?_0x2117c7['options'][_0x28b9('0x19')]||null:null,'limit':_0x2117c7[_0x28b9('0x18')]?_0x2117c7[_0x28b9('0x18')][_0x28b9('0x1a')]||null:null,'include':_0x2117c7[_0x28b9('0x18')]?_0x2117c7[_0x28b9('0x18')][_0x28b9('0x1b')]?_['map'](_0x2117c7[_0x28b9('0x18')][_0x28b9('0x1b')],function(_0x4a3de2){return{'model':db[_0x4a3de2[_0x28b9('0x1c')]],'as':_0x4a3de2['as'],'attributes':_0x4a3de2[_0x28b9('0x19')],'include':_0x4a3de2['include']?_[_0x28b9('0x1d')](_0x4a3de2[_0x28b9('0x1b')],function(_0x1809d0){return{'model':db[_0x1809d0[_0x28b9('0x1c')]],'as':_0x1809d0['as'],'attributes':_0x1809d0[_0x28b9('0x19')],'include':_0x1809d0['include']?_[_0x28b9('0x1d')](_0x1809d0[_0x28b9('0x1b')],function(_0x1a3e13){return{'model':db[_0x1a3e13[_0x28b9('0x1c')]],'as':_0x1a3e13['as'],'attributes':_0x1a3e13[_0x28b9('0x19')]};}):[]};}):[]};}):[]:[]})[_0x28b9('0x1e')](function(_0x47bfa7){logger[_0x28b9('0xd')]('GetServicenowAccount',_0x2117c7);logger[_0x28b9('0xf')](_0x28b9('0x1f'),_0x2117c7,JSON['stringify'](_0x47bfa7));_0x271d7e(_0x47bfa7);})[_0x28b9('0x15')](function(_0x22a297){logger[_0x28b9('0x11')](_0x28b9('0x1f'),_0x22a297[_0x28b9('0x14')],_0x2117c7);_0xfcc67a(_0x4c00dc[_0x28b9('0x11')](0x1f4,_0x22a297[_0x28b9('0x14')]));});});};exports['ShowServicenowAccount']=function(_0x16b36c){var _0x53bfa3=this;return new Promise(function(_0x28f5c5,_0x29a0f2){return db[_0x28b9('0x16')]['find']({'raw':_0x16b36c[_0x28b9('0x18')]?_0x16b36c[_0x28b9('0x18')][_0x28b9('0x20')]===undefined?!![]:![]:!![],'where':_0x16b36c['options']?_0x16b36c[_0x28b9('0x18')][_0x28b9('0x21')]||null:null,'attributes':_0x16b36c[_0x28b9('0x18')]?_0x16b36c[_0x28b9('0x18')][_0x28b9('0x19')]||null:null,'include':_0x16b36c[_0x28b9('0x18')]?_0x16b36c[_0x28b9('0x18')][_0x28b9('0x1b')]?_[_0x28b9('0x1d')](_0x16b36c[_0x28b9('0x18')]['include'],function(_0x2dbf0a){return{'model':db[_0x2dbf0a['model']],'as':_0x2dbf0a['as'],'attributes':_0x2dbf0a[_0x28b9('0x19')],'include':_0x2dbf0a['include']?_['map'](_0x2dbf0a['include'],function(_0x3d15a9){return{'model':db[_0x3d15a9[_0x28b9('0x1c')]],'as':_0x3d15a9['as'],'attributes':_0x3d15a9[_0x28b9('0x19')],'include':_0x3d15a9[_0x28b9('0x1b')]?_[_0x28b9('0x1d')](_0x3d15a9[_0x28b9('0x1b')],function(_0x3c1f5a){return{'model':db[_0x3c1f5a[_0x28b9('0x1c')]],'as':_0x3c1f5a['as'],'attributes':_0x3c1f5a['attributes']};}):[]};}):[]};}):[]:[]})[_0x28b9('0x1e')](function(_0x29b89a){logger['info'](_0x28b9('0x22'),_0x16b36c);logger['debug'](_0x28b9('0x22'),_0x16b36c,JSON[_0x28b9('0x23')](_0x29b89a));_0x28f5c5(_0x29b89a);})['catch'](function(_0x2edd07){logger[_0x28b9('0x11')](_0x28b9('0x22'),_0x2edd07['message'],_0x16b36c);_0x29a0f2(_0x53bfa3[_0x28b9('0x11')](0x1f4,_0x2edd07[_0x28b9('0x14')]));});});}; \ No newline at end of file +var _0xe50e=['jayson/promise','http','request','ServicenowAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','ServicenowAccount','options','where','attributes','include','model','map','then','debug','GetServicenowAccount','find','raw','ShowServicenowAccount','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x39609a,_0x28a563){var _0xecd92=function(_0x57241a){while(--_0x57241a){_0x39609a['push'](_0x39609a['shift']());}};_0xecd92(++_0x28a563);}(_0xe50e,0xeb));var _0xee50=function(_0x5d8e2e,_0xdacd46){_0x5d8e2e=_0x5d8e2e-0x0;var _0x165075=_0xe50e[_0x5d8e2e];return _0x165075;};'use strict';var _=require(_0xee50('0x0'));var util=require('util');var moment=require(_0xee50('0x1'));var BPromise=require(_0xee50('0x2'));var rs=require(_0xee50('0x3'));var fs=require('fs');var Redis=require(_0xee50('0x4'));var db=require(_0xee50('0x5'))['db'];var utils=require(_0xee50('0x6'));var logger=require(_0xee50('0x7'))(_0xee50('0x8'));var config=require(_0xee50('0x9'));var jayson=require(_0xee50('0xa'));var client=jayson['client'][_0xee50('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x174089,_0x14079d,_0x36ce70){return new BPromise(function(_0x1d81be,_0x10ffe8){return client[_0xee50('0xc')](_0x174089,_0x36ce70)['then'](function(_0x56b308){logger['info'](_0xee50('0xd'),_0x14079d,'request\x20sent');logger['debug']('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x14079d,_0xee50('0xe'),JSON[_0xee50('0xf')](_0x56b308));if(_0x56b308[_0xee50('0x10')]){if(_0x56b308[_0xee50('0x10')][_0xee50('0x11')]===0x1f4){logger[_0xee50('0x10')](_0xee50('0xd'),_0x14079d,_0x56b308[_0xee50('0x10')][_0xee50('0x12')]);return _0x10ffe8(_0x56b308['error'][_0xee50('0x12')]);}logger[_0xee50('0x10')](_0xee50('0xd'),_0x14079d,_0x56b308[_0xee50('0x10')][_0xee50('0x12')]);return _0x1d81be(_0x56b308[_0xee50('0x10')][_0xee50('0x12')]);}else{logger[_0xee50('0x13')](_0xee50('0xd'),_0x14079d,'request\x20sent');_0x1d81be(_0x56b308[_0xee50('0x14')][_0xee50('0x12')]);}})[_0xee50('0x15')](function(_0x54f6c4){logger[_0xee50('0x10')](_0xee50('0xd'),_0x14079d,_0x54f6c4);_0x10ffe8(_0x54f6c4);});});}exports['GetServicenowAccount']=function(_0x24e5c3){var _0x46b85a=this;return new Promise(function(_0x3dcd32,_0x24edef){return db[_0xee50('0x16')]['findAll']({'raw':_0x24e5c3[_0xee50('0x17')]?_0x24e5c3[_0xee50('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x24e5c3['options']?_0x24e5c3[_0xee50('0x17')][_0xee50('0x18')]||null:null,'attributes':_0x24e5c3['options']?_0x24e5c3[_0xee50('0x17')][_0xee50('0x19')]||null:null,'limit':_0x24e5c3[_0xee50('0x17')]?_0x24e5c3[_0xee50('0x17')]['limit']||null:null,'include':_0x24e5c3['options']?_0x24e5c3[_0xee50('0x17')]['include']?_['map'](_0x24e5c3[_0xee50('0x17')][_0xee50('0x1a')],function(_0x4ee4b8){return{'model':db[_0x4ee4b8[_0xee50('0x1b')]],'as':_0x4ee4b8['as'],'attributes':_0x4ee4b8[_0xee50('0x19')],'include':_0x4ee4b8[_0xee50('0x1a')]?_[_0xee50('0x1c')](_0x4ee4b8[_0xee50('0x1a')],function(_0x260898){return{'model':db[_0x260898['model']],'as':_0x260898['as'],'attributes':_0x260898['attributes'],'include':_0x260898[_0xee50('0x1a')]?_[_0xee50('0x1c')](_0x260898[_0xee50('0x1a')],function(_0x495e13){return{'model':db[_0x495e13[_0xee50('0x1b')]],'as':_0x495e13['as'],'attributes':_0x495e13[_0xee50('0x19')]};}):[]};}):[]};}):[]:[]})[_0xee50('0x1d')](function(_0x2f5417){logger[_0xee50('0x13')]('GetServicenowAccount',_0x24e5c3);logger[_0xee50('0x1e')](_0xee50('0x1f'),_0x24e5c3,JSON['stringify'](_0x2f5417));_0x3dcd32(_0x2f5417);})[_0xee50('0x15')](function(_0x2e6e58){logger[_0xee50('0x10')](_0xee50('0x1f'),_0x2e6e58['message'],_0x24e5c3);_0x24edef(_0x46b85a[_0xee50('0x10')](0x1f4,_0x2e6e58[_0xee50('0x12')]));});});};exports['ShowServicenowAccount']=function(_0x259404){var _0x4495aa=this;return new Promise(function(_0x5087de,_0x509186){return db[_0xee50('0x16')][_0xee50('0x20')]({'raw':_0x259404['options']?_0x259404[_0xee50('0x17')][_0xee50('0x21')]===undefined?!![]:![]:!![],'where':_0x259404[_0xee50('0x17')]?_0x259404['options'][_0xee50('0x18')]||null:null,'attributes':_0x259404[_0xee50('0x17')]?_0x259404[_0xee50('0x17')][_0xee50('0x19')]||null:null,'include':_0x259404[_0xee50('0x17')]?_0x259404[_0xee50('0x17')][_0xee50('0x1a')]?_[_0xee50('0x1c')](_0x259404[_0xee50('0x17')][_0xee50('0x1a')],function(_0x3079bb){return{'model':db[_0x3079bb[_0xee50('0x1b')]],'as':_0x3079bb['as'],'attributes':_0x3079bb[_0xee50('0x19')],'include':_0x3079bb['include']?_['map'](_0x3079bb[_0xee50('0x1a')],function(_0x529889){return{'model':db[_0x529889[_0xee50('0x1b')]],'as':_0x529889['as'],'attributes':_0x529889[_0xee50('0x19')],'include':_0x529889[_0xee50('0x1a')]?_[_0xee50('0x1c')](_0x529889[_0xee50('0x1a')],function(_0x27626e){return{'model':db[_0x27626e['model']],'as':_0x27626e['as'],'attributes':_0x27626e['attributes']};}):[]};}):[]};}):[]:[]})[_0xee50('0x1d')](function(_0x3d778c){logger['info'](_0xee50('0x22'),_0x259404);logger[_0xee50('0x1e')]('ShowServicenowAccount',_0x259404,JSON[_0xee50('0xf')](_0x3d778c));_0x5087de(_0x3d778c);})[_0xee50('0x15')](function(_0x1c6f71){logger[_0xee50('0x10')]('ShowServicenowAccount',_0x1c6f71['message'],_0x259404);_0x509186(_0x4495aa['error'](0x1f4,_0x1c6f71[_0xee50('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index ed368d7..69fb47d 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 _0x1997=['connect-timeout','Router','../../components/auth/service','./intServicenowConfiguration.controller','get','isAuthenticated','/:id','show','getSubjects','/:id/descriptions','getDescriptions','post','put','update','delete','destroy','exports','util','path'];(function(_0x45ca1f,_0x2341c9){var _0x11b2ce=function(_0x4ac8cf){while(--_0x4ac8cf){_0x45ca1f['push'](_0x45ca1f['shift']());}};_0x11b2ce(++_0x2341c9);}(_0x1997,0x1ec));var _0x7199=function(_0x4a6814,_0x31094b){_0x4a6814=_0x4a6814-0x0;var _0xa4d06d=_0x1997[_0x4a6814];return _0xa4d06d;};'use strict';var multer=require('multer');var util=require(_0x7199('0x0'));var path=require(_0x7199('0x1'));var timeout=require(_0x7199('0x2'));var express=require('express');var router=express[_0x7199('0x3')]();var auth=require(_0x7199('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7199('0x5'));router[_0x7199('0x6')]('/',auth[_0x7199('0x7')](),controller['index']);router[_0x7199('0x6')](_0x7199('0x8'),auth[_0x7199('0x7')](),controller[_0x7199('0x9')]);router[_0x7199('0x6')]('/:id/fields',auth[_0x7199('0x7')](),controller['getFields']);router[_0x7199('0x6')]('/:id/subjects',auth[_0x7199('0x7')](),controller[_0x7199('0xa')]);router[_0x7199('0x6')](_0x7199('0xb'),auth['isAuthenticated'](),controller[_0x7199('0xc')]);router[_0x7199('0xd')]('/',auth[_0x7199('0x7')](),controller['create']);router[_0x7199('0xe')](_0x7199('0x8'),auth[_0x7199('0x7')](),controller[_0x7199('0xf')]);router[_0x7199('0x10')](_0x7199('0x8'),auth[_0x7199('0x7')](),controller[_0x7199('0x11')]);module[_0x7199('0x12')]=router; \ No newline at end of file +var _0x6be4=['../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','getSubjects','/:id/descriptions','getDescriptions','post','create','update','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x13184d,_0x6bdeb0){var _0x384a96=function(_0x17070d){while(--_0x17070d){_0x13184d['push'](_0x13184d['shift']());}};_0x384a96(++_0x6bdeb0);}(_0x6be4,0x1ef));var _0x46be=function(_0x33773c,_0xf80333){_0x33773c=_0x33773c-0x0;var _0x3d2463=_0x6be4[_0x33773c];return _0x3d2463;};'use strict';var multer=require('multer');var util=require(_0x46be('0x0'));var path=require(_0x46be('0x1'));var timeout=require(_0x46be('0x2'));var express=require(_0x46be('0x3'));var router=express[_0x46be('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x46be('0x5'));var config=require(_0x46be('0x6'));var controller=require(_0x46be('0x7'));router[_0x46be('0x8')]('/',auth[_0x46be('0x9')](),controller[_0x46be('0xa')]);router[_0x46be('0x8')](_0x46be('0xb'),auth[_0x46be('0x9')](),controller['show']);router['get']('/:id/fields',auth[_0x46be('0x9')](),controller['getFields']);router[_0x46be('0x8')]('/:id/subjects',auth[_0x46be('0x9')](),controller[_0x46be('0xc')]);router[_0x46be('0x8')](_0x46be('0xd'),auth['isAuthenticated'](),controller[_0x46be('0xe')]);router[_0x46be('0xf')]('/',auth['isAuthenticated'](),controller[_0x46be('0x10')]);router['put'](_0x46be('0xb'),auth[_0x46be('0x9')](),controller[_0x46be('0x11')]);router['delete'](_0x46be('0xb'),auth['isAuthenticated'](),controller[_0x46be('0x12')]);module[_0x46be('0x13')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 4665b27..c0e40df 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 _0xb480=['STRING','sequelize','exports'];(function(_0x9b2bb0,_0x3965b1){var _0x2cdb3b=function(_0x177d75){while(--_0x177d75){_0x9b2bb0['push'](_0x9b2bb0['shift']());}};_0x2cdb3b(++_0x3965b1);}(_0xb480,0x1a8));var _0x0b48=function(_0x58581e,_0x3a3aef){_0x58581e=_0x58581e-0x0;var _0x1a0645=_0xb480[_0x58581e];return _0x1a0645;};'use strict';var Sequelize=require(_0x0b48('0x0'));module[_0x0b48('0x1')]={'name':{'type':Sequelize[_0x0b48('0x2')]},'description':{'type':Sequelize[_0x0b48('0x2')]}}; \ No newline at end of file +var _0x44b8=['sequelize','exports','STRING'];(function(_0x38dbad,_0x54d595){var _0x52f01e=function(_0x4100ad){while(--_0x4100ad){_0x38dbad['push'](_0x38dbad['shift']());}};_0x52f01e(++_0x54d595);}(_0x44b8,0x159));var _0x844b=function(_0x21abe1,_0x10c5ec){_0x21abe1=_0x21abe1-0x0;var _0x4d0611=_0x44b8[_0x21abe1];return _0x4d0611;};'use strict';var Sequelize=require(_0x844b('0x0'));module[_0x844b('0x1')]={'name':{'type':Sequelize[_0x844b('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 16711dd..13cd803 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 _0xbac9=['offset','limit','reject','save','update','destroy','name','send','index','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','ServicenowConfiguration','then','includeAll','findAll','catch','show','params','include','find','create','body','getFields','ServicenowField','map','nolimit','getSubjects','getDescriptions','findOne','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','test','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~!@#$%^&-_=+[{]}.','request','info','debug','stringify','error','code','ServicenowConfiguration,\x20%s,\x20%s','message','result','sendStatus','status','end','json','count'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xbac9,0x192));var _0x9bac=function(_0x1789bc,_0x1acf84){_0x1789bc=_0x1789bc-0x0;var _0x35efd1=_0xbac9[_0x1789bc];return _0x35efd1;};'use strict';var pdf=require(_0x9bac('0x0'));var emlformat=require(_0x9bac('0x1'));var rimraf=require(_0x9bac('0x2'));var zipdir=require(_0x9bac('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9bac('0x4'));var moment=require(_0x9bac('0x5'));var BPromise=require(_0x9bac('0x6'));var Mustache=require(_0x9bac('0x7'));var util=require(_0x9bac('0x8'));var path=require(_0x9bac('0x9'));var sox=require(_0x9bac('0xa'));var csv=require('to-csv');var ejs=require(_0x9bac('0xb'));var fs=require('fs');var _=require(_0x9bac('0xc'));var squel=require('squel');var crypto=require(_0x9bac('0xd'));var jsforce=require(_0x9bac('0xe'));var deskjs=require(_0x9bac('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9bac('0x10'));var Redis=require(_0x9bac('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9bac('0x12'));var as=require(_0x9bac('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9bac('0x14'))(_0x9bac('0x15'));var utils=require(_0x9bac('0x16'));var config=require(_0x9bac('0x17'));var db=require(_0x9bac('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x9bac('0x19')]['http']({'port':0x232a});function checkPasswordPattern(_0x46371a,_0x58763d,_0x1122c3){if(_0x1122c3){var _0x25ec10=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x25ec10[_0x9bac('0x1a')](_0x58763d)){return _0x46371a;}else{throw new db['Sequelize'][(_0x9bac('0x1b'))](_0x9bac('0x1c'));}}else{return _0x46371a;}}function respondWithRpcPromise(_0x43b143,_0x3a40fd,_0x436d0b,_0x3c3546){return new BPromise(function(_0x3ec0f5,_0x57b3dc){var _0x4c4b7d=_0x3c3546||client;return _0x4c4b7d[_0x9bac('0x1d')](_0x43b143,_0x436d0b)['then'](function(_0x1937ce){logger[_0x9bac('0x1e')]('ServicenowConfiguration,\x20%s,\x20%s',_0x3a40fd,'request\x20sent');logger[_0x9bac('0x1f')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x3a40fd,'request\x20sent',JSON[_0x9bac('0x20')](_0x1937ce));if(_0x1937ce[_0x9bac('0x21')]){if(_0x1937ce[_0x9bac('0x21')][_0x9bac('0x22')]===0x1f4){logger[_0x9bac('0x21')](_0x9bac('0x23'),_0x3a40fd,_0x1937ce[_0x9bac('0x21')][_0x9bac('0x24')]);return _0x57b3dc(_0x1937ce[_0x9bac('0x21')][_0x9bac('0x24')]);}logger['error'](_0x9bac('0x23'),_0x3a40fd,_0x1937ce[_0x9bac('0x21')][_0x9bac('0x24')]);return _0x3ec0f5(_0x1937ce['error'][_0x9bac('0x24')]);}else{logger[_0x9bac('0x1e')](_0x9bac('0x23'),_0x3a40fd,'request\x20sent');_0x3ec0f5(_0x1937ce[_0x9bac('0x25')][_0x9bac('0x24')]);}})['catch'](function(_0x1f2f12){logger[_0x9bac('0x21')](_0x9bac('0x23'),_0x3a40fd,_0x1f2f12);_0x57b3dc(_0x1f2f12);});});}function respondWithStatusCode(_0x253d13,_0x59f3a0){_0x59f3a0=_0x59f3a0||0xcc;return function(_0x513ad7){if(_0x513ad7){return _0x253d13[_0x9bac('0x26')](_0x59f3a0);}return _0x253d13[_0x9bac('0x27')](_0x59f3a0)[_0x9bac('0x28')]();};}function respondWithResult(_0x5e3062,_0x19121e){_0x19121e=_0x19121e||0xc8;return function(_0x4d06e1){if(_0x4d06e1){return _0x5e3062[_0x9bac('0x27')](_0x19121e)[_0x9bac('0x29')](_0x4d06e1);}};}function respondWithFilteredResult(_0x58d16d,_0x36c2bd){return function(_0x1d8843){if(_0x1d8843){var _0x57db0e=_0x1d8843[_0x9bac('0x2a')],_0x46867e=_0x36c2bd[_0x9bac('0x2b')],_0x1b459b=_0x36c2bd[_0x9bac('0x2b')]+_0x36c2bd[_0x9bac('0x2c')],_0x457e6f;if(_0x1b459b>=_0x57db0e){_0x1b459b=_0x57db0e;_0x457e6f=0xc8;}else{_0x457e6f=0xce;}_0x58d16d[_0x9bac('0x27')](_0x457e6f);return _0x58d16d['set']('Content-Range',_0x46867e+'-'+_0x1b459b+'/'+_0x57db0e)['json'](_0x1d8843);}return null;};}function patchUpdates(_0x598489){return function(_0x1be39d){try{jsonpatch['apply'](_0x1be39d,_0x598489,!![]);}catch(_0x354977){return BPromise[_0x9bac('0x2d')](_0x354977);}return _0x1be39d[_0x9bac('0x2e')]();};}function saveUpdates(_0x3db189,_0x6bb8ef){return function(_0x57477a){if(_0x57477a){return _0x57477a[_0x9bac('0x2f')](_0x3db189)['then'](function(_0x271f27){return _0x271f27;});}return null;};}function removeEntity(_0x4eaeeb,_0x2a4756){return function(_0x3d4873){if(_0x3d4873){return _0x3d4873[_0x9bac('0x30')]()['then'](function(){_0x4eaeeb['status'](0xcc)[_0x9bac('0x28')]();});}};}function handleEntityNotFound(_0x419734,_0x3b0373){return function(_0x244b3c){if(!_0x244b3c){_0x419734[_0x9bac('0x26')](0x194);}return _0x244b3c;};}function handleError(_0x30c039,_0x484db5){_0x484db5=_0x484db5||0x1f4;return function(_0x5a1615){logger[_0x9bac('0x21')](_0x5a1615['stack']);if(_0x5a1615[_0x9bac('0x31')]){delete _0x5a1615[_0x9bac('0x31')];}_0x30c039['status'](_0x484db5)[_0x9bac('0x32')](_0x5a1615);};}exports[_0x9bac('0x33')]=function(_0x432311,_0x3065fd){var _0x56ce06={},_0xe959fd={},_0x424206={'count':0x0,'rows':[]};var _0x53fe95=_['map'](db['ServicenowConfiguration'][_0x9bac('0x34')],function(_0x5820e8){return{'name':_0x5820e8['fieldName'],'type':_0x5820e8[_0x9bac('0x35')][_0x9bac('0x36')]};});_0xe959fd[_0x9bac('0x37')]=_['map'](_0x53fe95,_0x9bac('0x31'));_0xe959fd[_0x9bac('0x38')]=_[_0x9bac('0x39')](_0x432311['query']);_0xe959fd['filters']=_[_0x9bac('0x3a')](_0xe959fd['model'],_0xe959fd['query']);_0x56ce06[_0x9bac('0x3b')]=_[_0x9bac('0x3a')](_0xe959fd[_0x9bac('0x37')],qs[_0x9bac('0x3c')](_0x432311[_0x9bac('0x38')][_0x9bac('0x3c')]));_0x56ce06['attributes']=_0x56ce06[_0x9bac('0x3b')][_0x9bac('0x3d')]?_0x56ce06[_0x9bac('0x3b')]:_0xe959fd[_0x9bac('0x37')];if(!_0x432311[_0x9bac('0x38')][_0x9bac('0x3e')]('nolimit')){_0x56ce06['limit']=qs[_0x9bac('0x2c')](_0x432311[_0x9bac('0x38')][_0x9bac('0x2c')]);_0x56ce06[_0x9bac('0x2b')]=qs[_0x9bac('0x2b')](_0x432311[_0x9bac('0x38')][_0x9bac('0x2b')]);}_0x56ce06[_0x9bac('0x3f')]=qs[_0x9bac('0x40')](_0x432311[_0x9bac('0x38')][_0x9bac('0x40')]);_0x56ce06[_0x9bac('0x41')]=qs[_0x9bac('0x42')](_[_0x9bac('0x43')](_0x432311[_0x9bac('0x38')],_0xe959fd['filters']));if(_0x432311[_0x9bac('0x38')][_0x9bac('0x44')]){_0x56ce06[_0x9bac('0x41')]=_[_0x9bac('0x45')](_0x56ce06[_0x9bac('0x41')],{'$or':_['map'](_0x53fe95,function(_0x2fddf6){if(_0x2fddf6[_0x9bac('0x35')]!=='VIRTUAL'){var _0x24d086={};_0x24d086[_0x2fddf6[_0x9bac('0x31')]]={'$like':'%'+_0x432311[_0x9bac('0x38')][_0x9bac('0x44')]+'%'};return _0x24d086;}})});}_0x56ce06=_[_0x9bac('0x45')]({},_0x56ce06,_0x432311[_0x9bac('0x46')]);var _0x2825cf={'where':_0x56ce06[_0x9bac('0x41')]};return db[_0x9bac('0x47')][_0x9bac('0x2a')](_0x2825cf)[_0x9bac('0x48')](function(_0x4a9709){_0x424206[_0x9bac('0x2a')]=_0x4a9709;if(_0x432311[_0x9bac('0x38')][_0x9bac('0x49')]){_0x56ce06['include']=[{'all':!![]}];}return db[_0x9bac('0x47')][_0x9bac('0x4a')](_0x56ce06);})[_0x9bac('0x48')](function(_0x591d72){_0x424206['rows']=_0x591d72;return _0x424206;})[_0x9bac('0x48')](respondWithFilteredResult(_0x3065fd,_0x56ce06))[_0x9bac('0x4b')](handleError(_0x3065fd,null));};exports[_0x9bac('0x4c')]=function(_0x1433ec,_0x1144d6){var _0x5a1836={'raw':![],'where':{'id':_0x1433ec[_0x9bac('0x4d')]['id']}},_0x58975e={};_0x58975e[_0x9bac('0x37')]=_[_0x9bac('0x39')](db[_0x9bac('0x47')][_0x9bac('0x34')]);_0x58975e[_0x9bac('0x38')]=_[_0x9bac('0x39')](_0x1433ec[_0x9bac('0x38')]);_0x58975e['filters']=_['intersection'](_0x58975e[_0x9bac('0x37')],_0x58975e[_0x9bac('0x38')]);_0x5a1836['attributes']=_[_0x9bac('0x3a')](_0x58975e['model'],qs[_0x9bac('0x3c')](_0x1433ec[_0x9bac('0x38')][_0x9bac('0x3c')]));_0x5a1836[_0x9bac('0x3b')]=_0x5a1836['attributes'][_0x9bac('0x3d')]?_0x5a1836[_0x9bac('0x3b')]:_0x58975e[_0x9bac('0x37')];if(_0x1433ec[_0x9bac('0x38')][_0x9bac('0x49')]){_0x5a1836[_0x9bac('0x4e')]=[{'all':!![]}];}_0x5a1836=_[_0x9bac('0x45')]({},_0x5a1836,_0x1433ec[_0x9bac('0x46')]);return db[_0x9bac('0x47')][_0x9bac('0x4f')](_0x5a1836)[_0x9bac('0x48')](handleEntityNotFound(_0x1144d6,null))[_0x9bac('0x48')](respondWithResult(_0x1144d6,null))[_0x9bac('0x4b')](handleError(_0x1144d6,null));};exports[_0x9bac('0x50')]=function(_0x407d57,_0x2b1811){return db[_0x9bac('0x47')]['create'](_0x407d57['body'],{})[_0x9bac('0x48')](respondWithResult(_0x2b1811,0xc9))['catch'](handleError(_0x2b1811,null));};exports['update']=function(_0x512294,_0x320745){if(_0x512294[_0x9bac('0x51')]['id']){delete _0x512294['body']['id'];}return db[_0x9bac('0x47')]['find']({'where':{'id':_0x512294[_0x9bac('0x4d')]['id']}})[_0x9bac('0x48')](handleEntityNotFound(_0x320745,null))['then'](saveUpdates(_0x512294['body'],null))['then'](respondWithResult(_0x320745,null))[_0x9bac('0x4b')](handleError(_0x320745,null));};exports[_0x9bac('0x30')]=function(_0x1c8fd4,_0x8d2e15){return db[_0x9bac('0x47')][_0x9bac('0x4f')]({'where':{'id':_0x1c8fd4[_0x9bac('0x4d')]['id']}})[_0x9bac('0x48')](handleEntityNotFound(_0x8d2e15,null))[_0x9bac('0x48')](removeEntity(_0x8d2e15,null))[_0x9bac('0x4b')](handleError(_0x8d2e15,null));};exports[_0x9bac('0x52')]=function(_0x12503b,_0x3ab25b,_0x3fe914){var _0x19ca98={};var _0x355cca={};var _0xb24cd;var _0x5a2fd4;return db[_0x9bac('0x47')]['findOne']({'where':{'id':_0x12503b[_0x9bac('0x4d')]['id']}})[_0x9bac('0x48')](handleEntityNotFound(_0x3ab25b,null))[_0x9bac('0x48')](function(_0x33882f){if(_0x33882f){_0xb24cd=_0x33882f;_0x355cca[_0x9bac('0x37')]=_[_0x9bac('0x39')](db[_0x9bac('0x53')][_0x9bac('0x34')]);_0x355cca[_0x9bac('0x38')]=_[_0x9bac('0x39')](_0x12503b[_0x9bac('0x38')]);_0x355cca['filters']=_['intersection'](_0x355cca[_0x9bac('0x37')],_0x355cca['query']);_0x19ca98[_0x9bac('0x3b')]=_[_0x9bac('0x3a')](_0x355cca[_0x9bac('0x37')],qs[_0x9bac('0x3c')](_0x12503b[_0x9bac('0x38')][_0x9bac('0x3c')]));_0x19ca98[_0x9bac('0x3b')]=_0x19ca98[_0x9bac('0x3b')][_0x9bac('0x3d')]?_0x19ca98[_0x9bac('0x3b')]:_0x355cca[_0x9bac('0x37')];_0x19ca98[_0x9bac('0x3f')]=qs[_0x9bac('0x40')](_0x12503b['query']['sort']);_0x19ca98['where']=qs[_0x9bac('0x42')](_[_0x9bac('0x43')](_0x12503b[_0x9bac('0x38')],_0x355cca[_0x9bac('0x42')]));if(_0x12503b[_0x9bac('0x38')][_0x9bac('0x44')]){_0x19ca98['where']=_[_0x9bac('0x45')](_0x19ca98['where'],{'$or':_[_0x9bac('0x54')](_0x19ca98['attributes'],function(_0x59ff87){var _0x579355={};_0x579355[_0x59ff87]={'$like':'%'+_0x12503b[_0x9bac('0x38')]['filter']+'%'};return _0x579355;})});}_0x19ca98=_[_0x9bac('0x45')]({},_0x19ca98,_0x12503b[_0x9bac('0x46')]);return _0xb24cd[_0x9bac('0x52')](_0x19ca98);}})[_0x9bac('0x48')](function(_0x131740){if(_0x131740){_0x5a2fd4=_0x131740['length'];if(!_0x12503b[_0x9bac('0x38')][_0x9bac('0x3e')](_0x9bac('0x55'))){_0x19ca98[_0x9bac('0x2c')]=qs[_0x9bac('0x2c')](_0x12503b[_0x9bac('0x38')][_0x9bac('0x2c')]);_0x19ca98[_0x9bac('0x2b')]=qs[_0x9bac('0x2b')](_0x12503b[_0x9bac('0x38')][_0x9bac('0x2b')]);}return _0xb24cd[_0x9bac('0x52')](_0x19ca98);}})['then'](function(_0x4c7b01){if(_0x4c7b01){return _0x4c7b01?{'count':_0x5a2fd4,'rows':_0x4c7b01}:null;}})[_0x9bac('0x48')](respondWithResult(_0x3ab25b,null))[_0x9bac('0x4b')](handleError(_0x3ab25b,null));};exports['getSubjects']=function(_0x59c2c5,_0x27dfa3,_0x16699f){var _0x21a6be={};var _0x570517={};var _0x24fd04;var _0x321129;return db[_0x9bac('0x47')]['findOne']({'where':{'id':_0x59c2c5[_0x9bac('0x4d')]['id']}})['then'](handleEntityNotFound(_0x27dfa3,null))[_0x9bac('0x48')](function(_0x4d56f3){if(_0x4d56f3){_0x24fd04=_0x4d56f3;_0x570517[_0x9bac('0x37')]=_[_0x9bac('0x39')](db[_0x9bac('0x53')]['rawAttributes']);_0x570517[_0x9bac('0x38')]=_[_0x9bac('0x39')](_0x59c2c5[_0x9bac('0x38')]);_0x570517[_0x9bac('0x42')]=_['intersection'](_0x570517[_0x9bac('0x37')],_0x570517[_0x9bac('0x38')]);_0x21a6be[_0x9bac('0x3b')]=_[_0x9bac('0x3a')](_0x570517[_0x9bac('0x37')],qs['fields'](_0x59c2c5[_0x9bac('0x38')]['fields']));_0x21a6be[_0x9bac('0x3b')]=_0x21a6be[_0x9bac('0x3b')][_0x9bac('0x3d')]?_0x21a6be[_0x9bac('0x3b')]:_0x570517['model'];_0x21a6be[_0x9bac('0x3f')]=qs['sort'](_0x59c2c5[_0x9bac('0x38')][_0x9bac('0x40')]);_0x21a6be['where']=qs['filters'](_['pick'](_0x59c2c5[_0x9bac('0x38')],_0x570517[_0x9bac('0x42')]));if(_0x59c2c5[_0x9bac('0x38')]['filter']){_0x21a6be[_0x9bac('0x41')]=_[_0x9bac('0x45')](_0x21a6be[_0x9bac('0x41')],{'$or':_[_0x9bac('0x54')](_0x21a6be[_0x9bac('0x3b')],function(_0x3fd29e){var _0x2bd820={};_0x2bd820[_0x3fd29e]={'$like':'%'+_0x59c2c5[_0x9bac('0x38')][_0x9bac('0x44')]+'%'};return _0x2bd820;})});}_0x21a6be=_[_0x9bac('0x45')]({},_0x21a6be,_0x59c2c5['options']);return _0x24fd04[_0x9bac('0x56')](_0x21a6be);}})[_0x9bac('0x48')](function(_0x33c819){if(_0x33c819){_0x321129=_0x33c819[_0x9bac('0x3d')];if(!_0x59c2c5[_0x9bac('0x38')][_0x9bac('0x3e')](_0x9bac('0x55'))){_0x21a6be[_0x9bac('0x2c')]=qs[_0x9bac('0x2c')](_0x59c2c5['query'][_0x9bac('0x2c')]);_0x21a6be['offset']=qs[_0x9bac('0x2b')](_0x59c2c5['query']['offset']);}return _0x24fd04['getSubjects'](_0x21a6be);}})['then'](function(_0x4ef19c){if(_0x4ef19c){return _0x4ef19c?{'count':_0x321129,'rows':_0x4ef19c}:null;}})[_0x9bac('0x48')](respondWithResult(_0x27dfa3,null))[_0x9bac('0x4b')](handleError(_0x27dfa3,null));};exports[_0x9bac('0x57')]=function(_0x4b4b1b,_0x23b09a,_0x3c630a){var _0x525588={};var _0x317913={};var _0xd41e1b;var _0x21fb58;return db[_0x9bac('0x47')][_0x9bac('0x58')]({'where':{'id':_0x4b4b1b[_0x9bac('0x4d')]['id']}})[_0x9bac('0x48')](handleEntityNotFound(_0x23b09a,null))[_0x9bac('0x48')](function(_0x53f62a){if(_0x53f62a){_0xd41e1b=_0x53f62a;_0x317913[_0x9bac('0x37')]=_[_0x9bac('0x39')](db['ServicenowField']['rawAttributes']);_0x317913['query']=_[_0x9bac('0x39')](_0x4b4b1b[_0x9bac('0x38')]);_0x317913['filters']=_[_0x9bac('0x3a')](_0x317913[_0x9bac('0x37')],_0x317913[_0x9bac('0x38')]);_0x525588[_0x9bac('0x3b')]=_[_0x9bac('0x3a')](_0x317913[_0x9bac('0x37')],qs[_0x9bac('0x3c')](_0x4b4b1b[_0x9bac('0x38')][_0x9bac('0x3c')]));_0x525588[_0x9bac('0x3b')]=_0x525588[_0x9bac('0x3b')][_0x9bac('0x3d')]?_0x525588[_0x9bac('0x3b')]:_0x317913['model'];_0x525588[_0x9bac('0x3f')]=qs[_0x9bac('0x40')](_0x4b4b1b[_0x9bac('0x38')][_0x9bac('0x40')]);_0x525588[_0x9bac('0x41')]=qs[_0x9bac('0x42')](_[_0x9bac('0x43')](_0x4b4b1b['query'],_0x317913[_0x9bac('0x42')]));if(_0x4b4b1b['query'][_0x9bac('0x44')]){_0x525588[_0x9bac('0x41')]=_[_0x9bac('0x45')](_0x525588[_0x9bac('0x41')],{'$or':_[_0x9bac('0x54')](_0x525588['attributes'],function(_0x2a2139){var _0x81bdb5={};_0x81bdb5[_0x2a2139]={'$like':'%'+_0x4b4b1b['query']['filter']+'%'};return _0x81bdb5;})});}_0x525588=_[_0x9bac('0x45')]({},_0x525588,_0x4b4b1b[_0x9bac('0x46')]);return _0xd41e1b['getDescriptions'](_0x525588);}})[_0x9bac('0x48')](function(_0x25f580){if(_0x25f580){_0x21fb58=_0x25f580['length'];if(!_0x4b4b1b[_0x9bac('0x38')][_0x9bac('0x3e')](_0x9bac('0x55'))){_0x525588[_0x9bac('0x2c')]=qs['limit'](_0x4b4b1b['query']['limit']);_0x525588[_0x9bac('0x2b')]=qs[_0x9bac('0x2b')](_0x4b4b1b['query'][_0x9bac('0x2b')]);}return _0xd41e1b[_0x9bac('0x57')](_0x525588);}})['then'](function(_0x4df971){if(_0x4df971){return _0x4df971?{'count':_0x21fb58,'rows':_0x4df971}:null;}})[_0x9bac('0x48')](respondWithResult(_0x23b09a,null))[_0x9bac('0x4b')](handleError(_0x23b09a,null));}; \ No newline at end of file +var _0xa0be=['bluebird','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','stringify','code','error','ServicenowConfiguration,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','count','offset','set','Content-Range','apply','reject','save','destroy','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','params','length','find','create','body','getFields','ServicenowField','findOne','pick','nolimit','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x504e8a,_0x45141e){var _0x5d74b9=function(_0x597ca0){while(--_0x597ca0){_0x504e8a['push'](_0x504e8a['shift']());}};_0x5d74b9(++_0x45141e);}(_0xa0be,0x1c2));var _0xea0b=function(_0x12d39b,_0x2fc433){_0x12d39b=_0x12d39b-0x0;var _0x136972=_0xa0be[_0x12d39b];return _0x136972;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xea0b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xea0b('0x1'));var jsonpatch=require(_0xea0b('0x2'));var rp=require(_0xea0b('0x3'));var moment=require(_0xea0b('0x4'));var BPromise=require(_0xea0b('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xea0b('0x6'));var sox=require('sox');var csv=require(_0xea0b('0x7'));var ejs=require(_0xea0b('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xea0b('0x9'));var crypto=require(_0xea0b('0xa'));var jsforce=require(_0xea0b('0xb'));var deskjs=require(_0xea0b('0xc'));var toCsv=require(_0xea0b('0x7'));var querystring=require(_0xea0b('0xd'));var Papa=require(_0xea0b('0xe'));var Redis=require(_0xea0b('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xea0b('0x10'));var logger=require('../../config/logger')(_0xea0b('0x11'));var utils=require(_0xea0b('0x12'));var config=require(_0xea0b('0x13'));var db=require(_0xea0b('0x14'))['db'];var jayson=require(_0xea0b('0x15'));var client=jayson['client'][_0xea0b('0x16')]({'port':0x232a});function checkPasswordPattern(_0x4e2bd0,_0x3f4f28,_0x32596b){if(_0x32596b){var _0x1c2e42=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1c2e42[_0xea0b('0x17')](_0x3f4f28)){return _0x4e2bd0;}else{throw new db[(_0xea0b('0x18'))][(_0xea0b('0x19'))](_0xea0b('0x1a'));}}else{return _0x4e2bd0;}}function respondWithRpcPromise(_0x4139ac,_0x3fc94f,_0x22876c,_0x39315f){return new BPromise(function(_0x21f8fb,_0x160419){var _0x18c968=_0x39315f||client;return _0x18c968[_0xea0b('0x1b')](_0x4139ac,_0x22876c)[_0xea0b('0x1c')](function(_0x5dcf6b){logger[_0xea0b('0x1d')]('ServicenowConfiguration,\x20%s,\x20%s',_0x3fc94f,_0xea0b('0x1e'));logger[_0xea0b('0x1f')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x3fc94f,_0xea0b('0x1e'),JSON[_0xea0b('0x20')](_0x5dcf6b));if(_0x5dcf6b['error']){if(_0x5dcf6b['error'][_0xea0b('0x21')]===0x1f4){logger[_0xea0b('0x22')](_0xea0b('0x23'),_0x3fc94f,_0x5dcf6b[_0xea0b('0x22')][_0xea0b('0x24')]);return _0x160419(_0x5dcf6b['error']['message']);}logger['error'](_0xea0b('0x23'),_0x3fc94f,_0x5dcf6b['error'][_0xea0b('0x24')]);return _0x21f8fb(_0x5dcf6b[_0xea0b('0x22')][_0xea0b('0x24')]);}else{logger[_0xea0b('0x1d')](_0xea0b('0x23'),_0x3fc94f,_0xea0b('0x1e'));_0x21f8fb(_0x5dcf6b[_0xea0b('0x25')]['message']);}})[_0xea0b('0x26')](function(_0x28e7fa){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x3fc94f,_0x28e7fa);_0x160419(_0x28e7fa);});});}function respondWithStatusCode(_0xbaa6d8,_0x28725a){_0x28725a=_0x28725a||0xcc;return function(_0x58b3b9){if(_0x58b3b9){return _0xbaa6d8[_0xea0b('0x27')](_0x28725a);}return _0xbaa6d8['status'](_0x28725a)[_0xea0b('0x28')]();};}function respondWithResult(_0x4c80ab,_0x43c2e3){_0x43c2e3=_0x43c2e3||0xc8;return function(_0x2bee2b){if(_0x2bee2b){return _0x4c80ab[_0xea0b('0x29')](_0x43c2e3)['json'](_0x2bee2b);}};}function respondWithFilteredResult(_0x38b7f2,_0x19138f){return function(_0x52456f){if(_0x52456f){var _0x3a9e9b=_0x52456f[_0xea0b('0x2a')],_0x2870cd=_0x19138f['offset'],_0x5cc3b4=_0x19138f[_0xea0b('0x2b')]+_0x19138f['limit'],_0xb237c2;if(_0x5cc3b4>=_0x3a9e9b){_0x5cc3b4=_0x3a9e9b;_0xb237c2=0xc8;}else{_0xb237c2=0xce;}_0x38b7f2[_0xea0b('0x29')](_0xb237c2);return _0x38b7f2[_0xea0b('0x2c')](_0xea0b('0x2d'),_0x2870cd+'-'+_0x5cc3b4+'/'+_0x3a9e9b)['json'](_0x52456f);}return null;};}function patchUpdates(_0x582cba){return function(_0x20f5f4){try{jsonpatch[_0xea0b('0x2e')](_0x20f5f4,_0x582cba,!![]);}catch(_0x39fa62){return BPromise[_0xea0b('0x2f')](_0x39fa62);}return _0x20f5f4[_0xea0b('0x30')]();};}function saveUpdates(_0x5debc8,_0x43d0f5){return function(_0x2f335a){if(_0x2f335a){return _0x2f335a['update'](_0x5debc8)[_0xea0b('0x1c')](function(_0x3e8099){return _0x3e8099;});}return null;};}function removeEntity(_0x165caf,_0x49cff8){return function(_0xc15731){if(_0xc15731){return _0xc15731[_0xea0b('0x31')]()[_0xea0b('0x1c')](function(){_0x165caf[_0xea0b('0x29')](0xcc)[_0xea0b('0x28')]();});}};}function handleEntityNotFound(_0x31de3b,_0x1176bc){return function(_0x2de51e){if(!_0x2de51e){_0x31de3b[_0xea0b('0x27')](0x194);}return _0x2de51e;};}function handleError(_0x54119f,_0x32c535){_0x32c535=_0x32c535||0x1f4;return function(_0x452b76){logger['error'](_0x452b76[_0xea0b('0x32')]);if(_0x452b76[_0xea0b('0x33')]){delete _0x452b76['name'];}_0x54119f[_0xea0b('0x29')](_0x32c535)[_0xea0b('0x34')](_0x452b76);};}exports[_0xea0b('0x35')]=function(_0xb9979c,_0x2b3704){var _0x23978f={},_0x153caf={},_0x3ca362={'count':0x0,'rows':[]};var _0x12207a=_[_0xea0b('0x36')](db[_0xea0b('0x37')][_0xea0b('0x38')],function(_0xa8da9a){return{'name':_0xa8da9a[_0xea0b('0x39')],'type':_0xa8da9a[_0xea0b('0x3a')][_0xea0b('0x3b')]};});_0x153caf[_0xea0b('0x3c')]=_['map'](_0x12207a,_0xea0b('0x33'));_0x153caf[_0xea0b('0x3d')]=_[_0xea0b('0x3e')](_0xb9979c[_0xea0b('0x3d')]);_0x153caf[_0xea0b('0x3f')]=_[_0xea0b('0x40')](_0x153caf['model'],_0x153caf[_0xea0b('0x3d')]);_0x23978f[_0xea0b('0x41')]=_[_0xea0b('0x40')](_0x153caf[_0xea0b('0x3c')],qs[_0xea0b('0x42')](_0xb9979c[_0xea0b('0x3d')][_0xea0b('0x42')]));_0x23978f[_0xea0b('0x41')]=_0x23978f[_0xea0b('0x41')]['length']?_0x23978f[_0xea0b('0x41')]:_0x153caf[_0xea0b('0x3c')];if(!_0xb9979c[_0xea0b('0x3d')][_0xea0b('0x43')]('nolimit')){_0x23978f['limit']=qs[_0xea0b('0x44')](_0xb9979c[_0xea0b('0x3d')]['limit']);_0x23978f[_0xea0b('0x2b')]=qs[_0xea0b('0x2b')](_0xb9979c[_0xea0b('0x3d')][_0xea0b('0x2b')]);}_0x23978f[_0xea0b('0x45')]=qs[_0xea0b('0x46')](_0xb9979c[_0xea0b('0x3d')][_0xea0b('0x46')]);_0x23978f[_0xea0b('0x47')]=qs[_0xea0b('0x3f')](_['pick'](_0xb9979c[_0xea0b('0x3d')],_0x153caf[_0xea0b('0x3f')]));if(_0xb9979c[_0xea0b('0x3d')][_0xea0b('0x48')]){_0x23978f[_0xea0b('0x47')]=_[_0xea0b('0x49')](_0x23978f[_0xea0b('0x47')],{'$or':_[_0xea0b('0x36')](_0x12207a,function(_0x50900d){if(_0x50900d[_0xea0b('0x3a')]!=='VIRTUAL'){var _0x55a6ed={};_0x55a6ed[_0x50900d[_0xea0b('0x33')]]={'$like':'%'+_0xb9979c[_0xea0b('0x3d')][_0xea0b('0x48')]+'%'};return _0x55a6ed;}})});}_0x23978f=_[_0xea0b('0x49')]({},_0x23978f,_0xb9979c[_0xea0b('0x4a')]);var _0x3f4d07={'where':_0x23978f[_0xea0b('0x47')]};return db[_0xea0b('0x37')][_0xea0b('0x2a')](_0x3f4d07)[_0xea0b('0x1c')](function(_0x16fd8c){_0x3ca362[_0xea0b('0x2a')]=_0x16fd8c;if(_0xb9979c[_0xea0b('0x3d')][_0xea0b('0x4b')]){_0x23978f[_0xea0b('0x4c')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0xea0b('0x4d')](_0x23978f);})[_0xea0b('0x1c')](function(_0x4f4c85){_0x3ca362[_0xea0b('0x4e')]=_0x4f4c85;return _0x3ca362;})[_0xea0b('0x1c')](respondWithFilteredResult(_0x2b3704,_0x23978f))[_0xea0b('0x26')](handleError(_0x2b3704,null));};exports['show']=function(_0x3a6206,_0x430978){var _0x5cd40b={'raw':![],'where':{'id':_0x3a6206[_0xea0b('0x4f')]['id']}},_0x25a5ec={};_0x25a5ec[_0xea0b('0x3c')]=_[_0xea0b('0x3e')](db[_0xea0b('0x37')][_0xea0b('0x38')]);_0x25a5ec[_0xea0b('0x3d')]=_[_0xea0b('0x3e')](_0x3a6206[_0xea0b('0x3d')]);_0x25a5ec[_0xea0b('0x3f')]=_[_0xea0b('0x40')](_0x25a5ec[_0xea0b('0x3c')],_0x25a5ec[_0xea0b('0x3d')]);_0x5cd40b[_0xea0b('0x41')]=_['intersection'](_0x25a5ec[_0xea0b('0x3c')],qs[_0xea0b('0x42')](_0x3a6206[_0xea0b('0x3d')][_0xea0b('0x42')]));_0x5cd40b[_0xea0b('0x41')]=_0x5cd40b[_0xea0b('0x41')][_0xea0b('0x50')]?_0x5cd40b[_0xea0b('0x41')]:_0x25a5ec[_0xea0b('0x3c')];if(_0x3a6206[_0xea0b('0x3d')]['includeAll']){_0x5cd40b[_0xea0b('0x4c')]=[{'all':!![]}];}_0x5cd40b=_[_0xea0b('0x49')]({},_0x5cd40b,_0x3a6206['options']);return db['ServicenowConfiguration'][_0xea0b('0x51')](_0x5cd40b)[_0xea0b('0x1c')](handleEntityNotFound(_0x430978,null))[_0xea0b('0x1c')](respondWithResult(_0x430978,null))['catch'](handleError(_0x430978,null));};exports['create']=function(_0x117db8,_0x27e4c3){return db[_0xea0b('0x37')][_0xea0b('0x52')](_0x117db8[_0xea0b('0x53')],{})[_0xea0b('0x1c')](respondWithResult(_0x27e4c3,0xc9))[_0xea0b('0x26')](handleError(_0x27e4c3,null));};exports['update']=function(_0x4e5f3a,_0x415386){if(_0x4e5f3a[_0xea0b('0x53')]['id']){delete _0x4e5f3a[_0xea0b('0x53')]['id'];}return db[_0xea0b('0x37')][_0xea0b('0x51')]({'where':{'id':_0x4e5f3a[_0xea0b('0x4f')]['id']}})[_0xea0b('0x1c')](handleEntityNotFound(_0x415386,null))[_0xea0b('0x1c')](saveUpdates(_0x4e5f3a[_0xea0b('0x53')],null))[_0xea0b('0x1c')](respondWithResult(_0x415386,null))['catch'](handleError(_0x415386,null));};exports[_0xea0b('0x31')]=function(_0x5be9fd,_0xed144b){return db[_0xea0b('0x37')][_0xea0b('0x51')]({'where':{'id':_0x5be9fd[_0xea0b('0x4f')]['id']}})[_0xea0b('0x1c')](handleEntityNotFound(_0xed144b,null))[_0xea0b('0x1c')](removeEntity(_0xed144b,null))[_0xea0b('0x26')](handleError(_0xed144b,null));};exports[_0xea0b('0x54')]=function(_0x2bf898,_0x17e933,_0x298f5b){var _0x5d8dbf={};var _0x45d94a={};var _0x25bc6f;var _0x43ec88;return db[_0xea0b('0x37')]['findOne']({'where':{'id':_0x2bf898[_0xea0b('0x4f')]['id']}})['then'](handleEntityNotFound(_0x17e933,null))[_0xea0b('0x1c')](function(_0x2483e2){if(_0x2483e2){_0x25bc6f=_0x2483e2;_0x45d94a[_0xea0b('0x3c')]=_[_0xea0b('0x3e')](db[_0xea0b('0x55')][_0xea0b('0x38')]);_0x45d94a[_0xea0b('0x3d')]=_[_0xea0b('0x3e')](_0x2bf898['query']);_0x45d94a['filters']=_[_0xea0b('0x40')](_0x45d94a[_0xea0b('0x3c')],_0x45d94a[_0xea0b('0x3d')]);_0x5d8dbf[_0xea0b('0x41')]=_[_0xea0b('0x40')](_0x45d94a['model'],qs[_0xea0b('0x42')](_0x2bf898['query'][_0xea0b('0x42')]));_0x5d8dbf[_0xea0b('0x41')]=_0x5d8dbf[_0xea0b('0x41')]['length']?_0x5d8dbf[_0xea0b('0x41')]:_0x45d94a[_0xea0b('0x3c')];_0x5d8dbf[_0xea0b('0x45')]=qs['sort'](_0x2bf898[_0xea0b('0x3d')]['sort']);_0x5d8dbf[_0xea0b('0x47')]=qs[_0xea0b('0x3f')](_['pick'](_0x2bf898[_0xea0b('0x3d')],_0x45d94a[_0xea0b('0x3f')]));if(_0x2bf898[_0xea0b('0x3d')][_0xea0b('0x48')]){_0x5d8dbf[_0xea0b('0x47')]=_[_0xea0b('0x49')](_0x5d8dbf[_0xea0b('0x47')],{'$or':_[_0xea0b('0x36')](_0x5d8dbf['attributes'],function(_0x5008f4){var _0xbb561c={};_0xbb561c[_0x5008f4]={'$like':'%'+_0x2bf898['query'][_0xea0b('0x48')]+'%'};return _0xbb561c;})});}_0x5d8dbf=_[_0xea0b('0x49')]({},_0x5d8dbf,_0x2bf898[_0xea0b('0x4a')]);return _0x25bc6f[_0xea0b('0x54')](_0x5d8dbf);}})[_0xea0b('0x1c')](function(_0x2cbb36){if(_0x2cbb36){_0x43ec88=_0x2cbb36['length'];if(!_0x2bf898[_0xea0b('0x3d')][_0xea0b('0x43')]('nolimit')){_0x5d8dbf[_0xea0b('0x44')]=qs[_0xea0b('0x44')](_0x2bf898[_0xea0b('0x3d')][_0xea0b('0x44')]);_0x5d8dbf['offset']=qs[_0xea0b('0x2b')](_0x2bf898[_0xea0b('0x3d')][_0xea0b('0x2b')]);}return _0x25bc6f['getFields'](_0x5d8dbf);}})[_0xea0b('0x1c')](function(_0x255604){if(_0x255604){return _0x255604?{'count':_0x43ec88,'rows':_0x255604}:null;}})[_0xea0b('0x1c')](respondWithResult(_0x17e933,null))[_0xea0b('0x26')](handleError(_0x17e933,null));};exports['getSubjects']=function(_0x12e04a,_0xd0bd89,_0xd9747d){var _0x3f1710={};var _0x5a777={};var _0x2ce52d;var _0x684709;return db[_0xea0b('0x37')][_0xea0b('0x56')]({'where':{'id':_0x12e04a[_0xea0b('0x4f')]['id']}})[_0xea0b('0x1c')](handleEntityNotFound(_0xd0bd89,null))[_0xea0b('0x1c')](function(_0xc57183){if(_0xc57183){_0x2ce52d=_0xc57183;_0x5a777[_0xea0b('0x3c')]=_[_0xea0b('0x3e')](db[_0xea0b('0x55')][_0xea0b('0x38')]);_0x5a777[_0xea0b('0x3d')]=_['keys'](_0x12e04a[_0xea0b('0x3d')]);_0x5a777[_0xea0b('0x3f')]=_['intersection'](_0x5a777[_0xea0b('0x3c')],_0x5a777[_0xea0b('0x3d')]);_0x3f1710['attributes']=_[_0xea0b('0x40')](_0x5a777[_0xea0b('0x3c')],qs[_0xea0b('0x42')](_0x12e04a[_0xea0b('0x3d')][_0xea0b('0x42')]));_0x3f1710[_0xea0b('0x41')]=_0x3f1710[_0xea0b('0x41')][_0xea0b('0x50')]?_0x3f1710['attributes']:_0x5a777[_0xea0b('0x3c')];_0x3f1710[_0xea0b('0x45')]=qs['sort'](_0x12e04a[_0xea0b('0x3d')][_0xea0b('0x46')]);_0x3f1710[_0xea0b('0x47')]=qs[_0xea0b('0x3f')](_[_0xea0b('0x57')](_0x12e04a['query'],_0x5a777[_0xea0b('0x3f')]));if(_0x12e04a[_0xea0b('0x3d')][_0xea0b('0x48')]){_0x3f1710[_0xea0b('0x47')]=_[_0xea0b('0x49')](_0x3f1710[_0xea0b('0x47')],{'$or':_[_0xea0b('0x36')](_0x3f1710['attributes'],function(_0x293cb1){var _0x33dae7={};_0x33dae7[_0x293cb1]={'$like':'%'+_0x12e04a['query'][_0xea0b('0x48')]+'%'};return _0x33dae7;})});}_0x3f1710=_[_0xea0b('0x49')]({},_0x3f1710,_0x12e04a['options']);return _0x2ce52d['getSubjects'](_0x3f1710);}})[_0xea0b('0x1c')](function(_0x33c820){if(_0x33c820){_0x684709=_0x33c820[_0xea0b('0x50')];if(!_0x12e04a[_0xea0b('0x3d')][_0xea0b('0x43')](_0xea0b('0x58'))){_0x3f1710[_0xea0b('0x44')]=qs[_0xea0b('0x44')](_0x12e04a[_0xea0b('0x3d')][_0xea0b('0x44')]);_0x3f1710[_0xea0b('0x2b')]=qs[_0xea0b('0x2b')](_0x12e04a['query']['offset']);}return _0x2ce52d[_0xea0b('0x59')](_0x3f1710);}})[_0xea0b('0x1c')](function(_0x3e922f){if(_0x3e922f){return _0x3e922f?{'count':_0x684709,'rows':_0x3e922f}:null;}})[_0xea0b('0x1c')](respondWithResult(_0xd0bd89,null))[_0xea0b('0x26')](handleError(_0xd0bd89,null));};exports[_0xea0b('0x5a')]=function(_0x329cc0,_0xc77d64,_0x4f9bab){var _0x1311e2={};var _0x5b0601={};var _0x1e82f2;var _0x4f5c48;return db[_0xea0b('0x37')][_0xea0b('0x56')]({'where':{'id':_0x329cc0[_0xea0b('0x4f')]['id']}})[_0xea0b('0x1c')](handleEntityNotFound(_0xc77d64,null))['then'](function(_0x3edaa0){if(_0x3edaa0){_0x1e82f2=_0x3edaa0;_0x5b0601[_0xea0b('0x3c')]=_[_0xea0b('0x3e')](db['ServicenowField'][_0xea0b('0x38')]);_0x5b0601['query']=_[_0xea0b('0x3e')](_0x329cc0[_0xea0b('0x3d')]);_0x5b0601[_0xea0b('0x3f')]=_['intersection'](_0x5b0601['model'],_0x5b0601['query']);_0x1311e2['attributes']=_[_0xea0b('0x40')](_0x5b0601['model'],qs[_0xea0b('0x42')](_0x329cc0[_0xea0b('0x3d')][_0xea0b('0x42')]));_0x1311e2[_0xea0b('0x41')]=_0x1311e2[_0xea0b('0x41')][_0xea0b('0x50')]?_0x1311e2[_0xea0b('0x41')]:_0x5b0601['model'];_0x1311e2[_0xea0b('0x45')]=qs['sort'](_0x329cc0[_0xea0b('0x3d')]['sort']);_0x1311e2[_0xea0b('0x47')]=qs['filters'](_['pick'](_0x329cc0[_0xea0b('0x3d')],_0x5b0601[_0xea0b('0x3f')]));if(_0x329cc0[_0xea0b('0x3d')][_0xea0b('0x48')]){_0x1311e2[_0xea0b('0x47')]=_['merge'](_0x1311e2[_0xea0b('0x47')],{'$or':_[_0xea0b('0x36')](_0x1311e2['attributes'],function(_0x433d96){var _0x11fa9e={};_0x11fa9e[_0x433d96]={'$like':'%'+_0x329cc0['query']['filter']+'%'};return _0x11fa9e;})});}_0x1311e2=_[_0xea0b('0x49')]({},_0x1311e2,_0x329cc0[_0xea0b('0x4a')]);return _0x1e82f2[_0xea0b('0x5a')](_0x1311e2);}})[_0xea0b('0x1c')](function(_0x84fec0){if(_0x84fec0){_0x4f5c48=_0x84fec0[_0xea0b('0x50')];if(!_0x329cc0[_0xea0b('0x3d')][_0xea0b('0x43')](_0xea0b('0x58'))){_0x1311e2[_0xea0b('0x44')]=qs[_0xea0b('0x44')](_0x329cc0[_0xea0b('0x3d')][_0xea0b('0x44')]);_0x1311e2[_0xea0b('0x2b')]=qs[_0xea0b('0x2b')](_0x329cc0[_0xea0b('0x3d')][_0xea0b('0x2b')]);}return _0x1e82f2[_0xea0b('0x5a')](_0x1311e2);}})[_0xea0b('0x1c')](function(_0x366e7d){if(_0x366e7d){return _0x366e7d?{'count':_0x4f5c48,'rows':_0x366e7d}:null;}})[_0xea0b('0x1c')](respondWithResult(_0xc77d64,null))['catch'](handleError(_0xc77d64,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 556aa4b..1a12e6d 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 _0x1f39=['int_servicenow_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','./intServicenowConfiguration.attributes','exports','define'];(function(_0x22caf2,_0x1e4ef6){var _0x1f1044=function(_0x190181){while(--_0x190181){_0x22caf2['push'](_0x22caf2['shift']());}};_0x1f1044(++_0x1e4ef6);}(_0x1f39,0x85));var _0x91f3=function(_0x2746a2,_0x3ef3e3){_0x2746a2=_0x2746a2-0x0;var _0x258dae=_0x1f39[_0x2746a2];return _0x258dae;};'use strict';var _=require(_0x91f3('0x0'));var util=require(_0x91f3('0x1'));var logger=require(_0x91f3('0x2'))(_0x91f3('0x3'));var moment=require('moment');var BPromise=require(_0x91f3('0x4'));var rp=require(_0x91f3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x91f3('0x6'));var config=require('../../config/environment');var attributes=require(_0x91f3('0x7'));module[_0x91f3('0x8')]=function(_0x2db60b,_0x5c5ed7){return _0x2db60b[_0x91f3('0x9')]('ServicenowConfiguration',attributes,{'tableName':_0x91f3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf4c7=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','ServicenowConfiguration','int_servicenow_configurations'];(function(_0x1349d0,_0x5a7aea){var _0x3d2abc=function(_0x739a00){while(--_0x739a00){_0x1349d0['push'](_0x1349d0['shift']());}};_0x3d2abc(++_0x5a7aea);}(_0xf4c7,0x11e));var _0x7f4c=function(_0xa60623,_0x2d4e4f){_0xa60623=_0xa60623-0x0;var _0x4a6487=_0xf4c7[_0xa60623];return _0x4a6487;};'use strict';var _=require('lodash');var util=require(_0x7f4c('0x0'));var logger=require(_0x7f4c('0x1'))(_0x7f4c('0x2'));var moment=require('moment');var BPromise=require(_0x7f4c('0x3'));var rp=require(_0x7f4c('0x4'));var fs=require('fs');var path=require(_0x7f4c('0x5'));var rimraf=require(_0x7f4c('0x6'));var config=require(_0x7f4c('0x7'));var attributes=require('./intServicenowConfiguration.attributes');module[_0x7f4c('0x8')]=function(_0x206e16,_0x2dd622){return _0x206e16['define'](_0x7f4c('0x9'),attributes,{'tableName':_0x7f4c('0xa'),'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 190b425..e91d1de 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 _0x1597=['ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ServicenowConfiguration,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug'];(function(_0x2c421b,_0x234646){var _0x2a138c=function(_0xbe8942){while(--_0xbe8942){_0x2c421b['push'](_0x2c421b['shift']());}};_0x2a138c(++_0x234646);}(_0x1597,0x7b));var _0x7159=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x1597[_0x819464];return _0x49dcc0;};'use strict';var _=require('lodash');var util=require(_0x7159('0x0'));var moment=require('moment');var BPromise=require(_0x7159('0x1'));var rs=require(_0x7159('0x2'));var fs=require('fs');var Redis=require(_0x7159('0x3'));var db=require(_0x7159('0x4'))['db'];var utils=require(_0x7159('0x5'));var logger=require(_0x7159('0x6'))(_0x7159('0x7'));var config=require(_0x7159('0x8'));var jayson=require(_0x7159('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1fee68,_0x3e7542,_0x205914){return new BPromise(function(_0x51248a,_0x3418ff){return client[_0x7159('0xa')](_0x1fee68,_0x205914)[_0x7159('0xb')](function(_0x3979fc){logger[_0x7159('0xc')]('ServicenowConfiguration,\x20%s,\x20%s',_0x3e7542,_0x7159('0xd'));logger[_0x7159('0xe')](_0x7159('0xf'),_0x3e7542,_0x7159('0xd'),JSON[_0x7159('0x10')](_0x3979fc));if(_0x3979fc[_0x7159('0x11')]){if(_0x3979fc['error'][_0x7159('0x12')]===0x1f4){logger[_0x7159('0x11')](_0x7159('0x13'),_0x3e7542,_0x3979fc[_0x7159('0x11')][_0x7159('0x14')]);return _0x3418ff(_0x3979fc[_0x7159('0x11')][_0x7159('0x14')]);}logger[_0x7159('0x11')](_0x7159('0x13'),_0x3e7542,_0x3979fc[_0x7159('0x11')][_0x7159('0x14')]);return _0x51248a(_0x3979fc['error'][_0x7159('0x14')]);}else{logger[_0x7159('0xc')](_0x7159('0x13'),_0x3e7542,_0x7159('0xd'));_0x51248a(_0x3979fc[_0x7159('0x15')]['message']);}})[_0x7159('0x16')](function(_0x19c98f){logger[_0x7159('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x3e7542,_0x19c98f);_0x3418ff(_0x19c98f);});});} \ No newline at end of file +var _0xd324=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','moment','bluebird'];(function(_0xb1cf84,_0x813740){var _0x4bad2e=function(_0x53e6f2){while(--_0x53e6f2){_0xb1cf84['push'](_0xb1cf84['shift']());}};_0x4bad2e(++_0x813740);}(_0xd324,0x129));var _0x4d32=function(_0x516927,_0xb4aad0){_0x516927=_0x516927-0x0;var _0x30749b=_0xd324[_0x516927];return _0x30749b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4d32('0x0'));var BPromise=require(_0x4d32('0x1'));var rs=require(_0x4d32('0x2'));var fs=require('fs');var Redis=require(_0x4d32('0x3'));var db=require(_0x4d32('0x4'))['db'];var utils=require(_0x4d32('0x5'));var logger=require(_0x4d32('0x6'))(_0x4d32('0x7'));var config=require(_0x4d32('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4d32('0x9')][_0x4d32('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15706c,_0x1c6974,_0x3776e8){return new BPromise(function(_0x4ba014,_0x2fffd5){return client[_0x4d32('0xb')](_0x15706c,_0x3776e8)[_0x4d32('0xc')](function(_0x1163d6){logger[_0x4d32('0xd')](_0x4d32('0xe'),_0x1c6974,_0x4d32('0xf'));logger[_0x4d32('0x10')](_0x4d32('0x11'),_0x1c6974,_0x4d32('0xf'),JSON[_0x4d32('0x12')](_0x1163d6));if(_0x1163d6[_0x4d32('0x13')]){if(_0x1163d6[_0x4d32('0x13')]['code']===0x1f4){logger[_0x4d32('0x13')](_0x4d32('0xe'),_0x1c6974,_0x1163d6[_0x4d32('0x13')]['message']);return _0x2fffd5(_0x1163d6[_0x4d32('0x13')][_0x4d32('0x14')]);}logger['error'](_0x4d32('0xe'),_0x1c6974,_0x1163d6[_0x4d32('0x13')][_0x4d32('0x14')]);return _0x4ba014(_0x1163d6['error'][_0x4d32('0x14')]);}else{logger[_0x4d32('0xd')]('ServicenowConfiguration,\x20%s,\x20%s',_0x1c6974,_0x4d32('0xf'));_0x4ba014(_0x1163d6[_0x4d32('0x15')]['message']);}})[_0x4d32('0x16')](function(_0x2d6e80){logger[_0x4d32('0x13')](_0x4d32('0xe'),_0x1c6974,_0x2d6e80);_0x2fffd5(_0x2d6e80);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 34cbc2b..49a729f 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 _0x213d=['./intServicenowField.controller','get','index','/:id','isAuthenticated','post','create','update','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x213d,0xac));var _0xd213=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x213d[_0x23e7c1];return _0x1add43;};'use strict';var multer=require('multer');var util=require(_0xd213('0x0'));var path=require(_0xd213('0x1'));var timeout=require(_0xd213('0x2'));var express=require(_0xd213('0x3'));var router=express[_0xd213('0x4')]();var auth=require(_0xd213('0x5'));var interaction=require(_0xd213('0x6'));var config=require(_0xd213('0x7'));var controller=require(_0xd213('0x8'));router[_0xd213('0x9')]('/',auth['isAuthenticated'](),controller[_0xd213('0xa')]);router[_0xd213('0x9')](_0xd213('0xb'),auth[_0xd213('0xc')](),controller['show']);router[_0xd213('0xd')]('/',auth[_0xd213('0xc')](),controller[_0xd213('0xe')]);router['put'](_0xd213('0xb'),auth[_0xd213('0xc')](),controller[_0xd213('0xf')]);router['delete'](_0xd213('0xb'),auth[_0xd213('0xc')](),controller[_0xd213('0x10')]);module[_0xd213('0x11')]=router; \ No newline at end of file +var _0xd2fa=['exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','get','isAuthenticated','post','update','delete','destroy'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0xd2fa,0x17a));var _0xad2f=function(_0x3eb36b,_0x4b42e4){_0x3eb36b=_0x3eb36b-0x0;var _0x82726e=_0xd2fa[_0x3eb36b];return _0x82726e;};'use strict';var multer=require(_0xad2f('0x0'));var util=require(_0xad2f('0x1'));var path=require(_0xad2f('0x2'));var timeout=require(_0xad2f('0x3'));var express=require('express');var router=express[_0xad2f('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xad2f('0x5'));var config=require('../../config/environment');var controller=require('./intServicenowField.controller');router[_0xad2f('0x6')]('/',auth[_0xad2f('0x7')](),controller['index']);router[_0xad2f('0x6')]('/:id',auth[_0xad2f('0x7')](),controller['show']);router[_0xad2f('0x8')]('/',auth[_0xad2f('0x7')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xad2f('0x9')]);router[_0xad2f('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xad2f('0xb')]);module[_0xad2f('0xc')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index f47db7d..f5e6ec1 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 _0xdc3d=['string','variable','keyValue','STRING','customVariable','sequelize','exports','ENUM'];(function(_0x47025a,_0x556183){var _0x1e20f5=function(_0x310198){while(--_0x310198){_0x47025a['push'](_0x47025a['shift']());}};_0x1e20f5(++_0x556183);}(_0xdc3d,0x1ad));var _0xddc3=function(_0x44e877,_0x501d60){_0x44e877=_0x44e877-0x0;var _0x10c09a=_0xdc3d[_0x44e877];return _0x10c09a;};'use strict';var Sequelize=require(_0xddc3('0x0'));module[_0xddc3('0x1')]={'type':{'type':Sequelize[_0xddc3('0x2')](_0xddc3('0x3'),_0xddc3('0x4'),'customVariable',_0xddc3('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xddc3('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xddc3('0x2')](_0xddc3('0x3'),'variable',_0xddc3('0x7'))},'keyContent':{'type':Sequelize[_0xddc3('0x6')]},'idField':{'type':Sequelize[_0xddc3('0x6')]},'nameField':{'type':Sequelize[_0xddc3('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x75a9=['STRING','ENUM','customVariable','BOOLEAN','sequelize','exports','string','variable','keyValue'];(function(_0x53ff8e,_0x142c4a){var _0x57058b=function(_0x29c872){while(--_0x29c872){_0x53ff8e['push'](_0x53ff8e['shift']());}};_0x57058b(++_0x142c4a);}(_0x75a9,0x136));var _0x975a=function(_0x3aab61,_0x4523f9){_0x3aab61=_0x3aab61-0x0;var _0x3480e0=_0x75a9[_0x3aab61];return _0x3480e0;};'use strict';var Sequelize=require(_0x975a('0x0'));module[_0x975a('0x1')]={'type':{'type':Sequelize['ENUM'](_0x975a('0x2'),_0x975a('0x3'),'customVariable',_0x975a('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x975a('0x5')]},'key':{'type':Sequelize[_0x975a('0x5')]},'keyType':{'type':Sequelize[_0x975a('0x6')](_0x975a('0x2'),_0x975a('0x3'),_0x975a('0x7'))},'keyContent':{'type':Sequelize[_0x975a('0x5')]},'idField':{'type':Sequelize[_0x975a('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x975a('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x975a('0x5')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index b0105d5..e37af13 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 _0x4692=['body','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','options','ServicenowField','includeAll','findAll','show','params','rawAttributes','include','catch','create'];(function(_0x4b3ec4,_0x3c573c){var _0x192836=function(_0x498cc0){while(--_0x498cc0){_0x4b3ec4['push'](_0x4b3ec4['shift']());}};_0x192836(++_0x3c573c);}(_0x4692,0x1d6));var _0x2469=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x4692[_0x2b10c6];return _0x3789d2;};'use strict';var pdf=require(_0x2469('0x0'));var emlformat=require(_0x2469('0x1'));var rimraf=require(_0x2469('0x2'));var zipdir=require(_0x2469('0x3'));var jsonpatch=require(_0x2469('0x4'));var rp=require(_0x2469('0x5'));var moment=require(_0x2469('0x6'));var BPromise=require(_0x2469('0x7'));var Mustache=require(_0x2469('0x8'));var util=require(_0x2469('0x9'));var path=require('path');var sox=require(_0x2469('0xa'));var csv=require(_0x2469('0xb'));var ejs=require(_0x2469('0xc'));var fs=require('fs');var _=require(_0x2469('0xd'));var squel=require(_0x2469('0xe'));var crypto=require(_0x2469('0xf'));var jsforce=require(_0x2469('0x10'));var deskjs=require(_0x2469('0x11'));var toCsv=require(_0x2469('0xb'));var querystring=require(_0x2469('0x12'));var Papa=require(_0x2469('0x13'));var Redis=require(_0x2469('0x14'));var authService=require(_0x2469('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x2469('0x16'));var hardwareService=require(_0x2469('0x17'));var logger=require(_0x2469('0x18'))(_0x2469('0x19'));var utils=require(_0x2469('0x1a'));var config=require('../../config/environment');var db=require(_0x2469('0x1b'))['db'];function respondWithStatusCode(_0x5390bc,_0x53a3da){_0x53a3da=_0x53a3da||0xcc;return function(_0x20b8ee){if(_0x20b8ee){return _0x5390bc[_0x2469('0x1c')](_0x53a3da);}return _0x5390bc[_0x2469('0x1d')](_0x53a3da)[_0x2469('0x1e')]();};}function respondWithResult(_0xc1a56f,_0x55755a){_0x55755a=_0x55755a||0xc8;return function(_0xaf84ec){if(_0xaf84ec){return _0xc1a56f[_0x2469('0x1d')](_0x55755a)[_0x2469('0x1f')](_0xaf84ec);}};}function respondWithFilteredResult(_0x29ec83,_0x619c52){return function(_0x2cfbb2){if(_0x2cfbb2){var _0x2babb1=_0x2cfbb2[_0x2469('0x20')],_0x1a2e4a=_0x619c52[_0x2469('0x21')],_0x1f0e69=_0x619c52[_0x2469('0x21')]+_0x619c52[_0x2469('0x22')],_0x48ebd7;if(_0x1f0e69>=_0x2babb1){_0x1f0e69=_0x2babb1;_0x48ebd7=0xc8;}else{_0x48ebd7=0xce;}_0x29ec83[_0x2469('0x1d')](_0x48ebd7);return _0x29ec83[_0x2469('0x23')](_0x2469('0x24'),_0x1a2e4a+'-'+_0x1f0e69+'/'+_0x2babb1)[_0x2469('0x1f')](_0x2cfbb2);}return null;};}function patchUpdates(_0x1acf4c){return function(_0x42ea97){try{jsonpatch['apply'](_0x42ea97,_0x1acf4c,!![]);}catch(_0x2e1e1a){return BPromise[_0x2469('0x25')](_0x2e1e1a);}return _0x42ea97['save']();};}function saveUpdates(_0x5ee324,_0x3c361d){return function(_0x5c48ea){if(_0x5c48ea){return _0x5c48ea[_0x2469('0x26')](_0x5ee324)[_0x2469('0x27')](function(_0x1cd04e){return _0x1cd04e;});}return null;};}function removeEntity(_0x3dc61e,_0x40ce90){return function(_0x52189c){if(_0x52189c){return _0x52189c[_0x2469('0x28')]()[_0x2469('0x27')](function(){_0x3dc61e['status'](0xcc)[_0x2469('0x1e')]();});}};}function handleEntityNotFound(_0x58e5d6,_0x33274b){return function(_0x34c0b6){if(!_0x34c0b6){_0x58e5d6['sendStatus'](0x194);}return _0x34c0b6;};}function handleError(_0x9485b0,_0x5c16d3){_0x5c16d3=_0x5c16d3||0x1f4;return function(_0x549f81){logger[_0x2469('0x29')](_0x549f81[_0x2469('0x2a')]);if(_0x549f81[_0x2469('0x2b')]){delete _0x549f81[_0x2469('0x2b')];}_0x9485b0['status'](_0x5c16d3)[_0x2469('0x2c')](_0x549f81);};}exports[_0x2469('0x2d')]=function(_0x4162c4,_0x15d1b0){var _0x31a336={},_0x3a6a0a={},_0x98f3b={'count':0x0,'rows':[]};var _0x17e3c7=_['map'](db['ServicenowField']['rawAttributes'],function(_0x130294){return{'name':_0x130294[_0x2469('0x2e')],'type':_0x130294['type'][_0x2469('0x2f')]};});_0x3a6a0a[_0x2469('0x30')]=_[_0x2469('0x31')](_0x17e3c7,_0x2469('0x2b'));_0x3a6a0a[_0x2469('0x32')]=_[_0x2469('0x33')](_0x4162c4[_0x2469('0x32')]);_0x3a6a0a[_0x2469('0x34')]=_[_0x2469('0x35')](_0x3a6a0a[_0x2469('0x30')],_0x3a6a0a[_0x2469('0x32')]);_0x31a336[_0x2469('0x36')]=_[_0x2469('0x35')](_0x3a6a0a[_0x2469('0x30')],qs['fields'](_0x4162c4[_0x2469('0x32')][_0x2469('0x37')]));_0x31a336[_0x2469('0x36')]=_0x31a336['attributes'][_0x2469('0x38')]?_0x31a336[_0x2469('0x36')]:_0x3a6a0a[_0x2469('0x30')];if(!_0x4162c4[_0x2469('0x32')][_0x2469('0x39')](_0x2469('0x3a'))){_0x31a336[_0x2469('0x22')]=qs['limit'](_0x4162c4[_0x2469('0x32')][_0x2469('0x22')]);_0x31a336[_0x2469('0x21')]=qs[_0x2469('0x21')](_0x4162c4[_0x2469('0x32')][_0x2469('0x21')]);}_0x31a336[_0x2469('0x3b')]=qs['sort'](_0x4162c4[_0x2469('0x32')][_0x2469('0x3c')]);_0x31a336[_0x2469('0x3d')]=qs[_0x2469('0x34')](_[_0x2469('0x3e')](_0x4162c4[_0x2469('0x32')],_0x3a6a0a[_0x2469('0x34')]));if(_0x4162c4[_0x2469('0x32')]['filter']){_0x31a336[_0x2469('0x3d')]=_[_0x2469('0x3f')](_0x31a336[_0x2469('0x3d')],{'$or':_[_0x2469('0x31')](_0x17e3c7,function(_0x58f3b3){if(_0x58f3b3[_0x2469('0x40')]!==_0x2469('0x41')){var _0xccf140={};_0xccf140[_0x58f3b3[_0x2469('0x2b')]]={'$like':'%'+_0x4162c4[_0x2469('0x32')]['filter']+'%'};return _0xccf140;}})});}_0x31a336=_['merge']({},_0x31a336,_0x4162c4[_0x2469('0x42')]);var _0x5a4182={'where':_0x31a336[_0x2469('0x3d')]};return db[_0x2469('0x43')]['count'](_0x5a4182)[_0x2469('0x27')](function(_0x1fc803){_0x98f3b[_0x2469('0x20')]=_0x1fc803;if(_0x4162c4[_0x2469('0x32')][_0x2469('0x44')]){_0x31a336['include']=[{'all':!![]}];}return db['ServicenowField'][_0x2469('0x45')](_0x31a336);})[_0x2469('0x27')](function(_0x4df18e){_0x98f3b['rows']=_0x4df18e;return _0x98f3b;})['then'](respondWithFilteredResult(_0x15d1b0,_0x31a336))['catch'](handleError(_0x15d1b0,null));};exports[_0x2469('0x46')]=function(_0x107028,_0x554078){var _0x5351e6={'raw':!![],'where':{'id':_0x107028[_0x2469('0x47')]['id']}},_0x48729a={};_0x48729a[_0x2469('0x30')]=_[_0x2469('0x33')](db[_0x2469('0x43')][_0x2469('0x48')]);_0x48729a['query']=_[_0x2469('0x33')](_0x107028['query']);_0x48729a['filters']=_['intersection'](_0x48729a[_0x2469('0x30')],_0x48729a[_0x2469('0x32')]);_0x5351e6['attributes']=_[_0x2469('0x35')](_0x48729a[_0x2469('0x30')],qs[_0x2469('0x37')](_0x107028[_0x2469('0x32')][_0x2469('0x37')]));_0x5351e6['attributes']=_0x5351e6[_0x2469('0x36')]['length']?_0x5351e6[_0x2469('0x36')]:_0x48729a['model'];if(_0x107028[_0x2469('0x32')][_0x2469('0x44')]){_0x5351e6[_0x2469('0x49')]=[{'all':!![]}];}_0x5351e6=_[_0x2469('0x3f')]({},_0x5351e6,_0x107028[_0x2469('0x42')]);return db['ServicenowField']['find'](_0x5351e6)[_0x2469('0x27')](handleEntityNotFound(_0x554078,null))['then'](respondWithResult(_0x554078,null))[_0x2469('0x4a')](handleError(_0x554078,null));};exports[_0x2469('0x4b')]=function(_0x594d85,_0x3ed168){return db['ServicenowField']['create'](_0x594d85[_0x2469('0x4c')],{})[_0x2469('0x27')](respondWithResult(_0x3ed168,0xc9))[_0x2469('0x4a')](handleError(_0x3ed168,null));};exports[_0x2469('0x26')]=function(_0x35155f,_0x299f31){if(_0x35155f[_0x2469('0x4c')]['id']){delete _0x35155f[_0x2469('0x4c')]['id'];}return db[_0x2469('0x43')][_0x2469('0x4d')]({'where':{'id':_0x35155f['params']['id']}})[_0x2469('0x27')](handleEntityNotFound(_0x299f31,null))[_0x2469('0x27')](saveUpdates(_0x35155f[_0x2469('0x4c')],null))[_0x2469('0x27')](respondWithResult(_0x299f31,null))[_0x2469('0x4a')](handleError(_0x299f31,null));};exports['destroy']=function(_0xcb5731,_0x56bcd9){return db[_0x2469('0x43')]['find']({'where':{'id':_0xcb5731['params']['id']}})['then'](handleEntityNotFound(_0x56bcd9,null))[_0x2469('0x27')](removeEntity(_0x56bcd9,null))['catch'](handleError(_0x56bcd9,null));}; \ No newline at end of file +var _0xc5af=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','options','ServicenowField','includeAll','findAll','rows','catch','show','params','include','create','body','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','lodash','squel','crypto'];(function(_0x28ccd0,_0x13b1b1){var _0x543254=function(_0x3f195d){while(--_0x3f195d){_0x28ccd0['push'](_0x28ccd0['shift']());}};_0x543254(++_0x13b1b1);}(_0xc5af,0x10e));var _0xfc5a=function(_0x1e8eb4,_0x53a726){_0x1e8eb4=_0x1e8eb4-0x0;var _0x3e3e6e=_0xc5af[_0x1e8eb4];return _0x3e3e6e;};'use strict';var pdf=require(_0xfc5a('0x0'));var emlformat=require(_0xfc5a('0x1'));var rimraf=require(_0xfc5a('0x2'));var zipdir=require(_0xfc5a('0x3'));var jsonpatch=require(_0xfc5a('0x4'));var rp=require(_0xfc5a('0x5'));var moment=require(_0xfc5a('0x6'));var BPromise=require(_0xfc5a('0x7'));var Mustache=require(_0xfc5a('0x8'));var util=require('util');var path=require(_0xfc5a('0x9'));var sox=require('sox');var csv=require(_0xfc5a('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xfc5a('0xb'));var squel=require(_0xfc5a('0xc'));var crypto=require(_0xfc5a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfc5a('0xa'));var querystring=require(_0xfc5a('0xe'));var Papa=require(_0xfc5a('0xf'));var Redis=require('ioredis');var authService=require(_0xfc5a('0x10'));var qs=require(_0xfc5a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfc5a('0x12'));var logger=require(_0xfc5a('0x13'))(_0xfc5a('0x14'));var utils=require(_0xfc5a('0x15'));var config=require('../../config/environment');var db=require(_0xfc5a('0x16'))['db'];function respondWithStatusCode(_0x47fa64,_0x6f42ef){_0x6f42ef=_0x6f42ef||0xcc;return function(_0x356a71){if(_0x356a71){return _0x47fa64[_0xfc5a('0x17')](_0x6f42ef);}return _0x47fa64[_0xfc5a('0x18')](_0x6f42ef)['end']();};}function respondWithResult(_0x1552bd,_0x5964c3){_0x5964c3=_0x5964c3||0xc8;return function(_0x144204){if(_0x144204){return _0x1552bd[_0xfc5a('0x18')](_0x5964c3)[_0xfc5a('0x19')](_0x144204);}};}function respondWithFilteredResult(_0x2c2e26,_0x35bf5c){return function(_0x284905){if(_0x284905){var _0x1d326=_0x284905[_0xfc5a('0x1a')],_0x2ad083=_0x35bf5c[_0xfc5a('0x1b')],_0xc67a39=_0x35bf5c[_0xfc5a('0x1b')]+_0x35bf5c[_0xfc5a('0x1c')],_0x591acb;if(_0xc67a39>=_0x1d326){_0xc67a39=_0x1d326;_0x591acb=0xc8;}else{_0x591acb=0xce;}_0x2c2e26['status'](_0x591acb);return _0x2c2e26[_0xfc5a('0x1d')]('Content-Range',_0x2ad083+'-'+_0xc67a39+'/'+_0x1d326)[_0xfc5a('0x19')](_0x284905);}return null;};}function patchUpdates(_0x1f8c1d){return function(_0x4720b1){try{jsonpatch[_0xfc5a('0x1e')](_0x4720b1,_0x1f8c1d,!![]);}catch(_0x25a84d){return BPromise[_0xfc5a('0x1f')](_0x25a84d);}return _0x4720b1['save']();};}function saveUpdates(_0x2a21d9,_0x9969a6){return function(_0x4d7491){if(_0x4d7491){return _0x4d7491[_0xfc5a('0x20')](_0x2a21d9)[_0xfc5a('0x21')](function(_0x4a83aa){return _0x4a83aa;});}return null;};}function removeEntity(_0x425888,_0x2479e2){return function(_0x416d2a){if(_0x416d2a){return _0x416d2a[_0xfc5a('0x22')]()[_0xfc5a('0x21')](function(){_0x425888[_0xfc5a('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3fb381,_0x55387e){return function(_0xea26a5){if(!_0xea26a5){_0x3fb381[_0xfc5a('0x17')](0x194);}return _0xea26a5;};}function handleError(_0x38766b,_0x2d80a2){_0x2d80a2=_0x2d80a2||0x1f4;return function(_0x5221fb){logger[_0xfc5a('0x23')](_0x5221fb[_0xfc5a('0x24')]);if(_0x5221fb[_0xfc5a('0x25')]){delete _0x5221fb[_0xfc5a('0x25')];}_0x38766b[_0xfc5a('0x18')](_0x2d80a2)[_0xfc5a('0x26')](_0x5221fb);};}exports[_0xfc5a('0x27')]=function(_0x347e15,_0xf10189){var _0x560ba5={},_0x5dbe92={},_0x5840b7={'count':0x0,'rows':[]};var _0x3abc70=_[_0xfc5a('0x28')](db['ServicenowField'][_0xfc5a('0x29')],function(_0x293219){return{'name':_0x293219[_0xfc5a('0x2a')],'type':_0x293219['type']['key']};});_0x5dbe92[_0xfc5a('0x2b')]=_[_0xfc5a('0x28')](_0x3abc70,_0xfc5a('0x25'));_0x5dbe92[_0xfc5a('0x2c')]=_[_0xfc5a('0x2d')](_0x347e15[_0xfc5a('0x2c')]);_0x5dbe92[_0xfc5a('0x2e')]=_[_0xfc5a('0x2f')](_0x5dbe92[_0xfc5a('0x2b')],_0x5dbe92[_0xfc5a('0x2c')]);_0x560ba5[_0xfc5a('0x30')]=_['intersection'](_0x5dbe92['model'],qs[_0xfc5a('0x31')](_0x347e15['query'][_0xfc5a('0x31')]));_0x560ba5['attributes']=_0x560ba5[_0xfc5a('0x30')][_0xfc5a('0x32')]?_0x560ba5['attributes']:_0x5dbe92[_0xfc5a('0x2b')];if(!_0x347e15[_0xfc5a('0x2c')][_0xfc5a('0x33')](_0xfc5a('0x34'))){_0x560ba5[_0xfc5a('0x1c')]=qs[_0xfc5a('0x1c')](_0x347e15[_0xfc5a('0x2c')][_0xfc5a('0x1c')]);_0x560ba5[_0xfc5a('0x1b')]=qs[_0xfc5a('0x1b')](_0x347e15[_0xfc5a('0x2c')]['offset']);}_0x560ba5['order']=qs['sort'](_0x347e15['query'][_0xfc5a('0x35')]);_0x560ba5[_0xfc5a('0x36')]=qs[_0xfc5a('0x2e')](_['pick'](_0x347e15['query'],_0x5dbe92[_0xfc5a('0x2e')]));if(_0x347e15[_0xfc5a('0x2c')][_0xfc5a('0x37')]){_0x560ba5[_0xfc5a('0x36')]=_[_0xfc5a('0x38')](_0x560ba5[_0xfc5a('0x36')],{'$or':_[_0xfc5a('0x28')](_0x3abc70,function(_0x2fc9d4){if(_0x2fc9d4[_0xfc5a('0x39')]!==_0xfc5a('0x3a')){var _0x5b9128={};_0x5b9128[_0x2fc9d4[_0xfc5a('0x25')]]={'$like':'%'+_0x347e15[_0xfc5a('0x2c')]['filter']+'%'};return _0x5b9128;}})});}_0x560ba5=_[_0xfc5a('0x38')]({},_0x560ba5,_0x347e15[_0xfc5a('0x3b')]);var _0x12c135={'where':_0x560ba5[_0xfc5a('0x36')]};return db[_0xfc5a('0x3c')][_0xfc5a('0x1a')](_0x12c135)['then'](function(_0x50ebbd){_0x5840b7['count']=_0x50ebbd;if(_0x347e15[_0xfc5a('0x2c')][_0xfc5a('0x3d')]){_0x560ba5['include']=[{'all':!![]}];}return db[_0xfc5a('0x3c')][_0xfc5a('0x3e')](_0x560ba5);})['then'](function(_0x33279f){_0x5840b7[_0xfc5a('0x3f')]=_0x33279f;return _0x5840b7;})[_0xfc5a('0x21')](respondWithFilteredResult(_0xf10189,_0x560ba5))[_0xfc5a('0x40')](handleError(_0xf10189,null));};exports[_0xfc5a('0x41')]=function(_0x405bf8,_0x4fb020){var _0x222066={'raw':!![],'where':{'id':_0x405bf8[_0xfc5a('0x42')]['id']}},_0x451fd4={};_0x451fd4[_0xfc5a('0x2b')]=_[_0xfc5a('0x2d')](db[_0xfc5a('0x3c')][_0xfc5a('0x29')]);_0x451fd4[_0xfc5a('0x2c')]=_[_0xfc5a('0x2d')](_0x405bf8[_0xfc5a('0x2c')]);_0x451fd4[_0xfc5a('0x2e')]=_[_0xfc5a('0x2f')](_0x451fd4[_0xfc5a('0x2b')],_0x451fd4[_0xfc5a('0x2c')]);_0x222066[_0xfc5a('0x30')]=_[_0xfc5a('0x2f')](_0x451fd4[_0xfc5a('0x2b')],qs[_0xfc5a('0x31')](_0x405bf8['query'][_0xfc5a('0x31')]));_0x222066[_0xfc5a('0x30')]=_0x222066[_0xfc5a('0x30')]['length']?_0x222066[_0xfc5a('0x30')]:_0x451fd4['model'];if(_0x405bf8['query'][_0xfc5a('0x3d')]){_0x222066[_0xfc5a('0x43')]=[{'all':!![]}];}_0x222066=_[_0xfc5a('0x38')]({},_0x222066,_0x405bf8[_0xfc5a('0x3b')]);return db[_0xfc5a('0x3c')]['find'](_0x222066)[_0xfc5a('0x21')](handleEntityNotFound(_0x4fb020,null))[_0xfc5a('0x21')](respondWithResult(_0x4fb020,null))[_0xfc5a('0x40')](handleError(_0x4fb020,null));};exports[_0xfc5a('0x44')]=function(_0x33ce0c,_0x3e1630){return db[_0xfc5a('0x3c')]['create'](_0x33ce0c['body'],{})[_0xfc5a('0x21')](respondWithResult(_0x3e1630,0xc9))[_0xfc5a('0x40')](handleError(_0x3e1630,null));};exports['update']=function(_0x400d2c,_0x28993d){if(_0x400d2c[_0xfc5a('0x45')]['id']){delete _0x400d2c['body']['id'];}return db[_0xfc5a('0x3c')][_0xfc5a('0x46')]({'where':{'id':_0x400d2c[_0xfc5a('0x42')]['id']}})['then'](handleEntityNotFound(_0x28993d,null))[_0xfc5a('0x21')](saveUpdates(_0x400d2c['body'],null))['then'](respondWithResult(_0x28993d,null))[_0xfc5a('0x40')](handleError(_0x28993d,null));};exports['destroy']=function(_0x299e67,_0x2e1247){return db[_0xfc5a('0x3c')]['find']({'where':{'id':_0x299e67['params']['id']}})[_0xfc5a('0x21')](handleEntityNotFound(_0x2e1247,null))[_0xfc5a('0x21')](removeEntity(_0x2e1247,null))[_0xfc5a('0x40')](handleError(_0x2e1247,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 288eb1d..e77f660 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 _0xdb6e=['servicenow_unique_index','FieldId','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','ServicenowField','int_servicenow_fields'];(function(_0x3b6749,_0x2fed81){var _0x2e5a0c=function(_0x2646c8){while(--_0x2646c8){_0x3b6749['push'](_0x3b6749['shift']());}};_0x2e5a0c(++_0x2fed81);}(_0xdb6e,0x179));var _0xedb6=function(_0x4283c0,_0xc694d5){_0x4283c0=_0x4283c0-0x0;var _0x6b47ab=_0xdb6e[_0x4283c0];return _0x6b47ab;};'use strict';var _=require(_0xedb6('0x0'));var util=require(_0xedb6('0x1'));var logger=require(_0xedb6('0x2'))(_0xedb6('0x3'));var moment=require(_0xedb6('0x4'));var BPromise=require(_0xedb6('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xedb6('0x6'));var rimraf=require(_0xedb6('0x7'));var config=require(_0xedb6('0x8'));var attributes=require(_0xedb6('0x9'));module[_0xedb6('0xa')]=function(_0x30de0d,_0x35f987){return _0x30de0d['define'](_0xedb6('0xb'),attributes,{'tableName':_0xedb6('0xc'),'paranoid':![],'indexes':[{'name':_0xedb6('0xd'),'fields':['idField',_0xedb6('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf6a7=['bluebird','request-promise','path','rimraf','./intServicenowField.attributes','define','ServicenowField','servicenow_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment'];(function(_0x212629,_0x27eef1){var _0x426613=function(_0x6df3ca){while(--_0x6df3ca){_0x212629['push'](_0x212629['shift']());}};_0x426613(++_0x27eef1);}(_0xf6a7,0x1bd));var _0x7f6a=function(_0x5e1d47,_0x4204ac){_0x5e1d47=_0x5e1d47-0x0;var _0xe5c474=_0xf6a7[_0x5e1d47];return _0xe5c474;};'use strict';var _=require(_0x7f6a('0x0'));var util=require(_0x7f6a('0x1'));var logger=require(_0x7f6a('0x2'))(_0x7f6a('0x3'));var moment=require(_0x7f6a('0x4'));var BPromise=require(_0x7f6a('0x5'));var rp=require(_0x7f6a('0x6'));var fs=require('fs');var path=require(_0x7f6a('0x7'));var rimraf=require(_0x7f6a('0x8'));var config=require('../../config/environment');var attributes=require(_0x7f6a('0x9'));module['exports']=function(_0x4f6af4,_0x2f88fa){return _0x4f6af4[_0x7f6a('0xa')](_0x7f6a('0xb'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x7f6a('0xc'),'fields':[_0x7f6a('0xd'),_0x7f6a('0xe')],'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 325de54..df1f468 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 _0x4f2f=['request\x20sent','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','debug','stringify','error','code','ServicenowField,\x20%s,\x20%s','message'];(function(_0x28ddf2,_0x44e917){var _0x5b69d0=function(_0x17a4f1){while(--_0x17a4f1){_0x28ddf2['push'](_0x28ddf2['shift']());}};_0x5b69d0(++_0x44e917);}(_0x4f2f,0x162));var _0xf4f2=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x4f2f[_0x1f9f37];return _0x21c080;};'use strict';var _=require(_0xf4f2('0x0'));var util=require(_0xf4f2('0x1'));var moment=require(_0xf4f2('0x2'));var BPromise=require(_0xf4f2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf4f2('0x4'));var db=require(_0xf4f2('0x5'))['db'];var utils=require(_0xf4f2('0x6'));var logger=require(_0xf4f2('0x7'))(_0xf4f2('0x8'));var config=require(_0xf4f2('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf4f2('0xa')][_0xf4f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5ce1a3,_0x268ec0,_0x199230){return new BPromise(function(_0x29f5a1,_0x5d89bc){return client[_0xf4f2('0xc')](_0x5ce1a3,_0x199230)['then'](function(_0x161b01){logger[_0xf4f2('0xd')]('ServicenowField,\x20%s,\x20%s',_0x268ec0,'request\x20sent');logger[_0xf4f2('0xe')]('ServicenowField,\x20%s,\x20%s,\x20%s',_0x268ec0,'request\x20sent',JSON[_0xf4f2('0xf')](_0x161b01));if(_0x161b01[_0xf4f2('0x10')]){if(_0x161b01[_0xf4f2('0x10')][_0xf4f2('0x11')]===0x1f4){logger[_0xf4f2('0x10')](_0xf4f2('0x12'),_0x268ec0,_0x161b01[_0xf4f2('0x10')]['message']);return _0x5d89bc(_0x161b01[_0xf4f2('0x10')][_0xf4f2('0x13')]);}logger[_0xf4f2('0x10')](_0xf4f2('0x12'),_0x268ec0,_0x161b01['error'][_0xf4f2('0x13')]);return _0x29f5a1(_0x161b01[_0xf4f2('0x10')]['message']);}else{logger[_0xf4f2('0xd')]('ServicenowField,\x20%s,\x20%s',_0x268ec0,_0xf4f2('0x14'));_0x29f5a1(_0x161b01['result'][_0xf4f2('0x13')]);}})[_0xf4f2('0x15')](function(_0x558bab){logger['error'](_0xf4f2('0x12'),_0x268ec0,_0x558bab);_0x5d89bc(_0x558bab);});});} \ No newline at end of file +var _0x7b48=['info','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','ServicenowField,\x20%s,\x20%s','request\x20sent','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0x7b48,0xc0));var _0x87b4=function(_0x1cbfe1,_0x50e351){_0x1cbfe1=_0x1cbfe1-0x0;var _0x462030=_0x7b48[_0x1cbfe1];return _0x462030;};'use strict';var _=require('lodash');var util=require(_0x87b4('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x87b4('0x1'));var fs=require('fs');var Redis=require(_0x87b4('0x2'));var db=require(_0x87b4('0x3'))['db'];var utils=require(_0x87b4('0x4'));var logger=require(_0x87b4('0x5'))('rpc');var config=require(_0x87b4('0x6'));var jayson=require(_0x87b4('0x7'));var client=jayson[_0x87b4('0x8')][_0x87b4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a39c3,_0x2a22be,_0x2f5362){return new BPromise(function(_0x3dbcdc,_0x11b9ee){return client['request'](_0x2a39c3,_0x2f5362)[_0x87b4('0xa')](function(_0x54dbe8){logger['info'](_0x87b4('0xb'),_0x2a22be,_0x87b4('0xc'));logger['debug'](_0x87b4('0xd'),_0x2a22be,_0x87b4('0xc'),JSON[_0x87b4('0xe')](_0x54dbe8));if(_0x54dbe8[_0x87b4('0xf')]){if(_0x54dbe8[_0x87b4('0xf')][_0x87b4('0x10')]===0x1f4){logger[_0x87b4('0xf')](_0x87b4('0xb'),_0x2a22be,_0x54dbe8[_0x87b4('0xf')]['message']);return _0x11b9ee(_0x54dbe8[_0x87b4('0xf')]['message']);}logger[_0x87b4('0xf')]('ServicenowField,\x20%s,\x20%s',_0x2a22be,_0x54dbe8['error'][_0x87b4('0x11')]);return _0x3dbcdc(_0x54dbe8[_0x87b4('0xf')][_0x87b4('0x11')]);}else{logger[_0x87b4('0x12')](_0x87b4('0xb'),_0x2a22be,'request\x20sent');_0x3dbcdc(_0x54dbe8[_0x87b4('0x13')][_0x87b4('0x11')]);}})[_0x87b4('0x14')](function(_0x269b46){logger[_0x87b4('0xf')](_0x87b4('0xb'),_0x2a22be,_0x269b46);_0x11b9ee(_0x269b46);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index dd98eeb..9b17b85 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 _0x888b=['addConfiguration','put','update','delete','multer','util','connect-timeout','Router','../../components/auth/service','../../config/environment','./intSugarcrmAccount.controller','get','isAuthenticated','index','show','post','/:id/configurations'];(function(_0x4180c6,_0x642cf3){var _0xe0e5aa=function(_0x37f4e8){while(--_0x37f4e8){_0x4180c6['push'](_0x4180c6['shift']());}};_0xe0e5aa(++_0x642cf3);}(_0x888b,0x1be));var _0xb888=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x888b[_0x21a9d9];return _0x46adce;};'use strict';var multer=require(_0xb888('0x0'));var util=require(_0xb888('0x1'));var path=require('path');var timeout=require(_0xb888('0x2'));var express=require('express');var router=express[_0xb888('0x3')]();var auth=require(_0xb888('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb888('0x5'));var controller=require(_0xb888('0x6'));router[_0xb888('0x7')]('/',auth[_0xb888('0x8')](),controller[_0xb888('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xb888('0xa')]);router[_0xb888('0x7')]('/:id/configurations',auth[_0xb888('0x8')](),controller['getConfigurations']);router[_0xb888('0x7')]('/:id/fields',auth[_0xb888('0x8')](),controller['getFields']);router[_0xb888('0xb')]('/',auth[_0xb888('0x8')](),controller['create']);router[_0xb888('0xb')](_0xb888('0xc'),auth[_0xb888('0x8')](),controller[_0xb888('0xd')]);router[_0xb888('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xb888('0xf')]);router[_0xb888('0x10')]('/:id',auth[_0xb888('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x1fac=['../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','addConfiguration','put','update','delete','destroy','exports','multer','path','Router','../../components/auth/service'];(function(_0x5f4dff,_0x401f67){var _0x21b774=function(_0x51c691){while(--_0x51c691){_0x5f4dff['push'](_0x5f4dff['shift']());}};_0x21b774(++_0x401f67);}(_0x1fac,0xd8));var _0xc1fa=function(_0x4d6a12,_0x5384c5){_0x4d6a12=_0x4d6a12-0x0;var _0x2c057b=_0x1fac[_0x4d6a12];return _0x2c057b;};'use strict';var multer=require(_0xc1fa('0x0'));var util=require('util');var path=require(_0xc1fa('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc1fa('0x2')]();var auth=require(_0xc1fa('0x3'));var interaction=require(_0xc1fa('0x4'));var config=require(_0xc1fa('0x5'));var controller=require(_0xc1fa('0x6'));router[_0xc1fa('0x7')]('/',auth[_0xc1fa('0x8')](),controller[_0xc1fa('0x9')]);router['get'](_0xc1fa('0xa'),auth['isAuthenticated'](),controller[_0xc1fa('0xb')]);router[_0xc1fa('0x7')](_0xc1fa('0xc'),auth[_0xc1fa('0x8')](),controller[_0xc1fa('0xd')]);router[_0xc1fa('0x7')](_0xc1fa('0xe'),auth[_0xc1fa('0x8')](),controller[_0xc1fa('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xc1fa('0xc'),auth[_0xc1fa('0x8')](),controller[_0xc1fa('0x10')]);router[_0xc1fa('0x11')]('/:id',auth[_0xc1fa('0x8')](),controller[_0xc1fa('0x12')]);router[_0xc1fa('0x13')](_0xc1fa('0xa'),auth[_0xc1fa('0x8')](),controller[_0xc1fa('0x14')]);module[_0xc1fa('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 683acad..4a82ec4 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 _0x323a=['exports','STRING','username','remoteUri'];(function(_0x313c96,_0x3cee6e){var _0x522f53=function(_0x8961e){while(--_0x8961e){_0x313c96['push'](_0x313c96['shift']());}};_0x522f53(++_0x3cee6e);}(_0x323a,0x68));var _0xa323=function(_0x5acb94,_0x389dbc){_0x5acb94=_0x5acb94-0x0;var _0x11800a=_0x323a[_0x5acb94];return _0x11800a;};'use strict';var Sequelize=require('sequelize');module[_0xa323('0x0')]={'name':{'type':Sequelize[_0xa323('0x1')]},'description':{'type':Sequelize[_0xa323('0x1')]},'username':{'type':Sequelize[_0xa323('0x1')],'unique':_0xa323('0x2')},'password':{'type':Sequelize[_0xa323('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xa323('0x3')},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa03b=['sequelize','exports','STRING','username'];(function(_0x3cf613,_0xdcbc1e){var _0x4a3cdb=function(_0x790cb1){while(--_0x790cb1){_0x3cf613['push'](_0x3cf613['shift']());}};_0x4a3cdb(++_0xdcbc1e);}(_0xa03b,0x8c));var _0xba03=function(_0x2c27ed,_0x5c50f0){_0x2c27ed=_0x2c27ed-0x0;var _0x597bd1=_0xa03b[_0x2c27ed];return _0x597bd1;};'use strict';var Sequelize=require(_0xba03('0x0'));module[_0xba03('0x1')]={'name':{'type':Sequelize[_0xba03('0x2')]},'description':{'type':Sequelize[_0xba03('0x2')]},'username':{'type':Sequelize[_0xba03('0x2')],'unique':_0xba03('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xba03('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index 52887f0..c0d114e 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 _0xe615=['substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','JSON','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','stringify','Calls','values','module_fields','includes','label','value','statusCode','send','Wrong\x20credentials','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','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~!@#$%^&-_=+[{]}.','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','update','destroy','stack','name','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','options','SugarcrmAccount','count','includeAll','include','rows','show','length','merge','create','body','find','params','getConfigurations','SugarcrmConfiguration','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','getDescriptions','SugarcrmField','getFields','assigned_user_id','description','date_start','duration_hours','duration_minutes','parent_type','direction','username','password','remoteUri'];(function(_0x262946,_0x407a7b){var _0x140c8a=function(_0xdefa80){while(--_0xdefa80){_0x262946['push'](_0x262946['shift']());}};_0x140c8a(++_0x407a7b);}(_0xe615,0x11a));var _0x5e61=function(_0x4d4046,_0x195cf8){_0x4d4046=_0x4d4046-0x0;var _0x82d2b1=_0xe615[_0x4d4046];return _0x82d2b1;};'use strict';var pdf=require(_0x5e61('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5e61('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5e61('0x2'));var rp=require(_0x5e61('0x3'));var moment=require(_0x5e61('0x4'));var BPromise=require(_0x5e61('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x5e61('0x6'));var csv=require(_0x5e61('0x7'));var ejs=require(_0x5e61('0x8'));var fs=require('fs');var _=require(_0x5e61('0x9'));var squel=require(_0x5e61('0xa'));var crypto=require(_0x5e61('0xb'));var jsforce=require(_0x5e61('0xc'));var deskjs=require(_0x5e61('0xd'));var toCsv=require('to-csv');var querystring=require(_0x5e61('0xe'));var Papa=require(_0x5e61('0xf'));var Redis=require(_0x5e61('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5e61('0x11'));var as=require(_0x5e61('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5e61('0x13'))(_0x5e61('0x14'));var utils=require('../../config/utils');var config=require(_0x5e61('0x15'));var db=require(_0x5e61('0x16'))['db'];var integrations=require(_0x5e61('0x17'));var jayson=require(_0x5e61('0x18'));var client=jayson[_0x5e61('0x19')][_0x5e61('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x5665f6,_0x21dbb0,_0x5193ee){if(_0x5193ee){var _0x76acd5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x76acd5[_0x5e61('0x1b')](_0x21dbb0)){return _0x5665f6;}else{throw new db['Sequelize'][(_0x5e61('0x1c'))](_0x5e61('0x1d'));}}else{return _0x5665f6;}}function respondWithRpcPromise(_0x1068b7,_0x3c3a39,_0x425b9b,_0xd4d80d){return new BPromise(function(_0x49bb6b,_0x3f2f4d){var _0x3698e7=_0xd4d80d||client;return _0x3698e7[_0x5e61('0x1e')](_0x1068b7,_0x425b9b)[_0x5e61('0x1f')](function(_0x2ae17e){logger[_0x5e61('0x20')](_0x5e61('0x21'),_0x3c3a39,_0x5e61('0x22'));logger[_0x5e61('0x23')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x3c3a39,_0x5e61('0x22'),JSON['stringify'](_0x2ae17e));if(_0x2ae17e[_0x5e61('0x24')]){if(_0x2ae17e[_0x5e61('0x24')][_0x5e61('0x25')]===0x1f4){logger[_0x5e61('0x24')](_0x5e61('0x21'),_0x3c3a39,_0x2ae17e[_0x5e61('0x24')][_0x5e61('0x26')]);return _0x3f2f4d(_0x2ae17e[_0x5e61('0x24')]['message']);}logger[_0x5e61('0x24')]('SugarcrmAccount,\x20%s,\x20%s',_0x3c3a39,_0x2ae17e[_0x5e61('0x24')][_0x5e61('0x26')]);return _0x49bb6b(_0x2ae17e[_0x5e61('0x24')]['message']);}else{logger[_0x5e61('0x20')](_0x5e61('0x21'),_0x3c3a39,_0x5e61('0x22'));_0x49bb6b(_0x2ae17e['result']['message']);}})[_0x5e61('0x27')](function(_0x525c1d){logger[_0x5e61('0x24')]('SugarcrmAccount,\x20%s,\x20%s',_0x3c3a39,_0x525c1d);_0x3f2f4d(_0x525c1d);});});}function respondWithStatusCode(_0x40f37f,_0x76313b){_0x76313b=_0x76313b||0xcc;return function(_0x29236e){if(_0x29236e){return _0x40f37f[_0x5e61('0x28')](_0x76313b);}return _0x40f37f[_0x5e61('0x29')](_0x76313b)[_0x5e61('0x2a')]();};}function respondWithResult(_0x2b4220,_0x1507dc){_0x1507dc=_0x1507dc||0xc8;return function(_0x5825b0){if(_0x5825b0){return _0x2b4220['status'](_0x1507dc)[_0x5e61('0x2b')](_0x5825b0);}};}function respondWithFilteredResult(_0x434a74,_0x27c312){return function(_0x48dfa1){if(_0x48dfa1){var _0x22fca1=_0x48dfa1['count'],_0x15ba33=_0x27c312[_0x5e61('0x2c')],_0x21aed6=_0x27c312[_0x5e61('0x2c')]+_0x27c312[_0x5e61('0x2d')],_0x2c5f09;if(_0x21aed6>=_0x22fca1){_0x21aed6=_0x22fca1;_0x2c5f09=0xc8;}else{_0x2c5f09=0xce;}_0x434a74[_0x5e61('0x29')](_0x2c5f09);return _0x434a74[_0x5e61('0x2e')](_0x5e61('0x2f'),_0x15ba33+'-'+_0x21aed6+'/'+_0x22fca1)[_0x5e61('0x2b')](_0x48dfa1);}return null;};}function patchUpdates(_0x2b4f54){return function(_0x4e94f9){try{jsonpatch[_0x5e61('0x30')](_0x4e94f9,_0x2b4f54,!![]);}catch(_0x2409d9){return BPromise[_0x5e61('0x31')](_0x2409d9);}return _0x4e94f9['save']();};}function saveUpdates(_0x4eaa97,_0x3919c0){return function(_0x3de632){if(_0x3de632){return _0x3de632[_0x5e61('0x32')](_0x4eaa97)['then'](function(_0x442a1a){return _0x442a1a;});}return null;};}function removeEntity(_0xe6056a,_0x6d6d1b){return function(_0x50c98d){if(_0x50c98d){return _0x50c98d[_0x5e61('0x33')]()[_0x5e61('0x1f')](function(){_0xe6056a[_0x5e61('0x29')](0xcc)[_0x5e61('0x2a')]();});}};}function handleEntityNotFound(_0x23f8ea,_0x1bbb6c){return function(_0x3d0f75){if(!_0x3d0f75){_0x23f8ea['sendStatus'](0x194);}return _0x3d0f75;};}function handleError(_0xe3e94b,_0x15fa42){_0x15fa42=_0x15fa42||0x1f4;return function(_0x24e705){logger[_0x5e61('0x24')](_0x24e705[_0x5e61('0x34')]);if(_0x24e705[_0x5e61('0x35')]){delete _0x24e705['name'];}_0xe3e94b['status'](_0x15fa42)['send'](_0x24e705);};}exports['index']=function(_0x5d32de,_0x5bc300){var _0x3290c1={},_0xed8063={},_0x41cdff={'count':0x0,'rows':[]};var _0x2baa46=_[_0x5e61('0x36')](db['SugarcrmAccount'][_0x5e61('0x37')],function(_0x1033bd){return{'name':_0x1033bd[_0x5e61('0x38')],'type':_0x1033bd[_0x5e61('0x39')][_0x5e61('0x3a')]};});_0xed8063[_0x5e61('0x3b')]=_[_0x5e61('0x36')](_0x2baa46,_0x5e61('0x35'));_0xed8063['query']=_[_0x5e61('0x3c')](_0x5d32de[_0x5e61('0x3d')]);_0xed8063[_0x5e61('0x3e')]=_[_0x5e61('0x3f')](_0xed8063['model'],_0xed8063[_0x5e61('0x3d')]);_0x3290c1['attributes']=_[_0x5e61('0x3f')](_0xed8063[_0x5e61('0x3b')],qs[_0x5e61('0x40')](_0x5d32de[_0x5e61('0x3d')][_0x5e61('0x40')]));_0x3290c1[_0x5e61('0x41')]=_0x3290c1[_0x5e61('0x41')]['length']?_0x3290c1[_0x5e61('0x41')]:_0xed8063[_0x5e61('0x3b')];if(!_0x5d32de[_0x5e61('0x3d')][_0x5e61('0x42')](_0x5e61('0x43'))){_0x3290c1[_0x5e61('0x2d')]=qs[_0x5e61('0x2d')](_0x5d32de[_0x5e61('0x3d')]['limit']);_0x3290c1[_0x5e61('0x2c')]=qs[_0x5e61('0x2c')](_0x5d32de[_0x5e61('0x3d')][_0x5e61('0x2c')]);}_0x3290c1[_0x5e61('0x44')]=qs['sort'](_0x5d32de['query'][_0x5e61('0x45')]);_0x3290c1[_0x5e61('0x46')]=qs['filters'](_[_0x5e61('0x47')](_0x5d32de['query'],_0xed8063[_0x5e61('0x3e')]));if(_0x5d32de[_0x5e61('0x3d')]['filter']){_0x3290c1[_0x5e61('0x46')]=_['merge'](_0x3290c1[_0x5e61('0x46')],{'$or':_[_0x5e61('0x36')](_0x2baa46,function(_0x39d9fc){if(_0x39d9fc[_0x5e61('0x39')]!==_0x5e61('0x48')){var _0x128950={};_0x128950[_0x39d9fc[_0x5e61('0x35')]]={'$like':'%'+_0x5d32de[_0x5e61('0x3d')][_0x5e61('0x49')]+'%'};return _0x128950;}})});}_0x3290c1=_['merge']({},_0x3290c1,_0x5d32de[_0x5e61('0x4a')]);var _0x2fbcf8={'where':_0x3290c1[_0x5e61('0x46')]};return db[_0x5e61('0x4b')][_0x5e61('0x4c')](_0x2fbcf8)[_0x5e61('0x1f')](function(_0x542b41){_0x41cdff[_0x5e61('0x4c')]=_0x542b41;if(_0x5d32de[_0x5e61('0x3d')][_0x5e61('0x4d')]){_0x3290c1[_0x5e61('0x4e')]=[{'all':!![]}];}return db[_0x5e61('0x4b')]['findAll'](_0x3290c1);})[_0x5e61('0x1f')](function(_0x493bec){_0x41cdff[_0x5e61('0x4f')]=_0x493bec;return _0x41cdff;})[_0x5e61('0x1f')](respondWithFilteredResult(_0x5bc300,_0x3290c1))[_0x5e61('0x27')](handleError(_0x5bc300,null));};exports[_0x5e61('0x50')]=function(_0x428263,_0x969724){var _0x5d9639={'raw':![],'where':{'id':_0x428263['params']['id']}},_0x409384={};_0x409384['model']=_[_0x5e61('0x3c')](db['SugarcrmAccount'][_0x5e61('0x37')]);_0x409384[_0x5e61('0x3d')]=_[_0x5e61('0x3c')](_0x428263[_0x5e61('0x3d')]);_0x409384[_0x5e61('0x3e')]=_[_0x5e61('0x3f')](_0x409384['model'],_0x409384[_0x5e61('0x3d')]);_0x5d9639[_0x5e61('0x41')]=_['intersection'](_0x409384[_0x5e61('0x3b')],qs[_0x5e61('0x40')](_0x428263['query'][_0x5e61('0x40')]));_0x5d9639[_0x5e61('0x41')]=_0x5d9639[_0x5e61('0x41')][_0x5e61('0x51')]?_0x5d9639[_0x5e61('0x41')]:_0x409384[_0x5e61('0x3b')];if(_0x428263['query'][_0x5e61('0x4d')]){_0x5d9639['include']=[{'all':!![]}];}_0x5d9639=_[_0x5e61('0x52')]({},_0x5d9639,_0x428263[_0x5e61('0x4a')]);return db[_0x5e61('0x4b')]['find'](_0x5d9639)[_0x5e61('0x1f')](handleEntityNotFound(_0x969724,null))[_0x5e61('0x1f')](respondWithResult(_0x969724,null))['catch'](handleError(_0x969724,null));};exports[_0x5e61('0x53')]=function(_0x250998,_0x5054fb){return db[_0x5e61('0x4b')][_0x5e61('0x53')](_0x250998['body'],{})[_0x5e61('0x1f')](respondWithResult(_0x5054fb,0xc9))[_0x5e61('0x27')](handleError(_0x5054fb,null));};exports[_0x5e61('0x32')]=function(_0x251431,_0x5ca265){if(_0x251431['body']['id']){delete _0x251431[_0x5e61('0x54')]['id'];}return db[_0x5e61('0x4b')][_0x5e61('0x55')]({'where':{'id':_0x251431[_0x5e61('0x56')]['id']}})[_0x5e61('0x1f')](handleEntityNotFound(_0x5ca265,null))['then'](saveUpdates(_0x251431['body'],null))[_0x5e61('0x1f')](respondWithResult(_0x5ca265,null))[_0x5e61('0x27')](handleError(_0x5ca265,null));};exports[_0x5e61('0x33')]=function(_0x182b9a,_0x34decd){return db[_0x5e61('0x4b')]['find']({'where':{'id':_0x182b9a[_0x5e61('0x56')]['id']}})['then'](handleEntityNotFound(_0x34decd,null))[_0x5e61('0x1f')](removeEntity(_0x34decd,null))[_0x5e61('0x27')](handleError(_0x34decd,null));};exports[_0x5e61('0x57')]=function(_0x125d2e,_0x26cda4,_0x1415a4){var _0x23d313={};var _0x4c1155={};var _0x29aadd;var _0x160a0c;return db[_0x5e61('0x4b')]['findOne']({'where':{'id':_0x125d2e[_0x5e61('0x56')]['id']}})['then'](handleEntityNotFound(_0x26cda4,null))[_0x5e61('0x1f')](function(_0x5e5499){if(_0x5e5499){_0x29aadd=_0x5e5499;_0x4c1155['model']=_[_0x5e61('0x3c')](db[_0x5e61('0x58')][_0x5e61('0x37')]);_0x4c1155[_0x5e61('0x3d')]=_[_0x5e61('0x3c')](_0x125d2e[_0x5e61('0x3d')]);_0x4c1155['filters']=_[_0x5e61('0x3f')](_0x4c1155[_0x5e61('0x3b')],_0x4c1155[_0x5e61('0x3d')]);_0x23d313[_0x5e61('0x41')]=_[_0x5e61('0x3f')](_0x4c1155['model'],qs[_0x5e61('0x40')](_0x125d2e[_0x5e61('0x3d')][_0x5e61('0x40')]));_0x23d313[_0x5e61('0x41')]=_0x23d313['attributes']['length']?_0x23d313[_0x5e61('0x41')]:_0x4c1155[_0x5e61('0x3b')];_0x23d313[_0x5e61('0x44')]=qs[_0x5e61('0x45')](_0x125d2e[_0x5e61('0x3d')][_0x5e61('0x45')]);_0x23d313[_0x5e61('0x46')]=qs[_0x5e61('0x3e')](_[_0x5e61('0x47')](_0x125d2e['query'],_0x4c1155['filters']));if(_0x125d2e[_0x5e61('0x3d')][_0x5e61('0x49')]){_0x23d313[_0x5e61('0x46')]=_[_0x5e61('0x52')](_0x23d313[_0x5e61('0x46')],{'$or':_[_0x5e61('0x36')](_0x23d313[_0x5e61('0x41')],function(_0x4d9d9b){var _0x111167={};_0x111167[_0x4d9d9b]={'$like':'%'+_0x125d2e[_0x5e61('0x3d')][_0x5e61('0x49')]+'%'};return _0x111167;})});}_0x23d313=_[_0x5e61('0x52')]({},_0x23d313,_0x125d2e['options']);return _0x29aadd[_0x5e61('0x57')](_0x23d313);}})[_0x5e61('0x1f')](function(_0x57153e){if(_0x57153e){_0x160a0c=_0x57153e[_0x5e61('0x51')];if(!_0x125d2e[_0x5e61('0x3d')][_0x5e61('0x42')](_0x5e61('0x43'))){_0x23d313[_0x5e61('0x2d')]=qs[_0x5e61('0x2d')](_0x125d2e[_0x5e61('0x3d')][_0x5e61('0x2d')]);_0x23d313[_0x5e61('0x2c')]=qs[_0x5e61('0x2c')](_0x125d2e[_0x5e61('0x3d')][_0x5e61('0x2c')]);}return _0x29aadd[_0x5e61('0x57')](_0x23d313);}})[_0x5e61('0x1f')](function(_0x573289){if(_0x573289){return _0x573289?{'count':_0x160a0c,'rows':_0x573289}:null;}})[_0x5e61('0x1f')](respondWithResult(_0x26cda4,null))[_0x5e61('0x27')](handleError(_0x26cda4,null));};exports[_0x5e61('0x59')]=function(_0x211e90,_0x547db6,_0x14adf2){if(_0x211e90['body']['id']){delete _0x211e90[_0x5e61('0x54')]['id'];}return db[_0x5e61('0x4b')][_0x5e61('0x5a')]({'where':{'id':_0x211e90[_0x5e61('0x56')]['id']}})[_0x5e61('0x1f')](handleEntityNotFound(_0x547db6,null))[_0x5e61('0x1f')](function(_0x4ec48f){if(_0x4ec48f){_0x211e90[_0x5e61('0x54')][_0x5e61('0x5b')]=_0x4ec48f['id'];_0x211e90[_0x5e61('0x54')][_0x5e61('0x5c')]=integrations[_0x5e61('0x5d')](_0x211e90[_0x5e61('0x54')][_0x5e61('0x5e')],_0x211e90[_0x5e61('0x54')]['type']);_0x211e90[_0x5e61('0x54')]['Descriptions']=integrations[_0x5e61('0x5f')](_0x211e90['body'][_0x5e61('0x5e')],_0x211e90[_0x5e61('0x54')][_0x5e61('0x39')]);return db[_0x5e61('0x58')][_0x5e61('0x53')](_0x211e90[_0x5e61('0x54')],{'include':[{'model':db[_0x5e61('0x60')],'as':_0x5e61('0x5c')},{'model':db['SugarcrmField'],'as':'Descriptions'}]});}return null;})[_0x5e61('0x1f')](respondWithResult(_0x547db6,null))[_0x5e61('0x27')](handleError(_0x547db6,null));};exports[_0x5e61('0x61')]=function(_0x10ff5b,_0x1a98d5,_0x4cb4a9){var _0x3a4444='';var _0xac815e=['id','name',_0x5e61('0x62'),'created_by',_0x5e61('0x63'),_0x5e61('0x64'),_0x5e61('0x65'),_0x5e61('0x66'),'parent_id',_0x5e61('0x67'),'parent_name',_0x5e61('0x68')];return db[_0x5e61('0x4b')][_0x5e61('0x5a')]({'where':{'id':_0x10ff5b[_0x5e61('0x56')]['id']},'attributes':['id',_0x5e61('0x69'),_0x5e61('0x6a'),_0x5e61('0x6b')]})[_0x5e61('0x1f')](handleEntityNotFound(_0x1a98d5,null))[_0x5e61('0x1f')](function(_0x1af634){if(_0x1af634){_0x3a4444=_0x1af634[_0x5e61('0x6b')];var _0x37459a=_0x3a4444['slice'](-0x1);if(_0x37459a==='/'){_0x3a4444=_0x3a4444[_0x5e61('0x6c')](0x0,_0x3a4444[_0x5e61('0x6d')](_0x37459a));}return rp({'method':_0x5e61('0x6e'),'uri':util[_0x5e61('0x6f')](_0x5e61('0x70'),_0x3a4444,_0x5e61('0x71')),'json':!![],'form':{'method':'login','input_type':_0x5e61('0x72'),'response_type':'JSON','rest_data':JSON['stringify']({'user_auth':{'user_name':_0x1af634[_0x5e61('0x69')],'password':_0x1af634[_0x5e61('0x6a')],'encryption':_0x5e61('0x73')},'application':_0x5e61('0x74')})}});}})[_0x5e61('0x1f')](function(_0x4be2db){if(_0x4be2db&&_0x4be2db[_0x5e61('0x35')]!==_0x5e61('0x75')&&_0x4be2db[_0x5e61('0x35')]!==_0x5e61('0x76')){return rp({'method':_0x5e61('0x6e'),'uri':util['format'](_0x5e61('0x70'),_0x3a4444,_0x5e61('0x71')),'json':!![],'form':{'method':_0x5e61('0x77'),'input_type':'JSON','response_type':_0x5e61('0x72'),'rest_data':JSON[_0x5e61('0x78')]({'session':_0x4be2db['id'],'module_name':_0x5e61('0x79')})}})[_0x5e61('0x1f')](function(_0x276b56){if(_0x276b56){var _0x55c676=_[_0x5e61('0x7a')](_0x276b56[_0x5e61('0x7b')]);_['remove'](_0x55c676,function(_0x1beb08){return _0xac815e[_0x5e61('0x7c')](_0x1beb08[_0x5e61('0x35')]);});return{'count':_0x55c676['length'],'rows':_[_0x5e61('0x36')](_0x55c676,function(_0x253432){return{'id':_0x253432[_0x5e61('0x35')],'name':_0x253432[_0x5e61('0x7d')],'custom':_['endsWith'](_0x253432['name'],'_c')?!![]:![],'options':_0x253432[_0x5e61('0x4a')]?_[_0x5e61('0x36')](_['values'](_0x253432['options']),function(_0xbdf09a){return{'name':_0xbdf09a[_0x5e61('0x7e')],'value':_0xbdf09a['name']};}):[]};})};}})['then'](respondWithResult(_0x1a98d5,null))['catch'](function(_0x4032df){var _0x34ba6d=_0x10ff5b[_0x5e61('0x3d')][_0x5e61('0x1b')]?0x1f4:_0x4032df[_0x5e61('0x7f')]||0x1f4;logger[_0x5e61('0x24')]('getFields,\x20%s,\x20%s,\x20%s',_0x5e61('0x61'),_0x34ba6d,JSON[_0x5e61('0x78')](_0x4032df));delete _0x4032df['name'];if(_0x34ba6d===0x191){_0x34ba6d=0x190;}_0x1a98d5[_0x5e61('0x29')](_0x34ba6d)[_0x5e61('0x80')](_0x10ff5b[_0x5e61('0x3d')][_0x5e61('0x1b')]?{'message':_0x5e61('0x81'),'statusCode':_0x4032df[_0x5e61('0x7f')]}:_0x4032df);});}else{var _0xded015=0x1f4;_0x1a98d5[_0x5e61('0x29')](_0xded015)[_0x5e61('0x80')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file +var _0xff5f=['request','then','info','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','SugarcrmAccount,\x20%s,\x20%s','message','result','sendStatus','status','json','count','offset','limit','Content-Range','update','end','name','send','index','map','SugarcrmAccount','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','rows','show','params','length','includeAll','include','find','catch','create','body','destroy','findOne','pick','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','SugarcrmConfiguration','SugarcrmField','Descriptions','getFields','assigned_user_id','created_by','date_start','duration_hours','parent_id','parent_type','parent_name','username','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','values','module_fields','remove','includes','label','endsWith','value','test','Wrong\x20credentials','statusCode','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.'];(function(_0x3f2d35,_0x36db80){var _0x572caa=function(_0x47ff73){while(--_0x47ff73){_0x3f2d35['push'](_0x3f2d35['shift']());}};_0x572caa(++_0x36db80);}(_0xff5f,0x169));var _0xfff5=function(_0x19190b,_0x3857cc){_0x19190b=_0x19190b-0x0;var _0x426373=_0xff5f[_0x19190b];return _0x426373;};'use strict';var pdf=require(_0xfff5('0x0'));var emlformat=require(_0xfff5('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xfff5('0x2'));var jsonpatch=require(_0xfff5('0x3'));var rp=require(_0xfff5('0x4'));var moment=require(_0xfff5('0x5'));var BPromise=require(_0xfff5('0x6'));var Mustache=require(_0xfff5('0x7'));var util=require(_0xfff5('0x8'));var path=require(_0xfff5('0x9'));var sox=require(_0xfff5('0xa'));var csv=require(_0xfff5('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xfff5('0xc'));var squel=require(_0xfff5('0xd'));var crypto=require(_0xfff5('0xe'));var jsforce=require(_0xfff5('0xf'));var deskjs=require(_0xfff5('0x10'));var toCsv=require(_0xfff5('0xb'));var querystring=require(_0xfff5('0x11'));var Papa=require(_0xfff5('0x12'));var Redis=require('ioredis');var authService=require(_0xfff5('0x13'));var qs=require(_0xfff5('0x14'));var as=require(_0xfff5('0x15'));var hardwareService=require(_0xfff5('0x16'));var logger=require(_0xfff5('0x17'))('api');var utils=require(_0xfff5('0x18'));var config=require(_0xfff5('0x19'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xfff5('0x1a'));var client=jayson[_0xfff5('0x1b')][_0xfff5('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x5e58bd,_0x591e88,_0x50e432){if(_0x50e432){var _0x494559=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x494559['test'](_0x591e88)){return _0x5e58bd;}else{throw new db[(_0xfff5('0x1d'))][(_0xfff5('0x1e'))](_0xfff5('0x1f'));}}else{return _0x5e58bd;}}function respondWithRpcPromise(_0x471c0a,_0x15d1f2,_0x538dc4,_0x5888bd){return new BPromise(function(_0x3894d7,_0x26826e){var _0x38b0bc=_0x5888bd||client;return _0x38b0bc[_0xfff5('0x20')](_0x471c0a,_0x538dc4)[_0xfff5('0x21')](function(_0x6ae1ed){logger[_0xfff5('0x22')]('SugarcrmAccount,\x20%s,\x20%s',_0x15d1f2,_0xfff5('0x23'));logger['debug'](_0xfff5('0x24'),_0x15d1f2,_0xfff5('0x23'),JSON[_0xfff5('0x25')](_0x6ae1ed));if(_0x6ae1ed[_0xfff5('0x26')]){if(_0x6ae1ed[_0xfff5('0x26')]['code']===0x1f4){logger[_0xfff5('0x26')](_0xfff5('0x27'),_0x15d1f2,_0x6ae1ed[_0xfff5('0x26')][_0xfff5('0x28')]);return _0x26826e(_0x6ae1ed[_0xfff5('0x26')][_0xfff5('0x28')]);}logger[_0xfff5('0x26')]('SugarcrmAccount,\x20%s,\x20%s',_0x15d1f2,_0x6ae1ed['error'][_0xfff5('0x28')]);return _0x3894d7(_0x6ae1ed[_0xfff5('0x26')][_0xfff5('0x28')]);}else{logger[_0xfff5('0x22')](_0xfff5('0x27'),_0x15d1f2,'request\x20sent');_0x3894d7(_0x6ae1ed[_0xfff5('0x29')]['message']);}})['catch'](function(_0x557b8c){logger[_0xfff5('0x26')](_0xfff5('0x27'),_0x15d1f2,_0x557b8c);_0x26826e(_0x557b8c);});});}function respondWithStatusCode(_0x512c4e,_0x13d6b6){_0x13d6b6=_0x13d6b6||0xcc;return function(_0xac76fc){if(_0xac76fc){return _0x512c4e[_0xfff5('0x2a')](_0x13d6b6);}return _0x512c4e[_0xfff5('0x2b')](_0x13d6b6)['end']();};}function respondWithResult(_0x1a1eef,_0x242829){_0x242829=_0x242829||0xc8;return function(_0x33080e){if(_0x33080e){return _0x1a1eef[_0xfff5('0x2b')](_0x242829)[_0xfff5('0x2c')](_0x33080e);}};}function respondWithFilteredResult(_0x5a9810,_0x24d037){return function(_0x1b90a9){if(_0x1b90a9){var _0x2f95c5=_0x1b90a9[_0xfff5('0x2d')],_0x46f6eb=_0x24d037[_0xfff5('0x2e')],_0x29d9ec=_0x24d037[_0xfff5('0x2e')]+_0x24d037[_0xfff5('0x2f')],_0x2fd1e1;if(_0x29d9ec>=_0x2f95c5){_0x29d9ec=_0x2f95c5;_0x2fd1e1=0xc8;}else{_0x2fd1e1=0xce;}_0x5a9810[_0xfff5('0x2b')](_0x2fd1e1);return _0x5a9810['set'](_0xfff5('0x30'),_0x46f6eb+'-'+_0x29d9ec+'/'+_0x2f95c5)[_0xfff5('0x2c')](_0x1b90a9);}return null;};}function patchUpdates(_0x406034){return function(_0xc641d7){try{jsonpatch['apply'](_0xc641d7,_0x406034,!![]);}catch(_0x43b828){return BPromise['reject'](_0x43b828);}return _0xc641d7['save']();};}function saveUpdates(_0x33e5b4,_0x38e0a3){return function(_0xe76029){if(_0xe76029){return _0xe76029[_0xfff5('0x31')](_0x33e5b4)[_0xfff5('0x21')](function(_0xd52064){return _0xd52064;});}return null;};}function removeEntity(_0x5686dd,_0x5771c9){return function(_0x2780f1){if(_0x2780f1){return _0x2780f1['destroy']()[_0xfff5('0x21')](function(){_0x5686dd['status'](0xcc)[_0xfff5('0x32')]();});}};}function handleEntityNotFound(_0x416c3b,_0x4ce340){return function(_0x337e94){if(!_0x337e94){_0x416c3b[_0xfff5('0x2a')](0x194);}return _0x337e94;};}function handleError(_0x24d012,_0x14fef2){_0x14fef2=_0x14fef2||0x1f4;return function(_0x9f72a3){logger[_0xfff5('0x26')](_0x9f72a3['stack']);if(_0x9f72a3['name']){delete _0x9f72a3[_0xfff5('0x33')];}_0x24d012[_0xfff5('0x2b')](_0x14fef2)[_0xfff5('0x34')](_0x9f72a3);};}exports[_0xfff5('0x35')]=function(_0x28d03f,_0x38e2a7){var _0x1d51b8={},_0x30cfcd={},_0xc62b60={'count':0x0,'rows':[]};var _0x2d24c5=_[_0xfff5('0x36')](db[_0xfff5('0x37')][_0xfff5('0x38')],function(_0x1d7967){return{'name':_0x1d7967[_0xfff5('0x39')],'type':_0x1d7967[_0xfff5('0x3a')][_0xfff5('0x3b')]};});_0x30cfcd[_0xfff5('0x3c')]=_[_0xfff5('0x36')](_0x2d24c5,_0xfff5('0x33'));_0x30cfcd[_0xfff5('0x3d')]=_[_0xfff5('0x3e')](_0x28d03f[_0xfff5('0x3d')]);_0x30cfcd['filters']=_['intersection'](_0x30cfcd[_0xfff5('0x3c')],_0x30cfcd['query']);_0x1d51b8[_0xfff5('0x3f')]=_[_0xfff5('0x40')](_0x30cfcd[_0xfff5('0x3c')],qs[_0xfff5('0x41')](_0x28d03f[_0xfff5('0x3d')][_0xfff5('0x41')]));_0x1d51b8[_0xfff5('0x3f')]=_0x1d51b8[_0xfff5('0x3f')]['length']?_0x1d51b8[_0xfff5('0x3f')]:_0x30cfcd[_0xfff5('0x3c')];if(!_0x28d03f['query'][_0xfff5('0x42')](_0xfff5('0x43'))){_0x1d51b8[_0xfff5('0x2f')]=qs[_0xfff5('0x2f')](_0x28d03f[_0xfff5('0x3d')][_0xfff5('0x2f')]);_0x1d51b8[_0xfff5('0x2e')]=qs[_0xfff5('0x2e')](_0x28d03f['query']['offset']);}_0x1d51b8[_0xfff5('0x44')]=qs[_0xfff5('0x45')](_0x28d03f[_0xfff5('0x3d')][_0xfff5('0x45')]);_0x1d51b8['where']=qs['filters'](_['pick'](_0x28d03f[_0xfff5('0x3d')],_0x30cfcd[_0xfff5('0x46')]));if(_0x28d03f['query'][_0xfff5('0x47')]){_0x1d51b8[_0xfff5('0x48')]=_[_0xfff5('0x49')](_0x1d51b8[_0xfff5('0x48')],{'$or':_[_0xfff5('0x36')](_0x2d24c5,function(_0x771ab1){if(_0x771ab1[_0xfff5('0x3a')]!==_0xfff5('0x4a')){var _0x5b7833={};_0x5b7833[_0x771ab1['name']]={'$like':'%'+_0x28d03f[_0xfff5('0x3d')][_0xfff5('0x47')]+'%'};return _0x5b7833;}})});}_0x1d51b8=_[_0xfff5('0x49')]({},_0x1d51b8,_0x28d03f[_0xfff5('0x4b')]);var _0x237419={'where':_0x1d51b8[_0xfff5('0x48')]};return db['SugarcrmAccount']['count'](_0x237419)[_0xfff5('0x21')](function(_0x51253a){_0xc62b60[_0xfff5('0x2d')]=_0x51253a;if(_0x28d03f[_0xfff5('0x3d')]['includeAll']){_0x1d51b8['include']=[{'all':!![]}];}return db[_0xfff5('0x37')]['findAll'](_0x1d51b8);})[_0xfff5('0x21')](function(_0x14407e){_0xc62b60[_0xfff5('0x4c')]=_0x14407e;return _0xc62b60;})[_0xfff5('0x21')](respondWithFilteredResult(_0x38e2a7,_0x1d51b8))['catch'](handleError(_0x38e2a7,null));};exports[_0xfff5('0x4d')]=function(_0x17fe95,_0x4fa10c){var _0x45bdf5={'raw':![],'where':{'id':_0x17fe95[_0xfff5('0x4e')]['id']}},_0x316398={};_0x316398[_0xfff5('0x3c')]=_[_0xfff5('0x3e')](db[_0xfff5('0x37')][_0xfff5('0x38')]);_0x316398[_0xfff5('0x3d')]=_[_0xfff5('0x3e')](_0x17fe95[_0xfff5('0x3d')]);_0x316398[_0xfff5('0x46')]=_['intersection'](_0x316398[_0xfff5('0x3c')],_0x316398['query']);_0x45bdf5[_0xfff5('0x3f')]=_[_0xfff5('0x40')](_0x316398[_0xfff5('0x3c')],qs[_0xfff5('0x41')](_0x17fe95[_0xfff5('0x3d')]['fields']));_0x45bdf5[_0xfff5('0x3f')]=_0x45bdf5[_0xfff5('0x3f')][_0xfff5('0x4f')]?_0x45bdf5[_0xfff5('0x3f')]:_0x316398[_0xfff5('0x3c')];if(_0x17fe95[_0xfff5('0x3d')][_0xfff5('0x50')]){_0x45bdf5[_0xfff5('0x51')]=[{'all':!![]}];}_0x45bdf5=_[_0xfff5('0x49')]({},_0x45bdf5,_0x17fe95[_0xfff5('0x4b')]);return db[_0xfff5('0x37')][_0xfff5('0x52')](_0x45bdf5)[_0xfff5('0x21')](handleEntityNotFound(_0x4fa10c,null))[_0xfff5('0x21')](respondWithResult(_0x4fa10c,null))[_0xfff5('0x53')](handleError(_0x4fa10c,null));};exports[_0xfff5('0x54')]=function(_0x2553fa,_0x52c2d){return db['SugarcrmAccount'][_0xfff5('0x54')](_0x2553fa[_0xfff5('0x55')],{})['then'](respondWithResult(_0x52c2d,0xc9))[_0xfff5('0x53')](handleError(_0x52c2d,null));};exports[_0xfff5('0x31')]=function(_0x245b87,_0x2dfac7){if(_0x245b87[_0xfff5('0x55')]['id']){delete _0x245b87['body']['id'];}return db[_0xfff5('0x37')][_0xfff5('0x52')]({'where':{'id':_0x245b87[_0xfff5('0x4e')]['id']}})[_0xfff5('0x21')](handleEntityNotFound(_0x2dfac7,null))['then'](saveUpdates(_0x245b87[_0xfff5('0x55')],null))[_0xfff5('0x21')](respondWithResult(_0x2dfac7,null))[_0xfff5('0x53')](handleError(_0x2dfac7,null));};exports[_0xfff5('0x56')]=function(_0x39f458,_0x9e9a65){return db[_0xfff5('0x37')]['find']({'where':{'id':_0x39f458[_0xfff5('0x4e')]['id']}})[_0xfff5('0x21')](handleEntityNotFound(_0x9e9a65,null))[_0xfff5('0x21')](removeEntity(_0x9e9a65,null))['catch'](handleError(_0x9e9a65,null));};exports['getConfigurations']=function(_0x1041a4,_0x3e72ac,_0x44cae0){var _0x4521e3={};var _0x198311={};var _0x4e7adb;var _0x375c7e;return db[_0xfff5('0x37')][_0xfff5('0x57')]({'where':{'id':_0x1041a4[_0xfff5('0x4e')]['id']}})[_0xfff5('0x21')](handleEntityNotFound(_0x3e72ac,null))['then'](function(_0x118ccf){if(_0x118ccf){_0x4e7adb=_0x118ccf;_0x198311[_0xfff5('0x3c')]=_[_0xfff5('0x3e')](db['SugarcrmConfiguration'][_0xfff5('0x38')]);_0x198311[_0xfff5('0x3d')]=_['keys'](_0x1041a4[_0xfff5('0x3d')]);_0x198311['filters']=_[_0xfff5('0x40')](_0x198311[_0xfff5('0x3c')],_0x198311[_0xfff5('0x3d')]);_0x4521e3[_0xfff5('0x3f')]=_[_0xfff5('0x40')](_0x198311[_0xfff5('0x3c')],qs['fields'](_0x1041a4[_0xfff5('0x3d')]['fields']));_0x4521e3['attributes']=_0x4521e3['attributes']['length']?_0x4521e3[_0xfff5('0x3f')]:_0x198311['model'];_0x4521e3[_0xfff5('0x44')]=qs[_0xfff5('0x45')](_0x1041a4[_0xfff5('0x3d')][_0xfff5('0x45')]);_0x4521e3[_0xfff5('0x48')]=qs[_0xfff5('0x46')](_[_0xfff5('0x58')](_0x1041a4[_0xfff5('0x3d')],_0x198311[_0xfff5('0x46')]));if(_0x1041a4[_0xfff5('0x3d')]['filter']){_0x4521e3[_0xfff5('0x48')]=_[_0xfff5('0x49')](_0x4521e3['where'],{'$or':_[_0xfff5('0x36')](_0x4521e3[_0xfff5('0x3f')],function(_0x394ba4){var _0x13f781={};_0x13f781[_0x394ba4]={'$like':'%'+_0x1041a4[_0xfff5('0x3d')][_0xfff5('0x47')]+'%'};return _0x13f781;})});}_0x4521e3=_[_0xfff5('0x49')]({},_0x4521e3,_0x1041a4['options']);return _0x4e7adb[_0xfff5('0x59')](_0x4521e3);}})[_0xfff5('0x21')](function(_0x576513){if(_0x576513){_0x375c7e=_0x576513[_0xfff5('0x4f')];if(!_0x1041a4[_0xfff5('0x3d')][_0xfff5('0x42')](_0xfff5('0x43'))){_0x4521e3[_0xfff5('0x2f')]=qs['limit'](_0x1041a4[_0xfff5('0x3d')][_0xfff5('0x2f')]);_0x4521e3[_0xfff5('0x2e')]=qs[_0xfff5('0x2e')](_0x1041a4[_0xfff5('0x3d')][_0xfff5('0x2e')]);}return _0x4e7adb[_0xfff5('0x59')](_0x4521e3);}})['then'](function(_0x2dffa2){if(_0x2dffa2){return _0x2dffa2?{'count':_0x375c7e,'rows':_0x2dffa2}:null;}})[_0xfff5('0x21')](respondWithResult(_0x3e72ac,null))[_0xfff5('0x53')](handleError(_0x3e72ac,null));};exports[_0xfff5('0x5a')]=function(_0x3bd7cf,_0x4972e8,_0x219136){if(_0x3bd7cf[_0xfff5('0x55')]['id']){delete _0x3bd7cf[_0xfff5('0x55')]['id'];}return db[_0xfff5('0x37')][_0xfff5('0x57')]({'where':{'id':_0x3bd7cf[_0xfff5('0x4e')]['id']}})[_0xfff5('0x21')](handleEntityNotFound(_0x4972e8,null))['then'](function(_0x48d512){if(_0x48d512){_0x3bd7cf['body'][_0xfff5('0x5b')]=_0x48d512['id'];_0x3bd7cf[_0xfff5('0x55')][_0xfff5('0x5c')]=integrations[_0xfff5('0x5d')](_0x3bd7cf[_0xfff5('0x55')]['channel'],_0x3bd7cf['body'][_0xfff5('0x3a')]);_0x3bd7cf['body']['Descriptions']=integrations['getDescriptions'](_0x3bd7cf[_0xfff5('0x55')][_0xfff5('0x5e')],_0x3bd7cf[_0xfff5('0x55')][_0xfff5('0x3a')]);return db[_0xfff5('0x5f')]['create'](_0x3bd7cf[_0xfff5('0x55')],{'include':[{'model':db['SugarcrmField'],'as':'Subjects'},{'model':db[_0xfff5('0x60')],'as':_0xfff5('0x61')}]});}return null;})[_0xfff5('0x21')](respondWithResult(_0x4972e8,null))[_0xfff5('0x53')](handleError(_0x4972e8,null));};exports[_0xfff5('0x62')]=function(_0x3ee380,_0x4639b9,_0x159a01){var _0xb892f4='';var _0x4c2634=['id',_0xfff5('0x33'),_0xfff5('0x63'),_0xfff5('0x64'),'description',_0xfff5('0x65'),_0xfff5('0x66'),'duration_minutes',_0xfff5('0x67'),_0xfff5('0x68'),_0xfff5('0x69'),'direction'];return db[_0xfff5('0x37')][_0xfff5('0x57')]({'where':{'id':_0x3ee380[_0xfff5('0x4e')]['id']},'attributes':['id',_0xfff5('0x6a'),'password','remoteUri']})[_0xfff5('0x21')](handleEntityNotFound(_0x4639b9,null))[_0xfff5('0x21')](function(_0x2fde0e){if(_0x2fde0e){_0xb892f4=_0x2fde0e['remoteUri'];var _0x456867=_0xb892f4[_0xfff5('0x6b')](-0x1);if(_0x456867==='/'){_0xb892f4=_0xb892f4[_0xfff5('0x6c')](0x0,_0xb892f4[_0xfff5('0x6d')](_0x456867));}return rp({'method':_0xfff5('0x6e'),'uri':util[_0xfff5('0x6f')](_0xfff5('0x70'),_0xb892f4,_0xfff5('0x71')),'json':!![],'form':{'method':_0xfff5('0x72'),'input_type':_0xfff5('0x73'),'response_type':_0xfff5('0x73'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x2fde0e[_0xfff5('0x6a')],'password':_0x2fde0e['password'],'encryption':_0xfff5('0x74')},'application':_0xfff5('0x75')})}});}})[_0xfff5('0x21')](function(_0x1e6c05){if(_0x1e6c05&&_0x1e6c05[_0xfff5('0x33')]!==_0xfff5('0x76')&&_0x1e6c05['name']!==_0xfff5('0x77')){return rp({'method':_0xfff5('0x6e'),'uri':util[_0xfff5('0x6f')](_0xfff5('0x70'),_0xb892f4,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xfff5('0x78'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xfff5('0x25')]({'session':_0x1e6c05['id'],'module_name':'Calls'})}})[_0xfff5('0x21')](function(_0x37f4f1){if(_0x37f4f1){var _0x3665ea=_[_0xfff5('0x79')](_0x37f4f1[_0xfff5('0x7a')]);_[_0xfff5('0x7b')](_0x3665ea,function(_0x32956a){return _0x4c2634[_0xfff5('0x7c')](_0x32956a['name']);});return{'count':_0x3665ea['length'],'rows':_[_0xfff5('0x36')](_0x3665ea,function(_0x31daf8){return{'id':_0x31daf8[_0xfff5('0x33')],'name':_0x31daf8[_0xfff5('0x7d')],'custom':_[_0xfff5('0x7e')](_0x31daf8[_0xfff5('0x33')],'_c')?!![]:![],'options':_0x31daf8[_0xfff5('0x4b')]?_[_0xfff5('0x36')](_[_0xfff5('0x79')](_0x31daf8[_0xfff5('0x4b')]),function(_0x25d366){return{'name':_0x25d366[_0xfff5('0x7f')],'value':_0x25d366[_0xfff5('0x33')]};}):[]};})};}})['then'](respondWithResult(_0x4639b9,null))[_0xfff5('0x53')](function(_0x3deb40){var _0x3f4108=_0x3ee380[_0xfff5('0x3d')][_0xfff5('0x80')]?0x1f4:_0x3deb40['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xfff5('0x62'),_0x3f4108,JSON[_0xfff5('0x25')](_0x3deb40));delete _0x3deb40[_0xfff5('0x33')];if(_0x3f4108===0x191){_0x3f4108=0x190;}_0x4639b9['status'](_0x3f4108)['send'](_0x3ee380[_0xfff5('0x3d')][_0xfff5('0x80')]?{'message':_0xfff5('0x81'),'statusCode':_0x3deb40[_0xfff5('0x82')]}:_0x3deb40);});}else{var _0x3c0359=0x1f4;_0x4639b9[_0xfff5('0x2b')](_0x3c0359)['send']({'message':_0xfff5('0x81'),'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 c8b4ea1..7fe3f98 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 _0x0c84=['rimraf','../../config/environment','./intSugarcrmAccount.attributes','define','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x14c684,_0x22c35c){var _0x20e76b=function(_0x2251dd){while(--_0x2251dd){_0x14c684['push'](_0x14c684['shift']());}};_0x20e76b(++_0x22c35c);}(_0x0c84,0x122));var _0x40c8=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x0c84[_0x5f0089];return _0x193892;};'use strict';var _=require('lodash');var util=require(_0x40c8('0x0'));var logger=require(_0x40c8('0x1'))(_0x40c8('0x2'));var moment=require(_0x40c8('0x3'));var BPromise=require(_0x40c8('0x4'));var rp=require(_0x40c8('0x5'));var fs=require('fs');var path=require(_0x40c8('0x6'));var rimraf=require(_0x40c8('0x7'));var config=require(_0x40c8('0x8'));var attributes=require(_0x40c8('0x9'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x2ecff6,_0x4586c1){return _0x2ecff6[_0x40c8('0xa')]('SugarcrmAccount',attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e26=['SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x26308b,_0x316738){var _0x291c9c=function(_0x297c1c){while(--_0x297c1c){_0x26308b['push'](_0x26308b['shift']());}};_0x291c9c(++_0x316738);}(_0x3e26,0xaa));var _0x63e2=function(_0xe785d,_0x47f525){_0xe785d=_0xe785d-0x0;var _0x2b92cd=_0x3e26[_0xe785d];return _0x2b92cd;};'use strict';var _=require(_0x63e2('0x0'));var util=require(_0x63e2('0x1'));var logger=require(_0x63e2('0x2'))(_0x63e2('0x3'));var moment=require(_0x63e2('0x4'));var BPromise=require(_0x63e2('0x5'));var rp=require(_0x63e2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x63e2('0x7'));var attributes=require(_0x63e2('0x8'));var integrations=require(_0x63e2('0x9'));module[_0x63e2('0xa')]=function(_0x597036,_0x2e3853){return _0x597036[_0x63e2('0xb')](_0x63e2('0xc'),attributes,{'tableName':_0x63e2('0xd'),'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 e57752c..c2c7266 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 _0x0912=['error','SugarcrmAccount,\x20%s,\x20%s','message','request\x20sent','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','limit','include','map','model','stringify','find','ShowSugarcrmAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x0912,0x186));var _0x2091=function(_0x5b1835,_0x5eb626){_0x5b1835=_0x5b1835-0x0;var _0x2642e4=_0x0912[_0x5b1835];return _0x2642e4;};'use strict';var _=require(_0x2091('0x0'));var util=require(_0x2091('0x1'));var moment=require(_0x2091('0x2'));var BPromise=require(_0x2091('0x3'));var rs=require(_0x2091('0x4'));var fs=require('fs');var Redis=require(_0x2091('0x5'));var db=require(_0x2091('0x6'))['db'];var utils=require(_0x2091('0x7'));var logger=require(_0x2091('0x8'))(_0x2091('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2091('0xa')][_0x2091('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x23f700,_0xa08d07,_0xe8d50){return new BPromise(function(_0x4de357,_0x44c71c){return client[_0x2091('0xc')](_0x23f700,_0xe8d50)[_0x2091('0xd')](function(_0x2e67d3){logger[_0x2091('0xe')]('SugarcrmAccount,\x20%s,\x20%s',_0xa08d07,'request\x20sent');logger[_0x2091('0xf')](_0x2091('0x10'),_0xa08d07,'request\x20sent',JSON['stringify'](_0x2e67d3));if(_0x2e67d3[_0x2091('0x11')]){if(_0x2e67d3[_0x2091('0x11')]['code']===0x1f4){logger[_0x2091('0x11')](_0x2091('0x12'),_0xa08d07,_0x2e67d3[_0x2091('0x11')][_0x2091('0x13')]);return _0x44c71c(_0x2e67d3[_0x2091('0x11')]['message']);}logger['error'](_0x2091('0x12'),_0xa08d07,_0x2e67d3[_0x2091('0x11')]['message']);return _0x4de357(_0x2e67d3['error']['message']);}else{logger[_0x2091('0xe')](_0x2091('0x12'),_0xa08d07,_0x2091('0x14'));_0x4de357(_0x2e67d3[_0x2091('0x15')][_0x2091('0x13')]);}})[_0x2091('0x16')](function(_0x4ab7d1){logger[_0x2091('0x11')]('SugarcrmAccount,\x20%s,\x20%s',_0xa08d07,_0x4ab7d1);_0x44c71c(_0x4ab7d1);});});}exports[_0x2091('0x17')]=function(_0x5d7ee7){var _0x3991d6=this;return new Promise(function(_0x4184cb,_0x41b9c7){return db[_0x2091('0x18')][_0x2091('0x19')]({'raw':_0x5d7ee7[_0x2091('0x1a')]?_0x5d7ee7[_0x2091('0x1a')][_0x2091('0x1b')]===undefined?!![]:![]:!![],'where':_0x5d7ee7['options']?_0x5d7ee7['options'][_0x2091('0x1c')]||null:null,'attributes':_0x5d7ee7[_0x2091('0x1a')]?_0x5d7ee7[_0x2091('0x1a')][_0x2091('0x1d')]||null:null,'limit':_0x5d7ee7['options']?_0x5d7ee7[_0x2091('0x1a')][_0x2091('0x1e')]||null:null,'include':_0x5d7ee7['options']?_0x5d7ee7['options'][_0x2091('0x1f')]?_[_0x2091('0x20')](_0x5d7ee7[_0x2091('0x1a')][_0x2091('0x1f')],function(_0x38dc06){return{'model':db[_0x38dc06[_0x2091('0x21')]],'as':_0x38dc06['as'],'attributes':_0x38dc06['attributes'],'include':_0x38dc06['include']?_[_0x2091('0x20')](_0x38dc06[_0x2091('0x1f')],function(_0x34e4e5){return{'model':db[_0x34e4e5['model']],'as':_0x34e4e5['as'],'attributes':_0x34e4e5[_0x2091('0x1d')],'include':_0x34e4e5[_0x2091('0x1f')]?_[_0x2091('0x20')](_0x34e4e5[_0x2091('0x1f')],function(_0x525889){return{'model':db[_0x525889[_0x2091('0x21')]],'as':_0x525889['as'],'attributes':_0x525889[_0x2091('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x2091('0xd')](function(_0x42450d){logger[_0x2091('0xe')](_0x2091('0x17'),_0x5d7ee7);logger['debug']('GetSugarcrmAccount',_0x5d7ee7,JSON[_0x2091('0x22')](_0x42450d));_0x4184cb(_0x42450d);})[_0x2091('0x16')](function(_0x42e3bd){logger[_0x2091('0x11')](_0x2091('0x17'),_0x42e3bd[_0x2091('0x13')],_0x5d7ee7);_0x41b9c7(_0x3991d6[_0x2091('0x11')](0x1f4,_0x42e3bd[_0x2091('0x13')]));});});};exports['ShowSugarcrmAccount']=function(_0x3a90a){var _0x2c0c0f=this;return new Promise(function(_0x182e76,_0x4427dd){return db['SugarcrmAccount'][_0x2091('0x23')]({'raw':_0x3a90a[_0x2091('0x1a')]?_0x3a90a[_0x2091('0x1a')][_0x2091('0x1b')]===undefined?!![]:![]:!![],'where':_0x3a90a[_0x2091('0x1a')]?_0x3a90a[_0x2091('0x1a')]['where']||null:null,'attributes':_0x3a90a[_0x2091('0x1a')]?_0x3a90a['options'][_0x2091('0x1d')]||null:null,'include':_0x3a90a[_0x2091('0x1a')]?_0x3a90a[_0x2091('0x1a')][_0x2091('0x1f')]?_[_0x2091('0x20')](_0x3a90a[_0x2091('0x1a')]['include'],function(_0x43dc91){return{'model':db[_0x43dc91['model']],'as':_0x43dc91['as'],'attributes':_0x43dc91['attributes'],'include':_0x43dc91[_0x2091('0x1f')]?_['map'](_0x43dc91[_0x2091('0x1f')],function(_0x3e0b32){return{'model':db[_0x3e0b32[_0x2091('0x21')]],'as':_0x3e0b32['as'],'attributes':_0x3e0b32[_0x2091('0x1d')],'include':_0x3e0b32[_0x2091('0x1f')]?_['map'](_0x3e0b32[_0x2091('0x1f')],function(_0xdfbfb2){return{'model':db[_0xdfbfb2[_0x2091('0x21')]],'as':_0xdfbfb2['as'],'attributes':_0xdfbfb2['attributes']};}):[]};}):[]};}):[]:[]})[_0x2091('0xd')](function(_0x5acb42){logger[_0x2091('0xe')]('ShowSugarcrmAccount',_0x3a90a);logger[_0x2091('0xf')](_0x2091('0x24'),_0x3a90a,JSON[_0x2091('0x22')](_0x5acb42));_0x182e76(_0x5acb42);})[_0x2091('0x16')](function(_0x162aaf){logger[_0x2091('0x11')]('ShowSugarcrmAccount',_0x162aaf[_0x2091('0x13')],_0x3a90a);_0x4427dd(_0x2c0c0f['error'](0x1f4,_0x162aaf[_0x2091('0x13')]));});});}; \ No newline at end of file +var _0xb477=['model','stringify','ShowSugarcrmAccount','find','raw','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','code','SugarcrmAccount,\x20%s,\x20%s','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','where','attributes','limit','include','map'];(function(_0x46a3ff,_0x470b9a){var _0x404bc2=function(_0x20f25f){while(--_0x20f25f){_0x46a3ff['push'](_0x46a3ff['shift']());}};_0x404bc2(++_0x470b9a);}(_0xb477,0x186));var _0x7b47=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xb477[_0x565c49];return _0x20ca34;};'use strict';var _=require('lodash');var util=require(_0x7b47('0x0'));var moment=require(_0x7b47('0x1'));var BPromise=require(_0x7b47('0x2'));var rs=require(_0x7b47('0x3'));var fs=require('fs');var Redis=require(_0x7b47('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7b47('0x5'))(_0x7b47('0x6'));var config=require(_0x7b47('0x7'));var jayson=require(_0x7b47('0x8'));var client=jayson['client'][_0x7b47('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4113e7,_0x3db7f0,_0x5c9ae5){return new BPromise(function(_0x5e859e,_0x473b8e){return client['request'](_0x4113e7,_0x5c9ae5)[_0x7b47('0xa')](function(_0x50eae9){logger[_0x7b47('0xb')]('SugarcrmAccount,\x20%s,\x20%s',_0x3db7f0,_0x7b47('0xc'));logger[_0x7b47('0xd')](_0x7b47('0xe'),_0x3db7f0,_0x7b47('0xc'),JSON['stringify'](_0x50eae9));if(_0x50eae9['error']){if(_0x50eae9[_0x7b47('0xf')][_0x7b47('0x10')]===0x1f4){logger[_0x7b47('0xf')](_0x7b47('0x11'),_0x3db7f0,_0x50eae9[_0x7b47('0xf')][_0x7b47('0x12')]);return _0x473b8e(_0x50eae9['error'][_0x7b47('0x12')]);}logger[_0x7b47('0xf')](_0x7b47('0x11'),_0x3db7f0,_0x50eae9[_0x7b47('0xf')][_0x7b47('0x12')]);return _0x5e859e(_0x50eae9[_0x7b47('0xf')][_0x7b47('0x12')]);}else{logger[_0x7b47('0xb')](_0x7b47('0x11'),_0x3db7f0,_0x7b47('0xc'));_0x5e859e(_0x50eae9[_0x7b47('0x13')][_0x7b47('0x12')]);}})[_0x7b47('0x14')](function(_0xfffc8){logger[_0x7b47('0xf')](_0x7b47('0x11'),_0x3db7f0,_0xfffc8);_0x473b8e(_0xfffc8);});});}exports[_0x7b47('0x15')]=function(_0x523538){var _0x5276e7=this;return new Promise(function(_0x3a3a5f,_0x3ed15c){return db[_0x7b47('0x16')][_0x7b47('0x17')]({'raw':_0x523538[_0x7b47('0x18')]?_0x523538[_0x7b47('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x523538['options']?_0x523538[_0x7b47('0x18')][_0x7b47('0x19')]||null:null,'attributes':_0x523538['options']?_0x523538['options'][_0x7b47('0x1a')]||null:null,'limit':_0x523538['options']?_0x523538[_0x7b47('0x18')][_0x7b47('0x1b')]||null:null,'include':_0x523538['options']?_0x523538[_0x7b47('0x18')][_0x7b47('0x1c')]?_['map'](_0x523538[_0x7b47('0x18')][_0x7b47('0x1c')],function(_0x2f3778){return{'model':db[_0x2f3778['model']],'as':_0x2f3778['as'],'attributes':_0x2f3778[_0x7b47('0x1a')],'include':_0x2f3778['include']?_[_0x7b47('0x1d')](_0x2f3778['include'],function(_0x8d1069){return{'model':db[_0x8d1069[_0x7b47('0x1e')]],'as':_0x8d1069['as'],'attributes':_0x8d1069[_0x7b47('0x1a')],'include':_0x8d1069[_0x7b47('0x1c')]?_[_0x7b47('0x1d')](_0x8d1069['include'],function(_0x571a6d){return{'model':db[_0x571a6d[_0x7b47('0x1e')]],'as':_0x571a6d['as'],'attributes':_0x571a6d[_0x7b47('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x7b47('0xa')](function(_0x5d7c9){logger[_0x7b47('0xb')](_0x7b47('0x15'),_0x523538);logger['debug'](_0x7b47('0x15'),_0x523538,JSON[_0x7b47('0x1f')](_0x5d7c9));_0x3a3a5f(_0x5d7c9);})['catch'](function(_0x5f309c){logger[_0x7b47('0xf')](_0x7b47('0x15'),_0x5f309c['message'],_0x523538);_0x3ed15c(_0x5276e7[_0x7b47('0xf')](0x1f4,_0x5f309c[_0x7b47('0x12')]));});});};exports[_0x7b47('0x20')]=function(_0x2d7e85){var _0x4e4b99=this;return new Promise(function(_0x148594,_0x3f0b56){return db[_0x7b47('0x16')][_0x7b47('0x21')]({'raw':_0x2d7e85[_0x7b47('0x18')]?_0x2d7e85[_0x7b47('0x18')][_0x7b47('0x22')]===undefined?!![]:![]:!![],'where':_0x2d7e85[_0x7b47('0x18')]?_0x2d7e85[_0x7b47('0x18')][_0x7b47('0x19')]||null:null,'attributes':_0x2d7e85[_0x7b47('0x18')]?_0x2d7e85[_0x7b47('0x18')][_0x7b47('0x1a')]||null:null,'include':_0x2d7e85[_0x7b47('0x18')]?_0x2d7e85[_0x7b47('0x18')][_0x7b47('0x1c')]?_[_0x7b47('0x1d')](_0x2d7e85[_0x7b47('0x18')][_0x7b47('0x1c')],function(_0x2fef91){return{'model':db[_0x2fef91['model']],'as':_0x2fef91['as'],'attributes':_0x2fef91[_0x7b47('0x1a')],'include':_0x2fef91[_0x7b47('0x1c')]?_['map'](_0x2fef91[_0x7b47('0x1c')],function(_0x10e04b){return{'model':db[_0x10e04b[_0x7b47('0x1e')]],'as':_0x10e04b['as'],'attributes':_0x10e04b[_0x7b47('0x1a')],'include':_0x10e04b[_0x7b47('0x1c')]?_[_0x7b47('0x1d')](_0x10e04b[_0x7b47('0x1c')],function(_0x22192d){return{'model':db[_0x22192d['model']],'as':_0x22192d['as'],'attributes':_0x22192d[_0x7b47('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x7b47('0xa')](function(_0x2ad54a){logger['info'](_0x7b47('0x20'),_0x2d7e85);logger[_0x7b47('0xd')](_0x7b47('0x20'),_0x2d7e85,JSON[_0x7b47('0x1f')](_0x2ad54a));_0x148594(_0x2ad54a);})['catch'](function(_0x1081b7){logger[_0x7b47('0xf')]('ShowSugarcrmAccount',_0x1081b7[_0x7b47('0x12')],_0x2d7e85);_0x3f0b56(_0x4e4b99[_0x7b47('0xf')](0x1f4,_0x1081b7[_0x7b47('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index ea09f41..a795c53 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 _0x4ca2=['getSubjects','/:id/descriptions','getDescriptions','post','put','update','delete','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','/:id/subjects'];(function(_0xa6359b,_0x45fc07){var _0x3d9011=function(_0x18a91f){while(--_0x18a91f){_0xa6359b['push'](_0xa6359b['shift']());}};_0x3d9011(++_0x45fc07);}(_0x4ca2,0x132));var _0x24ca=function(_0x23ef1f,_0x127dd2){_0x23ef1f=_0x23ef1f-0x0;var _0x234192=_0x4ca2[_0x23ef1f];return _0x234192;};'use strict';var multer=require(_0x24ca('0x0'));var util=require(_0x24ca('0x1'));var path=require('path');var timeout=require(_0x24ca('0x2'));var express=require(_0x24ca('0x3'));var router=express[_0x24ca('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x24ca('0x5'));var config=require(_0x24ca('0x6'));var controller=require(_0x24ca('0x7'));router['get']('/',auth[_0x24ca('0x8')](),controller[_0x24ca('0x9')]);router[_0x24ca('0xa')](_0x24ca('0xb'),auth['isAuthenticated'](),controller[_0x24ca('0xc')]);router[_0x24ca('0xa')](_0x24ca('0xd'),auth[_0x24ca('0x8')](),controller[_0x24ca('0xe')]);router[_0x24ca('0xa')](_0x24ca('0xf'),auth[_0x24ca('0x8')](),controller[_0x24ca('0x10')]);router['get'](_0x24ca('0x11'),auth[_0x24ca('0x8')](),controller[_0x24ca('0x12')]);router[_0x24ca('0x13')]('/',auth[_0x24ca('0x8')](),controller['create']);router[_0x24ca('0x14')]('/:id',auth[_0x24ca('0x8')](),controller[_0x24ca('0x15')]);router[_0x24ca('0x16')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x9507=['/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','/:id','update','delete','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','isAuthenticated','index','get','show','/:id/fields','getFields'];(function(_0x1d0a9d,_0x9346f1){var _0x38107d=function(_0x21687f){while(--_0x21687f){_0x1d0a9d['push'](_0x1d0a9d['shift']());}};_0x38107d(++_0x9346f1);}(_0x9507,0x82));var _0x7950=function(_0x1496f9,_0x3429ca){_0x1496f9=_0x1496f9-0x0;var _0x493c92=_0x9507[_0x1496f9];return _0x493c92;};'use strict';var multer=require(_0x7950('0x0'));var util=require(_0x7950('0x1'));var path=require(_0x7950('0x2'));var timeout=require(_0x7950('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x7950('0x4'));var interaction=require(_0x7950('0x5'));var config=require(_0x7950('0x6'));var controller=require(_0x7950('0x7'));router['get']('/',auth[_0x7950('0x8')](),controller[_0x7950('0x9')]);router[_0x7950('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x7950('0xb')]);router['get'](_0x7950('0xc'),auth['isAuthenticated'](),controller[_0x7950('0xd')]);router['get'](_0x7950('0xe'),auth[_0x7950('0x8')](),controller[_0x7950('0xf')]);router[_0x7950('0xa')](_0x7950('0x10'),auth[_0x7950('0x8')](),controller[_0x7950('0x11')]);router[_0x7950('0x12')]('/',auth['isAuthenticated'](),controller[_0x7950('0x13')]);router['put'](_0x7950('0x14'),auth[_0x7950('0x8')](),controller[_0x7950('0x15')]);router[_0x7950('0x16')](_0x7950('0x14'),auth[_0x7950('0x8')](),controller['destroy']);module[_0x7950('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 48fe4d1..a959caa 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 _0x8526=['exports','STRING'];(function(_0x1419f6,_0x4180de){var _0x5b07c7=function(_0x5dd304){while(--_0x5dd304){_0x1419f6['push'](_0x1419f6['shift']());}};_0x5b07c7(++_0x4180de);}(_0x8526,0x78));var _0x6852=function(_0x4f5a64,_0xa33ccc){_0x4f5a64=_0x4f5a64-0x0;var _0xd0610=_0x8526[_0x4f5a64];return _0xd0610;};'use strict';var Sequelize=require('sequelize');module[_0x6852('0x0')]={'name':{'type':Sequelize[_0x6852('0x1')]},'description':{'type':Sequelize[_0x6852('0x1')]}}; \ No newline at end of file +var _0x6c6b=['STRING','exports'];(function(_0x47db2e,_0x41b2e3){var _0x467df3=function(_0x5b9e48){while(--_0x5b9e48){_0x47db2e['push'](_0x47db2e['shift']());}};_0x467df3(++_0x41b2e3);}(_0x6c6b,0xa3));var _0xb6c6=function(_0x56916d,_0x37b935){_0x56916d=_0x56916d-0x0;var _0x2b7f1f=_0x6c6b[_0x56916d];return _0x2b7f1f;};'use strict';var Sequelize=require('sequelize');module[_0xb6c6('0x0')]={'name':{'type':Sequelize[_0xb6c6('0x1')]},'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 2d86fe9..90b4680 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 _0x4b23=['filter','merge','VIRTUAL','options','SugarcrmConfiguration','count','include','findAll','rows','length','find','create','body','update','params','getFields','findOne','SugarcrmField','getSubjects','hasOwnProperty','getDescriptions','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','destroy','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','pick'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x4b23,0x71));var _0x34b2=function(_0x1a08ad,_0x21d209){_0x1a08ad=_0x1a08ad-0x0;var _0x521649=_0x4b23[_0x1a08ad];return _0x521649;};'use strict';var pdf=require(_0x34b2('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x34b2('0x1'));var zipdir=require(_0x34b2('0x2'));var jsonpatch=require(_0x34b2('0x3'));var rp=require(_0x34b2('0x4'));var moment=require(_0x34b2('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x34b2('0x6'));var util=require('util');var path=require(_0x34b2('0x7'));var sox=require(_0x34b2('0x8'));var csv=require(_0x34b2('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x34b2('0xa'));var squel=require(_0x34b2('0xb'));var crypto=require('crypto');var jsforce=require(_0x34b2('0xc'));var deskjs=require(_0x34b2('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x34b2('0xe'));var authService=require(_0x34b2('0xf'));var qs=require(_0x34b2('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x34b2('0x11'));var logger=require('../../config/logger')(_0x34b2('0x12'));var utils=require('../../config/utils');var config=require(_0x34b2('0x13'));var db=require(_0x34b2('0x14'))['db'];var jayson=require(_0x34b2('0x15'));var client=jayson[_0x34b2('0x16')][_0x34b2('0x17')]({'port':0x232a});function checkPasswordPattern(_0x5b124d,_0x4f9dc7,_0x3544f7){if(_0x3544f7){var _0x8e8db7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x8e8db7[_0x34b2('0x18')](_0x4f9dc7)){return _0x5b124d;}else{throw new db[(_0x34b2('0x19'))][(_0x34b2('0x1a'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x5b124d;}}function respondWithRpcPromise(_0x54fa37,_0x55ce0d,_0x14e41b,_0x44b39a){return new BPromise(function(_0x3ecb7b,_0xc1155c){var _0x20739a=_0x44b39a||client;return _0x20739a[_0x34b2('0x1b')](_0x54fa37,_0x14e41b)[_0x34b2('0x1c')](function(_0x5132d7){logger[_0x34b2('0x1d')](_0x34b2('0x1e'),_0x55ce0d,_0x34b2('0x1f'));logger['debug'](_0x34b2('0x20'),_0x55ce0d,_0x34b2('0x1f'),JSON[_0x34b2('0x21')](_0x5132d7));if(_0x5132d7[_0x34b2('0x22')]){if(_0x5132d7[_0x34b2('0x22')][_0x34b2('0x23')]===0x1f4){logger[_0x34b2('0x22')](_0x34b2('0x1e'),_0x55ce0d,_0x5132d7[_0x34b2('0x22')]['message']);return _0xc1155c(_0x5132d7[_0x34b2('0x22')][_0x34b2('0x24')]);}logger[_0x34b2('0x22')](_0x34b2('0x1e'),_0x55ce0d,_0x5132d7[_0x34b2('0x22')][_0x34b2('0x24')]);return _0x3ecb7b(_0x5132d7[_0x34b2('0x22')][_0x34b2('0x24')]);}else{logger[_0x34b2('0x1d')](_0x34b2('0x1e'),_0x55ce0d,_0x34b2('0x1f'));_0x3ecb7b(_0x5132d7[_0x34b2('0x25')][_0x34b2('0x24')]);}})[_0x34b2('0x26')](function(_0xa26195){logger['error'](_0x34b2('0x1e'),_0x55ce0d,_0xa26195);_0xc1155c(_0xa26195);});});}function respondWithStatusCode(_0x158af0,_0x3e48ba){_0x3e48ba=_0x3e48ba||0xcc;return function(_0x29ec4f){if(_0x29ec4f){return _0x158af0[_0x34b2('0x27')](_0x3e48ba);}return _0x158af0[_0x34b2('0x28')](_0x3e48ba)[_0x34b2('0x29')]();};}function respondWithResult(_0xa9de63,_0x1ea220){_0x1ea220=_0x1ea220||0xc8;return function(_0x4bc713){if(_0x4bc713){return _0xa9de63[_0x34b2('0x28')](_0x1ea220)[_0x34b2('0x2a')](_0x4bc713);}};}function respondWithFilteredResult(_0x5335dc,_0x57f16b){return function(_0x1288ea){if(_0x1288ea){var _0x72be74=_0x1288ea['count'],_0x1c8f2c=_0x57f16b[_0x34b2('0x2b')],_0x3c99a5=_0x57f16b['offset']+_0x57f16b[_0x34b2('0x2c')],_0x1bdc82;if(_0x3c99a5>=_0x72be74){_0x3c99a5=_0x72be74;_0x1bdc82=0xc8;}else{_0x1bdc82=0xce;}_0x5335dc[_0x34b2('0x28')](_0x1bdc82);return _0x5335dc[_0x34b2('0x2d')](_0x34b2('0x2e'),_0x1c8f2c+'-'+_0x3c99a5+'/'+_0x72be74)['json'](_0x1288ea);}return null;};}function patchUpdates(_0x10cb24){return function(_0x3f70e6){try{jsonpatch[_0x34b2('0x2f')](_0x3f70e6,_0x10cb24,!![]);}catch(_0x4c4a44){return BPromise[_0x34b2('0x30')](_0x4c4a44);}return _0x3f70e6['save']();};}function saveUpdates(_0x53174a,_0x549c1b){return function(_0x295fdd){if(_0x295fdd){return _0x295fdd['update'](_0x53174a)[_0x34b2('0x1c')](function(_0x1e60df){return _0x1e60df;});}return null;};}function removeEntity(_0x1f450f,_0xd468f8){return function(_0x142370){if(_0x142370){return _0x142370[_0x34b2('0x31')]()[_0x34b2('0x1c')](function(){_0x1f450f[_0x34b2('0x28')](0xcc)[_0x34b2('0x29')]();});}};}function handleEntityNotFound(_0x51c1ba,_0x53f3cb){return function(_0x4398d9){if(!_0x4398d9){_0x51c1ba[_0x34b2('0x27')](0x194);}return _0x4398d9;};}function handleError(_0x4ff845,_0x2c0c42){_0x2c0c42=_0x2c0c42||0x1f4;return function(_0x5218bd){logger[_0x34b2('0x22')](_0x5218bd[_0x34b2('0x32')]);if(_0x5218bd[_0x34b2('0x33')]){delete _0x5218bd[_0x34b2('0x33')];}_0x4ff845['status'](_0x2c0c42)[_0x34b2('0x34')](_0x5218bd);};}exports[_0x34b2('0x35')]=function(_0x5c67ca,_0x1e3574){var _0xfd570c={},_0x31d8cc={},_0x4022af={'count':0x0,'rows':[]};var _0x163a40=_['map'](db['SugarcrmConfiguration'][_0x34b2('0x36')],function(_0x106f4b){return{'name':_0x106f4b[_0x34b2('0x37')],'type':_0x106f4b[_0x34b2('0x38')][_0x34b2('0x39')]};});_0x31d8cc[_0x34b2('0x3a')]=_[_0x34b2('0x3b')](_0x163a40,_0x34b2('0x33'));_0x31d8cc[_0x34b2('0x3c')]=_[_0x34b2('0x3d')](_0x5c67ca[_0x34b2('0x3c')]);_0x31d8cc['filters']=_[_0x34b2('0x3e')](_0x31d8cc[_0x34b2('0x3a')],_0x31d8cc[_0x34b2('0x3c')]);_0xfd570c[_0x34b2('0x3f')]=_[_0x34b2('0x3e')](_0x31d8cc[_0x34b2('0x3a')],qs[_0x34b2('0x40')](_0x5c67ca[_0x34b2('0x3c')][_0x34b2('0x40')]));_0xfd570c[_0x34b2('0x3f')]=_0xfd570c[_0x34b2('0x3f')]['length']?_0xfd570c[_0x34b2('0x3f')]:_0x31d8cc[_0x34b2('0x3a')];if(!_0x5c67ca[_0x34b2('0x3c')]['hasOwnProperty'](_0x34b2('0x41'))){_0xfd570c['limit']=qs[_0x34b2('0x2c')](_0x5c67ca[_0x34b2('0x3c')][_0x34b2('0x2c')]);_0xfd570c[_0x34b2('0x2b')]=qs[_0x34b2('0x2b')](_0x5c67ca[_0x34b2('0x3c')][_0x34b2('0x2b')]);}_0xfd570c[_0x34b2('0x42')]=qs[_0x34b2('0x43')](_0x5c67ca['query']['sort']);_0xfd570c[_0x34b2('0x44')]=qs[_0x34b2('0x45')](_[_0x34b2('0x46')](_0x5c67ca['query'],_0x31d8cc[_0x34b2('0x45')]));if(_0x5c67ca[_0x34b2('0x3c')][_0x34b2('0x47')]){_0xfd570c[_0x34b2('0x44')]=_[_0x34b2('0x48')](_0xfd570c[_0x34b2('0x44')],{'$or':_[_0x34b2('0x3b')](_0x163a40,function(_0x542f5b){if(_0x542f5b[_0x34b2('0x38')]!==_0x34b2('0x49')){var _0x4d97a6={};_0x4d97a6[_0x542f5b[_0x34b2('0x33')]]={'$like':'%'+_0x5c67ca['query']['filter']+'%'};return _0x4d97a6;}})});}_0xfd570c=_[_0x34b2('0x48')]({},_0xfd570c,_0x5c67ca[_0x34b2('0x4a')]);var _0x26a78b={'where':_0xfd570c[_0x34b2('0x44')]};return db[_0x34b2('0x4b')][_0x34b2('0x4c')](_0x26a78b)[_0x34b2('0x1c')](function(_0x1223c7){_0x4022af[_0x34b2('0x4c')]=_0x1223c7;if(_0x5c67ca[_0x34b2('0x3c')]['includeAll']){_0xfd570c[_0x34b2('0x4d')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0x34b2('0x4e')](_0xfd570c);})[_0x34b2('0x1c')](function(_0x29e5f6){_0x4022af[_0x34b2('0x4f')]=_0x29e5f6;return _0x4022af;})['then'](respondWithFilteredResult(_0x1e3574,_0xfd570c))['catch'](handleError(_0x1e3574,null));};exports['show']=function(_0x163684,_0xaa9d09){var _0x5d84cd={'raw':![],'where':{'id':_0x163684['params']['id']}},_0xf05e98={};_0xf05e98[_0x34b2('0x3a')]=_[_0x34b2('0x3d')](db[_0x34b2('0x4b')][_0x34b2('0x36')]);_0xf05e98[_0x34b2('0x3c')]=_[_0x34b2('0x3d')](_0x163684[_0x34b2('0x3c')]);_0xf05e98[_0x34b2('0x45')]=_[_0x34b2('0x3e')](_0xf05e98[_0x34b2('0x3a')],_0xf05e98[_0x34b2('0x3c')]);_0x5d84cd[_0x34b2('0x3f')]=_[_0x34b2('0x3e')](_0xf05e98[_0x34b2('0x3a')],qs['fields'](_0x163684[_0x34b2('0x3c')][_0x34b2('0x40')]));_0x5d84cd['attributes']=_0x5d84cd[_0x34b2('0x3f')][_0x34b2('0x50')]?_0x5d84cd['attributes']:_0xf05e98[_0x34b2('0x3a')];if(_0x163684[_0x34b2('0x3c')]['includeAll']){_0x5d84cd['include']=[{'all':!![]}];}_0x5d84cd=_[_0x34b2('0x48')]({},_0x5d84cd,_0x163684[_0x34b2('0x4a')]);return db[_0x34b2('0x4b')][_0x34b2('0x51')](_0x5d84cd)[_0x34b2('0x1c')](handleEntityNotFound(_0xaa9d09,null))[_0x34b2('0x1c')](respondWithResult(_0xaa9d09,null))['catch'](handleError(_0xaa9d09,null));};exports[_0x34b2('0x52')]=function(_0x127b57,_0x288f73){return db[_0x34b2('0x4b')][_0x34b2('0x52')](_0x127b57[_0x34b2('0x53')],{})['then'](respondWithResult(_0x288f73,0xc9))[_0x34b2('0x26')](handleError(_0x288f73,null));};exports[_0x34b2('0x54')]=function(_0x21220b,_0x59b511){if(_0x21220b['body']['id']){delete _0x21220b['body']['id'];}return db[_0x34b2('0x4b')]['find']({'where':{'id':_0x21220b[_0x34b2('0x55')]['id']}})[_0x34b2('0x1c')](handleEntityNotFound(_0x59b511,null))[_0x34b2('0x1c')](saveUpdates(_0x21220b['body'],null))[_0x34b2('0x1c')](respondWithResult(_0x59b511,null))[_0x34b2('0x26')](handleError(_0x59b511,null));};exports[_0x34b2('0x31')]=function(_0x2a7269,_0x2772e6){return db[_0x34b2('0x4b')]['find']({'where':{'id':_0x2a7269['params']['id']}})['then'](handleEntityNotFound(_0x2772e6,null))[_0x34b2('0x1c')](removeEntity(_0x2772e6,null))[_0x34b2('0x26')](handleError(_0x2772e6,null));};exports[_0x34b2('0x56')]=function(_0x3afc10,_0x454312,_0x288049){var _0x36d3aa={};var _0x9f3fef={};var _0x5063ea;var _0x45ca4d;return db[_0x34b2('0x4b')][_0x34b2('0x57')]({'where':{'id':_0x3afc10[_0x34b2('0x55')]['id']}})[_0x34b2('0x1c')](handleEntityNotFound(_0x454312,null))[_0x34b2('0x1c')](function(_0x59e127){if(_0x59e127){_0x5063ea=_0x59e127;_0x9f3fef[_0x34b2('0x3a')]=_[_0x34b2('0x3d')](db[_0x34b2('0x58')][_0x34b2('0x36')]);_0x9f3fef[_0x34b2('0x3c')]=_[_0x34b2('0x3d')](_0x3afc10[_0x34b2('0x3c')]);_0x9f3fef[_0x34b2('0x45')]=_[_0x34b2('0x3e')](_0x9f3fef[_0x34b2('0x3a')],_0x9f3fef[_0x34b2('0x3c')]);_0x36d3aa[_0x34b2('0x3f')]=_['intersection'](_0x9f3fef[_0x34b2('0x3a')],qs[_0x34b2('0x40')](_0x3afc10[_0x34b2('0x3c')][_0x34b2('0x40')]));_0x36d3aa[_0x34b2('0x3f')]=_0x36d3aa[_0x34b2('0x3f')][_0x34b2('0x50')]?_0x36d3aa[_0x34b2('0x3f')]:_0x9f3fef[_0x34b2('0x3a')];_0x36d3aa[_0x34b2('0x42')]=qs[_0x34b2('0x43')](_0x3afc10[_0x34b2('0x3c')]['sort']);_0x36d3aa[_0x34b2('0x44')]=qs['filters'](_[_0x34b2('0x46')](_0x3afc10[_0x34b2('0x3c')],_0x9f3fef['filters']));if(_0x3afc10[_0x34b2('0x3c')]['filter']){_0x36d3aa[_0x34b2('0x44')]=_[_0x34b2('0x48')](_0x36d3aa['where'],{'$or':_[_0x34b2('0x3b')](_0x36d3aa[_0x34b2('0x3f')],function(_0x48510d){var _0x42bea3={};_0x42bea3[_0x48510d]={'$like':'%'+_0x3afc10[_0x34b2('0x3c')][_0x34b2('0x47')]+'%'};return _0x42bea3;})});}_0x36d3aa=_['merge']({},_0x36d3aa,_0x3afc10[_0x34b2('0x4a')]);return _0x5063ea['getFields'](_0x36d3aa);}})[_0x34b2('0x1c')](function(_0xd2fbdf){if(_0xd2fbdf){_0x45ca4d=_0xd2fbdf['length'];if(!_0x3afc10['query']['hasOwnProperty'](_0x34b2('0x41'))){_0x36d3aa['limit']=qs[_0x34b2('0x2c')](_0x3afc10['query'][_0x34b2('0x2c')]);_0x36d3aa[_0x34b2('0x2b')]=qs['offset'](_0x3afc10['query'][_0x34b2('0x2b')]);}return _0x5063ea[_0x34b2('0x56')](_0x36d3aa);}})['then'](function(_0x2c93f5){if(_0x2c93f5){return _0x2c93f5?{'count':_0x45ca4d,'rows':_0x2c93f5}:null;}})[_0x34b2('0x1c')](respondWithResult(_0x454312,null))[_0x34b2('0x26')](handleError(_0x454312,null));};exports[_0x34b2('0x59')]=function(_0x24e2de,_0x1cf83e,_0x5b2698){var _0x5e719c={};var _0x5a36d1={};var _0x28b32f;var _0x1b34a2;return db[_0x34b2('0x4b')][_0x34b2('0x57')]({'where':{'id':_0x24e2de[_0x34b2('0x55')]['id']}})[_0x34b2('0x1c')](handleEntityNotFound(_0x1cf83e,null))[_0x34b2('0x1c')](function(_0x3e98df){if(_0x3e98df){_0x28b32f=_0x3e98df;_0x5a36d1[_0x34b2('0x3a')]=_['keys'](db[_0x34b2('0x58')][_0x34b2('0x36')]);_0x5a36d1[_0x34b2('0x3c')]=_[_0x34b2('0x3d')](_0x24e2de[_0x34b2('0x3c')]);_0x5a36d1[_0x34b2('0x45')]=_[_0x34b2('0x3e')](_0x5a36d1[_0x34b2('0x3a')],_0x5a36d1[_0x34b2('0x3c')]);_0x5e719c[_0x34b2('0x3f')]=_[_0x34b2('0x3e')](_0x5a36d1[_0x34b2('0x3a')],qs['fields'](_0x24e2de[_0x34b2('0x3c')][_0x34b2('0x40')]));_0x5e719c[_0x34b2('0x3f')]=_0x5e719c['attributes'][_0x34b2('0x50')]?_0x5e719c['attributes']:_0x5a36d1[_0x34b2('0x3a')];_0x5e719c[_0x34b2('0x42')]=qs[_0x34b2('0x43')](_0x24e2de[_0x34b2('0x3c')][_0x34b2('0x43')]);_0x5e719c['where']=qs[_0x34b2('0x45')](_[_0x34b2('0x46')](_0x24e2de[_0x34b2('0x3c')],_0x5a36d1[_0x34b2('0x45')]));if(_0x24e2de[_0x34b2('0x3c')][_0x34b2('0x47')]){_0x5e719c[_0x34b2('0x44')]=_['merge'](_0x5e719c[_0x34b2('0x44')],{'$or':_['map'](_0x5e719c['attributes'],function(_0x33716f){var _0x43bcbb={};_0x43bcbb[_0x33716f]={'$like':'%'+_0x24e2de['query'][_0x34b2('0x47')]+'%'};return _0x43bcbb;})});}_0x5e719c=_['merge']({},_0x5e719c,_0x24e2de[_0x34b2('0x4a')]);return _0x28b32f[_0x34b2('0x59')](_0x5e719c);}})['then'](function(_0x2b10a3){if(_0x2b10a3){_0x1b34a2=_0x2b10a3[_0x34b2('0x50')];if(!_0x24e2de[_0x34b2('0x3c')][_0x34b2('0x5a')](_0x34b2('0x41'))){_0x5e719c[_0x34b2('0x2c')]=qs[_0x34b2('0x2c')](_0x24e2de['query'][_0x34b2('0x2c')]);_0x5e719c[_0x34b2('0x2b')]=qs['offset'](_0x24e2de['query'][_0x34b2('0x2b')]);}return _0x28b32f['getSubjects'](_0x5e719c);}})[_0x34b2('0x1c')](function(_0x22e3b1){if(_0x22e3b1){return _0x22e3b1?{'count':_0x1b34a2,'rows':_0x22e3b1}:null;}})[_0x34b2('0x1c')](respondWithResult(_0x1cf83e,null))[_0x34b2('0x26')](handleError(_0x1cf83e,null));};exports[_0x34b2('0x5b')]=function(_0xd0b383,_0x4efcd6,_0xd4093a){var _0x4ce1e0={};var _0x1423f9={};var _0x4d16ce;var _0x12a68d;return db[_0x34b2('0x4b')][_0x34b2('0x57')]({'where':{'id':_0xd0b383['params']['id']}})[_0x34b2('0x1c')](handleEntityNotFound(_0x4efcd6,null))[_0x34b2('0x1c')](function(_0x2fa456){if(_0x2fa456){_0x4d16ce=_0x2fa456;_0x1423f9[_0x34b2('0x3a')]=_['keys'](db[_0x34b2('0x58')][_0x34b2('0x36')]);_0x1423f9[_0x34b2('0x3c')]=_[_0x34b2('0x3d')](_0xd0b383[_0x34b2('0x3c')]);_0x1423f9[_0x34b2('0x45')]=_[_0x34b2('0x3e')](_0x1423f9['model'],_0x1423f9[_0x34b2('0x3c')]);_0x4ce1e0[_0x34b2('0x3f')]=_[_0x34b2('0x3e')](_0x1423f9['model'],qs[_0x34b2('0x40')](_0xd0b383[_0x34b2('0x3c')][_0x34b2('0x40')]));_0x4ce1e0[_0x34b2('0x3f')]=_0x4ce1e0[_0x34b2('0x3f')]['length']?_0x4ce1e0[_0x34b2('0x3f')]:_0x1423f9[_0x34b2('0x3a')];_0x4ce1e0['order']=qs['sort'](_0xd0b383['query'][_0x34b2('0x43')]);_0x4ce1e0['where']=qs['filters'](_[_0x34b2('0x46')](_0xd0b383[_0x34b2('0x3c')],_0x1423f9['filters']));if(_0xd0b383['query'][_0x34b2('0x47')]){_0x4ce1e0[_0x34b2('0x44')]=_[_0x34b2('0x48')](_0x4ce1e0['where'],{'$or':_[_0x34b2('0x3b')](_0x4ce1e0[_0x34b2('0x3f')],function(_0x356e33){var _0x2f6965={};_0x2f6965[_0x356e33]={'$like':'%'+_0xd0b383['query'][_0x34b2('0x47')]+'%'};return _0x2f6965;})});}_0x4ce1e0=_[_0x34b2('0x48')]({},_0x4ce1e0,_0xd0b383[_0x34b2('0x4a')]);return _0x4d16ce[_0x34b2('0x5b')](_0x4ce1e0);}})['then'](function(_0x5ebde0){if(_0x5ebde0){_0x12a68d=_0x5ebde0['length'];if(!_0xd0b383['query']['hasOwnProperty'](_0x34b2('0x41'))){_0x4ce1e0[_0x34b2('0x2c')]=qs[_0x34b2('0x2c')](_0xd0b383[_0x34b2('0x3c')][_0x34b2('0x2c')]);_0x4ce1e0[_0x34b2('0x2b')]=qs[_0x34b2('0x2b')](_0xd0b383['query'][_0x34b2('0x2b')]);}return _0x4d16ce['getDescriptions'](_0x4ce1e0);}})[_0x34b2('0x1c')](function(_0x5ad488){if(_0x5ad488){return _0x5ad488?{'count':_0x12a68d,'rows':_0x5ad488}:null;}})['then'](respondWithResult(_0x4efcd6,null))[_0x34b2('0x26')](handleError(_0x4efcd6,null));}; \ No newline at end of file +var _0x02e5=['desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','debug','request\x20sent','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','SugarcrmConfiguration','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','show','params','find','create','getFields','getSubjects','findOne','SugarcrmField','getDescriptions','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce'];(function(_0x5961,_0x4ec3c9){var _0x2fc8c1=function(_0x15e2a8){while(--_0x15e2a8){_0x5961['push'](_0x5961['shift']());}};_0x2fc8c1(++_0x4ec3c9);}(_0x02e5,0x1c7));var _0x502e=function(_0x23ca1b,_0x43e359){_0x23ca1b=_0x23ca1b-0x0;var _0x41ae75=_0x02e5[_0x23ca1b];return _0x41ae75;};'use strict';var pdf=require(_0x502e('0x0'));var emlformat=require(_0x502e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x502e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x502e('0x3'));var moment=require(_0x502e('0x4'));var BPromise=require(_0x502e('0x5'));var Mustache=require(_0x502e('0x6'));var util=require(_0x502e('0x7'));var path=require(_0x502e('0x8'));var sox=require(_0x502e('0x9'));var csv=require(_0x502e('0xa'));var ejs=require(_0x502e('0xb'));var fs=require('fs');var _=require(_0x502e('0xc'));var squel=require('squel');var crypto=require(_0x502e('0xd'));var jsforce=require(_0x502e('0xe'));var deskjs=require(_0x502e('0xf'));var toCsv=require(_0x502e('0xa'));var querystring=require(_0x502e('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x502e('0x11'));var qs=require(_0x502e('0x12'));var as=require(_0x502e('0x13'));var hardwareService=require(_0x502e('0x14'));var logger=require(_0x502e('0x15'))(_0x502e('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x502e('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x502e('0x18')][_0x502e('0x19')]({'port':0x232a});function checkPasswordPattern(_0x30f8ad,_0x445a98,_0x4a1515){if(_0x4a1515){var _0x220a22=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x220a22[_0x502e('0x1a')](_0x445a98)){return _0x30f8ad;}else{throw new db[(_0x502e('0x1b'))][(_0x502e('0x1c'))](_0x502e('0x1d'));}}else{return _0x30f8ad;}}function respondWithRpcPromise(_0xe0179e,_0x4c4e40,_0x4f908c,_0x55ece4){return new BPromise(function(_0x23fbdc,_0xa41d6){var _0x25f023=_0x55ece4||client;return _0x25f023['request'](_0xe0179e,_0x4f908c)[_0x502e('0x1e')](function(_0xbea678){logger[_0x502e('0x1f')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x4c4e40,'request\x20sent');logger[_0x502e('0x20')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x4c4e40,_0x502e('0x21'),JSON['stringify'](_0xbea678));if(_0xbea678[_0x502e('0x22')]){if(_0xbea678[_0x502e('0x22')][_0x502e('0x23')]===0x1f4){logger[_0x502e('0x22')](_0x502e('0x24'),_0x4c4e40,_0xbea678[_0x502e('0x22')][_0x502e('0x25')]);return _0xa41d6(_0xbea678[_0x502e('0x22')][_0x502e('0x25')]);}logger[_0x502e('0x22')](_0x502e('0x24'),_0x4c4e40,_0xbea678[_0x502e('0x22')][_0x502e('0x25')]);return _0x23fbdc(_0xbea678[_0x502e('0x22')][_0x502e('0x25')]);}else{logger[_0x502e('0x1f')](_0x502e('0x24'),_0x4c4e40,_0x502e('0x21'));_0x23fbdc(_0xbea678[_0x502e('0x26')][_0x502e('0x25')]);}})[_0x502e('0x27')](function(_0x15f698){logger[_0x502e('0x22')](_0x502e('0x24'),_0x4c4e40,_0x15f698);_0xa41d6(_0x15f698);});});}function respondWithStatusCode(_0x315f7b,_0x5d14a3){_0x5d14a3=_0x5d14a3||0xcc;return function(_0x1e6219){if(_0x1e6219){return _0x315f7b[_0x502e('0x28')](_0x5d14a3);}return _0x315f7b[_0x502e('0x29')](_0x5d14a3)[_0x502e('0x2a')]();};}function respondWithResult(_0x34c9b4,_0xaac3cf){_0xaac3cf=_0xaac3cf||0xc8;return function(_0xd5305f){if(_0xd5305f){return _0x34c9b4[_0x502e('0x29')](_0xaac3cf)[_0x502e('0x2b')](_0xd5305f);}};}function respondWithFilteredResult(_0x2fc0c5,_0x46a79e){return function(_0x4a8b72){if(_0x4a8b72){var _0x20e9cb=_0x4a8b72[_0x502e('0x2c')],_0x12ebf7=_0x46a79e[_0x502e('0x2d')],_0x2586e1=_0x46a79e[_0x502e('0x2d')]+_0x46a79e[_0x502e('0x2e')],_0x2ba56a;if(_0x2586e1>=_0x20e9cb){_0x2586e1=_0x20e9cb;_0x2ba56a=0xc8;}else{_0x2ba56a=0xce;}_0x2fc0c5[_0x502e('0x29')](_0x2ba56a);return _0x2fc0c5[_0x502e('0x2f')](_0x502e('0x30'),_0x12ebf7+'-'+_0x2586e1+'/'+_0x20e9cb)['json'](_0x4a8b72);}return null;};}function patchUpdates(_0xfb0d37){return function(_0x9cf86e){try{jsonpatch[_0x502e('0x31')](_0x9cf86e,_0xfb0d37,!![]);}catch(_0x4dfe42){return BPromise[_0x502e('0x32')](_0x4dfe42);}return _0x9cf86e[_0x502e('0x33')]();};}function saveUpdates(_0x1d6948,_0x532ff6){return function(_0x53dd73){if(_0x53dd73){return _0x53dd73[_0x502e('0x34')](_0x1d6948)[_0x502e('0x1e')](function(_0xb00102){return _0xb00102;});}return null;};}function removeEntity(_0x510bfc,_0x4f150c){return function(_0x2a0714){if(_0x2a0714){return _0x2a0714[_0x502e('0x35')]()[_0x502e('0x1e')](function(){_0x510bfc[_0x502e('0x29')](0xcc)[_0x502e('0x2a')]();});}};}function handleEntityNotFound(_0x4c86fa,_0xb9a800){return function(_0x5f06fa){if(!_0x5f06fa){_0x4c86fa['sendStatus'](0x194);}return _0x5f06fa;};}function handleError(_0x300ef7,_0x51802e){_0x51802e=_0x51802e||0x1f4;return function(_0x254053){logger[_0x502e('0x22')](_0x254053[_0x502e('0x36')]);if(_0x254053[_0x502e('0x37')]){delete _0x254053[_0x502e('0x37')];}_0x300ef7['status'](_0x51802e)[_0x502e('0x38')](_0x254053);};}exports[_0x502e('0x39')]=function(_0x1b1338,_0x2a4be7){var _0x321a4d={},_0x4dee57={},_0x5fa1ec={'count':0x0,'rows':[]};var _0x5ba287=_[_0x502e('0x3a')](db[_0x502e('0x3b')][_0x502e('0x3c')],function(_0x4b3303){return{'name':_0x4b3303[_0x502e('0x3d')],'type':_0x4b3303[_0x502e('0x3e')][_0x502e('0x3f')]};});_0x4dee57['model']=_[_0x502e('0x3a')](_0x5ba287,_0x502e('0x37'));_0x4dee57['query']=_[_0x502e('0x40')](_0x1b1338[_0x502e('0x41')]);_0x4dee57[_0x502e('0x42')]=_[_0x502e('0x43')](_0x4dee57[_0x502e('0x44')],_0x4dee57[_0x502e('0x41')]);_0x321a4d[_0x502e('0x45')]=_[_0x502e('0x43')](_0x4dee57[_0x502e('0x44')],qs[_0x502e('0x46')](_0x1b1338[_0x502e('0x41')][_0x502e('0x46')]));_0x321a4d[_0x502e('0x45')]=_0x321a4d[_0x502e('0x45')][_0x502e('0x47')]?_0x321a4d[_0x502e('0x45')]:_0x4dee57[_0x502e('0x44')];if(!_0x1b1338[_0x502e('0x41')][_0x502e('0x48')](_0x502e('0x49'))){_0x321a4d[_0x502e('0x2e')]=qs[_0x502e('0x2e')](_0x1b1338[_0x502e('0x41')]['limit']);_0x321a4d['offset']=qs['offset'](_0x1b1338[_0x502e('0x41')][_0x502e('0x2d')]);}_0x321a4d[_0x502e('0x4a')]=qs[_0x502e('0x4b')](_0x1b1338[_0x502e('0x41')][_0x502e('0x4b')]);_0x321a4d['where']=qs[_0x502e('0x42')](_[_0x502e('0x4c')](_0x1b1338[_0x502e('0x41')],_0x4dee57[_0x502e('0x42')]));if(_0x1b1338['query'][_0x502e('0x4d')]){_0x321a4d['where']=_[_0x502e('0x4e')](_0x321a4d[_0x502e('0x4f')],{'$or':_[_0x502e('0x3a')](_0x5ba287,function(_0x18a22d){if(_0x18a22d[_0x502e('0x3e')]!==_0x502e('0x50')){var _0x1adcf7={};_0x1adcf7[_0x18a22d[_0x502e('0x37')]]={'$like':'%'+_0x1b1338['query'][_0x502e('0x4d')]+'%'};return _0x1adcf7;}})});}_0x321a4d=_[_0x502e('0x4e')]({},_0x321a4d,_0x1b1338[_0x502e('0x51')]);var _0x5a38b8={'where':_0x321a4d['where']};return db[_0x502e('0x3b')][_0x502e('0x2c')](_0x5a38b8)[_0x502e('0x1e')](function(_0x117b5b){_0x5fa1ec['count']=_0x117b5b;if(_0x1b1338[_0x502e('0x41')][_0x502e('0x52')]){_0x321a4d[_0x502e('0x53')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0x502e('0x54')](_0x321a4d);})[_0x502e('0x1e')](function(_0x3fcd1d){_0x5fa1ec['rows']=_0x3fcd1d;return _0x5fa1ec;})[_0x502e('0x1e')](respondWithFilteredResult(_0x2a4be7,_0x321a4d))['catch'](handleError(_0x2a4be7,null));};exports[_0x502e('0x55')]=function(_0x3e60cf,_0x172952){var _0x370286={'raw':![],'where':{'id':_0x3e60cf[_0x502e('0x56')]['id']}},_0x37445d={};_0x37445d[_0x502e('0x44')]=_[_0x502e('0x40')](db['SugarcrmConfiguration'][_0x502e('0x3c')]);_0x37445d['query']=_[_0x502e('0x40')](_0x3e60cf['query']);_0x37445d['filters']=_[_0x502e('0x43')](_0x37445d['model'],_0x37445d[_0x502e('0x41')]);_0x370286[_0x502e('0x45')]=_[_0x502e('0x43')](_0x37445d[_0x502e('0x44')],qs[_0x502e('0x46')](_0x3e60cf[_0x502e('0x41')]['fields']));_0x370286[_0x502e('0x45')]=_0x370286[_0x502e('0x45')][_0x502e('0x47')]?_0x370286[_0x502e('0x45')]:_0x37445d[_0x502e('0x44')];if(_0x3e60cf[_0x502e('0x41')][_0x502e('0x52')]){_0x370286[_0x502e('0x53')]=[{'all':!![]}];}_0x370286=_[_0x502e('0x4e')]({},_0x370286,_0x3e60cf[_0x502e('0x51')]);return db[_0x502e('0x3b')][_0x502e('0x57')](_0x370286)[_0x502e('0x1e')](handleEntityNotFound(_0x172952,null))[_0x502e('0x1e')](respondWithResult(_0x172952,null))[_0x502e('0x27')](handleError(_0x172952,null));};exports['create']=function(_0x4ed7aa,_0x12e696){return db[_0x502e('0x3b')][_0x502e('0x58')](_0x4ed7aa['body'],{})['then'](respondWithResult(_0x12e696,0xc9))['catch'](handleError(_0x12e696,null));};exports['update']=function(_0x597d3e,_0x36ead0){if(_0x597d3e['body']['id']){delete _0x597d3e['body']['id'];}return db['SugarcrmConfiguration'][_0x502e('0x57')]({'where':{'id':_0x597d3e[_0x502e('0x56')]['id']}})[_0x502e('0x1e')](handleEntityNotFound(_0x36ead0,null))['then'](saveUpdates(_0x597d3e['body'],null))[_0x502e('0x1e')](respondWithResult(_0x36ead0,null))['catch'](handleError(_0x36ead0,null));};exports[_0x502e('0x35')]=function(_0x50883f,_0x1db9a2){return db[_0x502e('0x3b')][_0x502e('0x57')]({'where':{'id':_0x50883f[_0x502e('0x56')]['id']}})['then'](handleEntityNotFound(_0x1db9a2,null))[_0x502e('0x1e')](removeEntity(_0x1db9a2,null))['catch'](handleError(_0x1db9a2,null));};exports['getFields']=function(_0x23e859,_0x2e924a,_0x29c7a2){var _0x294ec9={};var _0x2b9f4a={};var _0x26993a;var _0x75f9fc;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x23e859[_0x502e('0x56')]['id']}})[_0x502e('0x1e')](handleEntityNotFound(_0x2e924a,null))[_0x502e('0x1e')](function(_0x2c1171){if(_0x2c1171){_0x26993a=_0x2c1171;_0x2b9f4a[_0x502e('0x44')]=_[_0x502e('0x40')](db['SugarcrmField'][_0x502e('0x3c')]);_0x2b9f4a[_0x502e('0x41')]=_[_0x502e('0x40')](_0x23e859[_0x502e('0x41')]);_0x2b9f4a['filters']=_[_0x502e('0x43')](_0x2b9f4a['model'],_0x2b9f4a['query']);_0x294ec9[_0x502e('0x45')]=_['intersection'](_0x2b9f4a[_0x502e('0x44')],qs[_0x502e('0x46')](_0x23e859[_0x502e('0x41')][_0x502e('0x46')]));_0x294ec9[_0x502e('0x45')]=_0x294ec9[_0x502e('0x45')][_0x502e('0x47')]?_0x294ec9[_0x502e('0x45')]:_0x2b9f4a['model'];_0x294ec9['order']=qs[_0x502e('0x4b')](_0x23e859[_0x502e('0x41')]['sort']);_0x294ec9[_0x502e('0x4f')]=qs[_0x502e('0x42')](_[_0x502e('0x4c')](_0x23e859[_0x502e('0x41')],_0x2b9f4a['filters']));if(_0x23e859[_0x502e('0x41')][_0x502e('0x4d')]){_0x294ec9['where']=_[_0x502e('0x4e')](_0x294ec9[_0x502e('0x4f')],{'$or':_[_0x502e('0x3a')](_0x294ec9[_0x502e('0x45')],function(_0x34845e){var _0x552916={};_0x552916[_0x34845e]={'$like':'%'+_0x23e859[_0x502e('0x41')]['filter']+'%'};return _0x552916;})});}_0x294ec9=_['merge']({},_0x294ec9,_0x23e859[_0x502e('0x51')]);return _0x26993a['getFields'](_0x294ec9);}})[_0x502e('0x1e')](function(_0x1f9a9e){if(_0x1f9a9e){_0x75f9fc=_0x1f9a9e['length'];if(!_0x23e859[_0x502e('0x41')][_0x502e('0x48')](_0x502e('0x49'))){_0x294ec9['limit']=qs['limit'](_0x23e859['query'][_0x502e('0x2e')]);_0x294ec9['offset']=qs['offset'](_0x23e859['query'][_0x502e('0x2d')]);}return _0x26993a[_0x502e('0x59')](_0x294ec9);}})[_0x502e('0x1e')](function(_0x477601){if(_0x477601){return _0x477601?{'count':_0x75f9fc,'rows':_0x477601}:null;}})[_0x502e('0x1e')](respondWithResult(_0x2e924a,null))[_0x502e('0x27')](handleError(_0x2e924a,null));};exports[_0x502e('0x5a')]=function(_0x78f223,_0x2a457e,_0x5b4bf2){var _0x544259={};var _0x53c7a6={};var _0x6445e4;var _0x2e3cf4;return db[_0x502e('0x3b')][_0x502e('0x5b')]({'where':{'id':_0x78f223[_0x502e('0x56')]['id']}})[_0x502e('0x1e')](handleEntityNotFound(_0x2a457e,null))[_0x502e('0x1e')](function(_0x289bbc){if(_0x289bbc){_0x6445e4=_0x289bbc;_0x53c7a6['model']=_['keys'](db[_0x502e('0x5c')]['rawAttributes']);_0x53c7a6[_0x502e('0x41')]=_[_0x502e('0x40')](_0x78f223[_0x502e('0x41')]);_0x53c7a6[_0x502e('0x42')]=_[_0x502e('0x43')](_0x53c7a6['model'],_0x53c7a6[_0x502e('0x41')]);_0x544259[_0x502e('0x45')]=_[_0x502e('0x43')](_0x53c7a6[_0x502e('0x44')],qs['fields'](_0x78f223[_0x502e('0x41')][_0x502e('0x46')]));_0x544259['attributes']=_0x544259[_0x502e('0x45')][_0x502e('0x47')]?_0x544259[_0x502e('0x45')]:_0x53c7a6[_0x502e('0x44')];_0x544259[_0x502e('0x4a')]=qs[_0x502e('0x4b')](_0x78f223[_0x502e('0x41')][_0x502e('0x4b')]);_0x544259['where']=qs[_0x502e('0x42')](_[_0x502e('0x4c')](_0x78f223[_0x502e('0x41')],_0x53c7a6[_0x502e('0x42')]));if(_0x78f223['query'][_0x502e('0x4d')]){_0x544259['where']=_[_0x502e('0x4e')](_0x544259['where'],{'$or':_[_0x502e('0x3a')](_0x544259[_0x502e('0x45')],function(_0x111e80){var _0x4d45eb={};_0x4d45eb[_0x111e80]={'$like':'%'+_0x78f223['query'][_0x502e('0x4d')]+'%'};return _0x4d45eb;})});}_0x544259=_['merge']({},_0x544259,_0x78f223[_0x502e('0x51')]);return _0x6445e4[_0x502e('0x5a')](_0x544259);}})[_0x502e('0x1e')](function(_0x5c48a6){if(_0x5c48a6){_0x2e3cf4=_0x5c48a6[_0x502e('0x47')];if(!_0x78f223[_0x502e('0x41')][_0x502e('0x48')](_0x502e('0x49'))){_0x544259[_0x502e('0x2e')]=qs[_0x502e('0x2e')](_0x78f223[_0x502e('0x41')][_0x502e('0x2e')]);_0x544259[_0x502e('0x2d')]=qs['offset'](_0x78f223[_0x502e('0x41')][_0x502e('0x2d')]);}return _0x6445e4[_0x502e('0x5a')](_0x544259);}})[_0x502e('0x1e')](function(_0x49c88d){if(_0x49c88d){return _0x49c88d?{'count':_0x2e3cf4,'rows':_0x49c88d}:null;}})['then'](respondWithResult(_0x2a457e,null))[_0x502e('0x27')](handleError(_0x2a457e,null));};exports[_0x502e('0x5d')]=function(_0x42cbcf,_0x1441e9,_0x27b366){var _0x3884c6={};var _0x6a5eee={};var _0xd0d6ff;var _0x19f887;return db[_0x502e('0x3b')][_0x502e('0x5b')]({'where':{'id':_0x42cbcf[_0x502e('0x56')]['id']}})[_0x502e('0x1e')](handleEntityNotFound(_0x1441e9,null))['then'](function(_0x6c1cbc){if(_0x6c1cbc){_0xd0d6ff=_0x6c1cbc;_0x6a5eee[_0x502e('0x44')]=_[_0x502e('0x40')](db[_0x502e('0x5c')][_0x502e('0x3c')]);_0x6a5eee['query']=_[_0x502e('0x40')](_0x42cbcf[_0x502e('0x41')]);_0x6a5eee[_0x502e('0x42')]=_[_0x502e('0x43')](_0x6a5eee[_0x502e('0x44')],_0x6a5eee[_0x502e('0x41')]);_0x3884c6[_0x502e('0x45')]=_[_0x502e('0x43')](_0x6a5eee[_0x502e('0x44')],qs[_0x502e('0x46')](_0x42cbcf[_0x502e('0x41')]['fields']));_0x3884c6['attributes']=_0x3884c6[_0x502e('0x45')][_0x502e('0x47')]?_0x3884c6[_0x502e('0x45')]:_0x6a5eee[_0x502e('0x44')];_0x3884c6[_0x502e('0x4a')]=qs[_0x502e('0x4b')](_0x42cbcf['query'][_0x502e('0x4b')]);_0x3884c6[_0x502e('0x4f')]=qs[_0x502e('0x42')](_['pick'](_0x42cbcf[_0x502e('0x41')],_0x6a5eee[_0x502e('0x42')]));if(_0x42cbcf[_0x502e('0x41')][_0x502e('0x4d')]){_0x3884c6[_0x502e('0x4f')]=_['merge'](_0x3884c6['where'],{'$or':_[_0x502e('0x3a')](_0x3884c6[_0x502e('0x45')],function(_0x3f0a0c){var _0x13ed56={};_0x13ed56[_0x3f0a0c]={'$like':'%'+_0x42cbcf['query']['filter']+'%'};return _0x13ed56;})});}_0x3884c6=_[_0x502e('0x4e')]({},_0x3884c6,_0x42cbcf[_0x502e('0x51')]);return _0xd0d6ff[_0x502e('0x5d')](_0x3884c6);}})[_0x502e('0x1e')](function(_0xaba099){if(_0xaba099){_0x19f887=_0xaba099[_0x502e('0x47')];if(!_0x42cbcf[_0x502e('0x41')]['hasOwnProperty'](_0x502e('0x49'))){_0x3884c6[_0x502e('0x2e')]=qs[_0x502e('0x2e')](_0x42cbcf[_0x502e('0x41')][_0x502e('0x2e')]);_0x3884c6[_0x502e('0x2d')]=qs['offset'](_0x42cbcf[_0x502e('0x41')][_0x502e('0x2d')]);}return _0xd0d6ff['getDescriptions'](_0x3884c6);}})[_0x502e('0x1e')](function(_0x40109c){if(_0x40109c){return _0x40109c?{'count':_0x19f887,'rows':_0x40109c}:null;}})['then'](respondWithResult(_0x1441e9,null))['catch'](handleError(_0x1441e9,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index e4b2493..d3f1af7 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 _0xff3a=['path','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','int_sugarcrm_configurations','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x38d45a,_0x5bbe19){var _0x7ec200=function(_0x4cc18b){while(--_0x4cc18b){_0x38d45a['push'](_0x38d45a['shift']());}};_0x7ec200(++_0x5bbe19);}(_0xff3a,0x162));var _0xaff3=function(_0x4555b1,_0x2e824e){_0x4555b1=_0x4555b1-0x0;var _0xe0408b=_0xff3a[_0x4555b1];return _0xe0408b;};'use strict';var _=require(_0xaff3('0x0'));var util=require(_0xaff3('0x1'));var logger=require(_0xaff3('0x2'))(_0xaff3('0x3'));var moment=require(_0xaff3('0x4'));var BPromise=require('bluebird');var rp=require(_0xaff3('0x5'));var fs=require('fs');var path=require(_0xaff3('0x6'));var rimraf=require('rimraf');var config=require(_0xaff3('0x7'));var attributes=require(_0xaff3('0x8'));module[_0xaff3('0x9')]=function(_0x3d7262,_0x200785){return _0x3d7262[_0xaff3('0xa')]('SugarcrmConfiguration',attributes,{'tableName':_0xaff3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x97ce=['bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x48fefe,_0x341c3f){var _0x5dd63b=function(_0x1c08a9){while(--_0x1c08a9){_0x48fefe['push'](_0x48fefe['shift']());}};_0x5dd63b(++_0x341c3f);}(_0x97ce,0xaf));var _0xe97c=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x97ce[_0x7e2eb0];return _0xd92de4;};'use strict';var _=require(_0xe97c('0x0'));var util=require(_0xe97c('0x1'));var logger=require(_0xe97c('0x2'))(_0xe97c('0x3'));var moment=require(_0xe97c('0x4'));var BPromise=require(_0xe97c('0x5'));var rp=require(_0xe97c('0x6'));var fs=require('fs');var path=require(_0xe97c('0x7'));var rimraf=require(_0xe97c('0x8'));var config=require(_0xe97c('0x9'));var attributes=require(_0xe97c('0xa'));module[_0xe97c('0xb')]=function(_0x21b339,_0x1ce01b){return _0x21b339[_0xe97c('0xc')](_0xe97c('0xd'),attributes,{'tableName':_0xe97c('0xe'),'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 340dcd2..e12804a 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 _0xffed=['info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x5c12f2,_0x5de043){var _0x5e8344=function(_0x445932){while(--_0x445932){_0x5c12f2['push'](_0x5c12f2['shift']());}};_0x5e8344(++_0x5de043);}(_0xffed,0x1be));var _0xdffe=function(_0x1e1686,_0x11e07f){_0x1e1686=_0x1e1686-0x0;var _0x2e4cf6=_0xffed[_0x1e1686];return _0x2e4cf6;};'use strict';var _=require(_0xdffe('0x0'));var util=require(_0xdffe('0x1'));var moment=require(_0xdffe('0x2'));var BPromise=require(_0xdffe('0x3'));var rs=require(_0xdffe('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdffe('0x5'))['db'];var utils=require(_0xdffe('0x6'));var logger=require(_0xdffe('0x7'))('rpc');var config=require(_0xdffe('0x8'));var jayson=require(_0xdffe('0x9'));var client=jayson[_0xdffe('0xa')][_0xdffe('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf8679b,_0xcfd92f,_0x54ac6){return new BPromise(function(_0x2932b4,_0x287f21){return client[_0xdffe('0xc')](_0xf8679b,_0x54ac6)[_0xdffe('0xd')](function(_0x24df94){logger[_0xdffe('0xe')](_0xdffe('0xf'),_0xcfd92f,_0xdffe('0x10'));logger[_0xdffe('0x11')](_0xdffe('0x12'),_0xcfd92f,_0xdffe('0x10'),JSON[_0xdffe('0x13')](_0x24df94));if(_0x24df94[_0xdffe('0x14')]){if(_0x24df94[_0xdffe('0x14')][_0xdffe('0x15')]===0x1f4){logger[_0xdffe('0x14')]('SugarcrmConfiguration,\x20%s,\x20%s',_0xcfd92f,_0x24df94[_0xdffe('0x14')]['message']);return _0x287f21(_0x24df94[_0xdffe('0x14')][_0xdffe('0x16')]);}logger[_0xdffe('0x14')](_0xdffe('0xf'),_0xcfd92f,_0x24df94[_0xdffe('0x14')]['message']);return _0x2932b4(_0x24df94['error'][_0xdffe('0x16')]);}else{logger['info'](_0xdffe('0xf'),_0xcfd92f,_0xdffe('0x10'));_0x2932b4(_0x24df94['result']['message']);}})['catch'](function(_0x56ed9a){logger['error'](_0xdffe('0xf'),_0xcfd92f,_0x56ed9a);_0x287f21(_0x56ed9a);});});} \ No newline at end of file +var _0x83b5=['../../config/logger','rpc','jayson/promise','http','request','then','SugarcrmConfiguration,\x20%s,\x20%s','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x270adf,_0x1daaa3){var _0x29eda9=function(_0x40afec){while(--_0x40afec){_0x270adf['push'](_0x270adf['shift']());}};_0x29eda9(++_0x1daaa3);}(_0x83b5,0x9a));var _0x583b=function(_0x17a647,_0x2bbe12){_0x17a647=_0x17a647-0x0;var _0x219a38=_0x83b5[_0x17a647];return _0x219a38;};'use strict';var _=require(_0x583b('0x0'));var util=require(_0x583b('0x1'));var moment=require(_0x583b('0x2'));var BPromise=require('bluebird');var rs=require(_0x583b('0x3'));var fs=require('fs');var Redis=require(_0x583b('0x4'));var db=require(_0x583b('0x5'))['db'];var utils=require(_0x583b('0x6'));var logger=require(_0x583b('0x7'))(_0x583b('0x8'));var config=require('../../config/environment');var jayson=require(_0x583b('0x9'));var client=jayson['client'][_0x583b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb27209,_0x5561c5,_0x326799){return new BPromise(function(_0x1dd42e,_0x4cbb23){return client[_0x583b('0xb')](_0xb27209,_0x326799)[_0x583b('0xc')](function(_0x246c6a){logger['info'](_0x583b('0xd'),_0x5561c5,'request\x20sent');logger[_0x583b('0xe')](_0x583b('0xf'),_0x5561c5,_0x583b('0x10'),JSON[_0x583b('0x11')](_0x246c6a));if(_0x246c6a[_0x583b('0x12')]){if(_0x246c6a[_0x583b('0x12')]['code']===0x1f4){logger['error'](_0x583b('0xd'),_0x5561c5,_0x246c6a[_0x583b('0x12')][_0x583b('0x13')]);return _0x4cbb23(_0x246c6a[_0x583b('0x12')][_0x583b('0x13')]);}logger['error'](_0x583b('0xd'),_0x5561c5,_0x246c6a['error'][_0x583b('0x13')]);return _0x1dd42e(_0x246c6a['error']['message']);}else{logger[_0x583b('0x14')](_0x583b('0xd'),_0x5561c5,_0x583b('0x10'));_0x1dd42e(_0x246c6a[_0x583b('0x15')][_0x583b('0x13')]);}})[_0x583b('0x16')](function(_0x4d22e2){logger[_0x583b('0x12')](_0x583b('0xd'),_0x5561c5,_0x4d22e2);_0x4cbb23(_0x4d22e2);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 4d8a1b8..0510e4a 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 _0x046d=['show','create','put','delete','destroy','exports','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id'];(function(_0x4a1647,_0x51a7ca){var _0x429446=function(_0x3d81ed){while(--_0x3d81ed){_0x4a1647['push'](_0x4a1647['shift']());}};_0x429446(++_0x51a7ca);}(_0x046d,0xab));var _0xd046=function(_0x4ff120,_0x30ee0b){_0x4ff120=_0x4ff120-0x0;var _0x1a8437=_0x046d[_0x4ff120];return _0x1a8437;};'use strict';var multer=require('multer');var util=require(_0xd046('0x0'));var path=require('path');var timeout=require(_0xd046('0x1'));var express=require(_0xd046('0x2'));var router=express['Router']();var auth=require(_0xd046('0x3'));var interaction=require(_0xd046('0x4'));var config=require(_0xd046('0x5'));var controller=require('./intSugarcrmField.controller');router['get']('/',auth[_0xd046('0x6')](),controller[_0xd046('0x7')]);router['get'](_0xd046('0x8'),auth['isAuthenticated'](),controller[_0xd046('0x9')]);router['post']('/',auth[_0xd046('0x6')](),controller[_0xd046('0xa')]);router[_0xd046('0xb')](_0xd046('0x8'),auth[_0xd046('0x6')](),controller['update']);router[_0xd046('0xc')]('/:id',auth[_0xd046('0x6')](),controller[_0xd046('0xd')]);module[_0xd046('0xe')]=router; \ No newline at end of file +var _0x546e=['connect-timeout','express','../../components/auth/service','./intSugarcrmField.controller','get','index','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x298498,_0xd5d2ff){var _0x407fa9=function(_0x13e963){while(--_0x13e963){_0x298498['push'](_0x298498['shift']());}};_0x407fa9(++_0xd5d2ff);}(_0x546e,0x1bf));var _0xe546=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x546e[_0x47aa64];return _0x549c7a;};'use strict';var multer=require(_0xe546('0x0'));var util=require(_0xe546('0x1'));var path=require(_0xe546('0x2'));var timeout=require(_0xe546('0x3'));var express=require(_0xe546('0x4'));var router=express['Router']();var auth=require(_0xe546('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe546('0x6'));router[_0xe546('0x7')]('/',auth['isAuthenticated'](),controller[_0xe546('0x8')]);router[_0xe546('0x7')](_0xe546('0x9'),auth[_0xe546('0xa')](),controller[_0xe546('0xb')]);router['post']('/',auth[_0xe546('0xa')](),controller[_0xe546('0xc')]);router[_0xe546('0xd')](_0xe546('0x9'),auth[_0xe546('0xa')](),controller[_0xe546('0xe')]);router[_0xe546('0xf')](_0xe546('0x9'),auth[_0xe546('0xa')](),controller[_0xe546('0x10')]);module[_0xe546('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index c0e96ea..4c34485 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 _0xdbd0=['BOOLEAN','sequelize','exports','ENUM','string','variable','keyValue','STRING','customVariable'];(function(_0x4ee8c7,_0x541b4a){var _0x22bb07=function(_0x89f7e2){while(--_0x89f7e2){_0x4ee8c7['push'](_0x4ee8c7['shift']());}};_0x22bb07(++_0x541b4a);}(_0xdbd0,0x88));var _0x0dbd=function(_0xde9323,_0x5dc4af){_0xde9323=_0xde9323-0x0;var _0x1f3a32=_0xdbd0[_0xde9323];return _0x1f3a32;};'use strict';var Sequelize=require(_0x0dbd('0x0'));module[_0x0dbd('0x1')]={'type':{'type':Sequelize[_0x0dbd('0x2')](_0x0dbd('0x3'),_0x0dbd('0x4'),'customVariable',_0x0dbd('0x5')),'defaultValue':_0x0dbd('0x3')},'content':{'type':Sequelize[_0x0dbd('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x0dbd('0x2')](_0x0dbd('0x3'),_0x0dbd('0x4'),_0x0dbd('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x0dbd('0x6')]},'customField':{'type':Sequelize[_0x0dbd('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0dbd('0x6')]}}; \ No newline at end of file +var _0xb68a=['sequelize','exports','ENUM','variable','customVariable','STRING','string','BOOLEAN'];(function(_0x3a636b,_0x54564c){var _0x2346c8=function(_0xbe1414){while(--_0xbe1414){_0x3a636b['push'](_0x3a636b['shift']());}};_0x2346c8(++_0x54564c);}(_0xb68a,0x1a8));var _0xab68=function(_0x126f47,_0x2199e9){_0x126f47=_0x126f47-0x0;var _0x49508a=_0xb68a[_0x126f47];return _0x49508a;};'use strict';var Sequelize=require(_0xab68('0x0'));module[_0xab68('0x1')]={'type':{'type':Sequelize[_0xab68('0x2')]('string',_0xab68('0x3'),_0xab68('0x4'),'keyValue'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xab68('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0xab68('0x6'),_0xab68('0x3'),_0xab68('0x4'))},'keyContent':{'type':Sequelize[_0xab68('0x5')]},'idField':{'type':Sequelize[_0xab68('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xab68('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 0d52764..4dec945 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 _0xc34f=['fields','length','nolimit','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','destroy','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','sendStatus','stack','name','send','index','map','SugarcrmField','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes'];(function(_0x499e98,_0x5bc814){var _0x3e437f=function(_0xe21ce){while(--_0xe21ce){_0x499e98['push'](_0x499e98['shift']());}};_0x3e437f(++_0x5bc814);}(_0xc34f,0x1c4));var _0xfc34=function(_0x34f9dd,_0x1f8f12){_0x34f9dd=_0x34f9dd-0x0;var _0x2439b5=_0xc34f[_0x34f9dd];return _0x2439b5;};'use strict';var pdf=require(_0xfc34('0x0'));var emlformat=require(_0xfc34('0x1'));var rimraf=require(_0xfc34('0x2'));var zipdir=require(_0xfc34('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfc34('0x4'));var moment=require(_0xfc34('0x5'));var BPromise=require(_0xfc34('0x6'));var Mustache=require(_0xfc34('0x7'));var util=require(_0xfc34('0x8'));var path=require(_0xfc34('0x9'));var sox=require(_0xfc34('0xa'));var csv=require(_0xfc34('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xfc34('0xc'));var squel=require(_0xfc34('0xd'));var crypto=require(_0xfc34('0xe'));var jsforce=require(_0xfc34('0xf'));var deskjs=require(_0xfc34('0x10'));var toCsv=require(_0xfc34('0xb'));var querystring=require(_0xfc34('0x11'));var Papa=require(_0xfc34('0x12'));var Redis=require(_0xfc34('0x13'));var authService=require(_0xfc34('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xfc34('0x15'));var hardwareService=require(_0xfc34('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xfc34('0x17'));var db=require(_0xfc34('0x18'))['db'];function respondWithStatusCode(_0x126525,_0x26289){_0x26289=_0x26289||0xcc;return function(_0x10a558){if(_0x10a558){return _0x126525['sendStatus'](_0x26289);}return _0x126525[_0xfc34('0x19')](_0x26289)[_0xfc34('0x1a')]();};}function respondWithResult(_0x451e23,_0x4b1359){_0x4b1359=_0x4b1359||0xc8;return function(_0x2a4ad1){if(_0x2a4ad1){return _0x451e23[_0xfc34('0x19')](_0x4b1359)[_0xfc34('0x1b')](_0x2a4ad1);}};}function respondWithFilteredResult(_0x16849f,_0x5cce73){return function(_0x1ba2fe){if(_0x1ba2fe){var _0x4cea77=_0x1ba2fe[_0xfc34('0x1c')],_0x5e8eb9=_0x5cce73[_0xfc34('0x1d')],_0x262969=_0x5cce73[_0xfc34('0x1d')]+_0x5cce73[_0xfc34('0x1e')],_0x42fdb2;if(_0x262969>=_0x4cea77){_0x262969=_0x4cea77;_0x42fdb2=0xc8;}else{_0x42fdb2=0xce;}_0x16849f[_0xfc34('0x19')](_0x42fdb2);return _0x16849f['set'](_0xfc34('0x1f'),_0x5e8eb9+'-'+_0x262969+'/'+_0x4cea77)[_0xfc34('0x1b')](_0x1ba2fe);}return null;};}function patchUpdates(_0x5efe59){return function(_0x5f3dae){try{jsonpatch[_0xfc34('0x20')](_0x5f3dae,_0x5efe59,!![]);}catch(_0x1f3dba){return BPromise[_0xfc34('0x21')](_0x1f3dba);}return _0x5f3dae[_0xfc34('0x22')]();};}function saveUpdates(_0x44da01,_0x427485){return function(_0x1fd9b5){if(_0x1fd9b5){return _0x1fd9b5[_0xfc34('0x23')](_0x44da01)[_0xfc34('0x24')](function(_0xf965f4){return _0xf965f4;});}return null;};}function removeEntity(_0x120b7c,_0x4bc324){return function(_0x3d2090){if(_0x3d2090){return _0x3d2090['destroy']()['then'](function(){_0x120b7c['status'](0xcc)[_0xfc34('0x1a')]();});}};}function handleEntityNotFound(_0x50884e,_0x373d5b){return function(_0x1c436a){if(!_0x1c436a){_0x50884e[_0xfc34('0x25')](0x194);}return _0x1c436a;};}function handleError(_0x2415b9,_0x56d8bf){_0x56d8bf=_0x56d8bf||0x1f4;return function(_0x23c0e9){logger['error'](_0x23c0e9[_0xfc34('0x26')]);if(_0x23c0e9['name']){delete _0x23c0e9[_0xfc34('0x27')];}_0x2415b9[_0xfc34('0x19')](_0x56d8bf)[_0xfc34('0x28')](_0x23c0e9);};}exports[_0xfc34('0x29')]=function(_0x40862e,_0x1e2d81){var _0x29eece={},_0x310a33={},_0x19311d={'count':0x0,'rows':[]};var _0x5ea0ae=_[_0xfc34('0x2a')](db[_0xfc34('0x2b')][_0xfc34('0x2c')],function(_0x595b62){return{'name':_0x595b62[_0xfc34('0x2d')],'type':_0x595b62['type']['key']};});_0x310a33[_0xfc34('0x2e')]=_[_0xfc34('0x2a')](_0x5ea0ae,_0xfc34('0x27'));_0x310a33[_0xfc34('0x2f')]=_[_0xfc34('0x30')](_0x40862e[_0xfc34('0x2f')]);_0x310a33[_0xfc34('0x31')]=_[_0xfc34('0x32')](_0x310a33[_0xfc34('0x2e')],_0x310a33['query']);_0x29eece[_0xfc34('0x33')]=_[_0xfc34('0x32')](_0x310a33['model'],qs[_0xfc34('0x34')](_0x40862e['query'][_0xfc34('0x34')]));_0x29eece[_0xfc34('0x33')]=_0x29eece[_0xfc34('0x33')][_0xfc34('0x35')]?_0x29eece['attributes']:_0x310a33['model'];if(!_0x40862e[_0xfc34('0x2f')]['hasOwnProperty'](_0xfc34('0x36'))){_0x29eece[_0xfc34('0x1e')]=qs[_0xfc34('0x1e')](_0x40862e[_0xfc34('0x2f')][_0xfc34('0x1e')]);_0x29eece['offset']=qs[_0xfc34('0x1d')](_0x40862e[_0xfc34('0x2f')][_0xfc34('0x1d')]);}_0x29eece['order']=qs[_0xfc34('0x37')](_0x40862e[_0xfc34('0x2f')]['sort']);_0x29eece['where']=qs['filters'](_[_0xfc34('0x38')](_0x40862e['query'],_0x310a33['filters']));if(_0x40862e['query'][_0xfc34('0x39')]){_0x29eece[_0xfc34('0x3a')]=_[_0xfc34('0x3b')](_0x29eece[_0xfc34('0x3a')],{'$or':_['map'](_0x5ea0ae,function(_0x3f7580){if(_0x3f7580[_0xfc34('0x3c')]!==_0xfc34('0x3d')){var _0x4927a3={};_0x4927a3[_0x3f7580[_0xfc34('0x27')]]={'$like':'%'+_0x40862e[_0xfc34('0x2f')]['filter']+'%'};return _0x4927a3;}})});}_0x29eece=_[_0xfc34('0x3b')]({},_0x29eece,_0x40862e[_0xfc34('0x3e')]);var _0x36457d={'where':_0x29eece[_0xfc34('0x3a')]};return db[_0xfc34('0x2b')][_0xfc34('0x1c')](_0x36457d)[_0xfc34('0x24')](function(_0xac8982){_0x19311d[_0xfc34('0x1c')]=_0xac8982;if(_0x40862e[_0xfc34('0x2f')][_0xfc34('0x3f')]){_0x29eece[_0xfc34('0x40')]=[{'all':!![]}];}return db['SugarcrmField']['findAll'](_0x29eece);})[_0xfc34('0x24')](function(_0x2d576e){_0x19311d['rows']=_0x2d576e;return _0x19311d;})[_0xfc34('0x24')](respondWithFilteredResult(_0x1e2d81,_0x29eece))[_0xfc34('0x41')](handleError(_0x1e2d81,null));};exports[_0xfc34('0x42')]=function(_0x2bb3e7,_0x4ba6ba){var _0x5074a4={'raw':!![],'where':{'id':_0x2bb3e7[_0xfc34('0x43')]['id']}},_0x120190={};_0x120190['model']=_[_0xfc34('0x30')](db['SugarcrmField'][_0xfc34('0x2c')]);_0x120190['query']=_[_0xfc34('0x30')](_0x2bb3e7[_0xfc34('0x2f')]);_0x120190[_0xfc34('0x31')]=_[_0xfc34('0x32')](_0x120190['model'],_0x120190[_0xfc34('0x2f')]);_0x5074a4['attributes']=_[_0xfc34('0x32')](_0x120190[_0xfc34('0x2e')],qs['fields'](_0x2bb3e7[_0xfc34('0x2f')][_0xfc34('0x34')]));_0x5074a4[_0xfc34('0x33')]=_0x5074a4[_0xfc34('0x33')][_0xfc34('0x35')]?_0x5074a4['attributes']:_0x120190[_0xfc34('0x2e')];if(_0x2bb3e7['query'][_0xfc34('0x3f')]){_0x5074a4[_0xfc34('0x40')]=[{'all':!![]}];}_0x5074a4=_['merge']({},_0x5074a4,_0x2bb3e7['options']);return db[_0xfc34('0x2b')][_0xfc34('0x44')](_0x5074a4)[_0xfc34('0x24')](handleEntityNotFound(_0x4ba6ba,null))[_0xfc34('0x24')](respondWithResult(_0x4ba6ba,null))[_0xfc34('0x41')](handleError(_0x4ba6ba,null));};exports[_0xfc34('0x45')]=function(_0x3b81ce,_0x4c2178){return db[_0xfc34('0x2b')]['create'](_0x3b81ce[_0xfc34('0x46')],{})[_0xfc34('0x24')](respondWithResult(_0x4c2178,0xc9))[_0xfc34('0x41')](handleError(_0x4c2178,null));};exports[_0xfc34('0x23')]=function(_0x276cb9,_0x2ac94f){if(_0x276cb9['body']['id']){delete _0x276cb9['body']['id'];}return db[_0xfc34('0x2b')][_0xfc34('0x44')]({'where':{'id':_0x276cb9[_0xfc34('0x43')]['id']}})[_0xfc34('0x24')](handleEntityNotFound(_0x2ac94f,null))[_0xfc34('0x24')](saveUpdates(_0x276cb9[_0xfc34('0x46')],null))[_0xfc34('0x24')](respondWithResult(_0x2ac94f,null))[_0xfc34('0x41')](handleError(_0x2ac94f,null));};exports[_0xfc34('0x47')]=function(_0x36a452,_0x1077dd){return db[_0xfc34('0x2b')][_0xfc34('0x44')]({'where':{'id':_0x36a452['params']['id']}})['then'](handleEntityNotFound(_0x1077dd,null))[_0xfc34('0x24')](removeEntity(_0x1077dd,null))[_0xfc34('0x41')](handleError(_0x1077dd,null));}; \ No newline at end of file +var _0xc113=['findAll','catch','show','params','rawAttributes','find','create','body','rimraf','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','json','count','offset','limit','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','SugarcrmField','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include'];(function(_0x5ae8f7,_0x330d91){var _0x54c636=function(_0x173188){while(--_0x173188){_0x5ae8f7['push'](_0x5ae8f7['shift']());}};_0x54c636(++_0x330d91);}(_0xc113,0x1a0));var _0x3c11=function(_0x49f251,_0x6eaeca){_0x49f251=_0x49f251-0x0;var _0x300130=_0xc113[_0x49f251];return _0x300130;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x3c11('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3c11('0x1'));var moment=require(_0x3c11('0x2'));var BPromise=require(_0x3c11('0x3'));var Mustache=require('mustache');var util=require(_0x3c11('0x4'));var path=require('path');var sox=require(_0x3c11('0x5'));var csv=require(_0x3c11('0x6'));var ejs=require(_0x3c11('0x7'));var fs=require('fs');var _=require(_0x3c11('0x8'));var squel=require('squel');var crypto=require(_0x3c11('0x9'));var jsforce=require(_0x3c11('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x3c11('0x6'));var querystring=require(_0x3c11('0xb'));var Papa=require(_0x3c11('0xc'));var Redis=require(_0x3c11('0xd'));var authService=require(_0x3c11('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3c11('0xf'));var logger=require(_0x3c11('0x10'))(_0x3c11('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x3c11('0x12'))['db'];function respondWithStatusCode(_0x32f7ca,_0x5e0277){_0x5e0277=_0x5e0277||0xcc;return function(_0x4e5405){if(_0x4e5405){return _0x32f7ca[_0x3c11('0x13')](_0x5e0277);}return _0x32f7ca[_0x3c11('0x14')](_0x5e0277)['end']();};}function respondWithResult(_0x172a10,_0x42f7f){_0x42f7f=_0x42f7f||0xc8;return function(_0x53894c){if(_0x53894c){return _0x172a10[_0x3c11('0x14')](_0x42f7f)[_0x3c11('0x15')](_0x53894c);}};}function respondWithFilteredResult(_0x4e8d6c,_0x37fd37){return function(_0x584d07){if(_0x584d07){var _0x3002e8=_0x584d07[_0x3c11('0x16')],_0x46a82d=_0x37fd37['offset'],_0x371637=_0x37fd37[_0x3c11('0x17')]+_0x37fd37[_0x3c11('0x18')],_0xaf1e06;if(_0x371637>=_0x3002e8){_0x371637=_0x3002e8;_0xaf1e06=0xc8;}else{_0xaf1e06=0xce;}_0x4e8d6c[_0x3c11('0x14')](_0xaf1e06);return _0x4e8d6c['set']('Content-Range',_0x46a82d+'-'+_0x371637+'/'+_0x3002e8)[_0x3c11('0x15')](_0x584d07);}return null;};}function patchUpdates(_0xbed5ea){return function(_0x172fee){try{jsonpatch[_0x3c11('0x19')](_0x172fee,_0xbed5ea,!![]);}catch(_0xe7766c){return BPromise[_0x3c11('0x1a')](_0xe7766c);}return _0x172fee[_0x3c11('0x1b')]();};}function saveUpdates(_0x4ae1ce,_0x1084f3){return function(_0xe0fded){if(_0xe0fded){return _0xe0fded[_0x3c11('0x1c')](_0x4ae1ce)[_0x3c11('0x1d')](function(_0x2cb8bc){return _0x2cb8bc;});}return null;};}function removeEntity(_0x45863f,_0x2f48e1){return function(_0x413248){if(_0x413248){return _0x413248[_0x3c11('0x1e')]()[_0x3c11('0x1d')](function(){_0x45863f['status'](0xcc)[_0x3c11('0x1f')]();});}};}function handleEntityNotFound(_0x365cba,_0x4134d4){return function(_0x308596){if(!_0x308596){_0x365cba[_0x3c11('0x13')](0x194);}return _0x308596;};}function handleError(_0x28293b,_0xb9ec60){_0xb9ec60=_0xb9ec60||0x1f4;return function(_0x58f5ec){logger[_0x3c11('0x20')](_0x58f5ec[_0x3c11('0x21')]);if(_0x58f5ec[_0x3c11('0x22')]){delete _0x58f5ec[_0x3c11('0x22')];}_0x28293b[_0x3c11('0x14')](_0xb9ec60)[_0x3c11('0x23')](_0x58f5ec);};}exports['index']=function(_0x462423,_0x4a51ae){var _0x57aeea={},_0x1d8849={},_0x36a89a={'count':0x0,'rows':[]};var _0x22c4ec=_[_0x3c11('0x24')](db[_0x3c11('0x25')]['rawAttributes'],function(_0x35bfa6){return{'name':_0x35bfa6[_0x3c11('0x26')],'type':_0x35bfa6[_0x3c11('0x27')][_0x3c11('0x28')]};});_0x1d8849['model']=_[_0x3c11('0x24')](_0x22c4ec,_0x3c11('0x22'));_0x1d8849[_0x3c11('0x29')]=_[_0x3c11('0x2a')](_0x462423[_0x3c11('0x29')]);_0x1d8849[_0x3c11('0x2b')]=_[_0x3c11('0x2c')](_0x1d8849[_0x3c11('0x2d')],_0x1d8849['query']);_0x57aeea['attributes']=_[_0x3c11('0x2c')](_0x1d8849[_0x3c11('0x2d')],qs[_0x3c11('0x2e')](_0x462423['query'][_0x3c11('0x2e')]));_0x57aeea[_0x3c11('0x2f')]=_0x57aeea[_0x3c11('0x2f')][_0x3c11('0x30')]?_0x57aeea[_0x3c11('0x2f')]:_0x1d8849[_0x3c11('0x2d')];if(!_0x462423[_0x3c11('0x29')][_0x3c11('0x31')](_0x3c11('0x32'))){_0x57aeea[_0x3c11('0x18')]=qs[_0x3c11('0x18')](_0x462423[_0x3c11('0x29')]['limit']);_0x57aeea['offset']=qs[_0x3c11('0x17')](_0x462423[_0x3c11('0x29')]['offset']);}_0x57aeea['order']=qs[_0x3c11('0x33')](_0x462423[_0x3c11('0x29')]['sort']);_0x57aeea['where']=qs[_0x3c11('0x2b')](_[_0x3c11('0x34')](_0x462423[_0x3c11('0x29')],_0x1d8849[_0x3c11('0x2b')]));if(_0x462423[_0x3c11('0x29')][_0x3c11('0x35')]){_0x57aeea[_0x3c11('0x36')]=_[_0x3c11('0x37')](_0x57aeea[_0x3c11('0x36')],{'$or':_[_0x3c11('0x24')](_0x22c4ec,function(_0x31ed1e){if(_0x31ed1e['type']!==_0x3c11('0x38')){var _0xd4fd44={};_0xd4fd44[_0x31ed1e[_0x3c11('0x22')]]={'$like':'%'+_0x462423[_0x3c11('0x29')][_0x3c11('0x35')]+'%'};return _0xd4fd44;}})});}_0x57aeea=_[_0x3c11('0x37')]({},_0x57aeea,_0x462423[_0x3c11('0x39')]);var _0x443926={'where':_0x57aeea['where']};return db[_0x3c11('0x25')][_0x3c11('0x16')](_0x443926)['then'](function(_0x58c917){_0x36a89a[_0x3c11('0x16')]=_0x58c917;if(_0x462423[_0x3c11('0x29')][_0x3c11('0x3a')]){_0x57aeea[_0x3c11('0x3b')]=[{'all':!![]}];}return db[_0x3c11('0x25')][_0x3c11('0x3c')](_0x57aeea);})['then'](function(_0x24ce4f){_0x36a89a['rows']=_0x24ce4f;return _0x36a89a;})[_0x3c11('0x1d')](respondWithFilteredResult(_0x4a51ae,_0x57aeea))[_0x3c11('0x3d')](handleError(_0x4a51ae,null));};exports[_0x3c11('0x3e')]=function(_0x321b09,_0x32e434){var _0x299c30={'raw':!![],'where':{'id':_0x321b09[_0x3c11('0x3f')]['id']}},_0x50d203={};_0x50d203[_0x3c11('0x2d')]=_['keys'](db[_0x3c11('0x25')][_0x3c11('0x40')]);_0x50d203[_0x3c11('0x29')]=_['keys'](_0x321b09[_0x3c11('0x29')]);_0x50d203[_0x3c11('0x2b')]=_[_0x3c11('0x2c')](_0x50d203[_0x3c11('0x2d')],_0x50d203['query']);_0x299c30[_0x3c11('0x2f')]=_['intersection'](_0x50d203[_0x3c11('0x2d')],qs[_0x3c11('0x2e')](_0x321b09['query'][_0x3c11('0x2e')]));_0x299c30['attributes']=_0x299c30[_0x3c11('0x2f')][_0x3c11('0x30')]?_0x299c30[_0x3c11('0x2f')]:_0x50d203[_0x3c11('0x2d')];if(_0x321b09[_0x3c11('0x29')][_0x3c11('0x3a')]){_0x299c30[_0x3c11('0x3b')]=[{'all':!![]}];}_0x299c30=_[_0x3c11('0x37')]({},_0x299c30,_0x321b09[_0x3c11('0x39')]);return db[_0x3c11('0x25')][_0x3c11('0x41')](_0x299c30)[_0x3c11('0x1d')](handleEntityNotFound(_0x32e434,null))[_0x3c11('0x1d')](respondWithResult(_0x32e434,null))[_0x3c11('0x3d')](handleError(_0x32e434,null));};exports[_0x3c11('0x42')]=function(_0x52793d,_0x429324){return db['SugarcrmField'][_0x3c11('0x42')](_0x52793d['body'],{})[_0x3c11('0x1d')](respondWithResult(_0x429324,0xc9))[_0x3c11('0x3d')](handleError(_0x429324,null));};exports[_0x3c11('0x1c')]=function(_0x244a97,_0x292c98){if(_0x244a97[_0x3c11('0x43')]['id']){delete _0x244a97['body']['id'];}return db[_0x3c11('0x25')][_0x3c11('0x41')]({'where':{'id':_0x244a97[_0x3c11('0x3f')]['id']}})[_0x3c11('0x1d')](handleEntityNotFound(_0x292c98,null))[_0x3c11('0x1d')](saveUpdates(_0x244a97['body'],null))['then'](respondWithResult(_0x292c98,null))[_0x3c11('0x3d')](handleError(_0x292c98,null));};exports[_0x3c11('0x1e')]=function(_0x594078,_0x381069){return db[_0x3c11('0x25')][_0x3c11('0x41')]({'where':{'id':_0x594078['params']['id']}})[_0x3c11('0x1d')](handleEntityNotFound(_0x381069,null))[_0x3c11('0x1d')](removeEntity(_0x381069,null))[_0x3c11('0x3d')](handleError(_0x381069,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 0f81525..4b3371c 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 _0xba19=['../../config/environment','./intSugarcrmField.attributes','int_sugarcrm_fields','sugarcrm_unique_index','FieldId','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x6a78d2,_0x47161d){var _0x3ebddd=function(_0x445be6){while(--_0x445be6){_0x6a78d2['push'](_0x6a78d2['shift']());}};_0x3ebddd(++_0x47161d);}(_0xba19,0x123));var _0x9ba1=function(_0x2efce3,_0x3a9f59){_0x2efce3=_0x2efce3-0x0;var _0x12b0e7=_0xba19[_0x2efce3];return _0x12b0e7;};'use strict';var _=require('lodash');var util=require(_0x9ba1('0x0'));var logger=require(_0x9ba1('0x1'))(_0x9ba1('0x2'));var moment=require(_0x9ba1('0x3'));var BPromise=require(_0x9ba1('0x4'));var rp=require(_0x9ba1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9ba1('0x6'));var attributes=require(_0x9ba1('0x7'));module['exports']=function(_0x528a59,_0x22c8d4){return _0x528a59['define']('SugarcrmField',attributes,{'tableName':_0x9ba1('0x8'),'paranoid':![],'indexes':[{'name':_0x9ba1('0x9'),'fields':['idField',_0x9ba1('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7074=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','idField','FieldId','lodash','util','../../config/logger'];(function(_0x4de11b,_0x583472){var _0x371743=function(_0x1b8ba5){while(--_0x1b8ba5){_0x4de11b['push'](_0x4de11b['shift']());}};_0x371743(++_0x583472);}(_0x7074,0x8d));var _0x4707=function(_0x4f2690,_0x17e5e8){_0x4f2690=_0x4f2690-0x0;var _0x2d0bc0=_0x7074[_0x4f2690];return _0x2d0bc0;};'use strict';var _=require(_0x4707('0x0'));var util=require(_0x4707('0x1'));var logger=require(_0x4707('0x2'))('api');var moment=require(_0x4707('0x3'));var BPromise=require(_0x4707('0x4'));var rp=require(_0x4707('0x5'));var fs=require('fs');var path=require(_0x4707('0x6'));var rimraf=require(_0x4707('0x7'));var config=require(_0x4707('0x8'));var attributes=require(_0x4707('0x9'));module[_0x4707('0xa')]=function(_0x19c055,_0x2bcbcf){return _0x19c055[_0x4707('0xb')](_0x4707('0xc'),attributes,{'tableName':_0x4707('0xd'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x4707('0xe'),_0x4707('0xf')],'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 9f15c12..f0a0763 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 _0x0b0e=['SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','debug'];(function(_0x3d2012,_0x3d02b9){var _0x53d542=function(_0x8f2be8){while(--_0x8f2be8){_0x3d2012['push'](_0x3d2012['shift']());}};_0x53d542(++_0x3d02b9);}(_0x0b0e,0x187));var _0xe0b0=function(_0x229f5e,_0x433f0f){_0x229f5e=_0x229f5e-0x0;var _0x2d62ff=_0x0b0e[_0x229f5e];return _0x2d62ff;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var Redis=require(_0xe0b0('0x3'));var db=require(_0xe0b0('0x4'))['db'];var utils=require(_0xe0b0('0x5'));var logger=require(_0xe0b0('0x6'))(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var jayson=require(_0xe0b0('0x9'));var client=jayson[_0xe0b0('0xa')][_0xe0b0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x219b1c,_0x5cf9cc,_0x50be7f){return new BPromise(function(_0x11effc,_0x435060){return client[_0xe0b0('0xc')](_0x219b1c,_0x50be7f)[_0xe0b0('0xd')](function(_0x4c24f9){logger[_0xe0b0('0xe')](_0xe0b0('0xf'),_0x5cf9cc,'request\x20sent');logger[_0xe0b0('0x10')](_0xe0b0('0x11'),_0x5cf9cc,'request\x20sent',JSON[_0xe0b0('0x12')](_0x4c24f9));if(_0x4c24f9[_0xe0b0('0x13')]){if(_0x4c24f9[_0xe0b0('0x13')]['code']===0x1f4){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x435060(_0x4c24f9[_0xe0b0('0x13')]['message']);}logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x11effc(_0x4c24f9[_0xe0b0('0x13')]['message']);}else{logger[_0xe0b0('0xe')]('SugarcrmField,\x20%s,\x20%s',_0x5cf9cc,_0xe0b0('0x15'));_0x11effc(_0x4c24f9[_0xe0b0('0x16')]['message']);}})[_0xe0b0('0x17')](function(_0x4a4cc0){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4a4cc0);_0x435060(_0x4a4cc0);});});} \ No newline at end of file +var _0xbaf0=['client','http','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xbaf0[_0x5ddb1c];return _0x354adc;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var BPromise=require(_0x0baf('0x2'));var rs=require(_0x0baf('0x3'));var fs=require('fs');var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));var config=require(_0x0baf('0x8'));var jayson=require(_0x0baf('0x9'));var client=jayson[_0x0baf('0xa')][_0x0baf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){return client['request'](_0x1a10b1,_0x1d0a0d)[_0x0baf('0xc')](function(_0x2c7442){logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,_0x0baf('0xf'));logger[_0x0baf('0x10')](_0x0baf('0x11'),_0x2dcaac,_0x0baf('0xf'),JSON[_0x0baf('0x12')](_0x2c7442));if(_0x2c7442[_0x0baf('0x13')]){if(_0x2c7442[_0x0baf('0x13')]['code']===0x1f4){logger['error'](_0x0baf('0xe'),_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x11b947(_0x2c7442[_0x0baf('0x13')]['message']);}logger[_0x0baf('0x13')]('SugarcrmField,\x20%s,\x20%s',_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x5f5030(_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);}else{logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,'request\x20sent');_0x5f5030(_0x2c7442['result'][_0x0baf('0x14')]);}})[_0x0baf('0x15')](function(_0x283408){logger[_0x0baf('0x13')](_0x0baf('0xe'),_0x2dcaac,_0x283408);_0x11b947(_0x283408);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 5834ee9..10786df 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 _0xf892=['show','/:id/configurations','getConfigurations','getFields','post','addConfiguration','put','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','./intVtigerAccount.controller','get','isAuthenticated','index','/:id'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0xf892,0x1ee));var _0x2f89=function(_0x1df7b8,_0x2fe5e5){_0x1df7b8=_0x1df7b8-0x0;var _0x29d911=_0xf892[_0x1df7b8];return _0x29d911;};'use strict';var multer=require(_0x2f89('0x0'));var util=require('util');var path=require(_0x2f89('0x1'));var timeout=require('connect-timeout');var express=require(_0x2f89('0x2'));var router=express[_0x2f89('0x3')]();var auth=require(_0x2f89('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2f89('0x5'));router[_0x2f89('0x6')]('/',auth[_0x2f89('0x7')](),controller[_0x2f89('0x8')]);router['get'](_0x2f89('0x9'),auth[_0x2f89('0x7')](),controller[_0x2f89('0xa')]);router[_0x2f89('0x6')](_0x2f89('0xb'),auth[_0x2f89('0x7')](),controller[_0x2f89('0xc')]);router['get']('/:id/fields',auth[_0x2f89('0x7')](),controller[_0x2f89('0xd')]);router[_0x2f89('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2f89('0xe')](_0x2f89('0xb'),auth['isAuthenticated'](),controller[_0x2f89('0xf')]);router[_0x2f89('0x10')](_0x2f89('0x9'),auth[_0x2f89('0x7')](),controller[_0x2f89('0x11')]);router[_0x2f89('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x2f89('0x13')]);module[_0x2f89('0x14')]=router; \ No newline at end of file +var _0x872d=['Router','../../components/auth/service','../../components/interaction/service','./intVtigerAccount.controller','get','show','/:id/configurations','isAuthenticated','getConfigurations','getFields','create','post','addConfiguration','/:id','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x15aa83,_0x25f0da){var _0x13a7d1=function(_0x52b56a){while(--_0x52b56a){_0x15aa83['push'](_0x15aa83['shift']());}};_0x13a7d1(++_0x25f0da);}(_0x872d,0x145));var _0xd872=function(_0x7d8d2a,_0x2a7061){_0x7d8d2a=_0x7d8d2a-0x0;var _0x31a55c=_0x872d[_0x7d8d2a];return _0x31a55c;};'use strict';var multer=require(_0xd872('0x0'));var util=require(_0xd872('0x1'));var path=require(_0xd872('0x2'));var timeout=require(_0xd872('0x3'));var express=require(_0xd872('0x4'));var router=express[_0xd872('0x5')]();var auth=require(_0xd872('0x6'));var interaction=require(_0xd872('0x7'));var config=require('../../config/environment');var controller=require(_0xd872('0x8'));router[_0xd872('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd872('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xd872('0xa')]);router[_0xd872('0x9')](_0xd872('0xb'),auth[_0xd872('0xc')](),controller[_0xd872('0xd')]);router[_0xd872('0x9')]('/:id/fields',auth[_0xd872('0xc')](),controller[_0xd872('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd872('0xf')]);router[_0xd872('0x10')](_0xd872('0xb'),auth[_0xd872('0xc')](),controller[_0xd872('0x11')]);router['put'](_0xd872('0x12'),auth[_0xd872('0xc')](),controller[_0xd872('0x13')]);router[_0xd872('0x14')](_0xd872('0x12'),auth['isAuthenticated'](),controller[_0xd872('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 0ffb1be..7e1af57 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 _0x2b22=['STRING','HelpDesk','sequelize','exports'];(function(_0x268635,_0x2c7948){var _0xcb6dcc=function(_0x557eaa){while(--_0x557eaa){_0x268635['push'](_0x268635['shift']());}};_0xcb6dcc(++_0x2c7948);}(_0x2b22,0x72));var _0x22b2=function(_0x485ec4,_0x31d5e4){_0x485ec4=_0x485ec4-0x0;var _0x297566=_0x2b22[_0x485ec4];return _0x297566;};'use strict';var Sequelize=require(_0x22b2('0x0'));module[_0x22b2('0x1')]={'name':{'type':Sequelize[_0x22b2('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x22b2('0x2')]},'username':{'type':Sequelize[_0x22b2('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x22b2('0x2')],'allowNull':![],'defaultValue':_0x22b2('0x3')},'remoteUri':{'type':Sequelize[_0x22b2('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x22b2('0x2')]},'accessKey':{'type':Sequelize[_0x22b2('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x95f8=['HelpDesk','STRING'];(function(_0x29d6e6,_0x264220){var _0xc75ff0=function(_0x214f6b){while(--_0x214f6b){_0x29d6e6['push'](_0x29d6e6['shift']());}};_0xc75ff0(++_0x264220);}(_0x95f8,0x87));var _0x895f=function(_0x387a48,_0xccda24){_0x387a48=_0x387a48-0x0;var _0x54b1ae=_0x95f8[_0x387a48];return _0x54b1ae;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x895f('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x895f('0x0')]},'username':{'type':Sequelize[_0x895f('0x0')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x895f('0x0')],'allowNull':![],'defaultValue':_0x895f('0x1')},'remoteUri':{'type':Sequelize[_0x895f('0x0')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x895f('0x0')]},'accessKey':{'type':Sequelize[_0x895f('0x0')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index f70dcef..d3c100b 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 _0x22b9=['statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','ValidationError','request','info','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','filter','include','findAll','rows','show','params','includeAll','options','find','create','body','getConfigurations','findOne','VtigerConfiguration','pick','nolimit','addConfiguration','AccountId','channel','getDescriptions','VtigerField','Subjects','Descriptions','md5','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','lastIndexOf','format','%s/webservice.php','GET','getchallenge','success','login','token','describe','sessionName','autogenerated','reference','owner','remove','includes','label','startsWith','cf_','picklist','picklistValues','log','vTiger\x20error:\x20'];(function(_0x4694e3,_0x2177da){var _0x3c801b=function(_0x274a29){while(--_0x274a29){_0x4694e3['push'](_0x4694e3['shift']());}};_0x3c801b(++_0x2177da);}(_0x22b9,0x8c));var _0x922b=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x22b9[_0x36eaaa];return _0x461349;};'use strict';var pdf=require(_0x922b('0x0'));var emlformat=require(_0x922b('0x1'));var rimraf=require(_0x922b('0x2'));var zipdir=require(_0x922b('0x3'));var jsonpatch=require(_0x922b('0x4'));var rp=require(_0x922b('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x922b('0x6'));var util=require('util');var path=require(_0x922b('0x7'));var sox=require(_0x922b('0x8'));var csv=require(_0x922b('0x9'));var ejs=require(_0x922b('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x922b('0xb'));var crypto=require('crypto');var jsforce=require(_0x922b('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x922b('0x9'));var querystring=require(_0x922b('0xd'));var Papa=require(_0x922b('0xe'));var Redis=require(_0x922b('0xf'));var authService=require(_0x922b('0x10'));var qs=require(_0x922b('0x11'));var as=require(_0x922b('0x12'));var hardwareService=require(_0x922b('0x13'));var logger=require(_0x922b('0x14'))(_0x922b('0x15'));var utils=require(_0x922b('0x16'));var config=require(_0x922b('0x17'));var db=require(_0x922b('0x18'))['db'];var integrations=require(_0x922b('0x19'));var jayson=require(_0x922b('0x1a'));var client=jayson[_0x922b('0x1b')][_0x922b('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x56ac4f,_0x23b81d,_0x7e7cb5){if(_0x7e7cb5){var _0x42bfe6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x42bfe6[_0x922b('0x1d')](_0x23b81d)){return _0x56ac4f;}else{throw new db[(_0x922b('0x1e'))][(_0x922b('0x1f'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x56ac4f;}}function respondWithRpcPromise(_0x2c56c3,_0x53c836,_0x479f27,_0x24b43b){return new BPromise(function(_0x46b41e,_0x41ff49){var _0x27878d=_0x24b43b||client;return _0x27878d[_0x922b('0x20')](_0x2c56c3,_0x479f27)['then'](function(_0x347617){logger[_0x922b('0x21')]('VtigerAccount,\x20%s,\x20%s',_0x53c836,_0x922b('0x22'));logger[_0x922b('0x23')](_0x922b('0x24'),_0x53c836,_0x922b('0x22'),JSON[_0x922b('0x25')](_0x347617));if(_0x347617[_0x922b('0x26')]){if(_0x347617[_0x922b('0x26')][_0x922b('0x27')]===0x1f4){logger[_0x922b('0x26')](_0x922b('0x28'),_0x53c836,_0x347617['error'][_0x922b('0x29')]);return _0x41ff49(_0x347617[_0x922b('0x26')][_0x922b('0x29')]);}logger[_0x922b('0x26')](_0x922b('0x28'),_0x53c836,_0x347617['error'][_0x922b('0x29')]);return _0x46b41e(_0x347617[_0x922b('0x26')][_0x922b('0x29')]);}else{logger[_0x922b('0x21')]('VtigerAccount,\x20%s,\x20%s',_0x53c836,_0x922b('0x22'));_0x46b41e(_0x347617[_0x922b('0x2a')][_0x922b('0x29')]);}})[_0x922b('0x2b')](function(_0xbc4dff){logger[_0x922b('0x26')](_0x922b('0x28'),_0x53c836,_0xbc4dff);_0x41ff49(_0xbc4dff);});});}function respondWithStatusCode(_0x33e776,_0x478a9f){_0x478a9f=_0x478a9f||0xcc;return function(_0x2b15e6){if(_0x2b15e6){return _0x33e776[_0x922b('0x2c')](_0x478a9f);}return _0x33e776[_0x922b('0x2d')](_0x478a9f)[_0x922b('0x2e')]();};}function respondWithResult(_0x28a76e,_0x16e2c9){_0x16e2c9=_0x16e2c9||0xc8;return function(_0x243116){if(_0x243116){return _0x28a76e[_0x922b('0x2d')](_0x16e2c9)['json'](_0x243116);}};}function respondWithFilteredResult(_0xf6f4a8,_0x1acb6f){return function(_0x1534ec){if(_0x1534ec){var _0xc5ac8=_0x1534ec[_0x922b('0x2f')],_0x25e908=_0x1acb6f[_0x922b('0x30')],_0x269120=_0x1acb6f['offset']+_0x1acb6f[_0x922b('0x31')],_0xc2ae9f;if(_0x269120>=_0xc5ac8){_0x269120=_0xc5ac8;_0xc2ae9f=0xc8;}else{_0xc2ae9f=0xce;}_0xf6f4a8[_0x922b('0x2d')](_0xc2ae9f);return _0xf6f4a8[_0x922b('0x32')](_0x922b('0x33'),_0x25e908+'-'+_0x269120+'/'+_0xc5ac8)['json'](_0x1534ec);}return null;};}function patchUpdates(_0x1d3032){return function(_0x887c30){try{jsonpatch[_0x922b('0x34')](_0x887c30,_0x1d3032,!![]);}catch(_0x113c6c){return BPromise['reject'](_0x113c6c);}return _0x887c30[_0x922b('0x35')]();};}function saveUpdates(_0x24d1e6,_0x252992){return function(_0x3a68d1){if(_0x3a68d1){return _0x3a68d1[_0x922b('0x36')](_0x24d1e6)[_0x922b('0x37')](function(_0x418739){return _0x418739;});}return null;};}function removeEntity(_0x257dda,_0x26ea3a){return function(_0x5d2435){if(_0x5d2435){return _0x5d2435[_0x922b('0x38')]()[_0x922b('0x37')](function(){_0x257dda['status'](0xcc)[_0x922b('0x2e')]();});}};}function handleEntityNotFound(_0x5ae184,_0x43e633){return function(_0x2950dd){if(!_0x2950dd){_0x5ae184[_0x922b('0x2c')](0x194);}return _0x2950dd;};}function handleError(_0x2ebd6f,_0x5b990a){_0x5b990a=_0x5b990a||0x1f4;return function(_0x31dc94){logger[_0x922b('0x26')](_0x31dc94[_0x922b('0x39')]);if(_0x31dc94[_0x922b('0x3a')]){delete _0x31dc94[_0x922b('0x3a')];}_0x2ebd6f[_0x922b('0x2d')](_0x5b990a)[_0x922b('0x3b')](_0x31dc94);};}exports[_0x922b('0x3c')]=function(_0x1062a6,_0x24755d){var _0x1272aa={},_0x2048ba={},_0x40f220={'count':0x0,'rows':[]};var _0x485b21=_[_0x922b('0x3d')](db[_0x922b('0x3e')][_0x922b('0x3f')],function(_0x15144a){return{'name':_0x15144a[_0x922b('0x40')],'type':_0x15144a[_0x922b('0x41')][_0x922b('0x42')]};});_0x2048ba[_0x922b('0x43')]=_[_0x922b('0x3d')](_0x485b21,'name');_0x2048ba['query']=_[_0x922b('0x44')](_0x1062a6[_0x922b('0x45')]);_0x2048ba[_0x922b('0x46')]=_[_0x922b('0x47')](_0x2048ba['model'],_0x2048ba[_0x922b('0x45')]);_0x1272aa[_0x922b('0x48')]=_[_0x922b('0x47')](_0x2048ba[_0x922b('0x43')],qs[_0x922b('0x49')](_0x1062a6['query']['fields']));_0x1272aa[_0x922b('0x48')]=_0x1272aa['attributes'][_0x922b('0x4a')]?_0x1272aa[_0x922b('0x48')]:_0x2048ba[_0x922b('0x43')];if(!_0x1062a6[_0x922b('0x45')][_0x922b('0x4b')]('nolimit')){_0x1272aa[_0x922b('0x31')]=qs[_0x922b('0x31')](_0x1062a6[_0x922b('0x45')][_0x922b('0x31')]);_0x1272aa[_0x922b('0x30')]=qs['offset'](_0x1062a6[_0x922b('0x45')]['offset']);}_0x1272aa[_0x922b('0x4c')]=qs[_0x922b('0x4d')](_0x1062a6[_0x922b('0x45')][_0x922b('0x4d')]);_0x1272aa[_0x922b('0x4e')]=qs['filters'](_['pick'](_0x1062a6['query'],_0x2048ba[_0x922b('0x46')]));if(_0x1062a6[_0x922b('0x45')]['filter']){_0x1272aa['where']=_[_0x922b('0x4f')](_0x1272aa[_0x922b('0x4e')],{'$or':_[_0x922b('0x3d')](_0x485b21,function(_0x6fc0c1){if(_0x6fc0c1[_0x922b('0x41')]!=='VIRTUAL'){var _0x3d1ea2={};_0x3d1ea2[_0x6fc0c1['name']]={'$like':'%'+_0x1062a6[_0x922b('0x45')][_0x922b('0x50')]+'%'};return _0x3d1ea2;}})});}_0x1272aa=_[_0x922b('0x4f')]({},_0x1272aa,_0x1062a6['options']);var _0x4e2092={'where':_0x1272aa[_0x922b('0x4e')]};return db[_0x922b('0x3e')][_0x922b('0x2f')](_0x4e2092)['then'](function(_0x44e837){_0x40f220[_0x922b('0x2f')]=_0x44e837;if(_0x1062a6[_0x922b('0x45')]['includeAll']){_0x1272aa[_0x922b('0x51')]=[{'all':!![]}];}return db['VtigerAccount'][_0x922b('0x52')](_0x1272aa);})[_0x922b('0x37')](function(_0x2689e0){_0x40f220[_0x922b('0x53')]=_0x2689e0;return _0x40f220;})['then'](respondWithFilteredResult(_0x24755d,_0x1272aa))['catch'](handleError(_0x24755d,null));};exports[_0x922b('0x54')]=function(_0xd8d7dd,_0x97a429){var _0x22e818={'raw':![],'where':{'id':_0xd8d7dd[_0x922b('0x55')]['id']}},_0x25148b={};_0x25148b[_0x922b('0x43')]=_[_0x922b('0x44')](db['VtigerAccount'][_0x922b('0x3f')]);_0x25148b[_0x922b('0x45')]=_[_0x922b('0x44')](_0xd8d7dd[_0x922b('0x45')]);_0x25148b[_0x922b('0x46')]=_['intersection'](_0x25148b[_0x922b('0x43')],_0x25148b[_0x922b('0x45')]);_0x22e818['attributes']=_[_0x922b('0x47')](_0x25148b[_0x922b('0x43')],qs[_0x922b('0x49')](_0xd8d7dd[_0x922b('0x45')][_0x922b('0x49')]));_0x22e818[_0x922b('0x48')]=_0x22e818[_0x922b('0x48')]['length']?_0x22e818[_0x922b('0x48')]:_0x25148b[_0x922b('0x43')];if(_0xd8d7dd['query'][_0x922b('0x56')]){_0x22e818[_0x922b('0x51')]=[{'all':!![]}];}_0x22e818=_[_0x922b('0x4f')]({},_0x22e818,_0xd8d7dd[_0x922b('0x57')]);return db[_0x922b('0x3e')][_0x922b('0x58')](_0x22e818)[_0x922b('0x37')](handleEntityNotFound(_0x97a429,null))[_0x922b('0x37')](respondWithResult(_0x97a429,null))[_0x922b('0x2b')](handleError(_0x97a429,null));};exports[_0x922b('0x59')]=function(_0x419a46,_0x568f98){return db[_0x922b('0x3e')][_0x922b('0x59')](_0x419a46[_0x922b('0x5a')],{})['then'](respondWithResult(_0x568f98,0xc9))[_0x922b('0x2b')](handleError(_0x568f98,null));};exports[_0x922b('0x36')]=function(_0x39864d,_0x77b40b){if(_0x39864d[_0x922b('0x5a')]['id']){delete _0x39864d['body']['id'];}return db['VtigerAccount'][_0x922b('0x58')]({'where':{'id':_0x39864d[_0x922b('0x55')]['id']}})[_0x922b('0x37')](handleEntityNotFound(_0x77b40b,null))[_0x922b('0x37')](saveUpdates(_0x39864d[_0x922b('0x5a')],null))[_0x922b('0x37')](respondWithResult(_0x77b40b,null))[_0x922b('0x2b')](handleError(_0x77b40b,null));};exports['destroy']=function(_0x4fdd82,_0x4107b2){return db[_0x922b('0x3e')]['find']({'where':{'id':_0x4fdd82[_0x922b('0x55')]['id']}})[_0x922b('0x37')](handleEntityNotFound(_0x4107b2,null))[_0x922b('0x37')](removeEntity(_0x4107b2,null))[_0x922b('0x2b')](handleError(_0x4107b2,null));};exports[_0x922b('0x5b')]=function(_0x4355e1,_0x25d649,_0x5078cf){var _0x4cbad6={};var _0x58b666={};var _0xdb196d;var _0x5ac8de;return db[_0x922b('0x3e')][_0x922b('0x5c')]({'where':{'id':_0x4355e1[_0x922b('0x55')]['id']}})[_0x922b('0x37')](handleEntityNotFound(_0x25d649,null))['then'](function(_0x585a1c){if(_0x585a1c){_0xdb196d=_0x585a1c;_0x58b666[_0x922b('0x43')]=_[_0x922b('0x44')](db[_0x922b('0x5d')][_0x922b('0x3f')]);_0x58b666[_0x922b('0x45')]=_[_0x922b('0x44')](_0x4355e1[_0x922b('0x45')]);_0x58b666['filters']=_[_0x922b('0x47')](_0x58b666[_0x922b('0x43')],_0x58b666[_0x922b('0x45')]);_0x4cbad6[_0x922b('0x48')]=_[_0x922b('0x47')](_0x58b666[_0x922b('0x43')],qs[_0x922b('0x49')](_0x4355e1[_0x922b('0x45')]['fields']));_0x4cbad6[_0x922b('0x48')]=_0x4cbad6['attributes'][_0x922b('0x4a')]?_0x4cbad6['attributes']:_0x58b666[_0x922b('0x43')];_0x4cbad6['order']=qs['sort'](_0x4355e1[_0x922b('0x45')][_0x922b('0x4d')]);_0x4cbad6[_0x922b('0x4e')]=qs[_0x922b('0x46')](_[_0x922b('0x5e')](_0x4355e1['query'],_0x58b666['filters']));if(_0x4355e1[_0x922b('0x45')][_0x922b('0x50')]){_0x4cbad6[_0x922b('0x4e')]=_['merge'](_0x4cbad6[_0x922b('0x4e')],{'$or':_['map'](_0x4cbad6['attributes'],function(_0x1ed718){var _0x1d5895={};_0x1d5895[_0x1ed718]={'$like':'%'+_0x4355e1['query'][_0x922b('0x50')]+'%'};return _0x1d5895;})});}_0x4cbad6=_[_0x922b('0x4f')]({},_0x4cbad6,_0x4355e1['options']);return _0xdb196d[_0x922b('0x5b')](_0x4cbad6);}})[_0x922b('0x37')](function(_0x44ded4){if(_0x44ded4){_0x5ac8de=_0x44ded4['length'];if(!_0x4355e1['query']['hasOwnProperty'](_0x922b('0x5f'))){_0x4cbad6[_0x922b('0x31')]=qs[_0x922b('0x31')](_0x4355e1[_0x922b('0x45')][_0x922b('0x31')]);_0x4cbad6[_0x922b('0x30')]=qs['offset'](_0x4355e1[_0x922b('0x45')][_0x922b('0x30')]);}return _0xdb196d[_0x922b('0x5b')](_0x4cbad6);}})[_0x922b('0x37')](function(_0x331d36){if(_0x331d36){return _0x331d36?{'count':_0x5ac8de,'rows':_0x331d36}:null;}})[_0x922b('0x37')](respondWithResult(_0x25d649,null))[_0x922b('0x2b')](handleError(_0x25d649,null));};exports[_0x922b('0x60')]=function(_0x1d9d8b,_0x86d077,_0x1c41e7){if(_0x1d9d8b[_0x922b('0x5a')]['id']){delete _0x1d9d8b[_0x922b('0x5a')]['id'];}return db['VtigerAccount'][_0x922b('0x5c')]({'where':{'id':_0x1d9d8b[_0x922b('0x55')]['id']}})['then'](handleEntityNotFound(_0x86d077,null))[_0x922b('0x37')](function(_0x192fd4){if(_0x192fd4){_0x1d9d8b[_0x922b('0x5a')][_0x922b('0x61')]=_0x192fd4['id'];_0x1d9d8b[_0x922b('0x5a')]['Subjects']=integrations['getSubjects'](_0x1d9d8b[_0x922b('0x5a')][_0x922b('0x62')],_0x1d9d8b['body'][_0x922b('0x41')]);_0x1d9d8b[_0x922b('0x5a')]['Descriptions']=integrations[_0x922b('0x63')](_0x1d9d8b[_0x922b('0x5a')][_0x922b('0x62')],_0x1d9d8b[_0x922b('0x5a')]['type']);return db[_0x922b('0x5d')][_0x922b('0x59')](_0x1d9d8b[_0x922b('0x5a')],{'include':[{'model':db[_0x922b('0x64')],'as':_0x922b('0x65')},{'model':db[_0x922b('0x64')],'as':_0x922b('0x66')}]});}return null;})['then'](respondWithResult(_0x86d077,null))[_0x922b('0x2b')](handleError(_0x86d077,null));};var md5=require(_0x922b('0x67'));exports[_0x922b('0x68')]=function(_0x1438c3,_0x4f1a39,_0x28d3fe){var _0x483487=null;var _0x47cdc3=null;var _0x490cc9=null;var _0x582141=null;var _0x3afc1e='';return db[_0x922b('0x3e')][_0x922b('0x5c')]({'where':{'id':_0x1438c3[_0x922b('0x55')]['id']},'attributes':['id',_0x922b('0x3a'),_0x922b('0x69'),_0x922b('0x6a'),_0x922b('0x6b'),_0x922b('0x6c'),_0x922b('0x6d'),_0x922b('0x6e')]})[_0x922b('0x37')](handleEntityNotFound(_0x4f1a39,null))[_0x922b('0x37')](function(_0x5d73c6){if(_0x5d73c6){_0x483487=_0x5d73c6[_0x922b('0x69')];_0x47cdc3=_0x5d73c6['accessKey'];_0x490cc9=_0x5d73c6[_0x922b('0x6b')];_0x3afc1e=_0x5d73c6[_0x922b('0x6c')];var _0x112bc2=_0x3afc1e[_0x922b('0x6f')](-0x1);if(_0x112bc2==='/'){_0x3afc1e=_0x3afc1e['substring'](0x0,_0x3afc1e[_0x922b('0x70')](_0x112bc2));}_0x582141=util[_0x922b('0x71')](_0x922b('0x72'),_0x3afc1e);var _0x490585={'method':_0x922b('0x73'),'uri':_0x582141,'qs':{'operation':_0x922b('0x74'),'username':_0x5d73c6[_0x922b('0x69')]},'json':!![]};return rp(_0x490585);}})[_0x922b('0x37')](function(_0x3774a8){if(_0x3774a8[_0x922b('0x75')]){var _0x2f10d4={'method':'POST','uri':_0x582141,'form':{'operation':_0x922b('0x76'),'username':_0x483487,'accessKey':md5(_0x3774a8[_0x922b('0x2a')][_0x922b('0x77')]+_0x47cdc3)},'json':!![]};return rp(_0x2f10d4);}})[_0x922b('0x37')](function(_0x5285e0){if(_0x5285e0[_0x922b('0x75')]){var _0x45640b={'method':_0x922b('0x73'),'uri':_0x582141,'qs':{'operation':_0x922b('0x78'),'username':_0x483487,'sessionName':_0x5285e0['result'][_0x922b('0x79')],'elementType':_0x490cc9},'json':!![]};return rp(_0x45640b);}})[_0x922b('0x37')](function(_0x2155bd){if(_0x2155bd[_0x922b('0x75')]){var _0x243540=[_0x922b('0x7a'),_0x922b('0x7b'),_0x922b('0x7c')];_[_0x922b('0x7d')](_0x2155bd[_0x922b('0x2a')][_0x922b('0x49')],function(_0x17bc25){return _0x243540[_0x922b('0x7e')](_0x17bc25[_0x922b('0x41')][_0x922b('0x3a')]);});_[_0x922b('0x7d')](_0x2155bd[_0x922b('0x2a')][_0x922b('0x49')],function(_0x4071df){return _0x4071df['editable']==='false';});return{'count':_0x2155bd[_0x922b('0x2a')][_0x922b('0x49')]['length'],'rows':_['map'](_0x2155bd[_0x922b('0x2a')][_0x922b('0x49')],function(_0x38a267){return{'id':_0x38a267[_0x922b('0x3a')],'name':_0x38a267[_0x922b('0x7f')],'custom':_[_0x922b('0x80')](_0x38a267[_0x922b('0x3a')],_0x922b('0x81'))?!![]:![],'options':_0x38a267[_0x922b('0x41')][_0x922b('0x3a')]===_0x922b('0x82')&&_0x38a267[_0x922b('0x41')][_0x922b('0x83')]['length']>0x0?_[_0x922b('0x3d')](_0x38a267[_0x922b('0x41')]['picklistValues'],function(_0x25e145){return{'name':_0x25e145['label'],'value':_0x25e145['value']};}):[]};})};}})[_0x922b('0x37')](respondWithResult(_0x4f1a39,null))[_0x922b('0x2b')](function(_0x39a284){console[_0x922b('0x84')](_0x922b('0x85')+_0x39a284);var _0x57ecb9=_0x1438c3[_0x922b('0x45')][_0x922b('0x1d')]?0x1f4:_0x39a284[_0x922b('0x86')]||0x1f4;logger[_0x922b('0x26')](_0x922b('0x87'),_0x922b('0x68'),_0x57ecb9,JSON[_0x922b('0x25')](_0x39a284));delete _0x39a284[_0x922b('0x3a')];if(_0x57ecb9===0x191){_0x57ecb9=0x190;}_0x4f1a39[_0x922b('0x2d')](_0x57ecb9)[_0x922b('0x3b')](_0x1438c3[_0x922b('0x45')][_0x922b('0x1d')]?{'message':_0x922b('0x88'),'statusCode':_0x39a284[_0x922b('0x86')]}:_0x39a284);});}; \ No newline at end of file +var _0x0127=['length','model','hasOwnProperty','sort','where','pick','filter','merge','VtigerAccount','includeAll','include','findAll','rows','params','find','create','body','getConfigurations','findOne','VtigerConfiguration','order','options','nolimit','addConfiguration','Subjects','getSubjects','channel','getDescriptions','VtigerField','Descriptions','username','description','moduleName','serverUrl','accessKey','remoteUri','slice','lastIndexOf','format','%s/webservice.php','GET','getchallenge','success','POST','login','token','describe','sessionName','autogenerated','reference','owner','remove','includes','editable','false','label','startsWith','cf_','picklist','picklistValues','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','html-pdf','eml-format','zip-dir','fast-json-patch','bluebird','util','path','ejs','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','test','Sequelize','ValidationError','request','then','info','VtigerAccount,\x20%s,\x20%s','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','sendStatus','name','send','index','map','rawAttributes','type','key','query','keys','filters','intersection','fields','attributes'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x0127,0x1c1));var _0x7012=function(_0x204284,_0x533be4){_0x204284=_0x204284-0x0;var _0x3dbdfc=_0x0127[_0x204284];return _0x3dbdfc;};'use strict';var pdf=require(_0x7012('0x0'));var emlformat=require(_0x7012('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x7012('0x2'));var jsonpatch=require(_0x7012('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7012('0x4'));var Mustache=require('mustache');var util=require(_0x7012('0x5'));var path=require(_0x7012('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7012('0x7'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x7012('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x7012('0x9'));var toCsv=require('to-csv');var querystring=require(_0x7012('0xa'));var Papa=require(_0x7012('0xb'));var Redis=require(_0x7012('0xc'));var authService=require(_0x7012('0xd'));var qs=require(_0x7012('0xe'));var as=require(_0x7012('0xf'));var hardwareService=require(_0x7012('0x10'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x7012('0x11'));var db=require(_0x7012('0x12'))['db'];var integrations=require(_0x7012('0x13'));var jayson=require(_0x7012('0x14'));var client=jayson[_0x7012('0x15')]['http']({'port':0x232a});function checkPasswordPattern(_0x57436b,_0x2841c0,_0x234de7){if(_0x234de7){var _0x337be9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x337be9[_0x7012('0x16')](_0x2841c0)){return _0x57436b;}else{throw new db[(_0x7012('0x17'))][(_0x7012('0x18'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x57436b;}}function respondWithRpcPromise(_0x1f7d98,_0x6e9ca9,_0x2e879f,_0x2a69ef){return new BPromise(function(_0x3ac554,_0x3262f2){var _0x8aee4c=_0x2a69ef||client;return _0x8aee4c[_0x7012('0x19')](_0x1f7d98,_0x2e879f)[_0x7012('0x1a')](function(_0x37116d){logger[_0x7012('0x1b')](_0x7012('0x1c'),_0x6e9ca9,'request\x20sent');logger['debug'](_0x7012('0x1d'),_0x6e9ca9,_0x7012('0x1e'),JSON[_0x7012('0x1f')](_0x37116d));if(_0x37116d[_0x7012('0x20')]){if(_0x37116d[_0x7012('0x20')][_0x7012('0x21')]===0x1f4){logger[_0x7012('0x20')](_0x7012('0x1c'),_0x6e9ca9,_0x37116d[_0x7012('0x20')][_0x7012('0x22')]);return _0x3262f2(_0x37116d[_0x7012('0x20')]['message']);}logger[_0x7012('0x20')]('VtigerAccount,\x20%s,\x20%s',_0x6e9ca9,_0x37116d[_0x7012('0x20')][_0x7012('0x22')]);return _0x3ac554(_0x37116d[_0x7012('0x20')][_0x7012('0x22')]);}else{logger['info'](_0x7012('0x1c'),_0x6e9ca9,_0x7012('0x1e'));_0x3ac554(_0x37116d[_0x7012('0x23')]['message']);}})[_0x7012('0x24')](function(_0xfd1be2){logger['error'](_0x7012('0x1c'),_0x6e9ca9,_0xfd1be2);_0x3262f2(_0xfd1be2);});});}function respondWithStatusCode(_0x33f622,_0x5133c7){_0x5133c7=_0x5133c7||0xcc;return function(_0x1b8907){if(_0x1b8907){return _0x33f622['sendStatus'](_0x5133c7);}return _0x33f622[_0x7012('0x25')](_0x5133c7)['end']();};}function respondWithResult(_0x599632,_0x56d676){_0x56d676=_0x56d676||0xc8;return function(_0x29d7dd){if(_0x29d7dd){return _0x599632[_0x7012('0x25')](_0x56d676)[_0x7012('0x26')](_0x29d7dd);}};}function respondWithFilteredResult(_0x3cece0,_0x2e2a6d){return function(_0x3a085c){if(_0x3a085c){var _0x309301=_0x3a085c[_0x7012('0x27')],_0x491a35=_0x2e2a6d[_0x7012('0x28')],_0x50667f=_0x2e2a6d[_0x7012('0x28')]+_0x2e2a6d[_0x7012('0x29')],_0x595b46;if(_0x50667f>=_0x309301){_0x50667f=_0x309301;_0x595b46=0xc8;}else{_0x595b46=0xce;}_0x3cece0[_0x7012('0x25')](_0x595b46);return _0x3cece0[_0x7012('0x2a')](_0x7012('0x2b'),_0x491a35+'-'+_0x50667f+'/'+_0x309301)['json'](_0x3a085c);}return null;};}function patchUpdates(_0x5c8aed){return function(_0x36d0bb){try{jsonpatch[_0x7012('0x2c')](_0x36d0bb,_0x5c8aed,!![]);}catch(_0x52031e){return BPromise[_0x7012('0x2d')](_0x52031e);}return _0x36d0bb[_0x7012('0x2e')]();};}function saveUpdates(_0x563a51,_0x16fd86){return function(_0x3ed234){if(_0x3ed234){return _0x3ed234[_0x7012('0x2f')](_0x563a51)['then'](function(_0x26dade){return _0x26dade;});}return null;};}function removeEntity(_0x44cd9a,_0x162645){return function(_0x23a979){if(_0x23a979){return _0x23a979[_0x7012('0x30')]()['then'](function(){_0x44cd9a[_0x7012('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x274269,_0x264e77){return function(_0x3491be){if(!_0x3491be){_0x274269[_0x7012('0x31')](0x194);}return _0x3491be;};}function handleError(_0x5713ac,_0x5f2651){_0x5f2651=_0x5f2651||0x1f4;return function(_0x12cbd1){logger[_0x7012('0x20')](_0x12cbd1['stack']);if(_0x12cbd1[_0x7012('0x32')]){delete _0x12cbd1[_0x7012('0x32')];}_0x5713ac[_0x7012('0x25')](_0x5f2651)[_0x7012('0x33')](_0x12cbd1);};}exports[_0x7012('0x34')]=function(_0x3449cf,_0x10f655){var _0x307bfd={},_0x15050e={},_0x39d137={'count':0x0,'rows':[]};var _0x1aef86=_[_0x7012('0x35')](db['VtigerAccount'][_0x7012('0x36')],function(_0x2d0f01){return{'name':_0x2d0f01['fieldName'],'type':_0x2d0f01[_0x7012('0x37')][_0x7012('0x38')]};});_0x15050e['model']=_['map'](_0x1aef86,_0x7012('0x32'));_0x15050e[_0x7012('0x39')]=_[_0x7012('0x3a')](_0x3449cf[_0x7012('0x39')]);_0x15050e[_0x7012('0x3b')]=_[_0x7012('0x3c')](_0x15050e['model'],_0x15050e['query']);_0x307bfd['attributes']=_[_0x7012('0x3c')](_0x15050e['model'],qs[_0x7012('0x3d')](_0x3449cf[_0x7012('0x39')]['fields']));_0x307bfd[_0x7012('0x3e')]=_0x307bfd[_0x7012('0x3e')][_0x7012('0x3f')]?_0x307bfd['attributes']:_0x15050e[_0x7012('0x40')];if(!_0x3449cf[_0x7012('0x39')][_0x7012('0x41')]('nolimit')){_0x307bfd[_0x7012('0x29')]=qs[_0x7012('0x29')](_0x3449cf[_0x7012('0x39')][_0x7012('0x29')]);_0x307bfd[_0x7012('0x28')]=qs['offset'](_0x3449cf[_0x7012('0x39')][_0x7012('0x28')]);}_0x307bfd['order']=qs[_0x7012('0x42')](_0x3449cf['query'][_0x7012('0x42')]);_0x307bfd[_0x7012('0x43')]=qs['filters'](_[_0x7012('0x44')](_0x3449cf[_0x7012('0x39')],_0x15050e[_0x7012('0x3b')]));if(_0x3449cf[_0x7012('0x39')][_0x7012('0x45')]){_0x307bfd['where']=_['merge'](_0x307bfd['where'],{'$or':_['map'](_0x1aef86,function(_0x38537){if(_0x38537[_0x7012('0x37')]!=='VIRTUAL'){var _0xe4e9f9={};_0xe4e9f9[_0x38537[_0x7012('0x32')]]={'$like':'%'+_0x3449cf[_0x7012('0x39')]['filter']+'%'};return _0xe4e9f9;}})});}_0x307bfd=_[_0x7012('0x46')]({},_0x307bfd,_0x3449cf['options']);var _0xcd6ca3={'where':_0x307bfd[_0x7012('0x43')]};return db[_0x7012('0x47')]['count'](_0xcd6ca3)[_0x7012('0x1a')](function(_0x61e4e8){_0x39d137['count']=_0x61e4e8;if(_0x3449cf['query'][_0x7012('0x48')]){_0x307bfd[_0x7012('0x49')]=[{'all':!![]}];}return db[_0x7012('0x47')][_0x7012('0x4a')](_0x307bfd);})['then'](function(_0x377ec9){_0x39d137[_0x7012('0x4b')]=_0x377ec9;return _0x39d137;})[_0x7012('0x1a')](respondWithFilteredResult(_0x10f655,_0x307bfd))[_0x7012('0x24')](handleError(_0x10f655,null));};exports['show']=function(_0x1453bd,_0x17301b){var _0x1551f9={'raw':![],'where':{'id':_0x1453bd[_0x7012('0x4c')]['id']}},_0x1eab47={};_0x1eab47['model']=_[_0x7012('0x3a')](db[_0x7012('0x47')][_0x7012('0x36')]);_0x1eab47[_0x7012('0x39')]=_[_0x7012('0x3a')](_0x1453bd[_0x7012('0x39')]);_0x1eab47['filters']=_[_0x7012('0x3c')](_0x1eab47[_0x7012('0x40')],_0x1eab47[_0x7012('0x39')]);_0x1551f9[_0x7012('0x3e')]=_[_0x7012('0x3c')](_0x1eab47['model'],qs[_0x7012('0x3d')](_0x1453bd[_0x7012('0x39')][_0x7012('0x3d')]));_0x1551f9['attributes']=_0x1551f9[_0x7012('0x3e')][_0x7012('0x3f')]?_0x1551f9['attributes']:_0x1eab47['model'];if(_0x1453bd[_0x7012('0x39')][_0x7012('0x48')]){_0x1551f9['include']=[{'all':!![]}];}_0x1551f9=_[_0x7012('0x46')]({},_0x1551f9,_0x1453bd['options']);return db[_0x7012('0x47')][_0x7012('0x4d')](_0x1551f9)[_0x7012('0x1a')](handleEntityNotFound(_0x17301b,null))[_0x7012('0x1a')](respondWithResult(_0x17301b,null))['catch'](handleError(_0x17301b,null));};exports[_0x7012('0x4e')]=function(_0x3ce5f7,_0x282d0b){return db['VtigerAccount'][_0x7012('0x4e')](_0x3ce5f7['body'],{})[_0x7012('0x1a')](respondWithResult(_0x282d0b,0xc9))[_0x7012('0x24')](handleError(_0x282d0b,null));};exports[_0x7012('0x2f')]=function(_0x41c578,_0x1ebe63){if(_0x41c578['body']['id']){delete _0x41c578[_0x7012('0x4f')]['id'];}return db[_0x7012('0x47')][_0x7012('0x4d')]({'where':{'id':_0x41c578[_0x7012('0x4c')]['id']}})[_0x7012('0x1a')](handleEntityNotFound(_0x1ebe63,null))[_0x7012('0x1a')](saveUpdates(_0x41c578[_0x7012('0x4f')],null))[_0x7012('0x1a')](respondWithResult(_0x1ebe63,null))[_0x7012('0x24')](handleError(_0x1ebe63,null));};exports[_0x7012('0x30')]=function(_0x175a5c,_0x21ac89){return db[_0x7012('0x47')][_0x7012('0x4d')]({'where':{'id':_0x175a5c[_0x7012('0x4c')]['id']}})[_0x7012('0x1a')](handleEntityNotFound(_0x21ac89,null))['then'](removeEntity(_0x21ac89,null))['catch'](handleError(_0x21ac89,null));};exports[_0x7012('0x50')]=function(_0x1b21aa,_0x112860,_0x427cee){var _0x9e40b8={};var _0x105ec3={};var _0x4daedd;var _0x3ccaea;return db[_0x7012('0x47')][_0x7012('0x51')]({'where':{'id':_0x1b21aa[_0x7012('0x4c')]['id']}})[_0x7012('0x1a')](handleEntityNotFound(_0x112860,null))[_0x7012('0x1a')](function(_0xe9e2e2){if(_0xe9e2e2){_0x4daedd=_0xe9e2e2;_0x105ec3[_0x7012('0x40')]=_[_0x7012('0x3a')](db[_0x7012('0x52')][_0x7012('0x36')]);_0x105ec3['query']=_[_0x7012('0x3a')](_0x1b21aa[_0x7012('0x39')]);_0x105ec3[_0x7012('0x3b')]=_['intersection'](_0x105ec3[_0x7012('0x40')],_0x105ec3[_0x7012('0x39')]);_0x9e40b8[_0x7012('0x3e')]=_[_0x7012('0x3c')](_0x105ec3[_0x7012('0x40')],qs['fields'](_0x1b21aa['query'][_0x7012('0x3d')]));_0x9e40b8[_0x7012('0x3e')]=_0x9e40b8['attributes'][_0x7012('0x3f')]?_0x9e40b8['attributes']:_0x105ec3[_0x7012('0x40')];_0x9e40b8[_0x7012('0x53')]=qs[_0x7012('0x42')](_0x1b21aa['query'][_0x7012('0x42')]);_0x9e40b8[_0x7012('0x43')]=qs[_0x7012('0x3b')](_['pick'](_0x1b21aa[_0x7012('0x39')],_0x105ec3['filters']));if(_0x1b21aa[_0x7012('0x39')][_0x7012('0x45')]){_0x9e40b8[_0x7012('0x43')]=_[_0x7012('0x46')](_0x9e40b8['where'],{'$or':_[_0x7012('0x35')](_0x9e40b8[_0x7012('0x3e')],function(_0x28a5a8){var _0x9e893f={};_0x9e893f[_0x28a5a8]={'$like':'%'+_0x1b21aa[_0x7012('0x39')][_0x7012('0x45')]+'%'};return _0x9e893f;})});}_0x9e40b8=_[_0x7012('0x46')]({},_0x9e40b8,_0x1b21aa[_0x7012('0x54')]);return _0x4daedd[_0x7012('0x50')](_0x9e40b8);}})[_0x7012('0x1a')](function(_0x1e14aa){if(_0x1e14aa){_0x3ccaea=_0x1e14aa[_0x7012('0x3f')];if(!_0x1b21aa['query'][_0x7012('0x41')](_0x7012('0x55'))){_0x9e40b8['limit']=qs[_0x7012('0x29')](_0x1b21aa[_0x7012('0x39')][_0x7012('0x29')]);_0x9e40b8[_0x7012('0x28')]=qs[_0x7012('0x28')](_0x1b21aa[_0x7012('0x39')][_0x7012('0x28')]);}return _0x4daedd[_0x7012('0x50')](_0x9e40b8);}})[_0x7012('0x1a')](function(_0x4ee94d){if(_0x4ee94d){return _0x4ee94d?{'count':_0x3ccaea,'rows':_0x4ee94d}:null;}})[_0x7012('0x1a')](respondWithResult(_0x112860,null))[_0x7012('0x24')](handleError(_0x112860,null));};exports[_0x7012('0x56')]=function(_0xe2ce1e,_0x3fb446,_0x1a11bf){if(_0xe2ce1e[_0x7012('0x4f')]['id']){delete _0xe2ce1e[_0x7012('0x4f')]['id'];}return db[_0x7012('0x47')]['findOne']({'where':{'id':_0xe2ce1e['params']['id']}})[_0x7012('0x1a')](handleEntityNotFound(_0x3fb446,null))[_0x7012('0x1a')](function(_0x39c703){if(_0x39c703){_0xe2ce1e[_0x7012('0x4f')]['AccountId']=_0x39c703['id'];_0xe2ce1e['body'][_0x7012('0x57')]=integrations[_0x7012('0x58')](_0xe2ce1e['body'][_0x7012('0x59')],_0xe2ce1e[_0x7012('0x4f')]['type']);_0xe2ce1e[_0x7012('0x4f')]['Descriptions']=integrations[_0x7012('0x5a')](_0xe2ce1e[_0x7012('0x4f')]['channel'],_0xe2ce1e['body']['type']);return db['VtigerConfiguration'][_0x7012('0x4e')](_0xe2ce1e['body'],{'include':[{'model':db[_0x7012('0x5b')],'as':_0x7012('0x57')},{'model':db[_0x7012('0x5b')],'as':_0x7012('0x5c')}]});}return null;})[_0x7012('0x1a')](respondWithResult(_0x3fb446,null))['catch'](handleError(_0x3fb446,null));};var md5=require('md5');exports['getFields']=function(_0xd110de,_0x278551,_0x1b22b6){var _0x45571d=null;var _0x59f2ab=null;var _0x3eb6f6=null;var _0x559d94=null;var _0x2e0113='';return db[_0x7012('0x47')][_0x7012('0x51')]({'where':{'id':_0xd110de[_0x7012('0x4c')]['id']},'attributes':['id',_0x7012('0x32'),_0x7012('0x5d'),_0x7012('0x5e'),_0x7012('0x5f'),'remoteUri',_0x7012('0x60'),'accessKey']})[_0x7012('0x1a')](handleEntityNotFound(_0x278551,null))[_0x7012('0x1a')](function(_0x427c32){if(_0x427c32){_0x45571d=_0x427c32[_0x7012('0x5d')];_0x59f2ab=_0x427c32[_0x7012('0x61')];_0x3eb6f6=_0x427c32[_0x7012('0x5f')];_0x2e0113=_0x427c32[_0x7012('0x62')];var _0x1934bd=_0x2e0113[_0x7012('0x63')](-0x1);if(_0x1934bd==='/'){_0x2e0113=_0x2e0113['substring'](0x0,_0x2e0113[_0x7012('0x64')](_0x1934bd));}_0x559d94=util[_0x7012('0x65')](_0x7012('0x66'),_0x2e0113);var _0x5331dc={'method':_0x7012('0x67'),'uri':_0x559d94,'qs':{'operation':_0x7012('0x68'),'username':_0x427c32[_0x7012('0x5d')]},'json':!![]};return rp(_0x5331dc);}})[_0x7012('0x1a')](function(_0x558f6d){if(_0x558f6d[_0x7012('0x69')]){var _0x35f5b0={'method':_0x7012('0x6a'),'uri':_0x559d94,'form':{'operation':_0x7012('0x6b'),'username':_0x45571d,'accessKey':md5(_0x558f6d[_0x7012('0x23')][_0x7012('0x6c')]+_0x59f2ab)},'json':!![]};return rp(_0x35f5b0);}})[_0x7012('0x1a')](function(_0x17acdf){if(_0x17acdf[_0x7012('0x69')]){var _0x3a9edf={'method':_0x7012('0x67'),'uri':_0x559d94,'qs':{'operation':_0x7012('0x6d'),'username':_0x45571d,'sessionName':_0x17acdf[_0x7012('0x23')][_0x7012('0x6e')],'elementType':_0x3eb6f6},'json':!![]};return rp(_0x3a9edf);}})['then'](function(_0x1092d9){if(_0x1092d9[_0x7012('0x69')]){var _0x3453f1=[_0x7012('0x6f'),_0x7012('0x70'),_0x7012('0x71')];_[_0x7012('0x72')](_0x1092d9['result']['fields'],function(_0x412a03){return _0x3453f1[_0x7012('0x73')](_0x412a03[_0x7012('0x37')][_0x7012('0x32')]);});_[_0x7012('0x72')](_0x1092d9[_0x7012('0x23')][_0x7012('0x3d')],function(_0x7fca07){return _0x7fca07[_0x7012('0x74')]===_0x7012('0x75');});return{'count':_0x1092d9['result'][_0x7012('0x3d')][_0x7012('0x3f')],'rows':_['map'](_0x1092d9[_0x7012('0x23')][_0x7012('0x3d')],function(_0x39d782){return{'id':_0x39d782[_0x7012('0x32')],'name':_0x39d782[_0x7012('0x76')],'custom':_[_0x7012('0x77')](_0x39d782[_0x7012('0x32')],_0x7012('0x78'))?!![]:![],'options':_0x39d782['type'][_0x7012('0x32')]===_0x7012('0x79')&&_0x39d782[_0x7012('0x37')]['picklistValues'][_0x7012('0x3f')]>0x0?_['map'](_0x39d782[_0x7012('0x37')][_0x7012('0x7a')],function(_0x491a92){return{'name':_0x491a92[_0x7012('0x76')],'value':_0x491a92['value']};}):[]};})};}})['then'](respondWithResult(_0x278551,null))[_0x7012('0x24')](function(_0x2bc080){console['log'](_0x7012('0x7b')+_0x2bc080);var _0x153629=_0xd110de[_0x7012('0x39')]['test']?0x1f4:_0x2bc080[_0x7012('0x7c')]||0x1f4;logger[_0x7012('0x20')](_0x7012('0x7d'),_0x7012('0x7e'),_0x153629,JSON[_0x7012('0x1f')](_0x2bc080));delete _0x2bc080[_0x7012('0x32')];if(_0x153629===0x191){_0x153629=0x190;}_0x278551['status'](_0x153629)[_0x7012('0x33')](_0xd110de[_0x7012('0x39')][_0x7012('0x16')]?{'message':_0x7012('0x7f'),'statusCode':_0x2bc080[_0x7012('0x7c')]}:_0x2bc080);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index fc66565..d100fb8 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 _0xc640=['path','../../config/environment','./intVtigerAccount.attributes','exports','define','int_vtiger_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xc640,0xde));var _0x0c64=function(_0x20f9b5,_0x514cc7){_0x20f9b5=_0x20f9b5-0x0;var _0x226b62=_0xc640[_0x20f9b5];return _0x226b62;};'use strict';var _=require(_0x0c64('0x0'));var util=require(_0x0c64('0x1'));var logger=require(_0x0c64('0x2'))('api');var moment=require(_0x0c64('0x3'));var BPromise=require(_0x0c64('0x4'));var rp=require(_0x0c64('0x5'));var fs=require('fs');var path=require(_0x0c64('0x6'));var rimraf=require('rimraf');var config=require(_0x0c64('0x7'));var attributes=require(_0x0c64('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x0c64('0x9')]=function(_0x2ff94d,_0x37b812){return _0x2ff94d[_0x0c64('0xa')]('VtigerAccount',attributes,{'tableName':_0x0c64('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x01af=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','VtigerAccount'];(function(_0x4142af,_0x396358){var _0x4bd460=function(_0x2ca275){while(--_0x2ca275){_0x4142af['push'](_0x4142af['shift']());}};_0x4bd460(++_0x396358);}(_0x01af,0x174));var _0xf01a=function(_0x309b99,_0x322570){_0x309b99=_0x309b99-0x0;var _0x3b4d5f=_0x01af[_0x309b99];return _0x3b4d5f;};'use strict';var _=require(_0xf01a('0x0'));var util=require(_0xf01a('0x1'));var logger=require(_0xf01a('0x2'))('api');var moment=require(_0xf01a('0x3'));var BPromise=require(_0xf01a('0x4'));var rp=require(_0xf01a('0x5'));var fs=require('fs');var path=require(_0xf01a('0x6'));var rimraf=require(_0xf01a('0x7'));var config=require('../../config/environment');var attributes=require(_0xf01a('0x8'));var integrations=require(_0xf01a('0x9'));module[_0xf01a('0xa')]=function(_0x54dabb,_0x40a0f3){return _0x54dabb['define'](_0xf01a('0xb'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index e69d371..dc9a4ca 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 _0x2d26=['options','raw','attributes','limit','include','model','map','info','catch','ShowVtigerAccount','find','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','GetVtigerAccount','VtigerAccount','findAll'];(function(_0xb725be,_0x45bd01){var _0x2f2424=function(_0x2566ca){while(--_0x2566ca){_0xb725be['push'](_0xb725be['shift']());}};_0x2f2424(++_0x45bd01);}(_0x2d26,0x71));var _0x62d2=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0x2d26[_0x1c546c];return _0x2cc384;};'use strict';var _=require('lodash');var util=require(_0x62d2('0x0'));var moment=require(_0x62d2('0x1'));var BPromise=require('bluebird');var rs=require(_0x62d2('0x2'));var fs=require('fs');var Redis=require(_0x62d2('0x3'));var db=require(_0x62d2('0x4'))['db'];var utils=require(_0x62d2('0x5'));var logger=require(_0x62d2('0x6'))(_0x62d2('0x7'));var config=require('../../config/environment');var jayson=require(_0x62d2('0x8'));var client=jayson['client'][_0x62d2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x350625,_0x5c7d4b,_0x5d7be0){return new BPromise(function(_0x2cb008,_0x5c0066){return client[_0x62d2('0xa')](_0x350625,_0x5d7be0)[_0x62d2('0xb')](function(_0x401fcc){logger['info'](_0x62d2('0xc'),_0x5c7d4b,'request\x20sent');logger[_0x62d2('0xd')](_0x62d2('0xe'),_0x5c7d4b,_0x62d2('0xf'),JSON[_0x62d2('0x10')](_0x401fcc));if(_0x401fcc[_0x62d2('0x11')]){if(_0x401fcc[_0x62d2('0x11')][_0x62d2('0x12')]===0x1f4){logger[_0x62d2('0x11')]('VtigerAccount,\x20%s,\x20%s',_0x5c7d4b,_0x401fcc['error'][_0x62d2('0x13')]);return _0x5c0066(_0x401fcc[_0x62d2('0x11')][_0x62d2('0x13')]);}logger[_0x62d2('0x11')]('VtigerAccount,\x20%s,\x20%s',_0x5c7d4b,_0x401fcc[_0x62d2('0x11')]['message']);return _0x2cb008(_0x401fcc[_0x62d2('0x11')][_0x62d2('0x13')]);}else{logger['info']('VtigerAccount,\x20%s,\x20%s',_0x5c7d4b,'request\x20sent');_0x2cb008(_0x401fcc['result'][_0x62d2('0x13')]);}})['catch'](function(_0x38b3e3){logger[_0x62d2('0x11')](_0x62d2('0xc'),_0x5c7d4b,_0x38b3e3);_0x5c0066(_0x38b3e3);});});}exports[_0x62d2('0x14')]=function(_0x3ddfbf){var _0x26f86e=this;return new Promise(function(_0x553a43,_0x35aaba){return db[_0x62d2('0x15')][_0x62d2('0x16')]({'raw':_0x3ddfbf['options']?_0x3ddfbf[_0x62d2('0x17')][_0x62d2('0x18')]===undefined?!![]:![]:!![],'where':_0x3ddfbf[_0x62d2('0x17')]?_0x3ddfbf[_0x62d2('0x17')]['where']||null:null,'attributes':_0x3ddfbf[_0x62d2('0x17')]?_0x3ddfbf[_0x62d2('0x17')][_0x62d2('0x19')]||null:null,'limit':_0x3ddfbf[_0x62d2('0x17')]?_0x3ddfbf[_0x62d2('0x17')][_0x62d2('0x1a')]||null:null,'include':_0x3ddfbf[_0x62d2('0x17')]?_0x3ddfbf[_0x62d2('0x17')][_0x62d2('0x1b')]?_['map'](_0x3ddfbf[_0x62d2('0x17')]['include'],function(_0x2a7942){return{'model':db[_0x2a7942[_0x62d2('0x1c')]],'as':_0x2a7942['as'],'attributes':_0x2a7942['attributes'],'include':_0x2a7942[_0x62d2('0x1b')]?_['map'](_0x2a7942[_0x62d2('0x1b')],function(_0x41d8e3){return{'model':db[_0x41d8e3[_0x62d2('0x1c')]],'as':_0x41d8e3['as'],'attributes':_0x41d8e3['attributes'],'include':_0x41d8e3[_0x62d2('0x1b')]?_[_0x62d2('0x1d')](_0x41d8e3['include'],function(_0x43a4ec){return{'model':db[_0x43a4ec[_0x62d2('0x1c')]],'as':_0x43a4ec['as'],'attributes':_0x43a4ec[_0x62d2('0x19')]};}):[]};}):[]};}):[]:[]})[_0x62d2('0xb')](function(_0x3586bc){logger[_0x62d2('0x1e')](_0x62d2('0x14'),_0x3ddfbf);logger['debug'](_0x62d2('0x14'),_0x3ddfbf,JSON['stringify'](_0x3586bc));_0x553a43(_0x3586bc);})[_0x62d2('0x1f')](function(_0x21718f){logger['error'](_0x62d2('0x14'),_0x21718f[_0x62d2('0x13')],_0x3ddfbf);_0x35aaba(_0x26f86e['error'](0x1f4,_0x21718f[_0x62d2('0x13')]));});});};exports[_0x62d2('0x20')]=function(_0x2e6460){var _0x52a17e=this;return new Promise(function(_0x4f1bca,_0x4acad6){return db[_0x62d2('0x15')][_0x62d2('0x21')]({'raw':_0x2e6460[_0x62d2('0x17')]?_0x2e6460[_0x62d2('0x17')][_0x62d2('0x18')]===undefined?!![]:![]:!![],'where':_0x2e6460[_0x62d2('0x17')]?_0x2e6460[_0x62d2('0x17')]['where']||null:null,'attributes':_0x2e6460['options']?_0x2e6460['options']['attributes']||null:null,'include':_0x2e6460['options']?_0x2e6460[_0x62d2('0x17')]['include']?_[_0x62d2('0x1d')](_0x2e6460[_0x62d2('0x17')]['include'],function(_0x4cb592){return{'model':db[_0x4cb592['model']],'as':_0x4cb592['as'],'attributes':_0x4cb592['attributes'],'include':_0x4cb592[_0x62d2('0x1b')]?_[_0x62d2('0x1d')](_0x4cb592[_0x62d2('0x1b')],function(_0x24d97a){return{'model':db[_0x24d97a[_0x62d2('0x1c')]],'as':_0x24d97a['as'],'attributes':_0x24d97a[_0x62d2('0x19')],'include':_0x24d97a[_0x62d2('0x1b')]?_[_0x62d2('0x1d')](_0x24d97a['include'],function(_0x18fa48){return{'model':db[_0x18fa48[_0x62d2('0x1c')]],'as':_0x18fa48['as'],'attributes':_0x18fa48[_0x62d2('0x19')]};}):[]};}):[]};}):[]:[]})[_0x62d2('0xb')](function(_0x588c3e){logger[_0x62d2('0x1e')](_0x62d2('0x20'),_0x2e6460);logger[_0x62d2('0xd')](_0x62d2('0x20'),_0x2e6460,JSON[_0x62d2('0x10')](_0x588c3e));_0x4f1bca(_0x588c3e);})[_0x62d2('0x1f')](function(_0x25dd4b){logger['error'](_0x62d2('0x20'),_0x25dd4b[_0x62d2('0x13')],_0x2e6460);_0x4acad6(_0x52a17e['error'](0x1f4,_0x25dd4b[_0x62d2('0x13')]));});});}; \ No newline at end of file +var _0x2dc0=['debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','attributes','limit','include','map','model','then','find','where','ShowVtigerAccount','lodash','util','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','info','VtigerAccount,\x20%s,\x20%s'];(function(_0x1519d9,_0x53f832){var _0x37a83c=function(_0x5b165e){while(--_0x5b165e){_0x1519d9['push'](_0x1519d9['shift']());}};_0x37a83c(++_0x53f832);}(_0x2dc0,0x76));var _0x02dc=function(_0x24556b,_0x1990c9){_0x24556b=_0x24556b-0x0;var _0x3fc2fd=_0x2dc0[_0x24556b];return _0x3fc2fd;};'use strict';var _=require(_0x02dc('0x0'));var util=require(_0x02dc('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x02dc('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x02dc('0x3'))('rpc');var config=require(_0x02dc('0x4'));var jayson=require(_0x02dc('0x5'));var client=jayson[_0x02dc('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2bece1,_0x12a55a,_0x4d334b){return new BPromise(function(_0x5cec74,_0x392a04){return client[_0x02dc('0x7')](_0x2bece1,_0x4d334b)['then'](function(_0xe11ad9){logger[_0x02dc('0x8')](_0x02dc('0x9'),_0x12a55a,'request\x20sent');logger[_0x02dc('0xa')](_0x02dc('0xb'),_0x12a55a,'request\x20sent',JSON[_0x02dc('0xc')](_0xe11ad9));if(_0xe11ad9[_0x02dc('0xd')]){if(_0xe11ad9['error'][_0x02dc('0xe')]===0x1f4){logger[_0x02dc('0xd')](_0x02dc('0x9'),_0x12a55a,_0xe11ad9[_0x02dc('0xd')]['message']);return _0x392a04(_0xe11ad9[_0x02dc('0xd')][_0x02dc('0xf')]);}logger[_0x02dc('0xd')](_0x02dc('0x9'),_0x12a55a,_0xe11ad9[_0x02dc('0xd')][_0x02dc('0xf')]);return _0x5cec74(_0xe11ad9['error'][_0x02dc('0xf')]);}else{logger['info'](_0x02dc('0x9'),_0x12a55a,'request\x20sent');_0x5cec74(_0xe11ad9[_0x02dc('0x10')][_0x02dc('0xf')]);}})[_0x02dc('0x11')](function(_0x4287bb){logger[_0x02dc('0xd')](_0x02dc('0x9'),_0x12a55a,_0x4287bb);_0x392a04(_0x4287bb);});});}exports[_0x02dc('0x12')]=function(_0x33ea23){var _0x2eb20b=this;return new Promise(function(_0x2f458d,_0x424f7b){return db[_0x02dc('0x13')][_0x02dc('0x14')]({'raw':_0x33ea23[_0x02dc('0x15')]?_0x33ea23[_0x02dc('0x15')][_0x02dc('0x16')]===undefined?!![]:![]:!![],'where':_0x33ea23[_0x02dc('0x15')]?_0x33ea23['options']['where']||null:null,'attributes':_0x33ea23[_0x02dc('0x15')]?_0x33ea23[_0x02dc('0x15')][_0x02dc('0x17')]||null:null,'limit':_0x33ea23['options']?_0x33ea23[_0x02dc('0x15')][_0x02dc('0x18')]||null:null,'include':_0x33ea23[_0x02dc('0x15')]?_0x33ea23[_0x02dc('0x15')][_0x02dc('0x19')]?_[_0x02dc('0x1a')](_0x33ea23[_0x02dc('0x15')]['include'],function(_0x22d6ad){return{'model':db[_0x22d6ad[_0x02dc('0x1b')]],'as':_0x22d6ad['as'],'attributes':_0x22d6ad[_0x02dc('0x17')],'include':_0x22d6ad[_0x02dc('0x19')]?_[_0x02dc('0x1a')](_0x22d6ad['include'],function(_0x35626c){return{'model':db[_0x35626c[_0x02dc('0x1b')]],'as':_0x35626c['as'],'attributes':_0x35626c['attributes'],'include':_0x35626c[_0x02dc('0x19')]?_[_0x02dc('0x1a')](_0x35626c['include'],function(_0x3ad436){return{'model':db[_0x3ad436[_0x02dc('0x1b')]],'as':_0x3ad436['as'],'attributes':_0x3ad436[_0x02dc('0x17')]};}):[]};}):[]};}):[]:[]})[_0x02dc('0x1c')](function(_0xb2697c){logger[_0x02dc('0x8')](_0x02dc('0x12'),_0x33ea23);logger['debug'](_0x02dc('0x12'),_0x33ea23,JSON[_0x02dc('0xc')](_0xb2697c));_0x2f458d(_0xb2697c);})[_0x02dc('0x11')](function(_0x48429b){logger['error'](_0x02dc('0x12'),_0x48429b['message'],_0x33ea23);_0x424f7b(_0x2eb20b[_0x02dc('0xd')](0x1f4,_0x48429b[_0x02dc('0xf')]));});});};exports['ShowVtigerAccount']=function(_0x1d9cdd){var _0x3b6604=this;return new Promise(function(_0x4dd4fc,_0x588aa4){return db[_0x02dc('0x13')][_0x02dc('0x1d')]({'raw':_0x1d9cdd[_0x02dc('0x15')]?_0x1d9cdd[_0x02dc('0x15')][_0x02dc('0x16')]===undefined?!![]:![]:!![],'where':_0x1d9cdd[_0x02dc('0x15')]?_0x1d9cdd[_0x02dc('0x15')][_0x02dc('0x1e')]||null:null,'attributes':_0x1d9cdd[_0x02dc('0x15')]?_0x1d9cdd[_0x02dc('0x15')]['attributes']||null:null,'include':_0x1d9cdd[_0x02dc('0x15')]?_0x1d9cdd[_0x02dc('0x15')]['include']?_[_0x02dc('0x1a')](_0x1d9cdd[_0x02dc('0x15')][_0x02dc('0x19')],function(_0x271ee0){return{'model':db[_0x271ee0[_0x02dc('0x1b')]],'as':_0x271ee0['as'],'attributes':_0x271ee0[_0x02dc('0x17')],'include':_0x271ee0[_0x02dc('0x19')]?_['map'](_0x271ee0[_0x02dc('0x19')],function(_0x552fba){return{'model':db[_0x552fba[_0x02dc('0x1b')]],'as':_0x552fba['as'],'attributes':_0x552fba['attributes'],'include':_0x552fba['include']?_[_0x02dc('0x1a')](_0x552fba[_0x02dc('0x19')],function(_0x580816){return{'model':db[_0x580816['model']],'as':_0x580816['as'],'attributes':_0x580816['attributes']};}):[]};}):[]};}):[]:[]})[_0x02dc('0x1c')](function(_0x528eb1){logger[_0x02dc('0x8')](_0x02dc('0x1f'),_0x1d9cdd);logger[_0x02dc('0xa')](_0x02dc('0x1f'),_0x1d9cdd,JSON[_0x02dc('0xc')](_0x528eb1));_0x4dd4fc(_0x528eb1);})[_0x02dc('0x11')](function(_0x571c71){logger[_0x02dc('0xd')]('ShowVtigerAccount',_0x571c71[_0x02dc('0xf')],_0x1d9cdd);_0x588aa4(_0x3b6604[_0x02dc('0xd')](0x1f4,_0x571c71[_0x02dc('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 5023765..7b64f7f 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 _0xb10b=['/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated'];(function(_0x3c0c1d,_0x273bcd){var _0x5c5445=function(_0x475adf){while(--_0x475adf){_0x3c0c1d['push'](_0x3c0c1d['shift']());}};_0x5c5445(++_0x273bcd);}(_0xb10b,0x12a));var _0xbb10=function(_0xc54c54,_0x59053b){_0xc54c54=_0xc54c54-0x0;var _0x476786=_0xb10b[_0xc54c54];return _0x476786;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0x8')](_0xbb10('0xe'),auth[_0xbb10('0x9')](),controller['getSubjects']);router['get'](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router['post']('/',auth[_0xbb10('0x9')](),controller['create']);router[_0xbb10('0x11')](_0xbb10('0xa'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x12')]);router[_0xbb10('0x13')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0x14')]);module[_0xbb10('0x15')]=router; \ No newline at end of file +var _0xb10b=['/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated'];(function(_0x3746db,_0x5983cc){var _0x1d4458=function(_0x17770f){while(--_0x17770f){_0x3746db['push'](_0x3746db['shift']());}};_0x1d4458(++_0x5983cc);}(_0xb10b,0x12a));var _0xbb10=function(_0x420745,_0x1a6314){_0x420745=_0x420745-0x0;var _0x153a1a=_0xb10b[_0x420745];return _0x153a1a;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0x8')](_0xbb10('0xe'),auth[_0xbb10('0x9')](),controller['getSubjects']);router['get'](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router['post']('/',auth[_0xbb10('0x9')](),controller['create']);router[_0xbb10('0x11')](_0xbb10('0xa'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x12')]);router[_0xbb10('0x13')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0x14')]);module[_0xbb10('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 b4cd2e2..ca4d4df 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 _0xe576=['STRING','sequelize','exports'];(function(_0x41f366,_0x19cf7d){var _0x33f5cc=function(_0x54df51){while(--_0x54df51){_0x41f366['push'](_0x41f366['shift']());}};_0x33f5cc(++_0x19cf7d);}(_0xe576,0x151));var _0x6e57=function(_0x4f20c3,_0x404155){_0x4f20c3=_0x4f20c3-0x0;var _0x223819=_0xe576[_0x4f20c3];return _0x223819;};'use strict';var Sequelize=require(_0x6e57('0x0'));module[_0x6e57('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6e57('0x2')]}}; \ No newline at end of file +var _0xdd73=['STRING','exports'];(function(_0x566407,_0x35c8ed){var _0x5dbbbe=function(_0x5c0d7f){while(--_0x5c0d7f){_0x566407['push'](_0x566407['shift']());}};_0x5dbbbe(++_0x35c8ed);}(_0xdd73,0xe1));var _0x3dd7=function(_0x28353f,_0x5b5ae2){_0x28353f=_0x28353f-0x0;var _0x6efccb=_0xdd73[_0x28353f];return _0x6efccb;};'use strict';var Sequelize=require('sequelize');module[_0x3dd7('0x0')]={'name':{'type':Sequelize[_0x3dd7('0x1')]},'description':{'type':Sequelize[_0x3dd7('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index ab0485b..4f53668 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 _0x58b6=['save','end','sendStatus','stack','name','send','map','VtigerConfiguration','fieldName','type','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','show','rawAttributes','fields','include','find','create','body','params','destroy','getFields','findOne','getSubjects','VtigerField','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','count','offset','limit','set','Content-Range','apply'];(function(_0x9148ba,_0x2cb1b5){var _0x355e3b=function(_0x134846){while(--_0x134846){_0x9148ba['push'](_0x9148ba['shift']());}};_0x355e3b(++_0x2cb1b5);}(_0x58b6,0x138));var _0x658b=function(_0x1f5062,_0x40a0fd){_0x1f5062=_0x1f5062-0x0;var _0x576b68=_0x58b6[_0x1f5062];return _0x576b68;};'use strict';var pdf=require(_0x658b('0x0'));var emlformat=require(_0x658b('0x1'));var rimraf=require(_0x658b('0x2'));var zipdir=require(_0x658b('0x3'));var jsonpatch=require(_0x658b('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x658b('0x5'));var util=require(_0x658b('0x6'));var path=require(_0x658b('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x658b('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x658b('0x9'));var crypto=require(_0x658b('0xa'));var jsforce=require(_0x658b('0xb'));var deskjs=require(_0x658b('0xc'));var toCsv=require(_0x658b('0xd'));var querystring=require('querystring');var Papa=require(_0x658b('0xe'));var Redis=require('ioredis');var authService=require(_0x658b('0xf'));var qs=require(_0x658b('0x10'));var as=require(_0x658b('0x11'));var hardwareService=require(_0x658b('0x12'));var logger=require(_0x658b('0x13'))('api');var utils=require(_0x658b('0x14'));var config=require(_0x658b('0x15'));var db=require(_0x658b('0x16'))['db'];var jayson=require(_0x658b('0x17'));var client=jayson[_0x658b('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x143e11,_0x570d04,_0x124dc0){if(_0x124dc0){var _0x300a25=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x300a25['test'](_0x570d04)){return _0x143e11;}else{throw new db[(_0x658b('0x19'))][(_0x658b('0x1a'))](_0x658b('0x1b'));}}else{return _0x143e11;}}function respondWithRpcPromise(_0x32d0fd,_0x3c4802,_0xae7c0,_0x13b26e){return new BPromise(function(_0x1d7142,_0xb544b5){var _0x483359=_0x13b26e||client;return _0x483359[_0x658b('0x1c')](_0x32d0fd,_0xae7c0)[_0x658b('0x1d')](function(_0xc39b44){logger[_0x658b('0x1e')](_0x658b('0x1f'),_0x3c4802,_0x658b('0x20'));logger['debug'](_0x658b('0x21'),_0x3c4802,_0x658b('0x20'),JSON[_0x658b('0x22')](_0xc39b44));if(_0xc39b44[_0x658b('0x23')]){if(_0xc39b44[_0x658b('0x23')][_0x658b('0x24')]===0x1f4){logger[_0x658b('0x23')](_0x658b('0x1f'),_0x3c4802,_0xc39b44[_0x658b('0x23')][_0x658b('0x25')]);return _0xb544b5(_0xc39b44['error'][_0x658b('0x25')]);}logger[_0x658b('0x23')](_0x658b('0x1f'),_0x3c4802,_0xc39b44['error']['message']);return _0x1d7142(_0xc39b44[_0x658b('0x23')][_0x658b('0x25')]);}else{logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x3c4802,_0x658b('0x20'));_0x1d7142(_0xc39b44[_0x658b('0x26')]['message']);}})[_0x658b('0x27')](function(_0x4ea911){logger['error'](_0x658b('0x1f'),_0x3c4802,_0x4ea911);_0xb544b5(_0x4ea911);});});}function respondWithStatusCode(_0xedc0d3,_0x1cead2){_0x1cead2=_0x1cead2||0xcc;return function(_0x1825a1){if(_0x1825a1){return _0xedc0d3['sendStatus'](_0x1cead2);}return _0xedc0d3[_0x658b('0x28')](_0x1cead2)['end']();};}function respondWithResult(_0x22fdd0,_0x3f47c9){_0x3f47c9=_0x3f47c9||0xc8;return function(_0x5031b9){if(_0x5031b9){return _0x22fdd0['status'](_0x3f47c9)[_0x658b('0x29')](_0x5031b9);}};}function respondWithFilteredResult(_0x129f89,_0x133866){return function(_0x25e889){if(_0x25e889){var _0x4af9a0=_0x25e889[_0x658b('0x2a')],_0x31522e=_0x133866[_0x658b('0x2b')],_0x37aba9=_0x133866[_0x658b('0x2b')]+_0x133866[_0x658b('0x2c')],_0x5f3141;if(_0x37aba9>=_0x4af9a0){_0x37aba9=_0x4af9a0;_0x5f3141=0xc8;}else{_0x5f3141=0xce;}_0x129f89[_0x658b('0x28')](_0x5f3141);return _0x129f89[_0x658b('0x2d')](_0x658b('0x2e'),_0x31522e+'-'+_0x37aba9+'/'+_0x4af9a0)['json'](_0x25e889);}return null;};}function patchUpdates(_0x174aa1){return function(_0x57c8ec){try{jsonpatch[_0x658b('0x2f')](_0x57c8ec,_0x174aa1,!![]);}catch(_0x85c8ff){return BPromise['reject'](_0x85c8ff);}return _0x57c8ec[_0x658b('0x30')]();};}function saveUpdates(_0x14b242,_0x5b7e23){return function(_0x1bb510){if(_0x1bb510){return _0x1bb510['update'](_0x14b242)[_0x658b('0x1d')](function(_0x35b30d){return _0x35b30d;});}return null;};}function removeEntity(_0x452667,_0x1a1da6){return function(_0x5e5721){if(_0x5e5721){return _0x5e5721['destroy']()[_0x658b('0x1d')](function(){_0x452667[_0x658b('0x28')](0xcc)[_0x658b('0x31')]();});}};}function handleEntityNotFound(_0x47d316,_0x2f97cc){return function(_0x5a3a26){if(!_0x5a3a26){_0x47d316[_0x658b('0x32')](0x194);}return _0x5a3a26;};}function handleError(_0x4f79a6,_0x74630f){_0x74630f=_0x74630f||0x1f4;return function(_0x46699c){logger[_0x658b('0x23')](_0x46699c[_0x658b('0x33')]);if(_0x46699c['name']){delete _0x46699c[_0x658b('0x34')];}_0x4f79a6[_0x658b('0x28')](_0x74630f)[_0x658b('0x35')](_0x46699c);};}exports['index']=function(_0x9edfb7,_0x129d5b){var _0x2bc2bb={},_0x1f142e={},_0x1795c7={'count':0x0,'rows':[]};var _0x14b9f3=_[_0x658b('0x36')](db[_0x658b('0x37')]['rawAttributes'],function(_0x25b154){return{'name':_0x25b154[_0x658b('0x38')],'type':_0x25b154[_0x658b('0x39')]['key']};});_0x1f142e[_0x658b('0x3a')]=_['map'](_0x14b9f3,'name');_0x1f142e[_0x658b('0x3b')]=_[_0x658b('0x3c')](_0x9edfb7['query']);_0x1f142e[_0x658b('0x3d')]=_['intersection'](_0x1f142e[_0x658b('0x3a')],_0x1f142e[_0x658b('0x3b')]);_0x2bc2bb[_0x658b('0x3e')]=_[_0x658b('0x3f')](_0x1f142e[_0x658b('0x3a')],qs['fields'](_0x9edfb7[_0x658b('0x3b')]['fields']));_0x2bc2bb['attributes']=_0x2bc2bb[_0x658b('0x3e')][_0x658b('0x40')]?_0x2bc2bb[_0x658b('0x3e')]:_0x1f142e[_0x658b('0x3a')];if(!_0x9edfb7[_0x658b('0x3b')][_0x658b('0x41')](_0x658b('0x42'))){_0x2bc2bb['limit']=qs[_0x658b('0x2c')](_0x9edfb7[_0x658b('0x3b')][_0x658b('0x2c')]);_0x2bc2bb[_0x658b('0x2b')]=qs[_0x658b('0x2b')](_0x9edfb7[_0x658b('0x3b')]['offset']);}_0x2bc2bb[_0x658b('0x43')]=qs['sort'](_0x9edfb7['query'][_0x658b('0x44')]);_0x2bc2bb[_0x658b('0x45')]=qs[_0x658b('0x3d')](_[_0x658b('0x46')](_0x9edfb7[_0x658b('0x3b')],_0x1f142e[_0x658b('0x3d')]));if(_0x9edfb7[_0x658b('0x3b')][_0x658b('0x47')]){_0x2bc2bb[_0x658b('0x45')]=_[_0x658b('0x48')](_0x2bc2bb[_0x658b('0x45')],{'$or':_[_0x658b('0x36')](_0x14b9f3,function(_0x4521f4){if(_0x4521f4[_0x658b('0x39')]!==_0x658b('0x49')){var _0x87912d={};_0x87912d[_0x4521f4[_0x658b('0x34')]]={'$like':'%'+_0x9edfb7[_0x658b('0x3b')]['filter']+'%'};return _0x87912d;}})});}_0x2bc2bb=_[_0x658b('0x48')]({},_0x2bc2bb,_0x9edfb7[_0x658b('0x4a')]);var _0x315481={'where':_0x2bc2bb[_0x658b('0x45')]};return db[_0x658b('0x37')]['count'](_0x315481)[_0x658b('0x1d')](function(_0x50de74){_0x1795c7['count']=_0x50de74;if(_0x9edfb7[_0x658b('0x3b')]['includeAll']){_0x2bc2bb['include']=[{'all':!![]}];}return db[_0x658b('0x37')][_0x658b('0x4b')](_0x2bc2bb);})['then'](function(_0x345dd4){_0x1795c7['rows']=_0x345dd4;return _0x1795c7;})[_0x658b('0x1d')](respondWithFilteredResult(_0x129d5b,_0x2bc2bb))[_0x658b('0x27')](handleError(_0x129d5b,null));};exports[_0x658b('0x4c')]=function(_0x57f296,_0x3c6b50){var _0x1156ef={'raw':![],'where':{'id':_0x57f296['params']['id']}},_0x5e0561={};_0x5e0561[_0x658b('0x3a')]=_['keys'](db[_0x658b('0x37')][_0x658b('0x4d')]);_0x5e0561[_0x658b('0x3b')]=_[_0x658b('0x3c')](_0x57f296[_0x658b('0x3b')]);_0x5e0561['filters']=_[_0x658b('0x3f')](_0x5e0561['model'],_0x5e0561[_0x658b('0x3b')]);_0x1156ef[_0x658b('0x3e')]=_[_0x658b('0x3f')](_0x5e0561[_0x658b('0x3a')],qs[_0x658b('0x4e')](_0x57f296[_0x658b('0x3b')][_0x658b('0x4e')]));_0x1156ef[_0x658b('0x3e')]=_0x1156ef['attributes'][_0x658b('0x40')]?_0x1156ef[_0x658b('0x3e')]:_0x5e0561[_0x658b('0x3a')];if(_0x57f296[_0x658b('0x3b')]['includeAll']){_0x1156ef[_0x658b('0x4f')]=[{'all':!![]}];}_0x1156ef=_['merge']({},_0x1156ef,_0x57f296[_0x658b('0x4a')]);return db[_0x658b('0x37')][_0x658b('0x50')](_0x1156ef)['then'](handleEntityNotFound(_0x3c6b50,null))[_0x658b('0x1d')](respondWithResult(_0x3c6b50,null))[_0x658b('0x27')](handleError(_0x3c6b50,null));};exports[_0x658b('0x51')]=function(_0x3f6fec,_0x5ac74d){return db[_0x658b('0x37')]['create'](_0x3f6fec[_0x658b('0x52')],{})['then'](respondWithResult(_0x5ac74d,0xc9))[_0x658b('0x27')](handleError(_0x5ac74d,null));};exports['update']=function(_0x1c5857,_0x236eef){if(_0x1c5857['body']['id']){delete _0x1c5857[_0x658b('0x52')]['id'];}return db[_0x658b('0x37')][_0x658b('0x50')]({'where':{'id':_0x1c5857[_0x658b('0x53')]['id']}})[_0x658b('0x1d')](handleEntityNotFound(_0x236eef,null))[_0x658b('0x1d')](saveUpdates(_0x1c5857[_0x658b('0x52')],null))[_0x658b('0x1d')](respondWithResult(_0x236eef,null))[_0x658b('0x27')](handleError(_0x236eef,null));};exports[_0x658b('0x54')]=function(_0x2b4a84,_0x6b8dfc){return db['VtigerConfiguration'][_0x658b('0x50')]({'where':{'id':_0x2b4a84['params']['id']}})[_0x658b('0x1d')](handleEntityNotFound(_0x6b8dfc,null))[_0x658b('0x1d')](removeEntity(_0x6b8dfc,null))[_0x658b('0x27')](handleError(_0x6b8dfc,null));};exports[_0x658b('0x55')]=function(_0x43f27b,_0x4456f9,_0x24c478){var _0x40601b={};var _0x16f28e={};var _0x748132;var _0x16df2c;return db[_0x658b('0x37')][_0x658b('0x56')]({'where':{'id':_0x43f27b[_0x658b('0x53')]['id']}})[_0x658b('0x1d')](handleEntityNotFound(_0x4456f9,null))['then'](function(_0x11d57e){if(_0x11d57e){_0x748132=_0x11d57e;_0x16f28e[_0x658b('0x3a')]=_[_0x658b('0x3c')](db['VtigerField'][_0x658b('0x4d')]);_0x16f28e[_0x658b('0x3b')]=_[_0x658b('0x3c')](_0x43f27b[_0x658b('0x3b')]);_0x16f28e['filters']=_[_0x658b('0x3f')](_0x16f28e[_0x658b('0x3a')],_0x16f28e[_0x658b('0x3b')]);_0x40601b[_0x658b('0x3e')]=_['intersection'](_0x16f28e[_0x658b('0x3a')],qs[_0x658b('0x4e')](_0x43f27b['query'][_0x658b('0x4e')]));_0x40601b[_0x658b('0x3e')]=_0x40601b[_0x658b('0x3e')][_0x658b('0x40')]?_0x40601b[_0x658b('0x3e')]:_0x16f28e[_0x658b('0x3a')];_0x40601b['order']=qs['sort'](_0x43f27b[_0x658b('0x3b')]['sort']);_0x40601b['where']=qs[_0x658b('0x3d')](_[_0x658b('0x46')](_0x43f27b[_0x658b('0x3b')],_0x16f28e[_0x658b('0x3d')]));if(_0x43f27b['query'][_0x658b('0x47')]){_0x40601b[_0x658b('0x45')]=_[_0x658b('0x48')](_0x40601b[_0x658b('0x45')],{'$or':_[_0x658b('0x36')](_0x40601b[_0x658b('0x3e')],function(_0x260fee){var _0x1085f2={};_0x1085f2[_0x260fee]={'$like':'%'+_0x43f27b[_0x658b('0x3b')][_0x658b('0x47')]+'%'};return _0x1085f2;})});}_0x40601b=_[_0x658b('0x48')]({},_0x40601b,_0x43f27b['options']);return _0x748132['getFields'](_0x40601b);}})['then'](function(_0x39aae6){if(_0x39aae6){_0x16df2c=_0x39aae6[_0x658b('0x40')];if(!_0x43f27b[_0x658b('0x3b')][_0x658b('0x41')](_0x658b('0x42'))){_0x40601b[_0x658b('0x2c')]=qs[_0x658b('0x2c')](_0x43f27b['query'][_0x658b('0x2c')]);_0x40601b['offset']=qs[_0x658b('0x2b')](_0x43f27b[_0x658b('0x3b')][_0x658b('0x2b')]);}return _0x748132[_0x658b('0x55')](_0x40601b);}})[_0x658b('0x1d')](function(_0x1377f5){if(_0x1377f5){return _0x1377f5?{'count':_0x16df2c,'rows':_0x1377f5}:null;}})['then'](respondWithResult(_0x4456f9,null))[_0x658b('0x27')](handleError(_0x4456f9,null));};exports[_0x658b('0x57')]=function(_0x3f76e9,_0x48142d,_0x5f42fc){var _0x3d7e9f={};var _0x1e7d5a={};var _0x3d6b5f;var _0x5e078a;return db[_0x658b('0x37')][_0x658b('0x56')]({'where':{'id':_0x3f76e9[_0x658b('0x53')]['id']}})[_0x658b('0x1d')](handleEntityNotFound(_0x48142d,null))[_0x658b('0x1d')](function(_0x4f8035){if(_0x4f8035){_0x3d6b5f=_0x4f8035;_0x1e7d5a[_0x658b('0x3a')]=_['keys'](db[_0x658b('0x58')]['rawAttributes']);_0x1e7d5a[_0x658b('0x3b')]=_[_0x658b('0x3c')](_0x3f76e9[_0x658b('0x3b')]);_0x1e7d5a[_0x658b('0x3d')]=_['intersection'](_0x1e7d5a[_0x658b('0x3a')],_0x1e7d5a[_0x658b('0x3b')]);_0x3d7e9f[_0x658b('0x3e')]=_[_0x658b('0x3f')](_0x1e7d5a[_0x658b('0x3a')],qs[_0x658b('0x4e')](_0x3f76e9[_0x658b('0x3b')][_0x658b('0x4e')]));_0x3d7e9f[_0x658b('0x3e')]=_0x3d7e9f[_0x658b('0x3e')][_0x658b('0x40')]?_0x3d7e9f[_0x658b('0x3e')]:_0x1e7d5a[_0x658b('0x3a')];_0x3d7e9f[_0x658b('0x43')]=qs[_0x658b('0x44')](_0x3f76e9[_0x658b('0x3b')][_0x658b('0x44')]);_0x3d7e9f['where']=qs[_0x658b('0x3d')](_[_0x658b('0x46')](_0x3f76e9[_0x658b('0x3b')],_0x1e7d5a[_0x658b('0x3d')]));if(_0x3f76e9[_0x658b('0x3b')][_0x658b('0x47')]){_0x3d7e9f[_0x658b('0x45')]=_['merge'](_0x3d7e9f[_0x658b('0x45')],{'$or':_[_0x658b('0x36')](_0x3d7e9f[_0x658b('0x3e')],function(_0x8d4617){var _0x3798c2={};_0x3798c2[_0x8d4617]={'$like':'%'+_0x3f76e9['query'][_0x658b('0x47')]+'%'};return _0x3798c2;})});}_0x3d7e9f=_['merge']({},_0x3d7e9f,_0x3f76e9[_0x658b('0x4a')]);return _0x3d6b5f[_0x658b('0x57')](_0x3d7e9f);}})[_0x658b('0x1d')](function(_0x457f7b){if(_0x457f7b){_0x5e078a=_0x457f7b[_0x658b('0x40')];if(!_0x3f76e9[_0x658b('0x3b')][_0x658b('0x41')](_0x658b('0x42'))){_0x3d7e9f[_0x658b('0x2c')]=qs['limit'](_0x3f76e9[_0x658b('0x3b')][_0x658b('0x2c')]);_0x3d7e9f[_0x658b('0x2b')]=qs[_0x658b('0x2b')](_0x3f76e9['query'][_0x658b('0x2b')]);}return _0x3d6b5f['getSubjects'](_0x3d7e9f);}})[_0x658b('0x1d')](function(_0x143d96){if(_0x143d96){return _0x143d96?{'count':_0x5e078a,'rows':_0x143d96}:null;}})[_0x658b('0x1d')](respondWithResult(_0x48142d,null))[_0x658b('0x27')](handleError(_0x48142d,null));};exports[_0x658b('0x59')]=function(_0x440a47,_0x44aecb,_0x39d712){var _0xd78954={};var _0x2c8f79={};var _0x7a606e;var _0x14e403;return db['VtigerConfiguration'][_0x658b('0x56')]({'where':{'id':_0x440a47['params']['id']}})['then'](handleEntityNotFound(_0x44aecb,null))[_0x658b('0x1d')](function(_0x41b71d){if(_0x41b71d){_0x7a606e=_0x41b71d;_0x2c8f79[_0x658b('0x3a')]=_[_0x658b('0x3c')](db[_0x658b('0x58')]['rawAttributes']);_0x2c8f79[_0x658b('0x3b')]=_[_0x658b('0x3c')](_0x440a47['query']);_0x2c8f79['filters']=_[_0x658b('0x3f')](_0x2c8f79[_0x658b('0x3a')],_0x2c8f79[_0x658b('0x3b')]);_0xd78954[_0x658b('0x3e')]=_[_0x658b('0x3f')](_0x2c8f79[_0x658b('0x3a')],qs['fields'](_0x440a47[_0x658b('0x3b')][_0x658b('0x4e')]));_0xd78954['attributes']=_0xd78954[_0x658b('0x3e')][_0x658b('0x40')]?_0xd78954['attributes']:_0x2c8f79[_0x658b('0x3a')];_0xd78954[_0x658b('0x43')]=qs[_0x658b('0x44')](_0x440a47[_0x658b('0x3b')][_0x658b('0x44')]);_0xd78954['where']=qs[_0x658b('0x3d')](_[_0x658b('0x46')](_0x440a47[_0x658b('0x3b')],_0x2c8f79[_0x658b('0x3d')]));if(_0x440a47[_0x658b('0x3b')][_0x658b('0x47')]){_0xd78954[_0x658b('0x45')]=_[_0x658b('0x48')](_0xd78954[_0x658b('0x45')],{'$or':_[_0x658b('0x36')](_0xd78954[_0x658b('0x3e')],function(_0x49286b){var _0x39c820={};_0x39c820[_0x49286b]={'$like':'%'+_0x440a47[_0x658b('0x3b')][_0x658b('0x47')]+'%'};return _0x39c820;})});}_0xd78954=_[_0x658b('0x48')]({},_0xd78954,_0x440a47[_0x658b('0x4a')]);return _0x7a606e[_0x658b('0x59')](_0xd78954);}})[_0x658b('0x1d')](function(_0x46d24f){if(_0x46d24f){_0x14e403=_0x46d24f['length'];if(!_0x440a47[_0x658b('0x3b')][_0x658b('0x41')](_0x658b('0x42'))){_0xd78954[_0x658b('0x2c')]=qs[_0x658b('0x2c')](_0x440a47[_0x658b('0x3b')][_0x658b('0x2c')]);_0xd78954[_0x658b('0x2b')]=qs[_0x658b('0x2b')](_0x440a47[_0x658b('0x3b')][_0x658b('0x2b')]);}return _0x7a606e['getDescriptions'](_0xd78954);}})[_0x658b('0x1d')](function(_0x4957a5){if(_0x4957a5){return _0x4957a5?{'count':_0x14e403,'rows':_0x4957a5}:null;}})['then'](respondWithResult(_0x44aecb,null))[_0x658b('0x27')](handleError(_0x44aecb,null));}; \ No newline at end of file +var _0xd3a2=['map','VtigerConfiguration','rawAttributes','type','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','keys','length','includeAll','find','body','destroy','getFields','findOne','VtigerField','getSubjects','getDescriptions','eml-format','fast-json-patch','moment','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','request','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','stack','name','send'];(function(_0x924c29,_0x309120){var _0x24ddd6=function(_0x1c8a9e){while(--_0x1c8a9e){_0x924c29['push'](_0x924c29['shift']());}};_0x24ddd6(++_0x309120);}(_0xd3a2,0x7c));var _0x2d3a=function(_0x43b48f,_0x5f1083){_0x43b48f=_0x43b48f-0x0;var _0x105db9=_0xd3a2[_0x43b48f];return _0x105db9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2d3a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2d3a('0x1'));var rp=require('request-promise');var moment=require(_0x2d3a('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2d3a('0x3'));var path=require(_0x2d3a('0x4'));var sox=require(_0x2d3a('0x5'));var csv=require(_0x2d3a('0x6'));var ejs=require(_0x2d3a('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2d3a('0x8'));var crypto=require('crypto');var jsforce=require(_0x2d3a('0x9'));var deskjs=require(_0x2d3a('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2d3a('0xb'));var authService=require(_0x2d3a('0xc'));var qs=require(_0x2d3a('0xd'));var as=require(_0x2d3a('0xe'));var hardwareService=require(_0x2d3a('0xf'));var logger=require(_0x2d3a('0x10'))(_0x2d3a('0x11'));var utils=require(_0x2d3a('0x12'));var config=require(_0x2d3a('0x13'));var db=require(_0x2d3a('0x14'))['db'];var jayson=require(_0x2d3a('0x15'));var client=jayson[_0x2d3a('0x16')][_0x2d3a('0x17')]({'port':0x232a});function checkPasswordPattern(_0x234d89,_0x48e125,_0x4c7434){if(_0x4c7434){var _0x22c2ef=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x22c2ef[_0x2d3a('0x18')](_0x48e125)){return _0x234d89;}else{throw new db[(_0x2d3a('0x19'))]['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~!@#$%^&-_=+[{]}.');}}else{return _0x234d89;}}function respondWithRpcPromise(_0x31e6c1,_0x272006,_0x3d8b73,_0x783914){return new BPromise(function(_0x2049a0,_0x2e0a8f){var _0x2d5771=_0x783914||client;return _0x2d5771[_0x2d3a('0x1a')](_0x31e6c1,_0x3d8b73)['then'](function(_0x341c07){logger[_0x2d3a('0x1b')](_0x2d3a('0x1c'),_0x272006,'request\x20sent');logger['debug']('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x272006,_0x2d3a('0x1d'),JSON[_0x2d3a('0x1e')](_0x341c07));if(_0x341c07[_0x2d3a('0x1f')]){if(_0x341c07[_0x2d3a('0x1f')][_0x2d3a('0x20')]===0x1f4){logger['error'](_0x2d3a('0x1c'),_0x272006,_0x341c07[_0x2d3a('0x1f')]['message']);return _0x2e0a8f(_0x341c07[_0x2d3a('0x1f')][_0x2d3a('0x21')]);}logger[_0x2d3a('0x1f')]('VtigerConfiguration,\x20%s,\x20%s',_0x272006,_0x341c07[_0x2d3a('0x1f')]['message']);return _0x2049a0(_0x341c07[_0x2d3a('0x1f')][_0x2d3a('0x21')]);}else{logger[_0x2d3a('0x1b')](_0x2d3a('0x1c'),_0x272006,_0x2d3a('0x1d'));_0x2049a0(_0x341c07['result'][_0x2d3a('0x21')]);}})[_0x2d3a('0x22')](function(_0x5cbed7){logger['error'](_0x2d3a('0x1c'),_0x272006,_0x5cbed7);_0x2e0a8f(_0x5cbed7);});});}function respondWithStatusCode(_0x5da2de,_0x217d8e){_0x217d8e=_0x217d8e||0xcc;return function(_0x480636){if(_0x480636){return _0x5da2de['sendStatus'](_0x217d8e);}return _0x5da2de[_0x2d3a('0x23')](_0x217d8e)[_0x2d3a('0x24')]();};}function respondWithResult(_0x386f11,_0x1a0d0d){_0x1a0d0d=_0x1a0d0d||0xc8;return function(_0x39f2ab){if(_0x39f2ab){return _0x386f11[_0x2d3a('0x23')](_0x1a0d0d)[_0x2d3a('0x25')](_0x39f2ab);}};}function respondWithFilteredResult(_0x5c4f1c,_0x4a58b0){return function(_0x1eec31){if(_0x1eec31){var _0x216951=_0x1eec31[_0x2d3a('0x26')],_0x3e47d3=_0x4a58b0[_0x2d3a('0x27')],_0x5f1cc2=_0x4a58b0['offset']+_0x4a58b0[_0x2d3a('0x28')],_0x33650b;if(_0x5f1cc2>=_0x216951){_0x5f1cc2=_0x216951;_0x33650b=0xc8;}else{_0x33650b=0xce;}_0x5c4f1c[_0x2d3a('0x23')](_0x33650b);return _0x5c4f1c[_0x2d3a('0x29')](_0x2d3a('0x2a'),_0x3e47d3+'-'+_0x5f1cc2+'/'+_0x216951)[_0x2d3a('0x25')](_0x1eec31);}return null;};}function patchUpdates(_0x503c75){return function(_0x59a983){try{jsonpatch[_0x2d3a('0x2b')](_0x59a983,_0x503c75,!![]);}catch(_0x719e54){return BPromise[_0x2d3a('0x2c')](_0x719e54);}return _0x59a983[_0x2d3a('0x2d')]();};}function saveUpdates(_0x167f42,_0x5af608){return function(_0x54061b){if(_0x54061b){return _0x54061b[_0x2d3a('0x2e')](_0x167f42)[_0x2d3a('0x2f')](function(_0xa10eb6){return _0xa10eb6;});}return null;};}function removeEntity(_0x1a04bc,_0x1b75c4){return function(_0x36e179){if(_0x36e179){return _0x36e179['destroy']()[_0x2d3a('0x2f')](function(){_0x1a04bc[_0x2d3a('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x360b1d,_0xf7100d){return function(_0x2ab421){if(!_0x2ab421){_0x360b1d[_0x2d3a('0x30')](0x194);}return _0x2ab421;};}function handleError(_0x498e8b,_0x4a725d){_0x4a725d=_0x4a725d||0x1f4;return function(_0x382a0e){logger[_0x2d3a('0x1f')](_0x382a0e[_0x2d3a('0x31')]);if(_0x382a0e[_0x2d3a('0x32')]){delete _0x382a0e[_0x2d3a('0x32')];}_0x498e8b[_0x2d3a('0x23')](_0x4a725d)[_0x2d3a('0x33')](_0x382a0e);};}exports['index']=function(_0x4a4457,_0xe8097a){var _0x53f3e8={},_0x14d4f5={},_0x26d096={'count':0x0,'rows':[]};var _0xd15c28=_[_0x2d3a('0x34')](db[_0x2d3a('0x35')][_0x2d3a('0x36')],function(_0x661eac){return{'name':_0x661eac['fieldName'],'type':_0x661eac[_0x2d3a('0x37')]['key']};});_0x14d4f5[_0x2d3a('0x38')]=_[_0x2d3a('0x34')](_0xd15c28,'name');_0x14d4f5[_0x2d3a('0x39')]=_['keys'](_0x4a4457['query']);_0x14d4f5['filters']=_[_0x2d3a('0x3a')](_0x14d4f5[_0x2d3a('0x38')],_0x14d4f5['query']);_0x53f3e8[_0x2d3a('0x3b')]=_['intersection'](_0x14d4f5[_0x2d3a('0x38')],qs[_0x2d3a('0x3c')](_0x4a4457[_0x2d3a('0x39')][_0x2d3a('0x3c')]));_0x53f3e8['attributes']=_0x53f3e8['attributes']['length']?_0x53f3e8[_0x2d3a('0x3b')]:_0x14d4f5[_0x2d3a('0x38')];if(!_0x4a4457[_0x2d3a('0x39')][_0x2d3a('0x3d')](_0x2d3a('0x3e'))){_0x53f3e8[_0x2d3a('0x28')]=qs['limit'](_0x4a4457[_0x2d3a('0x39')][_0x2d3a('0x28')]);_0x53f3e8[_0x2d3a('0x27')]=qs[_0x2d3a('0x27')](_0x4a4457[_0x2d3a('0x39')][_0x2d3a('0x27')]);}_0x53f3e8[_0x2d3a('0x3f')]=qs[_0x2d3a('0x40')](_0x4a4457['query']['sort']);_0x53f3e8[_0x2d3a('0x41')]=qs[_0x2d3a('0x42')](_[_0x2d3a('0x43')](_0x4a4457[_0x2d3a('0x39')],_0x14d4f5[_0x2d3a('0x42')]));if(_0x4a4457[_0x2d3a('0x39')][_0x2d3a('0x44')]){_0x53f3e8[_0x2d3a('0x41')]=_[_0x2d3a('0x45')](_0x53f3e8[_0x2d3a('0x41')],{'$or':_[_0x2d3a('0x34')](_0xd15c28,function(_0x32145f){if(_0x32145f[_0x2d3a('0x37')]!==_0x2d3a('0x46')){var _0x42eeef={};_0x42eeef[_0x32145f['name']]={'$like':'%'+_0x4a4457['query'][_0x2d3a('0x44')]+'%'};return _0x42eeef;}})});}_0x53f3e8=_['merge']({},_0x53f3e8,_0x4a4457[_0x2d3a('0x47')]);var _0x541f15={'where':_0x53f3e8['where']};return db[_0x2d3a('0x35')][_0x2d3a('0x26')](_0x541f15)[_0x2d3a('0x2f')](function(_0x501f26){_0x26d096[_0x2d3a('0x26')]=_0x501f26;if(_0x4a4457['query']['includeAll']){_0x53f3e8[_0x2d3a('0x48')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0x2d3a('0x49')](_0x53f3e8);})[_0x2d3a('0x2f')](function(_0x512f61){_0x26d096[_0x2d3a('0x4a')]=_0x512f61;return _0x26d096;})[_0x2d3a('0x2f')](respondWithFilteredResult(_0xe8097a,_0x53f3e8))['catch'](handleError(_0xe8097a,null));};exports[_0x2d3a('0x4b')]=function(_0x2f3667,_0xd1978a){var _0x7100bd={'raw':![],'where':{'id':_0x2f3667[_0x2d3a('0x4c')]['id']}},_0x4f4ea9={};_0x4f4ea9[_0x2d3a('0x38')]=_[_0x2d3a('0x4d')](db[_0x2d3a('0x35')]['rawAttributes']);_0x4f4ea9[_0x2d3a('0x39')]=_['keys'](_0x2f3667['query']);_0x4f4ea9['filters']=_[_0x2d3a('0x3a')](_0x4f4ea9[_0x2d3a('0x38')],_0x4f4ea9[_0x2d3a('0x39')]);_0x7100bd[_0x2d3a('0x3b')]=_[_0x2d3a('0x3a')](_0x4f4ea9[_0x2d3a('0x38')],qs[_0x2d3a('0x3c')](_0x2f3667[_0x2d3a('0x39')][_0x2d3a('0x3c')]));_0x7100bd[_0x2d3a('0x3b')]=_0x7100bd['attributes'][_0x2d3a('0x4e')]?_0x7100bd['attributes']:_0x4f4ea9[_0x2d3a('0x38')];if(_0x2f3667[_0x2d3a('0x39')][_0x2d3a('0x4f')]){_0x7100bd['include']=[{'all':!![]}];}_0x7100bd=_[_0x2d3a('0x45')]({},_0x7100bd,_0x2f3667[_0x2d3a('0x47')]);return db['VtigerConfiguration'][_0x2d3a('0x50')](_0x7100bd)['then'](handleEntityNotFound(_0xd1978a,null))[_0x2d3a('0x2f')](respondWithResult(_0xd1978a,null))[_0x2d3a('0x22')](handleError(_0xd1978a,null));};exports['create']=function(_0x56d974,_0x5676e9){return db['VtigerConfiguration']['create'](_0x56d974[_0x2d3a('0x51')],{})['then'](respondWithResult(_0x5676e9,0xc9))['catch'](handleError(_0x5676e9,null));};exports[_0x2d3a('0x2e')]=function(_0x1b51a2,_0x946915){if(_0x1b51a2[_0x2d3a('0x51')]['id']){delete _0x1b51a2['body']['id'];}return db['VtigerConfiguration'][_0x2d3a('0x50')]({'where':{'id':_0x1b51a2[_0x2d3a('0x4c')]['id']}})[_0x2d3a('0x2f')](handleEntityNotFound(_0x946915,null))[_0x2d3a('0x2f')](saveUpdates(_0x1b51a2['body'],null))[_0x2d3a('0x2f')](respondWithResult(_0x946915,null))[_0x2d3a('0x22')](handleError(_0x946915,null));};exports[_0x2d3a('0x52')]=function(_0x5b2a14,_0x142fed){return db[_0x2d3a('0x35')][_0x2d3a('0x50')]({'where':{'id':_0x5b2a14[_0x2d3a('0x4c')]['id']}})[_0x2d3a('0x2f')](handleEntityNotFound(_0x142fed,null))[_0x2d3a('0x2f')](removeEntity(_0x142fed,null))['catch'](handleError(_0x142fed,null));};exports[_0x2d3a('0x53')]=function(_0x364910,_0x44a2b0,_0x5b3115){var _0x486610={};var _0x25a452={};var _0x51b401;var _0x47f6ac;return db[_0x2d3a('0x35')][_0x2d3a('0x54')]({'where':{'id':_0x364910[_0x2d3a('0x4c')]['id']}})[_0x2d3a('0x2f')](handleEntityNotFound(_0x44a2b0,null))[_0x2d3a('0x2f')](function(_0xcbc96){if(_0xcbc96){_0x51b401=_0xcbc96;_0x25a452['model']=_['keys'](db[_0x2d3a('0x55')][_0x2d3a('0x36')]);_0x25a452[_0x2d3a('0x39')]=_[_0x2d3a('0x4d')](_0x364910[_0x2d3a('0x39')]);_0x25a452[_0x2d3a('0x42')]=_[_0x2d3a('0x3a')](_0x25a452[_0x2d3a('0x38')],_0x25a452[_0x2d3a('0x39')]);_0x486610['attributes']=_['intersection'](_0x25a452['model'],qs[_0x2d3a('0x3c')](_0x364910[_0x2d3a('0x39')][_0x2d3a('0x3c')]));_0x486610[_0x2d3a('0x3b')]=_0x486610[_0x2d3a('0x3b')][_0x2d3a('0x4e')]?_0x486610[_0x2d3a('0x3b')]:_0x25a452[_0x2d3a('0x38')];_0x486610[_0x2d3a('0x3f')]=qs[_0x2d3a('0x40')](_0x364910[_0x2d3a('0x39')][_0x2d3a('0x40')]);_0x486610[_0x2d3a('0x41')]=qs[_0x2d3a('0x42')](_['pick'](_0x364910[_0x2d3a('0x39')],_0x25a452[_0x2d3a('0x42')]));if(_0x364910[_0x2d3a('0x39')][_0x2d3a('0x44')]){_0x486610['where']=_[_0x2d3a('0x45')](_0x486610['where'],{'$or':_[_0x2d3a('0x34')](_0x486610[_0x2d3a('0x3b')],function(_0x23215a){var _0x18f45b={};_0x18f45b[_0x23215a]={'$like':'%'+_0x364910[_0x2d3a('0x39')][_0x2d3a('0x44')]+'%'};return _0x18f45b;})});}_0x486610=_['merge']({},_0x486610,_0x364910['options']);return _0x51b401[_0x2d3a('0x53')](_0x486610);}})['then'](function(_0x2ba862){if(_0x2ba862){_0x47f6ac=_0x2ba862['length'];if(!_0x364910[_0x2d3a('0x39')][_0x2d3a('0x3d')]('nolimit')){_0x486610[_0x2d3a('0x28')]=qs[_0x2d3a('0x28')](_0x364910[_0x2d3a('0x39')]['limit']);_0x486610[_0x2d3a('0x27')]=qs[_0x2d3a('0x27')](_0x364910[_0x2d3a('0x39')][_0x2d3a('0x27')]);}return _0x51b401[_0x2d3a('0x53')](_0x486610);}})[_0x2d3a('0x2f')](function(_0x3d76ec){if(_0x3d76ec){return _0x3d76ec?{'count':_0x47f6ac,'rows':_0x3d76ec}:null;}})[_0x2d3a('0x2f')](respondWithResult(_0x44a2b0,null))[_0x2d3a('0x22')](handleError(_0x44a2b0,null));};exports[_0x2d3a('0x56')]=function(_0x53862a,_0x10be17,_0x38f4fd){var _0x6cac6e={};var _0x54f020={};var _0xdbe643;var _0x5d6d0d;return db[_0x2d3a('0x35')][_0x2d3a('0x54')]({'where':{'id':_0x53862a[_0x2d3a('0x4c')]['id']}})[_0x2d3a('0x2f')](handleEntityNotFound(_0x10be17,null))[_0x2d3a('0x2f')](function(_0x79e5ec){if(_0x79e5ec){_0xdbe643=_0x79e5ec;_0x54f020['model']=_[_0x2d3a('0x4d')](db[_0x2d3a('0x55')][_0x2d3a('0x36')]);_0x54f020[_0x2d3a('0x39')]=_[_0x2d3a('0x4d')](_0x53862a[_0x2d3a('0x39')]);_0x54f020['filters']=_[_0x2d3a('0x3a')](_0x54f020[_0x2d3a('0x38')],_0x54f020['query']);_0x6cac6e[_0x2d3a('0x3b')]=_[_0x2d3a('0x3a')](_0x54f020[_0x2d3a('0x38')],qs['fields'](_0x53862a[_0x2d3a('0x39')]['fields']));_0x6cac6e[_0x2d3a('0x3b')]=_0x6cac6e[_0x2d3a('0x3b')][_0x2d3a('0x4e')]?_0x6cac6e[_0x2d3a('0x3b')]:_0x54f020[_0x2d3a('0x38')];_0x6cac6e[_0x2d3a('0x3f')]=qs['sort'](_0x53862a[_0x2d3a('0x39')][_0x2d3a('0x40')]);_0x6cac6e[_0x2d3a('0x41')]=qs[_0x2d3a('0x42')](_['pick'](_0x53862a['query'],_0x54f020[_0x2d3a('0x42')]));if(_0x53862a[_0x2d3a('0x39')][_0x2d3a('0x44')]){_0x6cac6e[_0x2d3a('0x41')]=_[_0x2d3a('0x45')](_0x6cac6e[_0x2d3a('0x41')],{'$or':_[_0x2d3a('0x34')](_0x6cac6e[_0x2d3a('0x3b')],function(_0xda0b9b){var _0x1684aa={};_0x1684aa[_0xda0b9b]={'$like':'%'+_0x53862a[_0x2d3a('0x39')]['filter']+'%'};return _0x1684aa;})});}_0x6cac6e=_[_0x2d3a('0x45')]({},_0x6cac6e,_0x53862a[_0x2d3a('0x47')]);return _0xdbe643['getSubjects'](_0x6cac6e);}})['then'](function(_0x34412d){if(_0x34412d){_0x5d6d0d=_0x34412d[_0x2d3a('0x4e')];if(!_0x53862a[_0x2d3a('0x39')][_0x2d3a('0x3d')](_0x2d3a('0x3e'))){_0x6cac6e[_0x2d3a('0x28')]=qs[_0x2d3a('0x28')](_0x53862a[_0x2d3a('0x39')][_0x2d3a('0x28')]);_0x6cac6e['offset']=qs[_0x2d3a('0x27')](_0x53862a[_0x2d3a('0x39')][_0x2d3a('0x27')]);}return _0xdbe643['getSubjects'](_0x6cac6e);}})['then'](function(_0x38aa9f){if(_0x38aa9f){return _0x38aa9f?{'count':_0x5d6d0d,'rows':_0x38aa9f}:null;}})['then'](respondWithResult(_0x10be17,null))[_0x2d3a('0x22')](handleError(_0x10be17,null));};exports[_0x2d3a('0x57')]=function(_0xbfd6b5,_0x519ae7,_0x1cbef7){var _0x12c11e={};var _0x3b4a2d={};var _0x2081c4;var _0x2009bf;return db[_0x2d3a('0x35')]['findOne']({'where':{'id':_0xbfd6b5[_0x2d3a('0x4c')]['id']}})[_0x2d3a('0x2f')](handleEntityNotFound(_0x519ae7,null))[_0x2d3a('0x2f')](function(_0x55bb00){if(_0x55bb00){_0x2081c4=_0x55bb00;_0x3b4a2d[_0x2d3a('0x38')]=_[_0x2d3a('0x4d')](db[_0x2d3a('0x55')][_0x2d3a('0x36')]);_0x3b4a2d['query']=_['keys'](_0xbfd6b5[_0x2d3a('0x39')]);_0x3b4a2d[_0x2d3a('0x42')]=_[_0x2d3a('0x3a')](_0x3b4a2d['model'],_0x3b4a2d[_0x2d3a('0x39')]);_0x12c11e[_0x2d3a('0x3b')]=_['intersection'](_0x3b4a2d[_0x2d3a('0x38')],qs[_0x2d3a('0x3c')](_0xbfd6b5[_0x2d3a('0x39')][_0x2d3a('0x3c')]));_0x12c11e[_0x2d3a('0x3b')]=_0x12c11e['attributes'][_0x2d3a('0x4e')]?_0x12c11e['attributes']:_0x3b4a2d[_0x2d3a('0x38')];_0x12c11e[_0x2d3a('0x3f')]=qs['sort'](_0xbfd6b5['query'][_0x2d3a('0x40')]);_0x12c11e[_0x2d3a('0x41')]=qs[_0x2d3a('0x42')](_[_0x2d3a('0x43')](_0xbfd6b5[_0x2d3a('0x39')],_0x3b4a2d[_0x2d3a('0x42')]));if(_0xbfd6b5[_0x2d3a('0x39')][_0x2d3a('0x44')]){_0x12c11e[_0x2d3a('0x41')]=_[_0x2d3a('0x45')](_0x12c11e[_0x2d3a('0x41')],{'$or':_['map'](_0x12c11e['attributes'],function(_0x4043c4){var _0xfe1762={};_0xfe1762[_0x4043c4]={'$like':'%'+_0xbfd6b5[_0x2d3a('0x39')]['filter']+'%'};return _0xfe1762;})});}_0x12c11e=_['merge']({},_0x12c11e,_0xbfd6b5[_0x2d3a('0x47')]);return _0x2081c4[_0x2d3a('0x57')](_0x12c11e);}})['then'](function(_0x143b4a){if(_0x143b4a){_0x2009bf=_0x143b4a[_0x2d3a('0x4e')];if(!_0xbfd6b5[_0x2d3a('0x39')][_0x2d3a('0x3d')](_0x2d3a('0x3e'))){_0x12c11e[_0x2d3a('0x28')]=qs['limit'](_0xbfd6b5[_0x2d3a('0x39')][_0x2d3a('0x28')]);_0x12c11e[_0x2d3a('0x27')]=qs[_0x2d3a('0x27')](_0xbfd6b5[_0x2d3a('0x39')]['offset']);}return _0x2081c4[_0x2d3a('0x57')](_0x12c11e);}})[_0x2d3a('0x2f')](function(_0xaba440){if(_0xaba440){return _0xaba440?{'count':_0x2009bf,'rows':_0xaba440}:null;}})['then'](respondWithResult(_0x519ae7,null))[_0x2d3a('0x22')](handleError(_0x519ae7,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 6435c7f..18f6924 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 _0x088b=['request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','VtigerConfiguration','lodash','util','../../config/logger','api'];(function(_0x11d16e,_0x5c1398){var _0x3e2a28=function(_0x5a03fe){while(--_0x5a03fe){_0x11d16e['push'](_0x11d16e['shift']());}};_0x3e2a28(++_0x5c1398);}(_0x088b,0x13c));var _0xb088=function(_0x4df7be,_0x174cea){_0x4df7be=_0x4df7be-0x0;var _0x3c15a4=_0x088b[_0x4df7be];return _0x3c15a4;};'use strict';var _=require(_0xb088('0x0'));var util=require(_0xb088('0x1'));var logger=require(_0xb088('0x2'))(_0xb088('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb088('0x4'));var fs=require('fs');var path=require(_0xb088('0x5'));var rimraf=require(_0xb088('0x6'));var config=require(_0xb088('0x7'));var attributes=require(_0xb088('0x8'));module['exports']=function(_0x4857dd,_0x5ea74d){return _0x4857dd['define'](_0xb088('0x9'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaea7=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','util','../../config/logger'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0xaea7,0x1da));var _0x7aea=function(_0x44a79b,_0x280f0a){_0x44a79b=_0x44a79b-0x0;var _0x41886c=_0xaea7[_0x44a79b];return _0x41886c;};'use strict';var _=require('lodash');var util=require(_0x7aea('0x0'));var logger=require(_0x7aea('0x1'))(_0x7aea('0x2'));var moment=require(_0x7aea('0x3'));var BPromise=require(_0x7aea('0x4'));var rp=require(_0x7aea('0x5'));var fs=require('fs');var path=require(_0x7aea('0x6'));var rimraf=require(_0x7aea('0x7'));var config=require(_0x7aea('0x8'));var attributes=require(_0x7aea('0x9'));module[_0x7aea('0xa')]=function(_0x21e612,_0x22dd54){return _0x21e612[_0x7aea('0xb')](_0x7aea('0xc'),attributes,{'tableName':_0x7aea('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index a5ee073..ed05eec 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 _0x4618=['info','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerConfiguration,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x10103c,_0x5ea134){var _0x3237bb=function(_0x4ffd66){while(--_0x4ffd66){_0x10103c['push'](_0x10103c['shift']());}};_0x3237bb(++_0x5ea134);}(_0x4618,0x88));var _0x8461=function(_0x13ce0c,_0x3f2a0d){_0x13ce0c=_0x13ce0c-0x0;var _0x4388fb=_0x4618[_0x13ce0c];return _0x4388fb;};'use strict';var _=require(_0x8461('0x0'));var util=require('util');var moment=require(_0x8461('0x1'));var BPromise=require(_0x8461('0x2'));var rs=require(_0x8461('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8461('0x4'))['db'];var utils=require(_0x8461('0x5'));var logger=require(_0x8461('0x6'))(_0x8461('0x7'));var config=require(_0x8461('0x8'));var jayson=require(_0x8461('0x9'));var client=jayson[_0x8461('0xa')][_0x8461('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4afe49,_0x4dc68a,_0x574b4a){return new BPromise(function(_0x5e5dda,_0x525530){return client[_0x8461('0xc')](_0x4afe49,_0x574b4a)[_0x8461('0xd')](function(_0x337e6c){logger[_0x8461('0xe')]('VtigerConfiguration,\x20%s,\x20%s',_0x4dc68a,_0x8461('0xf'));logger[_0x8461('0x10')](_0x8461('0x11'),_0x4dc68a,_0x8461('0xf'),JSON[_0x8461('0x12')](_0x337e6c));if(_0x337e6c[_0x8461('0x13')]){if(_0x337e6c['error'][_0x8461('0x14')]===0x1f4){logger['error'](_0x8461('0x15'),_0x4dc68a,_0x337e6c[_0x8461('0x13')][_0x8461('0x16')]);return _0x525530(_0x337e6c[_0x8461('0x13')][_0x8461('0x16')]);}logger[_0x8461('0x13')](_0x8461('0x15'),_0x4dc68a,_0x337e6c['error'][_0x8461('0x16')]);return _0x5e5dda(_0x337e6c['error']['message']);}else{logger[_0x8461('0xe')](_0x8461('0x15'),_0x4dc68a,'request\x20sent');_0x5e5dda(_0x337e6c[_0x8461('0x17')][_0x8461('0x16')]);}})[_0x8461('0x18')](function(_0x445c14){logger['error'](_0x8461('0x15'),_0x4dc68a,_0x445c14);_0x525530(_0x445c14);});});} \ No newline at end of file +var _0x9ba7=['stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x9ba7,0x124));var _0x79ba=function(_0x217c2e,_0x358f06){_0x217c2e=_0x217c2e-0x0;var _0x22b7d8=_0x9ba7[_0x217c2e];return _0x22b7d8;};'use strict';var _=require(_0x79ba('0x0'));var util=require(_0x79ba('0x1'));var moment=require(_0x79ba('0x2'));var BPromise=require('bluebird');var rs=require(_0x79ba('0x3'));var fs=require('fs');var Redis=require(_0x79ba('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x79ba('0x5'));var logger=require(_0x79ba('0x6'))('rpc');var config=require(_0x79ba('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x79ba('0x8')][_0x79ba('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x23d119,_0x43a660,_0x1beb3f){return new BPromise(function(_0x5c6ba0,_0x4f9f43){return client[_0x79ba('0xa')](_0x23d119,_0x1beb3f)[_0x79ba('0xb')](function(_0x54c629){logger[_0x79ba('0xc')](_0x79ba('0xd'),_0x43a660,_0x79ba('0xe'));logger[_0x79ba('0xf')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x43a660,_0x79ba('0xe'),JSON[_0x79ba('0x10')](_0x54c629));if(_0x54c629[_0x79ba('0x11')]){if(_0x54c629[_0x79ba('0x11')][_0x79ba('0x12')]===0x1f4){logger[_0x79ba('0x11')]('VtigerConfiguration,\x20%s,\x20%s',_0x43a660,_0x54c629[_0x79ba('0x11')][_0x79ba('0x13')]);return _0x4f9f43(_0x54c629[_0x79ba('0x11')][_0x79ba('0x13')]);}logger['error'](_0x79ba('0xd'),_0x43a660,_0x54c629['error']['message']);return _0x5c6ba0(_0x54c629[_0x79ba('0x11')][_0x79ba('0x13')]);}else{logger[_0x79ba('0xc')](_0x79ba('0xd'),_0x43a660,_0x79ba('0xe'));_0x5c6ba0(_0x54c629[_0x79ba('0x14')]['message']);}})[_0x79ba('0x15')](function(_0x17f8a2){logger[_0x79ba('0x11')](_0x79ba('0xd'),_0x43a660,_0x17f8a2);_0x4f9f43(_0x17f8a2);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 841f9ed..a34e3ae 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 _0x4aed=['create','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','index','/:id','isAuthenticated','show'];(function(_0x39abce,_0x1589e6){var _0x3fea79=function(_0x1548fb){while(--_0x1548fb){_0x39abce['push'](_0x39abce['shift']());}};_0x3fea79(++_0x1589e6);}(_0x4aed,0x102));var _0xd4ae=function(_0x54b534,_0x48d4e6){_0x54b534=_0x54b534-0x0;var _0x36e5a8=_0x4aed[_0x54b534];return _0x36e5a8;};'use strict';var multer=require(_0xd4ae('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd4ae('0x1'));var express=require(_0xd4ae('0x2'));var router=express[_0xd4ae('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xd4ae('0x4'));var config=require(_0xd4ae('0x5'));var controller=require(_0xd4ae('0x6'));router[_0xd4ae('0x7')]('/',auth['isAuthenticated'](),controller[_0xd4ae('0x8')]);router[_0xd4ae('0x7')](_0xd4ae('0x9'),auth[_0xd4ae('0xa')](),controller[_0xd4ae('0xb')]);router['post']('/',auth[_0xd4ae('0xa')](),controller[_0xd4ae('0xc')]);router[_0xd4ae('0xd')]('/:id',auth[_0xd4ae('0xa')](),controller[_0xd4ae('0xe')]);router[_0xd4ae('0xf')](_0xd4ae('0x9'),auth[_0xd4ae('0xa')](),controller[_0xd4ae('0x10')]);module[_0xd4ae('0x11')]=router; \ No newline at end of file +var _0x179b=['show','create','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id'];(function(_0x36865c,_0x3bcd5f){var _0x3163c0=function(_0x2a60e1){while(--_0x2a60e1){_0x36865c['push'](_0x36865c['shift']());}};_0x3163c0(++_0x3bcd5f);}(_0x179b,0x183));var _0xb179=function(_0x174ef5,_0x256e8e){_0x174ef5=_0x174ef5-0x0;var _0x1cc379=_0x179b[_0x174ef5];return _0x1cc379;};'use strict';var multer=require('multer');var util=require(_0xb179('0x0'));var path=require('path');var timeout=require(_0xb179('0x1'));var express=require(_0xb179('0x2'));var router=express[_0xb179('0x3')]();var auth=require(_0xb179('0x4'));var interaction=require(_0xb179('0x5'));var config=require(_0xb179('0x6'));var controller=require(_0xb179('0x7'));router[_0xb179('0x8')]('/',auth[_0xb179('0x9')](),controller[_0xb179('0xa')]);router['get'](_0xb179('0xb'),auth[_0xb179('0x9')](),controller[_0xb179('0xc')]);router['post']('/',auth[_0xb179('0x9')](),controller[_0xb179('0xd')]);router[_0xb179('0xe')](_0xb179('0xb'),auth['isAuthenticated'](),controller[_0xb179('0xf')]);router[_0xb179('0x10')](_0xb179('0xb'),auth[_0xb179('0x9')](),controller[_0xb179('0x11')]);module[_0xb179('0x12')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 1abbed9..d6ef102 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 _0xa3e6=['variable','customVariable','keyValue','STRING','string','BOOLEAN','sequelize','ENUM'];(function(_0x13342f,_0x3d6303){var _0x2fc1fc=function(_0x2d991f){while(--_0x2d991f){_0x13342f['push'](_0x13342f['shift']());}};_0x2fc1fc(++_0x3d6303);}(_0xa3e6,0xbe));var _0x6a3e=function(_0x6da569,_0x587a22){_0x6da569=_0x6da569-0x0;var _0x1bc2c2=_0xa3e6[_0x6da569];return _0x1bc2c2;};'use strict';var Sequelize=require(_0x6a3e('0x0'));module['exports']={'type':{'type':Sequelize[_0x6a3e('0x1')]('string',_0x6a3e('0x2'),_0x6a3e('0x3'),_0x6a3e('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x6a3e('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x6a3e('0x1')](_0x6a3e('0x6'),_0x6a3e('0x2'),_0x6a3e('0x3'))},'keyContent':{'type':Sequelize[_0x6a3e('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x6a3e('0x5')]},'customField':{'type':Sequelize[_0x6a3e('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x25b0=['variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0xe31fc4,_0x2939c4){var _0x3a975c=function(_0x72282){while(--_0x72282){_0xe31fc4['push'](_0xe31fc4['shift']());}};_0x3a975c(++_0x2939c4);}(_0x25b0,0x140));var _0x025b=function(_0x97db75,_0x3abdb8){_0x97db75=_0x97db75-0x0;var _0x259a53=_0x25b0[_0x97db75];return _0x259a53;};'use strict';var Sequelize=require(_0x025b('0x0'));module[_0x025b('0x1')]={'type':{'type':Sequelize[_0x025b('0x2')](_0x025b('0x3'),_0x025b('0x4'),_0x025b('0x5'),_0x025b('0x6')),'defaultValue':_0x025b('0x3')},'content':{'type':Sequelize[_0x025b('0x7')]},'key':{'type':Sequelize[_0x025b('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x025b('0x3'),_0x025b('0x4'),_0x025b('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x025b('0x7')]},'nameField':{'type':Sequelize[_0x025b('0x7')]},'customField':{'type':Sequelize[_0x025b('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x025b('0x7')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 0afb018..a1880f8 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 _0x2ef8=['querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','set','apply','reject','save','update','destroy','then','error','name','send','index','VtigerField','fieldName','type','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','count','include','findAll','rows','catch','show','params','includeAll','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','sox','ejs','lodash','squel','desk.js'];(function(_0x499ca5,_0x4986cf){var _0x7bfd9c=function(_0x36fe88){while(--_0x36fe88){_0x499ca5['push'](_0x499ca5['shift']());}};_0x7bfd9c(++_0x4986cf);}(_0x2ef8,0x1e5));var _0x82ef=function(_0x160594,_0x262f72){_0x160594=_0x160594-0x0;var _0x46049e=_0x2ef8[_0x160594];return _0x46049e;};'use strict';var pdf=require(_0x82ef('0x0'));var emlformat=require(_0x82ef('0x1'));var rimraf=require(_0x82ef('0x2'));var zipdir=require(_0x82ef('0x3'));var jsonpatch=require(_0x82ef('0x4'));var rp=require('request-promise');var moment=require(_0x82ef('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x82ef('0x6'));var path=require('path');var sox=require(_0x82ef('0x7'));var csv=require('to-csv');var ejs=require(_0x82ef('0x8'));var fs=require('fs');var _=require(_0x82ef('0x9'));var squel=require(_0x82ef('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x82ef('0xb'));var toCsv=require('to-csv');var querystring=require(_0x82ef('0xc'));var Papa=require('papaparse');var Redis=require(_0x82ef('0xd'));var authService=require(_0x82ef('0xe'));var qs=require(_0x82ef('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x82ef('0x10'))(_0x82ef('0x11'));var utils=require(_0x82ef('0x12'));var config=require(_0x82ef('0x13'));var db=require(_0x82ef('0x14'))['db'];function respondWithStatusCode(_0x38f1f2,_0x1067ce){_0x1067ce=_0x1067ce||0xcc;return function(_0x412250){if(_0x412250){return _0x38f1f2[_0x82ef('0x15')](_0x1067ce);}return _0x38f1f2['status'](_0x1067ce)[_0x82ef('0x16')]();};}function respondWithResult(_0x12e949,_0xe31757){_0xe31757=_0xe31757||0xc8;return function(_0x2dd8ad){if(_0x2dd8ad){return _0x12e949[_0x82ef('0x17')](_0xe31757)[_0x82ef('0x18')](_0x2dd8ad);}};}function respondWithFilteredResult(_0x6ac9eb,_0x5dbe87){return function(_0x3f9ba7){if(_0x3f9ba7){var _0x5d3a36=_0x3f9ba7['count'],_0x539754=_0x5dbe87[_0x82ef('0x19')],_0x2f3b7e=_0x5dbe87[_0x82ef('0x19')]+_0x5dbe87[_0x82ef('0x1a')],_0x2edac3;if(_0x2f3b7e>=_0x5d3a36){_0x2f3b7e=_0x5d3a36;_0x2edac3=0xc8;}else{_0x2edac3=0xce;}_0x6ac9eb['status'](_0x2edac3);return _0x6ac9eb[_0x82ef('0x1b')]('Content-Range',_0x539754+'-'+_0x2f3b7e+'/'+_0x5d3a36)[_0x82ef('0x18')](_0x3f9ba7);}return null;};}function patchUpdates(_0xf60898){return function(_0x1f94fc){try{jsonpatch[_0x82ef('0x1c')](_0x1f94fc,_0xf60898,!![]);}catch(_0xe9dd57){return BPromise[_0x82ef('0x1d')](_0xe9dd57);}return _0x1f94fc[_0x82ef('0x1e')]();};}function saveUpdates(_0x36ce21,_0x253c65){return function(_0x190461){if(_0x190461){return _0x190461[_0x82ef('0x1f')](_0x36ce21)['then'](function(_0x454fd7){return _0x454fd7;});}return null;};}function removeEntity(_0x2cd26c,_0x595fcf){return function(_0x468b78){if(_0x468b78){return _0x468b78[_0x82ef('0x20')]()[_0x82ef('0x21')](function(){_0x2cd26c[_0x82ef('0x17')](0xcc)[_0x82ef('0x16')]();});}};}function handleEntityNotFound(_0x494fb7,_0x2db9ad){return function(_0x12b9ee){if(!_0x12b9ee){_0x494fb7[_0x82ef('0x15')](0x194);}return _0x12b9ee;};}function handleError(_0x45b20f,_0xa6e952){_0xa6e952=_0xa6e952||0x1f4;return function(_0x32ad8a){logger[_0x82ef('0x22')](_0x32ad8a['stack']);if(_0x32ad8a[_0x82ef('0x23')]){delete _0x32ad8a[_0x82ef('0x23')];}_0x45b20f['status'](_0xa6e952)[_0x82ef('0x24')](_0x32ad8a);};}exports[_0x82ef('0x25')]=function(_0x5bfb5c,_0x2e4324){var _0x308d22={},_0x4218e2={},_0x553017={'count':0x0,'rows':[]};var _0x554a32=_['map'](db[_0x82ef('0x26')]['rawAttributes'],function(_0x178d30){return{'name':_0x178d30[_0x82ef('0x27')],'type':_0x178d30[_0x82ef('0x28')]['key']};});_0x4218e2[_0x82ef('0x29')]=_[_0x82ef('0x2a')](_0x554a32,_0x82ef('0x23'));_0x4218e2['query']=_[_0x82ef('0x2b')](_0x5bfb5c['query']);_0x4218e2[_0x82ef('0x2c')]=_[_0x82ef('0x2d')](_0x4218e2[_0x82ef('0x29')],_0x4218e2[_0x82ef('0x2e')]);_0x308d22[_0x82ef('0x2f')]=_[_0x82ef('0x2d')](_0x4218e2[_0x82ef('0x29')],qs['fields'](_0x5bfb5c[_0x82ef('0x2e')][_0x82ef('0x30')]));_0x308d22[_0x82ef('0x2f')]=_0x308d22[_0x82ef('0x2f')][_0x82ef('0x31')]?_0x308d22['attributes']:_0x4218e2[_0x82ef('0x29')];if(!_0x5bfb5c[_0x82ef('0x2e')][_0x82ef('0x32')](_0x82ef('0x33'))){_0x308d22[_0x82ef('0x1a')]=qs[_0x82ef('0x1a')](_0x5bfb5c[_0x82ef('0x2e')][_0x82ef('0x1a')]);_0x308d22[_0x82ef('0x19')]=qs[_0x82ef('0x19')](_0x5bfb5c[_0x82ef('0x2e')][_0x82ef('0x19')]);}_0x308d22[_0x82ef('0x34')]=qs[_0x82ef('0x35')](_0x5bfb5c[_0x82ef('0x2e')]['sort']);_0x308d22['where']=qs['filters'](_[_0x82ef('0x36')](_0x5bfb5c['query'],_0x4218e2[_0x82ef('0x2c')]));if(_0x5bfb5c[_0x82ef('0x2e')]['filter']){_0x308d22[_0x82ef('0x37')]=_[_0x82ef('0x38')](_0x308d22[_0x82ef('0x37')],{'$or':_['map'](_0x554a32,function(_0xffc193){if(_0xffc193[_0x82ef('0x28')]!==_0x82ef('0x39')){var _0x5313a0={};_0x5313a0[_0xffc193[_0x82ef('0x23')]]={'$like':'%'+_0x5bfb5c[_0x82ef('0x2e')][_0x82ef('0x3a')]+'%'};return _0x5313a0;}})});}_0x308d22=_['merge']({},_0x308d22,_0x5bfb5c[_0x82ef('0x3b')]);var _0x15a63d={'where':_0x308d22['where']};return db[_0x82ef('0x26')][_0x82ef('0x3c')](_0x15a63d)[_0x82ef('0x21')](function(_0x2d5d4a){_0x553017[_0x82ef('0x3c')]=_0x2d5d4a;if(_0x5bfb5c['query']['includeAll']){_0x308d22[_0x82ef('0x3d')]=[{'all':!![]}];}return db[_0x82ef('0x26')][_0x82ef('0x3e')](_0x308d22);})['then'](function(_0x26f2cf){_0x553017[_0x82ef('0x3f')]=_0x26f2cf;return _0x553017;})[_0x82ef('0x21')](respondWithFilteredResult(_0x2e4324,_0x308d22))[_0x82ef('0x40')](handleError(_0x2e4324,null));};exports[_0x82ef('0x41')]=function(_0x928141,_0x1c7fcb){var _0x7b363={'raw':!![],'where':{'id':_0x928141[_0x82ef('0x42')]['id']}},_0x467216={};_0x467216[_0x82ef('0x29')]=_[_0x82ef('0x2b')](db[_0x82ef('0x26')]['rawAttributes']);_0x467216['query']=_[_0x82ef('0x2b')](_0x928141['query']);_0x467216[_0x82ef('0x2c')]=_[_0x82ef('0x2d')](_0x467216[_0x82ef('0x29')],_0x467216[_0x82ef('0x2e')]);_0x7b363[_0x82ef('0x2f')]=_[_0x82ef('0x2d')](_0x467216[_0x82ef('0x29')],qs['fields'](_0x928141[_0x82ef('0x2e')][_0x82ef('0x30')]));_0x7b363[_0x82ef('0x2f')]=_0x7b363[_0x82ef('0x2f')]['length']?_0x7b363[_0x82ef('0x2f')]:_0x467216[_0x82ef('0x29')];if(_0x928141[_0x82ef('0x2e')][_0x82ef('0x43')]){_0x7b363[_0x82ef('0x3d')]=[{'all':!![]}];}_0x7b363=_[_0x82ef('0x38')]({},_0x7b363,_0x928141[_0x82ef('0x3b')]);return db[_0x82ef('0x26')][_0x82ef('0x44')](_0x7b363)[_0x82ef('0x21')](handleEntityNotFound(_0x1c7fcb,null))[_0x82ef('0x21')](respondWithResult(_0x1c7fcb,null))[_0x82ef('0x40')](handleError(_0x1c7fcb,null));};exports[_0x82ef('0x45')]=function(_0x468e8a,_0x2980a3){return db['VtigerField'][_0x82ef('0x45')](_0x468e8a['body'],{})[_0x82ef('0x21')](respondWithResult(_0x2980a3,0xc9))['catch'](handleError(_0x2980a3,null));};exports[_0x82ef('0x1f')]=function(_0x14836a,_0xca1a6e){if(_0x14836a[_0x82ef('0x46')]['id']){delete _0x14836a[_0x82ef('0x46')]['id'];}return db[_0x82ef('0x26')]['find']({'where':{'id':_0x14836a['params']['id']}})['then'](handleEntityNotFound(_0xca1a6e,null))[_0x82ef('0x21')](saveUpdates(_0x14836a[_0x82ef('0x46')],null))[_0x82ef('0x21')](respondWithResult(_0xca1a6e,null))['catch'](handleError(_0xca1a6e,null));};exports[_0x82ef('0x20')]=function(_0x30e269,_0x56fffb){return db[_0x82ef('0x26')][_0x82ef('0x44')]({'where':{'id':_0x30e269[_0x82ef('0x42')]['id']}})['then'](handleEntityNotFound(_0x56fffb,null))[_0x82ef('0x21')](removeEntity(_0x56fffb,null))[_0x82ef('0x40')](handleError(_0x56fffb,null));}; \ No newline at end of file +var _0x3822=['count','offset','limit','set','Content-Range','save','then','destroy','error','stack','name','send','VtigerField','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json'];(function(_0x2ffa5c,_0x17799b){var _0x171ba8=function(_0xed70a7){while(--_0xed70a7){_0x2ffa5c['push'](_0x2ffa5c['shift']());}};_0x171ba8(++_0x17799b);}(_0x3822,0x77));var _0x2382=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0x3822[_0x2aa0e7];return _0x1472c0;};'use strict';var pdf=require(_0x2382('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2382('0x1'));var zipdir=require(_0x2382('0x2'));var jsonpatch=require(_0x2382('0x3'));var rp=require(_0x2382('0x4'));var moment=require(_0x2382('0x5'));var BPromise=require(_0x2382('0x6'));var Mustache=require(_0x2382('0x7'));var util=require(_0x2382('0x8'));var path=require(_0x2382('0x9'));var sox=require(_0x2382('0xa'));var csv=require(_0x2382('0xb'));var ejs=require(_0x2382('0xc'));var fs=require('fs');var _=require(_0x2382('0xd'));var squel=require('squel');var crypto=require(_0x2382('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x2382('0xf'));var toCsv=require(_0x2382('0xb'));var querystring=require(_0x2382('0x10'));var Papa=require(_0x2382('0x11'));var Redis=require(_0x2382('0x12'));var authService=require(_0x2382('0x13'));var qs=require(_0x2382('0x14'));var as=require(_0x2382('0x15'));var hardwareService=require(_0x2382('0x16'));var logger=require(_0x2382('0x17'))(_0x2382('0x18'));var utils=require(_0x2382('0x19'));var config=require('../../config/environment');var db=require(_0x2382('0x1a'))['db'];function respondWithStatusCode(_0x187d44,_0x1e3c7d){_0x1e3c7d=_0x1e3c7d||0xcc;return function(_0x4c7ba7){if(_0x4c7ba7){return _0x187d44[_0x2382('0x1b')](_0x1e3c7d);}return _0x187d44['status'](_0x1e3c7d)[_0x2382('0x1c')]();};}function respondWithResult(_0x4211f7,_0x5dd453){_0x5dd453=_0x5dd453||0xc8;return function(_0x206e66){if(_0x206e66){return _0x4211f7[_0x2382('0x1d')](_0x5dd453)[_0x2382('0x1e')](_0x206e66);}};}function respondWithFilteredResult(_0x428d73,_0x266fe8){return function(_0x1fdeca){if(_0x1fdeca){var _0x1cfd20=_0x1fdeca[_0x2382('0x1f')],_0x43de96=_0x266fe8[_0x2382('0x20')],_0x18fe55=_0x266fe8[_0x2382('0x20')]+_0x266fe8[_0x2382('0x21')],_0x25dc55;if(_0x18fe55>=_0x1cfd20){_0x18fe55=_0x1cfd20;_0x25dc55=0xc8;}else{_0x25dc55=0xce;}_0x428d73[_0x2382('0x1d')](_0x25dc55);return _0x428d73[_0x2382('0x22')](_0x2382('0x23'),_0x43de96+'-'+_0x18fe55+'/'+_0x1cfd20)['json'](_0x1fdeca);}return null;};}function patchUpdates(_0x2f362e){return function(_0x37bbd8){try{jsonpatch['apply'](_0x37bbd8,_0x2f362e,!![]);}catch(_0x1f8d20){return BPromise['reject'](_0x1f8d20);}return _0x37bbd8[_0x2382('0x24')]();};}function saveUpdates(_0x5b5679,_0x460ca9){return function(_0x1c39ba){if(_0x1c39ba){return _0x1c39ba['update'](_0x5b5679)[_0x2382('0x25')](function(_0x4083da){return _0x4083da;});}return null;};}function removeEntity(_0x8d0872,_0x17a8e6){return function(_0x11fa7d){if(_0x11fa7d){return _0x11fa7d[_0x2382('0x26')]()[_0x2382('0x25')](function(){_0x8d0872[_0x2382('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe393bf,_0x293e9d){return function(_0x3ba77d){if(!_0x3ba77d){_0xe393bf['sendStatus'](0x194);}return _0x3ba77d;};}function handleError(_0x75cb00,_0x5155bc){_0x5155bc=_0x5155bc||0x1f4;return function(_0x4d1e70){logger[_0x2382('0x27')](_0x4d1e70[_0x2382('0x28')]);if(_0x4d1e70[_0x2382('0x29')]){delete _0x4d1e70[_0x2382('0x29')];}_0x75cb00['status'](_0x5155bc)[_0x2382('0x2a')](_0x4d1e70);};}exports['index']=function(_0x1254d5,_0x228b13){var _0x55c271={},_0x118d8d={},_0x2070c4={'count':0x0,'rows':[]};var _0x4e55ce=_['map'](db[_0x2382('0x2b')]['rawAttributes'],function(_0xc6aa8a){return{'name':_0xc6aa8a[_0x2382('0x2c')],'type':_0xc6aa8a[_0x2382('0x2d')][_0x2382('0x2e')]};});_0x118d8d[_0x2382('0x2f')]=_[_0x2382('0x30')](_0x4e55ce,_0x2382('0x29'));_0x118d8d[_0x2382('0x31')]=_['keys'](_0x1254d5[_0x2382('0x31')]);_0x118d8d[_0x2382('0x32')]=_[_0x2382('0x33')](_0x118d8d[_0x2382('0x2f')],_0x118d8d['query']);_0x55c271[_0x2382('0x34')]=_[_0x2382('0x33')](_0x118d8d['model'],qs['fields'](_0x1254d5[_0x2382('0x31')][_0x2382('0x35')]));_0x55c271[_0x2382('0x34')]=_0x55c271[_0x2382('0x34')][_0x2382('0x36')]?_0x55c271['attributes']:_0x118d8d['model'];if(!_0x1254d5[_0x2382('0x31')][_0x2382('0x37')]('nolimit')){_0x55c271['limit']=qs[_0x2382('0x21')](_0x1254d5['query']['limit']);_0x55c271[_0x2382('0x20')]=qs[_0x2382('0x20')](_0x1254d5[_0x2382('0x31')][_0x2382('0x20')]);}_0x55c271[_0x2382('0x38')]=qs[_0x2382('0x39')](_0x1254d5[_0x2382('0x31')][_0x2382('0x39')]);_0x55c271['where']=qs['filters'](_[_0x2382('0x3a')](_0x1254d5[_0x2382('0x31')],_0x118d8d[_0x2382('0x32')]));if(_0x1254d5[_0x2382('0x31')][_0x2382('0x3b')]){_0x55c271['where']=_[_0x2382('0x3c')](_0x55c271[_0x2382('0x3d')],{'$or':_['map'](_0x4e55ce,function(_0x5ee42e){if(_0x5ee42e[_0x2382('0x2d')]!==_0x2382('0x3e')){var _0x2e7cf1={};_0x2e7cf1[_0x5ee42e[_0x2382('0x29')]]={'$like':'%'+_0x1254d5[_0x2382('0x31')][_0x2382('0x3b')]+'%'};return _0x2e7cf1;}})});}_0x55c271=_[_0x2382('0x3c')]({},_0x55c271,_0x1254d5[_0x2382('0x3f')]);var _0x4dd2d3={'where':_0x55c271[_0x2382('0x3d')]};return db[_0x2382('0x2b')][_0x2382('0x1f')](_0x4dd2d3)[_0x2382('0x25')](function(_0x412de6){_0x2070c4[_0x2382('0x1f')]=_0x412de6;if(_0x1254d5[_0x2382('0x31')][_0x2382('0x40')]){_0x55c271[_0x2382('0x41')]=[{'all':!![]}];}return db[_0x2382('0x2b')][_0x2382('0x42')](_0x55c271);})[_0x2382('0x25')](function(_0x4abf31){_0x2070c4[_0x2382('0x43')]=_0x4abf31;return _0x2070c4;})[_0x2382('0x25')](respondWithFilteredResult(_0x228b13,_0x55c271))[_0x2382('0x44')](handleError(_0x228b13,null));};exports[_0x2382('0x45')]=function(_0x25117a,_0x275cc3){var _0x5555f2={'raw':!![],'where':{'id':_0x25117a[_0x2382('0x46')]['id']}},_0x2ca5da={};_0x2ca5da[_0x2382('0x2f')]=_['keys'](db[_0x2382('0x2b')]['rawAttributes']);_0x2ca5da[_0x2382('0x31')]=_[_0x2382('0x47')](_0x25117a[_0x2382('0x31')]);_0x2ca5da['filters']=_['intersection'](_0x2ca5da[_0x2382('0x2f')],_0x2ca5da['query']);_0x5555f2[_0x2382('0x34')]=_[_0x2382('0x33')](_0x2ca5da[_0x2382('0x2f')],qs[_0x2382('0x35')](_0x25117a[_0x2382('0x31')][_0x2382('0x35')]));_0x5555f2['attributes']=_0x5555f2[_0x2382('0x34')][_0x2382('0x36')]?_0x5555f2[_0x2382('0x34')]:_0x2ca5da[_0x2382('0x2f')];if(_0x25117a[_0x2382('0x31')][_0x2382('0x40')]){_0x5555f2[_0x2382('0x41')]=[{'all':!![]}];}_0x5555f2=_[_0x2382('0x3c')]({},_0x5555f2,_0x25117a['options']);return db[_0x2382('0x2b')][_0x2382('0x48')](_0x5555f2)['then'](handleEntityNotFound(_0x275cc3,null))[_0x2382('0x25')](respondWithResult(_0x275cc3,null))[_0x2382('0x44')](handleError(_0x275cc3,null));};exports[_0x2382('0x49')]=function(_0x5927d3,_0x4f536){return db[_0x2382('0x2b')]['create'](_0x5927d3[_0x2382('0x4a')],{})['then'](respondWithResult(_0x4f536,0xc9))[_0x2382('0x44')](handleError(_0x4f536,null));};exports['update']=function(_0x261354,_0x2aa9f6){if(_0x261354[_0x2382('0x4a')]['id']){delete _0x261354['body']['id'];}return db[_0x2382('0x2b')][_0x2382('0x48')]({'where':{'id':_0x261354[_0x2382('0x46')]['id']}})[_0x2382('0x25')](handleEntityNotFound(_0x2aa9f6,null))[_0x2382('0x25')](saveUpdates(_0x261354['body'],null))[_0x2382('0x25')](respondWithResult(_0x2aa9f6,null))[_0x2382('0x44')](handleError(_0x2aa9f6,null));};exports['destroy']=function(_0x56af00,_0x32d0eb){return db[_0x2382('0x2b')][_0x2382('0x48')]({'where':{'id':_0x56af00[_0x2382('0x46')]['id']}})[_0x2382('0x25')](handleEntityNotFound(_0x32d0eb,null))[_0x2382('0x25')](removeEntity(_0x32d0eb,null))[_0x2382('0x44')](handleError(_0x32d0eb,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index bd876a1..f16bc8e 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 _0x7a54=['int_vtiger_fields','idField','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','VtigerField'];(function(_0x54fa60,_0x4fb896){var _0x3326d7=function(_0x33538b){while(--_0x33538b){_0x54fa60['push'](_0x54fa60['shift']());}};_0x3326d7(++_0x4fb896);}(_0x7a54,0x106));var _0x47a5=function(_0x40b027,_0x3cd274){_0x40b027=_0x40b027-0x0;var _0x3b826f=_0x7a54[_0x40b027];return _0x3b826f;};'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':'vtiger_unique_index','fields':[_0x47a5('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['int_vtiger_fields','idField','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','VtigerField'];(function(_0x599e2e,_0x56d2a1){var _0x1b7a13=function(_0x17a721){while(--_0x17a721){_0x599e2e['push'](_0x599e2e['shift']());}};_0x1b7a13(++_0x56d2a1);}(_0x7a54,0x106));var _0x47a5=function(_0x1f64cd,_0x4435a6){_0x1f64cd=_0x1f64cd-0x0;var _0x11f200=_0x7a54[_0x1f64cd];return _0x11f200;};'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':'vtiger_unique_index','fields':[_0x47a5('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index 9eee8a0..15f728b 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 _0x3c8b=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','VtigerField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','util','bluebird','randomstring','ioredis'];(function(_0x5c2a2b,_0x22c94e){var _0x19921f=function(_0x3fb937){while(--_0x3fb937){_0x5c2a2b['push'](_0x5c2a2b['shift']());}};_0x19921f(++_0x22c94e);}(_0x3c8b,0x18b));var _0xb3c8=function(_0x40b714,_0x5e2f6d){_0x40b714=_0x40b714-0x0;var _0x461930=_0x3c8b[_0x40b714];return _0x461930;};'use strict';var _=require('lodash');var util=require(_0xb3c8('0x0'));var moment=require('moment');var BPromise=require(_0xb3c8('0x1'));var rs=require(_0xb3c8('0x2'));var fs=require('fs');var Redis=require(_0xb3c8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb3c8('0x4'));var logger=require(_0xb3c8('0x5'))(_0xb3c8('0x6'));var config=require(_0xb3c8('0x7'));var jayson=require(_0xb3c8('0x8'));var client=jayson[_0xb3c8('0x9')][_0xb3c8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x375af0,_0x47aa5b,_0x13c8f3){return new BPromise(function(_0x5ec6a7,_0x460956){return client[_0xb3c8('0xb')](_0x375af0,_0x13c8f3)['then'](function(_0x5cb72f){logger['info'](_0xb3c8('0xc'),_0x47aa5b,_0xb3c8('0xd'));logger[_0xb3c8('0xe')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x47aa5b,_0xb3c8('0xd'),JSON[_0xb3c8('0xf')](_0x5cb72f));if(_0x5cb72f[_0xb3c8('0x10')]){if(_0x5cb72f[_0xb3c8('0x10')]['code']===0x1f4){logger[_0xb3c8('0x10')]('VtigerField,\x20%s,\x20%s',_0x47aa5b,_0x5cb72f[_0xb3c8('0x10')]['message']);return _0x460956(_0x5cb72f[_0xb3c8('0x10')][_0xb3c8('0x11')]);}logger[_0xb3c8('0x10')]('VtigerField,\x20%s,\x20%s',_0x47aa5b,_0x5cb72f['error'][_0xb3c8('0x11')]);return _0x5ec6a7(_0x5cb72f[_0xb3c8('0x10')][_0xb3c8('0x11')]);}else{logger['info']('VtigerField,\x20%s,\x20%s',_0x47aa5b,_0xb3c8('0xd'));_0x5ec6a7(_0x5cb72f[_0xb3c8('0x12')][_0xb3c8('0x11')]);}})['catch'](function(_0x2ecca3){logger[_0xb3c8('0x10')](_0xb3c8('0xc'),_0x47aa5b,_0x2ecca3);_0x460956(_0x2ecca3);});});} \ No newline at end of file +var _0x0cfa=['client','http','request','then','info','VtigerField,\x20%s,\x20%s','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0xc116f3,_0x2e506a){var _0x2561ac=function(_0x7e25f2){while(--_0x7e25f2){_0xc116f3['push'](_0xc116f3['shift']());}};_0x2561ac(++_0x2e506a);}(_0x0cfa,0x73));var _0xa0cf=function(_0x2ed80a,_0x3fc638){_0x2ed80a=_0x2ed80a-0x0;var _0x95a08f=_0x0cfa[_0x2ed80a];return _0x95a08f;};'use strict';var _=require(_0xa0cf('0x0'));var util=require(_0xa0cf('0x1'));var moment=require(_0xa0cf('0x2'));var BPromise=require(_0xa0cf('0x3'));var rs=require(_0xa0cf('0x4'));var fs=require('fs');var Redis=require(_0xa0cf('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa0cf('0x6'));var logger=require('../../config/logger')(_0xa0cf('0x7'));var config=require(_0xa0cf('0x8'));var jayson=require(_0xa0cf('0x9'));var client=jayson[_0xa0cf('0xa')][_0xa0cf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3235b4,_0xa63ed,_0x1e3ad1){return new BPromise(function(_0x2dbef8,_0x4e2b85){return client[_0xa0cf('0xc')](_0x3235b4,_0x1e3ad1)[_0xa0cf('0xd')](function(_0x1ba1b7){logger[_0xa0cf('0xe')](_0xa0cf('0xf'),_0xa63ed,'request\x20sent');logger[_0xa0cf('0x10')](_0xa0cf('0x11'),_0xa63ed,'request\x20sent',JSON[_0xa0cf('0x12')](_0x1ba1b7));if(_0x1ba1b7[_0xa0cf('0x13')]){if(_0x1ba1b7[_0xa0cf('0x13')][_0xa0cf('0x14')]===0x1f4){logger[_0xa0cf('0x13')](_0xa0cf('0xf'),_0xa63ed,_0x1ba1b7[_0xa0cf('0x13')][_0xa0cf('0x15')]);return _0x4e2b85(_0x1ba1b7[_0xa0cf('0x13')][_0xa0cf('0x15')]);}logger['error']('VtigerField,\x20%s,\x20%s',_0xa63ed,_0x1ba1b7[_0xa0cf('0x13')][_0xa0cf('0x15')]);return _0x2dbef8(_0x1ba1b7[_0xa0cf('0x13')][_0xa0cf('0x15')]);}else{logger[_0xa0cf('0xe')](_0xa0cf('0xf'),_0xa63ed,_0xa0cf('0x16'));_0x2dbef8(_0x1ba1b7[_0xa0cf('0x17')]['message']);}})[_0xa0cf('0x18')](function(_0x594304){logger['error'](_0xa0cf('0xf'),_0xa63ed,_0x594304);_0x4e2b85(_0x594304);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 25ea9f8..f0fa42c 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 _0xd538=['multer','path','Router','../../components/auth/service','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','delete','destroy','exports'];(function(_0x3877c1,_0x238c29){var _0x59056a=function(_0x3567cd){while(--_0x3567cd){_0x3877c1['push'](_0x3877c1['shift']());}};_0x59056a(++_0x238c29);}(_0xd538,0x126));var _0x8d53=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xd538[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x8d53('0x0'));var util=require('util');var path=require(_0x8d53('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8d53('0x2')]();var auth=require(_0x8d53('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8d53('0x4'));router[_0x8d53('0x5')]('/',auth[_0x8d53('0x6')](),controller[_0x8d53('0x7')]);router[_0x8d53('0x5')](_0x8d53('0x8'),auth[_0x8d53('0x6')](),controller[_0x8d53('0x9')]);router['get'](_0x8d53('0xa'),auth[_0x8d53('0x6')](),controller[_0x8d53('0xb')]);router[_0x8d53('0x5')](_0x8d53('0xc'),auth[_0x8d53('0x6')](),controller['getFields']);router[_0x8d53('0xd')]('/',auth['isAuthenticated'](),controller[_0x8d53('0xe')]);router[_0x8d53('0xd')](_0x8d53('0xa'),auth['isAuthenticated'](),controller[_0x8d53('0xf')]);router[_0x8d53('0x10')](_0x8d53('0x8'),auth[_0x8d53('0x6')](),controller[_0x8d53('0x11')]);router[_0x8d53('0x12')]('/:id',auth[_0x8d53('0x6')](),controller[_0x8d53('0x13')]);module[_0x8d53('0x14')]=router; \ No newline at end of file +var _0x2994=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x3abfd4,_0x18062a){var _0x59e956=function(_0xe8fe68){while(--_0xe8fe68){_0x3abfd4['push'](_0x3abfd4['shift']());}};_0x59e956(++_0x18062a);}(_0x2994,0x137));var _0x4299=function(_0x51fe5f,_0x1d8632){_0x51fe5f=_0x51fe5f-0x0;var _0x4abce9=_0x2994[_0x51fe5f];return _0x4abce9;};'use strict';var multer=require(_0x4299('0x0'));var util=require(_0x4299('0x1'));var path=require(_0x4299('0x2'));var timeout=require(_0x4299('0x3'));var express=require(_0x4299('0x4'));var router=express['Router']();var auth=require(_0x4299('0x5'));var interaction=require(_0x4299('0x6'));var config=require(_0x4299('0x7'));var controller=require('./intZendeskAccount.controller');router[_0x4299('0x8')]('/',auth['isAuthenticated'](),controller[_0x4299('0x9')]);router[_0x4299('0x8')]('/:id',auth[_0x4299('0xa')](),controller[_0x4299('0xb')]);router[_0x4299('0x8')](_0x4299('0xc'),auth['isAuthenticated'](),controller[_0x4299('0xd')]);router['get'](_0x4299('0xe'),auth[_0x4299('0xa')](),controller[_0x4299('0xf')]);router[_0x4299('0x10')]('/',auth[_0x4299('0xa')](),controller['create']);router[_0x4299('0x10')](_0x4299('0xc'),auth[_0x4299('0xa')](),controller[_0x4299('0x11')]);router['put']('/:id',auth[_0x4299('0xa')](),controller[_0x4299('0x12')]);router['delete']('/:id',auth[_0x4299('0xa')](),controller[_0x4299('0x13')]);module[_0x4299('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index b1942d7..eb6d2f6 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 _0xc0a7=['integrationTab','newTab','sequelize','exports','STRING','username','remoteUri','ENUM','password','token'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xc0a7,0x1ba));var _0x7c0a=function(_0x2f43db,_0x349eea){_0x2f43db=_0x2f43db-0x0;var _0x3d1391=_0xc0a7[_0x2f43db];return _0x3d1391;};'use strict';var Sequelize=require(_0x7c0a('0x0'));module[_0x7c0a('0x1')]={'name':{'type':Sequelize[_0x7c0a('0x2')]},'description':{'type':Sequelize[_0x7c0a('0x2')]},'username':{'type':Sequelize[_0x7c0a('0x2')],'unique':_0x7c0a('0x3')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x7c0a('0x2')]},'remoteUri':{'type':Sequelize[_0x7c0a('0x2')],'unique':_0x7c0a('0x4')},'authType':{'type':Sequelize[_0x7c0a('0x5')](_0x7c0a('0x6'),_0x7c0a('0x7')),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0x7c0a('0x2')]},'type':{'type':Sequelize[_0x7c0a('0x5')](_0x7c0a('0x8'),_0x7c0a('0x9')),'defaultValue':_0x7c0a('0x8')}}; \ No newline at end of file +var _0x6b39=['token','password','newTab','STRING','username'];(function(_0xdcb83a,_0x187a63){var _0x187a41=function(_0x516b88){while(--_0x516b88){_0xdcb83a['push'](_0xdcb83a['shift']());}};_0x187a41(++_0x187a63);}(_0x6b39,0x1cf));var _0x96b3=function(_0x743701,_0x3e67bb){_0x743701=_0x743701-0x0;var _0x5a141d=_0x6b39[_0x743701];return _0x5a141d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x96b3('0x0')]},'username':{'type':Sequelize['STRING'],'unique':_0x96b3('0x1')},'password':{'type':Sequelize[_0x96b3('0x0')]},'token':{'type':Sequelize[_0x96b3('0x0')]},'remoteUri':{'type':Sequelize[_0x96b3('0x0')],'unique':'remoteUri'},'authType':{'type':Sequelize['ENUM']('password',_0x96b3('0x2')),'defaultValue':_0x96b3('0x3')},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM']('integrationTab',_0x96b3('0x4')),'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 2b48095..560e986 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 _0x5e60=['ticket_fields','headers','format','%s:%s','toString','base64','Basic\x20%s','%s/token:%s','Unknown\x20authentication\x20type','subject','description','group','remove','includes','title','position','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','reject','save','then','destroy','stack','send','index','fieldName','type','key','model','map','name','query','filters','attributes','fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','ZendeskAccount','include','findAll','params','keys','rawAttributes','intersection','length','includeAll','find','create','body','update','ZendeskConfiguration','order','getConfigurations','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','username','password','token','authType','remoteUri','slice','substring'];(function(_0x32be53,_0x50860d){var _0x10d08e=function(_0xed77bb){while(--_0xed77bb){_0x32be53['push'](_0x32be53['shift']());}};_0x10d08e(++_0x50860d);}(_0x5e60,0x9a));var _0x05e6=function(_0x1aa474,_0x3007ea){_0x1aa474=_0x1aa474-0x0;var _0x4d6c78=_0x5e60[_0x1aa474];return _0x4d6c78;};'use strict';var pdf=require(_0x05e6('0x0'));var emlformat=require(_0x05e6('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x05e6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x05e6('0x3'));var moment=require(_0x05e6('0x4'));var BPromise=require(_0x05e6('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x05e6('0x6'));var sox=require(_0x05e6('0x7'));var csv=require(_0x05e6('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x05e6('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x05e6('0xa'));var deskjs=require(_0x05e6('0xb'));var toCsv=require(_0x05e6('0x8'));var querystring=require(_0x05e6('0xc'));var Papa=require('papaparse');var Redis=require(_0x05e6('0xd'));var authService=require(_0x05e6('0xe'));var qs=require(_0x05e6('0xf'));var as=require(_0x05e6('0x10'));var hardwareService=require(_0x05e6('0x11'));var logger=require(_0x05e6('0x12'))(_0x05e6('0x13'));var utils=require('../../config/utils');var config=require(_0x05e6('0x14'));var db=require(_0x05e6('0x15'))['db'];var integrations=require(_0x05e6('0x16'));var jayson=require(_0x05e6('0x17'));var client=jayson[_0x05e6('0x18')][_0x05e6('0x19')]({'port':0x232a});function checkPasswordPattern(_0x53ac12,_0x4fd37a,_0x432782){if(_0x432782){var _0x249e8b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x249e8b['test'](_0x4fd37a)){return _0x53ac12;}else{throw new db[(_0x05e6('0x1a'))][(_0x05e6('0x1b'))](_0x05e6('0x1c'));}}else{return _0x53ac12;}}function respondWithRpcPromise(_0x48c40e,_0x3dce27,_0x478560,_0xba6359){return new BPromise(function(_0x2e325f,_0x5c2c60){var _0x42da1c=_0xba6359||client;return _0x42da1c[_0x05e6('0x1d')](_0x48c40e,_0x478560)['then'](function(_0x411430){logger[_0x05e6('0x1e')](_0x05e6('0x1f'),_0x3dce27,_0x05e6('0x20'));logger[_0x05e6('0x21')](_0x05e6('0x22'),_0x3dce27,_0x05e6('0x20'),JSON[_0x05e6('0x23')](_0x411430));if(_0x411430[_0x05e6('0x24')]){if(_0x411430[_0x05e6('0x24')][_0x05e6('0x25')]===0x1f4){logger[_0x05e6('0x24')](_0x05e6('0x1f'),_0x3dce27,_0x411430[_0x05e6('0x24')]['message']);return _0x5c2c60(_0x411430[_0x05e6('0x24')][_0x05e6('0x26')]);}logger[_0x05e6('0x24')](_0x05e6('0x1f'),_0x3dce27,_0x411430[_0x05e6('0x24')][_0x05e6('0x26')]);return _0x2e325f(_0x411430[_0x05e6('0x24')]['message']);}else{logger['info']('ZendeskAccount,\x20%s,\x20%s',_0x3dce27,_0x05e6('0x20'));_0x2e325f(_0x411430[_0x05e6('0x27')][_0x05e6('0x26')]);}})[_0x05e6('0x28')](function(_0x1d2817){logger[_0x05e6('0x24')](_0x05e6('0x1f'),_0x3dce27,_0x1d2817);_0x5c2c60(_0x1d2817);});});}function respondWithStatusCode(_0x1e3cc0,_0x204716){_0x204716=_0x204716||0xcc;return function(_0x31fb98){if(_0x31fb98){return _0x1e3cc0[_0x05e6('0x29')](_0x204716);}return _0x1e3cc0[_0x05e6('0x2a')](_0x204716)[_0x05e6('0x2b')]();};}function respondWithResult(_0x2bd982,_0x5cedcf){_0x5cedcf=_0x5cedcf||0xc8;return function(_0x1ca971){if(_0x1ca971){return _0x2bd982[_0x05e6('0x2a')](_0x5cedcf)['json'](_0x1ca971);}};}function respondWithFilteredResult(_0x3d82c9,_0x470988){return function(_0xd60e87){if(_0xd60e87){var _0xcd8fa1=_0xd60e87[_0x05e6('0x2c')],_0x285729=_0x470988[_0x05e6('0x2d')],_0x519724=_0x470988['offset']+_0x470988[_0x05e6('0x2e')],_0xd65632;if(_0x519724>=_0xcd8fa1){_0x519724=_0xcd8fa1;_0xd65632=0xc8;}else{_0xd65632=0xce;}_0x3d82c9[_0x05e6('0x2a')](_0xd65632);return _0x3d82c9['set'](_0x05e6('0x2f'),_0x285729+'-'+_0x519724+'/'+_0xcd8fa1)[_0x05e6('0x30')](_0xd60e87);}return null;};}function patchUpdates(_0x4288a0){return function(_0x49e0c6){try{jsonpatch[_0x05e6('0x31')](_0x49e0c6,_0x4288a0,!![]);}catch(_0x41b8c8){return BPromise[_0x05e6('0x32')](_0x41b8c8);}return _0x49e0c6[_0x05e6('0x33')]();};}function saveUpdates(_0x422b1e,_0x3d2b05){return function(_0x672128){if(_0x672128){return _0x672128['update'](_0x422b1e)[_0x05e6('0x34')](function(_0x2297f0){return _0x2297f0;});}return null;};}function removeEntity(_0x2ab953,_0x4f9162){return function(_0x31b2b5){if(_0x31b2b5){return _0x31b2b5[_0x05e6('0x35')]()['then'](function(){_0x2ab953[_0x05e6('0x2a')](0xcc)[_0x05e6('0x2b')]();});}};}function handleEntityNotFound(_0x19bad2,_0x4cd75a){return function(_0x58eb40){if(!_0x58eb40){_0x19bad2[_0x05e6('0x29')](0x194);}return _0x58eb40;};}function handleError(_0x12c585,_0x352b3e){_0x352b3e=_0x352b3e||0x1f4;return function(_0x252688){logger[_0x05e6('0x24')](_0x252688[_0x05e6('0x36')]);if(_0x252688['name']){delete _0x252688['name'];}_0x12c585[_0x05e6('0x2a')](_0x352b3e)[_0x05e6('0x37')](_0x252688);};}exports[_0x05e6('0x38')]=function(_0x4c811f,_0x460aa2){var _0x204db4={},_0x16caa7={},_0x4d0a3c={'count':0x0,'rows':[]};var _0x4f1299=_['map'](db['ZendeskAccount']['rawAttributes'],function(_0x5003eb){return{'name':_0x5003eb[_0x05e6('0x39')],'type':_0x5003eb[_0x05e6('0x3a')][_0x05e6('0x3b')]};});_0x16caa7[_0x05e6('0x3c')]=_[_0x05e6('0x3d')](_0x4f1299,_0x05e6('0x3e'));_0x16caa7['query']=_['keys'](_0x4c811f[_0x05e6('0x3f')]);_0x16caa7[_0x05e6('0x40')]=_['intersection'](_0x16caa7[_0x05e6('0x3c')],_0x16caa7[_0x05e6('0x3f')]);_0x204db4[_0x05e6('0x41')]=_['intersection'](_0x16caa7['model'],qs[_0x05e6('0x42')](_0x4c811f[_0x05e6('0x3f')][_0x05e6('0x42')]));_0x204db4['attributes']=_0x204db4[_0x05e6('0x41')]['length']?_0x204db4[_0x05e6('0x41')]:_0x16caa7[_0x05e6('0x3c')];if(!_0x4c811f[_0x05e6('0x3f')]['hasOwnProperty'](_0x05e6('0x43'))){_0x204db4['limit']=qs[_0x05e6('0x2e')](_0x4c811f['query'][_0x05e6('0x2e')]);_0x204db4['offset']=qs['offset'](_0x4c811f[_0x05e6('0x3f')][_0x05e6('0x2d')]);}_0x204db4['order']=qs[_0x05e6('0x44')](_0x4c811f[_0x05e6('0x3f')][_0x05e6('0x44')]);_0x204db4[_0x05e6('0x45')]=qs[_0x05e6('0x40')](_[_0x05e6('0x46')](_0x4c811f['query'],_0x16caa7['filters']));if(_0x4c811f['query'][_0x05e6('0x47')]){_0x204db4[_0x05e6('0x45')]=_[_0x05e6('0x48')](_0x204db4[_0x05e6('0x45')],{'$or':_[_0x05e6('0x3d')](_0x4f1299,function(_0x2be0e5){if(_0x2be0e5[_0x05e6('0x3a')]!==_0x05e6('0x49')){var _0x1f0457={};_0x1f0457[_0x2be0e5[_0x05e6('0x3e')]]={'$like':'%'+_0x4c811f[_0x05e6('0x3f')][_0x05e6('0x47')]+'%'};return _0x1f0457;}})});}_0x204db4=_['merge']({},_0x204db4,_0x4c811f[_0x05e6('0x4a')]);var _0x29ff98={'where':_0x204db4['where']};return db[_0x05e6('0x4b')][_0x05e6('0x2c')](_0x29ff98)['then'](function(_0x2614a1){_0x4d0a3c[_0x05e6('0x2c')]=_0x2614a1;if(_0x4c811f['query']['includeAll']){_0x204db4[_0x05e6('0x4c')]=[{'all':!![]}];}return db[_0x05e6('0x4b')][_0x05e6('0x4d')](_0x204db4);})[_0x05e6('0x34')](function(_0xb1298a){_0x4d0a3c['rows']=_0xb1298a;return _0x4d0a3c;})[_0x05e6('0x34')](respondWithFilteredResult(_0x460aa2,_0x204db4))[_0x05e6('0x28')](handleError(_0x460aa2,null));};exports['show']=function(_0x4169fe,_0x240f10){var _0x308eff={'raw':![],'where':{'id':_0x4169fe[_0x05e6('0x4e')]['id']}},_0x5aded9={};_0x5aded9[_0x05e6('0x3c')]=_[_0x05e6('0x4f')](db[_0x05e6('0x4b')][_0x05e6('0x50')]);_0x5aded9[_0x05e6('0x3f')]=_['keys'](_0x4169fe[_0x05e6('0x3f')]);_0x5aded9[_0x05e6('0x40')]=_['intersection'](_0x5aded9['model'],_0x5aded9['query']);_0x308eff[_0x05e6('0x41')]=_[_0x05e6('0x51')](_0x5aded9[_0x05e6('0x3c')],qs[_0x05e6('0x42')](_0x4169fe[_0x05e6('0x3f')][_0x05e6('0x42')]));_0x308eff[_0x05e6('0x41')]=_0x308eff[_0x05e6('0x41')][_0x05e6('0x52')]?_0x308eff['attributes']:_0x5aded9[_0x05e6('0x3c')];if(_0x4169fe['query'][_0x05e6('0x53')]){_0x308eff['include']=[{'all':!![]}];}_0x308eff=_[_0x05e6('0x48')]({},_0x308eff,_0x4169fe[_0x05e6('0x4a')]);return db[_0x05e6('0x4b')][_0x05e6('0x54')](_0x308eff)[_0x05e6('0x34')](handleEntityNotFound(_0x240f10,null))['then'](respondWithResult(_0x240f10,null))['catch'](handleError(_0x240f10,null));};exports[_0x05e6('0x55')]=function(_0x2e4d0d,_0x4c0324){return db[_0x05e6('0x4b')][_0x05e6('0x55')](_0x2e4d0d[_0x05e6('0x56')],{})[_0x05e6('0x34')](respondWithResult(_0x4c0324,0xc9))['catch'](handleError(_0x4c0324,null));};exports[_0x05e6('0x57')]=function(_0x4bbafa,_0x45b785){if(_0x4bbafa['body']['id']){delete _0x4bbafa['body']['id'];}return db[_0x05e6('0x4b')]['find']({'where':{'id':_0x4bbafa[_0x05e6('0x4e')]['id']}})[_0x05e6('0x34')](handleEntityNotFound(_0x45b785,null))[_0x05e6('0x34')](saveUpdates(_0x4bbafa['body'],null))[_0x05e6('0x34')](respondWithResult(_0x45b785,null))[_0x05e6('0x28')](handleError(_0x45b785,null));};exports[_0x05e6('0x35')]=function(_0x16f901,_0x53010e){return db[_0x05e6('0x4b')]['find']({'where':{'id':_0x16f901[_0x05e6('0x4e')]['id']}})[_0x05e6('0x34')](handleEntityNotFound(_0x53010e,null))[_0x05e6('0x34')](removeEntity(_0x53010e,null))[_0x05e6('0x28')](handleError(_0x53010e,null));};exports['getConfigurations']=function(_0x50d3e0,_0x58ba62,_0x4ba7d0){var _0xd0584b={};var _0x1cebba={};var _0x351083;var _0x2f8d2d;return db[_0x05e6('0x4b')]['findOne']({'where':{'id':_0x50d3e0[_0x05e6('0x4e')]['id']}})[_0x05e6('0x34')](handleEntityNotFound(_0x58ba62,null))[_0x05e6('0x34')](function(_0x3a650f){if(_0x3a650f){_0x351083=_0x3a650f;_0x1cebba[_0x05e6('0x3c')]=_[_0x05e6('0x4f')](db[_0x05e6('0x58')][_0x05e6('0x50')]);_0x1cebba[_0x05e6('0x3f')]=_['keys'](_0x50d3e0[_0x05e6('0x3f')]);_0x1cebba['filters']=_['intersection'](_0x1cebba['model'],_0x1cebba[_0x05e6('0x3f')]);_0xd0584b[_0x05e6('0x41')]=_[_0x05e6('0x51')](_0x1cebba[_0x05e6('0x3c')],qs[_0x05e6('0x42')](_0x50d3e0['query'][_0x05e6('0x42')]));_0xd0584b[_0x05e6('0x41')]=_0xd0584b[_0x05e6('0x41')][_0x05e6('0x52')]?_0xd0584b[_0x05e6('0x41')]:_0x1cebba[_0x05e6('0x3c')];_0xd0584b[_0x05e6('0x59')]=qs['sort'](_0x50d3e0['query'][_0x05e6('0x44')]);_0xd0584b[_0x05e6('0x45')]=qs[_0x05e6('0x40')](_['pick'](_0x50d3e0['query'],_0x1cebba[_0x05e6('0x40')]));if(_0x50d3e0[_0x05e6('0x3f')]['filter']){_0xd0584b[_0x05e6('0x45')]=_[_0x05e6('0x48')](_0xd0584b[_0x05e6('0x45')],{'$or':_['map'](_0xd0584b[_0x05e6('0x41')],function(_0x3378c0){var _0x4a164c={};_0x4a164c[_0x3378c0]={'$like':'%'+_0x50d3e0[_0x05e6('0x3f')]['filter']+'%'};return _0x4a164c;})});}_0xd0584b=_['merge']({},_0xd0584b,_0x50d3e0[_0x05e6('0x4a')]);return _0x351083[_0x05e6('0x5a')](_0xd0584b);}})['then'](function(_0x123ac5){if(_0x123ac5){_0x2f8d2d=_0x123ac5[_0x05e6('0x52')];if(!_0x50d3e0[_0x05e6('0x3f')][_0x05e6('0x5b')](_0x05e6('0x43'))){_0xd0584b['limit']=qs['limit'](_0x50d3e0[_0x05e6('0x3f')][_0x05e6('0x2e')]);_0xd0584b[_0x05e6('0x2d')]=qs['offset'](_0x50d3e0[_0x05e6('0x3f')][_0x05e6('0x2d')]);}return _0x351083['getConfigurations'](_0xd0584b);}})[_0x05e6('0x34')](function(_0x29c42b){if(_0x29c42b){return _0x29c42b?{'count':_0x2f8d2d,'rows':_0x29c42b}:null;}})[_0x05e6('0x34')](respondWithResult(_0x58ba62,null))['catch'](handleError(_0x58ba62,null));};exports[_0x05e6('0x5c')]=function(_0x20ae1e,_0x293c57,_0x2d4946){if(_0x20ae1e[_0x05e6('0x56')]['id']){delete _0x20ae1e[_0x05e6('0x56')]['id'];}return db[_0x05e6('0x4b')][_0x05e6('0x5d')]({'where':{'id':_0x20ae1e[_0x05e6('0x4e')]['id']}})[_0x05e6('0x34')](handleEntityNotFound(_0x293c57,null))['then'](function(_0x1b7b85){if(_0x1b7b85){_0x20ae1e[_0x05e6('0x56')][_0x05e6('0x5e')]=_0x1b7b85['id'];_0x20ae1e[_0x05e6('0x56')][_0x05e6('0x5f')]=integrations[_0x05e6('0x60')](_0x20ae1e[_0x05e6('0x56')][_0x05e6('0x61')],_0x20ae1e[_0x05e6('0x56')][_0x05e6('0x3a')]);_0x20ae1e[_0x05e6('0x56')][_0x05e6('0x62')]=integrations[_0x05e6('0x63')](_0x20ae1e['body'][_0x05e6('0x61')],_0x20ae1e[_0x05e6('0x56')][_0x05e6('0x3a')]);return db[_0x05e6('0x58')][_0x05e6('0x55')](_0x20ae1e[_0x05e6('0x56')],{'include':[{'model':db[_0x05e6('0x64')],'as':_0x05e6('0x5f')},{'model':db['ZendeskField'],'as':_0x05e6('0x62')}]});}return null;})['then'](respondWithResult(_0x293c57,null))['catch'](handleError(_0x293c57,null));};exports['getFields']=function(_0x2dd910,_0x684382,_0x40c2e4){var _0x25d6d0='';return db[_0x05e6('0x4b')][_0x05e6('0x5d')]({'where':{'id':_0x2dd910[_0x05e6('0x4e')]['id']},'attributes':['id',_0x05e6('0x65'),_0x05e6('0x66'),_0x05e6('0x67'),_0x05e6('0x68'),_0x05e6('0x69')]})[_0x05e6('0x34')](handleEntityNotFound(_0x684382,null))[_0x05e6('0x34')](function(_0x5c228a){if(_0x5c228a){_0x25d6d0=_0x5c228a[_0x05e6('0x69')];var _0x50f8d7=_0x25d6d0[_0x05e6('0x6a')](-0x1);if(_0x50f8d7==='/'){_0x25d6d0=_0x25d6d0[_0x05e6('0x6b')](0x0,_0x25d6d0['lastIndexOf'](_0x50f8d7));}var _0x494dca={'method':'GET','uri':util['format']('%s/%s',_0x25d6d0,_0x05e6('0x6c')),'json':!![]};switch(_0x5c228a[_0x05e6('0x68')]){case _0x05e6('0x66'):_0x494dca[_0x05e6('0x6d')]={'Authorization':util[_0x05e6('0x6e')]('Basic\x20%s',new Buffer(util[_0x05e6('0x6e')](_0x05e6('0x6f'),_0x5c228a['username'],_0x5c228a[_0x05e6('0x66')]))[_0x05e6('0x70')](_0x05e6('0x71')))};break;case _0x05e6('0x67'):_0x494dca[_0x05e6('0x6d')]={'Authorization':util[_0x05e6('0x6e')](_0x05e6('0x72'),new Buffer(util[_0x05e6('0x6e')](_0x05e6('0x73'),_0x5c228a[_0x05e6('0x65')],_0x5c228a['token']))[_0x05e6('0x70')](_0x05e6('0x71')))};break;default:throw new db[(_0x05e6('0x1a'))][(_0x05e6('0x1b'))](_0x05e6('0x74'));}return rp(_0x494dca);}})['then'](function(_0x5725e8){if(_0x5725e8){var _0x1c7d80=[_0x05e6('0x75'),_0x05e6('0x76'),_0x05e6('0x77'),'assignee'];_[_0x05e6('0x78')](_0x5725e8[_0x05e6('0x6c')],function(_0x4e6b7b){return _0x1c7d80[_0x05e6('0x79')](_0x4e6b7b[_0x05e6('0x3a')]);});return{'count':_0x5725e8[_0x05e6('0x6c')][_0x05e6('0x52')],'rows':_['map'](_0x5725e8['ticket_fields'],function(_0x53fd49){return{'id':_0x53fd49['id'],'name':_0x53fd49['position']>0x7?_0x53fd49[_0x05e6('0x7a')]:_0x53fd49[_0x05e6('0x3a')],'custom':_0x53fd49[_0x05e6('0x7b')]>0x7?!![]:![],'options':_0x53fd49['system_field_options']?_0x53fd49[_0x05e6('0x7c')]:_0x53fd49[_0x05e6('0x7d')]?_0x53fd49[_0x05e6('0x7d')]:[]};})};}})[_0x05e6('0x34')](respondWithResult(_0x684382,null))[_0x05e6('0x28')](function(_0x2ff984){var _0x222f59=_0x2dd910[_0x05e6('0x3f')][_0x05e6('0x7e')]?0x1f4:_0x2ff984[_0x05e6('0x7f')]||0x1f4;logger[_0x05e6('0x24')](_0x05e6('0x80'),_0x05e6('0x81'),_0x222f59,JSON[_0x05e6('0x23')](_0x2ff984));delete _0x2ff984[_0x05e6('0x3e')];if(_0x222f59===0x191){_0x222f59=0x190;}_0x684382[_0x05e6('0x2a')](_0x222f59)['send'](_0x2dd910['query']['test']?{'message':_0x05e6('0x82'),'statusCode':_0x2ff984[_0x05e6('0x7f')]}:_0x2ff984);});}; \ No newline at end of file +var _0xdede=['password','token','authType','remoteUri','slice','substring','lastIndexOf','ticket_fields','headers','format','Basic\x20%s','%s:%s','toString','base64','Unknown\x20authentication\x20type','subject','group','remove','title','position','system_field_options','custom_field_options','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','test','Sequelize','ValidationError','request','ZendeskAccount,\x20%s,\x20%s','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','then','destroy','name','send','index','map','ZendeskAccount','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','count','includeAll','include','findAll','show','params','rawAttributes','find','create','body','getConfigurations','findOne','ZendeskConfiguration','options','nolimit','addConfiguration','AccountId','getSubjects','channel','getDescriptions','ZendeskField','Subjects','Descriptions','getFields','username'];(function(_0x44fcba,_0x2746b0){var _0x274327=function(_0x523307){while(--_0x523307){_0x44fcba['push'](_0x44fcba['shift']());}};_0x274327(++_0x2746b0);}(_0xdede,0x199));var _0xeded=function(_0x3bf77e,_0x40d9b5){_0x3bf77e=_0x3bf77e-0x0;var _0x192df1=_0xdede[_0x3bf77e];return _0x192df1;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xeded('0x0'));var zipdir=require(_0xeded('0x1'));var jsonpatch=require(_0xeded('0x2'));var rp=require(_0xeded('0x3'));var moment=require(_0xeded('0x4'));var BPromise=require(_0xeded('0x5'));var Mustache=require(_0xeded('0x6'));var util=require(_0xeded('0x7'));var path=require(_0xeded('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeded('0x9'));var fs=require('fs');var _=require(_0xeded('0xa'));var squel=require(_0xeded('0xb'));var crypto=require(_0xeded('0xc'));var jsforce=require(_0xeded('0xd'));var deskjs=require(_0xeded('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xeded('0xf'));var Redis=require(_0xeded('0x10'));var authService=require(_0xeded('0x11'));var qs=require(_0xeded('0x12'));var as=require(_0xeded('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeded('0x14'))(_0xeded('0x15'));var utils=require(_0xeded('0x16'));var config=require(_0xeded('0x17'));var db=require(_0xeded('0x18'))['db'];var integrations=require(_0xeded('0x19'));var jayson=require(_0xeded('0x1a'));var client=jayson[_0xeded('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x2a1455,_0x7a5ed3,_0xf9afc4){if(_0xf9afc4){var _0x3ea861=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3ea861[_0xeded('0x1c')](_0x7a5ed3)){return _0x2a1455;}else{throw new db[(_0xeded('0x1d'))][(_0xeded('0x1e'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x2a1455;}}function respondWithRpcPromise(_0x431379,_0x546fc6,_0xcb8245,_0x3b880e){return new BPromise(function(_0x1fe827,_0x87b59c){var _0x525367=_0x3b880e||client;return _0x525367[_0xeded('0x1f')](_0x431379,_0xcb8245)['then'](function(_0x3214a9){logger['info'](_0xeded('0x20'),_0x546fc6,'request\x20sent');logger[_0xeded('0x21')](_0xeded('0x22'),_0x546fc6,'request\x20sent',JSON[_0xeded('0x23')](_0x3214a9));if(_0x3214a9[_0xeded('0x24')]){if(_0x3214a9[_0xeded('0x24')][_0xeded('0x25')]===0x1f4){logger['error'](_0xeded('0x20'),_0x546fc6,_0x3214a9[_0xeded('0x24')][_0xeded('0x26')]);return _0x87b59c(_0x3214a9[_0xeded('0x24')][_0xeded('0x26')]);}logger[_0xeded('0x24')](_0xeded('0x20'),_0x546fc6,_0x3214a9[_0xeded('0x24')]['message']);return _0x1fe827(_0x3214a9['error'][_0xeded('0x26')]);}else{logger[_0xeded('0x27')](_0xeded('0x20'),_0x546fc6,_0xeded('0x28'));_0x1fe827(_0x3214a9[_0xeded('0x29')][_0xeded('0x26')]);}})[_0xeded('0x2a')](function(_0x425620){logger['error'](_0xeded('0x20'),_0x546fc6,_0x425620);_0x87b59c(_0x425620);});});}function respondWithStatusCode(_0x49f437,_0x3d16e3){_0x3d16e3=_0x3d16e3||0xcc;return function(_0x254609){if(_0x254609){return _0x49f437[_0xeded('0x2b')](_0x3d16e3);}return _0x49f437[_0xeded('0x2c')](_0x3d16e3)[_0xeded('0x2d')]();};}function respondWithResult(_0xb89f0a,_0x2a0924){_0x2a0924=_0x2a0924||0xc8;return function(_0x4094c9){if(_0x4094c9){return _0xb89f0a[_0xeded('0x2c')](_0x2a0924)[_0xeded('0x2e')](_0x4094c9);}};}function respondWithFilteredResult(_0x1a33e5,_0x288e4c){return function(_0xe6f9ba){if(_0xe6f9ba){var _0x580488=_0xe6f9ba['count'],_0x7d5a3b=_0x288e4c[_0xeded('0x2f')],_0x3d4e11=_0x288e4c[_0xeded('0x2f')]+_0x288e4c[_0xeded('0x30')],_0x521ce7;if(_0x3d4e11>=_0x580488){_0x3d4e11=_0x580488;_0x521ce7=0xc8;}else{_0x521ce7=0xce;}_0x1a33e5[_0xeded('0x2c')](_0x521ce7);return _0x1a33e5[_0xeded('0x31')](_0xeded('0x32'),_0x7d5a3b+'-'+_0x3d4e11+'/'+_0x580488)[_0xeded('0x2e')](_0xe6f9ba);}return null;};}function patchUpdates(_0x50793d){return function(_0x2433df){try{jsonpatch['apply'](_0x2433df,_0x50793d,!![]);}catch(_0x5d5a46){return BPromise[_0xeded('0x33')](_0x5d5a46);}return _0x2433df['save']();};}function saveUpdates(_0x24ed16,_0x3e8b7f){return function(_0x3ffd48){if(_0x3ffd48){return _0x3ffd48['update'](_0x24ed16)[_0xeded('0x34')](function(_0x3029dc){return _0x3029dc;});}return null;};}function removeEntity(_0x58d7d6,_0x15ac9e){return function(_0x1c317a){if(_0x1c317a){return _0x1c317a[_0xeded('0x35')]()[_0xeded('0x34')](function(){_0x58d7d6[_0xeded('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48ae70,_0x103e8e){return function(_0x9624b4){if(!_0x9624b4){_0x48ae70[_0xeded('0x2b')](0x194);}return _0x9624b4;};}function handleError(_0x1f6995,_0x24273e){_0x24273e=_0x24273e||0x1f4;return function(_0x362f4c){logger[_0xeded('0x24')](_0x362f4c['stack']);if(_0x362f4c[_0xeded('0x36')]){delete _0x362f4c[_0xeded('0x36')];}_0x1f6995[_0xeded('0x2c')](_0x24273e)[_0xeded('0x37')](_0x362f4c);};}exports[_0xeded('0x38')]=function(_0x37e214,_0x566e3f){var _0x3a2da0={},_0x31c900={},_0x292ec3={'count':0x0,'rows':[]};var _0x1d563d=_[_0xeded('0x39')](db[_0xeded('0x3a')]['rawAttributes'],function(_0x5dccd4){return{'name':_0x5dccd4[_0xeded('0x3b')],'type':_0x5dccd4[_0xeded('0x3c')][_0xeded('0x3d')]};});_0x31c900[_0xeded('0x3e')]=_['map'](_0x1d563d,_0xeded('0x36'));_0x31c900[_0xeded('0x3f')]=_[_0xeded('0x40')](_0x37e214['query']);_0x31c900[_0xeded('0x41')]=_['intersection'](_0x31c900['model'],_0x31c900[_0xeded('0x3f')]);_0x3a2da0[_0xeded('0x42')]=_[_0xeded('0x43')](_0x31c900['model'],qs[_0xeded('0x44')](_0x37e214[_0xeded('0x3f')][_0xeded('0x44')]));_0x3a2da0[_0xeded('0x42')]=_0x3a2da0['attributes'][_0xeded('0x45')]?_0x3a2da0[_0xeded('0x42')]:_0x31c900[_0xeded('0x3e')];if(!_0x37e214[_0xeded('0x3f')][_0xeded('0x46')]('nolimit')){_0x3a2da0[_0xeded('0x30')]=qs['limit'](_0x37e214[_0xeded('0x3f')][_0xeded('0x30')]);_0x3a2da0[_0xeded('0x2f')]=qs[_0xeded('0x2f')](_0x37e214[_0xeded('0x3f')][_0xeded('0x2f')]);}_0x3a2da0[_0xeded('0x47')]=qs['sort'](_0x37e214[_0xeded('0x3f')][_0xeded('0x48')]);_0x3a2da0[_0xeded('0x49')]=qs[_0xeded('0x41')](_[_0xeded('0x4a')](_0x37e214['query'],_0x31c900[_0xeded('0x41')]));if(_0x37e214['query']['filter']){_0x3a2da0[_0xeded('0x49')]=_[_0xeded('0x4b')](_0x3a2da0[_0xeded('0x49')],{'$or':_[_0xeded('0x39')](_0x1d563d,function(_0x277fac){if(_0x277fac[_0xeded('0x3c')]!==_0xeded('0x4c')){var _0x341ca2={};_0x341ca2[_0x277fac[_0xeded('0x36')]]={'$like':'%'+_0x37e214[_0xeded('0x3f')][_0xeded('0x4d')]+'%'};return _0x341ca2;}})});}_0x3a2da0=_['merge']({},_0x3a2da0,_0x37e214['options']);var _0x1806fe={'where':_0x3a2da0['where']};return db['ZendeskAccount'][_0xeded('0x4e')](_0x1806fe)[_0xeded('0x34')](function(_0x1d23e5){_0x292ec3['count']=_0x1d23e5;if(_0x37e214['query'][_0xeded('0x4f')]){_0x3a2da0[_0xeded('0x50')]=[{'all':!![]}];}return db[_0xeded('0x3a')][_0xeded('0x51')](_0x3a2da0);})['then'](function(_0x52373f){_0x292ec3['rows']=_0x52373f;return _0x292ec3;})[_0xeded('0x34')](respondWithFilteredResult(_0x566e3f,_0x3a2da0))['catch'](handleError(_0x566e3f,null));};exports[_0xeded('0x52')]=function(_0x456117,_0x332c00){var _0x22e494={'raw':![],'where':{'id':_0x456117[_0xeded('0x53')]['id']}},_0x81ad13={};_0x81ad13[_0xeded('0x3e')]=_[_0xeded('0x40')](db['ZendeskAccount'][_0xeded('0x54')]);_0x81ad13['query']=_[_0xeded('0x40')](_0x456117[_0xeded('0x3f')]);_0x81ad13[_0xeded('0x41')]=_[_0xeded('0x43')](_0x81ad13[_0xeded('0x3e')],_0x81ad13['query']);_0x22e494[_0xeded('0x42')]=_[_0xeded('0x43')](_0x81ad13[_0xeded('0x3e')],qs['fields'](_0x456117['query'][_0xeded('0x44')]));_0x22e494[_0xeded('0x42')]=_0x22e494[_0xeded('0x42')][_0xeded('0x45')]?_0x22e494[_0xeded('0x42')]:_0x81ad13['model'];if(_0x456117[_0xeded('0x3f')]['includeAll']){_0x22e494['include']=[{'all':!![]}];}_0x22e494=_[_0xeded('0x4b')]({},_0x22e494,_0x456117['options']);return db[_0xeded('0x3a')][_0xeded('0x55')](_0x22e494)[_0xeded('0x34')](handleEntityNotFound(_0x332c00,null))['then'](respondWithResult(_0x332c00,null))[_0xeded('0x2a')](handleError(_0x332c00,null));};exports['create']=function(_0x3d5a4f,_0x5bdfc7){return db[_0xeded('0x3a')][_0xeded('0x56')](_0x3d5a4f[_0xeded('0x57')],{})[_0xeded('0x34')](respondWithResult(_0x5bdfc7,0xc9))['catch'](handleError(_0x5bdfc7,null));};exports['update']=function(_0x2a4609,_0x1e4802){if(_0x2a4609[_0xeded('0x57')]['id']){delete _0x2a4609[_0xeded('0x57')]['id'];}return db['ZendeskAccount'][_0xeded('0x55')]({'where':{'id':_0x2a4609[_0xeded('0x53')]['id']}})[_0xeded('0x34')](handleEntityNotFound(_0x1e4802,null))['then'](saveUpdates(_0x2a4609[_0xeded('0x57')],null))[_0xeded('0x34')](respondWithResult(_0x1e4802,null))[_0xeded('0x2a')](handleError(_0x1e4802,null));};exports[_0xeded('0x35')]=function(_0x105c4a,_0x4cbdef){return db['ZendeskAccount']['find']({'where':{'id':_0x105c4a['params']['id']}})[_0xeded('0x34')](handleEntityNotFound(_0x4cbdef,null))[_0xeded('0x34')](removeEntity(_0x4cbdef,null))[_0xeded('0x2a')](handleError(_0x4cbdef,null));};exports[_0xeded('0x58')]=function(_0x3955d7,_0x51ac41,_0x3c5024){var _0x146ac6={};var _0x3fb15b={};var _0x3a71c0;var _0x53155d;return db[_0xeded('0x3a')][_0xeded('0x59')]({'where':{'id':_0x3955d7[_0xeded('0x53')]['id']}})[_0xeded('0x34')](handleEntityNotFound(_0x51ac41,null))[_0xeded('0x34')](function(_0x251dc4){if(_0x251dc4){_0x3a71c0=_0x251dc4;_0x3fb15b[_0xeded('0x3e')]=_['keys'](db[_0xeded('0x5a')][_0xeded('0x54')]);_0x3fb15b['query']=_[_0xeded('0x40')](_0x3955d7[_0xeded('0x3f')]);_0x3fb15b[_0xeded('0x41')]=_['intersection'](_0x3fb15b[_0xeded('0x3e')],_0x3fb15b[_0xeded('0x3f')]);_0x146ac6[_0xeded('0x42')]=_[_0xeded('0x43')](_0x3fb15b[_0xeded('0x3e')],qs[_0xeded('0x44')](_0x3955d7[_0xeded('0x3f')][_0xeded('0x44')]));_0x146ac6[_0xeded('0x42')]=_0x146ac6['attributes'][_0xeded('0x45')]?_0x146ac6['attributes']:_0x3fb15b[_0xeded('0x3e')];_0x146ac6['order']=qs[_0xeded('0x48')](_0x3955d7[_0xeded('0x3f')][_0xeded('0x48')]);_0x146ac6[_0xeded('0x49')]=qs['filters'](_[_0xeded('0x4a')](_0x3955d7[_0xeded('0x3f')],_0x3fb15b[_0xeded('0x41')]));if(_0x3955d7[_0xeded('0x3f')]['filter']){_0x146ac6[_0xeded('0x49')]=_[_0xeded('0x4b')](_0x146ac6[_0xeded('0x49')],{'$or':_[_0xeded('0x39')](_0x146ac6[_0xeded('0x42')],function(_0x16a358){var _0x777c99={};_0x777c99[_0x16a358]={'$like':'%'+_0x3955d7['query']['filter']+'%'};return _0x777c99;})});}_0x146ac6=_['merge']({},_0x146ac6,_0x3955d7[_0xeded('0x5b')]);return _0x3a71c0[_0xeded('0x58')](_0x146ac6);}})[_0xeded('0x34')](function(_0x1dae2b){if(_0x1dae2b){_0x53155d=_0x1dae2b[_0xeded('0x45')];if(!_0x3955d7['query'][_0xeded('0x46')](_0xeded('0x5c'))){_0x146ac6['limit']=qs['limit'](_0x3955d7[_0xeded('0x3f')][_0xeded('0x30')]);_0x146ac6[_0xeded('0x2f')]=qs['offset'](_0x3955d7[_0xeded('0x3f')]['offset']);}return _0x3a71c0[_0xeded('0x58')](_0x146ac6);}})[_0xeded('0x34')](function(_0x443c60){if(_0x443c60){return _0x443c60?{'count':_0x53155d,'rows':_0x443c60}:null;}})[_0xeded('0x34')](respondWithResult(_0x51ac41,null))[_0xeded('0x2a')](handleError(_0x51ac41,null));};exports[_0xeded('0x5d')]=function(_0x2cd4ca,_0x4bc794,_0x4d11f9){if(_0x2cd4ca['body']['id']){delete _0x2cd4ca['body']['id'];}return db[_0xeded('0x3a')][_0xeded('0x59')]({'where':{'id':_0x2cd4ca[_0xeded('0x53')]['id']}})[_0xeded('0x34')](handleEntityNotFound(_0x4bc794,null))['then'](function(_0x2fef59){if(_0x2fef59){_0x2cd4ca[_0xeded('0x57')][_0xeded('0x5e')]=_0x2fef59['id'];_0x2cd4ca[_0xeded('0x57')]['Subjects']=integrations[_0xeded('0x5f')](_0x2cd4ca['body'][_0xeded('0x60')],_0x2cd4ca[_0xeded('0x57')][_0xeded('0x3c')]);_0x2cd4ca['body']['Descriptions']=integrations[_0xeded('0x61')](_0x2cd4ca['body'][_0xeded('0x60')],_0x2cd4ca[_0xeded('0x57')]['type']);return db[_0xeded('0x5a')][_0xeded('0x56')](_0x2cd4ca[_0xeded('0x57')],{'include':[{'model':db[_0xeded('0x62')],'as':_0xeded('0x63')},{'model':db[_0xeded('0x62')],'as':_0xeded('0x64')}]});}return null;})[_0xeded('0x34')](respondWithResult(_0x4bc794,null))['catch'](handleError(_0x4bc794,null));};exports[_0xeded('0x65')]=function(_0x8a95d1,_0x358416,_0x4c836e){var _0x4edbbb='';return db['ZendeskAccount']['findOne']({'where':{'id':_0x8a95d1[_0xeded('0x53')]['id']},'attributes':['id',_0xeded('0x66'),_0xeded('0x67'),_0xeded('0x68'),_0xeded('0x69'),_0xeded('0x6a')]})[_0xeded('0x34')](handleEntityNotFound(_0x358416,null))[_0xeded('0x34')](function(_0xd731c0){if(_0xd731c0){_0x4edbbb=_0xd731c0[_0xeded('0x6a')];var _0x4b315c=_0x4edbbb[_0xeded('0x6b')](-0x1);if(_0x4b315c==='/'){_0x4edbbb=_0x4edbbb[_0xeded('0x6c')](0x0,_0x4edbbb[_0xeded('0x6d')](_0x4b315c));}var _0x41c693={'method':'GET','uri':util['format']('%s/%s',_0x4edbbb,_0xeded('0x6e')),'json':!![]};switch(_0xd731c0[_0xeded('0x69')]){case _0xeded('0x67'):_0x41c693[_0xeded('0x6f')]={'Authorization':util[_0xeded('0x70')](_0xeded('0x71'),new Buffer(util['format'](_0xeded('0x72'),_0xd731c0[_0xeded('0x66')],_0xd731c0[_0xeded('0x67')]))[_0xeded('0x73')](_0xeded('0x74')))};break;case _0xeded('0x68'):_0x41c693[_0xeded('0x6f')]={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0xeded('0x70')]('%s/token:%s',_0xd731c0[_0xeded('0x66')],_0xd731c0[_0xeded('0x68')]))[_0xeded('0x73')](_0xeded('0x74')))};break;default:throw new db[(_0xeded('0x1d'))][(_0xeded('0x1e'))](_0xeded('0x75'));}return rp(_0x41c693);}})[_0xeded('0x34')](function(_0x5dfb5d){if(_0x5dfb5d){var _0x1f93c6=[_0xeded('0x76'),'description',_0xeded('0x77'),'assignee'];_[_0xeded('0x78')](_0x5dfb5d[_0xeded('0x6e')],function(_0x5cba32){return _0x1f93c6['includes'](_0x5cba32[_0xeded('0x3c')]);});return{'count':_0x5dfb5d[_0xeded('0x6e')][_0xeded('0x45')],'rows':_['map'](_0x5dfb5d[_0xeded('0x6e')],function(_0x4eb838){return{'id':_0x4eb838['id'],'name':_0x4eb838['position']>0x7?_0x4eb838[_0xeded('0x79')]:_0x4eb838['type'],'custom':_0x4eb838[_0xeded('0x7a')]>0x7?!![]:![],'options':_0x4eb838[_0xeded('0x7b')]?_0x4eb838[_0xeded('0x7b')]:_0x4eb838[_0xeded('0x7c')]?_0x4eb838[_0xeded('0x7c')]:[]};})};}})['then'](respondWithResult(_0x358416,null))[_0xeded('0x2a')](function(_0x4cd940){var _0x4b8bb7=_0x8a95d1['query'][_0xeded('0x1c')]?0x1f4:_0x4cd940['statusCode']||0x1f4;logger['error'](_0xeded('0x7d'),'getFields',_0x4b8bb7,JSON['stringify'](_0x4cd940));delete _0x4cd940[_0xeded('0x36')];if(_0x4b8bb7===0x191){_0x4b8bb7=0x190;}_0x358416[_0xeded('0x2c')](_0x4b8bb7)[_0xeded('0x37')](_0x8a95d1['query'][_0xeded('0x1c')]?{'message':_0xeded('0x7e'),'statusCode':_0x4cd940[_0xeded('0x7f')]}:_0x4cd940);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 861ecb8..e39bfac 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 _0x529e=['../../config/environment','../../components/integrations/configuration','exports','define','int_zendesk_accounts','lodash','util','api','moment','bluebird','path'];(function(_0x598408,_0x5e6f74){var _0x560720=function(_0x56a96d){while(--_0x56a96d){_0x598408['push'](_0x598408['shift']());}};_0x560720(++_0x5e6f74);}(_0x529e,0xf7));var _0xe529=function(_0x48a1d4,_0x3567c3){_0x48a1d4=_0x48a1d4-0x0;var _0xbbf1ee=_0x529e[_0x48a1d4];return _0xbbf1ee;};'use strict';var _=require(_0xe529('0x0'));var util=require(_0xe529('0x1'));var logger=require('../../config/logger')(_0xe529('0x2'));var moment=require(_0xe529('0x3'));var BPromise=require(_0xe529('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe529('0x5'));var rimraf=require('rimraf');var config=require(_0xe529('0x6'));var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0xe529('0x7'));module[_0xe529('0x8')]=function(_0x1967ca,_0x5df57f){return _0x1967ca[_0xe529('0x9')]('ZendeskAccount',attributes,{'tableName':_0xe529('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xae30=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','ZendeskAccount','lodash','util'];(function(_0x12fae1,_0x4a3efb){var _0x24bf66=function(_0x325183){while(--_0x325183){_0x12fae1['push'](_0x12fae1['shift']());}};_0x24bf66(++_0x4a3efb);}(_0xae30,0x111));var _0x0ae3=function(_0x2adfb1,_0x406e6e){_0x2adfb1=_0x2adfb1-0x0;var _0xa52d45=_0xae30[_0x2adfb1];return _0xa52d45;};'use strict';var _=require(_0x0ae3('0x0'));var util=require(_0x0ae3('0x1'));var logger=require(_0x0ae3('0x2'))(_0x0ae3('0x3'));var moment=require(_0x0ae3('0x4'));var BPromise=require(_0x0ae3('0x5'));var rp=require(_0x0ae3('0x6'));var fs=require('fs');var path=require(_0x0ae3('0x7'));var rimraf=require(_0x0ae3('0x8'));var config=require(_0x0ae3('0x9'));var attributes=require('./intZendeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x53bb55,_0x4084de){return _0x53bb55['define'](_0x0ae3('0xa'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index a67c38e..dc63284 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 _0xd8b0=['raw','where','include','map','model','attributes','ShowZendeskAccount','find','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount','options'];(function(_0x30dd79,_0x4b79b9){var _0xcf34a5=function(_0x4315ee){while(--_0x4315ee){_0x30dd79['push'](_0x30dd79['shift']());}};_0xcf34a5(++_0x4b79b9);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});}exports[_0x0d8b('0x16')]=function(_0x5fecbd){var _0x333674=this;return new Promise(function(_0x18dd2d,_0x264b39){return db[_0x0d8b('0x17')]['findAll']({'raw':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')][_0x0d8b('0x19')]===undefined?!![]:![]:!![],'where':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')][_0x0d8b('0x1a')]||null:null,'attributes':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')]['attributes']||null:null,'limit':_0x5fecbd['options']?_0x5fecbd[_0x0d8b('0x18')]['limit']||null:null,'include':_0x5fecbd['options']?_0x5fecbd['options'][_0x0d8b('0x1b')]?_[_0x0d8b('0x1c')](_0x5fecbd[_0x0d8b('0x18')][_0x0d8b('0x1b')],function(_0x221071){return{'model':db[_0x221071[_0x0d8b('0x1d')]],'as':_0x221071['as'],'attributes':_0x221071[_0x0d8b('0x1e')],'include':_0x221071[_0x0d8b('0x1b')]?_[_0x0d8b('0x1c')](_0x221071['include'],function(_0xe8bbee){return{'model':db[_0xe8bbee[_0x0d8b('0x1d')]],'as':_0xe8bbee['as'],'attributes':_0xe8bbee['attributes'],'include':_0xe8bbee[_0x0d8b('0x1b')]?_['map'](_0xe8bbee[_0x0d8b('0x1b')],function(_0x234bdd){return{'model':db[_0x234bdd[_0x0d8b('0x1d')]],'as':_0x234bdd['as'],'attributes':_0x234bdd['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x28f639){logger[_0x0d8b('0xb')]('GetZendeskAccount',_0x5fecbd);logger[_0x0d8b('0xe')]('GetZendeskAccount',_0x5fecbd,JSON[_0x0d8b('0x10')](_0x28f639));_0x18dd2d(_0x28f639);})['catch'](function(_0x97050a){logger['error'](_0x0d8b('0x16'),_0x97050a['message'],_0x5fecbd);_0x264b39(_0x333674[_0x0d8b('0x11')](0x1f4,_0x97050a['message']));});});};exports[_0x0d8b('0x1f')]=function(_0x106e4c){var _0x2c058d=this;return new Promise(function(_0x56120a,_0x4c80a2){return db['ZendeskAccount'][_0x0d8b('0x20')]({'raw':_0x106e4c['options']?_0x106e4c[_0x0d8b('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x106e4c['options']?_0x106e4c[_0x0d8b('0x18')][_0x0d8b('0x1a')]||null:null,'attributes':_0x106e4c[_0x0d8b('0x18')]?_0x106e4c[_0x0d8b('0x18')][_0x0d8b('0x1e')]||null:null,'include':_0x106e4c[_0x0d8b('0x18')]?_0x106e4c[_0x0d8b('0x18')][_0x0d8b('0x1b')]?_['map'](_0x106e4c[_0x0d8b('0x18')][_0x0d8b('0x1b')],function(_0x4b3ea0){return{'model':db[_0x4b3ea0[_0x0d8b('0x1d')]],'as':_0x4b3ea0['as'],'attributes':_0x4b3ea0[_0x0d8b('0x1e')],'include':_0x4b3ea0[_0x0d8b('0x1b')]?_['map'](_0x4b3ea0[_0x0d8b('0x1b')],function(_0x2c507e){return{'model':db[_0x2c507e[_0x0d8b('0x1d')]],'as':_0x2c507e['as'],'attributes':_0x2c507e[_0x0d8b('0x1e')],'include':_0x2c507e[_0x0d8b('0x1b')]?_['map'](_0x2c507e[_0x0d8b('0x1b')],function(_0x1649fc){return{'model':db[_0x1649fc['model']],'as':_0x1649fc['as'],'attributes':_0x1649fc[_0x0d8b('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0d8b('0xa')](function(_0x188af2){logger[_0x0d8b('0xb')](_0x0d8b('0x1f'),_0x106e4c);logger['debug']('ShowZendeskAccount',_0x106e4c,JSON[_0x0d8b('0x10')](_0x188af2));_0x56120a(_0x188af2);})['catch'](function(_0x531c55){logger[_0x0d8b('0x11')](_0x0d8b('0x1f'),_0x531c55[_0x0d8b('0x13')],_0x106e4c);_0x4c80a2(_0x2c058d[_0x0d8b('0x11')](0x1f4,_0x531c55[_0x0d8b('0x13')]));});});}; \ No newline at end of file +var _0x757a=['stringify','error','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','where','attributes','limit','include','map','model','ShowZendeskAccount','find','raw','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s'];(function(_0x7d73b0,_0x2ba62d){var _0x24d834=function(_0x42f1fa){while(--_0x42f1fa){_0x7d73b0['push'](_0x7d73b0['shift']());}};_0x24d834(++_0x2ba62d);}(_0x757a,0xde));var _0xa757=function(_0x5a4206,_0x5225cf){_0x5a4206=_0x5a4206-0x0;var _0x14a269=_0x757a[_0x5a4206];return _0x14a269;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var moment=require(_0xa757('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa757('0x2'))['db'];var utils=require(_0xa757('0x3'));var logger=require(_0xa757('0x4'))(_0xa757('0x5'));var config=require(_0xa757('0x6'));var jayson=require(_0xa757('0x7'));var client=jayson['client'][_0xa757('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4343b6,_0x53be0e,_0x2930fa){return new BPromise(function(_0x2f7793,_0x447344){return client[_0xa757('0x9')](_0x4343b6,_0x2930fa)[_0xa757('0xa')](function(_0x5aef8a){logger[_0xa757('0xb')](_0xa757('0xc'),_0x53be0e,_0xa757('0xd'));logger[_0xa757('0xe')](_0xa757('0xf'),_0x53be0e,_0xa757('0xd'),JSON[_0xa757('0x10')](_0x5aef8a));if(_0x5aef8a['error']){if(_0x5aef8a['error']['code']===0x1f4){logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x53be0e,_0x5aef8a[_0xa757('0x11')]['message']);return _0x447344(_0x5aef8a['error'][_0xa757('0x12')]);}logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x53be0e,_0x5aef8a[_0xa757('0x11')][_0xa757('0x12')]);return _0x2f7793(_0x5aef8a[_0xa757('0x11')][_0xa757('0x12')]);}else{logger[_0xa757('0xb')](_0xa757('0xc'),_0x53be0e,_0xa757('0xd'));_0x2f7793(_0x5aef8a[_0xa757('0x13')][_0xa757('0x12')]);}})[_0xa757('0x14')](function(_0x50aac1){logger[_0xa757('0x11')](_0xa757('0xc'),_0x53be0e,_0x50aac1);_0x447344(_0x50aac1);});});}exports[_0xa757('0x15')]=function(_0x4d9f58){var _0x54b305=this;return new Promise(function(_0x151c04,_0x468d45){return db[_0xa757('0x16')][_0xa757('0x17')]({'raw':_0x4d9f58[_0xa757('0x18')]?_0x4d9f58[_0xa757('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4d9f58[_0xa757('0x18')]?_0x4d9f58['options'][_0xa757('0x19')]||null:null,'attributes':_0x4d9f58[_0xa757('0x18')]?_0x4d9f58[_0xa757('0x18')][_0xa757('0x1a')]||null:null,'limit':_0x4d9f58['options']?_0x4d9f58['options'][_0xa757('0x1b')]||null:null,'include':_0x4d9f58[_0xa757('0x18')]?_0x4d9f58[_0xa757('0x18')][_0xa757('0x1c')]?_[_0xa757('0x1d')](_0x4d9f58[_0xa757('0x18')][_0xa757('0x1c')],function(_0x21f1af){return{'model':db[_0x21f1af[_0xa757('0x1e')]],'as':_0x21f1af['as'],'attributes':_0x21f1af['attributes'],'include':_0x21f1af[_0xa757('0x1c')]?_['map'](_0x21f1af[_0xa757('0x1c')],function(_0x47903b){return{'model':db[_0x47903b[_0xa757('0x1e')]],'as':_0x47903b['as'],'attributes':_0x47903b[_0xa757('0x1a')],'include':_0x47903b[_0xa757('0x1c')]?_['map'](_0x47903b[_0xa757('0x1c')],function(_0xcd98bd){return{'model':db[_0xcd98bd[_0xa757('0x1e')]],'as':_0xcd98bd['as'],'attributes':_0xcd98bd[_0xa757('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x449a7d){logger['info']('GetZendeskAccount',_0x4d9f58);logger['debug']('GetZendeskAccount',_0x4d9f58,JSON[_0xa757('0x10')](_0x449a7d));_0x151c04(_0x449a7d);})['catch'](function(_0x2208f9){logger[_0xa757('0x11')]('GetZendeskAccount',_0x2208f9[_0xa757('0x12')],_0x4d9f58);_0x468d45(_0x54b305['error'](0x1f4,_0x2208f9[_0xa757('0x12')]));});});};exports[_0xa757('0x1f')]=function(_0x5307c3){var _0x235e54=this;return new Promise(function(_0x5ade7b,_0x3a4a66){return db[_0xa757('0x16')][_0xa757('0x20')]({'raw':_0x5307c3[_0xa757('0x18')]?_0x5307c3[_0xa757('0x18')][_0xa757('0x21')]===undefined?!![]:![]:!![],'where':_0x5307c3[_0xa757('0x18')]?_0x5307c3[_0xa757('0x18')][_0xa757('0x19')]||null:null,'attributes':_0x5307c3[_0xa757('0x18')]?_0x5307c3[_0xa757('0x18')][_0xa757('0x1a')]||null:null,'include':_0x5307c3[_0xa757('0x18')]?_0x5307c3[_0xa757('0x18')][_0xa757('0x1c')]?_[_0xa757('0x1d')](_0x5307c3[_0xa757('0x18')][_0xa757('0x1c')],function(_0x1eacde){return{'model':db[_0x1eacde[_0xa757('0x1e')]],'as':_0x1eacde['as'],'attributes':_0x1eacde[_0xa757('0x1a')],'include':_0x1eacde[_0xa757('0x1c')]?_[_0xa757('0x1d')](_0x1eacde[_0xa757('0x1c')],function(_0x59700d){return{'model':db[_0x59700d[_0xa757('0x1e')]],'as':_0x59700d['as'],'attributes':_0x59700d[_0xa757('0x1a')],'include':_0x59700d[_0xa757('0x1c')]?_[_0xa757('0x1d')](_0x59700d[_0xa757('0x1c')],function(_0x51e2aa){return{'model':db[_0x51e2aa[_0xa757('0x1e')]],'as':_0x51e2aa['as'],'attributes':_0x51e2aa[_0xa757('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa757('0xa')](function(_0x2c34b1){logger[_0xa757('0xb')](_0xa757('0x1f'),_0x5307c3);logger['debug'](_0xa757('0x1f'),_0x5307c3,JSON[_0xa757('0x10')](_0x2c34b1));_0x5ade7b(_0x2c34b1);})[_0xa757('0x14')](function(_0xc34409){logger[_0xa757('0x11')](_0xa757('0x1f'),_0xc34409[_0xa757('0x12')],_0x5307c3);_0x3a4a66(_0x235e54[_0xa757('0x11')](0x1f4,_0xc34409[_0xa757('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index ad87421..74c8cf0 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 _0xeaa1=['destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','/:id','delete'];(function(_0xbc4560,_0x4020b8){var _0x298cfb=function(_0x254423){while(--_0x254423){_0xbc4560['push'](_0xbc4560['shift']());}};_0x298cfb(++_0x4020b8);}(_0xeaa1,0xbf));var _0x1eaa=function(_0x27d8b1,_0x38cf97){_0x27d8b1=_0x27d8b1-0x0;var _0x54c3e9=_0xeaa1[_0x27d8b1];return _0x54c3e9;};'use strict';var multer=require(_0x1eaa('0x0'));var util=require(_0x1eaa('0x1'));var path=require(_0x1eaa('0x2'));var timeout=require(_0x1eaa('0x3'));var express=require('express');var router=express[_0x1eaa('0x4')]();var auth=require(_0x1eaa('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1eaa('0x6'));var controller=require(_0x1eaa('0x7'));router[_0x1eaa('0x8')]('/',auth[_0x1eaa('0x9')](),controller[_0x1eaa('0xa')]);router[_0x1eaa('0x8')]('/:id',auth[_0x1eaa('0x9')](),controller[_0x1eaa('0xb')]);router[_0x1eaa('0x8')](_0x1eaa('0xc'),auth['isAuthenticated'](),controller[_0x1eaa('0xd')]);router[_0x1eaa('0x8')](_0x1eaa('0xe'),auth['isAuthenticated'](),controller[_0x1eaa('0xf')]);router[_0x1eaa('0x8')]('/:id/descriptions',auth[_0x1eaa('0x9')](),controller[_0x1eaa('0x10')]);router['get'](_0x1eaa('0x11'),auth[_0x1eaa('0x9')](),controller[_0x1eaa('0x12')]);router[_0x1eaa('0x13')]('/',auth[_0x1eaa('0x9')](),controller[_0x1eaa('0x14')]);router[_0x1eaa('0x13')]('/:id/tags',auth[_0x1eaa('0x9')](),controller[_0x1eaa('0x15')]);router[_0x1eaa('0x16')](_0x1eaa('0x17'),auth[_0x1eaa('0x9')](),controller['update']);router[_0x1eaa('0x18')](_0x1eaa('0x17'),auth[_0x1eaa('0x9')](),controller[_0x1eaa('0x19')]);module[_0x1eaa('0x1a')]=router; \ No newline at end of file +var _0x6830=['setTags','put','update','destroy','multer','util','path','../../components/auth/service','../../config/environment','./intZendeskConfiguration.controller','index','/:id','show','get','isAuthenticated','getFields','/:id/subjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create'];(function(_0x14cafc,_0x112188){var _0xc6da85=function(_0x4ae4fe){while(--_0x4ae4fe){_0x14cafc['push'](_0x14cafc['shift']());}};_0xc6da85(++_0x112188);}(_0x6830,0x101));var _0x0683=function(_0xe7b833,_0x30f279){_0xe7b833=_0xe7b833-0x0;var _0xafb963=_0x6830[_0xe7b833];return _0xafb963;};'use strict';var multer=require(_0x0683('0x0'));var util=require(_0x0683('0x1'));var path=require(_0x0683('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x0683('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x0683('0x4'));var controller=require(_0x0683('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x0683('0x6')]);router['get'](_0x0683('0x7'),auth['isAuthenticated'](),controller[_0x0683('0x8')]);router[_0x0683('0x9')]('/:id/fields',auth[_0x0683('0xa')](),controller[_0x0683('0xb')]);router[_0x0683('0x9')](_0x0683('0xc'),auth[_0x0683('0xa')](),controller['getSubjects']);router[_0x0683('0x9')](_0x0683('0xd'),auth[_0x0683('0xa')](),controller[_0x0683('0xe')]);router[_0x0683('0x9')](_0x0683('0xf'),auth[_0x0683('0xa')](),controller[_0x0683('0x10')]);router[_0x0683('0x11')]('/',auth[_0x0683('0xa')](),controller[_0x0683('0x12')]);router[_0x0683('0x11')](_0x0683('0xf'),auth[_0x0683('0xa')](),controller[_0x0683('0x13')]);router[_0x0683('0x14')](_0x0683('0x7'),auth[_0x0683('0xa')](),controller[_0x0683('0x15')]);router['delete'](_0x0683('0x7'),auth[_0x0683('0xa')](),controller[_0x0683('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 5c7cf75..9d5f6b6 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 _0x3152=['exports','STRING'];(function(_0x200045,_0x4e5da1){var _0x566a8d=function(_0x46b5a1){while(--_0x46b5a1){_0x200045['push'](_0x200045['shift']());}};_0x566a8d(++_0x4e5da1);}(_0x3152,0xba));var _0x2315=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x3152[_0x17b6e3];return _0x3906f3;};'use strict';var Sequelize=require('sequelize');module[_0x2315('0x0')]={'name':{'type':Sequelize[_0x2315('0x1')]},'description':{'type':Sequelize[_0x2315('0x1')]}}; \ No newline at end of file +var _0x6c7f=['exports','STRING'];(function(_0x1fa759,_0x4ecdce){var _0x2da9f4=function(_0x463e2a){while(--_0x463e2a){_0x1fa759['push'](_0x1fa759['shift']());}};_0x2da9f4(++_0x4ecdce);}(_0x6c7f,0x1b6));var _0xf6c7=function(_0x21c0b5,_0x3e475f){_0x21c0b5=_0x21c0b5-0x0;var _0x27f4e8=_0x6c7f[_0x21c0b5];return _0x27f4e8;};'use strict';var Sequelize=require('sequelize');module[_0xf6c7('0x0')]={'name':{'type':Sequelize[_0xf6c7('0x1')]},'description':{'type':Sequelize[_0xf6c7('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 5f7392b..ed174cd 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 _0x814b=['filters','pick','merge','type','VIRTUAL','filter','options','ZendeskConfiguration','count','includeAll','include','findAll','rows','show','params','keys','find','body','getFields','findOne','ZendeskField','getSubjects','getDescriptions','getTags','setTags','ids','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','error','ZendeskConfiguration,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','offset','Content-Range','reject','save','update','destroy','stack','name','send','index','map','rawAttributes','fieldName','key','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where'];(function(_0xa2b732,_0x57136f){var _0x40bc9b=function(_0x3bfcad){while(--_0x3bfcad){_0xa2b732['push'](_0xa2b732['shift']());}};_0x40bc9b(++_0x57136f);}(_0x814b,0x1a2));var _0xb814=function(_0xde9059,_0x750aab){_0xde9059=_0xde9059-0x0;var _0x23197d=_0x814b[_0xde9059];return _0x23197d;};'use strict';var pdf=require(_0xb814('0x0'));var emlformat=require(_0xb814('0x1'));var rimraf=require(_0xb814('0x2'));var zipdir=require(_0xb814('0x3'));var jsonpatch=require(_0xb814('0x4'));var rp=require(_0xb814('0x5'));var moment=require('moment');var BPromise=require(_0xb814('0x6'));var Mustache=require(_0xb814('0x7'));var util=require(_0xb814('0x8'));var path=require(_0xb814('0x9'));var sox=require(_0xb814('0xa'));var csv=require(_0xb814('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xb'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var db=require(_0xb814('0x19'))['db'];var jayson=require(_0xb814('0x1a'));var client=jayson[_0xb814('0x1b')][_0xb814('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x2ce718,_0x3bde14,_0x1438e7){if(_0x1438e7){var _0x41ed7b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x41ed7b[_0xb814('0x1d')](_0x3bde14)){return _0x2ce718;}else{throw new db[(_0xb814('0x1e'))][(_0xb814('0x1f'))](_0xb814('0x20'));}}else{return _0x2ce718;}}function respondWithRpcPromise(_0x17f5bd,_0x39bfcf,_0x303aca,_0x3a71d6){return new BPromise(function(_0x45e0d0,_0x265a83){var _0x125ce2=_0x3a71d6||client;return _0x125ce2[_0xb814('0x21')](_0x17f5bd,_0x303aca)[_0xb814('0x22')](function(_0x48c9df){logger[_0xb814('0x23')]('ZendeskConfiguration,\x20%s,\x20%s',_0x39bfcf,_0xb814('0x24'));logger[_0xb814('0x25')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x39bfcf,'request\x20sent',JSON['stringify'](_0x48c9df));if(_0x48c9df[_0xb814('0x26')]){if(_0x48c9df['error']['code']===0x1f4){logger[_0xb814('0x26')](_0xb814('0x27'),_0x39bfcf,_0x48c9df[_0xb814('0x26')]['message']);return _0x265a83(_0x48c9df[_0xb814('0x26')]['message']);}logger[_0xb814('0x26')](_0xb814('0x27'),_0x39bfcf,_0x48c9df[_0xb814('0x26')][_0xb814('0x28')]);return _0x45e0d0(_0x48c9df[_0xb814('0x26')][_0xb814('0x28')]);}else{logger[_0xb814('0x23')]('ZendeskConfiguration,\x20%s,\x20%s',_0x39bfcf,_0xb814('0x24'));_0x45e0d0(_0x48c9df['result'][_0xb814('0x28')]);}})[_0xb814('0x29')](function(_0x31c7ec){logger[_0xb814('0x26')](_0xb814('0x27'),_0x39bfcf,_0x31c7ec);_0x265a83(_0x31c7ec);});});}function respondWithStatusCode(_0xb9e57d,_0x3d836c){_0x3d836c=_0x3d836c||0xcc;return function(_0x5755ea){if(_0x5755ea){return _0xb9e57d[_0xb814('0x2a')](_0x3d836c);}return _0xb9e57d[_0xb814('0x2b')](_0x3d836c)[_0xb814('0x2c')]();};}function respondWithResult(_0x349394,_0x32ed56){_0x32ed56=_0x32ed56||0xc8;return function(_0x1d5965){if(_0x1d5965){return _0x349394[_0xb814('0x2b')](_0x32ed56)[_0xb814('0x2d')](_0x1d5965);}};}function respondWithFilteredResult(_0x5a6291,_0x271aa8){return function(_0x328a08){if(_0x328a08){var _0x52ed64=_0x328a08['count'],_0x9008b2=_0x271aa8[_0xb814('0x2e')],_0x37d24d=_0x271aa8[_0xb814('0x2e')]+_0x271aa8['limit'],_0x530744;if(_0x37d24d>=_0x52ed64){_0x37d24d=_0x52ed64;_0x530744=0xc8;}else{_0x530744=0xce;}_0x5a6291[_0xb814('0x2b')](_0x530744);return _0x5a6291['set'](_0xb814('0x2f'),_0x9008b2+'-'+_0x37d24d+'/'+_0x52ed64)['json'](_0x328a08);}return null;};}function patchUpdates(_0x4cfc58){return function(_0x419cd9){try{jsonpatch['apply'](_0x419cd9,_0x4cfc58,!![]);}catch(_0x2431e2){return BPromise[_0xb814('0x30')](_0x2431e2);}return _0x419cd9[_0xb814('0x31')]();};}function saveUpdates(_0x599f9f,_0x51d5ae){return function(_0x26d3a9){if(_0x26d3a9){return _0x26d3a9[_0xb814('0x32')](_0x599f9f)['then'](function(_0x2c8943){return _0x2c8943;});}return null;};}function removeEntity(_0xe558d5,_0x692c72){return function(_0x217b7e){if(_0x217b7e){return _0x217b7e[_0xb814('0x33')]()[_0xb814('0x22')](function(){_0xe558d5[_0xb814('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3207ec,_0x2263f6){return function(_0x30de5a){if(!_0x30de5a){_0x3207ec[_0xb814('0x2a')](0x194);}return _0x30de5a;};}function handleError(_0x14100d,_0x4ff31a){_0x4ff31a=_0x4ff31a||0x1f4;return function(_0x16ef82){logger['error'](_0x16ef82[_0xb814('0x34')]);if(_0x16ef82[_0xb814('0x35')]){delete _0x16ef82[_0xb814('0x35')];}_0x14100d['status'](_0x4ff31a)[_0xb814('0x36')](_0x16ef82);};}exports[_0xb814('0x37')]=function(_0x4ea6f8,_0x2fcd92){var _0x2d0e27={},_0x1a8bd0={},_0x1f7cd8={'count':0x0,'rows':[]};var _0xd77d96=_[_0xb814('0x38')](db['ZendeskConfiguration'][_0xb814('0x39')],function(_0x4e4684){return{'name':_0x4e4684[_0xb814('0x3a')],'type':_0x4e4684['type'][_0xb814('0x3b')]};});_0x1a8bd0['model']=_[_0xb814('0x38')](_0xd77d96,_0xb814('0x35'));_0x1a8bd0['query']=_['keys'](_0x4ea6f8['query']);_0x1a8bd0['filters']=_[_0xb814('0x3c')](_0x1a8bd0[_0xb814('0x3d')],_0x1a8bd0[_0xb814('0x3e')]);_0x2d0e27[_0xb814('0x3f')]=_['intersection'](_0x1a8bd0['model'],qs[_0xb814('0x40')](_0x4ea6f8['query'][_0xb814('0x40')]));_0x2d0e27[_0xb814('0x3f')]=_0x2d0e27[_0xb814('0x3f')][_0xb814('0x41')]?_0x2d0e27[_0xb814('0x3f')]:_0x1a8bd0[_0xb814('0x3d')];if(!_0x4ea6f8[_0xb814('0x3e')][_0xb814('0x42')](_0xb814('0x43'))){_0x2d0e27['limit']=qs['limit'](_0x4ea6f8['query'][_0xb814('0x44')]);_0x2d0e27['offset']=qs[_0xb814('0x2e')](_0x4ea6f8['query'][_0xb814('0x2e')]);}_0x2d0e27[_0xb814('0x45')]=qs[_0xb814('0x46')](_0x4ea6f8[_0xb814('0x3e')]['sort']);_0x2d0e27[_0xb814('0x47')]=qs[_0xb814('0x48')](_[_0xb814('0x49')](_0x4ea6f8[_0xb814('0x3e')],_0x1a8bd0[_0xb814('0x48')]));if(_0x4ea6f8[_0xb814('0x3e')]['filter']){_0x2d0e27[_0xb814('0x47')]=_[_0xb814('0x4a')](_0x2d0e27[_0xb814('0x47')],{'$or':_[_0xb814('0x38')](_0xd77d96,function(_0x46408b){if(_0x46408b[_0xb814('0x4b')]!==_0xb814('0x4c')){var _0x519545={};_0x519545[_0x46408b['name']]={'$like':'%'+_0x4ea6f8[_0xb814('0x3e')][_0xb814('0x4d')]+'%'};return _0x519545;}})});}_0x2d0e27=_[_0xb814('0x4a')]({},_0x2d0e27,_0x4ea6f8[_0xb814('0x4e')]);var _0x43f1b={'where':_0x2d0e27[_0xb814('0x47')]};return db[_0xb814('0x4f')][_0xb814('0x50')](_0x43f1b)[_0xb814('0x22')](function(_0x344198){_0x1f7cd8[_0xb814('0x50')]=_0x344198;if(_0x4ea6f8['query'][_0xb814('0x51')]){_0x2d0e27[_0xb814('0x52')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0xb814('0x53')](_0x2d0e27);})['then'](function(_0x2fb0f7){_0x1f7cd8[_0xb814('0x54')]=_0x2fb0f7;return _0x1f7cd8;})[_0xb814('0x22')](respondWithFilteredResult(_0x2fcd92,_0x2d0e27))[_0xb814('0x29')](handleError(_0x2fcd92,null));};exports[_0xb814('0x55')]=function(_0x4096d4,_0x2cc806){var _0x45480e={'raw':![],'where':{'id':_0x4096d4[_0xb814('0x56')]['id']}},_0x32a397={};_0x32a397['model']=_['keys'](db[_0xb814('0x4f')][_0xb814('0x39')]);_0x32a397[_0xb814('0x3e')]=_[_0xb814('0x57')](_0x4096d4[_0xb814('0x3e')]);_0x32a397[_0xb814('0x48')]=_[_0xb814('0x3c')](_0x32a397['model'],_0x32a397[_0xb814('0x3e')]);_0x45480e[_0xb814('0x3f')]=_[_0xb814('0x3c')](_0x32a397['model'],qs[_0xb814('0x40')](_0x4096d4['query'][_0xb814('0x40')]));_0x45480e['attributes']=_0x45480e[_0xb814('0x3f')][_0xb814('0x41')]?_0x45480e['attributes']:_0x32a397[_0xb814('0x3d')];if(_0x4096d4[_0xb814('0x3e')][_0xb814('0x51')]){_0x45480e['include']=[{'all':!![]}];}_0x45480e=_[_0xb814('0x4a')]({},_0x45480e,_0x4096d4['options']);return db[_0xb814('0x4f')][_0xb814('0x58')](_0x45480e)['then'](handleEntityNotFound(_0x2cc806,null))[_0xb814('0x22')](respondWithResult(_0x2cc806,null))['catch'](handleError(_0x2cc806,null));};exports['create']=function(_0x3b9709,_0x35f59a){return db[_0xb814('0x4f')]['create'](_0x3b9709[_0xb814('0x59')],{})['then'](respondWithResult(_0x35f59a,0xc9))[_0xb814('0x29')](handleError(_0x35f59a,null));};exports[_0xb814('0x32')]=function(_0x58d6e5,_0x2db5a6){if(_0x58d6e5['body']['id']){delete _0x58d6e5[_0xb814('0x59')]['id'];}return db[_0xb814('0x4f')][_0xb814('0x58')]({'where':{'id':_0x58d6e5[_0xb814('0x56')]['id']}})[_0xb814('0x22')](handleEntityNotFound(_0x2db5a6,null))[_0xb814('0x22')](saveUpdates(_0x58d6e5[_0xb814('0x59')],null))[_0xb814('0x22')](respondWithResult(_0x2db5a6,null))['catch'](handleError(_0x2db5a6,null));};exports[_0xb814('0x33')]=function(_0x5441c5,_0x5d71d5){return db[_0xb814('0x4f')][_0xb814('0x58')]({'where':{'id':_0x5441c5['params']['id']}})[_0xb814('0x22')](handleEntityNotFound(_0x5d71d5,null))['then'](removeEntity(_0x5d71d5,null))['catch'](handleError(_0x5d71d5,null));};exports[_0xb814('0x5a')]=function(_0x5257be,_0x3ff213,_0xd1cd8b){var _0x2dec52={};var _0x586957={};var _0x1a0ef4;var _0x4df65c;return db[_0xb814('0x4f')][_0xb814('0x5b')]({'where':{'id':_0x5257be[_0xb814('0x56')]['id']}})[_0xb814('0x22')](handleEntityNotFound(_0x3ff213,null))[_0xb814('0x22')](function(_0x3b374b){if(_0x3b374b){_0x1a0ef4=_0x3b374b;_0x586957[_0xb814('0x3d')]=_[_0xb814('0x57')](db[_0xb814('0x5c')]['rawAttributes']);_0x586957[_0xb814('0x3e')]=_[_0xb814('0x57')](_0x5257be[_0xb814('0x3e')]);_0x586957[_0xb814('0x48')]=_[_0xb814('0x3c')](_0x586957[_0xb814('0x3d')],_0x586957['query']);_0x2dec52[_0xb814('0x3f')]=_['intersection'](_0x586957[_0xb814('0x3d')],qs[_0xb814('0x40')](_0x5257be[_0xb814('0x3e')]['fields']));_0x2dec52[_0xb814('0x3f')]=_0x2dec52['attributes'][_0xb814('0x41')]?_0x2dec52['attributes']:_0x586957[_0xb814('0x3d')];_0x2dec52[_0xb814('0x45')]=qs[_0xb814('0x46')](_0x5257be[_0xb814('0x3e')][_0xb814('0x46')]);_0x2dec52[_0xb814('0x47')]=qs[_0xb814('0x48')](_['pick'](_0x5257be[_0xb814('0x3e')],_0x586957['filters']));if(_0x5257be[_0xb814('0x3e')][_0xb814('0x4d')]){_0x2dec52[_0xb814('0x47')]=_[_0xb814('0x4a')](_0x2dec52[_0xb814('0x47')],{'$or':_[_0xb814('0x38')](_0x2dec52['attributes'],function(_0x12882a){var _0x1a2603={};_0x1a2603[_0x12882a]={'$like':'%'+_0x5257be['query'][_0xb814('0x4d')]+'%'};return _0x1a2603;})});}_0x2dec52=_[_0xb814('0x4a')]({},_0x2dec52,_0x5257be[_0xb814('0x4e')]);return _0x1a0ef4[_0xb814('0x5a')](_0x2dec52);}})[_0xb814('0x22')](function(_0x51d834){if(_0x51d834){_0x4df65c=_0x51d834[_0xb814('0x41')];if(!_0x5257be['query'][_0xb814('0x42')](_0xb814('0x43'))){_0x2dec52[_0xb814('0x44')]=qs[_0xb814('0x44')](_0x5257be[_0xb814('0x3e')][_0xb814('0x44')]);_0x2dec52['offset']=qs['offset'](_0x5257be['query'][_0xb814('0x2e')]);}return _0x1a0ef4['getFields'](_0x2dec52);}})[_0xb814('0x22')](function(_0x1d3954){if(_0x1d3954){return _0x1d3954?{'count':_0x4df65c,'rows':_0x1d3954}:null;}})[_0xb814('0x22')](respondWithResult(_0x3ff213,null))['catch'](handleError(_0x3ff213,null));};exports[_0xb814('0x5d')]=function(_0x3e5ce8,_0xee204,_0x5aabbe){var _0x30f717={};var _0x1bf0b7={};var _0x1f39c0;var _0x3564e0;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x3e5ce8[_0xb814('0x56')]['id']}})[_0xb814('0x22')](handleEntityNotFound(_0xee204,null))[_0xb814('0x22')](function(_0x408870){if(_0x408870){_0x1f39c0=_0x408870;_0x1bf0b7[_0xb814('0x3d')]=_[_0xb814('0x57')](db[_0xb814('0x5c')][_0xb814('0x39')]);_0x1bf0b7[_0xb814('0x3e')]=_[_0xb814('0x57')](_0x3e5ce8[_0xb814('0x3e')]);_0x1bf0b7[_0xb814('0x48')]=_[_0xb814('0x3c')](_0x1bf0b7[_0xb814('0x3d')],_0x1bf0b7[_0xb814('0x3e')]);_0x30f717['attributes']=_[_0xb814('0x3c')](_0x1bf0b7[_0xb814('0x3d')],qs[_0xb814('0x40')](_0x3e5ce8[_0xb814('0x3e')][_0xb814('0x40')]));_0x30f717[_0xb814('0x3f')]=_0x30f717['attributes'][_0xb814('0x41')]?_0x30f717['attributes']:_0x1bf0b7[_0xb814('0x3d')];_0x30f717[_0xb814('0x45')]=qs[_0xb814('0x46')](_0x3e5ce8[_0xb814('0x3e')][_0xb814('0x46')]);_0x30f717['where']=qs['filters'](_[_0xb814('0x49')](_0x3e5ce8[_0xb814('0x3e')],_0x1bf0b7[_0xb814('0x48')]));if(_0x3e5ce8[_0xb814('0x3e')]['filter']){_0x30f717[_0xb814('0x47')]=_['merge'](_0x30f717[_0xb814('0x47')],{'$or':_[_0xb814('0x38')](_0x30f717['attributes'],function(_0x58b016){var _0x2fa6b7={};_0x2fa6b7[_0x58b016]={'$like':'%'+_0x3e5ce8['query'][_0xb814('0x4d')]+'%'};return _0x2fa6b7;})});}_0x30f717=_[_0xb814('0x4a')]({},_0x30f717,_0x3e5ce8[_0xb814('0x4e')]);return _0x1f39c0[_0xb814('0x5d')](_0x30f717);}})[_0xb814('0x22')](function(_0x420bde){if(_0x420bde){_0x3564e0=_0x420bde[_0xb814('0x41')];if(!_0x3e5ce8['query'][_0xb814('0x42')]('nolimit')){_0x30f717[_0xb814('0x44')]=qs['limit'](_0x3e5ce8[_0xb814('0x3e')][_0xb814('0x44')]);_0x30f717['offset']=qs[_0xb814('0x2e')](_0x3e5ce8['query'][_0xb814('0x2e')]);}return _0x1f39c0[_0xb814('0x5d')](_0x30f717);}})['then'](function(_0x5a0c4a){if(_0x5a0c4a){return _0x5a0c4a?{'count':_0x3564e0,'rows':_0x5a0c4a}:null;}})[_0xb814('0x22')](respondWithResult(_0xee204,null))[_0xb814('0x29')](handleError(_0xee204,null));};exports[_0xb814('0x5e')]=function(_0x6f5e6a,_0x220f8b,_0x4394da){var _0x2b12a9={};var _0x314600={};var _0x8cb107;var _0x34f49c;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x6f5e6a['params']['id']}})['then'](handleEntityNotFound(_0x220f8b,null))['then'](function(_0x45a202){if(_0x45a202){_0x8cb107=_0x45a202;_0x314600[_0xb814('0x3d')]=_[_0xb814('0x57')](db['ZendeskField'][_0xb814('0x39')]);_0x314600[_0xb814('0x3e')]=_[_0xb814('0x57')](_0x6f5e6a[_0xb814('0x3e')]);_0x314600[_0xb814('0x48')]=_[_0xb814('0x3c')](_0x314600[_0xb814('0x3d')],_0x314600[_0xb814('0x3e')]);_0x2b12a9['attributes']=_[_0xb814('0x3c')](_0x314600[_0xb814('0x3d')],qs[_0xb814('0x40')](_0x6f5e6a[_0xb814('0x3e')]['fields']));_0x2b12a9[_0xb814('0x3f')]=_0x2b12a9[_0xb814('0x3f')][_0xb814('0x41')]?_0x2b12a9[_0xb814('0x3f')]:_0x314600[_0xb814('0x3d')];_0x2b12a9['order']=qs['sort'](_0x6f5e6a[_0xb814('0x3e')]['sort']);_0x2b12a9[_0xb814('0x47')]=qs[_0xb814('0x48')](_['pick'](_0x6f5e6a[_0xb814('0x3e')],_0x314600['filters']));if(_0x6f5e6a[_0xb814('0x3e')]['filter']){_0x2b12a9[_0xb814('0x47')]=_[_0xb814('0x4a')](_0x2b12a9[_0xb814('0x47')],{'$or':_[_0xb814('0x38')](_0x2b12a9[_0xb814('0x3f')],function(_0x1ae812){var _0x455b22={};_0x455b22[_0x1ae812]={'$like':'%'+_0x6f5e6a['query']['filter']+'%'};return _0x455b22;})});}_0x2b12a9=_[_0xb814('0x4a')]({},_0x2b12a9,_0x6f5e6a['options']);return _0x8cb107['getDescriptions'](_0x2b12a9);}})[_0xb814('0x22')](function(_0x8fbda1){if(_0x8fbda1){_0x34f49c=_0x8fbda1[_0xb814('0x41')];if(!_0x6f5e6a['query'][_0xb814('0x42')]('nolimit')){_0x2b12a9[_0xb814('0x44')]=qs[_0xb814('0x44')](_0x6f5e6a[_0xb814('0x3e')][_0xb814('0x44')]);_0x2b12a9['offset']=qs[_0xb814('0x2e')](_0x6f5e6a[_0xb814('0x3e')][_0xb814('0x2e')]);}return _0x8cb107['getDescriptions'](_0x2b12a9);}})[_0xb814('0x22')](function(_0x3fc77d){if(_0x3fc77d){return _0x3fc77d?{'count':_0x34f49c,'rows':_0x3fc77d}:null;}})[_0xb814('0x22')](respondWithResult(_0x220f8b,null))['catch'](handleError(_0x220f8b,null));};exports[_0xb814('0x5f')]=function(_0x2d0651,_0x9dc06b,_0x216d67){var _0x40b3c5={};var _0x1ae8e8={};var _0x37a7ab;var _0x472c38;return db[_0xb814('0x4f')][_0xb814('0x5b')]({'where':{'id':_0x2d0651[_0xb814('0x56')]['id']}})[_0xb814('0x22')](handleEntityNotFound(_0x9dc06b,null))[_0xb814('0x22')](function(_0x5b8d2e){if(_0x5b8d2e){_0x37a7ab=_0x5b8d2e;_0x1ae8e8['model']=_[_0xb814('0x57')](db['Tag'][_0xb814('0x39')]);_0x1ae8e8[_0xb814('0x3e')]=_[_0xb814('0x57')](_0x2d0651[_0xb814('0x3e')]);_0x1ae8e8[_0xb814('0x48')]=_[_0xb814('0x3c')](_0x1ae8e8[_0xb814('0x3d')],_0x1ae8e8['query']);_0x40b3c5['attributes']=_[_0xb814('0x3c')](_0x1ae8e8['model'],qs[_0xb814('0x40')](_0x2d0651[_0xb814('0x3e')][_0xb814('0x40')]));_0x40b3c5['attributes']=_0x40b3c5[_0xb814('0x3f')][_0xb814('0x41')]?_0x40b3c5[_0xb814('0x3f')]:_0x1ae8e8[_0xb814('0x3d')];_0x40b3c5[_0xb814('0x45')]=qs['sort'](_0x2d0651[_0xb814('0x3e')][_0xb814('0x46')]);_0x40b3c5['where']=qs[_0xb814('0x48')](_[_0xb814('0x49')](_0x2d0651[_0xb814('0x3e')],_0x1ae8e8['filters']));if(_0x2d0651[_0xb814('0x3e')][_0xb814('0x4d')]){_0x40b3c5['where']=_[_0xb814('0x4a')](_0x40b3c5[_0xb814('0x47')],{'$or':_['map'](_0x40b3c5[_0xb814('0x3f')],function(_0x269832){var _0x3f4cbf={};_0x3f4cbf[_0x269832]={'$like':'%'+_0x2d0651[_0xb814('0x3e')][_0xb814('0x4d')]+'%'};return _0x3f4cbf;})});}_0x40b3c5=_[_0xb814('0x4a')]({},_0x40b3c5,_0x2d0651[_0xb814('0x4e')]);return _0x37a7ab[_0xb814('0x5f')](_0x40b3c5);}})[_0xb814('0x22')](function(_0x1f8c7a){if(_0x1f8c7a){_0x472c38=_0x1f8c7a[_0xb814('0x41')];if(!_0x2d0651[_0xb814('0x3e')]['hasOwnProperty']('nolimit')){_0x40b3c5[_0xb814('0x44')]=qs['limit'](_0x2d0651['query'][_0xb814('0x44')]);_0x40b3c5['offset']=qs['offset'](_0x2d0651['query'][_0xb814('0x2e')]);}return _0x37a7ab[_0xb814('0x5f')](_0x40b3c5);}})[_0xb814('0x22')](function(_0x5eb4b1){if(_0x5eb4b1){return _0x5eb4b1?{'count':_0x472c38,'rows':_0x5eb4b1}:null;}})[_0xb814('0x22')](respondWithResult(_0x9dc06b,null))['catch'](handleError(_0x9dc06b,null));};exports[_0xb814('0x60')]=function(_0x2e6660,_0x49a8de,_0x3c6a59){if(_0x2e6660['body']['id']){delete _0x2e6660[_0xb814('0x59')]['id'];}return db[_0xb814('0x4f')][_0xb814('0x5b')]({'where':{'id':_0x2e6660[_0xb814('0x56')]['id']}})[_0xb814('0x22')](handleEntityNotFound(_0x49a8de,null))[_0xb814('0x22')](function(_0x1f2ef8){if(_0x1f2ef8){return _0x1f2ef8[_0xb814('0x60')](_0x2e6660[_0xb814('0x59')][_0xb814('0x61')]||[]);}return null;})[_0xb814('0x22')](respondWithResult(_0x49a8de,null))[_0xb814('0x29')](handleError(_0x49a8de,null));}; \ No newline at end of file +var _0x9957=['count','offset','set','Content-Range','apply','save','update','name','send','index','ZendeskConfiguration','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','pick','filter','where','merge','type','options','includeAll','findAll','rows','show','params','find','create','body','getFields','findOne','ZendeskField','sort','nolimit','getSubjects','getDescriptions','getTags','setTags','ids','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','sendStatus','status','end','json'];(function(_0x52dbd1,_0xe46f69){var _0x58c76a=function(_0x35bff0){while(--_0x35bff0){_0x52dbd1['push'](_0x52dbd1['shift']());}};_0x58c76a(++_0xe46f69);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');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 db=require(_0x7995('0x19'))['db'];var jayson=require(_0x7995('0x1a'));var client=jayson[_0x7995('0x1b')][_0x7995('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x281576,_0x23999f,_0x2bbe7a){if(_0x2bbe7a){var _0x4cc004=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4cc004['test'](_0x23999f)){return _0x281576;}else{throw new db[(_0x7995('0x1d'))][(_0x7995('0x1e'))](_0x7995('0x1f'));}}else{return _0x281576;}}function respondWithRpcPromise(_0x321ae8,_0x3f1d3e,_0x1a5310,_0x2202ce){return new BPromise(function(_0x41cbf0,_0x5377e5){var _0x2eeacc=_0x2202ce||client;return _0x2eeacc['request'](_0x321ae8,_0x1a5310)[_0x7995('0x20')](function(_0x37f297){logger[_0x7995('0x21')](_0x7995('0x22'),_0x3f1d3e,_0x7995('0x23'));logger[_0x7995('0x24')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x3f1d3e,'request\x20sent',JSON[_0x7995('0x25')](_0x37f297));if(_0x37f297['error']){if(_0x37f297['error'][_0x7995('0x26')]===0x1f4){logger[_0x7995('0x27')]('ZendeskConfiguration,\x20%s,\x20%s',_0x3f1d3e,_0x37f297[_0x7995('0x27')]['message']);return _0x5377e5(_0x37f297['error'][_0x7995('0x28')]);}logger[_0x7995('0x27')](_0x7995('0x22'),_0x3f1d3e,_0x37f297[_0x7995('0x27')][_0x7995('0x28')]);return _0x41cbf0(_0x37f297[_0x7995('0x27')]['message']);}else{logger[_0x7995('0x21')](_0x7995('0x22'),_0x3f1d3e,_0x7995('0x23'));_0x41cbf0(_0x37f297[_0x7995('0x29')][_0x7995('0x28')]);}})[_0x7995('0x2a')](function(_0x475351){logger[_0x7995('0x27')]('ZendeskConfiguration,\x20%s,\x20%s',_0x3f1d3e,_0x475351);_0x5377e5(_0x475351);});});}function respondWithStatusCode(_0x39df42,_0x34e70c){_0x34e70c=_0x34e70c||0xcc;return function(_0x401dc3){if(_0x401dc3){return _0x39df42[_0x7995('0x2b')](_0x34e70c);}return _0x39df42[_0x7995('0x2c')](_0x34e70c)[_0x7995('0x2d')]();};}function respondWithResult(_0x56691a,_0x47625f){_0x47625f=_0x47625f||0xc8;return function(_0x5911c3){if(_0x5911c3){return _0x56691a[_0x7995('0x2c')](_0x47625f)[_0x7995('0x2e')](_0x5911c3);}};}function respondWithFilteredResult(_0xf16cc2,_0x132a42){return function(_0x11c1eb){if(_0x11c1eb){var _0x4b6f99=_0x11c1eb[_0x7995('0x2f')],_0x9b2a15=_0x132a42[_0x7995('0x30')],_0x514445=_0x132a42['offset']+_0x132a42['limit'],_0x456a28;if(_0x514445>=_0x4b6f99){_0x514445=_0x4b6f99;_0x456a28=0xc8;}else{_0x456a28=0xce;}_0xf16cc2['status'](_0x456a28);return _0xf16cc2[_0x7995('0x31')](_0x7995('0x32'),_0x9b2a15+'-'+_0x514445+'/'+_0x4b6f99)[_0x7995('0x2e')](_0x11c1eb);}return null;};}function patchUpdates(_0x2b874d){return function(_0x2e3493){try{jsonpatch[_0x7995('0x33')](_0x2e3493,_0x2b874d,!![]);}catch(_0x538841){return BPromise['reject'](_0x538841);}return _0x2e3493[_0x7995('0x34')]();};}function saveUpdates(_0x5524af,_0x553671){return function(_0x3eb566){if(_0x3eb566){return _0x3eb566[_0x7995('0x35')](_0x5524af)[_0x7995('0x20')](function(_0x1f7d27){return _0x1f7d27;});}return null;};}function removeEntity(_0x510841,_0x44309d){return function(_0x33e24e){if(_0x33e24e){return _0x33e24e['destroy']()['then'](function(){_0x510841['status'](0xcc)[_0x7995('0x2d')]();});}};}function handleEntityNotFound(_0x3acfc3,_0x4a176f){return function(_0x3e7020){if(!_0x3e7020){_0x3acfc3['sendStatus'](0x194);}return _0x3e7020;};}function handleError(_0x37917b,_0x1cb058){_0x1cb058=_0x1cb058||0x1f4;return function(_0x177cb4){logger['error'](_0x177cb4['stack']);if(_0x177cb4[_0x7995('0x36')]){delete _0x177cb4['name'];}_0x37917b['status'](_0x1cb058)[_0x7995('0x37')](_0x177cb4);};}exports[_0x7995('0x38')]=function(_0x5212ff,_0x1baa15){var _0x1922b4={},_0x2b772f={},_0x18667c={'count':0x0,'rows':[]};var _0x1e3dbf=_['map'](db[_0x7995('0x39')][_0x7995('0x3a')],function(_0xf612e6){return{'name':_0xf612e6[_0x7995('0x3b')],'type':_0xf612e6['type'][_0x7995('0x3c')]};});_0x2b772f[_0x7995('0x3d')]=_[_0x7995('0x3e')](_0x1e3dbf,_0x7995('0x36'));_0x2b772f[_0x7995('0x3f')]=_[_0x7995('0x40')](_0x5212ff['query']);_0x2b772f[_0x7995('0x41')]=_[_0x7995('0x42')](_0x2b772f[_0x7995('0x3d')],_0x2b772f[_0x7995('0x3f')]);_0x1922b4[_0x7995('0x43')]=_[_0x7995('0x42')](_0x2b772f[_0x7995('0x3d')],qs[_0x7995('0x44')](_0x5212ff[_0x7995('0x3f')][_0x7995('0x44')]));_0x1922b4[_0x7995('0x43')]=_0x1922b4[_0x7995('0x43')][_0x7995('0x45')]?_0x1922b4['attributes']:_0x2b772f['model'];if(!_0x5212ff[_0x7995('0x3f')][_0x7995('0x46')]('nolimit')){_0x1922b4['limit']=qs[_0x7995('0x47')](_0x5212ff['query']['limit']);_0x1922b4[_0x7995('0x30')]=qs[_0x7995('0x30')](_0x5212ff[_0x7995('0x3f')]['offset']);}_0x1922b4[_0x7995('0x48')]=qs['sort'](_0x5212ff[_0x7995('0x3f')]['sort']);_0x1922b4['where']=qs[_0x7995('0x41')](_[_0x7995('0x49')](_0x5212ff[_0x7995('0x3f')],_0x2b772f[_0x7995('0x41')]));if(_0x5212ff['query'][_0x7995('0x4a')]){_0x1922b4[_0x7995('0x4b')]=_[_0x7995('0x4c')](_0x1922b4[_0x7995('0x4b')],{'$or':_['map'](_0x1e3dbf,function(_0x5f28e7){if(_0x5f28e7[_0x7995('0x4d')]!=='VIRTUAL'){var _0x23c41d={};_0x23c41d[_0x5f28e7['name']]={'$like':'%'+_0x5212ff[_0x7995('0x3f')]['filter']+'%'};return _0x23c41d;}})});}_0x1922b4=_[_0x7995('0x4c')]({},_0x1922b4,_0x5212ff[_0x7995('0x4e')]);var _0x4d9245={'where':_0x1922b4[_0x7995('0x4b')]};return db[_0x7995('0x39')][_0x7995('0x2f')](_0x4d9245)[_0x7995('0x20')](function(_0x4c6837){_0x18667c[_0x7995('0x2f')]=_0x4c6837;if(_0x5212ff[_0x7995('0x3f')][_0x7995('0x4f')]){_0x1922b4['include']=[{'all':!![]}];}return db[_0x7995('0x39')][_0x7995('0x50')](_0x1922b4);})[_0x7995('0x20')](function(_0x3d8ae3){_0x18667c[_0x7995('0x51')]=_0x3d8ae3;return _0x18667c;})['then'](respondWithFilteredResult(_0x1baa15,_0x1922b4))[_0x7995('0x2a')](handleError(_0x1baa15,null));};exports[_0x7995('0x52')]=function(_0x5921b9,_0x3d1dbb){var _0x5843ba={'raw':![],'where':{'id':_0x5921b9[_0x7995('0x53')]['id']}},_0x1d87f9={};_0x1d87f9[_0x7995('0x3d')]=_[_0x7995('0x40')](db[_0x7995('0x39')][_0x7995('0x3a')]);_0x1d87f9[_0x7995('0x3f')]=_['keys'](_0x5921b9[_0x7995('0x3f')]);_0x1d87f9[_0x7995('0x41')]=_[_0x7995('0x42')](_0x1d87f9['model'],_0x1d87f9[_0x7995('0x3f')]);_0x5843ba[_0x7995('0x43')]=_[_0x7995('0x42')](_0x1d87f9['model'],qs['fields'](_0x5921b9['query'][_0x7995('0x44')]));_0x5843ba[_0x7995('0x43')]=_0x5843ba['attributes'][_0x7995('0x45')]?_0x5843ba[_0x7995('0x43')]:_0x1d87f9[_0x7995('0x3d')];if(_0x5921b9[_0x7995('0x3f')][_0x7995('0x4f')]){_0x5843ba['include']=[{'all':!![]}];}_0x5843ba=_[_0x7995('0x4c')]({},_0x5843ba,_0x5921b9['options']);return db[_0x7995('0x39')][_0x7995('0x54')](_0x5843ba)[_0x7995('0x20')](handleEntityNotFound(_0x3d1dbb,null))['then'](respondWithResult(_0x3d1dbb,null))['catch'](handleError(_0x3d1dbb,null));};exports['create']=function(_0x563f8e,_0x2e13b0){return db[_0x7995('0x39')][_0x7995('0x55')](_0x563f8e[_0x7995('0x56')],{})[_0x7995('0x20')](respondWithResult(_0x2e13b0,0xc9))[_0x7995('0x2a')](handleError(_0x2e13b0,null));};exports[_0x7995('0x35')]=function(_0xda6ce8,_0x328671){if(_0xda6ce8[_0x7995('0x56')]['id']){delete _0xda6ce8[_0x7995('0x56')]['id'];}return db[_0x7995('0x39')][_0x7995('0x54')]({'where':{'id':_0xda6ce8[_0x7995('0x53')]['id']}})[_0x7995('0x20')](handleEntityNotFound(_0x328671,null))[_0x7995('0x20')](saveUpdates(_0xda6ce8[_0x7995('0x56')],null))[_0x7995('0x20')](respondWithResult(_0x328671,null))[_0x7995('0x2a')](handleError(_0x328671,null));};exports['destroy']=function(_0x56a374,_0x630737){return db[_0x7995('0x39')][_0x7995('0x54')]({'where':{'id':_0x56a374['params']['id']}})['then'](handleEntityNotFound(_0x630737,null))[_0x7995('0x20')](removeEntity(_0x630737,null))[_0x7995('0x2a')](handleError(_0x630737,null));};exports[_0x7995('0x57')]=function(_0x332a85,_0x51c50b,_0x13cd7b){var _0x74ff38={};var _0xef5044={};var _0x33c49c;var _0x502d43;return db['ZendeskConfiguration'][_0x7995('0x58')]({'where':{'id':_0x332a85[_0x7995('0x53')]['id']}})[_0x7995('0x20')](handleEntityNotFound(_0x51c50b,null))[_0x7995('0x20')](function(_0x37072){if(_0x37072){_0x33c49c=_0x37072;_0xef5044[_0x7995('0x3d')]=_[_0x7995('0x40')](db[_0x7995('0x59')][_0x7995('0x3a')]);_0xef5044['query']=_[_0x7995('0x40')](_0x332a85[_0x7995('0x3f')]);_0xef5044[_0x7995('0x41')]=_[_0x7995('0x42')](_0xef5044['model'],_0xef5044['query']);_0x74ff38[_0x7995('0x43')]=_[_0x7995('0x42')](_0xef5044['model'],qs[_0x7995('0x44')](_0x332a85[_0x7995('0x3f')][_0x7995('0x44')]));_0x74ff38[_0x7995('0x43')]=_0x74ff38[_0x7995('0x43')]['length']?_0x74ff38[_0x7995('0x43')]:_0xef5044['model'];_0x74ff38[_0x7995('0x48')]=qs[_0x7995('0x5a')](_0x332a85[_0x7995('0x3f')][_0x7995('0x5a')]);_0x74ff38[_0x7995('0x4b')]=qs[_0x7995('0x41')](_[_0x7995('0x49')](_0x332a85[_0x7995('0x3f')],_0xef5044[_0x7995('0x41')]));if(_0x332a85[_0x7995('0x3f')][_0x7995('0x4a')]){_0x74ff38[_0x7995('0x4b')]=_['merge'](_0x74ff38[_0x7995('0x4b')],{'$or':_[_0x7995('0x3e')](_0x74ff38[_0x7995('0x43')],function(_0xc2b660){var _0x2c6548={};_0x2c6548[_0xc2b660]={'$like':'%'+_0x332a85['query']['filter']+'%'};return _0x2c6548;})});}_0x74ff38=_[_0x7995('0x4c')]({},_0x74ff38,_0x332a85[_0x7995('0x4e')]);return _0x33c49c[_0x7995('0x57')](_0x74ff38);}})[_0x7995('0x20')](function(_0x5aa2ec){if(_0x5aa2ec){_0x502d43=_0x5aa2ec[_0x7995('0x45')];if(!_0x332a85['query']['hasOwnProperty'](_0x7995('0x5b'))){_0x74ff38[_0x7995('0x47')]=qs[_0x7995('0x47')](_0x332a85[_0x7995('0x3f')][_0x7995('0x47')]);_0x74ff38[_0x7995('0x30')]=qs[_0x7995('0x30')](_0x332a85[_0x7995('0x3f')][_0x7995('0x30')]);}return _0x33c49c[_0x7995('0x57')](_0x74ff38);}})['then'](function(_0x2dc1f7){if(_0x2dc1f7){return _0x2dc1f7?{'count':_0x502d43,'rows':_0x2dc1f7}:null;}})[_0x7995('0x20')](respondWithResult(_0x51c50b,null))[_0x7995('0x2a')](handleError(_0x51c50b,null));};exports['getSubjects']=function(_0x1fe1cb,_0x1d2f9d,_0x705f0){var _0x3a7d9d={};var _0x3b0d30={};var _0x51ab1e;var _0x550a10;return db[_0x7995('0x39')][_0x7995('0x58')]({'where':{'id':_0x1fe1cb[_0x7995('0x53')]['id']}})[_0x7995('0x20')](handleEntityNotFound(_0x1d2f9d,null))['then'](function(_0x5e8b4c){if(_0x5e8b4c){_0x51ab1e=_0x5e8b4c;_0x3b0d30[_0x7995('0x3d')]=_[_0x7995('0x40')](db[_0x7995('0x59')][_0x7995('0x3a')]);_0x3b0d30['query']=_[_0x7995('0x40')](_0x1fe1cb[_0x7995('0x3f')]);_0x3b0d30['filters']=_['intersection'](_0x3b0d30[_0x7995('0x3d')],_0x3b0d30[_0x7995('0x3f')]);_0x3a7d9d['attributes']=_[_0x7995('0x42')](_0x3b0d30['model'],qs[_0x7995('0x44')](_0x1fe1cb[_0x7995('0x3f')]['fields']));_0x3a7d9d['attributes']=_0x3a7d9d[_0x7995('0x43')]['length']?_0x3a7d9d[_0x7995('0x43')]:_0x3b0d30[_0x7995('0x3d')];_0x3a7d9d[_0x7995('0x48')]=qs[_0x7995('0x5a')](_0x1fe1cb[_0x7995('0x3f')][_0x7995('0x5a')]);_0x3a7d9d[_0x7995('0x4b')]=qs[_0x7995('0x41')](_[_0x7995('0x49')](_0x1fe1cb[_0x7995('0x3f')],_0x3b0d30[_0x7995('0x41')]));if(_0x1fe1cb[_0x7995('0x3f')][_0x7995('0x4a')]){_0x3a7d9d[_0x7995('0x4b')]=_[_0x7995('0x4c')](_0x3a7d9d[_0x7995('0x4b')],{'$or':_[_0x7995('0x3e')](_0x3a7d9d[_0x7995('0x43')],function(_0x2ff7ba){var _0xa2fc8e={};_0xa2fc8e[_0x2ff7ba]={'$like':'%'+_0x1fe1cb[_0x7995('0x3f')][_0x7995('0x4a')]+'%'};return _0xa2fc8e;})});}_0x3a7d9d=_[_0x7995('0x4c')]({},_0x3a7d9d,_0x1fe1cb[_0x7995('0x4e')]);return _0x51ab1e[_0x7995('0x5c')](_0x3a7d9d);}})[_0x7995('0x20')](function(_0x2f7f51){if(_0x2f7f51){_0x550a10=_0x2f7f51[_0x7995('0x45')];if(!_0x1fe1cb['query'][_0x7995('0x46')](_0x7995('0x5b'))){_0x3a7d9d['limit']=qs['limit'](_0x1fe1cb[_0x7995('0x3f')][_0x7995('0x47')]);_0x3a7d9d[_0x7995('0x30')]=qs[_0x7995('0x30')](_0x1fe1cb[_0x7995('0x3f')][_0x7995('0x30')]);}return _0x51ab1e['getSubjects'](_0x3a7d9d);}})[_0x7995('0x20')](function(_0xb68962){if(_0xb68962){return _0xb68962?{'count':_0x550a10,'rows':_0xb68962}:null;}})[_0x7995('0x20')](respondWithResult(_0x1d2f9d,null))[_0x7995('0x2a')](handleError(_0x1d2f9d,null));};exports[_0x7995('0x5d')]=function(_0x3f0bff,_0x151d99,_0xc93dcb){var _0x560095={};var _0x1c8e7d={};var _0x2b8217;var _0x5c04c9;return db['ZendeskConfiguration'][_0x7995('0x58')]({'where':{'id':_0x3f0bff[_0x7995('0x53')]['id']}})[_0x7995('0x20')](handleEntityNotFound(_0x151d99,null))[_0x7995('0x20')](function(_0xe42797){if(_0xe42797){_0x2b8217=_0xe42797;_0x1c8e7d['model']=_[_0x7995('0x40')](db[_0x7995('0x59')]['rawAttributes']);_0x1c8e7d[_0x7995('0x3f')]=_[_0x7995('0x40')](_0x3f0bff['query']);_0x1c8e7d[_0x7995('0x41')]=_['intersection'](_0x1c8e7d[_0x7995('0x3d')],_0x1c8e7d[_0x7995('0x3f')]);_0x560095[_0x7995('0x43')]=_[_0x7995('0x42')](_0x1c8e7d[_0x7995('0x3d')],qs['fields'](_0x3f0bff[_0x7995('0x3f')][_0x7995('0x44')]));_0x560095[_0x7995('0x43')]=_0x560095['attributes'][_0x7995('0x45')]?_0x560095[_0x7995('0x43')]:_0x1c8e7d[_0x7995('0x3d')];_0x560095[_0x7995('0x48')]=qs['sort'](_0x3f0bff[_0x7995('0x3f')][_0x7995('0x5a')]);_0x560095[_0x7995('0x4b')]=qs['filters'](_['pick'](_0x3f0bff[_0x7995('0x3f')],_0x1c8e7d[_0x7995('0x41')]));if(_0x3f0bff['query']['filter']){_0x560095[_0x7995('0x4b')]=_[_0x7995('0x4c')](_0x560095[_0x7995('0x4b')],{'$or':_[_0x7995('0x3e')](_0x560095[_0x7995('0x43')],function(_0x551b5e){var _0x56003d={};_0x56003d[_0x551b5e]={'$like':'%'+_0x3f0bff[_0x7995('0x3f')]['filter']+'%'};return _0x56003d;})});}_0x560095=_['merge']({},_0x560095,_0x3f0bff[_0x7995('0x4e')]);return _0x2b8217[_0x7995('0x5d')](_0x560095);}})[_0x7995('0x20')](function(_0x5eb360){if(_0x5eb360){_0x5c04c9=_0x5eb360[_0x7995('0x45')];if(!_0x3f0bff[_0x7995('0x3f')][_0x7995('0x46')](_0x7995('0x5b'))){_0x560095[_0x7995('0x47')]=qs['limit'](_0x3f0bff[_0x7995('0x3f')][_0x7995('0x47')]);_0x560095[_0x7995('0x30')]=qs[_0x7995('0x30')](_0x3f0bff['query'][_0x7995('0x30')]);}return _0x2b8217[_0x7995('0x5d')](_0x560095);}})['then'](function(_0x310272){if(_0x310272){return _0x310272?{'count':_0x5c04c9,'rows':_0x310272}:null;}})[_0x7995('0x20')](respondWithResult(_0x151d99,null))['catch'](handleError(_0x151d99,null));};exports[_0x7995('0x5e')]=function(_0x50efab,_0x1b4b34,_0x51e7d7){var _0x21f496={};var _0x4d12fd={};var _0xa97c08;var _0x20f48c;return db['ZendeskConfiguration'][_0x7995('0x58')]({'where':{'id':_0x50efab['params']['id']}})['then'](handleEntityNotFound(_0x1b4b34,null))[_0x7995('0x20')](function(_0x14812d){if(_0x14812d){_0xa97c08=_0x14812d;_0x4d12fd[_0x7995('0x3d')]=_[_0x7995('0x40')](db['Tag'][_0x7995('0x3a')]);_0x4d12fd[_0x7995('0x3f')]=_['keys'](_0x50efab['query']);_0x4d12fd[_0x7995('0x41')]=_['intersection'](_0x4d12fd[_0x7995('0x3d')],_0x4d12fd[_0x7995('0x3f')]);_0x21f496[_0x7995('0x43')]=_['intersection'](_0x4d12fd['model'],qs[_0x7995('0x44')](_0x50efab['query'][_0x7995('0x44')]));_0x21f496[_0x7995('0x43')]=_0x21f496[_0x7995('0x43')][_0x7995('0x45')]?_0x21f496['attributes']:_0x4d12fd['model'];_0x21f496['order']=qs[_0x7995('0x5a')](_0x50efab[_0x7995('0x3f')][_0x7995('0x5a')]);_0x21f496[_0x7995('0x4b')]=qs[_0x7995('0x41')](_[_0x7995('0x49')](_0x50efab['query'],_0x4d12fd['filters']));if(_0x50efab[_0x7995('0x3f')]['filter']){_0x21f496['where']=_[_0x7995('0x4c')](_0x21f496['where'],{'$or':_['map'](_0x21f496[_0x7995('0x43')],function(_0x3541d7){var _0x3873f3={};_0x3873f3[_0x3541d7]={'$like':'%'+_0x50efab['query'][_0x7995('0x4a')]+'%'};return _0x3873f3;})});}_0x21f496=_[_0x7995('0x4c')]({},_0x21f496,_0x50efab[_0x7995('0x4e')]);return _0xa97c08[_0x7995('0x5e')](_0x21f496);}})[_0x7995('0x20')](function(_0x178746){if(_0x178746){_0x20f48c=_0x178746[_0x7995('0x45')];if(!_0x50efab[_0x7995('0x3f')][_0x7995('0x46')]('nolimit')){_0x21f496[_0x7995('0x47')]=qs[_0x7995('0x47')](_0x50efab[_0x7995('0x3f')][_0x7995('0x47')]);_0x21f496[_0x7995('0x30')]=qs['offset'](_0x50efab[_0x7995('0x3f')][_0x7995('0x30')]);}return _0xa97c08[_0x7995('0x5e')](_0x21f496);}})['then'](function(_0x4c554d){if(_0x4c554d){return _0x4c554d?{'count':_0x20f48c,'rows':_0x4c554d}:null;}})['then'](respondWithResult(_0x1b4b34,null))[_0x7995('0x2a')](handleError(_0x1b4b34,null));};exports[_0x7995('0x5f')]=function(_0x9daa49,_0x1d52cf,_0x16a94d){if(_0x9daa49[_0x7995('0x56')]['id']){delete _0x9daa49['body']['id'];}return db[_0x7995('0x39')]['findOne']({'where':{'id':_0x9daa49[_0x7995('0x53')]['id']}})[_0x7995('0x20')](handleEntityNotFound(_0x1d52cf,null))[_0x7995('0x20')](function(_0x2cc9a4){if(_0x2cc9a4){return _0x2cc9a4[_0x7995('0x5f')](_0x9daa49[_0x7995('0x56')][_0x7995('0x60')]||[]);}return null;})[_0x7995('0x20')](respondWithResult(_0x1d52cf,null))[_0x7995('0x2a')](handleError(_0x1d52cf,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 4a95af3..d323d63 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 _0x72b4=['../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','util','../../config/logger','api','moment','bluebird','path'];(function(_0x32008f,_0x3cbdd7){var _0x5bef9e=function(_0x23110a){while(--_0x23110a){_0x32008f['push'](_0x32008f['shift']());}};_0x5bef9e(++_0x3cbdd7);}(_0x72b4,0x1da));var _0x472b=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0x72b4[_0x21aec3];return _0x288bbc;};'use strict';var _=require('lodash');var util=require(_0x472b('0x0'));var logger=require(_0x472b('0x1'))(_0x472b('0x2'));var moment=require(_0x472b('0x3'));var BPromise=require(_0x472b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x472b('0x5'));var rimraf=require('rimraf');var config=require(_0x472b('0x6'));var attributes=require(_0x472b('0x7'));module[_0x472b('0x8')]=function(_0x41c48c,_0x3330f8){return _0x41c48c[_0x472b('0x9')](_0x472b('0xa'),attributes,{'tableName':_0x472b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4b61=['define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','moment','bluebird','request-promise','../../config/environment','exports'];(function(_0xbf160d,_0x57c6b2){var _0x173777=function(_0x2ea9fd){while(--_0x2ea9fd){_0xbf160d['push'](_0xbf160d['shift']());}};_0x173777(++_0x57c6b2);}(_0x4b61,0x19d));var _0x14b6=function(_0x27beea,_0x3bc9f4){_0x27beea=_0x27beea-0x0;var _0x122645=_0x4b61[_0x27beea];return _0x122645;};'use strict';var _=require(_0x14b6('0x0'));var util=require(_0x14b6('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x14b6('0x2'));var BPromise=require(_0x14b6('0x3'));var rp=require(_0x14b6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x14b6('0x5'));var attributes=require('./intZendeskConfiguration.attributes');module[_0x14b6('0x6')]=function(_0x5ad42e,_0x5ae0f6){return _0x5ad42e[_0x14b6('0x7')](_0x14b6('0x8'),attributes,{'tableName':_0x14b6('0x9'),'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 c44e638..6ff9bd2 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 _0xf014=['code','ZendeskConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error'];(function(_0x368f22,_0x51c694){var _0x1b5b26=function(_0x4c27e1){while(--_0x4c27e1){_0x368f22['push'](_0x368f22['shift']());}};_0x1b5b26(++_0x51c694);}(_0xf014,0x1d4));var _0x4f01=function(_0x3da7a1,_0x151473){_0x3da7a1=_0x3da7a1-0x0;var _0x3b7290=_0xf014[_0x3da7a1];return _0x3b7290;};'use strict';var _=require(_0x4f01('0x0'));var util=require('util');var moment=require(_0x4f01('0x1'));var BPromise=require(_0x4f01('0x2'));var rs=require(_0x4f01('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4f01('0x4'))['db'];var utils=require(_0x4f01('0x5'));var logger=require('../../config/logger')(_0x4f01('0x6'));var config=require(_0x4f01('0x7'));var jayson=require(_0x4f01('0x8'));var client=jayson[_0x4f01('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x459b35,_0xed3d42,_0x3d193f){return new BPromise(function(_0xa26d49,_0x22dc29){return client[_0x4f01('0xa')](_0x459b35,_0x3d193f)[_0x4f01('0xb')](function(_0x29be3d){logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0xed3d42,_0x4f01('0xc'));logger[_0x4f01('0xd')](_0x4f01('0xe'),_0xed3d42,_0x4f01('0xc'),JSON['stringify'](_0x29be3d));if(_0x29be3d[_0x4f01('0xf')]){if(_0x29be3d['error'][_0x4f01('0x10')]===0x1f4){logger['error'](_0x4f01('0x11'),_0xed3d42,_0x29be3d['error'][_0x4f01('0x12')]);return _0x22dc29(_0x29be3d[_0x4f01('0xf')][_0x4f01('0x12')]);}logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0xed3d42,_0x29be3d[_0x4f01('0xf')]['message']);return _0xa26d49(_0x29be3d[_0x4f01('0xf')][_0x4f01('0x12')]);}else{logger[_0x4f01('0x13')](_0x4f01('0x11'),_0xed3d42,_0x4f01('0xc'));_0xa26d49(_0x29be3d[_0x4f01('0x14')]['message']);}})[_0x4f01('0x15')](function(_0x5291c3){logger[_0x4f01('0xf')](_0x4f01('0x11'),_0xed3d42,_0x5291c3);_0x22dc29(_0x5291c3);});});} \ No newline at end of file +var _0xc498=['bluebird','randomstring','../../mysqldb','jayson/promise','http','request','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util'];(function(_0x75e89,_0x17635b){var _0x3f16d4=function(_0x1a33b8){while(--_0x1a33b8){_0x75e89['push'](_0x75e89['shift']());}};_0x3f16d4(++_0x17635b);}(_0xc498,0x154));var _0x8c49=function(_0x1e65ac,_0x15f1f5){_0x1e65ac=_0x1e65ac-0x0;var _0x33225c=_0xc498[_0x1e65ac];return _0x33225c;};'use strict';var _=require(_0x8c49('0x0'));var util=require(_0x8c49('0x1'));var moment=require('moment');var BPromise=require(_0x8c49('0x2'));var rs=require(_0x8c49('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8c49('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x8c49('0x5'));var client=jayson['client'][_0x8c49('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x57aaa4,_0x5783db,_0x31afe8){return new BPromise(function(_0x20e85f,_0x5ec632){return client[_0x8c49('0x7')](_0x57aaa4,_0x31afe8)['then'](function(_0x5dcde8){logger['info'](_0x8c49('0x8'),_0x5783db,_0x8c49('0x9'));logger[_0x8c49('0xa')](_0x8c49('0xb'),_0x5783db,_0x8c49('0x9'),JSON[_0x8c49('0xc')](_0x5dcde8));if(_0x5dcde8[_0x8c49('0xd')]){if(_0x5dcde8[_0x8c49('0xd')][_0x8c49('0xe')]===0x1f4){logger[_0x8c49('0xd')]('ZendeskConfiguration,\x20%s,\x20%s',_0x5783db,_0x5dcde8['error'][_0x8c49('0xf')]);return _0x5ec632(_0x5dcde8[_0x8c49('0xd')][_0x8c49('0xf')]);}logger[_0x8c49('0xd')](_0x8c49('0x8'),_0x5783db,_0x5dcde8[_0x8c49('0xd')][_0x8c49('0xf')]);return _0x20e85f(_0x5dcde8['error'][_0x8c49('0xf')]);}else{logger[_0x8c49('0x10')](_0x8c49('0x8'),_0x5783db,_0x8c49('0x9'));_0x20e85f(_0x5dcde8[_0x8c49('0x11')][_0x8c49('0xf')]);}})[_0x8c49('0x12')](function(_0x539b28){logger[_0x8c49('0xd')](_0x8c49('0x8'),_0x5783db,_0x539b28);_0x5ec632(_0x539b28);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index db66393..56de522 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 _0xc6f6=['../../config/environment','./intZendeskField.controller','get','/:id','post','isAuthenticated','create','put','update','destroy','exports','multer','util','path','Router','../../components/interaction/service'];(function(_0x1a751f,_0x269774){var _0x3a3b0e=function(_0x4644fc){while(--_0x4644fc){_0x1a751f['push'](_0x1a751f['shift']());}};_0x3a3b0e(++_0x269774);}(_0xc6f6,0xeb));var _0x6c6f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc6f6[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x6c6f('0x0'));var util=require(_0x6c6f('0x1'));var path=require(_0x6c6f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6c6f('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x6c6f('0x4'));var config=require(_0x6c6f('0x5'));var controller=require(_0x6c6f('0x6'));router[_0x6c6f('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6c6f('0x7')](_0x6c6f('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x6c6f('0x9')]('/',auth[_0x6c6f('0xa')](),controller[_0x6c6f('0xb')]);router[_0x6c6f('0xc')](_0x6c6f('0x8'),auth[_0x6c6f('0xa')](),controller[_0x6c6f('0xd')]);router['delete'](_0x6c6f('0x8'),auth[_0x6c6f('0xa')](),controller[_0x6c6f('0xe')]);module[_0x6c6f('0xf')]=router; \ No newline at end of file +var _0x24f1=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../config/environment','get','isAuthenticated','index','/:id','show','post'];(function(_0x4556a4,_0x31ee4f){var _0x5cc8d0=function(_0xe906e7){while(--_0xe906e7){_0x4556a4['push'](_0x4556a4['shift']());}};_0x5cc8d0(++_0x31ee4f);}(_0x24f1,0xf0));var _0x124f=function(_0xdd60ec,_0x2d2041){_0xdd60ec=_0xdd60ec-0x0;var _0x88ae55=_0x24f1[_0xdd60ec];return _0x88ae55;};'use strict';var multer=require(_0x124f('0x0'));var util=require(_0x124f('0x1'));var path=require(_0x124f('0x2'));var timeout=require(_0x124f('0x3'));var express=require(_0x124f('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x124f('0x5'));var controller=require('./intZendeskField.controller');router[_0x124f('0x6')]('/',auth[_0x124f('0x7')](),controller[_0x124f('0x8')]);router['get'](_0x124f('0x9'),auth[_0x124f('0x7')](),controller[_0x124f('0xa')]);router[_0x124f('0xb')]('/',auth[_0x124f('0x7')](),controller[_0x124f('0xc')]);router[_0x124f('0xd')](_0x124f('0x9'),auth[_0x124f('0x7')](),controller[_0x124f('0xe')]);router[_0x124f('0xf')](_0x124f('0x9'),auth['isAuthenticated'](),controller[_0x124f('0x10')]);module[_0x124f('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 d47896b..7fdfc97 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 _0xd4d1=['keyValue','STRING','customVariable','sequelize','exports','ENUM','string','variable'];(function(_0x740b79,_0x5c246d){var _0x358545=function(_0xb0dc44){while(--_0xb0dc44){_0x740b79['push'](_0x740b79['shift']());}};_0x358545(++_0x5c246d);}(_0xd4d1,0x123));var _0x1d4d=function(_0x1e0d2b,_0x354ac5){_0x1e0d2b=_0x1e0d2b-0x0;var _0x1373eb=_0xd4d1[_0x1e0d2b];return _0x1373eb;};'use strict';var Sequelize=require(_0x1d4d('0x0'));module[_0x1d4d('0x1')]={'type':{'type':Sequelize[_0x1d4d('0x2')](_0x1d4d('0x3'),_0x1d4d('0x4'),'customVariable',_0x1d4d('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x1d4d('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x1d4d('0x2')]('string',_0x1d4d('0x4'),_0x1d4d('0x7'))},'keyContent':{'type':Sequelize[_0x1d4d('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x1d4d('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1d4d('0x6')]}}; \ No newline at end of file +var _0x35e2=['variable','keyValue','STRING','customVariable','BOOLEAN','sequelize','ENUM','string'];(function(_0x4a3554,_0x14f2fd){var _0x12e4cb=function(_0x30dedc){while(--_0x30dedc){_0x4a3554['push'](_0x4a3554['shift']());}};_0x12e4cb(++_0x14f2fd);}(_0x35e2,0x1ed));var _0x235e=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x35e2[_0x2d7f0e];return _0x110b07;};'use strict';var Sequelize=require(_0x235e('0x0'));module['exports']={'type':{'type':Sequelize[_0x235e('0x1')](_0x235e('0x2'),_0x235e('0x3'),'customVariable',_0x235e('0x4')),'defaultValue':_0x235e('0x2')},'content':{'type':Sequelize[_0x235e('0x5')]},'key':{'type':Sequelize[_0x235e('0x5')]},'keyType':{'type':Sequelize[_0x235e('0x1')](_0x235e('0x2'),_0x235e('0x3'),_0x235e('0x6'))},'keyContent':{'type':Sequelize[_0x235e('0x5')]},'idField':{'type':Sequelize[_0x235e('0x5')]},'nameField':{'type':Sequelize[_0x235e('0x5')]},'customField':{'type':Sequelize[_0x235e('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x235e('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 07f1c39..4affd49 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 _0x66b5=['rows','catch','show','rawAttributes','length','merge','find','create','body','params','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','fieldName','type','map','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','ZendeskField','count','includeAll','include','findAll'];(function(_0x63f708,_0x3b6379){var _0x56c15b=function(_0x57c969){while(--_0x57c969){_0x63f708['push'](_0x63f708['shift']());}};_0x56c15b(++_0x3b6379);}(_0x66b5,0xf1));var _0x566b=function(_0x486b52,_0x4295d8){_0x486b52=_0x486b52-0x0;var _0x4f377d=_0x66b5[_0x486b52];return _0x4f377d;};'use strict';var pdf=require(_0x566b('0x0'));var emlformat=require(_0x566b('0x1'));var rimraf=require(_0x566b('0x2'));var zipdir=require(_0x566b('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x566b('0x4'));var moment=require(_0x566b('0x5'));var BPromise=require(_0x566b('0x6'));var Mustache=require('mustache');var util=require(_0x566b('0x7'));var path=require('path');var sox=require(_0x566b('0x8'));var csv=require('to-csv');var ejs=require(_0x566b('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x566b('0xa'));var crypto=require(_0x566b('0xb'));var jsforce=require(_0x566b('0xc'));var deskjs=require(_0x566b('0xd'));var toCsv=require(_0x566b('0xe'));var querystring=require(_0x566b('0xf'));var Papa=require('papaparse');var Redis=require(_0x566b('0x10'));var authService=require(_0x566b('0x11'));var qs=require(_0x566b('0x12'));var as=require(_0x566b('0x13'));var hardwareService=require(_0x566b('0x14'));var logger=require('../../config/logger')(_0x566b('0x15'));var utils=require(_0x566b('0x16'));var config=require(_0x566b('0x17'));var db=require(_0x566b('0x18'))['db'];function respondWithStatusCode(_0x55fcdd,_0x4dc1a0){_0x4dc1a0=_0x4dc1a0||0xcc;return function(_0x4feafc){if(_0x4feafc){return _0x55fcdd[_0x566b('0x19')](_0x4dc1a0);}return _0x55fcdd[_0x566b('0x1a')](_0x4dc1a0)[_0x566b('0x1b')]();};}function respondWithResult(_0x4222f0,_0x52e66e){_0x52e66e=_0x52e66e||0xc8;return function(_0x73b773){if(_0x73b773){return _0x4222f0['status'](_0x52e66e)['json'](_0x73b773);}};}function respondWithFilteredResult(_0x377e89,_0x48a6e2){return function(_0x533e3a){if(_0x533e3a){var _0x40d1a7=_0x533e3a['count'],_0x9bc51d=_0x48a6e2[_0x566b('0x1c')],_0x36b37b=_0x48a6e2[_0x566b('0x1c')]+_0x48a6e2[_0x566b('0x1d')],_0x1ef90f;if(_0x36b37b>=_0x40d1a7){_0x36b37b=_0x40d1a7;_0x1ef90f=0xc8;}else{_0x1ef90f=0xce;}_0x377e89[_0x566b('0x1a')](_0x1ef90f);return _0x377e89[_0x566b('0x1e')](_0x566b('0x1f'),_0x9bc51d+'-'+_0x36b37b+'/'+_0x40d1a7)[_0x566b('0x20')](_0x533e3a);}return null;};}function patchUpdates(_0x3e72af){return function(_0x468ac4){try{jsonpatch[_0x566b('0x21')](_0x468ac4,_0x3e72af,!![]);}catch(_0x28c679){return BPromise[_0x566b('0x22')](_0x28c679);}return _0x468ac4[_0x566b('0x23')]();};}function saveUpdates(_0x2778f8,_0x233a97){return function(_0x1f7a82){if(_0x1f7a82){return _0x1f7a82[_0x566b('0x24')](_0x2778f8)[_0x566b('0x25')](function(_0x90c184){return _0x90c184;});}return null;};}function removeEntity(_0x1ea069,_0x352689){return function(_0x55c38f){if(_0x55c38f){return _0x55c38f[_0x566b('0x26')]()['then'](function(){_0x1ea069[_0x566b('0x1a')](0xcc)[_0x566b('0x1b')]();});}};}function handleEntityNotFound(_0x46aae0,_0x45fe4f){return function(_0x3297bf){if(!_0x3297bf){_0x46aae0['sendStatus'](0x194);}return _0x3297bf;};}function handleError(_0xca4a6e,_0x1c8986){_0x1c8986=_0x1c8986||0x1f4;return function(_0x58ce5c){logger[_0x566b('0x27')](_0x58ce5c[_0x566b('0x28')]);if(_0x58ce5c['name']){delete _0x58ce5c[_0x566b('0x29')];}_0xca4a6e['status'](_0x1c8986)[_0x566b('0x2a')](_0x58ce5c);};}exports[_0x566b('0x2b')]=function(_0x4609e3,_0xaaf158){var _0x5b6d73={},_0x24b872={},_0x22ca28={'count':0x0,'rows':[]};var _0x54ea1c=_['map'](db['ZendeskField']['rawAttributes'],function(_0x1d2847){return{'name':_0x1d2847[_0x566b('0x2c')],'type':_0x1d2847[_0x566b('0x2d')]['key']};});_0x24b872['model']=_[_0x566b('0x2e')](_0x54ea1c,_0x566b('0x29'));_0x24b872[_0x566b('0x2f')]=_[_0x566b('0x30')](_0x4609e3[_0x566b('0x2f')]);_0x24b872[_0x566b('0x31')]=_['intersection'](_0x24b872[_0x566b('0x32')],_0x24b872[_0x566b('0x2f')]);_0x5b6d73[_0x566b('0x33')]=_[_0x566b('0x34')](_0x24b872[_0x566b('0x32')],qs[_0x566b('0x35')](_0x4609e3[_0x566b('0x2f')][_0x566b('0x35')]));_0x5b6d73[_0x566b('0x33')]=_0x5b6d73[_0x566b('0x33')]['length']?_0x5b6d73['attributes']:_0x24b872['model'];if(!_0x4609e3[_0x566b('0x2f')][_0x566b('0x36')](_0x566b('0x37'))){_0x5b6d73['limit']=qs[_0x566b('0x1d')](_0x4609e3[_0x566b('0x2f')][_0x566b('0x1d')]);_0x5b6d73[_0x566b('0x1c')]=qs[_0x566b('0x1c')](_0x4609e3['query']['offset']);}_0x5b6d73[_0x566b('0x38')]=qs[_0x566b('0x39')](_0x4609e3[_0x566b('0x2f')]['sort']);_0x5b6d73[_0x566b('0x3a')]=qs[_0x566b('0x31')](_[_0x566b('0x3b')](_0x4609e3[_0x566b('0x2f')],_0x24b872[_0x566b('0x31')]));if(_0x4609e3['query']['filter']){_0x5b6d73[_0x566b('0x3a')]=_['merge'](_0x5b6d73['where'],{'$or':_['map'](_0x54ea1c,function(_0x180e17){if(_0x180e17[_0x566b('0x2d')]!=='VIRTUAL'){var _0x3c4566={};_0x3c4566[_0x180e17[_0x566b('0x29')]]={'$like':'%'+_0x4609e3['query'][_0x566b('0x3c')]+'%'};return _0x3c4566;}})});}_0x5b6d73=_['merge']({},_0x5b6d73,_0x4609e3[_0x566b('0x3d')]);var _0x32e7a0={'where':_0x5b6d73[_0x566b('0x3a')]};return db[_0x566b('0x3e')][_0x566b('0x3f')](_0x32e7a0)[_0x566b('0x25')](function(_0x33fb85){_0x22ca28['count']=_0x33fb85;if(_0x4609e3['query'][_0x566b('0x40')]){_0x5b6d73[_0x566b('0x41')]=[{'all':!![]}];}return db['ZendeskField'][_0x566b('0x42')](_0x5b6d73);})[_0x566b('0x25')](function(_0x59b2e2){_0x22ca28[_0x566b('0x43')]=_0x59b2e2;return _0x22ca28;})['then'](respondWithFilteredResult(_0xaaf158,_0x5b6d73))[_0x566b('0x44')](handleError(_0xaaf158,null));};exports[_0x566b('0x45')]=function(_0x45f2a8,_0x473306){var _0x24d3bb={'raw':!![],'where':{'id':_0x45f2a8['params']['id']}},_0xde006d={};_0xde006d[_0x566b('0x32')]=_[_0x566b('0x30')](db[_0x566b('0x3e')][_0x566b('0x46')]);_0xde006d[_0x566b('0x2f')]=_[_0x566b('0x30')](_0x45f2a8[_0x566b('0x2f')]);_0xde006d[_0x566b('0x31')]=_[_0x566b('0x34')](_0xde006d[_0x566b('0x32')],_0xde006d['query']);_0x24d3bb[_0x566b('0x33')]=_[_0x566b('0x34')](_0xde006d[_0x566b('0x32')],qs['fields'](_0x45f2a8[_0x566b('0x2f')][_0x566b('0x35')]));_0x24d3bb[_0x566b('0x33')]=_0x24d3bb[_0x566b('0x33')][_0x566b('0x47')]?_0x24d3bb[_0x566b('0x33')]:_0xde006d[_0x566b('0x32')];if(_0x45f2a8['query']['includeAll']){_0x24d3bb['include']=[{'all':!![]}];}_0x24d3bb=_[_0x566b('0x48')]({},_0x24d3bb,_0x45f2a8[_0x566b('0x3d')]);return db['ZendeskField'][_0x566b('0x49')](_0x24d3bb)['then'](handleEntityNotFound(_0x473306,null))[_0x566b('0x25')](respondWithResult(_0x473306,null))['catch'](handleError(_0x473306,null));};exports[_0x566b('0x4a')]=function(_0x4399af,_0x501436){return db[_0x566b('0x3e')][_0x566b('0x4a')](_0x4399af[_0x566b('0x4b')],{})['then'](respondWithResult(_0x501436,0xc9))['catch'](handleError(_0x501436,null));};exports[_0x566b('0x24')]=function(_0x182767,_0x38e6ac){if(_0x182767[_0x566b('0x4b')]['id']){delete _0x182767['body']['id'];}return db[_0x566b('0x3e')][_0x566b('0x49')]({'where':{'id':_0x182767[_0x566b('0x4c')]['id']}})['then'](handleEntityNotFound(_0x38e6ac,null))[_0x566b('0x25')](saveUpdates(_0x182767['body'],null))[_0x566b('0x25')](respondWithResult(_0x38e6ac,null))[_0x566b('0x44')](handleError(_0x38e6ac,null));};exports[_0x566b('0x26')]=function(_0x1e1912,_0x3f6583){return db['ZendeskField'][_0x566b('0x49')]({'where':{'id':_0x1e1912[_0x566b('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3f6583,null))[_0x566b('0x25')](removeEntity(_0x3f6583,null))[_0x566b('0x44')](handleError(_0x3f6583,null));}; \ No newline at end of file +var _0x76e6=['status','json','count','offset','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','map','ZendeskField','rawAttributes','fieldName','key','query','keys','intersection','attributes','model','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','includeAll','findAll','rows','catch','params','length','include','find','create','body','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end'];(function(_0x4e317a,_0x30e4c2){var _0x39635b=function(_0xa1ac1f){while(--_0xa1ac1f){_0x4e317a['push'](_0x4e317a['shift']());}};_0x39635b(++_0x30e4c2);}(_0x76e6,0x109));var _0x676e=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x76e6[_0x502c7d];return _0x30b7ed;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x676e('0x0'));var jsonpatch=require(_0x676e('0x1'));var rp=require('request-promise');var moment=require(_0x676e('0x2'));var BPromise=require(_0x676e('0x3'));var Mustache=require(_0x676e('0x4'));var util=require(_0x676e('0x5'));var path=require(_0x676e('0x6'));var sox=require(_0x676e('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x676e('0x8'));var squel=require(_0x676e('0x9'));var crypto=require(_0x676e('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x676e('0xb'));var Papa=require(_0x676e('0xc'));var Redis=require(_0x676e('0xd'));var authService=require(_0x676e('0xe'));var qs=require(_0x676e('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x676e('0x10'));var logger=require('../../config/logger')(_0x676e('0x11'));var utils=require(_0x676e('0x12'));var config=require(_0x676e('0x13'));var db=require(_0x676e('0x14'))['db'];function respondWithStatusCode(_0x4d8f5b,_0x223f60){_0x223f60=_0x223f60||0xcc;return function(_0x256359){if(_0x256359){return _0x4d8f5b[_0x676e('0x15')](_0x223f60);}return _0x4d8f5b['status'](_0x223f60)[_0x676e('0x16')]();};}function respondWithResult(_0xa87d39,_0x474396){_0x474396=_0x474396||0xc8;return function(_0x412fee){if(_0x412fee){return _0xa87d39[_0x676e('0x17')](_0x474396)[_0x676e('0x18')](_0x412fee);}};}function respondWithFilteredResult(_0xab3446,_0x42e866){return function(_0x12a549){if(_0x12a549){var _0x154ee3=_0x12a549[_0x676e('0x19')],_0x2a1ba3=_0x42e866['offset'],_0x7a99f1=_0x42e866[_0x676e('0x1a')]+_0x42e866['limit'],_0x36af48;if(_0x7a99f1>=_0x154ee3){_0x7a99f1=_0x154ee3;_0x36af48=0xc8;}else{_0x36af48=0xce;}_0xab3446[_0x676e('0x17')](_0x36af48);return _0xab3446[_0x676e('0x1b')](_0x676e('0x1c'),_0x2a1ba3+'-'+_0x7a99f1+'/'+_0x154ee3)['json'](_0x12a549);}return null;};}function patchUpdates(_0x24c3c2){return function(_0x48afb8){try{jsonpatch[_0x676e('0x1d')](_0x48afb8,_0x24c3c2,!![]);}catch(_0x4ff761){return BPromise['reject'](_0x4ff761);}return _0x48afb8[_0x676e('0x1e')]();};}function saveUpdates(_0x1190d3,_0x277829){return function(_0x5123df){if(_0x5123df){return _0x5123df[_0x676e('0x1f')](_0x1190d3)['then'](function(_0x315475){return _0x315475;});}return null;};}function removeEntity(_0x184925,_0x1bd433){return function(_0x36f722){if(_0x36f722){return _0x36f722[_0x676e('0x20')]()[_0x676e('0x21')](function(){_0x184925['status'](0xcc)[_0x676e('0x16')]();});}};}function handleEntityNotFound(_0x14ff05,_0x41b186){return function(_0x562c59){if(!_0x562c59){_0x14ff05[_0x676e('0x15')](0x194);}return _0x562c59;};}function handleError(_0xb8cff5,_0xe2ba0f){_0xe2ba0f=_0xe2ba0f||0x1f4;return function(_0x1e22c3){logger[_0x676e('0x22')](_0x1e22c3[_0x676e('0x23')]);if(_0x1e22c3[_0x676e('0x24')]){delete _0x1e22c3[_0x676e('0x24')];}_0xb8cff5['status'](_0xe2ba0f)[_0x676e('0x25')](_0x1e22c3);};}exports['index']=function(_0x2fb74b,_0x3a84a8){var _0x4ca679={},_0x16463d={},_0x47ce71={'count':0x0,'rows':[]};var _0x225c64=_[_0x676e('0x26')](db[_0x676e('0x27')][_0x676e('0x28')],function(_0x3690b7){return{'name':_0x3690b7[_0x676e('0x29')],'type':_0x3690b7['type'][_0x676e('0x2a')]};});_0x16463d['model']=_[_0x676e('0x26')](_0x225c64,'name');_0x16463d[_0x676e('0x2b')]=_[_0x676e('0x2c')](_0x2fb74b[_0x676e('0x2b')]);_0x16463d['filters']=_[_0x676e('0x2d')](_0x16463d['model'],_0x16463d[_0x676e('0x2b')]);_0x4ca679[_0x676e('0x2e')]=_['intersection'](_0x16463d[_0x676e('0x2f')],qs[_0x676e('0x30')](_0x2fb74b[_0x676e('0x2b')][_0x676e('0x30')]));_0x4ca679[_0x676e('0x2e')]=_0x4ca679[_0x676e('0x2e')]['length']?_0x4ca679[_0x676e('0x2e')]:_0x16463d['model'];if(!_0x2fb74b[_0x676e('0x2b')][_0x676e('0x31')](_0x676e('0x32'))){_0x4ca679['limit']=qs[_0x676e('0x33')](_0x2fb74b[_0x676e('0x2b')][_0x676e('0x33')]);_0x4ca679[_0x676e('0x1a')]=qs['offset'](_0x2fb74b[_0x676e('0x2b')]['offset']);}_0x4ca679[_0x676e('0x34')]=qs[_0x676e('0x35')](_0x2fb74b[_0x676e('0x2b')][_0x676e('0x35')]);_0x4ca679[_0x676e('0x36')]=qs[_0x676e('0x37')](_[_0x676e('0x38')](_0x2fb74b[_0x676e('0x2b')],_0x16463d[_0x676e('0x37')]));if(_0x2fb74b[_0x676e('0x2b')][_0x676e('0x39')]){_0x4ca679['where']=_['merge'](_0x4ca679[_0x676e('0x36')],{'$or':_[_0x676e('0x26')](_0x225c64,function(_0x3ae4c8){if(_0x3ae4c8[_0x676e('0x3a')]!==_0x676e('0x3b')){var _0x5a87b3={};_0x5a87b3[_0x3ae4c8[_0x676e('0x24')]]={'$like':'%'+_0x2fb74b[_0x676e('0x2b')][_0x676e('0x39')]+'%'};return _0x5a87b3;}})});}_0x4ca679=_[_0x676e('0x3c')]({},_0x4ca679,_0x2fb74b[_0x676e('0x3d')]);var _0x2fc6ee={'where':_0x4ca679[_0x676e('0x36')]};return db['ZendeskField'][_0x676e('0x19')](_0x2fc6ee)['then'](function(_0x1e3918){_0x47ce71['count']=_0x1e3918;if(_0x2fb74b[_0x676e('0x2b')][_0x676e('0x3e')]){_0x4ca679['include']=[{'all':!![]}];}return db[_0x676e('0x27')][_0x676e('0x3f')](_0x4ca679);})[_0x676e('0x21')](function(_0x242b28){_0x47ce71[_0x676e('0x40')]=_0x242b28;return _0x47ce71;})[_0x676e('0x21')](respondWithFilteredResult(_0x3a84a8,_0x4ca679))[_0x676e('0x41')](handleError(_0x3a84a8,null));};exports['show']=function(_0x34b484,_0x3d34ef){var _0x31153e={'raw':!![],'where':{'id':_0x34b484[_0x676e('0x42')]['id']}},_0x45aabb={};_0x45aabb['model']=_[_0x676e('0x2c')](db[_0x676e('0x27')][_0x676e('0x28')]);_0x45aabb[_0x676e('0x2b')]=_[_0x676e('0x2c')](_0x34b484[_0x676e('0x2b')]);_0x45aabb[_0x676e('0x37')]=_['intersection'](_0x45aabb[_0x676e('0x2f')],_0x45aabb[_0x676e('0x2b')]);_0x31153e[_0x676e('0x2e')]=_[_0x676e('0x2d')](_0x45aabb[_0x676e('0x2f')],qs[_0x676e('0x30')](_0x34b484[_0x676e('0x2b')][_0x676e('0x30')]));_0x31153e[_0x676e('0x2e')]=_0x31153e['attributes'][_0x676e('0x43')]?_0x31153e[_0x676e('0x2e')]:_0x45aabb['model'];if(_0x34b484[_0x676e('0x2b')][_0x676e('0x3e')]){_0x31153e[_0x676e('0x44')]=[{'all':!![]}];}_0x31153e=_['merge']({},_0x31153e,_0x34b484['options']);return db[_0x676e('0x27')][_0x676e('0x45')](_0x31153e)['then'](handleEntityNotFound(_0x3d34ef,null))[_0x676e('0x21')](respondWithResult(_0x3d34ef,null))[_0x676e('0x41')](handleError(_0x3d34ef,null));};exports[_0x676e('0x46')]=function(_0x5cd08d,_0x25ecb1){return db[_0x676e('0x27')][_0x676e('0x46')](_0x5cd08d[_0x676e('0x47')],{})[_0x676e('0x21')](respondWithResult(_0x25ecb1,0xc9))[_0x676e('0x41')](handleError(_0x25ecb1,null));};exports[_0x676e('0x1f')]=function(_0x5b30c1,_0x37c646){if(_0x5b30c1['body']['id']){delete _0x5b30c1[_0x676e('0x47')]['id'];}return db[_0x676e('0x27')][_0x676e('0x45')]({'where':{'id':_0x5b30c1[_0x676e('0x42')]['id']}})['then'](handleEntityNotFound(_0x37c646,null))[_0x676e('0x21')](saveUpdates(_0x5b30c1['body'],null))[_0x676e('0x21')](respondWithResult(_0x37c646,null))[_0x676e('0x41')](handleError(_0x37c646,null));};exports[_0x676e('0x20')]=function(_0x2f1bed,_0x478f3b){return db[_0x676e('0x27')]['find']({'where':{'id':_0x2f1bed[_0x676e('0x42')]['id']}})[_0x676e('0x21')](handleEntityNotFound(_0x478f3b,null))[_0x676e('0x21')](removeEntity(_0x478f3b,null))[_0x676e('0x41')](handleError(_0x478f3b,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 524f293..e44808f 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 _0xc112=['bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','lodash','util','../../config/logger','moment'];(function(_0x580380,_0x4b33bb){var _0x4d4bdf=function(_0x106a19){while(--_0x106a19){_0x580380['push'](_0x580380['shift']());}};_0x4d4bdf(++_0x4b33bb);}(_0xc112,0xec));var _0x2c11=function(_0x5c9b16,_0x2bea6b){_0x5c9b16=_0x5c9b16-0x0;var _0x1c518d=_0xc112[_0x5c9b16];return _0x1c518d;};'use strict';var _=require(_0x2c11('0x0'));var util=require(_0x2c11('0x1'));var logger=require(_0x2c11('0x2'))('api');var moment=require(_0x2c11('0x3'));var BPromise=require(_0x2c11('0x4'));var rp=require(_0x2c11('0x5'));var fs=require('fs');var path=require(_0x2c11('0x6'));var rimraf=require(_0x2c11('0x7'));var config=require(_0x2c11('0x8'));var attributes=require(_0x2c11('0x9'));module[_0x2c11('0xa')]=function(_0x2337d0,_0x5c4748){return _0x2337d0['define'](_0x2c11('0xb'),attributes,{'tableName':_0x2c11('0xc'),'paranoid':![],'indexes':[{'name':_0x2c11('0xd'),'fields':[_0x2c11('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7035=['ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x53a158,_0x429e09){var _0x24af61=function(_0x5645ed){while(--_0x5645ed){_0x53a158['push'](_0x53a158['shift']());}};_0x24af61(++_0x429e09);}(_0x7035,0x15e));var _0x5703=function(_0x446b26,_0x1a4729){_0x446b26=_0x446b26-0x0;var _0x3e4896=_0x7035[_0x446b26];return _0x3e4896;};'use strict';var _=require(_0x5703('0x0'));var util=require('util');var logger=require(_0x5703('0x1'))(_0x5703('0x2'));var moment=require('moment');var BPromise=require(_0x5703('0x3'));var rp=require(_0x5703('0x4'));var fs=require('fs');var path=require(_0x5703('0x5'));var rimraf=require(_0x5703('0x6'));var config=require(_0x5703('0x7'));var attributes=require('./intZendeskField.attributes');module[_0x5703('0x8')]=function(_0x3fd6a6,_0x56df6c){return _0x3fd6a6[_0x5703('0x9')](_0x5703('0xa'),attributes,{'tableName':_0x5703('0xb'),'paranoid':![],'indexes':[{'name':_0x5703('0xc'),'fields':[_0x5703('0xd'),_0x5703('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 955ccdf..b2fb29c 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 _0x9428=['request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','jayson/promise','client'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x9428,0x123));var _0x8942=function(_0xc82d1a,_0x145c50){_0xc82d1a=_0xc82d1a-0x0;var _0x32fad2=_0x9428[_0xc82d1a];return _0x32fad2;};'use strict';var _=require(_0x8942('0x0'));var util=require(_0x8942('0x1'));var moment=require(_0x8942('0x2'));var BPromise=require(_0x8942('0x3'));var rs=require(_0x8942('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8942('0x5'))(_0x8942('0x6'));var config=require('../../config/environment');var jayson=require(_0x8942('0x7'));var client=jayson[_0x8942('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x6f8cbd,_0x4fc9f0,_0x557f24){return new BPromise(function(_0x542ab6,_0x4765ba){return client[_0x8942('0x9')](_0x6f8cbd,_0x557f24)[_0x8942('0xa')](function(_0x2a76b8){logger[_0x8942('0xb')](_0x8942('0xc'),_0x4fc9f0,_0x8942('0xd'));logger['debug'](_0x8942('0xe'),_0x4fc9f0,'request\x20sent',JSON[_0x8942('0xf')](_0x2a76b8));if(_0x2a76b8['error']){if(_0x2a76b8['error']['code']===0x1f4){logger['error'](_0x8942('0xc'),_0x4fc9f0,_0x2a76b8[_0x8942('0x10')][_0x8942('0x11')]);return _0x4765ba(_0x2a76b8[_0x8942('0x10')][_0x8942('0x11')]);}logger[_0x8942('0x10')](_0x8942('0xc'),_0x4fc9f0,_0x2a76b8[_0x8942('0x10')]['message']);return _0x542ab6(_0x2a76b8[_0x8942('0x10')][_0x8942('0x11')]);}else{logger[_0x8942('0xb')](_0x8942('0xc'),_0x4fc9f0,_0x8942('0xd'));_0x542ab6(_0x2a76b8[_0x8942('0x12')]['message']);}})[_0x8942('0x13')](function(_0x52ff79){logger[_0x8942('0x10')](_0x8942('0xc'),_0x4fc9f0,_0x52ff79);_0x4765ba(_0x52ff79);});});} \ No newline at end of file +var _0x8bff=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment'];(function(_0x321cb9,_0x1c3579){var _0x59c6bf=function(_0xfcaaf8){while(--_0xfcaaf8){_0x321cb9['push'](_0x321cb9['shift']());}};_0x59c6bf(++_0x1c3579);}(_0x8bff,0x1cb));var _0xf8bf=function(_0x28bca2,_0x2ab2c8){_0x28bca2=_0x28bca2-0x0;var _0x9c60d2=_0x8bff[_0x28bca2];return _0x9c60d2;};'use strict';var _=require(_0xf8bf('0x0'));var util=require(_0xf8bf('0x1'));var moment=require(_0xf8bf('0x2'));var BPromise=require(_0xf8bf('0x3'));var rs=require(_0xf8bf('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf8bf('0x5'))['db'];var utils=require(_0xf8bf('0x6'));var logger=require(_0xf8bf('0x7'))(_0xf8bf('0x8'));var config=require(_0xf8bf('0x9'));var jayson=require(_0xf8bf('0xa'));var client=jayson[_0xf8bf('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb81139,_0x5ed511,_0x33d559){return new BPromise(function(_0x2b1534,_0x30aa18){return client[_0xf8bf('0xc')](_0xb81139,_0x33d559)[_0xf8bf('0xd')](function(_0x1e1fad){logger['info'](_0xf8bf('0xe'),_0x5ed511,_0xf8bf('0xf'));logger[_0xf8bf('0x10')](_0xf8bf('0x11'),_0x5ed511,'request\x20sent',JSON['stringify'](_0x1e1fad));if(_0x1e1fad['error']){if(_0x1e1fad[_0xf8bf('0x12')][_0xf8bf('0x13')]===0x1f4){logger[_0xf8bf('0x12')]('ZendeskField,\x20%s,\x20%s',_0x5ed511,_0x1e1fad[_0xf8bf('0x12')][_0xf8bf('0x14')]);return _0x30aa18(_0x1e1fad[_0xf8bf('0x12')][_0xf8bf('0x14')]);}logger[_0xf8bf('0x12')](_0xf8bf('0xe'),_0x5ed511,_0x1e1fad[_0xf8bf('0x12')][_0xf8bf('0x14')]);return _0x2b1534(_0x1e1fad[_0xf8bf('0x12')]['message']);}else{logger['info']('ZendeskField,\x20%s,\x20%s',_0x5ed511,_0xf8bf('0xf'));_0x2b1534(_0x1e1fad[_0xf8bf('0x15')][_0xf8bf('0x14')]);}})['catch'](function(_0x489b0e){logger[_0xf8bf('0x12')](_0xf8bf('0xe'),_0x5ed511,_0x489b0e);_0x30aa18(_0x489b0e);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index ebb7512..3577edd 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 _0x65b3=['express','Router','../../components/auth/service','../../components/interaction/service','./intZohoAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','/:id/fields','post','create','addConfiguration','put','update','delete','destroy','exports','path','connect-timeout'];(function(_0x3395ed,_0x4dfcc7){var _0x21cb65=function(_0x3a056a){while(--_0x3a056a){_0x3395ed['push'](_0x3395ed['shift']());}};_0x21cb65(++_0x4dfcc7);}(_0x65b3,0xc4));var _0x365b=function(_0x1aed80,_0x3ca6f6){_0x1aed80=_0x1aed80-0x0;var _0x43961e=_0x65b3[_0x1aed80];return _0x43961e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x365b('0x0'));var timeout=require(_0x365b('0x1'));var express=require(_0x365b('0x2'));var router=express[_0x365b('0x3')]();var auth=require(_0x365b('0x4'));var interaction=require(_0x365b('0x5'));var config=require('../../config/environment');var controller=require(_0x365b('0x6'));router[_0x365b('0x7')]('/',auth['isAuthenticated'](),controller[_0x365b('0x8')]);router[_0x365b('0x7')](_0x365b('0x9'),auth[_0x365b('0xa')](),controller[_0x365b('0xb')]);router['get'](_0x365b('0xc'),auth[_0x365b('0xa')](),controller['getConfigurations']);router['get'](_0x365b('0xd'),auth[_0x365b('0xa')](),controller['getFields']);router[_0x365b('0xe')]('/',auth[_0x365b('0xa')](),controller[_0x365b('0xf')]);router[_0x365b('0xe')](_0x365b('0xc'),auth[_0x365b('0xa')](),controller[_0x365b('0x10')]);router[_0x365b('0x11')]('/:id',auth[_0x365b('0xa')](),controller[_0x365b('0x12')]);router[_0x365b('0x13')]('/:id',auth[_0x365b('0xa')](),controller[_0x365b('0x14')]);module[_0x365b('0x15')]=router; \ No newline at end of file +var _0x7984=['../../config/environment','./intZohoAccount.controller','get','/:id','show','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','destroy','multer','util','express','Router','../../components/interaction/service'];(function(_0x175af5,_0x338fb7){var _0x5043ed=function(_0x1ab87c){while(--_0x1ab87c){_0x175af5['push'](_0x175af5['shift']());}};_0x5043ed(++_0x338fb7);}(_0x7984,0x10c));var _0x4798=function(_0x44ee26,_0x2345f5){_0x44ee26=_0x44ee26-0x0;var _0x4ea269=_0x7984[_0x44ee26];return _0x4ea269;};'use strict';var multer=require(_0x4798('0x0'));var util=require(_0x4798('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4798('0x2'));var router=express[_0x4798('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x4798('0x4'));var config=require(_0x4798('0x5'));var controller=require(_0x4798('0x6'));router[_0x4798('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4798('0x7')](_0x4798('0x8'),auth['isAuthenticated'](),controller[_0x4798('0x9')]);router[_0x4798('0x7')](_0x4798('0xa'),auth[_0x4798('0xb')](),controller[_0x4798('0xc')]);router[_0x4798('0x7')](_0x4798('0xd'),auth[_0x4798('0xb')](),controller[_0x4798('0xe')]);router[_0x4798('0xf')]('/',auth[_0x4798('0xb')](),controller[_0x4798('0x10')]);router[_0x4798('0xf')](_0x4798('0xa'),auth['isAuthenticated'](),controller[_0x4798('0x11')]);router[_0x4798('0x12')](_0x4798('0x8'),auth[_0x4798('0xb')](),controller[_0x4798('0x13')]);router['delete'](_0x4798('0x8'),auth['isAuthenticated'](),controller[_0x4798('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 69c25c0..ec8f4b0 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 _0x28c8=['exports','STRING','sequelize'];(function(_0x2cfc89,_0x216cb8){var _0x389fa0=function(_0xe86069){while(--_0xe86069){_0x2cfc89['push'](_0x2cfc89['shift']());}};_0x389fa0(++_0x216cb8);}(_0x28c8,0x8f));var _0x828c=function(_0xb99421,_0xaab133){_0xb99421=_0xb99421-0x0;var _0x4b3ec7=_0x28c8[_0xb99421];return _0x4b3ec7;};'use strict';var Sequelize=require(_0x828c('0x0'));module[_0x828c('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x828c('0x2')]},'host':{'type':Sequelize[_0x828c('0x2')]},'zone':{'type':Sequelize[_0x828c('0x2')]},'clientId':{'type':Sequelize[_0x828c('0x2')]},'clientSecret':{'type':Sequelize[_0x828c('0x2')]},'serverUrl':{'type':Sequelize['STRING']},'code':{'type':Sequelize[_0x828c('0x2')]},'refreshToken':{'type':Sequelize[_0x828c('0x2')]}}; \ No newline at end of file +var _0x6a12=['STRING','sequelize','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6a12,0xbb));var _0x26a1=function(_0x10ee32,_0x5d6eb2){_0x10ee32=_0x10ee32-0x0;var _0x510ca7=_0x6a12[_0x10ee32];return _0x510ca7;};'use strict';var Sequelize=require(_0x26a1('0x0'));module[_0x26a1('0x1')]={'name':{'type':Sequelize[_0x26a1('0x2')]},'description':{'type':Sequelize[_0x26a1('0x2')]},'host':{'type':Sequelize[_0x26a1('0x2')]},'zone':{'type':Sequelize[_0x26a1('0x2')]},'clientId':{'type':Sequelize[_0x26a1('0x2')]},'clientSecret':{'type':Sequelize[_0x26a1('0x2')]},'serverUrl':{'type':Sequelize[_0x26a1('0x2')]},'code':{'type':Sequelize[_0x26a1('0x2')]},'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 b534bd5..7896eb3 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 _0x692c=['apply','reject','update','destroy','end','name','map','rawAttributes','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','ZohoAccount','includeAll','include','findAll','rows','show','params','length','find','catch','create','body','getConfigurations','ZohoConfiguration','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','type','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','clientSecret','host','zoho.eu','com','serverUrl','lastIndexOf','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','Owner','Subject','Description','WhoId','Call_Result','Call_Start_Time','Call_Type','remove','includes','system_mandatory','push','display_label','data_type','pick_list_values','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','http','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~!@#$%^&-_=+[{]}.','request','then','ZohoAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','sendStatus','status','json','count','offset','limit','Content-Range'];(function(_0x3a5d2f,_0x3d5590){var _0x107045=function(_0x426a9c){while(--_0x426a9c){_0x3a5d2f['push'](_0x3a5d2f['shift']());}};_0x107045(++_0x3d5590);}(_0x692c,0x166));var _0xc692=function(_0x5959d9,_0x2b69d2){_0x5959d9=_0x5959d9-0x0;var _0x2fc87c=_0x692c[_0x5959d9];return _0x2fc87c;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xc692('0x0'));var zipdir=require(_0xc692('0x1'));var jsonpatch=require(_0xc692('0x2'));var rp=require(_0xc692('0x3'));var moment=require(_0xc692('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc692('0x5'));var util=require(_0xc692('0x6'));var path=require(_0xc692('0x7'));var sox=require(_0xc692('0x8'));var csv=require('to-csv');var ejs=require(_0xc692('0x9'));var fs=require('fs');var _=require(_0xc692('0xa'));var squel=require(_0xc692('0xb'));var crypto=require(_0xc692('0xc'));var jsforce=require(_0xc692('0xd'));var deskjs=require(_0xc692('0xe'));var toCsv=require(_0xc692('0xf'));var querystring=require(_0xc692('0x10'));var Papa=require(_0xc692('0x11'));var Redis=require(_0xc692('0x12'));var authService=require(_0xc692('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc692('0x14'));var logger=require(_0xc692('0x15'))(_0xc692('0x16'));var utils=require(_0xc692('0x17'));var config=require(_0xc692('0x18'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xc692('0x19'));var client=jayson['client'][_0xc692('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x5f1bb2,_0x2358b8,_0x4e2bd9){if(_0x4e2bd9){var _0xa53fc1=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xa53fc1[_0xc692('0x1b')](_0x2358b8)){return _0x5f1bb2;}else{throw new db[(_0xc692('0x1c'))]['ValidationError'](_0xc692('0x1d'));}}else{return _0x5f1bb2;}}function respondWithRpcPromise(_0x386300,_0xdda013,_0x4c0c1e,_0x3cc782){return new BPromise(function(_0xc2dc5c,_0x36e0b1){var _0x286e24=_0x3cc782||client;return _0x286e24[_0xc692('0x1e')](_0x386300,_0x4c0c1e)[_0xc692('0x1f')](function(_0x453df9){logger['info'](_0xc692('0x20'),_0xdda013,_0xc692('0x21'));logger['debug']('ZohoAccount,\x20%s,\x20%s,\x20%s',_0xdda013,_0xc692('0x21'),JSON[_0xc692('0x22')](_0x453df9));if(_0x453df9[_0xc692('0x23')]){if(_0x453df9[_0xc692('0x23')][_0xc692('0x24')]===0x1f4){logger[_0xc692('0x23')]('ZohoAccount,\x20%s,\x20%s',_0xdda013,_0x453df9['error'][_0xc692('0x25')]);return _0x36e0b1(_0x453df9[_0xc692('0x23')][_0xc692('0x25')]);}logger[_0xc692('0x23')](_0xc692('0x20'),_0xdda013,_0x453df9[_0xc692('0x23')][_0xc692('0x25')]);return _0xc2dc5c(_0x453df9[_0xc692('0x23')][_0xc692('0x25')]);}else{logger[_0xc692('0x26')](_0xc692('0x20'),_0xdda013,_0xc692('0x21'));_0xc2dc5c(_0x453df9[_0xc692('0x27')][_0xc692('0x25')]);}})['catch'](function(_0x4680f4){logger['error'](_0xc692('0x20'),_0xdda013,_0x4680f4);_0x36e0b1(_0x4680f4);});});}function respondWithStatusCode(_0x24154d,_0xe70961){_0xe70961=_0xe70961||0xcc;return function(_0xd6fd1c){if(_0xd6fd1c){return _0x24154d[_0xc692('0x28')](_0xe70961);}return _0x24154d[_0xc692('0x29')](_0xe70961)['end']();};}function respondWithResult(_0x590b41,_0xa7c2c4){_0xa7c2c4=_0xa7c2c4||0xc8;return function(_0x510b30){if(_0x510b30){return _0x590b41[_0xc692('0x29')](_0xa7c2c4)[_0xc692('0x2a')](_0x510b30);}};}function respondWithFilteredResult(_0x168d5c,_0x81b36){return function(_0x6a16f6){if(_0x6a16f6){var _0x2f4ba9=_0x6a16f6[_0xc692('0x2b')],_0x45f6d0=_0x81b36[_0xc692('0x2c')],_0x283c51=_0x81b36['offset']+_0x81b36[_0xc692('0x2d')],_0x3b37cb;if(_0x283c51>=_0x2f4ba9){_0x283c51=_0x2f4ba9;_0x3b37cb=0xc8;}else{_0x3b37cb=0xce;}_0x168d5c[_0xc692('0x29')](_0x3b37cb);return _0x168d5c['set'](_0xc692('0x2e'),_0x45f6d0+'-'+_0x283c51+'/'+_0x2f4ba9)[_0xc692('0x2a')](_0x6a16f6);}return null;};}function patchUpdates(_0x43c5a5){return function(_0x30f173){try{jsonpatch[_0xc692('0x2f')](_0x30f173,_0x43c5a5,!![]);}catch(_0x2caae0){return BPromise[_0xc692('0x30')](_0x2caae0);}return _0x30f173['save']();};}function saveUpdates(_0x7606c8,_0x239d9a){return function(_0x3d1dee){if(_0x3d1dee){return _0x3d1dee[_0xc692('0x31')](_0x7606c8)[_0xc692('0x1f')](function(_0x3c9992){return _0x3c9992;});}return null;};}function removeEntity(_0x18ce47,_0x1cf4e9){return function(_0x365ca7){if(_0x365ca7){return _0x365ca7[_0xc692('0x32')]()['then'](function(){_0x18ce47[_0xc692('0x29')](0xcc)[_0xc692('0x33')]();});}};}function handleEntityNotFound(_0x44fcee,_0x4ce050){return function(_0x5048ab){if(!_0x5048ab){_0x44fcee['sendStatus'](0x194);}return _0x5048ab;};}function handleError(_0x558178,_0x4bc2ab){_0x4bc2ab=_0x4bc2ab||0x1f4;return function(_0x4b1296){logger[_0xc692('0x23')](_0x4b1296['stack']);if(_0x4b1296[_0xc692('0x34')]){delete _0x4b1296['name'];}_0x558178[_0xc692('0x29')](_0x4bc2ab)['send'](_0x4b1296);};}exports['index']=function(_0x48b2f0,_0x18ef88){var _0x1faded={},_0xab5720={},_0x12dd57={'count':0x0,'rows':[]};var _0x3f29cf=_[_0xc692('0x35')](db['ZohoAccount'][_0xc692('0x36')],function(_0x38132){return{'name':_0x38132['fieldName'],'type':_0x38132['type']['key']};});_0xab5720[_0xc692('0x37')]=_[_0xc692('0x35')](_0x3f29cf,'name');_0xab5720[_0xc692('0x38')]=_[_0xc692('0x39')](_0x48b2f0[_0xc692('0x38')]);_0xab5720[_0xc692('0x3a')]=_[_0xc692('0x3b')](_0xab5720[_0xc692('0x37')],_0xab5720[_0xc692('0x38')]);_0x1faded[_0xc692('0x3c')]=_[_0xc692('0x3b')](_0xab5720[_0xc692('0x37')],qs['fields'](_0x48b2f0[_0xc692('0x38')][_0xc692('0x3d')]));_0x1faded[_0xc692('0x3c')]=_0x1faded['attributes']['length']?_0x1faded[_0xc692('0x3c')]:_0xab5720['model'];if(!_0x48b2f0[_0xc692('0x38')][_0xc692('0x3e')](_0xc692('0x3f'))){_0x1faded[_0xc692('0x2d')]=qs[_0xc692('0x2d')](_0x48b2f0[_0xc692('0x38')][_0xc692('0x2d')]);_0x1faded[_0xc692('0x2c')]=qs[_0xc692('0x2c')](_0x48b2f0['query'][_0xc692('0x2c')]);}_0x1faded[_0xc692('0x40')]=qs[_0xc692('0x41')](_0x48b2f0[_0xc692('0x38')][_0xc692('0x41')]);_0x1faded['where']=qs[_0xc692('0x3a')](_[_0xc692('0x42')](_0x48b2f0[_0xc692('0x38')],_0xab5720['filters']));if(_0x48b2f0[_0xc692('0x38')][_0xc692('0x43')]){_0x1faded[_0xc692('0x44')]=_[_0xc692('0x45')](_0x1faded['where'],{'$or':_['map'](_0x3f29cf,function(_0x442cb0){if(_0x442cb0['type']!==_0xc692('0x46')){var _0x2de50f={};_0x2de50f[_0x442cb0[_0xc692('0x34')]]={'$like':'%'+_0x48b2f0[_0xc692('0x38')]['filter']+'%'};return _0x2de50f;}})});}_0x1faded=_[_0xc692('0x45')]({},_0x1faded,_0x48b2f0[_0xc692('0x47')]);var _0x175cd1={'where':_0x1faded['where']};return db[_0xc692('0x48')]['count'](_0x175cd1)[_0xc692('0x1f')](function(_0x3a8de8){_0x12dd57['count']=_0x3a8de8;if(_0x48b2f0[_0xc692('0x38')][_0xc692('0x49')]){_0x1faded[_0xc692('0x4a')]=[{'all':!![]}];}return db[_0xc692('0x48')][_0xc692('0x4b')](_0x1faded);})[_0xc692('0x1f')](function(_0x425871){_0x12dd57[_0xc692('0x4c')]=_0x425871;return _0x12dd57;})[_0xc692('0x1f')](respondWithFilteredResult(_0x18ef88,_0x1faded))['catch'](handleError(_0x18ef88,null));};exports[_0xc692('0x4d')]=function(_0x2f393e,_0xa5edb0){var _0x42cece={'raw':![],'where':{'id':_0x2f393e[_0xc692('0x4e')]['id']}},_0x2dc528={};_0x2dc528[_0xc692('0x37')]=_[_0xc692('0x39')](db['ZohoAccount'][_0xc692('0x36')]);_0x2dc528[_0xc692('0x38')]=_[_0xc692('0x39')](_0x2f393e['query']);_0x2dc528[_0xc692('0x3a')]=_['intersection'](_0x2dc528[_0xc692('0x37')],_0x2dc528[_0xc692('0x38')]);_0x42cece['attributes']=_['intersection'](_0x2dc528['model'],qs[_0xc692('0x3d')](_0x2f393e[_0xc692('0x38')][_0xc692('0x3d')]));_0x42cece['attributes']=_0x42cece[_0xc692('0x3c')][_0xc692('0x4f')]?_0x42cece[_0xc692('0x3c')]:_0x2dc528['model'];if(_0x2f393e[_0xc692('0x38')][_0xc692('0x49')]){_0x42cece[_0xc692('0x4a')]=[{'all':!![]}];}_0x42cece=_[_0xc692('0x45')]({},_0x42cece,_0x2f393e[_0xc692('0x47')]);return db[_0xc692('0x48')][_0xc692('0x50')](_0x42cece)[_0xc692('0x1f')](handleEntityNotFound(_0xa5edb0,null))['then'](respondWithResult(_0xa5edb0,null))[_0xc692('0x51')](handleError(_0xa5edb0,null));};exports[_0xc692('0x52')]=function(_0x8444b1,_0x47dba3){return db[_0xc692('0x48')][_0xc692('0x52')](_0x8444b1[_0xc692('0x53')],{})[_0xc692('0x1f')](respondWithResult(_0x47dba3,0xc9))[_0xc692('0x51')](handleError(_0x47dba3,null));};exports[_0xc692('0x31')]=function(_0x117774,_0x3ed8ba){if(_0x117774[_0xc692('0x53')]['id']){delete _0x117774[_0xc692('0x53')]['id'];}return db[_0xc692('0x48')]['find']({'where':{'id':_0x117774[_0xc692('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3ed8ba,null))[_0xc692('0x1f')](saveUpdates(_0x117774[_0xc692('0x53')],null))[_0xc692('0x1f')](respondWithResult(_0x3ed8ba,null))[_0xc692('0x51')](handleError(_0x3ed8ba,null));};exports[_0xc692('0x32')]=function(_0x50e04d,_0x19b9a3){return db[_0xc692('0x48')][_0xc692('0x50')]({'where':{'id':_0x50e04d[_0xc692('0x4e')]['id']}})[_0xc692('0x1f')](handleEntityNotFound(_0x19b9a3,null))['then'](removeEntity(_0x19b9a3,null))[_0xc692('0x51')](handleError(_0x19b9a3,null));};exports[_0xc692('0x54')]=function(_0x52cc8d,_0x12527d,_0x106117){var _0x6876a0={};var _0x29fccf={};var _0x3947ad;var _0x186c99;return db[_0xc692('0x48')]['findOne']({'where':{'id':_0x52cc8d[_0xc692('0x4e')]['id']}})[_0xc692('0x1f')](handleEntityNotFound(_0x12527d,null))['then'](function(_0x456f54){if(_0x456f54){_0x3947ad=_0x456f54;_0x29fccf[_0xc692('0x37')]=_['keys'](db[_0xc692('0x55')][_0xc692('0x36')]);_0x29fccf[_0xc692('0x38')]=_[_0xc692('0x39')](_0x52cc8d[_0xc692('0x38')]);_0x29fccf[_0xc692('0x3a')]=_[_0xc692('0x3b')](_0x29fccf[_0xc692('0x37')],_0x29fccf[_0xc692('0x38')]);_0x6876a0['attributes']=_[_0xc692('0x3b')](_0x29fccf['model'],qs[_0xc692('0x3d')](_0x52cc8d[_0xc692('0x38')][_0xc692('0x3d')]));_0x6876a0['attributes']=_0x6876a0['attributes'][_0xc692('0x4f')]?_0x6876a0[_0xc692('0x3c')]:_0x29fccf[_0xc692('0x37')];_0x6876a0[_0xc692('0x40')]=qs[_0xc692('0x41')](_0x52cc8d[_0xc692('0x38')][_0xc692('0x41')]);_0x6876a0[_0xc692('0x44')]=qs[_0xc692('0x3a')](_[_0xc692('0x42')](_0x52cc8d[_0xc692('0x38')],_0x29fccf[_0xc692('0x3a')]));if(_0x52cc8d[_0xc692('0x38')][_0xc692('0x43')]){_0x6876a0['where']=_[_0xc692('0x45')](_0x6876a0[_0xc692('0x44')],{'$or':_[_0xc692('0x35')](_0x6876a0[_0xc692('0x3c')],function(_0x274035){var _0x5520e0={};_0x5520e0[_0x274035]={'$like':'%'+_0x52cc8d['query']['filter']+'%'};return _0x5520e0;})});}_0x6876a0=_[_0xc692('0x45')]({},_0x6876a0,_0x52cc8d[_0xc692('0x47')]);return _0x3947ad[_0xc692('0x54')](_0x6876a0);}})['then'](function(_0x784307){if(_0x784307){_0x186c99=_0x784307[_0xc692('0x4f')];if(!_0x52cc8d[_0xc692('0x38')][_0xc692('0x3e')](_0xc692('0x3f'))){_0x6876a0[_0xc692('0x2d')]=qs['limit'](_0x52cc8d[_0xc692('0x38')][_0xc692('0x2d')]);_0x6876a0[_0xc692('0x2c')]=qs[_0xc692('0x2c')](_0x52cc8d['query']['offset']);}return _0x3947ad[_0xc692('0x54')](_0x6876a0);}})['then'](function(_0x4224ee){if(_0x4224ee){return _0x4224ee?{'count':_0x186c99,'rows':_0x4224ee}:null;}})[_0xc692('0x1f')](respondWithResult(_0x12527d,null))['catch'](handleError(_0x12527d,null));};exports[_0xc692('0x56')]=function(_0x53a090,_0x28a34f,_0x5b242e){if(_0x53a090[_0xc692('0x53')]['id']){delete _0x53a090['body']['id'];}return db[_0xc692('0x48')][_0xc692('0x57')]({'where':{'id':_0x53a090['params']['id']}})['then'](handleEntityNotFound(_0x28a34f,null))['then'](function(_0x3a8ed4){if(_0x3a8ed4){_0x53a090[_0xc692('0x53')][_0xc692('0x58')]=_0x3a8ed4['id'];_0x53a090[_0xc692('0x53')][_0xc692('0x59')]=integrations[_0xc692('0x5a')](_0x53a090[_0xc692('0x53')][_0xc692('0x5b')],_0x53a090['body'][_0xc692('0x5c')]);_0x53a090[_0xc692('0x53')][_0xc692('0x5d')]=integrations[_0xc692('0x5e')](_0x53a090['body']['channel'],_0x53a090[_0xc692('0x53')]['type']);return db[_0xc692('0x55')]['create'](_0x53a090[_0xc692('0x53')],{'include':[{'model':db[_0xc692('0x5f')],'as':'Subjects'},{'model':db[_0xc692('0x5f')],'as':_0xc692('0x5d')}]});}return null;})[_0xc692('0x1f')](respondWithResult(_0x28a34f,null))[_0xc692('0x51')](handleError(_0x28a34f,null));};function getAccessToken(_0x49da1e){return new Promise(function(_0x192dc4,_0x1b86fa){var _0x357ab1;switch(_0x49da1e[_0xc692('0x60')]){case'US':_0x357ab1=_0xc692('0x61');break;case'AU':_0x357ab1=_0xc692('0x62');break;case'EU':_0x357ab1='https://accounts.zoho.eu';break;case'IN':_0x357ab1=_0xc692('0x63');break;case'CN':_0x357ab1=_0xc692('0x64');break;default:_0x357ab1='https://accounts.zoho.eu';break;}var _0x3228a2={'method':_0xc692('0x65'),'uri':_0x357ab1+_0xc692('0x66'),'qs':{'refresh_token':_0x49da1e[_0xc692('0x67')],'client_id':_0x49da1e[_0xc692('0x68')],'client_secret':_0x49da1e['clientSecret'],'grant_type':'refresh_token'},'json':!![]};return rp(_0x3228a2)[_0xc692('0x1f')](function(_0x4fdc70){if(_0x4fdc70['access_token']){_0x192dc4(_0x4fdc70[_0xc692('0x69')]);}else{_0x1b86fa(_0xc692('0x6a'));}})['catch'](function(_0x56ccba){_0x1b86fa(_0x56ccba);});});}exports[_0xc692('0x6b')]=function(_0x4c207c,_0x1c6d68,_0x2f658f){var _0x43b00b,_0x41ed64,_0x5a5301,_0x1c7648,_0x47f91b;return db['ZohoAccount'][_0xc692('0x57')]({'where':{'id':_0x4c207c['params']['id']},'attributes':['id','host','zone',_0xc692('0x68'),_0xc692('0x6c'),'serverUrl','code',_0xc692('0x67')]})['then'](handleEntityNotFound(_0x1c6d68,null))[_0xc692('0x1f')](function(_0x1eaa9f){_0x47f91b=_0x1eaa9f;_0x43b00b=_0x47f91b[_0xc692('0x6d')];_0x41ed64=_0x43b00b===_0xc692('0x6e')?'eu':_0xc692('0x6f');_0x5a5301=_0x47f91b[_0xc692('0x70')];var _0xd723a6=_0x5a5301['slice'](-0x1);if(_0xd723a6==='/'||_0xd723a6==='\x5c'||_0xd723a6===':'){_0x5a5301=_0x5a5301['substring'](0x0,_0x5a5301[_0xc692('0x71')](_0xd723a6));}if(!_0x47f91b[_0xc692('0x67')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x47f91b);})['then'](function(_0xde3a6){if(_0xde3a6){return rp({'method':'GET','uri':util['format'](_0xc692('0x72'),_0x41ed64),'qs':{'module':_0xc692('0x73')},'headers':{'Authorization':_0xc692('0x74')+_0xde3a6},'json':!![]});}})[_0xc692('0x1f')](function(_0x57b8eb){if(_0x57b8eb){if(_0x57b8eb['response']&&_0x57b8eb[_0xc692('0x75')]['error']){throw new Error(_0x57b8eb['response']['error']['message']);}var _0x27542f=[];var _0x3bf802=[];var _0x4e4364=[_0xc692('0x76'),_0xc692('0x77'),_0xc692('0x78'),_0xc692('0x79'),'Call_Duration',_0xc692('0x7a'),_0xc692('0x7b'),_0xc692('0x7c')];_0x3bf802=_[_0xc692('0x7d')](_0x57b8eb['fields'],function(_0x7d29a6){return _0x4e4364[_0xc692('0x7e')](_0x7d29a6['api_name']);});for(var _0x3ab0ab=0x0;_0x3ab0ab<_0x3bf802['length'];_0x3ab0ab++){if(_0x3bf802[_0x3ab0ab][_0xc692('0x7f')]===![]){_0x27542f[_0xc692('0x80')]({'id':_0x3bf802[_0x3ab0ab]['id'],'name':_0x3bf802[_0x3ab0ab][_0xc692('0x81')],'custom':_0x3bf802[_0x3ab0ab]['custom_field'],'options':_0x3bf802[_0x3ab0ab][_0xc692('0x82')]==='picklist'&&_0x3bf802[_0x3ab0ab][_0xc692('0x83')][_0xc692('0x4f')]>-0x1?_['map'](_0x3bf802[_0x3ab0ab][_0xc692('0x83')],function(_0xe3251){return{'name':_0xe3251,'value':_0xe3251};}):[]});}}return{'count':_0x27542f[_0xc692('0x4f')],'rows':_0x27542f};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x1c6d68,null))[_0xc692('0x51')](function(_0xf90a11){var _0x107113=_0x4c207c[_0xc692('0x38')][_0xc692('0x1b')]?0x1f4:_0xf90a11['statusCode']||0x1f4;logger[_0xc692('0x23')](_0xc692('0x84'),_0xc692('0x6b'),_0x107113,JSON[_0xc692('0x22')](_0xf90a11));delete _0xf90a11[_0xc692('0x34')];if(_0x107113===0x191){_0x107113=0x190;}_0x1c6d68[_0xc692('0x29')](_0x107113)[_0xc692('0x85')](_0x4c207c['query'][_0xc692('0x1b')]?{'message':_0xc692('0x86'),'statusCode':_0xf90a11['statusCode']}:_0xf90a11);});}; \ No newline at end of file +var _0xb84b=['Descriptions','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','getFields','host','serverUrl','zoho.eu','com','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','Owner','Description','WhoId','Call_Duration','Call_Result','Call_Type','remove','api_name','push','display_label','custom_field','data_type','pick_list_values','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','util','to-csv','ejs','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','test','Sequelize','ValidationError','request','then','info','request\x20sent','debug','stringify','error','ZohoAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','save','update','destroy','end','stack','name','send','index','map','ZohoAccount','rawAttributes','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','include','findAll','rows','show','params','find','create','body','getConfigurations','findOne','ZohoConfiguration','AccountId','Subjects','channel'];(function(_0x20f050,_0x4bc6ee){var _0x120f93=function(_0x50c80c){while(--_0x50c80c){_0x20f050['push'](_0x20f050['shift']());}};_0x120f93(++_0x4bc6ee);}(_0xb84b,0x1a2));var _0xbb84=function(_0x29b2ee,_0x4c5f1e){_0x29b2ee=_0x29b2ee-0x0;var _0x517e6c=_0xb84b[_0x29b2ee];return _0x517e6c;};'use strict';var pdf=require(_0xbb84('0x0'));var emlformat=require(_0xbb84('0x1'));var rimraf=require(_0xbb84('0x2'));var zipdir=require(_0xbb84('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbb84('0x4'));var moment=require(_0xbb84('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbb84('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xbb84('0x7'));var ejs=require(_0xbb84('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xbb84('0x9'));var crypto=require('crypto');var jsforce=require(_0xbb84('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xbb84('0x7'));var querystring=require(_0xbb84('0xb'));var Papa=require('papaparse');var Redis=require(_0xbb84('0xc'));var authService=require(_0xbb84('0xd'));var qs=require(_0xbb84('0xe'));var as=require(_0xbb84('0xf'));var hardwareService=require(_0xbb84('0x10'));var logger=require(_0xbb84('0x11'))('api');var utils=require(_0xbb84('0x12'));var config=require('../../config/environment');var db=require(_0xbb84('0x13'))['db'];var integrations=require(_0xbb84('0x14'));var jayson=require(_0xbb84('0x15'));var client=jayson[_0xbb84('0x16')]['http']({'port':0x232a});function checkPasswordPattern(_0x477119,_0x4bcb36,_0x4abcf6){if(_0x4abcf6){var _0x149c1d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x149c1d[_0xbb84('0x17')](_0x4bcb36)){return _0x477119;}else{throw new db[(_0xbb84('0x18'))][(_0xbb84('0x19'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x477119;}}function respondWithRpcPromise(_0xaed225,_0x3dea16,_0x41e28b,_0x5427f9){return new BPromise(function(_0x309aea,_0x330171){var _0x4beba9=_0x5427f9||client;return _0x4beba9[_0xbb84('0x1a')](_0xaed225,_0x41e28b)[_0xbb84('0x1b')](function(_0xd042a4){logger[_0xbb84('0x1c')]('ZohoAccount,\x20%s,\x20%s',_0x3dea16,_0xbb84('0x1d'));logger[_0xbb84('0x1e')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x3dea16,_0xbb84('0x1d'),JSON[_0xbb84('0x1f')](_0xd042a4));if(_0xd042a4['error']){if(_0xd042a4[_0xbb84('0x20')]['code']===0x1f4){logger[_0xbb84('0x20')](_0xbb84('0x21'),_0x3dea16,_0xd042a4[_0xbb84('0x20')]['message']);return _0x330171(_0xd042a4['error'][_0xbb84('0x22')]);}logger[_0xbb84('0x20')](_0xbb84('0x21'),_0x3dea16,_0xd042a4[_0xbb84('0x20')][_0xbb84('0x22')]);return _0x309aea(_0xd042a4[_0xbb84('0x20')][_0xbb84('0x22')]);}else{logger[_0xbb84('0x1c')](_0xbb84('0x21'),_0x3dea16,_0xbb84('0x1d'));_0x309aea(_0xd042a4[_0xbb84('0x23')][_0xbb84('0x22')]);}})[_0xbb84('0x24')](function(_0x3f56b0){logger[_0xbb84('0x20')](_0xbb84('0x21'),_0x3dea16,_0x3f56b0);_0x330171(_0x3f56b0);});});}function respondWithStatusCode(_0xffaaef,_0x385261){_0x385261=_0x385261||0xcc;return function(_0x5eb5a4){if(_0x5eb5a4){return _0xffaaef[_0xbb84('0x25')](_0x385261);}return _0xffaaef[_0xbb84('0x26')](_0x385261)['end']();};}function respondWithResult(_0x227627,_0x4a9e62){_0x4a9e62=_0x4a9e62||0xc8;return function(_0x420773){if(_0x420773){return _0x227627['status'](_0x4a9e62)['json'](_0x420773);}};}function respondWithFilteredResult(_0x6c6f4d,_0x39ea42){return function(_0x391723){if(_0x391723){var _0x2f0624=_0x391723[_0xbb84('0x27')],_0x422b0d=_0x39ea42[_0xbb84('0x28')],_0xedfbdf=_0x39ea42['offset']+_0x39ea42[_0xbb84('0x29')],_0x5d7284;if(_0xedfbdf>=_0x2f0624){_0xedfbdf=_0x2f0624;_0x5d7284=0xc8;}else{_0x5d7284=0xce;}_0x6c6f4d[_0xbb84('0x26')](_0x5d7284);return _0x6c6f4d[_0xbb84('0x2a')](_0xbb84('0x2b'),_0x422b0d+'-'+_0xedfbdf+'/'+_0x2f0624)[_0xbb84('0x2c')](_0x391723);}return null;};}function patchUpdates(_0x3545cc){return function(_0x5c105c){try{jsonpatch[_0xbb84('0x2d')](_0x5c105c,_0x3545cc,!![]);}catch(_0x2481bc){return BPromise['reject'](_0x2481bc);}return _0x5c105c[_0xbb84('0x2e')]();};}function saveUpdates(_0x3a2abc,_0x35a81d){return function(_0x32151e){if(_0x32151e){return _0x32151e[_0xbb84('0x2f')](_0x3a2abc)[_0xbb84('0x1b')](function(_0xe9df4e){return _0xe9df4e;});}return null;};}function removeEntity(_0x30d855,_0x51a15b){return function(_0x46d0b5){if(_0x46d0b5){return _0x46d0b5[_0xbb84('0x30')]()[_0xbb84('0x1b')](function(){_0x30d855['status'](0xcc)[_0xbb84('0x31')]();});}};}function handleEntityNotFound(_0x473797,_0x1acb20){return function(_0x34b768){if(!_0x34b768){_0x473797['sendStatus'](0x194);}return _0x34b768;};}function handleError(_0x517efd,_0xf47ab6){_0xf47ab6=_0xf47ab6||0x1f4;return function(_0x3e8667){logger[_0xbb84('0x20')](_0x3e8667[_0xbb84('0x32')]);if(_0x3e8667[_0xbb84('0x33')]){delete _0x3e8667[_0xbb84('0x33')];}_0x517efd[_0xbb84('0x26')](_0xf47ab6)[_0xbb84('0x34')](_0x3e8667);};}exports[_0xbb84('0x35')]=function(_0x1c5ba8,_0x3e289b){var _0x39aa62={},_0x465db2={},_0x21135d={'count':0x0,'rows':[]};var _0x361db0=_[_0xbb84('0x36')](db[_0xbb84('0x37')][_0xbb84('0x38')],function(_0x22550c){return{'name':_0x22550c['fieldName'],'type':_0x22550c['type'][_0xbb84('0x39')]};});_0x465db2[_0xbb84('0x3a')]=_['map'](_0x361db0,'name');_0x465db2['query']=_[_0xbb84('0x3b')](_0x1c5ba8[_0xbb84('0x3c')]);_0x465db2['filters']=_['intersection'](_0x465db2[_0xbb84('0x3a')],_0x465db2[_0xbb84('0x3c')]);_0x39aa62[_0xbb84('0x3d')]=_[_0xbb84('0x3e')](_0x465db2[_0xbb84('0x3a')],qs['fields'](_0x1c5ba8[_0xbb84('0x3c')][_0xbb84('0x3f')]));_0x39aa62[_0xbb84('0x3d')]=_0x39aa62[_0xbb84('0x3d')][_0xbb84('0x40')]?_0x39aa62[_0xbb84('0x3d')]:_0x465db2[_0xbb84('0x3a')];if(!_0x1c5ba8['query'][_0xbb84('0x41')](_0xbb84('0x42'))){_0x39aa62[_0xbb84('0x29')]=qs[_0xbb84('0x29')](_0x1c5ba8[_0xbb84('0x3c')][_0xbb84('0x29')]);_0x39aa62[_0xbb84('0x28')]=qs[_0xbb84('0x28')](_0x1c5ba8[_0xbb84('0x3c')]['offset']);}_0x39aa62[_0xbb84('0x43')]=qs[_0xbb84('0x44')](_0x1c5ba8[_0xbb84('0x3c')]['sort']);_0x39aa62[_0xbb84('0x45')]=qs[_0xbb84('0x46')](_['pick'](_0x1c5ba8[_0xbb84('0x3c')],_0x465db2['filters']));if(_0x1c5ba8['query'][_0xbb84('0x47')]){_0x39aa62[_0xbb84('0x45')]=_[_0xbb84('0x48')](_0x39aa62[_0xbb84('0x45')],{'$or':_[_0xbb84('0x36')](_0x361db0,function(_0x576f06){if(_0x576f06[_0xbb84('0x49')]!==_0xbb84('0x4a')){var _0x2349d8={};_0x2349d8[_0x576f06[_0xbb84('0x33')]]={'$like':'%'+_0x1c5ba8[_0xbb84('0x3c')]['filter']+'%'};return _0x2349d8;}})});}_0x39aa62=_['merge']({},_0x39aa62,_0x1c5ba8[_0xbb84('0x4b')]);var _0x3615e1={'where':_0x39aa62[_0xbb84('0x45')]};return db[_0xbb84('0x37')][_0xbb84('0x27')](_0x3615e1)[_0xbb84('0x1b')](function(_0x28146f){_0x21135d['count']=_0x28146f;if(_0x1c5ba8[_0xbb84('0x3c')]['includeAll']){_0x39aa62[_0xbb84('0x4c')]=[{'all':!![]}];}return db[_0xbb84('0x37')][_0xbb84('0x4d')](_0x39aa62);})[_0xbb84('0x1b')](function(_0x42c680){_0x21135d[_0xbb84('0x4e')]=_0x42c680;return _0x21135d;})[_0xbb84('0x1b')](respondWithFilteredResult(_0x3e289b,_0x39aa62))[_0xbb84('0x24')](handleError(_0x3e289b,null));};exports[_0xbb84('0x4f')]=function(_0x1e6661,_0xdbada0){var _0x150b07={'raw':![],'where':{'id':_0x1e6661[_0xbb84('0x50')]['id']}},_0x1f163e={};_0x1f163e[_0xbb84('0x3a')]=_[_0xbb84('0x3b')](db[_0xbb84('0x37')][_0xbb84('0x38')]);_0x1f163e[_0xbb84('0x3c')]=_[_0xbb84('0x3b')](_0x1e6661[_0xbb84('0x3c')]);_0x1f163e['filters']=_[_0xbb84('0x3e')](_0x1f163e[_0xbb84('0x3a')],_0x1f163e[_0xbb84('0x3c')]);_0x150b07[_0xbb84('0x3d')]=_[_0xbb84('0x3e')](_0x1f163e[_0xbb84('0x3a')],qs['fields'](_0x1e6661[_0xbb84('0x3c')][_0xbb84('0x3f')]));_0x150b07[_0xbb84('0x3d')]=_0x150b07[_0xbb84('0x3d')][_0xbb84('0x40')]?_0x150b07[_0xbb84('0x3d')]:_0x1f163e[_0xbb84('0x3a')];if(_0x1e6661[_0xbb84('0x3c')]['includeAll']){_0x150b07[_0xbb84('0x4c')]=[{'all':!![]}];}_0x150b07=_[_0xbb84('0x48')]({},_0x150b07,_0x1e6661['options']);return db[_0xbb84('0x37')][_0xbb84('0x51')](_0x150b07)[_0xbb84('0x1b')](handleEntityNotFound(_0xdbada0,null))[_0xbb84('0x1b')](respondWithResult(_0xdbada0,null))['catch'](handleError(_0xdbada0,null));};exports[_0xbb84('0x52')]=function(_0x389f54,_0x31b9dc){return db[_0xbb84('0x37')]['create'](_0x389f54[_0xbb84('0x53')],{})[_0xbb84('0x1b')](respondWithResult(_0x31b9dc,0xc9))[_0xbb84('0x24')](handleError(_0x31b9dc,null));};exports[_0xbb84('0x2f')]=function(_0x365fae,_0x363c01){if(_0x365fae[_0xbb84('0x53')]['id']){delete _0x365fae[_0xbb84('0x53')]['id'];}return db[_0xbb84('0x37')]['find']({'where':{'id':_0x365fae[_0xbb84('0x50')]['id']}})['then'](handleEntityNotFound(_0x363c01,null))['then'](saveUpdates(_0x365fae[_0xbb84('0x53')],null))[_0xbb84('0x1b')](respondWithResult(_0x363c01,null))['catch'](handleError(_0x363c01,null));};exports[_0xbb84('0x30')]=function(_0x36bba4,_0x397b21){return db['ZohoAccount'][_0xbb84('0x51')]({'where':{'id':_0x36bba4[_0xbb84('0x50')]['id']}})['then'](handleEntityNotFound(_0x397b21,null))['then'](removeEntity(_0x397b21,null))['catch'](handleError(_0x397b21,null));};exports[_0xbb84('0x54')]=function(_0x23cb5a,_0x27ada4,_0x4483c9){var _0x58f7c9={};var _0xca2365={};var _0x489e26;var _0x421335;return db['ZohoAccount'][_0xbb84('0x55')]({'where':{'id':_0x23cb5a[_0xbb84('0x50')]['id']}})[_0xbb84('0x1b')](handleEntityNotFound(_0x27ada4,null))[_0xbb84('0x1b')](function(_0x5b192f){if(_0x5b192f){_0x489e26=_0x5b192f;_0xca2365['model']=_[_0xbb84('0x3b')](db[_0xbb84('0x56')][_0xbb84('0x38')]);_0xca2365[_0xbb84('0x3c')]=_[_0xbb84('0x3b')](_0x23cb5a[_0xbb84('0x3c')]);_0xca2365['filters']=_['intersection'](_0xca2365[_0xbb84('0x3a')],_0xca2365[_0xbb84('0x3c')]);_0x58f7c9[_0xbb84('0x3d')]=_[_0xbb84('0x3e')](_0xca2365[_0xbb84('0x3a')],qs[_0xbb84('0x3f')](_0x23cb5a['query']['fields']));_0x58f7c9['attributes']=_0x58f7c9['attributes']['length']?_0x58f7c9[_0xbb84('0x3d')]:_0xca2365['model'];_0x58f7c9[_0xbb84('0x43')]=qs[_0xbb84('0x44')](_0x23cb5a[_0xbb84('0x3c')][_0xbb84('0x44')]);_0x58f7c9[_0xbb84('0x45')]=qs[_0xbb84('0x46')](_['pick'](_0x23cb5a[_0xbb84('0x3c')],_0xca2365['filters']));if(_0x23cb5a[_0xbb84('0x3c')][_0xbb84('0x47')]){_0x58f7c9[_0xbb84('0x45')]=_[_0xbb84('0x48')](_0x58f7c9[_0xbb84('0x45')],{'$or':_['map'](_0x58f7c9[_0xbb84('0x3d')],function(_0x35e71c){var _0x4449a0={};_0x4449a0[_0x35e71c]={'$like':'%'+_0x23cb5a[_0xbb84('0x3c')][_0xbb84('0x47')]+'%'};return _0x4449a0;})});}_0x58f7c9=_['merge']({},_0x58f7c9,_0x23cb5a[_0xbb84('0x4b')]);return _0x489e26[_0xbb84('0x54')](_0x58f7c9);}})['then'](function(_0x1af9c1){if(_0x1af9c1){_0x421335=_0x1af9c1[_0xbb84('0x40')];if(!_0x23cb5a[_0xbb84('0x3c')]['hasOwnProperty'](_0xbb84('0x42'))){_0x58f7c9[_0xbb84('0x29')]=qs[_0xbb84('0x29')](_0x23cb5a[_0xbb84('0x3c')][_0xbb84('0x29')]);_0x58f7c9[_0xbb84('0x28')]=qs[_0xbb84('0x28')](_0x23cb5a[_0xbb84('0x3c')]['offset']);}return _0x489e26[_0xbb84('0x54')](_0x58f7c9);}})[_0xbb84('0x1b')](function(_0x2bd565){if(_0x2bd565){return _0x2bd565?{'count':_0x421335,'rows':_0x2bd565}:null;}})['then'](respondWithResult(_0x27ada4,null))[_0xbb84('0x24')](handleError(_0x27ada4,null));};exports['addConfiguration']=function(_0x3ab533,_0x3dbf59,_0x1a26ad){if(_0x3ab533[_0xbb84('0x53')]['id']){delete _0x3ab533[_0xbb84('0x53')]['id'];}return db[_0xbb84('0x37')][_0xbb84('0x55')]({'where':{'id':_0x3ab533[_0xbb84('0x50')]['id']}})[_0xbb84('0x1b')](handleEntityNotFound(_0x3dbf59,null))[_0xbb84('0x1b')](function(_0x1505ba){if(_0x1505ba){_0x3ab533['body'][_0xbb84('0x57')]=_0x1505ba['id'];_0x3ab533[_0xbb84('0x53')][_0xbb84('0x58')]=integrations['getSubjects'](_0x3ab533[_0xbb84('0x53')][_0xbb84('0x59')],_0x3ab533[_0xbb84('0x53')][_0xbb84('0x49')]);_0x3ab533[_0xbb84('0x53')][_0xbb84('0x5a')]=integrations['getDescriptions'](_0x3ab533['body']['channel'],_0x3ab533[_0xbb84('0x53')][_0xbb84('0x49')]);return db[_0xbb84('0x56')][_0xbb84('0x52')](_0x3ab533[_0xbb84('0x53')],{'include':[{'model':db['ZohoField'],'as':'Subjects'},{'model':db['ZohoField'],'as':_0xbb84('0x5a')}]});}return null;})[_0xbb84('0x1b')](respondWithResult(_0x3dbf59,null))[_0xbb84('0x24')](handleError(_0x3dbf59,null));};function getAccessToken(_0x48ee74){return new Promise(function(_0x2dc54d,_0x4b57a1){var _0x39b0b6;switch(_0x48ee74['zone']){case'US':_0x39b0b6='https://accounts.zoho.com';break;case'AU':_0x39b0b6=_0xbb84('0x5b');break;case'EU':_0x39b0b6=_0xbb84('0x5c');break;case'IN':_0x39b0b6='https://accounts.zoho.in';break;case'CN':_0x39b0b6=_0xbb84('0x5d');break;default:_0x39b0b6='https://accounts.zoho.eu';break;}var _0x4a5277={'method':_0xbb84('0x5e'),'uri':_0x39b0b6+_0xbb84('0x5f'),'qs':{'refresh_token':_0x48ee74[_0xbb84('0x60')],'client_id':_0x48ee74[_0xbb84('0x61')],'client_secret':_0x48ee74[_0xbb84('0x62')],'grant_type':_0xbb84('0x63')},'json':!![]};return rp(_0x4a5277)['then'](function(_0x5b917f){if(_0x5b917f['access_token']){_0x2dc54d(_0x5b917f[_0xbb84('0x64')]);}else{_0x4b57a1('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0xbb84('0x24')](function(_0x268034){_0x4b57a1(_0x268034);});});}exports[_0xbb84('0x65')]=function(_0x8b684f,_0x100d11,_0x349620){var _0x479219,_0x225116,_0xf8deb9,_0x2221f0,_0x51af99;return db[_0xbb84('0x37')][_0xbb84('0x55')]({'where':{'id':_0x8b684f[_0xbb84('0x50')]['id']},'attributes':['id',_0xbb84('0x66'),'zone',_0xbb84('0x61'),_0xbb84('0x62'),_0xbb84('0x67'),'code',_0xbb84('0x60')]})[_0xbb84('0x1b')](handleEntityNotFound(_0x100d11,null))[_0xbb84('0x1b')](function(_0x438a34){_0x51af99=_0x438a34;_0x479219=_0x51af99[_0xbb84('0x66')];_0x225116=_0x479219===_0xbb84('0x68')?'eu':_0xbb84('0x69');_0xf8deb9=_0x51af99['serverUrl'];var _0x3abaf3=_0xf8deb9['slice'](-0x1);if(_0x3abaf3==='/'||_0x3abaf3==='\x5c'||_0x3abaf3===':'){_0xf8deb9=_0xf8deb9['substring'](0x0,_0xf8deb9['lastIndexOf'](_0x3abaf3));}if(!_0x51af99[_0xbb84('0x60')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x51af99);})[_0xbb84('0x1b')](function(_0x51eb1b){if(_0x51eb1b){return rp({'method':_0xbb84('0x6a'),'uri':util['format'](_0xbb84('0x6b'),_0x225116),'qs':{'module':_0xbb84('0x6c')},'headers':{'Authorization':_0xbb84('0x6d')+_0x51eb1b},'json':!![]});}})[_0xbb84('0x1b')](function(_0xcef7b9){if(_0xcef7b9){if(_0xcef7b9[_0xbb84('0x6e')]&&_0xcef7b9[_0xbb84('0x6e')][_0xbb84('0x20')]){throw new Error(_0xcef7b9[_0xbb84('0x6e')][_0xbb84('0x20')][_0xbb84('0x22')]);}var _0x51ef49=[];var _0x3cf8c2=[];var _0x9ae9c4=[_0xbb84('0x6f'),'Subject',_0xbb84('0x70'),_0xbb84('0x71'),_0xbb84('0x72'),_0xbb84('0x73'),'Call_Start_Time',_0xbb84('0x74')];_0x3cf8c2=_[_0xbb84('0x75')](_0xcef7b9['fields'],function(_0x38b09f){return _0x9ae9c4['includes'](_0x38b09f[_0xbb84('0x76')]);});for(var _0x50468f=0x0;_0x50468f<_0x3cf8c2['length'];_0x50468f++){if(_0x3cf8c2[_0x50468f]['system_mandatory']===![]){_0x51ef49[_0xbb84('0x77')]({'id':_0x3cf8c2[_0x50468f]['id'],'name':_0x3cf8c2[_0x50468f][_0xbb84('0x78')],'custom':_0x3cf8c2[_0x50468f][_0xbb84('0x79')],'options':_0x3cf8c2[_0x50468f][_0xbb84('0x7a')]==='picklist'&&_0x3cf8c2[_0x50468f][_0xbb84('0x7b')][_0xbb84('0x40')]>-0x1?_[_0xbb84('0x36')](_0x3cf8c2[_0x50468f]['pick_list_values'],function(_0x429d1e){return{'name':_0x429d1e,'value':_0x429d1e};}):[]});}}return{'count':_0x51ef49[_0xbb84('0x40')],'rows':_0x51ef49};}else{return{'count':0x0,'rows':[]};}})[_0xbb84('0x1b')](respondWithResult(_0x100d11,null))['catch'](function(_0x1aaff0){var _0x75dc68=_0x8b684f['query'][_0xbb84('0x17')]?0x1f4:_0x1aaff0['statusCode']||0x1f4;logger['error'](_0xbb84('0x7c'),_0xbb84('0x65'),_0x75dc68,JSON[_0xbb84('0x1f')](_0x1aaff0));delete _0x1aaff0[_0xbb84('0x33')];if(_0x75dc68===0x191){_0x75dc68=0x190;}_0x100d11[_0xbb84('0x26')](_0x75dc68)[_0xbb84('0x34')](_0x8b684f[_0xbb84('0x3c')][_0xbb84('0x17')]?{'message':_0xbb84('0x7d'),'statusCode':_0x1aaff0[_0xbb84('0x7e')]}:_0x1aaff0);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 6cc470e..aa26680 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 _0x776d=['serverUrl','clientSecret','code','host','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','authorization_code','clientId','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','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','slice','https://accounts.zoho.eu','info','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','exports','define','int_zoho_accounts','changed','zone'];(function(_0x467a0c,_0x2b79e6){var _0x1afff7=function(_0x1b1a62){while(--_0x1b1a62){_0x467a0c['push'](_0x467a0c['shift']());}};_0x1afff7(++_0x2b79e6);}(_0x776d,0x9b));var _0xd776=function(_0x3691df,_0x3a1262){_0x3691df=_0x3691df-0x0;var _0x129a75=_0x776d[_0x3691df];return _0x129a75;};'use strict';var _=require('lodash');var util=require(_0xd776('0x0'));var logger=require(_0xd776('0x1'))('api');var moment=require('moment');var BPromise=require(_0xd776('0x2'));var rp=require(_0xd776('0x3'));var fs=require('fs');var path=require(_0xd776('0x4'));var rimraf=require(_0xd776('0x5'));var config=require(_0xd776('0x6'));var attributes=require(_0xd776('0x7'));var integrations=require('../../components/integrations/configuration');module[_0xd776('0x8')]=function(_0x21b785,_0x400cf6){return _0x21b785[_0xd776('0x9')]('ZohoAccount',attributes,{'tableName':_0xd776('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x34ac7c,_0x4d82f3,_0x173b16){if(_0x34ac7c[_0xd776('0xb')](_0xd776('0xc'))||_0x34ac7c[_0xd776('0xb')](_0xd776('0xd'))||_0x34ac7c[_0xd776('0xb')]('clientId')||_0x34ac7c['changed'](_0xd776('0xe'))||_0x34ac7c[_0xd776('0xb')](_0xd776('0xf'))||_0x34ac7c[_0xd776('0xb')](_0xd776('0x10'))){var _0x4235be,_0x186af2;_0x4235be=_0x34ac7c[_0xd776('0xd')];var _0x14256c=_0x4235be['slice'](-0x1);if(_0x14256c==='/'||_0x14256c==='\x5c'||_0x14256c===':'){_0x4235be=_0x4235be[_0xd776('0x11')](0x0,_0x4235be[_0xd776('0x12')](_0x14256c));}switch(_0x34ac7c[_0xd776('0xc')]){case'US':_0x186af2=_0xd776('0x13');break;case'AU':_0x186af2=_0xd776('0x14');break;case'IN':_0x186af2=_0xd776('0x15');break;case'CN':_0x186af2=_0xd776('0x16');break;default:_0x186af2='https://accounts.zoho.eu';break;}var _0x33b199={'method':_0xd776('0x17'),'uri':_0x186af2+_0xd776('0x18'),'form':{'grant_type':_0xd776('0x19'),'client_id':_0x34ac7c[_0xd776('0x1a')],'client_secret':_0x34ac7c[_0xd776('0xe')],'redirect_uri':_0x34ac7c[_0xd776('0xd')],'code':_0x34ac7c['code']},'headers':{'Content-Type':_0xd776('0x1b')}};return rp(_0x33b199)[_0xd776('0x1c')](function(_0x44b1fd){var _0x20a8c9=JSON[_0xd776('0x1d')](_0x44b1fd);if(_0x20a8c9[_0xd776('0x1e')]){_0x34ac7c[_0xd776('0x1f')]=_0x20a8c9[_0xd776('0x1e')];logger['info'](util[_0xd776('0x20')](_0xd776('0x21'),_0x34ac7c[_0xd776('0x22')],_0x34ac7c['id']));}else{logger[_0xd776('0x23')](util[_0xd776('0x20')](_0xd776('0x24'),_0x34ac7c[_0xd776('0x22')],_0x34ac7c['id']),util[_0xd776('0x25')](_0x20a8c9,{'showHidden':![],'depth':null}));}return _0x173b16(null,_0x4d82f3);})[_0xd776('0x26')](function(_0x54c3be){logger[_0xd776('0x23')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x34ac7c[_0xd776('0x22')],_0x34ac7c['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x173b16(_0x54c3be);});}else{return _0x173b16(null,_0x4d82f3);}},'beforeUpdate':function(_0x336c57,_0x3cb97a,_0x1e4f30){if(_0x336c57[_0xd776('0xb')]('zone')||_0x336c57[_0xd776('0xb')](_0xd776('0xd'))||_0x336c57[_0xd776('0xb')](_0xd776('0x1a'))||_0x336c57[_0xd776('0xb')](_0xd776('0xe'))||_0x336c57[_0xd776('0xb')]('code')||_0x336c57[_0xd776('0xb')](_0xd776('0x10'))){var _0xfc91c6,_0x43061a;_0xfc91c6=_0x336c57['serverUrl'];var _0x4b231a=_0xfc91c6[_0xd776('0x27')](-0x1);if(_0x4b231a==='/'||_0x4b231a==='\x5c'||_0x4b231a===':'){_0xfc91c6=_0xfc91c6[_0xd776('0x11')](0x0,_0xfc91c6[_0xd776('0x12')](_0x4b231a));}switch(_0x336c57[_0xd776('0xc')]){case'US':_0x43061a='https://accounts.zoho.com';break;case'AU':_0x43061a=_0xd776('0x14');break;case'IN':_0x43061a=_0xd776('0x15');break;case'CN':_0x43061a=_0xd776('0x16');break;default:_0x43061a=_0xd776('0x28');break;}var _0x58992b={'method':_0xd776('0x17'),'uri':_0x43061a+_0xd776('0x18'),'form':{'grant_type':_0xd776('0x19'),'client_id':_0x336c57['clientId'],'client_secret':_0x336c57[_0xd776('0xe')],'redirect_uri':_0x336c57[_0xd776('0xd')],'code':_0x336c57[_0xd776('0xf')]},'headers':{'Content-Type':_0xd776('0x1b')}};return rp(_0x58992b)[_0xd776('0x1c')](function(_0x4a6b58){var _0xc3daa4=JSON[_0xd776('0x1d')](_0x4a6b58);if(_0xc3daa4[_0xd776('0x1e')]){_0x336c57[_0xd776('0x1f')]=_0xc3daa4['refresh_token'];logger[_0xd776('0x29')](util['format'](_0xd776('0x21'),_0x336c57[_0xd776('0x22')],_0x336c57['id']));}else{logger[_0xd776('0x23')](util[_0xd776('0x20')](_0xd776('0x24'),_0x336c57[_0xd776('0x22')],_0x336c57['id']),util[_0xd776('0x25')](_0xc3daa4,{'showHidden':![],'depth':null}));}return _0x1e4f30(null,_0x3cb97a);})[_0xd776('0x26')](function(_0x388a83){logger['error'](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x336c57[_0xd776('0x22')],_0x336c57['id']),util[_0xd776('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x1e4f30(_0x388a83);});}else{return _0x1e4f30(null,_0x3cb97a);}}}});}; \ No newline at end of file +var _0xa796=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId','clientSecret','code','host','slice','substring','lastIndexOf','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','POST','/oauth/v2/token','refresh_token','refreshToken','format','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','catch','inspect','https://accounts.zoho.com','https://accounts.zoho.com.cn','authorization_code','application/x-www-form-urlencoded','then','parse','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','lodash'];(function(_0x20150f,_0x50d12e){var _0x4f5667=function(_0x41d692){while(--_0x41d692){_0x20150f['push'](_0x20150f['shift']());}};_0x4f5667(++_0x50d12e);}(_0xa796,0x1ee));var _0x6a79=function(_0x1f2217,_0x3e300f){_0x1f2217=_0x1f2217-0x0;var _0x22dc72=_0xa796[_0x1f2217];return _0x22dc72;};'use strict';var _=require(_0x6a79('0x0'));var util=require('util');var logger=require(_0x6a79('0x1'))(_0x6a79('0x2'));var moment=require(_0x6a79('0x3'));var BPromise=require(_0x6a79('0x4'));var rp=require(_0x6a79('0x5'));var fs=require('fs');var path=require(_0x6a79('0x6'));var rimraf=require('rimraf');var config=require(_0x6a79('0x7'));var attributes=require(_0x6a79('0x8'));var integrations=require(_0x6a79('0x9'));module[_0x6a79('0xa')]=function(_0x2bb8bf,_0x174c8c){return _0x2bb8bf[_0x6a79('0xb')](_0x6a79('0xc'),attributes,{'tableName':_0x6a79('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x99328e,_0x3278a5,_0x401b4){if(_0x99328e[_0x6a79('0xe')](_0x6a79('0xf'))||_0x99328e[_0x6a79('0xe')](_0x6a79('0x10'))||_0x99328e[_0x6a79('0xe')](_0x6a79('0x11'))||_0x99328e[_0x6a79('0xe')](_0x6a79('0x12'))||_0x99328e[_0x6a79('0xe')](_0x6a79('0x13'))||_0x99328e[_0x6a79('0xe')](_0x6a79('0x14'))){var _0x406c40,_0x2f8dee;_0x406c40=_0x99328e['serverUrl'];var _0x535fc8=_0x406c40[_0x6a79('0x15')](-0x1);if(_0x535fc8==='/'||_0x535fc8==='\x5c'||_0x535fc8===':'){_0x406c40=_0x406c40[_0x6a79('0x16')](0x0,_0x406c40[_0x6a79('0x17')](_0x535fc8));}switch(_0x99328e[_0x6a79('0xf')]){case'US':_0x2f8dee='https://accounts.zoho.com';break;case'AU':_0x2f8dee=_0x6a79('0x18');break;case'IN':_0x2f8dee=_0x6a79('0x19');break;case'CN':_0x2f8dee='https://accounts.zoho.com.cn';break;default:_0x2f8dee=_0x6a79('0x1a');break;}var _0x27f362={'method':_0x6a79('0x1b'),'uri':_0x2f8dee+_0x6a79('0x1c'),'form':{'grant_type':'authorization_code','client_id':_0x99328e[_0x6a79('0x11')],'client_secret':_0x99328e['clientSecret'],'redirect_uri':_0x99328e[_0x6a79('0x10')],'code':_0x99328e['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x27f362)['then'](function(_0x12812a){var _0x5b3199=JSON['parse'](_0x12812a);if(_0x5b3199[_0x6a79('0x1d')]){_0x99328e[_0x6a79('0x1e')]=_0x5b3199[_0x6a79('0x1d')];logger['info'](util[_0x6a79('0x1f')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x99328e[_0x6a79('0x20')],_0x99328e['id']));}else{logger[_0x6a79('0x21')](util[_0x6a79('0x1f')](_0x6a79('0x22'),_0x99328e['name'],_0x99328e['id']),util['inspect'](_0x5b3199,{'showHidden':![],'depth':null}));}return _0x401b4(null,_0x3278a5);})[_0x6a79('0x23')](function(_0x36f3e0){logger[_0x6a79('0x21')](util['format'](_0x6a79('0x22'),_0x99328e[_0x6a79('0x20')],_0x99328e['id']),util[_0x6a79('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x401b4(_0x36f3e0);});}else{return _0x401b4(null,_0x3278a5);}},'beforeUpdate':function(_0x20eff2,_0x36eea5,_0x7922e2){if(_0x20eff2['changed'](_0x6a79('0xf'))||_0x20eff2[_0x6a79('0xe')]('serverUrl')||_0x20eff2[_0x6a79('0xe')](_0x6a79('0x11'))||_0x20eff2['changed'](_0x6a79('0x12'))||_0x20eff2['changed'](_0x6a79('0x13'))||_0x20eff2[_0x6a79('0xe')](_0x6a79('0x14'))){var _0x1451db,_0xc4fe56;_0x1451db=_0x20eff2['serverUrl'];var _0x23d325=_0x1451db[_0x6a79('0x15')](-0x1);if(_0x23d325==='/'||_0x23d325==='\x5c'||_0x23d325===':'){_0x1451db=_0x1451db[_0x6a79('0x16')](0x0,_0x1451db[_0x6a79('0x17')](_0x23d325));}switch(_0x20eff2[_0x6a79('0xf')]){case'US':_0xc4fe56=_0x6a79('0x25');break;case'AU':_0xc4fe56=_0x6a79('0x18');break;case'IN':_0xc4fe56=_0x6a79('0x19');break;case'CN':_0xc4fe56=_0x6a79('0x26');break;default:_0xc4fe56=_0x6a79('0x1a');break;}var _0x5aa69b={'method':_0x6a79('0x1b'),'uri':_0xc4fe56+_0x6a79('0x1c'),'form':{'grant_type':_0x6a79('0x27'),'client_id':_0x20eff2[_0x6a79('0x11')],'client_secret':_0x20eff2[_0x6a79('0x12')],'redirect_uri':_0x20eff2[_0x6a79('0x10')],'code':_0x20eff2[_0x6a79('0x13')]},'headers':{'Content-Type':_0x6a79('0x28')}};return rp(_0x5aa69b)[_0x6a79('0x29')](function(_0xc64d5d){var _0x4272a8=JSON[_0x6a79('0x2a')](_0xc64d5d);if(_0x4272a8['refresh_token']){_0x20eff2[_0x6a79('0x1e')]=_0x4272a8['refresh_token'];logger[_0x6a79('0x2b')](util['format'](_0x6a79('0x2c'),_0x20eff2[_0x6a79('0x20')],_0x20eff2['id']));}else{logger[_0x6a79('0x21')](util[_0x6a79('0x1f')](_0x6a79('0x22'),_0x20eff2[_0x6a79('0x20')],_0x20eff2['id']),util['inspect'](_0x4272a8,{'showHidden':![],'depth':null}));}return _0x7922e2(null,_0x36eea5);})[_0x6a79('0x23')](function(_0x3196b7){logger[_0x6a79('0x21')](util[_0x6a79('0x1f')](_0x6a79('0x22'),_0x20eff2['name'],_0x20eff2['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x7922e2(_0x3196b7);});}else{return _0x7922e2(null,_0x36eea5);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 6a10b90..7dd594c 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 _0xfd2d=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ZohoAccount,\x20%s,\x20%s','debug','error','code','message','result','catch','ZohoAccount','findAll','options','raw','where','attributes','include','map','model','info','GetZohoAccount','stringify','find','ShowZohoAccount','lodash','util','bluebird','ioredis'];(function(_0x42182d,_0x125b1a){var _0x26459b=function(_0x1b88ab){while(--_0x1b88ab){_0x42182d['push'](_0x42182d['shift']());}};_0x26459b(++_0x125b1a);}(_0xfd2d,0x12e));var _0xdfd2=function(_0x34fbdf,_0x48d847){_0x34fbdf=_0x34fbdf-0x0;var _0x237cdc=_0xfd2d[_0x34fbdf];return _0x237cdc;};'use strict';var _=require(_0xdfd2('0x0'));var util=require(_0xdfd2('0x1'));var moment=require('moment');var BPromise=require(_0xdfd2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdfd2('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xdfd2('0x4'));var logger=require(_0xdfd2('0x5'))(_0xdfd2('0x6'));var config=require(_0xdfd2('0x7'));var jayson=require(_0xdfd2('0x8'));var client=jayson[_0xdfd2('0x9')][_0xdfd2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5526db,_0x55b82e,_0x1c77e7){return new BPromise(function(_0x2e3cab,_0x5dc3a6){return client[_0xdfd2('0xb')](_0x5526db,_0x1c77e7)[_0xdfd2('0xc')](function(_0x573c2b){logger['info'](_0xdfd2('0xd'),_0x55b82e,'request\x20sent');logger[_0xdfd2('0xe')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x55b82e,'request\x20sent',JSON['stringify'](_0x573c2b));if(_0x573c2b[_0xdfd2('0xf')]){if(_0x573c2b[_0xdfd2('0xf')][_0xdfd2('0x10')]===0x1f4){logger[_0xdfd2('0xf')]('ZohoAccount,\x20%s,\x20%s',_0x55b82e,_0x573c2b[_0xdfd2('0xf')]['message']);return _0x5dc3a6(_0x573c2b[_0xdfd2('0xf')][_0xdfd2('0x11')]);}logger[_0xdfd2('0xf')]('ZohoAccount,\x20%s,\x20%s',_0x55b82e,_0x573c2b['error'][_0xdfd2('0x11')]);return _0x2e3cab(_0x573c2b['error'][_0xdfd2('0x11')]);}else{logger['info'](_0xdfd2('0xd'),_0x55b82e,'request\x20sent');_0x2e3cab(_0x573c2b[_0xdfd2('0x12')][_0xdfd2('0x11')]);}})[_0xdfd2('0x13')](function(_0x411f6e){logger[_0xdfd2('0xf')](_0xdfd2('0xd'),_0x55b82e,_0x411f6e);_0x5dc3a6(_0x411f6e);});});}exports['GetZohoAccount']=function(_0x4d8500){var _0x5cf4d5=this;return new Promise(function(_0x46cd3e,_0x4c87ed){return db[_0xdfd2('0x14')][_0xdfd2('0x15')]({'raw':_0x4d8500[_0xdfd2('0x16')]?_0x4d8500[_0xdfd2('0x16')][_0xdfd2('0x17')]===undefined?!![]:![]:!![],'where':_0x4d8500[_0xdfd2('0x16')]?_0x4d8500[_0xdfd2('0x16')][_0xdfd2('0x18')]||null:null,'attributes':_0x4d8500['options']?_0x4d8500[_0xdfd2('0x16')][_0xdfd2('0x19')]||null:null,'limit':_0x4d8500[_0xdfd2('0x16')]?_0x4d8500[_0xdfd2('0x16')]['limit']||null:null,'include':_0x4d8500['options']?_0x4d8500['options'][_0xdfd2('0x1a')]?_[_0xdfd2('0x1b')](_0x4d8500[_0xdfd2('0x16')]['include'],function(_0x7d6b1){return{'model':db[_0x7d6b1[_0xdfd2('0x1c')]],'as':_0x7d6b1['as'],'attributes':_0x7d6b1[_0xdfd2('0x19')],'include':_0x7d6b1['include']?_[_0xdfd2('0x1b')](_0x7d6b1[_0xdfd2('0x1a')],function(_0x165659){return{'model':db[_0x165659[_0xdfd2('0x1c')]],'as':_0x165659['as'],'attributes':_0x165659['attributes'],'include':_0x165659['include']?_[_0xdfd2('0x1b')](_0x165659[_0xdfd2('0x1a')],function(_0x28fe24){return{'model':db[_0x28fe24['model']],'as':_0x28fe24['as'],'attributes':_0x28fe24[_0xdfd2('0x19')]};}):[]};}):[]};}):[]:[]})[_0xdfd2('0xc')](function(_0x3e41b9){logger[_0xdfd2('0x1d')]('GetZohoAccount',_0x4d8500);logger[_0xdfd2('0xe')](_0xdfd2('0x1e'),_0x4d8500,JSON[_0xdfd2('0x1f')](_0x3e41b9));_0x46cd3e(_0x3e41b9);})[_0xdfd2('0x13')](function(_0x4abdd0){logger[_0xdfd2('0xf')](_0xdfd2('0x1e'),_0x4abdd0[_0xdfd2('0x11')],_0x4d8500);_0x4c87ed(_0x5cf4d5[_0xdfd2('0xf')](0x1f4,_0x4abdd0[_0xdfd2('0x11')]));});});};exports['ShowZohoAccount']=function(_0x2ec1ab){var _0x1a1d3c=this;return new Promise(function(_0x43fab4,_0x3af474){return db[_0xdfd2('0x14')][_0xdfd2('0x20')]({'raw':_0x2ec1ab['options']?_0x2ec1ab[_0xdfd2('0x16')][_0xdfd2('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec1ab['options']?_0x2ec1ab['options']['where']||null:null,'attributes':_0x2ec1ab['options']?_0x2ec1ab['options'][_0xdfd2('0x19')]||null:null,'include':_0x2ec1ab[_0xdfd2('0x16')]?_0x2ec1ab[_0xdfd2('0x16')][_0xdfd2('0x1a')]?_[_0xdfd2('0x1b')](_0x2ec1ab[_0xdfd2('0x16')][_0xdfd2('0x1a')],function(_0x1a15e5){return{'model':db[_0x1a15e5[_0xdfd2('0x1c')]],'as':_0x1a15e5['as'],'attributes':_0x1a15e5['attributes'],'include':_0x1a15e5[_0xdfd2('0x1a')]?_[_0xdfd2('0x1b')](_0x1a15e5[_0xdfd2('0x1a')],function(_0x18c9d1){return{'model':db[_0x18c9d1[_0xdfd2('0x1c')]],'as':_0x18c9d1['as'],'attributes':_0x18c9d1[_0xdfd2('0x19')],'include':_0x18c9d1[_0xdfd2('0x1a')]?_[_0xdfd2('0x1b')](_0x18c9d1[_0xdfd2('0x1a')],function(_0x3f9524){return{'model':db[_0x3f9524['model']],'as':_0x3f9524['as'],'attributes':_0x3f9524[_0xdfd2('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x20fa56){logger[_0xdfd2('0x1d')](_0xdfd2('0x21'),_0x2ec1ab);logger['debug'](_0xdfd2('0x21'),_0x2ec1ab,JSON[_0xdfd2('0x1f')](_0x20fa56));_0x43fab4(_0x20fa56);})['catch'](function(_0x42d598){logger['error'](_0xdfd2('0x21'),_0x42d598[_0xdfd2('0x11')],_0x2ec1ab);_0x3af474(_0x1a1d3c[_0xdfd2('0xf')](0x1f4,_0x42d598[_0xdfd2('0x11')]));});});}; \ No newline at end of file +var _0x4635=['ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','findAll','options','raw','where','attributes','include','map','model','GetZohoAccount','debug','ZohoAccount','ShowZohoAccount','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','ZohoAccount,\x20%s,\x20%s'];(function(_0x20da40,_0x11a7e6){var _0x4f3ca2=function(_0x477699){while(--_0x477699){_0x20da40['push'](_0x20da40['shift']());}};_0x4f3ca2(++_0x11a7e6);}(_0x4635,0x19f));var _0x5463=function(_0x46f8f5,_0x1fec72){_0x46f8f5=_0x46f8f5-0x0;var _0x4d9846=_0x4635[_0x46f8f5];return _0x4d9846;};'use strict';var _=require(_0x5463('0x0'));var util=require(_0x5463('0x1'));var moment=require(_0x5463('0x2'));var BPromise=require(_0x5463('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5463('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5463('0x5'));var logger=require(_0x5463('0x6'))(_0x5463('0x7'));var config=require(_0x5463('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5463('0x9')][_0x5463('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1bbab7,_0x3556a7,_0x39831e){return new BPromise(function(_0x20c040,_0x14aebb){return client['request'](_0x1bbab7,_0x39831e)[_0x5463('0xb')](function(_0x3b25f1){logger[_0x5463('0xc')](_0x5463('0xd'),_0x3556a7,'request\x20sent');logger['debug'](_0x5463('0xe'),_0x3556a7,_0x5463('0xf'),JSON[_0x5463('0x10')](_0x3b25f1));if(_0x3b25f1['error']){if(_0x3b25f1[_0x5463('0x11')][_0x5463('0x12')]===0x1f4){logger[_0x5463('0x11')](_0x5463('0xd'),_0x3556a7,_0x3b25f1[_0x5463('0x11')][_0x5463('0x13')]);return _0x14aebb(_0x3b25f1[_0x5463('0x11')]['message']);}logger[_0x5463('0x11')]('ZohoAccount,\x20%s,\x20%s',_0x3556a7,_0x3b25f1[_0x5463('0x11')]['message']);return _0x20c040(_0x3b25f1[_0x5463('0x11')][_0x5463('0x13')]);}else{logger[_0x5463('0xc')](_0x5463('0xd'),_0x3556a7,_0x5463('0xf'));_0x20c040(_0x3b25f1['result'][_0x5463('0x13')]);}})[_0x5463('0x14')](function(_0x56c20c){logger[_0x5463('0x11')]('ZohoAccount,\x20%s,\x20%s',_0x3556a7,_0x56c20c);_0x14aebb(_0x56c20c);});});}exports['GetZohoAccount']=function(_0x58dfb7){var _0x407504=this;return new Promise(function(_0x2ebaa1,_0x4f6230){return db['ZohoAccount'][_0x5463('0x15')]({'raw':_0x58dfb7['options']?_0x58dfb7[_0x5463('0x16')][_0x5463('0x17')]===undefined?!![]:![]:!![],'where':_0x58dfb7[_0x5463('0x16')]?_0x58dfb7[_0x5463('0x16')][_0x5463('0x18')]||null:null,'attributes':_0x58dfb7[_0x5463('0x16')]?_0x58dfb7[_0x5463('0x16')][_0x5463('0x19')]||null:null,'limit':_0x58dfb7[_0x5463('0x16')]?_0x58dfb7[_0x5463('0x16')]['limit']||null:null,'include':_0x58dfb7[_0x5463('0x16')]?_0x58dfb7[_0x5463('0x16')][_0x5463('0x1a')]?_['map'](_0x58dfb7[_0x5463('0x16')][_0x5463('0x1a')],function(_0x4d278e){return{'model':db[_0x4d278e['model']],'as':_0x4d278e['as'],'attributes':_0x4d278e[_0x5463('0x19')],'include':_0x4d278e['include']?_[_0x5463('0x1b')](_0x4d278e[_0x5463('0x1a')],function(_0x47d687){return{'model':db[_0x47d687[_0x5463('0x1c')]],'as':_0x47d687['as'],'attributes':_0x47d687[_0x5463('0x19')],'include':_0x47d687[_0x5463('0x1a')]?_[_0x5463('0x1b')](_0x47d687[_0x5463('0x1a')],function(_0x171878){return{'model':db[_0x171878[_0x5463('0x1c')]],'as':_0x171878['as'],'attributes':_0x171878[_0x5463('0x19')]};}):[]};}):[]};}):[]:[]})[_0x5463('0xb')](function(_0x4ce049){logger[_0x5463('0xc')](_0x5463('0x1d'),_0x58dfb7);logger[_0x5463('0x1e')](_0x5463('0x1d'),_0x58dfb7,JSON[_0x5463('0x10')](_0x4ce049));_0x2ebaa1(_0x4ce049);})[_0x5463('0x14')](function(_0x4d8dfe){logger[_0x5463('0x11')](_0x5463('0x1d'),_0x4d8dfe[_0x5463('0x13')],_0x58dfb7);_0x4f6230(_0x407504['error'](0x1f4,_0x4d8dfe['message']));});});};exports['ShowZohoAccount']=function(_0x339097){var _0x3d677e=this;return new Promise(function(_0x445bf8,_0x332756){return db[_0x5463('0x1f')]['find']({'raw':_0x339097['options']?_0x339097[_0x5463('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x339097[_0x5463('0x16')]?_0x339097[_0x5463('0x16')]['where']||null:null,'attributes':_0x339097['options']?_0x339097['options'][_0x5463('0x19')]||null:null,'include':_0x339097[_0x5463('0x16')]?_0x339097[_0x5463('0x16')][_0x5463('0x1a')]?_[_0x5463('0x1b')](_0x339097[_0x5463('0x16')][_0x5463('0x1a')],function(_0x4c1b4f){return{'model':db[_0x4c1b4f[_0x5463('0x1c')]],'as':_0x4c1b4f['as'],'attributes':_0x4c1b4f[_0x5463('0x19')],'include':_0x4c1b4f[_0x5463('0x1a')]?_['map'](_0x4c1b4f[_0x5463('0x1a')],function(_0x325249){return{'model':db[_0x325249[_0x5463('0x1c')]],'as':_0x325249['as'],'attributes':_0x325249[_0x5463('0x19')],'include':_0x325249[_0x5463('0x1a')]?_['map'](_0x325249[_0x5463('0x1a')],function(_0xa95dca){return{'model':db[_0xa95dca[_0x5463('0x1c')]],'as':_0xa95dca['as'],'attributes':_0xa95dca[_0x5463('0x19')]};}):[]};}):[]};}):[]:[]})[_0x5463('0xb')](function(_0x1e751b){logger[_0x5463('0xc')](_0x5463('0x20'),_0x339097);logger[_0x5463('0x1e')](_0x5463('0x20'),_0x339097,JSON[_0x5463('0x10')](_0x1e751b));_0x445bf8(_0x1e751b);})[_0x5463('0x14')](function(_0x97ccea){logger['error']('ShowZohoAccount',_0x97ccea['message'],_0x339097);_0x332756(_0x3d677e[_0x5463('0x11')](0x1f4,_0x97ccea[_0x5463('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 2639c0e..70789e8 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 _0xb081=['index','get','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','update','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x4a4922,_0x82cb8f){var _0x55a8c6=function(_0x59712e){while(--_0x59712e){_0x4a4922['push'](_0x4a4922['shift']());}};_0x55a8c6(++_0x82cb8f);}(_0xb081,0x1c5));var _0x1b08=function(_0x102977,_0x3a99a6){_0x102977=_0x102977-0x0;var _0x15c466=_0xb081[_0x102977];return _0x15c466;};'use strict';var multer=require(_0x1b08('0x0'));var util=require('util');var path=require(_0x1b08('0x1'));var timeout=require(_0x1b08('0x2'));var express=require(_0x1b08('0x3'));var router=express[_0x1b08('0x4')]();var auth=require(_0x1b08('0x5'));var interaction=require(_0x1b08('0x6'));var config=require(_0x1b08('0x7'));var controller=require('./intZohoConfiguration.controller');router['get']('/',auth[_0x1b08('0x8')](),controller[_0x1b08('0x9')]);router[_0x1b08('0xa')](_0x1b08('0xb'),auth[_0x1b08('0x8')](),controller[_0x1b08('0xc')]);router['get'](_0x1b08('0xd'),auth[_0x1b08('0x8')](),controller['getFields']);router[_0x1b08('0xa')](_0x1b08('0xe'),auth[_0x1b08('0x8')](),controller[_0x1b08('0xf')]);router[_0x1b08('0xa')](_0x1b08('0x10'),auth['isAuthenticated'](),controller[_0x1b08('0x11')]);router[_0x1b08('0x12')]('/',auth[_0x1b08('0x8')](),controller['create']);router['put']('/:id',auth[_0x1b08('0x8')](),controller[_0x1b08('0x13')]);router[_0x1b08('0x14')]('/:id',auth[_0x1b08('0x8')](),controller[_0x1b08('0x15')]);module['exports']=router; \ No newline at end of file +var _0xced8=['get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x30f64d,_0x40f95e){var _0x191c46=function(_0x1091d5){while(--_0x1091d5){_0x30f64d['push'](_0x30f64d['shift']());}};_0x191c46(++_0x40f95e);}(_0xced8,0x13c));var _0x8ced=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xced8[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x8ced('0x0'));var util=require(_0x8ced('0x1'));var path=require(_0x8ced('0x2'));var timeout=require(_0x8ced('0x3'));var express=require(_0x8ced('0x4'));var router=express[_0x8ced('0x5')]();var auth=require(_0x8ced('0x6'));var interaction=require(_0x8ced('0x7'));var config=require(_0x8ced('0x8'));var controller=require('./intZohoConfiguration.controller');router[_0x8ced('0x9')]('/',auth[_0x8ced('0xa')](),controller[_0x8ced('0xb')]);router['get'](_0x8ced('0xc'),auth['isAuthenticated'](),controller[_0x8ced('0xd')]);router['get'](_0x8ced('0xe'),auth[_0x8ced('0xa')](),controller[_0x8ced('0xf')]);router['get'](_0x8ced('0x10'),auth[_0x8ced('0xa')](),controller[_0x8ced('0x11')]);router[_0x8ced('0x9')](_0x8ced('0x12'),auth[_0x8ced('0xa')](),controller[_0x8ced('0x13')]);router[_0x8ced('0x14')]('/',auth[_0x8ced('0xa')](),controller[_0x8ced('0x15')]);router[_0x8ced('0x16')](_0x8ced('0xc'),auth[_0x8ced('0xa')](),controller[_0x8ced('0x17')]);router[_0x8ced('0x18')](_0x8ced('0xc'),auth[_0x8ced('0xa')](),controller['destroy']);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 57c82e9..2e94298 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 _0x591e=['ENUM','Leads','sequelize','exports','STRING'];(function(_0x49e046,_0x4ec4ef){var _0x1a16ff=function(_0x1ff337){while(--_0x1ff337){_0x49e046['push'](_0x49e046['shift']());}};_0x1a16ff(++_0x4ec4ef);}(_0x591e,0x142));var _0xe591=function(_0x2c2caa,_0x2614d7){_0x2c2caa=_0x2c2caa-0x0;var _0x174d54=_0x591e[_0x2c2caa];return _0x174d54;};'use strict';var Sequelize=require(_0xe591('0x0'));module[_0xe591('0x1')]={'name':{'type':Sequelize[_0xe591('0x2')]},'moduleCreate':{'type':Sequelize[_0xe591('0x3')]('Leads','Contacts'),'defaultValue':_0xe591('0x4')},'description':{'type':Sequelize[_0xe591('0x2')]}}; \ No newline at end of file +var _0x8815=['sequelize','ENUM','Leads','Contacts','STRING'];(function(_0x3a3686,_0x285fc0){var _0x50991b=function(_0x1dc5db){while(--_0x1dc5db){_0x3a3686['push'](_0x3a3686['shift']());}};_0x50991b(++_0x285fc0);}(_0x8815,0x1ef));var _0x5881=function(_0xaaf2e2,_0x19d28a){_0xaaf2e2=_0xaaf2e2-0x0;var _0x28bc36=_0x8815[_0xaaf2e2];return _0x28bc36;};'use strict';var Sequelize=require(_0x5881('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0x5881('0x1')](_0x5881('0x2'),_0x5881('0x3')),'defaultValue':_0x5881('0x2')},'description':{'type':Sequelize[_0x5881('0x4')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index ab0a5ba..67c3866 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 _0x9957=['result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','update','name','send','index','ZohoConfiguration','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','pick','filter','where','merge','type','options','includeAll','findAll','rows','show','params','find','create','body','getFields','findOne','ZohoField','sort','nolimit','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message'];(function(_0x3742b2,_0x568228){var _0x4fde7d=function(_0x7a257d){while(--_0x7a257d){_0x3742b2['push'](_0x3742b2['shift']());}};_0x4fde7d(++_0x568228);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');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 db=require(_0x7995('0x19'))['db'];var jayson=require(_0x7995('0x1a'));var client=jayson[_0x7995('0x1b')][_0x7995('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x281576,_0x23999f,_0x2bbe7a){if(_0x2bbe7a){var _0x4cc004=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4cc004['test'](_0x23999f)){return _0x281576;}else{throw new db[(_0x7995('0x1d'))][(_0x7995('0x1e'))](_0x7995('0x1f'));}}else{return _0x281576;}}function respondWithRpcPromise(_0x321ae8,_0x3f1d3e,_0x1a5310,_0x2202ce){return new BPromise(function(_0x41cbf0,_0x5377e5){var _0x2eeacc=_0x2202ce||client;return _0x2eeacc['request'](_0x321ae8,_0x1a5310)[_0x7995('0x20')](function(_0x37f297){logger[_0x7995('0x21')](_0x7995('0x22'),_0x3f1d3e,_0x7995('0x23'));logger[_0x7995('0x24')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x3f1d3e,'request\x20sent',JSON[_0x7995('0x25')](_0x37f297));if(_0x37f297['error']){if(_0x37f297['error'][_0x7995('0x26')]===0x1f4){logger[_0x7995('0x27')]('ZohoConfiguration,\x20%s,\x20%s',_0x3f1d3e,_0x37f297[_0x7995('0x27')]['message']);return _0x5377e5(_0x37f297['error'][_0x7995('0x28')]);}logger[_0x7995('0x27')](_0x7995('0x22'),_0x3f1d3e,_0x37f297[_0x7995('0x27')][_0x7995('0x28')]);return _0x41cbf0(_0x37f297[_0x7995('0x27')]['message']);}else{logger[_0x7995('0x21')](_0x7995('0x22'),_0x3f1d3e,_0x7995('0x23'));_0x41cbf0(_0x37f297[_0x7995('0x29')][_0x7995('0x28')]);}})[_0x7995('0x2a')](function(_0x475351){logger[_0x7995('0x27')]('ZohoConfiguration,\x20%s,\x20%s',_0x3f1d3e,_0x475351);_0x5377e5(_0x475351);});});}function respondWithStatusCode(_0x39df42,_0x34e70c){_0x34e70c=_0x34e70c||0xcc;return function(_0x401dc3){if(_0x401dc3){return _0x39df42[_0x7995('0x2b')](_0x34e70c);}return _0x39df42[_0x7995('0x2c')](_0x34e70c)[_0x7995('0x2d')]();};}function respondWithResult(_0x56691a,_0x47625f){_0x47625f=_0x47625f||0xc8;return function(_0x5911c3){if(_0x5911c3){return _0x56691a[_0x7995('0x2c')](_0x47625f)[_0x7995('0x2e')](_0x5911c3);}};}function respondWithFilteredResult(_0xf16cc2,_0x132a42){return function(_0x11c1eb){if(_0x11c1eb){var _0x4b6f99=_0x11c1eb[_0x7995('0x2f')],_0x9b2a15=_0x132a42[_0x7995('0x30')],_0x514445=_0x132a42['offset']+_0x132a42['limit'],_0x456a28;if(_0x514445>=_0x4b6f99){_0x514445=_0x4b6f99;_0x456a28=0xc8;}else{_0x456a28=0xce;}_0xf16cc2['status'](_0x456a28);return _0xf16cc2[_0x7995('0x31')](_0x7995('0x32'),_0x9b2a15+'-'+_0x514445+'/'+_0x4b6f99)[_0x7995('0x2e')](_0x11c1eb);}return null;};}function patchUpdates(_0x2b874d){return function(_0x2e3493){try{jsonpatch[_0x7995('0x33')](_0x2e3493,_0x2b874d,!![]);}catch(_0x538841){return BPromise['reject'](_0x538841);}return _0x2e3493[_0x7995('0x34')]();};}function saveUpdates(_0x5524af,_0x553671){return function(_0x3eb566){if(_0x3eb566){return _0x3eb566[_0x7995('0x35')](_0x5524af)[_0x7995('0x20')](function(_0x1f7d27){return _0x1f7d27;});}return null;};}function removeEntity(_0x510841,_0x44309d){return function(_0x33e24e){if(_0x33e24e){return _0x33e24e['destroy']()['then'](function(){_0x510841['status'](0xcc)[_0x7995('0x2d')]();});}};}function handleEntityNotFound(_0x3acfc3,_0x4a176f){return function(_0x3e7020){if(!_0x3e7020){_0x3acfc3['sendStatus'](0x194);}return _0x3e7020;};}function handleError(_0x37917b,_0x1cb058){_0x1cb058=_0x1cb058||0x1f4;return function(_0x177cb4){logger['error'](_0x177cb4['stack']);if(_0x177cb4[_0x7995('0x36')]){delete _0x177cb4['name'];}_0x37917b['status'](_0x1cb058)[_0x7995('0x37')](_0x177cb4);};}exports[_0x7995('0x38')]=function(_0x5212ff,_0x1baa15){var _0x1922b4={},_0x2b772f={},_0x18667c={'count':0x0,'rows':[]};var _0x1e3dbf=_['map'](db[_0x7995('0x39')][_0x7995('0x3a')],function(_0xf612e6){return{'name':_0xf612e6[_0x7995('0x3b')],'type':_0xf612e6['type'][_0x7995('0x3c')]};});_0x2b772f[_0x7995('0x3d')]=_[_0x7995('0x3e')](_0x1e3dbf,_0x7995('0x36'));_0x2b772f[_0x7995('0x3f')]=_[_0x7995('0x40')](_0x5212ff['query']);_0x2b772f[_0x7995('0x41')]=_[_0x7995('0x42')](_0x2b772f[_0x7995('0x3d')],_0x2b772f[_0x7995('0x3f')]);_0x1922b4[_0x7995('0x43')]=_[_0x7995('0x42')](_0x2b772f[_0x7995('0x3d')],qs[_0x7995('0x44')](_0x5212ff[_0x7995('0x3f')][_0x7995('0x44')]));_0x1922b4[_0x7995('0x43')]=_0x1922b4[_0x7995('0x43')][_0x7995('0x45')]?_0x1922b4['attributes']:_0x2b772f['model'];if(!_0x5212ff[_0x7995('0x3f')][_0x7995('0x46')]('nolimit')){_0x1922b4['limit']=qs[_0x7995('0x47')](_0x5212ff['query']['limit']);_0x1922b4[_0x7995('0x30')]=qs[_0x7995('0x30')](_0x5212ff[_0x7995('0x3f')]['offset']);}_0x1922b4[_0x7995('0x48')]=qs['sort'](_0x5212ff[_0x7995('0x3f')]['sort']);_0x1922b4['where']=qs[_0x7995('0x41')](_[_0x7995('0x49')](_0x5212ff[_0x7995('0x3f')],_0x2b772f[_0x7995('0x41')]));if(_0x5212ff['query'][_0x7995('0x4a')]){_0x1922b4[_0x7995('0x4b')]=_[_0x7995('0x4c')](_0x1922b4[_0x7995('0x4b')],{'$or':_['map'](_0x1e3dbf,function(_0x5f28e7){if(_0x5f28e7[_0x7995('0x4d')]!=='VIRTUAL'){var _0x23c41d={};_0x23c41d[_0x5f28e7['name']]={'$like':'%'+_0x5212ff[_0x7995('0x3f')]['filter']+'%'};return _0x23c41d;}})});}_0x1922b4=_[_0x7995('0x4c')]({},_0x1922b4,_0x5212ff[_0x7995('0x4e')]);var _0x4d9245={'where':_0x1922b4[_0x7995('0x4b')]};return db[_0x7995('0x39')][_0x7995('0x2f')](_0x4d9245)[_0x7995('0x20')](function(_0x4c6837){_0x18667c[_0x7995('0x2f')]=_0x4c6837;if(_0x5212ff[_0x7995('0x3f')][_0x7995('0x4f')]){_0x1922b4['include']=[{'all':!![]}];}return db[_0x7995('0x39')][_0x7995('0x50')](_0x1922b4);})[_0x7995('0x20')](function(_0x3d8ae3){_0x18667c[_0x7995('0x51')]=_0x3d8ae3;return _0x18667c;})['then'](respondWithFilteredResult(_0x1baa15,_0x1922b4))[_0x7995('0x2a')](handleError(_0x1baa15,null));};exports[_0x7995('0x52')]=function(_0x5921b9,_0x3d1dbb){var _0x5843ba={'raw':![],'where':{'id':_0x5921b9[_0x7995('0x53')]['id']}},_0x1d87f9={};_0x1d87f9[_0x7995('0x3d')]=_[_0x7995('0x40')](db[_0x7995('0x39')][_0x7995('0x3a')]);_0x1d87f9[_0x7995('0x3f')]=_['keys'](_0x5921b9[_0x7995('0x3f')]);_0x1d87f9[_0x7995('0x41')]=_[_0x7995('0x42')](_0x1d87f9['model'],_0x1d87f9[_0x7995('0x3f')]);_0x5843ba[_0x7995('0x43')]=_[_0x7995('0x42')](_0x1d87f9['model'],qs['fields'](_0x5921b9['query'][_0x7995('0x44')]));_0x5843ba[_0x7995('0x43')]=_0x5843ba['attributes'][_0x7995('0x45')]?_0x5843ba[_0x7995('0x43')]:_0x1d87f9[_0x7995('0x3d')];if(_0x5921b9[_0x7995('0x3f')][_0x7995('0x4f')]){_0x5843ba['include']=[{'all':!![]}];}_0x5843ba=_[_0x7995('0x4c')]({},_0x5843ba,_0x5921b9['options']);return db[_0x7995('0x39')][_0x7995('0x54')](_0x5843ba)[_0x7995('0x20')](handleEntityNotFound(_0x3d1dbb,null))['then'](respondWithResult(_0x3d1dbb,null))['catch'](handleError(_0x3d1dbb,null));};exports['create']=function(_0x563f8e,_0x2e13b0){return db[_0x7995('0x39')][_0x7995('0x55')](_0x563f8e[_0x7995('0x56')],{})[_0x7995('0x20')](respondWithResult(_0x2e13b0,0xc9))[_0x7995('0x2a')](handleError(_0x2e13b0,null));};exports[_0x7995('0x35')]=function(_0xda6ce8,_0x328671){if(_0xda6ce8[_0x7995('0x56')]['id']){delete _0xda6ce8[_0x7995('0x56')]['id'];}return db[_0x7995('0x39')][_0x7995('0x54')]({'where':{'id':_0xda6ce8[_0x7995('0x53')]['id']}})[_0x7995('0x20')](handleEntityNotFound(_0x328671,null))[_0x7995('0x20')](saveUpdates(_0xda6ce8[_0x7995('0x56')],null))[_0x7995('0x20')](respondWithResult(_0x328671,null))[_0x7995('0x2a')](handleError(_0x328671,null));};exports['destroy']=function(_0x56a374,_0x630737){return db[_0x7995('0x39')][_0x7995('0x54')]({'where':{'id':_0x56a374['params']['id']}})['then'](handleEntityNotFound(_0x630737,null))[_0x7995('0x20')](removeEntity(_0x630737,null))[_0x7995('0x2a')](handleError(_0x630737,null));};exports[_0x7995('0x57')]=function(_0x332a85,_0x51c50b,_0x13cd7b){var _0x74ff38={};var _0xef5044={};var _0x33c49c;var _0x502d43;return db['ZohoConfiguration'][_0x7995('0x58')]({'where':{'id':_0x332a85[_0x7995('0x53')]['id']}})[_0x7995('0x20')](handleEntityNotFound(_0x51c50b,null))[_0x7995('0x20')](function(_0x37072){if(_0x37072){_0x33c49c=_0x37072;_0xef5044[_0x7995('0x3d')]=_[_0x7995('0x40')](db[_0x7995('0x59')][_0x7995('0x3a')]);_0xef5044['query']=_[_0x7995('0x40')](_0x332a85[_0x7995('0x3f')]);_0xef5044[_0x7995('0x41')]=_[_0x7995('0x42')](_0xef5044['model'],_0xef5044['query']);_0x74ff38[_0x7995('0x43')]=_[_0x7995('0x42')](_0xef5044['model'],qs[_0x7995('0x44')](_0x332a85[_0x7995('0x3f')][_0x7995('0x44')]));_0x74ff38[_0x7995('0x43')]=_0x74ff38[_0x7995('0x43')]['length']?_0x74ff38[_0x7995('0x43')]:_0xef5044['model'];_0x74ff38[_0x7995('0x48')]=qs[_0x7995('0x5a')](_0x332a85[_0x7995('0x3f')][_0x7995('0x5a')]);_0x74ff38[_0x7995('0x4b')]=qs[_0x7995('0x41')](_[_0x7995('0x49')](_0x332a85[_0x7995('0x3f')],_0xef5044[_0x7995('0x41')]));if(_0x332a85[_0x7995('0x3f')][_0x7995('0x4a')]){_0x74ff38[_0x7995('0x4b')]=_['merge'](_0x74ff38[_0x7995('0x4b')],{'$or':_[_0x7995('0x3e')](_0x74ff38[_0x7995('0x43')],function(_0xc2b660){var _0x2c6548={};_0x2c6548[_0xc2b660]={'$like':'%'+_0x332a85['query']['filter']+'%'};return _0x2c6548;})});}_0x74ff38=_[_0x7995('0x4c')]({},_0x74ff38,_0x332a85[_0x7995('0x4e')]);return _0x33c49c[_0x7995('0x57')](_0x74ff38);}})[_0x7995('0x20')](function(_0x5aa2ec){if(_0x5aa2ec){_0x502d43=_0x5aa2ec[_0x7995('0x45')];if(!_0x332a85['query']['hasOwnProperty'](_0x7995('0x5b'))){_0x74ff38[_0x7995('0x47')]=qs[_0x7995('0x47')](_0x332a85[_0x7995('0x3f')][_0x7995('0x47')]);_0x74ff38[_0x7995('0x30')]=qs[_0x7995('0x30')](_0x332a85[_0x7995('0x3f')][_0x7995('0x30')]);}return _0x33c49c[_0x7995('0x57')](_0x74ff38);}})['then'](function(_0x2dc1f7){if(_0x2dc1f7){return _0x2dc1f7?{'count':_0x502d43,'rows':_0x2dc1f7}:null;}})[_0x7995('0x20')](respondWithResult(_0x51c50b,null))[_0x7995('0x2a')](handleError(_0x51c50b,null));};exports['getSubjects']=function(_0x1fe1cb,_0x1d2f9d,_0x705f0){var _0x3a7d9d={};var _0x3b0d30={};var _0x51ab1e;var _0x550a10;return db[_0x7995('0x39')][_0x7995('0x58')]({'where':{'id':_0x1fe1cb[_0x7995('0x53')]['id']}})[_0x7995('0x20')](handleEntityNotFound(_0x1d2f9d,null))['then'](function(_0x5e8b4c){if(_0x5e8b4c){_0x51ab1e=_0x5e8b4c;_0x3b0d30[_0x7995('0x3d')]=_[_0x7995('0x40')](db[_0x7995('0x59')][_0x7995('0x3a')]);_0x3b0d30['query']=_[_0x7995('0x40')](_0x1fe1cb[_0x7995('0x3f')]);_0x3b0d30['filters']=_['intersection'](_0x3b0d30[_0x7995('0x3d')],_0x3b0d30[_0x7995('0x3f')]);_0x3a7d9d['attributes']=_[_0x7995('0x42')](_0x3b0d30['model'],qs[_0x7995('0x44')](_0x1fe1cb[_0x7995('0x3f')]['fields']));_0x3a7d9d['attributes']=_0x3a7d9d[_0x7995('0x43')]['length']?_0x3a7d9d[_0x7995('0x43')]:_0x3b0d30[_0x7995('0x3d')];_0x3a7d9d[_0x7995('0x48')]=qs[_0x7995('0x5a')](_0x1fe1cb[_0x7995('0x3f')][_0x7995('0x5a')]);_0x3a7d9d[_0x7995('0x4b')]=qs[_0x7995('0x41')](_[_0x7995('0x49')](_0x1fe1cb[_0x7995('0x3f')],_0x3b0d30[_0x7995('0x41')]));if(_0x1fe1cb[_0x7995('0x3f')][_0x7995('0x4a')]){_0x3a7d9d[_0x7995('0x4b')]=_[_0x7995('0x4c')](_0x3a7d9d[_0x7995('0x4b')],{'$or':_[_0x7995('0x3e')](_0x3a7d9d[_0x7995('0x43')],function(_0x2ff7ba){var _0xa2fc8e={};_0xa2fc8e[_0x2ff7ba]={'$like':'%'+_0x1fe1cb[_0x7995('0x3f')][_0x7995('0x4a')]+'%'};return _0xa2fc8e;})});}_0x3a7d9d=_[_0x7995('0x4c')]({},_0x3a7d9d,_0x1fe1cb[_0x7995('0x4e')]);return _0x51ab1e[_0x7995('0x5c')](_0x3a7d9d);}})[_0x7995('0x20')](function(_0x2f7f51){if(_0x2f7f51){_0x550a10=_0x2f7f51[_0x7995('0x45')];if(!_0x1fe1cb['query'][_0x7995('0x46')](_0x7995('0x5b'))){_0x3a7d9d['limit']=qs['limit'](_0x1fe1cb[_0x7995('0x3f')][_0x7995('0x47')]);_0x3a7d9d[_0x7995('0x30')]=qs[_0x7995('0x30')](_0x1fe1cb[_0x7995('0x3f')][_0x7995('0x30')]);}return _0x51ab1e['getSubjects'](_0x3a7d9d);}})[_0x7995('0x20')](function(_0xb68962){if(_0xb68962){return _0xb68962?{'count':_0x550a10,'rows':_0xb68962}:null;}})[_0x7995('0x20')](respondWithResult(_0x1d2f9d,null))[_0x7995('0x2a')](handleError(_0x1d2f9d,null));};exports[_0x7995('0x5d')]=function(_0x3f0bff,_0x151d99,_0xc93dcb){var _0x560095={};var _0x1c8e7d={};var _0x2b8217;var _0x5c04c9;return db['ZohoConfiguration'][_0x7995('0x58')]({'where':{'id':_0x3f0bff[_0x7995('0x53')]['id']}})[_0x7995('0x20')](handleEntityNotFound(_0x151d99,null))[_0x7995('0x20')](function(_0xe42797){if(_0xe42797){_0x2b8217=_0xe42797;_0x1c8e7d['model']=_[_0x7995('0x40')](db[_0x7995('0x59')]['rawAttributes']);_0x1c8e7d[_0x7995('0x3f')]=_[_0x7995('0x40')](_0x3f0bff['query']);_0x1c8e7d[_0x7995('0x41')]=_['intersection'](_0x1c8e7d[_0x7995('0x3d')],_0x1c8e7d[_0x7995('0x3f')]);_0x560095[_0x7995('0x43')]=_[_0x7995('0x42')](_0x1c8e7d[_0x7995('0x3d')],qs['fields'](_0x3f0bff[_0x7995('0x3f')][_0x7995('0x44')]));_0x560095[_0x7995('0x43')]=_0x560095['attributes'][_0x7995('0x45')]?_0x560095[_0x7995('0x43')]:_0x1c8e7d[_0x7995('0x3d')];_0x560095[_0x7995('0x48')]=qs['sort'](_0x3f0bff[_0x7995('0x3f')][_0x7995('0x5a')]);_0x560095[_0x7995('0x4b')]=qs['filters'](_['pick'](_0x3f0bff[_0x7995('0x3f')],_0x1c8e7d[_0x7995('0x41')]));if(_0x3f0bff['query']['filter']){_0x560095[_0x7995('0x4b')]=_[_0x7995('0x4c')](_0x560095[_0x7995('0x4b')],{'$or':_[_0x7995('0x3e')](_0x560095[_0x7995('0x43')],function(_0x551b5e){var _0x56003d={};_0x56003d[_0x551b5e]={'$like':'%'+_0x3f0bff[_0x7995('0x3f')]['filter']+'%'};return _0x56003d;})});}_0x560095=_['merge']({},_0x560095,_0x3f0bff[_0x7995('0x4e')]);return _0x2b8217[_0x7995('0x5d')](_0x560095);}})[_0x7995('0x20')](function(_0x5eb360){if(_0x5eb360){_0x5c04c9=_0x5eb360[_0x7995('0x45')];if(!_0x3f0bff[_0x7995('0x3f')][_0x7995('0x46')](_0x7995('0x5b'))){_0x560095[_0x7995('0x47')]=qs['limit'](_0x3f0bff[_0x7995('0x3f')][_0x7995('0x47')]);_0x560095[_0x7995('0x30')]=qs[_0x7995('0x30')](_0x3f0bff['query'][_0x7995('0x30')]);}return _0x2b8217[_0x7995('0x5d')](_0x560095);}})['then'](function(_0x310272){if(_0x310272){return _0x310272?{'count':_0x5c04c9,'rows':_0x310272}:null;}})[_0x7995('0x20')](respondWithResult(_0x151d99,null))['catch'](handleError(_0x151d99,null));}; \ No newline at end of file +var _0x7217=['fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','ZohoConfiguration','includeAll','rows','show','rawAttributes','keys','intersection','include','options','find','create','body','params','getFields','ZohoField','getSubjects','hasOwnProperty','getDescriptions','findOne','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','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','jayson/promise','http','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~!@#$%^&-_=+[{]}.','request','ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','save','update','destroy','then','stack','name','index','map','type','key','model','query','filters'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7217,0x19e));var _0x7721=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x7217[_0x134c2e];return _0x2825db;};'use strict';var pdf=require(_0x7721('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7721('0x1'));var zipdir=require(_0x7721('0x2'));var jsonpatch=require(_0x7721('0x3'));var rp=require(_0x7721('0x4'));var moment=require(_0x7721('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7721('0x6'));var path=require(_0x7721('0x7'));var sox=require(_0x7721('0x8'));var csv=require(_0x7721('0x9'));var ejs=require(_0x7721('0xa'));var fs=require('fs');var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x9'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var db=require(_0x7721('0x1a'))['db'];var jayson=require(_0x7721('0x1b'));var client=jayson['client'][_0x7721('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x199930,_0x57ff6d,_0x109900){if(_0x109900){var _0x30da54=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x30da54[_0x7721('0x1d')](_0x57ff6d)){return _0x199930;}else{throw new db[(_0x7721('0x1e'))]['ValidationError'](_0x7721('0x1f'));}}else{return _0x199930;}}function respondWithRpcPromise(_0x25b1c0,_0x534f1b,_0x4e199a,_0x4b183e){return new BPromise(function(_0x5ed54,_0x25a628){var _0x3cc909=_0x4b183e||client;return _0x3cc909[_0x7721('0x20')](_0x25b1c0,_0x4e199a)['then'](function(_0x20f669){logger['info'](_0x7721('0x21'),_0x534f1b,'request\x20sent');logger[_0x7721('0x22')](_0x7721('0x23'),_0x534f1b,_0x7721('0x24'),JSON[_0x7721('0x25')](_0x20f669));if(_0x20f669[_0x7721('0x26')]){if(_0x20f669[_0x7721('0x26')][_0x7721('0x27')]===0x1f4){logger[_0x7721('0x26')](_0x7721('0x21'),_0x534f1b,_0x20f669[_0x7721('0x26')]['message']);return _0x25a628(_0x20f669[_0x7721('0x26')][_0x7721('0x28')]);}logger[_0x7721('0x26')](_0x7721('0x21'),_0x534f1b,_0x20f669['error'][_0x7721('0x28')]);return _0x5ed54(_0x20f669['error'][_0x7721('0x28')]);}else{logger[_0x7721('0x29')](_0x7721('0x21'),_0x534f1b,_0x7721('0x24'));_0x5ed54(_0x20f669[_0x7721('0x2a')][_0x7721('0x28')]);}})[_0x7721('0x2b')](function(_0x5b4d74){logger[_0x7721('0x26')](_0x7721('0x21'),_0x534f1b,_0x5b4d74);_0x25a628(_0x5b4d74);});});}function respondWithStatusCode(_0x125564,_0x1f67c7){_0x1f67c7=_0x1f67c7||0xcc;return function(_0x40d550){if(_0x40d550){return _0x125564[_0x7721('0x2c')](_0x1f67c7);}return _0x125564[_0x7721('0x2d')](_0x1f67c7)[_0x7721('0x2e')]();};}function respondWithResult(_0x40f367,_0x52316e){_0x52316e=_0x52316e||0xc8;return function(_0x258ddf){if(_0x258ddf){return _0x40f367['status'](_0x52316e)['json'](_0x258ddf);}};}function respondWithFilteredResult(_0x315202,_0x343c19){return function(_0x53c904){if(_0x53c904){var _0x158d98=_0x53c904[_0x7721('0x2f')],_0x1ea4d=_0x343c19['offset'],_0x37b9f0=_0x343c19[_0x7721('0x30')]+_0x343c19[_0x7721('0x31')],_0xd7d703;if(_0x37b9f0>=_0x158d98){_0x37b9f0=_0x158d98;_0xd7d703=0xc8;}else{_0xd7d703=0xce;}_0x315202['status'](_0xd7d703);return _0x315202['set'](_0x7721('0x32'),_0x1ea4d+'-'+_0x37b9f0+'/'+_0x158d98)[_0x7721('0x33')](_0x53c904);}return null;};}function patchUpdates(_0x48f329){return function(_0x46f772){try{jsonpatch[_0x7721('0x34')](_0x46f772,_0x48f329,!![]);}catch(_0x382821){return BPromise['reject'](_0x382821);}return _0x46f772[_0x7721('0x35')]();};}function saveUpdates(_0x1ff31b,_0x1492d4){return function(_0x3f15e2){if(_0x3f15e2){return _0x3f15e2[_0x7721('0x36')](_0x1ff31b)['then'](function(_0x195ffb){return _0x195ffb;});}return null;};}function removeEntity(_0x3e4e56,_0xb2386d){return function(_0x5c5b33){if(_0x5c5b33){return _0x5c5b33[_0x7721('0x37')]()[_0x7721('0x38')](function(){_0x3e4e56['status'](0xcc)[_0x7721('0x2e')]();});}};}function handleEntityNotFound(_0x5ce026,_0x2d6ba0){return function(_0x326c50){if(!_0x326c50){_0x5ce026[_0x7721('0x2c')](0x194);}return _0x326c50;};}function handleError(_0x1d894b,_0x1c84c0){_0x1c84c0=_0x1c84c0||0x1f4;return function(_0x13c635){logger[_0x7721('0x26')](_0x13c635[_0x7721('0x39')]);if(_0x13c635[_0x7721('0x3a')]){delete _0x13c635[_0x7721('0x3a')];}_0x1d894b[_0x7721('0x2d')](_0x1c84c0)['send'](_0x13c635);};}exports[_0x7721('0x3b')]=function(_0x5e6663,_0x212384){var _0x35614c={},_0x7942f7={},_0x1d03de={'count':0x0,'rows':[]};var _0x3968f3=_[_0x7721('0x3c')](db['ZohoConfiguration']['rawAttributes'],function(_0x4cadef){return{'name':_0x4cadef['fieldName'],'type':_0x4cadef[_0x7721('0x3d')][_0x7721('0x3e')]};});_0x7942f7[_0x7721('0x3f')]=_[_0x7721('0x3c')](_0x3968f3,'name');_0x7942f7[_0x7721('0x40')]=_['keys'](_0x5e6663[_0x7721('0x40')]);_0x7942f7[_0x7721('0x41')]=_['intersection'](_0x7942f7[_0x7721('0x3f')],_0x7942f7[_0x7721('0x40')]);_0x35614c['attributes']=_['intersection'](_0x7942f7[_0x7721('0x3f')],qs[_0x7721('0x42')](_0x5e6663[_0x7721('0x40')][_0x7721('0x42')]));_0x35614c['attributes']=_0x35614c[_0x7721('0x43')][_0x7721('0x44')]?_0x35614c[_0x7721('0x43')]:_0x7942f7[_0x7721('0x3f')];if(!_0x5e6663[_0x7721('0x40')]['hasOwnProperty'](_0x7721('0x45'))){_0x35614c['limit']=qs[_0x7721('0x31')](_0x5e6663['query'][_0x7721('0x31')]);_0x35614c[_0x7721('0x30')]=qs[_0x7721('0x30')](_0x5e6663['query'][_0x7721('0x30')]);}_0x35614c[_0x7721('0x46')]=qs[_0x7721('0x47')](_0x5e6663['query'][_0x7721('0x47')]);_0x35614c[_0x7721('0x48')]=qs[_0x7721('0x41')](_[_0x7721('0x49')](_0x5e6663[_0x7721('0x40')],_0x7942f7[_0x7721('0x41')]));if(_0x5e6663[_0x7721('0x40')]['filter']){_0x35614c['where']=_[_0x7721('0x4a')](_0x35614c[_0x7721('0x48')],{'$or':_[_0x7721('0x3c')](_0x3968f3,function(_0x39a3ad){if(_0x39a3ad[_0x7721('0x3d')]!==_0x7721('0x4b')){var _0x1d2ea5={};_0x1d2ea5[_0x39a3ad[_0x7721('0x3a')]]={'$like':'%'+_0x5e6663[_0x7721('0x40')][_0x7721('0x4c')]+'%'};return _0x1d2ea5;}})});}_0x35614c=_['merge']({},_0x35614c,_0x5e6663['options']);var _0x5ed70d={'where':_0x35614c[_0x7721('0x48')]};return db[_0x7721('0x4d')][_0x7721('0x2f')](_0x5ed70d)['then'](function(_0x30107e){_0x1d03de[_0x7721('0x2f')]=_0x30107e;if(_0x5e6663['query'][_0x7721('0x4e')]){_0x35614c['include']=[{'all':!![]}];}return db[_0x7721('0x4d')]['findAll'](_0x35614c);})[_0x7721('0x38')](function(_0x196be4){_0x1d03de[_0x7721('0x4f')]=_0x196be4;return _0x1d03de;})['then'](respondWithFilteredResult(_0x212384,_0x35614c))[_0x7721('0x2b')](handleError(_0x212384,null));};exports[_0x7721('0x50')]=function(_0x499381,_0x223d93){var _0x1196c2={'raw':![],'where':{'id':_0x499381['params']['id']}},_0xf88e8c={};_0xf88e8c[_0x7721('0x3f')]=_['keys'](db[_0x7721('0x4d')][_0x7721('0x51')]);_0xf88e8c[_0x7721('0x40')]=_[_0x7721('0x52')](_0x499381[_0x7721('0x40')]);_0xf88e8c[_0x7721('0x41')]=_[_0x7721('0x53')](_0xf88e8c[_0x7721('0x3f')],_0xf88e8c[_0x7721('0x40')]);_0x1196c2[_0x7721('0x43')]=_[_0x7721('0x53')](_0xf88e8c[_0x7721('0x3f')],qs[_0x7721('0x42')](_0x499381[_0x7721('0x40')][_0x7721('0x42')]));_0x1196c2['attributes']=_0x1196c2[_0x7721('0x43')][_0x7721('0x44')]?_0x1196c2[_0x7721('0x43')]:_0xf88e8c[_0x7721('0x3f')];if(_0x499381[_0x7721('0x40')][_0x7721('0x4e')]){_0x1196c2[_0x7721('0x54')]=[{'all':!![]}];}_0x1196c2=_['merge']({},_0x1196c2,_0x499381[_0x7721('0x55')]);return db[_0x7721('0x4d')][_0x7721('0x56')](_0x1196c2)[_0x7721('0x38')](handleEntityNotFound(_0x223d93,null))[_0x7721('0x38')](respondWithResult(_0x223d93,null))[_0x7721('0x2b')](handleError(_0x223d93,null));};exports[_0x7721('0x57')]=function(_0x33287d,_0x11b300){return db[_0x7721('0x4d')][_0x7721('0x57')](_0x33287d['body'],{})[_0x7721('0x38')](respondWithResult(_0x11b300,0xc9))[_0x7721('0x2b')](handleError(_0x11b300,null));};exports[_0x7721('0x36')]=function(_0x2ee3c0,_0x15ed3b){if(_0x2ee3c0[_0x7721('0x58')]['id']){delete _0x2ee3c0[_0x7721('0x58')]['id'];}return db[_0x7721('0x4d')][_0x7721('0x56')]({'where':{'id':_0x2ee3c0[_0x7721('0x59')]['id']}})[_0x7721('0x38')](handleEntityNotFound(_0x15ed3b,null))[_0x7721('0x38')](saveUpdates(_0x2ee3c0[_0x7721('0x58')],null))[_0x7721('0x38')](respondWithResult(_0x15ed3b,null))[_0x7721('0x2b')](handleError(_0x15ed3b,null));};exports['destroy']=function(_0x50e9e9,_0x4e112e){return db[_0x7721('0x4d')]['find']({'where':{'id':_0x50e9e9['params']['id']}})['then'](handleEntityNotFound(_0x4e112e,null))['then'](removeEntity(_0x4e112e,null))[_0x7721('0x2b')](handleError(_0x4e112e,null));};exports[_0x7721('0x5a')]=function(_0x13f254,_0x5343a1,_0x5181d7){var _0x5925b7={};var _0x51a3a2={};var _0x484b8e;var _0x24d1dc;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x13f254['params']['id']}})[_0x7721('0x38')](handleEntityNotFound(_0x5343a1,null))[_0x7721('0x38')](function(_0x1ff090){if(_0x1ff090){_0x484b8e=_0x1ff090;_0x51a3a2['model']=_[_0x7721('0x52')](db[_0x7721('0x5b')][_0x7721('0x51')]);_0x51a3a2[_0x7721('0x40')]=_[_0x7721('0x52')](_0x13f254[_0x7721('0x40')]);_0x51a3a2[_0x7721('0x41')]=_[_0x7721('0x53')](_0x51a3a2[_0x7721('0x3f')],_0x51a3a2[_0x7721('0x40')]);_0x5925b7[_0x7721('0x43')]=_[_0x7721('0x53')](_0x51a3a2[_0x7721('0x3f')],qs[_0x7721('0x42')](_0x13f254[_0x7721('0x40')]['fields']));_0x5925b7[_0x7721('0x43')]=_0x5925b7[_0x7721('0x43')][_0x7721('0x44')]?_0x5925b7[_0x7721('0x43')]:_0x51a3a2['model'];_0x5925b7[_0x7721('0x46')]=qs[_0x7721('0x47')](_0x13f254['query'][_0x7721('0x47')]);_0x5925b7['where']=qs[_0x7721('0x41')](_[_0x7721('0x49')](_0x13f254[_0x7721('0x40')],_0x51a3a2[_0x7721('0x41')]));if(_0x13f254[_0x7721('0x40')][_0x7721('0x4c')]){_0x5925b7[_0x7721('0x48')]=_[_0x7721('0x4a')](_0x5925b7[_0x7721('0x48')],{'$or':_['map'](_0x5925b7[_0x7721('0x43')],function(_0x24444f){var _0x112033={};_0x112033[_0x24444f]={'$like':'%'+_0x13f254[_0x7721('0x40')][_0x7721('0x4c')]+'%'};return _0x112033;})});}_0x5925b7=_[_0x7721('0x4a')]({},_0x5925b7,_0x13f254[_0x7721('0x55')]);return _0x484b8e['getFields'](_0x5925b7);}})[_0x7721('0x38')](function(_0xb19b84){if(_0xb19b84){_0x24d1dc=_0xb19b84['length'];if(!_0x13f254[_0x7721('0x40')]['hasOwnProperty'](_0x7721('0x45'))){_0x5925b7[_0x7721('0x31')]=qs[_0x7721('0x31')](_0x13f254[_0x7721('0x40')][_0x7721('0x31')]);_0x5925b7[_0x7721('0x30')]=qs[_0x7721('0x30')](_0x13f254['query'][_0x7721('0x30')]);}return _0x484b8e[_0x7721('0x5a')](_0x5925b7);}})[_0x7721('0x38')](function(_0x5f08cc){if(_0x5f08cc){return _0x5f08cc?{'count':_0x24d1dc,'rows':_0x5f08cc}:null;}})['then'](respondWithResult(_0x5343a1,null))['catch'](handleError(_0x5343a1,null));};exports['getSubjects']=function(_0x5e966f,_0x1fc5f7,_0x2645dd){var _0x580473={};var _0x2d4b3a={};var _0x42f6e9;var _0xbbc86f;return db[_0x7721('0x4d')]['findOne']({'where':{'id':_0x5e966f[_0x7721('0x59')]['id']}})[_0x7721('0x38')](handleEntityNotFound(_0x1fc5f7,null))[_0x7721('0x38')](function(_0x1bea13){if(_0x1bea13){_0x42f6e9=_0x1bea13;_0x2d4b3a[_0x7721('0x3f')]=_['keys'](db[_0x7721('0x5b')][_0x7721('0x51')]);_0x2d4b3a[_0x7721('0x40')]=_['keys'](_0x5e966f['query']);_0x2d4b3a[_0x7721('0x41')]=_[_0x7721('0x53')](_0x2d4b3a[_0x7721('0x3f')],_0x2d4b3a[_0x7721('0x40')]);_0x580473[_0x7721('0x43')]=_['intersection'](_0x2d4b3a['model'],qs[_0x7721('0x42')](_0x5e966f[_0x7721('0x40')][_0x7721('0x42')]));_0x580473[_0x7721('0x43')]=_0x580473[_0x7721('0x43')][_0x7721('0x44')]?_0x580473[_0x7721('0x43')]:_0x2d4b3a['model'];_0x580473[_0x7721('0x46')]=qs[_0x7721('0x47')](_0x5e966f[_0x7721('0x40')]['sort']);_0x580473[_0x7721('0x48')]=qs[_0x7721('0x41')](_[_0x7721('0x49')](_0x5e966f[_0x7721('0x40')],_0x2d4b3a['filters']));if(_0x5e966f['query'][_0x7721('0x4c')]){_0x580473[_0x7721('0x48')]=_[_0x7721('0x4a')](_0x580473[_0x7721('0x48')],{'$or':_[_0x7721('0x3c')](_0x580473[_0x7721('0x43')],function(_0x59e80c){var _0x3855d5={};_0x3855d5[_0x59e80c]={'$like':'%'+_0x5e966f[_0x7721('0x40')][_0x7721('0x4c')]+'%'};return _0x3855d5;})});}_0x580473=_['merge']({},_0x580473,_0x5e966f[_0x7721('0x55')]);return _0x42f6e9[_0x7721('0x5c')](_0x580473);}})[_0x7721('0x38')](function(_0xc20188){if(_0xc20188){_0xbbc86f=_0xc20188[_0x7721('0x44')];if(!_0x5e966f['query'][_0x7721('0x5d')]('nolimit')){_0x580473[_0x7721('0x31')]=qs[_0x7721('0x31')](_0x5e966f[_0x7721('0x40')][_0x7721('0x31')]);_0x580473[_0x7721('0x30')]=qs[_0x7721('0x30')](_0x5e966f[_0x7721('0x40')][_0x7721('0x30')]);}return _0x42f6e9[_0x7721('0x5c')](_0x580473);}})[_0x7721('0x38')](function(_0x2c74d8){if(_0x2c74d8){return _0x2c74d8?{'count':_0xbbc86f,'rows':_0x2c74d8}:null;}})['then'](respondWithResult(_0x1fc5f7,null))[_0x7721('0x2b')](handleError(_0x1fc5f7,null));};exports[_0x7721('0x5e')]=function(_0x39194e,_0x5eec29,_0x94af20){var _0x26b2cc={};var _0x139517={};var _0xc9761e;var _0xcd9f0d;return db['ZohoConfiguration'][_0x7721('0x5f')]({'where':{'id':_0x39194e[_0x7721('0x59')]['id']}})[_0x7721('0x38')](handleEntityNotFound(_0x5eec29,null))[_0x7721('0x38')](function(_0x30326d){if(_0x30326d){_0xc9761e=_0x30326d;_0x139517[_0x7721('0x3f')]=_['keys'](db[_0x7721('0x5b')][_0x7721('0x51')]);_0x139517['query']=_[_0x7721('0x52')](_0x39194e['query']);_0x139517[_0x7721('0x41')]=_[_0x7721('0x53')](_0x139517['model'],_0x139517[_0x7721('0x40')]);_0x26b2cc['attributes']=_['intersection'](_0x139517['model'],qs[_0x7721('0x42')](_0x39194e[_0x7721('0x40')][_0x7721('0x42')]));_0x26b2cc['attributes']=_0x26b2cc['attributes']['length']?_0x26b2cc[_0x7721('0x43')]:_0x139517[_0x7721('0x3f')];_0x26b2cc[_0x7721('0x46')]=qs[_0x7721('0x47')](_0x39194e[_0x7721('0x40')][_0x7721('0x47')]);_0x26b2cc['where']=qs[_0x7721('0x41')](_[_0x7721('0x49')](_0x39194e[_0x7721('0x40')],_0x139517[_0x7721('0x41')]));if(_0x39194e[_0x7721('0x40')][_0x7721('0x4c')]){_0x26b2cc[_0x7721('0x48')]=_[_0x7721('0x4a')](_0x26b2cc[_0x7721('0x48')],{'$or':_[_0x7721('0x3c')](_0x26b2cc[_0x7721('0x43')],function(_0x368dbb){var _0x58429d={};_0x58429d[_0x368dbb]={'$like':'%'+_0x39194e['query'][_0x7721('0x4c')]+'%'};return _0x58429d;})});}_0x26b2cc=_[_0x7721('0x4a')]({},_0x26b2cc,_0x39194e['options']);return _0xc9761e[_0x7721('0x5e')](_0x26b2cc);}})['then'](function(_0x4e3c93){if(_0x4e3c93){_0xcd9f0d=_0x4e3c93[_0x7721('0x44')];if(!_0x39194e['query']['hasOwnProperty'](_0x7721('0x45'))){_0x26b2cc[_0x7721('0x31')]=qs[_0x7721('0x31')](_0x39194e[_0x7721('0x40')][_0x7721('0x31')]);_0x26b2cc['offset']=qs[_0x7721('0x30')](_0x39194e[_0x7721('0x40')][_0x7721('0x30')]);}return _0xc9761e[_0x7721('0x5e')](_0x26b2cc);}})['then'](function(_0x52fcc1){if(_0x52fcc1){return _0x52fcc1?{'count':_0xcd9f0d,'rows':_0x52fcc1}:null;}})[_0x7721('0x38')](respondWithResult(_0x5eec29,null))[_0x7721('0x2b')](handleError(_0x5eec29,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 6297424..60ed61e 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 _0xf0f9=['bluebird','request-promise','path','../../config/environment','./intZohoConfiguration.attributes','exports','ZohoConfiguration','int_zoho_configurations','util','api','moment'];(function(_0x1ae5b0,_0x21b9b6){var _0x2e4495=function(_0x3d20f1){while(--_0x3d20f1){_0x1ae5b0['push'](_0x1ae5b0['shift']());}};_0x2e4495(++_0x21b9b6);}(_0xf0f9,0xe4));var _0x9f0f=function(_0x205625,_0x2ef90f){_0x205625=_0x205625-0x0;var _0x570e2d=_0xf0f9[_0x205625];return _0x570e2d;};'use strict';var _=require('lodash');var util=require(_0x9f0f('0x0'));var logger=require('../../config/logger')(_0x9f0f('0x1'));var moment=require(_0x9f0f('0x2'));var BPromise=require(_0x9f0f('0x3'));var rp=require(_0x9f0f('0x4'));var fs=require('fs');var path=require(_0x9f0f('0x5'));var rimraf=require('rimraf');var config=require(_0x9f0f('0x6'));var attributes=require(_0x9f0f('0x7'));module[_0x9f0f('0x8')]=function(_0x12c2c5,_0x53f39a){return _0x12c2c5['define'](_0x9f0f('0x9'),attributes,{'tableName':_0x9f0f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5293=['moment','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','define','int_zoho_configurations','api'];(function(_0x186a43,_0x32dfa1){var _0x5ac5a4=function(_0xdf9cfa){while(--_0xdf9cfa){_0x186a43['push'](_0x186a43['shift']());}};_0x5ac5a4(++_0x32dfa1);}(_0x5293,0x1d3));var _0x3529=function(_0x4e5552,_0x19ec4e){_0x4e5552=_0x4e5552-0x0;var _0x60a338=_0x5293[_0x4e5552];return _0x60a338;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x3529('0x0'));var moment=require(_0x3529('0x1'));var BPromise=require('bluebird');var rp=require(_0x3529('0x2'));var fs=require('fs');var path=require(_0x3529('0x3'));var rimraf=require(_0x3529('0x4'));var config=require(_0x3529('0x5'));var attributes=require(_0x3529('0x6'));module['exports']=function(_0x4ba0fb,_0x51f9d6){return _0x4ba0fb[_0x3529('0x7')]('ZohoConfiguration',attributes,{'tableName':_0x3529('0x8'),'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 0eba2cf..327329e 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 _0x55c1=['ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','ZohoConfiguration,\x20%s,\x20%s'];(function(_0x2adcba,_0x2d2b1f){var _0xc48e17=function(_0x5cfb38){while(--_0x5cfb38){_0x2adcba['push'](_0x2adcba['shift']());}};_0xc48e17(++_0x2d2b1f);}(_0x55c1,0xb1));var _0x155c=function(_0x46b0ba,_0x5a767c){_0x46b0ba=_0x46b0ba-0x0;var _0x2e53e0=_0x55c1[_0x46b0ba];return _0x2e53e0;};'use strict';var _=require(_0x155c('0x0'));var util=require(_0x155c('0x1'));var moment=require(_0x155c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x155c('0x3'));var db=require(_0x155c('0x4'))['db'];var utils=require(_0x155c('0x5'));var logger=require(_0x155c('0x6'))('rpc');var config=require(_0x155c('0x7'));var jayson=require(_0x155c('0x8'));var client=jayson['client'][_0x155c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x377452,_0x338351,_0x4d012c){return new BPromise(function(_0x59adb8,_0x5c0bef){return client[_0x155c('0xa')](_0x377452,_0x4d012c)['then'](function(_0x32db62){logger[_0x155c('0xb')](_0x155c('0xc'),_0x338351,'request\x20sent');logger['debug'](_0x155c('0xd'),_0x338351,'request\x20sent',JSON[_0x155c('0xe')](_0x32db62));if(_0x32db62['error']){if(_0x32db62[_0x155c('0xf')][_0x155c('0x10')]===0x1f4){logger['error'](_0x155c('0xc'),_0x338351,_0x32db62[_0x155c('0xf')][_0x155c('0x11')]);return _0x5c0bef(_0x32db62['error'][_0x155c('0x11')]);}logger[_0x155c('0xf')](_0x155c('0xc'),_0x338351,_0x32db62[_0x155c('0xf')][_0x155c('0x11')]);return _0x59adb8(_0x32db62[_0x155c('0xf')]['message']);}else{logger[_0x155c('0xb')](_0x155c('0xc'),_0x338351,'request\x20sent');_0x59adb8(_0x32db62['result']['message']);}})[_0x155c('0x12')](function(_0x3a4383){logger[_0x155c('0xf')](_0x155c('0xc'),_0x338351,_0x3a4383);_0x5c0bef(_0x3a4383);});});} \ No newline at end of file +var _0x9898=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','ZohoConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash','util','randomstring'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x9898,0x14d));var _0x8989=function(_0x1895b7,_0x21fbc7){_0x1895b7=_0x1895b7-0x0;var _0x1aecdc=_0x9898[_0x1895b7];return _0x1aecdc;};'use strict';var _=require(_0x8989('0x0'));var util=require(_0x8989('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8989('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8989('0x3'));var logger=require(_0x8989('0x4'))(_0x8989('0x5'));var config=require(_0x8989('0x6'));var jayson=require(_0x8989('0x7'));var client=jayson[_0x8989('0x8')][_0x8989('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x555992,_0x2ec711,_0x3fee76){return new BPromise(function(_0x1901c0,_0x2e3a7e){return client[_0x8989('0xa')](_0x555992,_0x3fee76)[_0x8989('0xb')](function(_0x2ef727){logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x2ec711,_0x8989('0xc'));logger[_0x8989('0xd')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x2ec711,_0x8989('0xc'),JSON[_0x8989('0xe')](_0x2ef727));if(_0x2ef727[_0x8989('0xf')]){if(_0x2ef727[_0x8989('0xf')]['code']===0x1f4){logger[_0x8989('0xf')](_0x8989('0x10'),_0x2ec711,_0x2ef727[_0x8989('0xf')][_0x8989('0x11')]);return _0x2e3a7e(_0x2ef727[_0x8989('0xf')]['message']);}logger['error'](_0x8989('0x10'),_0x2ec711,_0x2ef727[_0x8989('0xf')][_0x8989('0x11')]);return _0x1901c0(_0x2ef727[_0x8989('0xf')][_0x8989('0x11')]);}else{logger[_0x8989('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0x2ec711,_0x8989('0xc'));_0x1901c0(_0x2ef727[_0x8989('0x13')][_0x8989('0x11')]);}})[_0x8989('0x14')](function(_0x4681c6){logger[_0x8989('0xf')](_0x8989('0x10'),_0x2ec711,_0x4681c6);_0x2e3a7e(_0x4681c6);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index cc09e32..2a3be4d 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 _0x9536=['connect-timeout','Router','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x5366a3,_0x48a8cc){var _0x4ee9da=function(_0x5e584c){while(--_0x5e584c){_0x5366a3['push'](_0x5366a3['shift']());}};_0x4ee9da(++_0x48a8cc);}(_0x9536,0x179));var _0x6953=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x9536[_0x550d12];return _0x12103d;};'use strict';var multer=require(_0x6953('0x0'));var util=require(_0x6953('0x1'));var path=require(_0x6953('0x2'));var timeout=require(_0x6953('0x3'));var express=require('express');var router=express[_0x6953('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x6953('0x5'));var config=require(_0x6953('0x6'));var controller=require(_0x6953('0x7'));router[_0x6953('0x8')]('/',auth[_0x6953('0x9')](),controller['index']);router[_0x6953('0x8')](_0x6953('0xa'),auth[_0x6953('0x9')](),controller[_0x6953('0xb')]);router[_0x6953('0xc')]('/',auth['isAuthenticated'](),controller[_0x6953('0xd')]);router[_0x6953('0xe')](_0x6953('0xa'),auth['isAuthenticated'](),controller[_0x6953('0xf')]);router[_0x6953('0x10')](_0x6953('0xa'),auth[_0x6953('0x9')](),controller[_0x6953('0x11')]);module[_0x6953('0x12')]=router; \ No newline at end of file +var _0x4137=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','/:id','show','create','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x2fea20,_0x483252){var _0x5dcd26=function(_0x3e8954){while(--_0x3e8954){_0x2fea20['push'](_0x2fea20['shift']());}};_0x5dcd26(++_0x483252);}(_0x4137,0xf8));var _0x7413=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x4137[_0x2c91e9];return _0x13f0ff;};'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 auth=require(_0x7413('0x6'));var interaction=require(_0x7413('0x7'));var config=require(_0x7413('0x8'));var controller=require(_0x7413('0x9'));router[_0x7413('0xa')]('/',auth[_0x7413('0xb')](),controller['index']);router[_0x7413('0xa')](_0x7413('0xc'),auth[_0x7413('0xb')](),controller[_0x7413('0xd')]);router['post']('/',auth[_0x7413('0xb')](),controller[_0x7413('0xe')]);router['put'](_0x7413('0xc'),auth[_0x7413('0xb')](),controller['update']);router[_0x7413('0xf')](_0x7413('0xc'),auth[_0x7413('0xb')](),controller[_0x7413('0x10')]);module[_0x7413('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 8f68102..3e476d1 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 _0x432b=['customVariable','STRING','BOOLEAN','sequelize','ENUM','string','variable'];(function(_0x138836,_0x229129){var _0x322688=function(_0x54b101){while(--_0x54b101){_0x138836['push'](_0x138836['shift']());}};_0x322688(++_0x229129);}(_0x432b,0x161));var _0xb432=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x432b[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb432('0x0'));module['exports']={'type':{'type':Sequelize[_0xb432('0x1')](_0xb432('0x2'),_0xb432('0x3'),_0xb432('0x4'),'keyValue'),'defaultValue':'string'},'content':{'type':Sequelize[_0xb432('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xb432('0x1')]('string',_0xb432('0x3'),_0xb432('0x4'))},'keyContent':{'type':Sequelize[_0xb432('0x5')]},'idField':{'type':Sequelize[_0xb432('0x5')]},'nameField':{'type':Sequelize[_0xb432('0x5')]},'customField':{'type':Sequelize[_0xb432('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb432('0x5')]}}; \ No newline at end of file +var _0x131a=['exports','ENUM','string','variable','keyValue','STRING','customVariable','BOOLEAN','sequelize'];(function(_0x4e53c1,_0x54ddd6){var _0x5d3c2b=function(_0x195e9a){while(--_0x195e9a){_0x4e53c1['push'](_0x4e53c1['shift']());}};_0x5d3c2b(++_0x54ddd6);}(_0x131a,0x18b));var _0xa131=function(_0x4c58d0,_0x3823ef){_0x4c58d0=_0x4c58d0-0x0;var _0x23f063=_0x131a[_0x4c58d0];return _0x23f063;};'use strict';var Sequelize=require(_0xa131('0x0'));module[_0xa131('0x1')]={'type':{'type':Sequelize[_0xa131('0x2')](_0xa131('0x3'),_0xa131('0x4'),'customVariable',_0xa131('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xa131('0x6')]},'key':{'type':Sequelize[_0xa131('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xa131('0x3'),_0xa131('0x4'),_0xa131('0x7'))},'keyContent':{'type':Sequelize[_0xa131('0x6')]},'idField':{'type':Sequelize[_0xa131('0x6')]},'nameField':{'type':Sequelize[_0xa131('0x6')]},'customField':{'type':Sequelize[_0xa131('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa131('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 03ed9f1..6b578d6 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 _0x7633=['stack','name','send','map','ZohoField','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','update','then','destroy','error'];(function(_0x11a6ad,_0x4d1bbd){var _0x5f5e9a=function(_0x333c05){while(--_0x333c05){_0x11a6ad['push'](_0x11a6ad['shift']());}};_0x5f5e9a(++_0x4d1bbd);}(_0x7633,0x181));var _0x3763=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x7633[_0x3ab51d];return _0x29a04e;};'use strict';var pdf=require(_0x3763('0x0'));var emlformat=require(_0x3763('0x1'));var rimraf=require(_0x3763('0x2'));var zipdir=require(_0x3763('0x3'));var jsonpatch=require(_0x3763('0x4'));var rp=require('request-promise');var moment=require(_0x3763('0x5'));var BPromise=require(_0x3763('0x6'));var Mustache=require('mustache');var util=require(_0x3763('0x7'));var path=require('path');var sox=require(_0x3763('0x8'));var csv=require(_0x3763('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x3763('0xa'));var crypto=require(_0x3763('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3763('0xc'));var toCsv=require('to-csv');var querystring=require(_0x3763('0xd'));var Papa=require('papaparse');var Redis=require(_0x3763('0xe'));var authService=require(_0x3763('0xf'));var qs=require(_0x3763('0x10'));var as=require(_0x3763('0x11'));var hardwareService=require(_0x3763('0x12'));var logger=require(_0x3763('0x13'))(_0x3763('0x14'));var utils=require('../../config/utils');var config=require(_0x3763('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x32af0a,_0xcdc874){_0xcdc874=_0xcdc874||0xcc;return function(_0x51cf18){if(_0x51cf18){return _0x32af0a[_0x3763('0x16')](_0xcdc874);}return _0x32af0a[_0x3763('0x17')](_0xcdc874)[_0x3763('0x18')]();};}function respondWithResult(_0x14a27d,_0x471bca){_0x471bca=_0x471bca||0xc8;return function(_0x2f4fff){if(_0x2f4fff){return _0x14a27d[_0x3763('0x17')](_0x471bca)[_0x3763('0x19')](_0x2f4fff);}};}function respondWithFilteredResult(_0x369c0c,_0x348b33){return function(_0x2f9596){if(_0x2f9596){var _0x4393a4=_0x2f9596['count'],_0x303acf=_0x348b33[_0x3763('0x1a')],_0x2409b8=_0x348b33[_0x3763('0x1a')]+_0x348b33[_0x3763('0x1b')],_0x38db8b;if(_0x2409b8>=_0x4393a4){_0x2409b8=_0x4393a4;_0x38db8b=0xc8;}else{_0x38db8b=0xce;}_0x369c0c[_0x3763('0x17')](_0x38db8b);return _0x369c0c['set'](_0x3763('0x1c'),_0x303acf+'-'+_0x2409b8+'/'+_0x4393a4)['json'](_0x2f9596);}return null;};}function patchUpdates(_0x290644){return function(_0x23a751){try{jsonpatch[_0x3763('0x1d')](_0x23a751,_0x290644,!![]);}catch(_0xee6e0){return BPromise[_0x3763('0x1e')](_0xee6e0);}return _0x23a751['save']();};}function saveUpdates(_0x34150e,_0x5b1365){return function(_0x1b5913){if(_0x1b5913){return _0x1b5913[_0x3763('0x1f')](_0x34150e)[_0x3763('0x20')](function(_0x19e18c){return _0x19e18c;});}return null;};}function removeEntity(_0x2c7426,_0x5d038f){return function(_0x7dc3b5){if(_0x7dc3b5){return _0x7dc3b5[_0x3763('0x21')]()[_0x3763('0x20')](function(){_0x2c7426[_0x3763('0x17')](0xcc)[_0x3763('0x18')]();});}};}function handleEntityNotFound(_0x53276f,_0x356e8e){return function(_0x17760f){if(!_0x17760f){_0x53276f[_0x3763('0x16')](0x194);}return _0x17760f;};}function handleError(_0x420186,_0x35ca55){_0x35ca55=_0x35ca55||0x1f4;return function(_0x2243e3){logger[_0x3763('0x22')](_0x2243e3[_0x3763('0x23')]);if(_0x2243e3[_0x3763('0x24')]){delete _0x2243e3['name'];}_0x420186[_0x3763('0x17')](_0x35ca55)[_0x3763('0x25')](_0x2243e3);};}exports['index']=function(_0x570dee,_0x4269ef){var _0x5aa6ae={},_0x350356={},_0x337c69={'count':0x0,'rows':[]};var _0x398fdf=_[_0x3763('0x26')](db[_0x3763('0x27')]['rawAttributes'],function(_0x2d77ed){return{'name':_0x2d77ed['fieldName'],'type':_0x2d77ed['type']['key']};});_0x350356[_0x3763('0x28')]=_[_0x3763('0x26')](_0x398fdf,_0x3763('0x24'));_0x350356[_0x3763('0x29')]=_['keys'](_0x570dee[_0x3763('0x29')]);_0x350356[_0x3763('0x2a')]=_[_0x3763('0x2b')](_0x350356[_0x3763('0x28')],_0x350356[_0x3763('0x29')]);_0x5aa6ae[_0x3763('0x2c')]=_[_0x3763('0x2b')](_0x350356[_0x3763('0x28')],qs['fields'](_0x570dee[_0x3763('0x29')][_0x3763('0x2d')]));_0x5aa6ae[_0x3763('0x2c')]=_0x5aa6ae['attributes'][_0x3763('0x2e')]?_0x5aa6ae['attributes']:_0x350356[_0x3763('0x28')];if(!_0x570dee[_0x3763('0x29')][_0x3763('0x2f')](_0x3763('0x30'))){_0x5aa6ae['limit']=qs[_0x3763('0x1b')](_0x570dee[_0x3763('0x29')][_0x3763('0x1b')]);_0x5aa6ae[_0x3763('0x1a')]=qs[_0x3763('0x1a')](_0x570dee[_0x3763('0x29')]['offset']);}_0x5aa6ae[_0x3763('0x31')]=qs[_0x3763('0x32')](_0x570dee[_0x3763('0x29')]['sort']);_0x5aa6ae[_0x3763('0x33')]=qs['filters'](_[_0x3763('0x34')](_0x570dee['query'],_0x350356['filters']));if(_0x570dee['query'][_0x3763('0x35')]){_0x5aa6ae['where']=_[_0x3763('0x36')](_0x5aa6ae[_0x3763('0x33')],{'$or':_[_0x3763('0x26')](_0x398fdf,function(_0x4693ab){if(_0x4693ab[_0x3763('0x37')]!==_0x3763('0x38')){var _0x22638e={};_0x22638e[_0x4693ab['name']]={'$like':'%'+_0x570dee[_0x3763('0x29')][_0x3763('0x35')]+'%'};return _0x22638e;}})});}_0x5aa6ae=_[_0x3763('0x36')]({},_0x5aa6ae,_0x570dee[_0x3763('0x39')]);var _0x4f1efc={'where':_0x5aa6ae['where']};return db[_0x3763('0x27')][_0x3763('0x3a')](_0x4f1efc)[_0x3763('0x20')](function(_0x24907d){_0x337c69['count']=_0x24907d;if(_0x570dee['query'][_0x3763('0x3b')]){_0x5aa6ae[_0x3763('0x3c')]=[{'all':!![]}];}return db[_0x3763('0x27')][_0x3763('0x3d')](_0x5aa6ae);})['then'](function(_0x543bbe){_0x337c69[_0x3763('0x3e')]=_0x543bbe;return _0x337c69;})['then'](respondWithFilteredResult(_0x4269ef,_0x5aa6ae))[_0x3763('0x3f')](handleError(_0x4269ef,null));};exports['show']=function(_0x4e670c,_0x457a03){var _0x2295ee={'raw':!![],'where':{'id':_0x4e670c[_0x3763('0x40')]['id']}},_0x4732c5={};_0x4732c5['model']=_[_0x3763('0x41')](db[_0x3763('0x27')][_0x3763('0x42')]);_0x4732c5['query']=_['keys'](_0x4e670c[_0x3763('0x29')]);_0x4732c5['filters']=_[_0x3763('0x2b')](_0x4732c5['model'],_0x4732c5[_0x3763('0x29')]);_0x2295ee[_0x3763('0x2c')]=_['intersection'](_0x4732c5[_0x3763('0x28')],qs[_0x3763('0x2d')](_0x4e670c['query'][_0x3763('0x2d')]));_0x2295ee[_0x3763('0x2c')]=_0x2295ee[_0x3763('0x2c')][_0x3763('0x2e')]?_0x2295ee[_0x3763('0x2c')]:_0x4732c5[_0x3763('0x28')];if(_0x4e670c[_0x3763('0x29')]['includeAll']){_0x2295ee[_0x3763('0x3c')]=[{'all':!![]}];}_0x2295ee=_[_0x3763('0x36')]({},_0x2295ee,_0x4e670c[_0x3763('0x39')]);return db[_0x3763('0x27')][_0x3763('0x43')](_0x2295ee)['then'](handleEntityNotFound(_0x457a03,null))[_0x3763('0x20')](respondWithResult(_0x457a03,null))[_0x3763('0x3f')](handleError(_0x457a03,null));};exports[_0x3763('0x44')]=function(_0x1799fe,_0x40bc90){return db[_0x3763('0x27')][_0x3763('0x44')](_0x1799fe['body'],{})[_0x3763('0x20')](respondWithResult(_0x40bc90,0xc9))['catch'](handleError(_0x40bc90,null));};exports[_0x3763('0x1f')]=function(_0x411bb1,_0xa48c9b){if(_0x411bb1[_0x3763('0x45')]['id']){delete _0x411bb1['body']['id'];}return db[_0x3763('0x27')][_0x3763('0x43')]({'where':{'id':_0x411bb1[_0x3763('0x40')]['id']}})['then'](handleEntityNotFound(_0xa48c9b,null))[_0x3763('0x20')](saveUpdates(_0x411bb1[_0x3763('0x45')],null))[_0x3763('0x20')](respondWithResult(_0xa48c9b,null))[_0x3763('0x3f')](handleError(_0xa48c9b,null));};exports[_0x3763('0x21')]=function(_0x1994e7,_0x5cfc9d){return db[_0x3763('0x27')][_0x3763('0x43')]({'where':{'id':_0x1994e7[_0x3763('0x40')]['id']}})[_0x3763('0x20')](handleEntityNotFound(_0x5cfc9d,null))['then'](removeEntity(_0x5cfc9d,null))[_0x3763('0x3f')](handleError(_0x5cfc9d,null));}; \ No newline at end of file +var _0xcaf5=['sox','ejs','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','Content-Range','reject','save','sendStatus','error','stack','name','send','index','ZohoField','rawAttributes','type','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','VIRTUAL','merge','then','includeAll','rows','catch','show','params','include','options','find','create','body','update','destroy','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path'];(function(_0xab2f7b,_0x12e25c){var _0x2e61c4=function(_0x4a61fd){while(--_0x4a61fd){_0xab2f7b['push'](_0xab2f7b['shift']());}};_0x2e61c4(++_0x12e25c);}(_0xcaf5,0x83));var _0x5caf=function(_0x384a2e,_0x35267c){_0x384a2e=_0x384a2e-0x0;var _0x346961=_0xcaf5[_0x384a2e];return _0x346961;};'use strict';var pdf=require(_0x5caf('0x0'));var emlformat=require(_0x5caf('0x1'));var rimraf=require(_0x5caf('0x2'));var zipdir=require(_0x5caf('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5caf('0x4'));var moment=require(_0x5caf('0x5'));var BPromise=require(_0x5caf('0x6'));var Mustache=require('mustache');var util=require(_0x5caf('0x7'));var path=require(_0x5caf('0x8'));var sox=require(_0x5caf('0x9'));var csv=require('to-csv');var ejs=require(_0x5caf('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x5caf('0xb'));var jsforce=require(_0x5caf('0xc'));var deskjs=require(_0x5caf('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5caf('0xe'));var Redis=require(_0x5caf('0xf'));var authService=require(_0x5caf('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5caf('0x11'));var hardwareService=require(_0x5caf('0x12'));var logger=require(_0x5caf('0x13'))('api');var utils=require(_0x5caf('0x14'));var config=require(_0x5caf('0x15'));var db=require(_0x5caf('0x16'))['db'];function respondWithStatusCode(_0x315a69,_0x40e9bc){_0x40e9bc=_0x40e9bc||0xcc;return function(_0x49924c){if(_0x49924c){return _0x315a69['sendStatus'](_0x40e9bc);}return _0x315a69[_0x5caf('0x17')](_0x40e9bc)[_0x5caf('0x18')]();};}function respondWithResult(_0x531c77,_0x4c349e){_0x4c349e=_0x4c349e||0xc8;return function(_0x146ac3){if(_0x146ac3){return _0x531c77[_0x5caf('0x17')](_0x4c349e)[_0x5caf('0x19')](_0x146ac3);}};}function respondWithFilteredResult(_0x15bd93,_0x26ad07){return function(_0x5bd5af){if(_0x5bd5af){var _0xa46109=_0x5bd5af[_0x5caf('0x1a')],_0x8b37ec=_0x26ad07[_0x5caf('0x1b')],_0x4eb72b=_0x26ad07[_0x5caf('0x1b')]+_0x26ad07[_0x5caf('0x1c')],_0x2a0d0a;if(_0x4eb72b>=_0xa46109){_0x4eb72b=_0xa46109;_0x2a0d0a=0xc8;}else{_0x2a0d0a=0xce;}_0x15bd93[_0x5caf('0x17')](_0x2a0d0a);return _0x15bd93['set'](_0x5caf('0x1d'),_0x8b37ec+'-'+_0x4eb72b+'/'+_0xa46109)[_0x5caf('0x19')](_0x5bd5af);}return null;};}function patchUpdates(_0x48f051){return function(_0x209d16){try{jsonpatch['apply'](_0x209d16,_0x48f051,!![]);}catch(_0x3f752c){return BPromise[_0x5caf('0x1e')](_0x3f752c);}return _0x209d16[_0x5caf('0x1f')]();};}function saveUpdates(_0x15e59e,_0x5903df){return function(_0x20b266){if(_0x20b266){return _0x20b266['update'](_0x15e59e)['then'](function(_0x338ede){return _0x338ede;});}return null;};}function removeEntity(_0x45fc88,_0x3b3c63){return function(_0x50052b){if(_0x50052b){return _0x50052b['destroy']()['then'](function(){_0x45fc88[_0x5caf('0x17')](0xcc)[_0x5caf('0x18')]();});}};}function handleEntityNotFound(_0x17bcfa,_0x5a8a92){return function(_0x4c35eb){if(!_0x4c35eb){_0x17bcfa[_0x5caf('0x20')](0x194);}return _0x4c35eb;};}function handleError(_0xfab21e,_0x44db81){_0x44db81=_0x44db81||0x1f4;return function(_0x28eff9){logger[_0x5caf('0x21')](_0x28eff9[_0x5caf('0x22')]);if(_0x28eff9[_0x5caf('0x23')]){delete _0x28eff9[_0x5caf('0x23')];}_0xfab21e[_0x5caf('0x17')](_0x44db81)[_0x5caf('0x24')](_0x28eff9);};}exports[_0x5caf('0x25')]=function(_0x211889,_0x21796a){var _0x2a7843={},_0x1d31fb={},_0x266e31={'count':0x0,'rows':[]};var _0x2ad401=_['map'](db[_0x5caf('0x26')][_0x5caf('0x27')],function(_0xc0aaa1){return{'name':_0xc0aaa1['fieldName'],'type':_0xc0aaa1[_0x5caf('0x28')]['key']};});_0x1d31fb[_0x5caf('0x29')]=_[_0x5caf('0x2a')](_0x2ad401,_0x5caf('0x23'));_0x1d31fb[_0x5caf('0x2b')]=_[_0x5caf('0x2c')](_0x211889[_0x5caf('0x2b')]);_0x1d31fb['filters']=_[_0x5caf('0x2d')](_0x1d31fb[_0x5caf('0x29')],_0x1d31fb[_0x5caf('0x2b')]);_0x2a7843[_0x5caf('0x2e')]=_['intersection'](_0x1d31fb['model'],qs['fields'](_0x211889[_0x5caf('0x2b')][_0x5caf('0x2f')]));_0x2a7843[_0x5caf('0x2e')]=_0x2a7843[_0x5caf('0x2e')][_0x5caf('0x30')]?_0x2a7843[_0x5caf('0x2e')]:_0x1d31fb['model'];if(!_0x211889[_0x5caf('0x2b')][_0x5caf('0x31')](_0x5caf('0x32'))){_0x2a7843[_0x5caf('0x1c')]=qs[_0x5caf('0x1c')](_0x211889[_0x5caf('0x2b')][_0x5caf('0x1c')]);_0x2a7843[_0x5caf('0x1b')]=qs['offset'](_0x211889[_0x5caf('0x2b')][_0x5caf('0x1b')]);}_0x2a7843['order']=qs[_0x5caf('0x33')](_0x211889[_0x5caf('0x2b')][_0x5caf('0x33')]);_0x2a7843[_0x5caf('0x34')]=qs[_0x5caf('0x35')](_[_0x5caf('0x36')](_0x211889[_0x5caf('0x2b')],_0x1d31fb[_0x5caf('0x35')]));if(_0x211889['query']['filter']){_0x2a7843[_0x5caf('0x34')]=_['merge'](_0x2a7843[_0x5caf('0x34')],{'$or':_[_0x5caf('0x2a')](_0x2ad401,function(_0x3e6db3){if(_0x3e6db3[_0x5caf('0x28')]!==_0x5caf('0x37')){var _0x29ab6f={};_0x29ab6f[_0x3e6db3['name']]={'$like':'%'+_0x211889[_0x5caf('0x2b')]['filter']+'%'};return _0x29ab6f;}})});}_0x2a7843=_[_0x5caf('0x38')]({},_0x2a7843,_0x211889['options']);var _0x155654={'where':_0x2a7843[_0x5caf('0x34')]};return db['ZohoField'][_0x5caf('0x1a')](_0x155654)[_0x5caf('0x39')](function(_0x3d79fd){_0x266e31[_0x5caf('0x1a')]=_0x3d79fd;if(_0x211889['query'][_0x5caf('0x3a')]){_0x2a7843['include']=[{'all':!![]}];}return db[_0x5caf('0x26')]['findAll'](_0x2a7843);})[_0x5caf('0x39')](function(_0x51d12a){_0x266e31[_0x5caf('0x3b')]=_0x51d12a;return _0x266e31;})['then'](respondWithFilteredResult(_0x21796a,_0x2a7843))[_0x5caf('0x3c')](handleError(_0x21796a,null));};exports[_0x5caf('0x3d')]=function(_0x6a0c90,_0x3fc13c){var _0x16b10e={'raw':!![],'where':{'id':_0x6a0c90[_0x5caf('0x3e')]['id']}},_0x4c3a81={};_0x4c3a81['model']=_[_0x5caf('0x2c')](db[_0x5caf('0x26')][_0x5caf('0x27')]);_0x4c3a81['query']=_[_0x5caf('0x2c')](_0x6a0c90['query']);_0x4c3a81[_0x5caf('0x35')]=_[_0x5caf('0x2d')](_0x4c3a81[_0x5caf('0x29')],_0x4c3a81[_0x5caf('0x2b')]);_0x16b10e[_0x5caf('0x2e')]=_[_0x5caf('0x2d')](_0x4c3a81[_0x5caf('0x29')],qs['fields'](_0x6a0c90['query'][_0x5caf('0x2f')]));_0x16b10e[_0x5caf('0x2e')]=_0x16b10e[_0x5caf('0x2e')][_0x5caf('0x30')]?_0x16b10e[_0x5caf('0x2e')]:_0x4c3a81['model'];if(_0x6a0c90[_0x5caf('0x2b')]['includeAll']){_0x16b10e[_0x5caf('0x3f')]=[{'all':!![]}];}_0x16b10e=_['merge']({},_0x16b10e,_0x6a0c90[_0x5caf('0x40')]);return db[_0x5caf('0x26')][_0x5caf('0x41')](_0x16b10e)[_0x5caf('0x39')](handleEntityNotFound(_0x3fc13c,null))[_0x5caf('0x39')](respondWithResult(_0x3fc13c,null))[_0x5caf('0x3c')](handleError(_0x3fc13c,null));};exports[_0x5caf('0x42')]=function(_0x2908e3,_0xefbe12){return db[_0x5caf('0x26')][_0x5caf('0x42')](_0x2908e3[_0x5caf('0x43')],{})[_0x5caf('0x39')](respondWithResult(_0xefbe12,0xc9))[_0x5caf('0x3c')](handleError(_0xefbe12,null));};exports[_0x5caf('0x44')]=function(_0x8ebffd,_0xd772c7){if(_0x8ebffd['body']['id']){delete _0x8ebffd['body']['id'];}return db[_0x5caf('0x26')]['find']({'where':{'id':_0x8ebffd[_0x5caf('0x3e')]['id']}})[_0x5caf('0x39')](handleEntityNotFound(_0xd772c7,null))[_0x5caf('0x39')](saveUpdates(_0x8ebffd[_0x5caf('0x43')],null))['then'](respondWithResult(_0xd772c7,null))[_0x5caf('0x3c')](handleError(_0xd772c7,null));};exports[_0x5caf('0x45')]=function(_0x4114f1,_0x1e0c76){return db[_0x5caf('0x26')][_0x5caf('0x41')]({'where':{'id':_0x4114f1[_0x5caf('0x3e')]['id']}})[_0x5caf('0x39')](handleEntityNotFound(_0x1e0c76,null))['then'](removeEntity(_0x1e0c76,null))[_0x5caf('0x3c')](handleError(_0x1e0c76,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index b076fb1..6232ca2 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 _0x7750=['exports','ZohoField','int_zoho_fields','idField','FieldId','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./intZohoField.attributes'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x7750,0x1e6));var _0x0775=function(_0x5e1e07,_0x2a721a){_0x5e1e07=_0x5e1e07-0x0;var _0x4e81b7=_0x7750[_0x5e1e07];return _0x4e81b7;};'use strict';var _=require('lodash');var util=require(_0x0775('0x0'));var logger=require(_0x0775('0x1'))(_0x0775('0x2'));var moment=require('moment');var BPromise=require(_0x0775('0x3'));var rp=require(_0x0775('0x4'));var fs=require('fs');var path=require(_0x0775('0x5'));var rimraf=require(_0x0775('0x6'));var config=require('../../config/environment');var attributes=require(_0x0775('0x7'));module[_0x0775('0x8')]=function(_0x23874a,_0x2db0b9){return _0x23874a['define'](_0x0775('0x9'),attributes,{'tableName':_0x0775('0xa'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0x0775('0xb'),_0x0775('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0055=['../../config/logger','api','moment','path','rimraf','./intZohoField.attributes','exports','define','ZohoField','zoho_unique_index','util'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x0055,0x1ac));var _0x5005=function(_0x57ac3b,_0x32e884){_0x57ac3b=_0x57ac3b-0x0;var _0x4204c9=_0x0055[_0x57ac3b];return _0x4204c9;};'use strict';var _=require('lodash');var util=require(_0x5005('0x0'));var logger=require(_0x5005('0x1'))(_0x5005('0x2'));var moment=require(_0x5005('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5005('0x4'));var rimraf=require(_0x5005('0x5'));var config=require('../../config/environment');var attributes=require(_0x5005('0x6'));module[_0x5005('0x7')]=function(_0x21824d,_0x46f9e9){return _0x21824d[_0x5005('0x8')](_0x5005('0x9'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0x5005('0xa'),'fields':['idField','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 ecc5936..46b6b71 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 _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','ZohoField,\x20%s,\x20%s','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x4f94b9,_0x25dbd9){var _0x3639ca=function(_0x3182dc){while(--_0x3182dc){_0x4f94b9['push'](_0x4f94b9['shift']());}};_0x3639ca(++_0x25dbd9);}(_0xe14b,0x93));var _0xbe14=function(_0x440787,_0x58afce){_0x440787=_0x440787-0x0;var _0x769faa=_0xe14b[_0x440787];return _0x769faa;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});} \ No newline at end of file +var _0xee14=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','error','code','ZohoField,\x20%s,\x20%s','message','result','catch','moment'];(function(_0x53b179,_0x308057){var _0x3b2376=function(_0x5a3e6e){while(--_0x5a3e6e){_0x53b179['push'](_0x53b179['shift']());}};_0x3b2376(++_0x308057);}(_0xee14,0x13a));var _0x4ee1=function(_0x5b6009,_0x1993ce){_0x5b6009=_0x5b6009-0x0;var _0x1e9a37=_0xee14[_0x5b6009];return _0x1e9a37;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4ee1('0x0'));var BPromise=require(_0x4ee1('0x1'));var rs=require(_0x4ee1('0x2'));var fs=require('fs');var Redis=require(_0x4ee1('0x3'));var db=require(_0x4ee1('0x4'))['db'];var utils=require(_0x4ee1('0x5'));var logger=require(_0x4ee1('0x6'))(_0x4ee1('0x7'));var config=require(_0x4ee1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4ee1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x327c18,_0x3a45a3,_0x187656){return new BPromise(function(_0x293d5f,_0xdfe9c1){return client[_0x4ee1('0xa')](_0x327c18,_0x187656)['then'](function(_0x33dbe6){logger[_0x4ee1('0xb')]('ZohoField,\x20%s,\x20%s',_0x3a45a3,_0x4ee1('0xc'));logger[_0x4ee1('0xd')](_0x4ee1('0xe'),_0x3a45a3,_0x4ee1('0xc'),JSON['stringify'](_0x33dbe6));if(_0x33dbe6[_0x4ee1('0xf')]){if(_0x33dbe6[_0x4ee1('0xf')][_0x4ee1('0x10')]===0x1f4){logger[_0x4ee1('0xf')](_0x4ee1('0x11'),_0x3a45a3,_0x33dbe6[_0x4ee1('0xf')]['message']);return _0xdfe9c1(_0x33dbe6[_0x4ee1('0xf')][_0x4ee1('0x12')]);}logger[_0x4ee1('0xf')](_0x4ee1('0x11'),_0x3a45a3,_0x33dbe6[_0x4ee1('0xf')][_0x4ee1('0x12')]);return _0x293d5f(_0x33dbe6[_0x4ee1('0xf')][_0x4ee1('0x12')]);}else{logger[_0x4ee1('0xb')]('ZohoField,\x20%s,\x20%s',_0x3a45a3,_0x4ee1('0xc'));_0x293d5f(_0x33dbe6[_0x4ee1('0x13')][_0x4ee1('0x12')]);}})[_0x4ee1('0x14')](function(_0x123c5e){logger[_0x4ee1('0xf')](_0x4ee1('0x11'),_0x3a45a3,_0x123c5e);_0xdfe9c1(_0x123c5e);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 73064a9..83c27f8 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 _0x2c6d=['../../config/environment','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x21ccb0,_0x2c040e){var _0x426422=function(_0xf45939){while(--_0xf45939){_0x21ccb0['push'](_0x21ccb0['shift']());}};_0x426422(++_0x2c040e);}(_0x2c6d,0x64));var _0xd2c6=function(_0x5e3b18,_0x198773){_0x5e3b18=_0x5e3b18-0x0;var _0x2d3391=_0x2c6d[_0x5e3b18];return _0x2d3391;};'use strict';var multer=require(_0xd2c6('0x0'));var util=require(_0xd2c6('0x1'));var path=require(_0xd2c6('0x2'));var timeout=require(_0xd2c6('0x3'));var express=require(_0xd2c6('0x4'));var router=express[_0xd2c6('0x5')]();var auth=require(_0xd2c6('0x6'));var interaction=require(_0xd2c6('0x7'));var config=require(_0xd2c6('0x8'));module['exports']=router; \ No newline at end of file +var _0x734b=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','path'];(function(_0x34953e,_0x8ad05a){var _0x584ff4=function(_0x690656){while(--_0x690656){_0x34953e['push'](_0x34953e['shift']());}};_0x584ff4(++_0x8ad05a);}(_0x734b,0x165));var _0xb734=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0x734b[_0x2aecb2];return _0x3ebb80;};'use strict';var multer=require(_0xb734('0x0'));var util=require(_0xb734('0x1'));var path=require(_0xb734('0x2'));var timeout=require(_0xb734('0x3'));var express=require(_0xb734('0x4'));var router=express[_0xb734('0x5')]();var auth=require(_0xb734('0x6'));var interaction=require(_0xb734('0x7'));var config=require(_0xb734('0x8'));module[_0xb734('0x9')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 8f98a58..e48f985 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 _0x8410=['sequelize','exports','STRING','unique_name_and_version','app.js','INTEGER','BOOLEAN','state'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x8410,0x120));var _0x0841=function(_0x514fa2,_0x111255){_0x514fa2=_0x514fa2-0x0;var _0x32e5f2=_0x8410[_0x514fa2];return _0x32e5f2;};'use strict';var Sequelize=require(_0x0841('0x0'));module[_0x0841('0x1')]={'name':{'type':Sequelize[_0x0841('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x0841('0x2')],'allowNull':![],'unique':_0x0841('0x3')},'main':{'type':Sequelize[_0x0841('0x2')],'defaultValue':_0x0841('0x4')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x0841('0x2')]},'size':{'type':Sequelize[_0x0841('0x5')]},'active':{'type':Sequelize[_0x0841('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0x0841('0x2')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x0841('0x2')],'unique':_0x0841('0x7')},'description':{'type':Sequelize[_0x0841('0x2')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0841('0x2')]},'link':{'type':Sequelize[_0x0841('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0x18ed=['STRING','unique_name_and_version','app.js','INTEGER','BOOLEAN','state','exports'];(function(_0x57cd4b,_0x14486a){var _0x57b42f=function(_0x502506){while(--_0x502506){_0x57cd4b['push'](_0x57cd4b['shift']());}};_0x57b42f(++_0x14486a);}(_0x18ed,0x1c6));var _0xd18e=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x18ed[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require('sequelize');module[_0xd18e('0x0')]={'name':{'type':Sequelize[_0xd18e('0x1')],'allowNull':![],'unique':_0xd18e('0x2')},'version':{'type':Sequelize[_0xd18e('0x1')],'allowNull':![],'unique':_0xd18e('0x2')},'main':{'type':Sequelize[_0xd18e('0x1')],'defaultValue':_0xd18e('0x3')},'filename':{'type':Sequelize[_0xd18e('0x1')]},'path':{'type':Sequelize[_0xd18e('0x1')]},'type':{'type':Sequelize[_0xd18e('0x1')]},'size':{'type':Sequelize[_0xd18e('0x4')]},'active':{'type':Sequelize[_0xd18e('0x5')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0xd18e('0x1')]},'state':{'type':Sequelize[_0xd18e('0x1')],'unique':_0xd18e('0x6')},'description':{'type':Sequelize[_0xd18e('0x1')]},'title':{'type':Sequelize[_0xd18e('0x1')]},'remoteUri':{'type':Sequelize[_0xd18e('0x1')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 0af90fd..a972408 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 _0x655c=['html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','status','json','count','offset','limit','set','Content-Range','apply','update','destroy','then','end','sendStatus','error','stack','name','send','index','map','Integration','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body'];(function(_0x98a7f4,_0x26a940){var _0x1d8a5a=function(_0x47c3a8){while(--_0x47c3a8){_0x98a7f4['push'](_0x98a7f4['shift']());}};_0x1d8a5a(++_0x26a940);}(_0x655c,0x134));var _0xc655=function(_0x166653,_0x149524){_0x166653=_0x166653-0x0;var _0x4077d6=_0x655c[_0x166653];return _0x4077d6;};'use strict';var pdf=require(_0xc655('0x0'));var emlformat=require(_0xc655('0x1'));var rimraf=require(_0xc655('0x2'));var zipdir=require(_0xc655('0x3'));var jsonpatch=require(_0xc655('0x4'));var rp=require(_0xc655('0x5'));var moment=require(_0xc655('0x6'));var BPromise=require(_0xc655('0x7'));var Mustache=require(_0xc655('0x8'));var util=require('util');var path=require(_0xc655('0x9'));var sox=require(_0xc655('0xa'));var csv=require(_0xc655('0xb'));var ejs=require(_0xc655('0xc'));var fs=require('fs');var _=require(_0xc655('0xd'));var squel=require(_0xc655('0xe'));var crypto=require('crypto');var jsforce=require(_0xc655('0xf'));var deskjs=require(_0xc655('0x10'));var toCsv=require(_0xc655('0xb'));var querystring=require(_0xc655('0x11'));var Papa=require(_0xc655('0x12'));var Redis=require(_0xc655('0x13'));var authService=require(_0xc655('0x14'));var qs=require(_0xc655('0x15'));var as=require(_0xc655('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc655('0x17'))(_0xc655('0x18'));var utils=require(_0xc655('0x19'));var config=require(_0xc655('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x300944,_0x59775a){_0x59775a=_0x59775a||0xcc;return function(_0x5e13a5){if(_0x5e13a5){return _0x300944['sendStatus'](_0x59775a);}return _0x300944['status'](_0x59775a)['end']();};}function respondWithResult(_0x2465f9,_0x2eecd3){_0x2eecd3=_0x2eecd3||0xc8;return function(_0x2497ac){if(_0x2497ac){return _0x2465f9[_0xc655('0x1b')](_0x2eecd3)[_0xc655('0x1c')](_0x2497ac);}};}function respondWithFilteredResult(_0x4789a1,_0x302afb){return function(_0x3d75c3){if(_0x3d75c3){var _0x172d99=_0x3d75c3[_0xc655('0x1d')],_0x271272=_0x302afb['offset'],_0x25d077=_0x302afb[_0xc655('0x1e')]+_0x302afb[_0xc655('0x1f')],_0x3cfcc4;if(_0x25d077>=_0x172d99){_0x25d077=_0x172d99;_0x3cfcc4=0xc8;}else{_0x3cfcc4=0xce;}_0x4789a1['status'](_0x3cfcc4);return _0x4789a1[_0xc655('0x20')](_0xc655('0x21'),_0x271272+'-'+_0x25d077+'/'+_0x172d99)['json'](_0x3d75c3);}return null;};}function patchUpdates(_0x3762a){return function(_0x2bbb06){try{jsonpatch[_0xc655('0x22')](_0x2bbb06,_0x3762a,!![]);}catch(_0x25198c){return BPromise['reject'](_0x25198c);}return _0x2bbb06['save']();};}function saveUpdates(_0x77ef80,_0x24b217){return function(_0xf578f6){if(_0xf578f6){return _0xf578f6[_0xc655('0x23')](_0x77ef80)['then'](function(_0x42d77d){return _0x42d77d;});}return null;};}function removeEntity(_0x25ba03,_0x17514d){return function(_0x5b1286){if(_0x5b1286){return _0x5b1286[_0xc655('0x24')]()[_0xc655('0x25')](function(){_0x25ba03[_0xc655('0x1b')](0xcc)[_0xc655('0x26')]();});}};}function handleEntityNotFound(_0x754d49,_0x1353d5){return function(_0xa1aaf1){if(!_0xa1aaf1){_0x754d49[_0xc655('0x27')](0x194);}return _0xa1aaf1;};}function handleError(_0x5fbc44,_0xf27cb1){_0xf27cb1=_0xf27cb1||0x1f4;return function(_0x238269){logger[_0xc655('0x28')](_0x238269[_0xc655('0x29')]);if(_0x238269[_0xc655('0x2a')]){delete _0x238269[_0xc655('0x2a')];}_0x5fbc44[_0xc655('0x1b')](_0xf27cb1)[_0xc655('0x2b')](_0x238269);};}exports[_0xc655('0x2c')]=function(_0x37c6bd,_0x33a859){var _0x48e3a4={},_0x8af91b={},_0x29d9b3={'count':0x0,'rows':[]};var _0x28f5cd=_[_0xc655('0x2d')](db[_0xc655('0x2e')][_0xc655('0x2f')],function(_0x2b869c){return{'name':_0x2b869c[_0xc655('0x30')],'type':_0x2b869c[_0xc655('0x31')][_0xc655('0x32')]};});_0x8af91b[_0xc655('0x33')]=_[_0xc655('0x2d')](_0x28f5cd,'name');_0x8af91b[_0xc655('0x34')]=_[_0xc655('0x35')](_0x37c6bd[_0xc655('0x34')]);_0x8af91b['filters']=_[_0xc655('0x36')](_0x8af91b[_0xc655('0x33')],_0x8af91b['query']);_0x48e3a4[_0xc655('0x37')]=_[_0xc655('0x36')](_0x8af91b['model'],qs[_0xc655('0x38')](_0x37c6bd[_0xc655('0x34')][_0xc655('0x38')]));_0x48e3a4[_0xc655('0x37')]=_0x48e3a4[_0xc655('0x37')][_0xc655('0x39')]?_0x48e3a4[_0xc655('0x37')]:_0x8af91b[_0xc655('0x33')];if(!_0x37c6bd[_0xc655('0x34')][_0xc655('0x3a')]('nolimit')){_0x48e3a4[_0xc655('0x1f')]=qs[_0xc655('0x1f')](_0x37c6bd[_0xc655('0x34')][_0xc655('0x1f')]);_0x48e3a4[_0xc655('0x1e')]=qs[_0xc655('0x1e')](_0x37c6bd['query'][_0xc655('0x1e')]);}_0x48e3a4[_0xc655('0x3b')]=qs['sort'](_0x37c6bd['query'][_0xc655('0x3c')]);_0x48e3a4['where']=qs[_0xc655('0x3d')](_[_0xc655('0x3e')](_0x37c6bd[_0xc655('0x34')],_0x8af91b[_0xc655('0x3d')]));if(_0x37c6bd[_0xc655('0x34')][_0xc655('0x3f')]){_0x48e3a4[_0xc655('0x40')]=_[_0xc655('0x41')](_0x48e3a4[_0xc655('0x40')],{'$or':_[_0xc655('0x2d')](_0x28f5cd,function(_0x96578b){if(_0x96578b[_0xc655('0x31')]!=='VIRTUAL'){var _0x2ee9b7={};_0x2ee9b7[_0x96578b['name']]={'$like':'%'+_0x37c6bd['query'][_0xc655('0x3f')]+'%'};return _0x2ee9b7;}})});}_0x48e3a4=_[_0xc655('0x41')]({},_0x48e3a4,_0x37c6bd[_0xc655('0x42')]);var _0x4bb140={'where':_0x48e3a4['where']};return db[_0xc655('0x2e')][_0xc655('0x1d')](_0x4bb140)['then'](function(_0x4a7a0d){_0x29d9b3[_0xc655('0x1d')]=_0x4a7a0d;if(_0x37c6bd[_0xc655('0x34')][_0xc655('0x43')]){_0x48e3a4[_0xc655('0x44')]=[{'all':!![]}];}return db[_0xc655('0x2e')][_0xc655('0x45')](_0x48e3a4);})[_0xc655('0x25')](function(_0x23cafa){_0x29d9b3[_0xc655('0x46')]=_0x23cafa;return _0x29d9b3;})[_0xc655('0x25')](respondWithFilteredResult(_0x33a859,_0x48e3a4))[_0xc655('0x47')](handleError(_0x33a859,null));};exports[_0xc655('0x48')]=function(_0x4f156a,_0x3d368f){var _0x4aa2c7={'raw':![],'where':{'id':_0x4f156a[_0xc655('0x49')]['id']}},_0x583185={};_0x583185[_0xc655('0x33')]=_[_0xc655('0x35')](db[_0xc655('0x2e')][_0xc655('0x2f')]);_0x583185[_0xc655('0x34')]=_['keys'](_0x4f156a[_0xc655('0x34')]);_0x583185['filters']=_[_0xc655('0x36')](_0x583185[_0xc655('0x33')],_0x583185['query']);_0x4aa2c7['attributes']=_[_0xc655('0x36')](_0x583185[_0xc655('0x33')],qs['fields'](_0x4f156a[_0xc655('0x34')][_0xc655('0x38')]));_0x4aa2c7[_0xc655('0x37')]=_0x4aa2c7[_0xc655('0x37')][_0xc655('0x39')]?_0x4aa2c7[_0xc655('0x37')]:_0x583185['model'];if(_0x4f156a[_0xc655('0x34')][_0xc655('0x43')]){_0x4aa2c7[_0xc655('0x44')]=[{'all':!![]}];}_0x4aa2c7=_[_0xc655('0x41')]({},_0x4aa2c7,_0x4f156a[_0xc655('0x42')]);return db['Integration'][_0xc655('0x4a')](_0x4aa2c7)['then'](handleEntityNotFound(_0x3d368f,null))['then'](respondWithResult(_0x3d368f,null))[_0xc655('0x47')](handleError(_0x3d368f,null));};exports[_0xc655('0x4b')]=function(_0x1c0343,_0x35b60d){return db[_0xc655('0x2e')][_0xc655('0x4b')](_0x1c0343[_0xc655('0x4c')],{})['then'](respondWithResult(_0x35b60d,0xc9))['catch'](handleError(_0x35b60d,null));};exports[_0xc655('0x23')]=function(_0x2311d6,_0x337d3b){if(_0x2311d6['body']['id']){delete _0x2311d6[_0xc655('0x4c')]['id'];}return db[_0xc655('0x2e')]['find']({'where':{'id':_0x2311d6[_0xc655('0x49')]['id']}})['then'](handleEntityNotFound(_0x337d3b,null))[_0xc655('0x25')](saveUpdates(_0x2311d6[_0xc655('0x4c')],null))['then'](respondWithResult(_0x337d3b,null))['catch'](handleError(_0x337d3b,null));};exports[_0xc655('0x24')]=function(_0x2f2535,_0x1d29ea){return db[_0xc655('0x2e')][_0xc655('0x4a')]({'where':{'id':_0x2f2535[_0xc655('0x49')]['id']}})[_0xc655('0x25')](handleEntityNotFound(_0x1d29ea,null))[_0xc655('0x25')](removeEntity(_0x1d29ea,null))[_0xc655('0x47')](handleError(_0x1d29ea,null));}; \ No newline at end of file +var _0x8aa8=['mustache','util','ejs','lodash','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','then','destroy','error','stack','name','send','map','Integration','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','count','includeAll','include','rows','catch','show','params','keys','rawAttributes','find','create','body','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird'];(function(_0x2b630f,_0x2b8869){var _0x3a3efc=function(_0x4491cc){while(--_0x4491cc){_0x2b630f['push'](_0x2b630f['shift']());}};_0x3a3efc(++_0x2b8869);}(_0x8aa8,0x153));var _0x88aa=function(_0x3e54ad,_0x5f2450){_0x3e54ad=_0x3e54ad-0x0;var _0x249e39=_0x8aa8[_0x3e54ad];return _0x249e39;};'use strict';var pdf=require(_0x88aa('0x0'));var emlformat=require(_0x88aa('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x88aa('0x2'));var jsonpatch=require(_0x88aa('0x3'));var rp=require(_0x88aa('0x4'));var moment=require('moment');var BPromise=require(_0x88aa('0x5'));var Mustache=require(_0x88aa('0x6'));var util=require(_0x88aa('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x88aa('0x8'));var fs=require('fs');var _=require(_0x88aa('0x9'));var squel=require('squel');var crypto=require(_0x88aa('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x88aa('0xb'));var toCsv=require(_0x88aa('0xc'));var querystring=require(_0x88aa('0xd'));var Papa=require(_0x88aa('0xe'));var Redis=require('ioredis');var authService=require(_0x88aa('0xf'));var qs=require(_0x88aa('0x10'));var as=require(_0x88aa('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x88aa('0x12'))('api');var utils=require(_0x88aa('0x13'));var config=require(_0x88aa('0x14'));var db=require(_0x88aa('0x15'))['db'];function respondWithStatusCode(_0x2a1f74,_0xe84a1e){_0xe84a1e=_0xe84a1e||0xcc;return function(_0x2a4cb8){if(_0x2a4cb8){return _0x2a1f74[_0x88aa('0x16')](_0xe84a1e);}return _0x2a1f74[_0x88aa('0x17')](_0xe84a1e)[_0x88aa('0x18')]();};}function respondWithResult(_0x2e1071,_0x4519bf){_0x4519bf=_0x4519bf||0xc8;return function(_0x57d724){if(_0x57d724){return _0x2e1071[_0x88aa('0x17')](_0x4519bf)[_0x88aa('0x19')](_0x57d724);}};}function respondWithFilteredResult(_0x43911f,_0x4d90a7){return function(_0x57e129){if(_0x57e129){var _0x12d2e9=_0x57e129['count'],_0x5f4143=_0x4d90a7[_0x88aa('0x1a')],_0x5c1f33=_0x4d90a7[_0x88aa('0x1a')]+_0x4d90a7[_0x88aa('0x1b')],_0x59e654;if(_0x5c1f33>=_0x12d2e9){_0x5c1f33=_0x12d2e9;_0x59e654=0xc8;}else{_0x59e654=0xce;}_0x43911f[_0x88aa('0x17')](_0x59e654);return _0x43911f[_0x88aa('0x1c')](_0x88aa('0x1d'),_0x5f4143+'-'+_0x5c1f33+'/'+_0x12d2e9)['json'](_0x57e129);}return null;};}function patchUpdates(_0x1a9d9b){return function(_0x526c21){try{jsonpatch['apply'](_0x526c21,_0x1a9d9b,!![]);}catch(_0x438345){return BPromise[_0x88aa('0x1e')](_0x438345);}return _0x526c21[_0x88aa('0x1f')]();};}function saveUpdates(_0x2783b1,_0x5827a5){return function(_0x210fe1){if(_0x210fe1){return _0x210fe1['update'](_0x2783b1)[_0x88aa('0x20')](function(_0x2a29ec){return _0x2a29ec;});}return null;};}function removeEntity(_0x593225,_0x4dbb21){return function(_0x36c2ef){if(_0x36c2ef){return _0x36c2ef[_0x88aa('0x21')]()['then'](function(){_0x593225[_0x88aa('0x17')](0xcc)[_0x88aa('0x18')]();});}};}function handleEntityNotFound(_0x43059e,_0x1a9ede){return function(_0x4a1dc6){if(!_0x4a1dc6){_0x43059e[_0x88aa('0x16')](0x194);}return _0x4a1dc6;};}function handleError(_0x4a3f8c,_0x471c24){_0x471c24=_0x471c24||0x1f4;return function(_0x366e9b){logger[_0x88aa('0x22')](_0x366e9b[_0x88aa('0x23')]);if(_0x366e9b[_0x88aa('0x24')]){delete _0x366e9b[_0x88aa('0x24')];}_0x4a3f8c[_0x88aa('0x17')](_0x471c24)[_0x88aa('0x25')](_0x366e9b);};}exports['index']=function(_0x1ab92e,_0x464d2d){var _0x21f3d6={},_0x58b45a={},_0xfd5d25={'count':0x0,'rows':[]};var _0x26251d=_[_0x88aa('0x26')](db[_0x88aa('0x27')]['rawAttributes'],function(_0x10e95f){return{'name':_0x10e95f[_0x88aa('0x28')],'type':_0x10e95f[_0x88aa('0x29')]['key']};});_0x58b45a[_0x88aa('0x2a')]=_[_0x88aa('0x26')](_0x26251d,'name');_0x58b45a[_0x88aa('0x2b')]=_['keys'](_0x1ab92e[_0x88aa('0x2b')]);_0x58b45a[_0x88aa('0x2c')]=_[_0x88aa('0x2d')](_0x58b45a[_0x88aa('0x2a')],_0x58b45a[_0x88aa('0x2b')]);_0x21f3d6[_0x88aa('0x2e')]=_['intersection'](_0x58b45a[_0x88aa('0x2a')],qs[_0x88aa('0x2f')](_0x1ab92e[_0x88aa('0x2b')]['fields']));_0x21f3d6[_0x88aa('0x2e')]=_0x21f3d6['attributes'][_0x88aa('0x30')]?_0x21f3d6['attributes']:_0x58b45a[_0x88aa('0x2a')];if(!_0x1ab92e[_0x88aa('0x2b')][_0x88aa('0x31')]('nolimit')){_0x21f3d6[_0x88aa('0x1b')]=qs[_0x88aa('0x1b')](_0x1ab92e[_0x88aa('0x2b')][_0x88aa('0x1b')]);_0x21f3d6[_0x88aa('0x1a')]=qs['offset'](_0x1ab92e['query']['offset']);}_0x21f3d6[_0x88aa('0x32')]=qs['sort'](_0x1ab92e[_0x88aa('0x2b')][_0x88aa('0x33')]);_0x21f3d6['where']=qs['filters'](_[_0x88aa('0x34')](_0x1ab92e[_0x88aa('0x2b')],_0x58b45a[_0x88aa('0x2c')]));if(_0x1ab92e[_0x88aa('0x2b')][_0x88aa('0x35')]){_0x21f3d6[_0x88aa('0x36')]=_[_0x88aa('0x37')](_0x21f3d6[_0x88aa('0x36')],{'$or':_[_0x88aa('0x26')](_0x26251d,function(_0x3709ac){if(_0x3709ac[_0x88aa('0x29')]!==_0x88aa('0x38')){var _0x3f387b={};_0x3f387b[_0x3709ac[_0x88aa('0x24')]]={'$like':'%'+_0x1ab92e[_0x88aa('0x2b')]['filter']+'%'};return _0x3f387b;}})});}_0x21f3d6=_[_0x88aa('0x37')]({},_0x21f3d6,_0x1ab92e['options']);var _0x4a9176={'where':_0x21f3d6[_0x88aa('0x36')]};return db[_0x88aa('0x27')][_0x88aa('0x39')](_0x4a9176)[_0x88aa('0x20')](function(_0x3fc562){_0xfd5d25[_0x88aa('0x39')]=_0x3fc562;if(_0x1ab92e[_0x88aa('0x2b')][_0x88aa('0x3a')]){_0x21f3d6[_0x88aa('0x3b')]=[{'all':!![]}];}return db[_0x88aa('0x27')]['findAll'](_0x21f3d6);})['then'](function(_0x581058){_0xfd5d25[_0x88aa('0x3c')]=_0x581058;return _0xfd5d25;})['then'](respondWithFilteredResult(_0x464d2d,_0x21f3d6))[_0x88aa('0x3d')](handleError(_0x464d2d,null));};exports[_0x88aa('0x3e')]=function(_0x2228b2,_0x55a261){var _0x574346={'raw':![],'where':{'id':_0x2228b2[_0x88aa('0x3f')]['id']}},_0x140e1f={};_0x140e1f[_0x88aa('0x2a')]=_[_0x88aa('0x40')](db[_0x88aa('0x27')][_0x88aa('0x41')]);_0x140e1f[_0x88aa('0x2b')]=_[_0x88aa('0x40')](_0x2228b2[_0x88aa('0x2b')]);_0x140e1f['filters']=_[_0x88aa('0x2d')](_0x140e1f[_0x88aa('0x2a')],_0x140e1f['query']);_0x574346[_0x88aa('0x2e')]=_[_0x88aa('0x2d')](_0x140e1f[_0x88aa('0x2a')],qs[_0x88aa('0x2f')](_0x2228b2[_0x88aa('0x2b')][_0x88aa('0x2f')]));_0x574346[_0x88aa('0x2e')]=_0x574346['attributes'][_0x88aa('0x30')]?_0x574346[_0x88aa('0x2e')]:_0x140e1f[_0x88aa('0x2a')];if(_0x2228b2['query'][_0x88aa('0x3a')]){_0x574346[_0x88aa('0x3b')]=[{'all':!![]}];}_0x574346=_['merge']({},_0x574346,_0x2228b2['options']);return db[_0x88aa('0x27')][_0x88aa('0x42')](_0x574346)[_0x88aa('0x20')](handleEntityNotFound(_0x55a261,null))[_0x88aa('0x20')](respondWithResult(_0x55a261,null))[_0x88aa('0x3d')](handleError(_0x55a261,null));};exports[_0x88aa('0x43')]=function(_0x49b277,_0x58ce09){return db['Integration'][_0x88aa('0x43')](_0x49b277[_0x88aa('0x44')],{})[_0x88aa('0x20')](respondWithResult(_0x58ce09,0xc9))[_0x88aa('0x3d')](handleError(_0x58ce09,null));};exports['update']=function(_0x11cbde,_0x5f0891){if(_0x11cbde[_0x88aa('0x44')]['id']){delete _0x11cbde['body']['id'];}return db[_0x88aa('0x27')][_0x88aa('0x42')]({'where':{'id':_0x11cbde[_0x88aa('0x3f')]['id']}})[_0x88aa('0x20')](handleEntityNotFound(_0x5f0891,null))['then'](saveUpdates(_0x11cbde['body'],null))[_0x88aa('0x20')](respondWithResult(_0x5f0891,null))[_0x88aa('0x3d')](handleError(_0x5f0891,null));};exports[_0x88aa('0x21')]=function(_0xcdda3d,_0x2f4af8){return db[_0x88aa('0x27')][_0x88aa('0x42')]({'where':{'id':_0xcdda3d[_0x88aa('0x3f')]['id']}})[_0x88aa('0x20')](handleEntityNotFound(_0x2f4af8,null))[_0x88aa('0x20')](removeEntity(_0x2f4af8,null))[_0x88aa('0x3d')](handleError(_0x2f4af8,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 24d7d15..6f6aeee 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 _0x5cb6=['util','moment','path','rimraf','./integration.attributes','exports','define','integrations','lodash'];(function(_0x1b7796,_0x335a78){var _0x7e76bb=function(_0x3ce8ac){while(--_0x3ce8ac){_0x1b7796['push'](_0x1b7796['shift']());}};_0x7e76bb(++_0x335a78);}(_0x5cb6,0x194));var _0x65cb=function(_0x38230,_0x148d0c){_0x38230=_0x38230-0x0;var _0x522ec9=_0x5cb6[_0x38230];return _0x522ec9;};'use strict';var _=require(_0x65cb('0x0'));var util=require(_0x65cb('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x65cb('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x65cb('0x3'));var rimraf=require(_0x65cb('0x4'));var config=require('../../config/environment');var attributes=require(_0x65cb('0x5'));module[_0x65cb('0x6')]=function(_0x4a9afb,_0x45d5d4){return _0x4a9afb[_0x65cb('0x7')]('Integration',attributes,{'tableName':_0x65cb('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x75f9=['rimraf','../../config/environment','./integration.attributes','exports','define','Integration','integrations','lodash','util','../../config/logger','moment','bluebird'];(function(_0x530a12,_0x5663d1){var _0x3f75e3=function(_0x3686be){while(--_0x3686be){_0x530a12['push'](_0x530a12['shift']());}};_0x3f75e3(++_0x5663d1);}(_0x75f9,0x1f3));var _0x975f=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x75f9[_0x2aec52];return _0x3b8835;};'use strict';var _=require(_0x975f('0x0'));var util=require(_0x975f('0x1'));var logger=require(_0x975f('0x2'))('api');var moment=require(_0x975f('0x3'));var BPromise=require(_0x975f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x975f('0x5'));var config=require(_0x975f('0x6'));var attributes=require(_0x975f('0x7'));module[_0x975f('0x8')]=function(_0x338e2e,_0x74e94){return _0x338e2e[_0x975f('0x9')](_0x975f('0xa'),attributes,{'tableName':_0x975f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index 1eb3760..e65f6a5 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 _0x28e3=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x28e3,0x106));var _0x328e=function(_0x519756,_0x288785){_0x519756=_0x519756-0x0;var _0x37047e=_0x28e3[_0x519756];return _0x37047e;};'use strict';var _=require(_0x328e('0x0'));var util=require(_0x328e('0x1'));var moment=require(_0x328e('0x2'));var BPromise=require(_0x328e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x328e('0x4'));var db=require(_0x328e('0x5'))['db'];var utils=require(_0x328e('0x6'));var logger=require(_0x328e('0x7'))(_0x328e('0x8'));var config=require(_0x328e('0x9'));var jayson=require(_0x328e('0xa'));var client=jayson[_0x328e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b5c91,_0x58885f,_0x2bddaa){return new BPromise(function(_0x3696b6,_0x3467ee){return client[_0x328e('0xc')](_0x4b5c91,_0x2bddaa)[_0x328e('0xd')](function(_0x4a4f53){logger[_0x328e('0xe')](_0x328e('0xf'),_0x58885f,_0x328e('0x10'));logger['debug']('Integration,\x20%s,\x20%s,\x20%s',_0x58885f,'request\x20sent',JSON[_0x328e('0x11')](_0x4a4f53));if(_0x4a4f53[_0x328e('0x12')]){if(_0x4a4f53[_0x328e('0x12')][_0x328e('0x13')]===0x1f4){logger[_0x328e('0x12')](_0x328e('0xf'),_0x58885f,_0x4a4f53[_0x328e('0x12')][_0x328e('0x14')]);return _0x3467ee(_0x4a4f53[_0x328e('0x12')][_0x328e('0x14')]);}logger[_0x328e('0x12')]('Integration,\x20%s,\x20%s',_0x58885f,_0x4a4f53[_0x328e('0x12')][_0x328e('0x14')]);return _0x3696b6(_0x4a4f53[_0x328e('0x12')][_0x328e('0x14')]);}else{logger[_0x328e('0xe')](_0x328e('0xf'),_0x58885f,_0x328e('0x10'));_0x3696b6(_0x4a4f53[_0x328e('0x15')][_0x328e('0x14')]);}})['catch'](function(_0x1fdb79){logger[_0x328e('0x12')](_0x328e('0xf'),_0x58885f,_0x1fdb79);_0x3467ee(_0x1fdb79);});});} \ No newline at end of file +var _0x9901=['stringify','error','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s'];(function(_0x3e37c4,_0x2ced42){var _0x46b4bf=function(_0x29c511){while(--_0x29c511){_0x3e37c4['push'](_0x3e37c4['shift']());}};_0x46b4bf(++_0x2ced42);}(_0x9901,0x15e));var _0x1990=function(_0xdbff26,_0xfc8995){_0xdbff26=_0xdbff26-0x0;var _0x4adb23=_0x9901[_0xdbff26];return _0x4adb23;};'use strict';var _=require('lodash');var util=require(_0x1990('0x0'));var moment=require('moment');var BPromise=require(_0x1990('0x1'));var rs=require(_0x1990('0x2'));var fs=require('fs');var Redis=require(_0x1990('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1990('0x4'));var logger=require(_0x1990('0x5'))(_0x1990('0x6'));var config=require(_0x1990('0x7'));var jayson=require(_0x1990('0x8'));var client=jayson[_0x1990('0x9')][_0x1990('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c1260,_0x21a593,_0x2d1371){return new BPromise(function(_0x38cd40,_0x5e0fce){return client[_0x1990('0xb')](_0x3c1260,_0x2d1371)[_0x1990('0xc')](function(_0x11352f){logger[_0x1990('0xd')](_0x1990('0xe'),_0x21a593,_0x1990('0xf'));logger[_0x1990('0x10')](_0x1990('0x11'),_0x21a593,_0x1990('0xf'),JSON[_0x1990('0x12')](_0x11352f));if(_0x11352f[_0x1990('0x13')]){if(_0x11352f[_0x1990('0x13')]['code']===0x1f4){logger[_0x1990('0x13')]('Integration,\x20%s,\x20%s',_0x21a593,_0x11352f['error'][_0x1990('0x14')]);return _0x5e0fce(_0x11352f['error'][_0x1990('0x14')]);}logger[_0x1990('0x13')]('Integration,\x20%s,\x20%s',_0x21a593,_0x11352f['error'][_0x1990('0x14')]);return _0x38cd40(_0x11352f[_0x1990('0x13')][_0x1990('0x14')]);}else{logger[_0x1990('0xd')]('Integration,\x20%s,\x20%s',_0x21a593,_0x1990('0xf'));_0x38cd40(_0x11352f[_0x1990('0x15')][_0x1990('0x14')]);}})[_0x1990('0x16')](function(_0x3b09ad){logger[_0x1990('0x13')](_0x1990('0xe'),_0x21a593,_0x3b09ad);_0x5e0fce(_0x3b09ad);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 08a1499..49597af 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 _0x09b7=['/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/describe','describe'];(function(_0x1fc134,_0x4286c2){var _0x3ef837=function(_0x4f7894){while(--_0x4f7894){_0x1fc134['push'](_0x1fc134['shift']());}};_0x3ef837(++_0x4286c2);}(_0x09b7,0x6d));var _0x709b=function(_0xb358eb,_0x1c49c8){_0xb358eb=_0xb358eb-0x0;var _0x486599=_0x09b7[_0xb358eb];return _0x486599;};'use strict';var multer=require(_0x709b('0x0'));var util=require(_0x709b('0x1'));var path=require(_0x709b('0x2'));var timeout=require(_0x709b('0x3'));var express=require(_0x709b('0x4'));var router=express['Router']();var auth=require(_0x709b('0x5'));var interaction=require(_0x709b('0x6'));var config=require('../../config/environment');var controller=require('./integrationReport.controller');router['get']('/',auth[_0x709b('0x7')](),controller['index']);router[_0x709b('0x8')](_0x709b('0x9'),auth[_0x709b('0x7')](),controller[_0x709b('0xa')]);router[_0x709b('0x8')](_0x709b('0xb'),auth[_0x709b('0x7')](),controller[_0x709b('0xc')]);router[_0x709b('0xd')]('/',auth['isAuthenticated'](),controller[_0x709b('0xe')]);router[_0x709b('0xf')](_0x709b('0xb'),auth[_0x709b('0x7')](),controller[_0x709b('0x10')]);router[_0x709b('0x11')](_0x709b('0xb'),auth[_0x709b('0x7')](),controller[_0x709b('0x12')]);module[_0x709b('0x13')]=router; \ No newline at end of file +var _0x8bc6=['post','create','put','update','delete','destroy','exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','/describe','describe','/:id'];(function(_0x77d310,_0x2b2fe7){var _0x2cdce4=function(_0xbaa481){while(--_0xbaa481){_0x77d310['push'](_0x77d310['shift']());}};_0x2cdce4(++_0x2b2fe7);}(_0x8bc6,0x137));var _0x68bc=function(_0xdc2b18,_0x385615){_0xdc2b18=_0xdc2b18-0x0;var _0x2b5b88=_0x8bc6[_0xdc2b18];return _0x2b5b88;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x68bc('0x0'));var express=require(_0x68bc('0x1'));var router=express[_0x68bc('0x2')]();var auth=require(_0x68bc('0x3'));var interaction=require(_0x68bc('0x4'));var config=require(_0x68bc('0x5'));var controller=require(_0x68bc('0x6'));router[_0x68bc('0x7')]('/',auth[_0x68bc('0x8')](),controller['index']);router['get'](_0x68bc('0x9'),auth[_0x68bc('0x8')](),controller[_0x68bc('0xa')]);router[_0x68bc('0x7')](_0x68bc('0xb'),auth[_0x68bc('0x8')](),controller['show']);router[_0x68bc('0xc')]('/',auth[_0x68bc('0x8')](),controller[_0x68bc('0xd')]);router[_0x68bc('0xe')](_0x68bc('0xb'),auth[_0x68bc('0x8')](),controller[_0x68bc('0xf')]);router[_0x68bc('0x10')](_0x68bc('0xb'),auth[_0x68bc('0x8')](),controller[_0x68bc('0x11')]);module[_0x68bc('0x12')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index ea46a89..2a08cac 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 _0x4bd8=['TEXT','ENUM','SENT','FAILED','sequelize','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0xa4b8e1,_0x49d30b){var _0x507e42=function(_0xca2abc){while(--_0xca2abc){_0xa4b8e1['push'](_0xa4b8e1['shift']());}};_0x507e42(++_0x49d30b);}(_0x4bd8,0x1d0));var _0x84bd=function(_0x3d6392,_0x3d8d7e){_0x3d6392=_0x3d6392-0x0;var _0xf6e919=_0x4bd8[_0x3d6392];return _0xf6e919;};'use strict';var Sequelize=require(_0x84bd('0x0'));module[_0x84bd('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0x84bd('0x2')]},'exitStatus':{'type':Sequelize[_0x84bd('0x2')]},'ticketId':{'type':Sequelize[_0x84bd('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x84bd('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x84bd('0x2')]},'calleridname':{'type':Sequelize[_0x84bd('0x2')]},'queue':{'type':Sequelize[_0x84bd('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x84bd('0x3')]},'holdtime':{'type':Sequelize[_0x84bd('0x4')]},'agentcomplete':{'type':Sequelize[_0x84bd('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x84bd('0x3')]},'talktime':{'type':Sequelize[_0x84bd('0x4')]},'agentacw':{'type':Sequelize[_0x84bd('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x84bd('0x4')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0x84bd('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x84bd('0x3')]},'lastevent':{'type':Sequelize[_0x84bd('0x2')]},'channel':{'type':Sequelize[_0x84bd('0x2')]},'channelstate':{'type':Sequelize[_0x84bd('0x4')]},'channelstatedesc':{'type':Sequelize[_0x84bd('0x2')]},'connectedlinenum':{'type':Sequelize[_0x84bd('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x84bd('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x84bd('0x2')]},'priority':{'type':Sequelize[_0x84bd('0x2')]},'destchannel':{'type':Sequelize[_0x84bd('0x2')]},'destchannelstate':{'type':Sequelize[_0x84bd('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x84bd('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x84bd('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x84bd('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x84bd('0x2')]},'destlanguage':{'type':Sequelize[_0x84bd('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x84bd('0x2')]},'destexten':{'type':Sequelize[_0x84bd('0x2')]},'destpriority':{'type':Sequelize[_0x84bd('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0x84bd('0x2')]},'inReplyTo':{'type':Sequelize[_0x84bd('0x2')]},'subject':{'type':Sequelize[_0x84bd('0x2')]},'from':{'type':Sequelize[_0x84bd('0x2')]},'to':{'type':Sequelize[_0x84bd('0x2')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x84bd('0x6')]},'html':{'type':Sequelize[_0x84bd('0x6')]},'text':{'type':Sequelize[_0x84bd('0x6')]},'status':{'type':Sequelize[_0x84bd('0x7')](_0x84bd('0x8'),'SENDING','RECEIVED',_0x84bd('0x9'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x84bd('0x2')]},'projectId':{'type':Sequelize[_0x84bd('0x4')]}}; \ No newline at end of file +var _0x5248=['INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','RECEIVED','FAILED','sequelize','exports','STRING'];(function(_0x119c85,_0x268175){var _0x41d288=function(_0x52c0b2){while(--_0x52c0b2){_0x119c85['push'](_0x119c85['shift']());}};_0x41d288(++_0x268175);}(_0x5248,0x19f));var _0x8524=function(_0x16dbf2,_0x221c57){_0x16dbf2=_0x16dbf2-0x0;var _0x57ad16=_0x5248[_0x16dbf2];return _0x57ad16;};'use strict';var Sequelize=require(_0x8524('0x0'));module[_0x8524('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0x8524('0x2')]},'exitStatus':{'type':Sequelize[_0x8524('0x2')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x8524('0x3')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x8524('0x2')]},'calleridnum':{'type':Sequelize[_0x8524('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x8524('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x8524('0x4')]},'agentconnectAt':{'type':Sequelize[_0x8524('0x4')]},'holdtime':{'type':Sequelize[_0x8524('0x3')]},'agentcomplete':{'type':Sequelize[_0x8524('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0x8524('0x3')]},'agentacw':{'type':Sequelize[_0x8524('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x8524('0x3')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x8524('0x4')]},'agentdump':{'type':Sequelize[_0x8524('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x8524('0x4')]},'lastevent':{'type':Sequelize[_0x8524('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x8524('0x3')]},'channelstatedesc':{'type':Sequelize[_0x8524('0x2')]},'connectedlinenum':{'type':Sequelize[_0x8524('0x2')]},'connectedlinename':{'type':Sequelize[_0x8524('0x2')]},'language':{'type':Sequelize[_0x8524('0x2')]},'accountcode':{'type':Sequelize[_0x8524('0x2')]},'context':{'type':Sequelize[_0x8524('0x2')]},'exten':{'type':Sequelize[_0x8524('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x8524('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x8524('0x2')]},'destcalleridnum':{'type':Sequelize[_0x8524('0x2')]},'destcalleridname':{'type':Sequelize[_0x8524('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x8524('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x8524('0x2')]},'destlanguage':{'type':Sequelize[_0x8524('0x2')]},'destaccountcode':{'type':Sequelize[_0x8524('0x2')]},'destcontext':{'type':Sequelize[_0x8524('0x2')]},'destexten':{'type':Sequelize[_0x8524('0x2')]},'destpriority':{'type':Sequelize[_0x8524('0x2')]},'destuniqueid':{'type':Sequelize[_0x8524('0x2')]},'messageId':{'type':Sequelize[_0x8524('0x2')]},'inReplyTo':{'type':Sequelize[_0x8524('0x2')]},'subject':{'type':Sequelize[_0x8524('0x2')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x8524('0x2')]},'cc':{'type':Sequelize[_0x8524('0x2')]},'attachment':{'type':Sequelize[_0x8524('0x6')]},'html':{'type':Sequelize[_0x8524('0x6')]},'text':{'type':Sequelize[_0x8524('0x6')]},'status':{'type':Sequelize[_0x8524('0x7')](_0x8524('0x8'),'SENDING',_0x8524('0x9'),_0x8524('0xa'))},'url':{'type':Sequelize[_0x8524('0x2')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0x8524('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 52f1cdc..b5c7fa6 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 _0xee2c=['findAll','catch','show','params','rawAttributes','include','find','create','body','destroy','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','json','count','offset','status','set','Content-Range','apply','reject','save','update','then','error','name','send','index','map','IntegrationReport','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','merge','filter','options','includeAll'];(function(_0xda79b9,_0x4eafbe){var _0x424704=function(_0x845b3e){while(--_0x845b3e){_0xda79b9['push'](_0xda79b9['shift']());}};_0x424704(++_0x4eafbe);}(_0xee2c,0x1c7));var _0xcee2=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0xee2c[_0x243b59];return _0x3e1676;};'use strict';var pdf=require(_0xcee2('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xcee2('0x1'));var zipdir=require(_0xcee2('0x2'));var jsonpatch=require(_0xcee2('0x3'));var rp=require(_0xcee2('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xcee2('0x5'));var util=require(_0xcee2('0x6'));var path=require('path');var sox=require(_0xcee2('0x7'));var csv=require(_0xcee2('0x8'));var ejs=require(_0xcee2('0x9'));var fs=require('fs');var _=require(_0xcee2('0xa'));var squel=require(_0xcee2('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xcee2('0xc'));var toCsv=require(_0xcee2('0x8'));var querystring=require(_0xcee2('0xd'));var Papa=require(_0xcee2('0xe'));var Redis=require(_0xcee2('0xf'));var authService=require(_0xcee2('0x10'));var qs=require(_0xcee2('0x11'));var as=require(_0xcee2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcee2('0x13'))(_0xcee2('0x14'));var utils=require(_0xcee2('0x15'));var config=require(_0xcee2('0x16'));var db=require(_0xcee2('0x17'))['db'];function respondWithStatusCode(_0x4b97dd,_0x25d11e){_0x25d11e=_0x25d11e||0xcc;return function(_0x4ca9ac){if(_0x4ca9ac){return _0x4b97dd['sendStatus'](_0x25d11e);}return _0x4b97dd['status'](_0x25d11e)[_0xcee2('0x18')]();};}function respondWithResult(_0x34cc92,_0x2afc56){_0x2afc56=_0x2afc56||0xc8;return function(_0x347a97){if(_0x347a97){return _0x34cc92['status'](_0x2afc56)[_0xcee2('0x19')](_0x347a97);}};}function respondWithFilteredResult(_0x818e13,_0x393761){return function(_0x238da0){if(_0x238da0){var _0x1787ec=_0x238da0[_0xcee2('0x1a')],_0x21a182=_0x393761['offset'],_0x25bdcf=_0x393761[_0xcee2('0x1b')]+_0x393761['limit'],_0x106c5e;if(_0x25bdcf>=_0x1787ec){_0x25bdcf=_0x1787ec;_0x106c5e=0xc8;}else{_0x106c5e=0xce;}_0x818e13[_0xcee2('0x1c')](_0x106c5e);return _0x818e13[_0xcee2('0x1d')](_0xcee2('0x1e'),_0x21a182+'-'+_0x25bdcf+'/'+_0x1787ec)[_0xcee2('0x19')](_0x238da0);}return null;};}function patchUpdates(_0x5bb46f){return function(_0x245811){try{jsonpatch[_0xcee2('0x1f')](_0x245811,_0x5bb46f,!![]);}catch(_0x19022a){return BPromise[_0xcee2('0x20')](_0x19022a);}return _0x245811[_0xcee2('0x21')]();};}function saveUpdates(_0x223f98,_0x42e222){return function(_0x198500){if(_0x198500){return _0x198500[_0xcee2('0x22')](_0x223f98)[_0xcee2('0x23')](function(_0x3e3f75){return _0x3e3f75;});}return null;};}function removeEntity(_0x5d42aa,_0x3f4f92){return function(_0x4864d7){if(_0x4864d7){return _0x4864d7['destroy']()['then'](function(){_0x5d42aa[_0xcee2('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31b2c8,_0x1a935a){return function(_0x2edef5){if(!_0x2edef5){_0x31b2c8['sendStatus'](0x194);}return _0x2edef5;};}function handleError(_0x49b1a8,_0x20a6de){_0x20a6de=_0x20a6de||0x1f4;return function(_0x2ccc9c){logger[_0xcee2('0x24')](_0x2ccc9c['stack']);if(_0x2ccc9c[_0xcee2('0x25')]){delete _0x2ccc9c['name'];}_0x49b1a8[_0xcee2('0x1c')](_0x20a6de)[_0xcee2('0x26')](_0x2ccc9c);};}exports[_0xcee2('0x27')]=function(_0x21bc84,_0x84d7c){var _0x31618c={},_0xbc2b2e={},_0x29be38={'count':0x0,'rows':[]};var _0x262954=_[_0xcee2('0x28')](db[_0xcee2('0x29')]['rawAttributes'],function(_0x19a99b){return{'name':_0x19a99b[_0xcee2('0x2a')],'type':_0x19a99b[_0xcee2('0x2b')]['key']};});_0xbc2b2e[_0xcee2('0x2c')]=_[_0xcee2('0x28')](_0x262954,'name');_0xbc2b2e[_0xcee2('0x2d')]=_[_0xcee2('0x2e')](_0x21bc84['query']);_0xbc2b2e['filters']=_[_0xcee2('0x2f')](_0xbc2b2e['model'],_0xbc2b2e['query']);_0x31618c[_0xcee2('0x30')]=_[_0xcee2('0x2f')](_0xbc2b2e['model'],qs[_0xcee2('0x31')](_0x21bc84[_0xcee2('0x2d')][_0xcee2('0x31')]));_0x31618c[_0xcee2('0x30')]=_0x31618c[_0xcee2('0x30')][_0xcee2('0x32')]?_0x31618c[_0xcee2('0x30')]:_0xbc2b2e[_0xcee2('0x2c')];if(!_0x21bc84[_0xcee2('0x2d')][_0xcee2('0x33')](_0xcee2('0x34'))){_0x31618c[_0xcee2('0x35')]=qs['limit'](_0x21bc84[_0xcee2('0x2d')][_0xcee2('0x35')]);_0x31618c['offset']=qs[_0xcee2('0x1b')](_0x21bc84[_0xcee2('0x2d')]['offset']);}_0x31618c[_0xcee2('0x36')]=qs[_0xcee2('0x37')](_0x21bc84[_0xcee2('0x2d')]['sort']);_0x31618c[_0xcee2('0x38')]=qs[_0xcee2('0x39')](_[_0xcee2('0x3a')](_0x21bc84[_0xcee2('0x2d')],_0xbc2b2e[_0xcee2('0x39')]));if(_0x21bc84[_0xcee2('0x2d')]['filter']){_0x31618c[_0xcee2('0x38')]=_[_0xcee2('0x3b')](_0x31618c[_0xcee2('0x38')],{'$or':_['map'](_0x262954,function(_0x1836cd){if(_0x1836cd['type']!=='VIRTUAL'){var _0x42c307={};_0x42c307[_0x1836cd[_0xcee2('0x25')]]={'$like':'%'+_0x21bc84[_0xcee2('0x2d')][_0xcee2('0x3c')]+'%'};return _0x42c307;}})});}_0x31618c=_[_0xcee2('0x3b')]({},_0x31618c,_0x21bc84[_0xcee2('0x3d')]);var _0x5ee5ad={'where':_0x31618c['where']};return db['IntegrationReport'][_0xcee2('0x1a')](_0x5ee5ad)['then'](function(_0x1cfa4d){_0x29be38[_0xcee2('0x1a')]=_0x1cfa4d;if(_0x21bc84['query'][_0xcee2('0x3e')]){_0x31618c['include']=[{'all':!![]}];}return db['IntegrationReport'][_0xcee2('0x3f')](_0x31618c);})[_0xcee2('0x23')](function(_0x5be207){_0x29be38['rows']=_0x5be207;return _0x29be38;})[_0xcee2('0x23')](respondWithFilteredResult(_0x84d7c,_0x31618c))[_0xcee2('0x40')](handleError(_0x84d7c,null));};exports[_0xcee2('0x41')]=function(_0x4517dd,_0x3cb71f){var _0x28bb5b={'raw':![],'where':{'id':_0x4517dd[_0xcee2('0x42')]['id']}},_0x31824a={};_0x31824a[_0xcee2('0x2c')]=_['keys'](db[_0xcee2('0x29')][_0xcee2('0x43')]);_0x31824a[_0xcee2('0x2d')]=_[_0xcee2('0x2e')](_0x4517dd['query']);_0x31824a[_0xcee2('0x39')]=_[_0xcee2('0x2f')](_0x31824a[_0xcee2('0x2c')],_0x31824a[_0xcee2('0x2d')]);_0x28bb5b[_0xcee2('0x30')]=_[_0xcee2('0x2f')](_0x31824a[_0xcee2('0x2c')],qs[_0xcee2('0x31')](_0x4517dd[_0xcee2('0x2d')]['fields']));_0x28bb5b[_0xcee2('0x30')]=_0x28bb5b[_0xcee2('0x30')][_0xcee2('0x32')]?_0x28bb5b['attributes']:_0x31824a[_0xcee2('0x2c')];if(_0x4517dd[_0xcee2('0x2d')][_0xcee2('0x3e')]){_0x28bb5b[_0xcee2('0x44')]=[{'all':!![]}];}_0x28bb5b=_[_0xcee2('0x3b')]({},_0x28bb5b,_0x4517dd[_0xcee2('0x3d')]);return db[_0xcee2('0x29')][_0xcee2('0x45')](_0x28bb5b)[_0xcee2('0x23')](handleEntityNotFound(_0x3cb71f,null))[_0xcee2('0x23')](respondWithResult(_0x3cb71f,null))[_0xcee2('0x40')](handleError(_0x3cb71f,null));};exports[_0xcee2('0x46')]=function(_0x1077aa,_0xa98bc1){return db['IntegrationReport'][_0xcee2('0x46')](_0x1077aa['body'],{})['then'](respondWithResult(_0xa98bc1,0xc9))[_0xcee2('0x40')](handleError(_0xa98bc1,null));};exports[_0xcee2('0x22')]=function(_0x1b0fd4,_0x1f8b75){if(_0x1b0fd4[_0xcee2('0x47')]['id']){delete _0x1b0fd4['body']['id'];}return db[_0xcee2('0x29')]['find']({'where':{'id':_0x1b0fd4[_0xcee2('0x42')]['id']}})[_0xcee2('0x23')](handleEntityNotFound(_0x1f8b75,null))[_0xcee2('0x23')](saveUpdates(_0x1b0fd4[_0xcee2('0x47')],null))[_0xcee2('0x23')](respondWithResult(_0x1f8b75,null))[_0xcee2('0x40')](handleError(_0x1f8b75,null));};exports[_0xcee2('0x48')]=function(_0x47c526,_0xfbd8d2){return db[_0xcee2('0x29')][_0xcee2('0x45')]({'where':{'id':_0x47c526[_0xcee2('0x42')]['id']}})[_0xcee2('0x23')](handleEntityNotFound(_0xfbd8d2,null))[_0xcee2('0x23')](removeEntity(_0xfbd8d2,null))[_0xcee2('0x40')](handleError(_0xfbd8d2,null));};exports[_0xcee2('0x49')]=function(_0x228c88,_0x5b41a1){return db['IntegrationReport'][_0xcee2('0x49')]()[_0xcee2('0x23')](respondWithResult(_0x5b41a1,null))['catch'](handleError(_0x5b41a1,null));}; \ No newline at end of file +var _0xa321=['options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','update','then','destroy','stack','map','IntegrationReport','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xa321,0x9d));var _0x1a32=function(_0x19318e,_0x46c067){_0x19318e=_0x19318e-0x0;var _0x425540=_0xa321[_0x19318e];return _0x425540;};'use strict';var pdf=require(_0x1a32('0x0'));var emlformat=require(_0x1a32('0x1'));var rimraf=require(_0x1a32('0x2'));var zipdir=require(_0x1a32('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1a32('0x4'));var moment=require(_0x1a32('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1a32('0x6'));var util=require(_0x1a32('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1a32('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1a32('0x9'));var crypto=require(_0x1a32('0xa'));var jsforce=require(_0x1a32('0xb'));var deskjs=require(_0x1a32('0xc'));var toCsv=require(_0x1a32('0xd'));var querystring=require('querystring');var Papa=require(_0x1a32('0xe'));var Redis=require(_0x1a32('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1a32('0x10'));var as=require(_0x1a32('0x11'));var hardwareService=require(_0x1a32('0x12'));var logger=require(_0x1a32('0x13'))(_0x1a32('0x14'));var utils=require(_0x1a32('0x15'));var config=require('../../config/environment');var db=require(_0x1a32('0x16'))['db'];function respondWithStatusCode(_0x2c8a69,_0x3b710d){_0x3b710d=_0x3b710d||0xcc;return function(_0x5ea58a){if(_0x5ea58a){return _0x2c8a69[_0x1a32('0x17')](_0x3b710d);}return _0x2c8a69[_0x1a32('0x18')](_0x3b710d)[_0x1a32('0x19')]();};}function respondWithResult(_0x1fceb9,_0x171cad){_0x171cad=_0x171cad||0xc8;return function(_0x4bcf66){if(_0x4bcf66){return _0x1fceb9[_0x1a32('0x18')](_0x171cad)[_0x1a32('0x1a')](_0x4bcf66);}};}function respondWithFilteredResult(_0x1838d2,_0x268b0a){return function(_0x3400ba){if(_0x3400ba){var _0x2a66b2=_0x3400ba['count'],_0x5c272a=_0x268b0a[_0x1a32('0x1b')],_0x29c53d=_0x268b0a[_0x1a32('0x1b')]+_0x268b0a[_0x1a32('0x1c')],_0x463763;if(_0x29c53d>=_0x2a66b2){_0x29c53d=_0x2a66b2;_0x463763=0xc8;}else{_0x463763=0xce;}_0x1838d2[_0x1a32('0x18')](_0x463763);return _0x1838d2[_0x1a32('0x1d')](_0x1a32('0x1e'),_0x5c272a+'-'+_0x29c53d+'/'+_0x2a66b2)[_0x1a32('0x1a')](_0x3400ba);}return null;};}function patchUpdates(_0xf6093d){return function(_0x54448a){try{jsonpatch[_0x1a32('0x1f')](_0x54448a,_0xf6093d,!![]);}catch(_0x2f6381){return BPromise['reject'](_0x2f6381);}return _0x54448a[_0x1a32('0x20')]();};}function saveUpdates(_0x16896e,_0x235fd0){return function(_0x5a12d5){if(_0x5a12d5){return _0x5a12d5[_0x1a32('0x21')](_0x16896e)[_0x1a32('0x22')](function(_0x4af60a){return _0x4af60a;});}return null;};}function removeEntity(_0x1250dc,_0x55c6a0){return function(_0x125504){if(_0x125504){return _0x125504[_0x1a32('0x23')]()['then'](function(){_0x1250dc[_0x1a32('0x18')](0xcc)[_0x1a32('0x19')]();});}};}function handleEntityNotFound(_0x2c93b0,_0x5e9a5e){return function(_0x2d6637){if(!_0x2d6637){_0x2c93b0[_0x1a32('0x17')](0x194);}return _0x2d6637;};}function handleError(_0x4bf0a0,_0x372b95){_0x372b95=_0x372b95||0x1f4;return function(_0x3b46e4){logger['error'](_0x3b46e4[_0x1a32('0x24')]);if(_0x3b46e4['name']){delete _0x3b46e4['name'];}_0x4bf0a0['status'](_0x372b95)['send'](_0x3b46e4);};}exports['index']=function(_0x40ca2e,_0x2309b3){var _0x4771b7={},_0x2094fa={},_0x382b3c={'count':0x0,'rows':[]};var _0x35af58=_[_0x1a32('0x25')](db[_0x1a32('0x26')]['rawAttributes'],function(_0x3a51e2){return{'name':_0x3a51e2[_0x1a32('0x27')],'type':_0x3a51e2[_0x1a32('0x28')][_0x1a32('0x29')]};});_0x2094fa[_0x1a32('0x2a')]=_[_0x1a32('0x25')](_0x35af58,_0x1a32('0x2b'));_0x2094fa[_0x1a32('0x2c')]=_[_0x1a32('0x2d')](_0x40ca2e['query']);_0x2094fa[_0x1a32('0x2e')]=_[_0x1a32('0x2f')](_0x2094fa['model'],_0x2094fa['query']);_0x4771b7[_0x1a32('0x30')]=_['intersection'](_0x2094fa['model'],qs[_0x1a32('0x31')](_0x40ca2e['query']['fields']));_0x4771b7['attributes']=_0x4771b7['attributes'][_0x1a32('0x32')]?_0x4771b7[_0x1a32('0x30')]:_0x2094fa[_0x1a32('0x2a')];if(!_0x40ca2e[_0x1a32('0x2c')][_0x1a32('0x33')]('nolimit')){_0x4771b7['limit']=qs[_0x1a32('0x1c')](_0x40ca2e['query'][_0x1a32('0x1c')]);_0x4771b7[_0x1a32('0x1b')]=qs[_0x1a32('0x1b')](_0x40ca2e['query'][_0x1a32('0x1b')]);}_0x4771b7[_0x1a32('0x34')]=qs[_0x1a32('0x35')](_0x40ca2e[_0x1a32('0x2c')][_0x1a32('0x35')]);_0x4771b7[_0x1a32('0x36')]=qs[_0x1a32('0x2e')](_[_0x1a32('0x37')](_0x40ca2e[_0x1a32('0x2c')],_0x2094fa['filters']));if(_0x40ca2e[_0x1a32('0x2c')][_0x1a32('0x38')]){_0x4771b7[_0x1a32('0x36')]=_['merge'](_0x4771b7[_0x1a32('0x36')],{'$or':_[_0x1a32('0x25')](_0x35af58,function(_0x59201f){if(_0x59201f[_0x1a32('0x28')]!==_0x1a32('0x39')){var _0x1cb5e5={};_0x1cb5e5[_0x59201f[_0x1a32('0x2b')]]={'$like':'%'+_0x40ca2e[_0x1a32('0x2c')][_0x1a32('0x38')]+'%'};return _0x1cb5e5;}})});}_0x4771b7=_[_0x1a32('0x3a')]({},_0x4771b7,_0x40ca2e[_0x1a32('0x3b')]);var _0x3e26e8={'where':_0x4771b7[_0x1a32('0x36')]};return db[_0x1a32('0x26')][_0x1a32('0x3c')](_0x3e26e8)['then'](function(_0x5e25fd){_0x382b3c['count']=_0x5e25fd;if(_0x40ca2e[_0x1a32('0x2c')][_0x1a32('0x3d')]){_0x4771b7[_0x1a32('0x3e')]=[{'all':!![]}];}return db[_0x1a32('0x26')][_0x1a32('0x3f')](_0x4771b7);})['then'](function(_0x14b8de){_0x382b3c[_0x1a32('0x40')]=_0x14b8de;return _0x382b3c;})[_0x1a32('0x22')](respondWithFilteredResult(_0x2309b3,_0x4771b7))[_0x1a32('0x41')](handleError(_0x2309b3,null));};exports[_0x1a32('0x42')]=function(_0x466fab,_0x554872){var _0x2e618e={'raw':![],'where':{'id':_0x466fab[_0x1a32('0x43')]['id']}},_0x10e8b2={};_0x10e8b2[_0x1a32('0x2a')]=_[_0x1a32('0x2d')](db['IntegrationReport']['rawAttributes']);_0x10e8b2['query']=_['keys'](_0x466fab[_0x1a32('0x2c')]);_0x10e8b2[_0x1a32('0x2e')]=_['intersection'](_0x10e8b2[_0x1a32('0x2a')],_0x10e8b2[_0x1a32('0x2c')]);_0x2e618e[_0x1a32('0x30')]=_[_0x1a32('0x2f')](_0x10e8b2[_0x1a32('0x2a')],qs[_0x1a32('0x31')](_0x466fab[_0x1a32('0x2c')][_0x1a32('0x31')]));_0x2e618e[_0x1a32('0x30')]=_0x2e618e[_0x1a32('0x30')][_0x1a32('0x32')]?_0x2e618e[_0x1a32('0x30')]:_0x10e8b2[_0x1a32('0x2a')];if(_0x466fab['query'][_0x1a32('0x3d')]){_0x2e618e['include']=[{'all':!![]}];}_0x2e618e=_['merge']({},_0x2e618e,_0x466fab[_0x1a32('0x3b')]);return db['IntegrationReport'][_0x1a32('0x44')](_0x2e618e)['then'](handleEntityNotFound(_0x554872,null))[_0x1a32('0x22')](respondWithResult(_0x554872,null))[_0x1a32('0x41')](handleError(_0x554872,null));};exports[_0x1a32('0x45')]=function(_0x384e9a,_0x34c841){return db[_0x1a32('0x26')][_0x1a32('0x45')](_0x384e9a[_0x1a32('0x46')],{})[_0x1a32('0x22')](respondWithResult(_0x34c841,0xc9))['catch'](handleError(_0x34c841,null));};exports[_0x1a32('0x21')]=function(_0x1514ef,_0x1a9ed7){if(_0x1514ef['body']['id']){delete _0x1514ef[_0x1a32('0x46')]['id'];}return db[_0x1a32('0x26')][_0x1a32('0x44')]({'where':{'id':_0x1514ef[_0x1a32('0x43')]['id']}})[_0x1a32('0x22')](handleEntityNotFound(_0x1a9ed7,null))['then'](saveUpdates(_0x1514ef[_0x1a32('0x46')],null))[_0x1a32('0x22')](respondWithResult(_0x1a9ed7,null))[_0x1a32('0x41')](handleError(_0x1a9ed7,null));};exports[_0x1a32('0x23')]=function(_0x1c4566,_0x24b75b){return db[_0x1a32('0x26')][_0x1a32('0x44')]({'where':{'id':_0x1c4566[_0x1a32('0x43')]['id']}})['then'](handleEntityNotFound(_0x24b75b,null))[_0x1a32('0x22')](removeEntity(_0x24b75b,null))[_0x1a32('0x41')](handleError(_0x24b75b,null));};exports[_0x1a32('0x47')]=function(_0x4a0042,_0x36f803){return db[_0x1a32('0x26')]['describe']()[_0x1a32('0x22')](respondWithResult(_0x36f803,null))[_0x1a32('0x41')](handleError(_0x36f803,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 7e3c806..233973a 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 _0x3bcc=['./integrationReport.attributes','exports','IntegrationReport','report_integration','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x43f6e1,_0x1c8c8a){var _0x136af9=function(_0x42fd1f){while(--_0x42fd1f){_0x43f6e1['push'](_0x43f6e1['shift']());}};_0x136af9(++_0x1c8c8a);}(_0x3bcc,0x178));var _0xc3bc=function(_0x131ea5,_0x22f9c0){_0x131ea5=_0x131ea5-0x0;var _0x63e4a2=_0x3bcc[_0x131ea5];return _0x63e4a2;};'use strict';var _=require('lodash');var util=require(_0xc3bc('0x0'));var logger=require(_0xc3bc('0x1'))(_0xc3bc('0x2'));var moment=require('moment');var BPromise=require(_0xc3bc('0x3'));var rp=require(_0xc3bc('0x4'));var fs=require('fs');var path=require(_0xc3bc('0x5'));var rimraf=require(_0xc3bc('0x6'));var config=require(_0xc3bc('0x7'));var attributes=require(_0xc3bc('0x8'));module[_0xc3bc('0x9')]=function(_0x533b75,_0x3f2c10){return _0x533b75['define'](_0xc3bc('0xa'),attributes,{'tableName':_0xc3bc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcfe6=['../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','report_integration','lodash','api','bluebird','request-promise','rimraf'];(function(_0x105d80,_0x38241d){var _0x53ab3c=function(_0x580742){while(--_0x580742){_0x105d80['push'](_0x105d80['shift']());}};_0x53ab3c(++_0x38241d);}(_0xcfe6,0x1ea));var _0x6cfe=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcfe6[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x6cfe('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6cfe('0x1'));var moment=require('moment');var BPromise=require(_0x6cfe('0x2'));var rp=require(_0x6cfe('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6cfe('0x4'));var config=require(_0x6cfe('0x5'));var attributes=require(_0x6cfe('0x6'));module[_0x6cfe('0x7')]=function(_0x2b4095,_0x1642ed){return _0x2b4095[_0x6cfe('0x8')](_0x6cfe('0x9'),attributes,{'tableName':_0x6cfe('0xa'),'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 d9311ff..ada382c 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 _0xb10b=['stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','IntegrationReport,\x20%s,\x20%s','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0xda9816,_0x2478e1){var _0x1fee48=function(_0x35fa6a){while(--_0x35fa6a){_0xda9816['push'](_0xda9816['shift']());}};_0x1fee48(++_0x2478e1);}(_0xb10b,0x12a));var _0xbb10=function(_0x242b6a,_0x2fc54a){_0x242b6a=_0x242b6a-0x0;var _0xab0bd0=_0xb10b[_0x242b6a];return _0xab0bd0;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});} \ No newline at end of file +var _0xda3f=['rpc','jayson/promise','client','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/logger'];(function(_0x3f465d,_0xbd2037){var _0x121ad1=function(_0x5b13d6){while(--_0x5b13d6){_0x3f465d['push'](_0x3f465d['shift']());}};_0x121ad1(++_0xbd2037);}(_0xda3f,0xec));var _0xfda3=function(_0x107672,_0x501f48){_0x107672=_0x107672-0x0;var _0x49f036=_0xda3f[_0x107672];return _0x49f036;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var moment=require(_0xfda3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x3'))(_0xfda3('0x4'));var config=require('../../config/environment');var jayson=require(_0xfda3('0x5'));var client=jayson[_0xfda3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e72d1,_0x316792,_0x42476a){return new BPromise(function(_0x125e2a,_0x4018c0){return client[_0xfda3('0x7')](_0x4e72d1,_0x42476a)[_0xfda3('0x8')](function(_0x46655c){logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x316792,_0xfda3('0xb'));logger[_0xfda3('0xc')](_0xfda3('0xd'),_0x316792,'request\x20sent',JSON[_0xfda3('0xe')](_0x46655c));if(_0x46655c[_0xfda3('0xf')]){if(_0x46655c[_0xfda3('0xf')][_0xfda3('0x10')]===0x1f4){logger[_0xfda3('0xf')]('IntegrationReport,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('IntegrationReport,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('IntegrationReport,\x20%s,\x20%s',_0x316792,_0xfda3('0xb'));_0x125e2a(_0x46655c[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0x34900d){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x316792,_0x34900d);_0x4018c0(_0x34900d);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index a6267fa..de90eb3 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 _0x7217=['multer','path','connect-timeout','express','Router','../../components/auth/service','./interval.controller','get','isAuthenticated','index','/:id','show','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','destroy','exports'];(function(_0x22205c,_0x473493){var _0x3f5efe=function(_0x153dbb){while(--_0x153dbb){_0x22205c['push'](_0x22205c['shift']());}};_0x3f5efe(++_0x473493);}(_0x7217,0x19e));var _0x7721=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x7217[_0x46aff0];return _0x9d78cf;};'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 auth=require(_0x7721('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7721('0x6'));router[_0x7721('0x7')]('/',auth[_0x7721('0x8')](),controller[_0x7721('0x9')]);router[_0x7721('0x7')](_0x7721('0xa'),auth[_0x7721('0x8')](),controller[_0x7721('0xb')]);router[_0x7721('0x7')](_0x7721('0xc'),auth[_0x7721('0x8')](),controller[_0x7721('0xd')]);router[_0x7721('0xe')]('/',auth[_0x7721('0x8')](),controller[_0x7721('0xf')]);router['post'](_0x7721('0xc'),auth[_0x7721('0x8')](),controller[_0x7721('0x10')]);router[_0x7721('0xe')](_0x7721('0x11'),auth[_0x7721('0x8')](),controller[_0x7721('0x12')]);router[_0x7721('0x13')]('/:id',auth[_0x7721('0x8')](),controller[_0x7721('0x14')]);router['delete'](_0x7721('0xa'),auth[_0x7721('0x8')](),controller[_0x7721('0x15')]);module[_0x7721('0x16')]=router; \ No newline at end of file +var _0x9c44=['../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','/:id/sub_intervals','getIntervals','post','addInterval','addIntervals','put','update','destroy','exports','path','connect-timeout','express','Router'];(function(_0x4856e5,_0x537d8e){var _0x31c7a1=function(_0x52e066){while(--_0x52e066){_0x4856e5['push'](_0x4856e5['shift']());}};_0x31c7a1(++_0x537d8e);}(_0x9c44,0x178));var _0x49c4=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x9c44[_0x2d7f0e];return _0x110b07;};'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 auth=require(_0x49c4('0x4'));var interaction=require(_0x49c4('0x5'));var config=require('../../config/environment');var controller=require('./interval.controller');router[_0x49c4('0x6')]('/',auth['isAuthenticated'](),controller[_0x49c4('0x7')]);router[_0x49c4('0x6')](_0x49c4('0x8'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xa')]);router['get'](_0x49c4('0xb'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xc')]);router[_0x49c4('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x49c4('0xd')](_0x49c4('0xb'),auth['isAuthenticated'](),controller[_0x49c4('0xe')]);router[_0x49c4('0xd')]('/:id/sub_intervals/create_many',auth['isAuthenticated'](),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth[_0x49c4('0x9')](),controller[_0x49c4('0x11')]);router['delete'](_0x49c4('0x8'),auth[_0x49c4('0x9')](),controller[_0x49c4('0x12')]);module[_0x49c4('0x13')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 96d69a5..6065cfd 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 _0x1da3=['sequelize'];(function(_0x44da8b,_0x44b4c1){var _0x4c86ff=function(_0x4ed33d){while(--_0x4ed33d){_0x44da8b['push'](_0x44da8b['shift']());}};_0x4c86ff(++_0x44b4c1);}(_0x1da3,0x78));var _0x31da=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x1da3[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0x31da('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x4912=['exports','STRING'];(function(_0x565010,_0x4dd720){var _0x210689=function(_0x1d2b51){while(--_0x1d2b51){_0x565010['push'](_0x565010['shift']());}};_0x210689(++_0x4dd720);}(_0x4912,0x178));var _0x2491=function(_0x34faa4,_0x5e7822){_0x34faa4=_0x34faa4-0x0;var _0x2211a9=_0x4912[_0x34faa4];return _0x2211a9;};'use strict';var Sequelize=require('sequelize');module[_0x2491('0x0')]={'name':{'type':Sequelize[_0x2491('0x1')]},'description':{'type':Sequelize[_0x2491('0x1')]},'interval':{'type':Sequelize[_0x2491('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 64336e8..6d43318 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 _0x008c=['query','keys','filters','intersection','attributes','fields','length','nolimit','limit','offset','order','sort','pick','where','VIRTUAL','filter','merge','options','Interval','include','findAll','catch','show','params','rawAttributes','includeAll','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Intervals','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','addInterval','getIntervals','findOne','hasOwnProperty','sequelize','IntervalId','bulkCreate','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','end','status','json','count','set','Content-Range','save','destroy','then','get','UserProfileResource','sendStatus','name','send','map','fieldName','type','key','model'];(function(_0x1b658,_0x344b6a){var _0x1d17e5=function(_0x1fae07){while(--_0x1fae07){_0x1b658['push'](_0x1b658['shift']());}};_0x1d17e5(++_0x344b6a);}(_0x008c,0x188));var _0xc008=function(_0x2fe3b9,_0xca959f){_0x2fe3b9=_0x2fe3b9-0x0;var _0x35c846=_0x008c[_0x2fe3b9];return _0x35c846;};'use strict';var pdf=require(_0xc008('0x0'));var emlformat=require(_0xc008('0x1'));var rimraf=require(_0xc008('0x2'));var zipdir=require(_0xc008('0x3'));var jsonpatch=require(_0xc008('0x4'));var rp=require('request-promise');var moment=require(_0xc008('0x5'));var BPromise=require(_0xc008('0x6'));var Mustache=require(_0xc008('0x7'));var util=require(_0xc008('0x8'));var path=require(_0xc008('0x9'));var sox=require(_0xc008('0xa'));var csv=require(_0xc008('0xb'));var ejs=require(_0xc008('0xc'));var fs=require('fs');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 db=require(_0xc008('0x16'))['db'];var extensions=require(_0xc008('0x17'));function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=_0x5e894e[_0xc008('0x1b')],_0x11ef38=_0x5ee00b['offset'],_0x15a6ad=_0x5ee00b['offset']+_0x5ee00b['limit'],_0x3cafe3;if(_0x15a6ad>=_0x4bd0f4){_0x15a6ad=_0x4bd0f4;_0x3cafe3=0xc8;}else{_0x3cafe3=0xce;}_0x3f0ecf['status'](_0x3cafe3);return _0x3f0ecf[_0xc008('0x1c')](_0xc008('0x1d'),_0x11ef38+'-'+_0x15a6ad+'/'+_0x4bd0f4)['json'](_0x5e894e);}return null;};}function patchUpdates(_0x813397){return function(_0x5906e6){try{jsonpatch['apply'](_0x5906e6,_0x813397,!![]);}catch(_0x543e5d){return BPromise['reject'](_0x543e5d);}return _0x5906e6[_0xc008('0x1e')]();};}function saveUpdates(_0x4b9726,_0x5560b1){return function(_0x590a71){if(_0x590a71){return _0x590a71['update'](_0x4b9726)['then'](function(_0x13a263){return _0x13a263;});}return null;};}function removeEntity(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x1f')]()[_0xc008('0x20')](function(){var _0x4f43e2=_0x415af3[_0xc008('0x21')]({'plain':!![]});var _0x5c85f2='Intervals';return db[_0xc008('0x22')][_0xc008('0x1f')]({'where':{'type':_0x5c85f2,'resourceId':_0x4f43e2['id']}})[_0xc008('0x20')](function(){return _0x415af3;});})[_0xc008('0x20')](function(){_0x4777a6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5de1e9,_0x3f7b07){return function(_0x15dade){if(!_0x15dade){_0x5de1e9[_0xc008('0x23')](0x194);}return _0x15dade;};}function handleError(_0x2e31c2,_0x5bebd9){_0x5bebd9=_0x5bebd9||0x1f4;return function(_0x5e2aca){logger['error'](_0x5e2aca['stack']);if(_0x5e2aca['name']){delete _0x5e2aca[_0xc008('0x24')];}_0x2e31c2[_0xc008('0x19')](_0x5bebd9)[_0xc008('0x25')](_0x5e2aca);};}exports['index']=function(_0x24c14c,_0x32390d){var _0x209591={},_0x2a7d4f={},_0x4c5dec={'count':0x0,'rows':[]};var _0xcdb32b=_[_0xc008('0x26')](db['Interval']['rawAttributes'],function(_0x539766){return{'name':_0x539766[_0xc008('0x27')],'type':_0x539766[_0xc008('0x28')][_0xc008('0x29')]};});_0x2a7d4f[_0xc008('0x2a')]=_[_0xc008('0x26')](_0xcdb32b,_0xc008('0x24'));_0x2a7d4f[_0xc008('0x2b')]=_[_0xc008('0x2c')](_0x24c14c[_0xc008('0x2b')]);_0x2a7d4f[_0xc008('0x2d')]=_[_0xc008('0x2e')](_0x2a7d4f[_0xc008('0x2a')],_0x2a7d4f['query']);_0x209591[_0xc008('0x2f')]=_[_0xc008('0x2e')](_0x2a7d4f['model'],qs[_0xc008('0x30')](_0x24c14c[_0xc008('0x2b')][_0xc008('0x30')]));_0x209591[_0xc008('0x2f')]=_0x209591[_0xc008('0x2f')][_0xc008('0x31')]?_0x209591[_0xc008('0x2f')]:_0x2a7d4f[_0xc008('0x2a')];if(!_0x24c14c[_0xc008('0x2b')]['hasOwnProperty'](_0xc008('0x32'))){_0x209591[_0xc008('0x33')]=qs[_0xc008('0x33')](_0x24c14c[_0xc008('0x2b')][_0xc008('0x33')]);_0x209591[_0xc008('0x34')]=qs[_0xc008('0x34')](_0x24c14c['query'][_0xc008('0x34')]);}_0x209591[_0xc008('0x35')]=qs['sort'](_0x24c14c[_0xc008('0x2b')][_0xc008('0x36')]);_0x209591['where']=qs[_0xc008('0x2d')](_[_0xc008('0x37')](_0x24c14c[_0xc008('0x2b')],_0x2a7d4f['filters']));if(_0x24c14c['query']['filter']){_0x209591[_0xc008('0x38')]=_['merge'](_0x209591[_0xc008('0x38')],{'$or':_[_0xc008('0x26')](_0xcdb32b,function(_0x6a4ccb){if(_0x6a4ccb[_0xc008('0x28')]!==_0xc008('0x39')){var _0xa381d1={};_0xa381d1[_0x6a4ccb[_0xc008('0x24')]]={'$like':'%'+_0x24c14c[_0xc008('0x2b')][_0xc008('0x3a')]+'%'};return _0xa381d1;}})});}_0x209591=_[_0xc008('0x3b')]({},_0x209591,_0x24c14c[_0xc008('0x3c')]);var _0xdfca2e={'where':_0x209591[_0xc008('0x38')]};return db[_0xc008('0x3d')]['count'](_0xdfca2e)[_0xc008('0x20')](function(_0x23c4db){_0x4c5dec[_0xc008('0x1b')]=_0x23c4db;if(_0x24c14c[_0xc008('0x2b')]['includeAll']){_0x209591[_0xc008('0x3e')]=[{'all':!![]}];}return db[_0xc008('0x3d')][_0xc008('0x3f')](_0x209591);})[_0xc008('0x20')](function(_0x2d142d){_0x4c5dec['rows']=_0x2d142d;return _0x4c5dec;})[_0xc008('0x20')](respondWithFilteredResult(_0x32390d,_0x209591))[_0xc008('0x40')](handleError(_0x32390d,null));};exports[_0xc008('0x41')]=function(_0x3e9a99,_0x7279e8){var _0x4f93a4={'raw':!![],'where':{'id':_0x3e9a99[_0xc008('0x42')]['id']}},_0xf4cc4b={};_0xf4cc4b[_0xc008('0x2a')]=_[_0xc008('0x2c')](db['Interval'][_0xc008('0x43')]);_0xf4cc4b[_0xc008('0x2b')]=_[_0xc008('0x2c')](_0x3e9a99['query']);_0xf4cc4b[_0xc008('0x2d')]=_['intersection'](_0xf4cc4b[_0xc008('0x2a')],_0xf4cc4b['query']);_0x4f93a4[_0xc008('0x2f')]=_[_0xc008('0x2e')](_0xf4cc4b['model'],qs[_0xc008('0x30')](_0x3e9a99[_0xc008('0x2b')][_0xc008('0x30')]));_0x4f93a4['attributes']=_0x4f93a4[_0xc008('0x2f')][_0xc008('0x31')]?_0x4f93a4[_0xc008('0x2f')]:_0xf4cc4b[_0xc008('0x2a')];if(_0x3e9a99[_0xc008('0x2b')][_0xc008('0x44')]){_0x4f93a4['include']=[{'all':!![]}];}_0x4f93a4=_['merge']({},_0x4f93a4,_0x3e9a99['options']);return db[_0xc008('0x3d')][_0xc008('0x45')](_0x4f93a4)[_0xc008('0x20')](handleEntityNotFound(_0x7279e8,null))[_0xc008('0x20')](respondWithResult(_0x7279e8,null))[_0xc008('0x40')](handleError(_0x7279e8,null));};exports[_0xc008('0x46')]=function(_0x2cf641,_0x33be4f){return db['Interval']['create'](_0x2cf641['body'],{})[_0xc008('0x20')](function(_0x2651cf){var _0x158eae=_0x2cf641['user'][_0xc008('0x21')]({'plain':!![]});if(!_0x158eae)throw new Error(_0xc008('0x47'));if(_0x158eae[_0xc008('0x48')]===_0xc008('0x49')){var _0x4981b4=_0x2651cf[_0xc008('0x21')]({'plain':!![]});var _0x17ec90=_0xc008('0x4a');return db[_0xc008('0x4b')][_0xc008('0x45')]({'where':{'name':_0x17ec90,'userProfileId':_0x158eae['userProfileId']},'raw':!![]})['then'](function(_0x223056){if(_0x223056&&_0x223056['autoAssociation']===0x0){return db[_0xc008('0x22')][_0xc008('0x46')]({'name':_0x4981b4[_0xc008('0x24')],'resourceId':_0x4981b4['id'],'type':_0x223056['name'],'sectionId':_0x223056['id']},{})[_0xc008('0x20')](function(){return _0x2651cf;});}else{return _0x2651cf;}})[_0xc008('0x40')](function(_0xee64){logger[_0xc008('0x4c')](_0xc008('0x4d'),_0xee64);throw _0xee64;});}return _0x2651cf;})['then'](respondWithResult(_0x33be4f,0xc9))[_0xc008('0x40')](handleError(_0x33be4f,null));};exports[_0xc008('0x4e')]=function(_0x4b4c6d,_0x24f775){if(_0x4b4c6d[_0xc008('0x4f')]['id']){delete _0x4b4c6d['body']['id'];}return db['Interval'][_0xc008('0x45')]({'where':{'id':_0x4b4c6d[_0xc008('0x42')]['id']}})[_0xc008('0x20')](handleEntityNotFound(_0x24f775,null))[_0xc008('0x20')](saveUpdates(_0x4b4c6d[_0xc008('0x4f')],null))['then'](respondWithResult(_0x24f775,null))['catch'](handleError(_0x24f775,null));};exports[_0xc008('0x1f')]=function(_0x5d815d,_0x3d7cce){return db[_0xc008('0x3d')][_0xc008('0x45')]({'where':{'id':_0x5d815d[_0xc008('0x42')]['id']}})[_0xc008('0x20')](handleEntityNotFound(_0x3d7cce,null))[_0xc008('0x20')](removeEntity(_0x3d7cce,null))['catch'](handleError(_0x3d7cce,null));};exports[_0xc008('0x50')]=function(_0xbd7422,_0x9a7abc,_0x2b350c){if(_0xbd7422[_0xc008('0x4f')]['id']){delete _0xbd7422['body']['id'];}return db[_0xc008('0x3d')]['find']({'where':{'id':_0xbd7422['params']['id']}})['then'](handleEntityNotFound(_0x9a7abc,null))[_0xc008('0x20')](function(_0x1bcbb1){if(_0x1bcbb1){_0xbd7422[_0xc008('0x4f')]['IntervalId']=_0x1bcbb1['id'];return db[_0xc008('0x3d')][_0xc008('0x46')](_0xbd7422[_0xc008('0x4f')]);}})['then'](respondWithResult(_0x9a7abc,null))[_0xc008('0x40')](handleError(_0x9a7abc,null));};exports[_0xc008('0x51')]=function(_0x12ba3f,_0x1b5a22,_0x5baff1){var _0x4022dd={};var _0x4eaa6d={};var _0x23ef33;var _0x422e1f;return db[_0xc008('0x3d')][_0xc008('0x52')]({'where':{'id':_0x12ba3f[_0xc008('0x42')]['id']}})[_0xc008('0x20')](handleEntityNotFound(_0x1b5a22,null))['then'](function(_0x375e71){if(_0x375e71){_0x23ef33=_0x375e71;_0x4eaa6d['model']=_['keys'](db[_0xc008('0x3d')][_0xc008('0x43')]);_0x4eaa6d['query']=_[_0xc008('0x2c')](_0x12ba3f[_0xc008('0x2b')]);_0x4eaa6d[_0xc008('0x2d')]=_[_0xc008('0x2e')](_0x4eaa6d[_0xc008('0x2a')],_0x4eaa6d[_0xc008('0x2b')]);_0x4022dd[_0xc008('0x2f')]=_['intersection'](_0x4eaa6d[_0xc008('0x2a')],qs[_0xc008('0x30')](_0x12ba3f[_0xc008('0x2b')][_0xc008('0x30')]));_0x4022dd[_0xc008('0x2f')]=_0x4022dd[_0xc008('0x2f')][_0xc008('0x31')]?_0x4022dd[_0xc008('0x2f')]:_0x4eaa6d[_0xc008('0x2a')];_0x4022dd[_0xc008('0x35')]=qs[_0xc008('0x36')](_0x12ba3f[_0xc008('0x2b')][_0xc008('0x36')]);_0x4022dd[_0xc008('0x38')]=qs['filters'](_[_0xc008('0x37')](_0x12ba3f[_0xc008('0x2b')],_0x4eaa6d[_0xc008('0x2d')]));if(_0x12ba3f['query'][_0xc008('0x3a')]){_0x4022dd[_0xc008('0x38')]=_['merge'](_0x4022dd['where'],{'$or':_[_0xc008('0x26')](_0x4022dd[_0xc008('0x2f')],function(_0x7bad14){var _0x39083c={};_0x39083c[_0x7bad14]={'$like':'%'+_0x12ba3f[_0xc008('0x2b')][_0xc008('0x3a')]+'%'};return _0x39083c;})});}_0x4022dd=_[_0xc008('0x3b')]({},_0x4022dd,_0x12ba3f[_0xc008('0x3c')]);return _0x23ef33[_0xc008('0x51')](_0x4022dd);}})[_0xc008('0x20')](function(_0x383325){if(_0x383325){_0x422e1f=_0x383325['length'];if(!_0x12ba3f[_0xc008('0x2b')][_0xc008('0x53')](_0xc008('0x32'))){_0x4022dd[_0xc008('0x33')]=qs['limit'](_0x12ba3f[_0xc008('0x2b')]['limit']);_0x4022dd[_0xc008('0x34')]=qs[_0xc008('0x34')](_0x12ba3f[_0xc008('0x2b')]['offset']);}return _0x23ef33[_0xc008('0x51')](_0x4022dd);}})[_0xc008('0x20')](function(_0xa80000){if(_0xa80000){return _0xa80000?{'count':_0x422e1f,'rows':_0xa80000}:null;}})['then'](respondWithResult(_0x1b5a22,null))[_0xc008('0x40')](handleError(_0x1b5a22,null));};exports['addIntervals']=function(_0x50ee03,_0xee7a85,_0x23012c){return db[_0xc008('0x3d')][_0xc008('0x52')]({'where':{'id':_0x50ee03['params']['id']}})[_0xc008('0x20')](handleEntityNotFound(_0xee7a85,null))[_0xc008('0x20')](function(_0x49493b){if(_0x49493b){return db[_0xc008('0x54')]['transaction'](function(_0x278cbe){return db['Interval'][_0xc008('0x1f')]({'where':{'IntervalId':_0x50ee03['params']['id']},'transaction':_0x278cbe})[_0xc008('0x20')](function(_0x103d75){var _0x33d8e4=_[_0xc008('0x26')](_0x50ee03['body'],function(_0x57752c){delete _0x57752c['id'];_0x57752c[_0xc008('0x55')]=_0x50ee03[_0xc008('0x42')]['id'];return _0x57752c;});return db[_0xc008('0x3d')][_0xc008('0x56')](_0x33d8e4,{'transaction':_0x278cbe});});})[_0xc008('0x20')](function(){return db[_0xc008('0x3d')][_0xc008('0x3f')]({'where':{'IntervalId':_0x50ee03['params']['id']}});});}})[_0xc008('0x20')](respondWithResult(_0xee7a85,null))['catch'](handleError(_0xee7a85,null));}; \ No newline at end of file +var _0xa9e0=['rows','catch','show','params','includeAll','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','find','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','getIntervals','pick','nolimit','addIntervals','findOne','transaction','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','../../components/extensions/rewrite','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','Intervals','UserProfileResource','stack','name','send','index','map','Interval','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','filter','merge','where','VIRTUAL','count','include','findAll'];(function(_0x2ac6cf,_0x4ef760){var _0x355c9a=function(_0x46411c){while(--_0x46411c){_0x2ac6cf['push'](_0x2ac6cf['shift']());}};_0x355c9a(++_0x4ef760);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');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 db=require(_0x0a9e('0x13'))['db'];var extensions=require(_0x0a9e('0x14'));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=_0x5d0880['count'],_0x519dfd=_0x22dccb[_0x0a9e('0x19')],_0x16033c=_0x22dccb['offset']+_0x22dccb[_0x0a9e('0x1a')],_0x12066b;if(_0x16033c>=_0x1985b6){_0x16033c=_0x1985b6;_0x12066b=0xc8;}else{_0x12066b=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x12066b);return _0x52a03d[_0x0a9e('0x1b')](_0x0a9e('0x1c'),_0x519dfd+'-'+_0x16033c+'/'+_0x1985b6)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x2eb11f){return function(_0x530eb7){try{jsonpatch[_0x0a9e('0x1d')](_0x530eb7,_0x2eb11f,!![]);}catch(_0x1314ae){return BPromise[_0x0a9e('0x1e')](_0x1314ae);}return _0x530eb7[_0x0a9e('0x1f')]();};}function saveUpdates(_0x105080,_0x4bb1e3){return function(_0x2c3407){if(_0x2c3407){return _0x2c3407[_0x0a9e('0x20')](_0x105080)['then'](function(_0x20f109){return _0x20f109;});}return null;};}function removeEntity(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')]()[_0x0a9e('0x22')](function(){var _0x30bae6=_0x3a02e1['get']({'plain':!![]});var _0xfb6e48=_0x0a9e('0x23');return db[_0x0a9e('0x24')][_0x0a9e('0x21')]({'where':{'type':_0xfb6e48,'resourceId':_0x30bae6['id']}})[_0x0a9e('0x22')](function(){return _0x3a02e1;});})[_0x0a9e('0x22')](function(){_0x5a09ef[_0x0a9e('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59181e,_0x197ec0){return function(_0x3a8e58){if(!_0x3a8e58){_0x59181e[_0x0a9e('0x15')](0x194);}return _0x3a8e58;};}function handleError(_0x33161b,_0x526cf3){_0x526cf3=_0x526cf3||0x1f4;return function(_0x384319){logger['error'](_0x384319[_0x0a9e('0x25')]);if(_0x384319['name']){delete _0x384319[_0x0a9e('0x26')];}_0x33161b[_0x0a9e('0x17')](_0x526cf3)[_0x0a9e('0x27')](_0x384319);};}exports[_0x0a9e('0x28')]=function(_0x140511,_0x1538a4){var _0x11c3b6={},_0x14de77={},_0x5a101a={'count':0x0,'rows':[]};var _0x3652a7=_[_0x0a9e('0x29')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')],function(_0x5c877d){return{'name':_0x5c877d[_0x0a9e('0x2c')],'type':_0x5c877d[_0x0a9e('0x2d')][_0x0a9e('0x2e')]};});_0x14de77[_0x0a9e('0x2f')]=_[_0x0a9e('0x29')](_0x3652a7,_0x0a9e('0x26'));_0x14de77[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x140511[_0x0a9e('0x30')]);_0x14de77['filters']=_[_0x0a9e('0x32')](_0x14de77['model'],_0x14de77[_0x0a9e('0x30')]);_0x11c3b6[_0x0a9e('0x33')]=_[_0x0a9e('0x32')](_0x14de77[_0x0a9e('0x2f')],qs[_0x0a9e('0x34')](_0x140511['query'][_0x0a9e('0x34')]));_0x11c3b6[_0x0a9e('0x33')]=_0x11c3b6[_0x0a9e('0x33')][_0x0a9e('0x35')]?_0x11c3b6[_0x0a9e('0x33')]:_0x14de77[_0x0a9e('0x2f')];if(!_0x140511[_0x0a9e('0x30')][_0x0a9e('0x36')]('nolimit')){_0x11c3b6[_0x0a9e('0x1a')]=qs['limit'](_0x140511[_0x0a9e('0x30')][_0x0a9e('0x1a')]);_0x11c3b6[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x140511['query'][_0x0a9e('0x19')]);}_0x11c3b6[_0x0a9e('0x37')]=qs[_0x0a9e('0x38')](_0x140511[_0x0a9e('0x30')]['sort']);_0x11c3b6['where']=qs[_0x0a9e('0x39')](_['pick'](_0x140511[_0x0a9e('0x30')],_0x14de77[_0x0a9e('0x39')]));if(_0x140511[_0x0a9e('0x30')][_0x0a9e('0x3a')]){_0x11c3b6['where']=_[_0x0a9e('0x3b')](_0x11c3b6[_0x0a9e('0x3c')],{'$or':_[_0x0a9e('0x29')](_0x3652a7,function(_0x533942){if(_0x533942[_0x0a9e('0x2d')]!==_0x0a9e('0x3d')){var _0x289467={};_0x289467[_0x533942['name']]={'$like':'%'+_0x140511['query'][_0x0a9e('0x3a')]+'%'};return _0x289467;}})});}_0x11c3b6=_[_0x0a9e('0x3b')]({},_0x11c3b6,_0x140511['options']);var _0x2b814e={'where':_0x11c3b6[_0x0a9e('0x3c')]};return db[_0x0a9e('0x2a')][_0x0a9e('0x3e')](_0x2b814e)['then'](function(_0x5a594b){_0x5a101a[_0x0a9e('0x3e')]=_0x5a594b;if(_0x140511[_0x0a9e('0x30')]['includeAll']){_0x11c3b6[_0x0a9e('0x3f')]=[{'all':!![]}];}return db[_0x0a9e('0x2a')][_0x0a9e('0x40')](_0x11c3b6);})['then'](function(_0x316c8f){_0x5a101a[_0x0a9e('0x41')]=_0x316c8f;return _0x5a101a;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x1538a4,_0x11c3b6))[_0x0a9e('0x42')](handleError(_0x1538a4,null));};exports[_0x0a9e('0x43')]=function(_0xeaa5e5,_0x2881b3){var _0x45a9b8={'raw':!![],'where':{'id':_0xeaa5e5[_0x0a9e('0x44')]['id']}},_0x23b089={};_0x23b089[_0x0a9e('0x2f')]=_[_0x0a9e('0x31')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x23b089[_0x0a9e('0x30')]=_['keys'](_0xeaa5e5['query']);_0x23b089[_0x0a9e('0x39')]=_[_0x0a9e('0x32')](_0x23b089[_0x0a9e('0x2f')],_0x23b089[_0x0a9e('0x30')]);_0x45a9b8[_0x0a9e('0x33')]=_[_0x0a9e('0x32')](_0x23b089[_0x0a9e('0x2f')],qs[_0x0a9e('0x34')](_0xeaa5e5[_0x0a9e('0x30')][_0x0a9e('0x34')]));_0x45a9b8[_0x0a9e('0x33')]=_0x45a9b8[_0x0a9e('0x33')]['length']?_0x45a9b8[_0x0a9e('0x33')]:_0x23b089[_0x0a9e('0x2f')];if(_0xeaa5e5[_0x0a9e('0x30')][_0x0a9e('0x45')]){_0x45a9b8[_0x0a9e('0x3f')]=[{'all':!![]}];}_0x45a9b8=_[_0x0a9e('0x3b')]({},_0x45a9b8,_0xeaa5e5[_0x0a9e('0x46')]);return db[_0x0a9e('0x2a')]['find'](_0x45a9b8)[_0x0a9e('0x22')](handleEntityNotFound(_0x2881b3,null))['then'](respondWithResult(_0x2881b3,null))[_0x0a9e('0x42')](handleError(_0x2881b3,null));};exports[_0x0a9e('0x47')]=function(_0x8d6dd1,_0x562fb4){return db[_0x0a9e('0x2a')][_0x0a9e('0x47')](_0x8d6dd1[_0x0a9e('0x48')],{})[_0x0a9e('0x22')](function(_0x45c845){var _0x37be73=_0x8d6dd1[_0x0a9e('0x49')]['get']({'plain':!![]});if(!_0x37be73)throw new Error(_0x0a9e('0x4a'));if(_0x37be73[_0x0a9e('0x4b')]===_0x0a9e('0x49')){var _0x16f976=_0x45c845[_0x0a9e('0x4c')]({'plain':!![]});var _0x992c77=_0x0a9e('0x23');return db[_0x0a9e('0x4d')][_0x0a9e('0x4e')]({'where':{'name':_0x992c77,'userProfileId':_0x37be73['userProfileId']},'raw':!![]})[_0x0a9e('0x22')](function(_0x3fe430){if(_0x3fe430&&_0x3fe430['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x16f976[_0x0a9e('0x26')],'resourceId':_0x16f976['id'],'type':_0x3fe430[_0x0a9e('0x26')],'sectionId':_0x3fe430['id']},{})[_0x0a9e('0x22')](function(){return _0x45c845;});}else{return _0x45c845;}})[_0x0a9e('0x42')](function(_0x61bb17){logger[_0x0a9e('0x4f')](_0x0a9e('0x50'),_0x61bb17);throw _0x61bb17;});}return _0x45c845;})[_0x0a9e('0x22')](respondWithResult(_0x562fb4,0xc9))['catch'](handleError(_0x562fb4,null));};exports['update']=function(_0x53975a,_0x39d77d){if(_0x53975a[_0x0a9e('0x48')]['id']){delete _0x53975a[_0x0a9e('0x48')]['id'];}return db['Interval'][_0x0a9e('0x4e')]({'where':{'id':_0x53975a[_0x0a9e('0x44')]['id']}})['then'](handleEntityNotFound(_0x39d77d,null))['then'](saveUpdates(_0x53975a[_0x0a9e('0x48')],null))['then'](respondWithResult(_0x39d77d,null))[_0x0a9e('0x42')](handleError(_0x39d77d,null));};exports['destroy']=function(_0x2e5e62,_0x3c20b2){return db[_0x0a9e('0x2a')]['find']({'where':{'id':_0x2e5e62[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x3c20b2,null))['then'](removeEntity(_0x3c20b2,null))['catch'](handleError(_0x3c20b2,null));};exports[_0x0a9e('0x51')]=function(_0x3aedd0,_0x49c095,_0x145931){if(_0x3aedd0['body']['id']){delete _0x3aedd0[_0x0a9e('0x48')]['id'];}return db['Interval'][_0x0a9e('0x4e')]({'where':{'id':_0x3aedd0['params']['id']}})['then'](handleEntityNotFound(_0x49c095,null))['then'](function(_0x2da03c){if(_0x2da03c){_0x3aedd0['body'][_0x0a9e('0x52')]=_0x2da03c['id'];return db[_0x0a9e('0x2a')][_0x0a9e('0x47')](_0x3aedd0[_0x0a9e('0x48')]);}})[_0x0a9e('0x22')](respondWithResult(_0x49c095,null))[_0x0a9e('0x42')](handleError(_0x49c095,null));};exports[_0x0a9e('0x53')]=function(_0x28d814,_0x4e67ab,_0x1c693e){var _0x121cef={};var _0x2642bb={};var _0x30c491;var _0xb83dfd;return db[_0x0a9e('0x2a')]['findOne']({'where':{'id':_0x28d814[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x4e67ab,null))['then'](function(_0x3649cc){if(_0x3649cc){_0x30c491=_0x3649cc;_0x2642bb['model']=_[_0x0a9e('0x31')](db['Interval']['rawAttributes']);_0x2642bb['query']=_[_0x0a9e('0x31')](_0x28d814['query']);_0x2642bb[_0x0a9e('0x39')]=_[_0x0a9e('0x32')](_0x2642bb[_0x0a9e('0x2f')],_0x2642bb[_0x0a9e('0x30')]);_0x121cef[_0x0a9e('0x33')]=_[_0x0a9e('0x32')](_0x2642bb['model'],qs[_0x0a9e('0x34')](_0x28d814['query'][_0x0a9e('0x34')]));_0x121cef[_0x0a9e('0x33')]=_0x121cef[_0x0a9e('0x33')]['length']?_0x121cef[_0x0a9e('0x33')]:_0x2642bb[_0x0a9e('0x2f')];_0x121cef[_0x0a9e('0x37')]=qs[_0x0a9e('0x38')](_0x28d814['query'][_0x0a9e('0x38')]);_0x121cef[_0x0a9e('0x3c')]=qs['filters'](_[_0x0a9e('0x54')](_0x28d814[_0x0a9e('0x30')],_0x2642bb[_0x0a9e('0x39')]));if(_0x28d814[_0x0a9e('0x30')][_0x0a9e('0x3a')]){_0x121cef['where']=_[_0x0a9e('0x3b')](_0x121cef[_0x0a9e('0x3c')],{'$or':_[_0x0a9e('0x29')](_0x121cef['attributes'],function(_0x3528b7){var _0x4f1e60={};_0x4f1e60[_0x3528b7]={'$like':'%'+_0x28d814['query'][_0x0a9e('0x3a')]+'%'};return _0x4f1e60;})});}_0x121cef=_[_0x0a9e('0x3b')]({},_0x121cef,_0x28d814[_0x0a9e('0x46')]);return _0x30c491[_0x0a9e('0x53')](_0x121cef);}})[_0x0a9e('0x22')](function(_0xc8c264){if(_0xc8c264){_0xb83dfd=_0xc8c264[_0x0a9e('0x35')];if(!_0x28d814[_0x0a9e('0x30')][_0x0a9e('0x36')](_0x0a9e('0x55'))){_0x121cef[_0x0a9e('0x1a')]=qs[_0x0a9e('0x1a')](_0x28d814[_0x0a9e('0x30')][_0x0a9e('0x1a')]);_0x121cef[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x28d814[_0x0a9e('0x30')][_0x0a9e('0x19')]);}return _0x30c491['getIntervals'](_0x121cef);}})[_0x0a9e('0x22')](function(_0x295763){if(_0x295763){return _0x295763?{'count':_0xb83dfd,'rows':_0x295763}:null;}})[_0x0a9e('0x22')](respondWithResult(_0x4e67ab,null))['catch'](handleError(_0x4e67ab,null));};exports[_0x0a9e('0x56')]=function(_0x30944e,_0x4b341d,_0x83f0b2){return db[_0x0a9e('0x2a')][_0x0a9e('0x57')]({'where':{'id':_0x30944e[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x4b341d,null))['then'](function(_0x50cdce){if(_0x50cdce){return db['sequelize'][_0x0a9e('0x58')](function(_0x18bf5d){return db[_0x0a9e('0x2a')][_0x0a9e('0x21')]({'where':{'IntervalId':_0x30944e[_0x0a9e('0x44')]['id']},'transaction':_0x18bf5d})[_0x0a9e('0x22')](function(_0xeef20){var _0x1a0677=_['map'](_0x30944e[_0x0a9e('0x48')],function(_0xcbc8b2){delete _0xcbc8b2['id'];_0xcbc8b2[_0x0a9e('0x52')]=_0x30944e['params']['id'];return _0xcbc8b2;});return db[_0x0a9e('0x2a')]['bulkCreate'](_0x1a0677,{'transaction':_0x18bf5d});});})[_0x0a9e('0x22')](function(){return db[_0x0a9e('0x2a')]['findAll']({'where':{'IntervalId':_0x30944e[_0x0a9e('0x44')]['id']}});});}})[_0x0a9e('0x22')](respondWithResult(_0x4b341d,null))[_0x0a9e('0x42')](handleError(_0x4b341d,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 3c09350..b92f8f0 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 _0x6ed3=['rimraf','../../config/environment','./interval.attributes','exports','define','Interval','tools_intervals','rewrite','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1252bf,_0x53dd51){var _0x370be2=function(_0x39eaa3){while(--_0x39eaa3){_0x1252bf['push'](_0x1252bf['shift']());}};_0x370be2(++_0x53dd51);}(_0x6ed3,0x1d9));var _0x36ed=function(_0x457ef8,_0x1a19ae){_0x457ef8=_0x457ef8-0x0;var _0x596c56=_0x6ed3[_0x457ef8];return _0x596c56;};'use strict';var _=require(_0x36ed('0x0'));var util=require('util');var logger=require(_0x36ed('0x1'))(_0x36ed('0x2'));var moment=require(_0x36ed('0x3'));var BPromise=require(_0x36ed('0x4'));var rp=require(_0x36ed('0x5'));var fs=require('fs');var path=require(_0x36ed('0x6'));var rimraf=require(_0x36ed('0x7'));var config=require(_0x36ed('0x8'));var attributes=require(_0x36ed('0x9'));var extensions=require('../../components/extensions/rewrite');module[_0x36ed('0xa')]=function(_0x47dafa,_0x26a498){return _0x47dafa[_0x36ed('0xb')](_0x36ed('0xc'),attributes,{'tableName':_0x36ed('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x536574,_0x866ef6){extensions[_0x36ed('0xe')](_0x47dafa,_0x536574);},'afterBulkCreate':function(_0x241b6c,_0x2583b8,_0x5cdbb8){_0x5cdbb8();extensions['rewrite'](_0x47dafa,_0x241b6c[0x0]);},'afterUpdate':function(_0x242745,_0x20d250){extensions[_0x36ed('0xe')](_0x47dafa,_0x242745);},'afterDestroy':function(_0xd40e7a,_0x4187fe){extensions[_0x36ed('0xe')](_0x47dafa,_0xd40e7a);}}});}; \ No newline at end of file +var _0x6ff6=['moment','bluebird','request-promise','path','rimraf','../../components/extensions/rewrite','exports','define','Interval','tools_intervals','rewrite','lodash','util','api'];(function(_0x17dc33,_0x5bb571){var _0x1dbb33=function(_0x72a772){while(--_0x72a772){_0x17dc33['push'](_0x17dc33['shift']());}};_0x1dbb33(++_0x5bb571);}(_0x6ff6,0x115));var _0x66ff=function(_0x540e54,_0x5a40bf){_0x540e54=_0x540e54-0x0;var _0x43878d=_0x6ff6[_0x540e54];return _0x43878d;};'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('./interval.attributes');var extensions=require(_0x66ff('0x8'));module[_0x66ff('0x9')]=function(_0x33f9f5,_0x5d93c4){return _0x33f9f5[_0x66ff('0xa')](_0x66ff('0xb'),attributes,{'tableName':_0x66ff('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x243b7c,_0x4a0c8d){extensions['rewrite'](_0x33f9f5,_0x243b7c);},'afterBulkCreate':function(_0x44044a,_0x1c42aa,_0xe9374e){_0xe9374e();extensions[_0x66ff('0xd')](_0x33f9f5,_0x44044a[0x0]);},'afterUpdate':function(_0x1638e6,_0x3e44a7){extensions[_0x66ff('0xd')](_0x33f9f5,_0x1638e6);},'afterDestroy':function(_0x3c9fd6,_0x192bfb){extensions[_0x66ff('0xd')](_0x33f9f5,_0x3c9fd6);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index ab15ffa..cd7799d 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 _0xdd1a=['limit','map','include','model','ShowInterval','debug','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','info','Interval,\x20%s,\x20%s','request\x20sent','Interval,\x20%s,\x20%s,\x20%s','stringify','error','message','GetInterval','Interval','findAll','options','raw','where','attributes'];(function(_0x4d7e31,_0xa91bba){var _0x5c4e68=function(_0x41bef2){while(--_0x41bef2){_0x4d7e31['push'](_0x4d7e31['shift']());}};_0x5c4e68(++_0xa91bba);}(_0xdd1a,0xe7));var _0xadd1=function(_0x449845,_0x21a87b){_0x449845=_0x449845-0x0;var _0x3908b9=_0xdd1a[_0x449845];return _0x3908b9;};'use strict';var _=require(_0xadd1('0x0'));var util=require(_0xadd1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xadd1('0x2'));var fs=require('fs');var Redis=require(_0xadd1('0x3'));var db=require(_0xadd1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xadd1('0x5'))('rpc');var config=require(_0xadd1('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xadd1('0x7')][_0xadd1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xaca406,_0x2d6a7b,_0x256ade){return new BPromise(function(_0x3962fc,_0x4ca44e){return client[_0xadd1('0x9')](_0xaca406,_0x256ade)[_0xadd1('0xa')](function(_0x26b5bc){logger[_0xadd1('0xb')](_0xadd1('0xc'),_0x2d6a7b,_0xadd1('0xd'));logger['debug'](_0xadd1('0xe'),_0x2d6a7b,_0xadd1('0xd'),JSON[_0xadd1('0xf')](_0x26b5bc));if(_0x26b5bc[_0xadd1('0x10')]){if(_0x26b5bc[_0xadd1('0x10')]['code']===0x1f4){logger[_0xadd1('0x10')](_0xadd1('0xc'),_0x2d6a7b,_0x26b5bc['error'][_0xadd1('0x11')]);return _0x4ca44e(_0x26b5bc[_0xadd1('0x10')][_0xadd1('0x11')]);}logger['error'](_0xadd1('0xc'),_0x2d6a7b,_0x26b5bc[_0xadd1('0x10')][_0xadd1('0x11')]);return _0x3962fc(_0x26b5bc[_0xadd1('0x10')][_0xadd1('0x11')]);}else{logger[_0xadd1('0xb')]('Interval,\x20%s,\x20%s',_0x2d6a7b,_0xadd1('0xd'));_0x3962fc(_0x26b5bc['result'][_0xadd1('0x11')]);}})['catch'](function(_0x5219c6){logger[_0xadd1('0x10')](_0xadd1('0xc'),_0x2d6a7b,_0x5219c6);_0x4ca44e(_0x5219c6);});});}exports[_0xadd1('0x12')]=function(_0x3c028a){var _0x6d4a6b=this;return new Promise(function(_0xa73f95,_0x3d0327){return db[_0xadd1('0x13')][_0xadd1('0x14')]({'raw':_0x3c028a[_0xadd1('0x15')]?_0x3c028a[_0xadd1('0x15')][_0xadd1('0x16')]===undefined?!![]:![]:!![],'where':_0x3c028a[_0xadd1('0x15')]?_0x3c028a['options'][_0xadd1('0x17')]||null:null,'attributes':_0x3c028a['options']?_0x3c028a[_0xadd1('0x15')][_0xadd1('0x18')]||null:null,'limit':_0x3c028a[_0xadd1('0x15')]?_0x3c028a[_0xadd1('0x15')][_0xadd1('0x19')]||null:null,'include':_0x3c028a[_0xadd1('0x15')]?_0x3c028a['options']['include']?_[_0xadd1('0x1a')](_0x3c028a[_0xadd1('0x15')][_0xadd1('0x1b')],function(_0x296e12){return{'model':db[_0x296e12[_0xadd1('0x1c')]],'as':_0x296e12['as'],'attributes':_0x296e12[_0xadd1('0x18')],'include':_0x296e12[_0xadd1('0x1b')]?_[_0xadd1('0x1a')](_0x296e12['include'],function(_0x4d3b60){return{'model':db[_0x4d3b60['model']],'as':_0x4d3b60['as'],'attributes':_0x4d3b60[_0xadd1('0x18')],'include':_0x4d3b60[_0xadd1('0x1b')]?_['map'](_0x4d3b60[_0xadd1('0x1b')],function(_0x1e56f9){return{'model':db[_0x1e56f9[_0xadd1('0x1c')]],'as':_0x1e56f9['as'],'attributes':_0x1e56f9['attributes']};}):[]};}):[]};}):[]:[]})[_0xadd1('0xa')](function(_0x124b60){logger[_0xadd1('0xb')]('GetInterval',_0x3c028a);logger['debug'](_0xadd1('0x12'),_0x3c028a,JSON[_0xadd1('0xf')](_0x124b60));_0xa73f95(_0x124b60);})['catch'](function(_0x514fc5){logger[_0xadd1('0x10')](_0xadd1('0x12'),_0x514fc5['message'],_0x3c028a);_0x3d0327(_0x6d4a6b[_0xadd1('0x10')](0x1f4,_0x514fc5[_0xadd1('0x11')]));});});};exports[_0xadd1('0x1d')]=function(_0x26338a){var _0x4d8ecc=this;return new Promise(function(_0x5084f9,_0x3f8c43){return db['Interval']['find']({'raw':_0x26338a[_0xadd1('0x15')]?_0x26338a['options'][_0xadd1('0x16')]===undefined?!![]:![]:!![],'where':_0x26338a[_0xadd1('0x15')]?_0x26338a[_0xadd1('0x15')][_0xadd1('0x17')]||null:null,'attributes':_0x26338a[_0xadd1('0x15')]?_0x26338a[_0xadd1('0x15')]['attributes']||null:null,'include':_0x26338a[_0xadd1('0x15')]?_0x26338a[_0xadd1('0x15')]['include']?_['map'](_0x26338a['options'][_0xadd1('0x1b')],function(_0xe5d562){return{'model':db[_0xe5d562[_0xadd1('0x1c')]],'as':_0xe5d562['as'],'attributes':_0xe5d562[_0xadd1('0x18')],'include':_0xe5d562['include']?_[_0xadd1('0x1a')](_0xe5d562[_0xadd1('0x1b')],function(_0x25d872){return{'model':db[_0x25d872[_0xadd1('0x1c')]],'as':_0x25d872['as'],'attributes':_0x25d872[_0xadd1('0x18')],'include':_0x25d872[_0xadd1('0x1b')]?_[_0xadd1('0x1a')](_0x25d872[_0xadd1('0x1b')],function(_0x232f84){return{'model':db[_0x232f84[_0xadd1('0x1c')]],'as':_0x232f84['as'],'attributes':_0x232f84['attributes']};}):[]};}):[]};}):[]:[]})[_0xadd1('0xa')](function(_0x32a625){logger[_0xadd1('0xb')](_0xadd1('0x1d'),_0x26338a);logger[_0xadd1('0x1e')](_0xadd1('0x1d'),_0x26338a,JSON['stringify'](_0x32a625));_0x5084f9(_0x32a625);})[_0xadd1('0x1f')](function(_0xbf3a60){logger['error'](_0xadd1('0x1d'),_0xbf3a60['message'],_0x26338a);_0x3f8c43(_0x4d8ecc[_0xadd1('0x10')](0x1f4,_0xbf3a60[_0xadd1('0x11')]));});});}; \ No newline at end of file +var _0xa97d=['code','message','result','catch','GetInterval','Interval','options','raw','where','limit','map','include','attributes','model','ShowInterval','find','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','Interval,\x20%s,\x20%s','debug','Interval,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x3eb079,_0x4343fb){var _0x14a854=function(_0x2e39cc){while(--_0x2e39cc){_0x3eb079['push'](_0x3eb079['shift']());}};_0x14a854(++_0x4343fb);}(_0xa97d,0x17b));var _0xda97=function(_0x5c57e8,_0x35997a){_0x5c57e8=_0x5c57e8-0x0;var _0x4224f8=_0xa97d[_0x5c57e8];return _0x4224f8;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xda97('0x0'));var rs=require(_0xda97('0x1'));var fs=require('fs');var Redis=require(_0xda97('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xda97('0x3'));var logger=require(_0xda97('0x4'))(_0xda97('0x5'));var config=require('../../config/environment');var jayson=require(_0xda97('0x6'));var client=jayson[_0xda97('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32237a,_0x343639,_0xa426db){return new BPromise(function(_0x47d758,_0x14368a){return client[_0xda97('0x8')](_0x32237a,_0xa426db)[_0xda97('0x9')](function(_0x5eca6a){logger[_0xda97('0xa')](_0xda97('0xb'),_0x343639,'request\x20sent');logger[_0xda97('0xc')](_0xda97('0xd'),_0x343639,_0xda97('0xe'),JSON[_0xda97('0xf')](_0x5eca6a));if(_0x5eca6a[_0xda97('0x10')]){if(_0x5eca6a['error'][_0xda97('0x11')]===0x1f4){logger[_0xda97('0x10')](_0xda97('0xb'),_0x343639,_0x5eca6a[_0xda97('0x10')][_0xda97('0x12')]);return _0x14368a(_0x5eca6a[_0xda97('0x10')]['message']);}logger[_0xda97('0x10')](_0xda97('0xb'),_0x343639,_0x5eca6a[_0xda97('0x10')][_0xda97('0x12')]);return _0x47d758(_0x5eca6a[_0xda97('0x10')][_0xda97('0x12')]);}else{logger[_0xda97('0xa')](_0xda97('0xb'),_0x343639,_0xda97('0xe'));_0x47d758(_0x5eca6a[_0xda97('0x13')][_0xda97('0x12')]);}})[_0xda97('0x14')](function(_0x25e3eb){logger[_0xda97('0x10')]('Interval,\x20%s,\x20%s',_0x343639,_0x25e3eb);_0x14368a(_0x25e3eb);});});}exports[_0xda97('0x15')]=function(_0x4295a4){var _0x54dfc8=this;return new Promise(function(_0x47cd47,_0x58aae0){return db[_0xda97('0x16')]['findAll']({'raw':_0x4295a4[_0xda97('0x17')]?_0x4295a4['options'][_0xda97('0x18')]===undefined?!![]:![]:!![],'where':_0x4295a4[_0xda97('0x17')]?_0x4295a4[_0xda97('0x17')][_0xda97('0x19')]||null:null,'attributes':_0x4295a4[_0xda97('0x17')]?_0x4295a4[_0xda97('0x17')]['attributes']||null:null,'limit':_0x4295a4[_0xda97('0x17')]?_0x4295a4[_0xda97('0x17')][_0xda97('0x1a')]||null:null,'include':_0x4295a4[_0xda97('0x17')]?_0x4295a4[_0xda97('0x17')]['include']?_[_0xda97('0x1b')](_0x4295a4['options'][_0xda97('0x1c')],function(_0x2ff289){return{'model':db[_0x2ff289['model']],'as':_0x2ff289['as'],'attributes':_0x2ff289[_0xda97('0x1d')],'include':_0x2ff289[_0xda97('0x1c')]?_['map'](_0x2ff289[_0xda97('0x1c')],function(_0x29551c){return{'model':db[_0x29551c[_0xda97('0x1e')]],'as':_0x29551c['as'],'attributes':_0x29551c['attributes'],'include':_0x29551c[_0xda97('0x1c')]?_['map'](_0x29551c[_0xda97('0x1c')],function(_0x33c5e6){return{'model':db[_0x33c5e6[_0xda97('0x1e')]],'as':_0x33c5e6['as'],'attributes':_0x33c5e6[_0xda97('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xda97('0x9')](function(_0x260642){logger[_0xda97('0xa')](_0xda97('0x15'),_0x4295a4);logger['debug']('GetInterval',_0x4295a4,JSON[_0xda97('0xf')](_0x260642));_0x47cd47(_0x260642);})[_0xda97('0x14')](function(_0x3812e1){logger[_0xda97('0x10')](_0xda97('0x15'),_0x3812e1[_0xda97('0x12')],_0x4295a4);_0x58aae0(_0x54dfc8[_0xda97('0x10')](0x1f4,_0x3812e1[_0xda97('0x12')]));});});};exports[_0xda97('0x1f')]=function(_0x327351){var _0x534f55=this;return new Promise(function(_0x414de4,_0x73adb6){return db[_0xda97('0x16')][_0xda97('0x20')]({'raw':_0x327351['options']?_0x327351['options'][_0xda97('0x18')]===undefined?!![]:![]:!![],'where':_0x327351[_0xda97('0x17')]?_0x327351[_0xda97('0x17')][_0xda97('0x19')]||null:null,'attributes':_0x327351[_0xda97('0x17')]?_0x327351[_0xda97('0x17')][_0xda97('0x1d')]||null:null,'include':_0x327351['options']?_0x327351[_0xda97('0x17')][_0xda97('0x1c')]?_[_0xda97('0x1b')](_0x327351[_0xda97('0x17')]['include'],function(_0x459123){return{'model':db[_0x459123[_0xda97('0x1e')]],'as':_0x459123['as'],'attributes':_0x459123[_0xda97('0x1d')],'include':_0x459123[_0xda97('0x1c')]?_[_0xda97('0x1b')](_0x459123[_0xda97('0x1c')],function(_0x238be3){return{'model':db[_0x238be3['model']],'as':_0x238be3['as'],'attributes':_0x238be3[_0xda97('0x1d')],'include':_0x238be3['include']?_[_0xda97('0x1b')](_0x238be3[_0xda97('0x1c')],function(_0x1232ed){return{'model':db[_0x1232ed[_0xda97('0x1e')]],'as':_0x1232ed['as'],'attributes':_0x1232ed[_0xda97('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xda97('0x9')](function(_0x380592){logger[_0xda97('0xa')](_0xda97('0x1f'),_0x327351);logger[_0xda97('0xc')](_0xda97('0x1f'),_0x327351,JSON[_0xda97('0xf')](_0x380592));_0x414de4(_0x380592);})[_0xda97('0x14')](function(_0xd51860){logger['error'](_0xda97('0x1f'),_0xd51860['message'],_0x327351);_0x73adb6(_0x534f55[_0xda97('0x10')](0x1f4,_0xd51860[_0xda97('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 6592818..f49e718 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 _0x5e69=['Router','../../components/auth/service','./jira.controller','post','isAuthenticated','send','exports','express'];(function(_0x420660,_0x1e4eb4){var _0x16dd87=function(_0x41018c){while(--_0x41018c){_0x420660['push'](_0x420660['shift']());}};_0x16dd87(++_0x1e4eb4);}(_0x5e69,0x147));var _0x95e6=function(_0xb60ae4,_0x48b458){_0xb60ae4=_0xb60ae4-0x0;var _0x53d530=_0x5e69[_0xb60ae4];return _0x53d530;};'use strict';var express=require(_0x95e6('0x0'));var router=express[_0x95e6('0x1')]();var auth=require(_0x95e6('0x2'));var controller=require(_0x95e6('0x3'));router[_0x95e6('0x4')]('/',auth[_0x95e6('0x5')](),controller[_0x95e6('0x6')]);module[_0x95e6('0x7')]=router; \ No newline at end of file +var _0x605b=['isAuthenticated','exports','express','../../components/auth/service','./jira.controller','post'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x605b,0x134));var _0xb605=function(_0xe85a8b,_0x5e3567){_0xe85a8b=_0xe85a8b-0x0;var _0x145386=_0x605b[_0xe85a8b];return _0x145386;};'use strict';var express=require(_0xb605('0x0'));var router=express['Router']();var auth=require(_0xb605('0x1'));var controller=require(_0xb605('0x2'));router[_0xb605('0x3')]('/',auth[_0xb605('0x4')](),controller['send']);module[_0xb605('0x5')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index fafc4b3..4c8c9b6 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 _0x336c=['POST','application/json','Basic\x20','toString','request','setEncoding','utf8','end','statusCode','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','headers','x-forwarded-for','connection','remoteAddress','socket','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','Report','\x20from\x20','stringify','issuetype','Bug','fields','customfield_11500','oldToken','customfield_11502','customfield_11503','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue'];(function(_0x43b984,_0x342871){var _0x2eb22d=function(_0x36d6f1){while(--_0x36d6f1){_0x43b984['push'](_0x43b984['shift']());}};_0x2eb22d(++_0x342871);}(_0x336c,0x65));var _0xc336=function(_0x307763,_0x3f6491){_0x307763=_0x307763-0x0;var _0x201b82=_0x336c[_0x307763];return _0x201b82;};'use strict';var BPromise=require('bluebird');var https=require(_0xc336('0x0'));var logger=require(_0xc336('0x1'))(_0xc336('0x2'));var USERNAME=_0xc336('0x3');var PASSWORD=_0xc336('0x4');function openIssue(_0x1f4717,_0x3fab70){var _0x1a8e81={'fields':{'project':{'key':_0x1f4717[_0xc336('0x5')]||_0xc336('0x6')},'summary':(_0x1f4717['summary']||_0xc336('0x7'))+_0xc336('0x8')+_0x1f4717['ip'],'description':_0x1f4717['description']||JSON[_0xc336('0x9')](_0x1f4717),'issuetype':{'name':_0x1f4717[_0xc336('0xa')]||_0xc336('0xb')}}};_0x1a8e81[_0xc336('0xc')][_0xc336('0xd')]=_0x1f4717['email'];_0x1a8e81[_0xc336('0xc')]['customfield_11501']=_0x1f4717[_0xc336('0xe')];_0x1a8e81[_0xc336('0xc')][_0xc336('0xf')]=_0x1f4717['newToken'];_0x1a8e81['fields'][_0xc336('0x10')]=_0x1f4717['name'];_0x1a8e81[_0xc336('0xc')][_0xc336('0x11')]=_0x1f4717[_0xc336('0x12')];_0x1a8e81[_0xc336('0xc')][_0xc336('0x13')]=_0x1f4717['ip'];var _0x5495ac={'host':_0xc336('0x14'),'port':0x1bb,'path':_0xc336('0x15'),'method':_0xc336('0x16'),'timeout':0x4e20,'headers':{'Content-Type':_0xc336('0x17'),'Authorization':_0xc336('0x18')+new Buffer(USERNAME+':'+PASSWORD)[_0xc336('0x19')]('base64')}};var _0x29cf41=JSON[_0xc336('0x9')](_0x1a8e81);var _0x551893=https[_0xc336('0x1a')](_0x5495ac,function(_0x7c71b8){_0x7c71b8[_0xc336('0x1b')](_0xc336('0x1c'));var _0x4a5a23='';_0x7c71b8['on']('data',function(_0x1f9965){_0x4a5a23+=_0x1f9965;});_0x7c71b8['on'](_0xc336('0x1d'),function(){if(_0x3fab70){return _0x3fab70['status'](_0x7c71b8[_0xc336('0x1e')])[_0xc336('0x1f')](JSON['parse'](_0x4a5a23));}});});_0x551893['on']('error',function(_0x1c2ab6){if(_0x3fab70){return _0x3fab70['status'](0x1f4)['json']({'errors':[{'message':_0xc336('0x20'),'type':_0xc336('0x21')}]});}});_0x551893[_0xc336('0x22')](_0x29cf41);_0x551893[_0xc336('0x1d')]();}exports[_0xc336('0x23')]=openIssue;exports['send']=function(_0x37813d,_0xa02406){_0x37813d['body']['ip']=_0x37813d[_0xc336('0x24')][_0xc336('0x25')]||_0x37813d[_0xc336('0x26')][_0xc336('0x27')]||_0x37813d['socket']['remoteAddress']||_0x37813d[_0xc336('0x26')][_0xc336('0x28')]['remoteAddress'];return openIssue(_0x37813d['body'],_0xa02406);}; \ No newline at end of file +var _0x408c=['fields','customfield_11500','email','customfield_11501','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','request','end','status','parse','error','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','send','headers','x-forwarded-for','connection','remoteAddress','socket','body','https','support','3eAmWpBVP0','key','MOTGUI','Report','stringify','issuetype','Bug'];(function(_0x2732fb,_0x27f148){var _0x46d956=function(_0x2063ea){while(--_0x2063ea){_0x2732fb['push'](_0x2732fb['shift']());}};_0x46d956(++_0x27f148);}(_0x408c,0x1af));var _0xc408=function(_0x20e79f,_0x1633b6){_0x20e79f=_0x20e79f-0x0;var _0x1a846b=_0x408c[_0x20e79f];return _0x1a846b;};'use strict';var BPromise=require('bluebird');var https=require(_0xc408('0x0'));var logger=require('../../config/logger')('api');var USERNAME=_0xc408('0x1');var PASSWORD=_0xc408('0x2');function openIssue(_0xd11dea,_0x5e5165){var _0x51f402={'fields':{'project':{'key':_0xd11dea[_0xc408('0x3')]||_0xc408('0x4')},'summary':(_0xd11dea['summary']||_0xc408('0x5'))+'\x20from\x20'+_0xd11dea['ip'],'description':_0xd11dea['description']||JSON[_0xc408('0x6')](_0xd11dea),'issuetype':{'name':_0xd11dea[_0xc408('0x7')]||_0xc408('0x8')}}};_0x51f402[_0xc408('0x9')][_0xc408('0xa')]=_0xd11dea[_0xc408('0xb')];_0x51f402[_0xc408('0x9')][_0xc408('0xc')]=_0xd11dea['oldToken'];_0x51f402[_0xc408('0x9')]['customfield_11502']=_0xd11dea[_0xc408('0xd')];_0x51f402[_0xc408('0x9')][_0xc408('0xe')]=_0xd11dea[_0xc408('0xf')];_0x51f402['fields'][_0xc408('0x10')]=_0xd11dea[_0xc408('0x11')];_0x51f402[_0xc408('0x9')][_0xc408('0x12')]=_0xd11dea['ip'];var _0x121c5b={'host':'track.xcallymotion.com','port':0x1bb,'path':_0xc408('0x13'),'method':_0xc408('0x14'),'timeout':0x4e20,'headers':{'Content-Type':_0xc408('0x15'),'Authorization':_0xc408('0x16')+new Buffer(USERNAME+':'+PASSWORD)[_0xc408('0x17')](_0xc408('0x18'))}};var _0x279356=JSON['stringify'](_0x51f402);var _0x56ed90=https[_0xc408('0x19')](_0x121c5b,function(_0xf09270){_0xf09270['setEncoding']('utf8');var _0x1c680c='';_0xf09270['on']('data',function(_0x269ca9){_0x1c680c+=_0x269ca9;});_0xf09270['on'](_0xc408('0x1a'),function(){if(_0x5e5165){return _0x5e5165[_0xc408('0x1b')](_0xf09270['statusCode'])['json'](JSON[_0xc408('0x1c')](_0x1c680c));}});});_0x56ed90['on'](_0xc408('0x1d'),function(_0x396882){if(_0x5e5165){return _0x5e5165[_0xc408('0x1b')](0x1f4)[_0xc408('0x1e')]({'errors':[{'message':_0xc408('0x1f'),'type':_0xc408('0x20')}]});}});_0x56ed90['write'](_0x279356);_0x56ed90[_0xc408('0x1a')]();}exports['openIssue']=openIssue;exports[_0xc408('0x21')]=function(_0x48724d,_0x51a2c1){_0x48724d['body']['ip']=_0x48724d[_0xc408('0x22')][_0xc408('0x23')]||_0x48724d[_0xc408('0x24')][_0xc408('0x25')]||_0x48724d[_0xc408('0x26')][_0xc408('0x25')]||_0x48724d['connection']['socket'][_0xc408('0x25')];return openIssue(_0x48724d[_0xc408('0x27')],_0x51a2c1);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 9b50360..4eb763e 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 _0x2df4=['destroy','exports','multer','util','connect-timeout','Router','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated','/:id','show','post','update','delete'];(function(_0x5a9a1a,_0x4f2946){var _0x43cf5a=function(_0x57520f){while(--_0x57520f){_0x5a9a1a['push'](_0x5a9a1a['shift']());}};_0x43cf5a(++_0x4f2946);}(_0x2df4,0xe2));var _0x42df=function(_0x23e5fd,_0x2c6da6){_0x23e5fd=_0x23e5fd-0x0;var _0xab592b=_0x2df4[_0x23e5fd];return _0xab592b;};'use strict';var multer=require(_0x42df('0x0'));var util=require(_0x42df('0x1'));var path=require('path');var timeout=require(_0x42df('0x2'));var express=require('express');var router=express[_0x42df('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x42df('0x4'));router[_0x42df('0x5')]('/',auth['isAuthenticated'](),controller[_0x42df('0x6')]);router[_0x42df('0x5')](_0x42df('0x7'),auth[_0x42df('0x8')](),controller['describe']);router['get'](_0x42df('0x9'),auth['isAuthenticated'](),controller[_0x42df('0xa')]);router[_0x42df('0xb')]('/',auth[_0x42df('0x8')](),controller['create']);router['put']('/:id',auth[_0x42df('0x8')](),controller[_0x42df('0xc')]);router[_0x42df('0xd')](_0x42df('0x9'),auth['isAuthenticated'](),controller[_0x42df('0xe')]);module[_0x42df('0xf')]=router; \ No newline at end of file +var _0x6062=['put','update','delete','destroy','exports','multer','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','create'];(function(_0x5e320e,_0x26107a){var _0x158f88=function(_0xe49624){while(--_0xe49624){_0x5e320e['push'](_0x5e320e['shift']());}};_0x158f88(++_0x26107a);}(_0x6062,0x145));var _0x2606=function(_0x414d4c,_0x35d218){_0x414d4c=_0x414d4c-0x0;var _0x5091bc=_0x6062[_0x414d4c];return _0x5091bc;};'use strict';var multer=require(_0x2606('0x0'));var util=require('util');var path=require(_0x2606('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2606('0x2')]();var auth=require(_0x2606('0x3'));var interaction=require(_0x2606('0x4'));var config=require(_0x2606('0x5'));var controller=require(_0x2606('0x6'));router[_0x2606('0x7')]('/',auth['isAuthenticated'](),controller[_0x2606('0x8')]);router[_0x2606('0x7')](_0x2606('0x9'),auth[_0x2606('0xa')](),controller[_0x2606('0xb')]);router[_0x2606('0x7')](_0x2606('0xc'),auth[_0x2606('0xa')](),controller[_0x2606('0xd')]);router['post']('/',auth[_0x2606('0xa')](),controller[_0x2606('0xe')]);router[_0x2606('0xf')](_0x2606('0xc'),auth[_0x2606('0xa')](),controller[_0x2606('0x10')]);router[_0x2606('0x11')](_0x2606('0xc'),auth[_0x2606('0xa')](),controller[_0x2606('0x12')]);module[_0x2606('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 748fb39..d10427f 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 _0x109c=['sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x109c,0x184));var _0xc109=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x109c[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0xc109('0x0'));module['exports']={'question':{'type':Sequelize[_0xc109('0x1')]},'answer':{'type':Sequelize['TEXT']('long')},'membername':{'type':Sequelize[_0xc109('0x1')]},'projectname':{'type':Sequelize[_0xc109('0x1')]},'queue':{'type':Sequelize[_0xc109('0x1')]},'uniqueid':{'type':Sequelize[_0xc109('0x1')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xc109('0x1')]},'questionId':{'type':Sequelize[_0xc109('0x1')]}}; \ No newline at end of file +var _0x6e64=['long','sequelize','exports','STRING','TEXT'];(function(_0x1eda75,_0x391690){var _0x4ce7fc=function(_0x24e979){while(--_0x24e979){_0x1eda75['push'](_0x1eda75['shift']());}};_0x4ce7fc(++_0x391690);}(_0x6e64,0x100));var _0x46e6=function(_0x5d4e27,_0x1cc69b){_0x5d4e27=_0x5d4e27-0x0;var _0x13205e=_0x6e64[_0x5d4e27];return _0x13205e;};'use strict';var Sequelize=require(_0x46e6('0x0'));module[_0x46e6('0x1')]={'question':{'type':Sequelize[_0x46e6('0x2')]},'answer':{'type':Sequelize[_0x46e6('0x3')](_0x46e6('0x4'))},'membername':{'type':Sequelize[_0x46e6('0x2')]},'projectname':{'type':Sequelize[_0x46e6('0x2')]},'queue':{'type':Sequelize[_0x46e6('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x46e6('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'questionId':{'type':Sequelize[_0x46e6('0x2')]}}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index 6f5439d..081beaa 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 _0x842e=['mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','JscriptyAnswerReport','findAll','rows','params','keys','includeAll','options','find','catch','create','body','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x361078,_0x283dcb){var _0x22d9e8=function(_0x140b4b){while(--_0x140b4b){_0x361078['push'](_0x361078['shift']());}};_0x22d9e8(++_0x283dcb);}(_0x842e,0x1c1));var _0xe842=function(_0x54ea7a,_0x19df9b){_0x54ea7a=_0x54ea7a-0x0;var _0x65a10d=_0x842e[_0x54ea7a];return _0x65a10d;};'use strict';var pdf=require(_0xe842('0x0'));var emlformat=require(_0xe842('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xe842('0x2'));var jsonpatch=require(_0xe842('0x3'));var rp=require(_0xe842('0x4'));var moment=require(_0xe842('0x5'));var BPromise=require(_0xe842('0x6'));var Mustache=require(_0xe842('0x7'));var util=require(_0xe842('0x8'));var path=require(_0xe842('0x9'));var sox=require(_0xe842('0xa'));var csv=require(_0xe842('0xb'));var ejs=require(_0xe842('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe842('0xd'));var crypto=require(_0xe842('0xe'));var jsforce=require(_0xe842('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xe842('0xb'));var querystring=require('querystring');var Papa=require(_0xe842('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe842('0x11'));var hardwareService=require(_0xe842('0x12'));var logger=require(_0xe842('0x13'))(_0xe842('0x14'));var utils=require(_0xe842('0x15'));var config=require(_0xe842('0x16'));var db=require(_0xe842('0x17'))['db'];function respondWithStatusCode(_0x30a5f2,_0x555c51){_0x555c51=_0x555c51||0xcc;return function(_0x516227){if(_0x516227){return _0x30a5f2[_0xe842('0x18')](_0x555c51);}return _0x30a5f2[_0xe842('0x19')](_0x555c51)[_0xe842('0x1a')]();};}function respondWithResult(_0x4cd714,_0x3a0297){_0x3a0297=_0x3a0297||0xc8;return function(_0x6b7990){if(_0x6b7990){return _0x4cd714[_0xe842('0x19')](_0x3a0297)['json'](_0x6b7990);}};}function respondWithFilteredResult(_0x151f3a,_0x17508c){return function(_0x254837){if(_0x254837){var _0x1f5357=_0x254837[_0xe842('0x1b')],_0x21acbb=_0x17508c[_0xe842('0x1c')],_0x3c0525=_0x17508c[_0xe842('0x1c')]+_0x17508c[_0xe842('0x1d')],_0x3622fb;if(_0x3c0525>=_0x1f5357){_0x3c0525=_0x1f5357;_0x3622fb=0xc8;}else{_0x3622fb=0xce;}_0x151f3a[_0xe842('0x19')](_0x3622fb);return _0x151f3a[_0xe842('0x1e')](_0xe842('0x1f'),_0x21acbb+'-'+_0x3c0525+'/'+_0x1f5357)[_0xe842('0x20')](_0x254837);}return null;};}function patchUpdates(_0x3dd6db){return function(_0x31c1e1){try{jsonpatch[_0xe842('0x21')](_0x31c1e1,_0x3dd6db,!![]);}catch(_0x1ab904){return BPromise[_0xe842('0x22')](_0x1ab904);}return _0x31c1e1['save']();};}function saveUpdates(_0x45e16e,_0x2ca904){return function(_0x3ce31e){if(_0x3ce31e){return _0x3ce31e[_0xe842('0x23')](_0x45e16e)[_0xe842('0x24')](function(_0x32409a){return _0x32409a;});}return null;};}function removeEntity(_0xb30187,_0xaa698b){return function(_0x41aa3a){if(_0x41aa3a){return _0x41aa3a[_0xe842('0x25')]()['then'](function(){_0xb30187[_0xe842('0x19')](0xcc)[_0xe842('0x1a')]();});}};}function handleEntityNotFound(_0x2921c8,_0x5cdee3){return function(_0x27a56c){if(!_0x27a56c){_0x2921c8['sendStatus'](0x194);}return _0x27a56c;};}function handleError(_0x17a7cf,_0xdea9d8){_0xdea9d8=_0xdea9d8||0x1f4;return function(_0x226488){logger[_0xe842('0x26')](_0x226488[_0xe842('0x27')]);if(_0x226488[_0xe842('0x28')]){delete _0x226488[_0xe842('0x28')];}_0x17a7cf[_0xe842('0x19')](_0xdea9d8)[_0xe842('0x29')](_0x226488);};}exports[_0xe842('0x2a')]=function(_0x1d4d1d,_0x50dd36){var _0x3d9b9c={},_0x81b68a={},_0x1ec646={'count':0x0,'rows':[]};var _0x8a003b=_[_0xe842('0x2b')](db['JscriptyAnswerReport'][_0xe842('0x2c')],function(_0x379aa4){return{'name':_0x379aa4[_0xe842('0x2d')],'type':_0x379aa4['type'][_0xe842('0x2e')]};});_0x81b68a['model']=_['map'](_0x8a003b,'name');_0x81b68a[_0xe842('0x2f')]=_['keys'](_0x1d4d1d['query']);_0x81b68a['filters']=_[_0xe842('0x30')](_0x81b68a[_0xe842('0x31')],_0x81b68a[_0xe842('0x2f')]);_0x3d9b9c[_0xe842('0x32')]=_['intersection'](_0x81b68a[_0xe842('0x31')],qs[_0xe842('0x33')](_0x1d4d1d[_0xe842('0x2f')][_0xe842('0x33')]));_0x3d9b9c[_0xe842('0x32')]=_0x3d9b9c[_0xe842('0x32')][_0xe842('0x34')]?_0x3d9b9c['attributes']:_0x81b68a['model'];if(!_0x1d4d1d[_0xe842('0x2f')][_0xe842('0x35')](_0xe842('0x36'))){_0x3d9b9c['limit']=qs[_0xe842('0x1d')](_0x1d4d1d[_0xe842('0x2f')][_0xe842('0x1d')]);_0x3d9b9c['offset']=qs[_0xe842('0x1c')](_0x1d4d1d[_0xe842('0x2f')]['offset']);}_0x3d9b9c[_0xe842('0x37')]=qs[_0xe842('0x38')](_0x1d4d1d['query']['sort']);_0x3d9b9c[_0xe842('0x39')]=qs[_0xe842('0x3a')](_[_0xe842('0x3b')](_0x1d4d1d[_0xe842('0x2f')],_0x81b68a['filters']));if(_0x1d4d1d['query'][_0xe842('0x3c')]){_0x3d9b9c[_0xe842('0x39')]=_[_0xe842('0x3d')](_0x3d9b9c['where'],{'$or':_[_0xe842('0x2b')](_0x8a003b,function(_0x4eb5df){if(_0x4eb5df[_0xe842('0x3e')]!==_0xe842('0x3f')){var _0x12476b={};_0x12476b[_0x4eb5df[_0xe842('0x28')]]={'$like':'%'+_0x1d4d1d[_0xe842('0x2f')][_0xe842('0x3c')]+'%'};return _0x12476b;}})});}_0x3d9b9c=_[_0xe842('0x3d')]({},_0x3d9b9c,_0x1d4d1d['options']);var _0x2eb24b={'where':_0x3d9b9c[_0xe842('0x39')]};return db[_0xe842('0x40')]['count'](_0x2eb24b)[_0xe842('0x24')](function(_0xe8945){_0x1ec646['count']=_0xe8945;if(_0x1d4d1d[_0xe842('0x2f')]['includeAll']){_0x3d9b9c['include']=[{'all':!![]}];}return db[_0xe842('0x40')][_0xe842('0x41')](_0x3d9b9c);})[_0xe842('0x24')](function(_0x5466e9){_0x1ec646[_0xe842('0x42')]=_0x5466e9;return _0x1ec646;})['then'](respondWithFilteredResult(_0x50dd36,_0x3d9b9c))['catch'](handleError(_0x50dd36,null));};exports['show']=function(_0xac3de7,_0x271add){var _0x4d1980={'raw':!![],'where':{'id':_0xac3de7[_0xe842('0x43')]['id']}},_0xdb102={};_0xdb102[_0xe842('0x31')]=_['keys'](db[_0xe842('0x40')][_0xe842('0x2c')]);_0xdb102[_0xe842('0x2f')]=_[_0xe842('0x44')](_0xac3de7[_0xe842('0x2f')]);_0xdb102['filters']=_[_0xe842('0x30')](_0xdb102[_0xe842('0x31')],_0xdb102[_0xe842('0x2f')]);_0x4d1980[_0xe842('0x32')]=_[_0xe842('0x30')](_0xdb102['model'],qs[_0xe842('0x33')](_0xac3de7[_0xe842('0x2f')][_0xe842('0x33')]));_0x4d1980[_0xe842('0x32')]=_0x4d1980['attributes'][_0xe842('0x34')]?_0x4d1980[_0xe842('0x32')]:_0xdb102['model'];if(_0xac3de7[_0xe842('0x2f')][_0xe842('0x45')]){_0x4d1980['include']=[{'all':!![]}];}_0x4d1980=_[_0xe842('0x3d')]({},_0x4d1980,_0xac3de7[_0xe842('0x46')]);return db['JscriptyAnswerReport'][_0xe842('0x47')](_0x4d1980)[_0xe842('0x24')](handleEntityNotFound(_0x271add,null))['then'](respondWithResult(_0x271add,null))[_0xe842('0x48')](handleError(_0x271add,null));};exports[_0xe842('0x49')]=function(_0x2b4d06,_0x470208){return db['JscriptyAnswerReport'][_0xe842('0x49')](_0x2b4d06[_0xe842('0x4a')],{})[_0xe842('0x24')](respondWithResult(_0x470208,0xc9))['catch'](handleError(_0x470208,null));};exports[_0xe842('0x23')]=function(_0x28424a,_0x175f85){if(_0x28424a[_0xe842('0x4a')]['id']){delete _0x28424a[_0xe842('0x4a')]['id'];}return db['JscriptyAnswerReport'][_0xe842('0x47')]({'where':{'id':_0x28424a['params']['id']}})[_0xe842('0x24')](handleEntityNotFound(_0x175f85,null))[_0xe842('0x24')](saveUpdates(_0x28424a['body'],null))[_0xe842('0x24')](respondWithResult(_0x175f85,null))[_0xe842('0x48')](handleError(_0x175f85,null));};exports[_0xe842('0x25')]=function(_0x28d780,_0x32d2bd){return db[_0xe842('0x40')][_0xe842('0x47')]({'where':{'id':_0x28d780[_0xe842('0x43')]['id']}})[_0xe842('0x24')](handleEntityNotFound(_0x32d2bd,null))[_0xe842('0x24')](removeEntity(_0x32d2bd,null))['catch'](handleError(_0x32d2bd,null));};exports[_0xe842('0x4b')]=function(_0x44a2e7,_0x56f4f5){return db[_0xe842('0x40')][_0xe842('0x4b')]()[_0xe842('0x24')](respondWithResult(_0x56f4f5,null))[_0xe842('0x48')](handleError(_0x56f4f5,null));}; \ No newline at end of file +var _0x4fdd=['destroy','error','stack','name','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','options','find','create','body','params','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','end','status','count','offset','set','Content-Range','apply','save','update','then'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x4fdd,0x17f));var _0xd4fd=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x4fdd[_0x2c91e9];return _0x13f0ff;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd4fd('0x0'));var rimraf=require(_0xd4fd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd4fd('0x2'));var moment=require(_0xd4fd('0x3'));var BPromise=require(_0xd4fd('0x4'));var Mustache=require(_0xd4fd('0x5'));var util=require(_0xd4fd('0x6'));var path=require(_0xd4fd('0x7'));var sox=require(_0xd4fd('0x8'));var csv=require(_0xd4fd('0x9'));var ejs=require(_0xd4fd('0xa'));var fs=require('fs');var _=require(_0xd4fd('0xb'));var squel=require(_0xd4fd('0xc'));var crypto=require(_0xd4fd('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xd4fd('0xe'));var toCsv=require(_0xd4fd('0x9'));var querystring=require(_0xd4fd('0xf'));var Papa=require(_0xd4fd('0x10'));var Redis=require('ioredis');var authService=require(_0xd4fd('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd4fd('0x12'));var hardwareService=require(_0xd4fd('0x13'));var logger=require(_0xd4fd('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x503011,_0x38b338){_0x38b338=_0x38b338||0xcc;return function(_0x3d52f1){if(_0x3d52f1){return _0x503011['sendStatus'](_0x38b338);}return _0x503011['status'](_0x38b338)[_0xd4fd('0x15')]();};}function respondWithResult(_0x199a3b,_0x4e0fbb){_0x4e0fbb=_0x4e0fbb||0xc8;return function(_0x1e50fa){if(_0x1e50fa){return _0x199a3b[_0xd4fd('0x16')](_0x4e0fbb)['json'](_0x1e50fa);}};}function respondWithFilteredResult(_0x33b200,_0x27e001){return function(_0x26a5d9){if(_0x26a5d9){var _0x1511f0=_0x26a5d9[_0xd4fd('0x17')],_0x55a445=_0x27e001[_0xd4fd('0x18')],_0x3bb010=_0x27e001[_0xd4fd('0x18')]+_0x27e001['limit'],_0x379bc0;if(_0x3bb010>=_0x1511f0){_0x3bb010=_0x1511f0;_0x379bc0=0xc8;}else{_0x379bc0=0xce;}_0x33b200['status'](_0x379bc0);return _0x33b200[_0xd4fd('0x19')](_0xd4fd('0x1a'),_0x55a445+'-'+_0x3bb010+'/'+_0x1511f0)['json'](_0x26a5d9);}return null;};}function patchUpdates(_0x2df09b){return function(_0xe702f){try{jsonpatch[_0xd4fd('0x1b')](_0xe702f,_0x2df09b,!![]);}catch(_0x5687bf){return BPromise['reject'](_0x5687bf);}return _0xe702f[_0xd4fd('0x1c')]();};}function saveUpdates(_0x123a6a,_0x53ee2e){return function(_0xbc15ee){if(_0xbc15ee){return _0xbc15ee[_0xd4fd('0x1d')](_0x123a6a)[_0xd4fd('0x1e')](function(_0x3a2772){return _0x3a2772;});}return null;};}function removeEntity(_0x2ec976,_0x164fae){return function(_0x1cf8ee){if(_0x1cf8ee){return _0x1cf8ee[_0xd4fd('0x1f')]()['then'](function(){_0x2ec976[_0xd4fd('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x397ffa,_0x30e77d){return function(_0x124dd0){if(!_0x124dd0){_0x397ffa['sendStatus'](0x194);}return _0x124dd0;};}function handleError(_0x38e925,_0x115a24){_0x115a24=_0x115a24||0x1f4;return function(_0x372048){logger[_0xd4fd('0x20')](_0x372048[_0xd4fd('0x21')]);if(_0x372048[_0xd4fd('0x22')]){delete _0x372048[_0xd4fd('0x22')];}_0x38e925[_0xd4fd('0x16')](_0x115a24)['send'](_0x372048);};}exports['index']=function(_0x268d09,_0x411b64){var _0x389f07={},_0x1cf573={},_0x1d34c6={'count':0x0,'rows':[]};var _0x1fdebf=_[_0xd4fd('0x23')](db[_0xd4fd('0x24')][_0xd4fd('0x25')],function(_0x36a563){return{'name':_0x36a563[_0xd4fd('0x26')],'type':_0x36a563[_0xd4fd('0x27')][_0xd4fd('0x28')]};});_0x1cf573['model']=_[_0xd4fd('0x23')](_0x1fdebf,_0xd4fd('0x22'));_0x1cf573['query']=_[_0xd4fd('0x29')](_0x268d09[_0xd4fd('0x2a')]);_0x1cf573[_0xd4fd('0x2b')]=_[_0xd4fd('0x2c')](_0x1cf573[_0xd4fd('0x2d')],_0x1cf573[_0xd4fd('0x2a')]);_0x389f07[_0xd4fd('0x2e')]=_[_0xd4fd('0x2c')](_0x1cf573[_0xd4fd('0x2d')],qs[_0xd4fd('0x2f')](_0x268d09['query'][_0xd4fd('0x2f')]));_0x389f07[_0xd4fd('0x2e')]=_0x389f07[_0xd4fd('0x2e')][_0xd4fd('0x30')]?_0x389f07[_0xd4fd('0x2e')]:_0x1cf573[_0xd4fd('0x2d')];if(!_0x268d09[_0xd4fd('0x2a')][_0xd4fd('0x31')]('nolimit')){_0x389f07[_0xd4fd('0x32')]=qs['limit'](_0x268d09[_0xd4fd('0x2a')]['limit']);_0x389f07[_0xd4fd('0x18')]=qs['offset'](_0x268d09[_0xd4fd('0x2a')][_0xd4fd('0x18')]);}_0x389f07['order']=qs[_0xd4fd('0x33')](_0x268d09['query'][_0xd4fd('0x33')]);_0x389f07[_0xd4fd('0x34')]=qs['filters'](_[_0xd4fd('0x35')](_0x268d09[_0xd4fd('0x2a')],_0x1cf573['filters']));if(_0x268d09[_0xd4fd('0x2a')][_0xd4fd('0x36')]){_0x389f07[_0xd4fd('0x34')]=_[_0xd4fd('0x37')](_0x389f07[_0xd4fd('0x34')],{'$or':_[_0xd4fd('0x23')](_0x1fdebf,function(_0x597aef){if(_0x597aef[_0xd4fd('0x27')]!==_0xd4fd('0x38')){var _0x5a3bc2={};_0x5a3bc2[_0x597aef[_0xd4fd('0x22')]]={'$like':'%'+_0x268d09[_0xd4fd('0x2a')]['filter']+'%'};return _0x5a3bc2;}})});}_0x389f07=_[_0xd4fd('0x37')]({},_0x389f07,_0x268d09['options']);var _0x154de9={'where':_0x389f07[_0xd4fd('0x34')]};return db[_0xd4fd('0x24')][_0xd4fd('0x17')](_0x154de9)['then'](function(_0x238ad3){_0x1d34c6[_0xd4fd('0x17')]=_0x238ad3;if(_0x268d09[_0xd4fd('0x2a')][_0xd4fd('0x39')]){_0x389f07[_0xd4fd('0x3a')]=[{'all':!![]}];}return db[_0xd4fd('0x24')][_0xd4fd('0x3b')](_0x389f07);})[_0xd4fd('0x1e')](function(_0x1c45ac){_0x1d34c6[_0xd4fd('0x3c')]=_0x1c45ac;return _0x1d34c6;})[_0xd4fd('0x1e')](respondWithFilteredResult(_0x411b64,_0x389f07))[_0xd4fd('0x3d')](handleError(_0x411b64,null));};exports[_0xd4fd('0x3e')]=function(_0x3c5376,_0x25327d){var _0x3d22c1={'raw':!![],'where':{'id':_0x3c5376['params']['id']}},_0x5db64d={};_0x5db64d[_0xd4fd('0x2d')]=_['keys'](db[_0xd4fd('0x24')][_0xd4fd('0x25')]);_0x5db64d[_0xd4fd('0x2a')]=_[_0xd4fd('0x29')](_0x3c5376[_0xd4fd('0x2a')]);_0x5db64d[_0xd4fd('0x2b')]=_[_0xd4fd('0x2c')](_0x5db64d['model'],_0x5db64d[_0xd4fd('0x2a')]);_0x3d22c1[_0xd4fd('0x2e')]=_[_0xd4fd('0x2c')](_0x5db64d['model'],qs[_0xd4fd('0x2f')](_0x3c5376['query']['fields']));_0x3d22c1[_0xd4fd('0x2e')]=_0x3d22c1[_0xd4fd('0x2e')][_0xd4fd('0x30')]?_0x3d22c1[_0xd4fd('0x2e')]:_0x5db64d['model'];if(_0x3c5376[_0xd4fd('0x2a')]['includeAll']){_0x3d22c1[_0xd4fd('0x3a')]=[{'all':!![]}];}_0x3d22c1=_[_0xd4fd('0x37')]({},_0x3d22c1,_0x3c5376[_0xd4fd('0x3f')]);return db[_0xd4fd('0x24')][_0xd4fd('0x40')](_0x3d22c1)[_0xd4fd('0x1e')](handleEntityNotFound(_0x25327d,null))['then'](respondWithResult(_0x25327d,null))[_0xd4fd('0x3d')](handleError(_0x25327d,null));};exports[_0xd4fd('0x41')]=function(_0x4c79f8,_0x4576e4){return db[_0xd4fd('0x24')][_0xd4fd('0x41')](_0x4c79f8['body'],{})[_0xd4fd('0x1e')](respondWithResult(_0x4576e4,0xc9))['catch'](handleError(_0x4576e4,null));};exports[_0xd4fd('0x1d')]=function(_0x4150ad,_0x3f8213){if(_0x4150ad[_0xd4fd('0x42')]['id']){delete _0x4150ad[_0xd4fd('0x42')]['id'];}return db[_0xd4fd('0x24')][_0xd4fd('0x40')]({'where':{'id':_0x4150ad[_0xd4fd('0x43')]['id']}})['then'](handleEntityNotFound(_0x3f8213,null))['then'](saveUpdates(_0x4150ad[_0xd4fd('0x42')],null))[_0xd4fd('0x1e')](respondWithResult(_0x3f8213,null))['catch'](handleError(_0x3f8213,null));};exports[_0xd4fd('0x1f')]=function(_0x375bfe,_0x5f2620){return db[_0xd4fd('0x24')][_0xd4fd('0x40')]({'where':{'id':_0x375bfe['params']['id']}})['then'](handleEntityNotFound(_0x5f2620,null))[_0xd4fd('0x1e')](removeEntity(_0x5f2620,null))[_0xd4fd('0x3d')](handleError(_0x5f2620,null));};exports[_0xd4fd('0x44')]=function(_0x3e262a,_0x5d9c89){return db[_0xd4fd('0x24')][_0xd4fd('0x44')]()[_0xd4fd('0x1e')](respondWithResult(_0x5d9c89,null))[_0xd4fd('0x3d')](handleError(_0x5d9c89,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 450570a..c3900c3 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 _0x29d4=['moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','lodash','../../config/logger','api'];(function(_0x1e1a53,_0x37d35d){var _0x1b91fa=function(_0x1e7600){while(--_0x1e7600){_0x1e1a53['push'](_0x1e1a53['shift']());}};_0x1b91fa(++_0x37d35d);}(_0x29d4,0x1a1));var _0x429d=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0x29d4[_0x4dbaad];return _0x226c72;};'use strict';var _=require(_0x429d('0x0'));var util=require('util');var logger=require(_0x429d('0x1'))(_0x429d('0x2'));var moment=require(_0x429d('0x3'));var BPromise=require(_0x429d('0x4'));var rp=require(_0x429d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x429d('0x6'));var config=require(_0x429d('0x7'));var attributes=require(_0x429d('0x8'));module[_0x429d('0x9')]=function(_0x1c55aa,_0xa71445){return _0x1c55aa[_0x429d('0xa')](_0x429d('0xb'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd19b=['request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2d14b0,_0x362cb4){var _0x4395ac=function(_0x1c1859){while(--_0x1c1859){_0x2d14b0['push'](_0x2d14b0['shift']());}};_0x4395ac(++_0x362cb4);}(_0xd19b,0x153));var _0xbd19=function(_0x145b3c,_0x31ea4a){_0x145b3c=_0x145b3c-0x0;var _0x1b6e36=_0xd19b[_0x145b3c];return _0x1b6e36;};'use strict';var _=require(_0xbd19('0x0'));var util=require(_0xbd19('0x1'));var logger=require(_0xbd19('0x2'))(_0xbd19('0x3'));var moment=require(_0xbd19('0x4'));var BPromise=require(_0xbd19('0x5'));var rp=require(_0xbd19('0x6'));var fs=require('fs');var path=require(_0xbd19('0x7'));var rimraf=require(_0xbd19('0x8'));var config=require(_0xbd19('0x9'));var attributes=require(_0xbd19('0xa'));module[_0xbd19('0xb')]=function(_0x388adc,_0x214410){return _0x388adc[_0xbd19('0xc')](_0xbd19('0xd'),attributes,{'tableName':_0xbd19('0xe'),'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 46fa326..8d0c08c 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 _0x1242=['client','http','request','JscriptyAnswerReport,\x20%s,\x20%s','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x39e4ba,_0x49cb44){var _0x1655a0=function(_0x20d258){while(--_0x20d258){_0x39e4ba['push'](_0x39e4ba['shift']());}};_0x1655a0(++_0x49cb44);}(_0x1242,0x141));var _0x2124=function(_0x1133a7,_0x3a94e7){_0x1133a7=_0x1133a7-0x0;var _0xef79d1=_0x1242[_0x1133a7];return _0xef79d1;};'use strict';var _=require(_0x2124('0x0'));var util=require(_0x2124('0x1'));var moment=require(_0x2124('0x2'));var BPromise=require(_0x2124('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2124('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2124('0x5'))(_0x2124('0x6'));var config=require(_0x2124('0x7'));var jayson=require(_0x2124('0x8'));var client=jayson[_0x2124('0x9')][_0x2124('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1458c0,_0x431ca2,_0x59d4e6){return new BPromise(function(_0x36fa4e,_0x3f4518){return client[_0x2124('0xb')](_0x1458c0,_0x59d4e6)['then'](function(_0x34e68d){logger['info'](_0x2124('0xc'),_0x431ca2,'request\x20sent');logger[_0x2124('0xd')](_0x2124('0xe'),_0x431ca2,_0x2124('0xf'),JSON[_0x2124('0x10')](_0x34e68d));if(_0x34e68d[_0x2124('0x11')]){if(_0x34e68d[_0x2124('0x11')]['code']===0x1f4){logger['error'](_0x2124('0xc'),_0x431ca2,_0x34e68d[_0x2124('0x11')]['message']);return _0x3f4518(_0x34e68d[_0x2124('0x11')][_0x2124('0x12')]);}logger[_0x2124('0x11')](_0x2124('0xc'),_0x431ca2,_0x34e68d['error']['message']);return _0x36fa4e(_0x34e68d[_0x2124('0x11')][_0x2124('0x12')]);}else{logger[_0x2124('0x13')](_0x2124('0xc'),_0x431ca2,'request\x20sent');_0x36fa4e(_0x34e68d[_0x2124('0x14')][_0x2124('0x12')]);}})[_0x2124('0x15')](function(_0x5032a2){logger[_0x2124('0x11')](_0x2124('0xc'),_0x431ca2,_0x5032a2);_0x3f4518(_0x5032a2);});});} \ No newline at end of file +var _0x9f80=['../../config/environment','jayson/promise','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9f80,0xb8));var _0x09f8=function(_0x34ba21,_0x4932a7){_0x34ba21=_0x34ba21-0x0;var _0x2de66b=_0x9f80[_0x34ba21];return _0x2de66b;};'use strict';var _=require(_0x09f8('0x0'));var util=require(_0x09f8('0x1'));var moment=require(_0x09f8('0x2'));var BPromise=require(_0x09f8('0x3'));var rs=require(_0x09f8('0x4'));var fs=require('fs');var Redis=require(_0x09f8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x09f8('0x6'));var logger=require('../../config/logger')(_0x09f8('0x7'));var config=require(_0x09f8('0x8'));var jayson=require(_0x09f8('0x9'));var client=jayson[_0x09f8('0xa')][_0x09f8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x374efd,_0x43e79b,_0x3cb842){return new BPromise(function(_0x13be6b,_0x2dd5db){return client[_0x09f8('0xc')](_0x374efd,_0x3cb842)[_0x09f8('0xd')](function(_0x502e83){logger[_0x09f8('0xe')](_0x09f8('0xf'),_0x43e79b,_0x09f8('0x10'));logger[_0x09f8('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x43e79b,_0x09f8('0x10'),JSON[_0x09f8('0x12')](_0x502e83));if(_0x502e83[_0x09f8('0x13')]){if(_0x502e83[_0x09f8('0x13')][_0x09f8('0x14')]===0x1f4){logger[_0x09f8('0x13')](_0x09f8('0xf'),_0x43e79b,_0x502e83[_0x09f8('0x13')][_0x09f8('0x15')]);return _0x2dd5db(_0x502e83[_0x09f8('0x13')][_0x09f8('0x15')]);}logger[_0x09f8('0x13')](_0x09f8('0xf'),_0x43e79b,_0x502e83[_0x09f8('0x13')][_0x09f8('0x15')]);return _0x13be6b(_0x502e83[_0x09f8('0x13')][_0x09f8('0x15')]);}else{logger[_0x09f8('0xe')](_0x09f8('0xf'),_0x43e79b,_0x09f8('0x10'));_0x13be6b(_0x502e83[_0x09f8('0x16')][_0x09f8('0x15')]);}})[_0x09f8('0x17')](function(_0x1a384b){logger[_0x09f8('0x13')](_0x09f8('0xf'),_0x43e79b,_0x1a384b);_0x2dd5db(_0x1a384b);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index b644304..9372580 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 _0x74fa=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id','show','getSessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','create','/:id/clone','clone','put','delete'];(function(_0x100682,_0x11afec){var _0xcb6e87=function(_0x3ef421){while(--_0x3ef421){_0x100682['push'](_0x100682['shift']());}};_0xcb6e87(++_0x11afec);}(_0x74fa,0x6e));var _0xa74f=function(_0x56e466,_0x2dbadf){_0x56e466=_0x56e466-0x0;var _0x4b2e2a=_0x74fa[_0x56e466];return _0x4b2e2a;};'use strict';var multer=require(_0xa74f('0x0'));var util=require(_0xa74f('0x1'));var path=require(_0xa74f('0x2'));var timeout=require(_0xa74f('0x3'));var express=require(_0xa74f('0x4'));var router=express[_0xa74f('0x5')]();var auth=require(_0xa74f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa74f('0x7'));var controller=require(_0xa74f('0x8'));router[_0xa74f('0x9')]('/',auth[_0xa74f('0xa')](),controller[_0xa74f('0xb')]);router['get'](_0xa74f('0xc'),auth[_0xa74f('0xa')](),controller[_0xa74f('0xd')]);router[_0xa74f('0x9')]('/:id/sessions',auth[_0xa74f('0xa')](),controller[_0xa74f('0xe')]);router[_0xa74f('0x9')](_0xa74f('0xf'),auth[_0xa74f('0xa')](),controller[_0xa74f('0x10')]);router[_0xa74f('0x9')](_0xa74f('0x11'),auth[_0xa74f('0xa')](),timeout(_0xa74f('0x12')),controller[_0xa74f('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa74f('0x14')]);router['post'](_0xa74f('0x15'),auth['isAuthenticated'](),controller[_0xa74f('0x16')]);router[_0xa74f('0x17')](_0xa74f('0xc'),auth[_0xa74f('0xa')](),controller['update']);router[_0xa74f('0x18')]('/:id',auth[_0xa74f('0xa')](),controller[_0xa74f('0x19')]);module[_0xa74f('0x1a')]=router; \ No newline at end of file +var _0xda6a=['./jscriptyProject.controller','get','isAuthenticated','/:id','show','/:id/sessions','getSessions','/:id/answers','/:id/summary','30s','post','/:id/clone','clone','put','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x3f750f,_0x25b2b4){var _0x13e231=function(_0x43ca1b){while(--_0x43ca1b){_0x3f750f['push'](_0x3f750f['shift']());}};_0x13e231(++_0x25b2b4);}(_0xda6a,0x10d));var _0xada6=function(_0x27c2d9,_0x2c6648){_0x27c2d9=_0x27c2d9-0x0;var _0x3d6e28=_0xda6a[_0x27c2d9];return _0x3d6e28;};'use strict';var multer=require(_0xada6('0x0'));var util=require(_0xada6('0x1'));var path=require(_0xada6('0x2'));var timeout=require(_0xada6('0x3'));var express=require(_0xada6('0x4'));var router=express[_0xada6('0x5')]();var auth=require(_0xada6('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xada6('0x7'));router[_0xada6('0x8')]('/',auth[_0xada6('0x9')](),controller['index']);router[_0xada6('0x8')](_0xada6('0xa'),auth[_0xada6('0x9')](),controller[_0xada6('0xb')]);router[_0xada6('0x8')](_0xada6('0xc'),auth[_0xada6('0x9')](),controller[_0xada6('0xd')]);router[_0xada6('0x8')](_0xada6('0xe'),auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0xada6('0xf'),auth['isAuthenticated'](),timeout(_0xada6('0x10')),controller['getSummary']);router[_0xada6('0x11')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xada6('0x12'),auth[_0xada6('0x9')](),controller[_0xada6('0x13')]);router[_0xada6('0x14')](_0xada6('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xada6('0x15')]('/:id',auth[_0xada6('0x9')](),controller[_0xada6('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 6c95b6b..e0ee454 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 _0x917c=['setDataValue','formData','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','exports','STRING','name','TEXT','long','isObjectLike'];(function(_0x2e0c40,_0x4437c8){var _0x794118=function(_0xd667bf){while(--_0xd667bf){_0x2e0c40['push'](_0x2e0c40['shift']());}};_0x794118(++_0x4437c8);}(_0x917c,0x18d));var _0xc917=function(_0x2eb31a,_0x2455a5){_0x2eb31a=_0x2eb31a-0x0;var _0x3310ac=_0x917c[_0x2eb31a];return _0x3310ac;};'use strict';var Sequelize=require(_0xc917('0x0'));var _=require(_0xc917('0x1'));var util=require('util');module[_0xc917('0x2')]={'name':{'type':Sequelize[_0xc917('0x3')],'unique':_0xc917('0x4')},'description':{'type':Sequelize[_0xc917('0x3')]},'formData':{'type':Sequelize[_0xc917('0x5')](_0xc917('0x6')),'set':function(_0x112783){if(_[_0xc917('0x7')](_0x112783)){this[_0xc917('0x8')](_0xc917('0x9'),JSON['stringify'](_0x112783));}else if(_['isString'](_0x112783)){this[_0xc917('0x8')](_0xc917('0x9'),_0x112783);}else{this[_0xc917('0x8')](_0xc917('0x9'),util[_0xc917('0xa')](_0xc917('0xb'),this[_0xc917('0xc')](_0xc917('0x4'))||'',this[_0xc917('0xc')](_0xc917('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xc917('0xe')],'defaultValue':![]}}; \ No newline at end of file +var _0x481f=['formData','stringify','isString','format','getDataValue','description','BOOLEAN','sequelize','util','exports','STRING','name','TEXT','isObjectLike','setDataValue'];(function(_0x1fb038,_0xc3f69b){var _0x1600dc=function(_0x2a040e){while(--_0x2a040e){_0x1fb038['push'](_0x1fb038['shift']());}};_0x1600dc(++_0xc3f69b);}(_0x481f,0x142));var _0xf481=function(_0x4b6aa6,_0x206ba5){_0x4b6aa6=_0x4b6aa6-0x0;var _0x222bd3=_0x481f[_0x4b6aa6];return _0x222bd3;};'use strict';var Sequelize=require(_0xf481('0x0'));var _=require('lodash');var util=require(_0xf481('0x1'));module[_0xf481('0x2')]={'name':{'type':Sequelize[_0xf481('0x3')],'unique':_0xf481('0x4')},'description':{'type':Sequelize[_0xf481('0x3')]},'formData':{'type':Sequelize[_0xf481('0x5')]('long'),'set':function(_0x2119ce){if(_[_0xf481('0x6')](_0x2119ce)){this[_0xf481('0x7')](_0xf481('0x8'),JSON[_0xf481('0x9')](_0x2119ce));}else if(_[_0xf481('0xa')](_0x2119ce)){this['setDataValue'](_0xf481('0x8'),_0x2119ce);}else{this[_0xf481('0x7')]('formData',util[_0xf481('0xb')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0xf481('0xc')](_0xf481('0x4'))||'',this[_0xf481('0xc')](_0xf481('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xf481('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xf481('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 ed66cd3..0696b84 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 _0xccd7=['name','send','JscriptyProject','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','options','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','body','updatedAt','getSessions','JscriptySessionReport','ProjectId','filter','getAnswers','findOne','JscriptyAnswerReport','order','number','fromCharCode','toString','indexOf','startTime','starttime','parse','-createdAt','questionId','question','YYYY-MM-DD\x20HH:mm:ss','answer','push','isEmpty','now','writeFileSync','format','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','download','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','get','Projects','UserProfileResource','destroy','stack'];(function(_0x3e2569,_0xb5c0d9){var _0x310f79=function(_0xcbe38e){while(--_0xcbe38e){_0x3e2569['push'](_0x3e2569['shift']());}};_0x310f79(++_0xb5c0d9);}(_0xccd7,0x13e));var _0x7ccd=function(_0x55daf2,_0x1b48de){_0x55daf2=_0x55daf2-0x0;var _0x1c8500=_0xccd7[_0x55daf2];return _0x1c8500;};'use strict';var pdf=require(_0x7ccd('0x0'));var emlformat=require(_0x7ccd('0x1'));var rimraf=require(_0x7ccd('0x2'));var zipdir=require(_0x7ccd('0x3'));var jsonpatch=require(_0x7ccd('0x4'));var rp=require(_0x7ccd('0x5'));var moment=require('moment');var BPromise=require(_0x7ccd('0x6'));var Mustache=require(_0x7ccd('0x7'));var util=require(_0x7ccd('0x8'));var path=require(_0x7ccd('0x9'));var sox=require('sox');var csv=require(_0x7ccd('0xa'));var ejs=require(_0x7ccd('0xb'));var fs=require('fs');var _=require(_0x7ccd('0xc'));var squel=require(_0x7ccd('0xd'));var crypto=require(_0x7ccd('0xe'));var jsforce=require(_0x7ccd('0xf'));var deskjs=require(_0x7ccd('0x10'));var toCsv=require(_0x7ccd('0xa'));var querystring=require(_0x7ccd('0x11'));var Papa=require('papaparse');var Redis=require(_0x7ccd('0x12'));var authService=require(_0x7ccd('0x13'));var qs=require(_0x7ccd('0x14'));var as=require(_0x7ccd('0x15'));var hardwareService=require(_0x7ccd('0x16'));var logger=require('../../config/logger')(_0x7ccd('0x17'));var utils=require(_0x7ccd('0x18'));var config=require(_0x7ccd('0x19'));var db=require(_0x7ccd('0x1a'))['db'];function respondWithStatusCode(_0x188ffc,_0x18a9a6){_0x18a9a6=_0x18a9a6||0xcc;return function(_0x293b8d){if(_0x293b8d){return _0x188ffc[_0x7ccd('0x1b')](_0x18a9a6);}return _0x188ffc[_0x7ccd('0x1c')](_0x18a9a6)[_0x7ccd('0x1d')]();};}function respondWithResult(_0x1f2d02,_0x4706f6){_0x4706f6=_0x4706f6||0xc8;return function(_0x53d885){if(_0x53d885){return _0x1f2d02['status'](_0x4706f6)[_0x7ccd('0x1e')](_0x53d885);}};}function respondWithFilteredResult(_0x3d2674,_0x3b2ded){return function(_0x3d5925){if(_0x3d5925){var _0x3d65e5=_0x3d5925[_0x7ccd('0x1f')],_0x58a8a4=_0x3b2ded[_0x7ccd('0x20')],_0x50ff58=_0x3b2ded['offset']+_0x3b2ded[_0x7ccd('0x21')],_0x2182df;if(_0x50ff58>=_0x3d65e5){_0x50ff58=_0x3d65e5;_0x2182df=0xc8;}else{_0x2182df=0xce;}_0x3d2674['status'](_0x2182df);return _0x3d2674['set'](_0x7ccd('0x22'),_0x58a8a4+'-'+_0x50ff58+'/'+_0x3d65e5)[_0x7ccd('0x1e')](_0x3d5925);}return null;};}function patchUpdates(_0x4f1152){return function(_0x333b10){try{jsonpatch[_0x7ccd('0x23')](_0x333b10,_0x4f1152,!![]);}catch(_0x22bf2d){return BPromise[_0x7ccd('0x24')](_0x22bf2d);}return _0x333b10[_0x7ccd('0x25')]();};}function saveUpdates(_0x453626,_0x3c81d8){return function(_0x4e42da){if(_0x4e42da){return _0x4e42da[_0x7ccd('0x26')](_0x453626)[_0x7ccd('0x27')](function(_0x3fa16e){return _0x3fa16e;});}return null;};}function removeEntity(_0x178d60,_0x4caea1){return function(_0x417806){if(_0x417806){return _0x417806['destroy']()[_0x7ccd('0x27')](function(){var _0x10080e=_0x417806[_0x7ccd('0x28')]({'plain':!![]});var _0x239d7f=_0x7ccd('0x29');return db[_0x7ccd('0x2a')][_0x7ccd('0x2b')]({'where':{'type':_0x239d7f,'resourceId':_0x10080e['id']}})[_0x7ccd('0x27')](function(){return _0x417806;});})[_0x7ccd('0x27')](function(){_0x178d60[_0x7ccd('0x1c')](0xcc)[_0x7ccd('0x1d')]();});}};}function handleEntityNotFound(_0x158fac,_0x5d41e6){return function(_0x5cd12c){if(!_0x5cd12c){_0x158fac[_0x7ccd('0x1b')](0x194);}return _0x5cd12c;};}function handleError(_0x467c81,_0x3a1aac){_0x3a1aac=_0x3a1aac||0x1f4;return function(_0x121f78){logger['error'](_0x121f78[_0x7ccd('0x2c')]);if(_0x121f78[_0x7ccd('0x2d')]){delete _0x121f78[_0x7ccd('0x2d')];}_0x467c81[_0x7ccd('0x1c')](_0x3a1aac)[_0x7ccd('0x2e')](_0x121f78);};}exports['index']=function(_0x9317f8,_0x323398){var _0x332be6={},_0x58420a={},_0x52fb4d={'count':0x0,'rows':[]};var _0x19915d=_['map'](db[_0x7ccd('0x2f')][_0x7ccd('0x30')],function(_0x17b240){return{'name':_0x17b240['fieldName'],'type':_0x17b240[_0x7ccd('0x31')][_0x7ccd('0x32')]};});_0x58420a[_0x7ccd('0x33')]=_[_0x7ccd('0x34')](_0x19915d,_0x7ccd('0x2d'));_0x58420a[_0x7ccd('0x35')]=_[_0x7ccd('0x36')](_0x9317f8[_0x7ccd('0x35')]);_0x58420a[_0x7ccd('0x37')]=_[_0x7ccd('0x38')](_0x58420a['model'],_0x58420a['query']);_0x332be6[_0x7ccd('0x39')]=_[_0x7ccd('0x38')](_0x58420a[_0x7ccd('0x33')],qs[_0x7ccd('0x3a')](_0x9317f8[_0x7ccd('0x35')]['fields']));_0x332be6[_0x7ccd('0x39')]=_0x332be6['attributes'][_0x7ccd('0x3b')]?_0x332be6[_0x7ccd('0x39')]:_0x58420a[_0x7ccd('0x33')];if(!_0x9317f8['query'][_0x7ccd('0x3c')](_0x7ccd('0x3d'))){_0x332be6['limit']=qs[_0x7ccd('0x21')](_0x9317f8[_0x7ccd('0x35')][_0x7ccd('0x21')]);_0x332be6['offset']=qs[_0x7ccd('0x20')](_0x9317f8['query'][_0x7ccd('0x20')]);}_0x332be6['order']=qs[_0x7ccd('0x3e')](_0x9317f8[_0x7ccd('0x35')][_0x7ccd('0x3e')]);_0x332be6['where']=qs[_0x7ccd('0x37')](_[_0x7ccd('0x3f')](_0x9317f8[_0x7ccd('0x35')],_0x58420a[_0x7ccd('0x37')]));if(_0x9317f8['query']['filter']){_0x332be6[_0x7ccd('0x40')]=_[_0x7ccd('0x41')](_0x332be6[_0x7ccd('0x40')],{'$or':_[_0x7ccd('0x34')](_0x19915d,function(_0x2cb0fe){if(_0x2cb0fe['type']!==_0x7ccd('0x42')){var _0x2546be={};_0x2546be[_0x2cb0fe[_0x7ccd('0x2d')]]={'$like':'%'+_0x9317f8['query']['filter']+'%'};return _0x2546be;}})});}_0x332be6=_[_0x7ccd('0x41')]({},_0x332be6,_0x9317f8['options']);var _0xbe53d8={'where':_0x332be6['where']};return db[_0x7ccd('0x2f')]['count'](_0xbe53d8)['then'](function(_0x2f649e){_0x52fb4d[_0x7ccd('0x1f')]=_0x2f649e;if(_0x9317f8[_0x7ccd('0x35')][_0x7ccd('0x43')]){_0x332be6[_0x7ccd('0x44')]=[{'all':!![]}];}return db['JscriptyProject'][_0x7ccd('0x45')](_0x332be6);})[_0x7ccd('0x27')](function(_0x23edfc){_0x52fb4d[_0x7ccd('0x46')]=_0x23edfc;return _0x52fb4d;})[_0x7ccd('0x27')](respondWithFilteredResult(_0x323398,_0x332be6))['catch'](handleError(_0x323398,null));};exports[_0x7ccd('0x47')]=function(_0x1cee57,_0x1bbba5){var _0xe9a559={'raw':![],'where':{'id':_0x1cee57[_0x7ccd('0x48')]['id']}},_0x2e2b06={};_0x2e2b06[_0x7ccd('0x33')]=_[_0x7ccd('0x36')](db[_0x7ccd('0x2f')]['rawAttributes']);_0x2e2b06[_0x7ccd('0x35')]=_[_0x7ccd('0x36')](_0x1cee57[_0x7ccd('0x35')]);_0x2e2b06[_0x7ccd('0x37')]=_[_0x7ccd('0x38')](_0x2e2b06[_0x7ccd('0x33')],_0x2e2b06[_0x7ccd('0x35')]);_0xe9a559['attributes']=_[_0x7ccd('0x38')](_0x2e2b06[_0x7ccd('0x33')],qs[_0x7ccd('0x3a')](_0x1cee57[_0x7ccd('0x35')][_0x7ccd('0x3a')]));_0xe9a559[_0x7ccd('0x39')]=_0xe9a559[_0x7ccd('0x39')]['length']?_0xe9a559[_0x7ccd('0x39')]:_0x2e2b06[_0x7ccd('0x33')];if(_0x1cee57[_0x7ccd('0x35')][_0x7ccd('0x43')]){_0xe9a559['include']=[{'all':!![]}];}_0xe9a559=_[_0x7ccd('0x41')]({},_0xe9a559,_0x1cee57[_0x7ccd('0x49')]);return db['JscriptyProject'][_0x7ccd('0x4a')](_0xe9a559)[_0x7ccd('0x27')](handleEntityNotFound(_0x1bbba5,null))['then'](respondWithResult(_0x1bbba5,null))[_0x7ccd('0x4b')](handleError(_0x1bbba5,null));};exports[_0x7ccd('0x4c')]=function(_0x54ab12,_0x490342){return db[_0x7ccd('0x2f')][_0x7ccd('0x4c')](_0x54ab12['body'],{})[_0x7ccd('0x27')](function(_0x2efd6a){var _0x3e89d2=_0x54ab12['user']['get']({'plain':!![]});if(!_0x3e89d2)throw new Error(_0x7ccd('0x4d'));if(_0x3e89d2[_0x7ccd('0x4e')]===_0x7ccd('0x4f')){var _0x36633c=_0x2efd6a[_0x7ccd('0x28')]({'plain':!![]});var _0x2d0c29=_0x7ccd('0x29');return db[_0x7ccd('0x50')][_0x7ccd('0x4a')]({'where':{'name':_0x2d0c29,'userProfileId':_0x3e89d2[_0x7ccd('0x51')]},'raw':!![]})[_0x7ccd('0x27')](function(_0x14959c){if(_0x14959c&&_0x14959c[_0x7ccd('0x52')]===0x0){return db['UserProfileResource'][_0x7ccd('0x4c')]({'name':_0x36633c[_0x7ccd('0x2d')],'resourceId':_0x36633c['id'],'type':_0x14959c['name'],'sectionId':_0x14959c['id']},{})[_0x7ccd('0x27')](function(){return _0x2efd6a;});}else{return _0x2efd6a;}})['catch'](function(_0x4f873b){logger[_0x7ccd('0x53')](_0x7ccd('0x54'),_0x4f873b);throw _0x4f873b;});}return _0x2efd6a;})[_0x7ccd('0x27')](respondWithResult(_0x490342,0xc9))[_0x7ccd('0x4b')](handleError(_0x490342,null));};exports['clone']=function(_0x25a01e,_0xd273){var _0x3f179d={'where':{'id':_0x25a01e[_0x7ccd('0x48')]['id']}},_0x1fb051={};_0x1fb051[_0x7ccd('0x33')]=_['keys'](db[_0x7ccd('0x2f')][_0x7ccd('0x30')]);_0x3f179d[_0x7ccd('0x39')]=_[_0x7ccd('0x38')](_0x1fb051[_0x7ccd('0x33')],qs[_0x7ccd('0x3a')](_0x25a01e[_0x7ccd('0x35')][_0x7ccd('0x3a')]));_0x3f179d[_0x7ccd('0x39')]=_0x3f179d['attributes']['length']?_0x3f179d[_0x7ccd('0x39')]:_0x1fb051[_0x7ccd('0x33')];if(_0x25a01e[_0x7ccd('0x35')][_0x7ccd('0x43')]){_0x3f179d[_0x7ccd('0x44')]=[{'all':!![]}];}_0x3f179d=_[_0x7ccd('0x41')]({},_0x3f179d,_0x25a01e[_0x7ccd('0x49')]);return db[_0x7ccd('0x2f')][_0x7ccd('0x4a')](_0x3f179d)[_0x7ccd('0x27')](handleEntityNotFound(_0xd273,null))[_0x7ccd('0x27')](function(_0x398ee1){if(_0x398ee1){var _0x10d546=_0x398ee1[_0x7ccd('0x28')]({'plain':!![]});_0x10d546=qs[_0x7ccd('0x55')](_0x10d546,['id',_0x7ccd('0x56'),'updatedAt']);_0x25a01e[_0x7ccd('0x57')]=_['omit'](_0x25a01e[_0x7ccd('0x57')],['id',_0x7ccd('0x56'),_0x7ccd('0x58')]);return db[_0x7ccd('0x2f')][_0x7ccd('0x4c')](_[_0x7ccd('0x41')](_0x10d546,_0x25a01e[_0x7ccd('0x57')]),{'include':_0x25a01e[_0x7ccd('0x35')]['includeAll']?[{'all':!![]}]:undefined})[_0x7ccd('0x27')](function(_0x115a21){var _0x2b8685=_0x25a01e[_0x7ccd('0x4f')][_0x7ccd('0x28')]({'plain':!![]});if(!_0x2b8685)throw new Error(_0x7ccd('0x4d'));if(_0x2b8685[_0x7ccd('0x4e')]==='user'){var _0x487c08=_0x115a21['get']({'plain':!![]});var _0x269d10=_0x7ccd('0x29');return db[_0x7ccd('0x50')][_0x7ccd('0x4a')]({'where':{'name':_0x269d10,'userProfileId':_0x2b8685[_0x7ccd('0x51')]},'raw':!![]})[_0x7ccd('0x27')](function(_0x4d1455){if(_0x4d1455&&_0x4d1455[_0x7ccd('0x52')]===0x0){return db[_0x7ccd('0x2a')][_0x7ccd('0x4c')]({'name':_0x487c08[_0x7ccd('0x2d')],'resourceId':_0x487c08['id'],'type':_0x4d1455[_0x7ccd('0x2d')],'sectionId':_0x4d1455['id']},{})[_0x7ccd('0x27')](function(){return _0x115a21;});}else{return _0x115a21;}})[_0x7ccd('0x4b')](function(_0x508032){logger[_0x7ccd('0x53')](_0x7ccd('0x54'),_0x508032);throw _0x508032;});}return _0x115a21;});}})['then'](respondWithResult(_0xd273,0xc9))[_0x7ccd('0x4b')](handleError(_0xd273,null));};exports[_0x7ccd('0x26')]=function(_0xcf8577,_0x436711){if(_0xcf8577[_0x7ccd('0x57')]['id']){delete _0xcf8577['body']['id'];}return db['JscriptyProject'][_0x7ccd('0x4a')]({'where':{'id':_0xcf8577[_0x7ccd('0x48')]['id']}})['then'](handleEntityNotFound(_0x436711,null))[_0x7ccd('0x27')](saveUpdates(_0xcf8577[_0x7ccd('0x57')],null))['then'](respondWithResult(_0x436711,null))['catch'](handleError(_0x436711,null));};exports[_0x7ccd('0x2b')]=function(_0x4afafb,_0x7f5136){return db['JscriptyProject'][_0x7ccd('0x4a')]({'where':{'id':_0x4afafb['params']['id']}})[_0x7ccd('0x27')](handleEntityNotFound(_0x7f5136,null))[_0x7ccd('0x27')](removeEntity(_0x7f5136,null))[_0x7ccd('0x4b')](handleError(_0x7f5136,null));};exports[_0x7ccd('0x59')]=function(_0x41fe27,_0x38ce4d,_0x586c4e){var _0x1bc023={'raw':!![],'where':{}};var _0x2a18cd={};var _0x5eb5bd={'count':0x0,'rows':[]};return db['JscriptyProject']['findOne']({'where':{'id':_0x41fe27[_0x7ccd('0x48')]['id']}})[_0x7ccd('0x27')](handleEntityNotFound(_0x38ce4d,null))[_0x7ccd('0x27')](function(_0x597f34){if(_0x597f34){_0x2a18cd[_0x7ccd('0x33')]=_[_0x7ccd('0x36')](db[_0x7ccd('0x5a')][_0x7ccd('0x30')]);_0x2a18cd['query']=_[_0x7ccd('0x36')](_0x41fe27[_0x7ccd('0x35')]);_0x2a18cd['filters']=_[_0x7ccd('0x38')](_0x2a18cd['model'],_0x2a18cd['query']);_0x1bc023['attributes']=_['intersection'](_0x2a18cd[_0x7ccd('0x33')],qs['fields'](_0x41fe27[_0x7ccd('0x35')][_0x7ccd('0x3a')]));_0x1bc023[_0x7ccd('0x39')]=_0x1bc023[_0x7ccd('0x39')]['length']?_0x1bc023[_0x7ccd('0x39')]:_0x2a18cd[_0x7ccd('0x33')];if(!_0x41fe27[_0x7ccd('0x35')][_0x7ccd('0x3c')](_0x7ccd('0x3d'))){_0x1bc023['limit']=qs['limit'](_0x41fe27[_0x7ccd('0x35')][_0x7ccd('0x21')]);_0x1bc023['offset']=qs['offset'](_0x41fe27[_0x7ccd('0x35')]['offset']);}_0x1bc023['order']=qs[_0x7ccd('0x3e')](_0x41fe27[_0x7ccd('0x35')][_0x7ccd('0x3e')]);_0x1bc023[_0x7ccd('0x40')]=qs[_0x7ccd('0x37')](_[_0x7ccd('0x3f')](_0x41fe27['query'],_0x2a18cd[_0x7ccd('0x37')]));_0x1bc023[_0x7ccd('0x40')][_0x7ccd('0x5b')]=_0x597f34['id'];if(_0x41fe27[_0x7ccd('0x35')][_0x7ccd('0x5c')]){_0x1bc023[_0x7ccd('0x40')]=_['merge'](_0x1bc023['where'],{'$or':_[_0x7ccd('0x34')](_0x1bc023[_0x7ccd('0x39')],function(_0x28065c){var _0x3ac257={};_0x3ac257[_0x28065c]={'$like':'%'+_0x41fe27[_0x7ccd('0x35')][_0x7ccd('0x5c')]+'%'};return _0x3ac257;})});}_0x1bc023=_[_0x7ccd('0x41')]({},_0x1bc023,_0x41fe27['options']);return db[_0x7ccd('0x5a')]['count']({'where':_0x1bc023['where']})[_0x7ccd('0x27')](function(_0x4a6da2){_0x5eb5bd[_0x7ccd('0x1f')]=_0x4a6da2;if(_0x41fe27[_0x7ccd('0x35')][_0x7ccd('0x43')]){_0x1bc023[_0x7ccd('0x44')]=[{'all':!![]}];}return db[_0x7ccd('0x5a')][_0x7ccd('0x45')](_0x1bc023);})[_0x7ccd('0x27')](function(_0x50f2d6){_0x5eb5bd[_0x7ccd('0x46')]=_0x50f2d6;return _0x5eb5bd;});}})[_0x7ccd('0x27')](respondWithFilteredResult(_0x38ce4d,_0x1bc023))['catch'](handleError(_0x38ce4d,null));};exports[_0x7ccd('0x5d')]=function(_0x3479c0,_0x1454d3,_0x4afecf){var _0xd850d5={'raw':!![],'where':{}};var _0x55d930={};var _0x1341df={'count':0x0,'rows':[]};return db[_0x7ccd('0x2f')][_0x7ccd('0x5e')]({'where':{'id':_0x3479c0['params']['id']}})[_0x7ccd('0x27')](handleEntityNotFound(_0x1454d3,null))[_0x7ccd('0x27')](function(_0xb7c303){if(_0xb7c303){_0x55d930['model']=_['keys'](db[_0x7ccd('0x5f')][_0x7ccd('0x30')]);_0x55d930[_0x7ccd('0x35')]=_[_0x7ccd('0x36')](_0x3479c0[_0x7ccd('0x35')]);_0x55d930['filters']=_[_0x7ccd('0x38')](_0x55d930['model'],_0x55d930[_0x7ccd('0x35')]);_0xd850d5[_0x7ccd('0x39')]=_[_0x7ccd('0x38')](_0x55d930[_0x7ccd('0x33')],qs[_0x7ccd('0x3a')](_0x3479c0['query']['fields']));_0xd850d5[_0x7ccd('0x39')]=_0xd850d5['attributes'][_0x7ccd('0x3b')]?_0xd850d5[_0x7ccd('0x39')]:_0x55d930['model'];if(!_0x3479c0[_0x7ccd('0x35')][_0x7ccd('0x3c')](_0x7ccd('0x3d'))){_0xd850d5[_0x7ccd('0x21')]=qs[_0x7ccd('0x21')](_0x3479c0[_0x7ccd('0x35')]['limit']);_0xd850d5[_0x7ccd('0x20')]=qs['offset'](_0x3479c0[_0x7ccd('0x35')]['offset']);}_0xd850d5[_0x7ccd('0x60')]=qs[_0x7ccd('0x3e')](_0x3479c0[_0x7ccd('0x35')][_0x7ccd('0x3e')]);_0xd850d5[_0x7ccd('0x40')]=qs[_0x7ccd('0x37')](_[_0x7ccd('0x3f')](_0x3479c0['query'],_0x55d930[_0x7ccd('0x37')]));_0xd850d5[_0x7ccd('0x40')][_0x7ccd('0x5b')]=_0xb7c303['id'];if(_0x3479c0[_0x7ccd('0x35')][_0x7ccd('0x5c')]){_0xd850d5[_0x7ccd('0x40')]=_[_0x7ccd('0x41')](_0xd850d5[_0x7ccd('0x40')],{'$or':_[_0x7ccd('0x34')](_0xd850d5[_0x7ccd('0x39')],function(_0x3e4e89){var _0x973afe={};_0x973afe[_0x3e4e89]={'$like':'%'+_0x3479c0[_0x7ccd('0x35')][_0x7ccd('0x5c')]+'%'};return _0x973afe;})});}_0xd850d5=_[_0x7ccd('0x41')]({},_0xd850d5,_0x3479c0['options']);return db[_0x7ccd('0x5f')][_0x7ccd('0x1f')]({'where':_0xd850d5[_0x7ccd('0x40')]})[_0x7ccd('0x27')](function(_0x3a2069){_0x1341df[_0x7ccd('0x1f')]=_0x3a2069;if(_0x3479c0['query'][_0x7ccd('0x43')]){_0xd850d5[_0x7ccd('0x44')]=[{'all':!![]}];}return db[_0x7ccd('0x5f')]['findAll'](_0xd850d5);})[_0x7ccd('0x27')](function(_0x2ae1f1){_0x1341df[_0x7ccd('0x46')]=_0x2ae1f1;return _0x1341df;});}})[_0x7ccd('0x27')](respondWithFilteredResult(_0x1454d3,_0xd850d5))['catch'](handleError(_0x1454d3,null));};function char(_0xf58de5){return _0x7ccd('0x61')===typeof _0xf58de5?String[_0x7ccd('0x62')][_0x7ccd('0x23')](null,arguments):_0xf58de5;}function needsEncapsulation(_0xc65100){return!!_0xc65100&&(_0xc65100[_0x7ccd('0x63')]()[_0x7ccd('0x64')](char(0xd))>=0x0||_0xc65100['toString']()[_0x7ccd('0x64')](char(0xa))>=0x0||_0xc65100[_0x7ccd('0x63')]()[_0x7ccd('0x64')](char(0x2c))>=0x0||_0xc65100[_0x7ccd('0x63')]()[_0x7ccd('0x64')](char(0x22))>=0x0);}function encapsulate(_0x3c2c73){var _0x148782=char(0x22),_0x1bba0f='\x5c'+char(0x22),_0x41579f=_0x3c2c73[_0x7ccd('0x63')]()['replace'](new RegExp(_0x148782,'g'),_0x1bba0f);return _0x148782+_0x41579f+_0x148782;}exports['getSummary']=function(_0x261238,_0x3973a1,_0x5e9507){var _0x208b04,_0x43d949;var _0x202e23={'where':{'ProjectId':_0x261238[_0x7ccd('0x48')]['id']}};if(_0x261238[_0x7ccd('0x35')][_0x7ccd('0x65')]){_0x202e23[_0x7ccd('0x40')][_0x7ccd('0x66')]=JSON[_0x7ccd('0x67')](_0x261238[_0x7ccd('0x35')][_0x7ccd('0x65')]);}return db[_0x7ccd('0x5a')][_0x7ccd('0x45')](_0x202e23)[_0x7ccd('0x27')](handleEntityNotFound(_0x3973a1,null))['then'](function(_0x341a3e){if(_0x341a3e){_0x208b04=_0x341a3e;return db['JscriptyQuestionReport'][_0x7ccd('0x45')]({'where':{'SessionId':{'$in':_[_0x7ccd('0x34')](_0x208b04,'id')},'ProjectId':_0x261238[_0x7ccd('0x48')]['id']},'order':_0x7ccd('0x68')});}})[_0x7ccd('0x27')](handleEntityNotFound(_0x3973a1,null))[_0x7ccd('0x27')](function(_0x5a0d52){if(_0x5a0d52){_0x43d949=_0x5a0d52;var _0x159dbc={};for(var _0x4634cf=0x0,_0xbfb331=_0x43d949[_0x7ccd('0x3b')];_0x4634cf<_0xbfb331;_0x4634cf++){if(!_0x159dbc['hasOwnProperty'](_0x43d949[_0x4634cf][_0x7ccd('0x69')])){_0x159dbc[_0x43d949[_0x4634cf]['questionId']]=needsEncapsulation(_0x43d949[_0x4634cf][_0x7ccd('0x6a')])?encapsulate(_0x43d949[_0x4634cf]['question']):_0x43d949[_0x4634cf][_0x7ccd('0x6a')];}}var _0x1f94e6=[],_0x31989c={};for(var _0x52c7fb=0x0,_0x40af71=_0x208b04[_0x7ccd('0x3b')];_0x52c7fb<_0x40af71;_0x52c7fb++){_0x31989c={'ProjectId':_0x261238[_0x7ccd('0x48')]['id'],'SessionId':_0x208b04[_0x52c7fb]['id'],'StartTime':moment(_0x208b04[_0x52c7fb]['starttime'])['format'](_0x7ccd('0x6b'))};for(var _0x283f9b=0x0,_0x2cd317=_0x43d949['length'];_0x283f9b<_0x2cd317;_0x283f9b++){if(_0x43d949[_0x283f9b]['SessionId']==_0x208b04[_0x52c7fb]['id']&&_0x159dbc[_0x7ccd('0x3c')](_0x43d949[_0x283f9b][_0x7ccd('0x69')])){_0x31989c[_0x159dbc[_0x43d949[_0x283f9b][_0x7ccd('0x69')]]]=_0x43d949[_0x283f9b][_0x7ccd('0x6c')];}}for(var _0x50f127 in _0x159dbc){if(!_0x31989c[_0x7ccd('0x3c')](_0x159dbc[_0x50f127])){_0x31989c[_0x159dbc[_0x50f127]]=null;}}_0x1f94e6[_0x7ccd('0x6d')](_0x31989c);}return _0x1f94e6;}})[_0x7ccd('0x27')](function(_0x28faf0){if(!_[_0x7ccd('0x6e')](_0x28faf0)){var _0x46dbc4=toCsv(_0x28faf0);var _0x580a7e=Date[_0x7ccd('0x6f')]();fs[_0x7ccd('0x70')](util[_0x7ccd('0x71')](_0x7ccd('0x72'),_0x261238[_0x7ccd('0x48')]['id'],_0x580a7e),_0x46dbc4);_0x3973a1[_0x7ccd('0x73')](_0x7ccd('0x74'),_0x7ccd('0x75')+util[_0x7ccd('0x71')]('Jscripty_Project_%d_Summary_%s.csv',_0x261238[_0x7ccd('0x48')]['id'],_0x580a7e));_0x3973a1['setHeader'](_0x7ccd('0x76'),_0x7ccd('0x77'));return _0x3973a1[_0x7ccd('0x78')](util[_0x7ccd('0x71')](_0x7ccd('0x72'),_0x261238[_0x7ccd('0x48')]['id'],_0x580a7e));}else{return _0x3973a1[_0x7ccd('0x1b')](0xcc);}})[_0x7ccd('0x4b')](handleError(_0x3973a1,null));}; \ No newline at end of file +var _0x7602=['include','findAll','rows','catch','show','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','userProfileId','update','params','findOne','JscriptySessionReport','ProjectId','getAnswers','JscriptyAnswerReport','nolimit','order','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','attachment;\x20filename=','Content-type','text/csv','download','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','apply','reject','save','then','destroy','get','Projects','sendStatus','error','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','merge','VIRTUAL','filter','options'];(function(_0x503679,_0x1d99bf){var _0x2c6c2b=function(_0x451623){while(--_0x451623){_0x503679['push'](_0x503679['shift']());}};_0x2c6c2b(++_0x1d99bf);}(_0x7602,0x127));var _0x2760=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0x7602[_0x3fba9f];return _0x192cf1;};'use strict';var pdf=require(_0x2760('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2760('0x1'));var zipdir=require(_0x2760('0x2'));var jsonpatch=require(_0x2760('0x3'));var rp=require(_0x2760('0x4'));var moment=require(_0x2760('0x5'));var BPromise=require(_0x2760('0x6'));var Mustache=require('mustache');var util=require(_0x2760('0x7'));var path=require(_0x2760('0x8'));var sox=require(_0x2760('0x9'));var csv=require(_0x2760('0xa'));var ejs=require(_0x2760('0xb'));var fs=require('fs');var _=require(_0x2760('0xc'));var squel=require(_0x2760('0xd'));var crypto=require('crypto');var jsforce=require(_0x2760('0xe'));var deskjs=require(_0x2760('0xf'));var toCsv=require(_0x2760('0xa'));var querystring=require(_0x2760('0x10'));var Papa=require(_0x2760('0x11'));var Redis=require('ioredis');var authService=require(_0x2760('0x12'));var qs=require(_0x2760('0x13'));var as=require(_0x2760('0x14'));var hardwareService=require(_0x2760('0x15'));var logger=require('../../config/logger')(_0x2760('0x16'));var utils=require(_0x2760('0x17'));var config=require(_0x2760('0x18'));var db=require(_0x2760('0x19'))['db'];function respondWithStatusCode(_0x5699fc,_0x924500){_0x924500=_0x924500||0xcc;return function(_0x471740){if(_0x471740){return _0x5699fc['sendStatus'](_0x924500);}return _0x5699fc[_0x2760('0x1a')](_0x924500)[_0x2760('0x1b')]();};}function respondWithResult(_0xf39c0b,_0x4e0096){_0x4e0096=_0x4e0096||0xc8;return function(_0x4fba88){if(_0x4fba88){return _0xf39c0b[_0x2760('0x1a')](_0x4e0096)[_0x2760('0x1c')](_0x4fba88);}};}function respondWithFilteredResult(_0x5a424d,_0x5ee075){return function(_0xf2c62c){if(_0xf2c62c){var _0x1c9427=_0xf2c62c[_0x2760('0x1d')],_0x1b79f7=_0x5ee075[_0x2760('0x1e')],_0x1916fe=_0x5ee075['offset']+_0x5ee075[_0x2760('0x1f')],_0x7a5b58;if(_0x1916fe>=_0x1c9427){_0x1916fe=_0x1c9427;_0x7a5b58=0xc8;}else{_0x7a5b58=0xce;}_0x5a424d['status'](_0x7a5b58);return _0x5a424d[_0x2760('0x20')]('Content-Range',_0x1b79f7+'-'+_0x1916fe+'/'+_0x1c9427)[_0x2760('0x1c')](_0xf2c62c);}return null;};}function patchUpdates(_0x41e14a){return function(_0x1e2616){try{jsonpatch[_0x2760('0x21')](_0x1e2616,_0x41e14a,!![]);}catch(_0x19abff){return BPromise[_0x2760('0x22')](_0x19abff);}return _0x1e2616[_0x2760('0x23')]();};}function saveUpdates(_0xcb4367,_0x3988ad){return function(_0x5a2379){if(_0x5a2379){return _0x5a2379['update'](_0xcb4367)[_0x2760('0x24')](function(_0x23b9d5){return _0x23b9d5;});}return null;};}function removeEntity(_0x143ec3,_0x516744){return function(_0x1dcaff){if(_0x1dcaff){return _0x1dcaff[_0x2760('0x25')]()[_0x2760('0x24')](function(){var _0x113dae=_0x1dcaff[_0x2760('0x26')]({'plain':!![]});var _0x3d6ead=_0x2760('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x3d6ead,'resourceId':_0x113dae['id']}})['then'](function(){return _0x1dcaff;});})['then'](function(){_0x143ec3[_0x2760('0x1a')](0xcc)[_0x2760('0x1b')]();});}};}function handleEntityNotFound(_0x21d66e,_0xc74298){return function(_0x34c069){if(!_0x34c069){_0x21d66e[_0x2760('0x28')](0x194);}return _0x34c069;};}function handleError(_0x4a2af2,_0x1647c7){_0x1647c7=_0x1647c7||0x1f4;return function(_0x34e391){logger[_0x2760('0x29')](_0x34e391[_0x2760('0x2a')]);if(_0x34e391[_0x2760('0x2b')]){delete _0x34e391[_0x2760('0x2b')];}_0x4a2af2[_0x2760('0x1a')](_0x1647c7)[_0x2760('0x2c')](_0x34e391);};}exports[_0x2760('0x2d')]=function(_0x2e9a57,_0x581b2c){var _0x54db20={},_0x573eaa={},_0x4a00b4={'count':0x0,'rows':[]};var _0x2c3c1b=_[_0x2760('0x2e')](db[_0x2760('0x2f')][_0x2760('0x30')],function(_0x5d1d2b){return{'name':_0x5d1d2b[_0x2760('0x31')],'type':_0x5d1d2b[_0x2760('0x32')][_0x2760('0x33')]};});_0x573eaa[_0x2760('0x34')]=_[_0x2760('0x2e')](_0x2c3c1b,_0x2760('0x2b'));_0x573eaa[_0x2760('0x35')]=_[_0x2760('0x36')](_0x2e9a57[_0x2760('0x35')]);_0x573eaa['filters']=_[_0x2760('0x37')](_0x573eaa[_0x2760('0x34')],_0x573eaa[_0x2760('0x35')]);_0x54db20[_0x2760('0x38')]=_[_0x2760('0x37')](_0x573eaa['model'],qs['fields'](_0x2e9a57[_0x2760('0x35')][_0x2760('0x39')]));_0x54db20[_0x2760('0x38')]=_0x54db20[_0x2760('0x38')][_0x2760('0x3a')]?_0x54db20[_0x2760('0x38')]:_0x573eaa[_0x2760('0x34')];if(!_0x2e9a57[_0x2760('0x35')][_0x2760('0x3b')]('nolimit')){_0x54db20[_0x2760('0x1f')]=qs[_0x2760('0x1f')](_0x2e9a57[_0x2760('0x35')][_0x2760('0x1f')]);_0x54db20[_0x2760('0x1e')]=qs[_0x2760('0x1e')](_0x2e9a57['query'][_0x2760('0x1e')]);}_0x54db20['order']=qs[_0x2760('0x3c')](_0x2e9a57['query'][_0x2760('0x3c')]);_0x54db20[_0x2760('0x3d')]=qs[_0x2760('0x3e')](_[_0x2760('0x3f')](_0x2e9a57[_0x2760('0x35')],_0x573eaa['filters']));if(_0x2e9a57[_0x2760('0x35')]['filter']){_0x54db20[_0x2760('0x3d')]=_[_0x2760('0x40')](_0x54db20[_0x2760('0x3d')],{'$or':_[_0x2760('0x2e')](_0x2c3c1b,function(_0x554f9e){if(_0x554f9e['type']!==_0x2760('0x41')){var _0x18cff2={};_0x18cff2[_0x554f9e['name']]={'$like':'%'+_0x2e9a57['query'][_0x2760('0x42')]+'%'};return _0x18cff2;}})});}_0x54db20=_[_0x2760('0x40')]({},_0x54db20,_0x2e9a57[_0x2760('0x43')]);var _0x24c787={'where':_0x54db20[_0x2760('0x3d')]};return db[_0x2760('0x2f')]['count'](_0x24c787)[_0x2760('0x24')](function(_0x2b8d27){_0x4a00b4[_0x2760('0x1d')]=_0x2b8d27;if(_0x2e9a57['query']['includeAll']){_0x54db20[_0x2760('0x44')]=[{'all':!![]}];}return db['JscriptyProject'][_0x2760('0x45')](_0x54db20);})[_0x2760('0x24')](function(_0x41bbb4){_0x4a00b4[_0x2760('0x46')]=_0x41bbb4;return _0x4a00b4;})['then'](respondWithFilteredResult(_0x581b2c,_0x54db20))[_0x2760('0x47')](handleError(_0x581b2c,null));};exports[_0x2760('0x48')]=function(_0x5f0530,_0x36ada8){var _0x482962={'raw':![],'where':{'id':_0x5f0530['params']['id']}},_0x117d4a={};_0x117d4a[_0x2760('0x34')]=_['keys'](db['JscriptyProject'][_0x2760('0x30')]);_0x117d4a[_0x2760('0x35')]=_[_0x2760('0x36')](_0x5f0530['query']);_0x117d4a['filters']=_['intersection'](_0x117d4a['model'],_0x117d4a['query']);_0x482962['attributes']=_[_0x2760('0x37')](_0x117d4a[_0x2760('0x34')],qs[_0x2760('0x39')](_0x5f0530[_0x2760('0x35')][_0x2760('0x39')]));_0x482962[_0x2760('0x38')]=_0x482962[_0x2760('0x38')]['length']?_0x482962[_0x2760('0x38')]:_0x117d4a['model'];if(_0x5f0530[_0x2760('0x35')][_0x2760('0x49')]){_0x482962[_0x2760('0x44')]=[{'all':!![]}];}_0x482962=_['merge']({},_0x482962,_0x5f0530['options']);return db[_0x2760('0x2f')]['find'](_0x482962)[_0x2760('0x24')](handleEntityNotFound(_0x36ada8,null))['then'](respondWithResult(_0x36ada8,null))[_0x2760('0x47')](handleError(_0x36ada8,null));};exports[_0x2760('0x4a')]=function(_0x4bef9d,_0x2de43e){return db[_0x2760('0x2f')][_0x2760('0x4a')](_0x4bef9d[_0x2760('0x4b')],{})[_0x2760('0x24')](function(_0xfbc8aa){var _0xd87894=_0x4bef9d[_0x2760('0x4c')][_0x2760('0x26')]({'plain':!![]});if(!_0xd87894)throw new Error(_0x2760('0x4d'));if(_0xd87894[_0x2760('0x4e')]===_0x2760('0x4c')){var _0x1d23f7=_0xfbc8aa[_0x2760('0x26')]({'plain':!![]});var _0x489588='Projects';return db[_0x2760('0x4f')][_0x2760('0x50')]({'where':{'name':_0x489588,'userProfileId':_0xd87894['userProfileId']},'raw':!![]})['then'](function(_0x50947c){if(_0x50947c&&_0x50947c[_0x2760('0x51')]===0x0){return db[_0x2760('0x52')][_0x2760('0x4a')]({'name':_0x1d23f7[_0x2760('0x2b')],'resourceId':_0x1d23f7['id'],'type':_0x50947c[_0x2760('0x2b')],'sectionId':_0x50947c['id']},{})[_0x2760('0x24')](function(){return _0xfbc8aa;});}else{return _0xfbc8aa;}})[_0x2760('0x47')](function(_0x22d2c9){logger[_0x2760('0x29')](_0x2760('0x53'),_0x22d2c9);throw _0x22d2c9;});}return _0xfbc8aa;})[_0x2760('0x24')](respondWithResult(_0x2de43e,0xc9))[_0x2760('0x47')](handleError(_0x2de43e,null));};exports[_0x2760('0x54')]=function(_0x992b28,_0x394ec9){var _0x28906e={'where':{'id':_0x992b28['params']['id']}},_0x3365de={};_0x3365de[_0x2760('0x34')]=_[_0x2760('0x36')](db[_0x2760('0x2f')]['rawAttributes']);_0x28906e['attributes']=_['intersection'](_0x3365de[_0x2760('0x34')],qs[_0x2760('0x39')](_0x992b28[_0x2760('0x35')]['fields']));_0x28906e[_0x2760('0x38')]=_0x28906e['attributes'][_0x2760('0x3a')]?_0x28906e[_0x2760('0x38')]:_0x3365de[_0x2760('0x34')];if(_0x992b28[_0x2760('0x35')][_0x2760('0x49')]){_0x28906e[_0x2760('0x44')]=[{'all':!![]}];}_0x28906e=_[_0x2760('0x40')]({},_0x28906e,_0x992b28[_0x2760('0x43')]);return db[_0x2760('0x2f')][_0x2760('0x50')](_0x28906e)[_0x2760('0x24')](handleEntityNotFound(_0x394ec9,null))['then'](function(_0x989306){if(_0x989306){var _0x502ad9=_0x989306[_0x2760('0x26')]({'plain':!![]});_0x502ad9=qs[_0x2760('0x55')](_0x502ad9,['id',_0x2760('0x56'),_0x2760('0x57')]);_0x992b28[_0x2760('0x4b')]=_['omit'](_0x992b28['body'],['id',_0x2760('0x56'),_0x2760('0x57')]);return db['JscriptyProject']['create'](_[_0x2760('0x40')](_0x502ad9,_0x992b28[_0x2760('0x4b')]),{'include':_0x992b28[_0x2760('0x35')][_0x2760('0x49')]?[{'all':!![]}]:undefined})[_0x2760('0x24')](function(_0x4d66ec){var _0x1d6095=_0x992b28[_0x2760('0x4c')][_0x2760('0x26')]({'plain':!![]});if(!_0x1d6095)throw new Error(_0x2760('0x4d'));if(_0x1d6095[_0x2760('0x4e')]===_0x2760('0x4c')){var _0x5dbf0d=_0x4d66ec[_0x2760('0x26')]({'plain':!![]});var _0x44eebd='Projects';return db[_0x2760('0x4f')][_0x2760('0x50')]({'where':{'name':_0x44eebd,'userProfileId':_0x1d6095[_0x2760('0x58')]},'raw':!![]})[_0x2760('0x24')](function(_0x30b3a9){if(_0x30b3a9&&_0x30b3a9[_0x2760('0x51')]===0x0){return db[_0x2760('0x52')][_0x2760('0x4a')]({'name':_0x5dbf0d[_0x2760('0x2b')],'resourceId':_0x5dbf0d['id'],'type':_0x30b3a9['name'],'sectionId':_0x30b3a9['id']},{})[_0x2760('0x24')](function(){return _0x4d66ec;});}else{return _0x4d66ec;}})[_0x2760('0x47')](function(_0x107afc){logger[_0x2760('0x29')](_0x2760('0x53'),_0x107afc);throw _0x107afc;});}return _0x4d66ec;});}})[_0x2760('0x24')](respondWithResult(_0x394ec9,0xc9))['catch'](handleError(_0x394ec9,null));};exports[_0x2760('0x59')]=function(_0x5a68a5,_0x353f6d){if(_0x5a68a5['body']['id']){delete _0x5a68a5[_0x2760('0x4b')]['id'];}return db[_0x2760('0x2f')][_0x2760('0x50')]({'where':{'id':_0x5a68a5['params']['id']}})[_0x2760('0x24')](handleEntityNotFound(_0x353f6d,null))['then'](saveUpdates(_0x5a68a5['body'],null))[_0x2760('0x24')](respondWithResult(_0x353f6d,null))[_0x2760('0x47')](handleError(_0x353f6d,null));};exports['destroy']=function(_0x8c2f61,_0x4cf964){return db[_0x2760('0x2f')]['find']({'where':{'id':_0x8c2f61[_0x2760('0x5a')]['id']}})[_0x2760('0x24')](handleEntityNotFound(_0x4cf964,null))['then'](removeEntity(_0x4cf964,null))['catch'](handleError(_0x4cf964,null));};exports['getSessions']=function(_0x5db93d,_0x3263e9,_0x38717c){var _0x1892aa={'raw':!![],'where':{}};var _0x17006d={};var _0x5ca0af={'count':0x0,'rows':[]};return db[_0x2760('0x2f')][_0x2760('0x5b')]({'where':{'id':_0x5db93d[_0x2760('0x5a')]['id']}})[_0x2760('0x24')](handleEntityNotFound(_0x3263e9,null))['then'](function(_0x44657e){if(_0x44657e){_0x17006d['model']=_['keys'](db[_0x2760('0x5c')][_0x2760('0x30')]);_0x17006d[_0x2760('0x35')]=_[_0x2760('0x36')](_0x5db93d[_0x2760('0x35')]);_0x17006d[_0x2760('0x3e')]=_[_0x2760('0x37')](_0x17006d[_0x2760('0x34')],_0x17006d[_0x2760('0x35')]);_0x1892aa[_0x2760('0x38')]=_['intersection'](_0x17006d['model'],qs['fields'](_0x5db93d[_0x2760('0x35')][_0x2760('0x39')]));_0x1892aa[_0x2760('0x38')]=_0x1892aa[_0x2760('0x38')][_0x2760('0x3a')]?_0x1892aa[_0x2760('0x38')]:_0x17006d[_0x2760('0x34')];if(!_0x5db93d[_0x2760('0x35')]['hasOwnProperty']('nolimit')){_0x1892aa['limit']=qs['limit'](_0x5db93d[_0x2760('0x35')][_0x2760('0x1f')]);_0x1892aa[_0x2760('0x1e')]=qs['offset'](_0x5db93d[_0x2760('0x35')][_0x2760('0x1e')]);}_0x1892aa['order']=qs['sort'](_0x5db93d['query'][_0x2760('0x3c')]);_0x1892aa[_0x2760('0x3d')]=qs[_0x2760('0x3e')](_['pick'](_0x5db93d[_0x2760('0x35')],_0x17006d[_0x2760('0x3e')]));_0x1892aa[_0x2760('0x3d')][_0x2760('0x5d')]=_0x44657e['id'];if(_0x5db93d['query'][_0x2760('0x42')]){_0x1892aa[_0x2760('0x3d')]=_[_0x2760('0x40')](_0x1892aa[_0x2760('0x3d')],{'$or':_[_0x2760('0x2e')](_0x1892aa[_0x2760('0x38')],function(_0xe2284){var _0x5e133d={};_0x5e133d[_0xe2284]={'$like':'%'+_0x5db93d[_0x2760('0x35')][_0x2760('0x42')]+'%'};return _0x5e133d;})});}_0x1892aa=_[_0x2760('0x40')]({},_0x1892aa,_0x5db93d[_0x2760('0x43')]);return db[_0x2760('0x5c')][_0x2760('0x1d')]({'where':_0x1892aa[_0x2760('0x3d')]})[_0x2760('0x24')](function(_0x49d55d){_0x5ca0af[_0x2760('0x1d')]=_0x49d55d;if(_0x5db93d[_0x2760('0x35')][_0x2760('0x49')]){_0x1892aa['include']=[{'all':!![]}];}return db[_0x2760('0x5c')]['findAll'](_0x1892aa);})[_0x2760('0x24')](function(_0x378bf7){_0x5ca0af['rows']=_0x378bf7;return _0x5ca0af;});}})[_0x2760('0x24')](respondWithFilteredResult(_0x3263e9,_0x1892aa))[_0x2760('0x47')](handleError(_0x3263e9,null));};exports[_0x2760('0x5e')]=function(_0x5f581b,_0x12e0c4,_0x543aa0){var _0x491b18={'raw':!![],'where':{}};var _0x3a4681={};var _0x46ea71={'count':0x0,'rows':[]};return db[_0x2760('0x2f')][_0x2760('0x5b')]({'where':{'id':_0x5f581b['params']['id']}})[_0x2760('0x24')](handleEntityNotFound(_0x12e0c4,null))[_0x2760('0x24')](function(_0x569f83){if(_0x569f83){_0x3a4681[_0x2760('0x34')]=_['keys'](db[_0x2760('0x5f')][_0x2760('0x30')]);_0x3a4681[_0x2760('0x35')]=_[_0x2760('0x36')](_0x5f581b['query']);_0x3a4681[_0x2760('0x3e')]=_[_0x2760('0x37')](_0x3a4681[_0x2760('0x34')],_0x3a4681['query']);_0x491b18[_0x2760('0x38')]=_[_0x2760('0x37')](_0x3a4681[_0x2760('0x34')],qs[_0x2760('0x39')](_0x5f581b[_0x2760('0x35')]['fields']));_0x491b18[_0x2760('0x38')]=_0x491b18[_0x2760('0x38')][_0x2760('0x3a')]?_0x491b18[_0x2760('0x38')]:_0x3a4681[_0x2760('0x34')];if(!_0x5f581b['query']['hasOwnProperty'](_0x2760('0x60'))){_0x491b18['limit']=qs['limit'](_0x5f581b[_0x2760('0x35')][_0x2760('0x1f')]);_0x491b18[_0x2760('0x1e')]=qs[_0x2760('0x1e')](_0x5f581b[_0x2760('0x35')]['offset']);}_0x491b18[_0x2760('0x61')]=qs[_0x2760('0x3c')](_0x5f581b['query'][_0x2760('0x3c')]);_0x491b18[_0x2760('0x3d')]=qs[_0x2760('0x3e')](_[_0x2760('0x3f')](_0x5f581b[_0x2760('0x35')],_0x3a4681[_0x2760('0x3e')]));_0x491b18['where'][_0x2760('0x5d')]=_0x569f83['id'];if(_0x5f581b[_0x2760('0x35')]['filter']){_0x491b18[_0x2760('0x3d')]=_[_0x2760('0x40')](_0x491b18['where'],{'$or':_[_0x2760('0x2e')](_0x491b18[_0x2760('0x38')],function(_0x5d06d0){var _0x472a88={};_0x472a88[_0x5d06d0]={'$like':'%'+_0x5f581b['query'][_0x2760('0x42')]+'%'};return _0x472a88;})});}_0x491b18=_[_0x2760('0x40')]({},_0x491b18,_0x5f581b[_0x2760('0x43')]);return db[_0x2760('0x5f')][_0x2760('0x1d')]({'where':_0x491b18[_0x2760('0x3d')]})[_0x2760('0x24')](function(_0x2aeb56){_0x46ea71[_0x2760('0x1d')]=_0x2aeb56;if(_0x5f581b[_0x2760('0x35')][_0x2760('0x49')]){_0x491b18[_0x2760('0x44')]=[{'all':!![]}];}return db[_0x2760('0x5f')]['findAll'](_0x491b18);})[_0x2760('0x24')](function(_0xa718ae){_0x46ea71[_0x2760('0x46')]=_0xa718ae;return _0x46ea71;});}})[_0x2760('0x24')](respondWithFilteredResult(_0x12e0c4,_0x491b18))['catch'](handleError(_0x12e0c4,null));};function char(_0x569331){return'number'===typeof _0x569331?String[_0x2760('0x62')][_0x2760('0x21')](null,arguments):_0x569331;}function needsEncapsulation(_0x4de724){return!!_0x4de724&&(_0x4de724[_0x2760('0x63')]()['indexOf'](char(0xd))>=0x0||_0x4de724[_0x2760('0x63')]()['indexOf'](char(0xa))>=0x0||_0x4de724[_0x2760('0x63')]()[_0x2760('0x64')](char(0x2c))>=0x0||_0x4de724[_0x2760('0x63')]()[_0x2760('0x64')](char(0x22))>=0x0);}function encapsulate(_0xe60f36){var _0x4bd171=char(0x22),_0x179e37='\x5c'+char(0x22),_0x216849=_0xe60f36['toString']()[_0x2760('0x65')](new RegExp(_0x4bd171,'g'),_0x179e37);return _0x4bd171+_0x216849+_0x4bd171;}exports[_0x2760('0x66')]=function(_0x337217,_0x401951,_0x28484c){var _0x167b33,_0x121774;var _0x2bce76={'where':{'ProjectId':_0x337217['params']['id']}};if(_0x337217[_0x2760('0x35')][_0x2760('0x67')]){_0x2bce76[_0x2760('0x3d')][_0x2760('0x68')]=JSON[_0x2760('0x69')](_0x337217[_0x2760('0x35')][_0x2760('0x67')]);}return db[_0x2760('0x5c')]['findAll'](_0x2bce76)[_0x2760('0x24')](handleEntityNotFound(_0x401951,null))['then'](function(_0x5578a8){if(_0x5578a8){_0x167b33=_0x5578a8;return db[_0x2760('0x6a')][_0x2760('0x45')]({'where':{'SessionId':{'$in':_[_0x2760('0x2e')](_0x167b33,'id')},'ProjectId':_0x337217[_0x2760('0x5a')]['id']},'order':'-createdAt'});}})[_0x2760('0x24')](handleEntityNotFound(_0x401951,null))[_0x2760('0x24')](function(_0x5d03ce){if(_0x5d03ce){_0x121774=_0x5d03ce;var _0x3a07d9={};for(var _0x47c95d=0x0,_0xfb6320=_0x121774[_0x2760('0x3a')];_0x47c95d<_0xfb6320;_0x47c95d++){if(!_0x3a07d9[_0x2760('0x3b')](_0x121774[_0x47c95d][_0x2760('0x6b')])){_0x3a07d9[_0x121774[_0x47c95d]['questionId']]=needsEncapsulation(_0x121774[_0x47c95d][_0x2760('0x6c')])?encapsulate(_0x121774[_0x47c95d]['question']):_0x121774[_0x47c95d][_0x2760('0x6c')];}}var _0x2f532e=[],_0x43a7b={};for(var _0x55bb12=0x0,_0x1ed668=_0x167b33[_0x2760('0x3a')];_0x55bb12<_0x1ed668;_0x55bb12++){_0x43a7b={'ProjectId':_0x337217['params']['id'],'SessionId':_0x167b33[_0x55bb12]['id'],'StartTime':moment(_0x167b33[_0x55bb12][_0x2760('0x68')])[_0x2760('0x6d')](_0x2760('0x6e'))};for(var _0x540a86=0x0,_0x4fc806=_0x121774[_0x2760('0x3a')];_0x540a86<_0x4fc806;_0x540a86++){if(_0x121774[_0x540a86][_0x2760('0x6f')]==_0x167b33[_0x55bb12]['id']&&_0x3a07d9[_0x2760('0x3b')](_0x121774[_0x540a86][_0x2760('0x6b')])){_0x43a7b[_0x3a07d9[_0x121774[_0x540a86]['questionId']]]=_0x121774[_0x540a86][_0x2760('0x70')];}}for(var _0x32f22e in _0x3a07d9){if(!_0x43a7b['hasOwnProperty'](_0x3a07d9[_0x32f22e])){_0x43a7b[_0x3a07d9[_0x32f22e]]=null;}}_0x2f532e[_0x2760('0x71')](_0x43a7b);}return _0x2f532e;}})[_0x2760('0x24')](function(_0x48609a){if(!_['isEmpty'](_0x48609a)){var _0x2c2ff9=toCsv(_0x48609a);var _0x23431d=Date[_0x2760('0x72')]();fs['writeFileSync'](util['format'](_0x2760('0x73'),_0x337217[_0x2760('0x5a')]['id'],_0x23431d),_0x2c2ff9);_0x401951['setHeader'](_0x2760('0x74'),_0x2760('0x75')+util[_0x2760('0x6d')]('Jscripty_Project_%d_Summary_%s.csv',_0x337217[_0x2760('0x5a')]['id'],_0x23431d));_0x401951['setHeader'](_0x2760('0x76'),_0x2760('0x77'));return _0x401951[_0x2760('0x78')](util[_0x2760('0x6d')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x337217[_0x2760('0x5a')]['id'],_0x23431d));}else{return _0x401951[_0x2760('0x28')](0xcc);}})[_0x2760('0x47')](handleError(_0x401951,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 2677ea8..c5a6fc7 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 _0x50b2=['request-promise','../../config/environment','./jscriptyProject.attributes','define','jscripty_projects','util','moment','bluebird'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x50b2,0x9d));var _0x250b=function(_0x23e3b0,_0x5f2901){_0x23e3b0=_0x23e3b0-0x0;var _0x13c675=_0x50b2[_0x23e3b0];return _0x13c675;};'use strict';var _=require('lodash');var util=require(_0x250b('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x250b('0x1'));var BPromise=require(_0x250b('0x2'));var rp=require(_0x250b('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x250b('0x4'));var attributes=require(_0x250b('0x5'));module['exports']=function(_0x366242,_0x80961f){return _0x366242[_0x250b('0x6')]('JscriptyProject',attributes,{'tableName':_0x250b('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x78ec=['bluebird','request-promise','path','rimraf','./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects','../../config/logger','api'];(function(_0x1529a3,_0x529f63){var _0x1a0d4b=function(_0x6f1058){while(--_0x6f1058){_0x1529a3['push'](_0x1529a3['shift']());}};_0x1a0d4b(++_0x529f63);}(_0x78ec,0xda));var _0xc78e=function(_0x26ec80,_0x39090b){_0x26ec80=_0x26ec80-0x0;var _0x1d38e0=_0x78ec[_0x26ec80];return _0x1d38e0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc78e('0x0'))(_0xc78e('0x1'));var moment=require('moment');var BPromise=require(_0xc78e('0x2'));var rp=require(_0xc78e('0x3'));var fs=require('fs');var path=require(_0xc78e('0x4'));var rimraf=require(_0xc78e('0x5'));var config=require('../../config/environment');var attributes=require(_0xc78e('0x6'));module[_0xc78e('0x7')]=function(_0x3fce36,_0x2db52b){return _0x3fce36[_0xc78e('0x8')](_0xc78e('0x9'),attributes,{'tableName':_0xc78e('0xa'),'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 9cfc6f6..cf004e6 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 _0x10cf=['../../config/utils','rpc','jayson/promise','http','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','error','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x138c06,_0x218141){var _0x265391=function(_0x1b3900){while(--_0x1b3900){_0x138c06['push'](_0x138c06['shift']());}};_0x265391(++_0x218141);}(_0x10cf,0xf7));var _0xf10c=function(_0x99b276,_0x4c290a){_0x99b276=_0x99b276-0x0;var _0x54e03e=_0x10cf[_0x99b276];return _0x54e03e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf10c('0x0'));var BPromise=require(_0xf10c('0x1'));var rs=require(_0xf10c('0x2'));var fs=require('fs');var Redis=require(_0xf10c('0x3'));var db=require(_0xf10c('0x4'))['db'];var utils=require(_0xf10c('0x5'));var logger=require('../../config/logger')(_0xf10c('0x6'));var config=require('../../config/environment');var jayson=require(_0xf10c('0x7'));var client=jayson['client'][_0xf10c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5e80d7,_0xef836,_0x4d8354){return new BPromise(function(_0x45fe03,_0x954de4){return client['request'](_0x5e80d7,_0x4d8354)[_0xf10c('0x9')](function(_0x4c0e4e){logger[_0xf10c('0xa')](_0xf10c('0xb'),_0xef836,_0xf10c('0xc'));logger[_0xf10c('0xd')](_0xf10c('0xe'),_0xef836,'request\x20sent',JSON['stringify'](_0x4c0e4e));if(_0x4c0e4e['error']){if(_0x4c0e4e[_0xf10c('0xf')]['code']===0x1f4){logger[_0xf10c('0xf')](_0xf10c('0xb'),_0xef836,_0x4c0e4e[_0xf10c('0xf')][_0xf10c('0x10')]);return _0x954de4(_0x4c0e4e['error'][_0xf10c('0x10')]);}logger[_0xf10c('0xf')](_0xf10c('0xb'),_0xef836,_0x4c0e4e[_0xf10c('0xf')][_0xf10c('0x10')]);return _0x45fe03(_0x4c0e4e[_0xf10c('0xf')][_0xf10c('0x10')]);}else{logger[_0xf10c('0xa')](_0xf10c('0xb'),_0xef836,'request\x20sent');_0x45fe03(_0x4c0e4e[_0xf10c('0x11')]['message']);}})['catch'](function(_0x6d6e3){logger[_0xf10c('0xf')](_0xf10c('0xb'),_0xef836,_0x6d6e3);_0x954de4(_0x6d6e3);});});} \ No newline at end of file +var _0x958a=['catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','jayson/promise','client','http','request','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x25f1c8,_0x53aa8e){var _0x9e72dd=function(_0x57c1c2){while(--_0x57c1c2){_0x25f1c8['push'](_0x25f1c8['shift']());}};_0x9e72dd(++_0x53aa8e);}(_0x958a,0xa9));var _0xa958=function(_0xa18587,_0x7e58fe){_0xa18587=_0xa18587-0x0;var _0x4d85a7=_0x958a[_0xa18587];return _0x4d85a7;};'use strict';var _=require(_0xa958('0x0'));var util=require(_0xa958('0x1'));var moment=require(_0xa958('0x2'));var BPromise=require('bluebird');var rs=require(_0xa958('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa958('0x4'));var logger=require(_0xa958('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa958('0x6'));var client=jayson[_0xa958('0x7')][_0xa958('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xda265,_0x57e9e0,_0xd27884){return new BPromise(function(_0x527abb,_0x1c05da){return client[_0xa958('0x9')](_0xda265,_0xd27884)['then'](function(_0x210ad8){logger['info'](_0xa958('0xa'),_0x57e9e0,_0xa958('0xb'));logger[_0xa958('0xc')](_0xa958('0xd'),_0x57e9e0,_0xa958('0xb'),JSON[_0xa958('0xe')](_0x210ad8));if(_0x210ad8[_0xa958('0xf')]){if(_0x210ad8[_0xa958('0xf')][_0xa958('0x10')]===0x1f4){logger['error'](_0xa958('0xa'),_0x57e9e0,_0x210ad8[_0xa958('0xf')][_0xa958('0x11')]);return _0x1c05da(_0x210ad8[_0xa958('0xf')]['message']);}logger[_0xa958('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x57e9e0,_0x210ad8['error'][_0xa958('0x11')]);return _0x527abb(_0x210ad8[_0xa958('0xf')][_0xa958('0x11')]);}else{logger[_0xa958('0x12')](_0xa958('0xa'),_0x57e9e0,_0xa958('0xb'));_0x527abb(_0x210ad8[_0xa958('0x13')][_0xa958('0x11')]);}})[_0xa958('0x14')](function(_0x3ad052){logger[_0xa958('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x57e9e0,_0x3ad052);_0x1c05da(_0x3ad052);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 8d76c3d..f25c7d2 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 _0x16f4=['express','../../components/interaction/service','./jscriptyQuestionReport.controller','get','index','describe','create','put','isAuthenticated','delete','/:id','exports','multer','util','connect-timeout'];(function(_0x4e2823,_0x384753){var _0x3f7c5e=function(_0x42aa76){while(--_0x42aa76){_0x4e2823['push'](_0x4e2823['shift']());}};_0x3f7c5e(++_0x384753);}(_0x16f4,0xcf));var _0x416f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x16f4[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x416f('0x0'));var util=require(_0x416f('0x1'));var path=require('path');var timeout=require(_0x416f('0x2'));var express=require(_0x416f('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x416f('0x4'));var config=require('../../config/environment');var controller=require(_0x416f('0x5'));router[_0x416f('0x6')]('/',auth['isAuthenticated'](),controller[_0x416f('0x7')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x416f('0x8')]);router[_0x416f('0x6')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x416f('0x9')]);router[_0x416f('0xa')]('/:id',auth[_0x416f('0xb')](),controller['update']);router[_0x416f('0xc')](_0x416f('0xd'),auth[_0x416f('0xb')](),controller['destroy']);module[_0x416f('0xe')]=router; \ No newline at end of file +var _0xd29c=['get','isAuthenticated','describe','/:id','show','post','create','put','update','delete','util','path','Router','../../components/auth/service','../../config/environment','./jscriptyQuestionReport.controller','index'];(function(_0x3bcab6,_0x2bdd04){var _0x2c6162=function(_0x37e6db){while(--_0x37e6db){_0x3bcab6['push'](_0x3bcab6['shift']());}};_0x2c6162(++_0x2bdd04);}(_0xd29c,0x13c));var _0xcd29=function(_0x693462,_0x1b7847){_0x693462=_0x693462-0x0;var _0x5a6519=_0xd29c[_0x693462];return _0x5a6519;};'use strict';var multer=require('multer');var util=require(_0xcd29('0x0'));var path=require(_0xcd29('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xcd29('0x2')]();var auth=require(_0xcd29('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xcd29('0x4'));var controller=require(_0xcd29('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xcd29('0x6')]);router[_0xcd29('0x7')]('/describe',auth[_0xcd29('0x8')](),controller[_0xcd29('0x9')]);router[_0xcd29('0x7')](_0xcd29('0xa'),auth['isAuthenticated'](),controller[_0xcd29('0xb')]);router[_0xcd29('0xc')]('/',auth[_0xcd29('0x8')](),controller[_0xcd29('0xd')]);router[_0xcd29('0xe')](_0xcd29('0xa'),auth['isAuthenticated'](),controller[_0xcd29('0xf')]);router[_0xcd29('0x10')](_0xcd29('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index ce96748..71887fe 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 _0x0bd2=['TEXT','long','sequelize','exports','STRING'];(function(_0x2d432f,_0x26916d){var _0x2003b8=function(_0x15af43){while(--_0x15af43){_0x2d432f['push'](_0x2d432f['shift']());}};_0x2003b8(++_0x26916d);}(_0x0bd2,0xd4));var _0x20bd=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0x0bd2[_0x455c6c];return _0x488242;};'use strict';var Sequelize=require(_0x20bd('0x0'));module[_0x20bd('0x1')]={'question':{'type':Sequelize[_0x20bd('0x2')]},'answer':{'type':Sequelize[_0x20bd('0x3')](_0x20bd('0x4'))},'membername':{'type':Sequelize[_0x20bd('0x2')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x20bd('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x20bd('0x2')]},'calleridnum':{'type':Sequelize[_0x20bd('0x2')]},'questionId':{'type':Sequelize[_0x20bd('0x2')]}}; \ No newline at end of file +var _0x826c=['long','STRING','sequelize','exports','TEXT'];(function(_0x52ea9c,_0x2e4bae){var _0x311d92=function(_0x8c11e0){while(--_0x8c11e0){_0x52ea9c['push'](_0x52ea9c['shift']());}};_0x311d92(++_0x2e4bae);}(_0x826c,0x110));var _0xc826=function(_0x5a1873,_0x478144){_0x5a1873=_0x5a1873-0x0;var _0x9055b9=_0x826c[_0x5a1873];return _0x9055b9;};'use strict';var Sequelize=require(_0xc826('0x0'));module[_0xc826('0x1')]={'question':{'type':Sequelize['STRING']},'answer':{'type':Sequelize[_0xc826('0x2')](_0xc826('0x3'))},'membername':{'type':Sequelize[_0xc826('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xc826('0x4')]},'uniqueid':{'type':Sequelize[_0xc826('0x4')]},'calleridname':{'type':Sequelize[_0xc826('0x4')]},'calleridnum':{'type':Sequelize[_0xc826('0x4')]},'questionId':{'type':Sequelize[_0xc826('0x4')]}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index 24660a4..1c8b877 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 _0x15e2=['lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','error','stack','name','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','findAll','rows','catch','params','keys','length','includeAll','include','find','create','body','describe','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x15e2,0xc9));var _0x215e=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0x15e2[_0x3ea913];return _0x2b4f28;};'use strict';var pdf=require(_0x215e('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x215e('0x1'));var jsonpatch=require(_0x215e('0x2'));var rp=require(_0x215e('0x3'));var moment=require(_0x215e('0x4'));var BPromise=require(_0x215e('0x5'));var Mustache=require('mustache');var util=require(_0x215e('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x215e('0x7'));var ejs=require(_0x215e('0x8'));var fs=require('fs');var _=require(_0x215e('0x9'));var squel=require(_0x215e('0xa'));var crypto=require('crypto');var jsforce=require(_0x215e('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x215e('0x7'));var querystring=require(_0x215e('0xc'));var Papa=require(_0x215e('0xd'));var Redis=require(_0x215e('0xe'));var authService=require(_0x215e('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x215e('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x215e('0x11'))('api');var utils=require(_0x215e('0x12'));var config=require(_0x215e('0x13'));var db=require(_0x215e('0x14'))['db'];function respondWithStatusCode(_0x4fdb74,_0x385398){_0x385398=_0x385398||0xcc;return function(_0x3c82ff){if(_0x3c82ff){return _0x4fdb74[_0x215e('0x15')](_0x385398);}return _0x4fdb74[_0x215e('0x16')](_0x385398)[_0x215e('0x17')]();};}function respondWithResult(_0x372be0,_0x4bf901){_0x4bf901=_0x4bf901||0xc8;return function(_0x13c06b){if(_0x13c06b){return _0x372be0[_0x215e('0x16')](_0x4bf901)[_0x215e('0x18')](_0x13c06b);}};}function respondWithFilteredResult(_0x46448a,_0x1cde76){return function(_0x221277){if(_0x221277){var _0x83fbdc=_0x221277[_0x215e('0x19')],_0x3143b7=_0x1cde76[_0x215e('0x1a')],_0x2c846d=_0x1cde76[_0x215e('0x1a')]+_0x1cde76[_0x215e('0x1b')],_0x3eb7dd;if(_0x2c846d>=_0x83fbdc){_0x2c846d=_0x83fbdc;_0x3eb7dd=0xc8;}else{_0x3eb7dd=0xce;}_0x46448a['status'](_0x3eb7dd);return _0x46448a[_0x215e('0x1c')]('Content-Range',_0x3143b7+'-'+_0x2c846d+'/'+_0x83fbdc)['json'](_0x221277);}return null;};}function patchUpdates(_0x46c11e){return function(_0x48cec4){try{jsonpatch[_0x215e('0x1d')](_0x48cec4,_0x46c11e,!![]);}catch(_0x4fff2f){return BPromise[_0x215e('0x1e')](_0x4fff2f);}return _0x48cec4[_0x215e('0x1f')]();};}function saveUpdates(_0xea067d,_0x20882d){return function(_0x23e95f){if(_0x23e95f){return _0x23e95f[_0x215e('0x20')](_0xea067d)[_0x215e('0x21')](function(_0x2e1e6d){return _0x2e1e6d;});}return null;};}function removeEntity(_0x175e04,_0x2a58be){return function(_0xd44b0a){if(_0xd44b0a){return _0xd44b0a[_0x215e('0x22')]()[_0x215e('0x21')](function(){_0x175e04[_0x215e('0x16')](0xcc)[_0x215e('0x17')]();});}};}function handleEntityNotFound(_0x4bdb27,_0xff02c2){return function(_0x3a52a7){if(!_0x3a52a7){_0x4bdb27['sendStatus'](0x194);}return _0x3a52a7;};}function handleError(_0x4dcfcf,_0x3f6906){_0x3f6906=_0x3f6906||0x1f4;return function(_0x9d395f){logger[_0x215e('0x23')](_0x9d395f[_0x215e('0x24')]);if(_0x9d395f[_0x215e('0x25')]){delete _0x9d395f['name'];}_0x4dcfcf[_0x215e('0x16')](_0x3f6906)['send'](_0x9d395f);};}exports['index']=function(_0x8d8322,_0x494744){var _0x3f6d67={},_0x5760a0={},_0x377ba6={'count':0x0,'rows':[]};var _0x2aadf8=_[_0x215e('0x26')](db[_0x215e('0x27')][_0x215e('0x28')],function(_0x1ff46c){return{'name':_0x1ff46c[_0x215e('0x29')],'type':_0x1ff46c[_0x215e('0x2a')][_0x215e('0x2b')]};});_0x5760a0['model']=_[_0x215e('0x26')](_0x2aadf8,_0x215e('0x25'));_0x5760a0[_0x215e('0x2c')]=_['keys'](_0x8d8322[_0x215e('0x2c')]);_0x5760a0[_0x215e('0x2d')]=_[_0x215e('0x2e')](_0x5760a0[_0x215e('0x2f')],_0x5760a0[_0x215e('0x2c')]);_0x3f6d67[_0x215e('0x30')]=_[_0x215e('0x2e')](_0x5760a0[_0x215e('0x2f')],qs['fields'](_0x8d8322[_0x215e('0x2c')][_0x215e('0x31')]));_0x3f6d67['attributes']=_0x3f6d67[_0x215e('0x30')]['length']?_0x3f6d67[_0x215e('0x30')]:_0x5760a0[_0x215e('0x2f')];if(!_0x8d8322[_0x215e('0x2c')]['hasOwnProperty'](_0x215e('0x32'))){_0x3f6d67[_0x215e('0x1b')]=qs[_0x215e('0x1b')](_0x8d8322['query'][_0x215e('0x1b')]);_0x3f6d67[_0x215e('0x1a')]=qs[_0x215e('0x1a')](_0x8d8322[_0x215e('0x2c')][_0x215e('0x1a')]);}_0x3f6d67['order']=qs[_0x215e('0x33')](_0x8d8322[_0x215e('0x2c')][_0x215e('0x33')]);_0x3f6d67[_0x215e('0x34')]=qs[_0x215e('0x2d')](_[_0x215e('0x35')](_0x8d8322[_0x215e('0x2c')],_0x5760a0[_0x215e('0x2d')]));if(_0x8d8322['query'][_0x215e('0x36')]){_0x3f6d67[_0x215e('0x34')]=_['merge'](_0x3f6d67[_0x215e('0x34')],{'$or':_['map'](_0x2aadf8,function(_0x147ca0){if(_0x147ca0[_0x215e('0x2a')]!==_0x215e('0x37')){var _0x1cc560={};_0x1cc560[_0x147ca0[_0x215e('0x25')]]={'$like':'%'+_0x8d8322['query'][_0x215e('0x36')]+'%'};return _0x1cc560;}})});}_0x3f6d67=_[_0x215e('0x38')]({},_0x3f6d67,_0x8d8322[_0x215e('0x39')]);var _0x55028a={'where':_0x3f6d67['where']};return db[_0x215e('0x27')][_0x215e('0x19')](_0x55028a)[_0x215e('0x21')](function(_0x37a851){_0x377ba6[_0x215e('0x19')]=_0x37a851;if(_0x8d8322[_0x215e('0x2c')]['includeAll']){_0x3f6d67['include']=[{'all':!![]}];}return db[_0x215e('0x27')][_0x215e('0x3a')](_0x3f6d67);})[_0x215e('0x21')](function(_0x1e2d02){_0x377ba6[_0x215e('0x3b')]=_0x1e2d02;return _0x377ba6;})[_0x215e('0x21')](respondWithFilteredResult(_0x494744,_0x3f6d67))[_0x215e('0x3c')](handleError(_0x494744,null));};exports['show']=function(_0x16584a,_0x365c30){var _0x3a1817={'raw':!![],'where':{'id':_0x16584a[_0x215e('0x3d')]['id']}},_0xa07480={};_0xa07480[_0x215e('0x2f')]=_['keys'](db['JscriptyQuestionReport']['rawAttributes']);_0xa07480[_0x215e('0x2c')]=_[_0x215e('0x3e')](_0x16584a[_0x215e('0x2c')]);_0xa07480['filters']=_[_0x215e('0x2e')](_0xa07480[_0x215e('0x2f')],_0xa07480[_0x215e('0x2c')]);_0x3a1817[_0x215e('0x30')]=_[_0x215e('0x2e')](_0xa07480[_0x215e('0x2f')],qs[_0x215e('0x31')](_0x16584a[_0x215e('0x2c')][_0x215e('0x31')]));_0x3a1817[_0x215e('0x30')]=_0x3a1817['attributes'][_0x215e('0x3f')]?_0x3a1817[_0x215e('0x30')]:_0xa07480[_0x215e('0x2f')];if(_0x16584a[_0x215e('0x2c')][_0x215e('0x40')]){_0x3a1817[_0x215e('0x41')]=[{'all':!![]}];}_0x3a1817=_[_0x215e('0x38')]({},_0x3a1817,_0x16584a[_0x215e('0x39')]);return db['JscriptyQuestionReport'][_0x215e('0x42')](_0x3a1817)[_0x215e('0x21')](handleEntityNotFound(_0x365c30,null))[_0x215e('0x21')](respondWithResult(_0x365c30,null))[_0x215e('0x3c')](handleError(_0x365c30,null));};exports[_0x215e('0x43')]=function(_0x3d5f28,_0x57bddc){return db[_0x215e('0x27')][_0x215e('0x43')](_0x3d5f28[_0x215e('0x44')],{})[_0x215e('0x21')](respondWithResult(_0x57bddc,0xc9))['catch'](handleError(_0x57bddc,null));};exports[_0x215e('0x20')]=function(_0x3d8920,_0x31a345){if(_0x3d8920['body']['id']){delete _0x3d8920[_0x215e('0x44')]['id'];}return db[_0x215e('0x27')][_0x215e('0x42')]({'where':{'id':_0x3d8920[_0x215e('0x3d')]['id']}})[_0x215e('0x21')](handleEntityNotFound(_0x31a345,null))[_0x215e('0x21')](saveUpdates(_0x3d8920['body'],null))[_0x215e('0x21')](respondWithResult(_0x31a345,null))[_0x215e('0x3c')](handleError(_0x31a345,null));};exports[_0x215e('0x22')]=function(_0x3774bd,_0x575679){return db[_0x215e('0x27')][_0x215e('0x42')]({'where':{'id':_0x3774bd[_0x215e('0x3d')]['id']}})[_0x215e('0x21')](handleEntityNotFound(_0x575679,null))[_0x215e('0x21')](removeEntity(_0x575679,null))[_0x215e('0x3c')](handleError(_0x575679,null));};exports[_0x215e('0x45')]=function(_0x4b7d79,_0x4473fe){return db[_0x215e('0x27')][_0x215e('0x45')]()[_0x215e('0x21')](respondWithResult(_0x4473fe,null))[_0x215e('0x3c')](handleError(_0x4473fe,null));}; \ No newline at end of file +var _0xa3a5=['create','body','params','describe','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','limit','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','JscriptyQuestionReport','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filter','where','merge','type','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','find'];(function(_0x242a4f,_0x369c57){var _0x122117=function(_0x55a797){while(--_0x55a797){_0x242a4f['push'](_0x242a4f['shift']());}};_0x122117(++_0x369c57);}(_0xa3a5,0x1c0));var _0x5a3a=function(_0x3df131,_0x24b1f5){_0x3df131=_0x3df131-0x0;var _0x53fa49=_0xa3a5[_0x3df131];return _0x53fa49;};'use strict';var pdf=require(_0x5a3a('0x0'));var emlformat=require(_0x5a3a('0x1'));var rimraf=require(_0x5a3a('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5a3a('0x3'));var rp=require('request-promise');var moment=require(_0x5a3a('0x4'));var BPromise=require(_0x5a3a('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5a3a('0x6'));var sox=require(_0x5a3a('0x7'));var csv=require('to-csv');var ejs=require(_0x5a3a('0x8'));var fs=require('fs');var _=require(_0x5a3a('0x9'));var squel=require(_0x5a3a('0xa'));var crypto=require(_0x5a3a('0xb'));var jsforce=require(_0x5a3a('0xc'));var deskjs=require(_0x5a3a('0xd'));var toCsv=require(_0x5a3a('0xe'));var querystring=require(_0x5a3a('0xf'));var Papa=require('papaparse');var Redis=require(_0x5a3a('0x10'));var authService=require(_0x5a3a('0x11'));var qs=require(_0x5a3a('0x12'));var as=require(_0x5a3a('0x13'));var hardwareService=require(_0x5a3a('0x14'));var logger=require('../../config/logger')(_0x5a3a('0x15'));var utils=require(_0x5a3a('0x16'));var config=require(_0x5a3a('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d9003,_0x10bcb3){_0x10bcb3=_0x10bcb3||0xcc;return function(_0x17ab1b){if(_0x17ab1b){return _0x1d9003[_0x5a3a('0x18')](_0x10bcb3);}return _0x1d9003['status'](_0x10bcb3)[_0x5a3a('0x19')]();};}function respondWithResult(_0x403f1f,_0x43b794){_0x43b794=_0x43b794||0xc8;return function(_0x3d6fc8){if(_0x3d6fc8){return _0x403f1f[_0x5a3a('0x1a')](_0x43b794)[_0x5a3a('0x1b')](_0x3d6fc8);}};}function respondWithFilteredResult(_0x244110,_0x5ad14b){return function(_0x25ccb6){if(_0x25ccb6){var _0x3db510=_0x25ccb6['count'],_0x203ceb=_0x5ad14b[_0x5a3a('0x1c')],_0x47eb73=_0x5ad14b['offset']+_0x5ad14b[_0x5a3a('0x1d')],_0x2e7552;if(_0x47eb73>=_0x3db510){_0x47eb73=_0x3db510;_0x2e7552=0xc8;}else{_0x2e7552=0xce;}_0x244110[_0x5a3a('0x1a')](_0x2e7552);return _0x244110[_0x5a3a('0x1e')]('Content-Range',_0x203ceb+'-'+_0x47eb73+'/'+_0x3db510)[_0x5a3a('0x1b')](_0x25ccb6);}return null;};}function patchUpdates(_0x16e6ed){return function(_0x4e64c1){try{jsonpatch[_0x5a3a('0x1f')](_0x4e64c1,_0x16e6ed,!![]);}catch(_0xa7ed57){return BPromise[_0x5a3a('0x20')](_0xa7ed57);}return _0x4e64c1[_0x5a3a('0x21')]();};}function saveUpdates(_0x308ccc,_0x382076){return function(_0x53a943){if(_0x53a943){return _0x53a943[_0x5a3a('0x22')](_0x308ccc)[_0x5a3a('0x23')](function(_0x4127f5){return _0x4127f5;});}return null;};}function removeEntity(_0x43ba7c,_0x340805){return function(_0x447313){if(_0x447313){return _0x447313[_0x5a3a('0x24')]()[_0x5a3a('0x23')](function(){_0x43ba7c['status'](0xcc)[_0x5a3a('0x19')]();});}};}function handleEntityNotFound(_0x3f1236,_0x415fea){return function(_0x8894d){if(!_0x8894d){_0x3f1236[_0x5a3a('0x18')](0x194);}return _0x8894d;};}function handleError(_0x276755,_0x59e0c0){_0x59e0c0=_0x59e0c0||0x1f4;return function(_0x3f43af){logger[_0x5a3a('0x25')](_0x3f43af[_0x5a3a('0x26')]);if(_0x3f43af[_0x5a3a('0x27')]){delete _0x3f43af[_0x5a3a('0x27')];}_0x276755[_0x5a3a('0x1a')](_0x59e0c0)[_0x5a3a('0x28')](_0x3f43af);};}exports[_0x5a3a('0x29')]=function(_0x345964,_0x54ba89){var _0x2df7cb={},_0x1b4b90={},_0x5351a9={'count':0x0,'rows':[]};var _0x189f08=_[_0x5a3a('0x2a')](db[_0x5a3a('0x2b')]['rawAttributes'],function(_0x53d865){return{'name':_0x53d865[_0x5a3a('0x2c')],'type':_0x53d865['type'][_0x5a3a('0x2d')]};});_0x1b4b90[_0x5a3a('0x2e')]=_['map'](_0x189f08,_0x5a3a('0x27'));_0x1b4b90[_0x5a3a('0x2f')]=_['keys'](_0x345964[_0x5a3a('0x2f')]);_0x1b4b90[_0x5a3a('0x30')]=_[_0x5a3a('0x31')](_0x1b4b90[_0x5a3a('0x2e')],_0x1b4b90[_0x5a3a('0x2f')]);_0x2df7cb['attributes']=_[_0x5a3a('0x31')](_0x1b4b90['model'],qs['fields'](_0x345964[_0x5a3a('0x2f')][_0x5a3a('0x32')]));_0x2df7cb[_0x5a3a('0x33')]=_0x2df7cb['attributes'][_0x5a3a('0x34')]?_0x2df7cb[_0x5a3a('0x33')]:_0x1b4b90[_0x5a3a('0x2e')];if(!_0x345964[_0x5a3a('0x2f')][_0x5a3a('0x35')](_0x5a3a('0x36'))){_0x2df7cb[_0x5a3a('0x1d')]=qs[_0x5a3a('0x1d')](_0x345964['query'][_0x5a3a('0x1d')]);_0x2df7cb[_0x5a3a('0x1c')]=qs[_0x5a3a('0x1c')](_0x345964[_0x5a3a('0x2f')][_0x5a3a('0x1c')]);}_0x2df7cb['order']=qs[_0x5a3a('0x37')](_0x345964['query'][_0x5a3a('0x37')]);_0x2df7cb['where']=qs[_0x5a3a('0x30')](_['pick'](_0x345964[_0x5a3a('0x2f')],_0x1b4b90[_0x5a3a('0x30')]));if(_0x345964['query'][_0x5a3a('0x38')]){_0x2df7cb[_0x5a3a('0x39')]=_[_0x5a3a('0x3a')](_0x2df7cb[_0x5a3a('0x39')],{'$or':_[_0x5a3a('0x2a')](_0x189f08,function(_0x1008dd){if(_0x1008dd[_0x5a3a('0x3b')]!==_0x5a3a('0x3c')){var _0x12c751={};_0x12c751[_0x1008dd[_0x5a3a('0x27')]]={'$like':'%'+_0x345964[_0x5a3a('0x2f')][_0x5a3a('0x38')]+'%'};return _0x12c751;}})});}_0x2df7cb=_['merge']({},_0x2df7cb,_0x345964[_0x5a3a('0x3d')]);var _0x1b3f31={'where':_0x2df7cb[_0x5a3a('0x39')]};return db[_0x5a3a('0x2b')]['count'](_0x1b3f31)[_0x5a3a('0x23')](function(_0x1b21a6){_0x5351a9[_0x5a3a('0x3e')]=_0x1b21a6;if(_0x345964[_0x5a3a('0x2f')][_0x5a3a('0x3f')]){_0x2df7cb[_0x5a3a('0x40')]=[{'all':!![]}];}return db[_0x5a3a('0x2b')][_0x5a3a('0x41')](_0x2df7cb);})['then'](function(_0x59b1e1){_0x5351a9[_0x5a3a('0x42')]=_0x59b1e1;return _0x5351a9;})['then'](respondWithFilteredResult(_0x54ba89,_0x2df7cb))[_0x5a3a('0x43')](handleError(_0x54ba89,null));};exports[_0x5a3a('0x44')]=function(_0x3d4c63,_0x4ef296){var _0x2f29bd={'raw':!![],'where':{'id':_0x3d4c63['params']['id']}},_0x9327d7={};_0x9327d7[_0x5a3a('0x2e')]=_['keys'](db[_0x5a3a('0x2b')]['rawAttributes']);_0x9327d7['query']=_['keys'](_0x3d4c63[_0x5a3a('0x2f')]);_0x9327d7[_0x5a3a('0x30')]=_[_0x5a3a('0x31')](_0x9327d7[_0x5a3a('0x2e')],_0x9327d7['query']);_0x2f29bd[_0x5a3a('0x33')]=_[_0x5a3a('0x31')](_0x9327d7['model'],qs[_0x5a3a('0x32')](_0x3d4c63[_0x5a3a('0x2f')]['fields']));_0x2f29bd[_0x5a3a('0x33')]=_0x2f29bd['attributes'][_0x5a3a('0x34')]?_0x2f29bd[_0x5a3a('0x33')]:_0x9327d7['model'];if(_0x3d4c63['query'][_0x5a3a('0x3f')]){_0x2f29bd[_0x5a3a('0x40')]=[{'all':!![]}];}_0x2f29bd=_[_0x5a3a('0x3a')]({},_0x2f29bd,_0x3d4c63[_0x5a3a('0x3d')]);return db['JscriptyQuestionReport'][_0x5a3a('0x45')](_0x2f29bd)['then'](handleEntityNotFound(_0x4ef296,null))[_0x5a3a('0x23')](respondWithResult(_0x4ef296,null))[_0x5a3a('0x43')](handleError(_0x4ef296,null));};exports[_0x5a3a('0x46')]=function(_0x17d5ac,_0xdb5a45){return db['JscriptyQuestionReport'][_0x5a3a('0x46')](_0x17d5ac[_0x5a3a('0x47')],{})[_0x5a3a('0x23')](respondWithResult(_0xdb5a45,0xc9))['catch'](handleError(_0xdb5a45,null));};exports[_0x5a3a('0x22')]=function(_0x3201a5,_0x37dd9c){if(_0x3201a5[_0x5a3a('0x47')]['id']){delete _0x3201a5[_0x5a3a('0x47')]['id'];}return db[_0x5a3a('0x2b')]['find']({'where':{'id':_0x3201a5['params']['id']}})[_0x5a3a('0x23')](handleEntityNotFound(_0x37dd9c,null))[_0x5a3a('0x23')](saveUpdates(_0x3201a5['body'],null))[_0x5a3a('0x23')](respondWithResult(_0x37dd9c,null))[_0x5a3a('0x43')](handleError(_0x37dd9c,null));};exports[_0x5a3a('0x24')]=function(_0x380248,_0x4bb4d6){return db[_0x5a3a('0x2b')][_0x5a3a('0x45')]({'where':{'id':_0x380248[_0x5a3a('0x48')]['id']}})[_0x5a3a('0x23')](handleEntityNotFound(_0x4bb4d6,null))[_0x5a3a('0x23')](removeEntity(_0x4bb4d6,null))[_0x5a3a('0x43')](handleError(_0x4bb4d6,null));};exports[_0x5a3a('0x49')]=function(_0x3bf1c0,_0x54298f){return db[_0x5a3a('0x2b')]['describe']()['then'](respondWithResult(_0x54298f,null))[_0x5a3a('0x43')](handleError(_0x54298f,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 5e99e8c..43910ee 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 _0x24c1=['define','report_jscripty_questions','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x24c1,0xe6));var _0x124c=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x24c1[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require(_0x124c('0x0'));var logger=require(_0x124c('0x1'))(_0x124c('0x2'));var moment=require(_0x124c('0x3'));var BPromise=require(_0x124c('0x4'));var rp=require(_0x124c('0x5'));var fs=require('fs');var path=require(_0x124c('0x6'));var rimraf=require(_0x124c('0x7'));var config=require(_0x124c('0x8'));var attributes=require(_0x124c('0x9'));module['exports']=function(_0x16c3ac,_0x526735){return _0x16c3ac[_0x124c('0xa')]('JscriptyQuestionReport',attributes,{'tableName':_0x124c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x86cc=['define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./jscriptyQuestionReport.attributes','exports'];(function(_0x17f283,_0x343b6f){var _0x370bc2=function(_0x53a6d7){while(--_0x53a6d7){_0x17f283['push'](_0x17f283['shift']());}};_0x370bc2(++_0x343b6f);}(_0x86cc,0xf1));var _0xc86c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x86cc[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xc86c('0x0'));var util=require(_0xc86c('0x1'));var logger=require(_0xc86c('0x2'))(_0xc86c('0x3'));var moment=require(_0xc86c('0x4'));var BPromise=require(_0xc86c('0x5'));var rp=require(_0xc86c('0x6'));var fs=require('fs');var path=require(_0xc86c('0x7'));var rimraf=require('rimraf');var config=require(_0xc86c('0x8'));var attributes=require(_0xc86c('0x9'));module[_0xc86c('0xa')]=function(_0x39a2a6,_0x306d70){return _0x39a2a6[_0xc86c('0xb')](_0xc86c('0xc'),attributes,{'tableName':_0xc86c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index b1a37b4..45a5aa0 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 _0xa0ba=['error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent'];(function(_0xe5ccf2,_0x59cc14){var _0x321516=function(_0x12275c){while(--_0x12275c){_0xe5ccf2['push'](_0xe5ccf2['shift']());}};_0x321516(++_0x59cc14);}(_0xa0ba,0x145));var _0xaa0b=function(_0x4fe496,_0x1d8673){_0x4fe496=_0x4fe496-0x0;var _0x422b24=_0xa0ba[_0x4fe496];return _0x422b24;};'use strict';var _=require('lodash');var util=require(_0xaa0b('0x0'));var moment=require(_0xaa0b('0x1'));var BPromise=require(_0xaa0b('0x2'));var rs=require(_0xaa0b('0x3'));var fs=require('fs');var Redis=require(_0xaa0b('0x4'));var db=require(_0xaa0b('0x5'))['db'];var utils=require(_0xaa0b('0x6'));var logger=require(_0xaa0b('0x7'))('rpc');var config=require(_0xaa0b('0x8'));var jayson=require(_0xaa0b('0x9'));var client=jayson[_0xaa0b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1493be,_0x4e1c7d,_0x1b07df){return new BPromise(function(_0x2d9b83,_0x54a1af){return client[_0xaa0b('0xb')](_0x1493be,_0x1b07df)['then'](function(_0x5738ae){logger[_0xaa0b('0xc')](_0xaa0b('0xd'),_0x4e1c7d,_0xaa0b('0xe'));logger['debug']('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x4e1c7d,'request\x20sent',JSON['stringify'](_0x5738ae));if(_0x5738ae[_0xaa0b('0xf')]){if(_0x5738ae[_0xaa0b('0xf')][_0xaa0b('0x10')]===0x1f4){logger['error'](_0xaa0b('0xd'),_0x4e1c7d,_0x5738ae[_0xaa0b('0xf')][_0xaa0b('0x11')]);return _0x54a1af(_0x5738ae[_0xaa0b('0xf')][_0xaa0b('0x11')]);}logger[_0xaa0b('0xf')](_0xaa0b('0xd'),_0x4e1c7d,_0x5738ae['error']['message']);return _0x2d9b83(_0x5738ae[_0xaa0b('0xf')][_0xaa0b('0x11')]);}else{logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x4e1c7d,_0xaa0b('0xe'));_0x2d9b83(_0x5738ae[_0xaa0b('0x12')][_0xaa0b('0x11')]);}})[_0xaa0b('0x13')](function(_0x7872e){logger[_0xaa0b('0xf')](_0xaa0b('0xd'),_0x4e1c7d,_0x7872e);_0x54a1af(_0x7872e);});});} \ No newline at end of file +var _0x6a21=['randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x273680,_0x4e236d){var _0x518ee5=function(_0x466de8){while(--_0x466de8){_0x273680['push'](_0x273680['shift']());}};_0x518ee5(++_0x4e236d);}(_0x6a21,0x81));var _0x16a2=function(_0x937712,_0x5c7485){_0x937712=_0x937712-0x0;var _0x203998=_0x6a21[_0x937712];return _0x203998;};'use strict';var _=require(_0x16a2('0x0'));var util=require(_0x16a2('0x1'));var moment=require(_0x16a2('0x2'));var BPromise=require('bluebird');var rs=require(_0x16a2('0x3'));var fs=require('fs');var Redis=require(_0x16a2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x16a2('0x5'));var logger=require('../../config/logger')(_0x16a2('0x6'));var config=require(_0x16a2('0x7'));var jayson=require(_0x16a2('0x8'));var client=jayson[_0x16a2('0x9')][_0x16a2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15a769,_0xa1c83d,_0x2441e4){return new BPromise(function(_0x4296f2,_0x412d4f){return client[_0x16a2('0xb')](_0x15a769,_0x2441e4)[_0x16a2('0xc')](function(_0xe691d4){logger[_0x16a2('0xd')](_0x16a2('0xe'),_0xa1c83d,_0x16a2('0xf'));logger['debug']('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0xa1c83d,_0x16a2('0xf'),JSON[_0x16a2('0x10')](_0xe691d4));if(_0xe691d4[_0x16a2('0x11')]){if(_0xe691d4[_0x16a2('0x11')][_0x16a2('0x12')]===0x1f4){logger[_0x16a2('0x11')](_0x16a2('0xe'),_0xa1c83d,_0xe691d4['error'][_0x16a2('0x13')]);return _0x412d4f(_0xe691d4[_0x16a2('0x11')]['message']);}logger[_0x16a2('0x11')](_0x16a2('0xe'),_0xa1c83d,_0xe691d4['error'][_0x16a2('0x13')]);return _0x4296f2(_0xe691d4['error']['message']);}else{logger[_0x16a2('0xd')]('JscriptyQuestionReport,\x20%s,\x20%s',_0xa1c83d,'request\x20sent');_0x4296f2(_0xe691d4[_0x16a2('0x14')][_0x16a2('0x13')]);}})[_0x16a2('0x15')](function(_0x3ca674){logger[_0x16a2('0x11')](_0x16a2('0xe'),_0xa1c83d,_0x3ca674);_0x412d4f(_0x3ca674);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index db746d5..c7c53ee 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 _0x2ce1=['delete','destroy','exports','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./jscriptySessionReport.controller','isAuthenticated','index','get','/:id','/:id/questions','getQuestions','put','update'];(function(_0x38e8c9,_0x3dc323){var _0xe95067=function(_0x2e776e){while(--_0x2e776e){_0x38e8c9['push'](_0x38e8c9['shift']());}};_0xe95067(++_0x3dc323);}(_0x2ce1,0x8b));var _0x12ce=function(_0x6ce7e8,_0x59f4c1){_0x6ce7e8=_0x6ce7e8-0x0;var _0x406e2d=_0x2ce1[_0x6ce7e8];return _0x406e2d;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x12ce('0x0'));var express=require(_0x12ce('0x1'));var router=express[_0x12ce('0x2')]();var auth=require(_0x12ce('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x12ce('0x4'));var controller=require(_0x12ce('0x5'));router['get']('/',auth[_0x12ce('0x6')](),controller[_0x12ce('0x7')]);router[_0x12ce('0x8')]('/describe',auth[_0x12ce('0x6')](),controller['describe']);router[_0x12ce('0x8')](_0x12ce('0x9'),auth[_0x12ce('0x6')](),controller['show']);router[_0x12ce('0x8')](_0x12ce('0xa'),auth[_0x12ce('0x6')](),controller[_0x12ce('0xb')]);router['post']('/',auth[_0x12ce('0x6')](),controller['create']);router[_0x12ce('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x12ce('0xd')]);router[_0x12ce('0xe')](_0x12ce('0x9'),auth[_0x12ce('0x6')](),controller[_0x12ce('0xf')]);module[_0x12ce('0x10')]=router; \ No newline at end of file +var _0xd8b1=['isAuthenticated','describe','/:id','getQuestions','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./jscriptySessionReport.controller','get'];(function(_0x3c1304,_0x219ae5){var _0x11b071=function(_0x2c1d0d){while(--_0x2c1d0d){_0x3c1304['push'](_0x3c1304['shift']());}};_0x11b071(++_0x219ae5);}(_0xd8b1,0x105));var _0x1d8b=function(_0x20f805,_0x30c470){_0x20f805=_0x20f805-0x0;var _0x485d0d=_0xd8b1[_0x20f805];return _0x485d0d;};'use strict';var multer=require(_0x1d8b('0x0'));var util=require(_0x1d8b('0x1'));var path=require(_0x1d8b('0x2'));var timeout=require(_0x1d8b('0x3'));var express=require(_0x1d8b('0x4'));var router=express['Router']();var auth=require(_0x1d8b('0x5'));var interaction=require(_0x1d8b('0x6'));var config=require('../../config/environment');var controller=require(_0x1d8b('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x1d8b('0x8')]('/describe',auth[_0x1d8b('0x9')](),controller[_0x1d8b('0xa')]);router[_0x1d8b('0x8')](_0x1d8b('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1d8b('0x8')]('/:id/questions',auth['isAuthenticated'](),controller[_0x1d8b('0xc')]);router['post']('/',auth[_0x1d8b('0x9')](),controller['create']);router[_0x1d8b('0xd')](_0x1d8b('0xb'),auth[_0x1d8b('0x9')](),controller[_0x1d8b('0xe')]);router[_0x1d8b('0xf')](_0x1d8b('0xb'),auth['isAuthenticated'](),controller[_0x1d8b('0x10')]);module[_0x1d8b('0x11')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 167f957..c6b9787 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 _0xaa5d=['starttime','endtime','STRING','BOOLEAN','moment','exports','DATE','setDataValue'];(function(_0x111b26,_0xf76620){var _0x3a0a1e=function(_0x2829cc){while(--_0x2829cc){_0x111b26['push'](_0x111b26['shift']());}};_0x3a0a1e(++_0xf76620);}(_0xaa5d,0x134));var _0xdaa5=function(_0x261b8a,_0x553ec4){_0x261b8a=_0x261b8a-0x0;var _0x3455e8=_0xaa5d[_0x261b8a];return _0x3455e8;};'use strict';var moment=require(_0xdaa5('0x0'));var Sequelize=require('sequelize');module[_0xdaa5('0x1')]={'starttime':{'type':Sequelize[_0xdaa5('0x2')],'set':function(_0x38bcc1){this[_0xdaa5('0x3')](_0xdaa5('0x4'),_0x38bcc1);this[_0xdaa5('0x3')](_0xdaa5('0x5'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0xdaa5('0x2')]},'membername':{'type':Sequelize[_0xdaa5('0x6')]},'projectname':{'type':Sequelize[_0xdaa5('0x6')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xdaa5('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0xdaa5('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0xb7e5=['format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','sequelize','DATE','setDataValue','starttime','endtime'];(function(_0x5b1dde,_0x5b5baa){var _0x4530bb=function(_0x40405c){while(--_0x40405c){_0x5b1dde['push'](_0x5b1dde['shift']());}};_0x4530bb(++_0x5b5baa);}(_0xb7e5,0xc1));var _0x5b7e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb7e5[_0x20a584];return _0x4b41a8;};'use strict';var moment=require('moment');var Sequelize=require(_0x5b7e('0x0'));module['exports']={'starttime':{'type':Sequelize[_0x5b7e('0x1')],'set':function(_0x205186){this[_0x5b7e('0x2')](_0x5b7e('0x3'),_0x205186);this['setDataValue'](_0x5b7e('0x4'),moment()[_0x5b7e('0x5')](_0x5b7e('0x6')));}},'endtime':{'type':Sequelize[_0x5b7e('0x1')]},'membername':{'type':Sequelize[_0x5b7e('0x7')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x5b7e('0x7')]},'uniqueid':{'type':Sequelize[_0x5b7e('0x7')]},'calleridname':{'type':Sequelize[_0x5b7e('0x7')]},'calleridnum':{'type':Sequelize[_0x5b7e('0x7')]},'completed':{'type':Sequelize[_0x5b7e('0x8')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index c30ddf5..a01794f 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 _0x87e4=['nolimit','limit','order','sort','filters','pick','filter','merge','options','where','JscriptySessionReport','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','describe','getQuestions','JscriptyQuestionReport','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','status','end','json','count','offset','set','apply','reject','save','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','model','map','query','attributes','intersection','fields','length'];(function(_0x59a45e,_0x23661c){var _0x4a4c75=function(_0x4a7713){while(--_0x4a7713){_0x59a45e['push'](_0x59a45e['shift']());}};_0x4a4c75(++_0x23661c);}(_0x87e4,0xaf));var _0x487e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x87e4[_0xa1e3e3];return _0xc980e9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x487e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x487e('0x1'));var rp=require(_0x487e('0x2'));var moment=require(_0x487e('0x3'));var BPromise=require(_0x487e('0x4'));var Mustache=require(_0x487e('0x5'));var util=require(_0x487e('0x6'));var path=require(_0x487e('0x7'));var sox=require(_0x487e('0x8'));var csv=require('to-csv');var ejs=require(_0x487e('0x9'));var fs=require('fs');var _=require(_0x487e('0xa'));var squel=require(_0x487e('0xb'));var crypto=require(_0x487e('0xc'));var jsforce=require(_0x487e('0xd'));var deskjs=require(_0x487e('0xe'));var toCsv=require(_0x487e('0xf'));var querystring=require(_0x487e('0x10'));var Papa=require(_0x487e('0x11'));var Redis=require(_0x487e('0x12'));var authService=require(_0x487e('0x13'));var qs=require(_0x487e('0x14'));var as=require(_0x487e('0x15'));var hardwareService=require(_0x487e('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x487e('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x34f7f6,_0x3254a4){_0x3254a4=_0x3254a4||0xcc;return function(_0x4c1d5e){if(_0x4c1d5e){return _0x34f7f6['sendStatus'](_0x3254a4);}return _0x34f7f6[_0x487e('0x18')](_0x3254a4)[_0x487e('0x19')]();};}function respondWithResult(_0x1fc1e2,_0x157215){_0x157215=_0x157215||0xc8;return function(_0x2e9fce){if(_0x2e9fce){return _0x1fc1e2[_0x487e('0x18')](_0x157215)[_0x487e('0x1a')](_0x2e9fce);}};}function respondWithFilteredResult(_0x1abf03,_0x1ca6a7){return function(_0x466293){if(_0x466293){var _0x2a206b=_0x466293[_0x487e('0x1b')],_0x14c6e5=_0x1ca6a7[_0x487e('0x1c')],_0x2de123=_0x1ca6a7[_0x487e('0x1c')]+_0x1ca6a7['limit'],_0xe7e990;if(_0x2de123>=_0x2a206b){_0x2de123=_0x2a206b;_0xe7e990=0xc8;}else{_0xe7e990=0xce;}_0x1abf03[_0x487e('0x18')](_0xe7e990);return _0x1abf03[_0x487e('0x1d')]('Content-Range',_0x14c6e5+'-'+_0x2de123+'/'+_0x2a206b)[_0x487e('0x1a')](_0x466293);}return null;};}function patchUpdates(_0x4a395a){return function(_0x4361a3){try{jsonpatch[_0x487e('0x1e')](_0x4361a3,_0x4a395a,!![]);}catch(_0x31e835){return BPromise[_0x487e('0x1f')](_0x31e835);}return _0x4361a3[_0x487e('0x20')]();};}function saveUpdates(_0x1485b9,_0x1146e6){return function(_0x5544c5){if(_0x5544c5){return _0x5544c5['update'](_0x1485b9)[_0x487e('0x21')](function(_0x2b1535){return _0x2b1535;});}return null;};}function removeEntity(_0xbf2d71,_0x20adf3){return function(_0x36cbac){if(_0x36cbac){return _0x36cbac[_0x487e('0x22')]()[_0x487e('0x21')](function(){_0xbf2d71[_0x487e('0x18')](0xcc)[_0x487e('0x19')]();});}};}function handleEntityNotFound(_0x2055fb,_0x1c7136){return function(_0x40d825){if(!_0x40d825){_0x2055fb['sendStatus'](0x194);}return _0x40d825;};}function handleError(_0x2f1b73,_0x4bd3dc){_0x4bd3dc=_0x4bd3dc||0x1f4;return function(_0x7e3ab0){logger[_0x487e('0x23')](_0x7e3ab0[_0x487e('0x24')]);if(_0x7e3ab0[_0x487e('0x25')]){delete _0x7e3ab0[_0x487e('0x25')];}_0x2f1b73[_0x487e('0x18')](_0x4bd3dc)[_0x487e('0x26')](_0x7e3ab0);};}exports[_0x487e('0x27')]=function(_0x5e37b3,_0x3d6d74){var _0x7854d={},_0xb33e46={},_0x52ca79={'count':0x0,'rows':[]};var _0x261154=_['map'](db['JscriptySessionReport'][_0x487e('0x28')],function(_0x2edf61){return{'name':_0x2edf61[_0x487e('0x29')],'type':_0x2edf61[_0x487e('0x2a')]['key']};});_0xb33e46[_0x487e('0x2b')]=_[_0x487e('0x2c')](_0x261154,'name');_0xb33e46['query']=_['keys'](_0x5e37b3['query']);_0xb33e46['filters']=_['intersection'](_0xb33e46['model'],_0xb33e46[_0x487e('0x2d')]);_0x7854d[_0x487e('0x2e')]=_[_0x487e('0x2f')](_0xb33e46[_0x487e('0x2b')],qs[_0x487e('0x30')](_0x5e37b3[_0x487e('0x2d')][_0x487e('0x30')]));_0x7854d[_0x487e('0x2e')]=_0x7854d[_0x487e('0x2e')][_0x487e('0x31')]?_0x7854d[_0x487e('0x2e')]:_0xb33e46[_0x487e('0x2b')];if(!_0x5e37b3['query']['hasOwnProperty'](_0x487e('0x32'))){_0x7854d[_0x487e('0x33')]=qs[_0x487e('0x33')](_0x5e37b3[_0x487e('0x2d')][_0x487e('0x33')]);_0x7854d[_0x487e('0x1c')]=qs['offset'](_0x5e37b3[_0x487e('0x2d')][_0x487e('0x1c')]);}_0x7854d[_0x487e('0x34')]=qs[_0x487e('0x35')](_0x5e37b3[_0x487e('0x2d')][_0x487e('0x35')]);_0x7854d['where']=qs[_0x487e('0x36')](_[_0x487e('0x37')](_0x5e37b3['query'],_0xb33e46[_0x487e('0x36')]));if(_0x5e37b3[_0x487e('0x2d')][_0x487e('0x38')]){_0x7854d['where']=_[_0x487e('0x39')](_0x7854d['where'],{'$or':_[_0x487e('0x2c')](_0x261154,function(_0x1f93ec){if(_0x1f93ec[_0x487e('0x2a')]!=='VIRTUAL'){var _0x868f20={};_0x868f20[_0x1f93ec[_0x487e('0x25')]]={'$like':'%'+_0x5e37b3[_0x487e('0x2d')]['filter']+'%'};return _0x868f20;}})});}_0x7854d=_[_0x487e('0x39')]({},_0x7854d,_0x5e37b3[_0x487e('0x3a')]);var _0x291e58={'where':_0x7854d[_0x487e('0x3b')]};return db[_0x487e('0x3c')][_0x487e('0x1b')](_0x291e58)[_0x487e('0x21')](function(_0x4930e8){_0x52ca79[_0x487e('0x1b')]=_0x4930e8;if(_0x5e37b3[_0x487e('0x2d')]['includeAll']){_0x7854d[_0x487e('0x3d')]=[{'all':!![]}];}return db[_0x487e('0x3c')][_0x487e('0x3e')](_0x7854d);})[_0x487e('0x21')](function(_0x4de5fa){_0x52ca79[_0x487e('0x3f')]=_0x4de5fa;return _0x52ca79;})[_0x487e('0x21')](respondWithFilteredResult(_0x3d6d74,_0x7854d))[_0x487e('0x40')](handleError(_0x3d6d74,null));};exports[_0x487e('0x41')]=function(_0x1a8454,_0x1fa222){var _0x20ee5f={'raw':!![],'where':{'id':_0x1a8454[_0x487e('0x42')]['id']}},_0x2a37a8={};_0x2a37a8['model']=_[_0x487e('0x43')](db[_0x487e('0x3c')][_0x487e('0x28')]);_0x2a37a8['query']=_[_0x487e('0x43')](_0x1a8454[_0x487e('0x2d')]);_0x2a37a8[_0x487e('0x36')]=_[_0x487e('0x2f')](_0x2a37a8[_0x487e('0x2b')],_0x2a37a8[_0x487e('0x2d')]);_0x20ee5f[_0x487e('0x2e')]=_['intersection'](_0x2a37a8['model'],qs[_0x487e('0x30')](_0x1a8454[_0x487e('0x2d')]['fields']));_0x20ee5f[_0x487e('0x2e')]=_0x20ee5f['attributes']['length']?_0x20ee5f[_0x487e('0x2e')]:_0x2a37a8[_0x487e('0x2b')];if(_0x1a8454['query'][_0x487e('0x44')]){_0x20ee5f[_0x487e('0x3d')]=[{'all':!![]}];}_0x20ee5f=_['merge']({},_0x20ee5f,_0x1a8454['options']);return db[_0x487e('0x3c')][_0x487e('0x45')](_0x20ee5f)[_0x487e('0x21')](handleEntityNotFound(_0x1fa222,null))[_0x487e('0x21')](respondWithResult(_0x1fa222,null))[_0x487e('0x40')](handleError(_0x1fa222,null));};exports['create']=function(_0x479d75,_0x44ee8e){return db[_0x487e('0x3c')][_0x487e('0x46')](_0x479d75[_0x487e('0x47')],{})[_0x487e('0x21')](respondWithResult(_0x44ee8e,0xc9))[_0x487e('0x40')](handleError(_0x44ee8e,null));};exports['update']=function(_0x522bf0,_0x2fcc99){if(_0x522bf0[_0x487e('0x47')]['id']){delete _0x522bf0[_0x487e('0x47')]['id'];}return db[_0x487e('0x3c')][_0x487e('0x45')]({'where':{'id':_0x522bf0['params']['id']}})[_0x487e('0x21')](handleEntityNotFound(_0x2fcc99,null))[_0x487e('0x21')](saveUpdates(_0x522bf0[_0x487e('0x47')],null))[_0x487e('0x21')](respondWithResult(_0x2fcc99,null))[_0x487e('0x40')](handleError(_0x2fcc99,null));};exports[_0x487e('0x22')]=function(_0xcf25e5,_0xcdc57){return db[_0x487e('0x3c')]['find']({'where':{'id':_0xcf25e5[_0x487e('0x42')]['id']}})[_0x487e('0x21')](handleEntityNotFound(_0xcdc57,null))[_0x487e('0x21')](removeEntity(_0xcdc57,null))[_0x487e('0x40')](handleError(_0xcdc57,null));};exports[_0x487e('0x48')]=function(_0x1c9ef4,_0x289a1c){return db[_0x487e('0x3c')]['describe']()['then'](respondWithResult(_0x289a1c,null))['catch'](handleError(_0x289a1c,null));};exports[_0x487e('0x49')]=function(_0x88f7c2,_0x122c6f,_0x9055c2){var _0x445396={'raw':!![],'where':{}};var _0x25850b={};var _0x431812={'count':0x0,'rows':[]};return db[_0x487e('0x3c')]['findOne']({'where':{'id':_0x88f7c2['params']['id']}})[_0x487e('0x21')](handleEntityNotFound(_0x122c6f,null))[_0x487e('0x21')](function(_0x48895f){if(_0x48895f){_0x25850b['model']=_[_0x487e('0x43')](db[_0x487e('0x4a')]['rawAttributes']);_0x25850b[_0x487e('0x2d')]=_[_0x487e('0x43')](_0x88f7c2[_0x487e('0x2d')]);_0x25850b['filters']=_[_0x487e('0x2f')](_0x25850b[_0x487e('0x2b')],_0x25850b[_0x487e('0x2d')]);_0x445396['attributes']=_[_0x487e('0x2f')](_0x25850b[_0x487e('0x2b')],qs['fields'](_0x88f7c2[_0x487e('0x2d')][_0x487e('0x30')]));_0x445396[_0x487e('0x2e')]=_0x445396['attributes']['length']?_0x445396[_0x487e('0x2e')]:_0x25850b['model'];if(!_0x88f7c2['query']['hasOwnProperty'](_0x487e('0x32'))){_0x445396[_0x487e('0x33')]=qs['limit'](_0x88f7c2[_0x487e('0x2d')][_0x487e('0x33')]);_0x445396['offset']=qs[_0x487e('0x1c')](_0x88f7c2[_0x487e('0x2d')][_0x487e('0x1c')]);}_0x445396['order']=qs[_0x487e('0x35')](_0x88f7c2[_0x487e('0x2d')]['sort']);_0x445396[_0x487e('0x3b')]=qs['filters'](_[_0x487e('0x37')](_0x88f7c2['query'],_0x25850b['filters']));_0x445396['where']['SessionId']=_0x48895f['id'];if(_0x88f7c2[_0x487e('0x2d')]['filter']){_0x445396[_0x487e('0x3b')]=_[_0x487e('0x39')](_0x445396[_0x487e('0x3b')],{'$or':_['map'](_0x445396[_0x487e('0x2e')],function(_0x4456d4){var _0x48fdc2={};_0x48fdc2[_0x4456d4]={'$like':'%'+_0x88f7c2['query'][_0x487e('0x38')]+'%'};return _0x48fdc2;})});}_0x445396=_[_0x487e('0x39')]({},_0x445396,_0x88f7c2['options']);return db[_0x487e('0x4a')]['count']({'where':_0x445396[_0x487e('0x3b')]})[_0x487e('0x21')](function(_0x4526a8){_0x431812[_0x487e('0x1b')]=_0x4526a8;if(_0x88f7c2[_0x487e('0x2d')][_0x487e('0x44')]){_0x445396['include']=[{'all':!![]}];}return db[_0x487e('0x4a')][_0x487e('0x3e')](_0x445396);})[_0x487e('0x21')](function(_0x28f4f6){_0x431812[_0x487e('0x3f')]=_0x28f4f6;return _0x431812;});}})[_0x487e('0x21')](respondWithFilteredResult(_0x122c6f,_0x445396))['catch'](handleError(_0x122c6f,null));}; \ No newline at end of file +var _0x1923=['JscriptySessionReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','sort','where','merge','map','VIRTUAL','filter','options','include','findAll','rows','show','params','length','includeAll','create','body','find','catch','describe','getQuestions','findOne','order','eml-format','rimraf','zip-dir','fast-json-patch','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','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','json','reject','save','update','destroy','then','stack','name','index'];(function(_0x2067e3,_0x19bcb2){var _0x180c44=function(_0x53751f){while(--_0x53751f){_0x2067e3['push'](_0x2067e3['shift']());}};_0x180c44(++_0x19bcb2);}(_0x1923,0x1e5));var _0x3192=function(_0x2a7772,_0xb7dbc8){_0x2a7772=_0x2a7772-0x0;var _0x5d1b7f=_0x1923[_0x2a7772];return _0x5d1b7f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3192('0x0'));var rimraf=require(_0x3192('0x1'));var zipdir=require(_0x3192('0x2'));var jsonpatch=require(_0x3192('0x3'));var rp=require('request-promise');var moment=require(_0x3192('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3192('0x5'));var util=require(_0x3192('0x6'));var path=require(_0x3192('0x7'));var sox=require(_0x3192('0x8'));var csv=require(_0x3192('0x9'));var ejs=require(_0x3192('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3192('0xb'));var crypto=require(_0x3192('0xc'));var jsforce=require(_0x3192('0xd'));var deskjs=require(_0x3192('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3192('0xf'));var Papa=require(_0x3192('0x10'));var Redis=require(_0x3192('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x3192('0x12'));var as=require(_0x3192('0x13'));var hardwareService=require(_0x3192('0x14'));var logger=require(_0x3192('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x3192('0x16'));var db=require(_0x3192('0x17'))['db'];function respondWithStatusCode(_0x4acf89,_0x5b5d27){_0x5b5d27=_0x5b5d27||0xcc;return function(_0x258a52){if(_0x258a52){return _0x4acf89[_0x3192('0x18')](_0x5b5d27);}return _0x4acf89[_0x3192('0x19')](_0x5b5d27)['end']();};}function respondWithResult(_0xb10ffe,_0x4ccb24){_0x4ccb24=_0x4ccb24||0xc8;return function(_0x3cf8c9){if(_0x3cf8c9){return _0xb10ffe[_0x3192('0x19')](_0x4ccb24)['json'](_0x3cf8c9);}};}function respondWithFilteredResult(_0x1daaf7,_0x3252d1){return function(_0x1ddcca){if(_0x1ddcca){var _0x5af3d0=_0x1ddcca[_0x3192('0x1a')],_0x5cff3e=_0x3252d1[_0x3192('0x1b')],_0x2efb0d=_0x3252d1[_0x3192('0x1b')]+_0x3252d1[_0x3192('0x1c')],_0x33448f;if(_0x2efb0d>=_0x5af3d0){_0x2efb0d=_0x5af3d0;_0x33448f=0xc8;}else{_0x33448f=0xce;}_0x1daaf7[_0x3192('0x19')](_0x33448f);return _0x1daaf7[_0x3192('0x1d')](_0x3192('0x1e'),_0x5cff3e+'-'+_0x2efb0d+'/'+_0x5af3d0)[_0x3192('0x1f')](_0x1ddcca);}return null;};}function patchUpdates(_0x2204fb){return function(_0x1266cf){try{jsonpatch['apply'](_0x1266cf,_0x2204fb,!![]);}catch(_0x33a788){return BPromise[_0x3192('0x20')](_0x33a788);}return _0x1266cf[_0x3192('0x21')]();};}function saveUpdates(_0x3346f2,_0x4bfebd){return function(_0x483e05){if(_0x483e05){return _0x483e05[_0x3192('0x22')](_0x3346f2)['then'](function(_0x5c4ede){return _0x5c4ede;});}return null;};}function removeEntity(_0x5780fa,_0x2138dd){return function(_0x1131eb){if(_0x1131eb){return _0x1131eb[_0x3192('0x23')]()[_0x3192('0x24')](function(){_0x5780fa[_0x3192('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d2976,_0x148191){return function(_0x2754c1){if(!_0x2754c1){_0x2d2976[_0x3192('0x18')](0x194);}return _0x2754c1;};}function handleError(_0x2d6618,_0x896221){_0x896221=_0x896221||0x1f4;return function(_0x88fbe4){logger['error'](_0x88fbe4[_0x3192('0x25')]);if(_0x88fbe4[_0x3192('0x26')]){delete _0x88fbe4[_0x3192('0x26')];}_0x2d6618[_0x3192('0x19')](_0x896221)['send'](_0x88fbe4);};}exports[_0x3192('0x27')]=function(_0x1fa8a5,_0x54ded8){var _0x7c1259={},_0x368d3a={},_0x2fb264={'count':0x0,'rows':[]};var _0x5e82c1=_['map'](db[_0x3192('0x28')][_0x3192('0x29')],function(_0x489533){return{'name':_0x489533[_0x3192('0x2a')],'type':_0x489533[_0x3192('0x2b')][_0x3192('0x2c')]};});_0x368d3a['model']=_['map'](_0x5e82c1,_0x3192('0x26'));_0x368d3a[_0x3192('0x2d')]=_[_0x3192('0x2e')](_0x1fa8a5['query']);_0x368d3a[_0x3192('0x2f')]=_[_0x3192('0x30')](_0x368d3a[_0x3192('0x31')],_0x368d3a['query']);_0x7c1259[_0x3192('0x32')]=_[_0x3192('0x30')](_0x368d3a[_0x3192('0x31')],qs[_0x3192('0x33')](_0x1fa8a5[_0x3192('0x2d')][_0x3192('0x33')]));_0x7c1259[_0x3192('0x32')]=_0x7c1259[_0x3192('0x32')]['length']?_0x7c1259[_0x3192('0x32')]:_0x368d3a['model'];if(!_0x1fa8a5[_0x3192('0x2d')][_0x3192('0x34')]('nolimit')){_0x7c1259['limit']=qs[_0x3192('0x1c')](_0x1fa8a5[_0x3192('0x2d')][_0x3192('0x1c')]);_0x7c1259[_0x3192('0x1b')]=qs[_0x3192('0x1b')](_0x1fa8a5['query'][_0x3192('0x1b')]);}_0x7c1259['order']=qs[_0x3192('0x35')](_0x1fa8a5[_0x3192('0x2d')][_0x3192('0x35')]);_0x7c1259[_0x3192('0x36')]=qs['filters'](_['pick'](_0x1fa8a5[_0x3192('0x2d')],_0x368d3a['filters']));if(_0x1fa8a5['query']['filter']){_0x7c1259[_0x3192('0x36')]=_[_0x3192('0x37')](_0x7c1259[_0x3192('0x36')],{'$or':_[_0x3192('0x38')](_0x5e82c1,function(_0x1ef78d){if(_0x1ef78d[_0x3192('0x2b')]!==_0x3192('0x39')){var _0x3c0449={};_0x3c0449[_0x1ef78d['name']]={'$like':'%'+_0x1fa8a5['query'][_0x3192('0x3a')]+'%'};return _0x3c0449;}})});}_0x7c1259=_['merge']({},_0x7c1259,_0x1fa8a5[_0x3192('0x3b')]);var _0x1d5036={'where':_0x7c1259[_0x3192('0x36')]};return db['JscriptySessionReport'][_0x3192('0x1a')](_0x1d5036)[_0x3192('0x24')](function(_0x10ba79){_0x2fb264[_0x3192('0x1a')]=_0x10ba79;if(_0x1fa8a5['query']['includeAll']){_0x7c1259[_0x3192('0x3c')]=[{'all':!![]}];}return db[_0x3192('0x28')][_0x3192('0x3d')](_0x7c1259);})[_0x3192('0x24')](function(_0x43faba){_0x2fb264[_0x3192('0x3e')]=_0x43faba;return _0x2fb264;})[_0x3192('0x24')](respondWithFilteredResult(_0x54ded8,_0x7c1259))['catch'](handleError(_0x54ded8,null));};exports[_0x3192('0x3f')]=function(_0xd16194,_0xe90ccd){var _0x24e3a4={'raw':!![],'where':{'id':_0xd16194[_0x3192('0x40')]['id']}},_0xc88ff4={};_0xc88ff4[_0x3192('0x31')]=_['keys'](db[_0x3192('0x28')]['rawAttributes']);_0xc88ff4[_0x3192('0x2d')]=_[_0x3192('0x2e')](_0xd16194[_0x3192('0x2d')]);_0xc88ff4[_0x3192('0x2f')]=_['intersection'](_0xc88ff4[_0x3192('0x31')],_0xc88ff4['query']);_0x24e3a4[_0x3192('0x32')]=_[_0x3192('0x30')](_0xc88ff4['model'],qs['fields'](_0xd16194[_0x3192('0x2d')][_0x3192('0x33')]));_0x24e3a4[_0x3192('0x32')]=_0x24e3a4['attributes'][_0x3192('0x41')]?_0x24e3a4[_0x3192('0x32')]:_0xc88ff4[_0x3192('0x31')];if(_0xd16194[_0x3192('0x2d')][_0x3192('0x42')]){_0x24e3a4[_0x3192('0x3c')]=[{'all':!![]}];}_0x24e3a4=_[_0x3192('0x37')]({},_0x24e3a4,_0xd16194[_0x3192('0x3b')]);return db['JscriptySessionReport']['find'](_0x24e3a4)['then'](handleEntityNotFound(_0xe90ccd,null))[_0x3192('0x24')](respondWithResult(_0xe90ccd,null))['catch'](handleError(_0xe90ccd,null));};exports[_0x3192('0x43')]=function(_0x3dce8c,_0x1dd03f){return db[_0x3192('0x28')][_0x3192('0x43')](_0x3dce8c[_0x3192('0x44')],{})[_0x3192('0x24')](respondWithResult(_0x1dd03f,0xc9))['catch'](handleError(_0x1dd03f,null));};exports['update']=function(_0x17ca08,_0x352529){if(_0x17ca08[_0x3192('0x44')]['id']){delete _0x17ca08[_0x3192('0x44')]['id'];}return db[_0x3192('0x28')][_0x3192('0x45')]({'where':{'id':_0x17ca08[_0x3192('0x40')]['id']}})[_0x3192('0x24')](handleEntityNotFound(_0x352529,null))['then'](saveUpdates(_0x17ca08[_0x3192('0x44')],null))[_0x3192('0x24')](respondWithResult(_0x352529,null))[_0x3192('0x46')](handleError(_0x352529,null));};exports[_0x3192('0x23')]=function(_0x1d47d3,_0x624e59){return db[_0x3192('0x28')][_0x3192('0x45')]({'where':{'id':_0x1d47d3['params']['id']}})[_0x3192('0x24')](handleEntityNotFound(_0x624e59,null))['then'](removeEntity(_0x624e59,null))[_0x3192('0x46')](handleError(_0x624e59,null));};exports['describe']=function(_0xfef0c2,_0x1d76a2){return db[_0x3192('0x28')][_0x3192('0x47')]()[_0x3192('0x24')](respondWithResult(_0x1d76a2,null))[_0x3192('0x46')](handleError(_0x1d76a2,null));};exports[_0x3192('0x48')]=function(_0x544679,_0x422668,_0x28a64c){var _0x38c9b4={'raw':!![],'where':{}};var _0x1ece27={};var _0x41f7ad={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x3192('0x49')]({'where':{'id':_0x544679['params']['id']}})[_0x3192('0x24')](handleEntityNotFound(_0x422668,null))[_0x3192('0x24')](function(_0x371fe0){if(_0x371fe0){_0x1ece27[_0x3192('0x31')]=_['keys'](db['JscriptyQuestionReport'][_0x3192('0x29')]);_0x1ece27[_0x3192('0x2d')]=_['keys'](_0x544679[_0x3192('0x2d')]);_0x1ece27[_0x3192('0x2f')]=_[_0x3192('0x30')](_0x1ece27[_0x3192('0x31')],_0x1ece27[_0x3192('0x2d')]);_0x38c9b4[_0x3192('0x32')]=_[_0x3192('0x30')](_0x1ece27['model'],qs[_0x3192('0x33')](_0x544679[_0x3192('0x2d')][_0x3192('0x33')]));_0x38c9b4[_0x3192('0x32')]=_0x38c9b4[_0x3192('0x32')][_0x3192('0x41')]?_0x38c9b4[_0x3192('0x32')]:_0x1ece27[_0x3192('0x31')];if(!_0x544679[_0x3192('0x2d')][_0x3192('0x34')]('nolimit')){_0x38c9b4[_0x3192('0x1c')]=qs['limit'](_0x544679[_0x3192('0x2d')][_0x3192('0x1c')]);_0x38c9b4[_0x3192('0x1b')]=qs['offset'](_0x544679['query'][_0x3192('0x1b')]);}_0x38c9b4[_0x3192('0x4a')]=qs[_0x3192('0x35')](_0x544679[_0x3192('0x2d')][_0x3192('0x35')]);_0x38c9b4[_0x3192('0x36')]=qs[_0x3192('0x2f')](_['pick'](_0x544679[_0x3192('0x2d')],_0x1ece27[_0x3192('0x2f')]));_0x38c9b4['where']['SessionId']=_0x371fe0['id'];if(_0x544679[_0x3192('0x2d')][_0x3192('0x3a')]){_0x38c9b4['where']=_[_0x3192('0x37')](_0x38c9b4[_0x3192('0x36')],{'$or':_[_0x3192('0x38')](_0x38c9b4[_0x3192('0x32')],function(_0x1c6673){var _0x188a93={};_0x188a93[_0x1c6673]={'$like':'%'+_0x544679['query']['filter']+'%'};return _0x188a93;})});}_0x38c9b4=_[_0x3192('0x37')]({},_0x38c9b4,_0x544679[_0x3192('0x3b')]);return db['JscriptyQuestionReport'][_0x3192('0x1a')]({'where':_0x38c9b4['where']})[_0x3192('0x24')](function(_0x4c14a1){_0x41f7ad[_0x3192('0x1a')]=_0x4c14a1;if(_0x544679['query'][_0x3192('0x42')]){_0x38c9b4['include']=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x3192('0x3d')](_0x38c9b4);})[_0x3192('0x24')](function(_0x5a862f){_0x41f7ad['rows']=_0x5a862f;return _0x41f7ad;});}})[_0x3192('0x24')](respondWithFilteredResult(_0x422668,_0x38c9b4))[_0x3192('0x46')](handleError(_0x422668,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index d410fd7..64d4bf0 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 _0x43f3=['./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','lodash','util','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x4caa51,_0x46800d){var _0x140064=function(_0x1a3532){while(--_0x1a3532){_0x4caa51['push'](_0x4caa51['shift']());}};_0x140064(++_0x46800d);}(_0x43f3,0x67));var _0x343f=function(_0x4ae829,_0x2c842c){_0x4ae829=_0x4ae829-0x0;var _0x256b31=_0x43f3[_0x4ae829];return _0x256b31;};'use strict';var _=require(_0x343f('0x0'));var util=require(_0x343f('0x1'));var logger=require('../../config/logger')(_0x343f('0x2'));var moment=require(_0x343f('0x3'));var BPromise=require(_0x343f('0x4'));var rp=require(_0x343f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x343f('0x6'));var attributes=require(_0x343f('0x7'));module[_0x343f('0x8')]=function(_0x5040ce,_0x4a5a2c){return _0x5040ce[_0x343f('0x9')](_0x343f('0xa'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x09f5=['bluebird','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','report_jscripty_sessions','../../config/logger','api','moment'];(function(_0x21ef04,_0x595196){var _0x3eed4f=function(_0x300f9c){while(--_0x300f9c){_0x21ef04['push'](_0x21ef04['shift']());}};_0x3eed4f(++_0x595196);}(_0x09f5,0x13d));var _0x509f=function(_0x401455,_0x1ec053){_0x401455=_0x401455-0x0;var _0x1c405d=_0x09f5[_0x401455];return _0x1c405d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x509f('0x0'))(_0x509f('0x1'));var moment=require(_0x509f('0x2'));var BPromise=require(_0x509f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x509f('0x4'));var rimraf=require(_0x509f('0x5'));var config=require(_0x509f('0x6'));var attributes=require(_0x509f('0x7'));module[_0x509f('0x8')]=function(_0x339853,_0x5ad8b2){return _0x339853['define']('JscriptySessionReport',attributes,{'tableName':_0x509f('0x9'),'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 7141352..cefb2cb 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 _0xd582=['stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s'];(function(_0x3f0d38,_0x58c1a3){var _0x18dc52=function(_0x1a2c1f){while(--_0x1a2c1f){_0x3f0d38['push'](_0x3f0d38['shift']());}};_0x18dc52(++_0x58c1a3);}(_0xd582,0xff));var _0x2d58=function(_0x4a7e8e,_0x5e70eb){_0x4a7e8e=_0x4a7e8e-0x0;var _0x4b7c4f=_0xd582[_0x4a7e8e];return _0x4b7c4f;};'use strict';var _=require(_0x2d58('0x0'));var util=require(_0x2d58('0x1'));var moment=require(_0x2d58('0x2'));var BPromise=require(_0x2d58('0x3'));var rs=require(_0x2d58('0x4'));var fs=require('fs');var Redis=require(_0x2d58('0x5'));var db=require(_0x2d58('0x6'))['db'];var utils=require(_0x2d58('0x7'));var logger=require(_0x2d58('0x8'))(_0x2d58('0x9'));var config=require(_0x2d58('0xa'));var jayson=require(_0x2d58('0xb'));var client=jayson[_0x2d58('0xc')][_0x2d58('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x45e5fd,_0x16a5a1,_0x308218){return new BPromise(function(_0x575a45,_0x572af1){return client[_0x2d58('0xe')](_0x45e5fd,_0x308218)[_0x2d58('0xf')](function(_0x4e0884){logger[_0x2d58('0x10')](_0x2d58('0x11'),_0x16a5a1,_0x2d58('0x12'));logger['debug'](_0x2d58('0x13'),_0x16a5a1,_0x2d58('0x12'),JSON[_0x2d58('0x14')](_0x4e0884));if(_0x4e0884[_0x2d58('0x15')]){if(_0x4e0884[_0x2d58('0x15')][_0x2d58('0x16')]===0x1f4){logger['error'](_0x2d58('0x11'),_0x16a5a1,_0x4e0884[_0x2d58('0x15')][_0x2d58('0x17')]);return _0x572af1(_0x4e0884['error'][_0x2d58('0x17')]);}logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x16a5a1,_0x4e0884[_0x2d58('0x15')][_0x2d58('0x17')]);return _0x575a45(_0x4e0884[_0x2d58('0x15')]['message']);}else{logger[_0x2d58('0x10')](_0x2d58('0x11'),_0x16a5a1,_0x2d58('0x12'));_0x575a45(_0x4e0884[_0x2d58('0x18')][_0x2d58('0x17')]);}})['catch'](function(_0x3bd68c){logger[_0x2d58('0x15')](_0x2d58('0x11'),_0x16a5a1,_0x3bd68c);_0x572af1(_0x3bd68c);});});} \ No newline at end of file +var _0x5f2c=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','randomstring'];(function(_0xa264da,_0x13410f){var _0x4b4eda=function(_0x3b1490){while(--_0x3b1490){_0xa264da['push'](_0xa264da['shift']());}};_0x4b4eda(++_0x13410f);}(_0x5f2c,0x80));var _0xc5f2=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x5f2c[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xc5f2('0x0'));var util=require(_0xc5f2('0x1'));var moment=require(_0xc5f2('0x2'));var BPromise=require('bluebird');var rs=require(_0xc5f2('0x3'));var fs=require('fs');var Redis=require(_0xc5f2('0x4'));var db=require(_0xc5f2('0x5'))['db'];var utils=require(_0xc5f2('0x6'));var logger=require(_0xc5f2('0x7'))(_0xc5f2('0x8'));var config=require(_0xc5f2('0x9'));var jayson=require(_0xc5f2('0xa'));var client=jayson['client'][_0xc5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f45a6,_0x54244b,_0x37cfed){return new BPromise(function(_0x265706,_0x6d2742){return client['request'](_0x3f45a6,_0x37cfed)[_0xc5f2('0xc')](function(_0x2140ef){logger[_0xc5f2('0xd')](_0xc5f2('0xe'),_0x54244b,_0xc5f2('0xf'));logger[_0xc5f2('0x10')](_0xc5f2('0x11'),_0x54244b,'request\x20sent',JSON['stringify'](_0x2140ef));if(_0x2140ef[_0xc5f2('0x12')]){if(_0x2140ef['error']['code']===0x1f4){logger[_0xc5f2('0x12')](_0xc5f2('0xe'),_0x54244b,_0x2140ef[_0xc5f2('0x12')][_0xc5f2('0x13')]);return _0x6d2742(_0x2140ef['error']['message']);}logger[_0xc5f2('0x12')]('JscriptySessionReport,\x20%s,\x20%s',_0x54244b,_0x2140ef[_0xc5f2('0x12')]['message']);return _0x265706(_0x2140ef[_0xc5f2('0x12')][_0xc5f2('0x13')]);}else{logger[_0xc5f2('0xd')](_0xc5f2('0xe'),_0x54244b,_0xc5f2('0xf'));_0x265706(_0x2140ef[_0xc5f2('0x14')][_0xc5f2('0x13')]);}})[_0xc5f2('0x15')](function(_0x2bf70d){logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x54244b,_0x2bf70d);_0x6d2742(_0x2bf70d);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 42394e4..f020606 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 _0xc3e0=['index','put','/:id','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./license.controller','get'];(function(_0x53237f,_0x10cee8){var _0x22bf01=function(_0x15cd53){while(--_0x15cd53){_0x53237f['push'](_0x53237f['shift']());}};_0x22bf01(++_0x10cee8);}(_0xc3e0,0xe5));var _0x0c3e=function(_0x38bfb,_0x47c28e){_0x38bfb=_0x38bfb-0x0;var _0x5930d5=_0xc3e0[_0x38bfb];return _0x5930d5;};'use strict';var multer=require(_0x0c3e('0x0'));var util=require(_0x0c3e('0x1'));var path=require(_0x0c3e('0x2'));var timeout=require(_0x0c3e('0x3'));var express=require(_0x0c3e('0x4'));var router=express[_0x0c3e('0x5')]();var auth=require(_0x0c3e('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0c3e('0x7'));router[_0x0c3e('0x8')]('/',controller[_0x0c3e('0x9')]);router[_0x0c3e('0xa')](_0x0c3e('0xb'),auth['isAuthenticated'](),controller[_0x0c3e('0xc')]);module[_0x0c3e('0xd')]=router; \ No newline at end of file +var _0x9347=['express','../../components/interaction/service','../../config/environment','get','index','put','/:id','update','exports','multer','util','path'];(function(_0x4bdad2,_0x3bb56b){var _0x249aa7=function(_0x435fd5){while(--_0x435fd5){_0x4bdad2['push'](_0x4bdad2['shift']());}};_0x249aa7(++_0x3bb56b);}(_0x9347,0xf9));var _0x7934=function(_0x490abd,_0x3df7e7){_0x490abd=_0x490abd-0x0;var _0x5f1450=_0x9347[_0x490abd];return _0x5f1450;};'use strict';var multer=require(_0x7934('0x0'));var util=require(_0x7934('0x1'));var path=require(_0x7934('0x2'));var timeout=require('connect-timeout');var express=require(_0x7934('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x7934('0x4'));var config=require(_0x7934('0x5'));var controller=require('./license.controller');router[_0x7934('0x6')]('/',controller[_0x7934('0x7')]);router[_0x7934('0x8')](_0x7934('0x9'),auth['isAuthenticated'](),controller[_0x7934('0xa')]);module[_0x7934('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 df186bf..6ca1f9c 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 _0x524e=['STRING','INTEGER','TEXT'];(function(_0x4b6830,_0x2bf6fb){var _0x239e4a=function(_0x364735){while(--_0x364735){_0x4b6830['push'](_0x4b6830['shift']());}};_0x239e4a(++_0x2bf6fb);}(_0x524e,0x15e));var _0xe524=function(_0xa39da1,_0x44d2d4){_0xa39da1=_0xa39da1-0x0;var _0x2a4590=_0x524e[_0xa39da1];return _0x2a4590;};'use strict';var Sequelize=require('sequelize');module['exports']={'license':{'type':Sequelize[_0xe524('0x0')]},'data1':{'type':Sequelize[_0xe524('0x1')]},'data2':{'type':Sequelize[_0xe524('0x1')]},'chatLicenseExceeded':{'type':Sequelize[_0xe524('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x687b=['TEXT','STRING','sequelize','exports'];(function(_0x34a257,_0x521057){var _0xb8818c=function(_0x3fac06){while(--_0x3fac06){_0x34a257['push'](_0x34a257['shift']());}};_0xb8818c(++_0x521057);}(_0x687b,0x14a));var _0xb687=function(_0x5c7883,_0x2d0e2e){_0x5c7883=_0x5c7883-0x0;var _0x2e4777=_0x687b[_0x5c7883];return _0x2e4777;};'use strict';var Sequelize=require(_0xb687('0x0'));module[_0xb687('0x1')]={'license':{'type':Sequelize[_0xb687('0x2')]},'data1':{'type':Sequelize[_0xb687('0x3')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'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 6a47776..ddcecef 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 _0x0248=['querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','then','destroy','error','name','send','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','options','getLicense','catch','update','body','License','find','params','get','checkLicense','key','demo','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x1a7011,_0x44b2c2){var _0x5c1c7a=function(_0x5ae062){while(--_0x5ae062){_0x1a7011['push'](_0x1a7011['shift']());}};_0x5c1c7a(++_0x44b2c2);}(_0x0248,0x130));var _0x8024=function(_0x508ead,_0x41e952){_0x508ead=_0x508ead-0x0;var _0x5ba4ba=_0x0248[_0x508ead];return _0x5ba4ba;};'use strict';var pdf=require(_0x8024('0x0'));var emlformat=require(_0x8024('0x1'));var rimraf=require(_0x8024('0x2'));var zipdir=require(_0x8024('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8024('0x4'));var moment=require(_0x8024('0x5'));var BPromise=require(_0x8024('0x6'));var Mustache=require(_0x8024('0x7'));var util=require('util');var path=require(_0x8024('0x8'));var sox=require(_0x8024('0x9'));var csv=require('to-csv');var ejs=require(_0x8024('0xa'));var fs=require('fs');var _=require(_0x8024('0xb'));var squel=require(_0x8024('0xc'));var crypto=require(_0x8024('0xd'));var jsforce=require(_0x8024('0xe'));var deskjs=require(_0x8024('0xf'));var toCsv=require('to-csv');var querystring=require(_0x8024('0x10'));var Papa=require('papaparse');var Redis=require(_0x8024('0x11'));var authService=require(_0x8024('0x12'));var qs=require(_0x8024('0x13'));var as=require(_0x8024('0x14'));var hardwareService=require(_0x8024('0x15'));var logger=require(_0x8024('0x16'))(_0x8024('0x17'));var utils=require(_0x8024('0x18'));var config=require(_0x8024('0x19'));var db=require(_0x8024('0x1a'))['db'];function respondWithStatusCode(_0x1aad8e,_0x28ade6){_0x28ade6=_0x28ade6||0xcc;return function(_0x5b8e76){if(_0x5b8e76){return _0x1aad8e[_0x8024('0x1b')](_0x28ade6);}return _0x1aad8e[_0x8024('0x1c')](_0x28ade6)[_0x8024('0x1d')]();};}function respondWithResult(_0x1a8ed8,_0x3149aa){_0x3149aa=_0x3149aa||0xc8;return function(_0x5c33a4){if(_0x5c33a4){return _0x1a8ed8[_0x8024('0x1c')](_0x3149aa)[_0x8024('0x1e')](_0x5c33a4);}};}function respondWithFilteredResult(_0x423059,_0x36ff35){return function(_0x29b207){if(_0x29b207){var _0x6482d6=_0x29b207[_0x8024('0x1f')],_0x4ec9e0=_0x36ff35['offset'],_0x25ffa6=_0x36ff35[_0x8024('0x20')]+_0x36ff35[_0x8024('0x21')],_0x7e9cec;if(_0x25ffa6>=_0x6482d6){_0x25ffa6=_0x6482d6;_0x7e9cec=0xc8;}else{_0x7e9cec=0xce;}_0x423059[_0x8024('0x1c')](_0x7e9cec);return _0x423059[_0x8024('0x22')]('Content-Range',_0x4ec9e0+'-'+_0x25ffa6+'/'+_0x6482d6)[_0x8024('0x1e')](_0x29b207);}return null;};}function patchUpdates(_0x52fbad){return function(_0x4a5fff){try{jsonpatch[_0x8024('0x23')](_0x4a5fff,_0x52fbad,!![]);}catch(_0x5d60bd){return BPromise[_0x8024('0x24')](_0x5d60bd);}return _0x4a5fff[_0x8024('0x25')]();};}function saveUpdates(_0x25b160,_0x147bf4){return function(_0x261780){if(_0x261780){return _0x261780['update'](_0x25b160)[_0x8024('0x26')](function(_0x7b1b76){return _0x7b1b76;});}return null;};}function removeEntity(_0x505985,_0xeff71c){return function(_0x24ff38){if(_0x24ff38){return _0x24ff38[_0x8024('0x27')]()[_0x8024('0x26')](function(){_0x505985[_0x8024('0x1c')](0xcc)[_0x8024('0x1d')]();});}};}function handleEntityNotFound(_0x5cde6e,_0x3ad173){return function(_0x2657df){if(!_0x2657df){_0x5cde6e[_0x8024('0x1b')](0x194);}return _0x2657df;};}function handleError(_0x4ed840,_0x24d70b){_0x24d70b=_0x24d70b||0x1f4;return function(_0x24e4c4){logger[_0x8024('0x28')](_0x24e4c4['stack']);if(_0x24e4c4[_0x8024('0x29')]){delete _0x24e4c4['name'];}_0x4ed840[_0x8024('0x1c')](_0x24d70b)[_0x8024('0x2a')](_0x24e4c4);};}var utilLicense=require('../../config/license/util');exports['index']=function(_0x1a1f46,_0x38916a){var _0x50cb7b={'raw':!![],'where':{'id':0x1}},_0x130561={};_0x130561[_0x8024('0x2b')]=_[_0x8024('0x2c')](db['License'][_0x8024('0x2d')]);_0x130561['query']=_['keys'](_0x1a1f46[_0x8024('0x2e')]);_0x130561[_0x8024('0x2f')]=_[_0x8024('0x30')](_0x130561[_0x8024('0x2b')],_0x130561['query']);_0x50cb7b[_0x8024('0x31')]=_['intersection'](_0x130561[_0x8024('0x2b')],qs[_0x8024('0x32')](_0x1a1f46['query'][_0x8024('0x32')]));_0x50cb7b['attributes']=_0x50cb7b[_0x8024('0x31')][_0x8024('0x33')]?_0x50cb7b[_0x8024('0x31')]:_0x130561[_0x8024('0x2b')];_0x50cb7b=_['merge']({},_0x50cb7b,_0x1a1f46[_0x8024('0x34')]);return utilLicense[_0x8024('0x35')](_0x50cb7b)[_0x8024('0x26')](respondWithResult(_0x38916a,null))[_0x8024('0x36')](handleError(_0x38916a,null));};exports[_0x8024('0x37')]=function(_0x1c8b77,_0x255b8e){if(_0x1c8b77[_0x8024('0x38')]['id']){delete _0x1c8b77[_0x8024('0x38')]['id'];}return db[_0x8024('0x39')][_0x8024('0x3a')]({'where':{'id':_0x1c8b77[_0x8024('0x3b')]['id']}})[_0x8024('0x26')](handleEntityNotFound(_0x255b8e,null))[_0x8024('0x26')](function(_0x341bb7){var _0x39897c=_0x341bb7[_0x8024('0x3c')]({'plain':!![]});return utilLicense[_0x8024('0x3d')](_0x39897c,_0x1c8b77[_0x8024('0x38')][_0x8024('0x3e')]);})['then'](function(_0x381726){if(!_0x381726[_0x8024('0x3f')]){return saveUpdates(_0x1c8b77[_0x8024('0x38')],null);}return _0x381726;})[_0x8024('0x26')](respondWithResult(_0x255b8e,null))[_0x8024('0x36')](handleError(_0x255b8e,null));}; \ No newline at end of file +var _0xab47=['keys','License','query','filters','intersection','attributes','fields','length','merge','options','getLicense','catch','body','find','checkLicense','demo','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','set','Content-Range','json','apply','update','then','end','stack','name','send','../../config/license/util','model'];(function(_0x53cd49,_0x25a9ca){var _0x774d2c=function(_0x125b79){while(--_0x125b79){_0x53cd49['push'](_0x53cd49['shift']());}};_0x774d2c(++_0x25a9ca);}(_0xab47,0x7c));var _0x7ab4=function(_0x1196bd,_0xba4aea){_0x1196bd=_0x1196bd-0x0;var _0x26014f=_0xab47[_0x1196bd];return _0x26014f;};'use strict';var pdf=require(_0x7ab4('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7ab4('0x1'));var zipdir=require(_0x7ab4('0x2'));var jsonpatch=require(_0x7ab4('0x3'));var rp=require('request-promise');var moment=require(_0x7ab4('0x4'));var BPromise=require(_0x7ab4('0x5'));var Mustache=require(_0x7ab4('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x7ab4('0x7'));var ejs=require(_0x7ab4('0x8'));var fs=require('fs');var _=require(_0x7ab4('0x9'));var squel=require('squel');var crypto=require(_0x7ab4('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x7ab4('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7ab4('0xc'));var Redis=require(_0x7ab4('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x7ab4('0xe'));var as=require(_0x7ab4('0xf'));var hardwareService=require(_0x7ab4('0x10'));var logger=require(_0x7ab4('0x11'))(_0x7ab4('0x12'));var utils=require(_0x7ab4('0x13'));var config=require(_0x7ab4('0x14'));var db=require(_0x7ab4('0x15'))['db'];function respondWithStatusCode(_0x4f51dc,_0xa8626f){_0xa8626f=_0xa8626f||0xcc;return function(_0x12f946){if(_0x12f946){return _0x4f51dc[_0x7ab4('0x16')](_0xa8626f);}return _0x4f51dc['status'](_0xa8626f)['end']();};}function respondWithResult(_0x411ff5,_0x212f6d){_0x212f6d=_0x212f6d||0xc8;return function(_0x550f41){if(_0x550f41){return _0x411ff5[_0x7ab4('0x17')](_0x212f6d)['json'](_0x550f41);}};}function respondWithFilteredResult(_0x3e0a27,_0x53f84a){return function(_0x1ab8cc){if(_0x1ab8cc){var _0x4456b9=_0x1ab8cc[_0x7ab4('0x18')],_0x4b5e38=_0x53f84a['offset'],_0x4ab4f0=_0x53f84a[_0x7ab4('0x19')]+_0x53f84a['limit'],_0x404f04;if(_0x4ab4f0>=_0x4456b9){_0x4ab4f0=_0x4456b9;_0x404f04=0xc8;}else{_0x404f04=0xce;}_0x3e0a27[_0x7ab4('0x17')](_0x404f04);return _0x3e0a27[_0x7ab4('0x1a')](_0x7ab4('0x1b'),_0x4b5e38+'-'+_0x4ab4f0+'/'+_0x4456b9)[_0x7ab4('0x1c')](_0x1ab8cc);}return null;};}function patchUpdates(_0x1ce4d7){return function(_0x2c263f){try{jsonpatch[_0x7ab4('0x1d')](_0x2c263f,_0x1ce4d7,!![]);}catch(_0x3a2209){return BPromise['reject'](_0x3a2209);}return _0x2c263f['save']();};}function saveUpdates(_0x528275,_0x2671bd){return function(_0x4c2acc){if(_0x4c2acc){return _0x4c2acc[_0x7ab4('0x1e')](_0x528275)[_0x7ab4('0x1f')](function(_0x352d5c){return _0x352d5c;});}return null;};}function removeEntity(_0xb26de5,_0x4e4b8f){return function(_0x5869db){if(_0x5869db){return _0x5869db['destroy']()[_0x7ab4('0x1f')](function(){_0xb26de5['status'](0xcc)[_0x7ab4('0x20')]();});}};}function handleEntityNotFound(_0x242d09,_0x389357){return function(_0x2d5987){if(!_0x2d5987){_0x242d09[_0x7ab4('0x16')](0x194);}return _0x2d5987;};}function handleError(_0x560adb,_0x38b502){_0x38b502=_0x38b502||0x1f4;return function(_0x51f54f){logger['error'](_0x51f54f[_0x7ab4('0x21')]);if(_0x51f54f[_0x7ab4('0x22')]){delete _0x51f54f[_0x7ab4('0x22')];}_0x560adb['status'](_0x38b502)[_0x7ab4('0x23')](_0x51f54f);};}var utilLicense=require(_0x7ab4('0x24'));exports['index']=function(_0x4df201,_0x58a153){var _0x2e8bc2={'raw':!![],'where':{'id':0x1}},_0x5f1044={};_0x5f1044[_0x7ab4('0x25')]=_[_0x7ab4('0x26')](db[_0x7ab4('0x27')]['rawAttributes']);_0x5f1044['query']=_['keys'](_0x4df201[_0x7ab4('0x28')]);_0x5f1044[_0x7ab4('0x29')]=_[_0x7ab4('0x2a')](_0x5f1044[_0x7ab4('0x25')],_0x5f1044['query']);_0x2e8bc2[_0x7ab4('0x2b')]=_['intersection'](_0x5f1044[_0x7ab4('0x25')],qs[_0x7ab4('0x2c')](_0x4df201[_0x7ab4('0x28')][_0x7ab4('0x2c')]));_0x2e8bc2[_0x7ab4('0x2b')]=_0x2e8bc2[_0x7ab4('0x2b')][_0x7ab4('0x2d')]?_0x2e8bc2[_0x7ab4('0x2b')]:_0x5f1044['model'];_0x2e8bc2=_[_0x7ab4('0x2e')]({},_0x2e8bc2,_0x4df201[_0x7ab4('0x2f')]);return utilLicense[_0x7ab4('0x30')](_0x2e8bc2)['then'](respondWithResult(_0x58a153,null))[_0x7ab4('0x31')](handleError(_0x58a153,null));};exports['update']=function(_0x1ad219,_0xa820a4){if(_0x1ad219[_0x7ab4('0x32')]['id']){delete _0x1ad219[_0x7ab4('0x32')]['id'];}return db[_0x7ab4('0x27')][_0x7ab4('0x33')]({'where':{'id':_0x1ad219['params']['id']}})[_0x7ab4('0x1f')](handleEntityNotFound(_0xa820a4,null))[_0x7ab4('0x1f')](function(_0x240756){var _0x362d14=_0x240756['get']({'plain':!![]});return utilLicense[_0x7ab4('0x34')](_0x362d14,_0x1ad219[_0x7ab4('0x32')]['key']);})[_0x7ab4('0x1f')](function(_0x3982e5){if(!_0x3982e5[_0x7ab4('0x35')]){return saveUpdates(_0x1ad219[_0x7ab4('0x32')],null);}return _0x3982e5;})[_0x7ab4('0x1f')](respondWithResult(_0xa820a4,null))[_0x7ab4('0x31')](handleError(_0xa820a4,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 397c5a1..2247e2c 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 _0x851e=['../../config/environment','exports','define','License','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x2926ad,_0xadc0da){var _0x56c53b=function(_0x1a2c4f){while(--_0x1a2c4f){_0x2926ad['push'](_0x2926ad['shift']());}};_0x56c53b(++_0xadc0da);}(_0x851e,0x1e8));var _0xe851=function(_0x494986,_0x4debb8){_0x494986=_0x494986-0x0;var _0x1c805b=_0x851e[_0x494986];return _0x1c805b;};'use strict';var _=require(_0xe851('0x0'));var util=require(_0xe851('0x1'));var logger=require(_0xe851('0x2'))('api');var moment=require('moment');var BPromise=require(_0xe851('0x3'));var rp=require(_0xe851('0x4'));var fs=require('fs');var path=require(_0xe851('0x5'));var rimraf=require(_0xe851('0x6'));var config=require(_0xe851('0x7'));var attributes=require('./license.attributes');module[_0xe851('0x8')]=function(_0x2b36b5,_0xba0648){return _0x2b36b5[_0xe851('0x9')](_0xe851('0xa'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6629=['rimraf','exports','define','util','../../config/logger','api','request-promise','path'];(function(_0x17236f,_0x219673){var _0x30d509=function(_0xb0af93){while(--_0xb0af93){_0x17236f['push'](_0x17236f['shift']());}};_0x30d509(++_0x219673);}(_0x6629,0xf3));var _0x9662=function(_0x1b6ca0,_0x157c99){_0x1b6ca0=_0x1b6ca0-0x0;var _0x2f086d=_0x6629[_0x1b6ca0];return _0x2f086d;};'use strict';var _=require('lodash');var util=require(_0x9662('0x0'));var logger=require(_0x9662('0x1'))(_0x9662('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9662('0x3'));var fs=require('fs');var path=require(_0x9662('0x4'));var rimraf=require(_0x9662('0x5'));var config=require('../../config/environment');var attributes=require('./license.attributes');module[_0x9662('0x6')]=function(_0x1c0805,_0xdbdc93){return _0x1c0805[_0x9662('0x7')]('License',attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index bc419bd..ce81b07 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 _0x7d13=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','License,\x20%s,\x20%s','message','result','catch','util','bluebird'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0x7d13,0x6c));var _0x37d1=function(_0x1ccdac,_0x1e7f93){_0x1ccdac=_0x1ccdac-0x0;var _0x15dddf=_0x7d13[_0x1ccdac];return _0x15dddf;};'use strict';var _=require('lodash');var util=require(_0x37d1('0x0'));var moment=require('moment');var BPromise=require(_0x37d1('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x37d1('0x2'));var db=require(_0x37d1('0x3'))['db'];var utils=require(_0x37d1('0x4'));var logger=require(_0x37d1('0x5'))(_0x37d1('0x6'));var config=require('../../config/environment');var jayson=require(_0x37d1('0x7'));var client=jayson[_0x37d1('0x8')][_0x37d1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x27ac1d,_0x5146e3,_0x9302bd){return new BPromise(function(_0x41dfaa,_0x115eca){return client[_0x37d1('0xa')](_0x27ac1d,_0x9302bd)[_0x37d1('0xb')](function(_0x636359){logger[_0x37d1('0xc')]('License,\x20%s,\x20%s',_0x5146e3,'request\x20sent');logger[_0x37d1('0xd')](_0x37d1('0xe'),_0x5146e3,'request\x20sent',JSON[_0x37d1('0xf')](_0x636359));if(_0x636359[_0x37d1('0x10')]){if(_0x636359[_0x37d1('0x10')][_0x37d1('0x11')]===0x1f4){logger[_0x37d1('0x10')](_0x37d1('0x12'),_0x5146e3,_0x636359[_0x37d1('0x10')][_0x37d1('0x13')]);return _0x115eca(_0x636359['error'][_0x37d1('0x13')]);}logger[_0x37d1('0x10')]('License,\x20%s,\x20%s',_0x5146e3,_0x636359[_0x37d1('0x10')][_0x37d1('0x13')]);return _0x41dfaa(_0x636359['error'][_0x37d1('0x13')]);}else{logger[_0x37d1('0xc')]('License,\x20%s,\x20%s',_0x5146e3,'request\x20sent');_0x41dfaa(_0x636359[_0x37d1('0x14')][_0x37d1('0x13')]);}})[_0x37d1('0x15')](function(_0x5ded71){logger[_0x37d1('0x10')](_0x37d1('0x12'),_0x5146e3,_0x5ded71);_0x115eca(_0x5ded71);});});} \ No newline at end of file +var _0xbf82=['ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','randomstring'];(function(_0x10fb52,_0x10a0d1){var _0x473428=function(_0x990e1b){while(--_0x990e1b){_0x10fb52['push'](_0x10fb52['shift']());}};_0x473428(++_0x10a0d1);}(_0xbf82,0x1cb));var _0x2bf8=function(_0x49ae68,_0x5bd43b){_0x49ae68=_0x49ae68-0x0;var _0x81f434=_0xbf82[_0x49ae68];return _0x81f434;};'use strict';var _=require(_0x2bf8('0x0'));var util=require('util');var moment=require(_0x2bf8('0x1'));var BPromise=require('bluebird');var rs=require(_0x2bf8('0x2'));var fs=require('fs');var Redis=require(_0x2bf8('0x3'));var db=require(_0x2bf8('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2bf8('0x5'));var config=require(_0x2bf8('0x6'));var jayson=require(_0x2bf8('0x7'));var client=jayson[_0x2bf8('0x8')][_0x2bf8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5a3818,_0x586bd5,_0x1c57e9){return new BPromise(function(_0x5c1944,_0x130e6d){return client[_0x2bf8('0xa')](_0x5a3818,_0x1c57e9)[_0x2bf8('0xb')](function(_0x596d31){logger[_0x2bf8('0xc')](_0x2bf8('0xd'),_0x586bd5,_0x2bf8('0xe'));logger[_0x2bf8('0xf')](_0x2bf8('0x10'),_0x586bd5,_0x2bf8('0xe'),JSON[_0x2bf8('0x11')](_0x596d31));if(_0x596d31[_0x2bf8('0x12')]){if(_0x596d31[_0x2bf8('0x12')][_0x2bf8('0x13')]===0x1f4){logger[_0x2bf8('0x12')]('License,\x20%s,\x20%s',_0x586bd5,_0x596d31[_0x2bf8('0x12')]['message']);return _0x130e6d(_0x596d31[_0x2bf8('0x12')]['message']);}logger['error'](_0x2bf8('0xd'),_0x586bd5,_0x596d31[_0x2bf8('0x12')][_0x2bf8('0x14')]);return _0x5c1944(_0x596d31[_0x2bf8('0x12')][_0x2bf8('0x14')]);}else{logger['info']('License,\x20%s,\x20%s',_0x586bd5,_0x2bf8('0xe'));_0x5c1944(_0x596d31[_0x2bf8('0x15')][_0x2bf8('0x14')]);}})['catch'](function(_0x15c040){logger[_0x2bf8('0x12')](_0x2bf8('0xd'),_0x586bd5,_0x15c040);_0x130e6d(_0x15c040);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 9138354..f9a7285 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 _0x9805=['./mailAccount.controller','get','isAuthenticated','index','/describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','/:id/interactions','getApplications','getMessages','/:id/users','getAgents','addDisposition','post','addImap','addApplications','/:id/send','send','addAgents','put','update','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','/:id','destroy','removeAgents','exports','util','path','connect-timeout','express','../../components/interaction/service'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x9805,0x11a));var _0x5980=function(_0x70fa60,_0x1460c0){_0x70fa60=_0x70fa60-0x0;var _0xa48a63=_0x9805[_0x70fa60];return _0xa48a63;};'use strict';var multer=require('multer');var util=require(_0x5980('0x0'));var path=require(_0x5980('0x1'));var timeout=require(_0x5980('0x2'));var express=require(_0x5980('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x5980('0x4'));var config=require('../../config/environment');var controller=require(_0x5980('0x5'));router[_0x5980('0x6')]('/',auth[_0x5980('0x7')](),controller[_0x5980('0x8')]);router['get'](_0x5980('0x9'),auth[_0x5980('0x7')](),controller['describe']);router[_0x5980('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x5980('0xa')]);router['get'](_0x5980('0xb'),auth[_0x5980('0x7')](),controller[_0x5980('0xc')]);router[_0x5980('0x6')](_0x5980('0xd'),auth[_0x5980('0x7')](),controller[_0x5980('0xe')]);router[_0x5980('0x6')](_0x5980('0xf'),auth[_0x5980('0x7')](),controller[_0x5980('0x10')]);router[_0x5980('0x6')](_0x5980('0x11'),auth[_0x5980('0x7')](),controller['getSmtp']);router['get'](_0x5980('0x12'),auth[_0x5980('0x7')](),controller['getInteractions']);router[_0x5980('0x6')]('/:id/applications',auth[_0x5980('0x7')](),controller[_0x5980('0x13')]);router['get']('/:id/messages',auth[_0x5980('0x7')](),controller[_0x5980('0x14')]);router[_0x5980('0x6')]('/:id/verify',auth[_0x5980('0x7')](),controller['verifySmtp']);router[_0x5980('0x6')](_0x5980('0x15'),auth[_0x5980('0x7')](),controller[_0x5980('0x16')]);router['post'](_0x5980('0xb'),auth[_0x5980('0x7')](),controller[_0x5980('0x17')]);router[_0x5980('0x18')](_0x5980('0xd'),auth['isAuthenticated'](),controller['addAnswer']);router[_0x5980('0x18')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5980('0x18')](_0x5980('0xf'),auth['isAuthenticated'](),controller[_0x5980('0x19')]);router[_0x5980('0x18')](_0x5980('0x11'),auth[_0x5980('0x7')](),controller['addSmtp']);router[_0x5980('0x18')](_0x5980('0x12'),auth[_0x5980('0x7')](),controller['addInteraction']);router[_0x5980('0x18')]('/:id/applications',auth[_0x5980('0x7')](),controller[_0x5980('0x1a')]);router[_0x5980('0x18')](_0x5980('0x1b'),auth[_0x5980('0x7')](),controller[_0x5980('0x1c')]);router[_0x5980('0x18')]('/:id/users',auth[_0x5980('0x7')](),controller[_0x5980('0x1d')]);router[_0x5980('0x1e')]('/:id',auth[_0x5980('0x7')](),controller[_0x5980('0x1f')]);router[_0x5980('0x20')](_0x5980('0xb'),auth[_0x5980('0x7')](),controller[_0x5980('0x21')]);router[_0x5980('0x20')]('/:id/canned_answers',auth[_0x5980('0x7')](),controller[_0x5980('0x22')]);router['delete']('/:id/in_servers',auth[_0x5980('0x7')](),controller[_0x5980('0x23')]);router[_0x5980('0x20')](_0x5980('0x11'),auth[_0x5980('0x7')](),controller[_0x5980('0x24')]);router[_0x5980('0x20')](_0x5980('0x25'),auth[_0x5980('0x7')](),controller[_0x5980('0x26')]);router[_0x5980('0x20')](_0x5980('0x15'),auth[_0x5980('0x7')](),controller[_0x5980('0x27')]);module[_0x5980('0x28')]=router; \ No newline at end of file +var _0x6802=['Router','../../components/auth/service','../../components/interaction/service','./mailAccount.controller','get','isAuthenticated','index','/describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','getImap','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','getMessages','/:id/verify','verifySmtp','/:id/users','post','addAnswer','create','addImap','/:id/out_servers','addSmtp','addApplications','send','put','update','removeDispositions','delete','removeAnswers','removeImap','/:id','removeAgents','exports','util','path','connect-timeout','express'];(function(_0x38f8f3,_0x253b6e){var _0x5160b5=function(_0x77e10f){while(--_0x77e10f){_0x38f8f3['push'](_0x38f8f3['shift']());}};_0x5160b5(++_0x253b6e);}(_0x6802,0x1aa));var _0x2680=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x6802[_0x51020b];return _0x371e47;};'use strict';var multer=require('multer');var util=require(_0x2680('0x0'));var path=require(_0x2680('0x1'));var timeout=require(_0x2680('0x2'));var express=require(_0x2680('0x3'));var router=express[_0x2680('0x4')]();var auth=require(_0x2680('0x5'));var interaction=require(_0x2680('0x6'));var config=require('../../config/environment');var controller=require(_0x2680('0x7'));router[_0x2680('0x8')]('/',auth[_0x2680('0x9')](),controller[_0x2680('0xa')]);router[_0x2680('0x8')](_0x2680('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x2680('0x8')]('/:id',auth[_0x2680('0x9')](),controller[_0x2680('0xc')]);router[_0x2680('0x8')](_0x2680('0xd'),auth[_0x2680('0x9')](),controller['getDispositions']);router[_0x2680('0x8')](_0x2680('0xe'),auth[_0x2680('0x9')](),controller[_0x2680('0xf')]);router['get']('/:id/in_servers',auth[_0x2680('0x9')](),controller[_0x2680('0x10')]);router[_0x2680('0x8')]('/:id/out_servers',auth['isAuthenticated'](),controller[_0x2680('0x11')]);router['get'](_0x2680('0x12'),auth[_0x2680('0x9')](),controller[_0x2680('0x13')]);router[_0x2680('0x8')](_0x2680('0x14'),auth[_0x2680('0x9')](),controller[_0x2680('0x15')]);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0x2680('0x16')]);router[_0x2680('0x8')](_0x2680('0x17'),auth[_0x2680('0x9')](),controller[_0x2680('0x18')]);router['get'](_0x2680('0x19'),auth[_0x2680('0x9')](),controller['getAgents']);router[_0x2680('0x1a')](_0x2680('0xd'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x2680('0x1a')](_0x2680('0xe'),auth['isAuthenticated'](),controller[_0x2680('0x1b')]);router[_0x2680('0x1a')]('/',auth[_0x2680('0x9')](),controller[_0x2680('0x1c')]);router[_0x2680('0x1a')]('/:id/in_servers',auth[_0x2680('0x9')](),controller[_0x2680('0x1d')]);router[_0x2680('0x1a')](_0x2680('0x1e'),auth['isAuthenticated'](),controller[_0x2680('0x1f')]);router[_0x2680('0x1a')](_0x2680('0x12'),auth[_0x2680('0x9')](),controller['addInteraction']);router[_0x2680('0x1a')](_0x2680('0x14'),auth['isAuthenticated'](),controller[_0x2680('0x20')]);router[_0x2680('0x1a')]('/:id/send',auth[_0x2680('0x9')](),controller[_0x2680('0x21')]);router[_0x2680('0x1a')](_0x2680('0x19'),auth[_0x2680('0x9')](),controller['addAgents']);router[_0x2680('0x22')]('/:id',auth[_0x2680('0x9')](),controller[_0x2680('0x23')]);router['delete']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x2680('0x24')]);router[_0x2680('0x25')]('/:id/canned_answers',auth[_0x2680('0x9')](),controller[_0x2680('0x26')]);router[_0x2680('0x25')]('/:id/in_servers',auth['isAuthenticated'](),controller[_0x2680('0x27')]);router[_0x2680('0x25')](_0x2680('0x1e'),auth[_0x2680('0x9')](),controller['removeSmtp']);router[_0x2680('0x25')](_0x2680('0x28'),auth['isAuthenticated'](),controller['destroy']);router[_0x2680('0x25')](_0x2680('0x19'),auth['isAuthenticated'](),controller[_0x2680('0x29')]);module[_0x2680('0x2a')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 3127bba..b694627 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 _0x94b1=['BOOLEAN','Arial,Helvetica,sans-serif','UNSIGNED','TEXT','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x94b1,0x12a));var _0x194b=function(_0x50500b,_0x315b0a){_0x50500b=_0x50500b-0x0;var _0x39f643=_0x94b1[_0x50500b];return _0x39f643;};'use strict';var Sequelize=require(_0x194b('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x194b('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x194b('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x194b('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x194b('0x1')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0x194b('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x194b('0x1')],'allowNull':![],'defaultValue':_0x194b('0x3')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0x194b('0x4')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x194b('0x5')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize[_0x194b('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x194b('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x194b('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x194b('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x194b('0x6')],'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[_0x194b('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x194b('0x7')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x194b('0x8'),'set':function(_0x48a2fb){if(!_0x48a2fb)this['setDataValue']('mandatoryDispositionPauseId',null);this['setDataValue'](_0x194b('0x9'),_0x48a2fb);}}}; \ No newline at end of file +var _0xc342=['INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif'];(function(_0x14a5b6,_0x129c3d){var _0x595566=function(_0x3b8c0f){while(--_0x3b8c0f){_0x14a5b6['push'](_0x14a5b6['shift']());}};_0x595566(++_0x129c3d);}(_0xc342,0x72));var _0x2c34=function(_0x22d655,_0x3941dd){_0x22d655=_0x22d655-0x0;var _0x257739=_0xc342[_0x22d655];return _0x257739;};'use strict';var Sequelize=require(_0x2c34('0x0'));module[_0x2c34('0x1')]={'description':{'type':Sequelize[_0x2c34('0x2')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x2c34('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x2c34('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x2c34('0x3')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x2c34('0x4')]},'markAsUnread':{'type':Sequelize[_0x2c34('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2c34('0x5')},'fontSize':{'type':Sequelize[_0x2c34('0x6')](0x2)[_0x2c34('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x2c34('0x4')],'defaultValue':function(){return _0x2c34('0x8');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x2c34('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2c34('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2c34('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2c34('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x2c34('0x3')],'defaultValue':![],'comment':_0x2c34('0x9'),'set':function(_0x568032){if(!_0x568032)this[_0x2c34('0xa')]('mandatoryDispositionPauseId',null);this[_0x2c34('0xa')](_0x2c34('0xb'),_0x568032);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 7db1df9..8c9f29b 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 _0xb65d=['MailMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','CmList','updatedAt','from','format','%s\x20<%s>','email','attachments','join','root','basename','auth','secure','SendMail','sendMail','List\x20not\x20found','List','Contacts','messageId','subject','out','Interaction','Messages','verifySmtp','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','isArray','userMailAccount:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','register','client','http','test','ValidationError','request','then','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','end','status','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','UserProfileResource','sendStatus','stack','name','send','index','MailServerIn','Imap','MailServerOut','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','MailAccount','count','includeAll','include','rows','show','params','Smtp','find','body','describe','addDisposition','MailAccountId','Disposition','create','findOne','findAll','removeDispositions','addAnswer','getAnswers','CannedAnswer','nolimit','removeAnswers','ids','ListId','isNil','active','description','cauthentication','password','cpassword','authentication','host','port','service','cservice','user','cuser','pass','get','role','UserProfileSection','MailAccounts','userProfileId','autoAssociation','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','transaction','MailApplication','findAndCountAll','priority','getApplications','getMessages'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb65d,0x1b0));var _0xdb65=function(_0x43e809,_0x13775c){_0x43e809=_0x43e809-0x0;var _0x229a48=_0xb65d[_0x43e809];return _0x229a48;};'use strict';var pdf=require(_0xdb65('0x0'));var emlformat=require(_0xdb65('0x1'));var rimraf=require(_0xdb65('0x2'));var zipdir=require(_0xdb65('0x3'));var jsonpatch=require(_0xdb65('0x4'));var rp=require(_0xdb65('0x5'));var moment=require(_0xdb65('0x6'));var BPromise=require(_0xdb65('0x7'));var Mustache=require(_0xdb65('0x8'));var util=require(_0xdb65('0x9'));var path=require('path');var sox=require(_0xdb65('0xa'));var csv=require(_0xdb65('0xb'));var ejs=require(_0xdb65('0xc'));var fs=require('fs');var _=require(_0xdb65('0xd'));var squel=require(_0xdb65('0xe'));var crypto=require(_0xdb65('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xdb65('0xb'));var querystring=require('querystring');var Papa=require(_0xdb65('0x10'));var Redis=require(_0xdb65('0x11'));var authService=require(_0xdb65('0x12'));var qs=require(_0xdb65('0x13'));var as=require(_0xdb65('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdb65('0x15'))(_0xdb65('0x16'));var utils=require('../../config/utils');var config=require(_0xdb65('0x17'));var db=require(_0xdb65('0x18'))['db'];config[_0xdb65('0x19')]=_[_0xdb65('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdb65('0x19')]));require('./mailAccount.socket')[_0xdb65('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0xdb65('0x1c')][_0xdb65('0x1d')]({'port':0x232b});function checkPasswordPattern(_0xaa435,_0x417488,_0x452cca){if(_0x452cca){var _0x3f3d69=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3f3d69[_0xdb65('0x1e')](_0x417488)){return _0xaa435;}else{throw new db['Sequelize'][(_0xdb65('0x1f'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0xaa435;}}function respondWithRpcPromise(_0x3ae98a,_0x1fac1d,_0x4eee3d,_0x3d50cc){return new BPromise(function(_0x326bd1,_0xa6290a){var _0x478ec9=_0x3d50cc||client;return _0x478ec9[_0xdb65('0x20')](_0x3ae98a,_0x4eee3d)[_0xdb65('0x21')](function(_0x1fb8b5){logger[_0xdb65('0x22')](_0xdb65('0x23'),_0x1fac1d,'request\x20sent');logger[_0xdb65('0x24')](_0xdb65('0x25'),_0x1fac1d,_0xdb65('0x26'),JSON[_0xdb65('0x27')](_0x1fb8b5));if(_0x1fb8b5[_0xdb65('0x28')]){if(_0x1fb8b5[_0xdb65('0x28')][_0xdb65('0x29')]===0x1f4){logger[_0xdb65('0x28')](_0xdb65('0x23'),_0x1fac1d,_0x1fb8b5[_0xdb65('0x28')][_0xdb65('0x2a')]);return _0xa6290a(_0x1fb8b5['error']['message']);}logger[_0xdb65('0x28')](_0xdb65('0x23'),_0x1fac1d,_0x1fb8b5[_0xdb65('0x28')][_0xdb65('0x2a')]);return _0x326bd1(_0x1fb8b5[_0xdb65('0x28')][_0xdb65('0x2a')]);}else{logger[_0xdb65('0x22')]('MailAccount,\x20%s,\x20%s',_0x1fac1d,_0xdb65('0x26'));_0x326bd1(_0x1fb8b5[_0xdb65('0x2b')][_0xdb65('0x2a')]);}})[_0xdb65('0x2c')](function(_0x39d775){logger['error']('MailAccount,\x20%s,\x20%s',_0x1fac1d,_0x39d775);_0xa6290a(_0x39d775);});});}function respondWithStatusCode(_0x2ea520,_0x1edcc3){_0x1edcc3=_0x1edcc3||0xcc;return function(_0x3711fe){if(_0x3711fe){return _0x2ea520['sendStatus'](_0x1edcc3);}return _0x2ea520['status'](_0x1edcc3)[_0xdb65('0x2d')]();};}function respondWithResult(_0x5b9423,_0x2a9ae6){_0x2a9ae6=_0x2a9ae6||0xc8;return function(_0x55bd45){if(_0x55bd45){return _0x5b9423[_0xdb65('0x2e')](_0x2a9ae6)[_0xdb65('0x2f')](_0x55bd45);}};}function respondWithFilteredResult(_0xb30dae,_0x1dbc74){return function(_0x285d46){if(_0x285d46){var _0x39f13b=_0x285d46['count'],_0x376f14=_0x1dbc74['offset'],_0x995860=_0x1dbc74[_0xdb65('0x30')]+_0x1dbc74[_0xdb65('0x31')],_0x100206;if(_0x995860>=_0x39f13b){_0x995860=_0x39f13b;_0x100206=0xc8;}else{_0x100206=0xce;}_0xb30dae['status'](_0x100206);return _0xb30dae[_0xdb65('0x32')](_0xdb65('0x33'),_0x376f14+'-'+_0x995860+'/'+_0x39f13b)[_0xdb65('0x2f')](_0x285d46);}return null;};}function patchUpdates(_0x2fa361){return function(_0x46d0bc){try{jsonpatch[_0xdb65('0x34')](_0x46d0bc,_0x2fa361,!![]);}catch(_0x3b3c0b){return BPromise[_0xdb65('0x35')](_0x3b3c0b);}return _0x46d0bc[_0xdb65('0x36')]();};}function saveUpdates(_0x5d0c59,_0x8db891){return function(_0x490166){if(_0x490166){return _0x490166[_0xdb65('0x37')](_0x5d0c59)[_0xdb65('0x21')](function(_0x2c4b1c){return _0x2c4b1c;});}return null;};}function removeEntity(_0xdd2f6c,_0x2d9d6a){return function(_0x4e6d63){if(_0x4e6d63){return _0x4e6d63[_0xdb65('0x38')]()[_0xdb65('0x21')](function(){var _0x226e11=_0x4e6d63['get']({'plain':!![]});var _0x51b1bc='MailAccounts';return db[_0xdb65('0x39')][_0xdb65('0x38')]({'where':{'type':_0x51b1bc,'resourceId':_0x226e11['id']}})['then'](function(){return _0x4e6d63;});})[_0xdb65('0x21')](function(){_0xdd2f6c[_0xdb65('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1985fb,_0x170621){return function(_0x4dce3c){if(!_0x4dce3c){_0x1985fb[_0xdb65('0x3a')](0x194);}return _0x4dce3c;};}function handleError(_0x4da397,_0xa3ed78){_0xa3ed78=_0xa3ed78||0x1f4;return function(_0x57e593){logger[_0xdb65('0x28')](_0x57e593[_0xdb65('0x3b')]);if(_0x57e593[_0xdb65('0x3c')]){delete _0x57e593[_0xdb65('0x3c')];}_0x4da397['status'](_0xa3ed78)[_0xdb65('0x3d')](_0x57e593);};}exports[_0xdb65('0x3e')]=function(_0x129f90,_0x5b043a){var _0x1961dc={'include':[{'model':db[_0xdb65('0x3f')],'as':_0xdb65('0x40')},{'model':db[_0xdb65('0x41')],'as':'Smtp'},{'model':db['Pause'],'as':_0xdb65('0x42')}]},_0x1859ad={},_0x58f373={'count':0x0,'rows':[]};var _0x1da3f7=_[_0xdb65('0x43')](db['MailAccount'][_0xdb65('0x44')],function(_0x59d877){return{'name':_0x59d877[_0xdb65('0x45')],'type':_0x59d877[_0xdb65('0x46')][_0xdb65('0x47')]};});_0x1859ad[_0xdb65('0x48')]=_['map'](_0x1da3f7,_0xdb65('0x3c'));_0x1859ad['query']=_[_0xdb65('0x49')](_0x129f90[_0xdb65('0x4a')]);_0x1859ad[_0xdb65('0x4b')]=_[_0xdb65('0x4c')](_0x1859ad[_0xdb65('0x48')],_0x1859ad['query']);_0x1961dc[_0xdb65('0x4d')]=_[_0xdb65('0x4c')](_0x1859ad[_0xdb65('0x48')],qs[_0xdb65('0x4e')](_0x129f90[_0xdb65('0x4a')][_0xdb65('0x4e')]));_0x1961dc[_0xdb65('0x4d')]=_0x1961dc[_0xdb65('0x4d')][_0xdb65('0x4f')]?_0x1961dc[_0xdb65('0x4d')]:_0x1859ad[_0xdb65('0x48')];if(!_0x129f90[_0xdb65('0x4a')][_0xdb65('0x50')]('nolimit')){_0x1961dc[_0xdb65('0x31')]=qs[_0xdb65('0x31')](_0x129f90[_0xdb65('0x4a')][_0xdb65('0x31')]);_0x1961dc[_0xdb65('0x30')]=qs[_0xdb65('0x30')](_0x129f90[_0xdb65('0x4a')]['offset']);}_0x1961dc[_0xdb65('0x51')]=qs[_0xdb65('0x52')](_0x129f90[_0xdb65('0x4a')][_0xdb65('0x52')]);_0x1961dc[_0xdb65('0x53')]=qs[_0xdb65('0x4b')](_[_0xdb65('0x54')](_0x129f90['query'],_0x1859ad[_0xdb65('0x4b')]));if(_0x129f90[_0xdb65('0x4a')]['filter']){_0x1961dc[_0xdb65('0x53')]=_[_0xdb65('0x55')](_0x1961dc[_0xdb65('0x53')],{'$or':_['map'](_0x1da3f7,function(_0x2468ae){if(_0x2468ae['type']!==_0xdb65('0x56')){var _0x1f7095={};_0x1f7095[_0x2468ae[_0xdb65('0x3c')]]={'$like':'%'+_0x129f90[_0xdb65('0x4a')][_0xdb65('0x57')]+'%'};return _0x1f7095;}})});}_0x1961dc=_[_0xdb65('0x55')]({},_0x1961dc,_0x129f90[_0xdb65('0x58')]);var _0x1e5f5b={'where':_0x1961dc[_0xdb65('0x53')]};return db[_0xdb65('0x59')][_0xdb65('0x5a')](_0x1e5f5b)[_0xdb65('0x21')](function(_0x24ce7c){_0x58f373[_0xdb65('0x5a')]=_0x24ce7c;if(_0x129f90[_0xdb65('0x4a')][_0xdb65('0x5b')]){_0x1961dc[_0xdb65('0x5c')]=[{'all':!![]}];}return db[_0xdb65('0x59')]['findAll'](_0x1961dc);})[_0xdb65('0x21')](function(_0xc14555){_0x58f373[_0xdb65('0x5d')]=_0xc14555;return _0x58f373;})[_0xdb65('0x21')](respondWithFilteredResult(_0x5b043a,_0x1961dc))[_0xdb65('0x2c')](handleError(_0x5b043a,null));};exports[_0xdb65('0x5e')]=function(_0xf1c48d,_0x56c3f7){var _0xfd1908={'raw':![],'where':{'id':_0xf1c48d[_0xdb65('0x5f')]['id']},'include':[{'model':db[_0xdb65('0x3f')],'as':_0xdb65('0x40')},{'model':db['MailServerOut'],'as':_0xdb65('0x60')},{'model':db['Pause'],'as':_0xdb65('0x42')}]},_0x554f14={};_0x554f14[_0xdb65('0x48')]=_[_0xdb65('0x49')](db[_0xdb65('0x59')][_0xdb65('0x44')]);_0x554f14[_0xdb65('0x4a')]=_[_0xdb65('0x49')](_0xf1c48d['query']);_0x554f14[_0xdb65('0x4b')]=_[_0xdb65('0x4c')](_0x554f14[_0xdb65('0x48')],_0x554f14[_0xdb65('0x4a')]);_0xfd1908[_0xdb65('0x4d')]=_[_0xdb65('0x4c')](_0x554f14['model'],qs[_0xdb65('0x4e')](_0xf1c48d['query'][_0xdb65('0x4e')]));_0xfd1908['attributes']=_0xfd1908[_0xdb65('0x4d')][_0xdb65('0x4f')]?_0xfd1908[_0xdb65('0x4d')]:_0x554f14['model'];if(_0xf1c48d[_0xdb65('0x4a')]['includeAll']){_0xfd1908[_0xdb65('0x5c')]=[{'all':!![]}];}_0xfd1908=_[_0xdb65('0x55')]({},_0xfd1908,_0xf1c48d['options']);return db[_0xdb65('0x59')][_0xdb65('0x61')](_0xfd1908)[_0xdb65('0x21')](handleEntityNotFound(_0x56c3f7,null))['then'](respondWithResult(_0x56c3f7,null))[_0xdb65('0x2c')](handleError(_0x56c3f7,null));};exports[_0xdb65('0x37')]=function(_0x3b6e45,_0x14a715){if(_0x3b6e45['body']['id']){delete _0x3b6e45['body']['id'];}return db[_0xdb65('0x59')]['find']({'where':{'id':_0x3b6e45[_0xdb65('0x5f')]['id']},'include':[{'model':db[_0xdb65('0x3f')],'as':_0xdb65('0x40')},{'model':db[_0xdb65('0x41')],'as':_0xdb65('0x60')},{'model':db['Pause'],'as':_0xdb65('0x42')}]})[_0xdb65('0x21')](handleEntityNotFound(_0x14a715,null))[_0xdb65('0x21')](saveUpdates(_0x3b6e45[_0xdb65('0x62')],null))['then'](function(_0x3bc8dc){if(_0x3bc8dc&&_0x3b6e45['body'][_0xdb65('0x40')]){return db[_0xdb65('0x3f')][_0xdb65('0x37')](_0x3b6e45[_0xdb65('0x62')][_0xdb65('0x40')],{'where':{'MailAccountId':_0x3bc8dc['id']}})['then'](function(){return _0x3bc8dc;});}return _0x3bc8dc;})[_0xdb65('0x21')](function(_0x16587e){if(_0x16587e&&_0x3b6e45[_0xdb65('0x62')]['Smtp']){return db[_0xdb65('0x41')][_0xdb65('0x37')](_0x3b6e45[_0xdb65('0x62')]['Smtp'],{'where':{'MailAccountId':_0x16587e['id']}})['then'](function(){return _0x16587e;});}return _0x16587e;})[_0xdb65('0x21')](respondWithResult(_0x14a715,null))[_0xdb65('0x2c')](handleError(_0x14a715,null));};exports[_0xdb65('0x63')]=function(_0xb286e3,_0xdb389c){return db[_0xdb65('0x59')]['describe']()[_0xdb65('0x21')](respondWithResult(_0xdb389c,null))['catch'](handleError(_0xdb389c,null));};exports[_0xdb65('0x64')]=function(_0x22d245,_0x5da18d,_0x92348c){if(_0x22d245['body']['id']){delete _0x22d245[_0xdb65('0x62')]['id'];}return db[_0xdb65('0x59')][_0xdb65('0x61')]({'where':{'id':_0x22d245[_0xdb65('0x5f')]['id']}})['then'](handleEntityNotFound(_0x5da18d,null))['then'](function(_0x4d4e77){if(_0x4d4e77){_0x22d245[_0xdb65('0x62')][_0xdb65('0x65')]=_0x4d4e77['id'];return db[_0xdb65('0x66')][_0xdb65('0x67')](_0x22d245[_0xdb65('0x62')]);}})[_0xdb65('0x21')](respondWithResult(_0x5da18d,null))[_0xdb65('0x2c')](handleError(_0x5da18d,null));};exports['getDispositions']=function(_0x6d3023,_0x2883b7,_0x2f53a1){var _0x34884d={'raw':![],'where':{}};var _0x4dbe0f={};var _0x214af8={'count':0x0,'rows':[]};return db[_0xdb65('0x59')][_0xdb65('0x68')]({'where':{'id':_0x6d3023[_0xdb65('0x5f')]['id']}})[_0xdb65('0x21')](handleEntityNotFound(_0x2883b7,null))[_0xdb65('0x21')](function(_0x3632e9){if(_0x3632e9){_0x4dbe0f[_0xdb65('0x48')]=_[_0xdb65('0x49')](db[_0xdb65('0x66')][_0xdb65('0x44')]);_0x4dbe0f[_0xdb65('0x4a')]=_[_0xdb65('0x49')](_0x6d3023['query']);_0x4dbe0f[_0xdb65('0x4b')]=_[_0xdb65('0x4c')](_0x4dbe0f[_0xdb65('0x48')],_0x4dbe0f[_0xdb65('0x4a')]);_0x34884d[_0xdb65('0x4d')]=_['intersection'](_0x4dbe0f[_0xdb65('0x48')],qs[_0xdb65('0x4e')](_0x6d3023['query'][_0xdb65('0x4e')]));_0x34884d[_0xdb65('0x4d')]=_0x34884d[_0xdb65('0x4d')][_0xdb65('0x4f')]?_0x34884d['attributes']:_0x4dbe0f[_0xdb65('0x48')];if(!_0x6d3023[_0xdb65('0x4a')][_0xdb65('0x50')]('nolimit')){_0x34884d[_0xdb65('0x31')]=qs[_0xdb65('0x31')](_0x6d3023[_0xdb65('0x4a')]['limit']);_0x34884d[_0xdb65('0x30')]=qs[_0xdb65('0x30')](_0x6d3023[_0xdb65('0x4a')][_0xdb65('0x30')]);}_0x34884d[_0xdb65('0x51')]=qs['sort'](_0x6d3023[_0xdb65('0x4a')][_0xdb65('0x52')]);_0x34884d[_0xdb65('0x53')]=qs[_0xdb65('0x4b')](_[_0xdb65('0x54')](_0x6d3023[_0xdb65('0x4a')],_0x4dbe0f[_0xdb65('0x4b')]));_0x34884d[_0xdb65('0x53')][_0xdb65('0x65')]=_0x3632e9['id'];if(_0x6d3023[_0xdb65('0x4a')][_0xdb65('0x57')]){_0x34884d['where']=_['merge'](_0x34884d[_0xdb65('0x53')],{'$or':_[_0xdb65('0x43')](_0x34884d[_0xdb65('0x4d')],function(_0x4f8665){var _0x425352={};_0x425352[_0x4f8665]={'$like':'%'+_0x6d3023[_0xdb65('0x4a')]['filter']+'%'};return _0x425352;})});}_0x34884d=_[_0xdb65('0x55')]({},_0x34884d,_0x6d3023[_0xdb65('0x58')]);return db['Disposition'][_0xdb65('0x5a')]({'where':_0x34884d[_0xdb65('0x53')]})[_0xdb65('0x21')](function(_0x356c57){_0x214af8[_0xdb65('0x5a')]=_0x356c57;if(_0x6d3023[_0xdb65('0x4a')][_0xdb65('0x5b')]){_0x34884d['include']=[{'all':!![]}];}return db['Disposition'][_0xdb65('0x69')](_0x34884d);})['then'](function(_0x2c48c8){_0x214af8[_0xdb65('0x5d')]=_0x2c48c8;return _0x214af8;});}})['then'](respondWithFilteredResult(_0x2883b7,_0x34884d))[_0xdb65('0x2c')](handleError(_0x2883b7,null));};exports[_0xdb65('0x6a')]=function(_0x45c122,_0x5b9553,_0x2c9061){return db[_0xdb65('0x59')]['find']({'where':{'id':_0x45c122['params']['id']}})[_0xdb65('0x21')](handleEntityNotFound(_0x5b9553,null))[_0xdb65('0x21')](function(_0x1ff9bb){if(_0x1ff9bb){return _0x1ff9bb[_0xdb65('0x6a')](_0x45c122[_0xdb65('0x4a')]['ids']);}})[_0xdb65('0x21')](respondWithStatusCode(_0x5b9553,null))[_0xdb65('0x2c')](handleError(_0x5b9553,null));};exports[_0xdb65('0x6b')]=function(_0x51602b,_0x153d6d,_0x2f671d){if(_0x51602b[_0xdb65('0x62')]['id']){delete _0x51602b[_0xdb65('0x62')]['id'];}return db[_0xdb65('0x59')][_0xdb65('0x61')]({'where':{'id':_0x51602b['params']['id']}})[_0xdb65('0x21')](handleEntityNotFound(_0x153d6d,null))[_0xdb65('0x21')](function(_0x17840a){if(_0x17840a){_0x51602b[_0xdb65('0x62')][_0xdb65('0x65')]=_0x17840a['id'];return db['CannedAnswer'][_0xdb65('0x67')](_0x51602b[_0xdb65('0x62')]);}})[_0xdb65('0x21')](respondWithResult(_0x153d6d,null))['catch'](handleError(_0x153d6d,null));};exports[_0xdb65('0x6c')]=function(_0x5b84f7,_0x45fcf5,_0x144a03){var _0x4f402d={'raw':![],'where':{}};var _0x2ec375={};var _0x174d2c={'count':0x0,'rows':[]};return db[_0xdb65('0x59')][_0xdb65('0x68')]({'where':{'id':_0x5b84f7['params']['id']}})[_0xdb65('0x21')](handleEntityNotFound(_0x45fcf5,null))[_0xdb65('0x21')](function(_0x115db4){if(_0x115db4){_0x2ec375['model']=_[_0xdb65('0x49')](db[_0xdb65('0x6d')][_0xdb65('0x44')]);_0x2ec375['query']=_[_0xdb65('0x49')](_0x5b84f7[_0xdb65('0x4a')]);_0x2ec375['filters']=_['intersection'](_0x2ec375[_0xdb65('0x48')],_0x2ec375[_0xdb65('0x4a')]);_0x4f402d[_0xdb65('0x4d')]=_[_0xdb65('0x4c')](_0x2ec375[_0xdb65('0x48')],qs[_0xdb65('0x4e')](_0x5b84f7['query']['fields']));_0x4f402d[_0xdb65('0x4d')]=_0x4f402d[_0xdb65('0x4d')][_0xdb65('0x4f')]?_0x4f402d[_0xdb65('0x4d')]:_0x2ec375[_0xdb65('0x48')];if(!_0x5b84f7[_0xdb65('0x4a')]['hasOwnProperty'](_0xdb65('0x6e'))){_0x4f402d[_0xdb65('0x31')]=qs[_0xdb65('0x31')](_0x5b84f7[_0xdb65('0x4a')]['limit']);_0x4f402d[_0xdb65('0x30')]=qs[_0xdb65('0x30')](_0x5b84f7['query'][_0xdb65('0x30')]);}_0x4f402d[_0xdb65('0x51')]=qs[_0xdb65('0x52')](_0x5b84f7[_0xdb65('0x4a')][_0xdb65('0x52')]);_0x4f402d[_0xdb65('0x53')]=qs[_0xdb65('0x4b')](_['pick'](_0x5b84f7['query'],_0x2ec375[_0xdb65('0x4b')]));_0x4f402d[_0xdb65('0x53')][_0xdb65('0x65')]=_0x115db4['id'];if(_0x5b84f7[_0xdb65('0x4a')][_0xdb65('0x57')]){_0x4f402d[_0xdb65('0x53')]=_[_0xdb65('0x55')](_0x4f402d[_0xdb65('0x53')],{'$or':_[_0xdb65('0x43')](_0x4f402d[_0xdb65('0x4d')],function(_0x4b7478){var _0x5623b1={};_0x5623b1[_0x4b7478]={'$like':'%'+_0x5b84f7[_0xdb65('0x4a')][_0xdb65('0x57')]+'%'};return _0x5623b1;})});}_0x4f402d=_[_0xdb65('0x55')]({},_0x4f402d,_0x5b84f7[_0xdb65('0x58')]);return db[_0xdb65('0x6d')][_0xdb65('0x5a')]({'where':_0x4f402d['where']})[_0xdb65('0x21')](function(_0x168080){_0x174d2c[_0xdb65('0x5a')]=_0x168080;if(_0x5b84f7[_0xdb65('0x4a')][_0xdb65('0x5b')]){_0x4f402d[_0xdb65('0x5c')]=[{'all':!![]}];}return db[_0xdb65('0x6d')][_0xdb65('0x69')](_0x4f402d);})[_0xdb65('0x21')](function(_0x41bc60){_0x174d2c[_0xdb65('0x5d')]=_0x41bc60;return _0x174d2c;});}})[_0xdb65('0x21')](respondWithFilteredResult(_0x45fcf5,_0x4f402d))['catch'](handleError(_0x45fcf5,null));};exports[_0xdb65('0x6f')]=function(_0x22b0ea,_0x2c361e,_0x12de53){return db[_0xdb65('0x59')][_0xdb65('0x61')]({'where':{'id':_0x22b0ea['params']['id']}})[_0xdb65('0x21')](handleEntityNotFound(_0x2c361e,null))[_0xdb65('0x21')](function(_0x99f936){if(_0x99f936){return _0x99f936['removeAnswers'](_0x22b0ea[_0xdb65('0x4a')][_0xdb65('0x70')]);}})[_0xdb65('0x21')](respondWithStatusCode(_0x2c361e,null))[_0xdb65('0x2c')](handleError(_0x2c361e,null));};exports[_0xdb65('0x67')]=function(_0x4e6b49,_0x1503cf){var _0x1e68b6={'name':_0x4e6b49[_0xdb65('0x62')]['name'],'key':_0x4e6b49[_0xdb65('0x62')][_0xdb65('0x47')],'email':_0x4e6b49['body']['email'],'ListId':_0x4e6b49[_0xdb65('0x62')][_0xdb65('0x71')],'active':!_[_0xdb65('0x72')](_0x4e6b49[_0xdb65('0x62')][_0xdb65('0x73')])?_0x4e6b49[_0xdb65('0x62')][_0xdb65('0x73')]:!![],'description':_0x4e6b49[_0xdb65('0x62')][_0xdb65('0x74')]||null,'Imap':{},'Smtp':{}};if(_[_0xdb65('0x72')](_0x4e6b49[_0xdb65('0x62')]['cservice'])){if(_0x4e6b49[_0xdb65('0x62')][_0xdb65('0x75')]){_0x1e68b6[_0xdb65('0x40')]['user']=_0x1e68b6[_0xdb65('0x60')]['user']=_0x4e6b49[_0xdb65('0x62')]['cuser'];_0x1e68b6[_0xdb65('0x40')][_0xdb65('0x76')]=_0x1e68b6['Smtp']['pass']=_0x4e6b49[_0xdb65('0x62')][_0xdb65('0x77')];}else{_0x1e68b6['Imap']['authentication']=_0x1e68b6[_0xdb65('0x60')][_0xdb65('0x78')]=![];}_0x1e68b6[_0xdb65('0x40')][_0xdb65('0x79')]=_0x4e6b49['body'][_0xdb65('0x40')][_0xdb65('0x79')];_0x1e68b6[_0xdb65('0x40')][_0xdb65('0x7a')]=_0x4e6b49[_0xdb65('0x62')][_0xdb65('0x40')][_0xdb65('0x7a')];_0x1e68b6[_0xdb65('0x60')]['host']=_0x4e6b49[_0xdb65('0x62')]['Smtp']['host'];_0x1e68b6['Smtp'][_0xdb65('0x7a')]=_0x4e6b49['body'][_0xdb65('0x60')][_0xdb65('0x7a')];}else{_0x1e68b6['Imap'][_0xdb65('0x7b')]=_0x1e68b6[_0xdb65('0x60')]['service']=_0x4e6b49['body'][_0xdb65('0x7c')];_0x1e68b6[_0xdb65('0x40')]['user']=_0x1e68b6[_0xdb65('0x60')][_0xdb65('0x7d')]=_0x4e6b49[_0xdb65('0x62')][_0xdb65('0x7e')];_0x1e68b6[_0xdb65('0x40')][_0xdb65('0x76')]=_0x1e68b6[_0xdb65('0x60')][_0xdb65('0x7f')]=_0x4e6b49['body'][_0xdb65('0x77')];}return db['MailAccount'][_0xdb65('0x67')](_0x1e68b6,{'include':[{'model':db[_0xdb65('0x41')],'as':_0xdb65('0x60')},{'model':db['MailServerIn'],'as':_0xdb65('0x40')}]})[_0xdb65('0x21')](function(_0x1d4b2b){var _0x12f935=_0x4e6b49[_0xdb65('0x7d')][_0xdb65('0x80')]({'plain':!![]});if(!_0x12f935)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x12f935[_0xdb65('0x81')]===_0xdb65('0x7d')){var _0x491ded=_0x1d4b2b['get']({'plain':!![]});return db[_0xdb65('0x82')][_0xdb65('0x61')]({'where':{'name':_0xdb65('0x83'),'userProfileId':_0x12f935[_0xdb65('0x84')]},'raw':!![]})[_0xdb65('0x21')](function(_0x2430ba){if(_0x2430ba&&_0x2430ba[_0xdb65('0x85')]===0x0){return db[_0xdb65('0x39')]['create']({'name':_0x491ded[_0xdb65('0x3c')],'resourceId':_0x491ded['id'],'type':_0x2430ba['name'],'sectionId':_0x2430ba['id']},{})['then'](function(){return _0x1d4b2b;});}else{return _0x1d4b2b;}})[_0xdb65('0x2c')](function(_0x3d5e5f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3d5e5f);throw _0x3d5e5f;});}return _0x1d4b2b;})['then'](respondWithResult(_0x1503cf,0xc9))[_0xdb65('0x2c')](handleError(_0x1503cf,null));};exports[_0xdb65('0x86')]=function(_0xac51d1,_0x5b962b,_0x24e352){return db[_0xdb65('0x59')][_0xdb65('0x68')]({'where':{'id':_0xac51d1['params']['id']}})[_0xdb65('0x21')](handleEntityNotFound(_0x5b962b,null))[_0xdb65('0x21')](function(_0x212077){if(_0x212077){return _0x212077[_0xdb65('0x86')]();}return null;})[_0xdb65('0x21')](respondWithResult(_0x5b962b,null))['catch'](handleError(_0x5b962b,null));};exports[_0xdb65('0x87')]=function(_0x2d17b1,_0x154621,_0x578759){if(_0x2d17b1['body']['id']){delete _0x2d17b1[_0xdb65('0x62')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x2d17b1[_0xdb65('0x5f')]['id']}})[_0xdb65('0x21')](handleEntityNotFound(_0x154621,null))[_0xdb65('0x21')](function(_0x582ceb){if(_0x582ceb){_0x2d17b1[_0xdb65('0x62')][_0xdb65('0x65')]=_0x582ceb['id'];return db[_0xdb65('0x3f')][_0xdb65('0x67')](_0x2d17b1[_0xdb65('0x62')]);}})['then'](respondWithResult(_0x154621,null))[_0xdb65('0x2c')](handleError(_0x154621,null));};exports[_0xdb65('0x88')]=function(_0x3f9e33,_0x5656ec,_0x16ba50){return db[_0xdb65('0x59')][_0xdb65('0x68')]({'where':{'id':_0x3f9e33[_0xdb65('0x5f')]['id']}})['then'](handleEntityNotFound(_0x5656ec,null))[_0xdb65('0x21')](function(_0x21ffb8){if(_0x21ffb8){return _0x21ffb8[_0xdb65('0x89')](null);}return null;})[_0xdb65('0x21')](respondWithStatusCode(_0x5656ec,null))[_0xdb65('0x2c')](handleError(_0x5656ec,null));};exports[_0xdb65('0x8a')]=function(_0x4d8548,_0x1c7203,_0x5047b0){return db[_0xdb65('0x59')][_0xdb65('0x68')]({'where':{'id':_0x4d8548[_0xdb65('0x5f')]['id']}})[_0xdb65('0x21')](handleEntityNotFound(_0x1c7203,null))[_0xdb65('0x21')](function(_0x2b7dd7){if(_0x2b7dd7){return _0x2b7dd7['getSmtp']();}return null;})[_0xdb65('0x21')](respondWithResult(_0x1c7203,null))[_0xdb65('0x2c')](handleError(_0x1c7203,null));};exports[_0xdb65('0x8b')]=function(_0x3578c9,_0x5ab1a3,_0x36e099){if(_0x3578c9[_0xdb65('0x62')]['id']){delete _0x3578c9[_0xdb65('0x62')]['id'];}return db[_0xdb65('0x59')][_0xdb65('0x61')]({'where':{'id':_0x3578c9[_0xdb65('0x5f')]['id']}})[_0xdb65('0x21')](handleEntityNotFound(_0x5ab1a3,null))[_0xdb65('0x21')](function(_0x96fa2a){if(_0x96fa2a){_0x3578c9[_0xdb65('0x62')]['MailAccountId']=_0x96fa2a['id'];return db[_0xdb65('0x41')]['create'](_0x3578c9[_0xdb65('0x62')]);}})[_0xdb65('0x21')](respondWithResult(_0x5ab1a3,null))[_0xdb65('0x2c')](handleError(_0x5ab1a3,null));};exports['removeSmtp']=function(_0x472e0c,_0x33a4ae,_0x554c6f){return db[_0xdb65('0x59')][_0xdb65('0x68')]({'where':{'id':_0x472e0c['params']['id']}})['then'](handleEntityNotFound(_0x33a4ae,null))[_0xdb65('0x21')](function(_0x4ada96){if(_0x4ada96){return _0x4ada96[_0xdb65('0x8c')](null);}return null;})[_0xdb65('0x21')](respondWithStatusCode(_0x33a4ae,null))[_0xdb65('0x2c')](handleError(_0x33a4ae,null));};exports[_0xdb65('0x8d')]=function(_0x5745ba,_0x27812d,_0x2b0133){return db[_0xdb65('0x8e')][_0xdb65('0x61')]({'where':{'id':_0x5745ba[_0xdb65('0x5f')]['id']}})[_0xdb65('0x21')](handleEntityNotFound(_0x27812d,null))['then'](function(_0x3a1d90){if(_0x3a1d90){return _0x3a1d90['addInteraction'](_0x5745ba['body'][_0xdb65('0x70')],_[_0xdb65('0x8f')](_0x5745ba[_0xdb65('0x62')],[_0xdb65('0x70'),'id'])||{});}})[_0xdb65('0x21')](respondWithResult(_0x27812d,null))['catch'](handleError(_0x27812d,null));};exports[_0xdb65('0x90')]=function(_0x31330d,_0x5577df,_0x505bbe){var _0x3bc904={'raw':![],'where':{}};var _0x3cb94f={};var _0x2d20e5={'count':0x0,'rows':[]};return db['MailAccount'][_0xdb65('0x68')]({'where':{'id':_0x31330d['params']['id']}})['then'](handleEntityNotFound(_0x5577df,null))['then'](function(_0x39e7f2){if(_0x39e7f2){_0x3cb94f[_0xdb65('0x48')]=_[_0xdb65('0x49')](db[_0xdb65('0x8e')][_0xdb65('0x44')]);_0x3cb94f['query']=_[_0xdb65('0x49')](_0x31330d[_0xdb65('0x4a')]);_0x3cb94f[_0xdb65('0x4b')]=_[_0xdb65('0x4c')](_0x3cb94f[_0xdb65('0x48')],_0x3cb94f['query']);_0x3bc904['attributes']=_[_0xdb65('0x4c')](_0x3cb94f[_0xdb65('0x48')],qs[_0xdb65('0x4e')](_0x31330d[_0xdb65('0x4a')]['fields']));_0x3bc904['attributes']=_0x3bc904[_0xdb65('0x4d')][_0xdb65('0x4f')]?_0x3bc904[_0xdb65('0x4d')]:_0x3cb94f[_0xdb65('0x48')];if(!_0x31330d[_0xdb65('0x4a')]['hasOwnProperty'](_0xdb65('0x6e'))){_0x3bc904['limit']=qs['limit'](_0x31330d[_0xdb65('0x4a')][_0xdb65('0x31')]);_0x3bc904[_0xdb65('0x30')]=qs['offset'](_0x31330d['query'][_0xdb65('0x30')]);}_0x3bc904[_0xdb65('0x51')]=qs[_0xdb65('0x52')](_0x31330d[_0xdb65('0x4a')][_0xdb65('0x52')]);_0x3bc904['where']=qs[_0xdb65('0x4b')](_[_0xdb65('0x54')](_0x31330d[_0xdb65('0x4a')],_0x3cb94f[_0xdb65('0x4b')]));_0x3bc904['where'][_0xdb65('0x65')]=_0x39e7f2['id'];if(_0x31330d[_0xdb65('0x4a')]['filter']){_0x3bc904[_0xdb65('0x53')]=_['merge'](_0x3bc904[_0xdb65('0x53')],{'$or':_[_0xdb65('0x43')](_0x3bc904[_0xdb65('0x4d')],function(_0x1e92b9){var _0x2cd0b0={};_0x2cd0b0[_0x1e92b9]={'$like':'%'+_0x31330d['query'][_0xdb65('0x57')]+'%'};return _0x2cd0b0;})});}_0x3bc904=_[_0xdb65('0x55')]({},_0x3bc904,_0x31330d[_0xdb65('0x58')]);return db['MailInteraction'][_0xdb65('0x5a')]({'where':_0x3bc904[_0xdb65('0x53')]})[_0xdb65('0x21')](function(_0x2ae8a2){_0x2d20e5[_0xdb65('0x5a')]=_0x2ae8a2;if(_0x31330d[_0xdb65('0x4a')][_0xdb65('0x5b')]){_0x3bc904[_0xdb65('0x5c')]=[{'model':db[_0xdb65('0x91')],'as':_0xdb65('0x92'),'required':![]},{'model':db[_0xdb65('0x93')],'as':_0xdb65('0x94'),'attributes':[_0xdb65('0x3c'),_0xdb65('0x95'),_0xdb65('0x96')],'required':![]},{'model':db[_0xdb65('0x97')],'as':_0xdb65('0x98'),'attributes':['id',_0xdb65('0x3c'),_0xdb65('0x99')],'where':_0x31330d[_0xdb65('0x4a')][_0xdb65('0x9a')]?{'id':_0x31330d[_0xdb65('0x4a')][_0xdb65('0x9a')]}:undefined,'required':_0x31330d[_0xdb65('0x4a')][_0xdb65('0x9a')]?!![]:![]}];}return db[_0xdb65('0x8e')][_0xdb65('0x69')](_0x3bc904);})[_0xdb65('0x21')](function(_0x3830c9){_0x2d20e5[_0xdb65('0x5d')]=_0x3830c9;return _0x2d20e5;});}})[_0xdb65('0x21')](respondWithFilteredResult(_0x5577df,_0x3bc904))['catch'](handleError(_0x5577df,null));};exports[_0xdb65('0x9b')]=function(_0x15ac14,_0x13d866,_0x1b6fd6){return db[_0xdb65('0x59')][_0xdb65('0x68')]({'where':{'id':_0x15ac14[_0xdb65('0x5f')]['id']}})[_0xdb65('0x21')](handleEntityNotFound(_0x13d866,null))[_0xdb65('0x21')](function(_0x97db29){if(_0x97db29){return db['sequelize'][_0xdb65('0x9c')](function(_0x105f82){return db[_0xdb65('0x9d')]['destroy']({'where':{'MailAccountId':_0x15ac14[_0xdb65('0x5f')]['id']},'transaction':_0x105f82})['then'](function(_0x426dc5){var _0x3a49c8=_[_0xdb65('0x43')](_0x15ac14[_0xdb65('0x62')],function(_0x2ad302){_0x2ad302[_0xdb65('0x65')]=_0x15ac14[_0xdb65('0x5f')]['id'];return _0x2ad302;});return db[_0xdb65('0x9d')]['bulkCreate'](_0x3a49c8,{'transaction':_0x105f82});});})[_0xdb65('0x21')](function(){return db[_0xdb65('0x9d')][_0xdb65('0x9e')]({'where':{'MailAccountId':_0x15ac14[_0xdb65('0x5f')]['id']},'order':_0xdb65('0x9f')});});}})['then'](respondWithResult(_0x13d866,null))[_0xdb65('0x2c')](handleError(_0x13d866,null));};exports[_0xdb65('0xa0')]=function(_0x45fc91,_0x5072b3,_0x340f54){var _0x754353={};var _0xc4bd9d={};var _0x3310e1;var _0x216422;return db[_0xdb65('0x59')][_0xdb65('0x68')]({'where':{'id':_0x45fc91[_0xdb65('0x5f')]['id']}})[_0xdb65('0x21')](handleEntityNotFound(_0x5072b3,null))['then'](function(_0x17ed18){if(_0x17ed18){_0x3310e1=_0x17ed18;_0xc4bd9d['model']=_[_0xdb65('0x49')](db[_0xdb65('0x9d')]['rawAttributes']);_0xc4bd9d[_0xdb65('0x4a')]=_[_0xdb65('0x49')](_0x45fc91[_0xdb65('0x4a')]);_0xc4bd9d[_0xdb65('0x4b')]=_[_0xdb65('0x4c')](_0xc4bd9d[_0xdb65('0x48')],_0xc4bd9d[_0xdb65('0x4a')]);_0x754353[_0xdb65('0x4d')]=_[_0xdb65('0x4c')](_0xc4bd9d[_0xdb65('0x48')],qs[_0xdb65('0x4e')](_0x45fc91[_0xdb65('0x4a')]['fields']));_0x754353[_0xdb65('0x4d')]=_0x754353[_0xdb65('0x4d')][_0xdb65('0x4f')]?_0x754353[_0xdb65('0x4d')]:_0xc4bd9d[_0xdb65('0x48')];_0x754353['order']=qs[_0xdb65('0x52')](_0x45fc91[_0xdb65('0x4a')][_0xdb65('0x52')]);_0x754353['where']=qs[_0xdb65('0x4b')](_[_0xdb65('0x54')](_0x45fc91[_0xdb65('0x4a')],_0xc4bd9d[_0xdb65('0x4b')]));if(_0x45fc91['query'][_0xdb65('0x57')]){_0x754353['where']=_['merge'](_0x754353['where'],{'$or':_[_0xdb65('0x43')](_0x754353[_0xdb65('0x4d')],function(_0x2fd2cd){var _0x43b145={};_0x43b145[_0x2fd2cd]={'$like':'%'+_0x45fc91[_0xdb65('0x4a')][_0xdb65('0x57')]+'%'};return _0x43b145;})});}_0x754353=_[_0xdb65('0x55')]({},_0x754353,_0x45fc91['options']);return _0x3310e1[_0xdb65('0xa0')](_0x754353);}})[_0xdb65('0x21')](function(_0xcf7473){if(_0xcf7473){_0x216422=_0xcf7473['length'];if(!_0x45fc91[_0xdb65('0x4a')][_0xdb65('0x50')]('nolimit')){_0x754353['limit']=qs['limit'](_0x45fc91[_0xdb65('0x4a')][_0xdb65('0x31')]);_0x754353[_0xdb65('0x30')]=qs[_0xdb65('0x30')](_0x45fc91['query'][_0xdb65('0x30')]);}return _0x3310e1[_0xdb65('0xa0')](_0x754353);}})[_0xdb65('0x21')](function(_0x399500){if(_0x399500){return _0x399500?{'count':_0x216422,'rows':_0x399500}:null;}})['then'](respondWithResult(_0x5072b3,null))[_0xdb65('0x2c')](handleError(_0x5072b3,null));};exports[_0xdb65('0xa1')]=function(_0x5e6455,_0x37d191,_0x3f44d3){var _0x24315c={'raw':!![],'where':{}};var _0x17b67d={};var _0x25594c={'count':0x0,'rows':[]};return db['MailAccount'][_0xdb65('0x68')]({'where':{'id':_0x5e6455[_0xdb65('0x5f')]['id']}})[_0xdb65('0x21')](handleEntityNotFound(_0x37d191,null))['then'](function(_0x452f22){if(_0x452f22){_0x17b67d[_0xdb65('0x48')]=_[_0xdb65('0x49')](db[_0xdb65('0xa2')]['rawAttributes']);_0x17b67d[_0xdb65('0x4a')]=_[_0xdb65('0x49')](_0x5e6455[_0xdb65('0x4a')]);_0x17b67d[_0xdb65('0x4b')]=_[_0xdb65('0x4c')](_0x17b67d[_0xdb65('0x48')],_0x17b67d[_0xdb65('0x4a')]);_0x24315c['attributes']=_[_0xdb65('0x4c')](_0x17b67d[_0xdb65('0x48')],qs[_0xdb65('0x4e')](_0x5e6455[_0xdb65('0x4a')][_0xdb65('0x4e')]));_0x24315c['attributes']=_0x24315c[_0xdb65('0x4d')][_0xdb65('0x4f')]?_0x24315c['attributes']:_0x17b67d['model'];if(!_0x5e6455[_0xdb65('0x4a')][_0xdb65('0x50')](_0xdb65('0x6e'))){_0x24315c[_0xdb65('0x31')]=qs[_0xdb65('0x31')](_0x5e6455[_0xdb65('0x4a')][_0xdb65('0x31')]);_0x24315c[_0xdb65('0x30')]=qs['offset'](_0x5e6455[_0xdb65('0x4a')][_0xdb65('0x30')]);}_0x24315c[_0xdb65('0x51')]=qs[_0xdb65('0x52')](_0x5e6455[_0xdb65('0x4a')][_0xdb65('0x52')]);_0x24315c[_0xdb65('0x53')]=qs[_0xdb65('0x4b')](_['pick'](_0x5e6455[_0xdb65('0x4a')],_0x17b67d[_0xdb65('0x4b')]));_0x24315c['where'][_0xdb65('0x65')]=_0x452f22['id'];if(_0x5e6455[_0xdb65('0x4a')]['filter']){_0x24315c['where']=_['merge'](_0x24315c[_0xdb65('0x53')],{'$or':_[_0xdb65('0x43')](_0x24315c[_0xdb65('0x4d')],function(_0x46bc3c){var _0x286e7e={};_0x286e7e[_0x46bc3c]={'$like':'%'+_0x5e6455[_0xdb65('0x4a')][_0xdb65('0x57')]+'%'};return _0x286e7e;})});}if(_0x5e6455[_0xdb65('0x4a')][_0xdb65('0xa3')]){var _0x29998a=_0x5e6455[_0xdb65('0x4a')][_0xdb65('0xa3')][_0xdb65('0xa4')](',');var _0x52fe92={};_0x52fe92[_0x29998a[0x0]]={'$gte':moment(_0x29998a[0x1])['format'](_0xdb65('0xa5'))};_0x24315c['where']=_['merge'](_0x24315c[_0xdb65('0x53')],_0x52fe92);}_0x24315c=_[_0xdb65('0x55')]({},_0x24315c,_0x5e6455['options']);return db[_0xdb65('0xa2')][_0xdb65('0x5a')]({'where':_0x24315c[_0xdb65('0x53')]})['then'](function(_0x95cd8f){_0x25594c['count']=_0x95cd8f;if(_0x5e6455[_0xdb65('0x4a')][_0xdb65('0x5b')]){_0x24315c[_0xdb65('0x5c')]=[{'all':!![]}];}return db[_0xdb65('0xa2')][_0xdb65('0x69')](_0x24315c);})[_0xdb65('0x21')](function(_0x5b43a3){_0x25594c[_0xdb65('0x5d')]=_0x5b43a3;return _0x25594c;});}})[_0xdb65('0x21')](respondWithFilteredResult(_0x37d191,_0x24315c))[_0xdb65('0x2c')](handleError(_0x37d191,null));};exports[_0xdb65('0x3d')]=function(_0x342e86,_0x189680,_0x3070c8){var _0x3fe074,_0x1d3e2f={},_0x560ea0;if(_0x342e86[_0xdb65('0x62')]['to']){_0x560ea0=_0x342e86[_0xdb65('0x62')]['to'][_0xdb65('0xa4')](',')[0x0];}return db[_0xdb65('0x59')][_0xdb65('0x61')]({'where':{'id':_0x342e86['params']['id']},'include':[{'model':db[_0xdb65('0xa6')],'as':'List','include':[{'model':db[_0xdb65('0x91')],'as':'Contacts','where':{'email':_0x560ea0},'limit':0x1,'order':[[_0xdb65('0xa7'),'DESC']]}]},{'model':db[_0xdb65('0x41')],'as':'Smtp','raw':!![]}]})[_0xdb65('0x21')](handleEntityNotFound(_0x189680,null))[_0xdb65('0x21')](function(_0x13ea9d){if(_0x13ea9d){_0x3fe074=_0x13ea9d;if(_0x13ea9d['Smtp']){if(_['isNil'](_0x342e86['body'][_0xdb65('0xa8')])){_0x342e86[_0xdb65('0x62')]['from']=util[_0xdb65('0xa9')](_0xdb65('0xaa'),_0x13ea9d[_0xdb65('0x3c')],_0x13ea9d[_0xdb65('0xab')]||_0x13ea9d['Smtp'][_0xdb65('0x7d')]);}if(_0x342e86['body']['attachments']&&_0x342e86['body']['attachments'][_0xdb65('0x4f')]){for(var _0x3219dc=0x0;_0x3219dc<_0x342e86['body'][_0xdb65('0xac')][_0xdb65('0x4f')];_0x3219dc+=0x1){_0x342e86[_0xdb65('0x62')][_0xdb65('0xac')][_0x3219dc]={'filename':_0x342e86[_0xdb65('0x62')][_0xdb65('0xac')][_0x3219dc][_0xdb65('0x3c')],'path':path[_0xdb65('0xad')](config[_0xdb65('0xae')],'server/files/attachments',_0x342e86[_0xdb65('0x62')][_0xdb65('0xac')][_0x3219dc][_0xdb65('0xaf')])};}}var _0x3f8e11={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x13ea9d[_0xdb65('0x60')][_0xdb65('0x7b')])){if(_0x13ea9d[_0xdb65('0x60')][_0xdb65('0x78')]){_0x3f8e11[_0xdb65('0xb0')]={'user':_0x13ea9d['Smtp'][_0xdb65('0x7d')],'pass':_0x13ea9d['Smtp'][_0xdb65('0x7f')]};}_0x3f8e11[_0xdb65('0x79')]=_0x13ea9d['Smtp']['host'];_0x3f8e11[_0xdb65('0x7a')]=_0x13ea9d['Smtp'][_0xdb65('0x7a')];_0x3f8e11[_0xdb65('0xb1')]=_0x13ea9d[_0xdb65('0x60')][_0xdb65('0xb1')];}else{_0x3f8e11[_0xdb65('0x7b')]=_0x13ea9d[_0xdb65('0x60')][_0xdb65('0x7b')];_0x3f8e11[_0xdb65('0xb0')]={'user':_0x13ea9d[_0xdb65('0x60')][_0xdb65('0x7d')],'pass':_0x13ea9d[_0xdb65('0x60')][_0xdb65('0x7f')]};}return respondWithRpcPromise(_0xdb65('0xb2'),_0xdb65('0xb3'),{'account':_0x3f8e11,'message':_0x342e86[_0xdb65('0x62')]});}else{throw new Error(_0xdb65('0xb4'));}}})[_0xdb65('0x21')](function(_0x5e9bf6){if(_0x5e9bf6){_0x1d3e2f=_0x5e9bf6;if(_0x3fe074[_0xdb65('0xb5')]){if(_0x3fe074[_0xdb65('0xb5')][_0xdb65('0xb6')]['length']){return _0x3fe074[_0xdb65('0xb5')][_0xdb65('0xb6')][0x0];}else{return db[_0xdb65('0x91')][_0xdb65('0x67')](_[_0xdb65('0x1a')](_0x342e86[_0xdb65('0x62')],{'firstName':_0x342e86[_0xdb65('0x62')]['to'],'email':_0x342e86[_0xdb65('0x62')]['to'],'phone':_0x342e86[_0xdb65('0x62')]['to'],'ListId':_0x3fe074[_0xdb65('0x71')]}));}}else{throw new Error('List\x20not\x20found');}}})['then'](function(_0x4c7c32){if(_0x4c7c32){var _0x56a2ae={'UserId':_0x342e86[_0xdb65('0x7d')]['id'],'ContactId':_0x4c7c32['id'],'MailAccountId':_0x3fe074['id'],'inReplyTo':_0x1d3e2f[_0xdb65('0xb7')],'to':_0x342e86[_0xdb65('0x62')]['from'],'cc':_0x342e86[_0xdb65('0x62')]['cc'],'subject':_0x342e86[_0xdb65('0x62')][_0xdb65('0xb8')],'attach':_0x342e86[_0xdb65('0x62')]['attach'],'firstMsgDirection':_0xdb65('0xb9'),'lastMsgAt':moment()['format'](_0xdb65('0xa5')),'lastMsgDirection':_0xdb65('0xb9'),'lastMsgBody':_0x342e86['body'][_0xdb65('0x62')],'Messages':[_[_0xdb65('0x55')](_0x342e86['body'],{'messageId':_0x1d3e2f[_0xdb65('0xb7')],'sentAt':moment()[_0xdb65('0xa9')](_0xdb65('0xa5')),'read':!![],'MailAccountId':_0x3fe074['id'],'UserId':_0x342e86[_0xdb65('0x7d')]['id'],'ContactId':_0x4c7c32['id']})]};if(_0x342e86['body'][_0xdb65('0xba')]){_0x56a2ae=_[_0xdb65('0x55')](_0x56a2ae,_0x342e86[_0xdb65('0x62')][_0xdb65('0xba')]);}return db[_0xdb65('0x8e')][_0xdb65('0x67')](_0x56a2ae,{'include':[{'model':db['MailMessage'],'as':_0xdb65('0xbb')}]});}})[_0xdb65('0x21')](respondWithResult(_0x189680,null))[_0xdb65('0x2c')](handleError(_0x189680,null));};exports[_0xdb65('0xbc')]=function(_0x249f9a,_0x9f3f8c,_0x332487){return db[_0xdb65('0x59')][_0xdb65('0x61')]({'where':{'id':_0x249f9a[_0xdb65('0x5f')]['id']},'include':[{'model':db[_0xdb65('0x41')],'as':_0xdb65('0x60'),'raw':!![]}]})['then'](handleEntityNotFound(_0x9f3f8c,null))[_0xdb65('0x21')](function(_0x16ef98){if(_0x16ef98&&_0x16ef98[_0xdb65('0x60')]){var _0x94d71e={'id':_0x16ef98['id'],'tls':{'rejectUnauthorized':![]}};if(_0x16ef98['Smtp'][_0xdb65('0x7b')]){_0x94d71e[_0xdb65('0x7b')]=_0x16ef98[_0xdb65('0x60')]['service'];}else{_0x94d71e['host']=_0x16ef98['Smtp'][_0xdb65('0x79')];_0x94d71e[_0xdb65('0x7a')]=_0x16ef98[_0xdb65('0x60')][_0xdb65('0x7a')];_0x94d71e['secure']=_0x16ef98[_0xdb65('0x60')][_0xdb65('0xb1')];}if(_0x16ef98['Smtp']['authentication']){_0x94d71e[_0xdb65('0xb0')]={'user':_0x16ef98[_0xdb65('0x60')][_0xdb65('0x7d')],'pass':_0x16ef98[_0xdb65('0x60')][_0xdb65('0x7f')]};}return respondWithRpcPromise('VerifySmtp',_0xdb65('0xbc'),{'account':_0x94d71e});}})['then'](respondWithResult(_0x9f3f8c,null))[_0xdb65('0x2c')](handleError(_0x9f3f8c,null));};exports[_0xdb65('0x38')]=function(_0x370e9e,_0x1e1575){return db[_0xdb65('0x59')][_0xdb65('0x61')]({'where':{'id':_0x370e9e[_0xdb65('0x5f')]['id']}})[_0xdb65('0x21')](handleEntityNotFound(_0x1e1575,null))['then'](function(_0x2b3f79){if(_0x2b3f79&&_0x2b3f79[_0xdb65('0x7b')]){throw new db[(_0xdb65('0xbd'))][(_0xdb65('0x1f'))](_0xdb65('0xbe'));}return _0x2b3f79;})[_0xdb65('0x21')](removeEntity(_0x1e1575,null))[_0xdb65('0x2c')](handleError(_0x1e1575,null));};exports[_0xdb65('0xbf')]=function(_0x538274,_0x195f39,_0xc9b115){return db[_0xdb65('0x59')][_0xdb65('0x61')]({'where':{'id':_0x538274['params']['id']}})[_0xdb65('0x21')](handleEntityNotFound(_0x195f39,null))['then'](function(_0x533238){if(_0x533238){return _0x533238[_0xdb65('0xbf')](_0x538274[_0xdb65('0x62')][_0xdb65('0x70')],_[_0xdb65('0x8f')](_0x538274['body'],['ids','id'])||{})[_0xdb65('0xc0')](function(_0x5ba4db){for(var _0x218df3=0x0;_0x218df3<_0x538274[_0xdb65('0x62')]['ids'][_0xdb65('0x4f')];_0x218df3+=0x1){socket[_0xdb65('0xc1')](_0xdb65('0xc2'),{'UserId':_0x538274[_0xdb65('0x62')][_0xdb65('0x70')][_0x218df3],'MailAccountId':_0x538274[_0xdb65('0x5f')]['id']});}return _0x5ba4db;});}})[_0xdb65('0x21')](respondWithResult(_0x195f39,null))[_0xdb65('0x2c')](handleError(_0x195f39,null));};exports['removeAgents']=function(_0x5984c7,_0x5e0207,_0x224000){return db[_0xdb65('0x59')][_0xdb65('0x61')]({'where':{'id':_0x5984c7[_0xdb65('0x5f')]['id']}})[_0xdb65('0x21')](handleEntityNotFound(_0x5e0207,null))['then'](function(_0x14eebe){if(_0x14eebe){return _0x14eebe['removeAgents'](_0x5984c7['query'][_0xdb65('0x70')])[_0xdb65('0x21')](function(){if(_[_0xdb65('0xc3')](_0x5984c7[_0xdb65('0x4a')][_0xdb65('0x70')])){for(var _0x1221b8=0x0;_0x1221b8<_0x5984c7['query']['ids'][_0xdb65('0x4f')];_0x1221b8+=0x1){socket[_0xdb65('0xc1')]('userMailAccount:remove',{'UserId':Number(_0x5984c7['query']['ids'][_0x1221b8]),'MailAccountId':Number(_0x5984c7[_0xdb65('0x5f')]['id'])});}}else{socket[_0xdb65('0xc1')](_0xdb65('0xc4'),{'UserId':Number(_0x5984c7['query'][_0xdb65('0x70')]),'MailAccountId':Number(_0x5984c7[_0xdb65('0x5f')]['id'])});}});}})[_0xdb65('0x21')](respondWithStatusCode(_0x5e0207,null))[_0xdb65('0x2c')](handleError(_0x5e0207,null));};exports[_0xdb65('0xc5')]=function(_0x5c19e3,_0x550b39,_0x3a8737){var _0x231fd6={};var _0x973c1f={};var _0xf8060d;var _0xf3261b;return db[_0xdb65('0x59')][_0xdb65('0x68')]({'where':{'id':_0x5c19e3[_0xdb65('0x5f')]['id']}})[_0xdb65('0x21')](handleEntityNotFound(_0x550b39,null))[_0xdb65('0x21')](function(_0x4a87f9){if(_0x4a87f9){_0xf8060d=_0x4a87f9;_0x973c1f[_0xdb65('0x48')]=_[_0xdb65('0x49')](db[_0xdb65('0x93')]['rawAttributes']);_0x973c1f['query']=_[_0xdb65('0x49')](_0x5c19e3[_0xdb65('0x4a')]);_0x973c1f[_0xdb65('0x4b')]=_[_0xdb65('0x4c')](_0x973c1f[_0xdb65('0x48')],_0x973c1f[_0xdb65('0x4a')]);_0x231fd6[_0xdb65('0x4d')]=_[_0xdb65('0x4c')](_0x973c1f[_0xdb65('0x48')],qs['fields'](_0x5c19e3[_0xdb65('0x4a')][_0xdb65('0x4e')]));_0x231fd6[_0xdb65('0x4d')]=_0x231fd6[_0xdb65('0x4d')][_0xdb65('0x4f')]?_0x231fd6[_0xdb65('0x4d')]:_0x973c1f['model'];_0x231fd6[_0xdb65('0x51')]=qs[_0xdb65('0x52')](_0x5c19e3[_0xdb65('0x4a')]['sort']);_0x231fd6['where']=qs[_0xdb65('0x4b')](_[_0xdb65('0x54')](_0x5c19e3[_0xdb65('0x4a')],_0x973c1f[_0xdb65('0x4b')]));if(_0x5c19e3[_0xdb65('0x4a')][_0xdb65('0x57')]){_0x231fd6[_0xdb65('0x53')]=_[_0xdb65('0x55')](_0x231fd6[_0xdb65('0x53')],{'$or':_[_0xdb65('0x43')](_0x231fd6[_0xdb65('0x4d')],function(_0x45e1e6){var _0x3871ee={};_0x3871ee[_0x45e1e6]={'$like':'%'+_0x5c19e3[_0xdb65('0x4a')][_0xdb65('0x57')]+'%'};return _0x3871ee;})});}_0x231fd6=_[_0xdb65('0x55')]({},_0x231fd6,_0x5c19e3[_0xdb65('0x58')]);return _0xf8060d[_0xdb65('0xc5')](_0x231fd6);}})[_0xdb65('0x21')](function(_0xb35d0c){if(_0xb35d0c){_0xf3261b=_0xb35d0c[_0xdb65('0x4f')];if(!_0x5c19e3[_0xdb65('0x4a')][_0xdb65('0x50')](_0xdb65('0x6e'))){_0x231fd6[_0xdb65('0x31')]=qs[_0xdb65('0x31')](_0x5c19e3[_0xdb65('0x4a')]['limit']);_0x231fd6[_0xdb65('0x30')]=qs[_0xdb65('0x30')](_0x5c19e3[_0xdb65('0x4a')][_0xdb65('0x30')]);}return _0xf8060d[_0xdb65('0xc5')](_0x231fd6);}})['then'](function(_0x1435ba){if(_0x1435ba){return _0x1435ba?{'count':_0xf3261b,'rows':_0x1435ba}:null;}})['then'](respondWithResult(_0x550b39,null))[_0xdb65('0x2c')](handleError(_0x550b39,null));}; \ No newline at end of file +var _0xd0f0=['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','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','tag','addApplications','sequelize','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','getMessages','$gte','format','MailMessage','send','split','CmList','List','Contacts','updatedAt','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','secure','auth','SendMail','List\x20not\x20found','subject','out','YYYY-MM-DD\x20HH:mm:ss','messageId','Interaction','verifySmtp','VerifySmtp','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','offset','set','Content-Range','update','destroy','get','sendStatus','name','index','MailServerOut','Smtp','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','MailAccount','count','include','rows','show','params','MailServerIn','Pause','keys','includeAll','find','body','Imap','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','length','limit','order','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','ListId','active','isNil'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd0f0,0x1d4));var _0x0d0f=function(_0x391507,_0x564142){_0x391507=_0x391507-0x0;var _0x47fdc4=_0xd0f0[_0x391507];return _0x47fdc4;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0d0f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0d0f('0x1'));var jsonpatch=require(_0x0d0f('0x2'));var rp=require(_0x0d0f('0x3'));var moment=require(_0x0d0f('0x4'));var BPromise=require(_0x0d0f('0x5'));var Mustache=require(_0x0d0f('0x6'));var util=require('util');var path=require(_0x0d0f('0x7'));var sox=require(_0x0d0f('0x8'));var csv=require(_0x0d0f('0x9'));var ejs=require(_0x0d0f('0xa'));var fs=require('fs');var _=require(_0x0d0f('0xb'));var squel=require('squel');var crypto=require(_0x0d0f('0xc'));var jsforce=require(_0x0d0f('0xd'));var deskjs=require(_0x0d0f('0xe'));var toCsv=require(_0x0d0f('0x9'));var querystring=require(_0x0d0f('0xf'));var Papa=require(_0x0d0f('0x10'));var Redis=require(_0x0d0f('0x11'));var authService=require(_0x0d0f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0d0f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0d0f('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0d0f('0x15'))['db'];config[_0x0d0f('0x16')]=_[_0x0d0f('0x17')](config['redis'],{'host':_0x0d0f('0x18'),'port':0x18eb});var socket=require(_0x0d0f('0x19'))(new Redis(config['redis']));require(_0x0d0f('0x1a'))[_0x0d0f('0x1b')](socket);var jayson=require(_0x0d0f('0x1c'));var client=jayson[_0x0d0f('0x1d')][_0x0d0f('0x1e')]({'port':0x232b});function checkPasswordPattern(_0x3d368f,_0x2e810a,_0x401766){if(_0x401766){var _0x4316af=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4316af[_0x0d0f('0x1f')](_0x2e810a)){return _0x3d368f;}else{throw new db[(_0x0d0f('0x20'))][(_0x0d0f('0x21'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x3d368f;}}function respondWithRpcPromise(_0xd93cb6,_0x448b20,_0xb925d3,_0x24d7b5){return new BPromise(function(_0x91787e,_0xf9bfee){var _0x3a5c36=_0x24d7b5||client;return _0x3a5c36[_0x0d0f('0x22')](_0xd93cb6,_0xb925d3)[_0x0d0f('0x23')](function(_0x2d70e0){logger[_0x0d0f('0x24')](_0x0d0f('0x25'),_0x448b20,_0x0d0f('0x26'));logger[_0x0d0f('0x27')](_0x0d0f('0x28'),_0x448b20,_0x0d0f('0x26'),JSON[_0x0d0f('0x29')](_0x2d70e0));if(_0x2d70e0[_0x0d0f('0x2a')]){if(_0x2d70e0[_0x0d0f('0x2a')][_0x0d0f('0x2b')]===0x1f4){logger['error']('MailAccount,\x20%s,\x20%s',_0x448b20,_0x2d70e0[_0x0d0f('0x2a')][_0x0d0f('0x2c')]);return _0xf9bfee(_0x2d70e0[_0x0d0f('0x2a')]['message']);}logger[_0x0d0f('0x2a')](_0x0d0f('0x25'),_0x448b20,_0x2d70e0[_0x0d0f('0x2a')][_0x0d0f('0x2c')]);return _0x91787e(_0x2d70e0['error'][_0x0d0f('0x2c')]);}else{logger[_0x0d0f('0x24')]('MailAccount,\x20%s,\x20%s',_0x448b20,_0x0d0f('0x26'));_0x91787e(_0x2d70e0[_0x0d0f('0x2d')][_0x0d0f('0x2c')]);}})[_0x0d0f('0x2e')](function(_0x1d8575){logger[_0x0d0f('0x2a')](_0x0d0f('0x25'),_0x448b20,_0x1d8575);_0xf9bfee(_0x1d8575);});});}function respondWithStatusCode(_0x24af31,_0x434665){_0x434665=_0x434665||0xcc;return function(_0x25b03b){if(_0x25b03b){return _0x24af31['sendStatus'](_0x434665);}return _0x24af31[_0x0d0f('0x2f')](_0x434665)['end']();};}function respondWithResult(_0x5a7f92,_0x3f0ef6){_0x3f0ef6=_0x3f0ef6||0xc8;return function(_0x2e6291){if(_0x2e6291){return _0x5a7f92['status'](_0x3f0ef6)[_0x0d0f('0x30')](_0x2e6291);}};}function respondWithFilteredResult(_0x2b3c33,_0x1ed5e4){return function(_0x257f65){if(_0x257f65){var _0xd25250=_0x257f65['count'],_0x184d5d=_0x1ed5e4[_0x0d0f('0x31')],_0x64310d=_0x1ed5e4['offset']+_0x1ed5e4['limit'],_0x324d0a;if(_0x64310d>=_0xd25250){_0x64310d=_0xd25250;_0x324d0a=0xc8;}else{_0x324d0a=0xce;}_0x2b3c33[_0x0d0f('0x2f')](_0x324d0a);return _0x2b3c33[_0x0d0f('0x32')](_0x0d0f('0x33'),_0x184d5d+'-'+_0x64310d+'/'+_0xd25250)[_0x0d0f('0x30')](_0x257f65);}return null;};}function patchUpdates(_0x35354a){return function(_0x5239cb){try{jsonpatch['apply'](_0x5239cb,_0x35354a,!![]);}catch(_0x3cce7f){return BPromise['reject'](_0x3cce7f);}return _0x5239cb['save']();};}function saveUpdates(_0x167017,_0x583765){return function(_0x208b9a){if(_0x208b9a){return _0x208b9a[_0x0d0f('0x34')](_0x167017)[_0x0d0f('0x23')](function(_0x46adbe){return _0x46adbe;});}return null;};}function removeEntity(_0x16c3ae,_0x5cdb7b){return function(_0x498d48){if(_0x498d48){return _0x498d48[_0x0d0f('0x35')]()['then'](function(){var _0x2f0bc1=_0x498d48[_0x0d0f('0x36')]({'plain':!![]});var _0x581b1e='MailAccounts';return db['UserProfileResource'][_0x0d0f('0x35')]({'where':{'type':_0x581b1e,'resourceId':_0x2f0bc1['id']}})[_0x0d0f('0x23')](function(){return _0x498d48;});})['then'](function(){_0x16c3ae[_0x0d0f('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x458fa5,_0x4b88e4){return function(_0x4f9ab4){if(!_0x4f9ab4){_0x458fa5[_0x0d0f('0x37')](0x194);}return _0x4f9ab4;};}function handleError(_0x49d1d4,_0x37c937){_0x37c937=_0x37c937||0x1f4;return function(_0x7d1141){logger[_0x0d0f('0x2a')](_0x7d1141['stack']);if(_0x7d1141[_0x0d0f('0x38')]){delete _0x7d1141[_0x0d0f('0x38')];}_0x49d1d4[_0x0d0f('0x2f')](_0x37c937)['send'](_0x7d1141);};}exports[_0x0d0f('0x39')]=function(_0x4c47f6,_0xd5dd92){var _0x5ee532={'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db[_0x0d0f('0x3a')],'as':_0x0d0f('0x3b')},{'model':db['Pause'],'as':_0x0d0f('0x3c')}]},_0x80a77d={},_0x49adba={'count':0x0,'rows':[]};var _0x2ab3fe=_[_0x0d0f('0x3d')](db['MailAccount'][_0x0d0f('0x3e')],function(_0x2dce83){return{'name':_0x2dce83[_0x0d0f('0x3f')],'type':_0x2dce83[_0x0d0f('0x40')][_0x0d0f('0x41')]};});_0x80a77d[_0x0d0f('0x42')]=_[_0x0d0f('0x3d')](_0x2ab3fe,'name');_0x80a77d[_0x0d0f('0x43')]=_['keys'](_0x4c47f6[_0x0d0f('0x43')]);_0x80a77d[_0x0d0f('0x44')]=_[_0x0d0f('0x45')](_0x80a77d[_0x0d0f('0x42')],_0x80a77d['query']);_0x5ee532[_0x0d0f('0x46')]=_[_0x0d0f('0x45')](_0x80a77d[_0x0d0f('0x42')],qs[_0x0d0f('0x47')](_0x4c47f6['query'][_0x0d0f('0x47')]));_0x5ee532[_0x0d0f('0x46')]=_0x5ee532[_0x0d0f('0x46')]['length']?_0x5ee532[_0x0d0f('0x46')]:_0x80a77d[_0x0d0f('0x42')];if(!_0x4c47f6[_0x0d0f('0x43')][_0x0d0f('0x48')](_0x0d0f('0x49'))){_0x5ee532['limit']=qs['limit'](_0x4c47f6[_0x0d0f('0x43')]['limit']);_0x5ee532[_0x0d0f('0x31')]=qs[_0x0d0f('0x31')](_0x4c47f6[_0x0d0f('0x43')][_0x0d0f('0x31')]);}_0x5ee532['order']=qs[_0x0d0f('0x4a')](_0x4c47f6[_0x0d0f('0x43')][_0x0d0f('0x4a')]);_0x5ee532[_0x0d0f('0x4b')]=qs[_0x0d0f('0x44')](_[_0x0d0f('0x4c')](_0x4c47f6['query'],_0x80a77d[_0x0d0f('0x44')]));if(_0x4c47f6['query'][_0x0d0f('0x4d')]){_0x5ee532[_0x0d0f('0x4b')]=_[_0x0d0f('0x4e')](_0x5ee532[_0x0d0f('0x4b')],{'$or':_[_0x0d0f('0x3d')](_0x2ab3fe,function(_0x22950f){if(_0x22950f[_0x0d0f('0x40')]!==_0x0d0f('0x4f')){var _0xbb9c0d={};_0xbb9c0d[_0x22950f['name']]={'$like':'%'+_0x4c47f6[_0x0d0f('0x43')][_0x0d0f('0x4d')]+'%'};return _0xbb9c0d;}})});}_0x5ee532=_[_0x0d0f('0x4e')]({},_0x5ee532,_0x4c47f6[_0x0d0f('0x50')]);var _0x465298={'where':_0x5ee532[_0x0d0f('0x4b')]};return db[_0x0d0f('0x51')][_0x0d0f('0x52')](_0x465298)[_0x0d0f('0x23')](function(_0x4adb94){_0x49adba[_0x0d0f('0x52')]=_0x4adb94;if(_0x4c47f6[_0x0d0f('0x43')]['includeAll']){_0x5ee532[_0x0d0f('0x53')]=[{'all':!![]}];}return db[_0x0d0f('0x51')]['findAll'](_0x5ee532);})[_0x0d0f('0x23')](function(_0x9c369e){_0x49adba[_0x0d0f('0x54')]=_0x9c369e;return _0x49adba;})[_0x0d0f('0x23')](respondWithFilteredResult(_0xd5dd92,_0x5ee532))[_0x0d0f('0x2e')](handleError(_0xd5dd92,null));};exports[_0x0d0f('0x55')]=function(_0x4373c5,_0x232f2d){var _0x35fbc2={'raw':![],'where':{'id':_0x4373c5[_0x0d0f('0x56')]['id']},'include':[{'model':db[_0x0d0f('0x57')],'as':'Imap'},{'model':db[_0x0d0f('0x3a')],'as':_0x0d0f('0x3b')},{'model':db[_0x0d0f('0x58')],'as':_0x0d0f('0x3c')}]},_0x267d2a={};_0x267d2a[_0x0d0f('0x42')]=_[_0x0d0f('0x59')](db[_0x0d0f('0x51')]['rawAttributes']);_0x267d2a[_0x0d0f('0x43')]=_[_0x0d0f('0x59')](_0x4373c5['query']);_0x267d2a[_0x0d0f('0x44')]=_[_0x0d0f('0x45')](_0x267d2a[_0x0d0f('0x42')],_0x267d2a['query']);_0x35fbc2[_0x0d0f('0x46')]=_['intersection'](_0x267d2a[_0x0d0f('0x42')],qs[_0x0d0f('0x47')](_0x4373c5[_0x0d0f('0x43')][_0x0d0f('0x47')]));_0x35fbc2[_0x0d0f('0x46')]=_0x35fbc2[_0x0d0f('0x46')]['length']?_0x35fbc2[_0x0d0f('0x46')]:_0x267d2a[_0x0d0f('0x42')];if(_0x4373c5['query'][_0x0d0f('0x5a')]){_0x35fbc2[_0x0d0f('0x53')]=[{'all':!![]}];}_0x35fbc2=_[_0x0d0f('0x4e')]({},_0x35fbc2,_0x4373c5[_0x0d0f('0x50')]);return db['MailAccount'][_0x0d0f('0x5b')](_0x35fbc2)[_0x0d0f('0x23')](handleEntityNotFound(_0x232f2d,null))[_0x0d0f('0x23')](respondWithResult(_0x232f2d,null))[_0x0d0f('0x2e')](handleError(_0x232f2d,null));};exports['update']=function(_0x57c175,_0x244904){if(_0x57c175[_0x0d0f('0x5c')]['id']){delete _0x57c175['body']['id'];}return db['MailAccount'][_0x0d0f('0x5b')]({'where':{'id':_0x57c175['params']['id']},'include':[{'model':db['MailServerIn'],'as':_0x0d0f('0x5d')},{'model':db[_0x0d0f('0x3a')],'as':_0x0d0f('0x3b')},{'model':db[_0x0d0f('0x58')],'as':_0x0d0f('0x3c')}]})[_0x0d0f('0x23')](handleEntityNotFound(_0x244904,null))[_0x0d0f('0x23')](saveUpdates(_0x57c175['body'],null))[_0x0d0f('0x23')](function(_0x2f4acb){if(_0x2f4acb&&_0x57c175['body'][_0x0d0f('0x5d')]){return db[_0x0d0f('0x57')][_0x0d0f('0x34')](_0x57c175[_0x0d0f('0x5c')][_0x0d0f('0x5d')],{'where':{'MailAccountId':_0x2f4acb['id']}})['then'](function(){return _0x2f4acb;});}return _0x2f4acb;})[_0x0d0f('0x23')](function(_0x4f6c8c){if(_0x4f6c8c&&_0x57c175[_0x0d0f('0x5c')][_0x0d0f('0x3b')]){return db[_0x0d0f('0x3a')][_0x0d0f('0x34')](_0x57c175[_0x0d0f('0x5c')]['Smtp'],{'where':{'MailAccountId':_0x4f6c8c['id']}})[_0x0d0f('0x23')](function(){return _0x4f6c8c;});}return _0x4f6c8c;})[_0x0d0f('0x23')](respondWithResult(_0x244904,null))[_0x0d0f('0x2e')](handleError(_0x244904,null));};exports['describe']=function(_0x49726d,_0x3ea711){return db[_0x0d0f('0x51')][_0x0d0f('0x5e')]()['then'](respondWithResult(_0x3ea711,null))[_0x0d0f('0x2e')](handleError(_0x3ea711,null));};exports[_0x0d0f('0x5f')]=function(_0x55380b,_0x5ac5a8,_0xcd57eb){if(_0x55380b[_0x0d0f('0x5c')]['id']){delete _0x55380b['body']['id'];}return db[_0x0d0f('0x51')][_0x0d0f('0x5b')]({'where':{'id':_0x55380b[_0x0d0f('0x56')]['id']}})[_0x0d0f('0x23')](handleEntityNotFound(_0x5ac5a8,null))[_0x0d0f('0x23')](function(_0x1b8998){if(_0x1b8998){_0x55380b['body'][_0x0d0f('0x60')]=_0x1b8998['id'];return db[_0x0d0f('0x61')][_0x0d0f('0x62')](_0x55380b[_0x0d0f('0x5c')]);}})[_0x0d0f('0x23')](respondWithResult(_0x5ac5a8,null))[_0x0d0f('0x2e')](handleError(_0x5ac5a8,null));};exports[_0x0d0f('0x63')]=function(_0x203940,_0x5d2041,_0x586646){var _0x1a8b04={'raw':![],'where':{}};var _0x167f23={};var _0x7afecf={'count':0x0,'rows':[]};return db[_0x0d0f('0x51')][_0x0d0f('0x64')]({'where':{'id':_0x203940[_0x0d0f('0x56')]['id']}})[_0x0d0f('0x23')](handleEntityNotFound(_0x5d2041,null))['then'](function(_0x3edaa5){if(_0x3edaa5){_0x167f23[_0x0d0f('0x42')]=_[_0x0d0f('0x59')](db[_0x0d0f('0x61')]['rawAttributes']);_0x167f23['query']=_['keys'](_0x203940[_0x0d0f('0x43')]);_0x167f23[_0x0d0f('0x44')]=_[_0x0d0f('0x45')](_0x167f23['model'],_0x167f23[_0x0d0f('0x43')]);_0x1a8b04[_0x0d0f('0x46')]=_[_0x0d0f('0x45')](_0x167f23['model'],qs[_0x0d0f('0x47')](_0x203940[_0x0d0f('0x43')][_0x0d0f('0x47')]));_0x1a8b04['attributes']=_0x1a8b04[_0x0d0f('0x46')][_0x0d0f('0x65')]?_0x1a8b04[_0x0d0f('0x46')]:_0x167f23[_0x0d0f('0x42')];if(!_0x203940[_0x0d0f('0x43')][_0x0d0f('0x48')](_0x0d0f('0x49'))){_0x1a8b04[_0x0d0f('0x66')]=qs[_0x0d0f('0x66')](_0x203940['query'][_0x0d0f('0x66')]);_0x1a8b04[_0x0d0f('0x31')]=qs['offset'](_0x203940[_0x0d0f('0x43')]['offset']);}_0x1a8b04[_0x0d0f('0x67')]=qs[_0x0d0f('0x4a')](_0x203940['query'][_0x0d0f('0x4a')]);_0x1a8b04[_0x0d0f('0x4b')]=qs['filters'](_['pick'](_0x203940[_0x0d0f('0x43')],_0x167f23['filters']));_0x1a8b04[_0x0d0f('0x4b')][_0x0d0f('0x60')]=_0x3edaa5['id'];if(_0x203940[_0x0d0f('0x43')][_0x0d0f('0x4d')]){_0x1a8b04[_0x0d0f('0x4b')]=_[_0x0d0f('0x4e')](_0x1a8b04['where'],{'$or':_[_0x0d0f('0x3d')](_0x1a8b04[_0x0d0f('0x46')],function(_0x40fa00){var _0x30a19d={};_0x30a19d[_0x40fa00]={'$like':'%'+_0x203940['query'][_0x0d0f('0x4d')]+'%'};return _0x30a19d;})});}_0x1a8b04=_[_0x0d0f('0x4e')]({},_0x1a8b04,_0x203940[_0x0d0f('0x50')]);return db['Disposition'][_0x0d0f('0x52')]({'where':_0x1a8b04['where']})[_0x0d0f('0x23')](function(_0x3b5245){_0x7afecf['count']=_0x3b5245;if(_0x203940[_0x0d0f('0x43')]['includeAll']){_0x1a8b04[_0x0d0f('0x53')]=[{'all':!![]}];}return db['Disposition'][_0x0d0f('0x68')](_0x1a8b04);})[_0x0d0f('0x23')](function(_0x2b4613){_0x7afecf[_0x0d0f('0x54')]=_0x2b4613;return _0x7afecf;});}})[_0x0d0f('0x23')](respondWithFilteredResult(_0x5d2041,_0x1a8b04))['catch'](handleError(_0x5d2041,null));};exports['removeDispositions']=function(_0x3c38b6,_0x3ef4c5,_0x3a2923){return db[_0x0d0f('0x51')]['find']({'where':{'id':_0x3c38b6[_0x0d0f('0x56')]['id']}})[_0x0d0f('0x23')](handleEntityNotFound(_0x3ef4c5,null))['then'](function(_0x1727e8){if(_0x1727e8){return _0x1727e8[_0x0d0f('0x69')](_0x3c38b6['query'][_0x0d0f('0x6a')]);}})[_0x0d0f('0x23')](respondWithStatusCode(_0x3ef4c5,null))[_0x0d0f('0x2e')](handleError(_0x3ef4c5,null));};exports[_0x0d0f('0x6b')]=function(_0x408e54,_0x54ab42,_0x2522d4){if(_0x408e54[_0x0d0f('0x5c')]['id']){delete _0x408e54['body']['id'];}return db[_0x0d0f('0x51')][_0x0d0f('0x5b')]({'where':{'id':_0x408e54['params']['id']}})['then'](handleEntityNotFound(_0x54ab42,null))[_0x0d0f('0x23')](function(_0x4202f6){if(_0x4202f6){_0x408e54['body'][_0x0d0f('0x60')]=_0x4202f6['id'];return db[_0x0d0f('0x6c')][_0x0d0f('0x62')](_0x408e54[_0x0d0f('0x5c')]);}})[_0x0d0f('0x23')](respondWithResult(_0x54ab42,null))['catch'](handleError(_0x54ab42,null));};exports[_0x0d0f('0x6d')]=function(_0x1f5f27,_0x14c55f,_0x52f32b){var _0x3a6be3={'raw':![],'where':{}};var _0x32c6cb={};var _0x30259d={'count':0x0,'rows':[]};return db[_0x0d0f('0x51')][_0x0d0f('0x64')]({'where':{'id':_0x1f5f27[_0x0d0f('0x56')]['id']}})[_0x0d0f('0x23')](handleEntityNotFound(_0x14c55f,null))[_0x0d0f('0x23')](function(_0x1ef171){if(_0x1ef171){_0x32c6cb[_0x0d0f('0x42')]=_[_0x0d0f('0x59')](db[_0x0d0f('0x6c')][_0x0d0f('0x3e')]);_0x32c6cb[_0x0d0f('0x43')]=_[_0x0d0f('0x59')](_0x1f5f27[_0x0d0f('0x43')]);_0x32c6cb[_0x0d0f('0x44')]=_[_0x0d0f('0x45')](_0x32c6cb[_0x0d0f('0x42')],_0x32c6cb[_0x0d0f('0x43')]);_0x3a6be3[_0x0d0f('0x46')]=_['intersection'](_0x32c6cb[_0x0d0f('0x42')],qs['fields'](_0x1f5f27[_0x0d0f('0x43')][_0x0d0f('0x47')]));_0x3a6be3['attributes']=_0x3a6be3['attributes'][_0x0d0f('0x65')]?_0x3a6be3[_0x0d0f('0x46')]:_0x32c6cb[_0x0d0f('0x42')];if(!_0x1f5f27[_0x0d0f('0x43')]['hasOwnProperty']('nolimit')){_0x3a6be3[_0x0d0f('0x66')]=qs[_0x0d0f('0x66')](_0x1f5f27[_0x0d0f('0x43')][_0x0d0f('0x66')]);_0x3a6be3[_0x0d0f('0x31')]=qs['offset'](_0x1f5f27[_0x0d0f('0x43')][_0x0d0f('0x31')]);}_0x3a6be3['order']=qs[_0x0d0f('0x4a')](_0x1f5f27[_0x0d0f('0x43')]['sort']);_0x3a6be3['where']=qs[_0x0d0f('0x44')](_[_0x0d0f('0x4c')](_0x1f5f27[_0x0d0f('0x43')],_0x32c6cb[_0x0d0f('0x44')]));_0x3a6be3[_0x0d0f('0x4b')]['MailAccountId']=_0x1ef171['id'];if(_0x1f5f27[_0x0d0f('0x43')][_0x0d0f('0x4d')]){_0x3a6be3['where']=_[_0x0d0f('0x4e')](_0x3a6be3[_0x0d0f('0x4b')],{'$or':_[_0x0d0f('0x3d')](_0x3a6be3['attributes'],function(_0x44b885){var _0x223704={};_0x223704[_0x44b885]={'$like':'%'+_0x1f5f27[_0x0d0f('0x43')][_0x0d0f('0x4d')]+'%'};return _0x223704;})});}_0x3a6be3=_[_0x0d0f('0x4e')]({},_0x3a6be3,_0x1f5f27[_0x0d0f('0x50')]);return db[_0x0d0f('0x6c')][_0x0d0f('0x52')]({'where':_0x3a6be3[_0x0d0f('0x4b')]})[_0x0d0f('0x23')](function(_0x4c4a15){_0x30259d[_0x0d0f('0x52')]=_0x4c4a15;if(_0x1f5f27[_0x0d0f('0x43')][_0x0d0f('0x5a')]){_0x3a6be3[_0x0d0f('0x53')]=[{'all':!![]}];}return db[_0x0d0f('0x6c')][_0x0d0f('0x68')](_0x3a6be3);})[_0x0d0f('0x23')](function(_0x5c9e03){_0x30259d[_0x0d0f('0x54')]=_0x5c9e03;return _0x30259d;});}})[_0x0d0f('0x23')](respondWithFilteredResult(_0x14c55f,_0x3a6be3))['catch'](handleError(_0x14c55f,null));};exports[_0x0d0f('0x6e')]=function(_0x30f22e,_0x103318,_0x448d4c){return db[_0x0d0f('0x51')][_0x0d0f('0x5b')]({'where':{'id':_0x30f22e[_0x0d0f('0x56')]['id']}})[_0x0d0f('0x23')](handleEntityNotFound(_0x103318,null))[_0x0d0f('0x23')](function(_0x44b3a7){if(_0x44b3a7){return _0x44b3a7['removeAnswers'](_0x30f22e[_0x0d0f('0x43')][_0x0d0f('0x6a')]);}})[_0x0d0f('0x23')](respondWithStatusCode(_0x103318,null))[_0x0d0f('0x2e')](handleError(_0x103318,null));};exports[_0x0d0f('0x62')]=function(_0x3b03e9,_0x2514ac){var _0x1eb13d={'name':_0x3b03e9[_0x0d0f('0x5c')][_0x0d0f('0x38')],'key':_0x3b03e9[_0x0d0f('0x5c')][_0x0d0f('0x41')],'email':_0x3b03e9['body']['email'],'ListId':_0x3b03e9[_0x0d0f('0x5c')][_0x0d0f('0x6f')],'active':!_['isNil'](_0x3b03e9[_0x0d0f('0x5c')][_0x0d0f('0x70')])?_0x3b03e9[_0x0d0f('0x5c')]['active']:!![],'description':_0x3b03e9[_0x0d0f('0x5c')]['description']||null,'Imap':{},'Smtp':{}};if(_[_0x0d0f('0x71')](_0x3b03e9['body'][_0x0d0f('0x72')])){if(_0x3b03e9['body'][_0x0d0f('0x73')]){_0x1eb13d['Imap'][_0x0d0f('0x74')]=_0x1eb13d[_0x0d0f('0x3b')][_0x0d0f('0x74')]=_0x3b03e9[_0x0d0f('0x5c')][_0x0d0f('0x75')];_0x1eb13d[_0x0d0f('0x5d')][_0x0d0f('0x76')]=_0x1eb13d['Smtp'][_0x0d0f('0x77')]=_0x3b03e9[_0x0d0f('0x5c')]['cpassword'];}else{_0x1eb13d[_0x0d0f('0x5d')]['authentication']=_0x1eb13d[_0x0d0f('0x3b')][_0x0d0f('0x78')]=![];}_0x1eb13d[_0x0d0f('0x5d')][_0x0d0f('0x79')]=_0x3b03e9['body'][_0x0d0f('0x5d')][_0x0d0f('0x79')];_0x1eb13d[_0x0d0f('0x5d')]['port']=_0x3b03e9[_0x0d0f('0x5c')]['Imap'][_0x0d0f('0x7a')];_0x1eb13d[_0x0d0f('0x3b')][_0x0d0f('0x79')]=_0x3b03e9[_0x0d0f('0x5c')][_0x0d0f('0x3b')][_0x0d0f('0x79')];_0x1eb13d[_0x0d0f('0x3b')][_0x0d0f('0x7a')]=_0x3b03e9['body'][_0x0d0f('0x3b')][_0x0d0f('0x7a')];}else{_0x1eb13d[_0x0d0f('0x5d')]['service']=_0x1eb13d[_0x0d0f('0x3b')][_0x0d0f('0x7b')]=_0x3b03e9['body'][_0x0d0f('0x72')];_0x1eb13d[_0x0d0f('0x5d')][_0x0d0f('0x74')]=_0x1eb13d[_0x0d0f('0x3b')][_0x0d0f('0x74')]=_0x3b03e9[_0x0d0f('0x5c')][_0x0d0f('0x75')];_0x1eb13d[_0x0d0f('0x5d')][_0x0d0f('0x76')]=_0x1eb13d[_0x0d0f('0x3b')][_0x0d0f('0x77')]=_0x3b03e9[_0x0d0f('0x5c')]['cpassword'];}return db[_0x0d0f('0x51')][_0x0d0f('0x62')](_0x1eb13d,{'include':[{'model':db['MailServerOut'],'as':_0x0d0f('0x3b')},{'model':db['MailServerIn'],'as':_0x0d0f('0x5d')}]})[_0x0d0f('0x23')](function(_0x29a76e){var _0x2e304c=_0x3b03e9[_0x0d0f('0x74')]['get']({'plain':!![]});if(!_0x2e304c)throw new Error(_0x0d0f('0x7c'));if(_0x2e304c[_0x0d0f('0x7d')]===_0x0d0f('0x74')){var _0x3f68f2=_0x29a76e[_0x0d0f('0x36')]({'plain':!![]});return db[_0x0d0f('0x7e')]['find']({'where':{'name':_0x0d0f('0x7f'),'userProfileId':_0x2e304c[_0x0d0f('0x80')]},'raw':!![]})[_0x0d0f('0x23')](function(_0x33b977){if(_0x33b977&&_0x33b977['autoAssociation']===0x0){return db['UserProfileResource'][_0x0d0f('0x62')]({'name':_0x3f68f2[_0x0d0f('0x38')],'resourceId':_0x3f68f2['id'],'type':_0x33b977[_0x0d0f('0x38')],'sectionId':_0x33b977['id']},{})['then'](function(){return _0x29a76e;});}else{return _0x29a76e;}})['catch'](function(_0x8c48d9){logger['error'](_0x0d0f('0x81'),_0x8c48d9);throw _0x8c48d9;});}return _0x29a76e;})[_0x0d0f('0x23')](respondWithResult(_0x2514ac,0xc9))['catch'](handleError(_0x2514ac,null));};exports[_0x0d0f('0x82')]=function(_0x19ce14,_0x1e33cb,_0x40144a){return db[_0x0d0f('0x51')][_0x0d0f('0x64')]({'where':{'id':_0x19ce14[_0x0d0f('0x56')]['id']}})[_0x0d0f('0x23')](handleEntityNotFound(_0x1e33cb,null))[_0x0d0f('0x23')](function(_0xe7fea2){if(_0xe7fea2){return _0xe7fea2['getImap']();}return null;})[_0x0d0f('0x23')](respondWithResult(_0x1e33cb,null))[_0x0d0f('0x2e')](handleError(_0x1e33cb,null));};exports[_0x0d0f('0x83')]=function(_0x479448,_0x259b7c,_0x1031a2){if(_0x479448[_0x0d0f('0x5c')]['id']){delete _0x479448[_0x0d0f('0x5c')]['id'];}return db['MailAccount'][_0x0d0f('0x5b')]({'where':{'id':_0x479448[_0x0d0f('0x56')]['id']}})[_0x0d0f('0x23')](handleEntityNotFound(_0x259b7c,null))['then'](function(_0x18d698){if(_0x18d698){_0x479448[_0x0d0f('0x5c')][_0x0d0f('0x60')]=_0x18d698['id'];return db[_0x0d0f('0x57')]['create'](_0x479448[_0x0d0f('0x5c')]);}})[_0x0d0f('0x23')](respondWithResult(_0x259b7c,null))[_0x0d0f('0x2e')](handleError(_0x259b7c,null));};exports['removeImap']=function(_0x5f4155,_0xe6297,_0x34f35f){return db['MailAccount'][_0x0d0f('0x64')]({'where':{'id':_0x5f4155[_0x0d0f('0x56')]['id']}})[_0x0d0f('0x23')](handleEntityNotFound(_0xe6297,null))['then'](function(_0x62d89){if(_0x62d89){return _0x62d89[_0x0d0f('0x84')](null);}return null;})[_0x0d0f('0x23')](respondWithStatusCode(_0xe6297,null))[_0x0d0f('0x2e')](handleError(_0xe6297,null));};exports[_0x0d0f('0x85')]=function(_0x16b23f,_0x1890f3,_0x40442f){return db[_0x0d0f('0x51')][_0x0d0f('0x64')]({'where':{'id':_0x16b23f[_0x0d0f('0x56')]['id']}})['then'](handleEntityNotFound(_0x1890f3,null))[_0x0d0f('0x23')](function(_0x30e07a){if(_0x30e07a){return _0x30e07a[_0x0d0f('0x85')]();}return null;})[_0x0d0f('0x23')](respondWithResult(_0x1890f3,null))[_0x0d0f('0x2e')](handleError(_0x1890f3,null));};exports[_0x0d0f('0x86')]=function(_0x14cd47,_0x2cd2c0,_0x4b334d){if(_0x14cd47[_0x0d0f('0x5c')]['id']){delete _0x14cd47[_0x0d0f('0x5c')]['id'];}return db[_0x0d0f('0x51')][_0x0d0f('0x5b')]({'where':{'id':_0x14cd47['params']['id']}})[_0x0d0f('0x23')](handleEntityNotFound(_0x2cd2c0,null))[_0x0d0f('0x23')](function(_0x155596){if(_0x155596){_0x14cd47['body'][_0x0d0f('0x60')]=_0x155596['id'];return db['MailServerOut'][_0x0d0f('0x62')](_0x14cd47['body']);}})[_0x0d0f('0x23')](respondWithResult(_0x2cd2c0,null))[_0x0d0f('0x2e')](handleError(_0x2cd2c0,null));};exports[_0x0d0f('0x87')]=function(_0x426a39,_0xc95a06,_0x256d6b){return db[_0x0d0f('0x51')][_0x0d0f('0x64')]({'where':{'id':_0x426a39[_0x0d0f('0x56')]['id']}})[_0x0d0f('0x23')](handleEntityNotFound(_0xc95a06,null))['then'](function(_0x516420){if(_0x516420){return _0x516420[_0x0d0f('0x88')](null);}return null;})[_0x0d0f('0x23')](respondWithStatusCode(_0xc95a06,null))[_0x0d0f('0x2e')](handleError(_0xc95a06,null));};exports[_0x0d0f('0x89')]=function(_0xe80f5d,_0x25b5b5,_0x3fc327){return db[_0x0d0f('0x8a')][_0x0d0f('0x5b')]({'where':{'id':_0xe80f5d[_0x0d0f('0x56')]['id']}})[_0x0d0f('0x23')](handleEntityNotFound(_0x25b5b5,null))[_0x0d0f('0x23')](function(_0x19ed12){if(_0x19ed12){return _0x19ed12[_0x0d0f('0x89')](_0xe80f5d['body']['ids'],_[_0x0d0f('0x8b')](_0xe80f5d[_0x0d0f('0x5c')],[_0x0d0f('0x6a'),'id'])||{});}})[_0x0d0f('0x23')](respondWithResult(_0x25b5b5,null))[_0x0d0f('0x2e')](handleError(_0x25b5b5,null));};exports[_0x0d0f('0x8c')]=function(_0x58c1f0,_0xbe0b29,_0x18cce4){var _0x1ba737={'raw':![],'where':{}};var _0x65b5be={};var _0x762b07={'count':0x0,'rows':[]};return db[_0x0d0f('0x51')][_0x0d0f('0x64')]({'where':{'id':_0x58c1f0[_0x0d0f('0x56')]['id']}})[_0x0d0f('0x23')](handleEntityNotFound(_0xbe0b29,null))[_0x0d0f('0x23')](function(_0x51110f){if(_0x51110f){_0x65b5be[_0x0d0f('0x42')]=_[_0x0d0f('0x59')](db[_0x0d0f('0x8a')][_0x0d0f('0x3e')]);_0x65b5be['query']=_['keys'](_0x58c1f0[_0x0d0f('0x43')]);_0x65b5be[_0x0d0f('0x44')]=_['intersection'](_0x65b5be[_0x0d0f('0x42')],_0x65b5be[_0x0d0f('0x43')]);_0x1ba737['attributes']=_[_0x0d0f('0x45')](_0x65b5be[_0x0d0f('0x42')],qs[_0x0d0f('0x47')](_0x58c1f0[_0x0d0f('0x43')][_0x0d0f('0x47')]));_0x1ba737[_0x0d0f('0x46')]=_0x1ba737[_0x0d0f('0x46')][_0x0d0f('0x65')]?_0x1ba737['attributes']:_0x65b5be[_0x0d0f('0x42')];if(!_0x58c1f0[_0x0d0f('0x43')]['hasOwnProperty'](_0x0d0f('0x49'))){_0x1ba737[_0x0d0f('0x66')]=qs['limit'](_0x58c1f0[_0x0d0f('0x43')][_0x0d0f('0x66')]);_0x1ba737[_0x0d0f('0x31')]=qs[_0x0d0f('0x31')](_0x58c1f0[_0x0d0f('0x43')][_0x0d0f('0x31')]);}_0x1ba737[_0x0d0f('0x67')]=qs[_0x0d0f('0x4a')](_0x58c1f0[_0x0d0f('0x43')][_0x0d0f('0x4a')]);_0x1ba737['where']=qs[_0x0d0f('0x44')](_[_0x0d0f('0x4c')](_0x58c1f0[_0x0d0f('0x43')],_0x65b5be[_0x0d0f('0x44')]));_0x1ba737[_0x0d0f('0x4b')][_0x0d0f('0x60')]=_0x51110f['id'];if(_0x58c1f0[_0x0d0f('0x43')][_0x0d0f('0x4d')]){_0x1ba737[_0x0d0f('0x4b')]=_[_0x0d0f('0x4e')](_0x1ba737['where'],{'$or':_[_0x0d0f('0x3d')](_0x1ba737['attributes'],function(_0x36d200){var _0x2bae72={};_0x2bae72[_0x36d200]={'$like':'%'+_0x58c1f0[_0x0d0f('0x43')][_0x0d0f('0x4d')]+'%'};return _0x2bae72;})});}_0x1ba737=_[_0x0d0f('0x4e')]({},_0x1ba737,_0x58c1f0[_0x0d0f('0x50')]);return db[_0x0d0f('0x8a')][_0x0d0f('0x52')]({'where':_0x1ba737[_0x0d0f('0x4b')]})[_0x0d0f('0x23')](function(_0x20dd4f){_0x762b07[_0x0d0f('0x52')]=_0x20dd4f;if(_0x58c1f0['query'][_0x0d0f('0x5a')]){_0x1ba737['include']=[{'model':db[_0x0d0f('0x8d')],'as':_0x0d0f('0x8e'),'required':![]},{'model':db[_0x0d0f('0x8f')],'as':_0x0d0f('0x90'),'attributes':[_0x0d0f('0x38'),_0x0d0f('0x91'),_0x0d0f('0x92')],'required':![]},{'model':db[_0x0d0f('0x93')],'as':_0x0d0f('0x94'),'attributes':['id','name','color'],'where':_0x58c1f0[_0x0d0f('0x43')]['tag']?{'id':_0x58c1f0['query'][_0x0d0f('0x95')]}:undefined,'required':_0x58c1f0[_0x0d0f('0x43')][_0x0d0f('0x95')]?!![]:![]}];}return db['MailInteraction'][_0x0d0f('0x68')](_0x1ba737);})['then'](function(_0x4745fb){_0x762b07[_0x0d0f('0x54')]=_0x4745fb;return _0x762b07;});}})[_0x0d0f('0x23')](respondWithFilteredResult(_0xbe0b29,_0x1ba737))['catch'](handleError(_0xbe0b29,null));};exports[_0x0d0f('0x96')]=function(_0x10a8b5,_0x5c111a,_0x471387){return db[_0x0d0f('0x51')]['findOne']({'where':{'id':_0x10a8b5[_0x0d0f('0x56')]['id']}})[_0x0d0f('0x23')](handleEntityNotFound(_0x5c111a,null))[_0x0d0f('0x23')](function(_0x19a33c){if(_0x19a33c){return db[_0x0d0f('0x97')]['transaction'](function(_0x145960){return db[_0x0d0f('0x98')][_0x0d0f('0x35')]({'where':{'MailAccountId':_0x10a8b5['params']['id']},'transaction':_0x145960})[_0x0d0f('0x23')](function(_0x3717ab){var _0x5553ef=_[_0x0d0f('0x3d')](_0x10a8b5[_0x0d0f('0x5c')],function(_0x26544c){_0x26544c[_0x0d0f('0x60')]=_0x10a8b5[_0x0d0f('0x56')]['id'];return _0x26544c;});return db['MailApplication'][_0x0d0f('0x99')](_0x5553ef,{'transaction':_0x145960});});})[_0x0d0f('0x23')](function(){return db[_0x0d0f('0x98')][_0x0d0f('0x9a')]({'where':{'MailAccountId':_0x10a8b5[_0x0d0f('0x56')]['id']},'order':_0x0d0f('0x9b')});});}})[_0x0d0f('0x23')](respondWithResult(_0x5c111a,null))[_0x0d0f('0x2e')](handleError(_0x5c111a,null));};exports[_0x0d0f('0x9c')]=function(_0x29d477,_0x38f68c,_0xd3eda2){var _0x1e9150={};var _0x3258ac={};var _0x1c1fb8;var _0x142bd4;return db[_0x0d0f('0x51')][_0x0d0f('0x64')]({'where':{'id':_0x29d477[_0x0d0f('0x56')]['id']}})[_0x0d0f('0x23')](handleEntityNotFound(_0x38f68c,null))[_0x0d0f('0x23')](function(_0x125e44){if(_0x125e44){_0x1c1fb8=_0x125e44;_0x3258ac[_0x0d0f('0x42')]=_[_0x0d0f('0x59')](db[_0x0d0f('0x98')][_0x0d0f('0x3e')]);_0x3258ac['query']=_[_0x0d0f('0x59')](_0x29d477[_0x0d0f('0x43')]);_0x3258ac[_0x0d0f('0x44')]=_[_0x0d0f('0x45')](_0x3258ac[_0x0d0f('0x42')],_0x3258ac[_0x0d0f('0x43')]);_0x1e9150[_0x0d0f('0x46')]=_[_0x0d0f('0x45')](_0x3258ac[_0x0d0f('0x42')],qs[_0x0d0f('0x47')](_0x29d477[_0x0d0f('0x43')]['fields']));_0x1e9150[_0x0d0f('0x46')]=_0x1e9150[_0x0d0f('0x46')][_0x0d0f('0x65')]?_0x1e9150['attributes']:_0x3258ac[_0x0d0f('0x42')];_0x1e9150[_0x0d0f('0x67')]=qs[_0x0d0f('0x4a')](_0x29d477[_0x0d0f('0x43')][_0x0d0f('0x4a')]);_0x1e9150[_0x0d0f('0x4b')]=qs[_0x0d0f('0x44')](_[_0x0d0f('0x4c')](_0x29d477[_0x0d0f('0x43')],_0x3258ac[_0x0d0f('0x44')]));if(_0x29d477[_0x0d0f('0x43')]['filter']){_0x1e9150['where']=_[_0x0d0f('0x4e')](_0x1e9150['where'],{'$or':_[_0x0d0f('0x3d')](_0x1e9150['attributes'],function(_0x5250e5){var _0x419b10={};_0x419b10[_0x5250e5]={'$like':'%'+_0x29d477[_0x0d0f('0x43')][_0x0d0f('0x4d')]+'%'};return _0x419b10;})});}_0x1e9150=_['merge']({},_0x1e9150,_0x29d477[_0x0d0f('0x50')]);return _0x1c1fb8[_0x0d0f('0x9c')](_0x1e9150);}})[_0x0d0f('0x23')](function(_0x4dccae){if(_0x4dccae){_0x142bd4=_0x4dccae[_0x0d0f('0x65')];if(!_0x29d477['query'][_0x0d0f('0x48')]('nolimit')){_0x1e9150[_0x0d0f('0x66')]=qs[_0x0d0f('0x66')](_0x29d477['query'][_0x0d0f('0x66')]);_0x1e9150['offset']=qs[_0x0d0f('0x31')](_0x29d477[_0x0d0f('0x43')][_0x0d0f('0x31')]);}return _0x1c1fb8[_0x0d0f('0x9c')](_0x1e9150);}})[_0x0d0f('0x23')](function(_0x15daf1){if(_0x15daf1){return _0x15daf1?{'count':_0x142bd4,'rows':_0x15daf1}:null;}})[_0x0d0f('0x23')](respondWithResult(_0x38f68c,null))[_0x0d0f('0x2e')](handleError(_0x38f68c,null));};exports[_0x0d0f('0x9d')]=function(_0x1c9936,_0x560a64,_0x48109c){var _0x384a7d={'raw':!![],'where':{}};var _0x57135a={};var _0x15d454={'count':0x0,'rows':[]};return db[_0x0d0f('0x51')][_0x0d0f('0x64')]({'where':{'id':_0x1c9936[_0x0d0f('0x56')]['id']}})[_0x0d0f('0x23')](handleEntityNotFound(_0x560a64,null))[_0x0d0f('0x23')](function(_0x4c25cd){if(_0x4c25cd){_0x57135a[_0x0d0f('0x42')]=_['keys'](db['MailMessage'][_0x0d0f('0x3e')]);_0x57135a[_0x0d0f('0x43')]=_[_0x0d0f('0x59')](_0x1c9936[_0x0d0f('0x43')]);_0x57135a[_0x0d0f('0x44')]=_[_0x0d0f('0x45')](_0x57135a[_0x0d0f('0x42')],_0x57135a[_0x0d0f('0x43')]);_0x384a7d['attributes']=_[_0x0d0f('0x45')](_0x57135a[_0x0d0f('0x42')],qs[_0x0d0f('0x47')](_0x1c9936['query']['fields']));_0x384a7d['attributes']=_0x384a7d[_0x0d0f('0x46')]['length']?_0x384a7d[_0x0d0f('0x46')]:_0x57135a['model'];if(!_0x1c9936[_0x0d0f('0x43')][_0x0d0f('0x48')](_0x0d0f('0x49'))){_0x384a7d[_0x0d0f('0x66')]=qs[_0x0d0f('0x66')](_0x1c9936['query'][_0x0d0f('0x66')]);_0x384a7d['offset']=qs['offset'](_0x1c9936[_0x0d0f('0x43')]['offset']);}_0x384a7d[_0x0d0f('0x67')]=qs['sort'](_0x1c9936[_0x0d0f('0x43')]['sort']);_0x384a7d[_0x0d0f('0x4b')]=qs[_0x0d0f('0x44')](_[_0x0d0f('0x4c')](_0x1c9936[_0x0d0f('0x43')],_0x57135a[_0x0d0f('0x44')]));_0x384a7d[_0x0d0f('0x4b')][_0x0d0f('0x60')]=_0x4c25cd['id'];if(_0x1c9936[_0x0d0f('0x43')][_0x0d0f('0x4d')]){_0x384a7d[_0x0d0f('0x4b')]=_[_0x0d0f('0x4e')](_0x384a7d[_0x0d0f('0x4b')],{'$or':_['map'](_0x384a7d[_0x0d0f('0x46')],function(_0x2537c7){var _0xa13f78={};_0xa13f78[_0x2537c7]={'$like':'%'+_0x1c9936[_0x0d0f('0x43')][_0x0d0f('0x4d')]+'%'};return _0xa13f78;})});}if(_0x1c9936[_0x0d0f('0x43')][_0x0d0f('0x9e')]){var _0x2266d3=_0x1c9936[_0x0d0f('0x43')][_0x0d0f('0x9e')]['split'](',');var _0x22d544={};_0x22d544[_0x2266d3[0x0]]={'$gte':moment(_0x2266d3[0x1])[_0x0d0f('0x9f')]('YYYY-MM-DD\x20HH:mm:ss')};_0x384a7d[_0x0d0f('0x4b')]=_['merge'](_0x384a7d[_0x0d0f('0x4b')],_0x22d544);}_0x384a7d=_[_0x0d0f('0x4e')]({},_0x384a7d,_0x1c9936[_0x0d0f('0x50')]);return db[_0x0d0f('0xa0')]['count']({'where':_0x384a7d[_0x0d0f('0x4b')]})['then'](function(_0x56e59c){_0x15d454['count']=_0x56e59c;if(_0x1c9936[_0x0d0f('0x43')][_0x0d0f('0x5a')]){_0x384a7d[_0x0d0f('0x53')]=[{'all':!![]}];}return db[_0x0d0f('0xa0')]['findAll'](_0x384a7d);})[_0x0d0f('0x23')](function(_0x18e6ed){_0x15d454[_0x0d0f('0x54')]=_0x18e6ed;return _0x15d454;});}})[_0x0d0f('0x23')](respondWithFilteredResult(_0x560a64,_0x384a7d))[_0x0d0f('0x2e')](handleError(_0x560a64,null));};exports[_0x0d0f('0xa1')]=function(_0x34ffe7,_0x444119,_0x36f161){var _0x5d835e,_0x1daf1c={},_0x3fb5f0;if(_0x34ffe7[_0x0d0f('0x5c')]['to']){_0x3fb5f0=_0x34ffe7['body']['to'][_0x0d0f('0xa2')](',')[0x0];}return db[_0x0d0f('0x51')]['find']({'where':{'id':_0x34ffe7[_0x0d0f('0x56')]['id']},'include':[{'model':db[_0x0d0f('0xa3')],'as':_0x0d0f('0xa4'),'include':[{'model':db[_0x0d0f('0x8d')],'as':_0x0d0f('0xa5'),'where':{'email':_0x3fb5f0},'limit':0x1,'order':[[_0x0d0f('0xa6'),'DESC']]}]},{'model':db[_0x0d0f('0x3a')],'as':'Smtp','raw':!![]}]})[_0x0d0f('0x23')](handleEntityNotFound(_0x444119,null))[_0x0d0f('0x23')](function(_0xae2e8f){if(_0xae2e8f){_0x5d835e=_0xae2e8f;if(_0xae2e8f[_0x0d0f('0x3b')]){if(_[_0x0d0f('0x71')](_0x34ffe7[_0x0d0f('0x5c')]['from'])){_0x34ffe7[_0x0d0f('0x5c')][_0x0d0f('0xa7')]=util[_0x0d0f('0x9f')](_0x0d0f('0xa8'),_0xae2e8f[_0x0d0f('0x38')],_0xae2e8f['email']||_0xae2e8f['Smtp']['user']);}if(_0x34ffe7['body'][_0x0d0f('0xa9')]&&_0x34ffe7[_0x0d0f('0x5c')][_0x0d0f('0xa9')][_0x0d0f('0x65')]){for(var _0x12e387=0x0;_0x12e387<_0x34ffe7[_0x0d0f('0x5c')]['attachments']['length'];_0x12e387+=0x1){_0x34ffe7[_0x0d0f('0x5c')][_0x0d0f('0xa9')][_0x12e387]={'filename':_0x34ffe7[_0x0d0f('0x5c')][_0x0d0f('0xa9')][_0x12e387]['name'],'path':path[_0x0d0f('0xaa')](config[_0x0d0f('0xab')],_0x0d0f('0xac'),_0x34ffe7[_0x0d0f('0x5c')][_0x0d0f('0xa9')][_0x12e387][_0x0d0f('0xad')])};}}var _0x175cda={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0xae2e8f[_0x0d0f('0x3b')][_0x0d0f('0x7b')])){if(_0xae2e8f[_0x0d0f('0x3b')][_0x0d0f('0x78')]){_0x175cda['auth']={'user':_0xae2e8f['Smtp'][_0x0d0f('0x74')],'pass':_0xae2e8f[_0x0d0f('0x3b')][_0x0d0f('0x77')]};}_0x175cda[_0x0d0f('0x79')]=_0xae2e8f[_0x0d0f('0x3b')][_0x0d0f('0x79')];_0x175cda[_0x0d0f('0x7a')]=_0xae2e8f['Smtp'][_0x0d0f('0x7a')];_0x175cda[_0x0d0f('0xae')]=_0xae2e8f['Smtp'][_0x0d0f('0xae')];}else{_0x175cda[_0x0d0f('0x7b')]=_0xae2e8f[_0x0d0f('0x3b')]['service'];_0x175cda[_0x0d0f('0xaf')]={'user':_0xae2e8f[_0x0d0f('0x3b')][_0x0d0f('0x74')],'pass':_0xae2e8f[_0x0d0f('0x3b')][_0x0d0f('0x77')]};}return respondWithRpcPromise(_0x0d0f('0xb0'),'sendMail',{'account':_0x175cda,'message':_0x34ffe7[_0x0d0f('0x5c')]});}else{throw new Error(_0x0d0f('0xb1'));}}})[_0x0d0f('0x23')](function(_0x38870d){if(_0x38870d){_0x1daf1c=_0x38870d;if(_0x5d835e[_0x0d0f('0xa4')]){if(_0x5d835e[_0x0d0f('0xa4')][_0x0d0f('0xa5')][_0x0d0f('0x65')]){return _0x5d835e['List']['Contacts'][0x0];}else{return db[_0x0d0f('0x8d')][_0x0d0f('0x62')](_[_0x0d0f('0x17')](_0x34ffe7['body'],{'firstName':_0x34ffe7[_0x0d0f('0x5c')]['to'],'email':_0x34ffe7[_0x0d0f('0x5c')]['to'],'phone':_0x34ffe7[_0x0d0f('0x5c')]['to'],'ListId':_0x5d835e['ListId']}));}}else{throw new Error(_0x0d0f('0xb1'));}}})[_0x0d0f('0x23')](function(_0x3637d0){if(_0x3637d0){var _0x5099a4={'UserId':_0x34ffe7['user']['id'],'ContactId':_0x3637d0['id'],'MailAccountId':_0x5d835e['id'],'inReplyTo':_0x1daf1c['messageId'],'to':_0x34ffe7['body']['from'],'cc':_0x34ffe7[_0x0d0f('0x5c')]['cc'],'subject':_0x34ffe7[_0x0d0f('0x5c')][_0x0d0f('0xb2')],'attach':_0x34ffe7[_0x0d0f('0x5c')]['attach'],'firstMsgDirection':_0x0d0f('0xb3'),'lastMsgAt':moment()[_0x0d0f('0x9f')](_0x0d0f('0xb4')),'lastMsgDirection':_0x0d0f('0xb3'),'lastMsgBody':_0x34ffe7[_0x0d0f('0x5c')][_0x0d0f('0x5c')],'Messages':[_['merge'](_0x34ffe7[_0x0d0f('0x5c')],{'messageId':_0x1daf1c[_0x0d0f('0xb5')],'sentAt':moment()[_0x0d0f('0x9f')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x5d835e['id'],'UserId':_0x34ffe7[_0x0d0f('0x74')]['id'],'ContactId':_0x3637d0['id']})]};if(_0x34ffe7['body'][_0x0d0f('0xb6')]){_0x5099a4=_[_0x0d0f('0x4e')](_0x5099a4,_0x34ffe7[_0x0d0f('0x5c')][_0x0d0f('0xb6')]);}return db[_0x0d0f('0x8a')]['create'](_0x5099a4,{'include':[{'model':db['MailMessage'],'as':'Messages'}]});}})['then'](respondWithResult(_0x444119,null))[_0x0d0f('0x2e')](handleError(_0x444119,null));};exports[_0x0d0f('0xb7')]=function(_0x4ce881,_0x237cc6,_0x43a899){return db[_0x0d0f('0x51')][_0x0d0f('0x5b')]({'where':{'id':_0x4ce881[_0x0d0f('0x56')]['id']},'include':[{'model':db[_0x0d0f('0x3a')],'as':'Smtp','raw':!![]}]})[_0x0d0f('0x23')](handleEntityNotFound(_0x237cc6,null))[_0x0d0f('0x23')](function(_0x2c60d2){if(_0x2c60d2&&_0x2c60d2[_0x0d0f('0x3b')]){var _0x11f424={'id':_0x2c60d2['id'],'tls':{'rejectUnauthorized':![]}};if(_0x2c60d2['Smtp'][_0x0d0f('0x7b')]){_0x11f424[_0x0d0f('0x7b')]=_0x2c60d2[_0x0d0f('0x3b')][_0x0d0f('0x7b')];}else{_0x11f424[_0x0d0f('0x79')]=_0x2c60d2[_0x0d0f('0x3b')]['host'];_0x11f424[_0x0d0f('0x7a')]=_0x2c60d2[_0x0d0f('0x3b')][_0x0d0f('0x7a')];_0x11f424[_0x0d0f('0xae')]=_0x2c60d2['Smtp'][_0x0d0f('0xae')];}if(_0x2c60d2[_0x0d0f('0x3b')]['authentication']){_0x11f424[_0x0d0f('0xaf')]={'user':_0x2c60d2['Smtp'][_0x0d0f('0x74')],'pass':_0x2c60d2[_0x0d0f('0x3b')][_0x0d0f('0x77')]};}return respondWithRpcPromise(_0x0d0f('0xb8'),'verifySmtp',{'account':_0x11f424});}})[_0x0d0f('0x23')](respondWithResult(_0x237cc6,null))[_0x0d0f('0x2e')](handleError(_0x237cc6,null));};exports['destroy']=function(_0x103c55,_0x401459){return db[_0x0d0f('0x51')][_0x0d0f('0x5b')]({'where':{'id':_0x103c55['params']['id']}})['then'](handleEntityNotFound(_0x401459,null))[_0x0d0f('0x23')](function(_0x43f86a){if(_0x43f86a&&_0x43f86a[_0x0d0f('0x7b')]){throw new db[(_0x0d0f('0x20'))][(_0x0d0f('0x21'))](_0x0d0f('0xb9'));}return _0x43f86a;})[_0x0d0f('0x23')](removeEntity(_0x401459,null))[_0x0d0f('0x2e')](handleError(_0x401459,null));};exports[_0x0d0f('0xba')]=function(_0x57c83a,_0x50f741,_0x4f39ea){return db[_0x0d0f('0x51')][_0x0d0f('0x5b')]({'where':{'id':_0x57c83a[_0x0d0f('0x56')]['id']}})[_0x0d0f('0x23')](handleEntityNotFound(_0x50f741,null))[_0x0d0f('0x23')](function(_0x23f5ef){if(_0x23f5ef){return _0x23f5ef[_0x0d0f('0xba')](_0x57c83a[_0x0d0f('0x5c')][_0x0d0f('0x6a')],_[_0x0d0f('0x8b')](_0x57c83a[_0x0d0f('0x5c')],[_0x0d0f('0x6a'),'id'])||{})[_0x0d0f('0xbb')](function(_0x1107a4){for(var _0x510e73=0x0;_0x510e73<_0x57c83a[_0x0d0f('0x5c')][_0x0d0f('0x6a')][_0x0d0f('0x65')];_0x510e73+=0x1){socket[_0x0d0f('0xbc')](_0x0d0f('0xbd'),{'UserId':_0x57c83a[_0x0d0f('0x5c')][_0x0d0f('0x6a')][_0x510e73],'MailAccountId':_0x57c83a[_0x0d0f('0x56')]['id']});}return _0x1107a4;});}})['then'](respondWithResult(_0x50f741,null))[_0x0d0f('0x2e')](handleError(_0x50f741,null));};exports[_0x0d0f('0xbe')]=function(_0x1dc6d0,_0x3acf56,_0x1f2f83){return db['MailAccount'][_0x0d0f('0x5b')]({'where':{'id':_0x1dc6d0[_0x0d0f('0x56')]['id']}})[_0x0d0f('0x23')](handleEntityNotFound(_0x3acf56,null))[_0x0d0f('0x23')](function(_0x191a60){if(_0x191a60){return _0x191a60[_0x0d0f('0xbe')](_0x1dc6d0['query'][_0x0d0f('0x6a')])[_0x0d0f('0x23')](function(){if(_[_0x0d0f('0xbf')](_0x1dc6d0[_0x0d0f('0x43')][_0x0d0f('0x6a')])){for(var _0x3333ad=0x0;_0x3333ad<_0x1dc6d0[_0x0d0f('0x43')][_0x0d0f('0x6a')]['length'];_0x3333ad+=0x1){socket[_0x0d0f('0xbc')](_0x0d0f('0xc0'),{'UserId':Number(_0x1dc6d0[_0x0d0f('0x43')][_0x0d0f('0x6a')][_0x3333ad]),'MailAccountId':Number(_0x1dc6d0[_0x0d0f('0x56')]['id'])});}}else{socket[_0x0d0f('0xbc')](_0x0d0f('0xc0'),{'UserId':Number(_0x1dc6d0[_0x0d0f('0x43')]['ids']),'MailAccountId':Number(_0x1dc6d0[_0x0d0f('0x56')]['id'])});}});}})[_0x0d0f('0x23')](respondWithStatusCode(_0x3acf56,null))[_0x0d0f('0x2e')](handleError(_0x3acf56,null));};exports[_0x0d0f('0xc1')]=function(_0x579b59,_0x4d07bf,_0x12469e){var _0x2e8ff3={};var _0x43f753={};var _0x262486;var _0xddad9;return db[_0x0d0f('0x51')][_0x0d0f('0x64')]({'where':{'id':_0x579b59[_0x0d0f('0x56')]['id']}})[_0x0d0f('0x23')](handleEntityNotFound(_0x4d07bf,null))[_0x0d0f('0x23')](function(_0x3ff149){if(_0x3ff149){_0x262486=_0x3ff149;_0x43f753['model']=_[_0x0d0f('0x59')](db['User'][_0x0d0f('0x3e')]);_0x43f753[_0x0d0f('0x43')]=_[_0x0d0f('0x59')](_0x579b59[_0x0d0f('0x43')]);_0x43f753['filters']=_[_0x0d0f('0x45')](_0x43f753['model'],_0x43f753[_0x0d0f('0x43')]);_0x2e8ff3[_0x0d0f('0x46')]=_[_0x0d0f('0x45')](_0x43f753[_0x0d0f('0x42')],qs[_0x0d0f('0x47')](_0x579b59[_0x0d0f('0x43')][_0x0d0f('0x47')]));_0x2e8ff3['attributes']=_0x2e8ff3[_0x0d0f('0x46')][_0x0d0f('0x65')]?_0x2e8ff3['attributes']:_0x43f753[_0x0d0f('0x42')];_0x2e8ff3[_0x0d0f('0x67')]=qs[_0x0d0f('0x4a')](_0x579b59[_0x0d0f('0x43')][_0x0d0f('0x4a')]);_0x2e8ff3[_0x0d0f('0x4b')]=qs[_0x0d0f('0x44')](_[_0x0d0f('0x4c')](_0x579b59[_0x0d0f('0x43')],_0x43f753[_0x0d0f('0x44')]));if(_0x579b59[_0x0d0f('0x43')]['filter']){_0x2e8ff3['where']=_[_0x0d0f('0x4e')](_0x2e8ff3[_0x0d0f('0x4b')],{'$or':_[_0x0d0f('0x3d')](_0x2e8ff3[_0x0d0f('0x46')],function(_0x37c075){var _0x24fb70={};_0x24fb70[_0x37c075]={'$like':'%'+_0x579b59[_0x0d0f('0x43')][_0x0d0f('0x4d')]+'%'};return _0x24fb70;})});}_0x2e8ff3=_['merge']({},_0x2e8ff3,_0x579b59['options']);return _0x262486[_0x0d0f('0xc1')](_0x2e8ff3);}})[_0x0d0f('0x23')](function(_0x827435){if(_0x827435){_0xddad9=_0x827435[_0x0d0f('0x65')];if(!_0x579b59[_0x0d0f('0x43')]['hasOwnProperty']('nolimit')){_0x2e8ff3[_0x0d0f('0x66')]=qs['limit'](_0x579b59[_0x0d0f('0x43')][_0x0d0f('0x66')]);_0x2e8ff3[_0x0d0f('0x31')]=qs[_0x0d0f('0x31')](_0x579b59['query']['offset']);}return _0x262486[_0x0d0f('0xc1')](_0x2e8ff3);}})[_0x0d0f('0x23')](function(_0x2dd929){if(_0x2dd929){return _0x2dd929?{'count':_0xddad9,'rows':_0x2dd929}:null;}})[_0x0d0f('0x23')](respondWithResult(_0x4d07bf,null))[_0x0d0f('0x2e')](handleError(_0x4d07bf,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 9cf2ec6..c23b63e 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 _0x349d=['update','remove','emit','exports','../../mysqldb','MailAccount','save'];(function(_0x137312,_0x384de7){var _0x329a0d=function(_0x5a97cc){while(--_0x5a97cc){_0x137312['push'](_0x137312['shift']());}};_0x329a0d(++_0x384de7);}(_0x349d,0x193));var _0xd349=function(_0xea60fb,_0x5825af){_0xea60fb=_0xea60fb-0x0;var _0x304f64=_0x349d[_0xea60fb];return _0x304f64;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0xd349('0x0'))['db'][_0xd349('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd349('0x2'),'afterUpdate':_0xd349('0x3'),'afterDestroy':_0xd349('0x4')};function emitEvent(_0x6bf979){return function(_0xf0a523,_0x465466,_0x4a7d95){MailAccountEvents['emit'](_0x6bf979+':'+_0xf0a523['id'],_0xf0a523);MailAccountEvents[_0xd349('0x5')](_0x6bf979,_0xf0a523);_0x4a7d95(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0xd349('0x6')]=MailAccountEvents; \ No newline at end of file +var _0xe034=['update','remove','emit','events','../../mysqldb'];(function(_0x2541e1,_0x5efad4){var _0x1690dc=function(_0x2a0b73){while(--_0x2a0b73){_0x2541e1['push'](_0x2541e1['shift']());}};_0x1690dc(++_0x5efad4);}(_0xe034,0x6c));var _0x4e03=function(_0x30dcc2,_0x25f442){_0x30dcc2=_0x30dcc2-0x0;var _0x3231f0=_0xe034[_0x30dcc2];return _0x3231f0;};'use strict';var EventEmitter=require(_0x4e03('0x0'));var MailAccount=require(_0x4e03('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x4e03('0x2'),'afterDestroy':_0x4e03('0x3')};function emitEvent(_0x4463cd){return function(_0x4951c1,_0x3e916d,_0x113574){MailAccountEvents[_0x4e03('0x4')](_0x4463cd+':'+_0x4951c1['id'],_0x4951c1);MailAccountEvents[_0x4e03('0x4')](_0x4463cd,_0x4951c1);_0x113574(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 4b89472..a1cc14b 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 _0x3bc2=['MailAccount','mail_accounts','api','moment','bluebird','request-promise','path','../../config/environment','./mailAccount.attributes','exports','define'];(function(_0x2b3298,_0x3eeb1d){var _0x5f08f2=function(_0xfb6402){while(--_0xfb6402){_0x2b3298['push'](_0x2b3298['shift']());}};_0x5f08f2(++_0x3eeb1d);}(_0x3bc2,0x91));var _0x23bc=function(_0x6f2b1a,_0x2065bb){_0x6f2b1a=_0x6f2b1a-0x0;var _0x257eea=_0x3bc2[_0x6f2b1a];return _0x257eea;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x23bc('0x0'));var moment=require(_0x23bc('0x1'));var BPromise=require(_0x23bc('0x2'));var rp=require(_0x23bc('0x3'));var fs=require('fs');var path=require(_0x23bc('0x4'));var rimraf=require('rimraf');var config=require(_0x23bc('0x5'));var attributes=require(_0x23bc('0x6'));module[_0x23bc('0x7')]=function(_0x45890f,_0x25370b){return _0x45890f[_0x23bc('0x8')](_0x23bc('0x9'),attributes,{'tableName':_0x23bc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x11b7=['path','rimraf','../../config/environment','exports','define','MailAccount','mail_accounts','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x26bf51,_0x5e261a){var _0x503415=function(_0x92b028){while(--_0x92b028){_0x26bf51['push'](_0x26bf51['shift']());}};_0x503415(++_0x5e261a);}(_0x11b7,0x132));var _0x711b=function(_0x152635,_0x5dac8b){_0x152635=_0x152635-0x0;var _0x24f4a4=_0x11b7[_0x152635];return _0x24f4a4;};'use strict';var _=require(_0x711b('0x0'));var util=require(_0x711b('0x1'));var logger=require(_0x711b('0x2'))(_0x711b('0x3'));var moment=require(_0x711b('0x4'));var BPromise=require(_0x711b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x711b('0x6'));var rimraf=require(_0x711b('0x7'));var config=require(_0x711b('0x8'));var attributes=require('./mailAccount.attributes');module[_0x711b('0x9')]=function(_0x644cb1,_0x2d5a6a){return _0x644cb1[_0x711b('0xa')](_0x711b('0xb'),attributes,{'tableName':_0x711b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 363c1d7..22dde89 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 _0xb6b1=['error','MailAccount,\x20%s,\x20%s','message','catch','GetMailAccount','findAll','options','raw','where','include','model','attributes','map','MailAccount','find','ShowMailAccount','NotifyMailAccount','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','ListId','body','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','from','account','CmList','List','Contacts','MailApplication','Applications','MailServerOut','Smtp','get','applications','list','orderBy','priority','autoclose','push','length','close','defaults','create','contact','messageId','generate','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','Messages','inReplyTo','Contact\x20not\x20found','spread','attach','interaction','created','MailMessage','subject','originCc','bcc','Attachment','UserId','User','name','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','lodash','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','socket.io-emitter','./mailAccount.socket','register','request','then','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0x4aae13,_0x4d9f3e){var _0x32c03f=function(_0x245476){while(--_0x245476){_0x4aae13['push'](_0x4aae13['shift']());}};_0x32c03f(++_0x4d9f3e);}(_0xb6b1,0x17b));var _0x1b6b=function(_0x1ebe90,_0x5d29fc){_0x1ebe90=_0x1ebe90-0x0;var _0x447c82=_0xb6b1[_0x1ebe90];return _0x447c82;};'use strict';var _=require(_0x1b6b('0x0'));var util=require('util');var moment=require(_0x1b6b('0x1'));var BPromise=require('bluebird');var rs=require(_0x1b6b('0x2'));var fs=require('fs');var Redis=require(_0x1b6b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1b6b('0x4'));var logger=require('../../config/logger')(_0x1b6b('0x5'));var config=require(_0x1b6b('0x6'));var jayson=require(_0x1b6b('0x7'));var client=jayson[_0x1b6b('0x8')]['http']({'port':0x232c});config[_0x1b6b('0x9')]=_['defaults'](config[_0x1b6b('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x1b6b('0xa'))(new Redis(config[_0x1b6b('0x9')]));require(_0x1b6b('0xb'))[_0x1b6b('0xc')](socket);function respondWithRpcPromise(_0x5249cd,_0x4c750a,_0x475423){return new BPromise(function(_0x43d9f0,_0x3c622d){return client[_0x1b6b('0xd')](_0x5249cd,_0x475423)[_0x1b6b('0xe')](function(_0xcadff4){logger[_0x1b6b('0xf')]('MailAccount,\x20%s,\x20%s',_0x4c750a,_0x1b6b('0x10'));logger[_0x1b6b('0x11')](_0x1b6b('0x12'),_0x4c750a,'request\x20sent',JSON[_0x1b6b('0x13')](_0xcadff4));if(_0xcadff4['error']){if(_0xcadff4['error'][_0x1b6b('0x14')]===0x1f4){logger[_0x1b6b('0x15')](_0x1b6b('0x16'),_0x4c750a,_0xcadff4[_0x1b6b('0x15')][_0x1b6b('0x17')]);return _0x3c622d(_0xcadff4[_0x1b6b('0x15')][_0x1b6b('0x17')]);}logger['error'](_0x1b6b('0x16'),_0x4c750a,_0xcadff4[_0x1b6b('0x15')][_0x1b6b('0x17')]);return _0x43d9f0(_0xcadff4[_0x1b6b('0x15')]['message']);}else{logger[_0x1b6b('0xf')](_0x1b6b('0x16'),_0x4c750a,_0x1b6b('0x10'));_0x43d9f0(_0xcadff4['result'][_0x1b6b('0x17')]);}})[_0x1b6b('0x18')](function(_0x38801e){logger[_0x1b6b('0x15')](_0x1b6b('0x16'),_0x4c750a,_0x38801e);_0x3c622d(_0x38801e);});});}exports[_0x1b6b('0x19')]=function(_0x1b8a7e){var _0x1622b3=this;return new Promise(function(_0x30f9d6,_0x20a5a3){return db['MailAccount'][_0x1b6b('0x1a')]({'raw':_0x1b8a7e[_0x1b6b('0x1b')]?_0x1b8a7e[_0x1b6b('0x1b')][_0x1b6b('0x1c')]===undefined?!![]:![]:!![],'where':_0x1b8a7e[_0x1b6b('0x1b')]?_0x1b8a7e[_0x1b6b('0x1b')][_0x1b6b('0x1d')]||null:null,'attributes':_0x1b8a7e[_0x1b6b('0x1b')]?_0x1b8a7e[_0x1b6b('0x1b')]['attributes']||null:null,'limit':_0x1b8a7e[_0x1b6b('0x1b')]?_0x1b8a7e['options']['limit']||null:null,'include':_0x1b8a7e['options']?_0x1b8a7e[_0x1b6b('0x1b')][_0x1b6b('0x1e')]?_['map'](_0x1b8a7e[_0x1b6b('0x1b')]['include'],function(_0x15dfc7){return{'model':db[_0x15dfc7[_0x1b6b('0x1f')]],'as':_0x15dfc7['as'],'attributes':_0x15dfc7[_0x1b6b('0x20')],'include':_0x15dfc7[_0x1b6b('0x1e')]?_[_0x1b6b('0x21')](_0x15dfc7[_0x1b6b('0x1e')],function(_0x5d0a0a){return{'model':db[_0x5d0a0a[_0x1b6b('0x1f')]],'as':_0x5d0a0a['as'],'attributes':_0x5d0a0a[_0x1b6b('0x20')],'include':_0x5d0a0a[_0x1b6b('0x1e')]?_[_0x1b6b('0x21')](_0x5d0a0a['include'],function(_0x23dac4){return{'model':db[_0x23dac4['model']],'as':_0x23dac4['as'],'attributes':_0x23dac4['attributes']};}):[]};}):[]};}):[]:[]})[_0x1b6b('0xe')](function(_0x4e9843){logger[_0x1b6b('0xf')](_0x1b6b('0x19'),_0x1b8a7e);logger['debug']('GetMailAccount',_0x1b8a7e,JSON[_0x1b6b('0x13')](_0x4e9843));_0x30f9d6(_0x4e9843);})[_0x1b6b('0x18')](function(_0x53d5ec){logger['error'](_0x1b6b('0x19'),_0x53d5ec[_0x1b6b('0x17')],_0x1b8a7e);_0x20a5a3(_0x1622b3[_0x1b6b('0x15')](0x1f4,_0x53d5ec[_0x1b6b('0x17')]));});});};exports['ShowMailAccount']=function(_0x20bbd7){var _0x1f4c1f=this;return new Promise(function(_0x340249,_0x34cb27){return db[_0x1b6b('0x22')][_0x1b6b('0x23')]({'raw':_0x20bbd7[_0x1b6b('0x1b')]?_0x20bbd7[_0x1b6b('0x1b')][_0x1b6b('0x1c')]===undefined?!![]:![]:!![],'where':_0x20bbd7['options']?_0x20bbd7[_0x1b6b('0x1b')][_0x1b6b('0x1d')]||null:null,'attributes':_0x20bbd7[_0x1b6b('0x1b')]?_0x20bbd7[_0x1b6b('0x1b')]['attributes']||null:null,'include':_0x20bbd7[_0x1b6b('0x1b')]?_0x20bbd7['options'][_0x1b6b('0x1e')]?_['map'](_0x20bbd7['options'][_0x1b6b('0x1e')],function(_0x3a3f35){return{'model':db[_0x3a3f35[_0x1b6b('0x1f')]],'as':_0x3a3f35['as'],'attributes':_0x3a3f35['attributes'],'include':_0x3a3f35[_0x1b6b('0x1e')]?_[_0x1b6b('0x21')](_0x3a3f35[_0x1b6b('0x1e')],function(_0x276bf9){return{'model':db[_0x276bf9[_0x1b6b('0x1f')]],'as':_0x276bf9['as'],'attributes':_0x276bf9[_0x1b6b('0x20')],'include':_0x276bf9[_0x1b6b('0x1e')]?_[_0x1b6b('0x21')](_0x276bf9[_0x1b6b('0x1e')],function(_0x2033fa){return{'model':db[_0x2033fa[_0x1b6b('0x1f')]],'as':_0x2033fa['as'],'attributes':_0x2033fa[_0x1b6b('0x20')]};}):[]};}):[]};}):[]:[]})[_0x1b6b('0xe')](function(_0xfc4d04){logger['info'](_0x1b6b('0x24'),_0x20bbd7);logger[_0x1b6b('0x11')]('ShowMailAccount',_0x20bbd7,JSON[_0x1b6b('0x13')](_0xfc4d04));_0x340249(_0xfc4d04);})['catch'](function(_0x1beed6){logger[_0x1b6b('0x15')](_0x1b6b('0x24'),_0x1beed6['message'],_0x20bbd7);_0x34cb27(_0x1f4c1f[_0x1b6b('0x15')](0x1f4,_0x1beed6[_0x1b6b('0x17')]));});});};exports[_0x1b6b('0x25')]=function(_0x5578d9){var _0x2d04c1=this;return new Promise(function(_0x478287,_0x1fd874){var _0x51721b={'body':_0x5578d9['body'],'channel':'mail'};var _0xf84df2=_[_0x1b6b('0x26')](_[_0x1b6b('0x27')](db[_0x1b6b('0x28')][_0x1b6b('0x29')]),[_0x1b6b('0x2a'),_0x1b6b('0x2b'),'CompanyId',_0x1b6b('0x2c')]);var _0x165384=![];if(_0x5578d9[_0x1b6b('0x2d')]['id']){delete _0x5578d9[_0x1b6b('0x2d')]['id'];}if(_[_0x1b6b('0x2e')](_0x5578d9[_0x1b6b('0x2d')]['from'])){return _0x1fd874(_0x2d04c1[_0x1b6b('0x15')](0x1f4,_0x1b6b('0x2f')));}if(_[_0x1b6b('0x2e')](_0x5578d9[_0x1b6b('0x2d')][_0x1b6b('0x2d')])||_0x5578d9[_0x1b6b('0x2d')][_0x1b6b('0x2d')]===''){return _0x1fd874(_0x2d04c1[_0x1b6b('0x15')](0x1f4,_0x1b6b('0x30')));}if(_[_0x1b6b('0x2e')](_0x5578d9[_0x1b6b('0x2d')][_0x1b6b('0x31')])){return _0x1fd874(_0x2d04c1['error'](0x1f4,_0x1b6b('0x32')+_0xf84df2));}if(!_[_0x1b6b('0x33')](_0xf84df2,_0x5578d9[_0x1b6b('0x2d')][_0x1b6b('0x31')])){return _0x1fd874(_0x2d04c1[_0x1b6b('0x15')](0x1f4,_0x1b6b('0x34')+_0xf84df2));}var _0x53544f={};_0x53544f[_0x5578d9['body'][_0x1b6b('0x31')]]=_0x5578d9['body'][_0x1b6b('0x35')];return db['MailAccount'][_0x1b6b('0x23')]({'where':{'id':_0x5578d9[_0x1b6b('0x36')]['id']},'include':[{'model':db[_0x1b6b('0x37')],'as':_0x1b6b('0x38'),'include':[{'model':db['CmContact'],'as':_0x1b6b('0x39'),'where':_0x53544f,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x1b6b('0x3a')],'as':_0x1b6b('0x3b')},{'model':db[_0x1b6b('0x3c')],'as':_0x1b6b('0x3d')}]})['then'](function(_0x45f31b){if(_0x45f31b&&_0x45f31b['List']){var _0x3db14f=_0x45f31b[_0x1b6b('0x3e')]({'plain':!![]});_0x51721b[_0x1b6b('0x36')]=_['omit'](_0x3db14f,[_0x1b6b('0x3b'),'List']);_0x51721b[_0x1b6b('0x3f')]=_0x3db14f['Applications'];_0x51721b[_0x1b6b('0x40')]=_0x3db14f[_0x1b6b('0x38')];_0x51721b[_0x1b6b('0x3f')]=_[_0x1b6b('0x41')](_0x51721b[_0x1b6b('0x3f')],[_0x1b6b('0x42')],['asc']);if(_0x51721b['account']&&_0x51721b[_0x1b6b('0x36')][_0x1b6b('0x43')]){_0x51721b['applications'][_0x1b6b('0x44')]({'id':0x0,'priority':_0x51721b[_0x1b6b('0x3f')][_0x1b6b('0x45')]+0x1,'app':_0x1b6b('0x46'),'appdata':_0x1b6b('0x43'),'interval':'*,*,*,*'});}if(_0x51721b[_0x1b6b('0x36')]['Applications']){delete _0x51721b[_0x1b6b('0x36')][_0x1b6b('0x3b')];}if(_0x51721b[_0x1b6b('0x36')][_0x1b6b('0x38')]){delete _0x51721b[_0x1b6b('0x36')][_0x1b6b('0x38')];}if(_0x3db14f[_0x1b6b('0x38')][_0x1b6b('0x39')][_0x1b6b('0x45')]){return _0x3db14f['List']['Contacts'][0x0];}var _0x58c7e7=_[_0x1b6b('0x47')](_0x5578d9['body'],{'firstName':_0x5578d9['body'][_0x1b6b('0x35')],'ListId':_0x3db14f[_0x1b6b('0x2c')]});_0x58c7e7[_0x5578d9[_0x1b6b('0x2d')][_0x1b6b('0x31')]]=_0x5578d9['body'][_0x1b6b('0x35')];return db[_0x1b6b('0x28')][_0x1b6b('0x48')](_0x58c7e7);}else{throw new Error('List\x20not\x20found');}})['then'](function(_0xfc3746){_0x51721b[_0x1b6b('0x49')]=_0xfc3746;if(_0xfc3746){if(!_0x5578d9[_0x1b6b('0x2d')]['message']['messageId']){_0x5578d9['body']['message'][_0x1b6b('0x4a')]=rs[_0x1b6b('0x4b')]()+'\x20'+_0x5578d9[_0x1b6b('0x2d')][_0x1b6b('0x17')][_0x1b6b('0x35')];}var _0xa01e5={'ContactId':_0xfc3746['id'],'MailAccountId':_0x5578d9['account']['id'],'inReplyTo':_0x5578d9[_0x1b6b('0x2d')][_0x1b6b('0x17')][_0x1b6b('0x4a')],'to':_0x5578d9[_0x1b6b('0x2d')][_0x1b6b('0x17')][_0x1b6b('0x35')],'cc':_0x5578d9['body'][_0x1b6b('0x17')]['cc'],'subject':_0x5578d9['body']['message']['subject'],'attach':_0x5578d9[_0x1b6b('0x2d')]['message']['attach'],'lastMsgAt':moment()[_0x1b6b('0x4c')](_0x1b6b('0x4d')),'lastMsgDirection':'in','lastMsgBody':_0x5578d9[_0x1b6b('0x2d')][_0x1b6b('0x2d')]};return db[_0x1b6b('0x4e')][_0x1b6b('0x23')]({'where':{'closed':![],'MailAccountId':_0x5578d9[_0x1b6b('0x36')]['id']},'include':[{'model':db['MailMessage'],'as':_0x1b6b('0x4f'),'attributes':['messageId'],'where':{'messageId':_0x5578d9[_0x1b6b('0x2d')][_0x1b6b('0x17')][_0x1b6b('0x50')]}}]})['then'](function(_0x5b0095){if(_0x5b0095){return[_0x5b0095,![]];}return db[_0x1b6b('0x4e')][_0x1b6b('0x48')](_0xa01e5)[_0x1b6b('0xe')](function(_0x3d6474){return[_0x3d6474,!![]];});});}else{throw new Error(_0x1b6b('0x51'));}})[_0x1b6b('0x52')](function(_0x1b6eb7,_0x4545ee){if(_0x1b6eb7){_0x165384=_0x4545ee;if(!_0x4545ee){return _0x1b6eb7['update']({'inReplyTo':_0x5578d9['body'][_0x1b6b('0x17')][_0x1b6b('0x4a')],'to':_0x5578d9[_0x1b6b('0x2d')][_0x1b6b('0x17')]['from'],'cc':_0x5578d9[_0x1b6b('0x2d')]['message']['cc'],'subject':_0x5578d9[_0x1b6b('0x2d')][_0x1b6b('0x17')]['subject'],'attach':_0x1b6eb7[_0x1b6b('0x53')]?_0x1b6eb7[_0x1b6b('0x53')]:_0x5578d9[_0x1b6b('0x2d')][_0x1b6b('0x17')][_0x1b6b('0x53')],'substatus':null,'substatusAt':moment()[_0x1b6b('0x4c')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0x1b6b('0x4c')](_0x1b6b('0x4d')),'lastMsgDirection':'in','lastMsgBody':_0x5578d9['body'][_0x1b6b('0x2d')]});}else{return _0x1b6eb7;}}})[_0x1b6b('0xe')](function(_0x2a816b){_0x51721b[_0x1b6b('0x54')]=_0x2a816b[_0x1b6b('0x3e')]({'plain':!![]});_0x51721b[_0x1b6b('0x54')][_0x1b6b('0x55')]=_0x165384;return db[_0x1b6b('0x56')]['create']({'body':_0x5578d9['body']['body'],'MailAccountId':_0x5578d9[_0x1b6b('0x36')]['id'],'MailInteractionId':_0x2a816b['id'],'direction':'in','ContactId':_0x51721b[_0x1b6b('0x49')]['id'],'messageId':_0x5578d9[_0x1b6b('0x2d')][_0x1b6b('0x17')][_0x1b6b('0x4a')],'from':_0x5578d9[_0x1b6b('0x2d')]['message']['from'],'to':_0x5578d9[_0x1b6b('0x2d')]['message']['to'],'cc':_0x5578d9[_0x1b6b('0x2d')][_0x1b6b('0x17')]['cc'],'subject':_0x5578d9[_0x1b6b('0x2d')]['message'][_0x1b6b('0x57')],'attach':_0x5578d9['body'][_0x1b6b('0x17')][_0x1b6b('0x53')],'Attachments':_0x5578d9['body'][_0x1b6b('0x17')]['attachments'],'originTo':_0x5578d9[_0x1b6b('0x2d')][_0x1b6b('0x17')]['originTo'],'originCc':_0x5578d9[_0x1b6b('0x2d')][_0x1b6b('0x17')][_0x1b6b('0x58')],'bcc':_0x5578d9[_0x1b6b('0x2d')][_0x1b6b('0x17')][_0x1b6b('0x59')]},{'include':[{'model':db[_0x1b6b('0x5a')],'as':'Attachments'}]});})[_0x1b6b('0xe')](function(_0x48414b){_0x51721b[_0x1b6b('0x17')]=_0x48414b;if(_0x51721b['interaction'][_0x1b6b('0x5b')]){return db[_0x1b6b('0x5c')]['find']({'attributes':['id',_0x1b6b('0x5d')],'where':{'id':_0x51721b[_0x1b6b('0x54')][_0x1b6b('0x5b')]}})['then'](function(_0x5501b1){if(_0x5501b1){_0x51721b[_0x1b6b('0x3f')][_0x1b6b('0x5e')]({'id':0x0,'priority':0x0,'app':_0x1b6b('0x5f'),'appdata':_0x5501b1['name']+','+(_0x51721b[_0x1b6b('0x36')][_0x1b6b('0x60')]||0xa),'interval':_0x1b6b('0x61')});}return respondWithRpcPromise(_0x1b6b('0x62'),_0x1b6b('0x63'),_0x51721b);});}return respondWithRpcPromise(_0x1b6b('0x62'),_0x1b6b('0x63'),_0x51721b);})[_0x1b6b('0xe')](function(_0x2a7ddf){_0x478287(_0x2a7ddf);})[_0x1b6b('0x18')](function(_0x41e282){_0x1fd874(_0x2d04c1[_0x1b6b('0x15')](0x1f4,_0x41e282[_0x1b6b('0x17')]));});});}; \ No newline at end of file +var _0xd9dc=['attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','update','interaction','attachments','originTo','originCc','bcc','Attachment','Attachments','User','name','UserId','agent','Start','startRouting','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','request','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','MailAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetMailAccount','then','ShowMailAccount','stringify','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','from\x20is\x20mandatory','isNil','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','find','account','CmList','List','Contacts','DESC','MailApplication','Applications','Smtp','get','omit','applications','orderBy','priority','asc','push','length','autoclose','*,*,*,*','create','List\x20not\x20found','contact','messageId','generate','subject'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd9dc,0x1be));var _0xcd9d=function(_0x45d016,_0x36bdb1){_0x45d016=_0x45d016-0x0;var _0x54803a=_0xd9dc[_0x45d016];return _0x54803a;};'use strict';var _=require('lodash');var util=require(_0xcd9d('0x0'));var moment=require(_0xcd9d('0x1'));var BPromise=require('bluebird');var rs=require(_0xcd9d('0x2'));var fs=require('fs');var Redis=require(_0xcd9d('0x3'));var db=require(_0xcd9d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcd9d('0x5'))(_0xcd9d('0x6'));var config=require(_0xcd9d('0x7'));var jayson=require(_0xcd9d('0x8'));var client=jayson[_0xcd9d('0x9')]['http']({'port':0x232c});config[_0xcd9d('0xa')]=_[_0xcd9d('0xb')](config[_0xcd9d('0xa')],{'host':_0xcd9d('0xc'),'port':0x18eb});var socket=require(_0xcd9d('0xd'))(new Redis(config['redis']));require(_0xcd9d('0xe'))[_0xcd9d('0xf')](socket);function respondWithRpcPromise(_0x32dce7,_0x112c01,_0x18f6a7){return new BPromise(function(_0x2bbf4e,_0x23b23b){return client[_0xcd9d('0x10')](_0x32dce7,_0x18f6a7)['then'](function(_0xcde42f){logger['info'](_0xcd9d('0x11'),_0x112c01,'request\x20sent');logger[_0xcd9d('0x12')](_0xcd9d('0x13'),_0x112c01,_0xcd9d('0x14'),JSON['stringify'](_0xcde42f));if(_0xcde42f[_0xcd9d('0x15')]){if(_0xcde42f['error'][_0xcd9d('0x16')]===0x1f4){logger[_0xcd9d('0x15')](_0xcd9d('0x11'),_0x112c01,_0xcde42f['error'][_0xcd9d('0x17')]);return _0x23b23b(_0xcde42f[_0xcd9d('0x15')]['message']);}logger[_0xcd9d('0x15')]('MailAccount,\x20%s,\x20%s',_0x112c01,_0xcde42f[_0xcd9d('0x15')]['message']);return _0x2bbf4e(_0xcde42f[_0xcd9d('0x15')][_0xcd9d('0x17')]);}else{logger[_0xcd9d('0x18')](_0xcd9d('0x11'),_0x112c01,_0xcd9d('0x14'));_0x2bbf4e(_0xcde42f[_0xcd9d('0x19')][_0xcd9d('0x17')]);}})[_0xcd9d('0x1a')](function(_0x1f7c8f){logger[_0xcd9d('0x15')](_0xcd9d('0x11'),_0x112c01,_0x1f7c8f);_0x23b23b(_0x1f7c8f);});});}exports['GetMailAccount']=function(_0x15fec8){var _0x2b9618=this;return new Promise(function(_0x3599eb,_0x594bd8){return db[_0xcd9d('0x1b')][_0xcd9d('0x1c')]({'raw':_0x15fec8[_0xcd9d('0x1d')]?_0x15fec8[_0xcd9d('0x1d')][_0xcd9d('0x1e')]===undefined?!![]:![]:!![],'where':_0x15fec8[_0xcd9d('0x1d')]?_0x15fec8[_0xcd9d('0x1d')][_0xcd9d('0x1f')]||null:null,'attributes':_0x15fec8['options']?_0x15fec8['options'][_0xcd9d('0x20')]||null:null,'limit':_0x15fec8[_0xcd9d('0x1d')]?_0x15fec8[_0xcd9d('0x1d')][_0xcd9d('0x21')]||null:null,'include':_0x15fec8['options']?_0x15fec8[_0xcd9d('0x1d')][_0xcd9d('0x22')]?_[_0xcd9d('0x23')](_0x15fec8[_0xcd9d('0x1d')][_0xcd9d('0x22')],function(_0x5ed51f){return{'model':db[_0x5ed51f[_0xcd9d('0x24')]],'as':_0x5ed51f['as'],'attributes':_0x5ed51f[_0xcd9d('0x20')],'include':_0x5ed51f[_0xcd9d('0x22')]?_[_0xcd9d('0x23')](_0x5ed51f[_0xcd9d('0x22')],function(_0x3b1abd){return{'model':db[_0x3b1abd[_0xcd9d('0x24')]],'as':_0x3b1abd['as'],'attributes':_0x3b1abd['attributes'],'include':_0x3b1abd[_0xcd9d('0x22')]?_[_0xcd9d('0x23')](_0x3b1abd['include'],function(_0x588db6){return{'model':db[_0x588db6[_0xcd9d('0x24')]],'as':_0x588db6['as'],'attributes':_0x588db6[_0xcd9d('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xcf8b36){logger[_0xcd9d('0x18')](_0xcd9d('0x25'),_0x15fec8);logger[_0xcd9d('0x12')](_0xcd9d('0x25'),_0x15fec8,JSON['stringify'](_0xcf8b36));_0x3599eb(_0xcf8b36);})[_0xcd9d('0x1a')](function(_0x2931df){logger[_0xcd9d('0x15')]('GetMailAccount',_0x2931df[_0xcd9d('0x17')],_0x15fec8);_0x594bd8(_0x2b9618[_0xcd9d('0x15')](0x1f4,_0x2931df[_0xcd9d('0x17')]));});});};exports['ShowMailAccount']=function(_0x154dd8){var _0x2372e2=this;return new Promise(function(_0x343835,_0xa4440){return db['MailAccount']['find']({'raw':_0x154dd8[_0xcd9d('0x1d')]?_0x154dd8['options']['raw']===undefined?!![]:![]:!![],'where':_0x154dd8[_0xcd9d('0x1d')]?_0x154dd8[_0xcd9d('0x1d')][_0xcd9d('0x1f')]||null:null,'attributes':_0x154dd8[_0xcd9d('0x1d')]?_0x154dd8['options']['attributes']||null:null,'include':_0x154dd8[_0xcd9d('0x1d')]?_0x154dd8[_0xcd9d('0x1d')][_0xcd9d('0x22')]?_['map'](_0x154dd8[_0xcd9d('0x1d')][_0xcd9d('0x22')],function(_0x13553c){return{'model':db[_0x13553c[_0xcd9d('0x24')]],'as':_0x13553c['as'],'attributes':_0x13553c[_0xcd9d('0x20')],'include':_0x13553c[_0xcd9d('0x22')]?_[_0xcd9d('0x23')](_0x13553c[_0xcd9d('0x22')],function(_0x16b943){return{'model':db[_0x16b943[_0xcd9d('0x24')]],'as':_0x16b943['as'],'attributes':_0x16b943[_0xcd9d('0x20')],'include':_0x16b943[_0xcd9d('0x22')]?_['map'](_0x16b943[_0xcd9d('0x22')],function(_0x383c1d){return{'model':db[_0x383c1d['model']],'as':_0x383c1d['as'],'attributes':_0x383c1d['attributes']};}):[]};}):[]};}):[]:[]})[_0xcd9d('0x26')](function(_0x4875d0){logger['info'](_0xcd9d('0x27'),_0x154dd8);logger[_0xcd9d('0x12')](_0xcd9d('0x27'),_0x154dd8,JSON[_0xcd9d('0x28')](_0x4875d0));_0x343835(_0x4875d0);})['catch'](function(_0x40efec){logger[_0xcd9d('0x15')]('ShowMailAccount',_0x40efec[_0xcd9d('0x17')],_0x154dd8);_0xa4440(_0x2372e2[_0xcd9d('0x15')](0x1f4,_0x40efec[_0xcd9d('0x17')]));});});};exports[_0xcd9d('0x29')]=function(_0x4c9984){var _0x4f06e6=this;return new Promise(function(_0x308488,_0x4ca724){var _0xe93927={'body':_0x4c9984[_0xcd9d('0x2a')],'channel':_0xcd9d('0x2b')};var _0x5b3dc3=_[_0xcd9d('0x2c')](_[_0xcd9d('0x2d')](db[_0xcd9d('0x2e')][_0xcd9d('0x2f')]),[_0xcd9d('0x30'),_0xcd9d('0x31'),_0xcd9d('0x32'),_0xcd9d('0x33')]);var _0x127eb8=![];if(_0x4c9984[_0xcd9d('0x2a')]['id']){delete _0x4c9984[_0xcd9d('0x2a')]['id'];}if(_['isNil'](_0x4c9984['body']['from'])){return _0x4ca724(_0x4f06e6[_0xcd9d('0x15')](0x1f4,_0xcd9d('0x34')));}if(_[_0xcd9d('0x35')](_0x4c9984['body'][_0xcd9d('0x2a')])||_0x4c9984[_0xcd9d('0x2a')]['body']===''){return _0x4ca724(_0x4f06e6[_0xcd9d('0x15')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xcd9d('0x35')](_0x4c9984[_0xcd9d('0x2a')]['mapKey'])){return _0x4ca724(_0x4f06e6['error'](0x1f4,_0xcd9d('0x36')+_0x5b3dc3));}if(!_[_0xcd9d('0x37')](_0x5b3dc3,_0x4c9984[_0xcd9d('0x2a')][_0xcd9d('0x38')])){return _0x4ca724(_0x4f06e6[_0xcd9d('0x15')](0x1f4,_0xcd9d('0x39')+_0x5b3dc3));}var _0x49137e={};_0x49137e[_0x4c9984['body']['mapKey']]=_0x4c9984[_0xcd9d('0x2a')][_0xcd9d('0x3a')];return db['MailAccount'][_0xcd9d('0x3b')]({'where':{'id':_0x4c9984[_0xcd9d('0x3c')]['id']},'include':[{'model':db[_0xcd9d('0x3d')],'as':_0xcd9d('0x3e'),'include':[{'model':db[_0xcd9d('0x2e')],'as':_0xcd9d('0x3f'),'where':_0x49137e,'limit':0x1,'order':[[_0xcd9d('0x31'),_0xcd9d('0x40')]]}]},{'model':db[_0xcd9d('0x41')],'as':_0xcd9d('0x42')},{'model':db['MailServerOut'],'as':_0xcd9d('0x43')}]})[_0xcd9d('0x26')](function(_0x1f3de0){if(_0x1f3de0&&_0x1f3de0[_0xcd9d('0x3e')]){var _0x2011af=_0x1f3de0[_0xcd9d('0x44')]({'plain':!![]});_0xe93927[_0xcd9d('0x3c')]=_[_0xcd9d('0x45')](_0x2011af,['Applications',_0xcd9d('0x3e')]);_0xe93927[_0xcd9d('0x46')]=_0x2011af[_0xcd9d('0x42')];_0xe93927['list']=_0x2011af[_0xcd9d('0x3e')];_0xe93927[_0xcd9d('0x46')]=_[_0xcd9d('0x47')](_0xe93927[_0xcd9d('0x46')],[_0xcd9d('0x48')],[_0xcd9d('0x49')]);if(_0xe93927[_0xcd9d('0x3c')]&&_0xe93927[_0xcd9d('0x3c')]['autoclose']){_0xe93927[_0xcd9d('0x46')][_0xcd9d('0x4a')]({'id':0x0,'priority':_0xe93927[_0xcd9d('0x46')][_0xcd9d('0x4b')]+0x1,'app':'close','appdata':_0xcd9d('0x4c'),'interval':_0xcd9d('0x4d')});}if(_0xe93927[_0xcd9d('0x3c')][_0xcd9d('0x42')]){delete _0xe93927['account'][_0xcd9d('0x42')];}if(_0xe93927[_0xcd9d('0x3c')][_0xcd9d('0x3e')]){delete _0xe93927[_0xcd9d('0x3c')][_0xcd9d('0x3e')];}if(_0x2011af['List'][_0xcd9d('0x3f')][_0xcd9d('0x4b')]){return _0x2011af['List'][_0xcd9d('0x3f')][0x0];}var _0x3c3d0e=_['defaults'](_0x4c9984[_0xcd9d('0x2a')],{'firstName':_0x4c9984[_0xcd9d('0x2a')][_0xcd9d('0x3a')],'ListId':_0x2011af[_0xcd9d('0x33')]});_0x3c3d0e[_0x4c9984[_0xcd9d('0x2a')][_0xcd9d('0x38')]]=_0x4c9984['body']['from'];return db['CmContact'][_0xcd9d('0x4e')](_0x3c3d0e);}else{throw new Error(_0xcd9d('0x4f'));}})[_0xcd9d('0x26')](function(_0x4ba03e){_0xe93927[_0xcd9d('0x50')]=_0x4ba03e;if(_0x4ba03e){if(!_0x4c9984[_0xcd9d('0x2a')]['message'][_0xcd9d('0x51')]){_0x4c9984[_0xcd9d('0x2a')][_0xcd9d('0x17')]['messageId']=rs[_0xcd9d('0x52')]()+'\x20'+_0x4c9984[_0xcd9d('0x2a')]['message'][_0xcd9d('0x3a')];}var _0x5af756={'ContactId':_0x4ba03e['id'],'MailAccountId':_0x4c9984[_0xcd9d('0x3c')]['id'],'inReplyTo':_0x4c9984[_0xcd9d('0x2a')][_0xcd9d('0x17')]['messageId'],'to':_0x4c9984[_0xcd9d('0x2a')][_0xcd9d('0x17')][_0xcd9d('0x3a')],'cc':_0x4c9984[_0xcd9d('0x2a')][_0xcd9d('0x17')]['cc'],'subject':_0x4c9984[_0xcd9d('0x2a')][_0xcd9d('0x17')][_0xcd9d('0x53')],'attach':_0x4c9984[_0xcd9d('0x2a')]['message'][_0xcd9d('0x54')],'lastMsgAt':moment()[_0xcd9d('0x55')](_0xcd9d('0x56')),'lastMsgDirection':'in','lastMsgBody':_0x4c9984['body'][_0xcd9d('0x2a')]};return db[_0xcd9d('0x57')][_0xcd9d('0x3b')]({'where':{'closed':![],'MailAccountId':_0x4c9984[_0xcd9d('0x3c')]['id']},'include':[{'model':db[_0xcd9d('0x58')],'as':_0xcd9d('0x59'),'attributes':['messageId'],'where':{'messageId':_0x4c9984['body'][_0xcd9d('0x17')][_0xcd9d('0x5a')]}}]})[_0xcd9d('0x26')](function(_0x7e30af){if(_0x7e30af){return[_0x7e30af,![]];}return db[_0xcd9d('0x57')]['create'](_0x5af756)[_0xcd9d('0x26')](function(_0x55e1a3){return[_0x55e1a3,!![]];});});}else{throw new Error(_0xcd9d('0x5b'));}})['spread'](function(_0x7fcad5,_0x596426){if(_0x7fcad5){_0x127eb8=_0x596426;if(!_0x596426){return _0x7fcad5[_0xcd9d('0x5c')]({'inReplyTo':_0x4c9984[_0xcd9d('0x2a')]['message'][_0xcd9d('0x51')],'to':_0x4c9984['body'][_0xcd9d('0x17')][_0xcd9d('0x3a')],'cc':_0x4c9984['body'][_0xcd9d('0x17')]['cc'],'subject':_0x4c9984[_0xcd9d('0x2a')][_0xcd9d('0x17')]['subject'],'attach':_0x7fcad5[_0xcd9d('0x54')]?_0x7fcad5['attach']:_0x4c9984['body'][_0xcd9d('0x17')][_0xcd9d('0x54')],'substatus':null,'substatusAt':moment()[_0xcd9d('0x55')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0xcd9d('0x55')](_0xcd9d('0x56')),'lastMsgDirection':'in','lastMsgBody':_0x4c9984[_0xcd9d('0x2a')][_0xcd9d('0x2a')]});}else{return _0x7fcad5;}}})[_0xcd9d('0x26')](function(_0x2d9cb3){_0xe93927['interaction']=_0x2d9cb3[_0xcd9d('0x44')]({'plain':!![]});_0xe93927[_0xcd9d('0x5d')]['created']=_0x127eb8;return db[_0xcd9d('0x58')]['create']({'body':_0x4c9984[_0xcd9d('0x2a')][_0xcd9d('0x2a')],'MailAccountId':_0x4c9984[_0xcd9d('0x3c')]['id'],'MailInteractionId':_0x2d9cb3['id'],'direction':'in','ContactId':_0xe93927[_0xcd9d('0x50')]['id'],'messageId':_0x4c9984[_0xcd9d('0x2a')][_0xcd9d('0x17')][_0xcd9d('0x51')],'from':_0x4c9984[_0xcd9d('0x2a')][_0xcd9d('0x17')]['from'],'to':_0x4c9984[_0xcd9d('0x2a')]['message']['to'],'cc':_0x4c9984[_0xcd9d('0x2a')][_0xcd9d('0x17')]['cc'],'subject':_0x4c9984[_0xcd9d('0x2a')][_0xcd9d('0x17')][_0xcd9d('0x53')],'attach':_0x4c9984['body'][_0xcd9d('0x17')][_0xcd9d('0x54')],'Attachments':_0x4c9984[_0xcd9d('0x2a')][_0xcd9d('0x17')][_0xcd9d('0x5e')],'originTo':_0x4c9984['body']['message'][_0xcd9d('0x5f')],'originCc':_0x4c9984['body'][_0xcd9d('0x17')][_0xcd9d('0x60')],'bcc':_0x4c9984['body'][_0xcd9d('0x17')][_0xcd9d('0x61')]},{'include':[{'model':db[_0xcd9d('0x62')],'as':_0xcd9d('0x63')}]});})['then'](function(_0x52b1bc){_0xe93927['message']=_0x52b1bc;if(_0xe93927['interaction']['UserId']){return db[_0xcd9d('0x64')]['find']({'attributes':['id',_0xcd9d('0x65')],'where':{'id':_0xe93927[_0xcd9d('0x5d')][_0xcd9d('0x66')]}})[_0xcd9d('0x26')](function(_0x24684b){if(_0x24684b){_0xe93927[_0xcd9d('0x46')]['unshift']({'id':0x0,'priority':0x0,'app':_0xcd9d('0x67'),'appdata':_0x24684b[_0xcd9d('0x65')]+','+(_0xe93927[_0xcd9d('0x3c')]['waitForTheAssignedAgent']||0xa),'interval':_0xcd9d('0x4d')});}return respondWithRpcPromise(_0xcd9d('0x68'),_0xcd9d('0x69'),_0xe93927);});}return respondWithRpcPromise('Start',_0xcd9d('0x69'),_0xe93927);})['then'](function(_0x95f7cd){_0x308488(_0x95f7cd);})[_0xcd9d('0x1a')](function(_0x26630d){_0x4ca724(_0x4f06e6[_0xcd9d('0x15')](0x1f4,_0x26630d[_0xcd9d('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 2bc76ba..f799721 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 _0x1c9a=['register','length','mailAccount:','./mailAccount.events','save','update','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1c9a,0x1a7));var _0xa1c9=function(_0x10bace,_0x38d2e8){_0x10bace=_0x10bace-0x0;var _0x14ffa7=_0x1c9a[_0x10bace];return _0x14ffa7;};'use strict';var MailAccountEvents=require(_0xa1c9('0x0'));var events=[_0xa1c9('0x1'),'remove',_0xa1c9('0x2')];function createListener(_0x867bbb,_0x38c48f){return function(_0x408418){_0x38c48f[_0xa1c9('0x3')](_0x867bbb,_0x408418);};}function removeListener(_0x4a0d3d,_0x2f883c){return function(){MailAccountEvents['removeListener'](_0x4a0d3d,_0x2f883c);};}exports[_0xa1c9('0x4')]=function(_0xdd22bf){for(var _0x237862=0x0,_0x2b0c89=events[_0xa1c9('0x5')];_0x237862<_0x2b0c89;_0x237862++){var _0x46b19a=events[_0x237862];var _0x3b1a2c=createListener(_0xa1c9('0x6')+_0x46b19a,_0xdd22bf);MailAccountEvents['on'](_0x46b19a,_0x3b1a2c);}}; \ No newline at end of file +var _0x49df=['emit','removeListener','register','length','mailAccount:','remove','update'];(function(_0x21ba39,_0x413046){var _0x7a1e4f=function(_0x734831){while(--_0x734831){_0x21ba39['push'](_0x21ba39['shift']());}};_0x7a1e4f(++_0x413046);}(_0x49df,0xad));var _0xf49d=function(_0x4af05c,_0x314e3e){_0x4af05c=_0x4af05c-0x0;var _0x1964d6=_0x49df[_0x4af05c];return _0x1964d6;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=['save',_0xf49d('0x0'),_0xf49d('0x1')];function createListener(_0x4e297,_0x21eb98){return function(_0x3d07cf){_0x21eb98[_0xf49d('0x2')](_0x4e297,_0x3d07cf);};}function removeListener(_0x44b37e,_0x59cb9d){return function(){MailAccountEvents[_0xf49d('0x3')](_0x44b37e,_0x59cb9d);};}exports[_0xf49d('0x4')]=function(_0x325c19){for(var _0xca1090=0x0,_0x1aaf37=events[_0xf49d('0x5')];_0xca1090<_0x1aaf37;_0xca1090++){var _0x4e8b5e=events[_0xca1090];var _0xadfde5=createListener(_0xf49d('0x6')+_0x4e8b5e,_0x325c19);MailAccountEvents['on'](_0x4e8b5e,_0xadfde5);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index ee349ba..266eeec 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 _0xbf6e=['get','/:id','isAuthenticated','show','put','delete','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x775d87,_0x3e5dde){var _0x495d46=function(_0x1b298b){while(--_0x1b298b){_0x775d87['push'](_0x775d87['shift']());}};_0x495d46(++_0x3e5dde);}(_0xbf6e,0x149));var _0xebf6=function(_0x1a9ed0,_0x1085fc){_0x1a9ed0=_0x1a9ed0-0x0;var _0x47bbd6=_0xbf6e[_0x1a9ed0];return _0x47bbd6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xebf6('0x0'));var timeout=require(_0xebf6('0x1'));var express=require(_0xebf6('0x2'));var router=express[_0xebf6('0x3')]();var auth=require(_0xebf6('0x4'));var interaction=require(_0xebf6('0x5'));var config=require(_0xebf6('0x6'));var controller=require('./mailApplication.controller');router[_0xebf6('0x7')](_0xebf6('0x8'),auth[_0xebf6('0x9')](),controller[_0xebf6('0xa')]);router[_0xebf6('0xb')](_0xebf6('0x8'),auth[_0xebf6('0x9')](),controller['update']);router[_0xebf6('0xc')](_0xebf6('0x8'),auth[_0xebf6('0x9')](),controller['destroy']);module[_0xebf6('0xd')]=router; \ No newline at end of file +var _0x1d2d=['multer','util','path','connect-timeout','express','../../components/auth/service','./mailApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1d2d,0xf0));var _0xd1d2=function(_0x23da6f,_0x46ee88){_0x23da6f=_0x23da6f-0x0;var _0x24d508=_0x1d2d[_0x23da6f];return _0x24d508;};'use strict';var multer=require(_0xd1d2('0x0'));var util=require(_0xd1d2('0x1'));var path=require(_0xd1d2('0x2'));var timeout=require(_0xd1d2('0x3'));var express=require(_0xd1d2('0x4'));var router=express['Router']();var auth=require(_0xd1d2('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd1d2('0x6'));router[_0xd1d2('0x7')](_0xd1d2('0x8'),auth[_0xd1d2('0x9')](),controller[_0xd1d2('0xa')]);router[_0xd1d2('0xb')]('/:id',auth[_0xd1d2('0x9')](),controller[_0xd1d2('0xc')]);router[_0xd1d2('0xd')](_0xd1d2('0x8'),auth[_0xd1d2('0x9')](),controller[_0xd1d2('0xe')]);module[_0xd1d2('0xf')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 649b655..5ef5f73 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 _0xbbe4=['STRING','noop','TEXT','sequelize','INTEGER'];(function(_0x573fd7,_0x4f6f89){var _0x266542=function(_0x4ea9ce){while(--_0x4ea9ce){_0x573fd7['push'](_0x573fd7['shift']());}};_0x266542(++_0x4f6f89);}(_0xbbe4,0x170));var _0x4bbe=function(_0xf2682d,_0x48f012){_0xf2682d=_0xf2682d-0x0;var _0x53dea0=_0xbbe4[_0xf2682d];return _0x53dea0;};'use strict';var Sequelize=require(_0x4bbe('0x0'));module['exports']={'priority':{'type':Sequelize[_0x4bbe('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x4bbe('0x2')],'allowNull':![],'defaultValue':_0x4bbe('0x3')},'appdata':{'type':Sequelize[_0x4bbe('0x4')]()},'description':{'type':Sequelize[_0x4bbe('0x2')]},'interval':{'type':Sequelize[_0x4bbe('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xeb2d=['TEXT','STRING','*,*,*,*','sequelize','INTEGER','noop'];(function(_0x2e3793,_0x17a8fc){var _0x577255=function(_0x130e14){while(--_0x130e14){_0x2e3793['push'](_0x2e3793['shift']());}};_0x577255(++_0x17a8fc);}(_0xeb2d,0x171));var _0xdeb2=function(_0x3891e5,_0x515d13){_0x3891e5=_0x3891e5-0x0;var _0x3015bd=_0xeb2d[_0x3891e5];return _0x3015bd;};'use strict';var Sequelize=require(_0xdeb2('0x0'));module['exports']={'priority':{'type':Sequelize[_0xdeb2('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xdeb2('0x2')},'appdata':{'type':Sequelize[_0xdeb2('0x3')]()},'description':{'type':Sequelize[_0xdeb2('0x4')]},'interval':{'type':Sequelize[_0xdeb2('0x4')],'defaultValue':_0xdeb2('0x5')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 7c80d5f..092e91f 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 _0x15cd=['show','params','model','rawAttributes','keys','query','filters','intersection','attributes','fields','length','merge','options','MailApplication','find','body','catch','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','update','destroy','then','sendStatus','error','stack','name'];(function(_0x16cb7f,_0x4bf301){var _0x417eed=function(_0x4649f4){while(--_0x4649f4){_0x16cb7f['push'](_0x16cb7f['shift']());}};_0x417eed(++_0x4bf301);}(_0x15cd,0xfd));var _0xd15c=function(_0x260478,_0x2040a1){_0x260478=_0x260478-0x0;var _0x4048fb=_0x15cd[_0x260478];return _0x4048fb;};'use strict';var pdf=require(_0xd15c('0x0'));var emlformat=require(_0xd15c('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd15c('0x2'));var jsonpatch=require(_0xd15c('0x3'));var rp=require(_0xd15c('0x4'));var moment=require(_0xd15c('0x5'));var BPromise=require(_0xd15c('0x6'));var Mustache=require(_0xd15c('0x7'));var util=require(_0xd15c('0x8'));var path=require(_0xd15c('0x9'));var sox=require(_0xd15c('0xa'));var csv=require(_0xd15c('0xb'));var ejs=require(_0xd15c('0xc'));var fs=require('fs');var _=require(_0xd15c('0xd'));var squel=require(_0xd15c('0xe'));var crypto=require(_0xd15c('0xf'));var jsforce=require(_0xd15c('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd15c('0x11'));var authService=require(_0xd15c('0x12'));var qs=require(_0xd15c('0x13'));var as=require(_0xd15c('0x14'));var hardwareService=require(_0xd15c('0x15'));var logger=require('../../config/logger')(_0xd15c('0x16'));var utils=require(_0xd15c('0x17'));var config=require(_0xd15c('0x18'));var db=require(_0xd15c('0x19'))['db'];function respondWithStatusCode(_0x529984,_0xe2f293){_0xe2f293=_0xe2f293||0xcc;return function(_0x363c45){if(_0x363c45){return _0x529984['sendStatus'](_0xe2f293);}return _0x529984[_0xd15c('0x1a')](_0xe2f293)[_0xd15c('0x1b')]();};}function respondWithResult(_0x3eef73,_0x433302){_0x433302=_0x433302||0xc8;return function(_0x16d251){if(_0x16d251){return _0x3eef73[_0xd15c('0x1a')](_0x433302)[_0xd15c('0x1c')](_0x16d251);}};}function respondWithFilteredResult(_0x1250e3,_0x97f969){return function(_0x15cded){if(_0x15cded){var _0x3d07c6=_0x15cded[_0xd15c('0x1d')],_0x2f8485=_0x97f969[_0xd15c('0x1e')],_0x170219=_0x97f969['offset']+_0x97f969[_0xd15c('0x1f')],_0x10fcaa;if(_0x170219>=_0x3d07c6){_0x170219=_0x3d07c6;_0x10fcaa=0xc8;}else{_0x10fcaa=0xce;}_0x1250e3[_0xd15c('0x1a')](_0x10fcaa);return _0x1250e3[_0xd15c('0x20')](_0xd15c('0x21'),_0x2f8485+'-'+_0x170219+'/'+_0x3d07c6)['json'](_0x15cded);}return null;};}function patchUpdates(_0x427ed0){return function(_0x46d9d6){try{jsonpatch[_0xd15c('0x22')](_0x46d9d6,_0x427ed0,!![]);}catch(_0x440b14){return BPromise['reject'](_0x440b14);}return _0x46d9d6['save']();};}function saveUpdates(_0xa3f719,_0x2b52fa){return function(_0x286758){if(_0x286758){return _0x286758[_0xd15c('0x23')](_0xa3f719)['then'](function(_0x48c217){return _0x48c217;});}return null;};}function removeEntity(_0x25b019,_0x302e67){return function(_0x43df3f){if(_0x43df3f){return _0x43df3f[_0xd15c('0x24')]()[_0xd15c('0x25')](function(){_0x25b019[_0xd15c('0x1a')](0xcc)[_0xd15c('0x1b')]();});}};}function handleEntityNotFound(_0x21021b,_0x4c92cf){return function(_0x3ed921){if(!_0x3ed921){_0x21021b[_0xd15c('0x26')](0x194);}return _0x3ed921;};}function handleError(_0xcf653d,_0x172d62){_0x172d62=_0x172d62||0x1f4;return function(_0x72829b){logger[_0xd15c('0x27')](_0x72829b[_0xd15c('0x28')]);if(_0x72829b[_0xd15c('0x29')]){delete _0x72829b[_0xd15c('0x29')];}_0xcf653d['status'](_0x172d62)['send'](_0x72829b);};}exports[_0xd15c('0x2a')]=function(_0x569d28,_0xb0cc64){var _0xc48639={'raw':!![],'where':{'id':_0x569d28[_0xd15c('0x2b')]['id']}},_0x5028e5={};_0x5028e5[_0xd15c('0x2c')]=_['keys'](db['MailApplication'][_0xd15c('0x2d')]);_0x5028e5['query']=_[_0xd15c('0x2e')](_0x569d28[_0xd15c('0x2f')]);_0x5028e5[_0xd15c('0x30')]=_[_0xd15c('0x31')](_0x5028e5[_0xd15c('0x2c')],_0x5028e5['query']);_0xc48639[_0xd15c('0x32')]=_[_0xd15c('0x31')](_0x5028e5[_0xd15c('0x2c')],qs[_0xd15c('0x33')](_0x569d28[_0xd15c('0x2f')]['fields']));_0xc48639[_0xd15c('0x32')]=_0xc48639['attributes'][_0xd15c('0x34')]?_0xc48639[_0xd15c('0x32')]:_0x5028e5['model'];if(_0x569d28[_0xd15c('0x2f')]['includeAll']){_0xc48639['include']=[{'all':!![]}];}_0xc48639=_[_0xd15c('0x35')]({},_0xc48639,_0x569d28[_0xd15c('0x36')]);return db[_0xd15c('0x37')][_0xd15c('0x38')](_0xc48639)[_0xd15c('0x25')](handleEntityNotFound(_0xb0cc64,null))['then'](respondWithResult(_0xb0cc64,null))['catch'](handleError(_0xb0cc64,null));};exports[_0xd15c('0x23')]=function(_0x476fc8,_0x2e6f0c){if(_0x476fc8['body']['id']){delete _0x476fc8[_0xd15c('0x39')]['id'];}return db[_0xd15c('0x37')][_0xd15c('0x38')]({'where':{'id':_0x476fc8[_0xd15c('0x2b')]['id']}})[_0xd15c('0x25')](handleEntityNotFound(_0x2e6f0c,null))['then'](saveUpdates(_0x476fc8[_0xd15c('0x39')],null))[_0xd15c('0x25')](respondWithResult(_0x2e6f0c,null))[_0xd15c('0x3a')](handleError(_0x2e6f0c,null));};exports[_0xd15c('0x24')]=function(_0x1e352c,_0xf64222){return db['MailApplication'][_0xd15c('0x38')]({'where':{'id':_0x1e352c['params']['id']}})['then'](handleEntityNotFound(_0xf64222,null))[_0xd15c('0x25')](removeEntity(_0xf64222,null))[_0xd15c('0x3a')](handleError(_0xf64222,null));}; \ No newline at end of file +var _0x0f9a=['destroy','sendStatus','error','stack','name','send','show','params','model','keys','query','intersection','attributes','fields','length','includeAll','include','options','MailApplication','find','catch','update','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','status','end','count','offset','limit','Content-Range','apply','reject','save','then'];(function(_0x5cd63b,_0x57222b){var _0x35a117=function(_0x215ed0){while(--_0x215ed0){_0x5cd63b['push'](_0x5cd63b['shift']());}};_0x35a117(++_0x57222b);}(_0x0f9a,0xbf));var _0xa0f9=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x0f9a[_0x465a0c];return _0x1e202e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa0f9('0x0'));var rimraf=require(_0xa0f9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa0f9('0x2'));var rp=require(_0xa0f9('0x3'));var moment=require(_0xa0f9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa0f9('0x5'));var util=require(_0xa0f9('0x6'));var path=require(_0xa0f9('0x7'));var sox=require(_0xa0f9('0x8'));var csv=require(_0xa0f9('0x9'));var ejs=require(_0xa0f9('0xa'));var fs=require('fs');var _=require(_0xa0f9('0xb'));var squel=require(_0xa0f9('0xc'));var crypto=require(_0xa0f9('0xd'));var jsforce=require(_0xa0f9('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa0f9('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa0f9('0xf'));var authService=require(_0xa0f9('0x10'));var qs=require(_0xa0f9('0x11'));var as=require(_0xa0f9('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa0f9('0x13'))(_0xa0f9('0x14'));var utils=require('../../config/utils');var config=require(_0xa0f9('0x15'));var db=require(_0xa0f9('0x16'))['db'];function respondWithStatusCode(_0x34653a,_0x35e403){_0x35e403=_0x35e403||0xcc;return function(_0x5055d8){if(_0x5055d8){return _0x34653a['sendStatus'](_0x35e403);}return _0x34653a[_0xa0f9('0x17')](_0x35e403)[_0xa0f9('0x18')]();};}function respondWithResult(_0x213367,_0x237900){_0x237900=_0x237900||0xc8;return function(_0x2ea259){if(_0x2ea259){return _0x213367[_0xa0f9('0x17')](_0x237900)['json'](_0x2ea259);}};}function respondWithFilteredResult(_0x22f395,_0x22f2fb){return function(_0x23076d){if(_0x23076d){var _0x5aa8fb=_0x23076d[_0xa0f9('0x19')],_0x4918ec=_0x22f2fb[_0xa0f9('0x1a')],_0x19bbf0=_0x22f2fb[_0xa0f9('0x1a')]+_0x22f2fb[_0xa0f9('0x1b')],_0x1d569f;if(_0x19bbf0>=_0x5aa8fb){_0x19bbf0=_0x5aa8fb;_0x1d569f=0xc8;}else{_0x1d569f=0xce;}_0x22f395['status'](_0x1d569f);return _0x22f395['set'](_0xa0f9('0x1c'),_0x4918ec+'-'+_0x19bbf0+'/'+_0x5aa8fb)['json'](_0x23076d);}return null;};}function patchUpdates(_0x36703d){return function(_0x33929d){try{jsonpatch[_0xa0f9('0x1d')](_0x33929d,_0x36703d,!![]);}catch(_0x28b4d1){return BPromise[_0xa0f9('0x1e')](_0x28b4d1);}return _0x33929d[_0xa0f9('0x1f')]();};}function saveUpdates(_0x36745b,_0x5474ea){return function(_0x3d3c01){if(_0x3d3c01){return _0x3d3c01['update'](_0x36745b)[_0xa0f9('0x20')](function(_0x4f8dce){return _0x4f8dce;});}return null;};}function removeEntity(_0x2849d0,_0x4d4606){return function(_0x549a79){if(_0x549a79){return _0x549a79[_0xa0f9('0x21')]()[_0xa0f9('0x20')](function(){_0x2849d0[_0xa0f9('0x17')](0xcc)[_0xa0f9('0x18')]();});}};}function handleEntityNotFound(_0xc9b34f,_0x58845d){return function(_0x2592ea){if(!_0x2592ea){_0xc9b34f[_0xa0f9('0x22')](0x194);}return _0x2592ea;};}function handleError(_0x4c1d82,_0x11fb49){_0x11fb49=_0x11fb49||0x1f4;return function(_0x3b65e9){logger[_0xa0f9('0x23')](_0x3b65e9[_0xa0f9('0x24')]);if(_0x3b65e9[_0xa0f9('0x25')]){delete _0x3b65e9['name'];}_0x4c1d82['status'](_0x11fb49)[_0xa0f9('0x26')](_0x3b65e9);};}exports[_0xa0f9('0x27')]=function(_0x1e29bc,_0xa28be0){var _0x32e7e8={'raw':!![],'where':{'id':_0x1e29bc[_0xa0f9('0x28')]['id']}},_0x23e7fe={};_0x23e7fe[_0xa0f9('0x29')]=_[_0xa0f9('0x2a')](db['MailApplication']['rawAttributes']);_0x23e7fe[_0xa0f9('0x2b')]=_['keys'](_0x1e29bc[_0xa0f9('0x2b')]);_0x23e7fe['filters']=_[_0xa0f9('0x2c')](_0x23e7fe['model'],_0x23e7fe[_0xa0f9('0x2b')]);_0x32e7e8[_0xa0f9('0x2d')]=_[_0xa0f9('0x2c')](_0x23e7fe[_0xa0f9('0x29')],qs[_0xa0f9('0x2e')](_0x1e29bc[_0xa0f9('0x2b')][_0xa0f9('0x2e')]));_0x32e7e8[_0xa0f9('0x2d')]=_0x32e7e8[_0xa0f9('0x2d')][_0xa0f9('0x2f')]?_0x32e7e8[_0xa0f9('0x2d')]:_0x23e7fe[_0xa0f9('0x29')];if(_0x1e29bc[_0xa0f9('0x2b')][_0xa0f9('0x30')]){_0x32e7e8[_0xa0f9('0x31')]=[{'all':!![]}];}_0x32e7e8=_['merge']({},_0x32e7e8,_0x1e29bc[_0xa0f9('0x32')]);return db[_0xa0f9('0x33')][_0xa0f9('0x34')](_0x32e7e8)[_0xa0f9('0x20')](handleEntityNotFound(_0xa28be0,null))[_0xa0f9('0x20')](respondWithResult(_0xa28be0,null))[_0xa0f9('0x35')](handleError(_0xa28be0,null));};exports[_0xa0f9('0x36')]=function(_0x5fa327,_0x17212c){if(_0x5fa327[_0xa0f9('0x37')]['id']){delete _0x5fa327[_0xa0f9('0x37')]['id'];}return db['MailApplication']['find']({'where':{'id':_0x5fa327['params']['id']}})['then'](handleEntityNotFound(_0x17212c,null))[_0xa0f9('0x20')](saveUpdates(_0x5fa327[_0xa0f9('0x37')],null))[_0xa0f9('0x20')](respondWithResult(_0x17212c,null))[_0xa0f9('0x35')](handleError(_0x17212c,null));};exports[_0xa0f9('0x21')]=function(_0x3f9bd0,_0x51f9f2){return db[_0xa0f9('0x33')][_0xa0f9('0x34')]({'where':{'id':_0x3f9bd0[_0xa0f9('0x28')]['id']}})[_0xa0f9('0x20')](handleEntityNotFound(_0x51f9f2,null))['then'](removeEntity(_0x51f9f2,null))[_0xa0f9('0x35')](handleError(_0x51f9f2,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 12b8ea8..0f74ea5 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 _0xaf60=['../../config/logger','bluebird','rimraf','../../config/environment','./mailApplication.attributes','exports','define','mail_applications','utf8mb4','lodash','util'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xaf60,0x82));var _0x0af6=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xaf60[_0x5b561d];return _0x431060;};'use strict';var _=require(_0x0af6('0x0'));var util=require(_0x0af6('0x1'));var logger=require(_0x0af6('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0af6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0af6('0x4'));var config=require(_0x0af6('0x5'));var attributes=require(_0x0af6('0x6'));module[_0x0af6('0x7')]=function(_0x463023,_0x333ce1){return _0x463023[_0x0af6('0x8')]('MailApplication',attributes,{'tableName':_0x0af6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0af6('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xc4d8=['utf8mb4','lodash','../../config/logger','api','request-promise','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc4d8,0xa6));var _0x8c4d=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xc4d8[_0x5c351c];return _0x26f3b3;};'use strict';var _=require(_0x8c4d('0x0'));var util=require('util');var logger=require(_0x8c4d('0x1'))(_0x8c4d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8c4d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8c4d('0x4'));var attributes=require(_0x8c4d('0x5'));module[_0x8c4d('0x6')]=function(_0xa1bc80,_0x227bc8){return _0xa1bc80[_0x8c4d('0x7')](_0x8c4d('0x8'),attributes,{'tableName':_0x8c4d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8c4d('0xa'),'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 85a65db..bcb1674 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 _0xd448=['message','request\x20sent','MailApplication','update','body','options','raw','where','attributes','limit','UpdateMailApplication','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','MailApplication,\x20%s,\x20%s,\x20%s','error','code','MailApplication,\x20%s,\x20%s'];(function(_0x56a794,_0x230f30){var _0x322faf=function(_0x2562c3){while(--_0x2562c3){_0x56a794['push'](_0x56a794['shift']());}};_0x322faf(++_0x230f30);}(_0xd448,0xa6));var _0x8d44=function(_0x42d5c4,_0x2b9276){_0x42d5c4=_0x42d5c4-0x0;var _0x431564=_0xd448[_0x42d5c4];return _0x431564;};'use strict';var _=require('lodash');var util=require(_0x8d44('0x0'));var moment=require(_0x8d44('0x1'));var BPromise=require('bluebird');var rs=require(_0x8d44('0x2'));var fs=require('fs');var Redis=require(_0x8d44('0x3'));var db=require(_0x8d44('0x4'))['db'];var utils=require(_0x8d44('0x5'));var logger=require(_0x8d44('0x6'))(_0x8d44('0x7'));var config=require(_0x8d44('0x8'));var jayson=require(_0x8d44('0x9'));var client=jayson[_0x8d44('0xa')][_0x8d44('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xb5d8e1,_0x19cc7d,_0x337200){return new BPromise(function(_0x22236e,_0x33c47e){return client[_0x8d44('0xc')](_0xb5d8e1,_0x337200)[_0x8d44('0xd')](function(_0x463e3c){logger[_0x8d44('0xe')]('MailApplication,\x20%s,\x20%s',_0x19cc7d,'request\x20sent');logger[_0x8d44('0xf')](_0x8d44('0x10'),_0x19cc7d,'request\x20sent',JSON['stringify'](_0x463e3c));if(_0x463e3c['error']){if(_0x463e3c[_0x8d44('0x11')][_0x8d44('0x12')]===0x1f4){logger[_0x8d44('0x11')](_0x8d44('0x13'),_0x19cc7d,_0x463e3c[_0x8d44('0x11')][_0x8d44('0x14')]);return _0x33c47e(_0x463e3c[_0x8d44('0x11')][_0x8d44('0x14')]);}logger[_0x8d44('0x11')]('MailApplication,\x20%s,\x20%s',_0x19cc7d,_0x463e3c[_0x8d44('0x11')][_0x8d44('0x14')]);return _0x22236e(_0x463e3c[_0x8d44('0x11')]['message']);}else{logger[_0x8d44('0xe')](_0x8d44('0x13'),_0x19cc7d,_0x8d44('0x15'));_0x22236e(_0x463e3c['result'][_0x8d44('0x14')]);}})['catch'](function(_0x87ce17){logger[_0x8d44('0x11')](_0x8d44('0x13'),_0x19cc7d,_0x87ce17);_0x33c47e(_0x87ce17);});});}exports['UpdateMailApplication']=function(_0x55eb14){var _0x4718b0=this;return new Promise(function(_0x3c2349,_0x3e094a){return db[_0x8d44('0x16')][_0x8d44('0x17')](_0x55eb14[_0x8d44('0x18')],{'raw':_0x55eb14[_0x8d44('0x19')]?_0x55eb14[_0x8d44('0x19')][_0x8d44('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55eb14[_0x8d44('0x19')]?_0x55eb14['options'][_0x8d44('0x1b')]||null:null,'attributes':_0x55eb14['options']?_0x55eb14[_0x8d44('0x19')][_0x8d44('0x1c')]||null:null,'limit':_0x55eb14[_0x8d44('0x19')]?_0x55eb14[_0x8d44('0x19')][_0x8d44('0x1d')]||null:null})['then'](function(_0x5edc27){logger[_0x8d44('0xe')](_0x8d44('0x1e'),_0x55eb14);logger['debug']('UpdateMailApplication',_0x55eb14,JSON['stringify'](_0x5edc27));_0x3c2349(_0x5edc27);})['catch'](function(_0x34b641){logger['error']('UpdateMailApplication',_0x34b641[_0x8d44('0x14')],_0x55eb14);_0x3e094a(_0x4718b0['error'](0x1f4,_0x34b641[_0x8d44('0x14')]));});});}; \ No newline at end of file +var _0xb585=['randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','then','info','MailApplication,\x20%s,\x20%s','debug','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','UpdateMailApplication','MailApplication','options','raw','where','attributes','limit','catch','lodash','util','moment'];(function(_0x1672d1,_0x1ecb83){var _0x39f2a7=function(_0x1e9286){while(--_0x1e9286){_0x1672d1['push'](_0x1672d1['shift']());}};_0x39f2a7(++_0x1ecb83);}(_0xb585,0x183));var _0x5b58=function(_0x528554,_0x1dc778){_0x528554=_0x528554-0x0;var _0x2f3639=_0xb585[_0x528554];return _0x2f3639;};'use strict';var _=require(_0x5b58('0x0'));var util=require(_0x5b58('0x1'));var moment=require(_0x5b58('0x2'));var BPromise=require('bluebird');var rs=require(_0x5b58('0x3'));var fs=require('fs');var Redis=require(_0x5b58('0x4'));var db=require(_0x5b58('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5b58('0x6'));var config=require(_0x5b58('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5b58('0x8')][_0x5b58('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf33ffe,_0x569138,_0x3391ee){return new BPromise(function(_0x116faa,_0x191604){return client[_0x5b58('0xa')](_0xf33ffe,_0x3391ee)[_0x5b58('0xb')](function(_0x55f04f){logger[_0x5b58('0xc')](_0x5b58('0xd'),_0x569138,'request\x20sent');logger[_0x5b58('0xe')](_0x5b58('0xf'),_0x569138,_0x5b58('0x10'),JSON[_0x5b58('0x11')](_0x55f04f));if(_0x55f04f[_0x5b58('0x12')]){if(_0x55f04f[_0x5b58('0x12')][_0x5b58('0x13')]===0x1f4){logger[_0x5b58('0x12')]('MailApplication,\x20%s,\x20%s',_0x569138,_0x55f04f[_0x5b58('0x12')][_0x5b58('0x14')]);return _0x191604(_0x55f04f['error'][_0x5b58('0x14')]);}logger[_0x5b58('0x12')]('MailApplication,\x20%s,\x20%s',_0x569138,_0x55f04f['error']['message']);return _0x116faa(_0x55f04f[_0x5b58('0x12')][_0x5b58('0x14')]);}else{logger['info'](_0x5b58('0xd'),_0x569138,_0x5b58('0x10'));_0x116faa(_0x55f04f[_0x5b58('0x15')]['message']);}})['catch'](function(_0x483988){logger[_0x5b58('0x12')](_0x5b58('0xd'),_0x569138,_0x483988);_0x191604(_0x483988);});});}exports[_0x5b58('0x16')]=function(_0x15c71a){var _0x17fe02=this;return new Promise(function(_0x3ba9f9,_0x46a41d){return db[_0x5b58('0x17')]['update'](_0x15c71a['body'],{'raw':_0x15c71a['options']?_0x15c71a[_0x5b58('0x18')][_0x5b58('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x15c71a['options']?_0x15c71a[_0x5b58('0x18')][_0x5b58('0x1a')]||null:null,'attributes':_0x15c71a[_0x5b58('0x18')]?_0x15c71a[_0x5b58('0x18')][_0x5b58('0x1b')]||null:null,'limit':_0x15c71a['options']?_0x15c71a['options'][_0x5b58('0x1c')]||null:null})[_0x5b58('0xb')](function(_0x5f20d4){logger[_0x5b58('0xc')](_0x5b58('0x16'),_0x15c71a);logger[_0x5b58('0xe')]('UpdateMailApplication',_0x15c71a,JSON[_0x5b58('0x11')](_0x5f20d4));_0x3ba9f9(_0x5f20d4);})[_0x5b58('0x1d')](function(_0x4b6b8c){logger[_0x5b58('0x12')](_0x5b58('0x16'),_0x4b6b8c[_0x5b58('0x14')],_0x15c71a);_0x46a41d(_0x17fe02[_0x5b58('0x12')](0x1f4,_0x4b6b8c[_0x5b58('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index ca8149a..18330d2 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 _0x95bb=['../../components/interaction/service','./mailInteraction.controller','get','/describe','isAuthenticated','describe','/:id','show','getMessages','/:id/download','post','create','/:id/tags','tracked','mail','addTags','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service'];(function(_0x2cad5f,_0x23d523){var _0x1b9ddd=function(_0x49eb96){while(--_0x49eb96){_0x2cad5f['push'](_0x2cad5f['shift']());}};_0x1b9ddd(++_0x23d523);}(_0x95bb,0xed));var _0xb95b=function(_0x241e80,_0x59fdc1){_0x241e80=_0x241e80-0x0;var _0x231ba6=_0x95bb[_0x241e80];return _0x231ba6;};'use strict';var multer=require(_0xb95b('0x0'));var util=require(_0xb95b('0x1'));var path=require(_0xb95b('0x2'));var timeout=require('connect-timeout');var express=require(_0xb95b('0x3'));var router=express[_0xb95b('0x4')]();var auth=require(_0xb95b('0x5'));var interaction=require(_0xb95b('0x6'));var config=require('../../config/environment');var controller=require(_0xb95b('0x7'));router[_0xb95b('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb95b('0x8')](_0xb95b('0x9'),auth[_0xb95b('0xa')](),controller[_0xb95b('0xb')]);router[_0xb95b('0x8')](_0xb95b('0xc'),auth['isAuthenticated'](),controller[_0xb95b('0xd')]);router[_0xb95b('0x8')]('/:id/messages',auth[_0xb95b('0xa')](),controller[_0xb95b('0xe')]);router[_0xb95b('0x8')](_0xb95b('0xf'),auth[_0xb95b('0xa')](),controller['download']);router[_0xb95b('0x10')]('/',auth[_0xb95b('0xa')](),controller[_0xb95b('0x11')]);router[_0xb95b('0x10')]('/:id/messages',auth[_0xb95b('0xa')](),controller['addMessage']);router[_0xb95b('0x10')](_0xb95b('0x12'),auth[_0xb95b('0xa')](),interaction[_0xb95b('0x13')](_0xb95b('0x14'),'mailinteraction:addtags'),controller[_0xb95b('0x15')]);router[_0xb95b('0x16')](_0xb95b('0xc'),auth['isAuthenticated'](),interaction[_0xb95b('0x13')]('mail','mailinteraction:update'),controller[_0xb95b('0x17')]);router[_0xb95b('0x18')](_0xb95b('0xc'),auth[_0xb95b('0xa')](),interaction['tracked'](_0xb95b('0x14'),'mailinteraction:destroy'),controller[_0xb95b('0x19')]);router[_0xb95b('0x18')]('/:id/tags',auth[_0xb95b('0xa')](),controller['removeTags']);module[_0xb95b('0x1a')]=router; \ No newline at end of file +var _0x757a=['post','/:id/tags','tracked','mail','addTags','put','mailinteraction:update','update','mailinteraction:destroy','removeTags','exports','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','download'];(function(_0x25afc3,_0x533f62){var _0x4ddd61=function(_0x78f84b){while(--_0x78f84b){_0x25afc3['push'](_0x25afc3['shift']());}};_0x4ddd61(++_0x533f62);}(_0x757a,0x1af));var _0xa757=function(_0x51015a,_0x4f5e3c){_0x51015a=_0x51015a-0x0;var _0x30f01e=_0x757a[_0x51015a];return _0x30f01e;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require('path');var timeout=require(_0xa757('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0xa757('0x2'));var interaction=require(_0xa757('0x3'));var config=require(_0xa757('0x4'));var controller=require(_0xa757('0x5'));router[_0xa757('0x6')]('/',auth['isAuthenticated'](),controller[_0xa757('0x7')]);router[_0xa757('0x6')](_0xa757('0x8'),auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0x6')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller[_0xa757('0xc')]);router[_0xa757('0x6')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);router[_0xa757('0x6')](_0xa757('0xf'),auth['isAuthenticated'](),controller[_0xa757('0x10')]);router['post']('/',auth[_0xa757('0x9')](),controller['create']);router[_0xa757('0x11')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller['addMessage']);router[_0xa757('0x11')](_0xa757('0x12'),auth[_0xa757('0x9')](),interaction[_0xa757('0x13')](_0xa757('0x14'),'mailinteraction:addtags'),controller[_0xa757('0x15')]);router[_0xa757('0x16')]('/:id',auth[_0xa757('0x9')](),interaction[_0xa757('0x13')](_0xa757('0x14'),_0xa757('0x17')),controller[_0xa757('0x18')]);router['delete'](_0xa757('0xb'),auth[_0xa757('0x9')](),interaction[_0xa757('0x13')]('mail',_0xa757('0x19')),controller['destroy']);router['delete'](_0xa757('0x12'),auth['isAuthenticated'](),controller[_0xa757('0x1a')]);module[_0xa757('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index de8f9f9..97ada1a 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 _0x5424=['TEXT','long','ENUM','out','sequelize','iconv','BOOLEAN','DATE','STRING'];(function(_0x39aa81,_0xa27032){var _0x58cddd=function(_0x3a1509){while(--_0x3a1509){_0x39aa81['push'](_0x39aa81['shift']());}};_0x58cddd(++_0xa27032);}(_0x5424,0x190));var _0x4542=function(_0x274509,_0x1353f7){_0x274509=_0x274509-0x0;var _0x47298c=_0x5424[_0x274509];return _0x47298c;};'use strict';var Sequelize=require(_0x4542('0x0'));var iconv=require(_0x4542('0x1'));module['exports']={'closed':{'type':Sequelize[_0x4542('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4542('0x3')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x4542('0x4')]},'inReplyTo':{'type':Sequelize[_0x4542('0x4')](0x1fe)},'to':{'type':Sequelize[_0x4542('0x4')]},'cc':{'type':Sequelize[_0x4542('0x5')](_0x4542('0x6'))},'subject':{'type':Sequelize[_0x4542('0x5')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x4542('0x3')]},'substatus':{'type':Sequelize[_0x4542('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x4542('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x4542('0x7')]('in',_0x4542('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x4542('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x4542('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize['TEXT']('long')},'lastMsgText':{'type':Sequelize['TEXT']('long')}}; \ No newline at end of file +var _0xb33d=['TEXT','ENUM','out','long','sequelize','iconv','DATE','STRING'];(function(_0x4c49cd,_0x1b630d){var _0x29ba71=function(_0x3df9cf){while(--_0x3df9cf){_0x4c49cd['push'](_0x4c49cd['shift']());}};_0x29ba71(++_0x1b630d);}(_0xb33d,0x1cc));var _0xdb33=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0xb33d[_0x3305de];return _0x3b5a84;};'use strict';var Sequelize=require(_0xdb33('0x0'));var iconv=require(_0xdb33('0x1'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xdb33('0x2')]},'disposition':{'type':Sequelize[_0xdb33('0x3')]},'note':{'type':Sequelize[_0xdb33('0x3')]},'inReplyTo':{'type':Sequelize[_0xdb33('0x3')](0x1fe)},'to':{'type':Sequelize[_0xdb33('0x3')]},'cc':{'type':Sequelize[_0xdb33('0x4')]('long')},'subject':{'type':Sequelize[_0xdb33('0x4')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xdb33('0x2')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0xdb33('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xdb33('0x5')]('in',_0xdb33('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xdb33('0x5')]('in',_0xdb33('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize['TEXT'](_0xdb33('0x7'))},'lastMsgText':{'type':Sequelize['TEXT'](_0xdb33('0x7'))}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index fb625d5..68d5587 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 _0xdcca=['conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','plainBody','start','compact','isEmpty','where','i.MailAccountId\x20IN\x20?','createdAt','$gte','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','t.id\x20IN\x20?','resolve','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','i.updatedAt','i.closed','i.closedAt','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.substatus','i.to','i.UserId','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','Setting','enableEmailPreview','all','rows','params','includeAll','options','create','body','describe','MailMessage','addMessage','omit','ids','getMessages','MailInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','addTags','setTags','mailInteractionTags:save','removeTags','download','unix','root','server','files','tmp','join','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','bcc','subject','get','mkdirSync','each','headers','Bcc','basename','existsSync','readFileSync','build','writeFileSync','message%d.eml','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./mailInteraction.socket','register','sendStatus','end','status','count','offset','set','Content-Range','apply','save','update','then','destroy','stack','name','map','fullname','TagIds','Tags','split','forEach','push','MailInteraction','findOne','lastMsgBody','lastMsgText','trimStart','fromString','catch','rawAttributes','type','keys','query','filters','intersection','model','attributes','fields','length','nolimit','limit','order','sort','pick','select','field','color','u.id','u.fullname','ui.MailInteractionId','from','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','a.id\x20=\x20i.MailAccountId','mail_messages','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator'];(function(_0x1a1c2c,_0x1ab66b){var _0x4e3752=function(_0x57e45b){while(--_0x57e45b){_0x1a1c2c['push'](_0x1a1c2c['shift']());}};_0x4e3752(++_0x1ab66b);}(_0xdcca,0x8c));var _0xadcc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdcca[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xadcc('0x0'));var emlformat=require(_0xadcc('0x1'));var rimraf=require(_0xadcc('0x2'));var zipdir=require(_0xadcc('0x3'));var jsonpatch=require(_0xadcc('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xadcc('0x5'));var Mustache=require(_0xadcc('0x6'));var util=require(_0xadcc('0x7'));var path=require(_0xadcc('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xadcc('0x9'));var squel=require(_0xadcc('0xa'));var crypto=require(_0xadcc('0xb'));var jsforce=require(_0xadcc('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xadcc('0xd'));var Papa=require(_0xadcc('0xe'));var htmlToText=require('html-to-text');var Redis=require('ioredis');var authService=require(_0xadcc('0xf'));var qs=require(_0xadcc('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xadcc('0x11'));var logger=require(_0xadcc('0x12'))(_0xadcc('0x13'));var utils=require(_0xadcc('0x14'));var config=require(_0xadcc('0x15'));var db=require(_0xadcc('0x16'))['db'];config[_0xadcc('0x17')]=_[_0xadcc('0x18')](config[_0xadcc('0x17')],{'host':_0xadcc('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xadcc('0x17')]));require(_0xadcc('0x1a'))[_0xadcc('0x1b')](socket);function respondWithStatusCode(_0x2baeec,_0xfb3013){_0xfb3013=_0xfb3013||0xcc;return function(_0x5a69c8){if(_0x5a69c8){return _0x2baeec[_0xadcc('0x1c')](_0xfb3013);}return _0x2baeec['status'](_0xfb3013)[_0xadcc('0x1d')]();};}function respondWithResult(_0x132281,_0xfe2730){_0xfe2730=_0xfe2730||0xc8;return function(_0x184c8c){if(_0x184c8c){return _0x132281[_0xadcc('0x1e')](_0xfe2730)['json'](_0x184c8c);}};}function respondWithFilteredResult(_0x359ad9,_0x5ea8a3){return function(_0x38329c){if(_0x38329c){var _0x574100=_0x38329c[_0xadcc('0x1f')],_0x581547=_0x5ea8a3[_0xadcc('0x20')],_0x1611a0=_0x5ea8a3['offset']+_0x5ea8a3['limit'],_0x5af4f4;if(_0x1611a0>=_0x574100){_0x1611a0=_0x574100;_0x5af4f4=0xc8;}else{_0x5af4f4=0xce;}_0x359ad9[_0xadcc('0x1e')](_0x5af4f4);return _0x359ad9[_0xadcc('0x21')](_0xadcc('0x22'),_0x581547+'-'+_0x1611a0+'/'+_0x574100)['json'](_0x38329c);}return null;};}function patchUpdates(_0x345c41){return function(_0x5283bf){try{jsonpatch[_0xadcc('0x23')](_0x5283bf,_0x345c41,!![]);}catch(_0x1c9f60){return BPromise['reject'](_0x1c9f60);}return _0x5283bf[_0xadcc('0x24')]();};}function saveUpdates(_0x1b09a5,_0x1ffb58){return function(_0x5a6917){if(_0x5a6917){return _0x5a6917[_0xadcc('0x25')](_0x1b09a5)[_0xadcc('0x26')](function(_0xa7024e){return _0xa7024e;});}return null;};}function removeEntity(_0x377ed1,_0x449f33){return function(_0x3c1766){if(_0x3c1766){return _0x3c1766[_0xadcc('0x27')]()[_0xadcc('0x26')](function(){_0x377ed1[_0xadcc('0x1e')](0xcc)[_0xadcc('0x1d')]();});}};}function handleEntityNotFound(_0x578f77,_0x3e67ce){return function(_0x143095){if(!_0x143095){_0x578f77[_0xadcc('0x1c')](0x194);}return _0x143095;};}function handleError(_0x17fb3c,_0x5950d0){_0x5950d0=_0x5950d0||0x1f4;return function(_0xf8576b){logger['error'](_0xf8576b[_0xadcc('0x28')]);if(_0xf8576b[_0xadcc('0x29')]){delete _0xf8576b[_0xadcc('0x29')];}_0x17fb3c[_0xadcc('0x1e')](_0x5950d0)['send'](_0xf8576b);};}function getInteractionUsers(_0x19ae1b,_0x55555f){return new BPromise(function(_0x15b3e7,_0x8e481){try{if(_0x55555f[_0x19ae1b['id']]){_0x19ae1b['Users']=_[_0xadcc('0x2a')](_0x55555f[_0x19ae1b['id']],function(_0x2fec45){return{'id':_0x2fec45['id'],'fullname':_0x2fec45[_0xadcc('0x2b')]};});}}catch(_0x381070){_0x8e481(_0x381070);}_0x15b3e7(_0x19ae1b);});}function getInteractionTags(_0x554699,_0x2a648e){return new BPromise(function(_0x4e60d1,_0x4659cd){try{if(_0x554699[_0xadcc('0x2c')]){_0x554699[_0xadcc('0x2d')]=[];_0x554699['TagIds'][_0xadcc('0x2e')](',')[_0xadcc('0x2f')](function(_0x3a91ea){_0x554699[_0xadcc('0x2d')][_0xadcc('0x30')](_0x2a648e[_0x3a91ea]);});}delete _0x554699[_0xadcc('0x2c')];}catch(_0x4cd646){_0x4659cd(_0x4cd646);}_0x4e60d1(_0x554699);});}function getLastMessageText(_0x121c87){return new BPromise(function(_0x3b518b,_0x4ff850){return db[_0xadcc('0x31')][_0xadcc('0x32')]({'where':{'id':_0x121c87['id']},'attributes':[_0xadcc('0x33'),_0xadcc('0x34')],'raw':!![]})[_0xadcc('0x26')](function(_0x1cd3a8){if(!_0x1cd3a8[_0xadcc('0x34')]){_0x121c87[_0xadcc('0x34')]=_[_0xadcc('0x35')](htmlToText[_0xadcc('0x36')](_0x1cd3a8[_0xadcc('0x33')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x121c87[_0xadcc('0x34')]=_0x1cd3a8[_0xadcc('0x34')];}_0x3b518b(_0x121c87);})[_0xadcc('0x37')](function(_0x145e2f){_0x4ff850(_0x145e2f);});});}function updateMailInteraction(_0x78fba,_0x132fb1,_0x198cec,_0x56e988){return new BPromise(function(_0x83631e,_0x36f50a){return getInteractionUsers(_0x78fba,_0x198cec)['then'](function(_0x4314a2){return getInteractionTags(_0x4314a2,_0x132fb1);})[_0xadcc('0x26')](function(_0x2809a4){if(_0x56e988){_0x83631e(getLastMessageText(_0x2809a4));}else{_0x83631e(_0x2809a4);}})[_0xadcc('0x37')](function(_0x561362){_0x36f50a(_0x561362);});});}exports['index']=function(_0x2b6ef0,_0x43d789){var _0xa2be55={},_0x4b0006={},_0x322787={'count':0x0,'rows':[]};var _0x188cf9=_[_0xadcc('0x2a')](db['MailInteraction'][_0xadcc('0x38')],function(_0x2b47e1){return{'name':_0x2b47e1['fieldName'],'type':_0x2b47e1[_0xadcc('0x39')]['key']};});_0x4b0006['model']=_['map'](_0x188cf9,_0xadcc('0x29'));_0x4b0006['query']=_[_0xadcc('0x3a')](_0x2b6ef0[_0xadcc('0x3b')]);_0x4b0006[_0xadcc('0x3c')]=_[_0xadcc('0x3d')](_0x4b0006[_0xadcc('0x3e')],_0x4b0006[_0xadcc('0x3b')]);_0xa2be55[_0xadcc('0x3f')]=_[_0xadcc('0x3d')](_0x4b0006[_0xadcc('0x3e')],qs[_0xadcc('0x40')](_0x2b6ef0[_0xadcc('0x3b')][_0xadcc('0x40')]));_0xa2be55['attributes']=_0xa2be55['attributes'][_0xadcc('0x41')]?_0xa2be55[_0xadcc('0x3f')]:_0x4b0006[_0xadcc('0x3e')];if(!_0x2b6ef0[_0xadcc('0x3b')]['hasOwnProperty'](_0xadcc('0x42'))){_0xa2be55[_0xadcc('0x43')]=qs[_0xadcc('0x43')](_0x2b6ef0[_0xadcc('0x3b')][_0xadcc('0x43')]);_0xa2be55['offset']=qs['offset'](_0x2b6ef0[_0xadcc('0x3b')][_0xadcc('0x20')]);}_0xa2be55[_0xadcc('0x44')]=qs[_0xadcc('0x45')](_0x2b6ef0[_0xadcc('0x3b')][_0xadcc('0x45')]);_0xa2be55['where']=qs['filters'](_[_0xadcc('0x46')](_0x2b6ef0[_0xadcc('0x3b')],_0x4b0006['filters']));var _0x406a22=[];var _0xb8c3f2=squel[_0xadcc('0x47')]()[_0xadcc('0x48')]('id')[_0xadcc('0x48')](_0xadcc('0x29'))[_0xadcc('0x48')](_0xadcc('0x49'))['from']('tools_tags');var _0x4196b8=squel[_0xadcc('0x47')]()[_0xadcc('0x48')](_0xadcc('0x4a'))['field'](_0xadcc('0x4b'))[_0xadcc('0x48')](_0xadcc('0x4c'))[_0xadcc('0x4d')](_0xadcc('0x4e'),'ui')[_0xadcc('0x4f')](_0xadcc('0x50'),'u',_0xadcc('0x51'));var _0x3a0538=squel[_0xadcc('0x47')]()[_0xadcc('0x4d')](_0xadcc('0x52'),'i')[_0xadcc('0x4f')](_0xadcc('0x53'),'c',_0xadcc('0x54'))[_0xadcc('0x4f')]('users','o',_0xadcc('0x55'))[_0xadcc('0x4f')]('mail_accounts','a',_0xadcc('0x56'))['left_join'](_0xadcc('0x57'),'me','me.MailInteractionId\x20=\x20i.id')[_0xadcc('0x4f')](_0xadcc('0x58'),'it',_0xadcc('0x59'))[_0xadcc('0x4f')]('tools_tags','t',_0xadcc('0x5a'));var _0x25be0e=squel[_0xadcc('0x5b')]();var _0x2fcad8=[];var _0x199b10=squel['expr']();var _0x35162e;if(_0x2b6ef0['query'][_0xadcc('0x5c')]){_0x35162e=as[_0xadcc('0x5d')](_0x2b6ef0['query']['search']);var _0x267e67=_0x35162e[_0xadcc('0x5e')];for(var _0x458ae6=0x0;_0x458ae6<_0x35162e[_0xadcc('0x5f')][_0xadcc('0x41')];_0x458ae6++){var _0x8df9c9=_0x35162e[_0xadcc('0x5f')][_0x458ae6];var _0x3be3e4='i';var _0x2bf6d2=_[_0xadcc('0x60')](_0x188cf9,[_0xadcc('0x29'),_0x8df9c9['field']]);if(!_0x2bf6d2){switch(_0x8df9c9[_0xadcc('0x48')]){case _0xadcc('0x61'):if(_0x8df9c9[_0xadcc('0x62')]==0x1){_0x3a0538[_0xadcc('0x63')]('`'+_0x8df9c9[_0xadcc('0x48')]+_0xadcc('0x64'));}else{_0x3a0538[_0xadcc('0x63')]('`'+_0x8df9c9[_0xadcc('0x48')]+_0xadcc('0x65'));}break;case _0xadcc('0x66'):if(_0x8df9c9[_0xadcc('0x67')]===_0xadcc('0x68')){if(_0x8df9c9[_0xadcc('0x62')][_0xadcc('0x2e')]('\x20')[_0xadcc('0x41')]>0x1){_0x25be0e[_0x267e67](_0xadcc('0x69'),qs[_0xadcc('0x6a')](_0x8df9c9[_0xadcc('0x62')]),null);}else{var _0x2bbb57='%'+_0x8df9c9['value']+'%';_0x25be0e[_0x267e67](_0xadcc('0x6b'),_0x2bbb57,_0x2bbb57,_0x2bbb57);}}else{_0x2bf6d2=_['find'](_0x188cf9,[_0xadcc('0x29'),'ContactId']);_0x8df9c9[_0xadcc('0x48')]=_0xadcc('0x6c');_0x33ac71=as[_0xadcc('0x6d')](_0x3be3e4,_0x2bf6d2['type'],_0x8df9c9);_0x25be0e[_0x267e67](_0x33ac71[_0xadcc('0x6e')],_0x33ac71[_0xadcc('0x62')]['start'],_0x33ac71[_0xadcc('0x62')][_0xadcc('0x1d')]);}break;case _0xadcc('0x6f'):var _0x37227f=_0x8df9c9[_0xadcc('0x62')]['split'](',')[_0xadcc('0x2a')](function(_0x1dd479){return Number(_0x1dd479);});_0x37227f['forEach'](function(_0x17329c){_0x199b10['or'](_0xadcc('0x70'),'%,'+_0x17329c+',%');});_0x2fcad8=_['union'](_0x2fcad8,_0x37227f);break;case _0xadcc('0x71'):if(_0x8df9c9['operator']==='$substring'){_0x25be0e[_0x267e67](_0xadcc('0x72'),'%'+_0x8df9c9[_0xadcc('0x62')]+'%',null);}else{_0x2bf6d2=_[_0xadcc('0x60')](_0x188cf9,[_0xadcc('0x29'),_0xadcc('0x73')]);_0x8df9c9[_0xadcc('0x48')]='UserId';_0x33ac71=as[_0xadcc('0x6d')](_0x3be3e4,_0x2bf6d2[_0xadcc('0x39')],_0x8df9c9);_0x25be0e[_0x267e67](_0x33ac71[_0xadcc('0x6e')],_0x33ac71[_0xadcc('0x62')]['start'],_0x33ac71['value'][_0xadcc('0x1d')]);}break;case _0xadcc('0x74'):_0x33ac71=as[_0xadcc('0x6d')]('me',null,_0x8df9c9);_0x25be0e[_0x267e67](_0x33ac71[_0xadcc('0x6e')],_0x33ac71['value'][_0xadcc('0x75')],_0x33ac71[_0xadcc('0x62')][_0xadcc('0x1d')]);break;}}else{var _0x33ac71=as[_0xadcc('0x6d')](_0x3be3e4,_0x2bf6d2[_0xadcc('0x39')],_0x8df9c9);_0x25be0e[_0x267e67](_0x33ac71[_0xadcc('0x6e')],_0x33ac71[_0xadcc('0x62')][_0xadcc('0x75')],_0x33ac71[_0xadcc('0x62')]['end']);}}}else{var _0x2f74c4=_(_0x2b6ef0[_0xadcc('0x3b')])['keys']()[_0xadcc('0x2a')](function(_0x58668f){return _['some'](_0x188cf9,[_0xadcc('0x29'),_0x58668f])?_0x58668f:undefined;})[_0xadcc('0x76')]()[_0xadcc('0x62')]();if(!_[_0xadcc('0x77')](_0x2f74c4)){_0x2f74c4[_0xadcc('0x2f')](function(_0x42482f){if(_0x42482f==='MailAccountId'){_0x3a0538[_0xadcc('0x78')](_0xadcc('0x79'),[]['concat'](_0x2b6ef0[_0xadcc('0x3b')][_0x42482f]));}else if(_0x42482f===_0xadcc('0x7a')){var _0x54dec9=JSON['parse'](_0x2b6ef0[_0xadcc('0x3b')][_0x42482f])[_0xadcc('0x7b')];var _0x1efcf9=JSON[_0xadcc('0x7c')](_0x2b6ef0[_0xadcc('0x3b')][_0x42482f])['$lte'];_0x3a0538[_0xadcc('0x78')](_0xadcc('0x7d'),_0x54dec9,_0x1efcf9);}else{if(_0x2b6ef0['query'][_0x42482f]===_0xadcc('0x7e')){_0x3a0538['where']('i.'+_0x42482f+_0xadcc('0x7f'));}else{_0x3a0538[_0xadcc('0x78')]('i.'+_0x42482f+_0xadcc('0x80'),_0x2b6ef0['query'][_0x42482f]);}}});}if(_0x2b6ef0[_0xadcc('0x3b')][_0xadcc('0x81')]){if(_0x2b6ef0[_0xadcc('0x3b')][_0xadcc('0x81')]==0x1){_0x3a0538[_0xadcc('0x63')](_0xadcc('0x82'));}else{_0x3a0538['having'](_0xadcc('0x83'));}}if(_0x2b6ef0[_0xadcc('0x3b')][_0xadcc('0x84')]){_0x2fcad8=_[_0xadcc('0x85')](_0x2b6ef0['query'][_0xadcc('0x84')])?_0x2b6ef0[_0xadcc('0x3b')][_0xadcc('0x84')]:new Array(_0x2b6ef0[_0xadcc('0x3b')][_0xadcc('0x84')]);_0x2fcad8[_0xadcc('0x2f')](function(_0xaac74c){_0x199b10['or'](_0xadcc('0x70'),'%,'+_0xaac74c+',%');});}if(_0x2b6ef0[_0xadcc('0x3b')][_0xadcc('0x86')]){var _0x820a79=_0x2b6ef0[_0xadcc('0x3b')][_0xadcc('0x86')][_0xadcc('0x87')]('\x5c','\x5c\x5c')[_0xadcc('0x87')]('\x27\x27',_0xadcc('0x88'));if(qs['isNumeric'](_0x820a79)){_0x25be0e['or']('i.id\x20LIKE\x20?',_0x820a79+'%');}else if(qs[_0xadcc('0x89')](_0x820a79)){_0x25be0e['or'](_0xadcc('0x8a'),_0x820a79+'%');}else{_0x25be0e['or'](_0xadcc('0x8b'),qs[_0xadcc('0x6a')](_0x820a79))['or'](_0xadcc('0x8c'),qs[_0xadcc('0x6a')](_0x820a79));}}}_0x3a0538['where'](_0x25be0e);_0x3a0538[_0xadcc('0x8d')](_0xadcc('0x8e'));var _0x1cb656={'type':db[_0xadcc('0x8f')][_0xadcc('0x90')][_0xadcc('0x91')],'raw':!![]};var _0x42b5fd=_0x3a0538[_0xadcc('0x92')]();_0x42b5fd['field'](_0xadcc('0x8e'));_0x42b5fd[_0xadcc('0x48')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xadcc('0x61'));if(_0xa2be55['order']){_0xa2be55['order'][_0xadcc('0x2f')](function(_0x25f28c){_0x3a0538[_0xadcc('0x44')]('i.'+_0x25f28c[0x0],_0x25f28c[0x1]==='DESC'?![]:!![]);});}if(!_[_0xadcc('0x77')](_0x2fcad8)){_0x3a0538['having'](_0x199b10);_0x42b5fd[_0xadcc('0x78')](_0xadcc('0x93'),_0x2fcad8);}BPromise[_0xadcc('0x94')]()[_0xadcc('0x26')](function(){if(!_0x35162e&&_0x2b6ef0[_0xadcc('0x3b')]['MailAccountId'])return;return _0x2b6ef0['user']['getMailAccounts']({'attributes':['id'],'raw':!![]})[_0xadcc('0x26')](function(_0xf39582){if(_['isEmpty'](_0xf39582)){_0x42b5fd[_0xadcc('0x78')](_0xadcc('0x95'));_0x3a0538[_0xadcc('0x78')]('i.MailAccountId\x20IS\x20NULL');}else{_0x42b5fd['where'](_0xadcc('0x79'),_[_0xadcc('0x2a')](_0xf39582,'id'));_0x3a0538[_0xadcc('0x78')](_0xadcc('0x79'),_[_0xadcc('0x2a')](_0xf39582,'id'));}});})[_0xadcc('0x26')](function(){db[_0xadcc('0x96')]['query'](_0x42b5fd[_0xadcc('0x97')](),_0x1cb656)[_0xadcc('0x26')](function(_0x211739){_0x322787[_0xadcc('0x1f')]=_0x211739[_0xadcc('0x41')];if(_0x322787[_0xadcc('0x1f')]===0x0)return[];return db['sequelize'][_0xadcc('0x3b')](_0xb8c3f2['toString'](),_0x1cb656)['then'](function(_0x3e72d6){_0x406a22=_[_0xadcc('0x98')](_0x3e72d6,'id');_0x1cb656=_[_0xadcc('0x99')](_0x1cb656,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2b6ef0['query'][_0xadcc('0x40')]){_0xa2be55[_0xadcc('0x3f')][_0xadcc('0x2f')](function(_0x48ab6c){_0x3a0538['field']('i.'+_0x48ab6c);});}else{_0x3a0538['field'](_0xadcc('0x9a'),_0xadcc('0x61'));_0x3a0538['field'](_0xadcc('0x9b'),_0xadcc('0x9c'));_0x3a0538[_0xadcc('0x48')](_0xadcc('0x9d'),'Account.mandatoryDisposition');_0x3a0538[_0xadcc('0x48')](_0xadcc('0x8e'));_0x3a0538['field']('i.createdAt');_0x3a0538[_0xadcc('0x48')](_0xadcc('0x9e'));_0x3a0538[_0xadcc('0x48')](_0xadcc('0x9f'));_0x3a0538[_0xadcc('0x48')](_0xadcc('0xa0'));_0x3a0538[_0xadcc('0x48')]('i.attach');_0x3a0538[_0xadcc('0x48')](_0xadcc('0xa1'));_0x3a0538['field'](_0xadcc('0xa2'));_0x3a0538[_0xadcc('0x48')](_0xadcc('0xa3'));_0x3a0538[_0xadcc('0x48')](_0xadcc('0xa4'));_0x3a0538[_0xadcc('0x48')](_0xadcc('0xa5'));_0x3a0538[_0xadcc('0x48')](_0xadcc('0xa6'));_0x3a0538[_0xadcc('0x48')]('i.ContactId');_0x3a0538[_0xadcc('0x48')]('i.MailAccountId');_0x3a0538[_0xadcc('0x48')](_0xadcc('0xa7'));_0x3a0538['field']('c.firstName','Contact.firstName');_0x3a0538[_0xadcc('0x48')]('c.lastName',_0xadcc('0xa8'));_0x3a0538[_0xadcc('0x48')](_0xadcc('0xa9'),_0xadcc('0xaa'));_0x3a0538[_0xadcc('0x48')](_0xadcc('0xab'),_0xadcc('0xac'));_0x3a0538['field'](_0xadcc('0xad'),'Contact.mobile');_0x3a0538[_0xadcc('0x48')](_0xadcc('0xae'),_0xadcc('0xaf'));_0x3a0538[_0xadcc('0x48')](_0xadcc('0xb0'),_0xadcc('0xb1'));_0x3a0538[_0xadcc('0x48')](_0xadcc('0xb2'),_0xadcc('0xb3'));_0x3a0538[_0xadcc('0x48')](_0xadcc('0xb4'),_0xadcc('0x2c'));}_0x3a0538['limit'](_0xa2be55[_0xadcc('0x43')]);_0x3a0538[_0xadcc('0x20')](_0xa2be55['offset']);return db[_0xadcc('0x96')][_0xadcc('0x3b')](_0x3a0538[_0xadcc('0x97')](),_0x1cb656);})['then'](function(_0x3fdec7){_0x4196b8[_0xadcc('0x78')](_0xadcc('0xb5'),_[_0xadcc('0x2a')](_0x3fdec7,'id'));return db[_0xadcc('0x96')][_0xadcc('0x3b')](_0x4196b8[_0xadcc('0x97')](),_0x1cb656)[_0xadcc('0x26')](function(_0xadcd11){var _0x2cc282=_[_0xadcc('0xb6')](_0xadcd11,'MailInteractionId');var _0x384e60=[];return db[_0xadcc('0xb7')]['findOne']({'attributes':[_0xadcc('0xb8')],'raw':!![]})[_0xadcc('0x26')](function(_0x414848){var _0x3ecc2e=_0x414848[_0xadcc('0xb8')];_0x3fdec7[_0xadcc('0x2f')](function(_0x1d737c){_0x384e60['push'](updateMailInteraction(_0x1d737c,_0x406a22,_0x2cc282,_0x3ecc2e));});return BPromise[_0xadcc('0xb9')](_0x384e60);});});});})[_0xadcc('0x26')](function(_0x1de507){_0x322787[_0xadcc('0xba')]=_0x1de507;return _0x322787;})['then'](respondWithFilteredResult(_0x43d789,_0xa2be55));})[_0xadcc('0x37')](handleError(_0x43d789,null));};exports['show']=function(_0x242971,_0x303193){var _0x342832={'raw':![],'where':{'id':_0x242971[_0xadcc('0xbb')]['id']}},_0x1af601={};_0x1af601[_0xadcc('0x3e')]=_['keys'](db[_0xadcc('0x31')][_0xadcc('0x38')]);_0x1af601[_0xadcc('0x3b')]=_[_0xadcc('0x3a')](_0x242971[_0xadcc('0x3b')]);_0x1af601[_0xadcc('0x3c')]=_[_0xadcc('0x3d')](_0x1af601['model'],_0x1af601[_0xadcc('0x3b')]);_0x342832[_0xadcc('0x3f')]=_['intersection'](_0x1af601[_0xadcc('0x3e')],qs['fields'](_0x242971[_0xadcc('0x3b')]['fields']));_0x342832[_0xadcc('0x3f')]=_0x342832[_0xadcc('0x3f')][_0xadcc('0x41')]?_0x342832['attributes']:_0x1af601[_0xadcc('0x3e')];if(_0x242971[_0xadcc('0x3b')][_0xadcc('0xbc')]){_0x342832['include']=[{'all':!![]}];}_0x342832=_[_0xadcc('0x99')]({},_0x342832,_0x242971[_0xadcc('0xbd')]);return db[_0xadcc('0x31')][_0xadcc('0x60')](_0x342832)[_0xadcc('0x26')](handleEntityNotFound(_0x303193,null))[_0xadcc('0x26')](respondWithResult(_0x303193,null))[_0xadcc('0x37')](handleError(_0x303193,null));};exports['create']=function(_0x16cc5b,_0x3df8f4){return db[_0xadcc('0x31')][_0xadcc('0xbe')](_0x16cc5b['body'],{})['then'](respondWithResult(_0x3df8f4,0xc9))['catch'](handleError(_0x3df8f4,null));};exports[_0xadcc('0x25')]=function(_0x4c0193,_0x1e6818){if(_0x4c0193[_0xadcc('0xbf')]['id']){delete _0x4c0193[_0xadcc('0xbf')]['id'];}return db[_0xadcc('0x31')][_0xadcc('0x60')]({'where':{'id':_0x4c0193[_0xadcc('0xbb')]['id']}})[_0xadcc('0x26')](handleEntityNotFound(_0x1e6818,null))[_0xadcc('0x26')](saveUpdates(_0x4c0193[_0xadcc('0xbf')],null))[_0xadcc('0x26')](respondWithResult(_0x1e6818,null))['catch'](handleError(_0x1e6818,null));};exports[_0xadcc('0x27')]=function(_0x561dad,_0xbff8e9){return db['MailInteraction'][_0xadcc('0x60')]({'where':{'id':_0x561dad[_0xadcc('0xbb')]['id']}})['then'](handleEntityNotFound(_0xbff8e9,null))['then'](removeEntity(_0xbff8e9,null))[_0xadcc('0x37')](handleError(_0xbff8e9,null));};exports['describe']=function(_0x5d809b,_0x627a50){return db[_0xadcc('0x31')][_0xadcc('0xc0')]()[_0xadcc('0x26')](respondWithResult(_0x627a50,null))[_0xadcc('0x37')](handleError(_0x627a50,null));};exports['addMessage']=function(_0x56d3fe,_0x240651,_0x308775){return db[_0xadcc('0xc1')]['find']({'where':{'id':_0x56d3fe[_0xadcc('0xbb')]['id']}})[_0xadcc('0x26')](handleEntityNotFound(_0x240651,null))[_0xadcc('0x26')](function(_0x4e16a2){if(_0x4e16a2){return _0x4e16a2[_0xadcc('0xc2')](_0x56d3fe[_0xadcc('0xbf')]['ids'],_[_0xadcc('0xc3')](_0x56d3fe['body'],[_0xadcc('0xc4'),'id'])||{});}})[_0xadcc('0x26')](respondWithResult(_0x240651,null))[_0xadcc('0x37')](handleError(_0x240651,null));};exports[_0xadcc('0xc5')]=function(_0x3584c3,_0x1ada7f,_0x3584a2){var _0x25e466={'raw':![],'where':{}};var _0x152dcf={};var _0x58cbe7={'count':0x0,'rows':[]};return db[_0xadcc('0x31')][_0xadcc('0x32')]({'where':{'id':_0x3584c3[_0xadcc('0xbb')]['id']}})['then'](handleEntityNotFound(_0x1ada7f,null))[_0xadcc('0x26')](function(_0x5a3386){if(_0x5a3386){_0x152dcf[_0xadcc('0x3e')]=_[_0xadcc('0x3a')](db[_0xadcc('0xc1')]['rawAttributes']);_0x152dcf[_0xadcc('0x3b')]=_[_0xadcc('0x3a')](_0x3584c3[_0xadcc('0x3b')]);_0x152dcf[_0xadcc('0x3c')]=_[_0xadcc('0x3d')](_0x152dcf[_0xadcc('0x3e')],_0x152dcf[_0xadcc('0x3b')]);_0x25e466['attributes']=_[_0xadcc('0x3d')](_0x152dcf['model'],qs[_0xadcc('0x40')](_0x3584c3[_0xadcc('0x3b')]['fields']));_0x25e466[_0xadcc('0x3f')]=_0x25e466['attributes']['length']?_0x25e466[_0xadcc('0x3f')]:_0x152dcf[_0xadcc('0x3e')];if(!_0x3584c3['query']['hasOwnProperty']('nolimit')){_0x25e466[_0xadcc('0x43')]=qs['limit'](_0x3584c3[_0xadcc('0x3b')][_0xadcc('0x43')]);_0x25e466['offset']=qs[_0xadcc('0x20')](_0x3584c3[_0xadcc('0x3b')]['offset']);}_0x25e466[_0xadcc('0x44')]=qs[_0xadcc('0x45')](_0x3584c3[_0xadcc('0x3b')]['sort']);_0x25e466[_0xadcc('0x78')]=qs[_0xadcc('0x3c')](_[_0xadcc('0x46')](_0x3584c3[_0xadcc('0x3b')],_0x152dcf[_0xadcc('0x3c')]));_0x25e466[_0xadcc('0x78')][_0xadcc('0xc6')]=_0x5a3386['id'];if(_0x3584c3[_0xadcc('0x3b')][_0xadcc('0x86')]){_0x25e466[_0xadcc('0x78')]=_[_0xadcc('0x99')](_0x25e466['where'],{'$or':_[_0xadcc('0x2a')](_0x25e466['attributes'],function(_0x120002){var _0x1d4936={};_0x1d4936[_0x120002]={'$like':'%'+_0x3584c3[_0xadcc('0x3b')]['filter']+'%'};return _0x1d4936;})});}if(_0x3584c3[_0xadcc('0x3b')][_0xadcc('0x7b')]){var _0x465be0=_0x3584c3['query'][_0xadcc('0x7b')][_0xadcc('0x2e')](',');var _0x97ef01={};_0x97ef01[_0x465be0[0x0]]={'$gte':moment(_0x465be0[0x1])[_0xadcc('0xc7')](_0xadcc('0xc8'))};_0x25e466['where']=_['merge'](_0x25e466[_0xadcc('0x78')],_0x97ef01);}_0x25e466=_[_0xadcc('0x99')]({},_0x25e466,_0x3584c3['options']);return db['MailMessage']['count']({'where':_0x25e466['where']})[_0xadcc('0x26')](function(_0x2977d4){_0x58cbe7[_0xadcc('0x1f')]=_0x2977d4;if(_0x3584c3[_0xadcc('0x3b')]['includeAll']){_0x25e466[_0xadcc('0xc9')]=[{'all':!![]}];}return db[_0xadcc('0xc1')][_0xadcc('0xca')](_0x25e466);})[_0xadcc('0x26')](function(_0x2fa4c7){_0x58cbe7[_0xadcc('0xba')]=_0x2fa4c7;return _0x58cbe7;});}})[_0xadcc('0x26')](respondWithFilteredResult(_0x1ada7f,_0x25e466))[_0xadcc('0x37')](handleError(_0x1ada7f,null));};exports[_0xadcc('0xcb')]=function(_0xc79607,_0xdad4c1,_0x3895e1){return db[_0xadcc('0x31')]['find']({'where':{'id':_0xc79607[_0xadcc('0xbb')]['id']}})['then'](handleEntityNotFound(_0xdad4c1,null))[_0xadcc('0x26')](function(_0x5e33a0){if(_0x5e33a0){return _0x5e33a0[_0xadcc('0xcc')](_0xc79607[_0xadcc('0xbf')][_0xadcc('0xc4')],_[_0xadcc('0xc3')](_0xc79607['body'],['ids','id'])||{})['spread'](function(){return db[_0xadcc('0x6f')][_0xadcc('0xca')]({'attributes':['id',_0xadcc('0x29'),_0xadcc('0x49')],'where':{'id':_0xc79607[_0xadcc('0xbf')][_0xadcc('0xc4')]}});})['then'](function(_0x354b44){socket['emit'](_0xadcc('0xcd'),{'id':Number(_0xc79607['params']['id']),'tags':_0x354b44||[]});return{'id':Number(_0xc79607[_0xadcc('0xbb')]['id']),'tags':_0x354b44||[]};});}})[_0xadcc('0x26')](respondWithResult(_0xdad4c1,null))[_0xadcc('0x37')](handleError(_0xdad4c1,null));};exports['removeTags']=function(_0x249f15,_0x574d5e,_0x4a524f){return db[_0xadcc('0x31')]['find']({'where':{'id':_0x249f15[_0xadcc('0xbb')]['id']}})[_0xadcc('0x26')](handleEntityNotFound(_0x574d5e,null))[_0xadcc('0x26')](function(_0x4b27fd){if(_0x4b27fd){return _0x4b27fd[_0xadcc('0xce')](_0x249f15[_0xadcc('0x3b')]['ids']);}})['then'](respondWithStatusCode(_0x574d5e,null))['catch'](handleError(_0x574d5e,null));};exports[_0xadcc('0xcf')]=function(_0x2fa348,_0x55dcf5){var _0x183a94=moment()[_0xadcc('0xd0')]()[_0xadcc('0x97')]();var _0x3fc6ef=path['join'](config[_0xadcc('0xd1')],_0xadcc('0xd2'),_0xadcc('0xd3'),_0xadcc('0xd4'));var _0x5b082d=path[_0xadcc('0xd5')](config['root'],_0xadcc('0xd2'),'files',_0xadcc('0xd6'));var _0x2d26a4=path[_0xadcc('0xd5')](_0x3fc6ef,_0x183a94);var _0x46f1ae=util[_0xadcc('0xc7')](_0xadcc('0xd7'),_0x2fa348[_0xadcc('0xbb')]['id'],_0x183a94);var _0x3839fd=path[_0xadcc('0xd5')](_0x3fc6ef,_0x46f1ae);var _0x46a938=[];if(_0x2fa348[_0xadcc('0x3b')][_0xadcc('0xd6')]){_0x46a938['push']({'model':db[_0xadcc('0xd8')],'as':_0xadcc('0xd9'),'raw':!![]});}var _0x591168=[{'model':db[_0xadcc('0xc1')],'as':_0xadcc('0xda'),'attributes':['id',_0xadcc('0xbf'),_0xadcc('0x4d'),'to','cc',_0xadcc('0xdb'),_0xadcc('0xdc'),'createdAt'],'where':{'secret':![]},'order':qs[_0xadcc('0x45')]('id'),'include':_0x46a938}];return db['MailInteraction'][_0xadcc('0x60')]({'where':{'id':_0x2fa348[_0xadcc('0xbb')]['id']},'include':_0x591168})[_0xadcc('0x26')](handleEntityNotFound(_0x55dcf5,null))[_0xadcc('0x26')](function(_0x9b0cd9){if(_0x9b0cd9&&_0x9b0cd9[_0xadcc('0xda')]){var _0x37ec26=_0x9b0cd9[_0xadcc('0xdd')]({'plain':!![]});fs[_0xadcc('0xde')](_0x2d26a4);return BPromise[_0xadcc('0xdf')](_0x37ec26[_0xadcc('0xda')],function(_0x334c32,_0x4179aa){var _0x17b2e0={'from':_0x334c32['from'],'to':_0x334c32['to'],'subject':_0x334c32[_0xadcc('0xdc')],'html':_0x334c32[_0xadcc('0xbf')],'headers':{'Date':moment(_0x334c32['createdAt'])['format']('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x334c32['cc']){_0x17b2e0[_0xadcc('0xe0')]['Cc']=_0x334c32['cc'];}if(_0x334c32[_0xadcc('0xdb')]){_0x17b2e0[_0xadcc('0xe0')][_0xadcc('0xe1')]=_0x334c32['bcc'];}return new BPromise(function(_0x43961f,_0x3459bd){if(_0x334c32['Attachments']){for(var _0x1be3dc=0x0;_0x1be3dc<_0x334c32[_0xadcc('0xd9')]['length'];_0x1be3dc++){var _0x3ce003=_0x334c32[_0xadcc('0xd9')][_0x1be3dc];var _0x40cb62=path[_0xadcc('0xd5')](_0x5b082d,_0x3ce003[_0xadcc('0xe2')]);if(fs[_0xadcc('0xe3')](_0x40cb62)){_0x17b2e0[_0xadcc('0xd6')]['push']({'name':_0x3ce003[_0xadcc('0x29')],'contentType':_0x3ce003[_0xadcc('0x39')],'data':fs[_0xadcc('0xe4')](_0x40cb62)});}}}emlformat[_0xadcc('0xe5')](_0x17b2e0,function(_0x1729cb,_0x2e5d7e){if(_0x1729cb)return _0x3459bd(_0x1729cb);fs[_0xadcc('0xe6')](path[_0xadcc('0xd5')](_0x2d26a4,util['format'](_0xadcc('0xe7'),_0x4179aa)),_0x2e5d7e);return _0x43961f(_0x2e5d7e);});});})[_0xadcc('0x26')](function(){return new BPromise(function(_0x51ce76,_0x3e39b9){zipdir(_0x2d26a4,{'saveTo':_0x3839fd},function(_0x3726e4,_0x18292d){if(_0x3726e4)return _0x3e39b9(_0x3726e4);return _0x51ce76(_0x18292d);});})['then'](function(){return new BPromise(function(_0x440af0,_0x3d3a51){rimraf(_0x2d26a4,function(_0x365eba){if(_0x365eba)_0x3d3a51(_0x365eba);return _0x440af0();});});})[_0xadcc('0x26')](function(){return _0x55dcf5[_0xadcc('0xcf')](_0x3839fd,_0x46f1ae,function(_0x2b27d7){if(_0x2b27d7){console[_0xadcc('0xe8')](_0xadcc('0xe9'),_0x2b27d7);}else{fs[_0xadcc('0xea')](_0x3839fd);}});});});}else{return _0x55dcf5[_0xadcc('0x1c')](0xc8);}})['catch'](handleError(_0x55dcf5,null));}; \ No newline at end of file +var _0x300c=['mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','html-to-text','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','destroy','stack','name','send','Users','map','fullname','TagIds','split','forEach','Tags','push','findOne','lastMsgBody','then','lastMsgText','trimStart','fromString','catch','MailInteraction','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','select','field','color','from','tools_tags','u.id','ui.MailInteractionId','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','plainBody','some','compact','isEmpty','MailAccountId','where','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','SELECT','clone','order','resolve','user','getMailAccounts','i.MailAccountId\x20IS\x20NULL','i.MailAccountId\x20IN\x20?','sequelize','toString','count','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.lastMsgAt','i.subject','i.disposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','Contact.lastName','c.email','c.phone','c.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','Setting','enableEmailPreview','all','rows','show','params','includeAll','include','options','create','update','body','describe','addMessage','MailMessage','omit','getMessages','nolimit','pick','MailInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','ids','Tag','mailInteractionTags:save','download','unix','join','root','server','files','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','bcc','subject','mkdirSync','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','basename','existsSync','readFileSync','build','writeFileSync','message%d.eml','log','unlinkSync','html-pdf','zip-dir','request-promise','moment'];(function(_0x36c624,_0x4c1de0){var _0x5acd5d=function(_0x109236){while(--_0x109236){_0x36c624['push'](_0x36c624['shift']());}};_0x5acd5d(++_0x4c1de0);}(_0x300c,0x1d8));var _0xc300=function(_0x4ad51f,_0x26e6fc){_0x4ad51f=_0x4ad51f-0x0;var _0xaf7bc7=_0x300c[_0x4ad51f];return _0xaf7bc7;};'use strict';var pdf=require(_0xc300('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc300('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc300('0x2'));var moment=require(_0xc300('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc300('0x4'));var util=require(_0xc300('0x5'));var path=require('path');var sox=require(_0xc300('0x6'));var csv=require(_0xc300('0x7'));var ejs=require(_0xc300('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc300('0x9'));var crypto=require(_0xc300('0xa'));var jsforce=require(_0xc300('0xb'));var deskjs=require(_0xc300('0xc'));var toCsv=require(_0xc300('0x7'));var querystring=require(_0xc300('0xd'));var Papa=require(_0xc300('0xe'));var htmlToText=require(_0xc300('0xf'));var Redis=require('ioredis');var authService=require(_0xc300('0x10'));var qs=require(_0xc300('0x11'));var as=require(_0xc300('0x12'));var hardwareService=require(_0xc300('0x13'));var logger=require(_0xc300('0x14'))('api');var utils=require(_0xc300('0x15'));var config=require(_0xc300('0x16'));var db=require(_0xc300('0x17'))['db'];config[_0xc300('0x18')]=_[_0xc300('0x19')](config[_0xc300('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xc300('0x1a'))(new Redis(config[_0xc300('0x18')]));require('./mailInteraction.socket')[_0xc300('0x1b')](socket);function respondWithStatusCode(_0x17e666,_0x540805){_0x540805=_0x540805||0xcc;return function(_0xf559c4){if(_0xf559c4){return _0x17e666[_0xc300('0x1c')](_0x540805);}return _0x17e666[_0xc300('0x1d')](_0x540805)[_0xc300('0x1e')]();};}function respondWithResult(_0x2059be,_0x3add18){_0x3add18=_0x3add18||0xc8;return function(_0x3f7a5b){if(_0x3f7a5b){return _0x2059be[_0xc300('0x1d')](_0x3add18)[_0xc300('0x1f')](_0x3f7a5b);}};}function respondWithFilteredResult(_0x1de406,_0x4e8a05){return function(_0x41809a){if(_0x41809a){var _0x47373d=_0x41809a['count'],_0x419e44=_0x4e8a05[_0xc300('0x20')],_0x595452=_0x4e8a05['offset']+_0x4e8a05[_0xc300('0x21')],_0x2d405a;if(_0x595452>=_0x47373d){_0x595452=_0x47373d;_0x2d405a=0xc8;}else{_0x2d405a=0xce;}_0x1de406['status'](_0x2d405a);return _0x1de406[_0xc300('0x22')](_0xc300('0x23'),_0x419e44+'-'+_0x595452+'/'+_0x47373d)['json'](_0x41809a);}return null;};}function patchUpdates(_0xf841c6){return function(_0x2abf89){try{jsonpatch[_0xc300('0x24')](_0x2abf89,_0xf841c6,!![]);}catch(_0x5524aa){return BPromise[_0xc300('0x25')](_0x5524aa);}return _0x2abf89[_0xc300('0x26')]();};}function saveUpdates(_0x67df09,_0xa1ffeb){return function(_0x26c25c){if(_0x26c25c){return _0x26c25c['update'](_0x67df09)['then'](function(_0x295928){return _0x295928;});}return null;};}function removeEntity(_0x4ccc95,_0x25a42b){return function(_0x4c05c0){if(_0x4c05c0){return _0x4c05c0[_0xc300('0x27')]()['then'](function(){_0x4ccc95[_0xc300('0x1d')](0xcc)[_0xc300('0x1e')]();});}};}function handleEntityNotFound(_0x17dcea,_0x68ee66){return function(_0x345b12){if(!_0x345b12){_0x17dcea['sendStatus'](0x194);}return _0x345b12;};}function handleError(_0x37197f,_0xd11f88){_0xd11f88=_0xd11f88||0x1f4;return function(_0xcb7852){logger['error'](_0xcb7852[_0xc300('0x28')]);if(_0xcb7852[_0xc300('0x29')]){delete _0xcb7852[_0xc300('0x29')];}_0x37197f[_0xc300('0x1d')](_0xd11f88)[_0xc300('0x2a')](_0xcb7852);};}function getInteractionUsers(_0x546d68,_0x49f460){return new BPromise(function(_0x2f1044,_0x3915f7){try{if(_0x49f460[_0x546d68['id']]){_0x546d68[_0xc300('0x2b')]=_[_0xc300('0x2c')](_0x49f460[_0x546d68['id']],function(_0x4267ed){return{'id':_0x4267ed['id'],'fullname':_0x4267ed[_0xc300('0x2d')]};});}}catch(_0x2d606e){_0x3915f7(_0x2d606e);}_0x2f1044(_0x546d68);});}function getInteractionTags(_0x4cf631,_0x5947c5){return new BPromise(function(_0x3e7b63,_0x3ea9a4){try{if(_0x4cf631[_0xc300('0x2e')]){_0x4cf631['Tags']=[];_0x4cf631['TagIds'][_0xc300('0x2f')](',')[_0xc300('0x30')](function(_0x58c1d5){_0x4cf631[_0xc300('0x31')][_0xc300('0x32')](_0x5947c5[_0x58c1d5]);});}delete _0x4cf631[_0xc300('0x2e')];}catch(_0x17b5b2){_0x3ea9a4(_0x17b5b2);}_0x3e7b63(_0x4cf631);});}function getLastMessageText(_0x14c641){return new BPromise(function(_0x41d579,_0xfb6af8){return db['MailInteraction'][_0xc300('0x33')]({'where':{'id':_0x14c641['id']},'attributes':[_0xc300('0x34'),'lastMsgText'],'raw':!![]})[_0xc300('0x35')](function(_0x8613e){if(!_0x8613e['lastMsgText']){_0x14c641[_0xc300('0x36')]=_[_0xc300('0x37')](htmlToText[_0xc300('0x38')](_0x8613e[_0xc300('0x34')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x14c641[_0xc300('0x36')]=_0x8613e[_0xc300('0x36')];}_0x41d579(_0x14c641);})[_0xc300('0x39')](function(_0x4f3045){_0xfb6af8(_0x4f3045);});});}function updateMailInteraction(_0xb9a9f6,_0xbb2097,_0x1f2ec7,_0x27ce97){return new BPromise(function(_0x453573,_0x4b1061){return getInteractionUsers(_0xb9a9f6,_0x1f2ec7)[_0xc300('0x35')](function(_0xad20fe){return getInteractionTags(_0xad20fe,_0xbb2097);})['then'](function(_0x3aace5){if(_0x27ce97){_0x453573(getLastMessageText(_0x3aace5));}else{_0x453573(_0x3aace5);}})['catch'](function(_0x1fef64){_0x4b1061(_0x1fef64);});});}exports['index']=function(_0x13209a,_0xced2e){var _0x1d144d={},_0x2b6958={},_0x2d3cb5={'count':0x0,'rows':[]};var _0x3c4209=_['map'](db[_0xc300('0x3a')][_0xc300('0x3b')],function(_0x581ea5){return{'name':_0x581ea5[_0xc300('0x3c')],'type':_0x581ea5['type'][_0xc300('0x3d')]};});_0x2b6958[_0xc300('0x3e')]=_[_0xc300('0x2c')](_0x3c4209,_0xc300('0x29'));_0x2b6958[_0xc300('0x3f')]=_[_0xc300('0x40')](_0x13209a[_0xc300('0x3f')]);_0x2b6958[_0xc300('0x41')]=_[_0xc300('0x42')](_0x2b6958[_0xc300('0x3e')],_0x2b6958['query']);_0x1d144d[_0xc300('0x43')]=_['intersection'](_0x2b6958[_0xc300('0x3e')],qs[_0xc300('0x44')](_0x13209a[_0xc300('0x3f')][_0xc300('0x44')]));_0x1d144d['attributes']=_0x1d144d[_0xc300('0x43')][_0xc300('0x45')]?_0x1d144d['attributes']:_0x2b6958['model'];if(!_0x13209a[_0xc300('0x3f')][_0xc300('0x46')]('nolimit')){_0x1d144d[_0xc300('0x21')]=qs[_0xc300('0x21')](_0x13209a[_0xc300('0x3f')][_0xc300('0x21')]);_0x1d144d[_0xc300('0x20')]=qs['offset'](_0x13209a[_0xc300('0x3f')][_0xc300('0x20')]);}_0x1d144d['order']=qs[_0xc300('0x47')](_0x13209a[_0xc300('0x3f')][_0xc300('0x47')]);_0x1d144d['where']=qs[_0xc300('0x41')](_['pick'](_0x13209a[_0xc300('0x3f')],_0x2b6958[_0xc300('0x41')]));var _0x3dbe05=[];var _0x5228d6=squel[_0xc300('0x48')]()[_0xc300('0x49')]('id')[_0xc300('0x49')](_0xc300('0x29'))[_0xc300('0x49')](_0xc300('0x4a'))[_0xc300('0x4b')](_0xc300('0x4c'));var _0x7f29ff=squel[_0xc300('0x48')]()[_0xc300('0x49')](_0xc300('0x4d'))[_0xc300('0x49')]('u.fullname')[_0xc300('0x49')](_0xc300('0x4e'))[_0xc300('0x4b')](_0xc300('0x4f'),'ui')[_0xc300('0x50')](_0xc300('0x51'),'u',_0xc300('0x52'));var _0x382e97=squel['select']()[_0xc300('0x4b')](_0xc300('0x53'),'i')[_0xc300('0x50')](_0xc300('0x54'),'c',_0xc300('0x55'))[_0xc300('0x50')]('users','o',_0xc300('0x56'))[_0xc300('0x50')](_0xc300('0x57'),'a',_0xc300('0x58'))[_0xc300('0x50')](_0xc300('0x59'),'me',_0xc300('0x5a'))[_0xc300('0x50')](_0xc300('0x5b'),'it','it.MailInteractionId\x20=\x20i.id')[_0xc300('0x50')](_0xc300('0x4c'),'t',_0xc300('0x5c'));var _0x348ba1=squel[_0xc300('0x5d')]();var _0x89c06c=[];var _0x57cd44=squel[_0xc300('0x5d')]();var _0x2fcf02;if(_0x13209a['query'][_0xc300('0x5e')]){_0x2fcf02=as['parseSearch'](_0x13209a[_0xc300('0x3f')][_0xc300('0x5e')]);var _0x116b1e=_0x2fcf02[_0xc300('0x5f')];for(var _0x34da45=0x0;_0x34da45<_0x2fcf02[_0xc300('0x60')][_0xc300('0x45')];_0x34da45++){var _0x2073d1=_0x2fcf02['conditions'][_0x34da45];var _0xa6f52a='i';var _0x1c0fa3=_[_0xc300('0x61')](_0x3c4209,['name',_0x2073d1['field']]);if(!_0x1c0fa3){switch(_0x2073d1[_0xc300('0x49')]){case _0xc300('0x62'):if(_0x2073d1[_0xc300('0x63')]==0x1){_0x382e97[_0xc300('0x64')]('`'+_0x2073d1[_0xc300('0x49')]+_0xc300('0x65'));}else{_0x382e97[_0xc300('0x64')]('`'+_0x2073d1[_0xc300('0x49')]+_0xc300('0x66'));}break;case'Contact':if(_0x2073d1[_0xc300('0x67')]==='$substring'){if(_0x2073d1[_0xc300('0x63')][_0xc300('0x2f')]('\x20')[_0xc300('0x45')]>0x1){_0x348ba1[_0x116b1e](_0xc300('0x68'),qs[_0xc300('0x69')](_0x2073d1[_0xc300('0x63')]),null);}else{var _0x3d7804='%'+_0x2073d1[_0xc300('0x63')]+'%';_0x348ba1[_0x116b1e](_0xc300('0x6a'),_0x3d7804,_0x3d7804,_0x3d7804);}}else{_0x1c0fa3=_[_0xc300('0x61')](_0x3c4209,[_0xc300('0x29'),_0xc300('0x6b')]);_0x2073d1[_0xc300('0x49')]='ContactId';_0x175b6d=as[_0xc300('0x6c')](_0xa6f52a,_0x1c0fa3[_0xc300('0x6d')],_0x2073d1);_0x348ba1[_0x116b1e](_0x175b6d[_0xc300('0x6e')],_0x175b6d['value']['start'],_0x175b6d[_0xc300('0x63')][_0xc300('0x1e')]);}break;case'Tag':var _0x1b51a2=_0x2073d1[_0xc300('0x63')]['split'](',')[_0xc300('0x2c')](function(_0xd710ec){return Number(_0xd710ec);});_0x1b51a2[_0xc300('0x30')](function(_0x3ca4d3){_0x57cd44['or'](_0xc300('0x6f'),'%,'+_0x3ca4d3+',%');});_0x89c06c=_[_0xc300('0x70')](_0x89c06c,_0x1b51a2);break;case _0xc300('0x71'):if(_0x2073d1[_0xc300('0x67')]===_0xc300('0x72')){_0x348ba1[_0x116b1e](_0xc300('0x73'),'%'+_0x2073d1[_0xc300('0x63')]+'%',null);}else{_0x1c0fa3=_[_0xc300('0x61')](_0x3c4209,[_0xc300('0x29'),_0xc300('0x74')]);_0x2073d1[_0xc300('0x49')]=_0xc300('0x74');_0x175b6d=as[_0xc300('0x6c')](_0xa6f52a,_0x1c0fa3[_0xc300('0x6d')],_0x2073d1);_0x348ba1[_0x116b1e](_0x175b6d[_0xc300('0x6e')],_0x175b6d[_0xc300('0x63')][_0xc300('0x75')],_0x175b6d['value'][_0xc300('0x1e')]);}break;case _0xc300('0x76'):_0x175b6d=as[_0xc300('0x6c')]('me',null,_0x2073d1);_0x348ba1[_0x116b1e](_0x175b6d['text'],_0x175b6d[_0xc300('0x63')][_0xc300('0x75')],_0x175b6d[_0xc300('0x63')][_0xc300('0x1e')]);break;}}else{var _0x175b6d=as[_0xc300('0x6c')](_0xa6f52a,_0x1c0fa3[_0xc300('0x6d')],_0x2073d1);_0x348ba1[_0x116b1e](_0x175b6d[_0xc300('0x6e')],_0x175b6d[_0xc300('0x63')][_0xc300('0x75')],_0x175b6d[_0xc300('0x63')][_0xc300('0x1e')]);}}}else{var _0x405e8d=_(_0x13209a[_0xc300('0x3f')])[_0xc300('0x40')]()[_0xc300('0x2c')](function(_0x39c471){return _[_0xc300('0x77')](_0x3c4209,[_0xc300('0x29'),_0x39c471])?_0x39c471:undefined;})[_0xc300('0x78')]()['value']();if(!_[_0xc300('0x79')](_0x405e8d)){_0x405e8d['forEach'](function(_0x58e215){if(_0x58e215===_0xc300('0x7a')){_0x382e97[_0xc300('0x7b')]('i.MailAccountId\x20IN\x20?',[]['concat'](_0x13209a[_0xc300('0x3f')][_0x58e215]));}else if(_0x58e215===_0xc300('0x7c')){var _0x55056d=JSON[_0xc300('0x7d')](_0x13209a['query'][_0x58e215])[_0xc300('0x7e')];var _0x6098cf=JSON['parse'](_0x13209a[_0xc300('0x3f')][_0x58e215])[_0xc300('0x7f')];_0x382e97['where'](_0xc300('0x80'),_0x55056d,_0x6098cf);}else{if(_0x13209a[_0xc300('0x3f')][_0x58e215]===_0xc300('0x81')){_0x382e97[_0xc300('0x7b')]('i.'+_0x58e215+_0xc300('0x82'));}else{_0x382e97[_0xc300('0x7b')]('i.'+_0x58e215+_0xc300('0x83'),_0x13209a[_0xc300('0x3f')][_0x58e215]);}}});}if(_0x13209a[_0xc300('0x3f')]['read']){if(_0x13209a['query']['read']==0x1){_0x382e97[_0xc300('0x64')]('`unreadMessages`\x20=\x200');}else{_0x382e97['having'](_0xc300('0x84'));}}if(_0x13209a[_0xc300('0x3f')][_0xc300('0x85')]){_0x89c06c=_[_0xc300('0x86')](_0x13209a[_0xc300('0x3f')][_0xc300('0x85')])?_0x13209a[_0xc300('0x3f')][_0xc300('0x85')]:new Array(_0x13209a[_0xc300('0x3f')][_0xc300('0x85')]);_0x89c06c[_0xc300('0x30')](function(_0x4ce31a){_0x57cd44['or'](_0xc300('0x6f'),'%,'+_0x4ce31a+',%');});}if(_0x13209a[_0xc300('0x3f')]['filter']){var _0x2ab745=_0x13209a['query'][_0xc300('0x87')][_0xc300('0x88')]('\x5c','\x5c\x5c')[_0xc300('0x88')]('\x27\x27',_0xc300('0x89'));if(qs[_0xc300('0x8a')](_0x2ab745)){_0x348ba1['or'](_0xc300('0x8b'),_0x2ab745+'%');}else if(qs['isEmail'](_0x2ab745)){_0x348ba1['or'](_0xc300('0x8c'),_0x2ab745+'%');}else{_0x348ba1['or'](_0xc300('0x8d'),qs[_0xc300('0x69')](_0x2ab745))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xc300('0x69')](_0x2ab745));}}}_0x382e97['where'](_0x348ba1);_0x382e97[_0xc300('0x8e')](_0xc300('0x8f'));var _0x1cd624={'type':db[_0xc300('0x90')]['QueryTypes'][_0xc300('0x91')],'raw':!![]};var _0x18da6a=_0x382e97[_0xc300('0x92')]();_0x18da6a[_0xc300('0x49')]('i.id');_0x18da6a['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xc300('0x62'));if(_0x1d144d[_0xc300('0x93')]){_0x1d144d[_0xc300('0x93')][_0xc300('0x30')](function(_0x4b32e1){_0x382e97[_0xc300('0x93')]('i.'+_0x4b32e1[0x0],_0x4b32e1[0x1]==='DESC'?![]:!![]);});}if(!_[_0xc300('0x79')](_0x89c06c)){_0x382e97[_0xc300('0x64')](_0x57cd44);_0x18da6a[_0xc300('0x7b')]('t.id\x20IN\x20?',_0x89c06c);}BPromise[_0xc300('0x94')]()[_0xc300('0x35')](function(){if(!_0x2fcf02&&_0x13209a[_0xc300('0x3f')]['MailAccountId'])return;return _0x13209a[_0xc300('0x95')][_0xc300('0x96')]({'attributes':['id'],'raw':!![]})[_0xc300('0x35')](function(_0xe31373){if(_[_0xc300('0x79')](_0xe31373)){_0x18da6a[_0xc300('0x7b')](_0xc300('0x97'));_0x382e97['where']('i.MailAccountId\x20IS\x20NULL');}else{_0x18da6a[_0xc300('0x7b')](_0xc300('0x98'),_[_0xc300('0x2c')](_0xe31373,'id'));_0x382e97[_0xc300('0x7b')](_0xc300('0x98'),_[_0xc300('0x2c')](_0xe31373,'id'));}});})['then'](function(){db[_0xc300('0x99')]['query'](_0x18da6a[_0xc300('0x9a')](),_0x1cd624)['then'](function(_0xc3cba){_0x2d3cb5[_0xc300('0x9b')]=_0xc3cba['length'];if(_0x2d3cb5[_0xc300('0x9b')]===0x0)return[];return db[_0xc300('0x99')]['query'](_0x5228d6['toString'](),_0x1cd624)['then'](function(_0x288aa3){_0x3dbe05=_['keyBy'](_0x288aa3,'id');_0x1cd624=_[_0xc300('0x9c')](_0x1cd624,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x13209a[_0xc300('0x3f')][_0xc300('0x44')]){_0x1d144d['attributes']['forEach'](function(_0x1e2452){_0x382e97['field']('i.'+_0x1e2452);});}else{_0x382e97['field'](_0xc300('0x9d'),_0xc300('0x62'));_0x382e97['field'](_0xc300('0x9e'),_0xc300('0x9f'));_0x382e97[_0xc300('0x49')]('a.mandatoryDisposition',_0xc300('0xa0'));_0x382e97['field'](_0xc300('0x8f'));_0x382e97[_0xc300('0x49')](_0xc300('0xa1'));_0x382e97[_0xc300('0x49')](_0xc300('0xa2'));_0x382e97[_0xc300('0x49')](_0xc300('0xa3'));_0x382e97[_0xc300('0x49')](_0xc300('0xa4'));_0x382e97[_0xc300('0x49')]('i.attach');_0x382e97['field'](_0xc300('0xa5'));_0x382e97['field']('i.lastMsgDirection');_0x382e97[_0xc300('0x49')](_0xc300('0xa6'));_0x382e97['field'](_0xc300('0xa7'));_0x382e97[_0xc300('0x49')](_0xc300('0xa8'));_0x382e97['field'](_0xc300('0xa9'));_0x382e97[_0xc300('0x49')](_0xc300('0xaa'));_0x382e97['field'](_0xc300('0xab'));_0x382e97['field'](_0xc300('0xac'));_0x382e97[_0xc300('0x49')](_0xc300('0xad'),_0xc300('0xae'));_0x382e97['field']('c.lastName',_0xc300('0xaf'));_0x382e97[_0xc300('0x49')](_0xc300('0xb0'),'Contact.email');_0x382e97['field'](_0xc300('0xb1'),'Contact.phone');_0x382e97[_0xc300('0x49')]('c.mobile','Contact.mobile');_0x382e97[_0xc300('0x49')](_0xc300('0xb2'),'Contact.fax');_0x382e97['field'](_0xc300('0xb3'),_0xc300('0xb4'));_0x382e97['field'](_0xc300('0xb5'),'Owner.internal');_0x382e97[_0xc300('0x49')](_0xc300('0xb6'),_0xc300('0x2e'));}_0x382e97['limit'](_0x1d144d['limit']);_0x382e97[_0xc300('0x20')](_0x1d144d['offset']);return db[_0xc300('0x99')][_0xc300('0x3f')](_0x382e97['toString'](),_0x1cd624);})['then'](function(_0x2e1c2f){_0x7f29ff[_0xc300('0x7b')](_0xc300('0xb7'),_['map'](_0x2e1c2f,'id'));return db['sequelize'][_0xc300('0x3f')](_0x7f29ff[_0xc300('0x9a')](),_0x1cd624)['then'](function(_0x10e79e){var _0x4f345a=_[_0xc300('0xb8')](_0x10e79e,'MailInteractionId');var _0x2e8fc=[];return db[_0xc300('0xb9')][_0xc300('0x33')]({'attributes':[_0xc300('0xba')],'raw':!![]})['then'](function(_0x391bf8){var _0xb76ae=_0x391bf8[_0xc300('0xba')];_0x2e1c2f['forEach'](function(_0x4f7f0b){_0x2e8fc[_0xc300('0x32')](updateMailInteraction(_0x4f7f0b,_0x3dbe05,_0x4f345a,_0xb76ae));});return BPromise[_0xc300('0xbb')](_0x2e8fc);});});});})[_0xc300('0x35')](function(_0x4d1881){_0x2d3cb5[_0xc300('0xbc')]=_0x4d1881;return _0x2d3cb5;})[_0xc300('0x35')](respondWithFilteredResult(_0xced2e,_0x1d144d));})['catch'](handleError(_0xced2e,null));};exports[_0xc300('0xbd')]=function(_0x61339f,_0x233e98){var _0x3047bd={'raw':![],'where':{'id':_0x61339f[_0xc300('0xbe')]['id']}},_0x407928={};_0x407928['model']=_[_0xc300('0x40')](db[_0xc300('0x3a')][_0xc300('0x3b')]);_0x407928[_0xc300('0x3f')]=_[_0xc300('0x40')](_0x61339f[_0xc300('0x3f')]);_0x407928['filters']=_['intersection'](_0x407928['model'],_0x407928[_0xc300('0x3f')]);_0x3047bd['attributes']=_['intersection'](_0x407928[_0xc300('0x3e')],qs[_0xc300('0x44')](_0x61339f[_0xc300('0x3f')][_0xc300('0x44')]));_0x3047bd[_0xc300('0x43')]=_0x3047bd[_0xc300('0x43')][_0xc300('0x45')]?_0x3047bd[_0xc300('0x43')]:_0x407928[_0xc300('0x3e')];if(_0x61339f[_0xc300('0x3f')][_0xc300('0xbf')]){_0x3047bd[_0xc300('0xc0')]=[{'all':!![]}];}_0x3047bd=_[_0xc300('0x9c')]({},_0x3047bd,_0x61339f[_0xc300('0xc1')]);return db['MailInteraction'][_0xc300('0x61')](_0x3047bd)[_0xc300('0x35')](handleEntityNotFound(_0x233e98,null))[_0xc300('0x35')](respondWithResult(_0x233e98,null))['catch'](handleError(_0x233e98,null));};exports[_0xc300('0xc2')]=function(_0x1d58ad,_0x1ed90f){return db['MailInteraction'][_0xc300('0xc2')](_0x1d58ad['body'],{})[_0xc300('0x35')](respondWithResult(_0x1ed90f,0xc9))[_0xc300('0x39')](handleError(_0x1ed90f,null));};exports[_0xc300('0xc3')]=function(_0x1363b7,_0x854692){if(_0x1363b7[_0xc300('0xc4')]['id']){delete _0x1363b7[_0xc300('0xc4')]['id'];}return db['MailInteraction'][_0xc300('0x61')]({'where':{'id':_0x1363b7['params']['id']}})[_0xc300('0x35')](handleEntityNotFound(_0x854692,null))[_0xc300('0x35')](saveUpdates(_0x1363b7['body'],null))[_0xc300('0x35')](respondWithResult(_0x854692,null))[_0xc300('0x39')](handleError(_0x854692,null));};exports[_0xc300('0x27')]=function(_0xed0fcc,_0x1bbf97){return db['MailInteraction'][_0xc300('0x61')]({'where':{'id':_0xed0fcc['params']['id']}})[_0xc300('0x35')](handleEntityNotFound(_0x1bbf97,null))[_0xc300('0x35')](removeEntity(_0x1bbf97,null))[_0xc300('0x39')](handleError(_0x1bbf97,null));};exports[_0xc300('0xc5')]=function(_0x1ffa79,_0x2a1170){return db['MailInteraction'][_0xc300('0xc5')]()['then'](respondWithResult(_0x2a1170,null))[_0xc300('0x39')](handleError(_0x2a1170,null));};exports[_0xc300('0xc6')]=function(_0x4ed097,_0x4a6684,_0x160aa5){return db[_0xc300('0xc7')][_0xc300('0x61')]({'where':{'id':_0x4ed097['params']['id']}})[_0xc300('0x35')](handleEntityNotFound(_0x4a6684,null))[_0xc300('0x35')](function(_0x8d4d1c){if(_0x8d4d1c){return _0x8d4d1c['addMessage'](_0x4ed097[_0xc300('0xc4')]['ids'],_[_0xc300('0xc8')](_0x4ed097[_0xc300('0xc4')],['ids','id'])||{});}})[_0xc300('0x35')](respondWithResult(_0x4a6684,null))['catch'](handleError(_0x4a6684,null));};exports[_0xc300('0xc9')]=function(_0x28c878,_0x2f3523,_0x34045a){var _0x3f70af={'raw':![],'where':{}};var _0x1a06cd={};var _0x1a6cac={'count':0x0,'rows':[]};return db[_0xc300('0x3a')][_0xc300('0x33')]({'where':{'id':_0x28c878['params']['id']}})['then'](handleEntityNotFound(_0x2f3523,null))[_0xc300('0x35')](function(_0x26cc50){if(_0x26cc50){_0x1a06cd['model']=_[_0xc300('0x40')](db[_0xc300('0xc7')][_0xc300('0x3b')]);_0x1a06cd['query']=_['keys'](_0x28c878[_0xc300('0x3f')]);_0x1a06cd['filters']=_[_0xc300('0x42')](_0x1a06cd[_0xc300('0x3e')],_0x1a06cd[_0xc300('0x3f')]);_0x3f70af[_0xc300('0x43')]=_[_0xc300('0x42')](_0x1a06cd[_0xc300('0x3e')],qs[_0xc300('0x44')](_0x28c878[_0xc300('0x3f')]['fields']));_0x3f70af[_0xc300('0x43')]=_0x3f70af['attributes'][_0xc300('0x45')]?_0x3f70af[_0xc300('0x43')]:_0x1a06cd[_0xc300('0x3e')];if(!_0x28c878['query']['hasOwnProperty'](_0xc300('0xca'))){_0x3f70af[_0xc300('0x21')]=qs[_0xc300('0x21')](_0x28c878[_0xc300('0x3f')][_0xc300('0x21')]);_0x3f70af[_0xc300('0x20')]=qs['offset'](_0x28c878[_0xc300('0x3f')][_0xc300('0x20')]);}_0x3f70af[_0xc300('0x93')]=qs['sort'](_0x28c878[_0xc300('0x3f')][_0xc300('0x47')]);_0x3f70af[_0xc300('0x7b')]=qs[_0xc300('0x41')](_[_0xc300('0xcb')](_0x28c878[_0xc300('0x3f')],_0x1a06cd[_0xc300('0x41')]));_0x3f70af[_0xc300('0x7b')][_0xc300('0xcc')]=_0x26cc50['id'];if(_0x28c878[_0xc300('0x3f')][_0xc300('0x87')]){_0x3f70af['where']=_[_0xc300('0x9c')](_0x3f70af[_0xc300('0x7b')],{'$or':_['map'](_0x3f70af[_0xc300('0x43')],function(_0x417a49){var _0x458cc9={};_0x458cc9[_0x417a49]={'$like':'%'+_0x28c878[_0xc300('0x3f')][_0xc300('0x87')]+'%'};return _0x458cc9;})});}if(_0x28c878[_0xc300('0x3f')]['$gte']){var _0x385fd5=_0x28c878[_0xc300('0x3f')][_0xc300('0x7e')][_0xc300('0x2f')](',');var _0x5e398c={};_0x5e398c[_0x385fd5[0x0]]={'$gte':moment(_0x385fd5[0x1])[_0xc300('0xcd')](_0xc300('0xce'))};_0x3f70af['where']=_[_0xc300('0x9c')](_0x3f70af[_0xc300('0x7b')],_0x5e398c);}_0x3f70af=_[_0xc300('0x9c')]({},_0x3f70af,_0x28c878[_0xc300('0xc1')]);return db[_0xc300('0xc7')][_0xc300('0x9b')]({'where':_0x3f70af[_0xc300('0x7b')]})['then'](function(_0x36278a){_0x1a6cac[_0xc300('0x9b')]=_0x36278a;if(_0x28c878['query'][_0xc300('0xbf')]){_0x3f70af[_0xc300('0xc0')]=[{'all':!![]}];}return db['MailMessage'][_0xc300('0xcf')](_0x3f70af);})[_0xc300('0x35')](function(_0x377fc8){_0x1a6cac['rows']=_0x377fc8;return _0x1a6cac;});}})[_0xc300('0x35')](respondWithFilteredResult(_0x2f3523,_0x3f70af))[_0xc300('0x39')](handleError(_0x2f3523,null));};exports[_0xc300('0xd0')]=function(_0x22d692,_0x27d1a0,_0x42dba2){return db[_0xc300('0x3a')]['find']({'where':{'id':_0x22d692[_0xc300('0xbe')]['id']}})[_0xc300('0x35')](handleEntityNotFound(_0x27d1a0,null))[_0xc300('0x35')](function(_0x536904){if(_0x536904){return _0x536904[_0xc300('0xd1')](_0x22d692[_0xc300('0xc4')]['ids'],_['omit'](_0x22d692[_0xc300('0xc4')],[_0xc300('0xd2'),'id'])||{})['spread'](function(){return db[_0xc300('0xd3')][_0xc300('0xcf')]({'attributes':['id','name','color'],'where':{'id':_0x22d692['body']['ids']}});})['then'](function(_0x5471d3){socket['emit'](_0xc300('0xd4'),{'id':Number(_0x22d692[_0xc300('0xbe')]['id']),'tags':_0x5471d3||[]});return{'id':Number(_0x22d692['params']['id']),'tags':_0x5471d3||[]};});}})[_0xc300('0x35')](respondWithResult(_0x27d1a0,null))[_0xc300('0x39')](handleError(_0x27d1a0,null));};exports['removeTags']=function(_0x162674,_0x5a1545,_0xf6f179){return db[_0xc300('0x3a')]['find']({'where':{'id':_0x162674[_0xc300('0xbe')]['id']}})[_0xc300('0x35')](handleEntityNotFound(_0x5a1545,null))['then'](function(_0x50b20d){if(_0x50b20d){return _0x50b20d['removeTags'](_0x162674[_0xc300('0x3f')][_0xc300('0xd2')]);}})[_0xc300('0x35')](respondWithStatusCode(_0x5a1545,null))['catch'](handleError(_0x5a1545,null));};exports[_0xc300('0xd5')]=function(_0x175909,_0x2e93e7){var _0x82f027=moment()[_0xc300('0xd6')]()[_0xc300('0x9a')]();var _0x131f5c=path[_0xc300('0xd7')](config[_0xc300('0xd8')],_0xc300('0xd9'),_0xc300('0xda'),'tmp');var _0x1906a1=path[_0xc300('0xd7')](config['root'],_0xc300('0xd9'),'files',_0xc300('0xdb'));var _0x1d9baf=path[_0xc300('0xd7')](_0x131f5c,_0x82f027);var _0x2a8bd1=util['format'](_0xc300('0xdc'),_0x175909[_0xc300('0xbe')]['id'],_0x82f027);var _0x1b5404=path[_0xc300('0xd7')](_0x131f5c,_0x2a8bd1);var _0x1b1159=[];if(_0x175909['query'][_0xc300('0xdb')]){_0x1b1159[_0xc300('0x32')]({'model':db[_0xc300('0xdd')],'as':_0xc300('0xde'),'raw':!![]});}var _0x3b7d27=[{'model':db['MailMessage'],'as':_0xc300('0xdf'),'attributes':['id','body',_0xc300('0x4b'),'to','cc',_0xc300('0xe0'),_0xc300('0xe1'),_0xc300('0x7c')],'where':{'secret':![]},'order':qs[_0xc300('0x47')]('id'),'include':_0x1b1159}];return db[_0xc300('0x3a')][_0xc300('0x61')]({'where':{'id':_0x175909[_0xc300('0xbe')]['id']},'include':_0x3b7d27})[_0xc300('0x35')](handleEntityNotFound(_0x2e93e7,null))[_0xc300('0x35')](function(_0x4ce581){if(_0x4ce581&&_0x4ce581[_0xc300('0xdf')]){var _0x6f23ac=_0x4ce581['get']({'plain':!![]});fs[_0xc300('0xe2')](_0x1d9baf);return BPromise[_0xc300('0xe3')](_0x6f23ac[_0xc300('0xdf')],function(_0x2efc47,_0x338c93){var _0x355e1a={'from':_0x2efc47[_0xc300('0x4b')],'to':_0x2efc47['to'],'subject':_0x2efc47[_0xc300('0xe1')],'html':_0x2efc47[_0xc300('0xc4')],'headers':{'Date':moment(_0x2efc47[_0xc300('0x7c')])[_0xc300('0xcd')](_0xc300('0xe4'))},'attachments':[]};if(_0x2efc47['cc']){_0x355e1a[_0xc300('0xe5')]['Cc']=_0x2efc47['cc'];}if(_0x2efc47[_0xc300('0xe0')]){_0x355e1a[_0xc300('0xe5')]['Bcc']=_0x2efc47[_0xc300('0xe0')];}return new BPromise(function(_0x56c4c2,_0x4dbb50){if(_0x2efc47['Attachments']){for(var _0x4feb56=0x0;_0x4feb56<_0x2efc47[_0xc300('0xde')][_0xc300('0x45')];_0x4feb56++){var _0x556c29=_0x2efc47[_0xc300('0xde')][_0x4feb56];var _0x21cc29=path[_0xc300('0xd7')](_0x1906a1,_0x556c29[_0xc300('0xe6')]);if(fs[_0xc300('0xe7')](_0x21cc29)){_0x355e1a[_0xc300('0xdb')][_0xc300('0x32')]({'name':_0x556c29[_0xc300('0x29')],'contentType':_0x556c29[_0xc300('0x6d')],'data':fs[_0xc300('0xe8')](_0x21cc29)});}}}emlformat[_0xc300('0xe9')](_0x355e1a,function(_0x13f893,_0x50538e){if(_0x13f893)return _0x4dbb50(_0x13f893);fs[_0xc300('0xea')](path[_0xc300('0xd7')](_0x1d9baf,util['format'](_0xc300('0xeb'),_0x338c93)),_0x50538e);return _0x56c4c2(_0x50538e);});});})[_0xc300('0x35')](function(){return new BPromise(function(_0x3f2cd9,_0x11c12a){zipdir(_0x1d9baf,{'saveTo':_0x1b5404},function(_0x2af281,_0x3e65f1){if(_0x2af281)return _0x11c12a(_0x2af281);return _0x3f2cd9(_0x3e65f1);});})[_0xc300('0x35')](function(){return new BPromise(function(_0x2bc1cd,_0x4904dc){rimraf(_0x1d9baf,function(_0x587a7a){if(_0x587a7a)_0x4904dc(_0x587a7a);return _0x2bc1cd();});});})['then'](function(){return _0x2e93e7['download'](_0x1b5404,_0x2a8bd1,function(_0x26b248){if(_0x26b248){console[_0xc300('0xec')]('err',_0x26b248);}else{fs[_0xc300('0xed')](_0x1b5404);}});});});}else{return _0x2e93e7[_0xc300('0x1c')](0xc8);}})[_0xc300('0x39')](handleError(_0x2e93e7,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index b03a5b0..f6e6e09 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 _0x5286=['findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','MailInteraction','MailMessage','save','remove','getUsers','then','setDataValue','Users','map'];(function(_0x52a857,_0xc99fa1){var _0x4e2aae=function(_0x5410d9){while(--_0x5410d9){_0x52a857['push'](_0x52a857['shift']());}};_0x4e2aae(++_0xc99fa1);}(_0x5286,0x112));var _0x6528=function(_0x58ae51,_0x470d39){_0x58ae51=_0x58ae51-0x0;var _0xfaede0=_0x5286[_0x58ae51];return _0xfaede0;};'use strict';var EventEmitter=require(_0x6528('0x0'));var MailInteraction=require(_0x6528('0x1'))['db'][_0x6528('0x2')];var MailMessage=require(_0x6528('0x1'))['db'][_0x6528('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6528('0x4'),'afterUpdate':'update','afterDestroy':_0x6528('0x5')};function emitEvent(_0x50b83c){return function(_0x57c62e,_0x4f8d35,_0x4f6276){_0x57c62e[_0x6528('0x6')]({'attributes':['id'],'raw':!![]})[_0x6528('0x7')](function(_0x22645c){_0x57c62e[_0x6528('0x8')](_0x6528('0x9'),_0x22645c[_0x6528('0xa')](function(_0x5ae8f3){return{'id':_0x5ae8f3['id']};}));return MailMessage[_0x6528('0xb')]({'where':{'MailInteractionId':_0x57c62e['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x155d1b){_0x57c62e[_0x6528('0x8')](_0x6528('0xc'),_0x155d1b[_0x6528('0xd')]);MailInteractionEvents[_0x6528('0xe')](_0x50b83c+':'+_0x57c62e['id'],_0x57c62e);MailInteractionEvents[_0x6528('0xe')](_0x50b83c,_0x57c62e);_0x4f6276(null);})[_0x6528('0xf')](_0x4f6276(null));};}for(var e in events){if(events[_0x6528('0x10')](e)){var event=events[e];MailInteraction[_0x6528('0x11')](e,emitEvent(event));}}module[_0x6528('0x12')]=MailInteractionEvents; \ No newline at end of file +var _0xf26e=['emit','catch','hasOwnProperty','hook','events','MailMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xf26e,0x158));var _0xef26=function(_0x5d2670,_0x26093e){_0x5d2670=_0x5d2670-0x0;var _0x1e8316=_0xf26e[_0x5d2670];return _0x1e8316;};'use strict';var EventEmitter=require(_0xef26('0x0'));var MailInteraction=require('../../mysqldb')['db']['MailInteraction'];var MailMessage=require('../../mysqldb')['db'][_0xef26('0x1')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xef26('0x2')](0x0);var events={'afterCreate':_0xef26('0x3'),'afterUpdate':_0xef26('0x4'),'afterDestroy':_0xef26('0x5')};function emitEvent(_0x5c45d8){return function(_0x49bb67,_0x566760,_0x486945){_0x49bb67[_0xef26('0x6')]({'attributes':['id'],'raw':!![]})[_0xef26('0x7')](function(_0x1e7292){_0x49bb67[_0xef26('0x8')](_0xef26('0x9'),_0x1e7292[_0xef26('0xa')](function(_0xb3806){return{'id':_0xb3806['id']};}));return MailMessage[_0xef26('0xb')]({'where':{'MailInteractionId':_0x49bb67['id'],'direction':'in','read':![]},'raw':!![]});})[_0xef26('0x7')](function(_0x46ecff){_0x49bb67[_0xef26('0x8')](_0xef26('0xc'),_0x46ecff['length']);MailInteractionEvents[_0xef26('0xd')](_0x5c45d8+':'+_0x49bb67['id'],_0x49bb67);MailInteractionEvents[_0xef26('0xd')](_0x5c45d8,_0x49bb67);_0x486945(null);})[_0xef26('0xe')](_0x486945(null));};}for(var e in events){if(events[_0xef26('0xf')](e)){var event=events[e];MailInteraction[_0xef26('0x10')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 313e8ea..c1eb7dc 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 _0x5271=['../../config/logger','api','bluebird','request-promise','path','rimraf','./mailInteraction.attributes','MailInteraction','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closedAt','format','changed','closed','MailMessage','update','catch','utf8mb4_unicode_ci','lodash'];(function(_0x4f192e,_0x4d1756){var _0x49294d=function(_0x580ab3){while(--_0x580ab3){_0x4f192e['push'](_0x4f192e['shift']());}};_0x49294d(++_0x4d1756);}(_0x5271,0xa0));var _0x1527=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x5271[_0x4fbfd9];return _0x31dc94;};'use strict';var _=require(_0x1527('0x0'));var util=require('util');var logger=require(_0x1527('0x1'))(_0x1527('0x2'));var moment=require('moment');var BPromise=require(_0x1527('0x3'));var rp=require(_0x1527('0x4'));var fs=require('fs');var path=require(_0x1527('0x5'));var rimraf=require(_0x1527('0x6'));var config=require('../../config/environment');var attributes=require(_0x1527('0x7'));module['exports']=function(_0x329108,_0x55871f){return _0x329108['define'](_0x1527('0x8'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0x1527('0x9'),'fields':[_0x1527('0xa'),'to'],'type':_0x1527('0xb')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x27c7eb,_0x68f9ce,_0x1f5c71){if(_0x27c7eb[_0x1527('0xc')]){_0x27c7eb[_0x1527('0xd')]=moment()['format'](_0x1527('0xe'));}if(_0x27c7eb['closed']){_0x27c7eb[_0x1527('0xf')]=moment()[_0x1527('0x10')](_0x1527('0xe'));}_0x1f5c71(null,_0x68f9ce);},'beforeUpdate':function(_0x26602e,_0x39d5b7,_0xee06fd){if(_0x26602e['changed'](_0x1527('0xc'))){_0x26602e[_0x1527('0xd')]=_0x26602e[_0x1527('0xc')]?moment()[_0x1527('0x10')](_0x1527('0xe')):null;}if(_0x26602e[_0x1527('0x11')](_0x1527('0x12'))){_0x26602e[_0x1527('0xf')]=moment()[_0x1527('0x10')](_0x1527('0xe'));_0x26602e[_0x1527('0xc')]=null;_0x26602e[_0x1527('0xd')]=null;}_0xee06fd(null,_0x26602e);},'afterUpdate':function(_0x13331b,_0x5c9913,_0x43f813){var _0x1c8786=_0x329108['models'];var _0x229508=_0x13331b['get']({'plain':!![]});if(_0x229508['closed']){return _0x1c8786[_0x1527('0x13')][_0x1527('0x14')]({'read':!![]},{'where':{'MailInteractionId':_0x229508['id']}})['then'](function(){_0x43f813();})[_0x1527('0x15')](function(_0x5d08b4){_0x43f813(_0x5d08b4);});}else{_0x43f813();}}},'charset':'utf8mb4','collate':_0x1527('0x16')});}; \ No newline at end of file +var _0x9c2c=['bluebird','path','rimraf','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','substatusAt','models','get','MailMessage','then','catch','utf8mb4_unicode_ci','lodash','util'];(function(_0x3bceea,_0x58af75){var _0x30a8d3=function(_0x1550b5){while(--_0x1550b5){_0x3bceea['push'](_0x3bceea['shift']());}};_0x30a8d3(++_0x58af75);}(_0x9c2c,0x1c0));var _0xc9c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c2c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc9c2('0x0'));var util=require(_0xc9c2('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xc9c2('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc9c2('0x3'));var rimraf=require(_0xc9c2('0x4'));var config=require('../../config/environment');var attributes=require('./mailInteraction.attributes');module[_0xc9c2('0x5')]=function(_0x5140a8,_0x30f3d6){return _0x5140a8[_0xc9c2('0x6')](_0xc9c2('0x7'),attributes,{'tableName':_0xc9c2('0x8'),'paranoid':![],'indexes':[{'name':_0xc9c2('0x9'),'fields':[_0xc9c2('0xa'),'to'],'type':_0xc9c2('0xb')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3cfcbf,_0x8614c4,_0x53e18d){if(_0x3cfcbf[_0xc9c2('0xc')]){_0x3cfcbf['substatusAt']=moment()[_0xc9c2('0xd')](_0xc9c2('0xe'));}if(_0x3cfcbf[_0xc9c2('0xf')]){_0x3cfcbf[_0xc9c2('0x10')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x53e18d(null,_0x8614c4);},'beforeUpdate':function(_0x10c97d,_0x25aee6,_0x568f69){if(_0x10c97d[_0xc9c2('0x11')](_0xc9c2('0xc'))){_0x10c97d[_0xc9c2('0x12')]=_0x10c97d[_0xc9c2('0xc')]?moment()[_0xc9c2('0xd')](_0xc9c2('0xe')):null;}if(_0x10c97d[_0xc9c2('0x11')](_0xc9c2('0xf'))){_0x10c97d[_0xc9c2('0x10')]=moment()[_0xc9c2('0xd')](_0xc9c2('0xe'));_0x10c97d[_0xc9c2('0xc')]=null;_0x10c97d['substatusAt']=null;}_0x568f69(null,_0x10c97d);},'afterUpdate':function(_0x27840d,_0xc554be,_0x728017){var _0x240099=_0x5140a8[_0xc9c2('0x13')];var _0x49413b=_0x27840d[_0xc9c2('0x14')]({'plain':!![]});if(_0x49413b[_0xc9c2('0xf')]){return _0x240099[_0xc9c2('0x15')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x49413b['id']}})[_0xc9c2('0x16')](function(){_0x728017();})[_0xc9c2('0x17')](function(_0x55dbb1){_0x728017(_0x55dbb1);});}else{_0x728017();}}},'charset':'utf8mb4','collate':_0xc9c2('0x18')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 8cbb057..33ded68 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 _0x515d=['MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','UpdateMailInteraction','MailInteraction','update','options','raw','where','limit','AddTagsToMailInteraction','find','ids','omit','body','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','localhost','./mailInteraction.socket','register','request','then','MailInteraction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x25d542,_0x462ad9){var _0x377a7e=function(_0x5bd8ee){while(--_0x5bd8ee){_0x25d542['push'](_0x25d542['shift']());}};_0x377a7e(++_0x462ad9);}(_0x515d,0x104));var _0xd515=function(_0x1703c1,_0x4ae857){_0x1703c1=_0x1703c1-0x0;var _0x42a796=_0x515d[_0x1703c1];return _0x42a796;};'use strict';var _=require('lodash');var util=require(_0xd515('0x0'));var moment=require(_0xd515('0x1'));var BPromise=require(_0xd515('0x2'));var rs=require(_0xd515('0x3'));var fs=require('fs');var Redis=require(_0xd515('0x4'));var db=require(_0xd515('0x5'))['db'];var utils=require(_0xd515('0x6'));var logger=require(_0xd515('0x7'))('rpc');var config=require(_0xd515('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd515('0x9')]({'port':0x232a});config[_0xd515('0xa')]=_[_0xd515('0xb')](config[_0xd515('0xa')],{'host':_0xd515('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd515('0xa')]));require(_0xd515('0xd'))[_0xd515('0xe')](socket);function respondWithRpcPromise(_0x423156,_0x21d6ce,_0x1a33c1){return new BPromise(function(_0x5c66c0,_0x2ac287){return client[_0xd515('0xf')](_0x423156,_0x1a33c1)[_0xd515('0x10')](function(_0x2adc6c){logger['info'](_0xd515('0x11'),_0x21d6ce,_0xd515('0x12'));logger[_0xd515('0x13')](_0xd515('0x14'),_0x21d6ce,_0xd515('0x12'),JSON[_0xd515('0x15')](_0x2adc6c));if(_0x2adc6c[_0xd515('0x16')]){if(_0x2adc6c[_0xd515('0x16')][_0xd515('0x17')]===0x1f4){logger[_0xd515('0x16')](_0xd515('0x11'),_0x21d6ce,_0x2adc6c[_0xd515('0x16')][_0xd515('0x18')]);return _0x2ac287(_0x2adc6c['error'][_0xd515('0x18')]);}logger[_0xd515('0x16')](_0xd515('0x11'),_0x21d6ce,_0x2adc6c[_0xd515('0x16')][_0xd515('0x18')]);return _0x5c66c0(_0x2adc6c[_0xd515('0x16')][_0xd515('0x18')]);}else{logger[_0xd515('0x19')](_0xd515('0x11'),_0x21d6ce,_0xd515('0x12'));_0x5c66c0(_0x2adc6c['result'][_0xd515('0x18')]);}})[_0xd515('0x1a')](function(_0x33c772){logger[_0xd515('0x16')](_0xd515('0x11'),_0x21d6ce,_0x33c772);_0x2ac287(_0x33c772);});});}exports[_0xd515('0x1b')]=function(_0x7cd5fb){var _0x2cf2d8=this;return new Promise(function(_0x4d191,_0x5c7fef){return db[_0xd515('0x1c')][_0xd515('0x1d')](_0x7cd5fb['body'],{'raw':_0x7cd5fb[_0xd515('0x1e')]?_0x7cd5fb[_0xd515('0x1e')][_0xd515('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x7cd5fb['options']?_0x7cd5fb[_0xd515('0x1e')][_0xd515('0x20')]||null:null,'attributes':_0x7cd5fb[_0xd515('0x1e')]?_0x7cd5fb[_0xd515('0x1e')]['attributes']||null:null,'limit':_0x7cd5fb[_0xd515('0x1e')]?_0x7cd5fb[_0xd515('0x1e')][_0xd515('0x21')]||null:null})[_0xd515('0x10')](function(_0x1a5f58){logger[_0xd515('0x19')](_0xd515('0x1b'),_0x7cd5fb);logger[_0xd515('0x13')](_0xd515('0x1b'),_0x7cd5fb,JSON['stringify'](_0x1a5f58));_0x4d191(_0x1a5f58);})['catch'](function(_0x2e4455){logger[_0xd515('0x16')](_0xd515('0x1b'),_0x2e4455[_0xd515('0x18')],_0x7cd5fb);_0x5c7fef(_0x2cf2d8[_0xd515('0x16')](0x1f4,_0x2e4455[_0xd515('0x18')]));});});};exports[_0xd515('0x22')]=function(_0x33fc3b){return new Promise(function(_0x53ec33,_0x38766a){return db[_0xd515('0x1c')][_0xd515('0x23')]({'where':_0x33fc3b[_0xd515('0x1e')]?_0x33fc3b[_0xd515('0x1e')][_0xd515('0x20')]||null:null})[_0xd515('0x10')](function(_0x5841c4){if(_0x5841c4){return _0x5841c4['addTags'](_0x33fc3b['body'][_0xd515('0x24')],_[_0xd515('0x25')](_0x33fc3b[_0xd515('0x26')],['ids','id'])||{});}})['spread'](function(_0x483846){logger[_0xd515('0x19')](_0xd515('0x27'),_0x33fc3b);logger[_0xd515('0x13')](_0xd515('0x27'),_0x33fc3b,JSON[_0xd515('0x15')](_0x483846));_0x53ec33(_0x483846);})['catch'](function(_0x2248eb){logger['error'](_0xd515('0x27'),_0x2248eb[_0xd515('0x18')],_0x33fc3b);_0x38766a(_this[_0xd515('0x16')](0x1f4,_0x2248eb[_0xd515('0x18')]));});});}; \ No newline at end of file +var _0x4198=['code','message','info','result','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','limit','then','catch','AddTagsToMailInteraction','find','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','request','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x4dbba7,_0x34d6d1){var _0x43ef83=function(_0x27acf1){while(--_0x27acf1){_0x4dbba7['push'](_0x4dbba7['shift']());}};_0x43ef83(++_0x34d6d1);}(_0x4198,0x69));var _0x8419=function(_0x201a13,_0x15a16f){_0x201a13=_0x201a13-0x0;var _0x46064e=_0x4198[_0x201a13];return _0x46064e;};'use strict';var _=require(_0x8419('0x0'));var util=require('util');var moment=require(_0x8419('0x1'));var BPromise=require(_0x8419('0x2'));var rs=require(_0x8419('0x3'));var fs=require('fs');var Redis=require(_0x8419('0x4'));var db=require(_0x8419('0x5'))['db'];var utils=require(_0x8419('0x6'));var logger=require(_0x8419('0x7'))(_0x8419('0x8'));var config=require(_0x8419('0x9'));var jayson=require(_0x8419('0xa'));var client=jayson['client'][_0x8419('0xb')]({'port':0x232a});config[_0x8419('0xc')]=_[_0x8419('0xd')](config[_0x8419('0xc')],{'host':_0x8419('0xe'),'port':0x18eb});var socket=require(_0x8419('0xf'))(new Redis(config[_0x8419('0xc')]));require(_0x8419('0x10'))[_0x8419('0x11')](socket);function respondWithRpcPromise(_0x1b3dfe,_0x8bd9e9,_0x398099){return new BPromise(function(_0x704360,_0x9e314e){return client[_0x8419('0x12')](_0x1b3dfe,_0x398099)['then'](function(_0xbbc491){logger['info'](_0x8419('0x13'),_0x8bd9e9,_0x8419('0x14'));logger[_0x8419('0x15')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x8bd9e9,'request\x20sent',JSON[_0x8419('0x16')](_0xbbc491));if(_0xbbc491[_0x8419('0x17')]){if(_0xbbc491['error'][_0x8419('0x18')]===0x1f4){logger[_0x8419('0x17')](_0x8419('0x13'),_0x8bd9e9,_0xbbc491[_0x8419('0x17')][_0x8419('0x19')]);return _0x9e314e(_0xbbc491['error'][_0x8419('0x19')]);}logger[_0x8419('0x17')]('MailInteraction,\x20%s,\x20%s',_0x8bd9e9,_0xbbc491[_0x8419('0x17')][_0x8419('0x19')]);return _0x704360(_0xbbc491[_0x8419('0x17')][_0x8419('0x19')]);}else{logger[_0x8419('0x1a')](_0x8419('0x13'),_0x8bd9e9,_0x8419('0x14'));_0x704360(_0xbbc491[_0x8419('0x1b')][_0x8419('0x19')]);}})['catch'](function(_0x4ccca7){logger[_0x8419('0x17')](_0x8419('0x13'),_0x8bd9e9,_0x4ccca7);_0x9e314e(_0x4ccca7);});});}exports[_0x8419('0x1c')]=function(_0x34c6c0){var _0x359d0b=this;return new Promise(function(_0x42b3b6,_0x43efb7){return db[_0x8419('0x1d')][_0x8419('0x1e')](_0x34c6c0[_0x8419('0x1f')],{'raw':_0x34c6c0[_0x8419('0x20')]?_0x34c6c0['options'][_0x8419('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34c6c0[_0x8419('0x20')]?_0x34c6c0[_0x8419('0x20')][_0x8419('0x22')]||null:null,'attributes':_0x34c6c0['options']?_0x34c6c0[_0x8419('0x20')]['attributes']||null:null,'limit':_0x34c6c0['options']?_0x34c6c0[_0x8419('0x20')][_0x8419('0x23')]||null:null})[_0x8419('0x24')](function(_0x26457f){logger[_0x8419('0x1a')]('UpdateMailInteraction',_0x34c6c0);logger[_0x8419('0x15')](_0x8419('0x1c'),_0x34c6c0,JSON[_0x8419('0x16')](_0x26457f));_0x42b3b6(_0x26457f);})[_0x8419('0x25')](function(_0x2b8157){logger[_0x8419('0x17')](_0x8419('0x1c'),_0x2b8157[_0x8419('0x19')],_0x34c6c0);_0x43efb7(_0x359d0b[_0x8419('0x17')](0x1f4,_0x2b8157[_0x8419('0x19')]));});});};exports[_0x8419('0x26')]=function(_0x1fcbef){return new Promise(function(_0xcd7208,_0x4a5487){return db['MailInteraction'][_0x8419('0x27')]({'where':_0x1fcbef[_0x8419('0x20')]?_0x1fcbef[_0x8419('0x20')][_0x8419('0x22')]||null:null})[_0x8419('0x24')](function(_0x4e5b41){if(_0x4e5b41){return _0x4e5b41['addTags'](_0x1fcbef[_0x8419('0x1f')]['ids'],_[_0x8419('0x28')](_0x1fcbef['body'],['ids','id'])||{});}})[_0x8419('0x29')](function(_0x257f13){logger['info'](_0x8419('0x2a'),_0x1fcbef);logger['debug']('AddTags',_0x1fcbef,JSON[_0x8419('0x16')](_0x257f13));_0xcd7208(_0x257f13);})[_0x8419('0x25')](function(_0x155433){logger['error'](_0x8419('0x2a'),_0x155433[_0x8419('0x19')],_0x1fcbef);_0x4a5487(_this[_0x8419('0x17')](0x1f4,_0x155433[_0x8419('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 0cce483..ec1c307 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 _0x7391=['length','mailInteraction:','remove','emit','removeListener','register'];(function(_0x49905e,_0x1c9791){var _0x57d5dd=function(_0x84e957){while(--_0x84e957){_0x49905e['push'](_0x49905e['shift']());}};_0x57d5dd(++_0x1c9791);}(_0x7391,0xb6));var _0x1739=function(_0xc5e02a,_0xd9da3c){_0xc5e02a=_0xc5e02a-0x0;var _0xbeca77=_0x7391[_0xc5e02a];return _0xbeca77;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=['save',_0x1739('0x0'),'update'];function createListener(_0x584edc,_0x4a9f56){return function(_0x561025){_0x4a9f56[_0x1739('0x1')](_0x584edc,_0x561025);};}function removeListener(_0x1d11e5,_0x1dc59e){return function(){MailInteractionEvents[_0x1739('0x2')](_0x1d11e5,_0x1dc59e);};}exports[_0x1739('0x3')]=function(_0x54e213){for(var _0x26ac75=0x0,_0x271ea4=events[_0x1739('0x4')];_0x26ac75<_0x271ea4;_0x26ac75++){var _0x42916c=events[_0x26ac75];var _0x3a0041=createListener(_0x1739('0x5')+_0x42916c,_0x54e213);MailInteractionEvents['on'](_0x42916c,_0x3a0041);}}; \ No newline at end of file +var _0xd79d=['length','mailInteraction:','remove','update','emit','removeListener'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0xd79d,0x19a));var _0xdd79=function(_0x247a5e,_0x40b75d){_0x247a5e=_0x247a5e-0x0;var _0x16e004=_0xd79d[_0x247a5e];return _0x16e004;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=['save',_0xdd79('0x0'),_0xdd79('0x1')];function createListener(_0x3252d3,_0xd8a6d5){return function(_0x31e452){_0xd8a6d5[_0xdd79('0x2')](_0x3252d3,_0x31e452);};}function removeListener(_0x2a4faf,_0x5cd0ef){return function(){MailInteractionEvents[_0xdd79('0x3')](_0x2a4faf,_0x5cd0ef);};}exports['register']=function(_0x39da3f){for(var _0x53b8d8=0x0,_0x38c299=events[_0xdd79('0x4')];_0x53b8d8<_0x38c299;_0x53b8d8++){var _0x59dcfd=events[_0x53b8d8];var _0x25e5e8=createListener(_0xdd79('0x5')+_0x59dcfd,_0x39da3f);MailInteractionEvents['on'](_0x59dcfd,_0x25e5e8);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 86a53ef..f8917c3 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 _0xd6d6=['mailmessage:create','update','put','/:id/accept','accept','reject','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','/describe','describe','/:id','/:id/download','download','post','mail'];(function(_0x5e2f51,_0x4b3b45){var _0x2d414d=function(_0x220526){while(--_0x220526){_0x5e2f51['push'](_0x5e2f51['shift']());}};_0x2d414d(++_0x4b3b45);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x58d3f0,_0x3560c2){_0x58d3f0=_0x58d3f0-0x0;var _0xc93ad4=_0xd6d6[_0x58d3f0];return _0xc93ad4;};'use strict';var multer=require(_0x6d6d('0x0'));var util=require(_0x6d6d('0x1'));var path=require(_0x6d6d('0x2'));var timeout=require(_0x6d6d('0x3'));var express=require('express');var router=express[_0x6d6d('0x4')]();var auth=require(_0x6d6d('0x5'));var interaction=require(_0x6d6d('0x6'));var config=require(_0x6d6d('0x7'));var controller=require(_0x6d6d('0x8'));router[_0x6d6d('0x9')]('/',auth[_0x6d6d('0xa')](),controller['index']);router[_0x6d6d('0x9')](_0x6d6d('0xb'),auth[_0x6d6d('0xa')](),controller[_0x6d6d('0xc')]);router[_0x6d6d('0x9')](_0x6d6d('0xd'),auth[_0x6d6d('0xa')](),controller['show']);router['get'](_0x6d6d('0xe'),auth[_0x6d6d('0xa')](),controller[_0x6d6d('0xf')]);router[_0x6d6d('0x10')]('/',auth[_0x6d6d('0xa')](),interaction['tracked'](_0x6d6d('0x11'),_0x6d6d('0x12')),controller['create']);router['put'](_0x6d6d('0xd'),auth[_0x6d6d('0xa')](),controller[_0x6d6d('0x13')]);router[_0x6d6d('0x14')](_0x6d6d('0x15'),auth[_0x6d6d('0xa')](),controller[_0x6d6d('0x16')]);router[_0x6d6d('0x14')]('/:id/reject',auth[_0x6d6d('0xa')](),controller[_0x6d6d('0x17')]);router[_0x6d6d('0x18')](_0x6d6d('0xd'),auth[_0x6d6d('0xa')](),controller['destroy']);module[_0x6d6d('0x19')]=router; \ No newline at end of file +var _0x3e74=['path','connect-timeout','express','../../components/interaction/service','./mailMessage.controller','get','isAuthenticated','index','describe','/:id','download','post','tracked','mailmessage:create','create','update','put','accept','/:id/reject','delete','destroy','multer'];(function(_0x507f69,_0x5c812c){var _0x4eebcd=function(_0x1497c3){while(--_0x1497c3){_0x507f69['push'](_0x507f69['shift']());}};_0x4eebcd(++_0x5c812c);}(_0x3e74,0x175));var _0x43e7=function(_0x1f88e0,_0x51e344){_0x1f88e0=_0x1f88e0-0x0;var _0x146b91=_0x3e74[_0x1f88e0];return _0x146b91;};'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 auth=require('../../components/auth/service');var interaction=require(_0x43e7('0x4'));var config=require('../../config/environment');var controller=require(_0x43e7('0x5'));router[_0x43e7('0x6')]('/',auth[_0x43e7('0x7')](),controller[_0x43e7('0x8')]);router[_0x43e7('0x6')]('/describe',auth[_0x43e7('0x7')](),controller[_0x43e7('0x9')]);router[_0x43e7('0x6')](_0x43e7('0xa'),auth[_0x43e7('0x7')](),controller['show']);router[_0x43e7('0x6')]('/:id/download',auth['isAuthenticated'](),controller[_0x43e7('0xb')]);router[_0x43e7('0xc')]('/',auth['isAuthenticated'](),interaction[_0x43e7('0xd')]('mail',_0x43e7('0xe')),controller[_0x43e7('0xf')]);router['put'](_0x43e7('0xa'),auth[_0x43e7('0x7')](),controller[_0x43e7('0x10')]);router[_0x43e7('0x11')]('/:id/accept',auth['isAuthenticated'](),controller[_0x43e7('0x12')]);router[_0x43e7('0x11')](_0x43e7('0x13'),auth['isAuthenticated'](),controller['reject']);router[_0x43e7('0x14')](_0x43e7('0xa'),auth[_0x43e7('0x7')](),controller[_0x43e7('0x15')]);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 fc4a706..e7464a8 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 _0xa908=['DATE','sequelize','exports','long','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0xc0df0,_0x322239){var _0x5acda9=function(_0x84ead3){while(--_0x84ead3){_0xc0df0['push'](_0xc0df0['shift']());}};_0x5acda9(++_0x322239);}(_0xa908,0x1c3));var _0x8a90=function(_0x455ed5,_0xab57cc){_0x455ed5=_0x455ed5-0x0;var _0x481ac4=_0xa908[_0x455ed5];return _0x481ac4;};'use strict';var Sequelize=require(_0x8a90('0x0'));var _=require('lodash');module[_0x8a90('0x1')]={'body':{'type':Sequelize['TEXT'](_0x8a90('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x8a90('0x3')](_0x8a90('0x4'))},'read':{'type':Sequelize[_0x8a90('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8a90('0x6')]('in','out'),'defaultValue':_0x8a90('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0x8a90('0x8')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x8a90('0x3')](_0x8a90('0x2'))},'cc':{'type':Sequelize[_0x8a90('0x3')](_0x8a90('0x2'))},'bcc':{'type':Sequelize[_0x8a90('0x3')](_0x8a90('0x2'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0x8a90('0x9')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0x8a90('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0x8a90('0x3')](_0x8a90('0x2'))},'originCc':{'type':Sequelize[_0x8a90('0x3')](_0x8a90('0x2'))}}; \ No newline at end of file +var _0x866a=['lodash','exports','TEXT','long','BOOLEAN','ENUM','out','STRING','DATE'];(function(_0x412262,_0x421fdc){var _0x3378f3=function(_0x488a3f){while(--_0x488a3f){_0x412262['push'](_0x412262['shift']());}};_0x3378f3(++_0x421fdc);}(_0x866a,0x156));var _0xa866=function(_0x10d618,_0x1f1c82){_0x10d618=_0x10d618-0x0;var _0x57d044=_0x866a[_0x10d618];return _0x57d044;};'use strict';var Sequelize=require('sequelize');var _=require(_0xa866('0x0'));module[_0xa866('0x1')]={'body':{'type':Sequelize[_0xa866('0x2')](_0xa866('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xa866('0x2')]('medium')},'read':{'type':Sequelize[_0xa866('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xa866('0x5')]('in',_0xa866('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xa866('0x7')](0x1fe)},'from':{'type':Sequelize[_0xa866('0x7')]},'to':{'type':Sequelize[_0xa866('0x2')](_0xa866('0x3'))},'cc':{'type':Sequelize[_0xa866('0x2')](_0xa866('0x3'))},'bcc':{'type':Sequelize[_0xa866('0x2')](_0xa866('0x3'))},'subject':{'type':Sequelize[_0xa866('0x2')]},'sentAt':{'type':Sequelize[_0xa866('0x8')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0xa866('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xa866('0x8')]},'originTo':{'type':Sequelize[_0xa866('0x2')]('long')},'originCc':{'type':Sequelize[_0xa866('0x2')](_0xa866('0x3'))}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 318de2e..0793117 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 _0x9235=['merge','count','findAll','show','params','keys','include','options','find','body','describe','create','direction','out','secret','split','MailAccount','findOne','CmList','List','Contacts','updatedAt','DESC','MailServerOut','Smtp','isNil','service','host','port','secure','authentication','user','auth','pass','attachments','join','basename','defaults','ListId','List\x20not\x20found','SendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','mail-interactions','accept','mail','read','readAt','UserId','CmContact','Contact','MailInteraction','MailInteractionId','read1stAt','interaction','info','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','agent','get','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','rejectmessage','download','unix','toString','files','tmp','root','message-%s.eml','from','bcc','subject','createdAt','Attachment','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','Attachments','push','build','err','unlinkSync','html-pdf','eml-format','rimraf','fast-json-patch','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','socket.io-emitter','./mailMessage.socket','jayson/promise','http','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','json','offset','limit','Content-Range','apply','reject','save','update','destroy','stack','name','index','map','MailMessage','rawAttributes','fieldName','type','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter'];(function(_0x3d335d,_0xcae4c4){var _0x1af003=function(_0x42eec7){while(--_0x42eec7){_0x3d335d['push'](_0x3d335d['shift']());}};_0x1af003(++_0xcae4c4);}(_0x9235,0x101));var _0x5923=function(_0x5f2e2d,_0x2af206){_0x5f2e2d=_0x5f2e2d-0x0;var _0x3497af=_0x9235[_0x5f2e2d];return _0x3497af;};'use strict';var pdf=require(_0x5923('0x0'));var emlformat=require(_0x5923('0x1'));var rimraf=require(_0x5923('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5923('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5923('0x4'));var util=require(_0x5923('0x5'));var path=require('path');var sox=require(_0x5923('0x6'));var csv=require(_0x5923('0x7'));var ejs=require(_0x5923('0x8'));var fs=require('fs');var _=require(_0x5923('0x9'));var squel=require(_0x5923('0xa'));var crypto=require(_0x5923('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5923('0x7'));var querystring=require(_0x5923('0xc'));var Papa=require(_0x5923('0xd'));var Redis=require('ioredis');var authService=require(_0x5923('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5923('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0x5923('0x10'));var config=require(_0x5923('0x11'));var db=require(_0x5923('0x12'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5923('0x13'))(new Redis(config['redis']));require(_0x5923('0x14'))['register'](socket);var jayson=require(_0x5923('0x15'));var client=jayson['client'][_0x5923('0x16')]({'port':0x232c});var client9003=jayson[_0x5923('0x17')][_0x5923('0x16')]({'port':0x232b});var client9002=jayson[_0x5923('0x17')]['http']({'port':0x232a});function checkPasswordPattern(_0x3ac5ee,_0xb0a15b,_0x9dc723){if(_0x9dc723){var _0x2672ab=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2672ab[_0x5923('0x18')](_0xb0a15b)){return _0x3ac5ee;}else{throw new db[(_0x5923('0x19'))][(_0x5923('0x1a'))](_0x5923('0x1b'));}}else{return _0x3ac5ee;}}function respondWithRpcPromise(_0x462ae5,_0x5b2269,_0x289189,_0x124f32){return new BPromise(function(_0x439e11,_0x47e6dc){var _0x1884e7=_0x124f32||client;return _0x1884e7[_0x5923('0x1c')](_0x462ae5,_0x289189)[_0x5923('0x1d')](function(_0x4c7b03){logger['info'](_0x5923('0x1e'),_0x5b2269,'request\x20sent');logger[_0x5923('0x1f')](_0x5923('0x20'),_0x5b2269,_0x5923('0x21'),JSON['stringify'](_0x4c7b03));if(_0x4c7b03[_0x5923('0x22')]){if(_0x4c7b03[_0x5923('0x22')][_0x5923('0x23')]===0x1f4){logger[_0x5923('0x22')](_0x5923('0x1e'),_0x5b2269,_0x4c7b03['error'][_0x5923('0x24')]);return _0x47e6dc(_0x4c7b03[_0x5923('0x22')][_0x5923('0x24')]);}logger['error'](_0x5923('0x1e'),_0x5b2269,_0x4c7b03[_0x5923('0x22')]['message']);return _0x439e11(_0x4c7b03['error']['message']);}else{logger['info'](_0x5923('0x1e'),_0x5b2269,_0x5923('0x21'));_0x439e11(_0x4c7b03[_0x5923('0x25')][_0x5923('0x24')]);}})[_0x5923('0x26')](function(_0x54e0c0){logger[_0x5923('0x22')]('MailMessage,\x20%s,\x20%s',_0x5b2269,_0x54e0c0);_0x47e6dc(_0x54e0c0);});});}function respondWithStatusCode(_0x5ae2d4,_0x2fc5d7){_0x2fc5d7=_0x2fc5d7||0xcc;return function(_0x1f4866){if(_0x1f4866){return _0x5ae2d4[_0x5923('0x27')](_0x2fc5d7);}return _0x5ae2d4[_0x5923('0x28')](_0x2fc5d7)['end']();};}function respondWithResult(_0x399bb0,_0x36b9a2){_0x36b9a2=_0x36b9a2||0xc8;return function(_0x338b1c){if(_0x338b1c){return _0x399bb0['status'](_0x36b9a2)[_0x5923('0x29')](_0x338b1c);}};}function respondWithFilteredResult(_0x207b72,_0xd87cf9){return function(_0x7c2139){if(_0x7c2139){var _0x45ac64=_0x7c2139['count'],_0x4b848c=_0xd87cf9[_0x5923('0x2a')],_0x15144c=_0xd87cf9[_0x5923('0x2a')]+_0xd87cf9[_0x5923('0x2b')],_0x47facb;if(_0x15144c>=_0x45ac64){_0x15144c=_0x45ac64;_0x47facb=0xc8;}else{_0x47facb=0xce;}_0x207b72[_0x5923('0x28')](_0x47facb);return _0x207b72['set'](_0x5923('0x2c'),_0x4b848c+'-'+_0x15144c+'/'+_0x45ac64)[_0x5923('0x29')](_0x7c2139);}return null;};}function patchUpdates(_0x2114dc){return function(_0x2027ee){try{jsonpatch[_0x5923('0x2d')](_0x2027ee,_0x2114dc,!![]);}catch(_0x8f9220){return BPromise[_0x5923('0x2e')](_0x8f9220);}return _0x2027ee[_0x5923('0x2f')]();};}function saveUpdates(_0x5998b3,_0x2fd230){return function(_0x5a857d){if(_0x5a857d){return _0x5a857d[_0x5923('0x30')](_0x5998b3)['then'](function(_0x417cc5){return _0x417cc5;});}return null;};}function removeEntity(_0x570528,_0x4f01cd){return function(_0x189c36){if(_0x189c36){return _0x189c36[_0x5923('0x31')]()['then'](function(){_0x570528['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x166a07,_0x9408e8){return function(_0x3bd576){if(!_0x3bd576){_0x166a07[_0x5923('0x27')](0x194);}return _0x3bd576;};}function handleError(_0x181934,_0x3d1ff2){_0x3d1ff2=_0x3d1ff2||0x1f4;return function(_0x15fb42){logger[_0x5923('0x22')](_0x15fb42[_0x5923('0x32')]);if(_0x15fb42[_0x5923('0x33')]){delete _0x15fb42[_0x5923('0x33')];}_0x181934[_0x5923('0x28')](_0x3d1ff2)['send'](_0x15fb42);};}exports[_0x5923('0x34')]=function(_0x2ad10d,_0x245dcf){var _0x217280={},_0xce23c7={},_0x5b1684={'count':0x0,'rows':[]};var _0x3560d6=_[_0x5923('0x35')](db[_0x5923('0x36')][_0x5923('0x37')],function(_0x4f019f){return{'name':_0x4f019f[_0x5923('0x38')],'type':_0x4f019f[_0x5923('0x39')]['key']};});_0xce23c7['model']=_[_0x5923('0x35')](_0x3560d6,'name');_0xce23c7['query']=_['keys'](_0x2ad10d[_0x5923('0x3a')]);_0xce23c7[_0x5923('0x3b')]=_['intersection'](_0xce23c7[_0x5923('0x3c')],_0xce23c7[_0x5923('0x3a')]);_0x217280[_0x5923('0x3d')]=_[_0x5923('0x3e')](_0xce23c7[_0x5923('0x3c')],qs[_0x5923('0x3f')](_0x2ad10d['query'][_0x5923('0x3f')]));_0x217280[_0x5923('0x3d')]=_0x217280[_0x5923('0x3d')][_0x5923('0x40')]?_0x217280[_0x5923('0x3d')]:_0xce23c7[_0x5923('0x3c')];if(!_0x2ad10d[_0x5923('0x3a')][_0x5923('0x41')](_0x5923('0x42'))){_0x217280['limit']=qs[_0x5923('0x2b')](_0x2ad10d['query']['limit']);_0x217280[_0x5923('0x2a')]=qs['offset'](_0x2ad10d[_0x5923('0x3a')]['offset']);}_0x217280['order']=qs[_0x5923('0x43')](_0x2ad10d[_0x5923('0x3a')]['sort']);_0x217280[_0x5923('0x44')]=qs[_0x5923('0x3b')](_[_0x5923('0x45')](_0x2ad10d[_0x5923('0x3a')],_0xce23c7[_0x5923('0x3b')]));if(_0x2ad10d[_0x5923('0x3a')][_0x5923('0x46')]){_0x217280[_0x5923('0x44')]=_[_0x5923('0x47')](_0x217280[_0x5923('0x44')],{'$or':_[_0x5923('0x35')](_0x3560d6,function(_0x1bf321){if(_0x1bf321['type']!=='VIRTUAL'){var _0x388bee={};_0x388bee[_0x1bf321[_0x5923('0x33')]]={'$like':'%'+_0x2ad10d[_0x5923('0x3a')][_0x5923('0x46')]+'%'};return _0x388bee;}})});}_0x217280=_[_0x5923('0x47')]({},_0x217280,_0x2ad10d['options']);var _0x381a47={'where':_0x217280[_0x5923('0x44')]};return db[_0x5923('0x36')]['count'](_0x381a47)[_0x5923('0x1d')](function(_0x31c9b7){_0x5b1684[_0x5923('0x48')]=_0x31c9b7;if(_0x2ad10d['query']['includeAll']){_0x217280['include']=[{'all':!![]}];}return db[_0x5923('0x36')][_0x5923('0x49')](_0x217280);})[_0x5923('0x1d')](function(_0x25c525){_0x5b1684['rows']=_0x25c525;return _0x5b1684;})[_0x5923('0x1d')](respondWithFilteredResult(_0x245dcf,_0x217280))[_0x5923('0x26')](handleError(_0x245dcf,null));};exports[_0x5923('0x4a')]=function(_0x34fdb7,_0x472635){var _0x14b880={'raw':!![],'where':{'id':_0x34fdb7[_0x5923('0x4b')]['id']}},_0x2c265a={};_0x2c265a['model']=_[_0x5923('0x4c')](db[_0x5923('0x36')][_0x5923('0x37')]);_0x2c265a[_0x5923('0x3a')]=_[_0x5923('0x4c')](_0x34fdb7[_0x5923('0x3a')]);_0x2c265a[_0x5923('0x3b')]=_[_0x5923('0x3e')](_0x2c265a[_0x5923('0x3c')],_0x2c265a[_0x5923('0x3a')]);_0x14b880[_0x5923('0x3d')]=_[_0x5923('0x3e')](_0x2c265a['model'],qs[_0x5923('0x3f')](_0x34fdb7[_0x5923('0x3a')][_0x5923('0x3f')]));_0x14b880[_0x5923('0x3d')]=_0x14b880['attributes'][_0x5923('0x40')]?_0x14b880['attributes']:_0x2c265a[_0x5923('0x3c')];if(_0x34fdb7[_0x5923('0x3a')]['includeAll']){_0x14b880[_0x5923('0x4d')]=[{'all':!![]}];}_0x14b880=_['merge']({},_0x14b880,_0x34fdb7[_0x5923('0x4e')]);return db[_0x5923('0x36')][_0x5923('0x4f')](_0x14b880)[_0x5923('0x1d')](handleEntityNotFound(_0x472635,null))[_0x5923('0x1d')](respondWithResult(_0x472635,null))[_0x5923('0x26')](handleError(_0x472635,null));};exports[_0x5923('0x30')]=function(_0x58a424,_0x547bd9){if(_0x58a424[_0x5923('0x50')]['id']){delete _0x58a424[_0x5923('0x50')]['id'];}return db[_0x5923('0x36')][_0x5923('0x4f')]({'where':{'id':_0x58a424[_0x5923('0x4b')]['id']}})[_0x5923('0x1d')](handleEntityNotFound(_0x547bd9,null))[_0x5923('0x1d')](saveUpdates(_0x58a424['body'],null))[_0x5923('0x1d')](respondWithResult(_0x547bd9,null))[_0x5923('0x26')](handleError(_0x547bd9,null));};exports[_0x5923('0x31')]=function(_0x193ae5,_0x5c9de0){return db[_0x5923('0x36')][_0x5923('0x4f')]({'where':{'id':_0x193ae5['params']['id']}})[_0x5923('0x1d')](handleEntityNotFound(_0x5c9de0,null))[_0x5923('0x1d')](removeEntity(_0x5c9de0,null))[_0x5923('0x26')](handleError(_0x5c9de0,null));};exports[_0x5923('0x51')]=function(_0x57ada6,_0x51917f){return db[_0x5923('0x36')][_0x5923('0x51')]()[_0x5923('0x1d')](respondWithResult(_0x51917f,null))[_0x5923('0x26')](handleError(_0x51917f,null));};exports[_0x5923('0x52')]=function(_0x1639d0,_0x3dc5fd){return db[_0x5923('0x36')][_0x5923('0x52')](_0x1639d0[_0x5923('0x50')])[_0x5923('0x1d')](function(_0xcfe79){if(_0xcfe79){if(_0xcfe79[_0x5923('0x53')]===_0x5923('0x54')&&!_0xcfe79[_0x5923('0x55')]){var _0x524298,_0x225cc3,_0x574d6e;if(_0x1639d0[_0x5923('0x50')]['to']){_0x225cc3=_0x1639d0[_0x5923('0x50')]['to'][_0x5923('0x56')](',')[0x0];}return db[_0x5923('0x57')][_0x5923('0x58')]({'where':{'id':_0xcfe79['MailAccountId']},'include':[{'model':db[_0x5923('0x59')],'as':_0x5923('0x5a'),'include':[{'model':db['CmContact'],'as':_0x5923('0x5b'),'where':{'email':_0x225cc3},'limit':0x1,'order':[[_0x5923('0x5c'),_0x5923('0x5d')]]}]},{'model':db[_0x5923('0x5e')],'as':'Smtp','raw':!![]}]})[_0x5923('0x1d')](function(_0x3e4bc9){_0x524298=_0x3e4bc9;if(_0x524298&&_0x524298[_0x5923('0x5f')]){var _0x544caf={'tls':{'rejectUnauthorized':![]}};if(_[_0x5923('0x60')](_0x524298[_0x5923('0x5f')][_0x5923('0x61')])){_0x544caf[_0x5923('0x62')]=_0x524298[_0x5923('0x5f')]['host'];_0x544caf[_0x5923('0x63')]=_0x524298['Smtp'][_0x5923('0x63')];_0x544caf[_0x5923('0x64')]=_0x524298[_0x5923('0x5f')][_0x5923('0x64')];if(_0x524298[_0x5923('0x5f')][_0x5923('0x65')]){_0x544caf['auth']={'user':_0x524298['Smtp'][_0x5923('0x66')],'pass':_0x524298['Smtp']['pass']};}}else{_0x544caf[_0x5923('0x61')]=_0x524298['Smtp'][_0x5923('0x61')];_0x544caf[_0x5923('0x67')]={'user':_0x524298[_0x5923('0x5f')][_0x5923('0x66')],'pass':_0x524298[_0x5923('0x5f')][_0x5923('0x68')]};_0x544caf[_0x5923('0x64')]=_0x524298['Smtp']['secure'];}if(_0x1639d0['body'][_0x5923('0x69')]&&_0x1639d0[_0x5923('0x50')][_0x5923('0x69')][_0x5923('0x40')]){for(var _0x715ae6=0x0;_0x715ae6<_0x1639d0[_0x5923('0x50')][_0x5923('0x69')][_0x5923('0x40')];_0x715ae6+=0x1){_0x1639d0[_0x5923('0x50')][_0x5923('0x69')][_0x715ae6]={'filename':_0x1639d0[_0x5923('0x50')]['attachments'][_0x715ae6][_0x5923('0x33')],'path':path[_0x5923('0x6a')](config['root'],'server/files/attachments',_0x1639d0[_0x5923('0x50')][_0x5923('0x69')][_0x715ae6][_0x5923('0x6b')])};}}_0x574d6e={'account':_0x544caf,'message':_0x1639d0['body']};return;}})[_0x5923('0x1d')](function(){if(_0x524298[_0x5923('0x5a')]){if(_0x524298[_0x5923('0x5a')][_0x5923('0x5b')][_0x5923('0x40')]){return _0x524298[_0x5923('0x5a')][_0x5923('0x5b')][0x0];}else{return db['CmContact'][_0x5923('0x52')](_[_0x5923('0x6c')](_0x1639d0[_0x5923('0x50')],{'firstName':_0x1639d0[_0x5923('0x50')]['to'],'email':_0x1639d0[_0x5923('0x50')]['to'],'phone':_0x1639d0[_0x5923('0x50')]['to'],'ListId':_0x524298[_0x5923('0x6d')]}));}}else{throw new Error(_0x5923('0x6e'));}})[_0x5923('0x1d')](function(){if(_0x574d6e){return respondWithRpcPromise(_0x5923('0x6f'),'sendMail',_0x574d6e,client9003)[_0x5923('0x1d')](function(_0x218969){return _0xcfe79[_0x5923('0x30')]({'read':!![],'messageId':_0x218969[_0x5923('0x70')],'sentAt':moment()[_0x5923('0x71')](_0x5923('0x72'))});})[_0x5923('0x26')](function(_0x3b3f86){logger[_0x5923('0x22')]('%s',JSON['stringify'](_0x3b3f86));return _0xcfe79;});}return _0xcfe79;});}return _0xcfe79;}})[_0x5923('0x1d')](respondWithResult(_0x3dc5fd,0xc9))['catch'](handleError(_0x3dc5fd,null));};var interaction_log=require('../../config/logger')(_0x5923('0x73'));exports[_0x5923('0x74')]=function(_0x110a65,_0xbc3e09,_0x4f1cfb){var _0x52b1be={'channel':_0x5923('0x75')};if(_0x110a65[_0x5923('0x50')]['id']){delete _0x110a65[_0x5923('0x50')]['id'];}_0x110a65[_0x5923('0x50')][_0x5923('0x76')]=!![];_0x110a65[_0x5923('0x50')][_0x5923('0x77')]=moment()['format'](_0x5923('0x72'));_0x110a65[_0x5923('0x50')][_0x5923('0x78')]=_0x110a65[_0x5923('0x50')][_0x5923('0x78')]||_0x110a65[_0x5923('0x66')]['id'];return db[_0x5923('0x36')][_0x5923('0x4f')]({'where':{'id':_0x110a65[_0x5923('0x4b')]['id'],'UserId':null},'include':[{'model':db[_0x5923('0x79')],'as':_0x5923('0x7a')}]})[_0x5923('0x1d')](handleEntityNotFound(_0xbc3e09,null))[_0x5923('0x1d')](saveUpdates(_0x110a65[_0x5923('0x50')],null))['then'](function(_0x2fc51f){if(_0x2fc51f){_0x52b1be[_0x5923('0x24')]=_0x2fc51f['get']({'plain':!![]});return db[_0x5923('0x7b')][_0x5923('0x4f')]({'where':{'id':_0x2fc51f[_0x5923('0x7c')]}});}return null;})[_0x5923('0x1d')](handleEntityNotFound(_0xbc3e09,null))[_0x5923('0x1d')](function(_0x1d93e0){if(_0x1d93e0){return _0x1d93e0[_0x5923('0x30')]({'UserId':_0x110a65[_0x5923('0x50')][_0x5923('0x78')],'read1stAt':_[_0x5923('0x60')](_0x1d93e0[_0x5923('0x7d')])?moment()[_0x5923('0x71')](_0x5923('0x72')):undefined});}return null;})[_0x5923('0x1d')](function(_0x6ad80d){if(_0x6ad80d){_0x52b1be[_0x5923('0x7e')]=_0x6ad80d['get']({'plain':!![]});interaction_log[_0x5923('0x7f')](_0x5923('0x80'),_0x110a65[_0x5923('0x66')]['id'],_0x110a65[_0x5923('0x66')][_0x5923('0x33')],_0x110a65[_0x5923('0x66')][_0x5923('0x81')],_0x52b1be[_0x5923('0x7e')]['id'],_0x110a65[_0x5923('0x50')]?JSON[_0x5923('0x82')](_0x110a65[_0x5923('0x50')]):_0x5923('0x83'));return respondWithRpcPromise(_0x5923('0x84'),'acceptMessage',_0x52b1be);}return null;})[_0x5923('0x1d')](function(_0x40d280){if(_0x40d280){if(_0x110a65[_0x5923('0x50')][_0x5923('0x85')]){_0x52b1be[_0x5923('0x24')][_0x5923('0x86')]=util[_0x5923('0x71')](_0x5923('0x87'),_0x110a65[_0x5923('0x66')][_0x5923('0x33')]);_0x52b1be[_0x5923('0x24')][_0x5923('0x88')]=_0x52b1be['channel'];_0x52b1be[_0x5923('0x24')][_0x5923('0x89')]=_0x5923('0x74');return respondWithRpcPromise('EventManager',_0x5923('0x8a'),{'event':_0x5923('0x8b'),'message':_0x52b1be['message']},client9002)[_0x5923('0x1d')](function(){return _0x52b1be;});}return _0x52b1be;}return null;})[_0x5923('0x1d')](respondWithResult(_0xbc3e09,null))[_0x5923('0x26')](handleError(_0xbc3e09,null));};var interaction_log=require('../../config/logger')(_0x5923('0x73'));exports[_0x5923('0x2e')]=function(_0x2a70a3,_0x317b2c,_0x450dfc){var _0x40cfd7={'agent':{},'channel':'mail'};if(_0x2a70a3[_0x5923('0x50')]['id']){delete _0x2a70a3[_0x5923('0x50')]['id'];}_0x2a70a3[_0x5923('0x50')][_0x5923('0x78')]=_0x2a70a3['body']['UserId']||_0x2a70a3[_0x5923('0x66')]['id'];_0x40cfd7[_0x5923('0x8c')]['id']=_0x2a70a3['body'][_0x5923('0x78')];return db[_0x5923('0x36')][_0x5923('0x4f')]({'where':{'id':_0x2a70a3[_0x5923('0x4b')]['id'],'UserId':null}})[_0x5923('0x1d')](handleEntityNotFound(_0x317b2c,null))['then'](function(_0x56fb47){if(_0x56fb47){_0x40cfd7[_0x5923('0x24')]=_0x56fb47['get']({'plain':!![]});return db[_0x5923('0x7b')][_0x5923('0x4f')]({'where':{'id':_0x56fb47['MailInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x317b2c,null))[_0x5923('0x1d')](function(_0x587323){if(_0x587323){_0x40cfd7[_0x5923('0x7e')]=_0x587323[_0x5923('0x8d')]({'plain':!![]});interaction_log[_0x5923('0x7f')](_0x5923('0x8e'),_0x2a70a3['user']['id'],_0x2a70a3[_0x5923('0x66')][_0x5923('0x33')],_0x2a70a3['user']['role'],_0x40cfd7[_0x5923('0x7e')]['id'],_0x2a70a3[_0x5923('0x50')]?JSON[_0x5923('0x82')](_0x2a70a3['body']):'null');return respondWithRpcPromise(_0x5923('0x8f'),_0x5923('0x90'),_0x40cfd7);}return null;})[_0x5923('0x1d')](function(_0x374599){if(_0x374599){_0x374599[_0x5923('0x24')][_0x5923('0x86')]=util['format']('SIP/%s',_0x2a70a3[_0x5923('0x66')][_0x5923('0x33')]);_0x374599[_0x5923('0x24')][_0x5923('0x88')]=_0x40cfd7[_0x5923('0x88')];_0x374599[_0x5923('0x24')][_0x5923('0x89')]=_0x5923('0x2e');respondWithRpcPromise('EventManager','EventManager',{'event':_0x5923('0x91'),'message':_0x374599[_0x5923('0x24')]},client9002);return _0x40cfd7;}return null;})[_0x5923('0x1d')](respondWithResult(_0x317b2c,null))[_0x5923('0x26')](handleError(_0x317b2c,null));};exports[_0x5923('0x92')]=function(_0x20486a,_0x5b33d4){var _0x420a99=moment()[_0x5923('0x93')]()[_0x5923('0x94')]();var _0x53fb50=path['join'](config['root'],'server',_0x5923('0x95'),_0x5923('0x96'));var _0x49714d=path[_0x5923('0x6a')](config[_0x5923('0x97')],'server',_0x5923('0x95'),_0x5923('0x69'));var _0x301632=util['format'](_0x5923('0x98'),_0x420a99);return db[_0x5923('0x36')][_0x5923('0x4f')]({'where':{'id':_0x20486a['params']['id']},'attributes':['id',_0x5923('0x50'),_0x5923('0x99'),'to','cc',_0x5923('0x9a'),_0x5923('0x9b'),_0x5923('0x9c')],'include':_0x20486a[_0x5923('0x3a')][_0x5923('0x69')]?[{'model':db[_0x5923('0x9d')],'as':'Attachments'}]:undefined})[_0x5923('0x1d')](handleEntityNotFound(_0x5b33d4,null))['then'](function(_0x32f922){if(_0x32f922){var _0x23d515=_0x32f922;var _0x16539e={'from':_0x23d515[_0x5923('0x99')],'to':_0x23d515['to'],'subject':_0x23d515['subject'],'html':_0x23d515['body'],'headers':{'Date':moment(_0x23d515['createdAt'])[_0x5923('0x71')](_0x5923('0x9e'))},'attachments':[]};if(_0x32f922['cc']){_0x16539e['headers']['Cc']=_0x32f922['cc'];}if(_0x32f922[_0x5923('0x9a')]){_0x16539e['headers']['Bcc']=_0x32f922[_0x5923('0x9a')];}return new BPromise(function(_0x4aa731,_0xa98fe9){if(_0x32f922['Attachments']){for(var _0x252e1f=0x0;_0x252e1f<_0x32f922[_0x5923('0x9f')][_0x5923('0x40')];_0x252e1f++){var _0x46b7ec=_0x32f922[_0x5923('0x9f')][_0x252e1f];var _0x469142=path[_0x5923('0x6a')](_0x49714d,_0x46b7ec[_0x5923('0x6b')]);if(fs['existsSync'](_0x469142)){_0x16539e[_0x5923('0x69')][_0x5923('0xa0')]({'name':_0x46b7ec[_0x5923('0x33')],'contentType':_0x46b7ec[_0x5923('0x39')],'data':fs['readFileSync'](_0x469142)});}}}emlformat[_0x5923('0xa1')](_0x16539e,function(_0x3c067e,_0x5579c9){if(_0x3c067e)return _0xa98fe9(_0x3c067e);fs['writeFileSync'](path[_0x5923('0x6a')](_0x53fb50,_0x301632),_0x5579c9);return _0x4aa731(_0x5579c9);});});}})[_0x5923('0x1d')](function(_0x5cdc66){if(_0x5cdc66){return _0x5b33d4['download'](path[_0x5923('0x6a')](_0x53fb50,_0x301632),_0x301632,function(_0x37a0ac){if(_0x37a0ac){console['log'](_0x5923('0xa2'),_0x37a0ac);}else{fs[_0x5923('0xa3')](path[_0x5923('0x6a')](_0x53fb50,_0x301632));}});}})[_0x5923('0x26')](handleError(_0x5b33d4,null));}; \ No newline at end of file +var _0xb9e7=['Attachment','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','build','writeFileSync','log','err','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','./mailMessage.socket','register','jayson/promise','client','http','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~!@#$%^&-_=+[{]}.','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','json','count','offset','limit','set','apply','save','update','destroy','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','fields','attributes','length','model','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','MailMessage','findAll','rows','show','params','find','body','describe','out','split','findOne','MailAccountId','CmList','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','isNil','host','port','secure','authentication','auth','user','pass','join','root','attachments','basename','List','create','defaults','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','stringify','mail-interactions','read','readAt','UserId','Contact','get','MailInteractionId','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','accept','EventManager','acceptmessage','mail','agent','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','reject','rejectmessage','download','toString','tmp','server','files','message-%s.eml','from','bcc','subject','createdAt'];(function(_0x3fb32c,_0xae6aca){var _0x3545ff=function(_0x22a412){while(--_0x22a412){_0x3fb32c['push'](_0x3fb32c['shift']());}};_0x3545ff(++_0xae6aca);}(_0xb9e7,0x15c));var _0x7b9e=function(_0x5466ab,_0x227b13){_0x5466ab=_0x5466ab-0x0;var _0x40751a=_0xb9e7[_0x5466ab];return _0x40751a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7b9e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7b9e('0x1'));var jsonpatch=require(_0x7b9e('0x2'));var rp=require(_0x7b9e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7b9e('0x4'));var util=require(_0x7b9e('0x5'));var path=require('path');var sox=require(_0x7b9e('0x6'));var csv=require(_0x7b9e('0x7'));var ejs=require(_0x7b9e('0x8'));var fs=require('fs');var _=require(_0x7b9e('0x9'));var squel=require(_0x7b9e('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7b9e('0xb'));var toCsv=require(_0x7b9e('0x7'));var querystring=require(_0x7b9e('0xc'));var Papa=require(_0x7b9e('0xd'));var Redis=require(_0x7b9e('0xe'));var authService=require(_0x7b9e('0xf'));var qs=require(_0x7b9e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7b9e('0x11'));var logger=require(_0x7b9e('0x12'))('api');var utils=require(_0x7b9e('0x13'));var config=require('../../config/environment');var db=require(_0x7b9e('0x14'))['db'];config[_0x7b9e('0x15')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7b9e('0x15')]));require(_0x7b9e('0x16'))[_0x7b9e('0x17')](socket);var jayson=require(_0x7b9e('0x18'));var client=jayson[_0x7b9e('0x19')][_0x7b9e('0x1a')]({'port':0x232c});var client9003=jayson[_0x7b9e('0x19')][_0x7b9e('0x1a')]({'port':0x232b});var client9002=jayson[_0x7b9e('0x19')][_0x7b9e('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x10e8c2,_0x472ee0,_0x4605f0){if(_0x4605f0){var _0x1e8194=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1e8194[_0x7b9e('0x1b')](_0x472ee0)){return _0x10e8c2;}else{throw new db[(_0x7b9e('0x1c'))]['ValidationError'](_0x7b9e('0x1d'));}}else{return _0x10e8c2;}}function respondWithRpcPromise(_0x3ef331,_0x1dc779,_0x2775dc,_0x309a48){return new BPromise(function(_0x37bdbc,_0x5e5179){var _0x107d42=_0x309a48||client;return _0x107d42['request'](_0x3ef331,_0x2775dc)[_0x7b9e('0x1e')](function(_0x256dce){logger[_0x7b9e('0x1f')](_0x7b9e('0x20'),_0x1dc779,_0x7b9e('0x21'));logger[_0x7b9e('0x22')](_0x7b9e('0x23'),_0x1dc779,_0x7b9e('0x21'),JSON['stringify'](_0x256dce));if(_0x256dce[_0x7b9e('0x24')]){if(_0x256dce[_0x7b9e('0x24')][_0x7b9e('0x25')]===0x1f4){logger[_0x7b9e('0x24')]('MailMessage,\x20%s,\x20%s',_0x1dc779,_0x256dce[_0x7b9e('0x24')][_0x7b9e('0x26')]);return _0x5e5179(_0x256dce['error']['message']);}logger[_0x7b9e('0x24')]('MailMessage,\x20%s,\x20%s',_0x1dc779,_0x256dce[_0x7b9e('0x24')]['message']);return _0x37bdbc(_0x256dce[_0x7b9e('0x24')][_0x7b9e('0x26')]);}else{logger[_0x7b9e('0x1f')](_0x7b9e('0x20'),_0x1dc779,'request\x20sent');_0x37bdbc(_0x256dce[_0x7b9e('0x27')][_0x7b9e('0x26')]);}})[_0x7b9e('0x28')](function(_0xd78e74){logger['error'](_0x7b9e('0x20'),_0x1dc779,_0xd78e74);_0x5e5179(_0xd78e74);});});}function respondWithStatusCode(_0x5e84f3,_0x123b26){_0x123b26=_0x123b26||0xcc;return function(_0x269963){if(_0x269963){return _0x5e84f3[_0x7b9e('0x29')](_0x123b26);}return _0x5e84f3[_0x7b9e('0x2a')](_0x123b26)['end']();};}function respondWithResult(_0x2fba55,_0xb65e15){_0xb65e15=_0xb65e15||0xc8;return function(_0x64eeda){if(_0x64eeda){return _0x2fba55[_0x7b9e('0x2a')](_0xb65e15)[_0x7b9e('0x2b')](_0x64eeda);}};}function respondWithFilteredResult(_0x189293,_0xd76224){return function(_0x166782){if(_0x166782){var _0x90827d=_0x166782[_0x7b9e('0x2c')],_0x1a8ca7=_0xd76224[_0x7b9e('0x2d')],_0x52c580=_0xd76224[_0x7b9e('0x2d')]+_0xd76224[_0x7b9e('0x2e')],_0x20994c;if(_0x52c580>=_0x90827d){_0x52c580=_0x90827d;_0x20994c=0xc8;}else{_0x20994c=0xce;}_0x189293[_0x7b9e('0x2a')](_0x20994c);return _0x189293[_0x7b9e('0x2f')]('Content-Range',_0x1a8ca7+'-'+_0x52c580+'/'+_0x90827d)[_0x7b9e('0x2b')](_0x166782);}return null;};}function patchUpdates(_0x291d78){return function(_0x1acfaa){try{jsonpatch[_0x7b9e('0x30')](_0x1acfaa,_0x291d78,!![]);}catch(_0x4cc651){return BPromise['reject'](_0x4cc651);}return _0x1acfaa[_0x7b9e('0x31')]();};}function saveUpdates(_0x227482,_0x42ea9f){return function(_0x3d305f){if(_0x3d305f){return _0x3d305f[_0x7b9e('0x32')](_0x227482)[_0x7b9e('0x1e')](function(_0x1a33ab){return _0x1a33ab;});}return null;};}function removeEntity(_0x17ecfb,_0x5c94de){return function(_0x48e853){if(_0x48e853){return _0x48e853[_0x7b9e('0x33')]()[_0x7b9e('0x1e')](function(){_0x17ecfb[_0x7b9e('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22f316,_0x2a50fc){return function(_0x2b5d40){if(!_0x2b5d40){_0x22f316[_0x7b9e('0x29')](0x194);}return _0x2b5d40;};}function handleError(_0x2c158d,_0x1936bd){_0x1936bd=_0x1936bd||0x1f4;return function(_0x19d285){logger['error'](_0x19d285[_0x7b9e('0x34')]);if(_0x19d285['name']){delete _0x19d285[_0x7b9e('0x35')];}_0x2c158d[_0x7b9e('0x2a')](_0x1936bd)[_0x7b9e('0x36')](_0x19d285);};}exports[_0x7b9e('0x37')]=function(_0x35d1f1,_0x40e277){var _0x58583f={},_0x42233b={},_0x1ca3c2={'count':0x0,'rows':[]};var _0x50f668=_['map'](db['MailMessage'][_0x7b9e('0x38')],function(_0x128adc){return{'name':_0x128adc[_0x7b9e('0x39')],'type':_0x128adc[_0x7b9e('0x3a')][_0x7b9e('0x3b')]};});_0x42233b['model']=_[_0x7b9e('0x3c')](_0x50f668,_0x7b9e('0x35'));_0x42233b[_0x7b9e('0x3d')]=_[_0x7b9e('0x3e')](_0x35d1f1[_0x7b9e('0x3d')]);_0x42233b[_0x7b9e('0x3f')]=_[_0x7b9e('0x40')](_0x42233b['model'],_0x42233b['query']);_0x58583f['attributes']=_[_0x7b9e('0x40')](_0x42233b['model'],qs[_0x7b9e('0x41')](_0x35d1f1[_0x7b9e('0x3d')][_0x7b9e('0x41')]));_0x58583f[_0x7b9e('0x42')]=_0x58583f[_0x7b9e('0x42')][_0x7b9e('0x43')]?_0x58583f[_0x7b9e('0x42')]:_0x42233b[_0x7b9e('0x44')];if(!_0x35d1f1[_0x7b9e('0x3d')][_0x7b9e('0x45')]('nolimit')){_0x58583f[_0x7b9e('0x2e')]=qs[_0x7b9e('0x2e')](_0x35d1f1[_0x7b9e('0x3d')][_0x7b9e('0x2e')]);_0x58583f[_0x7b9e('0x2d')]=qs[_0x7b9e('0x2d')](_0x35d1f1[_0x7b9e('0x3d')][_0x7b9e('0x2d')]);}_0x58583f['order']=qs['sort'](_0x35d1f1['query'][_0x7b9e('0x46')]);_0x58583f[_0x7b9e('0x47')]=qs[_0x7b9e('0x3f')](_[_0x7b9e('0x48')](_0x35d1f1['query'],_0x42233b[_0x7b9e('0x3f')]));if(_0x35d1f1[_0x7b9e('0x3d')][_0x7b9e('0x49')]){_0x58583f[_0x7b9e('0x47')]=_[_0x7b9e('0x4a')](_0x58583f[_0x7b9e('0x47')],{'$or':_[_0x7b9e('0x3c')](_0x50f668,function(_0x45fd55){if(_0x45fd55['type']!==_0x7b9e('0x4b')){var _0x57f142={};_0x57f142[_0x45fd55[_0x7b9e('0x35')]]={'$like':'%'+_0x35d1f1[_0x7b9e('0x3d')]['filter']+'%'};return _0x57f142;}})});}_0x58583f=_['merge']({},_0x58583f,_0x35d1f1[_0x7b9e('0x4c')]);var _0x313a34={'where':_0x58583f[_0x7b9e('0x47')]};return db['MailMessage'][_0x7b9e('0x2c')](_0x313a34)[_0x7b9e('0x1e')](function(_0x48941d){_0x1ca3c2[_0x7b9e('0x2c')]=_0x48941d;if(_0x35d1f1[_0x7b9e('0x3d')][_0x7b9e('0x4d')]){_0x58583f[_0x7b9e('0x4e')]=[{'all':!![]}];}return db[_0x7b9e('0x4f')][_0x7b9e('0x50')](_0x58583f);})[_0x7b9e('0x1e')](function(_0x219e6e){_0x1ca3c2[_0x7b9e('0x51')]=_0x219e6e;return _0x1ca3c2;})[_0x7b9e('0x1e')](respondWithFilteredResult(_0x40e277,_0x58583f))[_0x7b9e('0x28')](handleError(_0x40e277,null));};exports[_0x7b9e('0x52')]=function(_0x3aec7b,_0x5e4beb){var _0x4d1378={'raw':!![],'where':{'id':_0x3aec7b[_0x7b9e('0x53')]['id']}},_0x192fbd={};_0x192fbd['model']=_[_0x7b9e('0x3e')](db['MailMessage'][_0x7b9e('0x38')]);_0x192fbd[_0x7b9e('0x3d')]=_[_0x7b9e('0x3e')](_0x3aec7b[_0x7b9e('0x3d')]);_0x192fbd[_0x7b9e('0x3f')]=_[_0x7b9e('0x40')](_0x192fbd[_0x7b9e('0x44')],_0x192fbd['query']);_0x4d1378[_0x7b9e('0x42')]=_[_0x7b9e('0x40')](_0x192fbd['model'],qs[_0x7b9e('0x41')](_0x3aec7b[_0x7b9e('0x3d')][_0x7b9e('0x41')]));_0x4d1378[_0x7b9e('0x42')]=_0x4d1378['attributes'][_0x7b9e('0x43')]?_0x4d1378[_0x7b9e('0x42')]:_0x192fbd[_0x7b9e('0x44')];if(_0x3aec7b[_0x7b9e('0x3d')]['includeAll']){_0x4d1378[_0x7b9e('0x4e')]=[{'all':!![]}];}_0x4d1378=_[_0x7b9e('0x4a')]({},_0x4d1378,_0x3aec7b['options']);return db[_0x7b9e('0x4f')][_0x7b9e('0x54')](_0x4d1378)['then'](handleEntityNotFound(_0x5e4beb,null))[_0x7b9e('0x1e')](respondWithResult(_0x5e4beb,null))[_0x7b9e('0x28')](handleError(_0x5e4beb,null));};exports[_0x7b9e('0x32')]=function(_0x526ab2,_0x1b113a){if(_0x526ab2[_0x7b9e('0x55')]['id']){delete _0x526ab2['body']['id'];}return db[_0x7b9e('0x4f')][_0x7b9e('0x54')]({'where':{'id':_0x526ab2[_0x7b9e('0x53')]['id']}})['then'](handleEntityNotFound(_0x1b113a,null))[_0x7b9e('0x1e')](saveUpdates(_0x526ab2[_0x7b9e('0x55')],null))['then'](respondWithResult(_0x1b113a,null))[_0x7b9e('0x28')](handleError(_0x1b113a,null));};exports[_0x7b9e('0x33')]=function(_0x228d9f,_0x5c59b9){return db[_0x7b9e('0x4f')][_0x7b9e('0x54')]({'where':{'id':_0x228d9f['params']['id']}})[_0x7b9e('0x1e')](handleEntityNotFound(_0x5c59b9,null))[_0x7b9e('0x1e')](removeEntity(_0x5c59b9,null))['catch'](handleError(_0x5c59b9,null));};exports['describe']=function(_0x141ed4,_0x2f1708){return db[_0x7b9e('0x4f')][_0x7b9e('0x56')]()[_0x7b9e('0x1e')](respondWithResult(_0x2f1708,null))['catch'](handleError(_0x2f1708,null));};exports['create']=function(_0x48d479,_0x2d622f){return db[_0x7b9e('0x4f')]['create'](_0x48d479['body'])[_0x7b9e('0x1e')](function(_0x328bb9){if(_0x328bb9){if(_0x328bb9['direction']===_0x7b9e('0x57')&&!_0x328bb9['secret']){var _0x5761a4,_0x2272ef,_0x35aae8;if(_0x48d479[_0x7b9e('0x55')]['to']){_0x2272ef=_0x48d479[_0x7b9e('0x55')]['to'][_0x7b9e('0x58')](',')[0x0];}return db['MailAccount'][_0x7b9e('0x59')]({'where':{'id':_0x328bb9[_0x7b9e('0x5a')]},'include':[{'model':db[_0x7b9e('0x5b')],'as':'List','include':[{'model':db[_0x7b9e('0x5c')],'as':_0x7b9e('0x5d'),'where':{'email':_0x2272ef},'limit':0x1,'order':[[_0x7b9e('0x5e'),_0x7b9e('0x5f')]]}]},{'model':db[_0x7b9e('0x60')],'as':_0x7b9e('0x61'),'raw':!![]}]})[_0x7b9e('0x1e')](function(_0x58354b){_0x5761a4=_0x58354b;if(_0x5761a4&&_0x5761a4[_0x7b9e('0x61')]){var _0x4d0a3c={'tls':{'rejectUnauthorized':![]}};if(_[_0x7b9e('0x62')](_0x5761a4['Smtp']['service'])){_0x4d0a3c[_0x7b9e('0x63')]=_0x5761a4[_0x7b9e('0x61')]['host'];_0x4d0a3c[_0x7b9e('0x64')]=_0x5761a4[_0x7b9e('0x61')]['port'];_0x4d0a3c[_0x7b9e('0x65')]=_0x5761a4[_0x7b9e('0x61')]['secure'];if(_0x5761a4['Smtp'][_0x7b9e('0x66')]){_0x4d0a3c[_0x7b9e('0x67')]={'user':_0x5761a4[_0x7b9e('0x61')][_0x7b9e('0x68')],'pass':_0x5761a4[_0x7b9e('0x61')][_0x7b9e('0x69')]};}}else{_0x4d0a3c['service']=_0x5761a4[_0x7b9e('0x61')]['service'];_0x4d0a3c[_0x7b9e('0x67')]={'user':_0x5761a4[_0x7b9e('0x61')][_0x7b9e('0x68')],'pass':_0x5761a4['Smtp'][_0x7b9e('0x69')]};_0x4d0a3c[_0x7b9e('0x65')]=_0x5761a4[_0x7b9e('0x61')][_0x7b9e('0x65')];}if(_0x48d479[_0x7b9e('0x55')]['attachments']&&_0x48d479[_0x7b9e('0x55')]['attachments'][_0x7b9e('0x43')]){for(var _0x4ec8f7=0x0;_0x4ec8f7<_0x48d479[_0x7b9e('0x55')]['attachments']['length'];_0x4ec8f7+=0x1){_0x48d479[_0x7b9e('0x55')]['attachments'][_0x4ec8f7]={'filename':_0x48d479[_0x7b9e('0x55')]['attachments'][_0x4ec8f7]['name'],'path':path[_0x7b9e('0x6a')](config[_0x7b9e('0x6b')],'server/files/attachments',_0x48d479['body'][_0x7b9e('0x6c')][_0x4ec8f7][_0x7b9e('0x6d')])};}}_0x35aae8={'account':_0x4d0a3c,'message':_0x48d479[_0x7b9e('0x55')]};return;}})['then'](function(){if(_0x5761a4[_0x7b9e('0x6e')]){if(_0x5761a4[_0x7b9e('0x6e')]['Contacts'][_0x7b9e('0x43')]){return _0x5761a4['List'][_0x7b9e('0x5d')][0x0];}else{return db[_0x7b9e('0x5c')][_0x7b9e('0x6f')](_[_0x7b9e('0x70')](_0x48d479[_0x7b9e('0x55')],{'firstName':_0x48d479[_0x7b9e('0x55')]['to'],'email':_0x48d479[_0x7b9e('0x55')]['to'],'phone':_0x48d479[_0x7b9e('0x55')]['to'],'ListId':_0x5761a4[_0x7b9e('0x71')]}));}}else{throw new Error(_0x7b9e('0x72'));}})[_0x7b9e('0x1e')](function(){if(_0x35aae8){return respondWithRpcPromise(_0x7b9e('0x73'),_0x7b9e('0x74'),_0x35aae8,client9003)[_0x7b9e('0x1e')](function(_0x461704){return _0x328bb9[_0x7b9e('0x32')]({'read':!![],'messageId':_0x461704[_0x7b9e('0x75')],'sentAt':moment()[_0x7b9e('0x76')](_0x7b9e('0x77'))});})['catch'](function(_0x21514c){logger[_0x7b9e('0x24')]('%s',JSON[_0x7b9e('0x78')](_0x21514c));return _0x328bb9;});}return _0x328bb9;});}return _0x328bb9;}})['then'](respondWithResult(_0x2d622f,0xc9))[_0x7b9e('0x28')](handleError(_0x2d622f,null));};var interaction_log=require(_0x7b9e('0x12'))(_0x7b9e('0x79'));exports['accept']=function(_0x13e578,_0x5e1203,_0x3aca2d){var _0x5d4787={'channel':'mail'};if(_0x13e578[_0x7b9e('0x55')]['id']){delete _0x13e578[_0x7b9e('0x55')]['id'];}_0x13e578[_0x7b9e('0x55')][_0x7b9e('0x7a')]=!![];_0x13e578[_0x7b9e('0x55')][_0x7b9e('0x7b')]=moment()['format'](_0x7b9e('0x77'));_0x13e578[_0x7b9e('0x55')][_0x7b9e('0x7c')]=_0x13e578[_0x7b9e('0x55')][_0x7b9e('0x7c')]||_0x13e578[_0x7b9e('0x68')]['id'];return db[_0x7b9e('0x4f')][_0x7b9e('0x54')]({'where':{'id':_0x13e578[_0x7b9e('0x53')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x7b9e('0x7d')}]})[_0x7b9e('0x1e')](handleEntityNotFound(_0x5e1203,null))[_0x7b9e('0x1e')](saveUpdates(_0x13e578[_0x7b9e('0x55')],null))[_0x7b9e('0x1e')](function(_0x4ae6e2){if(_0x4ae6e2){_0x5d4787[_0x7b9e('0x26')]=_0x4ae6e2[_0x7b9e('0x7e')]({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0x4ae6e2[_0x7b9e('0x7f')]}});}return null;})['then'](handleEntityNotFound(_0x5e1203,null))[_0x7b9e('0x1e')](function(_0x29774e){if(_0x29774e){return _0x29774e['update']({'UserId':_0x13e578[_0x7b9e('0x55')][_0x7b9e('0x7c')],'read1stAt':_['isNil'](_0x29774e[_0x7b9e('0x80')])?moment()[_0x7b9e('0x76')](_0x7b9e('0x77')):undefined});}return null;})[_0x7b9e('0x1e')](function(_0x243e17){if(_0x243e17){_0x5d4787[_0x7b9e('0x81')]=_0x243e17['get']({'plain':!![]});interaction_log[_0x7b9e('0x1f')](_0x7b9e('0x82'),_0x13e578[_0x7b9e('0x68')]['id'],_0x13e578['user']['name'],_0x13e578[_0x7b9e('0x68')]['role'],_0x5d4787[_0x7b9e('0x81')]['id'],_0x13e578[_0x7b9e('0x55')]?JSON[_0x7b9e('0x78')](_0x13e578['body']):'null');return respondWithRpcPromise(_0x7b9e('0x83'),_0x7b9e('0x84'),_0x5d4787);}return null;})['then'](function(_0x58ddae){if(_0x58ddae){if(_0x13e578['body'][_0x7b9e('0x85')]){_0x5d4787[_0x7b9e('0x26')][_0x7b9e('0x86')]=util[_0x7b9e('0x76')](_0x7b9e('0x87'),_0x13e578[_0x7b9e('0x68')]['name']);_0x5d4787['message'][_0x7b9e('0x88')]=_0x5d4787['channel'];_0x5d4787[_0x7b9e('0x26')][_0x7b9e('0x89')]=_0x7b9e('0x8a');return respondWithRpcPromise(_0x7b9e('0x8b'),'EventManager',{'event':_0x7b9e('0x8c'),'message':_0x5d4787['message']},client9002)[_0x7b9e('0x1e')](function(){return _0x5d4787;});}return _0x5d4787;}return null;})['then'](respondWithResult(_0x5e1203,null))[_0x7b9e('0x28')](handleError(_0x5e1203,null));};var interaction_log=require(_0x7b9e('0x12'))(_0x7b9e('0x79'));exports['reject']=function(_0x5038b7,_0x1e9c20,_0xc21210){var _0xe63ef6={'agent':{},'channel':_0x7b9e('0x8d')};if(_0x5038b7[_0x7b9e('0x55')]['id']){delete _0x5038b7[_0x7b9e('0x55')]['id'];}_0x5038b7['body'][_0x7b9e('0x7c')]=_0x5038b7[_0x7b9e('0x55')][_0x7b9e('0x7c')]||_0x5038b7[_0x7b9e('0x68')]['id'];_0xe63ef6[_0x7b9e('0x8e')]['id']=_0x5038b7[_0x7b9e('0x55')]['UserId'];return db[_0x7b9e('0x4f')]['find']({'where':{'id':_0x5038b7['params']['id'],'UserId':null}})[_0x7b9e('0x1e')](handleEntityNotFound(_0x1e9c20,null))[_0x7b9e('0x1e')](function(_0x366b55){if(_0x366b55){_0xe63ef6[_0x7b9e('0x26')]=_0x366b55[_0x7b9e('0x7e')]({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0x366b55[_0x7b9e('0x7f')]}});}return null;})[_0x7b9e('0x1e')](handleEntityNotFound(_0x1e9c20,null))[_0x7b9e('0x1e')](function(_0x40a406){if(_0x40a406){_0xe63ef6[_0x7b9e('0x81')]=_0x40a406['get']({'plain':!![]});interaction_log['info'](_0x7b9e('0x8f'),_0x5038b7[_0x7b9e('0x68')]['id'],_0x5038b7[_0x7b9e('0x68')][_0x7b9e('0x35')],_0x5038b7[_0x7b9e('0x68')][_0x7b9e('0x90')],_0xe63ef6[_0x7b9e('0x81')]['id'],_0x5038b7[_0x7b9e('0x55')]?JSON[_0x7b9e('0x78')](_0x5038b7[_0x7b9e('0x55')]):'null');return respondWithRpcPromise(_0x7b9e('0x91'),_0x7b9e('0x92'),_0xe63ef6);}return null;})[_0x7b9e('0x1e')](function(_0xebab7e){if(_0xebab7e){_0xebab7e[_0x7b9e('0x26')][_0x7b9e('0x86')]=util['format'](_0x7b9e('0x87'),_0x5038b7['user'][_0x7b9e('0x35')]);_0xebab7e[_0x7b9e('0x26')][_0x7b9e('0x88')]=_0xe63ef6[_0x7b9e('0x88')];_0xebab7e[_0x7b9e('0x26')][_0x7b9e('0x89')]=_0x7b9e('0x93');respondWithRpcPromise(_0x7b9e('0x8b'),_0x7b9e('0x8b'),{'event':_0x7b9e('0x94'),'message':_0xebab7e['message']},client9002);return _0xe63ef6;}return null;})[_0x7b9e('0x1e')](respondWithResult(_0x1e9c20,null))[_0x7b9e('0x28')](handleError(_0x1e9c20,null));};exports[_0x7b9e('0x95')]=function(_0x5e18ca,_0x43a6fa){var _0x222b0d=moment()['unix']()[_0x7b9e('0x96')]();var _0x1d29ff=path[_0x7b9e('0x6a')](config[_0x7b9e('0x6b')],'server','files',_0x7b9e('0x97'));var _0x5cc32e=path[_0x7b9e('0x6a')](config[_0x7b9e('0x6b')],_0x7b9e('0x98'),_0x7b9e('0x99'),_0x7b9e('0x6c'));var _0x1b9412=util[_0x7b9e('0x76')](_0x7b9e('0x9a'),_0x222b0d);return db[_0x7b9e('0x4f')][_0x7b9e('0x54')]({'where':{'id':_0x5e18ca[_0x7b9e('0x53')]['id']},'attributes':['id',_0x7b9e('0x55'),_0x7b9e('0x9b'),'to','cc',_0x7b9e('0x9c'),_0x7b9e('0x9d'),_0x7b9e('0x9e')],'include':_0x5e18ca[_0x7b9e('0x3d')]['attachments']?[{'model':db[_0x7b9e('0x9f')],'as':_0x7b9e('0xa0')}]:undefined})['then'](handleEntityNotFound(_0x43a6fa,null))['then'](function(_0x2428d9){if(_0x2428d9){var _0x5dd2fe=_0x2428d9;var _0x514c79={'from':_0x5dd2fe[_0x7b9e('0x9b')],'to':_0x5dd2fe['to'],'subject':_0x5dd2fe[_0x7b9e('0x9d')],'html':_0x5dd2fe[_0x7b9e('0x55')],'headers':{'Date':moment(_0x5dd2fe[_0x7b9e('0x9e')])[_0x7b9e('0x76')](_0x7b9e('0xa1'))},'attachments':[]};if(_0x2428d9['cc']){_0x514c79[_0x7b9e('0xa2')]['Cc']=_0x2428d9['cc'];}if(_0x2428d9[_0x7b9e('0x9c')]){_0x514c79[_0x7b9e('0xa2')][_0x7b9e('0xa3')]=_0x2428d9[_0x7b9e('0x9c')];}return new BPromise(function(_0x5d64a3,_0x3cfb83){if(_0x2428d9[_0x7b9e('0xa0')]){for(var _0x5a8406=0x0;_0x5a8406<_0x2428d9[_0x7b9e('0xa0')][_0x7b9e('0x43')];_0x5a8406++){var _0xa38f5a=_0x2428d9[_0x7b9e('0xa0')][_0x5a8406];var _0x290f51=path[_0x7b9e('0x6a')](_0x5cc32e,_0xa38f5a['basename']);if(fs[_0x7b9e('0xa4')](_0x290f51)){_0x514c79[_0x7b9e('0x6c')]['push']({'name':_0xa38f5a[_0x7b9e('0x35')],'contentType':_0xa38f5a[_0x7b9e('0x3a')],'data':fs['readFileSync'](_0x290f51)});}}}emlformat[_0x7b9e('0xa5')](_0x514c79,function(_0x59d67e,_0x5e1e69){if(_0x59d67e)return _0x3cfb83(_0x59d67e);fs[_0x7b9e('0xa6')](path[_0x7b9e('0x6a')](_0x1d29ff,_0x1b9412),_0x5e1e69);return _0x5d64a3(_0x5e1e69);});});}})['then'](function(_0x331f09){if(_0x331f09){return _0x43a6fa[_0x7b9e('0x95')](path[_0x7b9e('0x6a')](_0x1d29ff,_0x1b9412),_0x1b9412,function(_0x59afa5){if(_0x59afa5){console[_0x7b9e('0xa7')](_0x7b9e('0xa8'),_0x59afa5);}else{fs['unlinkSync'](path['join'](_0x1d29ff,_0x1b9412));}});}})['catch'](handleError(_0x43a6fa,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index d91e8df..dd17e71 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 _0xe645=['save','update','remove','emit','hasOwnProperty','events','../../mysqldb','MailMessage','setMaxListeners'];(function(_0x273305,_0x4c2199){var _0x1f75e7=function(_0x38d64a){while(--_0x38d64a){_0x273305['push'](_0x273305['shift']());}};_0x1f75e7(++_0x4c2199);}(_0xe645,0x1c7));var _0x5e64=function(_0x319d18,_0x170569){_0x319d18=_0x319d18-0x0;var _0x2026c2=_0xe645[_0x319d18];return _0x2026c2;};'use strict';var EventEmitter=require(_0x5e64('0x0'));var MailMessage=require(_0x5e64('0x1'))['db'][_0x5e64('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x5e64('0x3')](0x0);var events={'afterCreate':_0x5e64('0x4'),'afterUpdate':_0x5e64('0x5'),'afterDestroy':_0x5e64('0x6')};function emitEvent(_0x24a60f){return function(_0xf5a798,_0x28aead,_0x1f46eb){MailMessageEvents[_0x5e64('0x7')](_0x24a60f+':'+_0xf5a798['id'],_0xf5a798);MailMessageEvents[_0x5e64('0x7')](_0x24a60f,_0xf5a798);_0x1f46eb(null);};}for(var e in events){if(events[_0x5e64('0x8')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file +var _0xfb5a=['hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage','setMaxListeners','save','remove','emit'];(function(_0x543c51,_0xff0084){var _0x360555=function(_0x2a0801){while(--_0x2a0801){_0x543c51['push'](_0x543c51['shift']());}};_0x360555(++_0xff0084);}(_0xfb5a,0xa3));var _0xafb5=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xfb5a[_0x501510];return _0x1e6ee5;};'use strict';var EventEmitter=require(_0xafb5('0x0'));var MailMessage=require(_0xafb5('0x1'))['db'][_0xafb5('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xafb5('0x3')](0x0);var events={'afterCreate':_0xafb5('0x4'),'afterUpdate':'update','afterDestroy':_0xafb5('0x5')};function emitEvent(_0x49926e){return function(_0x210480,_0x32a45a,_0x468e37){MailMessageEvents[_0xafb5('0x6')](_0x49926e+':'+_0x210480['id'],_0x210480);MailMessageEvents[_0xafb5('0x6')](_0x49926e,_0x210480);_0x468e37(null);};}for(var e in events){if(events[_0xafb5('0x7')](e)){var event=events[e];MailMessage[_0xafb5('0x8')](e,emitEvent(event));}}module[_0xafb5('0x9')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index cff6cb5..801cf70 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 _0x6377=['body','catch','error','utf8mb4','utf8mb4_unicode_ci','util','api','moment','path','rimraf','exports','MailMessage','messageId','fti_mail_messages','subject','plainBody','fromString','models','direction','toLowerCase','out','secret','isNil','UserId','MailInteraction','findOne','MailInteractionId','update','createdAt'];(function(_0x3585e2,_0x4cf6fd){var _0x115393=function(_0x42f360){while(--_0x42f360){_0x3585e2['push'](_0x3585e2['shift']());}};_0x115393(++_0x4cf6fd);}(_0x6377,0x144));var _0x7637=function(_0x1e5b0a,_0x5d3438){_0x1e5b0a=_0x1e5b0a-0x0;var _0x42caa6=_0x6377[_0x1e5b0a];return _0x42caa6;};'use strict';var _=require('lodash');var util=require(_0x7637('0x0'));var logger=require('../../config/logger')(_0x7637('0x1'));var moment=require(_0x7637('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x7637('0x3'));var rimraf=require(_0x7637('0x4'));var config=require('../../config/environment');var attributes=require('./mailMessage.attributes');module[_0x7637('0x5')]=function(_0x5cdb4b,_0x925d53){return _0x5cdb4b['define'](_0x7637('0x6'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x7637('0x7'),'fields':[_0x7637('0x7')]},{'name':_0x7637('0x8'),'fields':['plainBody',_0x7637('0x9')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5931dd,_0x19dac4,_0x55b755){if(_0x5931dd['body']){_0x5931dd[_0x7637('0xa')]=htmlToText[_0x7637('0xb')](_0x5931dd['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x55b755(null,_0x19dac4);},'afterCreate':function(_0x3d9381,_0x4cc390,_0x3ce354){var _0x330218=_0x5cdb4b[_0x7637('0xc')];var _0x7c8183=_0x3d9381['get']({'plain':!![]});if(_0x7c8183[_0x7637('0xd')][_0x7637('0xe')]()==='in'||_0x7c8183[_0x7637('0xd')][_0x7637('0xe')]()===_0x7637('0xf')&&!_0x7c8183[_0x7637('0x10')]&&!_[_0x7637('0x11')](_0x7c8183[_0x7637('0x12')])){_0x330218[_0x7637('0x13')][_0x7637('0x14')]({'where':{'id':_0x7c8183[_0x7637('0x15')]}})['then'](function(_0x2d9891){if(_0x2d9891){_0x2d9891[_0x7637('0x16')]({'lastMsgAt':_0x7c8183[_0x7637('0x17')],'lastMsgDirection':_0x7c8183[_0x7637('0xd')][_0x7637('0xe')](),'lastMsgBody':_0x7c8183[_0x7637('0x18')]});}})[_0x7637('0x19')](function(_0x3b7136){console[_0x7637('0x1a')](_0x3b7136);});}_0x3ce354();}},'charset':_0x7637('0x1b'),'collate':_0x7637('0x1c')});}; \ No newline at end of file +var _0x8fc0=['util','api','moment','bluebird','html-to-text','path','../../config/environment','./mailMessage.attributes','exports','define','mail_messages','messageId','subject','FULLTEXT','body','models','direction','toLowerCase','out','isNil','findOne','MailInteractionId','then','catch','utf8mb4','utf8mb4_unicode_ci'];(function(_0x586f4d,_0x1e7a2a){var _0x39ed55=function(_0x5b6b55){while(--_0x5b6b55){_0x586f4d['push'](_0x586f4d['shift']());}};_0x39ed55(++_0x1e7a2a);}(_0x8fc0,0x1d4));var _0x08fc=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0x8fc0[_0x24f31b];return _0x488401;};'use strict';var _=require('lodash');var util=require(_0x08fc('0x0'));var logger=require('../../config/logger')(_0x08fc('0x1'));var moment=require(_0x08fc('0x2'));var BPromise=require(_0x08fc('0x3'));var rp=require('request-promise');var htmlToText=require(_0x08fc('0x4'));var fs=require('fs');var path=require(_0x08fc('0x5'));var rimraf=require('rimraf');var config=require(_0x08fc('0x6'));var attributes=require(_0x08fc('0x7'));module[_0x08fc('0x8')]=function(_0x32e054,_0x371cc6){return _0x32e054[_0x08fc('0x9')]('MailMessage',attributes,{'tableName':_0x08fc('0xa'),'paranoid':![],'indexes':[{'name':_0x08fc('0xb'),'fields':[_0x08fc('0xb')]},{'name':'fti_mail_messages','fields':['plainBody',_0x08fc('0xc')],'type':_0x08fc('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2e71f0,_0x1301a5,_0x504ad3){if(_0x2e71f0[_0x08fc('0xe')]){_0x2e71f0['plainBody']=htmlToText['fromString'](_0x2e71f0[_0x08fc('0xe')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x504ad3(null,_0x1301a5);},'afterCreate':function(_0x1ebbfa,_0x180739,_0x26cc27){var _0x429fba=_0x32e054[_0x08fc('0xf')];var _0x9ceb65=_0x1ebbfa['get']({'plain':!![]});if(_0x9ceb65[_0x08fc('0x10')]['toLowerCase']()==='in'||_0x9ceb65[_0x08fc('0x10')][_0x08fc('0x11')]()===_0x08fc('0x12')&&!_0x9ceb65['secret']&&!_[_0x08fc('0x13')](_0x9ceb65['UserId'])){_0x429fba['MailInteraction'][_0x08fc('0x14')]({'where':{'id':_0x9ceb65[_0x08fc('0x15')]}})[_0x08fc('0x16')](function(_0x140c0d){if(_0x140c0d){_0x140c0d['update']({'lastMsgAt':_0x9ceb65['createdAt'],'lastMsgDirection':_0x9ceb65[_0x08fc('0x10')][_0x08fc('0x11')](),'lastMsgBody':_0x9ceb65['body']});}})[_0x08fc('0x17')](function(_0x254272){console['error'](_0x254272);});}_0x26cc27();}},'charset':_0x08fc('0x18'),'collate':_0x08fc('0x19')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index fb067e9..8564462 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 _0xf13b=['create','body','options','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','redis','localhost','./mailMessage.socket','register','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateMailMessage','MailMessage'];(function(_0x5896cd,_0x40d489){var _0x3f8b07=function(_0x5336c6){while(--_0x5336c6){_0x5896cd['push'](_0x5896cd['shift']());}};_0x3f8b07(++_0x40d489);}(_0xf13b,0x1f0));var _0xbf13=function(_0x13a14d,_0x1e10d2){_0x13a14d=_0x13a14d-0x0;var _0x4772c6=_0xf13b[_0x13a14d];return _0x4772c6;};'use strict';var _=require(_0xbf13('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbf13('0x1'));var fs=require('fs');var Redis=require(_0xbf13('0x2'));var db=require(_0xbf13('0x3'))['db'];var utils=require(_0xbf13('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbf13('0x5'));var jayson=require(_0xbf13('0x6'));var client=jayson['client'][_0xbf13('0x7')]({'port':0x232a});config[_0xbf13('0x8')]=_['defaults'](config[_0xbf13('0x8')],{'host':_0xbf13('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbf13('0x8')]));require(_0xbf13('0xa'))[_0xbf13('0xb')](socket);function respondWithRpcPromise(_0x7e139,_0x4bfed2,_0x14424d){return new BPromise(function(_0x586bcc,_0x344553){return client['request'](_0x7e139,_0x14424d)[_0xbf13('0xc')](function(_0x763b73){logger['info'](_0xbf13('0xd'),_0x4bfed2,_0xbf13('0xe'));logger[_0xbf13('0xf')](_0xbf13('0x10'),_0x4bfed2,'request\x20sent',JSON[_0xbf13('0x11')](_0x763b73));if(_0x763b73[_0xbf13('0x12')]){if(_0x763b73[_0xbf13('0x12')][_0xbf13('0x13')]===0x1f4){logger['error']('MailMessage,\x20%s,\x20%s',_0x4bfed2,_0x763b73['error'][_0xbf13('0x14')]);return _0x344553(_0x763b73[_0xbf13('0x12')][_0xbf13('0x14')]);}logger[_0xbf13('0x12')](_0xbf13('0xd'),_0x4bfed2,_0x763b73[_0xbf13('0x12')][_0xbf13('0x14')]);return _0x586bcc(_0x763b73[_0xbf13('0x12')]['message']);}else{logger[_0xbf13('0x15')](_0xbf13('0xd'),_0x4bfed2,_0xbf13('0xe'));_0x586bcc(_0x763b73[_0xbf13('0x16')][_0xbf13('0x14')]);}})[_0xbf13('0x17')](function(_0x56de6a){logger['error'](_0xbf13('0xd'),_0x4bfed2,_0x56de6a);_0x344553(_0x56de6a);});});}exports[_0xbf13('0x18')]=function(_0x3cbc13){var _0x2d3a94=this;return new Promise(function(_0x5d1be7,_0x4dd9d0){return db[_0xbf13('0x19')][_0xbf13('0x1a')](_0x3cbc13[_0xbf13('0x1b')],{'raw':_0x3cbc13['options']?_0x3cbc13[_0xbf13('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x31b0b9){logger[_0xbf13('0x15')](_0xbf13('0x18'),_0x3cbc13);logger[_0xbf13('0xf')](_0xbf13('0x18'),_0x3cbc13,JSON[_0xbf13('0x11')](_0x31b0b9));_0x5d1be7(_0x31b0b9);})[_0xbf13('0x17')](function(_0x326397){logger[_0xbf13('0x12')]('CreateMailMessage',_0x326397[_0xbf13('0x14')],_0x3cbc13);_0x4dd9d0(_0x2d3a94[_0xbf13('0x12')](0x1f4,_0x326397[_0xbf13('0x14')]));});});}; \ No newline at end of file +var _0xb934=['ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateMailMessage','MailMessage','lodash','util','moment','randomstring'];(function(_0x19bdeb,_0x59601b){var _0x4f44f3=function(_0x3d4f63){while(--_0x3d4f63){_0x19bdeb['push'](_0x19bdeb['shift']());}};_0x4f44f3(++_0x59601b);}(_0xb934,0x92));var _0x4b93=function(_0xaad399,_0x2a3009){_0xaad399=_0xaad399-0x0;var _0x355816=_0xb934[_0xaad399];return _0x355816;};'use strict';var _=require(_0x4b93('0x0'));var util=require(_0x4b93('0x1'));var moment=require(_0x4b93('0x2'));var BPromise=require('bluebird');var rs=require(_0x4b93('0x3'));var fs=require('fs');var Redis=require(_0x4b93('0x4'));var db=require(_0x4b93('0x5'))['db'];var utils=require(_0x4b93('0x6'));var logger=require(_0x4b93('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4b93('0x8'));var client=jayson[_0x4b93('0x9')][_0x4b93('0xa')]({'port':0x232a});config[_0x4b93('0xb')]=_['defaults'](config[_0x4b93('0xb')],{'host':_0x4b93('0xc'),'port':0x18eb});var socket=require(_0x4b93('0xd'))(new Redis(config[_0x4b93('0xb')]));require(_0x4b93('0xe'))[_0x4b93('0xf')](socket);function respondWithRpcPromise(_0x10a47b,_0x15ad72,_0x254572){return new BPromise(function(_0x50a74d,_0x2c33cc){return client[_0x4b93('0x10')](_0x10a47b,_0x254572)[_0x4b93('0x11')](function(_0xfb8b42){logger[_0x4b93('0x12')](_0x4b93('0x13'),_0x15ad72,_0x4b93('0x14'));logger[_0x4b93('0x15')](_0x4b93('0x16'),_0x15ad72,_0x4b93('0x14'),JSON[_0x4b93('0x17')](_0xfb8b42));if(_0xfb8b42[_0x4b93('0x18')]){if(_0xfb8b42[_0x4b93('0x18')][_0x4b93('0x19')]===0x1f4){logger[_0x4b93('0x18')]('MailMessage,\x20%s,\x20%s',_0x15ad72,_0xfb8b42[_0x4b93('0x18')][_0x4b93('0x1a')]);return _0x2c33cc(_0xfb8b42[_0x4b93('0x18')]['message']);}logger[_0x4b93('0x18')](_0x4b93('0x13'),_0x15ad72,_0xfb8b42[_0x4b93('0x18')][_0x4b93('0x1a')]);return _0x50a74d(_0xfb8b42[_0x4b93('0x18')]['message']);}else{logger[_0x4b93('0x12')](_0x4b93('0x13'),_0x15ad72,'request\x20sent');_0x50a74d(_0xfb8b42['result'][_0x4b93('0x1a')]);}})[_0x4b93('0x1b')](function(_0x12f944){logger[_0x4b93('0x18')](_0x4b93('0x13'),_0x15ad72,_0x12f944);_0x2c33cc(_0x12f944);});});}exports[_0x4b93('0x1c')]=function(_0xe26eb8){var _0x21b019=this;return new Promise(function(_0x3b5d15,_0x36bf8a){return db[_0x4b93('0x1d')]['create'](_0xe26eb8['body'],{'raw':_0xe26eb8['options']?_0xe26eb8['options']['raw']===undefined?!![]:![]:!![]})[_0x4b93('0x11')](function(_0x4b7858){logger[_0x4b93('0x12')](_0x4b93('0x1c'),_0xe26eb8);logger[_0x4b93('0x15')](_0x4b93('0x1c'),_0xe26eb8,JSON[_0x4b93('0x17')](_0x4b7858));_0x3b5d15(_0x4b7858);})[_0x4b93('0x1b')](function(_0x1b6e7a){logger[_0x4b93('0x18')]('CreateMailMessage',_0x1b6e7a['message'],_0xe26eb8);_0x36bf8a(_0x21b019[_0x4b93('0x18')](0x1f4,_0x1b6e7a['message']));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index e815703..dcd595c 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 _0x7c22=['removeListener','length','mailMessage:','./mailMessage.events','save','update','emit'];(function(_0x45d1bd,_0x261bb4){var _0x4fa050=function(_0x287928){while(--_0x287928){_0x45d1bd['push'](_0x45d1bd['shift']());}};_0x4fa050(++_0x261bb4);}(_0x7c22,0x6c));var _0x27c2=function(_0x3d062b,_0x141738){_0x3d062b=_0x3d062b-0x0;var _0x559eb6=_0x7c22[_0x3d062b];return _0x559eb6;};'use strict';var MailMessageEvents=require(_0x27c2('0x0'));var events=[_0x27c2('0x1'),'remove',_0x27c2('0x2')];function createListener(_0x117d29,_0x4d6d12){return function(_0x10f765){_0x4d6d12[_0x27c2('0x3')](_0x117d29,_0x10f765);};}function removeListener(_0x59004d,_0x4ce950){return function(){MailMessageEvents[_0x27c2('0x4')](_0x59004d,_0x4ce950);};}exports['register']=function(_0x28548d){for(var _0x5006bd=0x0,_0x32ec44=events[_0x27c2('0x5')];_0x5006bd<_0x32ec44;_0x5006bd++){var _0x56736f=events[_0x5006bd];var _0xb57ae1=createListener(_0x27c2('0x6')+_0x56736f,_0x28548d);MailMessageEvents['on'](_0x56736f,_0xb57ae1);}}; \ No newline at end of file +var _0x1165=['length','mailMessage:','update','emit','removeListener','register'];(function(_0x2b1b4a,_0x580b10){var _0x2896da=function(_0x1989fa){while(--_0x1989fa){_0x2b1b4a['push'](_0x2b1b4a['shift']());}};_0x2896da(++_0x580b10);}(_0x1165,0x1d6));var _0x5116=function(_0xe21d1b,_0x2e973a){_0xe21d1b=_0xe21d1b-0x0;var _0x31635d=_0x1165[_0xe21d1b];return _0x31635d;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=['save','remove',_0x5116('0x0')];function createListener(_0x22bae6,_0x438390){return function(_0x5581af){_0x438390[_0x5116('0x1')](_0x22bae6,_0x5581af);};}function removeListener(_0x49cdf2,_0x36a0d1){return function(){MailMessageEvents[_0x5116('0x2')](_0x49cdf2,_0x36a0d1);};}exports[_0x5116('0x3')]=function(_0x288151){for(var _0x112845=0x0,_0x313b36=events[_0x5116('0x4')];_0x112845<_0x313b36;_0x112845++){var _0x219810=events[_0x112845];var _0x285665=createListener(_0x5116('0x5')+_0x219810,_0x288151);MailMessageEvents['on'](_0x219810,_0x285665);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 94e93e3..20868bf 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 _0xd4f8=['./mailQueue.controller','get','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','isAuthenticated','getTeams','/:id/users','create','post','addTeams','addAgents','put','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x594691,_0x58203a){var _0x1f9fd8=function(_0x1ef299){while(--_0x1ef299){_0x594691['push'](_0x594691['shift']());}};_0x1f9fd8(++_0x58203a);}(_0xd4f8,0xbd));var _0x8d4f=function(_0x318cce,_0x1c4a65){_0x318cce=_0x318cce-0x0;var _0x1f6e1e=_0xd4f8[_0x318cce];return _0x1f6e1e;};'use strict';var multer=require(_0x8d4f('0x0'));var util=require(_0x8d4f('0x1'));var path=require(_0x8d4f('0x2'));var timeout=require(_0x8d4f('0x3'));var express=require(_0x8d4f('0x4'));var router=express['Router']();var auth=require(_0x8d4f('0x5'));var interaction=require(_0x8d4f('0x6'));var config=require('../../config/environment');var controller=require(_0x8d4f('0x7'));router[_0x8d4f('0x8')]('/',auth['isAuthenticated'](),controller[_0x8d4f('0x9')]);router[_0x8d4f('0x8')](_0x8d4f('0xa'),auth['isAuthenticated'](),controller[_0x8d4f('0xb')]);router[_0x8d4f('0x8')](_0x8d4f('0xc'),auth['isAuthenticated'](),controller[_0x8d4f('0xd')]);router['get'](_0x8d4f('0xe'),auth['isAuthenticated'](),controller[_0x8d4f('0xf')]);router[_0x8d4f('0x8')](_0x8d4f('0x10'),auth[_0x8d4f('0x11')](),controller[_0x8d4f('0x12')]);router[_0x8d4f('0x8')](_0x8d4f('0x13'),auth[_0x8d4f('0x11')](),controller['getAgents']);router['post']('/',auth[_0x8d4f('0x11')](),controller[_0x8d4f('0x14')]);router[_0x8d4f('0x15')](_0x8d4f('0x10'),auth[_0x8d4f('0x11')](),controller[_0x8d4f('0x16')]);router['post']('/:id/users',auth[_0x8d4f('0x11')](),controller[_0x8d4f('0x17')]);router[_0x8d4f('0x18')](_0x8d4f('0xc'),auth[_0x8d4f('0x11')](),controller[_0x8d4f('0x19')]);router[_0x8d4f('0x1a')](_0x8d4f('0xc'),auth[_0x8d4f('0x11')](),controller[_0x8d4f('0x1b')]);router[_0x8d4f('0x1a')](_0x8d4f('0x10'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x8d4f('0x1a')](_0x8d4f('0x13'),auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x3c01=['../../components/auth/service','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams','/:id/users','removeAgents','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x48cb1f,_0x5ca68d){var _0x172c4d=function(_0x85040){while(--_0x85040){_0x48cb1f['push'](_0x48cb1f['shift']());}};_0x172c4d(++_0x5ca68d);}(_0x3c01,0x1ac));var _0x13c0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3c01[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x13c0('0x0'));var util=require(_0x13c0('0x1'));var path=require(_0x13c0('0x2'));var timeout=require(_0x13c0('0x3'));var express=require(_0x13c0('0x4'));var router=express[_0x13c0('0x5')]();var auth=require(_0x13c0('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x13c0('0x7'));router[_0x13c0('0x8')]('/',auth[_0x13c0('0x9')](),controller[_0x13c0('0xa')]);router[_0x13c0('0x8')](_0x13c0('0xb'),auth[_0x13c0('0x9')](),controller[_0x13c0('0xc')]);router[_0x13c0('0x8')](_0x13c0('0xd'),auth['isAuthenticated'](),controller[_0x13c0('0xe')]);router[_0x13c0('0x8')](_0x13c0('0xf'),auth[_0x13c0('0x9')](),controller[_0x13c0('0x10')]);router[_0x13c0('0x8')](_0x13c0('0x11'),auth[_0x13c0('0x9')](),controller[_0x13c0('0x12')]);router[_0x13c0('0x8')]('/:id/users',auth[_0x13c0('0x9')](),controller['getAgents']);router[_0x13c0('0x13')]('/',auth['isAuthenticated'](),controller[_0x13c0('0x14')]);router[_0x13c0('0x13')](_0x13c0('0x11'),auth['isAuthenticated'](),controller[_0x13c0('0x15')]);router[_0x13c0('0x13')]('/:id/users',auth['isAuthenticated'](),controller[_0x13c0('0x16')]);router[_0x13c0('0x17')](_0x13c0('0xd'),auth[_0x13c0('0x9')](),controller[_0x13c0('0x18')]);router[_0x13c0('0x19')]('/:id',auth[_0x13c0('0x9')](),controller[_0x13c0('0x1a')]);router['delete'](_0x13c0('0x11'),auth[_0x13c0('0x9')](),controller[_0x13c0('0x1b')]);router[_0x13c0('0x19')](_0x13c0('0x1c'),auth[_0x13c0('0x9')](),controller[_0x13c0('0x1d')]);module[_0x13c0('0x1e')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 27066e1..b0aae81 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 _0x6afc=['rrmemory','beepall','roundrobin','sequelize','STRING','INTEGER'];(function(_0x12833b,_0x26c1d2){var _0x3acad3=function(_0x2f9ec9){while(--_0x2f9ec9){_0x12833b['push'](_0x12833b['shift']());}};_0x3acad3(++_0x26c1d2);}(_0x6afc,0x16b));var _0xc6af=function(_0x29d6f5,_0x3d3cfb){_0x29d6f5=_0x29d6f5-0x0;var _0x1c120c=_0x6afc[_0x29d6f5];return _0x1c120c;};'use strict';var Sequelize=require(_0xc6af('0x0'));module['exports']={'name':{'type':Sequelize[_0xc6af('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc6af('0x1')]},'timeout':{'type':Sequelize[_0xc6af('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xc6af('0x3'),_0xc6af('0x4'),_0xc6af('0x5'))}}; \ No newline at end of file +var _0x9ea6=['exports','INTEGER','ENUM','sequelize'];(function(_0x157793,_0x3ea83c){var _0x1f900d=function(_0x38881f){while(--_0x38881f){_0x157793['push'](_0x157793['shift']());}};_0x1f900d(++_0x3ea83c);}(_0x9ea6,0x15b));var _0x69ea=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x9ea6[_0x4b055c];return _0x4b62bb;};'use strict';var Sequelize=require(_0x69ea('0x0'));module[_0x69ea('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x69ea('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x69ea('0x3')]('rrmemory','beepall','roundrobin')}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index e79a8c8..795e98c 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 _0x5fb7=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','register','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','error','name','send','MailQueue','type','key','map','filters','query','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','intersection','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','MailQueues','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserMailQueue','MailQueueId','findAndCountAll','UserId','updatedAt','format','%s/%s','SIP','mailPause','createdAt','getTeams','findOne','Team','pick','addTeams','ids','Agents','voicePause','interface','flatMap','sequelize','findOrCreate','forEach','emit','removeTeams','User','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','transaction','isEmpty','removeAgents','addAgents','omit','spread','userMailQueue:save','isArray','userMailQueue:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis'];(function(_0x23d0a1,_0x5011a){var _0x1ef866=function(_0x5103d4){while(--_0x5103d4){_0x23d0a1['push'](_0x23d0a1['shift']());}};_0x1ef866(++_0x5011a);}(_0x5fb7,0x10c));var _0x75fb=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x5fb7[_0x3e5086];return _0xfeb102;};'use strict';var pdf=require(_0x75fb('0x0'));var emlformat=require(_0x75fb('0x1'));var rimraf=require(_0x75fb('0x2'));var zipdir=require(_0x75fb('0x3'));var jsonpatch=require(_0x75fb('0x4'));var rp=require('request-promise');var moment=require(_0x75fb('0x5'));var BPromise=require(_0x75fb('0x6'));var Mustache=require(_0x75fb('0x7'));var util=require('util');var path=require('path');var sox=require(_0x75fb('0x8'));var csv=require('to-csv');var ejs=require(_0x75fb('0x9'));var fs=require('fs');var _=require(_0x75fb('0xa'));var squel=require(_0x75fb('0xb'));var crypto=require('crypto');var jsforce=require(_0x75fb('0xc'));var deskjs=require(_0x75fb('0xd'));var toCsv=require(_0x75fb('0xe'));var querystring=require(_0x75fb('0xf'));var Papa=require(_0x75fb('0x10'));var Redis=require(_0x75fb('0x11'));var authService=require(_0x75fb('0x12'));var qs=require(_0x75fb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x75fb('0x14'));var logger=require(_0x75fb('0x15'))(_0x75fb('0x16'));var utils=require('../../config/utils');var config=require(_0x75fb('0x17'));var db=require(_0x75fb('0x18'))['db'];config['redis']=_[_0x75fb('0x19')](config['redis'],{'host':_0x75fb('0x1a'),'port':0x18eb});var socket=require(_0x75fb('0x1b'))(new Redis(config[_0x75fb('0x1c')]));require('./mailQueue.socket')[_0x75fb('0x1d')](socket);function respondWithStatusCode(_0xdf3fa1,_0x44542a){_0x44542a=_0x44542a||0xcc;return function(_0x34b072){if(_0x34b072){return _0xdf3fa1['sendStatus'](_0x44542a);}return _0xdf3fa1[_0x75fb('0x1e')](_0x44542a)[_0x75fb('0x1f')]();};}function respondWithResult(_0x3aaa65,_0x1a3304){_0x1a3304=_0x1a3304||0xc8;return function(_0x4179cf){if(_0x4179cf){return _0x3aaa65['status'](_0x1a3304)[_0x75fb('0x20')](_0x4179cf);}};}function respondWithFilteredResult(_0x548595,_0xe1717d){return function(_0x474d38){if(_0x474d38){var _0x1451bb=_0x474d38[_0x75fb('0x21')],_0x25d2ad=_0xe1717d[_0x75fb('0x22')],_0x8dd1f1=_0xe1717d[_0x75fb('0x22')]+_0xe1717d[_0x75fb('0x23')],_0x1aa4e3;if(_0x8dd1f1>=_0x1451bb){_0x8dd1f1=_0x1451bb;_0x1aa4e3=0xc8;}else{_0x1aa4e3=0xce;}_0x548595[_0x75fb('0x1e')](_0x1aa4e3);return _0x548595[_0x75fb('0x24')](_0x75fb('0x25'),_0x25d2ad+'-'+_0x8dd1f1+'/'+_0x1451bb)[_0x75fb('0x20')](_0x474d38);}return null;};}function patchUpdates(_0x3821d2){return function(_0x49bd0c){try{jsonpatch[_0x75fb('0x26')](_0x49bd0c,_0x3821d2,!![]);}catch(_0x1c9414){return BPromise['reject'](_0x1c9414);}return _0x49bd0c[_0x75fb('0x27')]();};}function saveUpdates(_0x2c69bc,_0x3eac1e){return function(_0x24a04e){if(_0x24a04e){return _0x24a04e[_0x75fb('0x28')](_0x2c69bc)[_0x75fb('0x29')](function(_0x3ed558){return _0x3ed558;});}return null;};}function removeEntity(_0x5fe0ba,_0xe94661){return function(_0x50f3ea){if(_0x50f3ea){return _0x50f3ea[_0x75fb('0x2a')]()[_0x75fb('0x29')](function(){var _0x410069=_0x50f3ea[_0x75fb('0x2b')]({'plain':!![]});var _0x33ce3f='MailQueues';return db['UserProfileResource']['destroy']({'where':{'type':_0x33ce3f,'resourceId':_0x410069['id']}})[_0x75fb('0x29')](function(){return _0x50f3ea;});})[_0x75fb('0x29')](function(){_0x5fe0ba[_0x75fb('0x1e')](0xcc)[_0x75fb('0x1f')]();});}};}function handleEntityNotFound(_0x2c87a1,_0x4a4df6){return function(_0x24db61){if(!_0x24db61){_0x2c87a1['sendStatus'](0x194);}return _0x24db61;};}function handleError(_0x23058f,_0x49954b){_0x49954b=_0x49954b||0x1f4;return function(_0x2daca0){logger[_0x75fb('0x2c')](_0x2daca0['stack']);if(_0x2daca0[_0x75fb('0x2d')]){delete _0x2daca0['name'];}_0x23058f['status'](_0x49954b)[_0x75fb('0x2e')](_0x2daca0);};}exports['index']=function(_0x4d9f1a,_0x308a0d){var _0x1f8eda={},_0x381f73={},_0x159f28={'count':0x0,'rows':[]};var _0x5a90be=_['map'](db[_0x75fb('0x2f')]['rawAttributes'],function(_0x2f191f){return{'name':_0x2f191f['fieldName'],'type':_0x2f191f[_0x75fb('0x30')][_0x75fb('0x31')]};});_0x381f73['model']=_[_0x75fb('0x32')](_0x5a90be,_0x75fb('0x2d'));_0x381f73['query']=_['keys'](_0x4d9f1a['query']);_0x381f73[_0x75fb('0x33')]=_['intersection'](_0x381f73['model'],_0x381f73[_0x75fb('0x34')]);_0x1f8eda[_0x75fb('0x35')]=_['intersection'](_0x381f73[_0x75fb('0x36')],qs[_0x75fb('0x37')](_0x4d9f1a['query'][_0x75fb('0x37')]));_0x1f8eda['attributes']=_0x1f8eda[_0x75fb('0x35')]['length']?_0x1f8eda[_0x75fb('0x35')]:_0x381f73[_0x75fb('0x36')];if(!_0x4d9f1a['query'][_0x75fb('0x38')](_0x75fb('0x39'))){_0x1f8eda[_0x75fb('0x23')]=qs[_0x75fb('0x23')](_0x4d9f1a[_0x75fb('0x34')][_0x75fb('0x23')]);_0x1f8eda[_0x75fb('0x22')]=qs[_0x75fb('0x22')](_0x4d9f1a[_0x75fb('0x34')][_0x75fb('0x22')]);}_0x1f8eda[_0x75fb('0x3a')]=qs['sort'](_0x4d9f1a['query'][_0x75fb('0x3b')]);_0x1f8eda[_0x75fb('0x3c')]=qs[_0x75fb('0x33')](_['pick'](_0x4d9f1a[_0x75fb('0x34')],_0x381f73['filters']));if(_0x4d9f1a[_0x75fb('0x34')]['filter']){_0x1f8eda[_0x75fb('0x3c')]=_[_0x75fb('0x3d')](_0x1f8eda[_0x75fb('0x3c')],{'$or':_[_0x75fb('0x32')](_0x5a90be,function(_0x439527){if(_0x439527[_0x75fb('0x30')]!==_0x75fb('0x3e')){var _0x30cb5f={};_0x30cb5f[_0x439527[_0x75fb('0x2d')]]={'$like':'%'+_0x4d9f1a['query'][_0x75fb('0x3f')]+'%'};return _0x30cb5f;}})});}_0x1f8eda=_[_0x75fb('0x3d')]({},_0x1f8eda,_0x4d9f1a[_0x75fb('0x40')]);var _0x43e21f={'where':_0x1f8eda[_0x75fb('0x3c')]};return db['MailQueue']['count'](_0x43e21f)['then'](function(_0x473b71){_0x159f28[_0x75fb('0x21')]=_0x473b71;if(_0x4d9f1a['query'][_0x75fb('0x41')]){_0x1f8eda[_0x75fb('0x42')]=[{'all':!![]}];}return db[_0x75fb('0x2f')][_0x75fb('0x43')](_0x1f8eda);})[_0x75fb('0x29')](function(_0x583ad5){_0x159f28[_0x75fb('0x44')]=_0x583ad5;return _0x159f28;})[_0x75fb('0x29')](respondWithFilteredResult(_0x308a0d,_0x1f8eda))[_0x75fb('0x45')](handleError(_0x308a0d,null));};exports['show']=function(_0x57031a,_0x5e4d70){var _0xe690e9={'raw':!![],'where':{'id':_0x57031a[_0x75fb('0x46')]['id']}},_0x206fac={};_0x206fac[_0x75fb('0x36')]=_[_0x75fb('0x47')](db[_0x75fb('0x2f')][_0x75fb('0x48')]);_0x206fac[_0x75fb('0x34')]=_[_0x75fb('0x47')](_0x57031a['query']);_0x206fac[_0x75fb('0x33')]=_[_0x75fb('0x49')](_0x206fac['model'],_0x206fac[_0x75fb('0x34')]);_0xe690e9[_0x75fb('0x35')]=_[_0x75fb('0x49')](_0x206fac[_0x75fb('0x36')],qs[_0x75fb('0x37')](_0x57031a['query'][_0x75fb('0x37')]));_0xe690e9[_0x75fb('0x35')]=_0xe690e9['attributes'][_0x75fb('0x4a')]?_0xe690e9[_0x75fb('0x35')]:_0x206fac['model'];if(_0x57031a['query']['includeAll']){_0xe690e9[_0x75fb('0x42')]=[{'all':!![]}];}_0xe690e9=_[_0x75fb('0x3d')]({},_0xe690e9,_0x57031a[_0x75fb('0x40')]);return db[_0x75fb('0x2f')][_0x75fb('0x4b')](_0xe690e9)['then'](handleEntityNotFound(_0x5e4d70,null))[_0x75fb('0x29')](respondWithResult(_0x5e4d70,null))[_0x75fb('0x45')](handleError(_0x5e4d70,null));};exports[_0x75fb('0x4c')]=function(_0x2a9e99,_0x229122){return db[_0x75fb('0x2f')]['create'](_0x2a9e99[_0x75fb('0x4d')],{})[_0x75fb('0x29')](function(_0x1df432){var _0x5b61a0=_0x2a9e99[_0x75fb('0x4e')][_0x75fb('0x2b')]({'plain':!![]});if(!_0x5b61a0)throw new Error(_0x75fb('0x4f'));if(_0x5b61a0['role']===_0x75fb('0x4e')){var _0x462c67=_0x1df432[_0x75fb('0x2b')]({'plain':!![]});var _0x3c0f5d=_0x75fb('0x50');return db[_0x75fb('0x51')][_0x75fb('0x4b')]({'where':{'name':_0x3c0f5d,'userProfileId':_0x5b61a0[_0x75fb('0x52')]},'raw':!![]})[_0x75fb('0x29')](function(_0x13d1d5){if(_0x13d1d5&&_0x13d1d5[_0x75fb('0x53')]===0x0){return db[_0x75fb('0x54')][_0x75fb('0x4c')]({'name':_0x462c67[_0x75fb('0x2d')],'resourceId':_0x462c67['id'],'type':_0x13d1d5['name'],'sectionId':_0x13d1d5['id']},{})[_0x75fb('0x29')](function(){return _0x1df432;});}else{return _0x1df432;}})[_0x75fb('0x45')](function(_0x147b04){logger[_0x75fb('0x2c')](_0x75fb('0x55'),_0x147b04);throw _0x147b04;});}return _0x1df432;})[_0x75fb('0x29')](respondWithResult(_0x229122,0xc9))['catch'](handleError(_0x229122,null));};exports['update']=function(_0x569b3c,_0x4b5414){if(_0x569b3c[_0x75fb('0x4d')]['id']){delete _0x569b3c['body']['id'];}return db[_0x75fb('0x2f')]['find']({'where':{'id':_0x569b3c[_0x75fb('0x46')]['id']}})[_0x75fb('0x29')](handleEntityNotFound(_0x4b5414,null))[_0x75fb('0x29')](saveUpdates(_0x569b3c[_0x75fb('0x4d')],null))[_0x75fb('0x29')](respondWithResult(_0x4b5414,null))[_0x75fb('0x45')](handleError(_0x4b5414,null));};exports[_0x75fb('0x2a')]=function(_0x641f0f,_0x356c8f){return db[_0x75fb('0x2f')][_0x75fb('0x4b')]({'where':{'id':_0x641f0f['params']['id']}})[_0x75fb('0x29')](handleEntityNotFound(_0x356c8f,null))[_0x75fb('0x29')](removeEntity(_0x356c8f,null))[_0x75fb('0x45')](handleError(_0x356c8f,null));};exports[_0x75fb('0x56')]=function(_0x2425ce,_0x703d64){return db[_0x75fb('0x2f')][_0x75fb('0x56')]()[_0x75fb('0x29')](respondWithResult(_0x703d64,null))[_0x75fb('0x45')](handleError(_0x703d64,null));};exports[_0x75fb('0x57')]=function(_0x44473b,_0x38fff9,_0x19985a){var _0x215e74={'raw':!![],'where':{}},_0x401dd6={},_0x9a08c9;return db[_0x75fb('0x2f')]['findOne']({'where':{'id':_0x44473b[_0x75fb('0x46')]['id']}})['then'](handleEntityNotFound(_0x38fff9,null))['then'](function(_0xabc502){if(_0xabc502){_0x9a08c9=_0xabc502['get']({'plain':!![]});_0x401dd6[_0x75fb('0x36')]=_[_0x75fb('0x47')](db[_0x75fb('0x58')][_0x75fb('0x48')]);_0x401dd6['query']=_[_0x75fb('0x47')](_0x44473b[_0x75fb('0x34')]);_0x401dd6[_0x75fb('0x33')]=_['intersection'](_0x401dd6[_0x75fb('0x36')],_0x401dd6[_0x75fb('0x34')]);_0x215e74[_0x75fb('0x35')]=_[_0x75fb('0x49')](_0x401dd6[_0x75fb('0x36')],qs[_0x75fb('0x37')](_0x44473b['query'][_0x75fb('0x37')]));_0x215e74[_0x75fb('0x35')]=_0x215e74[_0x75fb('0x35')][_0x75fb('0x4a')]?_0x215e74[_0x75fb('0x35')]:_0x401dd6['model'];if(!_0x44473b[_0x75fb('0x34')]['hasOwnProperty'](_0x75fb('0x39'))){_0x215e74['limit']=qs[_0x75fb('0x23')](_0x44473b[_0x75fb('0x34')][_0x75fb('0x23')]);_0x215e74['offset']=qs[_0x75fb('0x22')](_0x44473b[_0x75fb('0x34')][_0x75fb('0x22')]);}_0x215e74[_0x75fb('0x3a')]=qs[_0x75fb('0x3b')](_0x44473b['query']['sort']);_0x215e74[_0x75fb('0x3c')]=qs[_0x75fb('0x33')](_['pick'](_0x44473b[_0x75fb('0x34')],_0x401dd6[_0x75fb('0x33')]));_0x215e74[_0x75fb('0x3c')][_0x75fb('0x59')]=_0xabc502['id'];if(_0x44473b[_0x75fb('0x34')]['filter']){_0x215e74[_0x75fb('0x3c')]=_[_0x75fb('0x3d')](_0x215e74[_0x75fb('0x3c')],{'$or':_[_0x75fb('0x32')](_0x215e74[_0x75fb('0x35')],function(_0x90c5be){var _0xdb5c99={};_0xdb5c99[_0x90c5be]={'$like':'%'+_0x44473b[_0x75fb('0x34')][_0x75fb('0x3f')]+'%'};return _0xdb5c99;})});}_0x215e74=_[_0x75fb('0x3d')]({},_0x215e74,_0x44473b[_0x75fb('0x40')]);return db[_0x75fb('0x58')][_0x75fb('0x43')](_0x215e74);}})[_0x75fb('0x29')](function(_0x1fbd43){if(_0x1fbd43){return db['User'][_0x75fb('0x5a')]({'where':{'id':_[_0x75fb('0x32')](_0x1fbd43,_0x75fb('0x5b')),'role':'agent'},'attributes':['id',_0x75fb('0x2d'),'mailPause',_0x75fb('0x5c'),'createdAt']});}})[_0x75fb('0x29')](function(_0x49ca5e){if(_0x49ca5e){return{'count':_0x49ca5e[_0x75fb('0x21')],'rows':_[_0x75fb('0x32')](_0x49ca5e[_0x75fb('0x44')],function(_0x23605c){return{'membername':_0x23605c[_0x75fb('0x2d')],'UserId':_0x23605c['id'],'queue_name':_0x9a08c9[_0x75fb('0x2d')],'MailQueueId':_0x9a08c9['id'],'interface':util[_0x75fb('0x5d')](_0x75fb('0x5e'),_0x75fb('0x5f'),_0x23605c[_0x75fb('0x2d')]),'penalty':0x0,'paused':_0x23605c[_0x75fb('0x60')],'createdAt':_0x23605c[_0x75fb('0x61')],'updatedAt':_0x23605c[_0x75fb('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x75fb('0x29')](respondWithFilteredResult(_0x38fff9,_0x215e74))[_0x75fb('0x45')](handleError(_0x38fff9,null));};exports[_0x75fb('0x62')]=function(_0x363b56,_0x97bf69,_0x12fac8){var _0x357e50={};var _0x4ac6d0={};var _0x5f2195;var _0x567cb0;return db[_0x75fb('0x2f')][_0x75fb('0x63')]({'where':{'id':_0x363b56[_0x75fb('0x46')]['id']}})[_0x75fb('0x29')](handleEntityNotFound(_0x97bf69,null))[_0x75fb('0x29')](function(_0xe5a638){if(_0xe5a638){_0x5f2195=_0xe5a638;_0x4ac6d0['model']=_[_0x75fb('0x47')](db[_0x75fb('0x64')][_0x75fb('0x48')]);_0x4ac6d0[_0x75fb('0x34')]=_[_0x75fb('0x47')](_0x363b56[_0x75fb('0x34')]);_0x4ac6d0[_0x75fb('0x33')]=_[_0x75fb('0x49')](_0x4ac6d0[_0x75fb('0x36')],_0x4ac6d0[_0x75fb('0x34')]);_0x357e50[_0x75fb('0x35')]=_['intersection'](_0x4ac6d0[_0x75fb('0x36')],qs[_0x75fb('0x37')](_0x363b56[_0x75fb('0x34')]['fields']));_0x357e50[_0x75fb('0x35')]=_0x357e50[_0x75fb('0x35')][_0x75fb('0x4a')]?_0x357e50[_0x75fb('0x35')]:_0x4ac6d0['model'];_0x357e50[_0x75fb('0x3a')]=qs[_0x75fb('0x3b')](_0x363b56[_0x75fb('0x34')][_0x75fb('0x3b')]);_0x357e50[_0x75fb('0x3c')]=qs[_0x75fb('0x33')](_[_0x75fb('0x65')](_0x363b56[_0x75fb('0x34')],_0x4ac6d0[_0x75fb('0x33')]));if(_0x363b56['query'][_0x75fb('0x3f')]){_0x357e50[_0x75fb('0x3c')]=_[_0x75fb('0x3d')](_0x357e50[_0x75fb('0x3c')],{'$or':_['map'](_0x357e50['attributes'],function(_0x3cc0cd){var _0x2aebd5={};_0x2aebd5[_0x3cc0cd]={'$like':'%'+_0x363b56[_0x75fb('0x34')]['filter']+'%'};return _0x2aebd5;})});}_0x357e50=_['merge']({},_0x357e50,_0x363b56['options']);return _0x5f2195[_0x75fb('0x62')](_0x357e50);}})['then'](function(_0x452bf2){if(_0x452bf2){_0x567cb0=_0x452bf2[_0x75fb('0x4a')];if(!_0x363b56[_0x75fb('0x34')][_0x75fb('0x38')]('nolimit')){_0x357e50[_0x75fb('0x23')]=qs['limit'](_0x363b56[_0x75fb('0x34')]['limit']);_0x357e50[_0x75fb('0x22')]=qs[_0x75fb('0x22')](_0x363b56[_0x75fb('0x34')][_0x75fb('0x22')]);}return _0x5f2195[_0x75fb('0x62')](_0x357e50);}})['then'](function(_0x4adbd2){if(_0x4adbd2){return _0x4adbd2?{'count':_0x567cb0,'rows':_0x4adbd2}:null;}})[_0x75fb('0x29')](respondWithResult(_0x97bf69,null))[_0x75fb('0x45')](handleError(_0x97bf69,null));};exports[_0x75fb('0x66')]=function(_0x188818,_0x334e85,_0x450ab1){var _0xd063de=_0x188818[_0x75fb('0x4d')][_0x75fb('0x67')];return db[_0x75fb('0x64')]['findAll']({'where':{'id':_0xd063de},'attributes':['id'],'include':[{'model':db['User'],'as':_0x75fb('0x68'),'attributes':['id',_0x75fb('0x2d'),'online',_0x75fb('0x69'),_0x75fb('0x6a')],'raw':!![]}]})[_0x75fb('0x29')](function(_0x8e5b39){if(_0x8e5b39){var _0x3bb303=_[_0x75fb('0x6b')](_0x8e5b39,function(_0x375279){var _0x4fb8f4=_0x375279[_0x75fb('0x2b')]({'plain':!![]});return _0x4fb8f4[_0x75fb('0x68')];});return db[_0x75fb('0x2f')]['find']({'where':{'id':_0x188818[_0x75fb('0x46')]['id']}})[_0x75fb('0x29')](function(_0x3b7f2f){return db[_0x75fb('0x6c')]['transaction'](function(_0x1937a5){return _0x3b7f2f[_0x75fb('0x66')](_0xd063de,{'transaction':_0x1937a5})[_0x75fb('0x29')](function(){return BPromise['each'](_0x3bb303,function(_0x28c140){return db[_0x75fb('0x58')][_0x75fb('0x6d')]({'where':{'UserId':_0x28c140['id'],'MailQueueId':_0x188818['params']['id']},'transaction':_0x1937a5});});})[_0x75fb('0x29')](function(){_0x3bb303[_0x75fb('0x6e')](function(_0x3634af){socket[_0x75fb('0x6f')]('userMailQueue:save',{'UserId':_0x3634af['id'],'MailQueueId':_0x3b7f2f['id']});});});});});}})[_0x75fb('0x29')](respondWithStatusCode(_0x334e85,null))[_0x75fb('0x45')](handleError(_0x334e85,null));};exports[_0x75fb('0x70')]=function(_0x1b76b4,_0x1717ff,_0x56fa71){return db[_0x75fb('0x64')][_0x75fb('0x43')]({'where':{'id':_0x1b76b4[_0x75fb('0x34')][_0x75fb('0x67')]},'attributes':['id'],'include':[{'model':db[_0x75fb('0x71')],'as':_0x75fb('0x68'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1717ff,null))[_0x75fb('0x29')](function(_0xb79ca4){var _0x5c88e7=_[_0x75fb('0x32')](_0xb79ca4,'id');var _0x411c1a=[];var _0xf164ee=[];var _0x5883ae=squel[_0x75fb('0x72')]();_0x5883ae[_0x75fb('0x73')](_0x75fb('0x74'))[_0x75fb('0x75')](_0x75fb('0x76'),'tq')[_0x75fb('0x77')](_0x75fb('0x78'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x75fb('0x3c')]('MailQueueId\x20=\x20?',_0x1b76b4[_0x75fb('0x46')]['id']);for(var _0x48f2f9=0x0;_0x48f2f9<_0xb79ca4[_0x75fb('0x4a')];_0x48f2f9+=0x1){let _0x74d20e=_0xb79ca4[_0x48f2f9];for(var _0x4102dc=0x0;_0x4102dc<_0x74d20e[_0x75fb('0x68')]['length'];_0x4102dc+=0x1){let _0x208ff2=_0x74d20e['Agents'][_0x4102dc];var _0x41e88a=_0x5883ae[_0x75fb('0x79')]();_0x41e88a[_0x75fb('0x3c')](_0x75fb('0x7a'),_0x208ff2['id']);_0xf164ee['push'](db[_0x75fb('0x6c')]['query'](_0x41e88a[_0x75fb('0x7b')](),{'type':db[_0x75fb('0x6c')][_0x75fb('0x7c')][_0x75fb('0x7d')]})[_0x75fb('0x29')](function(_0x37d3ed){if(_0x37d3ed['length']===0x1){return _0x208ff2['id'];}else{var _0x3d2071=_[_0x75fb('0x7e')](_[_0x75fb('0x32')](_0x37d3ed,_0x75fb('0x7f')),function(_0x4cfd58){return _[_0x75fb('0x80')](_0x5c88e7,_0x4cfd58);});if(_0x3d2071){return _0x208ff2['id'];}}}));}}return BPromise[_0x75fb('0x81')](_0xf164ee)['then'](function(_0x86325){_0x411c1a=_(_0x411c1a)[_0x75fb('0x82')](_0x86325)[_0x75fb('0x83')]()[_0x75fb('0x84')]();return db[_0x75fb('0x2f')][_0x75fb('0x4b')]({'where':{'id':_0x1b76b4['params']['id']}})['then'](function(_0x58954b){return db[_0x75fb('0x6c')][_0x75fb('0x85')](function(_0x1ee6a8){return _0x58954b[_0x75fb('0x70')](_0x1b76b4[_0x75fb('0x34')][_0x75fb('0x67')],{'transaction':_0x1ee6a8})[_0x75fb('0x29')](function(){if(!_[_0x75fb('0x86')](_0x411c1a)){return _0x58954b[_0x75fb('0x87')](_0x411c1a,{'transaction':_0x1ee6a8});}})[_0x75fb('0x29')](function(){_0x411c1a[_0x75fb('0x6e')](function(_0x3d672b){socket[_0x75fb('0x6f')]('userMailQueue:remove',{'UserId':_0x3d672b,'MailQueueId':_0x58954b['id']});});});});});});})[_0x75fb('0x29')](respondWithStatusCode(_0x1717ff,null))['catch'](handleError(_0x1717ff,null));};exports['addAgents']=function(_0x187048,_0x1429f8,_0x3b1939){return db[_0x75fb('0x2f')]['find']({'where':{'id':_0x187048[_0x75fb('0x46')]['id']}})[_0x75fb('0x29')](handleEntityNotFound(_0x1429f8,null))[_0x75fb('0x29')](function(_0x12efa4){if(_0x12efa4){return _0x12efa4[_0x75fb('0x88')](_0x187048[_0x75fb('0x4d')][_0x75fb('0x67')],_[_0x75fb('0x89')](_0x187048[_0x75fb('0x4d')],[_0x75fb('0x67'),'id'])||{})[_0x75fb('0x8a')](function(_0x4541a9){for(var _0x2514e6=0x0;_0x2514e6<_0x187048[_0x75fb('0x4d')][_0x75fb('0x67')][_0x75fb('0x4a')];_0x2514e6+=0x1){socket[_0x75fb('0x6f')](_0x75fb('0x8b'),{'UserId':_0x187048[_0x75fb('0x4d')][_0x75fb('0x67')][_0x2514e6],'MailQueueId':_0x187048[_0x75fb('0x46')]['id']});}return _0x4541a9;});}})['then'](respondWithResult(_0x1429f8,null))[_0x75fb('0x45')](handleError(_0x1429f8,null));};exports['removeAgents']=function(_0x3942c8,_0x537be7,_0x426d03){return db[_0x75fb('0x2f')][_0x75fb('0x4b')]({'where':{'id':_0x3942c8[_0x75fb('0x46')]['id']}})['then'](handleEntityNotFound(_0x537be7,null))[_0x75fb('0x29')](function(_0x143c29){if(_0x143c29){return _0x143c29[_0x75fb('0x87')](_0x3942c8[_0x75fb('0x34')][_0x75fb('0x67')])[_0x75fb('0x29')](function(){if(_[_0x75fb('0x8c')](_0x3942c8['query'][_0x75fb('0x67')])){for(var _0xb858ea=0x0;_0xb858ea<_0x3942c8[_0x75fb('0x34')][_0x75fb('0x67')][_0x75fb('0x4a')];_0xb858ea+=0x1){socket['emit'](_0x75fb('0x8d'),{'UserId':Number(_0x3942c8[_0x75fb('0x34')][_0x75fb('0x67')][_0xb858ea]),'MailQueueId':Number(_0x3942c8[_0x75fb('0x46')]['id'])});}}else{socket['emit'](_0x75fb('0x8d'),{'UserId':Number(_0x3942c8['query']['ids']),'MailQueueId':Number(_0x3942c8[_0x75fb('0x46')]['id'])});}});}})[_0x75fb('0x29')](respondWithStatusCode(_0x537be7,null))['catch'](handleError(_0x537be7,null));};exports[_0x75fb('0x8e')]=function(_0x3443d7,_0x394fce,_0x75f400){var _0x520066={};var _0x56309d={};var _0x46daac;var _0x475b28;return db[_0x75fb('0x2f')][_0x75fb('0x63')]({'where':{'id':_0x3443d7[_0x75fb('0x46')]['id']}})['then'](handleEntityNotFound(_0x394fce,null))[_0x75fb('0x29')](function(_0x404bc2){if(_0x404bc2){_0x46daac=_0x404bc2;_0x56309d[_0x75fb('0x36')]=_[_0x75fb('0x47')](db[_0x75fb('0x71')][_0x75fb('0x48')]);_0x56309d[_0x75fb('0x34')]=_[_0x75fb('0x47')](_0x3443d7[_0x75fb('0x34')]);_0x56309d[_0x75fb('0x33')]=_[_0x75fb('0x49')](_0x56309d[_0x75fb('0x36')],_0x56309d[_0x75fb('0x34')]);_0x520066[_0x75fb('0x35')]=_[_0x75fb('0x49')](_0x56309d[_0x75fb('0x36')],qs[_0x75fb('0x37')](_0x3443d7[_0x75fb('0x34')]['fields']));_0x520066['attributes']=_0x520066[_0x75fb('0x35')][_0x75fb('0x4a')]?_0x520066[_0x75fb('0x35')]:_0x56309d[_0x75fb('0x36')];_0x520066[_0x75fb('0x3a')]=qs[_0x75fb('0x3b')](_0x3443d7[_0x75fb('0x34')][_0x75fb('0x3b')]);_0x520066['where']=qs[_0x75fb('0x33')](_[_0x75fb('0x65')](_0x3443d7[_0x75fb('0x34')],_0x56309d[_0x75fb('0x33')]));if(_0x3443d7[_0x75fb('0x34')][_0x75fb('0x3f')]){_0x520066[_0x75fb('0x3c')]=_[_0x75fb('0x3d')](_0x520066['where'],{'$or':_['map'](_0x520066['attributes'],function(_0x364566){var _0x13d593={};_0x13d593[_0x364566]={'$like':'%'+_0x3443d7[_0x75fb('0x34')]['filter']+'%'};return _0x13d593;})});}_0x520066=_[_0x75fb('0x3d')]({},_0x520066,_0x3443d7[_0x75fb('0x40')]);return _0x46daac[_0x75fb('0x8e')](_0x520066);}})[_0x75fb('0x29')](function(_0x24cd3e){if(_0x24cd3e){_0x475b28=_0x24cd3e[_0x75fb('0x4a')];if(!_0x3443d7['query'][_0x75fb('0x38')](_0x75fb('0x39'))){_0x520066['limit']=qs[_0x75fb('0x23')](_0x3443d7[_0x75fb('0x34')][_0x75fb('0x23')]);_0x520066[_0x75fb('0x22')]=qs['offset'](_0x3443d7['query'][_0x75fb('0x22')]);}return _0x46daac[_0x75fb('0x8e')](_0x520066);}})['then'](function(_0x4cbdda){if(_0x4cbdda){return _0x4cbdda?{'count':_0x475b28,'rows':_0x4cbdda}:null;}})[_0x75fb('0x29')](respondWithResult(_0x394fce,null))[_0x75fb('0x45')](handleError(_0x394fce,null));}; \ No newline at end of file +var _0x68a6=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','MailQueues','UserProfileSection','autoAssociation','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','order','MailQueueId','UserMailQueue','UserId','agent','createdAt','%s/%s','SIP','mailPause','updatedAt','getTeams','Team','User','Agents','online','interface','transaction','addTeams','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','userMailQueue:remove','addAgents','ids','omit','isArray','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','register','status','json','count','offset','limit','Content-Range','apply','reject','save','destroy','then','get','end','sendStatus','error','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','show','params','keys','find','create','body','user'];(function(_0xdaab62,_0x2728ab){var _0x13d767=function(_0x14bf14){while(--_0x14bf14){_0xdaab62['push'](_0xdaab62['shift']());}};_0x13d767(++_0x2728ab);}(_0x68a6,0x160));var _0x668a=function(_0xd73859,_0x576b5d){_0xd73859=_0xd73859-0x0;var _0x362748=_0x68a6[_0xd73859];return _0x362748;};'use strict';var pdf=require(_0x668a('0x0'));var emlformat=require(_0x668a('0x1'));var rimraf=require(_0x668a('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x668a('0x3'));var rp=require(_0x668a('0x4'));var moment=require(_0x668a('0x5'));var BPromise=require(_0x668a('0x6'));var Mustache=require('mustache');var util=require(_0x668a('0x7'));var path=require('path');var sox=require(_0x668a('0x8'));var csv=require('to-csv');var ejs=require(_0x668a('0x9'));var fs=require('fs');var _=require(_0x668a('0xa'));var squel=require(_0x668a('0xb'));var crypto=require(_0x668a('0xc'));var jsforce=require(_0x668a('0xd'));var deskjs=require(_0x668a('0xe'));var toCsv=require(_0x668a('0xf'));var querystring=require(_0x668a('0x10'));var Papa=require(_0x668a('0x11'));var Redis=require(_0x668a('0x12'));var authService=require(_0x668a('0x13'));var qs=require(_0x668a('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x668a('0x15'));var logger=require('../../config/logger')(_0x668a('0x16'));var utils=require('../../config/utils');var config=require(_0x668a('0x17'));var db=require(_0x668a('0x18'))['db'];config['redis']=_[_0x668a('0x19')](config[_0x668a('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x668a('0x1b'))(new Redis(config[_0x668a('0x1a')]));require('./mailQueue.socket')[_0x668a('0x1c')](socket);function respondWithStatusCode(_0x155d09,_0x114380){_0x114380=_0x114380||0xcc;return function(_0x74dd3d){if(_0x74dd3d){return _0x155d09['sendStatus'](_0x114380);}return _0x155d09[_0x668a('0x1d')](_0x114380)['end']();};}function respondWithResult(_0x2717fb,_0x22afda){_0x22afda=_0x22afda||0xc8;return function(_0x3b7f7a){if(_0x3b7f7a){return _0x2717fb['status'](_0x22afda)[_0x668a('0x1e')](_0x3b7f7a);}};}function respondWithFilteredResult(_0x2b571d,_0x58b841){return function(_0x7c714a){if(_0x7c714a){var _0x48c916=_0x7c714a[_0x668a('0x1f')],_0x44de3a=_0x58b841[_0x668a('0x20')],_0xebdb8c=_0x58b841[_0x668a('0x20')]+_0x58b841[_0x668a('0x21')],_0x1f334c;if(_0xebdb8c>=_0x48c916){_0xebdb8c=_0x48c916;_0x1f334c=0xc8;}else{_0x1f334c=0xce;}_0x2b571d[_0x668a('0x1d')](_0x1f334c);return _0x2b571d['set'](_0x668a('0x22'),_0x44de3a+'-'+_0xebdb8c+'/'+_0x48c916)[_0x668a('0x1e')](_0x7c714a);}return null;};}function patchUpdates(_0x47e59a){return function(_0x1d64cb){try{jsonpatch[_0x668a('0x23')](_0x1d64cb,_0x47e59a,!![]);}catch(_0x3f3b05){return BPromise[_0x668a('0x24')](_0x3f3b05);}return _0x1d64cb[_0x668a('0x25')]();};}function saveUpdates(_0x58138c,_0x3c303b){return function(_0x506cf5){if(_0x506cf5){return _0x506cf5['update'](_0x58138c)['then'](function(_0x1caed7){return _0x1caed7;});}return null;};}function removeEntity(_0x8fa7e4,_0x4ad4ab){return function(_0x11e6f2){if(_0x11e6f2){return _0x11e6f2[_0x668a('0x26')]()[_0x668a('0x27')](function(){var _0x3fd12c=_0x11e6f2[_0x668a('0x28')]({'plain':!![]});var _0xec9b1c='MailQueues';return db['UserProfileResource'][_0x668a('0x26')]({'where':{'type':_0xec9b1c,'resourceId':_0x3fd12c['id']}})[_0x668a('0x27')](function(){return _0x11e6f2;});})[_0x668a('0x27')](function(){_0x8fa7e4['status'](0xcc)[_0x668a('0x29')]();});}};}function handleEntityNotFound(_0x1184d7,_0x3e3775){return function(_0x742e17){if(!_0x742e17){_0x1184d7[_0x668a('0x2a')](0x194);}return _0x742e17;};}function handleError(_0x34ebbb,_0x48df06){_0x48df06=_0x48df06||0x1f4;return function(_0xe96893){logger[_0x668a('0x2b')](_0xe96893[_0x668a('0x2c')]);if(_0xe96893[_0x668a('0x2d')]){delete _0xe96893[_0x668a('0x2d')];}_0x34ebbb[_0x668a('0x1d')](_0x48df06)[_0x668a('0x2e')](_0xe96893);};}exports[_0x668a('0x2f')]=function(_0x5e9ae6,_0x25f7f6){var _0x59a3ff={},_0x59156a={},_0x35097e={'count':0x0,'rows':[]};var _0x3d50f7=_[_0x668a('0x30')](db[_0x668a('0x31')][_0x668a('0x32')],function(_0x334173){return{'name':_0x334173[_0x668a('0x33')],'type':_0x334173['type'][_0x668a('0x34')]};});_0x59156a[_0x668a('0x35')]=_[_0x668a('0x30')](_0x3d50f7,_0x668a('0x2d'));_0x59156a[_0x668a('0x36')]=_['keys'](_0x5e9ae6[_0x668a('0x36')]);_0x59156a[_0x668a('0x37')]=_['intersection'](_0x59156a[_0x668a('0x35')],_0x59156a[_0x668a('0x36')]);_0x59a3ff[_0x668a('0x38')]=_[_0x668a('0x39')](_0x59156a[_0x668a('0x35')],qs[_0x668a('0x3a')](_0x5e9ae6[_0x668a('0x36')][_0x668a('0x3a')]));_0x59a3ff[_0x668a('0x38')]=_0x59a3ff[_0x668a('0x38')][_0x668a('0x3b')]?_0x59a3ff[_0x668a('0x38')]:_0x59156a[_0x668a('0x35')];if(!_0x5e9ae6[_0x668a('0x36')][_0x668a('0x3c')](_0x668a('0x3d'))){_0x59a3ff[_0x668a('0x21')]=qs[_0x668a('0x21')](_0x5e9ae6[_0x668a('0x36')][_0x668a('0x21')]);_0x59a3ff[_0x668a('0x20')]=qs[_0x668a('0x20')](_0x5e9ae6[_0x668a('0x36')]['offset']);}_0x59a3ff['order']=qs[_0x668a('0x3e')](_0x5e9ae6[_0x668a('0x36')][_0x668a('0x3e')]);_0x59a3ff[_0x668a('0x3f')]=qs['filters'](_[_0x668a('0x40')](_0x5e9ae6[_0x668a('0x36')],_0x59156a[_0x668a('0x37')]));if(_0x5e9ae6['query'][_0x668a('0x41')]){_0x59a3ff[_0x668a('0x3f')]=_[_0x668a('0x42')](_0x59a3ff[_0x668a('0x3f')],{'$or':_[_0x668a('0x30')](_0x3d50f7,function(_0x4cb73f){if(_0x4cb73f[_0x668a('0x43')]!=='VIRTUAL'){var _0x3044a7={};_0x3044a7[_0x4cb73f[_0x668a('0x2d')]]={'$like':'%'+_0x5e9ae6['query'][_0x668a('0x41')]+'%'};return _0x3044a7;}})});}_0x59a3ff=_[_0x668a('0x42')]({},_0x59a3ff,_0x5e9ae6[_0x668a('0x44')]);var _0x166c5d={'where':_0x59a3ff['where']};return db[_0x668a('0x31')][_0x668a('0x1f')](_0x166c5d)['then'](function(_0x30ab46){_0x35097e[_0x668a('0x1f')]=_0x30ab46;if(_0x5e9ae6[_0x668a('0x36')][_0x668a('0x45')]){_0x59a3ff[_0x668a('0x46')]=[{'all':!![]}];}return db[_0x668a('0x31')][_0x668a('0x47')](_0x59a3ff);})['then'](function(_0x411680){_0x35097e[_0x668a('0x48')]=_0x411680;return _0x35097e;})[_0x668a('0x27')](respondWithFilteredResult(_0x25f7f6,_0x59a3ff))['catch'](handleError(_0x25f7f6,null));};exports[_0x668a('0x49')]=function(_0xa28a74,_0x5a575a){var _0x37d0da={'raw':!![],'where':{'id':_0xa28a74[_0x668a('0x4a')]['id']}},_0x24addb={};_0x24addb[_0x668a('0x35')]=_[_0x668a('0x4b')](db[_0x668a('0x31')][_0x668a('0x32')]);_0x24addb[_0x668a('0x36')]=_[_0x668a('0x4b')](_0xa28a74[_0x668a('0x36')]);_0x24addb[_0x668a('0x37')]=_['intersection'](_0x24addb[_0x668a('0x35')],_0x24addb[_0x668a('0x36')]);_0x37d0da[_0x668a('0x38')]=_[_0x668a('0x39')](_0x24addb[_0x668a('0x35')],qs[_0x668a('0x3a')](_0xa28a74[_0x668a('0x36')]['fields']));_0x37d0da[_0x668a('0x38')]=_0x37d0da[_0x668a('0x38')][_0x668a('0x3b')]?_0x37d0da[_0x668a('0x38')]:_0x24addb[_0x668a('0x35')];if(_0xa28a74[_0x668a('0x36')][_0x668a('0x45')]){_0x37d0da[_0x668a('0x46')]=[{'all':!![]}];}_0x37d0da=_[_0x668a('0x42')]({},_0x37d0da,_0xa28a74['options']);return db[_0x668a('0x31')][_0x668a('0x4c')](_0x37d0da)[_0x668a('0x27')](handleEntityNotFound(_0x5a575a,null))[_0x668a('0x27')](respondWithResult(_0x5a575a,null))['catch'](handleError(_0x5a575a,null));};exports[_0x668a('0x4d')]=function(_0x4985e8,_0x4945d4){return db[_0x668a('0x31')][_0x668a('0x4d')](_0x4985e8[_0x668a('0x4e')],{})[_0x668a('0x27')](function(_0x1f4dff){var _0x328d57=_0x4985e8[_0x668a('0x4f')][_0x668a('0x28')]({'plain':!![]});if(!_0x328d57)throw new Error(_0x668a('0x50'));if(_0x328d57[_0x668a('0x51')]===_0x668a('0x4f')){var _0xe2c72e=_0x1f4dff[_0x668a('0x28')]({'plain':!![]});var _0x5918f5=_0x668a('0x52');return db[_0x668a('0x53')][_0x668a('0x4c')]({'where':{'name':_0x5918f5,'userProfileId':_0x328d57['userProfileId']},'raw':!![]})[_0x668a('0x27')](function(_0x3722c7){if(_0x3722c7&&_0x3722c7[_0x668a('0x54')]===0x0){return db[_0x668a('0x55')][_0x668a('0x4d')]({'name':_0xe2c72e[_0x668a('0x2d')],'resourceId':_0xe2c72e['id'],'type':_0x3722c7[_0x668a('0x2d')],'sectionId':_0x3722c7['id']},{})['then'](function(){return _0x1f4dff;});}else{return _0x1f4dff;}})[_0x668a('0x56')](function(_0x1a4f75){logger['error'](_0x668a('0x57'),_0x1a4f75);throw _0x1a4f75;});}return _0x1f4dff;})[_0x668a('0x27')](respondWithResult(_0x4945d4,0xc9))[_0x668a('0x56')](handleError(_0x4945d4,null));};exports['update']=function(_0x521640,_0x12ed59){if(_0x521640[_0x668a('0x4e')]['id']){delete _0x521640[_0x668a('0x4e')]['id'];}return db[_0x668a('0x31')][_0x668a('0x4c')]({'where':{'id':_0x521640[_0x668a('0x4a')]['id']}})[_0x668a('0x27')](handleEntityNotFound(_0x12ed59,null))[_0x668a('0x27')](saveUpdates(_0x521640[_0x668a('0x4e')],null))[_0x668a('0x27')](respondWithResult(_0x12ed59,null))[_0x668a('0x56')](handleError(_0x12ed59,null));};exports[_0x668a('0x26')]=function(_0x3bbcda,_0x265162){return db['MailQueue'][_0x668a('0x4c')]({'where':{'id':_0x3bbcda[_0x668a('0x4a')]['id']}})['then'](handleEntityNotFound(_0x265162,null))[_0x668a('0x27')](removeEntity(_0x265162,null))['catch'](handleError(_0x265162,null));};exports[_0x668a('0x58')]=function(_0x4f7c97,_0x237d89){return db[_0x668a('0x31')]['describe']()[_0x668a('0x27')](respondWithResult(_0x237d89,null))[_0x668a('0x56')](handleError(_0x237d89,null));};exports[_0x668a('0x59')]=function(_0x2eb739,_0x1b2ee1,_0x3d12d1){var _0x14d497={'raw':!![],'where':{}},_0x3d2c30={},_0x3a558e;return db['MailQueue'][_0x668a('0x5a')]({'where':{'id':_0x2eb739[_0x668a('0x4a')]['id']}})[_0x668a('0x27')](handleEntityNotFound(_0x1b2ee1,null))[_0x668a('0x27')](function(_0x84c510){if(_0x84c510){_0x3a558e=_0x84c510[_0x668a('0x28')]({'plain':!![]});_0x3d2c30[_0x668a('0x35')]=_[_0x668a('0x4b')](db['UserMailQueue']['rawAttributes']);_0x3d2c30[_0x668a('0x36')]=_[_0x668a('0x4b')](_0x2eb739['query']);_0x3d2c30[_0x668a('0x37')]=_['intersection'](_0x3d2c30[_0x668a('0x35')],_0x3d2c30['query']);_0x14d497[_0x668a('0x38')]=_[_0x668a('0x39')](_0x3d2c30['model'],qs[_0x668a('0x3a')](_0x2eb739[_0x668a('0x36')][_0x668a('0x3a')]));_0x14d497[_0x668a('0x38')]=_0x14d497[_0x668a('0x38')]['length']?_0x14d497[_0x668a('0x38')]:_0x3d2c30[_0x668a('0x35')];if(!_0x2eb739['query'][_0x668a('0x3c')](_0x668a('0x3d'))){_0x14d497['limit']=qs[_0x668a('0x21')](_0x2eb739[_0x668a('0x36')]['limit']);_0x14d497[_0x668a('0x20')]=qs[_0x668a('0x20')](_0x2eb739['query'][_0x668a('0x20')]);}_0x14d497[_0x668a('0x5b')]=qs[_0x668a('0x3e')](_0x2eb739[_0x668a('0x36')][_0x668a('0x3e')]);_0x14d497[_0x668a('0x3f')]=qs[_0x668a('0x37')](_[_0x668a('0x40')](_0x2eb739[_0x668a('0x36')],_0x3d2c30[_0x668a('0x37')]));_0x14d497[_0x668a('0x3f')][_0x668a('0x5c')]=_0x84c510['id'];if(_0x2eb739[_0x668a('0x36')][_0x668a('0x41')]){_0x14d497[_0x668a('0x3f')]=_[_0x668a('0x42')](_0x14d497[_0x668a('0x3f')],{'$or':_[_0x668a('0x30')](_0x14d497[_0x668a('0x38')],function(_0x109e2d){var _0x167950={};_0x167950[_0x109e2d]={'$like':'%'+_0x2eb739[_0x668a('0x36')][_0x668a('0x41')]+'%'};return _0x167950;})});}_0x14d497=_[_0x668a('0x42')]({},_0x14d497,_0x2eb739[_0x668a('0x44')]);return db[_0x668a('0x5d')]['findAll'](_0x14d497);}})[_0x668a('0x27')](function(_0x550cd7){if(_0x550cd7){return db['User']['findAndCountAll']({'where':{'id':_[_0x668a('0x30')](_0x550cd7,_0x668a('0x5e')),'role':_0x668a('0x5f')},'attributes':['id',_0x668a('0x2d'),'mailPause','updatedAt',_0x668a('0x60')]});}})[_0x668a('0x27')](function(_0x5bc603){if(_0x5bc603){return{'count':_0x5bc603[_0x668a('0x1f')],'rows':_['map'](_0x5bc603['rows'],function(_0x28f7d1){return{'membername':_0x28f7d1[_0x668a('0x2d')],'UserId':_0x28f7d1['id'],'queue_name':_0x3a558e[_0x668a('0x2d')],'MailQueueId':_0x3a558e['id'],'interface':util['format'](_0x668a('0x61'),_0x668a('0x62'),_0x28f7d1['name']),'penalty':0x0,'paused':_0x28f7d1[_0x668a('0x63')],'createdAt':_0x28f7d1[_0x668a('0x60')],'updatedAt':_0x28f7d1[_0x668a('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x1b2ee1,_0x14d497))[_0x668a('0x56')](handleError(_0x1b2ee1,null));};exports[_0x668a('0x65')]=function(_0x43d10d,_0x37a2f4,_0x526019){var _0x1893b2={};var _0x50def9={};var _0x5e7e04;var _0x456ac3;return db[_0x668a('0x31')][_0x668a('0x5a')]({'where':{'id':_0x43d10d[_0x668a('0x4a')]['id']}})[_0x668a('0x27')](handleEntityNotFound(_0x37a2f4,null))[_0x668a('0x27')](function(_0xafdafa){if(_0xafdafa){_0x5e7e04=_0xafdafa;_0x50def9['model']=_['keys'](db[_0x668a('0x66')][_0x668a('0x32')]);_0x50def9[_0x668a('0x36')]=_[_0x668a('0x4b')](_0x43d10d['query']);_0x50def9['filters']=_[_0x668a('0x39')](_0x50def9[_0x668a('0x35')],_0x50def9[_0x668a('0x36')]);_0x1893b2[_0x668a('0x38')]=_['intersection'](_0x50def9[_0x668a('0x35')],qs[_0x668a('0x3a')](_0x43d10d['query'][_0x668a('0x3a')]));_0x1893b2[_0x668a('0x38')]=_0x1893b2['attributes'][_0x668a('0x3b')]?_0x1893b2[_0x668a('0x38')]:_0x50def9[_0x668a('0x35')];_0x1893b2['order']=qs[_0x668a('0x3e')](_0x43d10d[_0x668a('0x36')][_0x668a('0x3e')]);_0x1893b2[_0x668a('0x3f')]=qs['filters'](_[_0x668a('0x40')](_0x43d10d[_0x668a('0x36')],_0x50def9[_0x668a('0x37')]));if(_0x43d10d[_0x668a('0x36')][_0x668a('0x41')]){_0x1893b2[_0x668a('0x3f')]=_[_0x668a('0x42')](_0x1893b2[_0x668a('0x3f')],{'$or':_['map'](_0x1893b2[_0x668a('0x38')],function(_0x3bad82){var _0x41b5d2={};_0x41b5d2[_0x3bad82]={'$like':'%'+_0x43d10d[_0x668a('0x36')][_0x668a('0x41')]+'%'};return _0x41b5d2;})});}_0x1893b2=_['merge']({},_0x1893b2,_0x43d10d['options']);return _0x5e7e04[_0x668a('0x65')](_0x1893b2);}})[_0x668a('0x27')](function(_0x4b2f23){if(_0x4b2f23){_0x456ac3=_0x4b2f23[_0x668a('0x3b')];if(!_0x43d10d[_0x668a('0x36')][_0x668a('0x3c')](_0x668a('0x3d'))){_0x1893b2[_0x668a('0x21')]=qs[_0x668a('0x21')](_0x43d10d[_0x668a('0x36')][_0x668a('0x21')]);_0x1893b2[_0x668a('0x20')]=qs[_0x668a('0x20')](_0x43d10d[_0x668a('0x36')][_0x668a('0x20')]);}return _0x5e7e04['getTeams'](_0x1893b2);}})[_0x668a('0x27')](function(_0x26b1d1){if(_0x26b1d1){return _0x26b1d1?{'count':_0x456ac3,'rows':_0x26b1d1}:null;}})[_0x668a('0x27')](respondWithResult(_0x37a2f4,null))[_0x668a('0x56')](handleError(_0x37a2f4,null));};exports['addTeams']=function(_0x175b46,_0x7a96e7,_0x160076){var _0x421ec1=_0x175b46['body']['ids'];return db[_0x668a('0x66')][_0x668a('0x47')]({'where':{'id':_0x421ec1},'attributes':['id'],'include':[{'model':db[_0x668a('0x67')],'as':_0x668a('0x68'),'attributes':['id',_0x668a('0x2d'),_0x668a('0x69'),'voicePause',_0x668a('0x6a')],'raw':!![]}]})['then'](function(_0x38504a){if(_0x38504a){var _0x5e603e=_['flatMap'](_0x38504a,function(_0x299f35){var _0x2d9385=_0x299f35['get']({'plain':!![]});return _0x2d9385[_0x668a('0x68')];});return db['MailQueue'][_0x668a('0x4c')]({'where':{'id':_0x175b46['params']['id']}})['then'](function(_0x333c94){return db['sequelize'][_0x668a('0x6b')](function(_0x6f63b7){return _0x333c94[_0x668a('0x6c')](_0x421ec1,{'transaction':_0x6f63b7})['then'](function(){return BPromise[_0x668a('0x6d')](_0x5e603e,function(_0x547eb2){return db[_0x668a('0x5d')][_0x668a('0x6e')]({'where':{'UserId':_0x547eb2['id'],'MailQueueId':_0x175b46['params']['id']},'transaction':_0x6f63b7});});})['then'](function(){_0x5e603e[_0x668a('0x6f')](function(_0x4020a8){socket[_0x668a('0x70')](_0x668a('0x71'),{'UserId':_0x4020a8['id'],'MailQueueId':_0x333c94['id']});});});});});}})[_0x668a('0x27')](respondWithStatusCode(_0x7a96e7,null))['catch'](handleError(_0x7a96e7,null));};exports[_0x668a('0x72')]=function(_0x311eaa,_0x83e590,_0xd94e9c){return db['Team'][_0x668a('0x47')]({'where':{'id':_0x311eaa[_0x668a('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0x668a('0x67')],'as':_0x668a('0x68'),'attributes':['id'],'raw':!![]}]})[_0x668a('0x27')](handleEntityNotFound(_0x83e590,null))[_0x668a('0x27')](function(_0x3e16f4){var _0x50f626=_[_0x668a('0x30')](_0x3e16f4,'id');var _0x12d022=[];var _0x121459=[];var _0xd88da=squel[_0x668a('0x73')]();_0xd88da[_0x668a('0x74')](_0x668a('0x75'))[_0x668a('0x76')](_0x668a('0x77'),'tq')[_0x668a('0x78')](_0x668a('0x79'),'ut',_0x668a('0x7a'))['where'](_0x668a('0x7b'),_0x311eaa['params']['id']);for(var _0x3d7a0f=0x0;_0x3d7a0f<_0x3e16f4['length'];_0x3d7a0f+=0x1){let _0x48364f=_0x3e16f4[_0x3d7a0f];for(var _0x4fe8c6=0x0;_0x4fe8c6<_0x48364f[_0x668a('0x68')][_0x668a('0x3b')];_0x4fe8c6+=0x1){let _0x384e00=_0x48364f['Agents'][_0x4fe8c6];var _0xee4310=_0xd88da[_0x668a('0x7c')]();_0xee4310[_0x668a('0x3f')](_0x668a('0x7d'),_0x384e00['id']);_0x121459[_0x668a('0x7e')](db[_0x668a('0x7f')][_0x668a('0x36')](_0xee4310['toString'](),{'type':db[_0x668a('0x7f')][_0x668a('0x80')][_0x668a('0x81')]})['then'](function(_0xf825ad){if(_0xf825ad[_0x668a('0x3b')]===0x1){return _0x384e00['id'];}else{var _0x480c47=_[_0x668a('0x82')](_[_0x668a('0x30')](_0xf825ad,_0x668a('0x83')),function(_0x3153fb){return _[_0x668a('0x84')](_0x50f626,_0x3153fb);});if(_0x480c47){return _0x384e00['id'];}}}));}}return BPromise[_0x668a('0x85')](_0x121459)[_0x668a('0x27')](function(_0x3e14e1){_0x12d022=_(_0x12d022)['union'](_0x3e14e1)[_0x668a('0x86')]()[_0x668a('0x87')]();return db[_0x668a('0x31')][_0x668a('0x4c')]({'where':{'id':_0x311eaa[_0x668a('0x4a')]['id']}})[_0x668a('0x27')](function(_0x2c2153){return db['sequelize'][_0x668a('0x6b')](function(_0xaf6f15){return _0x2c2153[_0x668a('0x72')](_0x311eaa[_0x668a('0x36')]['ids'],{'transaction':_0xaf6f15})['then'](function(){if(!_[_0x668a('0x88')](_0x12d022)){return _0x2c2153[_0x668a('0x89')](_0x12d022,{'transaction':_0xaf6f15});}})[_0x668a('0x27')](function(){_0x12d022[_0x668a('0x6f')](function(_0x49e438){socket[_0x668a('0x70')](_0x668a('0x8a'),{'UserId':_0x49e438,'MailQueueId':_0x2c2153['id']});});});});});});})['then'](respondWithStatusCode(_0x83e590,null))['catch'](handleError(_0x83e590,null));};exports[_0x668a('0x8b')]=function(_0x5b52c2,_0x3a0967,_0x1a7fbe){return db['MailQueue']['find']({'where':{'id':_0x5b52c2[_0x668a('0x4a')]['id']}})[_0x668a('0x27')](handleEntityNotFound(_0x3a0967,null))[_0x668a('0x27')](function(_0x5732cb){if(_0x5732cb){return _0x5732cb['addAgents'](_0x5b52c2[_0x668a('0x4e')][_0x668a('0x8c')],_[_0x668a('0x8d')](_0x5b52c2[_0x668a('0x4e')],[_0x668a('0x8c'),'id'])||{})['spread'](function(_0x23412e){for(var _0x4d6d54=0x0;_0x4d6d54<_0x5b52c2[_0x668a('0x4e')][_0x668a('0x8c')]['length'];_0x4d6d54+=0x1){socket[_0x668a('0x70')]('userMailQueue:save',{'UserId':_0x5b52c2['body'][_0x668a('0x8c')][_0x4d6d54],'MailQueueId':_0x5b52c2[_0x668a('0x4a')]['id']});}return _0x23412e;});}})[_0x668a('0x27')](respondWithResult(_0x3a0967,null))[_0x668a('0x56')](handleError(_0x3a0967,null));};exports['removeAgents']=function(_0x2642f9,_0x3ee7fb,_0x5934ae){return db['MailQueue']['find']({'where':{'id':_0x2642f9['params']['id']}})[_0x668a('0x27')](handleEntityNotFound(_0x3ee7fb,null))[_0x668a('0x27')](function(_0x4917e2){if(_0x4917e2){return _0x4917e2['removeAgents'](_0x2642f9[_0x668a('0x36')][_0x668a('0x8c')])[_0x668a('0x27')](function(){if(_[_0x668a('0x8e')](_0x2642f9[_0x668a('0x36')][_0x668a('0x8c')])){for(var _0x5d02a3=0x0;_0x5d02a3<_0x2642f9[_0x668a('0x36')][_0x668a('0x8c')][_0x668a('0x3b')];_0x5d02a3+=0x1){socket['emit'](_0x668a('0x8a'),{'UserId':Number(_0x2642f9[_0x668a('0x36')][_0x668a('0x8c')][_0x5d02a3]),'MailQueueId':Number(_0x2642f9[_0x668a('0x4a')]['id'])});}}else{socket['emit'](_0x668a('0x8a'),{'UserId':Number(_0x2642f9[_0x668a('0x36')][_0x668a('0x8c')]),'MailQueueId':Number(_0x2642f9['params']['id'])});}});}})[_0x668a('0x27')](respondWithStatusCode(_0x3ee7fb,null))[_0x668a('0x56')](handleError(_0x3ee7fb,null));};exports[_0x668a('0x8f')]=function(_0x4c261b,_0x4bfb48,_0x27c0c8){var _0x211ee2={};var _0x28e366={};var _0x18737e;var _0x1e859e;return db['MailQueue']['findOne']({'where':{'id':_0x4c261b[_0x668a('0x4a')]['id']}})[_0x668a('0x27')](handleEntityNotFound(_0x4bfb48,null))['then'](function(_0x58158a){if(_0x58158a){_0x18737e=_0x58158a;_0x28e366[_0x668a('0x35')]=_[_0x668a('0x4b')](db[_0x668a('0x67')]['rawAttributes']);_0x28e366[_0x668a('0x36')]=_[_0x668a('0x4b')](_0x4c261b[_0x668a('0x36')]);_0x28e366['filters']=_[_0x668a('0x39')](_0x28e366[_0x668a('0x35')],_0x28e366[_0x668a('0x36')]);_0x211ee2[_0x668a('0x38')]=_[_0x668a('0x39')](_0x28e366[_0x668a('0x35')],qs[_0x668a('0x3a')](_0x4c261b[_0x668a('0x36')][_0x668a('0x3a')]));_0x211ee2[_0x668a('0x38')]=_0x211ee2[_0x668a('0x38')][_0x668a('0x3b')]?_0x211ee2[_0x668a('0x38')]:_0x28e366[_0x668a('0x35')];_0x211ee2[_0x668a('0x5b')]=qs[_0x668a('0x3e')](_0x4c261b['query']['sort']);_0x211ee2[_0x668a('0x3f')]=qs[_0x668a('0x37')](_['pick'](_0x4c261b[_0x668a('0x36')],_0x28e366[_0x668a('0x37')]));if(_0x4c261b['query'][_0x668a('0x41')]){_0x211ee2[_0x668a('0x3f')]=_[_0x668a('0x42')](_0x211ee2['where'],{'$or':_['map'](_0x211ee2[_0x668a('0x38')],function(_0x468118){var _0x2f593e={};_0x2f593e[_0x468118]={'$like':'%'+_0x4c261b[_0x668a('0x36')][_0x668a('0x41')]+'%'};return _0x2f593e;})});}_0x211ee2=_[_0x668a('0x42')]({},_0x211ee2,_0x4c261b[_0x668a('0x44')]);return _0x18737e['getAgents'](_0x211ee2);}})[_0x668a('0x27')](function(_0x29d988){if(_0x29d988){_0x1e859e=_0x29d988[_0x668a('0x3b')];if(!_0x4c261b[_0x668a('0x36')][_0x668a('0x3c')](_0x668a('0x3d'))){_0x211ee2['limit']=qs[_0x668a('0x21')](_0x4c261b[_0x668a('0x36')][_0x668a('0x21')]);_0x211ee2[_0x668a('0x20')]=qs[_0x668a('0x20')](_0x4c261b[_0x668a('0x36')][_0x668a('0x20')]);}return _0x18737e[_0x668a('0x8f')](_0x211ee2);}})[_0x668a('0x27')](function(_0x499912){if(_0x499912){return _0x499912?{'count':_0x1e859e,'rows':_0x499912}:null;}})[_0x668a('0x27')](respondWithResult(_0x4bfb48,null))[_0x668a('0x56')](handleError(_0x4bfb48,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index a12c8c7..7fad266 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 _0xa6e6=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','MailQueue','setMaxListeners','save','update'];(function(_0x2b7c47,_0x22dba6){var _0x58d855=function(_0x5cd7c8){while(--_0x5cd7c8){_0x2b7c47['push'](_0x2b7c47['shift']());}};_0x58d855(++_0x22dba6);}(_0xa6e6,0x68));var _0x6a6e=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0xa6e6[_0x819464];return _0x49dcc0;};'use strict';var EventEmitter=require(_0x6a6e('0x0'));var MailQueue=require(_0x6a6e('0x1'))['db'][_0x6a6e('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x6a6e('0x3')](0x0);var events={'afterCreate':_0x6a6e('0x4'),'afterUpdate':_0x6a6e('0x5'),'afterDestroy':_0x6a6e('0x6')};function emitEvent(_0x12a1fc){return function(_0x40aff4,_0x10b2bc,_0x1d1824){MailQueueEvents[_0x6a6e('0x7')](_0x12a1fc+':'+_0x40aff4['id'],_0x40aff4);MailQueueEvents[_0x6a6e('0x7')](_0x12a1fc,_0x40aff4);_0x1d1824(null);};}for(var e in events){if(events[_0x6a6e('0x8')](e)){var event=events[e];MailQueue[_0x6a6e('0x9')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file +var _0x9e5a=['hook','exports','events','../../mysqldb','MailQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x412ae1,_0x20a4c4){var _0x50bea0=function(_0x2e0f62){while(--_0x2e0f62){_0x412ae1['push'](_0x412ae1['shift']());}};_0x50bea0(++_0x20a4c4);}(_0x9e5a,0xc8));var _0xa9e5=function(_0x59a103,_0x25ad49){_0x59a103=_0x59a103-0x0;var _0x22b4ea=_0x9e5a[_0x59a103];return _0x22b4ea;};'use strict';var EventEmitter=require(_0xa9e5('0x0'));var MailQueue=require(_0xa9e5('0x1'))['db'][_0xa9e5('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xa9e5('0x3')](0x0);var events={'afterCreate':_0xa9e5('0x4'),'afterUpdate':_0xa9e5('0x5'),'afterDestroy':_0xa9e5('0x6')};function emitEvent(_0x8758ba){return function(_0x20ff20,_0x50c1df,_0x270b73){MailQueueEvents['emit'](_0x8758ba+':'+_0x20ff20['id'],_0x20ff20);MailQueueEvents[_0xa9e5('0x7')](_0x8758ba,_0x20ff20);_0x270b73(null);};}for(var e in events){if(events[_0xa9e5('0x8')](e)){var event=events[e];MailQueue[_0xa9e5('0x9')](e,emitEvent(event));}}module[_0xa9e5('0xa')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 6e440d3..dee62e8 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 _0xd4b3=['define','MailQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','exports'];(function(_0x3ada77,_0x5ec45d){var _0x35439c=function(_0x5e6942){while(--_0x5e6942){_0x3ada77['push'](_0x3ada77['shift']());}};_0x35439c(++_0x5ec45d);}(_0xd4b3,0x64));var _0x3d4b=function(_0x353422,_0xfa413e){_0x353422=_0x353422-0x0;var _0x3c3c3b=_0xd4b3[_0x353422];return _0x3c3c3b;};'use strict';var _=require(_0x3d4b('0x0'));var util=require(_0x3d4b('0x1'));var logger=require(_0x3d4b('0x2'))(_0x3d4b('0x3'));var moment=require(_0x3d4b('0x4'));var BPromise=require(_0x3d4b('0x5'));var rp=require(_0x3d4b('0x6'));var fs=require('fs');var path=require(_0x3d4b('0x7'));var rimraf=require(_0x3d4b('0x8'));var config=require(_0x3d4b('0x9'));var attributes=require(_0x3d4b('0xa'));module[_0x3d4b('0xb')]=function(_0x581515,_0x18b8a8){return _0x581515[_0x3d4b('0xc')](_0x3d4b('0xd'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xafcd=['util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./mailQueue.attributes','exports','define','MailQueue','mail_queues','lodash'];(function(_0x4fbaab,_0x5661c7){var _0x42eff5=function(_0x189078){while(--_0x189078){_0x4fbaab['push'](_0x4fbaab['shift']());}};_0x42eff5(++_0x5661c7);}(_0xafcd,0xcb));var _0xdafc=function(_0x15411f,_0x42bef8){_0x15411f=_0x15411f-0x0;var _0x555650=_0xafcd[_0x15411f];return _0x555650;};'use strict';var _=require(_0xdafc('0x0'));var util=require(_0xdafc('0x1'));var logger=require(_0xdafc('0x2'))('api');var moment=require(_0xdafc('0x3'));var BPromise=require(_0xdafc('0x4'));var rp=require(_0xdafc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdafc('0x6'));var attributes=require(_0xdafc('0x7'));module[_0xdafc('0x8')]=function(_0x337ae1,_0x1e68e0){return _0x337ae1[_0xdafc('0x9')](_0xdafc('0xa'),attributes,{'tableName':_0xdafc('0xb'),'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 8b88985..6f020fb 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 _0x999e=['redis','defaults','socket.io-emitter','./mailQueue.socket','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetMailQueue','MailQueue','findAll','options','raw','where','attributes','include','map','model','then','ShowMailQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','http'];(function(_0x56b540,_0x37f450){var _0xf62ffc=function(_0x2a8224){while(--_0x2a8224){_0x56b540['push'](_0x56b540['shift']());}};_0xf62ffc(++_0x37f450);}(_0x999e,0xcf));var _0xe999=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x999e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe999('0x0'));var util=require(_0xe999('0x1'));var moment=require(_0xe999('0x2'));var BPromise=require(_0xe999('0x3'));var rs=require(_0xe999('0x4'));var fs=require('fs');var Redis=require(_0xe999('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe999('0x6'))('rpc');var config=require(_0xe999('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe999('0x8')]({'port':0x232a});config[_0xe999('0x9')]=_[_0xe999('0xa')](config[_0xe999('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xe999('0xb'))(new Redis(config[_0xe999('0x9')]));require(_0xe999('0xc'))['register'](socket);function respondWithRpcPromise(_0x49e3b2,_0x26d300,_0x722c96){return new BPromise(function(_0xa247ef,_0x4a21b0){return client['request'](_0x49e3b2,_0x722c96)['then'](function(_0x5d686e){logger['info'](_0xe999('0xd'),_0x26d300,_0xe999('0xe'));logger[_0xe999('0xf')](_0xe999('0x10'),_0x26d300,_0xe999('0xe'),JSON[_0xe999('0x11')](_0x5d686e));if(_0x5d686e[_0xe999('0x12')]){if(_0x5d686e[_0xe999('0x12')][_0xe999('0x13')]===0x1f4){logger[_0xe999('0x12')]('MailQueue,\x20%s,\x20%s',_0x26d300,_0x5d686e[_0xe999('0x12')]['message']);return _0x4a21b0(_0x5d686e[_0xe999('0x12')][_0xe999('0x14')]);}logger[_0xe999('0x12')](_0xe999('0xd'),_0x26d300,_0x5d686e['error'][_0xe999('0x14')]);return _0xa247ef(_0x5d686e[_0xe999('0x12')][_0xe999('0x14')]);}else{logger[_0xe999('0x15')]('MailQueue,\x20%s,\x20%s',_0x26d300,_0xe999('0xe'));_0xa247ef(_0x5d686e[_0xe999('0x16')]['message']);}})[_0xe999('0x17')](function(_0x506118){logger['error'](_0xe999('0xd'),_0x26d300,_0x506118);_0x4a21b0(_0x506118);});});}exports[_0xe999('0x18')]=function(_0xf67c0a){var _0x22fcb0=this;return new Promise(function(_0x444413,_0x861487){return db[_0xe999('0x19')][_0xe999('0x1a')]({'raw':_0xf67c0a[_0xe999('0x1b')]?_0xf67c0a['options'][_0xe999('0x1c')]===undefined?!![]:![]:!![],'where':_0xf67c0a['options']?_0xf67c0a['options'][_0xe999('0x1d')]||null:null,'attributes':_0xf67c0a[_0xe999('0x1b')]?_0xf67c0a[_0xe999('0x1b')][_0xe999('0x1e')]||null:null,'limit':_0xf67c0a[_0xe999('0x1b')]?_0xf67c0a[_0xe999('0x1b')]['limit']||null:null,'include':_0xf67c0a[_0xe999('0x1b')]?_0xf67c0a[_0xe999('0x1b')][_0xe999('0x1f')]?_[_0xe999('0x20')](_0xf67c0a[_0xe999('0x1b')][_0xe999('0x1f')],function(_0x5208ce){return{'model':db[_0x5208ce['model']],'as':_0x5208ce['as'],'attributes':_0x5208ce[_0xe999('0x1e')],'include':_0x5208ce[_0xe999('0x1f')]?_[_0xe999('0x20')](_0x5208ce['include'],function(_0x2b6238){return{'model':db[_0x2b6238[_0xe999('0x21')]],'as':_0x2b6238['as'],'attributes':_0x2b6238[_0xe999('0x1e')],'include':_0x2b6238[_0xe999('0x1f')]?_[_0xe999('0x20')](_0x2b6238[_0xe999('0x1f')],function(_0xbc92e1){return{'model':db[_0xbc92e1[_0xe999('0x21')]],'as':_0xbc92e1['as'],'attributes':_0xbc92e1[_0xe999('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xe999('0x22')](function(_0x22049a){logger[_0xe999('0x15')](_0xe999('0x18'),_0xf67c0a);logger[_0xe999('0xf')](_0xe999('0x18'),_0xf67c0a,JSON[_0xe999('0x11')](_0x22049a));_0x444413(_0x22049a);})[_0xe999('0x17')](function(_0x39b8d0){logger[_0xe999('0x12')](_0xe999('0x18'),_0x39b8d0['message'],_0xf67c0a);_0x861487(_0x22fcb0[_0xe999('0x12')](0x1f4,_0x39b8d0['message']));});});};exports['ShowMailQueue']=function(_0x85cc36){var _0x1a294d=this;return new Promise(function(_0x5090b3,_0x599005){return db['MailQueue']['find']({'raw':_0x85cc36['options']?_0x85cc36['options'][_0xe999('0x1c')]===undefined?!![]:![]:!![],'where':_0x85cc36['options']?_0x85cc36[_0xe999('0x1b')][_0xe999('0x1d')]||null:null,'attributes':_0x85cc36[_0xe999('0x1b')]?_0x85cc36[_0xe999('0x1b')][_0xe999('0x1e')]||null:null,'include':_0x85cc36[_0xe999('0x1b')]?_0x85cc36[_0xe999('0x1b')][_0xe999('0x1f')]?_['map'](_0x85cc36[_0xe999('0x1b')][_0xe999('0x1f')],function(_0x3ab51e){return{'model':db[_0x3ab51e[_0xe999('0x21')]],'as':_0x3ab51e['as'],'attributes':_0x3ab51e[_0xe999('0x1e')],'include':_0x3ab51e[_0xe999('0x1f')]?_[_0xe999('0x20')](_0x3ab51e[_0xe999('0x1f')],function(_0x3b84fe){return{'model':db[_0x3b84fe['model']],'as':_0x3b84fe['as'],'attributes':_0x3b84fe[_0xe999('0x1e')],'include':_0x3b84fe[_0xe999('0x1f')]?_['map'](_0x3b84fe['include'],function(_0x27f889){return{'model':db[_0x27f889[_0xe999('0x21')]],'as':_0x27f889['as'],'attributes':_0x27f889[_0xe999('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xe999('0x22')](function(_0x7a929a){logger['info'](_0xe999('0x23'),_0x85cc36);logger[_0xe999('0xf')](_0xe999('0x23'),_0x85cc36,JSON[_0xe999('0x11')](_0x7a929a));_0x5090b3(_0x7a929a);})['catch'](function(_0x525edc){logger[_0xe999('0x12')](_0xe999('0x23'),_0x525edc[_0xe999('0x14')],_0x85cc36);_0x599005(_0x1a294d['error'](0x1f4,_0x525edc[_0xe999('0x14')]));});});}; \ No newline at end of file +var _0x9650=['then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailQueue','MailQueue','findAll','options','raw','where','limit','include','map','model','attributes','ShowMailQueue','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request'];(function(_0x44b3bd,_0x44c97d){var _0x1efc4a=function(_0x5d0205){while(--_0x5d0205){_0x44b3bd['push'](_0x44b3bd['shift']());}};_0x1efc4a(++_0x44c97d);}(_0x9650,0x161));var _0x0965=function(_0x3e5da0,_0x1d7849){_0x3e5da0=_0x3e5da0-0x0;var _0x241f4d=_0x9650[_0x3e5da0];return _0x241f4d;};'use strict';var _=require(_0x0965('0x0'));var util=require(_0x0965('0x1'));var moment=require(_0x0965('0x2'));var BPromise=require('bluebird');var rs=require(_0x0965('0x3'));var fs=require('fs');var Redis=require(_0x0965('0x4'));var db=require(_0x0965('0x5'))['db'];var utils=require(_0x0965('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x0965('0x7'));var jayson=require(_0x0965('0x8'));var client=jayson[_0x0965('0x9')][_0x0965('0xa')]({'port':0x232a});config[_0x0965('0xb')]=_[_0x0965('0xc')](config[_0x0965('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x0965('0xd'))(new Redis(config[_0x0965('0xb')]));require('./mailQueue.socket')[_0x0965('0xe')](socket);function respondWithRpcPromise(_0x458270,_0x2a6638,_0x2bdc39){return new BPromise(function(_0x1cbbb8,_0x26719a){return client[_0x0965('0xf')](_0x458270,_0x2bdc39)[_0x0965('0x10')](function(_0x15be8f){logger[_0x0965('0x11')](_0x0965('0x12'),_0x2a6638,_0x0965('0x13'));logger[_0x0965('0x14')](_0x0965('0x15'),_0x2a6638,_0x0965('0x13'),JSON[_0x0965('0x16')](_0x15be8f));if(_0x15be8f[_0x0965('0x17')]){if(_0x15be8f[_0x0965('0x17')][_0x0965('0x18')]===0x1f4){logger[_0x0965('0x17')](_0x0965('0x12'),_0x2a6638,_0x15be8f[_0x0965('0x17')]['message']);return _0x26719a(_0x15be8f[_0x0965('0x17')][_0x0965('0x19')]);}logger[_0x0965('0x17')]('MailQueue,\x20%s,\x20%s',_0x2a6638,_0x15be8f[_0x0965('0x17')][_0x0965('0x19')]);return _0x1cbbb8(_0x15be8f[_0x0965('0x17')][_0x0965('0x19')]);}else{logger[_0x0965('0x11')](_0x0965('0x12'),_0x2a6638,_0x0965('0x13'));_0x1cbbb8(_0x15be8f[_0x0965('0x1a')][_0x0965('0x19')]);}})[_0x0965('0x1b')](function(_0x58f179){logger['error'](_0x0965('0x12'),_0x2a6638,_0x58f179);_0x26719a(_0x58f179);});});}exports[_0x0965('0x1c')]=function(_0x549647){var _0x27fbb8=this;return new Promise(function(_0x5b4552,_0x1b5d7d){return db[_0x0965('0x1d')][_0x0965('0x1e')]({'raw':_0x549647[_0x0965('0x1f')]?_0x549647['options'][_0x0965('0x20')]===undefined?!![]:![]:!![],'where':_0x549647[_0x0965('0x1f')]?_0x549647[_0x0965('0x1f')][_0x0965('0x21')]||null:null,'attributes':_0x549647['options']?_0x549647[_0x0965('0x1f')]['attributes']||null:null,'limit':_0x549647[_0x0965('0x1f')]?_0x549647['options'][_0x0965('0x22')]||null:null,'include':_0x549647[_0x0965('0x1f')]?_0x549647[_0x0965('0x1f')][_0x0965('0x23')]?_[_0x0965('0x24')](_0x549647[_0x0965('0x1f')][_0x0965('0x23')],function(_0x586258){return{'model':db[_0x586258[_0x0965('0x25')]],'as':_0x586258['as'],'attributes':_0x586258[_0x0965('0x26')],'include':_0x586258[_0x0965('0x23')]?_[_0x0965('0x24')](_0x586258[_0x0965('0x23')],function(_0x1038a9){return{'model':db[_0x1038a9[_0x0965('0x25')]],'as':_0x1038a9['as'],'attributes':_0x1038a9[_0x0965('0x26')],'include':_0x1038a9[_0x0965('0x23')]?_[_0x0965('0x24')](_0x1038a9[_0x0965('0x23')],function(_0xfc99fb){return{'model':db[_0xfc99fb[_0x0965('0x25')]],'as':_0xfc99fb['as'],'attributes':_0xfc99fb['attributes']};}):[]};}):[]};}):[]:[]})[_0x0965('0x10')](function(_0x17e1d4){logger['info']('GetMailQueue',_0x549647);logger['debug'](_0x0965('0x1c'),_0x549647,JSON[_0x0965('0x16')](_0x17e1d4));_0x5b4552(_0x17e1d4);})[_0x0965('0x1b')](function(_0x3e3f1b){logger[_0x0965('0x17')]('GetMailQueue',_0x3e3f1b[_0x0965('0x19')],_0x549647);_0x1b5d7d(_0x27fbb8[_0x0965('0x17')](0x1f4,_0x3e3f1b['message']));});});};exports[_0x0965('0x27')]=function(_0x57c335){var _0x10922e=this;return new Promise(function(_0x2c1848,_0x13ade4){return db[_0x0965('0x1d')][_0x0965('0x28')]({'raw':_0x57c335['options']?_0x57c335[_0x0965('0x1f')][_0x0965('0x20')]===undefined?!![]:![]:!![],'where':_0x57c335[_0x0965('0x1f')]?_0x57c335[_0x0965('0x1f')][_0x0965('0x21')]||null:null,'attributes':_0x57c335[_0x0965('0x1f')]?_0x57c335[_0x0965('0x1f')][_0x0965('0x26')]||null:null,'include':_0x57c335['options']?_0x57c335[_0x0965('0x1f')][_0x0965('0x23')]?_[_0x0965('0x24')](_0x57c335[_0x0965('0x1f')][_0x0965('0x23')],function(_0x42a76d){return{'model':db[_0x42a76d['model']],'as':_0x42a76d['as'],'attributes':_0x42a76d[_0x0965('0x26')],'include':_0x42a76d[_0x0965('0x23')]?_[_0x0965('0x24')](_0x42a76d['include'],function(_0x4a4345){return{'model':db[_0x4a4345[_0x0965('0x25')]],'as':_0x4a4345['as'],'attributes':_0x4a4345[_0x0965('0x26')],'include':_0x4a4345['include']?_[_0x0965('0x24')](_0x4a4345['include'],function(_0x3d3b91){return{'model':db[_0x3d3b91[_0x0965('0x25')]],'as':_0x3d3b91['as'],'attributes':_0x3d3b91[_0x0965('0x26')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x113df8){logger[_0x0965('0x11')](_0x0965('0x27'),_0x57c335);logger[_0x0965('0x14')](_0x0965('0x27'),_0x57c335,JSON['stringify'](_0x113df8));_0x2c1848(_0x113df8);})['catch'](function(_0x3b03d8){logger[_0x0965('0x17')](_0x0965('0x27'),_0x3b03d8[_0x0965('0x19')],_0x57c335);_0x13ade4(_0x10922e[_0x0965('0x17')](0x1f4,_0x3b03d8[_0x0965('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 7a0a74d..715678b 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 _0xd40a=['register','length','mailQueue:','./mailQueue.events','save','update'];(function(_0x3849ff,_0x4ae25e){var _0x3ab676=function(_0x50a39e){while(--_0x50a39e){_0x3849ff['push'](_0x3849ff['shift']());}};_0x3ab676(++_0x4ae25e);}(_0xd40a,0x1e9));var _0xad40=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd40a[_0x20a584];return _0x4b41a8;};'use strict';var MailQueueEvents=require(_0xad40('0x0'));var events=[_0xad40('0x1'),'remove',_0xad40('0x2')];function createListener(_0x7c3cfa,_0x158df8){return function(_0x15505f){_0x158df8['emit'](_0x7c3cfa,_0x15505f);};}function removeListener(_0x3af0e7,_0x4826e0){return function(){MailQueueEvents['removeListener'](_0x3af0e7,_0x4826e0);};}exports[_0xad40('0x3')]=function(_0x303f72){for(var _0x54c13d=0x0,_0x36e815=events[_0xad40('0x4')];_0x54c13d<_0x36e815;_0x54c13d++){var _0x45ae98=events[_0x54c13d];var _0x58add6=createListener(_0xad40('0x5')+_0x45ae98,_0x303f72);MailQueueEvents['on'](_0x45ae98,_0x58add6);}}; \ No newline at end of file +var _0x954e=['mailQueue:','./mailQueue.events','save','remove','update','emit','removeListener','register','length'];(function(_0x1173f3,_0xde5c5){var _0xba7a80=function(_0x2b8cc0){while(--_0x2b8cc0){_0x1173f3['push'](_0x1173f3['shift']());}};_0xba7a80(++_0xde5c5);}(_0x954e,0x106));var _0xe954=function(_0x2c5231,_0x51913c){_0x2c5231=_0x2c5231-0x0;var _0x569090=_0x954e[_0x2c5231];return _0x569090;};'use strict';var MailQueueEvents=require(_0xe954('0x0'));var events=[_0xe954('0x1'),_0xe954('0x2'),_0xe954('0x3')];function createListener(_0x59976d,_0x87a03e){return function(_0x2148ad){_0x87a03e[_0xe954('0x4')](_0x59976d,_0x2148ad);};}function removeListener(_0x172fe9,_0x25251a){return function(){MailQueueEvents[_0xe954('0x5')](_0x172fe9,_0x25251a);};}exports[_0xe954('0x6')]=function(_0x2cbbd7){for(var _0x79db60=0x0,_0x4e90bd=events[_0xe954('0x7')];_0x79db60<_0x4e90bd;_0x79db60++){var _0x1d30f3=events[_0x79db60];var _0x570df3=createListener(_0xe954('0x8')+_0x1d30f3,_0x2cbbd7);MailQueueEvents['on'](_0x1d30f3,_0x570df3);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index e27076d..c521c3c 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 _0xf84a=['post','create','update','delete','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x39f28f,_0x352bf1){var _0x595e11=function(_0x1d9da8){while(--_0x1d9da8){_0x39f28f['push'](_0x39f28f['shift']());}};_0x595e11(++_0x352bf1);}(_0xf84a,0x1cf));var _0xaf84=function(_0x23dda3,_0x1c879d){_0x23dda3=_0x23dda3-0x0;var _0x36055a=_0xf84a[_0x23dda3];return _0x36055a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xaf84('0x0'));var timeout=require(_0xaf84('0x1'));var express=require(_0xaf84('0x2'));var router=express[_0xaf84('0x3')]();var auth=require(_0xaf84('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xaf84('0x5'));var controller=require(_0xaf84('0x6'));router[_0xaf84('0x7')]('/',auth[_0xaf84('0x8')](),controller[_0xaf84('0x9')]);router[_0xaf84('0x7')](_0xaf84('0xa'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xaf84('0xb'),auth['isAuthenticated'](),controller[_0xaf84('0xc')]);router[_0xaf84('0xd')]('/',auth['isAuthenticated'](),controller[_0xaf84('0xe')]);router['put'](_0xaf84('0xb'),auth[_0xaf84('0x8')](),controller[_0xaf84('0xf')]);router[_0xaf84('0x10')](_0xaf84('0xb'),auth[_0xaf84('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x4e7a=['destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','create','put','update','delete'];(function(_0x52f25e,_0x11631d){var _0x52ac03=function(_0x11cd02){while(--_0x11cd02){_0x52f25e['push'](_0x52f25e['shift']());}};_0x52ac03(++_0x11631d);}(_0x4e7a,0x156));var _0xa4e7=function(_0xd49fef,_0x23f01e){_0xd49fef=_0xd49fef-0x0;var _0x304be8=_0x4e7a[_0xd49fef];return _0x304be8;};'use strict';var multer=require(_0xa4e7('0x0'));var util=require('util');var path=require(_0xa4e7('0x1'));var timeout=require(_0xa4e7('0x2'));var express=require(_0xa4e7('0x3'));var router=express['Router']();var auth=require(_0xa4e7('0x4'));var interaction=require(_0xa4e7('0x5'));var config=require(_0xa4e7('0x6'));var controller=require(_0xa4e7('0x7'));router[_0xa4e7('0x8')]('/',auth[_0xa4e7('0x9')](),controller['index']);router[_0xa4e7('0x8')](_0xa4e7('0xa'),auth['isAuthenticated'](),controller[_0xa4e7('0xb')]);router['get'](_0xa4e7('0xc'),auth[_0xa4e7('0x9')](),controller[_0xa4e7('0xd')]);router['post']('/',auth[_0xa4e7('0x9')](),controller[_0xa4e7('0xe')]);router[_0xa4e7('0xf')]('/:id',auth[_0xa4e7('0x9')](),controller[_0xa4e7('0x10')]);router[_0xa4e7('0x11')](_0xa4e7('0xc'),auth[_0xa4e7('0x9')](),controller[_0xa4e7('0x12')]);module[_0xa4e7('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 7eaa3b2..30a3c5b 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 _0x4121=['DATE','moment','exports','STRING'];(function(_0x107f10,_0x5529f2){var _0x811cab=function(_0xc160ea){while(--_0xc160ea){_0x107f10['push'](_0x107f10['shift']());}};_0x811cab(++_0x5529f2);}(_0x4121,0x195));var _0x1412=function(_0x5bb758,_0x3679b4){_0x5bb758=_0x5bb758-0x0;var _0x1a6ee4=_0x4121[_0x5bb758];return _0x1a6ee4;};'use strict';var moment=require(_0x1412('0x0'));var Sequelize=require('sequelize');module[_0x1412('0x1')]={'uniqueid':{'type':Sequelize[_0x1412('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x1412('0x3')]},'leaveAt':{'type':Sequelize[_0x1412('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x1412('0x2')]}}; \ No newline at end of file +var _0x4955=['exports','STRING','DATE','moment'];(function(_0x3dfa3e,_0x293558){var _0x3ff9ed=function(_0x400e9b){while(--_0x400e9b){_0x3dfa3e['push'](_0x3dfa3e['shift']());}};_0x3ff9ed(++_0x293558);}(_0x4955,0x15f));var _0x5495=function(_0x21b768,_0xd421a0){_0x21b768=_0x21b768-0x0;var _0x18e6e3=_0x4955[_0x21b768];return _0x18e6e3;};'use strict';var moment=require(_0x5495('0x0'));var Sequelize=require('sequelize');module[_0x5495('0x1')]={'uniqueid':{'type':Sequelize[_0x5495('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x5495('0x3')]},'leaveAt':{'type':Sequelize[_0x5495('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x5495('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index cc3f7d5..3a69d15 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 _0xe83f=['apply','reject','save','then','destroy','error','stack','name','send','map','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','includeAll','MailQueueReport','findAll','catch','show','params','rawAttributes','include','options','find','create','body','update','describe','html-pdf','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json'];(function(_0x66272,_0x57e7d1){var _0x2fbe92=function(_0x4cf991){while(--_0x4cf991){_0x66272['push'](_0x66272['shift']());}};_0x2fbe92(++_0x57e7d1);}(_0xe83f,0xba));var _0xfe83=function(_0x77e5d6,_0x16e152){_0x77e5d6=_0x77e5d6-0x0;var _0x38b5bb=_0xe83f[_0x77e5d6];return _0x38b5bb;};'use strict';var pdf=require(_0xfe83('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xfe83('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfe83('0x2'));var moment=require(_0xfe83('0x3'));var BPromise=require(_0xfe83('0x4'));var Mustache=require(_0xfe83('0x5'));var util=require('util');var path=require(_0xfe83('0x6'));var sox=require(_0xfe83('0x7'));var csv=require(_0xfe83('0x8'));var ejs=require(_0xfe83('0x9'));var fs=require('fs');var _=require(_0xfe83('0xa'));var squel=require(_0xfe83('0xb'));var crypto=require('crypto');var jsforce=require(_0xfe83('0xc'));var deskjs=require(_0xfe83('0xd'));var toCsv=require(_0xfe83('0x8'));var querystring=require(_0xfe83('0xe'));var Papa=require('papaparse');var Redis=require(_0xfe83('0xf'));var authService=require(_0xfe83('0x10'));var qs=require(_0xfe83('0x11'));var as=require(_0xfe83('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfe83('0x13'))(_0xfe83('0x14'));var utils=require(_0xfe83('0x15'));var config=require(_0xfe83('0x16'));var db=require(_0xfe83('0x17'))['db'];function respondWithStatusCode(_0x4d4051,_0x1c9aef){_0x1c9aef=_0x1c9aef||0xcc;return function(_0x2dfc3c){if(_0x2dfc3c){return _0x4d4051[_0xfe83('0x18')](_0x1c9aef);}return _0x4d4051[_0xfe83('0x19')](_0x1c9aef)[_0xfe83('0x1a')]();};}function respondWithResult(_0x2fa6cc,_0x21ce8f){_0x21ce8f=_0x21ce8f||0xc8;return function(_0xd03af9){if(_0xd03af9){return _0x2fa6cc[_0xfe83('0x19')](_0x21ce8f)['json'](_0xd03af9);}};}function respondWithFilteredResult(_0x4e45e6,_0x2a48af){return function(_0x3b89d0){if(_0x3b89d0){var _0x595712=_0x3b89d0[_0xfe83('0x1b')],_0x274911=_0x2a48af[_0xfe83('0x1c')],_0x29724e=_0x2a48af[_0xfe83('0x1c')]+_0x2a48af[_0xfe83('0x1d')],_0x151a45;if(_0x29724e>=_0x595712){_0x29724e=_0x595712;_0x151a45=0xc8;}else{_0x151a45=0xce;}_0x4e45e6['status'](_0x151a45);return _0x4e45e6[_0xfe83('0x1e')](_0xfe83('0x1f'),_0x274911+'-'+_0x29724e+'/'+_0x595712)[_0xfe83('0x20')](_0x3b89d0);}return null;};}function patchUpdates(_0x5bd075){return function(_0x54afe7){try{jsonpatch[_0xfe83('0x21')](_0x54afe7,_0x5bd075,!![]);}catch(_0x32855b){return BPromise[_0xfe83('0x22')](_0x32855b);}return _0x54afe7[_0xfe83('0x23')]();};}function saveUpdates(_0x2a1afc,_0x8289ce){return function(_0xfa784){if(_0xfa784){return _0xfa784['update'](_0x2a1afc)[_0xfe83('0x24')](function(_0x2ed181){return _0x2ed181;});}return null;};}function removeEntity(_0x353501,_0x322b74){return function(_0x295122){if(_0x295122){return _0x295122[_0xfe83('0x25')]()['then'](function(){_0x353501[_0xfe83('0x19')](0xcc)[_0xfe83('0x1a')]();});}};}function handleEntityNotFound(_0x31309a,_0x18a3cb){return function(_0x2021e3){if(!_0x2021e3){_0x31309a[_0xfe83('0x18')](0x194);}return _0x2021e3;};}function handleError(_0x4ce867,_0x1041e0){_0x1041e0=_0x1041e0||0x1f4;return function(_0x168796){logger[_0xfe83('0x26')](_0x168796[_0xfe83('0x27')]);if(_0x168796['name']){delete _0x168796[_0xfe83('0x28')];}_0x4ce867[_0xfe83('0x19')](_0x1041e0)[_0xfe83('0x29')](_0x168796);};}exports['index']=function(_0x1df45f,_0x2ab06a){var _0x167747={},_0x5eb46c={},_0x5bbcfc={'count':0x0,'rows':[]};var _0x1639d7=_[_0xfe83('0x2a')](db['MailQueueReport']['rawAttributes'],function(_0x7c419c){return{'name':_0x7c419c['fieldName'],'type':_0x7c419c[_0xfe83('0x2b')][_0xfe83('0x2c')]};});_0x5eb46c[_0xfe83('0x2d')]=_['map'](_0x1639d7,_0xfe83('0x28'));_0x5eb46c[_0xfe83('0x2e')]=_['keys'](_0x1df45f['query']);_0x5eb46c['filters']=_[_0xfe83('0x2f')](_0x5eb46c[_0xfe83('0x2d')],_0x5eb46c['query']);_0x167747[_0xfe83('0x30')]=_['intersection'](_0x5eb46c['model'],qs[_0xfe83('0x31')](_0x1df45f[_0xfe83('0x2e')][_0xfe83('0x31')]));_0x167747[_0xfe83('0x30')]=_0x167747[_0xfe83('0x30')][_0xfe83('0x32')]?_0x167747['attributes']:_0x5eb46c[_0xfe83('0x2d')];if(!_0x1df45f[_0xfe83('0x2e')][_0xfe83('0x33')](_0xfe83('0x34'))){_0x167747[_0xfe83('0x1d')]=qs['limit'](_0x1df45f['query'][_0xfe83('0x1d')]);_0x167747[_0xfe83('0x1c')]=qs[_0xfe83('0x1c')](_0x1df45f[_0xfe83('0x2e')]['offset']);}_0x167747[_0xfe83('0x35')]=qs['sort'](_0x1df45f[_0xfe83('0x2e')]['sort']);_0x167747[_0xfe83('0x36')]=qs[_0xfe83('0x37')](_[_0xfe83('0x38')](_0x1df45f[_0xfe83('0x2e')],_0x5eb46c[_0xfe83('0x37')]));if(_0x1df45f[_0xfe83('0x2e')][_0xfe83('0x39')]){_0x167747[_0xfe83('0x36')]=_[_0xfe83('0x3a')](_0x167747[_0xfe83('0x36')],{'$or':_[_0xfe83('0x2a')](_0x1639d7,function(_0xbdb5a2){if(_0xbdb5a2[_0xfe83('0x2b')]!=='VIRTUAL'){var _0x2a3698={};_0x2a3698[_0xbdb5a2[_0xfe83('0x28')]]={'$like':'%'+_0x1df45f[_0xfe83('0x2e')][_0xfe83('0x39')]+'%'};return _0x2a3698;}})});}_0x167747=_['merge']({},_0x167747,_0x1df45f['options']);var _0x5b0805={'where':_0x167747[_0xfe83('0x36')]};return db['MailQueueReport'][_0xfe83('0x1b')](_0x5b0805)[_0xfe83('0x24')](function(_0x25589e){_0x5bbcfc[_0xfe83('0x1b')]=_0x25589e;if(_0x1df45f[_0xfe83('0x2e')][_0xfe83('0x3b')]){_0x167747['include']=[{'all':!![]}];}return db[_0xfe83('0x3c')][_0xfe83('0x3d')](_0x167747);})[_0xfe83('0x24')](function(_0x1a6902){_0x5bbcfc['rows']=_0x1a6902;return _0x5bbcfc;})[_0xfe83('0x24')](respondWithFilteredResult(_0x2ab06a,_0x167747))[_0xfe83('0x3e')](handleError(_0x2ab06a,null));};exports[_0xfe83('0x3f')]=function(_0x3e64ab,_0x401fea){var _0x819035={'raw':!![],'where':{'id':_0x3e64ab[_0xfe83('0x40')]['id']}},_0x11d955={};_0x11d955[_0xfe83('0x2d')]=_['keys'](db[_0xfe83('0x3c')][_0xfe83('0x41')]);_0x11d955[_0xfe83('0x2e')]=_['keys'](_0x3e64ab[_0xfe83('0x2e')]);_0x11d955['filters']=_[_0xfe83('0x2f')](_0x11d955[_0xfe83('0x2d')],_0x11d955['query']);_0x819035[_0xfe83('0x30')]=_[_0xfe83('0x2f')](_0x11d955[_0xfe83('0x2d')],qs['fields'](_0x3e64ab[_0xfe83('0x2e')][_0xfe83('0x31')]));_0x819035['attributes']=_0x819035['attributes'][_0xfe83('0x32')]?_0x819035[_0xfe83('0x30')]:_0x11d955[_0xfe83('0x2d')];if(_0x3e64ab['query']['includeAll']){_0x819035[_0xfe83('0x42')]=[{'all':!![]}];}_0x819035=_[_0xfe83('0x3a')]({},_0x819035,_0x3e64ab[_0xfe83('0x43')]);return db[_0xfe83('0x3c')][_0xfe83('0x44')](_0x819035)[_0xfe83('0x24')](handleEntityNotFound(_0x401fea,null))['then'](respondWithResult(_0x401fea,null))['catch'](handleError(_0x401fea,null));};exports['create']=function(_0x118da0,_0x351275){return db[_0xfe83('0x3c')][_0xfe83('0x45')](_0x118da0[_0xfe83('0x46')],{})[_0xfe83('0x24')](respondWithResult(_0x351275,0xc9))[_0xfe83('0x3e')](handleError(_0x351275,null));};exports[_0xfe83('0x47')]=function(_0x4075e9,_0x52013c){if(_0x4075e9[_0xfe83('0x46')]['id']){delete _0x4075e9[_0xfe83('0x46')]['id'];}return db[_0xfe83('0x3c')][_0xfe83('0x44')]({'where':{'id':_0x4075e9['params']['id']}})['then'](handleEntityNotFound(_0x52013c,null))['then'](saveUpdates(_0x4075e9[_0xfe83('0x46')],null))['then'](respondWithResult(_0x52013c,null))['catch'](handleError(_0x52013c,null));};exports[_0xfe83('0x25')]=function(_0x276050,_0x49356a){return db[_0xfe83('0x3c')][_0xfe83('0x44')]({'where':{'id':_0x276050['params']['id']}})['then'](handleEntityNotFound(_0x49356a,null))[_0xfe83('0x24')](removeEntity(_0x49356a,null))[_0xfe83('0x3e')](handleError(_0x49356a,null));};exports[_0xfe83('0x48')]=function(_0x140cd4,_0x33486d){return db[_0xfe83('0x3c')][_0xfe83('0x48')]()[_0xfe83('0x24')](respondWithResult(_0x33486d,null))['catch'](handleError(_0x33486d,null));}; \ No newline at end of file +var _0x4212=['body','find','params','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','save','update','destroy','then','name','send','index','map','MailQueueReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','rows','catch','length','create'];(function(_0x35baad,_0x484434){var _0x3a925c=function(_0x27b1e9){while(--_0x27b1e9){_0x35baad['push'](_0x35baad['shift']());}};_0x3a925c(++_0x484434);}(_0x4212,0x158));var _0x2421=function(_0x3cb6dc,_0x120dd3){_0x3cb6dc=_0x3cb6dc-0x0;var _0x47ec89=_0x4212[_0x3cb6dc];return _0x47ec89;};'use strict';var pdf=require(_0x2421('0x0'));var emlformat=require(_0x2421('0x1'));var rimraf=require(_0x2421('0x2'));var zipdir=require(_0x2421('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2421('0x4'));var moment=require('moment');var BPromise=require(_0x2421('0x5'));var Mustache=require('mustache');var util=require(_0x2421('0x6'));var path=require(_0x2421('0x7'));var sox=require('sox');var csv=require(_0x2421('0x8'));var ejs=require(_0x2421('0x9'));var fs=require('fs');var _=require(_0x2421('0xa'));var squel=require(_0x2421('0xb'));var crypto=require('crypto');var jsforce=require(_0x2421('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2421('0xd'));var Papa=require(_0x2421('0xe'));var Redis=require('ioredis');var authService=require(_0x2421('0xf'));var qs=require(_0x2421('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2421('0x11'));var logger=require(_0x2421('0x12'))('api');var utils=require(_0x2421('0x13'));var config=require(_0x2421('0x14'));var db=require(_0x2421('0x15'))['db'];function respondWithStatusCode(_0x49c918,_0x29f7c7){_0x29f7c7=_0x29f7c7||0xcc;return function(_0x49c9ce){if(_0x49c9ce){return _0x49c918[_0x2421('0x16')](_0x29f7c7);}return _0x49c918[_0x2421('0x17')](_0x29f7c7)[_0x2421('0x18')]();};}function respondWithResult(_0x487b00,_0xbe8ad){_0xbe8ad=_0xbe8ad||0xc8;return function(_0x10631b){if(_0x10631b){return _0x487b00[_0x2421('0x17')](_0xbe8ad)[_0x2421('0x19')](_0x10631b);}};}function respondWithFilteredResult(_0xba389e,_0x338dd7){return function(_0x9d0fe6){if(_0x9d0fe6){var _0x2b9d47=_0x9d0fe6[_0x2421('0x1a')],_0x5a1e6c=_0x338dd7[_0x2421('0x1b')],_0x584f88=_0x338dd7[_0x2421('0x1b')]+_0x338dd7[_0x2421('0x1c')],_0x2d6912;if(_0x584f88>=_0x2b9d47){_0x584f88=_0x2b9d47;_0x2d6912=0xc8;}else{_0x2d6912=0xce;}_0xba389e[_0x2421('0x17')](_0x2d6912);return _0xba389e['set'](_0x2421('0x1d'),_0x5a1e6c+'-'+_0x584f88+'/'+_0x2b9d47)[_0x2421('0x19')](_0x9d0fe6);}return null;};}function patchUpdates(_0x3d3e1e){return function(_0x11fd92){try{jsonpatch['apply'](_0x11fd92,_0x3d3e1e,!![]);}catch(_0x2845f6){return BPromise['reject'](_0x2845f6);}return _0x11fd92[_0x2421('0x1e')]();};}function saveUpdates(_0xd9a387,_0x527363){return function(_0x558013){if(_0x558013){return _0x558013[_0x2421('0x1f')](_0xd9a387)['then'](function(_0xc8faa6){return _0xc8faa6;});}return null;};}function removeEntity(_0x540e8b,_0x3f16a4){return function(_0xa61183){if(_0xa61183){return _0xa61183[_0x2421('0x20')]()[_0x2421('0x21')](function(){_0x540e8b['status'](0xcc)[_0x2421('0x18')]();});}};}function handleEntityNotFound(_0x2764df,_0x4dc7b8){return function(_0x2db781){if(!_0x2db781){_0x2764df[_0x2421('0x16')](0x194);}return _0x2db781;};}function handleError(_0x595681,_0xcacaf){_0xcacaf=_0xcacaf||0x1f4;return function(_0x549443){logger['error'](_0x549443['stack']);if(_0x549443[_0x2421('0x22')]){delete _0x549443[_0x2421('0x22')];}_0x595681['status'](_0xcacaf)[_0x2421('0x23')](_0x549443);};}exports[_0x2421('0x24')]=function(_0x18f93d,_0x3c654c){var _0x9c47b7={},_0x4904a6={},_0x11f5a6={'count':0x0,'rows':[]};var _0x2f0fd7=_[_0x2421('0x25')](db[_0x2421('0x26')][_0x2421('0x27')],function(_0x582e3d){return{'name':_0x582e3d[_0x2421('0x28')],'type':_0x582e3d[_0x2421('0x29')][_0x2421('0x2a')]};});_0x4904a6['model']=_[_0x2421('0x25')](_0x2f0fd7,_0x2421('0x22'));_0x4904a6[_0x2421('0x2b')]=_[_0x2421('0x2c')](_0x18f93d[_0x2421('0x2b')]);_0x4904a6[_0x2421('0x2d')]=_[_0x2421('0x2e')](_0x4904a6[_0x2421('0x2f')],_0x4904a6[_0x2421('0x2b')]);_0x9c47b7[_0x2421('0x30')]=_[_0x2421('0x2e')](_0x4904a6[_0x2421('0x2f')],qs[_0x2421('0x31')](_0x18f93d[_0x2421('0x2b')][_0x2421('0x31')]));_0x9c47b7[_0x2421('0x30')]=_0x9c47b7[_0x2421('0x30')]['length']?_0x9c47b7[_0x2421('0x30')]:_0x4904a6[_0x2421('0x2f')];if(!_0x18f93d[_0x2421('0x2b')][_0x2421('0x32')](_0x2421('0x33'))){_0x9c47b7[_0x2421('0x1c')]=qs[_0x2421('0x1c')](_0x18f93d['query']['limit']);_0x9c47b7[_0x2421('0x1b')]=qs['offset'](_0x18f93d['query'][_0x2421('0x1b')]);}_0x9c47b7[_0x2421('0x34')]=qs['sort'](_0x18f93d[_0x2421('0x2b')][_0x2421('0x35')]);_0x9c47b7[_0x2421('0x36')]=qs['filters'](_['pick'](_0x18f93d[_0x2421('0x2b')],_0x4904a6[_0x2421('0x2d')]));if(_0x18f93d['query'][_0x2421('0x37')]){_0x9c47b7[_0x2421('0x36')]=_[_0x2421('0x38')](_0x9c47b7[_0x2421('0x36')],{'$or':_[_0x2421('0x25')](_0x2f0fd7,function(_0x307b4a){if(_0x307b4a[_0x2421('0x29')]!==_0x2421('0x39')){var _0x32fad3={};_0x32fad3[_0x307b4a[_0x2421('0x22')]]={'$like':'%'+_0x18f93d[_0x2421('0x2b')]['filter']+'%'};return _0x32fad3;}})});}_0x9c47b7=_[_0x2421('0x38')]({},_0x9c47b7,_0x18f93d[_0x2421('0x3a')]);var _0x203f4d={'where':_0x9c47b7[_0x2421('0x36')]};return db[_0x2421('0x26')][_0x2421('0x1a')](_0x203f4d)['then'](function(_0x55c7ca){_0x11f5a6[_0x2421('0x1a')]=_0x55c7ca;if(_0x18f93d[_0x2421('0x2b')]['includeAll']){_0x9c47b7[_0x2421('0x3b')]=[{'all':!![]}];}return db[_0x2421('0x26')]['findAll'](_0x9c47b7);})['then'](function(_0x5c34e7){_0x11f5a6[_0x2421('0x3c')]=_0x5c34e7;return _0x11f5a6;})[_0x2421('0x21')](respondWithFilteredResult(_0x3c654c,_0x9c47b7))[_0x2421('0x3d')](handleError(_0x3c654c,null));};exports['show']=function(_0x41df3a,_0x142f0b){var _0x39326f={'raw':!![],'where':{'id':_0x41df3a['params']['id']}},_0x4c918b={};_0x4c918b[_0x2421('0x2f')]=_['keys'](db['MailQueueReport'][_0x2421('0x27')]);_0x4c918b[_0x2421('0x2b')]=_[_0x2421('0x2c')](_0x41df3a[_0x2421('0x2b')]);_0x4c918b[_0x2421('0x2d')]=_[_0x2421('0x2e')](_0x4c918b[_0x2421('0x2f')],_0x4c918b[_0x2421('0x2b')]);_0x39326f[_0x2421('0x30')]=_[_0x2421('0x2e')](_0x4c918b[_0x2421('0x2f')],qs[_0x2421('0x31')](_0x41df3a['query'][_0x2421('0x31')]));_0x39326f[_0x2421('0x30')]=_0x39326f[_0x2421('0x30')][_0x2421('0x3e')]?_0x39326f[_0x2421('0x30')]:_0x4c918b['model'];if(_0x41df3a[_0x2421('0x2b')]['includeAll']){_0x39326f[_0x2421('0x3b')]=[{'all':!![]}];}_0x39326f=_[_0x2421('0x38')]({},_0x39326f,_0x41df3a[_0x2421('0x3a')]);return db[_0x2421('0x26')]['find'](_0x39326f)[_0x2421('0x21')](handleEntityNotFound(_0x142f0b,null))[_0x2421('0x21')](respondWithResult(_0x142f0b,null))[_0x2421('0x3d')](handleError(_0x142f0b,null));};exports['create']=function(_0x79abcb,_0x5f52ef){return db[_0x2421('0x26')][_0x2421('0x3f')](_0x79abcb[_0x2421('0x40')],{})[_0x2421('0x21')](respondWithResult(_0x5f52ef,0xc9))['catch'](handleError(_0x5f52ef,null));};exports[_0x2421('0x1f')]=function(_0x2b090b,_0x212ff9){if(_0x2b090b[_0x2421('0x40')]['id']){delete _0x2b090b[_0x2421('0x40')]['id'];}return db[_0x2421('0x26')][_0x2421('0x41')]({'where':{'id':_0x2b090b[_0x2421('0x42')]['id']}})[_0x2421('0x21')](handleEntityNotFound(_0x212ff9,null))[_0x2421('0x21')](saveUpdates(_0x2b090b['body'],null))['then'](respondWithResult(_0x212ff9,null))[_0x2421('0x3d')](handleError(_0x212ff9,null));};exports[_0x2421('0x20')]=function(_0x323ad3,_0x3da303){return db[_0x2421('0x26')][_0x2421('0x41')]({'where':{'id':_0x323ad3[_0x2421('0x42')]['id']}})[_0x2421('0x21')](handleEntityNotFound(_0x3da303,null))[_0x2421('0x21')](removeEntity(_0x3da303,null))[_0x2421('0x3d')](handleError(_0x3da303,null));};exports[_0x2421('0x43')]=function(_0x947011,_0x3040d4){return db[_0x2421('0x26')][_0x2421('0x43')]()[_0x2421('0x21')](respondWithResult(_0x3040d4,null))['catch'](handleError(_0x3040d4,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index ab8c057..f544a82 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 _0x8bb2=['./mailQueueReport.attributes','exports','define','MailQueueReport','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x119452,_0x5c0b58){var _0x434d68=function(_0x354b02){while(--_0x354b02){_0x119452['push'](_0x119452['shift']());}};_0x434d68(++_0x5c0b58);}(_0x8bb2,0x1b1));var _0x28bb=function(_0x383356,_0x33d2f5){_0x383356=_0x383356-0x0;var _0x32ee5a=_0x8bb2[_0x383356];return _0x32ee5a;};'use strict';var _=require('lodash');var util=require(_0x28bb('0x0'));var logger=require('../../config/logger')(_0x28bb('0x1'));var moment=require(_0x28bb('0x2'));var BPromise=require(_0x28bb('0x3'));var rp=require(_0x28bb('0x4'));var fs=require('fs');var path=require(_0x28bb('0x5'));var rimraf=require(_0x28bb('0x6'));var config=require('../../config/environment');var attributes=require(_0x28bb('0x7'));module[_0x28bb('0x8')]=function(_0x1698c5,_0x2c8cef){return _0x1698c5[_0x28bb('0x9')](_0x28bb('0xa'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7495=['../../config/environment','./mailQueueReport.attributes','MailQueueReport','report_mail_queue','uniqueid','lodash','util','api','moment','path','rimraf'];(function(_0x5d0ff5,_0x4ae45d){var _0x12e5d5=function(_0x8cbd17){while(--_0x8cbd17){_0x5d0ff5['push'](_0x5d0ff5['shift']());}};_0x12e5d5(++_0x4ae45d);}(_0x7495,0x15a));var _0x5749=function(_0x503306,_0x356f2f){_0x503306=_0x503306-0x0;var _0x44a99d=_0x7495[_0x503306];return _0x44a99d;};'use strict';var _=require(_0x5749('0x0'));var util=require(_0x5749('0x1'));var logger=require('../../config/logger')(_0x5749('0x2'));var moment=require(_0x5749('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5749('0x4'));var rimraf=require(_0x5749('0x5'));var config=require(_0x5749('0x6'));var attributes=require(_0x5749('0x7'));module['exports']=function(_0x51b327,_0x49fbd){return _0x51b327['define'](_0x5749('0x8'),attributes,{'tableName':_0x5749('0x9'),'paranoid':![],'indexes':[{'name':_0x5749('0xa'),'fields':[_0x5749('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 14f9cd5..5a700e6 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 _0xdb28=['UpdateMailQueueReport','MailQueueReport','update','raw','where','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','CreateMailQueueReport','create','body','options'];(function(_0x1d0304,_0x315c51){var _0x2ef571=function(_0x37f359){while(--_0x37f359){_0x1d0304['push'](_0x1d0304['shift']());}};_0x2ef571(++_0x315c51);}(_0xdb28,0x106));var _0x8db2=function(_0x38d942,_0x5da7b3){_0x38d942=_0x38d942-0x0;var _0x436f69=_0xdb28[_0x38d942];return _0x436f69;};'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')]('MailQueueReport,\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);});});}exports[_0x8db2('0x16')]=function(_0x3fddc2){var _0x2efd06=this;return new Promise(function(_0x46ce14,_0x51d60d){return db['MailQueueReport'][_0x8db2('0x17')](_0x3fddc2[_0x8db2('0x18')],{'raw':_0x3fddc2[_0x8db2('0x19')]?_0x3fddc2[_0x8db2('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x8db2('0xc')](function(_0x36a9ff){logger[_0x8db2('0x14')](_0x8db2('0x16'),_0x3fddc2);logger[_0x8db2('0xf')]('CreateMailQueueReport',_0x3fddc2,JSON[_0x8db2('0x10')](_0x36a9ff));_0x46ce14(_0x36a9ff);})[_0x8db2('0x15')](function(_0x18f69c){logger[_0x8db2('0x11')](_0x8db2('0x16'),_0x18f69c[_0x8db2('0x13')],_0x3fddc2);_0x51d60d(_0x2efd06[_0x8db2('0x11')](0x1f4,_0x18f69c['message']));});});};exports[_0x8db2('0x1a')]=function(_0x4f6516){var _0x5725f0=this;return new Promise(function(_0x52a9ca,_0x4d923c){return db[_0x8db2('0x1b')][_0x8db2('0x1c')](_0x4f6516[_0x8db2('0x18')],{'raw':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f6516['options']?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1e')]||null:null,'attributes':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')]['attributes']||null:null,'limit':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1f')]||null:null})[_0x8db2('0xc')](function(_0xbe5ece){logger[_0x8db2('0x14')](_0x8db2('0x1a'),_0x4f6516);logger[_0x8db2('0xf')](_0x8db2('0x1a'),_0x4f6516,JSON['stringify'](_0xbe5ece));_0x52a9ca(_0xbe5ece);})[_0x8db2('0x15')](function(_0x50b28d){logger['error'](_0x8db2('0x1a'),_0x50b28d[_0x8db2('0x13')],_0x4f6516);_0x4d923c(_0x5725f0[_0x8db2('0x11')](0x1f4,_0x50b28d['message']));});});}; \ No newline at end of file +var _0x524e=['info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','MailQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailQueueReport','create','options','CreateMailQueueReport','catch','UpdateMailQueueReport','update','body','raw','attributes','limit','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x524e,0x15e));var _0xe524=function(_0x4b4ac9,_0x1a0c64){_0x4b4ac9=_0x4b4ac9-0x0;var _0x197242=_0x524e[_0x4b4ac9];return _0x197242;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe524('0x0'));var BPromise=require(_0xe524('0x1'));var rs=require(_0xe524('0x2'));var fs=require('fs');var Redis=require(_0xe524('0x3'));var db=require(_0xe524('0x4'))['db'];var utils=require(_0xe524('0x5'));var logger=require(_0xe524('0x6'))(_0xe524('0x7'));var config=require(_0xe524('0x8'));var jayson=require(_0xe524('0x9'));var client=jayson['client'][_0xe524('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41e1a3,_0x347bed,_0x533c14){return new BPromise(function(_0x384935,_0x3e4cda){return client[_0xe524('0xb')](_0x41e1a3,_0x533c14)[_0xe524('0xc')](function(_0x991924){logger[_0xe524('0xd')](_0xe524('0xe'),_0x347bed,_0xe524('0xf'));logger[_0xe524('0x10')](_0xe524('0x11'),_0x347bed,_0xe524('0xf'),JSON[_0xe524('0x12')](_0x991924));if(_0x991924[_0xe524('0x13')]){if(_0x991924[_0xe524('0x13')][_0xe524('0x14')]===0x1f4){logger[_0xe524('0x13')]('MailQueueReport,\x20%s,\x20%s',_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x3e4cda(_0x991924[_0xe524('0x13')][_0xe524('0x15')]);}logger[_0xe524('0x13')](_0xe524('0xe'),_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x384935(_0x991924['error'][_0xe524('0x15')]);}else{logger[_0xe524('0xd')]('MailQueueReport,\x20%s,\x20%s',_0x347bed,_0xe524('0xf'));_0x384935(_0x991924['result'][_0xe524('0x15')]);}})['catch'](function(_0x29a031){logger['error']('MailQueueReport,\x20%s,\x20%s',_0x347bed,_0x29a031);_0x3e4cda(_0x29a031);});});}exports['CreateMailQueueReport']=function(_0x3a4027){var _0x4f1dfb=this;return new Promise(function(_0x11b2a1,_0x238f8f){return db[_0xe524('0x16')][_0xe524('0x17')](_0x3a4027['body'],{'raw':_0x3a4027[_0xe524('0x18')]?_0x3a4027[_0xe524('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xe524('0xc')](function(_0x309f85){logger[_0xe524('0xd')](_0xe524('0x19'),_0x3a4027);logger[_0xe524('0x10')](_0xe524('0x19'),_0x3a4027,JSON[_0xe524('0x12')](_0x309f85));_0x11b2a1(_0x309f85);})[_0xe524('0x1a')](function(_0x7dfe97){logger['error'](_0xe524('0x19'),_0x7dfe97['message'],_0x3a4027);_0x238f8f(_0x4f1dfb['error'](0x1f4,_0x7dfe97[_0xe524('0x15')]));});});};exports[_0xe524('0x1b')]=function(_0x1ad106){var _0x85fc51=this;return new Promise(function(_0x599d5d,_0x158f07){return db['MailQueueReport'][_0xe524('0x1c')](_0x1ad106[_0xe524('0x1d')],{'raw':_0x1ad106[_0xe524('0x18')]?_0x1ad106[_0xe524('0x18')][_0xe524('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ad106[_0xe524('0x18')]?_0x1ad106[_0xe524('0x18')]['where']||null:null,'attributes':_0x1ad106['options']?_0x1ad106[_0xe524('0x18')][_0xe524('0x1f')]||null:null,'limit':_0x1ad106[_0xe524('0x18')]?_0x1ad106[_0xe524('0x18')][_0xe524('0x20')]||null:null})['then'](function(_0x52f140){logger[_0xe524('0xd')](_0xe524('0x1b'),_0x1ad106);logger[_0xe524('0x10')](_0xe524('0x1b'),_0x1ad106,JSON[_0xe524('0x12')](_0x52f140));_0x599d5d(_0x52f140);})['catch'](function(_0x365a1f){logger[_0xe524('0x13')]('UpdateMailQueueReport',_0x365a1f['message'],_0x1ad106);_0x158f07(_0x85fc51[_0xe524('0x13')](0x1f4,_0x365a1f[_0xe524('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 71e224d..b690537 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 _0x01d3=['exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x56b6d5,_0x388f95){var _0x2fb790=function(_0x2a41b0){while(--_0x2a41b0){_0x56b6d5['push'](_0x56b6d5['shift']());}};_0x2fb790(++_0x388f95);}(_0x01d3,0x184));var _0x301d=function(_0x1ae663,_0x14c20d){_0x1ae663=_0x1ae663-0x0;var _0x5cd864=_0x01d3[_0x1ae663];return _0x5cd864;};'use strict';var multer=require('multer');var util=require(_0x301d('0x0'));var path=require(_0x301d('0x1'));var timeout=require(_0x301d('0x2'));var express=require(_0x301d('0x3'));var router=express[_0x301d('0x4')]();var auth=require(_0x301d('0x5'));var interaction=require(_0x301d('0x6'));var config=require(_0x301d('0x7'));module[_0x301d('0x8')]=router; \ No newline at end of file +var _0x7a72=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','util','path'];(function(_0x3725ad,_0x4cb410){var _0x2580ca=function(_0x3a44d3){while(--_0x3a44d3){_0x3725ad['push'](_0x3725ad['shift']());}};_0x2580ca(++_0x4cb410);}(_0x7a72,0xbe));var _0x27a7=function(_0x34affc,_0x1ffce9){_0x34affc=_0x34affc-0x0;var _0x1f7aac=_0x7a72[_0x34affc];return _0x1f7aac;};'use strict';var multer=require('multer');var util=require(_0x27a7('0x0'));var path=require(_0x27a7('0x1'));var timeout=require(_0x27a7('0x2'));var express=require(_0x27a7('0x3'));var router=express[_0x27a7('0x4')]();var auth=require(_0x27a7('0x5'));var interaction=require(_0x27a7('0x6'));var config=require(_0x27a7('0x7'));module['exports']=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 57576aa..9112459 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 _0x656a=['username','INTEGER','INBOX','sequelize','exports','STRING','BOOLEAN'];(function(_0x46f504,_0x141725){var _0x1c33e7=function(_0x442e8a){while(--_0x442e8a){_0x46f504['push'](_0x46f504['shift']());}};_0x1c33e7(++_0x141725);}(_0x656a,0x176));var _0xa656=function(_0x334524,_0x1fca82){_0x334524=_0x334524-0x0;var _0x870ae9=_0x656a[_0x334524];return _0x870ae9;};'use strict';var Sequelize=require(_0xa656('0x0'));module[_0xa656('0x1')]={'description':{'type':Sequelize[_0xa656('0x2')]},'host':{'type':Sequelize[_0xa656('0x2')]},'authentication':{'type':Sequelize[_0xa656('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0xa656('0x2')],'unique':_0xa656('0x4')},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xa656('0x5')]},'tls':{'type':Sequelize[_0xa656('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xa656('0x2')],'defaultValue':_0xa656('0x6')},'connTimeout':{'type':Sequelize[_0xa656('0x5')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0xa656('0x2')]}}; \ No newline at end of file +var _0x1c92=['STRING','BOOLEAN','username','INTEGER','INBOX'];(function(_0x2ace43,_0x57679b){var _0x528956=function(_0x51fb5e){while(--_0x51fb5e){_0x2ace43['push'](_0x2ace43['shift']());}};_0x528956(++_0x57679b);}(_0x1c92,0x195));var _0x21c9=function(_0x53cf8e,_0x3d290f){_0x53cf8e=_0x53cf8e-0x0;var _0x459197=_0x1c92[_0x53cf8e];return _0x459197;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x21c9('0x0')]},'host':{'type':Sequelize[_0x21c9('0x0')]},'authentication':{'type':Sequelize[_0x21c9('0x1')],'defaultValue':!![]},'user':{'type':Sequelize['STRING'],'unique':_0x21c9('0x2')},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x21c9('0x3')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x21c9('0x0')],'defaultValue':_0x21c9('0x4')},'connTimeout':{'type':Sequelize[_0x21c9('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x21c9('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x21c9('0x0')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 55ad913..b00931e 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 _0xd523=['exports','MailServerIn','mail_servers_in','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./mailServerIn.attributes'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd523,0x153));var _0x3d52=function(_0x20e127,_0xbcbd6){_0x20e127=_0x20e127-0x0;var _0x2f1eb5=_0xd523[_0x20e127];return _0x2f1eb5;};'use strict';var _=require(_0x3d52('0x0'));var util=require(_0x3d52('0x1'));var logger=require(_0x3d52('0x2'))(_0x3d52('0x3'));var moment=require('moment');var BPromise=require(_0x3d52('0x4'));var rp=require(_0x3d52('0x5'));var fs=require('fs');var path=require(_0x3d52('0x6'));var rimraf=require('rimraf');var config=require(_0x3d52('0x7'));var attributes=require(_0x3d52('0x8'));module[_0x3d52('0x9')]=function(_0x46a0e9,_0x580f82){return _0x46a0e9['define'](_0x3d52('0xa'),attributes,{'tableName':_0x3d52('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xde9f=['lodash','api','moment','request-promise','path','../../config/environment','./mailServerIn.attributes','exports','MailServerIn','mail_servers_in'];(function(_0x173f10,_0x35db61){var _0x53142d=function(_0x37bbef){while(--_0x37bbef){_0x173f10['push'](_0x173f10['shift']());}};_0x53142d(++_0x35db61);}(_0xde9f,0x118));var _0xfde9=function(_0x46a3ff,_0x470b9a){_0x46a3ff=_0x46a3ff-0x0;var _0x404bc2=_0xde9f[_0x46a3ff];return _0x404bc2;};'use strict';var _=require(_0xfde9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xfde9('0x1'));var moment=require(_0xfde9('0x2'));var BPromise=require('bluebird');var rp=require(_0xfde9('0x3'));var fs=require('fs');var path=require(_0xfde9('0x4'));var rimraf=require('rimraf');var config=require(_0xfde9('0x5'));var attributes=require(_0xfde9('0x6'));module[_0xfde9('0x7')]=function(_0xe30eaf,_0x5e69c0){return _0xe30eaf['define'](_0xfde9('0x8'),attributes,{'tableName':_0xfde9('0x9'),'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 38b7739..ab2f7fd 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 _0x7f0a=['GetMailServerIn','MailServerIn','findAll','options','where','attributes','limit','include','map','model','stringify','catch','util','moment','randomstring','../../mysqldb','rpc','jayson/promise','then','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result'];(function(_0x4fb334,_0x4ca8c9){var _0x56dc84=function(_0x470d7b){while(--_0x470d7b){_0x4fb334['push'](_0x4fb334['shift']());}};_0x56dc84(++_0x4ca8c9);}(_0x7f0a,0x12a));var _0xa7f0=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x7f0a[_0x5783f4];return _0x28e380;};'use strict';var _=require('lodash');var util=require(_0xa7f0('0x0'));var moment=require(_0xa7f0('0x1'));var BPromise=require('bluebird');var rs=require(_0xa7f0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa7f0('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa7f0('0x4'));var config=require('../../config/environment');var jayson=require(_0xa7f0('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2182c2,_0x42facf,_0x512eb2){return new BPromise(function(_0x2f74e6,_0x957282){return client['request'](_0x2182c2,_0x512eb2)[_0xa7f0('0x6')](function(_0x31e3c7){logger['info'](_0xa7f0('0x7'),_0x42facf,_0xa7f0('0x8'));logger[_0xa7f0('0x9')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x42facf,_0xa7f0('0x8'),JSON['stringify'](_0x31e3c7));if(_0x31e3c7[_0xa7f0('0xa')]){if(_0x31e3c7[_0xa7f0('0xa')]['code']===0x1f4){logger[_0xa7f0('0xa')](_0xa7f0('0x7'),_0x42facf,_0x31e3c7[_0xa7f0('0xa')][_0xa7f0('0xb')]);return _0x957282(_0x31e3c7['error'][_0xa7f0('0xb')]);}logger[_0xa7f0('0xa')](_0xa7f0('0x7'),_0x42facf,_0x31e3c7['error'][_0xa7f0('0xb')]);return _0x2f74e6(_0x31e3c7[_0xa7f0('0xa')]['message']);}else{logger[_0xa7f0('0xc')]('MailServerIn,\x20%s,\x20%s',_0x42facf,_0xa7f0('0x8'));_0x2f74e6(_0x31e3c7[_0xa7f0('0xd')]['message']);}})['catch'](function(_0x1e5902){logger[_0xa7f0('0xa')](_0xa7f0('0x7'),_0x42facf,_0x1e5902);_0x957282(_0x1e5902);});});}exports[_0xa7f0('0xe')]=function(_0x1d9675){var _0x238059=this;return new Promise(function(_0x299d08,_0x50162c){return db[_0xa7f0('0xf')][_0xa7f0('0x10')]({'raw':_0x1d9675[_0xa7f0('0x11')]?_0x1d9675['options']['raw']===undefined?!![]:![]:!![],'where':_0x1d9675['options']?_0x1d9675[_0xa7f0('0x11')][_0xa7f0('0x12')]||null:null,'attributes':_0x1d9675[_0xa7f0('0x11')]?_0x1d9675[_0xa7f0('0x11')][_0xa7f0('0x13')]||null:null,'limit':_0x1d9675['options']?_0x1d9675[_0xa7f0('0x11')][_0xa7f0('0x14')]||null:null,'include':_0x1d9675[_0xa7f0('0x11')]?_0x1d9675[_0xa7f0('0x11')][_0xa7f0('0x15')]?_[_0xa7f0('0x16')](_0x1d9675[_0xa7f0('0x11')]['include'],function(_0xb7a3b7){return{'model':db[_0xb7a3b7[_0xa7f0('0x17')]],'as':_0xb7a3b7['as'],'attributes':_0xb7a3b7[_0xa7f0('0x13')],'include':_0xb7a3b7[_0xa7f0('0x15')]?_[_0xa7f0('0x16')](_0xb7a3b7[_0xa7f0('0x15')],function(_0x4dab96){return{'model':db[_0x4dab96[_0xa7f0('0x17')]],'as':_0x4dab96['as'],'attributes':_0x4dab96[_0xa7f0('0x13')],'include':_0x4dab96[_0xa7f0('0x15')]?_[_0xa7f0('0x16')](_0x4dab96['include'],function(_0x56cc86){return{'model':db[_0x56cc86[_0xa7f0('0x17')]],'as':_0x56cc86['as'],'attributes':_0x56cc86[_0xa7f0('0x13')]};}):[]};}):[]};}):[]:[]})[_0xa7f0('0x6')](function(_0x58e274){logger[_0xa7f0('0xc')](_0xa7f0('0xe'),_0x1d9675);logger[_0xa7f0('0x9')]('GetMailServerIn',_0x1d9675,JSON[_0xa7f0('0x18')](_0x58e274));_0x299d08(_0x58e274);})[_0xa7f0('0x19')](function(_0x2cbdc0){logger[_0xa7f0('0xa')]('GetMailServerIn',_0x2cbdc0[_0xa7f0('0xb')],_0x1d9675);_0x50162c(_0x238059['error'](0x1f4,_0x2cbdc0[_0xa7f0('0xb')]));});});}; \ No newline at end of file +var _0x1011=['GetMailServerIn','findAll','options','raw','where','attributes','limit','include','map','model','debug','stringify','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','MailServerIn,\x20%s,\x20%s','MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result'];(function(_0x2cb633,_0x5caee0){var _0x4b1a20=function(_0x4ea50f){while(--_0x4ea50f){_0x2cb633['push'](_0x2cb633['shift']());}};_0x4b1a20(++_0x5caee0);}(_0x1011,0x123));var _0x1101=function(_0x6289ef,_0x1490c1){_0x6289ef=_0x6289ef-0x0;var _0x4f83a0=_0x1011[_0x6289ef];return _0x4f83a0;};'use strict';var _=require(_0x1101('0x0'));var util=require('util');var moment=require(_0x1101('0x1'));var BPromise=require('bluebird');var rs=require(_0x1101('0x2'));var fs=require('fs');var Redis=require(_0x1101('0x3'));var db=require(_0x1101('0x4'))['db'];var utils=require(_0x1101('0x5'));var logger=require(_0x1101('0x6'))('rpc');var config=require(_0x1101('0x7'));var jayson=require(_0x1101('0x8'));var client=jayson[_0x1101('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x11b894,_0x58a0b7,_0x953a1d){return new BPromise(function(_0x51b359,_0x1586e9){return client[_0x1101('0xa')](_0x11b894,_0x953a1d)[_0x1101('0xb')](function(_0x2dd6ec){logger[_0x1101('0xc')](_0x1101('0xd'),_0x58a0b7,'request\x20sent');logger['debug'](_0x1101('0xe'),_0x58a0b7,_0x1101('0xf'),JSON['stringify'](_0x2dd6ec));if(_0x2dd6ec['error']){if(_0x2dd6ec[_0x1101('0x10')]['code']===0x1f4){logger[_0x1101('0x10')]('MailServerIn,\x20%s,\x20%s',_0x58a0b7,_0x2dd6ec[_0x1101('0x10')][_0x1101('0x11')]);return _0x1586e9(_0x2dd6ec['error'][_0x1101('0x11')]);}logger['error']('MailServerIn,\x20%s,\x20%s',_0x58a0b7,_0x2dd6ec[_0x1101('0x10')][_0x1101('0x11')]);return _0x51b359(_0x2dd6ec[_0x1101('0x10')][_0x1101('0x11')]);}else{logger[_0x1101('0xc')](_0x1101('0xd'),_0x58a0b7,_0x1101('0xf'));_0x51b359(_0x2dd6ec[_0x1101('0x12')]['message']);}})['catch'](function(_0x3b4a84){logger[_0x1101('0x10')](_0x1101('0xd'),_0x58a0b7,_0x3b4a84);_0x1586e9(_0x3b4a84);});});}exports[_0x1101('0x13')]=function(_0x57caf6){var _0x3dd7ed=this;return new Promise(function(_0x577cec,_0x6d2f0e){return db['MailServerIn'][_0x1101('0x14')]({'raw':_0x57caf6[_0x1101('0x15')]?_0x57caf6[_0x1101('0x15')][_0x1101('0x16')]===undefined?!![]:![]:!![],'where':_0x57caf6[_0x1101('0x15')]?_0x57caf6[_0x1101('0x15')][_0x1101('0x17')]||null:null,'attributes':_0x57caf6['options']?_0x57caf6[_0x1101('0x15')][_0x1101('0x18')]||null:null,'limit':_0x57caf6[_0x1101('0x15')]?_0x57caf6[_0x1101('0x15')][_0x1101('0x19')]||null:null,'include':_0x57caf6['options']?_0x57caf6[_0x1101('0x15')][_0x1101('0x1a')]?_[_0x1101('0x1b')](_0x57caf6[_0x1101('0x15')][_0x1101('0x1a')],function(_0x1761d4){return{'model':db[_0x1761d4[_0x1101('0x1c')]],'as':_0x1761d4['as'],'attributes':_0x1761d4[_0x1101('0x18')],'include':_0x1761d4[_0x1101('0x1a')]?_['map'](_0x1761d4[_0x1101('0x1a')],function(_0x479cf5){return{'model':db[_0x479cf5[_0x1101('0x1c')]],'as':_0x479cf5['as'],'attributes':_0x479cf5[_0x1101('0x18')],'include':_0x479cf5[_0x1101('0x1a')]?_[_0x1101('0x1b')](_0x479cf5[_0x1101('0x1a')],function(_0x2ac109){return{'model':db[_0x2ac109[_0x1101('0x1c')]],'as':_0x2ac109['as'],'attributes':_0x2ac109[_0x1101('0x18')]};}):[]};}):[]};}):[]:[]})[_0x1101('0xb')](function(_0x4e4f08){logger['info'](_0x1101('0x13'),_0x57caf6);logger[_0x1101('0x1d')](_0x1101('0x13'),_0x57caf6,JSON[_0x1101('0x1e')](_0x4e4f08));_0x577cec(_0x4e4f08);})['catch'](function(_0x118a4f){logger[_0x1101('0x10')](_0x1101('0x13'),_0x118a4f[_0x1101('0x11')],_0x57caf6);_0x6d2f0e(_0x3dd7ed['error'](0x1f4,_0x118a4f[_0x1101('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index b4bf20d..25dd3b2 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 _0xcd68=['index','get','/:id','isAuthenticated','show','create','put','update','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x21ca58,_0x147a33){var _0x3529bf=function(_0x303681){while(--_0x303681){_0x21ca58['push'](_0x21ca58['shift']());}};_0x3529bf(++_0x147a33);}(_0xcd68,0x119));var _0x8cd6=function(_0x30b0d8,_0x57470c){_0x30b0d8=_0x30b0d8-0x0;var _0x459c09=_0xcd68[_0x30b0d8];return _0x459c09;};'use strict';var multer=require(_0x8cd6('0x0'));var util=require(_0x8cd6('0x1'));var path=require('path');var timeout=require(_0x8cd6('0x2'));var express=require(_0x8cd6('0x3'));var router=express[_0x8cd6('0x4')]();var auth=require(_0x8cd6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8cd6('0x6'));var controller=require('./mailServerOut.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x8cd6('0x7')]);router[_0x8cd6('0x8')](_0x8cd6('0x9'),auth[_0x8cd6('0xa')](),controller[_0x8cd6('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8cd6('0xc')]);router[_0x8cd6('0xd')](_0x8cd6('0x9'),auth[_0x8cd6('0xa')](),controller[_0x8cd6('0xe')]);router['delete'](_0x8cd6('0x9'),auth[_0x8cd6('0xa')](),controller['destroy']);module[_0x8cd6('0xf')]=router; \ No newline at end of file +var _0xcbfa=['create','put','/:id','update','destroy','multer','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get','isAuthenticated','index','show'];(function(_0x254076,_0x5e7b8d){var _0x21a93e=function(_0x26aa78){while(--_0x26aa78){_0x254076['push'](_0x254076['shift']());}};_0x21a93e(++_0x5e7b8d);}(_0xcbfa,0x125));var _0xacbf=function(_0x17bccc,_0x4cc003){_0x17bccc=_0x17bccc-0x0;var _0x16e5fe=_0xcbfa[_0x17bccc];return _0x16e5fe;};'use strict';var multer=require(_0xacbf('0x0'));var util=require(_0xacbf('0x1'));var path=require('path');var timeout=require(_0xacbf('0x2'));var express=require('express');var router=express[_0xacbf('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xacbf('0x4'));var config=require(_0xacbf('0x5'));var controller=require(_0xacbf('0x6'));router[_0xacbf('0x7')]('/',auth[_0xacbf('0x8')](),controller[_0xacbf('0x9')]);router[_0xacbf('0x7')]('/:id',auth[_0xacbf('0x8')](),controller[_0xacbf('0xa')]);router['post']('/',auth[_0xacbf('0x8')](),controller[_0xacbf('0xb')]);router[_0xacbf('0xc')](_0xacbf('0xd'),auth['isAuthenticated'](),controller[_0xacbf('0xe')]);router['delete']('/:id',auth[_0xacbf('0x8')](),controller[_0xacbf('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 85c3c73..5b40940 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 _0x4c9d=['exports','STRING','INTEGER','BOOLEAN','sequelize'];(function(_0xcb5d31,_0x36f9f7){var _0x2302b3=function(_0x59909a){while(--_0x59909a){_0xcb5d31['push'](_0xcb5d31['shift']());}};_0x2302b3(++_0x36f9f7);}(_0x4c9d,0x7c));var _0xd4c9=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4c9d[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xd4c9('0x0'));module[_0xd4c9('0x1')]={'description':{'type':Sequelize[_0xd4c9('0x2')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0xd4c9('0x2')]},'pass':{'type':Sequelize[_0xd4c9('0x2')]},'port':{'type':Sequelize[_0xd4c9('0x3')]},'secure':{'type':Sequelize[_0xd4c9('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0xd4c9('0x2')]},'authentication':{'type':Sequelize[_0xd4c9('0x4')],'defaultValue':!![]}}; \ No newline at end of file +var _0x398a=['STRING','BOOLEAN','sequelize','exports'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x398a,0x11a));var _0xa398=function(_0x5cd9f8,_0x5aad9b){_0x5cd9f8=_0x5cd9f8-0x0;var _0x40ad31=_0x398a[_0x5cd9f8];return _0x40ad31;};'use strict';var Sequelize=require(_0xa398('0x0'));module[_0xa398('0x1')]={'description':{'type':Sequelize[_0xa398('0x2')]},'host':{'type':Sequelize[_0xa398('0x2')]},'user':{'type':Sequelize[_0xa398('0x2')]},'pass':{'type':Sequelize[_0xa398('0x2')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xa398('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 6a47ccf..4f3e502 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 _0x4212=['to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','reject','save','update','then','error','stack','name','send','index','map','MailServerOut','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','merge','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js'];(function(_0x22ba10,_0x34ddd5){var _0xa9d39c=function(_0x3f81b1){while(--_0x3f81b1){_0x22ba10['push'](_0x22ba10['shift']());}};_0xa9d39c(++_0x34ddd5);}(_0x4212,0x168));var _0x2421=function(_0x55ff3e,_0x41077f){_0x55ff3e=_0x55ff3e-0x0;var _0x2709eb=_0x4212[_0x55ff3e];return _0x2709eb;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2421('0x0'));var rimraf=require(_0x2421('0x1'));var zipdir=require(_0x2421('0x2'));var jsonpatch=require(_0x2421('0x3'));var rp=require(_0x2421('0x4'));var moment=require(_0x2421('0x5'));var BPromise=require(_0x2421('0x6'));var Mustache=require(_0x2421('0x7'));var util=require('util');var path=require(_0x2421('0x8'));var sox=require(_0x2421('0x9'));var csv=require('to-csv');var ejs=require(_0x2421('0xa'));var fs=require('fs');var _=require(_0x2421('0xb'));var squel=require(_0x2421('0xc'));var crypto=require('crypto');var jsforce=require(_0x2421('0xd'));var deskjs=require(_0x2421('0xe'));var toCsv=require(_0x2421('0xf'));var querystring=require(_0x2421('0x10'));var Papa=require(_0x2421('0x11'));var Redis=require(_0x2421('0x12'));var authService=require(_0x2421('0x13'));var qs=require(_0x2421('0x14'));var as=require(_0x2421('0x15'));var hardwareService=require(_0x2421('0x16'));var logger=require('../../config/logger')(_0x2421('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x2421('0x18'))['db'];function respondWithStatusCode(_0xb46ae,_0x15f8fa){_0x15f8fa=_0x15f8fa||0xcc;return function(_0x371d91){if(_0x371d91){return _0xb46ae[_0x2421('0x19')](_0x15f8fa);}return _0xb46ae[_0x2421('0x1a')](_0x15f8fa)[_0x2421('0x1b')]();};}function respondWithResult(_0x548198,_0xcdd0b5){_0xcdd0b5=_0xcdd0b5||0xc8;return function(_0x2bf939){if(_0x2bf939){return _0x548198[_0x2421('0x1a')](_0xcdd0b5)[_0x2421('0x1c')](_0x2bf939);}};}function respondWithFilteredResult(_0x431bd1,_0x3be75b){return function(_0x2c6923){if(_0x2c6923){var _0xee93c3=_0x2c6923[_0x2421('0x1d')],_0x2a1ab4=_0x3be75b[_0x2421('0x1e')],_0x7bf401=_0x3be75b[_0x2421('0x1e')]+_0x3be75b['limit'],_0x10f58a;if(_0x7bf401>=_0xee93c3){_0x7bf401=_0xee93c3;_0x10f58a=0xc8;}else{_0x10f58a=0xce;}_0x431bd1[_0x2421('0x1a')](_0x10f58a);return _0x431bd1[_0x2421('0x1f')]('Content-Range',_0x2a1ab4+'-'+_0x7bf401+'/'+_0xee93c3)['json'](_0x2c6923);}return null;};}function patchUpdates(_0x2e14b8){return function(_0x2845fe){try{jsonpatch[_0x2421('0x20')](_0x2845fe,_0x2e14b8,!![]);}catch(_0x5c329b){return BPromise[_0x2421('0x21')](_0x5c329b);}return _0x2845fe[_0x2421('0x22')]();};}function saveUpdates(_0xb30a36,_0x4c0b50){return function(_0x2d0349){if(_0x2d0349){return _0x2d0349[_0x2421('0x23')](_0xb30a36)[_0x2421('0x24')](function(_0x2baa5a){return _0x2baa5a;});}return null;};}function removeEntity(_0x1a635d,_0x24386d){return function(_0x38478e){if(_0x38478e){return _0x38478e['destroy']()[_0x2421('0x24')](function(){_0x1a635d['status'](0xcc)[_0x2421('0x1b')]();});}};}function handleEntityNotFound(_0xba6b1,_0x42a51f){return function(_0x2ad35c){if(!_0x2ad35c){_0xba6b1[_0x2421('0x19')](0x194);}return _0x2ad35c;};}function handleError(_0x1944e8,_0x1db376){_0x1db376=_0x1db376||0x1f4;return function(_0x54b345){logger[_0x2421('0x25')](_0x54b345[_0x2421('0x26')]);if(_0x54b345[_0x2421('0x27')]){delete _0x54b345[_0x2421('0x27')];}_0x1944e8[_0x2421('0x1a')](_0x1db376)[_0x2421('0x28')](_0x54b345);};}exports[_0x2421('0x29')]=function(_0x58c769,_0x3042e3){var _0x1c496d={},_0x27ce30={},_0xe847d6={'count':0x0,'rows':[]};var _0x4710ce=_[_0x2421('0x2a')](db[_0x2421('0x2b')]['rawAttributes'],function(_0x216cab){return{'name':_0x216cab[_0x2421('0x2c')],'type':_0x216cab[_0x2421('0x2d')][_0x2421('0x2e')]};});_0x27ce30[_0x2421('0x2f')]=_[_0x2421('0x2a')](_0x4710ce,'name');_0x27ce30[_0x2421('0x30')]=_['keys'](_0x58c769[_0x2421('0x30')]);_0x27ce30[_0x2421('0x31')]=_[_0x2421('0x32')](_0x27ce30[_0x2421('0x2f')],_0x27ce30[_0x2421('0x30')]);_0x1c496d[_0x2421('0x33')]=_[_0x2421('0x32')](_0x27ce30[_0x2421('0x2f')],qs[_0x2421('0x34')](_0x58c769['query'][_0x2421('0x34')]));_0x1c496d[_0x2421('0x33')]=_0x1c496d['attributes'][_0x2421('0x35')]?_0x1c496d[_0x2421('0x33')]:_0x27ce30['model'];if(!_0x58c769[_0x2421('0x30')][_0x2421('0x36')](_0x2421('0x37'))){_0x1c496d[_0x2421('0x38')]=qs['limit'](_0x58c769[_0x2421('0x30')]['limit']);_0x1c496d[_0x2421('0x1e')]=qs['offset'](_0x58c769[_0x2421('0x30')]['offset']);}_0x1c496d['order']=qs['sort'](_0x58c769['query'][_0x2421('0x39')]);_0x1c496d[_0x2421('0x3a')]=qs[_0x2421('0x31')](_[_0x2421('0x3b')](_0x58c769[_0x2421('0x30')],_0x27ce30[_0x2421('0x31')]));if(_0x58c769[_0x2421('0x30')][_0x2421('0x3c')]){_0x1c496d['where']=_['merge'](_0x1c496d[_0x2421('0x3a')],{'$or':_[_0x2421('0x2a')](_0x4710ce,function(_0x4fff92){if(_0x4fff92['type']!==_0x2421('0x3d')){var _0x3109a9={};_0x3109a9[_0x4fff92[_0x2421('0x27')]]={'$like':'%'+_0x58c769[_0x2421('0x30')]['filter']+'%'};return _0x3109a9;}})});}_0x1c496d=_['merge']({},_0x1c496d,_0x58c769[_0x2421('0x3e')]);var _0xc6133={'where':_0x1c496d[_0x2421('0x3a')]};return db['MailServerOut'][_0x2421('0x1d')](_0xc6133)[_0x2421('0x24')](function(_0x57e3dd){_0xe847d6['count']=_0x57e3dd;if(_0x58c769['query'][_0x2421('0x3f')]){_0x1c496d[_0x2421('0x40')]=[{'all':!![]}];}return db[_0x2421('0x2b')][_0x2421('0x41')](_0x1c496d);})['then'](function(_0x16b444){_0xe847d6[_0x2421('0x42')]=_0x16b444;return _0xe847d6;})[_0x2421('0x24')](respondWithFilteredResult(_0x3042e3,_0x1c496d))[_0x2421('0x43')](handleError(_0x3042e3,null));};exports[_0x2421('0x44')]=function(_0x10c8df,_0x8784c6){var _0x28ec91={'raw':!![],'where':{'id':_0x10c8df[_0x2421('0x45')]['id']}},_0x2cdeed={};_0x2cdeed[_0x2421('0x2f')]=_['keys'](db[_0x2421('0x2b')][_0x2421('0x46')]);_0x2cdeed['query']=_['keys'](_0x10c8df[_0x2421('0x30')]);_0x2cdeed[_0x2421('0x31')]=_[_0x2421('0x32')](_0x2cdeed[_0x2421('0x2f')],_0x2cdeed[_0x2421('0x30')]);_0x28ec91[_0x2421('0x33')]=_[_0x2421('0x32')](_0x2cdeed[_0x2421('0x2f')],qs[_0x2421('0x34')](_0x10c8df[_0x2421('0x30')][_0x2421('0x34')]));_0x28ec91[_0x2421('0x33')]=_0x28ec91[_0x2421('0x33')][_0x2421('0x35')]?_0x28ec91[_0x2421('0x33')]:_0x2cdeed[_0x2421('0x2f')];if(_0x10c8df[_0x2421('0x30')][_0x2421('0x3f')]){_0x28ec91[_0x2421('0x40')]=[{'all':!![]}];}_0x28ec91=_[_0x2421('0x47')]({},_0x28ec91,_0x10c8df[_0x2421('0x3e')]);return db['MailServerOut']['find'](_0x28ec91)[_0x2421('0x24')](handleEntityNotFound(_0x8784c6,null))['then'](respondWithResult(_0x8784c6,null))[_0x2421('0x43')](handleError(_0x8784c6,null));};exports[_0x2421('0x48')]=function(_0x44b294,_0x267a02){return db[_0x2421('0x2b')][_0x2421('0x48')](_0x44b294['body'],{})[_0x2421('0x24')](respondWithResult(_0x267a02,0xc9))[_0x2421('0x43')](handleError(_0x267a02,null));};exports[_0x2421('0x23')]=function(_0x5007cf,_0x578d4d){if(_0x5007cf[_0x2421('0x49')]['id']){delete _0x5007cf[_0x2421('0x49')]['id'];}return db[_0x2421('0x2b')][_0x2421('0x4a')]({'where':{'id':_0x5007cf[_0x2421('0x45')]['id']}})[_0x2421('0x24')](handleEntityNotFound(_0x578d4d,null))[_0x2421('0x24')](saveUpdates(_0x5007cf[_0x2421('0x49')],null))[_0x2421('0x24')](respondWithResult(_0x578d4d,null))[_0x2421('0x43')](handleError(_0x578d4d,null));};exports['destroy']=function(_0xd4ad8,_0x2ae200){return db[_0x2421('0x2b')][_0x2421('0x4a')]({'where':{'id':_0xd4ad8['params']['id']}})[_0x2421('0x24')](handleEntityNotFound(_0x2ae200,null))[_0x2421('0x24')](removeEntity(_0x2ae200,null))[_0x2421('0x43')](handleError(_0x2ae200,null));}; \ No newline at end of file +var _0x1fd5=['bluebird','mustache','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','apply','reject','update','then','destroy','stack','name','map','MailServerOut','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','find','create','body','catch','html-pdf','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x2a1da3,_0x30b61e){var _0x446f9b=function(_0x55fbd0){while(--_0x55fbd0){_0x2a1da3['push'](_0x2a1da3['shift']());}};_0x446f9b(++_0x30b61e);}(_0x1fd5,0x117));var _0x51fd=function(_0x299649,_0x1511db){_0x299649=_0x299649-0x0;var _0x3c2fdb=_0x1fd5[_0x299649];return _0x3c2fdb;};'use strict';var pdf=require(_0x51fd('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x51fd('0x1'));var zipdir=require(_0x51fd('0x2'));var jsonpatch=require(_0x51fd('0x3'));var rp=require('request-promise');var moment=require(_0x51fd('0x4'));var BPromise=require(_0x51fd('0x5'));var Mustache=require(_0x51fd('0x6'));var util=require('util');var path=require(_0x51fd('0x7'));var sox=require('sox');var csv=require(_0x51fd('0x8'));var ejs=require(_0x51fd('0x9'));var fs=require('fs');var _=require(_0x51fd('0xa'));var squel=require('squel');var crypto=require(_0x51fd('0xb'));var jsforce=require(_0x51fd('0xc'));var deskjs=require(_0x51fd('0xd'));var toCsv=require(_0x51fd('0x8'));var querystring=require(_0x51fd('0xe'));var Papa=require(_0x51fd('0xf'));var Redis=require(_0x51fd('0x10'));var authService=require(_0x51fd('0x11'));var qs=require(_0x51fd('0x12'));var as=require(_0x51fd('0x13'));var hardwareService=require(_0x51fd('0x14'));var logger=require(_0x51fd('0x15'))(_0x51fd('0x16'));var utils=require(_0x51fd('0x17'));var config=require(_0x51fd('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d7722,_0x411d13){_0x411d13=_0x411d13||0xcc;return function(_0x285839){if(_0x285839){return _0x5d7722[_0x51fd('0x19')](_0x411d13);}return _0x5d7722[_0x51fd('0x1a')](_0x411d13)[_0x51fd('0x1b')]();};}function respondWithResult(_0x18d05d,_0x2c4614){_0x2c4614=_0x2c4614||0xc8;return function(_0x442f68){if(_0x442f68){return _0x18d05d[_0x51fd('0x1a')](_0x2c4614)[_0x51fd('0x1c')](_0x442f68);}};}function respondWithFilteredResult(_0x5061e3,_0x43008c){return function(_0x40de03){if(_0x40de03){var _0x246244=_0x40de03[_0x51fd('0x1d')],_0x138ab4=_0x43008c[_0x51fd('0x1e')],_0x3810ef=_0x43008c[_0x51fd('0x1e')]+_0x43008c[_0x51fd('0x1f')],_0x28936a;if(_0x3810ef>=_0x246244){_0x3810ef=_0x246244;_0x28936a=0xc8;}else{_0x28936a=0xce;}_0x5061e3[_0x51fd('0x1a')](_0x28936a);return _0x5061e3['set']('Content-Range',_0x138ab4+'-'+_0x3810ef+'/'+_0x246244)[_0x51fd('0x1c')](_0x40de03);}return null;};}function patchUpdates(_0xa3af77){return function(_0x576933){try{jsonpatch[_0x51fd('0x20')](_0x576933,_0xa3af77,!![]);}catch(_0x1e8d52){return BPromise[_0x51fd('0x21')](_0x1e8d52);}return _0x576933['save']();};}function saveUpdates(_0x45665d,_0xd89337){return function(_0x4841f7){if(_0x4841f7){return _0x4841f7[_0x51fd('0x22')](_0x45665d)[_0x51fd('0x23')](function(_0x1d29ef){return _0x1d29ef;});}return null;};}function removeEntity(_0x3ef4fe,_0x3672df){return function(_0xb18f9a){if(_0xb18f9a){return _0xb18f9a[_0x51fd('0x24')]()[_0x51fd('0x23')](function(){_0x3ef4fe[_0x51fd('0x1a')](0xcc)[_0x51fd('0x1b')]();});}};}function handleEntityNotFound(_0x4d446a,_0x24e70e){return function(_0x3e23b0){if(!_0x3e23b0){_0x4d446a[_0x51fd('0x19')](0x194);}return _0x3e23b0;};}function handleError(_0x2d1478,_0x11706a){_0x11706a=_0x11706a||0x1f4;return function(_0x496e9a){logger['error'](_0x496e9a[_0x51fd('0x25')]);if(_0x496e9a[_0x51fd('0x26')]){delete _0x496e9a[_0x51fd('0x26')];}_0x2d1478['status'](_0x11706a)['send'](_0x496e9a);};}exports['index']=function(_0x1de205,_0x5a5c47){var _0x63e2ba={},_0x2282a3={},_0x26fa56={'count':0x0,'rows':[]};var _0x5b62bd=_[_0x51fd('0x27')](db[_0x51fd('0x28')]['rawAttributes'],function(_0x1e2822){return{'name':_0x1e2822[_0x51fd('0x29')],'type':_0x1e2822[_0x51fd('0x2a')][_0x51fd('0x2b')]};});_0x2282a3[_0x51fd('0x2c')]=_[_0x51fd('0x27')](_0x5b62bd,_0x51fd('0x26'));_0x2282a3[_0x51fd('0x2d')]=_[_0x51fd('0x2e')](_0x1de205[_0x51fd('0x2d')]);_0x2282a3[_0x51fd('0x2f')]=_[_0x51fd('0x30')](_0x2282a3['model'],_0x2282a3['query']);_0x63e2ba[_0x51fd('0x31')]=_['intersection'](_0x2282a3['model'],qs[_0x51fd('0x32')](_0x1de205[_0x51fd('0x2d')][_0x51fd('0x32')]));_0x63e2ba[_0x51fd('0x31')]=_0x63e2ba[_0x51fd('0x31')]['length']?_0x63e2ba[_0x51fd('0x31')]:_0x2282a3[_0x51fd('0x2c')];if(!_0x1de205[_0x51fd('0x2d')][_0x51fd('0x33')](_0x51fd('0x34'))){_0x63e2ba[_0x51fd('0x1f')]=qs['limit'](_0x1de205['query']['limit']);_0x63e2ba['offset']=qs[_0x51fd('0x1e')](_0x1de205[_0x51fd('0x2d')]['offset']);}_0x63e2ba['order']=qs[_0x51fd('0x35')](_0x1de205[_0x51fd('0x2d')][_0x51fd('0x35')]);_0x63e2ba[_0x51fd('0x36')]=qs[_0x51fd('0x2f')](_[_0x51fd('0x37')](_0x1de205[_0x51fd('0x2d')],_0x2282a3[_0x51fd('0x2f')]));if(_0x1de205['query'][_0x51fd('0x38')]){_0x63e2ba['where']=_[_0x51fd('0x39')](_0x63e2ba['where'],{'$or':_['map'](_0x5b62bd,function(_0x42b33b){if(_0x42b33b[_0x51fd('0x2a')]!==_0x51fd('0x3a')){var _0x36c08c={};_0x36c08c[_0x42b33b[_0x51fd('0x26')]]={'$like':'%'+_0x1de205[_0x51fd('0x2d')][_0x51fd('0x38')]+'%'};return _0x36c08c;}})});}_0x63e2ba=_[_0x51fd('0x39')]({},_0x63e2ba,_0x1de205[_0x51fd('0x3b')]);var _0x50b983={'where':_0x63e2ba['where']};return db[_0x51fd('0x28')][_0x51fd('0x1d')](_0x50b983)[_0x51fd('0x23')](function(_0x552ee8){_0x26fa56[_0x51fd('0x1d')]=_0x552ee8;if(_0x1de205[_0x51fd('0x2d')][_0x51fd('0x3c')]){_0x63e2ba[_0x51fd('0x3d')]=[{'all':!![]}];}return db[_0x51fd('0x28')][_0x51fd('0x3e')](_0x63e2ba);})[_0x51fd('0x23')](function(_0x2d0f7c){_0x26fa56[_0x51fd('0x3f')]=_0x2d0f7c;return _0x26fa56;})[_0x51fd('0x23')](respondWithFilteredResult(_0x5a5c47,_0x63e2ba))['catch'](handleError(_0x5a5c47,null));};exports[_0x51fd('0x40')]=function(_0xb0fb85,_0x1ea445){var _0x3b87ba={'raw':!![],'where':{'id':_0xb0fb85[_0x51fd('0x41')]['id']}},_0x39f908={};_0x39f908['model']=_[_0x51fd('0x2e')](db[_0x51fd('0x28')]['rawAttributes']);_0x39f908[_0x51fd('0x2d')]=_[_0x51fd('0x2e')](_0xb0fb85[_0x51fd('0x2d')]);_0x39f908['filters']=_['intersection'](_0x39f908[_0x51fd('0x2c')],_0x39f908[_0x51fd('0x2d')]);_0x3b87ba[_0x51fd('0x31')]=_['intersection'](_0x39f908[_0x51fd('0x2c')],qs[_0x51fd('0x32')](_0xb0fb85['query'][_0x51fd('0x32')]));_0x3b87ba[_0x51fd('0x31')]=_0x3b87ba[_0x51fd('0x31')][_0x51fd('0x42')]?_0x3b87ba['attributes']:_0x39f908[_0x51fd('0x2c')];if(_0xb0fb85[_0x51fd('0x2d')][_0x51fd('0x3c')]){_0x3b87ba[_0x51fd('0x3d')]=[{'all':!![]}];}_0x3b87ba=_[_0x51fd('0x39')]({},_0x3b87ba,_0xb0fb85[_0x51fd('0x3b')]);return db[_0x51fd('0x28')][_0x51fd('0x43')](_0x3b87ba)['then'](handleEntityNotFound(_0x1ea445,null))['then'](respondWithResult(_0x1ea445,null))['catch'](handleError(_0x1ea445,null));};exports[_0x51fd('0x44')]=function(_0x995c6c,_0x52b596){return db[_0x51fd('0x28')][_0x51fd('0x44')](_0x995c6c[_0x51fd('0x45')],{})[_0x51fd('0x23')](respondWithResult(_0x52b596,0xc9))[_0x51fd('0x46')](handleError(_0x52b596,null));};exports[_0x51fd('0x22')]=function(_0x5f0e21,_0x2a7709){if(_0x5f0e21['body']['id']){delete _0x5f0e21[_0x51fd('0x45')]['id'];}return db['MailServerOut'][_0x51fd('0x43')]({'where':{'id':_0x5f0e21[_0x51fd('0x41')]['id']}})[_0x51fd('0x23')](handleEntityNotFound(_0x2a7709,null))[_0x51fd('0x23')](saveUpdates(_0x5f0e21[_0x51fd('0x45')],null))[_0x51fd('0x23')](respondWithResult(_0x2a7709,null))[_0x51fd('0x46')](handleError(_0x2a7709,null));};exports[_0x51fd('0x24')]=function(_0x47de7d,_0x5ac9a9){return db['MailServerOut'][_0x51fd('0x43')]({'where':{'id':_0x47de7d[_0x51fd('0x41')]['id']}})[_0x51fd('0x23')](handleEntityNotFound(_0x5ac9a9,null))['then'](removeEntity(_0x5ac9a9,null))[_0x51fd('0x46')](handleError(_0x5ac9a9,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 1ae31a4..d5be7f8 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 _0xdc97=['path','../../config/environment','./mailServerOut.attributes','exports','define','lodash','util','../../config/logger','moment','request-promise'];(function(_0x29fefa,_0x3c9ba0){var _0x530b05=function(_0xc21842){while(--_0xc21842){_0x29fefa['push'](_0x29fefa['shift']());}};_0x530b05(++_0x3c9ba0);}(_0xdc97,0x13b));var _0x7dc9=function(_0x517169,_0x495be0){_0x517169=_0x517169-0x0;var _0x21292c=_0xdc97[_0x517169];return _0x21292c;};'use strict';var _=require(_0x7dc9('0x0'));var util=require(_0x7dc9('0x1'));var logger=require(_0x7dc9('0x2'))('api');var moment=require(_0x7dc9('0x3'));var BPromise=require('bluebird');var rp=require(_0x7dc9('0x4'));var fs=require('fs');var path=require(_0x7dc9('0x5'));var rimraf=require('rimraf');var config=require(_0x7dc9('0x6'));var attributes=require(_0x7dc9('0x7'));module[_0x7dc9('0x8')]=function(_0x3ba3ca,_0x589f02){return _0x3ba3ca[_0x7dc9('0x9')]('MailServerOut',attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xabce=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','define','mail_servers_out','lodash'];(function(_0x3b7743,_0x3be709){var _0x3c559f=function(_0x270bd7){while(--_0x270bd7){_0x3b7743['push'](_0x3b7743['shift']());}};_0x3c559f(++_0x3be709);}(_0xabce,0x103));var _0xeabc=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0xabce[_0x334841];return _0x5beb4b;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./mailServerOut.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('MailServerOut',attributes,{'tableName':_0xeabc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index f5e6a29..486f1fb 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 _0x1921=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','error','message','MailServerOut,\x20%s,\x20%s','info'];(function(_0x3238ea,_0x91809d){var _0x4aaac2=function(_0xc5b102){while(--_0xc5b102){_0x3238ea['push'](_0x3238ea['shift']());}};_0x4aaac2(++_0x91809d);}(_0x1921,0x172));var _0x1192=function(_0x53f571,_0x330271){_0x53f571=_0x53f571-0x0;var _0x269155=_0x1921[_0x53f571];return _0x269155;};'use strict';var _=require(_0x1192('0x0'));var util=require(_0x1192('0x1'));var moment=require(_0x1192('0x2'));var BPromise=require(_0x1192('0x3'));var rs=require(_0x1192('0x4'));var fs=require('fs');var Redis=require(_0x1192('0x5'));var db=require(_0x1192('0x6'))['db'];var utils=require(_0x1192('0x7'));var logger=require('../../config/logger')(_0x1192('0x8'));var config=require(_0x1192('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1192('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57a2a3,_0x2814a9,_0x2be8d3){return new BPromise(function(_0x73181d,_0x3350ac){return client[_0x1192('0xb')](_0x57a2a3,_0x2be8d3)[_0x1192('0xc')](function(_0x115ddd){logger['info']('MailServerOut,\x20%s,\x20%s',_0x2814a9,_0x1192('0xd'));logger[_0x1192('0xe')](_0x1192('0xf'),_0x2814a9,_0x1192('0xd'),JSON[_0x1192('0x10')](_0x115ddd));if(_0x115ddd['error']){if(_0x115ddd['error']['code']===0x1f4){logger[_0x1192('0x11')]('MailServerOut,\x20%s,\x20%s',_0x2814a9,_0x115ddd[_0x1192('0x11')][_0x1192('0x12')]);return _0x3350ac(_0x115ddd['error'][_0x1192('0x12')]);}logger[_0x1192('0x11')](_0x1192('0x13'),_0x2814a9,_0x115ddd[_0x1192('0x11')][_0x1192('0x12')]);return _0x73181d(_0x115ddd[_0x1192('0x11')][_0x1192('0x12')]);}else{logger[_0x1192('0x14')](_0x1192('0x13'),_0x2814a9,_0x1192('0xd'));_0x73181d(_0x115ddd[_0x1192('0x15')][_0x1192('0x12')]);}})[_0x1192('0x16')](function(_0x11cdc2){logger[_0x1192('0x11')](_0x1192('0x13'),_0x2814a9,_0x11cdc2);_0x3350ac(_0x11cdc2);});});} \ No newline at end of file +var _0x87bb=['stringify','error','code','message','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s'];(function(_0x5b9f60,_0x392049){var _0x2ccf26=function(_0xebaee7){while(--_0xebaee7){_0x5b9f60['push'](_0x5b9f60['shift']());}};_0x2ccf26(++_0x392049);}(_0x87bb,0xf2));var _0xb87b=function(_0x18c3fb,_0x28faed){_0x18c3fb=_0x18c3fb-0x0;var _0x27fefe=_0x87bb[_0x18c3fb];return _0x27fefe;};'use strict';var _=require('lodash');var util=require(_0xb87b('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb87b('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb87b('0x2'))['db'];var utils=require(_0xb87b('0x3'));var logger=require(_0xb87b('0x4'))('rpc');var config=require(_0xb87b('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xb87b('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d87b0,_0x155912,_0x20de01){return new BPromise(function(_0x16945e,_0x2b5369){return client[_0xb87b('0x7')](_0x1d87b0,_0x20de01)[_0xb87b('0x8')](function(_0xd15225){logger[_0xb87b('0x9')](_0xb87b('0xa'),_0x155912,_0xb87b('0xb'));logger['debug'](_0xb87b('0xc'),_0x155912,'request\x20sent',JSON[_0xb87b('0xd')](_0xd15225));if(_0xd15225['error']){if(_0xd15225[_0xb87b('0xe')][_0xb87b('0xf')]===0x1f4){logger['error'](_0xb87b('0xa'),_0x155912,_0xd15225[_0xb87b('0xe')][_0xb87b('0x10')]);return _0x2b5369(_0xd15225[_0xb87b('0xe')][_0xb87b('0x10')]);}logger[_0xb87b('0xe')](_0xb87b('0xa'),_0x155912,_0xd15225[_0xb87b('0xe')][_0xb87b('0x10')]);return _0x16945e(_0xd15225[_0xb87b('0xe')][_0xb87b('0x10')]);}else{logger[_0xb87b('0x9')](_0xb87b('0xa'),_0x155912,_0xb87b('0xb'));_0x16945e(_0xd15225['result'][_0xb87b('0x10')]);}})['catch'](function(_0x1d5a71){logger[_0xb87b('0xe')](_0xb87b('0xa'),_0x155912,_0x1d5a71);_0x2b5369(_0x1d5a71);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 68b75cb..f42a16a 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 _0x63d8=['./mailSubstatus.controller','get','/describe','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x285da8,_0x2d1d58){var _0x2dbd7d=function(_0x38ca2e){while(--_0x38ca2e){_0x285da8['push'](_0x285da8['shift']());}};_0x2dbd7d(++_0x2d1d58);}(_0x63d8,0x198));var _0x863d=function(_0x574842,_0x4716f8){_0x574842=_0x574842-0x0;var _0x5d3b70=_0x63d8[_0x574842];return _0x5d3b70;};'use strict';var multer=require(_0x863d('0x0'));var util=require(_0x863d('0x1'));var path=require('path');var timeout=require(_0x863d('0x2'));var express=require('express');var router=express[_0x863d('0x3')]();var auth=require(_0x863d('0x4'));var interaction=require(_0x863d('0x5'));var config=require('../../config/environment');var controller=require(_0x863d('0x6'));router[_0x863d('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x863d('0x7')](_0x863d('0x8'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x863d('0x9'),auth[_0x863d('0xa')](),controller[_0x863d('0xb')]);router[_0x863d('0xc')]('/',auth[_0x863d('0xa')](),controller[_0x863d('0xd')]);router[_0x863d('0xe')](_0x863d('0x9'),auth[_0x863d('0xa')](),controller['update']);router[_0x863d('0xf')](_0x863d('0x9'),auth[_0x863d('0xa')](),controller[_0x863d('0x10')]);module[_0x863d('0x11')]=router; \ No newline at end of file +var _0x5599=['get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1b87f1,_0x44c614){var _0x10dcab=function(_0x1f554c){while(--_0x1f554c){_0x1b87f1['push'](_0x1b87f1['shift']());}};_0x10dcab(++_0x44c614);}(_0x5599,0x126));var _0x9559=function(_0xa1152c,_0x1c3041){_0xa1152c=_0xa1152c-0x0;var _0x28c2fe=_0x5599[_0xa1152c];return _0x28c2fe;};'use strict';var multer=require(_0x9559('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9559('0x1'));var router=express[_0x9559('0x2')]();var auth=require(_0x9559('0x3'));var interaction=require(_0x9559('0x4'));var config=require(_0x9559('0x5'));var controller=require('./mailSubstatus.controller');router[_0x9559('0x6')]('/',auth['isAuthenticated'](),controller[_0x9559('0x7')]);router[_0x9559('0x6')](_0x9559('0x8'),auth[_0x9559('0x9')](),controller[_0x9559('0xa')]);router[_0x9559('0x6')](_0x9559('0xb'),auth['isAuthenticated'](),controller[_0x9559('0xc')]);router[_0x9559('0xd')]('/',auth[_0x9559('0x9')](),controller[_0x9559('0xe')]);router[_0x9559('0xf')](_0x9559('0xb'),auth[_0x9559('0x9')](),controller[_0x9559('0x10')]);router[_0x9559('0x11')](_0x9559('0xb'),auth[_0x9559('0x9')](),controller[_0x9559('0x12')]);module[_0x9559('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 02297f9..b1f33c8 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 _0x3f48=['STRING','name'];(function(_0x3124f8,_0x1a8b23){var _0x5bab5f=function(_0x18b09b){while(--_0x18b09b){_0x3124f8['push'](_0x3124f8['shift']());}};_0x5bab5f(++_0x1a8b23);}(_0x3f48,0x17c));var _0x83f4=function(_0xdacd17,_0x1b6ab3){_0xdacd17=_0xdacd17-0x0;var _0x23f120=_0x3f48[_0xdacd17];return _0x23f120;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x83f4('0x0')],'unique':_0x83f4('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x83f4('0x0')]}}; \ No newline at end of file +var _0xa498=['exports','STRING','sequelize'];(function(_0x345de7,_0x1de531){var _0x26ffc7=function(_0x5b8539){while(--_0x5b8539){_0x345de7['push'](_0x345de7['shift']());}};_0x26ffc7(++_0x1de531);}(_0xa498,0x179));var _0x8a49=function(_0xe033e7,_0x561a6d){_0xe033e7=_0xe033e7-0x0;var _0x63031f=_0xa498[_0xe033e7];return _0x63031f;};'use strict';var Sequelize=require(_0x8a49('0x0'));module[_0x8a49('0x1')]={'name':{'type':Sequelize[_0x8a49('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8a49('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 9050717..5586d9c 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 _0x90b1=['count','includeAll','include','findAll','params','find','catch','create','body','update','describe','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','index','map','MailSubstatus','fieldName','key','model','name','keys','filters','query','intersection','fields','attributes','length','hasOwnProperty','sort','pick','merge','where','type','VIRTUAL','options'];(function(_0xd1b828,_0x33c9a9){var _0x47bd60=function(_0x518e57){while(--_0x518e57){_0xd1b828['push'](_0xd1b828['shift']());}};_0x47bd60(++_0x33c9a9);}(_0x90b1,0x1bb));var _0x190b=function(_0xf166de,_0x335fa7){_0xf166de=_0xf166de-0x0;var _0x4434f7=_0x90b1[_0xf166de];return _0x4434f7;};'use strict';var pdf=require(_0x190b('0x0'));var emlformat=require(_0x190b('0x1'));var rimraf=require(_0x190b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x190b('0x3'));var moment=require(_0x190b('0x4'));var BPromise=require(_0x190b('0x5'));var Mustache=require(_0x190b('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x190b('0x7'));var fs=require('fs');var _=require(_0x190b('0x8'));var squel=require(_0x190b('0x9'));var crypto=require(_0x190b('0xa'));var jsforce=require(_0x190b('0xb'));var deskjs=require(_0x190b('0xc'));var toCsv=require(_0x190b('0xd'));var querystring=require('querystring');var Papa=require(_0x190b('0xe'));var Redis=require(_0x190b('0xf'));var authService=require(_0x190b('0x10'));var qs=require(_0x190b('0x11'));var as=require(_0x190b('0x12'));var hardwareService=require(_0x190b('0x13'));var logger=require(_0x190b('0x14'))(_0x190b('0x15'));var utils=require('../../config/utils');var config=require(_0x190b('0x16'));var db=require(_0x190b('0x17'))['db'];function respondWithStatusCode(_0x5701ad,_0x4d63ac){_0x4d63ac=_0x4d63ac||0xcc;return function(_0x596c48){if(_0x596c48){return _0x5701ad[_0x190b('0x18')](_0x4d63ac);}return _0x5701ad[_0x190b('0x19')](_0x4d63ac)[_0x190b('0x1a')]();};}function respondWithResult(_0x1e1fd5,_0x2e12d4){_0x2e12d4=_0x2e12d4||0xc8;return function(_0x13544c){if(_0x13544c){return _0x1e1fd5[_0x190b('0x19')](_0x2e12d4)[_0x190b('0x1b')](_0x13544c);}};}function respondWithFilteredResult(_0x186941,_0x1a046f){return function(_0xab346){if(_0xab346){var _0x3e8781=_0xab346['count'],_0x3fbfc3=_0x1a046f[_0x190b('0x1c')],_0x121867=_0x1a046f['offset']+_0x1a046f[_0x190b('0x1d')],_0x1b4f4c;if(_0x121867>=_0x3e8781){_0x121867=_0x3e8781;_0x1b4f4c=0xc8;}else{_0x1b4f4c=0xce;}_0x186941[_0x190b('0x19')](_0x1b4f4c);return _0x186941[_0x190b('0x1e')](_0x190b('0x1f'),_0x3fbfc3+'-'+_0x121867+'/'+_0x3e8781)['json'](_0xab346);}return null;};}function patchUpdates(_0x298343){return function(_0x22d946){try{jsonpatch[_0x190b('0x20')](_0x22d946,_0x298343,!![]);}catch(_0x3c64d9){return BPromise[_0x190b('0x21')](_0x3c64d9);}return _0x22d946[_0x190b('0x22')]();};}function saveUpdates(_0x47d704,_0x3ed24c){return function(_0x14f0a5){if(_0x14f0a5){return _0x14f0a5['update'](_0x47d704)[_0x190b('0x23')](function(_0x5740af){return _0x5740af;});}return null;};}function removeEntity(_0x55de01,_0xcd15e5){return function(_0x42e7f2){if(_0x42e7f2){return _0x42e7f2[_0x190b('0x24')]()['then'](function(){_0x55de01[_0x190b('0x19')](0xcc)[_0x190b('0x1a')]();});}};}function handleEntityNotFound(_0x16e989,_0x292ce3){return function(_0x3b8c74){if(!_0x3b8c74){_0x16e989[_0x190b('0x18')](0x194);}return _0x3b8c74;};}function handleError(_0x1bce97,_0x519a76){_0x519a76=_0x519a76||0x1f4;return function(_0x55b1f5){logger[_0x190b('0x25')](_0x55b1f5[_0x190b('0x26')]);if(_0x55b1f5['name']){delete _0x55b1f5['name'];}_0x1bce97[_0x190b('0x19')](_0x519a76)['send'](_0x55b1f5);};}exports[_0x190b('0x27')]=function(_0x3b6aaf,_0x51f8b4){var _0x3e7a10={},_0x1deea6={},_0x5c89ab={'count':0x0,'rows':[]};var _0xa9d6f7=_[_0x190b('0x28')](db[_0x190b('0x29')]['rawAttributes'],function(_0x536d7b){return{'name':_0x536d7b[_0x190b('0x2a')],'type':_0x536d7b['type'][_0x190b('0x2b')]};});_0x1deea6[_0x190b('0x2c')]=_['map'](_0xa9d6f7,_0x190b('0x2d'));_0x1deea6['query']=_[_0x190b('0x2e')](_0x3b6aaf['query']);_0x1deea6[_0x190b('0x2f')]=_['intersection'](_0x1deea6[_0x190b('0x2c')],_0x1deea6[_0x190b('0x30')]);_0x3e7a10['attributes']=_[_0x190b('0x31')](_0x1deea6[_0x190b('0x2c')],qs[_0x190b('0x32')](_0x3b6aaf[_0x190b('0x30')][_0x190b('0x32')]));_0x3e7a10[_0x190b('0x33')]=_0x3e7a10[_0x190b('0x33')][_0x190b('0x34')]?_0x3e7a10['attributes']:_0x1deea6['model'];if(!_0x3b6aaf[_0x190b('0x30')][_0x190b('0x35')]('nolimit')){_0x3e7a10[_0x190b('0x1d')]=qs[_0x190b('0x1d')](_0x3b6aaf[_0x190b('0x30')][_0x190b('0x1d')]);_0x3e7a10[_0x190b('0x1c')]=qs[_0x190b('0x1c')](_0x3b6aaf[_0x190b('0x30')]['offset']);}_0x3e7a10['order']=qs[_0x190b('0x36')](_0x3b6aaf[_0x190b('0x30')][_0x190b('0x36')]);_0x3e7a10['where']=qs[_0x190b('0x2f')](_[_0x190b('0x37')](_0x3b6aaf[_0x190b('0x30')],_0x1deea6['filters']));if(_0x3b6aaf[_0x190b('0x30')]['filter']){_0x3e7a10['where']=_[_0x190b('0x38')](_0x3e7a10[_0x190b('0x39')],{'$or':_['map'](_0xa9d6f7,function(_0x2ec698){if(_0x2ec698[_0x190b('0x3a')]!==_0x190b('0x3b')){var _0x5a9cba={};_0x5a9cba[_0x2ec698[_0x190b('0x2d')]]={'$like':'%'+_0x3b6aaf[_0x190b('0x30')]['filter']+'%'};return _0x5a9cba;}})});}_0x3e7a10=_['merge']({},_0x3e7a10,_0x3b6aaf[_0x190b('0x3c')]);var _0x4ab72d={'where':_0x3e7a10[_0x190b('0x39')]};return db[_0x190b('0x29')][_0x190b('0x3d')](_0x4ab72d)[_0x190b('0x23')](function(_0x5a399b){_0x5c89ab[_0x190b('0x3d')]=_0x5a399b;if(_0x3b6aaf['query'][_0x190b('0x3e')]){_0x3e7a10[_0x190b('0x3f')]=[{'all':!![]}];}return db['MailSubstatus'][_0x190b('0x40')](_0x3e7a10);})[_0x190b('0x23')](function(_0x45b296){_0x5c89ab['rows']=_0x45b296;return _0x5c89ab;})[_0x190b('0x23')](respondWithFilteredResult(_0x51f8b4,_0x3e7a10))['catch'](handleError(_0x51f8b4,null));};exports['show']=function(_0x554486,_0x2cfff0){var _0x3aef1d={'raw':!![],'where':{'id':_0x554486[_0x190b('0x41')]['id']}},_0x411cb5={};_0x411cb5['model']=_['keys'](db[_0x190b('0x29')]['rawAttributes']);_0x411cb5[_0x190b('0x30')]=_[_0x190b('0x2e')](_0x554486['query']);_0x411cb5[_0x190b('0x2f')]=_[_0x190b('0x31')](_0x411cb5[_0x190b('0x2c')],_0x411cb5['query']);_0x3aef1d[_0x190b('0x33')]=_[_0x190b('0x31')](_0x411cb5['model'],qs[_0x190b('0x32')](_0x554486['query'][_0x190b('0x32')]));_0x3aef1d[_0x190b('0x33')]=_0x3aef1d[_0x190b('0x33')]['length']?_0x3aef1d[_0x190b('0x33')]:_0x411cb5['model'];if(_0x554486[_0x190b('0x30')][_0x190b('0x3e')]){_0x3aef1d[_0x190b('0x3f')]=[{'all':!![]}];}_0x3aef1d=_[_0x190b('0x38')]({},_0x3aef1d,_0x554486[_0x190b('0x3c')]);return db[_0x190b('0x29')][_0x190b('0x42')](_0x3aef1d)['then'](handleEntityNotFound(_0x2cfff0,null))[_0x190b('0x23')](respondWithResult(_0x2cfff0,null))[_0x190b('0x43')](handleError(_0x2cfff0,null));};exports[_0x190b('0x44')]=function(_0x4b7f35,_0x1b71d5){return db[_0x190b('0x29')][_0x190b('0x44')](_0x4b7f35[_0x190b('0x45')],{})[_0x190b('0x23')](respondWithResult(_0x1b71d5,0xc9))['catch'](handleError(_0x1b71d5,null));};exports[_0x190b('0x46')]=function(_0xadc789,_0x1e8dc8){if(_0xadc789['body']['id']){delete _0xadc789[_0x190b('0x45')]['id'];}return db[_0x190b('0x29')][_0x190b('0x42')]({'where':{'id':_0xadc789['params']['id']}})['then'](handleEntityNotFound(_0x1e8dc8,null))[_0x190b('0x23')](saveUpdates(_0xadc789[_0x190b('0x45')],null))[_0x190b('0x23')](respondWithResult(_0x1e8dc8,null))[_0x190b('0x43')](handleError(_0x1e8dc8,null));};exports[_0x190b('0x24')]=function(_0x10aaeb,_0x49654b){return db[_0x190b('0x29')][_0x190b('0x42')]({'where':{'id':_0x10aaeb[_0x190b('0x41')]['id']}})['then'](handleEntityNotFound(_0x49654b,null))[_0x190b('0x23')](removeEntity(_0x49654b,null))[_0x190b('0x43')](handleError(_0x49654b,null));};exports[_0x190b('0x47')]=function(_0x503700,_0xbc6757){return db[_0x190b('0x29')][_0x190b('0x47')]()[_0x190b('0x23')](respondWithResult(_0xbc6757,null))[_0x190b('0x43')](handleError(_0xbc6757,null));}; \ No newline at end of file +var _0x9c5a=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','map','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','create','body','find','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','index','MailSubstatus','rawAttributes','fieldName','type','model','query'];(function(_0x4a9bdd,_0x5098f5){var _0x1ba3a4=function(_0x3b157f){while(--_0x3b157f){_0x4a9bdd['push'](_0x4a9bdd['shift']());}};_0x1ba3a4(++_0x5098f5);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x141d09,_0x444317){_0x141d09=_0x141d09-0x0;var _0x4f3c64=_0x9c5a[_0x141d09];return _0x4f3c64;};'use strict';var pdf=require(_0xa9c5('0x0'));var emlformat=require(_0xa9c5('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa9c5('0x2'));var jsonpatch=require(_0xa9c5('0x3'));var rp=require(_0xa9c5('0x4'));var moment=require(_0xa9c5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa9c5('0x6'));var util=require(_0xa9c5('0x7'));var path=require('path');var sox=require(_0xa9c5('0x8'));var csv=require('to-csv');var ejs=require(_0xa9c5('0x9'));var fs=require('fs');var _=require(_0xa9c5('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa9c5('0xb'));var deskjs=require(_0xa9c5('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa9c5('0xd'));var Papa=require(_0xa9c5('0xe'));var Redis=require('ioredis');var authService=require(_0xa9c5('0xf'));var qs=require(_0xa9c5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa9c5('0x11'))(_0xa9c5('0x12'));var utils=require(_0xa9c5('0x13'));var config=require(_0xa9c5('0x14'));var db=require(_0xa9c5('0x15'))['db'];function respondWithStatusCode(_0x4492a4,_0x51c8d){_0x51c8d=_0x51c8d||0xcc;return function(_0x42d5cf){if(_0x42d5cf){return _0x4492a4[_0xa9c5('0x16')](_0x51c8d);}return _0x4492a4[_0xa9c5('0x17')](_0x51c8d)['end']();};}function respondWithResult(_0x390ca2,_0x1276d2){_0x1276d2=_0x1276d2||0xc8;return function(_0x7df76d){if(_0x7df76d){return _0x390ca2[_0xa9c5('0x17')](_0x1276d2)[_0xa9c5('0x18')](_0x7df76d);}};}function respondWithFilteredResult(_0x1dad66,_0x251099){return function(_0x40b001){if(_0x40b001){var _0x19a43e=_0x40b001[_0xa9c5('0x19')],_0xcf13f2=_0x251099[_0xa9c5('0x1a')],_0x4bb57e=_0x251099['offset']+_0x251099[_0xa9c5('0x1b')],_0x2b0d73;if(_0x4bb57e>=_0x19a43e){_0x4bb57e=_0x19a43e;_0x2b0d73=0xc8;}else{_0x2b0d73=0xce;}_0x1dad66[_0xa9c5('0x17')](_0x2b0d73);return _0x1dad66[_0xa9c5('0x1c')](_0xa9c5('0x1d'),_0xcf13f2+'-'+_0x4bb57e+'/'+_0x19a43e)[_0xa9c5('0x18')](_0x40b001);}return null;};}function patchUpdates(_0x349f27){return function(_0x3b8d4d){try{jsonpatch[_0xa9c5('0x1e')](_0x3b8d4d,_0x349f27,!![]);}catch(_0x2c7cd5){return BPromise[_0xa9c5('0x1f')](_0x2c7cd5);}return _0x3b8d4d[_0xa9c5('0x20')]();};}function saveUpdates(_0x2d95f8,_0x54f8b9){return function(_0x1115ad){if(_0x1115ad){return _0x1115ad[_0xa9c5('0x21')](_0x2d95f8)['then'](function(_0x5d2115){return _0x5d2115;});}return null;};}function removeEntity(_0xce9af6,_0x366f5c){return function(_0x10b208){if(_0x10b208){return _0x10b208[_0xa9c5('0x22')]()[_0xa9c5('0x23')](function(){_0xce9af6[_0xa9c5('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fa280,_0x3d4e1b){return function(_0x11d395){if(!_0x11d395){_0x4fa280['sendStatus'](0x194);}return _0x11d395;};}function handleError(_0x6819b3,_0x424b4c){_0x424b4c=_0x424b4c||0x1f4;return function(_0x306c9b){logger[_0xa9c5('0x24')](_0x306c9b[_0xa9c5('0x25')]);if(_0x306c9b[_0xa9c5('0x26')]){delete _0x306c9b[_0xa9c5('0x26')];}_0x6819b3['status'](_0x424b4c)['send'](_0x306c9b);};}exports[_0xa9c5('0x27')]=function(_0x4cd5e6,_0x1762ac){var _0x830bad={},_0x4caefa={},_0x11a723={'count':0x0,'rows':[]};var _0x320dc0=_['map'](db[_0xa9c5('0x28')][_0xa9c5('0x29')],function(_0x198cdf){return{'name':_0x198cdf[_0xa9c5('0x2a')],'type':_0x198cdf[_0xa9c5('0x2b')]['key']};});_0x4caefa[_0xa9c5('0x2c')]=_['map'](_0x320dc0,_0xa9c5('0x26'));_0x4caefa[_0xa9c5('0x2d')]=_[_0xa9c5('0x2e')](_0x4cd5e6['query']);_0x4caefa[_0xa9c5('0x2f')]=_[_0xa9c5('0x30')](_0x4caefa['model'],_0x4caefa[_0xa9c5('0x2d')]);_0x830bad[_0xa9c5('0x31')]=_[_0xa9c5('0x30')](_0x4caefa[_0xa9c5('0x2c')],qs[_0xa9c5('0x32')](_0x4cd5e6[_0xa9c5('0x2d')][_0xa9c5('0x32')]));_0x830bad['attributes']=_0x830bad[_0xa9c5('0x31')][_0xa9c5('0x33')]?_0x830bad[_0xa9c5('0x31')]:_0x4caefa[_0xa9c5('0x2c')];if(!_0x4cd5e6[_0xa9c5('0x2d')][_0xa9c5('0x34')](_0xa9c5('0x35'))){_0x830bad[_0xa9c5('0x1b')]=qs['limit'](_0x4cd5e6['query'][_0xa9c5('0x1b')]);_0x830bad[_0xa9c5('0x1a')]=qs[_0xa9c5('0x1a')](_0x4cd5e6[_0xa9c5('0x2d')][_0xa9c5('0x1a')]);}_0x830bad[_0xa9c5('0x36')]=qs['sort'](_0x4cd5e6['query']['sort']);_0x830bad[_0xa9c5('0x37')]=qs[_0xa9c5('0x2f')](_['pick'](_0x4cd5e6[_0xa9c5('0x2d')],_0x4caefa['filters']));if(_0x4cd5e6[_0xa9c5('0x2d')][_0xa9c5('0x38')]){_0x830bad[_0xa9c5('0x37')]=_[_0xa9c5('0x39')](_0x830bad['where'],{'$or':_[_0xa9c5('0x3a')](_0x320dc0,function(_0x2cd721){if(_0x2cd721[_0xa9c5('0x2b')]!==_0xa9c5('0x3b')){var _0x814c1a={};_0x814c1a[_0x2cd721[_0xa9c5('0x26')]]={'$like':'%'+_0x4cd5e6[_0xa9c5('0x2d')][_0xa9c5('0x38')]+'%'};return _0x814c1a;}})});}_0x830bad=_['merge']({},_0x830bad,_0x4cd5e6[_0xa9c5('0x3c')]);var _0x46e5d2={'where':_0x830bad[_0xa9c5('0x37')]};return db[_0xa9c5('0x28')][_0xa9c5('0x19')](_0x46e5d2)[_0xa9c5('0x23')](function(_0x493b20){_0x11a723[_0xa9c5('0x19')]=_0x493b20;if(_0x4cd5e6['query'][_0xa9c5('0x3d')]){_0x830bad['include']=[{'all':!![]}];}return db[_0xa9c5('0x28')][_0xa9c5('0x3e')](_0x830bad);})[_0xa9c5('0x23')](function(_0x5d09c5){_0x11a723[_0xa9c5('0x3f')]=_0x5d09c5;return _0x11a723;})[_0xa9c5('0x23')](respondWithFilteredResult(_0x1762ac,_0x830bad))[_0xa9c5('0x40')](handleError(_0x1762ac,null));};exports[_0xa9c5('0x41')]=function(_0x5914d2,_0x2dbb48){var _0x97803f={'raw':!![],'where':{'id':_0x5914d2[_0xa9c5('0x42')]['id']}},_0x3db918={};_0x3db918[_0xa9c5('0x2c')]=_['keys'](db[_0xa9c5('0x28')]['rawAttributes']);_0x3db918[_0xa9c5('0x2d')]=_[_0xa9c5('0x2e')](_0x5914d2[_0xa9c5('0x2d')]);_0x3db918[_0xa9c5('0x2f')]=_[_0xa9c5('0x30')](_0x3db918[_0xa9c5('0x2c')],_0x3db918[_0xa9c5('0x2d')]);_0x97803f[_0xa9c5('0x31')]=_[_0xa9c5('0x30')](_0x3db918[_0xa9c5('0x2c')],qs['fields'](_0x5914d2[_0xa9c5('0x2d')][_0xa9c5('0x32')]));_0x97803f[_0xa9c5('0x31')]=_0x97803f[_0xa9c5('0x31')][_0xa9c5('0x33')]?_0x97803f[_0xa9c5('0x31')]:_0x3db918['model'];if(_0x5914d2[_0xa9c5('0x2d')][_0xa9c5('0x3d')]){_0x97803f['include']=[{'all':!![]}];}_0x97803f=_['merge']({},_0x97803f,_0x5914d2['options']);return db['MailSubstatus']['find'](_0x97803f)[_0xa9c5('0x23')](handleEntityNotFound(_0x2dbb48,null))[_0xa9c5('0x23')](respondWithResult(_0x2dbb48,null))[_0xa9c5('0x40')](handleError(_0x2dbb48,null));};exports[_0xa9c5('0x43')]=function(_0x255402,_0x240c40){return db[_0xa9c5('0x28')][_0xa9c5('0x43')](_0x255402[_0xa9c5('0x44')],{})[_0xa9c5('0x23')](respondWithResult(_0x240c40,0xc9))[_0xa9c5('0x40')](handleError(_0x240c40,null));};exports[_0xa9c5('0x21')]=function(_0x1c2ccf,_0x4bf8b4){if(_0x1c2ccf[_0xa9c5('0x44')]['id']){delete _0x1c2ccf['body']['id'];}return db[_0xa9c5('0x28')][_0xa9c5('0x45')]({'where':{'id':_0x1c2ccf['params']['id']}})['then'](handleEntityNotFound(_0x4bf8b4,null))[_0xa9c5('0x23')](saveUpdates(_0x1c2ccf[_0xa9c5('0x44')],null))[_0xa9c5('0x23')](respondWithResult(_0x4bf8b4,null))['catch'](handleError(_0x4bf8b4,null));};exports['destroy']=function(_0x2333c4,_0xd03cec){return db['MailSubstatus'][_0xa9c5('0x45')]({'where':{'id':_0x2333c4[_0xa9c5('0x42')]['id']}})[_0xa9c5('0x23')](handleEntityNotFound(_0xd03cec,null))[_0xa9c5('0x23')](removeEntity(_0xd03cec,null))[_0xa9c5('0x40')](handleError(_0xd03cec,null));};exports[_0xa9c5('0x46')]=function(_0x4b6fc9,_0x4cd8e4){return db['MailSubstatus'][_0xa9c5('0x46')]()[_0xa9c5('0x23')](respondWithResult(_0x4cd8e4,null))[_0xa9c5('0x40')](handleError(_0x4cd8e4,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index d8b7309..5e847d8 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 _0x761c=['api','bluebird','request-promise','path','../../config/environment','exports','define','MailSubstatus','mail_substatuses','lodash','../../config/logger'];(function(_0x1c3af2,_0x4578de){var _0xec93e=function(_0x37991a){while(--_0x37991a){_0x1c3af2['push'](_0x1c3af2['shift']());}};_0xec93e(++_0x4578de);}(_0x761c,0x18a));var _0xc761=function(_0x4cf1e3,_0x67ad43){_0x4cf1e3=_0x4cf1e3-0x0;var _0x307380=_0x761c[_0x4cf1e3];return _0x307380;};'use strict';var _=require(_0xc761('0x0'));var util=require('util');var logger=require(_0xc761('0x1'))(_0xc761('0x2'));var moment=require('moment');var BPromise=require(_0xc761('0x3'));var rp=require(_0xc761('0x4'));var fs=require('fs');var path=require(_0xc761('0x5'));var rimraf=require('rimraf');var config=require(_0xc761('0x6'));var attributes=require('./mailSubstatus.attributes');module[_0xc761('0x7')]=function(_0x468f51,_0x23ba0b){return _0x468f51[_0xc761('0x8')](_0xc761('0x9'),attributes,{'tableName':_0xc761('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x97db=['path','rimraf','exports','MailSubstatus','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x5ddaac,_0x2697a8){var _0x2a9c58=function(_0x851032){while(--_0x851032){_0x5ddaac['push'](_0x5ddaac['shift']());}};_0x2a9c58(++_0x2697a8);}(_0x97db,0x1b4));var _0xb97d=function(_0x3f0a90,_0x36903a){_0x3f0a90=_0x3f0a90-0x0;var _0x2519e9=_0x97db[_0x3f0a90];return _0x2519e9;};'use strict';var _=require(_0xb97d('0x0'));var util=require(_0xb97d('0x1'));var logger=require(_0xb97d('0x2'))('api');var moment=require('moment');var BPromise=require(_0xb97d('0x3'));var rp=require(_0xb97d('0x4'));var fs=require('fs');var path=require(_0xb97d('0x5'));var rimraf=require(_0xb97d('0x6'));var config=require('../../config/environment');var attributes=require('./mailSubstatus.attributes');module[_0xb97d('0x7')]=function(_0x1f59dd,_0x4a5902){return _0x1f59dd['define'](_0xb97d('0x8'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index a2877ce..b2a8ca1 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 _0x91a7=['message','MailSubstatus,\x20%s,\x20%s','catch','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error','code'];(function(_0x4914e9,_0x12cb7f){var _0x14c47e=function(_0x1402be){while(--_0x1402be){_0x4914e9['push'](_0x4914e9['shift']());}};_0x14c47e(++_0x12cb7f);}(_0x91a7,0xe7));var _0x791a=function(_0x3a7490,_0x265112){_0x3a7490=_0x3a7490-0x0;var _0x4209ab=_0x91a7[_0x3a7490];return _0x4209ab;};'use strict';var _=require('lodash');var util=require(_0x791a('0x0'));var moment=require(_0x791a('0x1'));var BPromise=require(_0x791a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x791a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x791a('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x791a('0x5'));var jayson=require(_0x791a('0x6'));var client=jayson['client'][_0x791a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5db6db,_0x33baac,_0x159e24){return new BPromise(function(_0x5aa10a,_0x1a32b4){return client[_0x791a('0x8')](_0x5db6db,_0x159e24)[_0x791a('0x9')](function(_0x80ff65){logger[_0x791a('0xa')]('MailSubstatus,\x20%s,\x20%s',_0x33baac,_0x791a('0xb'));logger[_0x791a('0xc')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x33baac,_0x791a('0xb'),JSON[_0x791a('0xd')](_0x80ff65));if(_0x80ff65[_0x791a('0xe')]){if(_0x80ff65[_0x791a('0xe')][_0x791a('0xf')]===0x1f4){logger[_0x791a('0xe')]('MailSubstatus,\x20%s,\x20%s',_0x33baac,_0x80ff65['error'][_0x791a('0x10')]);return _0x1a32b4(_0x80ff65[_0x791a('0xe')]['message']);}logger[_0x791a('0xe')](_0x791a('0x11'),_0x33baac,_0x80ff65['error'][_0x791a('0x10')]);return _0x5aa10a(_0x80ff65[_0x791a('0xe')][_0x791a('0x10')]);}else{logger[_0x791a('0xa')]('MailSubstatus,\x20%s,\x20%s',_0x33baac,_0x791a('0xb'));_0x5aa10a(_0x80ff65['result'][_0x791a('0x10')]);}})[_0x791a('0x12')](function(_0x49ae3e){logger[_0x791a('0xe')]('MailSubstatus,\x20%s,\x20%s',_0x33baac,_0x49ae3e);_0x1a32b4(_0x49ae3e);});});} \ No newline at end of file +var _0x70e0=['code','MailSubstatus,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x149030,_0x500fa2){var _0x583713=function(_0x5f06a7){while(--_0x5f06a7){_0x149030['push'](_0x149030['shift']());}};_0x583713(++_0x500fa2);}(_0x70e0,0x17b));var _0x070e=function(_0x3c5680,_0xca14ae){_0x3c5680=_0x3c5680-0x0;var _0x5b85b1=_0x70e0[_0x3c5680];return _0x5b85b1;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('MailSubstatus,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('MailSubstatus,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('MailSubstatus,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 8cf8b12..4b3699e 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 _0x44a6=['../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','show','post','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x5afbd5,_0x48a693){var _0x298511=function(_0x2f4262){while(--_0x2f4262){_0x5afbd5['push'](_0x5afbd5['shift']());}};_0x298511(++_0x48a693);}(_0x44a6,0xc1));var _0x644a=function(_0x524b07,_0x2cb714){_0x524b07=_0x524b07-0x0;var _0x598e17=_0x44a6[_0x524b07];return _0x598e17;};'use strict';var multer=require(_0x644a('0x0'));var util=require(_0x644a('0x1'));var path=require(_0x644a('0x2'));var timeout=require(_0x644a('0x3'));var express=require(_0x644a('0x4'));var router=express[_0x644a('0x5')]();var auth=require(_0x644a('0x6'));var interaction=require(_0x644a('0x7'));var config=require(_0x644a('0x8'));var controller=require(_0x644a('0x9'));router[_0x644a('0xa')]('/',auth[_0x644a('0xb')](),controller[_0x644a('0xc')]);router['get'](_0x644a('0xd'),auth[_0x644a('0xb')](),controller['describe']);router[_0x644a('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x644a('0xe')]);router[_0x644a('0xf')]('/',auth[_0x644a('0xb')](),controller['create']);router[_0x644a('0x10')]('/:id',auth[_0x644a('0xb')](),controller[_0x644a('0x11')]);router['delete']('/:id',auth[_0x644a('0xb')](),controller[_0x644a('0x12')]);module[_0x644a('0x13')]=router; \ No newline at end of file +var _0xbb85=['delete','destroy','exports','multer','util','connect-timeout','express','Router','../../config/environment','./mailTransferReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','put','update'];(function(_0x54ca96,_0x278098){var _0xb883ae=function(_0x5a84a1){while(--_0x5a84a1){_0x54ca96['push'](_0x54ca96['shift']());}};_0xb883ae(++_0x278098);}(_0xbb85,0x1b8));var _0x5bb8=function(_0x56693d,_0x1477d3){_0x56693d=_0x56693d-0x0;var _0x980625=_0xbb85[_0x56693d];return _0x980625;};'use strict';var multer=require(_0x5bb8('0x0'));var util=require(_0x5bb8('0x1'));var path=require('path');var timeout=require(_0x5bb8('0x2'));var express=require(_0x5bb8('0x3'));var router=express[_0x5bb8('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5bb8('0x5'));var controller=require(_0x5bb8('0x6'));router[_0x5bb8('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5bb8('0x7')](_0x5bb8('0x8'),auth[_0x5bb8('0x9')](),controller[_0x5bb8('0xa')]);router['get'](_0x5bb8('0xb'),auth[_0x5bb8('0x9')](),controller[_0x5bb8('0xc')]);router[_0x5bb8('0xd')]('/',auth[_0x5bb8('0x9')](),controller['create']);router[_0x5bb8('0xe')](_0x5bb8('0xb'),auth[_0x5bb8('0x9')](),controller[_0x5bb8('0xf')]);router[_0x5bb8('0x10')]('/:id',auth[_0x5bb8('0x9')](),controller[_0x5bb8('0x11')]);module[_0x5bb8('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 3c843d7..92ac155 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 _0x8252=['moment','sequelize','exports','STRING','account','agent','queue','NOW'];(function(_0x366a90,_0xcf1644){var _0x5250c0=function(_0x1e251d){while(--_0x1e251d){_0x366a90['push'](_0x366a90['shift']());}};_0x5250c0(++_0xcf1644);}(_0x8252,0x198));var _0x2825=function(_0x116b77,_0x304343){_0x116b77=_0x116b77-0x0;var _0x220178=_0x8252[_0x116b77];return _0x220178;};'use strict';var moment=require(_0x2825('0x0'));var Sequelize=require(_0x2825('0x1'));module[_0x2825('0x2')]={'uniqueid':{'type':Sequelize[_0x2825('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x2825('0x4'),_0x2825('0x5'),_0x2825('0x6')),'allowNull':![],'defaultValue':_0x2825('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x2825('0x7')]}}; \ No newline at end of file +var _0x6f88=['STRING','ENUM','account','agent','queue','DATE','moment'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x6f88,0x6f));var _0x86f8=function(_0x3ff332,_0x145564){_0x3ff332=_0x3ff332-0x0;var _0x5a2264=_0x6f88[_0x3ff332];return _0x5a2264;};'use strict';var moment=require(_0x86f8('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x86f8('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x86f8('0x2')](_0x86f8('0x3'),_0x86f8('0x4'),_0x86f8('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0x86f8('0x6')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index c56448d..1f1e8a2 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 _0x7a54=['Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','map','MailTransferReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','count','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','update','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','set'];(function(_0x211e7d,_0x19da1a){var _0x54592b=function(_0x3d29de){while(--_0x3d29de){_0x211e7d['push'](_0x211e7d['shift']());}};_0x54592b(++_0x19da1a);}(_0x7a54,0x106));var _0x47a5=function(_0x2dca29,_0x363001){_0x2dca29=_0x2dca29-0x0;var _0x2b8c11=_0x7a54[_0x2dca29];return _0x2b8c11;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');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 db=require(_0x47a5('0x14'))['db'];function respondWithStatusCode(_0xd612dd,_0xd308b8){_0xd308b8=_0xd308b8||0xcc;return function(_0x1eae59){if(_0x1eae59){return _0xd612dd['sendStatus'](_0xd308b8);}return _0xd612dd[_0x47a5('0x15')](_0xd308b8)[_0x47a5('0x16')]();};}function respondWithResult(_0x1cf309,_0x711793){_0x711793=_0x711793||0xc8;return function(_0x139f25){if(_0x139f25){return _0x1cf309[_0x47a5('0x15')](_0x711793)[_0x47a5('0x17')](_0x139f25);}};}function respondWithFilteredResult(_0x190faa,_0x4e99a8){return function(_0x362359){if(_0x362359){var _0x11faf5=_0x362359['count'],_0x3b001e=_0x4e99a8['offset'],_0x2a2cbb=_0x4e99a8[_0x47a5('0x18')]+_0x4e99a8['limit'],_0x1ef44c;if(_0x2a2cbb>=_0x11faf5){_0x2a2cbb=_0x11faf5;_0x1ef44c=0xc8;}else{_0x1ef44c=0xce;}_0x190faa['status'](_0x1ef44c);return _0x190faa[_0x47a5('0x19')](_0x47a5('0x1a'),_0x3b001e+'-'+_0x2a2cbb+'/'+_0x11faf5)[_0x47a5('0x17')](_0x362359);}return null;};}function patchUpdates(_0x1ef371){return function(_0x477b1d){try{jsonpatch[_0x47a5('0x1b')](_0x477b1d,_0x1ef371,!![]);}catch(_0x2763d6){return BPromise[_0x47a5('0x1c')](_0x2763d6);}return _0x477b1d[_0x47a5('0x1d')]();};}function saveUpdates(_0x4a9fcb,_0x1570bc){return function(_0xf160ba){if(_0xf160ba){return _0xf160ba['update'](_0x4a9fcb)[_0x47a5('0x1e')](function(_0x1f03f7){return _0x1f03f7;});}return null;};}function removeEntity(_0x36874d,_0x4c5910){return function(_0xb8ae6c){if(_0xb8ae6c){return _0xb8ae6c[_0x47a5('0x1f')]()[_0x47a5('0x1e')](function(){_0x36874d[_0x47a5('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe2dea9,_0x385687){return function(_0x513981){if(!_0x513981){_0xe2dea9[_0x47a5('0x20')](0x194);}return _0x513981;};}function handleError(_0xc4cd63,_0x4437f1){_0x4437f1=_0x4437f1||0x1f4;return function(_0x129ce5){logger[_0x47a5('0x21')](_0x129ce5['stack']);if(_0x129ce5['name']){delete _0x129ce5[_0x47a5('0x22')];}_0xc4cd63['status'](_0x4437f1)[_0x47a5('0x23')](_0x129ce5);};}exports['index']=function(_0x23cb77,_0x378208){var _0x36ad34={},_0x1dac65={},_0x21f296={'count':0x0,'rows':[]};var _0x3ba0b7=_[_0x47a5('0x24')](db[_0x47a5('0x25')][_0x47a5('0x26')],function(_0x361bfa){return{'name':_0x361bfa[_0x47a5('0x27')],'type':_0x361bfa[_0x47a5('0x28')][_0x47a5('0x29')]};});_0x1dac65['model']=_[_0x47a5('0x24')](_0x3ba0b7,'name');_0x1dac65[_0x47a5('0x2a')]=_[_0x47a5('0x2b')](_0x23cb77[_0x47a5('0x2a')]);_0x1dac65['filters']=_[_0x47a5('0x2c')](_0x1dac65[_0x47a5('0x2d')],_0x1dac65[_0x47a5('0x2a')]);_0x36ad34[_0x47a5('0x2e')]=_['intersection'](_0x1dac65['model'],qs[_0x47a5('0x2f')](_0x23cb77[_0x47a5('0x2a')]['fields']));_0x36ad34['attributes']=_0x36ad34[_0x47a5('0x2e')][_0x47a5('0x30')]?_0x36ad34['attributes']:_0x1dac65[_0x47a5('0x2d')];if(!_0x23cb77['query'][_0x47a5('0x31')](_0x47a5('0x32'))){_0x36ad34['limit']=qs['limit'](_0x23cb77[_0x47a5('0x2a')]['limit']);_0x36ad34[_0x47a5('0x18')]=qs[_0x47a5('0x18')](_0x23cb77[_0x47a5('0x2a')]['offset']);}_0x36ad34[_0x47a5('0x33')]=qs['sort'](_0x23cb77['query'][_0x47a5('0x34')]);_0x36ad34['where']=qs[_0x47a5('0x35')](_['pick'](_0x23cb77[_0x47a5('0x2a')],_0x1dac65[_0x47a5('0x35')]));if(_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]){_0x36ad34[_0x47a5('0x37')]=_[_0x47a5('0x38')](_0x36ad34[_0x47a5('0x37')],{'$or':_[_0x47a5('0x24')](_0x3ba0b7,function(_0x1a0d23){if(_0x1a0d23['type']!==_0x47a5('0x39')){var _0x10f136={};_0x10f136[_0x1a0d23['name']]={'$like':'%'+_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]+'%'};return _0x10f136;}})});}_0x36ad34=_[_0x47a5('0x38')]({},_0x36ad34,_0x23cb77['options']);var _0x101f70={'where':_0x36ad34[_0x47a5('0x37')]};return db['MailTransferReport'][_0x47a5('0x3a')](_0x101f70)[_0x47a5('0x1e')](function(_0x54ae35){_0x21f296['count']=_0x54ae35;if(_0x23cb77['query'][_0x47a5('0x3b')]){_0x36ad34['include']=[{'all':!![]}];}return db[_0x47a5('0x25')][_0x47a5('0x3c')](_0x36ad34);})[_0x47a5('0x1e')](function(_0x111f0d){_0x21f296[_0x47a5('0x3d')]=_0x111f0d;return _0x21f296;})[_0x47a5('0x1e')](respondWithFilteredResult(_0x378208,_0x36ad34))[_0x47a5('0x3e')](handleError(_0x378208,null));};exports[_0x47a5('0x3f')]=function(_0x3fa2a8,_0x36a24e){var _0x280500={'raw':!![],'where':{'id':_0x3fa2a8[_0x47a5('0x40')]['id']}},_0x1658e8={};_0x1658e8['model']=_[_0x47a5('0x2b')](db[_0x47a5('0x25')][_0x47a5('0x26')]);_0x1658e8[_0x47a5('0x2a')]=_['keys'](_0x3fa2a8[_0x47a5('0x2a')]);_0x1658e8['filters']=_['intersection'](_0x1658e8['model'],_0x1658e8['query']);_0x280500[_0x47a5('0x2e')]=_['intersection'](_0x1658e8[_0x47a5('0x2d')],qs[_0x47a5('0x2f')](_0x3fa2a8[_0x47a5('0x2a')]['fields']));_0x280500[_0x47a5('0x2e')]=_0x280500[_0x47a5('0x2e')]['length']?_0x280500['attributes']:_0x1658e8[_0x47a5('0x2d')];if(_0x3fa2a8['query'][_0x47a5('0x3b')]){_0x280500[_0x47a5('0x41')]=[{'all':!![]}];}_0x280500=_[_0x47a5('0x38')]({},_0x280500,_0x3fa2a8[_0x47a5('0x42')]);return db[_0x47a5('0x25')][_0x47a5('0x43')](_0x280500)[_0x47a5('0x1e')](handleEntityNotFound(_0x36a24e,null))[_0x47a5('0x1e')](respondWithResult(_0x36a24e,null))[_0x47a5('0x3e')](handleError(_0x36a24e,null));};exports[_0x47a5('0x44')]=function(_0x24ecb1,_0x3c3ebf){return db[_0x47a5('0x25')][_0x47a5('0x44')](_0x24ecb1[_0x47a5('0x45')],{})[_0x47a5('0x1e')](respondWithResult(_0x3c3ebf,0xc9))['catch'](handleError(_0x3c3ebf,null));};exports[_0x47a5('0x46')]=function(_0x23bb04,_0x49eab1){if(_0x23bb04['body']['id']){delete _0x23bb04[_0x47a5('0x45')]['id'];}return db['MailTransferReport'][_0x47a5('0x43')]({'where':{'id':_0x23bb04[_0x47a5('0x40')]['id']}})['then'](handleEntityNotFound(_0x49eab1,null))['then'](saveUpdates(_0x23bb04[_0x47a5('0x45')],null))['then'](respondWithResult(_0x49eab1,null))[_0x47a5('0x3e')](handleError(_0x49eab1,null));};exports[_0x47a5('0x1f')]=function(_0x3548bc,_0x3e12a7){return db[_0x47a5('0x25')][_0x47a5('0x43')]({'where':{'id':_0x3548bc[_0x47a5('0x40')]['id']}})['then'](handleEntityNotFound(_0x3e12a7,null))['then'](removeEntity(_0x3e12a7,null))[_0x47a5('0x3e')](handleError(_0x3e12a7,null));};exports[_0x47a5('0x47')]=function(_0x1163e3,_0x9ea93e){return db[_0x47a5('0x25')][_0x47a5('0x47')]()[_0x47a5('0x1e')](respondWithResult(_0x9ea93e,null))['catch'](handleError(_0x9ea93e,null));}; \ No newline at end of file +var _0x9957=['eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','pick','filter','where','merge','VIRTUAL','options','MailTransferReport','count','includeAll','include','findAll','rows','show','find','catch','create','body','update','params','describe','html-pdf'];(function(_0x1e90b4,_0x14ce86){var _0x4d52f8=function(_0x1dc612){while(--_0x1dc612){_0x1e90b4['push'](_0x1e90b4['shift']());}};_0x4d52f8(++_0x14ce86);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');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 db=require(_0x7995('0x19'))['db'];function respondWithStatusCode(_0x2cb37a,_0x19a27e){_0x19a27e=_0x19a27e||0xcc;return function(_0x385f00){if(_0x385f00){return _0x2cb37a[_0x7995('0x1a')](_0x19a27e);}return _0x2cb37a[_0x7995('0x1b')](_0x19a27e)[_0x7995('0x1c')]();};}function respondWithResult(_0x4cc004,_0x58f5ad){_0x58f5ad=_0x58f5ad||0xc8;return function(_0x2b4e94){if(_0x2b4e94){return _0x4cc004[_0x7995('0x1b')](_0x58f5ad)[_0x7995('0x1d')](_0x2b4e94);}};}function respondWithFilteredResult(_0x321ae8,_0x3f1d3e){return function(_0x1a5310){if(_0x1a5310){var _0x2202ce=_0x1a5310['count'],_0x41cbf0=_0x3f1d3e[_0x7995('0x1e')],_0x5377e5=_0x3f1d3e[_0x7995('0x1e')]+_0x3f1d3e[_0x7995('0x1f')],_0x2eeacc;if(_0x5377e5>=_0x2202ce){_0x5377e5=_0x2202ce;_0x2eeacc=0xc8;}else{_0x2eeacc=0xce;}_0x321ae8[_0x7995('0x1b')](_0x2eeacc);return _0x321ae8[_0x7995('0x20')](_0x7995('0x21'),_0x41cbf0+'-'+_0x5377e5+'/'+_0x2202ce)['json'](_0x1a5310);}return null;};}function patchUpdates(_0x54c9ae){return function(_0x2536c8){try{jsonpatch['apply'](_0x2536c8,_0x54c9ae,!![]);}catch(_0x555f74){return BPromise[_0x7995('0x22')](_0x555f74);}return _0x2536c8[_0x7995('0x23')]();};}function saveUpdates(_0x4cbe10,_0x3a9b54){return function(_0x51f276){if(_0x51f276){return _0x51f276['update'](_0x4cbe10)[_0x7995('0x24')](function(_0x327b1f){return _0x327b1f;});}return null;};}function removeEntity(_0x350fd9,_0x1a8568){return function(_0x460924){if(_0x460924){return _0x460924[_0x7995('0x25')]()['then'](function(){_0x350fd9[_0x7995('0x1b')](0xcc)[_0x7995('0x1c')]();});}};}function handleEntityNotFound(_0x204507,_0x285437){return function(_0x563799){if(!_0x563799){_0x204507[_0x7995('0x1a')](0x194);}return _0x563799;};}function handleError(_0x475351,_0x472195){_0x472195=_0x472195||0x1f4;return function(_0x59405a){logger[_0x7995('0x26')](_0x59405a[_0x7995('0x27')]);if(_0x59405a[_0x7995('0x28')]){delete _0x59405a[_0x7995('0x28')];}_0x475351[_0x7995('0x1b')](_0x472195)[_0x7995('0x29')](_0x59405a);};}exports['index']=function(_0x47625f,_0x5911c3){var _0x229742={},_0x49bc7e={},_0xf16cc2={'count':0x0,'rows':[]};var _0x132a42=_[_0x7995('0x2a')](db['MailTransferReport'][_0x7995('0x2b')],function(_0x514445){return{'name':_0x514445[_0x7995('0x2c')],'type':_0x514445[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x49bc7e['model']=_['map'](_0x132a42,'name');_0x49bc7e[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x47625f[_0x7995('0x2f')]);_0x49bc7e[_0x7995('0x31')]=_[_0x7995('0x32')](_0x49bc7e[_0x7995('0x33')],_0x49bc7e['query']);_0x229742['attributes']=_[_0x7995('0x32')](_0x49bc7e['model'],qs[_0x7995('0x34')](_0x47625f[_0x7995('0x2f')][_0x7995('0x34')]));_0x229742[_0x7995('0x35')]=_0x229742[_0x7995('0x35')]['length']?_0x229742[_0x7995('0x35')]:_0x49bc7e[_0x7995('0x33')];if(!_0x47625f['query']['hasOwnProperty']('nolimit')){_0x229742[_0x7995('0x1f')]=qs[_0x7995('0x1f')](_0x47625f['query'][_0x7995('0x1f')]);_0x229742['offset']=qs[_0x7995('0x1e')](_0x47625f[_0x7995('0x2f')][_0x7995('0x1e')]);}_0x229742['order']=qs['sort'](_0x47625f[_0x7995('0x2f')]['sort']);_0x229742['where']=qs[_0x7995('0x31')](_[_0x7995('0x36')](_0x47625f['query'],_0x49bc7e[_0x7995('0x31')]));if(_0x47625f[_0x7995('0x2f')][_0x7995('0x37')]){_0x229742[_0x7995('0x38')]=_[_0x7995('0x39')](_0x229742['where'],{'$or':_[_0x7995('0x2a')](_0x132a42,function(_0x242713){if(_0x242713[_0x7995('0x2d')]!==_0x7995('0x3a')){var _0x4b1541={};_0x4b1541[_0x242713[_0x7995('0x28')]]={'$like':'%'+_0x47625f[_0x7995('0x2f')][_0x7995('0x37')]+'%'};return _0x4b1541;}})});}_0x229742=_[_0x7995('0x39')]({},_0x229742,_0x47625f[_0x7995('0x3b')]);var _0x1035dc={'where':_0x229742['where']};return db[_0x7995('0x3c')][_0x7995('0x3d')](_0x1035dc)[_0x7995('0x24')](function(_0x2ea47f){_0xf16cc2[_0x7995('0x3d')]=_0x2ea47f;if(_0x47625f[_0x7995('0x2f')][_0x7995('0x3e')]){_0x229742[_0x7995('0x3f')]=[{'all':!![]}];}return db[_0x7995('0x3c')][_0x7995('0x40')](_0x229742);})[_0x7995('0x24')](function(_0x270d52){_0xf16cc2[_0x7995('0x41')]=_0x270d52;return _0xf16cc2;})['then'](respondWithFilteredResult(_0x5911c3,_0x229742))['catch'](handleError(_0x5911c3,null));};exports[_0x7995('0x42')]=function(_0x7325e8,_0x58523e){var _0x4b0855={'raw':!![],'where':{'id':_0x7325e8['params']['id']}},_0x3f8522={};_0x3f8522['model']=_[_0x7995('0x30')](db[_0x7995('0x3c')][_0x7995('0x2b')]);_0x3f8522['query']=_[_0x7995('0x30')](_0x7325e8['query']);_0x3f8522[_0x7995('0x31')]=_['intersection'](_0x3f8522['model'],_0x3f8522[_0x7995('0x2f')]);_0x4b0855[_0x7995('0x35')]=_[_0x7995('0x32')](_0x3f8522[_0x7995('0x33')],qs['fields'](_0x7325e8[_0x7995('0x2f')][_0x7995('0x34')]));_0x4b0855[_0x7995('0x35')]=_0x4b0855[_0x7995('0x35')]['length']?_0x4b0855['attributes']:_0x3f8522[_0x7995('0x33')];if(_0x7325e8['query'][_0x7995('0x3e')]){_0x4b0855['include']=[{'all':!![]}];}_0x4b0855=_[_0x7995('0x39')]({},_0x4b0855,_0x7325e8['options']);return db[_0x7995('0x3c')][_0x7995('0x43')](_0x4b0855)['then'](handleEntityNotFound(_0x58523e,null))[_0x7995('0x24')](respondWithResult(_0x58523e,null))[_0x7995('0x44')](handleError(_0x58523e,null));};exports[_0x7995('0x45')]=function(_0xb70a51,_0x4c6837){return db[_0x7995('0x3c')][_0x7995('0x45')](_0xb70a51[_0x7995('0x46')],{})['then'](respondWithResult(_0x4c6837,0xc9))[_0x7995('0x44')](handleError(_0x4c6837,null));};exports[_0x7995('0x47')]=function(_0x511567,_0x3d8ae3){if(_0x511567[_0x7995('0x46')]['id']){delete _0x511567['body']['id'];}return db[_0x7995('0x3c')][_0x7995('0x43')]({'where':{'id':_0x511567['params']['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x3d8ae3,null))['then'](saveUpdates(_0x511567[_0x7995('0x46')],null))[_0x7995('0x24')](respondWithResult(_0x3d8ae3,null))[_0x7995('0x44')](handleError(_0x3d8ae3,null));};exports[_0x7995('0x25')]=function(_0xddf537,_0x14b537){return db[_0x7995('0x3c')]['find']({'where':{'id':_0xddf537[_0x7995('0x48')]['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x14b537,null))[_0x7995('0x24')](removeEntity(_0x14b537,null))['catch'](handleError(_0x14b537,null));};exports[_0x7995('0x49')]=function(_0x1fe77e,_0x12d4b8){return db['MailTransferReport']['describe']()['then'](respondWithResult(_0x12d4b8,null))[_0x7995('0x44')](handleError(_0x12d4b8,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index e759ab3..fa258dd 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 _0x750e=['path','rimraf','./mailTransferReport.attributes','exports','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xa3633f,_0x19efea){var _0x559e56=function(_0xa2c057){while(--_0xa2c057){_0xa3633f['push'](_0xa3633f['shift']());}};_0x559e56(++_0x19efea);}(_0x750e,0x19c));var _0xe750=function(_0x58d602,_0x46c372){_0x58d602=_0x58d602-0x0;var _0x3cd64e=_0x750e[_0x58d602];return _0x3cd64e;};'use strict';var _=require(_0xe750('0x0'));var util=require(_0xe750('0x1'));var logger=require(_0xe750('0x2'))(_0xe750('0x3'));var moment=require(_0xe750('0x4'));var BPromise=require(_0xe750('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe750('0x6'));var rimraf=require(_0xe750('0x7'));var config=require('../../config/environment');var attributes=require(_0xe750('0x8'));module[_0xe750('0x9')]=function(_0x6cce81,_0x38e274){return _0x6cce81['define']('MailTransferReport',attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0xe750('0xa'),'fields':[_0xe750('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe97d=['bluebird','request-promise','path','rimraf','./mailTransferReport.attributes','exports','define','MailTransferReport','uniqueid','util','api','moment'];(function(_0x1597e2,_0x388d3e){var _0x4c8c0a=function(_0x3d4795){while(--_0x3d4795){_0x1597e2['push'](_0x1597e2['shift']());}};_0x4c8c0a(++_0x388d3e);}(_0xe97d,0xf9));var _0xde97=function(_0x28a03c,_0x123a4a){_0x28a03c=_0x28a03c-0x0;var _0x4bbb1e=_0xe97d[_0x28a03c];return _0x4bbb1e;};'use strict';var _=require('lodash');var util=require(_0xde97('0x0'));var logger=require('../../config/logger')(_0xde97('0x1'));var moment=require(_0xde97('0x2'));var BPromise=require(_0xde97('0x3'));var rp=require(_0xde97('0x4'));var fs=require('fs');var path=require(_0xde97('0x5'));var rimraf=require(_0xde97('0x6'));var config=require('../../config/environment');var attributes=require(_0xde97('0x7'));module[_0xde97('0x8')]=function(_0x4f6204,_0x446e28){return _0x4f6204[_0xde97('0x9')](_0xde97('0xa'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0xde97('0xb'),'fields':[_0xde97('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 4eb7be2..32bd915 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 _0x7bf4=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x7bf4,0x1ca));var _0x47bf=function(_0x13b16a,_0x1139ce){_0x13b16a=_0x13b16a-0x0;var _0x2b940f=_0x7bf4[_0x13b16a];return _0x2b940f;};'use strict';var _=require(_0x47bf('0x0'));var util=require('util');var moment=require(_0x47bf('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x47bf('0x2'))['db'];var utils=require(_0x47bf('0x3'));var logger=require('../../config/logger')(_0x47bf('0x4'));var config=require(_0x47bf('0x5'));var jayson=require(_0x47bf('0x6'));var client=jayson['client'][_0x47bf('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x473232,_0x58b050,_0x3df3d3){return new BPromise(function(_0x1dd4e8,_0x486bea){return client[_0x47bf('0x8')](_0x473232,_0x3df3d3)[_0x47bf('0x9')](function(_0x43b8f7){logger[_0x47bf('0xa')](_0x47bf('0xb'),_0x58b050,_0x47bf('0xc'));logger[_0x47bf('0xd')](_0x47bf('0xe'),_0x58b050,_0x47bf('0xc'),JSON[_0x47bf('0xf')](_0x43b8f7));if(_0x43b8f7['error']){if(_0x43b8f7['error']['code']===0x1f4){logger[_0x47bf('0x10')]('MailTransferReport,\x20%s,\x20%s',_0x58b050,_0x43b8f7[_0x47bf('0x10')][_0x47bf('0x11')]);return _0x486bea(_0x43b8f7[_0x47bf('0x10')]['message']);}logger['error'](_0x47bf('0xb'),_0x58b050,_0x43b8f7[_0x47bf('0x10')][_0x47bf('0x11')]);return _0x1dd4e8(_0x43b8f7[_0x47bf('0x10')][_0x47bf('0x11')]);}else{logger[_0x47bf('0xa')](_0x47bf('0xb'),_0x58b050,'request\x20sent');_0x1dd4e8(_0x43b8f7[_0x47bf('0x12')]['message']);}})[_0x47bf('0x13')](function(_0x3af88d){logger[_0x47bf('0x10')]('MailTransferReport,\x20%s,\x20%s',_0x58b050,_0x3af88d);_0x486bea(_0x3af88d);});});} \ No newline at end of file +var _0x5e0e=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','MailTransferReport,\x20%s,\x20%s','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','util','bluebird'];(function(_0x403da7,_0x4f9a77){var _0x21876e=function(_0x356b3f){while(--_0x356b3f){_0x403da7['push'](_0x403da7['shift']());}};_0x21876e(++_0x4f9a77);}(_0x5e0e,0xda));var _0xe5e0=function(_0x1c1577,_0x1d4d6d){_0x1c1577=_0x1c1577-0x0;var _0x566d1f=_0x5e0e[_0x1c1577];return _0x566d1f;};'use strict';var _=require('lodash');var util=require(_0xe5e0('0x0'));var moment=require('moment');var BPromise=require(_0xe5e0('0x1'));var rs=require(_0xe5e0('0x2'));var fs=require('fs');var Redis=require(_0xe5e0('0x3'));var db=require(_0xe5e0('0x4'))['db'];var utils=require(_0xe5e0('0x5'));var logger=require('../../config/logger')(_0xe5e0('0x6'));var config=require(_0xe5e0('0x7'));var jayson=require(_0xe5e0('0x8'));var client=jayson[_0xe5e0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x279f7a,_0x2ae4f3,_0x50bbce){return new BPromise(function(_0x5d1dd0,_0x5066cd){return client[_0xe5e0('0xa')](_0x279f7a,_0x50bbce)[_0xe5e0('0xb')](function(_0xc2c75){logger[_0xe5e0('0xc')](_0xe5e0('0xd'),_0x2ae4f3,'request\x20sent');logger[_0xe5e0('0xe')](_0xe5e0('0xf'),_0x2ae4f3,_0xe5e0('0x10'),JSON['stringify'](_0xc2c75));if(_0xc2c75[_0xe5e0('0x11')]){if(_0xc2c75[_0xe5e0('0x11')][_0xe5e0('0x12')]===0x1f4){logger['error'](_0xe5e0('0xd'),_0x2ae4f3,_0xc2c75[_0xe5e0('0x11')][_0xe5e0('0x13')]);return _0x5066cd(_0xc2c75[_0xe5e0('0x11')][_0xe5e0('0x13')]);}logger['error'](_0xe5e0('0xd'),_0x2ae4f3,_0xc2c75['error']['message']);return _0x5d1dd0(_0xc2c75[_0xe5e0('0x11')][_0xe5e0('0x13')]);}else{logger[_0xe5e0('0xc')](_0xe5e0('0xd'),_0x2ae4f3,_0xe5e0('0x10'));_0x5d1dd0(_0xc2c75['result'][_0xe5e0('0x13')]);}})['catch'](function(_0x4225ff){logger[_0xe5e0('0x11')](_0xe5e0('0xd'),_0x2ae4f3,_0x4225ff);_0x5066cd(_0x4225ff);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 27e946e..fdca2e0 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 _0xe12a=['update','delete','destroy','exports','multer','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','/describe','describe','post','put','/:id'];(function(_0x1bec9e,_0x168154){var _0x50e54d=function(_0x2b4c45){while(--_0x2b4c45){_0x1bec9e['push'](_0x1bec9e['shift']());}};_0x50e54d(++_0x168154);}(_0xe12a,0x16d));var _0xae12=function(_0x40317d,_0x5811e2){_0x40317d=_0x40317d-0x0;var _0x51f0ea=_0xe12a[_0x40317d];return _0x51f0ea;};'use strict';var multer=require(_0xae12('0x0'));var util=require('util');var path=require(_0xae12('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xae12('0x2')]();var auth=require(_0xae12('0x3'));var interaction=require(_0xae12('0x4'));var config=require(_0xae12('0x5'));var controller=require(_0xae12('0x6'));router[_0xae12('0x7')]('/',auth[_0xae12('0x8')](),controller[_0xae12('0x9')]);router[_0xae12('0x7')](_0xae12('0xa'),auth[_0xae12('0x8')](),controller[_0xae12('0xb')]);router[_0xae12('0x7')]('/:id',auth[_0xae12('0x8')](),controller['show']);router[_0xae12('0xc')]('/',auth[_0xae12('0x8')](),controller['create']);router[_0xae12('0xd')](_0xae12('0xe'),auth['isAuthenticated'](),controller[_0xae12('0xf')]);router[_0xae12('0x10')](_0xae12('0xe'),auth['isAuthenticated'](),controller[_0xae12('0x11')]);module[_0xae12('0x12')]=router; \ No newline at end of file +var _0xb4b7=['describe','/:id','show','post','create','destroy','exports','multer','util','path','connect-timeout','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','/describe'];(function(_0x4d6979,_0x1bbaf8){var _0x3e4455=function(_0x169199){while(--_0x169199){_0x4d6979['push'](_0x4d6979['shift']());}};_0x3e4455(++_0x1bbaf8);}(_0xb4b7,0x19f));var _0x7b4b=function(_0x26d8b9,_0x1ccdf6){_0x26d8b9=_0x26d8b9-0x0;var _0x281455=_0xb4b7[_0x26d8b9];return _0x281455;};'use strict';var multer=require(_0x7b4b('0x0'));var util=require(_0x7b4b('0x1'));var path=require(_0x7b4b('0x2'));var timeout=require(_0x7b4b('0x3'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x7b4b('0x4'));var config=require(_0x7b4b('0x5'));var controller=require(_0x7b4b('0x6'));router[_0x7b4b('0x7')]('/',auth[_0x7b4b('0x8')](),controller['index']);router[_0x7b4b('0x7')](_0x7b4b('0x9'),auth['isAuthenticated'](),controller[_0x7b4b('0xa')]);router[_0x7b4b('0x7')](_0x7b4b('0xb'),auth[_0x7b4b('0x8')](),controller[_0x7b4b('0xc')]);router[_0x7b4b('0xd')]('/',auth[_0x7b4b('0x8')](),controller[_0x7b4b('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x7b4b('0xb'),auth[_0x7b4b('0x8')](),controller[_0x7b4b('0xf')]);module[_0x7b4b('0x10')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 5b9b1ab..87c8280 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 _0x418a=['talk:[dial\x20string]','talk:[queue]','INTEGER','moment','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','DATE','getDataValue','enterAt','diff','seconds','setDataValue','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]'];(function(_0x152bf2,_0x57e325){var _0x2d6a46=function(_0x7ca135){while(--_0x7ca135){_0x152bf2['push'](_0x152bf2['shift']());}};_0x2d6a46(++_0x57e325);}(_0x418a,0x1c3));var _0xa418=function(_0x393c64,_0x390735){_0x393c64=_0x393c64-0x0;var _0xb13515=_0x418a[_0x393c64];return _0xb13515;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xa418('0x0'));module['exports']={'channel':{'type':Sequelize[_0xa418('0x1')]},'membername':{'type':Sequelize[_0xa418('0x1')]},'interface':{'type':Sequelize[_0xa418('0x1')]},'type':{'type':Sequelize[_0xa418('0x1')],'defaultValue':_0xa418('0x2'),'comment':_0xa418('0x3')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0xa418('0x4')]},'exitAt':{'type':Sequelize[_0xa418('0x4')],'set':function(_0x5096c8){var _0x5cfbc8=moment(_0x5096c8);var _0xdc2bae=moment(this[_0xa418('0x5')](_0xa418('0x6')));var _0x36811a=_0x5cfbc8[_0xa418('0x7')](_0xdc2bae,_0xa418('0x8'));this[_0xa418('0x9')]('exitAt',_0x5096c8);this[_0xa418('0x9')]('duration',_0x36811a||null);}},'data1':{'type':Sequelize[_0xa418('0x1')],'comment':_0xa418('0xa')},'data2':{'type':Sequelize[_0xa418('0x1')],'comment':_0xa418('0xb')},'data3':{'type':Sequelize[_0xa418('0x1')],'comment':_0xa418('0xc')},'data4':{'type':Sequelize['STRING'],'comment':_0xa418('0xd')},'data5':{'type':Sequelize[_0xa418('0x1')],'comment':_0xa418('0xe')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0xa418('0xf')]},'uniqueid':{'type':Sequelize[_0xa418('0x1')]}}; \ No newline at end of file +var _0x0397=['LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','moment','exports','STRING','DEFAULT\x20PAUSE'];(function(_0x1ecb71,_0x370253){var _0x402229=function(_0x25796a){while(--_0x25796a){_0x1ecb71['push'](_0x1ecb71['shift']());}};_0x402229(++_0x370253);}(_0x0397,0x13f));var _0x7039=function(_0x240261,_0x4fe66c){_0x240261=_0x240261-0x0;var _0x45c332=_0x0397[_0x240261];return _0x45c332;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x7039('0x0'));module[_0x7039('0x1')]={'channel':{'type':Sequelize[_0x7039('0x2')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x7039('0x2')]},'type':{'type':Sequelize[_0x7039('0x2')],'defaultValue':_0x7039('0x3'),'comment':_0x7039('0x4')},'duration':{'type':Sequelize[_0x7039('0x5')]},'enterAt':{'type':Sequelize[_0x7039('0x6')]},'exitAt':{'type':Sequelize[_0x7039('0x6')],'set':function(_0x58b31e){var _0x31285b=moment(_0x58b31e);var _0x5b4ae5=moment(this[_0x7039('0x7')](_0x7039('0x8')));var _0x287cbc=_0x31285b[_0x7039('0x9')](_0x5b4ae5,_0x7039('0xa'));this[_0x7039('0xb')](_0x7039('0xc'),_0x58b31e);this['setDataValue'](_0x7039('0xd'),_0x287cbc||null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x7039('0xe')},'data2':{'type':Sequelize[_0x7039('0x2')],'comment':_0x7039('0xf')},'data3':{'type':Sequelize['STRING'],'comment':_0x7039('0x10')},'data4':{'type':Sequelize[_0x7039('0x2')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x7039('0x2')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0x7039('0x2')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x7039('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 8b86256..4ce531f 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 _0x5c2e=['fields','length','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','options','count','includeAll','include','findAll','show','params','keys','catch','create','body','find','describe','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','MemberReport','rawAttributes','key','model','filters','intersection','query','attributes'];(function(_0x39cab2,_0x5a94dd){var _0xb11150=function(_0x2499c1){while(--_0x2499c1){_0x39cab2['push'](_0x39cab2['shift']());}};_0xb11150(++_0x5a94dd);}(_0x5c2e,0xf5));var _0xe5c2=function(_0x3cb30b,_0x504b3e){_0x3cb30b=_0x3cb30b-0x0;var _0x2ca717=_0x5c2e[_0x3cb30b];return _0x2ca717;};'use strict';var pdf=require(_0xe5c2('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe5c2('0x1'));var zipdir=require(_0xe5c2('0x2'));var jsonpatch=require(_0xe5c2('0x3'));var rp=require('request-promise');var moment=require(_0xe5c2('0x4'));var BPromise=require(_0xe5c2('0x5'));var Mustache=require(_0xe5c2('0x6'));var util=require(_0xe5c2('0x7'));var path=require(_0xe5c2('0x8'));var sox=require(_0xe5c2('0x9'));var csv=require(_0xe5c2('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe5c2('0xb'));var squel=require('squel');var crypto=require(_0xe5c2('0xc'));var jsforce=require(_0xe5c2('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe5c2('0xa'));var querystring=require(_0xe5c2('0xe'));var Papa=require('papaparse');var Redis=require(_0xe5c2('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe5c2('0x10'));var as=require(_0xe5c2('0x11'));var hardwareService=require(_0xe5c2('0x12'));var logger=require(_0xe5c2('0x13'))(_0xe5c2('0x14'));var utils=require(_0xe5c2('0x15'));var config=require('../../config/environment');var db=require(_0xe5c2('0x16'))['db'];function respondWithStatusCode(_0x418511,_0x181553){_0x181553=_0x181553||0xcc;return function(_0x3027b5){if(_0x3027b5){return _0x418511['sendStatus'](_0x181553);}return _0x418511[_0xe5c2('0x17')](_0x181553)[_0xe5c2('0x18')]();};}function respondWithResult(_0x3b3412,_0x1d822b){_0x1d822b=_0x1d822b||0xc8;return function(_0x3860a5){if(_0x3860a5){return _0x3b3412[_0xe5c2('0x17')](_0x1d822b)['json'](_0x3860a5);}};}function respondWithFilteredResult(_0x3d47ef,_0x4dfb55){return function(_0x493da0){if(_0x493da0){var _0x3a3ec5=_0x493da0['count'],_0x1b4c2d=_0x4dfb55['offset'],_0x50e04f=_0x4dfb55[_0xe5c2('0x19')]+_0x4dfb55[_0xe5c2('0x1a')],_0xf1fa8f;if(_0x50e04f>=_0x3a3ec5){_0x50e04f=_0x3a3ec5;_0xf1fa8f=0xc8;}else{_0xf1fa8f=0xce;}_0x3d47ef[_0xe5c2('0x17')](_0xf1fa8f);return _0x3d47ef[_0xe5c2('0x1b')](_0xe5c2('0x1c'),_0x1b4c2d+'-'+_0x50e04f+'/'+_0x3a3ec5)[_0xe5c2('0x1d')](_0x493da0);}return null;};}function patchUpdates(_0x30fb55){return function(_0x109ad0){try{jsonpatch[_0xe5c2('0x1e')](_0x109ad0,_0x30fb55,!![]);}catch(_0x4d765c){return BPromise[_0xe5c2('0x1f')](_0x4d765c);}return _0x109ad0[_0xe5c2('0x20')]();};}function saveUpdates(_0x416782,_0x585acd){return function(_0x24a323){if(_0x24a323){return _0x24a323[_0xe5c2('0x21')](_0x416782)[_0xe5c2('0x22')](function(_0x1b08e1){return _0x1b08e1;});}return null;};}function removeEntity(_0x506205,_0x35b126){return function(_0x4ee9e9){if(_0x4ee9e9){return _0x4ee9e9[_0xe5c2('0x23')]()[_0xe5c2('0x22')](function(){_0x506205['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x25ae20,_0x3a0eea){return function(_0x5ba5b6){if(!_0x5ba5b6){_0x25ae20[_0xe5c2('0x24')](0x194);}return _0x5ba5b6;};}function handleError(_0x418d01,_0xc2c09e){_0xc2c09e=_0xc2c09e||0x1f4;return function(_0x5ed6fb){logger[_0xe5c2('0x25')](_0x5ed6fb[_0xe5c2('0x26')]);if(_0x5ed6fb[_0xe5c2('0x27')]){delete _0x5ed6fb['name'];}_0x418d01[_0xe5c2('0x17')](_0xc2c09e)[_0xe5c2('0x28')](_0x5ed6fb);};}exports[_0xe5c2('0x29')]=function(_0x20b7a1,_0x3f88af){var _0x1891f={},_0x54f911={},_0x4d44c6={'count':0x0,'rows':[]};var _0x3b25a3=_[_0xe5c2('0x2a')](db[_0xe5c2('0x2b')][_0xe5c2('0x2c')],function(_0x2fa0af){return{'name':_0x2fa0af['fieldName'],'type':_0x2fa0af['type'][_0xe5c2('0x2d')]};});_0x54f911[_0xe5c2('0x2e')]=_[_0xe5c2('0x2a')](_0x3b25a3,_0xe5c2('0x27'));_0x54f911['query']=_['keys'](_0x20b7a1['query']);_0x54f911[_0xe5c2('0x2f')]=_[_0xe5c2('0x30')](_0x54f911[_0xe5c2('0x2e')],_0x54f911[_0xe5c2('0x31')]);_0x1891f[_0xe5c2('0x32')]=_[_0xe5c2('0x30')](_0x54f911[_0xe5c2('0x2e')],qs[_0xe5c2('0x33')](_0x20b7a1[_0xe5c2('0x31')][_0xe5c2('0x33')]));_0x1891f['attributes']=_0x1891f[_0xe5c2('0x32')][_0xe5c2('0x34')]?_0x1891f[_0xe5c2('0x32')]:_0x54f911[_0xe5c2('0x2e')];if(!_0x20b7a1[_0xe5c2('0x31')][_0xe5c2('0x35')]('nolimit')){_0x1891f[_0xe5c2('0x1a')]=qs[_0xe5c2('0x1a')](_0x20b7a1['query'][_0xe5c2('0x1a')]);_0x1891f['offset']=qs[_0xe5c2('0x19')](_0x20b7a1[_0xe5c2('0x31')][_0xe5c2('0x19')]);}_0x1891f[_0xe5c2('0x36')]=qs['sort'](_0x20b7a1[_0xe5c2('0x31')][_0xe5c2('0x37')]);_0x1891f[_0xe5c2('0x38')]=qs['filters'](_['pick'](_0x20b7a1['query'],_0x54f911[_0xe5c2('0x2f')]));if(_0x20b7a1[_0xe5c2('0x31')][_0xe5c2('0x39')]){_0x1891f[_0xe5c2('0x38')]=_[_0xe5c2('0x3a')](_0x1891f[_0xe5c2('0x38')],{'$or':_[_0xe5c2('0x2a')](_0x3b25a3,function(_0x4cb8e4){if(_0x4cb8e4[_0xe5c2('0x3b')]!==_0xe5c2('0x3c')){var _0x54ba57={};_0x54ba57[_0x4cb8e4[_0xe5c2('0x27')]]={'$like':'%'+_0x20b7a1[_0xe5c2('0x31')][_0xe5c2('0x39')]+'%'};return _0x54ba57;}})});}_0x1891f=_[_0xe5c2('0x3a')]({},_0x1891f,_0x20b7a1[_0xe5c2('0x3d')]);var _0x1ac722={'where':_0x1891f[_0xe5c2('0x38')]};return db['MemberReport'][_0xe5c2('0x3e')](_0x1ac722)[_0xe5c2('0x22')](function(_0x2d244f){_0x4d44c6[_0xe5c2('0x3e')]=_0x2d244f;if(_0x20b7a1[_0xe5c2('0x31')][_0xe5c2('0x3f')]){_0x1891f[_0xe5c2('0x40')]=[{'all':!![]}];}return db['MemberReport'][_0xe5c2('0x41')](_0x1891f);})[_0xe5c2('0x22')](function(_0x4498b2){_0x4d44c6['rows']=_0x4498b2;return _0x4d44c6;})[_0xe5c2('0x22')](respondWithFilteredResult(_0x3f88af,_0x1891f))['catch'](handleError(_0x3f88af,null));};exports[_0xe5c2('0x42')]=function(_0x1d68c5,_0x15e300){var _0x5eb82d={'raw':!![],'where':{'id':_0x1d68c5[_0xe5c2('0x43')]['id']}},_0xfba20f={};_0xfba20f[_0xe5c2('0x2e')]=_['keys'](db[_0xe5c2('0x2b')][_0xe5c2('0x2c')]);_0xfba20f[_0xe5c2('0x31')]=_[_0xe5c2('0x44')](_0x1d68c5[_0xe5c2('0x31')]);_0xfba20f[_0xe5c2('0x2f')]=_['intersection'](_0xfba20f[_0xe5c2('0x2e')],_0xfba20f['query']);_0x5eb82d['attributes']=_[_0xe5c2('0x30')](_0xfba20f[_0xe5c2('0x2e')],qs[_0xe5c2('0x33')](_0x1d68c5[_0xe5c2('0x31')][_0xe5c2('0x33')]));_0x5eb82d['attributes']=_0x5eb82d[_0xe5c2('0x32')][_0xe5c2('0x34')]?_0x5eb82d[_0xe5c2('0x32')]:_0xfba20f[_0xe5c2('0x2e')];if(_0x1d68c5[_0xe5c2('0x31')][_0xe5c2('0x3f')]){_0x5eb82d[_0xe5c2('0x40')]=[{'all':!![]}];}_0x5eb82d=_[_0xe5c2('0x3a')]({},_0x5eb82d,_0x1d68c5[_0xe5c2('0x3d')]);return db['MemberReport']['find'](_0x5eb82d)[_0xe5c2('0x22')](handleEntityNotFound(_0x15e300,null))[_0xe5c2('0x22')](respondWithResult(_0x15e300,null))[_0xe5c2('0x45')](handleError(_0x15e300,null));};exports[_0xe5c2('0x46')]=function(_0x3fe2ed,_0x147e67){return db['MemberReport'][_0xe5c2('0x46')](_0x3fe2ed[_0xe5c2('0x47')],{})[_0xe5c2('0x22')](respondWithResult(_0x147e67,0xc9))[_0xe5c2('0x45')](handleError(_0x147e67,null));};exports[_0xe5c2('0x21')]=function(_0xc518ff,_0x51e9d3){if(_0xc518ff[_0xe5c2('0x47')]['id']){delete _0xc518ff[_0xe5c2('0x47')]['id'];}return db[_0xe5c2('0x2b')][_0xe5c2('0x48')]({'where':{'id':_0xc518ff[_0xe5c2('0x43')]['id']}})[_0xe5c2('0x22')](handleEntityNotFound(_0x51e9d3,null))['then'](saveUpdates(_0xc518ff[_0xe5c2('0x47')],null))['then'](respondWithResult(_0x51e9d3,null))[_0xe5c2('0x45')](handleError(_0x51e9d3,null));};exports[_0xe5c2('0x23')]=function(_0x59bb13,_0x299a00){return db[_0xe5c2('0x2b')][_0xe5c2('0x48')]({'where':{'id':_0x59bb13['params']['id']}})[_0xe5c2('0x22')](handleEntityNotFound(_0x299a00,null))[_0xe5c2('0x22')](removeEntity(_0x299a00,null))[_0xe5c2('0x45')](handleError(_0x299a00,null));};exports[_0xe5c2('0x49')]=function(_0x1a64eb,_0x58df07){return db['MemberReport'][_0xe5c2('0x49')]()[_0xe5c2('0x22')](respondWithResult(_0x58df07,null))[_0xe5c2('0x45')](handleError(_0x58df07,null));}; \ No newline at end of file +var _0x9e46=['model','query','keys','filters','intersection','attributes','fields','length','order','sort','pick','where','type','VIRTUAL','options','then','includeAll','include','findAll','show','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','destroy','error','stack','name','send','index','map','MemberReport','rawAttributes','fieldName','key'];(function(_0x26d51f,_0x1de895){var _0x48305d=function(_0x13652a){while(--_0x13652a){_0x26d51f['push'](_0x26d51f['shift']());}};_0x48305d(++_0x1de895);}(_0x9e46,0xf1));var _0x69e4=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9e46[_0x618414];return _0x21c19a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x69e4('0x0'));var rimraf=require(_0x69e4('0x1'));var zipdir=require(_0x69e4('0x2'));var jsonpatch=require(_0x69e4('0x3'));var rp=require(_0x69e4('0x4'));var moment=require('moment');var BPromise=require(_0x69e4('0x5'));var Mustache=require(_0x69e4('0x6'));var util=require('util');var path=require(_0x69e4('0x7'));var sox=require(_0x69e4('0x8'));var csv=require(_0x69e4('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x69e4('0xa'));var squel=require(_0x69e4('0xb'));var crypto=require(_0x69e4('0xc'));var jsforce=require(_0x69e4('0xd'));var deskjs=require(_0x69e4('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x69e4('0xf'));var Redis=require(_0x69e4('0x10'));var authService=require(_0x69e4('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x69e4('0x12'));var hardwareService=require(_0x69e4('0x13'));var logger=require(_0x69e4('0x14'))(_0x69e4('0x15'));var utils=require(_0x69e4('0x16'));var config=require('../../config/environment');var db=require(_0x69e4('0x17'))['db'];function respondWithStatusCode(_0x443963,_0x27cdfa){_0x27cdfa=_0x27cdfa||0xcc;return function(_0x1a3891){if(_0x1a3891){return _0x443963[_0x69e4('0x18')](_0x27cdfa);}return _0x443963[_0x69e4('0x19')](_0x27cdfa)[_0x69e4('0x1a')]();};}function respondWithResult(_0xeea9a5,_0x25d483){_0x25d483=_0x25d483||0xc8;return function(_0x133897){if(_0x133897){return _0xeea9a5[_0x69e4('0x19')](_0x25d483)[_0x69e4('0x1b')](_0x133897);}};}function respondWithFilteredResult(_0x245122,_0x31b5f1){return function(_0x546b91){if(_0x546b91){var _0x18ddee=_0x546b91[_0x69e4('0x1c')],_0x4a4f7b=_0x31b5f1[_0x69e4('0x1d')],_0x27c86b=_0x31b5f1['offset']+_0x31b5f1[_0x69e4('0x1e')],_0x2605eb;if(_0x27c86b>=_0x18ddee){_0x27c86b=_0x18ddee;_0x2605eb=0xc8;}else{_0x2605eb=0xce;}_0x245122[_0x69e4('0x19')](_0x2605eb);return _0x245122[_0x69e4('0x1f')]('Content-Range',_0x4a4f7b+'-'+_0x27c86b+'/'+_0x18ddee)[_0x69e4('0x1b')](_0x546b91);}return null;};}function patchUpdates(_0x124252){return function(_0x365e2a){try{jsonpatch[_0x69e4('0x20')](_0x365e2a,_0x124252,!![]);}catch(_0x141667){return BPromise[_0x69e4('0x21')](_0x141667);}return _0x365e2a[_0x69e4('0x22')]();};}function saveUpdates(_0x4d76ea,_0x14e597){return function(_0x2c6e3b){if(_0x2c6e3b){return _0x2c6e3b[_0x69e4('0x23')](_0x4d76ea)['then'](function(_0x195113){return _0x195113;});}return null;};}function removeEntity(_0x743dc,_0x382866){return function(_0x4f81fa){if(_0x4f81fa){return _0x4f81fa[_0x69e4('0x24')]()['then'](function(){_0x743dc['status'](0xcc)[_0x69e4('0x1a')]();});}};}function handleEntityNotFound(_0x45166b,_0x277941){return function(_0x2109d2){if(!_0x2109d2){_0x45166b[_0x69e4('0x18')](0x194);}return _0x2109d2;};}function handleError(_0x17733a,_0x3fb4a1){_0x3fb4a1=_0x3fb4a1||0x1f4;return function(_0x443c02){logger[_0x69e4('0x25')](_0x443c02[_0x69e4('0x26')]);if(_0x443c02['name']){delete _0x443c02[_0x69e4('0x27')];}_0x17733a[_0x69e4('0x19')](_0x3fb4a1)[_0x69e4('0x28')](_0x443c02);};}exports[_0x69e4('0x29')]=function(_0x52afcb,_0x4db0d9){var _0x2d7dd8={},_0x2c1f87={},_0x224fad={'count':0x0,'rows':[]};var _0x471759=_[_0x69e4('0x2a')](db[_0x69e4('0x2b')][_0x69e4('0x2c')],function(_0x1776c9){return{'name':_0x1776c9[_0x69e4('0x2d')],'type':_0x1776c9['type'][_0x69e4('0x2e')]};});_0x2c1f87[_0x69e4('0x2f')]=_['map'](_0x471759,_0x69e4('0x27'));_0x2c1f87[_0x69e4('0x30')]=_[_0x69e4('0x31')](_0x52afcb[_0x69e4('0x30')]);_0x2c1f87[_0x69e4('0x32')]=_[_0x69e4('0x33')](_0x2c1f87['model'],_0x2c1f87[_0x69e4('0x30')]);_0x2d7dd8[_0x69e4('0x34')]=_['intersection'](_0x2c1f87[_0x69e4('0x2f')],qs['fields'](_0x52afcb[_0x69e4('0x30')][_0x69e4('0x35')]));_0x2d7dd8[_0x69e4('0x34')]=_0x2d7dd8[_0x69e4('0x34')][_0x69e4('0x36')]?_0x2d7dd8[_0x69e4('0x34')]:_0x2c1f87[_0x69e4('0x2f')];if(!_0x52afcb[_0x69e4('0x30')]['hasOwnProperty']('nolimit')){_0x2d7dd8[_0x69e4('0x1e')]=qs['limit'](_0x52afcb[_0x69e4('0x30')]['limit']);_0x2d7dd8['offset']=qs[_0x69e4('0x1d')](_0x52afcb[_0x69e4('0x30')][_0x69e4('0x1d')]);}_0x2d7dd8[_0x69e4('0x37')]=qs[_0x69e4('0x38')](_0x52afcb[_0x69e4('0x30')]['sort']);_0x2d7dd8['where']=qs[_0x69e4('0x32')](_[_0x69e4('0x39')](_0x52afcb['query'],_0x2c1f87[_0x69e4('0x32')]));if(_0x52afcb[_0x69e4('0x30')]['filter']){_0x2d7dd8[_0x69e4('0x3a')]=_['merge'](_0x2d7dd8['where'],{'$or':_[_0x69e4('0x2a')](_0x471759,function(_0x455e9d){if(_0x455e9d[_0x69e4('0x3b')]!==_0x69e4('0x3c')){var _0x17fafd={};_0x17fafd[_0x455e9d[_0x69e4('0x27')]]={'$like':'%'+_0x52afcb['query']['filter']+'%'};return _0x17fafd;}})});}_0x2d7dd8=_['merge']({},_0x2d7dd8,_0x52afcb[_0x69e4('0x3d')]);var _0x238249={'where':_0x2d7dd8[_0x69e4('0x3a')]};return db[_0x69e4('0x2b')][_0x69e4('0x1c')](_0x238249)[_0x69e4('0x3e')](function(_0xc5ae10){_0x224fad[_0x69e4('0x1c')]=_0xc5ae10;if(_0x52afcb[_0x69e4('0x30')][_0x69e4('0x3f')]){_0x2d7dd8[_0x69e4('0x40')]=[{'all':!![]}];}return db[_0x69e4('0x2b')][_0x69e4('0x41')](_0x2d7dd8);})['then'](function(_0x29519a){_0x224fad['rows']=_0x29519a;return _0x224fad;})['then'](respondWithFilteredResult(_0x4db0d9,_0x2d7dd8))['catch'](handleError(_0x4db0d9,null));};exports[_0x69e4('0x42')]=function(_0x24fc60,_0x5773e5){var _0x177714={'raw':!![],'where':{'id':_0x24fc60['params']['id']}},_0x254373={};_0x254373['model']=_[_0x69e4('0x31')](db[_0x69e4('0x2b')][_0x69e4('0x2c')]);_0x254373[_0x69e4('0x30')]=_[_0x69e4('0x31')](_0x24fc60['query']);_0x254373['filters']=_[_0x69e4('0x33')](_0x254373[_0x69e4('0x2f')],_0x254373[_0x69e4('0x30')]);_0x177714[_0x69e4('0x34')]=_[_0x69e4('0x33')](_0x254373['model'],qs[_0x69e4('0x35')](_0x24fc60[_0x69e4('0x30')]['fields']));_0x177714[_0x69e4('0x34')]=_0x177714['attributes']['length']?_0x177714['attributes']:_0x254373[_0x69e4('0x2f')];if(_0x24fc60[_0x69e4('0x30')][_0x69e4('0x3f')]){_0x177714['include']=[{'all':!![]}];}_0x177714=_['merge']({},_0x177714,_0x24fc60[_0x69e4('0x3d')]);return db[_0x69e4('0x2b')][_0x69e4('0x43')](_0x177714)['then'](handleEntityNotFound(_0x5773e5,null))[_0x69e4('0x3e')](respondWithResult(_0x5773e5,null))[_0x69e4('0x44')](handleError(_0x5773e5,null));};exports[_0x69e4('0x45')]=function(_0x5d805b,_0x57da82){return db[_0x69e4('0x2b')]['create'](_0x5d805b[_0x69e4('0x46')],{})['then'](respondWithResult(_0x57da82,0xc9))[_0x69e4('0x44')](handleError(_0x57da82,null));};exports[_0x69e4('0x23')]=function(_0x51b353,_0x40d4d5){if(_0x51b353['body']['id']){delete _0x51b353[_0x69e4('0x46')]['id'];}return db['MemberReport'][_0x69e4('0x43')]({'where':{'id':_0x51b353[_0x69e4('0x47')]['id']}})[_0x69e4('0x3e')](handleEntityNotFound(_0x40d4d5,null))[_0x69e4('0x3e')](saveUpdates(_0x51b353[_0x69e4('0x46')],null))[_0x69e4('0x3e')](respondWithResult(_0x40d4d5,null))[_0x69e4('0x44')](handleError(_0x40d4d5,null));};exports[_0x69e4('0x24')]=function(_0x21140f,_0x37ba95){return db[_0x69e4('0x2b')]['find']({'where':{'id':_0x21140f['params']['id']}})['then'](handleEntityNotFound(_0x37ba95,null))[_0x69e4('0x3e')](removeEntity(_0x37ba95,null))[_0x69e4('0x44')](handleError(_0x37ba95,null));};exports['describe']=function(_0x2fec06,_0x55e59d){return db[_0x69e4('0x2b')]['describe']()[_0x69e4('0x3e')](respondWithResult(_0x55e59d,null))[_0x69e4('0x44')](handleError(_0x55e59d,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 3196688..b9434b9 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 _0xd25e=['report_member','membername','interface','util','../../config/logger','bluebird','request-promise','path','rimraf','./memberReport.attributes','exports','define','MemberReport'];(function(_0x44454f,_0x4bfbe8){var _0x475150=function(_0x1cde13){while(--_0x1cde13){_0x44454f['push'](_0x44454f['shift']());}};_0x475150(++_0x4bfbe8);}(_0xd25e,0x107));var _0xed25=function(_0x250c6a,_0x5a5695){_0x250c6a=_0x250c6a-0x0;var _0x5bc16b=_0xd25e[_0x250c6a];return _0x5bc16b;};'use strict';var _=require('lodash');var util=require(_0xed25('0x0'));var logger=require(_0xed25('0x1'))('api');var moment=require('moment');var BPromise=require(_0xed25('0x2'));var rp=require(_0xed25('0x3'));var fs=require('fs');var path=require(_0xed25('0x4'));var rimraf=require(_0xed25('0x5'));var config=require('../../config/environment');var attributes=require(_0xed25('0x6'));module[_0xed25('0x7')]=function(_0x387bbc,_0x4badf9){return _0x387bbc[_0xed25('0x8')](_0xed25('0x9'),attributes,{'tableName':_0xed25('0xa'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0xed25('0xb'),_0xed25('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x67d1=['define','MemberReport','report_member','membername_interface','membername','interface','lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','./memberReport.attributes','exports'];(function(_0x3b6da0,_0x5a6da0){var _0x537720=function(_0x2b3a3a){while(--_0x2b3a3a){_0x3b6da0['push'](_0x3b6da0['shift']());}};_0x537720(++_0x5a6da0);}(_0x67d1,0x1d7));var _0x167d=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0x67d1[_0x3070dc];return _0x431489;};'use strict';var _=require(_0x167d('0x0'));var util=require(_0x167d('0x1'));var logger=require(_0x167d('0x2'))('api');var moment=require(_0x167d('0x3'));var BPromise=require(_0x167d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x167d('0x5'));var rimraf=require('rimraf');var config=require(_0x167d('0x6'));var attributes=require(_0x167d('0x7'));module[_0x167d('0x8')]=function(_0x183653,_0x30c8aa){return _0x183653[_0x167d('0x9')](_0x167d('0xa'),attributes,{'tableName':_0x167d('0xb'),'paranoid':![],'indexes':[{'name':_0x167d('0xc'),'fields':[_0x167d('0xd'),_0x167d('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 283661f..5997b0e 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 _0xa07a=['bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise','http','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','MemberReport','findAll','raw','options','where','attributes','limit','include','map','model','GetMemberReport','body','CreateMemberReport','UpdateMemberReport','update','lodash','util'];(function(_0x53fd37,_0x4e0999){var _0x425b34=function(_0x105f36){while(--_0x105f36){_0x53fd37['push'](_0x53fd37['shift']());}};_0x425b34(++_0x4e0999);}(_0xa07a,0xa8));var _0xaa07=function(_0x45ee95,_0x571576){_0x45ee95=_0x45ee95-0x0;var _0x2a9fbe=_0xa07a[_0x45ee95];return _0x2a9fbe;};'use strict';var _=require(_0xaa07('0x0'));var util=require(_0xaa07('0x1'));var moment=require('moment');var BPromise=require(_0xaa07('0x2'));var rs=require(_0xaa07('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xaa07('0x4'));var logger=require(_0xaa07('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xaa07('0x6'));var client=jayson['client'][_0xaa07('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5aa24b,_0x1ee202,_0x9b6049){return new BPromise(function(_0x25b63d,_0x427319){return client['request'](_0x5aa24b,_0x9b6049)[_0xaa07('0x8')](function(_0x203491){logger[_0xaa07('0x9')](_0xaa07('0xa'),_0x1ee202,_0xaa07('0xb'));logger[_0xaa07('0xc')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x1ee202,_0xaa07('0xb'),JSON[_0xaa07('0xd')](_0x203491));if(_0x203491[_0xaa07('0xe')]){if(_0x203491[_0xaa07('0xe')][_0xaa07('0xf')]===0x1f4){logger[_0xaa07('0xe')](_0xaa07('0xa'),_0x1ee202,_0x203491[_0xaa07('0xe')][_0xaa07('0x10')]);return _0x427319(_0x203491['error'][_0xaa07('0x10')]);}logger[_0xaa07('0xe')]('MemberReport,\x20%s,\x20%s',_0x1ee202,_0x203491[_0xaa07('0xe')]['message']);return _0x25b63d(_0x203491[_0xaa07('0xe')][_0xaa07('0x10')]);}else{logger[_0xaa07('0x9')](_0xaa07('0xa'),_0x1ee202,_0xaa07('0xb'));_0x25b63d(_0x203491[_0xaa07('0x11')][_0xaa07('0x10')]);}})[_0xaa07('0x12')](function(_0x3e423a){logger['error'](_0xaa07('0xa'),_0x1ee202,_0x3e423a);_0x427319(_0x3e423a);});});}exports['GetMemberReport']=function(_0x974b99){var _0x5ad6c9=this;return new Promise(function(_0x1ac9f9,_0x5501ae){return db[_0xaa07('0x13')][_0xaa07('0x14')]({'raw':_0x974b99['options']?_0x974b99['options'][_0xaa07('0x15')]===undefined?!![]:![]:!![],'where':_0x974b99[_0xaa07('0x16')]?_0x974b99[_0xaa07('0x16')][_0xaa07('0x17')]||null:null,'attributes':_0x974b99[_0xaa07('0x16')]?_0x974b99[_0xaa07('0x16')][_0xaa07('0x18')]||null:null,'limit':_0x974b99[_0xaa07('0x16')]?_0x974b99[_0xaa07('0x16')][_0xaa07('0x19')]||null:null,'include':_0x974b99[_0xaa07('0x16')]?_0x974b99['options'][_0xaa07('0x1a')]?_[_0xaa07('0x1b')](_0x974b99[_0xaa07('0x16')][_0xaa07('0x1a')],function(_0x43797b){return{'model':db[_0x43797b[_0xaa07('0x1c')]],'as':_0x43797b['as'],'attributes':_0x43797b[_0xaa07('0x18')],'include':_0x43797b[_0xaa07('0x1a')]?_[_0xaa07('0x1b')](_0x43797b[_0xaa07('0x1a')],function(_0x2230f7){return{'model':db[_0x2230f7['model']],'as':_0x2230f7['as'],'attributes':_0x2230f7['attributes'],'include':_0x2230f7['include']?_[_0xaa07('0x1b')](_0x2230f7[_0xaa07('0x1a')],function(_0x341c14){return{'model':db[_0x341c14[_0xaa07('0x1c')]],'as':_0x341c14['as'],'attributes':_0x341c14[_0xaa07('0x18')]};}):[]};}):[]};}):[]:[]})[_0xaa07('0x8')](function(_0xe87181){logger[_0xaa07('0x9')](_0xaa07('0x1d'),_0x974b99);logger[_0xaa07('0xc')](_0xaa07('0x1d'),_0x974b99,JSON[_0xaa07('0xd')](_0xe87181));_0x1ac9f9(_0xe87181);})[_0xaa07('0x12')](function(_0x51e94c){logger[_0xaa07('0xe')](_0xaa07('0x1d'),_0x51e94c[_0xaa07('0x10')],_0x974b99);_0x5501ae(_0x5ad6c9[_0xaa07('0xe')](0x1f4,_0x51e94c[_0xaa07('0x10')]));});});};exports['CreateMemberReport']=function(_0x2cd808){var _0x424e21=this;return new Promise(function(_0x5aa85f,_0x3be576){return db['MemberReport']['create'](_0x2cd808[_0xaa07('0x1e')],{'raw':_0x2cd808[_0xaa07('0x16')]?_0x2cd808[_0xaa07('0x16')][_0xaa07('0x15')]===undefined?!![]:![]:!![]})['then'](function(_0x4338ce){logger['info'](_0xaa07('0x1f'),_0x2cd808);logger['debug']('CreateMemberReport',_0x2cd808,JSON[_0xaa07('0xd')](_0x4338ce));_0x5aa85f(_0x4338ce);})[_0xaa07('0x12')](function(_0x47ad81){logger[_0xaa07('0xe')](_0xaa07('0x1f'),_0x47ad81['message'],_0x2cd808);_0x3be576(_0x424e21[_0xaa07('0xe')](0x1f4,_0x47ad81['message']));});});};exports[_0xaa07('0x20')]=function(_0xf6e88){var _0x278535=this;return new Promise(function(_0x1fa9a4,_0x819405){return db[_0xaa07('0x13')][_0xaa07('0x21')](_0xf6e88[_0xaa07('0x1e')],{'raw':_0xf6e88[_0xaa07('0x16')]?_0xf6e88[_0xaa07('0x16')][_0xaa07('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf6e88[_0xaa07('0x16')]?_0xf6e88[_0xaa07('0x16')]['where']||null:null,'attributes':_0xf6e88['options']?_0xf6e88[_0xaa07('0x16')]['attributes']||null:null,'limit':_0xf6e88['options']?_0xf6e88[_0xaa07('0x16')]['limit']||null:null})[_0xaa07('0x8')](function(_0x13ec1f){logger[_0xaa07('0x9')](_0xaa07('0x20'),_0xf6e88);logger[_0xaa07('0xc')](_0xaa07('0x20'),_0xf6e88,JSON[_0xaa07('0xd')](_0x13ec1f));_0x1fa9a4(_0x13ec1f);})[_0xaa07('0x12')](function(_0xcfb873){logger[_0xaa07('0xe')](_0xaa07('0x20'),_0xcfb873[_0xaa07('0x10')],_0xf6e88);_0x819405(_0x278535[_0xaa07('0xe')](0x1f4,_0xcfb873['message']));});});}; \ No newline at end of file +var _0xf8c8=['lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetMemberReport','MemberReport','findAll','options','raw','limit','include','map','model','attributes','body','CreateMemberReport','UpdateMemberReport','update','where'];(function(_0x4cb939,_0x2a70a6){var _0x4fc9de=function(_0x5c1335){while(--_0x5c1335){_0x4cb939['push'](_0x4cb939['shift']());}};_0x4fc9de(++_0x2a70a6);}(_0xf8c8,0x186));var _0x8f8c=function(_0x54af50,_0x505414){_0x54af50=_0x54af50-0x0;var _0x4f8a5f=_0xf8c8[_0x54af50];return _0x4f8a5f;};'use strict';var _=require(_0x8f8c('0x0'));var util=require(_0x8f8c('0x1'));var moment=require('moment');var BPromise=require(_0x8f8c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8f8c('0x3'));var db=require(_0x8f8c('0x4'))['db'];var utils=require(_0x8f8c('0x5'));var logger=require(_0x8f8c('0x6'))(_0x8f8c('0x7'));var config=require(_0x8f8c('0x8'));var jayson=require(_0x8f8c('0x9'));var client=jayson[_0x8f8c('0xa')][_0x8f8c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x480cab,_0x2215aa,_0x413210){return new BPromise(function(_0x1bf92a,_0x5884bc){return client['request'](_0x480cab,_0x413210)[_0x8f8c('0xc')](function(_0x4d454c){logger['info'](_0x8f8c('0xd'),_0x2215aa,_0x8f8c('0xe'));logger[_0x8f8c('0xf')](_0x8f8c('0x10'),_0x2215aa,_0x8f8c('0xe'),JSON[_0x8f8c('0x11')](_0x4d454c));if(_0x4d454c[_0x8f8c('0x12')]){if(_0x4d454c[_0x8f8c('0x12')][_0x8f8c('0x13')]===0x1f4){logger['error']('MemberReport,\x20%s,\x20%s',_0x2215aa,_0x4d454c[_0x8f8c('0x12')][_0x8f8c('0x14')]);return _0x5884bc(_0x4d454c['error']['message']);}logger[_0x8f8c('0x12')](_0x8f8c('0xd'),_0x2215aa,_0x4d454c[_0x8f8c('0x12')]['message']);return _0x1bf92a(_0x4d454c[_0x8f8c('0x12')][_0x8f8c('0x14')]);}else{logger[_0x8f8c('0x15')](_0x8f8c('0xd'),_0x2215aa,_0x8f8c('0xe'));_0x1bf92a(_0x4d454c[_0x8f8c('0x16')][_0x8f8c('0x14')]);}})[_0x8f8c('0x17')](function(_0x29d905){logger[_0x8f8c('0x12')]('MemberReport,\x20%s,\x20%s',_0x2215aa,_0x29d905);_0x5884bc(_0x29d905);});});}exports[_0x8f8c('0x18')]=function(_0x305ca4){var _0xa840d9=this;return new Promise(function(_0x5bb04d,_0x4803c5){return db[_0x8f8c('0x19')][_0x8f8c('0x1a')]({'raw':_0x305ca4[_0x8f8c('0x1b')]?_0x305ca4[_0x8f8c('0x1b')][_0x8f8c('0x1c')]===undefined?!![]:![]:!![],'where':_0x305ca4[_0x8f8c('0x1b')]?_0x305ca4[_0x8f8c('0x1b')]['where']||null:null,'attributes':_0x305ca4[_0x8f8c('0x1b')]?_0x305ca4['options']['attributes']||null:null,'limit':_0x305ca4['options']?_0x305ca4[_0x8f8c('0x1b')][_0x8f8c('0x1d')]||null:null,'include':_0x305ca4[_0x8f8c('0x1b')]?_0x305ca4[_0x8f8c('0x1b')][_0x8f8c('0x1e')]?_[_0x8f8c('0x1f')](_0x305ca4['options'][_0x8f8c('0x1e')],function(_0x14ddcd){return{'model':db[_0x14ddcd[_0x8f8c('0x20')]],'as':_0x14ddcd['as'],'attributes':_0x14ddcd[_0x8f8c('0x21')],'include':_0x14ddcd[_0x8f8c('0x1e')]?_[_0x8f8c('0x1f')](_0x14ddcd[_0x8f8c('0x1e')],function(_0x56415d){return{'model':db[_0x56415d['model']],'as':_0x56415d['as'],'attributes':_0x56415d[_0x8f8c('0x21')],'include':_0x56415d[_0x8f8c('0x1e')]?_['map'](_0x56415d[_0x8f8c('0x1e')],function(_0x49e04a){return{'model':db[_0x49e04a[_0x8f8c('0x20')]],'as':_0x49e04a['as'],'attributes':_0x49e04a[_0x8f8c('0x21')]};}):[]};}):[]};}):[]:[]})[_0x8f8c('0xc')](function(_0x71a4e9){logger[_0x8f8c('0x15')]('GetMemberReport',_0x305ca4);logger[_0x8f8c('0xf')](_0x8f8c('0x18'),_0x305ca4,JSON['stringify'](_0x71a4e9));_0x5bb04d(_0x71a4e9);})['catch'](function(_0x568d72){logger[_0x8f8c('0x12')]('GetMemberReport',_0x568d72[_0x8f8c('0x14')],_0x305ca4);_0x4803c5(_0xa840d9['error'](0x1f4,_0x568d72['message']));});});};exports['CreateMemberReport']=function(_0x3dac5d){var _0xca5cea=this;return new Promise(function(_0xde6146,_0xccea29){return db[_0x8f8c('0x19')]['create'](_0x3dac5d[_0x8f8c('0x22')],{'raw':_0x3dac5d[_0x8f8c('0x1b')]?_0x3dac5d[_0x8f8c('0x1b')][_0x8f8c('0x1c')]===undefined?!![]:![]:!![]})[_0x8f8c('0xc')](function(_0xcae090){logger[_0x8f8c('0x15')](_0x8f8c('0x23'),_0x3dac5d);logger['debug'](_0x8f8c('0x23'),_0x3dac5d,JSON[_0x8f8c('0x11')](_0xcae090));_0xde6146(_0xcae090);})[_0x8f8c('0x17')](function(_0x177c60){logger[_0x8f8c('0x12')]('CreateMemberReport',_0x177c60[_0x8f8c('0x14')],_0x3dac5d);_0xccea29(_0xca5cea[_0x8f8c('0x12')](0x1f4,_0x177c60[_0x8f8c('0x14')]));});});};exports[_0x8f8c('0x24')]=function(_0x40fcf4){var _0x5a3393=this;return new Promise(function(_0x223708,_0x219359){return db[_0x8f8c('0x19')][_0x8f8c('0x25')](_0x40fcf4[_0x8f8c('0x22')],{'raw':_0x40fcf4[_0x8f8c('0x1b')]?_0x40fcf4['options'][_0x8f8c('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40fcf4['options']?_0x40fcf4['options'][_0x8f8c('0x26')]||null:null,'attributes':_0x40fcf4[_0x8f8c('0x1b')]?_0x40fcf4[_0x8f8c('0x1b')][_0x8f8c('0x21')]||null:null,'limit':_0x40fcf4[_0x8f8c('0x1b')]?_0x40fcf4[_0x8f8c('0x1b')][_0x8f8c('0x1d')]||null:null})['then'](function(_0x117fd0){logger[_0x8f8c('0x15')]('UpdateMemberReport',_0x40fcf4);logger[_0x8f8c('0xf')](_0x8f8c('0x24'),_0x40fcf4,JSON['stringify'](_0x117fd0));_0x223708(_0x117fd0);})[_0x8f8c('0x17')](function(_0x2c4721){logger[_0x8f8c('0x12')]('UpdateMemberReport',_0x2c4721[_0x8f8c('0x14')],_0x40fcf4);_0x219359(_0x5a3393[_0x8f8c('0x12')](0x1f4,_0x2c4721[_0x8f8c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 2ce7134..4c6954b 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 _0x878f=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','index','util','path','connect-timeout'];(function(_0x5783a1,_0x1d0281){var _0x55e8b7=function(_0x41aa49){while(--_0x41aa49){_0x5783a1['push'](_0x5783a1['shift']());}};_0x55e8b7(++_0x1d0281);}(_0x878f,0x173));var _0xf878=function(_0x4e0232,_0x3861d5){_0x4e0232=_0x4e0232-0x0;var _0x821e17=_0x878f[_0x4e0232];return _0x821e17;};'use strict';var multer=require('multer');var util=require(_0xf878('0x0'));var path=require(_0xf878('0x1'));var timeout=require(_0xf878('0x2'));var express=require(_0xf878('0x3'));var router=express[_0xf878('0x4')]();var auth=require(_0xf878('0x5'));var interaction=require(_0xf878('0x6'));var config=require(_0xf878('0x7'));var controller=require(_0xf878('0x8'));router[_0xf878('0x9')]('/',controller[_0xf878('0xa')]);module['exports']=router; \ No newline at end of file +var _0xbfcc=['exports','multer','connect-timeout','express','Router','../../components/auth/service','index'];(function(_0x3740fe,_0x6c543c){var _0x55492b=function(_0x1f851f){while(--_0x1f851f){_0x3740fe['push'](_0x3740fe['shift']());}};_0x55492b(++_0x6c543c);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xbfcc[_0x2d7f0e];return _0x110b07;};'use strict';var multer=require(_0xcbfc('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xcbfc('0x1'));var express=require(_0xcbfc('0x2'));var router=express[_0xcbfc('0x3')]();var auth=require(_0xcbfc('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./migration.controller');router['get']('/',controller[_0xcbfc('0x5')]);module[_0xcbfc('0x6')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 28ab533..469450a 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 _0xaf58=['version','exports'];(function(_0x2d533c,_0x5ad802){var _0xbc6b3e=function(_0x1ef2a5){while(--_0x1ef2a5){_0x2d533c['push'](_0x2d533c['shift']());}};_0xbc6b3e(++_0x5ad802);}(_0xaf58,0x1d5));var _0x8af5=function(_0x31cba1,_0x421301){_0x31cba1=_0x31cba1-0x0;var _0x546467=_0xaf58[_0x31cba1];return _0x546467;};'use strict';var Sequelize=require('sequelize');module[_0x8af5('0x0')]={'version':{'type':Sequelize['STRING'],'unique':_0x8af5('0x1')}}; \ No newline at end of file +var _0x627a=['version','sequelize'];(function(_0x428029,_0x1a5eb3){var _0x52033a=function(_0x5d73a8){while(--_0x5d73a8){_0x428029['push'](_0x428029['shift']());}};_0x52033a(++_0x1a5eb3);}(_0x627a,0x1df));var _0xa627=function(_0x1baf11,_0x12af09){_0x1baf11=_0x1baf11-0x0;var _0x882806=_0x627a[_0x1baf11];return _0x882806;};'use strict';var Sequelize=require(_0xa627('0x0'));module['exports']={'version':{'type':Sequelize['STRING'],'unique':_0xa627('0x1')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index ccc37a9..b647d8a 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 _0x7a54=['filters','filter','where','merge','VIRTUAL','count','includeAll','findAll','rows','catch','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','map','Migration','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x278f99,_0x2488d4){var _0x1dcf1f=function(_0x44655c){while(--_0x44655c){_0x278f99['push'](_0x278f99['shift']());}};_0x1dcf1f(++_0x2488d4);}(_0x7a54,0x106));var _0x47a5=function(_0x191657,_0x42a696){_0x191657=_0x191657-0x0;var _0x571556=_0x7a54[_0x191657];return _0x571556;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');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 db=require(_0x47a5('0x14'))['db'];function respondWithStatusCode(_0xd612dd,_0xd308b8){_0xd308b8=_0xd308b8||0xcc;return function(_0x1eae59){if(_0x1eae59){return _0xd612dd['sendStatus'](_0xd308b8);}return _0xd612dd[_0x47a5('0x15')](_0xd308b8)[_0x47a5('0x16')]();};}function respondWithResult(_0x1cf309,_0x711793){_0x711793=_0x711793||0xc8;return function(_0x139f25){if(_0x139f25){return _0x1cf309[_0x47a5('0x15')](_0x711793)[_0x47a5('0x17')](_0x139f25);}};}function respondWithFilteredResult(_0x190faa,_0x4e99a8){return function(_0x362359){if(_0x362359){var _0x11faf5=_0x362359['count'],_0x3b001e=_0x4e99a8['offset'],_0x2a2cbb=_0x4e99a8[_0x47a5('0x18')]+_0x4e99a8['limit'],_0x1ef44c;if(_0x2a2cbb>=_0x11faf5){_0x2a2cbb=_0x11faf5;_0x1ef44c=0xc8;}else{_0x1ef44c=0xce;}_0x190faa['status'](_0x1ef44c);return _0x190faa[_0x47a5('0x19')](_0x47a5('0x1a'),_0x3b001e+'-'+_0x2a2cbb+'/'+_0x11faf5)[_0x47a5('0x17')](_0x362359);}return null;};}function patchUpdates(_0x1ef371){return function(_0x477b1d){try{jsonpatch[_0x47a5('0x1b')](_0x477b1d,_0x1ef371,!![]);}catch(_0x2763d6){return BPromise[_0x47a5('0x1c')](_0x2763d6);}return _0x477b1d[_0x47a5('0x1d')]();};}function saveUpdates(_0x4a9fcb,_0x1570bc){return function(_0xf160ba){if(_0xf160ba){return _0xf160ba['update'](_0x4a9fcb)[_0x47a5('0x1e')](function(_0x1f03f7){return _0x1f03f7;});}return null;};}function removeEntity(_0x36874d,_0x4c5910){return function(_0xb8ae6c){if(_0xb8ae6c){return _0xb8ae6c[_0x47a5('0x1f')]()[_0x47a5('0x1e')](function(){_0x36874d[_0x47a5('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe2dea9,_0x385687){return function(_0x513981){if(!_0x513981){_0xe2dea9[_0x47a5('0x20')](0x194);}return _0x513981;};}function handleError(_0xc4cd63,_0x4437f1){_0x4437f1=_0x4437f1||0x1f4;return function(_0x129ce5){logger[_0x47a5('0x21')](_0x129ce5['stack']);if(_0x129ce5['name']){delete _0x129ce5[_0x47a5('0x22')];}_0xc4cd63['status'](_0x4437f1)[_0x47a5('0x23')](_0x129ce5);};}exports['index']=function(_0x23cb77,_0x378208){var _0x36ad34={},_0x1dac65={},_0x21f296={'count':0x0,'rows':[]};var _0x3ba0b7=_[_0x47a5('0x24')](db[_0x47a5('0x25')][_0x47a5('0x26')],function(_0x361bfa){return{'name':_0x361bfa[_0x47a5('0x27')],'type':_0x361bfa[_0x47a5('0x28')][_0x47a5('0x29')]};});_0x1dac65['model']=_[_0x47a5('0x24')](_0x3ba0b7,'name');_0x1dac65[_0x47a5('0x2a')]=_[_0x47a5('0x2b')](_0x23cb77[_0x47a5('0x2a')]);_0x1dac65['filters']=_[_0x47a5('0x2c')](_0x1dac65[_0x47a5('0x2d')],_0x1dac65[_0x47a5('0x2a')]);_0x36ad34[_0x47a5('0x2e')]=_['intersection'](_0x1dac65['model'],qs[_0x47a5('0x2f')](_0x23cb77[_0x47a5('0x2a')]['fields']));_0x36ad34['attributes']=_0x36ad34[_0x47a5('0x2e')][_0x47a5('0x30')]?_0x36ad34['attributes']:_0x1dac65[_0x47a5('0x2d')];if(!_0x23cb77['query'][_0x47a5('0x31')](_0x47a5('0x32'))){_0x36ad34['limit']=qs['limit'](_0x23cb77[_0x47a5('0x2a')]['limit']);_0x36ad34[_0x47a5('0x18')]=qs[_0x47a5('0x18')](_0x23cb77[_0x47a5('0x2a')]['offset']);}_0x36ad34[_0x47a5('0x33')]=qs['sort'](_0x23cb77['query'][_0x47a5('0x34')]);_0x36ad34['where']=qs[_0x47a5('0x35')](_['pick'](_0x23cb77[_0x47a5('0x2a')],_0x1dac65[_0x47a5('0x35')]));if(_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]){_0x36ad34[_0x47a5('0x37')]=_[_0x47a5('0x38')](_0x36ad34[_0x47a5('0x37')],{'$or':_[_0x47a5('0x24')](_0x3ba0b7,function(_0x1a0d23){if(_0x1a0d23['type']!==_0x47a5('0x39')){var _0x10f136={};_0x10f136[_0x1a0d23['name']]={'$like':'%'+_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]+'%'};return _0x10f136;}})});}_0x36ad34=_[_0x47a5('0x38')]({},_0x36ad34,_0x23cb77['options']);var _0x101f70={'where':_0x36ad34[_0x47a5('0x37')]};return db['Migration'][_0x47a5('0x3a')](_0x101f70)[_0x47a5('0x1e')](function(_0x54ae35){_0x21f296['count']=_0x54ae35;if(_0x23cb77['query'][_0x47a5('0x3b')]){_0x36ad34['include']=[{'all':!![]}];}return db[_0x47a5('0x25')][_0x47a5('0x3c')](_0x36ad34);})[_0x47a5('0x1e')](function(_0x111f0d){_0x21f296[_0x47a5('0x3d')]=_0x111f0d;return _0x21f296;})[_0x47a5('0x1e')](respondWithFilteredResult(_0x378208,_0x36ad34))[_0x47a5('0x3e')](handleError(_0x378208,null));}; \ No newline at end of file +var _0x5f2f=['desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','end','error','stack','name','send','index','map','fieldName','type','query','keys','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','Migration','then','include','rows','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce'];(function(_0x100af2,_0x43dec4){var _0x483402=function(_0x216cc1){while(--_0x216cc1){_0x100af2['push'](_0x100af2['shift']());}};_0x483402(++_0x43dec4);}(_0x5f2f,0x73));var _0xf5f2=function(_0x40913a,_0x4276d7){_0x40913a=_0x40913a-0x0;var _0x46b62b=_0x5f2f[_0x40913a];return _0x46b62b;};'use strict';var pdf=require(_0xf5f2('0x0'));var emlformat=require(_0xf5f2('0x1'));var rimraf=require(_0xf5f2('0x2'));var zipdir=require(_0xf5f2('0x3'));var jsonpatch=require(_0xf5f2('0x4'));var rp=require(_0xf5f2('0x5'));var moment=require(_0xf5f2('0x6'));var BPromise=require(_0xf5f2('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf5f2('0x8'));var sox=require(_0xf5f2('0x9'));var csv=require(_0xf5f2('0xa'));var ejs=require(_0xf5f2('0xb'));var fs=require('fs');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('0xa'));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 db=require(_0xf5f2('0x16'))['db'];function respondWithStatusCode(_0x14b51f,_0x331482){_0x331482=_0x331482||0xcc;return function(_0x3f2997){if(_0x3f2997){return _0x14b51f[_0xf5f2('0x17')](_0x331482);}return _0x14b51f[_0xf5f2('0x18')](_0x331482)['end']();};}function respondWithResult(_0x5850f4,_0xea612c){_0xea612c=_0xea612c||0xc8;return function(_0x269909){if(_0x269909){return _0x5850f4[_0xf5f2('0x18')](_0xea612c)[_0xf5f2('0x19')](_0x269909);}};}function respondWithFilteredResult(_0x4d97fc,_0xafe430){return function(_0x286197){if(_0x286197){var _0x17d656=_0x286197[_0xf5f2('0x1a')],_0x1b6dd2=_0xafe430[_0xf5f2('0x1b')],_0x23e23a=_0xafe430[_0xf5f2('0x1b')]+_0xafe430[_0xf5f2('0x1c')],_0x3a9dbb;if(_0x23e23a>=_0x17d656){_0x23e23a=_0x17d656;_0x3a9dbb=0xc8;}else{_0x3a9dbb=0xce;}_0x4d97fc[_0xf5f2('0x18')](_0x3a9dbb);return _0x4d97fc[_0xf5f2('0x1d')](_0xf5f2('0x1e'),_0x1b6dd2+'-'+_0x23e23a+'/'+_0x17d656)[_0xf5f2('0x19')](_0x286197);}return null;};}function patchUpdates(_0x3cf5ea){return function(_0x626999){try{jsonpatch[_0xf5f2('0x1f')](_0x626999,_0x3cf5ea,!![]);}catch(_0x56acc5){return BPromise[_0xf5f2('0x20')](_0x56acc5);}return _0x626999[_0xf5f2('0x21')]();};}function saveUpdates(_0x49dac2,_0x47acfc){return function(_0x2d2805){if(_0x2d2805){return _0x2d2805[_0xf5f2('0x22')](_0x49dac2)['then'](function(_0x45b74f){return _0x45b74f;});}return null;};}function removeEntity(_0x170042,_0x39e44a){return function(_0x39c024){if(_0x39c024){return _0x39c024[_0xf5f2('0x23')]()['then'](function(){_0x170042[_0xf5f2('0x18')](0xcc)[_0xf5f2('0x24')]();});}};}function handleEntityNotFound(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(!_0x287ad5){_0x4e8bda['sendStatus'](0x194);}return _0x287ad5;};}function handleError(_0x529f07,_0x5f1124){_0x5f1124=_0x5f1124||0x1f4;return function(_0x3f79d5){logger[_0xf5f2('0x25')](_0x3f79d5[_0xf5f2('0x26')]);if(_0x3f79d5[_0xf5f2('0x27')]){delete _0x3f79d5[_0xf5f2('0x27')];}_0x529f07[_0xf5f2('0x18')](_0x5f1124)[_0xf5f2('0x28')](_0x3f79d5);};}exports[_0xf5f2('0x29')]=function(_0x4ab014,_0xaa2602){var _0x102449={},_0x375ca8={},_0x31bfcb={'count':0x0,'rows':[]};var _0x198c73=_[_0xf5f2('0x2a')](db['Migration']['rawAttributes'],function(_0x22c826){return{'name':_0x22c826[_0xf5f2('0x2b')],'type':_0x22c826[_0xf5f2('0x2c')]['key']};});_0x375ca8['model']=_[_0xf5f2('0x2a')](_0x198c73,_0xf5f2('0x27'));_0x375ca8[_0xf5f2('0x2d')]=_[_0xf5f2('0x2e')](_0x4ab014[_0xf5f2('0x2d')]);_0x375ca8['filters']=_['intersection'](_0x375ca8[_0xf5f2('0x2f')],_0x375ca8['query']);_0x102449[_0xf5f2('0x30')]=_['intersection'](_0x375ca8[_0xf5f2('0x2f')],qs[_0xf5f2('0x31')](_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x31')]));_0x102449[_0xf5f2('0x30')]=_0x102449[_0xf5f2('0x30')][_0xf5f2('0x32')]?_0x102449[_0xf5f2('0x30')]:_0x375ca8['model'];if(!_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x33')](_0xf5f2('0x34'))){_0x102449[_0xf5f2('0x1c')]=qs[_0xf5f2('0x1c')](_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x1c')]);_0x102449['offset']=qs[_0xf5f2('0x1b')](_0x4ab014[_0xf5f2('0x2d')]['offset']);}_0x102449[_0xf5f2('0x35')]=qs['sort'](_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x36')]);_0x102449[_0xf5f2('0x37')]=qs[_0xf5f2('0x38')](_['pick'](_0x4ab014['query'],_0x375ca8[_0xf5f2('0x38')]));if(_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x39')]){_0x102449['where']=_[_0xf5f2('0x3a')](_0x102449['where'],{'$or':_[_0xf5f2('0x2a')](_0x198c73,function(_0x566c47){if(_0x566c47[_0xf5f2('0x2c')]!==_0xf5f2('0x3b')){var _0x5337a6={};_0x5337a6[_0x566c47[_0xf5f2('0x27')]]={'$like':'%'+_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x39')]+'%'};return _0x5337a6;}})});}_0x102449=_[_0xf5f2('0x3a')]({},_0x102449,_0x4ab014['options']);var _0x5d2d82={'where':_0x102449[_0xf5f2('0x37')]};return db[_0xf5f2('0x3c')][_0xf5f2('0x1a')](_0x5d2d82)[_0xf5f2('0x3d')](function(_0x2c7f65){_0x31bfcb[_0xf5f2('0x1a')]=_0x2c7f65;if(_0x4ab014[_0xf5f2('0x2d')]['includeAll']){_0x102449[_0xf5f2('0x3e')]=[{'all':!![]}];}return db[_0xf5f2('0x3c')]['findAll'](_0x102449);})[_0xf5f2('0x3d')](function(_0x3f3895){_0x31bfcb[_0xf5f2('0x3f')]=_0x3f3895;return _0x31bfcb;})[_0xf5f2('0x3d')](respondWithFilteredResult(_0xaa2602,_0x102449))[_0xf5f2('0x40')](handleError(_0xaa2602,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index c29ed83..508ee26 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 _0xbb1b=['./migration.attributes','exports','Migration','migrations','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5d9041,_0x2c23bd){var _0x4c1042=function(_0xace5eb){while(--_0xace5eb){_0x5d9041['push'](_0x5d9041['shift']());}};_0x4c1042(++_0x2c23bd);}(_0xbb1b,0x86));var _0xbbb1=function(_0x158ccf,_0x271b7b){_0x158ccf=_0x158ccf-0x0;var _0xf39161=_0xbb1b[_0x158ccf];return _0xf39161;};'use strict';var _=require(_0xbbb1('0x0'));var util=require(_0xbbb1('0x1'));var logger=require(_0xbbb1('0x2'))(_0xbbb1('0x3'));var moment=require('moment');var BPromise=require(_0xbbb1('0x4'));var rp=require(_0xbbb1('0x5'));var fs=require('fs');var path=require(_0xbbb1('0x6'));var rimraf=require(_0xbbb1('0x7'));var config=require(_0xbbb1('0x8'));var attributes=require(_0xbbb1('0x9'));module[_0xbbb1('0xa')]=function(_0x39f850,_0x4c0071){return _0x39f850['define'](_0xbbb1('0xb'),attributes,{'tableName':_0xbbb1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1044=['exports','define','migrations','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./migration.attributes'];(function(_0x5de395,_0x3f9924){var _0x2a73cd=function(_0x174826){while(--_0x174826){_0x5de395['push'](_0x5de395['shift']());}};_0x2a73cd(++_0x3f9924);}(_0x1044,0xa3));var _0x4104=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0x1044[_0x1e3c16];return _0x47a0c9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4104('0x0'))(_0x4104('0x1'));var moment=require(_0x4104('0x2'));var BPromise=require('bluebird');var rp=require(_0x4104('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4104('0x4'));var config=require(_0x4104('0x5'));var attributes=require(_0x4104('0x6'));module[_0x4104('0x7')]=function(_0x343c36,_0x435d25){return _0x343c36[_0x4104('0x8')]('Migration',attributes,{'tableName':_0x4104('0x9'),'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 48ed444..d71c80c 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 _0x7d9b=['debug','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','Migration,\x20%s,\x20%s'];(function(_0x21af3a,_0x386e1d){var _0x268a49=function(_0x41a650){while(--_0x41a650){_0x21af3a['push'](_0x21af3a['shift']());}};_0x268a49(++_0x386e1d);}(_0x7d9b,0x126));var _0xb7d9=function(_0x4be3f3,_0x20efd7){_0x4be3f3=_0x4be3f3-0x0;var _0x5278b3=_0x7d9b[_0x4be3f3];return _0x5278b3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb7d9('0x0'));var BPromise=require(_0xb7d9('0x1'));var rs=require(_0xb7d9('0x2'));var fs=require('fs');var Redis=require(_0xb7d9('0x3'));var db=require(_0xb7d9('0x4'))['db'];var utils=require(_0xb7d9('0x5'));var logger=require(_0xb7d9('0x6'))('rpc');var config=require(_0xb7d9('0x7'));var jayson=require(_0xb7d9('0x8'));var client=jayson[_0xb7d9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f73c7,_0x544687,_0xe0606e){return new BPromise(function(_0x1a9a50,_0xc731f1){return client[_0xb7d9('0xa')](_0x2f73c7,_0xe0606e)[_0xb7d9('0xb')](function(_0x3c8059){logger[_0xb7d9('0xc')](_0xb7d9('0xd'),_0x544687,'request\x20sent');logger[_0xb7d9('0xe')](_0xb7d9('0xf'),_0x544687,_0xb7d9('0x10'),JSON[_0xb7d9('0x11')](_0x3c8059));if(_0x3c8059[_0xb7d9('0x12')]){if(_0x3c8059['error']['code']===0x1f4){logger[_0xb7d9('0x12')](_0xb7d9('0xd'),_0x544687,_0x3c8059[_0xb7d9('0x12')][_0xb7d9('0x13')]);return _0xc731f1(_0x3c8059['error'][_0xb7d9('0x13')]);}logger[_0xb7d9('0x12')](_0xb7d9('0xd'),_0x544687,_0x3c8059[_0xb7d9('0x12')][_0xb7d9('0x13')]);return _0x1a9a50(_0x3c8059[_0xb7d9('0x12')]['message']);}else{logger[_0xb7d9('0xc')](_0xb7d9('0xd'),_0x544687,_0xb7d9('0x10'));_0x1a9a50(_0x3c8059[_0xb7d9('0x14')]['message']);}})[_0xb7d9('0x15')](function(_0x1b345c){logger[_0xb7d9('0x12')](_0xb7d9('0xd'),_0x544687,_0x1b345c);_0xc731f1(_0x1b345c);});});} \ No newline at end of file +var _0xf960=['Migration,\x20%s,\x20%s','message','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x528b7b,_0x11ec67){var _0x20dadf=function(_0x3cedb1){while(--_0x3cedb1){_0x528b7b['push'](_0x528b7b['shift']());}};_0x20dadf(++_0x11ec67);}(_0xf960,0x193));var _0x0f96=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0xf960[_0x1762b4];return _0x29beda;};'use strict';var _=require(_0x0f96('0x0'));var util=require('util');var moment=require(_0x0f96('0x1'));var BPromise=require('bluebird');var rs=require(_0x0f96('0x2'));var fs=require('fs');var Redis=require(_0x0f96('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0f96('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x0f96('0x5'));var jayson=require(_0x0f96('0x6'));var client=jayson[_0x0f96('0x7')][_0x0f96('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x765dfe,_0x5c61f0,_0x48a12b){return new BPromise(function(_0x1c690a,_0x354642){return client[_0x0f96('0x9')](_0x765dfe,_0x48a12b)[_0x0f96('0xa')](function(_0x1eb762){logger[_0x0f96('0xb')]('Migration,\x20%s,\x20%s',_0x5c61f0,_0x0f96('0xc'));logger['debug'](_0x0f96('0xd'),_0x5c61f0,'request\x20sent',JSON[_0x0f96('0xe')](_0x1eb762));if(_0x1eb762[_0x0f96('0xf')]){if(_0x1eb762[_0x0f96('0xf')][_0x0f96('0x10')]===0x1f4){logger['error'](_0x0f96('0x11'),_0x5c61f0,_0x1eb762[_0x0f96('0xf')][_0x0f96('0x12')]);return _0x354642(_0x1eb762[_0x0f96('0xf')]['message']);}logger[_0x0f96('0xf')](_0x0f96('0x11'),_0x5c61f0,_0x1eb762[_0x0f96('0xf')][_0x0f96('0x12')]);return _0x1c690a(_0x1eb762[_0x0f96('0xf')][_0x0f96('0x12')]);}else{logger['info'](_0x0f96('0x11'),_0x5c61f0,'request\x20sent');_0x1c690a(_0x1eb762['result'][_0x0f96('0x12')]);}})[_0x0f96('0x13')](function(_0x183d93){logger[_0x0f96('0xf')](_0x0f96('0x11'),_0x5c61f0,_0x183d93);_0x354642(_0x183d93);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index c398019..9947154 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 _0x0f7b=['delete','destroy','exports','multer','util','path','express','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','post','update'];(function(_0x4a363a,_0x52cb63){var _0xb7ca40=function(_0x3fe1b7){while(--_0x3fe1b7){_0x4a363a['push'](_0x4a363a['shift']());}};_0xb7ca40(++_0x52cb63);}(_0x0f7b,0x113));var _0xb0f7=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x0f7b[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0xb0f7('0x0'));var util=require(_0xb0f7('0x1'));var path=require(_0xb0f7('0x2'));var timeout=require('connect-timeout');var express=require(_0xb0f7('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xb0f7('0x4'));var config=require(_0xb0f7('0x5'));var controller=require(_0xb0f7('0x6'));router[_0xb0f7('0x7')]('/',auth[_0xb0f7('0x8')](),controller[_0xb0f7('0x9')]);router[_0xb0f7('0x7')](_0xb0f7('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xb0f7('0xb')]('/',auth[_0xb0f7('0x8')](),controller['create']);router['put'](_0xb0f7('0xa'),auth['isAuthenticated'](),controller[_0xb0f7('0xc')]);router[_0xb0f7('0xd')](_0xb0f7('0xa'),auth[_0xb0f7('0x8')](),controller[_0xb0f7('0xe')]);module[_0xb0f7('0xf')]=router; \ No newline at end of file +var _0x4d54=['/:id','show','post','put','destroy','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x423efe,_0x16497d){var _0x1466b8=function(_0x153100){while(--_0x153100){_0x423efe['push'](_0x423efe['shift']());}};_0x1466b8(++_0x16497d);}(_0x4d54,0xf5));var _0x44d5=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x4d54[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0x44d5('0x0'));var util=require(_0x44d5('0x1'));var path=require(_0x44d5('0x2'));var timeout=require(_0x44d5('0x3'));var express=require(_0x44d5('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x44d5('0x5'));var config=require(_0x44d5('0x6'));var controller=require('./network.controller');router[_0x44d5('0x7')]('/',auth[_0x44d5('0x8')](),controller[_0x44d5('0x9')]);router['get'](_0x44d5('0xa'),auth[_0x44d5('0x8')](),controller[_0x44d5('0xb')]);router[_0x44d5('0xc')]('/',auth[_0x44d5('0x8')](),controller['create']);router[_0x44d5('0xd')]('/:id',auth[_0x44d5('0x8')](),controller['update']);router['delete'](_0x44d5('0xa'),auth['isAuthenticated'](),controller[_0x44d5('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 3d3b899..058c680 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 _0x6029=['externip','STRING','sequelize','exports','ENUM','localnet'];(function(_0x528dbd,_0x583639){var _0x258da1=function(_0x369a87){while(--_0x369a87){_0x528dbd['push'](_0x528dbd['shift']());}};_0x258da1(++_0x583639);}(_0x6029,0xd4));var _0x9602=function(_0x5388f4,_0x5d6d67){_0x5388f4=_0x5388f4-0x0;var _0x8e64a2=_0x6029[_0x5388f4];return _0x8e64a2;};'use strict';var Sequelize=require(_0x9602('0x0'));module[_0x9602('0x1')]={'type':{'type':Sequelize[_0x9602('0x2')](_0x9602('0x3'),_0x9602('0x4'))},'value':{'type':Sequelize[_0x9602('0x5')]}}; \ No newline at end of file +var _0xd9be=['ENUM','localnet','externip','STRING','sequelize'];(function(_0x414b44,_0x3b95a0){var _0x32fa6b=function(_0x109d96){while(--_0x109d96){_0x414b44['push'](_0x414b44['shift']());}};_0x32fa6b(++_0x3b95a0);}(_0xd9be,0x18f));var _0xed9b=function(_0x255208,_0x21dd79){_0x255208=_0x255208-0x0;var _0x11e987=_0xd9be[_0x255208];return _0x11e987;};'use strict';var Sequelize=require(_0xed9b('0x0'));module['exports']={'type':{'type':Sequelize[_0xed9b('0x1')](_0xed9b('0x2'),_0xed9b('0x3'))},'value':{'type':Sequelize[_0xed9b('0x4')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 456c15c..bebc91b 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 _0x3395=['nolimit','sort','where','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','find','create','sequelize','transaction','body','join','root','server/files/templates/network.ejs','utf8','render','writeFileSync','chan_sip.so','readFileSync','toLowerCase','Reload','/etc/asterisk/sip_xcally_%s.conf','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','update','destroy','stack','name','send','index','map','Network','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty'];(function(_0xc9033d,_0x367510){var _0x551c4d=function(_0x2d3c01){while(--_0x2d3c01){_0xc9033d['push'](_0xc9033d['shift']());}};_0x551c4d(++_0x367510);}(_0x3395,0xdf));var _0x5339=function(_0x156771,_0x313a4c){_0x156771=_0x156771-0x0;var _0x1401e8=_0x3395[_0x156771];return _0x1401e8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5339('0x0'));var rimraf=require(_0x5339('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5339('0x2'));var rp=require(_0x5339('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5339('0x4'));var util=require(_0x5339('0x5'));var path=require(_0x5339('0x6'));var sox=require(_0x5339('0x7'));var csv=require(_0x5339('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x5339('0x9'));var crypto=require(_0x5339('0xa'));var jsforce=require(_0x5339('0xb'));var deskjs=require(_0x5339('0xc'));var toCsv=require(_0x5339('0x8'));var querystring=require('querystring');var Papa=require(_0x5339('0xd'));var Redis=require('ioredis');var authService=require(_0x5339('0xe'));var qs=require(_0x5339('0xf'));var as=require(_0x5339('0x10'));var hardwareService=require(_0x5339('0x11'));var logger=require(_0x5339('0x12'))(_0x5339('0x13'));var utils=require('../../config/utils');var config=require(_0x5339('0x14'));var db=require(_0x5339('0x15'))['db'];var jayson=require(_0x5339('0x16'));var client=jayson[_0x5339('0x17')][_0x5339('0x18')]({'port':0x232a});function checkPasswordPattern(_0x14a57c,_0x262e32,_0x545a72){if(_0x545a72){var _0x592c35=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x592c35[_0x5339('0x19')](_0x262e32)){return _0x14a57c;}else{throw new db[(_0x5339('0x1a'))][(_0x5339('0x1b'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x14a57c;}}function respondWithRpcPromise(_0x3a29c0,_0x38d8fb,_0x83a6e9,_0x5ae0e4){return new BPromise(function(_0x3884af,_0x1fa821){var _0x17afce=_0x5ae0e4||client;return _0x17afce[_0x5339('0x1c')](_0x3a29c0,_0x83a6e9)[_0x5339('0x1d')](function(_0x454308){logger[_0x5339('0x1e')](_0x5339('0x1f'),_0x38d8fb,_0x5339('0x20'));logger[_0x5339('0x21')]('Network,\x20%s,\x20%s,\x20%s',_0x38d8fb,'request\x20sent',JSON[_0x5339('0x22')](_0x454308));if(_0x454308[_0x5339('0x23')]){if(_0x454308[_0x5339('0x23')][_0x5339('0x24')]===0x1f4){logger[_0x5339('0x23')]('Network,\x20%s,\x20%s',_0x38d8fb,_0x454308[_0x5339('0x23')][_0x5339('0x25')]);return _0x1fa821(_0x454308[_0x5339('0x23')][_0x5339('0x25')]);}logger[_0x5339('0x23')](_0x5339('0x1f'),_0x38d8fb,_0x454308[_0x5339('0x23')][_0x5339('0x25')]);return _0x3884af(_0x454308[_0x5339('0x23')]['message']);}else{logger['info']('Network,\x20%s,\x20%s',_0x38d8fb,_0x5339('0x20'));_0x3884af(_0x454308[_0x5339('0x26')][_0x5339('0x25')]);}})[_0x5339('0x27')](function(_0x186ace){logger[_0x5339('0x23')](_0x5339('0x1f'),_0x38d8fb,_0x186ace);_0x1fa821(_0x186ace);});});}function respondWithStatusCode(_0x4084cc,_0x1f9d5e){_0x1f9d5e=_0x1f9d5e||0xcc;return function(_0x3c8cc1){if(_0x3c8cc1){return _0x4084cc[_0x5339('0x28')](_0x1f9d5e);}return _0x4084cc[_0x5339('0x29')](_0x1f9d5e)[_0x5339('0x2a')]();};}function respondWithResult(_0x22e7f2,_0x4acf93){_0x4acf93=_0x4acf93||0xc8;return function(_0x2799df){if(_0x2799df){return _0x22e7f2['status'](_0x4acf93)['json'](_0x2799df);}};}function respondWithFilteredResult(_0x111cfb,_0x56a5aa){return function(_0x55bcc3){if(_0x55bcc3){var _0x1b20c8=_0x55bcc3[_0x5339('0x2b')],_0xd0b071=_0x56a5aa[_0x5339('0x2c')],_0x24a9ab=_0x56a5aa[_0x5339('0x2c')]+_0x56a5aa[_0x5339('0x2d')],_0x3bcf88;if(_0x24a9ab>=_0x1b20c8){_0x24a9ab=_0x1b20c8;_0x3bcf88=0xc8;}else{_0x3bcf88=0xce;}_0x111cfb['status'](_0x3bcf88);return _0x111cfb[_0x5339('0x2e')](_0x5339('0x2f'),_0xd0b071+'-'+_0x24a9ab+'/'+_0x1b20c8)['json'](_0x55bcc3);}return null;};}function patchUpdates(_0x26c7ca){return function(_0x31ffc2){try{jsonpatch['apply'](_0x31ffc2,_0x26c7ca,!![]);}catch(_0x2519fb){return BPromise['reject'](_0x2519fb);}return _0x31ffc2['save']();};}function saveUpdates(_0x184733,_0x208df0){return function(_0x196787){if(_0x196787){return _0x196787[_0x5339('0x30')](_0x184733)[_0x5339('0x1d')](function(_0x509a29){return _0x509a29;});}return null;};}function removeEntity(_0x390735,_0x2302b5){return function(_0x46783f){if(_0x46783f){return _0x46783f[_0x5339('0x31')]()['then'](function(){_0x390735[_0x5339('0x29')](0xcc)[_0x5339('0x2a')]();});}};}function handleEntityNotFound(_0x5ac5b8,_0x4a09b3){return function(_0x383daa){if(!_0x383daa){_0x5ac5b8[_0x5339('0x28')](0x194);}return _0x383daa;};}function handleError(_0x1b4230,_0x5b80c8){_0x5b80c8=_0x5b80c8||0x1f4;return function(_0x3b7be6){logger['error'](_0x3b7be6[_0x5339('0x32')]);if(_0x3b7be6[_0x5339('0x33')]){delete _0x3b7be6[_0x5339('0x33')];}_0x1b4230[_0x5339('0x29')](_0x5b80c8)[_0x5339('0x34')](_0x3b7be6);};}exports[_0x5339('0x35')]=function(_0x2c35e2,_0x3a805a){var _0x31c1ac={},_0x4817d7={},_0x2f4423={'count':0x0,'rows':[]};var _0x56feda=_[_0x5339('0x36')](db[_0x5339('0x37')][_0x5339('0x38')],function(_0x1d5dc2){return{'name':_0x1d5dc2[_0x5339('0x39')],'type':_0x1d5dc2['type'][_0x5339('0x3a')]};});_0x4817d7['model']=_[_0x5339('0x36')](_0x56feda,_0x5339('0x33'));_0x4817d7['query']=_[_0x5339('0x3b')](_0x2c35e2[_0x5339('0x3c')]);_0x4817d7[_0x5339('0x3d')]=_[_0x5339('0x3e')](_0x4817d7[_0x5339('0x3f')],_0x4817d7['query']);_0x31c1ac[_0x5339('0x40')]=_['intersection'](_0x4817d7['model'],qs[_0x5339('0x41')](_0x2c35e2[_0x5339('0x3c')]['fields']));_0x31c1ac['attributes']=_0x31c1ac[_0x5339('0x40')][_0x5339('0x42')]?_0x31c1ac[_0x5339('0x40')]:_0x4817d7[_0x5339('0x3f')];if(!_0x2c35e2[_0x5339('0x3c')][_0x5339('0x43')](_0x5339('0x44'))){_0x31c1ac[_0x5339('0x2d')]=qs['limit'](_0x2c35e2[_0x5339('0x3c')][_0x5339('0x2d')]);_0x31c1ac[_0x5339('0x2c')]=qs[_0x5339('0x2c')](_0x2c35e2[_0x5339('0x3c')][_0x5339('0x2c')]);}_0x31c1ac['order']=qs[_0x5339('0x45')](_0x2c35e2['query'][_0x5339('0x45')]);_0x31c1ac[_0x5339('0x46')]=qs[_0x5339('0x3d')](_['pick'](_0x2c35e2['query'],_0x4817d7[_0x5339('0x3d')]));if(_0x2c35e2[_0x5339('0x3c')]['filter']){_0x31c1ac[_0x5339('0x46')]=_[_0x5339('0x47')](_0x31c1ac['where'],{'$or':_[_0x5339('0x36')](_0x56feda,function(_0x1c8eb2){if(_0x1c8eb2[_0x5339('0x48')]!==_0x5339('0x49')){var _0x233192={};_0x233192[_0x1c8eb2[_0x5339('0x33')]]={'$like':'%'+_0x2c35e2[_0x5339('0x3c')][_0x5339('0x4a')]+'%'};return _0x233192;}})});}_0x31c1ac=_[_0x5339('0x47')]({},_0x31c1ac,_0x2c35e2[_0x5339('0x4b')]);var _0x400d5d={'where':_0x31c1ac[_0x5339('0x46')]};return db[_0x5339('0x37')][_0x5339('0x2b')](_0x400d5d)['then'](function(_0x293242){_0x2f4423[_0x5339('0x2b')]=_0x293242;if(_0x2c35e2[_0x5339('0x3c')][_0x5339('0x4c')]){_0x31c1ac[_0x5339('0x4d')]=[{'all':!![]}];}return db[_0x5339('0x37')][_0x5339('0x4e')](_0x31c1ac);})[_0x5339('0x1d')](function(_0x4f7303){_0x2f4423[_0x5339('0x4f')]=_0x4f7303;return _0x2f4423;})[_0x5339('0x1d')](respondWithFilteredResult(_0x3a805a,_0x31c1ac))[_0x5339('0x27')](handleError(_0x3a805a,null));};exports['show']=function(_0x45f741,_0x533c21){var _0x54dbcb={'raw':!![],'where':{'id':_0x45f741[_0x5339('0x50')]['id']}},_0x4f24aa={};_0x4f24aa[_0x5339('0x3f')]=_['keys'](db[_0x5339('0x37')][_0x5339('0x38')]);_0x4f24aa[_0x5339('0x3c')]=_['keys'](_0x45f741[_0x5339('0x3c')]);_0x4f24aa[_0x5339('0x3d')]=_[_0x5339('0x3e')](_0x4f24aa['model'],_0x4f24aa[_0x5339('0x3c')]);_0x54dbcb[_0x5339('0x40')]=_[_0x5339('0x3e')](_0x4f24aa[_0x5339('0x3f')],qs['fields'](_0x45f741['query'][_0x5339('0x41')]));_0x54dbcb[_0x5339('0x40')]=_0x54dbcb[_0x5339('0x40')]['length']?_0x54dbcb[_0x5339('0x40')]:_0x4f24aa[_0x5339('0x3f')];if(_0x45f741[_0x5339('0x3c')][_0x5339('0x4c')]){_0x54dbcb['include']=[{'all':!![]}];}_0x54dbcb=_['merge']({},_0x54dbcb,_0x45f741[_0x5339('0x4b')]);return db[_0x5339('0x37')][_0x5339('0x51')](_0x54dbcb)[_0x5339('0x1d')](handleEntityNotFound(_0x533c21,null))[_0x5339('0x1d')](respondWithResult(_0x533c21,null))[_0x5339('0x27')](handleError(_0x533c21,null));};exports[_0x5339('0x52')]=function(_0x1d4c81,_0x3ccc5a,_0x230d7d){var _0x2fb1b3;return db[_0x5339('0x53')][_0x5339('0x54')](function(_0x2092e6){return db[_0x5339('0x37')][_0x5339('0x52')](_0x1d4c81[_0x5339('0x55')],{'raw':!![]})[_0x5339('0x1d')](function(_0x12e26d){_0x2fb1b3=_0x12e26d;return db[_0x5339('0x37')][_0x5339('0x4e')]({'where':{'type':_0x1d4c81[_0x5339('0x55')]['type']},'raw':!![]});})[_0x5339('0x1d')](function(_0x39aa4c){var _0x36451d=fs['readFileSync'](path[_0x5339('0x56')](config[_0x5339('0x57')],_0x5339('0x58')),_0x5339('0x59'));var _0x139aa3=ejs[_0x5339('0x5a')](_0x36451d,{'networks':_0x39aa4c||[]});fs[_0x5339('0x5b')](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x1d4c81[_0x5339('0x55')][_0x5339('0x48')]['toLowerCase']()),_0x139aa3);})[_0x5339('0x1d')](function(){return respondWithRpcPromise('Reload',_0x5339('0x52'),{'module':_0x5339('0x5c')});})['then'](function(){return _0x2fb1b3;});})[_0x5339('0x1d')](respondWithResult(_0x3ccc5a,0xc9))[_0x5339('0x27')](handleError(_0x3ccc5a,null));};exports['update']=function(_0x583641,_0x23cdf8,_0xc2faca){var _0x43692a;return db[_0x5339('0x53')][_0x5339('0x54')](function(_0x1e9716){return db[_0x5339('0x37')][_0x5339('0x51')]({'where':{'id':_0x583641['params']['id']}})[_0x5339('0x1d')](handleEntityNotFound(_0x23cdf8,null))[_0x5339('0x1d')](saveUpdates(_0x583641[_0x5339('0x55')],null))[_0x5339('0x1d')](function(_0x4f7f5f){if(_0x4f7f5f){_0x43692a=_0x4f7f5f;return db[_0x5339('0x37')]['findAll']({'where':{'type':_0x43692a[_0x5339('0x48')]},'raw':!![]});}return null;})[_0x5339('0x1d')](function(_0x162f78){if(_0x162f78){var _0x328581=fs[_0x5339('0x5d')](path['join'](config['root'],_0x5339('0x58')),'utf8');var _0x550954=ejs[_0x5339('0x5a')](_0x328581,{'networks':_0x162f78||[]});fs[_0x5339('0x5b')](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x43692a['type'][_0x5339('0x5e')]()),_0x550954);return respondWithRpcPromise(_0x5339('0x5f'),'update',{'module':_0x5339('0x5c')});}return null;})[_0x5339('0x1d')](function(_0x1a3840){if(_0x1a3840){return _0x43692a;}return null;});})[_0x5339('0x1d')](respondWithResult(_0x23cdf8,null))[_0x5339('0x27')](handleError(_0x23cdf8,null));};exports['destroy']=function(_0x4556c,_0x4c4117,_0x2516db){var _0x5639c0;return db[_0x5339('0x37')][_0x5339('0x51')]({'where':{'id':_0x4556c[_0x5339('0x50')]['id']}})['then'](function(_0x3b2bca){_0x5639c0=_0x3b2bca;return _0x3b2bca;})['then'](handleEntityNotFound(_0x4c4117,null))['then'](removeEntity(_0x4c4117,null))[_0x5339('0x1d')](function(){if(_0x5639c0){return db[_0x5339('0x37')][_0x5339('0x4e')]({'where':{'type':_0x5639c0[_0x5339('0x48')]},'raw':!![]});}})[_0x5339('0x1d')](function(_0x311c2d){if(_0x311c2d){var _0x51fe6a=fs['readFileSync'](path['join'](config[_0x5339('0x57')],'server/files/templates/network.ejs'),_0x5339('0x59'));var _0x46e7d7=ejs['render'](_0x51fe6a,{'networks':_0x311c2d||[]});fs['writeFileSync'](util['format'](_0x5339('0x60'),_0x5639c0[_0x5339('0x48')][_0x5339('0x5e')]()),_0x46e7d7);return respondWithRpcPromise(_0x5339('0x5f'),_0x5339('0x31'),{'module':_0x5339('0x5c')});}})[_0x5339('0x27')](handleError(_0x4c4117,null));}; \ No newline at end of file +var _0x8f83=['html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','client','http','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~!@#$%^&-_=+[{]}.','request','Network,\x20%s,\x20%s','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','catch','sendStatus','status','end','count','limit','set','Content-Range','json','reject','update','then','destroy','stack','name','index','map','Network','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','params','keys','rawAttributes','create','sequelize','transaction','body','root','server/files/templates/network.ejs','utf8','render','writeFileSync','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','Reload','chan_sip.so','find','join','readFileSync'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x8f83,0x129));var _0x38f8=function(_0x36ce78,_0x84a216){_0x36ce78=_0x36ce78-0x0;var _0x21a8e6=_0x8f83[_0x36ce78];return _0x21a8e6;};'use strict';var pdf=require(_0x38f8('0x0'));var emlformat=require(_0x38f8('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x38f8('0x2'));var rp=require(_0x38f8('0x3'));var moment=require(_0x38f8('0x4'));var BPromise=require(_0x38f8('0x5'));var Mustache=require(_0x38f8('0x6'));var util=require('util');var path=require(_0x38f8('0x7'));var sox=require(_0x38f8('0x8'));var csv=require(_0x38f8('0x9'));var ejs=require(_0x38f8('0xa'));var fs=require('fs');var _=require(_0x38f8('0xb'));var squel=require('squel');var crypto=require(_0x38f8('0xc'));var jsforce=require(_0x38f8('0xd'));var deskjs=require(_0x38f8('0xe'));var toCsv=require(_0x38f8('0x9'));var querystring=require(_0x38f8('0xf'));var Papa=require(_0x38f8('0x10'));var Redis=require(_0x38f8('0x11'));var authService=require(_0x38f8('0x12'));var qs=require(_0x38f8('0x13'));var as=require(_0x38f8('0x14'));var hardwareService=require(_0x38f8('0x15'));var logger=require(_0x38f8('0x16'))(_0x38f8('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x38f8('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x38f8('0x19')][_0x38f8('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x44185c,_0x4023f8,_0x4d9cf5){if(_0x4d9cf5){var _0xc96f23=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xc96f23['test'](_0x4023f8)){return _0x44185c;}else{throw new db[(_0x38f8('0x1b'))]['ValidationError'](_0x38f8('0x1c'));}}else{return _0x44185c;}}function respondWithRpcPromise(_0x24f6c9,_0x38d9f4,_0x254a32,_0x51a8c1){return new BPromise(function(_0x542653,_0x2f0e24){var _0x59cf69=_0x51a8c1||client;return _0x59cf69[_0x38f8('0x1d')](_0x24f6c9,_0x254a32)['then'](function(_0x553d56){logger['info'](_0x38f8('0x1e'),_0x38d9f4,'request\x20sent');logger['debug'](_0x38f8('0x1f'),_0x38d9f4,'request\x20sent',JSON[_0x38f8('0x20')](_0x553d56));if(_0x553d56[_0x38f8('0x21')]){if(_0x553d56[_0x38f8('0x21')][_0x38f8('0x22')]===0x1f4){logger[_0x38f8('0x21')](_0x38f8('0x1e'),_0x38d9f4,_0x553d56['error']['message']);return _0x2f0e24(_0x553d56[_0x38f8('0x21')][_0x38f8('0x23')]);}logger['error'](_0x38f8('0x1e'),_0x38d9f4,_0x553d56[_0x38f8('0x21')][_0x38f8('0x23')]);return _0x542653(_0x553d56[_0x38f8('0x21')]['message']);}else{logger[_0x38f8('0x24')](_0x38f8('0x1e'),_0x38d9f4,_0x38f8('0x25'));_0x542653(_0x553d56['result'][_0x38f8('0x23')]);}})[_0x38f8('0x26')](function(_0x54ff82){logger[_0x38f8('0x21')](_0x38f8('0x1e'),_0x38d9f4,_0x54ff82);_0x2f0e24(_0x54ff82);});});}function respondWithStatusCode(_0x17548e,_0x520d57){_0x520d57=_0x520d57||0xcc;return function(_0x3b8167){if(_0x3b8167){return _0x17548e[_0x38f8('0x27')](_0x520d57);}return _0x17548e[_0x38f8('0x28')](_0x520d57)[_0x38f8('0x29')]();};}function respondWithResult(_0x588af5,_0x3d4ffb){_0x3d4ffb=_0x3d4ffb||0xc8;return function(_0x3bb4e3){if(_0x3bb4e3){return _0x588af5[_0x38f8('0x28')](_0x3d4ffb)['json'](_0x3bb4e3);}};}function respondWithFilteredResult(_0x2f2390,_0x2faf90){return function(_0x363d04){if(_0x363d04){var _0x2cf1e1=_0x363d04[_0x38f8('0x2a')],_0x486e9f=_0x2faf90['offset'],_0x216d7f=_0x2faf90['offset']+_0x2faf90[_0x38f8('0x2b')],_0x49c7d6;if(_0x216d7f>=_0x2cf1e1){_0x216d7f=_0x2cf1e1;_0x49c7d6=0xc8;}else{_0x49c7d6=0xce;}_0x2f2390[_0x38f8('0x28')](_0x49c7d6);return _0x2f2390[_0x38f8('0x2c')](_0x38f8('0x2d'),_0x486e9f+'-'+_0x216d7f+'/'+_0x2cf1e1)[_0x38f8('0x2e')](_0x363d04);}return null;};}function patchUpdates(_0x168b11){return function(_0x33649b){try{jsonpatch['apply'](_0x33649b,_0x168b11,!![]);}catch(_0x33157e){return BPromise[_0x38f8('0x2f')](_0x33157e);}return _0x33649b['save']();};}function saveUpdates(_0x426cd6,_0x3f9047){return function(_0x5b5df3){if(_0x5b5df3){return _0x5b5df3[_0x38f8('0x30')](_0x426cd6)[_0x38f8('0x31')](function(_0xc3fbb8){return _0xc3fbb8;});}return null;};}function removeEntity(_0x340f18,_0x2a6383){return function(_0x47c186){if(_0x47c186){return _0x47c186[_0x38f8('0x32')]()[_0x38f8('0x31')](function(){_0x340f18[_0x38f8('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e43ff,_0x4b0374){return function(_0x25b928){if(!_0x25b928){_0x3e43ff['sendStatus'](0x194);}return _0x25b928;};}function handleError(_0x3f721a,_0x34c42f){_0x34c42f=_0x34c42f||0x1f4;return function(_0x576a9d){logger[_0x38f8('0x21')](_0x576a9d[_0x38f8('0x33')]);if(_0x576a9d['name']){delete _0x576a9d[_0x38f8('0x34')];}_0x3f721a[_0x38f8('0x28')](_0x34c42f)['send'](_0x576a9d);};}exports[_0x38f8('0x35')]=function(_0x2dfcb3,_0x28b0ba){var _0x44895f={},_0x5c79f2={},_0x115976={'count':0x0,'rows':[]};var _0x46c206=_[_0x38f8('0x36')](db[_0x38f8('0x37')]['rawAttributes'],function(_0x53f9e6){return{'name':_0x53f9e6[_0x38f8('0x38')],'type':_0x53f9e6[_0x38f8('0x39')]['key']};});_0x5c79f2[_0x38f8('0x3a')]=_[_0x38f8('0x36')](_0x46c206,_0x38f8('0x34'));_0x5c79f2[_0x38f8('0x3b')]=_['keys'](_0x2dfcb3[_0x38f8('0x3b')]);_0x5c79f2['filters']=_[_0x38f8('0x3c')](_0x5c79f2[_0x38f8('0x3a')],_0x5c79f2['query']);_0x44895f[_0x38f8('0x3d')]=_[_0x38f8('0x3c')](_0x5c79f2['model'],qs[_0x38f8('0x3e')](_0x2dfcb3[_0x38f8('0x3b')]['fields']));_0x44895f['attributes']=_0x44895f['attributes'][_0x38f8('0x3f')]?_0x44895f[_0x38f8('0x3d')]:_0x5c79f2[_0x38f8('0x3a')];if(!_0x2dfcb3[_0x38f8('0x3b')][_0x38f8('0x40')](_0x38f8('0x41'))){_0x44895f[_0x38f8('0x2b')]=qs[_0x38f8('0x2b')](_0x2dfcb3[_0x38f8('0x3b')][_0x38f8('0x2b')]);_0x44895f[_0x38f8('0x42')]=qs[_0x38f8('0x42')](_0x2dfcb3['query'][_0x38f8('0x42')]);}_0x44895f[_0x38f8('0x43')]=qs['sort'](_0x2dfcb3['query'][_0x38f8('0x44')]);_0x44895f[_0x38f8('0x45')]=qs[_0x38f8('0x46')](_['pick'](_0x2dfcb3[_0x38f8('0x3b')],_0x5c79f2['filters']));if(_0x2dfcb3[_0x38f8('0x3b')][_0x38f8('0x47')]){_0x44895f[_0x38f8('0x45')]=_['merge'](_0x44895f[_0x38f8('0x45')],{'$or':_[_0x38f8('0x36')](_0x46c206,function(_0x2a8e0a){if(_0x2a8e0a['type']!==_0x38f8('0x48')){var _0xf0e1ed={};_0xf0e1ed[_0x2a8e0a[_0x38f8('0x34')]]={'$like':'%'+_0x2dfcb3[_0x38f8('0x3b')][_0x38f8('0x47')]+'%'};return _0xf0e1ed;}})});}_0x44895f=_[_0x38f8('0x49')]({},_0x44895f,_0x2dfcb3[_0x38f8('0x4a')]);var _0x18607e={'where':_0x44895f[_0x38f8('0x45')]};return db[_0x38f8('0x37')][_0x38f8('0x2a')](_0x18607e)[_0x38f8('0x31')](function(_0x9b0190){_0x115976['count']=_0x9b0190;if(_0x2dfcb3[_0x38f8('0x3b')][_0x38f8('0x4b')]){_0x44895f[_0x38f8('0x4c')]=[{'all':!![]}];}return db[_0x38f8('0x37')][_0x38f8('0x4d')](_0x44895f);})[_0x38f8('0x31')](function(_0x278b4b){_0x115976['rows']=_0x278b4b;return _0x115976;})['then'](respondWithFilteredResult(_0x28b0ba,_0x44895f))[_0x38f8('0x26')](handleError(_0x28b0ba,null));};exports[_0x38f8('0x4e')]=function(_0x5622eb,_0x50e677){var _0x4a7bf7={'raw':!![],'where':{'id':_0x5622eb[_0x38f8('0x4f')]['id']}},_0x3387b0={};_0x3387b0[_0x38f8('0x3a')]=_[_0x38f8('0x50')](db[_0x38f8('0x37')][_0x38f8('0x51')]);_0x3387b0['query']=_[_0x38f8('0x50')](_0x5622eb[_0x38f8('0x3b')]);_0x3387b0['filters']=_['intersection'](_0x3387b0[_0x38f8('0x3a')],_0x3387b0[_0x38f8('0x3b')]);_0x4a7bf7[_0x38f8('0x3d')]=_[_0x38f8('0x3c')](_0x3387b0[_0x38f8('0x3a')],qs[_0x38f8('0x3e')](_0x5622eb[_0x38f8('0x3b')][_0x38f8('0x3e')]));_0x4a7bf7['attributes']=_0x4a7bf7[_0x38f8('0x3d')][_0x38f8('0x3f')]?_0x4a7bf7[_0x38f8('0x3d')]:_0x3387b0['model'];if(_0x5622eb[_0x38f8('0x3b')]['includeAll']){_0x4a7bf7['include']=[{'all':!![]}];}_0x4a7bf7=_['merge']({},_0x4a7bf7,_0x5622eb[_0x38f8('0x4a')]);return db[_0x38f8('0x37')]['find'](_0x4a7bf7)[_0x38f8('0x31')](handleEntityNotFound(_0x50e677,null))[_0x38f8('0x31')](respondWithResult(_0x50e677,null))[_0x38f8('0x26')](handleError(_0x50e677,null));};exports[_0x38f8('0x52')]=function(_0x461625,_0x466911,_0x359569){var _0x282a85;return db[_0x38f8('0x53')][_0x38f8('0x54')](function(_0x347fad){return db['Network']['create'](_0x461625[_0x38f8('0x55')],{'raw':!![]})[_0x38f8('0x31')](function(_0xb7d156){_0x282a85=_0xb7d156;return db[_0x38f8('0x37')][_0x38f8('0x4d')]({'where':{'type':_0x461625[_0x38f8('0x55')]['type']},'raw':!![]});})['then'](function(_0x53fdf3){var _0x2b2b7e=fs['readFileSync'](path['join'](config[_0x38f8('0x56')],_0x38f8('0x57')),_0x38f8('0x58'));var _0x4f8701=ejs[_0x38f8('0x59')](_0x2b2b7e,{'networks':_0x53fdf3||[]});fs[_0x38f8('0x5a')](util[_0x38f8('0x5b')](_0x38f8('0x5c'),_0x461625['body']['type'][_0x38f8('0x5d')]()),_0x4f8701);})['then'](function(){return respondWithRpcPromise(_0x38f8('0x5e'),_0x38f8('0x52'),{'module':_0x38f8('0x5f')});})[_0x38f8('0x31')](function(){return _0x282a85;});})[_0x38f8('0x31')](respondWithResult(_0x466911,0xc9))[_0x38f8('0x26')](handleError(_0x466911,null));};exports['update']=function(_0x3f6f6f,_0x1afd9d,_0xc7368c){var _0x1ea627;return db[_0x38f8('0x53')]['transaction'](function(_0x51aa71){return db['Network'][_0x38f8('0x60')]({'where':{'id':_0x3f6f6f[_0x38f8('0x4f')]['id']}})[_0x38f8('0x31')](handleEntityNotFound(_0x1afd9d,null))[_0x38f8('0x31')](saveUpdates(_0x3f6f6f[_0x38f8('0x55')],null))[_0x38f8('0x31')](function(_0x28c5d1){if(_0x28c5d1){_0x1ea627=_0x28c5d1;return db[_0x38f8('0x37')][_0x38f8('0x4d')]({'where':{'type':_0x1ea627['type']},'raw':!![]});}return null;})[_0x38f8('0x31')](function(_0x296b3a){if(_0x296b3a){var _0x3e9892=fs['readFileSync'](path[_0x38f8('0x61')](config[_0x38f8('0x56')],_0x38f8('0x57')),'utf8');var _0x209bd4=ejs[_0x38f8('0x59')](_0x3e9892,{'networks':_0x296b3a||[]});fs[_0x38f8('0x5a')](util[_0x38f8('0x5b')](_0x38f8('0x5c'),_0x1ea627['type'][_0x38f8('0x5d')]()),_0x209bd4);return respondWithRpcPromise(_0x38f8('0x5e'),_0x38f8('0x30'),{'module':_0x38f8('0x5f')});}return null;})['then'](function(_0x22d592){if(_0x22d592){return _0x1ea627;}return null;});})[_0x38f8('0x31')](respondWithResult(_0x1afd9d,null))[_0x38f8('0x26')](handleError(_0x1afd9d,null));};exports[_0x38f8('0x32')]=function(_0x5a6974,_0x384f7d,_0x3523ed){var _0x171835;return db[_0x38f8('0x37')][_0x38f8('0x60')]({'where':{'id':_0x5a6974['params']['id']}})[_0x38f8('0x31')](function(_0x24987e){_0x171835=_0x24987e;return _0x24987e;})[_0x38f8('0x31')](handleEntityNotFound(_0x384f7d,null))['then'](removeEntity(_0x384f7d,null))['then'](function(){if(_0x171835){return db[_0x38f8('0x37')][_0x38f8('0x4d')]({'where':{'type':_0x171835['type']},'raw':!![]});}})[_0x38f8('0x31')](function(_0x26264f){if(_0x26264f){var _0xa2ac0=fs[_0x38f8('0x62')](path['join'](config[_0x38f8('0x56')],'server/files/templates/network.ejs'),_0x38f8('0x58'));var _0x6660c1=ejs[_0x38f8('0x59')](_0xa2ac0,{'networks':_0x26264f||[]});fs[_0x38f8('0x5a')](util[_0x38f8('0x5b')](_0x38f8('0x5c'),_0x171835[_0x38f8('0x39')][_0x38f8('0x5d')]()),_0x6660c1);return respondWithRpcPromise(_0x38f8('0x5e'),_0x38f8('0x32'),{'module':_0x38f8('0x5f')});}})[_0x38f8('0x26')](handleError(_0x384f7d,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index d2de0b0..d953d74 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 _0x4121=['moment','request-promise','path','rimraf','../../config/environment','./network.attributes','exports','define','network','lodash','util','api'];(function(_0x2d37b7,_0x3bf618){var _0x4dfbdb=function(_0x18fc40){while(--_0x18fc40){_0x2d37b7['push'](_0x2d37b7['shift']());}};_0x4dfbdb(++_0x3bf618);}(_0x4121,0xc9));var _0x1412=function(_0x30594d,_0x17fe54){_0x30594d=_0x30594d-0x0;var _0x27ce31=_0x4121[_0x30594d];return _0x27ce31;};'use strict';var _=require(_0x1412('0x0'));var util=require(_0x1412('0x1'));var logger=require('../../config/logger')(_0x1412('0x2'));var moment=require(_0x1412('0x3'));var BPromise=require('bluebird');var rp=require(_0x1412('0x4'));var fs=require('fs');var path=require(_0x1412('0x5'));var rimraf=require(_0x1412('0x6'));var config=require(_0x1412('0x7'));var attributes=require(_0x1412('0x8'));module[_0x1412('0x9')]=function(_0x230459,_0x3d1399){return _0x230459[_0x1412('0xa')]('Network',attributes,{'tableName':_0x1412('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x28ab=['network','lodash','../../config/logger','api','moment','bluebird','path','./network.attributes','exports','Network'];(function(_0x9861ff,_0x41fb17){var _0x48852b=function(_0x557001){while(--_0x557001){_0x9861ff['push'](_0x9861ff['shift']());}};_0x48852b(++_0x41fb17);}(_0x28ab,0xa1));var _0xb28a=function(_0x1c751c,_0x1f88ff){_0x1c751c=_0x1c751c-0x0;var _0x46cdce=_0x28ab[_0x1c751c];return _0x46cdce;};'use strict';var _=require(_0xb28a('0x0'));var util=require('util');var logger=require(_0xb28a('0x1'))(_0xb28a('0x2'));var moment=require(_0xb28a('0x3'));var BPromise=require(_0xb28a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb28a('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb28a('0x6'));module[_0xb28a('0x7')]=function(_0x56997c,_0x839740){return _0x56997c['define'](_0xb28a('0x8'),attributes,{'tableName':_0xb28a('0x9'),'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 82195f3..00aedb0 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 _0x209d=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird'];(function(_0xd27103,_0x3a94b){var _0x52d3f5=function(_0x21babf){while(--_0x21babf){_0xd27103['push'](_0xd27103['shift']());}};_0x52d3f5(++_0x3a94b);}(_0x209d,0x173));var _0xd209=function(_0xe4b531,_0x9a368b){_0xe4b531=_0xe4b531-0x0;var _0x1c9bba=_0x209d[_0xe4b531];return _0x1c9bba;};'use strict';var _=require(_0xd209('0x0'));var util=require(_0xd209('0x1'));var moment=require('moment');var BPromise=require(_0xd209('0x2'));var rs=require(_0xd209('0x3'));var fs=require('fs');var Redis=require(_0xd209('0x4'));var db=require(_0xd209('0x5'))['db'];var utils=require(_0xd209('0x6'));var logger=require(_0xd209('0x7'))('rpc');var config=require(_0xd209('0x8'));var jayson=require(_0xd209('0x9'));var client=jayson['client'][_0xd209('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c596f,_0x367b8b,_0x53986a){return new BPromise(function(_0x232729,_0x16ca0f){return client['request'](_0x1c596f,_0x53986a)[_0xd209('0xb')](function(_0x20a0d3){logger[_0xd209('0xc')](_0xd209('0xd'),_0x367b8b,_0xd209('0xe'));logger[_0xd209('0xf')](_0xd209('0x10'),_0x367b8b,_0xd209('0xe'),JSON[_0xd209('0x11')](_0x20a0d3));if(_0x20a0d3[_0xd209('0x12')]){if(_0x20a0d3['error'][_0xd209('0x13')]===0x1f4){logger[_0xd209('0x12')](_0xd209('0xd'),_0x367b8b,_0x20a0d3[_0xd209('0x12')]['message']);return _0x16ca0f(_0x20a0d3[_0xd209('0x12')][_0xd209('0x14')]);}logger[_0xd209('0x12')](_0xd209('0xd'),_0x367b8b,_0x20a0d3[_0xd209('0x12')][_0xd209('0x14')]);return _0x232729(_0x20a0d3[_0xd209('0x12')][_0xd209('0x14')]);}else{logger[_0xd209('0xc')](_0xd209('0xd'),_0x367b8b,_0xd209('0xe'));_0x232729(_0x20a0d3[_0xd209('0x15')][_0xd209('0x14')]);}})['catch'](function(_0x85efb6){logger[_0xd209('0x12')]('Network,\x20%s,\x20%s',_0x367b8b,_0x85efb6);_0x16ca0f(_0x85efb6);});});} \ No newline at end of file +var _0x645e=['stringify','error','code','message','result','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s'];(function(_0x30b710,_0x4477d1){var _0x205edf=function(_0x4e02cc){while(--_0x4e02cc){_0x30b710['push'](_0x30b710['shift']());}};_0x205edf(++_0x4477d1);}(_0x645e,0x14f));var _0xe645=function(_0x34c4c1,_0x13f3b4){_0x34c4c1=_0x34c4c1-0x0;var _0x2fa6b4=_0x645e[_0x34c4c1];return _0x2fa6b4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe645('0x0'));var BPromise=require('bluebird');var rs=require(_0xe645('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe645('0x2'))['db'];var utils=require(_0xe645('0x3'));var logger=require(_0xe645('0x4'))(_0xe645('0x5'));var config=require(_0xe645('0x6'));var jayson=require(_0xe645('0x7'));var client=jayson[_0xe645('0x8')][_0xe645('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x417580,_0x1bd9a6,_0x165c13){return new BPromise(function(_0x4e54cf,_0x502b98){return client[_0xe645('0xa')](_0x417580,_0x165c13)[_0xe645('0xb')](function(_0x4ab7ff){logger[_0xe645('0xc')](_0xe645('0xd'),_0x1bd9a6,_0xe645('0xe'));logger[_0xe645('0xf')](_0xe645('0x10'),_0x1bd9a6,_0xe645('0xe'),JSON[_0xe645('0x11')](_0x4ab7ff));if(_0x4ab7ff[_0xe645('0x12')]){if(_0x4ab7ff['error'][_0xe645('0x13')]===0x1f4){logger['error'](_0xe645('0xd'),_0x1bd9a6,_0x4ab7ff['error']['message']);return _0x502b98(_0x4ab7ff['error']['message']);}logger['error'](_0xe645('0xd'),_0x1bd9a6,_0x4ab7ff[_0xe645('0x12')]['message']);return _0x4e54cf(_0x4ab7ff[_0xe645('0x12')][_0xe645('0x14')]);}else{logger['info'](_0xe645('0xd'),_0x1bd9a6,_0xe645('0xe'));_0x4e54cf(_0x4ab7ff[_0xe645('0x15')]['message']);}})['catch'](function(_0x5bc053){logger[_0xe645('0x12')](_0xe645('0xd'),_0x1bd9a6,_0x5bc053);_0x502b98(_0x5bc053);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index a7b37cd..054a80e 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 _0x7115=['multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','/:id','/:id/dispositions','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','post','create','addDisposition','/:id/canned_answers','addAnswer','/:id/notify','notify','addApplications','/:id/users','addAgents','/:id/send','send','update','delete','destroy','removeDispositions','removeAnswers','removeAgents'];(function(_0x229ba7,_0x23aff8){var _0x5bae2c=function(_0x2c2ce3){while(--_0x2c2ce3){_0x229ba7['push'](_0x229ba7['shift']());}};_0x5bae2c(++_0x23aff8);}(_0x7115,0x98));var _0x5711=function(_0x44b978,_0xc8ecf4){_0x44b978=_0x44b978-0x0;var _0x5cf7dd=_0x7115[_0x44b978];return _0x5cf7dd;};'use strict';var multer=require(_0x5711('0x0'));var util=require(_0x5711('0x1'));var path=require(_0x5711('0x2'));var timeout=require('connect-timeout');var express=require(_0x5711('0x3'));var router=express[_0x5711('0x4')]();var auth=require(_0x5711('0x5'));var interaction=require(_0x5711('0x6'));var config=require(_0x5711('0x7'));var controller=require(_0x5711('0x8'));router[_0x5711('0x9')]('/',auth[_0x5711('0xa')](),controller[_0x5711('0xb')]);router[_0x5711('0x9')](_0x5711('0xc'),auth[_0x5711('0xa')](),controller['describe']);router['get'](_0x5711('0xd'),auth[_0x5711('0xa')](),controller['show']);router['get'](_0x5711('0xe'),auth[_0x5711('0xa')](),controller['getDispositions']);router[_0x5711('0x9')]('/:id/canned_answers',auth[_0x5711('0xa')](),controller[_0x5711('0xf')]);router[_0x5711('0x9')](_0x5711('0x10'),auth[_0x5711('0xa')](),controller[_0x5711('0x11')]);router[_0x5711('0x9')](_0x5711('0x12'),auth[_0x5711('0xa')](),controller[_0x5711('0x13')]);router[_0x5711('0x9')]('/:id/users',auth[_0x5711('0xa')](),controller['getAgents']);router[_0x5711('0x14')]('/',auth[_0x5711('0xa')](),controller[_0x5711('0x15')]);router[_0x5711('0x14')](_0x5711('0xe'),auth[_0x5711('0xa')](),controller[_0x5711('0x16')]);router[_0x5711('0x14')](_0x5711('0x17'),auth['isAuthenticated'](),controller[_0x5711('0x18')]);router[_0x5711('0x14')](_0x5711('0x19'),controller[_0x5711('0x1a')]);router[_0x5711('0x14')](_0x5711('0x10'),auth['isAuthenticated'](),controller[_0x5711('0x1b')]);router['post'](_0x5711('0x1c'),auth[_0x5711('0xa')](),controller[_0x5711('0x1d')]);router[_0x5711('0x14')](_0x5711('0x1e'),auth[_0x5711('0xa')](),controller[_0x5711('0x1f')]);router['put'](_0x5711('0xd'),auth[_0x5711('0xa')](),controller[_0x5711('0x20')]);router[_0x5711('0x21')]('/:id',auth[_0x5711('0xa')](),controller[_0x5711('0x22')]);router['delete'](_0x5711('0xe'),auth[_0x5711('0xa')](),controller[_0x5711('0x23')]);router['delete'](_0x5711('0x17'),auth[_0x5711('0xa')](),controller[_0x5711('0x24')]);router[_0x5711('0x21')](_0x5711('0x1c'),auth['isAuthenticated'](),controller[_0x5711('0x25')]);module['exports']=router; \ No newline at end of file +var _0x00f1=['/:id/applications','getApplications','getInteractions','getAgents','post','create','/:id/notify','notify','addApplications','/:id/users','addAgents','/:id/send','send','update','delete','destroy','removeDispositions','removeAgents','util','path','express','Router','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0x00f1,0xd2));var _0x100f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x00f1[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x100f('0x0'));var path=require(_0x100f('0x1'));var timeout=require('connect-timeout');var express=require(_0x100f('0x2'));var router=express[_0x100f('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x100f('0x4'));var controller=require(_0x100f('0x5'));router[_0x100f('0x6')]('/',auth[_0x100f('0x7')](),controller['index']);router['get'](_0x100f('0x8'),auth[_0x100f('0x7')](),controller['describe']);router[_0x100f('0x6')](_0x100f('0x9'),auth[_0x100f('0x7')](),controller[_0x100f('0xa')]);router[_0x100f('0x6')](_0x100f('0xb'),auth[_0x100f('0x7')](),controller[_0x100f('0xc')]);router[_0x100f('0x6')](_0x100f('0xd'),auth[_0x100f('0x7')](),controller['getAnswers']);router[_0x100f('0x6')](_0x100f('0xe'),auth[_0x100f('0x7')](),controller[_0x100f('0xf')]);router['get']('/:id/interactions',auth[_0x100f('0x7')](),controller[_0x100f('0x10')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x100f('0x11')]);router[_0x100f('0x12')]('/',auth['isAuthenticated'](),controller[_0x100f('0x13')]);router[_0x100f('0x12')]('/:id/dispositions',auth['isAuthenticated'](),controller['addDisposition']);router[_0x100f('0x12')](_0x100f('0xd'),auth[_0x100f('0x7')](),controller['addAnswer']);router[_0x100f('0x12')](_0x100f('0x14'),controller[_0x100f('0x15')]);router[_0x100f('0x12')](_0x100f('0xe'),auth[_0x100f('0x7')](),controller[_0x100f('0x16')]);router['post'](_0x100f('0x17'),auth[_0x100f('0x7')](),controller[_0x100f('0x18')]);router[_0x100f('0x12')](_0x100f('0x19'),auth['isAuthenticated'](),controller[_0x100f('0x1a')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x100f('0x1b')]);router[_0x100f('0x1c')]('/:id',auth[_0x100f('0x7')](),controller[_0x100f('0x1d')]);router[_0x100f('0x1c')](_0x100f('0xb'),auth['isAuthenticated'](),controller[_0x100f('0x1e')]);router['delete'](_0x100f('0xd'),auth[_0x100f('0x7')](),controller['removeAnswers']);router[_0x100f('0x1c')](_0x100f('0x17'),auth[_0x100f('0x7')](),controller[_0x100f('0x1f')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 1f45ca4..fbc51c7 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 _0xb118=['exports','STRING','name','generate','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','randomstring'];(function(_0x35da21,_0x2b6442){var _0x4b69a6=function(_0xf9c0b3){while(--_0xf9c0b3){_0x35da21['push'](_0x35da21['shift']());}};_0x4b69a6(++_0x2b6442);}(_0xb118,0x194));var _0x8b11=function(_0x2fc1e0,_0x3a77a9){_0x2fc1e0=_0x2fc1e0-0x0;var _0x2f29e7=_0xb118[_0x2fc1e0];return _0x2f29e7;};'use strict';var Sequelize=require(_0x8b11('0x0'));var rs=require(_0x8b11('0x1'));module[_0x8b11('0x2')]={'name':{'type':Sequelize[_0x8b11('0x3')],'unique':_0x8b11('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x8b11('0x3')]},'token':{'type':Sequelize[_0x8b11('0x3')],'defaultValue':function(){return rs[_0x8b11('0x5')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x8b11('0x6')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x8b11('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8b11('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0x8b11('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8b11('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8b11('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8b11('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0x8b11('0x9')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x8b11('0xa'),'set':function(_0x4df3aa){if(!_0x4df3aa)this['setDataValue'](_0x8b11('0xb'),null);this[_0x8b11('0xc')](_0x8b11('0xd'),_0x4df3aa);}}}; \ No newline at end of file +var _0xca3d=['mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId'];(function(_0x988561,_0x1a93ff){var _0x1996be=function(_0x5501db){while(--_0x5501db){_0x988561['push'](_0x988561['shift']());}};_0x1996be(++_0x1a93ff);}(_0xca3d,0x1cf));var _0xdca3=function(_0x23f2a7,_0x3bc14f){_0x23f2a7=_0x23f2a7-0x0;var _0x547933=_0xca3d[_0x23f2a7];return _0x547933;};'use strict';var Sequelize=require(_0xdca3('0x0'));var rs=require(_0xdca3('0x1'));module[_0xdca3('0x2')]={'name':{'type':Sequelize[_0xdca3('0x3')],'unique':_0xdca3('0x4'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xdca3('0x5')]();}},'replyUri':{'type':Sequelize[_0xdca3('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xdca3('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xdca3('0x6')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xdca3('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xdca3('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xdca3('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xdca3('0x3')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xdca3('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xdca3('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xdca3('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0xdca3('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xdca3('0x7')],'defaultValue':![],'comment':_0xdca3('0xa'),'set':function(_0x31b718){if(!_0x31b718)this[_0xdca3('0xb')](_0xdca3('0xc'),null);this['setDataValue'](_0xdca3('0xd'),_0x31b718);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 96ee3c0..c0a4b60 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 _0x83de=['util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','redis','defaults','localhost','./openchannelAccount.socket','register','client','http','test','Sequelize','ValidationError','request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','get','OpenchannelAccounts','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','model','query','keys','intersection','fields','attributes','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','rows','show','params','filters','length','includeAll','include','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','OpnechannelAccountId','Disposition','getDispositions','findOne','hasOwnProperty','OpenchannelAccountId','findAll','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','notify','openchannel','CmContact','no\x20available\x20attributes','createdAt','updatedAt','ListId','from','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','OpenchannelApplication','account','applications','Applications','orderBy','firstName','threadId','OpenchannelInteraction','externalUrl','ContactId','contact','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','bulkCreate','getApplications','getInteractions','Contact','internal','color','tag','addAgents','spread','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','OpenchannelMessage','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x3c5650,_0x1d5407){var _0x46bb7f=function(_0x2b67f2){while(--_0x2b67f2){_0x3c5650['push'](_0x3c5650['shift']());}};_0x46bb7f(++_0x1d5407);}(_0x83de,0x15a));var _0xe83d=function(_0x2afac1,_0x6ee574){_0x2afac1=_0x2afac1-0x0;var _0x14d945=_0x83de[_0x2afac1];return _0x14d945;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe83d('0x0'));var rimraf=require(_0xe83d('0x1'));var zipdir=require(_0xe83d('0x2'));var jsonpatch=require(_0xe83d('0x3'));var rp=require('request-promise');var moment=require(_0xe83d('0x4'));var BPromise=require(_0xe83d('0x5'));var Mustache=require('mustache');var util=require(_0xe83d('0x6'));var path=require('path');var sox=require(_0xe83d('0x7'));var csv=require('to-csv');var ejs=require(_0xe83d('0x8'));var fs=require('fs');var _=require(_0xe83d('0x9'));var squel=require(_0xe83d('0xa'));var crypto=require(_0xe83d('0xb'));var jsforce=require(_0xe83d('0xc'));var deskjs=require(_0xe83d('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe83d('0xe'));var Redis=require(_0xe83d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe83d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe83d('0x11'));var logger=require(_0xe83d('0x12'))(_0xe83d('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xe83d('0x14')]=_[_0xe83d('0x15')](config[_0xe83d('0x14')],{'host':_0xe83d('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe83d('0x14')]));require(_0xe83d('0x17'))[_0xe83d('0x18')](socket);var jayson=require('jayson/promise');var client=jayson[_0xe83d('0x19')][_0xe83d('0x1a')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0xdd0778,_0x29271a,_0x439f2c){if(_0x439f2c){var _0x1b43b3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1b43b3[_0xe83d('0x1b')](_0x29271a)){return _0xdd0778;}else{throw new db[(_0xe83d('0x1c'))][(_0xe83d('0x1d'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0xdd0778;}}function respondWithRpcPromise(_0x19aec4,_0x1a0a80,_0x110827,_0x1ac1c1){return new BPromise(function(_0x5880bb,_0x8c1a69){var _0x2371a7=_0x1ac1c1||client;return _0x2371a7[_0xe83d('0x1e')](_0x19aec4,_0x110827)[_0xe83d('0x1f')](function(_0x1c7ad6){logger['info'](_0xe83d('0x20'),_0x1a0a80,_0xe83d('0x21'));logger['debug'](_0xe83d('0x22'),_0x1a0a80,'request\x20sent',JSON[_0xe83d('0x23')](_0x1c7ad6));if(_0x1c7ad6[_0xe83d('0x24')]){if(_0x1c7ad6[_0xe83d('0x24')][_0xe83d('0x25')]===0x1f4){logger['error'](_0xe83d('0x20'),_0x1a0a80,_0x1c7ad6[_0xe83d('0x24')][_0xe83d('0x26')]);return _0x8c1a69(_0x1c7ad6['error'][_0xe83d('0x26')]);}logger[_0xe83d('0x24')](_0xe83d('0x20'),_0x1a0a80,_0x1c7ad6[_0xe83d('0x24')][_0xe83d('0x26')]);return _0x5880bb(_0x1c7ad6['error']['message']);}else{logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x1a0a80,_0xe83d('0x21'));_0x5880bb(_0x1c7ad6['result']['message']);}})[_0xe83d('0x27')](function(_0x574473){logger['error'](_0xe83d('0x20'),_0x1a0a80,_0x574473);_0x8c1a69(_0x574473);});});}function respondWithStatusCode(_0x4bcd69,_0x2fa04e){_0x2fa04e=_0x2fa04e||0xcc;return function(_0x4325ab){if(_0x4325ab){return _0x4bcd69['sendStatus'](_0x2fa04e);}return _0x4bcd69[_0xe83d('0x28')](_0x2fa04e)[_0xe83d('0x29')]();};}function respondWithResult(_0x743590,_0x4600f0){_0x4600f0=_0x4600f0||0xc8;return function(_0x1411b5){if(_0x1411b5){return _0x743590[_0xe83d('0x28')](_0x4600f0)[_0xe83d('0x2a')](_0x1411b5);}};}function respondWithFilteredResult(_0x18c53a,_0x30c162){return function(_0x302163){if(_0x302163){var _0x22023a=_0x302163[_0xe83d('0x2b')],_0xd7c722=_0x30c162[_0xe83d('0x2c')],_0x2d4ef2=_0x30c162['offset']+_0x30c162[_0xe83d('0x2d')],_0xdbe9bb;if(_0x2d4ef2>=_0x22023a){_0x2d4ef2=_0x22023a;_0xdbe9bb=0xc8;}else{_0xdbe9bb=0xce;}_0x18c53a[_0xe83d('0x28')](_0xdbe9bb);return _0x18c53a[_0xe83d('0x2e')](_0xe83d('0x2f'),_0xd7c722+'-'+_0x2d4ef2+'/'+_0x22023a)[_0xe83d('0x2a')](_0x302163);}return null;};}function patchUpdates(_0x3442d8){return function(_0x1768b8){try{jsonpatch[_0xe83d('0x30')](_0x1768b8,_0x3442d8,!![]);}catch(_0x37f6f6){return BPromise[_0xe83d('0x31')](_0x37f6f6);}return _0x1768b8['save']();};}function saveUpdates(_0x408d6c,_0x4c546f){return function(_0x469c92){if(_0x469c92){return _0x469c92[_0xe83d('0x32')](_0x408d6c)['then'](function(_0x4f9b6f){return _0x4f9b6f;});}return null;};}function removeEntity(_0xe2098,_0x17c424){return function(_0x3f3b93){if(_0x3f3b93){return _0x3f3b93[_0xe83d('0x33')]()['then'](function(){var _0x1a1ce0=_0x3f3b93[_0xe83d('0x34')]({'plain':!![]});var _0x15cf40=_0xe83d('0x35');return db['UserProfileResource'][_0xe83d('0x33')]({'where':{'type':_0x15cf40,'resourceId':_0x1a1ce0['id']}})[_0xe83d('0x1f')](function(){return _0x3f3b93;});})[_0xe83d('0x1f')](function(){_0xe2098['status'](0xcc)[_0xe83d('0x29')]();});}};}function handleEntityNotFound(_0x1a7f42,_0x470782){return function(_0x35335b){if(!_0x35335b){_0x1a7f42[_0xe83d('0x36')](0x194);}return _0x35335b;};}function handleError(_0x16338c,_0x15e06d){_0x15e06d=_0x15e06d||0x1f4;return function(_0x3e7aee){logger[_0xe83d('0x24')](_0x3e7aee[_0xe83d('0x37')]);if(_0x3e7aee[_0xe83d('0x38')]){delete _0x3e7aee[_0xe83d('0x38')];}_0x16338c[_0xe83d('0x28')](_0x15e06d)[_0xe83d('0x39')](_0x3e7aee);};}exports[_0xe83d('0x3a')]=function(_0x3c0c2d,_0x45ce5d){var _0x1c5009={'include':[{'model':db[_0xe83d('0x3b')],'as':_0xe83d('0x3c')}]},_0x2642e4={},_0x595694={'count':0x0,'rows':[]};var _0x214c62=_[_0xe83d('0x3d')](db[_0xe83d('0x3e')][_0xe83d('0x3f')],function(_0x57fec2){return{'name':_0x57fec2[_0xe83d('0x40')],'type':_0x57fec2['type']['key']};});_0x2642e4[_0xe83d('0x41')]=_[_0xe83d('0x3d')](_0x214c62,'name');_0x2642e4[_0xe83d('0x42')]=_[_0xe83d('0x43')](_0x3c0c2d[_0xe83d('0x42')]);_0x2642e4['filters']=_[_0xe83d('0x44')](_0x2642e4[_0xe83d('0x41')],_0x2642e4[_0xe83d('0x42')]);_0x1c5009['attributes']=_[_0xe83d('0x44')](_0x2642e4['model'],qs[_0xe83d('0x45')](_0x3c0c2d[_0xe83d('0x42')][_0xe83d('0x45')]));_0x1c5009[_0xe83d('0x46')]=_0x1c5009['attributes']['length']?_0x1c5009[_0xe83d('0x46')]:_0x2642e4[_0xe83d('0x41')];if(!_0x3c0c2d[_0xe83d('0x42')]['hasOwnProperty'](_0xe83d('0x47'))){_0x1c5009[_0xe83d('0x2d')]=qs['limit'](_0x3c0c2d[_0xe83d('0x42')][_0xe83d('0x2d')]);_0x1c5009[_0xe83d('0x2c')]=qs[_0xe83d('0x2c')](_0x3c0c2d[_0xe83d('0x42')][_0xe83d('0x2c')]);}_0x1c5009[_0xe83d('0x48')]=qs[_0xe83d('0x49')](_0x3c0c2d[_0xe83d('0x42')][_0xe83d('0x49')]);_0x1c5009[_0xe83d('0x4a')]=qs['filters'](_[_0xe83d('0x4b')](_0x3c0c2d['query'],_0x2642e4['filters']));if(_0x3c0c2d[_0xe83d('0x42')]['filter']){_0x1c5009[_0xe83d('0x4a')]=_[_0xe83d('0x4c')](_0x1c5009[_0xe83d('0x4a')],{'$or':_['map'](_0x214c62,function(_0x2657a2){if(_0x2657a2[_0xe83d('0x4d')]!==_0xe83d('0x4e')){var _0x63290e={};_0x63290e[_0x2657a2[_0xe83d('0x38')]]={'$like':'%'+_0x3c0c2d[_0xe83d('0x42')][_0xe83d('0x4f')]+'%'};return _0x63290e;}})});}_0x1c5009=_['merge']({},_0x1c5009,_0x3c0c2d['options']);var _0x4c5079={'where':_0x1c5009[_0xe83d('0x4a')]};return db[_0xe83d('0x3e')]['count'](_0x4c5079)['then'](function(_0x28c1e4){_0x595694[_0xe83d('0x2b')]=_0x28c1e4;if(_0x3c0c2d[_0xe83d('0x42')]['includeAll']){_0x1c5009['include']=[{'all':!![]}];}return db[_0xe83d('0x3e')]['findAll'](_0x1c5009);})[_0xe83d('0x1f')](function(_0x4db739){_0x595694[_0xe83d('0x50')]=_0x4db739;return _0x595694;})[_0xe83d('0x1f')](respondWithFilteredResult(_0x45ce5d,_0x1c5009))[_0xe83d('0x27')](handleError(_0x45ce5d,null));};exports[_0xe83d('0x51')]=function(_0x1e9775,_0x8c1ebe){var _0x3cbddd={'raw':![],'where':{'id':_0x1e9775[_0xe83d('0x52')]['id']},'include':[{'model':db[_0xe83d('0x3b')],'as':'mandatoryDispositionPause'}]},_0x5c6122={};_0x5c6122['model']=_[_0xe83d('0x43')](db[_0xe83d('0x3e')][_0xe83d('0x3f')]);_0x5c6122[_0xe83d('0x42')]=_[_0xe83d('0x43')](_0x1e9775[_0xe83d('0x42')]);_0x5c6122[_0xe83d('0x53')]=_['intersection'](_0x5c6122[_0xe83d('0x41')],_0x5c6122['query']);_0x3cbddd[_0xe83d('0x46')]=_[_0xe83d('0x44')](_0x5c6122[_0xe83d('0x41')],qs[_0xe83d('0x45')](_0x1e9775[_0xe83d('0x42')][_0xe83d('0x45')]));_0x3cbddd['attributes']=_0x3cbddd['attributes'][_0xe83d('0x54')]?_0x3cbddd[_0xe83d('0x46')]:_0x5c6122[_0xe83d('0x41')];if(_0x1e9775[_0xe83d('0x42')][_0xe83d('0x55')]){_0x3cbddd[_0xe83d('0x56')]=[{'all':!![]}];}_0x3cbddd=_[_0xe83d('0x4c')]({},_0x3cbddd,_0x1e9775[_0xe83d('0x57')]);return db['OpenchannelAccount']['find'](_0x3cbddd)['then'](handleEntityNotFound(_0x8c1ebe,null))['then'](respondWithResult(_0x8c1ebe,null))['catch'](handleError(_0x8c1ebe,null));};exports[_0xe83d('0x58')]=function(_0x1cdfbb,_0xbc6850){return db['OpenchannelAccount'][_0xe83d('0x58')](_0x1cdfbb[_0xe83d('0x59')],{})[_0xe83d('0x1f')](function(_0x54fa7a){var _0x1bcb55=_0x1cdfbb['user'][_0xe83d('0x34')]({'plain':!![]});if(!_0x1bcb55)throw new Error(_0xe83d('0x5a'));if(_0x1bcb55[_0xe83d('0x5b')]===_0xe83d('0x5c')){var _0x107728=_0x54fa7a['get']({'plain':!![]});var _0x24b7c3='OpenchannelAccounts';return db[_0xe83d('0x5d')]['find']({'where':{'name':_0x24b7c3,'userProfileId':_0x1bcb55[_0xe83d('0x5e')]},'raw':!![]})[_0xe83d('0x1f')](function(_0x1a396e){if(_0x1a396e&&_0x1a396e[_0xe83d('0x5f')]===0x0){return db['UserProfileResource'][_0xe83d('0x58')]({'name':_0x107728['name'],'resourceId':_0x107728['id'],'type':_0x1a396e[_0xe83d('0x38')],'sectionId':_0x1a396e['id']},{})[_0xe83d('0x1f')](function(){return _0x54fa7a;});}else{return _0x54fa7a;}})[_0xe83d('0x27')](function(_0xf9c41c){logger[_0xe83d('0x24')](_0xe83d('0x60'),_0xf9c41c);throw _0xf9c41c;});}return _0x54fa7a;})[_0xe83d('0x1f')](respondWithResult(_0xbc6850,0xc9))['catch'](handleError(_0xbc6850,null));};exports[_0xe83d('0x32')]=function(_0x39e45a,_0x279e31){if(_0x39e45a[_0xe83d('0x59')]['id']){delete _0x39e45a[_0xe83d('0x59')]['id'];}return db[_0xe83d('0x3e')][_0xe83d('0x61')]({'where':{'id':_0x39e45a[_0xe83d('0x52')]['id']},'include':[{'model':db[_0xe83d('0x3b')],'as':_0xe83d('0x3c')}]})[_0xe83d('0x1f')](handleEntityNotFound(_0x279e31,null))['then'](saveUpdates(_0x39e45a[_0xe83d('0x59')],null))[_0xe83d('0x1f')](respondWithResult(_0x279e31,null))[_0xe83d('0x27')](handleError(_0x279e31,null));};exports['destroy']=function(_0x321c6a,_0x17d828){return db[_0xe83d('0x3e')][_0xe83d('0x61')]({'where':{'id':_0x321c6a[_0xe83d('0x52')]['id']}})['then'](handleEntityNotFound(_0x17d828,null))['then'](removeEntity(_0x17d828,null))[_0xe83d('0x27')](handleError(_0x17d828,null));};exports[_0xe83d('0x62')]=function(_0x17fe3c,_0xa1fc15){return db[_0xe83d('0x3e')][_0xe83d('0x62')]()[_0xe83d('0x1f')](respondWithResult(_0xa1fc15,null))[_0xe83d('0x27')](handleError(_0xa1fc15,null));};exports['addDisposition']=function(_0x327222,_0x1e160d,_0x1bbe00){if(_0x327222[_0xe83d('0x59')]['id']){delete _0x327222[_0xe83d('0x59')]['id'];}return db[_0xe83d('0x3e')][_0xe83d('0x61')]({'where':{'id':_0x327222['params']['id']}})[_0xe83d('0x1f')](handleEntityNotFound(_0x1e160d,null))['then'](function(_0x5a1571){if(_0x5a1571){_0x327222[_0xe83d('0x59')][_0xe83d('0x63')]=_0x5a1571['id'];return db[_0xe83d('0x64')][_0xe83d('0x58')](_0x327222['body']);}})[_0xe83d('0x1f')](respondWithResult(_0x1e160d,null))[_0xe83d('0x27')](handleError(_0x1e160d,null));};exports[_0xe83d('0x65')]=function(_0x2510ca,_0x411241,_0x4223f7){var _0x3d6f23={'raw':![],'where':{}};var _0x29c1f1={};var _0x3526fb={'count':0x0,'rows':[]};return db[_0xe83d('0x3e')][_0xe83d('0x66')]({'where':{'id':_0x2510ca[_0xe83d('0x52')]['id']}})[_0xe83d('0x1f')](handleEntityNotFound(_0x411241,null))[_0xe83d('0x1f')](function(_0x1b9adb){if(_0x1b9adb){_0x29c1f1[_0xe83d('0x41')]=_[_0xe83d('0x43')](db['Disposition'][_0xe83d('0x3f')]);_0x29c1f1[_0xe83d('0x42')]=_[_0xe83d('0x43')](_0x2510ca[_0xe83d('0x42')]);_0x29c1f1['filters']=_[_0xe83d('0x44')](_0x29c1f1['model'],_0x29c1f1['query']);_0x3d6f23[_0xe83d('0x46')]=_[_0xe83d('0x44')](_0x29c1f1['model'],qs[_0xe83d('0x45')](_0x2510ca[_0xe83d('0x42')][_0xe83d('0x45')]));_0x3d6f23[_0xe83d('0x46')]=_0x3d6f23[_0xe83d('0x46')][_0xe83d('0x54')]?_0x3d6f23[_0xe83d('0x46')]:_0x29c1f1[_0xe83d('0x41')];if(!_0x2510ca[_0xe83d('0x42')][_0xe83d('0x67')](_0xe83d('0x47'))){_0x3d6f23[_0xe83d('0x2d')]=qs[_0xe83d('0x2d')](_0x2510ca['query'][_0xe83d('0x2d')]);_0x3d6f23['offset']=qs[_0xe83d('0x2c')](_0x2510ca[_0xe83d('0x42')]['offset']);}_0x3d6f23[_0xe83d('0x48')]=qs[_0xe83d('0x49')](_0x2510ca[_0xe83d('0x42')][_0xe83d('0x49')]);_0x3d6f23['where']=qs[_0xe83d('0x53')](_['pick'](_0x2510ca[_0xe83d('0x42')],_0x29c1f1['filters']));_0x3d6f23['where'][_0xe83d('0x68')]=_0x1b9adb['id'];if(_0x2510ca['query'][_0xe83d('0x4f')]){_0x3d6f23[_0xe83d('0x4a')]=_[_0xe83d('0x4c')](_0x3d6f23[_0xe83d('0x4a')],{'$or':_[_0xe83d('0x3d')](_0x3d6f23[_0xe83d('0x46')],function(_0xc1943a){var _0x120918={};_0x120918[_0xc1943a]={'$like':'%'+_0x2510ca[_0xe83d('0x42')]['filter']+'%'};return _0x120918;})});}_0x3d6f23=_[_0xe83d('0x4c')]({},_0x3d6f23,_0x2510ca[_0xe83d('0x57')]);return db[_0xe83d('0x64')]['count']({'where':_0x3d6f23['where']})[_0xe83d('0x1f')](function(_0x3ddf3d){_0x3526fb['count']=_0x3ddf3d;if(_0x2510ca[_0xe83d('0x42')]['includeAll']){_0x3d6f23['include']=[{'all':!![]}];}return db['Disposition'][_0xe83d('0x69')](_0x3d6f23);})['then'](function(_0x1954e1){_0x3526fb[_0xe83d('0x50')]=_0x1954e1;return _0x3526fb;});}})['then'](respondWithFilteredResult(_0x411241,_0x3d6f23))['catch'](handleError(_0x411241,null));};exports['removeDispositions']=function(_0x4335aa,_0x5f407e,_0x801ff3){return db[_0xe83d('0x3e')][_0xe83d('0x61')]({'where':{'id':_0x4335aa['params']['id']}})[_0xe83d('0x1f')](handleEntityNotFound(_0x5f407e,null))[_0xe83d('0x1f')](function(_0x5a6707){if(_0x5a6707){return _0x5a6707['removeDispositions'](_0x4335aa['query']['ids']);}})[_0xe83d('0x1f')](respondWithStatusCode(_0x5f407e,null))[_0xe83d('0x27')](handleError(_0x5f407e,null));};exports[_0xe83d('0x6a')]=function(_0x45a92b,_0x318831,_0x6de445){if(_0x45a92b[_0xe83d('0x59')]['id']){delete _0x45a92b[_0xe83d('0x59')]['id'];}return db[_0xe83d('0x3e')]['find']({'where':{'id':_0x45a92b[_0xe83d('0x52')]['id']}})[_0xe83d('0x1f')](handleEntityNotFound(_0x318831,null))[_0xe83d('0x1f')](function(_0xcf27e9){if(_0xcf27e9){_0x45a92b[_0xe83d('0x59')]['OpenchannelAccountId']=_0xcf27e9['id'];return db[_0xe83d('0x6b')][_0xe83d('0x58')](_0x45a92b[_0xe83d('0x59')]);}})[_0xe83d('0x1f')](respondWithResult(_0x318831,null))[_0xe83d('0x27')](handleError(_0x318831,null));};exports[_0xe83d('0x6c')]=function(_0x28b325,_0x1fa8c6,_0x5abd01){var _0x19df56={'raw':![],'where':{}};var _0x24ac30={};var _0x5a8e30={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xe83d('0x66')]({'where':{'id':_0x28b325[_0xe83d('0x52')]['id']}})[_0xe83d('0x1f')](handleEntityNotFound(_0x1fa8c6,null))[_0xe83d('0x1f')](function(_0x5294f4){if(_0x5294f4){_0x24ac30[_0xe83d('0x41')]=_[_0xe83d('0x43')](db[_0xe83d('0x6b')]['rawAttributes']);_0x24ac30['query']=_[_0xe83d('0x43')](_0x28b325[_0xe83d('0x42')]);_0x24ac30[_0xe83d('0x53')]=_['intersection'](_0x24ac30[_0xe83d('0x41')],_0x24ac30[_0xe83d('0x42')]);_0x19df56[_0xe83d('0x46')]=_[_0xe83d('0x44')](_0x24ac30['model'],qs[_0xe83d('0x45')](_0x28b325['query'][_0xe83d('0x45')]));_0x19df56[_0xe83d('0x46')]=_0x19df56['attributes'][_0xe83d('0x54')]?_0x19df56[_0xe83d('0x46')]:_0x24ac30['model'];if(!_0x28b325[_0xe83d('0x42')]['hasOwnProperty']('nolimit')){_0x19df56[_0xe83d('0x2d')]=qs['limit'](_0x28b325[_0xe83d('0x42')][_0xe83d('0x2d')]);_0x19df56[_0xe83d('0x2c')]=qs[_0xe83d('0x2c')](_0x28b325[_0xe83d('0x42')]['offset']);}_0x19df56['order']=qs[_0xe83d('0x49')](_0x28b325[_0xe83d('0x42')][_0xe83d('0x49')]);_0x19df56[_0xe83d('0x4a')]=qs[_0xe83d('0x53')](_['pick'](_0x28b325[_0xe83d('0x42')],_0x24ac30[_0xe83d('0x53')]));_0x19df56[_0xe83d('0x4a')][_0xe83d('0x68')]=_0x5294f4['id'];if(_0x28b325['query'][_0xe83d('0x4f')]){_0x19df56[_0xe83d('0x4a')]=_[_0xe83d('0x4c')](_0x19df56[_0xe83d('0x4a')],{'$or':_[_0xe83d('0x3d')](_0x19df56[_0xe83d('0x46')],function(_0x3e46c1){var _0x153ae7={};_0x153ae7[_0x3e46c1]={'$like':'%'+_0x28b325[_0xe83d('0x42')][_0xe83d('0x4f')]+'%'};return _0x153ae7;})});}_0x19df56=_[_0xe83d('0x4c')]({},_0x19df56,_0x28b325[_0xe83d('0x57')]);return db[_0xe83d('0x6b')]['count']({'where':_0x19df56[_0xe83d('0x4a')]})[_0xe83d('0x1f')](function(_0x3ccaac){_0x5a8e30['count']=_0x3ccaac;if(_0x28b325[_0xe83d('0x42')]['includeAll']){_0x19df56[_0xe83d('0x56')]=[{'all':!![]}];}return db[_0xe83d('0x6b')][_0xe83d('0x69')](_0x19df56);})[_0xe83d('0x1f')](function(_0x21fd4d){_0x5a8e30[_0xe83d('0x50')]=_0x21fd4d;return _0x5a8e30;});}})['then'](respondWithFilteredResult(_0x1fa8c6,_0x19df56))[_0xe83d('0x27')](handleError(_0x1fa8c6,null));};exports[_0xe83d('0x6d')]=function(_0x4ca47d,_0x31cec0,_0x13e776){return db[_0xe83d('0x3e')][_0xe83d('0x61')]({'where':{'id':_0x4ca47d[_0xe83d('0x52')]['id']}})[_0xe83d('0x1f')](handleEntityNotFound(_0x31cec0,null))[_0xe83d('0x1f')](function(_0x2f4ed5){if(_0x2f4ed5){return _0x2f4ed5[_0xe83d('0x6d')](_0x4ca47d['query'][_0xe83d('0x6e')]);}})[_0xe83d('0x1f')](respondWithStatusCode(_0x31cec0,null))[_0xe83d('0x27')](handleError(_0x31cec0,null));};exports[_0xe83d('0x6f')]=function(_0x77fcf5,_0x1dc248,_0x5507e5){var _0x16c945={'body':_0x77fcf5[_0xe83d('0x59')],'channel':_0xe83d('0x70')};var _0x54e5c1=[];var _0xc4858=[];var _0x254d3c={};var _0xdff8e=![];return db[_0xe83d('0x71')][_0xe83d('0x62')]()[_0xe83d('0x1f')](function(_0x452b43){if(!_0x452b43){throw new db[(_0xe83d('0x1c'))]['ValidationError'](_0xe83d('0x72'));}_0x54e5c1=_['difference'](_[_0xe83d('0x43')](_0x452b43),[_0xe83d('0x73'),_0xe83d('0x74')]);_0xc4858=_['difference'](_['keys'](_0x452b43),[_0xe83d('0x73'),_0xe83d('0x74'),'CompanyId',_0xe83d('0x75')]);if(_0x77fcf5[_0xe83d('0x59')]['id']){delete _0x77fcf5[_0xe83d('0x59')]['id'];}if(_['isNil'](_0x77fcf5[_0xe83d('0x59')][_0xe83d('0x76')])){throw new db[(_0xe83d('0x1c'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0xe83d('0x77')](_0x77fcf5[_0xe83d('0x59')][_0xe83d('0x59')])||_0x77fcf5['body']['body']===''){throw new db[(_0xe83d('0x1c'))][(_0xe83d('0x1d'))](_0xe83d('0x78'));}if(_[_0xe83d('0x77')](_0x77fcf5[_0xe83d('0x59')][_0xe83d('0x79')])){throw new db[(_0xe83d('0x1c'))][(_0xe83d('0x1d'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xc4858);}if(!_['includes'](_0xc4858,_0x77fcf5[_0xe83d('0x59')][_0xe83d('0x79')])){throw new db['Sequelize']['ValidationError'](_0xe83d('0x7a')+_0xc4858);}_0x254d3c[_0x77fcf5[_0xe83d('0x59')]['mapKey']]=_0x77fcf5[_0xe83d('0x59')]['from'];})[_0xe83d('0x1f')](function(){return db[_0xe83d('0x3e')][_0xe83d('0x61')]({'where':{'id':_0x77fcf5[_0xe83d('0x52')]['id']},'include':[{'model':db[_0xe83d('0x7b')],'as':_0xe83d('0x7c'),'include':[{'model':db[_0xe83d('0x71')],'as':_0xe83d('0x7d'),'where':_0x254d3c,'limit':0x1,'order':[[_0xe83d('0x74'),_0xe83d('0x7e')]]}]},{'model':db[_0xe83d('0x7f')],'as':'Applications'}]});})[_0xe83d('0x1f')](handleEntityNotFound(_0x1dc248,null))[_0xe83d('0x1f')](function(_0x43ce8f){if(_0x43ce8f&&_0x43ce8f['List']){_0x16c945[_0xe83d('0x80')]=_0x43ce8f;_0x16c945[_0xe83d('0x81')]=_0x43ce8f[_0xe83d('0x82')];_0x16c945['list']=_0x43ce8f[_0xe83d('0x7c')];_0x16c945[_0xe83d('0x81')]=_[_0xe83d('0x83')](_0x16c945[_0xe83d('0x81')],['priority'],['asc']);if(_0x16c945['account'][_0xe83d('0x82')]){delete _0x16c945[_0xe83d('0x80')][_0xe83d('0x82')];}if(_0x16c945[_0xe83d('0x80')][_0xe83d('0x7c')]&&_0x16c945[_0xe83d('0x80')][_0xe83d('0x7c')][_0xe83d('0x7d')][_0xe83d('0x54')]){return _0x16c945[_0xe83d('0x80')]['List']['Contacts'][0x0];}var _0x2549cf=_[_0xe83d('0x15')](_0x77fcf5[_0xe83d('0x59')],{'firstName':_0x77fcf5[_0xe83d('0x59')]['from'],'ListId':_0x43ce8f[_0xe83d('0x75')]});_0x2549cf[_0x77fcf5[_0xe83d('0x59')]['mapKey']]=_0x77fcf5[_0xe83d('0x59')]['from'];return db[_0xe83d('0x71')]['create'](_0x2549cf,{'fields':_0x54e5c1,'raw':!![]});}})['then'](handleEntityNotFound(_0x1dc248,null))['then'](function(_0x10b33a){_0x16c945['contact']=_0x10b33a;if(_0x10b33a){var _0x213fc1={'ContactId':_0x10b33a['id'],'OpenchannelAccountId':_0x77fcf5[_0xe83d('0x52')]['id'],'from':(_0x10b33a[_0xe83d('0x84')]||'')+'\x20'+(_0x10b33a['lastName']||'')};var _0x41daf1={'OpenchannelAccountId':_0x77fcf5[_0xe83d('0x52')]['id'],'closed':![]};if(_0x77fcf5[_0xe83d('0x59')]['threadId']){_0x41daf1[_0xe83d('0x85')]=_0x77fcf5[_0xe83d('0x59')][_0xe83d('0x85')];return db[_0xe83d('0x86')]['find']({'where':_0x41daf1})[_0xe83d('0x1f')](function(_0x235b81){if(_0x235b81){return[_0x235b81,![]];}_0x213fc1[_0xe83d('0x85')]=_0x77fcf5[_0xe83d('0x59')][_0xe83d('0x85')];_0x213fc1[_0xe83d('0x87')]=_0x77fcf5[_0xe83d('0x59')][_0xe83d('0x87')];return db[_0xe83d('0x86')][_0xe83d('0x58')](_0x213fc1)[_0xe83d('0x1f')](function(_0xf02cf3){return[_0xf02cf3,!![]];});});}else{_0x41daf1[_0xe83d('0x85')]=null;}_0x41daf1[_0xe83d('0x88')]=_0x10b33a['id'];return db['OpenchannelInteraction'][_0xe83d('0x61')]({'where':_0x41daf1})[_0xe83d('0x1f')](function(_0x4f8ec3){if(_0x4f8ec3){return[_0x4f8ec3,![]];}return db['OpenchannelInteraction'][_0xe83d('0x58')](_0x213fc1)[_0xe83d('0x1f')](function(_0x2af540){return[_0x2af540,!![]];});});}})['spread'](function(_0x4c8b82,_0x517ded){if(_0x4c8b82){_0xdff8e=_0x517ded;if(!_0x517ded){var _0x307c9f={'from':(_0x16c945[_0xe83d('0x89')][_0xe83d('0x84')]||'')+'\x20'+(_0x16c945[_0xe83d('0x89')]['lastName']||'')};if(_0x77fcf5[_0xe83d('0x59')][_0xe83d('0x85')]&&_0x77fcf5[_0xe83d('0x59')][_0xe83d('0x8a')]&&_0x77fcf5[_0xe83d('0x59')][_0xe83d('0x85')]!=_0x77fcf5[_0xe83d('0x59')][_0xe83d('0x8a')]){_0x307c9f[_0xe83d('0x85')]=_0x77fcf5['body'][_0xe83d('0x8a')];}return _0x4c8b82['update'](_0x307c9f);}else{return _0x4c8b82;}}})['then'](function(_0x1ca952){_0x16c945[_0xe83d('0x8b')]=_0x1ca952['get']({'plain':!![]});_0x16c945[_0xe83d('0x8b')][_0xe83d('0x8c')]=_0xdff8e;if(_0x16c945['interaction'][_0xe83d('0x8c')]){if(_0x16c945[_0xe83d('0x80')][_0xe83d('0x8d')]){_0x16c945['applications'][_0xe83d('0x8e')]({'id':0x0,'priority':_0x16c945[_0xe83d('0x81')][_0xe83d('0x54')]+0x1,'app':_0xe83d('0x8f'),'appdata':_0xe83d('0x90'),'interval':_0xe83d('0x91')});}}return db['OpenchannelMessage'][_0xe83d('0x58')]({'body':_0x77fcf5[_0xe83d('0x59')][_0xe83d('0x59')],'OpenchannelAccountId':_0x77fcf5['params']['id'],'OpenchannelInteractionId':_0x1ca952['id'],'direction':'in','ContactId':_0x16c945[_0xe83d('0x89')]['id'],'AttachmentId':_0x77fcf5[_0xe83d('0x59')][_0xe83d('0x92')]});})[_0xe83d('0x1f')](function(_0x1aed92){_0x16c945[_0xe83d('0x26')]=_0x1aed92;if(_0x16c945[_0xe83d('0x8b')][_0xe83d('0x93')]){return db[_0xe83d('0x94')][_0xe83d('0x61')]({'attributes':['id',_0xe83d('0x38')],'where':{'id':_0x16c945[_0xe83d('0x8b')]['UserId']}})[_0xe83d('0x1f')](function(_0x8ad40d){if(_0x8ad40d){_0x16c945['applications'][_0xe83d('0x95')]({'id':0x0,'priority':0x0,'app':_0xe83d('0x96'),'appdata':_0x8ad40d[_0xe83d('0x38')]+','+(_0x16c945[_0xe83d('0x80')][_0xe83d('0x97')]||0xa),'interval':_0xe83d('0x91')});_0x16c945[_0xe83d('0x98')]=![];}return respondWithRpcPromise('Start','startRouting',_0x16c945);});}return respondWithRpcPromise(_0xe83d('0x99'),_0xe83d('0x9a'),_0x16c945);})[_0xe83d('0x1f')](function(_0x7b9a16){respondWithRpcPromise(_0xe83d('0x9b'),_0xe83d('0x9b'),{'event':_0xe83d('0x6f'),'message':_0x7b9a16},client9002);return _0x7b9a16;})[_0xe83d('0x1f')](respondWithResult(_0x1dc248,null))[_0xe83d('0x27')](handleError(_0x1dc248,null));};exports[_0xe83d('0x9c')]=function(_0x339895,_0x2a5fa2,_0xd01a07){return db['OpenchannelAccount'][_0xe83d('0x66')]({'where':{'id':_0x339895[_0xe83d('0x52')]['id']}})[_0xe83d('0x1f')](handleEntityNotFound(_0x2a5fa2,null))['then'](function(_0x56ea95){if(_0x56ea95){return db['sequelize']['transaction'](function(_0x115694){return db[_0xe83d('0x7f')][_0xe83d('0x33')]({'where':{'OpenchannelAccountId':_0x339895[_0xe83d('0x52')]['id']},'transaction':_0x115694})[_0xe83d('0x1f')](function(_0x4e6ff5){var _0x27b899=_[_0xe83d('0x3d')](_0x339895[_0xe83d('0x59')],function(_0x521721){_0x521721[_0xe83d('0x68')]=_0x339895[_0xe83d('0x52')]['id'];return _0x521721;});return db[_0xe83d('0x7f')][_0xe83d('0x9d')](_0x27b899,{'transaction':_0x115694});});})['then'](function(){return db['OpenchannelApplication']['findAndCountAll']({'where':{'OpenchannelAccountId':_0x339895['params']['id']},'order':'priority'});});}})[_0xe83d('0x1f')](respondWithResult(_0x2a5fa2,null))[_0xe83d('0x27')](handleError(_0x2a5fa2,null));};exports[_0xe83d('0x9e')]=function(_0x4fd8cf,_0x3ca9cd,_0x428269){var _0x40777f={};var _0x2358a6={};var _0x5a1799;var _0x52ffb2;return db[_0xe83d('0x3e')]['findOne']({'where':{'id':_0x4fd8cf[_0xe83d('0x52')]['id']}})[_0xe83d('0x1f')](handleEntityNotFound(_0x3ca9cd,null))[_0xe83d('0x1f')](function(_0x2a23bf){if(_0x2a23bf){_0x5a1799=_0x2a23bf;_0x2358a6[_0xe83d('0x41')]=_[_0xe83d('0x43')](db['OpenchannelApplication'][_0xe83d('0x3f')]);_0x2358a6[_0xe83d('0x42')]=_[_0xe83d('0x43')](_0x4fd8cf['query']);_0x2358a6[_0xe83d('0x53')]=_['intersection'](_0x2358a6['model'],_0x2358a6[_0xe83d('0x42')]);_0x40777f[_0xe83d('0x46')]=_[_0xe83d('0x44')](_0x2358a6['model'],qs[_0xe83d('0x45')](_0x4fd8cf['query']['fields']));_0x40777f[_0xe83d('0x46')]=_0x40777f[_0xe83d('0x46')][_0xe83d('0x54')]?_0x40777f[_0xe83d('0x46')]:_0x2358a6[_0xe83d('0x41')];_0x40777f[_0xe83d('0x48')]=qs['sort'](_0x4fd8cf['query'][_0xe83d('0x49')]);_0x40777f[_0xe83d('0x4a')]=qs[_0xe83d('0x53')](_[_0xe83d('0x4b')](_0x4fd8cf[_0xe83d('0x42')],_0x2358a6[_0xe83d('0x53')]));if(_0x4fd8cf['query'][_0xe83d('0x4f')]){_0x40777f[_0xe83d('0x4a')]=_['merge'](_0x40777f[_0xe83d('0x4a')],{'$or':_['map'](_0x40777f['attributes'],function(_0x4d6274){var _0x1fd0c1={};_0x1fd0c1[_0x4d6274]={'$like':'%'+_0x4fd8cf[_0xe83d('0x42')][_0xe83d('0x4f')]+'%'};return _0x1fd0c1;})});}_0x40777f=_[_0xe83d('0x4c')]({},_0x40777f,_0x4fd8cf[_0xe83d('0x57')]);return _0x5a1799[_0xe83d('0x9e')](_0x40777f);}})[_0xe83d('0x1f')](function(_0x5cf45b){if(_0x5cf45b){_0x52ffb2=_0x5cf45b['length'];if(!_0x4fd8cf[_0xe83d('0x42')][_0xe83d('0x67')]('nolimit')){_0x40777f['limit']=qs[_0xe83d('0x2d')](_0x4fd8cf['query'][_0xe83d('0x2d')]);_0x40777f[_0xe83d('0x2c')]=qs[_0xe83d('0x2c')](_0x4fd8cf['query'][_0xe83d('0x2c')]);}return _0x5a1799[_0xe83d('0x9e')](_0x40777f);}})['then'](function(_0x2fff31){if(_0x2fff31){return _0x2fff31?{'count':_0x52ffb2,'rows':_0x2fff31}:null;}})['then'](respondWithResult(_0x3ca9cd,null))[_0xe83d('0x27')](handleError(_0x3ca9cd,null));};exports[_0xe83d('0x9f')]=function(_0x15f7c6,_0x5521ea,_0x1e561b){var _0x254282={'raw':![],'where':{}};var _0x418f8d={};var _0x34bb42={'count':0x0,'rows':[]};return db[_0xe83d('0x3e')][_0xe83d('0x66')]({'where':{'id':_0x15f7c6[_0xe83d('0x52')]['id']}})[_0xe83d('0x1f')](handleEntityNotFound(_0x5521ea,null))[_0xe83d('0x1f')](function(_0x4afc11){if(_0x4afc11){_0x418f8d['model']=_[_0xe83d('0x43')](db[_0xe83d('0x86')][_0xe83d('0x3f')]);_0x418f8d[_0xe83d('0x42')]=_['keys'](_0x15f7c6[_0xe83d('0x42')]);_0x418f8d[_0xe83d('0x53')]=_['intersection'](_0x418f8d['model'],_0x418f8d[_0xe83d('0x42')]);_0x254282[_0xe83d('0x46')]=_[_0xe83d('0x44')](_0x418f8d[_0xe83d('0x41')],qs[_0xe83d('0x45')](_0x15f7c6['query'][_0xe83d('0x45')]));_0x254282[_0xe83d('0x46')]=_0x254282[_0xe83d('0x46')]['length']?_0x254282[_0xe83d('0x46')]:_0x418f8d[_0xe83d('0x41')];if(!_0x15f7c6[_0xe83d('0x42')][_0xe83d('0x67')](_0xe83d('0x47'))){_0x254282[_0xe83d('0x2d')]=qs['limit'](_0x15f7c6[_0xe83d('0x42')][_0xe83d('0x2d')]);_0x254282[_0xe83d('0x2c')]=qs[_0xe83d('0x2c')](_0x15f7c6[_0xe83d('0x42')]['offset']);}_0x254282[_0xe83d('0x48')]=qs[_0xe83d('0x49')](_0x15f7c6[_0xe83d('0x42')][_0xe83d('0x49')]);_0x254282[_0xe83d('0x4a')]=qs[_0xe83d('0x53')](_[_0xe83d('0x4b')](_0x15f7c6[_0xe83d('0x42')],_0x418f8d['filters']));_0x254282[_0xe83d('0x4a')]['OpenchannelAccountId']=_0x4afc11['id'];if(_0x15f7c6[_0xe83d('0x42')][_0xe83d('0x4f')]){_0x254282[_0xe83d('0x4a')]=_['merge'](_0x254282[_0xe83d('0x4a')],{'$or':_[_0xe83d('0x3d')](_0x254282[_0xe83d('0x46')],function(_0x1044ce){var _0x254e37={};_0x254e37[_0x1044ce]={'$like':'%'+_0x15f7c6[_0xe83d('0x42')][_0xe83d('0x4f')]+'%'};return _0x254e37;})});}_0x254282=_[_0xe83d('0x4c')]({},_0x254282,_0x15f7c6[_0xe83d('0x57')]);return db[_0xe83d('0x86')][_0xe83d('0x2b')]({'where':_0x254282[_0xe83d('0x4a')]})[_0xe83d('0x1f')](function(_0x8165ef){_0x34bb42[_0xe83d('0x2b')]=_0x8165ef;if(_0x15f7c6[_0xe83d('0x42')][_0xe83d('0x55')]){_0x254282[_0xe83d('0x56')]=[{'model':db[_0xe83d('0x71')],'as':_0xe83d('0xa0'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0xe83d('0x38'),'fullname',_0xe83d('0xa1')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xe83d('0x38'),_0xe83d('0xa2')],'where':_0x15f7c6['query'][_0xe83d('0xa3')]?{'id':_0x15f7c6[_0xe83d('0x42')][_0xe83d('0xa3')]}:undefined,'required':_0x15f7c6[_0xe83d('0x42')][_0xe83d('0xa3')]?!![]:![]}];}return db['OpenchannelInteraction'][_0xe83d('0x69')](_0x254282);})[_0xe83d('0x1f')](function(_0x404b8a){_0x34bb42[_0xe83d('0x50')]=_0x404b8a;return _0x34bb42;});}})[_0xe83d('0x1f')](respondWithFilteredResult(_0x5521ea,_0x254282))[_0xe83d('0x27')](handleError(_0x5521ea,null));};exports[_0xe83d('0xa4')]=function(_0x47a456,_0x17bdf1,_0x30cd43){return db[_0xe83d('0x3e')][_0xe83d('0x61')]({'where':{'id':_0x47a456[_0xe83d('0x52')]['id']}})['then'](handleEntityNotFound(_0x17bdf1,null))['then'](function(_0x57c615){if(_0x57c615){return _0x57c615[_0xe83d('0xa4')](_0x47a456['body'][_0xe83d('0x6e')],_['omit'](_0x47a456[_0xe83d('0x59')],[_0xe83d('0x6e'),'id'])||{})[_0xe83d('0xa5')](function(_0x38655b){for(var _0x42f438=0x0;_0x42f438<_0x47a456[_0xe83d('0x59')]['ids'][_0xe83d('0x54')];_0x42f438+=0x1){socket[_0xe83d('0xa6')](_0xe83d('0xa7'),{'UserId':_0x47a456[_0xe83d('0x59')][_0xe83d('0x6e')][_0x42f438],'OpenchannelAccountId':_0x47a456['params']['id']});}return _0x38655b;});}})[_0xe83d('0x1f')](respondWithResult(_0x17bdf1,null))['catch'](handleError(_0x17bdf1,null));};exports[_0xe83d('0xa8')]=function(_0x316b2d,_0x3f2fe7,_0x317a5c){return db[_0xe83d('0x3e')][_0xe83d('0x61')]({'where':{'id':_0x316b2d['params']['id']}})[_0xe83d('0x1f')](handleEntityNotFound(_0x3f2fe7,null))[_0xe83d('0x1f')](function(_0x59a551){if(_0x59a551){return _0x59a551[_0xe83d('0xa8')](_0x316b2d['query'][_0xe83d('0x6e')])[_0xe83d('0x1f')](function(){if(_[_0xe83d('0xa9')](_0x316b2d['query'][_0xe83d('0x6e')])){for(var _0xaec869=0x0;_0xaec869<_0x316b2d[_0xe83d('0x42')][_0xe83d('0x6e')][_0xe83d('0x54')];_0xaec869+=0x1){socket[_0xe83d('0xa6')](_0xe83d('0xaa'),{'UserId':Number(_0x316b2d['query'][_0xe83d('0x6e')][_0xaec869]),'OpenchannelAccountId':Number(_0x316b2d[_0xe83d('0x52')]['id'])});}}else{socket[_0xe83d('0xa6')]('userOpenchannelAccount:remove',{'UserId':Number(_0x316b2d[_0xe83d('0x42')][_0xe83d('0x6e')]),'OpenchannelAccountId':Number(_0x316b2d['params']['id'])});}});}})['then'](respondWithStatusCode(_0x3f2fe7,null))['catch'](handleError(_0x3f2fe7,null));};exports[_0xe83d('0xab')]=function(_0x35d59f,_0x502d2b,_0x32e4db){var _0x40336f={};var _0x2f4e7c={};var _0xd1e8c2;var _0x2c1a52;return db[_0xe83d('0x3e')][_0xe83d('0x66')]({'where':{'id':_0x35d59f[_0xe83d('0x52')]['id']}})['then'](handleEntityNotFound(_0x502d2b,null))['then'](function(_0x5b91cd){if(_0x5b91cd){_0xd1e8c2=_0x5b91cd;_0x2f4e7c[_0xe83d('0x41')]=_['keys'](db[_0xe83d('0x94')][_0xe83d('0x3f')]);_0x2f4e7c[_0xe83d('0x42')]=_[_0xe83d('0x43')](_0x35d59f[_0xe83d('0x42')]);_0x2f4e7c[_0xe83d('0x53')]=_['intersection'](_0x2f4e7c[_0xe83d('0x41')],_0x2f4e7c['query']);_0x40336f[_0xe83d('0x46')]=_['intersection'](_0x2f4e7c[_0xe83d('0x41')],qs[_0xe83d('0x45')](_0x35d59f[_0xe83d('0x42')][_0xe83d('0x45')]));_0x40336f['attributes']=_0x40336f[_0xe83d('0x46')][_0xe83d('0x54')]?_0x40336f['attributes']:_0x2f4e7c[_0xe83d('0x41')];_0x40336f['order']=qs[_0xe83d('0x49')](_0x35d59f[_0xe83d('0x42')][_0xe83d('0x49')]);_0x40336f['where']=qs['filters'](_[_0xe83d('0x4b')](_0x35d59f[_0xe83d('0x42')],_0x2f4e7c[_0xe83d('0x53')]));if(_0x35d59f[_0xe83d('0x42')][_0xe83d('0x4f')]){_0x40336f[_0xe83d('0x4a')]=_[_0xe83d('0x4c')](_0x40336f[_0xe83d('0x4a')],{'$or':_[_0xe83d('0x3d')](_0x40336f[_0xe83d('0x46')],function(_0x485ba6){var _0x5d04e6={};_0x5d04e6[_0x485ba6]={'$like':'%'+_0x35d59f[_0xe83d('0x42')]['filter']+'%'};return _0x5d04e6;})});}_0x40336f=_[_0xe83d('0x4c')]({},_0x40336f,_0x35d59f[_0xe83d('0x57')]);return _0xd1e8c2['getAgents'](_0x40336f);}})['then'](function(_0xb0557a){if(_0xb0557a){_0x2c1a52=_0xb0557a[_0xe83d('0x54')];if(!_0x35d59f[_0xe83d('0x42')][_0xe83d('0x67')](_0xe83d('0x47'))){_0x40336f[_0xe83d('0x2d')]=qs[_0xe83d('0x2d')](_0x35d59f['query']['limit']);_0x40336f[_0xe83d('0x2c')]=qs[_0xe83d('0x2c')](_0x35d59f['query'][_0xe83d('0x2c')]);}return _0xd1e8c2[_0xe83d('0xab')](_0x40336f);}})[_0xe83d('0x1f')](function(_0x3bb3e4){if(_0x3bb3e4){return _0x3bb3e4?{'count':_0x2c1a52,'rows':_0x3bb3e4}:null;}})[_0xe83d('0x1f')](respondWithResult(_0x502d2b,null))[_0xe83d('0x27')](handleError(_0x502d2b,null));};exports['send']=function(_0x41d99e,_0x2f9018,_0x5ce714){var _0x2ef484,_0x3bfa42,_0x54e72e;if(_[_0xe83d('0x77')](_0x41d99e[_0xe83d('0x59')][_0xe83d('0x59')])||_0x41d99e[_0xe83d('0x59')]['body']===''){throw new db['Sequelize'][(_0xe83d('0x1d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xe83d('0x77')](_0x41d99e['body']['to'])){}_0x2ef484=_0x41d99e[_0xe83d('0x59')]['to'];return db[_0xe83d('0x3e')][_0xe83d('0x66')]({'where':{'id':_0x41d99e['params']['id']}})['then'](handleEntityNotFound(_0x2f9018,null))['then'](function(_0x2bb9bf){if(_0x2bb9bf){return db['OpenchannelAccount'][_0xe83d('0x61')]({'where':{'id':_0x2bb9bf['id']},'include':[{'model':db['CmList'],'as':_0xe83d('0x7c'),'include':[{'model':db[_0xe83d('0x71')],'as':_0xe83d('0x7d'),'where':{[_0x2bb9bf[_0xe83d('0x79')]]:_0x2ef484},'limit':0x1,'order':[[_0xe83d('0x74'),_0xe83d('0x7e')]]}]}]})['then'](handleEntityNotFound(_0x2f9018,null))[_0xe83d('0x1f')](function(_0x25cf60){if(_0x25cf60&&_0x25cf60[_0xe83d('0x7c')]){_0x3bfa42=_0x25cf60[_0xe83d('0x34')]({'plain':!![]});if(_0x3bfa42[_0xe83d('0x7c')]&&_0x3bfa42[_0xe83d('0x7c')][_0xe83d('0x7d')]['length']){return _0x3bfa42[_0xe83d('0x7c')][_0xe83d('0x7d')][0x0];}return db[_0xe83d('0x71')][_0xe83d('0x58')](_[_0xe83d('0x15')](_0x41d99e[_0xe83d('0x59')],{'firstName':_0x2ef484,[_0x25cf60[_0xe83d('0x79')]]:_0x2ef484,'phone':_0x2ef484,'ListId':_0x3bfa42[_0xe83d('0x75')]}));}})[_0xe83d('0x1f')](handleEntityNotFound(_0x2f9018,null))[_0xe83d('0x1f')](function(_0x4cf79f){if(_0x4cf79f){_0x54e72e=_0x4cf79f;return db['OpenchannelInteraction']['find']({'where':{'ContactId':_0x54e72e['id'],'closed':![],'OpenchannelAccountId':_0x3bfa42['id']}})[_0xe83d('0x1f')](function(_0x1b14e0){if(_0x1b14e0){return[_0x1b14e0,![]];}return db[_0xe83d('0x86')][_0xe83d('0x58')]({'UserId':_0x41d99e['user']['id'],'ContactId':_0x54e72e['id'],'OpenchannelAccountId':_0x3bfa42['id'],'lastMsgDirection':_0xe83d('0xac'),'Messages':[_['merge'](_0x41d99e['body'],{'read':![],'body':_0x41d99e[_0xe83d('0x59')][_0xe83d('0x59')],'OpenchannelAccountId':_0x3bfa42['id'],'UserId':_0x41d99e[_0xe83d('0x5c')]['id'],'ContactId':_0x54e72e['id']})]},{'include':[{'model':db[_0xe83d('0xad')],'as':'Messages'}]})[_0xe83d('0x1f')](function(_0x29700c){return[_0x29700c,!![]];});});}})[_0xe83d('0xa5')](function(_0x44da48,_0x1ee18f){if(_0x1ee18f){return _0x44da48;}return db[_0xe83d('0xad')]['create'](_[_0xe83d('0x4c')](_0x41d99e[_0xe83d('0x59')],{'read':![],'body':_0x41d99e[_0xe83d('0x59')][_0xe83d('0x59')],'OpenchannelAccountId':_0x3bfa42['id'],'OpenchannelInteractionId':_0x44da48['id'],'UserId':_0x41d99e[_0xe83d('0x5c')]['id'],'ContactId':_0x54e72e['id']}))[_0xe83d('0x1f')](function(_0x3ee651){_0x44da48['dataValues'][_0xe83d('0xae')]=[];_0x44da48[_0xe83d('0xaf')]['Messages'][_0xe83d('0x8e')](_0x3ee651['dataValues']);return _0x44da48;});});}})[_0xe83d('0x1f')](respondWithResult(_0x2f9018,null))[_0xe83d('0x27')](handleError(_0x2f9018,null));}; \ No newline at end of file +var _0xf511=['rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','OpenchannelAccount','includeAll','include','findAll','catch','show','Pause','mandatoryDispositionPause','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelAccounts','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','addDisposition','OpnechannelAccountId','Disposition','getDispositions','findOne','OpenchannelAccountId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','rows','removeAnswers','notify','openchannel','CmContact','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','List','Contacts','DESC','OpenchannelApplication','Applications','account','applications','list','orderBy','priority','asc','mapKey','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','spread','messageId','interaction','autoclose','push','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','bulkCreate','findAndCountAll','getApplications','fullname','internal','Tags','color','tag','addAgents','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','OpenchannelMessage','Messages','dataValues','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','jayson/promise','client','http','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~!@#$%^&-_=+[{]}.','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','count','offset','limit','set','Content-Range','json','reject','save','destroy','get','stack','name','send','map'];(function(_0x955128,_0x589a5f){var _0xe8cec8=function(_0x4b791a){while(--_0x4b791a){_0x955128['push'](_0x955128['shift']());}};_0xe8cec8(++_0x589a5f);}(_0xf511,0x141));var _0x1f51=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xf511[_0x2b4411];return _0x8e41ef;};'use strict';var pdf=require(_0x1f51('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1f51('0x1'));var zipdir=require(_0x1f51('0x2'));var jsonpatch=require(_0x1f51('0x3'));var rp=require(_0x1f51('0x4'));var moment=require('moment');var BPromise=require(_0x1f51('0x5'));var Mustache=require(_0x1f51('0x6'));var util=require('util');var path=require(_0x1f51('0x7'));var sox=require('sox');var csv=require(_0x1f51('0x8'));var ejs=require(_0x1f51('0x9'));var fs=require('fs');var _=require(_0x1f51('0xa'));var squel=require(_0x1f51('0xb'));var crypto=require(_0x1f51('0xc'));var jsforce=require(_0x1f51('0xd'));var deskjs=require(_0x1f51('0xe'));var toCsv=require(_0x1f51('0x8'));var querystring=require(_0x1f51('0xf'));var Papa=require(_0x1f51('0x10'));var Redis=require(_0x1f51('0x11'));var authService=require(_0x1f51('0x12'));var qs=require(_0x1f51('0x13'));var as=require(_0x1f51('0x14'));var hardwareService=require(_0x1f51('0x15'));var logger=require(_0x1f51('0x16'))(_0x1f51('0x17'));var utils=require(_0x1f51('0x18'));var config=require(_0x1f51('0x19'));var db=require('../../mysqldb')['db'];config[_0x1f51('0x1a')]=_[_0x1f51('0x1b')](config['redis'],{'host':_0x1f51('0x1c'),'port':0x18eb});var socket=require(_0x1f51('0x1d'))(new Redis(config['redis']));require(_0x1f51('0x1e'))['register'](socket);var jayson=require(_0x1f51('0x1f'));var client=jayson[_0x1f51('0x20')][_0x1f51('0x21')]({'port':0x232c});var client9002=jayson[_0x1f51('0x20')][_0x1f51('0x21')]({'port':0x232a});function checkPasswordPattern(_0x54c558,_0x526bb3,_0x2762d2){if(_0x2762d2){var _0x2bb2eb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2bb2eb[_0x1f51('0x22')](_0x526bb3)){return _0x54c558;}else{throw new db[(_0x1f51('0x23'))]['ValidationError'](_0x1f51('0x24'));}}else{return _0x54c558;}}function respondWithRpcPromise(_0x17f216,_0x127d83,_0x517940,_0x3907be){return new BPromise(function(_0x4f67e3,_0x33d307){var _0x2a97a7=_0x3907be||client;return _0x2a97a7['request'](_0x17f216,_0x517940)[_0x1f51('0x25')](function(_0x2de338){logger['info'](_0x1f51('0x26'),_0x127d83,_0x1f51('0x27'));logger['debug'](_0x1f51('0x28'),_0x127d83,_0x1f51('0x27'),JSON[_0x1f51('0x29')](_0x2de338));if(_0x2de338[_0x1f51('0x2a')]){if(_0x2de338[_0x1f51('0x2a')][_0x1f51('0x2b')]===0x1f4){logger[_0x1f51('0x2a')](_0x1f51('0x26'),_0x127d83,_0x2de338['error'][_0x1f51('0x2c')]);return _0x33d307(_0x2de338[_0x1f51('0x2a')][_0x1f51('0x2c')]);}logger[_0x1f51('0x2a')]('OpenchannelAccount,\x20%s,\x20%s',_0x127d83,_0x2de338[_0x1f51('0x2a')][_0x1f51('0x2c')]);return _0x4f67e3(_0x2de338[_0x1f51('0x2a')][_0x1f51('0x2c')]);}else{logger['info'](_0x1f51('0x26'),_0x127d83,'request\x20sent');_0x4f67e3(_0x2de338[_0x1f51('0x2d')][_0x1f51('0x2c')]);}})['catch'](function(_0x1ba616){logger[_0x1f51('0x2a')](_0x1f51('0x26'),_0x127d83,_0x1ba616);_0x33d307(_0x1ba616);});});}function respondWithStatusCode(_0x2dd70b,_0x16ffe3){_0x16ffe3=_0x16ffe3||0xcc;return function(_0x27d585){if(_0x27d585){return _0x2dd70b[_0x1f51('0x2e')](_0x16ffe3);}return _0x2dd70b[_0x1f51('0x2f')](_0x16ffe3)[_0x1f51('0x30')]();};}function respondWithResult(_0xa0bdec,_0x268c7f){_0x268c7f=_0x268c7f||0xc8;return function(_0x478c08){if(_0x478c08){return _0xa0bdec[_0x1f51('0x2f')](_0x268c7f)['json'](_0x478c08);}};}function respondWithFilteredResult(_0x7a9dd7,_0x45bd33){return function(_0x1120ff){if(_0x1120ff){var _0xc12e91=_0x1120ff[_0x1f51('0x31')],_0x2983e2=_0x45bd33[_0x1f51('0x32')],_0x2f0eb2=_0x45bd33[_0x1f51('0x32')]+_0x45bd33[_0x1f51('0x33')],_0x4a5801;if(_0x2f0eb2>=_0xc12e91){_0x2f0eb2=_0xc12e91;_0x4a5801=0xc8;}else{_0x4a5801=0xce;}_0x7a9dd7[_0x1f51('0x2f')](_0x4a5801);return _0x7a9dd7[_0x1f51('0x34')](_0x1f51('0x35'),_0x2983e2+'-'+_0x2f0eb2+'/'+_0xc12e91)[_0x1f51('0x36')](_0x1120ff);}return null;};}function patchUpdates(_0x48d8a8){return function(_0x140326){try{jsonpatch['apply'](_0x140326,_0x48d8a8,!![]);}catch(_0x2970f4){return BPromise[_0x1f51('0x37')](_0x2970f4);}return _0x140326[_0x1f51('0x38')]();};}function saveUpdates(_0xe20816,_0xd112a9){return function(_0x446e8e){if(_0x446e8e){return _0x446e8e['update'](_0xe20816)[_0x1f51('0x25')](function(_0x4e1a3a){return _0x4e1a3a;});}return null;};}function removeEntity(_0x3792b6,_0x221299){return function(_0x1ba02d){if(_0x1ba02d){return _0x1ba02d[_0x1f51('0x39')]()[_0x1f51('0x25')](function(){var _0x3bd689=_0x1ba02d[_0x1f51('0x3a')]({'plain':!![]});var _0x582392='OpenchannelAccounts';return db['UserProfileResource'][_0x1f51('0x39')]({'where':{'type':_0x582392,'resourceId':_0x3bd689['id']}})['then'](function(){return _0x1ba02d;});})[_0x1f51('0x25')](function(){_0x3792b6['status'](0xcc)[_0x1f51('0x30')]();});}};}function handleEntityNotFound(_0x89b196,_0x2b5cc9){return function(_0x3f7d98){if(!_0x3f7d98){_0x89b196[_0x1f51('0x2e')](0x194);}return _0x3f7d98;};}function handleError(_0x1965fe,_0x490ce9){_0x490ce9=_0x490ce9||0x1f4;return function(_0x45f6b8){logger[_0x1f51('0x2a')](_0x45f6b8[_0x1f51('0x3b')]);if(_0x45f6b8[_0x1f51('0x3c')]){delete _0x45f6b8[_0x1f51('0x3c')];}_0x1965fe[_0x1f51('0x2f')](_0x490ce9)[_0x1f51('0x3d')](_0x45f6b8);};}exports['index']=function(_0x955538,_0xafc84){var _0x36c38d={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x20cb9e={},_0x5df435={'count':0x0,'rows':[]};var _0x25efa7=_[_0x1f51('0x3e')](db['OpenchannelAccount'][_0x1f51('0x3f')],function(_0x200557){return{'name':_0x200557[_0x1f51('0x40')],'type':_0x200557[_0x1f51('0x41')][_0x1f51('0x42')]};});_0x20cb9e[_0x1f51('0x43')]=_[_0x1f51('0x3e')](_0x25efa7,_0x1f51('0x3c'));_0x20cb9e[_0x1f51('0x44')]=_[_0x1f51('0x45')](_0x955538[_0x1f51('0x44')]);_0x20cb9e[_0x1f51('0x46')]=_[_0x1f51('0x47')](_0x20cb9e[_0x1f51('0x43')],_0x20cb9e[_0x1f51('0x44')]);_0x36c38d[_0x1f51('0x48')]=_[_0x1f51('0x47')](_0x20cb9e[_0x1f51('0x43')],qs[_0x1f51('0x49')](_0x955538[_0x1f51('0x44')][_0x1f51('0x49')]));_0x36c38d[_0x1f51('0x48')]=_0x36c38d[_0x1f51('0x48')][_0x1f51('0x4a')]?_0x36c38d[_0x1f51('0x48')]:_0x20cb9e[_0x1f51('0x43')];if(!_0x955538[_0x1f51('0x44')][_0x1f51('0x4b')](_0x1f51('0x4c'))){_0x36c38d[_0x1f51('0x33')]=qs['limit'](_0x955538['query'][_0x1f51('0x33')]);_0x36c38d[_0x1f51('0x32')]=qs[_0x1f51('0x32')](_0x955538[_0x1f51('0x44')]['offset']);}_0x36c38d[_0x1f51('0x4d')]=qs['sort'](_0x955538['query'][_0x1f51('0x4e')]);_0x36c38d[_0x1f51('0x4f')]=qs[_0x1f51('0x46')](_[_0x1f51('0x50')](_0x955538[_0x1f51('0x44')],_0x20cb9e[_0x1f51('0x46')]));if(_0x955538['query'][_0x1f51('0x51')]){_0x36c38d[_0x1f51('0x4f')]=_[_0x1f51('0x52')](_0x36c38d[_0x1f51('0x4f')],{'$or':_[_0x1f51('0x3e')](_0x25efa7,function(_0x480a3e){if(_0x480a3e[_0x1f51('0x41')]!==_0x1f51('0x53')){var _0x1bbfd2={};_0x1bbfd2[_0x480a3e[_0x1f51('0x3c')]]={'$like':'%'+_0x955538[_0x1f51('0x44')]['filter']+'%'};return _0x1bbfd2;}})});}_0x36c38d=_['merge']({},_0x36c38d,_0x955538['options']);var _0xc35be7={'where':_0x36c38d[_0x1f51('0x4f')]};return db[_0x1f51('0x54')]['count'](_0xc35be7)[_0x1f51('0x25')](function(_0xd80d12){_0x5df435[_0x1f51('0x31')]=_0xd80d12;if(_0x955538['query'][_0x1f51('0x55')]){_0x36c38d[_0x1f51('0x56')]=[{'all':!![]}];}return db[_0x1f51('0x54')][_0x1f51('0x57')](_0x36c38d);})['then'](function(_0x2650cd){_0x5df435['rows']=_0x2650cd;return _0x5df435;})['then'](respondWithFilteredResult(_0xafc84,_0x36c38d))[_0x1f51('0x58')](handleError(_0xafc84,null));};exports[_0x1f51('0x59')]=function(_0x30127e,_0x8c85f6){var _0x4867b8={'raw':![],'where':{'id':_0x30127e['params']['id']},'include':[{'model':db[_0x1f51('0x5a')],'as':_0x1f51('0x5b')}]},_0x12a710={};_0x12a710[_0x1f51('0x43')]=_[_0x1f51('0x45')](db[_0x1f51('0x54')][_0x1f51('0x3f')]);_0x12a710[_0x1f51('0x44')]=_['keys'](_0x30127e[_0x1f51('0x44')]);_0x12a710['filters']=_['intersection'](_0x12a710[_0x1f51('0x43')],_0x12a710['query']);_0x4867b8[_0x1f51('0x48')]=_[_0x1f51('0x47')](_0x12a710[_0x1f51('0x43')],qs['fields'](_0x30127e['query'][_0x1f51('0x49')]));_0x4867b8[_0x1f51('0x48')]=_0x4867b8[_0x1f51('0x48')][_0x1f51('0x4a')]?_0x4867b8[_0x1f51('0x48')]:_0x12a710[_0x1f51('0x43')];if(_0x30127e[_0x1f51('0x44')][_0x1f51('0x55')]){_0x4867b8[_0x1f51('0x56')]=[{'all':!![]}];}_0x4867b8=_[_0x1f51('0x52')]({},_0x4867b8,_0x30127e[_0x1f51('0x5c')]);return db[_0x1f51('0x54')][_0x1f51('0x5d')](_0x4867b8)[_0x1f51('0x25')](handleEntityNotFound(_0x8c85f6,null))[_0x1f51('0x25')](respondWithResult(_0x8c85f6,null))[_0x1f51('0x58')](handleError(_0x8c85f6,null));};exports[_0x1f51('0x5e')]=function(_0x35e107,_0x5e91df){return db[_0x1f51('0x54')][_0x1f51('0x5e')](_0x35e107[_0x1f51('0x5f')],{})['then'](function(_0x493ea9){var _0x2dfe7b=_0x35e107[_0x1f51('0x60')][_0x1f51('0x3a')]({'plain':!![]});if(!_0x2dfe7b)throw new Error(_0x1f51('0x61'));if(_0x2dfe7b[_0x1f51('0x62')]==='user'){var _0x28b16e=_0x493ea9['get']({'plain':!![]});var _0x35a367=_0x1f51('0x63');return db[_0x1f51('0x64')][_0x1f51('0x5d')]({'where':{'name':_0x35a367,'userProfileId':_0x2dfe7b['userProfileId']},'raw':!![]})[_0x1f51('0x25')](function(_0xaa8442){if(_0xaa8442&&_0xaa8442[_0x1f51('0x65')]===0x0){return db[_0x1f51('0x66')][_0x1f51('0x5e')]({'name':_0x28b16e['name'],'resourceId':_0x28b16e['id'],'type':_0xaa8442[_0x1f51('0x3c')],'sectionId':_0xaa8442['id']},{})[_0x1f51('0x25')](function(){return _0x493ea9;});}else{return _0x493ea9;}})[_0x1f51('0x58')](function(_0x7bcfcf){logger[_0x1f51('0x2a')](_0x1f51('0x67'),_0x7bcfcf);throw _0x7bcfcf;});}return _0x493ea9;})[_0x1f51('0x25')](respondWithResult(_0x5e91df,0xc9))[_0x1f51('0x58')](handleError(_0x5e91df,null));};exports[_0x1f51('0x68')]=function(_0x10efc5,_0x51663b){if(_0x10efc5['body']['id']){delete _0x10efc5[_0x1f51('0x5f')]['id'];}return db[_0x1f51('0x54')][_0x1f51('0x5d')]({'where':{'id':_0x10efc5[_0x1f51('0x69')]['id']},'include':[{'model':db[_0x1f51('0x5a')],'as':_0x1f51('0x5b')}]})[_0x1f51('0x25')](handleEntityNotFound(_0x51663b,null))[_0x1f51('0x25')](saveUpdates(_0x10efc5['body'],null))[_0x1f51('0x25')](respondWithResult(_0x51663b,null))[_0x1f51('0x58')](handleError(_0x51663b,null));};exports[_0x1f51('0x39')]=function(_0x2a03c1,_0x28a1f2){return db[_0x1f51('0x54')][_0x1f51('0x5d')]({'where':{'id':_0x2a03c1['params']['id']}})['then'](handleEntityNotFound(_0x28a1f2,null))['then'](removeEntity(_0x28a1f2,null))[_0x1f51('0x58')](handleError(_0x28a1f2,null));};exports[_0x1f51('0x6a')]=function(_0x2e779f,_0x3d5217){return db[_0x1f51('0x54')][_0x1f51('0x6a')]()[_0x1f51('0x25')](respondWithResult(_0x3d5217,null))[_0x1f51('0x58')](handleError(_0x3d5217,null));};exports[_0x1f51('0x6b')]=function(_0x292f00,_0x1c274d,_0x39d069){if(_0x292f00['body']['id']){delete _0x292f00[_0x1f51('0x5f')]['id'];}return db[_0x1f51('0x54')][_0x1f51('0x5d')]({'where':{'id':_0x292f00[_0x1f51('0x69')]['id']}})[_0x1f51('0x25')](handleEntityNotFound(_0x1c274d,null))['then'](function(_0x28a800){if(_0x28a800){_0x292f00[_0x1f51('0x5f')][_0x1f51('0x6c')]=_0x28a800['id'];return db[_0x1f51('0x6d')][_0x1f51('0x5e')](_0x292f00[_0x1f51('0x5f')]);}})[_0x1f51('0x25')](respondWithResult(_0x1c274d,null))['catch'](handleError(_0x1c274d,null));};exports[_0x1f51('0x6e')]=function(_0x3ddda8,_0x398386,_0x2bc692){var _0xcdefa1={'raw':![],'where':{}};var _0x435790={};var _0x23e6fe={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x1f51('0x6f')]({'where':{'id':_0x3ddda8[_0x1f51('0x69')]['id']}})[_0x1f51('0x25')](handleEntityNotFound(_0x398386,null))[_0x1f51('0x25')](function(_0x3aff01){if(_0x3aff01){_0x435790[_0x1f51('0x43')]=_[_0x1f51('0x45')](db[_0x1f51('0x6d')][_0x1f51('0x3f')]);_0x435790[_0x1f51('0x44')]=_['keys'](_0x3ddda8[_0x1f51('0x44')]);_0x435790[_0x1f51('0x46')]=_['intersection'](_0x435790[_0x1f51('0x43')],_0x435790[_0x1f51('0x44')]);_0xcdefa1[_0x1f51('0x48')]=_[_0x1f51('0x47')](_0x435790[_0x1f51('0x43')],qs[_0x1f51('0x49')](_0x3ddda8[_0x1f51('0x44')][_0x1f51('0x49')]));_0xcdefa1[_0x1f51('0x48')]=_0xcdefa1[_0x1f51('0x48')][_0x1f51('0x4a')]?_0xcdefa1[_0x1f51('0x48')]:_0x435790[_0x1f51('0x43')];if(!_0x3ddda8['query'][_0x1f51('0x4b')](_0x1f51('0x4c'))){_0xcdefa1[_0x1f51('0x33')]=qs[_0x1f51('0x33')](_0x3ddda8['query'][_0x1f51('0x33')]);_0xcdefa1[_0x1f51('0x32')]=qs[_0x1f51('0x32')](_0x3ddda8['query'][_0x1f51('0x32')]);}_0xcdefa1[_0x1f51('0x4d')]=qs[_0x1f51('0x4e')](_0x3ddda8[_0x1f51('0x44')]['sort']);_0xcdefa1['where']=qs['filters'](_[_0x1f51('0x50')](_0x3ddda8['query'],_0x435790[_0x1f51('0x46')]));_0xcdefa1[_0x1f51('0x4f')][_0x1f51('0x70')]=_0x3aff01['id'];if(_0x3ddda8[_0x1f51('0x44')]['filter']){_0xcdefa1['where']=_['merge'](_0xcdefa1['where'],{'$or':_[_0x1f51('0x3e')](_0xcdefa1[_0x1f51('0x48')],function(_0x43ada1){var _0x3f7a62={};_0x3f7a62[_0x43ada1]={'$like':'%'+_0x3ddda8[_0x1f51('0x44')][_0x1f51('0x51')]+'%'};return _0x3f7a62;})});}_0xcdefa1=_[_0x1f51('0x52')]({},_0xcdefa1,_0x3ddda8[_0x1f51('0x5c')]);return db[_0x1f51('0x6d')][_0x1f51('0x31')]({'where':_0xcdefa1[_0x1f51('0x4f')]})[_0x1f51('0x25')](function(_0xe85103){_0x23e6fe[_0x1f51('0x31')]=_0xe85103;if(_0x3ddda8['query'][_0x1f51('0x55')]){_0xcdefa1[_0x1f51('0x56')]=[{'all':!![]}];}return db[_0x1f51('0x6d')][_0x1f51('0x57')](_0xcdefa1);})[_0x1f51('0x25')](function(_0x7f560b){_0x23e6fe['rows']=_0x7f560b;return _0x23e6fe;});}})[_0x1f51('0x25')](respondWithFilteredResult(_0x398386,_0xcdefa1))[_0x1f51('0x58')](handleError(_0x398386,null));};exports[_0x1f51('0x71')]=function(_0x34fd36,_0x121c29,_0x36e12c){return db[_0x1f51('0x54')][_0x1f51('0x5d')]({'where':{'id':_0x34fd36['params']['id']}})[_0x1f51('0x25')](handleEntityNotFound(_0x121c29,null))[_0x1f51('0x25')](function(_0x79595e){if(_0x79595e){return _0x79595e[_0x1f51('0x71')](_0x34fd36[_0x1f51('0x44')][_0x1f51('0x72')]);}})[_0x1f51('0x25')](respondWithStatusCode(_0x121c29,null))['catch'](handleError(_0x121c29,null));};exports[_0x1f51('0x73')]=function(_0x4f7c42,_0x39935a,_0x5ae9a3){if(_0x4f7c42[_0x1f51('0x5f')]['id']){delete _0x4f7c42['body']['id'];}return db[_0x1f51('0x54')][_0x1f51('0x5d')]({'where':{'id':_0x4f7c42[_0x1f51('0x69')]['id']}})[_0x1f51('0x25')](handleEntityNotFound(_0x39935a,null))[_0x1f51('0x25')](function(_0x33c963){if(_0x33c963){_0x4f7c42['body'][_0x1f51('0x70')]=_0x33c963['id'];return db[_0x1f51('0x74')][_0x1f51('0x5e')](_0x4f7c42[_0x1f51('0x5f')]);}})[_0x1f51('0x25')](respondWithResult(_0x39935a,null))['catch'](handleError(_0x39935a,null));};exports[_0x1f51('0x75')]=function(_0x2e1680,_0x117082,_0x2849a9){var _0x34fc02={'raw':![],'where':{}};var _0x351b08={};var _0x50b485={'count':0x0,'rows':[]};return db[_0x1f51('0x54')][_0x1f51('0x6f')]({'where':{'id':_0x2e1680[_0x1f51('0x69')]['id']}})[_0x1f51('0x25')](handleEntityNotFound(_0x117082,null))[_0x1f51('0x25')](function(_0x5397f9){if(_0x5397f9){_0x351b08[_0x1f51('0x43')]=_['keys'](db[_0x1f51('0x74')]['rawAttributes']);_0x351b08['query']=_[_0x1f51('0x45')](_0x2e1680[_0x1f51('0x44')]);_0x351b08[_0x1f51('0x46')]=_[_0x1f51('0x47')](_0x351b08[_0x1f51('0x43')],_0x351b08[_0x1f51('0x44')]);_0x34fc02[_0x1f51('0x48')]=_[_0x1f51('0x47')](_0x351b08[_0x1f51('0x43')],qs[_0x1f51('0x49')](_0x2e1680[_0x1f51('0x44')][_0x1f51('0x49')]));_0x34fc02[_0x1f51('0x48')]=_0x34fc02[_0x1f51('0x48')]['length']?_0x34fc02[_0x1f51('0x48')]:_0x351b08['model'];if(!_0x2e1680[_0x1f51('0x44')][_0x1f51('0x4b')](_0x1f51('0x4c'))){_0x34fc02[_0x1f51('0x33')]=qs[_0x1f51('0x33')](_0x2e1680[_0x1f51('0x44')]['limit']);_0x34fc02[_0x1f51('0x32')]=qs[_0x1f51('0x32')](_0x2e1680[_0x1f51('0x44')][_0x1f51('0x32')]);}_0x34fc02[_0x1f51('0x4d')]=qs[_0x1f51('0x4e')](_0x2e1680['query'][_0x1f51('0x4e')]);_0x34fc02[_0x1f51('0x4f')]=qs[_0x1f51('0x46')](_[_0x1f51('0x50')](_0x2e1680['query'],_0x351b08[_0x1f51('0x46')]));_0x34fc02[_0x1f51('0x4f')][_0x1f51('0x70')]=_0x5397f9['id'];if(_0x2e1680[_0x1f51('0x44')][_0x1f51('0x51')]){_0x34fc02[_0x1f51('0x4f')]=_['merge'](_0x34fc02[_0x1f51('0x4f')],{'$or':_['map'](_0x34fc02[_0x1f51('0x48')],function(_0x38e6e3){var _0x41b083={};_0x41b083[_0x38e6e3]={'$like':'%'+_0x2e1680[_0x1f51('0x44')][_0x1f51('0x51')]+'%'};return _0x41b083;})});}_0x34fc02=_[_0x1f51('0x52')]({},_0x34fc02,_0x2e1680[_0x1f51('0x5c')]);return db[_0x1f51('0x74')][_0x1f51('0x31')]({'where':_0x34fc02[_0x1f51('0x4f')]})['then'](function(_0x23dd58){_0x50b485[_0x1f51('0x31')]=_0x23dd58;if(_0x2e1680['query']['includeAll']){_0x34fc02[_0x1f51('0x56')]=[{'all':!![]}];}return db[_0x1f51('0x74')][_0x1f51('0x57')](_0x34fc02);})[_0x1f51('0x25')](function(_0x2b4b4e){_0x50b485[_0x1f51('0x76')]=_0x2b4b4e;return _0x50b485;});}})[_0x1f51('0x25')](respondWithFilteredResult(_0x117082,_0x34fc02))['catch'](handleError(_0x117082,null));};exports[_0x1f51('0x77')]=function(_0x375769,_0x121929,_0x307799){return db[_0x1f51('0x54')][_0x1f51('0x5d')]({'where':{'id':_0x375769[_0x1f51('0x69')]['id']}})['then'](handleEntityNotFound(_0x121929,null))[_0x1f51('0x25')](function(_0x2b0e86){if(_0x2b0e86){return _0x2b0e86[_0x1f51('0x77')](_0x375769[_0x1f51('0x44')]['ids']);}})['then'](respondWithStatusCode(_0x121929,null))[_0x1f51('0x58')](handleError(_0x121929,null));};exports[_0x1f51('0x78')]=function(_0x1cdac3,_0x220b38,_0x5f3d90){var _0x30f9f6={'body':_0x1cdac3[_0x1f51('0x5f')],'channel':_0x1f51('0x79')};var _0x2f1ee4=[];var _0x2047a4=[];var _0x60cac0={};var _0x4e6edc=![];return db[_0x1f51('0x7a')][_0x1f51('0x6a')]()[_0x1f51('0x25')](function(_0x4918ba){if(!_0x4918ba){throw new db[(_0x1f51('0x23'))][(_0x1f51('0x7b'))]('no\x20available\x20attributes');}_0x2f1ee4=_[_0x1f51('0x7c')](_[_0x1f51('0x45')](_0x4918ba),[_0x1f51('0x7d'),_0x1f51('0x7e')]);_0x2047a4=_[_0x1f51('0x7c')](_['keys'](_0x4918ba),[_0x1f51('0x7d'),_0x1f51('0x7e'),_0x1f51('0x7f'),_0x1f51('0x80')]);if(_0x1cdac3[_0x1f51('0x5f')]['id']){delete _0x1cdac3['body']['id'];}if(_['isNil'](_0x1cdac3[_0x1f51('0x5f')][_0x1f51('0x81')])){throw new db[(_0x1f51('0x23'))][(_0x1f51('0x7b'))](_0x1f51('0x82'));}if(_['isNil'](_0x1cdac3[_0x1f51('0x5f')][_0x1f51('0x5f')])||_0x1cdac3[_0x1f51('0x5f')][_0x1f51('0x5f')]===''){throw new db[(_0x1f51('0x23'))][(_0x1f51('0x7b'))](_0x1f51('0x83'));}if(_[_0x1f51('0x84')](_0x1cdac3[_0x1f51('0x5f')]['mapKey'])){throw new db[(_0x1f51('0x23'))]['ValidationError'](_0x1f51('0x85')+_0x2047a4);}if(!_[_0x1f51('0x86')](_0x2047a4,_0x1cdac3['body']['mapKey'])){throw new db[(_0x1f51('0x23'))][(_0x1f51('0x7b'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2047a4);}_0x60cac0[_0x1cdac3[_0x1f51('0x5f')]['mapKey']]=_0x1cdac3[_0x1f51('0x5f')][_0x1f51('0x81')];})[_0x1f51('0x25')](function(){return db[_0x1f51('0x54')][_0x1f51('0x5d')]({'where':{'id':_0x1cdac3[_0x1f51('0x69')]['id']},'include':[{'model':db[_0x1f51('0x87')],'as':_0x1f51('0x88'),'include':[{'model':db[_0x1f51('0x7a')],'as':_0x1f51('0x89'),'where':_0x60cac0,'limit':0x1,'order':[['updatedAt',_0x1f51('0x8a')]]}]},{'model':db[_0x1f51('0x8b')],'as':_0x1f51('0x8c')}]});})[_0x1f51('0x25')](handleEntityNotFound(_0x220b38,null))[_0x1f51('0x25')](function(_0x69a1eb){if(_0x69a1eb&&_0x69a1eb['List']){_0x30f9f6[_0x1f51('0x8d')]=_0x69a1eb;_0x30f9f6[_0x1f51('0x8e')]=_0x69a1eb['Applications'];_0x30f9f6[_0x1f51('0x8f')]=_0x69a1eb[_0x1f51('0x88')];_0x30f9f6[_0x1f51('0x8e')]=_[_0x1f51('0x90')](_0x30f9f6['applications'],[_0x1f51('0x91')],[_0x1f51('0x92')]);if(_0x30f9f6[_0x1f51('0x8d')][_0x1f51('0x8c')]){delete _0x30f9f6[_0x1f51('0x8d')][_0x1f51('0x8c')];}if(_0x30f9f6['account'][_0x1f51('0x88')]&&_0x30f9f6['account'][_0x1f51('0x88')]['Contacts'][_0x1f51('0x4a')]){return _0x30f9f6['account'][_0x1f51('0x88')][_0x1f51('0x89')][0x0];}var _0x119942=_['defaults'](_0x1cdac3[_0x1f51('0x5f')],{'firstName':_0x1cdac3[_0x1f51('0x5f')][_0x1f51('0x81')],'ListId':_0x69a1eb[_0x1f51('0x80')]});_0x119942[_0x1cdac3[_0x1f51('0x5f')][_0x1f51('0x93')]]=_0x1cdac3[_0x1f51('0x5f')]['from'];return db[_0x1f51('0x7a')][_0x1f51('0x5e')](_0x119942,{'fields':_0x2f1ee4,'raw':!![]});}})[_0x1f51('0x25')](handleEntityNotFound(_0x220b38,null))['then'](function(_0x770f94){_0x30f9f6[_0x1f51('0x94')]=_0x770f94;if(_0x770f94){var _0x5c3f58={'ContactId':_0x770f94['id'],'OpenchannelAccountId':_0x1cdac3[_0x1f51('0x69')]['id'],'from':(_0x770f94[_0x1f51('0x95')]||'')+'\x20'+(_0x770f94[_0x1f51('0x96')]||'')};var _0x4d3a61={'OpenchannelAccountId':_0x1cdac3['params']['id'],'closed':![]};if(_0x1cdac3[_0x1f51('0x5f')][_0x1f51('0x97')]){_0x4d3a61[_0x1f51('0x97')]=_0x1cdac3[_0x1f51('0x5f')][_0x1f51('0x97')];return db[_0x1f51('0x98')][_0x1f51('0x5d')]({'where':_0x4d3a61})[_0x1f51('0x25')](function(_0x6d56a1){if(_0x6d56a1){return[_0x6d56a1,![]];}_0x5c3f58[_0x1f51('0x97')]=_0x1cdac3[_0x1f51('0x5f')][_0x1f51('0x97')];_0x5c3f58['externalUrl']=_0x1cdac3['body'][_0x1f51('0x99')];return db[_0x1f51('0x98')][_0x1f51('0x5e')](_0x5c3f58)['then'](function(_0xaec27f){return[_0xaec27f,!![]];});});}else{_0x4d3a61[_0x1f51('0x97')]=null;}_0x4d3a61['ContactId']=_0x770f94['id'];return db[_0x1f51('0x98')][_0x1f51('0x5d')]({'where':_0x4d3a61})[_0x1f51('0x25')](function(_0x1d8b80){if(_0x1d8b80){return[_0x1d8b80,![]];}return db[_0x1f51('0x98')][_0x1f51('0x5e')](_0x5c3f58)['then'](function(_0x1fb7d2){return[_0x1fb7d2,!![]];});});}})[_0x1f51('0x9a')](function(_0x41bd08,_0x1d1b27){if(_0x41bd08){_0x4e6edc=_0x1d1b27;if(!_0x1d1b27){var _0x3b687c={'from':(_0x30f9f6[_0x1f51('0x94')][_0x1f51('0x95')]||'')+'\x20'+(_0x30f9f6[_0x1f51('0x94')][_0x1f51('0x96')]||'')};if(_0x1cdac3[_0x1f51('0x5f')][_0x1f51('0x97')]&&_0x1cdac3[_0x1f51('0x5f')][_0x1f51('0x9b')]&&_0x1cdac3['body'][_0x1f51('0x97')]!=_0x1cdac3[_0x1f51('0x5f')][_0x1f51('0x9b')]){_0x3b687c[_0x1f51('0x97')]=_0x1cdac3['body'][_0x1f51('0x9b')];}return _0x41bd08['update'](_0x3b687c);}else{return _0x41bd08;}}})[_0x1f51('0x25')](function(_0x2be169){_0x30f9f6['interaction']=_0x2be169[_0x1f51('0x3a')]({'plain':!![]});_0x30f9f6[_0x1f51('0x9c')]['created']=_0x4e6edc;if(_0x30f9f6['interaction']['created']){if(_0x30f9f6[_0x1f51('0x8d')][_0x1f51('0x9d')]){_0x30f9f6['applications'][_0x1f51('0x9e')]({'id':0x0,'priority':_0x30f9f6['applications'][_0x1f51('0x4a')]+0x1,'app':'close','appdata':_0x1f51('0x9f'),'interval':_0x1f51('0xa0')});}}return db['OpenchannelMessage'][_0x1f51('0x5e')]({'body':_0x1cdac3[_0x1f51('0x5f')][_0x1f51('0x5f')],'OpenchannelAccountId':_0x1cdac3[_0x1f51('0x69')]['id'],'OpenchannelInteractionId':_0x2be169['id'],'direction':'in','ContactId':_0x30f9f6['contact']['id'],'AttachmentId':_0x1cdac3[_0x1f51('0x5f')][_0x1f51('0xa1')]});})[_0x1f51('0x25')](function(_0x48b7d3){_0x30f9f6['message']=_0x48b7d3;if(_0x30f9f6[_0x1f51('0x9c')][_0x1f51('0xa2')]){return db[_0x1f51('0xa3')][_0x1f51('0x5d')]({'attributes':['id',_0x1f51('0x3c')],'where':{'id':_0x30f9f6[_0x1f51('0x9c')][_0x1f51('0xa2')]}})[_0x1f51('0x25')](function(_0x4f3c97){if(_0x4f3c97){_0x30f9f6[_0x1f51('0x8e')][_0x1f51('0xa4')]({'id':0x0,'priority':0x0,'app':_0x1f51('0xa5'),'appdata':_0x4f3c97['name']+','+(_0x30f9f6['account'][_0x1f51('0xa6')]||0xa),'interval':'*,*,*,*'});_0x30f9f6[_0x1f51('0xa7')]=![];}return respondWithRpcPromise(_0x1f51('0xa8'),_0x1f51('0xa9'),_0x30f9f6);});}return respondWithRpcPromise(_0x1f51('0xa8'),'startRouting',_0x30f9f6);})['then'](function(_0x20ac5b){respondWithRpcPromise(_0x1f51('0xaa'),_0x1f51('0xaa'),{'event':'notify','message':_0x20ac5b},client9002);return _0x20ac5b;})['then'](respondWithResult(_0x220b38,null))[_0x1f51('0x58')](handleError(_0x220b38,null));};exports[_0x1f51('0xab')]=function(_0x1cea46,_0x5c07e5,_0x2eedcc){return db[_0x1f51('0x54')][_0x1f51('0x6f')]({'where':{'id':_0x1cea46[_0x1f51('0x69')]['id']}})[_0x1f51('0x25')](handleEntityNotFound(_0x5c07e5,null))[_0x1f51('0x25')](function(_0x31aade){if(_0x31aade){return db[_0x1f51('0xac')]['transaction'](function(_0x3c32ba){return db['OpenchannelApplication'][_0x1f51('0x39')]({'where':{'OpenchannelAccountId':_0x1cea46['params']['id']},'transaction':_0x3c32ba})[_0x1f51('0x25')](function(_0x53dc39){var _0xcf716a=_['map'](_0x1cea46[_0x1f51('0x5f')],function(_0x1d9963){_0x1d9963[_0x1f51('0x70')]=_0x1cea46['params']['id'];return _0x1d9963;});return db[_0x1f51('0x8b')][_0x1f51('0xad')](_0xcf716a,{'transaction':_0x3c32ba});});})[_0x1f51('0x25')](function(){return db[_0x1f51('0x8b')][_0x1f51('0xae')]({'where':{'OpenchannelAccountId':_0x1cea46['params']['id']},'order':_0x1f51('0x91')});});}})[_0x1f51('0x25')](respondWithResult(_0x5c07e5,null))[_0x1f51('0x58')](handleError(_0x5c07e5,null));};exports[_0x1f51('0xaf')]=function(_0x29b544,_0x3e8b3f,_0xfc34ba){var _0x2cf91c={};var _0xd0de42={};var _0x3701ad;var _0x5a6712;return db[_0x1f51('0x54')]['findOne']({'where':{'id':_0x29b544[_0x1f51('0x69')]['id']}})[_0x1f51('0x25')](handleEntityNotFound(_0x3e8b3f,null))['then'](function(_0x34f328){if(_0x34f328){_0x3701ad=_0x34f328;_0xd0de42[_0x1f51('0x43')]=_['keys'](db[_0x1f51('0x8b')]['rawAttributes']);_0xd0de42[_0x1f51('0x44')]=_[_0x1f51('0x45')](_0x29b544[_0x1f51('0x44')]);_0xd0de42['filters']=_['intersection'](_0xd0de42[_0x1f51('0x43')],_0xd0de42[_0x1f51('0x44')]);_0x2cf91c[_0x1f51('0x48')]=_[_0x1f51('0x47')](_0xd0de42[_0x1f51('0x43')],qs[_0x1f51('0x49')](_0x29b544['query']['fields']));_0x2cf91c[_0x1f51('0x48')]=_0x2cf91c[_0x1f51('0x48')][_0x1f51('0x4a')]?_0x2cf91c['attributes']:_0xd0de42[_0x1f51('0x43')];_0x2cf91c[_0x1f51('0x4d')]=qs[_0x1f51('0x4e')](_0x29b544[_0x1f51('0x44')][_0x1f51('0x4e')]);_0x2cf91c[_0x1f51('0x4f')]=qs[_0x1f51('0x46')](_[_0x1f51('0x50')](_0x29b544['query'],_0xd0de42['filters']));if(_0x29b544[_0x1f51('0x44')][_0x1f51('0x51')]){_0x2cf91c[_0x1f51('0x4f')]=_[_0x1f51('0x52')](_0x2cf91c['where'],{'$or':_[_0x1f51('0x3e')](_0x2cf91c[_0x1f51('0x48')],function(_0x5a70ad){var _0x6be8={};_0x6be8[_0x5a70ad]={'$like':'%'+_0x29b544[_0x1f51('0x44')]['filter']+'%'};return _0x6be8;})});}_0x2cf91c=_['merge']({},_0x2cf91c,_0x29b544[_0x1f51('0x5c')]);return _0x3701ad[_0x1f51('0xaf')](_0x2cf91c);}})[_0x1f51('0x25')](function(_0x3ca4d7){if(_0x3ca4d7){_0x5a6712=_0x3ca4d7['length'];if(!_0x29b544[_0x1f51('0x44')]['hasOwnProperty'](_0x1f51('0x4c'))){_0x2cf91c['limit']=qs[_0x1f51('0x33')](_0x29b544[_0x1f51('0x44')][_0x1f51('0x33')]);_0x2cf91c[_0x1f51('0x32')]=qs['offset'](_0x29b544[_0x1f51('0x44')][_0x1f51('0x32')]);}return _0x3701ad['getApplications'](_0x2cf91c);}})[_0x1f51('0x25')](function(_0x30ff4c){if(_0x30ff4c){return _0x30ff4c?{'count':_0x5a6712,'rows':_0x30ff4c}:null;}})[_0x1f51('0x25')](respondWithResult(_0x3e8b3f,null))[_0x1f51('0x58')](handleError(_0x3e8b3f,null));};exports['getInteractions']=function(_0x3f5551,_0x5345d2,_0x489708){var _0x20e47b={'raw':![],'where':{}};var _0x4ebc1a={};var _0x302145={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x1f51('0x6f')]({'where':{'id':_0x3f5551[_0x1f51('0x69')]['id']}})[_0x1f51('0x25')](handleEntityNotFound(_0x5345d2,null))['then'](function(_0x4abbaa){if(_0x4abbaa){_0x4ebc1a[_0x1f51('0x43')]=_['keys'](db[_0x1f51('0x98')][_0x1f51('0x3f')]);_0x4ebc1a['query']=_['keys'](_0x3f5551[_0x1f51('0x44')]);_0x4ebc1a[_0x1f51('0x46')]=_[_0x1f51('0x47')](_0x4ebc1a[_0x1f51('0x43')],_0x4ebc1a[_0x1f51('0x44')]);_0x20e47b[_0x1f51('0x48')]=_[_0x1f51('0x47')](_0x4ebc1a[_0x1f51('0x43')],qs[_0x1f51('0x49')](_0x3f5551[_0x1f51('0x44')][_0x1f51('0x49')]));_0x20e47b[_0x1f51('0x48')]=_0x20e47b[_0x1f51('0x48')][_0x1f51('0x4a')]?_0x20e47b[_0x1f51('0x48')]:_0x4ebc1a[_0x1f51('0x43')];if(!_0x3f5551['query']['hasOwnProperty'](_0x1f51('0x4c'))){_0x20e47b[_0x1f51('0x33')]=qs[_0x1f51('0x33')](_0x3f5551['query'][_0x1f51('0x33')]);_0x20e47b['offset']=qs[_0x1f51('0x32')](_0x3f5551['query'][_0x1f51('0x32')]);}_0x20e47b[_0x1f51('0x4d')]=qs[_0x1f51('0x4e')](_0x3f5551[_0x1f51('0x44')][_0x1f51('0x4e')]);_0x20e47b[_0x1f51('0x4f')]=qs[_0x1f51('0x46')](_[_0x1f51('0x50')](_0x3f5551[_0x1f51('0x44')],_0x4ebc1a[_0x1f51('0x46')]));_0x20e47b['where'][_0x1f51('0x70')]=_0x4abbaa['id'];if(_0x3f5551[_0x1f51('0x44')][_0x1f51('0x51')]){_0x20e47b['where']=_[_0x1f51('0x52')](_0x20e47b['where'],{'$or':_[_0x1f51('0x3e')](_0x20e47b['attributes'],function(_0x64a26a){var _0x4332b1={};_0x4332b1[_0x64a26a]={'$like':'%'+_0x3f5551['query'][_0x1f51('0x51')]+'%'};return _0x4332b1;})});}_0x20e47b=_[_0x1f51('0x52')]({},_0x20e47b,_0x3f5551[_0x1f51('0x5c')]);return db[_0x1f51('0x98')][_0x1f51('0x31')]({'where':_0x20e47b[_0x1f51('0x4f')]})['then'](function(_0x4c3ece){_0x302145[_0x1f51('0x31')]=_0x4c3ece;if(_0x3f5551[_0x1f51('0x44')][_0x1f51('0x55')]){_0x20e47b['include']=[{'model':db[_0x1f51('0x7a')],'as':'Contact','required':![]},{'model':db[_0x1f51('0xa3')],'as':'Owner','attributes':['name',_0x1f51('0xb0'),_0x1f51('0xb1')],'required':![]},{'model':db['Tag'],'as':_0x1f51('0xb2'),'attributes':['id','name',_0x1f51('0xb3')],'where':_0x3f5551['query'][_0x1f51('0xb4')]?{'id':_0x3f5551[_0x1f51('0x44')][_0x1f51('0xb4')]}:undefined,'required':_0x3f5551[_0x1f51('0x44')]['tag']?!![]:![]}];}return db[_0x1f51('0x98')][_0x1f51('0x57')](_0x20e47b);})[_0x1f51('0x25')](function(_0x43fc38){_0x302145[_0x1f51('0x76')]=_0x43fc38;return _0x302145;});}})[_0x1f51('0x25')](respondWithFilteredResult(_0x5345d2,_0x20e47b))[_0x1f51('0x58')](handleError(_0x5345d2,null));};exports[_0x1f51('0xb5')]=function(_0x580058,_0xd060cd,_0x6c0ed1){return db[_0x1f51('0x54')][_0x1f51('0x5d')]({'where':{'id':_0x580058['params']['id']}})[_0x1f51('0x25')](handleEntityNotFound(_0xd060cd,null))[_0x1f51('0x25')](function(_0x214728){if(_0x214728){return _0x214728['addAgents'](_0x580058[_0x1f51('0x5f')]['ids'],_['omit'](_0x580058[_0x1f51('0x5f')],[_0x1f51('0x72'),'id'])||{})['spread'](function(_0x1489a6){for(var _0x5f2307=0x0;_0x5f2307<_0x580058[_0x1f51('0x5f')][_0x1f51('0x72')][_0x1f51('0x4a')];_0x5f2307+=0x1){socket[_0x1f51('0xb6')](_0x1f51('0xb7'),{'UserId':_0x580058[_0x1f51('0x5f')][_0x1f51('0x72')][_0x5f2307],'OpenchannelAccountId':_0x580058['params']['id']});}return _0x1489a6;});}})['then'](respondWithResult(_0xd060cd,null))['catch'](handleError(_0xd060cd,null));};exports[_0x1f51('0xb8')]=function(_0x53d63e,_0x5c2b34,_0x39623b){return db[_0x1f51('0x54')][_0x1f51('0x5d')]({'where':{'id':_0x53d63e[_0x1f51('0x69')]['id']}})['then'](handleEntityNotFound(_0x5c2b34,null))[_0x1f51('0x25')](function(_0x57348f){if(_0x57348f){return _0x57348f[_0x1f51('0xb8')](_0x53d63e[_0x1f51('0x44')][_0x1f51('0x72')])['then'](function(){if(_[_0x1f51('0xb9')](_0x53d63e[_0x1f51('0x44')][_0x1f51('0x72')])){for(var _0x4c10db=0x0;_0x4c10db<_0x53d63e[_0x1f51('0x44')][_0x1f51('0x72')][_0x1f51('0x4a')];_0x4c10db+=0x1){socket[_0x1f51('0xb6')](_0x1f51('0xba'),{'UserId':Number(_0x53d63e[_0x1f51('0x44')][_0x1f51('0x72')][_0x4c10db]),'OpenchannelAccountId':Number(_0x53d63e[_0x1f51('0x69')]['id'])});}}else{socket[_0x1f51('0xb6')]('userOpenchannelAccount:remove',{'UserId':Number(_0x53d63e[_0x1f51('0x44')][_0x1f51('0x72')]),'OpenchannelAccountId':Number(_0x53d63e[_0x1f51('0x69')]['id'])});}});}})[_0x1f51('0x25')](respondWithStatusCode(_0x5c2b34,null))['catch'](handleError(_0x5c2b34,null));};exports[_0x1f51('0xbb')]=function(_0x183901,_0x2e250c,_0x12ffbf){var _0x184153={};var _0x352942={};var _0xd0e4da;var _0x119871;return db['OpenchannelAccount'][_0x1f51('0x6f')]({'where':{'id':_0x183901[_0x1f51('0x69')]['id']}})[_0x1f51('0x25')](handleEntityNotFound(_0x2e250c,null))[_0x1f51('0x25')](function(_0x1ae43c){if(_0x1ae43c){_0xd0e4da=_0x1ae43c;_0x352942[_0x1f51('0x43')]=_[_0x1f51('0x45')](db[_0x1f51('0xa3')][_0x1f51('0x3f')]);_0x352942['query']=_['keys'](_0x183901['query']);_0x352942[_0x1f51('0x46')]=_['intersection'](_0x352942['model'],_0x352942[_0x1f51('0x44')]);_0x184153[_0x1f51('0x48')]=_[_0x1f51('0x47')](_0x352942[_0x1f51('0x43')],qs[_0x1f51('0x49')](_0x183901[_0x1f51('0x44')][_0x1f51('0x49')]));_0x184153[_0x1f51('0x48')]=_0x184153[_0x1f51('0x48')][_0x1f51('0x4a')]?_0x184153['attributes']:_0x352942[_0x1f51('0x43')];_0x184153[_0x1f51('0x4d')]=qs[_0x1f51('0x4e')](_0x183901[_0x1f51('0x44')]['sort']);_0x184153['where']=qs['filters'](_[_0x1f51('0x50')](_0x183901[_0x1f51('0x44')],_0x352942[_0x1f51('0x46')]));if(_0x183901[_0x1f51('0x44')]['filter']){_0x184153['where']=_[_0x1f51('0x52')](_0x184153[_0x1f51('0x4f')],{'$or':_[_0x1f51('0x3e')](_0x184153[_0x1f51('0x48')],function(_0x1ac920){var _0x472ca5={};_0x472ca5[_0x1ac920]={'$like':'%'+_0x183901[_0x1f51('0x44')][_0x1f51('0x51')]+'%'};return _0x472ca5;})});}_0x184153=_[_0x1f51('0x52')]({},_0x184153,_0x183901[_0x1f51('0x5c')]);return _0xd0e4da[_0x1f51('0xbb')](_0x184153);}})[_0x1f51('0x25')](function(_0x1f6bde){if(_0x1f6bde){_0x119871=_0x1f6bde['length'];if(!_0x183901[_0x1f51('0x44')]['hasOwnProperty']('nolimit')){_0x184153[_0x1f51('0x33')]=qs[_0x1f51('0x33')](_0x183901[_0x1f51('0x44')]['limit']);_0x184153[_0x1f51('0x32')]=qs['offset'](_0x183901['query'][_0x1f51('0x32')]);}return _0xd0e4da[_0x1f51('0xbb')](_0x184153);}})[_0x1f51('0x25')](function(_0x176c09){if(_0x176c09){return _0x176c09?{'count':_0x119871,'rows':_0x176c09}:null;}})[_0x1f51('0x25')](respondWithResult(_0x2e250c,null))[_0x1f51('0x58')](handleError(_0x2e250c,null));};exports[_0x1f51('0x3d')]=function(_0x50cc9d,_0x55da68,_0x2a0fef){var _0x3c69ab,_0x564e51,_0x49b9d1;if(_[_0x1f51('0x84')](_0x50cc9d['body']['body'])||_0x50cc9d[_0x1f51('0x5f')][_0x1f51('0x5f')]===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x50cc9d[_0x1f51('0x5f')]['to'])){}_0x3c69ab=_0x50cc9d[_0x1f51('0x5f')]['to'];return db['OpenchannelAccount'][_0x1f51('0x6f')]({'where':{'id':_0x50cc9d[_0x1f51('0x69')]['id']}})['then'](handleEntityNotFound(_0x55da68,null))[_0x1f51('0x25')](function(_0x16dbd6){if(_0x16dbd6){return db[_0x1f51('0x54')][_0x1f51('0x5d')]({'where':{'id':_0x16dbd6['id']},'include':[{'model':db['CmList'],'as':_0x1f51('0x88'),'include':[{'model':db['CmContact'],'as':_0x1f51('0x89'),'where':{[_0x16dbd6[_0x1f51('0x93')]]:_0x3c69ab},'limit':0x1,'order':[[_0x1f51('0x7e'),_0x1f51('0x8a')]]}]}]})['then'](handleEntityNotFound(_0x55da68,null))[_0x1f51('0x25')](function(_0x3341aa){if(_0x3341aa&&_0x3341aa['List']){_0x564e51=_0x3341aa[_0x1f51('0x3a')]({'plain':!![]});if(_0x564e51[_0x1f51('0x88')]&&_0x564e51['List'][_0x1f51('0x89')][_0x1f51('0x4a')]){return _0x564e51[_0x1f51('0x88')][_0x1f51('0x89')][0x0];}return db['CmContact'][_0x1f51('0x5e')](_[_0x1f51('0x1b')](_0x50cc9d[_0x1f51('0x5f')],{'firstName':_0x3c69ab,[_0x3341aa['mapKey']]:_0x3c69ab,'phone':_0x3c69ab,'ListId':_0x564e51['ListId']}));}})[_0x1f51('0x25')](handleEntityNotFound(_0x55da68,null))[_0x1f51('0x25')](function(_0x210ad2){if(_0x210ad2){_0x49b9d1=_0x210ad2;return db[_0x1f51('0x98')][_0x1f51('0x5d')]({'where':{'ContactId':_0x49b9d1['id'],'closed':![],'OpenchannelAccountId':_0x564e51['id']}})['then'](function(_0x2ae015){if(_0x2ae015){return[_0x2ae015,![]];}return db[_0x1f51('0x98')][_0x1f51('0x5e')]({'UserId':_0x50cc9d[_0x1f51('0x60')]['id'],'ContactId':_0x49b9d1['id'],'OpenchannelAccountId':_0x564e51['id'],'lastMsgDirection':_0x1f51('0xbc'),'Messages':[_[_0x1f51('0x52')](_0x50cc9d['body'],{'read':![],'body':_0x50cc9d[_0x1f51('0x5f')]['body'],'OpenchannelAccountId':_0x564e51['id'],'UserId':_0x50cc9d[_0x1f51('0x60')]['id'],'ContactId':_0x49b9d1['id']})]},{'include':[{'model':db[_0x1f51('0xbd')],'as':_0x1f51('0xbe')}]})[_0x1f51('0x25')](function(_0x3e9b74){return[_0x3e9b74,!![]];});});}})[_0x1f51('0x9a')](function(_0x2b9063,_0x5ab1af){if(_0x5ab1af){return _0x2b9063;}return db[_0x1f51('0xbd')][_0x1f51('0x5e')](_[_0x1f51('0x52')](_0x50cc9d[_0x1f51('0x5f')],{'read':![],'body':_0x50cc9d['body'][_0x1f51('0x5f')],'OpenchannelAccountId':_0x564e51['id'],'OpenchannelInteractionId':_0x2b9063['id'],'UserId':_0x50cc9d[_0x1f51('0x60')]['id'],'ContactId':_0x49b9d1['id']}))[_0x1f51('0x25')](function(_0x26ac6b){_0x2b9063[_0x1f51('0xbf')][_0x1f51('0xbe')]=[];_0x2b9063[_0x1f51('0xbf')][_0x1f51('0xbe')][_0x1f51('0x9e')](_0x26ac6b[_0x1f51('0xbf')]);return _0x2b9063;});});}})[_0x1f51('0x25')](respondWithResult(_0x55da68,null))['catch'](handleError(_0x55da68,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index cfb367d..eb9e385 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 _0x2487=['OpenchannelAccount','save','update','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2487,0x6e));var _0x7248=function(_0x539d94,_0x8aac84){_0x539d94=_0x539d94-0x0;var _0x1a5552=_0x2487[_0x539d94];return _0x1a5552;};'use strict';var EventEmitter=require(_0x7248('0x0'));var OpenchannelAccount=require(_0x7248('0x1'))['db'][_0x7248('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7248('0x3'),'afterUpdate':_0x7248('0x4'),'afterDestroy':'remove'};function emitEvent(_0x47e090){return function(_0x1034e6,_0x4d2ddf,_0x12e695){OpenchannelAccountEvents['emit'](_0x47e090+':'+_0x1034e6['id'],_0x1034e6);OpenchannelAccountEvents[_0x7248('0x5')](_0x47e090,_0x1034e6);_0x12e695(null);};}for(var e in events){if(events[_0x7248('0x6')](e)){var event=events[e];OpenchannelAccount[_0x7248('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file +var _0xa6eb=['emit','hook','exports','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x5a0cb1,_0x188fbc){var _0x330e9d=function(_0x463bb6){while(--_0x463bb6){_0x5a0cb1['push'](_0x5a0cb1['shift']());}};_0x330e9d(++_0x188fbc);}(_0xa6eb,0x1cb));var _0xba6e=function(_0x331c6c,_0x28529a){_0x331c6c=_0x331c6c-0x0;var _0x5bcd88=_0xa6eb[_0x331c6c];return _0x5bcd88;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0xba6e('0x0'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xba6e('0x1')](0x0);var events={'afterCreate':_0xba6e('0x2'),'afterUpdate':_0xba6e('0x3'),'afterDestroy':_0xba6e('0x4')};function emitEvent(_0x54077b){return function(_0x9f6935,_0x568e4f,_0x5816cb){OpenchannelAccountEvents[_0xba6e('0x5')](_0x54077b+':'+_0x9f6935['id'],_0x9f6935);OpenchannelAccountEvents[_0xba6e('0x5')](_0x54077b,_0x9f6935);_0x5816cb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0xba6e('0x6')](e,emitEvent(event));}}module[_0xba6e('0x7')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index ba9b12a..0fcdc48 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 _0x0298=['util','../../config/logger','moment','bluebird','request-promise','path','./openchannelAccount.attributes','exports','define','OpenchannelAccount','openchannel_accounts','lodash'];(function(_0x4e9643,_0x26ea79){var _0x4fa79d=function(_0x52a0cf){while(--_0x52a0cf){_0x4e9643['push'](_0x4e9643['shift']());}};_0x4fa79d(++_0x26ea79);}(_0x0298,0x107));var _0x8029=function(_0x483ad2,_0x5034bc){_0x483ad2=_0x483ad2-0x0;var _0x1a5251=_0x0298[_0x483ad2];return _0x1a5251;};'use strict';var _=require(_0x8029('0x0'));var util=require(_0x8029('0x1'));var logger=require(_0x8029('0x2'))('api');var moment=require(_0x8029('0x3'));var BPromise=require(_0x8029('0x4'));var rp=require(_0x8029('0x5'));var fs=require('fs');var path=require(_0x8029('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8029('0x7'));module[_0x8029('0x8')]=function(_0xdfd69d,_0x31b80d){return _0xdfd69d[_0x8029('0x9')](_0x8029('0xa'),attributes,{'tableName':_0x8029('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb03f=['request-promise','path','rimraf','../../config/environment','./openchannelAccount.attributes','define','openchannel_accounts','util','../../config/logger','moment','bluebird'];(function(_0x4b369c,_0x21005b){var _0xf520ce=function(_0x19f5b){while(--_0x19f5b){_0x4b369c['push'](_0x4b369c['shift']());}};_0xf520ce(++_0x21005b);}(_0xb03f,0x80));var _0xfb03=function(_0x41bee3,_0x2315fb){_0x41bee3=_0x41bee3-0x0;var _0x2596ac=_0xb03f[_0x41bee3];return _0x2596ac;};'use strict';var _=require('lodash');var util=require(_0xfb03('0x0'));var logger=require(_0xfb03('0x1'))('api');var moment=require(_0xfb03('0x2'));var BPromise=require(_0xfb03('0x3'));var rp=require(_0xfb03('0x4'));var fs=require('fs');var path=require(_0xfb03('0x5'));var rimraf=require(_0xfb03('0x6'));var config=require(_0xfb03('0x7'));var attributes=require(_0xfb03('0x8'));module['exports']=function(_0x1d6797,_0x60ad08){return _0x1d6797[_0xfb03('0x9')]('OpenchannelAccount',attributes,{'tableName':_0xfb03('0xa'),'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 31b10e4..6f56e46 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 _0x5645=['OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','then','info','OpenchannelAccount,\x20%s,\x20%s','debug'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0x5645,0x146));var _0x5564=function(_0x3ee800,_0x301bd0){_0x3ee800=_0x3ee800-0x0;var _0x41a863=_0x5645[_0x3ee800];return _0x41a863;};'use strict';var _=require(_0x5564('0x0'));var util=require(_0x5564('0x1'));var moment=require(_0x5564('0x2'));var BPromise=require(_0x5564('0x3'));var rs=require(_0x5564('0x4'));var fs=require('fs');var Redis=require(_0x5564('0x5'));var db=require(_0x5564('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5564('0x7'))(_0x5564('0x8'));var config=require(_0x5564('0x9'));var jayson=require(_0x5564('0xa'));var client=jayson[_0x5564('0xb')][_0x5564('0xc')]({'port':0x232a});config[_0x5564('0xd')]=_['defaults'](config['redis'],{'host':_0x5564('0xe'),'port':0x18eb});var socket=require(_0x5564('0xf'))(new Redis(config[_0x5564('0xd')]));require(_0x5564('0x10'))[_0x5564('0x11')](socket);function respondWithRpcPromise(_0x463ccb,_0x5ac5d9,_0x3943e2){return new BPromise(function(_0x503e6a,_0x8ec95a){return client['request'](_0x463ccb,_0x3943e2)[_0x5564('0x12')](function(_0x1858df){logger[_0x5564('0x13')](_0x5564('0x14'),_0x5ac5d9,'request\x20sent');logger[_0x5564('0x15')](_0x5564('0x16'),_0x5ac5d9,_0x5564('0x17'),JSON[_0x5564('0x18')](_0x1858df));if(_0x1858df['error']){if(_0x1858df[_0x5564('0x19')][_0x5564('0x1a')]===0x1f4){logger[_0x5564('0x19')](_0x5564('0x14'),_0x5ac5d9,_0x1858df[_0x5564('0x19')][_0x5564('0x1b')]);return _0x8ec95a(_0x1858df[_0x5564('0x19')]['message']);}logger[_0x5564('0x19')](_0x5564('0x14'),_0x5ac5d9,_0x1858df['error'][_0x5564('0x1b')]);return _0x503e6a(_0x1858df['error']['message']);}else{logger[_0x5564('0x13')](_0x5564('0x14'),_0x5ac5d9,_0x5564('0x17'));_0x503e6a(_0x1858df[_0x5564('0x1c')][_0x5564('0x1b')]);}})['catch'](function(_0x1bc014){logger[_0x5564('0x19')](_0x5564('0x14'),_0x5ac5d9,_0x1bc014);_0x8ec95a(_0x1bc014);});});} \ No newline at end of file +var _0x30e3=['request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','register'];(function(_0x8f4ca2,_0xc4ac52){var _0x126663=function(_0x1eebee){while(--_0x1eebee){_0x8f4ca2['push'](_0x8f4ca2['shift']());}};_0x126663(++_0xc4ac52);}(_0x30e3,0xdb));var _0x330e=function(_0x42a8d8,_0x7ec53e){_0x42a8d8=_0x42a8d8-0x0;var _0xffbb73=_0x30e3[_0x42a8d8];return _0xffbb73;};'use strict';var _=require(_0x330e('0x0'));var util=require(_0x330e('0x1'));var moment=require(_0x330e('0x2'));var BPromise=require(_0x330e('0x3'));var rs=require(_0x330e('0x4'));var fs=require('fs');var Redis=require(_0x330e('0x5'));var db=require(_0x330e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x330e('0x7'))('rpc');var config=require(_0x330e('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x330e('0x9')]({'port':0x232a});config[_0x330e('0xa')]=_[_0x330e('0xb')](config['redis'],{'host':_0x330e('0xc'),'port':0x18eb});var socket=require(_0x330e('0xd'))(new Redis(config['redis']));require('./openchannelAccount.socket')[_0x330e('0xe')](socket);function respondWithRpcPromise(_0x293fb5,_0x58e287,_0x58d4b9){return new BPromise(function(_0x4d185e,_0xb52df0){return client[_0x330e('0xf')](_0x293fb5,_0x58d4b9)[_0x330e('0x10')](function(_0x577c9d){logger['info'](_0x330e('0x11'),_0x58e287,_0x330e('0x12'));logger['debug'](_0x330e('0x13'),_0x58e287,_0x330e('0x12'),JSON[_0x330e('0x14')](_0x577c9d));if(_0x577c9d[_0x330e('0x15')]){if(_0x577c9d[_0x330e('0x15')][_0x330e('0x16')]===0x1f4){logger[_0x330e('0x15')](_0x330e('0x11'),_0x58e287,_0x577c9d[_0x330e('0x15')][_0x330e('0x17')]);return _0xb52df0(_0x577c9d['error'][_0x330e('0x17')]);}logger[_0x330e('0x15')](_0x330e('0x11'),_0x58e287,_0x577c9d[_0x330e('0x15')][_0x330e('0x17')]);return _0x4d185e(_0x577c9d['error'][_0x330e('0x17')]);}else{logger['info'](_0x330e('0x11'),_0x58e287,_0x330e('0x12'));_0x4d185e(_0x577c9d[_0x330e('0x18')]['message']);}})[_0x330e('0x19')](function(_0x4cec7e){logger['error'](_0x330e('0x11'),_0x58e287,_0x4cec7e);_0xb52df0(_0x4cec7e);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index fdc877e..dd6934a 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 _0xf144=['length','openchannelAccount:','save','remove','update','emit','removeListener','register'];(function(_0xc3d66f,_0x38c75b){var _0x4b9544=function(_0x110c3d){while(--_0x110c3d){_0xc3d66f['push'](_0xc3d66f['shift']());}};_0x4b9544(++_0x38c75b);}(_0xf144,0x142));var _0x4f14=function(_0x37ff49,_0x50bd30){_0x37ff49=_0x37ff49-0x0;var _0x3dbb50=_0xf144[_0x37ff49];return _0x3dbb50;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0x4f14('0x0'),_0x4f14('0x1'),_0x4f14('0x2')];function createListener(_0x170817,_0x56f4f1){return function(_0x4c06be){_0x56f4f1[_0x4f14('0x3')](_0x170817,_0x4c06be);};}function removeListener(_0x4fa908,_0x5ce92b){return function(){OpenchannelAccountEvents[_0x4f14('0x4')](_0x4fa908,_0x5ce92b);};}exports[_0x4f14('0x5')]=function(_0x40c152){for(var _0x152b3d=0x0,_0x2e9eb2=events[_0x4f14('0x6')];_0x152b3d<_0x2e9eb2;_0x152b3d++){var _0x4fd48a=events[_0x152b3d];var _0x38dd85=createListener(_0x4f14('0x7')+_0x4fd48a,_0x40c152);OpenchannelAccountEvents['on'](_0x4fd48a,_0x38dd85);}}; \ No newline at end of file +var _0x973b=['register','length','openchannelAccount:','./openchannelAccount.events','save','remove','update','emit','removeListener'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x973b,0x162));var _0xb973=function(_0x55495b,_0x3d3ee8){_0x55495b=_0x55495b-0x0;var _0x40e3e3=_0x973b[_0x55495b];return _0x40e3e3;};'use strict';var OpenchannelAccountEvents=require(_0xb973('0x0'));var events=[_0xb973('0x1'),_0xb973('0x2'),_0xb973('0x3')];function createListener(_0x4b40eb,_0x1172cc){return function(_0x47a2cb){_0x1172cc[_0xb973('0x4')](_0x4b40eb,_0x47a2cb);};}function removeListener(_0x8d5f48,_0x5b0ded){return function(){OpenchannelAccountEvents[_0xb973('0x5')](_0x8d5f48,_0x5b0ded);};}exports[_0xb973('0x6')]=function(_0xb14855){for(var _0xfb2d73=0x0,_0x566df6=events[_0xb973('0x7')];_0xfb2d73<_0x566df6;_0xfb2d73++){var _0x37121f=events[_0xfb2d73];var _0x5f54e4=createListener(_0xb973('0x8')+_0x37121f,_0xb14855);OpenchannelAccountEvents['on'](_0x37121f,_0x5f54e4);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 9d31ca8..7cd1536 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 _0x6aaa=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./openchannelApplication.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','exports'];(function(_0x136de3,_0x357817){var _0x1cf662=function(_0x3a3d4c){while(--_0x3a3d4c){_0x136de3['push'](_0x136de3['shift']());}};_0x1cf662(++_0x357817);}(_0x6aaa,0xea));var _0xa6aa=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6aaa[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xa6aa('0x0'));var util=require(_0xa6aa('0x1'));var path=require(_0xa6aa('0x2'));var timeout=require(_0xa6aa('0x3'));var express=require('express');var router=express[_0xa6aa('0x4')]();var auth=require(_0xa6aa('0x5'));var interaction=require(_0xa6aa('0x6'));var config=require('../../config/environment');var controller=require(_0xa6aa('0x7'));router[_0xa6aa('0x8')]('/',auth[_0xa6aa('0x9')](),controller['index']);router[_0xa6aa('0x8')](_0xa6aa('0xa'),auth[_0xa6aa('0x9')](),controller[_0xa6aa('0xb')]);router[_0xa6aa('0xc')]('/',auth['isAuthenticated'](),controller[_0xa6aa('0xd')]);router[_0xa6aa('0xe')]('/:id',auth[_0xa6aa('0x9')](),controller[_0xa6aa('0xf')]);router[_0xa6aa('0x10')]('/:id',auth[_0xa6aa('0x9')](),controller['destroy']);module[_0xa6aa('0x11')]=router; \ No newline at end of file +var _0x2bf5=['multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x2bf5,0x169));var _0x52bf=function(_0x13c1c6,_0x84c09){_0x13c1c6=_0x13c1c6-0x0;var _0x2e3351=_0x2bf5[_0x13c1c6];return _0x2e3351;};'use strict';var multer=require(_0x52bf('0x0'));var util=require('util');var path=require(_0x52bf('0x1'));var timeout=require('connect-timeout');var express=require(_0x52bf('0x2'));var router=express[_0x52bf('0x3')]();var auth=require(_0x52bf('0x4'));var interaction=require(_0x52bf('0x5'));var config=require(_0x52bf('0x6'));var controller=require(_0x52bf('0x7'));router['get']('/',auth[_0x52bf('0x8')](),controller[_0x52bf('0x9')]);router[_0x52bf('0xa')](_0x52bf('0xb'),auth[_0x52bf('0x8')](),controller[_0x52bf('0xc')]);router[_0x52bf('0xd')]('/',auth[_0x52bf('0x8')](),controller[_0x52bf('0xe')]);router[_0x52bf('0xf')](_0x52bf('0xb'),auth[_0x52bf('0x8')](),controller[_0x52bf('0x10')]);router[_0x52bf('0x11')](_0x52bf('0xb'),auth[_0x52bf('0x8')](),controller[_0x52bf('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 6fbfef1..24d0f5e 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 _0x3b81=['STRING','noop','sequelize','exports','INTEGER'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x3b81,0x98));var _0x13b8=function(_0x4bbe5f,_0x8ef5d8){_0x4bbe5f=_0x4bbe5f-0x0;var _0x1da364=_0x3b81[_0x4bbe5f];return _0x1da364;};'use strict';var Sequelize=require(_0x13b8('0x0'));module[_0x13b8('0x1')]={'priority':{'type':Sequelize[_0x13b8('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x13b8('0x3')],'allowNull':![],'defaultValue':_0x13b8('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x13b8('0x3')]},'interval':{'type':Sequelize[_0x13b8('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x38e2=['sequelize','INTEGER','STRING'];(function(_0x507c16,_0x164c8d){var _0x4af44c=function(_0x51bdab){while(--_0x51bdab){_0x507c16['push'](_0x507c16['shift']());}};_0x4af44c(++_0x164c8d);}(_0x38e2,0x1c8));var _0x238e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x38e2[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x238e('0x0'));module['exports']={'priority':{'type':Sequelize[_0x238e('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x238e('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x238e('0x2')]},'interval':{'type':Sequelize[_0x238e('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 9642318..7d90a1f 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 _0xa2a2=['name','send','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','includeAll','include','show','options','create','body','catch','update','find','params','html-pdf','moment','bluebird','mustache','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','count','offset','limit','status','set','Content-Range','apply','reject','save','then','destroy','end','error'];(function(_0x47e794,_0x545a45){var _0xca96c7=function(_0x241ea9){while(--_0x241ea9){_0x47e794['push'](_0x47e794['shift']());}};_0xca96c7(++_0x545a45);}(_0xa2a2,0x1ba));var _0x2a2a=function(_0x3d5f0e,_0x5e1b46){_0x3d5f0e=_0x3d5f0e-0x0;var _0x5822b3=_0xa2a2[_0x3d5f0e];return _0x5822b3;};'use strict';var pdf=require(_0x2a2a('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2a2a('0x1'));var BPromise=require(_0x2a2a('0x2'));var Mustache=require(_0x2a2a('0x3'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2a2a('0x4'));var fs=require('fs');var _=require(_0x2a2a('0x5'));var squel=require('squel');var crypto=require(_0x2a2a('0x6'));var jsforce=require(_0x2a2a('0x7'));var deskjs=require(_0x2a2a('0x8'));var toCsv=require(_0x2a2a('0x9'));var querystring=require(_0x2a2a('0xa'));var Papa=require(_0x2a2a('0xb'));var Redis=require(_0x2a2a('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x2a2a('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2a2a('0xe'));var logger=require(_0x2a2a('0xf'))('api');var utils=require(_0x2a2a('0x10'));var config=require(_0x2a2a('0x11'));var db=require(_0x2a2a('0x12'))['db'];function respondWithStatusCode(_0xf48662,_0x332c1d){_0x332c1d=_0x332c1d||0xcc;return function(_0x305759){if(_0x305759){return _0xf48662[_0x2a2a('0x13')](_0x332c1d);}return _0xf48662['status'](_0x332c1d)['end']();};}function respondWithResult(_0x5b8be8,_0x5b0680){_0x5b0680=_0x5b0680||0xc8;return function(_0x2b469d){if(_0x2b469d){return _0x5b8be8['status'](_0x5b0680)[_0x2a2a('0x14')](_0x2b469d);}};}function respondWithFilteredResult(_0x33cabf,_0x25f40c){return function(_0xdc4cb){if(_0xdc4cb){var _0x368437=_0xdc4cb[_0x2a2a('0x15')],_0x1aa1f1=_0x25f40c['offset'],_0x1f13b1=_0x25f40c[_0x2a2a('0x16')]+_0x25f40c[_0x2a2a('0x17')],_0x5d7d98;if(_0x1f13b1>=_0x368437){_0x1f13b1=_0x368437;_0x5d7d98=0xc8;}else{_0x5d7d98=0xce;}_0x33cabf[_0x2a2a('0x18')](_0x5d7d98);return _0x33cabf[_0x2a2a('0x19')](_0x2a2a('0x1a'),_0x1aa1f1+'-'+_0x1f13b1+'/'+_0x368437)[_0x2a2a('0x14')](_0xdc4cb);}return null;};}function patchUpdates(_0x32e35c){return function(_0x805e){try{jsonpatch[_0x2a2a('0x1b')](_0x805e,_0x32e35c,!![]);}catch(_0x24703e){return BPromise[_0x2a2a('0x1c')](_0x24703e);}return _0x805e[_0x2a2a('0x1d')]();};}function saveUpdates(_0x5dce9a,_0x17e8f3){return function(_0x404364){if(_0x404364){return _0x404364['update'](_0x5dce9a)[_0x2a2a('0x1e')](function(_0x2b49ee){return _0x2b49ee;});}return null;};}function removeEntity(_0x6711b5,_0xbc67c1){return function(_0x5b17d5){if(_0x5b17d5){return _0x5b17d5[_0x2a2a('0x1f')]()['then'](function(){_0x6711b5[_0x2a2a('0x18')](0xcc)[_0x2a2a('0x20')]();});}};}function handleEntityNotFound(_0xed1e53,_0x4857b5){return function(_0x52234b){if(!_0x52234b){_0xed1e53[_0x2a2a('0x13')](0x194);}return _0x52234b;};}function handleError(_0x3fd52e,_0x2c5650){_0x2c5650=_0x2c5650||0x1f4;return function(_0x3ea409){logger[_0x2a2a('0x21')](_0x3ea409['stack']);if(_0x3ea409[_0x2a2a('0x22')]){delete _0x3ea409[_0x2a2a('0x22')];}_0x3fd52e[_0x2a2a('0x18')](_0x2c5650)[_0x2a2a('0x23')](_0x3ea409);};}exports['index']=function(_0x1c8151,_0x4c55c5){var _0x46dfff={},_0x1d2e46={},_0x2ea508={'count':0x0,'rows':[]};var _0x3ff8d3=_[_0x2a2a('0x24')](db[_0x2a2a('0x25')][_0x2a2a('0x26')],function(_0x39a013){return{'name':_0x39a013[_0x2a2a('0x27')],'type':_0x39a013[_0x2a2a('0x28')][_0x2a2a('0x29')]};});_0x1d2e46[_0x2a2a('0x2a')]=_[_0x2a2a('0x24')](_0x3ff8d3,_0x2a2a('0x22'));_0x1d2e46['query']=_[_0x2a2a('0x2b')](_0x1c8151[_0x2a2a('0x2c')]);_0x1d2e46[_0x2a2a('0x2d')]=_[_0x2a2a('0x2e')](_0x1d2e46[_0x2a2a('0x2a')],_0x1d2e46['query']);_0x46dfff[_0x2a2a('0x2f')]=_['intersection'](_0x1d2e46['model'],qs[_0x2a2a('0x30')](_0x1c8151[_0x2a2a('0x2c')][_0x2a2a('0x30')]));_0x46dfff[_0x2a2a('0x2f')]=_0x46dfff[_0x2a2a('0x2f')][_0x2a2a('0x31')]?_0x46dfff['attributes']:_0x1d2e46[_0x2a2a('0x2a')];if(!_0x1c8151[_0x2a2a('0x2c')][_0x2a2a('0x32')](_0x2a2a('0x33'))){_0x46dfff['limit']=qs[_0x2a2a('0x17')](_0x1c8151['query']['limit']);_0x46dfff[_0x2a2a('0x16')]=qs[_0x2a2a('0x16')](_0x1c8151[_0x2a2a('0x2c')][_0x2a2a('0x16')]);}_0x46dfff[_0x2a2a('0x34')]=qs[_0x2a2a('0x35')](_0x1c8151[_0x2a2a('0x2c')][_0x2a2a('0x35')]);_0x46dfff['where']=qs[_0x2a2a('0x2d')](_['pick'](_0x1c8151['query'],_0x1d2e46[_0x2a2a('0x2d')]));if(_0x1c8151[_0x2a2a('0x2c')]['filter']){_0x46dfff[_0x2a2a('0x36')]=_[_0x2a2a('0x37')](_0x46dfff['where'],{'$or':_[_0x2a2a('0x24')](_0x3ff8d3,function(_0x24602c){if(_0x24602c[_0x2a2a('0x28')]!==_0x2a2a('0x38')){var _0x1f80db={};_0x1f80db[_0x24602c[_0x2a2a('0x22')]]={'$like':'%'+_0x1c8151[_0x2a2a('0x2c')][_0x2a2a('0x39')]+'%'};return _0x1f80db;}})});}_0x46dfff=_['merge']({},_0x46dfff,_0x1c8151['options']);var _0xa63c={'where':_0x46dfff[_0x2a2a('0x36')]};return db[_0x2a2a('0x25')][_0x2a2a('0x15')](_0xa63c)['then'](function(_0x1d8ab1){_0x2ea508[_0x2a2a('0x15')]=_0x1d8ab1;if(_0x1c8151[_0x2a2a('0x2c')][_0x2a2a('0x3a')]){_0x46dfff[_0x2a2a('0x3b')]=[{'all':!![]}];}return db[_0x2a2a('0x25')]['findAll'](_0x46dfff);})[_0x2a2a('0x1e')](function(_0x3b85b9){_0x2ea508['rows']=_0x3b85b9;return _0x2ea508;})[_0x2a2a('0x1e')](respondWithFilteredResult(_0x4c55c5,_0x46dfff))['catch'](handleError(_0x4c55c5,null));};exports[_0x2a2a('0x3c')]=function(_0x51b87a,_0x24cfd6){var _0x3cbea8={'raw':!![],'where':{'id':_0x51b87a['params']['id']}},_0x2bc994={};_0x2bc994[_0x2a2a('0x2a')]=_[_0x2a2a('0x2b')](db[_0x2a2a('0x25')]['rawAttributes']);_0x2bc994['query']=_[_0x2a2a('0x2b')](_0x51b87a[_0x2a2a('0x2c')]);_0x2bc994[_0x2a2a('0x2d')]=_[_0x2a2a('0x2e')](_0x2bc994[_0x2a2a('0x2a')],_0x2bc994['query']);_0x3cbea8[_0x2a2a('0x2f')]=_[_0x2a2a('0x2e')](_0x2bc994[_0x2a2a('0x2a')],qs[_0x2a2a('0x30')](_0x51b87a[_0x2a2a('0x2c')][_0x2a2a('0x30')]));_0x3cbea8[_0x2a2a('0x2f')]=_0x3cbea8[_0x2a2a('0x2f')][_0x2a2a('0x31')]?_0x3cbea8[_0x2a2a('0x2f')]:_0x2bc994['model'];if(_0x51b87a[_0x2a2a('0x2c')]['includeAll']){_0x3cbea8[_0x2a2a('0x3b')]=[{'all':!![]}];}_0x3cbea8=_[_0x2a2a('0x37')]({},_0x3cbea8,_0x51b87a[_0x2a2a('0x3d')]);return db[_0x2a2a('0x25')]['find'](_0x3cbea8)['then'](handleEntityNotFound(_0x24cfd6,null))[_0x2a2a('0x1e')](respondWithResult(_0x24cfd6,null))['catch'](handleError(_0x24cfd6,null));};exports[_0x2a2a('0x3e')]=function(_0x20d125,_0x420c49){return db['OpenchannelApplication'][_0x2a2a('0x3e')](_0x20d125[_0x2a2a('0x3f')],{})[_0x2a2a('0x1e')](respondWithResult(_0x420c49,0xc9))[_0x2a2a('0x40')](handleError(_0x420c49,null));};exports[_0x2a2a('0x41')]=function(_0x4ed055,_0x4905e6){if(_0x4ed055[_0x2a2a('0x3f')]['id']){delete _0x4ed055[_0x2a2a('0x3f')]['id'];}return db[_0x2a2a('0x25')][_0x2a2a('0x42')]({'where':{'id':_0x4ed055[_0x2a2a('0x43')]['id']}})[_0x2a2a('0x1e')](handleEntityNotFound(_0x4905e6,null))[_0x2a2a('0x1e')](saveUpdates(_0x4ed055[_0x2a2a('0x3f')],null))[_0x2a2a('0x1e')](respondWithResult(_0x4905e6,null))[_0x2a2a('0x40')](handleError(_0x4905e6,null));};exports[_0x2a2a('0x1f')]=function(_0x271c29,_0x43b9a1){return db['OpenchannelApplication'][_0x2a2a('0x42')]({'where':{'id':_0x271c29[_0x2a2a('0x43')]['id']}})['then'](handleEntityNotFound(_0x43b9a1,null))[_0x2a2a('0x1e')](removeEntity(_0x43b9a1,null))[_0x2a2a('0x40')](handleError(_0x43b9a1,null));}; \ No newline at end of file +var _0x3b88=['keys','intersection','query','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','catch','show','find','create','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','offset','limit','set','Content-Range','apply','save','then','destroy','sendStatus','error','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','type','key'];(function(_0x544099,_0x372b30){var _0x20ab09=function(_0x149613){while(--_0x149613){_0x544099['push'](_0x544099['shift']());}};_0x20ab09(++_0x372b30);}(_0x3b88,0xf6));var _0x83b8=function(_0x1b7ea2,_0x2d9ea2){_0x1b7ea2=_0x1b7ea2-0x0;var _0x2f7f1e=_0x3b88[_0x1b7ea2];return _0x2f7f1e;};'use strict';var pdf=require(_0x83b8('0x0'));var emlformat=require(_0x83b8('0x1'));var rimraf=require(_0x83b8('0x2'));var zipdir=require(_0x83b8('0x3'));var jsonpatch=require(_0x83b8('0x4'));var rp=require(_0x83b8('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x83b8('0x6'));var util=require(_0x83b8('0x7'));var path=require(_0x83b8('0x8'));var sox=require('sox');var csv=require(_0x83b8('0x9'));var ejs=require(_0x83b8('0xa'));var fs=require('fs');var _=require(_0x83b8('0xb'));var squel=require(_0x83b8('0xc'));var crypto=require('crypto');var jsforce=require(_0x83b8('0xd'));var deskjs=require(_0x83b8('0xe'));var toCsv=require(_0x83b8('0x9'));var querystring=require('querystring');var Papa=require(_0x83b8('0xf'));var Redis=require('ioredis');var authService=require(_0x83b8('0x10'));var qs=require(_0x83b8('0x11'));var as=require(_0x83b8('0x12'));var hardwareService=require(_0x83b8('0x13'));var logger=require(_0x83b8('0x14'))(_0x83b8('0x15'));var utils=require('../../config/utils');var config=require(_0x83b8('0x16'));var db=require(_0x83b8('0x17'))['db'];function respondWithStatusCode(_0x206339,_0x5e9c6e){_0x5e9c6e=_0x5e9c6e||0xcc;return function(_0x1ba0d9){if(_0x1ba0d9){return _0x206339['sendStatus'](_0x5e9c6e);}return _0x206339[_0x83b8('0x18')](_0x5e9c6e)[_0x83b8('0x19')]();};}function respondWithResult(_0x351d5d,_0x410d58){_0x410d58=_0x410d58||0xc8;return function(_0x312961){if(_0x312961){return _0x351d5d[_0x83b8('0x18')](_0x410d58)[_0x83b8('0x1a')](_0x312961);}};}function respondWithFilteredResult(_0x233137,_0x30456f){return function(_0x4c13df){if(_0x4c13df){var _0x428d59=_0x4c13df['count'],_0xf01ae=_0x30456f[_0x83b8('0x1b')],_0x571a57=_0x30456f[_0x83b8('0x1b')]+_0x30456f[_0x83b8('0x1c')],_0x31f818;if(_0x571a57>=_0x428d59){_0x571a57=_0x428d59;_0x31f818=0xc8;}else{_0x31f818=0xce;}_0x233137[_0x83b8('0x18')](_0x31f818);return _0x233137[_0x83b8('0x1d')](_0x83b8('0x1e'),_0xf01ae+'-'+_0x571a57+'/'+_0x428d59)[_0x83b8('0x1a')](_0x4c13df);}return null;};}function patchUpdates(_0x13b15c){return function(_0x5da8cf){try{jsonpatch[_0x83b8('0x1f')](_0x5da8cf,_0x13b15c,!![]);}catch(_0x252d16){return BPromise['reject'](_0x252d16);}return _0x5da8cf[_0x83b8('0x20')]();};}function saveUpdates(_0x4dcf48,_0x909d50){return function(_0x125162){if(_0x125162){return _0x125162['update'](_0x4dcf48)[_0x83b8('0x21')](function(_0x50c66f){return _0x50c66f;});}return null;};}function removeEntity(_0x3f9ac9,_0x54de27){return function(_0x2d4856){if(_0x2d4856){return _0x2d4856[_0x83b8('0x22')]()[_0x83b8('0x21')](function(){_0x3f9ac9['status'](0xcc)[_0x83b8('0x19')]();});}};}function handleEntityNotFound(_0x3583e5,_0x468de8){return function(_0x28434f){if(!_0x28434f){_0x3583e5[_0x83b8('0x23')](0x194);}return _0x28434f;};}function handleError(_0x2aa457,_0x7d81d3){_0x7d81d3=_0x7d81d3||0x1f4;return function(_0x598b28){logger[_0x83b8('0x24')](_0x598b28['stack']);if(_0x598b28[_0x83b8('0x25')]){delete _0x598b28['name'];}_0x2aa457[_0x83b8('0x18')](_0x7d81d3)[_0x83b8('0x26')](_0x598b28);};}exports[_0x83b8('0x27')]=function(_0xecfa7d,_0x2222ac){var _0x1d2e8e={},_0x4fd50f={},_0x14a866={'count':0x0,'rows':[]};var _0x5a7496=_[_0x83b8('0x28')](db[_0x83b8('0x29')][_0x83b8('0x2a')],function(_0x2bf156){return{'name':_0x2bf156[_0x83b8('0x2b')],'type':_0x2bf156[_0x83b8('0x2c')][_0x83b8('0x2d')]};});_0x4fd50f['model']=_[_0x83b8('0x28')](_0x5a7496,_0x83b8('0x25'));_0x4fd50f['query']=_[_0x83b8('0x2e')](_0xecfa7d['query']);_0x4fd50f['filters']=_[_0x83b8('0x2f')](_0x4fd50f['model'],_0x4fd50f[_0x83b8('0x30')]);_0x1d2e8e[_0x83b8('0x31')]=_[_0x83b8('0x2f')](_0x4fd50f[_0x83b8('0x32')],qs[_0x83b8('0x33')](_0xecfa7d[_0x83b8('0x30')]['fields']));_0x1d2e8e['attributes']=_0x1d2e8e[_0x83b8('0x31')]['length']?_0x1d2e8e[_0x83b8('0x31')]:_0x4fd50f[_0x83b8('0x32')];if(!_0xecfa7d[_0x83b8('0x30')][_0x83b8('0x34')](_0x83b8('0x35'))){_0x1d2e8e[_0x83b8('0x1c')]=qs[_0x83b8('0x1c')](_0xecfa7d[_0x83b8('0x30')][_0x83b8('0x1c')]);_0x1d2e8e['offset']=qs[_0x83b8('0x1b')](_0xecfa7d['query'][_0x83b8('0x1b')]);}_0x1d2e8e[_0x83b8('0x36')]=qs[_0x83b8('0x37')](_0xecfa7d[_0x83b8('0x30')][_0x83b8('0x37')]);_0x1d2e8e[_0x83b8('0x38')]=qs['filters'](_['pick'](_0xecfa7d['query'],_0x4fd50f[_0x83b8('0x39')]));if(_0xecfa7d[_0x83b8('0x30')][_0x83b8('0x3a')]){_0x1d2e8e[_0x83b8('0x38')]=_['merge'](_0x1d2e8e[_0x83b8('0x38')],{'$or':_[_0x83b8('0x28')](_0x5a7496,function(_0x1701fe){if(_0x1701fe[_0x83b8('0x2c')]!==_0x83b8('0x3b')){var _0x3b15ef={};_0x3b15ef[_0x1701fe['name']]={'$like':'%'+_0xecfa7d[_0x83b8('0x30')][_0x83b8('0x3a')]+'%'};return _0x3b15ef;}})});}_0x1d2e8e=_[_0x83b8('0x3c')]({},_0x1d2e8e,_0xecfa7d[_0x83b8('0x3d')]);var _0x525974={'where':_0x1d2e8e[_0x83b8('0x38')]};return db[_0x83b8('0x29')]['count'](_0x525974)[_0x83b8('0x21')](function(_0x3a33e1){_0x14a866[_0x83b8('0x3e')]=_0x3a33e1;if(_0xecfa7d[_0x83b8('0x30')][_0x83b8('0x3f')]){_0x1d2e8e[_0x83b8('0x40')]=[{'all':!![]}];}return db[_0x83b8('0x29')][_0x83b8('0x41')](_0x1d2e8e);})[_0x83b8('0x21')](function(_0x3fb3c7){_0x14a866[_0x83b8('0x42')]=_0x3fb3c7;return _0x14a866;})['then'](respondWithFilteredResult(_0x2222ac,_0x1d2e8e))[_0x83b8('0x43')](handleError(_0x2222ac,null));};exports[_0x83b8('0x44')]=function(_0x36f929,_0x3ef18a){var _0x27bee3={'raw':!![],'where':{'id':_0x36f929['params']['id']}},_0x9488c3={};_0x9488c3[_0x83b8('0x32')]=_[_0x83b8('0x2e')](db['OpenchannelApplication']['rawAttributes']);_0x9488c3[_0x83b8('0x30')]=_[_0x83b8('0x2e')](_0x36f929['query']);_0x9488c3['filters']=_[_0x83b8('0x2f')](_0x9488c3[_0x83b8('0x32')],_0x9488c3[_0x83b8('0x30')]);_0x27bee3['attributes']=_['intersection'](_0x9488c3['model'],qs['fields'](_0x36f929[_0x83b8('0x30')]['fields']));_0x27bee3[_0x83b8('0x31')]=_0x27bee3[_0x83b8('0x31')]['length']?_0x27bee3[_0x83b8('0x31')]:_0x9488c3[_0x83b8('0x32')];if(_0x36f929[_0x83b8('0x30')][_0x83b8('0x3f')]){_0x27bee3['include']=[{'all':!![]}];}_0x27bee3=_[_0x83b8('0x3c')]({},_0x27bee3,_0x36f929[_0x83b8('0x3d')]);return db[_0x83b8('0x29')][_0x83b8('0x45')](_0x27bee3)[_0x83b8('0x21')](handleEntityNotFound(_0x3ef18a,null))[_0x83b8('0x21')](respondWithResult(_0x3ef18a,null))[_0x83b8('0x43')](handleError(_0x3ef18a,null));};exports[_0x83b8('0x46')]=function(_0xb76246,_0xbf3e4e){return db[_0x83b8('0x29')][_0x83b8('0x46')](_0xb76246['body'],{})[_0x83b8('0x21')](respondWithResult(_0xbf3e4e,0xc9))['catch'](handleError(_0xbf3e4e,null));};exports['update']=function(_0x238b85,_0x878a08){if(_0x238b85[_0x83b8('0x47')]['id']){delete _0x238b85[_0x83b8('0x47')]['id'];}return db[_0x83b8('0x29')]['find']({'where':{'id':_0x238b85['params']['id']}})[_0x83b8('0x21')](handleEntityNotFound(_0x878a08,null))['then'](saveUpdates(_0x238b85[_0x83b8('0x47')],null))['then'](respondWithResult(_0x878a08,null))[_0x83b8('0x43')](handleError(_0x878a08,null));};exports['destroy']=function(_0x59e3ca,_0x19f4d6){return db[_0x83b8('0x29')][_0x83b8('0x45')]({'where':{'id':_0x59e3ca[_0x83b8('0x48')]['id']}})['then'](handleEntityNotFound(_0x19f4d6,null))[_0x83b8('0x21')](removeEntity(_0x19f4d6,null))[_0x83b8('0x43')](handleError(_0x19f4d6,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 8451990..5f71ce5 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 _0x2ca7=['../../config/environment','./openchannelApplication.attributes','exports','define','utf8mb4_unicode_ci','lodash','util','../../config/logger','request-promise','rimraf'];(function(_0x10d79d,_0x3c339c){var _0x5377c7=function(_0x3830ba){while(--_0x3830ba){_0x10d79d['push'](_0x10d79d['shift']());}};_0x5377c7(++_0x3c339c);}(_0x2ca7,0x1b3));var _0x72ca=function(_0x1f3c00,_0x2b86c0){_0x1f3c00=_0x1f3c00-0x0;var _0x1f0c29=_0x2ca7[_0x1f3c00];return _0x1f0c29;};'use strict';var _=require(_0x72ca('0x0'));var util=require(_0x72ca('0x1'));var logger=require(_0x72ca('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x72ca('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x72ca('0x4'));var config=require(_0x72ca('0x5'));var attributes=require(_0x72ca('0x6'));module[_0x72ca('0x7')]=function(_0x34d05a,_0x12ddfb){return _0x34d05a[_0x72ca('0x8')]('OpenchannelApplication',attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x72ca('0x9')});}; \ No newline at end of file +var _0x177f=['openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','path','rimraf','exports'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x177f,0x99));var _0xf177=function(_0xfedb8f,_0x5145fc){_0xfedb8f=_0xfedb8f-0x0;var _0x554626=_0x177f[_0xfedb8f];return _0x554626;};'use strict';var _=require(_0xf177('0x0'));var util=require(_0xf177('0x1'));var logger=require('../../config/logger')(_0xf177('0x2'));var moment=require('moment');var BPromise=require(_0xf177('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf177('0x4'));var rimraf=require(_0xf177('0x5'));var config=require('../../config/environment');var attributes=require('./openchannelApplication.attributes');module[_0xf177('0x6')]=function(_0x242757,_0x3f3c55){return _0x242757['define']('OpenchannelApplication',attributes,{'tableName':_0xf177('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf177('0x8'),'collate':_0xf177('0x9')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index fd71d04..2e6ef8a 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 _0xb10b=['then','info','OpenchannelApplication,\x20%s,\x20%s','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','UpdateOpenchannelApplication','OpenchannelApplication','update','options','raw','where','attributes','limit','debug','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x11fd5e,_0x349fbf){var _0x2badcf=function(_0x4a9e46){while(--_0x4a9e46){_0x11fd5e['push'](_0x11fd5e['shift']());}};_0x2badcf(++_0x349fbf);}(_0xb10b,0x12a));var _0xbb10=function(_0x2b8722,_0x50d540){_0x2b8722=_0x2b8722-0x0;var _0x20c180=_0xb10b[_0x2b8722];return _0x20c180;};'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?!![]:![]:!![],'individualHooks':!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1b')]||null:null,'limit':_0x378da8['options']?_0x378da8['options'][_0xbb10('0x1c')]||null:null})[_0xbb10('0xc')](function(_0x2e911d){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1d')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2e911d));_0x575cca(_0x2e911d);})[_0xbb10('0x1e')](function(_0x395404){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x395404['message'],_0x378da8);_0x30efc6(_0x1682a4['error'](0x1f4,_0x395404['message']));});});}; \ No newline at end of file +var _0xd8b0=['OpenchannelApplication','body','options','raw','where','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelApplication'];(function(_0x595bd1,_0xb1e7a){var _0xd0344f=function(_0x5eb2fd){while(--_0x5eb2fd){_0x595bd1['push'](_0x595bd1['shift']());}};_0xd0344f(++_0xb1e7a);}(_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 moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});}exports[_0x0d8b('0x16')]=function(_0x5fecbd){var _0x333674=this;return new Promise(function(_0x18dd2d,_0x264b39){return db[_0x0d8b('0x17')]['update'](_0x5fecbd[_0x0d8b('0x18')],{'raw':_0x5fecbd[_0x0d8b('0x19')]?_0x5fecbd[_0x0d8b('0x19')][_0x0d8b('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5fecbd[_0x0d8b('0x19')]?_0x5fecbd[_0x0d8b('0x19')][_0x0d8b('0x1b')]||null:null,'attributes':_0x5fecbd[_0x0d8b('0x19')]?_0x5fecbd['options']['attributes']||null:null,'limit':_0x5fecbd[_0x0d8b('0x19')]?_0x5fecbd['options']['limit']||null:null})['then'](function(_0x238728){logger[_0x0d8b('0xb')](_0x0d8b('0x16'),_0x5fecbd);logger[_0x0d8b('0xe')](_0x0d8b('0x16'),_0x5fecbd,JSON[_0x0d8b('0x10')](_0x238728));_0x18dd2d(_0x238728);})[_0x0d8b('0x15')](function(_0x4562cb){logger[_0x0d8b('0x11')]('UpdateOpenchannelApplication',_0x4562cb[_0x0d8b('0x13')],_0x5fecbd);_0x264b39(_0x333674[_0x0d8b('0x11')](0x1f4,_0x4562cb['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 050d201..c5a76d6 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 _0xc75d=['download','post','create','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','removeTags','multer','util','express','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','index','/describe','describe','/:id','show','/:id/messages','isAuthenticated','getMessages','/:id/download'];(function(_0x5285f7,_0x2b9fa0){var _0x12872c=function(_0x3ea440){while(--_0x3ea440){_0x5285f7['push'](_0x5285f7['shift']());}};_0x12872c(++_0x2b9fa0);}(_0xc75d,0x1d0));var _0xdc75=function(_0x24cc57,_0x263771){_0x24cc57=_0x24cc57-0x0;var _0xd95046=_0xc75d[_0x24cc57];return _0xd95046;};'use strict';var multer=require(_0xdc75('0x0'));var util=require(_0xdc75('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xdc75('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xdc75('0x3'));var config=require(_0xdc75('0x4'));var controller=require(_0xdc75('0x5'));router[_0xdc75('0x6')]('/',auth['isAuthenticated'](),controller[_0xdc75('0x7')]);router[_0xdc75('0x6')](_0xdc75('0x8'),auth['isAuthenticated'](),controller[_0xdc75('0x9')]);router[_0xdc75('0x6')](_0xdc75('0xa'),auth['isAuthenticated'](),controller[_0xdc75('0xb')]);router[_0xdc75('0x6')](_0xdc75('0xc'),auth[_0xdc75('0xd')](),controller[_0xdc75('0xe')]);router['get'](_0xdc75('0xf'),auth['isAuthenticated'](),controller[_0xdc75('0x10')]);router[_0xdc75('0x11')]('/',auth[_0xdc75('0xd')](),controller[_0xdc75('0x12')]);router['post'](_0xdc75('0xc'),auth['isAuthenticated'](),controller[_0xdc75('0x13')]);router['post'](_0xdc75('0x14'),auth[_0xdc75('0xd')](),interaction[_0xdc75('0x15')](_0xdc75('0x16'),_0xdc75('0x17')),controller[_0xdc75('0x18')]);router[_0xdc75('0x19')](_0xdc75('0xa'),auth[_0xdc75('0xd')](),interaction[_0xdc75('0x15')](_0xdc75('0x16'),_0xdc75('0x1a')),controller[_0xdc75('0x1b')]);router[_0xdc75('0x1c')](_0xdc75('0xa'),auth[_0xdc75('0xd')](),interaction[_0xdc75('0x15')](_0xdc75('0x16'),_0xdc75('0x1d')),controller[_0xdc75('0x1e')]);router[_0xdc75('0x1c')](_0xdc75('0x14'),auth[_0xdc75('0xd')](),controller[_0xdc75('0x1f')]);module['exports']=router; \ No newline at end of file +var _0xedd6=['../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/messages','getMessages','download','create','addMessage','post','/:id/tags','tracked','openchannel','put','openchannelinteraction:update','update','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x49d313,_0x5a6e3b){var _0x2291fd=function(_0x127a6e){while(--_0x127a6e){_0x49d313['push'](_0x49d313['shift']());}};_0x2291fd(++_0x5a6e3b);}(_0xedd6,0x155));var _0x6edd=function(_0x11a5d2,_0x1fed69){_0x11a5d2=_0x11a5d2-0x0;var _0x372ab6=_0xedd6[_0x11a5d2];return _0x372ab6;};'use strict';var multer=require(_0x6edd('0x0'));var util=require(_0x6edd('0x1'));var path=require(_0x6edd('0x2'));var timeout=require(_0x6edd('0x3'));var express=require(_0x6edd('0x4'));var router=express[_0x6edd('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x6edd('0x6'));var config=require(_0x6edd('0x7'));var controller=require(_0x6edd('0x8'));router[_0x6edd('0x9')]('/',auth[_0x6edd('0xa')](),controller[_0x6edd('0xb')]);router[_0x6edd('0x9')](_0x6edd('0xc'),auth[_0x6edd('0xa')](),controller[_0x6edd('0xd')]);router[_0x6edd('0x9')](_0x6edd('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x6edd('0x9')](_0x6edd('0xf'),auth['isAuthenticated'](),controller[_0x6edd('0x10')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0x6edd('0x11')]);router['post']('/',auth[_0x6edd('0xa')](),controller[_0x6edd('0x12')]);router['post'](_0x6edd('0xf'),auth['isAuthenticated'](),controller[_0x6edd('0x13')]);router[_0x6edd('0x14')](_0x6edd('0x15'),auth['isAuthenticated'](),interaction[_0x6edd('0x16')](_0x6edd('0x17'),'openchannelinteraction:addtags'),controller['addTags']);router[_0x6edd('0x18')](_0x6edd('0xe'),auth[_0x6edd('0xa')](),interaction['tracked'](_0x6edd('0x17'),_0x6edd('0x19')),controller[_0x6edd('0x1a')]);router['delete'](_0x6edd('0xe'),auth['isAuthenticated'](),interaction[_0x6edd('0x16')]('openchannel','openchannelinteraction:destroy'),controller['destroy']);router['delete'](_0x6edd('0x15'),auth[_0x6edd('0xa')](),controller[_0x6edd('0x1b')]);module[_0x6edd('0x1c')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 736a651..4783abe 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 _0xe1a2=['exports','BOOLEAN','DATE','STRING','ENUM','sequelize'];(function(_0x33d765,_0x4bdb71){var _0x3e2a19=function(_0xdc2bab){while(--_0xdc2bab){_0x33d765['push'](_0x33d765['shift']());}};_0x3e2a19(++_0x4bdb71);}(_0xe1a2,0x1e5));var _0x2e1a=function(_0x7791d5,_0xdab65f){_0x7791d5=_0x7791d5-0x0;var _0x5ce288=_0xe1a2[_0x7791d5];return _0x5ce288;};'use strict';var Sequelize=require(_0x2e1a('0x0'));module[_0x2e1a('0x1')]={'closed':{'type':Sequelize[_0x2e1a('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2e1a('0x3')]},'disposition':{'type':Sequelize[_0x2e1a('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x2e1a('0x3')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0x2e1a('0x4')]},'lastMsgAt':{'type':Sequelize[_0x2e1a('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x2e1a('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x2e1a('0x4')]}}; \ No newline at end of file +var _0x9e93=['DATE','out','exports','BOOLEAN','STRING'];(function(_0x2c5fbb,_0x5aff98){var _0x392ea3=function(_0x14708c){while(--_0x14708c){_0x2c5fbb['push'](_0x2c5fbb['shift']());}};_0x392ea3(++_0x5aff98);}(_0x9e93,0x13d));var _0x39e9=function(_0x281e5e,_0xf320e2){_0x281e5e=_0x281e5e-0x0;var _0x5a22d2=_0x9e93[_0x281e5e];return _0x5a22d2;};'use strict';var Sequelize=require('sequelize');module[_0x39e9('0x0')]={'closed':{'type':Sequelize[_0x39e9('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x39e9('0x2')]},'note':{'type':Sequelize[_0x39e9('0x2')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0x39e9('0x2')]},'lastMsgAt':{'type':Sequelize[_0x39e9('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x39e9('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x39e9('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 317b286..023313b 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 _0xb640=['Users','map','Tags','TagIds','forEach','push','catch','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','select','field','tools_tags','u.id','u.fullname','ui.OpenchannelInteractionId','from','user_has_openchannel_interactions','left_join','u.id\x20=\x20ui.UserId','openchannel_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','operator','$substring','split','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','buildExpression','some','compact','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','OpenchannelInteraction','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','all','show','params','includeAll','include','merge','options','create','body','update','describe','addMessage','omit','ids','getMessages','hasOwnProperty','OpenchannelInteractionId','YYYY-MM-DD\x20HH:mm:ss','OpenchannelMessage','findAll','rows','addTags','setTags','spread','emit','openchannelInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','format','CmContact','Contact','attachments','Messages','direction','secret','OpenchannelAccount','Account','Owner','fullname','get','mkdirSync','10px','40px','\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\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\x20\x20\x20\x20\x20\x20\x20','30px','\x0a\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\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20','%s\x20#%d','Openchannel','N.A.','closedAt','disposition','threadId','Public','Private','Attachment','existsSync','createReadStream','createWriteStream','basename','out','System','firstName','lastName','renderFile','downloadInteraction.html','toFile','.pdf','log','err','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','status','json','count','offset','set','Content-Range','apply','reject','save','destroy','then','end','sendStatus','error','stack','name','send'];(function(_0x587388,_0x5553f2){var _0x598f29=function(_0x124feb){while(--_0x124feb){_0x587388['push'](_0x587388['shift']());}};_0x598f29(++_0x5553f2);}(_0xb640,0xc7));var _0x0b64=function(_0x1408db,_0x4eb2a8){_0x1408db=_0x1408db-0x0;var _0x4f7cf7=_0xb640[_0x1408db];return _0x4f7cf7;};'use strict';var pdf=require(_0x0b64('0x0'));var emlformat=require(_0x0b64('0x1'));var rimraf=require(_0x0b64('0x2'));var zipdir=require(_0x0b64('0x3'));var jsonpatch=require(_0x0b64('0x4'));var rp=require(_0x0b64('0x5'));var moment=require(_0x0b64('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x0b64('0x7'));var util=require(_0x0b64('0x8'));var path=require(_0x0b64('0x9'));var sox=require('sox');var csv=require(_0x0b64('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0b64('0xb'));var squel=require(_0x0b64('0xc'));var crypto=require(_0x0b64('0xd'));var jsforce=require(_0x0b64('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0b64('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0b64('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x0b64('0x10'));var as=require(_0x0b64('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0b64('0x12'))(_0x0b64('0x13'));var utils=require(_0x0b64('0x14'));var config=require(_0x0b64('0x15'));var db=require(_0x0b64('0x16'))['db'];config[_0x0b64('0x17')]=_[_0x0b64('0x18')](config[_0x0b64('0x17')],{'host':_0x0b64('0x19'),'port':0x18eb});var socket=require(_0x0b64('0x1a'))(new Redis(config['redis']));require(_0x0b64('0x1b'))[_0x0b64('0x1c')](socket);function respondWithStatusCode(_0x12b1ba,_0x3904ae){_0x3904ae=_0x3904ae||0xcc;return function(_0x54160e){if(_0x54160e){return _0x12b1ba['sendStatus'](_0x3904ae);}return _0x12b1ba[_0x0b64('0x1d')](_0x3904ae)['end']();};}function respondWithResult(_0x4748f2,_0x2a397e){_0x2a397e=_0x2a397e||0xc8;return function(_0x46f65b){if(_0x46f65b){return _0x4748f2[_0x0b64('0x1d')](_0x2a397e)[_0x0b64('0x1e')](_0x46f65b);}};}function respondWithFilteredResult(_0x431a17,_0x419efc){return function(_0xdf4f10){if(_0xdf4f10){var _0x820652=_0xdf4f10[_0x0b64('0x1f')],_0x1eaf1d=_0x419efc['offset'],_0x422d0a=_0x419efc[_0x0b64('0x20')]+_0x419efc['limit'],_0x31431c;if(_0x422d0a>=_0x820652){_0x422d0a=_0x820652;_0x31431c=0xc8;}else{_0x31431c=0xce;}_0x431a17['status'](_0x31431c);return _0x431a17[_0x0b64('0x21')](_0x0b64('0x22'),_0x1eaf1d+'-'+_0x422d0a+'/'+_0x820652)[_0x0b64('0x1e')](_0xdf4f10);}return null;};}function patchUpdates(_0x51b941){return function(_0x517f76){try{jsonpatch[_0x0b64('0x23')](_0x517f76,_0x51b941,!![]);}catch(_0x52f4d6){return BPromise[_0x0b64('0x24')](_0x52f4d6);}return _0x517f76[_0x0b64('0x25')]();};}function saveUpdates(_0x52d6d9,_0x5d01fd){return function(_0x321d70){if(_0x321d70){return _0x321d70['update'](_0x52d6d9)['then'](function(_0x4cd7a3){return _0x4cd7a3;});}return null;};}function removeEntity(_0x1a0d3b,_0x220dc8){return function(_0x42f322){if(_0x42f322){return _0x42f322[_0x0b64('0x26')]()[_0x0b64('0x27')](function(){_0x1a0d3b[_0x0b64('0x1d')](0xcc)[_0x0b64('0x28')]();});}};}function handleEntityNotFound(_0x53844d,_0x31bf4a){return function(_0x17f799){if(!_0x17f799){_0x53844d[_0x0b64('0x29')](0x194);}return _0x17f799;};}function handleError(_0x6e85c6,_0x5d9001){_0x5d9001=_0x5d9001||0x1f4;return function(_0x117341){logger[_0x0b64('0x2a')](_0x117341[_0x0b64('0x2b')]);if(_0x117341[_0x0b64('0x2c')]){delete _0x117341[_0x0b64('0x2c')];}_0x6e85c6['status'](_0x5d9001)[_0x0b64('0x2d')](_0x117341);};}function getInteractionUsers(_0x5e70be,_0x2b5bd1){return new BPromise(function(_0x4c9631,_0x55b6a9){try{if(_0x2b5bd1[_0x5e70be['id']]){_0x5e70be[_0x0b64('0x2e')]=_[_0x0b64('0x2f')](_0x2b5bd1[_0x5e70be['id']],function(_0x3e4771){return{'id':_0x3e4771['id'],'fullname':_0x3e4771['fullname']};});}}catch(_0x5d9c9d){_0x55b6a9(_0x5d9c9d);}_0x4c9631(_0x5e70be);});}function getInteractionTags(_0x4fef6b,_0xadca07){return new BPromise(function(_0xe7c89a,_0x166048){try{if(_0x4fef6b['TagIds']){_0x4fef6b[_0x0b64('0x30')]=[];_0x4fef6b[_0x0b64('0x31')]['split'](',')[_0x0b64('0x32')](function(_0x2f5f28){_0x4fef6b[_0x0b64('0x30')][_0x0b64('0x33')](_0xadca07[_0x2f5f28]);});}delete _0x4fef6b[_0x0b64('0x31')];}catch(_0x392ae5){_0x166048(_0x392ae5);}_0xe7c89a(_0x4fef6b);});}function updateOpenchannelInteraction(_0x22ed37,_0x2b71ca,_0x4a1f06){return new BPromise(function(_0x31d0aa,_0x21ef6){return getInteractionUsers(_0x22ed37,_0x4a1f06)['then'](function(_0x1ab89b){return getInteractionTags(_0x1ab89b,_0x2b71ca);})['then'](function(_0x376206){_0x31d0aa(_0x376206);})[_0x0b64('0x34')](function(_0x73a615){_0x21ef6(_0x73a615);});});}exports['index']=function(_0xf0cee4,_0x11fc6e){var _0xa4a1b6={},_0x3af39b={},_0x4098c3={'count':0x0,'rows':[]};var _0x33ec26=_['map'](db['OpenchannelInteraction'][_0x0b64('0x35')],function(_0x355b2b){return{'name':_0x355b2b[_0x0b64('0x36')],'type':_0x355b2b[_0x0b64('0x37')][_0x0b64('0x38')]};});_0x3af39b[_0x0b64('0x39')]=_[_0x0b64('0x2f')](_0x33ec26,_0x0b64('0x2c'));_0x3af39b['query']=_[_0x0b64('0x3a')](_0xf0cee4[_0x0b64('0x3b')]);_0x3af39b[_0x0b64('0x3c')]=_[_0x0b64('0x3d')](_0x3af39b[_0x0b64('0x39')],_0x3af39b['query']);_0xa4a1b6[_0x0b64('0x3e')]=_['intersection'](_0x3af39b[_0x0b64('0x39')],qs['fields'](_0xf0cee4['query'][_0x0b64('0x3f')]));_0xa4a1b6[_0x0b64('0x3e')]=_0xa4a1b6[_0x0b64('0x3e')][_0x0b64('0x40')]?_0xa4a1b6['attributes']:_0x3af39b['model'];if(!_0xf0cee4[_0x0b64('0x3b')]['hasOwnProperty'](_0x0b64('0x41'))){_0xa4a1b6[_0x0b64('0x42')]=qs[_0x0b64('0x42')](_0xf0cee4[_0x0b64('0x3b')]['limit']);_0xa4a1b6['offset']=qs[_0x0b64('0x20')](_0xf0cee4['query'][_0x0b64('0x20')]);}_0xa4a1b6[_0x0b64('0x43')]=qs[_0x0b64('0x44')](_0xf0cee4[_0x0b64('0x3b')][_0x0b64('0x44')]);_0xa4a1b6[_0x0b64('0x45')]=qs[_0x0b64('0x3c')](_[_0x0b64('0x46')](_0xf0cee4[_0x0b64('0x3b')],_0x3af39b['filters']));var _0x545662=[];var _0x4de49e=squel[_0x0b64('0x47')]()['field']('id')['field']('name')[_0x0b64('0x48')]('color')['from'](_0x0b64('0x49'));var _0x23abce=squel[_0x0b64('0x47')]()['field'](_0x0b64('0x4a'))[_0x0b64('0x48')](_0x0b64('0x4b'))[_0x0b64('0x48')](_0x0b64('0x4c'))[_0x0b64('0x4d')](_0x0b64('0x4e'),'ui')[_0x0b64('0x4f')]('users','u',_0x0b64('0x50'));var _0x44ca5d=squel[_0x0b64('0x47')]()[_0x0b64('0x4d')](_0x0b64('0x51'),'i')[_0x0b64('0x4f')]('cm_contacts','c',_0x0b64('0x52'))[_0x0b64('0x4f')](_0x0b64('0x53'),'o',_0x0b64('0x54'))[_0x0b64('0x4f')](_0x0b64('0x55'),'a',_0x0b64('0x56'))[_0x0b64('0x4f')]('openchannel_messages','me',_0x0b64('0x57'))[_0x0b64('0x4f')](_0x0b64('0x58'),'it',_0x0b64('0x59'))[_0x0b64('0x4f')](_0x0b64('0x49'),'t',_0x0b64('0x5a'));var _0xc4810b=squel[_0x0b64('0x5b')]();var _0x418392=[];var _0x2942f5=squel[_0x0b64('0x5b')]();var _0x234291;if(_0xf0cee4[_0x0b64('0x3b')][_0x0b64('0x5c')]){_0x234291=as[_0x0b64('0x5d')](_0xf0cee4['query'][_0x0b64('0x5c')]);var _0x1e6e9f=_0x234291[_0x0b64('0x5e')];for(var _0xf6abae=0x0;_0xf6abae<_0x234291[_0x0b64('0x5f')][_0x0b64('0x40')];_0xf6abae++){var _0x2dc537=_0x234291[_0x0b64('0x5f')][_0xf6abae];var _0x1efcdd='i';var _0x49146b=_[_0x0b64('0x60')](_0x33ec26,['name',_0x2dc537[_0x0b64('0x48')]]);if(!_0x49146b){switch(_0x2dc537[_0x0b64('0x48')]){case _0x0b64('0x61'):if(_0x2dc537[_0x0b64('0x62')]==0x1){_0x44ca5d[_0x0b64('0x63')]('`'+_0x2dc537[_0x0b64('0x48')]+_0x0b64('0x64'));}else{_0x44ca5d['having']('`'+_0x2dc537['field']+_0x0b64('0x65'));}break;case'Contact':if(_0x2dc537[_0x0b64('0x66')]===_0x0b64('0x67')){if(_0x2dc537['value'][_0x0b64('0x68')]('\x20')[_0x0b64('0x40')]>0x1){_0xc4810b[_0x1e6e9f]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0b64('0x69')](_0x2dc537[_0x0b64('0x62')]),null);}else{var _0x2db881='%'+_0x2dc537['value']+'%';_0xc4810b[_0x1e6e9f](_0x0b64('0x6a'),_0x2db881,_0x2db881,_0x2db881);}}else{_0x49146b=_[_0x0b64('0x60')](_0x33ec26,[_0x0b64('0x2c'),_0x0b64('0x6b')]);_0x2dc537[_0x0b64('0x48')]=_0x0b64('0x6b');_0x269c27=as['buildExpression'](_0x1efcdd,_0x49146b[_0x0b64('0x37')],_0x2dc537);_0xc4810b[_0x1e6e9f](_0x269c27[_0x0b64('0x6c')],_0x269c27[_0x0b64('0x62')]['start'],_0x269c27[_0x0b64('0x62')][_0x0b64('0x28')]);}break;case _0x0b64('0x6d'):var _0x3d9057=_0x2dc537[_0x0b64('0x62')][_0x0b64('0x68')](',')[_0x0b64('0x2f')](function(_0x2f0ffe){return Number(_0x2f0ffe);});_0x3d9057[_0x0b64('0x32')](function(_0x3d4b34){_0x2942f5['or'](_0x0b64('0x6e'),'%,'+_0x3d4b34+',%');});_0x418392=_[_0x0b64('0x6f')](_0x418392,_0x3d9057);break;case _0x0b64('0x70'):if(_0x2dc537[_0x0b64('0x66')]==='$substring'){_0xc4810b[_0x1e6e9f](_0x0b64('0x71'),'%'+_0x2dc537[_0x0b64('0x62')]+'%',null);}else{_0x49146b=_[_0x0b64('0x60')](_0x33ec26,['name',_0x0b64('0x72')]);_0x2dc537[_0x0b64('0x48')]=_0x0b64('0x72');_0x269c27=as['buildExpression'](_0x1efcdd,_0x49146b[_0x0b64('0x37')],_0x2dc537);_0xc4810b[_0x1e6e9f](_0x269c27[_0x0b64('0x6c')],_0x269c27['value'][_0x0b64('0x73')],_0x269c27['value']['end']);}break;case'body':_0x269c27=as[_0x0b64('0x74')]('me',null,_0x2dc537);_0xc4810b[_0x1e6e9f](_0x269c27[_0x0b64('0x6c')],_0x269c27[_0x0b64('0x62')][_0x0b64('0x73')],_0x269c27[_0x0b64('0x62')][_0x0b64('0x28')]);break;}}else{var _0x269c27=as[_0x0b64('0x74')](_0x1efcdd,_0x49146b['type'],_0x2dc537);_0xc4810b[_0x1e6e9f](_0x269c27[_0x0b64('0x6c')],_0x269c27['value'][_0x0b64('0x73')],_0x269c27[_0x0b64('0x62')][_0x0b64('0x28')]);}}}else{var _0xbb89a9=_(_0xf0cee4[_0x0b64('0x3b')])['keys']()[_0x0b64('0x2f')](function(_0x1e12ae){return _[_0x0b64('0x75')](_0x33ec26,[_0x0b64('0x2c'),_0x1e12ae])?_0x1e12ae:undefined;})[_0x0b64('0x76')]()[_0x0b64('0x62')]();if(!_[_0x0b64('0x77')](_0xbb89a9)){_0xbb89a9['forEach'](function(_0x5248de){if(_0x5248de===_0x0b64('0x78')){_0x44ca5d[_0x0b64('0x45')](_0x0b64('0x79'),[][_0x0b64('0x7a')](_0xf0cee4[_0x0b64('0x3b')][_0x5248de]));}else if(_0x5248de===_0x0b64('0x7b')){var _0x1805b9=JSON[_0x0b64('0x7c')](_0xf0cee4['query'][_0x5248de])[_0x0b64('0x7d')];var _0x407ba9=JSON[_0x0b64('0x7c')](_0xf0cee4[_0x0b64('0x3b')][_0x5248de])[_0x0b64('0x7e')];_0x44ca5d['where'](_0x0b64('0x7f'),_0x1805b9,_0x407ba9);}else{if(_0xf0cee4[_0x0b64('0x3b')][_0x5248de]===_0x0b64('0x80')){_0x44ca5d[_0x0b64('0x45')]('i.'+_0x5248de+'\x20IS\x20NULL');}else{_0x44ca5d[_0x0b64('0x45')]('i.'+_0x5248de+_0x0b64('0x81'),_0xf0cee4[_0x0b64('0x3b')][_0x5248de]);}}});}if(_0xf0cee4[_0x0b64('0x3b')]['read']){if(_0xf0cee4['query'][_0x0b64('0x82')]==0x1){_0x44ca5d[_0x0b64('0x63')](_0x0b64('0x83'));}else{_0x44ca5d['having']('`unreadMessages`\x20>\x200');}}if(_0xf0cee4[_0x0b64('0x3b')][_0x0b64('0x84')]){_0x418392=_[_0x0b64('0x85')](_0xf0cee4[_0x0b64('0x3b')][_0x0b64('0x84')])?_0xf0cee4[_0x0b64('0x3b')]['tag']:new Array(_0xf0cee4[_0x0b64('0x3b')]['tag']);_0x418392['forEach'](function(_0x27b8c2){_0x2942f5['or'](_0x0b64('0x6e'),'%,'+_0x27b8c2+',%');});}if(_0xf0cee4['query']['filter']){var _0x9f6f14=_0xf0cee4[_0x0b64('0x3b')][_0x0b64('0x86')]['replace']('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x0b64('0x87'));if(qs[_0x0b64('0x88')](_0x9f6f14)){_0xc4810b['or'](_0x0b64('0x89'),_0x9f6f14+'%');}else{_0xc4810b['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0b64('0x69')](_0x9f6f14))['or'](_0x0b64('0x8a'),_0x9f6f14+'%')['or'](_0x0b64('0x8b'),_0x9f6f14+'%');}}}_0x44ca5d[_0x0b64('0x45')](_0xc4810b);_0x44ca5d[_0x0b64('0x8c')]('i.id');var _0x12a61c={'type':db[_0x0b64('0x8d')][_0x0b64('0x8e')]['SELECT'],'raw':!![]};var _0x43edf5=_0x44ca5d[_0x0b64('0x8f')]();_0x43edf5[_0x0b64('0x48')](_0x0b64('0x90'));_0x43edf5[_0x0b64('0x48')](_0x0b64('0x91'),'unreadMessages');if(_0xa4a1b6[_0x0b64('0x43')]){_0xa4a1b6[_0x0b64('0x43')][_0x0b64('0x32')](function(_0x48c93b){_0x44ca5d[_0x0b64('0x43')]('i.'+_0x48c93b[0x0],_0x48c93b[0x1]===_0x0b64('0x92')?![]:!![]);});}if(!_[_0x0b64('0x77')](_0x418392)){_0x44ca5d[_0x0b64('0x63')](_0x2942f5);_0x43edf5[_0x0b64('0x45')](_0x0b64('0x93'),_0x418392);}BPromise[_0x0b64('0x94')]()[_0x0b64('0x27')](function(){if(!_0x234291&&_0xf0cee4[_0x0b64('0x3b')]['OpenchannelAccountId'])return;return _0xf0cee4['user'][_0x0b64('0x95')]({'attributes':['id'],'raw':!![]})[_0x0b64('0x27')](function(_0x9d7483){if(_[_0x0b64('0x77')](_0x9d7483)){_0x43edf5[_0x0b64('0x45')]('i.OpenchannelAccountId\x20IS\x20NULL');_0x44ca5d['where'](_0x0b64('0x96'));}else{_0x43edf5[_0x0b64('0x45')](_0x0b64('0x79'),_[_0x0b64('0x2f')](_0x9d7483,'id'));_0x44ca5d[_0x0b64('0x45')]('i.OpenchannelAccountId\x20IN\x20?',_['map'](_0x9d7483,'id'));}});})[_0x0b64('0x27')](function(){db[_0x0b64('0x97')][_0x0b64('0x3b')](_0x43edf5[_0x0b64('0x98')](),_0x12a61c)[_0x0b64('0x27')](function(_0x5b89e1){_0x4098c3[_0x0b64('0x1f')]=_0x5b89e1[_0x0b64('0x40')];if(_0x4098c3['count']===0x0)return[];return db['sequelize'][_0x0b64('0x3b')](_0x4de49e[_0x0b64('0x98')](),_0x12a61c)[_0x0b64('0x27')](function(_0x4a7f17){_0x545662=_['keyBy'](_0x4a7f17,'id');_0x12a61c=_['merge'](_0x12a61c,{'model':db[_0x0b64('0x99')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xf0cee4[_0x0b64('0x3b')][_0x0b64('0x3f')]){_0xa4a1b6[_0x0b64('0x3e')][_0x0b64('0x32')](function(_0x1ad407){_0x44ca5d['field']('i.'+_0x1ad407);});}else{_0x44ca5d['field'](_0x0b64('0x91'),_0x0b64('0x61'));_0x44ca5d[_0x0b64('0x48')]('a.key','Account.key');_0x44ca5d[_0x0b64('0x48')](_0x0b64('0x9a'),_0x0b64('0x9b'));_0x44ca5d[_0x0b64('0x48')](_0x0b64('0x9c'));_0x44ca5d[_0x0b64('0x48')]('c.firstName',_0x0b64('0x9d'));_0x44ca5d[_0x0b64('0x48')](_0x0b64('0x9e'),'Contact.lastName');_0x44ca5d[_0x0b64('0x48')](_0x0b64('0x9f'),_0x0b64('0xa0'));_0x44ca5d['field'](_0x0b64('0xa1'),_0x0b64('0xa2'));_0x44ca5d[_0x0b64('0x48')](_0x0b64('0xa3'),'Contact.mobile');_0x44ca5d[_0x0b64('0x48')](_0x0b64('0xa4'),_0x0b64('0xa5'));_0x44ca5d[_0x0b64('0x48')]('o.fullname',_0x0b64('0xa6'));_0x44ca5d[_0x0b64('0x48')]('o.internal','Owner.internal');_0x44ca5d[_0x0b64('0x48')](_0x0b64('0xa7'),_0x0b64('0x31'));}_0x44ca5d[_0x0b64('0x42')](_0xa4a1b6['limit']);_0x44ca5d['offset'](_0xa4a1b6[_0x0b64('0x20')]);return db[_0x0b64('0x97')][_0x0b64('0x3b')](_0x44ca5d[_0x0b64('0x98')](),_0x12a61c);})[_0x0b64('0x27')](function(_0x42c4df){_0x23abce[_0x0b64('0x45')](_0x0b64('0xa8'),_[_0x0b64('0x2f')](_0x42c4df,'id'));return db[_0x0b64('0x97')][_0x0b64('0x3b')](_0x23abce[_0x0b64('0x98')](),_0x12a61c)[_0x0b64('0x27')](function(_0x31392f){var _0x57da0f=_[_0x0b64('0xa9')](_0x31392f,'OpenchannelInteractionId');var _0x52c4d2=[];_0x42c4df['forEach'](function(_0x1da888){_0x52c4d2[_0x0b64('0x33')](updateOpenchannelInteraction(_0x1da888,_0x545662,_0x57da0f));});return BPromise[_0x0b64('0xaa')](_0x52c4d2);});});})[_0x0b64('0x27')](function(_0x5d31d2){_0x4098c3['rows']=_0x5d31d2;return _0x4098c3;})[_0x0b64('0x27')](respondWithFilteredResult(_0x11fc6e,_0xa4a1b6));})[_0x0b64('0x34')](handleError(_0x11fc6e,null));};exports[_0x0b64('0xab')]=function(_0x5cf348,_0xa350d4){var _0x5e5538={'raw':![],'where':{'id':_0x5cf348[_0x0b64('0xac')]['id']}},_0x5e8394={};_0x5e8394[_0x0b64('0x39')]=_['keys'](db[_0x0b64('0x99')][_0x0b64('0x35')]);_0x5e8394[_0x0b64('0x3b')]=_[_0x0b64('0x3a')](_0x5cf348['query']);_0x5e8394[_0x0b64('0x3c')]=_[_0x0b64('0x3d')](_0x5e8394[_0x0b64('0x39')],_0x5e8394[_0x0b64('0x3b')]);_0x5e5538[_0x0b64('0x3e')]=_['intersection'](_0x5e8394[_0x0b64('0x39')],qs[_0x0b64('0x3f')](_0x5cf348[_0x0b64('0x3b')][_0x0b64('0x3f')]));_0x5e5538[_0x0b64('0x3e')]=_0x5e5538[_0x0b64('0x3e')][_0x0b64('0x40')]?_0x5e5538[_0x0b64('0x3e')]:_0x5e8394[_0x0b64('0x39')];if(_0x5cf348['query'][_0x0b64('0xad')]){_0x5e5538[_0x0b64('0xae')]=[{'all':!![]}];}_0x5e5538=_[_0x0b64('0xaf')]({},_0x5e5538,_0x5cf348[_0x0b64('0xb0')]);return db['OpenchannelInteraction']['find'](_0x5e5538)['then'](handleEntityNotFound(_0xa350d4,null))[_0x0b64('0x27')](respondWithResult(_0xa350d4,null))[_0x0b64('0x34')](handleError(_0xa350d4,null));};exports[_0x0b64('0xb1')]=function(_0x4b9014,_0x542347){return db[_0x0b64('0x99')]['create'](_0x4b9014[_0x0b64('0xb2')],{})[_0x0b64('0x27')](respondWithResult(_0x542347,0xc9))[_0x0b64('0x34')](handleError(_0x542347,null));};exports[_0x0b64('0xb3')]=function(_0x28df22,_0x305db3){if(_0x28df22[_0x0b64('0xb2')]['id']){delete _0x28df22[_0x0b64('0xb2')]['id'];}return db[_0x0b64('0x99')][_0x0b64('0x60')]({'where':{'id':_0x28df22['params']['id']}})[_0x0b64('0x27')](handleEntityNotFound(_0x305db3,null))[_0x0b64('0x27')](saveUpdates(_0x28df22[_0x0b64('0xb2')],null))[_0x0b64('0x27')](respondWithResult(_0x305db3,null))[_0x0b64('0x34')](handleError(_0x305db3,null));};exports[_0x0b64('0x26')]=function(_0x21bdf0,_0x56127d){return db[_0x0b64('0x99')][_0x0b64('0x60')]({'where':{'id':_0x21bdf0[_0x0b64('0xac')]['id']}})[_0x0b64('0x27')](handleEntityNotFound(_0x56127d,null))[_0x0b64('0x27')](removeEntity(_0x56127d,null))[_0x0b64('0x34')](handleError(_0x56127d,null));};exports['describe']=function(_0x4c08c6,_0x472a3f){return db[_0x0b64('0x99')][_0x0b64('0xb4')]()[_0x0b64('0x27')](respondWithResult(_0x472a3f,null))[_0x0b64('0x34')](handleError(_0x472a3f,null));};exports['addMessage']=function(_0x2615b4,_0xc587c6,_0x371aff){return db['OpenchannelMessage']['find']({'where':{'id':_0x2615b4[_0x0b64('0xac')]['id']}})[_0x0b64('0x27')](handleEntityNotFound(_0xc587c6,null))[_0x0b64('0x27')](function(_0x3fd930){if(_0x3fd930){return _0x3fd930[_0x0b64('0xb5')](_0x2615b4[_0x0b64('0xb2')]['ids'],_[_0x0b64('0xb6')](_0x2615b4[_0x0b64('0xb2')],[_0x0b64('0xb7'),'id'])||{});}})[_0x0b64('0x27')](respondWithResult(_0xc587c6,null))[_0x0b64('0x34')](handleError(_0xc587c6,null));};exports[_0x0b64('0xb8')]=function(_0x1d2527,_0x2b8356,_0x10b48){var _0x23cae9={'raw':![],'where':{}};var _0x46425e={};var _0x401337={'count':0x0,'rows':[]};return db[_0x0b64('0x99')]['findOne']({'where':{'id':_0x1d2527['params']['id']}})[_0x0b64('0x27')](handleEntityNotFound(_0x2b8356,null))[_0x0b64('0x27')](function(_0x35b347){if(_0x35b347){_0x46425e['model']=_['keys'](db['OpenchannelMessage'][_0x0b64('0x35')]);_0x46425e[_0x0b64('0x3b')]=_[_0x0b64('0x3a')](_0x1d2527[_0x0b64('0x3b')]);_0x46425e[_0x0b64('0x3c')]=_[_0x0b64('0x3d')](_0x46425e[_0x0b64('0x39')],_0x46425e['query']);_0x23cae9['attributes']=_[_0x0b64('0x3d')](_0x46425e[_0x0b64('0x39')],qs[_0x0b64('0x3f')](_0x1d2527['query']['fields']));_0x23cae9['attributes']=_0x23cae9[_0x0b64('0x3e')][_0x0b64('0x40')]?_0x23cae9['attributes']:_0x46425e[_0x0b64('0x39')];if(!_0x1d2527[_0x0b64('0x3b')][_0x0b64('0xb9')]('nolimit')){_0x23cae9[_0x0b64('0x42')]=qs[_0x0b64('0x42')](_0x1d2527[_0x0b64('0x3b')][_0x0b64('0x42')]);_0x23cae9[_0x0b64('0x20')]=qs[_0x0b64('0x20')](_0x1d2527[_0x0b64('0x3b')]['offset']);}_0x23cae9['order']=qs[_0x0b64('0x44')](_0x1d2527[_0x0b64('0x3b')][_0x0b64('0x44')]);_0x23cae9[_0x0b64('0x45')]=qs[_0x0b64('0x3c')](_[_0x0b64('0x46')](_0x1d2527[_0x0b64('0x3b')],_0x46425e['filters']));_0x23cae9[_0x0b64('0x45')][_0x0b64('0xba')]=_0x35b347['id'];if(_0x1d2527[_0x0b64('0x3b')][_0x0b64('0x86')]){_0x23cae9[_0x0b64('0x45')]=_['merge'](_0x23cae9['where'],{'$or':_['map'](_0x23cae9['attributes'],function(_0x36c411){var _0x38b325={};_0x38b325[_0x36c411]={'$like':'%'+_0x1d2527[_0x0b64('0x3b')][_0x0b64('0x86')]+'%'};return _0x38b325;})});}if(_0x1d2527[_0x0b64('0x3b')]['$gte']){var _0xb33a8c=_0x1d2527['query']['$gte']['split'](',');var _0x1a92e5={};_0x1a92e5[_0xb33a8c[0x0]]={'$gte':moment(_0xb33a8c[0x1])['format'](_0x0b64('0xbb'))};_0x23cae9[_0x0b64('0x45')]=_['merge'](_0x23cae9[_0x0b64('0x45')],_0x1a92e5);}_0x23cae9=_[_0x0b64('0xaf')]({},_0x23cae9,_0x1d2527[_0x0b64('0xb0')]);return db[_0x0b64('0xbc')][_0x0b64('0x1f')]({'where':_0x23cae9[_0x0b64('0x45')]})[_0x0b64('0x27')](function(_0xb68fb1){_0x401337[_0x0b64('0x1f')]=_0xb68fb1;if(_0x1d2527[_0x0b64('0x3b')]['includeAll']){_0x23cae9[_0x0b64('0xae')]=[{'all':!![]}];}return db[_0x0b64('0xbc')][_0x0b64('0xbd')](_0x23cae9);})['then'](function(_0x487931){_0x401337[_0x0b64('0xbe')]=_0x487931;return _0x401337;});}})['then'](respondWithFilteredResult(_0x2b8356,_0x23cae9))[_0x0b64('0x34')](handleError(_0x2b8356,null));};exports[_0x0b64('0xbf')]=function(_0x1d09ca,_0xf43be9,_0x16a8d4){return db[_0x0b64('0x99')]['find']({'where':{'id':_0x1d09ca['params']['id']}})[_0x0b64('0x27')](handleEntityNotFound(_0xf43be9,null))[_0x0b64('0x27')](function(_0x3a0f5f){if(_0x3a0f5f){return _0x3a0f5f[_0x0b64('0xc0')](_0x1d09ca[_0x0b64('0xb2')][_0x0b64('0xb7')],_[_0x0b64('0xb6')](_0x1d09ca['body'],['ids','id'])||{})[_0x0b64('0xc1')](function(){return db[_0x0b64('0x6d')]['findAll']({'attributes':['id','name','color'],'where':{'id':_0x1d09ca[_0x0b64('0xb2')][_0x0b64('0xb7')]}});})[_0x0b64('0x27')](function(_0x1a2052){socket[_0x0b64('0xc2')](_0x0b64('0xc3'),{'id':Number(_0x1d09ca[_0x0b64('0xac')]['id']),'tags':_0x1a2052||[]});return{'id':Number(_0x1d09ca[_0x0b64('0xac')]['id']),'tags':_0x1a2052||[]};});}})[_0x0b64('0x27')](respondWithResult(_0xf43be9,null))['catch'](handleError(_0xf43be9,null));};exports[_0x0b64('0xc4')]=function(_0x40f799,_0x27aa4d,_0x1dda1c){return db[_0x0b64('0x99')][_0x0b64('0x60')]({'where':{'id':_0x40f799['params']['id']}})[_0x0b64('0x27')](handleEntityNotFound(_0x27aa4d,null))[_0x0b64('0x27')](function(_0x5bcc5b){if(_0x5bcc5b){return _0x5bcc5b[_0x0b64('0xc4')](_0x40f799['query']['ids']);}})[_0x0b64('0x27')](respondWithStatusCode(_0x27aa4d,null))['catch'](handleError(_0x27aa4d,null));};exports[_0x0b64('0xc5')]=function(_0xca274a,_0x2987f8){var _0x55960b=moment()[_0x0b64('0xc6')]()[_0x0b64('0x98')]();var _0x30254e=path[_0x0b64('0xc7')](config[_0x0b64('0xc8')],_0x0b64('0xc9'),_0x0b64('0xca'),_0x0b64('0xcb'));var _0xd6ae09=path[_0x0b64('0xc7')](config['root'],_0x0b64('0xc9'),_0x0b64('0xca'),'attachments');var _0xd85552=path['join'](_0x30254e,_0x55960b);var _0xf11ad4=util[_0x0b64('0xcc')]('transcript-%d-%s.zip',_0xca274a['params']['id'],_0x55960b);var _0x5061b0=path[_0x0b64('0xc7')](_0x30254e,_0xf11ad4);var _0x3d9230=[];_0x3d9230['push']({'model':db[_0x0b64('0x70')],'as':_0x0b64('0x70'),'attributes':['id','fullname'],'raw':!![]});_0x3d9230[_0x0b64('0x33')]({'model':db[_0x0b64('0xcd')],'as':_0x0b64('0xce'),'attributes':['id','firstName','lastName'],'raw':!![]});if(_0xca274a['query'][_0x0b64('0xcf')]){_0x3d9230[_0x0b64('0x33')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x4fbd9e=[{'model':db[_0x0b64('0xbc')],'as':_0x0b64('0xd0'),'attributes':['id',_0x0b64('0xb2'),'createdAt',_0x0b64('0xd1'),_0x0b64('0xd2'),_0x0b64('0x82')],'include':_0x3d9230}];_0x4fbd9e[_0x0b64('0x33')]({'model':db[_0x0b64('0xd3')],'as':_0x0b64('0xd4'),'attributes':['id',_0x0b64('0x2c')]});_0x4fbd9e[_0x0b64('0x33')]({'model':db[_0x0b64('0x70')],'as':_0x0b64('0xd5'),'attributes':['id',_0x0b64('0xd6')]});return db['OpenchannelInteraction'][_0x0b64('0x60')]({'where':{'id':_0xca274a['params']['id']},'include':_0x4fbd9e})[_0x0b64('0x27')](handleEntityNotFound(_0x2987f8,null))[_0x0b64('0x27')](function(_0x28b2a0){if(_0x28b2a0){var _0x53a9c4=_0x28b2a0[_0x0b64('0xd7')]({'plain':!![]});fs[_0x0b64('0xd8')](_0xd85552);var _0xe17af={'format':'A4','border':_0x0b64('0xd9'),'header':{'height':_0x0b64('0xda'),'contents':{'first':_0x0b64('0xdb')}},'footer':{'height':_0x0b64('0xdc'),'contents':{'default':util[_0x0b64('0xcc')](_0x0b64('0xdd'),util['format'](_0x0b64('0xde'),_0x0b64('0xdf'),_0x53a9c4['id']),moment()[_0x0b64('0xcc')]('YYYY-MM-DD')['toString']())}}};var _0x4e2a6d={'channel':'Openchannel','account':_0x53a9c4['Account'][_0x0b64('0x2c')],'agent':_0x53a9c4['Owner']?_0x53a9c4['Owner'][_0x0b64('0xd6')]:_0x0b64('0xe0'),'createdAt':moment(_0x53a9c4['createdAt'])[_0x0b64('0xcc')](_0x0b64('0xbb'))['toString'](),'closedAt':_0x53a9c4['closed']?moment(_0x53a9c4[_0x0b64('0xe1')])[_0x0b64('0xcc')](_0x0b64('0xbb'))['toString']():'','disposition':_0x53a9c4[_0x0b64('0xe2')],'visibility':_0x53a9c4[_0x0b64('0xe3')]?_0x0b64('0xe4'):_0x0b64('0xe5'),'messages':_(_0x53a9c4[_0x0b64('0xd0')])[_0x0b64('0x86')]({'secret':![]})[_0x0b64('0x2f')](function(_0x3d546f){if(_0x3d546f[_0x0b64('0xe6')]){var _0x28ea4c=path['join'](_0xd6ae09,_0x3d546f[_0x0b64('0xe6')]['basename']);if(fs[_0x0b64('0xe7')](_0x28ea4c)){fs[_0x0b64('0xe8')](_0x28ea4c)['pipe'](fs[_0x0b64('0xe9')](path[_0x0b64('0xc7')](_0xd85552,_0x3d546f[_0x0b64('0xe6')][_0x0b64('0xea')])));}}return{'date':moment(_0x3d546f[_0x0b64('0x7b')])[_0x0b64('0xcc')](_0x0b64('0xbb'))[_0x0b64('0x98')](),'sender':_0x3d546f[_0x0b64('0xd1')]===_0x0b64('0xeb')?_0x3d546f['User']?_0x3d546f[_0x0b64('0x70')][_0x0b64('0xd6')]:_0x0b64('0xec'):_0x3d546f[_0x0b64('0xce')][_0x0b64('0xed')]+(_0x3d546f[_0x0b64('0xce')][_0x0b64('0xee')]?'\x20'+_0x3d546f[_0x0b64('0xce')][_0x0b64('0xee')]:''),'body':_0x3d546f[_0x0b64('0xe6')]?_0x3d546f[_0x0b64('0xe6')][_0x0b64('0xea')]:_0x3d546f[_0x0b64('0xb2')],'direction':_0x3d546f[_0x0b64('0xd1')]===_0x0b64('0xeb')?'A':'C','secret':_0x3d546f[_0x0b64('0xd2')],'read':_0x3d546f[_0x0b64('0x82')],'attachment':_0x3d546f[_0x0b64('0xe6')]};})[_0x0b64('0x62')]()};return ejs[_0x0b64('0xef')](path[_0x0b64('0xc7')](config['root'],_0x0b64('0xc9'),'views',_0x0b64('0xf0')),{'interaction':_0x4e2a6d})[_0x0b64('0x27')](function(_0x63ae4){return new BPromise(function(_0x42e448,_0x15fdb0){pdf[_0x0b64('0xb1')](_0x63ae4,_0xe17af)[_0x0b64('0xf1')](path['join'](_0xd85552,'transcript-'+_0x53a9c4['id']+'-'+_0x55960b+_0x0b64('0xf2')),function(_0x2c179e,_0x3933a4){if(_0x2c179e)return _0x15fdb0(_0x2c179e);_0x42e448(_0x3933a4);});});})[_0x0b64('0x27')](function(){return new BPromise(function(_0x18bbf6,_0x163abd){zipdir(_0xd85552,{'saveTo':_0x5061b0},function(_0x5f2587,_0x5b3024){if(_0x5f2587)return _0x163abd(_0x5f2587);return _0x18bbf6(_0x5b3024);});})[_0x0b64('0x27')](function(){return new BPromise(function(_0x21cfb6,_0x21f133){rimraf(_0xd85552,function(_0x5a6902){if(_0x5a6902)_0x21f133(_0x5a6902);return _0x21cfb6();});});})[_0x0b64('0x27')](function(){return _0x2987f8[_0x0b64('0xc5')](_0x5061b0,_0xf11ad4,function(_0xf08a30){if(_0xf08a30){console[_0x0b64('0xf3')](_0x0b64('0xf4'),_0xf08a30);}else{fs['unlinkSync'](_0x5061b0);}});});});}else{return _0x2987f8[_0x0b64('0x29')](0xc8);}})['catch'](handleError(_0x2987f8,null));}; \ No newline at end of file +var _0xbea7=['\x0a\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\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20','%s\x20#%d','Openchannel','YYYY-MM-DD','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','threadId','Public','basename','existsSync','createReadStream','out','firstName','renderFile','views','downloadInteraction.html','transcript-','.pdf','log','err','unlinkSync','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','count','limit','status','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','Users','TagIds','Tags','split','forEach','then','index','OpenchannelInteraction','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','nolimit','offset','order','sort','where','pick','field','color','from','tools_tags','select','u.id','u.fullname','ui.OpenchannelInteractionId','left_join','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','it.OpenchannelInteractionId\x20=\x20i.id','expr','search','conditions','length','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','getFullTextValue','find','ContactId','buildExpression','start','end','Tag','map','UserId','text','body','some','compact','isEmpty','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','i.id\x20LIKE\x20?','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','Sequelize','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','user','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','push','all','rows','catch','show','params','keys','include','merge','create','describe','OpenchannelMessage','addMessage','ids','omit','options','findAll','addTags','emit','removeTags','download','join','root','files','tmp','server','attachments','format','User','CmContact','lastName','Attachment','Messages','direction','secret','OpenchannelAccount','Account','Owner','fullname','get','10px','\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\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\x20\x20\x20\x20\x20\x20\x20','30px'];(function(_0x1f0ba3,_0xd0d300){var _0x370c4b=function(_0x10b146){while(--_0x10b146){_0x1f0ba3['push'](_0x1f0ba3['shift']());}};_0x370c4b(++_0xd0d300);}(_0xbea7,0xfa));var _0x7bea=function(_0x5648da,_0xe7e201){_0x5648da=_0x5648da-0x0;var _0x27d0d0=_0xbea7[_0x5648da];return _0x27d0d0;};'use strict';var pdf=require(_0x7bea('0x0'));var emlformat=require(_0x7bea('0x1'));var rimraf=require(_0x7bea('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7bea('0x3'));var rp=require(_0x7bea('0x4'));var moment=require('moment');var BPromise=require(_0x7bea('0x5'));var Mustache=require(_0x7bea('0x6'));var util=require(_0x7bea('0x7'));var path=require('path');var sox=require(_0x7bea('0x8'));var csv=require(_0x7bea('0x9'));var ejs=require(_0x7bea('0xa'));var fs=require('fs');var _=require(_0x7bea('0xb'));var squel=require(_0x7bea('0xc'));var crypto=require(_0x7bea('0xd'));var jsforce=require(_0x7bea('0xe'));var deskjs=require(_0x7bea('0xf'));var toCsv=require(_0x7bea('0x9'));var querystring=require(_0x7bea('0x10'));var Papa=require(_0x7bea('0x11'));var Redis=require('ioredis');var authService=require(_0x7bea('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7bea('0x13'));var logger=require(_0x7bea('0x14'))(_0x7bea('0x15'));var utils=require(_0x7bea('0x16'));var config=require(_0x7bea('0x17'));var db=require(_0x7bea('0x18'))['db'];config[_0x7bea('0x19')]=_[_0x7bea('0x1a')](config[_0x7bea('0x19')],{'host':_0x7bea('0x1b'),'port':0x18eb});var socket=require(_0x7bea('0x1c'))(new Redis(config['redis']));require(_0x7bea('0x1d'))[_0x7bea('0x1e')](socket);function respondWithStatusCode(_0x265c9b,_0x2b77fd){_0x2b77fd=_0x2b77fd||0xcc;return function(_0x465024){if(_0x465024){return _0x265c9b[_0x7bea('0x1f')](_0x2b77fd);}return _0x265c9b['status'](_0x2b77fd)['end']();};}function respondWithResult(_0x5f017c,_0x5397d3){_0x5397d3=_0x5397d3||0xc8;return function(_0x212c9f){if(_0x212c9f){return _0x5f017c['status'](_0x5397d3)['json'](_0x212c9f);}};}function respondWithFilteredResult(_0xb5b94b,_0x5ce209){return function(_0x575b0e){if(_0x575b0e){var _0x1863a0=_0x575b0e[_0x7bea('0x20')],_0xb938bf=_0x5ce209['offset'],_0xd07f18=_0x5ce209['offset']+_0x5ce209[_0x7bea('0x21')],_0x22c1c5;if(_0xd07f18>=_0x1863a0){_0xd07f18=_0x1863a0;_0x22c1c5=0xc8;}else{_0x22c1c5=0xce;}_0xb5b94b[_0x7bea('0x22')](_0x22c1c5);return _0xb5b94b[_0x7bea('0x23')](_0x7bea('0x24'),_0xb938bf+'-'+_0xd07f18+'/'+_0x1863a0)['json'](_0x575b0e);}return null;};}function patchUpdates(_0x2b3e0d){return function(_0x1b9d23){try{jsonpatch[_0x7bea('0x25')](_0x1b9d23,_0x2b3e0d,!![]);}catch(_0x235973){return BPromise[_0x7bea('0x26')](_0x235973);}return _0x1b9d23[_0x7bea('0x27')]();};}function saveUpdates(_0xbb7435,_0x5c7bc7){return function(_0x375a97){if(_0x375a97){return _0x375a97[_0x7bea('0x28')](_0xbb7435)['then'](function(_0x55a4f9){return _0x55a4f9;});}return null;};}function removeEntity(_0x486ba7,_0x7d5d3f){return function(_0x163c32){if(_0x163c32){return _0x163c32[_0x7bea('0x29')]()['then'](function(){_0x486ba7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x8ab861,_0x335fee){return function(_0x33158a){if(!_0x33158a){_0x8ab861[_0x7bea('0x1f')](0x194);}return _0x33158a;};}function handleError(_0x296c8d,_0x35e543){_0x35e543=_0x35e543||0x1f4;return function(_0x4b6af1){logger[_0x7bea('0x2a')](_0x4b6af1[_0x7bea('0x2b')]);if(_0x4b6af1[_0x7bea('0x2c')]){delete _0x4b6af1['name'];}_0x296c8d[_0x7bea('0x22')](_0x35e543)[_0x7bea('0x2d')](_0x4b6af1);};}function getInteractionUsers(_0x3dcbf1,_0x4a1c3d){return new BPromise(function(_0x3722d4,_0x47849f){try{if(_0x4a1c3d[_0x3dcbf1['id']]){_0x3dcbf1[_0x7bea('0x2e')]=_['map'](_0x4a1c3d[_0x3dcbf1['id']],function(_0x167248){return{'id':_0x167248['id'],'fullname':_0x167248['fullname']};});}}catch(_0x46861a){_0x47849f(_0x46861a);}_0x3722d4(_0x3dcbf1);});}function getInteractionTags(_0x29b3ff,_0x6608ab){return new BPromise(function(_0x2a22c0,_0x195d2d){try{if(_0x29b3ff[_0x7bea('0x2f')]){_0x29b3ff[_0x7bea('0x30')]=[];_0x29b3ff[_0x7bea('0x2f')][_0x7bea('0x31')](',')[_0x7bea('0x32')](function(_0x43f1fc){_0x29b3ff[_0x7bea('0x30')]['push'](_0x6608ab[_0x43f1fc]);});}delete _0x29b3ff[_0x7bea('0x2f')];}catch(_0x4c20c9){_0x195d2d(_0x4c20c9);}_0x2a22c0(_0x29b3ff);});}function updateOpenchannelInteraction(_0x185cf9,_0x1b1df9,_0x9bcfd1){return new BPromise(function(_0x11a1b1,_0x5293db){return getInteractionUsers(_0x185cf9,_0x9bcfd1)[_0x7bea('0x33')](function(_0xea6d92){return getInteractionTags(_0xea6d92,_0x1b1df9);})[_0x7bea('0x33')](function(_0x887ace){_0x11a1b1(_0x887ace);})['catch'](function(_0x2133a7){_0x5293db(_0x2133a7);});});}exports[_0x7bea('0x34')]=function(_0xec7b2d,_0x4234fc){var _0x4f96c2={},_0x10014a={},_0x11afa2={'count':0x0,'rows':[]};var _0x34240b=_['map'](db[_0x7bea('0x35')][_0x7bea('0x36')],function(_0x4cf3b6){return{'name':_0x4cf3b6[_0x7bea('0x37')],'type':_0x4cf3b6[_0x7bea('0x38')][_0x7bea('0x39')]};});_0x10014a[_0x7bea('0x3a')]=_['map'](_0x34240b,_0x7bea('0x2c'));_0x10014a[_0x7bea('0x3b')]=_['keys'](_0xec7b2d[_0x7bea('0x3b')]);_0x10014a[_0x7bea('0x3c')]=_['intersection'](_0x10014a[_0x7bea('0x3a')],_0x10014a[_0x7bea('0x3b')]);_0x4f96c2['attributes']=_[_0x7bea('0x3d')](_0x10014a[_0x7bea('0x3a')],qs['fields'](_0xec7b2d[_0x7bea('0x3b')][_0x7bea('0x3e')]));_0x4f96c2['attributes']=_0x4f96c2[_0x7bea('0x3f')]['length']?_0x4f96c2['attributes']:_0x10014a[_0x7bea('0x3a')];if(!_0xec7b2d[_0x7bea('0x3b')]['hasOwnProperty'](_0x7bea('0x40'))){_0x4f96c2[_0x7bea('0x21')]=qs[_0x7bea('0x21')](_0xec7b2d[_0x7bea('0x3b')][_0x7bea('0x21')]);_0x4f96c2[_0x7bea('0x41')]=qs[_0x7bea('0x41')](_0xec7b2d[_0x7bea('0x3b')][_0x7bea('0x41')]);}_0x4f96c2[_0x7bea('0x42')]=qs[_0x7bea('0x43')](_0xec7b2d[_0x7bea('0x3b')]['sort']);_0x4f96c2[_0x7bea('0x44')]=qs[_0x7bea('0x3c')](_[_0x7bea('0x45')](_0xec7b2d['query'],_0x10014a['filters']));var _0x1793e0=[];var _0x3fff71=squel['select']()['field']('id')[_0x7bea('0x46')](_0x7bea('0x2c'))[_0x7bea('0x46')](_0x7bea('0x47'))[_0x7bea('0x48')](_0x7bea('0x49'));var _0x243bc0=squel[_0x7bea('0x4a')]()[_0x7bea('0x46')](_0x7bea('0x4b'))[_0x7bea('0x46')](_0x7bea('0x4c'))[_0x7bea('0x46')](_0x7bea('0x4d'))[_0x7bea('0x48')]('user_has_openchannel_interactions','ui')[_0x7bea('0x4e')]('users','u','u.id\x20=\x20ui.UserId');var _0x1c622d=squel[_0x7bea('0x4a')]()[_0x7bea('0x48')](_0x7bea('0x4f'),'i')[_0x7bea('0x4e')](_0x7bea('0x50'),'c',_0x7bea('0x51'))[_0x7bea('0x4e')](_0x7bea('0x52'),'o',_0x7bea('0x53'))[_0x7bea('0x4e')]('openchannel_accounts','a',_0x7bea('0x54'))['left_join'](_0x7bea('0x55'),'me',_0x7bea('0x56'))[_0x7bea('0x4e')]('openchannel_interaction_has_tags','it',_0x7bea('0x57'))[_0x7bea('0x4e')](_0x7bea('0x49'),'t','t.id\x20=\x20it.TagId');var _0x413a6a=squel['expr']();var _0x31e4cf=[];var _0x5d600a=squel[_0x7bea('0x58')]();var _0x54388a;if(_0xec7b2d[_0x7bea('0x3b')][_0x7bea('0x59')]){_0x54388a=as['parseSearch'](_0xec7b2d[_0x7bea('0x3b')][_0x7bea('0x59')]);var _0x26a535=_0x54388a['sqlOperator'];for(var _0x14f79a=0x0;_0x14f79a<_0x54388a[_0x7bea('0x5a')][_0x7bea('0x5b')];_0x14f79a++){var _0x4ea566=_0x54388a['conditions'][_0x14f79a];var _0x5afd33='i';var _0x117b6c=_['find'](_0x34240b,[_0x7bea('0x2c'),_0x4ea566[_0x7bea('0x46')]]);if(!_0x117b6c){switch(_0x4ea566[_0x7bea('0x46')]){case _0x7bea('0x5c'):if(_0x4ea566[_0x7bea('0x5d')]==0x1){_0x1c622d[_0x7bea('0x5e')]('`'+_0x4ea566['field']+_0x7bea('0x5f'));}else{_0x1c622d['having']('`'+_0x4ea566[_0x7bea('0x46')]+_0x7bea('0x60'));}break;case _0x7bea('0x61'):if(_0x4ea566[_0x7bea('0x62')]===_0x7bea('0x63')){if(_0x4ea566[_0x7bea('0x5d')][_0x7bea('0x31')]('\x20')[_0x7bea('0x5b')]>0x1){_0x413a6a[_0x26a535]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x7bea('0x64')](_0x4ea566[_0x7bea('0x5d')]),null);}else{var _0x178a7f='%'+_0x4ea566['value']+'%';_0x413a6a[_0x26a535]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x178a7f,_0x178a7f,_0x178a7f);}}else{_0x117b6c=_[_0x7bea('0x65')](_0x34240b,[_0x7bea('0x2c'),_0x7bea('0x66')]);_0x4ea566['field']=_0x7bea('0x66');_0x4d43d0=as[_0x7bea('0x67')](_0x5afd33,_0x117b6c[_0x7bea('0x38')],_0x4ea566);_0x413a6a[_0x26a535](_0x4d43d0['text'],_0x4d43d0[_0x7bea('0x5d')][_0x7bea('0x68')],_0x4d43d0['value'][_0x7bea('0x69')]);}break;case _0x7bea('0x6a'):var _0x233133=_0x4ea566[_0x7bea('0x5d')][_0x7bea('0x31')](',')[_0x7bea('0x6b')](function(_0x4d8d2b){return Number(_0x4d8d2b);});_0x233133[_0x7bea('0x32')](function(_0xc20ac3){_0x5d600a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xc20ac3+',%');});_0x31e4cf=_['union'](_0x31e4cf,_0x233133);break;case'User':if(_0x4ea566[_0x7bea('0x62')]==='$substring'){_0x413a6a[_0x26a535]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x4ea566[_0x7bea('0x5d')]+'%',null);}else{_0x117b6c=_[_0x7bea('0x65')](_0x34240b,[_0x7bea('0x2c'),_0x7bea('0x6c')]);_0x4ea566['field']=_0x7bea('0x6c');_0x4d43d0=as[_0x7bea('0x67')](_0x5afd33,_0x117b6c[_0x7bea('0x38')],_0x4ea566);_0x413a6a[_0x26a535](_0x4d43d0[_0x7bea('0x6d')],_0x4d43d0[_0x7bea('0x5d')]['start'],_0x4d43d0['value'][_0x7bea('0x69')]);}break;case _0x7bea('0x6e'):_0x4d43d0=as[_0x7bea('0x67')]('me',null,_0x4ea566);_0x413a6a[_0x26a535](_0x4d43d0[_0x7bea('0x6d')],_0x4d43d0[_0x7bea('0x5d')][_0x7bea('0x68')],_0x4d43d0['value'][_0x7bea('0x69')]);break;}}else{var _0x4d43d0=as[_0x7bea('0x67')](_0x5afd33,_0x117b6c['type'],_0x4ea566);_0x413a6a[_0x26a535](_0x4d43d0['text'],_0x4d43d0[_0x7bea('0x5d')][_0x7bea('0x68')],_0x4d43d0[_0x7bea('0x5d')][_0x7bea('0x69')]);}}}else{var _0x47086a=_(_0xec7b2d[_0x7bea('0x3b')])['keys']()[_0x7bea('0x6b')](function(_0x500afc){return _[_0x7bea('0x6f')](_0x34240b,[_0x7bea('0x2c'),_0x500afc])?_0x500afc:undefined;})[_0x7bea('0x70')]()['value']();if(!_[_0x7bea('0x71')](_0x47086a)){_0x47086a[_0x7bea('0x32')](function(_0x39436b){if(_0x39436b==='OpenchannelAccountId'){_0x1c622d[_0x7bea('0x44')](_0x7bea('0x72'),[][_0x7bea('0x73')](_0xec7b2d[_0x7bea('0x3b')][_0x39436b]));}else if(_0x39436b===_0x7bea('0x74')){var _0x25e9e7=JSON[_0x7bea('0x75')](_0xec7b2d[_0x7bea('0x3b')][_0x39436b])[_0x7bea('0x76')];var _0x37ecbb=JSON[_0x7bea('0x75')](_0xec7b2d[_0x7bea('0x3b')][_0x39436b])[_0x7bea('0x77')];_0x1c622d[_0x7bea('0x44')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x25e9e7,_0x37ecbb);}else{if(_0xec7b2d[_0x7bea('0x3b')][_0x39436b]==='null'){_0x1c622d[_0x7bea('0x44')]('i.'+_0x39436b+_0x7bea('0x78'));}else{_0x1c622d['where']('i.'+_0x39436b+'\x20=\x20?',_0xec7b2d['query'][_0x39436b]);}}});}if(_0xec7b2d[_0x7bea('0x3b')][_0x7bea('0x79')]){if(_0xec7b2d['query'][_0x7bea('0x79')]==0x1){_0x1c622d[_0x7bea('0x5e')]('`unreadMessages`\x20=\x200');}else{_0x1c622d['having'](_0x7bea('0x7a'));}}if(_0xec7b2d['query'][_0x7bea('0x7b')]){_0x31e4cf=_[_0x7bea('0x7c')](_0xec7b2d[_0x7bea('0x3b')]['tag'])?_0xec7b2d[_0x7bea('0x3b')][_0x7bea('0x7b')]:new Array(_0xec7b2d['query'][_0x7bea('0x7b')]);_0x31e4cf[_0x7bea('0x32')](function(_0x316ce4){_0x5d600a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x316ce4+',%');});}if(_0xec7b2d[_0x7bea('0x3b')]['filter']){var _0x4d50fb=_0xec7b2d[_0x7bea('0x3b')][_0x7bea('0x7d')][_0x7bea('0x7e')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x7bea('0x7f'));if(qs['isNumeric'](_0x4d50fb)){_0x413a6a['or'](_0x7bea('0x80'),_0x4d50fb+'%');}else{_0x413a6a['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x7bea('0x64')](_0x4d50fb))['or'](_0x7bea('0x81'),_0x4d50fb+'%')['or'](_0x7bea('0x82'),_0x4d50fb+'%');}}}_0x1c622d[_0x7bea('0x44')](_0x413a6a);_0x1c622d['group']('i.id');var _0x26c54d={'type':db[_0x7bea('0x83')]['QueryTypes'][_0x7bea('0x84')],'raw':!![]};var _0x2f4829=_0x1c622d[_0x7bea('0x85')]();_0x2f4829[_0x7bea('0x46')](_0x7bea('0x86'));_0x2f4829[_0x7bea('0x46')](_0x7bea('0x87'),_0x7bea('0x5c'));if(_0x4f96c2['order']){_0x4f96c2[_0x7bea('0x42')][_0x7bea('0x32')](function(_0x497193){_0x1c622d[_0x7bea('0x42')]('i.'+_0x497193[0x0],_0x497193[0x1]===_0x7bea('0x88')?![]:!![]);});}if(!_[_0x7bea('0x71')](_0x31e4cf)){_0x1c622d[_0x7bea('0x5e')](_0x5d600a);_0x2f4829['where'](_0x7bea('0x89'),_0x31e4cf);}BPromise[_0x7bea('0x8a')]()[_0x7bea('0x33')](function(){if(!_0x54388a&&_0xec7b2d[_0x7bea('0x3b')]['OpenchannelAccountId'])return;return _0xec7b2d[_0x7bea('0x8b')]['getOpenchannelAccounts']({'attributes':['id'],'raw':!![]})[_0x7bea('0x33')](function(_0x21f250){if(_[_0x7bea('0x71')](_0x21f250)){_0x2f4829['where']('i.OpenchannelAccountId\x20IS\x20NULL');_0x1c622d[_0x7bea('0x44')](_0x7bea('0x8c'));}else{_0x2f4829[_0x7bea('0x44')](_0x7bea('0x72'),_[_0x7bea('0x6b')](_0x21f250,'id'));_0x1c622d[_0x7bea('0x44')]('i.OpenchannelAccountId\x20IN\x20?',_[_0x7bea('0x6b')](_0x21f250,'id'));}});})['then'](function(){db[_0x7bea('0x8d')]['query'](_0x2f4829['toString'](),_0x26c54d)[_0x7bea('0x33')](function(_0x2dffb7){_0x11afa2[_0x7bea('0x20')]=_0x2dffb7[_0x7bea('0x5b')];if(_0x11afa2['count']===0x0)return[];return db[_0x7bea('0x8d')][_0x7bea('0x3b')](_0x3fff71[_0x7bea('0x8e')](),_0x26c54d)['then'](function(_0x351ca9){_0x1793e0=_['keyBy'](_0x351ca9,'id');_0x26c54d=_['merge'](_0x26c54d,{'model':db[_0x7bea('0x35')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xec7b2d['query']['fields']){_0x4f96c2[_0x7bea('0x3f')][_0x7bea('0x32')](function(_0x4cbf8f){_0x1c622d['field']('i.'+_0x4cbf8f);});}else{_0x1c622d[_0x7bea('0x46')](_0x7bea('0x87'),'unreadMessages');_0x1c622d[_0x7bea('0x46')](_0x7bea('0x8f'),_0x7bea('0x90'));_0x1c622d[_0x7bea('0x46')](_0x7bea('0x91'),_0x7bea('0x92'));_0x1c622d[_0x7bea('0x46')](_0x7bea('0x93'));_0x1c622d[_0x7bea('0x46')](_0x7bea('0x94'),'Contact.firstName');_0x1c622d[_0x7bea('0x46')](_0x7bea('0x95'),_0x7bea('0x96'));_0x1c622d[_0x7bea('0x46')](_0x7bea('0x97'),'Contact.email');_0x1c622d[_0x7bea('0x46')]('c.phone','Contact.phone');_0x1c622d[_0x7bea('0x46')]('c.mobile',_0x7bea('0x98'));_0x1c622d[_0x7bea('0x46')](_0x7bea('0x99'),_0x7bea('0x9a'));_0x1c622d['field'](_0x7bea('0x9b'),'Owner.fullname');_0x1c622d[_0x7bea('0x46')](_0x7bea('0x9c'),_0x7bea('0x9d'));_0x1c622d[_0x7bea('0x46')](_0x7bea('0x9e'),_0x7bea('0x2f'));}_0x1c622d[_0x7bea('0x21')](_0x4f96c2[_0x7bea('0x21')]);_0x1c622d[_0x7bea('0x41')](_0x4f96c2[_0x7bea('0x41')]);return db[_0x7bea('0x8d')]['query'](_0x1c622d['toString'](),_0x26c54d);})[_0x7bea('0x33')](function(_0x5abfe5){_0x243bc0[_0x7bea('0x44')](_0x7bea('0x9f'),_[_0x7bea('0x6b')](_0x5abfe5,'id'));return db[_0x7bea('0x8d')][_0x7bea('0x3b')](_0x243bc0[_0x7bea('0x8e')](),_0x26c54d)[_0x7bea('0x33')](function(_0x5a0716){var _0x3c70fb=_[_0x7bea('0xa0')](_0x5a0716,'OpenchannelInteractionId');var _0x56ce60=[];_0x5abfe5[_0x7bea('0x32')](function(_0xdea8df){_0x56ce60[_0x7bea('0xa1')](updateOpenchannelInteraction(_0xdea8df,_0x1793e0,_0x3c70fb));});return BPromise[_0x7bea('0xa2')](_0x56ce60);});});})[_0x7bea('0x33')](function(_0x295f96){_0x11afa2[_0x7bea('0xa3')]=_0x295f96;return _0x11afa2;})[_0x7bea('0x33')](respondWithFilteredResult(_0x4234fc,_0x4f96c2));})[_0x7bea('0xa4')](handleError(_0x4234fc,null));};exports[_0x7bea('0xa5')]=function(_0x2a9fce,_0xe9d7c2){var _0x47b1ad={'raw':![],'where':{'id':_0x2a9fce[_0x7bea('0xa6')]['id']}},_0x3383fb={};_0x3383fb[_0x7bea('0x3a')]=_[_0x7bea('0xa7')](db['OpenchannelInteraction'][_0x7bea('0x36')]);_0x3383fb[_0x7bea('0x3b')]=_['keys'](_0x2a9fce[_0x7bea('0x3b')]);_0x3383fb[_0x7bea('0x3c')]=_[_0x7bea('0x3d')](_0x3383fb['model'],_0x3383fb[_0x7bea('0x3b')]);_0x47b1ad[_0x7bea('0x3f')]=_[_0x7bea('0x3d')](_0x3383fb['model'],qs[_0x7bea('0x3e')](_0x2a9fce[_0x7bea('0x3b')][_0x7bea('0x3e')]));_0x47b1ad[_0x7bea('0x3f')]=_0x47b1ad[_0x7bea('0x3f')][_0x7bea('0x5b')]?_0x47b1ad[_0x7bea('0x3f')]:_0x3383fb['model'];if(_0x2a9fce[_0x7bea('0x3b')]['includeAll']){_0x47b1ad[_0x7bea('0xa8')]=[{'all':!![]}];}_0x47b1ad=_[_0x7bea('0xa9')]({},_0x47b1ad,_0x2a9fce['options']);return db[_0x7bea('0x35')]['find'](_0x47b1ad)[_0x7bea('0x33')](handleEntityNotFound(_0xe9d7c2,null))[_0x7bea('0x33')](respondWithResult(_0xe9d7c2,null))[_0x7bea('0xa4')](handleError(_0xe9d7c2,null));};exports[_0x7bea('0xaa')]=function(_0x161e0a,_0x3a56ea){return db[_0x7bea('0x35')][_0x7bea('0xaa')](_0x161e0a[_0x7bea('0x6e')],{})['then'](respondWithResult(_0x3a56ea,0xc9))['catch'](handleError(_0x3a56ea,null));};exports['update']=function(_0x566f23,_0x57e40b){if(_0x566f23[_0x7bea('0x6e')]['id']){delete _0x566f23[_0x7bea('0x6e')]['id'];}return db['OpenchannelInteraction'][_0x7bea('0x65')]({'where':{'id':_0x566f23['params']['id']}})[_0x7bea('0x33')](handleEntityNotFound(_0x57e40b,null))['then'](saveUpdates(_0x566f23[_0x7bea('0x6e')],null))[_0x7bea('0x33')](respondWithResult(_0x57e40b,null))[_0x7bea('0xa4')](handleError(_0x57e40b,null));};exports['destroy']=function(_0x34db90,_0x4b32b6){return db[_0x7bea('0x35')][_0x7bea('0x65')]({'where':{'id':_0x34db90[_0x7bea('0xa6')]['id']}})[_0x7bea('0x33')](handleEntityNotFound(_0x4b32b6,null))[_0x7bea('0x33')](removeEntity(_0x4b32b6,null))[_0x7bea('0xa4')](handleError(_0x4b32b6,null));};exports[_0x7bea('0xab')]=function(_0x412982,_0xc4fab4){return db[_0x7bea('0x35')]['describe']()[_0x7bea('0x33')](respondWithResult(_0xc4fab4,null))[_0x7bea('0xa4')](handleError(_0xc4fab4,null));};exports['addMessage']=function(_0x5ce84b,_0x2d9160,_0x232a8c){return db[_0x7bea('0xac')][_0x7bea('0x65')]({'where':{'id':_0x5ce84b[_0x7bea('0xa6')]['id']}})[_0x7bea('0x33')](handleEntityNotFound(_0x2d9160,null))[_0x7bea('0x33')](function(_0x5cf258){if(_0x5cf258){return _0x5cf258[_0x7bea('0xad')](_0x5ce84b[_0x7bea('0x6e')][_0x7bea('0xae')],_[_0x7bea('0xaf')](_0x5ce84b[_0x7bea('0x6e')],[_0x7bea('0xae'),'id'])||{});}})['then'](respondWithResult(_0x2d9160,null))[_0x7bea('0xa4')](handleError(_0x2d9160,null));};exports['getMessages']=function(_0x33373d,_0x2f6759,_0x20382c){var _0x277d29={'raw':![],'where':{}};var _0x151044={};var _0x5de267={'count':0x0,'rows':[]};return db[_0x7bea('0x35')]['findOne']({'where':{'id':_0x33373d[_0x7bea('0xa6')]['id']}})[_0x7bea('0x33')](handleEntityNotFound(_0x2f6759,null))[_0x7bea('0x33')](function(_0x27af21){if(_0x27af21){_0x151044[_0x7bea('0x3a')]=_[_0x7bea('0xa7')](db[_0x7bea('0xac')]['rawAttributes']);_0x151044[_0x7bea('0x3b')]=_[_0x7bea('0xa7')](_0x33373d[_0x7bea('0x3b')]);_0x151044['filters']=_[_0x7bea('0x3d')](_0x151044[_0x7bea('0x3a')],_0x151044[_0x7bea('0x3b')]);_0x277d29[_0x7bea('0x3f')]=_['intersection'](_0x151044[_0x7bea('0x3a')],qs[_0x7bea('0x3e')](_0x33373d['query']['fields']));_0x277d29[_0x7bea('0x3f')]=_0x277d29['attributes'][_0x7bea('0x5b')]?_0x277d29['attributes']:_0x151044['model'];if(!_0x33373d['query']['hasOwnProperty'](_0x7bea('0x40'))){_0x277d29['limit']=qs[_0x7bea('0x21')](_0x33373d[_0x7bea('0x3b')]['limit']);_0x277d29[_0x7bea('0x41')]=qs[_0x7bea('0x41')](_0x33373d[_0x7bea('0x3b')][_0x7bea('0x41')]);}_0x277d29['order']=qs['sort'](_0x33373d[_0x7bea('0x3b')][_0x7bea('0x43')]);_0x277d29[_0x7bea('0x44')]=qs['filters'](_[_0x7bea('0x45')](_0x33373d[_0x7bea('0x3b')],_0x151044['filters']));_0x277d29[_0x7bea('0x44')]['OpenchannelInteractionId']=_0x27af21['id'];if(_0x33373d[_0x7bea('0x3b')]['filter']){_0x277d29['where']=_['merge'](_0x277d29['where'],{'$or':_[_0x7bea('0x6b')](_0x277d29[_0x7bea('0x3f')],function(_0x23959f){var _0x453f71={};_0x453f71[_0x23959f]={'$like':'%'+_0x33373d[_0x7bea('0x3b')][_0x7bea('0x7d')]+'%'};return _0x453f71;})});}if(_0x33373d['query'][_0x7bea('0x76')]){var _0x34aefd=_0x33373d[_0x7bea('0x3b')]['$gte'][_0x7bea('0x31')](',');var _0x23f0d7={};_0x23f0d7[_0x34aefd[0x0]]={'$gte':moment(_0x34aefd[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x277d29['where']=_[_0x7bea('0xa9')](_0x277d29['where'],_0x23f0d7);}_0x277d29=_['merge']({},_0x277d29,_0x33373d[_0x7bea('0xb0')]);return db[_0x7bea('0xac')][_0x7bea('0x20')]({'where':_0x277d29[_0x7bea('0x44')]})[_0x7bea('0x33')](function(_0x23cac6){_0x5de267[_0x7bea('0x20')]=_0x23cac6;if(_0x33373d[_0x7bea('0x3b')]['includeAll']){_0x277d29[_0x7bea('0xa8')]=[{'all':!![]}];}return db[_0x7bea('0xac')][_0x7bea('0xb1')](_0x277d29);})[_0x7bea('0x33')](function(_0x453cb3){_0x5de267[_0x7bea('0xa3')]=_0x453cb3;return _0x5de267;});}})[_0x7bea('0x33')](respondWithFilteredResult(_0x2f6759,_0x277d29))['catch'](handleError(_0x2f6759,null));};exports[_0x7bea('0xb2')]=function(_0x392881,_0xea9bbc,_0x271c9b){return db[_0x7bea('0x35')][_0x7bea('0x65')]({'where':{'id':_0x392881[_0x7bea('0xa6')]['id']}})[_0x7bea('0x33')](handleEntityNotFound(_0xea9bbc,null))[_0x7bea('0x33')](function(_0x512949){if(_0x512949){return _0x512949['setTags'](_0x392881[_0x7bea('0x6e')][_0x7bea('0xae')],_[_0x7bea('0xaf')](_0x392881[_0x7bea('0x6e')],[_0x7bea('0xae'),'id'])||{})['spread'](function(){return db[_0x7bea('0x6a')][_0x7bea('0xb1')]({'attributes':['id',_0x7bea('0x2c'),_0x7bea('0x47')],'where':{'id':_0x392881[_0x7bea('0x6e')]['ids']}});})['then'](function(_0x1561eb){socket[_0x7bea('0xb3')]('openchannelInteractionTags:save',{'id':Number(_0x392881[_0x7bea('0xa6')]['id']),'tags':_0x1561eb||[]});return{'id':Number(_0x392881['params']['id']),'tags':_0x1561eb||[]};});}})[_0x7bea('0x33')](respondWithResult(_0xea9bbc,null))[_0x7bea('0xa4')](handleError(_0xea9bbc,null));};exports[_0x7bea('0xb4')]=function(_0x7a196d,_0x14c14c,_0x48741d){return db[_0x7bea('0x35')]['find']({'where':{'id':_0x7a196d[_0x7bea('0xa6')]['id']}})[_0x7bea('0x33')](handleEntityNotFound(_0x14c14c,null))[_0x7bea('0x33')](function(_0x124703){if(_0x124703){return _0x124703[_0x7bea('0xb4')](_0x7a196d[_0x7bea('0x3b')]['ids']);}})[_0x7bea('0x33')](respondWithStatusCode(_0x14c14c,null))['catch'](handleError(_0x14c14c,null));};exports[_0x7bea('0xb5')]=function(_0x3bdb0e,_0x2e0458){var _0xe04826=moment()['unix']()[_0x7bea('0x8e')]();var _0x10d7f1=path[_0x7bea('0xb6')](config[_0x7bea('0xb7')],'server',_0x7bea('0xb8'),_0x7bea('0xb9'));var _0x3c6855=path[_0x7bea('0xb6')](config['root'],_0x7bea('0xba'),_0x7bea('0xb8'),_0x7bea('0xbb'));var _0x401919=path[_0x7bea('0xb6')](_0x10d7f1,_0xe04826);var _0x234de7=util[_0x7bea('0xbc')]('transcript-%d-%s.zip',_0x3bdb0e[_0x7bea('0xa6')]['id'],_0xe04826);var _0x10d6ac=path[_0x7bea('0xb6')](_0x10d7f1,_0x234de7);var _0x4e3d6f=[];_0x4e3d6f[_0x7bea('0xa1')]({'model':db[_0x7bea('0xbd')],'as':_0x7bea('0xbd'),'attributes':['id','fullname'],'raw':!![]});_0x4e3d6f[_0x7bea('0xa1')]({'model':db[_0x7bea('0xbe')],'as':'Contact','attributes':['id','firstName',_0x7bea('0xbf')],'raw':!![]});if(_0x3bdb0e[_0x7bea('0x3b')][_0x7bea('0xbb')]){_0x4e3d6f[_0x7bea('0xa1')]({'model':db[_0x7bea('0xc0')],'as':_0x7bea('0xc0'),'raw':!![]});}var _0x3c789c=[{'model':db[_0x7bea('0xac')],'as':_0x7bea('0xc1'),'attributes':['id','body',_0x7bea('0x74'),_0x7bea('0xc2'),_0x7bea('0xc3'),_0x7bea('0x79')],'include':_0x4e3d6f}];_0x3c789c[_0x7bea('0xa1')]({'model':db[_0x7bea('0xc4')],'as':_0x7bea('0xc5'),'attributes':['id','name']});_0x3c789c[_0x7bea('0xa1')]({'model':db[_0x7bea('0xbd')],'as':_0x7bea('0xc6'),'attributes':['id',_0x7bea('0xc7')]});return db[_0x7bea('0x35')][_0x7bea('0x65')]({'where':{'id':_0x3bdb0e[_0x7bea('0xa6')]['id']},'include':_0x3c789c})[_0x7bea('0x33')](handleEntityNotFound(_0x2e0458,null))[_0x7bea('0x33')](function(_0x3d3a03){if(_0x3d3a03){var _0x205a4a=_0x3d3a03[_0x7bea('0xc8')]({'plain':!![]});fs['mkdirSync'](_0x401919);var _0x2dd736={'format':'A4','border':_0x7bea('0xc9'),'header':{'height':'40px','contents':{'first':_0x7bea('0xca')}},'footer':{'height':_0x7bea('0xcb'),'contents':{'default':util['format'](_0x7bea('0xcc'),util['format'](_0x7bea('0xcd'),_0x7bea('0xce'),_0x205a4a['id']),moment()[_0x7bea('0xbc')](_0x7bea('0xcf'))[_0x7bea('0x8e')]())}}};var _0x134b46={'channel':_0x7bea('0xce'),'account':_0x205a4a[_0x7bea('0xc5')][_0x7bea('0x2c')],'agent':_0x205a4a['Owner']?_0x205a4a[_0x7bea('0xc6')]['fullname']:_0x7bea('0xd0'),'createdAt':moment(_0x205a4a['createdAt'])[_0x7bea('0xbc')](_0x7bea('0xd1'))[_0x7bea('0x8e')](),'closedAt':_0x205a4a[_0x7bea('0xd2')]?moment(_0x205a4a[_0x7bea('0xd3')])[_0x7bea('0xbc')](_0x7bea('0xd1'))[_0x7bea('0x8e')]():'','disposition':_0x205a4a['disposition'],'visibility':_0x205a4a[_0x7bea('0xd4')]?_0x7bea('0xd5'):'Private','messages':_(_0x205a4a[_0x7bea('0xc1')])['filter']({'secret':![]})[_0x7bea('0x6b')](function(_0x4c5b6d){if(_0x4c5b6d['Attachment']){var _0x378fc0=path[_0x7bea('0xb6')](_0x3c6855,_0x4c5b6d[_0x7bea('0xc0')][_0x7bea('0xd6')]);if(fs[_0x7bea('0xd7')](_0x378fc0)){fs[_0x7bea('0xd8')](_0x378fc0)['pipe'](fs['createWriteStream'](path[_0x7bea('0xb6')](_0x401919,_0x4c5b6d[_0x7bea('0xc0')][_0x7bea('0xd6')])));}}return{'date':moment(_0x4c5b6d[_0x7bea('0x74')])[_0x7bea('0xbc')](_0x7bea('0xd1'))[_0x7bea('0x8e')](),'sender':_0x4c5b6d[_0x7bea('0xc2')]===_0x7bea('0xd9')?_0x4c5b6d[_0x7bea('0xbd')]?_0x4c5b6d['User'][_0x7bea('0xc7')]:'System':_0x4c5b6d[_0x7bea('0x61')][_0x7bea('0xda')]+(_0x4c5b6d[_0x7bea('0x61')][_0x7bea('0xbf')]?'\x20'+_0x4c5b6d[_0x7bea('0x61')]['lastName']:''),'body':_0x4c5b6d[_0x7bea('0xc0')]?_0x4c5b6d['Attachment'][_0x7bea('0xd6')]:_0x4c5b6d['body'],'direction':_0x4c5b6d[_0x7bea('0xc2')]===_0x7bea('0xd9')?'A':'C','secret':_0x4c5b6d[_0x7bea('0xc3')],'read':_0x4c5b6d[_0x7bea('0x79')],'attachment':_0x4c5b6d[_0x7bea('0xc0')]};})[_0x7bea('0x5d')]()};return ejs[_0x7bea('0xdb')](path[_0x7bea('0xb6')](config[_0x7bea('0xb7')],'server',_0x7bea('0xdc'),_0x7bea('0xdd')),{'interaction':_0x134b46})[_0x7bea('0x33')](function(_0x3491c6){return new BPromise(function(_0x33069a,_0x42506f){pdf['create'](_0x3491c6,_0x2dd736)['toFile'](path['join'](_0x401919,_0x7bea('0xde')+_0x205a4a['id']+'-'+_0xe04826+_0x7bea('0xdf')),function(_0x26375a,_0x8676e7){if(_0x26375a)return _0x42506f(_0x26375a);_0x33069a(_0x8676e7);});});})[_0x7bea('0x33')](function(){return new BPromise(function(_0x1d9cce,_0x5ac173){zipdir(_0x401919,{'saveTo':_0x10d6ac},function(_0x5f2c7a,_0x2ee3f9){if(_0x5f2c7a)return _0x5ac173(_0x5f2c7a);return _0x1d9cce(_0x2ee3f9);});})['then'](function(){return new BPromise(function(_0x2bff83,_0x4923f3){rimraf(_0x401919,function(_0x208550){if(_0x208550)_0x4923f3(_0x208550);return _0x2bff83();});});})['then'](function(){return _0x2e0458[_0x7bea('0xb5')](_0x10d6ac,_0x234de7,function(_0x4166e8){if(_0x4166e8){console[_0x7bea('0xe0')](_0x7bea('0xe1'),_0x4166e8);}else{fs[_0x7bea('0xe2')](_0x10d6ac);}});});});}else{return _0x2e0458[_0x7bea('0x1f')](0xc8);}})[_0x7bea('0xa4')](handleError(_0x2e0458,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 82eea6c..f1f5013 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 _0x72f3=['setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','hasOwnProperty','hook','exports','../../mysqldb','OpenchannelInteraction','OpenchannelMessage'];(function(_0x58d6d1,_0x135816){var _0x1b6863=function(_0x30f42c){while(--_0x30f42c){_0x58d6d1['push'](_0x58d6d1['shift']());}};_0x1b6863(++_0x135816);}(_0x72f3,0x18c));var _0x372f=function(_0x5e56de,_0x189fa7){_0x5e56de=_0x5e56de-0x0;var _0x26c6ec=_0x72f3[_0x5e56de];return _0x26c6ec;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0x372f('0x0'))['db'][_0x372f('0x1')];var OpenchannelMessage=require('../../mysqldb')['db'][_0x372f('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x372f('0x3')](0x0);var events={'afterCreate':_0x372f('0x4'),'afterUpdate':_0x372f('0x5'),'afterDestroy':_0x372f('0x6')};function emitEvent(_0x343404){return function(_0x44c7d6,_0xf72f61,_0x1fd24e){_0x44c7d6[_0x372f('0x7')]({'attributes':['id'],'raw':!![]})[_0x372f('0x8')](function(_0x175aef){_0x44c7d6[_0x372f('0x9')](_0x372f('0xa'),_0x175aef[_0x372f('0xb')](function(_0xea749a){return{'id':_0xea749a['id']};}));return OpenchannelMessage[_0x372f('0xc')]({'where':{'OpenchannelInteractionId':_0x44c7d6['id'],'direction':'in','read':![]},'raw':!![]});})[_0x372f('0x8')](function(_0x30697d){_0x44c7d6[_0x372f('0x9')](_0x372f('0xd'),_0x30697d[_0x372f('0xe')]);OpenchannelInteractionEvents[_0x372f('0xf')](_0x343404+':'+_0x44c7d6['id'],_0x44c7d6);OpenchannelInteractionEvents[_0x372f('0xf')](_0x343404,_0x44c7d6);_0x1fd24e(null);})['catch'](_0x1fd24e(null));};}for(var e in events){if(events[_0x372f('0x10')](e)){var event=events[e];OpenchannelInteraction[_0x372f('0x11')](e,emitEvent(event));}}module[_0x372f('0x12')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x3fac=['OpenchannelMessage','remove','then','setDataValue','Users','findAll','length','emit','catch','hasOwnProperty','OpenchannelInteraction','../../mysqldb'];(function(_0x363d1c,_0x2a9014){var _0x2a352d=function(_0x1ab738){while(--_0x1ab738){_0x363d1c['push'](_0x363d1c['shift']());}};_0x2a352d(++_0x2a9014);}(_0x3fac,0x1ae));var _0xc3fa=function(_0x4416ce,_0x319246){_0x4416ce=_0x4416ce-0x0;var _0x4b3660=_0x3fac[_0x4416ce];return _0x4b3660;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require('../../mysqldb')['db'][_0xc3fa('0x0')];var OpenchannelMessage=require(_0xc3fa('0x1'))['db'][_0xc3fa('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xc3fa('0x3')};function emitEvent(_0x1b880a){return function(_0x58ea6f,_0x8f9c16,_0x7137b2){_0x58ea6f['getUsers']({'attributes':['id'],'raw':!![]})[_0xc3fa('0x4')](function(_0x548276){_0x58ea6f[_0xc3fa('0x5')](_0xc3fa('0x6'),_0x548276['map'](function(_0x4d1b44){return{'id':_0x4d1b44['id']};}));return OpenchannelMessage[_0xc3fa('0x7')]({'where':{'OpenchannelInteractionId':_0x58ea6f['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc3fa('0x4')](function(_0x70c5b5){_0x58ea6f[_0xc3fa('0x5')]('unreadMessages',_0x70c5b5[_0xc3fa('0x8')]);OpenchannelInteractionEvents[_0xc3fa('0x9')](_0x1b880a+':'+_0x58ea6f['id'],_0x58ea6f);OpenchannelInteractionEvents[_0xc3fa('0x9')](_0x1b880a,_0x58ea6f);_0x7137b2(null);})[_0xc3fa('0xa')](_0x7137b2(null));};}for(var e in events){if(events[_0xc3fa('0xb')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index b4526db..6657f84 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 _0x98a8=['request-promise','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','openchannel_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x17da83,_0xb970f1){var _0x3e4523=function(_0x56348d){while(--_0x56348d){_0x17da83['push'](_0x17da83['shift']());}};_0x3e4523(++_0xb970f1);}(_0x98a8,0x12c));var _0x898a=function(_0x21e08b,_0x1e39ba){_0x21e08b=_0x21e08b-0x0;var _0x5b1f96=_0x98a8[_0x21e08b];return _0x5b1f96;};'use strict';var _=require(_0x898a('0x0'));var util=require(_0x898a('0x1'));var logger=require(_0x898a('0x2'))(_0x898a('0x3'));var moment=require(_0x898a('0x4'));var BPromise=require(_0x898a('0x5'));var rp=require(_0x898a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x898a('0x7'));var config=require(_0x898a('0x8'));var attributes=require(_0x898a('0x9'));module[_0x898a('0xa')]=function(_0x3e7ddd,_0x5d7e59){return _0x3e7ddd[_0x898a('0xb')]('OpenchannelInteraction',attributes,{'tableName':_0x898a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4fbce5,_0x42021d,_0x283c5){if(_0x4fbce5[_0x898a('0xd')](_0x898a('0xe'))){_0x4fbce5[_0x898a('0xf')]=moment()[_0x898a('0x10')](_0x898a('0x11'));}_0x283c5(null,_0x4fbce5);}}});}; \ No newline at end of file +var _0x3c17=['YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','OpenchannelInteraction','openchannel_interactions','changed','closed','closedAt','format'];(function(_0x94b3e5,_0x380927){var _0x5e9836=function(_0x49141e){while(--_0x49141e){_0x94b3e5['push'](_0x94b3e5['shift']());}};_0x5e9836(++_0x380927);}(_0x3c17,0x1a1));var _0x73c1=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0x3c17[_0x4dbaad];return _0x226c72;};'use strict';var _=require(_0x73c1('0x0'));var util=require('util');var logger=require(_0x73c1('0x1'))('api');var moment=require(_0x73c1('0x2'));var BPromise=require(_0x73c1('0x3'));var rp=require(_0x73c1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x73c1('0x5'));var config=require(_0x73c1('0x6'));var attributes=require(_0x73c1('0x7'));module[_0x73c1('0x8')]=function(_0x48c943,_0x382f82){return _0x48c943['define'](_0x73c1('0x9'),attributes,{'tableName':_0x73c1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x422176,_0x5155aa,_0x4921f0){if(_0x422176[_0x73c1('0xb')](_0x73c1('0xc'))){_0x422176[_0x73c1('0xd')]=moment()[_0x73c1('0xe')](_0x73c1('0xf'));}_0x4921f0(null,_0x422176);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 30c85c4..e39ece2 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 _0x3da8=['omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','body','options','where','attributes','limit','then','info','AddTagsToOpenchannelInteraction','find','addTags','ids'];(function(_0x4fd79d,_0x231f31){var _0x4d2ed2=function(_0x4f8031){while(--_0x4f8031){_0x4fd79d['push'](_0x4fd79d['shift']());}};_0x4d2ed2(++_0x231f31);}(_0x3da8,0x189));var _0x83da=function(_0x55d6ee,_0x4db146){_0x55d6ee=_0x55d6ee-0x0;var _0x3adf43=_0x3da8[_0x55d6ee];return _0x3adf43;};'use strict';var _=require(_0x83da('0x0'));var util=require(_0x83da('0x1'));var moment=require(_0x83da('0x2'));var BPromise=require(_0x83da('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x83da('0x4'));var db=require(_0x83da('0x5'))['db'];var utils=require(_0x83da('0x6'));var logger=require('../../config/logger')(_0x83da('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x83da('0x8')]=_[_0x83da('0x9')](config['redis'],{'host':_0x83da('0xa'),'port':0x18eb});var socket=require(_0x83da('0xb'))(new Redis(config[_0x83da('0x8')]));require(_0x83da('0xc'))[_0x83da('0xd')](socket);function respondWithRpcPromise(_0x3bfdfc,_0x3bef8e,_0xb28c3a){return new BPromise(function(_0x43666a,_0x56d103){return client['request'](_0x3bfdfc,_0xb28c3a)['then'](function(_0x724c50){logger['info'](_0x83da('0xe'),_0x3bef8e,'request\x20sent');logger[_0x83da('0xf')](_0x83da('0x10'),_0x3bef8e,'request\x20sent',JSON[_0x83da('0x11')](_0x724c50));if(_0x724c50[_0x83da('0x12')]){if(_0x724c50[_0x83da('0x12')][_0x83da('0x13')]===0x1f4){logger[_0x83da('0x12')]('OpenchannelInteraction,\x20%s,\x20%s',_0x3bef8e,_0x724c50[_0x83da('0x12')][_0x83da('0x14')]);return _0x56d103(_0x724c50[_0x83da('0x12')][_0x83da('0x14')]);}logger[_0x83da('0x12')](_0x83da('0xe'),_0x3bef8e,_0x724c50[_0x83da('0x12')][_0x83da('0x14')]);return _0x43666a(_0x724c50[_0x83da('0x12')][_0x83da('0x14')]);}else{logger['info'](_0x83da('0xe'),_0x3bef8e,'request\x20sent');_0x43666a(_0x724c50[_0x83da('0x15')][_0x83da('0x14')]);}})[_0x83da('0x16')](function(_0x419274){logger[_0x83da('0x12')](_0x83da('0xe'),_0x3bef8e,_0x419274);_0x56d103(_0x419274);});});}exports[_0x83da('0x17')]=function(_0x3070cb){var _0x375c00=this;return new Promise(function(_0x50e440,_0x26aca2){return db[_0x83da('0x18')]['update'](_0x3070cb[_0x83da('0x19')],{'raw':_0x3070cb['options']?_0x3070cb[_0x83da('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3070cb[_0x83da('0x1a')]?_0x3070cb['options'][_0x83da('0x1b')]||null:null,'attributes':_0x3070cb[_0x83da('0x1a')]?_0x3070cb[_0x83da('0x1a')][_0x83da('0x1c')]||null:null,'limit':_0x3070cb[_0x83da('0x1a')]?_0x3070cb['options'][_0x83da('0x1d')]||null:null})[_0x83da('0x1e')](function(_0x4ea7b2){logger[_0x83da('0x1f')](_0x83da('0x17'),_0x3070cb);logger[_0x83da('0xf')]('UpdateOpenchannelInteraction',_0x3070cb,JSON['stringify'](_0x4ea7b2));_0x50e440(_0x4ea7b2);})[_0x83da('0x16')](function(_0x422e4b){logger[_0x83da('0x12')]('UpdateOpenchannelInteraction',_0x422e4b['message'],_0x3070cb);_0x26aca2(_0x375c00[_0x83da('0x12')](0x1f4,_0x422e4b['message']));});});};exports[_0x83da('0x20')]=function(_0x147572){return new Promise(function(_0xc17434,_0x344680){return db['OpenchannelInteraction'][_0x83da('0x21')]({'where':_0x147572[_0x83da('0x1a')]?_0x147572[_0x83da('0x1a')][_0x83da('0x1b')]||null:null})[_0x83da('0x1e')](function(_0x5aabfe){if(_0x5aabfe){return _0x5aabfe[_0x83da('0x22')](_0x147572['body'][_0x83da('0x23')],_[_0x83da('0x24')](_0x147572[_0x83da('0x19')],[_0x83da('0x23'),'id'])||{});}})[_0x83da('0x25')](function(_0x281fa2){logger[_0x83da('0x1f')](_0x83da('0x26'),_0x147572);logger[_0x83da('0xf')](_0x83da('0x26'),_0x147572,JSON[_0x83da('0x11')](_0x281fa2));_0xc17434(_0x281fa2);})[_0x83da('0x16')](function(_0xcdc494){logger[_0x83da('0x12')]('AddTags',_0xcdc494[_0x83da('0x14')],_0x147572);_0x344680(_this['error'](0x1f4,_0xcdc494[_0x83da('0x14')]));});});}; \ No newline at end of file +var _0x07b7=['raw','where','attributes','limit','debug','stringify','AddTagsToOpenchannelInteraction','find','addTags','ids','omit','spread','AddTags','lodash','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','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x07b7,0x1d9));var _0x707b=function(_0x234995,_0x48c007){_0x234995=_0x234995-0x0;var _0x5115f0=_0x07b7[_0x234995];return _0x5115f0;};'use strict';var _=require(_0x707b('0x0'));var util=require(_0x707b('0x1'));var moment=require(_0x707b('0x2'));var BPromise=require(_0x707b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x707b('0x4'))['db'];var utils=require(_0x707b('0x5'));var logger=require(_0x707b('0x6'))(_0x707b('0x7'));var config=require(_0x707b('0x8'));var jayson=require(_0x707b('0x9'));var client=jayson[_0x707b('0xa')][_0x707b('0xb')]({'port':0x232a});config[_0x707b('0xc')]=_[_0x707b('0xd')](config[_0x707b('0xc')],{'host':_0x707b('0xe'),'port':0x18eb});var socket=require(_0x707b('0xf'))(new Redis(config[_0x707b('0xc')]));require(_0x707b('0x10'))[_0x707b('0x11')](socket);function respondWithRpcPromise(_0x51a975,_0x3b212b,_0x2971ed){return new BPromise(function(_0x4e2ee3,_0x4d6fcc){return client[_0x707b('0x12')](_0x51a975,_0x2971ed)[_0x707b('0x13')](function(_0x4c1c98){logger[_0x707b('0x14')](_0x707b('0x15'),_0x3b212b,_0x707b('0x16'));logger['debug'](_0x707b('0x17'),_0x3b212b,_0x707b('0x16'),JSON['stringify'](_0x4c1c98));if(_0x4c1c98[_0x707b('0x18')]){if(_0x4c1c98[_0x707b('0x18')][_0x707b('0x19')]===0x1f4){logger[_0x707b('0x18')](_0x707b('0x15'),_0x3b212b,_0x4c1c98[_0x707b('0x18')][_0x707b('0x1a')]);return _0x4d6fcc(_0x4c1c98[_0x707b('0x18')]['message']);}logger[_0x707b('0x18')]('OpenchannelInteraction,\x20%s,\x20%s',_0x3b212b,_0x4c1c98[_0x707b('0x18')][_0x707b('0x1a')]);return _0x4e2ee3(_0x4c1c98[_0x707b('0x18')][_0x707b('0x1a')]);}else{logger[_0x707b('0x14')](_0x707b('0x15'),_0x3b212b,'request\x20sent');_0x4e2ee3(_0x4c1c98[_0x707b('0x1b')][_0x707b('0x1a')]);}})['catch'](function(_0x32a352){logger[_0x707b('0x18')](_0x707b('0x15'),_0x3b212b,_0x32a352);_0x4d6fcc(_0x32a352);});});}exports[_0x707b('0x1c')]=function(_0x19746c){var _0x3dcb40=this;return new Promise(function(_0x435e62,_0x4820ce){return db[_0x707b('0x1d')][_0x707b('0x1e')](_0x19746c[_0x707b('0x1f')],{'raw':_0x19746c[_0x707b('0x20')]?_0x19746c[_0x707b('0x20')][_0x707b('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19746c[_0x707b('0x20')]?_0x19746c[_0x707b('0x20')][_0x707b('0x22')]||null:null,'attributes':_0x19746c[_0x707b('0x20')]?_0x19746c[_0x707b('0x20')][_0x707b('0x23')]||null:null,'limit':_0x19746c[_0x707b('0x20')]?_0x19746c['options'][_0x707b('0x24')]||null:null})['then'](function(_0x2a8734){logger[_0x707b('0x14')](_0x707b('0x1c'),_0x19746c);logger[_0x707b('0x25')](_0x707b('0x1c'),_0x19746c,JSON[_0x707b('0x26')](_0x2a8734));_0x435e62(_0x2a8734);})['catch'](function(_0x46141c){logger[_0x707b('0x18')](_0x707b('0x1c'),_0x46141c['message'],_0x19746c);_0x4820ce(_0x3dcb40[_0x707b('0x18')](0x1f4,_0x46141c['message']));});});};exports[_0x707b('0x27')]=function(_0x12648f){return new Promise(function(_0x55efcd,_0x4becbc){return db['OpenchannelInteraction'][_0x707b('0x28')]({'where':_0x12648f[_0x707b('0x20')]?_0x12648f[_0x707b('0x20')]['where']||null:null})[_0x707b('0x13')](function(_0x376654){if(_0x376654){return _0x376654[_0x707b('0x29')](_0x12648f[_0x707b('0x1f')][_0x707b('0x2a')],_[_0x707b('0x2b')](_0x12648f['body'],[_0x707b('0x2a'),'id'])||{});}})[_0x707b('0x2c')](function(_0x11c946){logger[_0x707b('0x14')](_0x707b('0x2d'),_0x12648f);logger[_0x707b('0x25')](_0x707b('0x2d'),_0x12648f,JSON[_0x707b('0x26')](_0x11c946));_0x55efcd(_0x11c946);})['catch'](function(_0xb0a62b){logger['error'](_0x707b('0x2d'),_0xb0a62b['message'],_0x12648f);_0x4becbc(_this[_0x707b('0x18')](0x1f4,_0xb0a62b[_0x707b('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 53858cd..4b4e860 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 _0x0c6f=['openchannelInteraction:','remove','update','emit','removeListener','register'];(function(_0x34295e,_0x3d781c){var _0x50e9e8=function(_0x2743bd){while(--_0x2743bd){_0x34295e['push'](_0x34295e['shift']());}};_0x50e9e8(++_0x3d781c);}(_0x0c6f,0x7f));var _0xf0c6=function(_0x2f43d4,_0x4cbc3f){_0x2f43d4=_0x2f43d4-0x0;var _0x146ebe=_0x0c6f[_0x2f43d4];return _0x146ebe;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=['save',_0xf0c6('0x0'),_0xf0c6('0x1')];function createListener(_0xa30e62,_0x536af4){return function(_0x1b5201){_0x536af4[_0xf0c6('0x2')](_0xa30e62,_0x1b5201);};}function removeListener(_0x407c0e,_0x466cce){return function(){OpenchannelInteractionEvents[_0xf0c6('0x3')](_0x407c0e,_0x466cce);};}exports[_0xf0c6('0x4')]=function(_0x3f5f0c){for(var _0x59a8a5=0x0,_0xa9bfaa=events['length'];_0x59a8a5<_0xa9bfaa;_0x59a8a5++){var _0x5e8fe8=events[_0x59a8a5];var _0x59dccf=createListener(_0xf0c6('0x5')+_0x5e8fe8,_0x3f5f0c);OpenchannelInteractionEvents['on'](_0x5e8fe8,_0x59dccf);}}; \ No newline at end of file +var _0xd5bb=['./openchannelInteraction.events','save','update','emit','removeListener','register','length','openchannelInteraction:'];(function(_0x398582,_0x4ef989){var _0x189777=function(_0x297efe){while(--_0x297efe){_0x398582['push'](_0x398582['shift']());}};_0x189777(++_0x4ef989);}(_0xd5bb,0x168));var _0xbd5b=function(_0x323101,_0x2571c4){_0x323101=_0x323101-0x0;var _0x2ad80a=_0xd5bb[_0x323101];return _0x2ad80a;};'use strict';var OpenchannelInteractionEvents=require(_0xbd5b('0x0'));var events=[_0xbd5b('0x1'),'remove',_0xbd5b('0x2')];function createListener(_0x4ec8ab,_0x3f415a){return function(_0x41fbf3){_0x3f415a[_0xbd5b('0x3')](_0x4ec8ab,_0x41fbf3);};}function removeListener(_0x495dd3,_0x2863ba){return function(){OpenchannelInteractionEvents[_0xbd5b('0x4')](_0x495dd3,_0x2863ba);};}exports[_0xbd5b('0x5')]=function(_0x56a7b4){for(var _0xa46a9f=0x0,_0x2ec692=events[_0xbd5b('0x6')];_0xa46a9f<_0x2ec692;_0xa46a9f++){var _0x2f5699=events[_0xa46a9f];var _0x518c76=createListener(_0xbd5b('0x7')+_0x2f5699,_0x56a7b4);OpenchannelInteractionEvents['on'](_0x2f5699,_0x518c76);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index a5d3df4..e617933 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 _0x9d0d=['isAuthenticated','index','/:id','show','post','tracked','openchannel','openchannelmessage:create','create','put','/:id/accept','accept','/:id/reject','reject','destroy','exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get'];(function(_0x29dd4b,_0x5e3231){var _0x1380be=function(_0x33df7c){while(--_0x33df7c){_0x29dd4b['push'](_0x29dd4b['shift']());}};_0x1380be(++_0x5e3231);}(_0x9d0d,0x118));var _0xd9d0=function(_0x250831,_0x49408){_0x250831=_0x250831-0x0;var _0x1cb966=_0x9d0d[_0x250831];return _0x1cb966;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xd9d0('0x0'));var express=require(_0xd9d0('0x1'));var router=express[_0xd9d0('0x2')]();var auth=require(_0xd9d0('0x3'));var interaction=require(_0xd9d0('0x4'));var config=require(_0xd9d0('0x5'));var controller=require(_0xd9d0('0x6'));router[_0xd9d0('0x7')]('/',auth[_0xd9d0('0x8')](),controller[_0xd9d0('0x9')]);router['get']('/describe',auth[_0xd9d0('0x8')](),controller['describe']);router[_0xd9d0('0x7')](_0xd9d0('0xa'),auth['isAuthenticated'](),controller[_0xd9d0('0xb')]);router[_0xd9d0('0xc')]('/',auth[_0xd9d0('0x8')](),interaction[_0xd9d0('0xd')](_0xd9d0('0xe'),_0xd9d0('0xf')),controller[_0xd9d0('0x10')]);router[_0xd9d0('0x11')](_0xd9d0('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xd9d0('0x11')](_0xd9d0('0x12'),auth[_0xd9d0('0x8')](),controller[_0xd9d0('0x13')]);router[_0xd9d0('0x11')](_0xd9d0('0x14'),auth[_0xd9d0('0x8')](),controller[_0xd9d0('0x15')]);router['delete']('/:id',auth[_0xd9d0('0x8')](),controller[_0xd9d0('0x16')]);module[_0xd9d0('0x17')]=router; \ No newline at end of file +var _0xb019=['./openchannelMessage.controller','isAuthenticated','get','/describe','describe','/:id','show','post','tracked','openchannelmessage:create','update','put','/:id/accept','accept','/:id/reject','exports','multer','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5213cf,_0x167e72){var _0x2804ea=function(_0x4ad1e0){while(--_0x4ad1e0){_0x5213cf['push'](_0x5213cf['shift']());}};_0x2804ea(++_0x167e72);}(_0xb019,0x136));var _0x9b01=function(_0xb4bd36,_0x33d6ef){_0xb4bd36=_0xb4bd36-0x0;var _0x3bbddd=_0xb019[_0xb4bd36];return _0x3bbddd;};'use strict';var multer=require(_0x9b01('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9b01('0x1')]();var auth=require(_0x9b01('0x2'));var interaction=require(_0x9b01('0x3'));var config=require(_0x9b01('0x4'));var controller=require(_0x9b01('0x5'));router['get']('/',auth[_0x9b01('0x6')](),controller['index']);router[_0x9b01('0x7')](_0x9b01('0x8'),auth[_0x9b01('0x6')](),controller[_0x9b01('0x9')]);router[_0x9b01('0x7')](_0x9b01('0xa'),auth[_0x9b01('0x6')](),controller[_0x9b01('0xb')]);router[_0x9b01('0xc')]('/',auth['isAuthenticated'](),interaction[_0x9b01('0xd')]('openchannel',_0x9b01('0xe')),controller['create']);router['put'](_0x9b01('0xa'),auth['isAuthenticated'](),controller[_0x9b01('0xf')]);router[_0x9b01('0x10')](_0x9b01('0x11'),auth[_0x9b01('0x6')](),controller[_0x9b01('0x12')]);router['put'](_0x9b01('0x13'),auth[_0x9b01('0x6')](),controller['reject']);router['delete'](_0x9b01('0xa'),auth[_0x9b01('0x6')](),controller['destroy']);module[_0x9b01('0x14')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 212514f..47f0a02 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 _0x1be6=['DATE','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x3cf5ef,_0xbcd808){var _0x1b9740=function(_0x2163b2){while(--_0x2163b2){_0x3cf5ef['push'](_0x3cf5ef['shift']());}};_0x1b9740(++_0xbcd808);}(_0x1be6,0x182));var _0x61be=function(_0x3514c9,_0x3bbe2d){_0x3514c9=_0x3514c9-0x0;var _0x4dd9ea=_0x1be6[_0x3514c9];return _0x4dd9ea;};'use strict';var Sequelize=require('sequelize');module[_0x61be('0x0')]={'body':{'type':Sequelize[_0x61be('0x1')](_0x61be('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x61be('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x61be('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x61be('0x4')]('in','out'),'defaultValue':_0x61be('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x61be('0x6')]}}; \ No newline at end of file +var _0x792c=['BOOLEAN','out','DATE','exports','TEXT','medium'];(function(_0x89c25f,_0x447499){var _0x730ea5=function(_0x2ae703){while(--_0x2ae703){_0x89c25f['push'](_0x89c25f['shift']());}};_0x730ea5(++_0x447499);}(_0x792c,0x1d1));var _0xc792=function(_0x1c6f2a,_0x32961d){_0x1c6f2a=_0x1c6f2a-0x0;var _0x347466=_0x792c[_0x1c6f2a];return _0x347466;};'use strict';var Sequelize=require('sequelize');module[_0xc792('0x0')]={'body':{'type':Sequelize[_0xc792('0x1')](_0xc792('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xc792('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xc792('0x4')),'defaultValue':_0xc792('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xc792('0x5')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 0a7f68e..b186452 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 _0xc414=['openchannel','read','readAt','format','UserId','CmContact','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','openchannel-interactions','agent','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','html-pdf','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','crypto','desk.js','to-csv','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','OpenchannelMessage,\x20%s,\x20%s','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','sendStatus','name','send','map','OpenchannelMessage','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','create','body','find','describe','../../config/logger','accept'];(function(_0x53ba51,_0x2f2321){var _0x2e776e=function(_0x16b5cf){while(--_0x16b5cf){_0x53ba51['push'](_0x53ba51['shift']());}};_0x2e776e(++_0x2f2321);}(_0xc414,0x199));var _0x4c41=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc414[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x4c41('0x0'));var emlformat=require(_0x4c41('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4c41('0x2'));var jsonpatch=require(_0x4c41('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4c41('0x4'));var Mustache=require(_0x4c41('0x5'));var util=require(_0x4c41('0x6'));var path=require(_0x4c41('0x7'));var sox=require(_0x4c41('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x4c41('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x4c41('0xa'));var toCsv=require(_0x4c41('0xb'));var querystring=require('querystring');var Papa=require(_0x4c41('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4c41('0xd'));var hardwareService=require(_0x4c41('0xe'));var logger=require('../../config/logger')(_0x4c41('0xf'));var utils=require(_0x4c41('0x10'));var config=require(_0x4c41('0x11'));var db=require('../../mysqldb')['db'];config[_0x4c41('0x12')]=_[_0x4c41('0x13')](config['redis'],{'host':_0x4c41('0x14'),'port':0x18eb});var socket=require(_0x4c41('0x15'))(new Redis(config[_0x4c41('0x12')]));require(_0x4c41('0x16'))[_0x4c41('0x17')](socket);var jayson=require(_0x4c41('0x18'));var client=jayson[_0x4c41('0x19')][_0x4c41('0x1a')]({'port':0x232c});var client9002=jayson[_0x4c41('0x19')][_0x4c41('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x1f717f,_0x1cc8ac,_0x20855a){if(_0x20855a){var _0xf2c21e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xf2c21e[_0x4c41('0x1b')](_0x1cc8ac)){return _0x1f717f;}else{throw new db[(_0x4c41('0x1c'))][(_0x4c41('0x1d'))](_0x4c41('0x1e'));}}else{return _0x1f717f;}}function respondWithRpcPromise(_0xb221ab,_0x31047a,_0x1e439e,_0x51d558){return new BPromise(function(_0x1efef1,_0x46c825){var _0xfd8bbd=_0x51d558||client;return _0xfd8bbd[_0x4c41('0x1f')](_0xb221ab,_0x1e439e)[_0x4c41('0x20')](function(_0x59a011){logger[_0x4c41('0x21')](_0x4c41('0x22'),_0x31047a,'request\x20sent');logger[_0x4c41('0x23')](_0x4c41('0x24'),_0x31047a,_0x4c41('0x25'),JSON[_0x4c41('0x26')](_0x59a011));if(_0x59a011[_0x4c41('0x27')]){if(_0x59a011['error'][_0x4c41('0x28')]===0x1f4){logger[_0x4c41('0x27')](_0x4c41('0x22'),_0x31047a,_0x59a011[_0x4c41('0x27')][_0x4c41('0x29')]);return _0x46c825(_0x59a011[_0x4c41('0x27')]['message']);}logger['error'](_0x4c41('0x22'),_0x31047a,_0x59a011[_0x4c41('0x27')][_0x4c41('0x29')]);return _0x1efef1(_0x59a011[_0x4c41('0x27')]['message']);}else{logger[_0x4c41('0x21')]('OpenchannelMessage,\x20%s,\x20%s',_0x31047a,_0x4c41('0x25'));_0x1efef1(_0x59a011[_0x4c41('0x2a')][_0x4c41('0x29')]);}})[_0x4c41('0x2b')](function(_0x201433){logger[_0x4c41('0x27')](_0x4c41('0x22'),_0x31047a,_0x201433);_0x46c825(_0x201433);});});}function respondWithStatusCode(_0x40eb5f,_0xb188b6){_0xb188b6=_0xb188b6||0xcc;return function(_0xf12bbc){if(_0xf12bbc){return _0x40eb5f['sendStatus'](_0xb188b6);}return _0x40eb5f[_0x4c41('0x2c')](_0xb188b6)[_0x4c41('0x2d')]();};}function respondWithResult(_0x34d508,_0x5c7638){_0x5c7638=_0x5c7638||0xc8;return function(_0x2f6905){if(_0x2f6905){return _0x34d508['status'](_0x5c7638)[_0x4c41('0x2e')](_0x2f6905);}};}function respondWithFilteredResult(_0x54bda3,_0x4fb366){return function(_0x3f5591){if(_0x3f5591){var _0x9c55bd=_0x3f5591[_0x4c41('0x2f')],_0x206bee=_0x4fb366[_0x4c41('0x30')],_0x4dcb12=_0x4fb366[_0x4c41('0x30')]+_0x4fb366[_0x4c41('0x31')],_0x1f2e54;if(_0x4dcb12>=_0x9c55bd){_0x4dcb12=_0x9c55bd;_0x1f2e54=0xc8;}else{_0x1f2e54=0xce;}_0x54bda3['status'](_0x1f2e54);return _0x54bda3[_0x4c41('0x32')](_0x4c41('0x33'),_0x206bee+'-'+_0x4dcb12+'/'+_0x9c55bd)['json'](_0x3f5591);}return null;};}function patchUpdates(_0x56b815){return function(_0x5e694a){try{jsonpatch[_0x4c41('0x34')](_0x5e694a,_0x56b815,!![]);}catch(_0x5e9ef7){return BPromise[_0x4c41('0x35')](_0x5e9ef7);}return _0x5e694a[_0x4c41('0x36')]();};}function saveUpdates(_0x47620c,_0x2c2a82){return function(_0x573c30){if(_0x573c30){return _0x573c30[_0x4c41('0x37')](_0x47620c)[_0x4c41('0x20')](function(_0x41eeb1){return _0x41eeb1;});}return null;};}function removeEntity(_0x2070e6,_0x5b4e3d){return function(_0x375fcc){if(_0x375fcc){return _0x375fcc[_0x4c41('0x38')]()[_0x4c41('0x20')](function(){_0x2070e6[_0x4c41('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb74952,_0x3893db){return function(_0x2d1103){if(!_0x2d1103){_0xb74952[_0x4c41('0x39')](0x194);}return _0x2d1103;};}function handleError(_0x4705ec,_0x359c2a){_0x359c2a=_0x359c2a||0x1f4;return function(_0x5ba30a){logger[_0x4c41('0x27')](_0x5ba30a['stack']);if(_0x5ba30a[_0x4c41('0x3a')]){delete _0x5ba30a[_0x4c41('0x3a')];}_0x4705ec[_0x4c41('0x2c')](_0x359c2a)[_0x4c41('0x3b')](_0x5ba30a);};}exports['index']=function(_0x3eff91,_0x403e12){var _0x446ff2={},_0x3bf5af={},_0x32db9a={'count':0x0,'rows':[]};var _0x2bfa08=_[_0x4c41('0x3c')](db[_0x4c41('0x3d')][_0x4c41('0x3e')],function(_0x490d2e){return{'name':_0x490d2e[_0x4c41('0x3f')],'type':_0x490d2e[_0x4c41('0x40')][_0x4c41('0x41')]};});_0x3bf5af['model']=_[_0x4c41('0x3c')](_0x2bfa08,_0x4c41('0x3a'));_0x3bf5af[_0x4c41('0x42')]=_[_0x4c41('0x43')](_0x3eff91['query']);_0x3bf5af[_0x4c41('0x44')]=_[_0x4c41('0x45')](_0x3bf5af[_0x4c41('0x46')],_0x3bf5af['query']);_0x446ff2[_0x4c41('0x47')]=_[_0x4c41('0x45')](_0x3bf5af[_0x4c41('0x46')],qs[_0x4c41('0x48')](_0x3eff91[_0x4c41('0x42')][_0x4c41('0x48')]));_0x446ff2[_0x4c41('0x47')]=_0x446ff2[_0x4c41('0x47')][_0x4c41('0x49')]?_0x446ff2[_0x4c41('0x47')]:_0x3bf5af['model'];if(!_0x3eff91[_0x4c41('0x42')][_0x4c41('0x4a')](_0x4c41('0x4b'))){_0x446ff2[_0x4c41('0x31')]=qs[_0x4c41('0x31')](_0x3eff91['query'][_0x4c41('0x31')]);_0x446ff2[_0x4c41('0x30')]=qs[_0x4c41('0x30')](_0x3eff91[_0x4c41('0x42')][_0x4c41('0x30')]);}_0x446ff2[_0x4c41('0x4c')]=qs[_0x4c41('0x4d')](_0x3eff91[_0x4c41('0x42')][_0x4c41('0x4d')]);_0x446ff2[_0x4c41('0x4e')]=qs['filters'](_['pick'](_0x3eff91['query'],_0x3bf5af[_0x4c41('0x44')]));if(_0x3eff91[_0x4c41('0x42')]['filter']){_0x446ff2[_0x4c41('0x4e')]=_[_0x4c41('0x4f')](_0x446ff2[_0x4c41('0x4e')],{'$or':_['map'](_0x2bfa08,function(_0x20a38e){if(_0x20a38e[_0x4c41('0x40')]!==_0x4c41('0x50')){var _0x454502={};_0x454502[_0x20a38e[_0x4c41('0x3a')]]={'$like':'%'+_0x3eff91[_0x4c41('0x42')][_0x4c41('0x51')]+'%'};return _0x454502;}})});}_0x446ff2=_[_0x4c41('0x4f')]({},_0x446ff2,_0x3eff91[_0x4c41('0x52')]);var _0x942119={'where':_0x446ff2[_0x4c41('0x4e')]};return db[_0x4c41('0x3d')][_0x4c41('0x2f')](_0x942119)[_0x4c41('0x20')](function(_0xda9ef0){_0x32db9a['count']=_0xda9ef0;if(_0x3eff91[_0x4c41('0x42')][_0x4c41('0x53')]){_0x446ff2[_0x4c41('0x54')]=[{'all':!![]}];}return db[_0x4c41('0x3d')][_0x4c41('0x55')](_0x446ff2);})[_0x4c41('0x20')](function(_0x5e59ab){_0x32db9a[_0x4c41('0x56')]=_0x5e59ab;return _0x32db9a;})[_0x4c41('0x20')](respondWithFilteredResult(_0x403e12,_0x446ff2))[_0x4c41('0x2b')](handleError(_0x403e12,null));};exports[_0x4c41('0x57')]=function(_0x1e47c6,_0xc75827){var _0xce5f3={'raw':!![],'where':{'id':_0x1e47c6[_0x4c41('0x58')]['id']}},_0x3633c1={};_0x3633c1[_0x4c41('0x46')]=_[_0x4c41('0x43')](db[_0x4c41('0x3d')][_0x4c41('0x3e')]);_0x3633c1[_0x4c41('0x42')]=_[_0x4c41('0x43')](_0x1e47c6['query']);_0x3633c1[_0x4c41('0x44')]=_[_0x4c41('0x45')](_0x3633c1[_0x4c41('0x46')],_0x3633c1[_0x4c41('0x42')]);_0xce5f3[_0x4c41('0x47')]=_['intersection'](_0x3633c1[_0x4c41('0x46')],qs[_0x4c41('0x48')](_0x1e47c6[_0x4c41('0x42')]['fields']));_0xce5f3['attributes']=_0xce5f3[_0x4c41('0x47')][_0x4c41('0x49')]?_0xce5f3['attributes']:_0x3633c1[_0x4c41('0x46')];if(_0x1e47c6['query'][_0x4c41('0x53')]){_0xce5f3[_0x4c41('0x54')]=[{'all':!![]}];}_0xce5f3=_['merge']({},_0xce5f3,_0x1e47c6[_0x4c41('0x52')]);return db['OpenchannelMessage']['find'](_0xce5f3)[_0x4c41('0x20')](handleEntityNotFound(_0xc75827,null))[_0x4c41('0x20')](respondWithResult(_0xc75827,null))['catch'](handleError(_0xc75827,null));};exports[_0x4c41('0x59')]=function(_0xddeb94,_0x19a287){return db[_0x4c41('0x3d')][_0x4c41('0x59')](_0xddeb94['body'],{})['then'](respondWithResult(_0x19a287,0xc9))[_0x4c41('0x2b')](handleError(_0x19a287,null));};exports[_0x4c41('0x37')]=function(_0x1b7fd5,_0x62456e){if(_0x1b7fd5[_0x4c41('0x5a')]['id']){delete _0x1b7fd5[_0x4c41('0x5a')]['id'];}return db[_0x4c41('0x3d')]['find']({'where':{'id':_0x1b7fd5[_0x4c41('0x58')]['id']}})[_0x4c41('0x20')](handleEntityNotFound(_0x62456e,null))[_0x4c41('0x20')](saveUpdates(_0x1b7fd5['body'],null))[_0x4c41('0x20')](respondWithResult(_0x62456e,null))[_0x4c41('0x2b')](handleError(_0x62456e,null));};exports['destroy']=function(_0x1e4581,_0x363160){return db['OpenchannelMessage'][_0x4c41('0x5b')]({'where':{'id':_0x1e4581[_0x4c41('0x58')]['id']}})[_0x4c41('0x20')](handleEntityNotFound(_0x363160,null))['then'](removeEntity(_0x363160,null))[_0x4c41('0x2b')](handleError(_0x363160,null));};exports['describe']=function(_0x2742f6,_0xa6b60){return db['OpenchannelMessage'][_0x4c41('0x5c')]()[_0x4c41('0x20')](respondWithResult(_0xa6b60,null))[_0x4c41('0x2b')](handleError(_0xa6b60,null));};var interaction_log=require(_0x4c41('0x5d'))('openchannel-interactions');exports[_0x4c41('0x5e')]=function(_0x283bb3,_0x4757be,_0x4f1c0f){var _0x4544b5={'channel':_0x4c41('0x5f')};if(_0x283bb3[_0x4c41('0x5a')]['id']){delete _0x283bb3[_0x4c41('0x5a')]['id'];}_0x283bb3['body'][_0x4c41('0x60')]=!![];_0x283bb3[_0x4c41('0x5a')][_0x4c41('0x61')]=moment()[_0x4c41('0x62')]('YYYY-MM-DD\x20HH:mm:ss');_0x283bb3[_0x4c41('0x5a')][_0x4c41('0x63')]=_0x283bb3[_0x4c41('0x5a')]['UserId']||_0x283bb3['user']['id'];return db[_0x4c41('0x3d')]['find']({'where':{'id':_0x283bb3[_0x4c41('0x58')]['id'],'UserId':null},'include':[{'model':db[_0x4c41('0x64')],'as':'Contact'}]})[_0x4c41('0x20')](handleEntityNotFound(_0x4757be,null))['then'](saveUpdates(_0x283bb3[_0x4c41('0x5a')],null))[_0x4c41('0x20')](function(_0x3909a8){if(_0x3909a8){_0x4544b5[_0x4c41('0x29')]=_0x3909a8[_0x4c41('0x65')]({'plain':!![]});return db[_0x4c41('0x66')][_0x4c41('0x5b')]({'where':{'id':_0x3909a8[_0x4c41('0x67')]}});}return null;})[_0x4c41('0x20')](handleEntityNotFound(_0x4757be,null))[_0x4c41('0x20')](function(_0x4b1826){if(_0x4b1826){return _0x4b1826[_0x4c41('0x37')]({'UserId':_0x283bb3[_0x4c41('0x5a')][_0x4c41('0x63')],'read1stAt':_[_0x4c41('0x68')](_0x4b1826[_0x4c41('0x69')])?moment()[_0x4c41('0x62')](_0x4c41('0x6a')):undefined});}return null;})[_0x4c41('0x20')](function(_0x47e9b3){if(_0x47e9b3){_0x4544b5['interaction']=_0x47e9b3['get']({'plain':!![]});interaction_log[_0x4c41('0x21')](_0x4c41('0x6b'),_0x283bb3['user']['id'],_0x283bb3[_0x4c41('0x6c')][_0x4c41('0x3a')],_0x283bb3[_0x4c41('0x6c')][_0x4c41('0x6d')],_0x4544b5[_0x4c41('0x6e')]['id'],_0x283bb3[_0x4c41('0x5a')]?JSON[_0x4c41('0x26')](_0x283bb3[_0x4c41('0x5a')]):'null');return respondWithRpcPromise(_0x4c41('0x6f'),_0x4c41('0x70'),_0x4544b5);}return null;})[_0x4c41('0x20')](function(_0x694e3){if(_0x694e3){if(_0x283bb3[_0x4c41('0x5a')][_0x4c41('0x71')]){_0x4544b5['message'][_0x4c41('0x72')]=util[_0x4c41('0x62')](_0x4c41('0x73'),_0x283bb3[_0x4c41('0x6c')][_0x4c41('0x3a')]);_0x4544b5[_0x4c41('0x29')][_0x4c41('0x74')]=_0x4544b5[_0x4c41('0x74')];_0x4544b5[_0x4c41('0x29')][_0x4c41('0x75')]='accept';return respondWithRpcPromise(_0x4c41('0x76'),_0x4c41('0x76'),{'event':_0x4c41('0x77'),'message':_0x4544b5[_0x4c41('0x29')]},client9002)[_0x4c41('0x20')](function(){return _0x4544b5;});}return _0x4544b5;}return null;})[_0x4c41('0x20')](respondWithResult(_0x4757be,null))['catch'](handleError(_0x4757be,null));};var interaction_log=require(_0x4c41('0x5d'))(_0x4c41('0x78'));exports[_0x4c41('0x35')]=function(_0x48f959,_0x4acb57,_0x270a44){var _0x1084dd={'agent':{},'channel':_0x4c41('0x5f')};if(_0x48f959[_0x4c41('0x5a')]['id']){delete _0x48f959['body']['id'];}_0x48f959[_0x4c41('0x5a')][_0x4c41('0x63')]=_0x48f959[_0x4c41('0x5a')][_0x4c41('0x63')]||_0x48f959[_0x4c41('0x6c')]['id'];_0x1084dd[_0x4c41('0x79')]['id']=_0x48f959[_0x4c41('0x5a')][_0x4c41('0x63')];return db['OpenchannelMessage'][_0x4c41('0x5b')]({'where':{'id':_0x48f959[_0x4c41('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4acb57,null))[_0x4c41('0x20')](function(_0x5e4744){if(_0x5e4744){_0x1084dd[_0x4c41('0x29')]=_0x5e4744[_0x4c41('0x65')]({'plain':!![]});return db[_0x4c41('0x66')][_0x4c41('0x5b')]({'where':{'id':_0x5e4744['OpenchannelInteractionId']}});}return null;})[_0x4c41('0x20')](handleEntityNotFound(_0x4acb57,null))[_0x4c41('0x20')](function(_0x155b8a){if(_0x155b8a){_0x1084dd['interaction']=_0x155b8a[_0x4c41('0x65')]({'plain':!![]});interaction_log[_0x4c41('0x21')](_0x4c41('0x7a'),_0x48f959[_0x4c41('0x6c')]['id'],_0x48f959['user'][_0x4c41('0x3a')],_0x48f959[_0x4c41('0x6c')][_0x4c41('0x6d')],_0x1084dd[_0x4c41('0x6e')]['id'],_0x48f959['body']?JSON[_0x4c41('0x26')](_0x48f959[_0x4c41('0x5a')]):_0x4c41('0x7b'));return respondWithRpcPromise(_0x4c41('0x7c'),_0x4c41('0x7d'),_0x1084dd);}return null;})[_0x4c41('0x20')](function(_0x4e0c38){if(_0x4e0c38){_0x4e0c38[_0x4c41('0x29')][_0x4c41('0x72')]=util[_0x4c41('0x62')](_0x4c41('0x73'),_0x48f959['user']['name']);_0x4e0c38['message'][_0x4c41('0x74')]=_0x1084dd[_0x4c41('0x74')];_0x4e0c38[_0x4c41('0x29')][_0x4c41('0x75')]='reject';respondWithRpcPromise(_0x4c41('0x76'),_0x4c41('0x76'),{'event':'rejectmessage','message':_0x4e0c38['message']},client9002);return _0x1084dd;}return null;})[_0x4c41('0x20')](respondWithResult(_0x4acb57,null))['catch'](handleError(_0x4acb57,null));}; \ No newline at end of file +var _0x38a1=['result','catch','status','json','count','offset','Content-Range','apply','update','destroy','sendStatus','stack','name','send','index','OpenchannelMessage','rawAttributes','type','key','model','query','keys','attributes','fields','limit','order','sort','where','filters','merge','map','VIRTUAL','filter','options','include','rows','params','intersection','length','includeAll','find','create','body','describe','../../config/logger','openchannel-interactions','accept','openchannel','format','YYYY-MM-DD\x20HH:mm:ss','user','CmContact','Contact','OpenchannelInteraction','OpenchannelInteractionId','UserId','isNil','interaction','get','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','manual','interface','SIP/%s','event','EventManager','acceptmessage','reject','agent','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','channel','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','./openchannelMessage.socket','register','jayson/promise','client','http','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~!@#$%^&-_=+[{]}.','request','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x5e48b0,_0x590abf){var _0x15e4cc=function(_0x461c0e){while(--_0x461c0e){_0x5e48b0['push'](_0x5e48b0['shift']());}};_0x15e4cc(++_0x590abf);}(_0x38a1,0xc4));var _0x138a=function(_0x4132c2,_0xbec87e){_0x4132c2=_0x4132c2-0x0;var _0x28f0d0=_0x38a1[_0x4132c2];return _0x28f0d0;};'use strict';var pdf=require(_0x138a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x138a('0x1'));var zipdir=require(_0x138a('0x2'));var jsonpatch=require(_0x138a('0x3'));var rp=require(_0x138a('0x4'));var moment=require(_0x138a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x138a('0x6'));var util=require(_0x138a('0x7'));var path=require(_0x138a('0x8'));var sox=require(_0x138a('0x9'));var csv=require(_0x138a('0xa'));var ejs=require(_0x138a('0xb'));var fs=require('fs');var _=require(_0x138a('0xc'));var squel=require('squel');var crypto=require(_0x138a('0xd'));var jsforce=require(_0x138a('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x138a('0xf'));var Papa=require(_0x138a('0x10'));var Redis=require(_0x138a('0x11'));var authService=require(_0x138a('0x12'));var qs=require(_0x138a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x138a('0x14'));var logger=require('../../config/logger')(_0x138a('0x15'));var utils=require(_0x138a('0x16'));var config=require(_0x138a('0x17'));var db=require(_0x138a('0x18'))['db'];config['redis']=_[_0x138a('0x19')](config[_0x138a('0x1a')],{'host':_0x138a('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x138a('0x1c'))[_0x138a('0x1d')](socket);var jayson=require(_0x138a('0x1e'));var client=jayson[_0x138a('0x1f')]['http']({'port':0x232c});var client9002=jayson[_0x138a('0x1f')][_0x138a('0x20')]({'port':0x232a});function checkPasswordPattern(_0x4480bc,_0x420844,_0x466826){if(_0x466826){var _0x4039df=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4039df[_0x138a('0x21')](_0x420844)){return _0x4480bc;}else{throw new db[(_0x138a('0x22'))]['ValidationError'](_0x138a('0x23'));}}else{return _0x4480bc;}}function respondWithRpcPromise(_0x3ec828,_0x21de99,_0x18f221,_0x202d08){return new BPromise(function(_0xe67968,_0x32dbac){var _0x15b9ec=_0x202d08||client;return _0x15b9ec[_0x138a('0x24')](_0x3ec828,_0x18f221)[_0x138a('0x25')](function(_0x1a07bc){logger['info'](_0x138a('0x26'),_0x21de99,_0x138a('0x27'));logger['debug'](_0x138a('0x28'),_0x21de99,_0x138a('0x27'),JSON[_0x138a('0x29')](_0x1a07bc));if(_0x1a07bc[_0x138a('0x2a')]){if(_0x1a07bc['error'][_0x138a('0x2b')]===0x1f4){logger[_0x138a('0x2a')](_0x138a('0x26'),_0x21de99,_0x1a07bc['error'][_0x138a('0x2c')]);return _0x32dbac(_0x1a07bc[_0x138a('0x2a')][_0x138a('0x2c')]);}logger[_0x138a('0x2a')](_0x138a('0x26'),_0x21de99,_0x1a07bc[_0x138a('0x2a')][_0x138a('0x2c')]);return _0xe67968(_0x1a07bc['error'][_0x138a('0x2c')]);}else{logger[_0x138a('0x2d')](_0x138a('0x26'),_0x21de99,_0x138a('0x27'));_0xe67968(_0x1a07bc[_0x138a('0x2e')]['message']);}})[_0x138a('0x2f')](function(_0x66dec2){logger['error'](_0x138a('0x26'),_0x21de99,_0x66dec2);_0x32dbac(_0x66dec2);});});}function respondWithStatusCode(_0x17e835,_0x1795fc){_0x1795fc=_0x1795fc||0xcc;return function(_0x37915e){if(_0x37915e){return _0x17e835['sendStatus'](_0x1795fc);}return _0x17e835['status'](_0x1795fc)['end']();};}function respondWithResult(_0x1c1d36,_0x29dfb8){_0x29dfb8=_0x29dfb8||0xc8;return function(_0x37a6cf){if(_0x37a6cf){return _0x1c1d36[_0x138a('0x30')](_0x29dfb8)[_0x138a('0x31')](_0x37a6cf);}};}function respondWithFilteredResult(_0x5de391,_0x6e1f75){return function(_0x4c2b56){if(_0x4c2b56){var _0x539a36=_0x4c2b56[_0x138a('0x32')],_0x217a33=_0x6e1f75[_0x138a('0x33')],_0x2eccd4=_0x6e1f75[_0x138a('0x33')]+_0x6e1f75['limit'],_0x3b0b53;if(_0x2eccd4>=_0x539a36){_0x2eccd4=_0x539a36;_0x3b0b53=0xc8;}else{_0x3b0b53=0xce;}_0x5de391[_0x138a('0x30')](_0x3b0b53);return _0x5de391['set'](_0x138a('0x34'),_0x217a33+'-'+_0x2eccd4+'/'+_0x539a36)['json'](_0x4c2b56);}return null;};}function patchUpdates(_0x138a88){return function(_0xac4d8f){try{jsonpatch[_0x138a('0x35')](_0xac4d8f,_0x138a88,!![]);}catch(_0x233b4f){return BPromise['reject'](_0x233b4f);}return _0xac4d8f['save']();};}function saveUpdates(_0x20d6bd,_0x55b267){return function(_0x8772f){if(_0x8772f){return _0x8772f[_0x138a('0x36')](_0x20d6bd)[_0x138a('0x25')](function(_0x29c24c){return _0x29c24c;});}return null;};}function removeEntity(_0x2c83de,_0x376f05){return function(_0x5dafd7){if(_0x5dafd7){return _0x5dafd7[_0x138a('0x37')]()[_0x138a('0x25')](function(){_0x2c83de[_0x138a('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e56c0,_0x390b98){return function(_0x219a51){if(!_0x219a51){_0x4e56c0[_0x138a('0x38')](0x194);}return _0x219a51;};}function handleError(_0x54bc09,_0x3c4d7a){_0x3c4d7a=_0x3c4d7a||0x1f4;return function(_0x39a983){logger[_0x138a('0x2a')](_0x39a983[_0x138a('0x39')]);if(_0x39a983[_0x138a('0x3a')]){delete _0x39a983['name'];}_0x54bc09['status'](_0x3c4d7a)[_0x138a('0x3b')](_0x39a983);};}exports[_0x138a('0x3c')]=function(_0x33437f,_0x3b875c){var _0x48d95b={},_0x21272a={},_0x47406a={'count':0x0,'rows':[]};var _0x534e8a=_['map'](db[_0x138a('0x3d')][_0x138a('0x3e')],function(_0x5467a4){return{'name':_0x5467a4['fieldName'],'type':_0x5467a4[_0x138a('0x3f')][_0x138a('0x40')]};});_0x21272a[_0x138a('0x41')]=_['map'](_0x534e8a,_0x138a('0x3a'));_0x21272a[_0x138a('0x42')]=_[_0x138a('0x43')](_0x33437f[_0x138a('0x42')]);_0x21272a['filters']=_['intersection'](_0x21272a[_0x138a('0x41')],_0x21272a[_0x138a('0x42')]);_0x48d95b[_0x138a('0x44')]=_['intersection'](_0x21272a[_0x138a('0x41')],qs[_0x138a('0x45')](_0x33437f[_0x138a('0x42')][_0x138a('0x45')]));_0x48d95b[_0x138a('0x44')]=_0x48d95b['attributes']['length']?_0x48d95b[_0x138a('0x44')]:_0x21272a[_0x138a('0x41')];if(!_0x33437f[_0x138a('0x42')]['hasOwnProperty']('nolimit')){_0x48d95b[_0x138a('0x46')]=qs[_0x138a('0x46')](_0x33437f['query'][_0x138a('0x46')]);_0x48d95b[_0x138a('0x33')]=qs[_0x138a('0x33')](_0x33437f[_0x138a('0x42')][_0x138a('0x33')]);}_0x48d95b[_0x138a('0x47')]=qs[_0x138a('0x48')](_0x33437f[_0x138a('0x42')][_0x138a('0x48')]);_0x48d95b[_0x138a('0x49')]=qs[_0x138a('0x4a')](_['pick'](_0x33437f[_0x138a('0x42')],_0x21272a[_0x138a('0x4a')]));if(_0x33437f[_0x138a('0x42')]['filter']){_0x48d95b[_0x138a('0x49')]=_[_0x138a('0x4b')](_0x48d95b[_0x138a('0x49')],{'$or':_[_0x138a('0x4c')](_0x534e8a,function(_0x5c120e){if(_0x5c120e[_0x138a('0x3f')]!==_0x138a('0x4d')){var _0x54048c={};_0x54048c[_0x5c120e['name']]={'$like':'%'+_0x33437f[_0x138a('0x42')][_0x138a('0x4e')]+'%'};return _0x54048c;}})});}_0x48d95b=_['merge']({},_0x48d95b,_0x33437f[_0x138a('0x4f')]);var _0x43332d={'where':_0x48d95b['where']};return db['OpenchannelMessage']['count'](_0x43332d)[_0x138a('0x25')](function(_0x4e263c){_0x47406a[_0x138a('0x32')]=_0x4e263c;if(_0x33437f['query']['includeAll']){_0x48d95b[_0x138a('0x50')]=[{'all':!![]}];}return db[_0x138a('0x3d')]['findAll'](_0x48d95b);})['then'](function(_0x3842b5){_0x47406a[_0x138a('0x51')]=_0x3842b5;return _0x47406a;})['then'](respondWithFilteredResult(_0x3b875c,_0x48d95b))[_0x138a('0x2f')](handleError(_0x3b875c,null));};exports['show']=function(_0x55ee94,_0x478b2f){var _0x1b21f2={'raw':!![],'where':{'id':_0x55ee94[_0x138a('0x52')]['id']}},_0x125b90={};_0x125b90[_0x138a('0x41')]=_[_0x138a('0x43')](db[_0x138a('0x3d')]['rawAttributes']);_0x125b90['query']=_[_0x138a('0x43')](_0x55ee94[_0x138a('0x42')]);_0x125b90[_0x138a('0x4a')]=_[_0x138a('0x53')](_0x125b90[_0x138a('0x41')],_0x125b90[_0x138a('0x42')]);_0x1b21f2[_0x138a('0x44')]=_[_0x138a('0x53')](_0x125b90['model'],qs[_0x138a('0x45')](_0x55ee94[_0x138a('0x42')][_0x138a('0x45')]));_0x1b21f2['attributes']=_0x1b21f2['attributes'][_0x138a('0x54')]?_0x1b21f2[_0x138a('0x44')]:_0x125b90['model'];if(_0x55ee94[_0x138a('0x42')][_0x138a('0x55')]){_0x1b21f2['include']=[{'all':!![]}];}_0x1b21f2=_[_0x138a('0x4b')]({},_0x1b21f2,_0x55ee94['options']);return db['OpenchannelMessage'][_0x138a('0x56')](_0x1b21f2)[_0x138a('0x25')](handleEntityNotFound(_0x478b2f,null))[_0x138a('0x25')](respondWithResult(_0x478b2f,null))[_0x138a('0x2f')](handleError(_0x478b2f,null));};exports[_0x138a('0x57')]=function(_0x3f1e93,_0x240654){return db[_0x138a('0x3d')][_0x138a('0x57')](_0x3f1e93['body'],{})[_0x138a('0x25')](respondWithResult(_0x240654,0xc9))['catch'](handleError(_0x240654,null));};exports[_0x138a('0x36')]=function(_0x5edd30,_0x2f5d11){if(_0x5edd30['body']['id']){delete _0x5edd30[_0x138a('0x58')]['id'];}return db[_0x138a('0x3d')][_0x138a('0x56')]({'where':{'id':_0x5edd30['params']['id']}})[_0x138a('0x25')](handleEntityNotFound(_0x2f5d11,null))[_0x138a('0x25')](saveUpdates(_0x5edd30[_0x138a('0x58')],null))[_0x138a('0x25')](respondWithResult(_0x2f5d11,null))[_0x138a('0x2f')](handleError(_0x2f5d11,null));};exports[_0x138a('0x37')]=function(_0x243433,_0x26dd63){return db[_0x138a('0x3d')][_0x138a('0x56')]({'where':{'id':_0x243433['params']['id']}})['then'](handleEntityNotFound(_0x26dd63,null))['then'](removeEntity(_0x26dd63,null))[_0x138a('0x2f')](handleError(_0x26dd63,null));};exports[_0x138a('0x59')]=function(_0x55d7ff,_0xfe897b){return db[_0x138a('0x3d')][_0x138a('0x59')]()['then'](respondWithResult(_0xfe897b,null))[_0x138a('0x2f')](handleError(_0xfe897b,null));};var interaction_log=require(_0x138a('0x5a'))(_0x138a('0x5b'));exports[_0x138a('0x5c')]=function(_0x44a366,_0x28a21f,_0x1f4d03){var _0x2884f0={'channel':_0x138a('0x5d')};if(_0x44a366[_0x138a('0x58')]['id']){delete _0x44a366[_0x138a('0x58')]['id'];}_0x44a366[_0x138a('0x58')]['read']=!![];_0x44a366[_0x138a('0x58')]['readAt']=moment()[_0x138a('0x5e')](_0x138a('0x5f'));_0x44a366['body']['UserId']=_0x44a366[_0x138a('0x58')]['UserId']||_0x44a366[_0x138a('0x60')]['id'];return db[_0x138a('0x3d')][_0x138a('0x56')]({'where':{'id':_0x44a366['params']['id'],'UserId':null},'include':[{'model':db[_0x138a('0x61')],'as':_0x138a('0x62')}]})[_0x138a('0x25')](handleEntityNotFound(_0x28a21f,null))[_0x138a('0x25')](saveUpdates(_0x44a366['body'],null))[_0x138a('0x25')](function(_0x162b03){if(_0x162b03){_0x2884f0['message']=_0x162b03['get']({'plain':!![]});return db[_0x138a('0x63')]['find']({'where':{'id':_0x162b03[_0x138a('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x28a21f,null))[_0x138a('0x25')](function(_0x3adfe5){if(_0x3adfe5){return _0x3adfe5[_0x138a('0x36')]({'UserId':_0x44a366[_0x138a('0x58')][_0x138a('0x65')],'read1stAt':_[_0x138a('0x66')](_0x3adfe5['read1stAt'])?moment()[_0x138a('0x5e')](_0x138a('0x5f')):undefined});}return null;})[_0x138a('0x25')](function(_0x394a50){if(_0x394a50){_0x2884f0[_0x138a('0x67')]=_0x394a50[_0x138a('0x68')]({'plain':!![]});interaction_log['info'](_0x138a('0x69'),_0x44a366['user']['id'],_0x44a366[_0x138a('0x60')]['name'],_0x44a366[_0x138a('0x60')][_0x138a('0x6a')],_0x2884f0[_0x138a('0x67')]['id'],_0x44a366[_0x138a('0x58')]?JSON[_0x138a('0x29')](_0x44a366['body']):_0x138a('0x6b'));return respondWithRpcPromise(_0x138a('0x6c'),'acceptMessage',_0x2884f0);}return null;})[_0x138a('0x25')](function(_0x252bb3){if(_0x252bb3){if(_0x44a366[_0x138a('0x58')][_0x138a('0x6d')]){_0x2884f0[_0x138a('0x2c')][_0x138a('0x6e')]=util[_0x138a('0x5e')](_0x138a('0x6f'),_0x44a366[_0x138a('0x60')][_0x138a('0x3a')]);_0x2884f0[_0x138a('0x2c')]['channel']=_0x2884f0['channel'];_0x2884f0['message'][_0x138a('0x70')]='accept';return respondWithRpcPromise(_0x138a('0x71'),'EventManager',{'event':_0x138a('0x72'),'message':_0x2884f0['message']},client9002)[_0x138a('0x25')](function(){return _0x2884f0;});}return _0x2884f0;}return null;})[_0x138a('0x25')](respondWithResult(_0x28a21f,null))[_0x138a('0x2f')](handleError(_0x28a21f,null));};var interaction_log=require(_0x138a('0x5a'))('openchannel-interactions');exports[_0x138a('0x73')]=function(_0x3f0480,_0x44e06c,_0x47b4f9){var _0x2cd7de={'agent':{},'channel':_0x138a('0x5d')};if(_0x3f0480[_0x138a('0x58')]['id']){delete _0x3f0480[_0x138a('0x58')]['id'];}_0x3f0480['body']['UserId']=_0x3f0480['body'][_0x138a('0x65')]||_0x3f0480[_0x138a('0x60')]['id'];_0x2cd7de[_0x138a('0x74')]['id']=_0x3f0480[_0x138a('0x58')][_0x138a('0x65')];return db[_0x138a('0x3d')][_0x138a('0x56')]({'where':{'id':_0x3f0480[_0x138a('0x52')]['id'],'UserId':null}})[_0x138a('0x25')](handleEntityNotFound(_0x44e06c,null))[_0x138a('0x25')](function(_0x265dac){if(_0x265dac){_0x2cd7de[_0x138a('0x2c')]=_0x265dac[_0x138a('0x68')]({'plain':!![]});return db[_0x138a('0x63')][_0x138a('0x56')]({'where':{'id':_0x265dac[_0x138a('0x64')]}});}return null;})[_0x138a('0x25')](handleEntityNotFound(_0x44e06c,null))[_0x138a('0x25')](function(_0x18d1b6){if(_0x18d1b6){_0x2cd7de['interaction']=_0x18d1b6['get']({'plain':!![]});interaction_log[_0x138a('0x2d')](_0x138a('0x75'),_0x3f0480[_0x138a('0x60')]['id'],_0x3f0480[_0x138a('0x60')][_0x138a('0x3a')],_0x3f0480[_0x138a('0x60')][_0x138a('0x6a')],_0x2cd7de[_0x138a('0x67')]['id'],_0x3f0480[_0x138a('0x58')]?JSON[_0x138a('0x29')](_0x3f0480[_0x138a('0x58')]):'null');return respondWithRpcPromise(_0x138a('0x76'),_0x138a('0x77'),_0x2cd7de);}return null;})[_0x138a('0x25')](function(_0xc50b0){if(_0xc50b0){_0xc50b0['message']['interface']=util[_0x138a('0x5e')](_0x138a('0x6f'),_0x3f0480[_0x138a('0x60')][_0x138a('0x3a')]);_0xc50b0[_0x138a('0x2c')][_0x138a('0x78')]=_0x2cd7de[_0x138a('0x78')];_0xc50b0[_0x138a('0x2c')][_0x138a('0x70')]='reject';respondWithRpcPromise(_0x138a('0x71'),_0x138a('0x71'),{'event':'rejectmessage','message':_0xc50b0['message']},client9002);return _0x2cd7de;}return null;})[_0x138a('0x25')](respondWithResult(_0x44e06c,null))[_0x138a('0x2f')](handleError(_0x44e06c,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 975160c..891ee78 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 _0xda88=['exports','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x1fc03b,_0xee4bd8){var _0x1a5c1d=function(_0x5bf71d){while(--_0x5bf71d){_0x1fc03b['push'](_0x1fc03b['shift']());}};_0x1a5c1d(++_0xee4bd8);}(_0xda88,0x137));var _0x8da8=function(_0x2f3dee,_0x431792){_0x2f3dee=_0x2f3dee-0x0;var _0x24ec2b=_0xda88[_0x2f3dee];return _0x24ec2b;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x8da8('0x0'))['db'][_0x8da8('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x8da8('0x2')](0x0);var events={'afterCreate':_0x8da8('0x3'),'afterUpdate':_0x8da8('0x4'),'afterDestroy':_0x8da8('0x5')};function emitEvent(_0x1038e4){return function(_0x16004f,_0x2c2b22,_0x9af00f){OpenchannelMessageEvents[_0x8da8('0x6')](_0x1038e4+':'+_0x16004f['id'],_0x16004f);OpenchannelMessageEvents[_0x8da8('0x6')](_0x1038e4,_0x16004f);_0x9af00f(null);};}for(var e in events){if(events[_0x8da8('0x7')](e)){var event=events[e];OpenchannelMessage[_0x8da8('0x8')](e,emitEvent(event));}}module[_0x8da8('0x9')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x7573=['save','update','remove','emit','exports','setMaxListeners'];(function(_0xc91dfe,_0x3ef577){var _0x3aa3b6=function(_0x246d54){while(--_0x246d54){_0xc91dfe['push'](_0xc91dfe['shift']());}};_0x3aa3b6(++_0x3ef577);}(_0x7573,0x1eb));var _0x3757=function(_0x3faf6f,_0x13f6eb){_0x3faf6f=_0x3faf6f-0x0;var _0x3d9cc0=_0x7573[_0x3faf6f];return _0x3d9cc0;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x3757('0x0')](0x0);var events={'afterCreate':_0x3757('0x1'),'afterUpdate':_0x3757('0x2'),'afterDestroy':_0x3757('0x3')};function emitEvent(_0x612c2b){return function(_0xe52b5f,_0x57f787,_0x414aca){OpenchannelMessageEvents['emit'](_0x612c2b+':'+_0xe52b5f['id'],_0xe52b5f);OpenchannelMessageEvents[_0x3757('0x4')](_0x612c2b,_0xe52b5f);_0x414aca(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x3757('0x5')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index a4f8175..8a8fbb0 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 _0xa28a=['error','CmContact','describe','OpenchannelAccount','Interactions','Contact','keys','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','length','Interaction','POST','method','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','catch'];(function(_0x3d4876,_0x366386){var _0x58ca9d=function(_0x5bd045){while(--_0x5bd045){_0x3d4876['push'](_0x3d4876['shift']());}};_0x58ca9d(++_0x366386);}(_0xa28a,0x182));var _0xaa28=function(_0x552c61,_0x22d09c){_0x552c61=_0x552c61-0x0;var _0x17ba07=_0xa28a[_0x552c61];return _0x17ba07;};'use strict';var _=require(_0xaa28('0x0'));var util=require(_0xaa28('0x1'));var logger=require(_0xaa28('0x2'))(_0xaa28('0x3'));var moment=require(_0xaa28('0x4'));var BPromise=require(_0xaa28('0x5'));var rp=require(_0xaa28('0x6'));var fs=require('fs');var path=require(_0xaa28('0x7'));var rimraf=require(_0xaa28('0x8'));var config=require(_0xaa28('0x9'));var attributes=require('./openchannelMessage.attributes');module[_0xaa28('0xa')]=function(_0x5911bc,_0x316e0c){return _0x5911bc[_0xaa28('0xb')]('OpenchannelMessage',attributes,{'tableName':_0xaa28('0xc'),'paranoid':![],'indexes':[{'name':_0xaa28('0xd'),'fields':[_0xaa28('0xe')],'type':_0xaa28('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2eb934,_0x3a6d16,_0x3dad41){var _0x49ed1e=_0x5911bc[_0xaa28('0x10')];var _0x1ad7b2=_0x2eb934[_0xaa28('0x11')]({'plain':!![]});if(_0x1ad7b2[_0xaa28('0x12')][_0xaa28('0x13')]()==='in'||_0x1ad7b2['direction'][_0xaa28('0x13')]()===_0xaa28('0x14')&&!_0x1ad7b2[_0xaa28('0x15')]&&!_['isNil'](_0x1ad7b2[_0xaa28('0x16')])){_0x49ed1e[_0xaa28('0x17')][_0xaa28('0x18')]({'where':{'id':_0x1ad7b2[_0xaa28('0x19')]}})[_0xaa28('0x1a')](function(_0x361141){if(_0x361141){_0x361141[_0xaa28('0x1b')]({'lastMsgAt':_0x1ad7b2[_0xaa28('0x1c')],'lastMsgDirection':_0x1ad7b2[_0xaa28('0x12')][_0xaa28('0x13')]()});}})[_0xaa28('0x1d')](function(_0x3df60f){console[_0xaa28('0x1e')](_0x3df60f);});}if(_0x1ad7b2[_0xaa28('0x12')]==='out'&&!_0x1ad7b2[_0xaa28('0x15')]){var _0x5d157f;_0x49ed1e[_0xaa28('0x1f')][_0xaa28('0x20')]()['then'](function(_0x1aaf37){return _0x49ed1e[_0xaa28('0x21')]['find']({'where':{'id':_0x1ad7b2['OpenchannelAccountId']},'include':[{'model':_0x49ed1e[_0xaa28('0x17')],'as':_0xaa28('0x22'),'where':{'id':_0x1ad7b2['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x49ed1e[_0xaa28('0x1f')],'as':_0xaa28('0x23'),'attributes':_[_0xaa28('0x24')](_0x1aaf37)}]}]});})['then'](function(_0x4567db){_0x5d157f=_0x4567db['get']({'plain':!![]});if(_0x5d157f&&_0x5d157f['replyUri']){logger[_0xaa28('0x25')](_0xaa28('0x26'),_0xaa28('0x27'),util['format'](_0xaa28('0x28'),_0x1ad7b2['id'],_0x5d157f[_0xaa28('0x29')]));if(_0x5d157f[_0xaa28('0x22')]&&_0x5d157f['Interactions'][_0xaa28('0x2a')]){_0x1ad7b2[_0xaa28('0x2b')]=_['omit'](_0x5d157f[_0xaa28('0x22')][0x0],_0xaa28('0x23'));_0x1ad7b2[_0xaa28('0x23')]=_0x5d157f[_0xaa28('0x22')][0x0][_0xaa28('0x23')];}var _0x3a6d16={'method':_0xaa28('0x2c'),'uri':encodeURI(_0x5d157f[_0xaa28('0x29')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x3a6d16[_0xaa28('0x2d')]){case'GET':_0x3a6d16['qs']=_0x1ad7b2;break;case _0xaa28('0x2c'):_0x3a6d16['body']=_0x1ad7b2;break;}return rp(_0x3a6d16)['then'](function(_0x4caede){logger[_0xaa28('0x25')](_0xaa28('0x26'),_0xaa28('0x27'),util[_0xaa28('0x2e')](_0xaa28('0x2f'),_0x1ad7b2['id'],_0x5d157f[_0xaa28('0x29')]));if(_0x4caede['body'][_0xaa28('0x30')]&&_0x4caede[_0xaa28('0xe')][_0xaa28('0x30')]!=_0x1ad7b2[_0xaa28('0x2b')][_0xaa28('0x30')]){return _0x49ed1e[_0xaa28('0x17')]['update']({'threadId':_0x4caede[_0xaa28('0xe')]['threadId']},{'logging':!![],'where':{'id':_0x1ad7b2[_0xaa28('0x2b')]['id']}});}else{return;}})[_0xaa28('0x1a')](function(){return _0x2eb934['update']({'read':!![]});})['catch'](function(_0x3d16c9){logger[_0xaa28('0x1e')](_0xaa28('0x26'),_0xaa28('0x27'),util[_0xaa28('0x31')](_0x3d16c9,{'showHidden':![],'depth':null}));_0x3dad41();});}else{_0x3dad41();}})['finally'](function(){_0x3dad41();});}else{_0x3dad41();}}},'charset':_0xaa28('0x32'),'collate':_0xaa28('0x33')});}; \ No newline at end of file +var _0xdcaa=['moment','bluebird','path','rimraf','../../config/environment','exports','define','OpenchannelMessage','fti_openchannel_messages','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','OpenchannelInteraction','OpenchannelInteractionId','then','update','error','secret','CmContact','OpenchannelAccount','find','OpenchannelAccountId','Interactions','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','POST','method','GET','format','Message\x20%d\x20forwarded\x20to\x20%s','body','threadId','inspect','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0xdcaa,0x91));var _0xadca=function(_0x4d8cac,_0xa02f68){_0x4d8cac=_0x4d8cac-0x0;var _0x26d6c7=_0xdcaa[_0x4d8cac];return _0x26d6c7;};'use strict';var _=require(_0xadca('0x0'));var util=require('util');var logger=require(_0xadca('0x1'))('api');var moment=require(_0xadca('0x2'));var BPromise=require(_0xadca('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xadca('0x4'));var rimraf=require(_0xadca('0x5'));var config=require(_0xadca('0x6'));var attributes=require('./openchannelMessage.attributes');module[_0xadca('0x7')]=function(_0x4e474d,_0x2d2d8a){return _0x4e474d[_0xadca('0x8')](_0xadca('0x9'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0xadca('0xa'),'fields':['body'],'type':_0xadca('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x30b9ca,_0x5ee1f3,_0x1964e5){var _0x39921b=_0x4e474d[_0xadca('0xc')];var _0x334f51=_0x30b9ca[_0xadca('0xd')]({'plain':!![]});if(_0x334f51[_0xadca('0xe')][_0xadca('0xf')]()==='in'||_0x334f51[_0xadca('0xe')][_0xadca('0xf')]()===_0xadca('0x10')&&!_0x334f51['secret']&&!_[_0xadca('0x11')](_0x334f51[_0xadca('0x12')])){_0x39921b[_0xadca('0x13')]['findOne']({'where':{'id':_0x334f51[_0xadca('0x14')]}})[_0xadca('0x15')](function(_0xfda1aa){if(_0xfda1aa){_0xfda1aa[_0xadca('0x16')]({'lastMsgAt':_0x334f51['createdAt'],'lastMsgDirection':_0x334f51[_0xadca('0xe')]['toLowerCase']()});}})['catch'](function(_0x374281){console[_0xadca('0x17')](_0x374281);});}if(_0x334f51[_0xadca('0xe')]===_0xadca('0x10')&&!_0x334f51[_0xadca('0x18')]){var _0x462e44;_0x39921b[_0xadca('0x19')]['describe']()[_0xadca('0x15')](function(_0x364af3){return _0x39921b[_0xadca('0x1a')][_0xadca('0x1b')]({'where':{'id':_0x334f51[_0xadca('0x1c')]},'include':[{'model':_0x39921b[_0xadca('0x13')],'as':_0xadca('0x1d'),'where':{'id':_0x334f51[_0xadca('0x14')]},'limit':0x1,'include':[{'model':_0x39921b[_0xadca('0x19')],'as':_0xadca('0x1e'),'attributes':_[_0xadca('0x1f')](_0x364af3)}]}]});})[_0xadca('0x15')](function(_0x2683a9){_0x462e44=_0x2683a9['get']({'plain':!![]});if(_0x462e44&&_0x462e44[_0xadca('0x20')]){logger[_0xadca('0x21')](_0xadca('0x22'),_0xadca('0x23'),util['format'](_0xadca('0x24'),_0x334f51['id'],_0x462e44[_0xadca('0x20')]));if(_0x462e44[_0xadca('0x1d')]&&_0x462e44[_0xadca('0x1d')][_0xadca('0x25')]){_0x334f51[_0xadca('0x26')]=_['omit'](_0x462e44['Interactions'][0x0],_0xadca('0x1e'));_0x334f51[_0xadca('0x1e')]=_0x462e44[_0xadca('0x1d')][0x0][_0xadca('0x1e')];}var _0x5ee1f3={'method':_0xadca('0x27'),'uri':encodeURI(_0x462e44[_0xadca('0x20')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x5ee1f3[_0xadca('0x28')]){case _0xadca('0x29'):_0x5ee1f3['qs']=_0x334f51;break;case _0xadca('0x27'):_0x5ee1f3['body']=_0x334f51;break;}return rp(_0x5ee1f3)['then'](function(_0x4f59c3){logger[_0xadca('0x21')](_0xadca('0x22'),_0xadca('0x23'),util[_0xadca('0x2a')](_0xadca('0x2b'),_0x334f51['id'],_0x462e44['replyUri']));if(_0x4f59c3[_0xadca('0x2c')][_0xadca('0x2d')]&&_0x4f59c3[_0xadca('0x2c')][_0xadca('0x2d')]!=_0x334f51['Interaction'][_0xadca('0x2d')]){return _0x39921b['OpenchannelInteraction'][_0xadca('0x16')]({'threadId':_0x4f59c3['body']['threadId']},{'logging':!![],'where':{'id':_0x334f51[_0xadca('0x26')]['id']}});}else{return;}})[_0xadca('0x15')](function(){return _0x30b9ca['update']({'read':!![]});})['catch'](function(_0x35876a){logger['error'](_0xadca('0x22'),_0xadca('0x23'),util[_0xadca('0x2e')](_0x35876a,{'showHidden':![],'depth':null}));_0x1964e5();});}else{_0x1964e5();}})['finally'](function(){_0x1964e5();});}else{_0x1964e5();}}},'charset':_0xadca('0x2f'),'collate':_0xadca('0x30')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 519afe2..b2aae02 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 _0xca84=['http','redis','defaults','socket.io-emitter','./openchannelMessage.socket','request','then','info','request\x20sent','error','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','CreateOpenchannelMessage','OpenchannelMessage','create','body','options','raw','stringify','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xca84,0xf5));var _0x4ca8=function(_0x3a6d43,_0x3c7dac){_0x3a6d43=_0x3a6d43-0x0;var _0x463802=_0xca84[_0x3a6d43];return _0x463802;};'use strict';var _=require(_0x4ca8('0x0'));var util=require(_0x4ca8('0x1'));var moment=require(_0x4ca8('0x2'));var BPromise=require('bluebird');var rs=require(_0x4ca8('0x3'));var fs=require('fs');var Redis=require(_0x4ca8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4ca8('0x5'));var logger=require(_0x4ca8('0x6'))(_0x4ca8('0x7'));var config=require(_0x4ca8('0x8'));var jayson=require(_0x4ca8('0x9'));var client=jayson[_0x4ca8('0xa')][_0x4ca8('0xb')]({'port':0x232a});config[_0x4ca8('0xc')]=_[_0x4ca8('0xd')](config[_0x4ca8('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x4ca8('0xe'))(new Redis(config['redis']));require(_0x4ca8('0xf'))['register'](socket);function respondWithRpcPromise(_0x2f1198,_0x57db27,_0x41991d){return new BPromise(function(_0x53ffa,_0x3cc932){return client[_0x4ca8('0x10')](_0x2f1198,_0x41991d)[_0x4ca8('0x11')](function(_0x45e7d0){logger[_0x4ca8('0x12')]('OpenchannelMessage,\x20%s,\x20%s',_0x57db27,'request\x20sent');logger['debug']('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x57db27,_0x4ca8('0x13'),JSON['stringify'](_0x45e7d0));if(_0x45e7d0[_0x4ca8('0x14')]){if(_0x45e7d0[_0x4ca8('0x14')]['code']===0x1f4){logger['error'](_0x4ca8('0x15'),_0x57db27,_0x45e7d0[_0x4ca8('0x14')][_0x4ca8('0x16')]);return _0x3cc932(_0x45e7d0[_0x4ca8('0x14')][_0x4ca8('0x16')]);}logger[_0x4ca8('0x14')](_0x4ca8('0x15'),_0x57db27,_0x45e7d0[_0x4ca8('0x14')][_0x4ca8('0x16')]);return _0x53ffa(_0x45e7d0[_0x4ca8('0x14')][_0x4ca8('0x16')]);}else{logger[_0x4ca8('0x12')]('OpenchannelMessage,\x20%s,\x20%s',_0x57db27,_0x4ca8('0x13'));_0x53ffa(_0x45e7d0[_0x4ca8('0x17')][_0x4ca8('0x16')]);}})[_0x4ca8('0x18')](function(_0x28fe2b){logger['error'](_0x4ca8('0x15'),_0x57db27,_0x28fe2b);_0x3cc932(_0x28fe2b);});});}exports[_0x4ca8('0x19')]=function(_0x51a8c8){var _0x60e9e6=this;return new Promise(function(_0x4a6348,_0x2764e4){return db[_0x4ca8('0x1a')][_0x4ca8('0x1b')](_0x51a8c8[_0x4ca8('0x1c')],{'raw':_0x51a8c8[_0x4ca8('0x1d')]?_0x51a8c8['options'][_0x4ca8('0x1e')]===undefined?!![]:![]:!![]})[_0x4ca8('0x11')](function(_0x354072){logger[_0x4ca8('0x12')](_0x4ca8('0x19'),_0x51a8c8);logger['debug'](_0x4ca8('0x19'),_0x51a8c8,JSON[_0x4ca8('0x1f')](_0x354072));_0x4a6348(_0x354072);})[_0x4ca8('0x18')](function(_0x5e41d9){logger[_0x4ca8('0x14')]('CreateOpenchannelMessage',_0x5e41d9[_0x4ca8('0x16')],_0x51a8c8);_0x2764e4(_0x60e9e6[_0x4ca8('0x14')](0x1f4,_0x5e41d9[_0x4ca8('0x16')]));});});}; \ No newline at end of file +var _0x6edc=['jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./openchannelMessage.socket','request','then','info','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','error','code','message','catch','CreateOpenchannelMessage','OpenchannelMessage','create','body','options','stringify','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x192f4e,_0x3bce6e){var _0x47b6b9=function(_0x3b65be){while(--_0x3b65be){_0x192f4e['push'](_0x192f4e['shift']());}};_0x47b6b9(++_0x3bce6e);}(_0x6edc,0x138));var _0xc6ed=function(_0x25ddca,_0x5bbab6){_0x25ddca=_0x25ddca-0x0;var _0x54c8ff=_0x6edc[_0x25ddca];return _0x54c8ff;};'use strict';var _=require(_0xc6ed('0x0'));var util=require(_0xc6ed('0x1'));var moment=require(_0xc6ed('0x2'));var BPromise=require(_0xc6ed('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc6ed('0x4'))['db'];var utils=require(_0xc6ed('0x5'));var logger=require(_0xc6ed('0x6'))(_0xc6ed('0x7'));var config=require('../../config/environment');var jayson=require(_0xc6ed('0x8'));var client=jayson[_0xc6ed('0x9')][_0xc6ed('0xa')]({'port':0x232a});config['redis']=_[_0xc6ed('0xb')](config['redis'],{'host':_0xc6ed('0xc'),'port':0x18eb});var socket=require(_0xc6ed('0xd'))(new Redis(config[_0xc6ed('0xe')]));require(_0xc6ed('0xf'))['register'](socket);function respondWithRpcPromise(_0x83003,_0x2bc1d3,_0x32e625){return new BPromise(function(_0x4943be,_0x5a35ca){return client[_0xc6ed('0x10')](_0x83003,_0x32e625)[_0xc6ed('0x11')](function(_0x2719ea){logger[_0xc6ed('0x12')](_0xc6ed('0x13'),_0x2bc1d3,'request\x20sent');logger[_0xc6ed('0x14')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x2bc1d3,_0xc6ed('0x15'),JSON['stringify'](_0x2719ea));if(_0x2719ea[_0xc6ed('0x16')]){if(_0x2719ea[_0xc6ed('0x16')][_0xc6ed('0x17')]===0x1f4){logger['error'](_0xc6ed('0x13'),_0x2bc1d3,_0x2719ea[_0xc6ed('0x16')][_0xc6ed('0x18')]);return _0x5a35ca(_0x2719ea['error'][_0xc6ed('0x18')]);}logger['error'](_0xc6ed('0x13'),_0x2bc1d3,_0x2719ea[_0xc6ed('0x16')][_0xc6ed('0x18')]);return _0x4943be(_0x2719ea['error'][_0xc6ed('0x18')]);}else{logger[_0xc6ed('0x12')](_0xc6ed('0x13'),_0x2bc1d3,_0xc6ed('0x15'));_0x4943be(_0x2719ea['result']['message']);}})[_0xc6ed('0x19')](function(_0x9bbd08){logger[_0xc6ed('0x16')](_0xc6ed('0x13'),_0x2bc1d3,_0x9bbd08);_0x5a35ca(_0x9bbd08);});});}exports[_0xc6ed('0x1a')]=function(_0x2ebb09){var _0x28a334=this;return new Promise(function(_0xdbe2a1,_0xad393b){return db[_0xc6ed('0x1b')][_0xc6ed('0x1c')](_0x2ebb09[_0xc6ed('0x1d')],{'raw':_0x2ebb09[_0xc6ed('0x1e')]?_0x2ebb09[_0xc6ed('0x1e')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1170b0){logger['info']('CreateOpenchannelMessage',_0x2ebb09);logger[_0xc6ed('0x14')]('CreateOpenchannelMessage',_0x2ebb09,JSON[_0xc6ed('0x1f')](_0x1170b0));_0xdbe2a1(_0x1170b0);})[_0xc6ed('0x19')](function(_0x4682c5){logger['error']('CreateOpenchannelMessage',_0x4682c5['message'],_0x2ebb09);_0xad393b(_0x28a334[_0xc6ed('0x16')](0x1f4,_0x4682c5[_0xc6ed('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 390503d..7c049a8 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 _0xa9e0=['register','length','openchannelMessage:','./openchannelMessage.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(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'use strict';var OpenchannelMessageEvents=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(){OpenchannelMessageEvents[_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);OpenchannelMessageEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xac4a=['save','remove','update','removeListener','./openchannelMessage.events'];(function(_0x1da10a,_0x1fe948){var _0x5aea64=function(_0x1fa637){while(--_0x1fa637){_0x1da10a['push'](_0x1da10a['shift']());}};_0x5aea64(++_0x1fe948);}(_0xac4a,0x13f));var _0xaac4=function(_0x101edf,_0x463c83){_0x101edf=_0x101edf-0x0;var _0x54cd19=_0xac4a[_0x101edf];return _0x54cd19;};'use strict';var OpenchannelMessageEvents=require(_0xaac4('0x0'));var events=[_0xaac4('0x1'),_0xaac4('0x2'),_0xaac4('0x3')];function createListener(_0x38f4f4,_0x1dc251){return function(_0x5aeb7d){_0x1dc251['emit'](_0x38f4f4,_0x5aeb7d);};}function removeListener(_0x2af0f6,_0x2a5762){return function(){OpenchannelMessageEvents[_0xaac4('0x4')](_0x2af0f6,_0x2a5762);};}exports['register']=function(_0x1283a5){for(var _0x53d03a=0x0,_0x1cdfc5=events['length'];_0x53d03a<_0x1cdfc5;_0x53d03a++){var _0x1e4283=events[_0x53d03a];var _0x27354c=createListener('openchannelMessage:'+_0x1e4283,_0x1283a5);OpenchannelMessageEvents['on'](_0x1e4283,_0x27354c);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 394348f..c137895 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 _0xec46=['addAgents','put','update','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','/:id/teams','addTeams'];(function(_0x2dbce7,_0x57cb8d){var _0x3a3ed0=function(_0x28c8c6){while(--_0x28c8c6){_0x2dbce7['push'](_0x2dbce7['shift']());}};_0x3a3ed0(++_0x57cb8d);}(_0xec46,0x19c));var _0x6ec4=function(_0x572438,_0x1b94fe){_0x572438=_0x572438-0x0;var _0xc6e9a7=_0xec46[_0x572438];return _0xc6e9a7;};'use strict';var multer=require(_0x6ec4('0x0'));var util=require(_0x6ec4('0x1'));var path=require(_0x6ec4('0x2'));var timeout=require(_0x6ec4('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x6ec4('0x4'));var interaction=require(_0x6ec4('0x5'));var config=require(_0x6ec4('0x6'));var controller=require('./openchannelQueue.controller');router[_0x6ec4('0x7')]('/',auth[_0x6ec4('0x8')](),controller['index']);router[_0x6ec4('0x7')]('/describe',auth[_0x6ec4('0x8')](),controller[_0x6ec4('0x9')]);router[_0x6ec4('0x7')](_0x6ec4('0xa'),auth[_0x6ec4('0x8')](),controller[_0x6ec4('0xb')]);router[_0x6ec4('0x7')](_0x6ec4('0xc'),auth[_0x6ec4('0x8')](),controller[_0x6ec4('0xd')]);router[_0x6ec4('0x7')]('/:id/teams',auth['isAuthenticated'](),controller[_0x6ec4('0xe')]);router[_0x6ec4('0x7')](_0x6ec4('0xf'),auth['isAuthenticated'](),controller[_0x6ec4('0x10')]);router['post']('/',auth[_0x6ec4('0x8')](),controller['create']);router[_0x6ec4('0x11')](_0x6ec4('0x12'),auth[_0x6ec4('0x8')](),controller[_0x6ec4('0x13')]);router[_0x6ec4('0x11')]('/:id/users',auth[_0x6ec4('0x8')](),controller[_0x6ec4('0x14')]);router[_0x6ec4('0x15')](_0x6ec4('0xa'),auth[_0x6ec4('0x8')](),controller[_0x6ec4('0x16')]);router[_0x6ec4('0x17')](_0x6ec4('0xa'),auth[_0x6ec4('0x8')](),controller[_0x6ec4('0x18')]);router[_0x6ec4('0x17')]('/:id/teams',auth[_0x6ec4('0x8')](),controller['removeTeams']);router['delete'](_0x6ec4('0xf'),auth['isAuthenticated'](),controller[_0x6ec4('0x19')]);module[_0x6ec4('0x1a')]=router; \ No newline at end of file +var _0x6688=['getTeams','/:id/users','create','post','addTeams','addAgents','put','destroy','delete','/:id/teams','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','index','isAuthenticated','describe','/:id','show','/:id/members'];(function(_0x4e6eb2,_0x16a451){var _0x4e0c1c=function(_0x59f144){while(--_0x59f144){_0x4e6eb2['push'](_0x4e6eb2['shift']());}};_0x4e0c1c(++_0x16a451);}(_0x6688,0x10e));var _0x8668=function(_0x446d9f,_0x4062f6){_0x446d9f=_0x446d9f-0x0;var _0xff1bce=_0x6688[_0x446d9f];return _0xff1bce;};'use strict';var multer=require(_0x8668('0x0'));var util=require(_0x8668('0x1'));var path=require(_0x8668('0x2'));var timeout=require('connect-timeout');var express=require(_0x8668('0x3'));var router=express[_0x8668('0x4')]();var auth=require(_0x8668('0x5'));var interaction=require(_0x8668('0x6'));var config=require(_0x8668('0x7'));var controller=require(_0x8668('0x8'));router[_0x8668('0x9')]('/',auth['isAuthenticated'](),controller[_0x8668('0xa')]);router[_0x8668('0x9')]('/describe',auth[_0x8668('0xb')](),controller[_0x8668('0xc')]);router[_0x8668('0x9')](_0x8668('0xd'),auth[_0x8668('0xb')](),controller[_0x8668('0xe')]);router[_0x8668('0x9')](_0x8668('0xf'),auth['isAuthenticated'](),controller['getMembers']);router['get']('/:id/teams',auth[_0x8668('0xb')](),controller[_0x8668('0x10')]);router[_0x8668('0x9')](_0x8668('0x11'),auth[_0x8668('0xb')](),controller['getAgents']);router['post']('/',auth[_0x8668('0xb')](),controller[_0x8668('0x12')]);router[_0x8668('0x13')]('/:id/teams',auth[_0x8668('0xb')](),controller[_0x8668('0x14')]);router[_0x8668('0x13')]('/:id/users',auth['isAuthenticated'](),controller[_0x8668('0x15')]);router[_0x8668('0x16')](_0x8668('0xd'),auth[_0x8668('0xb')](),controller['update']);router['delete'](_0x8668('0xd'),auth[_0x8668('0xb')](),controller[_0x8668('0x17')]);router[_0x8668('0x18')](_0x8668('0x19'),auth[_0x8668('0xb')](),controller['removeTeams']);router[_0x8668('0x18')]('/:id/users',auth['isAuthenticated'](),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 cf15a4d..2d2d166 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 _0x3a6d=['ENUM','rrmemory','roundrobin','sequelize','exports','name','STRING','INTEGER'];(function(_0x5d9947,_0x459f22){var _0x1c09e5=function(_0x136c71){while(--_0x136c71){_0x5d9947['push'](_0x5d9947['shift']());}};_0x1c09e5(++_0x459f22);}(_0x3a6d,0x143));var _0xd3a6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3a6d[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xd3a6('0x0'));module[_0xd3a6('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xd3a6('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd3a6('0x3')]},'timeout':{'type':Sequelize[_0xd3a6('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd3a6('0x5')](_0xd3a6('0x6'),'beepall',_0xd3a6('0x7'))}}; \ No newline at end of file +var _0x556a=['name','INTEGER','ENUM','rrmemory','beepall','sequelize','exports','STRING'];(function(_0x4e491e,_0x324214){var _0x58c1b4=function(_0x327fe6){while(--_0x327fe6){_0x4e491e['push'](_0x4e491e['shift']());}};_0x58c1b4(++_0x324214);}(_0x556a,0x1dd));var _0xa556=function(_0x2cdfc7,_0x1bdf23){_0x2cdfc7=_0x2cdfc7-0x0;var _0x714fdf=_0x556a[_0x2cdfc7];return _0x714fdf;};'use strict';var Sequelize=require(_0xa556('0x0'));module[_0xa556('0x1')]={'name':{'type':Sequelize[_0xa556('0x2')],'unique':_0xa556('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa556('0x2')]},'timeout':{'type':Sequelize[_0xa556('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa556('0x5')](_0xa556('0x6'),_0xa556('0x7'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 7461833..c674fdc 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 _0x8509=['removeTeams','User','select','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','all','union','compact','value','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','isArray','getAgents','findOne','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','json','count','limit','set','Content-Range','apply','reject','save','destroy','then','get','OpenchannelQueues','error','stack','name','send','map','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filter','merge','type','options','OpenchannelQueue','includeAll','include','findAll','catch','rawAttributes','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','update','body','params','describe','getMembers','UserOpenchannelQueue','pick','findAndCountAll','agent','updatedAt','createdAt','format','%s/%s','getTeams','Team','ids','online','flatMap','Agents','sequelize','addTeams','each','findOrCreate','emit','userOpenchannelQueue:save'];(function(_0x18d631,_0x4376d2){var _0x50d708=function(_0x3b6ab5){while(--_0x3b6ab5){_0x18d631['push'](_0x18d631['shift']());}};_0x50d708(++_0x4376d2);}(_0x8509,0xa8));var _0x9850=function(_0x2ccc71,_0x1c458a){_0x2ccc71=_0x2ccc71-0x0;var _0x20fa15=_0x8509[_0x2ccc71];return _0x20fa15;};'use strict';var pdf=require(_0x9850('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9850('0x1'));var zipdir=require(_0x9850('0x2'));var jsonpatch=require(_0x9850('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9850('0x4'));var Mustache=require(_0x9850('0x5'));var util=require(_0x9850('0x6'));var path=require(_0x9850('0x7'));var sox=require('sox');var csv=require(_0x9850('0x8'));var ejs=require(_0x9850('0x9'));var fs=require('fs');var _=require(_0x9850('0xa'));var squel=require('squel');var crypto=require(_0x9850('0xb'));var jsforce=require(_0x9850('0xc'));var deskjs=require(_0x9850('0xd'));var toCsv=require(_0x9850('0x8'));var querystring=require(_0x9850('0xe'));var Papa=require(_0x9850('0xf'));var Redis=require(_0x9850('0x10'));var authService=require(_0x9850('0x11'));var qs=require(_0x9850('0x12'));var as=require(_0x9850('0x13'));var hardwareService=require(_0x9850('0x14'));var logger=require(_0x9850('0x15'))(_0x9850('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x9850('0x17'))['db'];config[_0x9850('0x18')]=_[_0x9850('0x19')](config[_0x9850('0x18')],{'host':_0x9850('0x1a'),'port':0x18eb});var socket=require(_0x9850('0x1b'))(new Redis(config['redis']));require(_0x9850('0x1c'))[_0x9850('0x1d')](socket);function respondWithStatusCode(_0x43a922,_0x1990c7){_0x1990c7=_0x1990c7||0xcc;return function(_0x2b89f7){if(_0x2b89f7){return _0x43a922[_0x9850('0x1e')](_0x1990c7);}return _0x43a922[_0x9850('0x1f')](_0x1990c7)[_0x9850('0x20')]();};}function respondWithResult(_0x5917ad,_0x194643){_0x194643=_0x194643||0xc8;return function(_0x24d39e){if(_0x24d39e){return _0x5917ad[_0x9850('0x1f')](_0x194643)[_0x9850('0x21')](_0x24d39e);}};}function respondWithFilteredResult(_0x40f679,_0x34db2d){return function(_0x286113){if(_0x286113){var _0x3cd2c1=_0x286113[_0x9850('0x22')],_0xd2101d=_0x34db2d['offset'],_0xfa313c=_0x34db2d['offset']+_0x34db2d[_0x9850('0x23')],_0x5497e3;if(_0xfa313c>=_0x3cd2c1){_0xfa313c=_0x3cd2c1;_0x5497e3=0xc8;}else{_0x5497e3=0xce;}_0x40f679[_0x9850('0x1f')](_0x5497e3);return _0x40f679[_0x9850('0x24')](_0x9850('0x25'),_0xd2101d+'-'+_0xfa313c+'/'+_0x3cd2c1)[_0x9850('0x21')](_0x286113);}return null;};}function patchUpdates(_0xe438a3){return function(_0x2d6ac5){try{jsonpatch[_0x9850('0x26')](_0x2d6ac5,_0xe438a3,!![]);}catch(_0x31fb25){return BPromise[_0x9850('0x27')](_0x31fb25);}return _0x2d6ac5[_0x9850('0x28')]();};}function saveUpdates(_0xff8335,_0x2f12fb){return function(_0x82582){if(_0x82582){return _0x82582['update'](_0xff8335)['then'](function(_0x294a1b){return _0x294a1b;});}return null;};}function removeEntity(_0x40d491,_0x855ff4){return function(_0x5b8053){if(_0x5b8053){return _0x5b8053[_0x9850('0x29')]()[_0x9850('0x2a')](function(){var _0x4b4aee=_0x5b8053[_0x9850('0x2b')]({'plain':!![]});var _0x48ec01=_0x9850('0x2c');return db['UserProfileResource'][_0x9850('0x29')]({'where':{'type':_0x48ec01,'resourceId':_0x4b4aee['id']}})[_0x9850('0x2a')](function(){return _0x5b8053;});})[_0x9850('0x2a')](function(){_0x40d491['status'](0xcc)[_0x9850('0x20')]();});}};}function handleEntityNotFound(_0x1dff29,_0x4b590d){return function(_0x5ca283){if(!_0x5ca283){_0x1dff29['sendStatus'](0x194);}return _0x5ca283;};}function handleError(_0xd2b6,_0x402189){_0x402189=_0x402189||0x1f4;return function(_0x2220b0){logger[_0x9850('0x2d')](_0x2220b0[_0x9850('0x2e')]);if(_0x2220b0[_0x9850('0x2f')]){delete _0x2220b0[_0x9850('0x2f')];}_0xd2b6[_0x9850('0x1f')](_0x402189)[_0x9850('0x30')](_0x2220b0);};}exports['index']=function(_0x347d1f,_0x186ab3){var _0x22f139={},_0x2a5dab={},_0x45a0dc={'count':0x0,'rows':[]};var _0x4476c6=_[_0x9850('0x31')](db['OpenchannelQueue']['rawAttributes'],function(_0x1309da){return{'name':_0x1309da['fieldName'],'type':_0x1309da['type'][_0x9850('0x32')]};});_0x2a5dab[_0x9850('0x33')]=_[_0x9850('0x31')](_0x4476c6,_0x9850('0x2f'));_0x2a5dab[_0x9850('0x34')]=_[_0x9850('0x35')](_0x347d1f[_0x9850('0x34')]);_0x2a5dab[_0x9850('0x36')]=_[_0x9850('0x37')](_0x2a5dab[_0x9850('0x33')],_0x2a5dab['query']);_0x22f139[_0x9850('0x38')]=_['intersection'](_0x2a5dab[_0x9850('0x33')],qs['fields'](_0x347d1f['query'][_0x9850('0x39')]));_0x22f139[_0x9850('0x38')]=_0x22f139[_0x9850('0x38')][_0x9850('0x3a')]?_0x22f139[_0x9850('0x38')]:_0x2a5dab['model'];if(!_0x347d1f[_0x9850('0x34')][_0x9850('0x3b')](_0x9850('0x3c'))){_0x22f139['limit']=qs[_0x9850('0x23')](_0x347d1f[_0x9850('0x34')][_0x9850('0x23')]);_0x22f139[_0x9850('0x3d')]=qs[_0x9850('0x3d')](_0x347d1f[_0x9850('0x34')]['offset']);}_0x22f139[_0x9850('0x3e')]=qs[_0x9850('0x3f')](_0x347d1f[_0x9850('0x34')][_0x9850('0x3f')]);_0x22f139[_0x9850('0x40')]=qs[_0x9850('0x36')](_['pick'](_0x347d1f[_0x9850('0x34')],_0x2a5dab[_0x9850('0x36')]));if(_0x347d1f['query'][_0x9850('0x41')]){_0x22f139['where']=_[_0x9850('0x42')](_0x22f139[_0x9850('0x40')],{'$or':_[_0x9850('0x31')](_0x4476c6,function(_0x42bee9){if(_0x42bee9[_0x9850('0x43')]!=='VIRTUAL'){var _0x2a122f={};_0x2a122f[_0x42bee9[_0x9850('0x2f')]]={'$like':'%'+_0x347d1f[_0x9850('0x34')][_0x9850('0x41')]+'%'};return _0x2a122f;}})});}_0x22f139=_['merge']({},_0x22f139,_0x347d1f[_0x9850('0x44')]);var _0x33e357={'where':_0x22f139[_0x9850('0x40')]};return db[_0x9850('0x45')][_0x9850('0x22')](_0x33e357)['then'](function(_0x4a4416){_0x45a0dc[_0x9850('0x22')]=_0x4a4416;if(_0x347d1f['query'][_0x9850('0x46')]){_0x22f139[_0x9850('0x47')]=[{'all':!![]}];}return db[_0x9850('0x45')][_0x9850('0x48')](_0x22f139);})[_0x9850('0x2a')](function(_0x948916){_0x45a0dc['rows']=_0x948916;return _0x45a0dc;})[_0x9850('0x2a')](respondWithFilteredResult(_0x186ab3,_0x22f139))[_0x9850('0x49')](handleError(_0x186ab3,null));};exports['show']=function(_0x5df6f7,_0x32bb6e){var _0x3ecbd4={'raw':!![],'where':{'id':_0x5df6f7['params']['id']}},_0x5ca784={};_0x5ca784['model']=_[_0x9850('0x35')](db['OpenchannelQueue'][_0x9850('0x4a')]);_0x5ca784['query']=_[_0x9850('0x35')](_0x5df6f7[_0x9850('0x34')]);_0x5ca784[_0x9850('0x36')]=_['intersection'](_0x5ca784[_0x9850('0x33')],_0x5ca784[_0x9850('0x34')]);_0x3ecbd4[_0x9850('0x38')]=_[_0x9850('0x37')](_0x5ca784[_0x9850('0x33')],qs[_0x9850('0x39')](_0x5df6f7[_0x9850('0x34')]['fields']));_0x3ecbd4[_0x9850('0x38')]=_0x3ecbd4[_0x9850('0x38')][_0x9850('0x3a')]?_0x3ecbd4[_0x9850('0x38')]:_0x5ca784['model'];if(_0x5df6f7[_0x9850('0x34')][_0x9850('0x46')]){_0x3ecbd4[_0x9850('0x47')]=[{'all':!![]}];}_0x3ecbd4=_[_0x9850('0x42')]({},_0x3ecbd4,_0x5df6f7['options']);return db[_0x9850('0x45')][_0x9850('0x4b')](_0x3ecbd4)[_0x9850('0x2a')](handleEntityNotFound(_0x32bb6e,null))['then'](respondWithResult(_0x32bb6e,null))[_0x9850('0x49')](handleError(_0x32bb6e,null));};exports[_0x9850('0x4c')]=function(_0xd359f5,_0x355465){return db[_0x9850('0x45')][_0x9850('0x4c')](_0xd359f5['body'],{})[_0x9850('0x2a')](function(_0x4963bb){var _0xfc56a6=_0xd359f5['user'][_0x9850('0x2b')]({'plain':!![]});if(!_0xfc56a6)throw new Error(_0x9850('0x4d'));if(_0xfc56a6[_0x9850('0x4e')]===_0x9850('0x4f')){var _0xcbddcb=_0x4963bb[_0x9850('0x2b')]({'plain':!![]});var _0x3d0144=_0x9850('0x2c');return db[_0x9850('0x50')][_0x9850('0x4b')]({'where':{'name':_0x3d0144,'userProfileId':_0xfc56a6[_0x9850('0x51')]},'raw':!![]})[_0x9850('0x2a')](function(_0xa5e296){if(_0xa5e296&&_0xa5e296[_0x9850('0x52')]===0x0){return db[_0x9850('0x53')][_0x9850('0x4c')]({'name':_0xcbddcb[_0x9850('0x2f')],'resourceId':_0xcbddcb['id'],'type':_0xa5e296[_0x9850('0x2f')],'sectionId':_0xa5e296['id']},{})[_0x9850('0x2a')](function(){return _0x4963bb;});}else{return _0x4963bb;}})[_0x9850('0x49')](function(_0x32bc81){logger[_0x9850('0x2d')](_0x9850('0x54'),_0x32bc81);throw _0x32bc81;});}return _0x4963bb;})['then'](respondWithResult(_0x355465,0xc9))[_0x9850('0x49')](handleError(_0x355465,null));};exports[_0x9850('0x55')]=function(_0x2497ac,_0x31c5a8){if(_0x2497ac[_0x9850('0x56')]['id']){delete _0x2497ac[_0x9850('0x56')]['id'];}return db[_0x9850('0x45')][_0x9850('0x4b')]({'where':{'id':_0x2497ac[_0x9850('0x57')]['id']}})[_0x9850('0x2a')](handleEntityNotFound(_0x31c5a8,null))[_0x9850('0x2a')](saveUpdates(_0x2497ac[_0x9850('0x56')],null))[_0x9850('0x2a')](respondWithResult(_0x31c5a8,null))[_0x9850('0x49')](handleError(_0x31c5a8,null));};exports[_0x9850('0x29')]=function(_0x384ba5,_0x13cbb2){return db[_0x9850('0x45')][_0x9850('0x4b')]({'where':{'id':_0x384ba5[_0x9850('0x57')]['id']}})[_0x9850('0x2a')](handleEntityNotFound(_0x13cbb2,null))[_0x9850('0x2a')](removeEntity(_0x13cbb2,null))[_0x9850('0x49')](handleError(_0x13cbb2,null));};exports['describe']=function(_0x181184,_0x9723e5){return db[_0x9850('0x45')][_0x9850('0x58')]()[_0x9850('0x2a')](respondWithResult(_0x9723e5,null))[_0x9850('0x49')](handleError(_0x9723e5,null));};exports[_0x9850('0x59')]=function(_0x22ffbf,_0x32bb88,_0x1100dd){var _0x4eda40={'raw':!![],'where':{}},_0x15902a={},_0x33ffe8;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x22ffbf['params']['id']}})[_0x9850('0x2a')](handleEntityNotFound(_0x32bb88,null))[_0x9850('0x2a')](function(_0x2cf258){if(_0x2cf258){_0x33ffe8=_0x2cf258['get']({'plain':!![]});_0x15902a[_0x9850('0x33')]=_[_0x9850('0x35')](db[_0x9850('0x5a')]['rawAttributes']);_0x15902a[_0x9850('0x34')]=_[_0x9850('0x35')](_0x22ffbf[_0x9850('0x34')]);_0x15902a[_0x9850('0x36')]=_['intersection'](_0x15902a[_0x9850('0x33')],_0x15902a[_0x9850('0x34')]);_0x4eda40[_0x9850('0x38')]=_[_0x9850('0x37')](_0x15902a[_0x9850('0x33')],qs['fields'](_0x22ffbf[_0x9850('0x34')][_0x9850('0x39')]));_0x4eda40[_0x9850('0x38')]=_0x4eda40[_0x9850('0x38')][_0x9850('0x3a')]?_0x4eda40[_0x9850('0x38')]:_0x15902a[_0x9850('0x33')];if(!_0x22ffbf['query'][_0x9850('0x3b')](_0x9850('0x3c'))){_0x4eda40[_0x9850('0x23')]=qs[_0x9850('0x23')](_0x22ffbf[_0x9850('0x34')][_0x9850('0x23')]);_0x4eda40['offset']=qs[_0x9850('0x3d')](_0x22ffbf[_0x9850('0x34')]['offset']);}_0x4eda40[_0x9850('0x3e')]=qs[_0x9850('0x3f')](_0x22ffbf[_0x9850('0x34')][_0x9850('0x3f')]);_0x4eda40['where']=qs[_0x9850('0x36')](_[_0x9850('0x5b')](_0x22ffbf[_0x9850('0x34')],_0x15902a['filters']));_0x4eda40[_0x9850('0x40')]['OpenchannelQueueId']=_0x2cf258['id'];if(_0x22ffbf[_0x9850('0x34')][_0x9850('0x41')]){_0x4eda40[_0x9850('0x40')]=_[_0x9850('0x42')](_0x4eda40[_0x9850('0x40')],{'$or':_['map'](_0x4eda40[_0x9850('0x38')],function(_0x54b0ce){var _0x6dadb6={};_0x6dadb6[_0x54b0ce]={'$like':'%'+_0x22ffbf[_0x9850('0x34')]['filter']+'%'};return _0x6dadb6;})});}_0x4eda40=_['merge']({},_0x4eda40,_0x22ffbf['options']);return db['UserOpenchannelQueue'][_0x9850('0x48')](_0x4eda40);}})[_0x9850('0x2a')](function(_0x105b07){if(_0x105b07){return db['User'][_0x9850('0x5c')]({'where':{'id':_[_0x9850('0x31')](_0x105b07,'UserId'),'role':_0x9850('0x5d')},'attributes':['id','name','openchannelPause',_0x9850('0x5e'),_0x9850('0x5f')]});}})[_0x9850('0x2a')](function(_0x4b9a57){if(_0x4b9a57){return{'count':_0x4b9a57['count'],'rows':_['map'](_0x4b9a57['rows'],function(_0x9facef){return{'membername':_0x9facef[_0x9850('0x2f')],'UserId':_0x9facef['id'],'queue_name':_0x33ffe8[_0x9850('0x2f')],'OpenchannelQueueId':_0x33ffe8['id'],'interface':util[_0x9850('0x60')](_0x9850('0x61'),'SIP',_0x9facef[_0x9850('0x2f')]),'penalty':0x0,'paused':_0x9facef['openchannelPause'],'createdAt':_0x9facef[_0x9850('0x5f')],'updatedAt':_0x9facef[_0x9850('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9850('0x2a')](respondWithFilteredResult(_0x32bb88,_0x4eda40))[_0x9850('0x49')](handleError(_0x32bb88,null));};exports[_0x9850('0x62')]=function(_0x4e6d89,_0x1e5873,_0x2532fb){var _0x571058={};var _0x333f04={};var _0x144ef1;var _0x563a3e;return db[_0x9850('0x45')]['findOne']({'where':{'id':_0x4e6d89[_0x9850('0x57')]['id']}})[_0x9850('0x2a')](handleEntityNotFound(_0x1e5873,null))[_0x9850('0x2a')](function(_0x79ed50){if(_0x79ed50){_0x144ef1=_0x79ed50;_0x333f04[_0x9850('0x33')]=_[_0x9850('0x35')](db[_0x9850('0x63')][_0x9850('0x4a')]);_0x333f04[_0x9850('0x34')]=_[_0x9850('0x35')](_0x4e6d89[_0x9850('0x34')]);_0x333f04[_0x9850('0x36')]=_['intersection'](_0x333f04[_0x9850('0x33')],_0x333f04[_0x9850('0x34')]);_0x571058['attributes']=_[_0x9850('0x37')](_0x333f04[_0x9850('0x33')],qs[_0x9850('0x39')](_0x4e6d89['query']['fields']));_0x571058[_0x9850('0x38')]=_0x571058[_0x9850('0x38')][_0x9850('0x3a')]?_0x571058[_0x9850('0x38')]:_0x333f04[_0x9850('0x33')];_0x571058[_0x9850('0x3e')]=qs[_0x9850('0x3f')](_0x4e6d89['query'][_0x9850('0x3f')]);_0x571058[_0x9850('0x40')]=qs['filters'](_['pick'](_0x4e6d89['query'],_0x333f04[_0x9850('0x36')]));if(_0x4e6d89[_0x9850('0x34')][_0x9850('0x41')]){_0x571058[_0x9850('0x40')]=_[_0x9850('0x42')](_0x571058[_0x9850('0x40')],{'$or':_[_0x9850('0x31')](_0x571058[_0x9850('0x38')],function(_0x6a0c1e){var _0x3f222a={};_0x3f222a[_0x6a0c1e]={'$like':'%'+_0x4e6d89['query']['filter']+'%'};return _0x3f222a;})});}_0x571058=_[_0x9850('0x42')]({},_0x571058,_0x4e6d89[_0x9850('0x44')]);return _0x144ef1['getTeams'](_0x571058);}})[_0x9850('0x2a')](function(_0x4ad7b5){if(_0x4ad7b5){_0x563a3e=_0x4ad7b5[_0x9850('0x3a')];if(!_0x4e6d89[_0x9850('0x34')][_0x9850('0x3b')](_0x9850('0x3c'))){_0x571058[_0x9850('0x23')]=qs[_0x9850('0x23')](_0x4e6d89[_0x9850('0x34')][_0x9850('0x23')]);_0x571058[_0x9850('0x3d')]=qs[_0x9850('0x3d')](_0x4e6d89[_0x9850('0x34')][_0x9850('0x3d')]);}return _0x144ef1[_0x9850('0x62')](_0x571058);}})[_0x9850('0x2a')](function(_0x541435){if(_0x541435){return _0x541435?{'count':_0x563a3e,'rows':_0x541435}:null;}})[_0x9850('0x2a')](respondWithResult(_0x1e5873,null))[_0x9850('0x49')](handleError(_0x1e5873,null));};exports['addTeams']=function(_0x4a4001,_0x509e9d,_0x5dab78){var _0x40a9a0=_0x4a4001[_0x9850('0x56')][_0x9850('0x64')];return db['Team'][_0x9850('0x48')]({'where':{'id':_0x40a9a0},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name',_0x9850('0x65'),'voicePause','interface'],'raw':!![]}]})[_0x9850('0x2a')](function(_0x242ef8){if(_0x242ef8){var _0x1d1a23=_[_0x9850('0x66')](_0x242ef8,function(_0x1fc2e9){var _0x2db6ba=_0x1fc2e9[_0x9850('0x2b')]({'plain':!![]});return _0x2db6ba[_0x9850('0x67')];});return db[_0x9850('0x45')][_0x9850('0x4b')]({'where':{'id':_0x4a4001[_0x9850('0x57')]['id']}})[_0x9850('0x2a')](function(_0x431a78){return db[_0x9850('0x68')]['transaction'](function(_0xb51f66){return _0x431a78[_0x9850('0x69')](_0x40a9a0,{'transaction':_0xb51f66})['then'](function(){return BPromise[_0x9850('0x6a')](_0x1d1a23,function(_0x5e5b95){return db[_0x9850('0x5a')][_0x9850('0x6b')]({'where':{'UserId':_0x5e5b95['id'],'OpenchannelQueueId':_0x4a4001[_0x9850('0x57')]['id']},'transaction':_0xb51f66});});})[_0x9850('0x2a')](function(){_0x1d1a23['forEach'](function(_0x4fd213){socket[_0x9850('0x6c')](_0x9850('0x6d'),{'UserId':_0x4fd213['id'],'OpenchannelQueueId':_0x431a78['id']});});});});});}})['then'](respondWithStatusCode(_0x509e9d,null))[_0x9850('0x49')](handleError(_0x509e9d,null));};exports[_0x9850('0x6e')]=function(_0x325428,_0x54aba6,_0x445928){return db[_0x9850('0x63')][_0x9850('0x48')]({'where':{'id':_0x325428[_0x9850('0x34')][_0x9850('0x64')]},'attributes':['id'],'include':[{'model':db[_0x9850('0x6f')],'as':_0x9850('0x67'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x54aba6,null))[_0x9850('0x2a')](function(_0x5eee44){var _0xd99769=_[_0x9850('0x31')](_0x5eee44,'id');var _0x410a81=[];var _0x3c97d4=[];var _0x5565ab=squel[_0x9850('0x70')]();_0x5565ab[_0x9850('0x71')](_0x9850('0x72'))[_0x9850('0x73')](_0x9850('0x74'),'tq')[_0x9850('0x75')](_0x9850('0x76'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x9850('0x40')](_0x9850('0x77'),_0x325428['params']['id']);for(var _0x31d968=0x0;_0x31d968<_0x5eee44[_0x9850('0x3a')];_0x31d968+=0x1){let _0x7295b1=_0x5eee44[_0x31d968];for(var _0x4c7932=0x0;_0x4c7932<_0x7295b1[_0x9850('0x67')][_0x9850('0x3a')];_0x4c7932+=0x1){let _0x31d6ef=_0x7295b1[_0x9850('0x67')][_0x4c7932];var _0x272a4b=_0x5565ab[_0x9850('0x78')]();_0x272a4b[_0x9850('0x40')](_0x9850('0x79'),_0x31d6ef['id']);_0x3c97d4[_0x9850('0x7a')](db[_0x9850('0x68')]['query'](_0x272a4b[_0x9850('0x7b')](),{'type':db[_0x9850('0x68')]['QueryTypes'][_0x9850('0x7c')]})['then'](function(_0x2427ad){if(_0x2427ad['length']===0x1){return _0x31d6ef['id'];}else{var _0x1fb524=_[_0x9850('0x7d')](_[_0x9850('0x31')](_0x2427ad,_0x9850('0x7e')),function(_0x47aba7){return _['includes'](_0xd99769,_0x47aba7);});if(_0x1fb524){return _0x31d6ef['id'];}}}));}}return BPromise[_0x9850('0x7f')](_0x3c97d4)[_0x9850('0x2a')](function(_0x36ee50){_0x410a81=_(_0x410a81)[_0x9850('0x80')](_0x36ee50)[_0x9850('0x81')]()[_0x9850('0x82')]();return db[_0x9850('0x45')][_0x9850('0x4b')]({'where':{'id':_0x325428[_0x9850('0x57')]['id']}})[_0x9850('0x2a')](function(_0x182ab0){return db[_0x9850('0x68')]['transaction'](function(_0x743300){return _0x182ab0[_0x9850('0x6e')](_0x325428['query']['ids'],{'transaction':_0x743300})['then'](function(){if(!_[_0x9850('0x83')](_0x410a81)){return _0x182ab0[_0x9850('0x84')](_0x410a81,{'transaction':_0x743300});}})[_0x9850('0x2a')](function(){_0x410a81['forEach'](function(_0x9333c2){socket[_0x9850('0x6c')](_0x9850('0x85'),{'UserId':_0x9333c2,'OpenchannelQueueId':_0x182ab0['id']});});});});});});})[_0x9850('0x2a')](respondWithStatusCode(_0x54aba6,null))[_0x9850('0x49')](handleError(_0x54aba6,null));};exports[_0x9850('0x86')]=function(_0x3e5786,_0x3f8465,_0x4f3cfb){return db[_0x9850('0x45')][_0x9850('0x4b')]({'where':{'id':_0x3e5786['params']['id']}})[_0x9850('0x2a')](handleEntityNotFound(_0x3f8465,null))[_0x9850('0x2a')](function(_0x4e0376){if(_0x4e0376){return _0x4e0376[_0x9850('0x86')](_0x3e5786[_0x9850('0x56')][_0x9850('0x64')],_[_0x9850('0x87')](_0x3e5786[_0x9850('0x56')],[_0x9850('0x64'),'id'])||{})['spread'](function(_0x4b83a2){for(var _0x40ac11=0x0;_0x40ac11<_0x3e5786[_0x9850('0x56')]['ids']['length'];_0x40ac11+=0x1){socket[_0x9850('0x6c')](_0x9850('0x6d'),{'UserId':_0x3e5786[_0x9850('0x56')][_0x9850('0x64')][_0x40ac11],'OpenchannelQueueId':_0x3e5786[_0x9850('0x57')]['id']});}return _0x4b83a2;});}})['then'](respondWithResult(_0x3f8465,null))[_0x9850('0x49')](handleError(_0x3f8465,null));};exports[_0x9850('0x84')]=function(_0x591573,_0x1bc325,_0x4c9cc4){return db[_0x9850('0x45')]['find']({'where':{'id':_0x591573[_0x9850('0x57')]['id']}})[_0x9850('0x2a')](handleEntityNotFound(_0x1bc325,null))[_0x9850('0x2a')](function(_0x4e4542){if(_0x4e4542){return _0x4e4542[_0x9850('0x84')](_0x591573[_0x9850('0x34')][_0x9850('0x64')])[_0x9850('0x2a')](function(){if(_[_0x9850('0x88')](_0x591573[_0x9850('0x34')]['ids'])){for(var _0x185902=0x0;_0x185902<_0x591573[_0x9850('0x34')]['ids']['length'];_0x185902+=0x1){socket['emit'](_0x9850('0x85'),{'UserId':Number(_0x591573[_0x9850('0x34')][_0x9850('0x64')][_0x185902]),'OpenchannelQueueId':Number(_0x591573[_0x9850('0x57')]['id'])});}}else{socket['emit'](_0x9850('0x85'),{'UserId':Number(_0x591573[_0x9850('0x34')]['ids']),'OpenchannelQueueId':Number(_0x591573[_0x9850('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x1bc325,null))[_0x9850('0x49')](handleError(_0x1bc325,null));};exports[_0x9850('0x89')]=function(_0x4c8b91,_0x1ca606,_0x3b45c4){var _0x3720b6={};var _0x4fafcf={};var _0x4ef4a7;var _0x271b39;return db[_0x9850('0x45')][_0x9850('0x8a')]({'where':{'id':_0x4c8b91['params']['id']}})[_0x9850('0x2a')](handleEntityNotFound(_0x1ca606,null))[_0x9850('0x2a')](function(_0x565437){if(_0x565437){_0x4ef4a7=_0x565437;_0x4fafcf[_0x9850('0x33')]=_[_0x9850('0x35')](db['User']['rawAttributes']);_0x4fafcf[_0x9850('0x34')]=_['keys'](_0x4c8b91[_0x9850('0x34')]);_0x4fafcf[_0x9850('0x36')]=_[_0x9850('0x37')](_0x4fafcf[_0x9850('0x33')],_0x4fafcf[_0x9850('0x34')]);_0x3720b6[_0x9850('0x38')]=_[_0x9850('0x37')](_0x4fafcf[_0x9850('0x33')],qs['fields'](_0x4c8b91[_0x9850('0x34')][_0x9850('0x39')]));_0x3720b6['attributes']=_0x3720b6[_0x9850('0x38')]['length']?_0x3720b6['attributes']:_0x4fafcf[_0x9850('0x33')];_0x3720b6[_0x9850('0x3e')]=qs[_0x9850('0x3f')](_0x4c8b91['query']['sort']);_0x3720b6[_0x9850('0x40')]=qs[_0x9850('0x36')](_[_0x9850('0x5b')](_0x4c8b91[_0x9850('0x34')],_0x4fafcf[_0x9850('0x36')]));if(_0x4c8b91[_0x9850('0x34')][_0x9850('0x41')]){_0x3720b6[_0x9850('0x40')]=_[_0x9850('0x42')](_0x3720b6[_0x9850('0x40')],{'$or':_['map'](_0x3720b6[_0x9850('0x38')],function(_0x46232d){var _0x7749eb={};_0x7749eb[_0x46232d]={'$like':'%'+_0x4c8b91['query']['filter']+'%'};return _0x7749eb;})});}_0x3720b6=_[_0x9850('0x42')]({},_0x3720b6,_0x4c8b91[_0x9850('0x44')]);return _0x4ef4a7[_0x9850('0x89')](_0x3720b6);}})[_0x9850('0x2a')](function(_0x1a88e1){if(_0x1a88e1){_0x271b39=_0x1a88e1['length'];if(!_0x4c8b91['query'][_0x9850('0x3b')]('nolimit')){_0x3720b6[_0x9850('0x23')]=qs[_0x9850('0x23')](_0x4c8b91[_0x9850('0x34')][_0x9850('0x23')]);_0x3720b6[_0x9850('0x3d')]=qs[_0x9850('0x3d')](_0x4c8b91[_0x9850('0x34')][_0x9850('0x3d')]);}return _0x4ef4a7['getAgents'](_0x3720b6);}})[_0x9850('0x2a')](function(_0x60b84f){if(_0x60b84f){return _0x60b84f?{'count':_0x271b39,'rows':_0x60b84f}:null;}})[_0x9850('0x2a')](respondWithResult(_0x1ca606,null))[_0x9850('0x49')](handleError(_0x1ca606,null));}; \ No newline at end of file +var _0xddf6=['show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserOpenchannelQueue','User','UserId','updatedAt','createdAt','format','SIP','getTeams','Team','pick','Agents','online','voicePause','interface','sequelize','addTeams','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','team_has_openchannel_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','toString','SELECT','every','TeamId','includes','compact','value','ids','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','spread','isArray','getAgents','findOne','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','defaults','redis','register','sendStatus','end','status','json','offset','set','Content-Range','save','update','then','destroy','OpenchannelQueues','UserProfileResource','error','stack','name','OpenchannelQueue','rawAttributes','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','count','include','findAll','rows','catch'];(function(_0x35cb30,_0x12ac50){var _0x2742b9=function(_0x54e888){while(--_0x54e888){_0x35cb30['push'](_0x35cb30['shift']());}};_0x2742b9(++_0x12ac50);}(_0xddf6,0xc2));var _0x6ddf=function(_0x509bf4,_0x2e1028){_0x509bf4=_0x509bf4-0x0;var _0x55b96e=_0xddf6[_0x509bf4];return _0x55b96e;};'use strict';var pdf=require(_0x6ddf('0x0'));var emlformat=require(_0x6ddf('0x1'));var rimraf=require(_0x6ddf('0x2'));var zipdir=require(_0x6ddf('0x3'));var jsonpatch=require(_0x6ddf('0x4'));var rp=require(_0x6ddf('0x5'));var moment=require(_0x6ddf('0x6'));var BPromise=require(_0x6ddf('0x7'));var Mustache=require(_0x6ddf('0x8'));var util=require(_0x6ddf('0x9'));var path=require('path');var sox=require('sox');var csv=require(_0x6ddf('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x6ddf('0xb'));var crypto=require(_0x6ddf('0xc'));var jsforce=require(_0x6ddf('0xd'));var deskjs=require(_0x6ddf('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6ddf('0xf'));var Papa=require(_0x6ddf('0x10'));var Redis=require(_0x6ddf('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x6ddf('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6ddf('0x13'));var logger=require(_0x6ddf('0x14'))(_0x6ddf('0x15'));var utils=require(_0x6ddf('0x16'));var config=require(_0x6ddf('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x6ddf('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6ddf('0x19')]));require('./openchannelQueue.socket')[_0x6ddf('0x1a')](socket);function respondWithStatusCode(_0x31efc7,_0x5dc126){_0x5dc126=_0x5dc126||0xcc;return function(_0x29ce1b){if(_0x29ce1b){return _0x31efc7[_0x6ddf('0x1b')](_0x5dc126);}return _0x31efc7['status'](_0x5dc126)[_0x6ddf('0x1c')]();};}function respondWithResult(_0x3f85bd,_0x47fd63){_0x47fd63=_0x47fd63||0xc8;return function(_0x547fe0){if(_0x547fe0){return _0x3f85bd[_0x6ddf('0x1d')](_0x47fd63)[_0x6ddf('0x1e')](_0x547fe0);}};}function respondWithFilteredResult(_0x1e74c8,_0x4118f1){return function(_0x3b6034){if(_0x3b6034){var _0x414691=_0x3b6034['count'],_0x3b8931=_0x4118f1[_0x6ddf('0x1f')],_0x106aae=_0x4118f1['offset']+_0x4118f1['limit'],_0x1cdd45;if(_0x106aae>=_0x414691){_0x106aae=_0x414691;_0x1cdd45=0xc8;}else{_0x1cdd45=0xce;}_0x1e74c8['status'](_0x1cdd45);return _0x1e74c8[_0x6ddf('0x20')](_0x6ddf('0x21'),_0x3b8931+'-'+_0x106aae+'/'+_0x414691)[_0x6ddf('0x1e')](_0x3b6034);}return null;};}function patchUpdates(_0xf06327){return function(_0x5830b3){try{jsonpatch['apply'](_0x5830b3,_0xf06327,!![]);}catch(_0x3ecbce){return BPromise['reject'](_0x3ecbce);}return _0x5830b3[_0x6ddf('0x22')]();};}function saveUpdates(_0x547808,_0x292119){return function(_0x19bc09){if(_0x19bc09){return _0x19bc09[_0x6ddf('0x23')](_0x547808)[_0x6ddf('0x24')](function(_0x1f415a){return _0x1f415a;});}return null;};}function removeEntity(_0x35a9c5,_0x37c738){return function(_0x50d421){if(_0x50d421){return _0x50d421[_0x6ddf('0x25')]()['then'](function(){var _0x3a7a6a=_0x50d421['get']({'plain':!![]});var _0x43bf6a=_0x6ddf('0x26');return db[_0x6ddf('0x27')][_0x6ddf('0x25')]({'where':{'type':_0x43bf6a,'resourceId':_0x3a7a6a['id']}})['then'](function(){return _0x50d421;});})[_0x6ddf('0x24')](function(){_0x35a9c5[_0x6ddf('0x1d')](0xcc)[_0x6ddf('0x1c')]();});}};}function handleEntityNotFound(_0x3ea1a4,_0x3740f6){return function(_0x2963cf){if(!_0x2963cf){_0x3ea1a4[_0x6ddf('0x1b')](0x194);}return _0x2963cf;};}function handleError(_0xff4c8e,_0xf54b68){_0xf54b68=_0xf54b68||0x1f4;return function(_0x44374f){logger[_0x6ddf('0x28')](_0x44374f[_0x6ddf('0x29')]);if(_0x44374f['name']){delete _0x44374f[_0x6ddf('0x2a')];}_0xff4c8e[_0x6ddf('0x1d')](_0xf54b68)['send'](_0x44374f);};}exports['index']=function(_0x3a2744,_0x2508e7){var _0x145bdc={},_0x5f50e7={},_0x3ff925={'count':0x0,'rows':[]};var _0x542941=_['map'](db[_0x6ddf('0x2b')][_0x6ddf('0x2c')],function(_0x13de89){return{'name':_0x13de89['fieldName'],'type':_0x13de89[_0x6ddf('0x2d')]['key']};});_0x5f50e7[_0x6ddf('0x2e')]=_[_0x6ddf('0x2f')](_0x542941,_0x6ddf('0x2a'));_0x5f50e7[_0x6ddf('0x30')]=_[_0x6ddf('0x31')](_0x3a2744['query']);_0x5f50e7[_0x6ddf('0x32')]=_[_0x6ddf('0x33')](_0x5f50e7['model'],_0x5f50e7['query']);_0x145bdc[_0x6ddf('0x34')]=_[_0x6ddf('0x33')](_0x5f50e7['model'],qs[_0x6ddf('0x35')](_0x3a2744[_0x6ddf('0x30')][_0x6ddf('0x35')]));_0x145bdc[_0x6ddf('0x34')]=_0x145bdc[_0x6ddf('0x34')][_0x6ddf('0x36')]?_0x145bdc[_0x6ddf('0x34')]:_0x5f50e7[_0x6ddf('0x2e')];if(!_0x3a2744['query'][_0x6ddf('0x37')](_0x6ddf('0x38'))){_0x145bdc[_0x6ddf('0x39')]=qs[_0x6ddf('0x39')](_0x3a2744['query'][_0x6ddf('0x39')]);_0x145bdc['offset']=qs[_0x6ddf('0x1f')](_0x3a2744[_0x6ddf('0x30')][_0x6ddf('0x1f')]);}_0x145bdc[_0x6ddf('0x3a')]=qs[_0x6ddf('0x3b')](_0x3a2744[_0x6ddf('0x30')][_0x6ddf('0x3b')]);_0x145bdc[_0x6ddf('0x3c')]=qs[_0x6ddf('0x32')](_['pick'](_0x3a2744[_0x6ddf('0x30')],_0x5f50e7[_0x6ddf('0x32')]));if(_0x3a2744[_0x6ddf('0x30')][_0x6ddf('0x3d')]){_0x145bdc[_0x6ddf('0x3c')]=_[_0x6ddf('0x3e')](_0x145bdc[_0x6ddf('0x3c')],{'$or':_[_0x6ddf('0x2f')](_0x542941,function(_0x2b3654){if(_0x2b3654[_0x6ddf('0x2d')]!==_0x6ddf('0x3f')){var _0x1661d2={};_0x1661d2[_0x2b3654['name']]={'$like':'%'+_0x3a2744[_0x6ddf('0x30')][_0x6ddf('0x3d')]+'%'};return _0x1661d2;}})});}_0x145bdc=_[_0x6ddf('0x3e')]({},_0x145bdc,_0x3a2744[_0x6ddf('0x40')]);var _0x23785a={'where':_0x145bdc[_0x6ddf('0x3c')]};return db[_0x6ddf('0x2b')]['count'](_0x23785a)[_0x6ddf('0x24')](function(_0xea0aae){_0x3ff925[_0x6ddf('0x41')]=_0xea0aae;if(_0x3a2744['query']['includeAll']){_0x145bdc[_0x6ddf('0x42')]=[{'all':!![]}];}return db[_0x6ddf('0x2b')][_0x6ddf('0x43')](_0x145bdc);})[_0x6ddf('0x24')](function(_0x506a73){_0x3ff925[_0x6ddf('0x44')]=_0x506a73;return _0x3ff925;})[_0x6ddf('0x24')](respondWithFilteredResult(_0x2508e7,_0x145bdc))[_0x6ddf('0x45')](handleError(_0x2508e7,null));};exports[_0x6ddf('0x46')]=function(_0x1de147,_0x337c33){var _0x4eb0c3={'raw':!![],'where':{'id':_0x1de147[_0x6ddf('0x47')]['id']}},_0x4b15ae={};_0x4b15ae[_0x6ddf('0x2e')]=_[_0x6ddf('0x31')](db[_0x6ddf('0x2b')]['rawAttributes']);_0x4b15ae[_0x6ddf('0x30')]=_[_0x6ddf('0x31')](_0x1de147[_0x6ddf('0x30')]);_0x4b15ae[_0x6ddf('0x32')]=_[_0x6ddf('0x33')](_0x4b15ae[_0x6ddf('0x2e')],_0x4b15ae[_0x6ddf('0x30')]);_0x4eb0c3[_0x6ddf('0x34')]=_[_0x6ddf('0x33')](_0x4b15ae[_0x6ddf('0x2e')],qs[_0x6ddf('0x35')](_0x1de147[_0x6ddf('0x30')][_0x6ddf('0x35')]));_0x4eb0c3[_0x6ddf('0x34')]=_0x4eb0c3[_0x6ddf('0x34')][_0x6ddf('0x36')]?_0x4eb0c3['attributes']:_0x4b15ae[_0x6ddf('0x2e')];if(_0x1de147[_0x6ddf('0x30')][_0x6ddf('0x48')]){_0x4eb0c3['include']=[{'all':!![]}];}_0x4eb0c3=_[_0x6ddf('0x3e')]({},_0x4eb0c3,_0x1de147[_0x6ddf('0x40')]);return db[_0x6ddf('0x2b')][_0x6ddf('0x49')](_0x4eb0c3)[_0x6ddf('0x24')](handleEntityNotFound(_0x337c33,null))['then'](respondWithResult(_0x337c33,null))[_0x6ddf('0x45')](handleError(_0x337c33,null));};exports[_0x6ddf('0x4a')]=function(_0x55a303,_0x1f25e2){return db['OpenchannelQueue'][_0x6ddf('0x4a')](_0x55a303[_0x6ddf('0x4b')],{})[_0x6ddf('0x24')](function(_0x3c9416){var _0x66bf2d=_0x55a303[_0x6ddf('0x4c')]['get']({'plain':!![]});if(!_0x66bf2d)throw new Error(_0x6ddf('0x4d'));if(_0x66bf2d[_0x6ddf('0x4e')]===_0x6ddf('0x4c')){var _0x59b7b7=_0x3c9416[_0x6ddf('0x4f')]({'plain':!![]});var _0x1dd516=_0x6ddf('0x26');return db[_0x6ddf('0x50')][_0x6ddf('0x49')]({'where':{'name':_0x1dd516,'userProfileId':_0x66bf2d[_0x6ddf('0x51')]},'raw':!![]})['then'](function(_0x4cffce){if(_0x4cffce&&_0x4cffce[_0x6ddf('0x52')]===0x0){return db[_0x6ddf('0x27')]['create']({'name':_0x59b7b7[_0x6ddf('0x2a')],'resourceId':_0x59b7b7['id'],'type':_0x4cffce[_0x6ddf('0x2a')],'sectionId':_0x4cffce['id']},{})[_0x6ddf('0x24')](function(){return _0x3c9416;});}else{return _0x3c9416;}})[_0x6ddf('0x45')](function(_0x13a786){logger['error'](_0x6ddf('0x53'),_0x13a786);throw _0x13a786;});}return _0x3c9416;})[_0x6ddf('0x24')](respondWithResult(_0x1f25e2,0xc9))['catch'](handleError(_0x1f25e2,null));};exports[_0x6ddf('0x23')]=function(_0x3798c1,_0x58cea1){if(_0x3798c1[_0x6ddf('0x4b')]['id']){delete _0x3798c1[_0x6ddf('0x4b')]['id'];}return db[_0x6ddf('0x2b')]['find']({'where':{'id':_0x3798c1[_0x6ddf('0x47')]['id']}})[_0x6ddf('0x24')](handleEntityNotFound(_0x58cea1,null))[_0x6ddf('0x24')](saveUpdates(_0x3798c1[_0x6ddf('0x4b')],null))[_0x6ddf('0x24')](respondWithResult(_0x58cea1,null))[_0x6ddf('0x45')](handleError(_0x58cea1,null));};exports[_0x6ddf('0x25')]=function(_0x161dec,_0x190b27){return db[_0x6ddf('0x2b')][_0x6ddf('0x49')]({'where':{'id':_0x161dec['params']['id']}})['then'](handleEntityNotFound(_0x190b27,null))[_0x6ddf('0x24')](removeEntity(_0x190b27,null))['catch'](handleError(_0x190b27,null));};exports[_0x6ddf('0x54')]=function(_0x3ab50a,_0x46d230){return db[_0x6ddf('0x2b')][_0x6ddf('0x54')]()[_0x6ddf('0x24')](respondWithResult(_0x46d230,null))['catch'](handleError(_0x46d230,null));};exports[_0x6ddf('0x55')]=function(_0x2cb584,_0x78e7bb,_0x3025e3){var _0x4186a7={'raw':!![],'where':{}},_0x42f019={},_0x25f3a8;return db[_0x6ddf('0x2b')]['findOne']({'where':{'id':_0x2cb584['params']['id']}})['then'](handleEntityNotFound(_0x78e7bb,null))[_0x6ddf('0x24')](function(_0x19ac13){if(_0x19ac13){_0x25f3a8=_0x19ac13[_0x6ddf('0x4f')]({'plain':!![]});_0x42f019['model']=_[_0x6ddf('0x31')](db[_0x6ddf('0x56')][_0x6ddf('0x2c')]);_0x42f019[_0x6ddf('0x30')]=_[_0x6ddf('0x31')](_0x2cb584['query']);_0x42f019['filters']=_[_0x6ddf('0x33')](_0x42f019['model'],_0x42f019['query']);_0x4186a7[_0x6ddf('0x34')]=_[_0x6ddf('0x33')](_0x42f019[_0x6ddf('0x2e')],qs[_0x6ddf('0x35')](_0x2cb584[_0x6ddf('0x30')][_0x6ddf('0x35')]));_0x4186a7['attributes']=_0x4186a7[_0x6ddf('0x34')]['length']?_0x4186a7[_0x6ddf('0x34')]:_0x42f019[_0x6ddf('0x2e')];if(!_0x2cb584[_0x6ddf('0x30')]['hasOwnProperty'](_0x6ddf('0x38'))){_0x4186a7[_0x6ddf('0x39')]=qs[_0x6ddf('0x39')](_0x2cb584[_0x6ddf('0x30')][_0x6ddf('0x39')]);_0x4186a7[_0x6ddf('0x1f')]=qs[_0x6ddf('0x1f')](_0x2cb584[_0x6ddf('0x30')][_0x6ddf('0x1f')]);}_0x4186a7[_0x6ddf('0x3a')]=qs[_0x6ddf('0x3b')](_0x2cb584['query'][_0x6ddf('0x3b')]);_0x4186a7[_0x6ddf('0x3c')]=qs[_0x6ddf('0x32')](_['pick'](_0x2cb584[_0x6ddf('0x30')],_0x42f019[_0x6ddf('0x32')]));_0x4186a7[_0x6ddf('0x3c')]['OpenchannelQueueId']=_0x19ac13['id'];if(_0x2cb584[_0x6ddf('0x30')]['filter']){_0x4186a7[_0x6ddf('0x3c')]=_[_0x6ddf('0x3e')](_0x4186a7['where'],{'$or':_[_0x6ddf('0x2f')](_0x4186a7[_0x6ddf('0x34')],function(_0x2a3a7e){var _0x353a90={};_0x353a90[_0x2a3a7e]={'$like':'%'+_0x2cb584['query'][_0x6ddf('0x3d')]+'%'};return _0x353a90;})});}_0x4186a7=_[_0x6ddf('0x3e')]({},_0x4186a7,_0x2cb584[_0x6ddf('0x40')]);return db[_0x6ddf('0x56')]['findAll'](_0x4186a7);}})[_0x6ddf('0x24')](function(_0x1bddca){if(_0x1bddca){return db[_0x6ddf('0x57')]['findAndCountAll']({'where':{'id':_[_0x6ddf('0x2f')](_0x1bddca,_0x6ddf('0x58')),'role':'agent'},'attributes':['id',_0x6ddf('0x2a'),'openchannelPause',_0x6ddf('0x59'),_0x6ddf('0x5a')]});}})[_0x6ddf('0x24')](function(_0x3f8103){if(_0x3f8103){return{'count':_0x3f8103[_0x6ddf('0x41')],'rows':_['map'](_0x3f8103[_0x6ddf('0x44')],function(_0x5402a6){return{'membername':_0x5402a6['name'],'UserId':_0x5402a6['id'],'queue_name':_0x25f3a8['name'],'OpenchannelQueueId':_0x25f3a8['id'],'interface':util[_0x6ddf('0x5b')]('%s/%s',_0x6ddf('0x5c'),_0x5402a6[_0x6ddf('0x2a')]),'penalty':0x0,'paused':_0x5402a6['openchannelPause'],'createdAt':_0x5402a6[_0x6ddf('0x5a')],'updatedAt':_0x5402a6['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x6ddf('0x24')](respondWithFilteredResult(_0x78e7bb,_0x4186a7))[_0x6ddf('0x45')](handleError(_0x78e7bb,null));};exports[_0x6ddf('0x5d')]=function(_0x1a45aa,_0x23be7e,_0x143eba){var _0x362138={};var _0x369f13={};var _0x6fbd34;var _0x4b2ee8;return db[_0x6ddf('0x2b')]['findOne']({'where':{'id':_0x1a45aa[_0x6ddf('0x47')]['id']}})[_0x6ddf('0x24')](handleEntityNotFound(_0x23be7e,null))[_0x6ddf('0x24')](function(_0x3aefb4){if(_0x3aefb4){_0x6fbd34=_0x3aefb4;_0x369f13[_0x6ddf('0x2e')]=_[_0x6ddf('0x31')](db[_0x6ddf('0x5e')][_0x6ddf('0x2c')]);_0x369f13[_0x6ddf('0x30')]=_['keys'](_0x1a45aa['query']);_0x369f13[_0x6ddf('0x32')]=_[_0x6ddf('0x33')](_0x369f13[_0x6ddf('0x2e')],_0x369f13['query']);_0x362138[_0x6ddf('0x34')]=_['intersection'](_0x369f13[_0x6ddf('0x2e')],qs[_0x6ddf('0x35')](_0x1a45aa[_0x6ddf('0x30')]['fields']));_0x362138[_0x6ddf('0x34')]=_0x362138[_0x6ddf('0x34')]['length']?_0x362138['attributes']:_0x369f13[_0x6ddf('0x2e')];_0x362138[_0x6ddf('0x3a')]=qs['sort'](_0x1a45aa[_0x6ddf('0x30')][_0x6ddf('0x3b')]);_0x362138['where']=qs['filters'](_[_0x6ddf('0x5f')](_0x1a45aa[_0x6ddf('0x30')],_0x369f13[_0x6ddf('0x32')]));if(_0x1a45aa[_0x6ddf('0x30')][_0x6ddf('0x3d')]){_0x362138[_0x6ddf('0x3c')]=_[_0x6ddf('0x3e')](_0x362138[_0x6ddf('0x3c')],{'$or':_[_0x6ddf('0x2f')](_0x362138[_0x6ddf('0x34')],function(_0x33057d){var _0xda785a={};_0xda785a[_0x33057d]={'$like':'%'+_0x1a45aa['query'][_0x6ddf('0x3d')]+'%'};return _0xda785a;})});}_0x362138=_[_0x6ddf('0x3e')]({},_0x362138,_0x1a45aa[_0x6ddf('0x40')]);return _0x6fbd34[_0x6ddf('0x5d')](_0x362138);}})[_0x6ddf('0x24')](function(_0x188d75){if(_0x188d75){_0x4b2ee8=_0x188d75[_0x6ddf('0x36')];if(!_0x1a45aa['query']['hasOwnProperty'](_0x6ddf('0x38'))){_0x362138['limit']=qs['limit'](_0x1a45aa[_0x6ddf('0x30')][_0x6ddf('0x39')]);_0x362138[_0x6ddf('0x1f')]=qs[_0x6ddf('0x1f')](_0x1a45aa['query'][_0x6ddf('0x1f')]);}return _0x6fbd34[_0x6ddf('0x5d')](_0x362138);}})[_0x6ddf('0x24')](function(_0x573275){if(_0x573275){return _0x573275?{'count':_0x4b2ee8,'rows':_0x573275}:null;}})[_0x6ddf('0x24')](respondWithResult(_0x23be7e,null))['catch'](handleError(_0x23be7e,null));};exports['addTeams']=function(_0x5633c6,_0x46b467,_0x5e8d3f){var _0x2e4931=_0x5633c6[_0x6ddf('0x4b')]['ids'];return db[_0x6ddf('0x5e')][_0x6ddf('0x43')]({'where':{'id':_0x2e4931},'attributes':['id'],'include':[{'model':db[_0x6ddf('0x57')],'as':_0x6ddf('0x60'),'attributes':['id',_0x6ddf('0x2a'),_0x6ddf('0x61'),_0x6ddf('0x62'),_0x6ddf('0x63')],'raw':!![]}]})['then'](function(_0x339d41){if(_0x339d41){var _0x35010b=_['flatMap'](_0x339d41,function(_0x8c7970){var _0x3ecafc=_0x8c7970[_0x6ddf('0x4f')]({'plain':!![]});return _0x3ecafc[_0x6ddf('0x60')];});return db[_0x6ddf('0x2b')][_0x6ddf('0x49')]({'where':{'id':_0x5633c6[_0x6ddf('0x47')]['id']}})[_0x6ddf('0x24')](function(_0x24ee5a){return db[_0x6ddf('0x64')]['transaction'](function(_0x5409b4){return _0x24ee5a[_0x6ddf('0x65')](_0x2e4931,{'transaction':_0x5409b4})[_0x6ddf('0x24')](function(){return BPromise[_0x6ddf('0x66')](_0x35010b,function(_0x144db0){return db[_0x6ddf('0x56')][_0x6ddf('0x67')]({'where':{'UserId':_0x144db0['id'],'OpenchannelQueueId':_0x5633c6['params']['id']},'transaction':_0x5409b4});});})[_0x6ddf('0x24')](function(){_0x35010b[_0x6ddf('0x68')](function(_0x3eb24d){socket[_0x6ddf('0x69')]('userOpenchannelQueue:save',{'UserId':_0x3eb24d['id'],'OpenchannelQueueId':_0x24ee5a['id']});});});});});}})['then'](respondWithStatusCode(_0x46b467,null))[_0x6ddf('0x45')](handleError(_0x46b467,null));};exports[_0x6ddf('0x6a')]=function(_0x30731b,_0x1501b6,_0xf34ad){return db[_0x6ddf('0x5e')]['findAll']({'where':{'id':_0x30731b[_0x6ddf('0x30')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x6ddf('0x60'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1501b6,null))[_0x6ddf('0x24')](function(_0x5c9c42){var _0x3917ea=_[_0x6ddf('0x2f')](_0x5c9c42,'id');var _0xa75ba2=[];var _0x8cf7d8=[];var _0x2ea169=squel[_0x6ddf('0x6b')]();_0x2ea169[_0x6ddf('0x6c')](_0x6ddf('0x6d'))[_0x6ddf('0x6e')](_0x6ddf('0x6f'),'tq')['join'](_0x6ddf('0x70'),'ut',_0x6ddf('0x71'))[_0x6ddf('0x3c')]('OpenchannelQueueId\x20=\x20?',_0x30731b['params']['id']);for(var _0x1feed8=0x0;_0x1feed8<_0x5c9c42['length'];_0x1feed8+=0x1){let _0x5487f1=_0x5c9c42[_0x1feed8];for(var _0x1a2c3b=0x0;_0x1a2c3b<_0x5487f1[_0x6ddf('0x60')][_0x6ddf('0x36')];_0x1a2c3b+=0x1){let _0x5acfbe=_0x5487f1[_0x6ddf('0x60')][_0x1a2c3b];var _0x5b1379=_0x2ea169[_0x6ddf('0x72')]();_0x5b1379[_0x6ddf('0x3c')]('ut.UserId\x20=\x20?',_0x5acfbe['id']);_0x8cf7d8[_0x6ddf('0x73')](db[_0x6ddf('0x64')][_0x6ddf('0x30')](_0x5b1379[_0x6ddf('0x74')](),{'type':db[_0x6ddf('0x64')]['QueryTypes'][_0x6ddf('0x75')]})[_0x6ddf('0x24')](function(_0x941288){if(_0x941288[_0x6ddf('0x36')]===0x1){return _0x5acfbe['id'];}else{var _0x183afb=_[_0x6ddf('0x76')](_[_0x6ddf('0x2f')](_0x941288,_0x6ddf('0x77')),function(_0x473c5c){return _[_0x6ddf('0x78')](_0x3917ea,_0x473c5c);});if(_0x183afb){return _0x5acfbe['id'];}}}));}}return BPromise['all'](_0x8cf7d8)[_0x6ddf('0x24')](function(_0xc6bac6){_0xa75ba2=_(_0xa75ba2)['union'](_0xc6bac6)[_0x6ddf('0x79')]()[_0x6ddf('0x7a')]();return db[_0x6ddf('0x2b')][_0x6ddf('0x49')]({'where':{'id':_0x30731b[_0x6ddf('0x47')]['id']}})[_0x6ddf('0x24')](function(_0x966998){return db[_0x6ddf('0x64')]['transaction'](function(_0x41bbd7){return _0x966998[_0x6ddf('0x6a')](_0x30731b['query'][_0x6ddf('0x7b')],{'transaction':_0x41bbd7})[_0x6ddf('0x24')](function(){if(!_[_0x6ddf('0x7c')](_0xa75ba2)){return _0x966998[_0x6ddf('0x7d')](_0xa75ba2,{'transaction':_0x41bbd7});}})[_0x6ddf('0x24')](function(){_0xa75ba2[_0x6ddf('0x68')](function(_0x4f9036){socket[_0x6ddf('0x69')](_0x6ddf('0x7e'),{'UserId':_0x4f9036,'OpenchannelQueueId':_0x966998['id']});});});});});});})[_0x6ddf('0x24')](respondWithStatusCode(_0x1501b6,null))[_0x6ddf('0x45')](handleError(_0x1501b6,null));};exports[_0x6ddf('0x7f')]=function(_0x4db6d8,_0x305ca1,_0x48fbb2){return db[_0x6ddf('0x2b')][_0x6ddf('0x49')]({'where':{'id':_0x4db6d8[_0x6ddf('0x47')]['id']}})[_0x6ddf('0x24')](handleEntityNotFound(_0x305ca1,null))[_0x6ddf('0x24')](function(_0x108620){if(_0x108620){return _0x108620['addAgents'](_0x4db6d8[_0x6ddf('0x4b')][_0x6ddf('0x7b')],_['omit'](_0x4db6d8[_0x6ddf('0x4b')],[_0x6ddf('0x7b'),'id'])||{})[_0x6ddf('0x80')](function(_0x373ef4){for(var _0x29d24e=0x0;_0x29d24e<_0x4db6d8[_0x6ddf('0x4b')][_0x6ddf('0x7b')]['length'];_0x29d24e+=0x1){socket['emit']('userOpenchannelQueue:save',{'UserId':_0x4db6d8[_0x6ddf('0x4b')][_0x6ddf('0x7b')][_0x29d24e],'OpenchannelQueueId':_0x4db6d8['params']['id']});}return _0x373ef4;});}})['then'](respondWithResult(_0x305ca1,null))['catch'](handleError(_0x305ca1,null));};exports[_0x6ddf('0x7d')]=function(_0x110261,_0x36394c,_0x5142fb){return db[_0x6ddf('0x2b')][_0x6ddf('0x49')]({'where':{'id':_0x110261['params']['id']}})[_0x6ddf('0x24')](handleEntityNotFound(_0x36394c,null))[_0x6ddf('0x24')](function(_0x58feb4){if(_0x58feb4){return _0x58feb4['removeAgents'](_0x110261[_0x6ddf('0x30')][_0x6ddf('0x7b')])[_0x6ddf('0x24')](function(){if(_[_0x6ddf('0x81')](_0x110261[_0x6ddf('0x30')][_0x6ddf('0x7b')])){for(var _0x3501f2=0x0;_0x3501f2<_0x110261[_0x6ddf('0x30')][_0x6ddf('0x7b')]['length'];_0x3501f2+=0x1){socket[_0x6ddf('0x69')](_0x6ddf('0x7e'),{'UserId':Number(_0x110261[_0x6ddf('0x30')][_0x6ddf('0x7b')][_0x3501f2]),'OpenchannelQueueId':Number(_0x110261[_0x6ddf('0x47')]['id'])});}}else{socket[_0x6ddf('0x69')](_0x6ddf('0x7e'),{'UserId':Number(_0x110261['query']['ids']),'OpenchannelQueueId':Number(_0x110261[_0x6ddf('0x47')]['id'])});}});}})[_0x6ddf('0x24')](respondWithStatusCode(_0x36394c,null))[_0x6ddf('0x45')](handleError(_0x36394c,null));};exports[_0x6ddf('0x82')]=function(_0x452537,_0x347261,_0x3896d4){var _0x4564da={};var _0x496173={};var _0x4e734b;var _0x2e7018;return db[_0x6ddf('0x2b')][_0x6ddf('0x83')]({'where':{'id':_0x452537[_0x6ddf('0x47')]['id']}})[_0x6ddf('0x24')](handleEntityNotFound(_0x347261,null))['then'](function(_0x220577){if(_0x220577){_0x4e734b=_0x220577;_0x496173[_0x6ddf('0x2e')]=_['keys'](db[_0x6ddf('0x57')][_0x6ddf('0x2c')]);_0x496173[_0x6ddf('0x30')]=_['keys'](_0x452537[_0x6ddf('0x30')]);_0x496173[_0x6ddf('0x32')]=_[_0x6ddf('0x33')](_0x496173[_0x6ddf('0x2e')],_0x496173[_0x6ddf('0x30')]);_0x4564da[_0x6ddf('0x34')]=_[_0x6ddf('0x33')](_0x496173['model'],qs[_0x6ddf('0x35')](_0x452537[_0x6ddf('0x30')]['fields']));_0x4564da['attributes']=_0x4564da[_0x6ddf('0x34')]['length']?_0x4564da[_0x6ddf('0x34')]:_0x496173[_0x6ddf('0x2e')];_0x4564da['order']=qs['sort'](_0x452537[_0x6ddf('0x30')][_0x6ddf('0x3b')]);_0x4564da[_0x6ddf('0x3c')]=qs[_0x6ddf('0x32')](_['pick'](_0x452537[_0x6ddf('0x30')],_0x496173[_0x6ddf('0x32')]));if(_0x452537[_0x6ddf('0x30')]['filter']){_0x4564da[_0x6ddf('0x3c')]=_[_0x6ddf('0x3e')](_0x4564da[_0x6ddf('0x3c')],{'$or':_[_0x6ddf('0x2f')](_0x4564da[_0x6ddf('0x34')],function(_0x26cdc9){var _0x1b9b8d={};_0x1b9b8d[_0x26cdc9]={'$like':'%'+_0x452537[_0x6ddf('0x30')]['filter']+'%'};return _0x1b9b8d;})});}_0x4564da=_['merge']({},_0x4564da,_0x452537[_0x6ddf('0x40')]);return _0x4e734b['getAgents'](_0x4564da);}})[_0x6ddf('0x24')](function(_0x540541){if(_0x540541){_0x2e7018=_0x540541['length'];if(!_0x452537['query'][_0x6ddf('0x37')]('nolimit')){_0x4564da[_0x6ddf('0x39')]=qs[_0x6ddf('0x39')](_0x452537[_0x6ddf('0x30')]['limit']);_0x4564da[_0x6ddf('0x1f')]=qs['offset'](_0x452537[_0x6ddf('0x30')][_0x6ddf('0x1f')]);}return _0x4e734b[_0x6ddf('0x82')](_0x4564da);}})[_0x6ddf('0x24')](function(_0x28c2ae){if(_0x28c2ae){return _0x28c2ae?{'count':_0x2e7018,'rows':_0x28c2ae}:null;}})[_0x6ddf('0x24')](respondWithResult(_0x347261,null))[_0x6ddf('0x45')](handleError(_0x347261,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 97d31bc..ce64e74 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 _0x7777=['hook','exports','../../mysqldb','OpenchannelQueue','save','emit','hasOwnProperty'];(function(_0x28a59c,_0x37bd9f){var _0x14cbba=function(_0x4624eb){while(--_0x4624eb){_0x28a59c['push'](_0x28a59c['shift']());}};_0x14cbba(++_0x37bd9f);}(_0x7777,0x113));var _0x7777=function(_0x251895,_0x414adb){_0x251895=_0x251895-0x0;var _0x70b2dd=_0x7777[_0x251895];return _0x70b2dd;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x7777('0x0'))['db'][_0x7777('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7777('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x16cd2b){return function(_0x3f77b8,_0x54a85e,_0x172008){OpenchannelQueueEvents[_0x7777('0x3')](_0x16cd2b+':'+_0x3f77b8['id'],_0x3f77b8);OpenchannelQueueEvents['emit'](_0x16cd2b,_0x3f77b8);_0x172008(null);};}for(var e in events){if(events[_0x7777('0x4')](e)){var event=events[e];OpenchannelQueue[_0x7777('0x5')](e,emitEvent(event));}}module[_0x7777('0x6')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x2651=['save','update','remove','emit','hasOwnProperty','../../mysqldb','OpenchannelQueue','setMaxListeners'];(function(_0xf4f28e,_0x2556fa){var _0x4ca46c=function(_0x3a2092){while(--_0x3a2092){_0xf4f28e['push'](_0xf4f28e['shift']());}};_0x4ca46c(++_0x2556fa);}(_0x2651,0x9d));var _0x1265=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0x2651[_0x4b2863];return _0x567d67;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x1265('0x0'))['db'][_0x1265('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x1265('0x2')](0x0);var events={'afterCreate':_0x1265('0x3'),'afterUpdate':_0x1265('0x4'),'afterDestroy':_0x1265('0x5')};function emitEvent(_0x42b936){return function(_0xe77b22,_0x378273,_0x3ebbcd){OpenchannelQueueEvents[_0x1265('0x6')](_0x42b936+':'+_0xe77b22['id'],_0xe77b22);OpenchannelQueueEvents['emit'](_0x42b936,_0xe77b22);_0x3ebbcd(null);};}for(var e in events){if(events[_0x1265('0x7')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 07cef63..ea21bb0 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 _0x5f5f=['exports','define','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes'];(function(_0x239193,_0x1585ef){var _0x4f51c3=function(_0x8eba2c){while(--_0x8eba2c){_0x239193['push'](_0x239193['shift']());}};_0x4f51c3(++_0x1585ef);}(_0x5f5f,0x178));var _0xf5f5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5f5f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf5f5('0x0'));var util=require('util');var logger=require(_0xf5f5('0x1'))(_0xf5f5('0x2'));var moment=require(_0xf5f5('0x3'));var BPromise=require('bluebird');var rp=require(_0xf5f5('0x4'));var fs=require('fs');var path=require(_0xf5f5('0x5'));var rimraf=require(_0xf5f5('0x6'));var config=require(_0xf5f5('0x7'));var attributes=require(_0xf5f5('0x8'));module[_0xf5f5('0x9')]=function(_0x28fc98,_0xb6003b){return _0x28fc98[_0xf5f5('0xa')]('OpenchannelQueue',attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6d1d=['util','../../config/logger','api','request-promise','path','rimraf','./openchannelQueue.attributes','exports','define','openchannel_queues'];(function(_0x570611,_0x4788c8){var _0x5d82c5=function(_0x458d08){while(--_0x458d08){_0x570611['push'](_0x570611['shift']());}};_0x5d82c5(++_0x4788c8);}(_0x6d1d,0x19a));var _0xd6d1=function(_0x18f6b8,_0x2503e2){_0x18f6b8=_0x18f6b8-0x0;var _0x64af61=_0x6d1d[_0x18f6b8];return _0x64af61;};'use strict';var _=require('lodash');var util=require(_0xd6d1('0x0'));var logger=require(_0xd6d1('0x1'))(_0xd6d1('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd6d1('0x3'));var fs=require('fs');var path=require(_0xd6d1('0x4'));var rimraf=require(_0xd6d1('0x5'));var config=require('../../config/environment');var attributes=require(_0xd6d1('0x6'));module[_0xd6d1('0x7')]=function(_0x56dd60,_0x338bd9){return _0x56dd60[_0xd6d1('0x8')]('OpenchannelQueue',attributes,{'tableName':_0xd6d1('0x9'),'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 3b27751..5dd305c 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 _0xa46e=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','./openchannelQueue.socket','request','then','OpenchannelQueue,\x20%s,\x20%s','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','include','map','model','find','ShowOpenchannelQueue','catch','lodash','util'];(function(_0x26260c,_0x3a9df0){var _0x21f487=function(_0x5dd85f){while(--_0x5dd85f){_0x26260c['push'](_0x26260c['shift']());}};_0x21f487(++_0x3a9df0);}(_0xa46e,0x116));var _0xea46=function(_0xb301d4,_0x27ed18){_0xb301d4=_0xb301d4-0x0;var _0x3b5bde=_0xa46e[_0xb301d4];return _0x3b5bde;};'use strict';var _=require(_0xea46('0x0'));var util=require(_0xea46('0x1'));var moment=require(_0xea46('0x2'));var BPromise=require(_0xea46('0x3'));var rs=require(_0xea46('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xea46('0x5'))['db'];var utils=require(_0xea46('0x6'));var logger=require(_0xea46('0x7'))(_0xea46('0x8'));var config=require(_0xea46('0x9'));var jayson=require(_0xea46('0xa'));var client=jayson['client'][_0xea46('0xb')]({'port':0x232a});config[_0xea46('0xc')]=_[_0xea46('0xd')](config[_0xea46('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xea46('0xc')]));require(_0xea46('0xe'))['register'](socket);function respondWithRpcPromise(_0x2de76e,_0x5b939d,_0x5bdaa7){return new BPromise(function(_0x75aa2c,_0x4210e7){return client[_0xea46('0xf')](_0x2de76e,_0x5bdaa7)[_0xea46('0x10')](function(_0x670587){logger['info'](_0xea46('0x11'),_0x5b939d,'request\x20sent');logger[_0xea46('0x12')](_0xea46('0x13'),_0x5b939d,_0xea46('0x14'),JSON[_0xea46('0x15')](_0x670587));if(_0x670587[_0xea46('0x16')]){if(_0x670587['error'][_0xea46('0x17')]===0x1f4){logger[_0xea46('0x16')](_0xea46('0x11'),_0x5b939d,_0x670587[_0xea46('0x16')][_0xea46('0x18')]);return _0x4210e7(_0x670587['error'][_0xea46('0x18')]);}logger[_0xea46('0x16')](_0xea46('0x11'),_0x5b939d,_0x670587[_0xea46('0x16')]['message']);return _0x75aa2c(_0x670587[_0xea46('0x16')][_0xea46('0x18')]);}else{logger[_0xea46('0x19')](_0xea46('0x11'),_0x5b939d,_0xea46('0x14'));_0x75aa2c(_0x670587[_0xea46('0x1a')][_0xea46('0x18')]);}})['catch'](function(_0x39b26b){logger[_0xea46('0x16')](_0xea46('0x11'),_0x5b939d,_0x39b26b);_0x4210e7(_0x39b26b);});});}exports[_0xea46('0x1b')]=function(_0x39a99c){var _0x3d9a7a=this;return new Promise(function(_0x22fd4a,_0x53bfff){return db[_0xea46('0x1c')][_0xea46('0x1d')]({'raw':_0x39a99c[_0xea46('0x1e')]?_0x39a99c[_0xea46('0x1e')][_0xea46('0x1f')]===undefined?!![]:![]:!![],'where':_0x39a99c['options']?_0x39a99c[_0xea46('0x1e')][_0xea46('0x20')]||null:null,'attributes':_0x39a99c['options']?_0x39a99c['options'][_0xea46('0x21')]||null:null,'limit':_0x39a99c['options']?_0x39a99c['options']['limit']||null:null,'include':_0x39a99c[_0xea46('0x1e')]?_0x39a99c[_0xea46('0x1e')][_0xea46('0x22')]?_[_0xea46('0x23')](_0x39a99c[_0xea46('0x1e')]['include'],function(_0x3848a5){return{'model':db[_0x3848a5[_0xea46('0x24')]],'as':_0x3848a5['as'],'attributes':_0x3848a5[_0xea46('0x21')],'include':_0x3848a5['include']?_[_0xea46('0x23')](_0x3848a5[_0xea46('0x22')],function(_0xdba90e){return{'model':db[_0xdba90e['model']],'as':_0xdba90e['as'],'attributes':_0xdba90e['attributes'],'include':_0xdba90e[_0xea46('0x22')]?_[_0xea46('0x23')](_0xdba90e[_0xea46('0x22')],function(_0x1dc827){return{'model':db[_0x1dc827[_0xea46('0x24')]],'as':_0x1dc827['as'],'attributes':_0x1dc827['attributes']};}):[]};}):[]};}):[]:[]})[_0xea46('0x10')](function(_0x59a8cd){logger[_0xea46('0x19')]('GetOpenchannelQueue',_0x39a99c);logger[_0xea46('0x12')](_0xea46('0x1b'),_0x39a99c,JSON[_0xea46('0x15')](_0x59a8cd));_0x22fd4a(_0x59a8cd);})['catch'](function(_0x3955ca){logger[_0xea46('0x16')](_0xea46('0x1b'),_0x3955ca['message'],_0x39a99c);_0x53bfff(_0x3d9a7a[_0xea46('0x16')](0x1f4,_0x3955ca[_0xea46('0x18')]));});});};exports['ShowOpenchannelQueue']=function(_0x5c2429){var _0x3421a7=this;return new Promise(function(_0x113210,_0x1391c1){return db[_0xea46('0x1c')][_0xea46('0x25')]({'raw':_0x5c2429[_0xea46('0x1e')]?_0x5c2429['options'][_0xea46('0x1f')]===undefined?!![]:![]:!![],'where':_0x5c2429[_0xea46('0x1e')]?_0x5c2429[_0xea46('0x1e')][_0xea46('0x20')]||null:null,'attributes':_0x5c2429[_0xea46('0x1e')]?_0x5c2429[_0xea46('0x1e')]['attributes']||null:null,'include':_0x5c2429[_0xea46('0x1e')]?_0x5c2429[_0xea46('0x1e')][_0xea46('0x22')]?_['map'](_0x5c2429[_0xea46('0x1e')]['include'],function(_0x477e3a){return{'model':db[_0x477e3a[_0xea46('0x24')]],'as':_0x477e3a['as'],'attributes':_0x477e3a[_0xea46('0x21')],'include':_0x477e3a['include']?_[_0xea46('0x23')](_0x477e3a[_0xea46('0x22')],function(_0x37b985){return{'model':db[_0x37b985[_0xea46('0x24')]],'as':_0x37b985['as'],'attributes':_0x37b985[_0xea46('0x21')],'include':_0x37b985[_0xea46('0x22')]?_[_0xea46('0x23')](_0x37b985[_0xea46('0x22')],function(_0x2de666){return{'model':db[_0x2de666['model']],'as':_0x2de666['as'],'attributes':_0x2de666['attributes']};}):[]};}):[]};}):[]:[]})[_0xea46('0x10')](function(_0x3afc78){logger['info'](_0xea46('0x26'),_0x5c2429);logger[_0xea46('0x12')](_0xea46('0x26'),_0x5c2429,JSON['stringify'](_0x3afc78));_0x113210(_0x3afc78);})[_0xea46('0x27')](function(_0x8d8cf8){logger['error'](_0xea46('0x26'),_0x8d8cf8['message'],_0x5c2429);_0x1391c1(_0x3421a7[_0xea46('0x16')](0x1f4,_0x8d8cf8[_0xea46('0x18')]));});});}; \ No newline at end of file +var _0xe132=['ShowOpenchannelQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','findAll','options','raw','where','limit','include','map','model','attributes','GetOpenchannelQueue','stringify','catch','OpenchannelQueue','find'];(function(_0x2a2766,_0x475265){var _0x30a56c=function(_0x8f9186){while(--_0x8f9186){_0x2a2766['push'](_0x2a2766['shift']());}};_0x30a56c(++_0x475265);}(_0xe132,0x1b9));var _0x2e13=function(_0x58faef,_0x2080c0){_0x58faef=_0x58faef-0x0;var _0x3c6e73=_0xe132[_0x58faef];return _0x3c6e73;};'use strict';var _=require(_0x2e13('0x0'));var util=require(_0x2e13('0x1'));var moment=require(_0x2e13('0x2'));var BPromise=require(_0x2e13('0x3'));var rs=require(_0x2e13('0x4'));var fs=require('fs');var Redis=require(_0x2e13('0x5'));var db=require(_0x2e13('0x6'))['db'];var utils=require(_0x2e13('0x7'));var logger=require(_0x2e13('0x8'))('rpc');var config=require(_0x2e13('0x9'));var jayson=require(_0x2e13('0xa'));var client=jayson[_0x2e13('0xb')][_0x2e13('0xc')]({'port':0x232a});config[_0x2e13('0xd')]=_[_0x2e13('0xe')](config[_0x2e13('0xd')],{'host':_0x2e13('0xf'),'port':0x18eb});var socket=require(_0x2e13('0x10'))(new Redis(config['redis']));require(_0x2e13('0x11'))[_0x2e13('0x12')](socket);function respondWithRpcPromise(_0x537674,_0x1e31ac,_0x3a1526){return new BPromise(function(_0x4dc6c0,_0x5c2ccf){return client['request'](_0x537674,_0x3a1526)[_0x2e13('0x13')](function(_0x13c536){logger[_0x2e13('0x14')](_0x2e13('0x15'),_0x1e31ac,_0x2e13('0x16'));logger[_0x2e13('0x17')](_0x2e13('0x18'),_0x1e31ac,_0x2e13('0x16'),JSON['stringify'](_0x13c536));if(_0x13c536[_0x2e13('0x19')]){if(_0x13c536[_0x2e13('0x19')][_0x2e13('0x1a')]===0x1f4){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x1e31ac,_0x13c536['error']['message']);return _0x5c2ccf(_0x13c536['error'][_0x2e13('0x1b')]);}logger[_0x2e13('0x19')](_0x2e13('0x15'),_0x1e31ac,_0x13c536[_0x2e13('0x19')][_0x2e13('0x1b')]);return _0x4dc6c0(_0x13c536[_0x2e13('0x19')][_0x2e13('0x1b')]);}else{logger['info'](_0x2e13('0x15'),_0x1e31ac,'request\x20sent');_0x4dc6c0(_0x13c536[_0x2e13('0x1c')][_0x2e13('0x1b')]);}})['catch'](function(_0x51cb96){logger['error'](_0x2e13('0x15'),_0x1e31ac,_0x51cb96);_0x5c2ccf(_0x51cb96);});});}exports['GetOpenchannelQueue']=function(_0x40c769){var _0x40c13d=this;return new Promise(function(_0x2410cf,_0x1e2356){return db['OpenchannelQueue'][_0x2e13('0x1d')]({'raw':_0x40c769[_0x2e13('0x1e')]?_0x40c769[_0x2e13('0x1e')][_0x2e13('0x1f')]===undefined?!![]:![]:!![],'where':_0x40c769[_0x2e13('0x1e')]?_0x40c769[_0x2e13('0x1e')][_0x2e13('0x20')]||null:null,'attributes':_0x40c769[_0x2e13('0x1e')]?_0x40c769['options']['attributes']||null:null,'limit':_0x40c769[_0x2e13('0x1e')]?_0x40c769[_0x2e13('0x1e')][_0x2e13('0x21')]||null:null,'include':_0x40c769[_0x2e13('0x1e')]?_0x40c769[_0x2e13('0x1e')][_0x2e13('0x22')]?_[_0x2e13('0x23')](_0x40c769['options'][_0x2e13('0x22')],function(_0x17dd3c){return{'model':db[_0x17dd3c[_0x2e13('0x24')]],'as':_0x17dd3c['as'],'attributes':_0x17dd3c[_0x2e13('0x25')],'include':_0x17dd3c[_0x2e13('0x22')]?_[_0x2e13('0x23')](_0x17dd3c[_0x2e13('0x22')],function(_0x7e509e){return{'model':db[_0x7e509e[_0x2e13('0x24')]],'as':_0x7e509e['as'],'attributes':_0x7e509e['attributes'],'include':_0x7e509e[_0x2e13('0x22')]?_['map'](_0x7e509e['include'],function(_0x21fd4a){return{'model':db[_0x21fd4a[_0x2e13('0x24')]],'as':_0x21fd4a['as'],'attributes':_0x21fd4a[_0x2e13('0x25')]};}):[]};}):[]};}):[]:[]})[_0x2e13('0x13')](function(_0x4d9322){logger[_0x2e13('0x14')](_0x2e13('0x26'),_0x40c769);logger[_0x2e13('0x17')](_0x2e13('0x26'),_0x40c769,JSON[_0x2e13('0x27')](_0x4d9322));_0x2410cf(_0x4d9322);})[_0x2e13('0x28')](function(_0x1e5f30){logger[_0x2e13('0x19')](_0x2e13('0x26'),_0x1e5f30['message'],_0x40c769);_0x1e2356(_0x40c13d[_0x2e13('0x19')](0x1f4,_0x1e5f30[_0x2e13('0x1b')]));});});};exports['ShowOpenchannelQueue']=function(_0x4410c7){var _0x1c4e2b=this;return new Promise(function(_0x1deff9,_0x3f8e1b){return db[_0x2e13('0x29')][_0x2e13('0x2a')]({'raw':_0x4410c7[_0x2e13('0x1e')]?_0x4410c7[_0x2e13('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x4410c7[_0x2e13('0x1e')]?_0x4410c7['options'][_0x2e13('0x20')]||null:null,'attributes':_0x4410c7['options']?_0x4410c7[_0x2e13('0x1e')]['attributes']||null:null,'include':_0x4410c7['options']?_0x4410c7[_0x2e13('0x1e')][_0x2e13('0x22')]?_[_0x2e13('0x23')](_0x4410c7['options'][_0x2e13('0x22')],function(_0x1f6af2){return{'model':db[_0x1f6af2[_0x2e13('0x24')]],'as':_0x1f6af2['as'],'attributes':_0x1f6af2[_0x2e13('0x25')],'include':_0x1f6af2[_0x2e13('0x22')]?_['map'](_0x1f6af2[_0x2e13('0x22')],function(_0x540443){return{'model':db[_0x540443['model']],'as':_0x540443['as'],'attributes':_0x540443[_0x2e13('0x25')],'include':_0x540443['include']?_[_0x2e13('0x23')](_0x540443['include'],function(_0x4bd319){return{'model':db[_0x4bd319[_0x2e13('0x24')]],'as':_0x4bd319['as'],'attributes':_0x4bd319['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x128b6f){logger[_0x2e13('0x14')](_0x2e13('0x2b'),_0x4410c7);logger[_0x2e13('0x17')](_0x2e13('0x2b'),_0x4410c7,JSON[_0x2e13('0x27')](_0x128b6f));_0x1deff9(_0x128b6f);})[_0x2e13('0x28')](function(_0x48415c){logger[_0x2e13('0x19')](_0x2e13('0x2b'),_0x48415c[_0x2e13('0x1b')],_0x4410c7);_0x3f8e1b(_0x1c4e2b['error'](0x1f4,_0x48415c[_0x2e13('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 5f4b409..4b63721 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 _0x026e=['emit','removeListener','register','length','openchannelQueue:','save','remove','update'];(function(_0x58e8c0,_0x423a7f){var _0x35ef81=function(_0x2660a7){while(--_0x2660a7){_0x58e8c0['push'](_0x58e8c0['shift']());}};_0x35ef81(++_0x423a7f);}(_0x026e,0x15d));var _0xe026=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x026e[_0x321bb2];return _0x9c12ed;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0xe026('0x0'),_0xe026('0x1'),_0xe026('0x2')];function createListener(_0x1875f9,_0x1ec3a4){return function(_0x3502ea){_0x1ec3a4[_0xe026('0x3')](_0x1875f9,_0x3502ea);};}function removeListener(_0x511249,_0x4a0b59){return function(){OpenchannelQueueEvents[_0xe026('0x4')](_0x511249,_0x4a0b59);};}exports[_0xe026('0x5')]=function(_0x4f6791){for(var _0xbb2ef7=0x0,_0x7601e=events[_0xe026('0x6')];_0xbb2ef7<_0x7601e;_0xbb2ef7++){var _0x77c943=events[_0xbb2ef7];var _0x12fe54=createListener(_0xe026('0x7')+_0x77c943,_0x4f6791);OpenchannelQueueEvents['on'](_0x77c943,_0x12fe54);}}; \ No newline at end of file +var _0x288a=['removeListener','length','save','update','emit'];(function(_0x1dadad,_0x50f274){var _0x42375b=function(_0x313e01){while(--_0x313e01){_0x1dadad['push'](_0x1dadad['shift']());}};_0x42375b(++_0x50f274);}(_0x288a,0x179));var _0xa288=function(_0x37946b,_0x2de031){_0x37946b=_0x37946b-0x0;var _0x8b04b9=_0x288a[_0x37946b];return _0x8b04b9;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0xa288('0x0'),'remove',_0xa288('0x1')];function createListener(_0x3bc062,_0x3bea0d){return function(_0x3b30d8){_0x3bea0d[_0xa288('0x2')](_0x3bc062,_0x3b30d8);};}function removeListener(_0x1a6351,_0x329f95){return function(){OpenchannelQueueEvents[_0xa288('0x3')](_0x1a6351,_0x329f95);};}exports['register']=function(_0x2cd29c){for(var _0x276c42=0x0,_0x5be0e8=events[_0xa288('0x4')];_0x276c42<_0x5be0e8;_0x276c42++){var _0x3321f5=events[_0x276c42];var _0x2c40d8=createListener('openchannelQueue:'+_0x3321f5,_0x2cd29c);OpenchannelQueueEvents['on'](_0x3321f5,_0x2c40d8);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 0e84ae5..86208c5 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 _0xcaa4=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','/:id','show','post','create','update','delete','multer','util','connect-timeout','express'];(function(_0x11900a,_0x243889){var _0x21ea87=function(_0xf17878){while(--_0xf17878){_0x11900a['push'](_0x11900a['shift']());}};_0x21ea87(++_0x243889);}(_0xcaa4,0x12e));var _0x4caa=function(_0x54d28e,_0xe86ca1){_0x54d28e=_0x54d28e-0x0;var _0x354cd9=_0xcaa4[_0x54d28e];return _0x354cd9;};'use strict';var multer=require(_0x4caa('0x0'));var util=require(_0x4caa('0x1'));var path=require('path');var timeout=require(_0x4caa('0x2'));var express=require(_0x4caa('0x3'));var router=express[_0x4caa('0x4')]();var auth=require(_0x4caa('0x5'));var interaction=require(_0x4caa('0x6'));var config=require(_0x4caa('0x7'));var controller=require('./openchannelQueueReport.controller');router['get']('/',auth[_0x4caa('0x8')](),controller[_0x4caa('0x9')]);router[_0x4caa('0xa')](_0x4caa('0xb'),auth[_0x4caa('0x8')](),controller['describe']);router[_0x4caa('0xa')](_0x4caa('0xc'),auth[_0x4caa('0x8')](),controller[_0x4caa('0xd')]);router[_0x4caa('0xe')]('/',auth['isAuthenticated'](),controller[_0x4caa('0xf')]);router['put'](_0x4caa('0xc'),auth['isAuthenticated'](),controller[_0x4caa('0x10')]);router[_0x4caa('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xda85=['create','put','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x14f8e7,_0x306590){var _0x249187=function(_0x21f9d7){while(--_0x21f9d7){_0x14f8e7['push'](_0x14f8e7['shift']());}};_0x249187(++_0x306590);}(_0xda85,0x12b));var _0x5da8=function(_0x496ca4,_0x7cc3fa){_0x496ca4=_0x496ca4-0x0;var _0x5e1e22=_0xda85[_0x496ca4];return _0x5e1e22;};'use strict';var multer=require(_0x5da8('0x0'));var util=require(_0x5da8('0x1'));var path=require(_0x5da8('0x2'));var timeout=require('connect-timeout');var express=require(_0x5da8('0x3'));var router=express[_0x5da8('0x4')]();var auth=require(_0x5da8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5da8('0x6'));var controller=require(_0x5da8('0x7'));router[_0x5da8('0x8')]('/',auth[_0x5da8('0x9')](),controller[_0x5da8('0xa')]);router[_0x5da8('0x8')](_0x5da8('0xb'),auth[_0x5da8('0x9')](),controller[_0x5da8('0xc')]);router[_0x5da8('0x8')](_0x5da8('0xd'),auth[_0x5da8('0x9')](),controller[_0x5da8('0xe')]);router[_0x5da8('0xf')]('/',auth[_0x5da8('0x9')](),controller[_0x5da8('0x10')]);router[_0x5da8('0x11')](_0x5da8('0xd'),auth[_0x5da8('0x9')](),controller['update']);router[_0x5da8('0x12')]('/:id',auth[_0x5da8('0x9')](),controller[_0x5da8('0x13')]);module[_0x5da8('0x14')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 77b0d93..deaeab3 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 _0x7f19=['DATE','sequelize','exports','STRING'];(function(_0x1e99e3,_0x59a197){var _0x985966=function(_0x23dc27){while(--_0x23dc27){_0x1e99e3['push'](_0x1e99e3['shift']());}};_0x985966(++_0x59a197);}(_0x7f19,0xc5));var _0x97f1=function(_0x18b4ba,_0x518a71){_0x18b4ba=_0x18b4ba-0x0;var _0xb17585=_0x7f19[_0x18b4ba];return _0xb17585;};'use strict';var moment=require('moment');var Sequelize=require(_0x97f1('0x0'));module[_0x97f1('0x1')]={'uniqueid':{'type':Sequelize[_0x97f1('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x97f1('0x2')]},'joinAt':{'type':Sequelize[_0x97f1('0x3')]},'leaveAt':{'type':Sequelize[_0x97f1('0x3')]},'acceptAt':{'type':Sequelize[_0x97f1('0x3')]},'exitAt':{'type':Sequelize[_0x97f1('0x3')]},'reason':{'type':Sequelize[_0x97f1('0x2')]}}; \ No newline at end of file +var _0x8fe8=['STRING','DATE','moment','sequelize','exports'];(function(_0x55c76f,_0x13b7f4){var _0x1571ff=function(_0x4082ce){while(--_0x4082ce){_0x55c76f['push'](_0x55c76f['shift']());}};_0x1571ff(++_0x13b7f4);}(_0x8fe8,0x101));var _0x88fe=function(_0x14ff1f,_0x137e2a){_0x14ff1f=_0x14ff1f-0x0;var _0x539885=_0x8fe8[_0x14ff1f];return _0x539885;};'use strict';var moment=require(_0x88fe('0x0'));var Sequelize=require(_0x88fe('0x1'));module[_0x88fe('0x2')]={'uniqueid':{'type':Sequelize[_0x88fe('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x88fe('0x3')]},'joinAt':{'type':Sequelize[_0x88fe('0x4')]},'leaveAt':{'type':Sequelize[_0x88fe('0x4')]},'acceptAt':{'type':Sequelize[_0x88fe('0x4')]},'exitAt':{'type':Sequelize[_0x88fe('0x4')]},'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 e6ab2e1..bd50f6f 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 _0x47d6=['body','update','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','reject','save','destroy','then','error','stack','name','send','index','type','key','map','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','OpenchannelQueueReport','catch','show','params','rawAttributes','keys','includeAll','include','find','create'];(function(_0xa650d8,_0x6d01ef){var _0x79ce97=function(_0x5ee62b){while(--_0x5ee62b){_0xa650d8['push'](_0xa650d8['shift']());}};_0x79ce97(++_0x6d01ef);}(_0x47d6,0x13f));var _0x647d=function(_0x52eee9,_0x26acae){_0x52eee9=_0x52eee9-0x0;var _0x5b846c=_0x47d6[_0x52eee9];return _0x5b846c;};'use strict';var pdf=require(_0x647d('0x0'));var emlformat=require(_0x647d('0x1'));var rimraf=require(_0x647d('0x2'));var zipdir=require(_0x647d('0x3'));var jsonpatch=require(_0x647d('0x4'));var rp=require(_0x647d('0x5'));var moment=require(_0x647d('0x6'));var BPromise=require(_0x647d('0x7'));var Mustache=require(_0x647d('0x8'));var util=require(_0x647d('0x9'));var path=require(_0x647d('0xa'));var sox=require(_0x647d('0xb'));var csv=require(_0x647d('0xc'));var ejs=require(_0x647d('0xd'));var fs=require('fs');var _=require(_0x647d('0xe'));var squel=require(_0x647d('0xf'));var crypto=require('crypto');var jsforce=require(_0x647d('0x10'));var deskjs=require(_0x647d('0x11'));var toCsv=require(_0x647d('0xc'));var querystring=require(_0x647d('0x12'));var Papa=require(_0x647d('0x13'));var Redis=require(_0x647d('0x14'));var authService=require(_0x647d('0x15'));var qs=require(_0x647d('0x16'));var as=require(_0x647d('0x17'));var hardwareService=require(_0x647d('0x18'));var logger=require(_0x647d('0x19'))(_0x647d('0x1a'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x647d('0x1b'))['db'];function respondWithStatusCode(_0xdd0f3c,_0xcdbe){_0xcdbe=_0xcdbe||0xcc;return function(_0xb7ffed){if(_0xb7ffed){return _0xdd0f3c[_0x647d('0x1c')](_0xcdbe);}return _0xdd0f3c[_0x647d('0x1d')](_0xcdbe)[_0x647d('0x1e')]();};}function respondWithResult(_0x3e6536,_0x5e723e){_0x5e723e=_0x5e723e||0xc8;return function(_0x29d0f3){if(_0x29d0f3){return _0x3e6536[_0x647d('0x1d')](_0x5e723e)['json'](_0x29d0f3);}};}function respondWithFilteredResult(_0xffca3c,_0x219b4a){return function(_0x3f805b){if(_0x3f805b){var _0x53297a=_0x3f805b[_0x647d('0x1f')],_0x531499=_0x219b4a['offset'],_0x2f9be8=_0x219b4a[_0x647d('0x20')]+_0x219b4a[_0x647d('0x21')],_0x20c5d1;if(_0x2f9be8>=_0x53297a){_0x2f9be8=_0x53297a;_0x20c5d1=0xc8;}else{_0x20c5d1=0xce;}_0xffca3c['status'](_0x20c5d1);return _0xffca3c[_0x647d('0x22')](_0x647d('0x23'),_0x531499+'-'+_0x2f9be8+'/'+_0x53297a)[_0x647d('0x24')](_0x3f805b);}return null;};}function patchUpdates(_0x53000c){return function(_0x5a3a99){try{jsonpatch['apply'](_0x5a3a99,_0x53000c,!![]);}catch(_0x1515b4){return BPromise[_0x647d('0x25')](_0x1515b4);}return _0x5a3a99[_0x647d('0x26')]();};}function saveUpdates(_0x4991ab,_0x16a1de){return function(_0x38dcc0){if(_0x38dcc0){return _0x38dcc0['update'](_0x4991ab)['then'](function(_0x5236dc){return _0x5236dc;});}return null;};}function removeEntity(_0x28a0bc,_0x362238){return function(_0x570fd2){if(_0x570fd2){return _0x570fd2[_0x647d('0x27')]()[_0x647d('0x28')](function(){_0x28a0bc[_0x647d('0x1d')](0xcc)[_0x647d('0x1e')]();});}};}function handleEntityNotFound(_0x5e9c0f,_0x5e43e7){return function(_0xa9b2f7){if(!_0xa9b2f7){_0x5e9c0f['sendStatus'](0x194);}return _0xa9b2f7;};}function handleError(_0x5bd068,_0x3626fb){_0x3626fb=_0x3626fb||0x1f4;return function(_0x15970b){logger[_0x647d('0x29')](_0x15970b[_0x647d('0x2a')]);if(_0x15970b[_0x647d('0x2b')]){delete _0x15970b[_0x647d('0x2b')];}_0x5bd068[_0x647d('0x1d')](_0x3626fb)[_0x647d('0x2c')](_0x15970b);};}exports[_0x647d('0x2d')]=function(_0x1b20ec,_0x11a0c1){var _0x31be11={},_0x398c33={},_0x24356c={'count':0x0,'rows':[]};var _0x3fd97f=_['map'](db['OpenchannelQueueReport']['rawAttributes'],function(_0x38ab27){return{'name':_0x38ab27['fieldName'],'type':_0x38ab27[_0x647d('0x2e')][_0x647d('0x2f')]};});_0x398c33['model']=_[_0x647d('0x30')](_0x3fd97f,_0x647d('0x2b'));_0x398c33[_0x647d('0x31')]=_['keys'](_0x1b20ec[_0x647d('0x31')]);_0x398c33[_0x647d('0x32')]=_[_0x647d('0x33')](_0x398c33['model'],_0x398c33['query']);_0x31be11[_0x647d('0x34')]=_[_0x647d('0x33')](_0x398c33[_0x647d('0x35')],qs['fields'](_0x1b20ec[_0x647d('0x31')][_0x647d('0x36')]));_0x31be11[_0x647d('0x34')]=_0x31be11[_0x647d('0x34')][_0x647d('0x37')]?_0x31be11[_0x647d('0x34')]:_0x398c33[_0x647d('0x35')];if(!_0x1b20ec[_0x647d('0x31')][_0x647d('0x38')](_0x647d('0x39'))){_0x31be11[_0x647d('0x21')]=qs['limit'](_0x1b20ec[_0x647d('0x31')][_0x647d('0x21')]);_0x31be11[_0x647d('0x20')]=qs[_0x647d('0x20')](_0x1b20ec[_0x647d('0x31')][_0x647d('0x20')]);}_0x31be11[_0x647d('0x3a')]=qs[_0x647d('0x3b')](_0x1b20ec['query']['sort']);_0x31be11[_0x647d('0x3c')]=qs[_0x647d('0x32')](_[_0x647d('0x3d')](_0x1b20ec[_0x647d('0x31')],_0x398c33['filters']));if(_0x1b20ec[_0x647d('0x31')][_0x647d('0x3e')]){_0x31be11['where']=_[_0x647d('0x3f')](_0x31be11[_0x647d('0x3c')],{'$or':_['map'](_0x3fd97f,function(_0x3231bb){if(_0x3231bb[_0x647d('0x2e')]!==_0x647d('0x40')){var _0xb6c9f6={};_0xb6c9f6[_0x3231bb[_0x647d('0x2b')]]={'$like':'%'+_0x1b20ec[_0x647d('0x31')][_0x647d('0x3e')]+'%'};return _0xb6c9f6;}})});}_0x31be11=_[_0x647d('0x3f')]({},_0x31be11,_0x1b20ec[_0x647d('0x41')]);var _0x24470c={'where':_0x31be11[_0x647d('0x3c')]};return db[_0x647d('0x42')][_0x647d('0x1f')](_0x24470c)[_0x647d('0x28')](function(_0x1c700d){_0x24356c[_0x647d('0x1f')]=_0x1c700d;if(_0x1b20ec['query']['includeAll']){_0x31be11['include']=[{'all':!![]}];}return db[_0x647d('0x42')]['findAll'](_0x31be11);})[_0x647d('0x28')](function(_0x379bad){_0x24356c['rows']=_0x379bad;return _0x24356c;})[_0x647d('0x28')](respondWithFilteredResult(_0x11a0c1,_0x31be11))[_0x647d('0x43')](handleError(_0x11a0c1,null));};exports[_0x647d('0x44')]=function(_0x54d25d,_0x4968ca){var _0x38f079={'raw':!![],'where':{'id':_0x54d25d[_0x647d('0x45')]['id']}},_0x56993={};_0x56993[_0x647d('0x35')]=_['keys'](db['OpenchannelQueueReport'][_0x647d('0x46')]);_0x56993[_0x647d('0x31')]=_[_0x647d('0x47')](_0x54d25d[_0x647d('0x31')]);_0x56993[_0x647d('0x32')]=_['intersection'](_0x56993[_0x647d('0x35')],_0x56993[_0x647d('0x31')]);_0x38f079[_0x647d('0x34')]=_['intersection'](_0x56993['model'],qs['fields'](_0x54d25d[_0x647d('0x31')][_0x647d('0x36')]));_0x38f079[_0x647d('0x34')]=_0x38f079[_0x647d('0x34')][_0x647d('0x37')]?_0x38f079[_0x647d('0x34')]:_0x56993[_0x647d('0x35')];if(_0x54d25d['query'][_0x647d('0x48')]){_0x38f079[_0x647d('0x49')]=[{'all':!![]}];}_0x38f079=_[_0x647d('0x3f')]({},_0x38f079,_0x54d25d[_0x647d('0x41')]);return db[_0x647d('0x42')][_0x647d('0x4a')](_0x38f079)[_0x647d('0x28')](handleEntityNotFound(_0x4968ca,null))[_0x647d('0x28')](respondWithResult(_0x4968ca,null))[_0x647d('0x43')](handleError(_0x4968ca,null));};exports[_0x647d('0x4b')]=function(_0x55e70a,_0x139ecd){return db[_0x647d('0x42')]['create'](_0x55e70a[_0x647d('0x4c')],{})[_0x647d('0x28')](respondWithResult(_0x139ecd,0xc9))[_0x647d('0x43')](handleError(_0x139ecd,null));};exports[_0x647d('0x4d')]=function(_0xefd6e7,_0x208b98){if(_0xefd6e7[_0x647d('0x4c')]['id']){delete _0xefd6e7[_0x647d('0x4c')]['id'];}return db[_0x647d('0x42')][_0x647d('0x4a')]({'where':{'id':_0xefd6e7['params']['id']}})[_0x647d('0x28')](handleEntityNotFound(_0x208b98,null))[_0x647d('0x28')](saveUpdates(_0xefd6e7[_0x647d('0x4c')],null))[_0x647d('0x28')](respondWithResult(_0x208b98,null))['catch'](handleError(_0x208b98,null));};exports[_0x647d('0x27')]=function(_0x86e11f,_0x2939e2){return db[_0x647d('0x42')][_0x647d('0x4a')]({'where':{'id':_0x86e11f[_0x647d('0x45')]['id']}})[_0x647d('0x28')](handleEntityNotFound(_0x2939e2,null))[_0x647d('0x28')](removeEntity(_0x2939e2,null))[_0x647d('0x43')](handleError(_0x2939e2,null));};exports[_0x647d('0x4e')]=function(_0x5a181f,_0x5606ea){return db[_0x647d('0x42')][_0x647d('0x4e')]()[_0x647d('0x28')](respondWithResult(_0x5606ea,null))[_0x647d('0x43')](handleError(_0x5606ea,null));}; \ No newline at end of file +var _0xcf66=['error','stack','name','send','index','OpenchannelQueueReport','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','create','body','update','find','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','then','destroy'];(function(_0x4025b4,_0x339dd1){var _0x3d5fad=function(_0x14a85a){while(--_0x14a85a){_0x4025b4['push'](_0x4025b4['shift']());}};_0x3d5fad(++_0x339dd1);}(_0xcf66,0x71));var _0x6cf6=function(_0x13e430,_0x3e7289){_0x13e430=_0x13e430-0x0;var _0x109166=_0xcf66[_0x13e430];return _0x109166;};'use strict';var pdf=require(_0x6cf6('0x0'));var emlformat=require(_0x6cf6('0x1'));var rimraf=require(_0x6cf6('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6cf6('0x3'));var rp=require(_0x6cf6('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6cf6('0x5'));var util=require(_0x6cf6('0x6'));var path=require('path');var sox=require(_0x6cf6('0x7'));var csv=require(_0x6cf6('0x8'));var ejs=require(_0x6cf6('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6cf6('0xa'));var crypto=require(_0x6cf6('0xb'));var jsforce=require(_0x6cf6('0xc'));var deskjs=require(_0x6cf6('0xd'));var toCsv=require(_0x6cf6('0x8'));var querystring=require(_0x6cf6('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6cf6('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6cf6('0x10'));var logger=require(_0x6cf6('0x11'))(_0x6cf6('0x12'));var utils=require(_0x6cf6('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5801a9,_0x3fdfea){_0x3fdfea=_0x3fdfea||0xcc;return function(_0x13b1ad){if(_0x13b1ad){return _0x5801a9[_0x6cf6('0x14')](_0x3fdfea);}return _0x5801a9[_0x6cf6('0x15')](_0x3fdfea)[_0x6cf6('0x16')]();};}function respondWithResult(_0x114c2c,_0x57909f){_0x57909f=_0x57909f||0xc8;return function(_0x32fe64){if(_0x32fe64){return _0x114c2c['status'](_0x57909f)[_0x6cf6('0x17')](_0x32fe64);}};}function respondWithFilteredResult(_0x18360e,_0x4b073f){return function(_0x40e413){if(_0x40e413){var _0x1b40f8=_0x40e413[_0x6cf6('0x18')],_0x2d23ab=_0x4b073f[_0x6cf6('0x19')],_0x74486a=_0x4b073f[_0x6cf6('0x19')]+_0x4b073f[_0x6cf6('0x1a')],_0x2b6d7b;if(_0x74486a>=_0x1b40f8){_0x74486a=_0x1b40f8;_0x2b6d7b=0xc8;}else{_0x2b6d7b=0xce;}_0x18360e[_0x6cf6('0x15')](_0x2b6d7b);return _0x18360e['set'](_0x6cf6('0x1b'),_0x2d23ab+'-'+_0x74486a+'/'+_0x1b40f8)[_0x6cf6('0x17')](_0x40e413);}return null;};}function patchUpdates(_0x22ab0){return function(_0x581164){try{jsonpatch[_0x6cf6('0x1c')](_0x581164,_0x22ab0,!![]);}catch(_0x39b4a2){return BPromise[_0x6cf6('0x1d')](_0x39b4a2);}return _0x581164[_0x6cf6('0x1e')]();};}function saveUpdates(_0x440634,_0x21e903){return function(_0x123993){if(_0x123993){return _0x123993['update'](_0x440634)[_0x6cf6('0x1f')](function(_0x306a64){return _0x306a64;});}return null;};}function removeEntity(_0x1add7a,_0x380a40){return function(_0x5cba3a){if(_0x5cba3a){return _0x5cba3a[_0x6cf6('0x20')]()[_0x6cf6('0x1f')](function(){_0x1add7a[_0x6cf6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b30e0,_0x276225){return function(_0x59f838){if(!_0x59f838){_0x5b30e0[_0x6cf6('0x14')](0x194);}return _0x59f838;};}function handleError(_0x18c8cd,_0x14ae3e){_0x14ae3e=_0x14ae3e||0x1f4;return function(_0x448f26){logger[_0x6cf6('0x21')](_0x448f26[_0x6cf6('0x22')]);if(_0x448f26[_0x6cf6('0x23')]){delete _0x448f26['name'];}_0x18c8cd[_0x6cf6('0x15')](_0x14ae3e)[_0x6cf6('0x24')](_0x448f26);};}exports[_0x6cf6('0x25')]=function(_0x558405,_0xf4eec5){var _0x2e56ca={},_0x2224db={},_0x1f5a88={'count':0x0,'rows':[]};var _0x5c9236=_['map'](db[_0x6cf6('0x26')][_0x6cf6('0x27')],function(_0x57099f){return{'name':_0x57099f[_0x6cf6('0x28')],'type':_0x57099f['type'][_0x6cf6('0x29')]};});_0x2224db['model']=_['map'](_0x5c9236,'name');_0x2224db[_0x6cf6('0x2a')]=_[_0x6cf6('0x2b')](_0x558405[_0x6cf6('0x2a')]);_0x2224db[_0x6cf6('0x2c')]=_[_0x6cf6('0x2d')](_0x2224db['model'],_0x2224db[_0x6cf6('0x2a')]);_0x2e56ca[_0x6cf6('0x2e')]=_[_0x6cf6('0x2d')](_0x2224db['model'],qs[_0x6cf6('0x2f')](_0x558405[_0x6cf6('0x2a')][_0x6cf6('0x2f')]));_0x2e56ca[_0x6cf6('0x2e')]=_0x2e56ca[_0x6cf6('0x2e')][_0x6cf6('0x30')]?_0x2e56ca[_0x6cf6('0x2e')]:_0x2224db[_0x6cf6('0x31')];if(!_0x558405[_0x6cf6('0x2a')][_0x6cf6('0x32')](_0x6cf6('0x33'))){_0x2e56ca[_0x6cf6('0x1a')]=qs[_0x6cf6('0x1a')](_0x558405[_0x6cf6('0x2a')][_0x6cf6('0x1a')]);_0x2e56ca[_0x6cf6('0x19')]=qs[_0x6cf6('0x19')](_0x558405[_0x6cf6('0x2a')]['offset']);}_0x2e56ca[_0x6cf6('0x34')]=qs[_0x6cf6('0x35')](_0x558405[_0x6cf6('0x2a')][_0x6cf6('0x35')]);_0x2e56ca[_0x6cf6('0x36')]=qs[_0x6cf6('0x2c')](_[_0x6cf6('0x37')](_0x558405[_0x6cf6('0x2a')],_0x2224db[_0x6cf6('0x2c')]));if(_0x558405[_0x6cf6('0x2a')][_0x6cf6('0x38')]){_0x2e56ca['where']=_[_0x6cf6('0x39')](_0x2e56ca[_0x6cf6('0x36')],{'$or':_[_0x6cf6('0x3a')](_0x5c9236,function(_0x43f2bf){if(_0x43f2bf[_0x6cf6('0x3b')]!==_0x6cf6('0x3c')){var _0x2f0120={};_0x2f0120[_0x43f2bf[_0x6cf6('0x23')]]={'$like':'%'+_0x558405[_0x6cf6('0x2a')]['filter']+'%'};return _0x2f0120;}})});}_0x2e56ca=_[_0x6cf6('0x39')]({},_0x2e56ca,_0x558405[_0x6cf6('0x3d')]);var _0x3a0cb1={'where':_0x2e56ca[_0x6cf6('0x36')]};return db[_0x6cf6('0x26')][_0x6cf6('0x18')](_0x3a0cb1)[_0x6cf6('0x1f')](function(_0x9de05b){_0x1f5a88[_0x6cf6('0x18')]=_0x9de05b;if(_0x558405['query'][_0x6cf6('0x3e')]){_0x2e56ca['include']=[{'all':!![]}];}return db[_0x6cf6('0x26')][_0x6cf6('0x3f')](_0x2e56ca);})[_0x6cf6('0x1f')](function(_0x1ce0be){_0x1f5a88[_0x6cf6('0x40')]=_0x1ce0be;return _0x1f5a88;})[_0x6cf6('0x1f')](respondWithFilteredResult(_0xf4eec5,_0x2e56ca))[_0x6cf6('0x41')](handleError(_0xf4eec5,null));};exports[_0x6cf6('0x42')]=function(_0x492381,_0x2e8ea2){var _0x335dce={'raw':!![],'where':{'id':_0x492381[_0x6cf6('0x43')]['id']}},_0x52c417={};_0x52c417[_0x6cf6('0x31')]=_[_0x6cf6('0x2b')](db['OpenchannelQueueReport'][_0x6cf6('0x27')]);_0x52c417[_0x6cf6('0x2a')]=_['keys'](_0x492381[_0x6cf6('0x2a')]);_0x52c417[_0x6cf6('0x2c')]=_[_0x6cf6('0x2d')](_0x52c417[_0x6cf6('0x31')],_0x52c417[_0x6cf6('0x2a')]);_0x335dce[_0x6cf6('0x2e')]=_[_0x6cf6('0x2d')](_0x52c417['model'],qs[_0x6cf6('0x2f')](_0x492381['query'][_0x6cf6('0x2f')]));_0x335dce[_0x6cf6('0x2e')]=_0x335dce['attributes'][_0x6cf6('0x30')]?_0x335dce[_0x6cf6('0x2e')]:_0x52c417[_0x6cf6('0x31')];if(_0x492381[_0x6cf6('0x2a')][_0x6cf6('0x3e')]){_0x335dce['include']=[{'all':!![]}];}_0x335dce=_[_0x6cf6('0x39')]({},_0x335dce,_0x492381[_0x6cf6('0x3d')]);return db[_0x6cf6('0x26')]['find'](_0x335dce)[_0x6cf6('0x1f')](handleEntityNotFound(_0x2e8ea2,null))[_0x6cf6('0x1f')](respondWithResult(_0x2e8ea2,null))[_0x6cf6('0x41')](handleError(_0x2e8ea2,null));};exports['create']=function(_0x2b4ac5,_0x5c08b3){return db['OpenchannelQueueReport'][_0x6cf6('0x44')](_0x2b4ac5[_0x6cf6('0x45')],{})[_0x6cf6('0x1f')](respondWithResult(_0x5c08b3,0xc9))[_0x6cf6('0x41')](handleError(_0x5c08b3,null));};exports[_0x6cf6('0x46')]=function(_0x311745,_0x28629d){if(_0x311745[_0x6cf6('0x45')]['id']){delete _0x311745[_0x6cf6('0x45')]['id'];}return db[_0x6cf6('0x26')][_0x6cf6('0x47')]({'where':{'id':_0x311745[_0x6cf6('0x43')]['id']}})[_0x6cf6('0x1f')](handleEntityNotFound(_0x28629d,null))['then'](saveUpdates(_0x311745[_0x6cf6('0x45')],null))[_0x6cf6('0x1f')](respondWithResult(_0x28629d,null))['catch'](handleError(_0x28629d,null));};exports['destroy']=function(_0x10047a,_0x17dd6e){return db[_0x6cf6('0x26')][_0x6cf6('0x47')]({'where':{'id':_0x10047a[_0x6cf6('0x43')]['id']}})[_0x6cf6('0x1f')](handleEntityNotFound(_0x17dd6e,null))['then'](removeEntity(_0x17dd6e,null))[_0x6cf6('0x41')](handleError(_0x17dd6e,null));};exports[_0x6cf6('0x48')]=function(_0x2503dc,_0x52122b){return db['OpenchannelQueueReport'][_0x6cf6('0x48')]()[_0x6cf6('0x1f')](respondWithResult(_0x52122b,null))[_0x6cf6('0x41')](handleError(_0x52122b,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 2da5784..619e5dc 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 _0x2caf=['rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','uniqueid','api','bluebird','request-promise','path'];(function(_0x323c7e,_0x3d16ec){var _0x2b0f72=function(_0x5a2310){while(--_0x5a2310){_0x323c7e['push'](_0x323c7e['shift']());}};_0x2b0f72(++_0x3d16ec);}(_0x2caf,0x6a));var _0xf2ca=function(_0x5bac04,_0xf50ac){_0x5bac04=_0x5bac04-0x0;var _0x25a024=_0x2caf[_0x5bac04];return _0x25a024;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xf2ca('0x0'));var moment=require('moment');var BPromise=require(_0xf2ca('0x1'));var rp=require(_0xf2ca('0x2'));var fs=require('fs');var path=require(_0xf2ca('0x3'));var rimraf=require(_0xf2ca('0x4'));var config=require(_0xf2ca('0x5'));var attributes=require(_0xf2ca('0x6'));module[_0xf2ca('0x7')]=function(_0x51372a,_0x8ce770){return _0x51372a[_0xf2ca('0x8')](_0xf2ca('0x9'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xf2ca('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2ce1=['../../config/environment','exports','OpenchannelQueueReport','uniqueid','api','moment','bluebird','request-promise','rimraf'];(function(_0x53431a,_0x5be6fd){var _0x40f61b=function(_0x56f5f5){while(--_0x56f5f5){_0x53431a['push'](_0x53431a['shift']());}};_0x40f61b(++_0x5be6fd);}(_0x2ce1,0x8b));var _0x12ce=function(_0x2cfb38,_0x1fd697){_0x2cfb38=_0x2cfb38-0x0;var _0xf2c879=_0x2ce1[_0x2cfb38];return _0xf2c879;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x12ce('0x0'));var moment=require(_0x12ce('0x1'));var BPromise=require(_0x12ce('0x2'));var rp=require(_0x12ce('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x12ce('0x4'));var config=require(_0x12ce('0x5'));var attributes=require('./openchannelQueueReport.attributes');module[_0x12ce('0x6')]=function(_0x15aa00,_0x36562a){return _0x15aa00['define'](_0x12ce('0x7'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0x12ce('0x8'),'fields':[_0x12ce('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index bd7370e..d82057c 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 _0xe2fe=['info','OpenchannelQueueReport,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','catch','UpdateOpenchannelQueueReport','update','attributes','limit','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then'];(function(_0x287ead,_0x5840ac){var _0x184020=function(_0x33f8b6){while(--_0x33f8b6){_0x287ead['push'](_0x287ead['shift']());}};_0x184020(++_0x5840ac);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xee2f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee2f('0x2'));var db=require(_0xee2f('0x3'))['db'];var utils=require(_0xee2f('0x4'));var logger=require(_0xee2f('0x5'))(_0xee2f('0x6'));var config=require('../../config/environment');var jayson=require(_0xee2f('0x7'));var client=jayson[_0xee2f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1533a0,_0x2e1c8c,_0x5a7975){return new BPromise(function(_0x3c4095,_0x5ea796){return client[_0xee2f('0x9')](_0x1533a0,_0x5a7975)[_0xee2f('0xa')](function(_0x53f7dd){logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,'request\x20sent');logger['debug']('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x2e1c8c,'request\x20sent',JSON[_0xee2f('0xd')](_0x53f7dd));if(_0x53f7dd['error']){if(_0x53f7dd['error']['code']===0x1f4){logger[_0xee2f('0xe')](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);return _0x5ea796(_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);}logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd['error'][_0xee2f('0xf')]);return _0x3c4095(_0x53f7dd[_0xee2f('0xe')]['message']);}else{logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,_0xee2f('0x10'));_0x3c4095(_0x53f7dd[_0xee2f('0x11')][_0xee2f('0xf')]);}})['catch'](function(_0x3f6372){logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x3f6372);_0x5ea796(_0x3f6372);});});}exports[_0xee2f('0x12')]=function(_0x502eb6){var _0x550da7=this;return new Promise(function(_0x40b5bc,_0x5a5078){return db[_0xee2f('0x13')][_0xee2f('0x14')](_0x502eb6[_0xee2f('0x15')],{'raw':_0x502eb6['options']?_0x502eb6[_0xee2f('0x16')][_0xee2f('0x17')]===undefined?!![]:![]:!![]})[_0xee2f('0xa')](function(_0x21fdf4){logger[_0xee2f('0xb')]('CreateOpenchannelQueueReport',_0x502eb6);logger['debug'](_0xee2f('0x12'),_0x502eb6,JSON[_0xee2f('0xd')](_0x21fdf4));_0x40b5bc(_0x21fdf4);})[_0xee2f('0x18')](function(_0x203b2f){logger[_0xee2f('0xe')](_0xee2f('0x12'),_0x203b2f[_0xee2f('0xf')],_0x502eb6);_0x5a5078(_0x550da7['error'](0x1f4,_0x203b2f[_0xee2f('0xf')]));});});};exports[_0xee2f('0x19')]=function(_0x15ceda){var _0x70e308=this;return new Promise(function(_0x820101,_0xf77cf5){return db[_0xee2f('0x13')][_0xee2f('0x1a')](_0x15ceda[_0xee2f('0x15')],{'raw':_0x15ceda[_0xee2f('0x16')]?_0x15ceda[_0xee2f('0x16')][_0xee2f('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x15ceda[_0xee2f('0x16')]?_0x15ceda[_0xee2f('0x16')]['where']||null:null,'attributes':_0x15ceda['options']?_0x15ceda['options'][_0xee2f('0x1b')]||null:null,'limit':_0x15ceda[_0xee2f('0x16')]?_0x15ceda[_0xee2f('0x16')][_0xee2f('0x1c')]||null:null})[_0xee2f('0xa')](function(_0x3737fd){logger['info'](_0xee2f('0x19'),_0x15ceda);logger['debug'](_0xee2f('0x19'),_0x15ceda,JSON[_0xee2f('0xd')](_0x3737fd));_0x820101(_0x3737fd);})[_0xee2f('0x18')](function(_0x8a0bf7){logger[_0xee2f('0xe')]('UpdateOpenchannelQueueReport',_0x8a0bf7[_0xee2f('0xf')],_0x15ceda);_0xf77cf5(_0x70e308[_0xee2f('0xe')](0x1f4,_0x8a0bf7['message']));});});}; \ No newline at end of file +var _0xdf5d=['update','body','where','attributes','limit','UpdateOpenchannelQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','options','raw','debug'];(function(_0x12e073,_0x4d43db){var _0x267748=function(_0x381284){while(--_0x381284){_0x12e073['push'](_0x12e073['shift']());}};_0x267748(++_0x4d43db);}(_0xdf5d,0x126));var _0xddf5=function(_0x46137a,_0x1175fc){_0x46137a=_0x46137a-0x0;var _0x8990ce=_0xdf5d[_0x46137a];return _0x8990ce;};'use strict';var _=require(_0xddf5('0x0'));var util=require(_0xddf5('0x1'));var moment=require(_0xddf5('0x2'));var BPromise=require(_0xddf5('0x3'));var rs=require(_0xddf5('0x4'));var fs=require('fs');var Redis=require(_0xddf5('0x5'));var db=require(_0xddf5('0x6'))['db'];var utils=require(_0xddf5('0x7'));var logger=require('../../config/logger')(_0xddf5('0x8'));var config=require(_0xddf5('0x9'));var jayson=require(_0xddf5('0xa'));var client=jayson[_0xddf5('0xb')][_0xddf5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x228fd4,_0xf3a209,_0xa029d2){return new BPromise(function(_0x3a1e13,_0x3df89){return client[_0xddf5('0xd')](_0x228fd4,_0xa029d2)[_0xddf5('0xe')](function(_0x36b306){logger[_0xddf5('0xf')](_0xddf5('0x10'),_0xf3a209,_0xddf5('0x11'));logger['debug'](_0xddf5('0x12'),_0xf3a209,_0xddf5('0x11'),JSON[_0xddf5('0x13')](_0x36b306));if(_0x36b306[_0xddf5('0x14')]){if(_0x36b306[_0xddf5('0x14')][_0xddf5('0x15')]===0x1f4){logger[_0xddf5('0x14')](_0xddf5('0x10'),_0xf3a209,_0x36b306['error']['message']);return _0x3df89(_0x36b306[_0xddf5('0x14')][_0xddf5('0x16')]);}logger[_0xddf5('0x14')](_0xddf5('0x10'),_0xf3a209,_0x36b306[_0xddf5('0x14')][_0xddf5('0x16')]);return _0x3a1e13(_0x36b306[_0xddf5('0x14')][_0xddf5('0x16')]);}else{logger['info'](_0xddf5('0x10'),_0xf3a209,_0xddf5('0x11'));_0x3a1e13(_0x36b306[_0xddf5('0x17')][_0xddf5('0x16')]);}})[_0xddf5('0x18')](function(_0x5ef952){logger[_0xddf5('0x14')]('OpenchannelQueueReport,\x20%s,\x20%s',_0xf3a209,_0x5ef952);_0x3df89(_0x5ef952);});});}exports[_0xddf5('0x19')]=function(_0x50c1ed){var _0x4b4f9a=this;return new Promise(function(_0x3d61df,_0x44db09){return db[_0xddf5('0x1a')]['create'](_0x50c1ed['body'],{'raw':_0x50c1ed[_0xddf5('0x1b')]?_0x50c1ed[_0xddf5('0x1b')][_0xddf5('0x1c')]===undefined?!![]:![]:!![]})[_0xddf5('0xe')](function(_0x5e5537){logger['info'](_0xddf5('0x19'),_0x50c1ed);logger[_0xddf5('0x1d')](_0xddf5('0x19'),_0x50c1ed,JSON['stringify'](_0x5e5537));_0x3d61df(_0x5e5537);})[_0xddf5('0x18')](function(_0x39212c){logger[_0xddf5('0x14')](_0xddf5('0x19'),_0x39212c['message'],_0x50c1ed);_0x44db09(_0x4b4f9a[_0xddf5('0x14')](0x1f4,_0x39212c[_0xddf5('0x16')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x300923){var _0x4267aa=this;return new Promise(function(_0x34539e,_0x12ece7){return db['OpenchannelQueueReport'][_0xddf5('0x1e')](_0x300923[_0xddf5('0x1f')],{'raw':_0x300923[_0xddf5('0x1b')]?_0x300923[_0xddf5('0x1b')][_0xddf5('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x300923['options']?_0x300923[_0xddf5('0x1b')][_0xddf5('0x20')]||null:null,'attributes':_0x300923['options']?_0x300923['options'][_0xddf5('0x21')]||null:null,'limit':_0x300923[_0xddf5('0x1b')]?_0x300923[_0xddf5('0x1b')][_0xddf5('0x22')]||null:null})[_0xddf5('0xe')](function(_0x1a476d){logger['info'](_0xddf5('0x23'),_0x300923);logger[_0xddf5('0x1d')]('UpdateOpenchannelQueueReport',_0x300923,JSON[_0xddf5('0x13')](_0x1a476d));_0x34539e(_0x1a476d);})[_0xddf5('0x18')](function(_0x281307){logger['error']('UpdateOpenchannelQueueReport',_0x281307['message'],_0x300923);_0x12ece7(_0x4267aa[_0xddf5('0x14')](0x1f4,_0x281307[_0xddf5('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 23171f5..2420d49 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 _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'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 auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);module[_0x0a9e('0xf')]=router; \ No newline at end of file +var _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x4179e2,_0xf2dbb){var _0x24cb50=function(_0x3b7899){while(--_0x3b7899){_0x4179e2['push'](_0x4179e2['shift']());}};_0x24cb50(++_0xf2dbb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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 auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);module[_0x0a9e('0xf')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 61b5ce8..c5f1e67 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 _0x128e=['agent','queue','DATE','sequelize','exports','STRING','ENUM','account'];(function(_0x4808b4,_0x2540a8){var _0x328547=function(_0x51a6de){while(--_0x51a6de){_0x4808b4['push'](_0x4808b4['shift']());}};_0x328547(++_0x2540a8);}(_0x128e,0xd3));var _0xe128=function(_0xf777e5,_0x51818f){_0xf777e5=_0xf777e5-0x0;var _0x438ec9=_0x128e[_0xf777e5];return _0x438ec9;};'use strict';var moment=require('moment');var Sequelize=require(_0xe128('0x0'));module[_0xe128('0x1')]={'uniqueid':{'type':Sequelize[_0xe128('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xe128('0x3')](_0xe128('0x4'),_0xe128('0x5'),_0xe128('0x6')),'allowNull':![],'defaultValue':_0xe128('0x6')},'transferredAt':{'type':Sequelize[_0xe128('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x3ac8=['exports','ENUM','account','queue','DATE','NOW','moment','sequelize'];(function(_0x1be149,_0x5f367e){var _0x3694c1=function(_0x209678){while(--_0x209678){_0x1be149['push'](_0x1be149['shift']());}};_0x3694c1(++_0x5f367e);}(_0x3ac8,0x1be));var _0x83ac=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3ac8[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x83ac('0x0'));var Sequelize=require(_0x83ac('0x1'));module[_0x83ac('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x83ac('0x3')](_0x83ac('0x4'),'agent',_0x83ac('0x5')),'allowNull':![],'defaultValue':_0x83ac('0x5')},'transferredAt':{'type':Sequelize[_0x83ac('0x6')],'allowNull':![],'defaultValue':Sequelize[_0x83ac('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index d6f9ac7..0b4b109 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 _0x1272=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','end','error','name','map','OpenchannelTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','options','find','catch','create','body','params','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','util','path','crypto','jsforce','desk.js','to-csv'];(function(_0x4b7b62,_0x4920a9){var _0x2280df=function(_0x21e1f8){while(--_0x21e1f8){_0x4b7b62['push'](_0x4b7b62['shift']());}};_0x2280df(++_0x4920a9);}(_0x1272,0x105));var _0x2127=function(_0x1e440c,_0x3b2ca5){_0x1e440c=_0x1e440c-0x0;var _0x3cfab5=_0x1272[_0x1e440c];return _0x3cfab5;};'use strict';var pdf=require(_0x2127('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2127('0x1'));var zipdir=require(_0x2127('0x2'));var jsonpatch=require(_0x2127('0x3'));var rp=require(_0x2127('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2127('0x5'));var path=require(_0x2127('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x2127('0x7'));var jsforce=require(_0x2127('0x8'));var deskjs=require(_0x2127('0x9'));var toCsv=require(_0x2127('0xa'));var querystring=require(_0x2127('0xb'));var Papa=require(_0x2127('0xc'));var Redis=require(_0x2127('0xd'));var authService=require(_0x2127('0xe'));var qs=require(_0x2127('0xf'));var as=require(_0x2127('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2127('0x11'))('api');var utils=require(_0x2127('0x12'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x34aa28,_0x317325){_0x317325=_0x317325||0xcc;return function(_0x3c02bf){if(_0x3c02bf){return _0x34aa28[_0x2127('0x13')](_0x317325);}return _0x34aa28[_0x2127('0x14')](_0x317325)['end']();};}function respondWithResult(_0x511545,_0x173bdd){_0x173bdd=_0x173bdd||0xc8;return function(_0x4e9969){if(_0x4e9969){return _0x511545[_0x2127('0x14')](_0x173bdd)[_0x2127('0x15')](_0x4e9969);}};}function respondWithFilteredResult(_0x4d59bd,_0x4698ac){return function(_0xa5ed60){if(_0xa5ed60){var _0x567664=_0xa5ed60[_0x2127('0x16')],_0x103399=_0x4698ac['offset'],_0x5f115e=_0x4698ac[_0x2127('0x17')]+_0x4698ac['limit'],_0xd28490;if(_0x5f115e>=_0x567664){_0x5f115e=_0x567664;_0xd28490=0xc8;}else{_0xd28490=0xce;}_0x4d59bd[_0x2127('0x14')](_0xd28490);return _0x4d59bd[_0x2127('0x18')](_0x2127('0x19'),_0x103399+'-'+_0x5f115e+'/'+_0x567664)[_0x2127('0x15')](_0xa5ed60);}return null;};}function patchUpdates(_0x104714){return function(_0x522545){try{jsonpatch[_0x2127('0x1a')](_0x522545,_0x104714,!![]);}catch(_0x156647){return BPromise[_0x2127('0x1b')](_0x156647);}return _0x522545[_0x2127('0x1c')]();};}function saveUpdates(_0x2e8a6c,_0x3bc408){return function(_0x1935be){if(_0x1935be){return _0x1935be[_0x2127('0x1d')](_0x2e8a6c)['then'](function(_0x428563){return _0x428563;});}return null;};}function removeEntity(_0x26d345,_0xd22945){return function(_0x55e084){if(_0x55e084){return _0x55e084[_0x2127('0x1e')]()[_0x2127('0x1f')](function(){_0x26d345[_0x2127('0x14')](0xcc)[_0x2127('0x20')]();});}};}function handleEntityNotFound(_0xe44196,_0x1cb930){return function(_0x29f0dd){if(!_0x29f0dd){_0xe44196[_0x2127('0x13')](0x194);}return _0x29f0dd;};}function handleError(_0xbd1e35,_0x4d4db1){_0x4d4db1=_0x4d4db1||0x1f4;return function(_0x191c93){logger[_0x2127('0x21')](_0x191c93['stack']);if(_0x191c93[_0x2127('0x22')]){delete _0x191c93[_0x2127('0x22')];}_0xbd1e35[_0x2127('0x14')](_0x4d4db1)['send'](_0x191c93);};}exports['index']=function(_0x1b6e95,_0x158dff){var _0x5884c5={},_0x1872be={},_0xc64bc2={'count':0x0,'rows':[]};var _0x308763=_[_0x2127('0x23')](db[_0x2127('0x24')][_0x2127('0x25')],function(_0x1deb53){return{'name':_0x1deb53[_0x2127('0x26')],'type':_0x1deb53[_0x2127('0x27')][_0x2127('0x28')]};});_0x1872be[_0x2127('0x29')]=_[_0x2127('0x23')](_0x308763,'name');_0x1872be[_0x2127('0x2a')]=_[_0x2127('0x2b')](_0x1b6e95[_0x2127('0x2a')]);_0x1872be[_0x2127('0x2c')]=_[_0x2127('0x2d')](_0x1872be[_0x2127('0x29')],_0x1872be[_0x2127('0x2a')]);_0x5884c5['attributes']=_[_0x2127('0x2d')](_0x1872be[_0x2127('0x29')],qs['fields'](_0x1b6e95['query'][_0x2127('0x2e')]));_0x5884c5['attributes']=_0x5884c5[_0x2127('0x2f')][_0x2127('0x30')]?_0x5884c5[_0x2127('0x2f')]:_0x1872be[_0x2127('0x29')];if(!_0x1b6e95['query'][_0x2127('0x31')](_0x2127('0x32'))){_0x5884c5[_0x2127('0x33')]=qs[_0x2127('0x33')](_0x1b6e95[_0x2127('0x2a')][_0x2127('0x33')]);_0x5884c5[_0x2127('0x17')]=qs[_0x2127('0x17')](_0x1b6e95[_0x2127('0x2a')][_0x2127('0x17')]);}_0x5884c5[_0x2127('0x34')]=qs[_0x2127('0x35')](_0x1b6e95[_0x2127('0x2a')][_0x2127('0x35')]);_0x5884c5[_0x2127('0x36')]=qs[_0x2127('0x2c')](_[_0x2127('0x37')](_0x1b6e95[_0x2127('0x2a')],_0x1872be[_0x2127('0x2c')]));if(_0x1b6e95[_0x2127('0x2a')][_0x2127('0x38')]){_0x5884c5[_0x2127('0x36')]=_[_0x2127('0x39')](_0x5884c5[_0x2127('0x36')],{'$or':_[_0x2127('0x23')](_0x308763,function(_0xe93359){if(_0xe93359[_0x2127('0x27')]!==_0x2127('0x3a')){var _0x4db7d8={};_0x4db7d8[_0xe93359[_0x2127('0x22')]]={'$like':'%'+_0x1b6e95[_0x2127('0x2a')][_0x2127('0x38')]+'%'};return _0x4db7d8;}})});}_0x5884c5=_[_0x2127('0x39')]({},_0x5884c5,_0x1b6e95['options']);var _0x512852={'where':_0x5884c5[_0x2127('0x36')]};return db[_0x2127('0x24')]['count'](_0x512852)[_0x2127('0x1f')](function(_0x81c6c8){_0xc64bc2[_0x2127('0x16')]=_0x81c6c8;if(_0x1b6e95['query'][_0x2127('0x3b')]){_0x5884c5[_0x2127('0x3c')]=[{'all':!![]}];}return db['OpenchannelTransferReport']['findAll'](_0x5884c5);})[_0x2127('0x1f')](function(_0x34959d){_0xc64bc2[_0x2127('0x3d')]=_0x34959d;return _0xc64bc2;})[_0x2127('0x1f')](respondWithFilteredResult(_0x158dff,_0x5884c5))['catch'](handleError(_0x158dff,null));};exports['show']=function(_0x2a22c5,_0xb9e82){var _0x245439={'raw':!![],'where':{'id':_0x2a22c5['params']['id']}},_0x61de16={};_0x61de16[_0x2127('0x29')]=_[_0x2127('0x2b')](db[_0x2127('0x24')][_0x2127('0x25')]);_0x61de16[_0x2127('0x2a')]=_[_0x2127('0x2b')](_0x2a22c5[_0x2127('0x2a')]);_0x61de16[_0x2127('0x2c')]=_[_0x2127('0x2d')](_0x61de16[_0x2127('0x29')],_0x61de16[_0x2127('0x2a')]);_0x245439[_0x2127('0x2f')]=_[_0x2127('0x2d')](_0x61de16[_0x2127('0x29')],qs[_0x2127('0x2e')](_0x2a22c5[_0x2127('0x2a')][_0x2127('0x2e')]));_0x245439['attributes']=_0x245439[_0x2127('0x2f')]['length']?_0x245439[_0x2127('0x2f')]:_0x61de16['model'];if(_0x2a22c5[_0x2127('0x2a')][_0x2127('0x3b')]){_0x245439['include']=[{'all':!![]}];}_0x245439=_[_0x2127('0x39')]({},_0x245439,_0x2a22c5[_0x2127('0x3e')]);return db[_0x2127('0x24')][_0x2127('0x3f')](_0x245439)[_0x2127('0x1f')](handleEntityNotFound(_0xb9e82,null))[_0x2127('0x1f')](respondWithResult(_0xb9e82,null))[_0x2127('0x40')](handleError(_0xb9e82,null));};exports[_0x2127('0x41')]=function(_0x28de18,_0xb5916f){return db['OpenchannelTransferReport'][_0x2127('0x41')](_0x28de18['body'],{})[_0x2127('0x1f')](respondWithResult(_0xb5916f,0xc9))['catch'](handleError(_0xb5916f,null));};exports[_0x2127('0x1d')]=function(_0x567e0f,_0x486d35){if(_0x567e0f[_0x2127('0x42')]['id']){delete _0x567e0f[_0x2127('0x42')]['id'];}return db['OpenchannelTransferReport']['find']({'where':{'id':_0x567e0f['params']['id']}})['then'](handleEntityNotFound(_0x486d35,null))[_0x2127('0x1f')](saveUpdates(_0x567e0f[_0x2127('0x42')],null))[_0x2127('0x1f')](respondWithResult(_0x486d35,null))[_0x2127('0x40')](handleError(_0x486d35,null));};exports[_0x2127('0x1e')]=function(_0x11f1f1,_0x4155c9){return db[_0x2127('0x24')][_0x2127('0x3f')]({'where':{'id':_0x11f1f1[_0x2127('0x43')]['id']}})[_0x2127('0x1f')](handleEntityNotFound(_0x4155c9,null))[_0x2127('0x1f')](removeEntity(_0x4155c9,null))[_0x2127('0x40')](handleError(_0x4155c9,null));};exports['describe']=function(_0x266984,_0x37da0b){return db[_0x2127('0x24')]['describe']()['then'](respondWithResult(_0x37da0b,null))[_0x2127('0x40')](handleError(_0x37da0b,null));}; \ No newline at end of file +var _0xda4d=['keys','catch','create','body','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','count','offset','limit','set','Content-Range','json','apply','reject','update','then','destroy','error','name','send','index','map','OpenchannelTransferReport','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','findAll','rows','show','params'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0xda4d,0xdd));var _0xdda4=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xda4d[_0xbca1b1];return _0x4e1686;};'use strict';var pdf=require(_0xdda4('0x0'));var emlformat=require(_0xdda4('0x1'));var rimraf=require(_0xdda4('0x2'));var zipdir=require(_0xdda4('0x3'));var jsonpatch=require(_0xdda4('0x4'));var rp=require('request-promise');var moment=require(_0xdda4('0x5'));var BPromise=require(_0xdda4('0x6'));var Mustache=require(_0xdda4('0x7'));var util=require(_0xdda4('0x8'));var path=require(_0xdda4('0x9'));var sox=require(_0xdda4('0xa'));var csv=require(_0xdda4('0xb'));var ejs=require(_0xdda4('0xc'));var fs=require('fs');var _=require(_0xdda4('0xd'));var squel=require(_0xdda4('0xe'));var crypto=require(_0xdda4('0xf'));var jsforce=require(_0xdda4('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xdda4('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xdda4('0x12'));var as=require(_0xdda4('0x13'));var hardwareService=require(_0xdda4('0x14'));var logger=require(_0xdda4('0x15'))(_0xdda4('0x16'));var utils=require(_0xdda4('0x17'));var config=require(_0xdda4('0x18'));var db=require(_0xdda4('0x19'))['db'];function respondWithStatusCode(_0x211da3,_0x2218a8){_0x2218a8=_0x2218a8||0xcc;return function(_0x1bf498){if(_0x1bf498){return _0x211da3['sendStatus'](_0x2218a8);}return _0x211da3[_0xdda4('0x1a')](_0x2218a8)['end']();};}function respondWithResult(_0xbb2657,_0x363b37){_0x363b37=_0x363b37||0xc8;return function(_0xc7286){if(_0xc7286){return _0xbb2657[_0xdda4('0x1a')](_0x363b37)['json'](_0xc7286);}};}function respondWithFilteredResult(_0x5d2c9e,_0x3c47a7){return function(_0xc3ca97){if(_0xc3ca97){var _0x46102b=_0xc3ca97[_0xdda4('0x1b')],_0x50b764=_0x3c47a7[_0xdda4('0x1c')],_0x3cad0f=_0x3c47a7[_0xdda4('0x1c')]+_0x3c47a7[_0xdda4('0x1d')],_0x2869a5;if(_0x3cad0f>=_0x46102b){_0x3cad0f=_0x46102b;_0x2869a5=0xc8;}else{_0x2869a5=0xce;}_0x5d2c9e[_0xdda4('0x1a')](_0x2869a5);return _0x5d2c9e[_0xdda4('0x1e')](_0xdda4('0x1f'),_0x50b764+'-'+_0x3cad0f+'/'+_0x46102b)[_0xdda4('0x20')](_0xc3ca97);}return null;};}function patchUpdates(_0x22610c){return function(_0x1e8b3e){try{jsonpatch[_0xdda4('0x21')](_0x1e8b3e,_0x22610c,!![]);}catch(_0x5d7ddb){return BPromise[_0xdda4('0x22')](_0x5d7ddb);}return _0x1e8b3e['save']();};}function saveUpdates(_0x3475f9,_0x29fd84){return function(_0x9e6d05){if(_0x9e6d05){return _0x9e6d05[_0xdda4('0x23')](_0x3475f9)[_0xdda4('0x24')](function(_0x5d304f){return _0x5d304f;});}return null;};}function removeEntity(_0x409333,_0xea0629){return function(_0x32bb25){if(_0x32bb25){return _0x32bb25[_0xdda4('0x25')]()[_0xdda4('0x24')](function(){_0x409333[_0xdda4('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4138a3,_0x144431){return function(_0x4b7a4f){if(!_0x4b7a4f){_0x4138a3['sendStatus'](0x194);}return _0x4b7a4f;};}function handleError(_0x69e3a5,_0x11f49e){_0x11f49e=_0x11f49e||0x1f4;return function(_0x2f66b9){logger[_0xdda4('0x26')](_0x2f66b9['stack']);if(_0x2f66b9[_0xdda4('0x27')]){delete _0x2f66b9[_0xdda4('0x27')];}_0x69e3a5[_0xdda4('0x1a')](_0x11f49e)[_0xdda4('0x28')](_0x2f66b9);};}exports[_0xdda4('0x29')]=function(_0x33057e,_0x4acaf2){var _0xf2f248={},_0x14b201={},_0x42a38d={'count':0x0,'rows':[]};var _0x564011=_[_0xdda4('0x2a')](db[_0xdda4('0x2b')][_0xdda4('0x2c')],function(_0x58e556){return{'name':_0x58e556[_0xdda4('0x2d')],'type':_0x58e556[_0xdda4('0x2e')]['key']};});_0x14b201[_0xdda4('0x2f')]=_[_0xdda4('0x2a')](_0x564011,_0xdda4('0x27'));_0x14b201[_0xdda4('0x30')]=_['keys'](_0x33057e[_0xdda4('0x30')]);_0x14b201[_0xdda4('0x31')]=_[_0xdda4('0x32')](_0x14b201[_0xdda4('0x2f')],_0x14b201[_0xdda4('0x30')]);_0xf2f248[_0xdda4('0x33')]=_[_0xdda4('0x32')](_0x14b201['model'],qs[_0xdda4('0x34')](_0x33057e['query'][_0xdda4('0x34')]));_0xf2f248['attributes']=_0xf2f248['attributes'][_0xdda4('0x35')]?_0xf2f248['attributes']:_0x14b201[_0xdda4('0x2f')];if(!_0x33057e[_0xdda4('0x30')]['hasOwnProperty'](_0xdda4('0x36'))){_0xf2f248[_0xdda4('0x1d')]=qs[_0xdda4('0x1d')](_0x33057e[_0xdda4('0x30')][_0xdda4('0x1d')]);_0xf2f248[_0xdda4('0x1c')]=qs['offset'](_0x33057e[_0xdda4('0x30')][_0xdda4('0x1c')]);}_0xf2f248['order']=qs[_0xdda4('0x37')](_0x33057e['query'][_0xdda4('0x37')]);_0xf2f248['where']=qs['filters'](_[_0xdda4('0x38')](_0x33057e[_0xdda4('0x30')],_0x14b201[_0xdda4('0x31')]));if(_0x33057e[_0xdda4('0x30')][_0xdda4('0x39')]){_0xf2f248['where']=_[_0xdda4('0x3a')](_0xf2f248[_0xdda4('0x3b')],{'$or':_[_0xdda4('0x2a')](_0x564011,function(_0x25c6c2){if(_0x25c6c2[_0xdda4('0x2e')]!==_0xdda4('0x3c')){var _0xf25a58={};_0xf25a58[_0x25c6c2['name']]={'$like':'%'+_0x33057e[_0xdda4('0x30')][_0xdda4('0x39')]+'%'};return _0xf25a58;}})});}_0xf2f248=_[_0xdda4('0x3a')]({},_0xf2f248,_0x33057e[_0xdda4('0x3d')]);var _0x2c6b5e={'where':_0xf2f248[_0xdda4('0x3b')]};return db[_0xdda4('0x2b')][_0xdda4('0x1b')](_0x2c6b5e)['then'](function(_0xbcb53d){_0x42a38d['count']=_0xbcb53d;if(_0x33057e[_0xdda4('0x30')][_0xdda4('0x3e')]){_0xf2f248['include']=[{'all':!![]}];}return db[_0xdda4('0x2b')][_0xdda4('0x3f')](_0xf2f248);})[_0xdda4('0x24')](function(_0x13f9d8){_0x42a38d[_0xdda4('0x40')]=_0x13f9d8;return _0x42a38d;})['then'](respondWithFilteredResult(_0x4acaf2,_0xf2f248))['catch'](handleError(_0x4acaf2,null));};exports[_0xdda4('0x41')]=function(_0x16f3b5,_0x16479e){var _0x2689a5={'raw':!![],'where':{'id':_0x16f3b5[_0xdda4('0x42')]['id']}},_0x593765={};_0x593765[_0xdda4('0x2f')]=_['keys'](db[_0xdda4('0x2b')][_0xdda4('0x2c')]);_0x593765[_0xdda4('0x30')]=_[_0xdda4('0x43')](_0x16f3b5[_0xdda4('0x30')]);_0x593765[_0xdda4('0x31')]=_[_0xdda4('0x32')](_0x593765[_0xdda4('0x2f')],_0x593765[_0xdda4('0x30')]);_0x2689a5[_0xdda4('0x33')]=_[_0xdda4('0x32')](_0x593765['model'],qs[_0xdda4('0x34')](_0x16f3b5[_0xdda4('0x30')]['fields']));_0x2689a5[_0xdda4('0x33')]=_0x2689a5[_0xdda4('0x33')][_0xdda4('0x35')]?_0x2689a5['attributes']:_0x593765[_0xdda4('0x2f')];if(_0x16f3b5[_0xdda4('0x30')][_0xdda4('0x3e')]){_0x2689a5['include']=[{'all':!![]}];}_0x2689a5=_[_0xdda4('0x3a')]({},_0x2689a5,_0x16f3b5[_0xdda4('0x3d')]);return db[_0xdda4('0x2b')]['find'](_0x2689a5)[_0xdda4('0x24')](handleEntityNotFound(_0x16479e,null))[_0xdda4('0x24')](respondWithResult(_0x16479e,null))[_0xdda4('0x44')](handleError(_0x16479e,null));};exports[_0xdda4('0x45')]=function(_0x478f94,_0x5175ef){return db[_0xdda4('0x2b')][_0xdda4('0x45')](_0x478f94['body'],{})[_0xdda4('0x24')](respondWithResult(_0x5175ef,0xc9))[_0xdda4('0x44')](handleError(_0x5175ef,null));};exports['update']=function(_0x306c6b,_0x4a0aad){if(_0x306c6b[_0xdda4('0x46')]['id']){delete _0x306c6b[_0xdda4('0x46')]['id'];}return db[_0xdda4('0x2b')][_0xdda4('0x47')]({'where':{'id':_0x306c6b[_0xdda4('0x42')]['id']}})[_0xdda4('0x24')](handleEntityNotFound(_0x4a0aad,null))['then'](saveUpdates(_0x306c6b['body'],null))[_0xdda4('0x24')](respondWithResult(_0x4a0aad,null))[_0xdda4('0x44')](handleError(_0x4a0aad,null));};exports[_0xdda4('0x25')]=function(_0x5634af,_0x7d0992){return db['OpenchannelTransferReport'][_0xdda4('0x47')]({'where':{'id':_0x5634af[_0xdda4('0x42')]['id']}})['then'](handleEntityNotFound(_0x7d0992,null))[_0xdda4('0x24')](removeEntity(_0x7d0992,null))['catch'](handleError(_0x7d0992,null));};exports['describe']=function(_0x36be37,_0x1494b1){return db[_0xdda4('0x2b')]['describe']()['then'](respondWithResult(_0x1494b1,null))[_0xdda4('0x44')](handleError(_0x1494b1,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index a1bc780..e13060e 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 _0x8ed4=['request-promise','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','uniqueid','../../config/logger','bluebird'];(function(_0x1beee7,_0x139a11){var _0x58fd88=function(_0x35047e){while(--_0x35047e){_0x1beee7['push'](_0x1beee7['shift']());}};_0x58fd88(++_0x139a11);}(_0x8ed4,0x1ac));var _0x48ed=function(_0x1ae2b3,_0x498639){_0x1ae2b3=_0x1ae2b3-0x0;var _0x1d1123=_0x8ed4[_0x1ae2b3];return _0x1d1123;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x48ed('0x0'))('api');var moment=require('moment');var BPromise=require(_0x48ed('0x1'));var rp=require(_0x48ed('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x48ed('0x3'));var config=require(_0x48ed('0x4'));var attributes=require(_0x48ed('0x5'));module[_0x48ed('0x6')]=function(_0x3a7f47,_0x3f09ed){return _0x3a7f47[_0x48ed('0x7')](_0x48ed('0x8'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x48ed('0x9'),'fields':[_0x48ed('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a26=['define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports'];(function(_0x18f9d9,_0x13aa75){var _0x230fe5=function(_0x79f45d){while(--_0x79f45d){_0x18f9d9['push'](_0x18f9d9['shift']());}};_0x230fe5(++_0x13aa75);}(_0x7a26,0x1b6));var _0x67a2=function(_0x2c47fd,_0x1f4b94){_0x2c47fd=_0x2c47fd-0x0;var _0x31bc36=_0x7a26[_0x2c47fd];return _0x31bc36;};'use strict';var _=require(_0x67a2('0x0'));var util=require('util');var logger=require(_0x67a2('0x1'))(_0x67a2('0x2'));var moment=require(_0x67a2('0x3'));var BPromise=require(_0x67a2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x67a2('0x5'));var rimraf=require(_0x67a2('0x6'));var config=require(_0x67a2('0x7'));var attributes=require(_0x67a2('0x8'));module[_0x67a2('0x9')]=function(_0x12d533,_0x24f9ab){return _0x12d533[_0x67a2('0xa')](_0x67a2('0xb'),attributes,{'tableName':_0x67a2('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x67a2('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 3e059ff..4aa36e9 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 _0xd2d9=['http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x11ebe2,_0x8897df){var _0x446bf4=function(_0x127099){while(--_0x127099){_0x11ebe2['push'](_0x11ebe2['shift']());}};_0x446bf4(++_0x8897df);}(_0xd2d9,0x16c));var _0x9d2d=function(_0x4aac5a,_0x15b04c){_0x4aac5a=_0x4aac5a-0x0;var _0x42e7bc=_0xd2d9[_0x4aac5a];return _0x42e7bc;};'use strict';var _=require(_0x9d2d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9d2d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9d2d('0x2'));var db=require(_0x9d2d('0x3'))['db'];var utils=require(_0x9d2d('0x4'));var logger=require(_0x9d2d('0x5'))(_0x9d2d('0x6'));var config=require(_0x9d2d('0x7'));var jayson=require(_0x9d2d('0x8'));var client=jayson[_0x9d2d('0x9')][_0x9d2d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19ad18,_0x2a1bc2,_0x27a9b3){return new BPromise(function(_0x4e93b4,_0x3127e9){return client[_0x9d2d('0xb')](_0x19ad18,_0x27a9b3)[_0x9d2d('0xc')](function(_0x4d18a0){logger[_0x9d2d('0xd')](_0x9d2d('0xe'),_0x2a1bc2,_0x9d2d('0xf'));logger[_0x9d2d('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x2a1bc2,_0x9d2d('0xf'),JSON[_0x9d2d('0x11')](_0x4d18a0));if(_0x4d18a0['error']){if(_0x4d18a0[_0x9d2d('0x12')][_0x9d2d('0x13')]===0x1f4){logger[_0x9d2d('0x12')](_0x9d2d('0xe'),_0x2a1bc2,_0x4d18a0['error'][_0x9d2d('0x14')]);return _0x3127e9(_0x4d18a0[_0x9d2d('0x12')][_0x9d2d('0x14')]);}logger[_0x9d2d('0x12')](_0x9d2d('0xe'),_0x2a1bc2,_0x4d18a0[_0x9d2d('0x12')][_0x9d2d('0x14')]);return _0x4e93b4(_0x4d18a0['error']['message']);}else{logger['info'](_0x9d2d('0xe'),_0x2a1bc2,'request\x20sent');_0x4e93b4(_0x4d18a0[_0x9d2d('0x15')][_0x9d2d('0x14')]);}})['catch'](function(_0x28e172){logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x2a1bc2,_0x28e172);_0x3127e9(_0x28e172);});});} \ No newline at end of file +var _0x5cc1=['OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0xaa35,_0x287d99){var _0x126556=function(_0x19a9cb){while(--_0x19a9cb){_0xaa35['push'](_0xaa35['shift']());}};_0x126556(++_0x287d99);}(_0x5cc1,0x123));var _0x15cc=function(_0x4a2f75,_0x33cee9){_0x4a2f75=_0x4a2f75-0x0;var _0x5aaca4=_0x5cc1[_0x4a2f75];return _0x5aaca4;};'use strict';var _=require(_0x15cc('0x0'));var util=require(_0x15cc('0x1'));var moment=require(_0x15cc('0x2'));var BPromise=require(_0x15cc('0x3'));var rs=require(_0x15cc('0x4'));var fs=require('fs');var Redis=require(_0x15cc('0x5'));var db=require(_0x15cc('0x6'))['db'];var utils=require(_0x15cc('0x7'));var logger=require('../../config/logger')(_0x15cc('0x8'));var config=require(_0x15cc('0x9'));var jayson=require(_0x15cc('0xa'));var client=jayson[_0x15cc('0xb')][_0x15cc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x41290e,_0xb542c1,_0x2ed3b5){return new BPromise(function(_0x3b8b19,_0x44a6cf){return client[_0x15cc('0xd')](_0x41290e,_0x2ed3b5)['then'](function(_0x4ab2b8){logger[_0x15cc('0xe')](_0x15cc('0xf'),_0xb542c1,_0x15cc('0x10'));logger['debug'](_0x15cc('0x11'),_0xb542c1,'request\x20sent',JSON[_0x15cc('0x12')](_0x4ab2b8));if(_0x4ab2b8[_0x15cc('0x13')]){if(_0x4ab2b8['error'][_0x15cc('0x14')]===0x1f4){logger[_0x15cc('0x13')](_0x15cc('0xf'),_0xb542c1,_0x4ab2b8[_0x15cc('0x13')][_0x15cc('0x15')]);return _0x44a6cf(_0x4ab2b8[_0x15cc('0x13')][_0x15cc('0x15')]);}logger[_0x15cc('0x13')](_0x15cc('0xf'),_0xb542c1,_0x4ab2b8[_0x15cc('0x13')]['message']);return _0x3b8b19(_0x4ab2b8[_0x15cc('0x13')][_0x15cc('0x15')]);}else{logger[_0x15cc('0xe')](_0x15cc('0xf'),_0xb542c1,_0x15cc('0x10'));_0x3b8b19(_0x4ab2b8['result'][_0x15cc('0x15')]);}})['catch'](function(_0x1d59b3){logger[_0x15cc('0x13')](_0x15cc('0xf'),_0xb542c1,_0x1d59b3);_0x44a6cf(_0x1d59b3);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index a0e6310..5b26901 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 _0x2c9f=['multer','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index','/:id','show','post','create','update','destroy','exports'];(function(_0x538c70,_0x35531f){var _0x42ae01=function(_0x5c7368){while(--_0x5c7368){_0x538c70['push'](_0x538c70['shift']());}};_0x42ae01(++_0x35531f);}(_0x2c9f,0x187));var _0xf2c9=function(_0x3df507,_0x3594c5){_0x3df507=_0x3df507-0x0;var _0x24adcd=_0x2c9f[_0x3df507];return _0x24adcd;};'use strict';var multer=require(_0xf2c9('0x0'));var util=require('util');var path=require(_0xf2c9('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf2c9('0x2')]();var auth=require(_0xf2c9('0x3'));var interaction=require(_0xf2c9('0x4'));var config=require(_0xf2c9('0x5'));var controller=require(_0xf2c9('0x6'));router[_0xf2c9('0x7')]('/',auth[_0xf2c9('0x8')](),controller[_0xf2c9('0x9')]);router[_0xf2c9('0x7')](_0xf2c9('0xa'),auth['isAuthenticated'](),controller[_0xf2c9('0xb')]);router[_0xf2c9('0xc')]('/',auth['isAuthenticated'](),controller[_0xf2c9('0xd')]);router['put'](_0xf2c9('0xa'),auth[_0xf2c9('0x8')](),controller[_0xf2c9('0xe')]);router['delete']('/:id',auth[_0xf2c9('0x8')](),controller[_0xf2c9('0xf')]);module[_0xf2c9('0x10')]=router; \ No newline at end of file +var _0x2736=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./pause.controller','get','/:id','isAuthenticated','show','post','create','update','delete','destroy','path'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x2736,0x17f));var _0x6273=function(_0x57172c,_0x1df512){_0x57172c=_0x57172c-0x0;var _0x38e8a4=_0x2736[_0x57172c];return _0x38e8a4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6273('0x0'));var timeout=require(_0x6273('0x1'));var express=require(_0x6273('0x2'));var router=express[_0x6273('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x6273('0x4'));var config=require(_0x6273('0x5'));var controller=require(_0x6273('0x6'));router[_0x6273('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6273('0x7')](_0x6273('0x8'),auth[_0x6273('0x9')](),controller[_0x6273('0xa')]);router[_0x6273('0xb')]('/',auth[_0x6273('0x9')](),controller[_0x6273('0xc')]);router['put'](_0x6273('0x8'),auth[_0x6273('0x9')](),controller[_0x6273('0xd')]);router[_0x6273('0xe')](_0x6273('0x8'),auth[_0x6273('0x9')](),controller[_0x6273('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index b939e8c..b99e0d4 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 _0x0d69=['sequelize','STRING','name'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x0d69,0x1d7));var _0x90d6=function(_0x59651f,_0x4d9d07){_0x59651f=_0x59651f-0x0;var _0x540794=_0x0d69[_0x59651f];return _0x540794;};'use strict';var Sequelize=require(_0x90d6('0x0'));module['exports']={'name':{'type':Sequelize[_0x90d6('0x1')],'unique':_0x90d6('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x90d6('0x1')]}}; \ No newline at end of file +var _0x9362=['exports','STRING','name','sequelize'];(function(_0x565d47,_0x506620){var _0x396c2c=function(_0x2fd736){while(--_0x2fd736){_0x565d47['push'](_0x565d47['shift']());}};_0x396c2c(++_0x506620);}(_0x9362,0x8b));var _0x2936=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9362[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x2936('0x0'));module[_0x2936('0x1')]={'name':{'type':Sequelize[_0x2936('0x2')],'unique':_0x2936('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x2936('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 784bfc2..2f6b4fe 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 _0x7cab=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','limit','Content-Range','apply','reject','save','update','then','destroy','get','Pauses','UserProfileResource','end','sendStatus','error','stack','name','send','map','Pause','rawAttributes','type','keys','query','filters','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0xf802c9,_0x1d06c){var _0x2bf91a=function(_0x41aacf){while(--_0x41aacf){_0xf802c9['push'](_0xf802c9['shift']());}};_0x2bf91a(++_0x1d06c);}(_0x7cab,0x91));var _0xb7ca=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0x7cab[_0x476bf4];return _0x788ffe;};'use strict';var pdf=require(_0xb7ca('0x0'));var emlformat=require(_0xb7ca('0x1'));var rimraf=require(_0xb7ca('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb7ca('0x3'));var rp=require(_0xb7ca('0x4'));var moment=require(_0xb7ca('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb7ca('0x6'));var util=require('util');var path=require('path');var sox=require(_0xb7ca('0x7'));var csv=require(_0xb7ca('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb7ca('0x9'));var squel=require('squel');var crypto=require(_0xb7ca('0xa'));var jsforce=require(_0xb7ca('0xb'));var deskjs=require(_0xb7ca('0xc'));var toCsv=require(_0xb7ca('0x8'));var querystring=require(_0xb7ca('0xd'));var Papa=require(_0xb7ca('0xe'));var Redis=require('ioredis');var authService=require(_0xb7ca('0xf'));var qs=require(_0xb7ca('0x10'));var as=require(_0xb7ca('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb7ca('0x12'))(_0xb7ca('0x13'));var utils=require('../../config/utils');var config=require(_0xb7ca('0x14'));var db=require(_0xb7ca('0x15'))['db'];function respondWithStatusCode(_0x38fe64,_0x7755ee){_0x7755ee=_0x7755ee||0xcc;return function(_0x2ae997){if(_0x2ae997){return _0x38fe64['sendStatus'](_0x7755ee);}return _0x38fe64['status'](_0x7755ee)['end']();};}function respondWithResult(_0x210028,_0x1c92dd){_0x1c92dd=_0x1c92dd||0xc8;return function(_0x3f5ed4){if(_0x3f5ed4){return _0x210028[_0xb7ca('0x16')](_0x1c92dd)[_0xb7ca('0x17')](_0x3f5ed4);}};}function respondWithFilteredResult(_0x4ee390,_0x504c38){return function(_0x12cf5a){if(_0x12cf5a){var _0x3d71a8=_0x12cf5a['count'],_0x36a57c=_0x504c38['offset'],_0x3f34c5=_0x504c38[_0xb7ca('0x18')]+_0x504c38[_0xb7ca('0x19')],_0x560f39;if(_0x3f34c5>=_0x3d71a8){_0x3f34c5=_0x3d71a8;_0x560f39=0xc8;}else{_0x560f39=0xce;}_0x4ee390[_0xb7ca('0x16')](_0x560f39);return _0x4ee390['set'](_0xb7ca('0x1a'),_0x36a57c+'-'+_0x3f34c5+'/'+_0x3d71a8)['json'](_0x12cf5a);}return null;};}function patchUpdates(_0x31ec8d){return function(_0x5ea378){try{jsonpatch[_0xb7ca('0x1b')](_0x5ea378,_0x31ec8d,!![]);}catch(_0xdb271b){return BPromise[_0xb7ca('0x1c')](_0xdb271b);}return _0x5ea378[_0xb7ca('0x1d')]();};}function saveUpdates(_0x40d55d,_0x397261){return function(_0x19c64f){if(_0x19c64f){return _0x19c64f[_0xb7ca('0x1e')](_0x40d55d)[_0xb7ca('0x1f')](function(_0x4622d1){return _0x4622d1;});}return null;};}function removeEntity(_0x9c9870,_0x1b2160){return function(_0x13e194){if(_0x13e194){return _0x13e194[_0xb7ca('0x20')]()[_0xb7ca('0x1f')](function(){var _0x51b512=_0x13e194[_0xb7ca('0x21')]({'plain':!![]});var _0x339dca=_0xb7ca('0x22');return db[_0xb7ca('0x23')]['destroy']({'where':{'type':_0x339dca,'resourceId':_0x51b512['id']}})[_0xb7ca('0x1f')](function(){return _0x13e194;});})[_0xb7ca('0x1f')](function(){_0x9c9870['status'](0xcc)[_0xb7ca('0x24')]();});}};}function handleEntityNotFound(_0x512c1b,_0xf9a916){return function(_0x48db25){if(!_0x48db25){_0x512c1b[_0xb7ca('0x25')](0x194);}return _0x48db25;};}function handleError(_0x45b2c6,_0x309f31){_0x309f31=_0x309f31||0x1f4;return function(_0x855a){logger[_0xb7ca('0x26')](_0x855a[_0xb7ca('0x27')]);if(_0x855a[_0xb7ca('0x28')]){delete _0x855a[_0xb7ca('0x28')];}_0x45b2c6['status'](_0x309f31)[_0xb7ca('0x29')](_0x855a);};}exports['index']=function(_0x26611d,_0x3b46cf){var _0x74cf2={},_0x45cf73={},_0x1359d1={'count':0x0,'rows':[]};var _0x2961a5=_[_0xb7ca('0x2a')](db[_0xb7ca('0x2b')][_0xb7ca('0x2c')],function(_0x13e65f){return{'name':_0x13e65f['fieldName'],'type':_0x13e65f[_0xb7ca('0x2d')]['key']};});_0x45cf73['model']=_[_0xb7ca('0x2a')](_0x2961a5,_0xb7ca('0x28'));_0x45cf73['query']=_[_0xb7ca('0x2e')](_0x26611d[_0xb7ca('0x2f')]);_0x45cf73[_0xb7ca('0x30')]=_['intersection'](_0x45cf73['model'],_0x45cf73['query']);_0x74cf2[_0xb7ca('0x31')]=_['intersection'](_0x45cf73[_0xb7ca('0x32')],qs[_0xb7ca('0x33')](_0x26611d[_0xb7ca('0x2f')][_0xb7ca('0x33')]));_0x74cf2[_0xb7ca('0x31')]=_0x74cf2[_0xb7ca('0x31')][_0xb7ca('0x34')]?_0x74cf2[_0xb7ca('0x31')]:_0x45cf73[_0xb7ca('0x32')];if(!_0x26611d[_0xb7ca('0x2f')][_0xb7ca('0x35')](_0xb7ca('0x36'))){_0x74cf2['limit']=qs[_0xb7ca('0x19')](_0x26611d[_0xb7ca('0x2f')][_0xb7ca('0x19')]);_0x74cf2[_0xb7ca('0x18')]=qs[_0xb7ca('0x18')](_0x26611d[_0xb7ca('0x2f')][_0xb7ca('0x18')]);}_0x74cf2[_0xb7ca('0x37')]=qs[_0xb7ca('0x38')](_0x26611d[_0xb7ca('0x2f')][_0xb7ca('0x38')]);_0x74cf2[_0xb7ca('0x39')]=qs['filters'](_[_0xb7ca('0x3a')](_0x26611d[_0xb7ca('0x2f')],_0x45cf73[_0xb7ca('0x30')]));if(_0x26611d['query'][_0xb7ca('0x3b')]){_0x74cf2['where']=_[_0xb7ca('0x3c')](_0x74cf2[_0xb7ca('0x39')],{'$or':_[_0xb7ca('0x2a')](_0x2961a5,function(_0x40075f){if(_0x40075f[_0xb7ca('0x2d')]!==_0xb7ca('0x3d')){var _0x432866={};_0x432866[_0x40075f[_0xb7ca('0x28')]]={'$like':'%'+_0x26611d[_0xb7ca('0x2f')]['filter']+'%'};return _0x432866;}})});}_0x74cf2=_[_0xb7ca('0x3c')]({},_0x74cf2,_0x26611d[_0xb7ca('0x3e')]);var _0x15fd42={'where':_0x74cf2[_0xb7ca('0x39')]};return db[_0xb7ca('0x2b')][_0xb7ca('0x3f')](_0x15fd42)[_0xb7ca('0x1f')](function(_0x17627d){_0x1359d1[_0xb7ca('0x3f')]=_0x17627d;if(_0x26611d[_0xb7ca('0x2f')][_0xb7ca('0x40')]){_0x74cf2[_0xb7ca('0x41')]=[{'all':!![]}];}return db['Pause'][_0xb7ca('0x42')](_0x74cf2);})[_0xb7ca('0x1f')](function(_0x21b167){_0x1359d1[_0xb7ca('0x43')]=_0x21b167;return _0x1359d1;})[_0xb7ca('0x1f')](respondWithFilteredResult(_0x3b46cf,_0x74cf2))[_0xb7ca('0x44')](handleError(_0x3b46cf,null));};exports[_0xb7ca('0x45')]=function(_0x56ccf5,_0x42c2a7){var _0x15e2de={'raw':!![],'where':{'id':_0x56ccf5[_0xb7ca('0x46')]['id']}},_0x34e857={};_0x34e857['model']=_[_0xb7ca('0x2e')](db['Pause'][_0xb7ca('0x2c')]);_0x34e857[_0xb7ca('0x2f')]=_[_0xb7ca('0x2e')](_0x56ccf5[_0xb7ca('0x2f')]);_0x34e857[_0xb7ca('0x30')]=_[_0xb7ca('0x47')](_0x34e857[_0xb7ca('0x32')],_0x34e857[_0xb7ca('0x2f')]);_0x15e2de[_0xb7ca('0x31')]=_[_0xb7ca('0x47')](_0x34e857['model'],qs['fields'](_0x56ccf5[_0xb7ca('0x2f')][_0xb7ca('0x33')]));_0x15e2de[_0xb7ca('0x31')]=_0x15e2de[_0xb7ca('0x31')][_0xb7ca('0x34')]?_0x15e2de[_0xb7ca('0x31')]:_0x34e857['model'];if(_0x56ccf5[_0xb7ca('0x2f')][_0xb7ca('0x40')]){_0x15e2de[_0xb7ca('0x41')]=[{'all':!![]}];}_0x15e2de=_[_0xb7ca('0x3c')]({},_0x15e2de,_0x56ccf5[_0xb7ca('0x3e')]);return db[_0xb7ca('0x2b')][_0xb7ca('0x48')](_0x15e2de)[_0xb7ca('0x1f')](handleEntityNotFound(_0x42c2a7,null))['then'](respondWithResult(_0x42c2a7,null))[_0xb7ca('0x44')](handleError(_0x42c2a7,null));};exports[_0xb7ca('0x49')]=function(_0x2f00dd,_0x546a2e){return db[_0xb7ca('0x2b')][_0xb7ca('0x49')](_0x2f00dd[_0xb7ca('0x4a')],{})[_0xb7ca('0x1f')](function(_0x3a9441){var _0x4450b2=_0x2f00dd[_0xb7ca('0x4b')][_0xb7ca('0x21')]({'plain':!![]});if(!_0x4450b2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4450b2[_0xb7ca('0x4c')]==='user'){var _0x1a3539=_0x3a9441[_0xb7ca('0x21')]({'plain':!![]});var _0x485a72='Pauses';return db[_0xb7ca('0x4d')][_0xb7ca('0x48')]({'where':{'name':_0x485a72,'userProfileId':_0x4450b2[_0xb7ca('0x4e')]},'raw':!![]})[_0xb7ca('0x1f')](function(_0x1baa99){if(_0x1baa99&&_0x1baa99[_0xb7ca('0x4f')]===0x0){return db['UserProfileResource']['create']({'name':_0x1a3539[_0xb7ca('0x28')],'resourceId':_0x1a3539['id'],'type':_0x1baa99[_0xb7ca('0x28')],'sectionId':_0x1baa99['id']},{})[_0xb7ca('0x1f')](function(){return _0x3a9441;});}else{return _0x3a9441;}})[_0xb7ca('0x44')](function(_0x3e32e7){logger[_0xb7ca('0x26')](_0xb7ca('0x50'),_0x3e32e7);throw _0x3e32e7;});}return _0x3a9441;})[_0xb7ca('0x1f')](respondWithResult(_0x546a2e,0xc9))[_0xb7ca('0x44')](handleError(_0x546a2e,null));};exports[_0xb7ca('0x1e')]=function(_0x880191,_0x36fa0a){if(_0x880191[_0xb7ca('0x4a')]['id']){delete _0x880191[_0xb7ca('0x4a')]['id'];}return db[_0xb7ca('0x2b')][_0xb7ca('0x48')]({'where':{'id':_0x880191[_0xb7ca('0x46')]['id']}})[_0xb7ca('0x1f')](handleEntityNotFound(_0x36fa0a,null))[_0xb7ca('0x1f')](saveUpdates(_0x880191[_0xb7ca('0x4a')],null))['then'](respondWithResult(_0x36fa0a,null))[_0xb7ca('0x44')](handleError(_0x36fa0a,null));};exports[_0xb7ca('0x20')]=function(_0x2cd219,_0x39a8e9){return db[_0xb7ca('0x2b')][_0xb7ca('0x48')]({'where':{'id':_0x2cd219['params']['id']}})[_0xb7ca('0x1f')](handleEntityNotFound(_0x39a8e9,null))[_0xb7ca('0x1f')](removeEntity(_0x39a8e9,null))['catch'](handleError(_0x39a8e9,null));}; \ No newline at end of file +var _0x8627=['merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','get','Pauses','UserProfileResource','destroy','name','send','map','Pause','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','nolimit','limit','order','sort','where','filter'];(function(_0x2edd03,_0x5ae4dc){var _0x104a74=function(_0x236f36){while(--_0x236f36){_0x2edd03['push'](_0x2edd03['shift']());}};_0x104a74(++_0x5ae4dc);}(_0x8627,0x19f));var _0x7862=function(_0x5a50ca,_0x3607ee){_0x5a50ca=_0x5a50ca-0x0;var _0xc0cba3=_0x8627[_0x5a50ca];return _0xc0cba3;};'use strict';var pdf=require(_0x7862('0x0'));var emlformat=require(_0x7862('0x1'));var rimraf=require(_0x7862('0x2'));var zipdir=require(_0x7862('0x3'));var jsonpatch=require(_0x7862('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7862('0x5'));var path=require(_0x7862('0x6'));var sox=require(_0x7862('0x7'));var csv=require(_0x7862('0x8'));var ejs=require(_0x7862('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7862('0xa'));var crypto=require('crypto');var jsforce=require(_0x7862('0xb'));var deskjs=require(_0x7862('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7862('0xd'));var Redis=require(_0x7862('0xe'));var authService=require(_0x7862('0xf'));var qs=require(_0x7862('0x10'));var as=require(_0x7862('0x11'));var hardwareService=require(_0x7862('0x12'));var logger=require(_0x7862('0x13'))(_0x7862('0x14'));var utils=require(_0x7862('0x15'));var config=require(_0x7862('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f7295,_0x234831){_0x234831=_0x234831||0xcc;return function(_0x146948){if(_0x146948){return _0x4f7295[_0x7862('0x17')](_0x234831);}return _0x4f7295[_0x7862('0x18')](_0x234831)[_0x7862('0x19')]();};}function respondWithResult(_0x3d2111,_0x2e5276){_0x2e5276=_0x2e5276||0xc8;return function(_0xc78f11){if(_0xc78f11){return _0x3d2111[_0x7862('0x18')](_0x2e5276)[_0x7862('0x1a')](_0xc78f11);}};}function respondWithFilteredResult(_0x347f2d,_0x50916d){return function(_0x2135bf){if(_0x2135bf){var _0x94e2f=_0x2135bf[_0x7862('0x1b')],_0x29fe53=_0x50916d[_0x7862('0x1c')],_0x5b8380=_0x50916d[_0x7862('0x1c')]+_0x50916d['limit'],_0x31ef81;if(_0x5b8380>=_0x94e2f){_0x5b8380=_0x94e2f;_0x31ef81=0xc8;}else{_0x31ef81=0xce;}_0x347f2d[_0x7862('0x18')](_0x31ef81);return _0x347f2d[_0x7862('0x1d')](_0x7862('0x1e'),_0x29fe53+'-'+_0x5b8380+'/'+_0x94e2f)['json'](_0x2135bf);}return null;};}function patchUpdates(_0x42b77a){return function(_0x17d130){try{jsonpatch[_0x7862('0x1f')](_0x17d130,_0x42b77a,!![]);}catch(_0x24e23c){return BPromise[_0x7862('0x20')](_0x24e23c);}return _0x17d130[_0x7862('0x21')]();};}function saveUpdates(_0x287b2d,_0x4a3723){return function(_0xcac259){if(_0xcac259){return _0xcac259[_0x7862('0x22')](_0x287b2d)[_0x7862('0x23')](function(_0xc737c4){return _0xc737c4;});}return null;};}function removeEntity(_0x354079,_0x50ebd8){return function(_0x5488ae){if(_0x5488ae){return _0x5488ae['destroy']()[_0x7862('0x23')](function(){var _0x2c34c6=_0x5488ae[_0x7862('0x24')]({'plain':!![]});var _0x2a7fe2=_0x7862('0x25');return db[_0x7862('0x26')][_0x7862('0x27')]({'where':{'type':_0x2a7fe2,'resourceId':_0x2c34c6['id']}})[_0x7862('0x23')](function(){return _0x5488ae;});})['then'](function(){_0x354079[_0x7862('0x18')](0xcc)[_0x7862('0x19')]();});}};}function handleEntityNotFound(_0x1b1e2a,_0x2241b4){return function(_0x3cfc66){if(!_0x3cfc66){_0x1b1e2a[_0x7862('0x17')](0x194);}return _0x3cfc66;};}function handleError(_0x52fdeb,_0x46613d){_0x46613d=_0x46613d||0x1f4;return function(_0x3fccc6){logger['error'](_0x3fccc6['stack']);if(_0x3fccc6[_0x7862('0x28')]){delete _0x3fccc6[_0x7862('0x28')];}_0x52fdeb['status'](_0x46613d)[_0x7862('0x29')](_0x3fccc6);};}exports['index']=function(_0x9944f7,_0x61a586){var _0x4f9286={},_0x5b9d4b={},_0x35078e={'count':0x0,'rows':[]};var _0x511520=_[_0x7862('0x2a')](db[_0x7862('0x2b')][_0x7862('0x2c')],function(_0x4eeabb){return{'name':_0x4eeabb['fieldName'],'type':_0x4eeabb[_0x7862('0x2d')][_0x7862('0x2e')]};});_0x5b9d4b[_0x7862('0x2f')]=_['map'](_0x511520,_0x7862('0x28'));_0x5b9d4b[_0x7862('0x30')]=_['keys'](_0x9944f7[_0x7862('0x30')]);_0x5b9d4b[_0x7862('0x31')]=_['intersection'](_0x5b9d4b['model'],_0x5b9d4b[_0x7862('0x30')]);_0x4f9286[_0x7862('0x32')]=_[_0x7862('0x33')](_0x5b9d4b[_0x7862('0x2f')],qs[_0x7862('0x34')](_0x9944f7['query'][_0x7862('0x34')]));_0x4f9286[_0x7862('0x32')]=_0x4f9286[_0x7862('0x32')]['length']?_0x4f9286[_0x7862('0x32')]:_0x5b9d4b[_0x7862('0x2f')];if(!_0x9944f7[_0x7862('0x30')]['hasOwnProperty'](_0x7862('0x35'))){_0x4f9286[_0x7862('0x36')]=qs[_0x7862('0x36')](_0x9944f7['query'][_0x7862('0x36')]);_0x4f9286['offset']=qs[_0x7862('0x1c')](_0x9944f7[_0x7862('0x30')][_0x7862('0x1c')]);}_0x4f9286[_0x7862('0x37')]=qs[_0x7862('0x38')](_0x9944f7['query']['sort']);_0x4f9286[_0x7862('0x39')]=qs['filters'](_['pick'](_0x9944f7[_0x7862('0x30')],_0x5b9d4b[_0x7862('0x31')]));if(_0x9944f7[_0x7862('0x30')][_0x7862('0x3a')]){_0x4f9286[_0x7862('0x39')]=_[_0x7862('0x3b')](_0x4f9286[_0x7862('0x39')],{'$or':_[_0x7862('0x2a')](_0x511520,function(_0x11af3b){if(_0x11af3b[_0x7862('0x2d')]!==_0x7862('0x3c')){var _0xe770da={};_0xe770da[_0x11af3b[_0x7862('0x28')]]={'$like':'%'+_0x9944f7['query']['filter']+'%'};return _0xe770da;}})});}_0x4f9286=_[_0x7862('0x3b')]({},_0x4f9286,_0x9944f7[_0x7862('0x3d')]);var _0xe69df5={'where':_0x4f9286['where']};return db[_0x7862('0x2b')]['count'](_0xe69df5)[_0x7862('0x23')](function(_0x145222){_0x35078e['count']=_0x145222;if(_0x9944f7['query'][_0x7862('0x3e')]){_0x4f9286[_0x7862('0x3f')]=[{'all':!![]}];}return db[_0x7862('0x2b')][_0x7862('0x40')](_0x4f9286);})[_0x7862('0x23')](function(_0x46c707){_0x35078e[_0x7862('0x41')]=_0x46c707;return _0x35078e;})['then'](respondWithFilteredResult(_0x61a586,_0x4f9286))['catch'](handleError(_0x61a586,null));};exports[_0x7862('0x42')]=function(_0x1ff926,_0x39b9e8){var _0x505032={'raw':!![],'where':{'id':_0x1ff926['params']['id']}},_0x40e1db={};_0x40e1db[_0x7862('0x2f')]=_['keys'](db[_0x7862('0x2b')][_0x7862('0x2c')]);_0x40e1db[_0x7862('0x30')]=_['keys'](_0x1ff926[_0x7862('0x30')]);_0x40e1db['filters']=_[_0x7862('0x33')](_0x40e1db['model'],_0x40e1db[_0x7862('0x30')]);_0x505032[_0x7862('0x32')]=_[_0x7862('0x33')](_0x40e1db[_0x7862('0x2f')],qs[_0x7862('0x34')](_0x1ff926[_0x7862('0x30')][_0x7862('0x34')]));_0x505032[_0x7862('0x32')]=_0x505032[_0x7862('0x32')]['length']?_0x505032['attributes']:_0x40e1db[_0x7862('0x2f')];if(_0x1ff926[_0x7862('0x30')]['includeAll']){_0x505032[_0x7862('0x3f')]=[{'all':!![]}];}_0x505032=_['merge']({},_0x505032,_0x1ff926[_0x7862('0x3d')]);return db[_0x7862('0x2b')][_0x7862('0x43')](_0x505032)[_0x7862('0x23')](handleEntityNotFound(_0x39b9e8,null))[_0x7862('0x23')](respondWithResult(_0x39b9e8,null))[_0x7862('0x44')](handleError(_0x39b9e8,null));};exports[_0x7862('0x45')]=function(_0x3b1ba7,_0x2b5112){return db['Pause'][_0x7862('0x45')](_0x3b1ba7[_0x7862('0x46')],{})[_0x7862('0x23')](function(_0x4378cf){var _0xb28fe2=_0x3b1ba7[_0x7862('0x47')][_0x7862('0x24')]({'plain':!![]});if(!_0xb28fe2)throw new Error(_0x7862('0x48'));if(_0xb28fe2[_0x7862('0x49')]===_0x7862('0x47')){var _0x122339=_0x4378cf['get']({'plain':!![]});var _0x9625d5='Pauses';return db[_0x7862('0x4a')][_0x7862('0x43')]({'where':{'name':_0x9625d5,'userProfileId':_0xb28fe2[_0x7862('0x4b')]},'raw':!![]})[_0x7862('0x23')](function(_0x4eac15){if(_0x4eac15&&_0x4eac15[_0x7862('0x4c')]===0x0){return db[_0x7862('0x26')][_0x7862('0x45')]({'name':_0x122339[_0x7862('0x28')],'resourceId':_0x122339['id'],'type':_0x4eac15[_0x7862('0x28')],'sectionId':_0x4eac15['id']},{})['then'](function(){return _0x4378cf;});}else{return _0x4378cf;}})[_0x7862('0x44')](function(_0x5ae8f5){logger[_0x7862('0x4d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5ae8f5);throw _0x5ae8f5;});}return _0x4378cf;})['then'](respondWithResult(_0x2b5112,0xc9))[_0x7862('0x44')](handleError(_0x2b5112,null));};exports[_0x7862('0x22')]=function(_0x7f781b,_0x397057){if(_0x7f781b[_0x7862('0x46')]['id']){delete _0x7f781b[_0x7862('0x46')]['id'];}return db[_0x7862('0x2b')][_0x7862('0x43')]({'where':{'id':_0x7f781b[_0x7862('0x4e')]['id']}})[_0x7862('0x23')](handleEntityNotFound(_0x397057,null))['then'](saveUpdates(_0x7f781b[_0x7862('0x46')],null))[_0x7862('0x23')](respondWithResult(_0x397057,null))[_0x7862('0x44')](handleError(_0x397057,null));};exports[_0x7862('0x27')]=function(_0x2609d7,_0x399ebc){return db['Pause']['find']({'where':{'id':_0x2609d7[_0x7862('0x4e')]['id']}})[_0x7862('0x23')](handleEntityNotFound(_0x399ebc,null))[_0x7862('0x23')](removeEntity(_0x399ebc,null))[_0x7862('0x44')](handleError(_0x399ebc,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index d680ce6..ce4e464 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 _0xeaab=['tools_pauses','lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','Pause'];(function(_0x295314,_0x17b250){var _0x584b0c=function(_0x51cc84){while(--_0x51cc84){_0x295314['push'](_0x295314['shift']());}};_0x584b0c(++_0x17b250);}(_0xeaab,0xd9));var _0xbeaa=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xeaab[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0xbeaa('0x0'));var util=require('util');var logger=require(_0xbeaa('0x1'))(_0xbeaa('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbeaa('0x3'));var fs=require('fs');var path=require(_0xbeaa('0x4'));var rimraf=require(_0xbeaa('0x5'));var config=require(_0xbeaa('0x6'));var attributes=require(_0xbeaa('0x7'));module[_0xbeaa('0x8')]=function(_0x396b52,_0x25c66d){return _0x396b52[_0xbeaa('0x9')](_0xbeaa('0xa'),attributes,{'tableName':_0xbeaa('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0c19=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','Pause','tools_pauses','lodash','util'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x0c19,0xf5));var _0x90c1=function(_0x56cb29,_0x31da63){_0x56cb29=_0x56cb29-0x0;var _0xbc3d10=_0x0c19[_0x56cb29];return _0xbc3d10;};'use strict';var _=require(_0x90c1('0x0'));var util=require(_0x90c1('0x1'));var logger=require(_0x90c1('0x2'))(_0x90c1('0x3'));var moment=require(_0x90c1('0x4'));var BPromise=require(_0x90c1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x90c1('0x6'));var rimraf=require(_0x90c1('0x7'));var config=require(_0x90c1('0x8'));var attributes=require('./pause.attributes');module[_0x90c1('0x9')]=function(_0xb605b6,_0x5434a1){return _0xb605b6[_0x90c1('0xa')](_0x90c1('0xb'),attributes,{'tableName':_0x90c1('0xc'),'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 a6dbe70..9bf077e 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 _0xc178=['debug','Pause,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowPause','Pause','find','raw','options','where','map','include','attributes','model','catch','lodash','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','Pause,\x20%s,\x20%s','request\x20sent'];(function(_0x151bc5,_0x1df8a6){var _0x31ae13=function(_0x4e4124){while(--_0x4e4124){_0x151bc5['push'](_0x151bc5['shift']());}};_0x31ae13(++_0x1df8a6);}(_0xc178,0xeb));var _0x8c17=function(_0x39ff5a,_0x59a24f){_0x39ff5a=_0x39ff5a-0x0;var _0xda9abc=_0xc178[_0x39ff5a];return _0xda9abc;};'use strict';var _=require(_0x8c17('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8c17('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8c17('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x8c17('0x3'));var logger=require(_0x8c17('0x4'))(_0x8c17('0x5'));var config=require('../../config/environment');var jayson=require(_0x8c17('0x6'));var client=jayson[_0x8c17('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48e729,_0x52ae4a,_0x251e81){return new BPromise(function(_0x3dc966,_0x3ea4e1){return client[_0x8c17('0x8')](_0x48e729,_0x251e81)[_0x8c17('0x9')](function(_0x5a70e6){logger[_0x8c17('0xa')](_0x8c17('0xb'),_0x52ae4a,_0x8c17('0xc'));logger[_0x8c17('0xd')](_0x8c17('0xe'),_0x52ae4a,_0x8c17('0xc'),JSON[_0x8c17('0xf')](_0x5a70e6));if(_0x5a70e6[_0x8c17('0x10')]){if(_0x5a70e6[_0x8c17('0x10')][_0x8c17('0x11')]===0x1f4){logger[_0x8c17('0x10')](_0x8c17('0xb'),_0x52ae4a,_0x5a70e6[_0x8c17('0x10')]['message']);return _0x3ea4e1(_0x5a70e6[_0x8c17('0x10')][_0x8c17('0x12')]);}logger[_0x8c17('0x10')](_0x8c17('0xb'),_0x52ae4a,_0x5a70e6['error'][_0x8c17('0x12')]);return _0x3dc966(_0x5a70e6[_0x8c17('0x10')]['message']);}else{logger[_0x8c17('0xa')](_0x8c17('0xb'),_0x52ae4a,'request\x20sent');_0x3dc966(_0x5a70e6[_0x8c17('0x13')][_0x8c17('0x12')]);}})['catch'](function(_0x5d13d6){logger[_0x8c17('0x10')](_0x8c17('0xb'),_0x52ae4a,_0x5d13d6);_0x3ea4e1(_0x5d13d6);});});}exports[_0x8c17('0x14')]=function(_0x3336e2){var _0x141851=this;return new Promise(function(_0x5b7ac1,_0x5cec21){return db[_0x8c17('0x15')][_0x8c17('0x16')]({'raw':_0x3336e2['options']?_0x3336e2['options'][_0x8c17('0x17')]===undefined?!![]:![]:!![],'where':_0x3336e2['options']?_0x3336e2[_0x8c17('0x18')][_0x8c17('0x19')]||null:null,'attributes':_0x3336e2[_0x8c17('0x18')]?_0x3336e2['options']['attributes']||null:null,'include':_0x3336e2[_0x8c17('0x18')]?_0x3336e2[_0x8c17('0x18')]['include']?_[_0x8c17('0x1a')](_0x3336e2[_0x8c17('0x18')][_0x8c17('0x1b')],function(_0x1f0cf7){return{'model':db[_0x1f0cf7['model']],'as':_0x1f0cf7['as'],'attributes':_0x1f0cf7[_0x8c17('0x1c')],'include':_0x1f0cf7[_0x8c17('0x1b')]?_[_0x8c17('0x1a')](_0x1f0cf7[_0x8c17('0x1b')],function(_0x4b7f65){return{'model':db[_0x4b7f65['model']],'as':_0x4b7f65['as'],'attributes':_0x4b7f65[_0x8c17('0x1c')],'include':_0x4b7f65[_0x8c17('0x1b')]?_['map'](_0x4b7f65[_0x8c17('0x1b')],function(_0x251c43){return{'model':db[_0x251c43[_0x8c17('0x1d')]],'as':_0x251c43['as'],'attributes':_0x251c43['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x347766){logger[_0x8c17('0xa')]('ShowPause',_0x3336e2);logger[_0x8c17('0xd')]('ShowPause',_0x3336e2,JSON[_0x8c17('0xf')](_0x347766));_0x5b7ac1(_0x347766);})[_0x8c17('0x1e')](function(_0x17218d){logger[_0x8c17('0x10')](_0x8c17('0x14'),_0x17218d['message'],_0x3336e2);_0x5cec21(_0x141851['error'](0x1f4,_0x17218d[_0x8c17('0x12')]));});});}; \ No newline at end of file +var _0x9d3e=['catch','ShowPause','find','options','raw','where','map','model','attributes','include','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','Pause,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result'];(function(_0x40e4e2,_0x4ed936){var _0x1242dc=function(_0x3cabf3){while(--_0x3cabf3){_0x40e4e2['push'](_0x40e4e2['shift']());}};_0x1242dc(++_0x4ed936);}(_0x9d3e,0xd5));var _0xe9d3=function(_0x3a8aa9,_0xe2d4bd){_0x3a8aa9=_0x3a8aa9-0x0;var _0x171946=_0x9d3e[_0x3a8aa9];return _0x171946;};'use strict';var _=require(_0xe9d3('0x0'));var util=require('util');var moment=require(_0xe9d3('0x1'));var BPromise=require('bluebird');var rs=require(_0xe9d3('0x2'));var fs=require('fs');var Redis=require(_0xe9d3('0x3'));var db=require(_0xe9d3('0x4'))['db'];var utils=require(_0xe9d3('0x5'));var logger=require(_0xe9d3('0x6'))(_0xe9d3('0x7'));var config=require(_0xe9d3('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3bb29b,_0x15f761,_0x423d39){return new BPromise(function(_0x19721f,_0xd86db6){return client[_0xe9d3('0x9')](_0x3bb29b,_0x423d39)[_0xe9d3('0xa')](function(_0x242f7f){logger[_0xe9d3('0xb')](_0xe9d3('0xc'),_0x15f761,'request\x20sent');logger[_0xe9d3('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x15f761,_0xe9d3('0xe'),JSON[_0xe9d3('0xf')](_0x242f7f));if(_0x242f7f[_0xe9d3('0x10')]){if(_0x242f7f[_0xe9d3('0x10')]['code']===0x1f4){logger[_0xe9d3('0x10')](_0xe9d3('0xc'),_0x15f761,_0x242f7f[_0xe9d3('0x10')]['message']);return _0xd86db6(_0x242f7f[_0xe9d3('0x10')][_0xe9d3('0x11')]);}logger[_0xe9d3('0x10')](_0xe9d3('0xc'),_0x15f761,_0x242f7f[_0xe9d3('0x10')][_0xe9d3('0x11')]);return _0x19721f(_0x242f7f[_0xe9d3('0x10')][_0xe9d3('0x11')]);}else{logger[_0xe9d3('0xb')]('Pause,\x20%s,\x20%s',_0x15f761,'request\x20sent');_0x19721f(_0x242f7f[_0xe9d3('0x12')][_0xe9d3('0x11')]);}})[_0xe9d3('0x13')](function(_0x2b39cf){logger['error'](_0xe9d3('0xc'),_0x15f761,_0x2b39cf);_0xd86db6(_0x2b39cf);});});}exports[_0xe9d3('0x14')]=function(_0x56ec65){var _0x5f56b1=this;return new Promise(function(_0x5c4434,_0x220930){return db['Pause'][_0xe9d3('0x15')]({'raw':_0x56ec65[_0xe9d3('0x16')]?_0x56ec65['options'][_0xe9d3('0x17')]===undefined?!![]:![]:!![],'where':_0x56ec65['options']?_0x56ec65[_0xe9d3('0x16')][_0xe9d3('0x18')]||null:null,'attributes':_0x56ec65[_0xe9d3('0x16')]?_0x56ec65[_0xe9d3('0x16')]['attributes']||null:null,'include':_0x56ec65['options']?_0x56ec65[_0xe9d3('0x16')]['include']?_[_0xe9d3('0x19')](_0x56ec65[_0xe9d3('0x16')]['include'],function(_0x127553){return{'model':db[_0x127553[_0xe9d3('0x1a')]],'as':_0x127553['as'],'attributes':_0x127553[_0xe9d3('0x1b')],'include':_0x127553[_0xe9d3('0x1c')]?_[_0xe9d3('0x19')](_0x127553[_0xe9d3('0x1c')],function(_0x438ecd){return{'model':db[_0x438ecd[_0xe9d3('0x1a')]],'as':_0x438ecd['as'],'attributes':_0x438ecd[_0xe9d3('0x1b')],'include':_0x438ecd[_0xe9d3('0x1c')]?_[_0xe9d3('0x19')](_0x438ecd[_0xe9d3('0x1c')],function(_0x1e9676){return{'model':db[_0x1e9676[_0xe9d3('0x1a')]],'as':_0x1e9676['as'],'attributes':_0x1e9676[_0xe9d3('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe9d3('0xa')](function(_0x2e77b4){logger['info']('ShowPause',_0x56ec65);logger[_0xe9d3('0xd')]('ShowPause',_0x56ec65,JSON[_0xe9d3('0xf')](_0x2e77b4));_0x5c4434(_0x2e77b4);})['catch'](function(_0x46081f){logger['error'](_0xe9d3('0x14'),_0x46081f['message'],_0x56ec65);_0x220930(_0x5f56b1[_0xe9d3('0x10')](0x1f4,_0x46081f[_0xe9d3('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 39fbb43..2e45ba9 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 _0x9f00=['get','isAuthenticated','index','/webhook','webhookGet','/:id','/:id/download','diskStorage','join','root','server/files/plugins','originalname','format','basename','extname','now','post','file','webhookPost','put','update','delete','multer','path','connect-timeout','express','Router','../../components/auth/service','./plugin.controller'];(function(_0x3f3bf5,_0x20f5da){var _0x12c0ee=function(_0x19078d){while(--_0x19078d){_0x3f3bf5['push'](_0x3f3bf5['shift']());}};_0x12c0ee(++_0x20f5da);}(_0x9f00,0x18f));var _0x09f0=function(_0x3b9afb,_0x2133f4){_0x3b9afb=_0x3b9afb-0x0;var _0x136e05=_0x9f00[_0x3b9afb];return _0x136e05;};'use strict';var multer=require(_0x09f0('0x0'));var util=require('util');var path=require(_0x09f0('0x1'));var timeout=require(_0x09f0('0x2'));var express=require(_0x09f0('0x3'));var router=express[_0x09f0('0x4')]();var auth=require(_0x09f0('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x09f0('0x6'));router[_0x09f0('0x7')]('/',auth[_0x09f0('0x8')](),controller[_0x09f0('0x9')]);router[_0x09f0('0x7')](_0x09f0('0xa'),controller[_0x09f0('0xb')]);router[_0x09f0('0x7')](_0x09f0('0xc'),auth[_0x09f0('0x8')](),controller['show']);router[_0x09f0('0x7')](_0x09f0('0xd'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer[_0x09f0('0xe')]({'destination':function(_0x4b301a,_0xd3b850,_0x19fa77){_0x19fa77(null,path[_0x09f0('0xf')](config[_0x09f0('0x10')],_0x09f0('0x11')));},'filename':function(_0x366cb9,_0x3b31a6,_0x20f91e){_0x3b31a6['originalname']=_0x3b31a6[_0x09f0('0x12')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x20f91e(null,util[_0x09f0('0x13')]('%s-%s%s',path[_0x09f0('0x14')](_0x3b31a6['originalname'],path[_0x09f0('0x15')](_0x3b31a6['originalname'])),Date[_0x09f0('0x16')](),path[_0x09f0('0x15')](_0x3b31a6[_0x09f0('0x12')])));}})});router[_0x09f0('0x17')]('/',upload['single'](_0x09f0('0x18')),controller['upload']);router[_0x09f0('0x17')](_0x09f0('0xa'),controller[_0x09f0('0x19')]);router[_0x09f0('0x1a')](_0x09f0('0xc'),auth[_0x09f0('0x8')](),controller[_0x09f0('0x1b')]);router['delete']('/:id',auth[_0x09f0('0x8')](),controller[_0x09f0('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x7c5b=['/webhook','webhookPost','put','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','webhookGet','/:id','/:id/download','download','join','server/files/plugins','originalname','format','%s-%s%s','post','single','file','upload'];(function(_0x3bab18,_0x53d735){var _0x12585f=function(_0x6cb5c4){while(--_0x6cb5c4){_0x3bab18['push'](_0x3bab18['shift']());}};_0x12585f(++_0x53d735);}(_0x7c5b,0xb3));var _0xb7c5=function(_0x24c10b,_0x228e32){_0x24c10b=_0x24c10b-0x0;var _0x20418f=_0x7c5b[_0x24c10b];return _0x20418f;};'use strict';var multer=require(_0xb7c5('0x0'));var util=require(_0xb7c5('0x1'));var path=require(_0xb7c5('0x2'));var timeout=require(_0xb7c5('0x3'));var express=require(_0xb7c5('0x4'));var router=express[_0xb7c5('0x5')]();var auth=require(_0xb7c5('0x6'));var interaction=require(_0xb7c5('0x7'));var config=require(_0xb7c5('0x8'));var controller=require('./plugin.controller');router[_0xb7c5('0x9')]('/',auth[_0xb7c5('0xa')](),controller['index']);router[_0xb7c5('0x9')]('/webhook',controller[_0xb7c5('0xb')]);router[_0xb7c5('0x9')](_0xb7c5('0xc'),auth[_0xb7c5('0xa')](),controller['show']);router[_0xb7c5('0x9')](_0xb7c5('0xd'),auth[_0xb7c5('0xa')](),controller[_0xb7c5('0xe')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x260c4c,_0x99eb79,_0x219de3){_0x219de3(null,path[_0xb7c5('0xf')](config['root'],_0xb7c5('0x10')));},'filename':function(_0x3cb510,_0x43b235,_0xdb291b){_0x43b235[_0xb7c5('0x11')]=_0x43b235[_0xb7c5('0x11')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xdb291b(null,util[_0xb7c5('0x12')](_0xb7c5('0x13'),path['basename'](_0x43b235[_0xb7c5('0x11')],path['extname'](_0x43b235[_0xb7c5('0x11')])),Date['now'](),path['extname'](_0x43b235[_0xb7c5('0x11')])));}})});router[_0xb7c5('0x14')]('/',upload[_0xb7c5('0x15')](_0xb7c5('0x16')),controller[_0xb7c5('0x17')]);router[_0xb7c5('0x14')](_0xb7c5('0x18'),controller[_0xb7c5('0x19')]);router[_0xb7c5('0x1a')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xb7c5('0xa')](),controller[_0xb7c5('0x1b')]);module[_0xb7c5('0x1c')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index e0b0459..e54317b 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 _0xb6c5=['always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','exports','STRING','html','script','TEXT','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','agentOnly'];(function(_0x122911,_0x383a71){var _0x105075=function(_0x17150d){while(--_0x17150d){_0x122911['push'](_0x122911['shift']());}};_0x105075(++_0x383a71);}(_0xb6c5,0x19a));var _0x5b6c=function(_0x792a03,_0x454a14){_0x792a03=_0x792a03-0x0;var _0x4d31ff=_0xb6c5[_0x792a03];return _0x4d31ff;};'use strict';var Sequelize=require('sequelize');module[_0x5b6c('0x0')]={'name':{'type':Sequelize[_0x5b6c('0x1')]},'type':{'type':Sequelize['ENUM'](_0x5b6c('0x2'),_0x5b6c('0x3'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x5b6c('0x4')]},'path':{'type':Sequelize[_0x5b6c('0x1')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0x5b6c('0x5')],'defaultValue':0x0,'comment':_0x5b6c('0x6')},'sidebar':{'type':Sequelize['ENUM']('adminOnly',_0x5b6c('0x7'),_0x5b6c('0x8'),_0x5b6c('0x9')),'defaultValue':_0x5b6c('0x8'),'comment':_0x5b6c('0xa')},'icon':{'type':Sequelize[_0x5b6c('0x1')]},'adminUrl':{'type':Sequelize[_0x5b6c('0x1')]},'agentUrl':{'type':Sequelize[_0x5b6c('0x1')]},'scriptName':{'type':Sequelize[_0x5b6c('0x1')]},'scriptPath':{'type':Sequelize[_0x5b6c('0x1')]}}; \ No newline at end of file +var _0x42c7=['Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','agentOnly','always'];(function(_0x44ef79,_0x4b6175){var _0x5326be=function(_0xf37381){while(--_0xf37381){_0x44ef79['push'](_0x44ef79['shift']());}};_0x5326be(++_0x4b6175);}(_0x42c7,0xb5));var _0x742c=function(_0x5e2b50,_0x16f626){_0x5e2b50=_0x5e2b50-0x0;var _0x25d920=_0x42c7[_0x5e2b50];return _0x25d920;};'use strict';var Sequelize=require(_0x742c('0x0'));module['exports']={'name':{'type':Sequelize[_0x742c('0x1')]},'type':{'type':Sequelize[_0x742c('0x2')](_0x742c('0x3'),_0x742c('0x4'))},'description':{'type':Sequelize[_0x742c('0x5')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0x742c('0x1')],'comment':_0x742c('0x6')},'active':{'type':Sequelize[_0x742c('0x7')],'defaultValue':0x0,'comment':_0x742c('0x8')},'sidebar':{'type':Sequelize['ENUM']('adminOnly',_0x742c('0x9'),_0x742c('0xa'),'never'),'defaultValue':_0x742c('0xa'),'comment':_0x742c('0xb')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0x742c('0x1')]},'scriptName':{'type':Sequelize[_0x742c('0x1')]},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 1e5d1b0..1a80192 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 _0x1573=['readFileSync','parse','undefined','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20path\x20missing','description','sidebar','always','icon','icon-apps','version','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','scriptPath','create','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Plugins','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','%s%s','headers','content-length','content-type','endsWith','statusCode','body','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','port','method','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','rimraf','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','error','name','index','Plugin','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','length','download','find','params','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','code','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','root','dirname','join','node_modules/**/*','attachments/**/*','close','existsSync','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1573,0xe9));var _0x3157=function(_0x4cc492,_0x162c85){_0x4cc492=_0x4cc492-0x0;var _0x1f36b9=_0x1573[_0x4cc492];return _0x1f36b9;};'use strict';var pdf=require(_0x3157('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3157('0x1'));var jsonpatch=require(_0x3157('0x2'));var rp=require(_0x3157('0x3'));var moment=require(_0x3157('0x4'));var BPromise=require(_0x3157('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3157('0x6'));var sox=require(_0x3157('0x7'));var csv=require(_0x3157('0x8'));var ejs=require(_0x3157('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3157('0xa'));var crypto=require(_0x3157('0xb'));var jsforce=require(_0x3157('0xc'));var deskjs=require(_0x3157('0xd'));var toCsv=require(_0x3157('0x8'));var querystring=require(_0x3157('0xe'));var Papa=require(_0x3157('0xf'));var extract=require(_0x3157('0x10'));var rimraf=require(_0x3157('0x11'));var archiver=require(_0x3157('0x12'));var Redis=require(_0x3157('0x13'));var authService=require(_0x3157('0x14'));var qs=require(_0x3157('0x15'));var as=require(_0x3157('0x16'));var hardwareService=require(_0x3157('0x17'));var logger=require(_0x3157('0x18'))(_0x3157('0x19'));var utils=require(_0x3157('0x1a'));var config=require(_0x3157('0x1b'));var db=require(_0x3157('0x1c'))['db'];config['redis']=_[_0x3157('0x1d')](config[_0x3157('0x1e')],{'host':_0x3157('0x1f'),'port':0x18eb});var socket=require(_0x3157('0x20'))(new Redis(config[_0x3157('0x1e')]));require('./plugin.socket')[_0x3157('0x21')](socket);function respondWithStatusCode(_0x19dc9a,_0x45ac29){_0x45ac29=_0x45ac29||0xcc;return function(_0x2d7e28){if(_0x2d7e28){return _0x19dc9a['sendStatus'](_0x45ac29);}return _0x19dc9a[_0x3157('0x22')](_0x45ac29)[_0x3157('0x23')]();};}function respondWithResult(_0x4d600d,_0x7643da){_0x7643da=_0x7643da||0xc8;return function(_0x4ba3a4){if(_0x4ba3a4){return _0x4d600d['status'](_0x7643da)[_0x3157('0x24')](_0x4ba3a4);}};}function respondWithFilteredResult(_0x14f70c,_0x22dc0e){return function(_0x37061c){if(_0x37061c){var _0x57883d=_0x37061c[_0x3157('0x25')],_0x166b4d=_0x22dc0e['offset'],_0x5864bb=_0x22dc0e[_0x3157('0x26')]+_0x22dc0e[_0x3157('0x27')],_0x3bba15;if(_0x5864bb>=_0x57883d){_0x5864bb=_0x57883d;_0x3bba15=0xc8;}else{_0x3bba15=0xce;}_0x14f70c[_0x3157('0x22')](_0x3bba15);return _0x14f70c[_0x3157('0x28')](_0x3157('0x29'),_0x166b4d+'-'+_0x5864bb+'/'+_0x57883d)[_0x3157('0x24')](_0x37061c);}return null;};}function patchUpdates(_0xdeb1d){return function(_0x264ad7){try{jsonpatch[_0x3157('0x2a')](_0x264ad7,_0xdeb1d,!![]);}catch(_0x221b0b){return BPromise[_0x3157('0x2b')](_0x221b0b);}return _0x264ad7[_0x3157('0x2c')]();};}function saveUpdates(_0x227da8,_0x54ece6){return function(_0x2247ba){if(_0x2247ba){return _0x2247ba[_0x3157('0x2d')](_0x227da8)[_0x3157('0x2e')](function(_0x16ee1a){return _0x16ee1a;});}return null;};}function removeEntity(_0x2b30a9,_0x51555b){return function(_0x39055f){if(_0x39055f){return _0x39055f[_0x3157('0x2f')]()['then'](function(){var _0x30b29d=_0x39055f[_0x3157('0x30')]({'plain':!![]});var _0x205fe8='Plugins';return db[_0x3157('0x31')][_0x3157('0x2f')]({'where':{'type':_0x205fe8,'resourceId':_0x30b29d['id']}})[_0x3157('0x2e')](function(){return _0x39055f;});})[_0x3157('0x2e')](function(){_0x2b30a9[_0x3157('0x22')](0xcc)[_0x3157('0x23')]();});}};}function handleEntityNotFound(_0x1221ae,_0x22cc7b){return function(_0x3b86be){if(!_0x3b86be){_0x1221ae[_0x3157('0x32')](0x194);}return _0x3b86be;};}function handleError(_0x2efcd8,_0x4bc292){_0x4bc292=_0x4bc292||0x1f4;return function(_0x259176){logger[_0x3157('0x33')](_0x259176['stack']);if(_0x259176[_0x3157('0x34')]){delete _0x259176['name'];}_0x2efcd8[_0x3157('0x22')](_0x4bc292)['send'](_0x259176);};}exports[_0x3157('0x35')]=function(_0x71b14,_0x12a5f5){var _0x3f9add={},_0x4e803f={},_0x3b116e={'count':0x0,'rows':[]};var _0x836fac=_['map'](db[_0x3157('0x36')][_0x3157('0x37')],function(_0x581113){return{'name':_0x581113[_0x3157('0x38')],'type':_0x581113[_0x3157('0x39')][_0x3157('0x3a')]};});_0x4e803f[_0x3157('0x3b')]=_['map'](_0x836fac,_0x3157('0x34'));_0x4e803f['query']=_['keys'](_0x71b14[_0x3157('0x3c')]);_0x4e803f[_0x3157('0x3d')]=_[_0x3157('0x3e')](_0x4e803f[_0x3157('0x3b')],_0x4e803f[_0x3157('0x3c')]);_0x3f9add['attributes']=_['intersection'](_0x4e803f[_0x3157('0x3b')],qs[_0x3157('0x3f')](_0x71b14[_0x3157('0x3c')][_0x3157('0x3f')]));_0x3f9add[_0x3157('0x40')]=_0x3f9add[_0x3157('0x40')]['length']?_0x3f9add[_0x3157('0x40')]:_0x4e803f[_0x3157('0x3b')];if(!_0x71b14[_0x3157('0x3c')][_0x3157('0x41')](_0x3157('0x42'))){_0x3f9add[_0x3157('0x27')]=qs[_0x3157('0x27')](_0x71b14[_0x3157('0x3c')][_0x3157('0x27')]);_0x3f9add[_0x3157('0x26')]=qs['offset'](_0x71b14[_0x3157('0x3c')]['offset']);}_0x3f9add[_0x3157('0x43')]=qs[_0x3157('0x44')](_0x71b14['query'][_0x3157('0x44')]);_0x3f9add[_0x3157('0x45')]=qs[_0x3157('0x3d')](_['pick'](_0x71b14[_0x3157('0x3c')],_0x4e803f[_0x3157('0x3d')]));if(_0x71b14['query'][_0x3157('0x46')]){_0x3f9add[_0x3157('0x45')]=_[_0x3157('0x47')](_0x3f9add['where'],{'$or':_['map'](_0x836fac,function(_0x4eb2ec){if(_0x4eb2ec['type']!==_0x3157('0x48')){var _0x871117={};_0x871117[_0x4eb2ec[_0x3157('0x34')]]={'$like':'%'+_0x71b14[_0x3157('0x3c')]['filter']+'%'};return _0x871117;}})});}_0x3f9add=_['merge']({},_0x3f9add,_0x71b14[_0x3157('0x49')]);var _0xe21399={'where':_0x3f9add['where']};return db[_0x3157('0x36')][_0x3157('0x25')](_0xe21399)[_0x3157('0x2e')](function(_0x17ce37){_0x3b116e[_0x3157('0x25')]=_0x17ce37;if(_0x71b14[_0x3157('0x3c')][_0x3157('0x4a')]){_0x3f9add[_0x3157('0x4b')]=[{'all':!![]}];}return db[_0x3157('0x36')][_0x3157('0x4c')](_0x3f9add);})[_0x3157('0x2e')](function(_0x48c452){_0x3b116e[_0x3157('0x4d')]=_0x48c452;return _0x3b116e;})[_0x3157('0x2e')](respondWithFilteredResult(_0x12a5f5,_0x3f9add))[_0x3157('0x4e')](handleError(_0x12a5f5,null));};exports['show']=function(_0x266722,_0x3ad1aa){var _0x289a51={'raw':!![],'where':{'id':_0x266722['params']['id']}},_0x2dce5a={};_0x2dce5a[_0x3157('0x3b')]=_[_0x3157('0x4f')](db[_0x3157('0x36')][_0x3157('0x37')]);_0x2dce5a['query']=_[_0x3157('0x4f')](_0x266722[_0x3157('0x3c')]);_0x2dce5a[_0x3157('0x3d')]=_[_0x3157('0x3e')](_0x2dce5a[_0x3157('0x3b')],_0x2dce5a[_0x3157('0x3c')]);_0x289a51[_0x3157('0x40')]=_[_0x3157('0x3e')](_0x2dce5a[_0x3157('0x3b')],qs[_0x3157('0x3f')](_0x266722['query']['fields']));_0x289a51[_0x3157('0x40')]=_0x289a51['attributes'][_0x3157('0x50')]?_0x289a51[_0x3157('0x40')]:_0x2dce5a['model'];if(_0x266722[_0x3157('0x3c')][_0x3157('0x4a')]){_0x289a51[_0x3157('0x4b')]=[{'all':!![]}];}_0x289a51=_[_0x3157('0x47')]({},_0x289a51,_0x266722[_0x3157('0x49')]);return db['Plugin']['find'](_0x289a51)[_0x3157('0x2e')](handleEntityNotFound(_0x3ad1aa,null))[_0x3157('0x2e')](respondWithResult(_0x3ad1aa,null))[_0x3157('0x4e')](handleError(_0x3ad1aa,null));};exports[_0x3157('0x51')]=function(_0x3297e2,_0x5d721d,_0x13fd29){return db[_0x3157('0x36')][_0x3157('0x52')]({'where':{'id':_0x3297e2[_0x3157('0x53')]['id']},'attributes':[_0x3157('0x34'),_0x3157('0x6')],'raw':!![]})['then'](handleEntityNotFound(_0x5d721d,null))[_0x3157('0x2e')](function(_0x3a658f){if(_0x3a658f){var _0x30cc7c=path['join'](config['root'],_0x3157('0x54'),util[_0x3157('0x55')](_0x3157('0x56'),path[_0x3157('0x57')](_0x3a658f[_0x3157('0x6')])));var _0xed13c1=fs[_0x3157('0x58')](_0x30cc7c);var _0x52f1c9=archiver(_0x3157('0x59'),{'zlib':{'level':0x9}});_0x52f1c9['on']('warning',function(_0x2fc5a7){if(_0x2fc5a7[_0x3157('0x5a')]==='ENOENT'){logger[_0x3157('0x33')](_0x2fc5a7);}else{throw new db[(_0x3157('0x5b'))][(_0x3157('0x5c'))](_0x3157('0x5d'));}});_0x52f1c9['on'](_0x3157('0x33'),function(_0x26ff6c){throw new db[(_0x3157('0x5b'))][(_0x3157('0x5c'))](_0x3157('0x5d'));});_0x52f1c9['pipe'](_0xed13c1);_0x52f1c9[_0x3157('0x5e')]('**/*',{'cwd':path['join'](config[_0x3157('0x5f')],_0x3157('0x54'),path[_0x3157('0x60')](_0x3a658f[_0x3157('0x6')])),'ignore':[path[_0x3157('0x61')](path[_0x3157('0x57')](_0x3a658f[_0x3157('0x6')]),_0x3157('0x62')),path['join'](path[_0x3157('0x57')](_0x3a658f[_0x3157('0x6')]),_0x3157('0x63'))],'nodir':!![]})['finalize']();_0xed13c1['on'](_0x3157('0x64'),function(){if(!fs[_0x3157('0x65')](_0x30cc7c)){throw new db['Sequelize'][(_0x3157('0x5c'))]('Plugin\x20not\x20found');}return _0x5d721d[_0x3157('0x51')](_0x30cc7c,util[_0x3157('0x55')](_0x3157('0x56'),path[_0x3157('0x57')](_0x3a658f[_0x3157('0x6')])),function(_0x450af6){if(_0x450af6){throw new db[(_0x3157('0x5b'))]['Error'](_0x3157('0x66'));}fs[_0x3157('0x67')](_0x30cc7c);logger[_0x3157('0x68')]('Download\x20completed');logger[_0x3157('0x68')](_0x3157('0x69'));});});}return null;})['catch'](handleError(_0x5d721d,null));};exports[_0x3157('0x6a')]=function(_0x2b11a,_0x4a2fc3,_0x1a60be){var _0x1a1300=path[_0x3157('0x57')](_0x2b11a[_0x3157('0x6b')][_0x3157('0x6c')],path[_0x3157('0x6d')](_0x2b11a[_0x3157('0x6b')][_0x3157('0x6c')]));var _0x154239=path[_0x3157('0x61')](config['root'],_0x3157('0x54'),_0x2b11a[_0x3157('0x6b')][_0x3157('0x6c')]);var _0x1acd31=path[_0x3157('0x61')](config[_0x3157('0x5f')],'server/files/plugins',_0x1a1300);logger['info'](_0x3157('0x6e'),_0x154239);logger['info'](_0x3157('0x6f'),_0x1acd31);try{fs[_0x3157('0x70')](_0x154239,parseInt(_0x3157('0x71'),0x8));extract(_0x154239,{'dir':_0x1acd31},function(_0x3c4d99){if(_0x3c4d99){logger['error'](_0x3c4d99);handleError(_0x3c4d99,!![]);};var _0x579b15=fs[_0x3157('0x72')](_0x1acd31);if(_0x579b15['length']>0x1){removeReferences(_0x154239,_0x1acd31);logger['error'](_0x3157('0x73'));return _0x1a60be(new Error('Invalid\x20plugin\x20structure'));}var _0x124040=fs[_0x3157('0x74')](path['join'](_0x1acd31,_0x579b15[0x0]));if(_0x124040['isFile']()){removeReferences(_0x154239,_0x1acd31);logger[_0x3157('0x33')](_0x3157('0x73'));return _0x1a60be(new Error(_0x3157('0x73')));}if(_0x124040[_0x3157('0x75')]()){var _0x26ace2=fs[_0x3157('0x72')](path[_0x3157('0x61')](_0x1acd31,_0x579b15[0x0]));if(_0x26ace2['length']===0x0){removeReferences(_0x154239,_0x1acd31);logger[_0x3157('0x33')](_0x3157('0x73'));return _0x1a60be(new Error(_0x3157('0x73')));}var _0x3b8052=_0x26ace2[_0x3157('0x76')](function(_0x16dcff){return _0x16dcff===_0x3157('0x77');});if(!_0x3b8052){return _0x1a60be(new Error(_0x3157('0x78')));}var _0x2d1dd5=fs[_0x3157('0x79')](path['join'](_0x1acd31,_0x579b15[0x0],_0x3157('0x77')));var _0x211607=JSON[_0x3157('0x7a')](_0x2d1dd5);if(_0x3157('0x7b')==typeof _0x211607['name']){return _0x1a60be(new Error(_0x3157('0x7c')));}if(_0x3157('0x7b')==typeof _0x211607[_0x3157('0x39')]){return _0x1a60be(new Error(_0x3157('0x7d')));}if(_0x3157('0x7b')==typeof _0x211607['version']){return _0x1a60be(new Error(_0x3157('0x7e')));}if('undefined'==typeof _0x211607[_0x3157('0x7f')]){return _0x1a60be(new Error(_0x3157('0x80')));}if(_0x211607['type']===_0x3157('0x81')){if(_0x3157('0x7b')==typeof _0x211607[_0x3157('0x7f')][_0x3157('0x82')]){return _0x1a60be(new Error(_0x3157('0x83')));}if(_0x3157('0x7b')==typeof _0x211607[_0x3157('0x7f')][_0x3157('0x82')][_0x3157('0x84')]&&_0x3157('0x7b')==typeof _0x211607['parameters']['views'][_0x3157('0x85')]){return _0x1a60be(new Error(_0x3157('0x86')));}}else if(_0x211607[_0x3157('0x39')]===_0x3157('0x87')){if('undefined'==typeof _0x211607[_0x3157('0x7f')][_0x3157('0x88')]){return _0x1a60be(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x3157('0x7b')==typeof _0x211607[_0x3157('0x7f')]['scriptPath']){return _0x1a60be(new Error(_0x3157('0x89')));}}else{return _0x1a60be(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x5bd83e=_0x211607[_0x3157('0x34')];var _0xe7e016=_0x211607[_0x3157('0x8a')];var _0x3d1b3c=_0x211607[_0x3157('0x39')];var _0xd51a5b=_0x211607[_0x3157('0x8b')]?_0x211607[_0x3157('0x8b')]:_0x3157('0x8c');var _0x23df9d=_0x211607[_0x3157('0x8d')]?_0x211607['icon']:_0x3157('0x8e');var _0x204179='';var _0x1c45cd='';var _0x13a28f='';var _0x2ab1b9='';var _0x3137a7=_0x211607[_0x3157('0x8f')];if(_0x3d1b3c===_0x3157('0x81')){if(_0x3157('0x7b')!=typeof _0x211607[_0x3157('0x7f')][_0x3157('0x82')][_0x3157('0x84')]){var _0x56a267=_0x211607[_0x3157('0x7f')][_0x3157('0x82')][_0x3157('0x84')];if(!/^(f|ht)tps?:\/\//i[_0x3157('0x90')](_0x56a267)){_0x204179=path[_0x3157('0x61')](_0x3157('0x91'),_0x1a1300,_0x579b15[0x0],_0x56a267);}else{_0x204179=_0x56a267;}}else{logger[_0x3157('0x68')](_0x3157('0x92'));}if(_0x3157('0x7b')!=typeof _0x211607[_0x3157('0x7f')][_0x3157('0x82')][_0x3157('0x85')]){var _0x5541bf=_0x211607[_0x3157('0x7f')]['views']['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0x5541bf)){_0x1c45cd=path['join'](_0x3157('0x91'),_0x1a1300,_0x579b15[0x0],_0x5541bf);}else{_0x1c45cd=_0x5541bf;}}else{logger[_0x3157('0x68')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x3d1b3c===_0x3157('0x87')){_0x13a28f=_0x211607[_0x3157('0x7f')][_0x3157('0x88')];_0x2ab1b9=_0x211607[_0x3157('0x7f')][_0x3157('0x93')];if(_0x3157('0x7b')!=typeof _0x211607[_0x3157('0x7f')][_0x3157('0x82')]){if(_0x3157('0x7b')!=typeof _0x211607[_0x3157('0x7f')][_0x3157('0x82')][_0x3157('0x84')]){var _0x56a267=_0x211607['parameters'][_0x3157('0x82')][_0x3157('0x84')];if(!/^(f|ht)tps?:\/\//i[_0x3157('0x90')](_0x56a267)){_0x204179=path[_0x3157('0x61')]('plugins',_0x1a1300,_0x579b15[0x0],_0x56a267);}else{_0x204179=_0x56a267;}}if('undefined'!=typeof _0x211607[_0x3157('0x7f')][_0x3157('0x82')][_0x3157('0x85')]){var _0x5541bf=_0x211607[_0x3157('0x7f')][_0x3157('0x82')][_0x3157('0x85')];if(!/^(f|ht)tps?:\/\//i[_0x3157('0x90')](_0x5541bf)){_0x1c45cd=path['join'](_0x3157('0x91'),_0x1a1300,_0x579b15[0x0],_0x5541bf);}else{_0x1c45cd=_0x5541bf;}}}}var _0x5d15fb={'name':_0x5bd83e,'description':_0xe7e016,'path':path[_0x3157('0x61')](_0x1a1300,_0x579b15[0x0]),'type':_0x3d1b3c,'sidebar':_0xd51a5b,'icon':_0x23df9d,'adminUrl':_0x204179,'agentUrl':_0x1c45cd,'scriptName':_0x13a28f,'scriptPath':_0x2ab1b9,'version':_0x3137a7};removeReferences(_0x154239,null);return db[_0x3157('0x36')][_0x3157('0x94')](_0x5d15fb)[_0x3157('0x2e')](function(_0x548fb7){var _0x3b0596={'role':_0x2b11a['body'][_0x3157('0x95')],'userProfileId':_0x2b11a['body']['userProfileId']};if(!_0x3b0596)throw new Error(_0x3157('0x96'));if(_0x3b0596[_0x3157('0x95')]===_0x3157('0x97')){var _0x4953fc=_0x548fb7[_0x3157('0x30')]({'plain':!![]});return db[_0x3157('0x98')][_0x3157('0x52')]({'where':{'name':_0x3157('0x99'),'userProfileId':_0x3b0596[_0x3157('0x9a')]},'raw':!![]})[_0x3157('0x2e')](function(_0x177ad8){if(_0x177ad8&&_0x177ad8[_0x3157('0x9b')]===0x0){return db[_0x3157('0x31')][_0x3157('0x94')]({'name':_0x4953fc[_0x3157('0x34')],'resourceId':_0x4953fc['id'],'type':_0x177ad8[_0x3157('0x34')],'sectionId':_0x177ad8['id']},{})[_0x3157('0x2e')](function(){return _0x548fb7;});}else{return _0x548fb7;}})[_0x3157('0x4e')](function(_0x2a817a){logger[_0x3157('0x33')](_0x3157('0x9c'),_0x2a817a);throw _0x2a817a;});}return _0x548fb7;})['then'](respondWithResult(_0x4a2fc3,null))[_0x3157('0x4e')](handleError(_0x4a2fc3,null));}});}catch(_0x367ee0){_0x4a2fc3[_0x3157('0x22')](0x1f4)['send'](_0x367ee0);}};function removeReferences(_0x97314c,_0x318df8){try{if(_0x97314c){fs[_0x3157('0x67')](_0x97314c);logger[_0x3157('0x68')](_0x3157('0x9d'));}if(_0x318df8){rimraf(_0x318df8,function(){});logger[_0x3157('0x68')](_0x3157('0x9e'));}}catch(_0x1db8b3){logger[_0x3157('0x33')](_0x1db8b3);}}exports[_0x3157('0x2d')]=function(_0x28ae5f,_0xb5d29b,_0x32a678){return db[_0x3157('0x36')][_0x3157('0x52')]({'where':{'id':_0x28ae5f[_0x3157('0x53')]['id']}})[_0x3157('0x2e')](handleEntityNotFound(_0xb5d29b,null))['then'](saveUpdates(_0x28ae5f['body'],null))[_0x3157('0x2e')](respondWithResult(_0xb5d29b,null))[_0x3157('0x4e')](handleError(_0xb5d29b,null));};exports[_0x3157('0x9f')]=function(_0x4c3bc6,_0x21e376,_0x2530f8){return db['Plugin']['find']({'where':{'id':_0x4c3bc6[_0x3157('0x53')]['id']}})[_0x3157('0x2e')](function(_0x55fee7){if(_0x55fee7){return _0x55fee7[_0x3157('0x2f')]();}})['then'](function(_0x5532eb){rimraf(path[_0x3157('0x61')](config['root'],_0x3157('0x54'),path['dirname'](_0x5532eb[_0x3157('0x6')])),function(){});return _0x5532eb;})['then'](handleEntityNotFound(_0x21e376,null))[_0x3157('0x2e')](respondWithStatusCode(_0x21e376,null))[_0x3157('0x4e')](handleError(_0x21e376,null));};exports[_0x3157('0xa0')]=function(_0x372ec2,_0x1bc9c0,_0x203a80){return BPromise[_0x3157('0xa1')]()[_0x3157('0x2e')](function(){if(!_0x372ec2[_0x3157('0x3c')][_0x3157('0x6')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x372ec2['query']['port']){throw new Error(_0x3157('0xa2'));}var _0x321b9a=_0x372ec2['query']['hostname']?_0x372ec2[_0x3157('0x3c')][_0x3157('0xa3')]+':'+_0x372ec2['query']['port']:_0x3157('0xa4')+_0x372ec2['query']['port'];var _0x395bd4=_0x372ec2['query']['json']?_0x372ec2[_0x3157('0x3c')][_0x3157('0x24')]:!![];var _0x1f04f6=_0x372ec2[_0x3157('0x3c')]['encoding']?_0x372ec2[_0x3157('0x3c')][_0x3157('0xa5')]:null;var _0x1fbb8a={'method':_0x372ec2['method'],'uri':util[_0x3157('0x55')](_0x3157('0xa6'),_0x321b9a,_0x372ec2[_0x3157('0x3c')]['path']),'json':_0x395bd4,'resolveWithFullResponse':!![],'encoding':_0x1f04f6,'qs':_0x372ec2[_0x3157('0x3c')]};if(_0x372ec2['headers']){_0x1fbb8a[_0x3157('0xa7')]=_0x372ec2[_0x3157('0xa7')];if(_0x1fbb8a['headers']['content-length']){delete _0x1fbb8a[_0x3157('0xa7')][_0x3157('0xa8')];}}if(_0x1fbb8a[_0x3157('0xa7')][_0x3157('0xa9')]){delete _0x1fbb8a[_0x3157('0xa7')]['content-type'];}return rp(_0x1fbb8a);})[_0x3157('0x2e')](function(_0x541312){if(_0x541312){_0x1bc9c0['set'](_0x541312[_0x3157('0xa7')]);logger[_0x3157('0x68')](_0x541312['body']);if(_[_0x3157('0xaa')](_0x372ec2[_0x3157('0x3c')]['path'],_0x3157('0x51'))&&_0x541312[_0x3157('0xab')]==0x1f4){return _0x1bc9c0['sendStatus'](_0x541312[_0x3157('0xab')]);}else{return _0x1bc9c0[_0x3157('0x22')](_0x541312[_0x3157('0xab')])['send'](_0x541312[_0x3157('0xac')]);}}else{return _0x1bc9c0[_0x3157('0x32')](0xc8);}})[_0x3157('0x4e')](handleError(_0x1bc9c0,null));};exports[_0x3157('0xad')]=function(_0x9935db,_0x13bcd0,_0x5127b8){return BPromise['resolve']()['then'](function(){if(!_0x9935db[_0x3157('0x3c')][_0x3157('0x6')]){throw new Error(_0x3157('0xae'));}if(!_0x9935db[_0x3157('0x3c')][_0x3157('0xaf')]){throw new Error(_0x3157('0xa2'));}var _0xe2711=_0x9935db[_0x3157('0x3c')]['hostname']?_0x9935db[_0x3157('0x3c')][_0x3157('0xa3')]+':'+_0x9935db[_0x3157('0x3c')][_0x3157('0xaf')]:_0x3157('0xa4')+_0x9935db[_0x3157('0x3c')][_0x3157('0xaf')];var _0x451f31=_0x9935db[_0x3157('0x3c')][_0x3157('0x24')]?_0x9935db['query'][_0x3157('0x24')]:!![];var _0x43a052=_0x9935db[_0x3157('0x3c')]['encoding']?_0x9935db[_0x3157('0x3c')]['encoding']:null;var _0x961c6a={'method':_0x9935db[_0x3157('0xb0')],'uri':util[_0x3157('0x55')](_0x3157('0xa6'),_0xe2711,_0x9935db['query'][_0x3157('0x6')]),'json':_0x451f31,'resolveWithFullResponse':!![],'encoding':_0x43a052,'body':_0x9935db['body']};if(_0x9935db[_0x3157('0xa7')]){_0x961c6a[_0x3157('0xa7')]=_0x9935db[_0x3157('0xa7')];if(_0x961c6a['headers'][_0x3157('0xa8')]){delete _0x961c6a[_0x3157('0xa7')][_0x3157('0xa8')];}}if(_0x961c6a['headers'][_0x3157('0xa9')]){delete _0x961c6a[_0x3157('0xa7')]['content-type'];}return rp(_0x961c6a);})[_0x3157('0x2e')](function(_0x2da8eb){if(_0x2da8eb){_0x13bcd0[_0x3157('0x28')](_0x2da8eb[_0x3157('0xa7')]);logger[_0x3157('0x68')](_0x2da8eb['body']);return _0x13bcd0['status'](_0x2da8eb[_0x3157('0xab')])['send'](_0x2da8eb[_0x3157('0xac')]);}else{return _0x13bcd0['sendStatus'](0xc8);}})[_0x3157('0x4e')](handleError(_0x13bcd0,null));}; \ No newline at end of file +var _0x99df=['defaults','localhost','socket.io-emitter','end','status','json','count','set','reject','save','then','destroy','get','Plugins','sendStatus','error','stack','name','send','map','Plugin','rawAttributes','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','offset','order','sort','pick','filter','where','merge','options','includeAll','findAll','rows','catch','show','params','find','join','root','server/files/plugins','format','zip','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','dirname','basename','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','%s.zip','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','extname','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','undefined','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','parameters','Invalid\x20manifest:\x20parameters\x20missing','Invalid\x20manifest:\x20views\x20missing','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','sidebar','always','icon','icon-apps','html','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','script','scriptPath','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','headers','content-length','content-type','endsWith','statusCode','webhookPost','resolve','%s%s','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','extract-zip','archiver','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis'];(function(_0x485444,_0x3b6978){var _0x583491=function(_0x1abff6){while(--_0x1abff6){_0x485444['push'](_0x485444['shift']());}};_0x583491(++_0x3b6978);}(_0x99df,0x1e7));var _0xf99d=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x99df[_0x3b0731];return _0x4204d7;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf99d('0x0'));var rimraf=require(_0xf99d('0x1'));var zipdir=require(_0xf99d('0x2'));var jsonpatch=require(_0xf99d('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf99d('0x4'));var Mustache=require(_0xf99d('0x5'));var util=require(_0xf99d('0x6'));var path=require(_0xf99d('0x7'));var sox=require(_0xf99d('0x8'));var csv=require('to-csv');var ejs=require(_0xf99d('0x9'));var fs=require('fs');var _=require(_0xf99d('0xa'));var squel=require(_0xf99d('0xb'));var crypto=require(_0xf99d('0xc'));var jsforce=require(_0xf99d('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf99d('0xe'));var Papa=require(_0xf99d('0xf'));var extract=require(_0xf99d('0x10'));var rimraf=require('rimraf');var archiver=require(_0xf99d('0x11'));var Redis=require('ioredis');var authService=require(_0xf99d('0x12'));var qs=require(_0xf99d('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf99d('0x14'));var logger=require(_0xf99d('0x15'))(_0xf99d('0x16'));var utils=require('../../config/utils');var config=require(_0xf99d('0x17'));var db=require(_0xf99d('0x18'))['db'];config[_0xf99d('0x19')]=_[_0xf99d('0x1a')](config[_0xf99d('0x19')],{'host':_0xf99d('0x1b'),'port':0x18eb});var socket=require(_0xf99d('0x1c'))(new Redis(config[_0xf99d('0x19')]));require('./plugin.socket')['register'](socket);function respondWithStatusCode(_0x352875,_0x3b5905){_0x3b5905=_0x3b5905||0xcc;return function(_0x12988b){if(_0x12988b){return _0x352875['sendStatus'](_0x3b5905);}return _0x352875['status'](_0x3b5905)[_0xf99d('0x1d')]();};}function respondWithResult(_0x5ad03f,_0x5e9b7d){_0x5e9b7d=_0x5e9b7d||0xc8;return function(_0x3366b2){if(_0x3366b2){return _0x5ad03f[_0xf99d('0x1e')](_0x5e9b7d)[_0xf99d('0x1f')](_0x3366b2);}};}function respondWithFilteredResult(_0x599210,_0x408f30){return function(_0x44025e){if(_0x44025e){var _0x2598b2=_0x44025e[_0xf99d('0x20')],_0x1d00d6=_0x408f30['offset'],_0x197e7a=_0x408f30['offset']+_0x408f30['limit'],_0xe2840d;if(_0x197e7a>=_0x2598b2){_0x197e7a=_0x2598b2;_0xe2840d=0xc8;}else{_0xe2840d=0xce;}_0x599210[_0xf99d('0x1e')](_0xe2840d);return _0x599210[_0xf99d('0x21')]('Content-Range',_0x1d00d6+'-'+_0x197e7a+'/'+_0x2598b2)[_0xf99d('0x1f')](_0x44025e);}return null;};}function patchUpdates(_0x4b32ed){return function(_0x31dc84){try{jsonpatch['apply'](_0x31dc84,_0x4b32ed,!![]);}catch(_0x39a348){return BPromise[_0xf99d('0x22')](_0x39a348);}return _0x31dc84[_0xf99d('0x23')]();};}function saveUpdates(_0x364bd6,_0x120b81){return function(_0x55181e){if(_0x55181e){return _0x55181e['update'](_0x364bd6)[_0xf99d('0x24')](function(_0x2df763){return _0x2df763;});}return null;};}function removeEntity(_0xcd9bd7,_0x12a354){return function(_0x22bad8){if(_0x22bad8){return _0x22bad8[_0xf99d('0x25')]()[_0xf99d('0x24')](function(){var _0x252337=_0x22bad8[_0xf99d('0x26')]({'plain':!![]});var _0x21941b=_0xf99d('0x27');return db['UserProfileResource'][_0xf99d('0x25')]({'where':{'type':_0x21941b,'resourceId':_0x252337['id']}})[_0xf99d('0x24')](function(){return _0x22bad8;});})[_0xf99d('0x24')](function(){_0xcd9bd7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5eb6ac,_0x42b6d6){return function(_0x59b898){if(!_0x59b898){_0x5eb6ac[_0xf99d('0x28')](0x194);}return _0x59b898;};}function handleError(_0x45f6f3,_0x9defe4){_0x9defe4=_0x9defe4||0x1f4;return function(_0x33a62e){logger[_0xf99d('0x29')](_0x33a62e[_0xf99d('0x2a')]);if(_0x33a62e[_0xf99d('0x2b')]){delete _0x33a62e[_0xf99d('0x2b')];}_0x45f6f3[_0xf99d('0x1e')](_0x9defe4)[_0xf99d('0x2c')](_0x33a62e);};}exports['index']=function(_0x26af50,_0xb6b125){var _0x582307={},_0x189115={},_0x5412cf={'count':0x0,'rows':[]};var _0x288849=_[_0xf99d('0x2d')](db[_0xf99d('0x2e')][_0xf99d('0x2f')],function(_0x22f055){return{'name':_0x22f055['fieldName'],'type':_0x22f055[_0xf99d('0x30')]['key']};});_0x189115[_0xf99d('0x31')]=_[_0xf99d('0x2d')](_0x288849,'name');_0x189115['query']=_[_0xf99d('0x32')](_0x26af50[_0xf99d('0x33')]);_0x189115[_0xf99d('0x34')]=_['intersection'](_0x189115[_0xf99d('0x31')],_0x189115[_0xf99d('0x33')]);_0x582307['attributes']=_[_0xf99d('0x35')](_0x189115['model'],qs[_0xf99d('0x36')](_0x26af50[_0xf99d('0x33')][_0xf99d('0x36')]));_0x582307[_0xf99d('0x37')]=_0x582307[_0xf99d('0x37')][_0xf99d('0x38')]?_0x582307[_0xf99d('0x37')]:_0x189115[_0xf99d('0x31')];if(!_0x26af50[_0xf99d('0x33')][_0xf99d('0x39')](_0xf99d('0x3a'))){_0x582307[_0xf99d('0x3b')]=qs[_0xf99d('0x3b')](_0x26af50[_0xf99d('0x33')][_0xf99d('0x3b')]);_0x582307['offset']=qs['offset'](_0x26af50[_0xf99d('0x33')][_0xf99d('0x3c')]);}_0x582307[_0xf99d('0x3d')]=qs[_0xf99d('0x3e')](_0x26af50[_0xf99d('0x33')]['sort']);_0x582307['where']=qs[_0xf99d('0x34')](_[_0xf99d('0x3f')](_0x26af50[_0xf99d('0x33')],_0x189115[_0xf99d('0x34')]));if(_0x26af50[_0xf99d('0x33')][_0xf99d('0x40')]){_0x582307[_0xf99d('0x41')]=_['merge'](_0x582307['where'],{'$or':_[_0xf99d('0x2d')](_0x288849,function(_0x5cf0ba){if(_0x5cf0ba[_0xf99d('0x30')]!=='VIRTUAL'){var _0x118458={};_0x118458[_0x5cf0ba['name']]={'$like':'%'+_0x26af50['query'][_0xf99d('0x40')]+'%'};return _0x118458;}})});}_0x582307=_[_0xf99d('0x42')]({},_0x582307,_0x26af50[_0xf99d('0x43')]);var _0x55d124={'where':_0x582307[_0xf99d('0x41')]};return db[_0xf99d('0x2e')][_0xf99d('0x20')](_0x55d124)[_0xf99d('0x24')](function(_0x48ced7){_0x5412cf['count']=_0x48ced7;if(_0x26af50[_0xf99d('0x33')][_0xf99d('0x44')]){_0x582307['include']=[{'all':!![]}];}return db[_0xf99d('0x2e')][_0xf99d('0x45')](_0x582307);})['then'](function(_0x5c41c6){_0x5412cf[_0xf99d('0x46')]=_0x5c41c6;return _0x5412cf;})[_0xf99d('0x24')](respondWithFilteredResult(_0xb6b125,_0x582307))[_0xf99d('0x47')](handleError(_0xb6b125,null));};exports[_0xf99d('0x48')]=function(_0x7edc2a,_0x240e62){var _0x1bcab0={'raw':!![],'where':{'id':_0x7edc2a[_0xf99d('0x49')]['id']}},_0x4bcf41={};_0x4bcf41['model']=_['keys'](db[_0xf99d('0x2e')][_0xf99d('0x2f')]);_0x4bcf41[_0xf99d('0x33')]=_['keys'](_0x7edc2a['query']);_0x4bcf41['filters']=_[_0xf99d('0x35')](_0x4bcf41[_0xf99d('0x31')],_0x4bcf41[_0xf99d('0x33')]);_0x1bcab0[_0xf99d('0x37')]=_[_0xf99d('0x35')](_0x4bcf41[_0xf99d('0x31')],qs[_0xf99d('0x36')](_0x7edc2a[_0xf99d('0x33')]['fields']));_0x1bcab0[_0xf99d('0x37')]=_0x1bcab0['attributes']['length']?_0x1bcab0[_0xf99d('0x37')]:_0x4bcf41['model'];if(_0x7edc2a[_0xf99d('0x33')][_0xf99d('0x44')]){_0x1bcab0['include']=[{'all':!![]}];}_0x1bcab0=_['merge']({},_0x1bcab0,_0x7edc2a[_0xf99d('0x43')]);return db['Plugin'][_0xf99d('0x4a')](_0x1bcab0)[_0xf99d('0x24')](handleEntityNotFound(_0x240e62,null))['then'](respondWithResult(_0x240e62,null))[_0xf99d('0x47')](handleError(_0x240e62,null));};exports['download']=function(_0x41f48f,_0x31a770,_0xba0c14){return db[_0xf99d('0x2e')]['find']({'where':{'id':_0x41f48f[_0xf99d('0x49')]['id']},'attributes':[_0xf99d('0x2b'),_0xf99d('0x7')],'raw':!![]})[_0xf99d('0x24')](handleEntityNotFound(_0x31a770,null))[_0xf99d('0x24')](function(_0x18d051){if(_0x18d051){var _0xae8c78=path[_0xf99d('0x4b')](config[_0xf99d('0x4c')],_0xf99d('0x4d'),util[_0xf99d('0x4e')]('%s.zip',path['basename'](_0x18d051['path'])));var _0x51178e=fs['createWriteStream'](_0xae8c78);var _0xacdaa4=archiver(_0xf99d('0x4f'),{'zlib':{'level':0x9}});_0xacdaa4['on']('warning',function(_0x4c50a6){if(_0x4c50a6[_0xf99d('0x50')]===_0xf99d('0x51')){logger['error'](_0x4c50a6);}else{throw new db[(_0xf99d('0x52'))][(_0xf99d('0x53'))](_0xf99d('0x54'));}});_0xacdaa4['on']('error',function(_0x2b6b07){throw new db[(_0xf99d('0x52'))][(_0xf99d('0x53'))](_0xf99d('0x54'));});_0xacdaa4[_0xf99d('0x55')](_0x51178e);_0xacdaa4[_0xf99d('0x56')](_0xf99d('0x57'),{'cwd':path[_0xf99d('0x4b')](config['root'],'server/files/plugins',path[_0xf99d('0x58')](_0x18d051[_0xf99d('0x7')])),'ignore':[path[_0xf99d('0x4b')](path[_0xf99d('0x59')](_0x18d051['path']),_0xf99d('0x5a')),path['join'](path[_0xf99d('0x59')](_0x18d051[_0xf99d('0x7')]),_0xf99d('0x5b'))],'nodir':!![]})[_0xf99d('0x5c')]();_0x51178e['on'](_0xf99d('0x5d'),function(){if(!fs[_0xf99d('0x5e')](_0xae8c78)){throw new db['Sequelize']['Error'](_0xf99d('0x5f'));}return _0x31a770['download'](_0xae8c78,util[_0xf99d('0x4e')](_0xf99d('0x60'),path['basename'](_0x18d051[_0xf99d('0x7')])),function(_0x5d621b){if(_0x5d621b){throw new db[(_0xf99d('0x52'))][(_0xf99d('0x53'))](_0xf99d('0x61'));}fs[_0xf99d('0x62')](_0xae8c78);logger[_0xf99d('0x63')](_0xf99d('0x64'));logger['info'](_0xf99d('0x65'));});});}return null;})['catch'](handleError(_0x31a770,null));};exports[_0xf99d('0x66')]=function(_0x50d7d2,_0x387485,_0xdd2270){var _0x65e54f=path['basename'](_0x50d7d2['file']['filename'],path[_0xf99d('0x67')](_0x50d7d2[_0xf99d('0x68')][_0xf99d('0x69')]));var _0x514f2b=path[_0xf99d('0x4b')](config[_0xf99d('0x4c')],_0xf99d('0x4d'),_0x50d7d2[_0xf99d('0x68')][_0xf99d('0x69')]);var _0x4d0b4b=path[_0xf99d('0x4b')](config['root'],_0xf99d('0x4d'),_0x65e54f);logger[_0xf99d('0x63')](_0xf99d('0x6a'),_0x514f2b);logger[_0xf99d('0x63')](_0xf99d('0x6b'),_0x4d0b4b);try{fs[_0xf99d('0x6c')](_0x514f2b,parseInt('0777',0x8));extract(_0x514f2b,{'dir':_0x4d0b4b},function(_0x4c978a){if(_0x4c978a){logger['error'](_0x4c978a);handleError(_0x4c978a,!![]);};var _0x355043=fs[_0xf99d('0x6d')](_0x4d0b4b);if(_0x355043['length']>0x1){removeReferences(_0x514f2b,_0x4d0b4b);logger['error'](_0xf99d('0x6e'));return _0xdd2270(new Error(_0xf99d('0x6e')));}var _0x2bdb4e=fs[_0xf99d('0x6f')](path['join'](_0x4d0b4b,_0x355043[0x0]));if(_0x2bdb4e[_0xf99d('0x70')]()){removeReferences(_0x514f2b,_0x4d0b4b);logger[_0xf99d('0x29')](_0xf99d('0x6e'));return _0xdd2270(new Error('Invalid\x20plugin\x20structure'));}if(_0x2bdb4e[_0xf99d('0x71')]()){var _0x305d51=fs[_0xf99d('0x6d')](path['join'](_0x4d0b4b,_0x355043[0x0]));if(_0x305d51['length']===0x0){removeReferences(_0x514f2b,_0x4d0b4b);logger[_0xf99d('0x29')](_0xf99d('0x6e'));return _0xdd2270(new Error(_0xf99d('0x6e')));}var _0x8ca53d=_0x305d51['some'](function(_0x53e36e){return _0x53e36e===_0xf99d('0x72');});if(!_0x8ca53d){return _0xdd2270(new Error(_0xf99d('0x73')));}var _0x2d87c6=fs[_0xf99d('0x74')](path[_0xf99d('0x4b')](_0x4d0b4b,_0x355043[0x0],_0xf99d('0x72')));var _0xf920d3=JSON[_0xf99d('0x75')](_0x2d87c6);if(_0xf99d('0x76')==typeof _0xf920d3['name']){return _0xdd2270(new Error(_0xf99d('0x77')));}if(_0xf99d('0x76')==typeof _0xf920d3[_0xf99d('0x30')]){return _0xdd2270(new Error(_0xf99d('0x78')));}if(_0xf99d('0x76')==typeof _0xf920d3[_0xf99d('0x79')]){return _0xdd2270(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0xf99d('0x76')==typeof _0xf920d3[_0xf99d('0x7a')]){return _0xdd2270(new Error(_0xf99d('0x7b')));}if(_0xf920d3[_0xf99d('0x30')]==='html'){if(_0xf99d('0x76')==typeof _0xf920d3[_0xf99d('0x7a')]['views']){return _0xdd2270(new Error(_0xf99d('0x7c')));}if('undefined'==typeof _0xf920d3[_0xf99d('0x7a')][_0xf99d('0x7d')][_0xf99d('0x7e')]&&_0xf99d('0x76')==typeof _0xf920d3[_0xf99d('0x7a')]['views'][_0xf99d('0x7f')]){return _0xdd2270(new Error(_0xf99d('0x80')));}}else if(_0xf920d3[_0xf99d('0x30')]==='script'){if(_0xf99d('0x76')==typeof _0xf920d3[_0xf99d('0x7a')]['scriptName']){return _0xdd2270(new Error(_0xf99d('0x81')));}if(_0xf99d('0x76')==typeof _0xf920d3[_0xf99d('0x7a')]['scriptPath']){return _0xdd2270(new Error(_0xf99d('0x82')));}}else{return _0xdd2270(new Error(_0xf99d('0x83')));}var _0x380389=_0xf920d3[_0xf99d('0x2b')];var _0x4e83ff=_0xf920d3['description'];var _0xcf0c52=_0xf920d3[_0xf99d('0x30')];var _0x4cbef0=_0xf920d3[_0xf99d('0x84')]?_0xf920d3['sidebar']:_0xf99d('0x85');var _0x36e124=_0xf920d3[_0xf99d('0x86')]?_0xf920d3[_0xf99d('0x86')]:_0xf99d('0x87');var _0x14184b='';var _0x1a925a='';var _0x348f30='';var _0x280c4f='';var _0x1e908d=_0xf920d3['version'];if(_0xcf0c52===_0xf99d('0x88')){if(_0xf99d('0x76')!=typeof _0xf920d3[_0xf99d('0x7a')][_0xf99d('0x7d')][_0xf99d('0x7e')]){var _0x38500b=_0xf920d3[_0xf99d('0x7a')][_0xf99d('0x7d')][_0xf99d('0x7e')];if(!/^(f|ht)tps?:\/\//i[_0xf99d('0x89')](_0x38500b)){_0x14184b=path[_0xf99d('0x4b')](_0xf99d('0x8a'),_0x65e54f,_0x355043[0x0],_0x38500b);}else{_0x14184b=_0x38500b;}}else{logger[_0xf99d('0x63')](_0xf99d('0x8b'));}if(_0xf99d('0x76')!=typeof _0xf920d3[_0xf99d('0x7a')][_0xf99d('0x7d')]['agent']){var _0x2c4a30=_0xf920d3[_0xf99d('0x7a')][_0xf99d('0x7d')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0xf99d('0x89')](_0x2c4a30)){_0x1a925a=path[_0xf99d('0x4b')](_0xf99d('0x8a'),_0x65e54f,_0x355043[0x0],_0x2c4a30);}else{_0x1a925a=_0x2c4a30;}}else{logger['info'](_0xf99d('0x8c'));}}else if(_0xcf0c52===_0xf99d('0x8d')){_0x348f30=_0xf920d3['parameters']['scriptName'];_0x280c4f=_0xf920d3['parameters'][_0xf99d('0x8e')];if(_0xf99d('0x76')!=typeof _0xf920d3[_0xf99d('0x7a')][_0xf99d('0x7d')]){if(_0xf99d('0x76')!=typeof _0xf920d3[_0xf99d('0x7a')][_0xf99d('0x7d')]['admin']){var _0x38500b=_0xf920d3[_0xf99d('0x7a')][_0xf99d('0x7d')][_0xf99d('0x7e')];if(!/^(f|ht)tps?:\/\//i[_0xf99d('0x89')](_0x38500b)){_0x14184b=path['join']('plugins',_0x65e54f,_0x355043[0x0],_0x38500b);}else{_0x14184b=_0x38500b;}}if(_0xf99d('0x76')!=typeof _0xf920d3['parameters'][_0xf99d('0x7d')]['agent']){var _0x2c4a30=_0xf920d3['parameters'][_0xf99d('0x7d')][_0xf99d('0x7f')];if(!/^(f|ht)tps?:\/\//i['test'](_0x2c4a30)){_0x1a925a=path[_0xf99d('0x4b')](_0xf99d('0x8a'),_0x65e54f,_0x355043[0x0],_0x2c4a30);}else{_0x1a925a=_0x2c4a30;}}}}var _0x59d885={'name':_0x380389,'description':_0x4e83ff,'path':path[_0xf99d('0x4b')](_0x65e54f,_0x355043[0x0]),'type':_0xcf0c52,'sidebar':_0x4cbef0,'icon':_0x36e124,'adminUrl':_0x14184b,'agentUrl':_0x1a925a,'scriptName':_0x348f30,'scriptPath':_0x280c4f,'version':_0x1e908d};removeReferences(_0x514f2b,null);return db[_0xf99d('0x2e')][_0xf99d('0x8f')](_0x59d885)[_0xf99d('0x24')](function(_0x4098bf){var _0x1d0e30={'role':_0x50d7d2[_0xf99d('0x90')][_0xf99d('0x91')],'userProfileId':_0x50d7d2[_0xf99d('0x90')][_0xf99d('0x92')]};if(!_0x1d0e30)throw new Error(_0xf99d('0x93'));if(_0x1d0e30[_0xf99d('0x91')]===_0xf99d('0x94')){var _0x7bd589=_0x4098bf[_0xf99d('0x26')]({'plain':!![]});return db[_0xf99d('0x95')][_0xf99d('0x4a')]({'where':{'name':_0xf99d('0x27'),'userProfileId':_0x1d0e30[_0xf99d('0x92')]},'raw':!![]})[_0xf99d('0x24')](function(_0x7bb564){if(_0x7bb564&&_0x7bb564[_0xf99d('0x96')]===0x0){return db['UserProfileResource'][_0xf99d('0x8f')]({'name':_0x7bd589['name'],'resourceId':_0x7bd589['id'],'type':_0x7bb564['name'],'sectionId':_0x7bb564['id']},{})[_0xf99d('0x24')](function(){return _0x4098bf;});}else{return _0x4098bf;}})[_0xf99d('0x47')](function(_0x22b7f0){logger[_0xf99d('0x29')](_0xf99d('0x97'),_0x22b7f0);throw _0x22b7f0;});}return _0x4098bf;})[_0xf99d('0x24')](respondWithResult(_0x387485,null))[_0xf99d('0x47')](handleError(_0x387485,null));}});}catch(_0x173055){_0x387485[_0xf99d('0x1e')](0x1f4)[_0xf99d('0x2c')](_0x173055);}};function removeReferences(_0x44eb4f,_0x53cde0){try{if(_0x44eb4f){fs['unlinkSync'](_0x44eb4f);logger['info'](_0xf99d('0x98'));}if(_0x53cde0){rimraf(_0x53cde0,function(){});logger[_0xf99d('0x63')](_0xf99d('0x99'));}}catch(_0x3542fa){logger[_0xf99d('0x29')](_0x3542fa);}}exports['update']=function(_0x307e56,_0x194067,_0x2ac36a){return db[_0xf99d('0x2e')][_0xf99d('0x4a')]({'where':{'id':_0x307e56[_0xf99d('0x49')]['id']}})[_0xf99d('0x24')](handleEntityNotFound(_0x194067,null))[_0xf99d('0x24')](saveUpdates(_0x307e56[_0xf99d('0x90')],null))[_0xf99d('0x24')](respondWithResult(_0x194067,null))[_0xf99d('0x47')](handleError(_0x194067,null));};exports[_0xf99d('0x9a')]=function(_0x2ab848,_0x42252d,_0x55cec5){return db[_0xf99d('0x2e')][_0xf99d('0x4a')]({'where':{'id':_0x2ab848['params']['id']}})[_0xf99d('0x24')](function(_0x3ac351){if(_0x3ac351){return _0x3ac351[_0xf99d('0x25')]();}})['then'](function(_0x5cd38f){rimraf(path[_0xf99d('0x4b')](config['root'],'server/files/plugins',path[_0xf99d('0x58')](_0x5cd38f[_0xf99d('0x7')])),function(){});return _0x5cd38f;})[_0xf99d('0x24')](handleEntityNotFound(_0x42252d,null))[_0xf99d('0x24')](respondWithStatusCode(_0x42252d,null))['catch'](handleError(_0x42252d,null));};exports[_0xf99d('0x9b')]=function(_0x5f110f,_0x48c1cb,_0x38a7ef){return BPromise['resolve']()[_0xf99d('0x24')](function(){if(!_0x5f110f[_0xf99d('0x33')][_0xf99d('0x7')]){throw new Error(_0xf99d('0x9c'));}if(!_0x5f110f[_0xf99d('0x33')][_0xf99d('0x9d')]){throw new Error(_0xf99d('0x9e'));}var _0x1de3b5=_0x5f110f['query'][_0xf99d('0x9f')]?_0x5f110f[_0xf99d('0x33')][_0xf99d('0x9f')]+':'+_0x5f110f['query']['port']:_0xf99d('0xa0')+_0x5f110f[_0xf99d('0x33')][_0xf99d('0x9d')];var _0x1ee4c4=_0x5f110f['query'][_0xf99d('0x1f')]?_0x5f110f[_0xf99d('0x33')][_0xf99d('0x1f')]:!![];var _0x2cc046=_0x5f110f['query'][_0xf99d('0xa1')]?_0x5f110f[_0xf99d('0x33')][_0xf99d('0xa1')]:null;var _0x1cdf10={'method':_0x5f110f[_0xf99d('0xa2')],'uri':util['format']('%s%s',_0x1de3b5,_0x5f110f[_0xf99d('0x33')][_0xf99d('0x7')]),'json':_0x1ee4c4,'resolveWithFullResponse':!![],'encoding':_0x2cc046,'qs':_0x5f110f['query']};if(_0x5f110f[_0xf99d('0xa3')]){_0x1cdf10[_0xf99d('0xa3')]=_0x5f110f[_0xf99d('0xa3')];if(_0x1cdf10[_0xf99d('0xa3')][_0xf99d('0xa4')]){delete _0x1cdf10[_0xf99d('0xa3')][_0xf99d('0xa4')];}}if(_0x1cdf10[_0xf99d('0xa3')][_0xf99d('0xa5')]){delete _0x1cdf10[_0xf99d('0xa3')]['content-type'];}return rp(_0x1cdf10);})[_0xf99d('0x24')](function(_0x2ec2c6){if(_0x2ec2c6){_0x48c1cb[_0xf99d('0x21')](_0x2ec2c6['headers']);logger[_0xf99d('0x63')](_0x2ec2c6[_0xf99d('0x90')]);if(_[_0xf99d('0xa6')](_0x5f110f[_0xf99d('0x33')][_0xf99d('0x7')],'download')&&_0x2ec2c6[_0xf99d('0xa7')]==0x1f4){return _0x48c1cb[_0xf99d('0x28')](_0x2ec2c6['statusCode']);}else{return _0x48c1cb[_0xf99d('0x1e')](_0x2ec2c6[_0xf99d('0xa7')])[_0xf99d('0x2c')](_0x2ec2c6['body']);}}else{return _0x48c1cb[_0xf99d('0x28')](0xc8);}})['catch'](handleError(_0x48c1cb,null));};exports[_0xf99d('0xa8')]=function(_0x57ca0f,_0x59b17d,_0x16f7b6){return BPromise[_0xf99d('0xa9')]()[_0xf99d('0x24')](function(){if(!_0x57ca0f[_0xf99d('0x33')][_0xf99d('0x7')]){throw new Error(_0xf99d('0x9c'));}if(!_0x57ca0f[_0xf99d('0x33')][_0xf99d('0x9d')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x199489=_0x57ca0f[_0xf99d('0x33')]['hostname']?_0x57ca0f['query']['hostname']+':'+_0x57ca0f[_0xf99d('0x33')][_0xf99d('0x9d')]:_0xf99d('0xa0')+_0x57ca0f[_0xf99d('0x33')][_0xf99d('0x9d')];var _0x28a21d=_0x57ca0f[_0xf99d('0x33')]['json']?_0x57ca0f[_0xf99d('0x33')][_0xf99d('0x1f')]:!![];var _0x494285=_0x57ca0f[_0xf99d('0x33')][_0xf99d('0xa1')]?_0x57ca0f['query'][_0xf99d('0xa1')]:null;var _0x354f7b={'method':_0x57ca0f['method'],'uri':util['format'](_0xf99d('0xaa'),_0x199489,_0x57ca0f['query'][_0xf99d('0x7')]),'json':_0x28a21d,'resolveWithFullResponse':!![],'encoding':_0x494285,'body':_0x57ca0f[_0xf99d('0x90')]};if(_0x57ca0f[_0xf99d('0xa3')]){_0x354f7b['headers']=_0x57ca0f[_0xf99d('0xa3')];if(_0x354f7b[_0xf99d('0xa3')][_0xf99d('0xa4')]){delete _0x354f7b['headers'][_0xf99d('0xa4')];}}if(_0x354f7b[_0xf99d('0xa3')]['content-type']){delete _0x354f7b[_0xf99d('0xa3')][_0xf99d('0xa5')];}return rp(_0x354f7b);})[_0xf99d('0x24')](function(_0x1ce77f){if(_0x1ce77f){_0x59b17d['set'](_0x1ce77f[_0xf99d('0xa3')]);logger['info'](_0x1ce77f['body']);return _0x59b17d['status'](_0x1ce77f[_0xf99d('0xa7')])['send'](_0x1ce77f[_0xf99d('0x90')]);}else{return _0x59b17d[_0xf99d('0x28')](0xc8);}})[_0xf99d('0x47')](handleError(_0x59b17d,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index e99bdde..9981879 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 _0x2032=['exports','../../mysqldb','Plugin','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x3c8e9a,_0x384306){var _0x2d4c57=function(_0x43d408){while(--_0x43d408){_0x3c8e9a['push'](_0x3c8e9a['shift']());}};_0x2d4c57(++_0x384306);}(_0x2032,0xd9));var _0x2203=function(_0x97c0ae,_0x171dcd){_0x97c0ae=_0x97c0ae-0x0;var _0x2df78a=_0x2032[_0x97c0ae];return _0x2df78a;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x2203('0x0'))['db'][_0x2203('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x2203('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2203('0x3'),'afterDestroy':_0x2203('0x4')};function emitEvent(_0x4b4c7f){return function(_0x46c49a,_0x880dcd,_0x44ccfd){PluginEvents[_0x2203('0x5')](_0x4b4c7f+':'+_0x46c49a['id'],_0x46c49a);PluginEvents[_0x2203('0x5')](_0x4b4c7f,_0x46c49a);_0x44ccfd(null);};}for(var e in events){if(events[_0x2203('0x6')](e)){var event=events[e];Plugin[_0x2203('0x7')](e,emitEvent(event));}}module[_0x2203('0x8')]=PluginEvents; \ No newline at end of file +var _0x1775=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','Plugin','setMaxListeners','save','update'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x1775,0x1db));var _0x5177=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x1775[_0x1facfa];return _0x9ec701;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x5177('0x0'))['db'][_0x5177('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x5177('0x2')](0x0);var events={'afterCreate':_0x5177('0x3'),'afterUpdate':_0x5177('0x4'),'afterDestroy':_0x5177('0x5')};function emitEvent(_0x420a5b){return function(_0x2027bf,_0x359401,_0x51275f){PluginEvents[_0x5177('0x6')](_0x420a5b+':'+_0x2027bf['id'],_0x2027bf);PluginEvents[_0x5177('0x6')](_0x420a5b,_0x2027bf);_0x51275f(null);};}for(var e in events){if(events[_0x5177('0x7')](e)){var event=events[e];Plugin[_0x5177('0x8')](e,emitEvent(event));}}module[_0x5177('0x9')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index fe86bb1..375e6f1 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 _0x7da7=['util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','exports','define','plugins','lodash'];(function(_0x46c63e,_0xa91409){var _0x58af4b=function(_0x2aac4a){while(--_0x2aac4a){_0x46c63e['push'](_0x46c63e['shift']());}};_0x58af4b(++_0xa91409);}(_0x7da7,0x10d));var _0x77da=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x7da7[_0x5f0089];return _0x193892;};'use strict';var _=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var logger=require(_0x77da('0x2'))('api');var moment=require('moment');var BPromise=require(_0x77da('0x3'));var rp=require(_0x77da('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x77da('0x5'));var config=require(_0x77da('0x6'));var attributes=require('./plugin.attributes');module[_0x77da('0x7')]=function(_0xc54a12,_0x47da81){return _0xc54a12[_0x77da('0x8')]('Plugin',attributes,{'tableName':_0x77da('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb458=['path','rimraf','./plugin.attributes','define','Plugin','plugins','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x2845bb,_0x143b08){var _0x1e3700=function(_0x5ef614){while(--_0x5ef614){_0x2845bb['push'](_0x2845bb['shift']());}};_0x1e3700(++_0x143b08);}(_0xb458,0x103));var _0x8b45=function(_0x4498ba,_0xe67e5d){_0x4498ba=_0x4498ba-0x0;var _0x161740=_0xb458[_0x4498ba];return _0x161740;};'use strict';var _=require(_0x8b45('0x0'));var util=require(_0x8b45('0x1'));var logger=require(_0x8b45('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8b45('0x3'));var rp=require(_0x8b45('0x4'));var fs=require('fs');var path=require(_0x8b45('0x5'));var rimraf=require(_0x8b45('0x6'));var config=require('../../config/environment');var attributes=require(_0x8b45('0x7'));module['exports']=function(_0x5cc2d5,_0xe8d774){return _0x5cc2d5[_0x8b45('0x8')](_0x8b45('0x9'),attributes,{'tableName':_0x8b45('0xa'),'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 b7fbc38..40e513d 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 _0x44b7=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','./plugin.socket','register','request','info','Plugin,\x20%s,\x20%s','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','error','code','message','CreatePlugin','create','body','options','then','lodash','util','moment','bluebird'];(function(_0x240aaf,_0x2b8d86){var _0x280f83=function(_0x164752){while(--_0x164752){_0x240aaf['push'](_0x240aaf['shift']());}};_0x280f83(++_0x2b8d86);}(_0x44b7,0x9c));var _0x744b=function(_0x1e35cb,_0xf568f){_0x1e35cb=_0x1e35cb-0x0;var _0x1c2551=_0x44b7[_0x1e35cb];return _0x1c2551;};'use strict';var _=require(_0x744b('0x0'));var util=require(_0x744b('0x1'));var moment=require(_0x744b('0x2'));var BPromise=require(_0x744b('0x3'));var rs=require(_0x744b('0x4'));var fs=require('fs');var Redis=require(_0x744b('0x5'));var db=require(_0x744b('0x6'))['db'];var utils=require(_0x744b('0x7'));var logger=require(_0x744b('0x8'))(_0x744b('0x9'));var config=require(_0x744b('0xa'));var jayson=require(_0x744b('0xb'));var client=jayson[_0x744b('0xc')]['http']({'port':0x232a});config['redis']=_[_0x744b('0xd')](config['redis'],{'host':_0x744b('0xe'),'port':0x18eb});var socket=require(_0x744b('0xf'))(new Redis(config[_0x744b('0x10')]));require(_0x744b('0x11'))[_0x744b('0x12')](socket);function respondWithRpcPromise(_0x386714,_0x3f1773,_0x3ccff7){return new BPromise(function(_0x21ca31,_0x356c17){return client[_0x744b('0x13')](_0x386714,_0x3ccff7)['then'](function(_0x11778){logger[_0x744b('0x14')](_0x744b('0x15'),_0x3f1773,_0x744b('0x16'));logger['debug'](_0x744b('0x17'),_0x3f1773,_0x744b('0x16'),JSON['stringify'](_0x11778));if(_0x11778[_0x744b('0x18')]){if(_0x11778[_0x744b('0x18')][_0x744b('0x19')]===0x1f4){logger['error'](_0x744b('0x15'),_0x3f1773,_0x11778[_0x744b('0x18')]['message']);return _0x356c17(_0x11778[_0x744b('0x18')]['message']);}logger[_0x744b('0x18')]('Plugin,\x20%s,\x20%s',_0x3f1773,_0x11778[_0x744b('0x18')]['message']);return _0x21ca31(_0x11778['error'][_0x744b('0x1a')]);}else{logger['info'](_0x744b('0x15'),_0x3f1773,_0x744b('0x16'));_0x21ca31(_0x11778['result']['message']);}})['catch'](function(_0x4b75a2){logger[_0x744b('0x18')](_0x744b('0x15'),_0x3f1773,_0x4b75a2);_0x356c17(_0x4b75a2);});});}exports[_0x744b('0x1b')]=function(_0x5e9f9c){var _0x5e1aff=this;return new Promise(function(_0x29d15f,_0x51a848){return db['Plugin'][_0x744b('0x1c')](_0x5e9f9c[_0x744b('0x1d')],{'raw':_0x5e9f9c['options']?_0x5e9f9c[_0x744b('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0x744b('0x1f')](function(_0x602863){logger[_0x744b('0x14')](_0x744b('0x1b'),_0x5e9f9c);logger['debug'](_0x744b('0x1b'),_0x5e9f9c,JSON['stringify'](_0x602863));_0x29d15f(_0x602863);})['catch'](function(_0x3e6f6f){logger[_0x744b('0x18')](_0x744b('0x1b'),_0x3e6f6f[_0x744b('0x1a')],_0x5e9f9c);_0x51a848(_0x5e1aff[_0x744b('0x18')](0x1f4,_0x3e6f6f['message']));});});}; \ No newline at end of file +var _0x3529=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./plugin.socket','register','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','Plugin','create','body','options','raw','CreatePlugin','stringify','lodash','util','bluebird','randomstring','ioredis'];(function(_0x30c8d3,_0x14fcc9){var _0x471882=function(_0x465610){while(--_0x465610){_0x30c8d3['push'](_0x30c8d3['shift']());}};_0x471882(++_0x14fcc9);}(_0x3529,0x193));var _0x9352=function(_0xab0515,_0x4b8ab2){_0xab0515=_0xab0515-0x0;var _0x443d59=_0x3529[_0xab0515];return _0x443d59;};'use strict';var _=require(_0x9352('0x0'));var util=require(_0x9352('0x1'));var moment=require('moment');var BPromise=require(_0x9352('0x2'));var rs=require(_0x9352('0x3'));var fs=require('fs');var Redis=require(_0x9352('0x4'));var db=require(_0x9352('0x5'))['db'];var utils=require(_0x9352('0x6'));var logger=require(_0x9352('0x7'))(_0x9352('0x8'));var config=require(_0x9352('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9352('0xa')][_0x9352('0xb')]({'port':0x232a});config[_0x9352('0xc')]=_[_0x9352('0xd')](config[_0x9352('0xc')],{'host':_0x9352('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9352('0xc')]));require(_0x9352('0xf'))[_0x9352('0x10')](socket);function respondWithRpcPromise(_0x1c3589,_0x569d83,_0x1ae485){return new BPromise(function(_0x1d388e,_0x501a3f){return client['request'](_0x1c3589,_0x1ae485)[_0x9352('0x11')](function(_0x2cb375){logger[_0x9352('0x12')](_0x9352('0x13'),_0x569d83,_0x9352('0x14'));logger[_0x9352('0x15')]('Plugin,\x20%s,\x20%s,\x20%s',_0x569d83,'request\x20sent',JSON['stringify'](_0x2cb375));if(_0x2cb375[_0x9352('0x16')]){if(_0x2cb375[_0x9352('0x16')][_0x9352('0x17')]===0x1f4){logger[_0x9352('0x16')](_0x9352('0x13'),_0x569d83,_0x2cb375['error'][_0x9352('0x18')]);return _0x501a3f(_0x2cb375['error']['message']);}logger[_0x9352('0x16')](_0x9352('0x13'),_0x569d83,_0x2cb375['error'][_0x9352('0x18')]);return _0x1d388e(_0x2cb375[_0x9352('0x16')]['message']);}else{logger[_0x9352('0x12')](_0x9352('0x13'),_0x569d83,'request\x20sent');_0x1d388e(_0x2cb375[_0x9352('0x19')][_0x9352('0x18')]);}})[_0x9352('0x1a')](function(_0x44f6a0){logger[_0x9352('0x16')](_0x9352('0x13'),_0x569d83,_0x44f6a0);_0x501a3f(_0x44f6a0);});});}exports['CreatePlugin']=function(_0x50fcc6){var _0x3efa42=this;return new Promise(function(_0x520c34,_0x2fdfd5){return db[_0x9352('0x1b')][_0x9352('0x1c')](_0x50fcc6[_0x9352('0x1d')],{'raw':_0x50fcc6['options']?_0x50fcc6[_0x9352('0x1e')][_0x9352('0x1f')]===undefined?!![]:![]:!![]})[_0x9352('0x11')](function(_0x2610d4){logger[_0x9352('0x12')]('CreatePlugin',_0x50fcc6);logger[_0x9352('0x15')](_0x9352('0x20'),_0x50fcc6,JSON[_0x9352('0x21')](_0x2610d4));_0x520c34(_0x2610d4);})[_0x9352('0x1a')](function(_0x17469e){logger[_0x9352('0x16')](_0x9352('0x20'),_0x17469e['message'],_0x50fcc6);_0x2fdfd5(_0x3efa42[_0x9352('0x16')](0x1f4,_0x17469e[_0x9352('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 55e807c..d4569c0 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 _0x0c0a=['plugin:','./plugin.events','save','remove','update','emit','length'];(function(_0x372e0b,_0x2e39a2){var _0x4b2385=function(_0x2389a0){while(--_0x2389a0){_0x372e0b['push'](_0x372e0b['shift']());}};_0x4b2385(++_0x2e39a2);}(_0x0c0a,0x19e));var _0xa0c0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c0a[_0x3dd15e];return _0x231fd0;};'use strict';var PluginEvents=require(_0xa0c0('0x0'));var events=[_0xa0c0('0x1'),_0xa0c0('0x2'),_0xa0c0('0x3')];function createListener(_0x2839f7,_0x1b7082){return function(_0x34b089){_0x1b7082[_0xa0c0('0x4')](_0x2839f7,_0x34b089);};}function removeListener(_0x1a197b,_0x394403){return function(){PluginEvents['removeListener'](_0x1a197b,_0x394403);};}exports['register']=function(_0x2ee7b1){for(var _0xaf7cda=0x0,_0x1af95b=events[_0xa0c0('0x5')];_0xaf7cda<_0x1af95b;_0xaf7cda++){var _0x1bc2f1=events[_0xaf7cda];var _0x119ce6=createListener(_0xa0c0('0x6')+_0x1bc2f1,_0x2ee7b1);PluginEvents['on'](_0x1bc2f1,_0x119ce6);}}; \ No newline at end of file +var _0x050f=['removeListener','register','length','plugin:','remove','update','emit'];(function(_0x3a1bdb,_0x162670){var _0x1873ba=function(_0x10e064){while(--_0x10e064){_0x3a1bdb['push'](_0x3a1bdb['shift']());}};_0x1873ba(++_0x162670);}(_0x050f,0xdd));var _0xf050=function(_0x3b210a,_0x240de1){_0x3b210a=_0x3b210a-0x0;var _0x4fc8d5=_0x050f[_0x3b210a];return _0x4fc8d5;};'use strict';var PluginEvents=require('./plugin.events');var events=['save',_0xf050('0x0'),_0xf050('0x1')];function createListener(_0x3f8926,_0x269b37){return function(_0x2324e0){_0x269b37[_0xf050('0x2')](_0x3f8926,_0x2324e0);};}function removeListener(_0x228d44,_0x226748){return function(){PluginEvents[_0xf050('0x3')](_0x228d44,_0x226748);};}exports[_0xf050('0x4')]=function(_0x117ad3){for(var _0x41262d=0x0,_0x2a40fc=events[_0xf050('0x5')];_0x41262d<_0x2a40fc;_0x41262d++){var _0x3a6997=events[_0x41262d];var _0x807c20=createListener(_0xf050('0x6')+_0x3a6997,_0x117ad3);PluginEvents['on'](_0x3a6997,_0x807c20);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 987b560..d0c20da 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 _0xa433=['express','Router','../../components/auth/service','./pm2.controller','isAuthenticated','index','get','/:id','show','post','create','update','delete','destroy','exports'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xa433,0x195));var _0x3a43=function(_0x390349,_0xa95b12){_0x390349=_0x390349-0x0;var _0x2154dd=_0xa433[_0x390349];return _0x2154dd;};'use strict';var express=require(_0x3a43('0x0'));var router=express[_0x3a43('0x1')]();var auth=require(_0x3a43('0x2'));var controller=require(_0x3a43('0x3'));router['get']('/',auth[_0x3a43('0x4')](),controller[_0x3a43('0x5')]);router[_0x3a43('0x6')](_0x3a43('0x7'),auth[_0x3a43('0x4')](),controller[_0x3a43('0x8')]);router[_0x3a43('0x9')]('/',auth[_0x3a43('0x4')](),controller[_0x3a43('0xa')]);router['put'](_0x3a43('0x7'),auth[_0x3a43('0x4')](),controller[_0x3a43('0xb')]);router[_0x3a43('0xc')](_0x3a43('0x7'),auth[_0x3a43('0x4')](),controller[_0x3a43('0xd')]);module[_0x3a43('0xe')]=router; \ No newline at end of file +var _0xb6c1=['post','create','put','update','delete','exports','express','Router','./pm2.controller','get','isAuthenticated','index','/:id','show'];(function(_0x4fe5cb,_0x4025be){var _0x3d2783=function(_0x3994a3){while(--_0x3994a3){_0x4fe5cb['push'](_0x4fe5cb['shift']());}};_0x3d2783(++_0x4025be);}(_0xb6c1,0x1e2));var _0x1b6c=function(_0x2aa2b4,_0x5b4af3){_0x2aa2b4=_0x2aa2b4-0x0;var _0x1be912=_0xb6c1[_0x2aa2b4];return _0x1be912;};'use strict';var express=require(_0x1b6c('0x0'));var router=express[_0x1b6c('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x1b6c('0x2'));router[_0x1b6c('0x3')]('/',auth[_0x1b6c('0x4')](),controller[_0x1b6c('0x5')]);router['get'](_0x1b6c('0x6'),auth[_0x1b6c('0x4')](),controller[_0x1b6c('0x7')]);router[_0x1b6c('0x8')]('/',auth[_0x1b6c('0x4')](),controller[_0x1b6c('0x9')]);router[_0x1b6c('0xa')](_0x1b6c('0x6'),auth[_0x1b6c('0x4')](),controller[_0x1b6c('0xb')]);router[_0x1b6c('0xc')](_0x1b6c('0x6'),auth[_0x1b6c('0x4')](),controller['destroy']);module[_0x1b6c('0xd')]=router; \ No newline at end of file diff --git a/server/api/pm2/pm2.controller.js b/server/api/pm2/pm2.controller.js index a1e3d58..c4bd95f 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 _0x684a=['join','../../files/plugins','cwd','chdir','dirname','start','Missing\x20name\x20and/or\x20path','update','restart','hasOwnProperty','params','destroy','delete','dump','Unknown\x20id','lodash','../../config/pm2','../../config/logger','child_process','exec','sendStatus','json','stack','name','status','send','npm\x20install','info','error','then','reject','express','motion2','length','catch','show','body','script'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x684a,0x119));var _0xa684=function(_0x5d104e,_0x1ccd0e){_0x5d104e=_0x5d104e-0x0;var _0x31a923=_0x684a[_0x5d104e];return _0x31a923;};'use strict';var _=require(_0xa684('0x0'));var pm2=require(_0xa684('0x1'));var logger=require(_0xa684('0x2'))('api');var path=require('path');var exec=require(_0xa684('0x3'))[_0xa684('0x4')];var BPromise=require('bluebird');function handleEntityNotFound(_0x2ff4d6,_0x2805a0){return function(_0x3937c1){if(!_0x3937c1){_0x2ff4d6[_0xa684('0x5')](0x194);;}return _0x3937c1;};}function respondWithResult(_0x588c3b,_0x56207e){_0x56207e=_0x56207e||0xc8;return function(_0x48e8e9){if(_0x48e8e9){return _0x588c3b['status'](_0x56207e)[_0xa684('0x6')](_0x48e8e9);}return null;};}function handleError(_0x4f7816,_0xff072b){_0xff072b=_0xff072b||0x1f4;return function(_0x415fd8){logger['error'](_0x415fd8[_0xa684('0x7')]);if(_0x415fd8[_0xa684('0x8')]){delete _0x415fd8[_0xa684('0x8')];}_0x4f7816[_0xa684('0x9')](_0xff072b)[_0xa684('0xa')](_0x415fd8);};}function execChildProcess(){return new BPromise(function(_0x525f37,_0x252436){exec(_0xa684('0xb'),function(_0x3f62e2,_0x51b082,_0x56f0a8){logger[_0xa684('0xc')](_0x51b082);logger['info'](_0x56f0a8);if(_0x3f62e2){logger[_0xa684('0xd')](_0x3f62e2);return _0x252436(_0x3f62e2);}return _0x525f37(_0x51b082);});});}exports['index']=function(_0xea45bb,_0x41531f){return pm2['list']()[_0xa684('0xe')](function(_0x1c91f4){if(_0x1c91f4){var _0x373ccb=_[_0xa684('0xf')](_0x1c91f4,function(_0x2da9ba){return _0x2da9ba['name']===_0xa684('0x10')||_0x2da9ba['name']===_0xa684('0x11');});return{'rows':_0x373ccb,'count':_0x373ccb[_0xa684('0x12')]};}return null;})[_0xa684('0xe')](respondWithResult(_0x41531f,null))[_0xa684('0x13')](handleError(_0x41531f,null));};exports[_0xa684('0x14')]=function(_0x2b2440,_0x18d37d){return pm2['describe'](_0x2b2440['params']['id'])[_0xa684('0xe')](respondWithResult(_0x18d37d,null))[_0xa684('0xe')](handleEntityNotFound(_0x18d37d,null))[_0xa684('0x13')](handleError(_0x18d37d,null));};exports['create']=function(_0x403cea,_0x2814f4){if(_0x403cea['body'][_0xa684('0x8')]&&_0x403cea[_0xa684('0x15')][_0xa684('0x16')]){var _0x128ae8=path[_0xa684('0x17')](__dirname,_0xa684('0x18'),_0x403cea[_0xa684('0x15')]['script']);var _0x16ddc3=process[_0xa684('0x19')]();process[_0xa684('0x1a')](path[_0xa684('0x1b')](_0x128ae8));return execChildProcess()[_0xa684('0xe')](function(_0x4245a7){process[_0xa684('0x1a')](_0x16ddc3);return pm2[_0xa684('0x1c')]({'name':_0x403cea['body'][_0xa684('0x8')],'script':_0x128ae8});})[_0xa684('0xe')](function(_0x213245){pm2['dump']();return _0x213245[0x0];})[_0xa684('0xe')](respondWithResult(_0x2814f4,0xc9))['catch'](handleError(_0x2814f4,null));}else{return _0x2814f4[_0xa684('0x9')](0x1f4)['send']({'message':_0xa684('0x1d')});}};exports[_0xa684('0x1e')]=function(_0x52e839,_0xfe7ef){if(_0x52e839[_0xa684('0x15')]['id']){delete _0x52e839[_0xa684('0x15')]['id'];}var _0x2cd9c7={'online':_0xa684('0x1f'),'stopped':'stop'};if(_0x2cd9c7[_0xa684('0x20')](_0x52e839[_0xa684('0x15')]['status'])){return pm2[_0x2cd9c7[_0x52e839[_0xa684('0x15')]['status']]](_0x52e839[_0xa684('0x21')]['id'])[_0xa684('0xe')](respondWithResult(_0xfe7ef,0xc8))[_0xa684('0x13')](handleError(_0xfe7ef,null));}else{return _0xfe7ef[_0xa684('0x9')](0x1f4)[_0xa684('0xa')]({'message':'Unknown\x20status'});}};exports[_0xa684('0x22')]=function(_0x2e2139,_0x2d7bb7){if(_0x2e2139[_0xa684('0x15')]['id']){delete _0x2e2139['body']['id'];}if(_0x2e2139[_0xa684('0x21')]['id']){return pm2[_0xa684('0x23')](_0x2e2139['params']['id'])[_0xa684('0xe')](function(_0x3a9aa8){pm2[_0xa684('0x24')]();return _0x3a9aa8[0x0];})[_0xa684('0xe')](respondWithResult(_0x2d7bb7,null))['catch'](handleError(_0x2d7bb7,null));}else{return _0x2d7bb7[_0xa684('0x9')](0x1f4)[_0xa684('0xa')]({'message':_0xa684('0x25')});}}; \ No newline at end of file +var _0x1abd=['../../files/plugins','script','cwd','chdir','dirname','start','dump','update','stop','hasOwnProperty','params','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','child_process','exec','status','json','error','stack','name','send','npm\x20install','info','index','list','then','reject','express','motion2','length','catch','show','describe','create','body'];(function(_0x492af5,_0xd51471){var _0x59f529=function(_0x40c9aa){while(--_0x40c9aa){_0x492af5['push'](_0x492af5['shift']());}};_0x59f529(++_0xd51471);}(_0x1abd,0x157));var _0xd1ab=function(_0x1a9ed0,_0x1085fc){_0x1a9ed0=_0x1a9ed0-0x0;var _0x47bbd6=_0x1abd[_0x1a9ed0];return _0x47bbd6;};'use strict';var _=require(_0xd1ab('0x0'));var pm2=require(_0xd1ab('0x1'));var logger=require(_0xd1ab('0x2'))(_0xd1ab('0x3'));var path=require('path');var exec=require(_0xd1ab('0x4'))[_0xd1ab('0x5')];var BPromise=require('bluebird');function handleEntityNotFound(_0x28bed4,_0x349077){return function(_0xb0eb27){if(!_0xb0eb27){_0x28bed4['sendStatus'](0x194);;}return _0xb0eb27;};}function respondWithResult(_0x2bd292,_0x5808d0){_0x5808d0=_0x5808d0||0xc8;return function(_0x4e9d5c){if(_0x4e9d5c){return _0x2bd292[_0xd1ab('0x6')](_0x5808d0)[_0xd1ab('0x7')](_0x4e9d5c);}return null;};}function handleError(_0x5b4432,_0x36c2f9){_0x36c2f9=_0x36c2f9||0x1f4;return function(_0x509f25){logger[_0xd1ab('0x8')](_0x509f25[_0xd1ab('0x9')]);if(_0x509f25['name']){delete _0x509f25[_0xd1ab('0xa')];}_0x5b4432[_0xd1ab('0x6')](_0x36c2f9)[_0xd1ab('0xb')](_0x509f25);};}function execChildProcess(){return new BPromise(function(_0x6e809,_0x3c9dca){exec(_0xd1ab('0xc'),function(_0x133eff,_0x17f6f8,_0x2d8cf8){logger[_0xd1ab('0xd')](_0x17f6f8);logger[_0xd1ab('0xd')](_0x2d8cf8);if(_0x133eff){logger[_0xd1ab('0x8')](_0x133eff);return _0x3c9dca(_0x133eff);}return _0x6e809(_0x17f6f8);});});}exports[_0xd1ab('0xe')]=function(_0x35403b,_0x16b9d8){return pm2[_0xd1ab('0xf')]()[_0xd1ab('0x10')](function(_0x46ef20){if(_0x46ef20){var _0x433ea8=_[_0xd1ab('0x11')](_0x46ef20,function(_0x41966f){return _0x41966f[_0xd1ab('0xa')]===_0xd1ab('0x12')||_0x41966f[_0xd1ab('0xa')]===_0xd1ab('0x13');});return{'rows':_0x433ea8,'count':_0x433ea8[_0xd1ab('0x14')]};}return null;})['then'](respondWithResult(_0x16b9d8,null))[_0xd1ab('0x15')](handleError(_0x16b9d8,null));};exports[_0xd1ab('0x16')]=function(_0x3f27e8,_0xabadbd){return pm2[_0xd1ab('0x17')](_0x3f27e8['params']['id'])['then'](respondWithResult(_0xabadbd,null))['then'](handleEntityNotFound(_0xabadbd,null))[_0xd1ab('0x15')](handleError(_0xabadbd,null));};exports[_0xd1ab('0x18')]=function(_0x2a0c1f,_0x58efb9){if(_0x2a0c1f[_0xd1ab('0x19')][_0xd1ab('0xa')]&&_0x2a0c1f[_0xd1ab('0x19')]['script']){var _0x559e35=path['join'](__dirname,_0xd1ab('0x1a'),_0x2a0c1f[_0xd1ab('0x19')][_0xd1ab('0x1b')]);var _0x46b51d=process[_0xd1ab('0x1c')]();process[_0xd1ab('0x1d')](path[_0xd1ab('0x1e')](_0x559e35));return execChildProcess()[_0xd1ab('0x10')](function(_0x502569){process[_0xd1ab('0x1d')](_0x46b51d);return pm2[_0xd1ab('0x1f')]({'name':_0x2a0c1f[_0xd1ab('0x19')][_0xd1ab('0xa')],'script':_0x559e35});})[_0xd1ab('0x10')](function(_0x2c1107){pm2[_0xd1ab('0x20')]();return _0x2c1107[0x0];})[_0xd1ab('0x10')](respondWithResult(_0x58efb9,0xc9))[_0xd1ab('0x15')](handleError(_0x58efb9,null));}else{return _0x58efb9['status'](0x1f4)[_0xd1ab('0xb')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0xd1ab('0x21')]=function(_0x418ba1,_0x892bf0){if(_0x418ba1['body']['id']){delete _0x418ba1[_0xd1ab('0x19')]['id'];}var _0x234391={'online':'restart','stopped':_0xd1ab('0x22')};if(_0x234391[_0xd1ab('0x23')](_0x418ba1[_0xd1ab('0x19')][_0xd1ab('0x6')])){return pm2[_0x234391[_0x418ba1[_0xd1ab('0x19')][_0xd1ab('0x6')]]](_0x418ba1[_0xd1ab('0x24')]['id'])[_0xd1ab('0x10')](respondWithResult(_0x892bf0,0xc8))[_0xd1ab('0x15')](handleError(_0x892bf0,null));}else{return _0x892bf0[_0xd1ab('0x6')](0x1f4)['send']({'message':_0xd1ab('0x25')});}};exports[_0xd1ab('0x26')]=function(_0x3e2e6d,_0x29b6ea){if(_0x3e2e6d[_0xd1ab('0x19')]['id']){delete _0x3e2e6d[_0xd1ab('0x19')]['id'];}if(_0x3e2e6d['params']['id']){return pm2[_0xd1ab('0x27')](_0x3e2e6d[_0xd1ab('0x24')]['id'])[_0xd1ab('0x10')](function(_0x4b1f59){pm2[_0xd1ab('0x20')]();return _0x4b1f59[0x0];})['then'](respondWithResult(_0x29b6ea,null))['catch'](handleError(_0x29b6ea,null));}else{return _0x29b6ea[_0xd1ab('0x6')](0x1f4)[_0xd1ab('0xb')]({'message':_0xd1ab('0x28')});}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index a733b39..639bac1 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 _0xec94=['../../components/interaction/service','exports','multer','util','path','../../components/auth/service'];(function(_0xddb860,_0x344918){var _0x255df9=function(_0x102c1c){while(--_0x102c1c){_0xddb860['push'](_0xddb860['shift']());}};_0x255df9(++_0x344918);}(_0xec94,0x1e8));var _0x4ec9=function(_0xd29952,_0x353ba8){_0xd29952=_0xd29952-0x0;var _0x3cd62d=_0xec94[_0xd29952];return _0x3cd62d;};'use strict';var multer=require(_0x4ec9('0x0'));var util=require(_0x4ec9('0x1'));var path=require(_0x4ec9('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x4ec9('0x3'));var interaction=require(_0x4ec9('0x4'));var config=require('../../config/environment');module[_0x4ec9('0x5')]=router; \ No newline at end of file +var _0x2978=['multer','util','path','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x2dc96e,_0x4db11a){var _0x335e9f=function(_0x4261df){while(--_0x4261df){_0x2dc96e['push'](_0x2dc96e['shift']());}};_0x335e9f(++_0x4db11a);}(_0x2978,0x16e));var _0x8297=function(_0x4fd56e,_0x52db7c){_0x4fd56e=_0x4fd56e-0x0;var _0x80b7d2=_0x2978[_0x4fd56e];return _0x80b7d2;};'use strict';var multer=require(_0x8297('0x0'));var util=require(_0x8297('0x1'));var path=require(_0x8297('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x8297('0x3'));var interaction=require(_0x8297('0x4'));var config=require('../../config/environment');module[_0x8297('0x5')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 2c9673a..af004e2 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 _0xa76e=['sequelize','exports','INTEGER','STRING','DATE'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xa76e,0x73));var _0xea76=function(_0xd816e2,_0x5edac2){_0xd816e2=_0xd816e2-0x0;var _0x1f5924=_0xa76e[_0xd816e2];return _0x1f5924;};'use strict';var Sequelize=require(_0xea76('0x0'));module[_0xea76('0x1')]={'state':{'type':Sequelize[_0xea76('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xea76('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0xea76('0x3')]},'starttime':{'type':Sequelize[_0xea76('0x4')]},'responsetime':{'type':Sequelize[_0xea76('0x4')]},'ringtime':{'type':Sequelize[_0xea76('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xea76('0x3')]}}; \ No newline at end of file +var _0x6a17=['STRING','DATE','sequelize','exports','INTEGER'];(function(_0x202d24,_0x5e8641){var _0x2b3a8e=function(_0x4c7c4a){while(--_0x4c7c4a){_0x202d24['push'](_0x202d24['shift']());}};_0x2b3a8e(++_0x5e8641);}(_0x6a17,0x174));var _0x76a1=function(_0x2ff71e,_0x33622c){_0x2ff71e=_0x2ff71e-0x0;var _0x2d1053=_0x6a17[_0x2ff71e];return _0x2d1053;};'use strict';var Sequelize=require(_0x76a1('0x0'));module[_0x76a1('0x1')]={'state':{'type':Sequelize[_0x76a1('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x76a1('0x3')]},'scheduledat':{'type':Sequelize[_0x76a1('0x4')]},'uniqueid':{'type':Sequelize[_0x76a1('0x3')]},'starttime':{'type':Sequelize[_0x76a1('0x4')]},'responsetime':{'type':Sequelize[_0x76a1('0x4')]},'ringtime':{'type':Sequelize[_0x76a1('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x76a1('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x76a1('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index ef92960..69457d7 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 _0xc1a9=['path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x182831,_0x5af1cb){var _0x2aee13=function(_0x5ab782){while(--_0x5ab782){_0x182831['push'](_0x182831['shift']());}};_0x2aee13(++_0x5af1cb);}(_0xc1a9,0xb0));var _0x9c1a=function(_0x2f57b2,_0xa8e91a){_0x2f57b2=_0x2f57b2-0x0;var _0x5ace77=_0xc1a9[_0x2f57b2];return _0x5ace77;};'use strict';var _=require(_0x9c1a('0x0'));var util=require(_0x9c1a('0x1'));var logger=require(_0x9c1a('0x2'))(_0x9c1a('0x3'));var moment=require(_0x9c1a('0x4'));var BPromise=require('bluebird');var rp=require(_0x9c1a('0x5'));var fs=require('fs');var path=require(_0x9c1a('0x6'));var rimraf=require(_0x9c1a('0x7'));var config=require(_0x9c1a('0x8'));var attributes=require(_0x9c1a('0x9'));module[_0x9c1a('0xa')]=function(_0x31683a,_0x2d8198){return _0x31683a[_0x9c1a('0xb')](_0x9c1a('0xc'),attributes,{'tableName':_0x9c1a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x07bf=['rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2e9f09,_0x1ad028){var _0x2f884a=function(_0x45a4f9){while(--_0x45a4f9){_0x2e9f09['push'](_0x2e9f09['shift']());}};_0x2f884a(++_0x1ad028);}(_0x07bf,0xf4));var _0xf07b=function(_0x2cebca,_0x4f7404){_0x2cebca=_0x2cebca-0x0;var _0x483d9a=_0x07bf[_0x2cebca];return _0x483d9a;};'use strict';var _=require(_0xf07b('0x0'));var util=require(_0xf07b('0x1'));var logger=require(_0xf07b('0x2'))(_0xf07b('0x3'));var moment=require(_0xf07b('0x4'));var BPromise=require(_0xf07b('0x5'));var rp=require(_0xf07b('0x6'));var fs=require('fs');var path=require(_0xf07b('0x7'));var rimraf=require(_0xf07b('0x8'));var config=require(_0xf07b('0x9'));var attributes=require(_0xf07b('0xa'));module[_0xf07b('0xb')]=function(_0x54fad7,_0x19e2e1){return _0x54fad7[_0xf07b('0xc')](_0xf07b('0xd'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index 68cb862..568c555 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 _0x37ac=['message','result','create','body','options','raw','then','CreateReportAgentPreview','debug','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x4cda01,_0x3968a3){var _0x42fdf3=function(_0x11d98a){while(--_0x11d98a){_0x4cda01['push'](_0x4cda01['shift']());}};_0x42fdf3(++_0x3968a3);}(_0x37ac,0x6e));var _0xc37a=function(_0x511eef,_0x498209){_0x511eef=_0x511eef-0x0;var _0xce8e10=_0x37ac[_0x511eef];return _0xce8e10;};'use strict';var _=require(_0xc37a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc37a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc37a('0x2'))['db'];var utils=require(_0xc37a('0x3'));var logger=require(_0xc37a('0x4'))(_0xc37a('0x5'));var config=require('../../config/environment');var jayson=require(_0xc37a('0x6'));var client=jayson[_0xc37a('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x114b5a,_0x2f01b4,_0x4deef4){return new BPromise(function(_0x297338,_0x659414){return client[_0xc37a('0x8')](_0x114b5a,_0x4deef4)['then'](function(_0x5086ee){logger[_0xc37a('0x9')](_0xc37a('0xa'),_0x2f01b4,_0xc37a('0xb'));logger['debug']('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x2f01b4,_0xc37a('0xb'),JSON[_0xc37a('0xc')](_0x5086ee));if(_0x5086ee[_0xc37a('0xd')]){if(_0x5086ee['error'][_0xc37a('0xe')]===0x1f4){logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x2f01b4,_0x5086ee[_0xc37a('0xd')][_0xc37a('0xf')]);return _0x659414(_0x5086ee[_0xc37a('0xd')][_0xc37a('0xf')]);}logger[_0xc37a('0xd')](_0xc37a('0xa'),_0x2f01b4,_0x5086ee[_0xc37a('0xd')][_0xc37a('0xf')]);return _0x297338(_0x5086ee['error'][_0xc37a('0xf')]);}else{logger['info'](_0xc37a('0xa'),_0x2f01b4,'request\x20sent');_0x297338(_0x5086ee[_0xc37a('0x10')]['message']);}})['catch'](function(_0xfad8ea){logger['error'](_0xc37a('0xa'),_0x2f01b4,_0xfad8ea);_0x659414(_0xfad8ea);});});}exports['CreateReportAgentPreview']=function(_0x1dd5f4){var _0x4d68db=this;return new Promise(function(_0x3c9a9a,_0x4f832b){return db['ReportAgentPreview'][_0xc37a('0x11')](_0x1dd5f4[_0xc37a('0x12')],{'raw':_0x1dd5f4[_0xc37a('0x13')]?_0x1dd5f4['options'][_0xc37a('0x14')]===undefined?!![]:![]:!![]})[_0xc37a('0x15')](function(_0x4f485d){logger[_0xc37a('0x9')](_0xc37a('0x16'),_0x1dd5f4);logger[_0xc37a('0x17')](_0xc37a('0x16'),_0x1dd5f4,JSON[_0xc37a('0xc')](_0x4f485d));_0x3c9a9a(_0x4f485d);})[_0xc37a('0x18')](function(_0x2e8357){logger[_0xc37a('0xd')](_0xc37a('0x16'),_0x2e8357['message'],_0x1dd5f4);_0x4f832b(_0x4d68db[_0xc37a('0xd')](0x1f4,_0x2e8357[_0xc37a('0xf')]));});});}; \ No newline at end of file +var _0x6263=['../../config/logger','rpc','jayson/promise','http','request','then','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x1d1c7a,_0x2bd1e0){var _0x7bfb9=function(_0xa0c993){while(--_0xa0c993){_0x1d1c7a['push'](_0x1d1c7a['shift']());}};_0x7bfb9(++_0x2bd1e0);}(_0x6263,0x19d));var _0x3626=function(_0x35af79,_0x324b92){_0x35af79=_0x35af79-0x0;var _0xdf1a72=_0x6263[_0x35af79];return _0xdf1a72;};'use strict';var _=require(_0x3626('0x0'));var util=require(_0x3626('0x1'));var moment=require(_0x3626('0x2'));var BPromise=require(_0x3626('0x3'));var rs=require(_0x3626('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3626('0x5'))['db'];var utils=require(_0x3626('0x6'));var logger=require(_0x3626('0x7'))(_0x3626('0x8'));var config=require('../../config/environment');var jayson=require(_0x3626('0x9'));var client=jayson['client'][_0x3626('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x292c3a,_0x4a6fd3,_0x313603){return new BPromise(function(_0x15d8b6,_0x48dede){return client[_0x3626('0xb')](_0x292c3a,_0x313603)[_0x3626('0xc')](function(_0x51cbc8){logger['info'](_0x3626('0xd'),_0x4a6fd3,_0x3626('0xe'));logger['debug'](_0x3626('0xf'),_0x4a6fd3,_0x3626('0xe'),JSON[_0x3626('0x10')](_0x51cbc8));if(_0x51cbc8[_0x3626('0x11')]){if(_0x51cbc8[_0x3626('0x11')]['code']===0x1f4){logger[_0x3626('0x11')](_0x3626('0xd'),_0x4a6fd3,_0x51cbc8['error'][_0x3626('0x12')]);return _0x48dede(_0x51cbc8[_0x3626('0x11')][_0x3626('0x12')]);}logger[_0x3626('0x11')](_0x3626('0xd'),_0x4a6fd3,_0x51cbc8[_0x3626('0x11')][_0x3626('0x12')]);return _0x15d8b6(_0x51cbc8[_0x3626('0x11')][_0x3626('0x12')]);}else{logger[_0x3626('0x13')]('ReportAgentPreview,\x20%s,\x20%s',_0x4a6fd3,_0x3626('0xe'));_0x15d8b6(_0x51cbc8[_0x3626('0x14')][_0x3626('0x12')]);}})[_0x3626('0x15')](function(_0x502abe){logger[_0x3626('0x11')](_0x3626('0xd'),_0x4a6fd3,_0x502abe);_0x48dede(_0x502abe);});});}exports[_0x3626('0x16')]=function(_0x38dcbb){var _0x2627c9=this;return new Promise(function(_0x52cac9,_0x554768){return db[_0x3626('0x17')][_0x3626('0x18')](_0x38dcbb[_0x3626('0x19')],{'raw':_0x38dcbb[_0x3626('0x1a')]?_0x38dcbb[_0x3626('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x3626('0xc')](function(_0x2033de){logger['info'](_0x3626('0x16'),_0x38dcbb);logger[_0x3626('0x1b')](_0x3626('0x16'),_0x38dcbb,JSON[_0x3626('0x10')](_0x2033de));_0x52cac9(_0x2033de);})['catch'](function(_0x2b78ed){logger[_0x3626('0x11')](_0x3626('0x16'),_0x2b78ed[_0x3626('0x12')],_0x38dcbb);_0x554768(_0x2627c9[_0x3626('0x11')](0x1f4,_0x2b78ed[_0x3626('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index cfbc992..d972e41 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 _0x55f6=['openchannel','/openchannel/queues/:id','showOpenchannelQueues','sms','/sms/queues/:id','/agents/:id/notify','agentNotify','exports','util','path','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','outbound','/outbound/channels','outboundChannels','/agents','agents','put','/agents/:id/capacity','/telephones','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','/openchannel/queues/:id/notify'];(function(_0x4a07ef,_0x130c8d){var _0x51b517=function(_0x18fcfd){while(--_0x18fcfd){_0x4a07ef['push'](_0x4a07ef['shift']());}};_0x51b517(++_0x130c8d);}(_0x55f6,0x17a));var _0x655f=function(_0x2958f8,_0x1b8fda){_0x2958f8=_0x2958f8-0x0;var _0x1a02c0=_0x55f6[_0x2958f8];return _0x1a02c0;};'use strict';var multer=require('multer');var util=require(_0x655f('0x0'));var path=require(_0x655f('0x1'));var express=require('express');var router=express[_0x655f('0x2')]();var auth=require(_0x655f('0x3'));var controller=require(_0x655f('0x4'));router[_0x655f('0x5')](_0x655f('0x6'),auth[_0x655f('0x7')](),controller['voiceChannels']);router['get']('/voice/channels/:uniqueid/mixmonitor',auth[_0x655f('0x7')](),controller['voiceChannelMixMonitor']);router[_0x655f('0x5')](_0x655f('0x8'),auth[_0x655f('0x7')](),controller[_0x655f('0x9')]);router[_0x655f('0x5')](_0x655f('0xa'),auth[_0x655f('0x7')](),controller[_0x655f('0xb')]);router[_0x655f('0x5')](_0x655f('0xc'),auth['isAuthenticated'](),controller[_0x655f('0xd')]);router[_0x655f('0x5')](_0x655f('0xe'),auth[_0x655f('0x7')](),controller[_0x655f('0xf')]);router[_0x655f('0x5')]('/mail/accounts',auth['isAuthenticated'](),controller[_0x655f('0x10')]);router[_0x655f('0x5')](_0x655f('0x11'),auth['isAuthenticated'](),controller[_0x655f('0x12')]);router[_0x655f('0x5')](_0x655f('0x13'),auth[_0x655f('0x7')](),controller[_0x655f('0x14')]);router[_0x655f('0x5')](_0x655f('0x15'),auth[_0x655f('0x7')](),controller[_0x655f('0x16')]);router[_0x655f('0x5')](_0x655f('0x17'),auth['isAuthenticated'](),controller[_0x655f('0x18')]);router['get'](_0x655f('0x19'),auth['isAuthenticated'](),controller[_0x655f('0x1a')]);router[_0x655f('0x5')](_0x655f('0x1b'),auth['isAuthenticated'](),controller['voiceQueuesChannel']);router[_0x655f('0x5')](_0x655f('0x1c'),auth['isAuthenticated'](),controller[_0x655f('0x1d')]);router['get']('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x655f('0x7')](),controller[_0x655f('0x1e')]);router[_0x655f('0x5')](_0x655f('0x1f'),auth[_0x655f('0x7')](),controller[_0x655f('0x20')]);router['get']('/outbound',auth[_0x655f('0x7')](),controller[_0x655f('0x21')]);router[_0x655f('0x5')](_0x655f('0x22'),auth[_0x655f('0x7')](),controller[_0x655f('0x23')]);router[_0x655f('0x5')](_0x655f('0x24'),auth[_0x655f('0x7')](),controller[_0x655f('0x25')]);router[_0x655f('0x26')](_0x655f('0x27'),auth[_0x655f('0x7')](),controller['agentCapacity']);router[_0x655f('0x5')](_0x655f('0x28'),auth[_0x655f('0x7')](),controller['telephones']);router[_0x655f('0x5')]('/trunks',auth[_0x655f('0x7')](),controller[_0x655f('0x29')]);router[_0x655f('0x5')](_0x655f('0x2a'),auth[_0x655f('0x7')](),controller[_0x655f('0x2b')]);router[_0x655f('0x5')](_0x655f('0x2c'),auth['isAuthenticated'](),controller[_0x655f('0x2d')]);router[_0x655f('0x5')](_0x655f('0x2e'),auth[_0x655f('0x7')](),controller[_0x655f('0x2f')]);router['get']('/mail/queues/waitinginteractions',auth[_0x655f('0x7')](),controller[_0x655f('0x30')]);router[_0x655f('0x5')]('/openchannel/queues/waitinginteractions',auth[_0x655f('0x7')](),controller[_0x655f('0x31')]);router[_0x655f('0x5')](_0x655f('0x32'),auth['isAuthenticated'](),controller[_0x655f('0x33')]);router['get']('/fax/queues/waitinginteractions',auth[_0x655f('0x7')](),controller[_0x655f('0x34')]);router[_0x655f('0x35')](_0x655f('0x36'),auth[_0x655f('0x7')](),controller[_0x655f('0x37')](_0x655f('0x38')));router['get'](_0x655f('0x39'),auth[_0x655f('0x7')](),controller[_0x655f('0x3a')]);router[_0x655f('0x35')]('/chat/queues/:id/notify',auth['isAuthenticated'](),controller['queueNotify'](_0x655f('0x3b')));router[_0x655f('0x5')](_0x655f('0x3c'),auth[_0x655f('0x7')](),controller[_0x655f('0x3d')]);router[_0x655f('0x35')](_0x655f('0x3e'),auth[_0x655f('0x7')](),controller[_0x655f('0x37')](_0x655f('0x3f')));router[_0x655f('0x5')](_0x655f('0x40'),auth['isAuthenticated'](),controller['showFaxQueues']);router[_0x655f('0x35')](_0x655f('0x41'),auth[_0x655f('0x7')](),controller[_0x655f('0x37')](_0x655f('0x42')));router[_0x655f('0x5')](_0x655f('0x43'),auth[_0x655f('0x7')](),controller[_0x655f('0x44')]);router[_0x655f('0x35')]('/sms/queues/:id/notify',auth[_0x655f('0x7')](),controller['queueNotify'](_0x655f('0x45')));router[_0x655f('0x5')](_0x655f('0x46'),auth[_0x655f('0x7')](),controller['showSmsQueues']);router[_0x655f('0x35')](_0x655f('0x47'),auth[_0x655f('0x7')](),controller[_0x655f('0x48')]);module[_0x655f('0x49')]=router; \ No newline at end of file +var _0xf608=['voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','showVoiceQueues','/outbound','/outbound/channels','outboundChannels','agents','put','/agents/:id/capacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','queueNotify','mail','/mail/queues/:id','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','fax','/fax/queues/:id','showFaxQueues','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','/sms/queues/:id','showSmsQueues','agentNotify','exports','util','path','express','Router','../../components/auth/service','/voice/channels','isAuthenticated','voiceChannels','get','/voice/channels/:uniqueid/mixmonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/sms/queues','smsQueues','/fax/queues','faxQueues'];(function(_0x217f30,_0x214ec2){var _0x551715=function(_0x31b764){while(--_0x31b764){_0x217f30['push'](_0x217f30['shift']());}};_0x551715(++_0x214ec2);}(_0xf608,0x1a4));var _0x8f60=function(_0x358c86,_0x38a8a2){_0x358c86=_0x358c86-0x0;var _0x52edc5=_0xf608[_0x358c86];return _0x52edc5;};'use strict';var multer=require('multer');var util=require(_0x8f60('0x0'));var path=require(_0x8f60('0x1'));var express=require(_0x8f60('0x2'));var router=express[_0x8f60('0x3')]();var auth=require(_0x8f60('0x4'));var controller=require('./rpc.controller');router['get'](_0x8f60('0x5'),auth[_0x8f60('0x6')](),controller[_0x8f60('0x7')]);router[_0x8f60('0x8')](_0x8f60('0x9'),auth['isAuthenticated'](),controller['voiceChannelMixMonitor']);router['get'](_0x8f60('0xa'),auth[_0x8f60('0x6')](),controller[_0x8f60('0xb')]);router[_0x8f60('0x8')](_0x8f60('0xc'),auth[_0x8f60('0x6')](),controller[_0x8f60('0xd')]);router[_0x8f60('0x8')](_0x8f60('0xe'),auth['isAuthenticated'](),controller[_0x8f60('0xf')]);router['get'](_0x8f60('0x10'),auth[_0x8f60('0x6')](),controller[_0x8f60('0x11')]);router[_0x8f60('0x8')](_0x8f60('0x12'),auth[_0x8f60('0x6')](),controller[_0x8f60('0x13')]);router[_0x8f60('0x8')]('/openchannel/queues',auth['isAuthenticated'](),controller['openchannelQueues']);router[_0x8f60('0x8')](_0x8f60('0x14'),auth['isAuthenticated'](),controller[_0x8f60('0x15')]);router[_0x8f60('0x8')](_0x8f60('0x16'),auth[_0x8f60('0x6')](),controller[_0x8f60('0x17')]);router[_0x8f60('0x8')]('/voice/queues/preview/:id',auth['isAuthenticated'](),controller[_0x8f60('0x18')]);router[_0x8f60('0x8')](_0x8f60('0x19'),auth[_0x8f60('0x6')](),controller[_0x8f60('0x1a')]);router[_0x8f60('0x8')](_0x8f60('0x1b'),auth[_0x8f60('0x6')](),controller['voiceQueuesChannel']);router['get']('/voice/queues/channels/:uniqueid/hangup',auth[_0x8f60('0x6')](),controller[_0x8f60('0x1c')]);router[_0x8f60('0x8')](_0x8f60('0x1d'),auth['isAuthenticated'](),controller[_0x8f60('0x1e')]);router[_0x8f60('0x8')]('/voice/queues/:id',auth[_0x8f60('0x6')](),controller[_0x8f60('0x1f')]);router['get'](_0x8f60('0x20'),auth['isAuthenticated'](),controller['outbound']);router['get'](_0x8f60('0x21'),auth['isAuthenticated'](),controller[_0x8f60('0x22')]);router[_0x8f60('0x8')]('/agents',auth['isAuthenticated'](),controller[_0x8f60('0x23')]);router[_0x8f60('0x24')](_0x8f60('0x25'),auth[_0x8f60('0x6')](),controller['agentCapacity']);router[_0x8f60('0x8')](_0x8f60('0x26'),auth[_0x8f60('0x6')](),controller[_0x8f60('0x27')]);router[_0x8f60('0x8')](_0x8f60('0x28'),auth[_0x8f60('0x6')](),controller[_0x8f60('0x29')]);router[_0x8f60('0x8')](_0x8f60('0x2a'),auth[_0x8f60('0x6')](),controller[_0x8f60('0x2b')]);router[_0x8f60('0x8')](_0x8f60('0x2c'),auth[_0x8f60('0x6')](),controller[_0x8f60('0x2d')]);router[_0x8f60('0x8')](_0x8f60('0x2e'),auth[_0x8f60('0x6')](),controller['chatQueuesWaitingInteractions']);router[_0x8f60('0x8')](_0x8f60('0x2f'),auth['isAuthenticated'](),controller[_0x8f60('0x30')]);router[_0x8f60('0x8')](_0x8f60('0x31'),auth[_0x8f60('0x6')](),controller[_0x8f60('0x32')]);router[_0x8f60('0x8')](_0x8f60('0x33'),auth['isAuthenticated'](),controller[_0x8f60('0x34')]);router[_0x8f60('0x8')](_0x8f60('0x35'),auth['isAuthenticated'](),controller[_0x8f60('0x36')]);router[_0x8f60('0x37')]('/mail/queues/:id/notify',auth[_0x8f60('0x6')](),controller[_0x8f60('0x38')](_0x8f60('0x39')));router[_0x8f60('0x8')](_0x8f60('0x3a'),auth['isAuthenticated'](),controller['showMailQueues']);router[_0x8f60('0x37')](_0x8f60('0x3b'),auth[_0x8f60('0x6')](),controller['queueNotify'](_0x8f60('0x3c')));router[_0x8f60('0x8')](_0x8f60('0x3d'),auth[_0x8f60('0x6')](),controller[_0x8f60('0x3e')]);router[_0x8f60('0x37')]('/fax/queues/:id/notify',auth[_0x8f60('0x6')](),controller['queueNotify'](_0x8f60('0x3f')));router[_0x8f60('0x8')](_0x8f60('0x40'),auth[_0x8f60('0x6')](),controller[_0x8f60('0x41')]);router[_0x8f60('0x37')]('/openchannel/queues/:id/notify',auth[_0x8f60('0x6')](),controller['queueNotify'](_0x8f60('0x42')));router[_0x8f60('0x8')](_0x8f60('0x43'),auth[_0x8f60('0x6')](),controller[_0x8f60('0x44')]);router[_0x8f60('0x37')](_0x8f60('0x45'),auth[_0x8f60('0x6')](),controller['queueNotify']('sms'));router[_0x8f60('0x8')](_0x8f60('0x46'),auth[_0x8f60('0x6')](),controller[_0x8f60('0x47')]);router[_0x8f60('0x37')]('/agents/:id/notify',auth['isAuthenticated'](),controller[_0x8f60('0x48')]);module[_0x8f60('0x49')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index f7d6d10..8a85d37 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 _0xd18b=['updateAttributes','interface','agent','capacity','telephones','trunks','Trunks','campaigns','Campaigns','ChatQueues','mailQueues','MailQueues','showMailQueues','openchannelQueues','showOpenchannelQueues','OpenchannelQueues','SmsQueues','showSmsQueues','faxQueues','showFaxQueues','FaxQueues','faxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','chat','Account','findOne','\x20Queue\x20not\x20found','messageId','Interaction','\x20Message\x20not\x20found','InteractionId','From','QueueId','TransferReport','create','Start','queue','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','Agent\x20not\x20found','Message','update','MessageId','agentTransferTimeout','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','result','json','sendStatus','stack','name','status','isNil','find','rows','VoiceChannels','query','catch','voiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','voiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','OutboundChannels','agents','agentCapacity','body','interaction','user','hasOwnProperty','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0xe1269d,_0x57b7c3){var _0x261ca1=function(_0x13b234){while(--_0x13b234){_0xe1269d['push'](_0xe1269d['shift']());}};_0x261ca1(++_0x57b7c3);}(_0xd18b,0xa2));var _0xbd18=function(_0x3dcf90,_0x310e25){_0x3dcf90=_0x3dcf90-0x0;var _0x4e3cf9=_0xd18b[_0x3dcf90];return _0x4e3cf9;};'use strict';var BPromise=require('bluebird');var moment=require('moment');var _=require(_0xbd18('0x0'));var util=require(_0xbd18('0x1'));var db=require(_0xbd18('0x2'))['db'];var logger=require(_0xbd18('0x3'))(_0xbd18('0x4'));var jayson=require(_0xbd18('0x5'));var amiClient=jayson[_0xbd18('0x6')]['http']({'port':0x232a});var mailClient=jayson[_0xbd18('0x6')][_0xbd18('0x7')]({'port':0x232b});var routingClient=jayson[_0xbd18('0x6')][_0xbd18('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x1b3de3,_0xe2af68,_0xd0e2b){return new BPromise(function(_0x59eb37,_0x55db07){var _0x51a2af=_0xd0e2b?_0xd0e2b:amiClient;return _0x51a2af[_0xbd18('0x8')](_0x1b3de3,_0xe2af68)[_0xbd18('0x9')](function(_0x4ecf52){if(_0x4ecf52[_0xbd18('0xa')]){if(_0x4ecf52[_0xbd18('0xa')][_0xbd18('0xb')]===0x1f4){return _0x55db07(_0x4ecf52[_0xbd18('0xa')][_0xbd18('0xc')]);}return _0x59eb37(_0x4ecf52[_0xbd18('0xa')][_0xbd18('0xc')]);}else{_0x59eb37(_0x4ecf52[_0xbd18('0xd')]);}})['catch'](function(_0x1986a0){_0x55db07(_0x1986a0);});});}function respondWithResult(_0xfae824,_0x3ea3a4){_0x3ea3a4=_0x3ea3a4||0xc8;return function(_0x1b5071){if(_0x1b5071){return _0xfae824['status'](_0x3ea3a4)[_0xbd18('0xe')](_0x1b5071);}return _0xfae824[_0xbd18('0xf')](0x194);};}function handleError(_0x33a2ca,_0x56404c){_0x56404c=_0x56404c||0x1f4;return function(_0x5ce377){logger[_0xbd18('0xa')](_0x5ce377[_0xbd18('0x10')]);if(_0x5ce377[_0xbd18('0x11')]){delete _0x5ce377[_0xbd18('0x11')];}_0x33a2ca[_0xbd18('0x12')](_0x56404c)['send'](_0x5ce377);};}function findById(_0xe93674){return function(_0x5b83b6){if(!_['isNil'](_0xe93674)&&!_[_0xbd18('0x13')](_0x5b83b6)&&!_[_0xbd18('0x13')](_0x5b83b6['rows'])){return _[_0xbd18('0x14')](_0x5b83b6[_0xbd18('0x15')],function(_0x2544f9){return _0x2544f9['id']==_0xe93674;});}return null;};}exports['voiceChannels']=function(_0x344587,_0x4580ef){return respondWithRpcPromise(_0xbd18('0x16'),_0x344587[_0xbd18('0x17')])[_0xbd18('0x9')](respondWithResult(_0x4580ef,null))[_0xbd18('0x18')](handleError(_0x4580ef,null));};exports[_0xbd18('0x19')]=function(_0x2e26e7,_0x3fc60e){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0xbd18('0x1a')](_0x2e26e7['query'],_0x2e26e7[_0xbd18('0x1b')]))[_0xbd18('0x9')](respondWithResult(_0x3fc60e,null))['catch'](handleError(_0x3fc60e,null));};exports[_0xbd18('0x1c')]=function(_0x58873b,_0xe52cae){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_[_0xbd18('0x1a')](_0x58873b[_0xbd18('0x17')],_0x58873b[_0xbd18('0x1b')]))[_0xbd18('0x9')](respondWithResult(_0xe52cae,null))[_0xbd18('0x18')](handleError(_0xe52cae,null));};exports[_0xbd18('0x1d')]=function(_0x2ba39f,_0xe6af20){return respondWithRpcPromise(_0xbd18('0x1e'),_0x2ba39f['query'])['then'](respondWithResult(_0xe6af20,null))[_0xbd18('0x18')](handleError(_0xe6af20,null));};exports[_0xbd18('0x1f')]=function(_0x2e4e03,_0x5af823){return respondWithRpcPromise(_0xbd18('0x1e'),_0x2e4e03['query'])['then'](findById(_0x2e4e03[_0xbd18('0x1b')]['id']))[_0xbd18('0x9')](respondWithResult(_0x5af823,null))[_0xbd18('0x18')](handleError(_0x5af823,null));};exports['voiceQueuesPreview']=function(_0x30b978,_0x549f54){return respondWithRpcPromise('VoiceQueuesPreview',_['merge'](_0x30b978['query'],_0x30b978[_0xbd18('0x1b')]))['then'](respondWithResult(_0x549f54,null))[_0xbd18('0x18')](handleError(_0x549f54,null));};exports[_0xbd18('0x20')]=function(_0x5b9af5,_0x3ccdc5){return respondWithRpcPromise('VoiceQueuesChannels',_0x5b9af5[_0xbd18('0x17')])['then'](respondWithResult(_0x3ccdc5,null))[_0xbd18('0x18')](handleError(_0x3ccdc5,null));};exports[_0xbd18('0x21')]=function(_0x53b9a8,_0x4e7284){return respondWithRpcPromise(_0xbd18('0x22'),_[_0xbd18('0x1a')](_0x53b9a8[_0xbd18('0x17')],_0x53b9a8['params']))[_0xbd18('0x9')](respondWithResult(_0x4e7284,null))['catch'](handleError(_0x4e7284,null));};exports[_0xbd18('0x23')]=function(_0x5bf563,_0x13f04d){return respondWithRpcPromise(_0xbd18('0x24'),_[_0xbd18('0x1a')](_0x5bf563[_0xbd18('0x17')],_0x5bf563[_0xbd18('0x1b')]))['then'](respondWithResult(_0x13f04d,null))[_0xbd18('0x18')](handleError(_0x13f04d,null));};exports[_0xbd18('0x25')]=function(_0x4cafbf,_0x2d6266){return respondWithRpcPromise(_0xbd18('0x26'),_[_0xbd18('0x1a')](_0x4cafbf[_0xbd18('0x17')],_0x4cafbf['params']))[_0xbd18('0x9')](respondWithResult(_0x2d6266,null))['catch'](handleError(_0x2d6266,null));};exports[_0xbd18('0x27')]=function(_0x471d44,_0x3045ba){return respondWithRpcPromise(_0xbd18('0x28'),_0x471d44[_0xbd18('0x17')])['then'](respondWithResult(_0x3045ba,null))[_0xbd18('0x18')](handleError(_0x3045ba,null));};exports['outboundChannels']=function(_0x47c81e,_0x1754a7){return respondWithRpcPromise(_0xbd18('0x29'),_0x47c81e['query'])['then'](respondWithResult(_0x1754a7,null))['catch'](handleError(_0x1754a7,null));};exports[_0xbd18('0x2a')]=function(_0x4bc547,_0x123064){var _0xe33f58;return respondWithRpcPromise('Agents',_0x4bc547[_0xbd18('0x17')])[_0xbd18('0x9')](function(_0x2e530a){_0xe33f58=_0x2e530a;return respondWithRpcPromise('Agents',_0x4bc547[_0xbd18('0x17')],routingClient);})[_0xbd18('0x9')](function(_0x59ee0b){return _[_0xbd18('0x1a')]({},_0x59ee0b,_0xe33f58);})[_0xbd18('0x9')](respondWithResult(_0x123064,null))[_0xbd18('0x18')](handleError(_0x123064,null));};exports[_0xbd18('0x2b')]=function(_0x2ea912,_0xdd5387){if(_0x2ea912[_0xbd18('0x2c')]&&_0x2ea912[_0xbd18('0x2c')][_0xbd18('0x2d')]&&_0x2ea912['user']&&_0x2ea912[_0xbd18('0x2e')]['name']){for(var _0x2a409b in _0x2ea912[_0xbd18('0x2c')][_0xbd18('0x2d')]){if(_0x2ea912['body']['interaction'][_0xbd18('0x2f')](_0x2a409b)){db[_0xbd18('0x30')][_0xbd18('0x31')]({'where':{'channel':_0x2a409b,'membername':_0x2ea912[_0xbd18('0x2e')][_0xbd18('0x11')],'type':_0xbd18('0x32'),'exitAt':null,'uniqueid':_0x2ea912[_0xbd18('0x2c')][_0xbd18('0x2d')][_0x2a409b]&&_0x2ea912[_0xbd18('0x2c')][_0xbd18('0x2d')][_0x2a409b][_0xbd18('0x33')]?{'$notIn':_0x2ea912['body'][_0xbd18('0x2d')][_0x2a409b]}:{'$ne':null}}})['then'](function(_0x1f25f2){var _0x99a591=moment()[_0xbd18('0x34')](_0xbd18('0x35'));for(var _0x2ecf35=0x0,_0x4be341=_0x1f25f2[_0xbd18('0x33')];_0x2ecf35<_0x4be341;_0x2ecf35+=0x1){_0x1f25f2[_0x2ecf35][_0xbd18('0x36')]({'exitAt':_0x99a591});}});for(var _0x33c152=0x0;_0x33c152<_0x2ea912['body'][_0xbd18('0x2d')][_0x2a409b][_0xbd18('0x33')];_0x33c152+=0x1){db[_0xbd18('0x30')]['findOrCreate']({'where':{'channel':_0x2a409b,'membername':_0x2ea912[_0xbd18('0x2e')][_0xbd18('0x11')],'type':_0xbd18('0x32'),'uniqueid':_0x2ea912[_0xbd18('0x2c')]['interaction'][_0x2a409b][_0x33c152],'exitAt':null},'defaults':{'channel':_0x2a409b,'membername':_0x2ea912[_0xbd18('0x2e')]['name'],'interface':_[_0xbd18('0x13')](_0x2ea912[_0xbd18('0x2e')][_0xbd18('0x37')])?util[_0xbd18('0x34')]('SIP/%s',_0x2ea912['user']['name']):_0x2ea912[_0xbd18('0x2e')][_0xbd18('0x37')],'type':_0xbd18('0x32'),'enterAt':moment()['format'](_0xbd18('0x35')),'role':_0xbd18('0x38'),'internal':_0x2ea912['user']['internal'],'uniqueid':_0x2ea912[_0xbd18('0x2c')]['interaction'][_0x2a409b][_0x33c152]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x2ea912[_0xbd18('0x1b')]['id'],'capacity':_0x2ea912[_0xbd18('0x2c')][_0xbd18('0x39')]},routingClient)[_0xbd18('0x9')](respondWithResult(_0xdd5387,null))[_0xbd18('0x18')](handleError(_0xdd5387,null));};exports[_0xbd18('0x3a')]=function(_0x49bd27,_0x1ee850){return respondWithRpcPromise('Telephones',_0x49bd27['query'])[_0xbd18('0x9')](respondWithResult(_0x1ee850,null))[_0xbd18('0x18')](handleError(_0x1ee850,null));};exports[_0xbd18('0x3b')]=function(_0x2d01c5,_0x275c3d){return respondWithRpcPromise(_0xbd18('0x3c'),_0x2d01c5[_0xbd18('0x17')])[_0xbd18('0x9')](respondWithResult(_0x275c3d,null))[_0xbd18('0x18')](handleError(_0x275c3d,null));};exports[_0xbd18('0x3d')]=function(_0x539b13,_0x1971b5){return respondWithRpcPromise(_0xbd18('0x3e'),_0x539b13[_0xbd18('0x17')])[_0xbd18('0x9')](respondWithResult(_0x1971b5,null))[_0xbd18('0x18')](handleError(_0x1971b5,null));};exports['chatQueues']=function(_0xceabdb,_0x106b49){return respondWithRpcPromise(_0xbd18('0x3f'),_0xceabdb[_0xbd18('0x17')],routingClient)[_0xbd18('0x9')](respondWithResult(_0x106b49,null))[_0xbd18('0x18')](handleError(_0x106b49,null));};exports['showChatQueues']=function(_0xa022f7,_0x44aaf1){return respondWithRpcPromise('ChatQueues',_0xa022f7[_0xbd18('0x17')],routingClient)[_0xbd18('0x9')](findById(_0xa022f7[_0xbd18('0x1b')]['id']))[_0xbd18('0x9')](respondWithResult(_0x44aaf1,null))[_0xbd18('0x18')](handleError(_0x44aaf1,null));};exports[_0xbd18('0x40')]=function(_0xaa4535,_0x414db8){return respondWithRpcPromise(_0xbd18('0x41'),_0xaa4535[_0xbd18('0x17')],routingClient)[_0xbd18('0x9')](respondWithResult(_0x414db8,null))['catch'](handleError(_0x414db8,null));};exports[_0xbd18('0x42')]=function(_0xe01b67,_0x44fa72){return respondWithRpcPromise('MailQueues',_0xe01b67[_0xbd18('0x17')],routingClient)[_0xbd18('0x9')](findById(_0xe01b67[_0xbd18('0x1b')]['id']))[_0xbd18('0x9')](respondWithResult(_0x44fa72,null))[_0xbd18('0x18')](handleError(_0x44fa72,null));};exports['mailAccounts']=function(_0x105e22,_0x25c766){return respondWithRpcPromise('MailAccounts',_0x105e22[_0xbd18('0x17')],mailClient)[_0xbd18('0x9')](respondWithResult(_0x25c766,null))[_0xbd18('0x18')](handleError(_0x25c766,null));};exports[_0xbd18('0x43')]=function(_0x5af084,_0x5249c1){return respondWithRpcPromise('OpenchannelQueues',_0x5af084['query'],routingClient)[_0xbd18('0x9')](respondWithResult(_0x5249c1,null))[_0xbd18('0x18')](handleError(_0x5249c1,null));};exports[_0xbd18('0x44')]=function(_0xce6a60,_0x5e6a86){return respondWithRpcPromise(_0xbd18('0x45'),_0xce6a60[_0xbd18('0x17')],routingClient)[_0xbd18('0x9')](findById(_0xce6a60[_0xbd18('0x1b')]['id']))['then'](respondWithResult(_0x5e6a86,null))[_0xbd18('0x18')](handleError(_0x5e6a86,null));};exports['smsQueues']=function(_0x543fd5,_0x383c8d){return respondWithRpcPromise(_0xbd18('0x46'),_0x543fd5[_0xbd18('0x17')],routingClient)[_0xbd18('0x9')](respondWithResult(_0x383c8d,null))['catch'](handleError(_0x383c8d,null));};exports[_0xbd18('0x47')]=function(_0x274666,_0x5261cb){return respondWithRpcPromise(_0xbd18('0x46'),_0x274666[_0xbd18('0x17')],routingClient)['then'](findById(_0x274666['params']['id']))[_0xbd18('0x9')](respondWithResult(_0x5261cb,null))[_0xbd18('0x18')](handleError(_0x5261cb,null));};exports[_0xbd18('0x48')]=function(_0x122f08,_0x43bd2f){return respondWithRpcPromise('FaxQueues',_0x122f08[_0xbd18('0x17')],routingClient)['then'](respondWithResult(_0x43bd2f,null))['catch'](handleError(_0x43bd2f,null));};exports[_0xbd18('0x49')]=function(_0x3dc9b8,_0x2de9cd){return respondWithRpcPromise(_0xbd18('0x4a'),_0x3dc9b8[_0xbd18('0x17')],routingClient)[_0xbd18('0x9')](findById(_0x3dc9b8[_0xbd18('0x1b')]['id']))['then'](respondWithResult(_0x2de9cd,null))[_0xbd18('0x18')](handleError(_0x2de9cd,null));};exports[_0xbd18('0x4b')]=function(_0x14bc45,_0x4ba9f8){return respondWithRpcPromise('FaxAccounts',_0x14bc45[_0xbd18('0x17')])['then'](respondWithResult(_0x4ba9f8,null))['catch'](handleError(_0x4ba9f8,null));};exports[_0xbd18('0x4c')]=function(_0x37accf,_0x5930e1){return respondWithRpcPromise(_0xbd18('0x4d'),_0x37accf[_0xbd18('0x17')],routingClient)[_0xbd18('0x9')](respondWithResult(_0x5930e1,null))['catch'](handleError(_0x5930e1,null));};exports[_0xbd18('0x4e')]=function(_0x2e731d,_0x2a1e9b){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x2e731d[_0xbd18('0x17')],routingClient)[_0xbd18('0x9')](respondWithResult(_0x2a1e9b,null))[_0xbd18('0x18')](handleError(_0x2a1e9b,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x2cf903,_0x255601){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x2cf903['query'],routingClient)[_0xbd18('0x9')](respondWithResult(_0x255601,null))[_0xbd18('0x18')](handleError(_0x255601,null));};exports[_0xbd18('0x4f')]=function(_0x309433,_0x36c4a8){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x309433['query'],routingClient)[_0xbd18('0x9')](respondWithResult(_0x36c4a8,null))['catch'](handleError(_0x36c4a8,null));};exports[_0xbd18('0x50')]=function(_0x603de1,_0x5b3e96){return respondWithRpcPromise(_0xbd18('0x51'),_0x603de1[_0xbd18('0x17')],routingClient)[_0xbd18('0x9')](respondWithResult(_0x5b3e96,null))['catch'](handleError(_0x5b3e96,null));};exports['queueNotify']=function(_0x52a50a){return function(_0x59ae34,_0x2a7408){var _0x3baff8,_0xfeb918;var _0x534c96=_[_0xbd18('0x52')](_0x52a50a);var _0x44e2a0=_0x52a50a===_0xbd18('0x53')?'Website':_0xbd18('0x54');return db[_0x534c96+'Queue'][_0xbd18('0x55')]({'raw':!![],'where':{'id':_0x59ae34[_0xbd18('0x1b')]['id']}})[_0xbd18('0x9')](function(_0x353414){if(_[_0xbd18('0x13')](_0x353414)){throw new Error(_0x534c96+_0xbd18('0x56'));}_0x3baff8=_0x353414;return db[_0x534c96+'Message']['findOne']({'where':{'id':_0x59ae34[_0xbd18('0x2c')][_0xbd18('0x57')]},'include':[{'model':db[_0x534c96+'Interaction'],'as':_0xbd18('0x58')},{'model':db[_0x534c96+_0x44e2a0],'as':_0xbd18('0x54')}]});})['then'](function(_0x4e3280){if(_[_0xbd18('0x13')](_0x4e3280)){throw new Error(_0x534c96+_0xbd18('0x59'));}_0xfeb918=_0x4e3280;return _0x4e3280['update']({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x5651dc={'uniqueid':_0x52a50a+'.'+_0xfeb918['id']+'.'+_0xfeb918[_0xbd18('0x58')]['id'],'FromUserId':_0x59ae34[_0xbd18('0x2e')]['id'],'type':'queue'};_0x5651dc[_0x534c96+'MessageId']=_0xfeb918['id'];_0x5651dc[_0x534c96+_0xbd18('0x5a')]=_0xfeb918[_0xbd18('0x58')]['id'];_0x5651dc[_0xbd18('0x5b')+_0x534c96+_0x44e2a0+'Id']=_0xfeb918['Account']['id'];_0x5651dc['To'+_0x534c96+_0xbd18('0x5c')]=_0x3baff8['id'];return db[_0x534c96+_0xbd18('0x5d')][_0xbd18('0x5e')](_0x5651dc);})['then'](function(){return respondWithRpcPromise(_0xbd18('0x5f'),{'channel':_0x52a50a,'interaction':_0xfeb918[_0xbd18('0x58')],'message':_0xfeb918,'account':_0xfeb918[_0xbd18('0x54')],'applications':[{'id':0x0,'priority':0x1,'app':_0xbd18('0x60'),'appdata':_0x3baff8['name']+','+(_0xfeb918['Account'][_0xbd18('0x61')]||0x12c),'interval':_0xbd18('0x62')}]},routingClient);})[_0xbd18('0x9')](respondWithResult(_0x2a7408,null))['catch'](handleError(_0x2a7408,null));};};exports[_0xbd18('0x63')]=function(_0xda7c0e,_0x47884a){var _0x56b97f,_0x4a8aa5;if(_[_0xbd18('0x13')](_0xda7c0e[_0xbd18('0x2c')][_0xbd18('0x64')])){throw new Error(_0xbd18('0x65'));}var _0x235cd0=_0xda7c0e['body']['channel'];var _0x14a140=_[_0xbd18('0x52')](_0x235cd0);var _0x4e1c50=_0x235cd0===_0xbd18('0x53')?'Website':_0xbd18('0x54');return db[_0xbd18('0x66')][_0xbd18('0x55')]({'raw':!![],'where':{'id':_0xda7c0e[_0xbd18('0x1b')]['id'],'role':_0xbd18('0x38')}})['then'](function(_0x1ef4de){if(_[_0xbd18('0x13')](_0x1ef4de)){throw new Error(_0xbd18('0x67'));}_0x56b97f=_0x1ef4de;return db[_0x14a140+_0xbd18('0x68')][_0xbd18('0x55')]({'where':{'id':_0xda7c0e[_0xbd18('0x2c')][_0xbd18('0x57')]},'include':[{'model':db[_0x14a140+_0xbd18('0x58')],'as':'Interaction'},{'model':db[_0x14a140+_0x4e1c50],'as':'Account'}]});})[_0xbd18('0x9')](function(_0x32491b){if(_[_0xbd18('0x13')](_0x32491b)){throw new Error(_0x14a140+_0xbd18('0x59'));}_0x4a8aa5=_0x32491b;return _0x32491b[_0xbd18('0x69')]({'read':0x0,'readAt':null,'UserId':null});})[_0xbd18('0x9')](function(){var _0x486ddc={'uniqueid':_0x235cd0+'.'+_0x4a8aa5['id']+'.'+_0x4a8aa5[_0xbd18('0x58')]['id'],'FromUserId':_0xda7c0e[_0xbd18('0x2e')]['id'],'type':_0xbd18('0x60'),'ToUserId':_0x56b97f['id']};_0x486ddc[_0x14a140+_0xbd18('0x6a')]=_0x4a8aa5['id'];_0x486ddc[_0x14a140+_0xbd18('0x5a')]=_0x4a8aa5[_0xbd18('0x58')]['id'];_0x486ddc[_0xbd18('0x5b')+_0x14a140+_0x4e1c50+'Id']=_0x4a8aa5[_0xbd18('0x54')]['id'];return db[_0x14a140+'TransferReport'][_0xbd18('0x5e')](_0x486ddc);})['then'](function(){return respondWithRpcPromise(_0xbd18('0x5f'),{'channel':_0x235cd0,'interaction':_0x4a8aa5[_0xbd18('0x58')],'message':_0x4a8aa5,'account':_0x4a8aa5[_0xbd18('0x54')],'applications':[{'id':0x0,'priority':0x1,'app':_0xbd18('0x38'),'appdata':_0x56b97f[_0xbd18('0x11')]+','+(_0x4a8aa5[_0xbd18('0x54')][_0xbd18('0x6b')]||0x12c),'interval':_0xbd18('0x62')}]},routingClient);})[_0xbd18('0x9')](respondWithResult(_0x47884a,null))['catch'](handleError(_0x47884a,null));}; \ No newline at end of file +var _0xd90d=['MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','update','MessageId','InteractionId','QueueId','TransferReport','create','Start','queueTransferTimeout','agentNotify','channel','Website','User','agentTransferTimeout','*,*,*,*','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','error','code','message','status','json','sendStatus','name','isNil','rows','find','voiceChannels','VoiceChannels','query','then','VoiceChannelMixMonitor','catch','merge','params','showVoiceQueues','VoiceQueues','voiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','body','user','interaction','hasOwnProperty','MemberReport','findAll','INTERACTION','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','format','agent','internal','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','MailQueues','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','FaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions'];(function(_0x53561c,_0x4baa3b){var _0x47e779=function(_0x4371af){while(--_0x4371af){_0x53561c['push'](_0x53561c['shift']());}};_0x47e779(++_0x4baa3b);}(_0xd90d,0x90));var _0xdd90=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0xd90d[_0x24061a];return _0x82054e;};'use strict';var BPromise=require(_0xdd90('0x0'));var moment=require(_0xdd90('0x1'));var _=require(_0xdd90('0x2'));var util=require(_0xdd90('0x3'));var db=require(_0xdd90('0x4'))['db'];var logger=require(_0xdd90('0x5'))(_0xdd90('0x6'));var jayson=require(_0xdd90('0x7'));var amiClient=jayson[_0xdd90('0x8')][_0xdd90('0x9')]({'port':0x232a});var mailClient=jayson['client'][_0xdd90('0x9')]({'port':0x232b});var routingClient=jayson[_0xdd90('0x8')][_0xdd90('0x9')]({'port':0x232c});function respondWithRpcPromise(_0x162d45,_0x2701e0,_0xbe49c0){return new BPromise(function(_0x198b35,_0x2b929a){var _0x2e2db2=_0xbe49c0?_0xbe49c0:amiClient;return _0x2e2db2['request'](_0x162d45,_0x2701e0)['then'](function(_0x1a1367){if(_0x1a1367[_0xdd90('0xa')]){if(_0x1a1367['error'][_0xdd90('0xb')]===0x1f4){return _0x2b929a(_0x1a1367[_0xdd90('0xa')][_0xdd90('0xc')]);}return _0x198b35(_0x1a1367[_0xdd90('0xa')]['message']);}else{_0x198b35(_0x1a1367['result']);}})['catch'](function(_0x4d89ad){_0x2b929a(_0x4d89ad);});});}function respondWithResult(_0x966cd9,_0x26977c){_0x26977c=_0x26977c||0xc8;return function(_0x13ad23){if(_0x13ad23){return _0x966cd9[_0xdd90('0xd')](_0x26977c)[_0xdd90('0xe')](_0x13ad23);}return _0x966cd9[_0xdd90('0xf')](0x194);};}function handleError(_0x3e7ae0,_0x4e6a15){_0x4e6a15=_0x4e6a15||0x1f4;return function(_0x104f72){logger[_0xdd90('0xa')](_0x104f72['stack']);if(_0x104f72[_0xdd90('0x10')]){delete _0x104f72[_0xdd90('0x10')];}_0x3e7ae0['status'](_0x4e6a15)['send'](_0x104f72);};}function findById(_0x5b841c){return function(_0x32f858){if(!_[_0xdd90('0x11')](_0x5b841c)&&!_['isNil'](_0x32f858)&&!_[_0xdd90('0x11')](_0x32f858[_0xdd90('0x12')])){return _[_0xdd90('0x13')](_0x32f858[_0xdd90('0x12')],function(_0x5179fb){return _0x5179fb['id']==_0x5b841c;});}return null;};}exports[_0xdd90('0x14')]=function(_0x4fca9b,_0x3adcf8){return respondWithRpcPromise(_0xdd90('0x15'),_0x4fca9b[_0xdd90('0x16')])[_0xdd90('0x17')](respondWithResult(_0x3adcf8,null))['catch'](handleError(_0x3adcf8,null));};exports['voiceChannelMixMonitor']=function(_0x4a82f7,_0x56518b){return respondWithRpcPromise(_0xdd90('0x18'),_['merge'](_0x4a82f7[_0xdd90('0x16')],_0x4a82f7['params']))['then'](respondWithResult(_0x56518b,null))[_0xdd90('0x19')](handleError(_0x56518b,null));};exports['voiceChannelStopMixMonitor']=function(_0x1e23b1,_0x1b398b){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_[_0xdd90('0x1a')](_0x1e23b1[_0xdd90('0x16')],_0x1e23b1[_0xdd90('0x1b')]))[_0xdd90('0x17')](respondWithResult(_0x1b398b,null))['catch'](handleError(_0x1b398b,null));};exports['voiceQueues']=function(_0x12a9e8,_0xadc0a2){return respondWithRpcPromise('VoiceQueues',_0x12a9e8[_0xdd90('0x16')])[_0xdd90('0x17')](respondWithResult(_0xadc0a2,null))[_0xdd90('0x19')](handleError(_0xadc0a2,null));};exports[_0xdd90('0x1c')]=function(_0x101a0c,_0x599a82){return respondWithRpcPromise(_0xdd90('0x1d'),_0x101a0c['query'])[_0xdd90('0x17')](findById(_0x101a0c[_0xdd90('0x1b')]['id']))[_0xdd90('0x17')](respondWithResult(_0x599a82,null))[_0xdd90('0x19')](handleError(_0x599a82,null));};exports[_0xdd90('0x1e')]=function(_0xa27266,_0x3119a7){return respondWithRpcPromise('VoiceQueuesPreview',_[_0xdd90('0x1a')](_0xa27266['query'],_0xa27266[_0xdd90('0x1b')]))[_0xdd90('0x17')](respondWithResult(_0x3119a7,null))[_0xdd90('0x19')](handleError(_0x3119a7,null));};exports[_0xdd90('0x1f')]=function(_0x4562ef,_0x335755){return respondWithRpcPromise('VoiceQueuesChannels',_0x4562ef[_0xdd90('0x16')])['then'](respondWithResult(_0x335755,null))[_0xdd90('0x19')](handleError(_0x335755,null));};exports[_0xdd90('0x20')]=function(_0x564f1b,_0x222436){return respondWithRpcPromise(_0xdd90('0x21'),_[_0xdd90('0x1a')](_0x564f1b[_0xdd90('0x16')],_0x564f1b[_0xdd90('0x1b')]))[_0xdd90('0x17')](respondWithResult(_0x222436,null))['catch'](handleError(_0x222436,null));};exports['voiceQueuesChannelHangup']=function(_0x55e49c,_0x448443){return respondWithRpcPromise(_0xdd90('0x22'),_[_0xdd90('0x1a')](_0x55e49c[_0xdd90('0x16')],_0x55e49c['params']))[_0xdd90('0x17')](respondWithResult(_0x448443,null))[_0xdd90('0x19')](handleError(_0x448443,null));};exports[_0xdd90('0x23')]=function(_0x169064,_0x1344a3){return respondWithRpcPromise(_0xdd90('0x24'),_[_0xdd90('0x1a')](_0x169064[_0xdd90('0x16')],_0x169064[_0xdd90('0x1b')]))[_0xdd90('0x17')](respondWithResult(_0x1344a3,null))[_0xdd90('0x19')](handleError(_0x1344a3,null));};exports[_0xdd90('0x25')]=function(_0x16006d,_0x357360){return respondWithRpcPromise(_0xdd90('0x26'),_0x16006d[_0xdd90('0x16')])['then'](respondWithResult(_0x357360,null))[_0xdd90('0x19')](handleError(_0x357360,null));};exports[_0xdd90('0x27')]=function(_0x51add5,_0x4a581e){return respondWithRpcPromise(_0xdd90('0x28'),_0x51add5[_0xdd90('0x16')])[_0xdd90('0x17')](respondWithResult(_0x4a581e,null))['catch'](handleError(_0x4a581e,null));};exports[_0xdd90('0x29')]=function(_0x1c972d,_0x70177a){var _0x4ae1e5;return respondWithRpcPromise(_0xdd90('0x2a'),_0x1c972d['query'])[_0xdd90('0x17')](function(_0x244d9b){_0x4ae1e5=_0x244d9b;return respondWithRpcPromise('Agents',_0x1c972d[_0xdd90('0x16')],routingClient);})['then'](function(_0x59e94e){return _[_0xdd90('0x1a')]({},_0x59e94e,_0x4ae1e5);})[_0xdd90('0x17')](respondWithResult(_0x70177a,null))['catch'](handleError(_0x70177a,null));};exports[_0xdd90('0x2b')]=function(_0x293976,_0x62ed65){if(_0x293976[_0xdd90('0x2c')]&&_0x293976[_0xdd90('0x2c')]['interaction']&&_0x293976[_0xdd90('0x2d')]&&_0x293976[_0xdd90('0x2d')][_0xdd90('0x10')]){for(var _0x3109ea in _0x293976[_0xdd90('0x2c')][_0xdd90('0x2e')]){if(_0x293976[_0xdd90('0x2c')][_0xdd90('0x2e')][_0xdd90('0x2f')](_0x3109ea)){db[_0xdd90('0x30')][_0xdd90('0x31')]({'where':{'channel':_0x3109ea,'membername':_0x293976['user']['name'],'type':_0xdd90('0x32'),'exitAt':null,'uniqueid':_0x293976[_0xdd90('0x2c')][_0xdd90('0x2e')][_0x3109ea]&&_0x293976[_0xdd90('0x2c')]['interaction'][_0x3109ea][_0xdd90('0x33')]?{'$notIn':_0x293976['body'][_0xdd90('0x2e')][_0x3109ea]}:{'$ne':null}}})[_0xdd90('0x17')](function(_0x12dc70){var _0x5e3501=moment()['format'](_0xdd90('0x34'));for(var _0x126fda=0x0,_0x3d1baf=_0x12dc70['length'];_0x126fda<_0x3d1baf;_0x126fda+=0x1){_0x12dc70[_0x126fda][_0xdd90('0x35')]({'exitAt':_0x5e3501});}});for(var _0x596937=0x0;_0x596937<_0x293976[_0xdd90('0x2c')][_0xdd90('0x2e')][_0x3109ea][_0xdd90('0x33')];_0x596937+=0x1){db['MemberReport'][_0xdd90('0x36')]({'where':{'channel':_0x3109ea,'membername':_0x293976[_0xdd90('0x2d')][_0xdd90('0x10')],'type':_0xdd90('0x32'),'uniqueid':_0x293976['body'][_0xdd90('0x2e')][_0x3109ea][_0x596937],'exitAt':null},'defaults':{'channel':_0x3109ea,'membername':_0x293976[_0xdd90('0x2d')][_0xdd90('0x10')],'interface':_[_0xdd90('0x11')](_0x293976[_0xdd90('0x2d')][_0xdd90('0x37')])?util['format']('SIP/%s',_0x293976[_0xdd90('0x2d')][_0xdd90('0x10')]):_0x293976[_0xdd90('0x2d')][_0xdd90('0x37')],'type':_0xdd90('0x32'),'enterAt':moment()[_0xdd90('0x38')](_0xdd90('0x34')),'role':_0xdd90('0x39'),'internal':_0x293976[_0xdd90('0x2d')][_0xdd90('0x3a')],'uniqueid':_0x293976[_0xdd90('0x2c')][_0xdd90('0x2e')][_0x3109ea][_0x596937]}});}}}}return respondWithRpcPromise(_0xdd90('0x3b'),{'id':_0x293976[_0xdd90('0x1b')]['id'],'capacity':_0x293976[_0xdd90('0x2c')][_0xdd90('0x3c')]},routingClient)[_0xdd90('0x17')](respondWithResult(_0x62ed65,null))['catch'](handleError(_0x62ed65,null));};exports[_0xdd90('0x3d')]=function(_0x3c6d2e,_0x3d63e2){return respondWithRpcPromise(_0xdd90('0x3e'),_0x3c6d2e[_0xdd90('0x16')])[_0xdd90('0x17')](respondWithResult(_0x3d63e2,null))[_0xdd90('0x19')](handleError(_0x3d63e2,null));};exports[_0xdd90('0x3f')]=function(_0x2f98ee,_0x2fcd57){return respondWithRpcPromise(_0xdd90('0x40'),_0x2f98ee[_0xdd90('0x16')])[_0xdd90('0x17')](respondWithResult(_0x2fcd57,null))[_0xdd90('0x19')](handleError(_0x2fcd57,null));};exports[_0xdd90('0x41')]=function(_0x1d64f2,_0x114de7){return respondWithRpcPromise(_0xdd90('0x42'),_0x1d64f2[_0xdd90('0x16')])[_0xdd90('0x17')](respondWithResult(_0x114de7,null))[_0xdd90('0x19')](handleError(_0x114de7,null));};exports[_0xdd90('0x43')]=function(_0x877bc9,_0x2656c0){return respondWithRpcPromise(_0xdd90('0x44'),_0x877bc9[_0xdd90('0x16')],routingClient)[_0xdd90('0x17')](respondWithResult(_0x2656c0,null))[_0xdd90('0x19')](handleError(_0x2656c0,null));};exports['showChatQueues']=function(_0x2d196d,_0x5eed0b){return respondWithRpcPromise(_0xdd90('0x44'),_0x2d196d[_0xdd90('0x16')],routingClient)[_0xdd90('0x17')](findById(_0x2d196d['params']['id']))['then'](respondWithResult(_0x5eed0b,null))[_0xdd90('0x19')](handleError(_0x5eed0b,null));};exports['mailQueues']=function(_0xbc7228,_0x360bba){return respondWithRpcPromise(_0xdd90('0x45'),_0xbc7228['query'],routingClient)[_0xdd90('0x17')](respondWithResult(_0x360bba,null))['catch'](handleError(_0x360bba,null));};exports['showMailQueues']=function(_0x282324,_0x58e944){return respondWithRpcPromise(_0xdd90('0x45'),_0x282324['query'],routingClient)[_0xdd90('0x17')](findById(_0x282324[_0xdd90('0x1b')]['id']))[_0xdd90('0x17')](respondWithResult(_0x58e944,null))[_0xdd90('0x19')](handleError(_0x58e944,null));};exports['mailAccounts']=function(_0x43b1a1,_0x34c091){return respondWithRpcPromise(_0xdd90('0x46'),_0x43b1a1[_0xdd90('0x16')],mailClient)[_0xdd90('0x17')](respondWithResult(_0x34c091,null))[_0xdd90('0x19')](handleError(_0x34c091,null));};exports[_0xdd90('0x47')]=function(_0x3a7f1b,_0x5169bf){return respondWithRpcPromise(_0xdd90('0x48'),_0x3a7f1b[_0xdd90('0x16')],routingClient)[_0xdd90('0x17')](respondWithResult(_0x5169bf,null))[_0xdd90('0x19')](handleError(_0x5169bf,null));};exports[_0xdd90('0x49')]=function(_0x4bd590,_0x12f86f){return respondWithRpcPromise(_0xdd90('0x48'),_0x4bd590[_0xdd90('0x16')],routingClient)[_0xdd90('0x17')](findById(_0x4bd590['params']['id']))[_0xdd90('0x17')](respondWithResult(_0x12f86f,null))[_0xdd90('0x19')](handleError(_0x12f86f,null));};exports[_0xdd90('0x4a')]=function(_0x206942,_0x55333c){return respondWithRpcPromise('SmsQueues',_0x206942[_0xdd90('0x16')],routingClient)[_0xdd90('0x17')](respondWithResult(_0x55333c,null))[_0xdd90('0x19')](handleError(_0x55333c,null));};exports['showSmsQueues']=function(_0x2b5794,_0x511b74){return respondWithRpcPromise(_0xdd90('0x4b'),_0x2b5794[_0xdd90('0x16')],routingClient)['then'](findById(_0x2b5794[_0xdd90('0x1b')]['id']))['then'](respondWithResult(_0x511b74,null))['catch'](handleError(_0x511b74,null));};exports['faxQueues']=function(_0x441228,_0x5ee0ff){return respondWithRpcPromise(_0xdd90('0x4c'),_0x441228['query'],routingClient)[_0xdd90('0x17')](respondWithResult(_0x5ee0ff,null))[_0xdd90('0x19')](handleError(_0x5ee0ff,null));};exports['showFaxQueues']=function(_0x39d0ce,_0x3cb4a2){return respondWithRpcPromise(_0xdd90('0x4c'),_0x39d0ce[_0xdd90('0x16')],routingClient)[_0xdd90('0x17')](findById(_0x39d0ce[_0xdd90('0x1b')]['id']))[_0xdd90('0x17')](respondWithResult(_0x3cb4a2,null))[_0xdd90('0x19')](handleError(_0x3cb4a2,null));};exports[_0xdd90('0x4d')]=function(_0x156860,_0x28e895){return respondWithRpcPromise(_0xdd90('0x4e'),_0x156860[_0xdd90('0x16')])['then'](respondWithResult(_0x28e895,null))[_0xdd90('0x19')](handleError(_0x28e895,null));};exports[_0xdd90('0x4f')]=function(_0x1ada40,_0x17bba2){return respondWithRpcPromise(_0xdd90('0x50'),_0x1ada40[_0xdd90('0x16')],routingClient)[_0xdd90('0x17')](respondWithResult(_0x17bba2,null))[_0xdd90('0x19')](handleError(_0x17bba2,null));};exports[_0xdd90('0x51')]=function(_0x2ff21d,_0x153cdb){return respondWithRpcPromise(_0xdd90('0x52'),_0x2ff21d[_0xdd90('0x16')],routingClient)['then'](respondWithResult(_0x153cdb,null))[_0xdd90('0x19')](handleError(_0x153cdb,null));};exports[_0xdd90('0x53')]=function(_0x2d0e93,_0x3a9982){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x2d0e93[_0xdd90('0x16')],routingClient)[_0xdd90('0x17')](respondWithResult(_0x3a9982,null))[_0xdd90('0x19')](handleError(_0x3a9982,null));};exports[_0xdd90('0x54')]=function(_0x2e1321,_0x32880a){return respondWithRpcPromise(_0xdd90('0x55'),_0x2e1321[_0xdd90('0x16')],routingClient)[_0xdd90('0x17')](respondWithResult(_0x32880a,null))[_0xdd90('0x19')](handleError(_0x32880a,null));};exports[_0xdd90('0x56')]=function(_0x57862c,_0x41e302){return respondWithRpcPromise(_0xdd90('0x57'),_0x57862c[_0xdd90('0x16')],routingClient)[_0xdd90('0x17')](respondWithResult(_0x41e302,null))[_0xdd90('0x19')](handleError(_0x41e302,null));};exports[_0xdd90('0x58')]=function(_0x19dc85){return function(_0x19256a,_0x2859d0){var _0x461353,_0x34328f;var _0xd713cb=_[_0xdd90('0x59')](_0x19dc85);var _0x48aef6=_0x19dc85===_0xdd90('0x5a')?'Website':_0xdd90('0x5b');return db[_0xd713cb+_0xdd90('0x5c')][_0xdd90('0x5d')]({'raw':!![],'where':{'id':_0x19256a[_0xdd90('0x1b')]['id']}})[_0xdd90('0x17')](function(_0x33b423){if(_['isNil'](_0x33b423)){throw new Error(_0xd713cb+_0xdd90('0x5e'));}_0x461353=_0x33b423;return db[_0xd713cb+_0xdd90('0x5f')][_0xdd90('0x5d')]({'where':{'id':_0x19256a[_0xdd90('0x2c')][_0xdd90('0x60')]},'include':[{'model':db[_0xd713cb+_0xdd90('0x61')],'as':_0xdd90('0x61')},{'model':db[_0xd713cb+_0x48aef6],'as':_0xdd90('0x5b')}]});})[_0xdd90('0x17')](function(_0x524c07){if(_[_0xdd90('0x11')](_0x524c07)){throw new Error(_0xd713cb+_0xdd90('0x62'));}_0x34328f=_0x524c07;return _0x524c07[_0xdd90('0x63')]({'read':0x0,'readAt':null,'UserId':null});})[_0xdd90('0x17')](function(){var _0x528974={'uniqueid':_0x19dc85+'.'+_0x34328f['id']+'.'+_0x34328f[_0xdd90('0x61')]['id'],'FromUserId':_0x19256a[_0xdd90('0x2d')]['id'],'type':'queue'};_0x528974[_0xd713cb+_0xdd90('0x64')]=_0x34328f['id'];_0x528974[_0xd713cb+_0xdd90('0x65')]=_0x34328f[_0xdd90('0x61')]['id'];_0x528974['From'+_0xd713cb+_0x48aef6+'Id']=_0x34328f['Account']['id'];_0x528974['To'+_0xd713cb+_0xdd90('0x66')]=_0x461353['id'];return db[_0xd713cb+_0xdd90('0x67')][_0xdd90('0x68')](_0x528974);})[_0xdd90('0x17')](function(){return respondWithRpcPromise(_0xdd90('0x69'),{'channel':_0x19dc85,'interaction':_0x34328f[_0xdd90('0x61')],'message':_0x34328f,'account':_0x34328f[_0xdd90('0x5b')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x461353['name']+','+(_0x34328f[_0xdd90('0x5b')][_0xdd90('0x6a')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xdd90('0x17')](respondWithResult(_0x2859d0,null))[_0xdd90('0x19')](handleError(_0x2859d0,null));};};exports[_0xdd90('0x6b')]=function(_0x19fe91,_0x40028c){var _0x441b5c,_0x1c8c28;if(_['isNil'](_0x19fe91[_0xdd90('0x2c')]['channel'])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x598966=_0x19fe91['body'][_0xdd90('0x6c')];var _0x2e3947=_['capitalize'](_0x598966);var _0x12d782=_0x598966===_0xdd90('0x5a')?_0xdd90('0x6d'):_0xdd90('0x5b');return db[_0xdd90('0x6e')][_0xdd90('0x5d')]({'raw':!![],'where':{'id':_0x19fe91[_0xdd90('0x1b')]['id'],'role':_0xdd90('0x39')}})[_0xdd90('0x17')](function(_0x12408a){if(_[_0xdd90('0x11')](_0x12408a)){throw new Error('Agent\x20not\x20found');}_0x441b5c=_0x12408a;return db[_0x2e3947+_0xdd90('0x5f')][_0xdd90('0x5d')]({'where':{'id':_0x19fe91['body'][_0xdd90('0x60')]},'include':[{'model':db[_0x2e3947+_0xdd90('0x61')],'as':_0xdd90('0x61')},{'model':db[_0x2e3947+_0x12d782],'as':_0xdd90('0x5b')}]});})['then'](function(_0x558459){if(_[_0xdd90('0x11')](_0x558459)){throw new Error(_0x2e3947+_0xdd90('0x62'));}_0x1c8c28=_0x558459;return _0x558459['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xdd90('0x17')](function(){var _0x1e6d8a={'uniqueid':_0x598966+'.'+_0x1c8c28['id']+'.'+_0x1c8c28[_0xdd90('0x61')]['id'],'FromUserId':_0x19fe91[_0xdd90('0x2d')]['id'],'type':'queue','ToUserId':_0x441b5c['id']};_0x1e6d8a[_0x2e3947+_0xdd90('0x64')]=_0x1c8c28['id'];_0x1e6d8a[_0x2e3947+_0xdd90('0x65')]=_0x1c8c28['Interaction']['id'];_0x1e6d8a['From'+_0x2e3947+_0x12d782+'Id']=_0x1c8c28[_0xdd90('0x5b')]['id'];return db[_0x2e3947+_0xdd90('0x67')]['create'](_0x1e6d8a);})[_0xdd90('0x17')](function(){return respondWithRpcPromise(_0xdd90('0x69'),{'channel':_0x598966,'interaction':_0x1c8c28[_0xdd90('0x61')],'message':_0x1c8c28,'account':_0x1c8c28[_0xdd90('0x5b')],'applications':[{'id':0x0,'priority':0x1,'app':_0xdd90('0x39'),'appdata':_0x441b5c[_0xdd90('0x10')]+','+(_0x1c8c28[_0xdd90('0x5b')][_0xdd90('0x6f')]||0x12c),'interval':_0xdd90('0x70')}]},routingClient);})[_0xdd90('0x17')](respondWithResult(_0x40028c,null))[_0xdd90('0x19')](handleError(_0x40028c,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index a713506..7fc543a 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 _0x0830=['path','connect-timeout','Router','../../components/auth/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','/:id','show','/:id/run','run','post','create','update','delete','destroy','exports','multer','util'];(function(_0xbd42f4,_0x56fcf6){var _0x5cb4e0=function(_0x3981e){while(--_0x3981e){_0xbd42f4['push'](_0xbd42f4['shift']());}};_0x5cb4e0(++_0x56fcf6);}(_0x0830,0x163));var _0x0083=function(_0x8ade42,_0x2a68fb){_0x8ade42=_0x8ade42-0x0;var _0x256329=_0x0830[_0x8ade42];return _0x256329;};'use strict';var multer=require(_0x0083('0x0'));var util=require(_0x0083('0x1'));var path=require(_0x0083('0x2'));var timeout=require(_0x0083('0x3'));var express=require('express');var router=express[_0x0083('0x4')]();var auth=require(_0x0083('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0083('0x6'));var controller=require(_0x0083('0x7'));router[_0x0083('0x8')]('/',auth[_0x0083('0x9')](),controller[_0x0083('0xa')]);router[_0x0083('0x8')](_0x0083('0xb'),auth['isAuthenticated'](),controller[_0x0083('0xc')]);router[_0x0083('0x8')](_0x0083('0xd'),auth[_0x0083('0x9')](),controller[_0x0083('0xe')]);router[_0x0083('0xf')]('/',auth[_0x0083('0x9')](),controller[_0x0083('0x10')]);router['put'](_0x0083('0xb'),auth[_0x0083('0x9')](),controller[_0x0083('0x11')]);router[_0x0083('0x12')](_0x0083('0xb'),auth['isAuthenticated'](),controller[_0x0083('0x13')]);module[_0x0083('0x14')]=router; \ No newline at end of file +var _0xdd08=['exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','/:id','show','/:id/run','run','post','delete'];(function(_0x15a629,_0x5160cb){var _0x533cd4=function(_0x3963c5){while(--_0x3963c5){_0x15a629['push'](_0x15a629['shift']());}};_0x533cd4(++_0x5160cb);}(_0xdd08,0xc7));var _0x8dd0=function(_0x26bf51,_0x5e261a){_0x26bf51=_0x26bf51-0x0;var _0x503415=_0xdd08[_0x26bf51];return _0x503415;};'use strict';var multer=require('multer');var util=require(_0x8dd0('0x0'));var path=require(_0x8dd0('0x1'));var timeout=require(_0x8dd0('0x2'));var express=require(_0x8dd0('0x3'));var router=express['Router']();var auth=require(_0x8dd0('0x4'));var interaction=require(_0x8dd0('0x5'));var config=require(_0x8dd0('0x6'));var controller=require(_0x8dd0('0x7'));router[_0x8dd0('0x8')]('/',auth[_0x8dd0('0x9')](),controller[_0x8dd0('0xa')]);router[_0x8dd0('0x8')](_0x8dd0('0xb'),auth['isAuthenticated'](),controller[_0x8dd0('0xc')]);router[_0x8dd0('0x8')](_0x8dd0('0xd'),auth['isAuthenticated'](),controller[_0x8dd0('0xe')]);router[_0x8dd0('0xf')]('/',auth[_0x8dd0('0x9')](),controller['create']);router['put'](_0x8dd0('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8dd0('0x10')](_0x8dd0('0xb'),auth[_0x8dd0('0x9')](),controller['destroy']);module[_0x8dd0('0x11')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index f7d7e7c..004171e 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 _0x448a=['STRING','BOOLEAN','DATE','ENUM','years','quarters','months','weeks','days','hours','csv','pdf','xlsx','custom','TEXT','exports'];(function(_0x4168e9,_0x137419){var _0x4fa5b8=function(_0xb23e35){while(--_0xb23e35){_0x4168e9['push'](_0x4168e9['shift']());}};_0x4fa5b8(++_0x137419);}(_0x448a,0x1ef));var _0xa448=function(_0x4c479c,_0x49f13e){_0x4c479c=_0x4c479c-0x0;var _0x1463ba=_0x448a[_0x4c479c];return _0x1463ba;};'use strict';var Sequelize=require('sequelize');module[_0xa448('0x0')]={'name':{'type':Sequelize[_0xa448('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xa448('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0xa448('0x3')],'allowNull':![]},'endAt':{'type':Sequelize[_0xa448('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xa448('0x4')](_0xa448('0x5'),_0xa448('0x6'),_0xa448('0x7'),_0xa448('0x8'),_0xa448('0x9'),_0xa448('0xa'),'minutes'),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0xa448('0x4')](_0xa448('0xb'),_0xa448('0xc'),_0xa448('0xd')),'allowNull':![],'defaultValue':_0xa448('0xb')},'type':{'type':Sequelize[_0xa448('0x4')](_0xa448('0xe'),'default'),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0xa448('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xa448('0x1')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0xa448('0xf')]},'sendIfEmpty':{'type':Sequelize[_0xa448('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x8b52=['INTEGER','ENUM','years','quarters','months','weeks','days','minutes','csv','pdf','default','custom','TEXT','sequelize','exports','STRING','BOOLEAN','DATE'];(function(_0x1726f0,_0x32220a){var _0x294de6=function(_0x4948d6){while(--_0x4948d6){_0x1726f0['push'](_0x1726f0['shift']());}};_0x294de6(++_0x32220a);}(_0x8b52,0x151));var _0x28b5=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x8b52[_0x2d7f0e];return _0x110b07;};'use strict';var Sequelize=require(_0x28b5('0x0'));module[_0x28b5('0x1')]={'name':{'type':Sequelize[_0x28b5('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x28b5('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x28b5('0x2')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0x28b5('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x28b5('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x28b5('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x28b5('0x6')](_0x28b5('0x7'),_0x28b5('0x8'),_0x28b5('0x9'),_0x28b5('0xa'),_0x28b5('0xb'),'hours',_0x28b5('0xc')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize['ENUM'](_0x28b5('0xd'),_0x28b5('0xe'),'xlsx'),'allowNull':![],'defaultValue':_0x28b5('0xd')},'type':{'type':Sequelize[_0x28b5('0x6')]('custom',_0x28b5('0xf')),'allowNull':![],'defaultValue':_0x28b5('0x10')},'sendMail':{'type':Sequelize[_0x28b5('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x28b5('0x2')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0x28b5('0x11')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 77711bf..df89259 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 _0x741e=['then','destroy','get','UserProfileResource','error','stack','name','send','map','Schedule','fieldName','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type','VIRTUAL','options','count','includeAll','include','findAll','catch','show','params','create','user','role','Scheduler','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','run','../../config/schedule','html-pdf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','json','offset','limit','status','set','Content-Range','apply','reject','save'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x741e,0x11f));var _0xe741=function(_0x1f0bef,_0x349b18){_0x1f0bef=_0x1f0bef-0x0;var _0x24cc1e=_0x741e[_0x1f0bef];return _0x24cc1e;};'use strict';var pdf=require(_0xe741('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe741('0x1'));var jsonpatch=require(_0xe741('0x2'));var rp=require('request-promise');var moment=require(_0xe741('0x3'));var BPromise=require(_0xe741('0x4'));var Mustache=require(_0xe741('0x5'));var util=require(_0xe741('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe741('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe741('0x8'));var crypto=require(_0xe741('0x9'));var jsforce=require(_0xe741('0xa'));var deskjs=require(_0xe741('0xb'));var toCsv=require(_0xe741('0xc'));var querystring=require(_0xe741('0xd'));var Papa=require(_0xe741('0xe'));var Redis=require('ioredis');var authService=require(_0xe741('0xf'));var qs=require(_0xe741('0x10'));var as=require(_0xe741('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe741('0x12'))(_0xe741('0x13'));var utils=require('../../config/utils');var config=require(_0xe741('0x14'));var db=require(_0xe741('0x15'))['db'];function respondWithStatusCode(_0x26d684,_0x30485b){_0x30485b=_0x30485b||0xcc;return function(_0x13d4a2){if(_0x13d4a2){return _0x26d684[_0xe741('0x16')](_0x30485b);}return _0x26d684['status'](_0x30485b)[_0xe741('0x17')]();};}function respondWithResult(_0x101881,_0x31e14a){_0x31e14a=_0x31e14a||0xc8;return function(_0x4051cc){if(_0x4051cc){return _0x101881['status'](_0x31e14a)[_0xe741('0x18')](_0x4051cc);}};}function respondWithFilteredResult(_0x2dba21,_0x556b9a){return function(_0x39b106){if(_0x39b106){var _0x1b63dd=_0x39b106['count'],_0x479d60=_0x556b9a[_0xe741('0x19')],_0x56c1a4=_0x556b9a['offset']+_0x556b9a[_0xe741('0x1a')],_0x3d174b;if(_0x56c1a4>=_0x1b63dd){_0x56c1a4=_0x1b63dd;_0x3d174b=0xc8;}else{_0x3d174b=0xce;}_0x2dba21[_0xe741('0x1b')](_0x3d174b);return _0x2dba21[_0xe741('0x1c')](_0xe741('0x1d'),_0x479d60+'-'+_0x56c1a4+'/'+_0x1b63dd)['json'](_0x39b106);}return null;};}function patchUpdates(_0x2aae3c){return function(_0x4cb64f){try{jsonpatch[_0xe741('0x1e')](_0x4cb64f,_0x2aae3c,!![]);}catch(_0x1e9fd1){return BPromise[_0xe741('0x1f')](_0x1e9fd1);}return _0x4cb64f[_0xe741('0x20')]();};}function saveUpdates(_0x329835,_0x141364){return function(_0x125ef0){if(_0x125ef0){return _0x125ef0['update'](_0x329835)[_0xe741('0x21')](function(_0x475441){return _0x475441;});}return null;};}function removeEntity(_0x5e60cf,_0x49c196){return function(_0x3f8c6c){if(_0x3f8c6c){return _0x3f8c6c[_0xe741('0x22')]()[_0xe741('0x21')](function(){var _0x25b4db=_0x3f8c6c[_0xe741('0x23')]({'plain':!![]});var _0x384a5a='Scheduler';return db[_0xe741('0x24')][_0xe741('0x22')]({'where':{'type':_0x384a5a,'resourceId':_0x25b4db['id']}})['then'](function(){return _0x3f8c6c;});})[_0xe741('0x21')](function(){_0x5e60cf['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x391493,_0x4708f4){return function(_0x384b4){if(!_0x384b4){_0x391493['sendStatus'](0x194);}return _0x384b4;};}function handleError(_0x2eb37a,_0x233c98){_0x233c98=_0x233c98||0x1f4;return function(_0x58255f){logger[_0xe741('0x25')](_0x58255f[_0xe741('0x26')]);if(_0x58255f[_0xe741('0x27')]){delete _0x58255f[_0xe741('0x27')];}_0x2eb37a['status'](_0x233c98)[_0xe741('0x28')](_0x58255f);};}exports['index']=function(_0x5cd996,_0x19ec53){var _0x47e44b={},_0x2be1c0={},_0x30730d={'count':0x0,'rows':[]};var _0x38d27b=_[_0xe741('0x29')](db[_0xe741('0x2a')]['rawAttributes'],function(_0x28f5ba){return{'name':_0x28f5ba[_0xe741('0x2b')],'type':_0x28f5ba['type'][_0xe741('0x2c')]};});_0x2be1c0[_0xe741('0x2d')]=_[_0xe741('0x29')](_0x38d27b,_0xe741('0x27'));_0x2be1c0[_0xe741('0x2e')]=_[_0xe741('0x2f')](_0x5cd996[_0xe741('0x2e')]);_0x2be1c0[_0xe741('0x30')]=_['intersection'](_0x2be1c0[_0xe741('0x2d')],_0x2be1c0[_0xe741('0x2e')]);_0x47e44b[_0xe741('0x31')]=_['intersection'](_0x2be1c0[_0xe741('0x2d')],qs[_0xe741('0x32')](_0x5cd996[_0xe741('0x2e')][_0xe741('0x32')]));_0x47e44b[_0xe741('0x31')]=_0x47e44b['attributes'][_0xe741('0x33')]?_0x47e44b[_0xe741('0x31')]:_0x2be1c0[_0xe741('0x2d')];if(!_0x5cd996[_0xe741('0x2e')][_0xe741('0x34')](_0xe741('0x35'))){_0x47e44b['limit']=qs['limit'](_0x5cd996[_0xe741('0x2e')][_0xe741('0x1a')]);_0x47e44b[_0xe741('0x19')]=qs[_0xe741('0x19')](_0x5cd996[_0xe741('0x2e')][_0xe741('0x19')]);}_0x47e44b['order']=qs['sort'](_0x5cd996[_0xe741('0x2e')][_0xe741('0x36')]);_0x47e44b['where']=qs[_0xe741('0x30')](_[_0xe741('0x37')](_0x5cd996[_0xe741('0x2e')],_0x2be1c0[_0xe741('0x30')]));if(_0x5cd996[_0xe741('0x2e')][_0xe741('0x38')]){_0x47e44b[_0xe741('0x39')]=_[_0xe741('0x3a')](_0x47e44b[_0xe741('0x39')],{'$or':_['map'](_0x38d27b,function(_0x2f7385){if(_0x2f7385[_0xe741('0x3b')]!==_0xe741('0x3c')){var _0x207406={};_0x207406[_0x2f7385[_0xe741('0x27')]]={'$like':'%'+_0x5cd996[_0xe741('0x2e')][_0xe741('0x38')]+'%'};return _0x207406;}})});}_0x47e44b=_[_0xe741('0x3a')]({},_0x47e44b,_0x5cd996[_0xe741('0x3d')]);var _0x148a0c={'where':_0x47e44b['where']};return db['Schedule']['count'](_0x148a0c)[_0xe741('0x21')](function(_0x5bda60){_0x30730d[_0xe741('0x3e')]=_0x5bda60;if(_0x5cd996['query'][_0xe741('0x3f')]){_0x47e44b[_0xe741('0x40')]=[{'all':!![]}];}return db[_0xe741('0x2a')][_0xe741('0x41')](_0x47e44b);})[_0xe741('0x21')](function(_0x2755a0){_0x30730d['rows']=_0x2755a0;return _0x30730d;})[_0xe741('0x21')](respondWithFilteredResult(_0x19ec53,_0x47e44b))[_0xe741('0x42')](handleError(_0x19ec53,null));};exports[_0xe741('0x43')]=function(_0x19ead4,_0x44e82e){var _0x482ae8={'raw':![],'where':{'id':_0x19ead4[_0xe741('0x44')]['id']}},_0x57d970={};_0x57d970[_0xe741('0x2d')]=_[_0xe741('0x2f')](db[_0xe741('0x2a')]['rawAttributes']);_0x57d970[_0xe741('0x2e')]=_[_0xe741('0x2f')](_0x19ead4[_0xe741('0x2e')]);_0x57d970['filters']=_['intersection'](_0x57d970['model'],_0x57d970['query']);_0x482ae8[_0xe741('0x31')]=_['intersection'](_0x57d970[_0xe741('0x2d')],qs[_0xe741('0x32')](_0x19ead4[_0xe741('0x2e')]['fields']));_0x482ae8[_0xe741('0x31')]=_0x482ae8[_0xe741('0x31')][_0xe741('0x33')]?_0x482ae8[_0xe741('0x31')]:_0x57d970[_0xe741('0x2d')];if(_0x19ead4['query'][_0xe741('0x3f')]){_0x482ae8[_0xe741('0x40')]=[{'all':!![]}];}_0x482ae8=_[_0xe741('0x3a')]({},_0x482ae8,_0x19ead4['options']);return db[_0xe741('0x2a')]['find'](_0x482ae8)['then'](handleEntityNotFound(_0x44e82e,null))['then'](respondWithResult(_0x44e82e,null))[_0xe741('0x42')](handleError(_0x44e82e,null));};exports[_0xe741('0x45')]=function(_0x5d1507,_0x3c7ee1){return db['Schedule']['create'](_0x5d1507['body'],{})[_0xe741('0x21')](function(_0x4cc0a5){var _0x38c1b9=_0x5d1507[_0xe741('0x46')][_0xe741('0x23')]({'plain':!![]});if(!_0x38c1b9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x38c1b9[_0xe741('0x47')]==='user'){var _0x238829=_0x4cc0a5[_0xe741('0x23')]({'plain':!![]});var _0x590ef4=_0xe741('0x48');return db['UserProfileSection'][_0xe741('0x49')]({'where':{'name':_0x590ef4,'userProfileId':_0x38c1b9[_0xe741('0x4a')]},'raw':!![]})[_0xe741('0x21')](function(_0x273d10){if(_0x273d10&&_0x273d10['autoAssociation']===0x0){return db['UserProfileResource'][_0xe741('0x45')]({'name':_0x238829[_0xe741('0x27')],'resourceId':_0x238829['id'],'type':_0x273d10[_0xe741('0x27')],'sectionId':_0x273d10['id']},{})[_0xe741('0x21')](function(){return _0x4cc0a5;});}else{return _0x4cc0a5;}})[_0xe741('0x42')](function(_0x52b4a0){logger['error'](_0xe741('0x4b'),_0x52b4a0);throw _0x52b4a0;});}return _0x4cc0a5;})[_0xe741('0x21')](respondWithResult(_0x3c7ee1,0xc9))['catch'](handleError(_0x3c7ee1,null));};exports[_0xe741('0x4c')]=function(_0x1687a7,_0x6b8256){if(_0x1687a7[_0xe741('0x4d')]['id']){delete _0x1687a7[_0xe741('0x4d')]['id'];}return db[_0xe741('0x2a')][_0xe741('0x49')]({'where':{'id':_0x1687a7[_0xe741('0x44')]['id']}})['then'](handleEntityNotFound(_0x6b8256,null))[_0xe741('0x21')](saveUpdates(_0x1687a7['body'],null))[_0xe741('0x21')](respondWithResult(_0x6b8256,null))[_0xe741('0x42')](handleError(_0x6b8256,null));};exports[_0xe741('0x22')]=function(_0x391511,_0x283fd6){return db[_0xe741('0x2a')][_0xe741('0x49')]({'where':{'id':_0x391511[_0xe741('0x44')]['id']}})[_0xe741('0x21')](handleEntityNotFound(_0x283fd6,null))[_0xe741('0x21')](removeEntity(_0x283fd6,null))[_0xe741('0x42')](handleError(_0x283fd6,null));};exports[_0xe741('0x4e')]=function(_0x361647,_0x3354ab,_0x3dd683){var _0x3b5c9f=require(_0xe741('0x4f'));return db[_0xe741('0x2a')][_0xe741('0x49')]({'where':{'id':_0x361647[_0xe741('0x44')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x3354ab,null))['then'](function(){_0x3b5c9f[_0xe741('0x4e')](_0x361647[_0xe741('0x44')]['id']);})[_0xe741('0x21')](respondWithStatusCode(_0x3354ab,null))[_0xe741('0x42')](handleError(_0x3354ab,null));}; \ No newline at end of file +var _0x137b=['type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','rawAttributes','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Scheduler','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','run','../../config/schedule','html-pdf','eml-format','zip-dir','fast-json-patch','moment','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','count','offset','limit','status','set','Content-Range','json','apply','save','then','destroy','get','stack','name','send','index','map','Schedule','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x3e5c37,_0x53b5c6){var _0x2c5ced=function(_0x9bc7c6){while(--_0x9bc7c6){_0x3e5c37['push'](_0x3e5c37['shift']());}};_0x2c5ced(++_0x53b5c6);}(_0x137b,0x11e));var _0xb137=function(_0x3a508a,_0x358c16){_0x3a508a=_0x3a508a-0x0;var _0x5a8c34=_0x137b[_0x3a508a];return _0x5a8c34;};'use strict';var pdf=require(_0xb137('0x0'));var emlformat=require(_0xb137('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb137('0x2'));var jsonpatch=require(_0xb137('0x3'));var rp=require('request-promise');var moment=require(_0xb137('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xb137('0x5'));var sox=require(_0xb137('0x6'));var csv=require('to-csv');var ejs=require(_0xb137('0x7'));var fs=require('fs');var _=require(_0xb137('0x8'));var squel=require(_0xb137('0x9'));var crypto=require(_0xb137('0xa'));var jsforce=require(_0xb137('0xb'));var deskjs=require(_0xb137('0xc'));var toCsv=require(_0xb137('0xd'));var querystring=require(_0xb137('0xe'));var Papa=require(_0xb137('0xf'));var Redis=require(_0xb137('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb137('0x11'));var as=require(_0xb137('0x12'));var hardwareService=require(_0xb137('0x13'));var logger=require(_0xb137('0x14'))(_0xb137('0x15'));var utils=require('../../config/utils');var config=require(_0xb137('0x16'));var db=require(_0xb137('0x17'))['db'];function respondWithStatusCode(_0x377a79,_0x333e6c){_0x333e6c=_0x333e6c||0xcc;return function(_0x31c012){if(_0x31c012){return _0x377a79[_0xb137('0x18')](_0x333e6c);}return _0x377a79['status'](_0x333e6c)[_0xb137('0x19')]();};}function respondWithResult(_0x4fb505,_0x392968){_0x392968=_0x392968||0xc8;return function(_0x5dfc55){if(_0x5dfc55){return _0x4fb505['status'](_0x392968)['json'](_0x5dfc55);}};}function respondWithFilteredResult(_0x2430ab,_0x3cf139){return function(_0x584361){if(_0x584361){var _0x3da22f=_0x584361[_0xb137('0x1a')],_0x4f5688=_0x3cf139[_0xb137('0x1b')],_0x31c3fd=_0x3cf139['offset']+_0x3cf139[_0xb137('0x1c')],_0x233cf8;if(_0x31c3fd>=_0x3da22f){_0x31c3fd=_0x3da22f;_0x233cf8=0xc8;}else{_0x233cf8=0xce;}_0x2430ab[_0xb137('0x1d')](_0x233cf8);return _0x2430ab[_0xb137('0x1e')](_0xb137('0x1f'),_0x4f5688+'-'+_0x31c3fd+'/'+_0x3da22f)[_0xb137('0x20')](_0x584361);}return null;};}function patchUpdates(_0x5df044){return function(_0x50e285){try{jsonpatch[_0xb137('0x21')](_0x50e285,_0x5df044,!![]);}catch(_0x9ccd0c){return BPromise['reject'](_0x9ccd0c);}return _0x50e285[_0xb137('0x22')]();};}function saveUpdates(_0x3375f0,_0x368168){return function(_0x1e2896){if(_0x1e2896){return _0x1e2896['update'](_0x3375f0)[_0xb137('0x23')](function(_0x27bfda){return _0x27bfda;});}return null;};}function removeEntity(_0x4135b0,_0x1b6119){return function(_0x172116){if(_0x172116){return _0x172116[_0xb137('0x24')]()['then'](function(){var _0x5ef9e8=_0x172116[_0xb137('0x25')]({'plain':!![]});var _0x59f8bc='Scheduler';return db['UserProfileResource'][_0xb137('0x24')]({'where':{'type':_0x59f8bc,'resourceId':_0x5ef9e8['id']}})['then'](function(){return _0x172116;});})[_0xb137('0x23')](function(){_0x4135b0[_0xb137('0x1d')](0xcc)[_0xb137('0x19')]();});}};}function handleEntityNotFound(_0x973dfd,_0x3cd985){return function(_0x5e5fd9){if(!_0x5e5fd9){_0x973dfd[_0xb137('0x18')](0x194);}return _0x5e5fd9;};}function handleError(_0x433b75,_0x5d2e07){_0x5d2e07=_0x5d2e07||0x1f4;return function(_0x2afe38){logger['error'](_0x2afe38[_0xb137('0x26')]);if(_0x2afe38[_0xb137('0x27')]){delete _0x2afe38[_0xb137('0x27')];}_0x433b75[_0xb137('0x1d')](_0x5d2e07)[_0xb137('0x28')](_0x2afe38);};}exports[_0xb137('0x29')]=function(_0x2be97a,_0x202144){var _0xb21118={},_0x4ab60f={},_0x453b5d={'count':0x0,'rows':[]};var _0x47277a=_[_0xb137('0x2a')](db[_0xb137('0x2b')]['rawAttributes'],function(_0x5af095){return{'name':_0x5af095['fieldName'],'type':_0x5af095['type']['key']};});_0x4ab60f['model']=_[_0xb137('0x2a')](_0x47277a,'name');_0x4ab60f['query']=_[_0xb137('0x2c')](_0x2be97a[_0xb137('0x2d')]);_0x4ab60f[_0xb137('0x2e')]=_[_0xb137('0x2f')](_0x4ab60f[_0xb137('0x30')],_0x4ab60f[_0xb137('0x2d')]);_0xb21118[_0xb137('0x31')]=_[_0xb137('0x2f')](_0x4ab60f[_0xb137('0x30')],qs['fields'](_0x2be97a[_0xb137('0x2d')]['fields']));_0xb21118[_0xb137('0x31')]=_0xb21118[_0xb137('0x31')][_0xb137('0x32')]?_0xb21118['attributes']:_0x4ab60f[_0xb137('0x30')];if(!_0x2be97a[_0xb137('0x2d')][_0xb137('0x33')](_0xb137('0x34'))){_0xb21118['limit']=qs['limit'](_0x2be97a['query'][_0xb137('0x1c')]);_0xb21118[_0xb137('0x1b')]=qs['offset'](_0x2be97a[_0xb137('0x2d')][_0xb137('0x1b')]);}_0xb21118[_0xb137('0x35')]=qs[_0xb137('0x36')](_0x2be97a[_0xb137('0x2d')][_0xb137('0x36')]);_0xb21118[_0xb137('0x37')]=qs[_0xb137('0x2e')](_[_0xb137('0x38')](_0x2be97a[_0xb137('0x2d')],_0x4ab60f[_0xb137('0x2e')]));if(_0x2be97a[_0xb137('0x2d')][_0xb137('0x39')]){_0xb21118[_0xb137('0x37')]=_['merge'](_0xb21118[_0xb137('0x37')],{'$or':_[_0xb137('0x2a')](_0x47277a,function(_0x5d7ab9){if(_0x5d7ab9[_0xb137('0x3a')]!==_0xb137('0x3b')){var _0x2892d1={};_0x2892d1[_0x5d7ab9[_0xb137('0x27')]]={'$like':'%'+_0x2be97a[_0xb137('0x2d')]['filter']+'%'};return _0x2892d1;}})});}_0xb21118=_[_0xb137('0x3c')]({},_0xb21118,_0x2be97a[_0xb137('0x3d')]);var _0x3095ea={'where':_0xb21118['where']};return db[_0xb137('0x2b')][_0xb137('0x1a')](_0x3095ea)[_0xb137('0x23')](function(_0x55c7eb){_0x453b5d['count']=_0x55c7eb;if(_0x2be97a[_0xb137('0x2d')][_0xb137('0x3e')]){_0xb21118[_0xb137('0x3f')]=[{'all':!![]}];}return db[_0xb137('0x2b')][_0xb137('0x40')](_0xb21118);})[_0xb137('0x23')](function(_0x3605f6){_0x453b5d[_0xb137('0x41')]=_0x3605f6;return _0x453b5d;})['then'](respondWithFilteredResult(_0x202144,_0xb21118))[_0xb137('0x42')](handleError(_0x202144,null));};exports['show']=function(_0x3c4ce2,_0x183fd2){var _0x38c801={'raw':![],'where':{'id':_0x3c4ce2[_0xb137('0x43')]['id']}},_0x1a59f2={};_0x1a59f2['model']=_[_0xb137('0x2c')](db[_0xb137('0x2b')][_0xb137('0x44')]);_0x1a59f2[_0xb137('0x2d')]=_['keys'](_0x3c4ce2[_0xb137('0x2d')]);_0x1a59f2[_0xb137('0x2e')]=_['intersection'](_0x1a59f2[_0xb137('0x30')],_0x1a59f2[_0xb137('0x2d')]);_0x38c801['attributes']=_[_0xb137('0x2f')](_0x1a59f2[_0xb137('0x30')],qs[_0xb137('0x45')](_0x3c4ce2['query'][_0xb137('0x45')]));_0x38c801[_0xb137('0x31')]=_0x38c801[_0xb137('0x31')][_0xb137('0x32')]?_0x38c801['attributes']:_0x1a59f2[_0xb137('0x30')];if(_0x3c4ce2[_0xb137('0x2d')][_0xb137('0x3e')]){_0x38c801[_0xb137('0x3f')]=[{'all':!![]}];}_0x38c801=_[_0xb137('0x3c')]({},_0x38c801,_0x3c4ce2['options']);return db[_0xb137('0x2b')][_0xb137('0x46')](_0x38c801)[_0xb137('0x23')](handleEntityNotFound(_0x183fd2,null))['then'](respondWithResult(_0x183fd2,null))[_0xb137('0x42')](handleError(_0x183fd2,null));};exports[_0xb137('0x47')]=function(_0x3e92bb,_0x20be92){return db[_0xb137('0x2b')][_0xb137('0x47')](_0x3e92bb[_0xb137('0x48')],{})[_0xb137('0x23')](function(_0x54f06d){var _0x542869=_0x3e92bb[_0xb137('0x49')][_0xb137('0x25')]({'plain':!![]});if(!_0x542869)throw new Error(_0xb137('0x4a'));if(_0x542869[_0xb137('0x4b')]===_0xb137('0x49')){var _0x58af36=_0x54f06d[_0xb137('0x25')]({'plain':!![]});var _0x317173=_0xb137('0x4c');return db[_0xb137('0x4d')]['find']({'where':{'name':_0x317173,'userProfileId':_0x542869[_0xb137('0x4e')]},'raw':!![]})['then'](function(_0x10b879){if(_0x10b879&&_0x10b879[_0xb137('0x4f')]===0x0){return db[_0xb137('0x50')][_0xb137('0x47')]({'name':_0x58af36[_0xb137('0x27')],'resourceId':_0x58af36['id'],'type':_0x10b879[_0xb137('0x27')],'sectionId':_0x10b879['id']},{})[_0xb137('0x23')](function(){return _0x54f06d;});}else{return _0x54f06d;}})[_0xb137('0x42')](function(_0x54389e){logger[_0xb137('0x51')](_0xb137('0x52'),_0x54389e);throw _0x54389e;});}return _0x54f06d;})[_0xb137('0x23')](respondWithResult(_0x20be92,0xc9))[_0xb137('0x42')](handleError(_0x20be92,null));};exports[_0xb137('0x53')]=function(_0x386eb0,_0x2b751f){if(_0x386eb0[_0xb137('0x48')]['id']){delete _0x386eb0[_0xb137('0x48')]['id'];}return db[_0xb137('0x2b')][_0xb137('0x46')]({'where':{'id':_0x386eb0['params']['id']}})['then'](handleEntityNotFound(_0x2b751f,null))[_0xb137('0x23')](saveUpdates(_0x386eb0[_0xb137('0x48')],null))[_0xb137('0x23')](respondWithResult(_0x2b751f,null))[_0xb137('0x42')](handleError(_0x2b751f,null));};exports['destroy']=function(_0x31a2f9,_0xa5f9ac){return db[_0xb137('0x2b')]['find']({'where':{'id':_0x31a2f9[_0xb137('0x43')]['id']}})[_0xb137('0x23')](handleEntityNotFound(_0xa5f9ac,null))[_0xb137('0x23')](removeEntity(_0xa5f9ac,null))[_0xb137('0x42')](handleError(_0xa5f9ac,null));};exports[_0xb137('0x54')]=function(_0x3e17ea,_0x252dc3,_0x45deab){var _0x23e9fe=require(_0xb137('0x55'));return db[_0xb137('0x2b')][_0xb137('0x46')]({'where':{'id':_0x3e17ea[_0xb137('0x43')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x252dc3,null))['then'](function(){_0x23e9fe['run'](_0x3e17ea[_0xb137('0x43')]['id']);})[_0xb137('0x23')](respondWithStatusCode(_0x252dc3,null))[_0xb137('0x42')](handleError(_0x252dc3,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 95d76d3..cd38e93 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 _0x5f96=['../../config/environment','./schedule.attributes','exports','define','Schedule','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0xeef4f2,_0x1b88e6){var _0x8b0443=function(_0x2f3c17){while(--_0x2f3c17){_0xeef4f2['push'](_0xeef4f2['shift']());}};_0x8b0443(++_0x1b88e6);}(_0x5f96,0x1e6));var _0x65f9=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x5f96[_0x525c7b];return _0x27b33e;};'use strict';var _=require(_0x65f9('0x0'));var util=require(_0x65f9('0x1'));var logger=require(_0x65f9('0x2'))(_0x65f9('0x3'));var moment=require(_0x65f9('0x4'));var BPromise=require('bluebird');var rp=require(_0x65f9('0x5'));var fs=require('fs');var path=require(_0x65f9('0x6'));var rimraf=require(_0x65f9('0x7'));var config=require(_0x65f9('0x8'));var attributes=require(_0x65f9('0x9'));module[_0x65f9('0xa')]=function(_0x3054fe,_0x1de2cc){return _0x3054fe[_0x65f9('0xb')](_0x65f9('0xc'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xae90=['./schedule.attributes','exports','define','Schedule','tools_schedules','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xae90,0x130));var _0x0ae9=function(_0x2eeded,_0x394b42){_0x2eeded=_0x2eeded-0x0;var _0x4dd8ce=_0xae90[_0x2eeded];return _0x4dd8ce;};'use strict';var _=require(_0x0ae9('0x0'));var util=require(_0x0ae9('0x1'));var logger=require(_0x0ae9('0x2'))(_0x0ae9('0x3'));var moment=require(_0x0ae9('0x4'));var BPromise=require(_0x0ae9('0x5'));var rp=require(_0x0ae9('0x6'));var fs=require('fs');var path=require(_0x0ae9('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0ae9('0x8'));module[_0x0ae9('0x9')]=function(_0x2d84cf,_0x48f81b){return _0x2d84cf[_0x0ae9('0xa')](_0x0ae9('0xb'),attributes,{'tableName':_0x0ae9('0xc'),'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 65fe070..4a154c4 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 _0xc9ee=['info','Schedule,\x20%s,\x20%s','debug','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x25040f,_0x47473e){var _0x1aec6a=function(_0x3da43f){while(--_0x3da43f){_0x25040f['push'](_0x25040f['shift']());}};_0x1aec6a(++_0x47473e);}(_0xc9ee,0x6d));var _0xec9e=function(_0x33ebf5,_0x258ec6){_0x33ebf5=_0x33ebf5-0x0;var _0x66957b=_0xc9ee[_0x33ebf5];return _0x66957b;};'use strict';var _=require(_0xec9e('0x0'));var util=require('util');var moment=require(_0xec9e('0x1'));var BPromise=require(_0xec9e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xec9e('0x3'));var db=require(_0xec9e('0x4'))['db'];var utils=require(_0xec9e('0x5'));var logger=require('../../config/logger')(_0xec9e('0x6'));var config=require(_0xec9e('0x7'));var jayson=require(_0xec9e('0x8'));var client=jayson[_0xec9e('0x9')][_0xec9e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3905d5,_0x1d5ad8,_0x5d5591){return new BPromise(function(_0x17bf20,_0x54b140){return client['request'](_0x3905d5,_0x5d5591)['then'](function(_0x1c1592){logger[_0xec9e('0xb')](_0xec9e('0xc'),_0x1d5ad8,'request\x20sent');logger[_0xec9e('0xd')](_0xec9e('0xe'),_0x1d5ad8,_0xec9e('0xf'),JSON['stringify'](_0x1c1592));if(_0x1c1592['error']){if(_0x1c1592[_0xec9e('0x10')][_0xec9e('0x11')]===0x1f4){logger[_0xec9e('0x10')]('Schedule,\x20%s,\x20%s',_0x1d5ad8,_0x1c1592['error'][_0xec9e('0x12')]);return _0x54b140(_0x1c1592[_0xec9e('0x10')][_0xec9e('0x12')]);}logger[_0xec9e('0x10')]('Schedule,\x20%s,\x20%s',_0x1d5ad8,_0x1c1592[_0xec9e('0x10')]['message']);return _0x17bf20(_0x1c1592[_0xec9e('0x10')][_0xec9e('0x12')]);}else{logger[_0xec9e('0xb')](_0xec9e('0xc'),_0x1d5ad8,_0xec9e('0xf'));_0x17bf20(_0x1c1592[_0xec9e('0x13')][_0xec9e('0x12')]);}})['catch'](function(_0x4ad1f7){logger[_0xec9e('0x10')](_0xec9e('0xc'),_0x1d5ad8,_0x4ad1f7);_0x54b140(_0x4ad1f7);});});} \ No newline at end of file +var _0x437f=['debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','Schedule,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x5e6539,_0x20704a){var _0xd4335d=function(_0x5be89e){while(--_0x5be89e){_0x5e6539['push'](_0x5e6539['shift']());}};_0xd4335d(++_0x20704a);}(_0x437f,0x7a));var _0xf437=function(_0x3b9859,_0x52b534){_0x3b9859=_0x3b9859-0x0;var _0x3bc080=_0x437f[_0x3b9859];return _0x3bc080;};'use strict';var _=require('lodash');var util=require(_0xf437('0x0'));var moment=require(_0xf437('0x1'));var BPromise=require(_0xf437('0x2'));var rs=require(_0xf437('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf437('0x4'))['db'];var utils=require(_0xf437('0x5'));var logger=require(_0xf437('0x6'))(_0xf437('0x7'));var config=require(_0xf437('0x8'));var jayson=require(_0xf437('0x9'));var client=jayson[_0xf437('0xa')][_0xf437('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x6b16aa,_0x282a47,_0x43bc47){return new BPromise(function(_0x592c5e,_0x39927a){return client[_0xf437('0xc')](_0x6b16aa,_0x43bc47)[_0xf437('0xd')](function(_0x4a6b0a){logger[_0xf437('0xe')]('Schedule,\x20%s,\x20%s',_0x282a47,_0xf437('0xf'));logger[_0xf437('0x10')](_0xf437('0x11'),_0x282a47,_0xf437('0xf'),JSON[_0xf437('0x12')](_0x4a6b0a));if(_0x4a6b0a['error']){if(_0x4a6b0a[_0xf437('0x13')]['code']===0x1f4){logger[_0xf437('0x13')](_0xf437('0x14'),_0x282a47,_0x4a6b0a[_0xf437('0x13')]['message']);return _0x39927a(_0x4a6b0a[_0xf437('0x13')][_0xf437('0x15')]);}logger[_0xf437('0x13')](_0xf437('0x14'),_0x282a47,_0x4a6b0a[_0xf437('0x13')]['message']);return _0x592c5e(_0x4a6b0a[_0xf437('0x13')]['message']);}else{logger[_0xf437('0xe')]('Schedule,\x20%s,\x20%s',_0x282a47,'request\x20sent');_0x592c5e(_0x4a6b0a[_0xf437('0x16')][_0xf437('0x15')]);}})['catch'](function(_0xe26e38){logger['error'](_0xf437('0x14'),_0x282a47,_0xe26e38);_0x39927a(_0xe26e38);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 85c862f..8db90af 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 _0x96bd=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','./screenRecording.controller','get','index','/describe','isAuthenticated','describe','show','/:id/download','download','post','create','/:id','update','destroy','exports','path'];(function(_0x54beb0,_0x4790ae){var _0x42f017=function(_0x3a0f7a){while(--_0x3a0f7a){_0x54beb0['push'](_0x54beb0['shift']());}};_0x42f017(++_0x4790ae);}(_0x96bd,0x14f));var _0xd96b=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x96bd[_0x57b54c];return _0x59cc19;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd96b('0x0'));var timeout=require(_0xd96b('0x1'));var express=require(_0xd96b('0x2'));var router=express[_0xd96b('0x3')]();var auth=require(_0xd96b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd96b('0x5'));var controller=require(_0xd96b('0x6'));router[_0xd96b('0x7')]('/',auth['isAuthenticated'](),controller[_0xd96b('0x8')]);router[_0xd96b('0x7')](_0xd96b('0x9'),auth[_0xd96b('0xa')](),controller[_0xd96b('0xb')]);router[_0xd96b('0x7')]('/:id',auth[_0xd96b('0xa')](),controller[_0xd96b('0xc')]);router[_0xd96b('0x7')](_0xd96b('0xd'),auth[_0xd96b('0xa')](),controller[_0xd96b('0xe')]);router[_0xd96b('0xf')]('/',auth['isAuthenticated'](),controller[_0xd96b('0x10')]);router['put'](_0xd96b('0x11'),auth[_0xd96b('0xa')](),controller[_0xd96b('0x12')]);router['delete']('/:id',auth[_0xd96b('0xa')](),controller[_0xd96b('0x13')]);module[_0xd96b('0x14')]=router; \ No newline at end of file +var _0xec6e=['put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id/download','download'];(function(_0x562f3b,_0x4c65ae){var _0x1edd55=function(_0xe67e06){while(--_0xe67e06){_0x562f3b['push'](_0x562f3b['shift']());}};_0x1edd55(++_0x4c65ae);}(_0xec6e,0xd8));var _0xeec6=function(_0x1daaa9,_0x220393){_0x1daaa9=_0x1daaa9-0x0;var _0x1dd221=_0xec6e[_0x1daaa9];return _0x1dd221;};'use strict';var multer=require(_0xeec6('0x0'));var util=require(_0xeec6('0x1'));var path=require(_0xeec6('0x2'));var timeout=require(_0xeec6('0x3'));var express=require(_0xeec6('0x4'));var router=express[_0xeec6('0x5')]();var auth=require(_0xeec6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xeec6('0x7'));var controller=require('./screenRecording.controller');router[_0xeec6('0x8')]('/',auth[_0xeec6('0x9')](),controller[_0xeec6('0xa')]);router['get'](_0xeec6('0xb'),auth[_0xeec6('0x9')](),controller[_0xeec6('0xc')]);router[_0xeec6('0x8')]('/:id',auth[_0xeec6('0x9')](),controller['show']);router[_0xeec6('0x8')](_0xeec6('0xd'),auth[_0xeec6('0x9')](),controller[_0xeec6('0xe')]);router['post']('/',auth[_0xeec6('0x9')](),controller['create']);router[_0xeec6('0xf')](_0xeec6('0x10'),auth[_0xeec6('0x9')](),controller[_0xeec6('0x11')]);router[_0xeec6('0x12')]('/:id',auth[_0xeec6('0x9')](),controller[_0xeec6('0x13')]);module[_0xeec6('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 6da281f..2e7f6cc 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 _0x0e85=['../../config/environment','exports','extname','value','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','getDataValue','createdAt','toString','updatedAt','sequelize','moment'];(function(_0x3252aa,_0x5c76a4){var _0x24c7b1=function(_0x28a15f){while(--_0x28a15f){_0x3252aa['push'](_0x3252aa['shift']());}};_0x24c7b1(++_0x5c76a4);}(_0x0e85,0x7c));var _0x50e8=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x0e85[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0x50e8('0x0'));var moment=require(_0x50e8('0x1'));var path=require('path');var config=require(_0x50e8('0x2'));module[_0x50e8('0x3')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue']('value')?path[_0x50e8('0x4')](this['getDataValue'](_0x50e8('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0x50e8('0x6')]},'channel':{'type':Sequelize[_0x50e8('0x6')]},'value':{'type':Sequelize[_0x50e8('0x6')],'set':function(_0x5e8b01){var _0x3ce904=_0x5e8b01[_0x50e8('0x7')](/\\/g,'/');this[_0x50e8('0x8')](_0x50e8('0x5'),_0x3ce904);}},'rating':{'type':Sequelize[_0x50e8('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x50e8('0x9')],'set':function(_0x5825f5){this[_0x50e8('0x8')](_0x50e8('0xa'),moment()[_0x50e8('0xb')](_0x5825f5,'ms'));this[_0x50e8('0x8')](_0x50e8('0xc'),moment());this[_0x50e8('0x8')](_0x50e8('0xd'),_0x5825f5);}},'startedAt':{'type':Sequelize[_0x50e8('0xe')],'get':function(){return moment(this['getDataValue']('startedAt'))[_0x50e8('0xf')](_0x50e8('0x10'))['toString']();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x50e8('0x11')](_0x50e8('0xc')))[_0x50e8('0xf')](_0x50e8('0x10'))['toString']();}},'createdAt':{'type':Sequelize[_0x50e8('0xe')],'get':function(){return moment(this[_0x50e8('0x11')](_0x50e8('0x12')))['format']('MM-DD-YYYY\x20HH:mm')[_0x50e8('0x13')]();}},'updatedAt':{'type':Sequelize[_0x50e8('0xe')],'get':function(){return moment(this[_0x50e8('0x11')](_0x50e8('0x14')))[_0x50e8('0xf')](_0x50e8('0x10'))['toString']();}}}; \ No newline at end of file +var _0x207c=['createdAt','updatedAt','moment','path','../../config/environment','exports','VIRTUAL','getDataValue','value','STRING','setDataValue','INTEGER','startedAt','subtract','closedAt','format','MM-DD-YYYY\x20HH:mm','DATE'];(function(_0x53b522,_0x20751e){var _0x548d58=function(_0x18c16b){while(--_0x18c16b){_0x53b522['push'](_0x53b522['shift']());}};_0x548d58(++_0x20751e);}(_0x207c,0x1e8));var _0xc207=function(_0x445101,_0x2414bf){_0x445101=_0x445101-0x0;var _0x3c3d04=_0x207c[_0x445101];return _0x3c3d04;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xc207('0x0'));var path=require(_0xc207('0x1'));var config=require(_0xc207('0x2'));module[_0xc207('0x3')]={'format':{'type':Sequelize[_0xc207('0x4')],'get':function(){return this[_0xc207('0x5')](_0xc207('0x6'))?path['extname'](this[_0xc207('0x5')]('value')):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0xc207('0x7')],'set':function(_0x314561){var _0x3395e4=_0x314561['replace'](/\\/g,'/');this[_0xc207('0x8')](_0xc207('0x6'),_0x3395e4);}},'rating':{'type':Sequelize[_0xc207('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0xffae6c){this[_0xc207('0x8')](_0xc207('0xa'),moment()[_0xc207('0xb')](_0xffae6c,'ms'));this[_0xc207('0x8')](_0xc207('0xc'),moment());this['setDataValue']('duration',_0xffae6c);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xc207('0x5')]('startedAt'))[_0xc207('0xd')](_0xc207('0xe'))['toString']();}},'closedAt':{'type':Sequelize[_0xc207('0xf')],'get':function(){return moment(this[_0xc207('0x5')](_0xc207('0xc')))[_0xc207('0xd')](_0xc207('0xe'))['toString']();}},'createdAt':{'type':Sequelize[_0xc207('0xf')],'get':function(){return moment(this[_0xc207('0x5')](_0xc207('0x10')))[_0xc207('0xd')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xc207('0x5')](_0xc207('0x11')))[_0xc207('0xd')](_0xc207('0xe'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index c88ff20..3cb6897 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 _0x10e9=['VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','duration','createdAt','closedAt','value','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','ValidationError','filename','extname','unlink','message','ScreenRecording\x20not\x20found','Not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','util','path','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','json','count','offset','limit','apply','update','then','destroy','error','stack','name','send','ScreenRecording','fieldName','type','key','model','map','format','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','filters','merge'];(function(_0x18e84d,_0x400654){var _0x154f7c=function(_0xbb4ecb){while(--_0xbb4ecb){_0x18e84d['push'](_0x18e84d['shift']());}};_0x154f7c(++_0x400654);}(_0x10e9,0x1a1));var _0x910e=function(_0x123450,_0x491c01){_0x123450=_0x123450-0x0;var _0x23b29d=_0x10e9[_0x123450];return _0x23b29d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x910e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x910e('0x1'));var path=require(_0x910e('0x2'));var sox=require('sox');var csv=require(_0x910e('0x3'));var ejs=require(_0x910e('0x4'));var fs=require('fs');var _=require(_0x910e('0x5'));var squel=require('squel');var crypto=require(_0x910e('0x6'));var jsforce=require(_0x910e('0x7'));var deskjs=require('desk.js');var toCsv=require(_0x910e('0x3'));var querystring=require(_0x910e('0x8'));var Papa=require(_0x910e('0x9'));var Redis=require(_0x910e('0xa'));var authService=require(_0x910e('0xb'));var qs=require('../../components/parsers/qs');var as=require(_0x910e('0xc'));var hardwareService=require(_0x910e('0xd'));var logger=require(_0x910e('0xe'))(_0x910e('0xf'));var utils=require(_0x910e('0x10'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x132e50,_0xbc512c){_0xbc512c=_0xbc512c||0xcc;return function(_0x5ef0cd){if(_0x5ef0cd){return _0x132e50['sendStatus'](_0xbc512c);}return _0x132e50[_0x910e('0x11')](_0xbc512c)[_0x910e('0x12')]();};}function respondWithResult(_0x23d09e,_0x148a29){_0x148a29=_0x148a29||0xc8;return function(_0x140031){if(_0x140031){return _0x23d09e[_0x910e('0x11')](_0x148a29)[_0x910e('0x13')](_0x140031);}};}function respondWithFilteredResult(_0x53b880,_0x4a76c2){return function(_0x10f71e){if(_0x10f71e){var _0x398d94=_0x10f71e[_0x910e('0x14')],_0x3810ec=_0x4a76c2[_0x910e('0x15')],_0x4e7292=_0x4a76c2['offset']+_0x4a76c2[_0x910e('0x16')],_0x1686b9;if(_0x4e7292>=_0x398d94){_0x4e7292=_0x398d94;_0x1686b9=0xc8;}else{_0x1686b9=0xce;}_0x53b880[_0x910e('0x11')](_0x1686b9);return _0x53b880['set']('Content-Range',_0x3810ec+'-'+_0x4e7292+'/'+_0x398d94)[_0x910e('0x13')](_0x10f71e);}return null;};}function patchUpdates(_0x1a0471){return function(_0x43ccf5){try{jsonpatch[_0x910e('0x17')](_0x43ccf5,_0x1a0471,!![]);}catch(_0x1e3ab1){return BPromise['reject'](_0x1e3ab1);}return _0x43ccf5['save']();};}function saveUpdates(_0xf9d295,_0x4693ca){return function(_0xe6de7a){if(_0xe6de7a){return _0xe6de7a[_0x910e('0x18')](_0xf9d295)[_0x910e('0x19')](function(_0xb57796){return _0xb57796;});}return null;};}function removeEntity(_0x257baa,_0x21f958){return function(_0x2d2035){if(_0x2d2035){return _0x2d2035[_0x910e('0x1a')]()['then'](function(){_0x257baa[_0x910e('0x11')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1023fa,_0x2c9764){return function(_0x19975e){if(!_0x19975e){_0x1023fa['sendStatus'](0x194);}return _0x19975e;};}function handleError(_0x49a515,_0x262da8){_0x262da8=_0x262da8||0x1f4;return function(_0x1e66f7){logger[_0x910e('0x1b')](_0x1e66f7[_0x910e('0x1c')]);if(_0x1e66f7[_0x910e('0x1d')]){delete _0x1e66f7[_0x910e('0x1d')];}_0x49a515[_0x910e('0x11')](_0x262da8)[_0x910e('0x1e')](_0x1e66f7);};}exports['index']=function(_0x1e00d3,_0x4ab4d2){var _0x27078d={},_0x1e7ec8={},_0x2e2914={'count':0x0,'rows':[]};var _0x3d82cb=_['map'](db[_0x910e('0x1f')]['rawAttributes'],function(_0x44d9e9){return{'name':_0x44d9e9[_0x910e('0x20')],'type':_0x44d9e9[_0x910e('0x21')][_0x910e('0x22')]};});_0x1e7ec8[_0x910e('0x23')]=_['differenceBy'](_[_0x910e('0x24')](_0x3d82cb,_0x910e('0x1d')),[_0x910e('0x25')]);_0x1e7ec8['query']=_['keys'](_0x1e00d3[_0x910e('0x26')]);_0x1e7ec8['filters']=_[_0x910e('0x27')](_0x1e7ec8['model'],_0x1e7ec8[_0x910e('0x26')]);_0x27078d[_0x910e('0x28')]=_[_0x910e('0x27')](_0x1e7ec8['model'],qs[_0x910e('0x29')](_0x1e00d3[_0x910e('0x26')][_0x910e('0x29')]));_0x27078d[_0x910e('0x28')]=_0x27078d[_0x910e('0x28')]['length']?_0x27078d[_0x910e('0x28')]:_0x1e7ec8[_0x910e('0x23')];if(!_0x1e00d3[_0x910e('0x26')][_0x910e('0x2a')](_0x910e('0x2b'))){_0x27078d['limit']=qs[_0x910e('0x16')](_0x1e00d3[_0x910e('0x26')][_0x910e('0x16')]);_0x27078d[_0x910e('0x15')]=qs[_0x910e('0x15')](_0x1e00d3[_0x910e('0x26')][_0x910e('0x15')]);}_0x27078d[_0x910e('0x2c')]=qs['sort'](_0x1e00d3[_0x910e('0x26')]['sort']);_0x27078d[_0x910e('0x2d')]=qs['filters'](_['pick'](_0x1e00d3[_0x910e('0x26')],_0x1e7ec8[_0x910e('0x2e')]));if(_0x1e00d3['query']['filter']){_0x27078d['where']=_[_0x910e('0x2f')](_0x27078d['where'],{'$or':_[_0x910e('0x24')](_0x3d82cb,function(_0x2f9c6f){if(_0x2f9c6f[_0x910e('0x21')]!==_0x910e('0x30')){var _0x5b8bc8={};_0x5b8bc8[_0x2f9c6f[_0x910e('0x1d')]]={'$like':'%'+_0x1e00d3[_0x910e('0x26')]['filter']+'%'};return _0x5b8bc8;}})});}_0x27078d=_[_0x910e('0x2f')]({},_0x27078d,_0x1e00d3[_0x910e('0x31')]);var _0x1e14f6={'where':_0x27078d[_0x910e('0x2d')]};return db[_0x910e('0x1f')]['count'](_0x1e14f6)[_0x910e('0x19')](function(_0x179bd8){_0x2e2914[_0x910e('0x14')]=_0x179bd8;if(_0x1e00d3[_0x910e('0x26')][_0x910e('0x32')]){_0x27078d[_0x910e('0x33')]=[{'all':!![]}];}return db[_0x910e('0x1f')][_0x910e('0x34')](_0x27078d);})[_0x910e('0x19')](function(_0x25fb76){_0x2e2914[_0x910e('0x35')]=_0x25fb76;return _0x2e2914;})['then'](respondWithFilteredResult(_0x4ab4d2,_0x27078d))[_0x910e('0x36')](handleError(_0x4ab4d2,null));};exports[_0x910e('0x37')]=function(_0x1501f2,_0x3abdd7){var _0x5876a={'raw':![],'where':{'id':_0x1501f2[_0x910e('0x38')]['id']}},_0x15f4cf={};_0x15f4cf[_0x910e('0x23')]=_[_0x910e('0x39')](db[_0x910e('0x1f')][_0x910e('0x3a')]);_0x15f4cf[_0x910e('0x26')]=_[_0x910e('0x39')](_0x1501f2['query']);_0x15f4cf[_0x910e('0x2e')]=_[_0x910e('0x27')](_0x15f4cf[_0x910e('0x23')],_0x15f4cf[_0x910e('0x26')]);_0x5876a[_0x910e('0x28')]=_['intersection'](_0x15f4cf[_0x910e('0x23')],qs[_0x910e('0x29')](_0x1501f2[_0x910e('0x26')]['fields']));_0x5876a[_0x910e('0x28')]=_0x5876a[_0x910e('0x28')]['length']?_0x5876a[_0x910e('0x28')]:_0x15f4cf[_0x910e('0x23')];if(_0x1501f2[_0x910e('0x26')]['includeAll']){_0x5876a[_0x910e('0x33')]=[{'all':!![]}];}_0x5876a=_[_0x910e('0x2f')]({},_0x5876a,_0x1501f2[_0x910e('0x31')]);return db[_0x910e('0x1f')][_0x910e('0x3b')](_0x5876a)['then'](handleEntityNotFound(_0x3abdd7,null))['then'](respondWithResult(_0x3abdd7,null))[_0x910e('0x36')](handleError(_0x3abdd7,null));};exports['create']=function(_0x369006,_0x5d944c){return db[_0x910e('0x1f')][_0x910e('0x3c')](_0x369006['body'],{})[_0x910e('0x19')](respondWithResult(_0x5d944c,0xc9))[_0x910e('0x36')](handleError(_0x5d944c,null));};exports[_0x910e('0x18')]=function(_0x36fd61,_0x51f031){if(_0x36fd61[_0x910e('0x3d')]['id']){delete _0x36fd61[_0x910e('0x3d')]['id'];}delete _0x36fd61[_0x910e('0x3d')][_0x910e('0x3e')];delete _0x36fd61[_0x910e('0x3d')][_0x910e('0x3f')];delete _0x36fd61[_0x910e('0x3d')][_0x910e('0x40')];delete _0x36fd61[_0x910e('0x3d')][_0x910e('0x41')];return db['ScreenRecording'][_0x910e('0x3b')]({'where':{'id':_0x36fd61[_0x910e('0x38')]['id']}})[_0x910e('0x19')](handleEntityNotFound(_0x51f031,null))[_0x910e('0x19')](saveUpdates(_0x36fd61['body'],null))['then'](respondWithResult(_0x51f031,null))['catch'](handleError(_0x51f031,null));};exports[_0x910e('0x42')]=function(_0x466e6b,_0x416406){return db[_0x910e('0x1f')][_0x910e('0x42')]()[_0x910e('0x19')](respondWithResult(_0x416406,null))['catch'](handleError(_0x416406,null));};exports[_0x910e('0x43')]=function(_0x4281dd,_0x32faea,_0x2863ce){var _0x1287d8=require(_0x910e('0x44'));var _0x52fcf0=![];var _0xdf5379={};if(_0x4281dd[_0x910e('0x26')]['type']&&_0x4281dd[_0x910e('0x26')][_0x910e('0x21')]===_0x910e('0x45')){_0xdf5379[_0x910e('0x45')]=_0x4281dd[_0x910e('0x38')]['id'];}else{_0xdf5379['id']=_0x4281dd[_0x910e('0x38')]['id'];}return db[_0x910e('0x1f')]['find']({'where':_0xdf5379,'attributes':['id',_0x910e('0x41')],'raw':!![]})['then'](handleEntityNotFound(_0x32faea,null))[_0x910e('0x19')](function(_0x9da14a){if(_0x9da14a){var _0x275617=path[_0x910e('0x46')](config[_0x910e('0x47')],_0x910e('0x48'),_0x9da14a[_0x910e('0x41')]);var _0x21f508=util[_0x910e('0x25')](_0x910e('0x49'),_0x275617);if(fs[_0x910e('0x4a')](_0x21f508)){_0x52fcf0=!![];return _0x1287d8[_0x910e('0x4b')](_0x21f508,_0x275617,config[_0x910e('0x4c')][_0x910e('0x4d')])[_0x910e('0x19')](function(){return _0x9da14a;});}return _0x9da14a;}})[_0x910e('0x19')](function(_0xa7a3c4){if(_0xa7a3c4){var _0x245cc2=path[_0x910e('0x46')](config['root'],'server/files/screen_recordings',_0xa7a3c4[_0x910e('0x41')]);if(!fs[_0x910e('0x4a')](_0x245cc2)){throw new db['Sequelize'][(_0x910e('0x4e'))]('ScreenRecording\x20not\x20found');}if(_0xa7a3c4['filename']){return _0x32faea[_0x910e('0x43')](_0x245cc2,_0xa7a3c4[_0x910e('0x4f')]+path[_0x910e('0x50')](_0x245cc2),function(){if(_0x52fcf0){fs[_0x910e('0x51')](_0x245cc2);}});}else{return _0x32faea['download'](_0x245cc2,function(_0x85204e){if(_0x52fcf0){fs[_0x910e('0x51')](_0x245cc2);}});}}})[_0x910e('0x36')](function(_0x40edb4){if(_0x40edb4[_0x910e('0x52')]===_0x910e('0x53')){_0x32faea['status'](0x194)[_0x910e('0x1e')](_0x910e('0x54'));}else{return handleError(_0x32faea,null);}});};exports[_0x910e('0x1a')]=function(_0x5e79cf,_0x2bdb12){return db['ScreenRecording'][_0x910e('0x3b')]({'where':{'id':_0x5e79cf[_0x910e('0x38')]['id']}})[_0x910e('0x19')](function(_0x263dea){if(!_0x263dea)throw new ReferenceError(_0x910e('0x55'));return _0x263dea;})['then'](function(_0x574df7){var _0x320808=path['join'](config[_0x910e('0x47')],'server/files/screen_recordings',_0x574df7[_0x910e('0x41')]);logger[_0x910e('0x56')](_0x910e('0x57'),_0x320808);if(!_[_0x910e('0x58')](_0x574df7[_0x910e('0x41')])&&fs[_0x910e('0x4a')](_0x320808)){logger[_0x910e('0x56')](_0x910e('0x59')+_0x320808+_0x910e('0x5a'));fs[_0x910e('0x5b')](_0x320808);}_0x320808=_0x320808+_0x910e('0x5c');if(!_[_0x910e('0x58')](_0x574df7[_0x910e('0x41')])&&fs[_0x910e('0x4a')](_0x320808)){logger[_0x910e('0x56')]('File:\x20\x22'+_0x320808+_0x910e('0x5a'));fs[_0x910e('0x5b')](_0x320808);}return _0x574df7;})[_0x910e('0x19')](function(_0x4f991c){if(!_0x4f991c)throw new InternalError();return _0x4f991c[_0x910e('0x1a')]();})['then'](function(){_0x2bdb12[_0x910e('0x11')](0xcc)[_0x910e('0x12')]();})[_0x910e('0x36')](function(_0x44ac77){var _0x5c4c2d=0x1f4;if(e instanceof ReferenceError){_0x5c4c2d=0x194;}else if(e instanceof InternalError){_0x5c4c2d=0x1f4;}logger['error'](_0x44ac77[_0x910e('0x1c')]);if(_0x44ac77['name']){delete _0x44ac77['name'];}_0x2bdb12[_0x910e('0x11')](_0x5c4c2d)[_0x910e('0x1e')](_0x44ac77);});}; \ No newline at end of file +var _0xcc2b=['isNil','stack','html-pdf','rimraf','zip-dir','request-promise','bluebird','mustache','util','to-csv','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','status','end','json','count','offset','limit','Content-Range','reject','save','update','destroy','then','sendStatus','error','name','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','rows','catch','find','body','duration','createdAt','value','params','describe','download','../../components/encryptor','uniqueid','join','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','filename','extname','unlink','ScreenRecording\x20not\x20found','send','Entity\x20not\x20found','root','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher'];(function(_0x333449,_0x5b996b){var _0xc8441e=function(_0xcac84d){while(--_0xcac84d){_0x333449['push'](_0x333449['shift']());}};_0xc8441e(++_0x5b996b);}(_0xcc2b,0xc0));var _0xbcc2=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xcc2b[_0x3511d3];return _0x5d6321;};'use strict';var pdf=require(_0xbcc2('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbcc2('0x1'));var zipdir=require(_0xbcc2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbcc2('0x3'));var moment=require('moment');var BPromise=require(_0xbcc2('0x4'));var Mustache=require(_0xbcc2('0x5'));var util=require(_0xbcc2('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xbcc2('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xbcc2('0x8'));var crypto=require('crypto');var jsforce=require(_0xbcc2('0x9'));var deskjs=require(_0xbcc2('0xa'));var toCsv=require('to-csv');var querystring=require(_0xbcc2('0xb'));var Papa=require(_0xbcc2('0xc'));var Redis=require(_0xbcc2('0xd'));var authService=require(_0xbcc2('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xbcc2('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbcc2('0x10'))('api');var utils=require(_0xbcc2('0x11'));var config=require(_0xbcc2('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf86e,_0x24abd5){_0x24abd5=_0x24abd5||0xcc;return function(_0x1f10e1){if(_0x1f10e1){return _0xf86e['sendStatus'](_0x24abd5);}return _0xf86e[_0xbcc2('0x13')](_0x24abd5)[_0xbcc2('0x14')]();};}function respondWithResult(_0x1c2fd0,_0x2c25b3){_0x2c25b3=_0x2c25b3||0xc8;return function(_0x2ccf37){if(_0x2ccf37){return _0x1c2fd0[_0xbcc2('0x13')](_0x2c25b3)[_0xbcc2('0x15')](_0x2ccf37);}};}function respondWithFilteredResult(_0x3b36f7,_0x1e850e){return function(_0x4ee399){if(_0x4ee399){var _0x32aac5=_0x4ee399[_0xbcc2('0x16')],_0x33ebad=_0x1e850e[_0xbcc2('0x17')],_0x2e78f3=_0x1e850e['offset']+_0x1e850e[_0xbcc2('0x18')],_0x57a2e0;if(_0x2e78f3>=_0x32aac5){_0x2e78f3=_0x32aac5;_0x57a2e0=0xc8;}else{_0x57a2e0=0xce;}_0x3b36f7['status'](_0x57a2e0);return _0x3b36f7['set'](_0xbcc2('0x19'),_0x33ebad+'-'+_0x2e78f3+'/'+_0x32aac5)[_0xbcc2('0x15')](_0x4ee399);}return null;};}function patchUpdates(_0x57661f){return function(_0x38f295){try{jsonpatch['apply'](_0x38f295,_0x57661f,!![]);}catch(_0x55d9e0){return BPromise[_0xbcc2('0x1a')](_0x55d9e0);}return _0x38f295[_0xbcc2('0x1b')]();};}function saveUpdates(_0x3af515,_0x41a8a0){return function(_0x1e2167){if(_0x1e2167){return _0x1e2167[_0xbcc2('0x1c')](_0x3af515)['then'](function(_0x5898c2){return _0x5898c2;});}return null;};}function removeEntity(_0x3dd36d,_0x32fd12){return function(_0x3cc89f){if(_0x3cc89f){return _0x3cc89f[_0xbcc2('0x1d')]()[_0xbcc2('0x1e')](function(){_0x3dd36d[_0xbcc2('0x13')](0xcc)[_0xbcc2('0x14')]();});}};}function handleEntityNotFound(_0x1f884c,_0x16cb72){return function(_0x2c6167){if(!_0x2c6167){_0x1f884c[_0xbcc2('0x1f')](0x194);}return _0x2c6167;};}function handleError(_0x15cc0e,_0x4e5dda){_0x4e5dda=_0x4e5dda||0x1f4;return function(_0x2ab66c){logger[_0xbcc2('0x20')](_0x2ab66c['stack']);if(_0x2ab66c[_0xbcc2('0x21')]){delete _0x2ab66c[_0xbcc2('0x21')];}_0x15cc0e[_0xbcc2('0x13')](_0x4e5dda)['send'](_0x2ab66c);};}exports[_0xbcc2('0x22')]=function(_0xaae2f3,_0x13445f){var _0x339c8e={},_0x384ee0={},_0x5e57e0={'count':0x0,'rows':[]};var _0x2c2482=_[_0xbcc2('0x23')](db[_0xbcc2('0x24')][_0xbcc2('0x25')],function(_0x1240fc){return{'name':_0x1240fc[_0xbcc2('0x26')],'type':_0x1240fc[_0xbcc2('0x27')][_0xbcc2('0x28')]};});_0x384ee0[_0xbcc2('0x29')]=_[_0xbcc2('0x2a')](_[_0xbcc2('0x23')](_0x2c2482,_0xbcc2('0x21')),['format']);_0x384ee0[_0xbcc2('0x2b')]=_[_0xbcc2('0x2c')](_0xaae2f3[_0xbcc2('0x2b')]);_0x384ee0[_0xbcc2('0x2d')]=_['intersection'](_0x384ee0[_0xbcc2('0x29')],_0x384ee0[_0xbcc2('0x2b')]);_0x339c8e[_0xbcc2('0x2e')]=_[_0xbcc2('0x2f')](_0x384ee0[_0xbcc2('0x29')],qs['fields'](_0xaae2f3[_0xbcc2('0x2b')][_0xbcc2('0x30')]));_0x339c8e['attributes']=_0x339c8e[_0xbcc2('0x2e')][_0xbcc2('0x31')]?_0x339c8e[_0xbcc2('0x2e')]:_0x384ee0[_0xbcc2('0x29')];if(!_0xaae2f3[_0xbcc2('0x2b')][_0xbcc2('0x32')](_0xbcc2('0x33'))){_0x339c8e[_0xbcc2('0x18')]=qs['limit'](_0xaae2f3['query'][_0xbcc2('0x18')]);_0x339c8e[_0xbcc2('0x17')]=qs[_0xbcc2('0x17')](_0xaae2f3[_0xbcc2('0x2b')][_0xbcc2('0x17')]);}_0x339c8e['order']=qs[_0xbcc2('0x34')](_0xaae2f3[_0xbcc2('0x2b')]['sort']);_0x339c8e[_0xbcc2('0x35')]=qs[_0xbcc2('0x2d')](_[_0xbcc2('0x36')](_0xaae2f3['query'],_0x384ee0[_0xbcc2('0x2d')]));if(_0xaae2f3[_0xbcc2('0x2b')]['filter']){_0x339c8e[_0xbcc2('0x35')]=_[_0xbcc2('0x37')](_0x339c8e[_0xbcc2('0x35')],{'$or':_[_0xbcc2('0x23')](_0x2c2482,function(_0x237690){if(_0x237690[_0xbcc2('0x27')]!==_0xbcc2('0x38')){var _0x5a647f={};_0x5a647f[_0x237690[_0xbcc2('0x21')]]={'$like':'%'+_0xaae2f3[_0xbcc2('0x2b')][_0xbcc2('0x39')]+'%'};return _0x5a647f;}})});}_0x339c8e=_[_0xbcc2('0x37')]({},_0x339c8e,_0xaae2f3[_0xbcc2('0x3a')]);var _0x1ced51={'where':_0x339c8e[_0xbcc2('0x35')]};return db[_0xbcc2('0x24')][_0xbcc2('0x16')](_0x1ced51)[_0xbcc2('0x1e')](function(_0x22d9cd){_0x5e57e0[_0xbcc2('0x16')]=_0x22d9cd;if(_0xaae2f3[_0xbcc2('0x2b')][_0xbcc2('0x3b')]){_0x339c8e['include']=[{'all':!![]}];}return db[_0xbcc2('0x24')]['findAll'](_0x339c8e);})[_0xbcc2('0x1e')](function(_0x3a8b61){_0x5e57e0[_0xbcc2('0x3c')]=_0x3a8b61;return _0x5e57e0;})['then'](respondWithFilteredResult(_0x13445f,_0x339c8e))[_0xbcc2('0x3d')](handleError(_0x13445f,null));};exports['show']=function(_0x13eb40,_0x6a2c20){var _0x78916c={'raw':![],'where':{'id':_0x13eb40['params']['id']}},_0x1f2853={};_0x1f2853[_0xbcc2('0x29')]=_[_0xbcc2('0x2c')](db[_0xbcc2('0x24')][_0xbcc2('0x25')]);_0x1f2853['query']=_[_0xbcc2('0x2c')](_0x13eb40['query']);_0x1f2853[_0xbcc2('0x2d')]=_[_0xbcc2('0x2f')](_0x1f2853['model'],_0x1f2853[_0xbcc2('0x2b')]);_0x78916c[_0xbcc2('0x2e')]=_['intersection'](_0x1f2853[_0xbcc2('0x29')],qs['fields'](_0x13eb40[_0xbcc2('0x2b')][_0xbcc2('0x30')]));_0x78916c[_0xbcc2('0x2e')]=_0x78916c[_0xbcc2('0x2e')]['length']?_0x78916c['attributes']:_0x1f2853[_0xbcc2('0x29')];if(_0x13eb40[_0xbcc2('0x2b')][_0xbcc2('0x3b')]){_0x78916c['include']=[{'all':!![]}];}_0x78916c=_[_0xbcc2('0x37')]({},_0x78916c,_0x13eb40[_0xbcc2('0x3a')]);return db[_0xbcc2('0x24')][_0xbcc2('0x3e')](_0x78916c)['then'](handleEntityNotFound(_0x6a2c20,null))[_0xbcc2('0x1e')](respondWithResult(_0x6a2c20,null))[_0xbcc2('0x3d')](handleError(_0x6a2c20,null));};exports['create']=function(_0x1aa31f,_0xe5535d){return db['ScreenRecording']['create'](_0x1aa31f[_0xbcc2('0x3f')],{})['then'](respondWithResult(_0xe5535d,0xc9))[_0xbcc2('0x3d')](handleError(_0xe5535d,null));};exports['update']=function(_0x2eca54,_0x5eb68e){if(_0x2eca54[_0xbcc2('0x3f')]['id']){delete _0x2eca54['body']['id'];}delete _0x2eca54['body'][_0xbcc2('0x40')];delete _0x2eca54[_0xbcc2('0x3f')][_0xbcc2('0x41')];delete _0x2eca54['body']['closedAt'];delete _0x2eca54['body'][_0xbcc2('0x42')];return db[_0xbcc2('0x24')]['find']({'where':{'id':_0x2eca54[_0xbcc2('0x43')]['id']}})[_0xbcc2('0x1e')](handleEntityNotFound(_0x5eb68e,null))[_0xbcc2('0x1e')](saveUpdates(_0x2eca54[_0xbcc2('0x3f')],null))[_0xbcc2('0x1e')](respondWithResult(_0x5eb68e,null))[_0xbcc2('0x3d')](handleError(_0x5eb68e,null));};exports[_0xbcc2('0x44')]=function(_0x1437c3,_0x2170ab){return db[_0xbcc2('0x24')]['describe']()[_0xbcc2('0x1e')](respondWithResult(_0x2170ab,null))[_0xbcc2('0x3d')](handleError(_0x2170ab,null));};exports[_0xbcc2('0x45')]=function(_0x176014,_0x571811,_0x2cccc9){var _0x26900c=require(_0xbcc2('0x46'));var _0x57749a=![];var _0x48cb9c={};if(_0x176014['query'][_0xbcc2('0x27')]&&_0x176014[_0xbcc2('0x2b')]['type']===_0xbcc2('0x47')){_0x48cb9c[_0xbcc2('0x47')]=_0x176014[_0xbcc2('0x43')]['id'];}else{_0x48cb9c['id']=_0x176014['params']['id'];}return db[_0xbcc2('0x24')]['find']({'where':_0x48cb9c,'attributes':['id','value'],'raw':!![]})[_0xbcc2('0x1e')](handleEntityNotFound(_0x571811,null))[_0xbcc2('0x1e')](function(_0x414ab3){if(_0x414ab3){var _0x84f9d9=path[_0xbcc2('0x48')](config['root'],_0xbcc2('0x49'),_0x414ab3[_0xbcc2('0x42')]);var _0x3f845c=util['format'](_0xbcc2('0x4a'),_0x84f9d9);if(fs[_0xbcc2('0x4b')](_0x3f845c)){_0x57749a=!![];return _0x26900c[_0xbcc2('0x4c')](_0x3f845c,_0x84f9d9,config[_0xbcc2('0x4d')][_0xbcc2('0x4e')])[_0xbcc2('0x1e')](function(){return _0x414ab3;});}return _0x414ab3;}})[_0xbcc2('0x1e')](function(_0x8b169f){if(_0x8b169f){var _0x566069=path[_0xbcc2('0x48')](config['root'],_0xbcc2('0x49'),_0x8b169f[_0xbcc2('0x42')]);if(!fs['existsSync'](_0x566069)){throw new db[(_0xbcc2('0x4f'))][(_0xbcc2('0x50'))]('ScreenRecording\x20not\x20found');}if(_0x8b169f['filename']){return _0x571811[_0xbcc2('0x45')](_0x566069,_0x8b169f[_0xbcc2('0x51')]+path[_0xbcc2('0x52')](_0x566069),function(){if(_0x57749a){fs[_0xbcc2('0x53')](_0x566069);}});}else{return _0x571811[_0xbcc2('0x45')](_0x566069,function(_0x2ae302){if(_0x57749a){fs[_0xbcc2('0x53')](_0x566069);}});}}})['catch'](function(_0x5ef1d1){if(_0x5ef1d1['message']===_0xbcc2('0x54')){_0x571811['status'](0x194)[_0xbcc2('0x55')]('Not\x20found');}else{return handleError(_0x571811,null);}});};exports[_0xbcc2('0x1d')]=function(_0x264fb5,_0x41d3cf){return db['ScreenRecording'][_0xbcc2('0x3e')]({'where':{'id':_0x264fb5[_0xbcc2('0x43')]['id']}})[_0xbcc2('0x1e')](function(_0x4d6a42){if(!_0x4d6a42)throw new ReferenceError(_0xbcc2('0x56'));return _0x4d6a42;})['then'](function(_0x253957){var _0x1ca2c1=path[_0xbcc2('0x48')](config[_0xbcc2('0x57')],_0xbcc2('0x49'),_0x253957[_0xbcc2('0x42')]);logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x1ca2c1);if(!_['isNil'](_0x253957[_0xbcc2('0x42')])&&fs[_0xbcc2('0x4b')](_0x1ca2c1)){logger[_0xbcc2('0x58')](_0xbcc2('0x59')+_0x1ca2c1+_0xbcc2('0x5a'));fs[_0xbcc2('0x5b')](_0x1ca2c1);}_0x1ca2c1=_0x1ca2c1+_0xbcc2('0x5c');if(!_[_0xbcc2('0x5d')](_0x253957[_0xbcc2('0x42')])&&fs[_0xbcc2('0x4b')](_0x1ca2c1)){logger[_0xbcc2('0x58')](_0xbcc2('0x59')+_0x1ca2c1+_0xbcc2('0x5a'));fs[_0xbcc2('0x5b')](_0x1ca2c1);}return _0x253957;})[_0xbcc2('0x1e')](function(_0x11bc77){if(!_0x11bc77)throw new InternalError();return _0x11bc77['destroy']();})[_0xbcc2('0x1e')](function(){_0x41d3cf[_0xbcc2('0x13')](0xcc)['end']();})['catch'](function(_0x24b466){var _0x3b13f9=0x1f4;if(e instanceof ReferenceError){_0x3b13f9=0x194;}else if(e instanceof InternalError){_0x3b13f9=0x1f4;}logger['error'](_0x24b466[_0xbcc2('0x5e')]);if(_0x24b466[_0xbcc2('0x21')]){delete _0x24b466[_0xbcc2('0x21')];}_0x41d3cf[_0xbcc2('0x13')](_0x3b13f9)[_0xbcc2('0x55')](_0x24b466);});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 8d2dc50..133704c 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 _0x8a53=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','util'];(function(_0x4df17c,_0x2d2b61){var _0x4e79b5=function(_0x2134a5){while(--_0x2134a5){_0x4df17c['push'](_0x4df17c['shift']());}};_0x4e79b5(++_0x2d2b61);}(_0x8a53,0x99));var _0x38a5=function(_0x21cc0b,_0x1613b4){_0x21cc0b=_0x21cc0b-0x0;var _0xb9b4e4=_0x8a53[_0x21cc0b];return _0xb9b4e4;};'use strict';var _=require('lodash');var util=require(_0x38a5('0x0'));var logger=require(_0x38a5('0x1'))('api');var moment=require(_0x38a5('0x2'));var BPromise=require(_0x38a5('0x3'));var rp=require(_0x38a5('0x4'));var fs=require('fs');var path=require(_0x38a5('0x5'));var rimraf=require(_0x38a5('0x6'));var config=require(_0x38a5('0x7'));var attributes=require(_0x38a5('0x8'));module[_0x38a5('0x9')]=function(_0x582d71,_0x4f84a7){return _0x582d71[_0x38a5('0xa')](_0x38a5('0xb'),attributes,{'tableName':_0x38a5('0xc'),'paranoid':![],'indexes':[{'name':_0x38a5('0xd'),'fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xbd72=['request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger','moment','bluebird'];(function(_0xbf8bc5,_0x21f45c){var _0x72af02=function(_0x5c5e46){while(--_0x5c5e46){_0xbf8bc5['push'](_0xbf8bc5['shift']());}};_0x72af02(++_0x21f45c);}(_0xbd72,0x145));var _0x2bd7=function(_0x4b6830,_0x2bf6fb){_0x4b6830=_0x4b6830-0x0;var _0x239e4a=_0xbd72[_0x4b6830];return _0x239e4a;};'use strict';var _=require(_0x2bd7('0x0'));var util=require(_0x2bd7('0x1'));var logger=require(_0x2bd7('0x2'))('api');var moment=require(_0x2bd7('0x3'));var BPromise=require(_0x2bd7('0x4'));var rp=require(_0x2bd7('0x5'));var fs=require('fs');var path=require(_0x2bd7('0x6'));var rimraf=require(_0x2bd7('0x7'));var config=require(_0x2bd7('0x8'));var attributes=require(_0x2bd7('0x9'));module[_0x2bd7('0xa')]=function(_0x3ea36d,_0x3e3620){return _0x3ea36d[_0x2bd7('0xb')](_0x2bd7('0xc'),attributes,{'tableName':_0x2bd7('0xd'),'paranoid':![],'indexes':[{'name':_0x2bd7('0xe'),'fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index a896214..60986e9 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 _0xa9e0=['http','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\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(_0x1fb14f,_0x48896c){var _0x24546d=function(_0x21bc4b){while(--_0x21bc4b){_0x1fb14f['push'](_0x1fb14f['shift']());}};_0x24546d(++_0x48896c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'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','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\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(_0x2364b2,_0x5cdd9c){var _0x167c33=function(_0x50a6f2){while(--_0x50a6f2){_0x2364b2['push'](_0x2364b2['shift']());}};_0x167c33(++_0x5cdd9c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'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/setting/index.js b/server/api/setting/index.js index d1a0a7b..5bb3f14 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 _0x2701=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','isAuthenticated','index','/:id','show','get','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','/:id/preferred','getPreferred','getFavicon','diskStorage','root','server/files/images/logos/','format','%s%s','logo','extname','originalname','post','single','join','file','addLogoLogin','preferred','addPreferred','favicon','put','update','exports','multer','path'];(function(_0xfbe581,_0xfea63f){var _0x446db6=function(_0xfeff8c){while(--_0xfeff8c){_0xfbe581['push'](_0xfbe581['shift']());}};_0x446db6(++_0xfea63f);}(_0x2701,0x76));var _0x1270=function(_0xc12bd,_0x288013){_0xc12bd=_0xc12bd-0x0;var _0x27b5eb=_0x2701[_0xc12bd];return _0x27b5eb;};'use strict';var multer=require(_0x1270('0x0'));var util=require('util');var path=require(_0x1270('0x1'));var timeout=require(_0x1270('0x2'));var express=require(_0x1270('0x3'));var router=express['Router']();var auth=require(_0x1270('0x4'));var interaction=require(_0x1270('0x5'));var config=require(_0x1270('0x6'));var controller=require(_0x1270('0x7'));router['get']('/',auth[_0x1270('0x8')](),controller[_0x1270('0x9')]);router['get'](_0x1270('0xa'),controller[_0x1270('0xb')]);router[_0x1270('0xc')](_0x1270('0xd'),controller[_0x1270('0xe')]);router[_0x1270('0xc')](_0x1270('0xf'),controller[_0x1270('0x10')]);router[_0x1270('0xc')](_0x1270('0x11'),controller['gdpr']);router['get'](_0x1270('0x12'),controller[_0x1270('0x13')]);router['get']('/:id/favicon',controller[_0x1270('0x14')]);var upload=multer({'storage':multer[_0x1270('0x15')]({'destination':function(_0x2505e6,_0xa3ed1b,_0x5d6250){_0x5d6250(null,path['join'](config[_0x1270('0x16')],_0x1270('0x17')));},'filename':function(_0x1a6f54,_0x41b311,_0x3a27b2){_0x3a27b2(null,util[_0x1270('0x18')](_0x1270('0x19'),_0x1270('0x1a'),path[_0x1270('0x1b')](_0x41b311[_0x1270('0x1c')])));}})});router[_0x1270('0x1d')]('/:id/logo',upload[_0x1270('0x1e')]('file'),controller['addLogo']);var upload=multer({'storage':multer[_0x1270('0x15')]({'destination':function(_0x21cf6f,_0x46177b,_0x3fac00){_0x3fac00(null,path[_0x1270('0x1f')](config['root'],'server/files/images/logos/'));},'filename':function(_0x4c9897,_0x3e23ea,_0x19fb7c){_0x19fb7c(null,util[_0x1270('0x18')]('%s%s','logologin',path[_0x1270('0x1b')](_0x3e23ea['originalname'])));}})});router['post'](_0x1270('0xf'),upload['single'](_0x1270('0x20')),controller[_0x1270('0x21')]);var upload=multer({'storage':multer[_0x1270('0x15')]({'destination':function(_0x36cb30,_0x138744,_0x20b1ef){_0x20b1ef(null,path[_0x1270('0x1f')](config['root'],_0x1270('0x17')));},'filename':function(_0x346877,_0x241c02,_0x2f9244){_0x2f9244(null,util[_0x1270('0x18')](_0x1270('0x19'),_0x1270('0x22'),path[_0x1270('0x1b')](_0x241c02['originalname'])));}})});router[_0x1270('0x1d')](_0x1270('0x12'),upload[_0x1270('0x1e')](_0x1270('0x20')),controller[_0x1270('0x23')]);var upload=multer({'storage':multer[_0x1270('0x15')]({'destination':function(_0x404f82,_0x15323c,_0x5baecd){_0x5baecd(null,path[_0x1270('0x1f')](config[_0x1270('0x16')],_0x1270('0x17')));},'filename':function(_0x327941,_0x24613f,_0x23cbcd){_0x23cbcd(null,util['format']('%s%s',_0x1270('0x24'),path['extname'](_0x24613f[_0x1270('0x1c')])));}})});router['post']('/:id/favicon',upload['single'](_0x1270('0x20')),controller['addFavicon']);router[_0x1270('0x25')](_0x1270('0xa'),auth[_0x1270('0x8')](),controller[_0x1270('0x26')]);module[_0x1270('0x27')]=router; \ No newline at end of file +var _0x843c=['join','root','server/files/images/logos/','format','logo','originalname','post','single','file','%s%s','logologin','extname','addLogoLogin','addPreferred','favicon','addFavicon','put','update','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','isAuthenticated','index','get','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','diskStorage'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x843c,0xe5));var _0xc843=function(_0x241437,_0x416544){_0x241437=_0x241437-0x0;var _0x18636f=_0x843c[_0x241437];return _0x18636f;};'use strict';var multer=require(_0xc843('0x0'));var util=require('util');var path=require(_0xc843('0x1'));var timeout=require(_0xc843('0x2'));var express=require('express');var router=express[_0xc843('0x3')]();var auth=require(_0xc843('0x4'));var interaction=require(_0xc843('0x5'));var config=require(_0xc843('0x6'));var controller=require(_0xc843('0x7'));router['get']('/',auth[_0xc843('0x8')](),controller[_0xc843('0x9')]);router[_0xc843('0xa')](_0xc843('0xb'),controller[_0xc843('0xc')]);router[_0xc843('0xa')](_0xc843('0xd'),controller[_0xc843('0xe')]);router[_0xc843('0xa')](_0xc843('0xf'),controller[_0xc843('0x10')]);router['get'](_0xc843('0x11'),controller[_0xc843('0x12')]);router[_0xc843('0xa')](_0xc843('0x13'),controller[_0xc843('0x14')]);router[_0xc843('0xa')](_0xc843('0x15'),controller['getFavicon']);var upload=multer({'storage':multer[_0xc843('0x16')]({'destination':function(_0x238112,_0x2c5b2b,_0x4dc394){_0x4dc394(null,path[_0xc843('0x17')](config[_0xc843('0x18')],_0xc843('0x19')));},'filename':function(_0x1a2c64,_0xfa14f4,_0x184b55){_0x184b55(null,util[_0xc843('0x1a')]('%s%s',_0xc843('0x1b'),path['extname'](_0xfa14f4[_0xc843('0x1c')])));}})});router[_0xc843('0x1d')]('/:id/logo',upload[_0xc843('0x1e')](_0xc843('0x1f')),controller['addLogo']);var upload=multer({'storage':multer[_0xc843('0x16')]({'destination':function(_0x26fb7c,_0x18bc90,_0x270d71){_0x270d71(null,path['join'](config[_0xc843('0x18')],_0xc843('0x19')));},'filename':function(_0x3298f2,_0x3dd388,_0x731326){_0x731326(null,util[_0xc843('0x1a')](_0xc843('0x20'),_0xc843('0x21'),path[_0xc843('0x22')](_0x3dd388[_0xc843('0x1c')])));}})});router[_0xc843('0x1d')]('/:id/logo_login',upload[_0xc843('0x1e')](_0xc843('0x1f')),controller[_0xc843('0x23')]);var upload=multer({'storage':multer[_0xc843('0x16')]({'destination':function(_0x154748,_0x47a2ba,_0x50878b){_0x50878b(null,path[_0xc843('0x17')](config[_0xc843('0x18')],_0xc843('0x19')));},'filename':function(_0x23b5d3,_0x4213fc,_0x172b4c){_0x172b4c(null,util[_0xc843('0x1a')](_0xc843('0x20'),'preferred',path[_0xc843('0x22')](_0x4213fc[_0xc843('0x1c')])));}})});router[_0xc843('0x1d')](_0xc843('0x13'),upload[_0xc843('0x1e')](_0xc843('0x1f')),controller[_0xc843('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5b9236,_0xeebcd7,_0x3a7c87){_0x3a7c87(null,path['join'](config[_0xc843('0x18')],_0xc843('0x19')));},'filename':function(_0x477523,_0x123244,_0x38bc4c){_0x38bc4c(null,util[_0xc843('0x1a')](_0xc843('0x20'),_0xc843('0x25'),path[_0xc843('0x22')](_0x123244[_0xc843('0x1c')])));}})});router[_0xc843('0x1d')](_0xc843('0x15'),upload['single'](_0xc843('0x1f')),controller[_0xc843('0x26')]);router[_0xc843('0x27')](_0xc843('0xb'),auth[_0xc843('0x8')](),controller[_0xc843('0x28')]);module[_0xc843('0x29')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 3086b72..191b779 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 _0x331f=['sequelize','exports','INTEGER','min_internal','min_mailbox','/var/opt/motion2/server/files/sounds/converted','STRING','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml'];(function(_0x276c2b,_0x44f5e7){var _0x34d491=function(_0x5b6d15){while(--_0x5b6d15){_0x276c2b['push'](_0x276c2b['shift']());}};_0x34d491(++_0x44f5e7);}(_0x331f,0xc6));var _0xf331=function(_0x21f03f,_0x5e21ad){_0x21f03f=_0x21f03f-0x0;var _0x4eb69b=_0x331f[_0x21f03f];return _0x4eb69b;};'use strict';var Sequelize=require(_0xf331('0x0'));module[_0xf331('0x1')]={'min_internal':{'type':Sequelize[_0xf331('0x2')](0xb),'unique':_0xf331('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xf331('0x2')](0xb),'unique':_0xf331('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xf331('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize['STRING'],'defaultValue':_0xf331('0x5')},'logo':{'type':Sequelize[_0xf331('0x6')]},'defaultLogo':{'type':Sequelize[_0xf331('0x7')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xf331('0x6')]},'defaultLoginLogo':{'type':Sequelize[_0xf331('0x7')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xf331('0x6')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xf331('0x7')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0xf331('0x6')]},'turnusername':{'type':Sequelize[_0xf331('0x6')]},'turnpassword':{'type':Sequelize[_0xf331('0x6')]},'pageTitle':{'type':Sequelize[_0xf331('0x6')]},'defaultPageTitle':{'type':Sequelize[_0xf331('0x7')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xf331('0x7')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0xf331('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xf331('0x6')],'defaultValue':_0xf331('0x8')},'enableEmailPreview':{'type':Sequelize[_0xf331('0x7')],'defaultValue':![]},'split':{'type':Sequelize[_0xf331('0x7')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xf331('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xf331('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xf331('0x6')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xf331('0x7')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xf331('0x6')]},'allowedLoginAttempts':{'type':Sequelize[_0xf331('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'favicon':{'type':Sequelize[_0xf331('0x6')]},'defaultFavicon':{'type':Sequelize[_0xf331('0x7')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xf331('0x2')],'defaultValue':0xa,'validate':{'min':0xa}}}; \ No newline at end of file +var _0x9d5b=['https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','sequelize','exports','INTEGER','min_internal','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x9d5b,0x1e2));var _0xb9d5=function(_0x3f5bf7,_0x46a3b2){_0x3f5bf7=_0x3f5bf7-0x0;var _0x122b0f=_0x9d5b[_0x3f5bf7];return _0x122b0f;};'use strict';var Sequelize=require(_0xb9d5('0x0'));module[_0xb9d5('0x1')]={'min_internal':{'type':Sequelize[_0xb9d5('0x2')](0xb),'unique':_0xb9d5('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xb9d5('0x2')](0xb),'unique':_0xb9d5('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xb9d5('0x5')],'defaultValue':_0xb9d5('0x6')},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0xb9d5('0x7')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xb9d5('0x5')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xb9d5('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0xb9d5('0x7')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0xb9d5('0x5')]},'turnusername':{'type':Sequelize[_0xb9d5('0x5')]},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0xb9d5('0x5')]},'defaultPageTitle':{'type':Sequelize[_0xb9d5('0x7')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xb9d5('0x7')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0xb9d5('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0xb9d5('0x8')},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xb9d5('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xb9d5('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xb9d5('0x5')],'defaultValue':_0xb9d5('0x9')},'chatTimeout':{'type':Sequelize[_0xb9d5('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'preferred':{'type':Sequelize[_0xb9d5('0x5')]},'defaultPreferred':{'type':Sequelize[_0xb9d5('0x7')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize[_0xb9d5('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'favicon':{'type':Sequelize[_0xb9d5('0x5')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xb9d5('0x2')],'defaultValue':0xa,'validate':{'min':0xa}}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index f026036..3703e41 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 _0xa5ad=['default_logo.png','default','custom','upperFirst','\x20not\x20found','download','getLogoLogin','defaultLogo','Sequelize','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','default_favicon.ico','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','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','jayson/promise','client','http','test','ValidationError','request','then','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','Setting,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','save','update','destroy','stack','name','send','map','Setting','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','VIRTUAL','count','includeAll','rows','show','fields','include','find','params','body','get','readFileSync','root','server/files/templates/stun.ejs','utf8','render','join','server/files/templates/turn.ejs','writeFileSync','/etc/asterisk/stun_xcally.conf','/etc/asterisk/turn_xcally.conf','Reload','res_stun_monitor.so','res_rtp_asterisk.so','addLogo','file','filename','logo','addLogoLogin','../../config/license/util','server/files/images/logos','getLicense','loginLogo','preferred','favicon','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','toLower'];(function(_0x2272b5,_0x362458){var _0x110156=function(_0x5c2e32){while(--_0x5c2e32){_0x2272b5['push'](_0x2272b5['shift']());}};_0x110156(++_0x362458);}(_0xa5ad,0x96));var _0xda5a=function(_0x40cb91,_0xca8c09){_0x40cb91=_0x40cb91-0x0;var _0x3cd00d=_0xa5ad[_0x40cb91];return _0x3cd00d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xda5a('0x0'));var rimraf=require(_0xda5a('0x1'));var zipdir=require(_0xda5a('0x2'));var jsonpatch=require(_0xda5a('0x3'));var rp=require(_0xda5a('0x4'));var moment=require(_0xda5a('0x5'));var BPromise=require(_0xda5a('0x6'));var Mustache=require(_0xda5a('0x7'));var util=require(_0xda5a('0x8'));var path=require(_0xda5a('0x9'));var sox=require(_0xda5a('0xa'));var csv=require(_0xda5a('0xb'));var ejs=require(_0xda5a('0xc'));var fs=require('fs');var _=require(_0xda5a('0xd'));var squel=require(_0xda5a('0xe'));var crypto=require(_0xda5a('0xf'));var jsforce=require(_0xda5a('0x10'));var deskjs=require(_0xda5a('0x11'));var toCsv=require('to-csv');var querystring=require(_0xda5a('0x12'));var Papa=require('papaparse');var Redis=require(_0xda5a('0x13'));var authService=require(_0xda5a('0x14'));var qs=require(_0xda5a('0x15'));var as=require(_0xda5a('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xda5a('0x17'));var utils=require(_0xda5a('0x18'));var config=require(_0xda5a('0x19'));var db=require('../../mysqldb')['db'];var jayson=require(_0xda5a('0x1a'));var client=jayson[_0xda5a('0x1b')][_0xda5a('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x396ad6,_0x1698a6,_0x67238b){if(_0x67238b){var _0x25bde6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x25bde6[_0xda5a('0x1d')](_0x1698a6)){return _0x396ad6;}else{throw new db['Sequelize'][(_0xda5a('0x1e'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x396ad6;}}function respondWithRpcPromise(_0x32e321,_0x1e6c17,_0x56b6ea,_0x18bf88){return new BPromise(function(_0x3de997,_0x3d1bd3){var _0x4bdd26=_0x18bf88||client;return _0x4bdd26[_0xda5a('0x1f')](_0x32e321,_0x56b6ea)[_0xda5a('0x20')](function(_0xaf91fd){logger['info']('Setting,\x20%s,\x20%s',_0x1e6c17,_0xda5a('0x21'));logger['debug'](_0xda5a('0x22'),_0x1e6c17,_0xda5a('0x21'),JSON[_0xda5a('0x23')](_0xaf91fd));if(_0xaf91fd[_0xda5a('0x24')]){if(_0xaf91fd[_0xda5a('0x24')][_0xda5a('0x25')]===0x1f4){logger['error'](_0xda5a('0x26'),_0x1e6c17,_0xaf91fd['error'][_0xda5a('0x27')]);return _0x3d1bd3(_0xaf91fd[_0xda5a('0x24')]['message']);}logger[_0xda5a('0x24')]('Setting,\x20%s,\x20%s',_0x1e6c17,_0xaf91fd[_0xda5a('0x24')][_0xda5a('0x27')]);return _0x3de997(_0xaf91fd['error']['message']);}else{logger[_0xda5a('0x28')](_0xda5a('0x26'),_0x1e6c17,_0xda5a('0x21'));_0x3de997(_0xaf91fd[_0xda5a('0x29')][_0xda5a('0x27')]);}})[_0xda5a('0x2a')](function(_0x51af76){logger[_0xda5a('0x24')](_0xda5a('0x26'),_0x1e6c17,_0x51af76);_0x3d1bd3(_0x51af76);});});}function respondWithStatusCode(_0x210819,_0x3feeb1){_0x3feeb1=_0x3feeb1||0xcc;return function(_0x350d1a){if(_0x350d1a){return _0x210819[_0xda5a('0x2b')](_0x3feeb1);}return _0x210819[_0xda5a('0x2c')](_0x3feeb1)[_0xda5a('0x2d')]();};}function respondWithResult(_0x551c27,_0x28a25a){_0x28a25a=_0x28a25a||0xc8;return function(_0x45bd75){if(_0x45bd75){return _0x551c27[_0xda5a('0x2c')](_0x28a25a)[_0xda5a('0x2e')](_0x45bd75);}};}function respondWithFilteredResult(_0x27d805,_0xe00d64){return function(_0x429781){if(_0x429781){var _0x2137ac=_0x429781['count'],_0x242af7=_0xe00d64[_0xda5a('0x2f')],_0x5053a5=_0xe00d64[_0xda5a('0x2f')]+_0xe00d64[_0xda5a('0x30')],_0x3564d5;if(_0x5053a5>=_0x2137ac){_0x5053a5=_0x2137ac;_0x3564d5=0xc8;}else{_0x3564d5=0xce;}_0x27d805['status'](_0x3564d5);return _0x27d805['set'](_0xda5a('0x31'),_0x242af7+'-'+_0x5053a5+'/'+_0x2137ac)[_0xda5a('0x2e')](_0x429781);}return null;};}function patchUpdates(_0x1694ed){return function(_0x5a2a20){try{jsonpatch[_0xda5a('0x32')](_0x5a2a20,_0x1694ed,!![]);}catch(_0x13a552){return BPromise[_0xda5a('0x33')](_0x13a552);}return _0x5a2a20[_0xda5a('0x34')]();};}function saveUpdates(_0x50cc26,_0x46a25e){return function(_0x459981){if(_0x459981){return _0x459981[_0xda5a('0x35')](_0x50cc26)['then'](function(_0x310a8d){return _0x310a8d;});}return null;};}function removeEntity(_0x4fbbd8,_0x41782f){return function(_0x1d7afb){if(_0x1d7afb){return _0x1d7afb[_0xda5a('0x36')]()[_0xda5a('0x20')](function(){_0x4fbbd8[_0xda5a('0x2c')](0xcc)[_0xda5a('0x2d')]();});}};}function handleEntityNotFound(_0x22479c,_0x4fae3e){return function(_0x3e6d7b){if(!_0x3e6d7b){_0x22479c['sendStatus'](0x194);}return _0x3e6d7b;};}function handleError(_0x5af68f,_0x444a10){_0x444a10=_0x444a10||0x1f4;return function(_0x23ead7){logger[_0xda5a('0x24')](_0x23ead7[_0xda5a('0x37')]);if(_0x23ead7[_0xda5a('0x38')]){delete _0x23ead7['name'];}_0x5af68f[_0xda5a('0x2c')](_0x444a10)[_0xda5a('0x39')](_0x23ead7);};}exports['index']=function(_0x5016e9,_0x9d3db0){var _0xe09d6e={},_0x411958={},_0x50d001={'count':0x0,'rows':[]};var _0x119029=_[_0xda5a('0x3a')](db[_0xda5a('0x3b')][_0xda5a('0x3c')],function(_0x68e13f){return{'name':_0x68e13f[_0xda5a('0x3d')],'type':_0x68e13f[_0xda5a('0x3e')][_0xda5a('0x3f')]};});_0x411958[_0xda5a('0x40')]=_[_0xda5a('0x3a')](_0x119029,_0xda5a('0x38'));_0x411958[_0xda5a('0x41')]=_[_0xda5a('0x42')](_0x5016e9['query']);_0x411958[_0xda5a('0x43')]=_['intersection'](_0x411958[_0xda5a('0x40')],_0x411958[_0xda5a('0x41')]);_0xe09d6e[_0xda5a('0x44')]=_[_0xda5a('0x45')](_0x411958['model'],qs['fields'](_0x5016e9['query']['fields']));_0xe09d6e[_0xda5a('0x44')]=_0xe09d6e[_0xda5a('0x44')][_0xda5a('0x46')]?_0xe09d6e[_0xda5a('0x44')]:_0x411958[_0xda5a('0x40')];if(!_0x5016e9[_0xda5a('0x41')][_0xda5a('0x47')](_0xda5a('0x48'))){_0xe09d6e[_0xda5a('0x30')]=qs['limit'](_0x5016e9[_0xda5a('0x41')][_0xda5a('0x30')]);_0xe09d6e['offset']=qs[_0xda5a('0x2f')](_0x5016e9[_0xda5a('0x41')]['offset']);}_0xe09d6e[_0xda5a('0x49')]=qs[_0xda5a('0x4a')](_0x5016e9[_0xda5a('0x41')][_0xda5a('0x4a')]);_0xe09d6e['where']=qs[_0xda5a('0x43')](_['pick'](_0x5016e9[_0xda5a('0x41')],_0x411958[_0xda5a('0x43')]));if(_0x5016e9[_0xda5a('0x41')][_0xda5a('0x4b')]){_0xe09d6e['where']=_[_0xda5a('0x4c')](_0xe09d6e[_0xda5a('0x4d')],{'$or':_[_0xda5a('0x3a')](_0x119029,function(_0x237403){if(_0x237403[_0xda5a('0x3e')]!==_0xda5a('0x4e')){var _0xc9a90f={};_0xc9a90f[_0x237403[_0xda5a('0x38')]]={'$like':'%'+_0x5016e9['query'][_0xda5a('0x4b')]+'%'};return _0xc9a90f;}})});}_0xe09d6e=_[_0xda5a('0x4c')]({},_0xe09d6e,_0x5016e9['options']);var _0x182eca={'where':_0xe09d6e[_0xda5a('0x4d')]};return db[_0xda5a('0x3b')]['count'](_0x182eca)['then'](function(_0x594d9f){_0x50d001[_0xda5a('0x4f')]=_0x594d9f;if(_0x5016e9[_0xda5a('0x41')][_0xda5a('0x50')]){_0xe09d6e['include']=[{'all':!![]}];}return db[_0xda5a('0x3b')]['findAll'](_0xe09d6e);})[_0xda5a('0x20')](function(_0x27c9d9){_0x50d001[_0xda5a('0x51')]=_0x27c9d9;return _0x50d001;})[_0xda5a('0x20')](respondWithFilteredResult(_0x9d3db0,_0xe09d6e))[_0xda5a('0x2a')](handleError(_0x9d3db0,null));};exports[_0xda5a('0x52')]=function(_0x24da1f,_0x261ca5){var _0x42e35d={'raw':![],'where':{'id':_0x24da1f['params']['id']}},_0x16680e={};_0x16680e[_0xda5a('0x40')]=_[_0xda5a('0x42')](db[_0xda5a('0x3b')][_0xda5a('0x3c')]);_0x16680e['query']=_['keys'](_0x24da1f[_0xda5a('0x41')]);_0x16680e[_0xda5a('0x43')]=_[_0xda5a('0x45')](_0x16680e[_0xda5a('0x40')],_0x16680e[_0xda5a('0x41')]);_0x42e35d[_0xda5a('0x44')]=_['intersection'](_0x16680e[_0xda5a('0x40')],qs[_0xda5a('0x53')](_0x24da1f[_0xda5a('0x41')][_0xda5a('0x53')]));_0x42e35d[_0xda5a('0x44')]=_0x42e35d['attributes']['length']?_0x42e35d[_0xda5a('0x44')]:_0x16680e[_0xda5a('0x40')];if(_0x24da1f[_0xda5a('0x41')][_0xda5a('0x50')]){_0x42e35d[_0xda5a('0x54')]=[{'all':!![]}];}_0x42e35d=_['merge']({},_0x42e35d,_0x24da1f['options']);return db[_0xda5a('0x3b')][_0xda5a('0x55')](_0x42e35d)[_0xda5a('0x20')](handleEntityNotFound(_0x261ca5,null))[_0xda5a('0x20')](respondWithResult(_0x261ca5,null))['catch'](handleError(_0x261ca5,null));};exports[_0xda5a('0x35')]=function(_0x5b7018,_0x312940,_0x104395){var _0x55d009;return db[_0xda5a('0x3b')][_0xda5a('0x55')]({'where':{'id':_0x5b7018[_0xda5a('0x56')]['id']}})[_0xda5a('0x20')](handleEntityNotFound(_0x312940,null))[_0xda5a('0x20')](saveUpdates(_0x5b7018[_0xda5a('0x57')],null))[_0xda5a('0x20')](function(_0x40825b){if(_0x40825b){_0x55d009=_0x40825b[_0xda5a('0x58')]({'plain':!![]});var _0x2ddf46=fs[_0xda5a('0x59')](path['join'](config[_0xda5a('0x5a')],_0xda5a('0x5b')),_0xda5a('0x5c'));var _0x2cfc50=ejs[_0xda5a('0x5d')](_0x2ddf46,_0x55d009);var _0x56d0b=fs[_0xda5a('0x59')](path[_0xda5a('0x5e')](config[_0xda5a('0x5a')],_0xda5a('0x5f')),_0xda5a('0x5c'));var _0x84aa26=ejs[_0xda5a('0x5d')](_0x56d0b,_0x55d009);fs[_0xda5a('0x60')](_0xda5a('0x61'),_0x2cfc50);fs[_0xda5a('0x60')](_0xda5a('0x62'),_0x84aa26);return respondWithRpcPromise(_0xda5a('0x63'),_0xda5a('0x35'),{'module':_0xda5a('0x64')});}})[_0xda5a('0x20')](function(){return respondWithRpcPromise(_0xda5a('0x63'),_0xda5a('0x35'),{'module':_0xda5a('0x65')});})[_0xda5a('0x20')](function(){return _0x55d009||null;})[_0xda5a('0x20')](respondWithResult(_0x312940,null))['catch'](handleError(_0x312940,null));};exports[_0xda5a('0x66')]=function(_0x4e7f50,_0x3582a7,_0x79de85){if(_0x4e7f50[_0xda5a('0x67')]&&_0x4e7f50[_0xda5a('0x67')][_0xda5a('0x68')]){_0x4e7f50['body'][_0xda5a('0x69')]=_0x4e7f50[_0xda5a('0x67')][_0xda5a('0x68')];}return db[_0xda5a('0x3b')][_0xda5a('0x55')]({'where':{'id':_0x4e7f50[_0xda5a('0x56')]['id']}})[_0xda5a('0x20')](handleEntityNotFound(_0x3582a7,null))['then'](saveUpdates(_0x4e7f50[_0xda5a('0x57')],null))['then'](respondWithResult(_0x3582a7,null))['catch'](handleError(_0x3582a7,null));};exports[_0xda5a('0x6a')]=function(_0x34abea,_0x3b1ef5,_0x13833d){if(_0x34abea['file']&&_0x34abea['file'][_0xda5a('0x68')]){_0x34abea['body']['loginLogo']=_0x34abea[_0xda5a('0x67')]['filename'];}return db[_0xda5a('0x3b')][_0xda5a('0x55')]({'where':{'id':_0x34abea[_0xda5a('0x56')]['id']}})[_0xda5a('0x20')](handleEntityNotFound(_0x3b1ef5,null))['then'](saveUpdates(_0x34abea[_0xda5a('0x57')],null))[_0xda5a('0x20')](respondWithResult(_0x3b1ef5,null))[_0xda5a('0x2a')](handleError(_0x3b1ef5,null));};var utilLicense=require(_0xda5a('0x6b'));exports['getLogo']=function(_0x248d5b,_0x4b82c7,_0x4bc27b){var _0x560bed=_0xda5a('0x6c');var _0x14e260={'custom':![]};return utilLicense[_0xda5a('0x6d')]()[_0xda5a('0x20')](function(_0x15c588){if(_0x15c588){_0x14e260=_0x15c588;}return db[_0xda5a('0x3b')][_0xda5a('0x55')]({'where':{'id':_0x248d5b[_0xda5a('0x56')]['id']},'attributes':[_0xda5a('0x69'),_0xda5a('0x6e'),_0xda5a('0x6f'),_0xda5a('0x70'),'defaultLogo',_0xda5a('0x71'),_0xda5a('0x72'),_0xda5a('0x73')],'raw':!![]});})['then'](handleEntityNotFound(_0x4b82c7,null))[_0xda5a('0x20')](function(_0xf819da){if(_0xf819da){var _0x3c0e73=_0xf819da['logo']&&fs[_0xda5a('0x74')](path[_0xda5a('0x5e')](config['root'],_0x560bed,_[_0xda5a('0x75')](_0xf819da[_0xda5a('0x69')])))?path[_0xda5a('0x5e')](config[_0xda5a('0x5a')],_0x560bed,_['toLower'](_0xf819da[_0xda5a('0x69')])):path['join'](config[_0xda5a('0x5a')],_0x560bed,_['toLower'](_0xda5a('0x76')));var _0x14182e=_0xda5a('0x77')+_['upperFirst'](_0xda5a('0x69'));if(_0xf819da[_0x14182e]||!_0x14e260[_0xda5a('0x78')]){_0x3c0e73=path[_0xda5a('0x5e')](config[_0xda5a('0x5a')],_0x560bed,_[_0xda5a('0x75')]('default_logo.png'));}if(!fs[_0xda5a('0x74')](_0x3c0e73)){throw new db['Sequelize']['ValidationError'](_[_0xda5a('0x79')](_0xda5a('0x69'))+_0xda5a('0x7a'));}return _0x4b82c7[_0xda5a('0x7b')](_0x3c0e73);}})[_0xda5a('0x2a')](handleError(_0x4b82c7,null));};var utilLicense=require(_0xda5a('0x6b'));exports[_0xda5a('0x7c')]=function(_0x2f6711,_0x9d74d6,_0x4d8a51){var _0x4e9208='server/files/images/logos';var _0x47df71={'custom':![]};return utilLicense[_0xda5a('0x6d')]()[_0xda5a('0x20')](function(_0x40d564){if(_0x40d564){_0x47df71=_0x40d564;}return db[_0xda5a('0x3b')][_0xda5a('0x55')]({'where':{'id':_0x2f6711['params']['id']},'attributes':['logo','loginLogo','preferred',_0xda5a('0x70'),_0xda5a('0x7d'),_0xda5a('0x71'),_0xda5a('0x72'),'defaultFavicon'],'raw':!![]});})[_0xda5a('0x20')](handleEntityNotFound(_0x9d74d6,null))[_0xda5a('0x20')](function(_0x12c16d){if(_0x12c16d){var _0x272b47=_0x12c16d[_0xda5a('0x6e')]&&fs['existsSync'](path[_0xda5a('0x5e')](config[_0xda5a('0x5a')],_0x4e9208,_['toLower'](_0x12c16d[_0xda5a('0x6e')])))?path['join'](config[_0xda5a('0x5a')],_0x4e9208,_[_0xda5a('0x75')](_0x12c16d[_0xda5a('0x6e')])):path[_0xda5a('0x5e')](config[_0xda5a('0x5a')],_0x4e9208,_[_0xda5a('0x75')]('default_loginLogo.png'));var _0x2927df=_0xda5a('0x77')+_['upperFirst']('loginLogo');if(_0x12c16d[_0x2927df]||!_0x47df71[_0xda5a('0x78')]){_0x272b47=path[_0xda5a('0x5e')](config[_0xda5a('0x5a')],_0x4e9208,_[_0xda5a('0x75')]('default_loginLogo.png'));}if(!fs['existsSync'](_0x272b47)){throw new db[(_0xda5a('0x7e'))][(_0xda5a('0x1e'))](_[_0xda5a('0x79')](_0xda5a('0x6e'))+_0xda5a('0x7a'));}return _0x9d74d6['download'](_0x272b47);}})[_0xda5a('0x2a')](handleError(_0x9d74d6,null));};exports[_0xda5a('0x7f')]=function(_0x4daef5,_0x4b006c){return db[_0xda5a('0x3b')][_0xda5a('0x55')]({'where':{'id':_0x4daef5[_0xda5a('0x56')]['id']},'attributes':[_0xda5a('0x80')]})[_0xda5a('0x20')](respondWithResult(_0x4b006c,null))['catch'](handleError(_0x4b006c,null));};exports[_0xda5a('0x81')]=function(_0x4726f5,_0x2bd05b,_0x1a0fda){if(_0x4726f5['file']&&_0x4726f5[_0xda5a('0x67')][_0xda5a('0x68')]){_0x4726f5[_0xda5a('0x57')][_0xda5a('0x6f')]=_0x4726f5[_0xda5a('0x67')]['filename'];}return db['Setting']['find']({'where':{'id':_0x4726f5[_0xda5a('0x56')]['id']}})[_0xda5a('0x20')](handleEntityNotFound(_0x2bd05b,null))[_0xda5a('0x20')](saveUpdates(_0x4726f5[_0xda5a('0x57')],null))[_0xda5a('0x20')](respondWithResult(_0x2bd05b,null))['catch'](handleError(_0x2bd05b,null));};var utilLicense=require(_0xda5a('0x6b'));exports[_0xda5a('0x82')]=function(_0xfdb1a4,_0x2ff7ab,_0x37d122){var _0x5b861=_0xda5a('0x6c');var _0x5ab69b={'custom':![]};return utilLicense['getLicense']()[_0xda5a('0x20')](function(_0x580a1f){if(_0x580a1f){_0x5ab69b=_0x580a1f;}return db[_0xda5a('0x3b')]['find']({'where':{'id':_0xfdb1a4[_0xda5a('0x56')]['id']},'attributes':[_0xda5a('0x69'),_0xda5a('0x6e'),'preferred','favicon',_0xda5a('0x7d'),'defaultLoginLogo',_0xda5a('0x72'),_0xda5a('0x73')],'raw':!![]});})[_0xda5a('0x20')](handleEntityNotFound(_0x2ff7ab,null))[_0xda5a('0x20')](function(_0x215a61){if(_0x215a61){var _0xb5d733=_0x215a61[_0xda5a('0x6f')]&&fs[_0xda5a('0x74')](path[_0xda5a('0x5e')](config['root'],_0x5b861,_[_0xda5a('0x75')](_0x215a61['preferred'])))?path[_0xda5a('0x5e')](config[_0xda5a('0x5a')],_0x5b861,_[_0xda5a('0x75')](_0x215a61['preferred'])):path[_0xda5a('0x5e')](config[_0xda5a('0x5a')],_0x5b861,_['toLower'](_0xda5a('0x83')));var _0x136bfe=_0xda5a('0x77')+_[_0xda5a('0x79')](_0xda5a('0x6f'));if(_0x215a61[_0x136bfe]||!_0x5ab69b[_0xda5a('0x78')]||!_0x5ab69b[_0xda5a('0x6f')]){_0xb5d733=path[_0xda5a('0x5e')](config[_0xda5a('0x5a')],_0x5b861,_['toLower'](_0xda5a('0x83')));}if(!fs['existsSync'](_0xb5d733)){throw new db[(_0xda5a('0x7e'))][(_0xda5a('0x1e'))](_[_0xda5a('0x79')]('preferred')+_0xda5a('0x7a'));}return _0x2ff7ab[_0xda5a('0x7b')](_0xb5d733);}})[_0xda5a('0x2a')](handleError(_0x2ff7ab,null));};exports[_0xda5a('0x84')]=function(_0x228dc,_0x256a37,_0x5d678d){if(_0x228dc[_0xda5a('0x67')]&&_0x228dc[_0xda5a('0x67')]['filename']){_0x228dc['body'][_0xda5a('0x70')]=_0x228dc['file']['filename'];}return db[_0xda5a('0x3b')][_0xda5a('0x55')]({'where':{'id':_0x228dc[_0xda5a('0x56')]['id']}})[_0xda5a('0x20')](handleEntityNotFound(_0x256a37,null))[_0xda5a('0x20')](saveUpdates(_0x228dc['body'],null))[_0xda5a('0x20')](respondWithResult(_0x256a37,null))['catch'](handleError(_0x256a37,null));};var utilLicense=require(_0xda5a('0x6b'));exports['getFavicon']=function(_0x28c39a,_0x1b7ffb,_0x4cc03f){var _0x206836=_0xda5a('0x6c');var _0x48009b={'custom':![]};return utilLicense[_0xda5a('0x6d')]()[_0xda5a('0x20')](function(_0x1d8faf){if(_0x1d8faf){_0x48009b=_0x1d8faf;}return db[_0xda5a('0x3b')][_0xda5a('0x55')]({'where':{'id':_0x28c39a['params']['id']},'attributes':['logo','loginLogo',_0xda5a('0x6f'),_0xda5a('0x70'),_0xda5a('0x7d'),_0xda5a('0x71'),_0xda5a('0x72'),_0xda5a('0x73')],'raw':!![]});})[_0xda5a('0x20')](handleEntityNotFound(_0x1b7ffb,null))[_0xda5a('0x20')](function(_0x4437a5){if(_0x4437a5){var _0x156910=_0x4437a5[_0xda5a('0x70')]&&fs[_0xda5a('0x74')](path[_0xda5a('0x5e')](config[_0xda5a('0x5a')],_0x206836,_[_0xda5a('0x75')](_0x4437a5[_0xda5a('0x70')])))?path['join'](config[_0xda5a('0x5a')],_0x206836,_[_0xda5a('0x75')](_0x4437a5[_0xda5a('0x70')])):path[_0xda5a('0x5e')](config['root'],_0x206836,_[_0xda5a('0x75')](_0xda5a('0x85')));var _0x1e1804='default'+_[_0xda5a('0x79')](_0xda5a('0x70'));if(_0x4437a5[_0x1e1804]||!_0x48009b['custom']){_0x156910=path[_0xda5a('0x5e')](config['root'],_0x206836,_[_0xda5a('0x75')](_0xda5a('0x85')));}if(!fs[_0xda5a('0x74')](_0x156910)){throw new db[(_0xda5a('0x7e'))][(_0xda5a('0x1e'))](_['upperFirst']('favicon')+_0xda5a('0x7a'));}return _0x1b7ffb['download'](_0x156910);}})['catch'](handleError(_0x1b7ffb,null));}; \ No newline at end of file +var _0xa7df=['../../config/license/util','getLogo','server/files/images/logos','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','toLower','default_logo.png','default','custom','upperFirst','\x20not\x20found','download','getLogoLogin','getLicense','default_loginLogo.png','gdpr','securePassword','getPreferred','default_preferred.png','getFavicon','default_favicon.ico','html-pdf','rimraf','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','update','then','destroy','end','stack','name','send','index','map','Setting','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','rows','intersection','fields','find','params','body','get','join','root','server/files/templates/stun.ejs','render','server/files/templates/turn.ejs','utf8','writeFileSync','/etc/asterisk/stun_xcally.conf','/etc/asterisk/turn_xcally.conf','Reload','res_rtp_asterisk.so','addLogo','file','filename','logo','addLogoLogin','loginLogo'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa7df,0xa1));var _0xfa7d=function(_0x5c137c,_0x221b2e){_0x5c137c=_0x5c137c-0x0;var _0x93e0a8=_0xa7df[_0x5c137c];return _0x93e0a8;};'use strict';var pdf=require(_0xfa7d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xfa7d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfa7d('0x2'));var rp=require('request-promise');var moment=require(_0xfa7d('0x3'));var BPromise=require(_0xfa7d('0x4'));var Mustache=require(_0xfa7d('0x5'));var util=require(_0xfa7d('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xfa7d('0x7'));var ejs=require(_0xfa7d('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xfa7d('0x9'));var crypto=require(_0xfa7d('0xa'));var jsforce=require(_0xfa7d('0xb'));var deskjs=require(_0xfa7d('0xc'));var toCsv=require(_0xfa7d('0x7'));var querystring=require(_0xfa7d('0xd'));var Papa=require(_0xfa7d('0xe'));var Redis=require(_0xfa7d('0xf'));var authService=require(_0xfa7d('0x10'));var qs=require(_0xfa7d('0x11'));var as=require(_0xfa7d('0x12'));var hardwareService=require(_0xfa7d('0x13'));var logger=require(_0xfa7d('0x14'))(_0xfa7d('0x15'));var utils=require(_0xfa7d('0x16'));var config=require(_0xfa7d('0x17'));var db=require(_0xfa7d('0x18'))['db'];var jayson=require(_0xfa7d('0x19'));var client=jayson[_0xfa7d('0x1a')][_0xfa7d('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x6f8475,_0x308f8a,_0x2d03ff){if(_0x2d03ff){var _0x72e7d9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x72e7d9[_0xfa7d('0x1c')](_0x308f8a)){return _0x6f8475;}else{throw new db[(_0xfa7d('0x1d'))][(_0xfa7d('0x1e'))](_0xfa7d('0x1f'));}}else{return _0x6f8475;}}function respondWithRpcPromise(_0x27f096,_0x3c5dc5,_0x31babe,_0x55e2){return new BPromise(function(_0x2d9a6a,_0x26f8e3){var _0x10f6c7=_0x55e2||client;return _0x10f6c7[_0xfa7d('0x20')](_0x27f096,_0x31babe)['then'](function(_0x52d99e){logger[_0xfa7d('0x21')](_0xfa7d('0x22'),_0x3c5dc5,_0xfa7d('0x23'));logger[_0xfa7d('0x24')](_0xfa7d('0x25'),_0x3c5dc5,_0xfa7d('0x23'),JSON[_0xfa7d('0x26')](_0x52d99e));if(_0x52d99e[_0xfa7d('0x27')]){if(_0x52d99e[_0xfa7d('0x27')][_0xfa7d('0x28')]===0x1f4){logger[_0xfa7d('0x27')](_0xfa7d('0x22'),_0x3c5dc5,_0x52d99e[_0xfa7d('0x27')]['message']);return _0x26f8e3(_0x52d99e[_0xfa7d('0x27')][_0xfa7d('0x29')]);}logger['error'](_0xfa7d('0x22'),_0x3c5dc5,_0x52d99e[_0xfa7d('0x27')]['message']);return _0x2d9a6a(_0x52d99e[_0xfa7d('0x27')][_0xfa7d('0x29')]);}else{logger[_0xfa7d('0x21')](_0xfa7d('0x22'),_0x3c5dc5,_0xfa7d('0x23'));_0x2d9a6a(_0x52d99e[_0xfa7d('0x2a')][_0xfa7d('0x29')]);}})[_0xfa7d('0x2b')](function(_0x1f0e46){logger['error'](_0xfa7d('0x22'),_0x3c5dc5,_0x1f0e46);_0x26f8e3(_0x1f0e46);});});}function respondWithStatusCode(_0xe8f716,_0x31c294){_0x31c294=_0x31c294||0xcc;return function(_0x3788b3){if(_0x3788b3){return _0xe8f716[_0xfa7d('0x2c')](_0x31c294);}return _0xe8f716[_0xfa7d('0x2d')](_0x31c294)['end']();};}function respondWithResult(_0x423945,_0x1f3161){_0x1f3161=_0x1f3161||0xc8;return function(_0xaabae7){if(_0xaabae7){return _0x423945[_0xfa7d('0x2d')](_0x1f3161)[_0xfa7d('0x2e')](_0xaabae7);}};}function respondWithFilteredResult(_0x36cf9b,_0x2b25b7){return function(_0x454010){if(_0x454010){var _0x26e310=_0x454010['count'],_0x456e42=_0x2b25b7[_0xfa7d('0x2f')],_0x1fe369=_0x2b25b7[_0xfa7d('0x2f')]+_0x2b25b7[_0xfa7d('0x30')],_0x5382d2;if(_0x1fe369>=_0x26e310){_0x1fe369=_0x26e310;_0x5382d2=0xc8;}else{_0x5382d2=0xce;}_0x36cf9b['status'](_0x5382d2);return _0x36cf9b[_0xfa7d('0x31')](_0xfa7d('0x32'),_0x456e42+'-'+_0x1fe369+'/'+_0x26e310)[_0xfa7d('0x2e')](_0x454010);}return null;};}function patchUpdates(_0x2ea7f8){return function(_0x5c9871){try{jsonpatch[_0xfa7d('0x33')](_0x5c9871,_0x2ea7f8,!![]);}catch(_0x342edd){return BPromise[_0xfa7d('0x34')](_0x342edd);}return _0x5c9871['save']();};}function saveUpdates(_0x336c36,_0x1ff4ec){return function(_0x21cf1d){if(_0x21cf1d){return _0x21cf1d[_0xfa7d('0x35')](_0x336c36)[_0xfa7d('0x36')](function(_0xc0e6f9){return _0xc0e6f9;});}return null;};}function removeEntity(_0x41d215,_0x295431){return function(_0x31fb97){if(_0x31fb97){return _0x31fb97[_0xfa7d('0x37')]()[_0xfa7d('0x36')](function(){_0x41d215['status'](0xcc)[_0xfa7d('0x38')]();});}};}function handleEntityNotFound(_0x10b022,_0x20ca27){return function(_0x4b2cab){if(!_0x4b2cab){_0x10b022[_0xfa7d('0x2c')](0x194);}return _0x4b2cab;};}function handleError(_0x142eb1,_0x3b3403){_0x3b3403=_0x3b3403||0x1f4;return function(_0x2b7385){logger[_0xfa7d('0x27')](_0x2b7385[_0xfa7d('0x39')]);if(_0x2b7385['name']){delete _0x2b7385[_0xfa7d('0x3a')];}_0x142eb1[_0xfa7d('0x2d')](_0x3b3403)[_0xfa7d('0x3b')](_0x2b7385);};}exports[_0xfa7d('0x3c')]=function(_0x4f3ad8,_0x34268e){var _0x606ffe={},_0x4e3345={},_0x2c29dc={'count':0x0,'rows':[]};var _0x558beb=_[_0xfa7d('0x3d')](db[_0xfa7d('0x3e')][_0xfa7d('0x3f')],function(_0x2c5033){return{'name':_0x2c5033[_0xfa7d('0x40')],'type':_0x2c5033[_0xfa7d('0x41')][_0xfa7d('0x42')]};});_0x4e3345[_0xfa7d('0x43')]=_[_0xfa7d('0x3d')](_0x558beb,_0xfa7d('0x3a'));_0x4e3345[_0xfa7d('0x44')]=_[_0xfa7d('0x45')](_0x4f3ad8[_0xfa7d('0x44')]);_0x4e3345[_0xfa7d('0x46')]=_['intersection'](_0x4e3345[_0xfa7d('0x43')],_0x4e3345[_0xfa7d('0x44')]);_0x606ffe[_0xfa7d('0x47')]=_['intersection'](_0x4e3345[_0xfa7d('0x43')],qs['fields'](_0x4f3ad8[_0xfa7d('0x44')]['fields']));_0x606ffe['attributes']=_0x606ffe[_0xfa7d('0x47')][_0xfa7d('0x48')]?_0x606ffe['attributes']:_0x4e3345[_0xfa7d('0x43')];if(!_0x4f3ad8['query'][_0xfa7d('0x49')](_0xfa7d('0x4a'))){_0x606ffe[_0xfa7d('0x30')]=qs['limit'](_0x4f3ad8[_0xfa7d('0x44')][_0xfa7d('0x30')]);_0x606ffe['offset']=qs[_0xfa7d('0x2f')](_0x4f3ad8[_0xfa7d('0x44')][_0xfa7d('0x2f')]);}_0x606ffe[_0xfa7d('0x4b')]=qs['sort'](_0x4f3ad8['query'][_0xfa7d('0x4c')]);_0x606ffe[_0xfa7d('0x4d')]=qs['filters'](_[_0xfa7d('0x4e')](_0x4f3ad8[_0xfa7d('0x44')],_0x4e3345[_0xfa7d('0x46')]));if(_0x4f3ad8[_0xfa7d('0x44')][_0xfa7d('0x4f')]){_0x606ffe[_0xfa7d('0x4d')]=_[_0xfa7d('0x50')](_0x606ffe[_0xfa7d('0x4d')],{'$or':_[_0xfa7d('0x3d')](_0x558beb,function(_0x5d716a){if(_0x5d716a['type']!==_0xfa7d('0x51')){var _0x2666c7={};_0x2666c7[_0x5d716a[_0xfa7d('0x3a')]]={'$like':'%'+_0x4f3ad8[_0xfa7d('0x44')][_0xfa7d('0x4f')]+'%'};return _0x2666c7;}})});}_0x606ffe=_[_0xfa7d('0x50')]({},_0x606ffe,_0x4f3ad8['options']);var _0x531993={'where':_0x606ffe['where']};return db[_0xfa7d('0x3e')][_0xfa7d('0x52')](_0x531993)['then'](function(_0x256dff){_0x2c29dc['count']=_0x256dff;if(_0x4f3ad8[_0xfa7d('0x44')][_0xfa7d('0x53')]){_0x606ffe[_0xfa7d('0x54')]=[{'all':!![]}];}return db['Setting']['findAll'](_0x606ffe);})[_0xfa7d('0x36')](function(_0x5c7ac4){_0x2c29dc[_0xfa7d('0x55')]=_0x5c7ac4;return _0x2c29dc;})[_0xfa7d('0x36')](respondWithFilteredResult(_0x34268e,_0x606ffe))[_0xfa7d('0x2b')](handleError(_0x34268e,null));};exports['show']=function(_0xb3dcdf,_0x9f7305){var _0x1d09eb={'raw':![],'where':{'id':_0xb3dcdf['params']['id']}},_0x5cb19a={};_0x5cb19a['model']=_[_0xfa7d('0x45')](db[_0xfa7d('0x3e')]['rawAttributes']);_0x5cb19a[_0xfa7d('0x44')]=_[_0xfa7d('0x45')](_0xb3dcdf['query']);_0x5cb19a[_0xfa7d('0x46')]=_[_0xfa7d('0x56')](_0x5cb19a['model'],_0x5cb19a['query']);_0x1d09eb[_0xfa7d('0x47')]=_['intersection'](_0x5cb19a[_0xfa7d('0x43')],qs[_0xfa7d('0x57')](_0xb3dcdf[_0xfa7d('0x44')][_0xfa7d('0x57')]));_0x1d09eb['attributes']=_0x1d09eb['attributes'][_0xfa7d('0x48')]?_0x1d09eb[_0xfa7d('0x47')]:_0x5cb19a[_0xfa7d('0x43')];if(_0xb3dcdf[_0xfa7d('0x44')]['includeAll']){_0x1d09eb['include']=[{'all':!![]}];}_0x1d09eb=_['merge']({},_0x1d09eb,_0xb3dcdf['options']);return db[_0xfa7d('0x3e')][_0xfa7d('0x58')](_0x1d09eb)[_0xfa7d('0x36')](handleEntityNotFound(_0x9f7305,null))[_0xfa7d('0x36')](respondWithResult(_0x9f7305,null))['catch'](handleError(_0x9f7305,null));};exports[_0xfa7d('0x35')]=function(_0x11001e,_0x2e0590,_0x28e351){var _0x568281;return db['Setting'][_0xfa7d('0x58')]({'where':{'id':_0x11001e[_0xfa7d('0x59')]['id']}})[_0xfa7d('0x36')](handleEntityNotFound(_0x2e0590,null))[_0xfa7d('0x36')](saveUpdates(_0x11001e[_0xfa7d('0x5a')],null))[_0xfa7d('0x36')](function(_0xabcc36){if(_0xabcc36){_0x568281=_0xabcc36[_0xfa7d('0x5b')]({'plain':!![]});var _0x4bfa48=fs['readFileSync'](path[_0xfa7d('0x5c')](config[_0xfa7d('0x5d')],_0xfa7d('0x5e')),'utf8');var _0xb7ffda=ejs[_0xfa7d('0x5f')](_0x4bfa48,_0x568281);var _0x143c78=fs['readFileSync'](path[_0xfa7d('0x5c')](config[_0xfa7d('0x5d')],_0xfa7d('0x60')),_0xfa7d('0x61'));var _0x53fa83=ejs[_0xfa7d('0x5f')](_0x143c78,_0x568281);fs[_0xfa7d('0x62')](_0xfa7d('0x63'),_0xb7ffda);fs['writeFileSync'](_0xfa7d('0x64'),_0x53fa83);return respondWithRpcPromise(_0xfa7d('0x65'),_0xfa7d('0x35'),{'module':'res_stun_monitor.so'});}})[_0xfa7d('0x36')](function(){return respondWithRpcPromise('Reload',_0xfa7d('0x35'),{'module':_0xfa7d('0x66')});})[_0xfa7d('0x36')](function(){return _0x568281||null;})[_0xfa7d('0x36')](respondWithResult(_0x2e0590,null))[_0xfa7d('0x2b')](handleError(_0x2e0590,null));};exports[_0xfa7d('0x67')]=function(_0x4f0c48,_0x44249b,_0x146a28){if(_0x4f0c48[_0xfa7d('0x68')]&&_0x4f0c48[_0xfa7d('0x68')][_0xfa7d('0x69')]){_0x4f0c48['body'][_0xfa7d('0x6a')]=_0x4f0c48['file'][_0xfa7d('0x69')];}return db[_0xfa7d('0x3e')][_0xfa7d('0x58')]({'where':{'id':_0x4f0c48['params']['id']}})[_0xfa7d('0x36')](handleEntityNotFound(_0x44249b,null))[_0xfa7d('0x36')](saveUpdates(_0x4f0c48[_0xfa7d('0x5a')],null))['then'](respondWithResult(_0x44249b,null))[_0xfa7d('0x2b')](handleError(_0x44249b,null));};exports[_0xfa7d('0x6b')]=function(_0x445825,_0x463faa,_0x2ff4dd){if(_0x445825[_0xfa7d('0x68')]&&_0x445825[_0xfa7d('0x68')][_0xfa7d('0x69')]){_0x445825[_0xfa7d('0x5a')][_0xfa7d('0x6c')]=_0x445825[_0xfa7d('0x68')][_0xfa7d('0x69')];}return db[_0xfa7d('0x3e')]['find']({'where':{'id':_0x445825['params']['id']}})['then'](handleEntityNotFound(_0x463faa,null))['then'](saveUpdates(_0x445825[_0xfa7d('0x5a')],null))[_0xfa7d('0x36')](respondWithResult(_0x463faa,null))['catch'](handleError(_0x463faa,null));};var utilLicense=require(_0xfa7d('0x6d'));exports[_0xfa7d('0x6e')]=function(_0x130c3f,_0x5ece00,_0x66f3bd){var _0x181de3=_0xfa7d('0x6f');var _0x2e873b={'custom':![]};return utilLicense['getLicense']()[_0xfa7d('0x36')](function(_0x38febc){if(_0x38febc){_0x2e873b=_0x38febc;}return db[_0xfa7d('0x3e')][_0xfa7d('0x58')]({'where':{'id':_0x130c3f[_0xfa7d('0x59')]['id']},'attributes':[_0xfa7d('0x6a'),'loginLogo',_0xfa7d('0x70'),_0xfa7d('0x71'),_0xfa7d('0x72'),_0xfa7d('0x73'),_0xfa7d('0x74'),_0xfa7d('0x75')],'raw':!![]});})[_0xfa7d('0x36')](handleEntityNotFound(_0x5ece00,null))[_0xfa7d('0x36')](function(_0xe2bc97){if(_0xe2bc97){var _0x1ada9d=_0xe2bc97['logo']&&fs[_0xfa7d('0x76')](path[_0xfa7d('0x5c')](config[_0xfa7d('0x5d')],_0x181de3,_['toLower'](_0xe2bc97[_0xfa7d('0x6a')])))?path[_0xfa7d('0x5c')](config[_0xfa7d('0x5d')],_0x181de3,_[_0xfa7d('0x77')](_0xe2bc97[_0xfa7d('0x6a')])):path['join'](config[_0xfa7d('0x5d')],_0x181de3,_['toLower'](_0xfa7d('0x78')));var _0x5f912c=_0xfa7d('0x79')+_['upperFirst'](_0xfa7d('0x6a'));if(_0xe2bc97[_0x5f912c]||!_0x2e873b[_0xfa7d('0x7a')]){_0x1ada9d=path['join'](config[_0xfa7d('0x5d')],_0x181de3,_[_0xfa7d('0x77')](_0xfa7d('0x78')));}if(!fs['existsSync'](_0x1ada9d)){throw new db[(_0xfa7d('0x1d'))][(_0xfa7d('0x1e'))](_[_0xfa7d('0x7b')](_0xfa7d('0x6a'))+_0xfa7d('0x7c'));}return _0x5ece00[_0xfa7d('0x7d')](_0x1ada9d);}})[_0xfa7d('0x2b')](handleError(_0x5ece00,null));};var utilLicense=require('../../config/license/util');exports[_0xfa7d('0x7e')]=function(_0x59094c,_0x3d0068,_0x581655){var _0x368375=_0xfa7d('0x6f');var _0x4e9888={'custom':![]};return utilLicense[_0xfa7d('0x7f')]()[_0xfa7d('0x36')](function(_0x5778b2){if(_0x5778b2){_0x4e9888=_0x5778b2;}return db[_0xfa7d('0x3e')][_0xfa7d('0x58')]({'where':{'id':_0x59094c[_0xfa7d('0x59')]['id']},'attributes':[_0xfa7d('0x6a'),'loginLogo','preferred','favicon',_0xfa7d('0x72'),_0xfa7d('0x73'),'defaultPreferred',_0xfa7d('0x75')],'raw':!![]});})[_0xfa7d('0x36')](handleEntityNotFound(_0x3d0068,null))[_0xfa7d('0x36')](function(_0x2698e9){if(_0x2698e9){var _0x4cea13=_0x2698e9[_0xfa7d('0x6c')]&&fs['existsSync'](path[_0xfa7d('0x5c')](config['root'],_0x368375,_['toLower'](_0x2698e9[_0xfa7d('0x6c')])))?path[_0xfa7d('0x5c')](config['root'],_0x368375,_[_0xfa7d('0x77')](_0x2698e9[_0xfa7d('0x6c')])):path[_0xfa7d('0x5c')](config['root'],_0x368375,_[_0xfa7d('0x77')](_0xfa7d('0x80')));var _0x30bf81=_0xfa7d('0x79')+_[_0xfa7d('0x7b')](_0xfa7d('0x6c'));if(_0x2698e9[_0x30bf81]||!_0x4e9888['custom']){_0x4cea13=path[_0xfa7d('0x5c')](config[_0xfa7d('0x5d')],_0x368375,_[_0xfa7d('0x77')](_0xfa7d('0x80')));}if(!fs['existsSync'](_0x4cea13)){throw new db[(_0xfa7d('0x1d'))]['ValidationError'](_['upperFirst']('loginLogo')+_0xfa7d('0x7c'));}return _0x3d0068[_0xfa7d('0x7d')](_0x4cea13);}})[_0xfa7d('0x2b')](handleError(_0x3d0068,null));};exports[_0xfa7d('0x81')]=function(_0x2562c1,_0x1fb618){return db[_0xfa7d('0x3e')][_0xfa7d('0x58')]({'where':{'id':_0x2562c1[_0xfa7d('0x59')]['id']},'attributes':[_0xfa7d('0x82')]})[_0xfa7d('0x36')](respondWithResult(_0x1fb618,null))[_0xfa7d('0x2b')](handleError(_0x1fb618,null));};exports['addPreferred']=function(_0x3699a8,_0x2a9c4e,_0x13f608){if(_0x3699a8[_0xfa7d('0x68')]&&_0x3699a8[_0xfa7d('0x68')][_0xfa7d('0x69')]){_0x3699a8['body'][_0xfa7d('0x70')]=_0x3699a8[_0xfa7d('0x68')][_0xfa7d('0x69')];}return db[_0xfa7d('0x3e')][_0xfa7d('0x58')]({'where':{'id':_0x3699a8['params']['id']}})['then'](handleEntityNotFound(_0x2a9c4e,null))[_0xfa7d('0x36')](saveUpdates(_0x3699a8[_0xfa7d('0x5a')],null))[_0xfa7d('0x36')](respondWithResult(_0x2a9c4e,null))['catch'](handleError(_0x2a9c4e,null));};var utilLicense=require(_0xfa7d('0x6d'));exports[_0xfa7d('0x83')]=function(_0x295b27,_0x13e9c3,_0x2373b2){var _0xab5641=_0xfa7d('0x6f');var _0x24fb50={'custom':![]};return utilLicense[_0xfa7d('0x7f')]()[_0xfa7d('0x36')](function(_0x11ef76){if(_0x11ef76){_0x24fb50=_0x11ef76;}return db[_0xfa7d('0x3e')]['find']({'where':{'id':_0x295b27[_0xfa7d('0x59')]['id']},'attributes':[_0xfa7d('0x6a'),_0xfa7d('0x6c'),_0xfa7d('0x70'),_0xfa7d('0x71'),_0xfa7d('0x72'),_0xfa7d('0x73'),'defaultPreferred','defaultFavicon'],'raw':!![]});})[_0xfa7d('0x36')](handleEntityNotFound(_0x13e9c3,null))[_0xfa7d('0x36')](function(_0x42df71){if(_0x42df71){var _0x43162f=_0x42df71[_0xfa7d('0x70')]&&fs[_0xfa7d('0x76')](path[_0xfa7d('0x5c')](config[_0xfa7d('0x5d')],_0xab5641,_['toLower'](_0x42df71[_0xfa7d('0x70')])))?path[_0xfa7d('0x5c')](config[_0xfa7d('0x5d')],_0xab5641,_['toLower'](_0x42df71[_0xfa7d('0x70')])):path['join'](config[_0xfa7d('0x5d')],_0xab5641,_[_0xfa7d('0x77')](_0xfa7d('0x84')));var _0x4795ed=_0xfa7d('0x79')+_[_0xfa7d('0x7b')](_0xfa7d('0x70'));if(_0x42df71[_0x4795ed]||!_0x24fb50[_0xfa7d('0x7a')]||!_0x24fb50['preferred']){_0x43162f=path[_0xfa7d('0x5c')](config['root'],_0xab5641,_[_0xfa7d('0x77')](_0xfa7d('0x84')));}if(!fs['existsSync'](_0x43162f)){throw new db[(_0xfa7d('0x1d'))][(_0xfa7d('0x1e'))](_[_0xfa7d('0x7b')](_0xfa7d('0x70'))+'\x20not\x20found');}return _0x13e9c3[_0xfa7d('0x7d')](_0x43162f);}})[_0xfa7d('0x2b')](handleError(_0x13e9c3,null));};exports['addFavicon']=function(_0x307130,_0x4c39be,_0x406f2b){if(_0x307130[_0xfa7d('0x68')]&&_0x307130['file'][_0xfa7d('0x69')]){_0x307130[_0xfa7d('0x5a')][_0xfa7d('0x71')]=_0x307130['file'][_0xfa7d('0x69')];}return db[_0xfa7d('0x3e')][_0xfa7d('0x58')]({'where':{'id':_0x307130[_0xfa7d('0x59')]['id']}})['then'](handleEntityNotFound(_0x4c39be,null))[_0xfa7d('0x36')](saveUpdates(_0x307130[_0xfa7d('0x5a')],null))[_0xfa7d('0x36')](respondWithResult(_0x4c39be,null))[_0xfa7d('0x2b')](handleError(_0x4c39be,null));};var utilLicense=require(_0xfa7d('0x6d'));exports[_0xfa7d('0x85')]=function(_0x4c6a24,_0x276bf4,_0x1b6e5f){var _0x520861=_0xfa7d('0x6f');var _0x5f5605={'custom':![]};return utilLicense[_0xfa7d('0x7f')]()['then'](function(_0x25109b){if(_0x25109b){_0x5f5605=_0x25109b;}return db[_0xfa7d('0x3e')]['find']({'where':{'id':_0x4c6a24[_0xfa7d('0x59')]['id']},'attributes':[_0xfa7d('0x6a'),_0xfa7d('0x6c'),_0xfa7d('0x70'),_0xfa7d('0x71'),_0xfa7d('0x72'),_0xfa7d('0x73'),_0xfa7d('0x74'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x276bf4,null))['then'](function(_0x45afc4){if(_0x45afc4){var _0x882354=_0x45afc4[_0xfa7d('0x71')]&&fs[_0xfa7d('0x76')](path[_0xfa7d('0x5c')](config[_0xfa7d('0x5d')],_0x520861,_['toLower'](_0x45afc4[_0xfa7d('0x71')])))?path[_0xfa7d('0x5c')](config[_0xfa7d('0x5d')],_0x520861,_[_0xfa7d('0x77')](_0x45afc4[_0xfa7d('0x71')])):path[_0xfa7d('0x5c')](config[_0xfa7d('0x5d')],_0x520861,_['toLower']('default_favicon.ico'));var _0x5cecb8='default'+_['upperFirst'](_0xfa7d('0x71'));if(_0x45afc4[_0x5cecb8]||!_0x5f5605[_0xfa7d('0x7a')]){_0x882354=path[_0xfa7d('0x5c')](config['root'],_0x520861,_[_0xfa7d('0x77')](_0xfa7d('0x86')));}if(!fs[_0xfa7d('0x76')](_0x882354)){throw new db[(_0xfa7d('0x1d'))][(_0xfa7d('0x1e'))](_[_0xfa7d('0x7b')](_0xfa7d('0x71'))+_0xfa7d('0x7c'));}return _0x276bf4[_0xfa7d('0x7d')](_0x882354);}})['catch'](handleError(_0x276bf4,null));}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index b8729ea..07f6bf5 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 _0xfba4=['bluebird','path','exports','settings','lodash','util','../../config/logger','api'];(function(_0x174062,_0x1ff0a4){var _0x24452b=function(_0x26b1ec){while(--_0x26b1ec){_0x174062['push'](_0x174062['shift']());}};_0x24452b(++_0x1ff0a4);}(_0xfba4,0x18c));var _0x4fba=function(_0x255ac0,_0x3f6645){_0x255ac0=_0x255ac0-0x0;var _0x437bf1=_0xfba4[_0x255ac0];return _0x437bf1;};'use strict';var _=require(_0x4fba('0x0'));var util=require(_0x4fba('0x1'));var logger=require(_0x4fba('0x2'))(_0x4fba('0x3'));var moment=require('moment');var BPromise=require(_0x4fba('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4fba('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./setting.attributes');module[_0x4fba('0x6')]=function(_0x122bb5,_0x1e7e4a){return _0x122bb5['define']('Setting',attributes,{'tableName':_0x4fba('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4214=['moment','bluebird','path','rimraf','./setting.attributes','exports','define','settings','lodash','util','api'];(function(_0x3d4876,_0x366386){var _0x58ca9d=function(_0x5bd045){while(--_0x5bd045){_0x3d4876['push'](_0x3d4876['shift']());}};_0x58ca9d(++_0x366386);}(_0x4214,0x1ec));var _0x4421=function(_0x32ab72,_0x47dd1b){_0x32ab72=_0x32ab72-0x0;var _0x83eea5=_0x4214[_0x32ab72];return _0x83eea5;};'use strict';var _=require(_0x4421('0x0'));var util=require(_0x4421('0x1'));var logger=require('../../config/logger')(_0x4421('0x2'));var moment=require(_0x4421('0x3'));var BPromise=require(_0x4421('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4421('0x5'));var rimraf=require(_0x4421('0x6'));var config=require('../../config/environment');var attributes=require(_0x4421('0x7'));module[_0x4421('0x8')]=function(_0x12875f,_0xee617){return _0x12875f[_0x4421('0x9')]('Setting',attributes,{'tableName':_0x4421('0xa'),'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 a3caf38..fa61727 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 _0x1615=['request\x20sent','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s'];(function(_0x19564e,_0x2217fe){var _0x2fa1c0=function(_0x167324){while(--_0x167324){_0x19564e['push'](_0x19564e['shift']());}};_0x2fa1c0(++_0x2217fe);}(_0x1615,0xa3));var _0x5161=function(_0x4d550a,_0x4ed1ea){_0x4d550a=_0x4d550a-0x0;var _0x1ce688=_0x1615[_0x4d550a];return _0x1ce688;};'use strict';var _=require(_0x5161('0x0'));var util=require(_0x5161('0x1'));var moment=require(_0x5161('0x2'));var BPromise=require(_0x5161('0x3'));var rs=require(_0x5161('0x4'));var fs=require('fs');var Redis=require(_0x5161('0x5'));var db=require(_0x5161('0x6'))['db'];var utils=require(_0x5161('0x7'));var logger=require(_0x5161('0x8'))(_0x5161('0x9'));var config=require(_0x5161('0xa'));var jayson=require(_0x5161('0xb'));var client=jayson[_0x5161('0xc')][_0x5161('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x27aca3,_0x42e6f2,_0x20c3af){return new BPromise(function(_0x4eb71e,_0x1578cf){return client[_0x5161('0xe')](_0x27aca3,_0x20c3af)[_0x5161('0xf')](function(_0x229c17){logger['info'](_0x5161('0x10'),_0x42e6f2,'request\x20sent');logger[_0x5161('0x11')](_0x5161('0x12'),_0x42e6f2,_0x5161('0x13'),JSON[_0x5161('0x14')](_0x229c17));if(_0x229c17[_0x5161('0x15')]){if(_0x229c17['error']['code']===0x1f4){logger[_0x5161('0x15')]('Setting,\x20%s,\x20%s',_0x42e6f2,_0x229c17[_0x5161('0x15')][_0x5161('0x16')]);return _0x1578cf(_0x229c17[_0x5161('0x15')][_0x5161('0x16')]);}logger[_0x5161('0x15')]('Setting,\x20%s,\x20%s',_0x42e6f2,_0x229c17[_0x5161('0x15')][_0x5161('0x16')]);return _0x4eb71e(_0x229c17[_0x5161('0x15')][_0x5161('0x16')]);}else{logger[_0x5161('0x17')]('Setting,\x20%s,\x20%s',_0x42e6f2,'request\x20sent');_0x4eb71e(_0x229c17[_0x5161('0x18')]['message']);}})[_0x5161('0x19')](function(_0x30a31c){logger[_0x5161('0x15')](_0x5161('0x10'),_0x42e6f2,_0x30a31c);_0x1578cf(_0x30a31c);});});} \ No newline at end of file +var _0x8538=['http','request','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8538,0x11a));var _0x8853=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8538[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8853('0x0'));var BPromise=require('bluebird');var rs=require(_0x8853('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8853('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x8853('0x3'))(_0x8853('0x4'));var config=require(_0x8853('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8853('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x11f3c2,_0x4927fc,_0x29618a){return new BPromise(function(_0x3c63c4,_0x59bc77){return client[_0x8853('0x7')](_0x11f3c2,_0x29618a)['then'](function(_0x5e17f8){logger['info'](_0x8853('0x8'),_0x4927fc,'request\x20sent');logger[_0x8853('0x9')](_0x8853('0xa'),_0x4927fc,_0x8853('0xb'),JSON[_0x8853('0xc')](_0x5e17f8));if(_0x5e17f8[_0x8853('0xd')]){if(_0x5e17f8[_0x8853('0xd')]['code']===0x1f4){logger[_0x8853('0xd')](_0x8853('0x8'),_0x4927fc,_0x5e17f8[_0x8853('0xd')][_0x8853('0xe')]);return _0x59bc77(_0x5e17f8['error'][_0x8853('0xe')]);}logger[_0x8853('0xd')](_0x8853('0x8'),_0x4927fc,_0x5e17f8[_0x8853('0xd')][_0x8853('0xe')]);return _0x3c63c4(_0x5e17f8[_0x8853('0xd')]['message']);}else{logger[_0x8853('0xf')]('Setting,\x20%s,\x20%s',_0x4927fc,_0x8853('0xb'));_0x3c63c4(_0x5e17f8[_0x8853('0x10')][_0x8853('0xe')]);}})[_0x8853('0x11')](function(_0xc8104d){logger[_0x8853('0xd')](_0x8853('0x8'),_0x4927fc,_0xc8104d);_0x59bc77(_0xc8104d);});});} \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index e11df3e..54c8a0d 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 _0x51ed=['/:id/users','addAgents','put','destroy','removeDispositions','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','/describe','/:id','show','/:id/dispositions','getDispositions','getApplications','getInteractions','statusGet','post','create','addDisposition','/:id/canned_answers','addAnswer','/:id/notify','notify','/:id/applications','addApplications','/:id/send','/:id/status','status'];(function(_0x132ea3,_0x40b0a3){var _0x4400bf=function(_0x526c36){while(--_0x526c36){_0x132ea3['push'](_0x132ea3['shift']());}};_0x4400bf(++_0x40b0a3);}(_0x51ed,0x12f));var _0xd51e=function(_0x577168,_0x1dec18){_0x577168=_0x577168-0x0;var _0x288c71=_0x51ed[_0x577168];return _0x288c71;};'use strict';var multer=require(_0xd51e('0x0'));var util=require(_0xd51e('0x1'));var path=require(_0xd51e('0x2'));var timeout=require(_0xd51e('0x3'));var express=require(_0xd51e('0x4'));var router=express[_0xd51e('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xd51e('0x6'));var config=require('../../config/environment');var controller=require(_0xd51e('0x7'));router[_0xd51e('0x8')]('/',auth[_0xd51e('0x9')](),controller['index']);router[_0xd51e('0x8')](_0xd51e('0xa'),auth[_0xd51e('0x9')](),controller['describe']);router[_0xd51e('0x8')](_0xd51e('0xb'),auth[_0xd51e('0x9')](),controller[_0xd51e('0xc')]);router[_0xd51e('0x8')](_0xd51e('0xd'),auth[_0xd51e('0x9')](),controller[_0xd51e('0xe')]);router['get']('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router[_0xd51e('0x8')]('/:id/applications',auth[_0xd51e('0x9')](),controller[_0xd51e('0xf')]);router[_0xd51e('0x8')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xd51e('0x10')]);router[_0xd51e('0x8')]('/:id/status',controller[_0xd51e('0x11')]);router[_0xd51e('0x8')]('/:id/users',auth[_0xd51e('0x9')](),controller['getAgents']);router[_0xd51e('0x12')]('/',auth[_0xd51e('0x9')](),controller[_0xd51e('0x13')]);router[_0xd51e('0x12')](_0xd51e('0xd'),auth['isAuthenticated'](),controller[_0xd51e('0x14')]);router[_0xd51e('0x12')](_0xd51e('0x15'),auth['isAuthenticated'](),controller[_0xd51e('0x16')]);router['post'](_0xd51e('0x17'),controller[_0xd51e('0x18')]);router['post'](_0xd51e('0x19'),auth[_0xd51e('0x9')](),controller[_0xd51e('0x1a')]);router[_0xd51e('0x12')](_0xd51e('0x1b'),auth[_0xd51e('0x9')](),controller['send']);router[_0xd51e('0x12')](_0xd51e('0x1c'),controller[_0xd51e('0x1d')]);router[_0xd51e('0x12')](_0xd51e('0x1e'),auth[_0xd51e('0x9')](),controller[_0xd51e('0x1f')]);router[_0xd51e('0x20')]('/:id',auth[_0xd51e('0x9')](),controller['update']);router['delete'](_0xd51e('0xb'),auth[_0xd51e('0x9')](),controller[_0xd51e('0x21')]);router['delete'](_0xd51e('0xd'),auth[_0xd51e('0x9')](),controller[_0xd51e('0x22')]);router['delete'](_0xd51e('0x15'),auth[_0xd51e('0x9')](),controller['removeAnswers']);router[_0xd51e('0x23')]('/:id/users',auth[_0xd51e('0x9')](),controller['removeAgents']);module[_0xd51e('0x24')]=router; \ No newline at end of file +var _0x575f=['/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','create','post','addDisposition','addAnswer','notify','/:id/applications','addApplications','/:id/send','addAgents','update','removeDispositions','removeAnswers','delete','removeAgents','multer','util','express','../../components/auth/service','../../config/environment','./smsAccount.controller','isAuthenticated','index','get','/describe'];(function(_0x8242a3,_0x2b67dd){var _0x25299e=function(_0x47cc7d){while(--_0x47cc7d){_0x8242a3['push'](_0x8242a3['shift']());}};_0x25299e(++_0x2b67dd);}(_0x575f,0x1bd));var _0xf575=function(_0x66f346,_0x2d4baa){_0x66f346=_0x66f346-0x0;var _0x32c1b5=_0x575f[_0x66f346];return _0x32c1b5;};'use strict';var multer=require(_0xf575('0x0'));var util=require(_0xf575('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf575('0x2'));var router=express['Router']();var auth=require(_0xf575('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xf575('0x4'));var controller=require(_0xf575('0x5'));router['get']('/',auth[_0xf575('0x6')](),controller[_0xf575('0x7')]);router[_0xf575('0x8')](_0xf575('0x9'),auth[_0xf575('0x6')](),controller['describe']);router[_0xf575('0x8')](_0xf575('0xa'),auth['isAuthenticated'](),controller[_0xf575('0xb')]);router[_0xf575('0x8')](_0xf575('0xc'),auth[_0xf575('0x6')](),controller[_0xf575('0xd')]);router[_0xf575('0x8')](_0xf575('0xe'),auth['isAuthenticated'](),controller[_0xf575('0xf')]);router[_0xf575('0x8')]('/:id/applications',auth[_0xf575('0x6')](),controller['getApplications']);router[_0xf575('0x8')](_0xf575('0x10'),auth[_0xf575('0x6')](),controller[_0xf575('0x11')]);router[_0xf575('0x8')](_0xf575('0x12'),controller[_0xf575('0x13')]);router[_0xf575('0x8')](_0xf575('0x14'),auth[_0xf575('0x6')](),controller['getAgents']);router['post']('/',auth[_0xf575('0x6')](),controller[_0xf575('0x15')]);router[_0xf575('0x16')](_0xf575('0xc'),auth[_0xf575('0x6')](),controller[_0xf575('0x17')]);router[_0xf575('0x16')]('/:id/canned_answers',auth[_0xf575('0x6')](),controller[_0xf575('0x18')]);router['post']('/:id/notify',controller[_0xf575('0x19')]);router['post'](_0xf575('0x1a'),auth['isAuthenticated'](),controller[_0xf575('0x1b')]);router['post'](_0xf575('0x1c'),auth[_0xf575('0x6')](),controller['send']);router[_0xf575('0x16')]('/:id/status',controller['status']);router[_0xf575('0x16')](_0xf575('0x14'),auth[_0xf575('0x6')](),controller[_0xf575('0x1d')]);router['put']('/:id',auth[_0xf575('0x6')](),controller[_0xf575('0x1e')]);router['delete'](_0xf575('0xa'),auth[_0xf575('0x6')](),controller['destroy']);router['delete'](_0xf575('0xc'),auth[_0xf575('0x6')](),controller[_0xf575('0x1f')]);router['delete'](_0xf575('0xe'),auth[_0xf575('0x6')](),controller[_0xf575('0x20')]);router[_0xf575('0x21')](_0xf575('0x14'),auth[_0xf575('0x6')](),controller[_0xf575('0x22')]);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 58865bb..1c7a060 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 _0x11a8=['infobip','ENUM','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','randomstring','exports','STRING','twilio','skebby','connectel','plivo','clickatell','csc'];(function(_0x1bfb31,_0x57a4c6){var _0x15136f=function(_0x3cc7a1){while(--_0x3cc7a1){_0x1bfb31['push'](_0x1bfb31['shift']());}};_0x15136f(++_0x57a4c6);}(_0x11a8,0xab));var _0x811a=function(_0x3c53bf,_0x43f522){_0x3c53bf=_0x3c53bf-0x0;var _0x55ebb6=_0x11a8[_0x3c53bf];return _0x55ebb6;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x811a('0x0'));module[_0x811a('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x811a('0x2')]},'type':{'type':Sequelize['ENUM'](_0x811a('0x3'),_0x811a('0x4'),_0x811a('0x5'),'clicksend',_0x811a('0x6'),_0x811a('0x7'),_0x811a('0x8'),_0x811a('0x9'),'intelepeer')},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0x811a('0x2')]},'authToken':{'type':Sequelize[_0x811a('0x2')]},'smsMethod':{'type':Sequelize[_0x811a('0xa')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0x811a('0x2')]},'deliveryReport':{'type':Sequelize[_0x811a('0xb')],'defaultValue':![]},'description':{'type':Sequelize[_0x811a('0x2')]},'notificationTemplate':{'type':Sequelize[_0x811a('0xc')],'defaultValue':function(){return _0x811a('0xd');}},'notificationSound':{'type':Sequelize[_0x811a('0xb')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x811a('0xb')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x811a('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x811a('0xb')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x811a('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x811a('0xb')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x811a('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x811a('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x811a('0xe')],'comment':_0x811a('0xf')},'mandatoryDisposition':{'type':Sequelize[_0x811a('0xb')],'defaultValue':![],'comment':_0x811a('0x10'),'set':function(_0x3ec25f){if(!_0x3ec25f)this['setDataValue'](_0x811a('0x11'),null);this[_0x811a('0x12')](_0x811a('0x13'),_0x3ec25f);}}}; \ No newline at end of file +var _0x5ff6=['mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','twilio','skebby','connectel','plivo','clickatell','infobip','intelepeer','ENUM','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'];(function(_0xae1a83,_0x1980d4){var _0xdb9da8=function(_0x36fc99){while(--_0x36fc99){_0xae1a83['push'](_0xae1a83['shift']());}};_0xdb9da8(++_0x1980d4);}(_0x5ff6,0x18d));var _0x65ff=function(_0x523b49,_0x4946a1){_0x523b49=_0x523b49-0x0;var _0x1d8470=_0x5ff6[_0x523b49];return _0x1d8470;};'use strict';var Sequelize=require(_0x65ff('0x0'));var rs=require(_0x65ff('0x1'));module[_0x65ff('0x2')]={'name':{'type':Sequelize[_0x65ff('0x3')],'unique':_0x65ff('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x65ff('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x65ff('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x65ff('0x3')],'defaultValue':function(){return rs[_0x65ff('0x5')]();}},'phone':{'type':Sequelize[_0x65ff('0x3')]},'type':{'type':Sequelize['ENUM'](_0x65ff('0x6'),_0x65ff('0x7'),_0x65ff('0x8'),'clicksend',_0x65ff('0x9'),_0x65ff('0xa'),'csc',_0x65ff('0xb'),_0x65ff('0xc'))},'accountSid':{'type':Sequelize[_0x65ff('0x3')]},'authId':{'type':Sequelize[_0x65ff('0x3')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0x65ff('0xd')]('SI','TI','GP')},'username':{'type':Sequelize[_0x65ff('0x3')]},'password':{'type':Sequelize[_0x65ff('0x3')]},'apiKey':{'type':Sequelize[_0x65ff('0x3')]},'senderString':{'type':Sequelize[_0x65ff('0x3')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x65ff('0xe')],'defaultValue':function(){return _0x65ff('0xf');}},'notificationSound':{'type':Sequelize[_0x65ff('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x65ff('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x65ff('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x65ff('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x65ff('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x65ff('0x11')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x65ff('0x10')],'defaultValue':![],'comment':_0x65ff('0x12'),'set':function(_0x332f2a){if(!_0x332f2a)this['setDataValue'](_0x65ff('0x13'),null);this[_0x65ff('0x14')](_0x65ff('0x15'),_0x332f2a);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 422e39c..cac97a2 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 _0x4137=['skebby_dispatch_id','requestid','statusInt','clicksend','status_code','results','groupName','DELIVERED','clickatell','redif','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','state','message-id','addAgents','emit','userSmsAccount:save','removeAgents','userSmsAccount:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','register','jayson/promise','http','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~!@#$%^&-_=+[{]}.','then','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','sendStatus','status','end','json','count','offset','limit','set','apply','save','update','get','destroy','stack','name','send','index','Pause','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','includeAll','include','SmsAccount','findAll','rows','catch','params','rawAttributes','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsAccounts','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','body','mandatoryDispositionPause','describe','addDisposition','Disposition','getDispositions','findOne','nolimit','removeDispositions','addAnswer','SmsAccountId','CannedAnswer','getAnswers','removeAnswers','ids','SmsApplication','Applications','account','orderBy','priority','CmContact','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','type','twilio','from','From','Body','messageId','MessageSid','skebby','text','connectel','message_id','plivo','Text','MessageUUID','infobip','csc','originatingAddress','segmentedMessage','fromNumber','replyMessageId','intelepeer','refid','ValidationError','isNil','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','ListId','Contacts','DESC','list','omit','contact','SmsInteraction','interaction','created','autoclose','applications','close','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','agent','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','addApplications','transaction','findAndCountAll','getApplications','getInteractions','Contact','User','Owner','fullname','internal','Tags','tag','List','out','Messages','spread','dataValues','log','received\x20delivery\x20report\x20from','inspect'];(function(_0x1cc9d4,_0x37b366){var _0x42f386=function(_0x42bab2){while(--_0x42bab2){_0x1cc9d4['push'](_0x1cc9d4['shift']());}};_0x42f386(++_0x37b366);}(_0x4137,0xf8));var _0x7413=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x4137[_0x27af45];return _0x18df21;};'use strict';var pdf=require(_0x7413('0x0'));var emlformat=require(_0x7413('0x1'));var rimraf=require(_0x7413('0x2'));var zipdir=require(_0x7413('0x3'));var jsonpatch=require(_0x7413('0x4'));var rp=require(_0x7413('0x5'));var moment=require(_0x7413('0x6'));var BPromise=require(_0x7413('0x7'));var Mustache=require(_0x7413('0x8'));var util=require(_0x7413('0x9'));var path=require(_0x7413('0xa'));var sox=require(_0x7413('0xb'));var csv=require('to-csv');var ejs=require(_0x7413('0xc'));var fs=require('fs');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('0x11'));var querystring=require('querystring');var Papa=require(_0x7413('0x12'));var Redis=require(_0x7413('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x7413('0x14'));var as=require(_0x7413('0x15'));var hardwareService=require(_0x7413('0x16'));var logger=require(_0x7413('0x17'))(_0x7413('0x18'));var utils=require('../../config/utils');var config=require(_0x7413('0x19'));var db=require(_0x7413('0x1a'))['db'];config['redis']=_[_0x7413('0x1b')](config[_0x7413('0x1c')],{'host':_0x7413('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsAccount.socket')[_0x7413('0x1e')](socket);var jayson=require(_0x7413('0x1f'));var client=jayson['client'][_0x7413('0x20')]({'port':0x232c});function checkPasswordPattern(_0x45bef0,_0x4955d3,_0x38b3d1){if(_0x38b3d1){var _0x50f301=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x50f301['test'](_0x4955d3)){return _0x45bef0;}else{throw new db[(_0x7413('0x21'))]['ValidationError'](_0x7413('0x22'));}}else{return _0x45bef0;}}function respondWithRpcPromise(_0x538862,_0x2036b6,_0x3230d8,_0x19157f){return new BPromise(function(_0x12a01e,_0x2a3417){var _0x26dafe=_0x19157f||client;return _0x26dafe['request'](_0x538862,_0x3230d8)[_0x7413('0x23')](function(_0x17c062){logger[_0x7413('0x24')](_0x7413('0x25'),_0x2036b6,'request\x20sent');logger[_0x7413('0x26')](_0x7413('0x27'),_0x2036b6,_0x7413('0x28'),JSON[_0x7413('0x29')](_0x17c062));if(_0x17c062[_0x7413('0x2a')]){if(_0x17c062[_0x7413('0x2a')][_0x7413('0x2b')]===0x1f4){logger[_0x7413('0x2a')]('SmsAccount,\x20%s,\x20%s',_0x2036b6,_0x17c062['error'][_0x7413('0x2c')]);return _0x2a3417(_0x17c062['error'][_0x7413('0x2c')]);}logger[_0x7413('0x2a')](_0x7413('0x25'),_0x2036b6,_0x17c062[_0x7413('0x2a')][_0x7413('0x2c')]);return _0x12a01e(_0x17c062[_0x7413('0x2a')][_0x7413('0x2c')]);}else{logger[_0x7413('0x24')](_0x7413('0x25'),_0x2036b6,'request\x20sent');_0x12a01e(_0x17c062['result'][_0x7413('0x2c')]);}})['catch'](function(_0x46c895){logger[_0x7413('0x2a')](_0x7413('0x25'),_0x2036b6,_0x46c895);_0x2a3417(_0x46c895);});});}function respondWithStatusCode(_0x4c2e90,_0x35e0fd){_0x35e0fd=_0x35e0fd||0xcc;return function(_0x896552){if(_0x896552){return _0x4c2e90[_0x7413('0x2d')](_0x35e0fd);}return _0x4c2e90[_0x7413('0x2e')](_0x35e0fd)[_0x7413('0x2f')]();};}function respondWithResult(_0x2e521f,_0x5eb4d9){_0x5eb4d9=_0x5eb4d9||0xc8;return function(_0x24dce7){if(_0x24dce7){return _0x2e521f['status'](_0x5eb4d9)[_0x7413('0x30')](_0x24dce7);}};}function respondWithFilteredResult(_0x23e682,_0xae2969){return function(_0x13a836){if(_0x13a836){var _0x25fa52=_0x13a836[_0x7413('0x31')],_0x2004ea=_0xae2969[_0x7413('0x32')],_0x5bb3ea=_0xae2969[_0x7413('0x32')]+_0xae2969[_0x7413('0x33')],_0x1ffb6f;if(_0x5bb3ea>=_0x25fa52){_0x5bb3ea=_0x25fa52;_0x1ffb6f=0xc8;}else{_0x1ffb6f=0xce;}_0x23e682[_0x7413('0x2e')](_0x1ffb6f);return _0x23e682[_0x7413('0x34')]('Content-Range',_0x2004ea+'-'+_0x5bb3ea+'/'+_0x25fa52)[_0x7413('0x30')](_0x13a836);}return null;};}function patchUpdates(_0x155235){return function(_0x41c7db){try{jsonpatch[_0x7413('0x35')](_0x41c7db,_0x155235,!![]);}catch(_0x14bf3b){return BPromise['reject'](_0x14bf3b);}return _0x41c7db[_0x7413('0x36')]();};}function saveUpdates(_0x537261,_0x3cc6c8){return function(_0x126d66){if(_0x126d66){return _0x126d66[_0x7413('0x37')](_0x537261)['then'](function(_0xe6b096){return _0xe6b096;});}return null;};}function removeEntity(_0x487dc8,_0x29e30a){return function(_0x31c174){if(_0x31c174){return _0x31c174['destroy']()['then'](function(){var _0x440bfe=_0x31c174[_0x7413('0x38')]({'plain':!![]});var _0x14da59='SmsAccounts';return db['UserProfileResource'][_0x7413('0x39')]({'where':{'type':_0x14da59,'resourceId':_0x440bfe['id']}})['then'](function(){return _0x31c174;});})['then'](function(){_0x487dc8[_0x7413('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ad12d,_0x28090c){return function(_0xf34b21){if(!_0xf34b21){_0x3ad12d[_0x7413('0x2d')](0x194);}return _0xf34b21;};}function handleError(_0x1acc14,_0x5142a1){_0x5142a1=_0x5142a1||0x1f4;return function(_0xa58bd2){logger[_0x7413('0x2a')](_0xa58bd2[_0x7413('0x3a')]);if(_0xa58bd2[_0x7413('0x3b')]){delete _0xa58bd2[_0x7413('0x3b')];}_0x1acc14[_0x7413('0x2e')](_0x5142a1)[_0x7413('0x3c')](_0xa58bd2);};}exports[_0x7413('0x3d')]=function(_0x5993d,_0x26a241){var _0x5c03eb={'include':[{'model':db[_0x7413('0x3e')],'as':'mandatoryDispositionPause'}]},_0x320c61={},_0x5a9791={'count':0x0,'rows':[]};var _0x56cb6f=_['map'](db['SmsAccount']['rawAttributes'],function(_0x44af7d){return{'name':_0x44af7d['fieldName'],'type':_0x44af7d['type'][_0x7413('0x3f')]};});_0x320c61['model']=_['map'](_0x56cb6f,_0x7413('0x3b'));_0x320c61[_0x7413('0x40')]=_[_0x7413('0x41')](_0x5993d[_0x7413('0x40')]);_0x320c61[_0x7413('0x42')]=_['intersection'](_0x320c61[_0x7413('0x43')],_0x320c61['query']);_0x5c03eb[_0x7413('0x44')]=_[_0x7413('0x45')](_0x320c61[_0x7413('0x43')],qs[_0x7413('0x46')](_0x5993d[_0x7413('0x40')][_0x7413('0x46')]));_0x5c03eb[_0x7413('0x44')]=_0x5c03eb[_0x7413('0x44')][_0x7413('0x47')]?_0x5c03eb[_0x7413('0x44')]:_0x320c61[_0x7413('0x43')];if(!_0x5993d[_0x7413('0x40')][_0x7413('0x48')]('nolimit')){_0x5c03eb[_0x7413('0x33')]=qs[_0x7413('0x33')](_0x5993d[_0x7413('0x40')][_0x7413('0x33')]);_0x5c03eb[_0x7413('0x32')]=qs[_0x7413('0x32')](_0x5993d[_0x7413('0x40')][_0x7413('0x32')]);}_0x5c03eb[_0x7413('0x49')]=qs[_0x7413('0x4a')](_0x5993d[_0x7413('0x40')]['sort']);_0x5c03eb[_0x7413('0x4b')]=qs['filters'](_[_0x7413('0x4c')](_0x5993d[_0x7413('0x40')],_0x320c61[_0x7413('0x42')]));if(_0x5993d[_0x7413('0x40')][_0x7413('0x4d')]){_0x5c03eb[_0x7413('0x4b')]=_[_0x7413('0x4e')](_0x5c03eb[_0x7413('0x4b')],{'$or':_[_0x7413('0x4f')](_0x56cb6f,function(_0x3b4742){if(_0x3b4742['type']!=='VIRTUAL'){var _0x3c1f1a={};_0x3c1f1a[_0x3b4742['name']]={'$like':'%'+_0x5993d['query'][_0x7413('0x4d')]+'%'};return _0x3c1f1a;}})});}_0x5c03eb=_[_0x7413('0x4e')]({},_0x5c03eb,_0x5993d['options']);var _0x2aa12c={'where':_0x5c03eb['where']};return db['SmsAccount'][_0x7413('0x31')](_0x2aa12c)['then'](function(_0x24f54e){_0x5a9791[_0x7413('0x31')]=_0x24f54e;if(_0x5993d[_0x7413('0x40')][_0x7413('0x50')]){_0x5c03eb[_0x7413('0x51')]=[{'all':!![]}];}return db[_0x7413('0x52')][_0x7413('0x53')](_0x5c03eb);})[_0x7413('0x23')](function(_0x66795){_0x5a9791[_0x7413('0x54')]=_0x66795;return _0x5a9791;})['then'](respondWithFilteredResult(_0x26a241,_0x5c03eb))[_0x7413('0x55')](handleError(_0x26a241,null));};exports['show']=function(_0x5206d0,_0x482b29){var _0x3817ad={'raw':![],'where':{'id':_0x5206d0[_0x7413('0x56')]['id']},'include':[{'model':db[_0x7413('0x3e')],'as':'mandatoryDispositionPause'}]},_0x4299a3={};_0x4299a3['model']=_[_0x7413('0x41')](db['SmsAccount'][_0x7413('0x57')]);_0x4299a3['query']=_['keys'](_0x5206d0['query']);_0x4299a3['filters']=_['intersection'](_0x4299a3[_0x7413('0x43')],_0x4299a3[_0x7413('0x40')]);_0x3817ad[_0x7413('0x44')]=_[_0x7413('0x45')](_0x4299a3[_0x7413('0x43')],qs['fields'](_0x5206d0[_0x7413('0x40')][_0x7413('0x46')]));_0x3817ad[_0x7413('0x44')]=_0x3817ad['attributes'][_0x7413('0x47')]?_0x3817ad['attributes']:_0x4299a3['model'];if(_0x5206d0[_0x7413('0x40')][_0x7413('0x50')]){_0x3817ad[_0x7413('0x51')]=[{'all':!![]}];}_0x3817ad=_[_0x7413('0x4e')]({},_0x3817ad,_0x5206d0[_0x7413('0x58')]);return db[_0x7413('0x52')]['find'](_0x3817ad)[_0x7413('0x23')](handleEntityNotFound(_0x482b29,null))['then'](respondWithResult(_0x482b29,null))[_0x7413('0x55')](handleError(_0x482b29,null));};exports['create']=function(_0x1ea50f,_0x4d4faa){return db[_0x7413('0x52')][_0x7413('0x59')](_0x1ea50f['body'],{})[_0x7413('0x23')](function(_0x549623){var _0xf01452=_0x1ea50f[_0x7413('0x5a')]['get']({'plain':!![]});if(!_0xf01452)throw new Error(_0x7413('0x5b'));if(_0xf01452[_0x7413('0x5c')]==='user'){var _0x3ce34c=_0x549623[_0x7413('0x38')]({'plain':!![]});var _0x4d181c=_0x7413('0x5d');return db[_0x7413('0x5e')][_0x7413('0x5f')]({'where':{'name':_0x4d181c,'userProfileId':_0xf01452[_0x7413('0x60')]},'raw':!![]})[_0x7413('0x23')](function(_0x6369a1){if(_0x6369a1&&_0x6369a1[_0x7413('0x61')]===0x0){return db[_0x7413('0x62')]['create']({'name':_0x3ce34c[_0x7413('0x3b')],'resourceId':_0x3ce34c['id'],'type':_0x6369a1['name'],'sectionId':_0x6369a1['id']},{})[_0x7413('0x23')](function(){return _0x549623;});}else{return _0x549623;}})[_0x7413('0x55')](function(_0x42f0a6){logger[_0x7413('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x42f0a6);throw _0x42f0a6;});}return _0x549623;})['then'](respondWithResult(_0x4d4faa,0xc9))['catch'](handleError(_0x4d4faa,null));};exports['update']=function(_0x5b5e42,_0x3c8316){if(_0x5b5e42[_0x7413('0x63')]['id']){delete _0x5b5e42[_0x7413('0x63')]['id'];}return db['SmsAccount'][_0x7413('0x5f')]({'where':{'id':_0x5b5e42[_0x7413('0x56')]['id']},'include':[{'model':db[_0x7413('0x3e')],'as':_0x7413('0x64')}]})[_0x7413('0x23')](handleEntityNotFound(_0x3c8316,null))[_0x7413('0x23')](saveUpdates(_0x5b5e42[_0x7413('0x63')],null))[_0x7413('0x23')](respondWithResult(_0x3c8316,null))[_0x7413('0x55')](handleError(_0x3c8316,null));};exports[_0x7413('0x39')]=function(_0x3f9cfd,_0x1264f3){return db[_0x7413('0x52')]['find']({'where':{'id':_0x3f9cfd[_0x7413('0x56')]['id']}})[_0x7413('0x23')](handleEntityNotFound(_0x1264f3,null))['then'](removeEntity(_0x1264f3,null))[_0x7413('0x55')](handleError(_0x1264f3,null));};exports[_0x7413('0x65')]=function(_0x521682,_0x5e4aa1){return db[_0x7413('0x52')][_0x7413('0x65')]()['then'](respondWithResult(_0x5e4aa1,null))[_0x7413('0x55')](handleError(_0x5e4aa1,null));};exports[_0x7413('0x66')]=function(_0x53ad15,_0xd056b1,_0x4ffcbc){if(_0x53ad15['body']['id']){delete _0x53ad15[_0x7413('0x63')]['id'];}return db[_0x7413('0x52')][_0x7413('0x5f')]({'where':{'id':_0x53ad15[_0x7413('0x56')]['id']}})[_0x7413('0x23')](handleEntityNotFound(_0xd056b1,null))[_0x7413('0x23')](function(_0x6171a9){if(_0x6171a9){_0x53ad15[_0x7413('0x63')]['SmsAccountId']=_0x6171a9['id'];return db[_0x7413('0x67')]['create'](_0x53ad15[_0x7413('0x63')]);}})[_0x7413('0x23')](respondWithResult(_0xd056b1,null))[_0x7413('0x55')](handleError(_0xd056b1,null));};exports[_0x7413('0x68')]=function(_0x2c4664,_0x29d919,_0x1d4ef5){var _0x46983f={'raw':![],'where':{}};var _0x2c504e={};var _0x50910a={'count':0x0,'rows':[]};return db[_0x7413('0x52')][_0x7413('0x69')]({'where':{'id':_0x2c4664['params']['id']}})[_0x7413('0x23')](handleEntityNotFound(_0x29d919,null))[_0x7413('0x23')](function(_0x599a91){if(_0x599a91){_0x2c504e[_0x7413('0x43')]=_['keys'](db[_0x7413('0x67')][_0x7413('0x57')]);_0x2c504e['query']=_['keys'](_0x2c4664[_0x7413('0x40')]);_0x2c504e[_0x7413('0x42')]=_[_0x7413('0x45')](_0x2c504e['model'],_0x2c504e[_0x7413('0x40')]);_0x46983f[_0x7413('0x44')]=_[_0x7413('0x45')](_0x2c504e[_0x7413('0x43')],qs[_0x7413('0x46')](_0x2c4664[_0x7413('0x40')]['fields']));_0x46983f[_0x7413('0x44')]=_0x46983f[_0x7413('0x44')][_0x7413('0x47')]?_0x46983f['attributes']:_0x2c504e[_0x7413('0x43')];if(!_0x2c4664[_0x7413('0x40')][_0x7413('0x48')](_0x7413('0x6a'))){_0x46983f[_0x7413('0x33')]=qs[_0x7413('0x33')](_0x2c4664[_0x7413('0x40')][_0x7413('0x33')]);_0x46983f[_0x7413('0x32')]=qs['offset'](_0x2c4664[_0x7413('0x40')][_0x7413('0x32')]);}_0x46983f[_0x7413('0x49')]=qs[_0x7413('0x4a')](_0x2c4664[_0x7413('0x40')][_0x7413('0x4a')]);_0x46983f['where']=qs[_0x7413('0x42')](_['pick'](_0x2c4664['query'],_0x2c504e[_0x7413('0x42')]));_0x46983f[_0x7413('0x4b')]['SmsAccountId']=_0x599a91['id'];if(_0x2c4664[_0x7413('0x40')][_0x7413('0x4d')]){_0x46983f[_0x7413('0x4b')]=_[_0x7413('0x4e')](_0x46983f[_0x7413('0x4b')],{'$or':_[_0x7413('0x4f')](_0x46983f[_0x7413('0x44')],function(_0x3413f2){var _0x5f4765={};_0x5f4765[_0x3413f2]={'$like':'%'+_0x2c4664[_0x7413('0x40')]['filter']+'%'};return _0x5f4765;})});}_0x46983f=_[_0x7413('0x4e')]({},_0x46983f,_0x2c4664[_0x7413('0x58')]);return db['Disposition'][_0x7413('0x31')]({'where':_0x46983f[_0x7413('0x4b')]})[_0x7413('0x23')](function(_0x300a17){_0x50910a[_0x7413('0x31')]=_0x300a17;if(_0x2c4664[_0x7413('0x40')][_0x7413('0x50')]){_0x46983f[_0x7413('0x51')]=[{'all':!![]}];}return db[_0x7413('0x67')][_0x7413('0x53')](_0x46983f);})['then'](function(_0x2a3d1c){_0x50910a[_0x7413('0x54')]=_0x2a3d1c;return _0x50910a;});}})['then'](respondWithFilteredResult(_0x29d919,_0x46983f))['catch'](handleError(_0x29d919,null));};exports['removeDispositions']=function(_0x29ac62,_0x521f0c,_0xf6faaa){return db[_0x7413('0x52')][_0x7413('0x5f')]({'where':{'id':_0x29ac62[_0x7413('0x56')]['id']}})[_0x7413('0x23')](handleEntityNotFound(_0x521f0c,null))[_0x7413('0x23')](function(_0xbba3c7){if(_0xbba3c7){return _0xbba3c7[_0x7413('0x6b')](_0x29ac62[_0x7413('0x40')]['ids']);}})[_0x7413('0x23')](respondWithStatusCode(_0x521f0c,null))[_0x7413('0x55')](handleError(_0x521f0c,null));};exports[_0x7413('0x6c')]=function(_0x4ea60e,_0x3b7a85,_0x3c3676){if(_0x4ea60e[_0x7413('0x63')]['id']){delete _0x4ea60e[_0x7413('0x63')]['id'];}return db[_0x7413('0x52')][_0x7413('0x5f')]({'where':{'id':_0x4ea60e[_0x7413('0x56')]['id']}})[_0x7413('0x23')](handleEntityNotFound(_0x3b7a85,null))[_0x7413('0x23')](function(_0xa31bf1){if(_0xa31bf1){_0x4ea60e['body'][_0x7413('0x6d')]=_0xa31bf1['id'];return db[_0x7413('0x6e')]['create'](_0x4ea60e[_0x7413('0x63')]);}})[_0x7413('0x23')](respondWithResult(_0x3b7a85,null))['catch'](handleError(_0x3b7a85,null));};exports[_0x7413('0x6f')]=function(_0x193d54,_0x230191,_0x47fbf0){var _0x36d8cf={'raw':![],'where':{}};var _0x5a44bd={};var _0x466ec8={'count':0x0,'rows':[]};return db[_0x7413('0x52')][_0x7413('0x69')]({'where':{'id':_0x193d54[_0x7413('0x56')]['id']}})[_0x7413('0x23')](handleEntityNotFound(_0x230191,null))[_0x7413('0x23')](function(_0x53e64f){if(_0x53e64f){_0x5a44bd[_0x7413('0x43')]=_[_0x7413('0x41')](db[_0x7413('0x6e')][_0x7413('0x57')]);_0x5a44bd[_0x7413('0x40')]=_['keys'](_0x193d54[_0x7413('0x40')]);_0x5a44bd[_0x7413('0x42')]=_[_0x7413('0x45')](_0x5a44bd[_0x7413('0x43')],_0x5a44bd[_0x7413('0x40')]);_0x36d8cf['attributes']=_['intersection'](_0x5a44bd[_0x7413('0x43')],qs[_0x7413('0x46')](_0x193d54[_0x7413('0x40')][_0x7413('0x46')]));_0x36d8cf['attributes']=_0x36d8cf['attributes'][_0x7413('0x47')]?_0x36d8cf[_0x7413('0x44')]:_0x5a44bd[_0x7413('0x43')];if(!_0x193d54['query']['hasOwnProperty'](_0x7413('0x6a'))){_0x36d8cf[_0x7413('0x33')]=qs[_0x7413('0x33')](_0x193d54[_0x7413('0x40')][_0x7413('0x33')]);_0x36d8cf[_0x7413('0x32')]=qs[_0x7413('0x32')](_0x193d54['query']['offset']);}_0x36d8cf[_0x7413('0x49')]=qs[_0x7413('0x4a')](_0x193d54['query'][_0x7413('0x4a')]);_0x36d8cf[_0x7413('0x4b')]=qs[_0x7413('0x42')](_[_0x7413('0x4c')](_0x193d54[_0x7413('0x40')],_0x5a44bd[_0x7413('0x42')]));_0x36d8cf[_0x7413('0x4b')][_0x7413('0x6d')]=_0x53e64f['id'];if(_0x193d54[_0x7413('0x40')]['filter']){_0x36d8cf[_0x7413('0x4b')]=_[_0x7413('0x4e')](_0x36d8cf[_0x7413('0x4b')],{'$or':_[_0x7413('0x4f')](_0x36d8cf[_0x7413('0x44')],function(_0x20ffaf){var _0x47ef50={};_0x47ef50[_0x20ffaf]={'$like':'%'+_0x193d54['query']['filter']+'%'};return _0x47ef50;})});}_0x36d8cf=_[_0x7413('0x4e')]({},_0x36d8cf,_0x193d54[_0x7413('0x58')]);return db[_0x7413('0x6e')][_0x7413('0x31')]({'where':_0x36d8cf[_0x7413('0x4b')]})[_0x7413('0x23')](function(_0x207293){_0x466ec8[_0x7413('0x31')]=_0x207293;if(_0x193d54['query'][_0x7413('0x50')]){_0x36d8cf['include']=[{'all':!![]}];}return db[_0x7413('0x6e')][_0x7413('0x53')](_0x36d8cf);})[_0x7413('0x23')](function(_0x266f8b){_0x466ec8[_0x7413('0x54')]=_0x266f8b;return _0x466ec8;});}})['then'](respondWithFilteredResult(_0x230191,_0x36d8cf))[_0x7413('0x55')](handleError(_0x230191,null));};exports[_0x7413('0x70')]=function(_0x1455b4,_0x145fcb,_0xf11f9b){return db[_0x7413('0x52')][_0x7413('0x5f')]({'where':{'id':_0x1455b4[_0x7413('0x56')]['id']}})[_0x7413('0x23')](handleEntityNotFound(_0x145fcb,null))[_0x7413('0x23')](function(_0x107192){if(_0x107192){return _0x107192[_0x7413('0x70')](_0x1455b4[_0x7413('0x40')][_0x7413('0x71')]);}})[_0x7413('0x23')](respondWithStatusCode(_0x145fcb,null))['catch'](handleError(_0x145fcb,null));};exports['notify']=function(_0x441816,_0xae889e,_0x591ee4){var _0x2144b3={'channel':'sms'};var _0x5e35ea=[];var _0x26536c=[];var _0x3b5ad6={};return db[_0x7413('0x52')][_0x7413('0x5f')]({'where':{'id':_0x441816[_0x7413('0x56')]['id']},'include':[{'model':db[_0x7413('0x72')],'as':_0x7413('0x73')}]})['then'](handleEntityNotFound(_0xae889e,null))[_0x7413('0x23')](function(_0x4c03be){_0x2144b3[_0x7413('0x74')]=_0x4c03be;_0x2144b3['applications']=_[_0x7413('0x75')](_0x4c03be[_0x7413('0x73')],[_0x7413('0x76')],['asc']);if(_0x2144b3[_0x7413('0x74')][_0x7413('0x73')]){delete _0x2144b3[_0x7413('0x74')][_0x7413('0x73')];}return db[_0x7413('0x77')][_0x7413('0x65')]();})['then'](function(_0x4f01f8){if(!_0x4f01f8){throw new db['Sequelize']['ValidationError'](_0x7413('0x78'));}_0x5e35ea=_[_0x7413('0x79')](_[_0x7413('0x41')](_0x4f01f8),['createdAt',_0x7413('0x7a')]);_0x26536c=_[_0x7413('0x79')](_[_0x7413('0x41')](_0x4f01f8),[_0x7413('0x7b'),_0x7413('0x7a'),_0x7413('0x7c'),'ListId']);_0x2144b3['body']={'mapKey':'mobile'};if(_0x2144b3[_0x7413('0x74')][_0x7413('0x7d')]){switch(_0x2144b3['account'][_0x7413('0x7d')]){case _0x7413('0x7e'):_0x2144b3[_0x7413('0x63')][_0x7413('0x7f')]=_0x441816['body'][_0x7413('0x80')];_0x2144b3[_0x7413('0x63')]['body']=_0x441816[_0x7413('0x63')][_0x7413('0x81')];_0x2144b3[_0x7413('0x63')][_0x7413('0x82')]=_0x441816['body'][_0x7413('0x83')];break;case _0x7413('0x84'):_0x2144b3['body'][_0x7413('0x7f')]='+'+_0x441816[_0x7413('0x63')]['sender'];_0x2144b3[_0x7413('0x63')]['body']=_0x441816[_0x7413('0x63')][_0x7413('0x85')];break;case _0x7413('0x86'):_0x2144b3[_0x7413('0x63')][_0x7413('0x7f')]=_0x441816[_0x7413('0x63')][_0x7413('0x7f')];_0x2144b3[_0x7413('0x63')]['body']=_0x441816[_0x7413('0x63')]['message'];break;case'clicksend':_0x2144b3[_0x7413('0x63')][_0x7413('0x7f')]=_0x441816['body'][_0x7413('0x7f')];_0x2144b3[_0x7413('0x63')][_0x7413('0x63')]=_0x441816[_0x7413('0x63')][_0x7413('0x63')];_0x2144b3[_0x7413('0x63')]['messageId']=_0x441816[_0x7413('0x63')][_0x7413('0x87')];break;case _0x7413('0x88'):_0x2144b3[_0x7413('0x63')]['from']=_0x441816[_0x7413('0x63')][_0x7413('0x80')];_0x2144b3['body'][_0x7413('0x63')]=_0x441816[_0x7413('0x63')][_0x7413('0x89')];_0x2144b3['body'][_0x7413('0x82')]=_0x441816[_0x7413('0x63')][_0x7413('0x8a')];break;case _0x7413('0x8b'):_0x2144b3[_0x7413('0x63')][_0x7413('0x7f')]='+'+_0x441816['body']['results'][0x0][_0x7413('0x7f')];_0x2144b3[_0x7413('0x63')][_0x7413('0x63')]=_0x441816[_0x7413('0x63')]['results'][0x0][_0x7413('0x85')];_0x2144b3[_0x7413('0x63')][_0x7413('0x82')]=_0x441816[_0x7413('0x63')]['results'][0x0]['messageId'];break;case _0x7413('0x8c'):_0x2144b3[_0x7413('0x63')]['from']=_0x441816[_0x7413('0x63')][_0x7413('0x8d')];_0x2144b3['body'][_0x7413('0x63')]=_0x441816[_0x7413('0x63')][_0x7413('0x8e')][_0x7413('0x2c')];break;case'clickatell':_0x2144b3['body']['from']=_0x441816['body'][_0x7413('0x8f')];_0x2144b3[_0x7413('0x63')][_0x7413('0x63')]=_0x441816[_0x7413('0x63')][_0x7413('0x85')];_0x2144b3[_0x7413('0x63')][_0x7413('0x82')]=_0x441816[_0x7413('0x63')][_0x7413('0x90')];break;case _0x7413('0x91'):_0x2144b3[_0x7413('0x63')]['from']=_0x441816['body']['from'];_0x2144b3[_0x7413('0x63')][_0x7413('0x63')]=_0x441816[_0x7413('0x63')]['message'];_0x2144b3['body'][_0x7413('0x82')]=_0x441816[_0x7413('0x63')][_0x7413('0x92')];break;}}if(_0x2144b3['body']['id']){delete _0x2144b3[_0x7413('0x63')]['id'];}if(_['isNil'](_0x2144b3[_0x7413('0x63')][_0x7413('0x7f')])){throw new db[(_0x7413('0x21'))][(_0x7413('0x93'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x2144b3['body']['body'])||_0x2144b3['body']['body']===''){throw new db[(_0x7413('0x21'))][(_0x7413('0x93'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x7413('0x94')](_0x2144b3[_0x7413('0x63')]['mapKey'])){throw new db[(_0x7413('0x21'))][(_0x7413('0x93'))](_0x7413('0x95')+_0x26536c);}if(!_['includes'](_0x26536c,_0x2144b3['body']['mapKey'])){throw new db[(_0x7413('0x21'))][(_0x7413('0x93'))](_0x7413('0x96')+_0x26536c);}_0x3b5ad6[_0x2144b3[_0x7413('0x63')][_0x7413('0x97')]]=_0x2144b3['body']['from'];return db[_0x7413('0x98')][_0x7413('0x5f')]({'where':{'id':_0x2144b3[_0x7413('0x74')][_0x7413('0x99')]},'include':[{'model':db['CmContact'],'as':_0x7413('0x9a'),'where':_0x3b5ad6,'limit':0x1,'order':[[_0x7413('0x7a'),_0x7413('0x9b')]]}]});})[_0x7413('0x23')](handleEntityNotFound(_0xae889e,null))[_0x7413('0x23')](function(_0x38f6ab){if(_0x38f6ab){_0x2144b3[_0x7413('0x9c')]=_[_0x7413('0x9d')](_0x38f6ab,[_0x7413('0x9a')]);if(_0x38f6ab[_0x7413('0x9a')]['length']){return _0x38f6ab[_0x7413('0x9a')][0x0];}var _0x37efdb=_[_0x7413('0x1b')](_0x2144b3[_0x7413('0x63')],{'firstName':_0x2144b3[_0x7413('0x63')][_0x7413('0x7f')],'ListId':_0x38f6ab['id']});_0x37efdb[_0x2144b3['body'][_0x7413('0x97')]]=_0x2144b3[_0x7413('0x63')][_0x7413('0x7f')];return db[_0x7413('0x77')][_0x7413('0x59')](_0x37efdb,{'fields':_0x5e35ea,'raw':!![]});}})[_0x7413('0x23')](handleEntityNotFound(_0xae889e,null))['then'](function(_0x561c08){if(_0x561c08){_0x2144b3[_0x7413('0x9e')]=_0x561c08;var _0x3954b6={'ContactId':_0x561c08['id'],'phone':_0x2144b3[_0x7413('0x63')][_0x7413('0x7f')],'SmsAccountId':_0x441816[_0x7413('0x56')]['id']};var _0x1b03f8={'ContactId':_0x561c08['id'],'SmsAccountId':_0x441816['params']['id'],'closed':![]};return db['SmsInteraction'][_0x7413('0x5f')]({'where':_0x1b03f8})[_0x7413('0x23')](function(_0x140d19){if(_0x140d19){return[_0x140d19,![]];}return db[_0x7413('0x9f')]['create'](_0x3954b6)[_0x7413('0x23')](function(_0x38b160){return[_0x38b160,!![]];});});}})['spread'](function(_0x117c9e,_0x3b2c83){_0x2144b3[_0x7413('0xa0')]=_0x117c9e[_0x7413('0x38')]({'plain':!![]});_0x2144b3['interaction'][_0x7413('0xa1')]=![];if(_0x3b2c83){if(_0x2144b3[_0x7413('0x74')][_0x7413('0xa2')]){_0x2144b3[_0x7413('0xa3')]['push']({'id':0x0,'priority':_0x2144b3['applications'][_0x7413('0x47')]+0x1,'app':_0x7413('0xa4'),'appdata':_0x7413('0xa5'),'interval':_0x7413('0xa6')});}_0x2144b3[_0x7413('0xa0')][_0x7413('0xa1')]=!![];}return db[_0x7413('0xa7')]['create']({'phone':_0x2144b3[_0x7413('0x63')][_0x7413('0x7f')],'messageId':_0x2144b3['body']['messageId'],'body':_0x2144b3[_0x7413('0x63')]['body'],'SmsAccountId':_0x441816['params']['id'],'SmsInteractionId':_0x117c9e['id'],'direction':'in','ContactId':_0x117c9e[_0x7413('0xa8')],'AttachmentId':_0x2144b3[_0x7413('0x63')][_0x7413('0xa9')]});})[_0x7413('0x23')](function(_0x232ef5){_0x2144b3[_0x7413('0x2c')]=_0x232ef5;if(_0x2144b3[_0x7413('0xa0')][_0x7413('0xaa')]){return db['User'][_0x7413('0x5f')]({'attributes':['id',_0x7413('0x3b')],'where':{'id':_0x2144b3['interaction'][_0x7413('0xaa')]}})[_0x7413('0x23')](function(_0x10f2c7){if(_0x10f2c7){_0x2144b3[_0x7413('0xa3')]['unshift']({'id':0x0,'priority':0x0,'app':_0x7413('0xab'),'appdata':_0x10f2c7[_0x7413('0x3b')]+','+(_0x2144b3[_0x7413('0x74')]['waitForTheAssignedAgent']||0xa),'interval':_0x7413('0xa6')});}return respondWithRpcPromise(_0x7413('0xac'),_0x7413('0xad'),_0x2144b3);});}return respondWithRpcPromise('Start',_0x7413('0xad'),_0x2144b3);})['then'](function(_0x196fed){if(_0x196fed){var _0x557d19=0xc8;var _0x57264f=_0x7413('0xae');logger[_0x7413('0x24')](_0x7413('0x27'),_0x57264f,_0x557d19,_0x7413('0xaf'));logger['debug'](_0x7413('0xb0'),_0x57264f,_0x557d19,'entity\x20found',JSON[_0x7413('0x29')](_0x196fed));if(_0x2144b3[_0x7413('0x74')]['type']===_0x7413('0x7e')){return _0xae889e[_0x7413('0x2e')](_0x557d19)[_0x7413('0x34')](_0x7413('0xb1'),_0x7413('0xb2'))[_0x7413('0x3c')](_0x7413('0xb3'));}else{return _0xae889e[_0x7413('0x2e')](_0x557d19)[_0x7413('0x30')](_0x196fed);}}})[_0x7413('0x55')](handleError(_0xae889e,null));};exports[_0x7413('0xb4')]=function(_0x1f7f8c,_0xe7f421,_0x1a012c){return db[_0x7413('0x52')][_0x7413('0x69')]({'where':{'id':_0x1f7f8c['params']['id']}})['then'](handleEntityNotFound(_0xe7f421,null))[_0x7413('0x23')](function(_0x198d7b){if(_0x198d7b){return db['sequelize'][_0x7413('0xb5')](function(_0x55173d){return db['SmsApplication'][_0x7413('0x39')]({'where':{'SmsAccountId':_0x1f7f8c['params']['id']},'transaction':_0x55173d})[_0x7413('0x23')](function(_0xb939e){var _0x2e92be=_[_0x7413('0x4f')](_0x1f7f8c['body'],function(_0x32245a){_0x32245a[_0x7413('0x6d')]=_0x1f7f8c[_0x7413('0x56')]['id'];return _0x32245a;});return db[_0x7413('0x72')]['bulkCreate'](_0x2e92be,{'transaction':_0x55173d});});})['then'](function(){return db[_0x7413('0x72')][_0x7413('0xb6')]({'where':{'SmsAccountId':_0x1f7f8c['params']['id']},'order':'priority'});});}})[_0x7413('0x23')](respondWithResult(_0xe7f421,null))['catch'](handleError(_0xe7f421,null));};exports[_0x7413('0xb7')]=function(_0x7c0bcc,_0x59bdf8,_0xa592f){var _0x30dc8b={};var _0x4a3ef0={};var _0x226844;var _0xbbb10b;return db[_0x7413('0x52')]['findOne']({'where':{'id':_0x7c0bcc[_0x7413('0x56')]['id']}})['then'](handleEntityNotFound(_0x59bdf8,null))[_0x7413('0x23')](function(_0x4bcefe){if(_0x4bcefe){_0x226844=_0x4bcefe;_0x4a3ef0[_0x7413('0x43')]=_[_0x7413('0x41')](db[_0x7413('0x72')]['rawAttributes']);_0x4a3ef0[_0x7413('0x40')]=_[_0x7413('0x41')](_0x7c0bcc[_0x7413('0x40')]);_0x4a3ef0[_0x7413('0x42')]=_[_0x7413('0x45')](_0x4a3ef0[_0x7413('0x43')],_0x4a3ef0['query']);_0x30dc8b['attributes']=_[_0x7413('0x45')](_0x4a3ef0['model'],qs['fields'](_0x7c0bcc['query'][_0x7413('0x46')]));_0x30dc8b[_0x7413('0x44')]=_0x30dc8b[_0x7413('0x44')][_0x7413('0x47')]?_0x30dc8b['attributes']:_0x4a3ef0[_0x7413('0x43')];_0x30dc8b[_0x7413('0x49')]=qs[_0x7413('0x4a')](_0x7c0bcc[_0x7413('0x40')]['sort']);_0x30dc8b[_0x7413('0x4b')]=qs[_0x7413('0x42')](_[_0x7413('0x4c')](_0x7c0bcc[_0x7413('0x40')],_0x4a3ef0['filters']));if(_0x7c0bcc['query']['filter']){_0x30dc8b[_0x7413('0x4b')]=_['merge'](_0x30dc8b['where'],{'$or':_[_0x7413('0x4f')](_0x30dc8b[_0x7413('0x44')],function(_0x2b5880){var _0x48db5f={};_0x48db5f[_0x2b5880]={'$like':'%'+_0x7c0bcc[_0x7413('0x40')][_0x7413('0x4d')]+'%'};return _0x48db5f;})});}_0x30dc8b=_[_0x7413('0x4e')]({},_0x30dc8b,_0x7c0bcc[_0x7413('0x58')]);return _0x226844[_0x7413('0xb7')](_0x30dc8b);}})['then'](function(_0x2629b1){if(_0x2629b1){_0xbbb10b=_0x2629b1['length'];if(!_0x7c0bcc['query'][_0x7413('0x48')]('nolimit')){_0x30dc8b[_0x7413('0x33')]=qs[_0x7413('0x33')](_0x7c0bcc['query']['limit']);_0x30dc8b[_0x7413('0x32')]=qs[_0x7413('0x32')](_0x7c0bcc[_0x7413('0x40')][_0x7413('0x32')]);}return _0x226844['getApplications'](_0x30dc8b);}})['then'](function(_0x5cb613){if(_0x5cb613){return _0x5cb613?{'count':_0xbbb10b,'rows':_0x5cb613}:null;}})[_0x7413('0x23')](respondWithResult(_0x59bdf8,null))['catch'](handleError(_0x59bdf8,null));};exports[_0x7413('0xb8')]=function(_0x4d5bf5,_0xcc6a1d,_0x567a82){var _0x5aa16a={'raw':![],'where':{}};var _0x3a0512={};var _0x5d70f6={'count':0x0,'rows':[]};return db[_0x7413('0x52')][_0x7413('0x69')]({'where':{'id':_0x4d5bf5['params']['id']}})['then'](handleEntityNotFound(_0xcc6a1d,null))['then'](function(_0x2b5a28){if(_0x2b5a28){_0x3a0512['model']=_[_0x7413('0x41')](db[_0x7413('0x9f')][_0x7413('0x57')]);_0x3a0512[_0x7413('0x40')]=_[_0x7413('0x41')](_0x4d5bf5[_0x7413('0x40')]);_0x3a0512['filters']=_['intersection'](_0x3a0512['model'],_0x3a0512[_0x7413('0x40')]);_0x5aa16a[_0x7413('0x44')]=_[_0x7413('0x45')](_0x3a0512[_0x7413('0x43')],qs[_0x7413('0x46')](_0x4d5bf5[_0x7413('0x40')][_0x7413('0x46')]));_0x5aa16a[_0x7413('0x44')]=_0x5aa16a[_0x7413('0x44')][_0x7413('0x47')]?_0x5aa16a[_0x7413('0x44')]:_0x3a0512[_0x7413('0x43')];if(!_0x4d5bf5[_0x7413('0x40')][_0x7413('0x48')](_0x7413('0x6a'))){_0x5aa16a[_0x7413('0x33')]=qs[_0x7413('0x33')](_0x4d5bf5[_0x7413('0x40')][_0x7413('0x33')]);_0x5aa16a[_0x7413('0x32')]=qs[_0x7413('0x32')](_0x4d5bf5[_0x7413('0x40')]['offset']);}_0x5aa16a[_0x7413('0x49')]=qs[_0x7413('0x4a')](_0x4d5bf5[_0x7413('0x40')][_0x7413('0x4a')]);_0x5aa16a[_0x7413('0x4b')]=qs['filters'](_[_0x7413('0x4c')](_0x4d5bf5[_0x7413('0x40')],_0x3a0512[_0x7413('0x42')]));_0x5aa16a[_0x7413('0x4b')]['SmsAccountId']=_0x2b5a28['id'];if(_0x4d5bf5['query'][_0x7413('0x4d')]){_0x5aa16a[_0x7413('0x4b')]=_[_0x7413('0x4e')](_0x5aa16a[_0x7413('0x4b')],{'$or':_[_0x7413('0x4f')](_0x5aa16a[_0x7413('0x44')],function(_0x1fcc55){var _0x164fca={};_0x164fca[_0x1fcc55]={'$like':'%'+_0x4d5bf5[_0x7413('0x40')][_0x7413('0x4d')]+'%'};return _0x164fca;})});}_0x5aa16a=_[_0x7413('0x4e')]({},_0x5aa16a,_0x4d5bf5['options']);return db[_0x7413('0x9f')][_0x7413('0x31')]({'where':_0x5aa16a[_0x7413('0x4b')]})[_0x7413('0x23')](function(_0x492d13){_0x5d70f6[_0x7413('0x31')]=_0x492d13;if(_0x4d5bf5[_0x7413('0x40')][_0x7413('0x50')]){_0x5aa16a[_0x7413('0x51')]=[{'model':db['CmContact'],'as':_0x7413('0xb9'),'required':![]},{'model':db[_0x7413('0xba')],'as':_0x7413('0xbb'),'attributes':[_0x7413('0x3b'),_0x7413('0xbc'),_0x7413('0xbd')],'required':![]},{'model':db['Tag'],'as':_0x7413('0xbe'),'attributes':['id',_0x7413('0x3b'),'color'],'where':_0x4d5bf5[_0x7413('0x40')][_0x7413('0xbf')]?{'id':_0x4d5bf5['query'][_0x7413('0xbf')]}:undefined,'required':_0x4d5bf5['query'][_0x7413('0xbf')]?!![]:![]}];}return db[_0x7413('0x9f')][_0x7413('0x53')](_0x5aa16a);})[_0x7413('0x23')](function(_0x338a56){_0x5d70f6[_0x7413('0x54')]=_0x338a56;return _0x5d70f6;});}})['then'](respondWithFilteredResult(_0xcc6a1d,_0x5aa16a))['catch'](handleError(_0xcc6a1d,null));};exports['send']=function(_0x2bb61d,_0x512a1c,_0x4110aa){var _0x5687e5,_0x49c6ad,_0x20ac98;if(_[_0x7413('0x94')](_0x2bb61d[_0x7413('0x63')]['body'])||_0x2bb61d[_0x7413('0x63')][_0x7413('0x63')]===''){throw new db['Sequelize'][(_0x7413('0x93'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x7413('0x94')](_0x2bb61d[_0x7413('0x63')]['to'])){throw new db[(_0x7413('0x21'))][(_0x7413('0x93'))]('to\x20is\x20mandatory');}_0x5687e5=_0x2bb61d[_0x7413('0x63')]['to'];return db[_0x7413('0x52')][_0x7413('0x5f')]({'where':{'id':_0x2bb61d['params']['id']},'include':[{'model':db[_0x7413('0x98')],'as':_0x7413('0xc0'),'include':[{'model':db[_0x7413('0x77')],'as':_0x7413('0x9a'),'where':{'mobile':_0x5687e5},'limit':0x1,'order':[[_0x7413('0x7a'),'DESC']]}]}]})[_0x7413('0x23')](handleEntityNotFound(_0x512a1c,null))[_0x7413('0x23')](function(_0x3bbcf7){if(_0x3bbcf7&&_0x3bbcf7[_0x7413('0xc0')]){_0x49c6ad=_0x3bbcf7[_0x7413('0x38')]({'plain':!![]});if(_0x49c6ad['List']&&_0x49c6ad[_0x7413('0xc0')][_0x7413('0x9a')][_0x7413('0x47')]){return _0x49c6ad[_0x7413('0xc0')][_0x7413('0x9a')][0x0];}return db[_0x7413('0x77')][_0x7413('0x59')](_[_0x7413('0x1b')](_0x2bb61d[_0x7413('0x63')],{'firstName':_0x5687e5,'mobile':_0x5687e5,'phone':_0x5687e5,'ListId':_0x49c6ad[_0x7413('0x99')]}));}})[_0x7413('0x23')](handleEntityNotFound(_0x512a1c,null))[_0x7413('0x23')](function(_0x4dd4b3){if(_0x4dd4b3){_0x20ac98=_0x4dd4b3;return db[_0x7413('0x9f')]['find']({'where':{'ContactId':_0x20ac98['id'],'closed':![],'SmsAccountId':_0x49c6ad['id']}})['then'](function(_0x131fa1){if(_0x131fa1){return[_0x131fa1,![]];}return db[_0x7413('0x9f')][_0x7413('0x59')]({'UserId':_0x2bb61d[_0x7413('0x5a')]['id'],'ContactId':_0x20ac98['id'],'SmsAccountId':_0x49c6ad['id'],'phone':_0x5687e5,'firstMsgDirection':_0x7413('0xc1'),'Messages':[_[_0x7413('0x4e')](_0x2bb61d[_0x7413('0x63')],{'read':![],'body':_0x2bb61d[_0x7413('0x63')][_0x7413('0x63')],'phone':_0x5687e5,'SmsAccountId':_0x49c6ad['id'],'UserId':_0x2bb61d[_0x7413('0x5a')]['id'],'ContactId':_0x20ac98['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0x7413('0xc2')}]})[_0x7413('0x23')](function(_0x57a8e3){return[_0x57a8e3,!![]];});});}})[_0x7413('0xc3')](function(_0x44c2d4,_0xa05eeb){if(_0xa05eeb){return _0x44c2d4;}return db[_0x7413('0xa7')]['create'](_[_0x7413('0x4e')](_0x2bb61d[_0x7413('0x63')],{'read':![],'body':_0x2bb61d[_0x7413('0x63')][_0x7413('0x63')],'phone':_0x5687e5,'SmsAccountId':_0x49c6ad['id'],'SmsInteractionId':_0x44c2d4['id'],'UserId':_0x2bb61d[_0x7413('0x5a')]['id'],'ContactId':_0x20ac98['id']}))[_0x7413('0x23')](function(_0x212f65){_0x44c2d4['dataValues'][_0x7413('0xc2')]=[];_0x44c2d4[_0x7413('0xc4')]['Messages']['push'](_0x212f65['dataValues']);return _0x44c2d4;});})[_0x7413('0x23')](respondWithResult(_0x512a1c,null))[_0x7413('0x55')](handleError(_0x512a1c,null));};exports[_0x7413('0x2e')]=function(_0x2c4d3e,_0x476a26,_0x4a575f){if(_0x2c4d3e['body']['id']){delete _0x2c4d3e[_0x7413('0x63')]['id'];}console[_0x7413('0xc5')]('endpoint\x20/status\x20POST\x20/',_0x2c4d3e[_0x7413('0x63')]);var _0x43b8b9,_0x414c64,_0x3e6c4c;return db['SmsAccount'][_0x7413('0x5f')]({'where':{'id':_0x2c4d3e[_0x7413('0x56')]['id']}})[_0x7413('0x23')](handleEntityNotFound(_0x476a26,null))[_0x7413('0x23')](function(_0x57a18c){if(_0x57a18c){_0x3e6c4c=_0x57a18c;logger['debug'](_0x7413('0x27'),_0x7413('0x2e'),_0x7413('0xc6'),_0x57a18c[_0x7413('0x7d')],util[_0x7413('0xc7')](_0x2c4d3e[_0x7413('0x63')],{'showHidden':![],'depth':null}));switch(_0x57a18c[_0x7413('0x7d')]){case'skebby':if(_0x2c4d3e[_0x7413('0x63')][_0x7413('0xc8')]&&_0x2c4d3e[_0x7413('0x63')][_0x7413('0x2e')]){_0x414c64=_0x2c4d3e[_0x7413('0x63')][_0x7413('0x2e')];return db[_0x7413('0xa7')][_0x7413('0x5f')]({'where':{'messageId':_0x2c4d3e[_0x7413('0x63')][_0x7413('0xc8')]}});}break;case _0x7413('0x86'):if(_0x2c4d3e[_0x7413('0x63')][_0x7413('0xc9')]&&_0x2c4d3e[_0x7413('0x63')][_0x7413('0xca')]){_0x414c64=_0x2c4d3e['body']['statusInt'];return db[_0x7413('0xa7')][_0x7413('0x5f')]({'where':{'messageId':_0x2c4d3e[_0x7413('0x63')][_0x7413('0xc9')]}});}break;case _0x7413('0xcb'):if(_0x2c4d3e[_0x7413('0x63')][_0x7413('0x87')]&&_0x2c4d3e[_0x7413('0x63')][_0x7413('0xcc')]){_0x414c64=_0x2c4d3e[_0x7413('0x63')][_0x7413('0xcc')];return db[_0x7413('0xa7')][_0x7413('0x5f')]({'where':{'messageId':_0x2c4d3e[_0x7413('0x63')][_0x7413('0x87')]}});}break;case _0x7413('0x8b'):var _0x32eaf9=_0x2c4d3e[_0x7413('0x63')][_0x7413('0xcd')][0x0];if(_0x32eaf9['messageId']&&_0x32eaf9['status'][_0x7413('0xce')]===_0x7413('0xcf')){_0x414c64=_0x32eaf9[_0x7413('0x2e')][_0x7413('0xce')];return db[_0x7413('0xa7')][_0x7413('0x5f')]({'where':{'messageId':_0x32eaf9[_0x7413('0x82')]}});}break;case _0x7413('0xd0'):if(_0x2c4d3e[_0x7413('0x63')][_0x7413('0x82')]&&_0x2c4d3e[_0x7413('0x63')][_0x7413('0x2e')]){_0x414c64=_0x2c4d3e[_0x7413('0x63')][_0x7413('0x2e')];return db[_0x7413('0xa7')][_0x7413('0x5f')]({'where':{'messageId':_0x2c4d3e[_0x7413('0x63')][_0x7413('0x82')]}});}break;case _0x7413('0x91'):if(_0x2c4d3e[_0x7413('0x63')][_0x7413('0xd1')]&&_0x2c4d3e[_0x7413('0x63')][_0x7413('0x2e')]){_0x414c64=_0x2c4d3e['body'][_0x7413('0x2e')];return db[_0x7413('0xa7')]['find']({'where':{'messageId':_0x2c4d3e[_0x7413('0x63')][_0x7413('0xd1')]}});}break;}}})[_0x7413('0x23')](handleEntityNotFound(_0x476a26,null))[_0x7413('0x23')](function(_0x58b984){if(_0x58b984){_0x43b8b9=_0x58b984;switch(_0x3e6c4c['type']){case'skebby':if(_0x414c64===_0x7413('0xcf')){return _0x43b8b9['update']({'read':!![]});}else{logger[_0x7413('0x2a')](_0x7413('0x27'),_0x7413('0x2e'),'skebby',util['inspect'](_0x2c4d3e[_0x7413('0x63')],{'showHidden':![],'depth':null}));}break;case _0x7413('0x86'):if(_0x414c64==='1'){return _0x43b8b9[_0x7413('0x37')]({'read':!![]});}else{logger[_0x7413('0x2a')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x7413('0x84'),util[_0x7413('0xc7')](_0x2c4d3e['body'],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x2c4d3e[_0x7413('0x63')][_0x7413('0xd2')]&&_0x414c64>=0xc8&&_0x414c64<=0xce){return _0x43b8b9['update']({'read':!![]});}else{logger['error'](_0x7413('0x27'),_0x7413('0x2e'),_0x7413('0xcb'),util[_0x7413('0xc7')](_0x2c4d3e[_0x7413('0x63')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0xfde55=_0x2c4d3e[_0x7413('0x63')][_0x7413('0xcd')][0x0];if(_0xfde55[_0x7413('0x2e')][_0x7413('0xce')]==='DELIVERED'){return _0x43b8b9[_0x7413('0x37')]({'read':!![]});}else{logger[_0x7413('0x2a')](_0x7413('0x27'),_0x7413('0x2e'),'infobip',util['inspect'](_0x2c4d3e[_0x7413('0x63')],{'showHidden':![],'depth':null}));}break;case _0x7413('0xd0'):if(_0x414c64==_0x7413('0xd3')||_0x414c64==_0x7413('0xd4')){return _0x43b8b9[_0x7413('0x37')]({'read':!![]});}else{logger['error'](_0x7413('0x27'),'status','clickatell',util[_0x7413('0xc7')](_0x2c4d3e['body'],{'showHidden':![],'depth':null}));}break;case _0x7413('0x91'):if(_0x414c64===_0x7413('0xd5')||_0x414c64===_0x7413('0xd6')){return _0x43b8b9[_0x7413('0x37')]({'read':!![]});}else{logger[_0x7413('0x2a')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7413('0x2e'),_0x7413('0x91'),util[_0x7413('0xc7')](_0x2c4d3e[_0x7413('0x63')],{'showHidden':![],'depth':null}));}break;}return _0x43b8b9;}})['then'](respondWithResult(_0x476a26,null))[_0x7413('0x55')](handleError(_0x476a26,null));};exports[_0x7413('0xd7')]=function(_0x58c275,_0x8c0c75,_0x192f67){var _0x1262ad,_0x56fbbd,_0x45aa4f;return db[_0x7413('0x52')][_0x7413('0x5f')]({'where':{'id':_0x58c275[_0x7413('0x56')]['id']}})['then'](handleEntityNotFound(_0x8c0c75,null))[_0x7413('0x23')](function(_0x15bed5){if(_0x15bed5){_0x45aa4f=_0x15bed5;logger[_0x7413('0x26')](_0x7413('0x27'),_0x7413('0x2e'),_0x7413('0xc6'),_0x15bed5['type'],util['inspect'](_0x58c275[_0x7413('0x40')],{'showHidden':![],'depth':null}));switch(_0x15bed5['type']){case _0x7413('0x8c'):if(_0x58c275[_0x7413('0x40')]['message-id']&&_0x58c275[_0x7413('0x40')][_0x7413('0xd8')]){_0x56fbbd=_0x58c275['query'][_0x7413('0xd8')];return db[_0x7413('0xa7')][_0x7413('0x5f')]({'where':{'messageId':_0x58c275['query'][_0x7413('0xd9')]}});}break;}}})[_0x7413('0x23')](handleEntityNotFound(_0x8c0c75,null))[_0x7413('0x23')](function(_0x31e805){if(_0x31e805){_0x1262ad=_0x31e805;switch(_0x45aa4f[_0x7413('0x7d')]){case'csc':if(_0x56fbbd==='2'||_0x56fbbd==='6'){return _0x1262ad[_0x7413('0x37')]({'read':!![]});}else{logger[_0x7413('0x2a')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7413('0x2e'),'csc',util[_0x7413('0xc7')](_0x58c275['query'],{'showHidden':![],'depth':null}));};break;}return _0x1262ad;}})[_0x7413('0x23')](respondWithResult(_0x8c0c75,null))[_0x7413('0x55')](handleError(_0x8c0c75,null));};exports[_0x7413('0xda')]=function(_0x26b141,_0x5ac490,_0x3e10c8){return db[_0x7413('0x52')][_0x7413('0x5f')]({'where':{'id':_0x26b141[_0x7413('0x56')]['id']}})['then'](handleEntityNotFound(_0x5ac490,null))[_0x7413('0x23')](function(_0x398fc9){if(_0x398fc9){return _0x398fc9[_0x7413('0xda')](_0x26b141['body'][_0x7413('0x71')],_[_0x7413('0x9d')](_0x26b141['body'],['ids','id'])||{})[_0x7413('0xc3')](function(_0x3a9b8a){for(var _0x3ad4a9=0x0;_0x3ad4a9<_0x26b141[_0x7413('0x63')][_0x7413('0x71')][_0x7413('0x47')];_0x3ad4a9+=0x1){socket[_0x7413('0xdb')](_0x7413('0xdc'),{'UserId':_0x26b141[_0x7413('0x63')][_0x7413('0x71')][_0x3ad4a9],'SmsAccountId':_0x26b141[_0x7413('0x56')]['id']});}return _0x3a9b8a;});}})[_0x7413('0x23')](respondWithResult(_0x5ac490,null))['catch'](handleError(_0x5ac490,null));};exports[_0x7413('0xdd')]=function(_0x1f73d0,_0x3c7fe2,_0x505f15){return db[_0x7413('0x52')]['find']({'where':{'id':_0x1f73d0[_0x7413('0x56')]['id']}})[_0x7413('0x23')](handleEntityNotFound(_0x3c7fe2,null))[_0x7413('0x23')](function(_0x4f11a3){if(_0x4f11a3){return _0x4f11a3[_0x7413('0xdd')](_0x1f73d0[_0x7413('0x40')][_0x7413('0x71')])[_0x7413('0x23')](function(){if(_['isArray'](_0x1f73d0[_0x7413('0x40')]['ids'])){for(var _0x409c11=0x0;_0x409c11<_0x1f73d0[_0x7413('0x40')][_0x7413('0x71')][_0x7413('0x47')];_0x409c11+=0x1){socket[_0x7413('0xdb')](_0x7413('0xde'),{'UserId':Number(_0x1f73d0[_0x7413('0x40')]['ids'][_0x409c11]),'SmsAccountId':Number(_0x1f73d0[_0x7413('0x56')]['id'])});}}else{socket[_0x7413('0xdb')](_0x7413('0xde'),{'UserId':Number(_0x1f73d0[_0x7413('0x40')]['ids']),'SmsAccountId':Number(_0x1f73d0[_0x7413('0x56')]['id'])});}});}})[_0x7413('0x23')](respondWithStatusCode(_0x3c7fe2,null))[_0x7413('0x55')](handleError(_0x3c7fe2,null));};exports[_0x7413('0xdf')]=function(_0x27bdfc,_0x59b819,_0x2dafd2){var _0x114a27={};var _0x3e034c={};var _0x4e6804;var _0x481508;return db[_0x7413('0x52')][_0x7413('0x69')]({'where':{'id':_0x27bdfc[_0x7413('0x56')]['id']}})['then'](handleEntityNotFound(_0x59b819,null))[_0x7413('0x23')](function(_0x12b491){if(_0x12b491){_0x4e6804=_0x12b491;_0x3e034c['model']=_['keys'](db['User'][_0x7413('0x57')]);_0x3e034c[_0x7413('0x40')]=_['keys'](_0x27bdfc[_0x7413('0x40')]);_0x3e034c[_0x7413('0x42')]=_[_0x7413('0x45')](_0x3e034c[_0x7413('0x43')],_0x3e034c[_0x7413('0x40')]);_0x114a27[_0x7413('0x44')]=_[_0x7413('0x45')](_0x3e034c['model'],qs['fields'](_0x27bdfc[_0x7413('0x40')][_0x7413('0x46')]));_0x114a27[_0x7413('0x44')]=_0x114a27[_0x7413('0x44')][_0x7413('0x47')]?_0x114a27[_0x7413('0x44')]:_0x3e034c[_0x7413('0x43')];_0x114a27[_0x7413('0x49')]=qs['sort'](_0x27bdfc[_0x7413('0x40')][_0x7413('0x4a')]);_0x114a27[_0x7413('0x4b')]=qs[_0x7413('0x42')](_[_0x7413('0x4c')](_0x27bdfc[_0x7413('0x40')],_0x3e034c[_0x7413('0x42')]));if(_0x27bdfc[_0x7413('0x40')][_0x7413('0x4d')]){_0x114a27['where']=_[_0x7413('0x4e')](_0x114a27[_0x7413('0x4b')],{'$or':_['map'](_0x114a27[_0x7413('0x44')],function(_0x56ef6d){var _0x3af16f={};_0x3af16f[_0x56ef6d]={'$like':'%'+_0x27bdfc[_0x7413('0x40')][_0x7413('0x4d')]+'%'};return _0x3af16f;})});}_0x114a27=_[_0x7413('0x4e')]({},_0x114a27,_0x27bdfc[_0x7413('0x58')]);return _0x4e6804[_0x7413('0xdf')](_0x114a27);}})[_0x7413('0x23')](function(_0x322989){if(_0x322989){_0x481508=_0x322989['length'];if(!_0x27bdfc[_0x7413('0x40')][_0x7413('0x48')](_0x7413('0x6a'))){_0x114a27[_0x7413('0x33')]=qs['limit'](_0x27bdfc[_0x7413('0x40')][_0x7413('0x33')]);_0x114a27['offset']=qs[_0x7413('0x32')](_0x27bdfc[_0x7413('0x40')][_0x7413('0x32')]);}return _0x4e6804[_0x7413('0xdf')](_0x114a27);}})[_0x7413('0x23')](function(_0x485014){if(_0x485014){return _0x485014?{'count':_0x481508,'rows':_0x485014}:null;}})[_0x7413('0x23')](respondWithResult(_0x59b819,null))[_0x7413('0x55')](handleError(_0x59b819,null));}; \ No newline at end of file +var _0x5464=['Unable\x20to\x20retrieve\x20the\x20current\x20user','get','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','SmsAccountId','Disposition','getDispositions','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','notify','sms','SmsApplication','Applications','applications','orderBy','priority','asc','account','CmContact','createdAt','difference','CompanyId','ListId','mobile','type','twilio','From','messageId','MessageSid','skebby','sender','text','from','clicksend','message_id','plivo','Text','MessageUUID','infobip','results','originatingAddress','segmentedMessage','clickatell','replyMessageId','refid','isNil','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','CmList','Contacts','updatedAt','DESC','list','omit','defaults','contact','SmsInteraction','spread','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','ContactId','AttachmentId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','entity\x20found','Content-Type','text/xml','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','to\x20is\x20mandatory','List','out','SmsMessage','Messages','dataValues','endpoint\x20/status\x20POST\x20/','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','connectel','requestid','statusInt','status_code','groupName','DELIVERED','intelepeer','redif','error_code','DELIVERED_TO_GATEWAY','DELIVRD','statusGet','csc','message-id','addAgents','userSmsAccount:save','removeAgents','isArray','emit','userSmsAccount:remove','html-pdf','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','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','../../mysqldb','redis','localhost','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','message','catch','sendStatus','status','end','json','offset','limit','Content-Range','reject','save','update','destroy','SmsAccounts','name','send','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','length','find','create','user'];(function(_0xd13a88,_0x3c5269){var _0x1c993c=function(_0x245af5){while(--_0x245af5){_0xd13a88['push'](_0xd13a88['shift']());}};_0x1c993c(++_0x3c5269);}(_0x5464,0x15d));var _0x4546=function(_0x5b46a3,_0xeb832d){_0x5b46a3=_0x5b46a3-0x0;var _0x59a614=_0x5464[_0x5b46a3];return _0x59a614;};'use strict';var pdf=require(_0x4546('0x0'));var emlformat=require(_0x4546('0x1'));var rimraf=require(_0x4546('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4546('0x3'));var rp=require('request-promise');var moment=require(_0x4546('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4546('0x5'));var util=require(_0x4546('0x6'));var path=require(_0x4546('0x7'));var sox=require(_0x4546('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x4546('0x9'));var crypto=require(_0x4546('0xa'));var jsforce=require(_0x4546('0xb'));var deskjs=require(_0x4546('0xc'));var toCsv=require(_0x4546('0xd'));var querystring=require(_0x4546('0xe'));var Papa=require(_0x4546('0xf'));var Redis=require(_0x4546('0x10'));var authService=require(_0x4546('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4546('0x12'));var hardwareService=require(_0x4546('0x13'));var logger=require(_0x4546('0x14'))('api');var utils=require(_0x4546('0x15'));var config=require(_0x4546('0x16'));var db=require(_0x4546('0x17'))['db'];config[_0x4546('0x18')]=_['defaults'](config['redis'],{'host':_0x4546('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsAccount.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x4546('0x1a')]({'port':0x232c});function checkPasswordPattern(_0x51e279,_0x363a17,_0x54581c){if(_0x54581c){var _0x26fc0e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x26fc0e['test'](_0x363a17)){return _0x51e279;}else{throw new db[(_0x4546('0x1b'))][(_0x4546('0x1c'))](_0x4546('0x1d'));}}else{return _0x51e279;}}function respondWithRpcPromise(_0x203348,_0x2a294b,_0x15e09e,_0x57d8de){return new BPromise(function(_0x4ffd6b,_0x5780a7){var _0x330235=_0x57d8de||client;return _0x330235[_0x4546('0x1e')](_0x203348,_0x15e09e)[_0x4546('0x1f')](function(_0x3d95c2){logger[_0x4546('0x20')](_0x4546('0x21'),_0x2a294b,_0x4546('0x22'));logger[_0x4546('0x23')](_0x4546('0x24'),_0x2a294b,_0x4546('0x22'),JSON['stringify'](_0x3d95c2));if(_0x3d95c2[_0x4546('0x25')]){if(_0x3d95c2[_0x4546('0x25')]['code']===0x1f4){logger[_0x4546('0x25')](_0x4546('0x21'),_0x2a294b,_0x3d95c2[_0x4546('0x25')][_0x4546('0x26')]);return _0x5780a7(_0x3d95c2[_0x4546('0x25')][_0x4546('0x26')]);}logger['error'](_0x4546('0x21'),_0x2a294b,_0x3d95c2[_0x4546('0x25')]['message']);return _0x4ffd6b(_0x3d95c2[_0x4546('0x25')][_0x4546('0x26')]);}else{logger[_0x4546('0x20')](_0x4546('0x21'),_0x2a294b,_0x4546('0x22'));_0x4ffd6b(_0x3d95c2['result'][_0x4546('0x26')]);}})[_0x4546('0x27')](function(_0x831fa5){logger['error']('SmsAccount,\x20%s,\x20%s',_0x2a294b,_0x831fa5);_0x5780a7(_0x831fa5);});});}function respondWithStatusCode(_0x43740e,_0x166d6f){_0x166d6f=_0x166d6f||0xcc;return function(_0x15611c){if(_0x15611c){return _0x43740e[_0x4546('0x28')](_0x166d6f);}return _0x43740e[_0x4546('0x29')](_0x166d6f)[_0x4546('0x2a')]();};}function respondWithResult(_0xcea7da,_0x586ff1){_0x586ff1=_0x586ff1||0xc8;return function(_0x367b23){if(_0x367b23){return _0xcea7da['status'](_0x586ff1)[_0x4546('0x2b')](_0x367b23);}};}function respondWithFilteredResult(_0x161815,_0x5396c5){return function(_0x539f74){if(_0x539f74){var _0xf7a95b=_0x539f74['count'],_0x5af997=_0x5396c5['offset'],_0x3c7c7d=_0x5396c5[_0x4546('0x2c')]+_0x5396c5[_0x4546('0x2d')],_0x58b69;if(_0x3c7c7d>=_0xf7a95b){_0x3c7c7d=_0xf7a95b;_0x58b69=0xc8;}else{_0x58b69=0xce;}_0x161815[_0x4546('0x29')](_0x58b69);return _0x161815['set'](_0x4546('0x2e'),_0x5af997+'-'+_0x3c7c7d+'/'+_0xf7a95b)[_0x4546('0x2b')](_0x539f74);}return null;};}function patchUpdates(_0x540983){return function(_0xad1b9c){try{jsonpatch['apply'](_0xad1b9c,_0x540983,!![]);}catch(_0x2a3541){return BPromise[_0x4546('0x2f')](_0x2a3541);}return _0xad1b9c[_0x4546('0x30')]();};}function saveUpdates(_0x2ce37f,_0x507ccb){return function(_0x12e38c){if(_0x12e38c){return _0x12e38c[_0x4546('0x31')](_0x2ce37f)[_0x4546('0x1f')](function(_0x298bef){return _0x298bef;});}return null;};}function removeEntity(_0x1487fd,_0x27f7b0){return function(_0x593aab){if(_0x593aab){return _0x593aab[_0x4546('0x32')]()[_0x4546('0x1f')](function(){var _0x549f48=_0x593aab['get']({'plain':!![]});var _0x3eb8e8=_0x4546('0x33');return db['UserProfileResource'][_0x4546('0x32')]({'where':{'type':_0x3eb8e8,'resourceId':_0x549f48['id']}})[_0x4546('0x1f')](function(){return _0x593aab;});})['then'](function(){_0x1487fd['status'](0xcc)[_0x4546('0x2a')]();});}};}function handleEntityNotFound(_0x141fe8,_0x18458b){return function(_0xf73ed2){if(!_0xf73ed2){_0x141fe8[_0x4546('0x28')](0x194);}return _0xf73ed2;};}function handleError(_0x24ae41,_0x4ddc9e){_0x4ddc9e=_0x4ddc9e||0x1f4;return function(_0x8041a9){logger[_0x4546('0x25')](_0x8041a9['stack']);if(_0x8041a9[_0x4546('0x34')]){delete _0x8041a9['name'];}_0x24ae41[_0x4546('0x29')](_0x4ddc9e)[_0x4546('0x35')](_0x8041a9);};}exports['index']=function(_0x5d9f18,_0x104d56){var _0x453593={'include':[{'model':db[_0x4546('0x36')],'as':_0x4546('0x37')}]},_0x43cec3={},_0x56129b={'count':0x0,'rows':[]};var _0x24eb6d=_[_0x4546('0x38')](db[_0x4546('0x39')][_0x4546('0x3a')],function(_0x3c3842){return{'name':_0x3c3842[_0x4546('0x3b')],'type':_0x3c3842['type'][_0x4546('0x3c')]};});_0x43cec3[_0x4546('0x3d')]=_['map'](_0x24eb6d,'name');_0x43cec3[_0x4546('0x3e')]=_[_0x4546('0x3f')](_0x5d9f18[_0x4546('0x3e')]);_0x43cec3[_0x4546('0x40')]=_[_0x4546('0x41')](_0x43cec3['model'],_0x43cec3[_0x4546('0x3e')]);_0x453593[_0x4546('0x42')]=_[_0x4546('0x41')](_0x43cec3[_0x4546('0x3d')],qs[_0x4546('0x43')](_0x5d9f18[_0x4546('0x3e')][_0x4546('0x43')]));_0x453593[_0x4546('0x42')]=_0x453593[_0x4546('0x42')]['length']?_0x453593[_0x4546('0x42')]:_0x43cec3[_0x4546('0x3d')];if(!_0x5d9f18[_0x4546('0x3e')][_0x4546('0x44')](_0x4546('0x45'))){_0x453593[_0x4546('0x2d')]=qs[_0x4546('0x2d')](_0x5d9f18[_0x4546('0x3e')][_0x4546('0x2d')]);_0x453593[_0x4546('0x2c')]=qs[_0x4546('0x2c')](_0x5d9f18['query'][_0x4546('0x2c')]);}_0x453593[_0x4546('0x46')]=qs['sort'](_0x5d9f18[_0x4546('0x3e')][_0x4546('0x47')]);_0x453593[_0x4546('0x48')]=qs['filters'](_[_0x4546('0x49')](_0x5d9f18[_0x4546('0x3e')],_0x43cec3[_0x4546('0x40')]));if(_0x5d9f18[_0x4546('0x3e')][_0x4546('0x4a')]){_0x453593[_0x4546('0x48')]=_[_0x4546('0x4b')](_0x453593[_0x4546('0x48')],{'$or':_[_0x4546('0x38')](_0x24eb6d,function(_0x1acfa7){if(_0x1acfa7['type']!==_0x4546('0x4c')){var _0x24a637={};_0x24a637[_0x1acfa7['name']]={'$like':'%'+_0x5d9f18[_0x4546('0x3e')][_0x4546('0x4a')]+'%'};return _0x24a637;}})});}_0x453593=_[_0x4546('0x4b')]({},_0x453593,_0x5d9f18[_0x4546('0x4d')]);var _0x576c0a={'where':_0x453593[_0x4546('0x48')]};return db['SmsAccount'][_0x4546('0x4e')](_0x576c0a)[_0x4546('0x1f')](function(_0x221f45){_0x56129b['count']=_0x221f45;if(_0x5d9f18[_0x4546('0x3e')][_0x4546('0x4f')]){_0x453593[_0x4546('0x50')]=[{'all':!![]}];}return db[_0x4546('0x39')][_0x4546('0x51')](_0x453593);})[_0x4546('0x1f')](function(_0x73d945){_0x56129b[_0x4546('0x52')]=_0x73d945;return _0x56129b;})[_0x4546('0x1f')](respondWithFilteredResult(_0x104d56,_0x453593))[_0x4546('0x27')](handleError(_0x104d56,null));};exports[_0x4546('0x53')]=function(_0x49b0d8,_0x2778f2){var _0x409b6a={'raw':![],'where':{'id':_0x49b0d8[_0x4546('0x54')]['id']},'include':[{'model':db[_0x4546('0x36')],'as':_0x4546('0x37')}]},_0x5d168b={};_0x5d168b['model']=_[_0x4546('0x3f')](db[_0x4546('0x39')][_0x4546('0x3a')]);_0x5d168b[_0x4546('0x3e')]=_[_0x4546('0x3f')](_0x49b0d8[_0x4546('0x3e')]);_0x5d168b[_0x4546('0x40')]=_[_0x4546('0x41')](_0x5d168b[_0x4546('0x3d')],_0x5d168b[_0x4546('0x3e')]);_0x409b6a[_0x4546('0x42')]=_[_0x4546('0x41')](_0x5d168b[_0x4546('0x3d')],qs[_0x4546('0x43')](_0x49b0d8[_0x4546('0x3e')][_0x4546('0x43')]));_0x409b6a['attributes']=_0x409b6a[_0x4546('0x42')][_0x4546('0x55')]?_0x409b6a['attributes']:_0x5d168b[_0x4546('0x3d')];if(_0x49b0d8[_0x4546('0x3e')][_0x4546('0x4f')]){_0x409b6a[_0x4546('0x50')]=[{'all':!![]}];}_0x409b6a=_['merge']({},_0x409b6a,_0x49b0d8[_0x4546('0x4d')]);return db[_0x4546('0x39')][_0x4546('0x56')](_0x409b6a)[_0x4546('0x1f')](handleEntityNotFound(_0x2778f2,null))[_0x4546('0x1f')](respondWithResult(_0x2778f2,null))[_0x4546('0x27')](handleError(_0x2778f2,null));};exports[_0x4546('0x57')]=function(_0x1765e0,_0x3406e9){return db[_0x4546('0x39')][_0x4546('0x57')](_0x1765e0['body'],{})[_0x4546('0x1f')](function(_0x1c951e){var _0x47a382=_0x1765e0[_0x4546('0x58')]['get']({'plain':!![]});if(!_0x47a382)throw new Error(_0x4546('0x59'));if(_0x47a382['role']===_0x4546('0x58')){var _0x24e66c=_0x1c951e[_0x4546('0x5a')]({'plain':!![]});var _0xbe8cb1=_0x4546('0x33');return db['UserProfileSection'][_0x4546('0x56')]({'where':{'name':_0xbe8cb1,'userProfileId':_0x47a382['userProfileId']},'raw':!![]})[_0x4546('0x1f')](function(_0x522165){if(_0x522165&&_0x522165['autoAssociation']===0x0){return db['UserProfileResource'][_0x4546('0x57')]({'name':_0x24e66c['name'],'resourceId':_0x24e66c['id'],'type':_0x522165[_0x4546('0x34')],'sectionId':_0x522165['id']},{})[_0x4546('0x1f')](function(){return _0x1c951e;});}else{return _0x1c951e;}})[_0x4546('0x27')](function(_0x2a1a21){logger['error'](_0x4546('0x5b'),_0x2a1a21);throw _0x2a1a21;});}return _0x1c951e;})[_0x4546('0x1f')](respondWithResult(_0x3406e9,0xc9))[_0x4546('0x27')](handleError(_0x3406e9,null));};exports[_0x4546('0x31')]=function(_0x1962c5,_0x5ba4f3){if(_0x1962c5[_0x4546('0x5c')]['id']){delete _0x1962c5[_0x4546('0x5c')]['id'];}return db[_0x4546('0x39')]['find']({'where':{'id':_0x1962c5[_0x4546('0x54')]['id']},'include':[{'model':db[_0x4546('0x36')],'as':_0x4546('0x37')}]})['then'](handleEntityNotFound(_0x5ba4f3,null))[_0x4546('0x1f')](saveUpdates(_0x1962c5[_0x4546('0x5c')],null))[_0x4546('0x1f')](respondWithResult(_0x5ba4f3,null))[_0x4546('0x27')](handleError(_0x5ba4f3,null));};exports[_0x4546('0x32')]=function(_0x14d030,_0x310661){return db[_0x4546('0x39')]['find']({'where':{'id':_0x14d030[_0x4546('0x54')]['id']}})[_0x4546('0x1f')](handleEntityNotFound(_0x310661,null))[_0x4546('0x1f')](removeEntity(_0x310661,null))[_0x4546('0x27')](handleError(_0x310661,null));};exports[_0x4546('0x5d')]=function(_0x146438,_0x3c92ff){return db[_0x4546('0x39')][_0x4546('0x5d')]()[_0x4546('0x1f')](respondWithResult(_0x3c92ff,null))[_0x4546('0x27')](handleError(_0x3c92ff,null));};exports[_0x4546('0x5e')]=function(_0x1f70b9,_0x41c587,_0x3bf410){if(_0x1f70b9['body']['id']){delete _0x1f70b9[_0x4546('0x5c')]['id'];}return db['SmsAccount'][_0x4546('0x56')]({'where':{'id':_0x1f70b9[_0x4546('0x54')]['id']}})['then'](handleEntityNotFound(_0x41c587,null))[_0x4546('0x1f')](function(_0x335881){if(_0x335881){_0x1f70b9[_0x4546('0x5c')][_0x4546('0x5f')]=_0x335881['id'];return db[_0x4546('0x60')][_0x4546('0x57')](_0x1f70b9[_0x4546('0x5c')]);}})[_0x4546('0x1f')](respondWithResult(_0x41c587,null))[_0x4546('0x27')](handleError(_0x41c587,null));};exports[_0x4546('0x61')]=function(_0x1aa678,_0x194667,_0x10a332){var _0x49cac3={'raw':![],'where':{}};var _0x235e41={};var _0x38681f={'count':0x0,'rows':[]};return db[_0x4546('0x39')]['findOne']({'where':{'id':_0x1aa678[_0x4546('0x54')]['id']}})[_0x4546('0x1f')](handleEntityNotFound(_0x194667,null))[_0x4546('0x1f')](function(_0x6bf923){if(_0x6bf923){_0x235e41[_0x4546('0x3d')]=_[_0x4546('0x3f')](db[_0x4546('0x60')]['rawAttributes']);_0x235e41[_0x4546('0x3e')]=_[_0x4546('0x3f')](_0x1aa678[_0x4546('0x3e')]);_0x235e41['filters']=_['intersection'](_0x235e41[_0x4546('0x3d')],_0x235e41[_0x4546('0x3e')]);_0x49cac3['attributes']=_[_0x4546('0x41')](_0x235e41[_0x4546('0x3d')],qs[_0x4546('0x43')](_0x1aa678[_0x4546('0x3e')]['fields']));_0x49cac3[_0x4546('0x42')]=_0x49cac3[_0x4546('0x42')][_0x4546('0x55')]?_0x49cac3[_0x4546('0x42')]:_0x235e41[_0x4546('0x3d')];if(!_0x1aa678[_0x4546('0x3e')][_0x4546('0x44')](_0x4546('0x45'))){_0x49cac3['limit']=qs[_0x4546('0x2d')](_0x1aa678[_0x4546('0x3e')]['limit']);_0x49cac3[_0x4546('0x2c')]=qs[_0x4546('0x2c')](_0x1aa678['query'][_0x4546('0x2c')]);}_0x49cac3[_0x4546('0x46')]=qs[_0x4546('0x47')](_0x1aa678['query'][_0x4546('0x47')]);_0x49cac3[_0x4546('0x48')]=qs[_0x4546('0x40')](_[_0x4546('0x49')](_0x1aa678[_0x4546('0x3e')],_0x235e41[_0x4546('0x40')]));_0x49cac3[_0x4546('0x48')]['SmsAccountId']=_0x6bf923['id'];if(_0x1aa678['query'][_0x4546('0x4a')]){_0x49cac3[_0x4546('0x48')]=_[_0x4546('0x4b')](_0x49cac3[_0x4546('0x48')],{'$or':_[_0x4546('0x38')](_0x49cac3[_0x4546('0x42')],function(_0x4c1a64){var _0x4ad785={};_0x4ad785[_0x4c1a64]={'$like':'%'+_0x1aa678[_0x4546('0x3e')][_0x4546('0x4a')]+'%'};return _0x4ad785;})});}_0x49cac3=_[_0x4546('0x4b')]({},_0x49cac3,_0x1aa678[_0x4546('0x4d')]);return db[_0x4546('0x60')][_0x4546('0x4e')]({'where':_0x49cac3[_0x4546('0x48')]})[_0x4546('0x1f')](function(_0x56142c){_0x38681f[_0x4546('0x4e')]=_0x56142c;if(_0x1aa678['query'][_0x4546('0x4f')]){_0x49cac3[_0x4546('0x50')]=[{'all':!![]}];}return db[_0x4546('0x60')]['findAll'](_0x49cac3);})[_0x4546('0x1f')](function(_0x1d733f){_0x38681f[_0x4546('0x52')]=_0x1d733f;return _0x38681f;});}})[_0x4546('0x1f')](respondWithFilteredResult(_0x194667,_0x49cac3))[_0x4546('0x27')](handleError(_0x194667,null));};exports[_0x4546('0x62')]=function(_0x1b0670,_0x5858ea,_0x3ff208){return db[_0x4546('0x39')]['find']({'where':{'id':_0x1b0670[_0x4546('0x54')]['id']}})[_0x4546('0x1f')](handleEntityNotFound(_0x5858ea,null))['then'](function(_0x36f8b5){if(_0x36f8b5){return _0x36f8b5[_0x4546('0x62')](_0x1b0670[_0x4546('0x3e')][_0x4546('0x63')]);}})['then'](respondWithStatusCode(_0x5858ea,null))['catch'](handleError(_0x5858ea,null));};exports[_0x4546('0x64')]=function(_0x2c6d39,_0x51828c,_0x1ee186){if(_0x2c6d39[_0x4546('0x5c')]['id']){delete _0x2c6d39['body']['id'];}return db[_0x4546('0x39')][_0x4546('0x56')]({'where':{'id':_0x2c6d39[_0x4546('0x54')]['id']}})[_0x4546('0x1f')](handleEntityNotFound(_0x51828c,null))[_0x4546('0x1f')](function(_0x5966ce){if(_0x5966ce){_0x2c6d39[_0x4546('0x5c')]['SmsAccountId']=_0x5966ce['id'];return db[_0x4546('0x65')][_0x4546('0x57')](_0x2c6d39[_0x4546('0x5c')]);}})[_0x4546('0x1f')](respondWithResult(_0x51828c,null))[_0x4546('0x27')](handleError(_0x51828c,null));};exports[_0x4546('0x66')]=function(_0x26cb26,_0x210712,_0x534f82){var _0x1edb52={'raw':![],'where':{}};var _0x21c9fb={};var _0x353d63={'count':0x0,'rows':[]};return db[_0x4546('0x39')][_0x4546('0x67')]({'where':{'id':_0x26cb26['params']['id']}})[_0x4546('0x1f')](handleEntityNotFound(_0x210712,null))['then'](function(_0x5afda4){if(_0x5afda4){_0x21c9fb['model']=_[_0x4546('0x3f')](db[_0x4546('0x65')][_0x4546('0x3a')]);_0x21c9fb[_0x4546('0x3e')]=_[_0x4546('0x3f')](_0x26cb26[_0x4546('0x3e')]);_0x21c9fb[_0x4546('0x40')]=_[_0x4546('0x41')](_0x21c9fb[_0x4546('0x3d')],_0x21c9fb[_0x4546('0x3e')]);_0x1edb52['attributes']=_[_0x4546('0x41')](_0x21c9fb['model'],qs[_0x4546('0x43')](_0x26cb26[_0x4546('0x3e')][_0x4546('0x43')]));_0x1edb52[_0x4546('0x42')]=_0x1edb52[_0x4546('0x42')][_0x4546('0x55')]?_0x1edb52[_0x4546('0x42')]:_0x21c9fb['model'];if(!_0x26cb26[_0x4546('0x3e')][_0x4546('0x44')]('nolimit')){_0x1edb52[_0x4546('0x2d')]=qs[_0x4546('0x2d')](_0x26cb26[_0x4546('0x3e')][_0x4546('0x2d')]);_0x1edb52[_0x4546('0x2c')]=qs[_0x4546('0x2c')](_0x26cb26[_0x4546('0x3e')][_0x4546('0x2c')]);}_0x1edb52[_0x4546('0x46')]=qs[_0x4546('0x47')](_0x26cb26[_0x4546('0x3e')][_0x4546('0x47')]);_0x1edb52['where']=qs[_0x4546('0x40')](_[_0x4546('0x49')](_0x26cb26[_0x4546('0x3e')],_0x21c9fb[_0x4546('0x40')]));_0x1edb52[_0x4546('0x48')][_0x4546('0x5f')]=_0x5afda4['id'];if(_0x26cb26[_0x4546('0x3e')][_0x4546('0x4a')]){_0x1edb52[_0x4546('0x48')]=_[_0x4546('0x4b')](_0x1edb52[_0x4546('0x48')],{'$or':_[_0x4546('0x38')](_0x1edb52[_0x4546('0x42')],function(_0x39c7ed){var _0x1ebc4d={};_0x1ebc4d[_0x39c7ed]={'$like':'%'+_0x26cb26[_0x4546('0x3e')][_0x4546('0x4a')]+'%'};return _0x1ebc4d;})});}_0x1edb52=_[_0x4546('0x4b')]({},_0x1edb52,_0x26cb26[_0x4546('0x4d')]);return db[_0x4546('0x65')][_0x4546('0x4e')]({'where':_0x1edb52[_0x4546('0x48')]})[_0x4546('0x1f')](function(_0x58e21b){_0x353d63['count']=_0x58e21b;if(_0x26cb26[_0x4546('0x3e')]['includeAll']){_0x1edb52[_0x4546('0x50')]=[{'all':!![]}];}return db[_0x4546('0x65')][_0x4546('0x51')](_0x1edb52);})['then'](function(_0x161bc2){_0x353d63['rows']=_0x161bc2;return _0x353d63;});}})['then'](respondWithFilteredResult(_0x210712,_0x1edb52))[_0x4546('0x27')](handleError(_0x210712,null));};exports[_0x4546('0x68')]=function(_0xad28f5,_0x5e7fc1,_0x582e8a){return db[_0x4546('0x39')][_0x4546('0x56')]({'where':{'id':_0xad28f5['params']['id']}})[_0x4546('0x1f')](handleEntityNotFound(_0x5e7fc1,null))[_0x4546('0x1f')](function(_0x7157e6){if(_0x7157e6){return _0x7157e6[_0x4546('0x68')](_0xad28f5[_0x4546('0x3e')][_0x4546('0x63')]);}})[_0x4546('0x1f')](respondWithStatusCode(_0x5e7fc1,null))['catch'](handleError(_0x5e7fc1,null));};exports[_0x4546('0x69')]=function(_0x4cc533,_0x2d02f3,_0x5a9311){var _0x5130a4={'channel':_0x4546('0x6a')};var _0x4ceebf=[];var _0x4aee1f=[];var _0xb53087={};return db[_0x4546('0x39')][_0x4546('0x56')]({'where':{'id':_0x4cc533[_0x4546('0x54')]['id']},'include':[{'model':db[_0x4546('0x6b')],'as':_0x4546('0x6c')}]})[_0x4546('0x1f')](handleEntityNotFound(_0x2d02f3,null))['then'](function(_0xf459e4){_0x5130a4['account']=_0xf459e4;_0x5130a4[_0x4546('0x6d')]=_[_0x4546('0x6e')](_0xf459e4[_0x4546('0x6c')],[_0x4546('0x6f')],[_0x4546('0x70')]);if(_0x5130a4[_0x4546('0x71')]['Applications']){delete _0x5130a4[_0x4546('0x71')][_0x4546('0x6c')];}return db[_0x4546('0x72')][_0x4546('0x5d')]();})['then'](function(_0x33f125){if(!_0x33f125){throw new db[(_0x4546('0x1b'))][(_0x4546('0x1c'))]('no\x20available\x20attributes');}_0x4ceebf=_['difference'](_['keys'](_0x33f125),[_0x4546('0x73'),'updatedAt']);_0x4aee1f=_[_0x4546('0x74')](_['keys'](_0x33f125),[_0x4546('0x73'),'updatedAt',_0x4546('0x75'),_0x4546('0x76')]);_0x5130a4['body']={'mapKey':_0x4546('0x77')};if(_0x5130a4['account'][_0x4546('0x78')]){switch(_0x5130a4[_0x4546('0x71')][_0x4546('0x78')]){case _0x4546('0x79'):_0x5130a4[_0x4546('0x5c')]['from']=_0x4cc533[_0x4546('0x5c')][_0x4546('0x7a')];_0x5130a4[_0x4546('0x5c')][_0x4546('0x5c')]=_0x4cc533[_0x4546('0x5c')]['Body'];_0x5130a4[_0x4546('0x5c')][_0x4546('0x7b')]=_0x4cc533[_0x4546('0x5c')][_0x4546('0x7c')];break;case _0x4546('0x7d'):_0x5130a4[_0x4546('0x5c')]['from']='+'+_0x4cc533['body'][_0x4546('0x7e')];_0x5130a4[_0x4546('0x5c')][_0x4546('0x5c')]=_0x4cc533[_0x4546('0x5c')][_0x4546('0x7f')];break;case'connectel':_0x5130a4['body'][_0x4546('0x80')]=_0x4cc533[_0x4546('0x5c')][_0x4546('0x80')];_0x5130a4[_0x4546('0x5c')][_0x4546('0x5c')]=_0x4cc533[_0x4546('0x5c')][_0x4546('0x26')];break;case _0x4546('0x81'):_0x5130a4[_0x4546('0x5c')][_0x4546('0x80')]=_0x4cc533[_0x4546('0x5c')]['from'];_0x5130a4['body'][_0x4546('0x5c')]=_0x4cc533['body'][_0x4546('0x5c')];_0x5130a4['body']['messageId']=_0x4cc533['body'][_0x4546('0x82')];break;case _0x4546('0x83'):_0x5130a4[_0x4546('0x5c')][_0x4546('0x80')]=_0x4cc533[_0x4546('0x5c')]['From'];_0x5130a4[_0x4546('0x5c')][_0x4546('0x5c')]=_0x4cc533[_0x4546('0x5c')][_0x4546('0x84')];_0x5130a4[_0x4546('0x5c')][_0x4546('0x7b')]=_0x4cc533[_0x4546('0x5c')][_0x4546('0x85')];break;case _0x4546('0x86'):_0x5130a4[_0x4546('0x5c')]['from']='+'+_0x4cc533[_0x4546('0x5c')][_0x4546('0x87')][0x0]['from'];_0x5130a4['body'][_0x4546('0x5c')]=_0x4cc533[_0x4546('0x5c')]['results'][0x0][_0x4546('0x7f')];_0x5130a4['body']['messageId']=_0x4cc533['body'][_0x4546('0x87')][0x0][_0x4546('0x7b')];break;case'csc':_0x5130a4[_0x4546('0x5c')][_0x4546('0x80')]=_0x4cc533[_0x4546('0x5c')][_0x4546('0x88')];_0x5130a4['body'][_0x4546('0x5c')]=_0x4cc533[_0x4546('0x5c')][_0x4546('0x89')][_0x4546('0x26')];break;case _0x4546('0x8a'):_0x5130a4[_0x4546('0x5c')]['from']=_0x4cc533[_0x4546('0x5c')]['fromNumber'];_0x5130a4['body'][_0x4546('0x5c')]=_0x4cc533['body'][_0x4546('0x7f')];_0x5130a4[_0x4546('0x5c')][_0x4546('0x7b')]=_0x4cc533[_0x4546('0x5c')][_0x4546('0x8b')];break;case'intelepeer':_0x5130a4[_0x4546('0x5c')][_0x4546('0x80')]=_0x4cc533['body'][_0x4546('0x80')];_0x5130a4['body'][_0x4546('0x5c')]=_0x4cc533['body'][_0x4546('0x26')];_0x5130a4[_0x4546('0x5c')][_0x4546('0x7b')]=_0x4cc533[_0x4546('0x5c')][_0x4546('0x8c')];break;}}if(_0x5130a4[_0x4546('0x5c')]['id']){delete _0x5130a4['body']['id'];}if(_[_0x4546('0x8d')](_0x5130a4['body'][_0x4546('0x80')])){throw new db[(_0x4546('0x1b'))]['ValidationError'](_0x4546('0x8e'));}if(_[_0x4546('0x8d')](_0x5130a4['body'][_0x4546('0x5c')])||_0x5130a4[_0x4546('0x5c')][_0x4546('0x5c')]===''){throw new db[(_0x4546('0x1b'))][(_0x4546('0x1c'))](_0x4546('0x8f'));}if(_[_0x4546('0x8d')](_0x5130a4['body']['mapKey'])){throw new db[(_0x4546('0x1b'))][(_0x4546('0x1c'))](_0x4546('0x90')+_0x4aee1f);}if(!_[_0x4546('0x91')](_0x4aee1f,_0x5130a4[_0x4546('0x5c')][_0x4546('0x92')])){throw new db[(_0x4546('0x1b'))][(_0x4546('0x1c'))](_0x4546('0x93')+_0x4aee1f);}_0xb53087[_0x5130a4[_0x4546('0x5c')][_0x4546('0x92')]]=_0x5130a4[_0x4546('0x5c')][_0x4546('0x80')];return db[_0x4546('0x94')][_0x4546('0x56')]({'where':{'id':_0x5130a4[_0x4546('0x71')][_0x4546('0x76')]},'include':[{'model':db[_0x4546('0x72')],'as':_0x4546('0x95'),'where':_0xb53087,'limit':0x1,'order':[[_0x4546('0x96'),_0x4546('0x97')]]}]});})[_0x4546('0x1f')](handleEntityNotFound(_0x2d02f3,null))[_0x4546('0x1f')](function(_0x4bb287){if(_0x4bb287){_0x5130a4[_0x4546('0x98')]=_[_0x4546('0x99')](_0x4bb287,[_0x4546('0x95')]);if(_0x4bb287[_0x4546('0x95')][_0x4546('0x55')]){return _0x4bb287[_0x4546('0x95')][0x0];}var _0x250080=_[_0x4546('0x9a')](_0x5130a4['body'],{'firstName':_0x5130a4[_0x4546('0x5c')][_0x4546('0x80')],'ListId':_0x4bb287['id']});_0x250080[_0x5130a4[_0x4546('0x5c')][_0x4546('0x92')]]=_0x5130a4[_0x4546('0x5c')][_0x4546('0x80')];return db[_0x4546('0x72')]['create'](_0x250080,{'fields':_0x4ceebf,'raw':!![]});}})[_0x4546('0x1f')](handleEntityNotFound(_0x2d02f3,null))['then'](function(_0x59f47d){if(_0x59f47d){_0x5130a4[_0x4546('0x9b')]=_0x59f47d;var _0x3d4e8f={'ContactId':_0x59f47d['id'],'phone':_0x5130a4[_0x4546('0x5c')][_0x4546('0x80')],'SmsAccountId':_0x4cc533[_0x4546('0x54')]['id']};var _0x267015={'ContactId':_0x59f47d['id'],'SmsAccountId':_0x4cc533[_0x4546('0x54')]['id'],'closed':![]};return db['SmsInteraction'][_0x4546('0x56')]({'where':_0x267015})[_0x4546('0x1f')](function(_0x1a18d1){if(_0x1a18d1){return[_0x1a18d1,![]];}return db[_0x4546('0x9c')][_0x4546('0x57')](_0x3d4e8f)['then'](function(_0x8afc02){return[_0x8afc02,!![]];});});}})[_0x4546('0x9d')](function(_0x1fe14d,_0x1d4011){_0x5130a4[_0x4546('0x9e')]=_0x1fe14d[_0x4546('0x5a')]({'plain':!![]});_0x5130a4[_0x4546('0x9e')][_0x4546('0x9f')]=![];if(_0x1d4011){if(_0x5130a4[_0x4546('0x71')][_0x4546('0xa0')]){_0x5130a4[_0x4546('0x6d')][_0x4546('0xa1')]({'id':0x0,'priority':_0x5130a4[_0x4546('0x6d')][_0x4546('0x55')]+0x1,'app':_0x4546('0xa2'),'appdata':_0x4546('0xa3'),'interval':_0x4546('0xa4')});}_0x5130a4[_0x4546('0x9e')]['created']=!![];}return db['SmsMessage']['create']({'phone':_0x5130a4[_0x4546('0x5c')][_0x4546('0x80')],'messageId':_0x5130a4[_0x4546('0x5c')][_0x4546('0x7b')],'body':_0x5130a4[_0x4546('0x5c')][_0x4546('0x5c')],'SmsAccountId':_0x4cc533['params']['id'],'SmsInteractionId':_0x1fe14d['id'],'direction':'in','ContactId':_0x1fe14d[_0x4546('0xa5')],'AttachmentId':_0x5130a4[_0x4546('0x5c')][_0x4546('0xa6')]});})['then'](function(_0x346be6){_0x5130a4[_0x4546('0x26')]=_0x346be6;if(_0x5130a4['interaction']['UserId']){return db['User'][_0x4546('0x56')]({'attributes':['id',_0x4546('0x34')],'where':{'id':_0x5130a4[_0x4546('0x9e')]['UserId']}})[_0x4546('0x1f')](function(_0x45257d){if(_0x45257d){_0x5130a4[_0x4546('0x6d')][_0x4546('0xa7')]({'id':0x0,'priority':0x0,'app':_0x4546('0xa8'),'appdata':_0x45257d['name']+','+(_0x5130a4['account'][_0x4546('0xa9')]||0xa),'interval':_0x4546('0xa4')});}return respondWithRpcPromise(_0x4546('0xaa'),'startRouting',_0x5130a4);});}return respondWithRpcPromise(_0x4546('0xaa'),_0x4546('0xab'),_0x5130a4);})[_0x4546('0x1f')](function(_0x16208){if(_0x16208){var _0x1abe7e=0xc8;var _0x1d8d8e='receiveMessage';logger['info'](_0x4546('0x24'),_0x1d8d8e,_0x1abe7e,_0x4546('0xac'));logger[_0x4546('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x1d8d8e,_0x1abe7e,_0x4546('0xac'),JSON['stringify'](_0x16208));if(_0x5130a4[_0x4546('0x71')]['type']===_0x4546('0x79')){return _0x2d02f3[_0x4546('0x29')](_0x1abe7e)['set'](_0x4546('0xad'),_0x4546('0xae'))[_0x4546('0x35')]('\x0a');}else{return _0x2d02f3[_0x4546('0x29')](_0x1abe7e)[_0x4546('0x2b')](_0x16208);}}})[_0x4546('0x27')](handleError(_0x2d02f3,null));};exports[_0x4546('0xaf')]=function(_0x363a90,_0x6c9085,_0x419b8b){return db[_0x4546('0x39')][_0x4546('0x67')]({'where':{'id':_0x363a90[_0x4546('0x54')]['id']}})[_0x4546('0x1f')](handleEntityNotFound(_0x6c9085,null))[_0x4546('0x1f')](function(_0x58393e){if(_0x58393e){return db[_0x4546('0xb0')][_0x4546('0xb1')](function(_0x3d8e99){return db[_0x4546('0x6b')][_0x4546('0x32')]({'where':{'SmsAccountId':_0x363a90[_0x4546('0x54')]['id']},'transaction':_0x3d8e99})[_0x4546('0x1f')](function(_0x408755){var _0x2bbe7c=_[_0x4546('0x38')](_0x363a90[_0x4546('0x5c')],function(_0x56c900){_0x56c900[_0x4546('0x5f')]=_0x363a90[_0x4546('0x54')]['id'];return _0x56c900;});return db[_0x4546('0x6b')][_0x4546('0xb2')](_0x2bbe7c,{'transaction':_0x3d8e99});});})[_0x4546('0x1f')](function(){return db['SmsApplication'][_0x4546('0xb3')]({'where':{'SmsAccountId':_0x363a90[_0x4546('0x54')]['id']},'order':'priority'});});}})[_0x4546('0x1f')](respondWithResult(_0x6c9085,null))[_0x4546('0x27')](handleError(_0x6c9085,null));};exports['getApplications']=function(_0x424996,_0x1f0db1,_0x69a5f6){var _0x185c29={};var _0x53b906={};var _0x24615e;var _0x36a079;return db[_0x4546('0x39')]['findOne']({'where':{'id':_0x424996['params']['id']}})[_0x4546('0x1f')](handleEntityNotFound(_0x1f0db1,null))[_0x4546('0x1f')](function(_0x2e576d){if(_0x2e576d){_0x24615e=_0x2e576d;_0x53b906[_0x4546('0x3d')]=_[_0x4546('0x3f')](db[_0x4546('0x6b')]['rawAttributes']);_0x53b906[_0x4546('0x3e')]=_[_0x4546('0x3f')](_0x424996[_0x4546('0x3e')]);_0x53b906[_0x4546('0x40')]=_[_0x4546('0x41')](_0x53b906['model'],_0x53b906[_0x4546('0x3e')]);_0x185c29[_0x4546('0x42')]=_[_0x4546('0x41')](_0x53b906[_0x4546('0x3d')],qs[_0x4546('0x43')](_0x424996['query']['fields']));_0x185c29[_0x4546('0x42')]=_0x185c29[_0x4546('0x42')][_0x4546('0x55')]?_0x185c29[_0x4546('0x42')]:_0x53b906[_0x4546('0x3d')];_0x185c29[_0x4546('0x46')]=qs[_0x4546('0x47')](_0x424996[_0x4546('0x3e')][_0x4546('0x47')]);_0x185c29[_0x4546('0x48')]=qs[_0x4546('0x40')](_[_0x4546('0x49')](_0x424996['query'],_0x53b906[_0x4546('0x40')]));if(_0x424996['query']['filter']){_0x185c29[_0x4546('0x48')]=_[_0x4546('0x4b')](_0x185c29[_0x4546('0x48')],{'$or':_['map'](_0x185c29[_0x4546('0x42')],function(_0x491d7c){var _0x441ff5={};_0x441ff5[_0x491d7c]={'$like':'%'+_0x424996[_0x4546('0x3e')][_0x4546('0x4a')]+'%'};return _0x441ff5;})});}_0x185c29=_[_0x4546('0x4b')]({},_0x185c29,_0x424996[_0x4546('0x4d')]);return _0x24615e[_0x4546('0xb4')](_0x185c29);}})[_0x4546('0x1f')](function(_0x28017c){if(_0x28017c){_0x36a079=_0x28017c['length'];if(!_0x424996[_0x4546('0x3e')][_0x4546('0x44')]('nolimit')){_0x185c29['limit']=qs[_0x4546('0x2d')](_0x424996[_0x4546('0x3e')][_0x4546('0x2d')]);_0x185c29['offset']=qs[_0x4546('0x2c')](_0x424996['query']['offset']);}return _0x24615e['getApplications'](_0x185c29);}})[_0x4546('0x1f')](function(_0x542939){if(_0x542939){return _0x542939?{'count':_0x36a079,'rows':_0x542939}:null;}})[_0x4546('0x1f')](respondWithResult(_0x1f0db1,null))[_0x4546('0x27')](handleError(_0x1f0db1,null));};exports[_0x4546('0xb5')]=function(_0x252716,_0x2dc962,_0x49afa0){var _0x83839f={'raw':![],'where':{}};var _0x462df7={};var _0x5d6ae1={'count':0x0,'rows':[]};return db[_0x4546('0x39')][_0x4546('0x67')]({'where':{'id':_0x252716[_0x4546('0x54')]['id']}})['then'](handleEntityNotFound(_0x2dc962,null))['then'](function(_0x20eaa5){if(_0x20eaa5){_0x462df7[_0x4546('0x3d')]=_[_0x4546('0x3f')](db[_0x4546('0x9c')]['rawAttributes']);_0x462df7[_0x4546('0x3e')]=_[_0x4546('0x3f')](_0x252716['query']);_0x462df7[_0x4546('0x40')]=_[_0x4546('0x41')](_0x462df7['model'],_0x462df7[_0x4546('0x3e')]);_0x83839f[_0x4546('0x42')]=_[_0x4546('0x41')](_0x462df7[_0x4546('0x3d')],qs[_0x4546('0x43')](_0x252716[_0x4546('0x3e')][_0x4546('0x43')]));_0x83839f[_0x4546('0x42')]=_0x83839f[_0x4546('0x42')][_0x4546('0x55')]?_0x83839f[_0x4546('0x42')]:_0x462df7[_0x4546('0x3d')];if(!_0x252716[_0x4546('0x3e')][_0x4546('0x44')](_0x4546('0x45'))){_0x83839f[_0x4546('0x2d')]=qs[_0x4546('0x2d')](_0x252716[_0x4546('0x3e')][_0x4546('0x2d')]);_0x83839f[_0x4546('0x2c')]=qs[_0x4546('0x2c')](_0x252716[_0x4546('0x3e')]['offset']);}_0x83839f[_0x4546('0x46')]=qs['sort'](_0x252716['query'][_0x4546('0x47')]);_0x83839f[_0x4546('0x48')]=qs[_0x4546('0x40')](_[_0x4546('0x49')](_0x252716['query'],_0x462df7[_0x4546('0x40')]));_0x83839f[_0x4546('0x48')][_0x4546('0x5f')]=_0x20eaa5['id'];if(_0x252716[_0x4546('0x3e')][_0x4546('0x4a')]){_0x83839f[_0x4546('0x48')]=_[_0x4546('0x4b')](_0x83839f['where'],{'$or':_[_0x4546('0x38')](_0x83839f[_0x4546('0x42')],function(_0x136902){var _0x449ca5={};_0x449ca5[_0x136902]={'$like':'%'+_0x252716[_0x4546('0x3e')]['filter']+'%'};return _0x449ca5;})});}_0x83839f=_[_0x4546('0x4b')]({},_0x83839f,_0x252716['options']);return db[_0x4546('0x9c')]['count']({'where':_0x83839f[_0x4546('0x48')]})[_0x4546('0x1f')](function(_0x5be36b){_0x5d6ae1[_0x4546('0x4e')]=_0x5be36b;if(_0x252716[_0x4546('0x3e')]['includeAll']){_0x83839f['include']=[{'model':db[_0x4546('0x72')],'as':_0x4546('0xb6'),'required':![]},{'model':db[_0x4546('0xb7')],'as':_0x4546('0xb8'),'attributes':['name',_0x4546('0xb9'),_0x4546('0xba')],'required':![]},{'model':db[_0x4546('0xbb')],'as':_0x4546('0xbc'),'attributes':['id',_0x4546('0x34'),'color'],'where':_0x252716[_0x4546('0x3e')]['tag']?{'id':_0x252716['query']['tag']}:undefined,'required':_0x252716[_0x4546('0x3e')]['tag']?!![]:![]}];}return db['SmsInteraction'][_0x4546('0x51')](_0x83839f);})[_0x4546('0x1f')](function(_0x4a0208){_0x5d6ae1[_0x4546('0x52')]=_0x4a0208;return _0x5d6ae1;});}})[_0x4546('0x1f')](respondWithFilteredResult(_0x2dc962,_0x83839f))[_0x4546('0x27')](handleError(_0x2dc962,null));};exports['send']=function(_0x501a15,_0x4ce7ec,_0x718d7f){var _0x1fdeec,_0x2f04e2,_0x2b0f2d;if(_[_0x4546('0x8d')](_0x501a15[_0x4546('0x5c')][_0x4546('0x5c')])||_0x501a15[_0x4546('0x5c')][_0x4546('0x5c')]===''){throw new db[(_0x4546('0x1b'))][(_0x4546('0x1c'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x4546('0x8d')](_0x501a15['body']['to'])){throw new db[(_0x4546('0x1b'))]['ValidationError'](_0x4546('0xbd'));}_0x1fdeec=_0x501a15['body']['to'];return db[_0x4546('0x39')]['find']({'where':{'id':_0x501a15[_0x4546('0x54')]['id']},'include':[{'model':db[_0x4546('0x94')],'as':_0x4546('0xbe'),'include':[{'model':db[_0x4546('0x72')],'as':_0x4546('0x95'),'where':{'mobile':_0x1fdeec},'limit':0x1,'order':[[_0x4546('0x96'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x4ce7ec,null))['then'](function(_0xa1b910){if(_0xa1b910&&_0xa1b910[_0x4546('0xbe')]){_0x2f04e2=_0xa1b910[_0x4546('0x5a')]({'plain':!![]});if(_0x2f04e2[_0x4546('0xbe')]&&_0x2f04e2['List'][_0x4546('0x95')][_0x4546('0x55')]){return _0x2f04e2[_0x4546('0xbe')][_0x4546('0x95')][0x0];}return db[_0x4546('0x72')][_0x4546('0x57')](_['defaults'](_0x501a15[_0x4546('0x5c')],{'firstName':_0x1fdeec,'mobile':_0x1fdeec,'phone':_0x1fdeec,'ListId':_0x2f04e2[_0x4546('0x76')]}));}})[_0x4546('0x1f')](handleEntityNotFound(_0x4ce7ec,null))[_0x4546('0x1f')](function(_0x1a601d){if(_0x1a601d){_0x2b0f2d=_0x1a601d;return db[_0x4546('0x9c')][_0x4546('0x56')]({'where':{'ContactId':_0x2b0f2d['id'],'closed':![],'SmsAccountId':_0x2f04e2['id']}})['then'](function(_0x20d20e){if(_0x20d20e){return[_0x20d20e,![]];}return db['SmsInteraction'][_0x4546('0x57')]({'UserId':_0x501a15[_0x4546('0x58')]['id'],'ContactId':_0x2b0f2d['id'],'SmsAccountId':_0x2f04e2['id'],'phone':_0x1fdeec,'firstMsgDirection':_0x4546('0xbf'),'Messages':[_[_0x4546('0x4b')](_0x501a15['body'],{'read':![],'body':_0x501a15['body'][_0x4546('0x5c')],'phone':_0x1fdeec,'SmsAccountId':_0x2f04e2['id'],'UserId':_0x501a15['user']['id'],'ContactId':_0x2b0f2d['id']})]},{'include':[{'model':db[_0x4546('0xc0')],'as':_0x4546('0xc1')}]})[_0x4546('0x1f')](function(_0x3cbd9d){return[_0x3cbd9d,!![]];});});}})[_0x4546('0x9d')](function(_0x2d9552,_0xedf80d){if(_0xedf80d){return _0x2d9552;}return db['SmsMessage'][_0x4546('0x57')](_[_0x4546('0x4b')](_0x501a15['body'],{'read':![],'body':_0x501a15[_0x4546('0x5c')]['body'],'phone':_0x1fdeec,'SmsAccountId':_0x2f04e2['id'],'SmsInteractionId':_0x2d9552['id'],'UserId':_0x501a15[_0x4546('0x58')]['id'],'ContactId':_0x2b0f2d['id']}))[_0x4546('0x1f')](function(_0x6fc99b){_0x2d9552[_0x4546('0xc2')][_0x4546('0xc1')]=[];_0x2d9552['dataValues'][_0x4546('0xc1')][_0x4546('0xa1')](_0x6fc99b[_0x4546('0xc2')]);return _0x2d9552;});})[_0x4546('0x1f')](respondWithResult(_0x4ce7ec,null))[_0x4546('0x27')](handleError(_0x4ce7ec,null));};exports[_0x4546('0x29')]=function(_0x47393c,_0x409d8d,_0x48d75d){if(_0x47393c[_0x4546('0x5c')]['id']){delete _0x47393c[_0x4546('0x5c')]['id'];}console['log'](_0x4546('0xc3'),_0x47393c[_0x4546('0x5c')]);var _0x14f52d,_0xbf0b56,_0x1a9bf2;return db[_0x4546('0x39')][_0x4546('0x56')]({'where':{'id':_0x47393c[_0x4546('0x54')]['id']}})[_0x4546('0x1f')](handleEntityNotFound(_0x409d8d,null))[_0x4546('0x1f')](function(_0x2158b0){if(_0x2158b0){_0x1a9bf2=_0x2158b0;logger[_0x4546('0x23')](_0x4546('0x24'),_0x4546('0x29'),_0x4546('0xc4'),_0x2158b0[_0x4546('0x78')],util[_0x4546('0xc5')](_0x47393c[_0x4546('0x5c')],{'showHidden':![],'depth':null}));switch(_0x2158b0[_0x4546('0x78')]){case _0x4546('0x7d'):if(_0x47393c[_0x4546('0x5c')][_0x4546('0xc6')]&&_0x47393c['body'][_0x4546('0x29')]){_0xbf0b56=_0x47393c[_0x4546('0x5c')][_0x4546('0x29')];return db[_0x4546('0xc0')]['find']({'where':{'messageId':_0x47393c[_0x4546('0x5c')][_0x4546('0xc6')]}});}break;case _0x4546('0xc7'):if(_0x47393c[_0x4546('0x5c')][_0x4546('0xc8')]&&_0x47393c['body']['statusInt']){_0xbf0b56=_0x47393c['body'][_0x4546('0xc9')];return db[_0x4546('0xc0')]['find']({'where':{'messageId':_0x47393c['body'][_0x4546('0xc8')]}});}break;case'clicksend':if(_0x47393c['body'][_0x4546('0x82')]&&_0x47393c[_0x4546('0x5c')]['status_code']){_0xbf0b56=_0x47393c[_0x4546('0x5c')][_0x4546('0xca')];return db[_0x4546('0xc0')]['find']({'where':{'messageId':_0x47393c[_0x4546('0x5c')][_0x4546('0x82')]}});}break;case _0x4546('0x86'):var _0x22e634=_0x47393c[_0x4546('0x5c')][_0x4546('0x87')][0x0];if(_0x22e634[_0x4546('0x7b')]&&_0x22e634[_0x4546('0x29')][_0x4546('0xcb')]===_0x4546('0xcc')){_0xbf0b56=_0x22e634['status'][_0x4546('0xcb')];return db[_0x4546('0xc0')][_0x4546('0x56')]({'where':{'messageId':_0x22e634[_0x4546('0x7b')]}});}break;case _0x4546('0x8a'):if(_0x47393c[_0x4546('0x5c')][_0x4546('0x7b')]&&_0x47393c[_0x4546('0x5c')][_0x4546('0x29')]){_0xbf0b56=_0x47393c[_0x4546('0x5c')][_0x4546('0x29')];return db[_0x4546('0xc0')]['find']({'where':{'messageId':_0x47393c[_0x4546('0x5c')][_0x4546('0x7b')]}});}break;case _0x4546('0xcd'):if(_0x47393c['body'][_0x4546('0xce')]&&_0x47393c[_0x4546('0x5c')]['status']){_0xbf0b56=_0x47393c[_0x4546('0x5c')][_0x4546('0x29')];return db[_0x4546('0xc0')]['find']({'where':{'messageId':_0x47393c[_0x4546('0x5c')]['redif']}});}break;}}})[_0x4546('0x1f')](handleEntityNotFound(_0x409d8d,null))[_0x4546('0x1f')](function(_0xd9b798){if(_0xd9b798){_0x14f52d=_0xd9b798;switch(_0x1a9bf2['type']){case'skebby':if(_0xbf0b56==='DELIVERED'){return _0x14f52d[_0x4546('0x31')]({'read':!![]});}else{logger[_0x4546('0x25')](_0x4546('0x24'),_0x4546('0x29'),_0x4546('0x7d'),util[_0x4546('0xc5')](_0x47393c['body'],{'showHidden':![],'depth':null}));}break;case _0x4546('0xc7'):if(_0xbf0b56==='1'){return _0x14f52d[_0x4546('0x31')]({'read':!![]});}else{logger[_0x4546('0x25')](_0x4546('0x24'),_0x4546('0x29'),_0x4546('0x7d'),util[_0x4546('0xc5')](_0x47393c[_0x4546('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x4546('0x81'):if(!_0x47393c[_0x4546('0x5c')][_0x4546('0xcf')]&&_0xbf0b56>=0xc8&&_0xbf0b56<=0xce){return _0x14f52d[_0x4546('0x31')]({'read':!![]});}else{logger[_0x4546('0x25')](_0x4546('0x24'),_0x4546('0x29'),_0x4546('0x81'),util[_0x4546('0xc5')](_0x47393c[_0x4546('0x5c')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x3b5a0e=_0x47393c[_0x4546('0x5c')][_0x4546('0x87')][0x0];if(_0x3b5a0e[_0x4546('0x29')][_0x4546('0xcb')]===_0x4546('0xcc')){return _0x14f52d[_0x4546('0x31')]({'read':!![]});}else{logger[_0x4546('0x25')](_0x4546('0x24'),_0x4546('0x29'),_0x4546('0x86'),util['inspect'](_0x47393c[_0x4546('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x4546('0x8a'):if(_0xbf0b56==_0x4546('0xd0')||_0xbf0b56=='RECEIVED_BY_RECIPIENT'){return _0x14f52d['update']({'read':!![]});}else{logger[_0x4546('0x25')](_0x4546('0x24'),_0x4546('0x29'),_0x4546('0x8a'),util[_0x4546('0xc5')](_0x47393c['body'],{'showHidden':![],'depth':null}));}break;case _0x4546('0xcd'):if(_0xbf0b56===_0x4546('0xd1')||_0xbf0b56==='ACCEPTD'){return _0x14f52d['update']({'read':!![]});}else{logger[_0x4546('0x25')](_0x4546('0x24'),_0x4546('0x29'),_0x4546('0xcd'),util[_0x4546('0xc5')](_0x47393c['body'],{'showHidden':![],'depth':null}));}break;}return _0x14f52d;}})[_0x4546('0x1f')](respondWithResult(_0x409d8d,null))[_0x4546('0x27')](handleError(_0x409d8d,null));};exports[_0x4546('0xd2')]=function(_0x5a4433,_0x8c331d,_0x33abcc){var _0x12055e,_0x5d24e0,_0x5936b9;return db[_0x4546('0x39')]['find']({'where':{'id':_0x5a4433[_0x4546('0x54')]['id']}})[_0x4546('0x1f')](handleEntityNotFound(_0x8c331d,null))[_0x4546('0x1f')](function(_0x15f19d){if(_0x15f19d){_0x5936b9=_0x15f19d;logger[_0x4546('0x23')](_0x4546('0x24'),_0x4546('0x29'),_0x4546('0xc4'),_0x15f19d[_0x4546('0x78')],util['inspect'](_0x5a4433[_0x4546('0x3e')],{'showHidden':![],'depth':null}));switch(_0x15f19d[_0x4546('0x78')]){case _0x4546('0xd3'):if(_0x5a4433[_0x4546('0x3e')][_0x4546('0xd4')]&&_0x5a4433[_0x4546('0x3e')]['state']){_0x5d24e0=_0x5a4433[_0x4546('0x3e')]['state'];return db[_0x4546('0xc0')][_0x4546('0x56')]({'where':{'messageId':_0x5a4433[_0x4546('0x3e')][_0x4546('0xd4')]}});}break;}}})['then'](handleEntityNotFound(_0x8c331d,null))[_0x4546('0x1f')](function(_0x30df79){if(_0x30df79){_0x12055e=_0x30df79;switch(_0x5936b9['type']){case _0x4546('0xd3'):if(_0x5d24e0==='2'||_0x5d24e0==='6'){return _0x12055e[_0x4546('0x31')]({'read':!![]});}else{logger[_0x4546('0x25')](_0x4546('0x24'),'status','csc',util[_0x4546('0xc5')](_0x5a4433[_0x4546('0x3e')],{'showHidden':![],'depth':null}));};break;}return _0x12055e;}})[_0x4546('0x1f')](respondWithResult(_0x8c331d,null))[_0x4546('0x27')](handleError(_0x8c331d,null));};exports[_0x4546('0xd5')]=function(_0x1d4d6f,_0x14c9a8,_0x556c7e){return db['SmsAccount'][_0x4546('0x56')]({'where':{'id':_0x1d4d6f[_0x4546('0x54')]['id']}})[_0x4546('0x1f')](handleEntityNotFound(_0x14c9a8,null))[_0x4546('0x1f')](function(_0x57debd){if(_0x57debd){return _0x57debd[_0x4546('0xd5')](_0x1d4d6f['body'][_0x4546('0x63')],_['omit'](_0x1d4d6f[_0x4546('0x5c')],[_0x4546('0x63'),'id'])||{})[_0x4546('0x9d')](function(_0x438135){for(var _0x159edf=0x0;_0x159edf<_0x1d4d6f[_0x4546('0x5c')][_0x4546('0x63')][_0x4546('0x55')];_0x159edf+=0x1){socket['emit'](_0x4546('0xd6'),{'UserId':_0x1d4d6f['body'][_0x4546('0x63')][_0x159edf],'SmsAccountId':_0x1d4d6f[_0x4546('0x54')]['id']});}return _0x438135;});}})['then'](respondWithResult(_0x14c9a8,null))[_0x4546('0x27')](handleError(_0x14c9a8,null));};exports[_0x4546('0xd7')]=function(_0x3cdc6a,_0x3b18af,_0x174434){return db[_0x4546('0x39')][_0x4546('0x56')]({'where':{'id':_0x3cdc6a[_0x4546('0x54')]['id']}})[_0x4546('0x1f')](handleEntityNotFound(_0x3b18af,null))[_0x4546('0x1f')](function(_0x582309){if(_0x582309){return _0x582309[_0x4546('0xd7')](_0x3cdc6a[_0x4546('0x3e')]['ids'])[_0x4546('0x1f')](function(){if(_[_0x4546('0xd8')](_0x3cdc6a['query'][_0x4546('0x63')])){for(var _0x591b2c=0x0;_0x591b2c<_0x3cdc6a[_0x4546('0x3e')]['ids'][_0x4546('0x55')];_0x591b2c+=0x1){socket[_0x4546('0xd9')](_0x4546('0xda'),{'UserId':Number(_0x3cdc6a[_0x4546('0x3e')][_0x4546('0x63')][_0x591b2c]),'SmsAccountId':Number(_0x3cdc6a[_0x4546('0x54')]['id'])});}}else{socket[_0x4546('0xd9')](_0x4546('0xda'),{'UserId':Number(_0x3cdc6a[_0x4546('0x3e')][_0x4546('0x63')]),'SmsAccountId':Number(_0x3cdc6a['params']['id'])});}});}})[_0x4546('0x1f')](respondWithStatusCode(_0x3b18af,null))['catch'](handleError(_0x3b18af,null));};exports['getAgents']=function(_0x1ad855,_0x15fa00,_0x4a8c3d){var _0x23d98b={};var _0x132471={};var _0x24fd51;var _0x27360e;return db['SmsAccount']['findOne']({'where':{'id':_0x1ad855[_0x4546('0x54')]['id']}})['then'](handleEntityNotFound(_0x15fa00,null))[_0x4546('0x1f')](function(_0x355fdc){if(_0x355fdc){_0x24fd51=_0x355fdc;_0x132471[_0x4546('0x3d')]=_[_0x4546('0x3f')](db[_0x4546('0xb7')][_0x4546('0x3a')]);_0x132471[_0x4546('0x3e')]=_['keys'](_0x1ad855[_0x4546('0x3e')]);_0x132471['filters']=_[_0x4546('0x41')](_0x132471['model'],_0x132471['query']);_0x23d98b[_0x4546('0x42')]=_[_0x4546('0x41')](_0x132471[_0x4546('0x3d')],qs[_0x4546('0x43')](_0x1ad855[_0x4546('0x3e')]['fields']));_0x23d98b['attributes']=_0x23d98b[_0x4546('0x42')][_0x4546('0x55')]?_0x23d98b['attributes']:_0x132471[_0x4546('0x3d')];_0x23d98b[_0x4546('0x46')]=qs[_0x4546('0x47')](_0x1ad855[_0x4546('0x3e')][_0x4546('0x47')]);_0x23d98b[_0x4546('0x48')]=qs['filters'](_[_0x4546('0x49')](_0x1ad855[_0x4546('0x3e')],_0x132471[_0x4546('0x40')]));if(_0x1ad855[_0x4546('0x3e')][_0x4546('0x4a')]){_0x23d98b['where']=_['merge'](_0x23d98b['where'],{'$or':_[_0x4546('0x38')](_0x23d98b['attributes'],function(_0x182b5d){var _0x279d6a={};_0x279d6a[_0x182b5d]={'$like':'%'+_0x1ad855[_0x4546('0x3e')][_0x4546('0x4a')]+'%'};return _0x279d6a;})});}_0x23d98b=_[_0x4546('0x4b')]({},_0x23d98b,_0x1ad855[_0x4546('0x4d')]);return _0x24fd51['getAgents'](_0x23d98b);}})[_0x4546('0x1f')](function(_0x225059){if(_0x225059){_0x27360e=_0x225059[_0x4546('0x55')];if(!_0x1ad855['query'][_0x4546('0x44')](_0x4546('0x45'))){_0x23d98b['limit']=qs[_0x4546('0x2d')](_0x1ad855[_0x4546('0x3e')][_0x4546('0x2d')]);_0x23d98b[_0x4546('0x2c')]=qs[_0x4546('0x2c')](_0x1ad855['query'][_0x4546('0x2c')]);}return _0x24fd51['getAgents'](_0x23d98b);}})[_0x4546('0x1f')](function(_0x871603){if(_0x871603){return _0x871603?{'count':_0x27360e,'rows':_0x871603}:null;}})[_0x4546('0x1f')](respondWithResult(_0x15fa00,null))['catch'](handleError(_0x15fa00,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 701d84e..74c8116 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 _0x66c1=['emit','hasOwnProperty','exports','../../mysqldb','setMaxListeners','save','update'];(function(_0x2493a8,_0x5a240d){var _0x2b06c9=function(_0x198d3c){while(--_0x198d3c){_0x2493a8['push'](_0x2493a8['shift']());}};_0x2b06c9(++_0x5a240d);}(_0x66c1,0xce));var _0x166c=function(_0x22ef92,_0xefec9){_0x22ef92=_0x22ef92-0x0;var _0x2526ee=_0x66c1[_0x22ef92];return _0x2526ee;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0x166c('0x0'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x166c('0x1')](0x0);var events={'afterCreate':_0x166c('0x2'),'afterUpdate':_0x166c('0x3'),'afterDestroy':'remove'};function emitEvent(_0x36d9f1){return function(_0x226a9d,_0x1d0978,_0x438400){SmsAccountEvents[_0x166c('0x4')](_0x36d9f1+':'+_0x226a9d['id'],_0x226a9d);SmsAccountEvents['emit'](_0x36d9f1,_0x226a9d);_0x438400(null);};}for(var e in events){if(events[_0x166c('0x5')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x166c('0x6')]=SmsAccountEvents; \ No newline at end of file +var _0x13e6=['emit','hasOwnProperty','hook','events','../../mysqldb','save','update','remove'];(function(_0x1c1904,_0x496ea2){var _0x57892c=function(_0x426c6e){while(--_0x426c6e){_0x1c1904['push'](_0x1c1904['shift']());}};_0x57892c(++_0x496ea2);}(_0x13e6,0x1b3));var _0x613e=function(_0x7fd79e,_0x7abf8c){_0x7fd79e=_0x7fd79e-0x0;var _0x14ef62=_0x13e6[_0x7fd79e];return _0x14ef62;};'use strict';var EventEmitter=require(_0x613e('0x0'));var SmsAccount=require(_0x613e('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x613e('0x2'),'afterUpdate':_0x613e('0x3'),'afterDestroy':_0x613e('0x4')};function emitEvent(_0x24aefc){return function(_0xa32986,_0xc39493,_0x48f320){SmsAccountEvents[_0x613e('0x5')](_0x24aefc+':'+_0xa32986['id'],_0xa32986);SmsAccountEvents[_0x613e('0x5')](_0x24aefc,_0xa32986);_0x48f320(null);};}for(var e in events){if(events[_0x613e('0x6')](e)){var event=events[e];SmsAccount[_0x613e('0x7')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 68df93e..12a95b6 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 _0x64e5=['path','rimraf','../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','lodash','util','../../config/logger','moment','request-promise'];(function(_0x16c248,_0x42ec2c){var _0x26e279=function(_0x2c39f4){while(--_0x2c39f4){_0x16c248['push'](_0x16c248['shift']());}};_0x26e279(++_0x42ec2c);}(_0x64e5,0x1cf));var _0x564e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x64e5[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x564e('0x0'));var util=require(_0x564e('0x1'));var logger=require(_0x564e('0x2'))('api');var moment=require(_0x564e('0x3'));var BPromise=require('bluebird');var rp=require(_0x564e('0x4'));var fs=require('fs');var path=require(_0x564e('0x5'));var rimraf=require(_0x564e('0x6'));var config=require(_0x564e('0x7'));var attributes=require(_0x564e('0x8'));module[_0x564e('0x9')]=function(_0x2c7192,_0x5db6c7){return _0x2c7192[_0x564e('0xa')](_0x564e('0xb'),attributes,{'tableName':_0x564e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9ab7=['path','rimraf','../../config/environment','./smsAccount.attributes','define','sms_accounts','../../config/logger','moment','bluebird','request-promise'];(function(_0x16d369,_0xbbaa52){var _0x53c1ca=function(_0x49908d){while(--_0x49908d){_0x16d369['push'](_0x16d369['shift']());}};_0x53c1ca(++_0xbbaa52);}(_0x9ab7,0x1b4));var _0x79ab=function(_0xef5a96,_0x3228c8){_0xef5a96=_0xef5a96-0x0;var _0x572188=_0x9ab7[_0xef5a96];return _0x572188;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x79ab('0x0'))('api');var moment=require(_0x79ab('0x1'));var BPromise=require(_0x79ab('0x2'));var rp=require(_0x79ab('0x3'));var fs=require('fs');var path=require(_0x79ab('0x4'));var rimraf=require(_0x79ab('0x5'));var config=require(_0x79ab('0x6'));var attributes=require(_0x79ab('0x7'));module['exports']=function(_0x571d57,_0x491405){return _0x571d57[_0x79ab('0x8')]('SmsAccount',attributes,{'tableName':_0x79ab('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index 6d6ff6f..ca15762 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 _0x3ba7=['map','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','request','then','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','include','model','attributes'];(function(_0x2d982d,_0x121028){var _0x4f36b0=function(_0x11f3a9){while(--_0x11f3a9){_0x2d982d['push'](_0x2d982d['shift']());}};_0x4f36b0(++_0x121028);}(_0x3ba7,0x173));var _0x73ba=function(_0x4acafa,_0x34aee4){_0x4acafa=_0x4acafa-0x0;var _0x191277=_0x3ba7[_0x4acafa];return _0x191277;};'use strict';var _=require(_0x73ba('0x0'));var util=require('util');var moment=require(_0x73ba('0x1'));var BPromise=require(_0x73ba('0x2'));var rs=require(_0x73ba('0x3'));var fs=require('fs');var Redis=require(_0x73ba('0x4'));var db=require(_0x73ba('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x73ba('0x6'))('rpc');var config=require(_0x73ba('0x7'));var jayson=require(_0x73ba('0x8'));var client=jayson[_0x73ba('0x9')]['http']({'port':0x232a});config['redis']=_[_0x73ba('0xa')](config[_0x73ba('0xb')],{'host':_0x73ba('0xc'),'port':0x18eb});var socket=require(_0x73ba('0xd'))(new Redis(config['redis']));require(_0x73ba('0xe'))['register'](socket);function respondWithRpcPromise(_0x29167b,_0x39a183,_0x3e794f){return new BPromise(function(_0x467cf3,_0x4d2b9d){return client[_0x73ba('0xf')](_0x29167b,_0x3e794f)[_0x73ba('0x10')](function(_0x17a563){logger['info'](_0x73ba('0x11'),_0x39a183,_0x73ba('0x12'));logger[_0x73ba('0x13')](_0x73ba('0x14'),_0x39a183,_0x73ba('0x12'),JSON[_0x73ba('0x15')](_0x17a563));if(_0x17a563[_0x73ba('0x16')]){if(_0x17a563[_0x73ba('0x16')][_0x73ba('0x17')]===0x1f4){logger[_0x73ba('0x16')]('SmsAccount,\x20%s,\x20%s',_0x39a183,_0x17a563[_0x73ba('0x16')]['message']);return _0x4d2b9d(_0x17a563[_0x73ba('0x16')][_0x73ba('0x18')]);}logger[_0x73ba('0x16')]('SmsAccount,\x20%s,\x20%s',_0x39a183,_0x17a563[_0x73ba('0x16')][_0x73ba('0x18')]);return _0x467cf3(_0x17a563[_0x73ba('0x16')][_0x73ba('0x18')]);}else{logger['info'](_0x73ba('0x11'),_0x39a183,'request\x20sent');_0x467cf3(_0x17a563[_0x73ba('0x19')][_0x73ba('0x18')]);}})[_0x73ba('0x1a')](function(_0x446b3a){logger[_0x73ba('0x16')]('SmsAccount,\x20%s,\x20%s',_0x39a183,_0x446b3a);_0x4d2b9d(_0x446b3a);});});}exports[_0x73ba('0x1b')]=function(_0x4729e0){var _0x2f99f3=this;return new Promise(function(_0x216a8d,_0x5e06a1){return db[_0x73ba('0x1c')][_0x73ba('0x1d')]({'raw':_0x4729e0[_0x73ba('0x1e')]?_0x4729e0['options'][_0x73ba('0x1f')]===undefined?!![]:![]:!![],'where':_0x4729e0[_0x73ba('0x1e')]?_0x4729e0[_0x73ba('0x1e')][_0x73ba('0x20')]||null:null,'attributes':_0x4729e0[_0x73ba('0x1e')]?_0x4729e0[_0x73ba('0x1e')]['attributes']||null:null,'include':_0x4729e0['options']?_0x4729e0[_0x73ba('0x1e')][_0x73ba('0x21')]?_['map'](_0x4729e0['options']['include'],function(_0xb5e3ec){return{'model':db[_0xb5e3ec[_0x73ba('0x22')]],'as':_0xb5e3ec['as'],'attributes':_0xb5e3ec[_0x73ba('0x23')],'include':_0xb5e3ec[_0x73ba('0x21')]?_[_0x73ba('0x24')](_0xb5e3ec[_0x73ba('0x21')],function(_0x1f76c3){return{'model':db[_0x1f76c3['model']],'as':_0x1f76c3['as'],'attributes':_0x1f76c3[_0x73ba('0x23')],'include':_0x1f76c3[_0x73ba('0x21')]?_[_0x73ba('0x24')](_0x1f76c3[_0x73ba('0x21')],function(_0x5bb102){return{'model':db[_0x5bb102[_0x73ba('0x22')]],'as':_0x5bb102['as'],'attributes':_0x5bb102[_0x73ba('0x23')]};}):[]};}):[]};}):[]:[]})[_0x73ba('0x10')](function(_0xa36764){logger['info'](_0x73ba('0x1b'),_0x4729e0);logger['debug'](_0x73ba('0x1b'),_0x4729e0,JSON[_0x73ba('0x15')](_0xa36764));_0x216a8d(_0xa36764);})['catch'](function(_0x2890d8){logger[_0x73ba('0x16')](_0x73ba('0x1b'),_0x2890d8[_0x73ba('0x18')],_0x4729e0);_0x5e06a1(_0x2f99f3[_0x73ba('0x16')](0x1f4,_0x2890d8[_0x73ba('0x18')]));});});}; \ No newline at end of file +var _0x5d02=['SmsAccount','find','options','raw','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','result','catch','ShowSmsAccount'];(function(_0x4dfab6,_0x8c7866){var _0x164dcf=function(_0x1fe4a0){while(--_0x1fe4a0){_0x4dfab6['push'](_0x4dfab6['shift']());}};_0x164dcf(++_0x8c7866);}(_0x5d02,0xf3));var _0x25d0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5d02[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x25d0('0x0'));var util=require(_0x25d0('0x1'));var moment=require(_0x25d0('0x2'));var BPromise=require(_0x25d0('0x3'));var rs=require(_0x25d0('0x4'));var fs=require('fs');var Redis=require(_0x25d0('0x5'));var db=require(_0x25d0('0x6'))['db'];var utils=require(_0x25d0('0x7'));var logger=require('../../config/logger')(_0x25d0('0x8'));var config=require('../../config/environment');var jayson=require(_0x25d0('0x9'));var client=jayson[_0x25d0('0xa')][_0x25d0('0xb')]({'port':0x232a});config[_0x25d0('0xc')]=_[_0x25d0('0xd')](config[_0x25d0('0xc')],{'host':_0x25d0('0xe'),'port':0x18eb});var socket=require(_0x25d0('0xf'))(new Redis(config[_0x25d0('0xc')]));require('./smsAccount.socket')['register'](socket);function respondWithRpcPromise(_0x283303,_0x13721f,_0x12a80f){return new BPromise(function(_0x1b9975,_0x24a055){return client[_0x25d0('0x10')](_0x283303,_0x12a80f)[_0x25d0('0x11')](function(_0x1258b2){logger[_0x25d0('0x12')]('SmsAccount,\x20%s,\x20%s',_0x13721f,_0x25d0('0x13'));logger[_0x25d0('0x14')](_0x25d0('0x15'),_0x13721f,_0x25d0('0x13'),JSON[_0x25d0('0x16')](_0x1258b2));if(_0x1258b2[_0x25d0('0x17')]){if(_0x1258b2[_0x25d0('0x17')][_0x25d0('0x18')]===0x1f4){logger[_0x25d0('0x17')](_0x25d0('0x19'),_0x13721f,_0x1258b2[_0x25d0('0x17')][_0x25d0('0x1a')]);return _0x24a055(_0x1258b2[_0x25d0('0x17')][_0x25d0('0x1a')]);}logger[_0x25d0('0x17')]('SmsAccount,\x20%s,\x20%s',_0x13721f,_0x1258b2[_0x25d0('0x17')][_0x25d0('0x1a')]);return _0x1b9975(_0x1258b2[_0x25d0('0x17')][_0x25d0('0x1a')]);}else{logger['info'](_0x25d0('0x19'),_0x13721f,_0x25d0('0x13'));_0x1b9975(_0x1258b2[_0x25d0('0x1b')][_0x25d0('0x1a')]);}})[_0x25d0('0x1c')](function(_0x1d87cb){logger['error']('SmsAccount,\x20%s,\x20%s',_0x13721f,_0x1d87cb);_0x24a055(_0x1d87cb);});});}exports[_0x25d0('0x1d')]=function(_0x2708e9){var _0x5189e9=this;return new Promise(function(_0x5b23da,_0x29739f){return db[_0x25d0('0x1e')][_0x25d0('0x1f')]({'raw':_0x2708e9[_0x25d0('0x20')]?_0x2708e9['options'][_0x25d0('0x21')]===undefined?!![]:![]:!![],'where':_0x2708e9[_0x25d0('0x20')]?_0x2708e9[_0x25d0('0x20')][_0x25d0('0x22')]||null:null,'attributes':_0x2708e9['options']?_0x2708e9[_0x25d0('0x20')][_0x25d0('0x23')]||null:null,'include':_0x2708e9[_0x25d0('0x20')]?_0x2708e9['options'][_0x25d0('0x24')]?_[_0x25d0('0x25')](_0x2708e9['options'][_0x25d0('0x24')],function(_0x514649){return{'model':db[_0x514649[_0x25d0('0x26')]],'as':_0x514649['as'],'attributes':_0x514649[_0x25d0('0x23')],'include':_0x514649[_0x25d0('0x24')]?_[_0x25d0('0x25')](_0x514649[_0x25d0('0x24')],function(_0x39238f){return{'model':db[_0x39238f[_0x25d0('0x26')]],'as':_0x39238f['as'],'attributes':_0x39238f['attributes'],'include':_0x39238f['include']?_[_0x25d0('0x25')](_0x39238f[_0x25d0('0x24')],function(_0x19a3f9){return{'model':db[_0x19a3f9['model']],'as':_0x19a3f9['as'],'attributes':_0x19a3f9[_0x25d0('0x23')]};}):[]};}):[]};}):[]:[]})[_0x25d0('0x11')](function(_0x391ad9){logger[_0x25d0('0x12')](_0x25d0('0x1d'),_0x2708e9);logger[_0x25d0('0x14')](_0x25d0('0x1d'),_0x2708e9,JSON[_0x25d0('0x16')](_0x391ad9));_0x5b23da(_0x391ad9);})[_0x25d0('0x1c')](function(_0x47a91a){logger[_0x25d0('0x17')]('ShowSmsAccount',_0x47a91a[_0x25d0('0x1a')],_0x2708e9);_0x29739f(_0x5189e9[_0x25d0('0x17')](0x1f4,_0x47a91a[_0x25d0('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 28bf156..14008bc 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 _0x020a=['smsAccount:','./smsAccount.events','save','remove','emit','removeListener','register','length'];(function(_0x798c45,_0x4c51bb){var _0x5b4c0a=function(_0x34af05){while(--_0x34af05){_0x798c45['push'](_0x798c45['shift']());}};_0x5b4c0a(++_0x4c51bb);}(_0x020a,0xc9));var _0xa020=function(_0x4fa97c,_0x4aa6ab){_0x4fa97c=_0x4fa97c-0x0;var _0x518c7f=_0x020a[_0x4fa97c];return _0x518c7f;};'use strict';var SmsAccountEvents=require(_0xa020('0x0'));var events=[_0xa020('0x1'),_0xa020('0x2'),'update'];function createListener(_0x30fdbc,_0x461623){return function(_0x3f2ab5){_0x461623[_0xa020('0x3')](_0x30fdbc,_0x3f2ab5);};}function removeListener(_0xa15fd7,_0x347152){return function(){SmsAccountEvents[_0xa020('0x4')](_0xa15fd7,_0x347152);};}exports[_0xa020('0x5')]=function(_0x46be7a){for(var _0xd8d116=0x0,_0x584ce7=events[_0xa020('0x6')];_0xd8d116<_0x584ce7;_0xd8d116++){var _0x36e64a=events[_0xd8d116];var _0x14823b=createListener(_0xa020('0x7')+_0x36e64a,_0x46be7a);SmsAccountEvents['on'](_0x36e64a,_0x14823b);}}; \ No newline at end of file +var _0xd6cb=['register','length','smsAccount:','./smsAccount.events','save','remove','update'];(function(_0x332e76,_0x4a89f7){var _0x1126f2=function(_0x3133af){while(--_0x3133af){_0x332e76['push'](_0x332e76['shift']());}};_0x1126f2(++_0x4a89f7);}(_0xd6cb,0x9d));var _0xbd6c=function(_0x34226f,_0x1cd113){_0x34226f=_0x34226f-0x0;var _0x1bf7dc=_0xd6cb[_0x34226f];return _0x1bf7dc;};'use strict';var SmsAccountEvents=require(_0xbd6c('0x0'));var events=[_0xbd6c('0x1'),_0xbd6c('0x2'),_0xbd6c('0x3')];function createListener(_0x18d14c,_0x271cdf){return function(_0x36a428){_0x271cdf['emit'](_0x18d14c,_0x36a428);};}function removeListener(_0x3ae9b3,_0x4f1740){return function(){SmsAccountEvents['removeListener'](_0x3ae9b3,_0x4f1740);};}exports[_0xbd6c('0x4')]=function(_0x309ac5){for(var _0x9bdefb=0x0,_0x54329f=events[_0xbd6c('0x5')];_0x9bdefb<_0x54329f;_0x9bdefb++){var _0x55b9ad=events[_0x9bdefb];var _0x5b148e=createListener(_0xbd6c('0x6')+_0x55b9ad,_0x309ac5);SmsAccountEvents['on'](_0x55b9ad,_0x5b148e);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index de36a60..3538272 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 _0xe330=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','show','post','create','put','update','delete','/:id','destroy','exports','multer','util'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xe330,0x14e));var _0x0e33=function(_0x309449,_0x5300fd){_0x309449=_0x309449-0x0;var _0x16b34a=_0xe330[_0x309449];return _0x16b34a;};'use strict';var multer=require(_0x0e33('0x0'));var util=require(_0x0e33('0x1'));var path=require(_0x0e33('0x2'));var timeout=require('connect-timeout');var express=require(_0x0e33('0x3'));var router=express[_0x0e33('0x4')]();var auth=require(_0x0e33('0x5'));var interaction=require(_0x0e33('0x6'));var config=require(_0x0e33('0x7'));var controller=require(_0x0e33('0x8'));router[_0x0e33('0x9')]('/',auth[_0x0e33('0xa')](),controller[_0x0e33('0xb')]);router[_0x0e33('0x9')]('/:id',auth[_0x0e33('0xa')](),controller[_0x0e33('0xc')]);router[_0x0e33('0xd')]('/',auth[_0x0e33('0xa')](),controller[_0x0e33('0xe')]);router[_0x0e33('0xf')]('/:id',auth[_0x0e33('0xa')](),controller[_0x0e33('0x10')]);router[_0x0e33('0x11')](_0x0e33('0x12'),auth['isAuthenticated'](),controller[_0x0e33('0x13')]);module[_0x0e33('0x14')]=router; \ No newline at end of file +var _0x9d18=['show','post','create','put','/:id','isAuthenticated','delete','exports','multer','util','connect-timeout','express','Router','./smsApplication.controller','index','get'];(function(_0x598408,_0x5e6f74){var _0x560720=function(_0x56a96d){while(--_0x56a96d){_0x598408['push'](_0x598408['shift']());}};_0x560720(++_0x5e6f74);}(_0x9d18,0x1c8));var _0x89d1=function(_0xda3f86,_0x32c86c){_0xda3f86=_0xda3f86-0x0;var _0x1bcc40=_0x9d18[_0xda3f86];return _0x1bcc40;};'use strict';var multer=require(_0x89d1('0x0'));var util=require(_0x89d1('0x1'));var path=require('path');var timeout=require(_0x89d1('0x2'));var express=require(_0x89d1('0x3'));var router=express[_0x89d1('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x89d1('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x89d1('0x6')]);router[_0x89d1('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x89d1('0x8')]);router[_0x89d1('0x9')]('/',auth['isAuthenticated'](),controller[_0x89d1('0xa')]);router[_0x89d1('0xb')](_0x89d1('0xc'),auth[_0x89d1('0xd')](),controller['update']);router[_0x89d1('0xe')]('/:id',auth[_0x89d1('0xd')](),controller['destroy']);module[_0x89d1('0xf')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 7570e56..c2f3ef5 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 _0x2cb8=['TEXT','*,*,*,*','sequelize','INTEGER','STRING','noop'];(function(_0x3e8d2d,_0x16725c){var _0x29e14e=function(_0x586e6c){while(--_0x586e6c){_0x3e8d2d['push'](_0x3e8d2d['shift']());}};_0x29e14e(++_0x16725c);}(_0x2cb8,0x140));var _0x82cb=function(_0x4fe7bb,_0x4e4ecd){_0x4fe7bb=_0x4fe7bb-0x0;var _0x4c24a2=_0x2cb8[_0x4fe7bb];return _0x4c24a2;};'use strict';var Sequelize=require(_0x82cb('0x0'));module['exports']={'priority':{'type':Sequelize[_0x82cb('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x82cb('0x2')],'allowNull':![],'defaultValue':_0x82cb('0x3')},'appdata':{'type':Sequelize[_0x82cb('0x4')]()},'description':{'type':Sequelize[_0x82cb('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x82cb('0x5')}}; \ No newline at end of file +var _0x8d99=['TEXT','sequelize','exports','STRING'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x8d99,0xa9));var _0x98d9=function(_0x302e6c,_0x18e914){_0x302e6c=_0x302e6c-0x0;var _0x1401d2=_0x8d99[_0x302e6c];return _0x1401d2;};'use strict';var Sequelize=require(_0x98d9('0x0'));module[_0x98d9('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x98d9('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x98d9('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x98d9('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 66281fd..6129969 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 _0x14df=['status','count','limit','set','json','apply','reject','update','then','destroy','end','error','stack','name','send','map','SmsApplication','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','nolimit','offset','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','length','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb'];(function(_0x1793de,_0x4d7233){var _0x4f0309=function(_0x229ee7){while(--_0x229ee7){_0x1793de['push'](_0x1793de['shift']());}};_0x4f0309(++_0x4d7233);}(_0x14df,0xf7));var _0xf14d=function(_0x1dc697,_0x443268){_0x1dc697=_0x1dc697-0x0;var _0xc24af4=_0x14df[_0x1dc697];return _0xc24af4;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xf14d('0x0'));var zipdir=require(_0xf14d('0x1'));var jsonpatch=require(_0xf14d('0x2'));var rp=require(_0xf14d('0x3'));var moment=require(_0xf14d('0x4'));var BPromise=require(_0xf14d('0x5'));var Mustache=require(_0xf14d('0x6'));var util=require('util');var path=require(_0xf14d('0x7'));var sox=require(_0xf14d('0x8'));var csv=require(_0xf14d('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf14d('0xa'));var deskjs=require(_0xf14d('0xb'));var toCsv=require(_0xf14d('0x9'));var querystring=require(_0xf14d('0xc'));var Papa=require(_0xf14d('0xd'));var Redis=require(_0xf14d('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xf14d('0xf'));var as=require(_0xf14d('0x10'));var hardwareService=require(_0xf14d('0x11'));var logger=require(_0xf14d('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xf14d('0x13'));var db=require(_0xf14d('0x14'))['db'];function respondWithStatusCode(_0x4f0ce9,_0x317bf1){_0x317bf1=_0x317bf1||0xcc;return function(_0x3f4aa5){if(_0x3f4aa5){return _0x4f0ce9['sendStatus'](_0x317bf1);}return _0x4f0ce9['status'](_0x317bf1)['end']();};}function respondWithResult(_0x462ebd,_0x46a9a7){_0x46a9a7=_0x46a9a7||0xc8;return function(_0x3fbbd0){if(_0x3fbbd0){return _0x462ebd[_0xf14d('0x15')](_0x46a9a7)['json'](_0x3fbbd0);}};}function respondWithFilteredResult(_0x1cb140,_0x3682c1){return function(_0x545a2c){if(_0x545a2c){var _0x186c3c=_0x545a2c[_0xf14d('0x16')],_0x17d7c3=_0x3682c1['offset'],_0x2807fe=_0x3682c1['offset']+_0x3682c1[_0xf14d('0x17')],_0x5d71f4;if(_0x2807fe>=_0x186c3c){_0x2807fe=_0x186c3c;_0x5d71f4=0xc8;}else{_0x5d71f4=0xce;}_0x1cb140[_0xf14d('0x15')](_0x5d71f4);return _0x1cb140[_0xf14d('0x18')]('Content-Range',_0x17d7c3+'-'+_0x2807fe+'/'+_0x186c3c)[_0xf14d('0x19')](_0x545a2c);}return null;};}function patchUpdates(_0x383cea){return function(_0x28efbe){try{jsonpatch[_0xf14d('0x1a')](_0x28efbe,_0x383cea,!![]);}catch(_0x57aa71){return BPromise[_0xf14d('0x1b')](_0x57aa71);}return _0x28efbe['save']();};}function saveUpdates(_0x1b0d21,_0x8f1f0){return function(_0x25db48){if(_0x25db48){return _0x25db48[_0xf14d('0x1c')](_0x1b0d21)[_0xf14d('0x1d')](function(_0x1adfac){return _0x1adfac;});}return null;};}function removeEntity(_0x5431d5,_0x4599d3){return function(_0x10d3b0){if(_0x10d3b0){return _0x10d3b0[_0xf14d('0x1e')]()[_0xf14d('0x1d')](function(){_0x5431d5[_0xf14d('0x15')](0xcc)[_0xf14d('0x1f')]();});}};}function handleEntityNotFound(_0x28f26e,_0x5b6efa){return function(_0x455e78){if(!_0x455e78){_0x28f26e['sendStatus'](0x194);}return _0x455e78;};}function handleError(_0x45f306,_0x400820){_0x400820=_0x400820||0x1f4;return function(_0x476d31){logger[_0xf14d('0x20')](_0x476d31[_0xf14d('0x21')]);if(_0x476d31[_0xf14d('0x22')]){delete _0x476d31[_0xf14d('0x22')];}_0x45f306[_0xf14d('0x15')](_0x400820)[_0xf14d('0x23')](_0x476d31);};}exports['index']=function(_0x5166c9,_0x3b9eaa){var _0x3e96={},_0x181660={},_0x5d6664={'count':0x0,'rows':[]};var _0x243156=_[_0xf14d('0x24')](db[_0xf14d('0x25')][_0xf14d('0x26')],function(_0xc6c61b){return{'name':_0xc6c61b['fieldName'],'type':_0xc6c61b[_0xf14d('0x27')][_0xf14d('0x28')]};});_0x181660[_0xf14d('0x29')]=_[_0xf14d('0x24')](_0x243156,_0xf14d('0x22'));_0x181660[_0xf14d('0x2a')]=_[_0xf14d('0x2b')](_0x5166c9['query']);_0x181660['filters']=_[_0xf14d('0x2c')](_0x181660['model'],_0x181660['query']);_0x3e96['attributes']=_[_0xf14d('0x2c')](_0x181660[_0xf14d('0x29')],qs['fields'](_0x5166c9[_0xf14d('0x2a')][_0xf14d('0x2d')]));_0x3e96[_0xf14d('0x2e')]=_0x3e96[_0xf14d('0x2e')]['length']?_0x3e96['attributes']:_0x181660[_0xf14d('0x29')];if(!_0x5166c9[_0xf14d('0x2a')]['hasOwnProperty'](_0xf14d('0x2f'))){_0x3e96[_0xf14d('0x17')]=qs[_0xf14d('0x17')](_0x5166c9[_0xf14d('0x2a')][_0xf14d('0x17')]);_0x3e96['offset']=qs[_0xf14d('0x30')](_0x5166c9['query'][_0xf14d('0x30')]);}_0x3e96[_0xf14d('0x31')]=qs[_0xf14d('0x32')](_0x5166c9[_0xf14d('0x2a')][_0xf14d('0x32')]);_0x3e96[_0xf14d('0x33')]=qs[_0xf14d('0x34')](_['pick'](_0x5166c9[_0xf14d('0x2a')],_0x181660[_0xf14d('0x34')]));if(_0x5166c9[_0xf14d('0x2a')][_0xf14d('0x35')]){_0x3e96['where']=_[_0xf14d('0x36')](_0x3e96[_0xf14d('0x33')],{'$or':_[_0xf14d('0x24')](_0x243156,function(_0x30c527){if(_0x30c527['type']!==_0xf14d('0x37')){var _0x1c171b={};_0x1c171b[_0x30c527[_0xf14d('0x22')]]={'$like':'%'+_0x5166c9[_0xf14d('0x2a')][_0xf14d('0x35')]+'%'};return _0x1c171b;}})});}_0x3e96=_[_0xf14d('0x36')]({},_0x3e96,_0x5166c9[_0xf14d('0x38')]);var _0x13f952={'where':_0x3e96[_0xf14d('0x33')]};return db[_0xf14d('0x25')]['count'](_0x13f952)[_0xf14d('0x1d')](function(_0xf2b80d){_0x5d6664[_0xf14d('0x16')]=_0xf2b80d;if(_0x5166c9[_0xf14d('0x2a')][_0xf14d('0x39')]){_0x3e96[_0xf14d('0x3a')]=[{'all':!![]}];}return db[_0xf14d('0x25')][_0xf14d('0x3b')](_0x3e96);})[_0xf14d('0x1d')](function(_0xb74f01){_0x5d6664['rows']=_0xb74f01;return _0x5d6664;})['then'](respondWithFilteredResult(_0x3b9eaa,_0x3e96))[_0xf14d('0x3c')](handleError(_0x3b9eaa,null));};exports[_0xf14d('0x3d')]=function(_0x36181a,_0x25ea17){var _0x3942f9={'raw':!![],'where':{'id':_0x36181a[_0xf14d('0x3e')]['id']}},_0xd4e38f={};_0xd4e38f[_0xf14d('0x29')]=_[_0xf14d('0x2b')](db['SmsApplication'][_0xf14d('0x26')]);_0xd4e38f[_0xf14d('0x2a')]=_[_0xf14d('0x2b')](_0x36181a[_0xf14d('0x2a')]);_0xd4e38f[_0xf14d('0x34')]=_[_0xf14d('0x2c')](_0xd4e38f[_0xf14d('0x29')],_0xd4e38f[_0xf14d('0x2a')]);_0x3942f9['attributes']=_[_0xf14d('0x2c')](_0xd4e38f[_0xf14d('0x29')],qs['fields'](_0x36181a[_0xf14d('0x2a')][_0xf14d('0x2d')]));_0x3942f9[_0xf14d('0x2e')]=_0x3942f9[_0xf14d('0x2e')][_0xf14d('0x3f')]?_0x3942f9[_0xf14d('0x2e')]:_0xd4e38f[_0xf14d('0x29')];if(_0x36181a[_0xf14d('0x2a')][_0xf14d('0x39')]){_0x3942f9['include']=[{'all':!![]}];}_0x3942f9=_['merge']({},_0x3942f9,_0x36181a[_0xf14d('0x38')]);return db['SmsApplication'][_0xf14d('0x40')](_0x3942f9)[_0xf14d('0x1d')](handleEntityNotFound(_0x25ea17,null))[_0xf14d('0x1d')](respondWithResult(_0x25ea17,null))['catch'](handleError(_0x25ea17,null));};exports[_0xf14d('0x41')]=function(_0x4e9f9e,_0x202116){return db[_0xf14d('0x25')][_0xf14d('0x41')](_0x4e9f9e[_0xf14d('0x42')],{})[_0xf14d('0x1d')](respondWithResult(_0x202116,0xc9))['catch'](handleError(_0x202116,null));};exports['update']=function(_0x1fea73,_0x8d8907){if(_0x1fea73[_0xf14d('0x42')]['id']){delete _0x1fea73[_0xf14d('0x42')]['id'];}return db['SmsApplication'][_0xf14d('0x40')]({'where':{'id':_0x1fea73['params']['id']}})[_0xf14d('0x1d')](handleEntityNotFound(_0x8d8907,null))[_0xf14d('0x1d')](saveUpdates(_0x1fea73[_0xf14d('0x42')],null))['then'](respondWithResult(_0x8d8907,null))[_0xf14d('0x3c')](handleError(_0x8d8907,null));};exports[_0xf14d('0x1e')]=function(_0x7ed580,_0x37b78e){return db[_0xf14d('0x25')][_0xf14d('0x40')]({'where':{'id':_0x7ed580[_0xf14d('0x3e')]['id']}})[_0xf14d('0x1d')](handleEntityNotFound(_0x37b78e,null))[_0xf14d('0x1d')](removeEntity(_0x37b78e,null))['catch'](handleError(_0x37b78e,null));}; \ No newline at end of file +var _0xecd9=['map','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','SmsApplication','findAll','rows','catch','show','params','keys','rawAttributes','length','find','create','body','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','count','offset','limit','json','apply','reject','update','then','destroy','stack','name','send','index'];(function(_0x32f589,_0x2f3495){var _0x47b493=function(_0x419340){while(--_0x419340){_0x32f589['push'](_0x32f589['shift']());}};_0x47b493(++_0x2f3495);}(_0xecd9,0xb1));var _0x9ecd=function(_0x3caf29,_0xbb55cd){_0x3caf29=_0x3caf29-0x0;var _0x5cb434=_0xecd9[_0x3caf29];return _0x5cb434;};'use strict';var pdf=require(_0x9ecd('0x0'));var emlformat=require(_0x9ecd('0x1'));var rimraf=require(_0x9ecd('0x2'));var zipdir=require(_0x9ecd('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9ecd('0x4'));var BPromise=require(_0x9ecd('0x5'));var Mustache=require('mustache');var util=require(_0x9ecd('0x6'));var path=require(_0x9ecd('0x7'));var sox=require(_0x9ecd('0x8'));var csv=require(_0x9ecd('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9ecd('0xa'));var squel=require(_0x9ecd('0xb'));var crypto=require(_0x9ecd('0xc'));var jsforce=require(_0x9ecd('0xd'));var deskjs=require(_0x9ecd('0xe'));var toCsv=require(_0x9ecd('0x9'));var querystring=require(_0x9ecd('0xf'));var Papa=require(_0x9ecd('0x10'));var Redis=require('ioredis');var authService=require(_0x9ecd('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9ecd('0x12'));var hardwareService=require(_0x9ecd('0x13'));var logger=require('../../config/logger')(_0x9ecd('0x14'));var utils=require(_0x9ecd('0x15'));var config=require(_0x9ecd('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55d30a,_0x175def){_0x175def=_0x175def||0xcc;return function(_0x3193f5){if(_0x3193f5){return _0x55d30a[_0x9ecd('0x17')](_0x175def);}return _0x55d30a[_0x9ecd('0x18')](_0x175def)[_0x9ecd('0x19')]();};}function respondWithResult(_0xeb29b4,_0x7cf6d3){_0x7cf6d3=_0x7cf6d3||0xc8;return function(_0x4485e7){if(_0x4485e7){return _0xeb29b4['status'](_0x7cf6d3)['json'](_0x4485e7);}};}function respondWithFilteredResult(_0x3d035c,_0x2f7825){return function(_0x560a7c){if(_0x560a7c){var _0x18eb56=_0x560a7c[_0x9ecd('0x1a')],_0x1dc848=_0x2f7825[_0x9ecd('0x1b')],_0x4d70b5=_0x2f7825[_0x9ecd('0x1b')]+_0x2f7825[_0x9ecd('0x1c')],_0x379eb8;if(_0x4d70b5>=_0x18eb56){_0x4d70b5=_0x18eb56;_0x379eb8=0xc8;}else{_0x379eb8=0xce;}_0x3d035c['status'](_0x379eb8);return _0x3d035c['set']('Content-Range',_0x1dc848+'-'+_0x4d70b5+'/'+_0x18eb56)[_0x9ecd('0x1d')](_0x560a7c);}return null;};}function patchUpdates(_0x55d2cb){return function(_0x13458b){try{jsonpatch[_0x9ecd('0x1e')](_0x13458b,_0x55d2cb,!![]);}catch(_0x3a44ab){return BPromise[_0x9ecd('0x1f')](_0x3a44ab);}return _0x13458b['save']();};}function saveUpdates(_0x596447,_0x372784){return function(_0x145c30){if(_0x145c30){return _0x145c30[_0x9ecd('0x20')](_0x596447)[_0x9ecd('0x21')](function(_0x30d4cf){return _0x30d4cf;});}return null;};}function removeEntity(_0x452353,_0x260bc4){return function(_0x1ff49b){if(_0x1ff49b){return _0x1ff49b[_0x9ecd('0x22')]()[_0x9ecd('0x21')](function(){_0x452353[_0x9ecd('0x18')](0xcc)[_0x9ecd('0x19')]();});}};}function handleEntityNotFound(_0x49c888,_0x418833){return function(_0x1565f6){if(!_0x1565f6){_0x49c888[_0x9ecd('0x17')](0x194);}return _0x1565f6;};}function handleError(_0x513f30,_0x21b996){_0x21b996=_0x21b996||0x1f4;return function(_0x6e2a66){logger['error'](_0x6e2a66[_0x9ecd('0x23')]);if(_0x6e2a66['name']){delete _0x6e2a66[_0x9ecd('0x24')];}_0x513f30[_0x9ecd('0x18')](_0x21b996)[_0x9ecd('0x25')](_0x6e2a66);};}exports[_0x9ecd('0x26')]=function(_0x5a7156,_0x28f8ed){var _0x55c303={},_0x1d1202={},_0x415172={'count':0x0,'rows':[]};var _0x767199=_[_0x9ecd('0x27')](db['SmsApplication']['rawAttributes'],function(_0x31e5fd){return{'name':_0x31e5fd[_0x9ecd('0x28')],'type':_0x31e5fd['type'][_0x9ecd('0x29')]};});_0x1d1202[_0x9ecd('0x2a')]=_[_0x9ecd('0x27')](_0x767199,_0x9ecd('0x24'));_0x1d1202[_0x9ecd('0x2b')]=_['keys'](_0x5a7156[_0x9ecd('0x2b')]);_0x1d1202[_0x9ecd('0x2c')]=_[_0x9ecd('0x2d')](_0x1d1202['model'],_0x1d1202[_0x9ecd('0x2b')]);_0x55c303[_0x9ecd('0x2e')]=_['intersection'](_0x1d1202[_0x9ecd('0x2a')],qs[_0x9ecd('0x2f')](_0x5a7156[_0x9ecd('0x2b')]['fields']));_0x55c303[_0x9ecd('0x2e')]=_0x55c303['attributes']['length']?_0x55c303[_0x9ecd('0x2e')]:_0x1d1202[_0x9ecd('0x2a')];if(!_0x5a7156['query'][_0x9ecd('0x30')](_0x9ecd('0x31'))){_0x55c303['limit']=qs[_0x9ecd('0x1c')](_0x5a7156['query'][_0x9ecd('0x1c')]);_0x55c303['offset']=qs[_0x9ecd('0x1b')](_0x5a7156[_0x9ecd('0x2b')][_0x9ecd('0x1b')]);}_0x55c303[_0x9ecd('0x32')]=qs[_0x9ecd('0x33')](_0x5a7156['query'][_0x9ecd('0x33')]);_0x55c303[_0x9ecd('0x34')]=qs[_0x9ecd('0x2c')](_[_0x9ecd('0x35')](_0x5a7156[_0x9ecd('0x2b')],_0x1d1202[_0x9ecd('0x2c')]));if(_0x5a7156[_0x9ecd('0x2b')][_0x9ecd('0x36')]){_0x55c303['where']=_[_0x9ecd('0x37')](_0x55c303[_0x9ecd('0x34')],{'$or':_[_0x9ecd('0x27')](_0x767199,function(_0x11d9ba){if(_0x11d9ba['type']!==_0x9ecd('0x38')){var _0x3a70f2={};_0x3a70f2[_0x11d9ba[_0x9ecd('0x24')]]={'$like':'%'+_0x5a7156['query'][_0x9ecd('0x36')]+'%'};return _0x3a70f2;}})});}_0x55c303=_[_0x9ecd('0x37')]({},_0x55c303,_0x5a7156[_0x9ecd('0x39')]);var _0x21857b={'where':_0x55c303[_0x9ecd('0x34')]};return db['SmsApplication'][_0x9ecd('0x1a')](_0x21857b)[_0x9ecd('0x21')](function(_0x23492c){_0x415172[_0x9ecd('0x1a')]=_0x23492c;if(_0x5a7156[_0x9ecd('0x2b')][_0x9ecd('0x3a')]){_0x55c303[_0x9ecd('0x3b')]=[{'all':!![]}];}return db[_0x9ecd('0x3c')][_0x9ecd('0x3d')](_0x55c303);})[_0x9ecd('0x21')](function(_0x38e772){_0x415172[_0x9ecd('0x3e')]=_0x38e772;return _0x415172;})[_0x9ecd('0x21')](respondWithFilteredResult(_0x28f8ed,_0x55c303))[_0x9ecd('0x3f')](handleError(_0x28f8ed,null));};exports[_0x9ecd('0x40')]=function(_0x343cfb,_0x52e5e6){var _0x3603dc={'raw':!![],'where':{'id':_0x343cfb[_0x9ecd('0x41')]['id']}},_0x4c019b={};_0x4c019b[_0x9ecd('0x2a')]=_[_0x9ecd('0x42')](db[_0x9ecd('0x3c')][_0x9ecd('0x43')]);_0x4c019b[_0x9ecd('0x2b')]=_['keys'](_0x343cfb['query']);_0x4c019b[_0x9ecd('0x2c')]=_[_0x9ecd('0x2d')](_0x4c019b[_0x9ecd('0x2a')],_0x4c019b['query']);_0x3603dc[_0x9ecd('0x2e')]=_[_0x9ecd('0x2d')](_0x4c019b[_0x9ecd('0x2a')],qs[_0x9ecd('0x2f')](_0x343cfb[_0x9ecd('0x2b')][_0x9ecd('0x2f')]));_0x3603dc['attributes']=_0x3603dc[_0x9ecd('0x2e')][_0x9ecd('0x44')]?_0x3603dc[_0x9ecd('0x2e')]:_0x4c019b['model'];if(_0x343cfb['query'][_0x9ecd('0x3a')]){_0x3603dc[_0x9ecd('0x3b')]=[{'all':!![]}];}_0x3603dc=_[_0x9ecd('0x37')]({},_0x3603dc,_0x343cfb['options']);return db[_0x9ecd('0x3c')][_0x9ecd('0x45')](_0x3603dc)[_0x9ecd('0x21')](handleEntityNotFound(_0x52e5e6,null))[_0x9ecd('0x21')](respondWithResult(_0x52e5e6,null))[_0x9ecd('0x3f')](handleError(_0x52e5e6,null));};exports[_0x9ecd('0x46')]=function(_0x57717a,_0x3e7406){return db[_0x9ecd('0x3c')][_0x9ecd('0x46')](_0x57717a['body'],{})[_0x9ecd('0x21')](respondWithResult(_0x3e7406,0xc9))['catch'](handleError(_0x3e7406,null));};exports[_0x9ecd('0x20')]=function(_0xf8553c,_0x529af5){if(_0xf8553c[_0x9ecd('0x47')]['id']){delete _0xf8553c[_0x9ecd('0x47')]['id'];}return db[_0x9ecd('0x3c')][_0x9ecd('0x45')]({'where':{'id':_0xf8553c['params']['id']}})[_0x9ecd('0x21')](handleEntityNotFound(_0x529af5,null))[_0x9ecd('0x21')](saveUpdates(_0xf8553c[_0x9ecd('0x47')],null))[_0x9ecd('0x21')](respondWithResult(_0x529af5,null))['catch'](handleError(_0x529af5,null));};exports[_0x9ecd('0x22')]=function(_0x4a132a,_0xd1b7d5){return db[_0x9ecd('0x3c')][_0x9ecd('0x45')]({'where':{'id':_0x4a132a['params']['id']}})[_0x9ecd('0x21')](handleEntityNotFound(_0xd1b7d5,null))[_0x9ecd('0x21')](removeEntity(_0xd1b7d5,null))['catch'](handleError(_0xd1b7d5,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 4be38d1..332a5ea 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 _0x65f7=['utf8mb4','lodash','util','api','moment','rimraf','../../config/environment','./smsApplication.attributes','SmsApplication','sms_applications'];(function(_0x567011,_0x273172){var _0x50ac02=function(_0x79f2ba){while(--_0x79f2ba){_0x567011['push'](_0x567011['shift']());}};_0x50ac02(++_0x273172);}(_0x65f7,0x1a5));var _0x765f=function(_0x103d6d,_0x5bd3c2){_0x103d6d=_0x103d6d-0x0;var _0x1a512b=_0x65f7[_0x103d6d];return _0x1a512b;};'use strict';var _=require(_0x765f('0x0'));var util=require(_0x765f('0x1'));var logger=require('../../config/logger')(_0x765f('0x2'));var moment=require(_0x765f('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x765f('0x4'));var config=require(_0x765f('0x5'));var attributes=require(_0x765f('0x6'));module['exports']=function(_0x29c966,_0x2e7ec4){return _0x29c966['define'](_0x765f('0x7'),attributes,{'tableName':_0x765f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x765f('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xf777=['SmsApplication','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./smsApplication.attributes','define'];(function(_0x333714,_0x3370ac){var _0x4c211e=function(_0x34219b){while(--_0x34219b){_0x333714['push'](_0x333714['shift']());}};_0x4c211e(++_0x3370ac);}(_0xf777,0x6b));var _0x7f77=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf777[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7f77('0x0'));var util=require('util');var logger=require(_0x7f77('0x1'))(_0x7f77('0x2'));var moment=require(_0x7f77('0x3'));var BPromise=require(_0x7f77('0x4'));var rp=require(_0x7f77('0x5'));var fs=require('fs');var path=require(_0x7f77('0x6'));var rimraf=require('rimraf');var config=require(_0x7f77('0x7'));var attributes=require(_0x7f77('0x8'));module['exports']=function(_0x77ab46,_0x124f8b){return _0x77ab46[_0x7f77('0x9')](_0x7f77('0xa'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7f77('0xb'),'collate':_0x7f77('0xc')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 53ebe01..6c5876b 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 _0x0734=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','info','SmsApplication,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x37636f,_0x3b5d9b){var _0xafa975=function(_0x25b60a){while(--_0x25b60a){_0x37636f['push'](_0x37636f['shift']());}};_0xafa975(++_0x3b5d9b);}(_0x0734,0xba));var _0x4073=function(_0x326579,_0x17d883){_0x326579=_0x326579-0x0;var _0xc270e3=_0x0734[_0x326579];return _0xc270e3;};'use strict';var _=require(_0x4073('0x0'));var util=require(_0x4073('0x1'));var moment=require(_0x4073('0x2'));var BPromise=require(_0x4073('0x3'));var rs=require(_0x4073('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4073('0x5'))['db'];var utils=require(_0x4073('0x6'));var logger=require(_0x4073('0x7'))(_0x4073('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4073('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c3c14,_0x2195e0,_0x1251bd){return new BPromise(function(_0x22a33d,_0x51515d){return client[_0x4073('0xa')](_0x2c3c14,_0x1251bd)['then'](function(_0x5432c4){logger[_0x4073('0xb')](_0x4073('0xc'),_0x2195e0,_0x4073('0xd'));logger['debug']('SmsApplication,\x20%s,\x20%s,\x20%s',_0x2195e0,_0x4073('0xd'),JSON[_0x4073('0xe')](_0x5432c4));if(_0x5432c4['error']){if(_0x5432c4[_0x4073('0xf')]['code']===0x1f4){logger[_0x4073('0xf')](_0x4073('0xc'),_0x2195e0,_0x5432c4[_0x4073('0xf')][_0x4073('0x10')]);return _0x51515d(_0x5432c4['error'][_0x4073('0x10')]);}logger[_0x4073('0xf')]('SmsApplication,\x20%s,\x20%s',_0x2195e0,_0x5432c4[_0x4073('0xf')][_0x4073('0x10')]);return _0x22a33d(_0x5432c4[_0x4073('0xf')][_0x4073('0x10')]);}else{logger[_0x4073('0xb')](_0x4073('0xc'),_0x2195e0,'request\x20sent');_0x22a33d(_0x5432c4[_0x4073('0x11')]['message']);}})[_0x4073('0x12')](function(_0x38ea09){logger['error'](_0x4073('0xc'),_0x2195e0,_0x38ea09);_0x51515d(_0x38ea09);});});} \ No newline at end of file +var _0xb0df=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x20f7e4,_0x41fa7f){var _0x1a26e7=function(_0x5d6ec1){while(--_0x5d6ec1){_0x20f7e4['push'](_0x20f7e4['shift']());}};_0x1a26e7(++_0x41fa7f);}(_0xb0df,0x85));var _0xfb0d=function(_0x3042c5,_0x36cb88){_0x3042c5=_0x3042c5-0x0;var _0x7cd140=_0xb0df[_0x3042c5];return _0x7cd140;};'use strict';var _=require('lodash');var util=require(_0xfb0d('0x0'));var moment=require(_0xfb0d('0x1'));var BPromise=require(_0xfb0d('0x2'));var rs=require(_0xfb0d('0x3'));var fs=require('fs');var Redis=require(_0xfb0d('0x4'));var db=require(_0xfb0d('0x5'))['db'];var utils=require(_0xfb0d('0x6'));var logger=require(_0xfb0d('0x7'))(_0xfb0d('0x8'));var config=require('../../config/environment');var jayson=require(_0xfb0d('0x9'));var client=jayson[_0xfb0d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b7591,_0xd9beab,_0xee3329){return new BPromise(function(_0x5cf723,_0x57ab8c){return client[_0xfb0d('0xb')](_0x5b7591,_0xee3329)[_0xfb0d('0xc')](function(_0x501d4f){logger[_0xfb0d('0xd')](_0xfb0d('0xe'),_0xd9beab,_0xfb0d('0xf'));logger[_0xfb0d('0x10')](_0xfb0d('0x11'),_0xd9beab,_0xfb0d('0xf'),JSON['stringify'](_0x501d4f));if(_0x501d4f[_0xfb0d('0x12')]){if(_0x501d4f['error'][_0xfb0d('0x13')]===0x1f4){logger[_0xfb0d('0x12')](_0xfb0d('0xe'),_0xd9beab,_0x501d4f[_0xfb0d('0x12')][_0xfb0d('0x14')]);return _0x57ab8c(_0x501d4f[_0xfb0d('0x12')][_0xfb0d('0x14')]);}logger['error']('SmsApplication,\x20%s,\x20%s',_0xd9beab,_0x501d4f['error'][_0xfb0d('0x14')]);return _0x5cf723(_0x501d4f[_0xfb0d('0x12')][_0xfb0d('0x14')]);}else{logger[_0xfb0d('0xd')](_0xfb0d('0xe'),_0xd9beab,_0xfb0d('0xf'));_0x5cf723(_0x501d4f[_0xfb0d('0x15')]['message']);}})[_0xfb0d('0x16')](function(_0x116179){logger[_0xfb0d('0x12')](_0xfb0d('0xe'),_0xd9beab,_0x116179);_0x57ab8c(_0x116179);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index e17087a..e748f03 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 _0xaa7c=['../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','describe','show','/:id/messages','getMessages','download','create','post','addMessage','sms','smsinteraction:addtags','addTags','put','/:id','tracked','update','delete','destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','express'];(function(_0x26393b,_0x449a84){var _0x57230a=function(_0x583888){while(--_0x583888){_0x26393b['push'](_0x26393b['shift']());}};_0x57230a(++_0x449a84);}(_0xaa7c,0x18e));var _0xcaa7=function(_0x3f8b1f,_0x1fbc78){_0x3f8b1f=_0x3f8b1f-0x0;var _0x4bf423=_0xaa7c[_0x3f8b1f];return _0x4bf423;};'use strict';var multer=require(_0xcaa7('0x0'));var util=require(_0xcaa7('0x1'));var path=require(_0xcaa7('0x2'));var timeout=require(_0xcaa7('0x3'));var express=require(_0xcaa7('0x4'));var router=express['Router']();var auth=require(_0xcaa7('0x5'));var interaction=require(_0xcaa7('0x6'));var config=require(_0xcaa7('0x7'));var controller=require(_0xcaa7('0x8'));router[_0xcaa7('0x9')]('/',auth[_0xcaa7('0xa')](),controller['index']);router[_0xcaa7('0x9')]('/describe',auth[_0xcaa7('0xa')](),controller[_0xcaa7('0xb')]);router[_0xcaa7('0x9')]('/:id',auth[_0xcaa7('0xa')](),controller[_0xcaa7('0xc')]);router[_0xcaa7('0x9')](_0xcaa7('0xd'),auth[_0xcaa7('0xa')](),controller[_0xcaa7('0xe')]);router[_0xcaa7('0x9')]('/:id/download',auth[_0xcaa7('0xa')](),controller[_0xcaa7('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xcaa7('0x10')]);router[_0xcaa7('0x11')](_0xcaa7('0xd'),auth['isAuthenticated'](),controller[_0xcaa7('0x12')]);router['post']('/:id/tags',auth['isAuthenticated'](),interaction['tracked'](_0xcaa7('0x13'),_0xcaa7('0x14')),controller[_0xcaa7('0x15')]);router[_0xcaa7('0x16')](_0xcaa7('0x17'),auth[_0xcaa7('0xa')](),interaction[_0xcaa7('0x18')](_0xcaa7('0x13'),'smsinteraction:update'),controller[_0xcaa7('0x19')]);router[_0xcaa7('0x1a')](_0xcaa7('0x17'),auth[_0xcaa7('0xa')](),interaction[_0xcaa7('0x18')](_0xcaa7('0x13'),'smsinteraction:destroy'),controller[_0xcaa7('0x1b')]);router[_0xcaa7('0x1a')](_0xcaa7('0x1c'),auth[_0xcaa7('0xa')](),controller[_0xcaa7('0x1d')]);module[_0xcaa7('0x1e')]=router; \ No newline at end of file +var _0x1a37=['post','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','/:id','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','isAuthenticated','get','/describe','describe','/:id/messages','getMessages','/:id/download','download'];(function(_0x2c7b00,_0x42e42a){var _0x4d0d95=function(_0x5d53cd){while(--_0x5d53cd){_0x2c7b00['push'](_0x2c7b00['shift']());}};_0x4d0d95(++_0x42e42a);}(_0x1a37,0xb4));var _0x71a3=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x1a37[_0x565c49];return _0x20ca34;};'use strict';var multer=require(_0x71a3('0x0'));var util=require(_0x71a3('0x1'));var path=require(_0x71a3('0x2'));var timeout=require(_0x71a3('0x3'));var express=require(_0x71a3('0x4'));var router=express[_0x71a3('0x5')]();var auth=require(_0x71a3('0x6'));var interaction=require(_0x71a3('0x7'));var config=require(_0x71a3('0x8'));var controller=require(_0x71a3('0x9'));router['get']('/',auth[_0x71a3('0xa')](),controller['index']);router[_0x71a3('0xb')](_0x71a3('0xc'),auth[_0x71a3('0xa')](),controller[_0x71a3('0xd')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x71a3('0xb')](_0x71a3('0xe'),auth[_0x71a3('0xa')](),controller[_0x71a3('0xf')]);router[_0x71a3('0xb')](_0x71a3('0x10'),auth[_0x71a3('0xa')](),controller[_0x71a3('0x11')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x71a3('0x12')](_0x71a3('0xe'),auth[_0x71a3('0xa')](),controller[_0x71a3('0x13')]);router[_0x71a3('0x12')](_0x71a3('0x14'),auth[_0x71a3('0xa')](),interaction[_0x71a3('0x15')](_0x71a3('0x16'),_0x71a3('0x17')),controller[_0x71a3('0x18')]);router['put'](_0x71a3('0x19'),auth[_0x71a3('0xa')](),interaction['tracked']('sms',_0x71a3('0x1a')),controller[_0x71a3('0x1b')]);router[_0x71a3('0x1c')](_0x71a3('0x19'),auth[_0x71a3('0xa')](),interaction[_0x71a3('0x15')]('sms',_0x71a3('0x1d')),controller[_0x71a3('0x1e')]);router['delete']('/:id/tags',auth[_0x71a3('0xa')](),controller[_0x71a3('0x1f')]);module[_0x71a3('0x20')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 3827b97..8d213eb 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 _0xbaf0=['DATE','STRING','ENUM','out','moment','exports','BOOLEAN'];(function(_0x3eff26,_0xce0e73){var _0x5410f3=function(_0x48e6b5){while(--_0x48e6b5){_0x3eff26['push'](_0x3eff26['shift']());}};_0x5410f3(++_0xce0e73);}(_0xbaf0,0x12a));var _0x0baf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbaf0[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x0baf('0x0'));module[_0x0baf('0x1')]={'closed':{'type':Sequelize[_0x0baf('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0baf('0x3')]},'disposition':{'type':Sequelize[_0x0baf('0x4')]},'note':{'type':Sequelize[_0x0baf('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x0baf('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x0baf('0x5')]('in',_0x0baf('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0baf('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x0baf('0x5')]('in',_0x0baf('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xb10b=['DATE','STRING','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x28a7a6,_0x35d328){var _0x26b366=function(_0x433cec){while(--_0x433cec){_0x28a7a6['push'](_0x28a7a6['shift']());}};_0x26b366(++_0x35d328);}(_0xb10b,0x12a));var _0xbb10=function(_0x11447e,_0x33dab2){_0x11447e=_0x11447e-0x0;var _0x45a214=_0xb10b[_0x11447e];return _0x45a214;};'use strict';var Sequelize=require(_0xbb10('0x0'));var moment=require('moment');module[_0xbb10('0x1')]={'closed':{'type':Sequelize[_0xbb10('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xbb10('0x3')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xbb10('0x4')]},'phone':{'type':Sequelize[_0xbb10('0x4')]},'read1stAt':{'type':Sequelize[_0xbb10('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xbb10('0x5')]('in',_0xbb10('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xbb10('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xbb10('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 461adb1..2853790 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 _0x815a=['me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','operator','$substring','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','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','DESC','t.id\x20IN\x20?','user','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','length','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','sequelize','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','rows','catch','params','include','options','create','describe','addMessage','omit','ids','getMessages','findOne','SmsMessage','nolimit','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','setTags','spread','emit','removeTags','unix','join','server','files','tmp','attachments','transcript-%d-%s.zip','User','Messages','secret','SmsAccount','Account','Owner','get','mkdirSync','10px','40px','\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\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\x20\x20\x20\x20\x20\x20\x20','\x0a\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\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20','%s\x20#%d','Sms','N.A.','closed','closedAt','disposition','out','System','firstName','Contact','lastName','direction','root','views','toFile','transcript-','.pdf','download','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','map','fullname','Tags','TagIds','split','forEach','push','index','SmsInteraction','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','limit','order','sort','where','filters','select','field','color','tools_tags','u.id','u.fullname','user_has_sms_interactions','left_join','users','from','sms_interactions','cm_contacts','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages'];(function(_0x9cddf6,_0x41e54c){var _0x2fad8c=function(_0x1659ce){while(--_0x1659ce){_0x9cddf6['push'](_0x9cddf6['shift']());}};_0x2fad8c(++_0x41e54c);}(_0x815a,0x180));var _0xa815=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x815a[_0xd1d19a];return _0x52a79d;};'use strict';var pdf=require(_0xa815('0x0'));var emlformat=require(_0xa815('0x1'));var rimraf=require(_0xa815('0x2'));var zipdir=require(_0xa815('0x3'));var jsonpatch=require(_0xa815('0x4'));var rp=require('request-promise');var moment=require(_0xa815('0x5'));var BPromise=require(_0xa815('0x6'));var Mustache=require(_0xa815('0x7'));var util=require(_0xa815('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa815('0x9'));var fs=require('fs');var _=require(_0xa815('0xa'));var squel=require(_0xa815('0xb'));var crypto=require(_0xa815('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa815('0xd'));var toCsv=require(_0xa815('0xe'));var querystring=require(_0xa815('0xf'));var Papa=require(_0xa815('0x10'));var Redis=require(_0xa815('0x11'));var authService=require(_0xa815('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa815('0x13'));var hardwareService=require(_0xa815('0x14'));var logger=require('../../config/logger')(_0xa815('0x15'));var utils=require('../../config/utils');var config=require(_0xa815('0x16'));var db=require(_0xa815('0x17'))['db'];config[_0xa815('0x18')]=_[_0xa815('0x19')](config[_0xa815('0x18')],{'host':_0xa815('0x1a'),'port':0x18eb});var socket=require(_0xa815('0x1b'))(new Redis(config[_0xa815('0x18')]));require(_0xa815('0x1c'))[_0xa815('0x1d')](socket);function respondWithStatusCode(_0x241861,_0x40fb85){_0x40fb85=_0x40fb85||0xcc;return function(_0x4b7c80){if(_0x4b7c80){return _0x241861[_0xa815('0x1e')](_0x40fb85);}return _0x241861['status'](_0x40fb85)['end']();};}function respondWithResult(_0x53132a,_0x2a657e){_0x2a657e=_0x2a657e||0xc8;return function(_0x32079e){if(_0x32079e){return _0x53132a[_0xa815('0x1f')](_0x2a657e)['json'](_0x32079e);}};}function respondWithFilteredResult(_0xde2968,_0x2051ab){return function(_0x361891){if(_0x361891){var _0x59c78e=_0x361891[_0xa815('0x20')],_0x2ff3c4=_0x2051ab['offset'],_0xa8d52d=_0x2051ab[_0xa815('0x21')]+_0x2051ab['limit'],_0x8ec5a9;if(_0xa8d52d>=_0x59c78e){_0xa8d52d=_0x59c78e;_0x8ec5a9=0xc8;}else{_0x8ec5a9=0xce;}_0xde2968['status'](_0x8ec5a9);return _0xde2968[_0xa815('0x22')](_0xa815('0x23'),_0x2ff3c4+'-'+_0xa8d52d+'/'+_0x59c78e)['json'](_0x361891);}return null;};}function patchUpdates(_0x3e73b8){return function(_0x251909){try{jsonpatch[_0xa815('0x24')](_0x251909,_0x3e73b8,!![]);}catch(_0x4576d9){return BPromise[_0xa815('0x25')](_0x4576d9);}return _0x251909[_0xa815('0x26')]();};}function saveUpdates(_0x284eac,_0x56d655){return function(_0x2ce5a6){if(_0x2ce5a6){return _0x2ce5a6[_0xa815('0x27')](_0x284eac)[_0xa815('0x28')](function(_0x445148){return _0x445148;});}return null;};}function removeEntity(_0x10b1d2,_0x88b56f){return function(_0x1ff44a){if(_0x1ff44a){return _0x1ff44a[_0xa815('0x29')]()[_0xa815('0x28')](function(){_0x10b1d2[_0xa815('0x1f')](0xcc)[_0xa815('0x2a')]();});}};}function handleEntityNotFound(_0x326705,_0x53aeb4){return function(_0x4903f4){if(!_0x4903f4){_0x326705['sendStatus'](0x194);}return _0x4903f4;};}function handleError(_0x378444,_0x433dfa){_0x433dfa=_0x433dfa||0x1f4;return function(_0x188f70){logger['error'](_0x188f70[_0xa815('0x2b')]);if(_0x188f70[_0xa815('0x2c')]){delete _0x188f70['name'];}_0x378444[_0xa815('0x1f')](_0x433dfa)['send'](_0x188f70);};}function getInteractionUsers(_0x354642,_0x5d433c){return new BPromise(function(_0x4041bb,_0x3e5485){try{if(_0x5d433c[_0x354642['id']]){_0x354642['Users']=_[_0xa815('0x2d')](_0x5d433c[_0x354642['id']],function(_0x219476){return{'id':_0x219476['id'],'fullname':_0x219476[_0xa815('0x2e')]};});}}catch(_0x15358e){_0x3e5485(_0x15358e);}_0x4041bb(_0x354642);});}function getInteractionTags(_0x47d961,_0x2de075){return new BPromise(function(_0x345492,_0x29d87f){try{if(_0x47d961['TagIds']){_0x47d961[_0xa815('0x2f')]=[];_0x47d961[_0xa815('0x30')][_0xa815('0x31')](',')[_0xa815('0x32')](function(_0x6e677a){_0x47d961['Tags'][_0xa815('0x33')](_0x2de075[_0x6e677a]);});}delete _0x47d961['TagIds'];}catch(_0x1cc9ac){_0x29d87f(_0x1cc9ac);}_0x345492(_0x47d961);});}function updateSmsInteraction(_0x4a6015,_0x321b81,_0x48e094){return new BPromise(function(_0x1682fb,_0x5d2f81){return getInteractionUsers(_0x4a6015,_0x48e094)[_0xa815('0x28')](function(_0x94b12f){return getInteractionTags(_0x94b12f,_0x321b81);})['then'](function(_0x49cdf4){_0x1682fb(_0x49cdf4);})['catch'](function(_0x58982b){_0x5d2f81(_0x58982b);});});}exports[_0xa815('0x34')]=function(_0x55aa62,_0x232d75){var _0x597337={},_0x3008b7={},_0x45e65a={'count':0x0,'rows':[]};var _0x105faa=_[_0xa815('0x2d')](db[_0xa815('0x35')][_0xa815('0x36')],function(_0x982d36){return{'name':_0x982d36[_0xa815('0x37')],'type':_0x982d36[_0xa815('0x38')][_0xa815('0x39')]};});_0x3008b7[_0xa815('0x3a')]=_[_0xa815('0x2d')](_0x105faa,_0xa815('0x2c'));_0x3008b7[_0xa815('0x3b')]=_[_0xa815('0x3c')](_0x55aa62['query']);_0x3008b7['filters']=_['intersection'](_0x3008b7[_0xa815('0x3a')],_0x3008b7[_0xa815('0x3b')]);_0x597337['attributes']=_[_0xa815('0x3d')](_0x3008b7[_0xa815('0x3a')],qs[_0xa815('0x3e')](_0x55aa62['query'][_0xa815('0x3e')]));_0x597337[_0xa815('0x3f')]=_0x597337[_0xa815('0x3f')]['length']?_0x597337['attributes']:_0x3008b7['model'];if(!_0x55aa62['query'][_0xa815('0x40')]('nolimit')){_0x597337['limit']=qs[_0xa815('0x41')](_0x55aa62['query'][_0xa815('0x41')]);_0x597337[_0xa815('0x21')]=qs['offset'](_0x55aa62[_0xa815('0x3b')][_0xa815('0x21')]);}_0x597337[_0xa815('0x42')]=qs[_0xa815('0x43')](_0x55aa62[_0xa815('0x3b')][_0xa815('0x43')]);_0x597337[_0xa815('0x44')]=qs['filters'](_['pick'](_0x55aa62[_0xa815('0x3b')],_0x3008b7[_0xa815('0x45')]));var _0x57a81c=[];var _0x4ef5c3=squel[_0xa815('0x46')]()[_0xa815('0x47')]('id')['field'](_0xa815('0x2c'))[_0xa815('0x47')](_0xa815('0x48'))['from'](_0xa815('0x49'));var _0x273ee1=squel[_0xa815('0x46')]()[_0xa815('0x47')](_0xa815('0x4a'))[_0xa815('0x47')](_0xa815('0x4b'))[_0xa815('0x47')]('ui.SmsInteractionId')['from'](_0xa815('0x4c'),'ui')[_0xa815('0x4d')](_0xa815('0x4e'),'u','u.id\x20=\x20ui.UserId');var _0x34d8fe=squel['select']()[_0xa815('0x4f')](_0xa815('0x50'),'i')['left_join'](_0xa815('0x51'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xa815('0x4d')](_0xa815('0x4e'),'o',_0xa815('0x52'))[_0xa815('0x4d')](_0xa815('0x53'),'a',_0xa815('0x54'))['left_join'](_0xa815('0x55'),'me',_0xa815('0x56'))['left_join'](_0xa815('0x57'),'it',_0xa815('0x58'))['left_join'](_0xa815('0x49'),'t',_0xa815('0x59'));var _0x33bb35=squel[_0xa815('0x5a')]();var _0x23bdc2=[];var _0xb09185=squel[_0xa815('0x5a')]();var _0xc4beee;if(_0x55aa62['query'][_0xa815('0x5b')]){_0xc4beee=as['parseSearch'](_0x55aa62[_0xa815('0x3b')][_0xa815('0x5b')]);var _0x19a9ee=_0xc4beee[_0xa815('0x5c')];for(var _0x536194=0x0;_0x536194<_0xc4beee['conditions']['length'];_0x536194++){var _0x19dcea=_0xc4beee[_0xa815('0x5d')][_0x536194];var _0x2e27c6='i';var _0x5b934a=_['find'](_0x105faa,[_0xa815('0x2c'),_0x19dcea[_0xa815('0x47')]]);if(!_0x5b934a){switch(_0x19dcea['field']){case _0xa815('0x5e'):if(_0x19dcea[_0xa815('0x5f')]==0x1){_0x34d8fe[_0xa815('0x60')]('`'+_0x19dcea[_0xa815('0x47')]+_0xa815('0x61'));}else{_0x34d8fe[_0xa815('0x60')]('`'+_0x19dcea[_0xa815('0x47')]+_0xa815('0x62'));}break;case'Contact':if(_0x19dcea[_0xa815('0x63')]===_0xa815('0x64')){if(_0x19dcea[_0xa815('0x5f')]['split']('\x20')['length']>0x1){_0x33bb35[_0x19a9ee]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xa815('0x65')](_0x19dcea['value']),null);}else{var _0x1f3253='%'+_0x19dcea[_0xa815('0x5f')]+'%';_0x33bb35[_0x19a9ee](_0xa815('0x66'),_0x1f3253,_0x1f3253,_0x1f3253);}}else{_0x5b934a=_[_0xa815('0x67')](_0x105faa,['name','ContactId']);_0x19dcea[_0xa815('0x47')]=_0xa815('0x68');_0x248432=as[_0xa815('0x69')](_0x2e27c6,_0x5b934a['type'],_0x19dcea);_0x33bb35[_0x19a9ee](_0x248432[_0xa815('0x6a')],_0x248432[_0xa815('0x5f')][_0xa815('0x6b')],_0x248432[_0xa815('0x5f')][_0xa815('0x2a')]);}break;case _0xa815('0x6c'):var _0x3b0d47=_0x19dcea['value'][_0xa815('0x31')](',')[_0xa815('0x2d')](function(_0x157dbe){return Number(_0x157dbe);});_0x3b0d47['forEach'](function(_0xd4b156){_0xb09185['or'](_0xa815('0x6d'),'%,'+_0xd4b156+',%');});_0x23bdc2=_[_0xa815('0x6e')](_0x23bdc2,_0x3b0d47);break;case'User':if(_0x19dcea['operator']===_0xa815('0x64')){_0x33bb35[_0x19a9ee](_0xa815('0x6f'),'%'+_0x19dcea[_0xa815('0x5f')]+'%',null);}else{_0x5b934a=_[_0xa815('0x67')](_0x105faa,[_0xa815('0x2c'),_0xa815('0x70')]);_0x19dcea[_0xa815('0x47')]=_0xa815('0x70');_0x248432=as[_0xa815('0x69')](_0x2e27c6,_0x5b934a[_0xa815('0x38')],_0x19dcea);_0x33bb35[_0x19a9ee](_0x248432[_0xa815('0x6a')],_0x248432[_0xa815('0x5f')][_0xa815('0x6b')],_0x248432[_0xa815('0x5f')][_0xa815('0x2a')]);}break;case _0xa815('0x71'):_0x248432=as[_0xa815('0x69')]('me',null,_0x19dcea);_0x33bb35[_0x19a9ee](_0x248432[_0xa815('0x6a')],_0x248432[_0xa815('0x5f')]['start'],_0x248432[_0xa815('0x5f')][_0xa815('0x2a')]);break;}}else{var _0x248432=as[_0xa815('0x69')](_0x2e27c6,_0x5b934a[_0xa815('0x38')],_0x19dcea);_0x33bb35[_0x19a9ee](_0x248432[_0xa815('0x6a')],_0x248432[_0xa815('0x5f')][_0xa815('0x6b')],_0x248432[_0xa815('0x5f')][_0xa815('0x2a')]);}}}else{var _0x7c3414=_(_0x55aa62[_0xa815('0x3b')])[_0xa815('0x3c')]()['map'](function(_0x1e3566){return _[_0xa815('0x72')](_0x105faa,[_0xa815('0x2c'),_0x1e3566])?_0x1e3566:undefined;})[_0xa815('0x73')]()[_0xa815('0x5f')]();if(!_[_0xa815('0x74')](_0x7c3414)){_0x7c3414[_0xa815('0x32')](function(_0x3e2717){if(_0x3e2717===_0xa815('0x75')){_0x34d8fe[_0xa815('0x44')](_0xa815('0x76'),[][_0xa815('0x77')](_0x55aa62[_0xa815('0x3b')][_0x3e2717]));}else if(_0x3e2717===_0xa815('0x78')){var _0x59edbe=JSON[_0xa815('0x79')](_0x55aa62[_0xa815('0x3b')][_0x3e2717])[_0xa815('0x7a')];var _0x58da5d=JSON[_0xa815('0x79')](_0x55aa62[_0xa815('0x3b')][_0x3e2717])[_0xa815('0x7b')];_0x34d8fe['where'](_0xa815('0x7c'),_0x59edbe,_0x58da5d);}else{if(_0x55aa62['query'][_0x3e2717]==='null'){_0x34d8fe['where']('i.'+_0x3e2717+'\x20IS\x20NULL');}else{_0x34d8fe[_0xa815('0x44')]('i.'+_0x3e2717+'\x20=\x20?',_0x55aa62[_0xa815('0x3b')][_0x3e2717]);}}});}if(_0x55aa62[_0xa815('0x3b')][_0xa815('0x7d')]){if(_0x55aa62['query'][_0xa815('0x7d')]==0x1){_0x34d8fe['having']('`unreadMessages`\x20=\x200');}else{_0x34d8fe[_0xa815('0x60')](_0xa815('0x7e'));}}if(_0x55aa62[_0xa815('0x3b')][_0xa815('0x7f')]){_0x23bdc2=_[_0xa815('0x80')](_0x55aa62['query']['tag'])?_0x55aa62[_0xa815('0x3b')][_0xa815('0x7f')]:new Array(_0x55aa62['query'][_0xa815('0x7f')]);_0x23bdc2[_0xa815('0x32')](function(_0x3811b9){_0xb09185['or'](_0xa815('0x6d'),'%,'+_0x3811b9+',%');});}if(_0x55aa62['query'][_0xa815('0x81')]){var _0x24e4f6=_0x55aa62[_0xa815('0x3b')][_0xa815('0x81')]['replace']('\x5c','\x5c\x5c')[_0xa815('0x82')]('\x27\x27','\x27\x27\x27\x27');if(qs[_0xa815('0x83')](_0x24e4f6)){_0x33bb35['or'](_0xa815('0x84'),_0x24e4f6+'%')['or']('i.phone\x20LIKE\x20?',_0x24e4f6+'%');}else{_0x33bb35['or'](_0xa815('0x85'),qs['getFullTextValue'](_0x24e4f6))['or'](_0xa815('0x86'),_0x24e4f6+'%');}}}_0x34d8fe[_0xa815('0x44')](_0x33bb35);_0x34d8fe[_0xa815('0x87')](_0xa815('0x88'));var _0x4b5eb2={'type':db[_0xa815('0x89')][_0xa815('0x8a')]['SELECT'],'raw':!![]};var _0x2e32aa=_0x34d8fe['clone']();_0x2e32aa['field'](_0xa815('0x88'));_0x2e32aa[_0xa815('0x47')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x597337[_0xa815('0x42')]){_0x597337['order'][_0xa815('0x32')](function(_0x146a56){_0x34d8fe['order']('i.'+_0x146a56[0x0],_0x146a56[0x1]===_0xa815('0x8b')?![]:!![]);});}if(!_[_0xa815('0x74')](_0x23bdc2)){_0x34d8fe[_0xa815('0x60')](_0xb09185);_0x2e32aa[_0xa815('0x44')](_0xa815('0x8c'),_0x23bdc2);}BPromise['resolve']()[_0xa815('0x28')](function(){if(!_0xc4beee&&_0x55aa62[_0xa815('0x3b')][_0xa815('0x75')])return;return _0x55aa62[_0xa815('0x8d')][_0xa815('0x8e')]({'attributes':['id'],'raw':!![]})['then'](function(_0x5604a6){if(_[_0xa815('0x74')](_0x5604a6)){_0x2e32aa[_0xa815('0x44')]('i.SmsAccountId\x20IS\x20NULL');_0x34d8fe[_0xa815('0x44')](_0xa815('0x8f'));}else{_0x2e32aa[_0xa815('0x44')](_0xa815('0x76'),_[_0xa815('0x2d')](_0x5604a6,'id'));_0x34d8fe['where']('i.SmsAccountId\x20IN\x20?',_[_0xa815('0x2d')](_0x5604a6,'id'));}});})[_0xa815('0x28')](function(){db['sequelize'][_0xa815('0x3b')](_0x2e32aa['toString'](),_0x4b5eb2)['then'](function(_0x3c8f01){_0x45e65a[_0xa815('0x20')]=_0x3c8f01[_0xa815('0x90')];if(_0x45e65a['count']===0x0)return[];return db['sequelize'][_0xa815('0x3b')](_0x4ef5c3[_0xa815('0x91')](),_0x4b5eb2)['then'](function(_0x589c1e){_0x57a81c=_[_0xa815('0x92')](_0x589c1e,'id');_0x4b5eb2=_[_0xa815('0x93')](_0x4b5eb2,{'model':db[_0xa815('0x35')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x55aa62[_0xa815('0x3b')]['fields']){_0x597337['attributes']['forEach'](function(_0x3d3f5){_0x34d8fe['field']('i.'+_0x3d3f5);});}else{_0x34d8fe[_0xa815('0x47')](_0xa815('0x94'),_0xa815('0x5e'));_0x34d8fe[_0xa815('0x47')](_0xa815('0x95'),_0xa815('0x96'));_0x34d8fe[_0xa815('0x47')](_0xa815('0x97'),_0xa815('0x98'));_0x34d8fe[_0xa815('0x47')](_0xa815('0x99'));_0x34d8fe[_0xa815('0x47')]('c.firstName',_0xa815('0x9a'));_0x34d8fe[_0xa815('0x47')](_0xa815('0x9b'),'Contact.lastName');_0x34d8fe[_0xa815('0x47')](_0xa815('0x9c'),_0xa815('0x9d'));_0x34d8fe[_0xa815('0x47')](_0xa815('0x9e'),_0xa815('0x9f'));_0x34d8fe['field'](_0xa815('0xa0'),_0xa815('0xa1'));_0x34d8fe[_0xa815('0x47')](_0xa815('0xa2'),'Contact.fax');_0x34d8fe[_0xa815('0x47')](_0xa815('0xa3'),_0xa815('0xa4'));_0x34d8fe['field'](_0xa815('0xa5'),_0xa815('0xa6'));_0x34d8fe[_0xa815('0x47')](_0xa815('0xa7'),'TagIds');}_0x34d8fe['limit'](_0x597337[_0xa815('0x41')]);_0x34d8fe[_0xa815('0x21')](_0x597337[_0xa815('0x21')]);return db[_0xa815('0xa8')][_0xa815('0x3b')](_0x34d8fe[_0xa815('0x91')](),_0x4b5eb2);})['then'](function(_0x5c37cf){_0x273ee1[_0xa815('0x44')](_0xa815('0xa9'),_[_0xa815('0x2d')](_0x5c37cf,'id'));return db['sequelize'][_0xa815('0x3b')](_0x273ee1[_0xa815('0x91')](),_0x4b5eb2)[_0xa815('0x28')](function(_0xdf828){var _0x23fed0=_[_0xa815('0xaa')](_0xdf828,_0xa815('0xab'));var _0x1f9668=[];_0x5c37cf['forEach'](function(_0x413d98){_0x1f9668[_0xa815('0x33')](updateSmsInteraction(_0x413d98,_0x57a81c,_0x23fed0));});return BPromise['all'](_0x1f9668);});});})[_0xa815('0x28')](function(_0x2bd46c){_0x45e65a[_0xa815('0xac')]=_0x2bd46c;return _0x45e65a;})[_0xa815('0x28')](respondWithFilteredResult(_0x232d75,_0x597337));})[_0xa815('0xad')](handleError(_0x232d75,null));};exports['show']=function(_0x22307f,_0x5eed37){var _0x3798d7={'raw':![],'where':{'id':_0x22307f[_0xa815('0xae')]['id']}},_0x30b3ee={};_0x30b3ee[_0xa815('0x3a')]=_['keys'](db[_0xa815('0x35')][_0xa815('0x36')]);_0x30b3ee[_0xa815('0x3b')]=_[_0xa815('0x3c')](_0x22307f[_0xa815('0x3b')]);_0x30b3ee['filters']=_[_0xa815('0x3d')](_0x30b3ee[_0xa815('0x3a')],_0x30b3ee[_0xa815('0x3b')]);_0x3798d7[_0xa815('0x3f')]=_[_0xa815('0x3d')](_0x30b3ee[_0xa815('0x3a')],qs[_0xa815('0x3e')](_0x22307f[_0xa815('0x3b')]['fields']));_0x3798d7[_0xa815('0x3f')]=_0x3798d7[_0xa815('0x3f')][_0xa815('0x90')]?_0x3798d7[_0xa815('0x3f')]:_0x30b3ee[_0xa815('0x3a')];if(_0x22307f[_0xa815('0x3b')]['includeAll']){_0x3798d7[_0xa815('0xaf')]=[{'all':!![]}];}_0x3798d7=_[_0xa815('0x93')]({},_0x3798d7,_0x22307f[_0xa815('0xb0')]);return db['SmsInteraction'][_0xa815('0x67')](_0x3798d7)['then'](handleEntityNotFound(_0x5eed37,null))[_0xa815('0x28')](respondWithResult(_0x5eed37,null))[_0xa815('0xad')](handleError(_0x5eed37,null));};exports[_0xa815('0xb1')]=function(_0x5da916,_0x5a292e){return db['SmsInteraction'][_0xa815('0xb1')](_0x5da916[_0xa815('0x71')],{})[_0xa815('0x28')](respondWithResult(_0x5a292e,0xc9))[_0xa815('0xad')](handleError(_0x5a292e,null));};exports[_0xa815('0x27')]=function(_0x2071f4,_0x273bce){if(_0x2071f4[_0xa815('0x71')]['id']){delete _0x2071f4[_0xa815('0x71')]['id'];}return db[_0xa815('0x35')][_0xa815('0x67')]({'where':{'id':_0x2071f4[_0xa815('0xae')]['id']}})['then'](handleEntityNotFound(_0x273bce,null))['then'](saveUpdates(_0x2071f4[_0xa815('0x71')],null))[_0xa815('0x28')](respondWithResult(_0x273bce,null))[_0xa815('0xad')](handleError(_0x273bce,null));};exports[_0xa815('0x29')]=function(_0x4a5585,_0x361b71){return db[_0xa815('0x35')][_0xa815('0x67')]({'where':{'id':_0x4a5585[_0xa815('0xae')]['id']}})['then'](handleEntityNotFound(_0x361b71,null))[_0xa815('0x28')](removeEntity(_0x361b71,null))['catch'](handleError(_0x361b71,null));};exports[_0xa815('0xb2')]=function(_0x2b5374,_0x2f352e){return db['SmsInteraction'][_0xa815('0xb2')]()['then'](respondWithResult(_0x2f352e,null))['catch'](handleError(_0x2f352e,null));};exports[_0xa815('0xb3')]=function(_0xee59a9,_0x2f9fe4,_0x44f81a){return db['SmsMessage'][_0xa815('0x67')]({'where':{'id':_0xee59a9[_0xa815('0xae')]['id']}})[_0xa815('0x28')](handleEntityNotFound(_0x2f9fe4,null))[_0xa815('0x28')](function(_0x50aa77){if(_0x50aa77){return _0x50aa77[_0xa815('0xb3')](_0xee59a9['body']['ids'],_[_0xa815('0xb4')](_0xee59a9['body'],[_0xa815('0xb5'),'id'])||{});}})[_0xa815('0x28')](respondWithResult(_0x2f9fe4,null))[_0xa815('0xad')](handleError(_0x2f9fe4,null));};exports[_0xa815('0xb6')]=function(_0x22ebca,_0xca443a,_0x527d62){var _0x58ca97={'raw':![],'where':{}};var _0x55e119={};var _0x212bde={'count':0x0,'rows':[]};return db[_0xa815('0x35')][_0xa815('0xb7')]({'where':{'id':_0x22ebca[_0xa815('0xae')]['id']}})[_0xa815('0x28')](handleEntityNotFound(_0xca443a,null))[_0xa815('0x28')](function(_0x333de3){if(_0x333de3){_0x55e119[_0xa815('0x3a')]=_['keys'](db[_0xa815('0xb8')][_0xa815('0x36')]);_0x55e119[_0xa815('0x3b')]=_['keys'](_0x22ebca[_0xa815('0x3b')]);_0x55e119['filters']=_[_0xa815('0x3d')](_0x55e119[_0xa815('0x3a')],_0x55e119[_0xa815('0x3b')]);_0x58ca97[_0xa815('0x3f')]=_[_0xa815('0x3d')](_0x55e119[_0xa815('0x3a')],qs['fields'](_0x22ebca[_0xa815('0x3b')]['fields']));_0x58ca97[_0xa815('0x3f')]=_0x58ca97['attributes']['length']?_0x58ca97[_0xa815('0x3f')]:_0x55e119[_0xa815('0x3a')];if(!_0x22ebca['query']['hasOwnProperty'](_0xa815('0xb9'))){_0x58ca97['limit']=qs['limit'](_0x22ebca[_0xa815('0x3b')][_0xa815('0x41')]);_0x58ca97[_0xa815('0x21')]=qs[_0xa815('0x21')](_0x22ebca['query']['offset']);}_0x58ca97[_0xa815('0x42')]=qs[_0xa815('0x43')](_0x22ebca[_0xa815('0x3b')]['sort']);_0x58ca97[_0xa815('0x44')]=qs[_0xa815('0x45')](_['pick'](_0x22ebca[_0xa815('0x3b')],_0x55e119[_0xa815('0x45')]));_0x58ca97[_0xa815('0x44')][_0xa815('0xab')]=_0x333de3['id'];if(_0x22ebca[_0xa815('0x3b')][_0xa815('0x81')]){_0x58ca97[_0xa815('0x44')]=_['merge'](_0x58ca97['where'],{'$or':_['map'](_0x58ca97['attributes'],function(_0x3e8c1e){var _0x41b911={};_0x41b911[_0x3e8c1e]={'$like':'%'+_0x22ebca[_0xa815('0x3b')]['filter']+'%'};return _0x41b911;})});}if(_0x22ebca[_0xa815('0x3b')][_0xa815('0x7a')]){var _0x3b18ff=_0x22ebca[_0xa815('0x3b')][_0xa815('0x7a')][_0xa815('0x31')](',');var _0x47712a={};_0x47712a[_0x3b18ff[0x0]]={'$gte':moment(_0x3b18ff[0x1])[_0xa815('0xba')](_0xa815('0xbb'))};_0x58ca97['where']=_[_0xa815('0x93')](_0x58ca97['where'],_0x47712a);}_0x58ca97=_[_0xa815('0x93')]({},_0x58ca97,_0x22ebca[_0xa815('0xb0')]);return db[_0xa815('0xb8')][_0xa815('0x20')]({'where':_0x58ca97[_0xa815('0x44')]})[_0xa815('0x28')](function(_0x359124){_0x212bde[_0xa815('0x20')]=_0x359124;if(_0x22ebca[_0xa815('0x3b')][_0xa815('0xbc')]){_0x58ca97['include']=[{'all':!![]}];}return db[_0xa815('0xb8')][_0xa815('0xbd')](_0x58ca97);})[_0xa815('0x28')](function(_0x24b95b){_0x212bde[_0xa815('0xac')]=_0x24b95b;return _0x212bde;});}})['then'](respondWithFilteredResult(_0xca443a,_0x58ca97))['catch'](handleError(_0xca443a,null));};exports[_0xa815('0xbe')]=function(_0x4bc7c8,_0x3c1f8f,_0xf4b3cf){return db[_0xa815('0x35')]['find']({'where':{'id':_0x4bc7c8[_0xa815('0xae')]['id']}})[_0xa815('0x28')](handleEntityNotFound(_0x3c1f8f,null))['then'](function(_0x14bbe3){if(_0x14bbe3){return _0x14bbe3[_0xa815('0xbf')](_0x4bc7c8[_0xa815('0x71')][_0xa815('0xb5')],_[_0xa815('0xb4')](_0x4bc7c8['body'],[_0xa815('0xb5'),'id'])||{})[_0xa815('0xc0')](function(){return db[_0xa815('0x6c')][_0xa815('0xbd')]({'attributes':['id','name',_0xa815('0x48')],'where':{'id':_0x4bc7c8[_0xa815('0x71')][_0xa815('0xb5')]}});})['then'](function(_0xdd27fb){socket[_0xa815('0xc1')]('smsInteractionTags:save',{'id':Number(_0x4bc7c8[_0xa815('0xae')]['id']),'tags':_0xdd27fb||[]});return{'id':Number(_0x4bc7c8[_0xa815('0xae')]['id']),'tags':_0xdd27fb||[]};});}})[_0xa815('0x28')](respondWithResult(_0x3c1f8f,null))[_0xa815('0xad')](handleError(_0x3c1f8f,null));};exports[_0xa815('0xc2')]=function(_0x566481,_0x180968,_0x1787f5){return db[_0xa815('0x35')][_0xa815('0x67')]({'where':{'id':_0x566481[_0xa815('0xae')]['id']}})[_0xa815('0x28')](handleEntityNotFound(_0x180968,null))['then'](function(_0x4189d8){if(_0x4189d8){return _0x4189d8['removeTags'](_0x566481[_0xa815('0x3b')][_0xa815('0xb5')]);}})[_0xa815('0x28')](respondWithStatusCode(_0x180968,null))[_0xa815('0xad')](handleError(_0x180968,null));};exports['download']=function(_0x220e47,_0x4a3ed3){var _0x2123bd=moment()[_0xa815('0xc3')]()[_0xa815('0x91')]();var _0xe0eac2=path[_0xa815('0xc4')](config['root'],_0xa815('0xc5'),_0xa815('0xc6'),_0xa815('0xc7'));var _0x26496e=path[_0xa815('0xc4')](config['root'],_0xa815('0xc5'),_0xa815('0xc6'),_0xa815('0xc8'));var _0x4d00a0=path[_0xa815('0xc4')](_0xe0eac2,_0x2123bd);var _0x1f5e38=util[_0xa815('0xba')](_0xa815('0xc9'),_0x220e47[_0xa815('0xae')]['id'],_0x2123bd);var _0x1cb26a=path[_0xa815('0xc4')](_0xe0eac2,_0x1f5e38);var _0x5e457=[];_0x5e457['push']({'model':db['User'],'as':_0xa815('0xca'),'attributes':['id','fullname'],'raw':!![]});_0x5e457['push']({'model':db['CmContact'],'as':'Contact','attributes':['id','firstName','lastName'],'raw':!![]});var _0x30b463=[{'model':db[_0xa815('0xb8')],'as':_0xa815('0xcb'),'attributes':['id',_0xa815('0x71'),_0xa815('0x78'),'direction',_0xa815('0xcc'),'read'],'include':_0x5e457}];_0x30b463[_0xa815('0x33')]({'model':db[_0xa815('0xcd')],'as':_0xa815('0xce'),'attributes':['id',_0xa815('0x2c')]});_0x30b463[_0xa815('0x33')]({'model':db[_0xa815('0xca')],'as':_0xa815('0xcf'),'attributes':['id','fullname']});return db[_0xa815('0x35')][_0xa815('0x67')]({'where':{'id':_0x220e47[_0xa815('0xae')]['id']},'include':_0x30b463})[_0xa815('0x28')](handleEntityNotFound(_0x4a3ed3,null))[_0xa815('0x28')](function(_0x4a0315){if(_0x4a0315){var _0x16f3ce=_0x4a0315[_0xa815('0xd0')]({'plain':!![]});fs[_0xa815('0xd1')](_0x4d00a0);var _0x53d1de={'format':'A4','border':_0xa815('0xd2'),'header':{'height':_0xa815('0xd3'),'contents':{'first':_0xa815('0xd4')}},'footer':{'height':'30px','contents':{'default':util['format'](_0xa815('0xd5'),util[_0xa815('0xba')](_0xa815('0xd6'),'Sms',_0x16f3ce['id']),moment()['format']('YYYY-MM-DD')[_0xa815('0x91')]())}}};var _0x177103={'channel':_0xa815('0xd7'),'account':_0x16f3ce[_0xa815('0xce')][_0xa815('0x2c')],'agent':_0x16f3ce[_0xa815('0xcf')]?_0x16f3ce[_0xa815('0xcf')][_0xa815('0x2e')]:_0xa815('0xd8'),'createdAt':moment(_0x16f3ce['createdAt'])[_0xa815('0xba')]('YYYY-MM-DD\x20HH:mm:ss')[_0xa815('0x91')](),'closedAt':_0x16f3ce[_0xa815('0xd9')]?moment(_0x16f3ce[_0xa815('0xda')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xa815('0x91')]():'','disposition':_0x16f3ce[_0xa815('0xdb')],'messages':_(_0x16f3ce[_0xa815('0xcb')])[_0xa815('0x81')]({'secret':![]})[_0xa815('0x2d')](function(_0x1587f2){return{'date':moment(_0x1587f2['createdAt'])[_0xa815('0xba')](_0xa815('0xbb'))['toString'](),'sender':_0x1587f2['direction']===_0xa815('0xdc')?_0x1587f2[_0xa815('0xca')]?_0x1587f2[_0xa815('0xca')]['fullname']:_0xa815('0xdd'):_0x1587f2['Contact'][_0xa815('0xde')]+(_0x1587f2[_0xa815('0xdf')]['lastName']?'\x20'+_0x1587f2['Contact'][_0xa815('0xe0')]:''),'body':_0x1587f2[_0xa815('0x71')],'direction':_0x1587f2[_0xa815('0xe1')]===_0xa815('0xdc')?'A':'C','secret':_0x1587f2[_0xa815('0xcc')],'read':_0x1587f2[_0xa815('0x7d')]};})[_0xa815('0x5f')]()};return ejs['renderFile'](path[_0xa815('0xc4')](config[_0xa815('0xe2')],_0xa815('0xc5'),_0xa815('0xe3'),'downloadInteraction.html'),{'interaction':_0x177103})[_0xa815('0x28')](function(_0x12c204){return new BPromise(function(_0xc07a21,_0x172a05){pdf[_0xa815('0xb1')](_0x12c204,_0x53d1de)[_0xa815('0xe4')](path[_0xa815('0xc4')](_0x4d00a0,_0xa815('0xe5')+_0x16f3ce['id']+'-'+_0x2123bd+_0xa815('0xe6')),function(_0x54ea0f,_0x2aeaec){if(_0x54ea0f)return _0x172a05(_0x54ea0f);_0xc07a21(_0x2aeaec);});});})[_0xa815('0x28')](function(){return new BPromise(function(_0x3b21d1,_0x1dfb37){zipdir(_0x4d00a0,{'saveTo':_0x1cb26a},function(_0x10b5ab,_0x45752d){if(_0x10b5ab)return _0x1dfb37(_0x10b5ab);return _0x3b21d1(_0x45752d);});})['then'](function(){return new BPromise(function(_0x285c0d,_0x367905){rimraf(_0x4d00a0,function(_0x559600){if(_0x559600)_0x367905(_0x559600);return _0x285c0d();});});})[_0xa815('0x28')](function(){return _0x4a3ed3[_0xa815('0xe7')](_0x1cb26a,_0x1f5e38,function(_0xcc321c){if(_0xcc321c){console[_0xa815('0xe8')](_0xa815('0xe9'),_0xcc321c);}else{fs[_0xa815('0xea')](_0x1cb26a);}});});});}else{return _0x4a3ed3[_0xa815('0x1e')](0xc8);}})[_0xa815('0xad')](handleError(_0x4a3ed3,null));}; \ No newline at end of file +var _0x2107=['createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','\x27\x27\x27\x27','isNumeric','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','t.id\x20IN\x20?','SmsAccountId','getSmsAccounts','isEmpty','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','push','all','rows','show','params','includeAll','include','catch','create','describe','addMessage','ids','omit','getMessages','findOne','SmsMessage','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','Tag','emit','smsInteractionTags:save','removeTags','download','unix','root','tmp','join','server','files','firstName','lastName','Messages','direction','SmsAccount','Account','Owner','mkdirSync','40px','\x0a\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\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20','%s\x20#%d','Sms','N.A.','closed','closedAt','disposition','out','renderFile','views','toFile','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','./smsInteraction.socket','register','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','update','destroy','then','error','name','send','map','fullname','Tags','split','forEach','index','SmsInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','ui.SmsInteractionId','users','sms_interactions','left_join','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','union','User','UserId','buildExpression','text','body','start','some','i.SmsAccountId\x20IN\x20?','concat'];(function(_0xf33ca8,_0x230781){var _0x134d63=function(_0x3b8410){while(--_0x3b8410){_0xf33ca8['push'](_0xf33ca8['shift']());}};_0x134d63(++_0x230781);}(_0x2107,0x6f));var _0x7210=function(_0x27604f,_0x5ae336){_0x27604f=_0x27604f-0x0;var _0x40d189=_0x2107[_0x27604f];return _0x40d189;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7210('0x0'));var rimraf=require(_0x7210('0x1'));var zipdir=require(_0x7210('0x2'));var jsonpatch=require(_0x7210('0x3'));var rp=require('request-promise');var moment=require(_0x7210('0x4'));var BPromise=require(_0x7210('0x5'));var Mustache=require(_0x7210('0x6'));var util=require(_0x7210('0x7'));var path=require('path');var sox=require(_0x7210('0x8'));var csv=require(_0x7210('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x7210('0xa'));var crypto=require(_0x7210('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7210('0x9'));var querystring=require(_0x7210('0xc'));var Papa=require(_0x7210('0xd'));var Redis=require('ioredis');var authService=require(_0x7210('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7210('0xf'))(_0x7210('0x10'));var utils=require('../../config/utils');var config=require(_0x7210('0x11'));var db=require(_0x7210('0x12'))['db'];config['redis']=_[_0x7210('0x13')](config[_0x7210('0x14')],{'host':_0x7210('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7210('0x14')]));require(_0x7210('0x16'))[_0x7210('0x17')](socket);function respondWithStatusCode(_0xbe5b26,_0x19693d){_0x19693d=_0x19693d||0xcc;return function(_0x341b20){if(_0x341b20){return _0xbe5b26[_0x7210('0x18')](_0x19693d);}return _0xbe5b26[_0x7210('0x19')](_0x19693d)[_0x7210('0x1a')]();};}function respondWithResult(_0x272e20,_0x2e85e4){_0x2e85e4=_0x2e85e4||0xc8;return function(_0x399d87){if(_0x399d87){return _0x272e20[_0x7210('0x19')](_0x2e85e4)[_0x7210('0x1b')](_0x399d87);}};}function respondWithFilteredResult(_0x29f25c,_0x3c9bf1){return function(_0x261f1d){if(_0x261f1d){var _0x4e736c=_0x261f1d[_0x7210('0x1c')],_0x131bc4=_0x3c9bf1[_0x7210('0x1d')],_0x4c80e6=_0x3c9bf1[_0x7210('0x1d')]+_0x3c9bf1['limit'],_0x55d909;if(_0x4c80e6>=_0x4e736c){_0x4c80e6=_0x4e736c;_0x55d909=0xc8;}else{_0x55d909=0xce;}_0x29f25c[_0x7210('0x19')](_0x55d909);return _0x29f25c['set'](_0x7210('0x1e'),_0x131bc4+'-'+_0x4c80e6+'/'+_0x4e736c)[_0x7210('0x1b')](_0x261f1d);}return null;};}function patchUpdates(_0x42054c){return function(_0x418a82){try{jsonpatch[_0x7210('0x1f')](_0x418a82,_0x42054c,!![]);}catch(_0x2dad73){return BPromise[_0x7210('0x20')](_0x2dad73);}return _0x418a82[_0x7210('0x21')]();};}function saveUpdates(_0x2e419f,_0x2fcd71){return function(_0x368dd4){if(_0x368dd4){return _0x368dd4[_0x7210('0x22')](_0x2e419f)['then'](function(_0x1fc7e9){return _0x1fc7e9;});}return null;};}function removeEntity(_0xd26be3,_0x2cbb49){return function(_0x283fbd){if(_0x283fbd){return _0x283fbd[_0x7210('0x23')]()[_0x7210('0x24')](function(){_0xd26be3[_0x7210('0x19')](0xcc)[_0x7210('0x1a')]();});}};}function handleEntityNotFound(_0x56ec1e,_0xab59c2){return function(_0x392a6c){if(!_0x392a6c){_0x56ec1e['sendStatus'](0x194);}return _0x392a6c;};}function handleError(_0x510462,_0x2fe378){_0x2fe378=_0x2fe378||0x1f4;return function(_0x216c19){logger[_0x7210('0x25')](_0x216c19['stack']);if(_0x216c19[_0x7210('0x26')]){delete _0x216c19[_0x7210('0x26')];}_0x510462[_0x7210('0x19')](_0x2fe378)[_0x7210('0x27')](_0x216c19);};}function getInteractionUsers(_0x555f0e,_0xa63b14){return new BPromise(function(_0x3c6f9f,_0x1ecc4a){try{if(_0xa63b14[_0x555f0e['id']]){_0x555f0e['Users']=_[_0x7210('0x28')](_0xa63b14[_0x555f0e['id']],function(_0x2d57c0){return{'id':_0x2d57c0['id'],'fullname':_0x2d57c0[_0x7210('0x29')]};});}}catch(_0x256b6d){_0x1ecc4a(_0x256b6d);}_0x3c6f9f(_0x555f0e);});}function getInteractionTags(_0x2a6c2d,_0x507802){return new BPromise(function(_0x784a57,_0x2ff80b){try{if(_0x2a6c2d['TagIds']){_0x2a6c2d[_0x7210('0x2a')]=[];_0x2a6c2d['TagIds'][_0x7210('0x2b')](',')[_0x7210('0x2c')](function(_0x426b9c){_0x2a6c2d[_0x7210('0x2a')]['push'](_0x507802[_0x426b9c]);});}delete _0x2a6c2d['TagIds'];}catch(_0xb0c003){_0x2ff80b(_0xb0c003);}_0x784a57(_0x2a6c2d);});}function updateSmsInteraction(_0x2024ff,_0x34f74c,_0x1ed114){return new BPromise(function(_0x1464bd,_0x231322){return getInteractionUsers(_0x2024ff,_0x1ed114)['then'](function(_0x40b6f1){return getInteractionTags(_0x40b6f1,_0x34f74c);})[_0x7210('0x24')](function(_0x123f81){_0x1464bd(_0x123f81);})['catch'](function(_0x44c7ca){_0x231322(_0x44c7ca);});});}exports[_0x7210('0x2d')]=function(_0x53c27c,_0x41df65){var _0x184b36={},_0x58008e={},_0x2ecb77={'count':0x0,'rows':[]};var _0x154e93=_[_0x7210('0x28')](db[_0x7210('0x2e')][_0x7210('0x2f')],function(_0x13fd16){return{'name':_0x13fd16[_0x7210('0x30')],'type':_0x13fd16[_0x7210('0x31')][_0x7210('0x32')]};});_0x58008e[_0x7210('0x33')]=_['map'](_0x154e93,_0x7210('0x26'));_0x58008e[_0x7210('0x34')]=_[_0x7210('0x35')](_0x53c27c['query']);_0x58008e[_0x7210('0x36')]=_[_0x7210('0x37')](_0x58008e[_0x7210('0x33')],_0x58008e[_0x7210('0x34')]);_0x184b36['attributes']=_[_0x7210('0x37')](_0x58008e[_0x7210('0x33')],qs[_0x7210('0x38')](_0x53c27c[_0x7210('0x34')][_0x7210('0x38')]));_0x184b36['attributes']=_0x184b36['attributes'][_0x7210('0x39')]?_0x184b36[_0x7210('0x3a')]:_0x58008e['model'];if(!_0x53c27c[_0x7210('0x34')][_0x7210('0x3b')](_0x7210('0x3c'))){_0x184b36[_0x7210('0x3d')]=qs['limit'](_0x53c27c[_0x7210('0x34')][_0x7210('0x3d')]);_0x184b36[_0x7210('0x1d')]=qs['offset'](_0x53c27c[_0x7210('0x34')][_0x7210('0x1d')]);}_0x184b36[_0x7210('0x3e')]=qs[_0x7210('0x3f')](_0x53c27c['query'][_0x7210('0x3f')]);_0x184b36[_0x7210('0x40')]=qs[_0x7210('0x36')](_[_0x7210('0x41')](_0x53c27c[_0x7210('0x34')],_0x58008e[_0x7210('0x36')]));var _0x3713ed=[];var _0x56ec04=squel[_0x7210('0x42')]()[_0x7210('0x43')]('id')[_0x7210('0x43')](_0x7210('0x26'))['field'](_0x7210('0x44'))[_0x7210('0x45')](_0x7210('0x46'));var _0x41817b=squel[_0x7210('0x42')]()['field'](_0x7210('0x47'))[_0x7210('0x43')]('u.fullname')[_0x7210('0x43')](_0x7210('0x48'))[_0x7210('0x45')]('user_has_sms_interactions','ui')['left_join'](_0x7210('0x49'),'u','u.id\x20=\x20ui.UserId');var _0x305d6d=squel[_0x7210('0x42')]()[_0x7210('0x45')](_0x7210('0x4a'),'i')[_0x7210('0x4b')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x7210('0x4b')]('users','o',_0x7210('0x4c'))[_0x7210('0x4b')](_0x7210('0x4d'),'a',_0x7210('0x4e'))[_0x7210('0x4b')](_0x7210('0x4f'),'me',_0x7210('0x50'))[_0x7210('0x4b')]('sms_interaction_has_tags','it',_0x7210('0x51'))[_0x7210('0x4b')](_0x7210('0x46'),'t',_0x7210('0x52'));var _0x4d78a3=squel[_0x7210('0x53')]();var _0x58a970=[];var _0x3c88e1=squel['expr']();var _0xdc1af9;if(_0x53c27c[_0x7210('0x34')][_0x7210('0x54')]){_0xdc1af9=as['parseSearch'](_0x53c27c['query'][_0x7210('0x54')]);var _0xd0cff8=_0xdc1af9[_0x7210('0x55')];for(var _0x3abdff=0x0;_0x3abdff<_0xdc1af9[_0x7210('0x56')][_0x7210('0x39')];_0x3abdff++){var _0x1c3e78=_0xdc1af9[_0x7210('0x56')][_0x3abdff];var _0x590c37='i';var _0x50a027=_[_0x7210('0x57')](_0x154e93,[_0x7210('0x26'),_0x1c3e78[_0x7210('0x43')]]);if(!_0x50a027){switch(_0x1c3e78['field']){case _0x7210('0x58'):if(_0x1c3e78[_0x7210('0x59')]==0x1){_0x305d6d[_0x7210('0x5a')]('`'+_0x1c3e78[_0x7210('0x43')]+_0x7210('0x5b'));}else{_0x305d6d['having']('`'+_0x1c3e78[_0x7210('0x43')]+_0x7210('0x5c'));}break;case _0x7210('0x5d'):if(_0x1c3e78[_0x7210('0x5e')]==='$substring'){if(_0x1c3e78[_0x7210('0x59')]['split']('\x20')[_0x7210('0x39')]>0x1){_0x4d78a3[_0xd0cff8](_0x7210('0x5f'),qs[_0x7210('0x60')](_0x1c3e78[_0x7210('0x59')]),null);}else{var _0x5c0590='%'+_0x1c3e78[_0x7210('0x59')]+'%';_0x4d78a3[_0xd0cff8]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x5c0590,_0x5c0590,_0x5c0590);}}else{_0x50a027=_[_0x7210('0x57')](_0x154e93,['name','ContactId']);_0x1c3e78['field']=_0x7210('0x61');_0x3418ad=as['buildExpression'](_0x590c37,_0x50a027[_0x7210('0x31')],_0x1c3e78);_0x4d78a3[_0xd0cff8](_0x3418ad['text'],_0x3418ad['value']['start'],_0x3418ad['value'][_0x7210('0x1a')]);}break;case'Tag':var _0x1a3ea5=_0x1c3e78['value'][_0x7210('0x2b')](',')[_0x7210('0x28')](function(_0x4d00c7){return Number(_0x4d00c7);});_0x1a3ea5[_0x7210('0x2c')](function(_0x229b0f){_0x3c88e1['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x229b0f+',%');});_0x58a970=_[_0x7210('0x62')](_0x58a970,_0x1a3ea5);break;case _0x7210('0x63'):if(_0x1c3e78['operator']==='$substring'){_0x4d78a3[_0xd0cff8]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x1c3e78[_0x7210('0x59')]+'%',null);}else{_0x50a027=_['find'](_0x154e93,[_0x7210('0x26'),_0x7210('0x64')]);_0x1c3e78[_0x7210('0x43')]=_0x7210('0x64');_0x3418ad=as[_0x7210('0x65')](_0x590c37,_0x50a027[_0x7210('0x31')],_0x1c3e78);_0x4d78a3[_0xd0cff8](_0x3418ad[_0x7210('0x66')],_0x3418ad[_0x7210('0x59')]['start'],_0x3418ad[_0x7210('0x59')]['end']);}break;case _0x7210('0x67'):_0x3418ad=as[_0x7210('0x65')]('me',null,_0x1c3e78);_0x4d78a3[_0xd0cff8](_0x3418ad[_0x7210('0x66')],_0x3418ad['value']['start'],_0x3418ad[_0x7210('0x59')][_0x7210('0x1a')]);break;}}else{var _0x3418ad=as[_0x7210('0x65')](_0x590c37,_0x50a027['type'],_0x1c3e78);_0x4d78a3[_0xd0cff8](_0x3418ad['text'],_0x3418ad[_0x7210('0x59')][_0x7210('0x68')],_0x3418ad['value'][_0x7210('0x1a')]);}}}else{var _0x4046a6=_(_0x53c27c['query'])[_0x7210('0x35')]()['map'](function(_0x24557b){return _[_0x7210('0x69')](_0x154e93,[_0x7210('0x26'),_0x24557b])?_0x24557b:undefined;})['compact']()[_0x7210('0x59')]();if(!_['isEmpty'](_0x4046a6)){_0x4046a6[_0x7210('0x2c')](function(_0x57a1cd){if(_0x57a1cd==='SmsAccountId'){_0x305d6d[_0x7210('0x40')](_0x7210('0x6a'),[][_0x7210('0x6b')](_0x53c27c[_0x7210('0x34')][_0x57a1cd]));}else if(_0x57a1cd===_0x7210('0x6c')){var _0x2209c6=JSON[_0x7210('0x6d')](_0x53c27c['query'][_0x57a1cd])[_0x7210('0x6e')];var _0x5c729e=JSON[_0x7210('0x6d')](_0x53c27c[_0x7210('0x34')][_0x57a1cd])[_0x7210('0x6f')];_0x305d6d[_0x7210('0x40')](_0x7210('0x70'),_0x2209c6,_0x5c729e);}else{if(_0x53c27c[_0x7210('0x34')][_0x57a1cd]===_0x7210('0x71')){_0x305d6d[_0x7210('0x40')]('i.'+_0x57a1cd+_0x7210('0x72'));}else{_0x305d6d[_0x7210('0x40')]('i.'+_0x57a1cd+_0x7210('0x73'),_0x53c27c[_0x7210('0x34')][_0x57a1cd]);}}});}if(_0x53c27c[_0x7210('0x34')]['read']){if(_0x53c27c['query'][_0x7210('0x74')]==0x1){_0x305d6d[_0x7210('0x5a')](_0x7210('0x75'));}else{_0x305d6d[_0x7210('0x5a')](_0x7210('0x76'));}}if(_0x53c27c[_0x7210('0x34')]['tag']){_0x58a970=_['isArray'](_0x53c27c[_0x7210('0x34')][_0x7210('0x77')])?_0x53c27c[_0x7210('0x34')][_0x7210('0x77')]:new Array(_0x53c27c[_0x7210('0x34')][_0x7210('0x77')]);_0x58a970[_0x7210('0x2c')](function(_0x3dd11b){_0x3c88e1['or'](_0x7210('0x78'),'%,'+_0x3dd11b+',%');});}if(_0x53c27c[_0x7210('0x34')][_0x7210('0x79')]){var _0x3c8220=_0x53c27c[_0x7210('0x34')][_0x7210('0x79')][_0x7210('0x7a')]('\x5c','\x5c\x5c')[_0x7210('0x7a')]('\x27\x27',_0x7210('0x7b'));if(qs[_0x7210('0x7c')](_0x3c8220)){_0x4d78a3['or']('i.id\x20LIKE\x20?',_0x3c8220+'%')['or'](_0x7210('0x7d'),_0x3c8220+'%');}else{_0x4d78a3['or'](_0x7210('0x7e'),qs[_0x7210('0x60')](_0x3c8220))['or'](_0x7210('0x7f'),_0x3c8220+'%');}}}_0x305d6d['where'](_0x4d78a3);_0x305d6d[_0x7210('0x80')](_0x7210('0x81'));var _0x50611a={'type':db[_0x7210('0x82')][_0x7210('0x83')][_0x7210('0x84')],'raw':!![]};var _0x21d405=_0x305d6d[_0x7210('0x85')]();_0x21d405['field'](_0x7210('0x81'));_0x21d405[_0x7210('0x43')](_0x7210('0x86'),_0x7210('0x58'));if(_0x184b36['order']){_0x184b36[_0x7210('0x3e')][_0x7210('0x2c')](function(_0x9d85d2){_0x305d6d['order']('i.'+_0x9d85d2[0x0],_0x9d85d2[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x58a970)){_0x305d6d[_0x7210('0x5a')](_0x3c88e1);_0x21d405[_0x7210('0x40')](_0x7210('0x87'),_0x58a970);}BPromise['resolve']()[_0x7210('0x24')](function(){if(!_0xdc1af9&&_0x53c27c['query'][_0x7210('0x88')])return;return _0x53c27c['user'][_0x7210('0x89')]({'attributes':['id'],'raw':!![]})[_0x7210('0x24')](function(_0x4a257f){if(_[_0x7210('0x8a')](_0x4a257f)){_0x21d405[_0x7210('0x40')](_0x7210('0x8b'));_0x305d6d['where'](_0x7210('0x8b'));}else{_0x21d405[_0x7210('0x40')]('i.SmsAccountId\x20IN\x20?',_['map'](_0x4a257f,'id'));_0x305d6d['where'](_0x7210('0x6a'),_['map'](_0x4a257f,'id'));}});})[_0x7210('0x24')](function(){db[_0x7210('0x8c')][_0x7210('0x34')](_0x21d405[_0x7210('0x8d')](),_0x50611a)[_0x7210('0x24')](function(_0x401223){_0x2ecb77['count']=_0x401223['length'];if(_0x2ecb77[_0x7210('0x1c')]===0x0)return[];return db[_0x7210('0x8c')][_0x7210('0x34')](_0x56ec04[_0x7210('0x8d')](),_0x50611a)[_0x7210('0x24')](function(_0x5afce2){_0x3713ed=_[_0x7210('0x8e')](_0x5afce2,'id');_0x50611a=_[_0x7210('0x8f')](_0x50611a,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x53c27c[_0x7210('0x34')][_0x7210('0x38')]){_0x184b36[_0x7210('0x3a')][_0x7210('0x2c')](function(_0xc233e4){_0x305d6d['field']('i.'+_0xc233e4);});}else{_0x305d6d[_0x7210('0x43')](_0x7210('0x86'),_0x7210('0x58'));_0x305d6d['field'](_0x7210('0x90'),_0x7210('0x91'));_0x305d6d[_0x7210('0x43')](_0x7210('0x92'),_0x7210('0x93'));_0x305d6d[_0x7210('0x43')](_0x7210('0x94'));_0x305d6d[_0x7210('0x43')](_0x7210('0x95'),_0x7210('0x96'));_0x305d6d[_0x7210('0x43')](_0x7210('0x97'),_0x7210('0x98'));_0x305d6d[_0x7210('0x43')](_0x7210('0x99'),'Contact.email');_0x305d6d[_0x7210('0x43')](_0x7210('0x9a'),'Contact.phone');_0x305d6d['field']('c.mobile',_0x7210('0x9b'));_0x305d6d[_0x7210('0x43')](_0x7210('0x9c'),_0x7210('0x9d'));_0x305d6d[_0x7210('0x43')]('o.fullname',_0x7210('0x9e'));_0x305d6d['field'](_0x7210('0x9f'),_0x7210('0xa0'));_0x305d6d[_0x7210('0x43')](_0x7210('0xa1'),_0x7210('0xa2'));}_0x305d6d['limit'](_0x184b36[_0x7210('0x3d')]);_0x305d6d[_0x7210('0x1d')](_0x184b36['offset']);return db[_0x7210('0x8c')][_0x7210('0x34')](_0x305d6d[_0x7210('0x8d')](),_0x50611a);})['then'](function(_0x19a337){_0x41817b[_0x7210('0x40')](_0x7210('0xa3'),_[_0x7210('0x28')](_0x19a337,'id'));return db[_0x7210('0x8c')][_0x7210('0x34')](_0x41817b[_0x7210('0x8d')](),_0x50611a)[_0x7210('0x24')](function(_0x2d5e91){var _0x19e007=_[_0x7210('0xa4')](_0x2d5e91,_0x7210('0xa5'));var _0x1d2c22=[];_0x19a337[_0x7210('0x2c')](function(_0x335c44){_0x1d2c22[_0x7210('0xa6')](updateSmsInteraction(_0x335c44,_0x3713ed,_0x19e007));});return BPromise[_0x7210('0xa7')](_0x1d2c22);});});})[_0x7210('0x24')](function(_0x3b585e){_0x2ecb77[_0x7210('0xa8')]=_0x3b585e;return _0x2ecb77;})[_0x7210('0x24')](respondWithFilteredResult(_0x41df65,_0x184b36));})['catch'](handleError(_0x41df65,null));};exports[_0x7210('0xa9')]=function(_0x1282b6,_0x34110f){var _0x75c2da={'raw':![],'where':{'id':_0x1282b6[_0x7210('0xaa')]['id']}},_0x30d579={};_0x30d579[_0x7210('0x33')]=_[_0x7210('0x35')](db[_0x7210('0x2e')]['rawAttributes']);_0x30d579[_0x7210('0x34')]=_[_0x7210('0x35')](_0x1282b6['query']);_0x30d579[_0x7210('0x36')]=_['intersection'](_0x30d579[_0x7210('0x33')],_0x30d579[_0x7210('0x34')]);_0x75c2da[_0x7210('0x3a')]=_[_0x7210('0x37')](_0x30d579[_0x7210('0x33')],qs['fields'](_0x1282b6[_0x7210('0x34')][_0x7210('0x38')]));_0x75c2da['attributes']=_0x75c2da[_0x7210('0x3a')][_0x7210('0x39')]?_0x75c2da[_0x7210('0x3a')]:_0x30d579[_0x7210('0x33')];if(_0x1282b6[_0x7210('0x34')][_0x7210('0xab')]){_0x75c2da[_0x7210('0xac')]=[{'all':!![]}];}_0x75c2da=_[_0x7210('0x8f')]({},_0x75c2da,_0x1282b6['options']);return db['SmsInteraction'][_0x7210('0x57')](_0x75c2da)['then'](handleEntityNotFound(_0x34110f,null))[_0x7210('0x24')](respondWithResult(_0x34110f,null))[_0x7210('0xad')](handleError(_0x34110f,null));};exports[_0x7210('0xae')]=function(_0x2a59ac,_0x23e57f){return db[_0x7210('0x2e')][_0x7210('0xae')](_0x2a59ac['body'],{})['then'](respondWithResult(_0x23e57f,0xc9))[_0x7210('0xad')](handleError(_0x23e57f,null));};exports['update']=function(_0x39ff84,_0x5737c2){if(_0x39ff84['body']['id']){delete _0x39ff84[_0x7210('0x67')]['id'];}return db[_0x7210('0x2e')][_0x7210('0x57')]({'where':{'id':_0x39ff84[_0x7210('0xaa')]['id']}})[_0x7210('0x24')](handleEntityNotFound(_0x5737c2,null))[_0x7210('0x24')](saveUpdates(_0x39ff84[_0x7210('0x67')],null))['then'](respondWithResult(_0x5737c2,null))[_0x7210('0xad')](handleError(_0x5737c2,null));};exports[_0x7210('0x23')]=function(_0x287872,_0x3db7b6){return db[_0x7210('0x2e')][_0x7210('0x57')]({'where':{'id':_0x287872['params']['id']}})[_0x7210('0x24')](handleEntityNotFound(_0x3db7b6,null))[_0x7210('0x24')](removeEntity(_0x3db7b6,null))[_0x7210('0xad')](handleError(_0x3db7b6,null));};exports[_0x7210('0xaf')]=function(_0x172407,_0xfdf5a1){return db[_0x7210('0x2e')]['describe']()['then'](respondWithResult(_0xfdf5a1,null))['catch'](handleError(_0xfdf5a1,null));};exports[_0x7210('0xb0')]=function(_0x15d4c3,_0x2050e1,_0x42672f){return db['SmsMessage']['find']({'where':{'id':_0x15d4c3[_0x7210('0xaa')]['id']}})[_0x7210('0x24')](handleEntityNotFound(_0x2050e1,null))['then'](function(_0x4b656f){if(_0x4b656f){return _0x4b656f[_0x7210('0xb0')](_0x15d4c3[_0x7210('0x67')][_0x7210('0xb1')],_[_0x7210('0xb2')](_0x15d4c3[_0x7210('0x67')],['ids','id'])||{});}})[_0x7210('0x24')](respondWithResult(_0x2050e1,null))[_0x7210('0xad')](handleError(_0x2050e1,null));};exports[_0x7210('0xb3')]=function(_0x2d9a0d,_0x84734d,_0x357526){var _0x21d71a={'raw':![],'where':{}};var _0x2fcbc1={};var _0x57aaec={'count':0x0,'rows':[]};return db[_0x7210('0x2e')][_0x7210('0xb4')]({'where':{'id':_0x2d9a0d[_0x7210('0xaa')]['id']}})['then'](handleEntityNotFound(_0x84734d,null))[_0x7210('0x24')](function(_0x502887){if(_0x502887){_0x2fcbc1['model']=_[_0x7210('0x35')](db[_0x7210('0xb5')][_0x7210('0x2f')]);_0x2fcbc1[_0x7210('0x34')]=_[_0x7210('0x35')](_0x2d9a0d[_0x7210('0x34')]);_0x2fcbc1['filters']=_[_0x7210('0x37')](_0x2fcbc1[_0x7210('0x33')],_0x2fcbc1[_0x7210('0x34')]);_0x21d71a[_0x7210('0x3a')]=_[_0x7210('0x37')](_0x2fcbc1[_0x7210('0x33')],qs[_0x7210('0x38')](_0x2d9a0d[_0x7210('0x34')][_0x7210('0x38')]));_0x21d71a[_0x7210('0x3a')]=_0x21d71a[_0x7210('0x3a')][_0x7210('0x39')]?_0x21d71a[_0x7210('0x3a')]:_0x2fcbc1[_0x7210('0x33')];if(!_0x2d9a0d[_0x7210('0x34')][_0x7210('0x3b')](_0x7210('0x3c'))){_0x21d71a[_0x7210('0x3d')]=qs[_0x7210('0x3d')](_0x2d9a0d[_0x7210('0x34')][_0x7210('0x3d')]);_0x21d71a['offset']=qs[_0x7210('0x1d')](_0x2d9a0d['query']['offset']);}_0x21d71a[_0x7210('0x3e')]=qs[_0x7210('0x3f')](_0x2d9a0d['query']['sort']);_0x21d71a[_0x7210('0x40')]=qs[_0x7210('0x36')](_['pick'](_0x2d9a0d[_0x7210('0x34')],_0x2fcbc1[_0x7210('0x36')]));_0x21d71a[_0x7210('0x40')][_0x7210('0xa5')]=_0x502887['id'];if(_0x2d9a0d['query'][_0x7210('0x79')]){_0x21d71a[_0x7210('0x40')]=_['merge'](_0x21d71a[_0x7210('0x40')],{'$or':_[_0x7210('0x28')](_0x21d71a[_0x7210('0x3a')],function(_0x5591c4){var _0x5d4337={};_0x5d4337[_0x5591c4]={'$like':'%'+_0x2d9a0d['query'][_0x7210('0x79')]+'%'};return _0x5d4337;})});}if(_0x2d9a0d['query'][_0x7210('0x6e')]){var _0x37d081=_0x2d9a0d[_0x7210('0x34')][_0x7210('0x6e')][_0x7210('0x2b')](',');var _0x3c1e98={};_0x3c1e98[_0x37d081[0x0]]={'$gte':moment(_0x37d081[0x1])[_0x7210('0xb6')](_0x7210('0xb7'))};_0x21d71a[_0x7210('0x40')]=_[_0x7210('0x8f')](_0x21d71a[_0x7210('0x40')],_0x3c1e98);}_0x21d71a=_[_0x7210('0x8f')]({},_0x21d71a,_0x2d9a0d['options']);return db['SmsMessage']['count']({'where':_0x21d71a[_0x7210('0x40')]})[_0x7210('0x24')](function(_0x2299e2){_0x57aaec['count']=_0x2299e2;if(_0x2d9a0d[_0x7210('0x34')][_0x7210('0xab')]){_0x21d71a[_0x7210('0xac')]=[{'all':!![]}];}return db['SmsMessage'][_0x7210('0xb8')](_0x21d71a);})[_0x7210('0x24')](function(_0x3e9109){_0x57aaec[_0x7210('0xa8')]=_0x3e9109;return _0x57aaec;});}})[_0x7210('0x24')](respondWithFilteredResult(_0x84734d,_0x21d71a))[_0x7210('0xad')](handleError(_0x84734d,null));};exports[_0x7210('0xb9')]=function(_0x2790e1,_0x1f172b,_0x2871b1){return db[_0x7210('0x2e')]['find']({'where':{'id':_0x2790e1['params']['id']}})[_0x7210('0x24')](handleEntityNotFound(_0x1f172b,null))[_0x7210('0x24')](function(_0x59b421){if(_0x59b421){return _0x59b421['setTags'](_0x2790e1[_0x7210('0x67')][_0x7210('0xb1')],_[_0x7210('0xb2')](_0x2790e1[_0x7210('0x67')],[_0x7210('0xb1'),'id'])||{})['spread'](function(){return db[_0x7210('0xba')]['findAll']({'attributes':['id','name',_0x7210('0x44')],'where':{'id':_0x2790e1[_0x7210('0x67')][_0x7210('0xb1')]}});})[_0x7210('0x24')](function(_0x1b4d4e){socket[_0x7210('0xbb')](_0x7210('0xbc'),{'id':Number(_0x2790e1['params']['id']),'tags':_0x1b4d4e||[]});return{'id':Number(_0x2790e1[_0x7210('0xaa')]['id']),'tags':_0x1b4d4e||[]};});}})[_0x7210('0x24')](respondWithResult(_0x1f172b,null))[_0x7210('0xad')](handleError(_0x1f172b,null));};exports[_0x7210('0xbd')]=function(_0x13a8f5,_0x3682d4,_0x2ee311){return db[_0x7210('0x2e')][_0x7210('0x57')]({'where':{'id':_0x13a8f5[_0x7210('0xaa')]['id']}})['then'](handleEntityNotFound(_0x3682d4,null))[_0x7210('0x24')](function(_0x4b1f2f){if(_0x4b1f2f){return _0x4b1f2f[_0x7210('0xbd')](_0x13a8f5['query'][_0x7210('0xb1')]);}})['then'](respondWithStatusCode(_0x3682d4,null))[_0x7210('0xad')](handleError(_0x3682d4,null));};exports[_0x7210('0xbe')]=function(_0x38841c,_0x5302de){var _0xa81750=moment()[_0x7210('0xbf')]()[_0x7210('0x8d')]();var _0x52c333=path['join'](config[_0x7210('0xc0')],'server','files',_0x7210('0xc1'));var _0x236727=path[_0x7210('0xc2')](config['root'],_0x7210('0xc3'),_0x7210('0xc4'),'attachments');var _0x266275=path['join'](_0x52c333,_0xa81750);var _0x5e887d=util[_0x7210('0xb6')]('transcript-%d-%s.zip',_0x38841c[_0x7210('0xaa')]['id'],_0xa81750);var _0x57b600=path[_0x7210('0xc2')](_0x52c333,_0x5e887d);var _0x138af0=[];_0x138af0['push']({'model':db[_0x7210('0x63')],'as':_0x7210('0x63'),'attributes':['id','fullname'],'raw':!![]});_0x138af0[_0x7210('0xa6')]({'model':db['CmContact'],'as':_0x7210('0x5d'),'attributes':['id',_0x7210('0xc5'),_0x7210('0xc6')],'raw':!![]});var _0x2ba3f7=[{'model':db['SmsMessage'],'as':_0x7210('0xc7'),'attributes':['id','body',_0x7210('0x6c'),_0x7210('0xc8'),'secret','read'],'include':_0x138af0}];_0x2ba3f7[_0x7210('0xa6')]({'model':db[_0x7210('0xc9')],'as':_0x7210('0xca'),'attributes':['id',_0x7210('0x26')]});_0x2ba3f7[_0x7210('0xa6')]({'model':db['User'],'as':_0x7210('0xcb'),'attributes':['id',_0x7210('0x29')]});return db[_0x7210('0x2e')][_0x7210('0x57')]({'where':{'id':_0x38841c['params']['id']},'include':_0x2ba3f7})[_0x7210('0x24')](handleEntityNotFound(_0x5302de,null))[_0x7210('0x24')](function(_0x26dba2){if(_0x26dba2){var _0xb05f69=_0x26dba2['get']({'plain':!![]});fs[_0x7210('0xcc')](_0x266275);var _0x2bccc8={'format':'A4','border':'10px','header':{'height':_0x7210('0xcd'),'contents':{'first':'\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\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\x20\x20\x20\x20\x20\x20\x20'}},'footer':{'height':'30px','contents':{'default':util[_0x7210('0xb6')](_0x7210('0xce'),util[_0x7210('0xb6')](_0x7210('0xcf'),_0x7210('0xd0'),_0xb05f69['id']),moment()['format']('YYYY-MM-DD')[_0x7210('0x8d')]())}}};var _0x355113={'channel':_0x7210('0xd0'),'account':_0xb05f69[_0x7210('0xca')][_0x7210('0x26')],'agent':_0xb05f69[_0x7210('0xcb')]?_0xb05f69['Owner']['fullname']:_0x7210('0xd1'),'createdAt':moment(_0xb05f69[_0x7210('0x6c')])['format'](_0x7210('0xb7'))[_0x7210('0x8d')](),'closedAt':_0xb05f69[_0x7210('0xd2')]?moment(_0xb05f69[_0x7210('0xd3')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x7210('0x8d')]():'','disposition':_0xb05f69[_0x7210('0xd4')],'messages':_(_0xb05f69[_0x7210('0xc7')])[_0x7210('0x79')]({'secret':![]})[_0x7210('0x28')](function(_0x10edfa){return{'date':moment(_0x10edfa['createdAt'])['format'](_0x7210('0xb7'))[_0x7210('0x8d')](),'sender':_0x10edfa['direction']===_0x7210('0xd5')?_0x10edfa[_0x7210('0x63')]?_0x10edfa[_0x7210('0x63')][_0x7210('0x29')]:'System':_0x10edfa[_0x7210('0x5d')]['firstName']+(_0x10edfa[_0x7210('0x5d')][_0x7210('0xc6')]?'\x20'+_0x10edfa['Contact'][_0x7210('0xc6')]:''),'body':_0x10edfa[_0x7210('0x67')],'direction':_0x10edfa[_0x7210('0xc8')]===_0x7210('0xd5')?'A':'C','secret':_0x10edfa['secret'],'read':_0x10edfa[_0x7210('0x74')]};})['value']()};return ejs[_0x7210('0xd6')](path['join'](config[_0x7210('0xc0')],_0x7210('0xc3'),_0x7210('0xd7'),'downloadInteraction.html'),{'interaction':_0x355113})['then'](function(_0x309751){return new BPromise(function(_0x52e19a,_0x5d28ba){pdf['create'](_0x309751,_0x2bccc8)[_0x7210('0xd8')](path[_0x7210('0xc2')](_0x266275,'transcript-'+_0xb05f69['id']+'-'+_0xa81750+'.pdf'),function(_0x294ec6,_0x4099ea){if(_0x294ec6)return _0x5d28ba(_0x294ec6);_0x52e19a(_0x4099ea);});});})[_0x7210('0x24')](function(){return new BPromise(function(_0x2e5009,_0x56ab95){zipdir(_0x266275,{'saveTo':_0x57b600},function(_0x5d86e9,_0xb69f31){if(_0x5d86e9)return _0x56ab95(_0x5d86e9);return _0x2e5009(_0xb69f31);});})['then'](function(){return new BPromise(function(_0x17d4d3,_0x1801cb){rimraf(_0x266275,function(_0x3217de){if(_0x3217de)_0x1801cb(_0x3217de);return _0x17d4d3();});});})['then'](function(){return _0x5302de[_0x7210('0xbe')](_0x57b600,_0x5e887d,function(_0x363b5f){if(_0x363b5f){console['log'](_0x7210('0xd9'),_0x363b5f);}else{fs[_0x7210('0xda')](_0x57b600);}});});});}else{return _0x5302de[_0x7210('0x18')](0xc8);}})['catch'](handleError(_0x5302de,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index afbd11e..5036a93 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 _0xb717=['length','emit','hasOwnProperty','exports','events','SmsInteraction','SmsMessage','setMaxListeners','save','remove','then','setDataValue','Users','map','findAll','unreadMessages'];(function(_0x641c1d,_0x227628){var _0x5a2b22=function(_0x58eb18){while(--_0x58eb18){_0x641c1d['push'](_0x641c1d['shift']());}};_0x5a2b22(++_0x227628);}(_0xb717,0x1b4));var _0x7b71=function(_0x2329d7,_0x27eac9){_0x2329d7=_0x2329d7-0x0;var _0x5229a1=_0xb717[_0x2329d7];return _0x5229a1;};'use strict';var EventEmitter=require(_0x7b71('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0x7b71('0x1')];var SmsMessage=require('../../mysqldb')['db'][_0x7b71('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x7b71('0x3')](0x0);var events={'afterCreate':_0x7b71('0x4'),'afterUpdate':'update','afterDestroy':_0x7b71('0x5')};function emitEvent(_0x2e583f){return function(_0x455c08,_0x26044f,_0x3d3643){_0x455c08['getUsers']({'attributes':['id'],'raw':!![]})[_0x7b71('0x6')](function(_0x27b060){_0x455c08[_0x7b71('0x7')](_0x7b71('0x8'),_0x27b060[_0x7b71('0x9')](function(_0x570e98){return{'id':_0x570e98['id']};}));return SmsMessage[_0x7b71('0xa')]({'where':{'SmsInteractionId':_0x455c08['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7b71('0x6')](function(_0x53857a){_0x455c08[_0x7b71('0x7')](_0x7b71('0xb'),_0x53857a[_0x7b71('0xc')]);SmsInteractionEvents['emit'](_0x2e583f+':'+_0x455c08['id'],_0x455c08);SmsInteractionEvents[_0x7b71('0xd')](_0x2e583f,_0x455c08);_0x3d3643(null);})['catch'](_0x3d3643(null));};}for(var e in events){if(events[_0x7b71('0xe')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0x7b71('0xf')]=SmsInteractionEvents; \ No newline at end of file +var _0x56e7=['emit','hasOwnProperty','hook','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','getUsers','then','Users','findAll','length'];(function(_0x764400,_0x5503de){var _0x3ec1e0=function(_0x551740){while(--_0x551740){_0x764400['push'](_0x764400['shift']());}};_0x3ec1e0(++_0x5503de);}(_0x56e7,0x7b));var _0x756e=function(_0x2dd1d3,_0x491b0c){_0x2dd1d3=_0x2dd1d3-0x0;var _0x531454=_0x56e7[_0x2dd1d3];return _0x531454;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x756e('0x0'))['db'][_0x756e('0x1')];var SmsMessage=require('../../mysqldb')['db'][_0x756e('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x756e('0x3')](0x0);var events={'afterCreate':_0x756e('0x4'),'afterUpdate':_0x756e('0x5'),'afterDestroy':_0x756e('0x6')};function emitEvent(_0x38546a){return function(_0x446fff,_0x538050,_0x3b3b8f){_0x446fff[_0x756e('0x7')]({'attributes':['id'],'raw':!![]})[_0x756e('0x8')](function(_0xcf58ec){_0x446fff['setDataValue'](_0x756e('0x9'),_0xcf58ec['map'](function(_0x4460c7){return{'id':_0x4460c7['id']};}));return SmsMessage[_0x756e('0xa')]({'where':{'SmsInteractionId':_0x446fff['id'],'direction':'in','read':![]},'raw':!![]});})[_0x756e('0x8')](function(_0x4738dc){_0x446fff['setDataValue']('unreadMessages',_0x4738dc[_0x756e('0xb')]);SmsInteractionEvents[_0x756e('0xc')](_0x38546a+':'+_0x446fff['id'],_0x446fff);SmsInteractionEvents[_0x756e('0xc')](_0x38546a,_0x446fff);_0x3b3b8f(null);})['catch'](_0x3b3b8f(null));};}for(var e in events){if(events[_0x756e('0xd')](e)){var event=events[e];SmsInteraction[_0x756e('0xe')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index ff050c2..2c124ef 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 _0x0234=['util','../../config/logger','bluebird','rimraf','./smsInteraction.attributes','define','SmsInteraction','sms_interactions','changed','closedAt','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x290061,_0x4f8ffe){var _0xeb3fd7=function(_0x30c03d){while(--_0x30c03d){_0x290061['push'](_0x290061['shift']());}};_0xeb3fd7(++_0x4f8ffe);}(_0x0234,0xfd));var _0x4023=function(_0x4c9278,_0x324a88){_0x4c9278=_0x4c9278-0x0;var _0x7844a9=_0x0234[_0x4c9278];return _0x7844a9;};'use strict';var _=require('lodash');var util=require(_0x4023('0x0'));var logger=require(_0x4023('0x1'))('api');var moment=require('moment');var BPromise=require(_0x4023('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4023('0x3'));var config=require('../../config/environment');var attributes=require(_0x4023('0x4'));module['exports']=function(_0x5560d5,_0x574c71){return _0x5560d5[_0x4023('0x5')](_0x4023('0x6'),attributes,{'tableName':_0x4023('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x356b2a,_0xa05f5a,_0x4a224b){if(_0x356b2a[_0x4023('0x8')]('closed')){_0x356b2a[_0x4023('0x9')]=moment()['format'](_0x4023('0xa'));}_0x4a224b(null,_0x356b2a);}}});}; \ No newline at end of file +var _0x514b=['format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','closed','closedAt'];(function(_0x447d04,_0x17d2ce){var _0x36a9e7=function(_0x49aa85){while(--_0x49aa85){_0x447d04['push'](_0x447d04['shift']());}};_0x36a9e7(++_0x17d2ce);}(_0x514b,0x1b2));var _0xb514=function(_0x264032,_0x3f07e1){_0x264032=_0x264032-0x0;var _0x5d8100=_0x514b[_0x264032];return _0x5d8100;};'use strict';var _=require(_0xb514('0x0'));var util=require(_0xb514('0x1'));var logger=require(_0xb514('0x2'))(_0xb514('0x3'));var moment=require(_0xb514('0x4'));var BPromise=require(_0xb514('0x5'));var rp=require(_0xb514('0x6'));var fs=require('fs');var path=require(_0xb514('0x7'));var rimraf=require(_0xb514('0x8'));var config=require('../../config/environment');var attributes=require(_0xb514('0x9'));module[_0xb514('0xa')]=function(_0x5d608b,_0x4fae63){return _0x5d608b[_0xb514('0xb')](_0xb514('0xc'),attributes,{'tableName':_0xb514('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5d66d5,_0x321a79,_0x2f08e5){if(_0x5d66d5['changed'](_0xb514('0xe'))){_0x5d66d5[_0xb514('0xf')]=moment()[_0xb514('0x10')](_0xb514('0x11'));}_0x2f08e5(null,_0x5d66d5);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 8c0f72b..3100c39 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 _0xf607=['./smsInteraction.socket','register','request','then','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','UpdateSmsInteraction','SmsInteraction','options','raw','where','addTags','ids','omit','body','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x19d428,_0x412a21){var _0x1344d3=function(_0x2f3376){while(--_0x2f3376){_0x19d428['push'](_0x19d428['shift']());}};_0x1344d3(++_0x412a21);}(_0xf607,0x19e));var _0x7f60=function(_0x292760,_0x48e3cc){_0x292760=_0x292760-0x0;var _0x3745c7=_0xf607[_0x292760];return _0x3745c7;};'use strict';var _=require(_0x7f60('0x0'));var util=require(_0x7f60('0x1'));var moment=require(_0x7f60('0x2'));var BPromise=require('bluebird');var rs=require(_0x7f60('0x3'));var fs=require('fs');var Redis=require(_0x7f60('0x4'));var db=require(_0x7f60('0x5'))['db'];var utils=require(_0x7f60('0x6'));var logger=require(_0x7f60('0x7'))(_0x7f60('0x8'));var config=require('../../config/environment');var jayson=require(_0x7f60('0x9'));var client=jayson['client'][_0x7f60('0xa')]({'port':0x232a});config[_0x7f60('0xb')]=_[_0x7f60('0xc')](config[_0x7f60('0xb')],{'host':_0x7f60('0xd'),'port':0x18eb});var socket=require(_0x7f60('0xe'))(new Redis(config[_0x7f60('0xb')]));require(_0x7f60('0xf'))[_0x7f60('0x10')](socket);function respondWithRpcPromise(_0x19190a,_0x2265bf,_0x5526f6){return new BPromise(function(_0x5a1ec4,_0x41ea98){return client[_0x7f60('0x11')](_0x19190a,_0x5526f6)[_0x7f60('0x12')](function(_0x3761d9){logger['info'](_0x7f60('0x13'),_0x2265bf,_0x7f60('0x14'));logger[_0x7f60('0x15')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x2265bf,_0x7f60('0x14'),JSON[_0x7f60('0x16')](_0x3761d9));if(_0x3761d9[_0x7f60('0x17')]){if(_0x3761d9[_0x7f60('0x17')][_0x7f60('0x18')]===0x1f4){logger[_0x7f60('0x17')](_0x7f60('0x13'),_0x2265bf,_0x3761d9[_0x7f60('0x17')][_0x7f60('0x19')]);return _0x41ea98(_0x3761d9[_0x7f60('0x17')][_0x7f60('0x19')]);}logger[_0x7f60('0x17')](_0x7f60('0x13'),_0x2265bf,_0x3761d9['error']['message']);return _0x5a1ec4(_0x3761d9[_0x7f60('0x17')]['message']);}else{logger[_0x7f60('0x1a')](_0x7f60('0x13'),_0x2265bf,_0x7f60('0x14'));_0x5a1ec4(_0x3761d9['result'][_0x7f60('0x19')]);}})[_0x7f60('0x1b')](function(_0x2fae74){logger['error'](_0x7f60('0x13'),_0x2265bf,_0x2fae74);_0x41ea98(_0x2fae74);});});}exports[_0x7f60('0x1c')]=function(_0x176d3d){var _0x176a44=this;return new Promise(function(_0x4e3134,_0x19d550){return db[_0x7f60('0x1d')]['update'](_0x176d3d['body'],{'raw':_0x176d3d[_0x7f60('0x1e')]?_0x176d3d[_0x7f60('0x1e')][_0x7f60('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x176d3d[_0x7f60('0x1e')]?_0x176d3d[_0x7f60('0x1e')][_0x7f60('0x20')]||null:null,'attributes':_0x176d3d[_0x7f60('0x1e')]?_0x176d3d[_0x7f60('0x1e')]['attributes']||null:null,'limit':_0x176d3d[_0x7f60('0x1e')]?_0x176d3d[_0x7f60('0x1e')]['limit']||null:null})[_0x7f60('0x12')](function(_0x7fe638){logger['info'](_0x7f60('0x1c'),_0x176d3d);logger[_0x7f60('0x15')]('UpdateSmsInteraction',_0x176d3d,JSON[_0x7f60('0x16')](_0x7fe638));_0x4e3134(_0x7fe638);})[_0x7f60('0x1b')](function(_0xdcc7e5){logger[_0x7f60('0x17')]('UpdateSmsInteraction',_0xdcc7e5['message'],_0x176d3d);_0x19d550(_0x176a44[_0x7f60('0x17')](0x1f4,_0xdcc7e5['message']));});});};exports['AddTagsToSmsInteraction']=function(_0x371d85){return new Promise(function(_0x594206,_0x43aeba){return db['SmsInteraction']['find']({'where':_0x371d85[_0x7f60('0x1e')]?_0x371d85[_0x7f60('0x1e')]['where']||null:null})[_0x7f60('0x12')](function(_0x134b79){if(_0x134b79){return _0x134b79[_0x7f60('0x21')](_0x371d85['body'][_0x7f60('0x22')],_[_0x7f60('0x23')](_0x371d85[_0x7f60('0x24')],['ids','id'])||{});}})[_0x7f60('0x25')](function(_0x3e4571){logger['info']('AddTags',_0x371d85);logger['debug'](_0x7f60('0x26'),_0x371d85,JSON['stringify'](_0x3e4571));_0x594206(_0x3e4571);})[_0x7f60('0x1b')](function(_0xff249b){logger['error'](_0x7f60('0x26'),_0xff249b[_0x7f60('0x19')],_0x371d85);_0x43aeba(_this[_0x7f60('0x17')](0x1f4,_0xff249b[_0x7f60('0x19')]));});});}; \ No newline at end of file +var _0x521b=['jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','debug','request\x20sent','stringify','error','code','SmsInteraction,\x20%s,\x20%s','message','info','result','catch','UpdateSmsInteraction','SmsInteraction','update','options','where','attributes','then','find','addTags','body','ids','omit','AddTags','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x521b,0xb3));var _0xb521=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x521b[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb521('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb521('0x1'));var db=require(_0xb521('0x2'))['db'];var utils=require(_0xb521('0x3'));var logger=require(_0xb521('0x4'))(_0xb521('0x5'));var config=require('../../config/environment');var jayson=require(_0xb521('0x6'));var client=jayson['client'][_0xb521('0x7')]({'port':0x232a});config[_0xb521('0x8')]=_[_0xb521('0x9')](config[_0xb521('0x8')],{'host':_0xb521('0xa'),'port':0x18eb});var socket=require(_0xb521('0xb'))(new Redis(config['redis']));require(_0xb521('0xc'))[_0xb521('0xd')](socket);function respondWithRpcPromise(_0xea2ddd,_0x52696a,_0x1ce3ee){return new BPromise(function(_0x43165f,_0x1aaa72){return client['request'](_0xea2ddd,_0x1ce3ee)['then'](function(_0x47b62d){logger['info']('SmsInteraction,\x20%s,\x20%s',_0x52696a,'request\x20sent');logger[_0xb521('0xe')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x52696a,_0xb521('0xf'),JSON[_0xb521('0x10')](_0x47b62d));if(_0x47b62d[_0xb521('0x11')]){if(_0x47b62d[_0xb521('0x11')][_0xb521('0x12')]===0x1f4){logger[_0xb521('0x11')](_0xb521('0x13'),_0x52696a,_0x47b62d[_0xb521('0x11')][_0xb521('0x14')]);return _0x1aaa72(_0x47b62d[_0xb521('0x11')][_0xb521('0x14')]);}logger['error']('SmsInteraction,\x20%s,\x20%s',_0x52696a,_0x47b62d[_0xb521('0x11')]['message']);return _0x43165f(_0x47b62d[_0xb521('0x11')][_0xb521('0x14')]);}else{logger[_0xb521('0x15')](_0xb521('0x13'),_0x52696a,_0xb521('0xf'));_0x43165f(_0x47b62d[_0xb521('0x16')][_0xb521('0x14')]);}})[_0xb521('0x17')](function(_0x188ba4){logger[_0xb521('0x11')](_0xb521('0x13'),_0x52696a,_0x188ba4);_0x1aaa72(_0x188ba4);});});}exports[_0xb521('0x18')]=function(_0x4abaf5){var _0x3d0adf=this;return new Promise(function(_0x4ddf2f,_0x11b1d1){return db[_0xb521('0x19')][_0xb521('0x1a')](_0x4abaf5['body'],{'raw':_0x4abaf5['options']?_0x4abaf5[_0xb521('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4abaf5[_0xb521('0x1b')]?_0x4abaf5['options'][_0xb521('0x1c')]||null:null,'attributes':_0x4abaf5[_0xb521('0x1b')]?_0x4abaf5[_0xb521('0x1b')][_0xb521('0x1d')]||null:null,'limit':_0x4abaf5['options']?_0x4abaf5[_0xb521('0x1b')]['limit']||null:null})[_0xb521('0x1e')](function(_0x4dbc23){logger[_0xb521('0x15')](_0xb521('0x18'),_0x4abaf5);logger[_0xb521('0xe')]('UpdateSmsInteraction',_0x4abaf5,JSON[_0xb521('0x10')](_0x4dbc23));_0x4ddf2f(_0x4dbc23);})[_0xb521('0x17')](function(_0x4d2bed){logger[_0xb521('0x11')](_0xb521('0x18'),_0x4d2bed[_0xb521('0x14')],_0x4abaf5);_0x11b1d1(_0x3d0adf[_0xb521('0x11')](0x1f4,_0x4d2bed[_0xb521('0x14')]));});});};exports['AddTagsToSmsInteraction']=function(_0x25d6fa){return new Promise(function(_0x3b6575,_0x2c6ee0){return db[_0xb521('0x19')][_0xb521('0x1f')]({'where':_0x25d6fa[_0xb521('0x1b')]?_0x25d6fa[_0xb521('0x1b')][_0xb521('0x1c')]||null:null})[_0xb521('0x1e')](function(_0x24ce0f){if(_0x24ce0f){return _0x24ce0f[_0xb521('0x20')](_0x25d6fa[_0xb521('0x21')][_0xb521('0x22')],_[_0xb521('0x23')](_0x25d6fa[_0xb521('0x21')],['ids','id'])||{});}})['spread'](function(_0x4dd297){logger['info'](_0xb521('0x24'),_0x25d6fa);logger['debug']('AddTags',_0x25d6fa,JSON[_0xb521('0x10')](_0x4dd297));_0x3b6575(_0x4dd297);})['catch'](function(_0x739b81){logger[_0xb521('0x11')]('AddTags',_0x739b81[_0xb521('0x14')],_0x25d6fa);_0x2c6ee0(_this[_0xb521('0x11')](0x1f4,_0x739b81[_0xb521('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 4f7cd46..6b88da1 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 _0x0b0e=['smsInteraction:','./smsInteraction.events','remove','emit','removeListener','register'];(function(_0x555cb1,_0x5e2de1){var _0x3259b2=function(_0x2bbb15){while(--_0x2bbb15){_0x555cb1['push'](_0x555cb1['shift']());}};_0x3259b2(++_0x5e2de1);}(_0x0b0e,0x187));var _0xe0b0=function(_0x34ea22,_0x1270b3){_0x34ea22=_0x34ea22-0x0;var _0x1ca470=_0x0b0e[_0x34ea22];return _0x1ca470;};'use strict';var SmsInteractionEvents=require(_0xe0b0('0x0'));var events=['save',_0xe0b0('0x1'),'update'];function createListener(_0x7e5a8a,_0xdf715e){return function(_0x3b5e2b){_0xdf715e[_0xe0b0('0x2')](_0x7e5a8a,_0x3b5e2b);};}function removeListener(_0x28040c,_0x38a058){return function(){SmsInteractionEvents[_0xe0b0('0x3')](_0x28040c,_0x38a058);};}exports[_0xe0b0('0x4')]=function(_0x30e20d){for(var _0x28e40f=0x0,_0x219b1c=events['length'];_0x28e40f<_0x219b1c;_0x28e40f++){var _0x50be7f=events[_0x28e40f];var _0x11effc=createListener(_0xe0b0('0x5')+_0x50be7f,_0x30e20d);SmsInteractionEvents['on'](_0x50be7f,_0x11effc);}}; \ No newline at end of file +var _0xd8b0=['save','emit','./smsInteraction.events'];(function(_0x4955e0,_0x31313c){var _0xecdcf2=function(_0x5866e5){while(--_0x5866e5){_0x4955e0['push'](_0x4955e0['shift']());}};_0xecdcf2(++_0x31313c);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var SmsInteractionEvents=require(_0x0d8b('0x0'));var events=[_0x0d8b('0x1'),'remove','update'];function createListener(_0x4b72b0,_0x3ff8df){return function(_0x5b9b89){_0x3ff8df[_0x0d8b('0x2')](_0x4b72b0,_0x5b9b89);};}function removeListener(_0x364286,_0x8196ed){return function(){SmsInteractionEvents['removeListener'](_0x364286,_0x8196ed);};}exports['register']=function(_0x3f8b6f){for(var _0x227c63=0x0,_0x39f43a=events['length'];_0x227c63<_0x39f43a;_0x227c63++){var _0x413284=events[_0x227c63];var _0x284169=createListener('smsInteraction:'+_0x413284,_0x3f8b6f);SmsInteractionEvents['on'](_0x413284,_0x284169);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 9628996..00e6355 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 _0x49a8=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','isAuthenticated','index','get','describe','/:id','show','tracked','sms','smsmessage:create','create','put','accept','destroy','exports','multer','util'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0x49a8,0x1e1));var _0x849a=function(_0x294ce4,_0x1f0c11){_0x294ce4=_0x294ce4-0x0;var _0x55e21d=_0x49a8[_0x294ce4];return _0x55e21d;};'use strict';var multer=require(_0x849a('0x0'));var util=require(_0x849a('0x1'));var path=require(_0x849a('0x2'));var timeout=require(_0x849a('0x3'));var express=require(_0x849a('0x4'));var router=express['Router']();var auth=require(_0x849a('0x5'));var interaction=require(_0x849a('0x6'));var config=require(_0x849a('0x7'));var controller=require(_0x849a('0x8'));router['get']('/',auth[_0x849a('0x9')](),controller[_0x849a('0xa')]);router[_0x849a('0xb')]('/describe',auth[_0x849a('0x9')](),controller[_0x849a('0xc')]);router[_0x849a('0xb')](_0x849a('0xd'),auth[_0x849a('0x9')](),controller[_0x849a('0xe')]);router['post']('/',auth[_0x849a('0x9')](),interaction[_0x849a('0xf')](_0x849a('0x10'),_0x849a('0x11')),controller[_0x849a('0x12')]);router['post']('/:id/status',controller['status']);router[_0x849a('0x13')](_0x849a('0xd'),auth[_0x849a('0x9')](),controller['update']);router['put']('/:id/accept',auth['isAuthenticated'](),controller[_0x849a('0x14')]);router[_0x849a('0x13')]('/:id/reject',auth[_0x849a('0x9')](),controller['reject']);router['delete'](_0x849a('0xd'),auth[_0x849a('0x9')](),controller[_0x849a('0x15')]);module[_0x849a('0x16')]=router; \ No newline at end of file +var _0x7050=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','index','isAuthenticated','/:id','post','tracked','sms','create','/:id/status','put','update','/:id/accept','/:id/reject','reject','delete','destroy','util','path'];(function(_0x46b7a1,_0x3b6247){var _0x478fa9=function(_0x3b856b){while(--_0x3b856b){_0x46b7a1['push'](_0x46b7a1['shift']());}};_0x478fa9(++_0x3b6247);}(_0x7050,0x166));var _0x0705=function(_0x145b3c,_0x31ea4a){_0x145b3c=_0x145b3c-0x0;var _0x1b6e36=_0x7050[_0x145b3c];return _0x1b6e36;};'use strict';var multer=require('multer');var util=require(_0x0705('0x0'));var path=require(_0x0705('0x1'));var timeout=require(_0x0705('0x2'));var express=require(_0x0705('0x3'));var router=express['Router']();var auth=require(_0x0705('0x4'));var interaction=require(_0x0705('0x5'));var config=require(_0x0705('0x6'));var controller=require(_0x0705('0x7'));router[_0x0705('0x8')]('/',auth['isAuthenticated'](),controller[_0x0705('0x9')]);router[_0x0705('0x8')]('/describe',auth[_0x0705('0xa')](),controller['describe']);router[_0x0705('0x8')](_0x0705('0xb'),auth[_0x0705('0xa')](),controller['show']);router[_0x0705('0xc')]('/',auth[_0x0705('0xa')](),interaction[_0x0705('0xd')](_0x0705('0xe'),'smsmessage:create'),controller[_0x0705('0xf')]);router['post'](_0x0705('0x10'),controller['status']);router[_0x0705('0x11')](_0x0705('0xb'),auth[_0x0705('0xa')](),controller[_0x0705('0x12')]);router[_0x0705('0x11')](_0x0705('0x13'),auth[_0x0705('0xa')](),controller['accept']);router['put'](_0x0705('0x14'),auth[_0x0705('0xa')](),controller[_0x0705('0x15')]);router[_0x0705('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x0705('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 5ec3c98..0aad10a 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 _0x4205=['medium','BOOLEAN','ENUM','out','STRING','DATE','sequelize','TEXT'];(function(_0x2a334b,_0x10e5b2){var _0xb7ac2b=function(_0x23415e){while(--_0x23415e){_0x2a334b['push'](_0x2a334b['shift']());}};_0xb7ac2b(++_0x10e5b2);}(_0x4205,0x1b6));var _0x5420=function(_0x275d76,_0x44d023){_0x275d76=_0x275d76-0x0;var _0x4f3cb2=_0x4205[_0x275d76];return _0x4f3cb2;};'use strict';var Sequelize=require(_0x5420('0x0'));module['exports']={'body':{'type':Sequelize[_0x5420('0x1')](_0x5420('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x5420('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x5420('0x4')]('in',_0x5420('0x5')),'defaultValue':_0x5420('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x5420('0x6')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x5420('0x7')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xf6c1=['medium','ENUM','out','STRING','BOOLEAN','sequelize'];(function(_0x38a97f,_0x49776d){var _0x408883=function(_0x5d424b){while(--_0x5d424b){_0x38a97f['push'](_0x38a97f['shift']());}};_0x408883(++_0x49776d);}(_0xf6c1,0x149));var _0x1f6c=function(_0x40e929,_0x2c4bed){_0x40e929=_0x40e929-0x0;var _0x3ac393=_0xf6c1[_0x40e929];return _0x3ac393;};'use strict';var Sequelize=require(_0x1f6c('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x1f6c('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x1f6c('0x2')]('in',_0x1f6c('0x3')),'defaultValue':_0x1f6c('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0x1f6c('0x4')](0xbe)},'phone':{'type':Sequelize[_0x1f6c('0x4')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x1f6c('0x5')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 15a60b7..b1b8f16 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 _0x3a29=['Content-Range','apply','reject','save','stack','name','send','index','SmsMessage','rawAttributes','fieldName','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','update','destroy','describe','sms-interactions','accept','sms','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','SmsInteraction','SmsInteractionId','format','get','role','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','EventManager','acceptmessage','agent','interaction','null','RejectMessage','rejectMessage','event','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','MessageSid','twilio','plivo','MessageUUID','messageId','indexOf','delivered','Status','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','infobip','results','groupName','DELIVERED','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','test','Sequelize','ValidationError','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','status','end','json','count','offset'];(function(_0x3223bf,_0x256456){var _0x194002=function(_0x59dacc){while(--_0x59dacc){_0x3223bf['push'](_0x3223bf['shift']());}};_0x194002(++_0x256456);}(_0x3a29,0xe3));var _0x93a2=function(_0x5efed8,_0x139363){_0x5efed8=_0x5efed8-0x0;var _0x2da65b=_0x3a29[_0x5efed8];return _0x2da65b;};'use strict';var pdf=require(_0x93a2('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x93a2('0x1'));var zipdir=require(_0x93a2('0x2'));var jsonpatch=require(_0x93a2('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x93a2('0x4'));var Mustache=require('mustache');var util=require(_0x93a2('0x5'));var path=require(_0x93a2('0x6'));var sox=require(_0x93a2('0x7'));var csv=require('to-csv');var ejs=require(_0x93a2('0x8'));var fs=require('fs');var _=require(_0x93a2('0x9'));var squel=require(_0x93a2('0xa'));var crypto=require(_0x93a2('0xb'));var jsforce=require(_0x93a2('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x93a2('0xd'));var querystring=require(_0x93a2('0xe'));var Papa=require(_0x93a2('0xf'));var Redis=require(_0x93a2('0x10'));var authService=require(_0x93a2('0x11'));var qs=require(_0x93a2('0x12'));var as=require(_0x93a2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x93a2('0x14'))(_0x93a2('0x15'));var utils=require('../../config/utils');var config=require(_0x93a2('0x16'));var db=require(_0x93a2('0x17'))['db'];config[_0x93a2('0x18')]=_[_0x93a2('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x93a2('0x1a'))(new Redis(config['redis']));require('./smsMessage.socket')[_0x93a2('0x1b')](socket);var jayson=require(_0x93a2('0x1c'));var client=jayson[_0x93a2('0x1d')][_0x93a2('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x93a2('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x3e92ab,_0x270991,_0x408606){if(_0x408606){var _0x42b931=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x42b931[_0x93a2('0x1f')](_0x270991)){return _0x3e92ab;}else{throw new db[(_0x93a2('0x20'))][(_0x93a2('0x21'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x3e92ab;}}function respondWithRpcPromise(_0x13602c,_0x34e4c7,_0x2d6964,_0x2125c0){return new BPromise(function(_0x58bfe3,_0x525f17){var _0x374bf6=_0x2125c0||client;return _0x374bf6['request'](_0x13602c,_0x2d6964)[_0x93a2('0x22')](function(_0x192b8d){logger['info'](_0x93a2('0x23'),_0x34e4c7,_0x93a2('0x24'));logger[_0x93a2('0x25')](_0x93a2('0x26'),_0x34e4c7,_0x93a2('0x24'),JSON[_0x93a2('0x27')](_0x192b8d));if(_0x192b8d[_0x93a2('0x28')]){if(_0x192b8d[_0x93a2('0x28')][_0x93a2('0x29')]===0x1f4){logger[_0x93a2('0x28')](_0x93a2('0x23'),_0x34e4c7,_0x192b8d[_0x93a2('0x28')][_0x93a2('0x2a')]);return _0x525f17(_0x192b8d[_0x93a2('0x28')][_0x93a2('0x2a')]);}logger[_0x93a2('0x28')](_0x93a2('0x23'),_0x34e4c7,_0x192b8d[_0x93a2('0x28')][_0x93a2('0x2a')]);return _0x58bfe3(_0x192b8d[_0x93a2('0x28')][_0x93a2('0x2a')]);}else{logger[_0x93a2('0x2b')](_0x93a2('0x23'),_0x34e4c7,_0x93a2('0x24'));_0x58bfe3(_0x192b8d['result'][_0x93a2('0x2a')]);}})['catch'](function(_0x1ef0e9){logger[_0x93a2('0x28')](_0x93a2('0x23'),_0x34e4c7,_0x1ef0e9);_0x525f17(_0x1ef0e9);});});}function respondWithStatusCode(_0x475aef,_0x36e0db){_0x36e0db=_0x36e0db||0xcc;return function(_0xde1e04){if(_0xde1e04){return _0x475aef['sendStatus'](_0x36e0db);}return _0x475aef[_0x93a2('0x2c')](_0x36e0db)[_0x93a2('0x2d')]();};}function respondWithResult(_0x519d6d,_0x337a81){_0x337a81=_0x337a81||0xc8;return function(_0x48f0e4){if(_0x48f0e4){return _0x519d6d[_0x93a2('0x2c')](_0x337a81)[_0x93a2('0x2e')](_0x48f0e4);}};}function respondWithFilteredResult(_0x1403ed,_0x33f9c1){return function(_0x4ab3a7){if(_0x4ab3a7){var _0x4af0f2=_0x4ab3a7[_0x93a2('0x2f')],_0x85a1ea=_0x33f9c1['offset'],_0x69c0d1=_0x33f9c1[_0x93a2('0x30')]+_0x33f9c1['limit'],_0x33f694;if(_0x69c0d1>=_0x4af0f2){_0x69c0d1=_0x4af0f2;_0x33f694=0xc8;}else{_0x33f694=0xce;}_0x1403ed[_0x93a2('0x2c')](_0x33f694);return _0x1403ed['set'](_0x93a2('0x31'),_0x85a1ea+'-'+_0x69c0d1+'/'+_0x4af0f2)[_0x93a2('0x2e')](_0x4ab3a7);}return null;};}function patchUpdates(_0xde7d6e){return function(_0x5ba7aa){try{jsonpatch[_0x93a2('0x32')](_0x5ba7aa,_0xde7d6e,!![]);}catch(_0x51316d){return BPromise[_0x93a2('0x33')](_0x51316d);}return _0x5ba7aa[_0x93a2('0x34')]();};}function saveUpdates(_0x16be61,_0x538626){return function(_0x25b9be){if(_0x25b9be){return _0x25b9be['update'](_0x16be61)[_0x93a2('0x22')](function(_0x2fdabb){return _0x2fdabb;});}return null;};}function removeEntity(_0x225a9d,_0x59978f){return function(_0x97016b){if(_0x97016b){return _0x97016b['destroy']()[_0x93a2('0x22')](function(){_0x225a9d['status'](0xcc)[_0x93a2('0x2d')]();});}};}function handleEntityNotFound(_0x80fa12,_0x24344b){return function(_0x43a7de){if(!_0x43a7de){_0x80fa12['sendStatus'](0x194);}return _0x43a7de;};}function handleError(_0x3a10da,_0x13ef6b){_0x13ef6b=_0x13ef6b||0x1f4;return function(_0x196ba2){logger[_0x93a2('0x28')](_0x196ba2[_0x93a2('0x35')]);if(_0x196ba2[_0x93a2('0x36')]){delete _0x196ba2['name'];}_0x3a10da[_0x93a2('0x2c')](_0x13ef6b)[_0x93a2('0x37')](_0x196ba2);};}exports[_0x93a2('0x38')]=function(_0x39129f,_0x4ee721){var _0x4fc6f0={},_0x5a7764={},_0x2ec43b={'count':0x0,'rows':[]};var _0xa5d214=_['map'](db[_0x93a2('0x39')][_0x93a2('0x3a')],function(_0x4eff92){return{'name':_0x4eff92[_0x93a2('0x3b')],'type':_0x4eff92['type']['key']};});_0x5a7764[_0x93a2('0x3c')]=_[_0x93a2('0x3d')](_0xa5d214,_0x93a2('0x36'));_0x5a7764[_0x93a2('0x3e')]=_[_0x93a2('0x3f')](_0x39129f[_0x93a2('0x3e')]);_0x5a7764['filters']=_[_0x93a2('0x40')](_0x5a7764[_0x93a2('0x3c')],_0x5a7764[_0x93a2('0x3e')]);_0x4fc6f0['attributes']=_[_0x93a2('0x40')](_0x5a7764[_0x93a2('0x3c')],qs[_0x93a2('0x41')](_0x39129f[_0x93a2('0x3e')][_0x93a2('0x41')]));_0x4fc6f0['attributes']=_0x4fc6f0[_0x93a2('0x42')][_0x93a2('0x43')]?_0x4fc6f0[_0x93a2('0x42')]:_0x5a7764[_0x93a2('0x3c')];if(!_0x39129f[_0x93a2('0x3e')][_0x93a2('0x44')](_0x93a2('0x45'))){_0x4fc6f0['limit']=qs[_0x93a2('0x46')](_0x39129f[_0x93a2('0x3e')][_0x93a2('0x46')]);_0x4fc6f0[_0x93a2('0x30')]=qs[_0x93a2('0x30')](_0x39129f['query']['offset']);}_0x4fc6f0['order']=qs[_0x93a2('0x47')](_0x39129f['query'][_0x93a2('0x47')]);_0x4fc6f0[_0x93a2('0x48')]=qs[_0x93a2('0x49')](_[_0x93a2('0x4a')](_0x39129f[_0x93a2('0x3e')],_0x5a7764[_0x93a2('0x49')]));if(_0x39129f['query'][_0x93a2('0x4b')]){_0x4fc6f0[_0x93a2('0x48')]=_[_0x93a2('0x4c')](_0x4fc6f0[_0x93a2('0x48')],{'$or':_[_0x93a2('0x3d')](_0xa5d214,function(_0x4743cb){if(_0x4743cb[_0x93a2('0x4d')]!==_0x93a2('0x4e')){var _0x1dfd63={};_0x1dfd63[_0x4743cb['name']]={'$like':'%'+_0x39129f[_0x93a2('0x3e')][_0x93a2('0x4b')]+'%'};return _0x1dfd63;}})});}_0x4fc6f0=_[_0x93a2('0x4c')]({},_0x4fc6f0,_0x39129f[_0x93a2('0x4f')]);var _0x5b3ead={'where':_0x4fc6f0[_0x93a2('0x48')]};return db[_0x93a2('0x39')][_0x93a2('0x2f')](_0x5b3ead)['then'](function(_0x287461){_0x2ec43b[_0x93a2('0x2f')]=_0x287461;if(_0x39129f[_0x93a2('0x3e')][_0x93a2('0x50')]){_0x4fc6f0['include']=[{'all':!![]}];}return db[_0x93a2('0x39')][_0x93a2('0x51')](_0x4fc6f0);})['then'](function(_0x2cb2b5){_0x2ec43b[_0x93a2('0x52')]=_0x2cb2b5;return _0x2ec43b;})[_0x93a2('0x22')](respondWithFilteredResult(_0x4ee721,_0x4fc6f0))[_0x93a2('0x53')](handleError(_0x4ee721,null));};exports[_0x93a2('0x54')]=function(_0x1f218f,_0x417904){var _0x49f1d5={'raw':!![],'where':{'id':_0x1f218f[_0x93a2('0x55')]['id']}},_0x3d166c={};_0x3d166c[_0x93a2('0x3c')]=_[_0x93a2('0x3f')](db[_0x93a2('0x39')][_0x93a2('0x3a')]);_0x3d166c['query']=_[_0x93a2('0x3f')](_0x1f218f[_0x93a2('0x3e')]);_0x3d166c[_0x93a2('0x49')]=_[_0x93a2('0x40')](_0x3d166c[_0x93a2('0x3c')],_0x3d166c['query']);_0x49f1d5[_0x93a2('0x42')]=_[_0x93a2('0x40')](_0x3d166c[_0x93a2('0x3c')],qs[_0x93a2('0x41')](_0x1f218f[_0x93a2('0x3e')]['fields']));_0x49f1d5[_0x93a2('0x42')]=_0x49f1d5[_0x93a2('0x42')]['length']?_0x49f1d5[_0x93a2('0x42')]:_0x3d166c[_0x93a2('0x3c')];if(_0x1f218f[_0x93a2('0x3e')][_0x93a2('0x50')]){_0x49f1d5[_0x93a2('0x56')]=[{'all':!![]}];}_0x49f1d5=_[_0x93a2('0x4c')]({},_0x49f1d5,_0x1f218f[_0x93a2('0x4f')]);return db[_0x93a2('0x39')][_0x93a2('0x57')](_0x49f1d5)[_0x93a2('0x22')](handleEntityNotFound(_0x417904,null))[_0x93a2('0x22')](respondWithResult(_0x417904,null))[_0x93a2('0x53')](handleError(_0x417904,null));};exports[_0x93a2('0x58')]=function(_0x32cf55,_0x4ba79a){return db[_0x93a2('0x39')][_0x93a2('0x58')](_0x32cf55[_0x93a2('0x59')],{})[_0x93a2('0x22')](respondWithResult(_0x4ba79a,0xc9))[_0x93a2('0x53')](handleError(_0x4ba79a,null));};exports[_0x93a2('0x5a')]=function(_0x55eb67,_0x2d39f6){if(_0x55eb67['body']['id']){delete _0x55eb67[_0x93a2('0x59')]['id'];}return db[_0x93a2('0x39')]['find']({'where':{'id':_0x55eb67[_0x93a2('0x55')]['id']}})['then'](handleEntityNotFound(_0x2d39f6,null))[_0x93a2('0x22')](saveUpdates(_0x55eb67[_0x93a2('0x59')],null))['then'](respondWithResult(_0x2d39f6,null))['catch'](handleError(_0x2d39f6,null));};exports[_0x93a2('0x5b')]=function(_0x5ad3ee,_0x22592e){return db[_0x93a2('0x39')][_0x93a2('0x57')]({'where':{'id':_0x5ad3ee[_0x93a2('0x55')]['id']}})['then'](handleEntityNotFound(_0x22592e,null))[_0x93a2('0x22')](removeEntity(_0x22592e,null))[_0x93a2('0x53')](handleError(_0x22592e,null));};exports['describe']=function(_0x532c85,_0x46f3fa){return db[_0x93a2('0x39')][_0x93a2('0x5c')]()[_0x93a2('0x22')](respondWithResult(_0x46f3fa,null))[_0x93a2('0x53')](handleError(_0x46f3fa,null));};var interaction_log=require('../../config/logger')(_0x93a2('0x5d'));exports[_0x93a2('0x5e')]=function(_0x43a00e,_0x22dbf9,_0x84cb88){var _0x4792e0={'channel':_0x93a2('0x5f')};if(_0x43a00e['body']['id']){delete _0x43a00e[_0x93a2('0x59')]['id'];}_0x43a00e['body'][_0x93a2('0x60')]=!![];_0x43a00e[_0x93a2('0x59')]['readAt']=moment()['format'](_0x93a2('0x61'));_0x43a00e[_0x93a2('0x59')]['UserId']=_0x43a00e[_0x93a2('0x59')][_0x93a2('0x62')]||_0x43a00e[_0x93a2('0x63')]['id'];return db['SmsMessage'][_0x93a2('0x57')]({'where':{'id':_0x43a00e[_0x93a2('0x55')]['id'],'UserId':null},'include':[{'model':db[_0x93a2('0x64')],'as':'Contact'}]})[_0x93a2('0x22')](handleEntityNotFound(_0x22dbf9,null))['then'](saveUpdates(_0x43a00e[_0x93a2('0x59')],null))[_0x93a2('0x22')](function(_0x23e66d){if(_0x23e66d){_0x4792e0['message']=_0x23e66d['get']({'plain':!![]});return db[_0x93a2('0x65')]['find']({'where':{'id':_0x23e66d[_0x93a2('0x66')]}});}return null;})[_0x93a2('0x22')](handleEntityNotFound(_0x22dbf9,null))[_0x93a2('0x22')](function(_0x5d4675){if(_0x5d4675){return _0x5d4675[_0x93a2('0x5a')]({'UserId':_0x43a00e[_0x93a2('0x59')][_0x93a2('0x62')],'read1stAt':_['isNil'](_0x5d4675['read1stAt'])?moment()[_0x93a2('0x67')](_0x93a2('0x61')):undefined});}return null;})['then'](function(_0x53ef98){if(_0x53ef98){_0x4792e0['interaction']=_0x53ef98[_0x93a2('0x68')]({'plain':!![]});interaction_log[_0x93a2('0x2b')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x43a00e[_0x93a2('0x63')]['id'],_0x43a00e[_0x93a2('0x63')]['name'],_0x43a00e[_0x93a2('0x63')][_0x93a2('0x69')],_0x4792e0['interaction']['id'],_0x43a00e[_0x93a2('0x59')]?JSON[_0x93a2('0x27')](_0x43a00e[_0x93a2('0x59')]):'null');return respondWithRpcPromise(_0x93a2('0x6a'),_0x93a2('0x6b'),_0x4792e0);}return null;})[_0x93a2('0x22')](function(_0x35ec65){if(_0x35ec65){if(_0x43a00e[_0x93a2('0x59')][_0x93a2('0x6c')]){_0x4792e0[_0x93a2('0x2a')][_0x93a2('0x6d')]=util[_0x93a2('0x67')](_0x93a2('0x6e'),_0x43a00e['user']['name']);_0x4792e0[_0x93a2('0x2a')][_0x93a2('0x6f')]=_0x4792e0[_0x93a2('0x6f')];_0x4792e0[_0x93a2('0x2a')]['event']=_0x93a2('0x5e');return respondWithRpcPromise(_0x93a2('0x70'),_0x93a2('0x70'),{'event':_0x93a2('0x71'),'message':_0x4792e0[_0x93a2('0x2a')]},client9002)[_0x93a2('0x22')](function(){return _0x4792e0;});}return _0x4792e0;}return null;})['then'](respondWithResult(_0x22dbf9,null))[_0x93a2('0x53')](handleError(_0x22dbf9,null));};var interaction_log=require(_0x93a2('0x14'))(_0x93a2('0x5d'));exports[_0x93a2('0x33')]=function(_0x888672,_0x52ee3e,_0x46f5d1){var _0x4d47a0={'agent':{},'channel':_0x93a2('0x5f')};if(_0x888672['body']['id']){delete _0x888672[_0x93a2('0x59')]['id'];}_0x888672[_0x93a2('0x59')][_0x93a2('0x62')]=_0x888672[_0x93a2('0x59')][_0x93a2('0x62')]||_0x888672['user']['id'];_0x4d47a0[_0x93a2('0x72')]['id']=_0x888672[_0x93a2('0x59')][_0x93a2('0x62')];return db[_0x93a2('0x39')]['find']({'where':{'id':_0x888672['params']['id'],'UserId':null}})[_0x93a2('0x22')](handleEntityNotFound(_0x52ee3e,null))['then'](function(_0x2c4399){if(_0x2c4399){_0x4d47a0[_0x93a2('0x2a')]=_0x2c4399[_0x93a2('0x68')]({'plain':!![]});return db[_0x93a2('0x65')]['find']({'where':{'id':_0x2c4399[_0x93a2('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x52ee3e,null))[_0x93a2('0x22')](function(_0x5b1f38){if(_0x5b1f38){_0x4d47a0[_0x93a2('0x73')]=_0x5b1f38[_0x93a2('0x68')]({'plain':!![]});interaction_log[_0x93a2('0x2b')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x888672['user']['id'],_0x888672[_0x93a2('0x63')]['name'],_0x888672[_0x93a2('0x63')][_0x93a2('0x69')],_0x4d47a0['interaction']['id'],_0x888672[_0x93a2('0x59')]?JSON[_0x93a2('0x27')](_0x888672[_0x93a2('0x59')]):_0x93a2('0x74'));return respondWithRpcPromise(_0x93a2('0x75'),_0x93a2('0x76'),_0x4d47a0);}return null;})['then'](function(_0x870ca1){if(_0x870ca1){_0x870ca1['message']['interface']=util[_0x93a2('0x67')]('SIP/%s',_0x888672[_0x93a2('0x63')][_0x93a2('0x36')]);_0x870ca1[_0x93a2('0x2a')][_0x93a2('0x6f')]=_0x4d47a0[_0x93a2('0x6f')];_0x870ca1[_0x93a2('0x2a')][_0x93a2('0x77')]=_0x93a2('0x33');respondWithRpcPromise(_0x93a2('0x70'),_0x93a2('0x70'),{'event':_0x93a2('0x78'),'message':_0x870ca1[_0x93a2('0x2a')]},client9002);return _0x4d47a0;}return null;})['then'](respondWithResult(_0x52ee3e,null))['catch'](handleError(_0x52ee3e,null));};exports[_0x93a2('0x2c')]=function(_0x455239,_0x437c54,_0x3d39eb){if(_0x455239[_0x93a2('0x59')]['id']){delete _0x455239[_0x93a2('0x59')]['id'];}var _0x4e9c93;return db[_0x93a2('0x39')][_0x93a2('0x57')]({'where':{'id':_0x455239['params']['id']}})['then'](handleEntityNotFound(_0x437c54,null))[_0x93a2('0x22')](function(_0x944df5){if(_0x944df5){_0x4e9c93=_0x944df5;return db[_0x93a2('0x79')]['find']({'where':{'id':_0x944df5[_0x93a2('0x7a')]}});}})[_0x93a2('0x22')](handleEntityNotFound(_0x437c54,null))[_0x93a2('0x22')](function(_0x196679){if(_0x196679){logger[_0x93a2('0x25')](_0x93a2('0x26'),_0x93a2('0x2c'),_0x93a2('0x7b'),_0x196679['type'],util['inspect'](_0x455239['body'],{'showHidden':![],'depth':null}));switch(_0x196679[_0x93a2('0x4d')]){case'twilio':if(_0x455239[_0x93a2('0x59')]['MessageSid']&&_0x455239['body'][_0x93a2('0x7c')]===_0x4e9c93['messageId']){return _0x4e9c93[_0x93a2('0x5a')]({'read':!![]});}else{logger[_0x93a2('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x93a2('0x2c'),_0x93a2('0x7d'),util['inspect'](_0x455239['body'],{'showHidden':![],'depth':null}));}break;case _0x93a2('0x7e'):if(_0x455239[_0x93a2('0x59')][_0x93a2('0x7f')]&&_0x455239['body'][_0x93a2('0x7f')]===_0x4e9c93[_0x93a2('0x80')]&&_[_0x93a2('0x81')](['sent',_0x93a2('0x82')],_0x455239[_0x93a2('0x59')][_0x93a2('0x83')])>=0x0){return _0x4e9c93[_0x93a2('0x5a')]({'read':!![]});}else{logger['error'](_0x93a2('0x84'),_0x93a2('0x2c'),'plivio',util[_0x93a2('0x85')](_0x455239['body'],{'showHidden':![],'depth':null}));}break;case _0x93a2('0x86'):var _0x38125d=_0x455239[_0x93a2('0x59')][_0x93a2('0x87')][0x0];if(_0x38125d[_0x93a2('0x2c')][_0x93a2('0x88')]===_0x93a2('0x89')){return _0x4e9c93['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x93a2('0x2c'),_0x93a2('0x86'),util[_0x93a2('0x85')](_0x455239['body'],{'showHidden':![],'depth':null}));}break;}return _0x4e9c93;}})[_0x93a2('0x22')](respondWithResult(_0x437c54,null))[_0x93a2('0x53')](handleError(_0x437c54,null));}; \ No newline at end of file +var _0x7c5a=['agent','null','RejectMessage','interface','SIP/%s','rejectmessage','SmsAccountId','debug','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','Status','plivio','results','groupName','DELIVERED','infobip','html-pdf','fast-json-patch','request-promise','moment','bluebird','mustache','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./smsMessage.socket','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SmsMessage,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','stack','name','send','index','map','SmsMessage','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','includeAll','include','findAll','rows','show','params','rawAttributes','options','find','create','body','describe','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction','role','AcceptMessage','manual','channel','event','EventManager','reject'];(function(_0x204ae6,_0x5b7b24){var _0x222f30=function(_0x4a6305){while(--_0x4a6305){_0x204ae6['push'](_0x204ae6['shift']());}};_0x222f30(++_0x5b7b24);}(_0x7c5a,0xa3));var _0xa7c5=function(_0x5cf754,_0x5ace1d){_0x5cf754=_0x5cf754-0x0;var _0x33a30c=_0x7c5a[_0x5cf754];return _0x33a30c;};'use strict';var pdf=require(_0xa7c5('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa7c5('0x1'));var rp=require(_0xa7c5('0x2'));var moment=require(_0xa7c5('0x3'));var BPromise=require(_0xa7c5('0x4'));var Mustache=require(_0xa7c5('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa7c5('0x6'));var fs=require('fs');var _=require(_0xa7c5('0x7'));var squel=require(_0xa7c5('0x8'));var crypto=require('crypto');var jsforce=require(_0xa7c5('0x9'));var deskjs=require(_0xa7c5('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa7c5('0xb'));var Redis=require(_0xa7c5('0xc'));var authService=require(_0xa7c5('0xd'));var qs=require(_0xa7c5('0xe'));var as=require(_0xa7c5('0xf'));var hardwareService=require(_0xa7c5('0x10'));var logger=require(_0xa7c5('0x11'))(_0xa7c5('0x12'));var utils=require(_0xa7c5('0x13'));var config=require(_0xa7c5('0x14'));var db=require(_0xa7c5('0x15'))['db'];config[_0xa7c5('0x16')]=_[_0xa7c5('0x17')](config[_0xa7c5('0x16')],{'host':_0xa7c5('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa7c5('0x16')]));require(_0xa7c5('0x19'))['register'](socket);var jayson=require(_0xa7c5('0x1a'));var client=jayson[_0xa7c5('0x1b')][_0xa7c5('0x1c')]({'port':0x232c});var client9002=jayson[_0xa7c5('0x1b')][_0xa7c5('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x3f97c5,_0x76176f,_0x32ef28){if(_0x32ef28){var _0x1e1c07=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1e1c07['test'](_0x76176f)){return _0x3f97c5;}else{throw new db[(_0xa7c5('0x1d'))][(_0xa7c5('0x1e'))](_0xa7c5('0x1f'));}}else{return _0x3f97c5;}}function respondWithRpcPromise(_0x442d52,_0x329f16,_0x4c1b6a,_0x37a39c){return new BPromise(function(_0xe7f2c0,_0x25cbb9){var _0x4a98e6=_0x37a39c||client;return _0x4a98e6[_0xa7c5('0x20')](_0x442d52,_0x4c1b6a)[_0xa7c5('0x21')](function(_0x61d006){logger[_0xa7c5('0x22')](_0xa7c5('0x23'),_0x329f16,'request\x20sent');logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x329f16,'request\x20sent',JSON[_0xa7c5('0x24')](_0x61d006));if(_0x61d006[_0xa7c5('0x25')]){if(_0x61d006[_0xa7c5('0x25')]['code']===0x1f4){logger[_0xa7c5('0x25')](_0xa7c5('0x23'),_0x329f16,_0x61d006['error'][_0xa7c5('0x26')]);return _0x25cbb9(_0x61d006['error'][_0xa7c5('0x26')]);}logger[_0xa7c5('0x25')](_0xa7c5('0x23'),_0x329f16,_0x61d006[_0xa7c5('0x25')]['message']);return _0xe7f2c0(_0x61d006[_0xa7c5('0x25')]['message']);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x329f16,_0xa7c5('0x27'));_0xe7f2c0(_0x61d006[_0xa7c5('0x28')][_0xa7c5('0x26')]);}})[_0xa7c5('0x29')](function(_0x429348){logger[_0xa7c5('0x25')](_0xa7c5('0x23'),_0x329f16,_0x429348);_0x25cbb9(_0x429348);});});}function respondWithStatusCode(_0x38bb5d,_0x54503a){_0x54503a=_0x54503a||0xcc;return function(_0x4c6ca0){if(_0x4c6ca0){return _0x38bb5d[_0xa7c5('0x2a')](_0x54503a);}return _0x38bb5d[_0xa7c5('0x2b')](_0x54503a)[_0xa7c5('0x2c')]();};}function respondWithResult(_0x2c196a,_0x530566){_0x530566=_0x530566||0xc8;return function(_0x582827){if(_0x582827){return _0x2c196a[_0xa7c5('0x2b')](_0x530566)[_0xa7c5('0x2d')](_0x582827);}};}function respondWithFilteredResult(_0x2d3a69,_0x268520){return function(_0x585506){if(_0x585506){var _0x3bbcfb=_0x585506[_0xa7c5('0x2e')],_0x5dd191=_0x268520['offset'],_0x41b606=_0x268520[_0xa7c5('0x2f')]+_0x268520[_0xa7c5('0x30')],_0x1480c5;if(_0x41b606>=_0x3bbcfb){_0x41b606=_0x3bbcfb;_0x1480c5=0xc8;}else{_0x1480c5=0xce;}_0x2d3a69[_0xa7c5('0x2b')](_0x1480c5);return _0x2d3a69[_0xa7c5('0x31')](_0xa7c5('0x32'),_0x5dd191+'-'+_0x41b606+'/'+_0x3bbcfb)[_0xa7c5('0x2d')](_0x585506);}return null;};}function patchUpdates(_0x8f65ab){return function(_0x592fa7){try{jsonpatch[_0xa7c5('0x33')](_0x592fa7,_0x8f65ab,!![]);}catch(_0x4829a2){return BPromise['reject'](_0x4829a2);}return _0x592fa7[_0xa7c5('0x34')]();};}function saveUpdates(_0x566e62,_0x16ab74){return function(_0x21e9f4){if(_0x21e9f4){return _0x21e9f4[_0xa7c5('0x35')](_0x566e62)[_0xa7c5('0x21')](function(_0x56ec88){return _0x56ec88;});}return null;};}function removeEntity(_0x1a5679,_0x2c695d){return function(_0x30c5d5){if(_0x30c5d5){return _0x30c5d5[_0xa7c5('0x36')]()[_0xa7c5('0x21')](function(){_0x1a5679['status'](0xcc)[_0xa7c5('0x2c')]();});}};}function handleEntityNotFound(_0x2e225e,_0x273b4e){return function(_0x4d6630){if(!_0x4d6630){_0x2e225e[_0xa7c5('0x2a')](0x194);}return _0x4d6630;};}function handleError(_0x57f928,_0x252238){_0x252238=_0x252238||0x1f4;return function(_0x4edbaf){logger[_0xa7c5('0x25')](_0x4edbaf[_0xa7c5('0x37')]);if(_0x4edbaf[_0xa7c5('0x38')]){delete _0x4edbaf['name'];}_0x57f928['status'](_0x252238)[_0xa7c5('0x39')](_0x4edbaf);};}exports[_0xa7c5('0x3a')]=function(_0x3b5ef3,_0x5dc1f7){var _0x227fd0={},_0x208818={},_0x4a59fd={'count':0x0,'rows':[]};var _0x4870ee=_[_0xa7c5('0x3b')](db[_0xa7c5('0x3c')]['rawAttributes'],function(_0x13914f){return{'name':_0x13914f[_0xa7c5('0x3d')],'type':_0x13914f['type'][_0xa7c5('0x3e')]};});_0x208818[_0xa7c5('0x3f')]=_[_0xa7c5('0x3b')](_0x4870ee,_0xa7c5('0x38'));_0x208818[_0xa7c5('0x40')]=_[_0xa7c5('0x41')](_0x3b5ef3[_0xa7c5('0x40')]);_0x208818['filters']=_[_0xa7c5('0x42')](_0x208818['model'],_0x208818[_0xa7c5('0x40')]);_0x227fd0[_0xa7c5('0x43')]=_['intersection'](_0x208818[_0xa7c5('0x3f')],qs[_0xa7c5('0x44')](_0x3b5ef3['query'][_0xa7c5('0x44')]));_0x227fd0[_0xa7c5('0x43')]=_0x227fd0[_0xa7c5('0x43')][_0xa7c5('0x45')]?_0x227fd0['attributes']:_0x208818[_0xa7c5('0x3f')];if(!_0x3b5ef3[_0xa7c5('0x40')][_0xa7c5('0x46')](_0xa7c5('0x47'))){_0x227fd0[_0xa7c5('0x30')]=qs[_0xa7c5('0x30')](_0x3b5ef3[_0xa7c5('0x40')]['limit']);_0x227fd0[_0xa7c5('0x2f')]=qs['offset'](_0x3b5ef3[_0xa7c5('0x40')][_0xa7c5('0x2f')]);}_0x227fd0[_0xa7c5('0x48')]=qs['sort'](_0x3b5ef3[_0xa7c5('0x40')][_0xa7c5('0x49')]);_0x227fd0[_0xa7c5('0x4a')]=qs[_0xa7c5('0x4b')](_[_0xa7c5('0x4c')](_0x3b5ef3[_0xa7c5('0x40')],_0x208818[_0xa7c5('0x4b')]));if(_0x3b5ef3['query'][_0xa7c5('0x4d')]){_0x227fd0['where']=_[_0xa7c5('0x4e')](_0x227fd0['where'],{'$or':_[_0xa7c5('0x3b')](_0x4870ee,function(_0x2c2504){if(_0x2c2504[_0xa7c5('0x4f')]!=='VIRTUAL'){var _0xa89e4a={};_0xa89e4a[_0x2c2504[_0xa7c5('0x38')]]={'$like':'%'+_0x3b5ef3[_0xa7c5('0x40')]['filter']+'%'};return _0xa89e4a;}})});}_0x227fd0=_[_0xa7c5('0x4e')]({},_0x227fd0,_0x3b5ef3['options']);var _0x1271ea={'where':_0x227fd0[_0xa7c5('0x4a')]};return db[_0xa7c5('0x3c')]['count'](_0x1271ea)[_0xa7c5('0x21')](function(_0x4bb42b){_0x4a59fd[_0xa7c5('0x2e')]=_0x4bb42b;if(_0x3b5ef3[_0xa7c5('0x40')][_0xa7c5('0x50')]){_0x227fd0[_0xa7c5('0x51')]=[{'all':!![]}];}return db[_0xa7c5('0x3c')][_0xa7c5('0x52')](_0x227fd0);})[_0xa7c5('0x21')](function(_0x2ba0d6){_0x4a59fd[_0xa7c5('0x53')]=_0x2ba0d6;return _0x4a59fd;})[_0xa7c5('0x21')](respondWithFilteredResult(_0x5dc1f7,_0x227fd0))[_0xa7c5('0x29')](handleError(_0x5dc1f7,null));};exports[_0xa7c5('0x54')]=function(_0x1cd99c,_0x40256a){var _0x2b3a7b={'raw':!![],'where':{'id':_0x1cd99c[_0xa7c5('0x55')]['id']}},_0x46d292={};_0x46d292[_0xa7c5('0x3f')]=_[_0xa7c5('0x41')](db[_0xa7c5('0x3c')][_0xa7c5('0x56')]);_0x46d292[_0xa7c5('0x40')]=_[_0xa7c5('0x41')](_0x1cd99c['query']);_0x46d292[_0xa7c5('0x4b')]=_[_0xa7c5('0x42')](_0x46d292['model'],_0x46d292[_0xa7c5('0x40')]);_0x2b3a7b[_0xa7c5('0x43')]=_[_0xa7c5('0x42')](_0x46d292['model'],qs[_0xa7c5('0x44')](_0x1cd99c[_0xa7c5('0x40')][_0xa7c5('0x44')]));_0x2b3a7b[_0xa7c5('0x43')]=_0x2b3a7b[_0xa7c5('0x43')][_0xa7c5('0x45')]?_0x2b3a7b[_0xa7c5('0x43')]:_0x46d292[_0xa7c5('0x3f')];if(_0x1cd99c['query'][_0xa7c5('0x50')]){_0x2b3a7b[_0xa7c5('0x51')]=[{'all':!![]}];}_0x2b3a7b=_[_0xa7c5('0x4e')]({},_0x2b3a7b,_0x1cd99c[_0xa7c5('0x57')]);return db[_0xa7c5('0x3c')][_0xa7c5('0x58')](_0x2b3a7b)[_0xa7c5('0x21')](handleEntityNotFound(_0x40256a,null))[_0xa7c5('0x21')](respondWithResult(_0x40256a,null))[_0xa7c5('0x29')](handleError(_0x40256a,null));};exports['create']=function(_0x3c3a9b,_0x495a1b){return db[_0xa7c5('0x3c')][_0xa7c5('0x59')](_0x3c3a9b[_0xa7c5('0x5a')],{})[_0xa7c5('0x21')](respondWithResult(_0x495a1b,0xc9))[_0xa7c5('0x29')](handleError(_0x495a1b,null));};exports['update']=function(_0x13f0d7,_0x555f7a){if(_0x13f0d7[_0xa7c5('0x5a')]['id']){delete _0x13f0d7[_0xa7c5('0x5a')]['id'];}return db['SmsMessage'][_0xa7c5('0x58')]({'where':{'id':_0x13f0d7[_0xa7c5('0x55')]['id']}})[_0xa7c5('0x21')](handleEntityNotFound(_0x555f7a,null))[_0xa7c5('0x21')](saveUpdates(_0x13f0d7['body'],null))['then'](respondWithResult(_0x555f7a,null))[_0xa7c5('0x29')](handleError(_0x555f7a,null));};exports[_0xa7c5('0x36')]=function(_0x28c6b9,_0x342e59){return db[_0xa7c5('0x3c')][_0xa7c5('0x58')]({'where':{'id':_0x28c6b9['params']['id']}})[_0xa7c5('0x21')](handleEntityNotFound(_0x342e59,null))[_0xa7c5('0x21')](removeEntity(_0x342e59,null))['catch'](handleError(_0x342e59,null));};exports[_0xa7c5('0x5b')]=function(_0x2e7c3f,_0x5d5d84){return db[_0xa7c5('0x3c')][_0xa7c5('0x5b')]()[_0xa7c5('0x21')](respondWithResult(_0x5d5d84,null))[_0xa7c5('0x29')](handleError(_0x5d5d84,null));};var interaction_log=require(_0xa7c5('0x11'))(_0xa7c5('0x5c'));exports[_0xa7c5('0x5d')]=function(_0x31d525,_0x16c7e9,_0x19050b){var _0x125279={'channel':_0xa7c5('0x5e')};if(_0x31d525[_0xa7c5('0x5a')]['id']){delete _0x31d525[_0xa7c5('0x5a')]['id'];}_0x31d525[_0xa7c5('0x5a')][_0xa7c5('0x5f')]=!![];_0x31d525['body'][_0xa7c5('0x60')]=moment()[_0xa7c5('0x61')](_0xa7c5('0x62'));_0x31d525[_0xa7c5('0x5a')][_0xa7c5('0x63')]=_0x31d525[_0xa7c5('0x5a')][_0xa7c5('0x63')]||_0x31d525[_0xa7c5('0x64')]['id'];return db[_0xa7c5('0x3c')][_0xa7c5('0x58')]({'where':{'id':_0x31d525['params']['id'],'UserId':null},'include':[{'model':db[_0xa7c5('0x65')],'as':'Contact'}]})[_0xa7c5('0x21')](handleEntityNotFound(_0x16c7e9,null))[_0xa7c5('0x21')](saveUpdates(_0x31d525[_0xa7c5('0x5a')],null))['then'](function(_0x1eec3b){if(_0x1eec3b){_0x125279[_0xa7c5('0x26')]=_0x1eec3b[_0xa7c5('0x66')]({'plain':!![]});return db[_0xa7c5('0x67')]['find']({'where':{'id':_0x1eec3b[_0xa7c5('0x68')]}});}return null;})[_0xa7c5('0x21')](handleEntityNotFound(_0x16c7e9,null))[_0xa7c5('0x21')](function(_0x3c93ed){if(_0x3c93ed){return _0x3c93ed['update']({'UserId':_0x31d525[_0xa7c5('0x5a')][_0xa7c5('0x63')],'read1stAt':_[_0xa7c5('0x69')](_0x3c93ed[_0xa7c5('0x6a')])?moment()[_0xa7c5('0x61')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xa7c5('0x21')](function(_0x414150){if(_0x414150){_0x125279[_0xa7c5('0x6b')]=_0x414150[_0xa7c5('0x66')]({'plain':!![]});interaction_log[_0xa7c5('0x22')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x31d525[_0xa7c5('0x64')]['id'],_0x31d525[_0xa7c5('0x64')][_0xa7c5('0x38')],_0x31d525[_0xa7c5('0x64')][_0xa7c5('0x6c')],_0x125279[_0xa7c5('0x6b')]['id'],_0x31d525[_0xa7c5('0x5a')]?JSON['stringify'](_0x31d525[_0xa7c5('0x5a')]):'null');return respondWithRpcPromise(_0xa7c5('0x6d'),'acceptMessage',_0x125279);}return null;})[_0xa7c5('0x21')](function(_0x3c49ec){if(_0x3c49ec){if(_0x31d525[_0xa7c5('0x5a')][_0xa7c5('0x6e')]){_0x125279[_0xa7c5('0x26')]['interface']=util[_0xa7c5('0x61')]('SIP/%s',_0x31d525[_0xa7c5('0x64')][_0xa7c5('0x38')]);_0x125279[_0xa7c5('0x26')]['channel']=_0x125279[_0xa7c5('0x6f')];_0x125279[_0xa7c5('0x26')][_0xa7c5('0x70')]='accept';return respondWithRpcPromise(_0xa7c5('0x71'),'EventManager',{'event':'acceptmessage','message':_0x125279[_0xa7c5('0x26')]},client9002)[_0xa7c5('0x21')](function(){return _0x125279;});}return _0x125279;}return null;})['then'](respondWithResult(_0x16c7e9,null))[_0xa7c5('0x29')](handleError(_0x16c7e9,null));};var interaction_log=require(_0xa7c5('0x11'))(_0xa7c5('0x5c'));exports[_0xa7c5('0x72')]=function(_0x2c01d5,_0x3c07f8,_0x1e018a){var _0x95dc2={'agent':{},'channel':_0xa7c5('0x5e')};if(_0x2c01d5[_0xa7c5('0x5a')]['id']){delete _0x2c01d5[_0xa7c5('0x5a')]['id'];}_0x2c01d5[_0xa7c5('0x5a')][_0xa7c5('0x63')]=_0x2c01d5[_0xa7c5('0x5a')]['UserId']||_0x2c01d5[_0xa7c5('0x64')]['id'];_0x95dc2[_0xa7c5('0x73')]['id']=_0x2c01d5['body'][_0xa7c5('0x63')];return db[_0xa7c5('0x3c')][_0xa7c5('0x58')]({'where':{'id':_0x2c01d5[_0xa7c5('0x55')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3c07f8,null))['then'](function(_0x216ed9){if(_0x216ed9){_0x95dc2[_0xa7c5('0x26')]=_0x216ed9[_0xa7c5('0x66')]({'plain':!![]});return db[_0xa7c5('0x67')][_0xa7c5('0x58')]({'where':{'id':_0x216ed9[_0xa7c5('0x68')]}});}return null;})['then'](handleEntityNotFound(_0x3c07f8,null))[_0xa7c5('0x21')](function(_0xe87d64){if(_0xe87d64){_0x95dc2[_0xa7c5('0x6b')]=_0xe87d64[_0xa7c5('0x66')]({'plain':!![]});interaction_log[_0xa7c5('0x22')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2c01d5['user']['id'],_0x2c01d5['user'][_0xa7c5('0x38')],_0x2c01d5[_0xa7c5('0x64')]['role'],_0x95dc2[_0xa7c5('0x6b')]['id'],_0x2c01d5[_0xa7c5('0x5a')]?JSON['stringify'](_0x2c01d5[_0xa7c5('0x5a')]):_0xa7c5('0x74'));return respondWithRpcPromise(_0xa7c5('0x75'),'rejectMessage',_0x95dc2);}return null;})[_0xa7c5('0x21')](function(_0x193e17){if(_0x193e17){_0x193e17[_0xa7c5('0x26')][_0xa7c5('0x76')]=util[_0xa7c5('0x61')](_0xa7c5('0x77'),_0x2c01d5[_0xa7c5('0x64')][_0xa7c5('0x38')]);_0x193e17[_0xa7c5('0x26')]['channel']=_0x95dc2[_0xa7c5('0x6f')];_0x193e17[_0xa7c5('0x26')]['event']='reject';respondWithRpcPromise(_0xa7c5('0x71'),'EventManager',{'event':_0xa7c5('0x78'),'message':_0x193e17[_0xa7c5('0x26')]},client9002);return _0x95dc2;}return null;})['then'](respondWithResult(_0x3c07f8,null))['catch'](handleError(_0x3c07f8,null));};exports[_0xa7c5('0x2b')]=function(_0x196785,_0x46eeac,_0x4acac5){if(_0x196785['body']['id']){delete _0x196785[_0xa7c5('0x5a')]['id'];}var _0x2c9b21;return db[_0xa7c5('0x3c')][_0xa7c5('0x58')]({'where':{'id':_0x196785['params']['id']}})[_0xa7c5('0x21')](handleEntityNotFound(_0x46eeac,null))[_0xa7c5('0x21')](function(_0x470628){if(_0x470628){_0x2c9b21=_0x470628;return db['SmsAccount'][_0xa7c5('0x58')]({'where':{'id':_0x470628[_0xa7c5('0x79')]}});}})[_0xa7c5('0x21')](handleEntityNotFound(_0x46eeac,null))['then'](function(_0x30db2b){if(_0x30db2b){logger[_0xa7c5('0x7a')](_0xa7c5('0x7b'),_0xa7c5('0x2b'),'received\x20delivery\x20report\x20from',_0x30db2b[_0xa7c5('0x4f')],util[_0xa7c5('0x7c')](_0x196785[_0xa7c5('0x5a')],{'showHidden':![],'depth':null}));switch(_0x30db2b[_0xa7c5('0x4f')]){case _0xa7c5('0x7d'):if(_0x196785[_0xa7c5('0x5a')][_0xa7c5('0x7e')]&&_0x196785[_0xa7c5('0x5a')][_0xa7c5('0x7e')]===_0x2c9b21[_0xa7c5('0x7f')]){return _0x2c9b21[_0xa7c5('0x35')]({'read':!![]});}else{logger[_0xa7c5('0x25')](_0xa7c5('0x80'),_0xa7c5('0x2b'),_0xa7c5('0x7d'),util[_0xa7c5('0x7c')](_0x196785[_0xa7c5('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xa7c5('0x81'):if(_0x196785[_0xa7c5('0x5a')]['MessageUUID']&&_0x196785[_0xa7c5('0x5a')][_0xa7c5('0x82')]===_0x2c9b21[_0xa7c5('0x7f')]&&_[_0xa7c5('0x83')]([_0xa7c5('0x84'),'delivered'],_0x196785[_0xa7c5('0x5a')][_0xa7c5('0x85')])>=0x0){return _0x2c9b21[_0xa7c5('0x35')]({'read':!![]});}else{logger['error'](_0xa7c5('0x80'),_0xa7c5('0x2b'),_0xa7c5('0x86'),util['inspect'](_0x196785[_0xa7c5('0x5a')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x3a5b68=_0x196785['body'][_0xa7c5('0x87')][0x0];if(_0x3a5b68[_0xa7c5('0x2b')][_0xa7c5('0x88')]===_0xa7c5('0x89')){return _0x2c9b21[_0xa7c5('0x35')]({'read':!![]});}else{logger[_0xa7c5('0x25')](_0xa7c5('0x80'),_0xa7c5('0x2b'),_0xa7c5('0x8a'),util[_0xa7c5('0x7c')](_0x196785[_0xa7c5('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x2c9b21;}})[_0xa7c5('0x21')](respondWithResult(_0x46eeac,null))[_0xa7c5('0x29')](handleError(_0x46eeac,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 8af3581..9536a63 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 _0x08a5=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save'];(function(_0x584ac5,_0x57e894){var _0x4f9d09=function(_0x4cd2dd){while(--_0x4cd2dd){_0x584ac5['push'](_0x584ac5['shift']());}};_0x4f9d09(++_0x57e894);}(_0x08a5,0x8c));var _0x508a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x08a5[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x508a('0x0'));var SmsMessage=require(_0x508a('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x508a('0x2')](0x0);var events={'afterCreate':_0x508a('0x3'),'afterUpdate':'update','afterDestroy':_0x508a('0x4')};function emitEvent(_0x4dd10b){return function(_0x595a3c,_0x40a66a,_0x1367f1){SmsMessageEvents['emit'](_0x4dd10b+':'+_0x595a3c['id'],_0x595a3c);SmsMessageEvents[_0x508a('0x5')](_0x4dd10b,_0x595a3c);_0x1367f1(null);};}for(var e in events){if(events[_0x508a('0x6')](e)){var event=events[e];SmsMessage[_0x508a('0x7')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file +var _0x1726=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x5a1b50,_0x5ad914){var _0x443dc9=function(_0x17477c){while(--_0x17477c){_0x5a1b50['push'](_0x5a1b50['shift']());}};_0x443dc9(++_0x5ad914);}(_0x1726,0x17a));var _0x6172=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0x1726[_0x36ed3c];return _0x52a2e0;};'use strict';var EventEmitter=require(_0x6172('0x0'));var SmsMessage=require(_0x6172('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x6172('0x2')](0x0);var events={'afterCreate':_0x6172('0x3'),'afterUpdate':_0x6172('0x4'),'afterDestroy':_0x6172('0x5')};function emitEvent(_0xf0d359){return function(_0x3c27ed,_0x436051,_0x23bac7){SmsMessageEvents['emit'](_0xf0d359+':'+_0x3c27ed['id'],_0x3c27ed);SmsMessageEvents[_0x6172('0x6')](_0xf0d359,_0x3c27ed);_0x23bac7(null);};}for(var e in events){if(events[_0x6172('0x7')](e)){var event=events[e];SmsMessage[_0x6172('0x8')](e,emitEvent(event));}}module[_0x6172('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 5f027ae..2319177 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 _0x0457=['status','refid','Token\x20not\x20received','finally','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','models','get','toLowerCase','secret','isNil','UserId','SmsInteraction','findOne','SmsInteractionId','then','update','direction','catch','error','SmsAccountId','type','twilio','accountSid','phone','authToken','messages','create','/api/sms/messages/','/status?token=','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','skebby','username','password','smsMethod','sender','&password=','GET','sms','user_key','session_key','internal_order_id','deliveryReport','read','connectel','senderString','POST','https://smsapi.connectel.se/api/send/','Missing\x20parameters:\x20authToken','clicksend','%s:%s','https://rest.clicksend.com/v3/sms/send','format','Basic\x20%s','toString','base64','http_code','data','queued_count','head','message_id','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','authId','remote','token','https://api.plivo.com/v1/Account/%s/Message/','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','application/json','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','text','timestamp','keys','sort','length','createHash','md5','digest','hex','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','clickatell','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','code','https://api.intelepeer.com/_rest/v4/app/sms/mdr','message'];(function(_0x4b031b,_0x1ebc74){var _0x33c636=function(_0x224996){while(--_0x224996){_0x4b031b['push'](_0x4b031b['shift']());}};_0x33c636(++_0x1ebc74);}(_0x0457,0x1e1));var _0x7045=function(_0x3f668b,_0x6ab15c){_0x3f668b=_0x3f668b-0x0;var _0x259a77=_0x0457[_0x3f668b];return _0x259a77;};'use strict';var _=require(_0x7045('0x0'));var util=require(_0x7045('0x1'));var logger=require(_0x7045('0x2'))(_0x7045('0x3'));var moment=require(_0x7045('0x4'));var BPromise=require(_0x7045('0x5'));var rp=require(_0x7045('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7045('0x7'));var config=require(_0x7045('0x8'));var attributes=require(_0x7045('0x9'));module[_0x7045('0xa')]=function(_0x1b276a,_0x593f20){return _0x1b276a[_0x7045('0xb')](_0x7045('0xc'),attributes,{'tableName':_0x7045('0xd'),'paranoid':![],'indexes':[{'name':_0x7045('0xe'),'fields':[_0x7045('0xe')]},{'name':_0x7045('0xf'),'fields':[_0x7045('0x10')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0xd45d17,_0x6e7b90,_0x124a76){var _0x3c6f85=_0x1b276a[_0x7045('0x11')];var _0x45aa2c=_0xd45d17[_0x7045('0x12')]({'plain':!![]});if(_0x45aa2c['direction']['toLowerCase']()==='in'||_0x45aa2c['direction'][_0x7045('0x13')]()==='out'&&!_0x45aa2c[_0x7045('0x14')]&&!_[_0x7045('0x15')](_0x45aa2c[_0x7045('0x16')])){_0x3c6f85[_0x7045('0x17')][_0x7045('0x18')]({'where':{'id':_0x45aa2c[_0x7045('0x19')]}})[_0x7045('0x1a')](function(_0x2249d0){if(_0x2249d0){_0x2249d0[_0x7045('0x1b')]({'lastMsgAt':_0x45aa2c['createdAt'],'lastMsgDirection':_0x45aa2c[_0x7045('0x1c')][_0x7045('0x13')]()});}})[_0x7045('0x1d')](function(_0x4ecb76){console[_0x7045('0x1e')](_0x4ecb76);});}if(_0x45aa2c[_0x7045('0x1c')]==='out'&&!_0x45aa2c[_0x7045('0x14')]){var _0x5cb1c2;_0x3c6f85['SmsAccount']['find']({'where':{'id':_0x45aa2c[_0x7045('0x1f')]},'raw':!![]})['then'](function(_0x4547b6){_0x5cb1c2=_0x4547b6;if(_0x5cb1c2&&_0x5cb1c2[_0x7045('0x20')]){switch(_0x5cb1c2[_0x7045('0x20')]){case _0x7045('0x21'):var _0x13539d=require('twilio');if(_0x5cb1c2[_0x7045('0x22')]&&_0x5cb1c2['authToken']&&_0x5cb1c2[_0x7045('0x23')]){var _0x5a6901=new _0x13539d(_0x5cb1c2[_0x7045('0x22')],_0x5cb1c2[_0x7045('0x24')]);_0x5a6901[_0x7045('0x25')][_0x7045('0x26')]({'body':_0x45aa2c['body'],'to':_0x45aa2c[_0x7045('0x23')],'from':_0x5cb1c2['phone'],'statusCallback':_0x5cb1c2['remote']+_0x7045('0x27')+_0x45aa2c['id']+_0x7045('0x28')+_0x5cb1c2['token']})[_0x7045('0x1a')](function(_0x1e996f){if(_0x1e996f['sid']){return _0xd45d17[_0x7045('0x1b')]({'messageId':_0x1e996f['sid']});}})[_0x7045('0x1d')](function(_0xf33c23){logger[_0x7045('0x1e')](_0x7045('0x29'),_0x7045('0x2a'),'twilio',util[_0x7045('0x2b')](_0xf33c23,{'showHidden':![],'depth':null}));});}else{logger[_0x7045('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7045('0x2a'),_0x7045('0x21'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x7045('0x2c'):var _0x376f97='https://api.skebby.it/API/v1.0/REST/';if(_0x5cb1c2[_0x7045('0x2d')]&&_0x5cb1c2[_0x7045('0x2e')]){var _0x18f88e={'recipient':[_0x45aa2c[_0x7045('0x23')]],'message':_0x45aa2c[_0x7045('0x10')],'message_type':_0x5cb1c2[_0x7045('0x2f')]};if(_0x5cb1c2[_0x7045('0x2f')]&&_0x5cb1c2[_0x7045('0x2f')]!=='SI'){_0x18f88e[_0x7045('0x30')]=_0x5cb1c2['phone'];}var _0x56d091={'url':_0x376f97+'login?username='+_0x5cb1c2[_0x7045('0x2d')]+_0x7045('0x31')+_0x5cb1c2[_0x7045('0x2e')],'method':_0x7045('0x32')};rp(_0x56d091)[_0x7045('0x1a')](function(_0x34cf00){var _0x1c5abe=_0x34cf00['split'](';');var _0x1c828d={'user_key':_0x1c5abe[0x0],'session_key':_0x1c5abe[0x1]};_0x56d091={'url':_0x376f97+_0x7045('0x33'),'method':'POST','headers':{'user_key':_0x1c828d[_0x7045('0x34')],'Session_key':_0x1c828d[_0x7045('0x35')]},'json':!![],'body':_0x18f88e};return rp(_0x56d091);})['then'](function(_0x465f98){if(_0x465f98['total_sent']>=0x1){var _0x40f349={'messageId':_0x465f98[_0x7045('0x36')]};if(_0x5cb1c2[_0x7045('0x2f')]!=='GP'||!_0x5cb1c2[_0x7045('0x37')]){_0x40f349[_0x7045('0x38')]=!![];}return _0xd45d17[_0x7045('0x1b')](_0x40f349);}else{return logger[_0x7045('0x1e')](_0x7045('0x29'),_0x7045('0x2a'),_0x7045('0x2c'),util[_0x7045('0x2b')](_0x465f98,{'showHidden':![],'depth':null}));}})[_0x7045('0x1d')](function(_0x78607f){return logger[_0x7045('0x1e')](_0x7045('0x29'),_0x7045('0x2a'),'skebby',util[_0x7045('0x2b')](_0x78607f,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x7045('0x29'),'afterCreate','skebby','Missing\x20parameters:\x20username,\x20password');}break;case _0x7045('0x39'):if(_0x5cb1c2[_0x7045('0x24')]){var _0x5c4de5={'recipient':_0x45aa2c[_0x7045('0x23')],'message':_0x45aa2c[_0x7045('0x10')],'sender':_0x5cb1c2[_0x7045('0x3a')]||_0x5cb1c2[_0x7045('0x23')],'authorization':_0x5cb1c2[_0x7045('0x24')]};var _0x6e7b90={'method':_0x7045('0x3b'),'uri':_0x7045('0x3c'),'body':_0x5c4de5,'json':!![]};rp(_0x6e7b90)[_0x7045('0x1a')](function(_0x3f0e60){var _0x3de8a0={'messageId':_0x3f0e60['requestid']};if(!_0x5cb1c2[_0x7045('0x37')]){_0x3de8a0[_0x7045('0x38')]=!![];}return _0xd45d17[_0x7045('0x1b')](_0x3de8a0);})[_0x7045('0x1d')](function(_0x1ea094){logger[_0x7045('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7045('0x2a'),_0x7045('0x39'),util[_0x7045('0x2b')](_0x1ea094,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x7045('0x29'),_0x7045('0x2a'),_0x7045('0x39'),_0x7045('0x3d'));}break;case _0x7045('0x3e'):if(_0x5cb1c2[_0x7045('0x2d')]&&_0x5cb1c2[_0x7045('0x2e')]){var _0x5c4de5={'messages':[{'source':'xCALLY\x20Motion','to':_0x45aa2c[_0x7045('0x23')],'body':_0x45aa2c[_0x7045('0x10')],'from':_0x5cb1c2['senderString']||_0x5cb1c2['phone']}]};var _0x5632b4=util['format'](_0x7045('0x3f'),_0x5cb1c2[_0x7045('0x2d')],_0x5cb1c2['password']);var _0x6e7b90={'method':_0x7045('0x3b'),'uri':_0x7045('0x40'),'body':_0x5c4de5,'headers':{'Authorization':util[_0x7045('0x41')](_0x7045('0x42'),new Buffer(_0x5632b4)[_0x7045('0x43')](_0x7045('0x44')))},'json':!![]};rp(_0x6e7b90)[_0x7045('0x1a')](function(_0x3f6ef2){if(_0x3f6ef2[_0x7045('0x45')]>=0xc8&&_0x3f6ef2[_0x7045('0x45')]<=0xce){if(_0x3f6ef2['data']&&_0x3f6ef2[_0x7045('0x46')][_0x7045('0x47')]>0x0){var _0x33eb47=_[_0x7045('0x48')](_0x3f6ef2[_0x7045('0x46')]['messages']);var _0x505f06={'messageId':_0x33eb47[_0x7045('0x49')]};if(!_0x5cb1c2[_0x7045('0x37')]){_0x505f06[_0x7045('0x38')]=!![];}return _0xd45d17['update'](_0x505f06);}else{logger[_0x7045('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7045('0x2a'),'clickSend',util[_0x7045('0x2b')](_0x3f6ef2,{'showHidden':![],'depth':null}));}}else{logger[_0x7045('0x1e')](_0x7045('0x29'),_0x7045('0x2a'),_0x7045('0x4a'),util['inspect'](_0x3f6ef2,{'showHidden':![],'depth':null}));}})[_0x7045('0x1d')](function(_0x386012){logger[_0x7045('0x1e')](_0x7045('0x29'),_0x7045('0x2a'),_0x7045('0x4a'),util[_0x7045('0x2b')](_0x386012,{'showHidden':![],'depth':null}));});}else{logger[_0x7045('0x1e')](_0x7045('0x29'),'afterCreate','clickSend',_0x7045('0x4b'));}break;case _0x7045('0x4c'):if(_0x5cb1c2[_0x7045('0x4d')]&&_0x5cb1c2[_0x7045('0x24')]){var _0x5c4de5={'dst':_0x45aa2c[_0x7045('0x23')],'text':_0x45aa2c['body'],'src':_0x5cb1c2[_0x7045('0x3a')]||_0x5cb1c2[_0x7045('0x23')],'url':_0x5cb1c2[_0x7045('0x4e')]+_0x7045('0x27')+_0x45aa2c['id']+_0x7045('0x28')+_0x5cb1c2[_0x7045('0x4f')]};var _0x5632b4=util[_0x7045('0x41')]('%s:%s',_0x5cb1c2[_0x7045('0x4d')],_0x5cb1c2[_0x7045('0x24')]);var _0x6e7b90={'method':_0x7045('0x3b'),'uri':util['format'](_0x7045('0x50'),_0x5cb1c2[_0x7045('0x4d')]),'body':_0x5c4de5,'headers':{'Authorization':util['format'](_0x7045('0x42'),new Buffer(_0x5632b4)[_0x7045('0x43')](_0x7045('0x44')))},'json':!![]};rp(_0x6e7b90)[_0x7045('0x1a')](function(_0x5bfff1){var _0x445d35={'messageId':_0x5bfff1['message_uuid'][0x0]};return _0xd45d17[_0x7045('0x1b')](_0x445d35);})['catch'](function(_0x2b1c4d){logger[_0x7045('0x1e')](_0x7045('0x29'),_0x7045('0x2a'),'plivo',util['inspect'](_0x2b1c4d,{'showHidden':![],'depth':null}));});}else{logger[_0x7045('0x1e')](_0x7045('0x29'),_0x7045('0x2a'),_0x7045('0x4c'),_0x7045('0x51'));}break;case'infobip':if(_0x5cb1c2['username']&&_0x5cb1c2[_0x7045('0x2e')]){if(_0x5cb1c2['baseUrl']){var _0x36c2eb={'method':_0x7045('0x3b'),'uri':_0x5cb1c2[_0x7045('0x52')]+_0x7045('0x53'),'body':{'username':_0x5cb1c2[_0x7045('0x2d')],'password':_0x5cb1c2[_0x7045('0x2e')]},'json':!![]};return rp(_0x36c2eb)['then'](function(_0x28de20){var _0x62029d={'method':'POST','uri':_0x5cb1c2[_0x7045('0x52')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x5cb1c2['phone'],'destinations':[{'to':_0x45aa2c[_0x7045('0x23')]}],'text':_0x45aa2c['body'],'notifyUrl':_0x5cb1c2['remote']+'/api/sms/messages/'+_0x45aa2c['id']+_0x7045('0x28')+_0x5cb1c2['token'],'notifyContentType':_0x7045('0x54'),'callbackData':_0x5cb1c2['phone']+';'+_0x45aa2c[_0x7045('0x10')]}]},'headers':{'Authorization':_0x7045('0x55')+_0x28de20[_0x7045('0x4f')]},'json':!![]};return rp(_0x62029d)[_0x7045('0x1a')](function(_0x1356cc){if(_0x1356cc['messages']){var _0x257de9={'messageId':_0x1356cc[_0x7045('0x25')][0x0][_0x7045('0xe')]};if(!_0x5cb1c2[_0x7045('0x37')]){_0x257de9[_0x7045('0x38')]=!![];}return _0xd45d17[_0x7045('0x1b')](_0x257de9);}else{return logger[_0x7045('0x1e')](_0x7045('0x29'),_0x7045('0x2a'),_0x7045('0x56'),util[_0x7045('0x2b')](_0x1356cc,{'showHidden':![],'depth':null}));}});})[_0x7045('0x1d')](function(_0x16326b){return logger[_0x7045('0x1e')](_0x7045('0x29'),'afterCreate',_0x7045('0x56'),util[_0x7045('0x2b')](_0x16326b,{'showHidden':![],'depth':null}));});}else{logger[_0x7045('0x1e')](_0x7045('0x29'),_0x7045('0x2a'),_0x7045('0x56'),_0x7045('0x57'));}}else{logger[_0x7045('0x1e')](_0x7045('0x29'),_0x7045('0x2a'),'infobip',_0x7045('0x4b'));}break;case _0x7045('0x58'):var _0x21af2e=require(_0x7045('0x59'));if(_0x5cb1c2[_0x7045('0x5a')]){var _0xbd0c20={};_0xbd0c20[_0x7045('0x5b')]=_0x5cb1c2['username'];_0xbd0c20['phone']=_0x45aa2c[_0x7045('0x23')];_0xbd0c20[_0x7045('0x30')]=_0x5cb1c2['phone'];_0xbd0c20[_0x7045('0x5c')]=_0x45aa2c['body'];_0xbd0c20[_0x7045('0x5d')]=+new Date();var _0x11764d='';var _0x2aa336='';var _0x1148e9=Object[_0x7045('0x5e')](_0xbd0c20);_0x1148e9[_0x7045('0x5f')]();for(var _0x5ca004=0x0;_0x5ca004<_0x1148e9[_0x7045('0x60')];_0x5ca004++){if(_0x11764d!=''){_0x11764d+='&';}_0x11764d+=_0x1148e9[_0x5ca004]+'='+encodeURIComponent(_0xbd0c20[_0x1148e9[_0x5ca004]]);_0x2aa336+=_0xbd0c20[_0x1148e9[_0x5ca004]];}_0x2aa336+=_0x5cb1c2['apiKey'];_0x2aa336=_0x21af2e[_0x7045('0x61')](_0x7045('0x62'))[_0x7045('0x1b')](_0x2aa336)[_0x7045('0x63')](_0x7045('0x64'));if(_0x11764d!==''){_0x11764d+='&';}_0x11764d+='signature='+_0x2aa336;var _0x56d091={'method':_0x7045('0x32'),'uri':_0x5cb1c2['baseUrl']+_0x7045('0x65')+_0x11764d,'json':!![]};return rp(_0x56d091)['then'](function(_0x4f392c){var _0xb859e4=Object[_0x7045('0x5e')](_0x4f392c);if(_0x4f392c[_0xb859e4[0x0]]['error']&&parseInt(_0x4f392c[_0xb859e4[0x0]]['error'])===0x0){var _0x1ee168={'messageId':_0x4f392c[_0xb859e4[0x0]][_0x7045('0x66')]};if(!_0x5cb1c2['deliveryReport']){_0x1ee168['read']=!![];}return _0xd45d17[_0x7045('0x1b')](_0x1ee168);}else{return logger[_0x7045('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7045('0x2a'),_0x7045('0x58'),util[_0x7045('0x2b')](_0x4f392c[_0x7045('0x1e')],{'showHidden':![],'depth':null}));}})[_0x7045('0x1d')](function(_0x4b9ae1){return logger[_0x7045('0x1e')](_0x7045('0x29'),_0x7045('0x2a'),'csc',util[_0x7045('0x2b')](_0x4b9ae1,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x7045('0x29'),_0x7045('0x2a'),_0x7045('0x58'),_0x7045('0x67'));}break;case'clickatell':if(_0x5cb1c2[_0x7045('0x5a')]){var _0x1dec4c={'method':_0x7045('0x3b'),'uri':_0x7045('0x68'),'headers':{'Authorization':_0x5cb1c2[_0x7045('0x5a')]},'body':{'content':_0x45aa2c[_0x7045('0x10')],'to':[_0x45aa2c[_0x7045('0x23')]],'from':_0x5cb1c2[_0x7045('0x23')],'binary':![],'clientMessageId':_0x7045('0x69'),'charset':_0x7045('0x6a')},'json':!![]};rp(_0x1dec4c)[_0x7045('0x1a')](function(_0x19a35){if(!_0x19a35['error']){var _0x5e0168={'messageId':_0x19a35[_0x7045('0x25')][0x0][_0x7045('0x6b')]};if(!_0x5cb1c2[_0x7045('0x37')]){_0x5e0168[_0x7045('0x38')]=!![];}return _0xd45d17[_0x7045('0x1b')](_0x5e0168);}else{return logger['error'](_0x7045('0x29'),_0x7045('0x2a'),_0x7045('0x6c'),util[_0x7045('0x2b')](_0x19a35[_0x7045('0x1e')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x533bd9){return logger[_0x7045('0x1e')](_0x7045('0x29'),_0x7045('0x2a'),_0x7045('0x6c'),util[_0x7045('0x2b')](_0x533bd9,{'showHidden':![],'depth':null}));});}else{logger[_0x7045('0x1e')](_0x7045('0x29'),'afterCreate',_0x7045('0x6c'),_0x7045('0x67'));}break;case _0x7045('0x6d'):if(_0x5cb1c2['apiKey']){var _0x4d1abf={};var _0x56d091={'method':_0x7045('0x3b'),'uri':_0x7045('0x6e'),'headers':{'Authorization':'Bearer\x20'+_0x5cb1c2[_0x7045('0x5a')],'Content-Type':_0x7045('0x54')},'body':{'from':_0x5cb1c2[_0x7045('0x23')],'to':_0x45aa2c[_0x7045('0x23')],'text':_0x45aa2c[_0x7045('0x10')]},'json':!![]};return rp(_0x56d091)[_0x7045('0x1a')](function(_0x5b30a1){if(_0x5b30a1[_0x7045('0x6f')]==0xca){_0x4d1abf['message']=_0x5b30a1;var _0x12ed46={'method':'POST','uri':_0x7045('0x70'),'headers':{'Authorization':'Bearer\x20'+_0x5cb1c2[_0x7045('0x5a')],'Content-Type':_0x7045('0x54')},'body':{'refid':_0x4d1abf[_0x7045('0x71')]['refid']},'json':!![]};return rp(_0x12ed46)[_0x7045('0x1a')](function(_0x36c4ee){_0x4d1abf[_0x7045('0x72')]=_0x36c4ee;var _0x46f3c3={'messageId':_0x4d1abf['message'][_0x7045('0x73')],'read':!![]};return _0xd45d17[_0x7045('0x1b')](_0x46f3c3);});}else{return logger[_0x7045('0x1e')](_0x7045('0x29'),_0x7045('0x2a'),'intelepeer',util[_0x7045('0x2b')](_0x5b30a1,{'showHidden':![],'depth':null}));}})[_0x7045('0x1d')](function(_0x4180e0){return logger[_0x7045('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7045('0x2a'),_0x7045('0x6d'),util[_0x7045('0x2b')](_0x4180e0,{'showHidden':![],'depth':null}));});}else{return logger[_0x7045('0x1e')](_0x7045('0x29'),_0x7045('0x2a'),_0x7045('0x6d'),_0x7045('0x74'));}break;}}})[_0x7045('0x75')](function(){_0x124a76();});}else{_0x124a76();}}},'charset':_0x7045('0x76'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x3d09=['SmsInteractionId','then','createdAt','catch','error','direction','secret','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','remote','/api/sms/messages/','/status?token=','token','sid','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','split','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','update','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20username,\x20password','connectel','https://smsapi.connectel.se/api/send/','requestid','Missing\x20parameters:\x20authToken','format','%s:%s','Basic\x20%s','toString','http_code','data','message_id','clickSend','plivo','authId','senderString','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','apiKey','login','keys','sort','length','createHash','md5','digest','hex','signature=','GET','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','uuid','apiMessageId','clickatell','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','status','refid','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','toLowerCase','out','isNil','UserId','findOne'];(function(_0x3fd8e6,_0x3a22ca){var _0x3e7cc9=function(_0x370777){while(--_0x370777){_0x3fd8e6['push'](_0x3fd8e6['shift']());}};_0x3e7cc9(++_0x3a22ca);}(_0x3d09,0xd6));var _0x93d0=function(_0x20f012,_0x3d0707){_0x20f012=_0x20f012-0x0;var _0x3d0ce6=_0x3d09[_0x20f012];return _0x3d0ce6;};'use strict';var _=require(_0x93d0('0x0'));var util=require(_0x93d0('0x1'));var logger=require(_0x93d0('0x2'))('api');var moment=require(_0x93d0('0x3'));var BPromise=require(_0x93d0('0x4'));var rp=require(_0x93d0('0x5'));var fs=require('fs');var path=require(_0x93d0('0x6'));var rimraf=require(_0x93d0('0x7'));var config=require(_0x93d0('0x8'));var attributes=require('./smsMessage.attributes');module[_0x93d0('0x9')]=function(_0x36ef61,_0x3d53a8){return _0x36ef61[_0x93d0('0xa')](_0x93d0('0xb'),attributes,{'tableName':_0x93d0('0xc'),'paranoid':![],'indexes':[{'name':_0x93d0('0xd'),'fields':[_0x93d0('0xd')]},{'name':_0x93d0('0xe'),'fields':[_0x93d0('0xf')],'type':_0x93d0('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5df62d,_0x1bba04,_0x23c5f0){var _0x35697f=_0x36ef61[_0x93d0('0x11')];var _0x333d21=_0x5df62d[_0x93d0('0x12')]({'plain':!![]});if(_0x333d21['direction']['toLowerCase']()==='in'||_0x333d21['direction'][_0x93d0('0x13')]()===_0x93d0('0x14')&&!_0x333d21['secret']&&!_[_0x93d0('0x15')](_0x333d21[_0x93d0('0x16')])){_0x35697f['SmsInteraction'][_0x93d0('0x17')]({'where':{'id':_0x333d21[_0x93d0('0x18')]}})[_0x93d0('0x19')](function(_0x2bc81c){if(_0x2bc81c){_0x2bc81c['update']({'lastMsgAt':_0x333d21[_0x93d0('0x1a')],'lastMsgDirection':_0x333d21['direction'][_0x93d0('0x13')]()});}})[_0x93d0('0x1b')](function(_0x7524c1){console[_0x93d0('0x1c')](_0x7524c1);});}if(_0x333d21[_0x93d0('0x1d')]==='out'&&!_0x333d21[_0x93d0('0x1e')]){var _0x145a04;_0x35697f[_0x93d0('0x1f')][_0x93d0('0x20')]({'where':{'id':_0x333d21[_0x93d0('0x21')]},'raw':!![]})[_0x93d0('0x19')](function(_0x4d9dfd){_0x145a04=_0x4d9dfd;if(_0x145a04&&_0x145a04[_0x93d0('0x22')]){switch(_0x145a04[_0x93d0('0x22')]){case _0x93d0('0x23'):var _0x3cf942=require(_0x93d0('0x23'));if(_0x145a04[_0x93d0('0x24')]&&_0x145a04[_0x93d0('0x25')]&&_0x145a04[_0x93d0('0x26')]){var _0x486629=new _0x3cf942(_0x145a04[_0x93d0('0x24')],_0x145a04[_0x93d0('0x25')]);_0x486629[_0x93d0('0x27')]['create']({'body':_0x333d21[_0x93d0('0xf')],'to':_0x333d21[_0x93d0('0x26')],'from':_0x145a04[_0x93d0('0x26')],'statusCallback':_0x145a04[_0x93d0('0x28')]+_0x93d0('0x29')+_0x333d21['id']+_0x93d0('0x2a')+_0x145a04[_0x93d0('0x2b')]})[_0x93d0('0x19')](function(_0x26ec21){if(_0x26ec21[_0x93d0('0x2c')]){return _0x5df62d['update']({'messageId':_0x26ec21[_0x93d0('0x2c')]});}})[_0x93d0('0x1b')](function(_0x347f0b){logger[_0x93d0('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x93d0('0x2d'),_0x93d0('0x23'),util[_0x93d0('0x2e')](_0x347f0b,{'showHidden':![],'depth':null}));});}else{logger[_0x93d0('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x93d0('0x2d'),_0x93d0('0x23'),_0x93d0('0x2f'));}break;case _0x93d0('0x30'):var _0x4bbf48=_0x93d0('0x31');if(_0x145a04[_0x93d0('0x32')]&&_0x145a04[_0x93d0('0x33')]){var _0x1bdab3={'recipient':[_0x333d21[_0x93d0('0x26')]],'message':_0x333d21[_0x93d0('0xf')],'message_type':_0x145a04[_0x93d0('0x34')]};if(_0x145a04[_0x93d0('0x34')]&&_0x145a04[_0x93d0('0x34')]!=='SI'){_0x1bdab3[_0x93d0('0x35')]=_0x145a04[_0x93d0('0x26')];}var _0x303c5b={'url':_0x4bbf48+'login?username='+_0x145a04['username']+'&password='+_0x145a04[_0x93d0('0x33')],'method':'GET'};rp(_0x303c5b)[_0x93d0('0x19')](function(_0x66e85f){var _0x5c0a34=_0x66e85f[_0x93d0('0x36')](';');var _0x1430c0={'user_key':_0x5c0a34[0x0],'session_key':_0x5c0a34[0x1]};_0x303c5b={'url':_0x4bbf48+_0x93d0('0x37'),'method':_0x93d0('0x38'),'headers':{'user_key':_0x1430c0[_0x93d0('0x39')],'Session_key':_0x1430c0[_0x93d0('0x3a')]},'json':!![],'body':_0x1bdab3};return rp(_0x303c5b);})[_0x93d0('0x19')](function(_0x2c6d92){if(_0x2c6d92[_0x93d0('0x3b')]>=0x1){var _0x3b9bfa={'messageId':_0x2c6d92[_0x93d0('0x3c')]};if(_0x145a04[_0x93d0('0x34')]!=='GP'||!_0x145a04[_0x93d0('0x3d')]){_0x3b9bfa[_0x93d0('0x3e')]=!![];}return _0x5df62d[_0x93d0('0x3f')](_0x3b9bfa);}else{return logger[_0x93d0('0x1c')](_0x93d0('0x40'),'afterCreate','skebby',util[_0x93d0('0x2e')](_0x2c6d92,{'showHidden':![],'depth':null}));}})['catch'](function(_0x2be259){return logger['error'](_0x93d0('0x40'),_0x93d0('0x2d'),_0x93d0('0x30'),util['inspect'](_0x2be259,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x93d0('0x40'),_0x93d0('0x2d'),_0x93d0('0x30'),_0x93d0('0x41'));}break;case _0x93d0('0x42'):if(_0x145a04[_0x93d0('0x25')]){var _0x41f8bf={'recipient':_0x333d21[_0x93d0('0x26')],'message':_0x333d21['body'],'sender':_0x145a04['senderString']||_0x145a04[_0x93d0('0x26')],'authorization':_0x145a04[_0x93d0('0x25')]};var _0x1bba04={'method':'POST','uri':_0x93d0('0x43'),'body':_0x41f8bf,'json':!![]};rp(_0x1bba04)['then'](function(_0x578a98){var _0x56adec={'messageId':_0x578a98[_0x93d0('0x44')]};if(!_0x145a04[_0x93d0('0x3d')]){_0x56adec[_0x93d0('0x3e')]=!![];}return _0x5df62d[_0x93d0('0x3f')](_0x56adec);})[_0x93d0('0x1b')](function(_0x133d64){logger[_0x93d0('0x1c')](_0x93d0('0x40'),_0x93d0('0x2d'),_0x93d0('0x42'),util[_0x93d0('0x2e')](_0x133d64,{'showHidden':![],'depth':null}));});}else{logger[_0x93d0('0x1c')](_0x93d0('0x40'),_0x93d0('0x2d'),'connectel',_0x93d0('0x45'));}break;case'clicksend':if(_0x145a04[_0x93d0('0x32')]&&_0x145a04['password']){var _0x41f8bf={'messages':[{'source':'xCALLY\x20Motion','to':_0x333d21['phone'],'body':_0x333d21[_0x93d0('0xf')],'from':_0x145a04['senderString']||_0x145a04[_0x93d0('0x26')]}]};var _0x1fc005=util[_0x93d0('0x46')](_0x93d0('0x47'),_0x145a04[_0x93d0('0x32')],_0x145a04[_0x93d0('0x33')]);var _0x1bba04={'method':_0x93d0('0x38'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x41f8bf,'headers':{'Authorization':util['format'](_0x93d0('0x48'),new Buffer(_0x1fc005)[_0x93d0('0x49')]('base64'))},'json':!![]};rp(_0x1bba04)[_0x93d0('0x19')](function(_0x396043){if(_0x396043[_0x93d0('0x4a')]>=0xc8&&_0x396043[_0x93d0('0x4a')]<=0xce){if(_0x396043[_0x93d0('0x4b')]&&_0x396043[_0x93d0('0x4b')]['queued_count']>0x0){var _0x24c6d4=_['head'](_0x396043[_0x93d0('0x4b')][_0x93d0('0x27')]);var _0x24672c={'messageId':_0x24c6d4[_0x93d0('0x4c')]};if(!_0x145a04['deliveryReport']){_0x24672c[_0x93d0('0x3e')]=!![];}return _0x5df62d[_0x93d0('0x3f')](_0x24672c);}else{logger[_0x93d0('0x1c')](_0x93d0('0x40'),_0x93d0('0x2d'),_0x93d0('0x4d'),util[_0x93d0('0x2e')](_0x396043,{'showHidden':![],'depth':null}));}}else{logger[_0x93d0('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x93d0('0x4d'),util[_0x93d0('0x2e')](_0x396043,{'showHidden':![],'depth':null}));}})[_0x93d0('0x1b')](function(_0x222b32){logger[_0x93d0('0x1c')](_0x93d0('0x40'),_0x93d0('0x2d'),_0x93d0('0x4d'),util[_0x93d0('0x2e')](_0x222b32,{'showHidden':![],'depth':null}));});}else{logger[_0x93d0('0x1c')](_0x93d0('0x40'),_0x93d0('0x2d'),_0x93d0('0x4d'),_0x93d0('0x41'));}break;case _0x93d0('0x4e'):if(_0x145a04[_0x93d0('0x4f')]&&_0x145a04[_0x93d0('0x25')]){var _0x41f8bf={'dst':_0x333d21['phone'],'text':_0x333d21[_0x93d0('0xf')],'src':_0x145a04[_0x93d0('0x50')]||_0x145a04[_0x93d0('0x26')],'url':_0x145a04['remote']+'/api/sms/messages/'+_0x333d21['id']+'/status?token='+_0x145a04['token']};var _0x1fc005=util[_0x93d0('0x46')](_0x93d0('0x47'),_0x145a04[_0x93d0('0x4f')],_0x145a04[_0x93d0('0x25')]);var _0x1bba04={'method':_0x93d0('0x38'),'uri':util[_0x93d0('0x46')]('https://api.plivo.com/v1/Account/%s/Message/',_0x145a04['authId']),'body':_0x41f8bf,'headers':{'Authorization':util['format'](_0x93d0('0x48'),new Buffer(_0x1fc005)[_0x93d0('0x49')]('base64'))},'json':!![]};rp(_0x1bba04)['then'](function(_0x492776){var _0x2eae7f={'messageId':_0x492776[_0x93d0('0x51')][0x0]};return _0x5df62d[_0x93d0('0x3f')](_0x2eae7f);})[_0x93d0('0x1b')](function(_0x4f1df5){logger[_0x93d0('0x1c')](_0x93d0('0x40'),_0x93d0('0x2d'),'plivo',util[_0x93d0('0x2e')](_0x4f1df5,{'showHidden':![],'depth':null}));});}else{logger[_0x93d0('0x1c')](_0x93d0('0x40'),_0x93d0('0x2d'),_0x93d0('0x4e'),_0x93d0('0x52'));}break;case _0x93d0('0x53'):if(_0x145a04['username']&&_0x145a04[_0x93d0('0x33')]){if(_0x145a04[_0x93d0('0x54')]){var _0x31e72a={'method':'POST','uri':_0x145a04[_0x93d0('0x54')]+_0x93d0('0x55'),'body':{'username':_0x145a04[_0x93d0('0x32')],'password':_0x145a04[_0x93d0('0x33')]},'json':!![]};return rp(_0x31e72a)['then'](function(_0x38ffd4){var _0x358026={'method':_0x93d0('0x38'),'uri':_0x145a04[_0x93d0('0x54')]+_0x93d0('0x56'),'body':{'messages':[{'from':_0x145a04[_0x93d0('0x26')],'destinations':[{'to':_0x333d21[_0x93d0('0x26')]}],'text':_0x333d21[_0x93d0('0xf')],'notifyUrl':_0x145a04[_0x93d0('0x28')]+_0x93d0('0x29')+_0x333d21['id']+_0x93d0('0x2a')+_0x145a04[_0x93d0('0x2b')],'notifyContentType':_0x93d0('0x57'),'callbackData':_0x145a04['phone']+';'+_0x333d21[_0x93d0('0xf')]}]},'headers':{'Authorization':_0x93d0('0x58')+_0x38ffd4['token']},'json':!![]};return rp(_0x358026)[_0x93d0('0x19')](function(_0x14045f){if(_0x14045f[_0x93d0('0x27')]){var _0x116b27={'messageId':_0x14045f[_0x93d0('0x27')][0x0][_0x93d0('0xd')]};if(!_0x145a04[_0x93d0('0x3d')]){_0x116b27[_0x93d0('0x3e')]=!![];}return _0x5df62d[_0x93d0('0x3f')](_0x116b27);}else{return logger[_0x93d0('0x1c')](_0x93d0('0x40'),'afterCreate',_0x93d0('0x53'),util[_0x93d0('0x2e')](_0x14045f,{'showHidden':![],'depth':null}));}});})[_0x93d0('0x1b')](function(_0x32629b){return logger['error'](_0x93d0('0x40'),'afterCreate','infobip',util[_0x93d0('0x2e')](_0x32629b,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x93d0('0x40'),_0x93d0('0x2d'),'infobip',_0x93d0('0x59'));}}else{logger[_0x93d0('0x1c')](_0x93d0('0x40'),'afterCreate',_0x93d0('0x53'),_0x93d0('0x41'));}break;case _0x93d0('0x5a'):var _0x43e786=require('crypto');if(_0x145a04[_0x93d0('0x5b')]){var _0x7bbdec={};_0x7bbdec[_0x93d0('0x5c')]=_0x145a04[_0x93d0('0x32')];_0x7bbdec[_0x93d0('0x26')]=_0x333d21['phone'];_0x7bbdec['sender']=_0x145a04[_0x93d0('0x26')];_0x7bbdec['text']=_0x333d21[_0x93d0('0xf')];_0x7bbdec['timestamp']=+new Date();var _0x43fe2b='';var _0x274316='';var _0x3a0a61=Object[_0x93d0('0x5d')](_0x7bbdec);_0x3a0a61[_0x93d0('0x5e')]();for(var _0x1a5be5=0x0;_0x1a5be5<_0x3a0a61[_0x93d0('0x5f')];_0x1a5be5++){if(_0x43fe2b!=''){_0x43fe2b+='&';}_0x43fe2b+=_0x3a0a61[_0x1a5be5]+'='+encodeURIComponent(_0x7bbdec[_0x3a0a61[_0x1a5be5]]);_0x274316+=_0x7bbdec[_0x3a0a61[_0x1a5be5]];}_0x274316+=_0x145a04[_0x93d0('0x5b')];_0x274316=_0x43e786[_0x93d0('0x60')](_0x93d0('0x61'))[_0x93d0('0x3f')](_0x274316)[_0x93d0('0x62')](_0x93d0('0x63'));if(_0x43fe2b!==''){_0x43fe2b+='&';}_0x43fe2b+=_0x93d0('0x64')+_0x274316;var _0x303c5b={'method':_0x93d0('0x65'),'uri':_0x145a04[_0x93d0('0x54')]+_0x93d0('0x66')+_0x43fe2b,'json':!![]};return rp(_0x303c5b)[_0x93d0('0x19')](function(_0x8d667c){var _0x3310a5=Object[_0x93d0('0x5d')](_0x8d667c);if(_0x8d667c[_0x3310a5[0x0]][_0x93d0('0x1c')]&&parseInt(_0x8d667c[_0x3310a5[0x0]]['error'])===0x0){var _0x1e830e={'messageId':_0x8d667c[_0x3310a5[0x0]][_0x93d0('0x67')]};if(!_0x145a04[_0x93d0('0x3d')]){_0x1e830e[_0x93d0('0x3e')]=!![];}return _0x5df62d['update'](_0x1e830e);}else{return logger[_0x93d0('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','csc',util[_0x93d0('0x2e')](_0x8d667c[_0x93d0('0x1c')],{'showHidden':![],'depth':null}));}})[_0x93d0('0x1b')](function(_0x4d8638){return logger[_0x93d0('0x1c')](_0x93d0('0x40'),_0x93d0('0x2d'),_0x93d0('0x5a'),util[_0x93d0('0x2e')](_0x4d8638,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x93d0('0x40'),_0x93d0('0x2d'),_0x93d0('0x5a'),_0x93d0('0x68'));}break;case'clickatell':if(_0x145a04[_0x93d0('0x5b')]){var _0x4991a3={'method':'POST','uri':_0x93d0('0x69'),'headers':{'Authorization':_0x145a04['apiKey']},'body':{'content':_0x333d21[_0x93d0('0xf')],'to':[_0x333d21[_0x93d0('0x26')]],'from':_0x145a04[_0x93d0('0x26')],'binary':![],'clientMessageId':_0x93d0('0x6a'),'charset':'UTF-8'},'json':!![]};rp(_0x4991a3)[_0x93d0('0x19')](function(_0x45147a){if(!_0x45147a[_0x93d0('0x1c')]){var _0x46ed6c={'messageId':_0x45147a[_0x93d0('0x27')][0x0][_0x93d0('0x6b')]};if(!_0x145a04[_0x93d0('0x3d')]){_0x46ed6c[_0x93d0('0x3e')]=!![];}return _0x5df62d[_0x93d0('0x3f')](_0x46ed6c);}else{return logger['error'](_0x93d0('0x40'),_0x93d0('0x2d'),_0x93d0('0x6c'),util['inspect'](_0x45147a[_0x93d0('0x1c')],{'showHidden':![],'depth':null}));}})['catch'](function(_0xc4cf4b){return logger[_0x93d0('0x1c')](_0x93d0('0x40'),_0x93d0('0x2d'),_0x93d0('0x6c'),util[_0x93d0('0x2e')](_0xc4cf4b,{'showHidden':![],'depth':null}));});}else{logger[_0x93d0('0x1c')](_0x93d0('0x40'),'afterCreate',_0x93d0('0x6c'),'Missing\x20parameters:\x20apiKey');}break;case _0x93d0('0x6d'):if(_0x145a04['apiKey']){var _0x441c3b={};var _0x303c5b={'method':_0x93d0('0x38'),'uri':_0x93d0('0x6e'),'headers':{'Authorization':_0x93d0('0x6f')+_0x145a04[_0x93d0('0x5b')],'Content-Type':_0x93d0('0x57')},'body':{'from':_0x145a04[_0x93d0('0x26')],'to':_0x333d21[_0x93d0('0x26')],'text':_0x333d21[_0x93d0('0xf')]},'json':!![]};return rp(_0x303c5b)[_0x93d0('0x19')](function(_0xd9ecee){if(_0xd9ecee['code']==0xca){_0x441c3b[_0x93d0('0x70')]=_0xd9ecee;var _0x379b4a={'method':_0x93d0('0x38'),'uri':_0x93d0('0x71'),'headers':{'Authorization':_0x93d0('0x6f')+_0x145a04[_0x93d0('0x5b')],'Content-Type':_0x93d0('0x57')},'body':{'refid':_0x441c3b[_0x93d0('0x70')]['refid']},'json':!![]};return rp(_0x379b4a)[_0x93d0('0x19')](function(_0x2832a0){_0x441c3b[_0x93d0('0x72')]=_0x2832a0;var _0xb27ffa={'messageId':_0x441c3b['message'][_0x93d0('0x73')],'read':!![]};return _0x5df62d[_0x93d0('0x3f')](_0xb27ffa);});}else{return logger['error'](_0x93d0('0x40'),_0x93d0('0x2d'),_0x93d0('0x6d'),util[_0x93d0('0x2e')](_0xd9ecee,{'showHidden':![],'depth':null}));}})[_0x93d0('0x1b')](function(_0x5e4f22){return logger[_0x93d0('0x1c')](_0x93d0('0x40'),'afterCreate',_0x93d0('0x6d'),util[_0x93d0('0x2e')](_0x5e4f22,{'showHidden':![],'depth':null}));});}else{return logger[_0x93d0('0x1c')](_0x93d0('0x40'),_0x93d0('0x2d'),_0x93d0('0x6d'),'Token\x20not\x20received');}break;}}})[_0x93d0('0x74')](function(){_0x23c5f0();});}else{_0x23c5f0();}}},'charset':_0x93d0('0x75'),'collate':_0x93d0('0x76')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 7093e16..a2562f3 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 _0x5eb8=['client','http','defaults','redis','localhost','register','request','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','SmsMessage,\x20%s,\x20%s','message','result','catch','options','raw','then','stringify','CreateSmsMessage','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xeb5cde,_0x45575b){var _0x32f7c0=function(_0x3fd598){while(--_0x3fd598){_0xeb5cde['push'](_0xeb5cde['shift']());}};_0x32f7c0(++_0x45575b);}(_0x5eb8,0xb0));var _0x85eb=function(_0x12309b,_0x59dd8c){_0x12309b=_0x12309b-0x0;var _0x482e4d=_0x5eb8[_0x12309b];return _0x482e4d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x85eb('0x0'));var BPromise=require(_0x85eb('0x1'));var rs=require(_0x85eb('0x2'));var fs=require('fs');var Redis=require(_0x85eb('0x3'));var db=require(_0x85eb('0x4'))['db'];var utils=require(_0x85eb('0x5'));var logger=require(_0x85eb('0x6'))(_0x85eb('0x7'));var config=require(_0x85eb('0x8'));var jayson=require(_0x85eb('0x9'));var client=jayson[_0x85eb('0xa')][_0x85eb('0xb')]({'port':0x232a});config['redis']=_[_0x85eb('0xc')](config[_0x85eb('0xd')],{'host':_0x85eb('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x85eb('0xd')]));require('./smsMessage.socket')[_0x85eb('0xf')](socket);function respondWithRpcPromise(_0x40d6b6,_0x673228,_0x29030b){return new BPromise(function(_0x1dacf2,_0x73e6d0){return client[_0x85eb('0x10')](_0x40d6b6,_0x29030b)['then'](function(_0x163f32){logger[_0x85eb('0x11')]('SmsMessage,\x20%s,\x20%s',_0x673228,_0x85eb('0x12'));logger[_0x85eb('0x13')](_0x85eb('0x14'),_0x673228,_0x85eb('0x12'),JSON['stringify'](_0x163f32));if(_0x163f32['error']){if(_0x163f32[_0x85eb('0x15')]['code']===0x1f4){logger[_0x85eb('0x15')](_0x85eb('0x16'),_0x673228,_0x163f32[_0x85eb('0x15')][_0x85eb('0x17')]);return _0x73e6d0(_0x163f32[_0x85eb('0x15')]['message']);}logger[_0x85eb('0x15')]('SmsMessage,\x20%s,\x20%s',_0x673228,_0x163f32[_0x85eb('0x15')][_0x85eb('0x17')]);return _0x1dacf2(_0x163f32[_0x85eb('0x15')][_0x85eb('0x17')]);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x673228,'request\x20sent');_0x1dacf2(_0x163f32[_0x85eb('0x18')][_0x85eb('0x17')]);}})[_0x85eb('0x19')](function(_0x2e986c){logger[_0x85eb('0x15')](_0x85eb('0x16'),_0x673228,_0x2e986c);_0x73e6d0(_0x2e986c);});});}exports['CreateSmsMessage']=function(_0x24cf28){var _0x7244fc=this;return new Promise(function(_0xd9f06d,_0x4e8041){return db['SmsMessage']['create'](_0x24cf28['body'],{'raw':_0x24cf28[_0x85eb('0x1a')]?_0x24cf28[_0x85eb('0x1a')][_0x85eb('0x1b')]===undefined?!![]:![]:!![]})[_0x85eb('0x1c')](function(_0x465c74){logger[_0x85eb('0x11')]('CreateSmsMessage',_0x24cf28);logger['debug']('CreateSmsMessage',_0x24cf28,JSON[_0x85eb('0x1d')](_0x465c74));_0xd9f06d(_0x465c74);})[_0x85eb('0x19')](function(_0x3f7a4d){logger[_0x85eb('0x15')](_0x85eb('0x1e'),_0x3f7a4d[_0x85eb('0x17')],_0x24cf28);_0x4e8041(_0x7244fc['error'](0x1f4,_0x3f7a4d[_0x85eb('0x17')]));});});}; \ No newline at end of file +var _0x5f2f=['SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','SmsMessage','create','options','raw','CreateSmsMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xdc05fb,_0x207fc2){var _0x1b45e8=function(_0x4a3798){while(--_0x4a3798){_0xdc05fb['push'](_0xdc05fb['shift']());}};_0x1b45e8(++_0x207fc2);}(_0x5f2f,0x73));var _0xf5f2=function(_0x577f6f,_0x224a15){_0x577f6f=_0x577f6f-0x0;var _0xf19faa=_0x5f2f[_0x577f6f];return _0xf19faa;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});config[_0xf5f2('0xc')]=_[_0xf5f2('0xd')](config['redis'],{'host':_0xf5f2('0xe'),'port':0x18eb});var socket=require(_0xf5f2('0xf'))(new Redis(config[_0xf5f2('0xc')]));require('./smsMessage.socket')[_0xf5f2('0x10')](socket);function respondWithRpcPromise(_0x15dd7c,_0x218ae3,_0x4e0e6b){return new BPromise(function(_0x977a59,_0x4ebbbe){return client['request'](_0x15dd7c,_0x4e0e6b)[_0xf5f2('0x11')](function(_0x151aba){logger['info'](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));logger[_0xf5f2('0x14')](_0xf5f2('0x15'),_0x218ae3,_0xf5f2('0x13'),JSON[_0xf5f2('0x16')](_0x151aba));if(_0x151aba['error']){if(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x18')]===0x1f4){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')]['message']);return _0x4ebbbe(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);return _0x977a59(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}else{logger[_0xf5f2('0x1a')](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));_0x977a59(_0x151aba[_0xf5f2('0x1b')][_0xf5f2('0x19')]);}})[_0xf5f2('0x1c')](function(_0x3cf5ea){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x3cf5ea);_0x4ebbbe(_0x3cf5ea);});});}exports['CreateSmsMessage']=function(_0x34706d){var _0x47101e=this;return new Promise(function(_0x49dac2,_0x47acfc){return db[_0xf5f2('0x1d')][_0xf5f2('0x1e')](_0x34706d['body'],{'raw':_0x34706d[_0xf5f2('0x1f')]?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x20')]===undefined?!![]:![]:!![]})[_0xf5f2('0x11')](function(_0x36f1cb){logger['info'](_0xf5f2('0x21'),_0x34706d);logger[_0xf5f2('0x14')](_0xf5f2('0x21'),_0x34706d,JSON[_0xf5f2('0x16')](_0x36f1cb));_0x49dac2(_0x36f1cb);})[_0xf5f2('0x1c')](function(_0x5bdf4a){logger['error'](_0xf5f2('0x21'),_0x5bdf4a[_0xf5f2('0x19')],_0x34706d);_0x47acfc(_0x47101e[_0xf5f2('0x17')](0x1f4,_0x5bdf4a[_0xf5f2('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 6f57680..67179b4 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 _0x82b7=['smsMessage:','./smsMessage.events','save','remove','update','removeListener','register','length'];(function(_0x2abda9,_0xa273d3){var _0x56b2ae=function(_0x5d726c){while(--_0x5d726c){_0x2abda9['push'](_0x2abda9['shift']());}};_0x56b2ae(++_0xa273d3);}(_0x82b7,0x1d9));var _0x782b=function(_0x5acbbd,_0x24db99){_0x5acbbd=_0x5acbbd-0x0;var _0x47fa14=_0x82b7[_0x5acbbd];return _0x47fa14;};'use strict';var SmsMessageEvents=require(_0x782b('0x0'));var events=[_0x782b('0x1'),_0x782b('0x2'),_0x782b('0x3')];function createListener(_0x450b84,_0x461086){return function(_0x1dca80){_0x461086['emit'](_0x450b84,_0x1dca80);};}function removeListener(_0x7bab0d,_0x26dd87){return function(){SmsMessageEvents[_0x782b('0x4')](_0x7bab0d,_0x26dd87);};}exports[_0x782b('0x5')]=function(_0x5a6c0d){for(var _0x3a5431=0x0,_0x3ac63f=events[_0x782b('0x6')];_0x3a5431<_0x3ac63f;_0x3a5431++){var _0x31073d=events[_0x3a5431];var _0x1ca99a=createListener(_0x782b('0x7')+_0x31073d,_0x5a6c0d);SmsMessageEvents['on'](_0x31073d,_0x1ca99a);}}; \ No newline at end of file +var _0xdaf6=['remove','update','removeListener','register','length','smsMessage:','./smsMessage.events','save'];(function(_0x8854f2,_0x79542c){var _0x38505d=function(_0x5af02b){while(--_0x5af02b){_0x8854f2['push'](_0x8854f2['shift']());}};_0x38505d(++_0x79542c);}(_0xdaf6,0x7e));var _0x6daf=function(_0x4f66c2,_0x47d4ed){_0x4f66c2=_0x4f66c2-0x0;var _0x447633=_0xdaf6[_0x4f66c2];return _0x447633;};'use strict';var SmsMessageEvents=require(_0x6daf('0x0'));var events=[_0x6daf('0x1'),_0x6daf('0x2'),_0x6daf('0x3')];function createListener(_0x249089,_0x1492c9){return function(_0x3b979f){_0x1492c9['emit'](_0x249089,_0x3b979f);};}function removeListener(_0x2eec00,_0x580e0c){return function(){SmsMessageEvents[_0x6daf('0x4')](_0x2eec00,_0x580e0c);};}exports[_0x6daf('0x5')]=function(_0xcfc70e){for(var _0x5833a4=0x0,_0x4e8251=events[_0x6daf('0x6')];_0x5833a4<_0x4e8251;_0x5833a4++){var _0x5e1ccb=events[_0x5833a4];var _0x89435e=createListener(_0x6daf('0x7')+_0x5e1ccb,_0xcfc70e);SmsMessageEvents['on'](_0x5e1ccb,_0x89435e);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 604f543..53f0c42 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 _0xf2e0=['post','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','create'];(function(_0x133842,_0x273005){var _0x3824da=function(_0x5344e9){while(--_0x5344e9){_0x133842['push'](_0x133842['shift']());}};_0x3824da(++_0x273005);}(_0xf2e0,0xc7));var _0x0f2e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xf2e0[_0xbb091];return _0x467a04;};'use strict';var multer=require(_0x0f2e('0x0'));var util=require(_0x0f2e('0x1'));var path=require('path');var timeout=require(_0x0f2e('0x2'));var express=require(_0x0f2e('0x3'));var router=express['Router']();var auth=require(_0x0f2e('0x4'));var interaction=require(_0x0f2e('0x5'));var config=require(_0x0f2e('0x6'));var controller=require('./smsQueue.controller');router[_0x0f2e('0x7')]('/',auth[_0x0f2e('0x8')](),controller[_0x0f2e('0x9')]);router['get']('/describe',auth[_0x0f2e('0x8')](),controller['describe']);router[_0x0f2e('0x7')](_0x0f2e('0xa'),auth[_0x0f2e('0x8')](),controller['show']);router[_0x0f2e('0x7')](_0x0f2e('0xb'),auth[_0x0f2e('0x8')](),controller['getMembers']);router[_0x0f2e('0x7')](_0x0f2e('0xc'),auth['isAuthenticated'](),controller[_0x0f2e('0xd')]);router[_0x0f2e('0x7')](_0x0f2e('0xe'),auth[_0x0f2e('0x8')](),controller[_0x0f2e('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0f2e('0x10')]);router[_0x0f2e('0x11')](_0x0f2e('0xc'),auth[_0x0f2e('0x8')](),controller[_0x0f2e('0x12')]);router[_0x0f2e('0x11')](_0x0f2e('0xe'),auth[_0x0f2e('0x8')](),controller[_0x0f2e('0x13')]);router[_0x0f2e('0x14')](_0x0f2e('0xa'),auth[_0x0f2e('0x8')](),controller[_0x0f2e('0x15')]);router[_0x0f2e('0x16')](_0x0f2e('0xa'),auth[_0x0f2e('0x8')](),controller[_0x0f2e('0x17')]);router[_0x0f2e('0x16')](_0x0f2e('0xc'),auth['isAuthenticated'](),controller[_0x0f2e('0x18')]);router[_0x0f2e('0x16')](_0x0f2e('0xe'),auth['isAuthenticated'](),controller[_0x0f2e('0x19')]);module[_0x0f2e('0x1a')]=router; \ No newline at end of file +var _0x31c2=['delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update'];(function(_0x5e52f5,_0x1e2674){var _0xfc3428=function(_0x4c1f46){while(--_0x4c1f46){_0x5e52f5['push'](_0x5e52f5['shift']());}};_0xfc3428(++_0x1e2674);}(_0x31c2,0x1e1));var _0x231c=function(_0x4edf95,_0x2eca29){_0x4edf95=_0x4edf95-0x0;var _0x597783=_0x31c2[_0x4edf95];return _0x597783;};'use strict';var multer=require(_0x231c('0x0'));var util=require(_0x231c('0x1'));var path=require(_0x231c('0x2'));var timeout=require(_0x231c('0x3'));var express=require(_0x231c('0x4'));var router=express[_0x231c('0x5')]();var auth=require(_0x231c('0x6'));var interaction=require(_0x231c('0x7'));var config=require('../../config/environment');var controller=require('./smsQueue.controller');router[_0x231c('0x8')]('/',auth[_0x231c('0x9')](),controller[_0x231c('0xa')]);router[_0x231c('0x8')]('/describe',auth[_0x231c('0x9')](),controller['describe']);router[_0x231c('0x8')](_0x231c('0xb'),auth[_0x231c('0x9')](),controller['show']);router[_0x231c('0x8')](_0x231c('0xc'),auth[_0x231c('0x9')](),controller[_0x231c('0xd')]);router[_0x231c('0x8')](_0x231c('0xe'),auth[_0x231c('0x9')](),controller['getTeams']);router[_0x231c('0x8')](_0x231c('0xf'),auth['isAuthenticated'](),controller[_0x231c('0x10')]);router[_0x231c('0x11')]('/',auth[_0x231c('0x9')](),controller[_0x231c('0x12')]);router[_0x231c('0x11')](_0x231c('0xe'),auth[_0x231c('0x9')](),controller[_0x231c('0x13')]);router[_0x231c('0x11')](_0x231c('0xf'),auth[_0x231c('0x9')](),controller[_0x231c('0x14')]);router[_0x231c('0x15')](_0x231c('0xb'),auth[_0x231c('0x9')](),controller[_0x231c('0x16')]);router[_0x231c('0x17')](_0x231c('0xb'),auth[_0x231c('0x9')](),controller[_0x231c('0x18')]);router['delete'](_0x231c('0xe'),auth[_0x231c('0x9')](),controller[_0x231c('0x19')]);router[_0x231c('0x17')](_0x231c('0xf'),auth[_0x231c('0x9')](),controller[_0x231c('0x1a')]);module[_0x231c('0x1b')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index e67ef1a..1d79b5a 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 _0xb1e8=['name','STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0xb1e8,0x1cf));var _0x8b1e=function(_0x105a8a,_0x15a3a2){_0x105a8a=_0x105a8a-0x0;var _0x105a0e=_0xb1e8[_0x105a8a];return _0x105a0e;};'use strict';var Sequelize=require(_0x8b1e('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x8b1e('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8b1e('0x2')]},'timeout':{'type':Sequelize[_0x8b1e('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8b1e('0x4')](_0x8b1e('0x5'),_0x8b1e('0x6'),_0x8b1e('0x7'))}}; \ No newline at end of file +var _0xc574=['STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','exports','name'];(function(_0x5a0ddd,_0x4ed495){var _0x34c7ca=function(_0x4310dd){while(--_0x4310dd){_0x5a0ddd['push'](_0x5a0ddd['shift']());}};_0x34c7ca(++_0x4ed495);}(_0xc574,0xe6));var _0x4c57=function(_0x2ca993,_0x3e7d5a){_0x2ca993=_0x2ca993-0x0;var _0x4d7ff5=_0xc574[_0x2ca993];return _0x4d7ff5;};'use strict';var Sequelize=require('sequelize');module[_0x4c57('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x4c57('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4c57('0x2')]},'timeout':{'type':Sequelize[_0x4c57('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4c57('0x4')](_0x4c57('0x5'),_0x4c57('0x6'),_0x4c57('0x7'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index b28256a..1bc6caa 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 _0x14a0=['SELECT','every','TeamId','includes','all','value','isEmpty','forEach','userSmsQueue:remove','omit','spread','removeAgents','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','squel','crypto','jsforce','querystring','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','then','destroy','get','SmsQueues','end','error','name','send','index','map','SmsQueue','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','includeAll','include','catch','show','params','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getMembers','findOne','findAll','User','findAndCountAll','UserId','agent','updatedAt','rows','%s/%s','createdAt','getTeams','addTeams','Team','Agents','online','voicePause','interface','sequelize','transaction','each','UserSmsQueue','emit','userSmsQueue:save','removeTeams','ids','select','field','tq.TeamId','team_has_sms_queues','join','clone','ut.UserId\x20=\x20?','push'];(function(_0x513047,_0x2199c5){var _0x15b779=function(_0x412fd5){while(--_0x412fd5){_0x513047['push'](_0x513047['shift']());}};_0x15b779(++_0x2199c5);}(_0x14a0,0x8e));var _0x014a=function(_0x3e1477,_0x49bf6c){_0x3e1477=_0x3e1477-0x0;var _0x2b7b62=_0x14a0[_0x3e1477];return _0x2b7b62;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x014a('0x0'));var rimraf=require(_0x014a('0x1'));var zipdir=require(_0x014a('0x2'));var jsonpatch=require(_0x014a('0x3'));var rp=require(_0x014a('0x4'));var moment=require(_0x014a('0x5'));var BPromise=require(_0x014a('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x014a('0x7'));var sox=require(_0x014a('0x8'));var csv=require(_0x014a('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x014a('0xa'));var crypto=require(_0x014a('0xb'));var jsforce=require(_0x014a('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x014a('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x014a('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x014a('0xf'))(_0x014a('0x10'));var utils=require('../../config/utils');var config=require(_0x014a('0x11'));var db=require(_0x014a('0x12'))['db'];config[_0x014a('0x13')]=_[_0x014a('0x14')](config[_0x014a('0x13')],{'host':_0x014a('0x15'),'port':0x18eb});var socket=require(_0x014a('0x16'))(new Redis(config[_0x014a('0x13')]));require(_0x014a('0x17'))[_0x014a('0x18')](socket);function respondWithStatusCode(_0x45cd80,_0x3c54c8){_0x3c54c8=_0x3c54c8||0xcc;return function(_0x4fe87c){if(_0x4fe87c){return _0x45cd80[_0x014a('0x19')](_0x3c54c8);}return _0x45cd80[_0x014a('0x1a')](_0x3c54c8)['end']();};}function respondWithResult(_0x3a836f,_0x128c46){_0x128c46=_0x128c46||0xc8;return function(_0x59a4ea){if(_0x59a4ea){return _0x3a836f[_0x014a('0x1a')](_0x128c46)[_0x014a('0x1b')](_0x59a4ea);}};}function respondWithFilteredResult(_0x20f148,_0x12da95){return function(_0x2c26ac){if(_0x2c26ac){var _0x12d339=_0x2c26ac[_0x014a('0x1c')],_0x61ec9f=_0x12da95[_0x014a('0x1d')],_0x263b07=_0x12da95[_0x014a('0x1d')]+_0x12da95[_0x014a('0x1e')],_0x16490a;if(_0x263b07>=_0x12d339){_0x263b07=_0x12d339;_0x16490a=0xc8;}else{_0x16490a=0xce;}_0x20f148[_0x014a('0x1a')](_0x16490a);return _0x20f148['set'](_0x014a('0x1f'),_0x61ec9f+'-'+_0x263b07+'/'+_0x12d339)[_0x014a('0x1b')](_0x2c26ac);}return null;};}function patchUpdates(_0x11065f){return function(_0x1897c7){try{jsonpatch[_0x014a('0x20')](_0x1897c7,_0x11065f,!![]);}catch(_0x2d7ccd){return BPromise[_0x014a('0x21')](_0x2d7ccd);}return _0x1897c7[_0x014a('0x22')]();};}function saveUpdates(_0x290b86,_0x486e66){return function(_0x3679ed){if(_0x3679ed){return _0x3679ed['update'](_0x290b86)[_0x014a('0x23')](function(_0x26718b){return _0x26718b;});}return null;};}function removeEntity(_0x44d921,_0x36d52b){return function(_0x2b3c10){if(_0x2b3c10){return _0x2b3c10[_0x014a('0x24')]()[_0x014a('0x23')](function(){var _0x453545=_0x2b3c10[_0x014a('0x25')]({'plain':!![]});var _0x4c2627=_0x014a('0x26');return db['UserProfileResource'][_0x014a('0x24')]({'where':{'type':_0x4c2627,'resourceId':_0x453545['id']}})[_0x014a('0x23')](function(){return _0x2b3c10;});})['then'](function(){_0x44d921['status'](0xcc)[_0x014a('0x27')]();});}};}function handleEntityNotFound(_0x3f9719,_0x143346){return function(_0x5ed71b){if(!_0x5ed71b){_0x3f9719[_0x014a('0x19')](0x194);}return _0x5ed71b;};}function handleError(_0x3c1fa4,_0x598179){_0x598179=_0x598179||0x1f4;return function(_0x31dc95){logger[_0x014a('0x28')](_0x31dc95['stack']);if(_0x31dc95['name']){delete _0x31dc95[_0x014a('0x29')];}_0x3c1fa4[_0x014a('0x1a')](_0x598179)[_0x014a('0x2a')](_0x31dc95);};}exports[_0x014a('0x2b')]=function(_0x4ea00c,_0x434038){var _0x147e7e={},_0x15af07={},_0x402d3b={'count':0x0,'rows':[]};var _0x2f4d20=_[_0x014a('0x2c')](db[_0x014a('0x2d')][_0x014a('0x2e')],function(_0xc802d5){return{'name':_0xc802d5[_0x014a('0x2f')],'type':_0xc802d5[_0x014a('0x30')]['key']};});_0x15af07[_0x014a('0x31')]=_[_0x014a('0x2c')](_0x2f4d20,_0x014a('0x29'));_0x15af07[_0x014a('0x32')]=_[_0x014a('0x33')](_0x4ea00c[_0x014a('0x32')]);_0x15af07[_0x014a('0x34')]=_['intersection'](_0x15af07[_0x014a('0x31')],_0x15af07[_0x014a('0x32')]);_0x147e7e['attributes']=_[_0x014a('0x35')](_0x15af07[_0x014a('0x31')],qs[_0x014a('0x36')](_0x4ea00c[_0x014a('0x32')][_0x014a('0x36')]));_0x147e7e[_0x014a('0x37')]=_0x147e7e[_0x014a('0x37')][_0x014a('0x38')]?_0x147e7e['attributes']:_0x15af07[_0x014a('0x31')];if(!_0x4ea00c[_0x014a('0x32')][_0x014a('0x39')](_0x014a('0x3a'))){_0x147e7e['limit']=qs[_0x014a('0x1e')](_0x4ea00c[_0x014a('0x32')][_0x014a('0x1e')]);_0x147e7e[_0x014a('0x1d')]=qs[_0x014a('0x1d')](_0x4ea00c[_0x014a('0x32')][_0x014a('0x1d')]);}_0x147e7e[_0x014a('0x3b')]=qs[_0x014a('0x3c')](_0x4ea00c['query'][_0x014a('0x3c')]);_0x147e7e['where']=qs[_0x014a('0x34')](_[_0x014a('0x3d')](_0x4ea00c[_0x014a('0x32')],_0x15af07[_0x014a('0x34')]));if(_0x4ea00c[_0x014a('0x32')]['filter']){_0x147e7e[_0x014a('0x3e')]=_[_0x014a('0x3f')](_0x147e7e['where'],{'$or':_[_0x014a('0x2c')](_0x2f4d20,function(_0x2990df){if(_0x2990df[_0x014a('0x30')]!==_0x014a('0x40')){var _0x3788d6={};_0x3788d6[_0x2990df[_0x014a('0x29')]]={'$like':'%'+_0x4ea00c[_0x014a('0x32')][_0x014a('0x41')]+'%'};return _0x3788d6;}})});}_0x147e7e=_[_0x014a('0x3f')]({},_0x147e7e,_0x4ea00c['options']);var _0x107f2f={'where':_0x147e7e[_0x014a('0x3e')]};return db[_0x014a('0x2d')][_0x014a('0x1c')](_0x107f2f)['then'](function(_0x227fd7){_0x402d3b[_0x014a('0x1c')]=_0x227fd7;if(_0x4ea00c[_0x014a('0x32')][_0x014a('0x42')]){_0x147e7e[_0x014a('0x43')]=[{'all':!![]}];}return db[_0x014a('0x2d')]['findAll'](_0x147e7e);})[_0x014a('0x23')](function(_0x2830e1){_0x402d3b['rows']=_0x2830e1;return _0x402d3b;})[_0x014a('0x23')](respondWithFilteredResult(_0x434038,_0x147e7e))[_0x014a('0x44')](handleError(_0x434038,null));};exports[_0x014a('0x45')]=function(_0x5dc092,_0x5bcf8){var _0x50a8f0={'raw':!![],'where':{'id':_0x5dc092[_0x014a('0x46')]['id']}},_0x5ab5e8={};_0x5ab5e8[_0x014a('0x31')]=_['keys'](db[_0x014a('0x2d')][_0x014a('0x2e')]);_0x5ab5e8[_0x014a('0x32')]=_[_0x014a('0x33')](_0x5dc092[_0x014a('0x32')]);_0x5ab5e8[_0x014a('0x34')]=_['intersection'](_0x5ab5e8[_0x014a('0x31')],_0x5ab5e8[_0x014a('0x32')]);_0x50a8f0[_0x014a('0x37')]=_['intersection'](_0x5ab5e8['model'],qs[_0x014a('0x36')](_0x5dc092['query']['fields']));_0x50a8f0[_0x014a('0x37')]=_0x50a8f0['attributes'][_0x014a('0x38')]?_0x50a8f0[_0x014a('0x37')]:_0x5ab5e8[_0x014a('0x31')];if(_0x5dc092['query'][_0x014a('0x42')]){_0x50a8f0[_0x014a('0x43')]=[{'all':!![]}];}_0x50a8f0=_[_0x014a('0x3f')]({},_0x50a8f0,_0x5dc092[_0x014a('0x47')]);return db[_0x014a('0x2d')][_0x014a('0x48')](_0x50a8f0)['then'](handleEntityNotFound(_0x5bcf8,null))[_0x014a('0x23')](respondWithResult(_0x5bcf8,null))[_0x014a('0x44')](handleError(_0x5bcf8,null));};exports['create']=function(_0x1a4df9,_0x29345b){return db[_0x014a('0x2d')][_0x014a('0x49')](_0x1a4df9[_0x014a('0x4a')],{})[_0x014a('0x23')](function(_0x437f23){var _0x21680f=_0x1a4df9['user'][_0x014a('0x25')]({'plain':!![]});if(!_0x21680f)throw new Error(_0x014a('0x4b'));if(_0x21680f[_0x014a('0x4c')]===_0x014a('0x4d')){var _0x312c7a=_0x437f23['get']({'plain':!![]});var _0x19e3c3='SmsQueues';return db[_0x014a('0x4e')][_0x014a('0x48')]({'where':{'name':_0x19e3c3,'userProfileId':_0x21680f[_0x014a('0x4f')]},'raw':!![]})[_0x014a('0x23')](function(_0x3caa6e){if(_0x3caa6e&&_0x3caa6e['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x312c7a['name'],'resourceId':_0x312c7a['id'],'type':_0x3caa6e[_0x014a('0x29')],'sectionId':_0x3caa6e['id']},{})['then'](function(){return _0x437f23;});}else{return _0x437f23;}})[_0x014a('0x44')](function(_0x5b5318){logger['error'](_0x014a('0x50'),_0x5b5318);throw _0x5b5318;});}return _0x437f23;})['then'](respondWithResult(_0x29345b,0xc9))[_0x014a('0x44')](handleError(_0x29345b,null));};exports[_0x014a('0x51')]=function(_0x400633,_0x3c7e06){if(_0x400633[_0x014a('0x4a')]['id']){delete _0x400633[_0x014a('0x4a')]['id'];}return db[_0x014a('0x2d')][_0x014a('0x48')]({'where':{'id':_0x400633[_0x014a('0x46')]['id']}})[_0x014a('0x23')](handleEntityNotFound(_0x3c7e06,null))['then'](saveUpdates(_0x400633['body'],null))[_0x014a('0x23')](respondWithResult(_0x3c7e06,null))[_0x014a('0x44')](handleError(_0x3c7e06,null));};exports[_0x014a('0x24')]=function(_0x4cc246,_0x58aa79){return db[_0x014a('0x2d')]['find']({'where':{'id':_0x4cc246[_0x014a('0x46')]['id']}})[_0x014a('0x23')](handleEntityNotFound(_0x58aa79,null))[_0x014a('0x23')](removeEntity(_0x58aa79,null))[_0x014a('0x44')](handleError(_0x58aa79,null));};exports['describe']=function(_0x861fb5,_0x2ccc2f){return db[_0x014a('0x2d')]['describe']()[_0x014a('0x23')](respondWithResult(_0x2ccc2f,null))['catch'](handleError(_0x2ccc2f,null));};exports[_0x014a('0x52')]=function(_0x47074f,_0x34736b,_0x24d433){var _0xd0334a={'raw':!![],'where':{}},_0x1a308b={},_0x4e9260;return db[_0x014a('0x2d')][_0x014a('0x53')]({'where':{'id':_0x47074f[_0x014a('0x46')]['id']}})['then'](handleEntityNotFound(_0x34736b,null))[_0x014a('0x23')](function(_0x17f9d7){if(_0x17f9d7){_0x4e9260=_0x17f9d7[_0x014a('0x25')]({'plain':!![]});_0x1a308b[_0x014a('0x31')]=_[_0x014a('0x33')](db['UserSmsQueue'][_0x014a('0x2e')]);_0x1a308b[_0x014a('0x32')]=_[_0x014a('0x33')](_0x47074f[_0x014a('0x32')]);_0x1a308b[_0x014a('0x34')]=_[_0x014a('0x35')](_0x1a308b[_0x014a('0x31')],_0x1a308b[_0x014a('0x32')]);_0xd0334a[_0x014a('0x37')]=_[_0x014a('0x35')](_0x1a308b[_0x014a('0x31')],qs[_0x014a('0x36')](_0x47074f['query'][_0x014a('0x36')]));_0xd0334a['attributes']=_0xd0334a['attributes']['length']?_0xd0334a['attributes']:_0x1a308b['model'];if(!_0x47074f[_0x014a('0x32')][_0x014a('0x39')](_0x014a('0x3a'))){_0xd0334a['limit']=qs[_0x014a('0x1e')](_0x47074f[_0x014a('0x32')][_0x014a('0x1e')]);_0xd0334a[_0x014a('0x1d')]=qs['offset'](_0x47074f['query'][_0x014a('0x1d')]);}_0xd0334a[_0x014a('0x3b')]=qs[_0x014a('0x3c')](_0x47074f[_0x014a('0x32')][_0x014a('0x3c')]);_0xd0334a[_0x014a('0x3e')]=qs[_0x014a('0x34')](_[_0x014a('0x3d')](_0x47074f[_0x014a('0x32')],_0x1a308b[_0x014a('0x34')]));_0xd0334a[_0x014a('0x3e')]['SmsQueueId']=_0x17f9d7['id'];if(_0x47074f[_0x014a('0x32')][_0x014a('0x41')]){_0xd0334a['where']=_[_0x014a('0x3f')](_0xd0334a[_0x014a('0x3e')],{'$or':_['map'](_0xd0334a[_0x014a('0x37')],function(_0x51ddea){var _0xc27657={};_0xc27657[_0x51ddea]={'$like':'%'+_0x47074f[_0x014a('0x32')][_0x014a('0x41')]+'%'};return _0xc27657;})});}_0xd0334a=_[_0x014a('0x3f')]({},_0xd0334a,_0x47074f[_0x014a('0x47')]);return db['UserSmsQueue'][_0x014a('0x54')](_0xd0334a);}})[_0x014a('0x23')](function(_0x107e1c){if(_0x107e1c){return db[_0x014a('0x55')][_0x014a('0x56')]({'where':{'id':_['map'](_0x107e1c,_0x014a('0x57')),'role':_0x014a('0x58')},'attributes':['id',_0x014a('0x29'),'smsPause',_0x014a('0x59'),'createdAt']});}})[_0x014a('0x23')](function(_0x1caefa){if(_0x1caefa){return{'count':_0x1caefa[_0x014a('0x1c')],'rows':_[_0x014a('0x2c')](_0x1caefa[_0x014a('0x5a')],function(_0x465a8e){return{'membername':_0x465a8e[_0x014a('0x29')],'UserId':_0x465a8e['id'],'queue_name':_0x4e9260['name'],'SmsQueueId':_0x4e9260['id'],'interface':util['format'](_0x014a('0x5b'),'SIP',_0x465a8e[_0x014a('0x29')]),'penalty':0x0,'paused':_0x465a8e['smsPause'],'createdAt':_0x465a8e[_0x014a('0x5c')],'updatedAt':_0x465a8e[_0x014a('0x59')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x34736b,_0xd0334a))['catch'](handleError(_0x34736b,null));};exports[_0x014a('0x5d')]=function(_0x8234ee,_0x5f391d,_0x882fc9){var _0x42e4e9={};var _0x5635fc={};var _0x4a1b65;var _0x8e0688;return db[_0x014a('0x2d')][_0x014a('0x53')]({'where':{'id':_0x8234ee[_0x014a('0x46')]['id']}})[_0x014a('0x23')](handleEntityNotFound(_0x5f391d,null))[_0x014a('0x23')](function(_0x51ab4a){if(_0x51ab4a){_0x4a1b65=_0x51ab4a;_0x5635fc[_0x014a('0x31')]=_['keys'](db['Team'][_0x014a('0x2e')]);_0x5635fc[_0x014a('0x32')]=_['keys'](_0x8234ee[_0x014a('0x32')]);_0x5635fc[_0x014a('0x34')]=_[_0x014a('0x35')](_0x5635fc[_0x014a('0x31')],_0x5635fc[_0x014a('0x32')]);_0x42e4e9['attributes']=_[_0x014a('0x35')](_0x5635fc[_0x014a('0x31')],qs[_0x014a('0x36')](_0x8234ee[_0x014a('0x32')]['fields']));_0x42e4e9[_0x014a('0x37')]=_0x42e4e9['attributes'][_0x014a('0x38')]?_0x42e4e9[_0x014a('0x37')]:_0x5635fc[_0x014a('0x31')];_0x42e4e9[_0x014a('0x3b')]=qs[_0x014a('0x3c')](_0x8234ee[_0x014a('0x32')]['sort']);_0x42e4e9[_0x014a('0x3e')]=qs[_0x014a('0x34')](_[_0x014a('0x3d')](_0x8234ee[_0x014a('0x32')],_0x5635fc[_0x014a('0x34')]));if(_0x8234ee[_0x014a('0x32')][_0x014a('0x41')]){_0x42e4e9[_0x014a('0x3e')]=_['merge'](_0x42e4e9[_0x014a('0x3e')],{'$or':_[_0x014a('0x2c')](_0x42e4e9[_0x014a('0x37')],function(_0x5edacf){var _0x2fbaf3={};_0x2fbaf3[_0x5edacf]={'$like':'%'+_0x8234ee[_0x014a('0x32')][_0x014a('0x41')]+'%'};return _0x2fbaf3;})});}_0x42e4e9=_[_0x014a('0x3f')]({},_0x42e4e9,_0x8234ee[_0x014a('0x47')]);return _0x4a1b65[_0x014a('0x5d')](_0x42e4e9);}})[_0x014a('0x23')](function(_0x48cec1){if(_0x48cec1){_0x8e0688=_0x48cec1['length'];if(!_0x8234ee['query']['hasOwnProperty'](_0x014a('0x3a'))){_0x42e4e9[_0x014a('0x1e')]=qs[_0x014a('0x1e')](_0x8234ee[_0x014a('0x32')][_0x014a('0x1e')]);_0x42e4e9[_0x014a('0x1d')]=qs[_0x014a('0x1d')](_0x8234ee['query'][_0x014a('0x1d')]);}return _0x4a1b65[_0x014a('0x5d')](_0x42e4e9);}})[_0x014a('0x23')](function(_0x28a8ec){if(_0x28a8ec){return _0x28a8ec?{'count':_0x8e0688,'rows':_0x28a8ec}:null;}})['then'](respondWithResult(_0x5f391d,null))['catch'](handleError(_0x5f391d,null));};exports[_0x014a('0x5e')]=function(_0x36ca98,_0x519798,_0x4aea1d){var _0x9aa04b=_0x36ca98['body']['ids'];return db[_0x014a('0x5f')][_0x014a('0x54')]({'where':{'id':_0x9aa04b},'attributes':['id'],'include':[{'model':db['User'],'as':_0x014a('0x60'),'attributes':['id',_0x014a('0x29'),_0x014a('0x61'),_0x014a('0x62'),_0x014a('0x63')],'raw':!![]}]})[_0x014a('0x23')](function(_0x13a545){if(_0x13a545){var _0xc86f44=_['flatMap'](_0x13a545,function(_0x5bae68){var _0x28dc6f=_0x5bae68['get']({'plain':!![]});return _0x28dc6f['Agents'];});return db['SmsQueue'][_0x014a('0x48')]({'where':{'id':_0x36ca98[_0x014a('0x46')]['id']}})[_0x014a('0x23')](function(_0x55408f){return db[_0x014a('0x64')][_0x014a('0x65')](function(_0x30e89b){return _0x55408f[_0x014a('0x5e')](_0x9aa04b,{'transaction':_0x30e89b})['then'](function(){return BPromise[_0x014a('0x66')](_0xc86f44,function(_0x3fa661){return db[_0x014a('0x67')]['findOrCreate']({'where':{'UserId':_0x3fa661['id'],'SmsQueueId':_0x36ca98[_0x014a('0x46')]['id']},'transaction':_0x30e89b});});})[_0x014a('0x23')](function(){_0xc86f44['forEach'](function(_0x3bdb8c){socket[_0x014a('0x68')](_0x014a('0x69'),{'UserId':_0x3bdb8c['id'],'SmsQueueId':_0x55408f['id']});});});});});}})['then'](respondWithStatusCode(_0x519798,null))[_0x014a('0x44')](handleError(_0x519798,null));};exports[_0x014a('0x6a')]=function(_0x53c335,_0x1e096b,_0x293221){return db[_0x014a('0x5f')][_0x014a('0x54')]({'where':{'id':_0x53c335[_0x014a('0x32')][_0x014a('0x6b')]},'attributes':['id'],'include':[{'model':db[_0x014a('0x55')],'as':_0x014a('0x60'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1e096b,null))[_0x014a('0x23')](function(_0x1806d0){var _0x50fa83=_['map'](_0x1806d0,'id');var _0x30d141=[];var _0x45a093=[];var _0x47f3c7=squel[_0x014a('0x6c')]();_0x47f3c7[_0x014a('0x6d')](_0x014a('0x6e'))['from'](_0x014a('0x6f'),'tq')[_0x014a('0x70')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x014a('0x3e')]('SmsQueueId\x20=\x20?',_0x53c335[_0x014a('0x46')]['id']);for(var _0x4f0929=0x0;_0x4f0929<_0x1806d0[_0x014a('0x38')];_0x4f0929+=0x1){let _0x25f4ef=_0x1806d0[_0x4f0929];for(var _0xda07b5=0x0;_0xda07b5<_0x25f4ef[_0x014a('0x60')][_0x014a('0x38')];_0xda07b5+=0x1){let _0x56cf6f=_0x25f4ef[_0x014a('0x60')][_0xda07b5];var _0xc07c07=_0x47f3c7[_0x014a('0x71')]();_0xc07c07[_0x014a('0x3e')](_0x014a('0x72'),_0x56cf6f['id']);_0x45a093[_0x014a('0x73')](db[_0x014a('0x64')][_0x014a('0x32')](_0xc07c07['toString'](),{'type':db[_0x014a('0x64')]['QueryTypes'][_0x014a('0x74')]})['then'](function(_0x48e5f9){if(_0x48e5f9['length']===0x1){return _0x56cf6f['id'];}else{var _0x4e10c2=_[_0x014a('0x75')](_[_0x014a('0x2c')](_0x48e5f9,_0x014a('0x76')),function(_0x2612f7){return _[_0x014a('0x77')](_0x50fa83,_0x2612f7);});if(_0x4e10c2){return _0x56cf6f['id'];}}}));}}return BPromise[_0x014a('0x78')](_0x45a093)[_0x014a('0x23')](function(_0x270208){_0x30d141=_(_0x30d141)['union'](_0x270208)['compact']()[_0x014a('0x79')]();return db[_0x014a('0x2d')][_0x014a('0x48')]({'where':{'id':_0x53c335[_0x014a('0x46')]['id']}})[_0x014a('0x23')](function(_0x19a0f4){return db[_0x014a('0x64')][_0x014a('0x65')](function(_0x5342cc){return _0x19a0f4[_0x014a('0x6a')](_0x53c335[_0x014a('0x32')][_0x014a('0x6b')],{'transaction':_0x5342cc})[_0x014a('0x23')](function(){if(!_[_0x014a('0x7a')](_0x30d141)){return _0x19a0f4['removeAgents'](_0x30d141,{'transaction':_0x5342cc});}})[_0x014a('0x23')](function(){_0x30d141[_0x014a('0x7b')](function(_0x2b9496){socket[_0x014a('0x68')](_0x014a('0x7c'),{'UserId':_0x2b9496,'SmsQueueId':_0x19a0f4['id']});});});});});});})[_0x014a('0x23')](respondWithStatusCode(_0x1e096b,null))[_0x014a('0x44')](handleError(_0x1e096b,null));};exports['addAgents']=function(_0x421c64,_0x5a83ab,_0x51530b){return db[_0x014a('0x2d')][_0x014a('0x48')]({'where':{'id':_0x421c64['params']['id']}})[_0x014a('0x23')](handleEntityNotFound(_0x5a83ab,null))[_0x014a('0x23')](function(_0x10ceb0){if(_0x10ceb0){return _0x10ceb0['addAgents'](_0x421c64[_0x014a('0x4a')][_0x014a('0x6b')],_[_0x014a('0x7d')](_0x421c64[_0x014a('0x4a')],[_0x014a('0x6b'),'id'])||{})[_0x014a('0x7e')](function(_0x13c2b2){for(var _0x327b07=0x0;_0x327b07<_0x421c64[_0x014a('0x4a')]['ids']['length'];_0x327b07+=0x1){socket[_0x014a('0x68')](_0x014a('0x69'),{'UserId':_0x421c64[_0x014a('0x4a')]['ids'][_0x327b07],'SmsQueueId':_0x421c64[_0x014a('0x46')]['id']});}return _0x13c2b2;});}})[_0x014a('0x23')](respondWithResult(_0x5a83ab,null))[_0x014a('0x44')](handleError(_0x5a83ab,null));};exports[_0x014a('0x7f')]=function(_0x49997,_0x2888a0,_0x47af31){return db[_0x014a('0x2d')][_0x014a('0x48')]({'where':{'id':_0x49997[_0x014a('0x46')]['id']}})[_0x014a('0x23')](handleEntityNotFound(_0x2888a0,null))['then'](function(_0x6ee9ac){if(_0x6ee9ac){return _0x6ee9ac[_0x014a('0x7f')](_0x49997[_0x014a('0x32')][_0x014a('0x6b')])[_0x014a('0x23')](function(){if(_['isArray'](_0x49997[_0x014a('0x32')]['ids'])){for(var _0x57f33e=0x0;_0x57f33e<_0x49997[_0x014a('0x32')][_0x014a('0x6b')][_0x014a('0x38')];_0x57f33e+=0x1){socket[_0x014a('0x68')](_0x014a('0x7c'),{'UserId':Number(_0x49997[_0x014a('0x32')][_0x014a('0x6b')][_0x57f33e]),'SmsQueueId':Number(_0x49997[_0x014a('0x46')]['id'])});}}else{socket[_0x014a('0x68')](_0x014a('0x7c'),{'UserId':Number(_0x49997[_0x014a('0x32')][_0x014a('0x6b')]),'SmsQueueId':Number(_0x49997[_0x014a('0x46')]['id'])});}});}})[_0x014a('0x23')](respondWithStatusCode(_0x2888a0,null))[_0x014a('0x44')](handleError(_0x2888a0,null));};exports[_0x014a('0x80')]=function(_0x54fc19,_0x1a4e1f,_0x27d1db){var _0x3c03ac={};var _0x4ab9d6={};var _0x4495c1;var _0x2e2360;return db[_0x014a('0x2d')][_0x014a('0x53')]({'where':{'id':_0x54fc19[_0x014a('0x46')]['id']}})[_0x014a('0x23')](handleEntityNotFound(_0x1a4e1f,null))[_0x014a('0x23')](function(_0x10adef){if(_0x10adef){_0x4495c1=_0x10adef;_0x4ab9d6[_0x014a('0x31')]=_['keys'](db[_0x014a('0x55')][_0x014a('0x2e')]);_0x4ab9d6[_0x014a('0x32')]=_[_0x014a('0x33')](_0x54fc19['query']);_0x4ab9d6[_0x014a('0x34')]=_['intersection'](_0x4ab9d6['model'],_0x4ab9d6[_0x014a('0x32')]);_0x3c03ac['attributes']=_[_0x014a('0x35')](_0x4ab9d6[_0x014a('0x31')],qs['fields'](_0x54fc19[_0x014a('0x32')]['fields']));_0x3c03ac[_0x014a('0x37')]=_0x3c03ac[_0x014a('0x37')]['length']?_0x3c03ac[_0x014a('0x37')]:_0x4ab9d6[_0x014a('0x31')];_0x3c03ac['order']=qs[_0x014a('0x3c')](_0x54fc19[_0x014a('0x32')][_0x014a('0x3c')]);_0x3c03ac[_0x014a('0x3e')]=qs[_0x014a('0x34')](_[_0x014a('0x3d')](_0x54fc19[_0x014a('0x32')],_0x4ab9d6[_0x014a('0x34')]));if(_0x54fc19[_0x014a('0x32')][_0x014a('0x41')]){_0x3c03ac[_0x014a('0x3e')]=_[_0x014a('0x3f')](_0x3c03ac['where'],{'$or':_[_0x014a('0x2c')](_0x3c03ac[_0x014a('0x37')],function(_0x3d8d34){var _0x5a7f33={};_0x5a7f33[_0x3d8d34]={'$like':'%'+_0x54fc19[_0x014a('0x32')][_0x014a('0x41')]+'%'};return _0x5a7f33;})});}_0x3c03ac=_[_0x014a('0x3f')]({},_0x3c03ac,_0x54fc19[_0x014a('0x47')]);return _0x4495c1['getAgents'](_0x3c03ac);}})[_0x014a('0x23')](function(_0xdd17a7){if(_0xdd17a7){_0x2e2360=_0xdd17a7[_0x014a('0x38')];if(!_0x54fc19[_0x014a('0x32')][_0x014a('0x39')](_0x014a('0x3a'))){_0x3c03ac['limit']=qs[_0x014a('0x1e')](_0x54fc19[_0x014a('0x32')][_0x014a('0x1e')]);_0x3c03ac['offset']=qs['offset'](_0x54fc19[_0x014a('0x32')][_0x014a('0x1d')]);}return _0x4495c1[_0x014a('0x80')](_0x3c03ac);}})[_0x014a('0x23')](function(_0x2b1695){if(_0x2b1695){return _0x2b1695?{'count':_0x2e2360,'rows':_0x2b1695}:null;}})['then'](respondWithResult(_0x1a4e1f,null))[_0x014a('0x44')](handleError(_0x1a4e1f,null));}; \ No newline at end of file +var _0xb10b=['push','QueryTypes','SELECT','TeamId','all','union','compact','isEmpty','removeAgents','forEach','addAgents','omit','spread','userSmsQueue:save','userSmsQueue:remove','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','update','then','destroy','UserProfileResource','error','stack','name','index','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','SmsQueue','findAll','rows','show','params','find','create','body','user','get','SmsQueues','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','nolimit','sort','SmsQueueId','findAndCountAll','UserId','agent','smsPause','createdAt','format','%s/%s','SIP','updatedAt','Team','getTeams','hasOwnProperty','addTeams','ids','User','Agents','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','emit','removeTeams','select','field','tq.TeamId','from','team_has_sms_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?'];(function(_0x362401,_0x55de89){var _0x33272e=function(_0x55d516){while(--_0x55d516){_0x362401['push'](_0x362401['shift']());}};_0x33272e(++_0x55de89);}(_0xb10b,0x12a));var _0xbb10=function(_0xcde2ee,_0x4d32cc){_0xcde2ee=_0xcde2ee-0x0;var _0x6eb7b2=_0xb10b[_0xcde2ee];return _0x6eb7b2;};'use strict';var pdf=require(_0xbb10('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbb10('0x1'));var zipdir=require(_0xbb10('0x2'));var jsonpatch=require(_0xbb10('0x3'));var rp=require('request-promise');var moment=require(_0xbb10('0x4'));var BPromise=require(_0xbb10('0x5'));var Mustache=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var path=require(_0xbb10('0x8'));var sox=require(_0xbb10('0x9'));var csv=require('to-csv');var ejs=require(_0xbb10('0xa'));var fs=require('fs');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('0xf'));var querystring=require(_0xbb10('0x10'));var Papa=require(_0xbb10('0x11'));var Redis=require(_0xbb10('0x12'));var authService=require(_0xbb10('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x14'));var logger=require(_0xbb10('0x15'))(_0xbb10('0x16'));var utils=require('../../config/utils');var config=require(_0xbb10('0x17'));var db=require('../../mysqldb')['db'];config[_0xbb10('0x18')]=_[_0xbb10('0x19')](config[_0xbb10('0x18')],{'host':_0xbb10('0x1a'),'port':0x18eb});var socket=require(_0xbb10('0x1b'))(new Redis(config[_0xbb10('0x18')]));require('./smsQueue.socket')[_0xbb10('0x1c')](socket);function respondWithStatusCode(_0x42d7e4,_0x45b9d6){_0x45b9d6=_0x45b9d6||0xcc;return function(_0x17fd46){if(_0x17fd46){return _0x42d7e4[_0xbb10('0x1d')](_0x45b9d6);}return _0x42d7e4[_0xbb10('0x1e')](_0x45b9d6)[_0xbb10('0x1f')]();};}function respondWithResult(_0x36b5e8,_0x3e26f4){_0x3e26f4=_0x3e26f4||0xc8;return function(_0x2b184e){if(_0x2b184e){return _0x36b5e8['status'](_0x3e26f4)[_0xbb10('0x20')](_0x2b184e);}};}function respondWithFilteredResult(_0x1145f1,_0x133ac2){return function(_0x42db98){if(_0x42db98){var _0x378da8=_0x42db98[_0xbb10('0x21')],_0x1682a4=_0x133ac2[_0xbb10('0x22')],_0x575cca=_0x133ac2['offset']+_0x133ac2[_0xbb10('0x23')],_0x30efc6;if(_0x575cca>=_0x378da8){_0x575cca=_0x378da8;_0x30efc6=0xc8;}else{_0x30efc6=0xce;}_0x1145f1[_0xbb10('0x1e')](_0x30efc6);return _0x1145f1[_0xbb10('0x24')](_0xbb10('0x25'),_0x1682a4+'-'+_0x575cca+'/'+_0x378da8)[_0xbb10('0x20')](_0x42db98);}return null;};}function patchUpdates(_0x44e563){return function(_0x4deb49){try{jsonpatch[_0xbb10('0x26')](_0x4deb49,_0x44e563,!![]);}catch(_0x12ef77){return BPromise['reject'](_0x12ef77);}return _0x4deb49['save']();};}function saveUpdates(_0x8e2b97,_0x311abe){return function(_0x2e911d){if(_0x2e911d){return _0x2e911d[_0xbb10('0x27')](_0x8e2b97)[_0xbb10('0x28')](function(_0x1824b7){return _0x1824b7;});}return null;};}function removeEntity(_0x407cb4,_0x436104){return function(_0x7f2377){if(_0x7f2377){return _0x7f2377[_0xbb10('0x29')]()[_0xbb10('0x28')](function(){var _0x26ad93=_0x7f2377['get']({'plain':!![]});var _0x4fedac='SmsQueues';return db[_0xbb10('0x2a')][_0xbb10('0x29')]({'where':{'type':_0x4fedac,'resourceId':_0x26ad93['id']}})[_0xbb10('0x28')](function(){return _0x7f2377;});})['then'](function(){_0x407cb4[_0xbb10('0x1e')](0xcc)[_0xbb10('0x1f')]();});}};}function handleEntityNotFound(_0x6ed43b,_0x1d5e95){return function(_0x1acce9){if(!_0x1acce9){_0x6ed43b[_0xbb10('0x1d')](0x194);}return _0x1acce9;};}function handleError(_0x2a0e8b,_0x4aabb9){_0x4aabb9=_0x4aabb9||0x1f4;return function(_0x3796c7){logger[_0xbb10('0x2b')](_0x3796c7[_0xbb10('0x2c')]);if(_0x3796c7[_0xbb10('0x2d')]){delete _0x3796c7[_0xbb10('0x2d')];}_0x2a0e8b[_0xbb10('0x1e')](_0x4aabb9)['send'](_0x3796c7);};}exports[_0xbb10('0x2e')]=function(_0x4ee02e,_0x448d5c){var _0x56f2da={},_0x16ad2a={},_0x1dcc9c={'count':0x0,'rows':[]};var _0x1b59f9=_['map'](db['SmsQueue'][_0xbb10('0x2f')],function(_0x34f65e){return{'name':_0x34f65e['fieldName'],'type':_0x34f65e[_0xbb10('0x30')][_0xbb10('0x31')]};});_0x16ad2a[_0xbb10('0x32')]=_[_0xbb10('0x33')](_0x1b59f9,_0xbb10('0x2d'));_0x16ad2a[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x4ee02e['query']);_0x16ad2a[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x16ad2a[_0xbb10('0x32')],_0x16ad2a[_0xbb10('0x34')]);_0x56f2da[_0xbb10('0x38')]=_[_0xbb10('0x37')](_0x16ad2a[_0xbb10('0x32')],qs[_0xbb10('0x39')](_0x4ee02e[_0xbb10('0x34')]['fields']));_0x56f2da[_0xbb10('0x38')]=_0x56f2da[_0xbb10('0x38')][_0xbb10('0x3a')]?_0x56f2da[_0xbb10('0x38')]:_0x16ad2a['model'];if(!_0x4ee02e[_0xbb10('0x34')]['hasOwnProperty']('nolimit')){_0x56f2da[_0xbb10('0x23')]=qs[_0xbb10('0x23')](_0x4ee02e[_0xbb10('0x34')][_0xbb10('0x23')]);_0x56f2da[_0xbb10('0x22')]=qs[_0xbb10('0x22')](_0x4ee02e['query'][_0xbb10('0x22')]);}_0x56f2da[_0xbb10('0x3b')]=qs['sort'](_0x4ee02e['query']['sort']);_0x56f2da[_0xbb10('0x3c')]=qs[_0xbb10('0x36')](_[_0xbb10('0x3d')](_0x4ee02e['query'],_0x16ad2a[_0xbb10('0x36')]));if(_0x4ee02e[_0xbb10('0x34')][_0xbb10('0x3e')]){_0x56f2da['where']=_[_0xbb10('0x3f')](_0x56f2da[_0xbb10('0x3c')],{'$or':_[_0xbb10('0x33')](_0x1b59f9,function(_0x446f49){if(_0x446f49['type']!==_0xbb10('0x40')){var _0x110eb5={};_0x110eb5[_0x446f49['name']]={'$like':'%'+_0x4ee02e[_0xbb10('0x34')][_0xbb10('0x3e')]+'%'};return _0x110eb5;}})});}_0x56f2da=_[_0xbb10('0x3f')]({},_0x56f2da,_0x4ee02e[_0xbb10('0x41')]);var _0x2dd35a={'where':_0x56f2da[_0xbb10('0x3c')]};return db['SmsQueue'][_0xbb10('0x21')](_0x2dd35a)[_0xbb10('0x28')](function(_0x3e7b4c){_0x1dcc9c[_0xbb10('0x21')]=_0x3e7b4c;if(_0x4ee02e['query'][_0xbb10('0x42')]){_0x56f2da[_0xbb10('0x43')]=[{'all':!![]}];}return db[_0xbb10('0x44')][_0xbb10('0x45')](_0x56f2da);})['then'](function(_0x351484){_0x1dcc9c[_0xbb10('0x46')]=_0x351484;return _0x1dcc9c;})['then'](respondWithFilteredResult(_0x448d5c,_0x56f2da))['catch'](handleError(_0x448d5c,null));};exports[_0xbb10('0x47')]=function(_0x4a3ddf,_0x318984){var _0x180933={'raw':!![],'where':{'id':_0x4a3ddf[_0xbb10('0x48')]['id']}},_0x4c66d8={};_0x4c66d8[_0xbb10('0x32')]=_[_0xbb10('0x35')](db['SmsQueue'][_0xbb10('0x2f')]);_0x4c66d8[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x4a3ddf[_0xbb10('0x34')]);_0x4c66d8[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x4c66d8[_0xbb10('0x32')],_0x4c66d8[_0xbb10('0x34')]);_0x180933[_0xbb10('0x38')]=_[_0xbb10('0x37')](_0x4c66d8[_0xbb10('0x32')],qs[_0xbb10('0x39')](_0x4a3ddf['query'][_0xbb10('0x39')]));_0x180933[_0xbb10('0x38')]=_0x180933['attributes'][_0xbb10('0x3a')]?_0x180933[_0xbb10('0x38')]:_0x4c66d8[_0xbb10('0x32')];if(_0x4a3ddf[_0xbb10('0x34')][_0xbb10('0x42')]){_0x180933[_0xbb10('0x43')]=[{'all':!![]}];}_0x180933=_[_0xbb10('0x3f')]({},_0x180933,_0x4a3ddf['options']);return db['SmsQueue'][_0xbb10('0x49')](_0x180933)[_0xbb10('0x28')](handleEntityNotFound(_0x318984,null))[_0xbb10('0x28')](respondWithResult(_0x318984,null))['catch'](handleError(_0x318984,null));};exports['create']=function(_0x3cd6f3,_0x34cf4e){return db[_0xbb10('0x44')][_0xbb10('0x4a')](_0x3cd6f3[_0xbb10('0x4b')],{})[_0xbb10('0x28')](function(_0x2f2552){var _0x460788=_0x3cd6f3[_0xbb10('0x4c')][_0xbb10('0x4d')]({'plain':!![]});if(!_0x460788)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x460788['role']===_0xbb10('0x4c')){var _0x467dba=_0x2f2552[_0xbb10('0x4d')]({'plain':!![]});var _0xb014b0=_0xbb10('0x4e');return db[_0xbb10('0x4f')][_0xbb10('0x49')]({'where':{'name':_0xb014b0,'userProfileId':_0x460788[_0xbb10('0x50')]},'raw':!![]})[_0xbb10('0x28')](function(_0x1214f7){if(_0x1214f7&&_0x1214f7[_0xbb10('0x51')]===0x0){return db[_0xbb10('0x2a')][_0xbb10('0x4a')]({'name':_0x467dba[_0xbb10('0x2d')],'resourceId':_0x467dba['id'],'type':_0x1214f7[_0xbb10('0x2d')],'sectionId':_0x1214f7['id']},{})['then'](function(){return _0x2f2552;});}else{return _0x2f2552;}})[_0xbb10('0x52')](function(_0x5bd44d){logger[_0xbb10('0x2b')](_0xbb10('0x53'),_0x5bd44d);throw _0x5bd44d;});}return _0x2f2552;})[_0xbb10('0x28')](respondWithResult(_0x34cf4e,0xc9))[_0xbb10('0x52')](handleError(_0x34cf4e,null));};exports[_0xbb10('0x27')]=function(_0x32d8e9,_0x2e3326){if(_0x32d8e9[_0xbb10('0x4b')]['id']){delete _0x32d8e9[_0xbb10('0x4b')]['id'];}return db[_0xbb10('0x44')][_0xbb10('0x49')]({'where':{'id':_0x32d8e9[_0xbb10('0x48')]['id']}})[_0xbb10('0x28')](handleEntityNotFound(_0x2e3326,null))[_0xbb10('0x28')](saveUpdates(_0x32d8e9[_0xbb10('0x4b')],null))['then'](respondWithResult(_0x2e3326,null))[_0xbb10('0x52')](handleError(_0x2e3326,null));};exports[_0xbb10('0x29')]=function(_0x1b83a9,_0x4ce8e7){return db[_0xbb10('0x44')][_0xbb10('0x49')]({'where':{'id':_0x1b83a9['params']['id']}})[_0xbb10('0x28')](handleEntityNotFound(_0x4ce8e7,null))[_0xbb10('0x28')](removeEntity(_0x4ce8e7,null))[_0xbb10('0x52')](handleError(_0x4ce8e7,null));};exports[_0xbb10('0x54')]=function(_0x432728,_0x22de7f){return db[_0xbb10('0x44')][_0xbb10('0x54')]()[_0xbb10('0x28')](respondWithResult(_0x22de7f,null))[_0xbb10('0x52')](handleError(_0x22de7f,null));};exports[_0xbb10('0x55')]=function(_0x2a1ce1,_0x16932f,_0x4e7fac){var _0x4ea1a6={'raw':!![],'where':{}},_0x16272d={},_0x3e6338;return db[_0xbb10('0x44')][_0xbb10('0x56')]({'where':{'id':_0x2a1ce1['params']['id']}})['then'](handleEntityNotFound(_0x16932f,null))[_0xbb10('0x28')](function(_0xaf2cc3){if(_0xaf2cc3){_0x3e6338=_0xaf2cc3[_0xbb10('0x4d')]({'plain':!![]});_0x16272d[_0xbb10('0x32')]=_[_0xbb10('0x35')](db[_0xbb10('0x57')][_0xbb10('0x2f')]);_0x16272d['query']=_[_0xbb10('0x35')](_0x2a1ce1[_0xbb10('0x34')]);_0x16272d['filters']=_['intersection'](_0x16272d['model'],_0x16272d[_0xbb10('0x34')]);_0x4ea1a6[_0xbb10('0x38')]=_[_0xbb10('0x37')](_0x16272d['model'],qs['fields'](_0x2a1ce1['query'][_0xbb10('0x39')]));_0x4ea1a6[_0xbb10('0x38')]=_0x4ea1a6[_0xbb10('0x38')]['length']?_0x4ea1a6[_0xbb10('0x38')]:_0x16272d[_0xbb10('0x32')];if(!_0x2a1ce1['query']['hasOwnProperty'](_0xbb10('0x58'))){_0x4ea1a6[_0xbb10('0x23')]=qs[_0xbb10('0x23')](_0x2a1ce1[_0xbb10('0x34')]['limit']);_0x4ea1a6[_0xbb10('0x22')]=qs[_0xbb10('0x22')](_0x2a1ce1[_0xbb10('0x34')]['offset']);}_0x4ea1a6[_0xbb10('0x3b')]=qs[_0xbb10('0x59')](_0x2a1ce1[_0xbb10('0x34')]['sort']);_0x4ea1a6[_0xbb10('0x3c')]=qs[_0xbb10('0x36')](_[_0xbb10('0x3d')](_0x2a1ce1[_0xbb10('0x34')],_0x16272d['filters']));_0x4ea1a6[_0xbb10('0x3c')][_0xbb10('0x5a')]=_0xaf2cc3['id'];if(_0x2a1ce1[_0xbb10('0x34')][_0xbb10('0x3e')]){_0x4ea1a6['where']=_[_0xbb10('0x3f')](_0x4ea1a6[_0xbb10('0x3c')],{'$or':_[_0xbb10('0x33')](_0x4ea1a6[_0xbb10('0x38')],function(_0x12f750){var _0x17807e={};_0x17807e[_0x12f750]={'$like':'%'+_0x2a1ce1[_0xbb10('0x34')]['filter']+'%'};return _0x17807e;})});}_0x4ea1a6=_['merge']({},_0x4ea1a6,_0x2a1ce1['options']);return db[_0xbb10('0x57')][_0xbb10('0x45')](_0x4ea1a6);}})[_0xbb10('0x28')](function(_0x5c9afc){if(_0x5c9afc){return db['User'][_0xbb10('0x5b')]({'where':{'id':_[_0xbb10('0x33')](_0x5c9afc,_0xbb10('0x5c')),'role':_0xbb10('0x5d')},'attributes':['id',_0xbb10('0x2d'),_0xbb10('0x5e'),'updatedAt',_0xbb10('0x5f')]});}})[_0xbb10('0x28')](function(_0x270fdb){if(_0x270fdb){return{'count':_0x270fdb[_0xbb10('0x21')],'rows':_[_0xbb10('0x33')](_0x270fdb['rows'],function(_0x56094a){return{'membername':_0x56094a['name'],'UserId':_0x56094a['id'],'queue_name':_0x3e6338[_0xbb10('0x2d')],'SmsQueueId':_0x3e6338['id'],'interface':util[_0xbb10('0x60')](_0xbb10('0x61'),_0xbb10('0x62'),_0x56094a[_0xbb10('0x2d')]),'penalty':0x0,'paused':_0x56094a[_0xbb10('0x5e')],'createdAt':_0x56094a['createdAt'],'updatedAt':_0x56094a[_0xbb10('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x16932f,_0x4ea1a6))['catch'](handleError(_0x16932f,null));};exports['getTeams']=function(_0xdf634f,_0x13040d,_0x23b1d5){var _0x108f99={};var _0x5ce94f={};var _0x122d38;var _0x5c583b;return db['SmsQueue'][_0xbb10('0x56')]({'where':{'id':_0xdf634f[_0xbb10('0x48')]['id']}})[_0xbb10('0x28')](handleEntityNotFound(_0x13040d,null))[_0xbb10('0x28')](function(_0xfa3c7c){if(_0xfa3c7c){_0x122d38=_0xfa3c7c;_0x5ce94f['model']=_[_0xbb10('0x35')](db[_0xbb10('0x64')][_0xbb10('0x2f')]);_0x5ce94f[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0xdf634f[_0xbb10('0x34')]);_0x5ce94f[_0xbb10('0x36')]=_['intersection'](_0x5ce94f[_0xbb10('0x32')],_0x5ce94f[_0xbb10('0x34')]);_0x108f99[_0xbb10('0x38')]=_[_0xbb10('0x37')](_0x5ce94f[_0xbb10('0x32')],qs[_0xbb10('0x39')](_0xdf634f[_0xbb10('0x34')][_0xbb10('0x39')]));_0x108f99['attributes']=_0x108f99[_0xbb10('0x38')][_0xbb10('0x3a')]?_0x108f99[_0xbb10('0x38')]:_0x5ce94f['model'];_0x108f99['order']=qs['sort'](_0xdf634f[_0xbb10('0x34')]['sort']);_0x108f99['where']=qs[_0xbb10('0x36')](_[_0xbb10('0x3d')](_0xdf634f[_0xbb10('0x34')],_0x5ce94f[_0xbb10('0x36')]));if(_0xdf634f[_0xbb10('0x34')][_0xbb10('0x3e')]){_0x108f99[_0xbb10('0x3c')]=_[_0xbb10('0x3f')](_0x108f99[_0xbb10('0x3c')],{'$or':_['map'](_0x108f99[_0xbb10('0x38')],function(_0x1351eb){var _0x46b6d2={};_0x46b6d2[_0x1351eb]={'$like':'%'+_0xdf634f[_0xbb10('0x34')]['filter']+'%'};return _0x46b6d2;})});}_0x108f99=_['merge']({},_0x108f99,_0xdf634f[_0xbb10('0x41')]);return _0x122d38[_0xbb10('0x65')](_0x108f99);}})[_0xbb10('0x28')](function(_0x32bb25){if(_0x32bb25){_0x5c583b=_0x32bb25['length'];if(!_0xdf634f[_0xbb10('0x34')][_0xbb10('0x66')](_0xbb10('0x58'))){_0x108f99[_0xbb10('0x23')]=qs[_0xbb10('0x23')](_0xdf634f['query']['limit']);_0x108f99[_0xbb10('0x22')]=qs[_0xbb10('0x22')](_0xdf634f[_0xbb10('0x34')]['offset']);}return _0x122d38[_0xbb10('0x65')](_0x108f99);}})[_0xbb10('0x28')](function(_0x50bcc9){if(_0x50bcc9){return _0x50bcc9?{'count':_0x5c583b,'rows':_0x50bcc9}:null;}})['then'](respondWithResult(_0x13040d,null))[_0xbb10('0x52')](handleError(_0x13040d,null));};exports[_0xbb10('0x67')]=function(_0x177f77,_0x4d64ff,_0x32d5a5){var _0x3a17fc=_0x177f77[_0xbb10('0x4b')][_0xbb10('0x68')];return db[_0xbb10('0x64')][_0xbb10('0x45')]({'where':{'id':_0x3a17fc},'attributes':['id'],'include':[{'model':db[_0xbb10('0x69')],'as':_0xbb10('0x6a'),'attributes':['id',_0xbb10('0x2d'),'online',_0xbb10('0x6b'),_0xbb10('0x6c')],'raw':!![]}]})[_0xbb10('0x28')](function(_0xdb7d3e){if(_0xdb7d3e){var _0x3e3083=_[_0xbb10('0x6d')](_0xdb7d3e,function(_0x33a6fc){var _0x305d52=_0x33a6fc[_0xbb10('0x4d')]({'plain':!![]});return _0x305d52[_0xbb10('0x6a')];});return db[_0xbb10('0x44')][_0xbb10('0x49')]({'where':{'id':_0x177f77['params']['id']}})['then'](function(_0xe1fc51){return db[_0xbb10('0x6e')][_0xbb10('0x6f')](function(_0x3fd367){return _0xe1fc51[_0xbb10('0x67')](_0x3a17fc,{'transaction':_0x3fd367})['then'](function(){return BPromise[_0xbb10('0x70')](_0x3e3083,function(_0x332fbe){return db[_0xbb10('0x57')][_0xbb10('0x71')]({'where':{'UserId':_0x332fbe['id'],'SmsQueueId':_0x177f77[_0xbb10('0x48')]['id']},'transaction':_0x3fd367});});})[_0xbb10('0x28')](function(){_0x3e3083['forEach'](function(_0xb25e71){socket[_0xbb10('0x72')]('userSmsQueue:save',{'UserId':_0xb25e71['id'],'SmsQueueId':_0xe1fc51['id']});});});});});}})[_0xbb10('0x28')](respondWithStatusCode(_0x4d64ff,null))['catch'](handleError(_0x4d64ff,null));};exports[_0xbb10('0x73')]=function(_0x28bd76,_0x2b473c,_0xa99bf5){return db[_0xbb10('0x64')]['findAll']({'where':{'id':_0x28bd76[_0xbb10('0x34')]['ids']},'attributes':['id'],'include':[{'model':db[_0xbb10('0x69')],'as':_0xbb10('0x6a'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2b473c,null))['then'](function(_0x415407){var _0x2b0d71=_[_0xbb10('0x33')](_0x415407,'id');var _0x283bab=[];var _0x18d18d=[];var _0x1cb22f=squel[_0xbb10('0x74')]();_0x1cb22f[_0xbb10('0x75')](_0xbb10('0x76'))[_0xbb10('0x77')](_0xbb10('0x78'),'tq')['join'](_0xbb10('0x79'),'ut',_0xbb10('0x7a'))[_0xbb10('0x3c')](_0xbb10('0x7b'),_0x28bd76[_0xbb10('0x48')]['id']);for(var _0x86a6ff=0x0;_0x86a6ff<_0x415407[_0xbb10('0x3a')];_0x86a6ff+=0x1){let _0x28bc95=_0x415407[_0x86a6ff];for(var _0x3e6fe2=0x0;_0x3e6fe2<_0x28bc95[_0xbb10('0x6a')][_0xbb10('0x3a')];_0x3e6fe2+=0x1){let _0x2d3e98=_0x28bc95['Agents'][_0x3e6fe2];var _0xe1d006=_0x1cb22f['clone']();_0xe1d006[_0xbb10('0x3c')](_0xbb10('0x7c'),_0x2d3e98['id']);_0x18d18d[_0xbb10('0x7d')](db[_0xbb10('0x6e')][_0xbb10('0x34')](_0xe1d006['toString'](),{'type':db[_0xbb10('0x6e')][_0xbb10('0x7e')][_0xbb10('0x7f')]})[_0xbb10('0x28')](function(_0x315b55){if(_0x315b55[_0xbb10('0x3a')]===0x1){return _0x2d3e98['id'];}else{var _0x4970fe=_['every'](_[_0xbb10('0x33')](_0x315b55,_0xbb10('0x80')),function(_0x41d4d0){return _['includes'](_0x2b0d71,_0x41d4d0);});if(_0x4970fe){return _0x2d3e98['id'];}}}));}}return BPromise[_0xbb10('0x81')](_0x18d18d)[_0xbb10('0x28')](function(_0x514fdf){_0x283bab=_(_0x283bab)[_0xbb10('0x82')](_0x514fdf)[_0xbb10('0x83')]()['value']();return db[_0xbb10('0x44')]['find']({'where':{'id':_0x28bd76[_0xbb10('0x48')]['id']}})[_0xbb10('0x28')](function(_0x5d82e4){return db[_0xbb10('0x6e')][_0xbb10('0x6f')](function(_0x4bac29){return _0x5d82e4['removeTeams'](_0x28bd76[_0xbb10('0x34')][_0xbb10('0x68')],{'transaction':_0x4bac29})[_0xbb10('0x28')](function(){if(!_[_0xbb10('0x84')](_0x283bab)){return _0x5d82e4[_0xbb10('0x85')](_0x283bab,{'transaction':_0x4bac29});}})['then'](function(){_0x283bab[_0xbb10('0x86')](function(_0x9f2e0f){socket[_0xbb10('0x72')]('userSmsQueue:remove',{'UserId':_0x9f2e0f,'SmsQueueId':_0x5d82e4['id']});});});});});});})[_0xbb10('0x28')](respondWithStatusCode(_0x2b473c,null))[_0xbb10('0x52')](handleError(_0x2b473c,null));};exports[_0xbb10('0x87')]=function(_0xa5391d,_0x44a3e1,_0xf5b08a){return db[_0xbb10('0x44')][_0xbb10('0x49')]({'where':{'id':_0xa5391d[_0xbb10('0x48')]['id']}})['then'](handleEntityNotFound(_0x44a3e1,null))['then'](function(_0x37e40c){if(_0x37e40c){return _0x37e40c[_0xbb10('0x87')](_0xa5391d[_0xbb10('0x4b')][_0xbb10('0x68')],_[_0xbb10('0x88')](_0xa5391d[_0xbb10('0x4b')],[_0xbb10('0x68'),'id'])||{})[_0xbb10('0x89')](function(_0x3ede66){for(var _0x471827=0x0;_0x471827<_0xa5391d[_0xbb10('0x4b')][_0xbb10('0x68')][_0xbb10('0x3a')];_0x471827+=0x1){socket['emit'](_0xbb10('0x8a'),{'UserId':_0xa5391d[_0xbb10('0x4b')][_0xbb10('0x68')][_0x471827],'SmsQueueId':_0xa5391d[_0xbb10('0x48')]['id']});}return _0x3ede66;});}})[_0xbb10('0x28')](respondWithResult(_0x44a3e1,null))[_0xbb10('0x52')](handleError(_0x44a3e1,null));};exports[_0xbb10('0x85')]=function(_0x1421e2,_0x3c6c45,_0x3c92f4){return db[_0xbb10('0x44')]['find']({'where':{'id':_0x1421e2[_0xbb10('0x48')]['id']}})['then'](handleEntityNotFound(_0x3c6c45,null))[_0xbb10('0x28')](function(_0x22ae3c){if(_0x22ae3c){return _0x22ae3c[_0xbb10('0x85')](_0x1421e2[_0xbb10('0x34')][_0xbb10('0x68')])[_0xbb10('0x28')](function(){if(_['isArray'](_0x1421e2[_0xbb10('0x34')]['ids'])){for(var _0xd82ce1=0x0;_0xd82ce1<_0x1421e2[_0xbb10('0x34')][_0xbb10('0x68')][_0xbb10('0x3a')];_0xd82ce1+=0x1){socket[_0xbb10('0x72')](_0xbb10('0x8b'),{'UserId':Number(_0x1421e2[_0xbb10('0x34')][_0xbb10('0x68')][_0xd82ce1]),'SmsQueueId':Number(_0x1421e2[_0xbb10('0x48')]['id'])});}}else{socket[_0xbb10('0x72')](_0xbb10('0x8b'),{'UserId':Number(_0x1421e2[_0xbb10('0x34')]['ids']),'SmsQueueId':Number(_0x1421e2[_0xbb10('0x48')]['id'])});}});}})['then'](respondWithStatusCode(_0x3c6c45,null))[_0xbb10('0x52')](handleError(_0x3c6c45,null));};exports[_0xbb10('0x8c')]=function(_0x418f63,_0x7673a0,_0x44c229){var _0x40271f={};var _0x185ec9={};var _0x5e9888;var _0x350657;return db['SmsQueue']['findOne']({'where':{'id':_0x418f63[_0xbb10('0x48')]['id']}})[_0xbb10('0x28')](handleEntityNotFound(_0x7673a0,null))[_0xbb10('0x28')](function(_0x1fd88a){if(_0x1fd88a){_0x5e9888=_0x1fd88a;_0x185ec9[_0xbb10('0x32')]=_[_0xbb10('0x35')](db['User'][_0xbb10('0x2f')]);_0x185ec9[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x418f63[_0xbb10('0x34')]);_0x185ec9[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x185ec9['model'],_0x185ec9[_0xbb10('0x34')]);_0x40271f[_0xbb10('0x38')]=_[_0xbb10('0x37')](_0x185ec9[_0xbb10('0x32')],qs[_0xbb10('0x39')](_0x418f63[_0xbb10('0x34')][_0xbb10('0x39')]));_0x40271f['attributes']=_0x40271f[_0xbb10('0x38')]['length']?_0x40271f[_0xbb10('0x38')]:_0x185ec9['model'];_0x40271f['order']=qs[_0xbb10('0x59')](_0x418f63[_0xbb10('0x34')][_0xbb10('0x59')]);_0x40271f[_0xbb10('0x3c')]=qs[_0xbb10('0x36')](_['pick'](_0x418f63[_0xbb10('0x34')],_0x185ec9['filters']));if(_0x418f63['query']['filter']){_0x40271f[_0xbb10('0x3c')]=_[_0xbb10('0x3f')](_0x40271f[_0xbb10('0x3c')],{'$or':_[_0xbb10('0x33')](_0x40271f[_0xbb10('0x38')],function(_0x5abedf){var _0x125bcf={};_0x125bcf[_0x5abedf]={'$like':'%'+_0x418f63[_0xbb10('0x34')][_0xbb10('0x3e')]+'%'};return _0x125bcf;})});}_0x40271f=_[_0xbb10('0x3f')]({},_0x40271f,_0x418f63[_0xbb10('0x41')]);return _0x5e9888[_0xbb10('0x8c')](_0x40271f);}})[_0xbb10('0x28')](function(_0x485c1a){if(_0x485c1a){_0x350657=_0x485c1a['length'];if(!_0x418f63['query'][_0xbb10('0x66')](_0xbb10('0x58'))){_0x40271f[_0xbb10('0x23')]=qs[_0xbb10('0x23')](_0x418f63[_0xbb10('0x34')][_0xbb10('0x23')]);_0x40271f[_0xbb10('0x22')]=qs[_0xbb10('0x22')](_0x418f63[_0xbb10('0x34')][_0xbb10('0x22')]);}return _0x5e9888['getAgents'](_0x40271f);}})['then'](function(_0x4dce53){if(_0x4dce53){return _0x4dce53?{'count':_0x350657,'rows':_0x4dce53}:null;}})[_0xbb10('0x28')](respondWithResult(_0x7673a0,null))[_0xbb10('0x52')](handleError(_0x7673a0,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 45159c1..78fb385 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 _0x70dd=['hasOwnProperty','hook','setMaxListeners','update','emit'];(function(_0x245a43,_0x591598){var _0x44420e=function(_0x4f5c59){while(--_0x4f5c59){_0x245a43['push'](_0x245a43['shift']());}};_0x44420e(++_0x591598);}(_0x70dd,0x75));var _0xd70d=function(_0x15aaf6,_0x4749dc){_0x15aaf6=_0x15aaf6-0x0;var _0xb5148a=_0x70dd[_0x15aaf6];return _0xb5148a;};'use strict';var EventEmitter=require('events');var SmsQueue=require('../../mysqldb')['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xd70d('0x0')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd70d('0x1'),'afterDestroy':'remove'};function emitEvent(_0x170451){return function(_0x2ac09f,_0x195012,_0x2e0d95){SmsQueueEvents[_0xd70d('0x2')](_0x170451+':'+_0x2ac09f['id'],_0x2ac09f);SmsQueueEvents[_0xd70d('0x2')](_0x170451,_0x2ac09f);_0x2e0d95(null);};}for(var e in events){if(events[_0xd70d('0x3')](e)){var event=events[e];SmsQueue[_0xd70d('0x4')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file +var _0x07f6=['events','SmsQueue','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x07f6,0x10e));var _0x607f=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x07f6[_0x56482c];return _0x5aae7a;};'use strict';var EventEmitter=require(_0x607f('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0x607f('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x607f('0x2')](0x0);var events={'afterCreate':_0x607f('0x3'),'afterUpdate':_0x607f('0x4'),'afterDestroy':_0x607f('0x5')};function emitEvent(_0x35da5d){return function(_0x1caad2,_0x130e06,_0x218b6d){SmsQueueEvents[_0x607f('0x6')](_0x35da5d+':'+_0x1caad2['id'],_0x1caad2);SmsQueueEvents['emit'](_0x35da5d,_0x1caad2);_0x218b6d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0x607f('0x7')](e,emitEvent(event));}}module[_0x607f('0x8')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 6ca4111..2f71fe3 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 _0xa03d=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','sms_queues','lodash','util'];(function(_0x1d2f09,_0x50d9d8){var _0x36e2ae=function(_0x17fcad){while(--_0x17fcad){_0x1d2f09['push'](_0x1d2f09['shift']());}};_0x36e2ae(++_0x50d9d8);}(_0xa03d,0x14e));var _0xda03=function(_0x467fd4,_0x20168c){_0x467fd4=_0x467fd4-0x0;var _0x56c5cf=_0xa03d[_0x467fd4];return _0x56c5cf;};'use strict';var _=require(_0xda03('0x0'));var util=require(_0xda03('0x1'));var logger=require(_0xda03('0x2'))('api');var moment=require(_0xda03('0x3'));var BPromise=require(_0xda03('0x4'));var rp=require(_0xda03('0x5'));var fs=require('fs');var path=require(_0xda03('0x6'));var rimraf=require(_0xda03('0x7'));var config=require(_0xda03('0x8'));var attributes=require(_0xda03('0x9'));module[_0xda03('0xa')]=function(_0x4746da,_0x241a55){return _0x4746da[_0xda03('0xb')](_0xda03('0xc'),attributes,{'tableName':_0xda03('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeb24=['moment','request-promise','path','./smsQueue.attributes','exports','define','sms_queues','lodash','util','../../config/logger','api'];(function(_0x5ddd39,_0x2f97be){var _0x422643=function(_0x42da91){while(--_0x42da91){_0x5ddd39['push'](_0x5ddd39['shift']());}};_0x422643(++_0x2f97be);}(_0xeb24,0xd8));var _0x4eb2=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xeb24[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0x4eb2('0x0'));var util=require(_0x4eb2('0x1'));var logger=require(_0x4eb2('0x2'))(_0x4eb2('0x3'));var moment=require(_0x4eb2('0x4'));var BPromise=require('bluebird');var rp=require(_0x4eb2('0x5'));var fs=require('fs');var path=require(_0x4eb2('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4eb2('0x7'));module[_0x4eb2('0x8')]=function(_0x1733ea,_0x3f32a3){return _0x1733ea[_0x4eb2('0x9')]('SmsQueue',attributes,{'tableName':_0x4eb2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index a976b4a..daed373 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 _0xa5e4=['map','include','model','catch','find','where','ShowSmsQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','register','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetSmsQueue','SmsQueue','options','raw','attributes','limit'];(function(_0x4e8f77,_0x3abc6b){var _0x2cbeec=function(_0x4b9608){while(--_0x4b9608){_0x4e8f77['push'](_0x4e8f77['shift']());}};_0x2cbeec(++_0x3abc6b);}(_0xa5e4,0xbb));var _0x4a5e=function(_0x1c19d0,_0x1cef78){_0x1c19d0=_0x1c19d0-0x0;var _0x52693c=_0xa5e4[_0x1c19d0];return _0x52693c;};'use strict';var _=require(_0x4a5e('0x0'));var util=require(_0x4a5e('0x1'));var moment=require(_0x4a5e('0x2'));var BPromise=require(_0x4a5e('0x3'));var rs=require(_0x4a5e('0x4'));var fs=require('fs');var Redis=require(_0x4a5e('0x5'));var db=require(_0x4a5e('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x4a5e('0x7'));var jayson=require(_0x4a5e('0x8'));var client=jayson['client'][_0x4a5e('0x9')]({'port':0x232a});config[_0x4a5e('0xa')]=_[_0x4a5e('0xb')](config[_0x4a5e('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x4a5e('0xc'))(new Redis(config[_0x4a5e('0xa')]));require('./smsQueue.socket')[_0x4a5e('0xd')](socket);function respondWithRpcPromise(_0x7bf7fa,_0x305d1a,_0x5c3057){return new BPromise(function(_0x53b666,_0x4ec85f){return client['request'](_0x7bf7fa,_0x5c3057)[_0x4a5e('0xe')](function(_0x2f70e5){logger[_0x4a5e('0xf')](_0x4a5e('0x10'),_0x305d1a,_0x4a5e('0x11'));logger['debug']('SmsQueue,\x20%s,\x20%s,\x20%s',_0x305d1a,_0x4a5e('0x11'),JSON[_0x4a5e('0x12')](_0x2f70e5));if(_0x2f70e5[_0x4a5e('0x13')]){if(_0x2f70e5[_0x4a5e('0x13')][_0x4a5e('0x14')]===0x1f4){logger[_0x4a5e('0x13')](_0x4a5e('0x10'),_0x305d1a,_0x2f70e5[_0x4a5e('0x13')][_0x4a5e('0x15')]);return _0x4ec85f(_0x2f70e5[_0x4a5e('0x13')][_0x4a5e('0x15')]);}logger['error'](_0x4a5e('0x10'),_0x305d1a,_0x2f70e5[_0x4a5e('0x13')][_0x4a5e('0x15')]);return _0x53b666(_0x2f70e5['error']['message']);}else{logger[_0x4a5e('0xf')]('SmsQueue,\x20%s,\x20%s',_0x305d1a,_0x4a5e('0x11'));_0x53b666(_0x2f70e5[_0x4a5e('0x16')][_0x4a5e('0x15')]);}})['catch'](function(_0x54fd61){logger['error'](_0x4a5e('0x10'),_0x305d1a,_0x54fd61);_0x4ec85f(_0x54fd61);});});}exports[_0x4a5e('0x17')]=function(_0xea3c47){var _0xd40445=this;return new Promise(function(_0xb6db30,_0xd94993){return db[_0x4a5e('0x18')]['findAll']({'raw':_0xea3c47[_0x4a5e('0x19')]?_0xea3c47[_0x4a5e('0x19')][_0x4a5e('0x1a')]===undefined?!![]:![]:!![],'where':_0xea3c47[_0x4a5e('0x19')]?_0xea3c47[_0x4a5e('0x19')]['where']||null:null,'attributes':_0xea3c47[_0x4a5e('0x19')]?_0xea3c47[_0x4a5e('0x19')][_0x4a5e('0x1b')]||null:null,'limit':_0xea3c47['options']?_0xea3c47['options'][_0x4a5e('0x1c')]||null:null,'include':_0xea3c47[_0x4a5e('0x19')]?_0xea3c47[_0x4a5e('0x19')]['include']?_[_0x4a5e('0x1d')](_0xea3c47[_0x4a5e('0x19')]['include'],function(_0x1594af){return{'model':db[_0x1594af['model']],'as':_0x1594af['as'],'attributes':_0x1594af[_0x4a5e('0x1b')],'include':_0x1594af[_0x4a5e('0x1e')]?_[_0x4a5e('0x1d')](_0x1594af[_0x4a5e('0x1e')],function(_0x553012){return{'model':db[_0x553012[_0x4a5e('0x1f')]],'as':_0x553012['as'],'attributes':_0x553012['attributes'],'include':_0x553012[_0x4a5e('0x1e')]?_['map'](_0x553012[_0x4a5e('0x1e')],function(_0x581728){return{'model':db[_0x581728['model']],'as':_0x581728['as'],'attributes':_0x581728['attributes']};}):[]};}):[]};}):[]:[]})[_0x4a5e('0xe')](function(_0x361462){logger[_0x4a5e('0xf')](_0x4a5e('0x17'),_0xea3c47);logger['debug'](_0x4a5e('0x17'),_0xea3c47,JSON[_0x4a5e('0x12')](_0x361462));_0xb6db30(_0x361462);})[_0x4a5e('0x20')](function(_0x5e772e){logger['error'](_0x4a5e('0x17'),_0x5e772e[_0x4a5e('0x15')],_0xea3c47);_0xd94993(_0xd40445['error'](0x1f4,_0x5e772e[_0x4a5e('0x15')]));});});};exports['ShowSmsQueue']=function(_0x2ba1cc){var _0x17b003=this;return new Promise(function(_0x5c2260,_0x150094){return db['SmsQueue'][_0x4a5e('0x21')]({'raw':_0x2ba1cc[_0x4a5e('0x19')]?_0x2ba1cc[_0x4a5e('0x19')][_0x4a5e('0x1a')]===undefined?!![]:![]:!![],'where':_0x2ba1cc['options']?_0x2ba1cc[_0x4a5e('0x19')][_0x4a5e('0x22')]||null:null,'attributes':_0x2ba1cc[_0x4a5e('0x19')]?_0x2ba1cc[_0x4a5e('0x19')]['attributes']||null:null,'include':_0x2ba1cc[_0x4a5e('0x19')]?_0x2ba1cc['options'][_0x4a5e('0x1e')]?_[_0x4a5e('0x1d')](_0x2ba1cc[_0x4a5e('0x19')][_0x4a5e('0x1e')],function(_0x2cdfae){return{'model':db[_0x2cdfae[_0x4a5e('0x1f')]],'as':_0x2cdfae['as'],'attributes':_0x2cdfae['attributes'],'include':_0x2cdfae[_0x4a5e('0x1e')]?_[_0x4a5e('0x1d')](_0x2cdfae[_0x4a5e('0x1e')],function(_0x1dc3d8){return{'model':db[_0x1dc3d8[_0x4a5e('0x1f')]],'as':_0x1dc3d8['as'],'attributes':_0x1dc3d8[_0x4a5e('0x1b')],'include':_0x1dc3d8[_0x4a5e('0x1e')]?_[_0x4a5e('0x1d')](_0x1dc3d8[_0x4a5e('0x1e')],function(_0xd89cf5){return{'model':db[_0xd89cf5[_0x4a5e('0x1f')]],'as':_0xd89cf5['as'],'attributes':_0xd89cf5[_0x4a5e('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4a5e('0xe')](function(_0x2f9dc8){logger['info']('ShowSmsQueue',_0x2ba1cc);logger['debug'](_0x4a5e('0x23'),_0x2ba1cc,JSON[_0x4a5e('0x12')](_0x2f9dc8));_0x5c2260(_0x2f9dc8);})['catch'](function(_0x9075a3){logger['error'](_0x4a5e('0x23'),_0x9075a3[_0x4a5e('0x15')],_0x2ba1cc);_0x150094(_0x17b003[_0x4a5e('0x13')](0x1f4,_0x9075a3['message']));});});}; \ No newline at end of file +var _0xa404=['./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowSmsQueue','find','moment','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','http','defaults','localhost','socket.io-emitter','redis'];(function(_0x1c8c28,_0x3ee093){var _0x1f59b4=function(_0x29bcc0){while(--_0x29bcc0){_0x1c8c28['push'](_0x1c8c28['shift']());}};_0x1f59b4(++_0x3ee093);}(_0xa404,0x171));var _0x4a40=function(_0x1b2cc6,_0x3d8873){_0x1b2cc6=_0x1b2cc6-0x0;var _0x167e67=_0xa404[_0x1b2cc6];return _0x167e67;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4a40('0x0'));var BPromise=require('bluebird');var rs=require(_0x4a40('0x1'));var fs=require('fs');var Redis=require(_0x4a40('0x2'));var db=require(_0x4a40('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x4a40('0x4'));var jayson=require(_0x4a40('0x5'));var client=jayson['client'][_0x4a40('0x6')]({'port':0x232a});config['redis']=_[_0x4a40('0x7')](config['redis'],{'host':_0x4a40('0x8'),'port':0x18eb});var socket=require(_0x4a40('0x9'))(new Redis(config[_0x4a40('0xa')]));require(_0x4a40('0xb'))[_0x4a40('0xc')](socket);function respondWithRpcPromise(_0xadefc3,_0x4006fc,_0x5caeef){return new BPromise(function(_0x46d235,_0x337646){return client[_0x4a40('0xd')](_0xadefc3,_0x5caeef)[_0x4a40('0xe')](function(_0x3016b9){logger[_0x4a40('0xf')](_0x4a40('0x10'),_0x4006fc,_0x4a40('0x11'));logger[_0x4a40('0x12')](_0x4a40('0x13'),_0x4006fc,_0x4a40('0x11'),JSON[_0x4a40('0x14')](_0x3016b9));if(_0x3016b9[_0x4a40('0x15')]){if(_0x3016b9[_0x4a40('0x15')]['code']===0x1f4){logger[_0x4a40('0x15')]('SmsQueue,\x20%s,\x20%s',_0x4006fc,_0x3016b9[_0x4a40('0x15')][_0x4a40('0x16')]);return _0x337646(_0x3016b9[_0x4a40('0x15')][_0x4a40('0x16')]);}logger[_0x4a40('0x15')](_0x4a40('0x10'),_0x4006fc,_0x3016b9['error']['message']);return _0x46d235(_0x3016b9[_0x4a40('0x15')]['message']);}else{logger[_0x4a40('0xf')]('SmsQueue,\x20%s,\x20%s',_0x4006fc,'request\x20sent');_0x46d235(_0x3016b9[_0x4a40('0x17')]['message']);}})[_0x4a40('0x18')](function(_0x2067ce){logger[_0x4a40('0x15')](_0x4a40('0x10'),_0x4006fc,_0x2067ce);_0x337646(_0x2067ce);});});}exports[_0x4a40('0x19')]=function(_0x3d49c2){var _0x58f33b=this;return new Promise(function(_0x12dc62,_0x35247b){return db[_0x4a40('0x1a')][_0x4a40('0x1b')]({'raw':_0x3d49c2[_0x4a40('0x1c')]?_0x3d49c2['options'][_0x4a40('0x1d')]===undefined?!![]:![]:!![],'where':_0x3d49c2[_0x4a40('0x1c')]?_0x3d49c2[_0x4a40('0x1c')][_0x4a40('0x1e')]||null:null,'attributes':_0x3d49c2[_0x4a40('0x1c')]?_0x3d49c2[_0x4a40('0x1c')][_0x4a40('0x1f')]||null:null,'limit':_0x3d49c2[_0x4a40('0x1c')]?_0x3d49c2[_0x4a40('0x1c')][_0x4a40('0x20')]||null:null,'include':_0x3d49c2[_0x4a40('0x1c')]?_0x3d49c2[_0x4a40('0x1c')][_0x4a40('0x21')]?_[_0x4a40('0x22')](_0x3d49c2[_0x4a40('0x1c')][_0x4a40('0x21')],function(_0x157be6){return{'model':db[_0x157be6[_0x4a40('0x23')]],'as':_0x157be6['as'],'attributes':_0x157be6[_0x4a40('0x1f')],'include':_0x157be6['include']?_['map'](_0x157be6['include'],function(_0x554552){return{'model':db[_0x554552[_0x4a40('0x23')]],'as':_0x554552['as'],'attributes':_0x554552[_0x4a40('0x1f')],'include':_0x554552[_0x4a40('0x21')]?_[_0x4a40('0x22')](_0x554552['include'],function(_0x17edbf){return{'model':db[_0x17edbf[_0x4a40('0x23')]],'as':_0x17edbf['as'],'attributes':_0x17edbf['attributes']};}):[]};}):[]};}):[]:[]})[_0x4a40('0xe')](function(_0x1b5a81){logger[_0x4a40('0xf')](_0x4a40('0x19'),_0x3d49c2);logger[_0x4a40('0x12')](_0x4a40('0x19'),_0x3d49c2,JSON['stringify'](_0x1b5a81));_0x12dc62(_0x1b5a81);})[_0x4a40('0x18')](function(_0x1d5057){logger[_0x4a40('0x15')](_0x4a40('0x19'),_0x1d5057[_0x4a40('0x16')],_0x3d49c2);_0x35247b(_0x58f33b[_0x4a40('0x15')](0x1f4,_0x1d5057[_0x4a40('0x16')]));});});};exports[_0x4a40('0x24')]=function(_0x4b52a3){var _0x3e1be6=this;return new Promise(function(_0x2a5ab8,_0x466c2c){return db[_0x4a40('0x1a')][_0x4a40('0x25')]({'raw':_0x4b52a3['options']?_0x4b52a3[_0x4a40('0x1c')][_0x4a40('0x1d')]===undefined?!![]:![]:!![],'where':_0x4b52a3[_0x4a40('0x1c')]?_0x4b52a3[_0x4a40('0x1c')][_0x4a40('0x1e')]||null:null,'attributes':_0x4b52a3[_0x4a40('0x1c')]?_0x4b52a3['options']['attributes']||null:null,'include':_0x4b52a3[_0x4a40('0x1c')]?_0x4b52a3[_0x4a40('0x1c')][_0x4a40('0x21')]?_[_0x4a40('0x22')](_0x4b52a3[_0x4a40('0x1c')][_0x4a40('0x21')],function(_0x1bc04d){return{'model':db[_0x1bc04d[_0x4a40('0x23')]],'as':_0x1bc04d['as'],'attributes':_0x1bc04d[_0x4a40('0x1f')],'include':_0x1bc04d[_0x4a40('0x21')]?_[_0x4a40('0x22')](_0x1bc04d[_0x4a40('0x21')],function(_0xa0b1bb){return{'model':db[_0xa0b1bb[_0x4a40('0x23')]],'as':_0xa0b1bb['as'],'attributes':_0xa0b1bb[_0x4a40('0x1f')],'include':_0xa0b1bb[_0x4a40('0x21')]?_[_0x4a40('0x22')](_0xa0b1bb[_0x4a40('0x21')],function(_0x41465d){return{'model':db[_0x41465d[_0x4a40('0x23')]],'as':_0x41465d['as'],'attributes':_0x41465d[_0x4a40('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x4a40('0xe')](function(_0x4f70f0){logger[_0x4a40('0xf')](_0x4a40('0x24'),_0x4b52a3);logger[_0x4a40('0x12')](_0x4a40('0x24'),_0x4b52a3,JSON['stringify'](_0x4f70f0));_0x2a5ab8(_0x4f70f0);})['catch'](function(_0x27f1df){logger[_0x4a40('0x15')](_0x4a40('0x24'),_0x27f1df['message'],_0x4b52a3);_0x466c2c(_0x3e1be6['error'](0x1f4,_0x27f1df[_0x4a40('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index f6b2cba..67f1b9e 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 _0x5f0d=['remove','update','emit','register','length','smsQueue:','./smsQueue.events','save'];(function(_0x28e74e,_0x53fdf1){var _0xb45ac1=function(_0x311a7a){while(--_0x311a7a){_0x28e74e['push'](_0x28e74e['shift']());}};_0xb45ac1(++_0x53fdf1);}(_0x5f0d,0xce));var _0xd5f0=function(_0x286880,_0x1585c2){_0x286880=_0x286880-0x0;var _0x47f3d0=_0x5f0d[_0x286880];return _0x47f3d0;};'use strict';var SmsQueueEvents=require(_0xd5f0('0x0'));var events=[_0xd5f0('0x1'),_0xd5f0('0x2'),_0xd5f0('0x3')];function createListener(_0x20e9e0,_0x1d0a93){return function(_0x1ed12c){_0x1d0a93[_0xd5f0('0x4')](_0x20e9e0,_0x1ed12c);};}function removeListener(_0x4ffd66,_0x5090a0){return function(){SmsQueueEvents['removeListener'](_0x4ffd66,_0x5090a0);};}exports[_0xd5f0('0x5')]=function(_0x4878ed){for(var _0x4d375b=0x0,_0x49bfd1=events[_0xd5f0('0x6')];_0x4d375b<_0x49bfd1;_0x4d375b++){var _0x3a5ddf=events[_0x4d375b];var _0x39e564=createListener(_0xd5f0('0x7')+_0x3a5ddf,_0x4878ed);SmsQueueEvents['on'](_0x3a5ddf,_0x39e564);}}; \ No newline at end of file +var _0x3f7f=['removeListener','register','length','remove','emit'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0x3f7f,0x1b1));var _0xf3f7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3f7f[_0x14add3];return _0x4a174f;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=['save',_0xf3f7('0x0'),'update'];function createListener(_0x2001a2,_0x93a021){return function(_0x4411af){_0x93a021[_0xf3f7('0x1')](_0x2001a2,_0x4411af);};}function removeListener(_0xdbe63e,_0x2b3342){return function(){SmsQueueEvents[_0xf3f7('0x2')](_0xdbe63e,_0x2b3342);};}exports[_0xf3f7('0x3')]=function(_0x47a4ef){for(var _0x502e63=0x0,_0x18ae69=events[_0xf3f7('0x4')];_0x502e63<_0x18ae69;_0x502e63++){var _0x4d9fab=events[_0x502e63];var _0x53a96b=createListener('smsQueue:'+_0x4d9fab,_0x47a4ef);SmsQueueEvents['on'](_0x4d9fab,_0x53a96b);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index e9eb26b..5aab0c3 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 _0xb564=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','put','delete'];(function(_0xe7bfd0,_0xce701d){var _0x382ff8=function(_0x50f108){while(--_0x50f108){_0xe7bfd0['push'](_0xe7bfd0['shift']());}};_0x382ff8(++_0xce701d);}(_0xb564,0x1d0));var _0x4b56=function(_0xf0ed6d,_0x16524a){_0xf0ed6d=_0xf0ed6d-0x0;var _0x303701=_0xb564[_0xf0ed6d];return _0x303701;};'use strict';var multer=require(_0x4b56('0x0'));var util=require(_0x4b56('0x1'));var path=require(_0x4b56('0x2'));var timeout=require(_0x4b56('0x3'));var express=require(_0x4b56('0x4'));var router=express[_0x4b56('0x5')]();var auth=require(_0x4b56('0x6'));var interaction=require(_0x4b56('0x7'));var config=require(_0x4b56('0x8'));var controller=require(_0x4b56('0x9'));router[_0x4b56('0xa')]('/',auth[_0x4b56('0xb')](),controller[_0x4b56('0xc')]);router['get'](_0x4b56('0xd'),auth[_0x4b56('0xb')](),controller[_0x4b56('0xe')]);router['get'](_0x4b56('0xf'),auth[_0x4b56('0xb')](),controller['show']);router[_0x4b56('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4b56('0x11')](_0x4b56('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x4b56('0x12')]('/:id',auth[_0x4b56('0xb')](),controller[_0x4b56('0x13')]);module[_0x4b56('0x14')]=router; \ No newline at end of file +var _0xc21f=['describe','show','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','/describe'];(function(_0x2a6d3c,_0xfd559a){var _0x4d445a=function(_0x34f2a8){while(--_0x34f2a8){_0x2a6d3c['push'](_0x2a6d3c['shift']());}};_0x4d445a(++_0xfd559a);}(_0xc21f,0x195));var _0xfc21=function(_0x572fb0,_0x3dbc6d){_0x572fb0=_0x572fb0-0x0;var _0x106aba=_0xc21f[_0x572fb0];return _0x106aba;};'use strict';var multer=require(_0xfc21('0x0'));var util=require(_0xfc21('0x1'));var path=require(_0xfc21('0x2'));var timeout=require(_0xfc21('0x3'));var express=require(_0xfc21('0x4'));var router=express[_0xfc21('0x5')]();var auth=require(_0xfc21('0x6'));var interaction=require(_0xfc21('0x7'));var config=require(_0xfc21('0x8'));var controller=require(_0xfc21('0x9'));router[_0xfc21('0xa')]('/',auth[_0xfc21('0xb')](),controller['index']);router[_0xfc21('0xa')](_0xfc21('0xc'),auth['isAuthenticated'](),controller[_0xfc21('0xd')]);router[_0xfc21('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xfc21('0xe')]);router['post']('/',auth[_0xfc21('0xb')](),controller[_0xfc21('0xf')]);router[_0xfc21('0x10')](_0xfc21('0x11'),auth[_0xfc21('0xb')](),controller[_0xfc21('0x12')]);router[_0xfc21('0x13')](_0xfc21('0x11'),auth[_0xfc21('0xb')](),controller[_0xfc21('0x14')]);module[_0xfc21('0x15')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index cadf3b6..92fd57e 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 _0xc831=['moment','sequelize','DATE','STRING'];(function(_0x169f47,_0x35884c){var _0x23f0c3=function(_0x549bb7){while(--_0x549bb7){_0x169f47['push'](_0x169f47['shift']());}};_0x23f0c3(++_0x35884c);}(_0xc831,0x190));var _0x1c83=function(_0x3fd3dd,_0x310cee){_0x3fd3dd=_0x3fd3dd-0x0;var _0x5a80e2=_0xc831[_0x3fd3dd];return _0x5a80e2;};'use strict';var moment=require(_0x1c83('0x0'));var Sequelize=require(_0x1c83('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x1c83('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x1c83('0x2')]},'exitAt':{'type':Sequelize[_0x1c83('0x2')]},'reason':{'type':Sequelize[_0x1c83('0x3')]}}; \ No newline at end of file +var _0xc4c8=['DATE','sequelize','STRING'];(function(_0x23b3a7,_0x335ef3){var _0x2a20fb=function(_0x327bff){while(--_0x327bff){_0x23b3a7['push'](_0x23b3a7['shift']());}};_0x2a20fb(++_0x335ef3);}(_0xc4c8,0x70));var _0x8c4c=function(_0x32b966,_0x324f06){_0x32b966=_0x32b966-0x0;var _0x19b9b0=_0xc4c8[_0x32b966];return _0x19b9b0;};'use strict';var moment=require('moment');var Sequelize=require(_0x8c4c('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x8c4c('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x8c4c('0x1')]},'joinAt':{'type':Sequelize[_0x8c4c('0x2')]},'leaveAt':{'type':Sequelize[_0x8c4c('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x8c4c('0x1')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 0e69c97..adf10d4 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 _0x73d5=['html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','SmsQueueReport','count','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','describe'];(function(_0x4d1ee9,_0x394a78){var _0x9a5456=function(_0x224f3b){while(--_0x224f3b){_0x4d1ee9['push'](_0x4d1ee9['shift']());}};_0x9a5456(++_0x394a78);}(_0x73d5,0x1c2));var _0x573d=function(_0x1341a8,_0x31b787){_0x1341a8=_0x1341a8-0x0;var _0x551b2d=_0x73d5[_0x1341a8];return _0x551b2d;};'use strict';var pdf=require(_0x573d('0x0'));var emlformat=require(_0x573d('0x1'));var rimraf=require(_0x573d('0x2'));var zipdir=require(_0x573d('0x3'));var jsonpatch=require(_0x573d('0x4'));var rp=require('request-promise');var moment=require(_0x573d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x573d('0x6'));var util=require(_0x573d('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x573d('0x8'));var ejs=require(_0x573d('0x9'));var fs=require('fs');var _=require(_0x573d('0xa'));var squel=require(_0x573d('0xb'));var crypto=require('crypto');var jsforce=require(_0x573d('0xc'));var deskjs=require(_0x573d('0xd'));var toCsv=require('to-csv');var querystring=require(_0x573d('0xe'));var Papa=require('papaparse');var Redis=require(_0x573d('0xf'));var authService=require(_0x573d('0x10'));var qs=require(_0x573d('0x11'));var as=require(_0x573d('0x12'));var hardwareService=require(_0x573d('0x13'));var logger=require(_0x573d('0x14'))('api');var utils=require(_0x573d('0x15'));var config=require(_0x573d('0x16'));var db=require(_0x573d('0x17'))['db'];function respondWithStatusCode(_0x53a64b,_0x422d03){_0x422d03=_0x422d03||0xcc;return function(_0x3a0b74){if(_0x3a0b74){return _0x53a64b[_0x573d('0x18')](_0x422d03);}return _0x53a64b[_0x573d('0x19')](_0x422d03)['end']();};}function respondWithResult(_0x147723,_0x1d0b45){_0x1d0b45=_0x1d0b45||0xc8;return function(_0x25d803){if(_0x25d803){return _0x147723[_0x573d('0x19')](_0x1d0b45)[_0x573d('0x1a')](_0x25d803);}};}function respondWithFilteredResult(_0x3223d5,_0x23170c){return function(_0x1b98a9){if(_0x1b98a9){var _0x30f07b=_0x1b98a9['count'],_0xe02d2c=_0x23170c['offset'],_0x116811=_0x23170c[_0x573d('0x1b')]+_0x23170c[_0x573d('0x1c')],_0x1cf366;if(_0x116811>=_0x30f07b){_0x116811=_0x30f07b;_0x1cf366=0xc8;}else{_0x1cf366=0xce;}_0x3223d5['status'](_0x1cf366);return _0x3223d5['set'](_0x573d('0x1d'),_0xe02d2c+'-'+_0x116811+'/'+_0x30f07b)[_0x573d('0x1a')](_0x1b98a9);}return null;};}function patchUpdates(_0xd516b8){return function(_0x34000b){try{jsonpatch[_0x573d('0x1e')](_0x34000b,_0xd516b8,!![]);}catch(_0x4285f5){return BPromise[_0x573d('0x1f')](_0x4285f5);}return _0x34000b['save']();};}function saveUpdates(_0x25b759,_0x18e27f){return function(_0x39fa9c){if(_0x39fa9c){return _0x39fa9c[_0x573d('0x20')](_0x25b759)[_0x573d('0x21')](function(_0x4ad287){return _0x4ad287;});}return null;};}function removeEntity(_0x17de49,_0x46b111){return function(_0x4056ae){if(_0x4056ae){return _0x4056ae[_0x573d('0x22')]()[_0x573d('0x21')](function(){_0x17de49['status'](0xcc)[_0x573d('0x23')]();});}};}function handleEntityNotFound(_0x48ed52,_0x16a2ce){return function(_0x5b8b3b){if(!_0x5b8b3b){_0x48ed52[_0x573d('0x18')](0x194);}return _0x5b8b3b;};}function handleError(_0x4d6d55,_0x4e4bc5){_0x4e4bc5=_0x4e4bc5||0x1f4;return function(_0x205e44){logger[_0x573d('0x24')](_0x205e44[_0x573d('0x25')]);if(_0x205e44[_0x573d('0x26')]){delete _0x205e44[_0x573d('0x26')];}_0x4d6d55['status'](_0x4e4bc5)[_0x573d('0x27')](_0x205e44);};}exports[_0x573d('0x28')]=function(_0x191209,_0x5cccca){var _0x5811f5={},_0x458cff={},_0x2b9df6={'count':0x0,'rows':[]};var _0x81216=_[_0x573d('0x29')](db['SmsQueueReport'][_0x573d('0x2a')],function(_0x54a9dc){return{'name':_0x54a9dc[_0x573d('0x2b')],'type':_0x54a9dc[_0x573d('0x2c')][_0x573d('0x2d')]};});_0x458cff['model']=_['map'](_0x81216,_0x573d('0x26'));_0x458cff[_0x573d('0x2e')]=_['keys'](_0x191209[_0x573d('0x2e')]);_0x458cff[_0x573d('0x2f')]=_[_0x573d('0x30')](_0x458cff[_0x573d('0x31')],_0x458cff[_0x573d('0x2e')]);_0x5811f5[_0x573d('0x32')]=_[_0x573d('0x30')](_0x458cff['model'],qs[_0x573d('0x33')](_0x191209[_0x573d('0x2e')]['fields']));_0x5811f5[_0x573d('0x32')]=_0x5811f5[_0x573d('0x32')][_0x573d('0x34')]?_0x5811f5[_0x573d('0x32')]:_0x458cff[_0x573d('0x31')];if(!_0x191209['query']['hasOwnProperty'](_0x573d('0x35'))){_0x5811f5[_0x573d('0x1c')]=qs[_0x573d('0x1c')](_0x191209[_0x573d('0x2e')][_0x573d('0x1c')]);_0x5811f5[_0x573d('0x1b')]=qs[_0x573d('0x1b')](_0x191209[_0x573d('0x2e')][_0x573d('0x1b')]);}_0x5811f5[_0x573d('0x36')]=qs[_0x573d('0x37')](_0x191209[_0x573d('0x2e')]['sort']);_0x5811f5[_0x573d('0x38')]=qs[_0x573d('0x2f')](_['pick'](_0x191209[_0x573d('0x2e')],_0x458cff[_0x573d('0x2f')]));if(_0x191209['query'][_0x573d('0x39')]){_0x5811f5[_0x573d('0x38')]=_[_0x573d('0x3a')](_0x5811f5[_0x573d('0x38')],{'$or':_[_0x573d('0x29')](_0x81216,function(_0x4b2b26){if(_0x4b2b26[_0x573d('0x2c')]!==_0x573d('0x3b')){var _0x1e9f51={};_0x1e9f51[_0x4b2b26[_0x573d('0x26')]]={'$like':'%'+_0x191209[_0x573d('0x2e')][_0x573d('0x39')]+'%'};return _0x1e9f51;}})});}_0x5811f5=_[_0x573d('0x3a')]({},_0x5811f5,_0x191209[_0x573d('0x3c')]);var _0x5c70c7={'where':_0x5811f5[_0x573d('0x38')]};return db[_0x573d('0x3d')][_0x573d('0x3e')](_0x5c70c7)[_0x573d('0x21')](function(_0x4a0b14){_0x2b9df6['count']=_0x4a0b14;if(_0x191209[_0x573d('0x2e')][_0x573d('0x3f')]){_0x5811f5[_0x573d('0x40')]=[{'all':!![]}];}return db['SmsQueueReport'][_0x573d('0x41')](_0x5811f5);})[_0x573d('0x21')](function(_0x3d05bf){_0x2b9df6[_0x573d('0x42')]=_0x3d05bf;return _0x2b9df6;})[_0x573d('0x21')](respondWithFilteredResult(_0x5cccca,_0x5811f5))[_0x573d('0x43')](handleError(_0x5cccca,null));};exports[_0x573d('0x44')]=function(_0x224273,_0x3c908c){var _0x5bdef3={'raw':!![],'where':{'id':_0x224273[_0x573d('0x45')]['id']}},_0x566705={};_0x566705[_0x573d('0x31')]=_[_0x573d('0x46')](db['SmsQueueReport'][_0x573d('0x2a')]);_0x566705[_0x573d('0x2e')]=_[_0x573d('0x46')](_0x224273['query']);_0x566705[_0x573d('0x2f')]=_[_0x573d('0x30')](_0x566705[_0x573d('0x31')],_0x566705[_0x573d('0x2e')]);_0x5bdef3[_0x573d('0x32')]=_['intersection'](_0x566705['model'],qs[_0x573d('0x33')](_0x224273[_0x573d('0x2e')][_0x573d('0x33')]));_0x5bdef3[_0x573d('0x32')]=_0x5bdef3[_0x573d('0x32')][_0x573d('0x34')]?_0x5bdef3['attributes']:_0x566705['model'];if(_0x224273['query'][_0x573d('0x3f')]){_0x5bdef3[_0x573d('0x40')]=[{'all':!![]}];}_0x5bdef3=_[_0x573d('0x3a')]({},_0x5bdef3,_0x224273['options']);return db['SmsQueueReport']['find'](_0x5bdef3)['then'](handleEntityNotFound(_0x3c908c,null))[_0x573d('0x21')](respondWithResult(_0x3c908c,null))[_0x573d('0x43')](handleError(_0x3c908c,null));};exports[_0x573d('0x47')]=function(_0x3492a2,_0x67fab2){return db['SmsQueueReport']['create'](_0x3492a2[_0x573d('0x48')],{})[_0x573d('0x21')](respondWithResult(_0x67fab2,0xc9))['catch'](handleError(_0x67fab2,null));};exports[_0x573d('0x20')]=function(_0x40f5cc,_0x2731be){if(_0x40f5cc[_0x573d('0x48')]['id']){delete _0x40f5cc['body']['id'];}return db[_0x573d('0x3d')][_0x573d('0x49')]({'where':{'id':_0x40f5cc['params']['id']}})['then'](handleEntityNotFound(_0x2731be,null))[_0x573d('0x21')](saveUpdates(_0x40f5cc[_0x573d('0x48')],null))[_0x573d('0x21')](respondWithResult(_0x2731be,null))[_0x573d('0x43')](handleError(_0x2731be,null));};exports[_0x573d('0x22')]=function(_0x718cd3,_0x101952){return db[_0x573d('0x3d')][_0x573d('0x49')]({'where':{'id':_0x718cd3[_0x573d('0x45')]['id']}})[_0x573d('0x21')](handleEntityNotFound(_0x101952,null))[_0x573d('0x21')](removeEntity(_0x101952,null))['catch'](handleError(_0x101952,null));};exports[_0x573d('0x4a')]=function(_0x2edf41,_0x122015){return db['SmsQueueReport'][_0x573d('0x4a')]()[_0x573d('0x21')](respondWithResult(_0x122015,null))[_0x573d('0x43')](handleError(_0x122015,null));}; \ No newline at end of file +var _0xc55a=['Content-Range','json','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','SmsQueueReport','rawAttributes','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','pick','filter','where','merge','type','VIRTUAL','count','includeAll','findAll','rows','params','include','options','find','create','body','catch','describe','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','offset'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0xc55a,0x1eb));var _0xac55=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0xc55a[_0x1a9204];return _0x17ca68;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xac55('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xac55('0x1'));var moment=require(_0xac55('0x2'));var BPromise=require(_0xac55('0x3'));var Mustache=require(_0xac55('0x4'));var util=require(_0xac55('0x5'));var path=require(_0xac55('0x6'));var sox=require(_0xac55('0x7'));var csv=require(_0xac55('0x8'));var ejs=require(_0xac55('0x9'));var fs=require('fs');var _=require(_0xac55('0xa'));var squel=require(_0xac55('0xb'));var crypto=require('crypto');var jsforce=require(_0xac55('0xc'));var deskjs=require(_0xac55('0xd'));var toCsv=require('to-csv');var querystring=require(_0xac55('0xe'));var Papa=require('papaparse');var Redis=require(_0xac55('0xf'));var authService=require(_0xac55('0x10'));var qs=require(_0xac55('0x11'));var as=require(_0xac55('0x12'));var hardwareService=require(_0xac55('0x13'));var logger=require(_0xac55('0x14'))(_0xac55('0x15'));var utils=require(_0xac55('0x16'));var config=require(_0xac55('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x343e4c,_0x530ffe){_0x530ffe=_0x530ffe||0xcc;return function(_0x4a1eec){if(_0x4a1eec){return _0x343e4c['sendStatus'](_0x530ffe);}return _0x343e4c[_0xac55('0x18')](_0x530ffe)[_0xac55('0x19')]();};}function respondWithResult(_0x3f052d,_0xd90960){_0xd90960=_0xd90960||0xc8;return function(_0xe6fc1a){if(_0xe6fc1a){return _0x3f052d['status'](_0xd90960)['json'](_0xe6fc1a);}};}function respondWithFilteredResult(_0x5d3223,_0x268d1e){return function(_0x52b857){if(_0x52b857){var _0x2d5af0=_0x52b857['count'],_0x36e724=_0x268d1e[_0xac55('0x1a')],_0x30439c=_0x268d1e['offset']+_0x268d1e['limit'],_0x24bbf6;if(_0x30439c>=_0x2d5af0){_0x30439c=_0x2d5af0;_0x24bbf6=0xc8;}else{_0x24bbf6=0xce;}_0x5d3223[_0xac55('0x18')](_0x24bbf6);return _0x5d3223['set'](_0xac55('0x1b'),_0x36e724+'-'+_0x30439c+'/'+_0x2d5af0)[_0xac55('0x1c')](_0x52b857);}return null;};}function patchUpdates(_0x5b3680){return function(_0x3cbb8b){try{jsonpatch['apply'](_0x3cbb8b,_0x5b3680,!![]);}catch(_0x2e7110){return BPromise[_0xac55('0x1d')](_0x2e7110);}return _0x3cbb8b[_0xac55('0x1e')]();};}function saveUpdates(_0x2eec82,_0x26a868){return function(_0x44fb7a){if(_0x44fb7a){return _0x44fb7a[_0xac55('0x1f')](_0x2eec82)['then'](function(_0x566404){return _0x566404;});}return null;};}function removeEntity(_0x5cf91c,_0x474dcb){return function(_0x4e537f){if(_0x4e537f){return _0x4e537f[_0xac55('0x20')]()[_0xac55('0x21')](function(){_0x5cf91c[_0xac55('0x18')](0xcc)[_0xac55('0x19')]();});}};}function handleEntityNotFound(_0x59de37,_0x1367e1){return function(_0x49eb24){if(!_0x49eb24){_0x59de37[_0xac55('0x22')](0x194);}return _0x49eb24;};}function handleError(_0x5f2de4,_0x4e2ca9){_0x4e2ca9=_0x4e2ca9||0x1f4;return function(_0x2d7632){logger[_0xac55('0x23')](_0x2d7632[_0xac55('0x24')]);if(_0x2d7632['name']){delete _0x2d7632[_0xac55('0x25')];}_0x5f2de4[_0xac55('0x18')](_0x4e2ca9)[_0xac55('0x26')](_0x2d7632);};}exports[_0xac55('0x27')]=function(_0x5e6a68,_0x5cb43d){var _0x512cfb={},_0x570b1d={},_0x31b014={'count':0x0,'rows':[]};var _0x230f85=_[_0xac55('0x28')](db[_0xac55('0x29')][_0xac55('0x2a')],function(_0x5bb9e6){return{'name':_0x5bb9e6['fieldName'],'type':_0x5bb9e6['type'][_0xac55('0x2b')]};});_0x570b1d[_0xac55('0x2c')]=_[_0xac55('0x28')](_0x230f85,_0xac55('0x25'));_0x570b1d['query']=_[_0xac55('0x2d')](_0x5e6a68[_0xac55('0x2e')]);_0x570b1d[_0xac55('0x2f')]=_['intersection'](_0x570b1d[_0xac55('0x2c')],_0x570b1d[_0xac55('0x2e')]);_0x512cfb[_0xac55('0x30')]=_[_0xac55('0x31')](_0x570b1d[_0xac55('0x2c')],qs[_0xac55('0x32')](_0x5e6a68['query'][_0xac55('0x32')]));_0x512cfb['attributes']=_0x512cfb[_0xac55('0x30')][_0xac55('0x33')]?_0x512cfb['attributes']:_0x570b1d['model'];if(!_0x5e6a68['query'][_0xac55('0x34')](_0xac55('0x35'))){_0x512cfb[_0xac55('0x36')]=qs['limit'](_0x5e6a68[_0xac55('0x2e')][_0xac55('0x36')]);_0x512cfb[_0xac55('0x1a')]=qs[_0xac55('0x1a')](_0x5e6a68[_0xac55('0x2e')][_0xac55('0x1a')]);}_0x512cfb['order']=qs['sort'](_0x5e6a68[_0xac55('0x2e')][_0xac55('0x37')]);_0x512cfb['where']=qs[_0xac55('0x2f')](_[_0xac55('0x38')](_0x5e6a68[_0xac55('0x2e')],_0x570b1d[_0xac55('0x2f')]));if(_0x5e6a68[_0xac55('0x2e')][_0xac55('0x39')]){_0x512cfb[_0xac55('0x3a')]=_[_0xac55('0x3b')](_0x512cfb[_0xac55('0x3a')],{'$or':_[_0xac55('0x28')](_0x230f85,function(_0x46185d){if(_0x46185d[_0xac55('0x3c')]!==_0xac55('0x3d')){var _0x1fd3bc={};_0x1fd3bc[_0x46185d[_0xac55('0x25')]]={'$like':'%'+_0x5e6a68[_0xac55('0x2e')][_0xac55('0x39')]+'%'};return _0x1fd3bc;}})});}_0x512cfb=_['merge']({},_0x512cfb,_0x5e6a68['options']);var _0x342421={'where':_0x512cfb['where']};return db[_0xac55('0x29')][_0xac55('0x3e')](_0x342421)[_0xac55('0x21')](function(_0x1d3f41){_0x31b014[_0xac55('0x3e')]=_0x1d3f41;if(_0x5e6a68['query'][_0xac55('0x3f')]){_0x512cfb['include']=[{'all':!![]}];}return db[_0xac55('0x29')][_0xac55('0x40')](_0x512cfb);})[_0xac55('0x21')](function(_0x123f3e){_0x31b014[_0xac55('0x41')]=_0x123f3e;return _0x31b014;})['then'](respondWithFilteredResult(_0x5cb43d,_0x512cfb))['catch'](handleError(_0x5cb43d,null));};exports['show']=function(_0x13b1a0,_0x10077c){var _0xeef3de={'raw':!![],'where':{'id':_0x13b1a0[_0xac55('0x42')]['id']}},_0x319dc7={};_0x319dc7['model']=_[_0xac55('0x2d')](db[_0xac55('0x29')][_0xac55('0x2a')]);_0x319dc7[_0xac55('0x2e')]=_[_0xac55('0x2d')](_0x13b1a0[_0xac55('0x2e')]);_0x319dc7[_0xac55('0x2f')]=_['intersection'](_0x319dc7[_0xac55('0x2c')],_0x319dc7[_0xac55('0x2e')]);_0xeef3de['attributes']=_[_0xac55('0x31')](_0x319dc7['model'],qs[_0xac55('0x32')](_0x13b1a0[_0xac55('0x2e')]['fields']));_0xeef3de[_0xac55('0x30')]=_0xeef3de[_0xac55('0x30')]['length']?_0xeef3de['attributes']:_0x319dc7[_0xac55('0x2c')];if(_0x13b1a0['query'][_0xac55('0x3f')]){_0xeef3de[_0xac55('0x43')]=[{'all':!![]}];}_0xeef3de=_['merge']({},_0xeef3de,_0x13b1a0[_0xac55('0x44')]);return db['SmsQueueReport'][_0xac55('0x45')](_0xeef3de)['then'](handleEntityNotFound(_0x10077c,null))[_0xac55('0x21')](respondWithResult(_0x10077c,null))['catch'](handleError(_0x10077c,null));};exports['create']=function(_0x8a7c5d,_0x428bff){return db[_0xac55('0x29')][_0xac55('0x46')](_0x8a7c5d[_0xac55('0x47')],{})['then'](respondWithResult(_0x428bff,0xc9))[_0xac55('0x48')](handleError(_0x428bff,null));};exports[_0xac55('0x1f')]=function(_0x3ec631,_0xb24d17){if(_0x3ec631[_0xac55('0x47')]['id']){delete _0x3ec631[_0xac55('0x47')]['id'];}return db[_0xac55('0x29')]['find']({'where':{'id':_0x3ec631[_0xac55('0x42')]['id']}})[_0xac55('0x21')](handleEntityNotFound(_0xb24d17,null))[_0xac55('0x21')](saveUpdates(_0x3ec631['body'],null))['then'](respondWithResult(_0xb24d17,null))[_0xac55('0x48')](handleError(_0xb24d17,null));};exports[_0xac55('0x20')]=function(_0x136786,_0x28cffc){return db[_0xac55('0x29')]['find']({'where':{'id':_0x136786[_0xac55('0x42')]['id']}})['then'](handleEntityNotFound(_0x28cffc,null))[_0xac55('0x21')](removeEntity(_0x28cffc,null))['catch'](handleError(_0x28cffc,null));};exports[_0xac55('0x49')]=function(_0x23d5c6,_0x48ec42){return db['SmsQueueReport'][_0xac55('0x49')]()[_0xac55('0x21')](respondWithResult(_0x48ec42,null))[_0xac55('0x48')](handleError(_0x48ec42,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index bad07a8..b3b4479 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 _0xc459=['util','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SmsQueueReport','uniqueid'];(function(_0xb915df,_0x2aa26a){var _0x52bbe5=function(_0x552166){while(--_0x552166){_0xb915df['push'](_0xb915df['shift']());}};_0x52bbe5(++_0x2aa26a);}(_0xc459,0x1d9));var _0x9c45=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc459[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x9c45('0x0'));var logger=require('../../config/logger')(_0x9c45('0x1'));var moment=require('moment');var BPromise=require(_0x9c45('0x2'));var rp=require(_0x9c45('0x3'));var fs=require('fs');var path=require(_0x9c45('0x4'));var rimraf=require(_0x9c45('0x5'));var config=require(_0x9c45('0x6'));var attributes=require('./smsQueueReport.attributes');module[_0x9c45('0x7')]=function(_0x3fcb9f,_0x4ae79d){return _0x3fcb9f[_0x9c45('0x8')](_0x9c45('0x9'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0x9c45('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x53d1=['request-promise','path','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','uniqueid','lodash','util','api','moment','bluebird'];(function(_0x1ac120,_0x3e7e45){var _0x19b703=function(_0x5f32cb){while(--_0x5f32cb){_0x1ac120['push'](_0x1ac120['shift']());}};_0x19b703(++_0x3e7e45);}(_0x53d1,0x174));var _0x153d=function(_0x5f0b64,_0x5a9ecb){_0x5f0b64=_0x5f0b64-0x0;var _0x299ff9=_0x53d1[_0x5f0b64];return _0x299ff9;};'use strict';var _=require(_0x153d('0x0'));var util=require(_0x153d('0x1'));var logger=require('../../config/logger')(_0x153d('0x2'));var moment=require(_0x153d('0x3'));var BPromise=require(_0x153d('0x4'));var rp=require(_0x153d('0x5'));var fs=require('fs');var path=require(_0x153d('0x6'));var rimraf=require('rimraf');var config=require(_0x153d('0x7'));var attributes=require(_0x153d('0x8'));module[_0x153d('0x9')]=function(_0x557bed,_0x417850){return _0x557bed[_0x153d('0xa')](_0x153d('0xb'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0x153d('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 8d86695..116f0bd 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 _0xd151=['info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','then','UpdateSmsQueueReport','update','where','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x1e4ca2,_0x195cac){var _0x160003=function(_0x4ac393){while(--_0x4ac393){_0x1e4ca2['push'](_0x1e4ca2['shift']());}};_0x160003(++_0x195cac);}(_0xd151,0x1c6));var _0x1d15=function(_0x3aaef5,_0x16cdc8){_0x3aaef5=_0x3aaef5-0x0;var _0x4c0ed5=_0xd151[_0x3aaef5];return _0x4c0ed5;};'use strict';var _=require(_0x1d15('0x0'));var util=require(_0x1d15('0x1'));var moment=require(_0x1d15('0x2'));var BPromise=require(_0x1d15('0x3'));var rs=require(_0x1d15('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1d15('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1d15('0x6'))(_0x1d15('0x7'));var config=require(_0x1d15('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1d15('0x9')][_0x1d15('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x34edb5,_0xd70504,_0x121638){return new BPromise(function(_0x548e1a,_0x2cf12c){return client['request'](_0x34edb5,_0x121638)['then'](function(_0x36c518){logger[_0x1d15('0xb')](_0x1d15('0xc'),_0xd70504,_0x1d15('0xd'));logger[_0x1d15('0xe')](_0x1d15('0xf'),_0xd70504,_0x1d15('0xd'),JSON[_0x1d15('0x10')](_0x36c518));if(_0x36c518['error']){if(_0x36c518[_0x1d15('0x11')]['code']===0x1f4){logger[_0x1d15('0x11')](_0x1d15('0xc'),_0xd70504,_0x36c518[_0x1d15('0x11')][_0x1d15('0x12')]);return _0x2cf12c(_0x36c518[_0x1d15('0x11')][_0x1d15('0x12')]);}logger[_0x1d15('0x11')]('SmsQueueReport,\x20%s,\x20%s',_0xd70504,_0x36c518[_0x1d15('0x11')]['message']);return _0x548e1a(_0x36c518[_0x1d15('0x11')][_0x1d15('0x12')]);}else{logger[_0x1d15('0xb')](_0x1d15('0xc'),_0xd70504,'request\x20sent');_0x548e1a(_0x36c518['result'][_0x1d15('0x12')]);}})[_0x1d15('0x13')](function(_0x432e19){logger['error']('SmsQueueReport,\x20%s,\x20%s',_0xd70504,_0x432e19);_0x2cf12c(_0x432e19);});});}exports[_0x1d15('0x14')]=function(_0x4c9df2){var _0xebad36=this;return new Promise(function(_0x518216,_0x54ee3d){return db[_0x1d15('0x15')][_0x1d15('0x16')](_0x4c9df2[_0x1d15('0x17')],{'raw':_0x4c9df2[_0x1d15('0x18')]?_0x4c9df2[_0x1d15('0x18')][_0x1d15('0x19')]===undefined?!![]:![]:!![]})[_0x1d15('0x1a')](function(_0x4e6459){logger[_0x1d15('0xb')](_0x1d15('0x14'),_0x4c9df2);logger[_0x1d15('0xe')](_0x1d15('0x14'),_0x4c9df2,JSON[_0x1d15('0x10')](_0x4e6459));_0x518216(_0x4e6459);})['catch'](function(_0x1c694b){logger['error'](_0x1d15('0x14'),_0x1c694b[_0x1d15('0x12')],_0x4c9df2);_0x54ee3d(_0xebad36[_0x1d15('0x11')](0x1f4,_0x1c694b[_0x1d15('0x12')]));});});};exports[_0x1d15('0x1b')]=function(_0x286ad7){var _0x2df5d6=this;return new Promise(function(_0x176be5,_0x354cfd){return db[_0x1d15('0x15')][_0x1d15('0x1c')](_0x286ad7['body'],{'raw':_0x286ad7[_0x1d15('0x18')]?_0x286ad7[_0x1d15('0x18')][_0x1d15('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x286ad7[_0x1d15('0x18')]?_0x286ad7[_0x1d15('0x18')][_0x1d15('0x1d')]||null:null,'attributes':_0x286ad7['options']?_0x286ad7['options']['attributes']||null:null,'limit':_0x286ad7[_0x1d15('0x18')]?_0x286ad7[_0x1d15('0x18')][_0x1d15('0x1e')]||null:null})[_0x1d15('0x1a')](function(_0x326354){logger['info']('UpdateSmsQueueReport',_0x286ad7);logger[_0x1d15('0xe')]('UpdateSmsQueueReport',_0x286ad7,JSON[_0x1d15('0x10')](_0x326354));_0x176be5(_0x326354);})[_0x1d15('0x13')](function(_0x2c4ef8){logger['error'](_0x1d15('0x1b'),_0x2c4ef8['message'],_0x286ad7);_0x354cfd(_0x2df5d6[_0x1d15('0x11')](0x1f4,_0x2c4ef8[_0x1d15('0x12')]));});});}; \ No newline at end of file +var _0xeab5=['code','message','SmsQueueReport,\x20%s,\x20%s','result','catch','SmsQueueReport','body','options','raw','CreateSmsQueueReport','debug','update','where','attributes','limit','UpdateSmsQueueReport','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xf06a2e,_0x3027ac){var _0x511b96=function(_0x5781cc){while(--_0x5781cc){_0xf06a2e['push'](_0xf06a2e['shift']());}};_0x511b96(++_0x3027ac);}(_0xeab5,0x150));var _0x5eab=function(_0x2c1fb0,_0x34760e){_0x2c1fb0=_0x2c1fb0-0x0;var _0xc861e4=_0xeab5[_0x2c1fb0];return _0xc861e4;};'use strict';var _=require('lodash');var util=require(_0x5eab('0x0'));var moment=require('moment');var BPromise=require(_0x5eab('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5eab('0x2'))['db'];var utils=require(_0x5eab('0x3'));var logger=require(_0x5eab('0x4'))(_0x5eab('0x5'));var config=require(_0x5eab('0x6'));var jayson=require(_0x5eab('0x7'));var client=jayson[_0x5eab('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14dc33,_0xf0f650,_0x188d6f){return new BPromise(function(_0x16dbd0,_0x385914){return client[_0x5eab('0x9')](_0x14dc33,_0x188d6f)[_0x5eab('0xa')](function(_0x4347b2){logger[_0x5eab('0xb')]('SmsQueueReport,\x20%s,\x20%s',_0xf0f650,_0x5eab('0xc'));logger['debug'](_0x5eab('0xd'),_0xf0f650,_0x5eab('0xc'),JSON[_0x5eab('0xe')](_0x4347b2));if(_0x4347b2[_0x5eab('0xf')]){if(_0x4347b2[_0x5eab('0xf')][_0x5eab('0x10')]===0x1f4){logger[_0x5eab('0xf')]('SmsQueueReport,\x20%s,\x20%s',_0xf0f650,_0x4347b2['error'][_0x5eab('0x11')]);return _0x385914(_0x4347b2[_0x5eab('0xf')][_0x5eab('0x11')]);}logger['error'](_0x5eab('0x12'),_0xf0f650,_0x4347b2['error'][_0x5eab('0x11')]);return _0x16dbd0(_0x4347b2[_0x5eab('0xf')]['message']);}else{logger['info']('SmsQueueReport,\x20%s,\x20%s',_0xf0f650,_0x5eab('0xc'));_0x16dbd0(_0x4347b2[_0x5eab('0x13')][_0x5eab('0x11')]);}})[_0x5eab('0x14')](function(_0xc531df){logger['error']('SmsQueueReport,\x20%s,\x20%s',_0xf0f650,_0xc531df);_0x385914(_0xc531df);});});}exports['CreateSmsQueueReport']=function(_0x19192c){var _0xb299e8=this;return new Promise(function(_0x177ecb,_0xcfecd){return db[_0x5eab('0x15')]['create'](_0x19192c[_0x5eab('0x16')],{'raw':_0x19192c[_0x5eab('0x17')]?_0x19192c[_0x5eab('0x17')][_0x5eab('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x131e59){logger[_0x5eab('0xb')](_0x5eab('0x19'),_0x19192c);logger[_0x5eab('0x1a')](_0x5eab('0x19'),_0x19192c,JSON[_0x5eab('0xe')](_0x131e59));_0x177ecb(_0x131e59);})[_0x5eab('0x14')](function(_0x436b2b){logger[_0x5eab('0xf')](_0x5eab('0x19'),_0x436b2b['message'],_0x19192c);_0xcfecd(_0xb299e8[_0x5eab('0xf')](0x1f4,_0x436b2b[_0x5eab('0x11')]));});});};exports['UpdateSmsQueueReport']=function(_0x52cc72){var _0xd803b=this;return new Promise(function(_0x26e689,_0x27a1ed){return db[_0x5eab('0x15')][_0x5eab('0x1b')](_0x52cc72['body'],{'raw':_0x52cc72['options']?_0x52cc72[_0x5eab('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x52cc72['options']?_0x52cc72['options'][_0x5eab('0x1c')]||null:null,'attributes':_0x52cc72[_0x5eab('0x17')]?_0x52cc72[_0x5eab('0x17')][_0x5eab('0x1d')]||null:null,'limit':_0x52cc72[_0x5eab('0x17')]?_0x52cc72[_0x5eab('0x17')][_0x5eab('0x1e')]||null:null})[_0x5eab('0xa')](function(_0xd1b5a4){logger[_0x5eab('0xb')](_0x5eab('0x1f'),_0x52cc72);logger[_0x5eab('0x1a')](_0x5eab('0x1f'),_0x52cc72,JSON[_0x5eab('0xe')](_0xd1b5a4));_0x26e689(_0xd1b5a4);})['catch'](function(_0x3ade30){logger['error'](_0x5eab('0x1f'),_0x3ade30[_0x5eab('0x11')],_0x52cc72);_0x27a1ed(_0xd803b[_0x5eab('0xf')](0x1f4,_0x3ade30[_0x5eab('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index f5ba88b..cee3857 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 _0x13f6=['post','create','put','update','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../config/environment','./smsTransferReport.controller','get','index','/:id','isAuthenticated','show'];(function(_0x6f7c64,_0x4a8555){var _0x16753a=function(_0xbb964c){while(--_0xbb964c){_0x6f7c64['push'](_0x6f7c64['shift']());}};_0x16753a(++_0x4a8555);}(_0x13f6,0x124));var _0x613f=function(_0x5ec82e,_0x203dfd){_0x5ec82e=_0x5ec82e-0x0;var _0x307ed1=_0x13f6[_0x5ec82e];return _0x307ed1;};'use strict';var multer=require(_0x613f('0x0'));var util=require(_0x613f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x613f('0x2'));var router=express[_0x613f('0x3')]();var auth=require(_0x613f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x613f('0x5'));var controller=require(_0x613f('0x6'));router[_0x613f('0x7')]('/',auth['isAuthenticated'](),controller[_0x613f('0x8')]);router[_0x613f('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x613f('0x9'),auth[_0x613f('0xa')](),controller[_0x613f('0xb')]);router[_0x613f('0xc')]('/',auth['isAuthenticated'](),controller[_0x613f('0xd')]);router[_0x613f('0xe')](_0x613f('0x9'),auth['isAuthenticated'](),controller[_0x613f('0xf')]);router[_0x613f('0x10')](_0x613f('0x9'),auth['isAuthenticated'](),controller[_0x613f('0x11')]);module[_0x613f('0x12')]=router; \ No newline at end of file +var _0x5eb8=['../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','describe','post','create','put','/:id','update','exports','path','connect-timeout','express','Router'];(function(_0x18b027,_0x4d0486){var _0x19643f=function(_0x36753b){while(--_0x36753b){_0x18b027['push'](_0x18b027['shift']());}};_0x19643f(++_0x4d0486);}(_0x5eb8,0xb0));var _0x85eb=function(_0x2ef8f1,_0x1280a3){_0x2ef8f1=_0x2ef8f1-0x0;var _0x17498d=_0x5eb8[_0x2ef8f1];return _0x17498d;};'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 auth=require(_0x85eb('0x4'));var interaction=require(_0x85eb('0x5'));var config=require(_0x85eb('0x6'));var controller=require(_0x85eb('0x7'));router[_0x85eb('0x8')]('/',auth[_0x85eb('0x9')](),controller[_0x85eb('0xa')]);router[_0x85eb('0x8')]('/describe',auth[_0x85eb('0x9')](),controller[_0x85eb('0xb')]);router[_0x85eb('0x8')]('/:id',auth[_0x85eb('0x9')](),controller['show']);router[_0x85eb('0xc')]('/',auth[_0x85eb('0x9')](),controller[_0x85eb('0xd')]);router[_0x85eb('0xe')](_0x85eb('0xf'),auth[_0x85eb('0x9')](),controller[_0x85eb('0x10')]);router['delete'](_0x85eb('0xf'),auth[_0x85eb('0x9')](),controller['destroy']);module[_0x85eb('0x11')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index cd6f6fb..dd5ee7a 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 _0x7e33=['account','queue','DATE','NOW','moment','sequelize','STRING','ENUM'];(function(_0x473ee7,_0x4dd754){var _0x30f0d4=function(_0x4d961d){while(--_0x4d961d){_0x473ee7['push'](_0x473ee7['shift']());}};_0x30f0d4(++_0x4dd754);}(_0x7e33,0xfc));var _0x37e3=function(_0x10ff2b,_0x9a8e29){_0x10ff2b=_0x10ff2b-0x0;var _0x2a19fd=_0x7e33[_0x10ff2b];return _0x2a19fd;};'use strict';var moment=require(_0x37e3('0x0'));var Sequelize=require(_0x37e3('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x37e3('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x37e3('0x3')](_0x37e3('0x4'),'agent',_0x37e3('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0x37e3('0x6')],'allowNull':![],'defaultValue':Sequelize[_0x37e3('0x7')]}}; \ No newline at end of file +var _0x07b4=['STRING','queue','DATE','NOW','sequelize','exports'];(function(_0x3559e6,_0x4e0644){var _0x821f6f=function(_0xe1cbfc){while(--_0xe1cbfc){_0x3559e6['push'](_0x3559e6['shift']());}};_0x821f6f(++_0x4e0644);}(_0x07b4,0x154));var _0x407b=function(_0x347d94,_0xcb9e7d){_0x347d94=_0x347d94-0x0;var _0xc6961c=_0x07b4[_0x347d94];return _0xc6961c;};'use strict';var moment=require('moment');var Sequelize=require(_0x407b('0x0'));module[_0x407b('0x1')]={'uniqueid':{'type':Sequelize[_0x407b('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('account','agent',_0x407b('0x3')),'allowNull':![],'defaultValue':_0x407b('0x3')},'transferredAt':{'type':Sequelize[_0x407b('0x4')],'allowNull':![],'defaultValue':Sequelize[_0x407b('0x5')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index fbd5b79..bb605a4 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 _0x991b=['fast-json-patch','moment','bluebird','mustache','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','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','update','then','error','stack','name','index','map','SmsTransferReport','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','filter','where','merge','options','includeAll','include','findAll','params','find','catch','create','body','describe','eml-format','rimraf','zip-dir'];(function(_0x55ae99,_0x3c741c){var _0x3283f2=function(_0x2d0a97){while(--_0x2d0a97){_0x55ae99['push'](_0x55ae99['shift']());}};_0x3283f2(++_0x3c741c);}(_0x991b,0x10d));var _0xb991=function(_0x5cccf1,_0x45e75d){_0x5cccf1=_0x5cccf1-0x0;var _0x11ac12=_0x991b[_0x5cccf1];return _0x11ac12;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb991('0x0'));var rimraf=require(_0xb991('0x1'));var zipdir=require(_0xb991('0x2'));var jsonpatch=require(_0xb991('0x3'));var rp=require('request-promise');var moment=require(_0xb991('0x4'));var BPromise=require(_0xb991('0x5'));var Mustache=require(_0xb991('0x6'));var util=require('util');var path=require('path');var sox=require(_0xb991('0x7'));var csv=require(_0xb991('0x8'));var ejs=require(_0xb991('0x9'));var fs=require('fs');var _=require(_0xb991('0xa'));var squel=require(_0xb991('0xb'));var crypto=require(_0xb991('0xc'));var jsforce=require(_0xb991('0xd'));var deskjs=require(_0xb991('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb991('0xf'));var Papa=require(_0xb991('0x10'));var Redis=require(_0xb991('0x11'));var authService=require(_0xb991('0x12'));var qs=require(_0xb991('0x13'));var as=require(_0xb991('0x14'));var hardwareService=require(_0xb991('0x15'));var logger=require(_0xb991('0x16'))(_0xb991('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xb991('0x18'))['db'];function respondWithStatusCode(_0x3b5834,_0x297e00){_0x297e00=_0x297e00||0xcc;return function(_0x324599){if(_0x324599){return _0x3b5834[_0xb991('0x19')](_0x297e00);}return _0x3b5834[_0xb991('0x1a')](_0x297e00)[_0xb991('0x1b')]();};}function respondWithResult(_0x59e02b,_0x215643){_0x215643=_0x215643||0xc8;return function(_0x5d8e60){if(_0x5d8e60){return _0x59e02b[_0xb991('0x1a')](_0x215643)[_0xb991('0x1c')](_0x5d8e60);}};}function respondWithFilteredResult(_0x2494e7,_0x208db8){return function(_0x298d2a){if(_0x298d2a){var _0x5d5979=_0x298d2a[_0xb991('0x1d')],_0x157e5b=_0x208db8[_0xb991('0x1e')],_0x148db8=_0x208db8['offset']+_0x208db8[_0xb991('0x1f')],_0x2fe64c;if(_0x148db8>=_0x5d5979){_0x148db8=_0x5d5979;_0x2fe64c=0xc8;}else{_0x2fe64c=0xce;}_0x2494e7[_0xb991('0x1a')](_0x2fe64c);return _0x2494e7[_0xb991('0x20')](_0xb991('0x21'),_0x157e5b+'-'+_0x148db8+'/'+_0x5d5979)['json'](_0x298d2a);}return null;};}function patchUpdates(_0x5b01cd){return function(_0x4f814f){try{jsonpatch['apply'](_0x4f814f,_0x5b01cd,!![]);}catch(_0x479fec){return BPromise[_0xb991('0x22')](_0x479fec);}return _0x4f814f['save']();};}function saveUpdates(_0x1a8917,_0x9178f2){return function(_0x3380bb){if(_0x3380bb){return _0x3380bb[_0xb991('0x23')](_0x1a8917)['then'](function(_0x3249c3){return _0x3249c3;});}return null;};}function removeEntity(_0x25c7c1,_0x3c301c){return function(_0x1bbd9b){if(_0x1bbd9b){return _0x1bbd9b['destroy']()[_0xb991('0x24')](function(){_0x25c7c1[_0xb991('0x1a')](0xcc)[_0xb991('0x1b')]();});}};}function handleEntityNotFound(_0x64a9b8,_0x44b6d4){return function(_0x5aa0da){if(!_0x5aa0da){_0x64a9b8['sendStatus'](0x194);}return _0x5aa0da;};}function handleError(_0x1468ca,_0x138f46){_0x138f46=_0x138f46||0x1f4;return function(_0x5979cc){logger[_0xb991('0x25')](_0x5979cc[_0xb991('0x26')]);if(_0x5979cc[_0xb991('0x27')]){delete _0x5979cc['name'];}_0x1468ca[_0xb991('0x1a')](_0x138f46)['send'](_0x5979cc);};}exports[_0xb991('0x28')]=function(_0x183c02,_0x5df5a3){var _0x158e9f={},_0x2ccbaf={},_0x57b9a3={'count':0x0,'rows':[]};var _0x38ac30=_[_0xb991('0x29')](db[_0xb991('0x2a')][_0xb991('0x2b')],function(_0x30bd43){return{'name':_0x30bd43['fieldName'],'type':_0x30bd43[_0xb991('0x2c')]['key']};});_0x2ccbaf[_0xb991('0x2d')]=_[_0xb991('0x29')](_0x38ac30,_0xb991('0x27'));_0x2ccbaf[_0xb991('0x2e')]=_[_0xb991('0x2f')](_0x183c02['query']);_0x2ccbaf[_0xb991('0x30')]=_[_0xb991('0x31')](_0x2ccbaf[_0xb991('0x2d')],_0x2ccbaf[_0xb991('0x2e')]);_0x158e9f[_0xb991('0x32')]=_[_0xb991('0x31')](_0x2ccbaf[_0xb991('0x2d')],qs[_0xb991('0x33')](_0x183c02[_0xb991('0x2e')][_0xb991('0x33')]));_0x158e9f['attributes']=_0x158e9f[_0xb991('0x32')][_0xb991('0x34')]?_0x158e9f[_0xb991('0x32')]:_0x2ccbaf[_0xb991('0x2d')];if(!_0x183c02[_0xb991('0x2e')][_0xb991('0x35')]('nolimit')){_0x158e9f[_0xb991('0x1f')]=qs[_0xb991('0x1f')](_0x183c02['query'][_0xb991('0x1f')]);_0x158e9f['offset']=qs[_0xb991('0x1e')](_0x183c02['query'][_0xb991('0x1e')]);}_0x158e9f['order']=qs[_0xb991('0x36')](_0x183c02[_0xb991('0x2e')]['sort']);_0x158e9f['where']=qs['filters'](_['pick'](_0x183c02[_0xb991('0x2e')],_0x2ccbaf[_0xb991('0x30')]));if(_0x183c02[_0xb991('0x2e')][_0xb991('0x37')]){_0x158e9f[_0xb991('0x38')]=_[_0xb991('0x39')](_0x158e9f[_0xb991('0x38')],{'$or':_[_0xb991('0x29')](_0x38ac30,function(_0x310427){if(_0x310427[_0xb991('0x2c')]!=='VIRTUAL'){var _0x4d3b91={};_0x4d3b91[_0x310427[_0xb991('0x27')]]={'$like':'%'+_0x183c02[_0xb991('0x2e')][_0xb991('0x37')]+'%'};return _0x4d3b91;}})});}_0x158e9f=_[_0xb991('0x39')]({},_0x158e9f,_0x183c02[_0xb991('0x3a')]);var _0x579f70={'where':_0x158e9f[_0xb991('0x38')]};return db[_0xb991('0x2a')][_0xb991('0x1d')](_0x579f70)['then'](function(_0x43642d){_0x57b9a3['count']=_0x43642d;if(_0x183c02[_0xb991('0x2e')][_0xb991('0x3b')]){_0x158e9f[_0xb991('0x3c')]=[{'all':!![]}];}return db[_0xb991('0x2a')][_0xb991('0x3d')](_0x158e9f);})[_0xb991('0x24')](function(_0x5dd296){_0x57b9a3['rows']=_0x5dd296;return _0x57b9a3;})[_0xb991('0x24')](respondWithFilteredResult(_0x5df5a3,_0x158e9f))['catch'](handleError(_0x5df5a3,null));};exports['show']=function(_0x27acd8,_0x168b2f){var _0x38fa1c={'raw':!![],'where':{'id':_0x27acd8[_0xb991('0x3e')]['id']}},_0x2dbecb={};_0x2dbecb[_0xb991('0x2d')]=_['keys'](db[_0xb991('0x2a')]['rawAttributes']);_0x2dbecb[_0xb991('0x2e')]=_[_0xb991('0x2f')](_0x27acd8[_0xb991('0x2e')]);_0x2dbecb[_0xb991('0x30')]=_[_0xb991('0x31')](_0x2dbecb['model'],_0x2dbecb[_0xb991('0x2e')]);_0x38fa1c[_0xb991('0x32')]=_[_0xb991('0x31')](_0x2dbecb['model'],qs[_0xb991('0x33')](_0x27acd8[_0xb991('0x2e')][_0xb991('0x33')]));_0x38fa1c[_0xb991('0x32')]=_0x38fa1c[_0xb991('0x32')][_0xb991('0x34')]?_0x38fa1c[_0xb991('0x32')]:_0x2dbecb[_0xb991('0x2d')];if(_0x27acd8[_0xb991('0x2e')][_0xb991('0x3b')]){_0x38fa1c[_0xb991('0x3c')]=[{'all':!![]}];}_0x38fa1c=_[_0xb991('0x39')]({},_0x38fa1c,_0x27acd8[_0xb991('0x3a')]);return db[_0xb991('0x2a')][_0xb991('0x3f')](_0x38fa1c)['then'](handleEntityNotFound(_0x168b2f,null))[_0xb991('0x24')](respondWithResult(_0x168b2f,null))[_0xb991('0x40')](handleError(_0x168b2f,null));};exports[_0xb991('0x41')]=function(_0x377504,_0x568c07){return db['SmsTransferReport']['create'](_0x377504[_0xb991('0x42')],{})[_0xb991('0x24')](respondWithResult(_0x568c07,0xc9))['catch'](handleError(_0x568c07,null));};exports[_0xb991('0x23')]=function(_0x46824e,_0x390b68){if(_0x46824e['body']['id']){delete _0x46824e[_0xb991('0x42')]['id'];}return db[_0xb991('0x2a')]['find']({'where':{'id':_0x46824e[_0xb991('0x3e')]['id']}})[_0xb991('0x24')](handleEntityNotFound(_0x390b68,null))[_0xb991('0x24')](saveUpdates(_0x46824e['body'],null))[_0xb991('0x24')](respondWithResult(_0x390b68,null))[_0xb991('0x40')](handleError(_0x390b68,null));};exports['destroy']=function(_0x498dac,_0x373983){return db[_0xb991('0x2a')][_0xb991('0x3f')]({'where':{'id':_0x498dac[_0xb991('0x3e')]['id']}})[_0xb991('0x24')](handleEntityNotFound(_0x373983,null))[_0xb991('0x24')](removeEntity(_0x373983,null))[_0xb991('0x40')](handleError(_0x373983,null));};exports[_0xb991('0x43')]=function(_0x45e8de,_0x26344c){return db[_0xb991('0x2a')][_0xb991('0x43')]()[_0xb991('0x24')](respondWithResult(_0x26344c,null))['catch'](handleError(_0x26344c,null));}; \ No newline at end of file +var _0x71d5=['mustache','util','path','sox','ejs','lodash','crypto','desk.js','to-csv','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','SmsTransferReport','rawAttributes','fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','merge','find','body','describe','html-pdf','eml-format','rimraf','bluebird'];(function(_0x4191af,_0x5783da){var _0x27bebf=function(_0x355be7){while(--_0x355be7){_0x4191af['push'](_0x4191af['shift']());}};_0x27bebf(++_0x5783da);}(_0x71d5,0x1a0));var _0x571d=function(_0x278aa2,_0x1ffa84){_0x278aa2=_0x278aa2-0x0;var _0x11488b=_0x71d5[_0x278aa2];return _0x11488b;};'use strict';var pdf=require(_0x571d('0x0'));var emlformat=require(_0x571d('0x1'));var rimraf=require(_0x571d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x571d('0x3'));var Mustache=require(_0x571d('0x4'));var util=require(_0x571d('0x5'));var path=require(_0x571d('0x6'));var sox=require(_0x571d('0x7'));var csv=require('to-csv');var ejs=require(_0x571d('0x8'));var fs=require('fs');var _=require(_0x571d('0x9'));var squel=require('squel');var crypto=require(_0x571d('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x571d('0xb'));var toCsv=require(_0x571d('0xc'));var querystring=require('querystring');var Papa=require(_0x571d('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x571d('0xe'));var hardwareService=require(_0x571d('0xf'));var logger=require(_0x571d('0x10'))(_0x571d('0x11'));var utils=require(_0x571d('0x12'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x33bf6d,_0x130a90){_0x130a90=_0x130a90||0xcc;return function(_0x297219){if(_0x297219){return _0x33bf6d['sendStatus'](_0x130a90);}return _0x33bf6d[_0x571d('0x13')](_0x130a90)[_0x571d('0x14')]();};}function respondWithResult(_0x1bd71d,_0x2b8368){_0x2b8368=_0x2b8368||0xc8;return function(_0x87b718){if(_0x87b718){return _0x1bd71d[_0x571d('0x13')](_0x2b8368)['json'](_0x87b718);}};}function respondWithFilteredResult(_0xceb957,_0x1a447d){return function(_0x2e4051){if(_0x2e4051){var _0x50468b=_0x2e4051[_0x571d('0x15')],_0x307dac=_0x1a447d[_0x571d('0x16')],_0x299536=_0x1a447d[_0x571d('0x16')]+_0x1a447d[_0x571d('0x17')],_0x3bd10b;if(_0x299536>=_0x50468b){_0x299536=_0x50468b;_0x3bd10b=0xc8;}else{_0x3bd10b=0xce;}_0xceb957[_0x571d('0x13')](_0x3bd10b);return _0xceb957[_0x571d('0x18')](_0x571d('0x19'),_0x307dac+'-'+_0x299536+'/'+_0x50468b)['json'](_0x2e4051);}return null;};}function patchUpdates(_0x589ea3){return function(_0x15c355){try{jsonpatch[_0x571d('0x1a')](_0x15c355,_0x589ea3,!![]);}catch(_0xaf5a0){return BPromise[_0x571d('0x1b')](_0xaf5a0);}return _0x15c355[_0x571d('0x1c')]();};}function saveUpdates(_0x16d72c,_0xa4271b){return function(_0x2fe997){if(_0x2fe997){return _0x2fe997[_0x571d('0x1d')](_0x16d72c)['then'](function(_0x5c00a0){return _0x5c00a0;});}return null;};}function removeEntity(_0x13d515,_0x35433c){return function(_0x2ba12a){if(_0x2ba12a){return _0x2ba12a[_0x571d('0x1e')]()[_0x571d('0x1f')](function(){_0x13d515[_0x571d('0x13')](0xcc)[_0x571d('0x14')]();});}};}function handleEntityNotFound(_0x180b94,_0x3cbf60){return function(_0x1f2a27){if(!_0x1f2a27){_0x180b94[_0x571d('0x20')](0x194);}return _0x1f2a27;};}function handleError(_0xfb10c6,_0x33c4c7){_0x33c4c7=_0x33c4c7||0x1f4;return function(_0x35b1c3){logger[_0x571d('0x21')](_0x35b1c3[_0x571d('0x22')]);if(_0x35b1c3['name']){delete _0x35b1c3[_0x571d('0x23')];}_0xfb10c6[_0x571d('0x13')](_0x33c4c7)[_0x571d('0x24')](_0x35b1c3);};}exports[_0x571d('0x25')]=function(_0x4b3f3d,_0x2de71e){var _0x5643e4={},_0x19f0aa={},_0x366b43={'count':0x0,'rows':[]};var _0xe7f29f=_['map'](db[_0x571d('0x26')][_0x571d('0x27')],function(_0x264e4f){return{'name':_0x264e4f[_0x571d('0x28')],'type':_0x264e4f[_0x571d('0x29')]['key']};});_0x19f0aa[_0x571d('0x2a')]=_[_0x571d('0x2b')](_0xe7f29f,_0x571d('0x23'));_0x19f0aa[_0x571d('0x2c')]=_[_0x571d('0x2d')](_0x4b3f3d[_0x571d('0x2c')]);_0x19f0aa[_0x571d('0x2e')]=_['intersection'](_0x19f0aa[_0x571d('0x2a')],_0x19f0aa['query']);_0x5643e4[_0x571d('0x2f')]=_[_0x571d('0x30')](_0x19f0aa[_0x571d('0x2a')],qs[_0x571d('0x31')](_0x4b3f3d[_0x571d('0x2c')][_0x571d('0x31')]));_0x5643e4[_0x571d('0x2f')]=_0x5643e4[_0x571d('0x2f')]['length']?_0x5643e4[_0x571d('0x2f')]:_0x19f0aa['model'];if(!_0x4b3f3d[_0x571d('0x2c')][_0x571d('0x32')](_0x571d('0x33'))){_0x5643e4[_0x571d('0x17')]=qs[_0x571d('0x17')](_0x4b3f3d[_0x571d('0x2c')][_0x571d('0x17')]);_0x5643e4[_0x571d('0x16')]=qs[_0x571d('0x16')](_0x4b3f3d[_0x571d('0x2c')][_0x571d('0x16')]);}_0x5643e4['order']=qs[_0x571d('0x34')](_0x4b3f3d['query'][_0x571d('0x34')]);_0x5643e4[_0x571d('0x35')]=qs[_0x571d('0x2e')](_[_0x571d('0x36')](_0x4b3f3d[_0x571d('0x2c')],_0x19f0aa['filters']));if(_0x4b3f3d['query'][_0x571d('0x37')]){_0x5643e4[_0x571d('0x35')]=_['merge'](_0x5643e4[_0x571d('0x35')],{'$or':_[_0x571d('0x2b')](_0xe7f29f,function(_0x3a7f05){if(_0x3a7f05[_0x571d('0x29')]!==_0x571d('0x38')){var _0x4ca728={};_0x4ca728[_0x3a7f05[_0x571d('0x23')]]={'$like':'%'+_0x4b3f3d[_0x571d('0x2c')][_0x571d('0x37')]+'%'};return _0x4ca728;}})});}_0x5643e4=_['merge']({},_0x5643e4,_0x4b3f3d[_0x571d('0x39')]);var _0x52e234={'where':_0x5643e4[_0x571d('0x35')]};return db[_0x571d('0x26')][_0x571d('0x15')](_0x52e234)['then'](function(_0x18a123){_0x366b43[_0x571d('0x15')]=_0x18a123;if(_0x4b3f3d[_0x571d('0x2c')][_0x571d('0x3a')]){_0x5643e4[_0x571d('0x3b')]=[{'all':!![]}];}return db[_0x571d('0x26')][_0x571d('0x3c')](_0x5643e4);})[_0x571d('0x1f')](function(_0x34eeb5){_0x366b43[_0x571d('0x3d')]=_0x34eeb5;return _0x366b43;})[_0x571d('0x1f')](respondWithFilteredResult(_0x2de71e,_0x5643e4))[_0x571d('0x3e')](handleError(_0x2de71e,null));};exports[_0x571d('0x3f')]=function(_0x274b2c,_0x1d2fe6){var _0x196ad0={'raw':!![],'where':{'id':_0x274b2c[_0x571d('0x40')]['id']}},_0xa450dd={};_0xa450dd[_0x571d('0x2a')]=_['keys'](db[_0x571d('0x26')]['rawAttributes']);_0xa450dd['query']=_['keys'](_0x274b2c['query']);_0xa450dd[_0x571d('0x2e')]=_[_0x571d('0x30')](_0xa450dd[_0x571d('0x2a')],_0xa450dd[_0x571d('0x2c')]);_0x196ad0[_0x571d('0x2f')]=_[_0x571d('0x30')](_0xa450dd['model'],qs['fields'](_0x274b2c[_0x571d('0x2c')]['fields']));_0x196ad0[_0x571d('0x2f')]=_0x196ad0[_0x571d('0x2f')][_0x571d('0x41')]?_0x196ad0[_0x571d('0x2f')]:_0xa450dd[_0x571d('0x2a')];if(_0x274b2c['query']['includeAll']){_0x196ad0[_0x571d('0x3b')]=[{'all':!![]}];}_0x196ad0=_[_0x571d('0x42')]({},_0x196ad0,_0x274b2c[_0x571d('0x39')]);return db[_0x571d('0x26')][_0x571d('0x43')](_0x196ad0)[_0x571d('0x1f')](handleEntityNotFound(_0x1d2fe6,null))['then'](respondWithResult(_0x1d2fe6,null))[_0x571d('0x3e')](handleError(_0x1d2fe6,null));};exports['create']=function(_0x1a90aa,_0x92700e){return db[_0x571d('0x26')]['create'](_0x1a90aa[_0x571d('0x44')],{})[_0x571d('0x1f')](respondWithResult(_0x92700e,0xc9))[_0x571d('0x3e')](handleError(_0x92700e,null));};exports[_0x571d('0x1d')]=function(_0x36d35a,_0x465e16){if(_0x36d35a[_0x571d('0x44')]['id']){delete _0x36d35a[_0x571d('0x44')]['id'];}return db[_0x571d('0x26')][_0x571d('0x43')]({'where':{'id':_0x36d35a['params']['id']}})[_0x571d('0x1f')](handleEntityNotFound(_0x465e16,null))[_0x571d('0x1f')](saveUpdates(_0x36d35a[_0x571d('0x44')],null))[_0x571d('0x1f')](respondWithResult(_0x465e16,null))['catch'](handleError(_0x465e16,null));};exports[_0x571d('0x1e')]=function(_0x5a2da6,_0x5d521f){return db[_0x571d('0x26')]['find']({'where':{'id':_0x5a2da6[_0x571d('0x40')]['id']}})[_0x571d('0x1f')](handleEntityNotFound(_0x5d521f,null))[_0x571d('0x1f')](removeEntity(_0x5d521f,null))[_0x571d('0x3e')](handleError(_0x5d521f,null));};exports[_0x571d('0x45')]=function(_0xd4acd4,_0x2cf87e){return db[_0x571d('0x26')][_0x571d('0x45')]()[_0x571d('0x1f')](respondWithResult(_0x2cf87e,null))[_0x571d('0x3e')](handleError(_0x2cf87e,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 6748c29..d801bcd 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 _0x9a5a=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash'];(function(_0x4f238c,_0x5c2324){var _0x432c06=function(_0x211bfa){while(--_0x211bfa){_0x4f238c['push'](_0x4f238c['shift']());}};_0x432c06(++_0x5c2324);}(_0x9a5a,0x194));var _0xa9a5=function(_0x113533,_0xb9e87a){_0x113533=_0x113533-0x0;var _0x51e07a=_0x9a5a[_0x113533];return _0x51e07a;};'use strict';var _=require(_0xa9a5('0x0'));var util=require(_0xa9a5('0x1'));var logger=require(_0xa9a5('0x2'))(_0xa9a5('0x3'));var moment=require(_0xa9a5('0x4'));var BPromise=require('bluebird');var rp=require(_0xa9a5('0x5'));var fs=require('fs');var path=require(_0xa9a5('0x6'));var rimraf=require(_0xa9a5('0x7'));var config=require(_0xa9a5('0x8'));var attributes=require(_0xa9a5('0x9'));module[_0xa9a5('0xa')]=function(_0x4a73f4,_0xb0ccd9){return _0x4a73f4[_0xa9a5('0xb')](_0xa9a5('0xc'),attributes,{'tableName':_0xa9a5('0xd'),'paranoid':![],'indexes':[{'name':_0xa9a5('0xe'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xda19=['request-promise','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','util','../../config/logger','moment'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0xda19,0xd5));var _0x9da1=function(_0x2b32a8,_0x412cd2){_0x2b32a8=_0x2b32a8-0x0;var _0x3ce4e2=_0xda19[_0x2b32a8];return _0x3ce4e2;};'use strict';var _=require('lodash');var util=require(_0x9da1('0x0'));var logger=require(_0x9da1('0x1'))('api');var moment=require(_0x9da1('0x2'));var BPromise=require('bluebird');var rp=require(_0x9da1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9da1('0x4'));var config=require(_0x9da1('0x5'));var attributes=require(_0x9da1('0x6'));module[_0x9da1('0x7')]=function(_0x156faf,_0x2dcbc6){return _0x156faf[_0x9da1('0x8')](_0x9da1('0x9'),attributes,{'tableName':_0x9da1('0xa'),'paranoid':![],'indexes':[{'name':_0x9da1('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index b998b22..65daec0 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 _0x71b9=['jayson/promise','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','randomstring','../../config/utils','../../config/logger','../../config/environment'];(function(_0x4d916f,_0x59fab1){var _0x267390=function(_0x512b77){while(--_0x512b77){_0x4d916f['push'](_0x4d916f['shift']());}};_0x267390(++_0x59fab1);}(_0x71b9,0xb8));var _0x971b=function(_0x5efb80,_0x328258){_0x5efb80=_0x5efb80-0x0;var _0x512df3=_0x71b9[_0x5efb80];return _0x512df3;};'use strict';var _=require(_0x971b('0x0'));var util=require(_0x971b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x971b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x971b('0x3'));var logger=require(_0x971b('0x4'))('rpc');var config=require(_0x971b('0x5'));var jayson=require(_0x971b('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xc0a8ec,_0x37cc63,_0x2e72fb){return new BPromise(function(_0x3be916,_0x5ebf75){return client[_0x971b('0x7')](_0xc0a8ec,_0x2e72fb)[_0x971b('0x8')](function(_0x16217a){logger[_0x971b('0x9')](_0x971b('0xa'),_0x37cc63,_0x971b('0xb'));logger[_0x971b('0xc')](_0x971b('0xd'),_0x37cc63,_0x971b('0xb'),JSON[_0x971b('0xe')](_0x16217a));if(_0x16217a[_0x971b('0xf')]){if(_0x16217a[_0x971b('0xf')][_0x971b('0x10')]===0x1f4){logger[_0x971b('0xf')](_0x971b('0xa'),_0x37cc63,_0x16217a[_0x971b('0xf')][_0x971b('0x11')]);return _0x5ebf75(_0x16217a[_0x971b('0xf')]['message']);}logger[_0x971b('0xf')](_0x971b('0xa'),_0x37cc63,_0x16217a[_0x971b('0xf')][_0x971b('0x11')]);return _0x3be916(_0x16217a[_0x971b('0xf')]['message']);}else{logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x37cc63,_0x971b('0xb'));_0x3be916(_0x16217a['result']['message']);}})[_0x971b('0x12')](function(_0x5195e5){logger[_0x971b('0xf')](_0x971b('0xa'),_0x37cc63,_0x5195e5);_0x5ebf75(_0x5195e5);});});} \ No newline at end of file +var _0x16ec=['rpc','jayson/promise','client','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x147571,_0x4eea0e){var _0x203cc4=function(_0xae0be1){while(--_0xae0be1){_0x147571['push'](_0x147571['shift']());}};_0x203cc4(++_0x4eea0e);}(_0x16ec,0x19a));var _0xc16e=function(_0x563e11,_0x1c1147){_0x563e11=_0x563e11-0x0;var _0x21dd09=_0x16ec[_0x563e11];return _0x21dd09;};'use strict';var _=require(_0xc16e('0x0'));var util=require(_0xc16e('0x1'));var moment=require(_0xc16e('0x2'));var BPromise=require(_0xc16e('0x3'));var rs=require(_0xc16e('0x4'));var fs=require('fs');var Redis=require(_0xc16e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc16e('0x6'));var logger=require(_0xc16e('0x7'))(_0xc16e('0x8'));var config=require('../../config/environment');var jayson=require(_0xc16e('0x9'));var client=jayson[_0xc16e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30d73f,_0x2fc559,_0x58b0c3){return new BPromise(function(_0x4da1d1,_0x2506ba){return client['request'](_0x30d73f,_0x58b0c3)['then'](function(_0x210507){logger['info'](_0xc16e('0xb'),_0x2fc559,_0xc16e('0xc'));logger[_0xc16e('0xd')](_0xc16e('0xe'),_0x2fc559,_0xc16e('0xc'),JSON[_0xc16e('0xf')](_0x210507));if(_0x210507['error']){if(_0x210507[_0xc16e('0x10')][_0xc16e('0x11')]===0x1f4){logger[_0xc16e('0x10')](_0xc16e('0xb'),_0x2fc559,_0x210507[_0xc16e('0x10')][_0xc16e('0x12')]);return _0x2506ba(_0x210507[_0xc16e('0x10')]['message']);}logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x2fc559,_0x210507[_0xc16e('0x10')]['message']);return _0x4da1d1(_0x210507[_0xc16e('0x10')][_0xc16e('0x12')]);}else{logger[_0xc16e('0x13')](_0xc16e('0xb'),_0x2fc559,_0xc16e('0xc'));_0x4da1d1(_0x210507[_0xc16e('0x14')][_0xc16e('0x12')]);}})[_0xc16e('0x15')](function(_0x59a002){logger[_0xc16e('0x10')](_0xc16e('0xb'),_0x2fc559,_0x59a002);_0x2506ba(_0x59a002);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 5f07764..70704f2 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 _0xaec6=['file','create','put','delete','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','diskStorage','join','root','originalname','replace','%s-%s%s','extname','now','single'];(function(_0x5ef8ab,_0x235fad){var _0x4839c0=function(_0x3acbfe){while(--_0x3acbfe){_0x5ef8ab['push'](_0x5ef8ab['shift']());}};_0x4839c0(++_0x235fad);}(_0xaec6,0x113));var _0x6aec=function(_0x193f2d,_0x40124d){_0x193f2d=_0x193f2d-0x0;var _0x1d9ab4=_0xaec6[_0x193f2d];return _0x1d9ab4;};'use strict';var multer=require(_0x6aec('0x0'));var util=require(_0x6aec('0x1'));var path=require('path');var timeout=require(_0x6aec('0x2'));var express=require(_0x6aec('0x3'));var router=express['Router']();var auth=require(_0x6aec('0x4'));var interaction=require(_0x6aec('0x5'));var config=require(_0x6aec('0x6'));var controller=require('./sound.controller');router[_0x6aec('0x7')]('/',auth[_0x6aec('0x8')](),controller[_0x6aec('0x9')]);router[_0x6aec('0x7')](_0x6aec('0xa'),auth[_0x6aec('0x8')](),controller[_0x6aec('0xb')]);router[_0x6aec('0x7')](_0x6aec('0xc'),auth[_0x6aec('0x8')](),controller['download']);var upload=multer({'storage':multer[_0x6aec('0xd')]({'destination':function(_0x22b84f,_0x340cc4,_0x46fd8b){_0x46fd8b(null,path[_0x6aec('0xe')](config[_0x6aec('0xf')],'server/files/sounds/original/'));},'filename':function(_0x402b1e,_0x4f0dd3,_0x94aa1b){_0x4f0dd3[_0x6aec('0x10')]=_0x4f0dd3[_0x6aec('0x10')][_0x6aec('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x94aa1b(null,util['format'](_0x6aec('0x12'),path['basename'](_0x4f0dd3[_0x6aec('0x10')],path[_0x6aec('0x13')](_0x4f0dd3[_0x6aec('0x10')])),Date[_0x6aec('0x14')](),path[_0x6aec('0x13')](_0x4f0dd3[_0x6aec('0x10')])));}})});router['post']('/',upload[_0x6aec('0x15')](_0x6aec('0x16')),controller[_0x6aec('0x17')]);router[_0x6aec('0x18')](_0x6aec('0xa'),auth[_0x6aec('0x8')](),controller['update']);router['delete'](_0x6aec('0xa'),auth['isAuthenticated'](),controller[_0x6aec('0x19')]);module[_0x6aec('0x1a')]=router; \ No newline at end of file +var _0x6359=['update','delete','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./sound.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','diskStorage','join','root','originalname','replace','format','%s-%s%s','basename','now','extname','file','create','put'];(function(_0x1dd5b2,_0x30775e){var _0x430626=function(_0x27bb1f){while(--_0x27bb1f){_0x1dd5b2['push'](_0x1dd5b2['shift']());}};_0x430626(++_0x30775e);}(_0x6359,0xb7));var _0x9635=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x6359[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0x9635('0x0'));var util=require(_0x9635('0x1'));var path=require(_0x9635('0x2'));var timeout=require(_0x9635('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x9635('0x4'));var interaction=require(_0x9635('0x5'));var config=require('../../config/environment');var controller=require(_0x9635('0x6'));router[_0x9635('0x7')]('/',auth[_0x9635('0x8')](),controller[_0x9635('0x9')]);router[_0x9635('0x7')](_0x9635('0xa'),auth[_0x9635('0x8')](),controller[_0x9635('0xb')]);router['get'](_0x9635('0xc'),auth[_0x9635('0x8')](),controller[_0x9635('0xd')]);var upload=multer({'storage':multer[_0x9635('0xe')]({'destination':function(_0x201c65,_0x4a4a63,_0x339dd5){_0x339dd5(null,path[_0x9635('0xf')](config[_0x9635('0x10')],'server/files/sounds/original/'));},'filename':function(_0x461812,_0x32528a,_0xfc9fe1){_0x32528a['originalname']=_0x32528a[_0x9635('0x11')][_0x9635('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xfc9fe1(null,util[_0x9635('0x13')](_0x9635('0x14'),path[_0x9635('0x15')](_0x32528a[_0x9635('0x11')],path['extname'](_0x32528a[_0x9635('0x11')])),Date[_0x9635('0x16')](),path[_0x9635('0x17')](_0x32528a['originalname'])));}})});router['post']('/',upload['single'](_0x9635('0x18')),controller[_0x9635('0x19')]);router[_0x9635('0x1a')](_0x9635('0xa'),auth[_0x9635('0x8')](),controller[_0x9635('0x1b')]);router[_0x9635('0x1c')](_0x9635('0xa'),auth['isAuthenticated'](),controller['delete']);module[_0x9635('0x1d')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 316c4a4..544e570 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 _0x005c=['FLOAT','BIGINT','INTEGER','sequelize','exports','STRING'];(function(_0x45a22c,_0x46df55){var _0x128dab=function(_0x12894e){while(--_0x12894e){_0x45a22c['push'](_0x45a22c['shift']());}};_0x128dab(++_0x46df55);}(_0x005c,0x177));var _0xc005=function(_0x13a5a3,_0x186a75){_0x13a5a3=_0x13a5a3-0x0;var _0x5a5d5a=_0x005c[_0x13a5a3];return _0x5a5d5a;};'use strict';var Sequelize=require(_0xc005('0x0'));module[_0xc005('0x1')]={'name':{'type':Sequelize[_0xc005('0x2')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0xc005('0x2')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0xc005('0x2')]},'original_duration':{'type':Sequelize[_0xc005('0x3')]},'original_sampleCount':{'type':Sequelize[_0xc005('0x4')]},'original_channelCount':{'type':Sequelize[_0xc005('0x5')]},'original_bitRate':{'type':Sequelize[_0xc005('0x4')]},'original_sampleRate':{'type':Sequelize[_0xc005('0x5')]},'converted_format':{'type':Sequelize[_0xc005('0x2')]},'converted_duration':{'type':Sequelize[_0xc005('0x3')]},'converted_sampleCount':{'type':Sequelize[_0xc005('0x4')]},'converted_channelCount':{'type':Sequelize[_0xc005('0x5')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0xc005('0x5')]}}; \ No newline at end of file +var _0x572e=['INTEGER','sequelize','STRING','FLOAT','BIGINT'];(function(_0x2e7963,_0x520386){var _0x4df4d3=function(_0x5bf3ac){while(--_0x5bf3ac){_0x2e7963['push'](_0x2e7963['shift']());}};_0x4df4d3(++_0x520386);}(_0x572e,0xa6));var _0xe572=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0x572e[_0x5317b5];return _0x3b7ce2;};'use strict';var Sequelize=require(_0xe572('0x0'));module['exports']={'name':{'type':Sequelize[_0xe572('0x1')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0xe572('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0xe572('0x1')]},'original_format':{'type':Sequelize[_0xe572('0x1')]},'original_duration':{'type':Sequelize[_0xe572('0x2')]},'original_sampleCount':{'type':Sequelize[_0xe572('0x3')]},'original_channelCount':{'type':Sequelize[_0xe572('0x4')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0xe572('0x4')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0xe572('0x2')]},'converted_sampleCount':{'type':Sequelize[_0xe572('0x3')]},'converted_channelCount':{'type':Sequelize[_0xe572('0x4')]},'converted_bitRate':{'type':Sequelize[_0xe572('0x3')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index de5bc0d..0cfae71 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 _0x43c9=['body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','Sounds','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','original_format','unlinkSync','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','set','apply','save','update','destroy','then','UserProfileResource','error','stack','name','index','map','Sound','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','count','includeAll','include','findAll','show','params','keys','catch','download','find','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','Sequelize','ValidationError','format','%s.%s','file','basename','extname','originalname','substring','wav','server/files/sounds/original','filename','Sound\x20upload\x20filepath:\x20%s','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','src','original_duration','duration','original_sampleCount','sampleCount','channelCount','bitRate','sampleRate','dest','converted_sampleCount','converted_channelCount','create'];(function(_0x5b0445,_0x53c60e){var _0x550f94=function(_0x31d654){while(--_0x31d654){_0x5b0445['push'](_0x5b0445['shift']());}};_0x550f94(++_0x53c60e);}(_0x43c9,0x88));var _0x943c=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x43c9[_0x42cae2];return _0x5f256f;};'use strict';var pdf=require(_0x943c('0x0'));var emlformat=require(_0x943c('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x943c('0x2'));var jsonpatch=require(_0x943c('0x3'));var rp=require(_0x943c('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x943c('0x5'));var util=require(_0x943c('0x6'));var path=require(_0x943c('0x7'));var sox=require('sox');var csv=require(_0x943c('0x8'));var ejs=require(_0x943c('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x943c('0xa'));var crypto=require(_0x943c('0xb'));var jsforce=require(_0x943c('0xc'));var deskjs=require(_0x943c('0xd'));var toCsv=require(_0x943c('0x8'));var querystring=require('querystring');var Papa=require(_0x943c('0xe'));var Redis=require('ioredis');var authService=require(_0x943c('0xf'));var qs=require(_0x943c('0x10'));var as=require(_0x943c('0x11'));var hardwareService=require(_0x943c('0x12'));var logger=require('../../config/logger')(_0x943c('0x13'));var utils=require(_0x943c('0x14'));var config=require(_0x943c('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x19984e,_0x594d1c){_0x594d1c=_0x594d1c||0xcc;return function(_0x5c7ae3){if(_0x5c7ae3){return _0x19984e[_0x943c('0x16')](_0x594d1c);}return _0x19984e[_0x943c('0x17')](_0x594d1c)[_0x943c('0x18')]();};}function respondWithResult(_0x48a8ea,_0x2cab83){_0x2cab83=_0x2cab83||0xc8;return function(_0x4ab949){if(_0x4ab949){return _0x48a8ea['status'](_0x2cab83)[_0x943c('0x19')](_0x4ab949);}};}function respondWithFilteredResult(_0x1aa599,_0xee6cd9){return function(_0x4b588d){if(_0x4b588d){var _0x1b26f1=_0x4b588d['count'],_0x2d1a75=_0xee6cd9['offset'],_0x287651=_0xee6cd9[_0x943c('0x1a')]+_0xee6cd9['limit'],_0x561571;if(_0x287651>=_0x1b26f1){_0x287651=_0x1b26f1;_0x561571=0xc8;}else{_0x561571=0xce;}_0x1aa599[_0x943c('0x17')](_0x561571);return _0x1aa599[_0x943c('0x1b')]('Content-Range',_0x2d1a75+'-'+_0x287651+'/'+_0x1b26f1)[_0x943c('0x19')](_0x4b588d);}return null;};}function patchUpdates(_0x19914a){return function(_0xcdf626){try{jsonpatch[_0x943c('0x1c')](_0xcdf626,_0x19914a,!![]);}catch(_0x5bb5a7){return BPromise['reject'](_0x5bb5a7);}return _0xcdf626[_0x943c('0x1d')]();};}function saveUpdates(_0x333ee4,_0x55d43c){return function(_0x2f2d91){if(_0x2f2d91){return _0x2f2d91[_0x943c('0x1e')](_0x333ee4)['then'](function(_0x144d6d){return _0x144d6d;});}return null;};}function removeEntity(_0x23091d,_0x564f59){return function(_0x52eb36){if(_0x52eb36){return _0x52eb36[_0x943c('0x1f')]()[_0x943c('0x20')](function(){var _0x36498e=_0x52eb36['get']({'plain':!![]});var _0x3ab97f='Sounds';return db[_0x943c('0x21')][_0x943c('0x1f')]({'where':{'type':_0x3ab97f,'resourceId':_0x36498e['id']}})['then'](function(){return _0x52eb36;});})['then'](function(){_0x23091d[_0x943c('0x17')](0xcc)[_0x943c('0x18')]();});}};}function handleEntityNotFound(_0x1c6a90,_0x35e2ed){return function(_0xba43fb){if(!_0xba43fb){_0x1c6a90['sendStatus'](0x194);}return _0xba43fb;};}function handleError(_0x187301,_0x25f616){_0x25f616=_0x25f616||0x1f4;return function(_0x17f3ce){logger[_0x943c('0x22')](_0x17f3ce[_0x943c('0x23')]);if(_0x17f3ce['name']){delete _0x17f3ce[_0x943c('0x24')];}_0x187301[_0x943c('0x17')](_0x25f616)['send'](_0x17f3ce);};}exports[_0x943c('0x25')]=function(_0x48a486,_0x2f11bd){var _0x19c9d7={},_0x5a497d={},_0x58cfd3={'count':0x0,'rows':[]};var _0x58f995=_[_0x943c('0x26')](db[_0x943c('0x27')][_0x943c('0x28')],function(_0x4afea5){return{'name':_0x4afea5[_0x943c('0x29')],'type':_0x4afea5[_0x943c('0x2a')]['key']};});_0x5a497d[_0x943c('0x2b')]=_['map'](_0x58f995,_0x943c('0x24'));_0x5a497d[_0x943c('0x2c')]=_['keys'](_0x48a486[_0x943c('0x2c')]);_0x5a497d[_0x943c('0x2d')]=_[_0x943c('0x2e')](_0x5a497d['model'],_0x5a497d[_0x943c('0x2c')]);_0x19c9d7['attributes']=_[_0x943c('0x2e')](_0x5a497d[_0x943c('0x2b')],qs[_0x943c('0x2f')](_0x48a486[_0x943c('0x2c')][_0x943c('0x2f')]));_0x19c9d7['attributes']=_0x19c9d7[_0x943c('0x30')][_0x943c('0x31')]?_0x19c9d7[_0x943c('0x30')]:_0x5a497d[_0x943c('0x2b')];if(!_0x48a486['query'][_0x943c('0x32')](_0x943c('0x33'))){_0x19c9d7[_0x943c('0x34')]=qs[_0x943c('0x34')](_0x48a486['query'][_0x943c('0x34')]);_0x19c9d7[_0x943c('0x1a')]=qs[_0x943c('0x1a')](_0x48a486[_0x943c('0x2c')][_0x943c('0x1a')]);}_0x19c9d7[_0x943c('0x35')]=qs['sort'](_0x48a486[_0x943c('0x2c')][_0x943c('0x36')]);_0x19c9d7[_0x943c('0x37')]=qs[_0x943c('0x2d')](_[_0x943c('0x38')](_0x48a486['query'],_0x5a497d[_0x943c('0x2d')]));if(_0x48a486['query'][_0x943c('0x39')]){_0x19c9d7['where']=_[_0x943c('0x3a')](_0x19c9d7['where'],{'$or':_['map'](_0x58f995,function(_0x4c29a9){if(_0x4c29a9['type']!=='VIRTUAL'){var _0x4463e4={};_0x4463e4[_0x4c29a9[_0x943c('0x24')]]={'$like':'%'+_0x48a486[_0x943c('0x2c')]['filter']+'%'};return _0x4463e4;}})});}_0x19c9d7=_[_0x943c('0x3a')]({},_0x19c9d7,_0x48a486[_0x943c('0x3b')]);var _0x376023={'where':_0x19c9d7[_0x943c('0x37')]};return db[_0x943c('0x27')][_0x943c('0x3c')](_0x376023)['then'](function(_0x373256){_0x58cfd3[_0x943c('0x3c')]=_0x373256;if(_0x48a486[_0x943c('0x2c')][_0x943c('0x3d')]){_0x19c9d7[_0x943c('0x3e')]=[{'all':!![]}];}return db['Sound'][_0x943c('0x3f')](_0x19c9d7);})[_0x943c('0x20')](function(_0x52b104){_0x58cfd3['rows']=_0x52b104;return _0x58cfd3;})[_0x943c('0x20')](respondWithFilteredResult(_0x2f11bd,_0x19c9d7))['catch'](handleError(_0x2f11bd,null));};exports[_0x943c('0x40')]=function(_0x1f8f0d,_0x29479c){var _0x2c9c15={'raw':!![],'where':{'id':_0x1f8f0d[_0x943c('0x41')]['id']}},_0xbd0d89={};_0xbd0d89[_0x943c('0x2b')]=_[_0x943c('0x42')](db['Sound']['rawAttributes']);_0xbd0d89['query']=_[_0x943c('0x42')](_0x1f8f0d[_0x943c('0x2c')]);_0xbd0d89[_0x943c('0x2d')]=_['intersection'](_0xbd0d89[_0x943c('0x2b')],_0xbd0d89[_0x943c('0x2c')]);_0x2c9c15[_0x943c('0x30')]=_[_0x943c('0x2e')](_0xbd0d89['model'],qs[_0x943c('0x2f')](_0x1f8f0d[_0x943c('0x2c')]['fields']));_0x2c9c15[_0x943c('0x30')]=_0x2c9c15['attributes'][_0x943c('0x31')]?_0x2c9c15[_0x943c('0x30')]:_0xbd0d89[_0x943c('0x2b')];if(_0x1f8f0d['query']['includeAll']){_0x2c9c15[_0x943c('0x3e')]=[{'all':!![]}];}_0x2c9c15=_[_0x943c('0x3a')]({},_0x2c9c15,_0x1f8f0d[_0x943c('0x3b')]);return db[_0x943c('0x27')]['find'](_0x2c9c15)[_0x943c('0x20')](handleEntityNotFound(_0x29479c,null))['then'](respondWithResult(_0x29479c,null))[_0x943c('0x43')](handleError(_0x29479c,null));};exports[_0x943c('0x44')]=function(_0x950db5,_0x139055,_0x5c9337){return db['Sound'][_0x943c('0x45')]({'where':{'id':_0x950db5['params']['id']},'attributes':[_0x943c('0x24'),_0x943c('0x46'),_0x943c('0x47')],'raw':!![]})['then'](handleEntityNotFound(_0x139055,null))['then'](function(_0x5d9570){if(_0x5d9570){if(!fs[_0x943c('0x48')](path[_0x943c('0x49')](config[_0x943c('0x4a')],_0x943c('0x4b'),_0x5d9570[_0x943c('0x46')]+'.'+_0x5d9570[_0x943c('0x47')]))){throw new db[(_0x943c('0x4c'))][(_0x943c('0x4d'))]('Sound\x20not\x20found');}return _0x139055[_0x943c('0x44')](path['join'](config[_0x943c('0x4a')],_0x943c('0x4b'),util[_0x943c('0x4e')](_0x943c('0x4f'),_0x5d9570[_0x943c('0x46')],_0x5d9570[_0x943c('0x47')])),util[_0x943c('0x4e')](_0x943c('0x4f'),_0x5d9570['name'],_0x5d9570['converted_format']));}return null;})['catch'](handleError(_0x139055,null));};exports['create']=function(_0x28fbcb,_0x55c208,_0x40517d){var _0x8b5751={'name':path['basename'](_0x28fbcb[_0x943c('0x50')]['originalname'],path['extname'](_0x28fbcb['file']['originalname'])),'save_name':path[_0x943c('0x51')](_0x28fbcb['file']['filename'],path[_0x943c('0x52')](_0x28fbcb[_0x943c('0x50')]['filename'])),'original_format':path['extname'](_0x28fbcb[_0x943c('0x50')][_0x943c('0x53')])[_0x943c('0x54')](0x1),'converted_format':_0x943c('0x55')};var _0x5246c5=path[_0x943c('0x49')](config[_0x943c('0x4a')],_0x943c('0x56'),_0x28fbcb[_0x943c('0x50')][_0x943c('0x57')]);var _0x56ddeb=path[_0x943c('0x49')](config[_0x943c('0x4a')],_0x943c('0x4b'),util[_0x943c('0x4e')]('%s.%s',path[_0x943c('0x51')](_0x28fbcb[_0x943c('0x50')][_0x943c('0x57')],path[_0x943c('0x52')](_0x28fbcb['file']['filename'])),_0x8b5751['converted_format']));logger['info'](_0x943c('0x58'),_0x5246c5);logger[_0x943c('0x59')](_0x943c('0x5a'),_0x56ddeb);try{fs[_0x943c('0x5b')](_0x5246c5,parseInt(_0x943c('0x5c'),0x8));var _0x1da753=sox[_0x943c('0x5d')](_0x5246c5,_0x56ddeb,{'sampleRate':0x1f40,'format':_0x943c('0x55'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1da753['on'](_0x943c('0x22'),function(_0x32a1ff){fs['unlinkSync'](_0x5246c5);_0x55c208[_0x943c('0x17')](0x1f4)['send'](_0x32a1ff);});_0x1da753['on'](_0x943c('0x5e'),function(_0x45e325){_0x8b5751[_0x943c('0x5f')]=isNaN(_0x45e325['duration'])?null:_0x45e325[_0x943c('0x60')]*0x3e8;_0x8b5751[_0x943c('0x61')]=isNaN(_0x45e325[_0x943c('0x62')])?null:_0x45e325[_0x943c('0x62')];_0x8b5751['original_channelCount']=isNaN(_0x45e325[_0x943c('0x63')])?null:_0x45e325[_0x943c('0x63')];_0x8b5751['original_bitRate']=isNaN(_0x45e325[_0x943c('0x64')])?null:_0x45e325[_0x943c('0x64')];_0x8b5751['original_sampleRate']=isNaN(_0x45e325[_0x943c('0x65')])?null:_0x45e325[_0x943c('0x65')];});_0x1da753['on'](_0x943c('0x66'),function(_0x42bee6){_0x8b5751['converted_duration']=isNaN(_0x42bee6[_0x943c('0x60')])?null:_0x42bee6['duration']*0x3e8;_0x8b5751[_0x943c('0x67')]=isNaN(_0x42bee6[_0x943c('0x62')])?null:_0x42bee6[_0x943c('0x62')];_0x8b5751[_0x943c('0x68')]=isNaN(_0x42bee6[_0x943c('0x63')])?null:_0x42bee6[_0x943c('0x63')];_0x8b5751['converted_bitRate']=isNaN(_0x42bee6[_0x943c('0x64')])?null:_0x42bee6[_0x943c('0x64')];_0x8b5751['converted_sampleRate']=isNaN(_0x42bee6[_0x943c('0x65')])?null:_0x42bee6['sampleRate'];});_0x1da753['on'](_0x943c('0x18'),function(){fs[_0x943c('0x5b')](_0x56ddeb,parseInt(_0x943c('0x5c'),0x8));return db[_0x943c('0x27')][_0x943c('0x69')](_0x8b5751)['then'](function(_0x321b91){var _0x5e5188={'role':_0x28fbcb[_0x943c('0x6a')][_0x943c('0x6b')],'userProfileId':_0x28fbcb['body'][_0x943c('0x6c')]};if(!_0x5e5188)throw new Error(_0x943c('0x6d'));if(_0x5e5188['role']===_0x943c('0x6e')){var _0x4664cf=_0x321b91[_0x943c('0x6f')]({'plain':!![]});return db[_0x943c('0x70')][_0x943c('0x45')]({'where':{'name':_0x943c('0x71'),'userProfileId':_0x5e5188[_0x943c('0x6c')]},'raw':!![]})[_0x943c('0x20')](function(_0x37982f){if(_0x37982f&&_0x37982f[_0x943c('0x72')]===0x0){return db[_0x943c('0x21')][_0x943c('0x69')]({'name':_0x4664cf[_0x943c('0x24')],'resourceId':_0x4664cf['id'],'type':_0x37982f[_0x943c('0x24')],'sectionId':_0x37982f['id']},{})[_0x943c('0x20')](function(){return _0x321b91;});}else{return _0x321b91;}})[_0x943c('0x43')](function(_0x68394c){logger[_0x943c('0x22')](_0x943c('0x73'),_0x68394c);throw _0x68394c;});}return _0x321b91;})[_0x943c('0x20')](respondWithResult(_0x55c208,null))[_0x943c('0x43')](handleError(_0x55c208,null));});_0x1da753[_0x943c('0x74')]();}catch(_0x1de1ae){_0x55c208[_0x943c('0x17')](0x1f4)['send'](_0x1de1ae);}};exports['update']=function(_0x5b6116,_0x36b4d0,_0x713bbd){return db[_0x943c('0x27')][_0x943c('0x45')]({'where':{'id':_0x5b6116[_0x943c('0x41')]['id']}})['then'](handleEntityNotFound(_0x36b4d0,null))[_0x943c('0x20')](saveUpdates(_[_0x943c('0x38')](_0x5b6116['body'],['name',_0x943c('0x75')]),null))[_0x943c('0x20')](respondWithResult(_0x36b4d0,null))['catch'](handleError(_0x36b4d0,null));};exports[_0x943c('0x76')]=function(_0x4158af,_0x5377df,_0x44fefc){return db[_0x943c('0x27')][_0x943c('0x45')]({'where':{'id':_0x4158af[_0x943c('0x41')]['id']}})[_0x943c('0x20')](function(_0x4c2db1){if(_0x4c2db1){return _0x4c2db1[_0x943c('0x1f')]();}})[_0x943c('0x20')](function(_0x2361ed){var _0xacfe8c=path[_0x943c('0x49')](config['root'],'server/files/sounds/original',util[_0x943c('0x4e')]('%s.%s',_0x2361ed[_0x943c('0x46')],_0x2361ed[_0x943c('0x77')]));var _0x445a23=path[_0x943c('0x49')](config[_0x943c('0x4a')],_0x943c('0x4b'),util[_0x943c('0x4e')](_0x943c('0x4f'),_0x2361ed[_0x943c('0x46')],_0x2361ed[_0x943c('0x47')]));fs[_0x943c('0x78')](_0xacfe8c);fs['unlinkSync'](_0x445a23);return _0x2361ed;})['then'](function(_0x3a4dd2){if(_0x3a4dd2){return _0x5377df[_0x943c('0x17')](0xcc)[_0x943c('0x18')]();}})[_0x943c('0x20')](handleEntityNotFound(_0x5377df,null))['catch'](handleError(_0x5377df,null));}; \ No newline at end of file +var _0x6c9e=['chmodSync','transcode','unlinkSync','src','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','0777','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','original_format','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','json','count','offset','limit','set','apply','reject','save','then','destroy','get','Sounds','UserProfileResource','sendStatus','error','stack','name','send','map','Sound','fieldName','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','fields','length','find','download','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','format','%s.%s','originalname','extname','file','basename','filename','substring','wav','server/files/sounds/original','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6c9e,0x120));var _0xe6c9=function(_0xe1af8e,_0x30e49d){_0xe1af8e=_0xe1af8e-0x0;var _0x4be2dd=_0x6c9e[_0xe1af8e];return _0x4be2dd;};'use strict';var pdf=require(_0xe6c9('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe6c9('0x1'));var jsonpatch=require(_0xe6c9('0x2'));var rp=require(_0xe6c9('0x3'));var moment=require(_0xe6c9('0x4'));var BPromise=require(_0xe6c9('0x5'));var Mustache=require(_0xe6c9('0x6'));var util=require('util');var path=require(_0xe6c9('0x7'));var sox=require(_0xe6c9('0x8'));var csv=require(_0xe6c9('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe6c9('0xa'));var squel=require('squel');var crypto=require(_0xe6c9('0xb'));var jsforce=require(_0xe6c9('0xc'));var deskjs=require(_0xe6c9('0xd'));var toCsv=require(_0xe6c9('0x9'));var querystring=require(_0xe6c9('0xe'));var Papa=require(_0xe6c9('0xf'));var Redis=require(_0xe6c9('0x10'));var authService=require(_0xe6c9('0x11'));var qs=require(_0xe6c9('0x12'));var as=require(_0xe6c9('0x13'));var hardwareService=require(_0xe6c9('0x14'));var logger=require(_0xe6c9('0x15'))(_0xe6c9('0x16'));var utils=require(_0xe6c9('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x332d9e,_0x3e6dfb){_0x3e6dfb=_0x3e6dfb||0xcc;return function(_0x273d4a){if(_0x273d4a){return _0x332d9e['sendStatus'](_0x3e6dfb);}return _0x332d9e[_0xe6c9('0x18')](_0x3e6dfb)[_0xe6c9('0x19')]();};}function respondWithResult(_0x411108,_0x56bb89){_0x56bb89=_0x56bb89||0xc8;return function(_0x41c5ce){if(_0x41c5ce){return _0x411108[_0xe6c9('0x18')](_0x56bb89)[_0xe6c9('0x1a')](_0x41c5ce);}};}function respondWithFilteredResult(_0x251315,_0x145a5f){return function(_0x212502){if(_0x212502){var _0x23bacf=_0x212502[_0xe6c9('0x1b')],_0x1f26af=_0x145a5f[_0xe6c9('0x1c')],_0xc3c6d1=_0x145a5f['offset']+_0x145a5f[_0xe6c9('0x1d')],_0x189f5d;if(_0xc3c6d1>=_0x23bacf){_0xc3c6d1=_0x23bacf;_0x189f5d=0xc8;}else{_0x189f5d=0xce;}_0x251315[_0xe6c9('0x18')](_0x189f5d);return _0x251315[_0xe6c9('0x1e')]('Content-Range',_0x1f26af+'-'+_0xc3c6d1+'/'+_0x23bacf)[_0xe6c9('0x1a')](_0x212502);}return null;};}function patchUpdates(_0x33b4b1){return function(_0x164a83){try{jsonpatch[_0xe6c9('0x1f')](_0x164a83,_0x33b4b1,!![]);}catch(_0x1ce11b){return BPromise[_0xe6c9('0x20')](_0x1ce11b);}return _0x164a83[_0xe6c9('0x21')]();};}function saveUpdates(_0x24fa30,_0x2bba4e){return function(_0x5b03d6){if(_0x5b03d6){return _0x5b03d6['update'](_0x24fa30)[_0xe6c9('0x22')](function(_0x13b776){return _0x13b776;});}return null;};}function removeEntity(_0x269d87,_0x2001a9){return function(_0x1df9ff){if(_0x1df9ff){return _0x1df9ff[_0xe6c9('0x23')]()['then'](function(){var _0x540fed=_0x1df9ff[_0xe6c9('0x24')]({'plain':!![]});var _0x2cadae=_0xe6c9('0x25');return db[_0xe6c9('0x26')][_0xe6c9('0x23')]({'where':{'type':_0x2cadae,'resourceId':_0x540fed['id']}})[_0xe6c9('0x22')](function(){return _0x1df9ff;});})[_0xe6c9('0x22')](function(){_0x269d87['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x667300,_0x5cc220){return function(_0x5a8940){if(!_0x5a8940){_0x667300[_0xe6c9('0x27')](0x194);}return _0x5a8940;};}function handleError(_0x19a317,_0x119253){_0x119253=_0x119253||0x1f4;return function(_0x4c68aa){logger[_0xe6c9('0x28')](_0x4c68aa[_0xe6c9('0x29')]);if(_0x4c68aa[_0xe6c9('0x2a')]){delete _0x4c68aa[_0xe6c9('0x2a')];}_0x19a317['status'](_0x119253)[_0xe6c9('0x2b')](_0x4c68aa);};}exports['index']=function(_0x56b421,_0x4269aa){var _0x42ed75={},_0x2baed9={},_0x155336={'count':0x0,'rows':[]};var _0xf702c9=_[_0xe6c9('0x2c')](db[_0xe6c9('0x2d')]['rawAttributes'],function(_0x540169){return{'name':_0x540169[_0xe6c9('0x2e')],'type':_0x540169[_0xe6c9('0x2f')][_0xe6c9('0x30')]};});_0x2baed9[_0xe6c9('0x31')]=_[_0xe6c9('0x2c')](_0xf702c9,_0xe6c9('0x2a'));_0x2baed9[_0xe6c9('0x32')]=_[_0xe6c9('0x33')](_0x56b421[_0xe6c9('0x32')]);_0x2baed9[_0xe6c9('0x34')]=_[_0xe6c9('0x35')](_0x2baed9[_0xe6c9('0x31')],_0x2baed9[_0xe6c9('0x32')]);_0x42ed75[_0xe6c9('0x36')]=_['intersection'](_0x2baed9[_0xe6c9('0x31')],qs['fields'](_0x56b421['query']['fields']));_0x42ed75[_0xe6c9('0x36')]=_0x42ed75[_0xe6c9('0x36')]['length']?_0x42ed75[_0xe6c9('0x36')]:_0x2baed9[_0xe6c9('0x31')];if(!_0x56b421['query'][_0xe6c9('0x37')]('nolimit')){_0x42ed75[_0xe6c9('0x1d')]=qs[_0xe6c9('0x1d')](_0x56b421[_0xe6c9('0x32')][_0xe6c9('0x1d')]);_0x42ed75[_0xe6c9('0x1c')]=qs['offset'](_0x56b421[_0xe6c9('0x32')][_0xe6c9('0x1c')]);}_0x42ed75[_0xe6c9('0x38')]=qs['sort'](_0x56b421['query'][_0xe6c9('0x39')]);_0x42ed75['where']=qs[_0xe6c9('0x34')](_[_0xe6c9('0x3a')](_0x56b421[_0xe6c9('0x32')],_0x2baed9[_0xe6c9('0x34')]));if(_0x56b421['query'][_0xe6c9('0x3b')]){_0x42ed75['where']=_[_0xe6c9('0x3c')](_0x42ed75[_0xe6c9('0x3d')],{'$or':_[_0xe6c9('0x2c')](_0xf702c9,function(_0x2643a2){if(_0x2643a2[_0xe6c9('0x2f')]!==_0xe6c9('0x3e')){var _0x5bd026={};_0x5bd026[_0x2643a2[_0xe6c9('0x2a')]]={'$like':'%'+_0x56b421[_0xe6c9('0x32')][_0xe6c9('0x3b')]+'%'};return _0x5bd026;}})});}_0x42ed75=_['merge']({},_0x42ed75,_0x56b421[_0xe6c9('0x3f')]);var _0x2888b8={'where':_0x42ed75[_0xe6c9('0x3d')]};return db['Sound']['count'](_0x2888b8)[_0xe6c9('0x22')](function(_0x11e67a){_0x155336[_0xe6c9('0x1b')]=_0x11e67a;if(_0x56b421[_0xe6c9('0x32')]['includeAll']){_0x42ed75[_0xe6c9('0x40')]=[{'all':!![]}];}return db[_0xe6c9('0x2d')][_0xe6c9('0x41')](_0x42ed75);})[_0xe6c9('0x22')](function(_0x20eb2c){_0x155336[_0xe6c9('0x42')]=_0x20eb2c;return _0x155336;})[_0xe6c9('0x22')](respondWithFilteredResult(_0x4269aa,_0x42ed75))[_0xe6c9('0x43')](handleError(_0x4269aa,null));};exports[_0xe6c9('0x44')]=function(_0x570b2d,_0x51187a){var _0x4397c9={'raw':!![],'where':{'id':_0x570b2d[_0xe6c9('0x45')]['id']}},_0x1a3e8a={};_0x1a3e8a[_0xe6c9('0x31')]=_[_0xe6c9('0x33')](db[_0xe6c9('0x2d')][_0xe6c9('0x46')]);_0x1a3e8a[_0xe6c9('0x32')]=_[_0xe6c9('0x33')](_0x570b2d[_0xe6c9('0x32')]);_0x1a3e8a[_0xe6c9('0x34')]=_[_0xe6c9('0x35')](_0x1a3e8a['model'],_0x1a3e8a[_0xe6c9('0x32')]);_0x4397c9[_0xe6c9('0x36')]=_[_0xe6c9('0x35')](_0x1a3e8a[_0xe6c9('0x31')],qs[_0xe6c9('0x47')](_0x570b2d['query'][_0xe6c9('0x47')]));_0x4397c9[_0xe6c9('0x36')]=_0x4397c9[_0xe6c9('0x36')][_0xe6c9('0x48')]?_0x4397c9[_0xe6c9('0x36')]:_0x1a3e8a['model'];if(_0x570b2d[_0xe6c9('0x32')]['includeAll']){_0x4397c9[_0xe6c9('0x40')]=[{'all':!![]}];}_0x4397c9=_[_0xe6c9('0x3c')]({},_0x4397c9,_0x570b2d[_0xe6c9('0x3f')]);return db['Sound'][_0xe6c9('0x49')](_0x4397c9)[_0xe6c9('0x22')](handleEntityNotFound(_0x51187a,null))['then'](respondWithResult(_0x51187a,null))[_0xe6c9('0x43')](handleError(_0x51187a,null));};exports[_0xe6c9('0x4a')]=function(_0x55ff60,_0x446bd3,_0x415358){return db[_0xe6c9('0x2d')][_0xe6c9('0x49')]({'where':{'id':_0x55ff60['params']['id']},'attributes':['name',_0xe6c9('0x4b'),_0xe6c9('0x4c')],'raw':!![]})[_0xe6c9('0x22')](handleEntityNotFound(_0x446bd3,null))['then'](function(_0x8d4acd){if(_0x8d4acd){if(!fs[_0xe6c9('0x4d')](path[_0xe6c9('0x4e')](config[_0xe6c9('0x4f')],_0xe6c9('0x50'),_0x8d4acd[_0xe6c9('0x4b')]+'.'+_0x8d4acd[_0xe6c9('0x4c')]))){throw new db[(_0xe6c9('0x51'))][(_0xe6c9('0x52'))](_0xe6c9('0x53'));}return _0x446bd3[_0xe6c9('0x4a')](path[_0xe6c9('0x4e')](config[_0xe6c9('0x4f')],_0xe6c9('0x50'),util[_0xe6c9('0x54')](_0xe6c9('0x55'),_0x8d4acd['save_name'],_0x8d4acd['converted_format'])),util[_0xe6c9('0x54')](_0xe6c9('0x55'),_0x8d4acd[_0xe6c9('0x2a')],_0x8d4acd[_0xe6c9('0x4c')]));}return null;})[_0xe6c9('0x43')](handleError(_0x446bd3,null));};exports['create']=function(_0x26451d,_0x1b50b3,_0x121079){var _0x566dfc={'name':path['basename'](_0x26451d['file'][_0xe6c9('0x56')],path[_0xe6c9('0x57')](_0x26451d[_0xe6c9('0x58')][_0xe6c9('0x56')])),'save_name':path[_0xe6c9('0x59')](_0x26451d[_0xe6c9('0x58')][_0xe6c9('0x5a')],path[_0xe6c9('0x57')](_0x26451d['file']['filename'])),'original_format':path[_0xe6c9('0x57')](_0x26451d[_0xe6c9('0x58')][_0xe6c9('0x56')])[_0xe6c9('0x5b')](0x1),'converted_format':_0xe6c9('0x5c')};var _0x5b6bc8=path[_0xe6c9('0x4e')](config[_0xe6c9('0x4f')],_0xe6c9('0x5d'),_0x26451d['file'][_0xe6c9('0x5a')]);var _0x987220=path[_0xe6c9('0x4e')](config['root'],_0xe6c9('0x50'),util[_0xe6c9('0x54')](_0xe6c9('0x55'),path['basename'](_0x26451d[_0xe6c9('0x58')]['filename'],path['extname'](_0x26451d[_0xe6c9('0x58')]['filename'])),_0x566dfc['converted_format']));logger['info'](_0xe6c9('0x5e'),_0x5b6bc8);logger['info'](_0xe6c9('0x5f'),_0x987220);try{fs[_0xe6c9('0x60')](_0x5b6bc8,parseInt('0777',0x8));var _0x544faf=sox[_0xe6c9('0x61')](_0x5b6bc8,_0x987220,{'sampleRate':0x1f40,'format':_0xe6c9('0x5c'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x544faf['on'](_0xe6c9('0x28'),function(_0x25fcae){fs[_0xe6c9('0x62')](_0x5b6bc8);_0x1b50b3[_0xe6c9('0x18')](0x1f4)[_0xe6c9('0x2b')](_0x25fcae);});_0x544faf['on'](_0xe6c9('0x63'),function(_0x37a912){_0x566dfc['original_duration']=isNaN(_0x37a912[_0xe6c9('0x64')])?null:_0x37a912['duration']*0x3e8;_0x566dfc[_0xe6c9('0x65')]=isNaN(_0x37a912[_0xe6c9('0x66')])?null:_0x37a912[_0xe6c9('0x66')];_0x566dfc[_0xe6c9('0x67')]=isNaN(_0x37a912['channelCount'])?null:_0x37a912[_0xe6c9('0x68')];_0x566dfc[_0xe6c9('0x69')]=isNaN(_0x37a912[_0xe6c9('0x6a')])?null:_0x37a912[_0xe6c9('0x6a')];_0x566dfc[_0xe6c9('0x6b')]=isNaN(_0x37a912[_0xe6c9('0x6c')])?null:_0x37a912[_0xe6c9('0x6c')];});_0x544faf['on'](_0xe6c9('0x6d'),function(_0x356985){_0x566dfc[_0xe6c9('0x6e')]=isNaN(_0x356985[_0xe6c9('0x64')])?null:_0x356985[_0xe6c9('0x64')]*0x3e8;_0x566dfc[_0xe6c9('0x6f')]=isNaN(_0x356985[_0xe6c9('0x66')])?null:_0x356985[_0xe6c9('0x66')];_0x566dfc[_0xe6c9('0x70')]=isNaN(_0x356985[_0xe6c9('0x68')])?null:_0x356985['channelCount'];_0x566dfc[_0xe6c9('0x71')]=isNaN(_0x356985['bitRate'])?null:_0x356985[_0xe6c9('0x6a')];_0x566dfc[_0xe6c9('0x72')]=isNaN(_0x356985['sampleRate'])?null:_0x356985['sampleRate'];});_0x544faf['on']('end',function(){fs[_0xe6c9('0x60')](_0x987220,parseInt(_0xe6c9('0x73'),0x8));return db['Sound'][_0xe6c9('0x74')](_0x566dfc)[_0xe6c9('0x22')](function(_0x4cd563){var _0x5f491c={'role':_0x26451d[_0xe6c9('0x75')][_0xe6c9('0x76')],'userProfileId':_0x26451d['body'][_0xe6c9('0x77')]};if(!_0x5f491c)throw new Error(_0xe6c9('0x78'));if(_0x5f491c[_0xe6c9('0x76')]===_0xe6c9('0x79')){var _0x18af31=_0x4cd563['get']({'plain':!![]});return db[_0xe6c9('0x7a')][_0xe6c9('0x49')]({'where':{'name':'Sounds','userProfileId':_0x5f491c[_0xe6c9('0x77')]},'raw':!![]})['then'](function(_0x464e0f){if(_0x464e0f&&_0x464e0f[_0xe6c9('0x7b')]===0x0){return db['UserProfileResource'][_0xe6c9('0x74')]({'name':_0x18af31[_0xe6c9('0x2a')],'resourceId':_0x18af31['id'],'type':_0x464e0f[_0xe6c9('0x2a')],'sectionId':_0x464e0f['id']},{})[_0xe6c9('0x22')](function(){return _0x4cd563;});}else{return _0x4cd563;}})['catch'](function(_0x5d3501){logger[_0xe6c9('0x28')](_0xe6c9('0x7c'),_0x5d3501);throw _0x5d3501;});}return _0x4cd563;})[_0xe6c9('0x22')](respondWithResult(_0x1b50b3,null))[_0xe6c9('0x43')](handleError(_0x1b50b3,null));});_0x544faf[_0xe6c9('0x7d')]();}catch(_0x232781){_0x1b50b3['status'](0x1f4)[_0xe6c9('0x2b')](_0x232781);}};exports['update']=function(_0x1dc6b4,_0xb89e05,_0x1be287){return db['Sound'][_0xe6c9('0x49')]({'where':{'id':_0x1dc6b4[_0xe6c9('0x45')]['id']}})[_0xe6c9('0x22')](handleEntityNotFound(_0xb89e05,null))['then'](saveUpdates(_[_0xe6c9('0x3a')](_0x1dc6b4[_0xe6c9('0x75')],['name',_0xe6c9('0x7e')]),null))['then'](respondWithResult(_0xb89e05,null))['catch'](handleError(_0xb89e05,null));};exports['delete']=function(_0x8e47fc,_0x1eca92,_0x22dee7){return db[_0xe6c9('0x2d')][_0xe6c9('0x49')]({'where':{'id':_0x8e47fc[_0xe6c9('0x45')]['id']}})['then'](function(_0x5bb779){if(_0x5bb779){return _0x5bb779[_0xe6c9('0x23')]();}})['then'](function(_0x41b89a){var _0x228ec2=path[_0xe6c9('0x4e')](config[_0xe6c9('0x4f')],'server/files/sounds/original',util[_0xe6c9('0x54')](_0xe6c9('0x55'),_0x41b89a[_0xe6c9('0x4b')],_0x41b89a[_0xe6c9('0x7f')]));var _0x55479d=path['join'](config['root'],_0xe6c9('0x50'),util['format']('%s.%s',_0x41b89a[_0xe6c9('0x4b')],_0x41b89a[_0xe6c9('0x4c')]));fs[_0xe6c9('0x62')](_0x228ec2);fs['unlinkSync'](_0x55479d);return _0x41b89a;})[_0xe6c9('0x22')](function(_0x5e49b9){if(_0x5e49b9){return _0x1eca92['status'](0xcc)[_0xe6c9('0x19')]();}})[_0xe6c9('0x22')](handleEntityNotFound(_0x1eca92,null))[_0xe6c9('0x43')](handleError(_0x1eca92,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 8e8b1c1..2b53cf6 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 _0x4578=['path','rimraf','./sound.attributes','exports','Sound','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x498334,_0x27b6fe){var _0x13bb70=function(_0x4087b1){while(--_0x4087b1){_0x498334['push'](_0x498334['shift']());}};_0x13bb70(++_0x27b6fe);}(_0x4578,0x186));var _0x8457=function(_0x57a9ad,_0x32fdcd){_0x57a9ad=_0x57a9ad-0x0;var _0x229a3b=_0x4578[_0x57a9ad];return _0x229a3b;};'use strict';var _=require(_0x8457('0x0'));var util=require('util');var logger=require(_0x8457('0x1'))(_0x8457('0x2'));var moment=require(_0x8457('0x3'));var BPromise=require(_0x8457('0x4'));var rp=require(_0x8457('0x5'));var fs=require('fs');var path=require(_0x8457('0x6'));var rimraf=require(_0x8457('0x7'));var config=require('../../config/environment');var attributes=require(_0x8457('0x8'));module[_0x8457('0x9')]=function(_0x1423a5,_0x19707c){return _0x1423a5['define'](_0x8457('0xa'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4bd6=['request-promise','path','rimraf','./sound.attributes','define','Sound','tools_sounds','lodash','util','../../config/logger','api','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4bd6,0x193));var _0x64bd=function(_0x5b8743,_0x515484){_0x5b8743=_0x5b8743-0x0;var _0x11d515=_0x4bd6[_0x5b8743];return _0x11d515;};'use strict';var _=require(_0x64bd('0x0'));var util=require(_0x64bd('0x1'));var logger=require(_0x64bd('0x2'))(_0x64bd('0x3'));var moment=require('moment');var BPromise=require(_0x64bd('0x4'));var rp=require(_0x64bd('0x5'));var fs=require('fs');var path=require(_0x64bd('0x6'));var rimraf=require(_0x64bd('0x7'));var config=require('../../config/environment');var attributes=require(_0x64bd('0x8'));module['exports']=function(_0x1f5b99,_0x514b8c){return _0x1f5b99[_0x64bd('0x9')](_0x64bd('0xa'),attributes,{'tableName':_0x64bd('0xb'),'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 83c1db1..057d085 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 _0x9aff=['http','then','info','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','Sound,\x20%s,\x20%s','message','catch','ShowSound','Sound','find','options','raw','where','include','model','attributes','map','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x124298,_0x542004){var _0x35ac24=function(_0x49afe8){while(--_0x49afe8){_0x124298['push'](_0x124298['shift']());}};_0x35ac24(++_0x542004);}(_0x9aff,0x1c8));var _0xf9af=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x9aff[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0xf9af('0x0'));var util=require('util');var moment=require(_0xf9af('0x1'));var BPromise=require(_0xf9af('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf9af('0x3'));var db=require(_0xf9af('0x4'))['db'];var utils=require(_0xf9af('0x5'));var logger=require(_0xf9af('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf9af('0x7'));var client=jayson[_0xf9af('0x8')][_0xf9af('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x33bb49,_0x555c6c,_0x2cd63a){return new BPromise(function(_0x565485,_0x59a96e){return client['request'](_0x33bb49,_0x2cd63a)[_0xf9af('0xa')](function(_0x4894c3){logger[_0xf9af('0xb')]('Sound,\x20%s,\x20%s',_0x555c6c,_0xf9af('0xc'));logger[_0xf9af('0xd')](_0xf9af('0xe'),_0x555c6c,_0xf9af('0xc'),JSON[_0xf9af('0xf')](_0x4894c3));if(_0x4894c3[_0xf9af('0x10')]){if(_0x4894c3[_0xf9af('0x10')][_0xf9af('0x11')]===0x1f4){logger[_0xf9af('0x10')](_0xf9af('0x12'),_0x555c6c,_0x4894c3[_0xf9af('0x10')]['message']);return _0x59a96e(_0x4894c3[_0xf9af('0x10')][_0xf9af('0x13')]);}logger[_0xf9af('0x10')](_0xf9af('0x12'),_0x555c6c,_0x4894c3[_0xf9af('0x10')][_0xf9af('0x13')]);return _0x565485(_0x4894c3[_0xf9af('0x10')][_0xf9af('0x13')]);}else{logger[_0xf9af('0xb')](_0xf9af('0x12'),_0x555c6c,_0xf9af('0xc'));_0x565485(_0x4894c3['result'][_0xf9af('0x13')]);}})[_0xf9af('0x14')](function(_0x58b602){logger['error'](_0xf9af('0x12'),_0x555c6c,_0x58b602);_0x59a96e(_0x58b602);});});}exports[_0xf9af('0x15')]=function(_0x514699){var _0xffa6f2=this;return new Promise(function(_0x225e89,_0x2321a8){return db[_0xf9af('0x16')][_0xf9af('0x17')]({'raw':_0x514699[_0xf9af('0x18')]?_0x514699[_0xf9af('0x18')][_0xf9af('0x19')]===undefined?!![]:![]:!![],'where':_0x514699[_0xf9af('0x18')]?_0x514699[_0xf9af('0x18')][_0xf9af('0x1a')]||null:null,'attributes':_0x514699[_0xf9af('0x18')]?_0x514699['options']['attributes']||null:null,'include':_0x514699[_0xf9af('0x18')]?_0x514699[_0xf9af('0x18')][_0xf9af('0x1b')]?_['map'](_0x514699[_0xf9af('0x18')][_0xf9af('0x1b')],function(_0x555b6f){return{'model':db[_0x555b6f[_0xf9af('0x1c')]],'as':_0x555b6f['as'],'attributes':_0x555b6f['attributes'],'include':_0x555b6f[_0xf9af('0x1b')]?_['map'](_0x555b6f[_0xf9af('0x1b')],function(_0x4b4c98){return{'model':db[_0x4b4c98[_0xf9af('0x1c')]],'as':_0x4b4c98['as'],'attributes':_0x4b4c98[_0xf9af('0x1d')],'include':_0x4b4c98[_0xf9af('0x1b')]?_[_0xf9af('0x1e')](_0x4b4c98[_0xf9af('0x1b')],function(_0x3af0d7){return{'model':db[_0x3af0d7[_0xf9af('0x1c')]],'as':_0x3af0d7['as'],'attributes':_0x3af0d7['attributes']};}):[]};}):[]};}):[]:[]})[_0xf9af('0xa')](function(_0x8cef74){logger[_0xf9af('0xb')](_0xf9af('0x15'),_0x514699);logger['debug']('ShowSound',_0x514699,JSON[_0xf9af('0xf')](_0x8cef74));_0x225e89(_0x8cef74);})[_0xf9af('0x14')](function(_0x10be5a){logger[_0xf9af('0x10')](_0xf9af('0x15'),_0x10be5a['message'],_0x514699);_0x2321a8(_0xffa6f2[_0xf9af('0x10')](0x1f4,_0x10be5a[_0xf9af('0x13')]));});});}; \ No newline at end of file +var _0x6aa8=['stringify','error','code','Sound,\x20%s,\x20%s','message','result','catch','ShowSound','Sound','find','options','raw','where','attributes','include','model','map','debug','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','Sound,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x2f1804,_0x56f082){var _0x129110=function(_0x2fd55e){while(--_0x2fd55e){_0x2f1804['push'](_0x2f1804['shift']());}};_0x129110(++_0x56f082);}(_0x6aa8,0xd8));var _0x86aa=function(_0x40aa33,_0x4a4ada){_0x40aa33=_0x40aa33-0x0;var _0x3cf565=_0x6aa8[_0x40aa33];return _0x3cf565;};'use strict';var _=require(_0x86aa('0x0'));var util=require(_0x86aa('0x1'));var moment=require('moment');var BPromise=require(_0x86aa('0x2'));var rs=require(_0x86aa('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x86aa('0x4'))['db'];var utils=require(_0x86aa('0x5'));var logger=require('../../config/logger')(_0x86aa('0x6'));var config=require(_0x86aa('0x7'));var jayson=require(_0x86aa('0x8'));var client=jayson[_0x86aa('0x9')][_0x86aa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28a41b,_0x252188,_0x464b4e){return new BPromise(function(_0xffb654,_0x275fba){return client['request'](_0x28a41b,_0x464b4e)[_0x86aa('0xb')](function(_0x5020bb){logger[_0x86aa('0xc')]('Sound,\x20%s,\x20%s',_0x252188,'request\x20sent');logger['debug'](_0x86aa('0xd'),_0x252188,_0x86aa('0xe'),JSON[_0x86aa('0xf')](_0x5020bb));if(_0x5020bb['error']){if(_0x5020bb[_0x86aa('0x10')][_0x86aa('0x11')]===0x1f4){logger['error'](_0x86aa('0x12'),_0x252188,_0x5020bb[_0x86aa('0x10')]['message']);return _0x275fba(_0x5020bb['error'][_0x86aa('0x13')]);}logger[_0x86aa('0x10')](_0x86aa('0x12'),_0x252188,_0x5020bb['error'][_0x86aa('0x13')]);return _0xffb654(_0x5020bb['error'][_0x86aa('0x13')]);}else{logger[_0x86aa('0xc')](_0x86aa('0x12'),_0x252188,_0x86aa('0xe'));_0xffb654(_0x5020bb[_0x86aa('0x14')]['message']);}})[_0x86aa('0x15')](function(_0xd6e469){logger[_0x86aa('0x10')](_0x86aa('0x12'),_0x252188,_0xd6e469);_0x275fba(_0xd6e469);});});}exports[_0x86aa('0x16')]=function(_0x23f94a){var _0x579e29=this;return new Promise(function(_0xb502ce,_0x4f8c07){return db[_0x86aa('0x17')][_0x86aa('0x18')]({'raw':_0x23f94a[_0x86aa('0x19')]?_0x23f94a[_0x86aa('0x19')][_0x86aa('0x1a')]===undefined?!![]:![]:!![],'where':_0x23f94a[_0x86aa('0x19')]?_0x23f94a[_0x86aa('0x19')][_0x86aa('0x1b')]||null:null,'attributes':_0x23f94a[_0x86aa('0x19')]?_0x23f94a[_0x86aa('0x19')][_0x86aa('0x1c')]||null:null,'include':_0x23f94a['options']?_0x23f94a['options']['include']?_['map'](_0x23f94a['options'][_0x86aa('0x1d')],function(_0x3102f5){return{'model':db[_0x3102f5[_0x86aa('0x1e')]],'as':_0x3102f5['as'],'attributes':_0x3102f5[_0x86aa('0x1c')],'include':_0x3102f5[_0x86aa('0x1d')]?_[_0x86aa('0x1f')](_0x3102f5[_0x86aa('0x1d')],function(_0x9db02a){return{'model':db[_0x9db02a[_0x86aa('0x1e')]],'as':_0x9db02a['as'],'attributes':_0x9db02a[_0x86aa('0x1c')],'include':_0x9db02a[_0x86aa('0x1d')]?_[_0x86aa('0x1f')](_0x9db02a[_0x86aa('0x1d')],function(_0x17b4b3){return{'model':db[_0x17b4b3['model']],'as':_0x17b4b3['as'],'attributes':_0x17b4b3['attributes']};}):[]};}):[]};}):[]:[]})[_0x86aa('0xb')](function(_0x204692){logger['info']('ShowSound',_0x23f94a);logger[_0x86aa('0x20')]('ShowSound',_0x23f94a,JSON['stringify'](_0x204692));_0xb502ce(_0x204692);})[_0x86aa('0x15')](function(_0x4e4a7c){logger[_0x86aa('0x10')](_0x86aa('0x16'),_0x4e4a7c[_0x86aa('0x13')],_0x23f94a);_0x4f8c07(_0x579e29[_0x86aa('0x10')](0x1f4,_0x4e4a7c[_0x86aa('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 773ae5e..fa2fec0 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 _0x8d6e=['../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','post','create','put','/:id','update','delete','exports','util','path','connect-timeout','express','Router'];(function(_0x34967a,_0xeb6b64){var _0x55afc5=function(_0x31e4bf){while(--_0x31e4bf){_0x34967a['push'](_0x34967a['shift']());}};_0x55afc5(++_0xeb6b64);}(_0x8d6e,0x177));var _0xe8d6=function(_0x4d2b42,_0x4a7ff4){_0x4d2b42=_0x4d2b42-0x0;var _0x34fb52=_0x8d6e[_0x4d2b42];return _0x34fb52;};'use strict';var multer=require('multer');var util=require(_0xe8d6('0x0'));var path=require(_0xe8d6('0x1'));var timeout=require(_0xe8d6('0x2'));var express=require(_0xe8d6('0x3'));var router=express[_0xe8d6('0x4')]();var auth=require(_0xe8d6('0x5'));var interaction=require(_0xe8d6('0x6'));var config=require(_0xe8d6('0x7'));var controller=require('./squareMessage.controller');router['get']('/',auth[_0xe8d6('0x8')](),controller[_0xe8d6('0x9')]);router[_0xe8d6('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xe8d6('0xb')]);router[_0xe8d6('0xc')]('/',auth[_0xe8d6('0x8')](),controller[_0xe8d6('0xd')]);router[_0xe8d6('0xe')](_0xe8d6('0xf'),auth['isAuthenticated'](),controller[_0xe8d6('0x10')]);router[_0xe8d6('0x11')](_0xe8d6('0xf'),auth[_0xe8d6('0x8')](),controller['destroy']);module[_0xe8d6('0x12')]=router; \ No newline at end of file +var _0xca33=['/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','show','post','update'];(function(_0x256b72,_0x340985){var _0x2183e3=function(_0xf7fd37){while(--_0xf7fd37){_0x256b72['push'](_0x256b72['shift']());}};_0x2183e3(++_0x340985);}(_0xca33,0x133));var _0x3ca3=function(_0x2e90fc,_0x4ae77b){_0x2e90fc=_0x2e90fc-0x0;var _0x1aba5b=_0xca33[_0x2e90fc];return _0x1aba5b;};'use strict';var multer=require(_0x3ca3('0x0'));var util=require(_0x3ca3('0x1'));var path=require(_0x3ca3('0x2'));var timeout=require(_0x3ca3('0x3'));var express=require(_0x3ca3('0x4'));var router=express[_0x3ca3('0x5')]();var auth=require(_0x3ca3('0x6'));var interaction=require(_0x3ca3('0x7'));var config=require(_0x3ca3('0x8'));var controller=require(_0x3ca3('0x9'));router[_0x3ca3('0xa')]('/',auth[_0x3ca3('0xb')](),controller[_0x3ca3('0xc')]);router[_0x3ca3('0xa')]('/:id',auth[_0x3ca3('0xb')](),controller[_0x3ca3('0xd')]);router[_0x3ca3('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0x3ca3('0xb')](),controller[_0x3ca3('0xf')]);router['delete'](_0x3ca3('0x10'),auth['isAuthenticated'](),controller[_0x3ca3('0x11')]);module[_0x3ca3('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index e896905..7642223 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 _0x7bbb=['exports','STRING','TEXT','medium','out','sequelize'];(function(_0x399aac,_0x162856){var _0x2b902e=function(_0x5a7115){while(--_0x5a7115){_0x399aac['push'](_0x399aac['shift']());}};_0x2b902e(++_0x162856);}(_0x7bbb,0x1a9));var _0xb7bb=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0x7bbb[_0x3ce3c];return _0x55a2c9;};'use strict';var Sequelize=require(_0xb7bb('0x0'));module[_0xb7bb('0x1')]={'uniqueid':{'type':Sequelize[_0xb7bb('0x2')]},'body':{'type':Sequelize[_0xb7bb('0x3')](_0xb7bb('0x4')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0xb7bb('0x5')),'defaultValue':_0xb7bb('0x5'),'allowNull':![]}}; \ No newline at end of file +var _0x5356=['out','sequelize','exports','STRING','TEXT','medium','ENUM'];(function(_0x160a2e,_0x5919bd){var _0x107c86=function(_0x389f4d){while(--_0x389f4d){_0x160a2e['push'](_0x160a2e['shift']());}};_0x107c86(++_0x5919bd);}(_0x5356,0x1dd));var _0x6535=function(_0x45c0da,_0x4f9492){_0x45c0da=_0x45c0da-0x0;var _0x51efff=_0x5356[_0x45c0da];return _0x51efff;};'use strict';var Sequelize=require(_0x6535('0x0'));module[_0x6535('0x1')]={'uniqueid':{'type':Sequelize[_0x6535('0x2')]},'body':{'type':Sequelize[_0x6535('0x3')](_0x6535('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0x6535('0x5')]('in',_0x6535('0x6')),'defaultValue':_0x6535('0x6'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index ce1f18f..b1ee76f 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 _0xa2b8=['name','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','SquareMessage','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','html-pdf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','end','json','offset','limit','status','set','Content-Range','save','update','then','destroy','error','stack','index','map','fieldName'];(function(_0x589aee,_0x140a03){var _0x2f5ed4=function(_0x3d224f){while(--_0x3d224f){_0x589aee['push'](_0x589aee['shift']());}};_0x2f5ed4(++_0x140a03);}(_0xa2b8,0x14d));var _0x8a2b=function(_0x25c6a8,_0x1043ae){_0x25c6a8=_0x25c6a8-0x0;var _0x1682ab=_0xa2b8[_0x25c6a8];return _0x1682ab;};'use strict';var pdf=require(_0x8a2b('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8a2b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8a2b('0x2'));var moment=require(_0x8a2b('0x3'));var BPromise=require(_0x8a2b('0x4'));var Mustache=require(_0x8a2b('0x5'));var util=require(_0x8a2b('0x6'));var path=require('path');var sox=require(_0x8a2b('0x7'));var csv=require(_0x8a2b('0x8'));var ejs=require(_0x8a2b('0x9'));var fs=require('fs');var _=require(_0x8a2b('0xa'));var squel=require(_0x8a2b('0xb'));var crypto=require(_0x8a2b('0xc'));var jsforce=require(_0x8a2b('0xd'));var deskjs=require(_0x8a2b('0xe'));var toCsv=require(_0x8a2b('0x8'));var querystring=require(_0x8a2b('0xf'));var Papa=require(_0x8a2b('0x10'));var Redis=require(_0x8a2b('0x11'));var authService=require(_0x8a2b('0x12'));var qs=require(_0x8a2b('0x13'));var as=require(_0x8a2b('0x14'));var hardwareService=require(_0x8a2b('0x15'));var logger=require('../../config/logger')(_0x8a2b('0x16'));var utils=require('../../config/utils');var config=require(_0x8a2b('0x17'));var db=require(_0x8a2b('0x18'))['db'];function respondWithStatusCode(_0x10a2bf,_0x374cc2){_0x374cc2=_0x374cc2||0xcc;return function(_0x5579ef){if(_0x5579ef){return _0x10a2bf[_0x8a2b('0x19')](_0x374cc2);}return _0x10a2bf['status'](_0x374cc2)[_0x8a2b('0x1a')]();};}function respondWithResult(_0x146edd,_0x565c98){_0x565c98=_0x565c98||0xc8;return function(_0x5a9c41){if(_0x5a9c41){return _0x146edd['status'](_0x565c98)[_0x8a2b('0x1b')](_0x5a9c41);}};}function respondWithFilteredResult(_0x35f520,_0x39e71e){return function(_0x4d6644){if(_0x4d6644){var _0x36a59a=_0x4d6644['count'],_0x5b5e12=_0x39e71e[_0x8a2b('0x1c')],_0x539832=_0x39e71e[_0x8a2b('0x1c')]+_0x39e71e[_0x8a2b('0x1d')],_0x4b054c;if(_0x539832>=_0x36a59a){_0x539832=_0x36a59a;_0x4b054c=0xc8;}else{_0x4b054c=0xce;}_0x35f520[_0x8a2b('0x1e')](_0x4b054c);return _0x35f520[_0x8a2b('0x1f')](_0x8a2b('0x20'),_0x5b5e12+'-'+_0x539832+'/'+_0x36a59a)['json'](_0x4d6644);}return null;};}function patchUpdates(_0x4ebba8){return function(_0x5ab9ae){try{jsonpatch['apply'](_0x5ab9ae,_0x4ebba8,!![]);}catch(_0xc5786){return BPromise['reject'](_0xc5786);}return _0x5ab9ae[_0x8a2b('0x21')]();};}function saveUpdates(_0x178cb6,_0x5bdc24){return function(_0x3f70d2){if(_0x3f70d2){return _0x3f70d2[_0x8a2b('0x22')](_0x178cb6)[_0x8a2b('0x23')](function(_0x304c86){return _0x304c86;});}return null;};}function removeEntity(_0x55e1a9,_0x80c6e1){return function(_0x5d8c5f){if(_0x5d8c5f){return _0x5d8c5f[_0x8a2b('0x24')]()[_0x8a2b('0x23')](function(){_0x55e1a9[_0x8a2b('0x1e')](0xcc)[_0x8a2b('0x1a')]();});}};}function handleEntityNotFound(_0x315b36,_0x15373f){return function(_0x160897){if(!_0x160897){_0x315b36['sendStatus'](0x194);}return _0x160897;};}function handleError(_0x30cdfa,_0x7eec19){_0x7eec19=_0x7eec19||0x1f4;return function(_0x5aa550){logger[_0x8a2b('0x25')](_0x5aa550[_0x8a2b('0x26')]);if(_0x5aa550['name']){delete _0x5aa550['name'];}_0x30cdfa[_0x8a2b('0x1e')](_0x7eec19)['send'](_0x5aa550);};}exports[_0x8a2b('0x27')]=function(_0x165d12,_0x2a5007){var _0x480c00={},_0x42df76={},_0x4e001e={'count':0x0,'rows':[]};var _0x26c084=_[_0x8a2b('0x28')](db['SquareMessage']['rawAttributes'],function(_0xa66d9e){return{'name':_0xa66d9e[_0x8a2b('0x29')],'type':_0xa66d9e['type']['key']};});_0x42df76['model']=_[_0x8a2b('0x28')](_0x26c084,_0x8a2b('0x2a'));_0x42df76[_0x8a2b('0x2b')]=_[_0x8a2b('0x2c')](_0x165d12[_0x8a2b('0x2b')]);_0x42df76[_0x8a2b('0x2d')]=_['intersection'](_0x42df76['model'],_0x42df76[_0x8a2b('0x2b')]);_0x480c00[_0x8a2b('0x2e')]=_[_0x8a2b('0x2f')](_0x42df76[_0x8a2b('0x30')],qs['fields'](_0x165d12['query'][_0x8a2b('0x31')]));_0x480c00[_0x8a2b('0x2e')]=_0x480c00[_0x8a2b('0x2e')][_0x8a2b('0x32')]?_0x480c00['attributes']:_0x42df76[_0x8a2b('0x30')];if(!_0x165d12[_0x8a2b('0x2b')][_0x8a2b('0x33')](_0x8a2b('0x34'))){_0x480c00[_0x8a2b('0x1d')]=qs[_0x8a2b('0x1d')](_0x165d12['query']['limit']);_0x480c00[_0x8a2b('0x1c')]=qs[_0x8a2b('0x1c')](_0x165d12[_0x8a2b('0x2b')][_0x8a2b('0x1c')]);}_0x480c00[_0x8a2b('0x35')]=qs[_0x8a2b('0x36')](_0x165d12['query'][_0x8a2b('0x36')]);_0x480c00[_0x8a2b('0x37')]=qs['filters'](_[_0x8a2b('0x38')](_0x165d12[_0x8a2b('0x2b')],_0x42df76[_0x8a2b('0x2d')]));if(_0x165d12[_0x8a2b('0x2b')][_0x8a2b('0x39')]){_0x480c00[_0x8a2b('0x37')]=_['merge'](_0x480c00[_0x8a2b('0x37')],{'$or':_['map'](_0x26c084,function(_0x2a3928){if(_0x2a3928[_0x8a2b('0x3a')]!==_0x8a2b('0x3b')){var _0x430619={};_0x430619[_0x2a3928[_0x8a2b('0x2a')]]={'$like':'%'+_0x165d12[_0x8a2b('0x2b')][_0x8a2b('0x39')]+'%'};return _0x430619;}})});}_0x480c00=_[_0x8a2b('0x3c')]({},_0x480c00,_0x165d12[_0x8a2b('0x3d')]);var _0x34df4c={'where':_0x480c00[_0x8a2b('0x37')]};return db[_0x8a2b('0x3e')][_0x8a2b('0x3f')](_0x34df4c)[_0x8a2b('0x23')](function(_0x36e2fc){_0x4e001e[_0x8a2b('0x3f')]=_0x36e2fc;if(_0x165d12['query'][_0x8a2b('0x40')]){_0x480c00[_0x8a2b('0x41')]=[{'all':!![]}];}return db['SquareMessage'][_0x8a2b('0x42')](_0x480c00);})[_0x8a2b('0x23')](function(_0x403f3f){_0x4e001e[_0x8a2b('0x43')]=_0x403f3f;return _0x4e001e;})['then'](respondWithFilteredResult(_0x2a5007,_0x480c00))[_0x8a2b('0x44')](handleError(_0x2a5007,null));};exports[_0x8a2b('0x45')]=function(_0xcc086f,_0x10bde8){var _0x4f9a04={'raw':!![],'where':{'id':_0xcc086f[_0x8a2b('0x46')]['id']}},_0x29f7db={};_0x29f7db[_0x8a2b('0x30')]=_[_0x8a2b('0x2c')](db[_0x8a2b('0x3e')][_0x8a2b('0x47')]);_0x29f7db['query']=_[_0x8a2b('0x2c')](_0xcc086f[_0x8a2b('0x2b')]);_0x29f7db[_0x8a2b('0x2d')]=_[_0x8a2b('0x2f')](_0x29f7db[_0x8a2b('0x30')],_0x29f7db[_0x8a2b('0x2b')]);_0x4f9a04[_0x8a2b('0x2e')]=_[_0x8a2b('0x2f')](_0x29f7db[_0x8a2b('0x30')],qs[_0x8a2b('0x31')](_0xcc086f[_0x8a2b('0x2b')][_0x8a2b('0x31')]));_0x4f9a04[_0x8a2b('0x2e')]=_0x4f9a04[_0x8a2b('0x2e')][_0x8a2b('0x32')]?_0x4f9a04[_0x8a2b('0x2e')]:_0x29f7db[_0x8a2b('0x30')];if(_0xcc086f[_0x8a2b('0x2b')][_0x8a2b('0x40')]){_0x4f9a04[_0x8a2b('0x41')]=[{'all':!![]}];}_0x4f9a04=_['merge']({},_0x4f9a04,_0xcc086f[_0x8a2b('0x3d')]);return db[_0x8a2b('0x3e')][_0x8a2b('0x48')](_0x4f9a04)[_0x8a2b('0x23')](handleEntityNotFound(_0x10bde8,null))[_0x8a2b('0x23')](respondWithResult(_0x10bde8,null))[_0x8a2b('0x44')](handleError(_0x10bde8,null));};exports[_0x8a2b('0x49')]=function(_0x1bb04b,_0x1ba57f){return db[_0x8a2b('0x3e')][_0x8a2b('0x49')](_0x1bb04b[_0x8a2b('0x4a')],{})[_0x8a2b('0x23')](respondWithResult(_0x1ba57f,0xc9))[_0x8a2b('0x44')](handleError(_0x1ba57f,null));};exports[_0x8a2b('0x22')]=function(_0x5ac98d,_0x35f94e){if(_0x5ac98d['body']['id']){delete _0x5ac98d[_0x8a2b('0x4a')]['id'];}return db[_0x8a2b('0x3e')][_0x8a2b('0x48')]({'where':{'id':_0x5ac98d['params']['id']}})[_0x8a2b('0x23')](handleEntityNotFound(_0x35f94e,null))[_0x8a2b('0x23')](saveUpdates(_0x5ac98d['body'],null))['then'](respondWithResult(_0x35f94e,null))[_0x8a2b('0x44')](handleError(_0x35f94e,null));};exports[_0x8a2b('0x24')]=function(_0x57960d,_0x4b6123){return db[_0x8a2b('0x3e')][_0x8a2b('0x48')]({'where':{'id':_0x57960d['params']['id']}})[_0x8a2b('0x23')](handleEntityNotFound(_0x4b6123,null))['then'](removeEntity(_0x4b6123,null))[_0x8a2b('0x44')](handleError(_0x4b6123,null));}; \ No newline at end of file +var _0xb396=['fields','length','nolimit','order','sort','where','merge','VIRTUAL','filter','rows','catch','show','params','keys','includeAll','options','create','find','body','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','map','SquareMessage','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes'];(function(_0x51b8c2,_0x252271){var _0x5a27cb=function(_0x387cd9){while(--_0x387cd9){_0x51b8c2['push'](_0x51b8c2['shift']());}};_0x5a27cb(++_0x252271);}(_0xb396,0x1e8));var _0x6b39=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xb396[_0xa464c9];return _0x3d73c4;};'use strict';var pdf=require(_0x6b39('0x0'));var emlformat=require(_0x6b39('0x1'));var rimraf=require(_0x6b39('0x2'));var zipdir=require(_0x6b39('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6b39('0x4'));var moment=require(_0x6b39('0x5'));var BPromise=require(_0x6b39('0x6'));var Mustache=require(_0x6b39('0x7'));var util=require(_0x6b39('0x8'));var path=require(_0x6b39('0x9'));var sox=require('sox');var csv=require(_0x6b39('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6b39('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6b39('0xc'));var deskjs=require(_0x6b39('0xd'));var toCsv=require(_0x6b39('0xa'));var querystring=require(_0x6b39('0xe'));var Papa=require(_0x6b39('0xf'));var Redis=require(_0x6b39('0x10'));var authService=require(_0x6b39('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6b39('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x6b39('0x13'))['db'];function respondWithStatusCode(_0x366232,_0x513855){_0x513855=_0x513855||0xcc;return function(_0x51ba26){if(_0x51ba26){return _0x366232[_0x6b39('0x14')](_0x513855);}return _0x366232[_0x6b39('0x15')](_0x513855)[_0x6b39('0x16')]();};}function respondWithResult(_0x20c41d,_0x104167){_0x104167=_0x104167||0xc8;return function(_0x53ed1e){if(_0x53ed1e){return _0x20c41d[_0x6b39('0x15')](_0x104167)['json'](_0x53ed1e);}};}function respondWithFilteredResult(_0x26c704,_0x18c3c7){return function(_0x2b190b){if(_0x2b190b){var _0x49277f=_0x2b190b[_0x6b39('0x17')],_0x84b853=_0x18c3c7[_0x6b39('0x18')],_0x5426f5=_0x18c3c7[_0x6b39('0x18')]+_0x18c3c7[_0x6b39('0x19')],_0x27cf58;if(_0x5426f5>=_0x49277f){_0x5426f5=_0x49277f;_0x27cf58=0xc8;}else{_0x27cf58=0xce;}_0x26c704[_0x6b39('0x15')](_0x27cf58);return _0x26c704[_0x6b39('0x1a')](_0x6b39('0x1b'),_0x84b853+'-'+_0x5426f5+'/'+_0x49277f)['json'](_0x2b190b);}return null;};}function patchUpdates(_0x51a7dc){return function(_0x14968a){try{jsonpatch[_0x6b39('0x1c')](_0x14968a,_0x51a7dc,!![]);}catch(_0x6b9cde){return BPromise[_0x6b39('0x1d')](_0x6b9cde);}return _0x14968a[_0x6b39('0x1e')]();};}function saveUpdates(_0x299538,_0x458e7d){return function(_0x560024){if(_0x560024){return _0x560024[_0x6b39('0x1f')](_0x299538)[_0x6b39('0x20')](function(_0x4a631b){return _0x4a631b;});}return null;};}function removeEntity(_0x187ab1,_0x39502d){return function(_0x3b7250){if(_0x3b7250){return _0x3b7250[_0x6b39('0x21')]()['then'](function(){_0x187ab1[_0x6b39('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c2be5,_0x6fd12){return function(_0x2e4fbf){if(!_0x2e4fbf){_0x5c2be5[_0x6b39('0x14')](0x194);}return _0x2e4fbf;};}function handleError(_0x5183cc,_0x4ebc33){_0x4ebc33=_0x4ebc33||0x1f4;return function(_0x503d6f){logger['error'](_0x503d6f[_0x6b39('0x22')]);if(_0x503d6f[_0x6b39('0x23')]){delete _0x503d6f[_0x6b39('0x23')];}_0x5183cc['status'](_0x4ebc33)[_0x6b39('0x24')](_0x503d6f);};}exports['index']=function(_0x2e1ea1,_0x4f0c90){var _0x2e4527={},_0x2dfdd4={},_0x19f53b={'count':0x0,'rows':[]};var _0x478821=_[_0x6b39('0x25')](db[_0x6b39('0x26')][_0x6b39('0x27')],function(_0x47bad3){return{'name':_0x47bad3[_0x6b39('0x28')],'type':_0x47bad3[_0x6b39('0x29')][_0x6b39('0x2a')]};});_0x2dfdd4['model']=_[_0x6b39('0x25')](_0x478821,_0x6b39('0x23'));_0x2dfdd4[_0x6b39('0x2b')]=_['keys'](_0x2e1ea1[_0x6b39('0x2b')]);_0x2dfdd4[_0x6b39('0x2c')]=_[_0x6b39('0x2d')](_0x2dfdd4[_0x6b39('0x2e')],_0x2dfdd4[_0x6b39('0x2b')]);_0x2e4527[_0x6b39('0x2f')]=_[_0x6b39('0x2d')](_0x2dfdd4['model'],qs[_0x6b39('0x30')](_0x2e1ea1[_0x6b39('0x2b')]['fields']));_0x2e4527[_0x6b39('0x2f')]=_0x2e4527[_0x6b39('0x2f')][_0x6b39('0x31')]?_0x2e4527[_0x6b39('0x2f')]:_0x2dfdd4[_0x6b39('0x2e')];if(!_0x2e1ea1[_0x6b39('0x2b')]['hasOwnProperty'](_0x6b39('0x32'))){_0x2e4527[_0x6b39('0x19')]=qs[_0x6b39('0x19')](_0x2e1ea1[_0x6b39('0x2b')]['limit']);_0x2e4527[_0x6b39('0x18')]=qs[_0x6b39('0x18')](_0x2e1ea1[_0x6b39('0x2b')][_0x6b39('0x18')]);}_0x2e4527[_0x6b39('0x33')]=qs[_0x6b39('0x34')](_0x2e1ea1[_0x6b39('0x2b')][_0x6b39('0x34')]);_0x2e4527[_0x6b39('0x35')]=qs['filters'](_['pick'](_0x2e1ea1[_0x6b39('0x2b')],_0x2dfdd4[_0x6b39('0x2c')]));if(_0x2e1ea1[_0x6b39('0x2b')]['filter']){_0x2e4527['where']=_[_0x6b39('0x36')](_0x2e4527[_0x6b39('0x35')],{'$or':_[_0x6b39('0x25')](_0x478821,function(_0x10625c){if(_0x10625c[_0x6b39('0x29')]!==_0x6b39('0x37')){var _0x541dce={};_0x541dce[_0x10625c[_0x6b39('0x23')]]={'$like':'%'+_0x2e1ea1[_0x6b39('0x2b')][_0x6b39('0x38')]+'%'};return _0x541dce;}})});}_0x2e4527=_[_0x6b39('0x36')]({},_0x2e4527,_0x2e1ea1['options']);var _0x72e6b6={'where':_0x2e4527[_0x6b39('0x35')]};return db[_0x6b39('0x26')][_0x6b39('0x17')](_0x72e6b6)[_0x6b39('0x20')](function(_0x275639){_0x19f53b[_0x6b39('0x17')]=_0x275639;if(_0x2e1ea1[_0x6b39('0x2b')]['includeAll']){_0x2e4527['include']=[{'all':!![]}];}return db[_0x6b39('0x26')]['findAll'](_0x2e4527);})[_0x6b39('0x20')](function(_0x3bea34){_0x19f53b[_0x6b39('0x39')]=_0x3bea34;return _0x19f53b;})[_0x6b39('0x20')](respondWithFilteredResult(_0x4f0c90,_0x2e4527))[_0x6b39('0x3a')](handleError(_0x4f0c90,null));};exports[_0x6b39('0x3b')]=function(_0x1966e6,_0x59b1dd){var _0x128169={'raw':!![],'where':{'id':_0x1966e6[_0x6b39('0x3c')]['id']}},_0x130e72={};_0x130e72[_0x6b39('0x2e')]=_[_0x6b39('0x3d')](db[_0x6b39('0x26')][_0x6b39('0x27')]);_0x130e72['query']=_[_0x6b39('0x3d')](_0x1966e6[_0x6b39('0x2b')]);_0x130e72[_0x6b39('0x2c')]=_['intersection'](_0x130e72[_0x6b39('0x2e')],_0x130e72[_0x6b39('0x2b')]);_0x128169[_0x6b39('0x2f')]=_[_0x6b39('0x2d')](_0x130e72[_0x6b39('0x2e')],qs[_0x6b39('0x30')](_0x1966e6[_0x6b39('0x2b')][_0x6b39('0x30')]));_0x128169['attributes']=_0x128169[_0x6b39('0x2f')][_0x6b39('0x31')]?_0x128169[_0x6b39('0x2f')]:_0x130e72[_0x6b39('0x2e')];if(_0x1966e6[_0x6b39('0x2b')][_0x6b39('0x3e')]){_0x128169['include']=[{'all':!![]}];}_0x128169=_[_0x6b39('0x36')]({},_0x128169,_0x1966e6[_0x6b39('0x3f')]);return db['SquareMessage']['find'](_0x128169)[_0x6b39('0x20')](handleEntityNotFound(_0x59b1dd,null))[_0x6b39('0x20')](respondWithResult(_0x59b1dd,null))[_0x6b39('0x3a')](handleError(_0x59b1dd,null));};exports[_0x6b39('0x40')]=function(_0x2bd86f,_0x20ec0d){return db['SquareMessage'][_0x6b39('0x40')](_0x2bd86f['body'],{})[_0x6b39('0x20')](respondWithResult(_0x20ec0d,0xc9))['catch'](handleError(_0x20ec0d,null));};exports[_0x6b39('0x1f')]=function(_0x3844b6,_0x479a97){if(_0x3844b6['body']['id']){delete _0x3844b6['body']['id'];}return db['SquareMessage'][_0x6b39('0x41')]({'where':{'id':_0x3844b6['params']['id']}})[_0x6b39('0x20')](handleEntityNotFound(_0x479a97,null))[_0x6b39('0x20')](saveUpdates(_0x3844b6[_0x6b39('0x42')],null))[_0x6b39('0x20')](respondWithResult(_0x479a97,null))[_0x6b39('0x3a')](handleError(_0x479a97,null));};exports[_0x6b39('0x21')]=function(_0x599c0e,_0x27a4bf){return db[_0x6b39('0x26')][_0x6b39('0x41')]({'where':{'id':_0x599c0e[_0x6b39('0x3c')]['id']}})[_0x6b39('0x20')](handleEntityNotFound(_0x27a4bf,null))['then'](removeEntity(_0x27a4bf,null))['catch'](handleError(_0x27a4bf,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index a2d3c05..6daea0a 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 _0xf92f=['SquareMessage','lodash','util','../../config/logger','request-promise','rimraf','../../config/environment','./squareMessage.attributes','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf92f,0x105));var _0xff92=function(_0x4084d3,_0x4e6078){_0x4084d3=_0x4084d3-0x0;var _0x9e64d8=_0xf92f[_0x4084d3];return _0x9e64d8;};'use strict';var _=require(_0xff92('0x0'));var util=require(_0xff92('0x1'));var logger=require(_0xff92('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xff92('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xff92('0x4'));var config=require(_0xff92('0x5'));var attributes=require(_0xff92('0x6'));module[_0xff92('0x7')]=function(_0x4fe6c8,_0x16afb6){return _0x4fe6c8[_0xff92('0x8')](_0xff92('0x9'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3cd6=['square_messages','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage'];(function(_0x166dc9,_0x19aec7){var _0x3558eb=function(_0x2f5539){while(--_0x2f5539){_0x166dc9['push'](_0x166dc9['shift']());}};_0x3558eb(++_0x19aec7);}(_0x3cd6,0x187));var _0x63cd=function(_0xdd453b,_0x4cb496){_0xdd453b=_0xdd453b-0x0;var _0x323130=_0x3cd6[_0xdd453b];return _0x323130;};'use strict';var _=require('lodash');var util=require(_0x63cd('0x0'));var logger=require(_0x63cd('0x1'))(_0x63cd('0x2'));var moment=require(_0x63cd('0x3'));var BPromise=require(_0x63cd('0x4'));var rp=require(_0x63cd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x63cd('0x6'));var config=require(_0x63cd('0x7'));var attributes=require(_0x63cd('0x8'));module[_0x63cd('0x9')]=function(_0x474702,_0x52bfc4){return _0x474702[_0x63cd('0xa')](_0x63cd('0xb'),attributes,{'tableName':_0x63cd('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 969adbf..beff49c 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 _0xb931=['options','raw','then','debug','catch','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SquareMessage,\x20%s,\x20%s','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateSquareMessage','SquareMessage','create','body'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xb931,0x155));var _0x1b93=function(_0x5c350c,_0x5e910d){_0x5c350c=_0x5c350c-0x0;var _0x4f03d0=_0xb931[_0x5c350c];return _0x4f03d0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1b93('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1b93('0x1'));var db=require(_0x1b93('0x2'))['db'];var utils=require(_0x1b93('0x3'));var logger=require(_0x1b93('0x4'))(_0x1b93('0x5'));var config=require(_0x1b93('0x6'));var jayson=require(_0x1b93('0x7'));var client=jayson[_0x1b93('0x8')][_0x1b93('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c482c,_0x369a19,_0x55cda6){return new BPromise(function(_0x7462d7,_0x3dc130){return client[_0x1b93('0xa')](_0x1c482c,_0x55cda6)['then'](function(_0x541e77){logger[_0x1b93('0xb')](_0x1b93('0xc'),_0x369a19,_0x1b93('0xd'));logger['debug'](_0x1b93('0xe'),_0x369a19,'request\x20sent',JSON[_0x1b93('0xf')](_0x541e77));if(_0x541e77[_0x1b93('0x10')]){if(_0x541e77['error']['code']===0x1f4){logger[_0x1b93('0x10')](_0x1b93('0xc'),_0x369a19,_0x541e77[_0x1b93('0x10')]['message']);return _0x3dc130(_0x541e77[_0x1b93('0x10')]['message']);}logger[_0x1b93('0x10')](_0x1b93('0xc'),_0x369a19,_0x541e77[_0x1b93('0x10')][_0x1b93('0x11')]);return _0x7462d7(_0x541e77[_0x1b93('0x10')][_0x1b93('0x11')]);}else{logger['info'](_0x1b93('0xc'),_0x369a19,_0x1b93('0xd'));_0x7462d7(_0x541e77[_0x1b93('0x12')][_0x1b93('0x11')]);}})['catch'](function(_0x294be5){logger[_0x1b93('0x10')]('SquareMessage,\x20%s,\x20%s',_0x369a19,_0x294be5);_0x3dc130(_0x294be5);});});}exports[_0x1b93('0x13')]=function(_0x339c5b){var _0x4ed0d5=this;return new Promise(function(_0x5ccbf4,_0x5f4d17){return db[_0x1b93('0x14')][_0x1b93('0x15')](_0x339c5b[_0x1b93('0x16')],{'raw':_0x339c5b[_0x1b93('0x17')]?_0x339c5b['options'][_0x1b93('0x18')]===undefined?!![]:![]:!![]})[_0x1b93('0x19')](function(_0x5cba05){logger['info'](_0x1b93('0x13'),_0x339c5b);logger[_0x1b93('0x1a')](_0x1b93('0x13'),_0x339c5b,JSON[_0x1b93('0xf')](_0x5cba05));_0x5ccbf4(_0x5cba05);})[_0x1b93('0x1b')](function(_0x333390){logger['error'](_0x1b93('0x13'),_0x333390[_0x1b93('0x11')],_0x339c5b);_0x5f4d17(_0x4ed0d5[_0x1b93('0x10')](0x1f4,_0x333390['message']));});});}; \ No newline at end of file +var _0xfcbe=['stringify','error','code','message','result','catch','SquareMessage','create','body','options','raw','CreateSquareMessage','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','http','request','then','info','SquareMessage,\x20%s,\x20%s','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x1bb235,_0x2792){var _0x108d42=function(_0x3f9e4c){while(--_0x3f9e4c){_0x1bb235['push'](_0x1bb235['shift']());}};_0x108d42(++_0x2792);}(_0xfcbe,0x1b1));var _0xefcb=function(_0x417dd9,_0x295f9b){_0x417dd9=_0x417dd9-0x0;var _0x3783d8=_0xfcbe[_0x417dd9];return _0x3783d8;};'use strict';var _=require('lodash');var util=require(_0xefcb('0x0'));var moment=require(_0xefcb('0x1'));var BPromise=require(_0xefcb('0x2'));var rs=require(_0xefcb('0x3'));var fs=require('fs');var Redis=require(_0xefcb('0x4'));var db=require(_0xefcb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xefcb('0x6'))(_0xefcb('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xefcb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4e15ab,_0x4bacb4,_0x4697fe){return new BPromise(function(_0x55cad2,_0x100aa1){return client[_0xefcb('0x9')](_0x4e15ab,_0x4697fe)[_0xefcb('0xa')](function(_0x5dc9cd){logger[_0xefcb('0xb')](_0xefcb('0xc'),_0x4bacb4,'request\x20sent');logger['debug'](_0xefcb('0xd'),_0x4bacb4,_0xefcb('0xe'),JSON[_0xefcb('0xf')](_0x5dc9cd));if(_0x5dc9cd[_0xefcb('0x10')]){if(_0x5dc9cd[_0xefcb('0x10')][_0xefcb('0x11')]===0x1f4){logger['error'](_0xefcb('0xc'),_0x4bacb4,_0x5dc9cd[_0xefcb('0x10')][_0xefcb('0x12')]);return _0x100aa1(_0x5dc9cd[_0xefcb('0x10')][_0xefcb('0x12')]);}logger['error']('SquareMessage,\x20%s,\x20%s',_0x4bacb4,_0x5dc9cd[_0xefcb('0x10')][_0xefcb('0x12')]);return _0x55cad2(_0x5dc9cd['error'][_0xefcb('0x12')]);}else{logger['info'](_0xefcb('0xc'),_0x4bacb4,'request\x20sent');_0x55cad2(_0x5dc9cd[_0xefcb('0x13')][_0xefcb('0x12')]);}})[_0xefcb('0x14')](function(_0x187f0f){logger[_0xefcb('0x10')](_0xefcb('0xc'),_0x4bacb4,_0x187f0f);_0x100aa1(_0x187f0f);});});}exports['CreateSquareMessage']=function(_0x15fbec){var _0x8de41a=this;return new Promise(function(_0xe922c7,_0x4884be){return db[_0xefcb('0x15')][_0xefcb('0x16')](_0x15fbec[_0xefcb('0x17')],{'raw':_0x15fbec['options']?_0x15fbec[_0xefcb('0x18')][_0xefcb('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x12a93f){logger[_0xefcb('0xb')](_0xefcb('0x1a'),_0x15fbec);logger[_0xefcb('0x1b')](_0xefcb('0x1a'),_0x15fbec,JSON['stringify'](_0x12a93f));_0xe922c7(_0x12a93f);})[_0xefcb('0x14')](function(_0x33641c){logger[_0xefcb('0x10')](_0xefcb('0x1a'),_0x33641c[_0xefcb('0x12')],_0x15fbec);_0x4884be(_0x8de41a[_0xefcb('0x10')](0x1f4,_0x33641c[_0xefcb('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 43ed044..d3c12f8 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 _0x0b8a=['update','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','/:id/test','test','post','create','put'];(function(_0x51674a,_0x77ccff){var _0x13fca6=function(_0x3d6c27){while(--_0x3d6c27){_0x51674a['push'](_0x51674a['shift']());}};_0x13fca6(++_0x77ccff);}(_0x0b8a,0x11c));var _0xa0b8=function(_0x3887f6,_0x24985d){_0x3887f6=_0x3887f6-0x0;var _0x423ab6=_0x0b8a[_0x3887f6];return _0x423ab6;};'use strict';var multer=require(_0xa0b8('0x0'));var util=require('util');var path=require(_0xa0b8('0x1'));var timeout=require(_0xa0b8('0x2'));var express=require('express');var router=express[_0xa0b8('0x3')]();var auth=require(_0xa0b8('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa0b8('0x5'));router[_0xa0b8('0x6')]('/',auth[_0xa0b8('0x7')](),controller[_0xa0b8('0x8')]);router[_0xa0b8('0x6')](_0xa0b8('0x9'),auth[_0xa0b8('0x7')](),controller[_0xa0b8('0xa')]);router['get'](_0xa0b8('0xb'),auth['isAuthenticated'](),timeout('15s'),controller[_0xa0b8('0xc')]);router[_0xa0b8('0xd')]('/',auth['isAuthenticated'](),controller[_0xa0b8('0xe')]);router[_0xa0b8('0xf')](_0xa0b8('0x9'),auth[_0xa0b8('0x7')](),controller[_0xa0b8('0x10')]);router[_0xa0b8('0x11')](_0xa0b8('0x9'),auth[_0xa0b8('0x7')](),controller[_0xa0b8('0x12')]);module[_0xa0b8('0x13')]=router; \ No newline at end of file +var _0xb547=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./squareOdbc.controller','isAuthenticated','/:id','show','get','/:id/test','test','post','create'];(function(_0x3f6e74,_0x353290){var _0x769411=function(_0x58695e){while(--_0x58695e){_0x3f6e74['push'](_0x3f6e74['shift']());}};_0x769411(++_0x353290);}(_0xb547,0x143));var _0x7b54=function(_0x53ad58,_0x3fb489){_0x53ad58=_0x53ad58-0x0;var _0x554b03=_0xb547[_0x53ad58];return _0x554b03;};'use strict';var multer=require(_0x7b54('0x0'));var util=require(_0x7b54('0x1'));var path=require(_0x7b54('0x2'));var timeout=require(_0x7b54('0x3'));var express=require(_0x7b54('0x4'));var router=express[_0x7b54('0x5')]();var auth=require(_0x7b54('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7b54('0x7'));var controller=require(_0x7b54('0x8'));router['get']('/',auth[_0x7b54('0x9')](),controller['index']);router['get'](_0x7b54('0xa'),auth[_0x7b54('0x9')](),controller[_0x7b54('0xb')]);router[_0x7b54('0xc')](_0x7b54('0xd'),auth[_0x7b54('0x9')](),timeout('15s'),controller[_0x7b54('0xe')]);router[_0x7b54('0xf')]('/',auth[_0x7b54('0x9')](),controller[_0x7b54('0x10')]);router['put'](_0x7b54('0xa'),auth[_0x7b54('0x9')](),controller[_0x7b54('0x11')]);router['delete'](_0x7b54('0xa'),auth[_0x7b54('0x9')](),controller[_0x7b54('0x12')]);module[_0x7b54('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index c866d1c..6150f9a 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 _0x8079=['exports','STRING','name','sequelize'];(function(_0x5db221,_0x45952f){var _0x437b3a=function(_0x2b5824){while(--_0x2b5824){_0x5db221['push'](_0x5db221['shift']());}};_0x437b3a(++_0x45952f);}(_0x8079,0x73));var _0x9807=function(_0x58cf07,_0x2e3858){_0x58cf07=_0x58cf07-0x0;var _0x42afe0=_0x8079[_0x58cf07];return _0x42afe0;};'use strict';var Sequelize=require(_0x9807('0x0'));module[_0x9807('0x1')]={'name':{'type':Sequelize[_0x9807('0x2')],'unique':_0x9807('0x3'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe3b0=['sequelize','exports','STRING'];(function(_0x509414,_0x29f4cd){var _0x10a4dc=function(_0x598c64){while(--_0x598c64){_0x509414['push'](_0x509414['shift']());}};_0x10a4dc(++_0x29f4cd);}(_0xe3b0,0x1cb));var _0x0e3b=function(_0x48b810,_0x173a5e){_0x48b810=_0x48b810-0x0;var _0x23c17d=_0xe3b0[_0x48b810];return _0x23c17d;};'use strict';var Sequelize=require(_0x0e3b('0x0'));module[_0x0e3b('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0x0e3b('0x2')]},'description':{'type':Sequelize[_0x0e3b('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 8913e9a..4bd4b37 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 _0xe20c=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','get','UserProfileResource','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','query','keys','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','type','VIRTUAL','filter','options','SquareOdbc','includeAll','include','findAll','catch','show','params','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ODBC','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','test','dsn','openSync','closeSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash'];(function(_0x35bd6c,_0x585087){var _0x2f421d=function(_0x42ae70){while(--_0x42ae70){_0x35bd6c['push'](_0x35bd6c['shift']());}};_0x2f421d(++_0x585087);}(_0xe20c,0x10c));var _0xce20=function(_0x5168d3,_0x4c7705){_0x5168d3=_0x5168d3-0x0;var _0xb1143a=_0xe20c[_0x5168d3];return _0xb1143a;};'use strict';var pdf=require(_0xce20('0x0'));var emlformat=require(_0xce20('0x1'));var rimraf=require(_0xce20('0x2'));var zipdir=require(_0xce20('0x3'));var jsonpatch=require(_0xce20('0x4'));var rp=require(_0xce20('0x5'));var moment=require('moment');var BPromise=require(_0xce20('0x6'));var Mustache=require(_0xce20('0x7'));var util=require(_0xce20('0x8'));var path=require(_0xce20('0x9'));var sox=require(_0xce20('0xa'));var csv=require(_0xce20('0xb'));var ejs=require(_0xce20('0xc'));var fs=require('fs');var _=require(_0xce20('0xd'));var squel=require(_0xce20('0xe'));var crypto=require(_0xce20('0xf'));var jsforce=require(_0xce20('0x10'));var deskjs=require(_0xce20('0x11'));var toCsv=require(_0xce20('0xb'));var querystring=require(_0xce20('0x12'));var Papa=require(_0xce20('0x13'));var Redis=require(_0xce20('0x14'));var authService=require(_0xce20('0x15'));var qs=require(_0xce20('0x16'));var as=require(_0xce20('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xce20('0x18'))(_0xce20('0x19'));var utils=require('../../config/utils');var config=require(_0xce20('0x1a'));var db=require(_0xce20('0x1b'))['db'];function respondWithStatusCode(_0x437bd5,_0x407668){_0x407668=_0x407668||0xcc;return function(_0x1b5cee){if(_0x1b5cee){return _0x437bd5[_0xce20('0x1c')](_0x407668);}return _0x437bd5[_0xce20('0x1d')](_0x407668)[_0xce20('0x1e')]();};}function respondWithResult(_0x2e7cac,_0x3744be){_0x3744be=_0x3744be||0xc8;return function(_0x17f9ea){if(_0x17f9ea){return _0x2e7cac[_0xce20('0x1d')](_0x3744be)[_0xce20('0x1f')](_0x17f9ea);}};}function respondWithFilteredResult(_0x3bed55,_0x5969a3){return function(_0x434650){if(_0x434650){var _0x4008a1=_0x434650[_0xce20('0x20')],_0x3e96d3=_0x5969a3[_0xce20('0x21')],_0x5dc7c3=_0x5969a3[_0xce20('0x21')]+_0x5969a3[_0xce20('0x22')],_0x5e02ff;if(_0x5dc7c3>=_0x4008a1){_0x5dc7c3=_0x4008a1;_0x5e02ff=0xc8;}else{_0x5e02ff=0xce;}_0x3bed55[_0xce20('0x1d')](_0x5e02ff);return _0x3bed55[_0xce20('0x23')](_0xce20('0x24'),_0x3e96d3+'-'+_0x5dc7c3+'/'+_0x4008a1)[_0xce20('0x1f')](_0x434650);}return null;};}function patchUpdates(_0x436b18){return function(_0x456099){try{jsonpatch[_0xce20('0x25')](_0x456099,_0x436b18,!![]);}catch(_0x48c65e){return BPromise[_0xce20('0x26')](_0x48c65e);}return _0x456099[_0xce20('0x27')]();};}function saveUpdates(_0x4cd99c,_0x2b88c8){return function(_0x4b0bfc){if(_0x4b0bfc){return _0x4b0bfc['update'](_0x4cd99c)[_0xce20('0x28')](function(_0x871a86){return _0x871a86;});}return null;};}function removeEntity(_0x26b038,_0x2b26ae){return function(_0x3b59c9){if(_0x3b59c9){return _0x3b59c9['destroy']()[_0xce20('0x28')](function(){var _0x15d90d=_0x3b59c9[_0xce20('0x29')]({'plain':!![]});var _0x7b4eef='ODBC';return db[_0xce20('0x2a')][_0xce20('0x2b')]({'where':{'type':_0x7b4eef,'resourceId':_0x15d90d['id']}})[_0xce20('0x28')](function(){return _0x3b59c9;});})[_0xce20('0x28')](function(){_0x26b038[_0xce20('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3bbbae,_0x59da3e){return function(_0x540eeb){if(!_0x540eeb){_0x3bbbae[_0xce20('0x1c')](0x194);}return _0x540eeb;};}function handleError(_0x4a489a,_0x233b34){_0x233b34=_0x233b34||0x1f4;return function(_0x2e65ab){logger[_0xce20('0x2c')](_0x2e65ab[_0xce20('0x2d')]);if(_0x2e65ab['name']){delete _0x2e65ab[_0xce20('0x2e')];}_0x4a489a['status'](_0x233b34)[_0xce20('0x2f')](_0x2e65ab);};}exports[_0xce20('0x30')]=function(_0xcc9d04,_0x55c3c1){var _0x52121f={},_0x7c01e9={},_0x32b0e9={'count':0x0,'rows':[]};var _0x14b1d2=_[_0xce20('0x31')](db['SquareOdbc'][_0xce20('0x32')],function(_0x1cedd2){return{'name':_0x1cedd2[_0xce20('0x33')],'type':_0x1cedd2['type'][_0xce20('0x34')]};});_0x7c01e9['model']=_[_0xce20('0x31')](_0x14b1d2,_0xce20('0x2e'));_0x7c01e9[_0xce20('0x35')]=_[_0xce20('0x36')](_0xcc9d04['query']);_0x7c01e9['filters']=_[_0xce20('0x37')](_0x7c01e9[_0xce20('0x38')],_0x7c01e9[_0xce20('0x35')]);_0x52121f[_0xce20('0x39')]=_[_0xce20('0x37')](_0x7c01e9['model'],qs['fields'](_0xcc9d04[_0xce20('0x35')]['fields']));_0x52121f[_0xce20('0x39')]=_0x52121f[_0xce20('0x39')][_0xce20('0x3a')]?_0x52121f['attributes']:_0x7c01e9[_0xce20('0x38')];if(!_0xcc9d04[_0xce20('0x35')][_0xce20('0x3b')](_0xce20('0x3c'))){_0x52121f['limit']=qs[_0xce20('0x22')](_0xcc9d04[_0xce20('0x35')]['limit']);_0x52121f[_0xce20('0x21')]=qs['offset'](_0xcc9d04[_0xce20('0x35')][_0xce20('0x21')]);}_0x52121f[_0xce20('0x3d')]=qs[_0xce20('0x3e')](_0xcc9d04[_0xce20('0x35')][_0xce20('0x3e')]);_0x52121f['where']=qs[_0xce20('0x3f')](_[_0xce20('0x40')](_0xcc9d04['query'],_0x7c01e9[_0xce20('0x3f')]));if(_0xcc9d04[_0xce20('0x35')]['filter']){_0x52121f[_0xce20('0x41')]=_[_0xce20('0x42')](_0x52121f['where'],{'$or':_[_0xce20('0x31')](_0x14b1d2,function(_0x4d8a15){if(_0x4d8a15[_0xce20('0x43')]!==_0xce20('0x44')){var _0x4a7cf6={};_0x4a7cf6[_0x4d8a15[_0xce20('0x2e')]]={'$like':'%'+_0xcc9d04['query'][_0xce20('0x45')]+'%'};return _0x4a7cf6;}})});}_0x52121f=_[_0xce20('0x42')]({},_0x52121f,_0xcc9d04[_0xce20('0x46')]);var _0xd4615={'where':_0x52121f[_0xce20('0x41')]};return db[_0xce20('0x47')]['count'](_0xd4615)[_0xce20('0x28')](function(_0x1b34dd){_0x32b0e9[_0xce20('0x20')]=_0x1b34dd;if(_0xcc9d04[_0xce20('0x35')][_0xce20('0x48')]){_0x52121f[_0xce20('0x49')]=[{'all':!![]}];}return db['SquareOdbc'][_0xce20('0x4a')](_0x52121f);})['then'](function(_0x33ed40){_0x32b0e9['rows']=_0x33ed40;return _0x32b0e9;})[_0xce20('0x28')](respondWithFilteredResult(_0x55c3c1,_0x52121f))[_0xce20('0x4b')](handleError(_0x55c3c1,null));};exports[_0xce20('0x4c')]=function(_0x2b7beb,_0x3aa310){var _0x1804cd={'raw':!![],'where':{'id':_0x2b7beb[_0xce20('0x4d')]['id']}},_0x20e87e={};_0x20e87e['model']=_[_0xce20('0x36')](db['SquareOdbc']['rawAttributes']);_0x20e87e['query']=_[_0xce20('0x36')](_0x2b7beb[_0xce20('0x35')]);_0x20e87e[_0xce20('0x3f')]=_[_0xce20('0x37')](_0x20e87e[_0xce20('0x38')],_0x20e87e['query']);_0x1804cd['attributes']=_[_0xce20('0x37')](_0x20e87e[_0xce20('0x38')],qs['fields'](_0x2b7beb[_0xce20('0x35')]['fields']));_0x1804cd['attributes']=_0x1804cd['attributes'][_0xce20('0x3a')]?_0x1804cd[_0xce20('0x39')]:_0x20e87e[_0xce20('0x38')];if(_0x2b7beb['query']['includeAll']){_0x1804cd['include']=[{'all':!![]}];}_0x1804cd=_[_0xce20('0x42')]({},_0x1804cd,_0x2b7beb['options']);return db[_0xce20('0x47')]['find'](_0x1804cd)['then'](handleEntityNotFound(_0x3aa310,null))[_0xce20('0x28')](respondWithResult(_0x3aa310,null))[_0xce20('0x4b')](handleError(_0x3aa310,null));};exports[_0xce20('0x4e')]=function(_0xa83d2c,_0x3b3370){return db[_0xce20('0x47')][_0xce20('0x4e')](_0xa83d2c[_0xce20('0x4f')],{})['then'](function(_0x539ce7){var _0x3fb970=_0xa83d2c['user']['get']({'plain':!![]});if(!_0x3fb970)throw new Error(_0xce20('0x50'));if(_0x3fb970[_0xce20('0x51')]===_0xce20('0x52')){var _0x5f1cd8=_0x539ce7[_0xce20('0x29')]({'plain':!![]});var _0x5106d4=_0xce20('0x53');return db[_0xce20('0x54')]['find']({'where':{'name':_0x5106d4,'userProfileId':_0x3fb970[_0xce20('0x55')]},'raw':!![]})[_0xce20('0x28')](function(_0x3d3cc2){if(_0x3d3cc2&&_0x3d3cc2[_0xce20('0x56')]===0x0){return db[_0xce20('0x2a')][_0xce20('0x4e')]({'name':_0x5f1cd8[_0xce20('0x2e')],'resourceId':_0x5f1cd8['id'],'type':_0x3d3cc2[_0xce20('0x2e')],'sectionId':_0x3d3cc2['id']},{})['then'](function(){return _0x539ce7;});}else{return _0x539ce7;}})[_0xce20('0x4b')](function(_0x592d9a){logger[_0xce20('0x2c')](_0xce20('0x57'),_0x592d9a);throw _0x592d9a;});}return _0x539ce7;})[_0xce20('0x28')](respondWithResult(_0x3b3370,0xc9))[_0xce20('0x4b')](handleError(_0x3b3370,null));};exports[_0xce20('0x58')]=function(_0x4d61d4,_0x76efaf){if(_0x4d61d4[_0xce20('0x4f')]['id']){delete _0x4d61d4['body']['id'];}return db[_0xce20('0x47')][_0xce20('0x59')]({'where':{'id':_0x4d61d4[_0xce20('0x4d')]['id']}})[_0xce20('0x28')](handleEntityNotFound(_0x76efaf,null))[_0xce20('0x28')](saveUpdates(_0x4d61d4[_0xce20('0x4f')],null))['then'](respondWithResult(_0x76efaf,null))[_0xce20('0x4b')](handleError(_0x76efaf,null));};exports[_0xce20('0x2b')]=function(_0x1b8029,_0x2505e0){return db['SquareOdbc'][_0xce20('0x59')]({'where':{'id':_0x1b8029[_0xce20('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2505e0,null))[_0xce20('0x28')](removeEntity(_0x2505e0,null))[_0xce20('0x4b')](handleError(_0x2505e0,null));};exports[_0xce20('0x5a')]=function(_0x31f551,_0x5529ba,_0x19906a){var _0x4c10f6;return db['SquareOdbc'][_0xce20('0x59')]({'where':{'id':_0x31f551[_0xce20('0x4d')]['id']},'attributes':['id',_0xce20('0x5b')]})['then'](handleEntityNotFound(_0x5529ba,null))[_0xce20('0x28')](function(_0x51d14c){if(_0x51d14c){var _0x5d9854=require('odbc')();_0x5d9854[_0xce20('0x5c')](_0x51d14c[_0xce20('0x5b')]);_0x5d9854[_0xce20('0x5d')]();return _0x51d14c;}})[_0xce20('0x28')](respondWithResult(_0x5529ba,null))[_0xce20('0x4b')](handleError(_0x5529ba,null));}; \ No newline at end of file +var _0x7f8c=['SquareOdbc','count','includeAll','findAll','rows','catch','params','options','find','create','body','role','ODBC','autoAssociation','UserProfileResource','dsn','odbc','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','lodash','squel','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','update','destroy','then','get','stack','name','send','rawAttributes','fieldName','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','map','type','VIRTUAL'];(function(_0x564523,_0x5db1c8){var _0x404d2a=function(_0x346236){while(--_0x346236){_0x564523['push'](_0x564523['shift']());}};_0x404d2a(++_0x5db1c8);}(_0x7f8c,0x189));var _0xc7f8=function(_0x35009d,_0x36f200){_0x35009d=_0x35009d-0x0;var _0x2efcc5=_0x7f8c[_0x35009d];return _0x2efcc5;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc7f8('0x0'));var rimraf=require(_0xc7f8('0x1'));var zipdir=require(_0xc7f8('0x2'));var jsonpatch=require(_0xc7f8('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc7f8('0x4'));var Mustache=require(_0xc7f8('0x5'));var util=require(_0xc7f8('0x6'));var path=require(_0xc7f8('0x7'));var sox=require('sox');var csv=require(_0xc7f8('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc7f8('0x9'));var squel=require(_0xc7f8('0xa'));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(_0xc7f8('0xb'));var Redis=require('ioredis');var authService=require(_0xc7f8('0xc'));var qs=require(_0xc7f8('0xd'));var as=require(_0xc7f8('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc7f8('0xf'))('api');var utils=require(_0xc7f8('0x10'));var config=require(_0xc7f8('0x11'));var db=require(_0xc7f8('0x12'))['db'];function respondWithStatusCode(_0x5e71f0,_0x4835f0){_0x4835f0=_0x4835f0||0xcc;return function(_0x327298){if(_0x327298){return _0x5e71f0[_0xc7f8('0x13')](_0x4835f0);}return _0x5e71f0[_0xc7f8('0x14')](_0x4835f0)[_0xc7f8('0x15')]();};}function respondWithResult(_0x21339f,_0x5bde5a){_0x5bde5a=_0x5bde5a||0xc8;return function(_0x17262f){if(_0x17262f){return _0x21339f[_0xc7f8('0x14')](_0x5bde5a)[_0xc7f8('0x16')](_0x17262f);}};}function respondWithFilteredResult(_0x30c30f,_0x1d507b){return function(_0x166b5f){if(_0x166b5f){var _0xd11299=_0x166b5f['count'],_0x1bdace=_0x1d507b[_0xc7f8('0x17')],_0x5429f8=_0x1d507b[_0xc7f8('0x17')]+_0x1d507b[_0xc7f8('0x18')],_0x36d863;if(_0x5429f8>=_0xd11299){_0x5429f8=_0xd11299;_0x36d863=0xc8;}else{_0x36d863=0xce;}_0x30c30f[_0xc7f8('0x14')](_0x36d863);return _0x30c30f[_0xc7f8('0x19')](_0xc7f8('0x1a'),_0x1bdace+'-'+_0x5429f8+'/'+_0xd11299)[_0xc7f8('0x16')](_0x166b5f);}return null;};}function patchUpdates(_0x2394d0){return function(_0x26442c){try{jsonpatch[_0xc7f8('0x1b')](_0x26442c,_0x2394d0,!![]);}catch(_0x5c5574){return BPromise['reject'](_0x5c5574);}return _0x26442c[_0xc7f8('0x1c')]();};}function saveUpdates(_0x5293e5,_0x3610ee){return function(_0x2d99ec){if(_0x2d99ec){return _0x2d99ec[_0xc7f8('0x1d')](_0x5293e5)['then'](function(_0x4924e9){return _0x4924e9;});}return null;};}function removeEntity(_0x56d281,_0x52ecbd){return function(_0x2842a1){if(_0x2842a1){return _0x2842a1[_0xc7f8('0x1e')]()[_0xc7f8('0x1f')](function(){var _0x751872=_0x2842a1[_0xc7f8('0x20')]({'plain':!![]});var _0x5dc3b0='ODBC';return db['UserProfileResource'][_0xc7f8('0x1e')]({'where':{'type':_0x5dc3b0,'resourceId':_0x751872['id']}})['then'](function(){return _0x2842a1;});})[_0xc7f8('0x1f')](function(){_0x56d281[_0xc7f8('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f00ac,_0x3df4a3){return function(_0x3557eb){if(!_0x3557eb){_0x1f00ac[_0xc7f8('0x13')](0x194);}return _0x3557eb;};}function handleError(_0x47001e,_0x1b6d2c){_0x1b6d2c=_0x1b6d2c||0x1f4;return function(_0x4f2bb3){logger['error'](_0x4f2bb3[_0xc7f8('0x21')]);if(_0x4f2bb3[_0xc7f8('0x22')]){delete _0x4f2bb3['name'];}_0x47001e[_0xc7f8('0x14')](_0x1b6d2c)[_0xc7f8('0x23')](_0x4f2bb3);};}exports['index']=function(_0x5a44eb,_0x52912e){var _0x2a5dfa={},_0xce4603={},_0x536c67={'count':0x0,'rows':[]};var _0x50185b=_['map'](db['SquareOdbc'][_0xc7f8('0x24')],function(_0x2cedac){return{'name':_0x2cedac[_0xc7f8('0x25')],'type':_0x2cedac['type'][_0xc7f8('0x26')]};});_0xce4603['model']=_['map'](_0x50185b,'name');_0xce4603[_0xc7f8('0x27')]=_[_0xc7f8('0x28')](_0x5a44eb['query']);_0xce4603['filters']=_[_0xc7f8('0x29')](_0xce4603[_0xc7f8('0x2a')],_0xce4603[_0xc7f8('0x27')]);_0x2a5dfa['attributes']=_['intersection'](_0xce4603['model'],qs[_0xc7f8('0x2b')](_0x5a44eb[_0xc7f8('0x27')][_0xc7f8('0x2b')]));_0x2a5dfa[_0xc7f8('0x2c')]=_0x2a5dfa[_0xc7f8('0x2c')][_0xc7f8('0x2d')]?_0x2a5dfa['attributes']:_0xce4603[_0xc7f8('0x2a')];if(!_0x5a44eb[_0xc7f8('0x27')][_0xc7f8('0x2e')]('nolimit')){_0x2a5dfa[_0xc7f8('0x18')]=qs[_0xc7f8('0x18')](_0x5a44eb['query'][_0xc7f8('0x18')]);_0x2a5dfa[_0xc7f8('0x17')]=qs[_0xc7f8('0x17')](_0x5a44eb[_0xc7f8('0x27')][_0xc7f8('0x17')]);}_0x2a5dfa[_0xc7f8('0x2f')]=qs['sort'](_0x5a44eb['query'][_0xc7f8('0x30')]);_0x2a5dfa[_0xc7f8('0x31')]=qs['filters'](_[_0xc7f8('0x32')](_0x5a44eb[_0xc7f8('0x27')],_0xce4603[_0xc7f8('0x33')]));if(_0x5a44eb['query'][_0xc7f8('0x34')]){_0x2a5dfa[_0xc7f8('0x31')]=_[_0xc7f8('0x35')](_0x2a5dfa[_0xc7f8('0x31')],{'$or':_[_0xc7f8('0x36')](_0x50185b,function(_0x363dff){if(_0x363dff[_0xc7f8('0x37')]!==_0xc7f8('0x38')){var _0x3e4bb1={};_0x3e4bb1[_0x363dff[_0xc7f8('0x22')]]={'$like':'%'+_0x5a44eb['query'][_0xc7f8('0x34')]+'%'};return _0x3e4bb1;}})});}_0x2a5dfa=_[_0xc7f8('0x35')]({},_0x2a5dfa,_0x5a44eb['options']);var _0x1e209e={'where':_0x2a5dfa[_0xc7f8('0x31')]};return db[_0xc7f8('0x39')][_0xc7f8('0x3a')](_0x1e209e)['then'](function(_0x2466df){_0x536c67[_0xc7f8('0x3a')]=_0x2466df;if(_0x5a44eb['query'][_0xc7f8('0x3b')]){_0x2a5dfa['include']=[{'all':!![]}];}return db['SquareOdbc'][_0xc7f8('0x3c')](_0x2a5dfa);})[_0xc7f8('0x1f')](function(_0x1bf630){_0x536c67[_0xc7f8('0x3d')]=_0x1bf630;return _0x536c67;})['then'](respondWithFilteredResult(_0x52912e,_0x2a5dfa))[_0xc7f8('0x3e')](handleError(_0x52912e,null));};exports['show']=function(_0x5e76e2,_0x3e5b92){var _0x7374d3={'raw':!![],'where':{'id':_0x5e76e2[_0xc7f8('0x3f')]['id']}},_0x17aac1={};_0x17aac1[_0xc7f8('0x2a')]=_['keys'](db[_0xc7f8('0x39')]['rawAttributes']);_0x17aac1['query']=_['keys'](_0x5e76e2[_0xc7f8('0x27')]);_0x17aac1[_0xc7f8('0x33')]=_[_0xc7f8('0x29')](_0x17aac1[_0xc7f8('0x2a')],_0x17aac1['query']);_0x7374d3[_0xc7f8('0x2c')]=_[_0xc7f8('0x29')](_0x17aac1['model'],qs[_0xc7f8('0x2b')](_0x5e76e2[_0xc7f8('0x27')]['fields']));_0x7374d3[_0xc7f8('0x2c')]=_0x7374d3[_0xc7f8('0x2c')][_0xc7f8('0x2d')]?_0x7374d3[_0xc7f8('0x2c')]:_0x17aac1[_0xc7f8('0x2a')];if(_0x5e76e2['query'][_0xc7f8('0x3b')]){_0x7374d3['include']=[{'all':!![]}];}_0x7374d3=_[_0xc7f8('0x35')]({},_0x7374d3,_0x5e76e2[_0xc7f8('0x40')]);return db[_0xc7f8('0x39')][_0xc7f8('0x41')](_0x7374d3)[_0xc7f8('0x1f')](handleEntityNotFound(_0x3e5b92,null))[_0xc7f8('0x1f')](respondWithResult(_0x3e5b92,null))[_0xc7f8('0x3e')](handleError(_0x3e5b92,null));};exports[_0xc7f8('0x42')]=function(_0x5dd90d,_0x5b87d6){return db[_0xc7f8('0x39')][_0xc7f8('0x42')](_0x5dd90d[_0xc7f8('0x43')],{})['then'](function(_0x40439a){var _0x4d77e6=_0x5dd90d['user'][_0xc7f8('0x20')]({'plain':!![]});if(!_0x4d77e6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4d77e6[_0xc7f8('0x44')]==='user'){var _0x5c5e80=_0x40439a[_0xc7f8('0x20')]({'plain':!![]});var _0x4969e6=_0xc7f8('0x45');return db['UserProfileSection'][_0xc7f8('0x41')]({'where':{'name':_0x4969e6,'userProfileId':_0x4d77e6['userProfileId']},'raw':!![]})[_0xc7f8('0x1f')](function(_0xc8f113){if(_0xc8f113&&_0xc8f113[_0xc7f8('0x46')]===0x0){return db[_0xc7f8('0x47')][_0xc7f8('0x42')]({'name':_0x5c5e80['name'],'resourceId':_0x5c5e80['id'],'type':_0xc8f113[_0xc7f8('0x22')],'sectionId':_0xc8f113['id']},{})['then'](function(){return _0x40439a;});}else{return _0x40439a;}})[_0xc7f8('0x3e')](function(_0x34bc64){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x34bc64);throw _0x34bc64;});}return _0x40439a;})[_0xc7f8('0x1f')](respondWithResult(_0x5b87d6,0xc9))[_0xc7f8('0x3e')](handleError(_0x5b87d6,null));};exports[_0xc7f8('0x1d')]=function(_0x17a8d6,_0x3bae83){if(_0x17a8d6[_0xc7f8('0x43')]['id']){delete _0x17a8d6['body']['id'];}return db[_0xc7f8('0x39')]['find']({'where':{'id':_0x17a8d6[_0xc7f8('0x3f')]['id']}})[_0xc7f8('0x1f')](handleEntityNotFound(_0x3bae83,null))['then'](saveUpdates(_0x17a8d6[_0xc7f8('0x43')],null))[_0xc7f8('0x1f')](respondWithResult(_0x3bae83,null))[_0xc7f8('0x3e')](handleError(_0x3bae83,null));};exports['destroy']=function(_0x29f834,_0x356fa1){return db[_0xc7f8('0x39')][_0xc7f8('0x41')]({'where':{'id':_0x29f834[_0xc7f8('0x3f')]['id']}})[_0xc7f8('0x1f')](handleEntityNotFound(_0x356fa1,null))[_0xc7f8('0x1f')](removeEntity(_0x356fa1,null))[_0xc7f8('0x3e')](handleError(_0x356fa1,null));};exports['test']=function(_0x27e6b3,_0x2f71ea,_0x262f58){var _0x5c5336;return db['SquareOdbc'][_0xc7f8('0x41')]({'where':{'id':_0x27e6b3[_0xc7f8('0x3f')]['id']},'attributes':['id',_0xc7f8('0x48')]})[_0xc7f8('0x1f')](handleEntityNotFound(_0x2f71ea,null))[_0xc7f8('0x1f')](function(_0x3ca260){if(_0x3ca260){var _0xef1f0d=require(_0xc7f8('0x49'))();_0xef1f0d['openSync'](_0x3ca260['dsn']);_0xef1f0d[_0xc7f8('0x4a')]();return _0x3ca260;}})[_0xc7f8('0x1f')](respondWithResult(_0x2f71ea,null))[_0xc7f8('0x3e')](handleError(_0x2f71ea,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index bab4a4a..c0fcdd4 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 _0xd0a9=['moment','bluebird','request-promise','../../config/environment','./squareOdbc.attributes','exports','SquareOdbc','util','../../config/logger','api'];(function(_0x3d14b0,_0x203233){var _0x597a2d=function(_0x4e4dfc){while(--_0x4e4dfc){_0x3d14b0['push'](_0x3d14b0['shift']());}};_0x597a2d(++_0x203233);}(_0xd0a9,0x10b));var _0x9d0a=function(_0x5c3ae9,_0x450f9a){_0x5c3ae9=_0x5c3ae9-0x0;var _0x3f5950=_0xd0a9[_0x5c3ae9];return _0x3f5950;};'use strict';var _=require('lodash');var util=require(_0x9d0a('0x0'));var logger=require(_0x9d0a('0x1'))(_0x9d0a('0x2'));var moment=require(_0x9d0a('0x3'));var BPromise=require(_0x9d0a('0x4'));var rp=require(_0x9d0a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9d0a('0x6'));var attributes=require(_0x9d0a('0x7'));module[_0x9d0a('0x8')]=function(_0x13e08f,_0x5c9aa3){return _0x13e08f['define'](_0x9d0a('0x9'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf003=['exports','SquareOdbc','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes'];(function(_0x3f69e3,_0x191d58){var _0x1388f0=function(_0x50b7da){while(--_0x50b7da){_0x3f69e3['push'](_0x3f69e3['shift']());}};_0x1388f0(++_0x191d58);}(_0xf003,0x14c));var _0x3f00=function(_0x1cd674,_0x8d3638){_0x1cd674=_0x1cd674-0x0;var _0x27928f=_0xf003[_0x1cd674];return _0x27928f;};'use strict';var _=require('lodash');var util=require(_0x3f00('0x0'));var logger=require('../../config/logger')(_0x3f00('0x1'));var moment=require('moment');var BPromise=require(_0x3f00('0x2'));var rp=require(_0x3f00('0x3'));var fs=require('fs');var path=require(_0x3f00('0x4'));var rimraf=require(_0x3f00('0x5'));var config=require(_0x3f00('0x6'));var attributes=require(_0x3f00('0x7'));module[_0x3f00('0x8')]=function(_0x5bcce7,_0x4cab56){return _0x5bcce7['define'](_0x3f00('0x9'),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 6b96cd9..033b967 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 _0x55ca=['options','where','attributes','include','map','model','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowSquareOdbc','SquareOdbc','find'];(function(_0x959591,_0x5aa72b){var _0xc85623=function(_0x21649b){while(--_0x21649b){_0x959591['push'](_0x959591['shift']());}};_0xc85623(++_0x5aa72b);}(_0x55ca,0x126));var _0xa55c=function(_0x5377a1,_0x22e1e4){_0x5377a1=_0x5377a1-0x0;var _0x45ff6f=_0x55ca[_0x5377a1];return _0x45ff6f;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('SquareOdbc,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('SquareOdbc,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});}exports[_0xa55c('0x17')]=function(_0x24783b){var _0x4cee3c=this;return new Promise(function(_0x3d4c9e,_0x104a99){return db[_0xa55c('0x18')][_0xa55c('0x19')]({'raw':_0x24783b[_0xa55c('0x1a')]?_0x24783b[_0xa55c('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x24783b['options']?_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1b')]||null:null,'attributes':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1c')]||null:null,'include':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1d')],function(_0x234372){return{'model':db[_0x234372['model']],'as':_0x234372['as'],'attributes':_0x234372[_0xa55c('0x1c')],'include':_0x234372['include']?_['map'](_0x234372['include'],function(_0x19ae88){return{'model':db[_0x19ae88['model']],'as':_0x19ae88['as'],'attributes':_0x19ae88[_0xa55c('0x1c')],'include':_0x19ae88[_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x19ae88[_0xa55c('0x1d')],function(_0x2313a9){return{'model':db[_0x2313a9[_0xa55c('0x1f')]],'as':_0x2313a9['as'],'attributes':_0x2313a9[_0xa55c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa55c('0xb')](function(_0x192df2){logger[_0xa55c('0x14')](_0xa55c('0x17'),_0x24783b);logger['debug'](_0xa55c('0x17'),_0x24783b,JSON[_0xa55c('0x10')](_0x192df2));_0x3d4c9e(_0x192df2);})[_0xa55c('0x16')](function(_0x906caa){logger['error'](_0xa55c('0x17'),_0x906caa[_0xa55c('0x13')],_0x24783b);_0x104a99(_0x4cee3c[_0xa55c('0x11')](0x1f4,_0x906caa[_0xa55c('0x13')]));});});}; \ No newline at end of file +var _0x5fc3=['info','request\x20sent','debug','stringify','error','code','message','SquareOdbc,\x20%s,\x20%s','result','catch','ShowSquareOdbc','find','options','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x1280a1,_0x5967cd){var _0x240d6f=function(_0x480ee9){while(--_0x480ee9){_0x1280a1['push'](_0x1280a1['shift']());}};_0x240d6f(++_0x5967cd);}(_0x5fc3,0xa8));var _0x35fc=function(_0x265003,_0xf0f023){_0x265003=_0x265003-0x0;var _0x33c743=_0x5fc3[_0x265003];return _0x33c743;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('SquareOdbc,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('SquareOdbc,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});}exports[_0x35fc('0x16')]=function(_0x553677){var _0x41e165=this;return new Promise(function(_0x363e47,_0x2e513b){return db['SquareOdbc'][_0x35fc('0x17')]({'raw':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x19')]||null:null,'attributes':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x1a')]||null:null,'include':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x1b')]?_[_0x35fc('0x1c')](_0x553677['options'][_0x35fc('0x1b')],function(_0xd5399f){return{'model':db[_0xd5399f[_0x35fc('0x1d')]],'as':_0xd5399f['as'],'attributes':_0xd5399f[_0x35fc('0x1a')],'include':_0xd5399f[_0x35fc('0x1b')]?_['map'](_0xd5399f[_0x35fc('0x1b')],function(_0x4c587a){return{'model':db[_0x4c587a['model']],'as':_0x4c587a['as'],'attributes':_0x4c587a[_0x35fc('0x1a')],'include':_0x4c587a[_0x35fc('0x1b')]?_[_0x35fc('0x1c')](_0x4c587a['include'],function(_0x4086e9){return{'model':db[_0x4086e9['model']],'as':_0x4086e9['as'],'attributes':_0x4086e9[_0x35fc('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x35fc('0xb')](function(_0x5cb986){logger['info'](_0x35fc('0x16'),_0x553677);logger['debug'](_0x35fc('0x16'),_0x553677,JSON[_0x35fc('0xf')](_0x5cb986));_0x363e47(_0x5cb986);})['catch'](function(_0x26b7cb){logger[_0x35fc('0x10')](_0x35fc('0x16'),_0x26b7cb[_0x35fc('0x12')],_0x553677);_0x2e513b(_0x41e165[_0x35fc('0x10')](0x1f4,_0x26b7cb[_0x35fc('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 55c1fb9..f4a75a9 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 _0x7916=['destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','getUsers','post','create','/:id/users','addUsers','put','/:id','update','delete'];(function(_0x3aa0ac,_0x5f5da6){var _0x568a11=function(_0x26f47e){while(--_0x26f47e){_0x3aa0ac['push'](_0x3aa0ac['shift']());}};_0x568a11(++_0x5f5da6);}(_0x7916,0x128));var _0x6791=function(_0x59a602,_0x4ceae3){_0x59a602=_0x59a602-0x0;var _0x4db22f=_0x7916[_0x59a602];return _0x4db22f;};'use strict';var multer=require(_0x6791('0x0'));var util=require('util');var path=require(_0x6791('0x1'));var timeout=require(_0x6791('0x2'));var express=require('express');var router=express[_0x6791('0x3')]();var auth=require(_0x6791('0x4'));var interaction=require(_0x6791('0x5'));var config=require(_0x6791('0x6'));var controller=require('./squareProject.controller');router[_0x6791('0x7')]('/',auth['isAuthenticated'](),controller[_0x6791('0x8')]);router[_0x6791('0x7')]('/:id',auth[_0x6791('0x9')](),controller['show']);router[_0x6791('0x7')]('/:id/users',auth['isAuthenticated'](),controller[_0x6791('0xa')]);router[_0x6791('0xb')]('/',auth['isAuthenticated'](),controller[_0x6791('0xc')]);router[_0x6791('0xb')](_0x6791('0xd'),auth['isAuthenticated'](),controller[_0x6791('0xe')]);router[_0x6791('0xf')](_0x6791('0x10'),auth[_0x6791('0x9')](),controller[_0x6791('0x11')]);router[_0x6791('0x12')](_0x6791('0x10'),auth[_0x6791('0x9')](),controller[_0x6791('0x13')]);router[_0x6791('0x12')](_0x6791('0xd'),auth['isAuthenticated'](),controller['removeUsers']);module[_0x6791('0x14')]=router; \ No newline at end of file +var _0xd4f4=['/:id','isAuthenticated','show','/:id/users','getUsers','post','create','addUsers','put','update','destroy','delete','removeUsers','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get'];(function(_0xd58fc1,_0x1d931c){var _0xc71c40=function(_0x8f4d82){while(--_0x8f4d82){_0xd58fc1['push'](_0xd58fc1['shift']());}};_0xc71c40(++_0x1d931c);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x26bb23,_0x34a171){_0x26bb23=_0x26bb23-0x0;var _0x385c49=_0xd4f4[_0x26bb23];return _0x385c49;};'use strict';var multer=require(_0x4d4f('0x0'));var util=require(_0x4d4f('0x1'));var path=require(_0x4d4f('0x2'));var timeout=require(_0x4d4f('0x3'));var express=require(_0x4d4f('0x4'));var router=express[_0x4d4f('0x5')]();var auth=require(_0x4d4f('0x6'));var interaction=require(_0x4d4f('0x7'));var config=require(_0x4d4f('0x8'));var controller=require(_0x4d4f('0x9'));router[_0x4d4f('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x4d4f('0xb'),auth[_0x4d4f('0xc')](),controller[_0x4d4f('0xd')]);router[_0x4d4f('0xa')](_0x4d4f('0xe'),auth[_0x4d4f('0xc')](),controller[_0x4d4f('0xf')]);router[_0x4d4f('0x10')]('/',auth[_0x4d4f('0xc')](),controller[_0x4d4f('0x11')]);router[_0x4d4f('0x10')](_0x4d4f('0xe'),auth[_0x4d4f('0xc')](),controller[_0x4d4f('0x12')]);router[_0x4d4f('0x13')](_0x4d4f('0xb'),auth[_0x4d4f('0xc')](),controller[_0x4d4f('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x4d4f('0x15')]);router[_0x4d4f('0x16')]('/:id/users',auth[_0x4d4f('0xc')](),controller[_0x4d4f('0x17')]);module[_0x4d4f('0x18')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 39c7f52..9744637 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 _0xd9e7=['long','production','utf8','sequelize','STRING','name','TEXT','getDataValue','preproduction','toString','BLOB'];(function(_0x32f6b9,_0x2d4aa9){var _0x267d52=function(_0x10f74f){while(--_0x10f74f){_0x32f6b9['push'](_0x32f6b9['shift']());}};_0x267d52(++_0x2d4aa9);}(_0xd9e7,0x179));var _0x7d9e=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0xd9e7[_0x494d1f];return _0x457b6e;};'use strict';var Sequelize=require(_0x7d9e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7d9e('0x1')],'unique':_0x7d9e('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x7d9e('0x1')]},'notes':{'type':Sequelize[_0x7d9e('0x3')]},'preproduction':{'type':Sequelize['BLOB']('long'),'get':function(){if(this[_0x7d9e('0x4')](_0x7d9e('0x5'))){return this[_0x7d9e('0x4')](_0x7d9e('0x5'))[_0x7d9e('0x6')]('utf8');}}},'production':{'type':Sequelize[_0x7d9e('0x7')](_0x7d9e('0x8')),'get':function(){if(this['getDataValue'](_0x7d9e('0x9'))){return this[_0x7d9e('0x4')]('production')[_0x7d9e('0x6')](_0x7d9e('0xa'));}}}}; \ No newline at end of file +var _0x8921=['getDataValue','preproduction','utf8','production','toString','sequelize','exports','STRING','name','BLOB','long'];(function(_0x24618a,_0x2cd0f4){var _0x2e3d64=function(_0x28c59c){while(--_0x28c59c){_0x24618a['push'](_0x24618a['shift']());}};_0x2e3d64(++_0x2cd0f4);}(_0x8921,0x73));var _0x1892=function(_0x4e6339,_0x22b18f){_0x4e6339=_0x4e6339-0x0;var _0x103a1b=_0x8921[_0x4e6339];return _0x103a1b;};'use strict';var Sequelize=require(_0x1892('0x0'));module[_0x1892('0x1')]={'name':{'type':Sequelize[_0x1892('0x2')],'unique':_0x1892('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x1892('0x4')](_0x1892('0x5')),'get':function(){if(this[_0x1892('0x6')](_0x1892('0x7'))){return this['getDataValue'](_0x1892('0x7'))['toString'](_0x1892('0x8'));}}},'production':{'type':Sequelize[_0x1892('0x4')]('long'),'get':function(){if(this[_0x1892('0x6')](_0x1892('0x9'))){return this['getDataValue'](_0x1892('0x9'))[_0x1892('0xa')](_0x1892('0x8'));}}}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index a99baaa..5a218f4 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 _0xca66=['fieldName','type','keys','query','filters','model','attributes','intersection','fields','length','nolimit','order','where','pick','filter','VIRTUAL','merge','options','include','SquareProject','rows','catch','show','params','includeAll','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','User','sort','html-pdf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./squareProject.socket','register','status','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','get','SquareProjects','UserProfileResource','then','sendStatus','name','send','index','map','rawAttributes'];(function(_0x4b41b9,_0x3f8f23){var _0x16282d=function(_0x94785){while(--_0x94785){_0x4b41b9['push'](_0x4b41b9['shift']());}};_0x16282d(++_0x3f8f23);}(_0xca66,0x8b));var _0x6ca6=function(_0x3bb219,_0x37e326){_0x3bb219=_0x3bb219-0x0;var _0x39af61=_0xca66[_0x3bb219];return _0x39af61;};'use strict';var pdf=require(_0x6ca6('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6ca6('0x1'));var jsonpatch=require(_0x6ca6('0x2'));var rp=require(_0x6ca6('0x3'));var moment=require('moment');var BPromise=require(_0x6ca6('0x4'));var Mustache=require('mustache');var util=require(_0x6ca6('0x5'));var path=require('path');var sox=require(_0x6ca6('0x6'));var csv=require(_0x6ca6('0x7'));var ejs=require(_0x6ca6('0x8'));var fs=require('fs');var _=require(_0x6ca6('0x9'));var squel=require(_0x6ca6('0xa'));var crypto=require(_0x6ca6('0xb'));var jsforce=require(_0x6ca6('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6ca6('0x7'));var querystring=require(_0x6ca6('0xd'));var Papa=require(_0x6ca6('0xe'));var Redis=require(_0x6ca6('0xf'));var authService=require(_0x6ca6('0x10'));var qs=require(_0x6ca6('0x11'));var as=require(_0x6ca6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6ca6('0x13'))(_0x6ca6('0x14'));var utils=require(_0x6ca6('0x15'));var config=require(_0x6ca6('0x16'));var db=require(_0x6ca6('0x17'))['db'];config[_0x6ca6('0x18')]=_['defaults'](config[_0x6ca6('0x18')],{'host':_0x6ca6('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6ca6('0x18')]));require(_0x6ca6('0x1a'))[_0x6ca6('0x1b')](socket);function respondWithStatusCode(_0x3570f1,_0xc774c){_0xc774c=_0xc774c||0xcc;return function(_0x1d1d86){if(_0x1d1d86){return _0x3570f1['sendStatus'](_0xc774c);}return _0x3570f1['status'](_0xc774c)['end']();};}function respondWithResult(_0x36ff3e,_0x19e94f){_0x19e94f=_0x19e94f||0xc8;return function(_0x260b56){if(_0x260b56){return _0x36ff3e[_0x6ca6('0x1c')](_0x19e94f)[_0x6ca6('0x1d')](_0x260b56);}};}function respondWithFilteredResult(_0x3d7f3f,_0x25dc6c){return function(_0x4f056d){if(_0x4f056d){var _0x2391ce=_0x4f056d[_0x6ca6('0x1e')],_0x10be57=_0x25dc6c[_0x6ca6('0x1f')],_0xc97f0=_0x25dc6c[_0x6ca6('0x1f')]+_0x25dc6c[_0x6ca6('0x20')],_0x1f21ff;if(_0xc97f0>=_0x2391ce){_0xc97f0=_0x2391ce;_0x1f21ff=0xc8;}else{_0x1f21ff=0xce;}_0x3d7f3f[_0x6ca6('0x1c')](_0x1f21ff);return _0x3d7f3f[_0x6ca6('0x21')](_0x6ca6('0x22'),_0x10be57+'-'+_0xc97f0+'/'+_0x2391ce)['json'](_0x4f056d);}return null;};}function patchUpdates(_0x28a982){return function(_0x254afe){try{jsonpatch[_0x6ca6('0x23')](_0x254afe,_0x28a982,!![]);}catch(_0x195c92){return BPromise[_0x6ca6('0x24')](_0x195c92);}return _0x254afe[_0x6ca6('0x25')]();};}function saveUpdates(_0x593f15,_0xfb962d){return function(_0x108319){if(_0x108319){return _0x108319['update'](_0x593f15)['then'](function(_0xfbf496){return _0xfbf496;});}return null;};}function removeEntity(_0x216701,_0xfe0760){return function(_0x224a1f){if(_0x224a1f){return _0x224a1f[_0x6ca6('0x26')]()['then'](function(){var _0x222373=_0x224a1f[_0x6ca6('0x27')]({'plain':!![]});var _0x1c43ee=_0x6ca6('0x28');return db[_0x6ca6('0x29')][_0x6ca6('0x26')]({'where':{'type':_0x1c43ee,'resourceId':_0x222373['id']}})[_0x6ca6('0x2a')](function(){return _0x224a1f;});})[_0x6ca6('0x2a')](function(){_0x216701['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x144ec5,_0x9467bd){return function(_0xf1d821){if(!_0xf1d821){_0x144ec5[_0x6ca6('0x2b')](0x194);}return _0xf1d821;};}function handleError(_0x552f3e,_0x5ea6f7){_0x5ea6f7=_0x5ea6f7||0x1f4;return function(_0x306583){logger['error'](_0x306583['stack']);if(_0x306583[_0x6ca6('0x2c')]){delete _0x306583[_0x6ca6('0x2c')];}_0x552f3e['status'](_0x5ea6f7)[_0x6ca6('0x2d')](_0x306583);};}exports[_0x6ca6('0x2e')]=function(_0xac50e8,_0x566543){var _0x484411={},_0x28af50={},_0x23112a={'count':0x0,'rows':[]};var _0x35fbb5=_[_0x6ca6('0x2f')](db['SquareProject'][_0x6ca6('0x30')],function(_0x15b962){return{'name':_0x15b962[_0x6ca6('0x31')],'type':_0x15b962[_0x6ca6('0x32')]['key']};});_0x28af50['model']=_['map'](_0x35fbb5,'name');_0x28af50['query']=_[_0x6ca6('0x33')](_0xac50e8[_0x6ca6('0x34')]);_0x28af50[_0x6ca6('0x35')]=_['intersection'](_0x28af50[_0x6ca6('0x36')],_0x28af50[_0x6ca6('0x34')]);_0x484411[_0x6ca6('0x37')]=_[_0x6ca6('0x38')](_0x28af50['model'],qs[_0x6ca6('0x39')](_0xac50e8[_0x6ca6('0x34')][_0x6ca6('0x39')]));_0x484411[_0x6ca6('0x37')]=_0x484411['attributes'][_0x6ca6('0x3a')]?_0x484411['attributes']:_0x28af50[_0x6ca6('0x36')];if(!_0xac50e8['query']['hasOwnProperty'](_0x6ca6('0x3b'))){_0x484411[_0x6ca6('0x20')]=qs[_0x6ca6('0x20')](_0xac50e8[_0x6ca6('0x34')]['limit']);_0x484411['offset']=qs[_0x6ca6('0x1f')](_0xac50e8[_0x6ca6('0x34')]['offset']);}_0x484411[_0x6ca6('0x3c')]=qs['sort'](_0xac50e8[_0x6ca6('0x34')]['sort']);_0x484411[_0x6ca6('0x3d')]=qs[_0x6ca6('0x35')](_[_0x6ca6('0x3e')](_0xac50e8[_0x6ca6('0x34')],_0x28af50[_0x6ca6('0x35')]));if(_0xac50e8[_0x6ca6('0x34')][_0x6ca6('0x3f')]){_0x484411[_0x6ca6('0x3d')]=_['merge'](_0x484411[_0x6ca6('0x3d')],{'$or':_['map'](_0x35fbb5,function(_0x57186c){if(_0x57186c[_0x6ca6('0x32')]!==_0x6ca6('0x40')){var _0x52cc41={};_0x52cc41[_0x57186c[_0x6ca6('0x2c')]]={'$like':'%'+_0xac50e8['query'][_0x6ca6('0x3f')]+'%'};return _0x52cc41;}})});}_0x484411=_[_0x6ca6('0x41')]({},_0x484411,_0xac50e8[_0x6ca6('0x42')]);var _0x3705cc={'where':_0x484411['where']};return db['SquareProject'][_0x6ca6('0x1e')](_0x3705cc)[_0x6ca6('0x2a')](function(_0x197ffa){_0x23112a[_0x6ca6('0x1e')]=_0x197ffa;if(_0xac50e8[_0x6ca6('0x34')]['includeAll']){_0x484411[_0x6ca6('0x43')]=[{'all':!![]}];}return db[_0x6ca6('0x44')]['findAll'](_0x484411);})[_0x6ca6('0x2a')](function(_0x3b60db){_0x23112a[_0x6ca6('0x45')]=_0x3b60db;return _0x23112a;})[_0x6ca6('0x2a')](respondWithFilteredResult(_0x566543,_0x484411))[_0x6ca6('0x46')](handleError(_0x566543,null));};exports[_0x6ca6('0x47')]=function(_0x258c76,_0xe9bce9){var _0x1a8b7e={'raw':![],'where':{'id':_0x258c76[_0x6ca6('0x48')]['id']}},_0x5e424f={};_0x5e424f[_0x6ca6('0x36')]=_[_0x6ca6('0x33')](db[_0x6ca6('0x44')][_0x6ca6('0x30')]);_0x5e424f[_0x6ca6('0x34')]=_[_0x6ca6('0x33')](_0x258c76[_0x6ca6('0x34')]);_0x5e424f['filters']=_['intersection'](_0x5e424f[_0x6ca6('0x36')],_0x5e424f[_0x6ca6('0x34')]);_0x1a8b7e[_0x6ca6('0x37')]=_[_0x6ca6('0x38')](_0x5e424f[_0x6ca6('0x36')],qs[_0x6ca6('0x39')](_0x258c76[_0x6ca6('0x34')]['fields']));_0x1a8b7e['attributes']=_0x1a8b7e[_0x6ca6('0x37')][_0x6ca6('0x3a')]?_0x1a8b7e['attributes']:_0x5e424f[_0x6ca6('0x36')];if(_0x258c76[_0x6ca6('0x34')][_0x6ca6('0x49')]){_0x1a8b7e[_0x6ca6('0x43')]=[{'all':!![]}];}_0x1a8b7e=_[_0x6ca6('0x41')]({},_0x1a8b7e,_0x258c76[_0x6ca6('0x42')]);return db[_0x6ca6('0x44')]['find'](_0x1a8b7e)[_0x6ca6('0x2a')](handleEntityNotFound(_0xe9bce9,null))[_0x6ca6('0x2a')](respondWithResult(_0xe9bce9,null))[_0x6ca6('0x46')](handleError(_0xe9bce9,null));};exports['create']=function(_0x408df3,_0x4dd78d){return db[_0x6ca6('0x44')]['create'](_0x408df3['body'],{})['then'](function(_0x199489){var _0x1603a7=_0x408df3[_0x6ca6('0x4a')]['get']({'plain':!![]});if(!_0x1603a7)throw new Error(_0x6ca6('0x4b'));if(_0x1603a7['role']===_0x6ca6('0x4a')){var _0x1010a6=_0x199489[_0x6ca6('0x27')]({'plain':!![]});var _0x18602d=_0x6ca6('0x28');return db[_0x6ca6('0x4c')][_0x6ca6('0x4d')]({'where':{'name':_0x18602d,'userProfileId':_0x1603a7[_0x6ca6('0x4e')]},'raw':!![]})[_0x6ca6('0x2a')](function(_0x2e4cc5){if(_0x2e4cc5&&_0x2e4cc5[_0x6ca6('0x4f')]===0x0){return db['UserProfileResource'][_0x6ca6('0x50')]({'name':_0x1010a6[_0x6ca6('0x2c')],'resourceId':_0x1010a6['id'],'type':_0x2e4cc5[_0x6ca6('0x2c')],'sectionId':_0x2e4cc5['id']},{})[_0x6ca6('0x2a')](function(){return _0x199489;});}else{return _0x199489;}})[_0x6ca6('0x46')](function(_0x594209){logger[_0x6ca6('0x51')](_0x6ca6('0x52'),_0x594209);throw _0x594209;});}return _0x199489;})[_0x6ca6('0x2a')](respondWithResult(_0x4dd78d,0xc9))['catch'](handleError(_0x4dd78d,null));};exports['update']=function(_0x4fe7a9,_0x4bcb4e){if(_0x4fe7a9[_0x6ca6('0x53')]['id']){delete _0x4fe7a9[_0x6ca6('0x53')]['id'];}return db[_0x6ca6('0x44')]['find']({'where':{'id':_0x4fe7a9['params']['id']}})[_0x6ca6('0x2a')](handleEntityNotFound(_0x4bcb4e,null))[_0x6ca6('0x2a')](saveUpdates(_0x4fe7a9[_0x6ca6('0x53')],null))['then'](respondWithResult(_0x4bcb4e,null))[_0x6ca6('0x46')](handleError(_0x4bcb4e,null));};exports['destroy']=function(_0x281759,_0x40077c){return db[_0x6ca6('0x44')][_0x6ca6('0x4d')]({'where':{'id':_0x281759['params']['id']}})[_0x6ca6('0x2a')](handleEntityNotFound(_0x40077c,null))['then'](removeEntity(_0x40077c,null))['catch'](handleError(_0x40077c,null));};exports[_0x6ca6('0x54')]=function(_0x11538e,_0x1b9da5,_0x35854a){return db['SquareProject'][_0x6ca6('0x4d')]({'where':{'id':_0x11538e[_0x6ca6('0x48')]['id']}})[_0x6ca6('0x2a')](handleEntityNotFound(_0x1b9da5,null))[_0x6ca6('0x2a')](function(_0x43881a){if(_0x43881a){return _0x43881a[_0x6ca6('0x54')](_0x11538e[_0x6ca6('0x53')][_0x6ca6('0x55')],_[_0x6ca6('0x56')](_0x11538e[_0x6ca6('0x53')],[_0x6ca6('0x55'),'id'])||{});}})[_0x6ca6('0x2a')](respondWithResult(_0x1b9da5,null))[_0x6ca6('0x46')](handleError(_0x1b9da5,null));};exports[_0x6ca6('0x57')]=function(_0x2eeed6,_0x290c04,_0x493e5d){return db[_0x6ca6('0x44')][_0x6ca6('0x4d')]({'where':{'id':_0x2eeed6[_0x6ca6('0x48')]['id']}})[_0x6ca6('0x2a')](handleEntityNotFound(_0x290c04,null))[_0x6ca6('0x2a')](function(_0x139144){if(_0x139144){return _0x139144[_0x6ca6('0x57')](_0x2eeed6[_0x6ca6('0x34')][_0x6ca6('0x55')])[_0x6ca6('0x2a')](function(){if(_[_0x6ca6('0x58')](_0x2eeed6[_0x6ca6('0x34')][_0x6ca6('0x55')])){for(var _0x16a4f9=0x0;_0x16a4f9<_0x2eeed6[_0x6ca6('0x34')][_0x6ca6('0x55')]['length'];_0x16a4f9+=0x1){socket[_0x6ca6('0x59')](_0x6ca6('0x5a'),{'UserId':Number(_0x2eeed6[_0x6ca6('0x34')][_0x6ca6('0x55')][_0x16a4f9]),'SquareProjectId':Number(_0x2eeed6[_0x6ca6('0x48')]['id'])});}}else{socket[_0x6ca6('0x59')]('userSquareProject:remove',{'UserId':Number(_0x2eeed6['query']['ids']),'SquareProjectId':Number(_0x2eeed6[_0x6ca6('0x48')]['id'])});}});}})[_0x6ca6('0x2a')](respondWithStatusCode(_0x290c04,null))['catch'](handleError(_0x290c04,null));};exports[_0x6ca6('0x5b')]=function(_0xc6021a,_0x97f23,_0x555b22){var _0x4250a1={};var _0x18e9c1={};var _0x22c621;var _0x1c3064;return db[_0x6ca6('0x44')]['findOne']({'where':{'id':_0xc6021a['params']['id']}})[_0x6ca6('0x2a')](handleEntityNotFound(_0x97f23,null))[_0x6ca6('0x2a')](function(_0x47d420){if(_0x47d420){_0x22c621=_0x47d420;_0x18e9c1[_0x6ca6('0x36')]=_[_0x6ca6('0x33')](db[_0x6ca6('0x5c')][_0x6ca6('0x30')]);_0x18e9c1[_0x6ca6('0x34')]=_[_0x6ca6('0x33')](_0xc6021a[_0x6ca6('0x34')]);_0x18e9c1[_0x6ca6('0x35')]=_[_0x6ca6('0x38')](_0x18e9c1['model'],_0x18e9c1['query']);_0x4250a1[_0x6ca6('0x37')]=_[_0x6ca6('0x38')](_0x18e9c1[_0x6ca6('0x36')],qs[_0x6ca6('0x39')](_0xc6021a[_0x6ca6('0x34')][_0x6ca6('0x39')]));_0x4250a1['attributes']=_0x4250a1[_0x6ca6('0x37')]['length']?_0x4250a1[_0x6ca6('0x37')]:_0x18e9c1[_0x6ca6('0x36')];_0x4250a1[_0x6ca6('0x3c')]=qs[_0x6ca6('0x5d')](_0xc6021a[_0x6ca6('0x34')]['sort']);_0x4250a1['where']=qs[_0x6ca6('0x35')](_[_0x6ca6('0x3e')](_0xc6021a[_0x6ca6('0x34')],_0x18e9c1['filters']));if(_0xc6021a[_0x6ca6('0x34')][_0x6ca6('0x3f')]){_0x4250a1[_0x6ca6('0x3d')]=_[_0x6ca6('0x41')](_0x4250a1['where'],{'$or':_[_0x6ca6('0x2f')](_0x4250a1[_0x6ca6('0x37')],function(_0x3637c9){var _0x48d7cb={};_0x48d7cb[_0x3637c9]={'$like':'%'+_0xc6021a[_0x6ca6('0x34')]['filter']+'%'};return _0x48d7cb;})});}_0x4250a1=_[_0x6ca6('0x41')]({},_0x4250a1,_0xc6021a[_0x6ca6('0x42')]);return _0x22c621[_0x6ca6('0x5b')](_0x4250a1);}})[_0x6ca6('0x2a')](function(_0x2b3fb5){if(_0x2b3fb5){_0x1c3064=_0x2b3fb5[_0x6ca6('0x3a')];if(!_0xc6021a[_0x6ca6('0x34')]['hasOwnProperty']('nolimit')){_0x4250a1[_0x6ca6('0x20')]=qs[_0x6ca6('0x20')](_0xc6021a[_0x6ca6('0x34')]['limit']);_0x4250a1[_0x6ca6('0x1f')]=qs[_0x6ca6('0x1f')](_0xc6021a[_0x6ca6('0x34')][_0x6ca6('0x1f')]);}return _0x22c621[_0x6ca6('0x5b')](_0x4250a1);}})[_0x6ca6('0x2a')](function(_0x5ceb48){if(_0x5ceb48){return _0x5ceb48?{'count':_0x1c3064,'rows':_0x5ceb48}:null;}})['then'](respondWithResult(_0x97f23,null))[_0x6ca6('0x46')](handleError(_0x97f23,null));}; \ No newline at end of file +var _0x0fd9=['json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','get','SquareProjects','UserProfileResource','error','stack','send','index','map','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','SquareProject','findAll','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','removeUsers','ids','isArray','emit','userSquareProject:remove','getUsers','User','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./squareProject.socket','sendStatus','status','end'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0fd9,0xa3));var _0x90fd=function(_0x483d8b,_0x526c52){_0x483d8b=_0x483d8b-0x0;var _0x6500f1=_0x0fd9[_0x483d8b];return _0x6500f1;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x90fd('0x0'));var rimraf=require(_0x90fd('0x1'));var zipdir=require(_0x90fd('0x2'));var jsonpatch=require(_0x90fd('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x90fd('0x4'));var Mustache=require(_0x90fd('0x5'));var util=require(_0x90fd('0x6'));var path=require(_0x90fd('0x7'));var sox=require(_0x90fd('0x8'));var csv=require(_0x90fd('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x90fd('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x90fd('0xb'));var toCsv=require(_0x90fd('0x9'));var querystring=require('querystring');var Papa=require(_0x90fd('0xc'));var Redis=require(_0x90fd('0xd'));var authService=require(_0x90fd('0xe'));var qs=require(_0x90fd('0xf'));var as=require(_0x90fd('0x10'));var hardwareService=require(_0x90fd('0x11'));var logger=require(_0x90fd('0x12'))(_0x90fd('0x13'));var utils=require(_0x90fd('0x14'));var config=require('../../config/environment');var db=require(_0x90fd('0x15'))['db'];config[_0x90fd('0x16')]=_['defaults'](config[_0x90fd('0x16')],{'host':_0x90fd('0x17'),'port':0x18eb});var socket=require(_0x90fd('0x18'))(new Redis(config['redis']));require(_0x90fd('0x19'))['register'](socket);function respondWithStatusCode(_0x1cae40,_0xb402d9){_0xb402d9=_0xb402d9||0xcc;return function(_0x18bdb6){if(_0x18bdb6){return _0x1cae40[_0x90fd('0x1a')](_0xb402d9);}return _0x1cae40[_0x90fd('0x1b')](_0xb402d9)[_0x90fd('0x1c')]();};}function respondWithResult(_0x296a64,_0x4eb953){_0x4eb953=_0x4eb953||0xc8;return function(_0x4f6b7b){if(_0x4f6b7b){return _0x296a64[_0x90fd('0x1b')](_0x4eb953)[_0x90fd('0x1d')](_0x4f6b7b);}};}function respondWithFilteredResult(_0x4baa2c,_0x130489){return function(_0x13a694){if(_0x13a694){var _0x1fcc87=_0x13a694[_0x90fd('0x1e')],_0x4d8f3b=_0x130489[_0x90fd('0x1f')],_0x3f9c76=_0x130489[_0x90fd('0x1f')]+_0x130489[_0x90fd('0x20')],_0x16e9e3;if(_0x3f9c76>=_0x1fcc87){_0x3f9c76=_0x1fcc87;_0x16e9e3=0xc8;}else{_0x16e9e3=0xce;}_0x4baa2c[_0x90fd('0x1b')](_0x16e9e3);return _0x4baa2c[_0x90fd('0x21')](_0x90fd('0x22'),_0x4d8f3b+'-'+_0x3f9c76+'/'+_0x1fcc87)[_0x90fd('0x1d')](_0x13a694);}return null;};}function patchUpdates(_0x19e79b){return function(_0x34ab93){try{jsonpatch[_0x90fd('0x23')](_0x34ab93,_0x19e79b,!![]);}catch(_0x83fde){return BPromise[_0x90fd('0x24')](_0x83fde);}return _0x34ab93['save']();};}function saveUpdates(_0x35ce4e,_0xc4e4e2){return function(_0xf3044b){if(_0xf3044b){return _0xf3044b[_0x90fd('0x25')](_0x35ce4e)[_0x90fd('0x26')](function(_0x3ad6c6){return _0x3ad6c6;});}return null;};}function removeEntity(_0x30f67e,_0x300262){return function(_0x5152f6){if(_0x5152f6){return _0x5152f6[_0x90fd('0x27')]()['then'](function(){var _0x3a9e50=_0x5152f6[_0x90fd('0x28')]({'plain':!![]});var _0x2ffea2=_0x90fd('0x29');return db[_0x90fd('0x2a')]['destroy']({'where':{'type':_0x2ffea2,'resourceId':_0x3a9e50['id']}})[_0x90fd('0x26')](function(){return _0x5152f6;});})[_0x90fd('0x26')](function(){_0x30f67e[_0x90fd('0x1b')](0xcc)[_0x90fd('0x1c')]();});}};}function handleEntityNotFound(_0x1c3805,_0x428bc2){return function(_0x4fbdb5){if(!_0x4fbdb5){_0x1c3805['sendStatus'](0x194);}return _0x4fbdb5;};}function handleError(_0xbf1c9b,_0x170cfb){_0x170cfb=_0x170cfb||0x1f4;return function(_0x2924e9){logger[_0x90fd('0x2b')](_0x2924e9[_0x90fd('0x2c')]);if(_0x2924e9['name']){delete _0x2924e9['name'];}_0xbf1c9b[_0x90fd('0x1b')](_0x170cfb)[_0x90fd('0x2d')](_0x2924e9);};}exports[_0x90fd('0x2e')]=function(_0x3a0102,_0x4a3ae4){var _0x59aede={},_0x12dea4={},_0x21a9cf={'count':0x0,'rows':[]};var _0x3d315b=_[_0x90fd('0x2f')](db['SquareProject'][_0x90fd('0x30')],function(_0x1127ef){return{'name':_0x1127ef[_0x90fd('0x31')],'type':_0x1127ef[_0x90fd('0x32')][_0x90fd('0x33')]};});_0x12dea4[_0x90fd('0x34')]=_[_0x90fd('0x2f')](_0x3d315b,_0x90fd('0x35'));_0x12dea4[_0x90fd('0x36')]=_[_0x90fd('0x37')](_0x3a0102[_0x90fd('0x36')]);_0x12dea4[_0x90fd('0x38')]=_[_0x90fd('0x39')](_0x12dea4[_0x90fd('0x34')],_0x12dea4[_0x90fd('0x36')]);_0x59aede[_0x90fd('0x3a')]=_['intersection'](_0x12dea4[_0x90fd('0x34')],qs[_0x90fd('0x3b')](_0x3a0102[_0x90fd('0x36')][_0x90fd('0x3b')]));_0x59aede[_0x90fd('0x3a')]=_0x59aede[_0x90fd('0x3a')][_0x90fd('0x3c')]?_0x59aede[_0x90fd('0x3a')]:_0x12dea4[_0x90fd('0x34')];if(!_0x3a0102[_0x90fd('0x36')][_0x90fd('0x3d')](_0x90fd('0x3e'))){_0x59aede[_0x90fd('0x20')]=qs['limit'](_0x3a0102[_0x90fd('0x36')][_0x90fd('0x20')]);_0x59aede[_0x90fd('0x1f')]=qs[_0x90fd('0x1f')](_0x3a0102['query'][_0x90fd('0x1f')]);}_0x59aede[_0x90fd('0x3f')]=qs[_0x90fd('0x40')](_0x3a0102['query']['sort']);_0x59aede[_0x90fd('0x41')]=qs[_0x90fd('0x38')](_[_0x90fd('0x42')](_0x3a0102[_0x90fd('0x36')],_0x12dea4[_0x90fd('0x38')]));if(_0x3a0102[_0x90fd('0x36')][_0x90fd('0x43')]){_0x59aede[_0x90fd('0x41')]=_[_0x90fd('0x44')](_0x59aede[_0x90fd('0x41')],{'$or':_[_0x90fd('0x2f')](_0x3d315b,function(_0x43c84c){if(_0x43c84c[_0x90fd('0x32')]!==_0x90fd('0x45')){var _0x1ed624={};_0x1ed624[_0x43c84c[_0x90fd('0x35')]]={'$like':'%'+_0x3a0102[_0x90fd('0x36')][_0x90fd('0x43')]+'%'};return _0x1ed624;}})});}_0x59aede=_['merge']({},_0x59aede,_0x3a0102[_0x90fd('0x46')]);var _0x39cf69={'where':_0x59aede[_0x90fd('0x41')]};return db['SquareProject']['count'](_0x39cf69)['then'](function(_0x45f37d){_0x21a9cf[_0x90fd('0x1e')]=_0x45f37d;if(_0x3a0102[_0x90fd('0x36')][_0x90fd('0x47')]){_0x59aede[_0x90fd('0x48')]=[{'all':!![]}];}return db[_0x90fd('0x49')][_0x90fd('0x4a')](_0x59aede);})[_0x90fd('0x26')](function(_0x94e96d){_0x21a9cf[_0x90fd('0x4b')]=_0x94e96d;return _0x21a9cf;})[_0x90fd('0x26')](respondWithFilteredResult(_0x4a3ae4,_0x59aede))[_0x90fd('0x4c')](handleError(_0x4a3ae4,null));};exports[_0x90fd('0x4d')]=function(_0x386a0e,_0x311cbf){var _0x50b722={'raw':![],'where':{'id':_0x386a0e[_0x90fd('0x4e')]['id']}},_0x512b64={};_0x512b64[_0x90fd('0x34')]=_[_0x90fd('0x37')](db['SquareProject']['rawAttributes']);_0x512b64[_0x90fd('0x36')]=_[_0x90fd('0x37')](_0x386a0e['query']);_0x512b64['filters']=_[_0x90fd('0x39')](_0x512b64[_0x90fd('0x34')],_0x512b64['query']);_0x50b722['attributes']=_[_0x90fd('0x39')](_0x512b64[_0x90fd('0x34')],qs[_0x90fd('0x3b')](_0x386a0e['query'][_0x90fd('0x3b')]));_0x50b722[_0x90fd('0x3a')]=_0x50b722['attributes']['length']?_0x50b722['attributes']:_0x512b64[_0x90fd('0x34')];if(_0x386a0e[_0x90fd('0x36')]['includeAll']){_0x50b722[_0x90fd('0x48')]=[{'all':!![]}];}_0x50b722=_[_0x90fd('0x44')]({},_0x50b722,_0x386a0e[_0x90fd('0x46')]);return db[_0x90fd('0x49')][_0x90fd('0x4f')](_0x50b722)['then'](handleEntityNotFound(_0x311cbf,null))['then'](respondWithResult(_0x311cbf,null))[_0x90fd('0x4c')](handleError(_0x311cbf,null));};exports[_0x90fd('0x50')]=function(_0x125874,_0x17b6b0){return db[_0x90fd('0x49')][_0x90fd('0x50')](_0x125874[_0x90fd('0x51')],{})[_0x90fd('0x26')](function(_0x31b284){var _0x3c4c35=_0x125874['user'][_0x90fd('0x28')]({'plain':!![]});if(!_0x3c4c35)throw new Error(_0x90fd('0x52'));if(_0x3c4c35[_0x90fd('0x53')]===_0x90fd('0x54')){var _0x4b47bc=_0x31b284['get']({'plain':!![]});var _0x1cce5b='SquareProjects';return db['UserProfileSection'][_0x90fd('0x4f')]({'where':{'name':_0x1cce5b,'userProfileId':_0x3c4c35[_0x90fd('0x55')]},'raw':!![]})[_0x90fd('0x26')](function(_0xb8a2af){if(_0xb8a2af&&_0xb8a2af[_0x90fd('0x56')]===0x0){return db[_0x90fd('0x2a')][_0x90fd('0x50')]({'name':_0x4b47bc['name'],'resourceId':_0x4b47bc['id'],'type':_0xb8a2af['name'],'sectionId':_0xb8a2af['id']},{})[_0x90fd('0x26')](function(){return _0x31b284;});}else{return _0x31b284;}})[_0x90fd('0x4c')](function(_0x1f016e){logger['error'](_0x90fd('0x57'),_0x1f016e);throw _0x1f016e;});}return _0x31b284;})[_0x90fd('0x26')](respondWithResult(_0x17b6b0,0xc9))[_0x90fd('0x4c')](handleError(_0x17b6b0,null));};exports[_0x90fd('0x25')]=function(_0x437abd,_0xaea5cc){if(_0x437abd[_0x90fd('0x51')]['id']){delete _0x437abd[_0x90fd('0x51')]['id'];}return db['SquareProject']['find']({'where':{'id':_0x437abd[_0x90fd('0x4e')]['id']}})[_0x90fd('0x26')](handleEntityNotFound(_0xaea5cc,null))[_0x90fd('0x26')](saveUpdates(_0x437abd['body'],null))[_0x90fd('0x26')](respondWithResult(_0xaea5cc,null))[_0x90fd('0x4c')](handleError(_0xaea5cc,null));};exports[_0x90fd('0x27')]=function(_0x24229f,_0x43f75a){return db[_0x90fd('0x49')]['find']({'where':{'id':_0x24229f[_0x90fd('0x4e')]['id']}})['then'](handleEntityNotFound(_0x43f75a,null))[_0x90fd('0x26')](removeEntity(_0x43f75a,null))['catch'](handleError(_0x43f75a,null));};exports[_0x90fd('0x58')]=function(_0x461509,_0x2fb220,_0x81f00d){return db['SquareProject'][_0x90fd('0x4f')]({'where':{'id':_0x461509[_0x90fd('0x4e')]['id']}})[_0x90fd('0x26')](handleEntityNotFound(_0x2fb220,null))[_0x90fd('0x26')](function(_0x4586e9){if(_0x4586e9){return _0x4586e9[_0x90fd('0x58')](_0x461509['body']['ids'],_['omit'](_0x461509['body'],['ids','id'])||{});}})[_0x90fd('0x26')](respondWithResult(_0x2fb220,null))[_0x90fd('0x4c')](handleError(_0x2fb220,null));};exports[_0x90fd('0x59')]=function(_0x161522,_0x14fd9b,_0x4ae384){return db['SquareProject']['find']({'where':{'id':_0x161522[_0x90fd('0x4e')]['id']}})[_0x90fd('0x26')](handleEntityNotFound(_0x14fd9b,null))['then'](function(_0x41f596){if(_0x41f596){return _0x41f596[_0x90fd('0x59')](_0x161522[_0x90fd('0x36')][_0x90fd('0x5a')])[_0x90fd('0x26')](function(){if(_[_0x90fd('0x5b')](_0x161522[_0x90fd('0x36')][_0x90fd('0x5a')])){for(var _0x3d835e=0x0;_0x3d835e<_0x161522['query'][_0x90fd('0x5a')][_0x90fd('0x3c')];_0x3d835e+=0x1){socket[_0x90fd('0x5c')]('userSquareProject:remove',{'UserId':Number(_0x161522['query'][_0x90fd('0x5a')][_0x3d835e]),'SquareProjectId':Number(_0x161522[_0x90fd('0x4e')]['id'])});}}else{socket['emit'](_0x90fd('0x5d'),{'UserId':Number(_0x161522['query']['ids']),'SquareProjectId':Number(_0x161522[_0x90fd('0x4e')]['id'])});}});}})[_0x90fd('0x26')](respondWithStatusCode(_0x14fd9b,null))[_0x90fd('0x4c')](handleError(_0x14fd9b,null));};exports[_0x90fd('0x5e')]=function(_0x2e6e95,_0x44e599,_0x321cfb){var _0x337bf9={};var _0x55f94b={};var _0x32a456;var _0x278b0c;return db[_0x90fd('0x49')]['findOne']({'where':{'id':_0x2e6e95[_0x90fd('0x4e')]['id']}})[_0x90fd('0x26')](handleEntityNotFound(_0x44e599,null))['then'](function(_0x5cb475){if(_0x5cb475){_0x32a456=_0x5cb475;_0x55f94b[_0x90fd('0x34')]=_[_0x90fd('0x37')](db[_0x90fd('0x5f')]['rawAttributes']);_0x55f94b[_0x90fd('0x36')]=_['keys'](_0x2e6e95['query']);_0x55f94b[_0x90fd('0x38')]=_['intersection'](_0x55f94b[_0x90fd('0x34')],_0x55f94b[_0x90fd('0x36')]);_0x337bf9['attributes']=_[_0x90fd('0x39')](_0x55f94b[_0x90fd('0x34')],qs[_0x90fd('0x3b')](_0x2e6e95[_0x90fd('0x36')][_0x90fd('0x3b')]));_0x337bf9[_0x90fd('0x3a')]=_0x337bf9['attributes']['length']?_0x337bf9['attributes']:_0x55f94b['model'];_0x337bf9[_0x90fd('0x3f')]=qs[_0x90fd('0x40')](_0x2e6e95[_0x90fd('0x36')]['sort']);_0x337bf9[_0x90fd('0x41')]=qs[_0x90fd('0x38')](_['pick'](_0x2e6e95[_0x90fd('0x36')],_0x55f94b[_0x90fd('0x38')]));if(_0x2e6e95[_0x90fd('0x36')][_0x90fd('0x43')]){_0x337bf9['where']=_[_0x90fd('0x44')](_0x337bf9[_0x90fd('0x41')],{'$or':_['map'](_0x337bf9['attributes'],function(_0x517552){var _0x154292={};_0x154292[_0x517552]={'$like':'%'+_0x2e6e95['query']['filter']+'%'};return _0x154292;})});}_0x337bf9=_[_0x90fd('0x44')]({},_0x337bf9,_0x2e6e95['options']);return _0x32a456[_0x90fd('0x5e')](_0x337bf9);}})[_0x90fd('0x26')](function(_0x126a71){if(_0x126a71){_0x278b0c=_0x126a71[_0x90fd('0x3c')];if(!_0x2e6e95[_0x90fd('0x36')][_0x90fd('0x3d')]('nolimit')){_0x337bf9[_0x90fd('0x20')]=qs[_0x90fd('0x20')](_0x2e6e95[_0x90fd('0x36')]['limit']);_0x337bf9['offset']=qs[_0x90fd('0x1f')](_0x2e6e95[_0x90fd('0x36')][_0x90fd('0x1f')]);}return _0x32a456[_0x90fd('0x5e')](_0x337bf9);}})[_0x90fd('0x26')](function(_0x278bcf){if(_0x278bcf){return _0x278bcf?{'count':_0x278b0c,'rows':_0x278bcf}:null;}})[_0x90fd('0x26')](respondWithResult(_0x44e599,null))[_0x90fd('0x4c')](handleError(_0x44e599,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index b5dbdab..ad5dc49 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 _0xa03b=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','save','update'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0xa03b,0xad));var _0xba03=function(_0x5d225a,_0x2debe9){_0x5d225a=_0x5d225a-0x0;var _0x1e7761=_0xa03b[_0x5d225a];return _0x1e7761;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0xba03('0x0'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xba03('0x1'),'afterUpdate':_0xba03('0x2'),'afterDestroy':_0xba03('0x3')};function emitEvent(_0x4f155e){return function(_0x215692,_0x82ef51,_0x80f7e7){SquareProjectEvents[_0xba03('0x4')](_0x4f155e+':'+_0x215692['id'],_0x215692);SquareProjectEvents[_0xba03('0x4')](_0x4f155e,_0x215692);_0x80f7e7(null);};}for(var e in events){if(events[_0xba03('0x5')](e)){var event=events[e];SquareProject[_0xba03('0x6')](e,emitEvent(event));}}module[_0xba03('0x7')]=SquareProjectEvents; \ No newline at end of file +var _0x9b6d=['exports','../../mysqldb','SquareProject','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x28cd24,_0x490be5){var _0x2196be=function(_0x3bc3be){while(--_0x3bc3be){_0x28cd24['push'](_0x28cd24['shift']());}};_0x2196be(++_0x490be5);}(_0x9b6d,0x105));var _0xd9b6=function(_0x109a94,_0x27f502){_0x109a94=_0x109a94-0x0;var _0xec4106=_0x9b6d[_0x109a94];return _0xec4106;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0xd9b6('0x0'))['db'][_0xd9b6('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xd9b6('0x2')](0x0);var events={'afterCreate':_0xd9b6('0x3'),'afterUpdate':_0xd9b6('0x4'),'afterDestroy':_0xd9b6('0x5')};function emitEvent(_0x3ec1b7){return function(_0xbd3d3b,_0x3e9fde,_0x190ee4){SquareProjectEvents[_0xd9b6('0x6')](_0x3ec1b7+':'+_0xbd3d3b['id'],_0xbd3d3b);SquareProjectEvents['emit'](_0x3ec1b7,_0xbd3d3b);_0x190ee4(null);};}for(var e in events){if(events[_0xd9b6('0x7')](e)){var event=events[e];SquareProject[_0xd9b6('0x8')](e,emitEvent(event));}}module[_0xd9b6('0x9')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index ce9dae6..ed685a1 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 _0x1b2c=['moment','bluebird','request-promise','../../config/environment','exports','define','SquareProject','lodash','util','api'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0x1b2c,0x1a1));var _0xc1b2=function(_0x1715a2,_0x13d1d3){_0x1715a2=_0x1715a2-0x0;var _0x447fc1=_0x1b2c[_0x1715a2];return _0x447fc1;};'use strict';var _=require(_0xc1b2('0x0'));var util=require(_0xc1b2('0x1'));var logger=require('../../config/logger')(_0xc1b2('0x2'));var moment=require(_0xc1b2('0x3'));var BPromise=require(_0xc1b2('0x4'));var rp=require(_0xc1b2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc1b2('0x6'));var attributes=require('./squareProject.attributes');module[_0xc1b2('0x7')]=function(_0x3e7596,_0x49d756){return _0x3e7596[_0xc1b2('0x8')](_0xc1b2('0x9'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf63e=['./squareProject.attributes','define','SquareProject','square_projects','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x139751,_0x2f37dd){var _0x565c12=function(_0x2dc4eb){while(--_0x2dc4eb){_0x139751['push'](_0x139751['shift']());}};_0x565c12(++_0x2f37dd);}(_0xf63e,0xa0));var _0xef63=function(_0x4e11ee,_0x3ad816){_0x4e11ee=_0x4e11ee-0x0;var _0x1d3ca6=_0xf63e[_0x4e11ee];return _0x1d3ca6;};'use strict';var _=require(_0xef63('0x0'));var util=require(_0xef63('0x1'));var logger=require(_0xef63('0x2'))(_0xef63('0x3'));var moment=require(_0xef63('0x4'));var BPromise=require(_0xef63('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xef63('0x6'));var rimraf=require(_0xef63('0x7'));var config=require(_0xef63('0x8'));var attributes=require(_0xef63('0x9'));module['exports']=function(_0x3a873d,_0x11d647){return _0x3a873d[_0xef63('0xa')](_0xef63('0xb'),attributes,{'tableName':_0xef63('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 7439679..ede83ca 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 _0x07fa=['moment','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./squareProject.socket','register','then','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','options','raw','attributes','include','map','model','ShowSquareProject','catch','util'];(function(_0x1e79e4,_0x2d45c7){var _0x5bc539=function(_0x300e4f){while(--_0x300e4f){_0x1e79e4['push'](_0x1e79e4['shift']());}};_0x5bc539(++_0x2d45c7);}(_0x07fa,0x128));var _0xa07f=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x07fa[_0x5c2e3e];return _0x53f64a;};'use strict';var _=require('lodash');var util=require(_0xa07f('0x0'));var moment=require(_0xa07f('0x1'));var BPromise=require('bluebird');var rs=require(_0xa07f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa07f('0x3'));var logger=require('../../config/logger')(_0xa07f('0x4'));var config=require(_0xa07f('0x5'));var jayson=require(_0xa07f('0x6'));var client=jayson[_0xa07f('0x7')][_0xa07f('0x8')]({'port':0x232a});config[_0xa07f('0x9')]=_[_0xa07f('0xa')](config[_0xa07f('0x9')],{'host':_0xa07f('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa07f('0x9')]));require(_0xa07f('0xc'))[_0xa07f('0xd')](socket);function respondWithRpcPromise(_0x483b7e,_0x2ee886,_0x2a446a){return new BPromise(function(_0x1a7746,_0x3b9de5){return client['request'](_0x483b7e,_0x2a446a)[_0xa07f('0xe')](function(_0x468508){logger[_0xa07f('0xf')](_0xa07f('0x10'),_0x2ee886,_0xa07f('0x11'));logger[_0xa07f('0x12')](_0xa07f('0x13'),_0x2ee886,_0xa07f('0x11'),JSON[_0xa07f('0x14')](_0x468508));if(_0x468508[_0xa07f('0x15')]){if(_0x468508['error'][_0xa07f('0x16')]===0x1f4){logger[_0xa07f('0x15')](_0xa07f('0x10'),_0x2ee886,_0x468508[_0xa07f('0x15')]['message']);return _0x3b9de5(_0x468508['error'][_0xa07f('0x17')]);}logger[_0xa07f('0x15')](_0xa07f('0x10'),_0x2ee886,_0x468508[_0xa07f('0x15')]['message']);return _0x1a7746(_0x468508[_0xa07f('0x15')][_0xa07f('0x17')]);}else{logger[_0xa07f('0xf')](_0xa07f('0x10'),_0x2ee886,'request\x20sent');_0x1a7746(_0x468508[_0xa07f('0x18')][_0xa07f('0x17')]);}})['catch'](function(_0x172bc6){logger[_0xa07f('0x15')]('SquareProject,\x20%s,\x20%s',_0x2ee886,_0x172bc6);_0x3b9de5(_0x172bc6);});});}exports['ShowSquareProject']=function(_0x5c83d9){var _0x271c7b=this;return new Promise(function(_0x6aef,_0x49b692){return db['SquareProject']['find']({'raw':_0x5c83d9[_0xa07f('0x19')]?_0x5c83d9['options'][_0xa07f('0x1a')]===undefined?!![]:![]:!![],'where':_0x5c83d9[_0xa07f('0x19')]?_0x5c83d9['options']['where']||null:null,'attributes':_0x5c83d9[_0xa07f('0x19')]?_0x5c83d9['options'][_0xa07f('0x1b')]||null:null,'include':_0x5c83d9[_0xa07f('0x19')]?_0x5c83d9[_0xa07f('0x19')][_0xa07f('0x1c')]?_[_0xa07f('0x1d')](_0x5c83d9[_0xa07f('0x19')]['include'],function(_0x15a745){return{'model':db[_0x15a745[_0xa07f('0x1e')]],'as':_0x15a745['as'],'attributes':_0x15a745['attributes'],'include':_0x15a745[_0xa07f('0x1c')]?_[_0xa07f('0x1d')](_0x15a745[_0xa07f('0x1c')],function(_0x135cda){return{'model':db[_0x135cda[_0xa07f('0x1e')]],'as':_0x135cda['as'],'attributes':_0x135cda['attributes'],'include':_0x135cda[_0xa07f('0x1c')]?_[_0xa07f('0x1d')](_0x135cda[_0xa07f('0x1c')],function(_0x31ec17){return{'model':db[_0x31ec17[_0xa07f('0x1e')]],'as':_0x31ec17['as'],'attributes':_0x31ec17['attributes']};}):[]};}):[]};}):[]:[]})[_0xa07f('0xe')](function(_0x5e519a){logger[_0xa07f('0xf')](_0xa07f('0x1f'),_0x5c83d9);logger[_0xa07f('0x12')](_0xa07f('0x1f'),_0x5c83d9,JSON['stringify'](_0x5e519a));_0x6aef(_0x5e519a);})[_0xa07f('0x20')](function(_0x39355d){logger[_0xa07f('0x15')]('ShowSquareProject',_0x39355d[_0xa07f('0x17')],_0x5c83d9);_0x49b692(_0x271c7b['error'](0x1f4,_0x39355d[_0xa07f('0x17')]));});});}; \ No newline at end of file +var _0xfc06=['error','code','message','result','ShowSquareProject','SquareProject','find','options','where','attributes','include','model','map','then','catch','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x7a5efe,_0x27b521){var _0x1da481=function(_0x12edda){while(--_0x12edda){_0x7a5efe['push'](_0x7a5efe['shift']());}};_0x1da481(++_0x27b521);}(_0xfc06,0xe7));var _0x6fc0=function(_0x2bef37,_0x582efa){_0x2bef37=_0x2bef37-0x0;var _0x313936=_0xfc06[_0x2bef37];return _0x313936;};'use strict';var _=require('lodash');var util=require(_0x6fc0('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6fc0('0x1'));var fs=require('fs');var Redis=require(_0x6fc0('0x2'));var db=require(_0x6fc0('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x6fc0('0x4'))(_0x6fc0('0x5'));var config=require(_0x6fc0('0x6'));var jayson=require(_0x6fc0('0x7'));var client=jayson[_0x6fc0('0x8')][_0x6fc0('0x9')]({'port':0x232a});config[_0x6fc0('0xa')]=_[_0x6fc0('0xb')](config['redis'],{'host':_0x6fc0('0xc'),'port':0x18eb});var socket=require(_0x6fc0('0xd'))(new Redis(config[_0x6fc0('0xa')]));require(_0x6fc0('0xe'))[_0x6fc0('0xf')](socket);function respondWithRpcPromise(_0x46e094,_0x1450f4,_0x1c3db3){return new BPromise(function(_0x37b90b,_0xa5c15f){return client['request'](_0x46e094,_0x1c3db3)['then'](function(_0x387890){logger[_0x6fc0('0x10')](_0x6fc0('0x11'),_0x1450f4,_0x6fc0('0x12'));logger[_0x6fc0('0x13')]('SquareProject,\x20%s,\x20%s,\x20%s',_0x1450f4,_0x6fc0('0x12'),JSON[_0x6fc0('0x14')](_0x387890));if(_0x387890[_0x6fc0('0x15')]){if(_0x387890['error'][_0x6fc0('0x16')]===0x1f4){logger[_0x6fc0('0x15')](_0x6fc0('0x11'),_0x1450f4,_0x387890[_0x6fc0('0x15')][_0x6fc0('0x17')]);return _0xa5c15f(_0x387890['error'][_0x6fc0('0x17')]);}logger[_0x6fc0('0x15')](_0x6fc0('0x11'),_0x1450f4,_0x387890[_0x6fc0('0x15')][_0x6fc0('0x17')]);return _0x37b90b(_0x387890[_0x6fc0('0x15')]['message']);}else{logger[_0x6fc0('0x10')](_0x6fc0('0x11'),_0x1450f4,_0x6fc0('0x12'));_0x37b90b(_0x387890[_0x6fc0('0x18')][_0x6fc0('0x17')]);}})['catch'](function(_0x2263e9){logger[_0x6fc0('0x15')](_0x6fc0('0x11'),_0x1450f4,_0x2263e9);_0xa5c15f(_0x2263e9);});});}exports[_0x6fc0('0x19')]=function(_0x527c1c){var _0x2afdc3=this;return new Promise(function(_0x105489,_0x161ab4){return db[_0x6fc0('0x1a')][_0x6fc0('0x1b')]({'raw':_0x527c1c['options']?_0x527c1c['options']['raw']===undefined?!![]:![]:!![],'where':_0x527c1c[_0x6fc0('0x1c')]?_0x527c1c['options'][_0x6fc0('0x1d')]||null:null,'attributes':_0x527c1c[_0x6fc0('0x1c')]?_0x527c1c['options'][_0x6fc0('0x1e')]||null:null,'include':_0x527c1c['options']?_0x527c1c[_0x6fc0('0x1c')][_0x6fc0('0x1f')]?_['map'](_0x527c1c['options']['include'],function(_0x483a28){return{'model':db[_0x483a28[_0x6fc0('0x20')]],'as':_0x483a28['as'],'attributes':_0x483a28['attributes'],'include':_0x483a28[_0x6fc0('0x1f')]?_[_0x6fc0('0x21')](_0x483a28[_0x6fc0('0x1f')],function(_0x819c05){return{'model':db[_0x819c05[_0x6fc0('0x20')]],'as':_0x819c05['as'],'attributes':_0x819c05[_0x6fc0('0x1e')],'include':_0x819c05['include']?_[_0x6fc0('0x21')](_0x819c05[_0x6fc0('0x1f')],function(_0x573d0d){return{'model':db[_0x573d0d['model']],'as':_0x573d0d['as'],'attributes':_0x573d0d[_0x6fc0('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x6fc0('0x22')](function(_0x4e567f){logger[_0x6fc0('0x10')](_0x6fc0('0x19'),_0x527c1c);logger['debug'](_0x6fc0('0x19'),_0x527c1c,JSON[_0x6fc0('0x14')](_0x4e567f));_0x105489(_0x4e567f);})[_0x6fc0('0x23')](function(_0xb0a6d3){logger[_0x6fc0('0x15')]('ShowSquareProject',_0xb0a6d3[_0x6fc0('0x17')],_0x527c1c);_0x161ab4(_0x2afdc3['error'](0x1f4,_0xb0a6d3[_0x6fc0('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index ee33e28..fce2fa5 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 _0x6d38=['removeListener','length','squareProject:','save','remove','update'];(function(_0xb2c2b4,_0x4800b2){var _0x362374=function(_0x72ccae){while(--_0x72ccae){_0xb2c2b4['push'](_0xb2c2b4['shift']());}};_0x362374(++_0x4800b2);}(_0x6d38,0x1ef));var _0x86d3=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x6d38[_0x3e5086];return _0xfeb102;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x86d3('0x0'),_0x86d3('0x1'),_0x86d3('0x2')];function createListener(_0x52d138,_0x5c0b77){return function(_0xd1c7c){_0x5c0b77['emit'](_0x52d138,_0xd1c7c);};}function removeListener(_0xe9198a,_0x455b9d){return function(){SquareProjectEvents[_0x86d3('0x3')](_0xe9198a,_0x455b9d);};}exports['register']=function(_0x2d8272){for(var _0xfbbc15=0x0,_0x33d4aa=events[_0x86d3('0x4')];_0xfbbc15<_0x33d4aa;_0xfbbc15++){var _0x47e654=events[_0xfbbc15];var _0x552b07=createListener(_0x86d3('0x5')+_0x47e654,_0x2d8272);SquareProjectEvents['on'](_0x47e654,_0x552b07);}}; \ No newline at end of file +var _0xe2fe=['update','emit','register','length','./squareProject.events'];(function(_0x57e227,_0x351a09){var _0x581ccc=function(_0x1330f0){while(--_0x1330f0){_0x57e227['push'](_0x57e227['shift']());}};_0x581ccc(++_0x351a09);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var SquareProjectEvents=require(_0xee2f('0x0'));var events=['save','remove',_0xee2f('0x1')];function createListener(_0x5e18ae,_0x169cf9){return function(_0x1b6f4c){_0x169cf9[_0xee2f('0x2')](_0x5e18ae,_0x1b6f4c);};}function removeListener(_0x2d2b03,_0xcb45e6){return function(){SquareProjectEvents['removeListener'](_0x2d2b03,_0xcb45e6);};}exports[_0xee2f('0x3')]=function(_0x2b7e7c){for(var _0x49926b=0x0,_0x1533a0=events[_0xee2f('0x4')];_0x49926b<_0x1533a0;_0x49926b++){var _0x5a7975=events[_0x49926b];var _0x3c4095=createListener('squareProject:'+_0x5a7975,_0x2b7e7c);SquareProjectEvents['on'](_0x5a7975,_0x3c4095);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 778c2a9..9de0f62 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 _0x0b0e=['multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','index','/:id','/:id/download','download','create','delete','exports'];(function(_0x277f7d,_0x1c4b1f){var _0x29771a=function(_0x31bf10){while(--_0x31bf10){_0x277f7d['push'](_0x277f7d['shift']());}};_0x29771a(++_0x1c4b1f);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4a4922,_0x82cb8f){_0x4a4922=_0x4a4922-0x0;var _0x55a8c6=_0x0b0e[_0x4a4922];return _0x55a8c6;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var auth=require(_0xe0b0('0x4'));var interaction=require(_0xe0b0('0x5'));var config=require(_0xe0b0('0x6'));var controller=require(_0xe0b0('0x7'));router[_0xe0b0('0x8')]('/',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xa')]);router[_0xe0b0('0x8')](_0xe0b0('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xe0b0('0x8')](_0xe0b0('0xc'),auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xd')]);router['post']('/',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xe')]);router['put'](_0xe0b0('0xb'),auth[_0xe0b0('0x9')](),controller['update']);router[_0xe0b0('0xf')](_0xe0b0('0xb'),auth[_0xe0b0('0x9')](),controller['destroy']);module[_0xe0b0('0x10')]=router; \ No newline at end of file +var _0xdb28=['download','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','isAuthenticated','index','show','get','/:id/download'];(function(_0x1c0d3a,_0x5917c1){var _0x115215=function(_0x10688e){while(--_0x10688e){_0x1c0d3a['push'](_0x1c0d3a['shift']());}};_0x115215(++_0x5917c1);}(_0xdb28,0x106));var _0x8db2=function(_0x35616c,_0x3754f1){_0x35616c=_0x35616c-0x0;var _0x1db80a=_0xdb28[_0x35616c];return _0x1db80a;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var auth=require(_0x8db2('0x5'));var interaction=require(_0x8db2('0x6'));var config=require(_0x8db2('0x7'));var controller=require(_0x8db2('0x8'));router['get']('/',auth[_0x8db2('0x9')](),controller[_0x8db2('0xa')]);router['get']('/:id',auth[_0x8db2('0x9')](),controller[_0x8db2('0xb')]);router[_0x8db2('0xc')](_0x8db2('0xd'),auth[_0x8db2('0x9')](),controller[_0x8db2('0xe')]);router[_0x8db2('0xf')]('/',auth['isAuthenticated'](),controller[_0x8db2('0x10')]);router[_0x8db2('0x11')](_0x8db2('0x12'),auth['isAuthenticated'](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')]('/:id',auth[_0x8db2('0x9')](),controller[_0x8db2('0x15')]);module[_0x8db2('0x16')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 940ae65..304312e 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 _0x8a35=['sequelize','exports','STRING'];(function(_0x3ffbd3,_0x56970f){var _0x2f5f8c=function(_0x3c86be){while(--_0x3c86be){_0x3ffbd3['push'](_0x3ffbd3['shift']());}};_0x2f5f8c(++_0x56970f);}(_0x8a35,0xa8));var _0x58a3=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x8a35[_0x8c43de];return _0xa6591b;};'use strict';var Sequelize=require(_0x58a3('0x0'));module[_0x58a3('0x1')]={'uniqueid':{'type':Sequelize[_0x58a3('0x2')]},'callerid':{'type':Sequelize[_0x58a3('0x2')]},'calleridname':{'type':Sequelize[_0x58a3('0x2')]},'context':{'type':Sequelize[_0x58a3('0x2')]},'extension':{'type':Sequelize[_0x58a3('0x2')]},'priority':{'type':Sequelize[_0x58a3('0x2')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x58a3('0x2')]},'projectName':{'type':Sequelize[_0x58a3('0x2')]},'saveName':{'type':Sequelize[_0x58a3('0x2')]},'filename':{'type':Sequelize[_0x58a3('0x2')]},'savePath':{'type':Sequelize[_0x58a3('0x2')]}}; \ No newline at end of file +var _0x6e01=['STRING'];(function(_0x16b5a9,_0x5d9fa2){var _0x45e5ef=function(_0x3b4b9e){while(--_0x3b4b9e){_0x16b5a9['push'](_0x16b5a9['shift']());}};_0x45e5ef(++_0x5d9fa2);}(_0x6e01,0x135));var _0x16e0=function(_0x60df74,_0x458e29){_0x60df74=_0x60df74-0x0;var _0x5ee872=_0x6e01[_0x60df74];return _0x5ee872;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x16e0('0x0')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x16e0('0x0')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x16e0('0x0')]},'accountcode':{'type':Sequelize[_0x16e0('0x0')]},'dnid':{'type':Sequelize[_0x16e0('0x0')]},'projectName':{'type':Sequelize[_0x16e0('0x0')]},'saveName':{'type':Sequelize[_0x16e0('0x0')]},'filename':{'type':Sequelize[_0x16e0('0x0')]},'savePath':{'type':Sequelize[_0x16e0('0x0')]}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 964c1d3..ddaa861 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 _0xf603=['limit','set','Content-Range','json','reject','save','update','destroy','error','name','send','index','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','SquareRecording','then','include','rows','catch','show','params','keys','includeAll','create','body','find','download','../../components/encryptor','uniqueid','savePath','filename','format','decryptFile','secrets','existsSync','Sequelize','SquareRecording\x20not\x20found','extname','unlink','message','Not\x20found','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xf603,0xeb));var _0x3f60=function(_0x49b39d,_0x18cc9f){_0x49b39d=_0x49b39d-0x0;var _0x39a428=_0xf603[_0x49b39d];return _0x39a428;};'use strict';var pdf=require(_0x3f60('0x0'));var emlformat=require(_0x3f60('0x1'));var rimraf=require(_0x3f60('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3f60('0x3'));var rp=require(_0x3f60('0x4'));var moment=require(_0x3f60('0x5'));var BPromise=require(_0x3f60('0x6'));var Mustache=require(_0x3f60('0x7'));var util=require('util');var path=require(_0x3f60('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3f60('0x9'));var fs=require('fs');var _=require(_0x3f60('0xa'));var squel=require(_0x3f60('0xb'));var crypto=require(_0x3f60('0xc'));var jsforce=require(_0x3f60('0xd'));var deskjs=require(_0x3f60('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3f60('0xf'));var Papa=require(_0x3f60('0x10'));var Redis=require(_0x3f60('0x11'));var authService=require(_0x3f60('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3f60('0x13'));var logger=require(_0x3f60('0x14'))(_0x3f60('0x15'));var utils=require('../../config/utils');var config=require(_0x3f60('0x16'));var db=require(_0x3f60('0x17'))['db'];function respondWithStatusCode(_0xad12ff,_0x4aef12){_0x4aef12=_0x4aef12||0xcc;return function(_0x50f2ef){if(_0x50f2ef){return _0xad12ff[_0x3f60('0x18')](_0x4aef12);}return _0xad12ff[_0x3f60('0x19')](_0x4aef12)[_0x3f60('0x1a')]();};}function respondWithResult(_0x385250,_0x1c0dea){_0x1c0dea=_0x1c0dea||0xc8;return function(_0x17b9c8){if(_0x17b9c8){return _0x385250[_0x3f60('0x19')](_0x1c0dea)['json'](_0x17b9c8);}};}function respondWithFilteredResult(_0x4a46f1,_0x596e4d){return function(_0x959ab4){if(_0x959ab4){var _0xa06f96=_0x959ab4[_0x3f60('0x1b')],_0x3d79b7=_0x596e4d[_0x3f60('0x1c')],_0x23c96e=_0x596e4d[_0x3f60('0x1c')]+_0x596e4d[_0x3f60('0x1d')],_0x1de18b;if(_0x23c96e>=_0xa06f96){_0x23c96e=_0xa06f96;_0x1de18b=0xc8;}else{_0x1de18b=0xce;}_0x4a46f1['status'](_0x1de18b);return _0x4a46f1[_0x3f60('0x1e')](_0x3f60('0x1f'),_0x3d79b7+'-'+_0x23c96e+'/'+_0xa06f96)[_0x3f60('0x20')](_0x959ab4);}return null;};}function patchUpdates(_0xb7731f){return function(_0x531587){try{jsonpatch['apply'](_0x531587,_0xb7731f,!![]);}catch(_0x218159){return BPromise[_0x3f60('0x21')](_0x218159);}return _0x531587[_0x3f60('0x22')]();};}function saveUpdates(_0x1f0195,_0x4af884){return function(_0xed3b2b){if(_0xed3b2b){return _0xed3b2b[_0x3f60('0x23')](_0x1f0195)['then'](function(_0x5b08a3){return _0x5b08a3;});}return null;};}function removeEntity(_0x39d98d,_0x8d2dc9){return function(_0x13c089){if(_0x13c089){return _0x13c089[_0x3f60('0x24')]()['then'](function(){_0x39d98d[_0x3f60('0x19')](0xcc)[_0x3f60('0x1a')]();});}};}function handleEntityNotFound(_0x2a84ca,_0x107b1a){return function(_0x1d2660){if(!_0x1d2660){_0x2a84ca[_0x3f60('0x18')](0x194);}return _0x1d2660;};}function handleError(_0x450ef5,_0x42beb9){_0x42beb9=_0x42beb9||0x1f4;return function(_0x435637){logger[_0x3f60('0x25')](_0x435637['stack']);if(_0x435637[_0x3f60('0x26')]){delete _0x435637[_0x3f60('0x26')];}_0x450ef5[_0x3f60('0x19')](_0x42beb9)[_0x3f60('0x27')](_0x435637);};}exports[_0x3f60('0x28')]=function(_0x362801,_0x5cba29){var _0x20ec12={},_0x3eecfc={},_0x44ea75={'count':0x0,'rows':[]};var _0x4b1a97=_['map'](db['SquareRecording']['rawAttributes'],function(_0x19bd56){return{'name':_0x19bd56[_0x3f60('0x29')],'type':_0x19bd56[_0x3f60('0x2a')][_0x3f60('0x2b')]};});_0x3eecfc[_0x3f60('0x2c')]=_[_0x3f60('0x2d')](_0x4b1a97,'name');_0x3eecfc[_0x3f60('0x2e')]=_['keys'](_0x362801[_0x3f60('0x2e')]);_0x3eecfc[_0x3f60('0x2f')]=_[_0x3f60('0x30')](_0x3eecfc[_0x3f60('0x2c')],_0x3eecfc['query']);_0x20ec12[_0x3f60('0x31')]=_['intersection'](_0x3eecfc[_0x3f60('0x2c')],qs[_0x3f60('0x32')](_0x362801[_0x3f60('0x2e')][_0x3f60('0x32')]));_0x20ec12['attributes']=_0x20ec12['attributes'][_0x3f60('0x33')]?_0x20ec12[_0x3f60('0x31')]:_0x3eecfc[_0x3f60('0x2c')];if(!_0x362801[_0x3f60('0x2e')][_0x3f60('0x34')](_0x3f60('0x35'))){_0x20ec12[_0x3f60('0x1d')]=qs['limit'](_0x362801[_0x3f60('0x2e')]['limit']);_0x20ec12[_0x3f60('0x1c')]=qs['offset'](_0x362801['query'][_0x3f60('0x1c')]);}_0x20ec12['order']=qs[_0x3f60('0x36')](_0x362801[_0x3f60('0x2e')][_0x3f60('0x36')]);_0x20ec12[_0x3f60('0x37')]=qs[_0x3f60('0x2f')](_[_0x3f60('0x38')](_0x362801['query'],_0x3eecfc[_0x3f60('0x2f')]));if(_0x362801[_0x3f60('0x2e')][_0x3f60('0x39')]){_0x20ec12['where']=_[_0x3f60('0x3a')](_0x20ec12['where'],{'$or':_[_0x3f60('0x2d')](_0x4b1a97,function(_0x4174db){if(_0x4174db[_0x3f60('0x2a')]!==_0x3f60('0x3b')){var _0x28927e={};_0x28927e[_0x4174db[_0x3f60('0x26')]]={'$like':'%'+_0x362801['query']['filter']+'%'};return _0x28927e;}})});}_0x20ec12=_['merge']({},_0x20ec12,_0x362801[_0x3f60('0x3c')]);var _0x18465d={'where':_0x20ec12[_0x3f60('0x37')]};return db[_0x3f60('0x3d')][_0x3f60('0x1b')](_0x18465d)[_0x3f60('0x3e')](function(_0x7d7c46){_0x44ea75['count']=_0x7d7c46;if(_0x362801[_0x3f60('0x2e')]['includeAll']){_0x20ec12[_0x3f60('0x3f')]=[{'all':!![]}];}return db['SquareRecording']['findAll'](_0x20ec12);})[_0x3f60('0x3e')](function(_0x328a08){_0x44ea75[_0x3f60('0x40')]=_0x328a08;return _0x44ea75;})['then'](respondWithFilteredResult(_0x5cba29,_0x20ec12))[_0x3f60('0x41')](handleError(_0x5cba29,null));};exports[_0x3f60('0x42')]=function(_0x10bc5d,_0x319cf6){var _0x14e797={'raw':!![],'where':{'id':_0x10bc5d[_0x3f60('0x43')]['id']}},_0x4789fb={};_0x4789fb[_0x3f60('0x2c')]=_[_0x3f60('0x44')](db['SquareRecording']['rawAttributes']);_0x4789fb[_0x3f60('0x2e')]=_['keys'](_0x10bc5d['query']);_0x4789fb[_0x3f60('0x2f')]=_[_0x3f60('0x30')](_0x4789fb['model'],_0x4789fb[_0x3f60('0x2e')]);_0x14e797['attributes']=_['intersection'](_0x4789fb[_0x3f60('0x2c')],qs[_0x3f60('0x32')](_0x10bc5d[_0x3f60('0x2e')][_0x3f60('0x32')]));_0x14e797['attributes']=_0x14e797['attributes'][_0x3f60('0x33')]?_0x14e797[_0x3f60('0x31')]:_0x4789fb['model'];if(_0x10bc5d['query'][_0x3f60('0x45')]){_0x14e797[_0x3f60('0x3f')]=[{'all':!![]}];}_0x14e797=_[_0x3f60('0x3a')]({},_0x14e797,_0x10bc5d['options']);return db['SquareRecording']['find'](_0x14e797)['then'](handleEntityNotFound(_0x319cf6,null))[_0x3f60('0x3e')](respondWithResult(_0x319cf6,null))[_0x3f60('0x41')](handleError(_0x319cf6,null));};exports[_0x3f60('0x46')]=function(_0x496ca3,_0x4696ac){return db[_0x3f60('0x3d')][_0x3f60('0x46')](_0x496ca3['body'],{})[_0x3f60('0x3e')](respondWithResult(_0x4696ac,0xc9))['catch'](handleError(_0x4696ac,null));};exports[_0x3f60('0x23')]=function(_0x1ffe03,_0x384b8a){if(_0x1ffe03[_0x3f60('0x47')]['id']){delete _0x1ffe03[_0x3f60('0x47')]['id'];}return db[_0x3f60('0x3d')][_0x3f60('0x48')]({'where':{'id':_0x1ffe03[_0x3f60('0x43')]['id']}})[_0x3f60('0x3e')](handleEntityNotFound(_0x384b8a,null))['then'](saveUpdates(_0x1ffe03[_0x3f60('0x47')],null))['then'](respondWithResult(_0x384b8a,null))[_0x3f60('0x41')](handleError(_0x384b8a,null));};exports[_0x3f60('0x24')]=function(_0xf906f2,_0x81da){return db[_0x3f60('0x3d')][_0x3f60('0x48')]({'where':{'id':_0xf906f2['params']['id']}})[_0x3f60('0x3e')](handleEntityNotFound(_0x81da,null))['then'](removeEntity(_0x81da,null))[_0x3f60('0x41')](handleError(_0x81da,null));};exports[_0x3f60('0x49')]=function(_0x502c13,_0xf7ea5f,_0x4ba46e){var _0x5e6122=require(_0x3f60('0x4a'));var _0x4d5db3=![];var _0x2d7955={};if(_0x502c13['query'][_0x3f60('0x2a')]&&_0x502c13[_0x3f60('0x2e')][_0x3f60('0x2a')]===_0x3f60('0x4b')){_0x2d7955[_0x3f60('0x4b')]=_0x502c13[_0x3f60('0x43')]['id'];}else{_0x2d7955['id']=_0x502c13[_0x3f60('0x43')]['id'];}return db[_0x3f60('0x3d')]['find']({'where':_0x2d7955,'attributes':['id',_0x3f60('0x4c'),_0x3f60('0x4d')],'raw':!![]})[_0x3f60('0x3e')](handleEntityNotFound(_0xf7ea5f,null))['then'](function(_0x1ec20d){if(_0x1ec20d){var _0x50258b=_0x1ec20d['savePath'];var _0x491b5e=util[_0x3f60('0x4e')]('%s.cypher',_0x50258b);if(fs['existsSync'](_0x491b5e)){_0x4d5db3=!![];return _0x5e6122[_0x3f60('0x4f')](_0x491b5e,_0x50258b,config[_0x3f60('0x50')]['recording'])[_0x3f60('0x3e')](function(){return _0x1ec20d;});}return _0x1ec20d;}})[_0x3f60('0x3e')](function(_0x14dd3d){if(_0x14dd3d){var _0x4a01f7=_0x14dd3d[_0x3f60('0x4c')];if(!fs[_0x3f60('0x51')](_0x4a01f7)){throw new db[(_0x3f60('0x52'))]['ValidationError'](_0x3f60('0x53'));}if(_0x14dd3d[_0x3f60('0x4d')]){return _0xf7ea5f['download'](_0x4a01f7,_0x14dd3d['filename']+path[_0x3f60('0x54')](_0x4a01f7),function(){if(_0x4d5db3){fs[_0x3f60('0x55')](_0x4a01f7);}});}else{return _0xf7ea5f[_0x3f60('0x49')](_0x4a01f7,function(_0x88333a){if(_0x4d5db3){fs[_0x3f60('0x55')](_0x4a01f7);}});}}})['catch'](function(_0x4475a9){if(_0x4475a9[_0x3f60('0x56')]==='SquareRecording\x20not\x20found'){_0xf7ea5f[_0x3f60('0x19')](0x194)[_0x3f60('0x27')](_0x3f60('0x57'));}else{return handleError(_0xf7ea5f,null);}});}; \ No newline at end of file +var _0x6e1c=['html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','SquareRecording','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','merge','where','filter','options','includeAll','include','rows','catch','show','params','find','create','body','download','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','unlink','message','Not\x20found'];(function(_0x8e9794,_0xc5234f){var _0x591bb0=function(_0x50a8f6){while(--_0x50a8f6){_0x8e9794['push'](_0x8e9794['shift']());}};_0x591bb0(++_0xc5234f);}(_0x6e1c,0xb6));var _0xc6e1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6e1c[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0xc6e1('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc6e1('0x1'));var jsonpatch=require(_0xc6e1('0x2'));var rp=require(_0xc6e1('0x3'));var moment=require(_0xc6e1('0x4'));var BPromise=require(_0xc6e1('0x5'));var Mustache=require(_0xc6e1('0x6'));var util=require(_0xc6e1('0x7'));var path=require(_0xc6e1('0x8'));var sox=require(_0xc6e1('0x9'));var csv=require(_0xc6e1('0xa'));var ejs=require(_0xc6e1('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc6e1('0xc'));var crypto=require(_0xc6e1('0xd'));var jsforce=require(_0xc6e1('0xe'));var deskjs=require(_0xc6e1('0xf'));var toCsv=require(_0xc6e1('0xa'));var querystring=require('querystring');var Papa=require(_0xc6e1('0x10'));var Redis=require(_0xc6e1('0x11'));var authService=require(_0xc6e1('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc6e1('0x13'));var logger=require(_0xc6e1('0x14'))('api');var utils=require(_0xc6e1('0x15'));var config=require(_0xc6e1('0x16'));var db=require(_0xc6e1('0x17'))['db'];function respondWithStatusCode(_0x1c8aa7,_0x22b511){_0x22b511=_0x22b511||0xcc;return function(_0x3526e7){if(_0x3526e7){return _0x1c8aa7['sendStatus'](_0x22b511);}return _0x1c8aa7[_0xc6e1('0x18')](_0x22b511)[_0xc6e1('0x19')]();};}function respondWithResult(_0x355409,_0x2d554f){_0x2d554f=_0x2d554f||0xc8;return function(_0x3573dd){if(_0x3573dd){return _0x355409['status'](_0x2d554f)['json'](_0x3573dd);}};}function respondWithFilteredResult(_0x42e7a1,_0x30428e){return function(_0x5da248){if(_0x5da248){var _0x6a58af=_0x5da248[_0xc6e1('0x1a')],_0x580fae=_0x30428e[_0xc6e1('0x1b')],_0x353469=_0x30428e[_0xc6e1('0x1b')]+_0x30428e[_0xc6e1('0x1c')],_0x5645d3;if(_0x353469>=_0x6a58af){_0x353469=_0x6a58af;_0x5645d3=0xc8;}else{_0x5645d3=0xce;}_0x42e7a1['status'](_0x5645d3);return _0x42e7a1[_0xc6e1('0x1d')](_0xc6e1('0x1e'),_0x580fae+'-'+_0x353469+'/'+_0x6a58af)[_0xc6e1('0x1f')](_0x5da248);}return null;};}function patchUpdates(_0x11f476){return function(_0x302e56){try{jsonpatch[_0xc6e1('0x20')](_0x302e56,_0x11f476,!![]);}catch(_0x1e5d0c){return BPromise[_0xc6e1('0x21')](_0x1e5d0c);}return _0x302e56[_0xc6e1('0x22')]();};}function saveUpdates(_0x1046b9,_0x23369a){return function(_0x816a){if(_0x816a){return _0x816a[_0xc6e1('0x23')](_0x1046b9)[_0xc6e1('0x24')](function(_0x4cb1f9){return _0x4cb1f9;});}return null;};}function removeEntity(_0x7afa3a,_0x255ae1){return function(_0x1ed09e){if(_0x1ed09e){return _0x1ed09e[_0xc6e1('0x25')]()[_0xc6e1('0x24')](function(){_0x7afa3a[_0xc6e1('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x484d0c,_0x40b059){return function(_0x5597d3){if(!_0x5597d3){_0x484d0c[_0xc6e1('0x26')](0x194);}return _0x5597d3;};}function handleError(_0xcc509,_0x5421d1){_0x5421d1=_0x5421d1||0x1f4;return function(_0x4b044c){logger[_0xc6e1('0x27')](_0x4b044c[_0xc6e1('0x28')]);if(_0x4b044c['name']){delete _0x4b044c[_0xc6e1('0x29')];}_0xcc509[_0xc6e1('0x18')](_0x5421d1)[_0xc6e1('0x2a')](_0x4b044c);};}exports[_0xc6e1('0x2b')]=function(_0x3b6f10,_0x240801){var _0x26cec4={},_0x71fa6d={},_0x191520={'count':0x0,'rows':[]};var _0x511191=_[_0xc6e1('0x2c')](db[_0xc6e1('0x2d')][_0xc6e1('0x2e')],function(_0x5cefb6){return{'name':_0x5cefb6[_0xc6e1('0x2f')],'type':_0x5cefb6[_0xc6e1('0x30')][_0xc6e1('0x31')]};});_0x71fa6d[_0xc6e1('0x32')]=_[_0xc6e1('0x2c')](_0x511191,'name');_0x71fa6d[_0xc6e1('0x33')]=_[_0xc6e1('0x34')](_0x3b6f10['query']);_0x71fa6d[_0xc6e1('0x35')]=_[_0xc6e1('0x36')](_0x71fa6d[_0xc6e1('0x32')],_0x71fa6d[_0xc6e1('0x33')]);_0x26cec4[_0xc6e1('0x37')]=_[_0xc6e1('0x36')](_0x71fa6d[_0xc6e1('0x32')],qs[_0xc6e1('0x38')](_0x3b6f10['query'][_0xc6e1('0x38')]));_0x26cec4[_0xc6e1('0x37')]=_0x26cec4[_0xc6e1('0x37')][_0xc6e1('0x39')]?_0x26cec4[_0xc6e1('0x37')]:_0x71fa6d[_0xc6e1('0x32')];if(!_0x3b6f10['query']['hasOwnProperty'](_0xc6e1('0x3a'))){_0x26cec4[_0xc6e1('0x1c')]=qs[_0xc6e1('0x1c')](_0x3b6f10['query'][_0xc6e1('0x1c')]);_0x26cec4[_0xc6e1('0x1b')]=qs['offset'](_0x3b6f10[_0xc6e1('0x33')][_0xc6e1('0x1b')]);}_0x26cec4[_0xc6e1('0x3b')]=qs[_0xc6e1('0x3c')](_0x3b6f10['query'][_0xc6e1('0x3c')]);_0x26cec4['where']=qs[_0xc6e1('0x35')](_[_0xc6e1('0x3d')](_0x3b6f10[_0xc6e1('0x33')],_0x71fa6d[_0xc6e1('0x35')]));if(_0x3b6f10[_0xc6e1('0x33')]['filter']){_0x26cec4['where']=_[_0xc6e1('0x3e')](_0x26cec4[_0xc6e1('0x3f')],{'$or':_[_0xc6e1('0x2c')](_0x511191,function(_0x519097){if(_0x519097[_0xc6e1('0x30')]!=='VIRTUAL'){var _0x3135db={};_0x3135db[_0x519097[_0xc6e1('0x29')]]={'$like':'%'+_0x3b6f10[_0xc6e1('0x33')][_0xc6e1('0x40')]+'%'};return _0x3135db;}})});}_0x26cec4=_[_0xc6e1('0x3e')]({},_0x26cec4,_0x3b6f10[_0xc6e1('0x41')]);var _0x257526={'where':_0x26cec4[_0xc6e1('0x3f')]};return db['SquareRecording'][_0xc6e1('0x1a')](_0x257526)[_0xc6e1('0x24')](function(_0x14f0b2){_0x191520['count']=_0x14f0b2;if(_0x3b6f10['query'][_0xc6e1('0x42')]){_0x26cec4[_0xc6e1('0x43')]=[{'all':!![]}];}return db[_0xc6e1('0x2d')]['findAll'](_0x26cec4);})[_0xc6e1('0x24')](function(_0x470d2c){_0x191520[_0xc6e1('0x44')]=_0x470d2c;return _0x191520;})['then'](respondWithFilteredResult(_0x240801,_0x26cec4))[_0xc6e1('0x45')](handleError(_0x240801,null));};exports[_0xc6e1('0x46')]=function(_0x313674,_0x11be38){var _0x33e085={'raw':!![],'where':{'id':_0x313674[_0xc6e1('0x47')]['id']}},_0xe34556={};_0xe34556[_0xc6e1('0x32')]=_[_0xc6e1('0x34')](db[_0xc6e1('0x2d')][_0xc6e1('0x2e')]);_0xe34556[_0xc6e1('0x33')]=_[_0xc6e1('0x34')](_0x313674[_0xc6e1('0x33')]);_0xe34556[_0xc6e1('0x35')]=_['intersection'](_0xe34556[_0xc6e1('0x32')],_0xe34556[_0xc6e1('0x33')]);_0x33e085['attributes']=_[_0xc6e1('0x36')](_0xe34556[_0xc6e1('0x32')],qs[_0xc6e1('0x38')](_0x313674[_0xc6e1('0x33')][_0xc6e1('0x38')]));_0x33e085['attributes']=_0x33e085[_0xc6e1('0x37')][_0xc6e1('0x39')]?_0x33e085['attributes']:_0xe34556[_0xc6e1('0x32')];if(_0x313674[_0xc6e1('0x33')][_0xc6e1('0x42')]){_0x33e085[_0xc6e1('0x43')]=[{'all':!![]}];}_0x33e085=_['merge']({},_0x33e085,_0x313674[_0xc6e1('0x41')]);return db[_0xc6e1('0x2d')][_0xc6e1('0x48')](_0x33e085)[_0xc6e1('0x24')](handleEntityNotFound(_0x11be38,null))[_0xc6e1('0x24')](respondWithResult(_0x11be38,null))['catch'](handleError(_0x11be38,null));};exports[_0xc6e1('0x49')]=function(_0x572d6b,_0x3fa2e1){return db[_0xc6e1('0x2d')][_0xc6e1('0x49')](_0x572d6b[_0xc6e1('0x4a')],{})[_0xc6e1('0x24')](respondWithResult(_0x3fa2e1,0xc9))[_0xc6e1('0x45')](handleError(_0x3fa2e1,null));};exports['update']=function(_0x2ec072,_0x3d200e){if(_0x2ec072[_0xc6e1('0x4a')]['id']){delete _0x2ec072[_0xc6e1('0x4a')]['id'];}return db[_0xc6e1('0x2d')]['find']({'where':{'id':_0x2ec072[_0xc6e1('0x47')]['id']}})[_0xc6e1('0x24')](handleEntityNotFound(_0x3d200e,null))['then'](saveUpdates(_0x2ec072['body'],null))[_0xc6e1('0x24')](respondWithResult(_0x3d200e,null))[_0xc6e1('0x45')](handleError(_0x3d200e,null));};exports['destroy']=function(_0x580dac,_0x7768ec){return db[_0xc6e1('0x2d')][_0xc6e1('0x48')]({'where':{'id':_0x580dac[_0xc6e1('0x47')]['id']}})[_0xc6e1('0x24')](handleEntityNotFound(_0x7768ec,null))['then'](removeEntity(_0x7768ec,null))[_0xc6e1('0x45')](handleError(_0x7768ec,null));};exports[_0xc6e1('0x4b')]=function(_0xee6bfc,_0x21aff2,_0x10223a){var _0x2a07d0=require(_0xc6e1('0x4c'));var _0x4c409d=![];var _0x3c9589={};if(_0xee6bfc[_0xc6e1('0x33')]['type']&&_0xee6bfc[_0xc6e1('0x33')][_0xc6e1('0x30')]===_0xc6e1('0x4d')){_0x3c9589[_0xc6e1('0x4d')]=_0xee6bfc[_0xc6e1('0x47')]['id'];}else{_0x3c9589['id']=_0xee6bfc['params']['id'];}return db['SquareRecording'][_0xc6e1('0x48')]({'where':_0x3c9589,'attributes':['id',_0xc6e1('0x4e'),_0xc6e1('0x4f')],'raw':!![]})[_0xc6e1('0x24')](handleEntityNotFound(_0x21aff2,null))[_0xc6e1('0x24')](function(_0x1d54ea){if(_0x1d54ea){var _0x25fa2d=_0x1d54ea[_0xc6e1('0x4e')];var _0x13f49c=util[_0xc6e1('0x50')](_0xc6e1('0x51'),_0x25fa2d);if(fs[_0xc6e1('0x52')](_0x13f49c)){_0x4c409d=!![];return _0x2a07d0[_0xc6e1('0x53')](_0x13f49c,_0x25fa2d,config[_0xc6e1('0x54')][_0xc6e1('0x55')])[_0xc6e1('0x24')](function(){return _0x1d54ea;});}return _0x1d54ea;}})[_0xc6e1('0x24')](function(_0x2d194d){if(_0x2d194d){var _0x34f6ea=_0x2d194d[_0xc6e1('0x4e')];if(!fs[_0xc6e1('0x52')](_0x34f6ea)){throw new db[(_0xc6e1('0x56'))][(_0xc6e1('0x57'))]('SquareRecording\x20not\x20found');}if(_0x2d194d[_0xc6e1('0x4f')]){return _0x21aff2[_0xc6e1('0x4b')](_0x34f6ea,_0x2d194d[_0xc6e1('0x4f')]+path['extname'](_0x34f6ea),function(){if(_0x4c409d){fs[_0xc6e1('0x58')](_0x34f6ea);}});}else{return _0x21aff2[_0xc6e1('0x4b')](_0x34f6ea,function(_0x2978bd){if(_0x4c409d){fs[_0xc6e1('0x58')](_0x34f6ea);}});}}})[_0xc6e1('0x45')](function(_0x18da8b){if(_0x18da8b[_0xc6e1('0x59')]==='SquareRecording\x20not\x20found'){_0x21aff2[_0xc6e1('0x18')](0x194)[_0xc6e1('0x2a')](_0xc6e1('0x5a'));}else{return handleError(_0x21aff2,null);}});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 12bca60..98d0109 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 _0xdbc6=['path','rimraf','../../config/environment','exports','define','SquareRecording','square_recordings','../../config/logger','moment','bluebird','request-promise'];(function(_0x44b976,_0x1e4296){var _0x5a0f2e=function(_0x33c3af){while(--_0x33c3af){_0x44b976['push'](_0x44b976['shift']());}};_0x5a0f2e(++_0x1e4296);}(_0xdbc6,0x13b));var _0x6dbc=function(_0x214858,_0x18e8e8){_0x214858=_0x214858-0x0;var _0x243bea=_0xdbc6[_0x214858];return _0x243bea;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6dbc('0x0'))('api');var moment=require(_0x6dbc('0x1'));var BPromise=require(_0x6dbc('0x2'));var rp=require(_0x6dbc('0x3'));var fs=require('fs');var path=require(_0x6dbc('0x4'));var rimraf=require(_0x6dbc('0x5'));var config=require(_0x6dbc('0x6'));var attributes=require('./squareRecording.attributes');module[_0x6dbc('0x7')]=function(_0x434e1a,_0x5ebe85){return _0x434e1a[_0x6dbc('0x8')](_0x6dbc('0x9'),attributes,{'tableName':_0x6dbc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x351d=['../../config/environment','exports','SquareRecording','square_recordings','lodash','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x5772c5,_0xfcc1ed){var _0x4ee69c=function(_0x2a6432){while(--_0x2a6432){_0x5772c5['push'](_0x5772c5['shift']());}};_0x4ee69c(++_0xfcc1ed);}(_0x351d,0x90));var _0xd351=function(_0x2716f2,_0x4ebe52){_0x2716f2=_0x2716f2-0x0;var _0x11a871=_0x351d[_0x2716f2];return _0x11a871;};'use strict';var _=require(_0xd351('0x0'));var util=require('util');var logger=require(_0xd351('0x1'))(_0xd351('0x2'));var moment=require(_0xd351('0x3'));var BPromise=require('bluebird');var rp=require(_0xd351('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd351('0x5'));var config=require(_0xd351('0x6'));var attributes=require('./squareRecording.attributes');module[_0xd351('0x7')]=function(_0x45e9e5,_0x88bd2b){return _0x45e9e5['define'](_0xd351('0x8'),attributes,{'tableName':_0xd351('0x9'),'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 2ec109b..30bcaf3 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 _0xb165=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','SquareRecording,\x20%s,\x20%s','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','CreateSquareRecording','create','body','options','raw','then','catch','util','bluebird','ioredis'];(function(_0x425716,_0x3e9d1c){var _0x2d39af=function(_0x1febc1){while(--_0x1febc1){_0x425716['push'](_0x425716['shift']());}};_0x2d39af(++_0x3e9d1c);}(_0xb165,0x183));var _0x5b16=function(_0x5dc0de,_0x25bba4){_0x5dc0de=_0x5dc0de-0x0;var _0x54ba0e=_0xb165[_0x5dc0de];return _0x54ba0e;};'use strict';var _=require('lodash');var util=require(_0x5b16('0x0'));var moment=require('moment');var BPromise=require(_0x5b16('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5b16('0x2'));var db=require(_0x5b16('0x3'))['db'];var utils=require(_0x5b16('0x4'));var logger=require(_0x5b16('0x5'))('rpc');var config=require(_0x5b16('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x5b16('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x226b77,_0x5b1762,_0x3c643e){return new BPromise(function(_0x468fd1,_0x1bcbe8){return client[_0x5b16('0x8')](_0x226b77,_0x3c643e)['then'](function(_0x3e45c0){logger['info'](_0x5b16('0x9'),_0x5b1762,'request\x20sent');logger[_0x5b16('0xa')](_0x5b16('0xb'),_0x5b1762,'request\x20sent',JSON[_0x5b16('0xc')](_0x3e45c0));if(_0x3e45c0[_0x5b16('0xd')]){if(_0x3e45c0['error'][_0x5b16('0xe')]===0x1f4){logger['error'](_0x5b16('0x9'),_0x5b1762,_0x3e45c0[_0x5b16('0xd')][_0x5b16('0xf')]);return _0x1bcbe8(_0x3e45c0[_0x5b16('0xd')][_0x5b16('0xf')]);}logger[_0x5b16('0xd')](_0x5b16('0x9'),_0x5b1762,_0x3e45c0[_0x5b16('0xd')][_0x5b16('0xf')]);return _0x468fd1(_0x3e45c0['error']['message']);}else{logger[_0x5b16('0x10')]('SquareRecording,\x20%s,\x20%s',_0x5b1762,_0x5b16('0x11'));_0x468fd1(_0x3e45c0[_0x5b16('0x12')][_0x5b16('0xf')]);}})['catch'](function(_0x4ff7a5){logger['error'](_0x5b16('0x9'),_0x5b1762,_0x4ff7a5);_0x1bcbe8(_0x4ff7a5);});});}exports[_0x5b16('0x13')]=function(_0x2c4c64){var _0xc0fb96=this;return new Promise(function(_0x2f08b0,_0x5b57b3){return db['SquareRecording'][_0x5b16('0x14')](_0x2c4c64[_0x5b16('0x15')],{'raw':_0x2c4c64[_0x5b16('0x16')]?_0x2c4c64['options'][_0x5b16('0x17')]===undefined?!![]:![]:!![]})[_0x5b16('0x18')](function(_0x32492f){logger[_0x5b16('0x10')](_0x5b16('0x13'),_0x2c4c64);logger['debug'](_0x5b16('0x13'),_0x2c4c64,JSON[_0x5b16('0xc')](_0x32492f));_0x2f08b0(_0x32492f);})[_0x5b16('0x19')](function(_0x27774b){logger['error'](_0x5b16('0x13'),_0x27774b[_0x5b16('0xf')],_0x2c4c64);_0x5b57b3(_0xc0fb96[_0x5b16('0xd')](0x1f4,_0x27774b[_0x5b16('0xf')]));});});}; \ No newline at end of file +var _0x757e=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','CreateSquareRecording','SquareRecording','create','body','options','raw'];(function(_0x528b8a,_0x2cd83d){var _0x47d97e=function(_0x1d211c){while(--_0x1d211c){_0x528b8a['push'](_0x528b8a['shift']());}};_0x47d97e(++_0x2cd83d);}(_0x757e,0x174));var _0xe757=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x757e[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xe757('0x0'));var util=require(_0xe757('0x1'));var moment=require(_0xe757('0x2'));var BPromise=require(_0xe757('0x3'));var rs=require(_0xe757('0x4'));var fs=require('fs');var Redis=require(_0xe757('0x5'));var db=require(_0xe757('0x6'))['db'];var utils=require(_0xe757('0x7'));var logger=require(_0xe757('0x8'))(_0xe757('0x9'));var config=require(_0xe757('0xa'));var jayson=require(_0xe757('0xb'));var client=jayson[_0xe757('0xc')][_0xe757('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x7a82ba,_0xcc5307,_0x5b0801){return new BPromise(function(_0x3cc8cb,_0x13c774){return client[_0xe757('0xe')](_0x7a82ba,_0x5b0801)[_0xe757('0xf')](function(_0x8cfb8b){logger['info'](_0xe757('0x10'),_0xcc5307,_0xe757('0x11'));logger[_0xe757('0x12')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0xcc5307,'request\x20sent',JSON['stringify'](_0x8cfb8b));if(_0x8cfb8b['error']){if(_0x8cfb8b[_0xe757('0x13')][_0xe757('0x14')]===0x1f4){logger['error'](_0xe757('0x10'),_0xcc5307,_0x8cfb8b[_0xe757('0x13')][_0xe757('0x15')]);return _0x13c774(_0x8cfb8b[_0xe757('0x13')][_0xe757('0x15')]);}logger[_0xe757('0x13')](_0xe757('0x10'),_0xcc5307,_0x8cfb8b['error'][_0xe757('0x15')]);return _0x3cc8cb(_0x8cfb8b[_0xe757('0x13')][_0xe757('0x15')]);}else{logger[_0xe757('0x16')](_0xe757('0x10'),_0xcc5307,_0xe757('0x11'));_0x3cc8cb(_0x8cfb8b[_0xe757('0x17')]['message']);}})[_0xe757('0x18')](function(_0x11a203){logger['error'](_0xe757('0x10'),_0xcc5307,_0x11a203);_0x13c774(_0x11a203);});});}exports[_0xe757('0x19')]=function(_0x5605d1){var _0x2b448f=this;return new Promise(function(_0x1f62e7,_0x2ffe95){return db[_0xe757('0x1a')][_0xe757('0x1b')](_0x5605d1[_0xe757('0x1c')],{'raw':_0x5605d1[_0xe757('0x1d')]?_0x5605d1['options'][_0xe757('0x1e')]===undefined?!![]:![]:!![]})[_0xe757('0xf')](function(_0x283edc){logger[_0xe757('0x16')](_0xe757('0x19'),_0x5605d1);logger[_0xe757('0x12')]('CreateSquareRecording',_0x5605d1,JSON['stringify'](_0x283edc));_0x1f62e7(_0x283edc);})[_0xe757('0x18')](function(_0x4d76e7){logger[_0xe757('0x13')]('CreateSquareRecording',_0x4d76e7[_0xe757('0x15')],_0x5605d1);_0x2ffe95(_0x2b448f['error'](0x1f4,_0x4d76e7[_0xe757('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 370d774..ce2c76c 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 _0x65fb=['create','update','delete','destroy','exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','/:id','show'];(function(_0xeb0af8,_0x52e58d){var _0x391d80=function(_0xf24113){while(--_0xf24113){_0xeb0af8['push'](_0xeb0af8['shift']());}};_0x391d80(++_0x52e58d);}(_0x65fb,0x1c5));var _0xb65f=function(_0x256684,_0x529c1e){_0x256684=_0x256684-0x0;var _0x37a0c9=_0x65fb[_0x256684];return _0x37a0c9;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xb65f('0x0'));var express=require(_0xb65f('0x1'));var router=express[_0xb65f('0x2')]();var auth=require(_0xb65f('0x3'));var interaction=require(_0xb65f('0x4'));var config=require('../../config/environment');var controller=require('./squareReport.controller');router[_0xb65f('0x5')]('/',auth['isAuthenticated'](),controller[_0xb65f('0x6')]);router[_0xb65f('0x5')](_0xb65f('0x7'),auth[_0xb65f('0x8')](),controller['describe']);router[_0xb65f('0x5')](_0xb65f('0x9'),auth[_0xb65f('0x8')](),controller[_0xb65f('0xa')]);router['post']('/',auth[_0xb65f('0x8')](),controller[_0xb65f('0xb')]);router['put'](_0xb65f('0x9'),auth[_0xb65f('0x8')](),controller[_0xb65f('0xc')]);router[_0xb65f('0xd')](_0xb65f('0x9'),auth[_0xb65f('0x8')](),controller[_0xb65f('0xe')]);module[_0xb65f('0xf')]=router; \ No newline at end of file +var _0x6196=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','delete','destroy','exports'];(function(_0xebe6e2,_0x2f84d7){var _0x3e35cb=function(_0x420152){while(--_0x420152){_0xebe6e2['push'](_0xebe6e2['shift']());}};_0x3e35cb(++_0x2f84d7);}(_0x6196,0x150));var _0x6619=function(_0x2758cf,_0x567d6b){_0x2758cf=_0x2758cf-0x0;var _0x1bc3f5=_0x6196[_0x2758cf];return _0x1bc3f5;};'use strict';var multer=require(_0x6619('0x0'));var util=require(_0x6619('0x1'));var path=require(_0x6619('0x2'));var timeout=require(_0x6619('0x3'));var express=require(_0x6619('0x4'));var router=express[_0x6619('0x5')]();var auth=require(_0x6619('0x6'));var interaction=require(_0x6619('0x7'));var config=require(_0x6619('0x8'));var controller=require(_0x6619('0x9'));router[_0x6619('0xa')]('/',auth[_0x6619('0xb')](),controller[_0x6619('0xc')]);router[_0x6619('0xa')](_0x6619('0xd'),auth[_0x6619('0xb')](),controller[_0x6619('0xe')]);router[_0x6619('0xa')]('/:id',auth[_0x6619('0xb')](),controller[_0x6619('0xf')]);router[_0x6619('0x10')]('/',auth['isAuthenticated'](),controller[_0x6619('0x11')]);router[_0x6619('0x12')](_0x6619('0x13'),auth[_0x6619('0xb')](),controller[_0x6619('0x14')]);router[_0x6619('0x15')](_0x6619('0x13'),auth['isAuthenticated'](),controller[_0x6619('0x16')]);module[_0x6619('0x17')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 09f97c0..34c8d22 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 _0xfff3=['BOOLEAN','exports','STRING','DATE'];(function(_0x4d22cc,_0x3d70aa){var _0x30e510=function(_0x10b804){while(--_0x10b804){_0x4d22cc['push'](_0x4d22cc['shift']());}};_0x30e510(++_0x3d70aa);}(_0xfff3,0x1bd));var _0x3fff=function(_0x5d7598,_0x47c4cd){_0x5d7598=_0x5d7598-0x0;var _0x1f10eb=_0xfff3[_0x5d7598];return _0x1f10eb;};'use strict';var Sequelize=require('sequelize');module[_0x3fff('0x0')]={'network':{'type':Sequelize[_0x3fff('0x1')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x3fff('0x1')]},'channel':{'type':Sequelize[_0x3fff('0x1')]},'language':{'type':Sequelize[_0x3fff('0x1')]},'type':{'type':Sequelize[_0x3fff('0x1')]},'uniqueid':{'type':Sequelize[_0x3fff('0x1')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x3fff('0x1')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0x3fff('0x1')]},'callingani2':{'type':Sequelize[_0x3fff('0x1')]},'callington':{'type':Sequelize[_0x3fff('0x1')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x3fff('0x1')]},'rdnis':{'type':Sequelize[_0x3fff('0x1')]},'context':{'type':Sequelize[_0x3fff('0x1')]},'extension':{'type':Sequelize[_0x3fff('0x1')]},'priority':{'type':Sequelize[_0x3fff('0x1')]},'enhanced':{'type':Sequelize[_0x3fff('0x1')]},'accountcode':{'type':Sequelize[_0x3fff('0x1')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0x3fff('0x1')]},'joinAt':{'type':Sequelize[_0x3fff('0x2')]},'leaveAt':{'type':Sequelize[_0x3fff('0x2')]},'bot':{'type':Sequelize[_0x3fff('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x8f46=['DATE','BOOLEAN','sequelize','exports','STRING'];(function(_0x21fc48,_0x560138){var _0x1d803d=function(_0xa693f5){while(--_0xa693f5){_0x21fc48['push'](_0x21fc48['shift']());}};_0x1d803d(++_0x560138);}(_0x8f46,0xd4));var _0x68f4=function(_0x2e08ff,_0x544f39){_0x2e08ff=_0x2e08ff-0x0;var _0x33e273=_0x8f46[_0x2e08ff];return _0x33e273;};'use strict';var Sequelize=require(_0x68f4('0x0'));module[_0x68f4('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0x68f4('0x2')]},'request':{'type':Sequelize[_0x68f4('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x68f4('0x2')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x68f4('0x2')]},'calleridname':{'type':Sequelize[_0x68f4('0x2')]},'callingpres':{'type':Sequelize[_0x68f4('0x2')]},'callingani2':{'type':Sequelize[_0x68f4('0x2')]},'callington':{'type':Sequelize[_0x68f4('0x2')]},'callingtns':{'type':Sequelize[_0x68f4('0x2')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0x68f4('0x2')]},'context':{'type':Sequelize[_0x68f4('0x2')]},'extension':{'type':Sequelize[_0x68f4('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x68f4('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x68f4('0x2')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x68f4('0x3')]},'bot':{'type':Sequelize[_0x68f4('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 93480a4..88a8665 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 _0xf494=['pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','destroy','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','sendStatus','status','end','count','offset','limit','apply','reject','update','then','stack','name','send','index','map','SquareReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x26fc81,_0x57fc19){var _0x9feece=function(_0x4344c3){while(--_0x4344c3){_0x26fc81['push'](_0x26fc81['shift']());}};_0x9feece(++_0x57fc19);}(_0xf494,0x1c6));var _0x4f49=function(_0x2e23f7,_0x35f041){_0x2e23f7=_0x2e23f7-0x0;var _0x436114=_0xf494[_0x2e23f7];return _0x436114;};'use strict';var pdf=require(_0x4f49('0x0'));var emlformat=require(_0x4f49('0x1'));var rimraf=require(_0x4f49('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4f49('0x3'));var rp=require(_0x4f49('0x4'));var moment=require(_0x4f49('0x5'));var BPromise=require(_0x4f49('0x6'));var Mustache=require(_0x4f49('0x7'));var util=require(_0x4f49('0x8'));var path=require(_0x4f49('0x9'));var sox=require(_0x4f49('0xa'));var csv=require(_0x4f49('0xb'));var ejs=require(_0x4f49('0xc'));var fs=require('fs');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('0xb'));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 db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b9cd3,_0x12527d){_0x12527d=_0x12527d||0xcc;return function(_0x4bf89f){if(_0x4bf89f){return _0x4b9cd3[_0x4f49('0x18')](_0x12527d);}return _0x4b9cd3[_0x4f49('0x19')](_0x12527d)[_0x4f49('0x1a')]();};}function respondWithResult(_0x2efe49,_0x1a0f1e){_0x1a0f1e=_0x1a0f1e||0xc8;return function(_0x2f0131){if(_0x2f0131){return _0x2efe49[_0x4f49('0x19')](_0x1a0f1e)['json'](_0x2f0131);}};}function respondWithFilteredResult(_0x515ace,_0x1f2d0d){return function(_0x415e83){if(_0x415e83){var _0x5878f4=_0x415e83[_0x4f49('0x1b')],_0x5bdfaf=_0x1f2d0d['offset'],_0x2f0a0d=_0x1f2d0d[_0x4f49('0x1c')]+_0x1f2d0d[_0x4f49('0x1d')],_0x2ecaaa;if(_0x2f0a0d>=_0x5878f4){_0x2f0a0d=_0x5878f4;_0x2ecaaa=0xc8;}else{_0x2ecaaa=0xce;}_0x515ace[_0x4f49('0x19')](_0x2ecaaa);return _0x515ace['set']('Content-Range',_0x5bdfaf+'-'+_0x2f0a0d+'/'+_0x5878f4)['json'](_0x415e83);}return null;};}function patchUpdates(_0x47f1e8){return function(_0xb2081a){try{jsonpatch[_0x4f49('0x1e')](_0xb2081a,_0x47f1e8,!![]);}catch(_0x1c2d70){return BPromise[_0x4f49('0x1f')](_0x1c2d70);}return _0xb2081a['save']();};}function saveUpdates(_0x416893,_0x2aed27){return function(_0x197a49){if(_0x197a49){return _0x197a49[_0x4f49('0x20')](_0x416893)[_0x4f49('0x21')](function(_0x509f7c){return _0x509f7c;});}return null;};}function removeEntity(_0x3e7e28,_0x357446){return function(_0x3ae590){if(_0x3ae590){return _0x3ae590['destroy']()[_0x4f49('0x21')](function(){_0x3e7e28[_0x4f49('0x19')](0xcc)[_0x4f49('0x1a')]();});}};}function handleEntityNotFound(_0x43c458,_0x9d30aa){return function(_0x36187b){if(!_0x36187b){_0x43c458['sendStatus'](0x194);}return _0x36187b;};}function handleError(_0x4e9041,_0x3a947b){_0x3a947b=_0x3a947b||0x1f4;return function(_0x429de7){logger['error'](_0x429de7[_0x4f49('0x22')]);if(_0x429de7[_0x4f49('0x23')]){delete _0x429de7[_0x4f49('0x23')];}_0x4e9041['status'](_0x3a947b)[_0x4f49('0x24')](_0x429de7);};}exports[_0x4f49('0x25')]=function(_0x298785,_0x148153){var _0xfefbab={},_0x122404={},_0x4915af={'count':0x0,'rows':[]};var _0x50c571=_[_0x4f49('0x26')](db[_0x4f49('0x27')][_0x4f49('0x28')],function(_0x560050){return{'name':_0x560050[_0x4f49('0x29')],'type':_0x560050[_0x4f49('0x2a')][_0x4f49('0x2b')]};});_0x122404['model']=_['map'](_0x50c571,_0x4f49('0x23'));_0x122404[_0x4f49('0x2c')]=_[_0x4f49('0x2d')](_0x298785['query']);_0x122404[_0x4f49('0x2e')]=_[_0x4f49('0x2f')](_0x122404[_0x4f49('0x30')],_0x122404[_0x4f49('0x2c')]);_0xfefbab[_0x4f49('0x31')]=_[_0x4f49('0x2f')](_0x122404[_0x4f49('0x30')],qs[_0x4f49('0x32')](_0x298785[_0x4f49('0x2c')][_0x4f49('0x32')]));_0xfefbab[_0x4f49('0x31')]=_0xfefbab[_0x4f49('0x31')][_0x4f49('0x33')]?_0xfefbab[_0x4f49('0x31')]:_0x122404[_0x4f49('0x30')];if(!_0x298785[_0x4f49('0x2c')][_0x4f49('0x34')](_0x4f49('0x35'))){_0xfefbab[_0x4f49('0x1d')]=qs['limit'](_0x298785[_0x4f49('0x2c')][_0x4f49('0x1d')]);_0xfefbab[_0x4f49('0x1c')]=qs[_0x4f49('0x1c')](_0x298785[_0x4f49('0x2c')][_0x4f49('0x1c')]);}_0xfefbab[_0x4f49('0x36')]=qs[_0x4f49('0x37')](_0x298785[_0x4f49('0x2c')][_0x4f49('0x37')]);_0xfefbab[_0x4f49('0x38')]=qs[_0x4f49('0x2e')](_[_0x4f49('0x39')](_0x298785['query'],_0x122404[_0x4f49('0x2e')]));if(_0x298785[_0x4f49('0x2c')][_0x4f49('0x3a')]){_0xfefbab[_0x4f49('0x38')]=_[_0x4f49('0x3b')](_0xfefbab[_0x4f49('0x38')],{'$or':_[_0x4f49('0x26')](_0x50c571,function(_0x25fdf8){if(_0x25fdf8[_0x4f49('0x2a')]!==_0x4f49('0x3c')){var _0x173b6e={};_0x173b6e[_0x25fdf8[_0x4f49('0x23')]]={'$like':'%'+_0x298785[_0x4f49('0x2c')][_0x4f49('0x3a')]+'%'};return _0x173b6e;}})});}_0xfefbab=_['merge']({},_0xfefbab,_0x298785[_0x4f49('0x3d')]);var _0xb0e6c2={'where':_0xfefbab['where']};return db[_0x4f49('0x27')][_0x4f49('0x1b')](_0xb0e6c2)['then'](function(_0x29e762){_0x4915af[_0x4f49('0x1b')]=_0x29e762;if(_0x298785[_0x4f49('0x2c')][_0x4f49('0x3e')]){_0xfefbab[_0x4f49('0x3f')]=[{'all':!![]}];}return db[_0x4f49('0x27')][_0x4f49('0x40')](_0xfefbab);})['then'](function(_0x5e1461){_0x4915af['rows']=_0x5e1461;return _0x4915af;})[_0x4f49('0x21')](respondWithFilteredResult(_0x148153,_0xfefbab))[_0x4f49('0x41')](handleError(_0x148153,null));};exports[_0x4f49('0x42')]=function(_0x373f90,_0x1053b2){var _0x1ecf6c={'raw':!![],'where':{'id':_0x373f90[_0x4f49('0x43')]['id']}},_0x38aff8={};_0x38aff8[_0x4f49('0x30')]=_['keys'](db['SquareReport'][_0x4f49('0x28')]);_0x38aff8[_0x4f49('0x2c')]=_[_0x4f49('0x2d')](_0x373f90['query']);_0x38aff8[_0x4f49('0x2e')]=_['intersection'](_0x38aff8['model'],_0x38aff8[_0x4f49('0x2c')]);_0x1ecf6c[_0x4f49('0x31')]=_[_0x4f49('0x2f')](_0x38aff8['model'],qs[_0x4f49('0x32')](_0x373f90[_0x4f49('0x2c')]['fields']));_0x1ecf6c[_0x4f49('0x31')]=_0x1ecf6c['attributes'][_0x4f49('0x33')]?_0x1ecf6c[_0x4f49('0x31')]:_0x38aff8[_0x4f49('0x30')];if(_0x373f90['query'][_0x4f49('0x3e')]){_0x1ecf6c[_0x4f49('0x3f')]=[{'all':!![]}];}_0x1ecf6c=_[_0x4f49('0x3b')]({},_0x1ecf6c,_0x373f90[_0x4f49('0x3d')]);return db[_0x4f49('0x27')][_0x4f49('0x44')](_0x1ecf6c)[_0x4f49('0x21')](handleEntityNotFound(_0x1053b2,null))[_0x4f49('0x21')](respondWithResult(_0x1053b2,null))[_0x4f49('0x41')](handleError(_0x1053b2,null));};exports[_0x4f49('0x45')]=function(_0x4fe382,_0x26c222){return db[_0x4f49('0x27')]['create'](_0x4fe382[_0x4f49('0x46')],{})['then'](respondWithResult(_0x26c222,0xc9))[_0x4f49('0x41')](handleError(_0x26c222,null));};exports[_0x4f49('0x20')]=function(_0x2d3dcd,_0x300230){if(_0x2d3dcd['body']['id']){delete _0x2d3dcd[_0x4f49('0x46')]['id'];}return db[_0x4f49('0x27')][_0x4f49('0x44')]({'where':{'id':_0x2d3dcd[_0x4f49('0x43')]['id']}})[_0x4f49('0x21')](handleEntityNotFound(_0x300230,null))[_0x4f49('0x21')](saveUpdates(_0x2d3dcd[_0x4f49('0x46')],null))[_0x4f49('0x21')](respondWithResult(_0x300230,null))[_0x4f49('0x41')](handleError(_0x300230,null));};exports[_0x4f49('0x47')]=function(_0x1be59a,_0x4482f7){return db[_0x4f49('0x27')][_0x4f49('0x44')]({'where':{'id':_0x1be59a[_0x4f49('0x43')]['id']}})[_0x4f49('0x21')](handleEntityNotFound(_0x4482f7,null))['then'](removeEntity(_0x4482f7,null))['catch'](handleError(_0x4482f7,null));};exports[_0x4f49('0x48')]=function(_0x197670,_0x36bcc2){return db[_0x4f49('0x27')][_0x4f49('0x48')]()[_0x4f49('0x21')](respondWithResult(_0x36bcc2,null))[_0x4f49('0x41')](handleError(_0x36bcc2,null));}; \ No newline at end of file +var _0x7217=['type','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filters','filter','merge','options','includeAll','include','findAll','rows','catch','show','create','body','find','params','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','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','json','count','offset','status','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','SquareReport','rawAttributes','fieldName'];(function(_0x27eea9,_0x5d6c4d){var _0x389a9b=function(_0x1c4da4){while(--_0x1c4da4){_0x27eea9['push'](_0x27eea9['shift']());}};_0x389a9b(++_0x5d6c4d);}(_0x7217,0x19e));var _0x7721=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x7217[_0xc6be3a];return _0x56a310;};'use strict';var pdf=require(_0x7721('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7721('0x1'));var zipdir=require(_0x7721('0x2'));var jsonpatch=require(_0x7721('0x3'));var rp=require(_0x7721('0x4'));var moment=require(_0x7721('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7721('0x6'));var path=require(_0x7721('0x7'));var sox=require(_0x7721('0x8'));var csv=require(_0x7721('0x9'));var ejs=require(_0x7721('0xa'));var fs=require('fs');var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x9'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var db=require(_0x7721('0x1a'))['db'];function respondWithStatusCode(_0x27b36b,_0x55b4ca){_0x55b4ca=_0x55b4ca||0xcc;return function(_0x2911ec){if(_0x2911ec){return _0x27b36b[_0x7721('0x1b')](_0x55b4ca);}return _0x27b36b['status'](_0x55b4ca)[_0x7721('0x1c')]();};}function respondWithResult(_0x30da54,_0x3f01c5){_0x3f01c5=_0x3f01c5||0xc8;return function(_0x2e9752){if(_0x2e9752){return _0x30da54['status'](_0x3f01c5)[_0x7721('0x1d')](_0x2e9752);}};}function respondWithFilteredResult(_0x25b1c0,_0x534f1b){return function(_0x4e199a){if(_0x4e199a){var _0x4b183e=_0x4e199a[_0x7721('0x1e')],_0x5ed54=_0x534f1b['offset'],_0x25a628=_0x534f1b[_0x7721('0x1f')]+_0x534f1b['limit'],_0x3cc909;if(_0x25a628>=_0x4b183e){_0x25a628=_0x4b183e;_0x3cc909=0xc8;}else{_0x3cc909=0xce;}_0x25b1c0[_0x7721('0x20')](_0x3cc909);return _0x25b1c0['set'](_0x7721('0x21'),_0x5ed54+'-'+_0x25a628+'/'+_0x4b183e)[_0x7721('0x1d')](_0x4e199a);}return null;};}function patchUpdates(_0x3ab5a5){return function(_0x3e140d){try{jsonpatch[_0x7721('0x22')](_0x3e140d,_0x3ab5a5,!![]);}catch(_0x40af90){return BPromise[_0x7721('0x23')](_0x40af90);}return _0x3e140d[_0x7721('0x24')]();};}function saveUpdates(_0x3b29ac,_0xaeccc4){return function(_0x4ce1db){if(_0x4ce1db){return _0x4ce1db[_0x7721('0x25')](_0x3b29ac)[_0x7721('0x26')](function(_0x3a053f){return _0x3a053f;});}return null;};}function removeEntity(_0xd8ad3c,_0x57140c){return function(_0x28f5a6){if(_0x28f5a6){return _0x28f5a6['destroy']()[_0x7721('0x26')](function(){_0xd8ad3c[_0x7721('0x20')](0xcc)[_0x7721('0x1c')]();});}};}function handleEntityNotFound(_0x1caad8,_0x121cc4){return function(_0x395b15){if(!_0x395b15){_0x1caad8[_0x7721('0x1b')](0x194);}return _0x395b15;};}function handleError(_0x5b4d74,_0x216f20){_0x216f20=_0x216f20||0x1f4;return function(_0x1abedb){logger[_0x7721('0x27')](_0x1abedb[_0x7721('0x28')]);if(_0x1abedb[_0x7721('0x29')]){delete _0x1abedb[_0x7721('0x29')];}_0x5b4d74[_0x7721('0x20')](_0x216f20)[_0x7721('0x2a')](_0x1abedb);};}exports[_0x7721('0x2b')]=function(_0x52316e,_0x258ddf){var _0x5b0551={},_0x499b87={},_0x315202={'count':0x0,'rows':[]};var _0x343c19=_[_0x7721('0x2c')](db[_0x7721('0x2d')][_0x7721('0x2e')],function(_0x37b9f0){return{'name':_0x37b9f0[_0x7721('0x2f')],'type':_0x37b9f0[_0x7721('0x30')]['key']};});_0x499b87[_0x7721('0x31')]=_[_0x7721('0x2c')](_0x343c19,'name');_0x499b87['query']=_[_0x7721('0x32')](_0x52316e[_0x7721('0x33')]);_0x499b87['filters']=_[_0x7721('0x34')](_0x499b87[_0x7721('0x31')],_0x499b87[_0x7721('0x33')]);_0x5b0551['attributes']=_[_0x7721('0x34')](_0x499b87[_0x7721('0x31')],qs[_0x7721('0x35')](_0x52316e[_0x7721('0x33')][_0x7721('0x35')]));_0x5b0551['attributes']=_0x5b0551[_0x7721('0x36')][_0x7721('0x37')]?_0x5b0551[_0x7721('0x36')]:_0x499b87['model'];if(!_0x52316e[_0x7721('0x33')][_0x7721('0x38')]('nolimit')){_0x5b0551[_0x7721('0x39')]=qs['limit'](_0x52316e[_0x7721('0x33')][_0x7721('0x39')]);_0x5b0551[_0x7721('0x1f')]=qs[_0x7721('0x1f')](_0x52316e[_0x7721('0x33')][_0x7721('0x1f')]);}_0x5b0551[_0x7721('0x3a')]=qs[_0x7721('0x3b')](_0x52316e[_0x7721('0x33')][_0x7721('0x3b')]);_0x5b0551[_0x7721('0x3c')]=qs['filters'](_[_0x7721('0x3d')](_0x52316e['query'],_0x499b87[_0x7721('0x3e')]));if(_0x52316e[_0x7721('0x33')][_0x7721('0x3f')]){_0x5b0551[_0x7721('0x3c')]=_[_0x7721('0x40')](_0x5b0551[_0x7721('0x3c')],{'$or':_['map'](_0x343c19,function(_0x557c34){if(_0x557c34['type']!=='VIRTUAL'){var _0x18001c={};_0x18001c[_0x557c34[_0x7721('0x29')]]={'$like':'%'+_0x52316e[_0x7721('0x33')][_0x7721('0x3f')]+'%'};return _0x18001c;}})});}_0x5b0551=_['merge']({},_0x5b0551,_0x52316e[_0x7721('0x41')]);var _0x4cf659={'where':_0x5b0551[_0x7721('0x3c')]};return db[_0x7721('0x2d')]['count'](_0x4cf659)[_0x7721('0x26')](function(_0x3a47c8){_0x315202['count']=_0x3a47c8;if(_0x52316e['query'][_0x7721('0x42')]){_0x5b0551[_0x7721('0x43')]=[{'all':!![]}];}return db[_0x7721('0x2d')][_0x7721('0x44')](_0x5b0551);})['then'](function(_0x2db173){_0x315202[_0x7721('0x45')]=_0x2db173;return _0x315202;})[_0x7721('0x26')](respondWithFilteredResult(_0x258ddf,_0x5b0551))[_0x7721('0x46')](handleError(_0x258ddf,null));};exports[_0x7721('0x47')]=function(_0x52ab67,_0x490d4){var _0x4a2c28={'raw':!![],'where':{'id':_0x52ab67['params']['id']}},_0xaa3216={};_0xaa3216[_0x7721('0x31')]=_[_0x7721('0x32')](db[_0x7721('0x2d')]['rawAttributes']);_0xaa3216[_0x7721('0x33')]=_[_0x7721('0x32')](_0x52ab67[_0x7721('0x33')]);_0xaa3216['filters']=_[_0x7721('0x34')](_0xaa3216[_0x7721('0x31')],_0xaa3216[_0x7721('0x33')]);_0x4a2c28[_0x7721('0x36')]=_[_0x7721('0x34')](_0xaa3216[_0x7721('0x31')],qs[_0x7721('0x35')](_0x52ab67['query']['fields']));_0x4a2c28[_0x7721('0x36')]=_0x4a2c28[_0x7721('0x36')][_0x7721('0x37')]?_0x4a2c28[_0x7721('0x36')]:_0xaa3216[_0x7721('0x31')];if(_0x52ab67[_0x7721('0x33')][_0x7721('0x42')]){_0x4a2c28[_0x7721('0x43')]=[{'all':!![]}];}_0x4a2c28=_[_0x7721('0x40')]({},_0x4a2c28,_0x52ab67[_0x7721('0x41')]);return db['SquareReport']['find'](_0x4a2c28)[_0x7721('0x26')](handleEntityNotFound(_0x490d4,null))[_0x7721('0x26')](respondWithResult(_0x490d4,null))[_0x7721('0x46')](handleError(_0x490d4,null));};exports[_0x7721('0x48')]=function(_0x589e95,_0x30107e){return db[_0x7721('0x2d')]['create'](_0x589e95[_0x7721('0x49')],{})['then'](respondWithResult(_0x30107e,0xc9))[_0x7721('0x46')](handleError(_0x30107e,null));};exports['update']=function(_0x334f23,_0x196be4){if(_0x334f23[_0x7721('0x49')]['id']){delete _0x334f23['body']['id'];}return db[_0x7721('0x2d')][_0x7721('0x4a')]({'where':{'id':_0x334f23['params']['id']}})[_0x7721('0x26')](handleEntityNotFound(_0x196be4,null))[_0x7721('0x26')](saveUpdates(_0x334f23[_0x7721('0x49')],null))['then'](respondWithResult(_0x196be4,null))[_0x7721('0x46')](handleError(_0x196be4,null));};exports['destroy']=function(_0xdb1ca8,_0x310549){return db[_0x7721('0x2d')][_0x7721('0x4a')]({'where':{'id':_0xdb1ca8[_0x7721('0x4b')]['id']}})[_0x7721('0x26')](handleEntityNotFound(_0x310549,null))[_0x7721('0x26')](removeEntity(_0x310549,null))[_0x7721('0x46')](handleError(_0x310549,null));};exports[_0x7721('0x4c')]=function(_0x3386aa,_0x31770e){return db[_0x7721('0x2d')][_0x7721('0x4c')]()[_0x7721('0x26')](respondWithResult(_0x31770e,null))[_0x7721('0x46')](handleError(_0x31770e,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 07ec9fa..6513ab8 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 _0x2e1a=['util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','define','SquareReport','report_square','project_name'];(function(_0x55ffef,_0xb94090){var _0x5a5111=function(_0x4695ca){while(--_0x4695ca){_0x55ffef['push'](_0x55ffef['shift']());}};_0x5a5111(++_0xb94090);}(_0x2e1a,0x174));var _0xa2e1=function(_0xac0de1,_0x12d3d9){_0xac0de1=_0xac0de1-0x0;var _0x1c1995=_0x2e1a[_0xac0de1];return _0x1c1995;};'use strict';var _=require('lodash');var util=require(_0xa2e1('0x0'));var logger=require(_0xa2e1('0x1'))('api');var moment=require('moment');var BPromise=require(_0xa2e1('0x2'));var rp=require(_0xa2e1('0x3'));var fs=require('fs');var path=require(_0xa2e1('0x4'));var rimraf=require(_0xa2e1('0x5'));var config=require(_0xa2e1('0x6'));var attributes=require(_0xa2e1('0x7'));module['exports']=function(_0x5799eb,_0x26ae01){return _0x5799eb[_0xa2e1('0x8')](_0xa2e1('0x9'),attributes,{'tableName':_0xa2e1('0xa'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':['uniqueid',_0xa2e1('0xb')]},{'name':'leaveAt','fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file +var _0x1854=['leaveAt','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SquareReport','report_square','uniqueid','project_name'];(function(_0x4eec9b,_0x4aea09){var _0x2e3849=function(_0x24c06d){while(--_0x24c06d){_0x4eec9b['push'](_0x4eec9b['shift']());}};_0x2e3849(++_0x4aea09);}(_0x1854,0xe1));var _0x4185=function(_0x4c2c23,_0x3d8d28){_0x4c2c23=_0x4c2c23-0x0;var _0x5c992e=_0x1854[_0x4c2c23];return _0x5c992e;};'use strict';var _=require(_0x4185('0x0'));var util=require(_0x4185('0x1'));var logger=require(_0x4185('0x2'))('api');var moment=require(_0x4185('0x3'));var BPromise=require(_0x4185('0x4'));var rp=require(_0x4185('0x5'));var fs=require('fs');var path=require(_0x4185('0x6'));var rimraf=require(_0x4185('0x7'));var config=require(_0x4185('0x8'));var attributes=require('./squareReport.attributes');module[_0x4185('0x9')]=function(_0x4ca831,_0x24c982){return _0x4ca831[_0x4185('0xa')](_0x4185('0xb'),attributes,{'tableName':_0x4185('0xc'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0x4185('0xd'),_0x4185('0xe')]},{'name':_0x4185('0xf'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index e375a0d..5c1df53 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 _0x1365=['create','body','options','raw','debug','UpdateSquareReport','update','where','attributes','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareReport','SquareReport'];(function(_0x54d6c0,_0x2cbe66){var _0x285655=function(_0x18894b){while(--_0x18894b){_0x54d6c0['push'](_0x54d6c0['shift']());}};_0x285655(++_0x2cbe66);}(_0x1365,0x14d));var _0x5136=function(_0x3132d4,_0x28b999){_0x3132d4=_0x3132d4-0x0;var _0x3f5ef3=_0x1365[_0x3132d4];return _0x3f5ef3;};'use strict';var _=require(_0x5136('0x0'));var util=require('util');var moment=require(_0x5136('0x1'));var BPromise=require(_0x5136('0x2'));var rs=require(_0x5136('0x3'));var fs=require('fs');var Redis=require(_0x5136('0x4'));var db=require(_0x5136('0x5'))['db'];var utils=require(_0x5136('0x6'));var logger=require(_0x5136('0x7'))(_0x5136('0x8'));var config=require(_0x5136('0x9'));var jayson=require(_0x5136('0xa'));var client=jayson[_0x5136('0xb')][_0x5136('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x44480b,_0x282417,_0xaa2eee){return new BPromise(function(_0x271352,_0xb41aed){return client[_0x5136('0xd')](_0x44480b,_0xaa2eee)[_0x5136('0xe')](function(_0x454f9f){logger[_0x5136('0xf')](_0x5136('0x10'),_0x282417,_0x5136('0x11'));logger['debug'](_0x5136('0x12'),_0x282417,'request\x20sent',JSON[_0x5136('0x13')](_0x454f9f));if(_0x454f9f[_0x5136('0x14')]){if(_0x454f9f['error'][_0x5136('0x15')]===0x1f4){logger[_0x5136('0x14')](_0x5136('0x10'),_0x282417,_0x454f9f['error'][_0x5136('0x16')]);return _0xb41aed(_0x454f9f[_0x5136('0x14')][_0x5136('0x16')]);}logger[_0x5136('0x14')](_0x5136('0x10'),_0x282417,_0x454f9f[_0x5136('0x14')][_0x5136('0x16')]);return _0x271352(_0x454f9f[_0x5136('0x14')]['message']);}else{logger[_0x5136('0xf')](_0x5136('0x10'),_0x282417,'request\x20sent');_0x271352(_0x454f9f[_0x5136('0x17')]['message']);}})[_0x5136('0x18')](function(_0x2cc234){logger[_0x5136('0x14')](_0x5136('0x10'),_0x282417,_0x2cc234);_0xb41aed(_0x2cc234);});});}exports[_0x5136('0x19')]=function(_0x45df40){var _0x3eaab2=this;return new Promise(function(_0x20d13b,_0x343e55){return db[_0x5136('0x1a')][_0x5136('0x1b')](_0x45df40[_0x5136('0x1c')],{'raw':_0x45df40[_0x5136('0x1d')]?_0x45df40[_0x5136('0x1d')][_0x5136('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x3df97c){logger[_0x5136('0xf')](_0x5136('0x19'),_0x45df40);logger[_0x5136('0x1f')](_0x5136('0x19'),_0x45df40,JSON['stringify'](_0x3df97c));_0x20d13b(_0x3df97c);})[_0x5136('0x18')](function(_0x58cdd0){logger[_0x5136('0x14')](_0x5136('0x19'),_0x58cdd0['message'],_0x45df40);_0x343e55(_0x3eaab2[_0x5136('0x14')](0x1f4,_0x58cdd0[_0x5136('0x16')]));});});};exports[_0x5136('0x20')]=function(_0x57f956){var _0x55fd8f=this;return new Promise(function(_0x2ee44c,_0x10f758){return db[_0x5136('0x1a')][_0x5136('0x21')](_0x57f956[_0x5136('0x1c')],{'raw':_0x57f956['options']?_0x57f956['options'][_0x5136('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57f956[_0x5136('0x1d')]?_0x57f956[_0x5136('0x1d')][_0x5136('0x22')]||null:null,'attributes':_0x57f956['options']?_0x57f956[_0x5136('0x1d')][_0x5136('0x23')]||null:null,'limit':_0x57f956[_0x5136('0x1d')]?_0x57f956['options']['limit']||null:null})[_0x5136('0xe')](function(_0x3b9500){logger[_0x5136('0xf')]('UpdateSquareReport',_0x57f956);logger[_0x5136('0x1f')](_0x5136('0x20'),_0x57f956,JSON['stringify'](_0x3b9500));_0x2ee44c(_0x3b9500);})[_0x5136('0x18')](function(_0x30c8d6){logger[_0x5136('0x14')](_0x5136('0x20'),_0x30c8d6['message'],_0x57f956);_0x10f758(_0x55fd8f[_0x5136('0x14')](0x1f4,_0x30c8d6[_0x5136('0x16')]));});});}; \ No newline at end of file +var _0x6eeb=['request','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','code','error','message','catch','create','body','options','then','CreateSquareReport','stringify','UpdateSquareReport','update','raw','where','attributes','limit','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/environment','http'];(function(_0x2ee429,_0x5b289a){var _0x34587f=function(_0x865e76){while(--_0x865e76){_0x2ee429['push'](_0x2ee429['shift']());}};_0x34587f(++_0x5b289a);}(_0x6eeb,0x85));var _0xb6ee=function(_0x35e768,_0xbe0d60){_0x35e768=_0x35e768-0x0;var _0x58cc5f=_0x6eeb[_0x35e768];return _0x58cc5f;};'use strict';var _=require(_0xb6ee('0x0'));var util=require(_0xb6ee('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb6ee('0x2'));var db=require(_0xb6ee('0x3'))['db'];var utils=require(_0xb6ee('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xb6ee('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb6ee('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x8c3a8c,_0x191c6d,_0xdba94c){return new BPromise(function(_0x36c9e3,_0x28d9c8){return client[_0xb6ee('0x7')](_0x8c3a8c,_0xdba94c)['then'](function(_0xd6ce5f){logger[_0xb6ee('0x8')](_0xb6ee('0x9'),_0x191c6d,_0xb6ee('0xa'));logger[_0xb6ee('0xb')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x191c6d,_0xb6ee('0xa'),JSON['stringify'](_0xd6ce5f));if(_0xd6ce5f['error']){if(_0xd6ce5f['error'][_0xb6ee('0xc')]===0x1f4){logger[_0xb6ee('0xd')](_0xb6ee('0x9'),_0x191c6d,_0xd6ce5f[_0xb6ee('0xd')][_0xb6ee('0xe')]);return _0x28d9c8(_0xd6ce5f[_0xb6ee('0xd')][_0xb6ee('0xe')]);}logger['error'](_0xb6ee('0x9'),_0x191c6d,_0xd6ce5f[_0xb6ee('0xd')][_0xb6ee('0xe')]);return _0x36c9e3(_0xd6ce5f[_0xb6ee('0xd')]['message']);}else{logger[_0xb6ee('0x8')](_0xb6ee('0x9'),_0x191c6d,_0xb6ee('0xa'));_0x36c9e3(_0xd6ce5f['result'][_0xb6ee('0xe')]);}})[_0xb6ee('0xf')](function(_0x112fcc){logger[_0xb6ee('0xd')](_0xb6ee('0x9'),_0x191c6d,_0x112fcc);_0x28d9c8(_0x112fcc);});});}exports['CreateSquareReport']=function(_0xc4aa6){var _0x396d93=this;return new Promise(function(_0x424a49,_0x45bbc6){return db['SquareReport'][_0xb6ee('0x10')](_0xc4aa6[_0xb6ee('0x11')],{'raw':_0xc4aa6[_0xb6ee('0x12')]?_0xc4aa6[_0xb6ee('0x12')]['raw']===undefined?!![]:![]:!![]})[_0xb6ee('0x13')](function(_0x485820){logger[_0xb6ee('0x8')](_0xb6ee('0x14'),_0xc4aa6);logger[_0xb6ee('0xb')](_0xb6ee('0x14'),_0xc4aa6,JSON[_0xb6ee('0x15')](_0x485820));_0x424a49(_0x485820);})[_0xb6ee('0xf')](function(_0xa228c4){logger['error'](_0xb6ee('0x14'),_0xa228c4['message'],_0xc4aa6);_0x45bbc6(_0x396d93['error'](0x1f4,_0xa228c4[_0xb6ee('0xe')]));});});};exports[_0xb6ee('0x16')]=function(_0x191615){var _0x7f4330=this;return new Promise(function(_0x28e21f,_0x2061a9){return db['SquareReport'][_0xb6ee('0x17')](_0x191615[_0xb6ee('0x11')],{'raw':_0x191615[_0xb6ee('0x12')]?_0x191615[_0xb6ee('0x12')][_0xb6ee('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x191615['options']?_0x191615[_0xb6ee('0x12')][_0xb6ee('0x19')]||null:null,'attributes':_0x191615['options']?_0x191615['options'][_0xb6ee('0x1a')]||null:null,'limit':_0x191615[_0xb6ee('0x12')]?_0x191615[_0xb6ee('0x12')][_0xb6ee('0x1b')]||null:null})[_0xb6ee('0x13')](function(_0x97f442){logger[_0xb6ee('0x8')](_0xb6ee('0x16'),_0x191615);logger[_0xb6ee('0xb')](_0xb6ee('0x16'),_0x191615,JSON[_0xb6ee('0x15')](_0x97f442));_0x28e21f(_0x97f442);})[_0xb6ee('0xf')](function(_0x2f555f){logger[_0xb6ee('0xd')]('UpdateSquareReport',_0x2f555f[_0xb6ee('0xe')],_0x191615);_0x2061a9(_0x7f4330['error'](0x1f4,_0x2f555f[_0xb6ee('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 4696816..ccddc3b 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 _0x7a54=['describe','/:id','create','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated'];(function(_0x51760f,_0x16f2e7){var _0x846c42=function(_0x1744f8){while(--_0x1744f8){_0x51760f['push'](_0x51760f['shift']());}};_0x846c42(++_0x16f2e7);}(_0x7a54,0x106));var _0x47a5=function(_0x29c8a9,_0x2e62d6){_0x29c8a9=_0x29c8a9-0x0;var _0xbc96a=_0x7a54[_0x29c8a9];return _0xbc96a;};'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 auth=require('../../components/auth/service');var interaction=require(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var controller=require(_0x47a5('0x7'));router[_0x47a5('0x8')]('/',auth[_0x47a5('0x9')](),controller['index']);router[_0x47a5('0x8')]('/describe',auth[_0x47a5('0x9')](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x47a5('0x9')](),controller[_0x47a5('0xc')]);router['put'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x47a5('0xd')](_0x47a5('0xb'),auth[_0x47a5('0x9')](),controller[_0x47a5('0xe')]);module[_0x47a5('0xf')]=router; \ No newline at end of file +var _0x7a54=['describe','/:id','create','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated'];(function(_0x4493ae,_0xf4e5c6){var _0x2da25d=function(_0x3501e4){while(--_0x3501e4){_0x4493ae['push'](_0x4493ae['shift']());}};_0x2da25d(++_0xf4e5c6);}(_0x7a54,0x106));var _0x47a5=function(_0x38671b,_0x11300a){_0x38671b=_0x38671b-0x0;var _0x32e720=_0x7a54[_0x38671b];return _0x32e720;};'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 auth=require('../../components/auth/service');var interaction=require(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var controller=require(_0x47a5('0x7'));router[_0x47a5('0x8')]('/',auth[_0x47a5('0x9')](),controller['index']);router[_0x47a5('0x8')]('/describe',auth[_0x47a5('0x9')](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x47a5('0x9')](),controller[_0x47a5('0xc')]);router['put'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x47a5('0xd')](_0x47a5('0xb'),auth[_0x47a5('0x9')](),controller[_0x47a5('0xe')]);module[_0x47a5('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 a9ef928..e1df632 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 _0x19ee=['STRING','sequelize','exports'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x19ee,0x1bd));var _0xe19e=function(_0x3b8f2e,_0x5a99a8){_0x3b8f2e=_0x3b8f2e-0x0;var _0x1433d5=_0x19ee[_0x3b8f2e];return _0x1433d5;};'use strict';var Sequelize=require(_0xe19e('0x0'));module[_0xe19e('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0xe19e('0x2')]},'application':{'type':Sequelize[_0xe19e('0x2')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0xe19e('0x2')]},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2d1c=['sequelize','exports','STRING','TEXT'];(function(_0x45cf76,_0x5789fa){var _0x57d6ce=function(_0x21bbf5){while(--_0x21bbf5){_0x45cf76['push'](_0x45cf76['shift']());}};_0x57d6ce(++_0x5789fa);}(_0x2d1c,0x164));var _0xc2d1=function(_0xe7119b,_0x5037fc){_0xe7119b=_0xe7119b-0x0;var _0x1f4b60=_0x2d1c[_0xe7119b];return _0x1f4b60;};'use strict';var Sequelize=require(_0xc2d1('0x0'));module[_0xc2d1('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0xc2d1('0x2')]},'application':{'type':Sequelize[_0xc2d1('0x2')]},'data':{'type':Sequelize[_0xc2d1('0x3')]},'project_name':{'type':Sequelize[_0xc2d1('0x2')]},'callerid':{'type':Sequelize[_0xc2d1('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 88a566b..615785d 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 _0xe92d=['find','create','body','catch','update','params','describe','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','set','Content-Range','reject','save','then','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','SquareDetailsReport','includeAll','rows','length','include'];(function(_0x42cd08,_0x2467dd){var _0x2ed9a7=function(_0x2ed233){while(--_0x2ed233){_0x42cd08['push'](_0x42cd08['shift']());}};_0x2ed9a7(++_0x2467dd);}(_0xe92d,0x12f));var _0xde92=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xe92d[_0x1facfa];return _0x9ec701;};'use strict';var pdf=require(_0xde92('0x0'));var emlformat=require(_0xde92('0x1'));var rimraf=require(_0xde92('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xde92('0x3'));var moment=require(_0xde92('0x4'));var BPromise=require(_0xde92('0x5'));var Mustache=require(_0xde92('0x6'));var util=require(_0xde92('0x7'));var path=require(_0xde92('0x8'));var sox=require('sox');var csv=require(_0xde92('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xde92('0xa'));var squel=require('squel');var crypto=require(_0xde92('0xb'));var jsforce=require(_0xde92('0xc'));var deskjs=require(_0xde92('0xd'));var toCsv=require(_0xde92('0x9'));var querystring=require(_0xde92('0xe'));var Papa=require(_0xde92('0xf'));var Redis=require(_0xde92('0x10'));var authService=require(_0xde92('0x11'));var qs=require(_0xde92('0x12'));var as=require(_0xde92('0x13'));var hardwareService=require(_0xde92('0x14'));var logger=require(_0xde92('0x15'))(_0xde92('0x16'));var utils=require(_0xde92('0x17'));var config=require(_0xde92('0x18'));var db=require(_0xde92('0x19'))['db'];function respondWithStatusCode(_0x1d5103,_0x5a9088){_0x5a9088=_0x5a9088||0xcc;return function(_0x5c81e7){if(_0x5c81e7){return _0x1d5103['sendStatus'](_0x5a9088);}return _0x1d5103['status'](_0x5a9088)['end']();};}function respondWithResult(_0xa50227,_0x107f89){_0x107f89=_0x107f89||0xc8;return function(_0x1ce04c){if(_0x1ce04c){return _0xa50227[_0xde92('0x1a')](_0x107f89)[_0xde92('0x1b')](_0x1ce04c);}};}function respondWithFilteredResult(_0x2a425b,_0x4afbbd){return function(_0x27ef4c){if(_0x27ef4c){var _0x6bfb49=_0x27ef4c[_0xde92('0x1c')],_0x538adc=_0x4afbbd['offset'],_0x58a12e=_0x4afbbd[_0xde92('0x1d')]+_0x4afbbd[_0xde92('0x1e')],_0x17a2d6;if(_0x58a12e>=_0x6bfb49){_0x58a12e=_0x6bfb49;_0x17a2d6=0xc8;}else{_0x17a2d6=0xce;}_0x2a425b['status'](_0x17a2d6);return _0x2a425b[_0xde92('0x1f')](_0xde92('0x20'),_0x538adc+'-'+_0x58a12e+'/'+_0x6bfb49)[_0xde92('0x1b')](_0x27ef4c);}return null;};}function patchUpdates(_0x338c43){return function(_0xf749cb){try{jsonpatch['apply'](_0xf749cb,_0x338c43,!![]);}catch(_0x1b7234){return BPromise[_0xde92('0x21')](_0x1b7234);}return _0xf749cb[_0xde92('0x22')]();};}function saveUpdates(_0x290423,_0x18aa97){return function(_0x1c5a15){if(_0x1c5a15){return _0x1c5a15['update'](_0x290423)[_0xde92('0x23')](function(_0x3d7149){return _0x3d7149;});}return null;};}function removeEntity(_0x220941,_0x1491e7){return function(_0x2d1aa8){if(_0x2d1aa8){return _0x2d1aa8[_0xde92('0x24')]()[_0xde92('0x23')](function(){_0x220941[_0xde92('0x1a')](0xcc)[_0xde92('0x25')]();});}};}function handleEntityNotFound(_0x549c7d,_0x10512b){return function(_0xbeb12b){if(!_0xbeb12b){_0x549c7d['sendStatus'](0x194);}return _0xbeb12b;};}function handleError(_0x4e7397,_0x4f90f2){_0x4f90f2=_0x4f90f2||0x1f4;return function(_0x13d6fe){logger['error'](_0x13d6fe[_0xde92('0x26')]);if(_0x13d6fe[_0xde92('0x27')]){delete _0x13d6fe[_0xde92('0x27')];}_0x4e7397[_0xde92('0x1a')](_0x4f90f2)[_0xde92('0x28')](_0x13d6fe);};}exports[_0xde92('0x29')]=function(_0x38fb0e,_0x468e19){var _0x44812a={},_0xaeb6b={},_0x4f8326={'count':0x0,'rows':[]};var _0x307da4=_[_0xde92('0x2a')](db['SquareDetailsReport'][_0xde92('0x2b')],function(_0x2ab992){return{'name':_0x2ab992[_0xde92('0x2c')],'type':_0x2ab992[_0xde92('0x2d')][_0xde92('0x2e')]};});_0xaeb6b[_0xde92('0x2f')]=_[_0xde92('0x2a')](_0x307da4,'name');_0xaeb6b[_0xde92('0x30')]=_[_0xde92('0x31')](_0x38fb0e['query']);_0xaeb6b['filters']=_['intersection'](_0xaeb6b[_0xde92('0x2f')],_0xaeb6b[_0xde92('0x30')]);_0x44812a['attributes']=_[_0xde92('0x32')](_0xaeb6b[_0xde92('0x2f')],qs[_0xde92('0x33')](_0x38fb0e[_0xde92('0x30')]['fields']));_0x44812a['attributes']=_0x44812a[_0xde92('0x34')]['length']?_0x44812a[_0xde92('0x34')]:_0xaeb6b[_0xde92('0x2f')];if(!_0x38fb0e['query'][_0xde92('0x35')](_0xde92('0x36'))){_0x44812a[_0xde92('0x1e')]=qs[_0xde92('0x1e')](_0x38fb0e[_0xde92('0x30')]['limit']);_0x44812a[_0xde92('0x1d')]=qs[_0xde92('0x1d')](_0x38fb0e['query'][_0xde92('0x1d')]);}_0x44812a[_0xde92('0x37')]=qs[_0xde92('0x38')](_0x38fb0e[_0xde92('0x30')]['sort']);_0x44812a[_0xde92('0x39')]=qs['filters'](_['pick'](_0x38fb0e[_0xde92('0x30')],_0xaeb6b[_0xde92('0x3a')]));if(_0x38fb0e[_0xde92('0x30')][_0xde92('0x3b')]){_0x44812a[_0xde92('0x39')]=_[_0xde92('0x3c')](_0x44812a[_0xde92('0x39')],{'$or':_[_0xde92('0x2a')](_0x307da4,function(_0x47a7d5){if(_0x47a7d5['type']!=='VIRTUAL'){var _0x5d8e52={};_0x5d8e52[_0x47a7d5[_0xde92('0x27')]]={'$like':'%'+_0x38fb0e[_0xde92('0x30')][_0xde92('0x3b')]+'%'};return _0x5d8e52;}})});}_0x44812a=_[_0xde92('0x3c')]({},_0x44812a,_0x38fb0e[_0xde92('0x3d')]);var _0x1cf947={'where':_0x44812a[_0xde92('0x39')]};return db[_0xde92('0x3e')]['count'](_0x1cf947)[_0xde92('0x23')](function(_0x22ccdb){_0x4f8326['count']=_0x22ccdb;if(_0x38fb0e[_0xde92('0x30')][_0xde92('0x3f')]){_0x44812a['include']=[{'all':!![]}];}return db[_0xde92('0x3e')]['findAll'](_0x44812a);})[_0xde92('0x23')](function(_0x24bd68){_0x4f8326[_0xde92('0x40')]=_0x24bd68;return _0x4f8326;})['then'](respondWithFilteredResult(_0x468e19,_0x44812a))['catch'](handleError(_0x468e19,null));};exports['show']=function(_0x229fe3,_0x255507){var _0x50c8fa={'raw':!![],'where':{'id':_0x229fe3['params']['id']}},_0x1536ff={};_0x1536ff[_0xde92('0x2f')]=_[_0xde92('0x31')](db[_0xde92('0x3e')][_0xde92('0x2b')]);_0x1536ff[_0xde92('0x30')]=_[_0xde92('0x31')](_0x229fe3['query']);_0x1536ff[_0xde92('0x3a')]=_[_0xde92('0x32')](_0x1536ff[_0xde92('0x2f')],_0x1536ff[_0xde92('0x30')]);_0x50c8fa[_0xde92('0x34')]=_[_0xde92('0x32')](_0x1536ff[_0xde92('0x2f')],qs['fields'](_0x229fe3[_0xde92('0x30')][_0xde92('0x33')]));_0x50c8fa[_0xde92('0x34')]=_0x50c8fa[_0xde92('0x34')][_0xde92('0x41')]?_0x50c8fa[_0xde92('0x34')]:_0x1536ff[_0xde92('0x2f')];if(_0x229fe3['query'][_0xde92('0x3f')]){_0x50c8fa[_0xde92('0x42')]=[{'all':!![]}];}_0x50c8fa=_[_0xde92('0x3c')]({},_0x50c8fa,_0x229fe3[_0xde92('0x3d')]);return db[_0xde92('0x3e')][_0xde92('0x43')](_0x50c8fa)[_0xde92('0x23')](handleEntityNotFound(_0x255507,null))[_0xde92('0x23')](respondWithResult(_0x255507,null))['catch'](handleError(_0x255507,null));};exports[_0xde92('0x44')]=function(_0x211d33,_0x10b23a){return db['SquareDetailsReport'][_0xde92('0x44')](_0x211d33[_0xde92('0x45')],{})[_0xde92('0x23')](respondWithResult(_0x10b23a,0xc9))[_0xde92('0x46')](handleError(_0x10b23a,null));};exports[_0xde92('0x47')]=function(_0x50b002,_0xbfbfe3){if(_0x50b002['body']['id']){delete _0x50b002[_0xde92('0x45')]['id'];}return db['SquareDetailsReport'][_0xde92('0x43')]({'where':{'id':_0x50b002[_0xde92('0x48')]['id']}})[_0xde92('0x23')](handleEntityNotFound(_0xbfbfe3,null))[_0xde92('0x23')](saveUpdates(_0x50b002[_0xde92('0x45')],null))[_0xde92('0x23')](respondWithResult(_0xbfbfe3,null))[_0xde92('0x46')](handleError(_0xbfbfe3,null));};exports[_0xde92('0x24')]=function(_0x1c4834,_0x59d3ab){return db[_0xde92('0x3e')]['find']({'where':{'id':_0x1c4834[_0xde92('0x48')]['id']}})['then'](handleEntityNotFound(_0x59d3ab,null))['then'](removeEntity(_0x59d3ab,null))['catch'](handleError(_0x59d3ab,null));};exports[_0xde92('0x49')]=function(_0x598ef6,_0x31fef2){return db[_0xde92('0x3e')]['describe']()['then'](respondWithResult(_0x31fef2,null))[_0xde92('0x46')](handleError(_0x31fef2,null));}; \ No newline at end of file +var _0xf805=['body','destroy','describe','html-pdf','rimraf','zip-dir','request-promise','moment','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/utils','status','count','offset','json','apply','save','update','then','end','error','stack','name','send','index','SquareDetailsReport','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','map','VIRTUAL','filter','merge','options','findAll','rows','catch','show','params','rawAttributes','include','find'];(function(_0x420f2a,_0x2cc58d){var _0x28f802=function(_0x3329cc){while(--_0x3329cc){_0x420f2a['push'](_0x420f2a['shift']());}};_0x28f802(++_0x2cc58d);}(_0xf805,0x1ad));var _0x5f80=function(_0x22bfde,_0x4fd781){_0x22bfde=_0x22bfde-0x0;var _0x213491=_0xf805[_0x22bfde];return _0x213491;};'use strict';var pdf=require(_0x5f80('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5f80('0x1'));var zipdir=require(_0x5f80('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5f80('0x3'));var moment=require(_0x5f80('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5f80('0x5'));var util=require(_0x5f80('0x6'));var path=require(_0x5f80('0x7'));var sox=require(_0x5f80('0x8'));var csv=require(_0x5f80('0x9'));var ejs=require(_0x5f80('0xa'));var fs=require('fs');var _=require(_0x5f80('0xb'));var squel=require(_0x5f80('0xc'));var crypto=require(_0x5f80('0xd'));var jsforce=require(_0x5f80('0xe'));var deskjs=require(_0x5f80('0xf'));var toCsv=require(_0x5f80('0x9'));var querystring=require(_0x5f80('0x10'));var Papa=require('papaparse');var Redis=require(_0x5f80('0x11'));var authService=require(_0x5f80('0x12'));var qs=require(_0x5f80('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5f80('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x5f80('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x514474,_0x1cd5b4){_0x1cd5b4=_0x1cd5b4||0xcc;return function(_0x341d16){if(_0x341d16){return _0x514474['sendStatus'](_0x1cd5b4);}return _0x514474[_0x5f80('0x16')](_0x1cd5b4)['end']();};}function respondWithResult(_0x2159e6,_0x2017d0){_0x2017d0=_0x2017d0||0xc8;return function(_0xe51b17){if(_0xe51b17){return _0x2159e6['status'](_0x2017d0)['json'](_0xe51b17);}};}function respondWithFilteredResult(_0x1e59c3,_0x23c2b2){return function(_0xb394cb){if(_0xb394cb){var _0x374222=_0xb394cb[_0x5f80('0x17')],_0x4d380f=_0x23c2b2[_0x5f80('0x18')],_0x4da3a8=_0x23c2b2['offset']+_0x23c2b2['limit'],_0x4210ba;if(_0x4da3a8>=_0x374222){_0x4da3a8=_0x374222;_0x4210ba=0xc8;}else{_0x4210ba=0xce;}_0x1e59c3[_0x5f80('0x16')](_0x4210ba);return _0x1e59c3['set']('Content-Range',_0x4d380f+'-'+_0x4da3a8+'/'+_0x374222)[_0x5f80('0x19')](_0xb394cb);}return null;};}function patchUpdates(_0x18bf63){return function(_0x1ee984){try{jsonpatch[_0x5f80('0x1a')](_0x1ee984,_0x18bf63,!![]);}catch(_0x44221d){return BPromise['reject'](_0x44221d);}return _0x1ee984[_0x5f80('0x1b')]();};}function saveUpdates(_0x4206af,_0xfc0cb){return function(_0x53525b){if(_0x53525b){return _0x53525b[_0x5f80('0x1c')](_0x4206af)[_0x5f80('0x1d')](function(_0x38d7d7){return _0x38d7d7;});}return null;};}function removeEntity(_0x34223b,_0x5afc3a){return function(_0x29c496){if(_0x29c496){return _0x29c496['destroy']()[_0x5f80('0x1d')](function(){_0x34223b[_0x5f80('0x16')](0xcc)[_0x5f80('0x1e')]();});}};}function handleEntityNotFound(_0x2a1425,_0x15ba8e){return function(_0x2a3691){if(!_0x2a3691){_0x2a1425['sendStatus'](0x194);}return _0x2a3691;};}function handleError(_0x3808c8,_0x796538){_0x796538=_0x796538||0x1f4;return function(_0x7eb622){logger[_0x5f80('0x1f')](_0x7eb622[_0x5f80('0x20')]);if(_0x7eb622['name']){delete _0x7eb622[_0x5f80('0x21')];}_0x3808c8['status'](_0x796538)[_0x5f80('0x22')](_0x7eb622);};}exports[_0x5f80('0x23')]=function(_0x1ce068,_0x2d74b3){var _0x54c2f2={},_0x198849={},_0x46bf8f={'count':0x0,'rows':[]};var _0x5c5194=_['map'](db[_0x5f80('0x24')]['rawAttributes'],function(_0x194769){return{'name':_0x194769[_0x5f80('0x25')],'type':_0x194769[_0x5f80('0x26')][_0x5f80('0x27')]};});_0x198849['model']=_['map'](_0x5c5194,'name');_0x198849[_0x5f80('0x28')]=_[_0x5f80('0x29')](_0x1ce068[_0x5f80('0x28')]);_0x198849[_0x5f80('0x2a')]=_[_0x5f80('0x2b')](_0x198849[_0x5f80('0x2c')],_0x198849['query']);_0x54c2f2['attributes']=_['intersection'](_0x198849['model'],qs[_0x5f80('0x2d')](_0x1ce068[_0x5f80('0x28')]['fields']));_0x54c2f2[_0x5f80('0x2e')]=_0x54c2f2[_0x5f80('0x2e')][_0x5f80('0x2f')]?_0x54c2f2[_0x5f80('0x2e')]:_0x198849['model'];if(!_0x1ce068[_0x5f80('0x28')][_0x5f80('0x30')](_0x5f80('0x31'))){_0x54c2f2[_0x5f80('0x32')]=qs[_0x5f80('0x32')](_0x1ce068['query'][_0x5f80('0x32')]);_0x54c2f2[_0x5f80('0x18')]=qs[_0x5f80('0x18')](_0x1ce068[_0x5f80('0x28')][_0x5f80('0x18')]);}_0x54c2f2[_0x5f80('0x33')]=qs[_0x5f80('0x34')](_0x1ce068['query'][_0x5f80('0x34')]);_0x54c2f2[_0x5f80('0x35')]=qs[_0x5f80('0x2a')](_[_0x5f80('0x36')](_0x1ce068[_0x5f80('0x28')],_0x198849['filters']));if(_0x1ce068['query']['filter']){_0x54c2f2[_0x5f80('0x35')]=_['merge'](_0x54c2f2[_0x5f80('0x35')],{'$or':_[_0x5f80('0x37')](_0x5c5194,function(_0x2bd3f8){if(_0x2bd3f8[_0x5f80('0x26')]!==_0x5f80('0x38')){var _0x30fe8c={};_0x30fe8c[_0x2bd3f8['name']]={'$like':'%'+_0x1ce068[_0x5f80('0x28')][_0x5f80('0x39')]+'%'};return _0x30fe8c;}})});}_0x54c2f2=_[_0x5f80('0x3a')]({},_0x54c2f2,_0x1ce068[_0x5f80('0x3b')]);var _0x2a66fb={'where':_0x54c2f2['where']};return db[_0x5f80('0x24')][_0x5f80('0x17')](_0x2a66fb)[_0x5f80('0x1d')](function(_0x23708c){_0x46bf8f[_0x5f80('0x17')]=_0x23708c;if(_0x1ce068[_0x5f80('0x28')]['includeAll']){_0x54c2f2['include']=[{'all':!![]}];}return db[_0x5f80('0x24')][_0x5f80('0x3c')](_0x54c2f2);})[_0x5f80('0x1d')](function(_0x2a15e6){_0x46bf8f[_0x5f80('0x3d')]=_0x2a15e6;return _0x46bf8f;})[_0x5f80('0x1d')](respondWithFilteredResult(_0x2d74b3,_0x54c2f2))[_0x5f80('0x3e')](handleError(_0x2d74b3,null));};exports[_0x5f80('0x3f')]=function(_0xcd2765,_0x47c200){var _0x10faec={'raw':!![],'where':{'id':_0xcd2765[_0x5f80('0x40')]['id']}},_0x5a63ca={};_0x5a63ca[_0x5f80('0x2c')]=_[_0x5f80('0x29')](db[_0x5f80('0x24')][_0x5f80('0x41')]);_0x5a63ca[_0x5f80('0x28')]=_['keys'](_0xcd2765[_0x5f80('0x28')]);_0x5a63ca[_0x5f80('0x2a')]=_[_0x5f80('0x2b')](_0x5a63ca[_0x5f80('0x2c')],_0x5a63ca[_0x5f80('0x28')]);_0x10faec['attributes']=_[_0x5f80('0x2b')](_0x5a63ca[_0x5f80('0x2c')],qs[_0x5f80('0x2d')](_0xcd2765[_0x5f80('0x28')][_0x5f80('0x2d')]));_0x10faec['attributes']=_0x10faec[_0x5f80('0x2e')]['length']?_0x10faec['attributes']:_0x5a63ca[_0x5f80('0x2c')];if(_0xcd2765[_0x5f80('0x28')]['includeAll']){_0x10faec[_0x5f80('0x42')]=[{'all':!![]}];}_0x10faec=_[_0x5f80('0x3a')]({},_0x10faec,_0xcd2765[_0x5f80('0x3b')]);return db[_0x5f80('0x24')][_0x5f80('0x43')](_0x10faec)[_0x5f80('0x1d')](handleEntityNotFound(_0x47c200,null))[_0x5f80('0x1d')](respondWithResult(_0x47c200,null))[_0x5f80('0x3e')](handleError(_0x47c200,null));};exports['create']=function(_0x15b638,_0x352de1){return db['SquareDetailsReport']['create'](_0x15b638[_0x5f80('0x44')],{})[_0x5f80('0x1d')](respondWithResult(_0x352de1,0xc9))[_0x5f80('0x3e')](handleError(_0x352de1,null));};exports['update']=function(_0xbcb82a,_0x5f5ddb){if(_0xbcb82a[_0x5f80('0x44')]['id']){delete _0xbcb82a['body']['id'];}return db[_0x5f80('0x24')][_0x5f80('0x43')]({'where':{'id':_0xbcb82a[_0x5f80('0x40')]['id']}})['then'](handleEntityNotFound(_0x5f5ddb,null))['then'](saveUpdates(_0xbcb82a['body'],null))[_0x5f80('0x1d')](respondWithResult(_0x5f5ddb,null))[_0x5f80('0x3e')](handleError(_0x5f5ddb,null));};exports[_0x5f80('0x45')]=function(_0x4570d9,_0x2c44ab){return db[_0x5f80('0x24')]['find']({'where':{'id':_0x4570d9['params']['id']}})[_0x5f80('0x1d')](handleEntityNotFound(_0x2c44ab,null))[_0x5f80('0x1d')](removeEntity(_0x2c44ab,null))['catch'](handleError(_0x2c44ab,null));};exports[_0x5f80('0x46')]=function(_0x3d69a7,_0x3c61e8){return db[_0x5f80('0x24')][_0x5f80('0x46')]()[_0x5f80('0x1d')](respondWithResult(_0x3c61e8,null))[_0x5f80('0x3e')](handleError(_0x3c61e8,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index e6b8d9c..58cb039 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 _0x792a=['util','api','request-promise','rimraf','../../config/environment','./squareReportDetail.attributes','SquareDetailsReport','report_square_details','lodash'];(function(_0xa521cb,_0x274e3e){var _0x159b3d=function(_0x5424d6){while(--_0x5424d6){_0xa521cb['push'](_0xa521cb['shift']());}};_0x159b3d(++_0x274e3e);}(_0x792a,0x131));var _0xa792=function(_0x57a9ce,_0x23a568){_0x57a9ce=_0x57a9ce-0x0;var _0x41f760=_0x792a[_0x57a9ce];return _0x41f760;};'use strict';var _=require(_0xa792('0x0'));var util=require(_0xa792('0x1'));var logger=require('../../config/logger')(_0xa792('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa792('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa792('0x4'));var config=require(_0xa792('0x5'));var attributes=require(_0xa792('0x6'));module['exports']=function(_0x138bd2,_0x3e76f7){return _0x138bd2['define'](_0xa792('0x7'),attributes,{'tableName':_0xa792('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8343=['util','../../config/logger','moment','request-promise','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash'];(function(_0x549278,_0x450754){var _0x1ea9a1=function(_0x2e559d){while(--_0x2e559d){_0x549278['push'](_0x549278['shift']());}};_0x1ea9a1(++_0x450754);}(_0x8343,0xa9));var _0x3834=function(_0xfe2098,_0x6186a5){_0xfe2098=_0xfe2098-0x0;var _0x5b4e35=_0x8343[_0xfe2098];return _0x5b4e35;};'use strict';var _=require(_0x3834('0x0'));var util=require(_0x3834('0x1'));var logger=require(_0x3834('0x2'))('api');var moment=require(_0x3834('0x3'));var BPromise=require('bluebird');var rp=require(_0x3834('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3834('0x5'));module[_0x3834('0x6')]=function(_0xb8d48,_0x5574d1){return _0xb8d48[_0x3834('0x7')](_0x3834('0x8'),attributes,{'tableName':_0x3834('0x9'),'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 7c19a0e..c3e805d 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 _0xc6e6=['client','http','request','info','request\x20sent','debug','error','code','SquareDetailsReport,\x20%s,\x20%s','message','result','catch','SquareDetailsReport','options','raw','then','CreateSquareDetailsReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x20f047,_0x570f65){var _0x224e20=function(_0x56787f){while(--_0x56787f){_0x20f047['push'](_0x20f047['shift']());}};_0x224e20(++_0x570f65);}(_0xc6e6,0x1d1));var _0x6c6e=function(_0x3dde37,_0x4ab03e){_0x3dde37=_0x3dde37-0x0;var _0x2cfe6e=_0xc6e6[_0x3dde37];return _0x2cfe6e;};'use strict';var _=require('lodash');var util=require(_0x6c6e('0x0'));var moment=require(_0x6c6e('0x1'));var BPromise=require(_0x6c6e('0x2'));var rs=require(_0x6c6e('0x3'));var fs=require('fs');var Redis=require(_0x6c6e('0x4'));var db=require(_0x6c6e('0x5'))['db'];var utils=require(_0x6c6e('0x6'));var logger=require(_0x6c6e('0x7'))(_0x6c6e('0x8'));var config=require(_0x6c6e('0x9'));var jayson=require(_0x6c6e('0xa'));var client=jayson[_0x6c6e('0xb')][_0x6c6e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x39c0ba,_0x3a287c,_0x213996){return new BPromise(function(_0x473a58,_0x53df26){return client[_0x6c6e('0xd')](_0x39c0ba,_0x213996)['then'](function(_0x32e6b9){logger[_0x6c6e('0xe')]('SquareDetailsReport,\x20%s,\x20%s',_0x3a287c,_0x6c6e('0xf'));logger[_0x6c6e('0x10')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x3a287c,_0x6c6e('0xf'),JSON['stringify'](_0x32e6b9));if(_0x32e6b9[_0x6c6e('0x11')]){if(_0x32e6b9[_0x6c6e('0x11')][_0x6c6e('0x12')]===0x1f4){logger[_0x6c6e('0x11')](_0x6c6e('0x13'),_0x3a287c,_0x32e6b9[_0x6c6e('0x11')][_0x6c6e('0x14')]);return _0x53df26(_0x32e6b9['error'][_0x6c6e('0x14')]);}logger[_0x6c6e('0x11')]('SquareDetailsReport,\x20%s,\x20%s',_0x3a287c,_0x32e6b9[_0x6c6e('0x11')][_0x6c6e('0x14')]);return _0x473a58(_0x32e6b9['error'][_0x6c6e('0x14')]);}else{logger[_0x6c6e('0xe')](_0x6c6e('0x13'),_0x3a287c,_0x6c6e('0xf'));_0x473a58(_0x32e6b9[_0x6c6e('0x15')][_0x6c6e('0x14')]);}})[_0x6c6e('0x16')](function(_0x1afeb0){logger[_0x6c6e('0x11')](_0x6c6e('0x13'),_0x3a287c,_0x1afeb0);_0x53df26(_0x1afeb0);});});}exports['CreateSquareDetailsReport']=function(_0x58d6b6){var _0x4015ba=this;return new Promise(function(_0x3cc9bc,_0x329312){return db[_0x6c6e('0x17')]['create'](_0x58d6b6['body'],{'raw':_0x58d6b6[_0x6c6e('0x18')]?_0x58d6b6[_0x6c6e('0x18')][_0x6c6e('0x19')]===undefined?!![]:![]:!![]})[_0x6c6e('0x1a')](function(_0x58425a){logger[_0x6c6e('0xe')](_0x6c6e('0x1b'),_0x58d6b6);logger['debug'](_0x6c6e('0x1b'),_0x58d6b6,JSON['stringify'](_0x58425a));_0x3cc9bc(_0x58425a);})[_0x6c6e('0x16')](function(_0x4ba8c9){logger['error'](_0x6c6e('0x1b'),_0x4ba8c9['message'],_0x58d6b6);_0x329312(_0x4015ba[_0x6c6e('0x11')](0x1f4,_0x4ba8c9[_0x6c6e('0x14')]));});});}; \ No newline at end of file +var _0x9ac5=['SquareDetailsReport','create','body','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareDetailsReport'];(function(_0x2e33d3,_0x4375d2){var _0x5cd87d=function(_0x2ae53c){while(--_0x2ae53c){_0x2e33d3['push'](_0x2e33d3['shift']());}};_0x5cd87d(++_0x4375d2);}(_0x9ac5,0x18d));var _0x59ac=function(_0xf2e7d2,_0x36da11){_0xf2e7d2=_0xf2e7d2-0x0;var _0x51a45c=_0x9ac5[_0xf2e7d2];return _0x51a45c;};'use strict';var _=require(_0x59ac('0x0'));var util=require('util');var moment=require(_0x59ac('0x1'));var BPromise=require(_0x59ac('0x2'));var rs=require(_0x59ac('0x3'));var fs=require('fs');var Redis=require(_0x59ac('0x4'));var db=require(_0x59ac('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x59ac('0x6'))(_0x59ac('0x7'));var config=require(_0x59ac('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x59ac('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22f457,_0x187039,_0x36e163){return new BPromise(function(_0x5215c3,_0x3939a2){return client['request'](_0x22f457,_0x36e163)[_0x59ac('0xa')](function(_0x4977de){logger[_0x59ac('0xb')](_0x59ac('0xc'),_0x187039,_0x59ac('0xd'));logger[_0x59ac('0xe')](_0x59ac('0xf'),_0x187039,_0x59ac('0xd'),JSON[_0x59ac('0x10')](_0x4977de));if(_0x4977de[_0x59ac('0x11')]){if(_0x4977de[_0x59ac('0x11')][_0x59ac('0x12')]===0x1f4){logger[_0x59ac('0x11')](_0x59ac('0xc'),_0x187039,_0x4977de['error']['message']);return _0x3939a2(_0x4977de[_0x59ac('0x11')][_0x59ac('0x13')]);}logger[_0x59ac('0x11')](_0x59ac('0xc'),_0x187039,_0x4977de[_0x59ac('0x11')]['message']);return _0x5215c3(_0x4977de[_0x59ac('0x11')][_0x59ac('0x13')]);}else{logger[_0x59ac('0xb')]('SquareDetailsReport,\x20%s,\x20%s',_0x187039,_0x59ac('0xd'));_0x5215c3(_0x4977de[_0x59ac('0x14')][_0x59ac('0x13')]);}})[_0x59ac('0x15')](function(_0x2f6c23){logger[_0x59ac('0x11')](_0x59ac('0xc'),_0x187039,_0x2f6c23);_0x3939a2(_0x2f6c23);});});}exports[_0x59ac('0x16')]=function(_0x574007){var _0x4de546=this;return new Promise(function(_0x1acfed,_0x3474d5){return db[_0x59ac('0x17')][_0x59ac('0x18')](_0x574007[_0x59ac('0x19')],{'raw':_0x574007[_0x59ac('0x1a')]?_0x574007[_0x59ac('0x1a')][_0x59ac('0x1b')]===undefined?!![]:![]:!![]})[_0x59ac('0xa')](function(_0x461dc2){logger['info'](_0x59ac('0x16'),_0x574007);logger[_0x59ac('0xe')](_0x59ac('0x16'),_0x574007,JSON[_0x59ac('0x10')](_0x461dc2));_0x1acfed(_0x461dc2);})[_0x59ac('0x15')](function(_0x163c42){logger[_0x59ac('0x11')]('CreateSquareDetailsReport',_0x163c42['message'],_0x574007);_0x3474d5(_0x4de546[_0x59ac('0x11')](0x1f4,_0x163c42[_0x59ac('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 64d63a3..047755e 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 _0x8bb2=['express','../../components/auth/service','./system.controller','get','isAuthenticated','index','/process/:pid/kill','killProcess','exports'];(function(_0x1c7713,_0x44cf4c){var _0x773b22=function(_0x11416d){while(--_0x11416d){_0x1c7713['push'](_0x1c7713['shift']());}};_0x773b22(++_0x44cf4c);}(_0x8bb2,0x13b));var _0x28bb=function(_0x1f4b18,_0x4e777c){_0x1f4b18=_0x1f4b18-0x0;var _0xde3957=_0x8bb2[_0x1f4b18];return _0xde3957;};'use strict';var express=require(_0x28bb('0x0'));var router=express['Router']();var auth=require(_0x28bb('0x1'));var controller=require(_0x28bb('0x2'));router[_0x28bb('0x3')]('/',auth[_0x28bb('0x4')](),controller[_0x28bb('0x5')]);router[_0x28bb('0x3')](_0x28bb('0x6'),auth[_0x28bb('0x4')](),controller[_0x28bb('0x7')]);module[_0x28bb('0x8')]=router; \ No newline at end of file +var _0xe9ee=['killProcess','exports','express','Router','../../components/auth/service','./system.controller','get','/process/:pid/kill','isAuthenticated'];(function(_0x11f449,_0x4186a2){var _0x3cd932=function(_0x108f2e){while(--_0x108f2e){_0x11f449['push'](_0x11f449['shift']());}};_0x3cd932(++_0x4186a2);}(_0xe9ee,0x1e8));var _0xee9e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe9ee[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0xee9e('0x0'));var router=express[_0xee9e('0x1')]();var auth=require(_0xee9e('0x2'));var controller=require(_0xee9e('0x3'));router[_0xee9e('0x4')]('/',auth['isAuthenticated'](),controller['index']);router[_0xee9e('0x4')](_0xee9e('0x5'),auth[_0xee9e('0x6')](),controller[_0xee9e('0x7')]);module[_0xee9e('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 948d9d4..c953970 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 _0xa801=['inspect','name','status','index','getAllData','then','catch','format','params','pid','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','json','child_process','api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s'];(function(_0x345209,_0x26625d){var _0x35f98c=function(_0x14837e){while(--_0x14837e){_0x345209['push'](_0x345209['shift']());}};_0x35f98c(++_0x26625d);}(_0xa801,0x1c5));var _0x1a80=function(_0x137ab0,_0x36078e){_0x137ab0=_0x137ab0-0x0;var _0x425528=_0xa801[_0x137ab0];return _0x425528;};'use strict';var info=require('systeminformation');var exec=require(_0x1a80('0x0'))['exec'];var logger=require('../../config/logger')(_0x1a80('0x1'));var util=require(_0x1a80('0x2'));var BPromise=require(_0x1a80('0x3'));var _=require(_0x1a80('0x4'));function handleError(_0x44ad96,_0x42cf95,_0x161c7c){_0x42cf95=_0x42cf95||0x1f4;return function(_0x561498){logger[_0x1a80('0x5')](_0x1a80('0x6'),_0x161c7c,_0x42cf95,util[_0x1a80('0x7')](_0x561498,{'showHidden':![],'depth':null}));delete _0x561498[_0x1a80('0x8')];_0x44ad96[_0x1a80('0x9')](_0x42cf95)['send'](_0x561498);};}exports[_0x1a80('0xa')]=function(_0x8ebbf8,_0x405f55){return info[_0x1a80('0xb')]()[_0x1a80('0xc')](function(_0x34658b){return _0x405f55[_0x1a80('0x9')](0xc8)['json'](_0x34658b);})[_0x1a80('0xd')](function(_0x3d8d66){return _0x405f55['status'](0x1f4)['json'](_0x3d8d66);});};exports['killProcess']=function(_0x19e9fd,_0x1911f4){var _0x5b3029=['components/import/cm'];return new BPromise(function(_0x447a81,_0x1cbb78){return exec(util[_0x1a80('0xe')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x19e9fd[_0x1a80('0xf')][_0x1a80('0x10')]),function(_0x2eab28,_0x2bb572,_0x5397f8){if(_0x2eab28){return _0x1cbb78(_0x2eab28);}return _0x447a81(_0x2bb572);});})['then'](function(_0x2206f4){var _0x2acf24=![];var _0x1fe775=_0x2206f4['split'](/\n/);for(var _0x4b446b=0x0,_0x432b64=_0x5b3029['length'];_0x4b446b<_0x432b64,_0x2acf24===![];_0x4b446b+=0x1){if(_0x2206f4['indexOf'](_0x5b3029[_0x4b446b])>=0x0){_0x2acf24=!![];}}if(!_0x2acf24){throw new Error(util[_0x1a80('0xe')](_0x1a80('0x11'),_0x19e9fd[_0x1a80('0xf')][_0x1a80('0x10')]));}process[_0x1a80('0x12')](_0x19e9fd[_0x1a80('0xf')][_0x1a80('0x10')],'SIGINT');return _0x1911f4[_0x1a80('0x9')](0xc8)[_0x1a80('0x13')]({'message':util['format']('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x19e9fd['params'][_0x1a80('0x10')])});})[_0x1a80('0xd')](handleError(_0x1911f4,null,'killProcess'));}; \ No newline at end of file +var _0xb073=['Process\x20with\x20pid\x20%s\x20killed\x20correctly','child_process','../../config/logger','api','util','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','getAllData','then','json','catch','killProcess','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','pid','split','format','Process\x20with\x20pid\x20%s\x20not\x20found!','params','SIGINT'];(function(_0xf73c09,_0x4e424e){var _0xa8923c=function(_0x4831c1){while(--_0x4831c1){_0xf73c09['push'](_0xf73c09['shift']());}};_0xa8923c(++_0x4e424e);}(_0xb073,0x187));var _0x3b07=function(_0xae8320,_0x2100b8){_0xae8320=_0xae8320-0x0;var _0x55d2c5=_0xb073[_0xae8320];return _0x55d2c5;};'use strict';var info=require('systeminformation');var exec=require(_0x3b07('0x0'))['exec'];var logger=require(_0x3b07('0x1'))(_0x3b07('0x2'));var util=require(_0x3b07('0x3'));var BPromise=require('bluebird');var _=require(_0x3b07('0x4'));function handleError(_0x3112da,_0x31e382,_0x48cf22){_0x31e382=_0x31e382||0x1f4;return function(_0x433434){logger[_0x3b07('0x5')](_0x3b07('0x6'),_0x48cf22,_0x31e382,util[_0x3b07('0x7')](_0x433434,{'showHidden':![],'depth':null}));delete _0x433434[_0x3b07('0x8')];_0x3112da[_0x3b07('0x9')](_0x31e382)[_0x3b07('0xa')](_0x433434);};}exports[_0x3b07('0xb')]=function(_0x599a82,_0x56e508){return info[_0x3b07('0xc')]()[_0x3b07('0xd')](function(_0x31cf54){return _0x56e508[_0x3b07('0x9')](0xc8)[_0x3b07('0xe')](_0x31cf54);})[_0x3b07('0xf')](function(_0x864f66){return _0x56e508[_0x3b07('0x9')](0x1f4)[_0x3b07('0xe')](_0x864f66);});};exports[_0x3b07('0x10')]=function(_0x1eda50,_0x5deed4){var _0x4ed704=[_0x3b07('0x11')];return new BPromise(function(_0x3f7091,_0x277bc6){return exec(util['format'](_0x3b07('0x12'),_0x1eda50['params'][_0x3b07('0x13')]),function(_0x589d65,_0x2d3151,_0xad5aaa){if(_0x589d65){return _0x277bc6(_0x589d65);}return _0x3f7091(_0x2d3151);});})[_0x3b07('0xd')](function(_0x33275d){var _0x2e1f12=![];var _0x33d648=_0x33275d[_0x3b07('0x14')](/\n/);for(var _0x268f0b=0x0,_0x4f38b2=_0x4ed704['length'];_0x268f0b<_0x4f38b2,_0x2e1f12===![];_0x268f0b+=0x1){if(_0x33275d['indexOf'](_0x4ed704[_0x268f0b])>=0x0){_0x2e1f12=!![];}}if(!_0x2e1f12){throw new Error(util[_0x3b07('0x15')](_0x3b07('0x16'),_0x1eda50['params']['pid']));}process['kill'](_0x1eda50[_0x3b07('0x17')]['pid'],_0x3b07('0x18'));return _0x5deed4[_0x3b07('0x9')](0xc8)[_0x3b07('0xe')]({'message':util[_0x3b07('0x15')](_0x3b07('0x19'),_0x1eda50[_0x3b07('0x17')][_0x3b07('0x13')])});})[_0x3b07('0xf')](handleError(_0x5deed4,null,_0x3b07('0x10')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index a8231e0..2161007 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 _0x5c12=['../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','index','/:id','post','isAuthenticated','create','put','update','delete','destroy','util','path','express','Router'];(function(_0x5d2636,_0x1b5806){var _0x15dc9a=function(_0x124a46){while(--_0x124a46){_0x5d2636['push'](_0x5d2636['shift']());}};_0x15dc9a(++_0x1b5806);}(_0x5c12,0x188));var _0x25c1=function(_0x5de214,_0x107e9d){_0x5de214=_0x5de214-0x0;var _0x4df627=_0x5c12[_0x5de214];return _0x4df627;};'use strict';var multer=require('multer');var util=require(_0x25c1('0x0'));var path=require(_0x25c1('0x1'));var timeout=require('connect-timeout');var express=require(_0x25c1('0x2'));var router=express[_0x25c1('0x3')]();var auth=require(_0x25c1('0x4'));var interaction=require(_0x25c1('0x5'));var config=require(_0x25c1('0x6'));var controller=require(_0x25c1('0x7'));router[_0x25c1('0x8')]('/',auth['isAuthenticated'](),controller[_0x25c1('0x9')]);router[_0x25c1('0x8')](_0x25c1('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x25c1('0xb')]('/',auth[_0x25c1('0xc')](),controller[_0x25c1('0xd')]);router[_0x25c1('0xe')](_0x25c1('0xa'),auth['isAuthenticated'](),controller[_0x25c1('0xf')]);router[_0x25c1('0x10')](_0x25c1('0xa'),auth[_0x25c1('0xc')](),controller[_0x25c1('0x11')]);module['exports']=router; \ No newline at end of file +var _0x6f0d=['delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','index','/:id','isAuthenticated','show','post','put','update'];(function(_0xfc9401,_0xda8d18){var _0x14f3ff=function(_0x24e579){while(--_0x24e579){_0xfc9401['push'](_0xfc9401['shift']());}};_0x14f3ff(++_0xda8d18);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x9181ad,_0x1e03c7){_0x9181ad=_0x9181ad-0x0;var _0x3f0a90=_0x6f0d[_0x9181ad];return _0x3f0a90;};'use strict';var multer=require('multer');var util=require(_0xd6f0('0x0'));var path=require(_0xd6f0('0x1'));var timeout=require(_0xd6f0('0x2'));var express=require(_0xd6f0('0x3'));var router=express['Router']();var auth=require(_0xd6f0('0x4'));var interaction=require(_0xd6f0('0x5'));var config=require(_0xd6f0('0x6'));var controller=require(_0xd6f0('0x7'));router[_0xd6f0('0x8')]('/',auth['isAuthenticated'](),controller[_0xd6f0('0x9')]);router['get'](_0xd6f0('0xa'),auth[_0xd6f0('0xb')](),controller[_0xd6f0('0xc')]);router[_0xd6f0('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd6f0('0xe')](_0xd6f0('0xa'),auth[_0xd6f0('0xb')](),controller[_0xd6f0('0xf')]);router[_0xd6f0('0x10')]('/:id',auth[_0xd6f0('0xb')](),controller[_0xd6f0('0x11')]);module[_0xd6f0('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 333f471..1962a1a 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 _0x9ffd=['STRING','#0091EA','sequelize','exports'];(function(_0x5b7c0a,_0x3892c1){var _0x33e84f=function(_0x2b1e27){while(--_0x2b1e27){_0x5b7c0a['push'](_0x5b7c0a['shift']());}};_0x33e84f(++_0x3892c1);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x1dc71a,_0x51ef11){_0x1dc71a=_0x1dc71a-0x0;var _0x5f1bb8=_0x9ffd[_0x1dc71a];return _0x5f1bb8;};'use strict';var Sequelize=require(_0xd9ff('0x0'));module[_0xd9ff('0x1')]={'name':{'type':Sequelize[_0xd9ff('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xd9ff('0x2')],'defaultValue':_0xd9ff('0x3')},'description':{'type':Sequelize[_0xd9ff('0x2')]}}; \ No newline at end of file +var _0x2032=['#0091EA','exports','STRING','name'];(function(_0xbd4634,_0x4cc313){var _0x2ebd35=function(_0xaf72e8){while(--_0xaf72e8){_0xbd4634['push'](_0xbd4634['shift']());}};_0x2ebd35(++_0x4cc313);}(_0x2032,0xd9));var _0x2203=function(_0x22e44a,_0x86bd3f){_0x22e44a=_0x22e44a-0x0;var _0x5f3c13=_0x2032[_0x22e44a];return _0x5f3c13;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'unique':_0x2203('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x2203('0x3')},'description':{'type':Sequelize[_0x2203('0x1')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 3ffc9d1..76684b8 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 _0x7f9c=['papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','set','Content-Range','json','reject','save','update','then','destroy','get','Tags','UserProfileResource','sendStatus','error','name','index','map','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','limit','sort','where','pick','filter','options','Tag','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','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','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js'];(function(_0x46d744,_0x565e01){var _0x3f6120=function(_0x12585e){while(--_0x12585e){_0x46d744['push'](_0x46d744['shift']());}};_0x3f6120(++_0x565e01);}(_0x7f9c,0x1ca));var _0xc7f9=function(_0x2c8390,_0x2361c2){_0x2c8390=_0x2c8390-0x0;var _0x48c47d=_0x7f9c[_0x2c8390];return _0x48c47d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc7f9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc7f9('0x1'));var jsonpatch=require(_0xc7f9('0x2'));var rp=require(_0xc7f9('0x3'));var moment=require(_0xc7f9('0x4'));var BPromise=require(_0xc7f9('0x5'));var Mustache=require(_0xc7f9('0x6'));var util=require(_0xc7f9('0x7'));var path=require(_0xc7f9('0x8'));var sox=require(_0xc7f9('0x9'));var csv=require(_0xc7f9('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc7f9('0xb'));var squel=require(_0xc7f9('0xc'));var crypto=require(_0xc7f9('0xd'));var jsforce=require(_0xc7f9('0xe'));var deskjs=require(_0xc7f9('0xf'));var toCsv=require(_0xc7f9('0xa'));var querystring=require('querystring');var Papa=require(_0xc7f9('0x10'));var Redis=require(_0xc7f9('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xc7f9('0x12'));var as=require(_0xc7f9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc7f9('0x14'))(_0xc7f9('0x15'));var utils=require(_0xc7f9('0x16'));var config=require(_0xc7f9('0x17'));var db=require(_0xc7f9('0x18'))['db'];function respondWithStatusCode(_0x27b727,_0x327221){_0x327221=_0x327221||0xcc;return function(_0x52c230){if(_0x52c230){return _0x27b727['sendStatus'](_0x327221);}return _0x27b727[_0xc7f9('0x19')](_0x327221)[_0xc7f9('0x1a')]();};}function respondWithResult(_0x573507,_0x1e0134){_0x1e0134=_0x1e0134||0xc8;return function(_0x503084){if(_0x503084){return _0x573507[_0xc7f9('0x19')](_0x1e0134)['json'](_0x503084);}};}function respondWithFilteredResult(_0x19d8ca,_0x5cdaca){return function(_0x420e71){if(_0x420e71){var _0xb6d853=_0x420e71['count'],_0x64c394=_0x5cdaca[_0xc7f9('0x1b')],_0x158873=_0x5cdaca[_0xc7f9('0x1b')]+_0x5cdaca['limit'],_0x5e6921;if(_0x158873>=_0xb6d853){_0x158873=_0xb6d853;_0x5e6921=0xc8;}else{_0x5e6921=0xce;}_0x19d8ca[_0xc7f9('0x19')](_0x5e6921);return _0x19d8ca[_0xc7f9('0x1c')](_0xc7f9('0x1d'),_0x64c394+'-'+_0x158873+'/'+_0xb6d853)[_0xc7f9('0x1e')](_0x420e71);}return null;};}function patchUpdates(_0x3694a3){return function(_0x5330a6){try{jsonpatch['apply'](_0x5330a6,_0x3694a3,!![]);}catch(_0x57a14a){return BPromise[_0xc7f9('0x1f')](_0x57a14a);}return _0x5330a6[_0xc7f9('0x20')]();};}function saveUpdates(_0xf21544,_0x4cbb68){return function(_0x42d900){if(_0x42d900){return _0x42d900[_0xc7f9('0x21')](_0xf21544)[_0xc7f9('0x22')](function(_0xb2bd0){return _0xb2bd0;});}return null;};}function removeEntity(_0x19a653,_0x298091){return function(_0x16f129){if(_0x16f129){return _0x16f129[_0xc7f9('0x23')]()[_0xc7f9('0x22')](function(){var _0x5a85c9=_0x16f129[_0xc7f9('0x24')]({'plain':!![]});var _0x38c550=_0xc7f9('0x25');return db[_0xc7f9('0x26')]['destroy']({'where':{'type':_0x38c550,'resourceId':_0x5a85c9['id']}})['then'](function(){return _0x16f129;});})[_0xc7f9('0x22')](function(){_0x19a653[_0xc7f9('0x19')](0xcc)[_0xc7f9('0x1a')]();});}};}function handleEntityNotFound(_0x116ac4,_0x6ef794){return function(_0x566301){if(!_0x566301){_0x116ac4[_0xc7f9('0x27')](0x194);}return _0x566301;};}function handleError(_0xfc66ff,_0x3a7d1e){_0x3a7d1e=_0x3a7d1e||0x1f4;return function(_0x227a81){logger[_0xc7f9('0x28')](_0x227a81['stack']);if(_0x227a81[_0xc7f9('0x29')]){delete _0x227a81[_0xc7f9('0x29')];}_0xfc66ff[_0xc7f9('0x19')](_0x3a7d1e)['send'](_0x227a81);};}exports[_0xc7f9('0x2a')]=function(_0x5e8174,_0x5a5479){var _0x346683={},_0xf8f23a={},_0x414978={'count':0x0,'rows':[]};var _0x16ccb8=_[_0xc7f9('0x2b')](db['Tag']['rawAttributes'],function(_0x4f69b0){return{'name':_0x4f69b0[_0xc7f9('0x2c')],'type':_0x4f69b0[_0xc7f9('0x2d')][_0xc7f9('0x2e')]};});_0xf8f23a[_0xc7f9('0x2f')]=_['map'](_0x16ccb8,_0xc7f9('0x29'));_0xf8f23a['query']=_[_0xc7f9('0x30')](_0x5e8174[_0xc7f9('0x31')]);_0xf8f23a[_0xc7f9('0x32')]=_[_0xc7f9('0x33')](_0xf8f23a[_0xc7f9('0x2f')],_0xf8f23a['query']);_0x346683[_0xc7f9('0x34')]=_['intersection'](_0xf8f23a[_0xc7f9('0x2f')],qs[_0xc7f9('0x35')](_0x5e8174[_0xc7f9('0x31')][_0xc7f9('0x35')]));_0x346683[_0xc7f9('0x34')]=_0x346683[_0xc7f9('0x34')][_0xc7f9('0x36')]?_0x346683[_0xc7f9('0x34')]:_0xf8f23a[_0xc7f9('0x2f')];if(!_0x5e8174['query']['hasOwnProperty']('nolimit')){_0x346683['limit']=qs[_0xc7f9('0x37')](_0x5e8174[_0xc7f9('0x31')][_0xc7f9('0x37')]);_0x346683[_0xc7f9('0x1b')]=qs[_0xc7f9('0x1b')](_0x5e8174[_0xc7f9('0x31')][_0xc7f9('0x1b')]);}_0x346683['order']=qs[_0xc7f9('0x38')](_0x5e8174[_0xc7f9('0x31')]['sort']);_0x346683[_0xc7f9('0x39')]=qs[_0xc7f9('0x32')](_[_0xc7f9('0x3a')](_0x5e8174[_0xc7f9('0x31')],_0xf8f23a[_0xc7f9('0x32')]));if(_0x5e8174[_0xc7f9('0x31')]['filter']){_0x346683[_0xc7f9('0x39')]=_['merge'](_0x346683['where'],{'$or':_[_0xc7f9('0x2b')](_0x16ccb8,function(_0x3dca68){if(_0x3dca68[_0xc7f9('0x2d')]!=='VIRTUAL'){var _0x22d1d2={};_0x22d1d2[_0x3dca68[_0xc7f9('0x29')]]={'$like':'%'+_0x5e8174['query'][_0xc7f9('0x3b')]+'%'};return _0x22d1d2;}})});}_0x346683=_['merge']({},_0x346683,_0x5e8174[_0xc7f9('0x3c')]);var _0xc00ca5={'where':_0x346683[_0xc7f9('0x39')]};return db[_0xc7f9('0x3d')][_0xc7f9('0x3e')](_0xc00ca5)[_0xc7f9('0x22')](function(_0x35b73f){_0x414978[_0xc7f9('0x3e')]=_0x35b73f;if(_0x5e8174['query'][_0xc7f9('0x3f')]){_0x346683[_0xc7f9('0x40')]=[{'all':!![]}];}return db['Tag'][_0xc7f9('0x41')](_0x346683);})[_0xc7f9('0x22')](function(_0x12f665){_0x414978[_0xc7f9('0x42')]=_0x12f665;return _0x414978;})[_0xc7f9('0x22')](respondWithFilteredResult(_0x5a5479,_0x346683))[_0xc7f9('0x43')](handleError(_0x5a5479,null));};exports[_0xc7f9('0x44')]=function(_0x585e9e,_0x10faa5){var _0x34f6be={'raw':!![],'where':{'id':_0x585e9e[_0xc7f9('0x45')]['id']}},_0x432fa5={};_0x432fa5['model']=_[_0xc7f9('0x30')](db[_0xc7f9('0x3d')][_0xc7f9('0x46')]);_0x432fa5[_0xc7f9('0x31')]=_['keys'](_0x585e9e[_0xc7f9('0x31')]);_0x432fa5[_0xc7f9('0x32')]=_[_0xc7f9('0x33')](_0x432fa5[_0xc7f9('0x2f')],_0x432fa5[_0xc7f9('0x31')]);_0x34f6be['attributes']=_[_0xc7f9('0x33')](_0x432fa5['model'],qs[_0xc7f9('0x35')](_0x585e9e[_0xc7f9('0x31')][_0xc7f9('0x35')]));_0x34f6be['attributes']=_0x34f6be[_0xc7f9('0x34')]['length']?_0x34f6be[_0xc7f9('0x34')]:_0x432fa5['model'];if(_0x585e9e[_0xc7f9('0x31')][_0xc7f9('0x3f')]){_0x34f6be[_0xc7f9('0x40')]=[{'all':!![]}];}_0x34f6be=_['merge']({},_0x34f6be,_0x585e9e[_0xc7f9('0x3c')]);return db[_0xc7f9('0x3d')]['find'](_0x34f6be)[_0xc7f9('0x22')](handleEntityNotFound(_0x10faa5,null))['then'](respondWithResult(_0x10faa5,null))[_0xc7f9('0x43')](handleError(_0x10faa5,null));};exports[_0xc7f9('0x47')]=function(_0x54a38b,_0x852d59){return db[_0xc7f9('0x3d')][_0xc7f9('0x47')](_0x54a38b[_0xc7f9('0x48')],{})[_0xc7f9('0x22')](function(_0xd744db){var _0x62a845=_0x54a38b[_0xc7f9('0x49')][_0xc7f9('0x24')]({'plain':!![]});if(!_0x62a845)throw new Error(_0xc7f9('0x4a'));if(_0x62a845[_0xc7f9('0x4b')]==='user'){var _0x2f25bd=_0xd744db[_0xc7f9('0x24')]({'plain':!![]});var _0x137ae3=_0xc7f9('0x25');return db['UserProfileSection'][_0xc7f9('0x4c')]({'where':{'name':_0x137ae3,'userProfileId':_0x62a845['userProfileId']},'raw':!![]})[_0xc7f9('0x22')](function(_0x2b1a73){if(_0x2b1a73&&_0x2b1a73[_0xc7f9('0x4d')]===0x0){return db[_0xc7f9('0x26')]['create']({'name':_0x2f25bd[_0xc7f9('0x29')],'resourceId':_0x2f25bd['id'],'type':_0x2b1a73['name'],'sectionId':_0x2b1a73['id']},{})[_0xc7f9('0x22')](function(){return _0xd744db;});}else{return _0xd744db;}})['catch'](function(_0x5c5005){logger[_0xc7f9('0x28')](_0xc7f9('0x4e'),_0x5c5005);throw _0x5c5005;});}return _0xd744db;})['then'](respondWithResult(_0x852d59,0xc9))[_0xc7f9('0x43')](handleError(_0x852d59,null));};exports[_0xc7f9('0x21')]=function(_0x1e798d,_0x54bd5f){if(_0x1e798d[_0xc7f9('0x48')]['id']){delete _0x1e798d['body']['id'];}return db[_0xc7f9('0x3d')][_0xc7f9('0x4c')]({'where':{'id':_0x1e798d['params']['id']}})['then'](handleEntityNotFound(_0x54bd5f,null))[_0xc7f9('0x22')](saveUpdates(_0x1e798d[_0xc7f9('0x48')],null))[_0xc7f9('0x22')](respondWithResult(_0x54bd5f,null))[_0xc7f9('0x43')](handleError(_0x54bd5f,null));};exports['destroy']=function(_0x8dbe20,_0x2b5339){return db['Tag'][_0xc7f9('0x4c')]({'where':{'id':_0x8dbe20[_0xc7f9('0x45')]['id']}})[_0xc7f9('0x22')](handleEntityNotFound(_0x2b5339,null))['then'](removeEntity(_0x2b5339,null))['catch'](handleError(_0x2b5339,null));}; \ No newline at end of file +var _0x46cf=['role','user','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','limit','set','Content-Range','json','apply','then','get','Tags','UserProfileResource','destroy','end','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','Tag','count','includeAll','include','findAll','rows','params','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x46cf,0x147));var _0xf46c=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x46cf[_0xaa1b3e];return _0x454d7d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf46c('0x0'));var rimraf=require(_0xf46c('0x1'));var zipdir=require(_0xf46c('0x2'));var jsonpatch=require(_0xf46c('0x3'));var rp=require(_0xf46c('0x4'));var moment=require('moment');var BPromise=require(_0xf46c('0x5'));var Mustache=require(_0xf46c('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf46c('0x7'));var fs=require('fs');var _=require(_0xf46c('0x8'));var squel=require(_0xf46c('0x9'));var crypto=require(_0xf46c('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xf46c('0xb'));var toCsv=require(_0xf46c('0xc'));var querystring=require(_0xf46c('0xd'));var Papa=require(_0xf46c('0xe'));var Redis=require('ioredis');var authService=require(_0xf46c('0xf'));var qs=require(_0xf46c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf46c('0x11'));var logger=require(_0xf46c('0x12'))(_0xf46c('0x13'));var utils=require(_0xf46c('0x14'));var config=require(_0xf46c('0x15'));var db=require(_0xf46c('0x16'))['db'];function respondWithStatusCode(_0x31fdb4,_0x302c15){_0x302c15=_0x302c15||0xcc;return function(_0x1dc7b7){if(_0x1dc7b7){return _0x31fdb4[_0xf46c('0x17')](_0x302c15);}return _0x31fdb4[_0xf46c('0x18')](_0x302c15)['end']();};}function respondWithResult(_0x7062d1,_0x3bd8d7){_0x3bd8d7=_0x3bd8d7||0xc8;return function(_0xe7ee01){if(_0xe7ee01){return _0x7062d1[_0xf46c('0x18')](_0x3bd8d7)['json'](_0xe7ee01);}};}function respondWithFilteredResult(_0x2ffc7a,_0x1eb668){return function(_0x571b19){if(_0x571b19){var _0x3c9eca=_0x571b19['count'],_0x5ab6af=_0x1eb668[_0xf46c('0x19')],_0x199963=_0x1eb668[_0xf46c('0x19')]+_0x1eb668[_0xf46c('0x1a')],_0x5f4987;if(_0x199963>=_0x3c9eca){_0x199963=_0x3c9eca;_0x5f4987=0xc8;}else{_0x5f4987=0xce;}_0x2ffc7a[_0xf46c('0x18')](_0x5f4987);return _0x2ffc7a[_0xf46c('0x1b')](_0xf46c('0x1c'),_0x5ab6af+'-'+_0x199963+'/'+_0x3c9eca)[_0xf46c('0x1d')](_0x571b19);}return null;};}function patchUpdates(_0x59e7ba){return function(_0x57c080){try{jsonpatch[_0xf46c('0x1e')](_0x57c080,_0x59e7ba,!![]);}catch(_0x287db4){return BPromise['reject'](_0x287db4);}return _0x57c080['save']();};}function saveUpdates(_0xb86d9c,_0x4ca790){return function(_0x2713ca){if(_0x2713ca){return _0x2713ca['update'](_0xb86d9c)[_0xf46c('0x1f')](function(_0x19c25e){return _0x19c25e;});}return null;};}function removeEntity(_0x3af83d,_0x310537){return function(_0xb373e3){if(_0xb373e3){return _0xb373e3['destroy']()[_0xf46c('0x1f')](function(){var _0x521d6d=_0xb373e3[_0xf46c('0x20')]({'plain':!![]});var _0x1b1596=_0xf46c('0x21');return db[_0xf46c('0x22')][_0xf46c('0x23')]({'where':{'type':_0x1b1596,'resourceId':_0x521d6d['id']}})['then'](function(){return _0xb373e3;});})[_0xf46c('0x1f')](function(){_0x3af83d[_0xf46c('0x18')](0xcc)[_0xf46c('0x24')]();});}};}function handleEntityNotFound(_0x1454be,_0x2daf68){return function(_0x371123){if(!_0x371123){_0x1454be[_0xf46c('0x17')](0x194);}return _0x371123;};}function handleError(_0x4cb023,_0x22722f){_0x22722f=_0x22722f||0x1f4;return function(_0x596dc7){logger[_0xf46c('0x25')](_0x596dc7['stack']);if(_0x596dc7[_0xf46c('0x26')]){delete _0x596dc7[_0xf46c('0x26')];}_0x4cb023[_0xf46c('0x18')](_0x22722f)[_0xf46c('0x27')](_0x596dc7);};}exports[_0xf46c('0x28')]=function(_0x2b2058,_0x1e2c8e){var _0x5306c8={},_0x1316b9={},_0x5bc1fa={'count':0x0,'rows':[]};var _0x34a479=_[_0xf46c('0x29')](db['Tag'][_0xf46c('0x2a')],function(_0x247d4c){return{'name':_0x247d4c[_0xf46c('0x2b')],'type':_0x247d4c[_0xf46c('0x2c')][_0xf46c('0x2d')]};});_0x1316b9[_0xf46c('0x2e')]=_[_0xf46c('0x29')](_0x34a479,_0xf46c('0x26'));_0x1316b9[_0xf46c('0x2f')]=_[_0xf46c('0x30')](_0x2b2058[_0xf46c('0x2f')]);_0x1316b9[_0xf46c('0x31')]=_[_0xf46c('0x32')](_0x1316b9['model'],_0x1316b9[_0xf46c('0x2f')]);_0x5306c8[_0xf46c('0x33')]=_[_0xf46c('0x32')](_0x1316b9[_0xf46c('0x2e')],qs[_0xf46c('0x34')](_0x2b2058[_0xf46c('0x2f')][_0xf46c('0x34')]));_0x5306c8[_0xf46c('0x33')]=_0x5306c8[_0xf46c('0x33')][_0xf46c('0x35')]?_0x5306c8[_0xf46c('0x33')]:_0x1316b9[_0xf46c('0x2e')];if(!_0x2b2058['query'][_0xf46c('0x36')](_0xf46c('0x37'))){_0x5306c8['limit']=qs['limit'](_0x2b2058[_0xf46c('0x2f')]['limit']);_0x5306c8[_0xf46c('0x19')]=qs[_0xf46c('0x19')](_0x2b2058['query'][_0xf46c('0x19')]);}_0x5306c8[_0xf46c('0x38')]=qs[_0xf46c('0x39')](_0x2b2058[_0xf46c('0x2f')][_0xf46c('0x39')]);_0x5306c8[_0xf46c('0x3a')]=qs['filters'](_[_0xf46c('0x3b')](_0x2b2058[_0xf46c('0x2f')],_0x1316b9[_0xf46c('0x31')]));if(_0x2b2058['query'][_0xf46c('0x3c')]){_0x5306c8[_0xf46c('0x3a')]=_['merge'](_0x5306c8[_0xf46c('0x3a')],{'$or':_[_0xf46c('0x29')](_0x34a479,function(_0x3b09f9){if(_0x3b09f9['type']!=='VIRTUAL'){var _0x102764={};_0x102764[_0x3b09f9['name']]={'$like':'%'+_0x2b2058[_0xf46c('0x2f')]['filter']+'%'};return _0x102764;}})});}_0x5306c8=_[_0xf46c('0x3d')]({},_0x5306c8,_0x2b2058[_0xf46c('0x3e')]);var _0x20c4fb={'where':_0x5306c8[_0xf46c('0x3a')]};return db[_0xf46c('0x3f')][_0xf46c('0x40')](_0x20c4fb)[_0xf46c('0x1f')](function(_0x5b028d){_0x5bc1fa[_0xf46c('0x40')]=_0x5b028d;if(_0x2b2058[_0xf46c('0x2f')][_0xf46c('0x41')]){_0x5306c8[_0xf46c('0x42')]=[{'all':!![]}];}return db[_0xf46c('0x3f')][_0xf46c('0x43')](_0x5306c8);})['then'](function(_0x151c4f){_0x5bc1fa[_0xf46c('0x44')]=_0x151c4f;return _0x5bc1fa;})[_0xf46c('0x1f')](respondWithFilteredResult(_0x1e2c8e,_0x5306c8))['catch'](handleError(_0x1e2c8e,null));};exports['show']=function(_0x3db524,_0x39e58d){var _0x537837={'raw':!![],'where':{'id':_0x3db524[_0xf46c('0x45')]['id']}},_0x48fbef={};_0x48fbef[_0xf46c('0x2e')]=_[_0xf46c('0x30')](db['Tag'][_0xf46c('0x2a')]);_0x48fbef[_0xf46c('0x2f')]=_[_0xf46c('0x30')](_0x3db524[_0xf46c('0x2f')]);_0x48fbef[_0xf46c('0x31')]=_[_0xf46c('0x32')](_0x48fbef[_0xf46c('0x2e')],_0x48fbef[_0xf46c('0x2f')]);_0x537837['attributes']=_[_0xf46c('0x32')](_0x48fbef[_0xf46c('0x2e')],qs[_0xf46c('0x34')](_0x3db524[_0xf46c('0x2f')][_0xf46c('0x34')]));_0x537837[_0xf46c('0x33')]=_0x537837[_0xf46c('0x33')]['length']?_0x537837[_0xf46c('0x33')]:_0x48fbef['model'];if(_0x3db524[_0xf46c('0x2f')][_0xf46c('0x41')]){_0x537837[_0xf46c('0x42')]=[{'all':!![]}];}_0x537837=_['merge']({},_0x537837,_0x3db524[_0xf46c('0x3e')]);return db[_0xf46c('0x3f')]['find'](_0x537837)['then'](handleEntityNotFound(_0x39e58d,null))[_0xf46c('0x1f')](respondWithResult(_0x39e58d,null))[_0xf46c('0x46')](handleError(_0x39e58d,null));};exports[_0xf46c('0x47')]=function(_0x2f6c05,_0x546be8){return db[_0xf46c('0x3f')][_0xf46c('0x47')](_0x2f6c05['body'],{})[_0xf46c('0x1f')](function(_0x3032d7){var _0x5b944d=_0x2f6c05['user']['get']({'plain':!![]});if(!_0x5b944d)throw new Error(_0xf46c('0x48'));if(_0x5b944d[_0xf46c('0x49')]===_0xf46c('0x4a')){var _0x1b30e8=_0x3032d7[_0xf46c('0x20')]({'plain':!![]});var _0x36df4e=_0xf46c('0x21');return db['UserProfileSection'][_0xf46c('0x4b')]({'where':{'name':_0x36df4e,'userProfileId':_0x5b944d['userProfileId']},'raw':!![]})[_0xf46c('0x1f')](function(_0x48bc4f){if(_0x48bc4f&&_0x48bc4f[_0xf46c('0x4c')]===0x0){return db[_0xf46c('0x22')]['create']({'name':_0x1b30e8[_0xf46c('0x26')],'resourceId':_0x1b30e8['id'],'type':_0x48bc4f['name'],'sectionId':_0x48bc4f['id']},{})['then'](function(){return _0x3032d7;});}else{return _0x3032d7;}})[_0xf46c('0x46')](function(_0x16dfcb){logger[_0xf46c('0x25')](_0xf46c('0x4d'),_0x16dfcb);throw _0x16dfcb;});}return _0x3032d7;})[_0xf46c('0x1f')](respondWithResult(_0x546be8,0xc9))[_0xf46c('0x46')](handleError(_0x546be8,null));};exports[_0xf46c('0x4e')]=function(_0x3745b6,_0x2ebaf6){if(_0x3745b6['body']['id']){delete _0x3745b6[_0xf46c('0x4f')]['id'];}return db[_0xf46c('0x3f')][_0xf46c('0x4b')]({'where':{'id':_0x3745b6[_0xf46c('0x45')]['id']}})[_0xf46c('0x1f')](handleEntityNotFound(_0x2ebaf6,null))['then'](saveUpdates(_0x3745b6[_0xf46c('0x4f')],null))[_0xf46c('0x1f')](respondWithResult(_0x2ebaf6,null))[_0xf46c('0x46')](handleError(_0x2ebaf6,null));};exports[_0xf46c('0x23')]=function(_0x1466db,_0x4f29e9){return db[_0xf46c('0x3f')][_0xf46c('0x4b')]({'where':{'id':_0x1466db[_0xf46c('0x45')]['id']}})[_0xf46c('0x1f')](handleEntityNotFound(_0x4f29e9,null))[_0xf46c('0x1f')](removeEntity(_0x4f29e9,null))[_0xf46c('0x46')](handleError(_0x4f29e9,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index ac10391..fe825a4 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 _0xa6f9=['Tag','tools_tags','util','../../config/logger','api','bluebird','../../config/environment','define'];(function(_0x37e59a,_0xa91da2){var _0x58541c=function(_0x13301f){while(--_0x13301f){_0x37e59a['push'](_0x37e59a['shift']());}};_0x58541c(++_0xa91da2);}(_0xa6f9,0x11a));var _0x9a6f=function(_0x25138f,_0x236b7d){_0x25138f=_0x25138f-0x0;var _0x404e4d=_0xa6f9[_0x25138f];return _0x404e4d;};'use strict';var _=require('lodash');var util=require(_0x9a6f('0x0'));var logger=require(_0x9a6f('0x1'))(_0x9a6f('0x2'));var moment=require('moment');var BPromise=require(_0x9a6f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9a6f('0x4'));var attributes=require('./tag.attributes');module['exports']=function(_0x3261f7,_0x30d9a7){return _0x3261f7[_0x9a6f('0x5')](_0x9a6f('0x6'),attributes,{'tableName':_0x9a6f('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4e7b=['exports','define','Tag','lodash','util','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x35df44,_0x5b1082){var _0x3dcfb0=function(_0x48181f){while(--_0x48181f){_0x35df44['push'](_0x35df44['shift']());}};_0x3dcfb0(++_0x5b1082);}(_0x4e7b,0xf3));var _0xb4e7=function(_0x59db48,_0xe2798){_0x59db48=_0x59db48-0x0;var _0xe15da0=_0x4e7b[_0x59db48];return _0xe15da0;};'use strict';var _=require(_0xb4e7('0x0'));var util=require(_0xb4e7('0x1'));var logger=require('../../config/logger')(_0xb4e7('0x2'));var moment=require('moment');var BPromise=require(_0xb4e7('0x3'));var rp=require(_0xb4e7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb4e7('0x5'));var config=require(_0xb4e7('0x6'));var attributes=require('./tag.attributes');module[_0xb4e7('0x7')]=function(_0x3351aa,_0x271dbf){return _0x3351aa[_0xb4e7('0x8')](_0xb4e7('0x9'),attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index d137e6d..c917547 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 _0xde2c=['Tag,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','Tag,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x371ae2,_0x3c0d56){var _0x5a10a0=function(_0x32e1a2){while(--_0x32e1a2){_0x371ae2['push'](_0x371ae2['shift']());}};_0x5a10a0(++_0x3c0d56);}(_0xde2c,0x7f));var _0xcde2=function(_0x2892da,_0x191a40){_0x2892da=_0x2892da-0x0;var _0x28cff2=_0xde2c[_0x2892da];return _0x28cff2;};'use strict';var _=require(_0xcde2('0x0'));var util=require(_0xcde2('0x1'));var moment=require(_0xcde2('0x2'));var BPromise=require(_0xcde2('0x3'));var rs=require(_0xcde2('0x4'));var fs=require('fs');var Redis=require(_0xcde2('0x5'));var db=require(_0xcde2('0x6'))['db'];var utils=require(_0xcde2('0x7'));var logger=require('../../config/logger')(_0xcde2('0x8'));var config=require(_0xcde2('0x9'));var jayson=require(_0xcde2('0xa'));var client=jayson[_0xcde2('0xb')][_0xcde2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x53c558,_0x2b27ef,_0x385e83){return new BPromise(function(_0x9c7036,_0x544235){return client['request'](_0x53c558,_0x385e83)[_0xcde2('0xd')](function(_0x1c8b3c){logger['info'](_0xcde2('0xe'),_0x2b27ef,_0xcde2('0xf'));logger[_0xcde2('0x10')](_0xcde2('0x11'),_0x2b27ef,'request\x20sent',JSON['stringify'](_0x1c8b3c));if(_0x1c8b3c[_0xcde2('0x12')]){if(_0x1c8b3c[_0xcde2('0x12')][_0xcde2('0x13')]===0x1f4){logger[_0xcde2('0x12')](_0xcde2('0xe'),_0x2b27ef,_0x1c8b3c[_0xcde2('0x12')]['message']);return _0x544235(_0x1c8b3c[_0xcde2('0x12')]['message']);}logger[_0xcde2('0x12')]('Tag,\x20%s,\x20%s',_0x2b27ef,_0x1c8b3c['error'][_0xcde2('0x14')]);return _0x9c7036(_0x1c8b3c[_0xcde2('0x12')][_0xcde2('0x14')]);}else{logger[_0xcde2('0x15')](_0xcde2('0xe'),_0x2b27ef,'request\x20sent');_0x9c7036(_0x1c8b3c[_0xcde2('0x16')]['message']);}})[_0xcde2('0x17')](function(_0x198840){logger[_0xcde2('0x12')](_0xcde2('0xe'),_0x2b27ef,_0x198840);_0x544235(_0x198840);});});} \ No newline at end of file +var _0x4fdb=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','then','info','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','Tag,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x1bad8a,_0x4a160f){var _0xfa3b6b=function(_0x1abb3a){while(--_0x1abb3a){_0x1bad8a['push'](_0x1bad8a['shift']());}};_0xfa3b6b(++_0x4a160f);}(_0x4fdb,0x9c));var _0xb4fd=function(_0x1dfbf4,_0x46e1c2){_0x1dfbf4=_0x1dfbf4-0x0;var _0x4cc062=_0x4fdb[_0x1dfbf4];return _0x4cc062;};'use strict';var _=require(_0xb4fd('0x0'));var util=require(_0xb4fd('0x1'));var moment=require(_0xb4fd('0x2'));var BPromise=require(_0xb4fd('0x3'));var rs=require(_0xb4fd('0x4'));var fs=require('fs');var Redis=require(_0xb4fd('0x5'));var db=require(_0xb4fd('0x6'))['db'];var utils=require(_0xb4fd('0x7'));var logger=require(_0xb4fd('0x8'))('rpc');var config=require(_0xb4fd('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb4fd('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53273f,_0x299bff,_0x3af8e3){return new BPromise(function(_0x1151b5,_0x52dca2){return client['request'](_0x53273f,_0x3af8e3)[_0xb4fd('0xb')](function(_0x4f9d18){logger[_0xb4fd('0xc')]('Tag,\x20%s,\x20%s',_0x299bff,_0xb4fd('0xd'));logger[_0xb4fd('0xe')](_0xb4fd('0xf'),_0x299bff,_0xb4fd('0xd'),JSON[_0xb4fd('0x10')](_0x4f9d18));if(_0x4f9d18['error']){if(_0x4f9d18[_0xb4fd('0x11')][_0xb4fd('0x12')]===0x1f4){logger[_0xb4fd('0x11')](_0xb4fd('0x13'),_0x299bff,_0x4f9d18['error'][_0xb4fd('0x14')]);return _0x52dca2(_0x4f9d18[_0xb4fd('0x11')][_0xb4fd('0x14')]);}logger['error'](_0xb4fd('0x13'),_0x299bff,_0x4f9d18[_0xb4fd('0x11')][_0xb4fd('0x14')]);return _0x1151b5(_0x4f9d18[_0xb4fd('0x11')][_0xb4fd('0x14')]);}else{logger[_0xb4fd('0xc')](_0xb4fd('0x13'),_0x299bff,'request\x20sent');_0x1151b5(_0x4f9d18[_0xb4fd('0x15')][_0xb4fd('0x14')]);}})[_0xb4fd('0x16')](function(_0x2d4701){logger[_0xb4fd('0x11')](_0xb4fd('0x13'),_0x299bff,_0x2d4701);_0x52dca2(_0x2d4701);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 531bd54..1c74cc0 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 _0x9dc1=['../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','isAuthenticated','index','/:id','show','/:id/queues','getQueues','/:id/users','getAgents','post','create','addQueues','addAgents','update','delete','destroy','removeAgents','path','connect-timeout','express','Router'];(function(_0x284a9b,_0x553238){var _0x412146=function(_0x5e8c3f){while(--_0x5e8c3f){_0x284a9b['push'](_0x284a9b['shift']());}};_0x412146(++_0x553238);}(_0x9dc1,0x79));var _0x19dc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9dc1[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x19dc('0x0'));var timeout=require(_0x19dc('0x1'));var express=require(_0x19dc('0x2'));var router=express[_0x19dc('0x3')]();var auth=require(_0x19dc('0x4'));var interaction=require(_0x19dc('0x5'));var config=require(_0x19dc('0x6'));var controller=require(_0x19dc('0x7'));router[_0x19dc('0x8')]('/',auth[_0x19dc('0x9')](),controller[_0x19dc('0xa')]);router['get'](_0x19dc('0xb'),auth[_0x19dc('0x9')](),controller[_0x19dc('0xc')]);router[_0x19dc('0x8')](_0x19dc('0xd'),auth['isAuthenticated'](),controller[_0x19dc('0xe')]);router[_0x19dc('0x8')](_0x19dc('0xf'),auth['isAuthenticated'](),controller[_0x19dc('0x10')]);router[_0x19dc('0x11')]('/',auth[_0x19dc('0x9')](),controller[_0x19dc('0x12')]);router[_0x19dc('0x11')]('/:id/queues',auth[_0x19dc('0x9')](),controller[_0x19dc('0x13')]);router[_0x19dc('0x11')](_0x19dc('0xf'),auth['isAuthenticated'](),controller[_0x19dc('0x14')]);router['put'](_0x19dc('0xb'),auth['isAuthenticated'](),controller[_0x19dc('0x15')]);router[_0x19dc('0x16')](_0x19dc('0xb'),auth['isAuthenticated'](),controller[_0x19dc('0x17')]);router[_0x19dc('0x16')](_0x19dc('0xd'),auth['isAuthenticated'](),controller['removeQueues']);router[_0x19dc('0x16')](_0x19dc('0xf'),auth[_0x19dc('0x9')](),controller[_0x19dc('0x18')]);module['exports']=router; \ No newline at end of file +var _0x605d=['delete','removeQueues','removeAgents','exports','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./team.controller','get','index','isAuthenticated','/:id/queues','getQueues','getAgents','post','create','addQueues','/:id/users','addAgents','put','/:id','update'];(function(_0x304135,_0x2a7145){var _0x2f8030=function(_0x5099f6){while(--_0x5099f6){_0x304135['push'](_0x304135['shift']());}};_0x2f8030(++_0x2a7145);}(_0x605d,0x68));var _0xd605=function(_0xe2b013,_0x5790ce){_0xe2b013=_0xe2b013-0x0;var _0x37e2cc=_0x605d[_0xe2b013];return _0x37e2cc;};'use strict';var multer=require('multer');var util=require(_0xd605('0x0'));var path=require('path');var timeout=require(_0xd605('0x1'));var express=require(_0xd605('0x2'));var router=express[_0xd605('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xd605('0x4'));var config=require(_0xd605('0x5'));var controller=require(_0xd605('0x6'));router[_0xd605('0x7')]('/',auth['isAuthenticated'](),controller[_0xd605('0x8')]);router[_0xd605('0x7')]('/:id',auth[_0xd605('0x9')](),controller['show']);router[_0xd605('0x7')](_0xd605('0xa'),auth[_0xd605('0x9')](),controller[_0xd605('0xb')]);router[_0xd605('0x7')]('/:id/users',auth[_0xd605('0x9')](),controller[_0xd605('0xc')]);router[_0xd605('0xd')]('/',auth['isAuthenticated'](),controller[_0xd605('0xe')]);router[_0xd605('0xd')](_0xd605('0xa'),auth[_0xd605('0x9')](),controller[_0xd605('0xf')]);router['post'](_0xd605('0x10'),auth[_0xd605('0x9')](),controller[_0xd605('0x11')]);router[_0xd605('0x12')](_0xd605('0x13'),auth[_0xd605('0x9')](),controller[_0xd605('0x14')]);router[_0xd605('0x15')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0xd605('0x15')](_0xd605('0xa'),auth[_0xd605('0x9')](),controller[_0xd605('0x16')]);router[_0xd605('0x15')](_0xd605('0x10'),auth[_0xd605('0x9')](),controller[_0xd605('0x17')]);module[_0xd605('0x18')]=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index 64bc635..25620c0 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 _0x4aa7=['name','exports','STRING'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x4aa7,0x11e));var _0x74aa=function(_0x51a164,_0x4e6fb0){_0x51a164=_0x51a164-0x0;var _0x4ac595=_0x4aa7[_0x51a164];return _0x4ac595;};'use strict';var Sequelize=require('sequelize');module[_0x74aa('0x0')]={'name':{'type':Sequelize[_0x74aa('0x1')],'allowNull':![],'unique':_0x74aa('0x2')},'description':{'type':Sequelize[_0x74aa('0x1')]}}; \ No newline at end of file +var _0x0926=['sequelize','exports','name','STRING'];(function(_0x4ccb4b,_0x18347e){var _0x25817f=function(_0x2594ff){while(--_0x2594ff){_0x4ccb4b['push'](_0x4ccb4b['shift']());}};_0x25817f(++_0x18347e);}(_0x0926,0x68));var _0x6092=function(_0x548627,_0x4ec392){_0x548627=_0x548627-0x0;var _0x844a84=_0x0926[_0x548627];return _0x844a84;};'use strict';var Sequelize=require(_0x6092('0x0'));module[_0x6092('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6092('0x2')},'description':{'type':Sequelize[_0x6092('0x3')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 48cdbf0..385fd7b 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 _0x1410=['Sequelize','ValidationError','capitalize','toLowerCase','pick','Queues','addQueues','findOne','Unknown\x20channel','ids','removeQueues','remove','Voice','Chat','Mail','Sms','Fax','Openchannel','each','addAgents','voicePause','interface','upsert','isNil','format','SIP/%s','omit','spread','emit','userTeam:save','removeAgents','voice','chat','mail','fax','UserVoiceQueueRt','isArray','userTeam:remove','getAgents','User','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./team.socket','register','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','save','update','then','destroy','get','Teams','UserProfileResource','error','stack','name','send','index','map','Team','rawAttributes','fieldName','key','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','findAll','rows','catch','show','params','keys','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','getQueues','channel','isValidChannel'];(function(_0x2e5c72,_0x393efa){var _0x17071f=function(_0x1be8de){while(--_0x1be8de){_0x2e5c72['push'](_0x2e5c72['shift']());}};_0x17071f(++_0x393efa);}(_0x1410,0x130));var _0x0141=function(_0x38e6cd,_0x32637b){_0x38e6cd=_0x38e6cd-0x0;var _0x2fa526=_0x1410[_0x38e6cd];return _0x2fa526;};'use strict';var pdf=require(_0x0141('0x0'));var emlformat=require(_0x0141('0x1'));var rimraf=require(_0x0141('0x2'));var zipdir=require(_0x0141('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0141('0x4'));var moment=require('moment');var BPromise=require(_0x0141('0x5'));var Mustache=require('mustache');var util=require(_0x0141('0x6'));var path=require(_0x0141('0x7'));var sox=require(_0x0141('0x8'));var csv=require(_0x0141('0x9'));var ejs=require(_0x0141('0xa'));var fs=require('fs');var _=require(_0x0141('0xb'));var squel=require(_0x0141('0xc'));var crypto=require(_0x0141('0xd'));var jsforce=require(_0x0141('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0141('0x9'));var querystring=require(_0x0141('0xf'));var Papa=require(_0x0141('0x10'));var Redis=require(_0x0141('0x11'));var authService=require(_0x0141('0x12'));var qs=require(_0x0141('0x13'));var as=require(_0x0141('0x14'));var hardwareService=require(_0x0141('0x15'));var logger=require('../../config/logger')(_0x0141('0x16'));var utils=require(_0x0141('0x17'));var config=require(_0x0141('0x18'));var db=require(_0x0141('0x19'))['db'];config['redis']=_['defaults'](config[_0x0141('0x1a')],{'host':_0x0141('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0141('0x1a')]));require(_0x0141('0x1c'))[_0x0141('0x1d')](socket);function respondWithStatusCode(_0x245007,_0x1665e2){_0x1665e2=_0x1665e2||0xcc;return function(_0x51a855){if(_0x51a855){return _0x245007[_0x0141('0x1e')](_0x1665e2);}return _0x245007['status'](_0x1665e2)[_0x0141('0x1f')]();};}function respondWithResult(_0x3db66a,_0x345fbd){_0x345fbd=_0x345fbd||0xc8;return function(_0x310e2b){if(_0x310e2b){return _0x3db66a[_0x0141('0x20')](_0x345fbd)[_0x0141('0x21')](_0x310e2b);}};}function respondWithFilteredResult(_0x5274ab,_0x58c3bb){return function(_0x1b48c7){if(_0x1b48c7){var _0x3720f6=_0x1b48c7[_0x0141('0x22')],_0x4f9945=_0x58c3bb[_0x0141('0x23')],_0x9c1eec=_0x58c3bb['offset']+_0x58c3bb[_0x0141('0x24')],_0x18808d;if(_0x9c1eec>=_0x3720f6){_0x9c1eec=_0x3720f6;_0x18808d=0xc8;}else{_0x18808d=0xce;}_0x5274ab[_0x0141('0x20')](_0x18808d);return _0x5274ab['set'](_0x0141('0x25'),_0x4f9945+'-'+_0x9c1eec+'/'+_0x3720f6)[_0x0141('0x21')](_0x1b48c7);}return null;};}function patchUpdates(_0x17585f){return function(_0x30a141){try{jsonpatch[_0x0141('0x26')](_0x30a141,_0x17585f,!![]);}catch(_0x13ac96){return BPromise['reject'](_0x13ac96);}return _0x30a141[_0x0141('0x27')]();};}function saveUpdates(_0x40c774,_0x363860){return function(_0x239ea2){if(_0x239ea2){return _0x239ea2[_0x0141('0x28')](_0x40c774)[_0x0141('0x29')](function(_0xccf0c){return _0xccf0c;});}return null;};}function removeEntity(_0x20656b,_0x12a11e){return function(_0x3869b7){if(_0x3869b7){return _0x3869b7[_0x0141('0x2a')]()[_0x0141('0x29')](function(){var _0x59bdbd=_0x3869b7[_0x0141('0x2b')]({'plain':!![]});var _0x14ecbf=_0x0141('0x2c');return db[_0x0141('0x2d')][_0x0141('0x2a')]({'where':{'type':_0x14ecbf,'resourceId':_0x59bdbd['id']}})['then'](function(){return _0x3869b7;});})[_0x0141('0x29')](function(){_0x20656b[_0x0141('0x20')](0xcc)[_0x0141('0x1f')]();});}};}function handleEntityNotFound(_0x4a82a6,_0x29bec2){return function(_0x4d1cb3){if(!_0x4d1cb3){_0x4a82a6[_0x0141('0x1e')](0x194);}return _0x4d1cb3;};}function handleError(_0x13d8d1,_0x400602){_0x400602=_0x400602||0x1f4;return function(_0x378a87){logger[_0x0141('0x2e')](_0x378a87[_0x0141('0x2f')]);if(_0x378a87[_0x0141('0x30')]){delete _0x378a87[_0x0141('0x30')];}_0x13d8d1[_0x0141('0x20')](_0x400602)[_0x0141('0x31')](_0x378a87);};}exports[_0x0141('0x32')]=function(_0x36c409,_0x19f25f){var _0x48e025={},_0x4201ae={},_0x555294={'count':0x0,'rows':[]};var _0x4388ea=_[_0x0141('0x33')](db[_0x0141('0x34')][_0x0141('0x35')],function(_0x453d12){return{'name':_0x453d12[_0x0141('0x36')],'type':_0x453d12['type'][_0x0141('0x37')]};});_0x4201ae['model']=_[_0x0141('0x33')](_0x4388ea,_0x0141('0x30'));_0x4201ae[_0x0141('0x38')]=_['keys'](_0x36c409[_0x0141('0x38')]);_0x4201ae[_0x0141('0x39')]=_['intersection'](_0x4201ae[_0x0141('0x3a')],_0x4201ae[_0x0141('0x38')]);_0x48e025[_0x0141('0x3b')]=_[_0x0141('0x3c')](_0x4201ae[_0x0141('0x3a')],qs['fields'](_0x36c409[_0x0141('0x38')][_0x0141('0x3d')]));_0x48e025[_0x0141('0x3b')]=_0x48e025[_0x0141('0x3b')][_0x0141('0x3e')]?_0x48e025[_0x0141('0x3b')]:_0x4201ae['model'];if(!_0x36c409['query'][_0x0141('0x3f')](_0x0141('0x40'))){_0x48e025['limit']=qs[_0x0141('0x24')](_0x36c409[_0x0141('0x38')][_0x0141('0x24')]);_0x48e025['offset']=qs['offset'](_0x36c409['query'][_0x0141('0x23')]);}_0x48e025[_0x0141('0x41')]=qs[_0x0141('0x42')](_0x36c409[_0x0141('0x38')][_0x0141('0x42')]);_0x48e025[_0x0141('0x43')]=qs[_0x0141('0x39')](_['pick'](_0x36c409[_0x0141('0x38')],_0x4201ae[_0x0141('0x39')]));if(_0x36c409['query'][_0x0141('0x44')]){_0x48e025[_0x0141('0x43')]=_[_0x0141('0x45')](_0x48e025[_0x0141('0x43')],{'$or':_[_0x0141('0x33')](_0x4388ea,function(_0x158480){if(_0x158480[_0x0141('0x46')]!==_0x0141('0x47')){var _0x50d933={};_0x50d933[_0x158480[_0x0141('0x30')]]={'$like':'%'+_0x36c409[_0x0141('0x38')]['filter']+'%'};return _0x50d933;}})});}_0x48e025=_[_0x0141('0x45')]({},_0x48e025,_0x36c409[_0x0141('0x48')]);var _0x321f83={'where':_0x48e025[_0x0141('0x43')]};return db[_0x0141('0x34')]['count'](_0x321f83)[_0x0141('0x29')](function(_0x56ac88){_0x555294[_0x0141('0x22')]=_0x56ac88;if(_0x36c409['query']['includeAll']){_0x48e025['include']=[{'all':!![]}];}return db[_0x0141('0x34')][_0x0141('0x49')](_0x48e025);})[_0x0141('0x29')](function(_0x5dfd8a){_0x555294[_0x0141('0x4a')]=_0x5dfd8a;return _0x555294;})[_0x0141('0x29')](respondWithFilteredResult(_0x19f25f,_0x48e025))[_0x0141('0x4b')](handleError(_0x19f25f,null));};exports[_0x0141('0x4c')]=function(_0x4c64bf,_0x3caba9){var _0x268d2a={'raw':![],'where':{'id':_0x4c64bf[_0x0141('0x4d')]['id']}},_0x3195bc={};_0x3195bc[_0x0141('0x3a')]=_[_0x0141('0x4e')](db[_0x0141('0x34')][_0x0141('0x35')]);_0x3195bc['query']=_[_0x0141('0x4e')](_0x4c64bf[_0x0141('0x38')]);_0x3195bc[_0x0141('0x39')]=_['intersection'](_0x3195bc[_0x0141('0x3a')],_0x3195bc[_0x0141('0x38')]);_0x268d2a[_0x0141('0x3b')]=_['intersection'](_0x3195bc[_0x0141('0x3a')],qs['fields'](_0x4c64bf[_0x0141('0x38')]['fields']));_0x268d2a[_0x0141('0x3b')]=_0x268d2a['attributes'][_0x0141('0x3e')]?_0x268d2a[_0x0141('0x3b')]:_0x3195bc[_0x0141('0x3a')];if(_0x4c64bf[_0x0141('0x38')][_0x0141('0x4f')]){_0x268d2a['include']=[{'all':!![]}];}_0x268d2a=_[_0x0141('0x45')]({},_0x268d2a,_0x4c64bf[_0x0141('0x48')]);return db[_0x0141('0x34')]['find'](_0x268d2a)[_0x0141('0x29')](handleEntityNotFound(_0x3caba9,null))[_0x0141('0x29')](respondWithResult(_0x3caba9,null))[_0x0141('0x4b')](handleError(_0x3caba9,null));};exports['create']=function(_0x3e30a8,_0x5e983a){return db[_0x0141('0x34')][_0x0141('0x50')](_0x3e30a8[_0x0141('0x51')],{})[_0x0141('0x29')](function(_0x5c8f64){var _0x28d638=_0x3e30a8[_0x0141('0x52')][_0x0141('0x2b')]({'plain':!![]});if(!_0x28d638)throw new Error(_0x0141('0x53'));if(_0x28d638[_0x0141('0x54')]===_0x0141('0x52')){var _0x4a37d3=_0x5c8f64['get']({'plain':!![]});var _0x285807=_0x0141('0x2c');return db[_0x0141('0x55')]['find']({'where':{'name':_0x285807,'userProfileId':_0x28d638[_0x0141('0x56')]},'raw':!![]})[_0x0141('0x29')](function(_0x1a4217){if(_0x1a4217&&_0x1a4217['autoAssociation']===0x0){return db[_0x0141('0x2d')]['create']({'name':_0x4a37d3[_0x0141('0x30')],'resourceId':_0x4a37d3['id'],'type':_0x1a4217[_0x0141('0x30')],'sectionId':_0x1a4217['id']},{})[_0x0141('0x29')](function(){return _0x5c8f64;});}else{return _0x5c8f64;}})[_0x0141('0x4b')](function(_0x1ccb50){logger[_0x0141('0x2e')](_0x0141('0x57'),_0x1ccb50);throw _0x1ccb50;});}return _0x5c8f64;})[_0x0141('0x29')](respondWithResult(_0x5e983a,0xc9))[_0x0141('0x4b')](handleError(_0x5e983a,null));};exports[_0x0141('0x28')]=function(_0xb16c00,_0x53b31f){if(_0xb16c00[_0x0141('0x51')]['id']){delete _0xb16c00[_0x0141('0x51')]['id'];}return db[_0x0141('0x34')][_0x0141('0x58')]({'where':{'id':_0xb16c00['params']['id']}})[_0x0141('0x29')](handleEntityNotFound(_0x53b31f,null))[_0x0141('0x29')](saveUpdates(_0xb16c00[_0x0141('0x51')],null))[_0x0141('0x29')](respondWithResult(_0x53b31f,null))[_0x0141('0x4b')](handleError(_0x53b31f,null));};exports[_0x0141('0x2a')]=function(_0x5f4a03,_0x258b2a){return db['Team'][_0x0141('0x58')]({'where':{'id':_0x5f4a03[_0x0141('0x4d')]['id']}})[_0x0141('0x29')](handleEntityNotFound(_0x258b2a,null))[_0x0141('0x29')](removeEntity(_0x258b2a,null))[_0x0141('0x4b')](handleError(_0x258b2a,null));};exports[_0x0141('0x59')]=function(_0x38557d,_0x4d515e,_0x55272c){return db[_0x0141('0x34')]['findOne']({'where':{'id':_0x38557d['params']['id']}})[_0x0141('0x29')](handleEntityNotFound(_0x4d515e,null))[_0x0141('0x29')](function(_0x2c611c){if(!_0x38557d[_0x0141('0x38')][_0x0141('0x5a')]||!utils[_0x0141('0x5b')](_0x38557d[_0x0141('0x38')][_0x0141('0x5a')])){throw new db[(_0x0141('0x5c'))][(_0x0141('0x5d'))]('Unknown\x20channel');}var _0x2ec121={};var _0x25017c={};_0x25017c[_0x0141('0x3a')]=_[_0x0141('0x4e')](db[_[_0x0141('0x5e')](_0x38557d[_0x0141('0x38')][_0x0141('0x5a')][_0x0141('0x5f')]())+'Queue'][_0x0141('0x35')]);_0x25017c[_0x0141('0x38')]=_[_0x0141('0x4e')](_0x38557d[_0x0141('0x38')]);_0x25017c[_0x0141('0x39')]=_['intersection'](_0x25017c['model'],_0x25017c[_0x0141('0x38')]);_0x2ec121[_0x0141('0x3b')]=_[_0x0141('0x3c')](_0x25017c[_0x0141('0x3a')],qs[_0x0141('0x3d')](_0x38557d['query'][_0x0141('0x3d')]));_0x2ec121[_0x0141('0x3b')]=_0x2ec121[_0x0141('0x3b')][_0x0141('0x3e')]?_0x2ec121[_0x0141('0x3b')]:_0x25017c['model'];_0x2ec121['limit']=qs[_0x0141('0x24')](_0x38557d[_0x0141('0x38')][_0x0141('0x24')]);_0x2ec121[_0x0141('0x23')]=qs['offset'](_0x38557d[_0x0141('0x38')][_0x0141('0x23')]);_0x2ec121[_0x0141('0x41')]=qs[_0x0141('0x42')](_0x38557d[_0x0141('0x38')]['sort']);_0x2ec121[_0x0141('0x43')]=qs[_0x0141('0x39')](_[_0x0141('0x60')](_0x38557d[_0x0141('0x38')],_0x25017c[_0x0141('0x39')]));_0x2ec121=_['merge']({},_0x2ec121,_0x38557d['options']);return _0x2c611c['get'+_[_0x0141('0x5e')](_0x38557d[_0x0141('0x38')][_0x0141('0x5a')]['toLowerCase']())+_0x0141('0x61')](_0x2ec121);})[_0x0141('0x29')](respondWithResult(_0x4d515e,null))[_0x0141('0x4b')](handleError(_0x4d515e,null));};exports[_0x0141('0x62')]=function(_0x396eeb,_0x25cb89,_0x5e3f1c){return db[_0x0141('0x34')][_0x0141('0x63')]({'where':{'id':_0x396eeb[_0x0141('0x4d')]['id']}})[_0x0141('0x29')](function(_0xa4312d){if(_0xa4312d){if(!_0x396eeb[_0x0141('0x51')][_0x0141('0x5a')]||!utils[_0x0141('0x5b')](_0x396eeb['body'][_0x0141('0x5a')])){throw new db[(_0x0141('0x5c'))][(_0x0141('0x5d'))](_0x0141('0x64'));}return _0xa4312d['add'+_['capitalize'](_0x396eeb[_0x0141('0x51')]['channel'][_0x0141('0x5f')]())+'Queues'](_0x396eeb[_0x0141('0x51')][_0x0141('0x65')]);}return null;})[_0x0141('0x29')](handleEntityNotFound(_0x25cb89,null))['then'](respondWithStatusCode(_0x25cb89,null))[_0x0141('0x4b')](handleError(_0x25cb89,null));};exports[_0x0141('0x66')]=function(_0x35f336,_0x4fc114,_0x30d545){return db['Team'][_0x0141('0x63')]({'where':{'id':_0x35f336['params']['id']}})[_0x0141('0x29')](function(_0x521ef5){if(_0x521ef5){if(!_0x35f336[_0x0141('0x38')]['channel']||!utils[_0x0141('0x5b')](_0x35f336[_0x0141('0x38')]['channel'])){throw new db[(_0x0141('0x5c'))]['ValidationError'](_0x0141('0x64'));}return _0x521ef5[_0x0141('0x67')+_[_0x0141('0x5e')](_0x35f336[_0x0141('0x38')][_0x0141('0x5a')][_0x0141('0x5f')]())+_0x0141('0x61')](_0x35f336[_0x0141('0x38')]['ids']);}return null;})['then'](handleEntityNotFound(_0x4fc114,null))[_0x0141('0x29')](respondWithStatusCode(_0x4fc114,null))[_0x0141('0x4b')](handleError(_0x4fc114,null));};exports['addAgents']=function(_0x50ffeb,_0x5174fd,_0x245613){return db[_0x0141('0x34')][_0x0141('0x58')]({'where':{'id':_0x50ffeb[_0x0141('0x4d')]['id']}})[_0x0141('0x29')](handleEntityNotFound(_0x5174fd,null))[_0x0141('0x29')](function(_0x3d85c1){if(_0x3d85c1){var _0x392140=[_0x0141('0x68'),_0x0141('0x69'),_0x0141('0x6a'),_0x0141('0x6b'),_0x0141('0x6c'),_0x0141('0x6d')];return BPromise[_0x0141('0x6e')](_0x392140,function(_0x468bf3){return _0x3d85c1[_0x0141('0x2b')+_0x468bf3+_0x0141('0x61')]({'attributes':['id','name']})[_0x0141('0x29')](function(_0x21ec53){return BPromise[_0x0141('0x6e')](_0x21ec53,function(_0x4a847d){return _0x4a847d[_0x0141('0x6f')](_0x50ffeb[_0x0141('0x51')][_0x0141('0x65')])[_0x0141('0x29')](function(){if(_0x468bf3==='Voice'){return db['User'][_0x0141('0x49')]({'where':{'id':_0x50ffeb[_0x0141('0x51')][_0x0141('0x65')]},'attributes':['id',_0x0141('0x30'),'online',_0x0141('0x70'),_0x0141('0x71')],'raw':!![]})[_0x0141('0x29')](function(_0x4a375c){return BPromise[_0x0141('0x6e')](_[_0x0141('0x44')](_0x4a375c,{'online':0x1}),function(_0x15c75a){return db['UserVoiceQueueRt'][_0x0141('0x72')]({'membername':_0x15c75a[_0x0141('0x30')],'UserId':_0x15c75a['id'],'queue_name':_0x4a847d[_0x0141('0x30')],'VoiceQueueId':_0x4a847d['id'],'interface':_[_0x0141('0x73')](_0x15c75a['interface'])?util[_0x0141('0x74')](_0x0141('0x75'),_0x15c75a[_0x0141('0x30')]):_0x15c75a[_0x0141('0x71')],'paused':_0x15c75a[_0x0141('0x70')]||![],'penalty':0x0});});});}});});})[_0x0141('0x29')](function(){return _0x3d85c1;});})[_0x0141('0x29')](function(){return _0x3d85c1;});}})[_0x0141('0x29')](function(_0x13f1a7){if(_0x13f1a7){return _0x13f1a7['addAgents'](_0x50ffeb[_0x0141('0x51')][_0x0141('0x65')],_[_0x0141('0x76')](_0x50ffeb[_0x0141('0x51')],[_0x0141('0x65'),'id'])||{})[_0x0141('0x77')](function(_0x2ee1b5){for(var _0x27fa5c=0x0;_0x27fa5c<_0x50ffeb['body'][_0x0141('0x65')][_0x0141('0x3e')];_0x27fa5c+=0x1){socket[_0x0141('0x78')](_0x0141('0x79'),{'UserId':_0x50ffeb[_0x0141('0x51')][_0x0141('0x65')][_0x27fa5c],'TeamId':_0x50ffeb[_0x0141('0x4d')]['id']});}return _0x2ee1b5;});}})['then'](respondWithResult(_0x5174fd,null))[_0x0141('0x4b')](handleError(_0x5174fd,null));};exports[_0x0141('0x7a')]=function(_0x33a73d,_0x154b0d,_0xb6e9da){return db[_0x0141('0x34')][_0x0141('0x58')]({'where':{'id':_0x33a73d['params']['id']}})['then'](handleEntityNotFound(_0x154b0d,null))['then'](function(_0x50cdec){if(_0x50cdec){return BPromise[_0x0141('0x6e')]([_0x0141('0x7b'),_0x0141('0x7c'),_0x0141('0x7d'),'sms',_0x0141('0x7e'),'openchannel'],function(_0x4233c8){return _0x50cdec['get'+_[_0x0141('0x5e')](_0x4233c8)+_0x0141('0x61')]({'attributes':['id',_0x0141('0x30')]})['then'](function(_0x539510){return BPromise[_0x0141('0x6e')](_0x539510,function(_0x1446d5){return _0x1446d5['removeAgents'](_0x33a73d[_0x0141('0x38')][_0x0141('0x65')])[_0x0141('0x29')](function(){if(_0x4233c8===_0x0141('0x7b')){return db[_0x0141('0x7f')][_0x0141('0x2a')]({'where':{'VoiceQueueId':_0x1446d5['id'],'UserId':_0x33a73d[_0x0141('0x38')]['ids']}});}});});})[_0x0141('0x29')](function(){return _0x50cdec;});})[_0x0141('0x29')](function(){return _0x50cdec;});}})[_0x0141('0x29')](function(_0x574ce3){if(_0x574ce3){return _0x574ce3[_0x0141('0x7a')](_0x33a73d[_0x0141('0x38')]['ids'])[_0x0141('0x29')](function(){if(_[_0x0141('0x80')](_0x33a73d[_0x0141('0x38')][_0x0141('0x65')])){for(var _0x520185=0x0;_0x520185<_0x33a73d[_0x0141('0x38')]['ids'][_0x0141('0x3e')];_0x520185+=0x1){socket[_0x0141('0x78')]('userTeam:remove',{'UserId':Number(_0x33a73d[_0x0141('0x38')][_0x0141('0x65')][_0x520185]),'TeamId':Number(_0x33a73d[_0x0141('0x4d')]['id'])});}}else{socket[_0x0141('0x78')](_0x0141('0x81'),{'UserId':Number(_0x33a73d[_0x0141('0x38')]['ids']),'TeamId':Number(_0x33a73d['params']['id'])});}});}})[_0x0141('0x29')](respondWithStatusCode(_0x154b0d,null))['catch'](handleError(_0x154b0d,null));};exports[_0x0141('0x82')]=function(_0x3eff9d,_0x57bad6,_0x127dff){var _0x31a079={};var _0x534006={};var _0x131b67;var _0x5558d4;return db[_0x0141('0x34')][_0x0141('0x63')]({'where':{'id':_0x3eff9d[_0x0141('0x4d')]['id']}})[_0x0141('0x29')](handleEntityNotFound(_0x57bad6,null))[_0x0141('0x29')](function(_0x5c7ef0){if(_0x5c7ef0){_0x131b67=_0x5c7ef0;_0x534006[_0x0141('0x3a')]=_[_0x0141('0x4e')](db[_0x0141('0x83')][_0x0141('0x35')]);_0x534006[_0x0141('0x38')]=_['keys'](_0x3eff9d[_0x0141('0x38')]);_0x534006[_0x0141('0x39')]=_[_0x0141('0x3c')](_0x534006[_0x0141('0x3a')],_0x534006[_0x0141('0x38')]);_0x31a079[_0x0141('0x3b')]=_['intersection'](_0x534006['model'],qs['fields'](_0x3eff9d['query'][_0x0141('0x3d')]));_0x31a079[_0x0141('0x3b')]=_0x31a079[_0x0141('0x3b')][_0x0141('0x3e')]?_0x31a079[_0x0141('0x3b')]:_0x534006[_0x0141('0x3a')];_0x31a079[_0x0141('0x41')]=qs[_0x0141('0x42')](_0x3eff9d['query'][_0x0141('0x42')]);_0x31a079[_0x0141('0x43')]=qs[_0x0141('0x39')](_[_0x0141('0x60')](_0x3eff9d['query'],_0x534006['filters']));if(_0x3eff9d[_0x0141('0x38')][_0x0141('0x44')]){_0x31a079[_0x0141('0x43')]=_['merge'](_0x31a079['where'],{'$or':_['map'](_0x31a079[_0x0141('0x3b')],function(_0x3d5058){var _0x5cec9f={};_0x5cec9f[_0x3d5058]={'$like':'%'+_0x3eff9d['query'][_0x0141('0x44')]+'%'};return _0x5cec9f;})});}_0x31a079=_[_0x0141('0x45')]({},_0x31a079,_0x3eff9d[_0x0141('0x48')]);return _0x131b67[_0x0141('0x82')](_0x31a079);}})['then'](function(_0x5d68c4){if(_0x5d68c4){_0x5558d4=_0x5d68c4[_0x0141('0x3e')];if(!_0x3eff9d['query'][_0x0141('0x3f')](_0x0141('0x40'))){_0x31a079[_0x0141('0x24')]=qs[_0x0141('0x24')](_0x3eff9d[_0x0141('0x38')][_0x0141('0x24')]);_0x31a079['offset']=qs[_0x0141('0x23')](_0x3eff9d[_0x0141('0x38')]['offset']);}return _0x131b67[_0x0141('0x82')](_0x31a079);}})[_0x0141('0x29')](function(_0x42323b){if(_0x42323b){return _0x42323b?{'count':_0x5558d4,'rows':_0x42323b}:null;}})[_0x0141('0x29')](respondWithResult(_0x57bad6,null))[_0x0141('0x4b')](handleError(_0x57bad6,null));}; \ No newline at end of file +var _0x3cd0=['emit','userTeam:save','voice','chat','mail','sms','fax','openchannel','removeAgents','UserVoiceQueueRt','userTeam:remove','getAgents','html-pdf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','localhost','./team.socket','sendStatus','status','end','json','offset','limit','Content-Range','apply','save','update','destroy','then','get','error','stack','name','send','index','map','Team','rawAttributes','fieldName','type','key','model','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','query','order','sort','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Teams','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getQueues','channel','isValidChannel','Sequelize','Unknown\x20channel','toLowerCase','Queue','capitalize','Queues','addQueues','findOne','ValidationError','add','ids','remove','Mail','Sms','Openchannel','each','addAgents','User','online','voicePause','interface','isNil','format','omit','spread'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3cd0,0x8a));var _0x03cd=function(_0x31a938,_0x4daec6){_0x31a938=_0x31a938-0x0;var _0x1bf341=_0x3cd0[_0x31a938];return _0x1bf341;};'use strict';var pdf=require(_0x03cd('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x03cd('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x03cd('0x2'));var moment=require(_0x03cd('0x3'));var BPromise=require(_0x03cd('0x4'));var Mustache=require(_0x03cd('0x5'));var util=require(_0x03cd('0x6'));var path=require('path');var sox=require(_0x03cd('0x7'));var csv=require(_0x03cd('0x8'));var ejs=require(_0x03cd('0x9'));var fs=require('fs');var _=require(_0x03cd('0xa'));var squel=require(_0x03cd('0xb'));var crypto=require('crypto');var jsforce=require(_0x03cd('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x03cd('0x8'));var querystring=require(_0x03cd('0xd'));var Papa=require(_0x03cd('0xe'));var Redis=require(_0x03cd('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x03cd('0x10'));var as=require(_0x03cd('0x11'));var hardwareService=require(_0x03cd('0x12'));var logger=require(_0x03cd('0x13'))(_0x03cd('0x14'));var utils=require(_0x03cd('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x03cd('0x16')]=_[_0x03cd('0x17')](config[_0x03cd('0x16')],{'host':_0x03cd('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x03cd('0x16')]));require(_0x03cd('0x19'))['register'](socket);function respondWithStatusCode(_0x4f8f17,_0x58c000){_0x58c000=_0x58c000||0xcc;return function(_0x119915){if(_0x119915){return _0x4f8f17[_0x03cd('0x1a')](_0x58c000);}return _0x4f8f17[_0x03cd('0x1b')](_0x58c000)[_0x03cd('0x1c')]();};}function respondWithResult(_0x526102,_0xdf7488){_0xdf7488=_0xdf7488||0xc8;return function(_0x486580){if(_0x486580){return _0x526102[_0x03cd('0x1b')](_0xdf7488)[_0x03cd('0x1d')](_0x486580);}};}function respondWithFilteredResult(_0x1b6fa5,_0x5ac997){return function(_0x39733a){if(_0x39733a){var _0x27de4f=_0x39733a['count'],_0x44e477=_0x5ac997[_0x03cd('0x1e')],_0x12b3ea=_0x5ac997[_0x03cd('0x1e')]+_0x5ac997[_0x03cd('0x1f')],_0x21049d;if(_0x12b3ea>=_0x27de4f){_0x12b3ea=_0x27de4f;_0x21049d=0xc8;}else{_0x21049d=0xce;}_0x1b6fa5[_0x03cd('0x1b')](_0x21049d);return _0x1b6fa5['set'](_0x03cd('0x20'),_0x44e477+'-'+_0x12b3ea+'/'+_0x27de4f)['json'](_0x39733a);}return null;};}function patchUpdates(_0x1d51fa){return function(_0x351f1c){try{jsonpatch[_0x03cd('0x21')](_0x351f1c,_0x1d51fa,!![]);}catch(_0x4d620f){return BPromise['reject'](_0x4d620f);}return _0x351f1c[_0x03cd('0x22')]();};}function saveUpdates(_0x19ad78,_0x4e8ff6){return function(_0x140ae7){if(_0x140ae7){return _0x140ae7[_0x03cd('0x23')](_0x19ad78)['then'](function(_0x440df7){return _0x440df7;});}return null;};}function removeEntity(_0x514c11,_0x4f1b33){return function(_0x201215){if(_0x201215){return _0x201215[_0x03cd('0x24')]()[_0x03cd('0x25')](function(){var _0x13da4a=_0x201215[_0x03cd('0x26')]({'plain':!![]});var _0x2f32df='Teams';return db['UserProfileResource'][_0x03cd('0x24')]({'where':{'type':_0x2f32df,'resourceId':_0x13da4a['id']}})[_0x03cd('0x25')](function(){return _0x201215;});})[_0x03cd('0x25')](function(){_0x514c11['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x709473,_0x4f7fb5){return function(_0x40bfb8){if(!_0x40bfb8){_0x709473[_0x03cd('0x1a')](0x194);}return _0x40bfb8;};}function handleError(_0x5b976d,_0x13242a){_0x13242a=_0x13242a||0x1f4;return function(_0x38117e){logger[_0x03cd('0x27')](_0x38117e[_0x03cd('0x28')]);if(_0x38117e[_0x03cd('0x29')]){delete _0x38117e['name'];}_0x5b976d[_0x03cd('0x1b')](_0x13242a)[_0x03cd('0x2a')](_0x38117e);};}exports[_0x03cd('0x2b')]=function(_0x1e8827,_0x4e43c2){var _0x1a3b3e={},_0x1e2eff={},_0x2b9e23={'count':0x0,'rows':[]};var _0x1f667b=_[_0x03cd('0x2c')](db[_0x03cd('0x2d')][_0x03cd('0x2e')],function(_0x37cd99){return{'name':_0x37cd99[_0x03cd('0x2f')],'type':_0x37cd99[_0x03cd('0x30')][_0x03cd('0x31')]};});_0x1e2eff[_0x03cd('0x32')]=_[_0x03cd('0x2c')](_0x1f667b,'name');_0x1e2eff['query']=_[_0x03cd('0x33')](_0x1e8827['query']);_0x1e2eff[_0x03cd('0x34')]=_[_0x03cd('0x35')](_0x1e2eff['model'],_0x1e2eff['query']);_0x1a3b3e[_0x03cd('0x36')]=_[_0x03cd('0x35')](_0x1e2eff[_0x03cd('0x32')],qs[_0x03cd('0x37')](_0x1e8827['query'][_0x03cd('0x37')]));_0x1a3b3e[_0x03cd('0x36')]=_0x1a3b3e[_0x03cd('0x36')][_0x03cd('0x38')]?_0x1a3b3e[_0x03cd('0x36')]:_0x1e2eff[_0x03cd('0x32')];if(!_0x1e8827['query'][_0x03cd('0x39')](_0x03cd('0x3a'))){_0x1a3b3e[_0x03cd('0x1f')]=qs['limit'](_0x1e8827[_0x03cd('0x3b')][_0x03cd('0x1f')]);_0x1a3b3e[_0x03cd('0x1e')]=qs[_0x03cd('0x1e')](_0x1e8827[_0x03cd('0x3b')][_0x03cd('0x1e')]);}_0x1a3b3e[_0x03cd('0x3c')]=qs['sort'](_0x1e8827[_0x03cd('0x3b')][_0x03cd('0x3d')]);_0x1a3b3e['where']=qs[_0x03cd('0x34')](_[_0x03cd('0x3e')](_0x1e8827[_0x03cd('0x3b')],_0x1e2eff[_0x03cd('0x34')]));if(_0x1e8827['query'][_0x03cd('0x3f')]){_0x1a3b3e[_0x03cd('0x40')]=_[_0x03cd('0x41')](_0x1a3b3e[_0x03cd('0x40')],{'$or':_[_0x03cd('0x2c')](_0x1f667b,function(_0x3be9c2){if(_0x3be9c2[_0x03cd('0x30')]!==_0x03cd('0x42')){var _0x5351ba={};_0x5351ba[_0x3be9c2['name']]={'$like':'%'+_0x1e8827[_0x03cd('0x3b')][_0x03cd('0x3f')]+'%'};return _0x5351ba;}})});}_0x1a3b3e=_[_0x03cd('0x41')]({},_0x1a3b3e,_0x1e8827[_0x03cd('0x43')]);var _0x3d633e={'where':_0x1a3b3e['where']};return db[_0x03cd('0x2d')][_0x03cd('0x44')](_0x3d633e)[_0x03cd('0x25')](function(_0x49f5e9){_0x2b9e23[_0x03cd('0x44')]=_0x49f5e9;if(_0x1e8827[_0x03cd('0x3b')][_0x03cd('0x45')]){_0x1a3b3e[_0x03cd('0x46')]=[{'all':!![]}];}return db[_0x03cd('0x2d')][_0x03cd('0x47')](_0x1a3b3e);})['then'](function(_0x34723b){_0x2b9e23[_0x03cd('0x48')]=_0x34723b;return _0x2b9e23;})[_0x03cd('0x25')](respondWithFilteredResult(_0x4e43c2,_0x1a3b3e))[_0x03cd('0x49')](handleError(_0x4e43c2,null));};exports[_0x03cd('0x4a')]=function(_0x841ec,_0xe7c542){var _0x55edce={'raw':![],'where':{'id':_0x841ec[_0x03cd('0x4b')]['id']}},_0x5438e8={};_0x5438e8[_0x03cd('0x32')]=_[_0x03cd('0x33')](db[_0x03cd('0x2d')][_0x03cd('0x2e')]);_0x5438e8[_0x03cd('0x3b')]=_[_0x03cd('0x33')](_0x841ec['query']);_0x5438e8[_0x03cd('0x34')]=_[_0x03cd('0x35')](_0x5438e8[_0x03cd('0x32')],_0x5438e8[_0x03cd('0x3b')]);_0x55edce[_0x03cd('0x36')]=_[_0x03cd('0x35')](_0x5438e8['model'],qs['fields'](_0x841ec['query']['fields']));_0x55edce[_0x03cd('0x36')]=_0x55edce[_0x03cd('0x36')][_0x03cd('0x38')]?_0x55edce[_0x03cd('0x36')]:_0x5438e8[_0x03cd('0x32')];if(_0x841ec[_0x03cd('0x3b')][_0x03cd('0x45')]){_0x55edce[_0x03cd('0x46')]=[{'all':!![]}];}_0x55edce=_['merge']({},_0x55edce,_0x841ec['options']);return db[_0x03cd('0x2d')][_0x03cd('0x4c')](_0x55edce)['then'](handleEntityNotFound(_0xe7c542,null))['then'](respondWithResult(_0xe7c542,null))['catch'](handleError(_0xe7c542,null));};exports[_0x03cd('0x4d')]=function(_0x2e10c4,_0x545a49){return db[_0x03cd('0x2d')][_0x03cd('0x4d')](_0x2e10c4[_0x03cd('0x4e')],{})['then'](function(_0x3c624d){var _0x40d4b9=_0x2e10c4[_0x03cd('0x4f')][_0x03cd('0x26')]({'plain':!![]});if(!_0x40d4b9)throw new Error(_0x03cd('0x50'));if(_0x40d4b9['role']===_0x03cd('0x4f')){var _0x18d4fc=_0x3c624d[_0x03cd('0x26')]({'plain':!![]});var _0x23d586=_0x03cd('0x51');return db[_0x03cd('0x52')][_0x03cd('0x4c')]({'where':{'name':_0x23d586,'userProfileId':_0x40d4b9['userProfileId']},'raw':!![]})[_0x03cd('0x25')](function(_0x41637f){if(_0x41637f&&_0x41637f[_0x03cd('0x53')]===0x0){return db[_0x03cd('0x54')][_0x03cd('0x4d')]({'name':_0x18d4fc[_0x03cd('0x29')],'resourceId':_0x18d4fc['id'],'type':_0x41637f[_0x03cd('0x29')],'sectionId':_0x41637f['id']},{})['then'](function(){return _0x3c624d;});}else{return _0x3c624d;}})[_0x03cd('0x49')](function(_0x13fffb){logger[_0x03cd('0x27')](_0x03cd('0x55'),_0x13fffb);throw _0x13fffb;});}return _0x3c624d;})['then'](respondWithResult(_0x545a49,0xc9))[_0x03cd('0x49')](handleError(_0x545a49,null));};exports[_0x03cd('0x23')]=function(_0x1299eb,_0x3d611b){if(_0x1299eb[_0x03cd('0x4e')]['id']){delete _0x1299eb[_0x03cd('0x4e')]['id'];}return db[_0x03cd('0x2d')][_0x03cd('0x4c')]({'where':{'id':_0x1299eb[_0x03cd('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3d611b,null))[_0x03cd('0x25')](saveUpdates(_0x1299eb[_0x03cd('0x4e')],null))['then'](respondWithResult(_0x3d611b,null))[_0x03cd('0x49')](handleError(_0x3d611b,null));};exports['destroy']=function(_0x5137f1,_0x4fdfeb){return db[_0x03cd('0x2d')][_0x03cd('0x4c')]({'where':{'id':_0x5137f1[_0x03cd('0x4b')]['id']}})[_0x03cd('0x25')](handleEntityNotFound(_0x4fdfeb,null))['then'](removeEntity(_0x4fdfeb,null))[_0x03cd('0x49')](handleError(_0x4fdfeb,null));};exports[_0x03cd('0x56')]=function(_0x43df8b,_0x32b51c,_0x3ee773){return db[_0x03cd('0x2d')]['findOne']({'where':{'id':_0x43df8b['params']['id']}})['then'](handleEntityNotFound(_0x32b51c,null))[_0x03cd('0x25')](function(_0x1bf77b){if(!_0x43df8b[_0x03cd('0x3b')][_0x03cd('0x57')]||!utils[_0x03cd('0x58')](_0x43df8b[_0x03cd('0x3b')][_0x03cd('0x57')])){throw new db[(_0x03cd('0x59'))]['ValidationError'](_0x03cd('0x5a'));}var _0x2fc027={};var _0x3930d9={};_0x3930d9[_0x03cd('0x32')]=_[_0x03cd('0x33')](db[_['capitalize'](_0x43df8b[_0x03cd('0x3b')][_0x03cd('0x57')][_0x03cd('0x5b')]())+_0x03cd('0x5c')]['rawAttributes']);_0x3930d9[_0x03cd('0x3b')]=_[_0x03cd('0x33')](_0x43df8b[_0x03cd('0x3b')]);_0x3930d9[_0x03cd('0x34')]=_[_0x03cd('0x35')](_0x3930d9[_0x03cd('0x32')],_0x3930d9[_0x03cd('0x3b')]);_0x2fc027[_0x03cd('0x36')]=_[_0x03cd('0x35')](_0x3930d9['model'],qs['fields'](_0x43df8b[_0x03cd('0x3b')][_0x03cd('0x37')]));_0x2fc027[_0x03cd('0x36')]=_0x2fc027['attributes']['length']?_0x2fc027[_0x03cd('0x36')]:_0x3930d9[_0x03cd('0x32')];_0x2fc027['limit']=qs[_0x03cd('0x1f')](_0x43df8b[_0x03cd('0x3b')][_0x03cd('0x1f')]);_0x2fc027[_0x03cd('0x1e')]=qs[_0x03cd('0x1e')](_0x43df8b[_0x03cd('0x3b')][_0x03cd('0x1e')]);_0x2fc027[_0x03cd('0x3c')]=qs[_0x03cd('0x3d')](_0x43df8b[_0x03cd('0x3b')][_0x03cd('0x3d')]);_0x2fc027[_0x03cd('0x40')]=qs['filters'](_['pick'](_0x43df8b[_0x03cd('0x3b')],_0x3930d9[_0x03cd('0x34')]));_0x2fc027=_[_0x03cd('0x41')]({},_0x2fc027,_0x43df8b[_0x03cd('0x43')]);return _0x1bf77b[_0x03cd('0x26')+_[_0x03cd('0x5d')](_0x43df8b['query'][_0x03cd('0x57')][_0x03cd('0x5b')]())+_0x03cd('0x5e')](_0x2fc027);})['then'](respondWithResult(_0x32b51c,null))[_0x03cd('0x49')](handleError(_0x32b51c,null));};exports[_0x03cd('0x5f')]=function(_0x1e331b,_0x406d90,_0x2bcfff){return db['Team'][_0x03cd('0x60')]({'where':{'id':_0x1e331b['params']['id']}})['then'](function(_0x378f5f){if(_0x378f5f){if(!_0x1e331b[_0x03cd('0x4e')]['channel']||!utils[_0x03cd('0x58')](_0x1e331b[_0x03cd('0x4e')]['channel'])){throw new db[(_0x03cd('0x59'))][(_0x03cd('0x61'))](_0x03cd('0x5a'));}return _0x378f5f[_0x03cd('0x62')+_[_0x03cd('0x5d')](_0x1e331b[_0x03cd('0x4e')]['channel'][_0x03cd('0x5b')]())+'Queues'](_0x1e331b[_0x03cd('0x4e')][_0x03cd('0x63')]);}return null;})['then'](handleEntityNotFound(_0x406d90,null))[_0x03cd('0x25')](respondWithStatusCode(_0x406d90,null))[_0x03cd('0x49')](handleError(_0x406d90,null));};exports['removeQueues']=function(_0x30350e,_0x1497b4,_0x18dc70){return db[_0x03cd('0x2d')]['findOne']({'where':{'id':_0x30350e['params']['id']}})[_0x03cd('0x25')](function(_0x4fbed5){if(_0x4fbed5){if(!_0x30350e['query'][_0x03cd('0x57')]||!utils[_0x03cd('0x58')](_0x30350e[_0x03cd('0x3b')][_0x03cd('0x57')])){throw new db[(_0x03cd('0x59'))]['ValidationError'](_0x03cd('0x5a'));}return _0x4fbed5[_0x03cd('0x64')+_[_0x03cd('0x5d')](_0x30350e[_0x03cd('0x3b')][_0x03cd('0x57')][_0x03cd('0x5b')]())+'Queues'](_0x30350e[_0x03cd('0x3b')]['ids']);}return null;})[_0x03cd('0x25')](handleEntityNotFound(_0x1497b4,null))['then'](respondWithStatusCode(_0x1497b4,null))['catch'](handleError(_0x1497b4,null));};exports['addAgents']=function(_0x4b7eb3,_0x3a819e,_0x2318c8){return db[_0x03cd('0x2d')][_0x03cd('0x4c')]({'where':{'id':_0x4b7eb3[_0x03cd('0x4b')]['id']}})[_0x03cd('0x25')](handleEntityNotFound(_0x3a819e,null))[_0x03cd('0x25')](function(_0x50db4e){if(_0x50db4e){var _0x5e5168=['Voice','Chat',_0x03cd('0x65'),_0x03cd('0x66'),'Fax',_0x03cd('0x67')];return BPromise[_0x03cd('0x68')](_0x5e5168,function(_0x27e5f4){return _0x50db4e['get'+_0x27e5f4+_0x03cd('0x5e')]({'attributes':['id',_0x03cd('0x29')]})[_0x03cd('0x25')](function(_0x57084c){return BPromise[_0x03cd('0x68')](_0x57084c,function(_0x4d3f3e){return _0x4d3f3e[_0x03cd('0x69')](_0x4b7eb3['body']['ids'])['then'](function(){if(_0x27e5f4==='Voice'){return db[_0x03cd('0x6a')]['findAll']({'where':{'id':_0x4b7eb3[_0x03cd('0x4e')][_0x03cd('0x63')]},'attributes':['id',_0x03cd('0x29'),_0x03cd('0x6b'),_0x03cd('0x6c'),_0x03cd('0x6d')],'raw':!![]})[_0x03cd('0x25')](function(_0x11e33a){return BPromise['each'](_[_0x03cd('0x3f')](_0x11e33a,{'online':0x1}),function(_0xbaf3f1){return db['UserVoiceQueueRt']['upsert']({'membername':_0xbaf3f1[_0x03cd('0x29')],'UserId':_0xbaf3f1['id'],'queue_name':_0x4d3f3e[_0x03cd('0x29')],'VoiceQueueId':_0x4d3f3e['id'],'interface':_[_0x03cd('0x6e')](_0xbaf3f1[_0x03cd('0x6d')])?util[_0x03cd('0x6f')]('SIP/%s',_0xbaf3f1[_0x03cd('0x29')]):_0xbaf3f1['interface'],'paused':_0xbaf3f1[_0x03cd('0x6c')]||![],'penalty':0x0});});});}});});})[_0x03cd('0x25')](function(){return _0x50db4e;});})[_0x03cd('0x25')](function(){return _0x50db4e;});}})['then'](function(_0x10b0b3){if(_0x10b0b3){return _0x10b0b3[_0x03cd('0x69')](_0x4b7eb3[_0x03cd('0x4e')]['ids'],_[_0x03cd('0x70')](_0x4b7eb3[_0x03cd('0x4e')],[_0x03cd('0x63'),'id'])||{})[_0x03cd('0x71')](function(_0x5ec558){for(var _0x182d96=0x0;_0x182d96<_0x4b7eb3['body'][_0x03cd('0x63')]['length'];_0x182d96+=0x1){socket[_0x03cd('0x72')](_0x03cd('0x73'),{'UserId':_0x4b7eb3['body'][_0x03cd('0x63')][_0x182d96],'TeamId':_0x4b7eb3[_0x03cd('0x4b')]['id']});}return _0x5ec558;});}})[_0x03cd('0x25')](respondWithResult(_0x3a819e,null))[_0x03cd('0x49')](handleError(_0x3a819e,null));};exports['removeAgents']=function(_0x57e829,_0x19ea31,_0x3c6d30){return db[_0x03cd('0x2d')][_0x03cd('0x4c')]({'where':{'id':_0x57e829[_0x03cd('0x4b')]['id']}})['then'](handleEntityNotFound(_0x19ea31,null))[_0x03cd('0x25')](function(_0x4689e1){if(_0x4689e1){return BPromise['each']([_0x03cd('0x74'),_0x03cd('0x75'),_0x03cd('0x76'),_0x03cd('0x77'),_0x03cd('0x78'),_0x03cd('0x79')],function(_0x4bbf1d){return _0x4689e1[_0x03cd('0x26')+_[_0x03cd('0x5d')](_0x4bbf1d)+'Queues']({'attributes':['id',_0x03cd('0x29')]})[_0x03cd('0x25')](function(_0x3dfecb){return BPromise[_0x03cd('0x68')](_0x3dfecb,function(_0xc6cca1){return _0xc6cca1[_0x03cd('0x7a')](_0x57e829[_0x03cd('0x3b')][_0x03cd('0x63')])[_0x03cd('0x25')](function(){if(_0x4bbf1d==='voice'){return db[_0x03cd('0x7b')][_0x03cd('0x24')]({'where':{'VoiceQueueId':_0xc6cca1['id'],'UserId':_0x57e829[_0x03cd('0x3b')]['ids']}});}});});})[_0x03cd('0x25')](function(){return _0x4689e1;});})['then'](function(){return _0x4689e1;});}})['then'](function(_0x46356f){if(_0x46356f){return _0x46356f['removeAgents'](_0x57e829[_0x03cd('0x3b')][_0x03cd('0x63')])['then'](function(){if(_['isArray'](_0x57e829[_0x03cd('0x3b')][_0x03cd('0x63')])){for(var _0x218340=0x0;_0x218340<_0x57e829[_0x03cd('0x3b')]['ids'][_0x03cd('0x38')];_0x218340+=0x1){socket[_0x03cd('0x72')](_0x03cd('0x7c'),{'UserId':Number(_0x57e829[_0x03cd('0x3b')][_0x03cd('0x63')][_0x218340]),'TeamId':Number(_0x57e829['params']['id'])});}}else{socket['emit']('userTeam:remove',{'UserId':Number(_0x57e829['query'][_0x03cd('0x63')]),'TeamId':Number(_0x57e829['params']['id'])});}});}})['then'](respondWithStatusCode(_0x19ea31,null))[_0x03cd('0x49')](handleError(_0x19ea31,null));};exports[_0x03cd('0x7d')]=function(_0x8fa219,_0x32cf34,_0x46ff2d){var _0xec83d8={};var _0x2bb485={};var _0x326b39;var _0x45f49f;return db[_0x03cd('0x2d')]['findOne']({'where':{'id':_0x8fa219[_0x03cd('0x4b')]['id']}})[_0x03cd('0x25')](handleEntityNotFound(_0x32cf34,null))[_0x03cd('0x25')](function(_0x376aae){if(_0x376aae){_0x326b39=_0x376aae;_0x2bb485[_0x03cd('0x32')]=_['keys'](db[_0x03cd('0x6a')][_0x03cd('0x2e')]);_0x2bb485[_0x03cd('0x3b')]=_[_0x03cd('0x33')](_0x8fa219[_0x03cd('0x3b')]);_0x2bb485['filters']=_[_0x03cd('0x35')](_0x2bb485['model'],_0x2bb485[_0x03cd('0x3b')]);_0xec83d8[_0x03cd('0x36')]=_[_0x03cd('0x35')](_0x2bb485[_0x03cd('0x32')],qs[_0x03cd('0x37')](_0x8fa219[_0x03cd('0x3b')][_0x03cd('0x37')]));_0xec83d8['attributes']=_0xec83d8[_0x03cd('0x36')][_0x03cd('0x38')]?_0xec83d8[_0x03cd('0x36')]:_0x2bb485[_0x03cd('0x32')];_0xec83d8[_0x03cd('0x3c')]=qs['sort'](_0x8fa219[_0x03cd('0x3b')][_0x03cd('0x3d')]);_0xec83d8[_0x03cd('0x40')]=qs[_0x03cd('0x34')](_['pick'](_0x8fa219[_0x03cd('0x3b')],_0x2bb485[_0x03cd('0x34')]));if(_0x8fa219[_0x03cd('0x3b')][_0x03cd('0x3f')]){_0xec83d8[_0x03cd('0x40')]=_['merge'](_0xec83d8[_0x03cd('0x40')],{'$or':_['map'](_0xec83d8[_0x03cd('0x36')],function(_0x3df24d){var _0x2d774c={};_0x2d774c[_0x3df24d]={'$like':'%'+_0x8fa219[_0x03cd('0x3b')][_0x03cd('0x3f')]+'%'};return _0x2d774c;})});}_0xec83d8=_[_0x03cd('0x41')]({},_0xec83d8,_0x8fa219[_0x03cd('0x43')]);return _0x326b39[_0x03cd('0x7d')](_0xec83d8);}})[_0x03cd('0x25')](function(_0x4deaa3){if(_0x4deaa3){_0x45f49f=_0x4deaa3[_0x03cd('0x38')];if(!_0x8fa219[_0x03cd('0x3b')]['hasOwnProperty']('nolimit')){_0xec83d8[_0x03cd('0x1f')]=qs[_0x03cd('0x1f')](_0x8fa219[_0x03cd('0x3b')][_0x03cd('0x1f')]);_0xec83d8['offset']=qs[_0x03cd('0x1e')](_0x8fa219[_0x03cd('0x3b')][_0x03cd('0x1e')]);}return _0x326b39[_0x03cd('0x7d')](_0xec83d8);}})[_0x03cd('0x25')](function(_0x1941d4){if(_0x1941d4){return _0x1941d4?{'count':_0x45f49f,'rows':_0x1941d4}:null;}})['then'](respondWithResult(_0x32cf34,null))[_0x03cd('0x49')](handleError(_0x32cf34,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index ec51269..dc22fcc 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 _0xae27=['hasOwnProperty','hook','exports','../../mysqldb','Team','setMaxListeners','remove','emit'];(function(_0x1ee578,_0x4692ba){var _0x415497=function(_0x52b191){while(--_0x52b191){_0x1ee578['push'](_0x1ee578['shift']());}};_0x415497(++_0x4692ba);}(_0xae27,0x17b));var _0x7ae2=function(_0x1fb1c1,_0x4ebe69){_0x1fb1c1=_0x1fb1c1-0x0;var _0x1622df=_0xae27[_0x1fb1c1];return _0x1622df;};'use strict';var EventEmitter=require('events');var Team=require(_0x7ae2('0x0'))['db'][_0x7ae2('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0x7ae2('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x7ae2('0x3')};function emitEvent(_0x1278c3){return function(_0x8e8c12,_0x528dcc,_0x1687f7){TeamEvents[_0x7ae2('0x4')](_0x1278c3+':'+_0x8e8c12['id'],_0x8e8c12);TeamEvents[_0x7ae2('0x4')](_0x1278c3,_0x8e8c12);_0x1687f7(null);};}for(var e in events){if(events[_0x7ae2('0x5')](e)){var event=events[e];Team[_0x7ae2('0x6')](e,emitEvent(event));}}module[_0x7ae2('0x7')]=TeamEvents; \ No newline at end of file +var _0x7fd4=['save','update','remove','emit','hook','exports','events','setMaxListeners'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x7fd4,0xf6));var _0x47fd=function(_0x1857d0,_0x6eade0){_0x1857d0=_0x1857d0-0x0;var _0x3e3c46=_0x7fd4[_0x1857d0];return _0x3e3c46;};'use strict';var EventEmitter=require(_0x47fd('0x0'));var Team=require('../../mysqldb')['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0x47fd('0x1')](0x0);var events={'afterCreate':_0x47fd('0x2'),'afterUpdate':_0x47fd('0x3'),'afterDestroy':_0x47fd('0x4')};function emitEvent(_0x4becb4){return function(_0x45dcd2,_0x5dba18,_0x180f9c){TeamEvents[_0x47fd('0x5')](_0x4becb4+':'+_0x45dcd2['id'],_0x45dcd2);TeamEvents[_0x47fd('0x5')](_0x4becb4,_0x45dcd2);_0x180f9c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0x47fd('0x6')](e,emitEvent(event));}}module[_0x47fd('0x7')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index b6346c9..c528920 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 _0x3a64=['request-promise','path','../../config/environment','./team.attributes','exports','Team','teams','lodash','util','../../config/logger','moment','bluebird'];(function(_0xee7e7c,_0x260e2b){var _0x2d7b1e=function(_0x3c725c){while(--_0x3c725c){_0xee7e7c['push'](_0xee7e7c['shift']());}};_0x2d7b1e(++_0x260e2b);}(_0x3a64,0x8b));var _0x43a6=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x3a64[_0x819464];return _0x49dcc0;};'use strict';var _=require(_0x43a6('0x0'));var util=require(_0x43a6('0x1'));var logger=require(_0x43a6('0x2'))('api');var moment=require(_0x43a6('0x3'));var BPromise=require(_0x43a6('0x4'));var rp=require(_0x43a6('0x5'));var fs=require('fs');var path=require(_0x43a6('0x6'));var rimraf=require('rimraf');var config=require(_0x43a6('0x7'));var attributes=require(_0x43a6('0x8'));module[_0x43a6('0x9')]=function(_0x3a25d9,_0xfb2037){return _0x3a25d9['define'](_0x43a6('0xa'),attributes,{'tableName':_0x43a6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd254=['util','api','moment','bluebird','rimraf','./team.attributes','exports'];(function(_0xf51c06,_0x388e5b){var _0x1d5420=function(_0x5e077b){while(--_0x5e077b){_0xf51c06['push'](_0xf51c06['shift']());}};_0x1d5420(++_0x388e5b);}(_0xd254,0x19d));var _0x4d25=function(_0x14ad1e,_0x4e6017){_0x14ad1e=_0x14ad1e-0x0;var _0x2efcab=_0xd254[_0x14ad1e];return _0x2efcab;};'use strict';var _=require('lodash');var util=require(_0x4d25('0x0'));var logger=require('../../config/logger')(_0x4d25('0x1'));var moment=require(_0x4d25('0x2'));var BPromise=require(_0x4d25('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4d25('0x4'));var config=require('../../config/environment');var attributes=require(_0x4d25('0x5'));module[_0x4d25('0x6')]=function(_0x213d5c,_0x44ad8c){return _0x213d5c['define']('Team',attributes,{'tableName':'teams','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 70b8a89..1390879 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 _0x340a=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','jayson/promise','client','http','redis','defaults','./team.socket','register','request','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x42aabd,_0x217ade){var _0x2e83fb=function(_0x1508d8){while(--_0x1508d8){_0x42aabd['push'](_0x42aabd['shift']());}};_0x2e83fb(++_0x217ade);}(_0x340a,0x12c));var _0xa340=function(_0x5659f5,_0x204ef1){_0x5659f5=_0x5659f5-0x0;var _0x2df630=_0x340a[_0x5659f5];return _0x2df630;};'use strict';var _=require(_0xa340('0x0'));var util=require(_0xa340('0x1'));var moment=require(_0xa340('0x2'));var BPromise=require(_0xa340('0x3'));var rs=require(_0xa340('0x4'));var fs=require('fs');var Redis=require(_0xa340('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa340('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xa340('0x7'));var client=jayson[_0xa340('0x8')][_0xa340('0x9')]({'port':0x232a});config[_0xa340('0xa')]=_[_0xa340('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa340('0xc'))[_0xa340('0xd')](socket);function respondWithRpcPromise(_0xd8169d,_0xa01eb,_0x278534){return new BPromise(function(_0x18891f,_0x1a5120){return client[_0xa340('0xe')](_0xd8169d,_0x278534)['then'](function(_0x2ac58a){logger[_0xa340('0xf')](_0xa340('0x10'),_0xa01eb,_0xa340('0x11'));logger[_0xa340('0x12')](_0xa340('0x13'),_0xa01eb,_0xa340('0x11'),JSON[_0xa340('0x14')](_0x2ac58a));if(_0x2ac58a[_0xa340('0x15')]){if(_0x2ac58a[_0xa340('0x15')][_0xa340('0x16')]===0x1f4){logger[_0xa340('0x15')](_0xa340('0x10'),_0xa01eb,_0x2ac58a['error'][_0xa340('0x17')]);return _0x1a5120(_0x2ac58a[_0xa340('0x15')][_0xa340('0x17')]);}logger[_0xa340('0x15')](_0xa340('0x10'),_0xa01eb,_0x2ac58a[_0xa340('0x15')][_0xa340('0x17')]);return _0x18891f(_0x2ac58a['error'][_0xa340('0x17')]);}else{logger[_0xa340('0xf')](_0xa340('0x10'),_0xa01eb,_0xa340('0x11'));_0x18891f(_0x2ac58a[_0xa340('0x18')]['message']);}})['catch'](function(_0x4e1e24){logger[_0xa340('0x15')](_0xa340('0x10'),_0xa01eb,_0x4e1e24);_0x1a5120(_0x4e1e24);});});} \ No newline at end of file +var _0xf8d9=['then','info','Team,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','socket.io-emitter','register','request'];(function(_0x176b0b,_0x233d54){var _0x571f89=function(_0x4be8dc){while(--_0x4be8dc){_0x176b0b['push'](_0x176b0b['shift']());}};_0x571f89(++_0x233d54);}(_0xf8d9,0x1c3));var _0x9f8d=function(_0xf230c7,_0x50fb7c){_0xf230c7=_0xf230c7-0x0;var _0x5a47f6=_0xf8d9[_0xf230c7];return _0x5a47f6;};'use strict';var _=require(_0x9f8d('0x0'));var util=require(_0x9f8d('0x1'));var moment=require(_0x9f8d('0x2'));var BPromise=require(_0x9f8d('0x3'));var rs=require(_0x9f8d('0x4'));var fs=require('fs');var Redis=require(_0x9f8d('0x5'));var db=require(_0x9f8d('0x6'))['db'];var utils=require(_0x9f8d('0x7'));var logger=require(_0x9f8d('0x8'))(_0x9f8d('0x9'));var config=require('../../config/environment');var jayson=require(_0x9f8d('0xa'));var client=jayson[_0x9f8d('0xb')][_0x9f8d('0xc')]({'port':0x232a});config[_0x9f8d('0xd')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9f8d('0xe'))(new Redis(config[_0x9f8d('0xd')]));require('./team.socket')[_0x9f8d('0xf')](socket);function respondWithRpcPromise(_0x5d56ce,_0x14f099,_0x2e8d33){return new BPromise(function(_0x580e4c,_0x469d3b){return client[_0x9f8d('0x10')](_0x5d56ce,_0x2e8d33)[_0x9f8d('0x11')](function(_0x3d24a4){logger[_0x9f8d('0x12')](_0x9f8d('0x13'),_0x14f099,_0x9f8d('0x14'));logger[_0x9f8d('0x15')]('Team,\x20%s,\x20%s,\x20%s',_0x14f099,_0x9f8d('0x14'),JSON[_0x9f8d('0x16')](_0x3d24a4));if(_0x3d24a4['error']){if(_0x3d24a4['error']['code']===0x1f4){logger[_0x9f8d('0x17')]('Team,\x20%s,\x20%s',_0x14f099,_0x3d24a4[_0x9f8d('0x17')][_0x9f8d('0x18')]);return _0x469d3b(_0x3d24a4['error'][_0x9f8d('0x18')]);}logger[_0x9f8d('0x17')](_0x9f8d('0x13'),_0x14f099,_0x3d24a4['error'][_0x9f8d('0x18')]);return _0x580e4c(_0x3d24a4[_0x9f8d('0x17')][_0x9f8d('0x18')]);}else{logger[_0x9f8d('0x12')](_0x9f8d('0x13'),_0x14f099,_0x9f8d('0x14'));_0x580e4c(_0x3d24a4[_0x9f8d('0x19')][_0x9f8d('0x18')]);}})['catch'](function(_0x54b3f4){logger['error']('Team,\x20%s,\x20%s',_0x14f099,_0x54b3f4);_0x469d3b(_0x54b3f4);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index ecd8266..2e8171f 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 _0x7da6=['removeListener','register','remove','update','emit'];(function(_0x32a308,_0x56d420){var _0x45bd54=function(_0x25b0a8){while(--_0x25b0a8){_0x32a308['push'](_0x32a308['shift']());}};_0x45bd54(++_0x56d420);}(_0x7da6,0x124));var _0x67da=function(_0x2ade6f,_0x18d576){_0x2ade6f=_0x2ade6f-0x0;var _0x28fa0f=_0x7da6[_0x2ade6f];return _0x28fa0f;};'use strict';var TeamEvents=require('./team.events');var events=['save',_0x67da('0x0'),_0x67da('0x1')];function createListener(_0xb594a8,_0x3d2962){return function(_0x5a7846){_0x3d2962[_0x67da('0x2')](_0xb594a8,_0x5a7846);};}function removeListener(_0x282a52,_0x37ef9d){return function(){TeamEvents[_0x67da('0x3')](_0x282a52,_0x37ef9d);};}exports[_0x67da('0x4')]=function(_0x40d5f8){for(var _0x59af9a=0x0,_0xb7f52=events['length'];_0x59af9a<_0xb7f52;_0x59af9a++){var _0x4cfe49=events[_0x59af9a];var _0x3d971d=createListener('team:'+_0x4cfe49,_0x40d5f8);TeamEvents['on'](_0x4cfe49,_0x3d971d);}}; \ No newline at end of file +var _0xfcf0=['removeListener','register','length','team:','./team.events','save','update'];(function(_0x340a0f,_0x2518a3){var _0x1018ba=function(_0x4d2163){while(--_0x4d2163){_0x340a0f['push'](_0x340a0f['shift']());}};_0x1018ba(++_0x2518a3);}(_0xfcf0,0x138));var _0x0fcf=function(_0x3eb4a9,_0x359d73){_0x3eb4a9=_0x3eb4a9-0x0;var _0x48dbad=_0xfcf0[_0x3eb4a9];return _0x48dbad;};'use strict';var TeamEvents=require(_0x0fcf('0x0'));var events=[_0x0fcf('0x1'),'remove',_0x0fcf('0x2')];function createListener(_0x3d8e0f,_0x366cfa){return function(_0xd744d1){_0x366cfa['emit'](_0x3d8e0f,_0xd744d1);};}function removeListener(_0x2fe6d8,_0x265968){return function(){TeamEvents[_0x0fcf('0x3')](_0x2fe6d8,_0x265968);};}exports[_0x0fcf('0x4')]=function(_0x1bace8){for(var _0x1a7b03=0x0,_0x61bbb9=events[_0x0fcf('0x5')];_0x1a7b03<_0x61bbb9;_0x1a7b03++){var _0x50c575=events[_0x1a7b03];var _0x1388d1=createListener(_0x0fcf('0x6')+_0x50c575,_0x1bace8);TeamEvents['on'](_0x50c575,_0x1388d1);}}; \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index c3d9473..fed9109 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 _0xef9a=['exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','index','show','put','/:id','update','delete','destroy'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xef9a,0xe5));var _0xaef9=function(_0x3d4c55,_0x132314){_0x3d4c55=_0x3d4c55-0x0;var _0x30330d=_0xef9a[_0x3d4c55];return _0x30330d;};'use strict';var multer=require(_0xaef9('0x0'));var util=require('util');var path=require(_0xaef9('0x1'));var timeout=require(_0xaef9('0x2'));var express=require(_0xaef9('0x3'));var router=express[_0xaef9('0x4')]();var auth=require(_0xaef9('0x5'));var interaction=require(_0xaef9('0x6'));var config=require(_0xaef9('0x7'));var controller=require(_0xaef9('0x8'));router[_0xaef9('0x9')]('/',auth[_0xaef9('0xa')](),controller[_0xaef9('0xb')]);router[_0xaef9('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xaef9('0xc')]);router['post']('/',auth[_0xaef9('0xa')](),controller['create']);router[_0xaef9('0xd')](_0xaef9('0xe'),auth['isAuthenticated'](),controller[_0xaef9('0xf')]);router[_0xaef9('0x10')]('/:id',auth[_0xaef9('0xa')](),controller[_0xaef9('0x11')]);module[_0xaef9('0x12')]=router; \ No newline at end of file +var _0x0fc6=['../../config/environment','./template.controller','get','isAuthenticated','index','/:id','show','post','update','util','connect-timeout','Router','../../components/interaction/service'];(function(_0x315aea,_0x318a80){var _0x4a4bdb=function(_0x7c049c){while(--_0x7c049c){_0x315aea['push'](_0x315aea['shift']());}};_0x4a4bdb(++_0x318a80);}(_0x0fc6,0x1ea));var _0x60fc=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x0fc6[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require('multer');var util=require(_0x60fc('0x0'));var path=require('path');var timeout=require(_0x60fc('0x1'));var express=require('express');var router=express[_0x60fc('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x60fc('0x3'));var config=require(_0x60fc('0x4'));var controller=require(_0x60fc('0x5'));router[_0x60fc('0x6')]('/',auth[_0x60fc('0x7')](),controller[_0x60fc('0x8')]);router['get'](_0x60fc('0x9'),auth['isAuthenticated'](),controller[_0x60fc('0xa')]);router[_0x60fc('0xb')]('/',auth[_0x60fc('0x7')](),controller['create']);router['put']('/:id',auth[_0x60fc('0x7')](),controller[_0x60fc('0xc')]);router['delete'](_0x60fc('0x9'),auth[_0x60fc('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 968259d..d57d393 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 _0xc28e=['exports','STRING','sequelize'];(function(_0x1390f4,_0x60876c){var _0x5c63db=function(_0x39fefe){while(--_0x39fefe){_0x1390f4['push'](_0x1390f4['shift']());}};_0x5c63db(++_0x60876c);}(_0xc28e,0x1af));var _0xec28=function(_0x532112,_0x37d94b){_0x532112=_0x532112-0x0;var _0x23e5fb=_0xc28e[_0x532112];return _0x23e5fb;};'use strict';var Sequelize=require(_0xec28('0x0'));module[_0xec28('0x1')]={'name':{'type':Sequelize[_0xec28('0x2')]},'description':{'type':Sequelize[_0xec28('0x2')]},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xa3c3=['STRING','sequelize','exports'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0xa3c3,0xcd));var _0x3a3c=function(_0x9296e7,_0x24c717){_0x9296e7=_0x9296e7-0x0;var _0x25d984=_0xa3c3[_0x9296e7];return _0x25d984;};'use strict';var Sequelize=require(_0x3a3c('0x0'));module[_0x3a3c('0x1')]={'name':{'type':Sequelize[_0x3a3c('0x2')]},'description':{'type':Sequelize[_0x3a3c('0x2')]},'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 898b08e..cc406c1 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 _0x777d=['error','stack','name','send','index','Template','rawAttributes','fieldName','key','model','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','eml-format','rimraf','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/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','set','apply','reject','save','update','then','destroy','Templates','UserProfileResource'];(function(_0x38c769,_0x2d3dfd){var _0x440f65=function(_0x20932e){while(--_0x20932e){_0x38c769['push'](_0x38c769['shift']());}};_0x440f65(++_0x2d3dfd);}(_0x777d,0x17d));var _0xd777=function(_0x20ebb5,_0x237d88){_0x20ebb5=_0x20ebb5-0x0;var _0x487182=_0x777d[_0x20ebb5];return _0x487182;};'use strict';var pdf=require(_0xd777('0x0'));var emlformat=require(_0xd777('0x1'));var rimraf=require(_0xd777('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd777('0x3'));var rp=require(_0xd777('0x4'));var moment=require(_0xd777('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd777('0x6'));var util=require(_0xd777('0x7'));var path=require(_0xd777('0x8'));var sox=require(_0xd777('0x9'));var csv=require(_0xd777('0xa'));var ejs=require(_0xd777('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd777('0xc'));var crypto=require(_0xd777('0xd'));var jsforce=require(_0xd777('0xe'));var deskjs=require(_0xd777('0xf'));var toCsv=require(_0xd777('0xa'));var querystring=require(_0xd777('0x10'));var Papa=require(_0xd777('0x11'));var Redis=require(_0xd777('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xd777('0x13'));var as=require(_0xd777('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd777('0x15'))(_0xd777('0x16'));var utils=require(_0xd777('0x17'));var config=require('../../config/environment');var db=require(_0xd777('0x18'))['db'];function respondWithStatusCode(_0x247243,_0x30d468){_0x30d468=_0x30d468||0xcc;return function(_0x4191b1){if(_0x4191b1){return _0x247243[_0xd777('0x19')](_0x30d468);}return _0x247243[_0xd777('0x1a')](_0x30d468)['end']();};}function respondWithResult(_0x4eb2dd,_0xa370e9){_0xa370e9=_0xa370e9||0xc8;return function(_0x479e9c){if(_0x479e9c){return _0x4eb2dd['status'](_0xa370e9)[_0xd777('0x1b')](_0x479e9c);}};}function respondWithFilteredResult(_0x2a65f7,_0x5071fa){return function(_0x42c93e){if(_0x42c93e){var _0x3f49ce=_0x42c93e[_0xd777('0x1c')],_0x291609=_0x5071fa['offset'],_0x14f311=_0x5071fa[_0xd777('0x1d')]+_0x5071fa['limit'],_0x3ded14;if(_0x14f311>=_0x3f49ce){_0x14f311=_0x3f49ce;_0x3ded14=0xc8;}else{_0x3ded14=0xce;}_0x2a65f7['status'](_0x3ded14);return _0x2a65f7[_0xd777('0x1e')]('Content-Range',_0x291609+'-'+_0x14f311+'/'+_0x3f49ce)[_0xd777('0x1b')](_0x42c93e);}return null;};}function patchUpdates(_0x399f2e){return function(_0x242415){try{jsonpatch[_0xd777('0x1f')](_0x242415,_0x399f2e,!![]);}catch(_0x1cb826){return BPromise[_0xd777('0x20')](_0x1cb826);}return _0x242415[_0xd777('0x21')]();};}function saveUpdates(_0x197707,_0x3b33da){return function(_0x4b51fd){if(_0x4b51fd){return _0x4b51fd[_0xd777('0x22')](_0x197707)[_0xd777('0x23')](function(_0x123eff){return _0x123eff;});}return null;};}function removeEntity(_0x6c7422,_0x12955a){return function(_0x2f1a8b){if(_0x2f1a8b){return _0x2f1a8b[_0xd777('0x24')]()[_0xd777('0x23')](function(){var _0x2f9f75=_0x2f1a8b['get']({'plain':!![]});var _0x55d5a2=_0xd777('0x25');return db[_0xd777('0x26')]['destroy']({'where':{'type':_0x55d5a2,'resourceId':_0x2f9f75['id']}})['then'](function(){return _0x2f1a8b;});})[_0xd777('0x23')](function(){_0x6c7422[_0xd777('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x512bd5,_0x3ee9ff){return function(_0x1bc83e){if(!_0x1bc83e){_0x512bd5['sendStatus'](0x194);}return _0x1bc83e;};}function handleError(_0x158caa,_0x5a1779){_0x5a1779=_0x5a1779||0x1f4;return function(_0x4e267d){logger[_0xd777('0x27')](_0x4e267d[_0xd777('0x28')]);if(_0x4e267d[_0xd777('0x29')]){delete _0x4e267d[_0xd777('0x29')];}_0x158caa[_0xd777('0x1a')](_0x5a1779)[_0xd777('0x2a')](_0x4e267d);};}exports[_0xd777('0x2b')]=function(_0x54c604,_0xfa7e50){var _0x244918={},_0x186d11={},_0x37ac14={'count':0x0,'rows':[]};var _0x14ef08=_['map'](db[_0xd777('0x2c')][_0xd777('0x2d')],function(_0xbe6ae3){return{'name':_0xbe6ae3[_0xd777('0x2e')],'type':_0xbe6ae3['type'][_0xd777('0x2f')]};});_0x186d11[_0xd777('0x30')]=_[_0xd777('0x31')](_0x14ef08,'name');_0x186d11[_0xd777('0x32')]=_[_0xd777('0x33')](_0x54c604['query']);_0x186d11['filters']=_['intersection'](_0x186d11[_0xd777('0x30')],_0x186d11[_0xd777('0x32')]);_0x244918[_0xd777('0x34')]=_[_0xd777('0x35')](_0x186d11[_0xd777('0x30')],qs[_0xd777('0x36')](_0x54c604[_0xd777('0x32')][_0xd777('0x36')]));_0x244918[_0xd777('0x34')]=_0x244918['attributes'][_0xd777('0x37')]?_0x244918[_0xd777('0x34')]:_0x186d11[_0xd777('0x30')];if(!_0x54c604['query'][_0xd777('0x38')]('nolimit')){_0x244918[_0xd777('0x39')]=qs[_0xd777('0x39')](_0x54c604['query']['limit']);_0x244918[_0xd777('0x1d')]=qs['offset'](_0x54c604['query'][_0xd777('0x1d')]);}_0x244918[_0xd777('0x3a')]=qs['sort'](_0x54c604[_0xd777('0x32')][_0xd777('0x3b')]);_0x244918[_0xd777('0x3c')]=qs[_0xd777('0x3d')](_[_0xd777('0x3e')](_0x54c604[_0xd777('0x32')],_0x186d11['filters']));if(_0x54c604['query'][_0xd777('0x3f')]){_0x244918['where']=_['merge'](_0x244918['where'],{'$or':_['map'](_0x14ef08,function(_0x20e692){if(_0x20e692['type']!==_0xd777('0x40')){var _0x1dcde5={};_0x1dcde5[_0x20e692[_0xd777('0x29')]]={'$like':'%'+_0x54c604['query'][_0xd777('0x3f')]+'%'};return _0x1dcde5;}})});}_0x244918=_[_0xd777('0x41')]({},_0x244918,_0x54c604[_0xd777('0x42')]);var _0xe3f21d={'where':_0x244918[_0xd777('0x3c')]};return db[_0xd777('0x2c')]['count'](_0xe3f21d)[_0xd777('0x23')](function(_0x17a6fc){_0x37ac14[_0xd777('0x1c')]=_0x17a6fc;if(_0x54c604[_0xd777('0x32')][_0xd777('0x43')]){_0x244918[_0xd777('0x44')]=[{'all':!![]}];}return db[_0xd777('0x2c')][_0xd777('0x45')](_0x244918);})[_0xd777('0x23')](function(_0xe7e26d){_0x37ac14['rows']=_0xe7e26d;return _0x37ac14;})[_0xd777('0x23')](respondWithFilteredResult(_0xfa7e50,_0x244918))[_0xd777('0x46')](handleError(_0xfa7e50,null));};exports[_0xd777('0x47')]=function(_0xff20e8,_0x27d9d2){var _0x31f3be={'raw':!![],'where':{'id':_0xff20e8[_0xd777('0x48')]['id']}},_0x5b01df={};_0x5b01df['model']=_[_0xd777('0x33')](db[_0xd777('0x2c')]['rawAttributes']);_0x5b01df['query']=_[_0xd777('0x33')](_0xff20e8[_0xd777('0x32')]);_0x5b01df[_0xd777('0x3d')]=_['intersection'](_0x5b01df[_0xd777('0x30')],_0x5b01df[_0xd777('0x32')]);_0x31f3be[_0xd777('0x34')]=_[_0xd777('0x35')](_0x5b01df['model'],qs[_0xd777('0x36')](_0xff20e8[_0xd777('0x32')][_0xd777('0x36')]));_0x31f3be['attributes']=_0x31f3be['attributes']['length']?_0x31f3be[_0xd777('0x34')]:_0x5b01df[_0xd777('0x30')];if(_0xff20e8[_0xd777('0x32')][_0xd777('0x43')]){_0x31f3be[_0xd777('0x44')]=[{'all':!![]}];}_0x31f3be=_[_0xd777('0x41')]({},_0x31f3be,_0xff20e8['options']);return db['Template'][_0xd777('0x49')](_0x31f3be)[_0xd777('0x23')](handleEntityNotFound(_0x27d9d2,null))[_0xd777('0x23')](respondWithResult(_0x27d9d2,null))[_0xd777('0x46')](handleError(_0x27d9d2,null));};exports[_0xd777('0x4a')]=function(_0x12fa26,_0x1df6a2){return db['Template']['create'](_0x12fa26['body'],{})[_0xd777('0x23')](function(_0x361a9a){var _0x46569b=_0x12fa26[_0xd777('0x4b')][_0xd777('0x4c')]({'plain':!![]});if(!_0x46569b)throw new Error(_0xd777('0x4d'));if(_0x46569b[_0xd777('0x4e')]===_0xd777('0x4b')){var _0x3b48a3=_0x361a9a[_0xd777('0x4c')]({'plain':!![]});var _0x36e182='Templates';return db[_0xd777('0x4f')][_0xd777('0x49')]({'where':{'name':_0x36e182,'userProfileId':_0x46569b[_0xd777('0x50')]},'raw':!![]})[_0xd777('0x23')](function(_0x7e4167){if(_0x7e4167&&_0x7e4167[_0xd777('0x51')]===0x0){return db[_0xd777('0x26')][_0xd777('0x4a')]({'name':_0x3b48a3[_0xd777('0x29')],'resourceId':_0x3b48a3['id'],'type':_0x7e4167[_0xd777('0x29')],'sectionId':_0x7e4167['id']},{})['then'](function(){return _0x361a9a;});}else{return _0x361a9a;}})[_0xd777('0x46')](function(_0x421bc1){logger[_0xd777('0x27')](_0xd777('0x52'),_0x421bc1);throw _0x421bc1;});}return _0x361a9a;})[_0xd777('0x23')](respondWithResult(_0x1df6a2,0xc9))[_0xd777('0x46')](handleError(_0x1df6a2,null));};exports[_0xd777('0x22')]=function(_0x4a83d4,_0xf9ee32){if(_0x4a83d4['body']['id']){delete _0x4a83d4['body']['id'];}return db['Template'][_0xd777('0x49')]({'where':{'id':_0x4a83d4[_0xd777('0x48')]['id']}})[_0xd777('0x23')](handleEntityNotFound(_0xf9ee32,null))['then'](saveUpdates(_0x4a83d4[_0xd777('0x53')],null))[_0xd777('0x23')](respondWithResult(_0xf9ee32,null))[_0xd777('0x46')](handleError(_0xf9ee32,null));};exports['destroy']=function(_0x4bb90e,_0x26ee2f){return db[_0xd777('0x2c')][_0xd777('0x49')]({'where':{'id':_0x4bb90e[_0xd777('0x48')]['id']}})['then'](handleEntityNotFound(_0x26ee2f,null))[_0xd777('0x23')](removeEntity(_0x26ee2f,null))[_0xd777('0x46')](handleError(_0x26ee2f,null));}; \ No newline at end of file +var _0x5053=['intersection','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','include','rows','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Templates','UserProfileResource','error','stack','name','send','map','Template','rawAttributes','fieldName','key','query','keys','model','attributes'];(function(_0x101ccf,_0x37e172){var _0x99b0f1=function(_0x4111c8){while(--_0x4111c8){_0x101ccf['push'](_0x101ccf['shift']());}};_0x99b0f1(++_0x37e172);}(_0x5053,0x67));var _0x3505=function(_0x48c615,_0x4cc757){_0x48c615=_0x48c615-0x0;var _0x3d9e22=_0x5053[_0x48c615];return _0x3d9e22;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3505('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3505('0x1'));var jsonpatch=require(_0x3505('0x2'));var rp=require('request-promise');var moment=require(_0x3505('0x3'));var BPromise=require(_0x3505('0x4'));var Mustache=require(_0x3505('0x5'));var util=require(_0x3505('0x6'));var path=require(_0x3505('0x7'));var sox=require('sox');var csv=require(_0x3505('0x8'));var ejs=require(_0x3505('0x9'));var fs=require('fs');var _=require(_0x3505('0xa'));var squel=require(_0x3505('0xb'));var crypto=require(_0x3505('0xc'));var jsforce=require(_0x3505('0xd'));var deskjs=require(_0x3505('0xe'));var toCsv=require(_0x3505('0x8'));var querystring=require(_0x3505('0xf'));var Papa=require(_0x3505('0x10'));var Redis=require('ioredis');var authService=require(_0x3505('0x11'));var qs=require(_0x3505('0x12'));var as=require(_0x3505('0x13'));var hardwareService=require(_0x3505('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x3505('0x15'))['db'];function respondWithStatusCode(_0x3bb87a,_0x1c4025){_0x1c4025=_0x1c4025||0xcc;return function(_0x4a39c1){if(_0x4a39c1){return _0x3bb87a[_0x3505('0x16')](_0x1c4025);}return _0x3bb87a[_0x3505('0x17')](_0x1c4025)[_0x3505('0x18')]();};}function respondWithResult(_0x1c7a6f,_0xa19739){_0xa19739=_0xa19739||0xc8;return function(_0x4dc2ed){if(_0x4dc2ed){return _0x1c7a6f[_0x3505('0x17')](_0xa19739)[_0x3505('0x19')](_0x4dc2ed);}};}function respondWithFilteredResult(_0x4c4d66,_0x5773f7){return function(_0x5bccf4){if(_0x5bccf4){var _0x3a65cd=_0x5bccf4[_0x3505('0x1a')],_0x444c25=_0x5773f7[_0x3505('0x1b')],_0x560c02=_0x5773f7['offset']+_0x5773f7[_0x3505('0x1c')],_0x5cc08a;if(_0x560c02>=_0x3a65cd){_0x560c02=_0x3a65cd;_0x5cc08a=0xc8;}else{_0x5cc08a=0xce;}_0x4c4d66[_0x3505('0x17')](_0x5cc08a);return _0x4c4d66[_0x3505('0x1d')](_0x3505('0x1e'),_0x444c25+'-'+_0x560c02+'/'+_0x3a65cd)['json'](_0x5bccf4);}return null;};}function patchUpdates(_0x239b5b){return function(_0x2b0e4a){try{jsonpatch[_0x3505('0x1f')](_0x2b0e4a,_0x239b5b,!![]);}catch(_0x1f931b){return BPromise[_0x3505('0x20')](_0x1f931b);}return _0x2b0e4a[_0x3505('0x21')]();};}function saveUpdates(_0x466529,_0x1f08f6){return function(_0x443484){if(_0x443484){return _0x443484[_0x3505('0x22')](_0x466529)[_0x3505('0x23')](function(_0x25b1c3){return _0x25b1c3;});}return null;};}function removeEntity(_0x244076,_0x47edb2){return function(_0x3a3e07){if(_0x3a3e07){return _0x3a3e07[_0x3505('0x24')]()['then'](function(){var _0x4eb1bd=_0x3a3e07[_0x3505('0x25')]({'plain':!![]});var _0x298b99=_0x3505('0x26');return db[_0x3505('0x27')][_0x3505('0x24')]({'where':{'type':_0x298b99,'resourceId':_0x4eb1bd['id']}})['then'](function(){return _0x3a3e07;});})[_0x3505('0x23')](function(){_0x244076[_0x3505('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x138afd,_0x2474c0){return function(_0x12b536){if(!_0x12b536){_0x138afd[_0x3505('0x16')](0x194);}return _0x12b536;};}function handleError(_0x479ed3,_0x19d852){_0x19d852=_0x19d852||0x1f4;return function(_0xc133ef){logger[_0x3505('0x28')](_0xc133ef[_0x3505('0x29')]);if(_0xc133ef[_0x3505('0x2a')]){delete _0xc133ef[_0x3505('0x2a')];}_0x479ed3[_0x3505('0x17')](_0x19d852)[_0x3505('0x2b')](_0xc133ef);};}exports['index']=function(_0x2217aa,_0x1691b){var _0x474430={},_0x449a06={},_0x25520b={'count':0x0,'rows':[]};var _0x2e6df2=_[_0x3505('0x2c')](db[_0x3505('0x2d')][_0x3505('0x2e')],function(_0x373f2d){return{'name':_0x373f2d[_0x3505('0x2f')],'type':_0x373f2d['type'][_0x3505('0x30')]};});_0x449a06['model']=_[_0x3505('0x2c')](_0x2e6df2,_0x3505('0x2a'));_0x449a06[_0x3505('0x31')]=_[_0x3505('0x32')](_0x2217aa[_0x3505('0x31')]);_0x449a06['filters']=_['intersection'](_0x449a06[_0x3505('0x33')],_0x449a06[_0x3505('0x31')]);_0x474430[_0x3505('0x34')]=_[_0x3505('0x35')](_0x449a06[_0x3505('0x33')],qs[_0x3505('0x36')](_0x2217aa['query'][_0x3505('0x36')]));_0x474430[_0x3505('0x34')]=_0x474430[_0x3505('0x34')][_0x3505('0x37')]?_0x474430['attributes']:_0x449a06['model'];if(!_0x2217aa['query'][_0x3505('0x38')]('nolimit')){_0x474430[_0x3505('0x1c')]=qs[_0x3505('0x1c')](_0x2217aa['query'][_0x3505('0x1c')]);_0x474430[_0x3505('0x1b')]=qs[_0x3505('0x1b')](_0x2217aa['query']['offset']);}_0x474430[_0x3505('0x39')]=qs[_0x3505('0x3a')](_0x2217aa[_0x3505('0x31')][_0x3505('0x3a')]);_0x474430[_0x3505('0x3b')]=qs[_0x3505('0x3c')](_['pick'](_0x2217aa['query'],_0x449a06[_0x3505('0x3c')]));if(_0x2217aa[_0x3505('0x31')][_0x3505('0x3d')]){_0x474430[_0x3505('0x3b')]=_[_0x3505('0x3e')](_0x474430[_0x3505('0x3b')],{'$or':_[_0x3505('0x2c')](_0x2e6df2,function(_0x4f161e){if(_0x4f161e['type']!==_0x3505('0x3f')){var _0x2dbed6={};_0x2dbed6[_0x4f161e[_0x3505('0x2a')]]={'$like':'%'+_0x2217aa[_0x3505('0x31')]['filter']+'%'};return _0x2dbed6;}})});}_0x474430=_['merge']({},_0x474430,_0x2217aa[_0x3505('0x40')]);var _0x532bff={'where':_0x474430[_0x3505('0x3b')]};return db['Template']['count'](_0x532bff)['then'](function(_0x3fed3c){_0x25520b[_0x3505('0x1a')]=_0x3fed3c;if(_0x2217aa[_0x3505('0x31')]['includeAll']){_0x474430[_0x3505('0x41')]=[{'all':!![]}];}return db[_0x3505('0x2d')]['findAll'](_0x474430);})[_0x3505('0x23')](function(_0x2c4750){_0x25520b[_0x3505('0x42')]=_0x2c4750;return _0x25520b;})[_0x3505('0x23')](respondWithFilteredResult(_0x1691b,_0x474430))['catch'](handleError(_0x1691b,null));};exports[_0x3505('0x43')]=function(_0x4cce93,_0x1055d2){var _0x48fdae={'raw':!![],'where':{'id':_0x4cce93['params']['id']}},_0x41880f={};_0x41880f[_0x3505('0x33')]=_[_0x3505('0x32')](db[_0x3505('0x2d')][_0x3505('0x2e')]);_0x41880f[_0x3505('0x31')]=_[_0x3505('0x32')](_0x4cce93[_0x3505('0x31')]);_0x41880f[_0x3505('0x3c')]=_[_0x3505('0x35')](_0x41880f[_0x3505('0x33')],_0x41880f['query']);_0x48fdae[_0x3505('0x34')]=_['intersection'](_0x41880f[_0x3505('0x33')],qs[_0x3505('0x36')](_0x4cce93[_0x3505('0x31')]['fields']));_0x48fdae[_0x3505('0x34')]=_0x48fdae[_0x3505('0x34')][_0x3505('0x37')]?_0x48fdae[_0x3505('0x34')]:_0x41880f['model'];if(_0x4cce93[_0x3505('0x31')]['includeAll']){_0x48fdae[_0x3505('0x41')]=[{'all':!![]}];}_0x48fdae=_[_0x3505('0x3e')]({},_0x48fdae,_0x4cce93['options']);return db[_0x3505('0x2d')][_0x3505('0x44')](_0x48fdae)[_0x3505('0x23')](handleEntityNotFound(_0x1055d2,null))[_0x3505('0x23')](respondWithResult(_0x1055d2,null))['catch'](handleError(_0x1055d2,null));};exports['create']=function(_0x5e159f,_0x27f6cc){return db[_0x3505('0x2d')][_0x3505('0x45')](_0x5e159f[_0x3505('0x46')],{})[_0x3505('0x23')](function(_0x350f9b){var _0x3e060d=_0x5e159f[_0x3505('0x47')][_0x3505('0x25')]({'plain':!![]});if(!_0x3e060d)throw new Error(_0x3505('0x48'));if(_0x3e060d[_0x3505('0x49')]==='user'){var _0x3001ee=_0x350f9b[_0x3505('0x25')]({'plain':!![]});var _0x35361b=_0x3505('0x26');return db[_0x3505('0x4a')]['find']({'where':{'name':_0x35361b,'userProfileId':_0x3e060d['userProfileId']},'raw':!![]})[_0x3505('0x23')](function(_0xf740d4){if(_0xf740d4&&_0xf740d4['autoAssociation']===0x0){return db[_0x3505('0x27')]['create']({'name':_0x3001ee[_0x3505('0x2a')],'resourceId':_0x3001ee['id'],'type':_0xf740d4[_0x3505('0x2a')],'sectionId':_0xf740d4['id']},{})[_0x3505('0x23')](function(){return _0x350f9b;});}else{return _0x350f9b;}})[_0x3505('0x4b')](function(_0x1696e7){logger[_0x3505('0x28')](_0x3505('0x4c'),_0x1696e7);throw _0x1696e7;});}return _0x350f9b;})[_0x3505('0x23')](respondWithResult(_0x27f6cc,0xc9))['catch'](handleError(_0x27f6cc,null));};exports[_0x3505('0x22')]=function(_0x1c2c25,_0x22bea4){if(_0x1c2c25[_0x3505('0x46')]['id']){delete _0x1c2c25[_0x3505('0x46')]['id'];}return db['Template'][_0x3505('0x44')]({'where':{'id':_0x1c2c25['params']['id']}})[_0x3505('0x23')](handleEntityNotFound(_0x22bea4,null))[_0x3505('0x23')](saveUpdates(_0x1c2c25[_0x3505('0x46')],null))['then'](respondWithResult(_0x22bea4,null))[_0x3505('0x4b')](handleError(_0x22bea4,null));};exports['destroy']=function(_0x583f9e,_0x1ecb30){return db['Template'][_0x3505('0x44')]({'where':{'id':_0x583f9e[_0x3505('0x4d')]['id']}})[_0x3505('0x23')](handleEntityNotFound(_0x1ecb30,null))[_0x3505('0x23')](removeEntity(_0x1ecb30,null))[_0x3505('0x4b')](handleError(_0x1ecb30,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 0df5536..a475943 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 _0x3d14=['api','bluebird','request-promise','path','rimraf','../../config/environment','./template.attributes','Template','tools_templates','lodash','util'];(function(_0x32cab2,_0x1faa73){var _0x36353c=function(_0x4714b9){while(--_0x4714b9){_0x32cab2['push'](_0x32cab2['shift']());}};_0x36353c(++_0x1faa73);}(_0x3d14,0x169));var _0x43d1=function(_0x59616b,_0x38e534){_0x59616b=_0x59616b-0x0;var _0x5c4523=_0x3d14[_0x59616b];return _0x5c4523;};'use strict';var _=require(_0x43d1('0x0'));var util=require(_0x43d1('0x1'));var logger=require('../../config/logger')(_0x43d1('0x2'));var moment=require('moment');var BPromise=require(_0x43d1('0x3'));var rp=require(_0x43d1('0x4'));var fs=require('fs');var path=require(_0x43d1('0x5'));var rimraf=require(_0x43d1('0x6'));var config=require(_0x43d1('0x7'));var attributes=require(_0x43d1('0x8'));module['exports']=function(_0x240357,_0x3d07f9){return _0x240357['define'](_0x43d1('0x9'),attributes,{'tableName':_0x43d1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3fe2=['./template.attributes','Template','tools_templates','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3fe2,0x107));var _0x23fe=function(_0x3914cd,_0x5d45f0){_0x3914cd=_0x3914cd-0x0;var _0x3a7e9c=_0x3fe2[_0x3914cd];return _0x3a7e9c;};'use strict';var _=require(_0x23fe('0x0'));var util=require(_0x23fe('0x1'));var logger=require(_0x23fe('0x2'))(_0x23fe('0x3'));var moment=require(_0x23fe('0x4'));var BPromise=require(_0x23fe('0x5'));var rp=require(_0x23fe('0x6'));var fs=require('fs');var path=require(_0x23fe('0x7'));var rimraf=require(_0x23fe('0x8'));var config=require(_0x23fe('0x9'));var attributes=require(_0x23fe('0xa'));module['exports']=function(_0xf25af1,_0x3f0158){return _0xf25af1['define'](_0x23fe('0xb'),attributes,{'tableName':_0x23fe('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index 20462ef..37b7d58 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 _0xae01=['limit','include','map','model','GetTemplate','stringify','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','error','code','Template,\x20%s,\x20%s','message','result','Template','findAll','options','raw','where','attributes'];(function(_0x16ab52,_0x443eb7){var _0x209913=function(_0x18e9fe){while(--_0x18e9fe){_0x16ab52['push'](_0x16ab52['shift']());}};_0x209913(++_0x443eb7);}(_0xae01,0xdf));var _0x1ae0=function(_0x2b7c81,_0x3ba724){_0x2b7c81=_0x2b7c81-0x0;var _0x101cd2=_0xae01[_0x2b7c81];return _0x101cd2;};'use strict';var _=require(_0x1ae0('0x0'));var util=require(_0x1ae0('0x1'));var moment=require(_0x1ae0('0x2'));var BPromise=require(_0x1ae0('0x3'));var rs=require(_0x1ae0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1ae0('0x5'));var logger=require(_0x1ae0('0x6'))(_0x1ae0('0x7'));var config=require(_0x1ae0('0x8'));var jayson=require(_0x1ae0('0x9'));var client=jayson[_0x1ae0('0xa')][_0x1ae0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1e69f7,_0x3946e1,_0x37537d){return new BPromise(function(_0x51ecac,_0x2bd3e5){return client[_0x1ae0('0xc')](_0x1e69f7,_0x37537d)[_0x1ae0('0xd')](function(_0x5c9118){logger[_0x1ae0('0xe')]('Template,\x20%s,\x20%s',_0x3946e1,_0x1ae0('0xf'));logger[_0x1ae0('0x10')](_0x1ae0('0x11'),_0x3946e1,_0x1ae0('0xf'),JSON['stringify'](_0x5c9118));if(_0x5c9118[_0x1ae0('0x12')]){if(_0x5c9118[_0x1ae0('0x12')][_0x1ae0('0x13')]===0x1f4){logger[_0x1ae0('0x12')](_0x1ae0('0x14'),_0x3946e1,_0x5c9118['error'][_0x1ae0('0x15')]);return _0x2bd3e5(_0x5c9118['error'][_0x1ae0('0x15')]);}logger[_0x1ae0('0x12')]('Template,\x20%s,\x20%s',_0x3946e1,_0x5c9118[_0x1ae0('0x12')]['message']);return _0x51ecac(_0x5c9118[_0x1ae0('0x12')][_0x1ae0('0x15')]);}else{logger['info'](_0x1ae0('0x14'),_0x3946e1,'request\x20sent');_0x51ecac(_0x5c9118[_0x1ae0('0x16')]['message']);}})['catch'](function(_0x1f50f5){logger[_0x1ae0('0x12')]('Template,\x20%s,\x20%s',_0x3946e1,_0x1f50f5);_0x2bd3e5(_0x1f50f5);});});}exports['GetTemplate']=function(_0x5f3696){var _0x5a3957=this;return new Promise(function(_0x736612,_0x2027f4){return db[_0x1ae0('0x17')][_0x1ae0('0x18')]({'raw':_0x5f3696[_0x1ae0('0x19')]?_0x5f3696['options'][_0x1ae0('0x1a')]===undefined?!![]:![]:!![],'where':_0x5f3696[_0x1ae0('0x19')]?_0x5f3696[_0x1ae0('0x19')][_0x1ae0('0x1b')]||null:null,'attributes':_0x5f3696['options']?_0x5f3696[_0x1ae0('0x19')][_0x1ae0('0x1c')]||null:null,'limit':_0x5f3696[_0x1ae0('0x19')]?_0x5f3696[_0x1ae0('0x19')][_0x1ae0('0x1d')]||null:null,'include':_0x5f3696[_0x1ae0('0x19')]?_0x5f3696['options'][_0x1ae0('0x1e')]?_[_0x1ae0('0x1f')](_0x5f3696['options'][_0x1ae0('0x1e')],function(_0x299a9b){return{'model':db[_0x299a9b[_0x1ae0('0x20')]],'as':_0x299a9b['as'],'attributes':_0x299a9b[_0x1ae0('0x1c')],'include':_0x299a9b[_0x1ae0('0x1e')]?_[_0x1ae0('0x1f')](_0x299a9b[_0x1ae0('0x1e')],function(_0x48a8a2){return{'model':db[_0x48a8a2[_0x1ae0('0x20')]],'as':_0x48a8a2['as'],'attributes':_0x48a8a2[_0x1ae0('0x1c')],'include':_0x48a8a2['include']?_[_0x1ae0('0x1f')](_0x48a8a2['include'],function(_0x187e16){return{'model':db[_0x187e16['model']],'as':_0x187e16['as'],'attributes':_0x187e16[_0x1ae0('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1ae0('0xd')](function(_0x1ac76e){logger[_0x1ae0('0xe')](_0x1ae0('0x21'),_0x5f3696);logger[_0x1ae0('0x10')](_0x1ae0('0x21'),_0x5f3696,JSON[_0x1ae0('0x22')](_0x1ac76e));_0x736612(_0x1ac76e);})[_0x1ae0('0x23')](function(_0x2272d8){logger[_0x1ae0('0x12')]('GetTemplate',_0x2272d8['message'],_0x5f3696);_0x2027f4(_0x5a3957[_0x1ae0('0x12')](0x1f4,_0x2272d8[_0x1ae0('0x15')]));});});}; \ No newline at end of file +var _0xda33=['catch','GetTemplate','findAll','options','raw','attributes','limit','include','map','model','then','debug','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','info','request\x20sent','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','Template,\x20%s,\x20%s','message'];(function(_0x5b497b,_0x2905fc){var _0x2d7d36=function(_0x22dbf6){while(--_0x22dbf6){_0x5b497b['push'](_0x5b497b['shift']());}};_0x2d7d36(++_0x2905fc);}(_0xda33,0x156));var _0x3da3=function(_0x166515,_0x2a3bb8){_0x166515=_0x166515-0x0;var _0x1f62f6=_0xda33[_0x166515];return _0x1f62f6;};'use strict';var _=require(_0x3da3('0x0'));var util=require('util');var moment=require(_0x3da3('0x1'));var BPromise=require('bluebird');var rs=require(_0x3da3('0x2'));var fs=require('fs');var Redis=require(_0x3da3('0x3'));var db=require(_0x3da3('0x4'))['db'];var utils=require(_0x3da3('0x5'));var logger=require(_0x3da3('0x6'))('rpc');var config=require(_0x3da3('0x7'));var jayson=require(_0x3da3('0x8'));var client=jayson['client'][_0x3da3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x24df65,_0xfef113,_0x3e44bb){return new BPromise(function(_0x4417a4,_0x25470f){return client['request'](_0x24df65,_0x3e44bb)['then'](function(_0x118c06){logger[_0x3da3('0xa')]('Template,\x20%s,\x20%s',_0xfef113,_0x3da3('0xb'));logger['debug'](_0x3da3('0xc'),_0xfef113,_0x3da3('0xb'),JSON[_0x3da3('0xd')](_0x118c06));if(_0x118c06[_0x3da3('0xe')]){if(_0x118c06[_0x3da3('0xe')][_0x3da3('0xf')]===0x1f4){logger[_0x3da3('0xe')]('Template,\x20%s,\x20%s',_0xfef113,_0x118c06[_0x3da3('0xe')]['message']);return _0x25470f(_0x118c06[_0x3da3('0xe')]['message']);}logger['error'](_0x3da3('0x10'),_0xfef113,_0x118c06[_0x3da3('0xe')][_0x3da3('0x11')]);return _0x4417a4(_0x118c06[_0x3da3('0xe')][_0x3da3('0x11')]);}else{logger[_0x3da3('0xa')](_0x3da3('0x10'),_0xfef113,_0x3da3('0xb'));_0x4417a4(_0x118c06['result']['message']);}})[_0x3da3('0x12')](function(_0x580af1){logger[_0x3da3('0xe')](_0x3da3('0x10'),_0xfef113,_0x580af1);_0x25470f(_0x580af1);});});}exports[_0x3da3('0x13')]=function(_0x58fdbb){var _0x55f401=this;return new Promise(function(_0x1c5b42,_0x561b1b){return db['Template'][_0x3da3('0x14')]({'raw':_0x58fdbb[_0x3da3('0x15')]?_0x58fdbb[_0x3da3('0x15')][_0x3da3('0x16')]===undefined?!![]:![]:!![],'where':_0x58fdbb[_0x3da3('0x15')]?_0x58fdbb[_0x3da3('0x15')]['where']||null:null,'attributes':_0x58fdbb[_0x3da3('0x15')]?_0x58fdbb[_0x3da3('0x15')][_0x3da3('0x17')]||null:null,'limit':_0x58fdbb[_0x3da3('0x15')]?_0x58fdbb[_0x3da3('0x15')][_0x3da3('0x18')]||null:null,'include':_0x58fdbb[_0x3da3('0x15')]?_0x58fdbb['options'][_0x3da3('0x19')]?_[_0x3da3('0x1a')](_0x58fdbb['options'][_0x3da3('0x19')],function(_0x448c69){return{'model':db[_0x448c69['model']],'as':_0x448c69['as'],'attributes':_0x448c69['attributes'],'include':_0x448c69[_0x3da3('0x19')]?_['map'](_0x448c69[_0x3da3('0x19')],function(_0x170c7f){return{'model':db[_0x170c7f[_0x3da3('0x1b')]],'as':_0x170c7f['as'],'attributes':_0x170c7f[_0x3da3('0x17')],'include':_0x170c7f[_0x3da3('0x19')]?_[_0x3da3('0x1a')](_0x170c7f['include'],function(_0x3da68e){return{'model':db[_0x3da68e[_0x3da3('0x1b')]],'as':_0x3da68e['as'],'attributes':_0x3da68e[_0x3da3('0x17')]};}):[]};}):[]};}):[]:[]})[_0x3da3('0x1c')](function(_0xa5123b){logger[_0x3da3('0xa')]('GetTemplate',_0x58fdbb);logger[_0x3da3('0x1d')](_0x3da3('0x13'),_0x58fdbb,JSON['stringify'](_0xa5123b));_0x1c5b42(_0xa5123b);})[_0x3da3('0x12')](function(_0xf4cc73){logger['error'](_0x3da3('0x13'),_0xf4cc73[_0x3da3('0x11')],_0x58fdbb);_0x561b1b(_0x55f401['error'](0x1f4,_0xf4cc73[_0x3da3('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 1f93dc7..1bf8f00 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 _0xa7a1=['isAuthenticated','index','/:id','show','/:id/all_conditions','getAllConditions','getAnyConditions','/:id/actions','getActions','create','post','/:id/any_conditions','update','delete','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xa7a1,0x1f2));var _0x1a7a=function(_0x41d853,_0xf2796){_0x41d853=_0x41d853-0x0;var _0x45dc7c=_0xa7a1[_0x41d853];return _0x45dc7c;};'use strict';var multer=require('multer');var util=require(_0x1a7a('0x0'));var path=require(_0x1a7a('0x1'));var timeout=require(_0x1a7a('0x2'));var express=require(_0x1a7a('0x3'));var router=express['Router']();var auth=require(_0x1a7a('0x4'));var interaction=require(_0x1a7a('0x5'));var config=require(_0x1a7a('0x6'));var controller=require('./trigger.controller');router[_0x1a7a('0x7')]('/',auth[_0x1a7a('0x8')](),controller[_0x1a7a('0x9')]);router[_0x1a7a('0x7')](_0x1a7a('0xa'),auth['isAuthenticated'](),controller[_0x1a7a('0xb')]);router[_0x1a7a('0x7')](_0x1a7a('0xc'),auth['isAuthenticated'](),controller[_0x1a7a('0xd')]);router[_0x1a7a('0x7')]('/:id/any_conditions',auth['isAuthenticated'](),controller[_0x1a7a('0xe')]);router[_0x1a7a('0x7')](_0x1a7a('0xf'),auth['isAuthenticated'](),controller[_0x1a7a('0x10')]);router['post']('/',auth[_0x1a7a('0x8')](),controller[_0x1a7a('0x11')]);router[_0x1a7a('0x12')](_0x1a7a('0xc'),auth[_0x1a7a('0x8')](),controller['addAllCondition']);router['post'](_0x1a7a('0x13'),auth[_0x1a7a('0x8')](),controller['addAnyCondition']);router[_0x1a7a('0x12')]('/:id/actions',auth[_0x1a7a('0x8')](),controller['addAction']);router['put'](_0x1a7a('0xa'),auth[_0x1a7a('0x8')](),controller[_0x1a7a('0x14')]);router[_0x1a7a('0x15')](_0x1a7a('0xa'),auth[_0x1a7a('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x16c4=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id','show','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','create','post','/:id/all_conditions','addAllCondition','addAnyCondition','addAction','put','update','delete','destroy','exports','util','path'];(function(_0x3b4d88,_0x4f5760){var _0x184461=function(_0x47dad3){while(--_0x47dad3){_0x3b4d88['push'](_0x3b4d88['shift']());}};_0x184461(++_0x4f5760);}(_0x16c4,0x1ce));var _0x416c=function(_0x128bef,_0xc7a0af){_0x128bef=_0x128bef-0x0;var _0x1ba862=_0x16c4[_0x128bef];return _0x1ba862;};'use strict';var multer=require('multer');var util=require(_0x416c('0x0'));var path=require(_0x416c('0x1'));var timeout=require(_0x416c('0x2'));var express=require(_0x416c('0x3'));var router=express[_0x416c('0x4')]();var auth=require(_0x416c('0x5'));var interaction=require(_0x416c('0x6'));var config=require(_0x416c('0x7'));var controller=require(_0x416c('0x8'));router[_0x416c('0x9')]('/',auth[_0x416c('0xa')](),controller[_0x416c('0xb')]);router[_0x416c('0x9')](_0x416c('0xc'),auth[_0x416c('0xa')](),controller[_0x416c('0xd')]);router['get']('/:id/all_conditions',auth[_0x416c('0xa')](),controller[_0x416c('0xe')]);router[_0x416c('0x9')](_0x416c('0xf'),auth[_0x416c('0xa')](),controller[_0x416c('0x10')]);router['get'](_0x416c('0x11'),auth[_0x416c('0xa')](),controller['getActions']);router['post']('/',auth[_0x416c('0xa')](),controller[_0x416c('0x12')]);router[_0x416c('0x13')](_0x416c('0x14'),auth[_0x416c('0xa')](),controller[_0x416c('0x15')]);router['post'](_0x416c('0xf'),auth[_0x416c('0xa')](),controller[_0x416c('0x16')]);router[_0x416c('0x13')](_0x416c('0x11'),auth[_0x416c('0xa')](),controller[_0x416c('0x17')]);router[_0x416c('0x18')]('/:id',auth[_0x416c('0xa')](),controller[_0x416c('0x19')]);router[_0x416c('0x1a')](_0x416c('0xc'),auth[_0x416c('0xa')](),controller[_0x416c('0x1b')]);module[_0x416c('0x1c')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 30a6df8..372b5d3 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 _0x38e7=['exports','STRING','sequelize'];(function(_0x19b00c,_0x277b92){var _0x62a45c=function(_0x91769d){while(--_0x91769d){_0x19b00c['push'](_0x19b00c['shift']());}};_0x62a45c(++_0x277b92);}(_0x38e7,0x119));var _0x738e=function(_0xd22d95,_0xc59f8f){_0xd22d95=_0xd22d95-0x0;var _0x15d7a3=_0x38e7[_0xd22d95];return _0x15d7a3;};'use strict';var Sequelize=require(_0x738e('0x0'));module[_0x738e('0x1')]={'name':{'type':Sequelize[_0x738e('0x2')]},'channel':{'type':Sequelize[_0x738e('0x2')]},'description':{'type':Sequelize[_0x738e('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x19a5=['exports','STRING','BOOLEAN','sequelize'];(function(_0xdc3575,_0x592e0a){var _0x4e1b84=function(_0x1754b0){while(--_0x1754b0){_0xdc3575['push'](_0xdc3575['shift']());}};_0x4e1b84(++_0x592e0a);}(_0x19a5,0xbf));var _0x519a=function(_0xdf6812,_0x26eeb0){_0xdf6812=_0xdf6812-0x0;var _0x22f9ea=_0x19a5[_0xdf6812];return _0x22f9ea;};'use strict';var Sequelize=require(_0x519a('0x0'));module[_0x519a('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x519a('0x2')]},'status':{'type':Sequelize[_0x519a('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 17afb3f..b87f833 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 _0xc65b=['userProfileId','autoAssociation','error','params','addAllCondition','Condition','addAnyCondition','TriggerAnyId','findOne','order','pick','getAllConditions','getAnyConditions','hasOwnProperty','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','limit','apply','save','update','destroy','then','get','Triggers','UserProfileResource','end','stack','name','send','index','map','Trigger','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','filter','where','VIRTUAL','merge','options','count','includeAll','include','findAll','catch','show','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection'];(function(_0x117fa8,_0x3be473){var _0x3205a1=function(_0x1309fa){while(--_0x1309fa){_0x117fa8['push'](_0x117fa8['shift']());}};_0x3205a1(++_0x3be473);}(_0xc65b,0x12f));var _0xbc65=function(_0x172f5d,_0x2bff0f){_0x172f5d=_0x172f5d-0x0;var _0x268a72=_0xc65b[_0x172f5d];return _0x268a72;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbc65('0x0'));var rimraf=require(_0xbc65('0x1'));var zipdir=require(_0xbc65('0x2'));var jsonpatch=require(_0xbc65('0x3'));var rp=require(_0xbc65('0x4'));var moment=require(_0xbc65('0x5'));var BPromise=require(_0xbc65('0x6'));var Mustache=require('mustache');var util=require(_0xbc65('0x7'));var path=require(_0xbc65('0x8'));var sox=require('sox');var csv=require(_0xbc65('0x9'));var ejs=require(_0xbc65('0xa'));var fs=require('fs');var _=require(_0xbc65('0xb'));var squel=require(_0xbc65('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xbc65('0xd'));var toCsv=require(_0xbc65('0x9'));var querystring=require(_0xbc65('0xe'));var Papa=require(_0xbc65('0xf'));var Redis=require(_0xbc65('0x10'));var authService=require(_0xbc65('0x11'));var qs=require(_0xbc65('0x12'));var as=require(_0xbc65('0x13'));var hardwareService=require(_0xbc65('0x14'));var logger=require(_0xbc65('0x15'))(_0xbc65('0x16'));var utils=require(_0xbc65('0x17'));var config=require(_0xbc65('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x6866d1,_0x7deba2){_0x7deba2=_0x7deba2||0xcc;return function(_0x8c8486){if(_0x8c8486){return _0x6866d1[_0xbc65('0x19')](_0x7deba2);}return _0x6866d1[_0xbc65('0x1a')](_0x7deba2)['end']();};}function respondWithResult(_0x4ee45d,_0x214bf8){_0x214bf8=_0x214bf8||0xc8;return function(_0x25ce28){if(_0x25ce28){return _0x4ee45d[_0xbc65('0x1a')](_0x214bf8)[_0xbc65('0x1b')](_0x25ce28);}};}function respondWithFilteredResult(_0x130d41,_0x33a9bc){return function(_0x5c8b5a){if(_0x5c8b5a){var _0x5e5b4d=_0x5c8b5a['count'],_0x33bf42=_0x33a9bc[_0xbc65('0x1c')],_0x239fb1=_0x33a9bc[_0xbc65('0x1c')]+_0x33a9bc[_0xbc65('0x1d')],_0x2caa3c;if(_0x239fb1>=_0x5e5b4d){_0x239fb1=_0x5e5b4d;_0x2caa3c=0xc8;}else{_0x2caa3c=0xce;}_0x130d41[_0xbc65('0x1a')](_0x2caa3c);return _0x130d41['set']('Content-Range',_0x33bf42+'-'+_0x239fb1+'/'+_0x5e5b4d)[_0xbc65('0x1b')](_0x5c8b5a);}return null;};}function patchUpdates(_0x481199){return function(_0x90e2f3){try{jsonpatch[_0xbc65('0x1e')](_0x90e2f3,_0x481199,!![]);}catch(_0x46c729){return BPromise['reject'](_0x46c729);}return _0x90e2f3[_0xbc65('0x1f')]();};}function saveUpdates(_0xea173e,_0x47f3be){return function(_0x3f31b0){if(_0x3f31b0){return _0x3f31b0[_0xbc65('0x20')](_0xea173e)['then'](function(_0x465203){return _0x465203;});}return null;};}function removeEntity(_0x4c4815,_0x2d5b90){return function(_0x407590){if(_0x407590){return _0x407590[_0xbc65('0x21')]()[_0xbc65('0x22')](function(){var _0x39ab7c=_0x407590[_0xbc65('0x23')]({'plain':!![]});var _0x58a076=_0xbc65('0x24');return db[_0xbc65('0x25')][_0xbc65('0x21')]({'where':{'type':_0x58a076,'resourceId':_0x39ab7c['id']}})[_0xbc65('0x22')](function(){return _0x407590;});})[_0xbc65('0x22')](function(){_0x4c4815[_0xbc65('0x1a')](0xcc)[_0xbc65('0x26')]();});}};}function handleEntityNotFound(_0x2dc537,_0x231b19){return function(_0x3fac7b){if(!_0x3fac7b){_0x2dc537['sendStatus'](0x194);}return _0x3fac7b;};}function handleError(_0xb9eec1,_0x2190e3){_0x2190e3=_0x2190e3||0x1f4;return function(_0x2cda71){logger['error'](_0x2cda71[_0xbc65('0x27')]);if(_0x2cda71[_0xbc65('0x28')]){delete _0x2cda71[_0xbc65('0x28')];}_0xb9eec1[_0xbc65('0x1a')](_0x2190e3)[_0xbc65('0x29')](_0x2cda71);};}exports[_0xbc65('0x2a')]=function(_0x3558cb,_0x1fddd0){var _0x88417={},_0x27f12d={},_0x5725c5={'count':0x0,'rows':[]};var _0x3337a7=_[_0xbc65('0x2b')](db[_0xbc65('0x2c')][_0xbc65('0x2d')],function(_0x3950e8){return{'name':_0x3950e8[_0xbc65('0x2e')],'type':_0x3950e8[_0xbc65('0x2f')][_0xbc65('0x30')]};});_0x27f12d[_0xbc65('0x31')]=_[_0xbc65('0x2b')](_0x3337a7,_0xbc65('0x28'));_0x27f12d[_0xbc65('0x32')]=_['keys'](_0x3558cb[_0xbc65('0x32')]);_0x27f12d[_0xbc65('0x33')]=_[_0xbc65('0x34')](_0x27f12d[_0xbc65('0x31')],_0x27f12d[_0xbc65('0x32')]);_0x88417[_0xbc65('0x35')]=_[_0xbc65('0x34')](_0x27f12d[_0xbc65('0x31')],qs[_0xbc65('0x36')](_0x3558cb[_0xbc65('0x32')][_0xbc65('0x36')]));_0x88417[_0xbc65('0x35')]=_0x88417[_0xbc65('0x35')][_0xbc65('0x37')]?_0x88417[_0xbc65('0x35')]:_0x27f12d[_0xbc65('0x31')];if(!_0x3558cb[_0xbc65('0x32')]['hasOwnProperty'](_0xbc65('0x38'))){_0x88417[_0xbc65('0x1d')]=qs[_0xbc65('0x1d')](_0x3558cb[_0xbc65('0x32')][_0xbc65('0x1d')]);_0x88417[_0xbc65('0x1c')]=qs[_0xbc65('0x1c')](_0x3558cb['query'][_0xbc65('0x1c')]);}_0x88417['order']=qs['sort'](_0x3558cb[_0xbc65('0x32')][_0xbc65('0x39')]);_0x88417['where']=qs['filters'](_['pick'](_0x3558cb[_0xbc65('0x32')],_0x27f12d['filters']));if(_0x3558cb[_0xbc65('0x32')][_0xbc65('0x3a')]){_0x88417[_0xbc65('0x3b')]=_['merge'](_0x88417[_0xbc65('0x3b')],{'$or':_[_0xbc65('0x2b')](_0x3337a7,function(_0x119623){if(_0x119623['type']!==_0xbc65('0x3c')){var _0x296219={};_0x296219[_0x119623[_0xbc65('0x28')]]={'$like':'%'+_0x3558cb[_0xbc65('0x32')][_0xbc65('0x3a')]+'%'};return _0x296219;}})});}_0x88417=_[_0xbc65('0x3d')]({},_0x88417,_0x3558cb[_0xbc65('0x3e')]);var _0x3373fe={'where':_0x88417[_0xbc65('0x3b')]};return db[_0xbc65('0x2c')][_0xbc65('0x3f')](_0x3373fe)[_0xbc65('0x22')](function(_0x4366cd){_0x5725c5['count']=_0x4366cd;if(_0x3558cb[_0xbc65('0x32')][_0xbc65('0x40')]){_0x88417[_0xbc65('0x41')]=[{'all':!![]}];}return db[_0xbc65('0x2c')][_0xbc65('0x42')](_0x88417);})[_0xbc65('0x22')](function(_0x4622e2){_0x5725c5['rows']=_0x4622e2;return _0x5725c5;})['then'](respondWithFilteredResult(_0x1fddd0,_0x88417))[_0xbc65('0x43')](handleError(_0x1fddd0,null));};exports[_0xbc65('0x44')]=function(_0x42f83e,_0x1cb115){var _0x39477a={'raw':![],'where':{'id':_0x42f83e['params']['id']}},_0x2527f7={};_0x2527f7[_0xbc65('0x31')]=_[_0xbc65('0x45')](db[_0xbc65('0x2c')]['rawAttributes']);_0x2527f7[_0xbc65('0x32')]=_[_0xbc65('0x45')](_0x42f83e[_0xbc65('0x32')]);_0x2527f7[_0xbc65('0x33')]=_[_0xbc65('0x34')](_0x2527f7[_0xbc65('0x31')],_0x2527f7[_0xbc65('0x32')]);_0x39477a[_0xbc65('0x35')]=_['intersection'](_0x2527f7[_0xbc65('0x31')],qs[_0xbc65('0x36')](_0x42f83e['query'][_0xbc65('0x36')]));_0x39477a['attributes']=_0x39477a[_0xbc65('0x35')][_0xbc65('0x37')]?_0x39477a[_0xbc65('0x35')]:_0x2527f7['model'];if(_0x42f83e[_0xbc65('0x32')][_0xbc65('0x40')]){_0x39477a[_0xbc65('0x41')]=[{'all':!![]}];}_0x39477a=_[_0xbc65('0x3d')]({},_0x39477a,_0x42f83e[_0xbc65('0x3e')]);return db['Trigger'][_0xbc65('0x46')](_0x39477a)[_0xbc65('0x22')](handleEntityNotFound(_0x1cb115,null))[_0xbc65('0x22')](respondWithResult(_0x1cb115,null))['catch'](handleError(_0x1cb115,null));};exports['create']=function(_0x1d3356,_0x2eceb0){return db[_0xbc65('0x2c')][_0xbc65('0x47')](_0x1d3356[_0xbc65('0x48')],{})[_0xbc65('0x22')](function(_0x10fe96){var _0x5a292c=_0x1d3356[_0xbc65('0x49')][_0xbc65('0x23')]({'plain':!![]});if(!_0x5a292c)throw new Error(_0xbc65('0x4a'));if(_0x5a292c[_0xbc65('0x4b')]===_0xbc65('0x49')){var _0xfeec44=_0x10fe96[_0xbc65('0x23')]({'plain':!![]});var _0x210103=_0xbc65('0x24');return db[_0xbc65('0x4c')][_0xbc65('0x46')]({'where':{'name':_0x210103,'userProfileId':_0x5a292c[_0xbc65('0x4d')]},'raw':!![]})['then'](function(_0x2b806c){if(_0x2b806c&&_0x2b806c[_0xbc65('0x4e')]===0x0){return db[_0xbc65('0x25')][_0xbc65('0x47')]({'name':_0xfeec44['name'],'resourceId':_0xfeec44['id'],'type':_0x2b806c[_0xbc65('0x28')],'sectionId':_0x2b806c['id']},{})['then'](function(){return _0x10fe96;});}else{return _0x10fe96;}})[_0xbc65('0x43')](function(_0x24049a){logger[_0xbc65('0x4f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x24049a);throw _0x24049a;});}return _0x10fe96;})[_0xbc65('0x22')](respondWithResult(_0x2eceb0,0xc9))[_0xbc65('0x43')](handleError(_0x2eceb0,null));};exports['update']=function(_0x16f431,_0x3fa014){if(_0x16f431[_0xbc65('0x48')]['id']){delete _0x16f431['body']['id'];}return db[_0xbc65('0x2c')]['find']({'where':{'id':_0x16f431[_0xbc65('0x50')]['id']}})[_0xbc65('0x22')](handleEntityNotFound(_0x3fa014,null))[_0xbc65('0x22')](saveUpdates(_0x16f431[_0xbc65('0x48')],null))[_0xbc65('0x22')](respondWithResult(_0x3fa014,null))[_0xbc65('0x43')](handleError(_0x3fa014,null));};exports[_0xbc65('0x21')]=function(_0x3a17a2,_0x125320){return db[_0xbc65('0x2c')][_0xbc65('0x46')]({'where':{'id':_0x3a17a2[_0xbc65('0x50')]['id']}})[_0xbc65('0x22')](handleEntityNotFound(_0x125320,null))[_0xbc65('0x22')](removeEntity(_0x125320,null))[_0xbc65('0x43')](handleError(_0x125320,null));};exports[_0xbc65('0x51')]=function(_0x332e7f,_0x4214dd,_0x59429b){if(_0x332e7f[_0xbc65('0x48')]['id']){delete _0x332e7f[_0xbc65('0x48')]['id'];}return db['Trigger'][_0xbc65('0x46')]({'where':{'id':_0x332e7f[_0xbc65('0x50')]['id']}})[_0xbc65('0x22')](handleEntityNotFound(_0x4214dd,null))['then'](function(_0x1f8c03){if(_0x1f8c03){_0x332e7f['body']['TriggerAllId']=_0x1f8c03['id'];return db[_0xbc65('0x52')][_0xbc65('0x47')](_0x332e7f['body']);}})[_0xbc65('0x22')](respondWithResult(_0x4214dd,null))[_0xbc65('0x43')](handleError(_0x4214dd,null));};exports[_0xbc65('0x53')]=function(_0x1a00d4,_0x360964,_0xd940e8){if(_0x1a00d4[_0xbc65('0x48')]['id']){delete _0x1a00d4[_0xbc65('0x48')]['id'];}return db[_0xbc65('0x2c')]['find']({'where':{'id':_0x1a00d4['params']['id']}})[_0xbc65('0x22')](handleEntityNotFound(_0x360964,null))['then'](function(_0xa2c22c){if(_0xa2c22c){_0x1a00d4[_0xbc65('0x48')][_0xbc65('0x54')]=_0xa2c22c['id'];return db[_0xbc65('0x52')][_0xbc65('0x47')](_0x1a00d4[_0xbc65('0x48')]);}})[_0xbc65('0x22')](respondWithResult(_0x360964,null))[_0xbc65('0x43')](handleError(_0x360964,null));};exports['getAllConditions']=function(_0x4f9bb6,_0x301da6,_0x323555){var _0x5379be={};var _0x349b82={};var _0x441d40;var _0x4d5c1f;return db[_0xbc65('0x2c')][_0xbc65('0x55')]({'where':{'id':_0x4f9bb6[_0xbc65('0x50')]['id']}})[_0xbc65('0x22')](handleEntityNotFound(_0x301da6,null))[_0xbc65('0x22')](function(_0x532aff){if(_0x532aff){_0x441d40=_0x532aff;_0x349b82[_0xbc65('0x31')]=_[_0xbc65('0x45')](db['Condition']['rawAttributes']);_0x349b82['query']=_[_0xbc65('0x45')](_0x4f9bb6['query']);_0x349b82['filters']=_[_0xbc65('0x34')](_0x349b82[_0xbc65('0x31')],_0x349b82[_0xbc65('0x32')]);_0x5379be[_0xbc65('0x35')]=_[_0xbc65('0x34')](_0x349b82['model'],qs[_0xbc65('0x36')](_0x4f9bb6['query'][_0xbc65('0x36')]));_0x5379be[_0xbc65('0x35')]=_0x5379be[_0xbc65('0x35')][_0xbc65('0x37')]?_0x5379be['attributes']:_0x349b82[_0xbc65('0x31')];_0x5379be[_0xbc65('0x56')]=qs['sort'](_0x4f9bb6[_0xbc65('0x32')][_0xbc65('0x39')]);_0x5379be[_0xbc65('0x3b')]=qs[_0xbc65('0x33')](_[_0xbc65('0x57')](_0x4f9bb6[_0xbc65('0x32')],_0x349b82['filters']));if(_0x4f9bb6[_0xbc65('0x32')][_0xbc65('0x3a')]){_0x5379be[_0xbc65('0x3b')]=_['merge'](_0x5379be['where'],{'$or':_[_0xbc65('0x2b')](_0x5379be[_0xbc65('0x35')],function(_0x55b5f5){var _0x41b567={};_0x41b567[_0x55b5f5]={'$like':'%'+_0x4f9bb6[_0xbc65('0x32')]['filter']+'%'};return _0x41b567;})});}_0x5379be=_[_0xbc65('0x3d')]({},_0x5379be,_0x4f9bb6['options']);return _0x441d40[_0xbc65('0x58')](_0x5379be);}})[_0xbc65('0x22')](function(_0x5a3607){if(_0x5a3607){_0x4d5c1f=_0x5a3607[_0xbc65('0x37')];if(!_0x4f9bb6[_0xbc65('0x32')]['hasOwnProperty'](_0xbc65('0x38'))){_0x5379be[_0xbc65('0x1d')]=qs[_0xbc65('0x1d')](_0x4f9bb6[_0xbc65('0x32')][_0xbc65('0x1d')]);_0x5379be[_0xbc65('0x1c')]=qs['offset'](_0x4f9bb6[_0xbc65('0x32')][_0xbc65('0x1c')]);}return _0x441d40[_0xbc65('0x58')](_0x5379be);}})[_0xbc65('0x22')](function(_0x3890e2){if(_0x3890e2){return _0x3890e2?{'count':_0x4d5c1f,'rows':_0x3890e2}:null;}})['then'](respondWithResult(_0x301da6,null))[_0xbc65('0x43')](handleError(_0x301da6,null));};exports['getAnyConditions']=function(_0xbbd3e6,_0x41812d,_0x1e26c7){var _0x3bb3b8={};var _0x5232d2={};var _0x1804b3;var _0x35ff9f;return db['Trigger'][_0xbc65('0x55')]({'where':{'id':_0xbbd3e6[_0xbc65('0x50')]['id']}})[_0xbc65('0x22')](handleEntityNotFound(_0x41812d,null))['then'](function(_0x33c8fc){if(_0x33c8fc){_0x1804b3=_0x33c8fc;_0x5232d2['model']=_[_0xbc65('0x45')](db[_0xbc65('0x52')][_0xbc65('0x2d')]);_0x5232d2['query']=_[_0xbc65('0x45')](_0xbbd3e6[_0xbc65('0x32')]);_0x5232d2[_0xbc65('0x33')]=_[_0xbc65('0x34')](_0x5232d2[_0xbc65('0x31')],_0x5232d2['query']);_0x3bb3b8[_0xbc65('0x35')]=_[_0xbc65('0x34')](_0x5232d2[_0xbc65('0x31')],qs[_0xbc65('0x36')](_0xbbd3e6[_0xbc65('0x32')][_0xbc65('0x36')]));_0x3bb3b8[_0xbc65('0x35')]=_0x3bb3b8['attributes'][_0xbc65('0x37')]?_0x3bb3b8[_0xbc65('0x35')]:_0x5232d2[_0xbc65('0x31')];_0x3bb3b8[_0xbc65('0x56')]=qs['sort'](_0xbbd3e6[_0xbc65('0x32')]['sort']);_0x3bb3b8[_0xbc65('0x3b')]=qs[_0xbc65('0x33')](_[_0xbc65('0x57')](_0xbbd3e6[_0xbc65('0x32')],_0x5232d2['filters']));if(_0xbbd3e6[_0xbc65('0x32')][_0xbc65('0x3a')]){_0x3bb3b8['where']=_[_0xbc65('0x3d')](_0x3bb3b8[_0xbc65('0x3b')],{'$or':_[_0xbc65('0x2b')](_0x3bb3b8[_0xbc65('0x35')],function(_0x1f7b21){var _0x31386a={};_0x31386a[_0x1f7b21]={'$like':'%'+_0xbbd3e6[_0xbc65('0x32')][_0xbc65('0x3a')]+'%'};return _0x31386a;})});}_0x3bb3b8=_[_0xbc65('0x3d')]({},_0x3bb3b8,_0xbbd3e6[_0xbc65('0x3e')]);return _0x1804b3[_0xbc65('0x59')](_0x3bb3b8);}})[_0xbc65('0x22')](function(_0x32d8a4){if(_0x32d8a4){_0x35ff9f=_0x32d8a4[_0xbc65('0x37')];if(!_0xbbd3e6['query'][_0xbc65('0x5a')](_0xbc65('0x38'))){_0x3bb3b8['limit']=qs['limit'](_0xbbd3e6[_0xbc65('0x32')][_0xbc65('0x1d')]);_0x3bb3b8['offset']=qs['offset'](_0xbbd3e6['query'][_0xbc65('0x1c')]);}return _0x1804b3[_0xbc65('0x59')](_0x3bb3b8);}})[_0xbc65('0x22')](function(_0x5da384){if(_0x5da384){return _0x5da384?{'count':_0x35ff9f,'rows':_0x5da384}:null;}})['then'](respondWithResult(_0x41812d,null))[_0xbc65('0x43')](handleError(_0x41812d,null));};exports[_0xbc65('0x5b')]=function(_0x12b187,_0x3f9c60,_0x3abfc4){if(_0x12b187['body']['id']){delete _0x12b187[_0xbc65('0x48')]['id'];}return db[_0xbc65('0x2c')]['find']({'where':{'id':_0x12b187[_0xbc65('0x50')]['id']}})[_0xbc65('0x22')](handleEntityNotFound(_0x3f9c60,null))[_0xbc65('0x22')](function(_0xd6ae51){if(_0xd6ae51){_0x12b187[_0xbc65('0x48')][_0xbc65('0x5c')]=_0xd6ae51['id'];return db[_0xbc65('0x5d')][_0xbc65('0x47')](_0x12b187[_0xbc65('0x48')]);}})['then'](respondWithResult(_0x3f9c60,null))[_0xbc65('0x43')](handleError(_0x3f9c60,null));};exports[_0xbc65('0x5e')]=function(_0x2efaa7,_0x2630b9,_0x340b22){var _0x1498ed={};var _0x2efe40={};var _0x23b519;var _0x3da6b6;return db[_0xbc65('0x2c')]['findOne']({'where':{'id':_0x2efaa7[_0xbc65('0x50')]['id']}})[_0xbc65('0x22')](handleEntityNotFound(_0x2630b9,null))['then'](function(_0xfa6d3){if(_0xfa6d3){_0x23b519=_0xfa6d3;_0x2efe40[_0xbc65('0x31')]=_[_0xbc65('0x45')](db[_0xbc65('0x5d')][_0xbc65('0x2d')]);_0x2efe40[_0xbc65('0x32')]=_[_0xbc65('0x45')](_0x2efaa7[_0xbc65('0x32')]);_0x2efe40[_0xbc65('0x33')]=_[_0xbc65('0x34')](_0x2efe40[_0xbc65('0x31')],_0x2efe40[_0xbc65('0x32')]);_0x1498ed[_0xbc65('0x35')]=_[_0xbc65('0x34')](_0x2efe40[_0xbc65('0x31')],qs[_0xbc65('0x36')](_0x2efaa7['query'][_0xbc65('0x36')]));_0x1498ed[_0xbc65('0x35')]=_0x1498ed['attributes'][_0xbc65('0x37')]?_0x1498ed[_0xbc65('0x35')]:_0x2efe40[_0xbc65('0x31')];_0x1498ed['order']=qs['sort'](_0x2efaa7[_0xbc65('0x32')]['sort']);_0x1498ed['where']=qs[_0xbc65('0x33')](_[_0xbc65('0x57')](_0x2efaa7['query'],_0x2efe40[_0xbc65('0x33')]));if(_0x2efaa7[_0xbc65('0x32')][_0xbc65('0x3a')]){_0x1498ed[_0xbc65('0x3b')]=_[_0xbc65('0x3d')](_0x1498ed[_0xbc65('0x3b')],{'$or':_[_0xbc65('0x2b')](_0x1498ed['attributes'],function(_0x40adc0){var _0x2826c4={};_0x2826c4[_0x40adc0]={'$like':'%'+_0x2efaa7['query'][_0xbc65('0x3a')]+'%'};return _0x2826c4;})});}_0x1498ed=_['merge']({},_0x1498ed,_0x2efaa7[_0xbc65('0x3e')]);return _0x23b519[_0xbc65('0x5e')](_0x1498ed);}})[_0xbc65('0x22')](function(_0x23a90b){if(_0x23a90b){_0x3da6b6=_0x23a90b['length'];if(!_0x2efaa7[_0xbc65('0x32')][_0xbc65('0x5a')]('nolimit')){_0x1498ed[_0xbc65('0x1d')]=qs[_0xbc65('0x1d')](_0x2efaa7['query']['limit']);_0x1498ed[_0xbc65('0x1c')]=qs[_0xbc65('0x1c')](_0x2efaa7[_0xbc65('0x32')]['offset']);}return _0x23b519[_0xbc65('0x5e')](_0x1498ed);}})[_0xbc65('0x22')](function(_0x3fd96c){if(_0x3fd96c){return _0x3fd96c?{'count':_0x3da6b6,'rows':_0x3fd96c}:null;}})[_0xbc65('0x22')](respondWithResult(_0x2630b9,null))[_0xbc65('0x43')](handleError(_0x2630b9,null));}; \ No newline at end of file +var _0xd9bc=['getActions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','limit','Content-Range','reject','save','update','then','destroy','Triggers','UserProfileResource','end','error','stack','name','send','index','Trigger','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','length','sort','where','pick','filter','map','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','catch','show','keys','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','addAllCondition','TriggerAllId','addAnyCondition','TriggerAnyId','Condition','findOne','order','getAllConditions','nolimit','getAnyConditions','hasOwnProperty','addAction','TriggerId','Action'];(function(_0x1b5a5a,_0x1c3b75){var _0x42b32d=function(_0x3d35ab){while(--_0x3d35ab){_0x1b5a5a['push'](_0x1b5a5a['shift']());}};_0x42b32d(++_0x1c3b75);}(_0xd9bc,0xc7));var _0xcd9b=function(_0x5c4dd9,_0x355a31){_0x5c4dd9=_0x5c4dd9-0x0;var _0x2aee26=_0xd9bc[_0x5c4dd9];return _0x2aee26;};'use strict';var pdf=require(_0xcd9b('0x0'));var emlformat=require(_0xcd9b('0x1'));var rimraf=require(_0xcd9b('0x2'));var zipdir=require(_0xcd9b('0x3'));var jsonpatch=require(_0xcd9b('0x4'));var rp=require(_0xcd9b('0x5'));var moment=require(_0xcd9b('0x6'));var BPromise=require(_0xcd9b('0x7'));var Mustache=require(_0xcd9b('0x8'));var util=require('util');var path=require(_0xcd9b('0x9'));var sox=require(_0xcd9b('0xa'));var csv=require(_0xcd9b('0xb'));var ejs=require(_0xcd9b('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xcd9b('0xd'));var crypto=require(_0xcd9b('0xe'));var jsforce=require(_0xcd9b('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xcd9b('0xb'));var querystring=require(_0xcd9b('0x10'));var Papa=require(_0xcd9b('0x11'));var Redis=require(_0xcd9b('0x12'));var authService=require(_0xcd9b('0x13'));var qs=require(_0xcd9b('0x14'));var as=require(_0xcd9b('0x15'));var hardwareService=require(_0xcd9b('0x16'));var logger=require(_0xcd9b('0x17'))(_0xcd9b('0x18'));var utils=require(_0xcd9b('0x19'));var config=require(_0xcd9b('0x1a'));var db=require(_0xcd9b('0x1b'))['db'];function respondWithStatusCode(_0x73a04b,_0x105b8d){_0x105b8d=_0x105b8d||0xcc;return function(_0x2ccd7e){if(_0x2ccd7e){return _0x73a04b[_0xcd9b('0x1c')](_0x105b8d);}return _0x73a04b[_0xcd9b('0x1d')](_0x105b8d)['end']();};}function respondWithResult(_0x5e1fcb,_0x55e333){_0x55e333=_0x55e333||0xc8;return function(_0x559cae){if(_0x559cae){return _0x5e1fcb['status'](_0x55e333)['json'](_0x559cae);}};}function respondWithFilteredResult(_0xa2e481,_0x36a2fb){return function(_0x37bfc1){if(_0x37bfc1){var _0x1f803e=_0x37bfc1['count'],_0x1e8b40=_0x36a2fb[_0xcd9b('0x1e')],_0x1ac868=_0x36a2fb[_0xcd9b('0x1e')]+_0x36a2fb[_0xcd9b('0x1f')],_0x19e66b;if(_0x1ac868>=_0x1f803e){_0x1ac868=_0x1f803e;_0x19e66b=0xc8;}else{_0x19e66b=0xce;}_0xa2e481[_0xcd9b('0x1d')](_0x19e66b);return _0xa2e481['set'](_0xcd9b('0x20'),_0x1e8b40+'-'+_0x1ac868+'/'+_0x1f803e)['json'](_0x37bfc1);}return null;};}function patchUpdates(_0x45abf3){return function(_0x479bce){try{jsonpatch['apply'](_0x479bce,_0x45abf3,!![]);}catch(_0x258585){return BPromise[_0xcd9b('0x21')](_0x258585);}return _0x479bce[_0xcd9b('0x22')]();};}function saveUpdates(_0x35da3e,_0x59eb99){return function(_0x483b3b){if(_0x483b3b){return _0x483b3b[_0xcd9b('0x23')](_0x35da3e)[_0xcd9b('0x24')](function(_0x2927ce){return _0x2927ce;});}return null;};}function removeEntity(_0x20e1d6,_0xde590c){return function(_0x44a9fe){if(_0x44a9fe){return _0x44a9fe[_0xcd9b('0x25')]()['then'](function(){var _0x1946bb=_0x44a9fe['get']({'plain':!![]});var _0x4c72eb=_0xcd9b('0x26');return db[_0xcd9b('0x27')][_0xcd9b('0x25')]({'where':{'type':_0x4c72eb,'resourceId':_0x1946bb['id']}})[_0xcd9b('0x24')](function(){return _0x44a9fe;});})[_0xcd9b('0x24')](function(){_0x20e1d6['status'](0xcc)[_0xcd9b('0x28')]();});}};}function handleEntityNotFound(_0xc8c967,_0x5a41bf){return function(_0x490e6a){if(!_0x490e6a){_0xc8c967['sendStatus'](0x194);}return _0x490e6a;};}function handleError(_0x49cffd,_0x4553dc){_0x4553dc=_0x4553dc||0x1f4;return function(_0x1a0237){logger[_0xcd9b('0x29')](_0x1a0237[_0xcd9b('0x2a')]);if(_0x1a0237['name']){delete _0x1a0237[_0xcd9b('0x2b')];}_0x49cffd[_0xcd9b('0x1d')](_0x4553dc)[_0xcd9b('0x2c')](_0x1a0237);};}exports[_0xcd9b('0x2d')]=function(_0x3b3907,_0x18e1b8){var _0x326c4a={},_0x3844ef={},_0x202b81={'count':0x0,'rows':[]};var _0x40267b=_['map'](db[_0xcd9b('0x2e')][_0xcd9b('0x2f')],function(_0x405be9){return{'name':_0x405be9[_0xcd9b('0x30')],'type':_0x405be9[_0xcd9b('0x31')][_0xcd9b('0x32')]};});_0x3844ef['model']=_['map'](_0x40267b,_0xcd9b('0x2b'));_0x3844ef[_0xcd9b('0x33')]=_['keys'](_0x3b3907[_0xcd9b('0x33')]);_0x3844ef[_0xcd9b('0x34')]=_[_0xcd9b('0x35')](_0x3844ef['model'],_0x3844ef[_0xcd9b('0x33')]);_0x326c4a[_0xcd9b('0x36')]=_[_0xcd9b('0x35')](_0x3844ef[_0xcd9b('0x37')],qs[_0xcd9b('0x38')](_0x3b3907[_0xcd9b('0x33')][_0xcd9b('0x38')]));_0x326c4a[_0xcd9b('0x36')]=_0x326c4a[_0xcd9b('0x36')][_0xcd9b('0x39')]?_0x326c4a['attributes']:_0x3844ef['model'];if(!_0x3b3907[_0xcd9b('0x33')]['hasOwnProperty']('nolimit')){_0x326c4a['limit']=qs[_0xcd9b('0x1f')](_0x3b3907[_0xcd9b('0x33')][_0xcd9b('0x1f')]);_0x326c4a[_0xcd9b('0x1e')]=qs[_0xcd9b('0x1e')](_0x3b3907['query'][_0xcd9b('0x1e')]);}_0x326c4a['order']=qs[_0xcd9b('0x3a')](_0x3b3907[_0xcd9b('0x33')]['sort']);_0x326c4a[_0xcd9b('0x3b')]=qs[_0xcd9b('0x34')](_[_0xcd9b('0x3c')](_0x3b3907[_0xcd9b('0x33')],_0x3844ef[_0xcd9b('0x34')]));if(_0x3b3907[_0xcd9b('0x33')][_0xcd9b('0x3d')]){_0x326c4a[_0xcd9b('0x3b')]=_['merge'](_0x326c4a[_0xcd9b('0x3b')],{'$or':_[_0xcd9b('0x3e')](_0x40267b,function(_0x449f11){if(_0x449f11[_0xcd9b('0x31')]!==_0xcd9b('0x3f')){var _0x4e2d4a={};_0x4e2d4a[_0x449f11[_0xcd9b('0x2b')]]={'$like':'%'+_0x3b3907[_0xcd9b('0x33')][_0xcd9b('0x3d')]+'%'};return _0x4e2d4a;}})});}_0x326c4a=_[_0xcd9b('0x40')]({},_0x326c4a,_0x3b3907[_0xcd9b('0x41')]);var _0x21587a={'where':_0x326c4a[_0xcd9b('0x3b')]};return db[_0xcd9b('0x2e')]['count'](_0x21587a)[_0xcd9b('0x24')](function(_0x5303de){_0x202b81[_0xcd9b('0x42')]=_0x5303de;if(_0x3b3907[_0xcd9b('0x33')][_0xcd9b('0x43')]){_0x326c4a[_0xcd9b('0x44')]=[{'all':!![]}];}return db['Trigger'][_0xcd9b('0x45')](_0x326c4a);})[_0xcd9b('0x24')](function(_0x3861f9){_0x202b81[_0xcd9b('0x46')]=_0x3861f9;return _0x202b81;})[_0xcd9b('0x24')](respondWithFilteredResult(_0x18e1b8,_0x326c4a))[_0xcd9b('0x47')](handleError(_0x18e1b8,null));};exports[_0xcd9b('0x48')]=function(_0x18cd5d,_0x49419f){var _0x467778={'raw':![],'where':{'id':_0x18cd5d['params']['id']}},_0x426ee2={};_0x426ee2[_0xcd9b('0x37')]=_['keys'](db['Trigger']['rawAttributes']);_0x426ee2[_0xcd9b('0x33')]=_[_0xcd9b('0x49')](_0x18cd5d[_0xcd9b('0x33')]);_0x426ee2[_0xcd9b('0x34')]=_[_0xcd9b('0x35')](_0x426ee2[_0xcd9b('0x37')],_0x426ee2[_0xcd9b('0x33')]);_0x467778[_0xcd9b('0x36')]=_['intersection'](_0x426ee2[_0xcd9b('0x37')],qs[_0xcd9b('0x38')](_0x18cd5d['query'][_0xcd9b('0x38')]));_0x467778['attributes']=_0x467778[_0xcd9b('0x36')]['length']?_0x467778[_0xcd9b('0x36')]:_0x426ee2[_0xcd9b('0x37')];if(_0x18cd5d[_0xcd9b('0x33')][_0xcd9b('0x43')]){_0x467778[_0xcd9b('0x44')]=[{'all':!![]}];}_0x467778=_[_0xcd9b('0x40')]({},_0x467778,_0x18cd5d['options']);return db[_0xcd9b('0x2e')][_0xcd9b('0x4a')](_0x467778)[_0xcd9b('0x24')](handleEntityNotFound(_0x49419f,null))['then'](respondWithResult(_0x49419f,null))[_0xcd9b('0x47')](handleError(_0x49419f,null));};exports[_0xcd9b('0x4b')]=function(_0x3e4992,_0x373334){return db[_0xcd9b('0x2e')][_0xcd9b('0x4b')](_0x3e4992['body'],{})[_0xcd9b('0x24')](function(_0x125fb1){var _0x40c1bf=_0x3e4992[_0xcd9b('0x4c')][_0xcd9b('0x4d')]({'plain':!![]});if(!_0x40c1bf)throw new Error(_0xcd9b('0x4e'));if(_0x40c1bf['role']===_0xcd9b('0x4c')){var _0x3e6a93=_0x125fb1[_0xcd9b('0x4d')]({'plain':!![]});var _0x13436e=_0xcd9b('0x26');return db[_0xcd9b('0x4f')]['find']({'where':{'name':_0x13436e,'userProfileId':_0x40c1bf[_0xcd9b('0x50')]},'raw':!![]})['then'](function(_0x24ddef){if(_0x24ddef&&_0x24ddef['autoAssociation']===0x0){return db[_0xcd9b('0x27')][_0xcd9b('0x4b')]({'name':_0x3e6a93[_0xcd9b('0x2b')],'resourceId':_0x3e6a93['id'],'type':_0x24ddef[_0xcd9b('0x2b')],'sectionId':_0x24ddef['id']},{})[_0xcd9b('0x24')](function(){return _0x125fb1;});}else{return _0x125fb1;}})[_0xcd9b('0x47')](function(_0x48b581){logger['error'](_0xcd9b('0x51'),_0x48b581);throw _0x48b581;});}return _0x125fb1;})['then'](respondWithResult(_0x373334,0xc9))[_0xcd9b('0x47')](handleError(_0x373334,null));};exports[_0xcd9b('0x23')]=function(_0x11b602,_0x133318){if(_0x11b602[_0xcd9b('0x52')]['id']){delete _0x11b602[_0xcd9b('0x52')]['id'];}return db['Trigger'][_0xcd9b('0x4a')]({'where':{'id':_0x11b602[_0xcd9b('0x53')]['id']}})['then'](handleEntityNotFound(_0x133318,null))['then'](saveUpdates(_0x11b602[_0xcd9b('0x52')],null))['then'](respondWithResult(_0x133318,null))[_0xcd9b('0x47')](handleError(_0x133318,null));};exports[_0xcd9b('0x25')]=function(_0x4809d3,_0x201ccb){return db['Trigger'][_0xcd9b('0x4a')]({'where':{'id':_0x4809d3[_0xcd9b('0x53')]['id']}})[_0xcd9b('0x24')](handleEntityNotFound(_0x201ccb,null))[_0xcd9b('0x24')](removeEntity(_0x201ccb,null))['catch'](handleError(_0x201ccb,null));};exports[_0xcd9b('0x54')]=function(_0x4e87f4,_0x363af0,_0x336059){if(_0x4e87f4[_0xcd9b('0x52')]['id']){delete _0x4e87f4[_0xcd9b('0x52')]['id'];}return db[_0xcd9b('0x2e')][_0xcd9b('0x4a')]({'where':{'id':_0x4e87f4[_0xcd9b('0x53')]['id']}})[_0xcd9b('0x24')](handleEntityNotFound(_0x363af0,null))['then'](function(_0x3c9bdd){if(_0x3c9bdd){_0x4e87f4[_0xcd9b('0x52')][_0xcd9b('0x55')]=_0x3c9bdd['id'];return db['Condition'][_0xcd9b('0x4b')](_0x4e87f4[_0xcd9b('0x52')]);}})[_0xcd9b('0x24')](respondWithResult(_0x363af0,null))[_0xcd9b('0x47')](handleError(_0x363af0,null));};exports[_0xcd9b('0x56')]=function(_0x18a428,_0x359bc3,_0x3db09a){if(_0x18a428[_0xcd9b('0x52')]['id']){delete _0x18a428[_0xcd9b('0x52')]['id'];}return db[_0xcd9b('0x2e')][_0xcd9b('0x4a')]({'where':{'id':_0x18a428['params']['id']}})[_0xcd9b('0x24')](handleEntityNotFound(_0x359bc3,null))['then'](function(_0x532ae9){if(_0x532ae9){_0x18a428['body'][_0xcd9b('0x57')]=_0x532ae9['id'];return db[_0xcd9b('0x58')][_0xcd9b('0x4b')](_0x18a428[_0xcd9b('0x52')]);}})[_0xcd9b('0x24')](respondWithResult(_0x359bc3,null))['catch'](handleError(_0x359bc3,null));};exports['getAllConditions']=function(_0xd7db86,_0x49a0e7,_0x249008){var _0x444ff6={};var _0x2bfb30={};var _0x15992d;var _0x2e3682;return db['Trigger'][_0xcd9b('0x59')]({'where':{'id':_0xd7db86['params']['id']}})[_0xcd9b('0x24')](handleEntityNotFound(_0x49a0e7,null))[_0xcd9b('0x24')](function(_0x41ac9a){if(_0x41ac9a){_0x15992d=_0x41ac9a;_0x2bfb30[_0xcd9b('0x37')]=_['keys'](db['Condition']['rawAttributes']);_0x2bfb30[_0xcd9b('0x33')]=_['keys'](_0xd7db86[_0xcd9b('0x33')]);_0x2bfb30[_0xcd9b('0x34')]=_[_0xcd9b('0x35')](_0x2bfb30[_0xcd9b('0x37')],_0x2bfb30[_0xcd9b('0x33')]);_0x444ff6[_0xcd9b('0x36')]=_[_0xcd9b('0x35')](_0x2bfb30[_0xcd9b('0x37')],qs[_0xcd9b('0x38')](_0xd7db86[_0xcd9b('0x33')][_0xcd9b('0x38')]));_0x444ff6['attributes']=_0x444ff6[_0xcd9b('0x36')][_0xcd9b('0x39')]?_0x444ff6[_0xcd9b('0x36')]:_0x2bfb30[_0xcd9b('0x37')];_0x444ff6[_0xcd9b('0x5a')]=qs[_0xcd9b('0x3a')](_0xd7db86[_0xcd9b('0x33')][_0xcd9b('0x3a')]);_0x444ff6[_0xcd9b('0x3b')]=qs['filters'](_['pick'](_0xd7db86['query'],_0x2bfb30['filters']));if(_0xd7db86[_0xcd9b('0x33')][_0xcd9b('0x3d')]){_0x444ff6[_0xcd9b('0x3b')]=_[_0xcd9b('0x40')](_0x444ff6[_0xcd9b('0x3b')],{'$or':_[_0xcd9b('0x3e')](_0x444ff6['attributes'],function(_0x45f81a){var _0x15e889={};_0x15e889[_0x45f81a]={'$like':'%'+_0xd7db86[_0xcd9b('0x33')]['filter']+'%'};return _0x15e889;})});}_0x444ff6=_[_0xcd9b('0x40')]({},_0x444ff6,_0xd7db86[_0xcd9b('0x41')]);return _0x15992d[_0xcd9b('0x5b')](_0x444ff6);}})[_0xcd9b('0x24')](function(_0x2aa3be){if(_0x2aa3be){_0x2e3682=_0x2aa3be[_0xcd9b('0x39')];if(!_0xd7db86[_0xcd9b('0x33')]['hasOwnProperty'](_0xcd9b('0x5c'))){_0x444ff6['limit']=qs['limit'](_0xd7db86[_0xcd9b('0x33')][_0xcd9b('0x1f')]);_0x444ff6[_0xcd9b('0x1e')]=qs[_0xcd9b('0x1e')](_0xd7db86[_0xcd9b('0x33')][_0xcd9b('0x1e')]);}return _0x15992d[_0xcd9b('0x5b')](_0x444ff6);}})['then'](function(_0x3da9c9){if(_0x3da9c9){return _0x3da9c9?{'count':_0x2e3682,'rows':_0x3da9c9}:null;}})[_0xcd9b('0x24')](respondWithResult(_0x49a0e7,null))[_0xcd9b('0x47')](handleError(_0x49a0e7,null));};exports[_0xcd9b('0x5d')]=function(_0x379cab,_0x4b03b8,_0x57f1af){var _0x36224f={};var _0x10b580={};var _0x57d3c5;var _0x20c55b;return db[_0xcd9b('0x2e')][_0xcd9b('0x59')]({'where':{'id':_0x379cab[_0xcd9b('0x53')]['id']}})[_0xcd9b('0x24')](handleEntityNotFound(_0x4b03b8,null))['then'](function(_0x4e2670){if(_0x4e2670){_0x57d3c5=_0x4e2670;_0x10b580['model']=_['keys'](db[_0xcd9b('0x58')]['rawAttributes']);_0x10b580[_0xcd9b('0x33')]=_['keys'](_0x379cab['query']);_0x10b580[_0xcd9b('0x34')]=_['intersection'](_0x10b580[_0xcd9b('0x37')],_0x10b580['query']);_0x36224f[_0xcd9b('0x36')]=_[_0xcd9b('0x35')](_0x10b580['model'],qs[_0xcd9b('0x38')](_0x379cab[_0xcd9b('0x33')]['fields']));_0x36224f[_0xcd9b('0x36')]=_0x36224f[_0xcd9b('0x36')]['length']?_0x36224f[_0xcd9b('0x36')]:_0x10b580[_0xcd9b('0x37')];_0x36224f[_0xcd9b('0x5a')]=qs['sort'](_0x379cab['query'][_0xcd9b('0x3a')]);_0x36224f['where']=qs[_0xcd9b('0x34')](_['pick'](_0x379cab['query'],_0x10b580[_0xcd9b('0x34')]));if(_0x379cab['query'][_0xcd9b('0x3d')]){_0x36224f[_0xcd9b('0x3b')]=_[_0xcd9b('0x40')](_0x36224f[_0xcd9b('0x3b')],{'$or':_[_0xcd9b('0x3e')](_0x36224f[_0xcd9b('0x36')],function(_0x4662b){var _0x50772f={};_0x50772f[_0x4662b]={'$like':'%'+_0x379cab['query'][_0xcd9b('0x3d')]+'%'};return _0x50772f;})});}_0x36224f=_[_0xcd9b('0x40')]({},_0x36224f,_0x379cab[_0xcd9b('0x41')]);return _0x57d3c5[_0xcd9b('0x5d')](_0x36224f);}})[_0xcd9b('0x24')](function(_0x2f2f11){if(_0x2f2f11){_0x20c55b=_0x2f2f11[_0xcd9b('0x39')];if(!_0x379cab[_0xcd9b('0x33')][_0xcd9b('0x5e')]('nolimit')){_0x36224f[_0xcd9b('0x1f')]=qs[_0xcd9b('0x1f')](_0x379cab['query']['limit']);_0x36224f[_0xcd9b('0x1e')]=qs['offset'](_0x379cab[_0xcd9b('0x33')][_0xcd9b('0x1e')]);}return _0x57d3c5['getAnyConditions'](_0x36224f);}})[_0xcd9b('0x24')](function(_0x413751){if(_0x413751){return _0x413751?{'count':_0x20c55b,'rows':_0x413751}:null;}})['then'](respondWithResult(_0x4b03b8,null))['catch'](handleError(_0x4b03b8,null));};exports[_0xcd9b('0x5f')]=function(_0xc55080,_0x39a431,_0x18feae){if(_0xc55080[_0xcd9b('0x52')]['id']){delete _0xc55080[_0xcd9b('0x52')]['id'];}return db[_0xcd9b('0x2e')][_0xcd9b('0x4a')]({'where':{'id':_0xc55080[_0xcd9b('0x53')]['id']}})['then'](handleEntityNotFound(_0x39a431,null))[_0xcd9b('0x24')](function(_0x233612){if(_0x233612){_0xc55080['body'][_0xcd9b('0x60')]=_0x233612['id'];return db[_0xcd9b('0x61')][_0xcd9b('0x4b')](_0xc55080[_0xcd9b('0x52')]);}})['then'](respondWithResult(_0x39a431,null))[_0xcd9b('0x47')](handleError(_0x39a431,null));};exports[_0xcd9b('0x62')]=function(_0x54d8ea,_0x7525a2,_0x299250){var _0x90862d={};var _0x524ce9={};var _0x211542;var _0x27fd7f;return db[_0xcd9b('0x2e')][_0xcd9b('0x59')]({'where':{'id':_0x54d8ea[_0xcd9b('0x53')]['id']}})[_0xcd9b('0x24')](handleEntityNotFound(_0x7525a2,null))['then'](function(_0xd6f733){if(_0xd6f733){_0x211542=_0xd6f733;_0x524ce9['model']=_[_0xcd9b('0x49')](db[_0xcd9b('0x61')][_0xcd9b('0x2f')]);_0x524ce9[_0xcd9b('0x33')]=_['keys'](_0x54d8ea[_0xcd9b('0x33')]);_0x524ce9['filters']=_['intersection'](_0x524ce9['model'],_0x524ce9[_0xcd9b('0x33')]);_0x90862d[_0xcd9b('0x36')]=_['intersection'](_0x524ce9[_0xcd9b('0x37')],qs[_0xcd9b('0x38')](_0x54d8ea[_0xcd9b('0x33')][_0xcd9b('0x38')]));_0x90862d[_0xcd9b('0x36')]=_0x90862d[_0xcd9b('0x36')][_0xcd9b('0x39')]?_0x90862d['attributes']:_0x524ce9[_0xcd9b('0x37')];_0x90862d[_0xcd9b('0x5a')]=qs[_0xcd9b('0x3a')](_0x54d8ea[_0xcd9b('0x33')][_0xcd9b('0x3a')]);_0x90862d[_0xcd9b('0x3b')]=qs['filters'](_[_0xcd9b('0x3c')](_0x54d8ea[_0xcd9b('0x33')],_0x524ce9[_0xcd9b('0x34')]));if(_0x54d8ea[_0xcd9b('0x33')][_0xcd9b('0x3d')]){_0x90862d[_0xcd9b('0x3b')]=_[_0xcd9b('0x40')](_0x90862d[_0xcd9b('0x3b')],{'$or':_[_0xcd9b('0x3e')](_0x90862d[_0xcd9b('0x36')],function(_0xd11c1f){var _0x467178={};_0x467178[_0xd11c1f]={'$like':'%'+_0x54d8ea[_0xcd9b('0x33')][_0xcd9b('0x3d')]+'%'};return _0x467178;})});}_0x90862d=_['merge']({},_0x90862d,_0x54d8ea[_0xcd9b('0x41')]);return _0x211542[_0xcd9b('0x62')](_0x90862d);}})[_0xcd9b('0x24')](function(_0x3df2c8){if(_0x3df2c8){_0x27fd7f=_0x3df2c8[_0xcd9b('0x39')];if(!_0x54d8ea[_0xcd9b('0x33')][_0xcd9b('0x5e')]('nolimit')){_0x90862d[_0xcd9b('0x1f')]=qs[_0xcd9b('0x1f')](_0x54d8ea[_0xcd9b('0x33')][_0xcd9b('0x1f')]);_0x90862d[_0xcd9b('0x1e')]=qs[_0xcd9b('0x1e')](_0x54d8ea[_0xcd9b('0x33')][_0xcd9b('0x1e')]);}return _0x211542[_0xcd9b('0x62')](_0x90862d);}})[_0xcd9b('0x24')](function(_0x1dc7f5){if(_0x1dc7f5){return _0x1dc7f5?{'count':_0x27fd7f,'rows':_0x1dc7f5}:null;}})[_0xcd9b('0x24')](respondWithResult(_0x7525a2,null))[_0xcd9b('0x47')](handleError(_0x7525a2,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 45b0504..fa4fbac 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 _0x6647=['request-promise','path','exports','Trigger','tools_triggers','util','../../config/logger','api','moment','bluebird'];(function(_0x2508bd,_0x349de0){var _0x31ca9e=function(_0x13fde7){while(--_0x13fde7){_0x2508bd['push'](_0x2508bd['shift']());}};_0x31ca9e(++_0x349de0);}(_0x6647,0x163));var _0x7664=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6647[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x7664('0x0'));var logger=require(_0x7664('0x1'))(_0x7664('0x2'));var moment=require(_0x7664('0x3'));var BPromise=require(_0x7664('0x4'));var rp=require(_0x7664('0x5'));var fs=require('fs');var path=require(_0x7664('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./trigger.attributes');module[_0x7664('0x7')]=function(_0x1fbcad,_0xb19f0c){return _0x1fbcad['define'](_0x7664('0x8'),attributes,{'tableName':_0x7664('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4502=['tools_triggers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./trigger.attributes','exports','define'];(function(_0x3a4594,_0x2e9136){var _0x4a5d78=function(_0x54a4c1){while(--_0x54a4c1){_0x3a4594['push'](_0x3a4594['shift']());}};_0x4a5d78(++_0x2e9136);}(_0x4502,0x112));var _0x2450=function(_0x2ed8c2,_0x33d8ee){_0x2ed8c2=_0x2ed8c2-0x0;var _0x546d16=_0x4502[_0x2ed8c2];return _0x546d16;};'use strict';var _=require(_0x2450('0x0'));var util=require(_0x2450('0x1'));var logger=require(_0x2450('0x2'))(_0x2450('0x3'));var moment=require(_0x2450('0x4'));var BPromise=require(_0x2450('0x5'));var rp=require(_0x2450('0x6'));var fs=require('fs');var path=require(_0x2450('0x7'));var rimraf=require(_0x2450('0x8'));var config=require('../../config/environment');var attributes=require(_0x2450('0x9'));module[_0x2450('0xa')]=function(_0x1975a4,_0x2deef4){return _0x1975a4[_0x2450('0xb')]('Trigger',attributes,{'tableName':_0x2450('0xc'),'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 d005a54..2d333ff 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 _0xd914=['raw','where','attributes','limit','include','map','model','then','ShowTrigger','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetTrigger','Trigger','options'];(function(_0x349367,_0x1cede2){var _0x14179b=function(_0x38a191){while(--_0x38a191){_0x349367['push'](_0x349367['shift']());}};_0x14179b(++_0x1cede2);}(_0xd914,0x17f));var _0x4d91=function(_0x8ae98b,_0x155f88){_0x8ae98b=_0x8ae98b-0x0;var _0xc30bd4=_0xd914[_0x8ae98b];return _0xc30bd4;};'use strict';var _=require(_0x4d91('0x0'));var util=require(_0x4d91('0x1'));var moment=require('moment');var BPromise=require(_0x4d91('0x2'));var rs=require(_0x4d91('0x3'));var fs=require('fs');var Redis=require(_0x4d91('0x4'));var db=require(_0x4d91('0x5'))['db'];var utils=require(_0x4d91('0x6'));var logger=require(_0x4d91('0x7'))('rpc');var config=require(_0x4d91('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4d91('0x9')][_0x4d91('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x175ce3,_0x27c0d5,_0x22f2a4){return new BPromise(function(_0x150767,_0x3016c0){return client[_0x4d91('0xb')](_0x175ce3,_0x22f2a4)['then'](function(_0x37bde4){logger[_0x4d91('0xc')](_0x4d91('0xd'),_0x27c0d5,_0x4d91('0xe'));logger[_0x4d91('0xf')](_0x4d91('0x10'),_0x27c0d5,'request\x20sent',JSON['stringify'](_0x37bde4));if(_0x37bde4[_0x4d91('0x11')]){if(_0x37bde4[_0x4d91('0x11')][_0x4d91('0x12')]===0x1f4){logger[_0x4d91('0x11')](_0x4d91('0xd'),_0x27c0d5,_0x37bde4[_0x4d91('0x11')]['message']);return _0x3016c0(_0x37bde4['error'][_0x4d91('0x13')]);}logger[_0x4d91('0x11')](_0x4d91('0xd'),_0x27c0d5,_0x37bde4[_0x4d91('0x11')][_0x4d91('0x13')]);return _0x150767(_0x37bde4[_0x4d91('0x11')][_0x4d91('0x13')]);}else{logger['info'](_0x4d91('0xd'),_0x27c0d5,_0x4d91('0xe'));_0x150767(_0x37bde4[_0x4d91('0x14')][_0x4d91('0x13')]);}})[_0x4d91('0x15')](function(_0x554ca8){logger[_0x4d91('0x11')](_0x4d91('0xd'),_0x27c0d5,_0x554ca8);_0x3016c0(_0x554ca8);});});}exports[_0x4d91('0x16')]=function(_0x44b9a7){var _0x4cfa40=this;return new Promise(function(_0x350e23,_0x3b579b){return db[_0x4d91('0x17')]['findAll']({'raw':_0x44b9a7[_0x4d91('0x18')]?_0x44b9a7[_0x4d91('0x18')][_0x4d91('0x19')]===undefined?!![]:![]:!![],'where':_0x44b9a7[_0x4d91('0x18')]?_0x44b9a7[_0x4d91('0x18')][_0x4d91('0x1a')]||null:null,'attributes':_0x44b9a7[_0x4d91('0x18')]?_0x44b9a7[_0x4d91('0x18')][_0x4d91('0x1b')]||null:null,'limit':_0x44b9a7[_0x4d91('0x18')]?_0x44b9a7['options'][_0x4d91('0x1c')]||null:null,'include':_0x44b9a7['options']?_0x44b9a7['options'][_0x4d91('0x1d')]?_[_0x4d91('0x1e')](_0x44b9a7[_0x4d91('0x18')][_0x4d91('0x1d')],function(_0x7d8cbf){return{'model':db[_0x7d8cbf[_0x4d91('0x1f')]],'as':_0x7d8cbf['as'],'attributes':_0x7d8cbf[_0x4d91('0x1b')],'include':_0x7d8cbf[_0x4d91('0x1d')]?_['map'](_0x7d8cbf['include'],function(_0x1ee6b3){return{'model':db[_0x1ee6b3[_0x4d91('0x1f')]],'as':_0x1ee6b3['as'],'attributes':_0x1ee6b3[_0x4d91('0x1b')],'include':_0x1ee6b3[_0x4d91('0x1d')]?_[_0x4d91('0x1e')](_0x1ee6b3[_0x4d91('0x1d')],function(_0x14bdb4){return{'model':db[_0x14bdb4['model']],'as':_0x14bdb4['as'],'attributes':_0x14bdb4[_0x4d91('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4d91('0x20')](function(_0x12ac74){logger['info']('GetTrigger',_0x44b9a7);logger[_0x4d91('0xf')](_0x4d91('0x16'),_0x44b9a7,JSON['stringify'](_0x12ac74));_0x350e23(_0x12ac74);})['catch'](function(_0x42d5a0){logger[_0x4d91('0x11')](_0x4d91('0x16'),_0x42d5a0[_0x4d91('0x13')],_0x44b9a7);_0x3b579b(_0x4cfa40['error'](0x1f4,_0x42d5a0[_0x4d91('0x13')]));});});};exports[_0x4d91('0x21')]=function(_0x468e95){var _0xee7535=this;return new Promise(function(_0xa63422,_0x3466f3){return db[_0x4d91('0x17')]['find']({'raw':_0x468e95[_0x4d91('0x18')]?_0x468e95['options']['raw']===undefined?!![]:![]:!![],'where':_0x468e95[_0x4d91('0x18')]?_0x468e95[_0x4d91('0x18')]['where']||null:null,'attributes':_0x468e95[_0x4d91('0x18')]?_0x468e95[_0x4d91('0x18')][_0x4d91('0x1b')]||null:null,'include':_0x468e95[_0x4d91('0x18')]?_0x468e95[_0x4d91('0x18')]['include']?_[_0x4d91('0x1e')](_0x468e95[_0x4d91('0x18')][_0x4d91('0x1d')],function(_0x2b8131){return{'model':db[_0x2b8131[_0x4d91('0x1f')]],'as':_0x2b8131['as'],'attributes':_0x2b8131[_0x4d91('0x1b')],'include':_0x2b8131['include']?_[_0x4d91('0x1e')](_0x2b8131[_0x4d91('0x1d')],function(_0x5c2247){return{'model':db[_0x5c2247[_0x4d91('0x1f')]],'as':_0x5c2247['as'],'attributes':_0x5c2247[_0x4d91('0x1b')],'include':_0x5c2247[_0x4d91('0x1d')]?_['map'](_0x5c2247[_0x4d91('0x1d')],function(_0x2c8b54){return{'model':db[_0x2c8b54[_0x4d91('0x1f')]],'as':_0x2c8b54['as'],'attributes':_0x2c8b54[_0x4d91('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x64cee3){logger[_0x4d91('0xc')](_0x4d91('0x21'),_0x468e95);logger[_0x4d91('0xf')]('ShowTrigger',_0x468e95,JSON['stringify'](_0x64cee3));_0xa63422(_0x64cee3);})[_0x4d91('0x15')](function(_0x3dac76){logger['error'](_0x4d91('0x21'),_0x3dac76[_0x4d91('0x13')],_0x468e95);_0x3466f3(_0xee7535[_0x4d91('0x11')](0x1f4,_0x3dac76[_0x4d91('0x13')]));});});}; \ No newline at end of file +var _0xea28=['code','message','result','catch','GetTrigger','Trigger','findAll','options','where','attributes','limit','include','map','model','ShowTrigger','find','raw','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x399bfc,_0x36d4b0){var _0x36846d=function(_0x1465bc){while(--_0x1465bc){_0x399bfc['push'](_0x399bfc['shift']());}};_0x36846d(++_0x36d4b0);}(_0xea28,0x13a));var _0x8ea2=function(_0x4ad2c2,_0x3d28b7){_0x4ad2c2=_0x4ad2c2-0x0;var _0x24910f=_0xea28[_0x4ad2c2];return _0x24910f;};'use strict';var _=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var moment=require(_0x8ea2('0x2'));var BPromise=require(_0x8ea2('0x3'));var rs=require(_0x8ea2('0x4'));var fs=require('fs');var Redis=require(_0x8ea2('0x5'));var db=require(_0x8ea2('0x6'))['db'];var utils=require(_0x8ea2('0x7'));var logger=require('../../config/logger')(_0x8ea2('0x8'));var config=require(_0x8ea2('0x9'));var jayson=require(_0x8ea2('0xa'));var client=jayson['client'][_0x8ea2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x435d78,_0xb7f278,_0x39b1fa){return new BPromise(function(_0x28b5b8,_0x929304){return client[_0x8ea2('0xc')](_0x435d78,_0x39b1fa)[_0x8ea2('0xd')](function(_0x3de4a1){logger[_0x8ea2('0xe')](_0x8ea2('0xf'),_0xb7f278,_0x8ea2('0x10'));logger['debug']('Trigger,\x20%s,\x20%s,\x20%s',_0xb7f278,_0x8ea2('0x10'),JSON[_0x8ea2('0x11')](_0x3de4a1));if(_0x3de4a1[_0x8ea2('0x12')]){if(_0x3de4a1['error'][_0x8ea2('0x13')]===0x1f4){logger[_0x8ea2('0x12')](_0x8ea2('0xf'),_0xb7f278,_0x3de4a1[_0x8ea2('0x12')][_0x8ea2('0x14')]);return _0x929304(_0x3de4a1['error'][_0x8ea2('0x14')]);}logger['error']('Trigger,\x20%s,\x20%s',_0xb7f278,_0x3de4a1[_0x8ea2('0x12')][_0x8ea2('0x14')]);return _0x28b5b8(_0x3de4a1[_0x8ea2('0x12')][_0x8ea2('0x14')]);}else{logger[_0x8ea2('0xe')](_0x8ea2('0xf'),_0xb7f278,_0x8ea2('0x10'));_0x28b5b8(_0x3de4a1[_0x8ea2('0x15')][_0x8ea2('0x14')]);}})[_0x8ea2('0x16')](function(_0x2dfa7c){logger[_0x8ea2('0x12')](_0x8ea2('0xf'),_0xb7f278,_0x2dfa7c);_0x929304(_0x2dfa7c);});});}exports[_0x8ea2('0x17')]=function(_0x1b64cf){var _0x174ef2=this;return new Promise(function(_0x467045,_0x2a0329){return db[_0x8ea2('0x18')][_0x8ea2('0x19')]({'raw':_0x1b64cf[_0x8ea2('0x1a')]?_0x1b64cf[_0x8ea2('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x1b64cf['options']?_0x1b64cf[_0x8ea2('0x1a')][_0x8ea2('0x1b')]||null:null,'attributes':_0x1b64cf[_0x8ea2('0x1a')]?_0x1b64cf['options'][_0x8ea2('0x1c')]||null:null,'limit':_0x1b64cf[_0x8ea2('0x1a')]?_0x1b64cf['options'][_0x8ea2('0x1d')]||null:null,'include':_0x1b64cf[_0x8ea2('0x1a')]?_0x1b64cf[_0x8ea2('0x1a')][_0x8ea2('0x1e')]?_[_0x8ea2('0x1f')](_0x1b64cf[_0x8ea2('0x1a')][_0x8ea2('0x1e')],function(_0x1e4cc9){return{'model':db[_0x1e4cc9[_0x8ea2('0x20')]],'as':_0x1e4cc9['as'],'attributes':_0x1e4cc9['attributes'],'include':_0x1e4cc9[_0x8ea2('0x1e')]?_['map'](_0x1e4cc9[_0x8ea2('0x1e')],function(_0x42bec8){return{'model':db[_0x42bec8[_0x8ea2('0x20')]],'as':_0x42bec8['as'],'attributes':_0x42bec8['attributes'],'include':_0x42bec8['include']?_[_0x8ea2('0x1f')](_0x42bec8['include'],function(_0x200a49){return{'model':db[_0x200a49['model']],'as':_0x200a49['as'],'attributes':_0x200a49[_0x8ea2('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x8ea2('0xd')](function(_0x21c526){logger[_0x8ea2('0xe')]('GetTrigger',_0x1b64cf);logger['debug'](_0x8ea2('0x17'),_0x1b64cf,JSON['stringify'](_0x21c526));_0x467045(_0x21c526);})[_0x8ea2('0x16')](function(_0x287078){logger[_0x8ea2('0x12')](_0x8ea2('0x17'),_0x287078[_0x8ea2('0x14')],_0x1b64cf);_0x2a0329(_0x174ef2[_0x8ea2('0x12')](0x1f4,_0x287078[_0x8ea2('0x14')]));});});};exports[_0x8ea2('0x21')]=function(_0x19e868){var _0x9c5fac=this;return new Promise(function(_0x56d914,_0x5b7ff9){return db[_0x8ea2('0x18')][_0x8ea2('0x22')]({'raw':_0x19e868['options']?_0x19e868['options'][_0x8ea2('0x23')]===undefined?!![]:![]:!![],'where':_0x19e868['options']?_0x19e868[_0x8ea2('0x1a')][_0x8ea2('0x1b')]||null:null,'attributes':_0x19e868['options']?_0x19e868[_0x8ea2('0x1a')][_0x8ea2('0x1c')]||null:null,'include':_0x19e868[_0x8ea2('0x1a')]?_0x19e868['options']['include']?_['map'](_0x19e868[_0x8ea2('0x1a')][_0x8ea2('0x1e')],function(_0x3fc785){return{'model':db[_0x3fc785['model']],'as':_0x3fc785['as'],'attributes':_0x3fc785[_0x8ea2('0x1c')],'include':_0x3fc785[_0x8ea2('0x1e')]?_[_0x8ea2('0x1f')](_0x3fc785[_0x8ea2('0x1e')],function(_0x253031){return{'model':db[_0x253031[_0x8ea2('0x20')]],'as':_0x253031['as'],'attributes':_0x253031[_0x8ea2('0x1c')],'include':_0x253031[_0x8ea2('0x1e')]?_['map'](_0x253031[_0x8ea2('0x1e')],function(_0x29e3f5){return{'model':db[_0x29e3f5[_0x8ea2('0x20')]],'as':_0x29e3f5['as'],'attributes':_0x29e3f5[_0x8ea2('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2a1f14){logger['info'](_0x8ea2('0x21'),_0x19e868);logger[_0x8ea2('0x24')](_0x8ea2('0x21'),_0x19e868,JSON[_0x8ea2('0x11')](_0x2a1f14));_0x56d914(_0x2a1f14);})['catch'](function(_0x2bed24){logger['error']('ShowTrigger',_0x2bed24[_0x8ea2('0x14')],_0x19e868);_0x5b7ff9(_0x9c5fac['error'](0x1f4,_0x2bed24[_0x8ea2('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 590e157..964452d 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 _0x7bae=['index','/:id','show','post','/:id/clone','clone','create','put','update','delete','exports','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated'];(function(_0x1ef833,_0x43d626){var _0xa71145=function(_0x4e08a0){while(--_0x4e08a0){_0x1ef833['push'](_0x1ef833['shift']());}};_0xa71145(++_0x43d626);}(_0x7bae,0x13b));var _0xe7ba=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x7bae[_0x55f8b4];return _0x2475f9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7ba('0x0'));var timeout=require(_0xe7ba('0x1'));var express=require('express');var router=express[_0xe7ba('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xe7ba('0x3'));var config=require(_0xe7ba('0x4'));var controller=require(_0xe7ba('0x5'));router[_0xe7ba('0x6')]('/',auth[_0xe7ba('0x7')](),controller[_0xe7ba('0x8')]);router[_0xe7ba('0x6')](_0xe7ba('0x9'),auth[_0xe7ba('0x7')](),controller[_0xe7ba('0xa')]);router[_0xe7ba('0xb')](_0xe7ba('0xc'),auth[_0xe7ba('0x7')](),controller[_0xe7ba('0xd')]);router['post']('/',auth[_0xe7ba('0x7')](),controller[_0xe7ba('0xe')]);router[_0xe7ba('0xf')](_0xe7ba('0x9'),auth[_0xe7ba('0x7')](),controller[_0xe7ba('0x10')]);router[_0xe7ba('0x11')](_0xe7ba('0x9'),auth[_0xe7ba('0x7')](),controller['destroy']);module[_0xe7ba('0x12')]=router; \ No newline at end of file +var _0x9f62=['create','update','util','connect-timeout','express','Router','../../config/environment','./trunk.controller','get','isAuthenticated','/:id','show','post'];(function(_0x562dfd,_0x56f5d0){var _0x131138=function(_0x33a1b7){while(--_0x33a1b7){_0x562dfd['push'](_0x562dfd['shift']());}};_0x131138(++_0x56f5d0);}(_0x9f62,0x154));var _0x29f6=function(_0x4fd09b,_0x2cdaf0){_0x4fd09b=_0x4fd09b-0x0;var _0xdfa8e3=_0x9f62[_0x4fd09b];return _0xdfa8e3;};'use strict';var multer=require('multer');var util=require(_0x29f6('0x0'));var path=require('path');var timeout=require(_0x29f6('0x1'));var express=require(_0x29f6('0x2'));var router=express[_0x29f6('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x29f6('0x4'));var controller=require(_0x29f6('0x5'));router[_0x29f6('0x6')]('/',auth[_0x29f6('0x7')](),controller['index']);router[_0x29f6('0x6')](_0x29f6('0x8'),auth[_0x29f6('0x7')](),controller[_0x29f6('0x9')]);router[_0x29f6('0xa')]('/:id/clone',auth['isAuthenticated'](),controller['clone']);router['post']('/',auth[_0x29f6('0x7')](),controller[_0x29f6('0xb')]);router['put']('/:id',auth[_0x29f6('0x7')](),controller[_0x29f6('0xc')]);router['delete'](_0x29f6('0x8'),auth[_0x29f6('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 95e03c2..c06cc1b 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 _0x40cb=['accept','refuse','originate','uac','uas','pai','fingerprint','certificate','actpass','dynamic','BOOLEAN','sequelize','exports','name','friend','STRING','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','udp','setDataValue','transport','join','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','ENUM','rfc2833','inband','auto','nonat','update','outgoing','yes','force_rport,comedia','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','INTEGER','\x22\x22\x20<>'];(function(_0x454713,_0x3436dc){var _0x2509fe=function(_0x37c668){while(--_0x37c668){_0x454713['push'](_0x454713['shift']());}};_0x2509fe(++_0x3436dc);}(_0x40cb,0x11f));var _0xb40c=function(_0x4fd89d,_0xdc4524){_0x4fd89d=_0x4fd89d-0x0;var _0x5f3b98=_0x40cb[_0x4fd89d];return _0x5f3b98;};'use strict';var Sequelize=require(_0xb40c('0x0'));module[_0xb40c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb40c('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('friend','user','peer'),'allowNull':![],'defaultValue':_0xb40c('0x3')},'context':{'type':Sequelize[_0xb40c('0x4')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize['ENUM']('ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN',_0xb40c('0x5'),_0xb40c('0x6'),_0xb40c('0x7'),_0xb40c('0x8'),'PROHIB_FAILED_SCREEN','PROHIB')},'deny':{'type':Sequelize[_0xb40c('0x4')]},'permit':{'type':Sequelize[_0xb40c('0x4')]},'secret':{'type':Sequelize[_0xb40c('0x4')]},'md5secret':{'type':Sequelize[_0xb40c('0x4')]},'remotesecret':{'type':Sequelize[_0xb40c('0x4')]},'transport':{'type':Sequelize[_0xb40c('0x4')],'defaultValue':_0xb40c('0x9'),'set':function(_0x232648){this[_0xb40c('0xa')](_0xb40c('0xb'),_0x232648?_0x232648[_0xb40c('0xc')](','):null);},'get':function(){return this[_0xb40c('0xd')](_0xb40c('0xb'))?this['getDataValue'](_0xb40c('0xb'))['split'](','):null;},'comment':_0xb40c('0xe')},'dtmfmode':{'type':Sequelize[_0xb40c('0xf')](_0xb40c('0x10'),'info','shortinfo',_0xb40c('0x11'),_0xb40c('0x12')),'defaultValue':_0xb40c('0x10')},'directmedia':{'type':Sequelize[_0xb40c('0xf')]('yes','no',_0xb40c('0x13'),_0xb40c('0x14'),_0xb40c('0x15')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xb40c('0xf')](_0xb40c('0x16'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xb40c('0x4')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize['STRING'],'defaultValue':_0xb40c('0x17'),'set':function(_0x24838f){this[_0xb40c('0xa')](_0xb40c('0x18'),_0x24838f?_0x24838f[_0xb40c('0xc')](','):null);},'get':function(){return this[_0xb40c('0xd')](_0xb40c('0x18'))?this['getDataValue'](_0xb40c('0x18'))[_0xb40c('0x19')](','):null;},'comment':_0xb40c('0x1a')},'callgroup':{'type':Sequelize[_0xb40c('0x4')]},'namedcallgroup':{'type':Sequelize[_0xb40c('0x4')]},'pickupgroup':{'type':Sequelize[_0xb40c('0x4')]},'namedpickupgroup':{'type':Sequelize[_0xb40c('0x4')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0xb40c('0x1b')},'allow':{'type':Sequelize[_0xb40c('0x4')],'allowNull':![],'defaultValue':_0xb40c('0x1c'),'set':function(_0x3ff3fc){this[_0xb40c('0xa')]('allow',_0x3ff3fc?_0x3ff3fc[_0xb40c('0xc')](';'):_0xb40c('0x1c'));},'get':function(){return this[_0xb40c('0xd')](_0xb40c('0x1d'))?this[_0xb40c('0xd')](_0xb40c('0x1d'))[_0xb40c('0x19')](';'):null;},'comment':_0xb40c('0x1e')},'autoframing':{'type':Sequelize[_0xb40c('0xf')](_0xb40c('0x16'),'no')},'insecure':{'type':Sequelize[_0xb40c('0x4')],'defaultValue':_0xb40c('0x1f'),'set':function(_0x4a8681){this[_0xb40c('0xa')](_0xb40c('0x20'),_0x4a8681?_0x4a8681['join'](','):null);},'get':function(){return this[_0xb40c('0xd')]('insecure')?this['getDataValue'](_0xb40c('0x20'))[_0xb40c('0x19')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xb40c('0xf')](_0xb40c('0x16'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xb40c('0xf')](_0xb40c('0x16'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xb40c('0xf')](_0xb40c('0x16'),'no','never')},'promiscredir':{'type':Sequelize[_0xb40c('0xf')](_0xb40c('0x16'),'no')},'useclientcode':{'type':Sequelize[_0xb40c('0xf')]('yes','no')},'accountcode':{'type':Sequelize[_0xb40c('0x21')](0xb)},'setvar':{'type':Sequelize[_0xb40c('0x4')]},'callerid':{'type':Sequelize[_0xb40c('0x4')],'defaultValue':_0xb40c('0x22')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0xb40c('0xf')]('yes','no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0xb40c('0xf')]('yes','no')},'allowsubscribe':{'type':Sequelize[_0xb40c('0xf')](_0xb40c('0x16'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0xb40c('0x16'),'no')},'ignoresdpversion':{'type':Sequelize[_0xb40c('0xf')]('yes','no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0xb40c('0xf')]('yes','no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0xb40c('0xf')]('yes','no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0xb40c('0xf')](_0xb40c('0x23'),_0xb40c('0x24'),_0xb40c('0x25'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0xb40c('0x21')](0xb)},'session_refresher':{'type':Sequelize[_0xb40c('0xf')](_0xb40c('0x26'),_0xb40c('0x27')),'defaultValue':_0xb40c('0x27')},'t38pt_usertpsource':{'type':Sequelize[_0xb40c('0x4')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0xb40c('0x4')]},'port':{'type':Sequelize[_0xb40c('0x21')](0x5)},'qualify':{'type':Sequelize[_0xb40c('0xf')](_0xb40c('0x16'),'no'),'defaultValue':_0xb40c('0x16')},'keepalive':{'type':Sequelize[_0xb40c('0x21')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0xb40c('0x4')]},'rtptimeout':{'type':Sequelize[_0xb40c('0x21')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xb40c('0x21')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0xb40c('0xf')](_0xb40c('0x16'),'no',_0xb40c('0x28')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xb40c('0x4')]},'callbackextension':{'type':Sequelize[_0xb40c('0x4')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0xb40c('0x21')](0xb)},'qualifyfreq':{'type':Sequelize[_0xb40c('0x21')](0xb)},'contactpermit':{'type':Sequelize[_0xb40c('0x4')]},'contactdeny':{'type':Sequelize[_0xb40c('0x4')]},'contactacl':{'type':Sequelize[_0xb40c('0x4')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0xb40c('0x4')]},'maxforwards':{'type':Sequelize[_0xb40c('0x21')](0xb)},'encryption':{'type':Sequelize[_0xb40c('0xf')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xb40c('0xf')]('yes','no')},'force_avp':{'type':Sequelize[_0xb40c('0xf')](_0xb40c('0x16'),'no')},'icesupport':{'type':Sequelize[_0xb40c('0xf')]('yes','no')},'dtlsenable':{'type':Sequelize[_0xb40c('0xf')](_0xb40c('0x16'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0xb40c('0x16'),'no',_0xb40c('0x29'),_0xb40c('0x2a'))},'dtlsrekey':{'type':Sequelize[_0xb40c('0x21')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0xb40c('0x4')]},'dtlscipher':{'type':Sequelize[_0xb40c('0x4')]},'dtlscafile':{'type':Sequelize[_0xb40c('0x4')]},'dtlscapath':{'type':Sequelize[_0xb40c('0x4')]},'dtlssetup':{'type':Sequelize['ENUM']('active','passive',_0xb40c('0x2b')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0xb40c('0xf')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0xb40c('0x4')]},'call_limit':{'type':Sequelize[_0xb40c('0x21')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xb40c('0xf')]('yes','no')},'subscribemwi':{'type':Sequelize[_0xb40c('0xf')](_0xb40c('0x16'),'no')},'vmexten':{'type':Sequelize[_0xb40c('0x4')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0xb40c('0x4')]},'parkinglot':{'type':Sequelize[_0xb40c('0x4')]},'description':{'type':Sequelize[_0xb40c('0x4')]},'host':{'type':Sequelize[_0xb40c('0x4')],'defaultValue':_0xb40c('0x2c')},'canreinvite':{'type':Sequelize['ENUM'](_0xb40c('0x16'),'no',_0xb40c('0x13'),_0xb40c('0x14'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0xb40c('0x4')]},'otherFields':{'type':Sequelize[_0xb40c('0x4')]},'active':{'type':Sequelize[_0xb40c('0x2d')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file +var _0x5ef7=['PROHIB_PASSED_SCREEN','PROHIB','STRING','udp','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','rfc2833','yes','nonat','update','outgoing','force_rport,comedia','nat','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','never','INTEGER','\x22\x22\x20<>','always','originate','uac','uas','pai','fingerprint','certificate','active','passive','actpass','dynamic','update,nonat','BOOLEAN','ENUM','friend','user','peer','ALLOWED_NOT_SCREENED','ALLOWED','PROHIB_NOT_SCREENED'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x5ef7,0x1a0));var _0x75ef=function(_0x14cee7,_0x4e7406){_0x14cee7=_0x14cee7-0x0;var _0x28ddc9=_0x5ef7[_0x14cee7];return _0x28ddc9;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x75ef('0x0')](_0x75ef('0x1'),_0x75ef('0x2'),_0x75ef('0x3')),'allowNull':![],'defaultValue':_0x75ef('0x1')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize['ENUM'](_0x75ef('0x4'),'ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN',_0x75ef('0x5'),_0x75ef('0x6'),_0x75ef('0x7'),'PROHIB_FAILED_SCREEN',_0x75ef('0x8'))},'deny':{'type':Sequelize[_0x75ef('0x9')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0x75ef('0x9')]},'md5secret':{'type':Sequelize[_0x75ef('0x9')]},'remotesecret':{'type':Sequelize[_0x75ef('0x9')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x75ef('0xa'),'set':function(_0x374b3b){this[_0x75ef('0xb')](_0x75ef('0xc'),_0x374b3b?_0x374b3b[_0x75ef('0xd')](','):null);},'get':function(){return this[_0x75ef('0xe')]('transport')?this['getDataValue'](_0x75ef('0xc'))[_0x75ef('0xf')](','):null;},'comment':_0x75ef('0x10')},'dtmfmode':{'type':Sequelize[_0x75ef('0x0')]('rfc2833',_0x75ef('0x11'),_0x75ef('0x12'),_0x75ef('0x13'),'auto'),'defaultValue':_0x75ef('0x14')},'directmedia':{'type':Sequelize[_0x75ef('0x0')](_0x75ef('0x15'),'no',_0x75ef('0x16'),_0x75ef('0x17'),_0x75ef('0x18')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x75ef('0x0')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x75ef('0x9')]},'directmediadeny':{'type':Sequelize[_0x75ef('0x9')]},'nat':{'type':Sequelize[_0x75ef('0x9')],'defaultValue':_0x75ef('0x19'),'set':function(_0x190d78){this[_0x75ef('0xb')](_0x75ef('0x1a'),_0x190d78?_0x190d78['join'](','):null);},'get':function(){return this[_0x75ef('0xe')](_0x75ef('0x1a'))?this[_0x75ef('0xe')]('nat')[_0x75ef('0xf')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x75ef('0x9')]},'namedcallgroup':{'type':Sequelize[_0x75ef('0x9')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x75ef('0x9')]},'language':{'type':Sequelize[_0x75ef('0x9')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x75ef('0x9')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':'all'},'allow':{'type':Sequelize[_0x75ef('0x9')],'allowNull':![],'defaultValue':_0x75ef('0x1b'),'set':function(_0x20304a){this[_0x75ef('0xb')]('allow',_0x20304a?_0x20304a['join'](';'):_0x75ef('0x1b'));},'get':function(){return this[_0x75ef('0xe')]('allow')?this[_0x75ef('0xe')]('allow')['split'](';'):null;},'comment':_0x75ef('0x1c')},'autoframing':{'type':Sequelize['ENUM'](_0x75ef('0x15'),'no')},'insecure':{'type':Sequelize[_0x75ef('0x9')],'defaultValue':_0x75ef('0x1d'),'set':function(_0x177165){this[_0x75ef('0xb')](_0x75ef('0x1e'),_0x177165?_0x177165['join'](','):null);},'get':function(){return this['getDataValue']('insecure')?this['getDataValue'](_0x75ef('0x1e'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x75ef('0x0')](_0x75ef('0x15'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x75ef('0x0')](_0x75ef('0x15'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x75ef('0x0')](_0x75ef('0x15'),'no',_0x75ef('0x1f'))},'promiscredir':{'type':Sequelize[_0x75ef('0x0')](_0x75ef('0x15'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0x75ef('0x15'),'no')},'accountcode':{'type':Sequelize[_0x75ef('0x20')](0xb)},'setvar':{'type':Sequelize[_0x75ef('0x9')]},'callerid':{'type':Sequelize[_0x75ef('0x9')],'defaultValue':_0x75ef('0x21')},'amaflags':{'type':Sequelize[_0x75ef('0x9')]},'callcounter':{'type':Sequelize[_0x75ef('0x0')]('yes','no'),'defaultValue':_0x75ef('0x15')},'busylevel':{'type':Sequelize[_0x75ef('0x20')](0xb)},'allowoverlap':{'type':Sequelize[_0x75ef('0x0')]('yes','no')},'allowsubscribe':{'type':Sequelize[_0x75ef('0x0')]('yes','no')},'allowtransfer':{'type':Sequelize[_0x75ef('0x0')](_0x75ef('0x15'),'no')},'ignoresdpversion':{'type':Sequelize[_0x75ef('0x0')](_0x75ef('0x15'),'no')},'subscribecontext':{'type':Sequelize[_0x75ef('0x9')]},'template':{'type':Sequelize[_0x75ef('0x9')]},'videosupport':{'type':Sequelize[_0x75ef('0x0')](_0x75ef('0x15'),'no',_0x75ef('0x22')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x75ef('0x20')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x75ef('0x0')](_0x75ef('0x15'),'no')},'mailbox':{'type':Sequelize[_0x75ef('0x9')]},'session_timers':{'type':Sequelize[_0x75ef('0x0')]('accept','refuse',_0x75ef('0x23'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0x75ef('0x20')](0xb)},'session_refresher':{'type':Sequelize[_0x75ef('0x0')](_0x75ef('0x24'),_0x75ef('0x25')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x75ef('0x9')]},'regexten':{'type':Sequelize[_0x75ef('0x9')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0x75ef('0x9')]},'port':{'type':Sequelize[_0x75ef('0x20')](0x5)},'qualify':{'type':Sequelize[_0x75ef('0x0')](_0x75ef('0x15'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0x75ef('0x9')]},'defaultuser':{'type':Sequelize[_0x75ef('0x9')]},'rtptimeout':{'type':Sequelize[_0x75ef('0x20')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0x75ef('0x20')](0xb)},'sendrpid':{'type':Sequelize[_0x75ef('0x0')](_0x75ef('0x15'),'no',_0x75ef('0x26')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0x75ef('0x9')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0x75ef('0x20')](0xb)},'contactpermit':{'type':Sequelize[_0x75ef('0x9')]},'contactdeny':{'type':Sequelize[_0x75ef('0x9')]},'contactacl':{'type':Sequelize[_0x75ef('0x9')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0x75ef('0x9')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0x75ef('0x0')](_0x75ef('0x15'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x75ef('0x0')](_0x75ef('0x15'),'no')},'force_avp':{'type':Sequelize[_0x75ef('0x0')]('yes','no')},'icesupport':{'type':Sequelize[_0x75ef('0x0')](_0x75ef('0x15'),'no')},'dtlsenable':{'type':Sequelize[_0x75ef('0x0')](_0x75ef('0x15'),'no')},'dtlsverify':{'type':Sequelize[_0x75ef('0x0')](_0x75ef('0x15'),'no',_0x75ef('0x27'),_0x75ef('0x28'))},'dtlsrekey':{'type':Sequelize[_0x75ef('0x20')](0xb)},'dtlscertfile':{'type':Sequelize[_0x75ef('0x9')]},'dtlsprivatekey':{'type':Sequelize[_0x75ef('0x9')]},'dtlscipher':{'type':Sequelize[_0x75ef('0x9')]},'dtlscafile':{'type':Sequelize[_0x75ef('0x9')]},'dtlscapath':{'type':Sequelize[_0x75ef('0x9')]},'dtlssetup':{'type':Sequelize[_0x75ef('0x0')](_0x75ef('0x29'),_0x75ef('0x2a'),_0x75ef('0x2b')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0x75ef('0x0')](_0x75ef('0x15'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x75ef('0x20')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x75ef('0x0')](_0x75ef('0x15'),'no')},'subscribemwi':{'type':Sequelize[_0x75ef('0x0')](_0x75ef('0x15'),'no')},'vmexten':{'type':Sequelize[_0x75ef('0x9')]},'mohinterpret':{'type':Sequelize[_0x75ef('0x9')]},'mohsuggest':{'type':Sequelize[_0x75ef('0x9')]},'parkinglot':{'type':Sequelize[_0x75ef('0x9')]},'description':{'type':Sequelize[_0x75ef('0x9')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0x75ef('0x2c')},'canreinvite':{'type':Sequelize['ENUM'](_0x75ef('0x15'),'no',_0x75ef('0x16'),_0x75ef('0x17'),_0x75ef('0x2d')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x75ef('0x9')]},'otherFields':{'type':Sequelize[_0x75ef('0x9')]},'active':{'type':Sequelize[_0x75ef('0x2e')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x75ef('0x9')],'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 e4dc159..537d9f1 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 _0x82b7=['create','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','root','server/files/templates/trunk.ejs','utf8','join','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','Reload','chan_sip.so','role','update','/etc/asterisk/sip_xcally_registers.conf','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','limit','set','Content-Range','reject','destroy','get','Trunks','stack','name','send','index','Trunk','rawAttributes','fieldName','type','key','map','query','keys','filters','model','attributes','fields','hasOwnProperty','nolimit','offset','sort','where','filter','VIRTUAL','merge','options','count','include','findAll','rows','show','length','includeAll','find','params','intersection','omit','createdAt','updatedAt','body'];(function(_0x3e83bd,_0x2d8aab){var _0x90dbf0=function(_0x1be7f6){while(--_0x1be7f6){_0x3e83bd['push'](_0x3e83bd['shift']());}};_0x90dbf0(++_0x2d8aab);}(_0x82b7,0x15c));var _0x782b=function(_0x173349,_0x3660ca){_0x173349=_0x173349-0x0;var _0x5ec84e=_0x82b7[_0x173349];return _0x5ec84e;};'use strict';var pdf=require(_0x782b('0x0'));var emlformat=require(_0x782b('0x1'));var rimraf=require(_0x782b('0x2'));var zipdir=require(_0x782b('0x3'));var jsonpatch=require(_0x782b('0x4'));var rp=require(_0x782b('0x5'));var moment=require('moment');var BPromise=require(_0x782b('0x6'));var Mustache=require(_0x782b('0x7'));var util=require(_0x782b('0x8'));var path=require(_0x782b('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x782b('0xa'));var crypto=require(_0x782b('0xb'));var jsforce=require(_0x782b('0xc'));var deskjs=require(_0x782b('0xd'));var toCsv=require(_0x782b('0xe'));var querystring=require(_0x782b('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x782b('0x10'));var qs=require(_0x782b('0x11'));var as=require(_0x782b('0x12'));var hardwareService=require(_0x782b('0x13'));var logger=require(_0x782b('0x14'))(_0x782b('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x782b('0x16'))['db'];var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x16914d,_0x3a548f,_0x1b903a){if(_0x1b903a){var _0x59a87f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x59a87f[_0x782b('0x17')](_0x3a548f)){return _0x16914d;}else{throw new db[(_0x782b('0x18'))][(_0x782b('0x19'))](_0x782b('0x1a'));}}else{return _0x16914d;}}function respondWithRpcPromise(_0x23153e,_0xc3986d,_0x46f0a8,_0x2cb697){return new BPromise(function(_0x13674a,_0x5d7ff7){var _0x5ba7c5=_0x2cb697||client;return _0x5ba7c5[_0x782b('0x1b')](_0x23153e,_0x46f0a8)[_0x782b('0x1c')](function(_0x2167b0){logger[_0x782b('0x1d')](_0x782b('0x1e'),_0xc3986d,_0x782b('0x1f'));logger['debug'](_0x782b('0x20'),_0xc3986d,'request\x20sent',JSON[_0x782b('0x21')](_0x2167b0));if(_0x2167b0['error']){if(_0x2167b0[_0x782b('0x22')][_0x782b('0x23')]===0x1f4){logger[_0x782b('0x22')]('Trunk,\x20%s,\x20%s',_0xc3986d,_0x2167b0[_0x782b('0x22')][_0x782b('0x24')]);return _0x5d7ff7(_0x2167b0[_0x782b('0x22')][_0x782b('0x24')]);}logger[_0x782b('0x22')](_0x782b('0x1e'),_0xc3986d,_0x2167b0[_0x782b('0x22')][_0x782b('0x24')]);return _0x13674a(_0x2167b0['error'][_0x782b('0x24')]);}else{logger[_0x782b('0x1d')](_0x782b('0x1e'),_0xc3986d,_0x782b('0x1f'));_0x13674a(_0x2167b0[_0x782b('0x25')][_0x782b('0x24')]);}})[_0x782b('0x26')](function(_0x49c1a2){logger['error'](_0x782b('0x1e'),_0xc3986d,_0x49c1a2);_0x5d7ff7(_0x49c1a2);});});}function respondWithStatusCode(_0x36c86d,_0x3a4384){_0x3a4384=_0x3a4384||0xcc;return function(_0x861c50){if(_0x861c50){return _0x36c86d[_0x782b('0x27')](_0x3a4384);}return _0x36c86d[_0x782b('0x28')](_0x3a4384)['end']();};}function respondWithResult(_0x2f4a01,_0x252114){_0x252114=_0x252114||0xc8;return function(_0x2a4862){if(_0x2a4862){return _0x2f4a01[_0x782b('0x28')](_0x252114)[_0x782b('0x29')](_0x2a4862);}};}function respondWithFilteredResult(_0xfdc096,_0x31f2fd){return function(_0x1362f3){if(_0x1362f3){var _0x404d77=_0x1362f3['count'],_0x4c4dd5=_0x31f2fd['offset'],_0x2f34c8=_0x31f2fd['offset']+_0x31f2fd[_0x782b('0x2a')],_0x3e0548;if(_0x2f34c8>=_0x404d77){_0x2f34c8=_0x404d77;_0x3e0548=0xc8;}else{_0x3e0548=0xce;}_0xfdc096[_0x782b('0x28')](_0x3e0548);return _0xfdc096[_0x782b('0x2b')](_0x782b('0x2c'),_0x4c4dd5+'-'+_0x2f34c8+'/'+_0x404d77)['json'](_0x1362f3);}return null;};}function patchUpdates(_0x1f6d02){return function(_0x232a70){try{jsonpatch['apply'](_0x232a70,_0x1f6d02,!![]);}catch(_0x47ee31){return BPromise[_0x782b('0x2d')](_0x47ee31);}return _0x232a70['save']();};}function saveUpdates(_0x5a6678,_0x49a983){return function(_0x94f455){if(_0x94f455){return _0x94f455['update'](_0x5a6678)[_0x782b('0x1c')](function(_0x4c2de6){return _0x4c2de6;});}return null;};}function removeEntity(_0x4c7c63,_0x4b7c1a){return function(_0x33c5fe){if(_0x33c5fe){return _0x33c5fe[_0x782b('0x2e')]()[_0x782b('0x1c')](function(){var _0x397fa2=_0x33c5fe[_0x782b('0x2f')]({'plain':!![]});var _0x4a0b55=_0x782b('0x30');return db['UserProfileResource']['destroy']({'where':{'type':_0x4a0b55,'resourceId':_0x397fa2['id']}})[_0x782b('0x1c')](function(){return _0x33c5fe;});})[_0x782b('0x1c')](function(){_0x4c7c63['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x329451,_0x332161){return function(_0x4c228a){if(!_0x4c228a){_0x329451[_0x782b('0x27')](0x194);}return _0x4c228a;};}function handleError(_0x40a5bd,_0x474aa3){_0x474aa3=_0x474aa3||0x1f4;return function(_0x46f374){logger[_0x782b('0x22')](_0x46f374[_0x782b('0x31')]);if(_0x46f374[_0x782b('0x32')]){delete _0x46f374[_0x782b('0x32')];}_0x40a5bd[_0x782b('0x28')](_0x474aa3)[_0x782b('0x33')](_0x46f374);};}exports[_0x782b('0x34')]=function(_0x2fe3b5,_0x3d6df1){var _0x5eff7a={},_0x166c3b={},_0x3aaac5={'count':0x0,'rows':[]};var _0x5102cd=_['map'](db[_0x782b('0x35')][_0x782b('0x36')],function(_0x32377f){return{'name':_0x32377f[_0x782b('0x37')],'type':_0x32377f[_0x782b('0x38')][_0x782b('0x39')]};});_0x166c3b['model']=_[_0x782b('0x3a')](_0x5102cd,_0x782b('0x32'));_0x166c3b[_0x782b('0x3b')]=_[_0x782b('0x3c')](_0x2fe3b5[_0x782b('0x3b')]);_0x166c3b[_0x782b('0x3d')]=_['intersection'](_0x166c3b[_0x782b('0x3e')],_0x166c3b[_0x782b('0x3b')]);_0x5eff7a[_0x782b('0x3f')]=_['intersection'](_0x166c3b[_0x782b('0x3e')],qs['fields'](_0x2fe3b5[_0x782b('0x3b')][_0x782b('0x40')]));_0x5eff7a[_0x782b('0x3f')]=_0x5eff7a[_0x782b('0x3f')]['length']?_0x5eff7a[_0x782b('0x3f')]:_0x166c3b[_0x782b('0x3e')];if(!_0x2fe3b5[_0x782b('0x3b')][_0x782b('0x41')](_0x782b('0x42'))){_0x5eff7a[_0x782b('0x2a')]=qs[_0x782b('0x2a')](_0x2fe3b5[_0x782b('0x3b')][_0x782b('0x2a')]);_0x5eff7a[_0x782b('0x43')]=qs[_0x782b('0x43')](_0x2fe3b5[_0x782b('0x3b')]['offset']);}_0x5eff7a['order']=qs[_0x782b('0x44')](_0x2fe3b5[_0x782b('0x3b')][_0x782b('0x44')]);_0x5eff7a[_0x782b('0x45')]=qs['filters'](_['pick'](_0x2fe3b5[_0x782b('0x3b')],_0x166c3b['filters']));if(_0x2fe3b5['query'][_0x782b('0x46')]){_0x5eff7a['where']=_['merge'](_0x5eff7a[_0x782b('0x45')],{'$or':_[_0x782b('0x3a')](_0x5102cd,function(_0xe33ccd){if(_0xe33ccd[_0x782b('0x38')]!==_0x782b('0x47')){var _0x478a2e={};_0x478a2e[_0xe33ccd['name']]={'$like':'%'+_0x2fe3b5[_0x782b('0x3b')][_0x782b('0x46')]+'%'};return _0x478a2e;}})});}_0x5eff7a=_[_0x782b('0x48')]({},_0x5eff7a,_0x2fe3b5[_0x782b('0x49')]);var _0x1d3dd7={'where':_0x5eff7a['where']};return db[_0x782b('0x35')][_0x782b('0x4a')](_0x1d3dd7)[_0x782b('0x1c')](function(_0x46768c){_0x3aaac5[_0x782b('0x4a')]=_0x46768c;if(_0x2fe3b5[_0x782b('0x3b')]['includeAll']){_0x5eff7a[_0x782b('0x4b')]=[{'all':!![]}];}return db[_0x782b('0x35')][_0x782b('0x4c')](_0x5eff7a);})[_0x782b('0x1c')](function(_0x34c7ce){_0x3aaac5[_0x782b('0x4d')]=_0x34c7ce;return _0x3aaac5;})[_0x782b('0x1c')](respondWithFilteredResult(_0x3d6df1,_0x5eff7a))[_0x782b('0x26')](handleError(_0x3d6df1,null));};exports[_0x782b('0x4e')]=function(_0x361a45,_0x3a15fe){var _0x331719={'raw':![],'where':{'id':_0x361a45['params']['id']}},_0x428793={};_0x428793['model']=_[_0x782b('0x3c')](db[_0x782b('0x35')][_0x782b('0x36')]);_0x428793[_0x782b('0x3b')]=_[_0x782b('0x3c')](_0x361a45['query']);_0x428793[_0x782b('0x3d')]=_['intersection'](_0x428793[_0x782b('0x3e')],_0x428793[_0x782b('0x3b')]);_0x331719['attributes']=_['intersection'](_0x428793[_0x782b('0x3e')],qs[_0x782b('0x40')](_0x361a45[_0x782b('0x3b')][_0x782b('0x40')]));_0x331719[_0x782b('0x3f')]=_0x331719[_0x782b('0x3f')][_0x782b('0x4f')]?_0x331719[_0x782b('0x3f')]:_0x428793[_0x782b('0x3e')];if(_0x361a45[_0x782b('0x3b')][_0x782b('0x50')]){_0x331719['include']=[{'all':!![]}];}_0x331719=_[_0x782b('0x48')]({},_0x331719,_0x361a45[_0x782b('0x49')]);return db[_0x782b('0x35')][_0x782b('0x51')](_0x331719)[_0x782b('0x1c')](handleEntityNotFound(_0x3a15fe,null))[_0x782b('0x1c')](respondWithResult(_0x3a15fe,null))[_0x782b('0x26')](handleError(_0x3a15fe,null));};exports['clone']=function(_0xf6812a,_0x5a7f6d){var _0x34998c={'where':{'id':_0xf6812a[_0x782b('0x52')]['id']}},_0x4b0dca={};_0x4b0dca[_0x782b('0x3e')]=_[_0x782b('0x3c')](db[_0x782b('0x35')]['rawAttributes']);_0x34998c[_0x782b('0x3f')]=_[_0x782b('0x53')](_0x4b0dca[_0x782b('0x3e')],qs[_0x782b('0x40')](_0xf6812a[_0x782b('0x3b')][_0x782b('0x40')]));_0x34998c[_0x782b('0x3f')]=_0x34998c[_0x782b('0x3f')][_0x782b('0x4f')]?_0x34998c[_0x782b('0x3f')]:_0x4b0dca[_0x782b('0x3e')];if(_0xf6812a[_0x782b('0x3b')][_0x782b('0x50')]){_0x34998c[_0x782b('0x4b')]=[{'all':!![]}];}_0x34998c=_[_0x782b('0x48')]({},_0x34998c,_0xf6812a[_0x782b('0x49')]);return db[_0x782b('0x35')][_0x782b('0x51')](_0x34998c)[_0x782b('0x1c')](handleEntityNotFound(_0x5a7f6d,null))[_0x782b('0x1c')](function(_0x199882){if(_0x199882){var _0x5348a8=_0x199882[_0x782b('0x2f')]({'plain':!![]});_0x5348a8=qs[_0x782b('0x54')](_0x5348a8,['id',_0x782b('0x55'),_0x782b('0x56')]);_0xf6812a[_0x782b('0x57')]=_['omit'](_0xf6812a[_0x782b('0x57')],['id',_0x782b('0x55'),_0x782b('0x56')]);return db[_0x782b('0x35')][_0x782b('0x58')](_[_0x782b('0x48')](_0x5348a8,_0xf6812a[_0x782b('0x57')]),{'include':_0xf6812a[_0x782b('0x3b')][_0x782b('0x50')]?[{'all':!![]}]:undefined})['then'](function(_0x1c191f){var _0x3c924=_0xf6812a[_0x782b('0x59')]['get']({'plain':!![]});if(!_0x3c924)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3c924['role']===_0x782b('0x59')){var _0x22b612=_0x1c191f[_0x782b('0x2f')]({'plain':!![]});var _0x1f385c=_0x782b('0x30');return db[_0x782b('0x5a')][_0x782b('0x51')]({'where':{'name':_0x1f385c,'userProfileId':_0x3c924[_0x782b('0x5b')]},'raw':!![]})['then'](function(_0x1ee49f){if(_0x1ee49f&&_0x1ee49f[_0x782b('0x5c')]===0x0){return db[_0x782b('0x5d')][_0x782b('0x58')]({'name':_0x22b612[_0x782b('0x32')],'resourceId':_0x22b612['id'],'type':_0x1ee49f[_0x782b('0x32')],'sectionId':_0x1ee49f['id']},{})[_0x782b('0x1c')](function(){return _0x1c191f;});}else{return _0x1c191f;}})[_0x782b('0x26')](function(_0x597c55){logger[_0x782b('0x22')](_0x782b('0x5e'),_0x597c55);throw _0x597c55;});}return _0x1c191f;});}})[_0x782b('0x1c')](respondWithResult(_0x5a7f6d,0xc9))[_0x782b('0x26')](handleError(_0x5a7f6d,null));};exports[_0x782b('0x58')]=function(_0x2f1278,_0x178c16,_0x80e8ad){var _0x221ed5;return db[_0x782b('0x35')][_0x782b('0x58')](_0x2f1278[_0x782b('0x57')],{'raw':!![]})[_0x782b('0x1c')](function(_0x171a2c){_0x221ed5=_0x171a2c;return db[_0x782b('0x35')][_0x782b('0x4c')]({'raw':!![]});})[_0x782b('0x1c')](function(_0xfe2981){var _0x25f7c4=fs[_0x782b('0x5f')](path['join'](config[_0x782b('0x60')],_0x782b('0x61')),_0x782b('0x62'));var _0x52c89c=fs[_0x782b('0x5f')](path[_0x782b('0x63')](config[_0x782b('0x60')],_0x782b('0x64')),_0x782b('0x62'));var _0x177292=ejs[_0x782b('0x65')](_0x25f7c4,{'trunks':_0xfe2981||[]});fs[_0x782b('0x66')](_0x782b('0x67'),_0x177292);if(_0x221ed5['registry']){var _0x41b971=ejs[_0x782b('0x65')](_0x52c89c,{'trunks':_0xfe2981||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x41b971);}})[_0x782b('0x1c')](function(){return respondWithRpcPromise(_0x782b('0x68'),_0x782b('0x58'),{'module':_0x782b('0x69')});})[_0x782b('0x1c')](function(){var _0x46e210=_0x2f1278[_0x782b('0x59')][_0x782b('0x2f')]({'plain':!![]});if(!_0x46e210)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x46e210[_0x782b('0x6a')]===_0x782b('0x59')){var _0x381bba=_0x221ed5['get']({'plain':!![]});return db['UserProfileSection'][_0x782b('0x51')]({'where':{'name':'Trunks','userProfileId':_0x46e210['userProfileId']},'raw':!![]})[_0x782b('0x1c')](function(_0x18b7c8){if(_0x18b7c8&&_0x18b7c8[_0x782b('0x5c')]===0x0){return db[_0x782b('0x5d')][_0x782b('0x58')]({'name':_0x381bba[_0x782b('0x32')],'resourceId':_0x381bba['id'],'type':_0x18b7c8['name'],'sectionId':_0x18b7c8['id']},{})[_0x782b('0x1c')](function(){return _0x221ed5;});}else{return _0x221ed5;}})[_0x782b('0x26')](function(_0xf4e97a){logger[_0x782b('0x22')](_0x782b('0x5e'),_0xf4e97a);throw _0xf4e97a;});}return _0x221ed5;})['then'](respondWithResult(_0x178c16,0xc9))[_0x782b('0x26')](handleError(_0x178c16,null));};exports[_0x782b('0x6b')]=function(_0x2c105a,_0x4508d3,_0x37eb18){var _0x3cdd7c;return db[_0x782b('0x35')][_0x782b('0x51')]({'where':{'id':_0x2c105a[_0x782b('0x52')]['id']}})[_0x782b('0x1c')](handleEntityNotFound(_0x4508d3,null))[_0x782b('0x1c')](saveUpdates(_0x2c105a[_0x782b('0x57')],null))['then'](function(_0x27d94b){if(_0x27d94b){_0x3cdd7c=_0x27d94b;return db['Trunk'][_0x782b('0x4c')]({'raw':!![]});}})[_0x782b('0x1c')](function(_0x273ab7){if(_0x273ab7){var _0x22b21f=fs[_0x782b('0x5f')](path[_0x782b('0x63')](config[_0x782b('0x60')],_0x782b('0x61')),'utf8');var _0x63b33c=fs[_0x782b('0x5f')](path['join'](config['root'],_0x782b('0x64')),_0x782b('0x62'));var _0x565dd7=ejs['render'](_0x22b21f,{'trunks':_0x273ab7||[]});fs[_0x782b('0x66')](_0x782b('0x67'),_0x565dd7);var _0x39ddfe=ejs[_0x782b('0x65')](_0x63b33c,{'trunks':_0x273ab7||[]});fs[_0x782b('0x66')](_0x782b('0x6c'),_0x39ddfe);return respondWithRpcPromise(_0x782b('0x68'),_0x782b('0x6b'),{'module':'chan_sip.so'});}return null;})[_0x782b('0x1c')](function(_0xabc5e3){if(_0xabc5e3){return _0x3cdd7c;}})[_0x782b('0x1c')](respondWithResult(_0x4508d3,null))[_0x782b('0x26')](handleError(_0x4508d3,null));};exports[_0x782b('0x2e')]=function(_0x20dc7b,_0x1f13cb,_0x2cfad4){var _0x459f0d;return db[_0x782b('0x35')][_0x782b('0x51')]({'where':{'id':_0x20dc7b[_0x782b('0x52')]['id']}})['then'](handleEntityNotFound(_0x1f13cb,null))[_0x782b('0x1c')](removeEntity(_0x1f13cb,null))[_0x782b('0x1c')](function(){return db[_0x782b('0x35')][_0x782b('0x4c')]({'raw':!![]});})[_0x782b('0x1c')](function(_0x149cda){var _0x5f26cf=fs[_0x782b('0x5f')](path[_0x782b('0x63')](config[_0x782b('0x60')],_0x782b('0x61')),'utf8');var _0x489ce0=fs[_0x782b('0x5f')](path[_0x782b('0x63')](config[_0x782b('0x60')],_0x782b('0x64')),_0x782b('0x62'));var _0x3bd60b=ejs['render'](_0x5f26cf,{'trunks':_0x149cda});var _0x5e6b12=ejs[_0x782b('0x65')](_0x489ce0,{'trunks':_0x149cda});fs[_0x782b('0x66')](_0x782b('0x67'),_0x3bd60b);fs[_0x782b('0x66')](_0x782b('0x6c'),_0x5e6b12);return respondWithRpcPromise(_0x782b('0x68'),_0x782b('0x2e'),{'module':_0x782b('0x69')});})[_0x782b('0x26')](handleError(_0x1f13cb,null));}; \ No newline at end of file +var _0x80ab=['/etc/asterisk/sip_xcally_registers.conf','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','http','Sequelize','then','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','sendStatus','status','end','json','offset','limit','Content-Range','apply','save','destroy','get','UserProfileResource','stack','name','send','index','map','Trunk','rawAttributes','fieldName','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','options','count','includeAll','include','rows','catch','show','find','clone','omit','createdAt','updatedAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Trunks','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findAll','readFileSync','join','root','utf8','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','Reload','chan_sip.so','update','params','server/files/templates/trunk.ejs'];(function(_0x875bc2,_0x22d3b1){var _0x5de6e2=function(_0xc861e9){while(--_0xc861e9){_0x875bc2['push'](_0x875bc2['shift']());}};_0x5de6e2(++_0x22d3b1);}(_0x80ab,0xd7));var _0xb80a=function(_0x797784,_0x46343e){_0x797784=_0x797784-0x0;var _0x186f85=_0x80ab[_0x797784];return _0x186f85;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb80a('0x0'));var rimraf=require(_0xb80a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb80a('0x2'));var rp=require(_0xb80a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb80a('0x4'));var util=require(_0xb80a('0x5'));var path=require(_0xb80a('0x6'));var sox=require('sox');var csv=require(_0xb80a('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xb80a('0x8'));var jsforce=require(_0xb80a('0x9'));var deskjs=require(_0xb80a('0xa'));var toCsv=require(_0xb80a('0x7'));var querystring=require(_0xb80a('0xb'));var Papa=require(_0xb80a('0xc'));var Redis=require(_0xb80a('0xd'));var authService=require(_0xb80a('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xb80a('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb80a('0x10'))(_0xb80a('0x11'));var utils=require(_0xb80a('0x12'));var config=require(_0xb80a('0x13'));var db=require(_0xb80a('0x14'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xb80a('0x15')]({'port':0x232a});function checkPasswordPattern(_0xe64638,_0x4db93c,_0x43f8b1){if(_0x43f8b1){var _0x2c3cca=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2c3cca['test'](_0x4db93c)){return _0xe64638;}else{throw new db[(_0xb80a('0x16'))]['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~!@#$%^&-_=+[{]}.');}}else{return _0xe64638;}}function respondWithRpcPromise(_0x49095d,_0x3130ba,_0x5171f2,_0x5b3ae9){return new BPromise(function(_0x162b76,_0x520c85){var _0x1e0c9e=_0x5b3ae9||client;return _0x1e0c9e['request'](_0x49095d,_0x5171f2)[_0xb80a('0x17')](function(_0x1d2246){logger['info'](_0xb80a('0x18'),_0x3130ba,'request\x20sent');logger[_0xb80a('0x19')](_0xb80a('0x1a'),_0x3130ba,_0xb80a('0x1b'),JSON[_0xb80a('0x1c')](_0x1d2246));if(_0x1d2246[_0xb80a('0x1d')]){if(_0x1d2246[_0xb80a('0x1d')][_0xb80a('0x1e')]===0x1f4){logger['error'](_0xb80a('0x18'),_0x3130ba,_0x1d2246[_0xb80a('0x1d')][_0xb80a('0x1f')]);return _0x520c85(_0x1d2246[_0xb80a('0x1d')]['message']);}logger[_0xb80a('0x1d')](_0xb80a('0x18'),_0x3130ba,_0x1d2246['error'][_0xb80a('0x1f')]);return _0x162b76(_0x1d2246['error']['message']);}else{logger[_0xb80a('0x20')]('Trunk,\x20%s,\x20%s',_0x3130ba,_0xb80a('0x1b'));_0x162b76(_0x1d2246[_0xb80a('0x21')]['message']);}})['catch'](function(_0x2daac1){logger[_0xb80a('0x1d')](_0xb80a('0x18'),_0x3130ba,_0x2daac1);_0x520c85(_0x2daac1);});});}function respondWithStatusCode(_0x2cc2da,_0x26f775){_0x26f775=_0x26f775||0xcc;return function(_0x212084){if(_0x212084){return _0x2cc2da[_0xb80a('0x22')](_0x26f775);}return _0x2cc2da[_0xb80a('0x23')](_0x26f775)[_0xb80a('0x24')]();};}function respondWithResult(_0x16f44e,_0x4861bb){_0x4861bb=_0x4861bb||0xc8;return function(_0x4ab0d3){if(_0x4ab0d3){return _0x16f44e[_0xb80a('0x23')](_0x4861bb)[_0xb80a('0x25')](_0x4ab0d3);}};}function respondWithFilteredResult(_0x3c48cb,_0x20ac90){return function(_0x37bd6a){if(_0x37bd6a){var _0x778c31=_0x37bd6a['count'],_0x1f32ea=_0x20ac90[_0xb80a('0x26')],_0x1e2af0=_0x20ac90[_0xb80a('0x26')]+_0x20ac90[_0xb80a('0x27')],_0x3b0cd2;if(_0x1e2af0>=_0x778c31){_0x1e2af0=_0x778c31;_0x3b0cd2=0xc8;}else{_0x3b0cd2=0xce;}_0x3c48cb[_0xb80a('0x23')](_0x3b0cd2);return _0x3c48cb['set'](_0xb80a('0x28'),_0x1f32ea+'-'+_0x1e2af0+'/'+_0x778c31)[_0xb80a('0x25')](_0x37bd6a);}return null;};}function patchUpdates(_0x4f4dc6){return function(_0x1169d4){try{jsonpatch[_0xb80a('0x29')](_0x1169d4,_0x4f4dc6,!![]);}catch(_0x3a0092){return BPromise['reject'](_0x3a0092);}return _0x1169d4[_0xb80a('0x2a')]();};}function saveUpdates(_0x19e182,_0x32549d){return function(_0x496ded){if(_0x496ded){return _0x496ded['update'](_0x19e182)[_0xb80a('0x17')](function(_0x1ac87b){return _0x1ac87b;});}return null;};}function removeEntity(_0x177053,_0x540080){return function(_0x2e9060){if(_0x2e9060){return _0x2e9060[_0xb80a('0x2b')]()[_0xb80a('0x17')](function(){var _0x4ebb8f=_0x2e9060[_0xb80a('0x2c')]({'plain':!![]});var _0x44dba2='Trunks';return db[_0xb80a('0x2d')][_0xb80a('0x2b')]({'where':{'type':_0x44dba2,'resourceId':_0x4ebb8f['id']}})[_0xb80a('0x17')](function(){return _0x2e9060;});})['then'](function(){_0x177053['status'](0xcc)[_0xb80a('0x24')]();});}};}function handleEntityNotFound(_0xc227c5,_0x10e92b){return function(_0x2910a6){if(!_0x2910a6){_0xc227c5['sendStatus'](0x194);}return _0x2910a6;};}function handleError(_0x34d238,_0x39cf2e){_0x39cf2e=_0x39cf2e||0x1f4;return function(_0x237efb){logger[_0xb80a('0x1d')](_0x237efb[_0xb80a('0x2e')]);if(_0x237efb[_0xb80a('0x2f')]){delete _0x237efb[_0xb80a('0x2f')];}_0x34d238[_0xb80a('0x23')](_0x39cf2e)[_0xb80a('0x30')](_0x237efb);};}exports[_0xb80a('0x31')]=function(_0x584e02,_0x3754b9){var _0x503d15={},_0x3b274d={},_0xa54aa5={'count':0x0,'rows':[]};var _0x88aa84=_[_0xb80a('0x32')](db[_0xb80a('0x33')][_0xb80a('0x34')],function(_0x2dad6f){return{'name':_0x2dad6f[_0xb80a('0x35')],'type':_0x2dad6f['type'][_0xb80a('0x36')]};});_0x3b274d[_0xb80a('0x37')]=_['map'](_0x88aa84,_0xb80a('0x2f'));_0x3b274d['query']=_[_0xb80a('0x38')](_0x584e02['query']);_0x3b274d['filters']=_[_0xb80a('0x39')](_0x3b274d[_0xb80a('0x37')],_0x3b274d[_0xb80a('0x3a')]);_0x503d15[_0xb80a('0x3b')]=_['intersection'](_0x3b274d[_0xb80a('0x37')],qs[_0xb80a('0x3c')](_0x584e02[_0xb80a('0x3a')][_0xb80a('0x3c')]));_0x503d15[_0xb80a('0x3b')]=_0x503d15[_0xb80a('0x3b')][_0xb80a('0x3d')]?_0x503d15[_0xb80a('0x3b')]:_0x3b274d['model'];if(!_0x584e02[_0xb80a('0x3a')][_0xb80a('0x3e')]('nolimit')){_0x503d15[_0xb80a('0x27')]=qs[_0xb80a('0x27')](_0x584e02['query']['limit']);_0x503d15[_0xb80a('0x26')]=qs['offset'](_0x584e02['query'][_0xb80a('0x26')]);}_0x503d15[_0xb80a('0x3f')]=qs[_0xb80a('0x40')](_0x584e02['query'][_0xb80a('0x40')]);_0x503d15[_0xb80a('0x41')]=qs[_0xb80a('0x42')](_[_0xb80a('0x43')](_0x584e02[_0xb80a('0x3a')],_0x3b274d[_0xb80a('0x42')]));if(_0x584e02[_0xb80a('0x3a')][_0xb80a('0x44')]){_0x503d15['where']=_[_0xb80a('0x45')](_0x503d15[_0xb80a('0x41')],{'$or':_[_0xb80a('0x32')](_0x88aa84,function(_0x3ca0da){if(_0x3ca0da[_0xb80a('0x46')]!=='VIRTUAL'){var _0x1aec36={};_0x1aec36[_0x3ca0da['name']]={'$like':'%'+_0x584e02['query'][_0xb80a('0x44')]+'%'};return _0x1aec36;}})});}_0x503d15=_['merge']({},_0x503d15,_0x584e02[_0xb80a('0x47')]);var _0x3513fb={'where':_0x503d15[_0xb80a('0x41')]};return db[_0xb80a('0x33')]['count'](_0x3513fb)['then'](function(_0x22f546){_0xa54aa5[_0xb80a('0x48')]=_0x22f546;if(_0x584e02[_0xb80a('0x3a')][_0xb80a('0x49')]){_0x503d15[_0xb80a('0x4a')]=[{'all':!![]}];}return db[_0xb80a('0x33')]['findAll'](_0x503d15);})[_0xb80a('0x17')](function(_0x5ee709){_0xa54aa5[_0xb80a('0x4b')]=_0x5ee709;return _0xa54aa5;})[_0xb80a('0x17')](respondWithFilteredResult(_0x3754b9,_0x503d15))[_0xb80a('0x4c')](handleError(_0x3754b9,null));};exports[_0xb80a('0x4d')]=function(_0x2b962d,_0x743984){var _0x4c4480={'raw':![],'where':{'id':_0x2b962d['params']['id']}},_0x5ba739={};_0x5ba739['model']=_['keys'](db[_0xb80a('0x33')]['rawAttributes']);_0x5ba739[_0xb80a('0x3a')]=_[_0xb80a('0x38')](_0x2b962d['query']);_0x5ba739[_0xb80a('0x42')]=_[_0xb80a('0x39')](_0x5ba739[_0xb80a('0x37')],_0x5ba739['query']);_0x4c4480[_0xb80a('0x3b')]=_['intersection'](_0x5ba739['model'],qs['fields'](_0x2b962d[_0xb80a('0x3a')][_0xb80a('0x3c')]));_0x4c4480[_0xb80a('0x3b')]=_0x4c4480[_0xb80a('0x3b')][_0xb80a('0x3d')]?_0x4c4480[_0xb80a('0x3b')]:_0x5ba739['model'];if(_0x2b962d[_0xb80a('0x3a')][_0xb80a('0x49')]){_0x4c4480[_0xb80a('0x4a')]=[{'all':!![]}];}_0x4c4480=_['merge']({},_0x4c4480,_0x2b962d['options']);return db[_0xb80a('0x33')][_0xb80a('0x4e')](_0x4c4480)[_0xb80a('0x17')](handleEntityNotFound(_0x743984,null))[_0xb80a('0x17')](respondWithResult(_0x743984,null))[_0xb80a('0x4c')](handleError(_0x743984,null));};exports[_0xb80a('0x4f')]=function(_0x2ac81c,_0x66a0f0){var _0x4caa12={'where':{'id':_0x2ac81c['params']['id']}},_0x404768={};_0x404768[_0xb80a('0x37')]=_[_0xb80a('0x38')](db['Trunk']['rawAttributes']);_0x4caa12[_0xb80a('0x3b')]=_[_0xb80a('0x39')](_0x404768[_0xb80a('0x37')],qs[_0xb80a('0x3c')](_0x2ac81c[_0xb80a('0x3a')]['fields']));_0x4caa12[_0xb80a('0x3b')]=_0x4caa12[_0xb80a('0x3b')][_0xb80a('0x3d')]?_0x4caa12['attributes']:_0x404768[_0xb80a('0x37')];if(_0x2ac81c[_0xb80a('0x3a')][_0xb80a('0x49')]){_0x4caa12['include']=[{'all':!![]}];}_0x4caa12=_['merge']({},_0x4caa12,_0x2ac81c[_0xb80a('0x47')]);return db[_0xb80a('0x33')][_0xb80a('0x4e')](_0x4caa12)[_0xb80a('0x17')](handleEntityNotFound(_0x66a0f0,null))[_0xb80a('0x17')](function(_0x44f17e){if(_0x44f17e){var _0x4349ec=_0x44f17e['get']({'plain':!![]});_0x4349ec=qs[_0xb80a('0x50')](_0x4349ec,['id',_0xb80a('0x51'),_0xb80a('0x52')]);_0x2ac81c['body']=_[_0xb80a('0x50')](_0x2ac81c[_0xb80a('0x53')],['id',_0xb80a('0x51'),_0xb80a('0x52')]);return db[_0xb80a('0x33')][_0xb80a('0x54')](_['merge'](_0x4349ec,_0x2ac81c[_0xb80a('0x53')]),{'include':_0x2ac81c[_0xb80a('0x3a')][_0xb80a('0x49')]?[{'all':!![]}]:undefined})[_0xb80a('0x17')](function(_0x4017f2){var _0x31dc23=_0x2ac81c[_0xb80a('0x55')][_0xb80a('0x2c')]({'plain':!![]});if(!_0x31dc23)throw new Error(_0xb80a('0x56'));if(_0x31dc23[_0xb80a('0x57')]===_0xb80a('0x55')){var _0x1fe1e6=_0x4017f2[_0xb80a('0x2c')]({'plain':!![]});var _0x37ad5e=_0xb80a('0x58');return db['UserProfileSection']['find']({'where':{'name':_0x37ad5e,'userProfileId':_0x31dc23['userProfileId']},'raw':!![]})[_0xb80a('0x17')](function(_0x174b5f){if(_0x174b5f&&_0x174b5f[_0xb80a('0x59')]===0x0){return db['UserProfileResource']['create']({'name':_0x1fe1e6[_0xb80a('0x2f')],'resourceId':_0x1fe1e6['id'],'type':_0x174b5f[_0xb80a('0x2f')],'sectionId':_0x174b5f['id']},{})[_0xb80a('0x17')](function(){return _0x4017f2;});}else{return _0x4017f2;}})[_0xb80a('0x4c')](function(_0x372aad){logger[_0xb80a('0x1d')](_0xb80a('0x5a'),_0x372aad);throw _0x372aad;});}return _0x4017f2;});}})['then'](respondWithResult(_0x66a0f0,0xc9))[_0xb80a('0x4c')](handleError(_0x66a0f0,null));};exports['create']=function(_0xbe6cb3,_0x1d7eab,_0x10622d){var _0x968b6f;return db[_0xb80a('0x33')][_0xb80a('0x54')](_0xbe6cb3['body'],{'raw':!![]})[_0xb80a('0x17')](function(_0xd71583){_0x968b6f=_0xd71583;return db['Trunk'][_0xb80a('0x5b')]({'raw':!![]});})[_0xb80a('0x17')](function(_0x10f46f){var _0x4497c7=fs[_0xb80a('0x5c')](path[_0xb80a('0x5d')](config[_0xb80a('0x5e')],'server/files/templates/trunk.ejs'),_0xb80a('0x5f'));var _0x27e262=fs['readFileSync'](path['join'](config[_0xb80a('0x5e')],_0xb80a('0x60')),'utf8');var _0x300c66=ejs[_0xb80a('0x61')](_0x4497c7,{'trunks':_0x10f46f||[]});fs[_0xb80a('0x62')](_0xb80a('0x63'),_0x300c66);if(_0x968b6f[_0xb80a('0x64')]){var _0x2b0a01=ejs[_0xb80a('0x61')](_0x27e262,{'trunks':_0x10f46f||[]});fs[_0xb80a('0x62')]('/etc/asterisk/sip_xcally_registers.conf',_0x2b0a01);}})[_0xb80a('0x17')](function(){return respondWithRpcPromise(_0xb80a('0x65'),_0xb80a('0x54'),{'module':_0xb80a('0x66')});})[_0xb80a('0x17')](function(){var _0x12c538=_0xbe6cb3[_0xb80a('0x55')][_0xb80a('0x2c')]({'plain':!![]});if(!_0x12c538)throw new Error(_0xb80a('0x56'));if(_0x12c538['role']===_0xb80a('0x55')){var _0x41c4ca=_0x968b6f['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':'Trunks','userProfileId':_0x12c538['userProfileId']},'raw':!![]})[_0xb80a('0x17')](function(_0x14e6e4){if(_0x14e6e4&&_0x14e6e4[_0xb80a('0x59')]===0x0){return db[_0xb80a('0x2d')]['create']({'name':_0x41c4ca[_0xb80a('0x2f')],'resourceId':_0x41c4ca['id'],'type':_0x14e6e4[_0xb80a('0x2f')],'sectionId':_0x14e6e4['id']},{})['then'](function(){return _0x968b6f;});}else{return _0x968b6f;}})['catch'](function(_0xec4070){logger[_0xb80a('0x1d')](_0xb80a('0x5a'),_0xec4070);throw _0xec4070;});}return _0x968b6f;})[_0xb80a('0x17')](respondWithResult(_0x1d7eab,0xc9))[_0xb80a('0x4c')](handleError(_0x1d7eab,null));};exports[_0xb80a('0x67')]=function(_0x1e54db,_0x10b145,_0x459cea){var _0x5b0b3e;return db[_0xb80a('0x33')][_0xb80a('0x4e')]({'where':{'id':_0x1e54db[_0xb80a('0x68')]['id']}})[_0xb80a('0x17')](handleEntityNotFound(_0x10b145,null))[_0xb80a('0x17')](saveUpdates(_0x1e54db[_0xb80a('0x53')],null))[_0xb80a('0x17')](function(_0x45a416){if(_0x45a416){_0x5b0b3e=_0x45a416;return db[_0xb80a('0x33')][_0xb80a('0x5b')]({'raw':!![]});}})[_0xb80a('0x17')](function(_0x2d1eee){if(_0x2d1eee){var _0x26d67d=fs[_0xb80a('0x5c')](path[_0xb80a('0x5d')](config[_0xb80a('0x5e')],_0xb80a('0x69')),_0xb80a('0x5f'));var _0x321efe=fs['readFileSync'](path[_0xb80a('0x5d')](config[_0xb80a('0x5e')],'server/files/templates/registry.ejs'),_0xb80a('0x5f'));var _0x9e796c=ejs[_0xb80a('0x61')](_0x26d67d,{'trunks':_0x2d1eee||[]});fs[_0xb80a('0x62')](_0xb80a('0x63'),_0x9e796c);var _0x5f368b=ejs[_0xb80a('0x61')](_0x321efe,{'trunks':_0x2d1eee||[]});fs[_0xb80a('0x62')](_0xb80a('0x6a'),_0x5f368b);return respondWithRpcPromise(_0xb80a('0x65'),_0xb80a('0x67'),{'module':'chan_sip.so'});}return null;})[_0xb80a('0x17')](function(_0x563190){if(_0x563190){return _0x5b0b3e;}})[_0xb80a('0x17')](respondWithResult(_0x10b145,null))[_0xb80a('0x4c')](handleError(_0x10b145,null));};exports[_0xb80a('0x2b')]=function(_0xef6d95,_0x547536,_0x112fc8){var _0xfa074;return db[_0xb80a('0x33')][_0xb80a('0x4e')]({'where':{'id':_0xef6d95[_0xb80a('0x68')]['id']}})[_0xb80a('0x17')](handleEntityNotFound(_0x547536,null))['then'](removeEntity(_0x547536,null))[_0xb80a('0x17')](function(){return db[_0xb80a('0x33')][_0xb80a('0x5b')]({'raw':!![]});})[_0xb80a('0x17')](function(_0x1d4e36){var _0x22845a=fs['readFileSync'](path[_0xb80a('0x5d')](config[_0xb80a('0x5e')],_0xb80a('0x69')),_0xb80a('0x5f'));var _0x5d63ea=fs['readFileSync'](path[_0xb80a('0x5d')](config[_0xb80a('0x5e')],'server/files/templates/registry.ejs'),_0xb80a('0x5f'));var _0x409b66=ejs[_0xb80a('0x61')](_0x22845a,{'trunks':_0x1d4e36});var _0x40c19d=ejs[_0xb80a('0x61')](_0x5d63ea,{'trunks':_0x1d4e36});fs[_0xb80a('0x62')](_0xb80a('0x63'),_0x409b66);fs[_0xb80a('0x62')](_0xb80a('0x6a'),_0x40c19d);return respondWithRpcPromise('Reload',_0xb80a('0x2b'),{'module':_0xb80a('0x66')});})[_0xb80a('0x4c')](handleError(_0x547536,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index d377ead..15b24ab 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 _0x72af=['bluebird','path','rimraf','./trunk.attributes','define','Trunk','tools_trunks','lodash','../../config/logger','api','moment'];(function(_0xaf5b43,_0x543077){var _0x4a820b=function(_0x644750){while(--_0x644750){_0xaf5b43['push'](_0xaf5b43['shift']());}};_0x4a820b(++_0x543077);}(_0x72af,0xd8));var _0xf72a=function(_0x5d253e,_0x472b51){_0x5d253e=_0x5d253e-0x0;var _0x310122=_0x72af[_0x5d253e];return _0x310122;};'use strict';var _=require(_0xf72a('0x0'));var util=require('util');var logger=require(_0xf72a('0x1'))(_0xf72a('0x2'));var moment=require(_0xf72a('0x3'));var BPromise=require(_0xf72a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf72a('0x5'));var rimraf=require(_0xf72a('0x6'));var config=require('../../config/environment');var attributes=require(_0xf72a('0x7'));module['exports']=function(_0x5b18e3,_0x2a7562){return _0x5b18e3[_0xf72a('0x8')](_0xf72a('0x9'),attributes,{'tableName':_0xf72a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe39c=['../../config/environment','./trunk.attributes','exports','tools_trunks','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x28910d,_0x132aec){var _0x57e688=function(_0x44aefb){while(--_0x44aefb){_0x28910d['push'](_0x28910d['shift']());}};_0x57e688(++_0x132aec);}(_0xe39c,0xbf));var _0xce39=function(_0x131033,_0x551b40){_0x131033=_0x131033-0x0;var _0x131fc7=_0xe39c[_0x131033];return _0x131fc7;};'use strict';var _=require('lodash');var util=require(_0xce39('0x0'));var logger=require(_0xce39('0x1'))(_0xce39('0x2'));var moment=require(_0xce39('0x3'));var BPromise=require(_0xce39('0x4'));var rp=require(_0xce39('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xce39('0x6'));var config=require(_0xce39('0x7'));var attributes=require(_0xce39('0x8'));module[_0xce39('0x9')]=function(_0x318d70,_0x38341b){return _0x318d70['define']('Trunk',attributes,{'tableName':_0xce39('0xa'),'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 0953e22..6afcb30 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 _0x4fc2=['rpc','../../config/environment','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','findAll','options','where','attributes','include','model','map','GetTrunk','Trunk','find','raw','ShowTrunk','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x3f3f40,_0x4c71f4){var _0x403b7a=function(_0x509014){while(--_0x509014){_0x3f3f40['push'](_0x3f3f40['shift']());}};_0x403b7a(++_0x4c71f4);}(_0x4fc2,0x111));var _0x24fc=function(_0x25b9a1,_0x3e141b){_0x25b9a1=_0x25b9a1-0x0;var _0x2dff67=_0x4fc2[_0x25b9a1];return _0x2dff67;};'use strict';var _=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var moment=require(_0x24fc('0x2'));var BPromise=require(_0x24fc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x24fc('0x4'));var db=require(_0x24fc('0x5'))['db'];var utils=require(_0x24fc('0x6'));var logger=require('../../config/logger')(_0x24fc('0x7'));var config=require(_0x24fc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x24fc('0x9')][_0x24fc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4889f4,_0x115851,_0x22a0c8){return new BPromise(function(_0x220f9a,_0x123eff){return client[_0x24fc('0xb')](_0x4889f4,_0x22a0c8)[_0x24fc('0xc')](function(_0x5afdf1){logger[_0x24fc('0xd')](_0x24fc('0xe'),_0x115851,_0x24fc('0xf'));logger[_0x24fc('0x10')](_0x24fc('0x11'),_0x115851,_0x24fc('0xf'),JSON[_0x24fc('0x12')](_0x5afdf1));if(_0x5afdf1[_0x24fc('0x13')]){if(_0x5afdf1['error'][_0x24fc('0x14')]===0x1f4){logger[_0x24fc('0x13')]('Trunk,\x20%s,\x20%s',_0x115851,_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);return _0x123eff(_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);}logger[_0x24fc('0x13')](_0x24fc('0xe'),_0x115851,_0x5afdf1['error'][_0x24fc('0x15')]);return _0x220f9a(_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);}else{logger[_0x24fc('0xd')]('Trunk,\x20%s,\x20%s',_0x115851,_0x24fc('0xf'));_0x220f9a(_0x5afdf1['result'][_0x24fc('0x15')]);}})[_0x24fc('0x16')](function(_0x218fb6){logger[_0x24fc('0x13')](_0x24fc('0xe'),_0x115851,_0x218fb6);_0x123eff(_0x218fb6);});});}exports['GetTrunk']=function(_0x23873c){var _0x1cb3d0=this;return new Promise(function(_0x6cfa0a,_0x8ac114){return db['Trunk'][_0x24fc('0x17')]({'raw':_0x23873c[_0x24fc('0x18')]?_0x23873c[_0x24fc('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x23873c[_0x24fc('0x18')]?_0x23873c[_0x24fc('0x18')][_0x24fc('0x19')]||null:null,'attributes':_0x23873c[_0x24fc('0x18')]?_0x23873c['options'][_0x24fc('0x1a')]||null:null,'limit':_0x23873c['options']?_0x23873c[_0x24fc('0x18')]['limit']||null:null,'include':_0x23873c[_0x24fc('0x18')]?_0x23873c[_0x24fc('0x18')][_0x24fc('0x1b')]?_['map'](_0x23873c[_0x24fc('0x18')]['include'],function(_0x35a9c7){return{'model':db[_0x35a9c7[_0x24fc('0x1c')]],'as':_0x35a9c7['as'],'attributes':_0x35a9c7[_0x24fc('0x1a')],'include':_0x35a9c7[_0x24fc('0x1b')]?_[_0x24fc('0x1d')](_0x35a9c7[_0x24fc('0x1b')],function(_0x3f0875){return{'model':db[_0x3f0875[_0x24fc('0x1c')]],'as':_0x3f0875['as'],'attributes':_0x3f0875[_0x24fc('0x1a')],'include':_0x3f0875[_0x24fc('0x1b')]?_['map'](_0x3f0875[_0x24fc('0x1b')],function(_0x16f27f){return{'model':db[_0x16f27f[_0x24fc('0x1c')]],'as':_0x16f27f['as'],'attributes':_0x16f27f['attributes']};}):[]};}):[]};}):[]:[]})[_0x24fc('0xc')](function(_0x3d1ec8){logger[_0x24fc('0xd')](_0x24fc('0x1e'),_0x23873c);logger[_0x24fc('0x10')](_0x24fc('0x1e'),_0x23873c,JSON['stringify'](_0x3d1ec8));_0x6cfa0a(_0x3d1ec8);})[_0x24fc('0x16')](function(_0x29a461){logger[_0x24fc('0x13')](_0x24fc('0x1e'),_0x29a461[_0x24fc('0x15')],_0x23873c);_0x8ac114(_0x1cb3d0['error'](0x1f4,_0x29a461['message']));});});};exports['ShowTrunk']=function(_0x3df6f4){var _0x574ba3=this;return new Promise(function(_0x3f2464,_0x3e6389){return db[_0x24fc('0x1f')][_0x24fc('0x20')]({'raw':_0x3df6f4['options']?_0x3df6f4[_0x24fc('0x18')][_0x24fc('0x21')]===undefined?!![]:![]:!![],'where':_0x3df6f4['options']?_0x3df6f4[_0x24fc('0x18')][_0x24fc('0x19')]||null:null,'attributes':_0x3df6f4['options']?_0x3df6f4['options'][_0x24fc('0x1a')]||null:null,'include':_0x3df6f4['options']?_0x3df6f4[_0x24fc('0x18')][_0x24fc('0x1b')]?_['map'](_0x3df6f4[_0x24fc('0x18')][_0x24fc('0x1b')],function(_0x3b2862){return{'model':db[_0x3b2862[_0x24fc('0x1c')]],'as':_0x3b2862['as'],'attributes':_0x3b2862[_0x24fc('0x1a')],'include':_0x3b2862[_0x24fc('0x1b')]?_[_0x24fc('0x1d')](_0x3b2862[_0x24fc('0x1b')],function(_0x379a4a){return{'model':db[_0x379a4a['model']],'as':_0x379a4a['as'],'attributes':_0x379a4a[_0x24fc('0x1a')],'include':_0x379a4a[_0x24fc('0x1b')]?_[_0x24fc('0x1d')](_0x379a4a[_0x24fc('0x1b')],function(_0x242bd5){return{'model':db[_0x242bd5['model']],'as':_0x242bd5['as'],'attributes':_0x242bd5['attributes']};}):[]};}):[]};}):[]:[]})[_0x24fc('0xc')](function(_0x5d48fe){logger[_0x24fc('0xd')](_0x24fc('0x22'),_0x3df6f4);logger[_0x24fc('0x10')](_0x24fc('0x22'),_0x3df6f4,JSON['stringify'](_0x5d48fe));_0x3f2464(_0x5d48fe);})[_0x24fc('0x16')](function(_0x4f4ec8){logger[_0x24fc('0x13')](_0x24fc('0x22'),_0x4f4ec8[_0x24fc('0x15')],_0x3df6f4);_0x3e6389(_0x574ba3[_0x24fc('0x13')](0x1f4,_0x4f4ec8[_0x24fc('0x15')]));});});}; \ No newline at end of file +var _0x5f2f=['map','include','model','attributes','then','ShowTrunk','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','Trunk,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','GetTrunk','Trunk','findAll','options','raw','limit'];(function(_0x37ffea,_0x25b006){var _0x2e2615=function(_0x5e6c74){while(--_0x5e6c74){_0x37ffea['push'](_0x37ffea['shift']());}};_0x2e2615(++_0x25b006);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5758de,_0x79d46a){_0x5758de=_0x5758de-0x0;var _0x717f22=_0x5f2f[_0x5758de];return _0x717f22;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('Trunk,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}exports[_0xf5f2('0x17')]=function(_0x20fccd){var _0x28e097=this;return new Promise(function(_0x4ff59b,_0x3ee69){return db[_0xf5f2('0x18')][_0xf5f2('0x19')]({'raw':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd['options'][_0xf5f2('0x1b')]===undefined?!![]:![]:!![],'where':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd['options']['where']||null:null,'attributes':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd[_0xf5f2('0x1a')]['attributes']||null:null,'limit':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd[_0xf5f2('0x1a')][_0xf5f2('0x1c')]||null:null,'include':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd[_0xf5f2('0x1a')]['include']?_[_0xf5f2('0x1d')](_0x20fccd[_0xf5f2('0x1a')][_0xf5f2('0x1e')],function(_0x2833fe){return{'model':db[_0x2833fe[_0xf5f2('0x1f')]],'as':_0x2833fe['as'],'attributes':_0x2833fe['attributes'],'include':_0x2833fe['include']?_[_0xf5f2('0x1d')](_0x2833fe[_0xf5f2('0x1e')],function(_0x13da6f){return{'model':db[_0x13da6f[_0xf5f2('0x1f')]],'as':_0x13da6f['as'],'attributes':_0x13da6f[_0xf5f2('0x20')],'include':_0x13da6f[_0xf5f2('0x1e')]?_[_0xf5f2('0x1d')](_0x13da6f[_0xf5f2('0x1e')],function(_0x294414){return{'model':db[_0x294414['model']],'as':_0x294414['as'],'attributes':_0x294414[_0xf5f2('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf5f2('0x21')](function(_0x375ca8){logger[_0xf5f2('0xd')](_0xf5f2('0x17'),_0x20fccd);logger[_0xf5f2('0xf')]('GetTrunk',_0x20fccd,JSON['stringify'](_0x375ca8));_0x4ff59b(_0x375ca8);})[_0xf5f2('0x16')](function(_0x14c829){logger[_0xf5f2('0x11')]('GetTrunk',_0x14c829['message'],_0x20fccd);_0x3ee69(_0x28e097[_0xf5f2('0x11')](0x1f4,_0x14c829[_0xf5f2('0x13')]));});});};exports[_0xf5f2('0x22')]=function(_0x153924){var _0x1b381e=this;return new Promise(function(_0x54c0c8,_0x52e959){return db[_0xf5f2('0x18')]['find']({'raw':_0x153924[_0xf5f2('0x1a')]?_0x153924['options'][_0xf5f2('0x1b')]===undefined?!![]:![]:!![],'where':_0x153924[_0xf5f2('0x1a')]?_0x153924[_0xf5f2('0x1a')][_0xf5f2('0x23')]||null:null,'attributes':_0x153924[_0xf5f2('0x1a')]?_0x153924[_0xf5f2('0x1a')][_0xf5f2('0x20')]||null:null,'include':_0x153924[_0xf5f2('0x1a')]?_0x153924['options'][_0xf5f2('0x1e')]?_[_0xf5f2('0x1d')](_0x153924[_0xf5f2('0x1a')][_0xf5f2('0x1e')],function(_0x1408b9){return{'model':db[_0x1408b9[_0xf5f2('0x1f')]],'as':_0x1408b9['as'],'attributes':_0x1408b9[_0xf5f2('0x20')],'include':_0x1408b9['include']?_[_0xf5f2('0x1d')](_0x1408b9[_0xf5f2('0x1e')],function(_0x55989d){return{'model':db[_0x55989d[_0xf5f2('0x1f')]],'as':_0x55989d['as'],'attributes':_0x55989d['attributes'],'include':_0x55989d[_0xf5f2('0x1e')]?_[_0xf5f2('0x1d')](_0x55989d[_0xf5f2('0x1e')],function(_0x2e3cca){return{'model':db[_0x2e3cca['model']],'as':_0x2e3cca['as'],'attributes':_0x2e3cca['attributes']};}):[]};}):[]};}):[]:[]})[_0xf5f2('0x21')](function(_0x46ad4a){logger[_0xf5f2('0xd')]('ShowTrunk',_0x153924);logger[_0xf5f2('0xf')]('ShowTrunk',_0x153924,JSON[_0xf5f2('0x10')](_0x46ad4a));_0x54c0c8(_0x46ad4a);})['catch'](function(_0x46f464){logger[_0xf5f2('0x11')]('ShowTrunk',_0x46f464[_0xf5f2('0x13')],_0x153924);_0x52e959(_0x1b381e[_0xf5f2('0x11')](0x1f4,_0x46f464[_0xf5f2('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index b7cc798..2e17a2e 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 _0xdb28=['/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addChatWebsites','addSquareProjects','/:id/api_key','createApiKey','/:id','update','put','changePassword','delete','removeTeams','destroy','removeChatInteractions','/:id/mail_interactions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','/:id/fax_accounts','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeSquareProjects','removeApiKey','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','isAuthenticated','index','describe','get','/whoami','whoami','show','getAvatar','getContacts','/:id/queues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','/:id/sms/interactions','getSmsInteractions','getFaxInteractions','/:id/teams','getTeams','getAgents','/:id/prefixes','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','/:id/square_projects','getScheduledCalls','getApiKey','post','bulkCreate','/:id/contacts','addContacts','create','addQueues','diskStorage','server/files/images/','format','%s-%s','originalname','/:id/avatar','single','file','addAvatar','login'];(function(_0x15d805,_0x3c65d4){var _0x435a34=function(_0xf13535){while(--_0xf13535){_0x15d805['push'](_0x15d805['shift']());}};_0x435a34(++_0x3c65d4);}(_0xdb28,0x106));var _0x8db2=function(_0x44f2c3,_0x23b45a){_0x44f2c3=_0x44f2c3-0x0;var _0x403b14=_0xdb28[_0x44f2c3];return _0x403b14;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var auth=require(_0x8db2('0x5'));var interaction=require(_0x8db2('0x6'));var config=require(_0x8db2('0x7'));var controller=require(_0x8db2('0x8'));router['get']('/',auth[_0x8db2('0x9')](),controller[_0x8db2('0xa')]);router['get']('/describe',auth[_0x8db2('0x9')](),controller[_0x8db2('0xb')]);router[_0x8db2('0xc')](_0x8db2('0xd'),auth[_0x8db2('0x9')](),controller[_0x8db2('0xe')]);router[_0x8db2('0xc')]('/:id',auth[_0x8db2('0x9')](),controller[_0x8db2('0xf')]);router[_0x8db2('0xc')]('/:id/avatar',controller[_0x8db2('0x10')]);router[_0x8db2('0xc')]('/:id/contacts',auth[_0x8db2('0x9')](),controller[_0x8db2('0x11')]);router[_0x8db2('0xc')](_0x8db2('0x12'),auth[_0x8db2('0x9')](),controller['getQueues']);router['get'](_0x8db2('0x13'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x14')]);router[_0x8db2('0xc')](_0x8db2('0x15'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x16')]);router[_0x8db2('0xc')](_0x8db2('0x17'),auth[_0x8db2('0x9')](),controller['getRecordings']);router[_0x8db2('0xc')](_0x8db2('0x18'),auth['isAuthenticated'](),controller[_0x8db2('0x19')]);router[_0x8db2('0xc')](_0x8db2('0x1a'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x1b')]);router[_0x8db2('0xc')]('/:id/openchannel/interactions',auth['isAuthenticated'](),controller[_0x8db2('0x1c')]);router[_0x8db2('0xc')](_0x8db2('0x1d'),auth[_0x8db2('0x9')](),controller['getMailInteractions']);router[_0x8db2('0xc')](_0x8db2('0x1e'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x1f')]);router[_0x8db2('0xc')]('/:id/fax/interactions',auth[_0x8db2('0x9')](),controller[_0x8db2('0x20')]);router[_0x8db2('0xc')](_0x8db2('0x21'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x22')]);router[_0x8db2('0xc')]('/:id/lists',auth[_0x8db2('0x9')](),controller['getLists']);router['get']('/:id/agents',auth['isAuthenticated'](),controller[_0x8db2('0x23')]);router[_0x8db2('0xc')](_0x8db2('0x24'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x25')]);router[_0x8db2('0xc')]('/:id/fax_accounts',auth[_0x8db2('0x9')](),controller[_0x8db2('0x26')]);router[_0x8db2('0xc')](_0x8db2('0x27'),auth['isAuthenticated'](),controller[_0x8db2('0x28')]);router[_0x8db2('0xc')](_0x8db2('0x29'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x2a')]);router[_0x8db2('0xc')](_0x8db2('0x2b'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x2c')]);router['get'](_0x8db2('0x2d'),auth['isAuthenticated'](),controller['getChatWebsites']);router[_0x8db2('0xc')](_0x8db2('0x2e'),auth[_0x8db2('0x9')](),controller['getSquareProjects']);router[_0x8db2('0xc')]('/:id/scheduled_calls',auth[_0x8db2('0x9')](),controller[_0x8db2('0x2f')]);router[_0x8db2('0xc')]('/:id/api_key',auth['isAuthenticated'](),controller[_0x8db2('0x30')]);router[_0x8db2('0x31')]('/create_many',auth['isAuthenticated'](),controller[_0x8db2('0x32')]);router[_0x8db2('0x31')](_0x8db2('0x33'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x34')]);router[_0x8db2('0x31')]('/',auth[_0x8db2('0x9')](),controller[_0x8db2('0x35')]);router[_0x8db2('0x31')](_0x8db2('0x12'),auth['isAuthenticated'](),controller[_0x8db2('0x36')]);var upload=multer({'storage':multer[_0x8db2('0x37')]({'destination':function(_0x5d2a5b,_0x41594c,_0x3ca80b){_0x3ca80b(null,path['join'](config['root'],_0x8db2('0x38')));},'filename':function(_0x4a45dd,_0x3dfbaa,_0x264696){_0x264696(null,util[_0x8db2('0x39')](_0x8db2('0x3a'),Date['now'](),_0x3dfbaa[_0x8db2('0x3b')]));}})});router['post'](_0x8db2('0x3c'),upload[_0x8db2('0x3d')](_0x8db2('0x3e')),controller[_0x8db2('0x3f')]);router['post']('/:id/login',auth[_0x8db2('0x9')](),controller[_0x8db2('0x40')]);router['post'](_0x8db2('0x41'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x42')]);router['post'](_0x8db2('0x43'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x44')]);router[_0x8db2('0x31')](_0x8db2('0x45'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x46')]);router[_0x8db2('0x31')](_0x8db2('0x21'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x47')]);router[_0x8db2('0x31')](_0x8db2('0x48'),auth['isAuthenticated'](),controller[_0x8db2('0x49')]);router[_0x8db2('0x31')]('/:id/mail_interactions',auth['isAuthenticated'](),controller[_0x8db2('0x4a')]);router['post'](_0x8db2('0x4b'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x4c')]);router[_0x8db2('0x31')](_0x8db2('0x4d'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x4e')]);router['post'](_0x8db2('0x4f'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x50')]);router[_0x8db2('0x31')]('/:id/fax_accounts',auth[_0x8db2('0x9')](),controller[_0x8db2('0x51')]);router[_0x8db2('0x31')](_0x8db2('0x27'),auth['isAuthenticated'](),controller[_0x8db2('0x52')]);router['post'](_0x8db2('0x29'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x53')]);router['post']('/:id/sms_accounts',auth[_0x8db2('0x9')](),controller['addSmsAccounts']);router[_0x8db2('0x31')](_0x8db2('0x2d'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x54')]);router[_0x8db2('0x31')](_0x8db2('0x2e'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x55')]);router[_0x8db2('0x31')](_0x8db2('0x56'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x57')]);router['put'](_0x8db2('0x58'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x59')]);router[_0x8db2('0x5a')]('/:id/password',auth['isAuthenticated'](),controller[_0x8db2('0x5b')]);router[_0x8db2('0x5c')](_0x8db2('0x12'),auth['isAuthenticated'](),controller['removeQueues']);router['delete'](_0x8db2('0x21'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x5d')]);router[_0x8db2('0x5c')](_0x8db2('0x58'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x5e')]);router['delete']('/:id/chat_interactions',auth[_0x8db2('0x9')](),controller[_0x8db2('0x5f')]);router[_0x8db2('0x5c')](_0x8db2('0x60'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x61')]);router[_0x8db2('0x5c')](_0x8db2('0x4b'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x62')]);router[_0x8db2('0x5c')](_0x8db2('0x4d'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x63')]);router[_0x8db2('0x5c')]('/:id/openchannel_interactions',auth[_0x8db2('0x9')](),controller[_0x8db2('0x64')]);router['delete'](_0x8db2('0x65'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x66')]);router['delete'](_0x8db2('0x27'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x67')]);router[_0x8db2('0x5c')](_0x8db2('0x29'),auth['isAuthenticated'](),controller[_0x8db2('0x68')]);router[_0x8db2('0x5c')](_0x8db2('0x2b'),auth['isAuthenticated'](),controller[_0x8db2('0x69')]);router[_0x8db2('0x5c')](_0x8db2('0x2d'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x6a')]);router[_0x8db2('0x5c')](_0x8db2('0x2e'),auth['isAuthenticated'](),controller[_0x8db2('0x6b')]);router[_0x8db2('0x5c')]('/:id/api_key',auth[_0x8db2('0x9')](),controller[_0x8db2('0x6c')]);module['exports']=router; \ No newline at end of file +var _0xadb5=['/:id/openchannel/interactions','getOpenchannelInteractions','getMailInteractions','/:id/sms/interactions','getFaxInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','/:id/fax_accounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','post','/create_many','bulkCreate','addContacts','addQueues','diskStorage','join','root','server/files/images/','format','now','single','addAvatar','/:id/logout','/:id/pause','pause','addTeams','/:id/chat_interactions','addChatInteractions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','addOpenchannelInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addChatWebsites','addSquareProjects','/:id/api_key','createApiKey','put','update','removeQueues','delete','removeChatInteractions','/:id/mail_interactions','removeMailInteractions','removeFaxInteractions','/:id/openchannel_interactions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeApiKey','exports','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./user.controller','isAuthenticated','index','get','/describe','describe','/whoami','whoami','/:id','show','getAvatar','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions'];(function(_0x292404,_0x38536b){var _0x5b7b06=function(_0x46b25e){while(--_0x46b25e){_0x292404['push'](_0x292404['shift']());}};_0x5b7b06(++_0x38536b);}(_0xadb5,0xad));var _0x5adb=function(_0x18dd8e,_0x93bc91){_0x18dd8e=_0x18dd8e-0x0;var _0x53bb57=_0xadb5[_0x18dd8e];return _0x53bb57;};'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 auth=require('../../components/auth/service');var interaction=require(_0x5adb('0x4'));var config=require(_0x5adb('0x5'));var controller=require(_0x5adb('0x6'));router['get']('/',auth[_0x5adb('0x7')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0xa'),auth[_0x5adb('0x7')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x9')](_0x5adb('0xc'),auth[_0x5adb('0x7')](),controller[_0x5adb('0xd')]);router[_0x5adb('0x9')](_0x5adb('0xe'),auth[_0x5adb('0x7')](),controller[_0x5adb('0xf')]);router['get']('/:id/avatar',controller[_0x5adb('0x10')]);router[_0x5adb('0x9')](_0x5adb('0x11'),auth['isAuthenticated'](),controller[_0x5adb('0x12')]);router['get'](_0x5adb('0x13'),auth['isAuthenticated'](),controller[_0x5adb('0x14')]);router[_0x5adb('0x9')](_0x5adb('0x15'),auth['isAuthenticated'](),controller[_0x5adb('0x16')]);router[_0x5adb('0x9')](_0x5adb('0x17'),auth['isAuthenticated'](),controller[_0x5adb('0x18')]);router['get'](_0x5adb('0x19'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x1a')]);router[_0x5adb('0x9')](_0x5adb('0x1b'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x1c')]);router[_0x5adb('0x9')](_0x5adb('0x1d'),auth['isAuthenticated'](),controller[_0x5adb('0x1e')]);router['get'](_0x5adb('0x1f'),auth['isAuthenticated'](),controller[_0x5adb('0x20')]);router['get']('/:id/mail/interactions',auth[_0x5adb('0x7')](),controller[_0x5adb('0x21')]);router[_0x5adb('0x9')](_0x5adb('0x22'),auth[_0x5adb('0x7')](),controller['getSmsInteractions']);router[_0x5adb('0x9')]('/:id/fax/interactions',auth['isAuthenticated'](),controller[_0x5adb('0x23')]);router[_0x5adb('0x9')](_0x5adb('0x24'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x25')]);router[_0x5adb('0x9')](_0x5adb('0x26'),auth['isAuthenticated'](),controller[_0x5adb('0x27')]);router[_0x5adb('0x9')](_0x5adb('0x28'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x29')]);router['get'](_0x5adb('0x2a'),auth[_0x5adb('0x7')](),controller['getVoicePrefixes']);router[_0x5adb('0x9')](_0x5adb('0x2b'),auth[_0x5adb('0x7')](),controller['getFaxAccounts']);router[_0x5adb('0x9')](_0x5adb('0x2c'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x2d')]);router[_0x5adb('0x9')](_0x5adb('0x2e'),auth['isAuthenticated'](),controller['getOpenchannelAccounts']);router['get'](_0x5adb('0x2f'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x30')]);router[_0x5adb('0x9')](_0x5adb('0x31'),auth['isAuthenticated'](),controller[_0x5adb('0x32')]);router[_0x5adb('0x9')](_0x5adb('0x33'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x34')]);router[_0x5adb('0x9')](_0x5adb('0x35'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x36')]);router[_0x5adb('0x9')]('/:id/api_key',auth[_0x5adb('0x7')](),controller['getApiKey']);router[_0x5adb('0x37')](_0x5adb('0x38'),auth['isAuthenticated'](),controller[_0x5adb('0x39')]);router[_0x5adb('0x37')](_0x5adb('0x11'),auth['isAuthenticated'](),controller[_0x5adb('0x3a')]);router[_0x5adb('0x37')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5adb('0x37')]('/:id/queues',auth[_0x5adb('0x7')](),controller[_0x5adb('0x3b')]);var upload=multer({'storage':multer[_0x5adb('0x3c')]({'destination':function(_0x2da912,_0x9bdece,_0x5ece39){_0x5ece39(null,path[_0x5adb('0x3d')](config[_0x5adb('0x3e')],_0x5adb('0x3f')));},'filename':function(_0x54851b,_0x4c8870,_0x32eb69){_0x32eb69(null,util[_0x5adb('0x40')]('%s-%s',Date[_0x5adb('0x41')](),_0x4c8870['originalname']));}})});router[_0x5adb('0x37')]('/:id/avatar',upload[_0x5adb('0x42')]('file'),controller[_0x5adb('0x43')]);router[_0x5adb('0x37')]('/:id/login',auth[_0x5adb('0x7')](),controller['login']);router[_0x5adb('0x37')](_0x5adb('0x44'),auth[_0x5adb('0x7')](),controller['logout']);router[_0x5adb('0x37')](_0x5adb('0x45'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x46')]);router[_0x5adb('0x37')]('/:id/unpause',auth['isAuthenticated'](),controller['unpause']);router['post'](_0x5adb('0x24'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x47')]);router[_0x5adb('0x37')](_0x5adb('0x48'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x49')]);router[_0x5adb('0x37')]('/:id/mail_interactions',auth['isAuthenticated'](),controller[_0x5adb('0x4a')]);router['post'](_0x5adb('0x4b'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x4c')]);router[_0x5adb('0x37')](_0x5adb('0x4d'),auth['isAuthenticated'](),controller[_0x5adb('0x4e')]);router[_0x5adb('0x37')]('/:id/openchannel_interactions',auth[_0x5adb('0x7')](),controller[_0x5adb('0x4f')]);router['post'](_0x5adb('0x2b'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x50')]);router[_0x5adb('0x37')](_0x5adb('0x2c'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x51')]);router['post']('/:id/openchannel_accounts',auth[_0x5adb('0x7')](),controller[_0x5adb('0x52')]);router[_0x5adb('0x37')](_0x5adb('0x2f'),auth['isAuthenticated'](),controller['addSmsAccounts']);router[_0x5adb('0x37')](_0x5adb('0x31'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x53')]);router[_0x5adb('0x37')]('/:id/square_projects',auth[_0x5adb('0x7')](),controller[_0x5adb('0x54')]);router['post'](_0x5adb('0x55'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x56')]);router[_0x5adb('0x57')](_0x5adb('0xe'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x58')]);router[_0x5adb('0x57')]('/:id/password',auth[_0x5adb('0x7')](),controller['changePassword']);router['delete']('/:id/queues',auth[_0x5adb('0x7')](),controller[_0x5adb('0x59')]);router[_0x5adb('0x5a')]('/:id/teams',auth[_0x5adb('0x7')](),controller['removeTeams']);router[_0x5adb('0x5a')](_0x5adb('0xe'),auth[_0x5adb('0x7')](),controller['destroy']);router[_0x5adb('0x5a')]('/:id/chat_interactions',auth[_0x5adb('0x7')](),controller[_0x5adb('0x5b')]);router['delete'](_0x5adb('0x5c'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x5d')]);router[_0x5adb('0x5a')](_0x5adb('0x4b'),auth['isAuthenticated'](),controller[_0x5adb('0x5e')]);router[_0x5adb('0x5a')](_0x5adb('0x4d'),auth[_0x5adb('0x7')](),controller['removeSmsInteractions']);router[_0x5adb('0x5a')](_0x5adb('0x5f'),auth[_0x5adb('0x7')](),controller['removeOpenchannelInteractions']);router[_0x5adb('0x5a')](_0x5adb('0x2b'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x60')]);router['delete'](_0x5adb('0x2c'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x61')]);router[_0x5adb('0x5a')](_0x5adb('0x2e'),auth['isAuthenticated'](),controller[_0x5adb('0x62')]);router['delete'](_0x5adb('0x2f'),auth['isAuthenticated'](),controller[_0x5adb('0x63')]);router[_0x5adb('0x5a')](_0x5adb('0x31'),auth[_0x5adb('0x7')](),controller['removeChatWebsites']);router[_0x5adb('0x5a')](_0x5adb('0x33'),auth[_0x5adb('0x7')](),controller['removeSquareProjects']);router['delete']('/:id/api_key',auth[_0x5adb('0x7')](),controller[_0x5adb('0x64')]);module[_0x5adb('0x65')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 9b8b3cd..a3e6b66 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 _0xa9e0=['\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate','passive','update,nonat','showWebBar','get','wss','force_avp','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','encryption','icesupport','actpass','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','sequelize','moment','util','STRING','setDataValue','name','defaultuser','callerid','getDataValue','internal','email','admin','user','agent','telephone','INTEGER','format','fullname','BOOLEAN','DATE','DEFAULT\x20PAUSE','ENUM','peer','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','join','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','update','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never'];(function(_0x128b42,_0x49d070){var _0x47d363=function(_0x4570b9){while(--_0x4570b9){_0x128b42['push'](_0x128b42['shift']());}};_0x47d363(++_0x49d070);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x333808){this[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x333808);this[_0x0a9e('0x4')](_0x0a9e('0x6'),_0x333808);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'set':function(_0x441e3a){this[_0x0a9e('0x4')]('fullname',_0x441e3a);this['setDataValue'](_0x0a9e('0x7'),util['format']('\x22%s\x22\x20<%s>',_0x441e3a,this[_0x0a9e('0x8')](_0x0a9e('0x9'))));}},'alias':{'type':Sequelize[_0x0a9e('0x3')]},'email':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':_0x0a9e('0xa'),'validate':{'isEmail':!![]},'set':function(_0xbd1168){if(_0xbd1168){this['setDataValue']('email',_0xbd1168['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe')),'allowNull':![]},'password':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':![],'unique':_0x0a9e('0x9'),'set':function(_0x2b4227){this[_0x0a9e('0x4')](_0x0a9e('0x9'),_0x2b4227);this[_0x0a9e('0x4')]('accountcode',_0x2b4227);this[_0x0a9e('0x4')]('callerid',util[_0x0a9e('0x10')]('\x22%s\x22\x20<%s>',this[_0x0a9e('0x8')](_0x0a9e('0x11')),_0x2b4227));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x0a9e('0x3')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x0a9e('0x3')]},'zipcode':{'type':Sequelize[_0x0a9e('0x3')]},'userpic':{'type':Sequelize[_0x0a9e('0x3')]},'city':{'type':Sequelize[_0x0a9e('0x3')]},'country':{'type':Sequelize[_0x0a9e('0x3')]},'online':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x0a9e('0x13')]},'voicePause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':_0x0a9e('0x14')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x0a9e('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'description':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x0a9e('0xf')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x0a9e('0x15')]('friend',_0x0a9e('0xc'),_0x0a9e('0x16')),'allowNull':!![],'defaultValue':_0x0a9e('0x17')},'context':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x18')},'callingpres':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x19'),_0x0a9e('0x1a'),'ALLOWED_FAILED_SCREEN',_0x0a9e('0x1b'),_0x0a9e('0x1c'),_0x0a9e('0x1d'),_0x0a9e('0x1e'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x1f'),'set':function(_0x2e8759){this[_0x0a9e('0x4')]('transport',_0x2e8759?_0x2e8759[_0x0a9e('0x20')](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x21'))?this[_0x0a9e('0x8')](_0x0a9e('0x21'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x23')},'dtmfmode':{'type':Sequelize['ENUM'](_0x0a9e('0x24'),_0x0a9e('0x25'),_0x0a9e('0x26'),_0x0a9e('0x27'),_0x0a9e('0x28')),'allowNull':!![],'defaultValue':_0x0a9e('0x24')},'directmedia':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no','nonat',_0x0a9e('0x2a'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x0a9e('0x2b'),'set':function(_0xd1836d){this[_0x0a9e('0x4')](_0x0a9e('0x2c'),_0xd1836d?_0xd1836d['join'](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x2c'))?this['getDataValue'](_0x0a9e('0x2c'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x2d')},'callgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'language':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':_0x0a9e('0x2e')},'allow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x546ef8){this[_0x0a9e('0x4')](_0x0a9e('0x2f'),_0x546ef8?_0x546ef8['join'](';'):_0x0a9e('0x30'));},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x2f'))?this[_0x0a9e('0x8')]('allow')['split'](';'):null;},'comment':_0x0a9e('0x31')},'autoframing':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'set':function(_0x1dec2e){this[_0x0a9e('0x4')]('insecure',_0x1dec2e?_0x1dec2e[_0x0a9e('0x20')](','):null);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x32'))?this[_0x0a9e('0x8')](_0x0a9e('0x32'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x33')},'trustrpid':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no',_0x0a9e('0x34')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x35')},'amaflags':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x29')},'busylevel':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x0a9e('0x15')]('yes','no',_0x0a9e('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x0a9e('0x37'),_0x0a9e('0x38'),_0x0a9e('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x3a'),'uas'),'allowNull':!![],'defaultValue':_0x0a9e('0x3b')},'t38pt_usertpsource':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x29')},'keepalive':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no',_0x0a9e('0x3c'),_0x0a9e('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x0a9e('0x15')]('active',_0x0a9e('0x3e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no','nonat',_0x0a9e('0x2a'),_0x0a9e('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x0a9e('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x0a9e('0x13')]},'showWebBar':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0,'set':function(_0x5d86e9){this[_0x0a9e('0x4')](_0x0a9e('0x40'),_0x5d86e9);var _0x5239ef=this[_0x0a9e('0x41')]({'plain':!![]});switch(_0x5d86e9){case 0x0:case 0x1:var _0x5cc8fb=_0x5239ef[_0x0a9e('0x21')]?_['isArray'](_0x5239ef['transport'])?_0x5239ef['transport'][_0x0a9e('0x20')]():_0x5239ef['transport']:_0x0a9e('0x1f');if(_0x5cc8fb===_0x0a9e('0x42')){_0x5cc8fb=_0x0a9e('0x1f');}this[_0x0a9e('0x4')](_0x0a9e('0x21'),_0x5cc8fb);this[_0x0a9e('0x4')]('encryption','no');this[_0x0a9e('0x4')]('avpf',null);this[_0x0a9e('0x4')](_0x0a9e('0x43'),null);this[_0x0a9e('0x4')]('icesupport',null);this[_0x0a9e('0x4')](_0x0a9e('0x44'),null);this[_0x0a9e('0x4')](_0x0a9e('0x45'),null);this['setDataValue'](_0x0a9e('0x46'),null);this[_0x0a9e('0x4')]('dtlscertfile',null);this[_0x0a9e('0x4')](_0x0a9e('0x47'),null);this[_0x0a9e('0x4')](_0x0a9e('0x48'),'no');break;case 0x2:this[_0x0a9e('0x4')]('transport',_0x0a9e('0x42'));this[_0x0a9e('0x4')](_0x0a9e('0x49'),'yes');this[_0x0a9e('0x4')]('avpf','yes');this[_0x0a9e('0x4')](_0x0a9e('0x43'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x4a'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x44'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x45'),'no');this[_0x0a9e('0x4')](_0x0a9e('0x46'),_0x0a9e('0x4b'));this[_0x0a9e('0x4')](_0x0a9e('0x4c'),_0x5239ef[_0x0a9e('0x4c')]||_0x0a9e('0x4d'));this['setDataValue'](_0x0a9e('0x47'),_0x5239ef[_0x0a9e('0x47')]||_0x0a9e('0x4e'));this['setDataValue'](_0x0a9e('0x48'),_0x0a9e('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x83f0b2){this[_0x0a9e('0x4')](_0x0a9e('0x4f'),_0x83f0b2?_0x83f0b2[_0x0a9e('0x20')](','):[]);},'get':function(){return this[_0x0a9e('0x8')]('permissions')?_['map'](this['getDataValue'](_0x0a9e('0x4f'))[_0x0a9e('0x22')](','),function(_0x1104ad){return parseInt(_0x1104ad,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x0a9e('0x3')]},'passwordResetAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x50'))?this[_0x0a9e('0x8')](_0x0a9e('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'interface':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0x30a4c7){if(typeof _0x30a4c7===_0x0a9e('0x51')){var _0x332367=_0x30a4c7==='1'?!![]:_0x30a4c7==='0'?![]:_0x30a4c7===_0x0a9e('0x52')?!![]:_0x30a4c7===_0x0a9e('0x53')?![]:![];this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0x332367);}else{this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0x30a4c7);}}},'blocked':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0x25744a){this[_0x0a9e('0x4')]('blocked',_0x25744a);if(_0x25744a===!![]){this[_0x0a9e('0x4')](_0x0a9e('0x55'),moment());this[_0x0a9e('0x4')]('loginAttempts',0x0);}else{this[_0x0a9e('0x4')](_0x0a9e('0x55'),null);}}},'blockedAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xa9e0=['\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate','passive','update,nonat','showWebBar','get','wss','force_avp','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','encryption','icesupport','actpass','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','sequelize','moment','util','STRING','setDataValue','name','defaultuser','callerid','getDataValue','internal','email','admin','user','agent','telephone','INTEGER','format','fullname','BOOLEAN','DATE','DEFAULT\x20PAUSE','ENUM','peer','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','join','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','update','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never'];(function(_0x402dbb,_0x22a80f){var _0x69b4b=function(_0x21ab1b){while(--_0x21ab1b){_0x402dbb['push'](_0x402dbb['shift']());}};_0x69b4b(++_0x22a80f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x333808){this[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x333808);this[_0x0a9e('0x4')](_0x0a9e('0x6'),_0x333808);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'set':function(_0x441e3a){this[_0x0a9e('0x4')]('fullname',_0x441e3a);this['setDataValue'](_0x0a9e('0x7'),util['format']('\x22%s\x22\x20<%s>',_0x441e3a,this[_0x0a9e('0x8')](_0x0a9e('0x9'))));}},'alias':{'type':Sequelize[_0x0a9e('0x3')]},'email':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':_0x0a9e('0xa'),'validate':{'isEmail':!![]},'set':function(_0xbd1168){if(_0xbd1168){this['setDataValue']('email',_0xbd1168['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe')),'allowNull':![]},'password':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':![],'unique':_0x0a9e('0x9'),'set':function(_0x2b4227){this[_0x0a9e('0x4')](_0x0a9e('0x9'),_0x2b4227);this[_0x0a9e('0x4')]('accountcode',_0x2b4227);this[_0x0a9e('0x4')]('callerid',util[_0x0a9e('0x10')]('\x22%s\x22\x20<%s>',this[_0x0a9e('0x8')](_0x0a9e('0x11')),_0x2b4227));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x0a9e('0x3')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x0a9e('0x3')]},'zipcode':{'type':Sequelize[_0x0a9e('0x3')]},'userpic':{'type':Sequelize[_0x0a9e('0x3')]},'city':{'type':Sequelize[_0x0a9e('0x3')]},'country':{'type':Sequelize[_0x0a9e('0x3')]},'online':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x0a9e('0x13')]},'voicePause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':_0x0a9e('0x14')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x0a9e('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'description':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x0a9e('0xf')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x0a9e('0x15')]('friend',_0x0a9e('0xc'),_0x0a9e('0x16')),'allowNull':!![],'defaultValue':_0x0a9e('0x17')},'context':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x18')},'callingpres':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x19'),_0x0a9e('0x1a'),'ALLOWED_FAILED_SCREEN',_0x0a9e('0x1b'),_0x0a9e('0x1c'),_0x0a9e('0x1d'),_0x0a9e('0x1e'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x1f'),'set':function(_0x2e8759){this[_0x0a9e('0x4')]('transport',_0x2e8759?_0x2e8759[_0x0a9e('0x20')](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x21'))?this[_0x0a9e('0x8')](_0x0a9e('0x21'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x23')},'dtmfmode':{'type':Sequelize['ENUM'](_0x0a9e('0x24'),_0x0a9e('0x25'),_0x0a9e('0x26'),_0x0a9e('0x27'),_0x0a9e('0x28')),'allowNull':!![],'defaultValue':_0x0a9e('0x24')},'directmedia':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no','nonat',_0x0a9e('0x2a'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x0a9e('0x2b'),'set':function(_0xd1836d){this[_0x0a9e('0x4')](_0x0a9e('0x2c'),_0xd1836d?_0xd1836d['join'](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x2c'))?this['getDataValue'](_0x0a9e('0x2c'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x2d')},'callgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'language':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':_0x0a9e('0x2e')},'allow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x546ef8){this[_0x0a9e('0x4')](_0x0a9e('0x2f'),_0x546ef8?_0x546ef8['join'](';'):_0x0a9e('0x30'));},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x2f'))?this[_0x0a9e('0x8')]('allow')['split'](';'):null;},'comment':_0x0a9e('0x31')},'autoframing':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'set':function(_0x1dec2e){this[_0x0a9e('0x4')]('insecure',_0x1dec2e?_0x1dec2e[_0x0a9e('0x20')](','):null);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x32'))?this[_0x0a9e('0x8')](_0x0a9e('0x32'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x33')},'trustrpid':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no',_0x0a9e('0x34')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x35')},'amaflags':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x29')},'busylevel':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x0a9e('0x15')]('yes','no',_0x0a9e('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x0a9e('0x37'),_0x0a9e('0x38'),_0x0a9e('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x3a'),'uas'),'allowNull':!![],'defaultValue':_0x0a9e('0x3b')},'t38pt_usertpsource':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x29')},'keepalive':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no',_0x0a9e('0x3c'),_0x0a9e('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x0a9e('0x15')]('active',_0x0a9e('0x3e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no','nonat',_0x0a9e('0x2a'),_0x0a9e('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x0a9e('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x0a9e('0x13')]},'showWebBar':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0,'set':function(_0x5d86e9){this[_0x0a9e('0x4')](_0x0a9e('0x40'),_0x5d86e9);var _0x5239ef=this[_0x0a9e('0x41')]({'plain':!![]});switch(_0x5d86e9){case 0x0:case 0x1:var _0x5cc8fb=_0x5239ef[_0x0a9e('0x21')]?_['isArray'](_0x5239ef['transport'])?_0x5239ef['transport'][_0x0a9e('0x20')]():_0x5239ef['transport']:_0x0a9e('0x1f');if(_0x5cc8fb===_0x0a9e('0x42')){_0x5cc8fb=_0x0a9e('0x1f');}this[_0x0a9e('0x4')](_0x0a9e('0x21'),_0x5cc8fb);this[_0x0a9e('0x4')]('encryption','no');this[_0x0a9e('0x4')]('avpf',null);this[_0x0a9e('0x4')](_0x0a9e('0x43'),null);this[_0x0a9e('0x4')]('icesupport',null);this[_0x0a9e('0x4')](_0x0a9e('0x44'),null);this[_0x0a9e('0x4')](_0x0a9e('0x45'),null);this['setDataValue'](_0x0a9e('0x46'),null);this[_0x0a9e('0x4')]('dtlscertfile',null);this[_0x0a9e('0x4')](_0x0a9e('0x47'),null);this[_0x0a9e('0x4')](_0x0a9e('0x48'),'no');break;case 0x2:this[_0x0a9e('0x4')]('transport',_0x0a9e('0x42'));this[_0x0a9e('0x4')](_0x0a9e('0x49'),'yes');this[_0x0a9e('0x4')]('avpf','yes');this[_0x0a9e('0x4')](_0x0a9e('0x43'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x4a'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x44'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x45'),'no');this[_0x0a9e('0x4')](_0x0a9e('0x46'),_0x0a9e('0x4b'));this[_0x0a9e('0x4')](_0x0a9e('0x4c'),_0x5239ef[_0x0a9e('0x4c')]||_0x0a9e('0x4d'));this['setDataValue'](_0x0a9e('0x47'),_0x5239ef[_0x0a9e('0x47')]||_0x0a9e('0x4e'));this['setDataValue'](_0x0a9e('0x48'),_0x0a9e('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x83f0b2){this[_0x0a9e('0x4')](_0x0a9e('0x4f'),_0x83f0b2?_0x83f0b2[_0x0a9e('0x20')](','):[]);},'get':function(){return this[_0x0a9e('0x8')]('permissions')?_['map'](this['getDataValue'](_0x0a9e('0x4f'))[_0x0a9e('0x22')](','),function(_0x1104ad){return parseInt(_0x1104ad,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x0a9e('0x3')]},'passwordResetAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x50'))?this[_0x0a9e('0x8')](_0x0a9e('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'interface':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0x30a4c7){if(typeof _0x30a4c7===_0x0a9e('0x51')){var _0x332367=_0x30a4c7==='1'?!![]:_0x30a4c7==='0'?![]:_0x30a4c7===_0x0a9e('0x52')?!![]:_0x30a4c7===_0x0a9e('0x53')?![]:![];this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0x332367);}else{this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0x30a4c7);}}},'blocked':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0x25744a){this[_0x0a9e('0x4')]('blocked',_0x25744a);if(_0x25744a===!![]){this[_0x0a9e('0x4')](_0x0a9e('0x55'),moment());this[_0x0a9e('0x4')]('loginAttempts',0x0);}else{this[_0x0a9e('0x4')](_0x0a9e('0x55'),null);}}},'blockedAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index d5e9a5f..9520e80 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 _0xdbb9=['bulkCreate','body','find','describe','addContacts','ids','omit','agent\x20role','admin','../../config/license/util','getLicense','telephones','users','isNil','License\x20limit\x20reached','format','count\x20%s:\x20%s','create','Setting','securePassword','min_internal','max','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','from','voicemail','mailbox','VoiceMail','fullname','permissions','101','102','103','110','105','106','108','109','111','Unable\x20to\x20retrieve\x20the\x20current\x20user','Telephones','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','changePassword','findOne','newPassword','Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword','authenticate','oldPassword','Wrong\x20credentials','Invalid\x20body\x20format.\x20Use\x20newPassword','Unauthorized','channel','loginInPause','capitalize','toLowerCase','Queues','penalty','QueueId','emit','Queue:save','voice','findAll','online','push','interface','voicePause','UserVoiceQueueRt','upsert','removeQueues','isValidChannel','Unknown\x20channel','remove','addAvatar','userpic','filename','getAvatar','root','server/files/images/logos/default_profile.png','download','existsSync','join','server/files/images/','CmContact','getContacts','CmList','List','Tag','Tags','color','tag','hasOwnProperty','getQueues','Queue','Unknown\x20role','getVoiceQueuesRt','getGroups','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','SIP/%s','x-forwarded-for','connection','socket','remoteAddress','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','forEach','YYYY-MM-DD\x20HH:mm:ss','all','getChannels','LOGIN','LOGININPAUSE','MemberReport','concat','logout','pause','QueuePause','PAUSE','updateAttributes','DEFAULT\x20PAUSE','unpause','openchannelPause','smsPause','pauseType','lastPauseAt','manual','mail','chat','fax','openchannel','%s%s','getTeams','Team','addTeams','setDataValue','Voice','getChatQueues','Chat','Mail','getSmsQueues','Sms','getFaxQueues','Openchannel','flatten','transaction','addAgent','each','getDataValue','removeTeams','Fax','getOpenchannelQueues','removeAgent','Queue:remove','getLists','getAgents','values','addChatInteractions','spread','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','removeMailInteractions','isArray','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','getVoicePrefixes','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','CmHopper','$and','$or','$lt','$ne','$eq','$not','$between','$in','$notIn','$like','$iLike','$overlap','$contains','$contained','$any','firstName','Contact','VoiceQueue','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','nonce','apiKeyIat','API\x20key\x20not\x20available','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','whoami','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./user.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','User,\x20%s,\x20%s','debug','User,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','info','result','catch','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Users','user','Agents','agent','telephone','filter','map','value','includes','role','name','UserProfileResource','stack','send','index','User','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','sequelize','lower','col','count','includeAll','include','rows','show','params','differenceBy','password','salt','options'];(function(_0x7798eb,_0xf8e527){var _0x1f46f7=function(_0x1d228c){while(--_0x1d228c){_0x7798eb['push'](_0x7798eb['shift']());}};_0x1f46f7(++_0xf8e527);}(_0xdbb9,0xf9));var _0x9dbb=function(_0x183d91,_0x5e2a52){_0x183d91=_0x183d91-0x0;var _0x2504c0=_0xdbb9[_0x183d91];return _0x2504c0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9dbb('0x0'));var rimraf=require(_0x9dbb('0x1'));var zipdir=require(_0x9dbb('0x2'));var jsonpatch=require(_0x9dbb('0x3'));var rp=require('request-promise');var moment=require(_0x9dbb('0x4'));var BPromise=require(_0x9dbb('0x5'));var Mustache=require(_0x9dbb('0x6'));var util=require(_0x9dbb('0x7'));var path=require(_0x9dbb('0x8'));var sox=require(_0x9dbb('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x9dbb('0xa'));var crypto=require(_0x9dbb('0xb'));var jsforce=require(_0x9dbb('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9dbb('0xd'));var Papa=require(_0x9dbb('0xe'));var Redis=require(_0x9dbb('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9dbb('0x10'));var as=require(_0x9dbb('0x11'));var hardwareService=require(_0x9dbb('0x12'));var logger=require(_0x9dbb('0x13'))('api');var utils=require(_0x9dbb('0x14'));var config=require(_0x9dbb('0x15'));var db=require(_0x9dbb('0x16'))['db'];config[_0x9dbb('0x17')]=_[_0x9dbb('0x18')](config[_0x9dbb('0x17')],{'host':_0x9dbb('0x19'),'port':0x18eb});var socket=require(_0x9dbb('0x1a'))(new Redis(config[_0x9dbb('0x17')]));require(_0x9dbb('0x1b'))[_0x9dbb('0x1c')](socket);var jayson=require(_0x9dbb('0x1d'));var client=jayson[_0x9dbb('0x1e')][_0x9dbb('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x45f944,_0x464df5,_0x528110){if(_0x528110){var _0x1366b2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1366b2[_0x9dbb('0x20')](_0x464df5)){return _0x45f944;}else{throw new db[(_0x9dbb('0x21'))][(_0x9dbb('0x22'))](_0x9dbb('0x23'));}}else{return _0x45f944;}}function respondWithRpcPromise(_0x56f899,_0x382d61,_0x21af5a,_0x2383cf){return new BPromise(function(_0x20fb99,_0x45c6f5){var _0x54414d=_0x2383cf||client;return _0x54414d[_0x9dbb('0x24')](_0x56f899,_0x21af5a)['then'](function(_0x3de435){logger['info'](_0x9dbb('0x25'),_0x382d61,'request\x20sent');logger[_0x9dbb('0x26')](_0x9dbb('0x27'),_0x382d61,_0x9dbb('0x28'),JSON['stringify'](_0x3de435));if(_0x3de435['error']){if(_0x3de435['error'][_0x9dbb('0x29')]===0x1f4){logger[_0x9dbb('0x2a')]('User,\x20%s,\x20%s',_0x382d61,_0x3de435['error']['message']);return _0x45c6f5(_0x3de435[_0x9dbb('0x2a')][_0x9dbb('0x2b')]);}logger[_0x9dbb('0x2a')]('User,\x20%s,\x20%s',_0x382d61,_0x3de435[_0x9dbb('0x2a')][_0x9dbb('0x2b')]);return _0x20fb99(_0x3de435[_0x9dbb('0x2a')][_0x9dbb('0x2b')]);}else{logger[_0x9dbb('0x2c')](_0x9dbb('0x25'),_0x382d61,_0x9dbb('0x28'));_0x20fb99(_0x3de435[_0x9dbb('0x2d')][_0x9dbb('0x2b')]);}})[_0x9dbb('0x2e')](function(_0x25614a){logger[_0x9dbb('0x2a')]('User,\x20%s,\x20%s',_0x382d61,_0x25614a);_0x45c6f5(_0x25614a);});});}function respondWithStatusCode(_0x1c7077,_0x5aead8){_0x5aead8=_0x5aead8||0xcc;return function(_0x38c36d){if(_0x38c36d){return _0x1c7077[_0x9dbb('0x2f')](_0x5aead8);}return _0x1c7077['status'](_0x5aead8)[_0x9dbb('0x30')]();};}function respondWithResult(_0x4ebd57,_0x4b5ce1){_0x4b5ce1=_0x4b5ce1||0xc8;return function(_0x589f63){if(_0x589f63){return _0x4ebd57[_0x9dbb('0x31')](_0x4b5ce1)[_0x9dbb('0x32')](_0x589f63);}};}function respondWithFilteredResult(_0x491324,_0xec0c4a){return function(_0x2a82f0){if(_0x2a82f0){var _0x57e6e7=_0x2a82f0['count'],_0x71692a=_0xec0c4a[_0x9dbb('0x33')],_0xd4d388=_0xec0c4a['offset']+_0xec0c4a[_0x9dbb('0x34')],_0x3a8f61;if(_0xd4d388>=_0x57e6e7){_0xd4d388=_0x57e6e7;_0x3a8f61=0xc8;}else{_0x3a8f61=0xce;}_0x491324[_0x9dbb('0x31')](_0x3a8f61);return _0x491324[_0x9dbb('0x35')](_0x9dbb('0x36'),_0x71692a+'-'+_0xd4d388+'/'+_0x57e6e7)[_0x9dbb('0x32')](_0x2a82f0);}return null;};}function patchUpdates(_0x4016dd){return function(_0x30e1cb){try{jsonpatch[_0x9dbb('0x37')](_0x30e1cb,_0x4016dd,!![]);}catch(_0x384cdc){return BPromise[_0x9dbb('0x38')](_0x384cdc);}return _0x30e1cb[_0x9dbb('0x39')]();};}function saveUpdates(_0x55f2cc,_0x442a8b){return function(_0x9df81c){if(_0x9df81c){return _0x9df81c[_0x9dbb('0x3a')](_0x55f2cc)[_0x9dbb('0x3b')](function(_0x3ecf3e){return _0x3ecf3e;});}return null;};}function removeEntity(_0x3fe802,_0x132ec7){return function(_0x3e44ab){if(_0x3e44ab){return _0x3e44ab[_0x9dbb('0x3c')]()[_0x9dbb('0x3b')](function(){var _0x228f41=_0x3e44ab[_0x9dbb('0x3d')]({'plain':!![]});var _0x3cb034=[{'name':_0x9dbb('0x3e'),'value':_0x9dbb('0x3f'),'ignore':!![]},{'name':_0x9dbb('0x40'),'value':_0x9dbb('0x41'),'ignore':![]},{'name':'Telephones','value':_0x9dbb('0x42'),'ignore':![]}];var _0x315755=_(_0x3cb034)[_0x9dbb('0x43')]('ignore')[_0x9dbb('0x44')](_0x9dbb('0x45'))[_0x9dbb('0x45')]();if(_[_0x9dbb('0x46')](_0x315755,_0x228f41[_0x9dbb('0x47')])){return;}var _0x3f9a15=_['find'](_0x3cb034,[_0x9dbb('0x45'),_0x228f41['role']])[_0x9dbb('0x48')];return db[_0x9dbb('0x49')][_0x9dbb('0x3c')]({'where':{'type':_0x3f9a15,'resourceId':_0x228f41['id']}})[_0x9dbb('0x3b')](function(){return _0x3e44ab;});})['then'](function(){_0x3fe802[_0x9dbb('0x31')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29ccd0,_0x5c72aa){return function(_0x24320c){if(!_0x24320c){_0x29ccd0[_0x9dbb('0x2f')](0x194);}return _0x24320c;};}function handleError(_0x34524e,_0x377db5){_0x377db5=_0x377db5||0x1f4;return function(_0x2e9a6e){logger['error'](_0x2e9a6e[_0x9dbb('0x4a')]);if(_0x2e9a6e['name']){delete _0x2e9a6e[_0x9dbb('0x48')];}_0x34524e[_0x9dbb('0x31')](_0x377db5)[_0x9dbb('0x4b')](_0x2e9a6e);};}exports[_0x9dbb('0x4c')]=function(_0x1e98aa,_0x232b7b){var _0x6682aa={},_0x49e63f={},_0x20b93b={'count':0x0,'rows':[]};var _0x4d3744=_[_0x9dbb('0x44')](db[_0x9dbb('0x4d')][_0x9dbb('0x4e')],function(_0x104ec5){return{'name':_0x104ec5['fieldName'],'type':_0x104ec5[_0x9dbb('0x4f')]['key']};});_0x49e63f[_0x9dbb('0x50')]=_['differenceBy'](_[_0x9dbb('0x44')](_0x4d3744,_0x9dbb('0x48')),['password','salt']);_0x49e63f[_0x9dbb('0x51')]=_[_0x9dbb('0x52')](_0x1e98aa[_0x9dbb('0x51')]);_0x49e63f[_0x9dbb('0x53')]=_[_0x9dbb('0x54')](_0x49e63f[_0x9dbb('0x50')],_0x49e63f[_0x9dbb('0x51')]);_0x6682aa[_0x9dbb('0x55')]=_[_0x9dbb('0x54')](_0x49e63f['model'],qs[_0x9dbb('0x56')](_0x1e98aa['query'][_0x9dbb('0x56')]));_0x6682aa[_0x9dbb('0x55')]=_0x6682aa[_0x9dbb('0x55')][_0x9dbb('0x57')]?_0x6682aa['attributes']:_0x49e63f[_0x9dbb('0x50')];if(!_0x1e98aa['query']['hasOwnProperty'](_0x9dbb('0x58'))){_0x6682aa[_0x9dbb('0x34')]=qs[_0x9dbb('0x34')](_0x1e98aa[_0x9dbb('0x51')][_0x9dbb('0x34')]);_0x6682aa[_0x9dbb('0x33')]=qs['offset'](_0x1e98aa[_0x9dbb('0x51')]['offset']);}_0x6682aa[_0x9dbb('0x59')]=qs[_0x9dbb('0x5a')](_0x1e98aa[_0x9dbb('0x51')][_0x9dbb('0x5a')]);_0x6682aa[_0x9dbb('0x5b')]=qs[_0x9dbb('0x53')](_[_0x9dbb('0x5c')](_0x1e98aa[_0x9dbb('0x51')],_0x49e63f['filters']));if(_0x1e98aa[_0x9dbb('0x51')]['filter']){_0x6682aa[_0x9dbb('0x5b')]=_[_0x9dbb('0x5d')](_0x6682aa['where'],{'$or':_[_0x9dbb('0x44')](_0x4d3744,function(_0x57b9f6){if(_0x57b9f6['type']!=='VIRTUAL'){return db[_0x9dbb('0x5e')][_0x9dbb('0x5b')](db['sequelize']['fn'](_0x9dbb('0x5f'),db['sequelize'][_0x9dbb('0x60')](_0x57b9f6[_0x9dbb('0x48')])),{'$like':db[_0x9dbb('0x5e')]['fn'](_0x9dbb('0x5f'),'%'+_0x1e98aa[_0x9dbb('0x51')][_0x9dbb('0x43')]+'%')});}})});}_0x6682aa=_['merge']({},_0x6682aa,_0x1e98aa['options']);var _0x18113={'where':_0x6682aa[_0x9dbb('0x5b')]};return db['User'][_0x9dbb('0x61')](_0x18113)[_0x9dbb('0x3b')](function(_0x19cb4b){_0x20b93b[_0x9dbb('0x61')]=_0x19cb4b;if(_0x1e98aa['query'][_0x9dbb('0x62')]){_0x6682aa[_0x9dbb('0x63')]=[{'all':!![]}];}return db[_0x9dbb('0x4d')]['findAll'](_0x6682aa);})['then'](function(_0x58760d){_0x20b93b[_0x9dbb('0x64')]=_0x58760d;return _0x20b93b;})[_0x9dbb('0x3b')](respondWithFilteredResult(_0x232b7b,_0x6682aa))[_0x9dbb('0x2e')](handleError(_0x232b7b,null));};exports[_0x9dbb('0x65')]=function(_0x46c48d,_0x141ecb){var _0x1c32c4={'raw':![],'where':{'id':_0x46c48d[_0x9dbb('0x66')]['id']}},_0x2189a1={};_0x2189a1[_0x9dbb('0x50')]=_[_0x9dbb('0x67')](_[_0x9dbb('0x52')](db[_0x9dbb('0x4d')]['rawAttributes']),[_0x9dbb('0x68'),_0x9dbb('0x69')]);_0x2189a1[_0x9dbb('0x51')]=_[_0x9dbb('0x52')](_0x46c48d['query']);_0x2189a1[_0x9dbb('0x53')]=_[_0x9dbb('0x54')](_0x2189a1[_0x9dbb('0x50')],_0x2189a1['query']);_0x1c32c4[_0x9dbb('0x55')]=_[_0x9dbb('0x54')](_0x2189a1[_0x9dbb('0x50')],qs[_0x9dbb('0x56')](_0x46c48d['query'][_0x9dbb('0x56')]));_0x1c32c4[_0x9dbb('0x55')]=_0x1c32c4[_0x9dbb('0x55')][_0x9dbb('0x57')]?_0x1c32c4[_0x9dbb('0x55')]:_0x2189a1['model'];if(_0x46c48d['query']['includeAll']){_0x1c32c4[_0x9dbb('0x63')]=[{'all':!![]}];}_0x1c32c4=_[_0x9dbb('0x5d')]({},_0x1c32c4,_0x46c48d[_0x9dbb('0x6a')]);return db[_0x9dbb('0x4d')]['find'](_0x1c32c4)[_0x9dbb('0x3b')](handleEntityNotFound(_0x141ecb,null))[_0x9dbb('0x3b')](respondWithResult(_0x141ecb,null))[_0x9dbb('0x2e')](handleError(_0x141ecb,null));};exports[_0x9dbb('0x6b')]=function(_0x5191c4,_0x3b470b){return db[_0x9dbb('0x4d')][_0x9dbb('0x6b')](_0x5191c4[_0x9dbb('0x6c')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x3b470b,0xc9))[_0x9dbb('0x2e')](handleError(_0x3b470b,null));};exports[_0x9dbb('0x3a')]=function(_0x1d1dc2,_0x53e40d){if(_0x1d1dc2[_0x9dbb('0x6c')]['id']){delete _0x1d1dc2[_0x9dbb('0x6c')]['id'];}delete _0x1d1dc2[_0x9dbb('0x6c')][_0x9dbb('0x47')];return db[_0x9dbb('0x4d')][_0x9dbb('0x6d')]({'where':{'id':_0x1d1dc2['params']['id']}})[_0x9dbb('0x3b')](handleEntityNotFound(_0x53e40d,null))[_0x9dbb('0x3b')](saveUpdates(_0x1d1dc2['body'],null))[_0x9dbb('0x3b')](respondWithResult(_0x53e40d,null))[_0x9dbb('0x2e')](handleError(_0x53e40d,null));};exports[_0x9dbb('0x6e')]=function(_0x5543e1,_0x3febcd){return db[_0x9dbb('0x4d')][_0x9dbb('0x6e')]()[_0x9dbb('0x3b')](respondWithResult(_0x3febcd,null))['catch'](handleError(_0x3febcd,null));};exports[_0x9dbb('0x6f')]=function(_0x2f0b12,_0x3b46b9,_0x2546f0){return db['User'][_0x9dbb('0x6d')]({'where':{'id':_0x2f0b12[_0x9dbb('0x66')]['id']}})[_0x9dbb('0x3b')](handleEntityNotFound(_0x3b46b9,null))[_0x9dbb('0x3b')](function(_0x1a8444){if(_0x1a8444){return _0x1a8444['addContacts'](_0x2f0b12[_0x9dbb('0x6c')][_0x9dbb('0x70')],_[_0x9dbb('0x71')](_0x2f0b12[_0x9dbb('0x6c')],[_0x9dbb('0x70'),'id'])||{});}})[_0x9dbb('0x3b')](respondWithResult(_0x3b46b9,null))[_0x9dbb('0x2e')](handleError(_0x3b46b9,null));};var getLicense=function(_0x346f9d){return new BPromise(function(_0x236b5d,_0x577364){var _0x165cef=0x0;_0x346f9d[_0x9dbb('0x6c')]['role']===_0x9dbb('0x41')&&_0x236b5d(_0x9dbb('0x72'));return db['User'][_0x9dbb('0x61')]({'where':{'$or':[{'role':_0x346f9d['body'][_0x9dbb('0x47')]===_0x9dbb('0x42')?_0x9dbb('0x42'):[_0x9dbb('0x73'),'user']}]}})['then'](function(_0x1a362f){_0x165cef=_0x1a362f;return require(_0x9dbb('0x74'))[_0x9dbb('0x75')]();})['then'](function(_0x179fb6){var _0xcc9882=_0x346f9d[_0x9dbb('0x6c')][_0x9dbb('0x47')]===_0x9dbb('0x42')?_0x9dbb('0x76'):_0x9dbb('0x77');if(!_[_0x9dbb('0x78')](_0x179fb6[_0xcc9882])&&_0x165cef>=_0x179fb6[_0xcc9882]){return _0x577364({'message':_0x9dbb('0x79')});}return _0x236b5d(util[_0x9dbb('0x7a')](_0x9dbb('0x7b'),_0xcc9882,_0x165cef));})['catch'](function(_0x56e42b){return _0x577364(_0x56e42b);});});};exports[_0x9dbb('0x7c')]=function(_0xb29592,_0x1aa154){return getLicense(_0xb29592)[_0x9dbb('0x3b')](function(_0x19f72a){if(!_0xb29592[_0x9dbb('0x6c')]['internal']){var _0x286e17;return db[_0x9dbb('0x7d')]['findById'](0x1)['then'](function(_0x5026d2){return checkPasswordPattern(_0x5026d2,_0xb29592[_0x9dbb('0x6c')][_0x9dbb('0x68')],_0x5026d2[_0x9dbb('0x7e')]);})[_0x9dbb('0x3b')](function(_0x2daf86){_0x286e17=_0x2daf86[_0x9dbb('0x7f')];return db['User'][_0x9dbb('0x80')](_0x9dbb('0x81'));})[_0x9dbb('0x3b')](function(_0x134489){if(_[_0x9dbb('0x78')](_0x134489)){if(_0x286e17){_0xb29592[_0x9dbb('0x6c')][_0x9dbb('0x81')]=_0x286e17;}else{_0xb29592[_0x9dbb('0x6c')][_0x9dbb('0x81')]=0x1;}}else{if(_[_0x9dbb('0x78')](_0x286e17)||_0x286e17==_0x134489){_0xb29592[_0x9dbb('0x6c')][_0x9dbb('0x81')]=_0x134489+0x1;}else if(_0x286e17>_0x134489){_0xb29592[_0x9dbb('0x6c')]['internal']=_0x286e17;}else{return db[_0x9dbb('0x5e')]['query'](_0x9dbb('0x82'),{'type':db['sequelize'][_0x9dbb('0x83')]['SELECT']})['then'](function(_0x318edd){if(_0x318edd&&_0x318edd['length']){for(var _0x240e38=0x0,_0x41fd58=_0x318edd[_0x9dbb('0x57')];_0x240e38<_0x41fd58&&_['isNil'](_0xb29592[_0x9dbb('0x6c')]['internal']);_0x240e38++){if(_0x286e17<=_0x318edd[_0x240e38]['from']){_0xb29592['body'][_0x9dbb('0x81')]=_0x318edd[_0x240e38][_0x9dbb('0x84')];}else if(_0x286e17>_0x318edd[_0x240e38][_0x9dbb('0x84')]&&_0x286e17<=_0x318edd[_0x240e38]['to']){_0xb29592[_0x9dbb('0x6c')][_0x9dbb('0x81')]=_0x286e17;}}}if(_[_0x9dbb('0x78')](_0xb29592['body'][_0x9dbb('0x81')])){_0xb29592[_0x9dbb('0x6c')][_0x9dbb('0x81')]=_0x134489+0x1;}});}}});}})['then'](function(){if(_0xb29592[_0x9dbb('0x6c')][_0x9dbb('0x85')]){_0xb29592[_0x9dbb('0x6c')][_0x9dbb('0x86')]=_0xb29592[_0x9dbb('0x6c')][_0x9dbb('0x81')];_0xb29592[_0x9dbb('0x6c')][_0x9dbb('0x87')]={'mailbox':_0xb29592['body'][_0x9dbb('0x81')],'password':_0xb29592[_0x9dbb('0x6c')]['password'],'fullname':_0xb29592[_0x9dbb('0x6c')][_0x9dbb('0x88')],'email':_0xb29592[_0x9dbb('0x6c')]['email']};}if(_0xb29592[_0x9dbb('0x6c')]&&_0xb29592[_0x9dbb('0x6c')][_0x9dbb('0x47')]==='agent'){_0xb29592[_0x9dbb('0x6c')][_0x9dbb('0x89')]=[_0x9dbb('0x8a'),_0x9dbb('0x8b'),_0x9dbb('0x8c'),_0x9dbb('0x8d'),'104',_0x9dbb('0x8e'),_0x9dbb('0x8f'),'107',_0x9dbb('0x90'),_0x9dbb('0x91'),'100',_0x9dbb('0x92')];}return db[_0x9dbb('0x4d')]['create'](_0xb29592[_0x9dbb('0x6c')],{'include':[{'model':db[_0x9dbb('0x87')],'as':_0x9dbb('0x87')}]});})[_0x9dbb('0x3b')](function(_0x521d97){if(_0xb29592[_0x9dbb('0x6c')][_0x9dbb('0x47')]===_0x9dbb('0x3f'))return _0x521d97;var _0x44b9ba=_0xb29592[_0x9dbb('0x3f')][_0x9dbb('0x3d')]({'plain':!![]});if(!_0x44b9ba)throw new Error(_0x9dbb('0x93'));if(_0x44b9ba[_0x9dbb('0x47')]===_0x9dbb('0x3f')){var _0x517a85=_0x521d97[_0x9dbb('0x3d')]({'plain':!![]});var _0x96a436=[{'name':_0x9dbb('0x40'),'value':_0x9dbb('0x41')},{'name':_0x9dbb('0x94'),'value':'telephone'}];var _0x152cea=_[_0x9dbb('0x6d')](_0x96a436,[_0x9dbb('0x45'),_0x517a85[_0x9dbb('0x47')]])[_0x9dbb('0x48')];return db[_0x9dbb('0x95')]['find']({'where':{'name':_0x152cea,'userProfileId':_0x44b9ba[_0x9dbb('0x96')]},'raw':!![]})[_0x9dbb('0x3b')](function(_0x2d8005){if(_0x2d8005&&_0x2d8005[_0x9dbb('0x97')]===0x0){return db[_0x9dbb('0x49')][_0x9dbb('0x7c')]({'name':_0x517a85[_0x9dbb('0x48')],'resourceId':_0x517a85['id'],'type':_0x2d8005[_0x9dbb('0x48')],'sectionId':_0x2d8005['id']},{})[_0x9dbb('0x3b')](function(){return _0x521d97;});}else{return _0x521d97;}})[_0x9dbb('0x2e')](function(_0x22b656){logger[_0x9dbb('0x2a')](_0x9dbb('0x98'),_0x22b656);throw _0x22b656;});}return _0x521d97;})['then'](respondWithResult(_0x1aa154,0xc9))[_0x9dbb('0x2e')](handleError(_0x1aa154,null));};exports[_0x9dbb('0x99')]=function(_0x338b5d,_0x279e6d,_0x10426b){var _0x1de5b1=![];if(_0x338b5d[_0x9dbb('0x6c')]['id']){delete _0x338b5d[_0x9dbb('0x6c')]['id'];}return db[_0x9dbb('0x7d')][_0x9dbb('0x9a')]({'attributes':['id',_0x9dbb('0x7e')]})['then'](function(_0xef5377){_0x1de5b1=_0xef5377[_0x9dbb('0x7e')];return db[_0x9dbb('0x4d')][_0x9dbb('0x6d')]({'where':{'id':_0x338b5d[_0x9dbb('0x66')]['id']}});})['then'](function(_0x5d3107){if(_0x5d3107){if(_0x5d3107['id']==_0x338b5d[_0x9dbb('0x3f')]['id']){if(!_0x338b5d['body']['oldPassword']||!_0x338b5d[_0x9dbb('0x6c')][_0x9dbb('0x9b')]){throw new db[(_0x9dbb('0x21'))][(_0x9dbb('0x22'))](_0x9dbb('0x9c'));}if(!_0x5d3107[_0x9dbb('0x9d')](_0x338b5d[_0x9dbb('0x6c')][_0x9dbb('0x9e')])){throw new db[(_0x9dbb('0x21'))][(_0x9dbb('0x22'))](_0x9dbb('0x9f'));}if(_0x338b5d[_0x9dbb('0x6c')][_0x9dbb('0x9e')]==_0x338b5d[_0x9dbb('0x6c')][_0x9dbb('0x9b')]){throw new db[(_0x9dbb('0x21'))][(_0x9dbb('0x22'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}return _0x5d3107;}else if(_0x338b5d[_0x9dbb('0x3f')][_0x9dbb('0x47')]==_0x9dbb('0x73')){if(!_0x338b5d[_0x9dbb('0x6c')][_0x9dbb('0x9b')]){throw new db[(_0x9dbb('0x21'))][(_0x9dbb('0x22'))](_0x9dbb('0xa0'));}return _0x5d3107;}else if(_0x338b5d[_0x9dbb('0x3f')][_0x9dbb('0x47')]=='user'){if(!_0x338b5d[_0x9dbb('0x6c')]['newPassword']){throw new db[(_0x9dbb('0x21'))][(_0x9dbb('0x22'))](_0x9dbb('0xa0'));}if(_0x5d3107[_0x9dbb('0x47')]!=_0x9dbb('0x41')){throw new db[(_0x9dbb('0x21'))]['ValidationError'](_0x9dbb('0xa1'));}return _0x5d3107;}else{throw new db[(_0x9dbb('0x21'))][(_0x9dbb('0x22'))](_0x9dbb('0xa1'));}}return null;})[_0x9dbb('0x3b')](handleEntityNotFound(_0x279e6d,null))[_0x9dbb('0x3b')](function(_0x2e3591){return checkPasswordPattern(_0x2e3591,_0x338b5d[_0x9dbb('0x6c')][_0x9dbb('0x9b')],_0x1de5b1);})[_0x9dbb('0x3b')](saveUpdates({'password':_0x338b5d[_0x9dbb('0x6c')]['newPassword'],'passwordResetAt':_0x338b5d[_0x9dbb('0x3f')]['id']==_0x338b5d[_0x9dbb('0x66')]['id']?moment():null},null))['then'](respondWithResult(_0x279e6d,null))['catch'](handleError(_0x279e6d,null));};exports['addQueues']=function(_0x5957be,_0x2196b5,_0x2b3b94){var _0x464732=_0x5957be[_0x9dbb('0x6c')][_0x9dbb('0xa2')];return db[_0x9dbb('0x4d')][_0x9dbb('0x6d')]({'where':{'id':_0x5957be[_0x9dbb('0x66')]['id']},'attributes':['id',_0x9dbb('0x48'),_0x9dbb('0x47'),'online',_0x9dbb('0xa3'),'voicePause','interface']})[_0x9dbb('0x3b')](handleEntityNotFound(_0x2196b5,null))[_0x9dbb('0x3b')](function(_0x451d50){if(_0x451d50){if(!utils['isValidChannel'](_0x464732)){throw new db[(_0x9dbb('0x21'))][(_0x9dbb('0x22'))]('Unknown\x20channel');}return _0x451d50['add'+_[_0x9dbb('0xa4')](_0x464732[_0x9dbb('0xa5')]())+_0x9dbb('0xa6')](_0x5957be[_0x9dbb('0x6c')][_0x9dbb('0x70')],{'penalty':_0x5957be[_0x9dbb('0x6c')][_0x9dbb('0xa7')]||0x0})['spread'](function(_0x27744c){for(var _0x6b69b=0x0;_0x6b69b<_0x5957be['body'][_0x9dbb('0x70')][_0x9dbb('0x57')];_0x6b69b+=0x1){var _0x8eb1d4={'UserId':_0x5957be['params']['id']};_0x8eb1d4[_['capitalize'](_0x464732[_0x9dbb('0xa5')]())+_0x9dbb('0xa8')]=_0x5957be['body'][_0x9dbb('0x70')][_0x6b69b];socket[_0x9dbb('0xa9')](_0x9dbb('0x3f')+_[_0x9dbb('0xa4')](_0x464732['toLowerCase']())+_0x9dbb('0xaa'),_0x8eb1d4);}return _0x27744c;})[_0x9dbb('0x3b')](function(){if(_0x464732===_0x9dbb('0xab')){return db['VoiceQueue'][_0x9dbb('0xac')]({'where':{'id':_0x5957be[_0x9dbb('0x6c')][_0x9dbb('0x70')]||[]},'raw':!![],'attributes':['id','name']});}})['then'](function(_0x4a777d){var _0x2098ab=_0x451d50[_0x9dbb('0x3d')]({'plain':!![]});var _0x5d28d2=[];if(_0x464732===_0x9dbb('0xab')&&_0x2098ab[_0x9dbb('0x47')]===_0x9dbb('0x41')&&_0x2098ab[_0x9dbb('0xad')]){for(var _0x4e098d=0x0;_0x4e098d<_0x4a777d[_0x9dbb('0x57')];_0x4e098d+=0x1){_0x5d28d2[_0x9dbb('0xae')]({'membername':_0x2098ab['name'],'UserId':_0x2098ab['id'],'queue_name':_0x4a777d[_0x4e098d][_0x9dbb('0x48')],'VoiceQueueId':_0x4a777d[_0x4e098d]['id'],'interface':_[_0x9dbb('0x78')](_0x2098ab[_0x9dbb('0xaf')])?util['format']('SIP/%s',_0x2098ab['name']):_0x2098ab['interface'],'paused':_0x2098ab[_0x9dbb('0xb0')]||![],'penalty':_0x5957be[_0x9dbb('0x6c')]['penalty']||0x0});}return BPromise['each'](_0x5d28d2,function(_0x3fe2ef){return db[_0x9dbb('0xb1')][_0x9dbb('0xb2')](_0x3fe2ef);});}return _0x451d50;});}})[_0x9dbb('0x3b')](respondWithStatusCode(_0x2196b5,null))[_0x9dbb('0x2e')](handleError(_0x2196b5,null));};exports[_0x9dbb('0xb3')]=function(_0x3c18ec,_0x167032,_0xb9f59e){var _0x552622;return db[_0x9dbb('0x4d')][_0x9dbb('0x6d')]({'where':{'id':_0x3c18ec[_0x9dbb('0x66')]['id']},'attributes':['id','name','role']})[_0x9dbb('0x3b')](handleEntityNotFound(_0x167032,null))['then'](function(_0x117e64){if(_0x117e64){_0x552622=_0x117e64;if(!_0x3c18ec[_0x9dbb('0x51')]['channel']||!utils[_0x9dbb('0xb4')](_0x3c18ec[_0x9dbb('0x51')][_0x9dbb('0xa2')])){throw new db['Sequelize'][(_0x9dbb('0x22'))](_0x9dbb('0xb5'));}return _0x117e64[_0x9dbb('0xb6')+_[_0x9dbb('0xa4')](_0x3c18ec['query'][_0x9dbb('0xa2')][_0x9dbb('0xa5')]())+_0x9dbb('0xa6')](_0x3c18ec[_0x9dbb('0x51')]['ids']);}})[_0x9dbb('0x3b')](function(_0x4cf90d){for(var _0x4097fc=0x0;_0x4097fc<_0x3c18ec[_0x9dbb('0x51')][_0x9dbb('0x70')]['length'];_0x4097fc+=0x1){var _0x5f4b9f={'UserId':_0x3c18ec['params']['id']};_0x5f4b9f[_['capitalize'](_0x3c18ec[_0x9dbb('0x51')][_0x9dbb('0xa2')][_0x9dbb('0xa5')]())+'QueueId']=_0x3c18ec[_0x9dbb('0x51')][_0x9dbb('0x70')][_0x4097fc];socket[_0x9dbb('0xa9')](_0x9dbb('0x3f')+_[_0x9dbb('0xa4')](_0x3c18ec['query'][_0x9dbb('0xa2')][_0x9dbb('0xa5')]())+'Queue:remove',_0x5f4b9f);}return _0x4cf90d;})['then'](function(){if(_0x3c18ec[_0x9dbb('0x51')]['channel']==='voice'){return db[_0x9dbb('0xb1')][_0x9dbb('0x3c')]({'where':{'UserId':_0x3c18ec['params']['id'],'VoiceQueueId':_0x3c18ec[_0x9dbb('0x51')][_0x9dbb('0x70')]},'individualHooks':!![]})[_0x9dbb('0x3b')](function(){return _0x552622;});}return _0x552622;})[_0x9dbb('0x3b')](respondWithStatusCode(_0x167032,null))[_0x9dbb('0x2e')](handleError(_0x167032,null));};exports[_0x9dbb('0xb7')]=function(_0x15ecc7,_0x5570f3,_0x56c9c9){_0x15ecc7[_0x9dbb('0x6c')][_0x9dbb('0xb8')]=_0x15ecc7['file'][_0x9dbb('0xb9')];return db[_0x9dbb('0x4d')][_0x9dbb('0x6d')]({'where':{'id':_0x15ecc7[_0x9dbb('0x66')]['id']}})[_0x9dbb('0x3b')](handleEntityNotFound(_0x5570f3,null))[_0x9dbb('0x3b')](saveUpdates(_0x15ecc7[_0x9dbb('0x6c')],null))[_0x9dbb('0x3b')](respondWithResult(_0x5570f3,null))[_0x9dbb('0x2e')](handleError(_0x5570f3,null));};exports[_0x9dbb('0xba')]=function(_0x30015b,_0x23e900,_0x362368){var _0x1c790f=path['join'](config[_0x9dbb('0xbb')],_0x9dbb('0xbc'));return db['User'][_0x9dbb('0x6d')]({'where':{'id':_0x30015b['params']['id']},'attributes':['id',_0x9dbb('0xb8')],'raw':!![]})[_0x9dbb('0x3b')](handleEntityNotFound(_0x23e900,null))['then'](function(_0x4690dc){if(_0x4690dc){if(_['isNil'](_0x4690dc['userpic'])){return _0x23e900[_0x9dbb('0xbd')](_0x1c790f);}else{if(!fs[_0x9dbb('0xbe')](path[_0x9dbb('0xbf')](config[_0x9dbb('0xbb')],_0x9dbb('0xc0'),_0x4690dc[_0x9dbb('0xb8')]))){return _0x23e900[_0x9dbb('0xbd')](_0x1c790f);}return _0x23e900[_0x9dbb('0xbd')](path[_0x9dbb('0xbf')](config[_0x9dbb('0xbb')],'server/files/images/',_0x4690dc[_0x9dbb('0xb8')]));}}})['catch'](handleError(_0x23e900,null));};exports['getContacts']=function(_0x42517d,_0xc836ed,_0x426cfb){var _0x13316b={};var _0x57eed6={};var _0x1165ee;var _0x4c8104;return db['User'][_0x9dbb('0x9a')]({'where':{'id':_0x42517d[_0x9dbb('0x66')]['id']}})[_0x9dbb('0x3b')](handleEntityNotFound(_0xc836ed,null))['then'](function(_0x1db502){if(_0x1db502){_0x1165ee=_0x1db502;_0x57eed6[_0x9dbb('0x50')]=_[_0x9dbb('0x52')](db[_0x9dbb('0xc1')][_0x9dbb('0x4e')]);_0x57eed6[_0x9dbb('0x51')]=_[_0x9dbb('0x52')](_0x42517d[_0x9dbb('0x51')]);_0x57eed6[_0x9dbb('0x53')]=_['intersection'](_0x57eed6[_0x9dbb('0x50')],_0x57eed6[_0x9dbb('0x51')]);_0x13316b[_0x9dbb('0x55')]=_[_0x9dbb('0x54')](_0x57eed6[_0x9dbb('0x50')],qs['fields'](_0x42517d[_0x9dbb('0x51')][_0x9dbb('0x56')]));_0x13316b[_0x9dbb('0x55')]=_0x13316b[_0x9dbb('0x55')]['length']?_0x13316b[_0x9dbb('0x55')]:_0x57eed6[_0x9dbb('0x50')];_0x13316b[_0x9dbb('0x59')]=qs['sort'](_0x42517d[_0x9dbb('0x51')]['sort']);_0x13316b[_0x9dbb('0x5b')]=qs['filters'](_['pick'](_0x42517d[_0x9dbb('0x51')],_0x57eed6['filters']));if(_0x42517d[_0x9dbb('0x51')][_0x9dbb('0x43')]){_0x13316b[_0x9dbb('0x5b')]=_[_0x9dbb('0x5d')](_0x13316b['where'],{'$or':_[_0x9dbb('0x44')](_0x13316b[_0x9dbb('0x55')],function(_0x45f900){var _0x4ed9aa={};_0x4ed9aa[_0x45f900]={'$like':'%'+_0x42517d[_0x9dbb('0x51')][_0x9dbb('0x43')]+'%'};return _0x4ed9aa;})});}_0x13316b=_[_0x9dbb('0x5d')]({},_0x13316b,_0x42517d[_0x9dbb('0x6a')]);return _0x1165ee[_0x9dbb('0xc2')](_0x13316b);}})['then'](function(_0x147cd1){if(_0x147cd1){_0x4c8104=_0x147cd1[_0x9dbb('0x57')];if(_0x42517d['query']['hasOwnProperty'](_0x9dbb('0x62'))){_0x13316b[_0x9dbb('0x63')]=[{'model':db[_0x9dbb('0xc3')],'as':_0x9dbb('0xc4'),'required':![]},{'model':db[_0x9dbb('0xc5')],'as':_0x9dbb('0xc6'),'attributes':['id',_0x9dbb('0x48'),_0x9dbb('0xc7')],'where':_0x42517d[_0x9dbb('0x51')][_0x9dbb('0xc8')]?{'id':_0x42517d[_0x9dbb('0x51')]['tag']}:undefined,'required':_0x42517d[_0x9dbb('0x51')][_0x9dbb('0xc8')]?!![]:![]}];}if(!_0x42517d['query'][_0x9dbb('0xc9')](_0x9dbb('0x58'))){_0x13316b[_0x9dbb('0x34')]=qs[_0x9dbb('0x34')](_0x42517d[_0x9dbb('0x51')][_0x9dbb('0x34')]);_0x13316b[_0x9dbb('0x33')]=qs[_0x9dbb('0x33')](_0x42517d[_0x9dbb('0x51')][_0x9dbb('0x33')]);}return _0x1165ee['getContacts'](_0x13316b);}})[_0x9dbb('0x3b')](function(_0xfcab9c){if(_0xfcab9c){return _0xfcab9c?{'count':_0x4c8104,'rows':_0xfcab9c}:null;}})[_0x9dbb('0x3b')](respondWithResult(_0xc836ed,null))['catch'](handleError(_0xc836ed,null));};exports[_0x9dbb('0xca')]=function(_0x22c91b,_0x1a9860,_0xf40222){var _0x33d9b6;var _0x293662;var _0x452348={};var _0x382616;return db[_0x9dbb('0x4d')]['findOne']({'where':{'id':_0x22c91b[_0x9dbb('0x66')]['id']},'attributes':['id',_0x9dbb('0x48'),_0x9dbb('0x47')]})[_0x9dbb('0x3b')](handleEntityNotFound(_0x1a9860,null))[_0x9dbb('0x3b')](function(_0x32364b){if(!utils['isValidChannel'](_0x22c91b[_0x9dbb('0x51')][_0x9dbb('0xa2')])){throw new db[(_0x9dbb('0x21'))]['ValidationError'](_0x9dbb('0xb5'));}_0x33d9b6=_0x32364b;var _0x279dc4={};_0x279dc4[_0x9dbb('0x50')]=_['keys'](db[_[_0x9dbb('0xa4')](_0x22c91b['query'][_0x9dbb('0xa2')])+_0x9dbb('0xcb')][_0x9dbb('0x4e')]);_0x279dc4['query']=_[_0x9dbb('0x52')](_0x22c91b[_0x9dbb('0x51')]);_0x279dc4['filters']=_[_0x9dbb('0x54')](_0x279dc4['model'],_0x279dc4[_0x9dbb('0x51')]);_0x452348['attributes']=_[_0x9dbb('0x54')](_0x279dc4[_0x9dbb('0x50')],qs[_0x9dbb('0x56')](_0x22c91b[_0x9dbb('0x51')][_0x9dbb('0x56')]));_0x452348[_0x9dbb('0x55')]=_0x452348['attributes']['length']?_0x452348[_0x9dbb('0x55')]:_0x279dc4[_0x9dbb('0x50')];_0x452348['order']=qs[_0x9dbb('0x5a')](_0x22c91b['query'][_0x9dbb('0x5a')]);_0x452348[_0x9dbb('0x5b')]=qs['filters'](_[_0x9dbb('0x5c')](_0x22c91b['query'],_0x279dc4[_0x9dbb('0x53')]));if(_0x22c91b['query'][_0x9dbb('0x43')]){_0x452348[_0x9dbb('0x5b')]=_[_0x9dbb('0x5d')](_0x452348[_0x9dbb('0x5b')],{'$or':_[_0x9dbb('0x44')](_0x452348['attributes'],function(_0x2e1795){var _0x1ac0c6={};_0x1ac0c6[_0x2e1795]={'$like':'%'+_0x22c91b['query'][_0x9dbb('0x43')]+'%'};return _0x1ac0c6;})});}_0x452348=_[_0x9dbb('0x5d')]({},_0x452348,_0x22c91b['options']);switch(_0x33d9b6[_0x9dbb('0x47')]){case'admin':return db[_['capitalize'](_0x22c91b[_0x9dbb('0x51')]['channel'])+_0x9dbb('0xcb')][_0x9dbb('0xac')](_0x452348);case _0x9dbb('0x3f'):case _0x9dbb('0x41'):return _0x33d9b6['get'+_[_0x9dbb('0xa4')](_0x22c91b[_0x9dbb('0x51')][_0x9dbb('0xa2')])+_0x9dbb('0xa6')](_0x452348);default:throw new db['Sequelize'][(_0x9dbb('0x22'))](_0x9dbb('0xcc'));}})[_0x9dbb('0x3b')](function(_0x2f44f5){_0x382616=_0x2f44f5[_0x9dbb('0x57')];if(!_0x22c91b[_0x9dbb('0x51')][_0x9dbb('0xc9')](_0x9dbb('0x58'))){_0x452348[_0x9dbb('0x34')]=qs['limit'](_0x22c91b[_0x9dbb('0x51')][_0x9dbb('0x34')]);_0x452348['offset']=qs[_0x9dbb('0x33')](_0x22c91b[_0x9dbb('0x51')][_0x9dbb('0x33')]);}switch(_0x33d9b6[_0x9dbb('0x47')]){case'admin':return db[_['capitalize'](_0x22c91b[_0x9dbb('0x51')][_0x9dbb('0xa2')])+_0x9dbb('0xcb')][_0x9dbb('0xac')](_0x452348);case'user':case _0x9dbb('0x41'):return _0x33d9b6[_0x9dbb('0x3d')+_['capitalize'](_0x22c91b[_0x9dbb('0x51')][_0x9dbb('0xa2')])+_0x9dbb('0xa6')](_0x452348);}})['then'](function(_0x16b026){return{'count':_0x382616,'rows':_0x16b026};})['then'](respondWithResult(_0x1a9860,null))[_0x9dbb('0x2e')](handleError(_0x1a9860,null));};exports[_0x9dbb('0xcd')]=function(_0x411797,_0x28b28d,_0x1ae697){var _0x46111b={};var _0x3e2305={};var _0x3af05d;var _0x5ae316;return db[_0x9dbb('0x4d')][_0x9dbb('0x9a')]({'where':{'id':_0x411797[_0x9dbb('0x66')]['id']}})[_0x9dbb('0x3b')](handleEntityNotFound(_0x28b28d,null))[_0x9dbb('0x3b')](function(_0x521571){if(_0x521571){_0x3af05d=_0x521571;_0x3e2305[_0x9dbb('0x50')]=_[_0x9dbb('0x52')](db['UserVoiceQueueRt'][_0x9dbb('0x4e')]);_0x3e2305['query']=_[_0x9dbb('0x52')](_0x411797['query']);_0x3e2305['filters']=_[_0x9dbb('0x54')](_0x3e2305['model'],_0x3e2305[_0x9dbb('0x51')]);_0x46111b[_0x9dbb('0x55')]=_[_0x9dbb('0x54')](_0x3e2305[_0x9dbb('0x50')],qs['fields'](_0x411797[_0x9dbb('0x51')]['fields']));_0x46111b['attributes']=_0x46111b[_0x9dbb('0x55')][_0x9dbb('0x57')]?_0x46111b[_0x9dbb('0x55')]:_0x3e2305[_0x9dbb('0x50')];_0x46111b['order']=qs['sort'](_0x411797[_0x9dbb('0x51')][_0x9dbb('0x5a')]);_0x46111b[_0x9dbb('0x5b')]=qs['filters'](_[_0x9dbb('0x5c')](_0x411797['query'],_0x3e2305[_0x9dbb('0x53')]));if(_0x411797[_0x9dbb('0x51')][_0x9dbb('0x43')]){_0x46111b[_0x9dbb('0x5b')]=_[_0x9dbb('0x5d')](_0x46111b[_0x9dbb('0x5b')],{'$or':_[_0x9dbb('0x44')](_0x46111b[_0x9dbb('0x55')],function(_0x55e4d9){var _0x2cfce9={};_0x2cfce9[_0x55e4d9]={'$like':'%'+_0x411797[_0x9dbb('0x51')][_0x9dbb('0x43')]+'%'};return _0x2cfce9;})});}_0x46111b=_['merge']({},_0x46111b,_0x411797['options']);return _0x3af05d[_0x9dbb('0xcd')](_0x46111b);}})['then'](function(_0x3cce1b){if(_0x3cce1b){_0x5ae316=_0x3cce1b[_0x9dbb('0x57')];if(!_0x411797[_0x9dbb('0x51')]['hasOwnProperty'](_0x9dbb('0x58'))){_0x46111b[_0x9dbb('0x34')]=qs[_0x9dbb('0x34')](_0x411797['query'][_0x9dbb('0x34')]);_0x46111b[_0x9dbb('0x33')]=qs['offset'](_0x411797['query'][_0x9dbb('0x33')]);}return _0x3af05d[_0x9dbb('0xcd')](_0x46111b);}})[_0x9dbb('0x3b')](function(_0x5ec31f){if(_0x5ec31f){return _0x5ec31f?{'count':_0x5ae316,'rows':_0x5ec31f}:null;}})[_0x9dbb('0x3b')](respondWithResult(_0x28b28d,null))[_0x9dbb('0x2e')](handleError(_0x28b28d,null));};exports[_0x9dbb('0xce')]=function(_0x9711aa,_0x2cad27,_0x5728ff){var _0x21a53a={};var _0x4c821d={};var _0x4eec1f;var _0x599a67;return db[_0x9dbb('0x4d')][_0x9dbb('0x9a')]({'where':{'id':_0x9711aa[_0x9dbb('0x66')]['id']}})[_0x9dbb('0x3b')](handleEntityNotFound(_0x2cad27,null))['then'](function(_0x44caff){if(_0x44caff){_0x4eec1f=_0x44caff;_0x4c821d[_0x9dbb('0x50')]=_[_0x9dbb('0x52')](db['ChatGroup'][_0x9dbb('0x4e')]);_0x4c821d[_0x9dbb('0x51')]=_[_0x9dbb('0x52')](_0x9711aa[_0x9dbb('0x51')]);_0x4c821d[_0x9dbb('0x53')]=_[_0x9dbb('0x54')](_0x4c821d[_0x9dbb('0x50')],_0x4c821d[_0x9dbb('0x51')]);_0x21a53a[_0x9dbb('0x55')]=_['intersection'](_0x4c821d[_0x9dbb('0x50')],qs['fields'](_0x9711aa['query'][_0x9dbb('0x56')]));_0x21a53a[_0x9dbb('0x55')]=_0x21a53a[_0x9dbb('0x55')][_0x9dbb('0x57')]?_0x21a53a[_0x9dbb('0x55')]:_0x4c821d[_0x9dbb('0x50')];_0x21a53a['order']=qs[_0x9dbb('0x5a')](_0x9711aa[_0x9dbb('0x51')][_0x9dbb('0x5a')]);_0x21a53a[_0x9dbb('0x5b')]=qs[_0x9dbb('0x53')](_[_0x9dbb('0x5c')](_0x9711aa[_0x9dbb('0x51')],_0x4c821d[_0x9dbb('0x53')]));if(_0x9711aa['query']['filter']){_0x21a53a[_0x9dbb('0x5b')]=_[_0x9dbb('0x5d')](_0x21a53a[_0x9dbb('0x5b')],{'$or':_[_0x9dbb('0x44')](_0x21a53a[_0x9dbb('0x55')],function(_0x2fe873){var _0x281490={};_0x281490[_0x2fe873]={'$like':'%'+_0x9711aa['query'][_0x9dbb('0x43')]+'%'};return _0x281490;})});}_0x21a53a=_['merge']({},_0x21a53a,_0x9711aa[_0x9dbb('0x6a')]);return _0x4eec1f[_0x9dbb('0xce')](_0x21a53a);}})[_0x9dbb('0x3b')](function(_0x2087d9){if(_0x2087d9){_0x599a67=_0x2087d9[_0x9dbb('0x57')];if(!_0x9711aa[_0x9dbb('0x51')]['hasOwnProperty'](_0x9dbb('0x58'))){_0x21a53a[_0x9dbb('0x34')]=qs[_0x9dbb('0x34')](_0x9711aa[_0x9dbb('0x51')][_0x9dbb('0x34')]);_0x21a53a[_0x9dbb('0x33')]=qs[_0x9dbb('0x33')](_0x9711aa[_0x9dbb('0x51')][_0x9dbb('0x33')]);}return _0x4eec1f[_0x9dbb('0xce')](_0x21a53a);}})[_0x9dbb('0x3b')](function(_0x583766){if(_0x583766){return _0x583766?{'count':_0x599a67,'rows':_0x583766}:null;}})['then'](respondWithResult(_0x2cad27,null))[_0x9dbb('0x2e')](handleError(_0x2cad27,null));};exports[_0x9dbb('0xcf')]=function(_0x42c214,_0x263231,_0x4671db){var _0x4d9f7b={'raw':!![],'where':{}};var _0x344893={};var _0x5056ac={'count':0x0,'rows':[]};return db[_0x9dbb('0x4d')]['findOne']({'where':{'id':_0x42c214['params']['id']}})['then'](handleEntityNotFound(_0x263231,null))[_0x9dbb('0x3b')](function(_0x64d70f){if(_0x64d70f){_0x344893[_0x9dbb('0x50')]=_[_0x9dbb('0x52')](db[_0x9dbb('0xd0')][_0x9dbb('0x4e')]);_0x344893['query']=_['keys'](_0x42c214[_0x9dbb('0x51')]);_0x344893[_0x9dbb('0x53')]=_['intersection'](_0x344893['model'],_0x344893['query']);_0x4d9f7b[_0x9dbb('0x55')]=_[_0x9dbb('0x54')](_0x344893[_0x9dbb('0x50')],qs[_0x9dbb('0x56')](_0x42c214[_0x9dbb('0x51')][_0x9dbb('0x56')]));_0x4d9f7b['attributes']=_0x4d9f7b['attributes'][_0x9dbb('0x57')]?_0x4d9f7b[_0x9dbb('0x55')]:_0x344893[_0x9dbb('0x50')];if(!_0x42c214[_0x9dbb('0x51')][_0x9dbb('0xc9')](_0x9dbb('0x58'))){_0x4d9f7b[_0x9dbb('0x34')]=qs['limit'](_0x42c214['query']['limit']);_0x4d9f7b[_0x9dbb('0x33')]=qs[_0x9dbb('0x33')](_0x42c214[_0x9dbb('0x51')]['offset']);}_0x4d9f7b['order']=qs['sort'](_0x42c214[_0x9dbb('0x51')][_0x9dbb('0x5a')]);_0x4d9f7b[_0x9dbb('0x5b')]=qs['filters'](_[_0x9dbb('0x5c')](_0x42c214['query'],_0x344893[_0x9dbb('0x53')]));_0x4d9f7b[_0x9dbb('0x5b')][_0x9dbb('0xd1')]=_0x64d70f['id'];if(_0x42c214[_0x9dbb('0x51')][_0x9dbb('0x43')]){_0x4d9f7b[_0x9dbb('0x5b')]=_[_0x9dbb('0x5d')](_0x4d9f7b[_0x9dbb('0x5b')],{'$or':_[_0x9dbb('0x44')](_0x4d9f7b[_0x9dbb('0x55')],function(_0x14af76){var _0x5090fa={};_0x5090fa[_0x14af76]={'$like':'%'+_0x42c214[_0x9dbb('0x51')][_0x9dbb('0x43')]+'%'};return _0x5090fa;})});}_0x4d9f7b=_[_0x9dbb('0x5d')]({},_0x4d9f7b,_0x42c214[_0x9dbb('0x6a')]);return db[_0x9dbb('0xd0')][_0x9dbb('0x61')]({'where':_0x4d9f7b[_0x9dbb('0x5b')]})['then'](function(_0x406fd7){_0x5056ac[_0x9dbb('0x61')]=_0x406fd7;if(_0x42c214[_0x9dbb('0x51')][_0x9dbb('0x62')]){_0x4d9f7b[_0x9dbb('0x63')]=[{'all':!![]}];}return db[_0x9dbb('0xd0')]['findAll'](_0x4d9f7b);})[_0x9dbb('0x3b')](function(_0xe4bd2d){_0x5056ac['rows']=_0xe4bd2d;return _0x5056ac;});}})['then'](respondWithFilteredResult(_0x263231,_0x4d9f7b))[_0x9dbb('0x2e')](handleError(_0x263231,null));};exports[_0x9dbb('0xd2')]=function(_0x5d4d4e,_0xf2ef56,_0x3b7f1c){var _0x4c80c2={'raw':!![],'where':{}};var _0x363532={};var _0x4a4233={'count':0x0,'rows':[]};return db[_0x9dbb('0x4d')][_0x9dbb('0x9a')]({'where':{'id':_0x5d4d4e[_0x9dbb('0x66')]['id']}})[_0x9dbb('0x3b')](handleEntityNotFound(_0xf2ef56,null))[_0x9dbb('0x3b')](function(_0x517972){if(_0x517972){_0x363532[_0x9dbb('0x50')]=_[_0x9dbb('0x52')](db[_0x9dbb('0xd3')][_0x9dbb('0x4e')]);_0x363532[_0x9dbb('0x51')]=_[_0x9dbb('0x52')](_0x5d4d4e[_0x9dbb('0x51')]);_0x363532[_0x9dbb('0x53')]=_['intersection'](_0x363532[_0x9dbb('0x50')],_0x363532[_0x9dbb('0x51')]);_0x4c80c2[_0x9dbb('0x55')]=_[_0x9dbb('0x54')](_0x363532[_0x9dbb('0x50')],qs[_0x9dbb('0x56')](_0x5d4d4e[_0x9dbb('0x51')]['fields']));_0x4c80c2[_0x9dbb('0x55')]=_0x4c80c2[_0x9dbb('0x55')][_0x9dbb('0x57')]?_0x4c80c2[_0x9dbb('0x55')]:_0x363532[_0x9dbb('0x50')];if(!_0x5d4d4e['query'][_0x9dbb('0xc9')](_0x9dbb('0x58'))){_0x4c80c2[_0x9dbb('0x34')]=qs[_0x9dbb('0x34')](_0x5d4d4e['query'][_0x9dbb('0x34')]);_0x4c80c2[_0x9dbb('0x33')]=qs['offset'](_0x5d4d4e[_0x9dbb('0x51')][_0x9dbb('0x33')]);}_0x4c80c2['order']=qs[_0x9dbb('0x5a')](_0x5d4d4e[_0x9dbb('0x51')][_0x9dbb('0x5a')]);_0x4c80c2['where']=qs[_0x9dbb('0x53')](_[_0x9dbb('0x5c')](_0x5d4d4e[_0x9dbb('0x51')],_0x363532[_0x9dbb('0x53')]));_0x4c80c2[_0x9dbb('0x5b')][_0x9dbb('0xd1')]=_0x517972['id'];if(_0x5d4d4e[_0x9dbb('0x51')][_0x9dbb('0x43')]){_0x4c80c2[_0x9dbb('0x5b')]=_['merge'](_0x4c80c2['where'],{'$or':_[_0x9dbb('0x44')](_0x4c80c2[_0x9dbb('0x55')],function(_0xcdf8e6){var _0x4efaaf={};_0x4efaaf[_0xcdf8e6]={'$like':'%'+_0x5d4d4e[_0x9dbb('0x51')][_0x9dbb('0x43')]+'%'};return _0x4efaaf;})});}_0x4c80c2=_[_0x9dbb('0x5d')]({},_0x4c80c2,_0x5d4d4e[_0x9dbb('0x6a')]);return db[_0x9dbb('0xd3')][_0x9dbb('0x61')]({'where':_0x4c80c2[_0x9dbb('0x5b')]})[_0x9dbb('0x3b')](function(_0x18a80c){_0x4a4233['count']=_0x18a80c;if(_0x5d4d4e[_0x9dbb('0x51')][_0x9dbb('0x62')]){_0x4c80c2[_0x9dbb('0x63')]=[{'all':!![]}];}return db['ScreenRecording'][_0x9dbb('0xac')](_0x4c80c2);})[_0x9dbb('0x3b')](function(_0x81390){_0x4a4233[_0x9dbb('0x64')]=_0x81390;return _0x4a4233;});}})[_0x9dbb('0x3b')](respondWithFilteredResult(_0xf2ef56,_0x4c80c2))['catch'](handleError(_0xf2ef56,null));};exports[_0x9dbb('0xd4')]=function(_0x2ef255,_0x3814ad,_0x2a793c){var _0x2c2274={};var _0x458cf5={};var _0x329138;var _0x1f4917;return db[_0x9dbb('0x4d')]['findOne']({'where':{'id':_0x2ef255[_0x9dbb('0x66')]['id']}})[_0x9dbb('0x3b')](handleEntityNotFound(_0x3814ad,null))[_0x9dbb('0x3b')](function(_0xe1d651){if(_0xe1d651){_0x329138=_0xe1d651;_0x458cf5[_0x9dbb('0x50')]=_[_0x9dbb('0x52')](db[_0x9dbb('0xd5')][_0x9dbb('0x4e')]);_0x458cf5[_0x9dbb('0x51')]=_[_0x9dbb('0x52')](_0x2ef255[_0x9dbb('0x51')]);_0x458cf5[_0x9dbb('0x53')]=_[_0x9dbb('0x54')](_0x458cf5[_0x9dbb('0x50')],_0x458cf5[_0x9dbb('0x51')]);_0x2c2274['attributes']=_[_0x9dbb('0x54')](_0x458cf5['model'],qs[_0x9dbb('0x56')](_0x2ef255[_0x9dbb('0x51')][_0x9dbb('0x56')]));_0x2c2274[_0x9dbb('0x55')]=_0x2c2274[_0x9dbb('0x55')][_0x9dbb('0x57')]?_0x2c2274[_0x9dbb('0x55')]:_0x458cf5[_0x9dbb('0x50')];_0x2c2274[_0x9dbb('0x59')]=qs[_0x9dbb('0x5a')](_0x2ef255[_0x9dbb('0x51')][_0x9dbb('0x5a')]);_0x2c2274['where']=qs[_0x9dbb('0x53')](_['pick'](_0x2ef255[_0x9dbb('0x51')],_0x458cf5['filters']));if(_0x2ef255[_0x9dbb('0x51')][_0x9dbb('0x43')]){_0x2c2274[_0x9dbb('0x5b')]=_[_0x9dbb('0x5d')](_0x2c2274[_0x9dbb('0x5b')],{'$or':_[_0x9dbb('0x44')](_0x2c2274['attributes'],function(_0x5e7ade){var _0x3a2d71={};_0x3a2d71[_0x5e7ade]={'$like':'%'+_0x2ef255['query'][_0x9dbb('0x43')]+'%'};return _0x3a2d71;})});}_0x2c2274=_['merge']({},_0x2c2274,_0x2ef255['options']);return _0x329138[_0x9dbb('0xd4')](_0x2c2274);}})[_0x9dbb('0x3b')](function(_0x58c81a){if(_0x58c81a){_0x1f4917=_0x58c81a[_0x9dbb('0x57')];if(!_0x2ef255[_0x9dbb('0x51')]['hasOwnProperty'](_0x9dbb('0x58'))){_0x2c2274['limit']=qs['limit'](_0x2ef255[_0x9dbb('0x51')][_0x9dbb('0x34')]);_0x2c2274[_0x9dbb('0x33')]=qs['offset'](_0x2ef255[_0x9dbb('0x51')][_0x9dbb('0x33')]);}return _0x329138[_0x9dbb('0xd4')](_0x2c2274);}})[_0x9dbb('0x3b')](function(_0x1e25f0){if(_0x1e25f0){return _0x1e25f0?{'count':_0x1f4917,'rows':_0x1e25f0}:null;}})['then'](respondWithResult(_0x3814ad,null))[_0x9dbb('0x2e')](handleError(_0x3814ad,null));};exports[_0x9dbb('0xd6')]=function(_0x1868a4,_0x272f6b,_0x162c41){var _0x2022ee={};var _0x2c3bf7={};var _0x3e30b8;var _0x44252d;return db[_0x9dbb('0x4d')][_0x9dbb('0x9a')]({'where':{'id':_0x1868a4[_0x9dbb('0x66')]['id']}})[_0x9dbb('0x3b')](handleEntityNotFound(_0x272f6b,null))[_0x9dbb('0x3b')](function(_0x4d613e){if(_0x4d613e){_0x3e30b8=_0x4d613e;_0x2c3bf7[_0x9dbb('0x50')]=_['keys'](db[_0x9dbb('0xd7')]['rawAttributes']);_0x2c3bf7['query']=_['keys'](_0x1868a4['query']);_0x2c3bf7[_0x9dbb('0x53')]=_[_0x9dbb('0x54')](_0x2c3bf7[_0x9dbb('0x50')],_0x2c3bf7[_0x9dbb('0x51')]);_0x2022ee[_0x9dbb('0x55')]=_[_0x9dbb('0x54')](_0x2c3bf7[_0x9dbb('0x50')],qs[_0x9dbb('0x56')](_0x1868a4['query'][_0x9dbb('0x56')]));_0x2022ee[_0x9dbb('0x55')]=_0x2022ee[_0x9dbb('0x55')][_0x9dbb('0x57')]?_0x2022ee[_0x9dbb('0x55')]:_0x2c3bf7[_0x9dbb('0x50')];_0x2022ee[_0x9dbb('0x59')]=qs[_0x9dbb('0x5a')](_0x1868a4[_0x9dbb('0x51')]['sort']);_0x2022ee[_0x9dbb('0x5b')]=qs[_0x9dbb('0x53')](_[_0x9dbb('0x5c')](_0x1868a4[_0x9dbb('0x51')],_0x2c3bf7[_0x9dbb('0x53')]));if(_0x1868a4[_0x9dbb('0x51')][_0x9dbb('0x43')]){_0x2022ee[_0x9dbb('0x5b')]=_[_0x9dbb('0x5d')](_0x2022ee['where'],{'$or':_[_0x9dbb('0x44')](_0x2022ee[_0x9dbb('0x55')],function(_0x3fcdf7){var _0x473a7b={};_0x473a7b[_0x3fcdf7]={'$like':'%'+_0x1868a4[_0x9dbb('0x51')]['filter']+'%'};return _0x473a7b;})});}_0x2022ee=_[_0x9dbb('0x5d')]({},_0x2022ee,_0x1868a4[_0x9dbb('0x6a')]);return _0x3e30b8[_0x9dbb('0xd6')](_0x2022ee);}})[_0x9dbb('0x3b')](function(_0x498133){if(_0x498133){_0x44252d=_0x498133[_0x9dbb('0x57')];if(!_0x1868a4[_0x9dbb('0x51')]['hasOwnProperty']('nolimit')){_0x2022ee[_0x9dbb('0x34')]=qs['limit'](_0x1868a4[_0x9dbb('0x51')][_0x9dbb('0x34')]);_0x2022ee[_0x9dbb('0x33')]=qs[_0x9dbb('0x33')](_0x1868a4[_0x9dbb('0x51')][_0x9dbb('0x33')]);}return _0x3e30b8[_0x9dbb('0xd6')](_0x2022ee);}})[_0x9dbb('0x3b')](function(_0x1c3930){if(_0x1c3930){return _0x1c3930?{'count':_0x44252d,'rows':_0x1c3930}:null;}})[_0x9dbb('0x3b')](respondWithResult(_0x272f6b,null))[_0x9dbb('0x2e')](handleError(_0x272f6b,null));};exports[_0x9dbb('0xd8')]=function(_0x5702fe,_0x27f231,_0x4ff379){var _0x78dfc3={'raw':!![],'where':{}};var _0x502ac0={};var _0x1f8890={'count':0x0,'rows':[]};return db[_0x9dbb('0x4d')][_0x9dbb('0x9a')]({'where':{'id':_0x5702fe['params']['id']}})[_0x9dbb('0x3b')](handleEntityNotFound(_0x27f231,null))[_0x9dbb('0x3b')](function(_0x247105){if(_0x247105){_0x502ac0[_0x9dbb('0x50')]=_[_0x9dbb('0x52')](db[_0x9dbb('0xd9')][_0x9dbb('0x4e')]);_0x502ac0[_0x9dbb('0x51')]=_[_0x9dbb('0x52')](_0x5702fe[_0x9dbb('0x51')]);_0x502ac0[_0x9dbb('0x53')]=_['intersection'](_0x502ac0[_0x9dbb('0x50')],_0x502ac0[_0x9dbb('0x51')]);_0x78dfc3[_0x9dbb('0x55')]=_[_0x9dbb('0x54')](_0x502ac0[_0x9dbb('0x50')],qs[_0x9dbb('0x56')](_0x5702fe[_0x9dbb('0x51')][_0x9dbb('0x56')]));_0x78dfc3[_0x9dbb('0x55')]=_0x78dfc3[_0x9dbb('0x55')][_0x9dbb('0x57')]?_0x78dfc3[_0x9dbb('0x55')]:_0x502ac0[_0x9dbb('0x50')];if(!_0x5702fe[_0x9dbb('0x51')][_0x9dbb('0xc9')](_0x9dbb('0x58'))){_0x78dfc3['limit']=qs[_0x9dbb('0x34')](_0x5702fe['query'][_0x9dbb('0x34')]);_0x78dfc3[_0x9dbb('0x33')]=qs[_0x9dbb('0x33')](_0x5702fe['query'][_0x9dbb('0x33')]);}_0x78dfc3[_0x9dbb('0x59')]=qs[_0x9dbb('0x5a')](_0x5702fe[_0x9dbb('0x51')][_0x9dbb('0x5a')]);_0x78dfc3['where']=qs[_0x9dbb('0x53')](_['pick'](_0x5702fe[_0x9dbb('0x51')],_0x502ac0['filters']));_0x78dfc3['where'][_0x9dbb('0xd1')]=_0x247105['id'];if(_0x5702fe[_0x9dbb('0x51')][_0x9dbb('0x43')]){_0x78dfc3[_0x9dbb('0x5b')]=_[_0x9dbb('0x5d')](_0x78dfc3[_0x9dbb('0x5b')],{'$or':_[_0x9dbb('0x44')](_0x78dfc3[_0x9dbb('0x55')],function(_0x2cf526){var _0x4042c1={};_0x4042c1[_0x2cf526]={'$like':'%'+_0x5702fe['query'][_0x9dbb('0x43')]+'%'};return _0x4042c1;})});}_0x78dfc3=_['merge']({},_0x78dfc3,_0x5702fe[_0x9dbb('0x6a')]);return db[_0x9dbb('0xd9')]['count']({'where':_0x78dfc3[_0x9dbb('0x5b')]})['then'](function(_0x4c9d95){_0x1f8890[_0x9dbb('0x61')]=_0x4c9d95;if(_0x5702fe[_0x9dbb('0x51')]['includeAll']){_0x78dfc3[_0x9dbb('0x63')]=[{'all':!![]}];}return db[_0x9dbb('0xd9')]['findAll'](_0x78dfc3);})[_0x9dbb('0x3b')](function(_0x3d3e74){_0x1f8890[_0x9dbb('0x64')]=_0x3d3e74;return _0x1f8890;});}})[_0x9dbb('0x3b')](respondWithFilteredResult(_0x27f231,_0x78dfc3))[_0x9dbb('0x2e')](handleError(_0x27f231,null));};exports[_0x9dbb('0xda')]=function(_0x54450c,_0x20cc50,_0x1166d4){var _0x31ed6a={};var _0x2effe4={};var _0x30d683;var _0x167934;return db['User']['findOne']({'where':{'id':_0x54450c['params']['id']}})['then'](handleEntityNotFound(_0x20cc50,null))[_0x9dbb('0x3b')](function(_0x5ed09f){if(_0x5ed09f){_0x30d683=_0x5ed09f;_0x2effe4['model']=_[_0x9dbb('0x52')](db[_0x9dbb('0xdb')]['rawAttributes']);_0x2effe4[_0x9dbb('0x51')]=_['keys'](_0x54450c[_0x9dbb('0x51')]);_0x2effe4['filters']=_[_0x9dbb('0x54')](_0x2effe4['model'],_0x2effe4[_0x9dbb('0x51')]);_0x31ed6a[_0x9dbb('0x55')]=_[_0x9dbb('0x54')](_0x2effe4[_0x9dbb('0x50')],qs[_0x9dbb('0x56')](_0x54450c[_0x9dbb('0x51')][_0x9dbb('0x56')]));_0x31ed6a[_0x9dbb('0x55')]=_0x31ed6a['attributes'][_0x9dbb('0x57')]?_0x31ed6a[_0x9dbb('0x55')]:_0x2effe4[_0x9dbb('0x50')];_0x31ed6a[_0x9dbb('0x59')]=qs[_0x9dbb('0x5a')](_0x54450c[_0x9dbb('0x51')][_0x9dbb('0x5a')]);_0x31ed6a['where']=qs['filters'](_['pick'](_0x54450c['query'],_0x2effe4[_0x9dbb('0x53')]));if(_0x54450c[_0x9dbb('0x51')][_0x9dbb('0x43')]){_0x31ed6a[_0x9dbb('0x5b')]=_[_0x9dbb('0x5d')](_0x31ed6a[_0x9dbb('0x5b')],{'$or':_[_0x9dbb('0x44')](_0x31ed6a[_0x9dbb('0x55')],function(_0x3d20b4){var _0xaafbe1={};_0xaafbe1[_0x3d20b4]={'$like':'%'+_0x54450c['query'][_0x9dbb('0x43')]+'%'};return _0xaafbe1;})});}_0x31ed6a=_[_0x9dbb('0x5d')]({},_0x31ed6a,_0x54450c[_0x9dbb('0x6a')]);return _0x30d683[_0x9dbb('0xda')](_0x31ed6a);}})[_0x9dbb('0x3b')](function(_0xd5a7ff){if(_0xd5a7ff){_0x167934=_0xd5a7ff['length'];if(!_0x54450c[_0x9dbb('0x51')][_0x9dbb('0xc9')](_0x9dbb('0x58'))){_0x31ed6a[_0x9dbb('0x34')]=qs[_0x9dbb('0x34')](_0x54450c['query']['limit']);_0x31ed6a[_0x9dbb('0x33')]=qs[_0x9dbb('0x33')](_0x54450c[_0x9dbb('0x51')][_0x9dbb('0x33')]);}return _0x30d683[_0x9dbb('0xda')](_0x31ed6a);}})[_0x9dbb('0x3b')](function(_0x351d37){if(_0x351d37){return _0x351d37?{'count':_0x167934,'rows':_0x351d37}:null;}})[_0x9dbb('0x3b')](respondWithResult(_0x20cc50,null))[_0x9dbb('0x2e')](handleError(_0x20cc50,null));};exports[_0x9dbb('0xdc')]=function(_0x787b26,_0x3e1abe,_0x87a6ed){var _0x2338a5={};var _0x2d96b3={};var _0x760677;var _0x251885;return db[_0x9dbb('0x4d')][_0x9dbb('0x9a')]({'where':{'id':_0x787b26[_0x9dbb('0x66')]['id']}})[_0x9dbb('0x3b')](handleEntityNotFound(_0x3e1abe,null))[_0x9dbb('0x3b')](function(_0x35d103){if(_0x35d103){_0x760677=_0x35d103;_0x2d96b3[_0x9dbb('0x50')]=_['keys'](db[_0x9dbb('0xdd')][_0x9dbb('0x4e')]);_0x2d96b3[_0x9dbb('0x51')]=_['keys'](_0x787b26[_0x9dbb('0x51')]);_0x2d96b3[_0x9dbb('0x53')]=_[_0x9dbb('0x54')](_0x2d96b3[_0x9dbb('0x50')],_0x2d96b3[_0x9dbb('0x51')]);_0x2338a5[_0x9dbb('0x55')]=_[_0x9dbb('0x54')](_0x2d96b3[_0x9dbb('0x50')],qs[_0x9dbb('0x56')](_0x787b26[_0x9dbb('0x51')][_0x9dbb('0x56')]));_0x2338a5[_0x9dbb('0x55')]=_0x2338a5[_0x9dbb('0x55')][_0x9dbb('0x57')]?_0x2338a5[_0x9dbb('0x55')]:_0x2d96b3[_0x9dbb('0x50')];_0x2338a5['order']=qs['sort'](_0x787b26[_0x9dbb('0x51')][_0x9dbb('0x5a')]);_0x2338a5[_0x9dbb('0x5b')]=qs['filters'](_[_0x9dbb('0x5c')](_0x787b26[_0x9dbb('0x51')],_0x2d96b3[_0x9dbb('0x53')]));if(_0x787b26[_0x9dbb('0x51')]['filter']){_0x2338a5['where']=_[_0x9dbb('0x5d')](_0x2338a5['where'],{'$or':_['map'](_0x2338a5[_0x9dbb('0x55')],function(_0xf0904e){var _0x28e539={};_0x28e539[_0xf0904e]={'$like':'%'+_0x787b26['query']['filter']+'%'};return _0x28e539;})});}_0x2338a5=_['merge']({},_0x2338a5,_0x787b26['options']);return _0x760677[_0x9dbb('0xdc')](_0x2338a5);}})[_0x9dbb('0x3b')](function(_0x2d6c92){if(_0x2d6c92){_0x251885=_0x2d6c92[_0x9dbb('0x57')];if(!_0x787b26[_0x9dbb('0x51')][_0x9dbb('0xc9')]('nolimit')){_0x2338a5['limit']=qs[_0x9dbb('0x34')](_0x787b26[_0x9dbb('0x51')][_0x9dbb('0x34')]);_0x2338a5[_0x9dbb('0x33')]=qs[_0x9dbb('0x33')](_0x787b26[_0x9dbb('0x51')][_0x9dbb('0x33')]);}return _0x760677['getFaxInteractions'](_0x2338a5);}})[_0x9dbb('0x3b')](function(_0x4c018f){if(_0x4c018f){return _0x4c018f?{'count':_0x251885,'rows':_0x4c018f}:null;}})[_0x9dbb('0x3b')](respondWithResult(_0x3e1abe,null))[_0x9dbb('0x2e')](handleError(_0x3e1abe,null));};exports[_0x9dbb('0xde')]=function(_0x2e2344,_0x2e112c,_0x384e9f){var _0x404dd7;var _0x239132;var _0x72a65;var _0x4d5af0=!_['isNil'](_0x2e2344[_0x9dbb('0x66')]['id'])?_0x2e2344['params']['id']:!_[_0x9dbb('0x78')](_0x2e2344[_0x9dbb('0x3f')]['id'])?_0x2e2344[_0x9dbb('0x3f')]['id']:null;return db[_0x9dbb('0x4d')][_0x9dbb('0x6d')]({'where':{'id':_0x4d5af0,'role':{'$or':[_0x9dbb('0x73'),_0x9dbb('0x3f'),_0x9dbb('0x41')]}},'attributes':['id',_0x9dbb('0x48'),_0x9dbb('0xdf'),_0x9dbb('0xe0'),'role',_0x9dbb('0x81'),'loginInPause']})[_0x9dbb('0x3b')](function(_0x3fffcf){if(_0x3fffcf){if(_0x3fffcf[_0x9dbb('0x47')]==='agent'){_0x404dd7=_0x3fffcf;if(_0x2e2344[_0x9dbb('0x6c')][_0x9dbb('0xaf')]){_0x72a65=util['format'](_0x9dbb('0xe1'),_0x404dd7[_0x2e2344['body'][_0x9dbb('0xaf')]]);}else if(_0x2e2344[_0x9dbb('0x6c')][_0x9dbb('0xe2')]){_0x72a65=util['format'](_0x9dbb('0xe3'),_0x2e2344[_0x9dbb('0x6c')]['intrf']);}else{_0x72a65=util[_0x9dbb('0x7a')](_0x9dbb('0xe3'),_0x404dd7[_0x9dbb('0x48')]);}socket['to'](util[_0x9dbb('0x7a')]('user:%s',_0x404dd7[_0x9dbb('0x48')]))[_0x9dbb('0xa9')]('user:forcelogout',{'ip':_0x2e2344['headers'][_0x9dbb('0xe4')]||_0x2e2344[_0x9dbb('0xe5')]['remoteAddress']||_0x2e2344[_0x9dbb('0xe6')][_0x9dbb('0xe7')]||_0x2e2344[_0x9dbb('0xe5')]['socket'][_0x9dbb('0xe7')]});return db[_0x9dbb('0xb1')][_0x9dbb('0x3c')]({'where':{'membername':_0x404dd7['name']},'individualHooks':!![]});}}else{throw new db[(_0x9dbb('0x21'))]['ValidationError'](_0x9dbb('0xe8'));}})[_0x9dbb('0x3b')](function(){if(_0x404dd7){return _0x404dd7[_0x9dbb('0xe9')]({'raw':!![]});}})['then'](function(_0x539b86){if(_0x404dd7){var _0x52b891=[];if(_0x539b86){_0x239132=_0x539b86;if(_0x239132['length']){for(var _0x12af33=0x0;_0x12af33<_0x239132[_0x9dbb('0x57')];_0x12af33++){_0x52b891[_0x9dbb('0xae')]({'membername':_0x404dd7[_0x9dbb('0x48')],'UserId':_0x404dd7['id'],'queue_name':_0x239132[_0x12af33][_0x9dbb('0x48')],'VoiceQueueId':_0x239132[_0x12af33]['id'],'interface':_0x72a65,'paused':_0x404dd7[_0x9dbb('0xa3')]||![],'penalty':_0x239132[_0x12af33]['UserVoiceQueue.penalty']||0x0});}return BPromise['each'](_0x52b891,function(_0x23d744){return db[_0x9dbb('0xb1')]['upsert'](_0x23d744);});}}}})[_0x9dbb('0x3b')](function(){if(_0x404dd7){return db['MemberReport'][_0x9dbb('0xac')]({'where':{'membername':_0x404dd7[_0x9dbb('0x48')],'exitAt':null}});}})[_0x9dbb('0x3b')](function(_0x456432){if(_0x404dd7){var _0x1fcf9b=[];_0x456432[_0x9dbb('0xea')](function(_0x168750){_0x1fcf9b[_0x9dbb('0xae')](_0x168750['update']({'exitAt':moment()[_0x9dbb('0x7a')](_0x9dbb('0xeb'))}));});return BPromise[_0x9dbb('0xec')](_0x1fcf9b);}})[_0x9dbb('0x3b')](function(){if(_0x404dd7){var _0x11bde2=[];var _0x1e4ea1=[];var _0x59b4d8=utils[_0x9dbb('0xed')]();var _0x114d4f={'membername':_0x404dd7[_0x9dbb('0x48')],'interface':_0x72a65,'enterAt':moment()[_0x9dbb('0x7a')](_0x9dbb('0xeb')),'role':_0x404dd7[_0x9dbb('0x47')],'internal':_0x404dd7[_0x9dbb('0x81')]};_0x59b4d8[_0x9dbb('0xea')](function(_0x553a43){_0x11bde2[_0x9dbb('0xae')](_[_0x9dbb('0x5d')]({'channel':_0x553a43,'type':_0x9dbb('0xee'),'data1':_0x2e2344[_0x9dbb('0x6c')]['device'],'data2':_0x72a65},_0x114d4f));if(_0x404dd7['loginInPause']){_0x1e4ea1['push'](_[_0x9dbb('0x5d')]({'channel':_0x553a43,'type':'PAUSE','data1':_0x9dbb('0xef')},_0x114d4f));}});return db[_0x9dbb('0xf0')][_0x9dbb('0x6b')](_0x11bde2[_0x9dbb('0xf1')](_0x1e4ea1),{'individualHooks':!![]});}})[_0x9dbb('0x3b')](function(){if(_0x404dd7){return _0x404dd7[_0x9dbb('0x3a')]({'online':!![],'lastLoginAt':moment()[_0x9dbb('0x7a')](_0x9dbb('0xeb')),'voicePause':_0x404dd7['loginInPause']||![],'mailPause':_0x404dd7[_0x9dbb('0xa3')]||![],'chatPause':_0x404dd7['loginInPause']||![],'faxPause':_0x404dd7[_0x9dbb('0xa3')]||![],'smsPause':_0x404dd7['loginInPause']||![],'openchannelPause':_0x404dd7['loginInPause']||![],'pauseType':_0x404dd7['loginInPause']?'LOGININPAUSE':null,'interface':_0x72a65,'lastPauseAt':moment()[_0x9dbb('0x7a')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x9dbb('0x3b')](function(_0x10028d){if(_0x2e2344['isMiddleware']){return _0x384e9f();}else{return BPromise['resolve'](_0x10028d)[_0x9dbb('0x3b')](respondWithResult(_0x2e112c,null));}})[_0x9dbb('0x2e')](handleError(_0x2e112c,null));};exports[_0x9dbb('0xf2')]=function(_0x3223a6,_0x5efba1,_0x2d6435){var _0x468e0c;return db[_0x9dbb('0x4d')][_0x9dbb('0x6d')]({'where':{'id':_0x3223a6['params']['id'],'role':_0x9dbb('0x41')},'attributes':['id','name',_0x9dbb('0x47')]})[_0x9dbb('0x3b')](handleEntityNotFound(_0x5efba1,null))['then'](function(_0x3a3c71){if(_0x3a3c71){_0x468e0c=_0x3a3c71;return db[_0x9dbb('0xb1')][_0x9dbb('0x3c')]({'where':{'membername':_0x468e0c[_0x9dbb('0x48')]},'individualHooks':!![]});}})[_0x9dbb('0x3b')](function(){return db[_0x9dbb('0xf0')][_0x9dbb('0xac')]({'where':{'membername':_0x468e0c[_0x9dbb('0x48')],'exitAt':null}});})[_0x9dbb('0x3b')](function(_0x26d9a0){var _0x44a2a6=[];_0x26d9a0[_0x9dbb('0xea')](function(_0x366c3c){_0x44a2a6[_0x9dbb('0xae')](_0x366c3c[_0x9dbb('0x3a')]({'exitAt':moment()[_0x9dbb('0x7a')](_0x9dbb('0xeb'))}));});return BPromise[_0x9dbb('0xec')](_0x44a2a6);})['then'](function(){return _0x468e0c[_0x9dbb('0x3a')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})[_0x9dbb('0x3b')](respondWithResult(_0x5efba1,null))[_0x9dbb('0x2e')](handleError(_0x5efba1,null));};exports[_0x9dbb('0xf3')]=function(_0x412508,_0x1d5958,_0x4d2553){var _0x46b174;return db[_0x9dbb('0xb1')][_0x9dbb('0x3a')]({'paused':0x1},{'where':{'UserId':_0x412508['params']['id']},'individualHooks':!![]})[_0x9dbb('0x3b')](function(){return db['User']['find']({'where':{'id':_0x412508[_0x9dbb('0x66')]['id'],'role':_0x9dbb('0x41')},'attributes':['id',_0x9dbb('0x48'),_0x9dbb('0x47'),_0x9dbb('0x81'),_0x9dbb('0xaf')]});})[_0x9dbb('0x3b')](handleEntityNotFound(_0x1d5958,null))[_0x9dbb('0x3b')](function(_0x51ed5f){if(_0x51ed5f){_0x46b174=_0x51ed5f;return respondWithRpcPromise(_0x9dbb('0xf4'),_0x9dbb('0xf3'),{'id':_0x46b174['id'],'name':_0x46b174[_0x9dbb('0x48')],'pause':!![]});}})[_0x9dbb('0x3b')](function(){if(_0x46b174){return db['MemberReport'][_0x9dbb('0xac')]({'where':{'membername':_0x46b174['name'],'type':_0x9dbb('0xf5'),'exitAt':null}});}})['then'](function(_0x10e622){if(_0x10e622[_0x9dbb('0x57')]){var _0x37694c=moment()[_0x9dbb('0x7a')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x3e8cfd=0x0,_0x476f75=_0x10e622[_0x9dbb('0x57')];_0x3e8cfd<_0x476f75;_0x3e8cfd++){_0x10e622[_0x3e8cfd][_0x9dbb('0xf6')]({'exitAt':_0x37694c});}}})[_0x9dbb('0x3b')](function(){var _0x5caa97=[];var _0x226cfb=utils[_0x9dbb('0xed')]();_0x226cfb[_0x9dbb('0xea')](function(_0x6ccf92){_0x5caa97['push']({'channel':_0x6ccf92,'membername':_0x46b174[_0x9dbb('0x48')],'interface':_[_0x9dbb('0x78')](_0x46b174[_0x9dbb('0xaf')])?util[_0x9dbb('0x7a')]('SIP/%s',_0x46b174['name']):_0x46b174[_0x9dbb('0xaf')],'type':'PAUSE','enterAt':moment()[_0x9dbb('0x7a')](_0x9dbb('0xeb')),'data1':_0x412508['body'][_0x9dbb('0x4f')]||_0x9dbb('0xf7'),'role':_0x46b174[_0x9dbb('0x47')],'internal':_0x46b174[_0x9dbb('0x81')]});});return db[_0x9dbb('0xf0')][_0x9dbb('0x6b')](_0x5caa97,{'individualHooks':!![]});})['then'](function(){return _0x46b174[_0x9dbb('0x3a')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x412508[_0x9dbb('0x6c')][_0x9dbb('0x4f')]||_0x9dbb('0xf7'),'lastPauseAt':moment()[_0x9dbb('0x7a')](_0x9dbb('0xeb'))});})[_0x9dbb('0x3b')](respondWithResult(_0x1d5958,null))[_0x9dbb('0x2e')](handleError(_0x1d5958,null));};exports[_0x9dbb('0xf8')]=function(_0x2951a7,_0x5861aa,_0x54ab97){var _0x38adb4;return db[_0x9dbb('0x4d')][_0x9dbb('0x6d')]({'where':{'id':_0x2951a7[_0x9dbb('0x66')]['id']},'attributes':['id','name',_0x9dbb('0x47'),_0x9dbb('0xb0'),'mailPause','chatPause','faxPause',_0x9dbb('0xf9'),_0x9dbb('0xfa'),_0x9dbb('0xfb'),_0x9dbb('0xfc')]})[_0x9dbb('0x3b')](handleEntityNotFound(_0x5861aa,null))['then'](function(_0x20e598){if(_0x20e598){_0x38adb4=_0x20e598;if(_0x2951a7[_0x9dbb('0x6c')][_0x9dbb('0xa2')]&&!utils[_0x9dbb('0xb4')](_0x2951a7[_0x9dbb('0x6c')][_0x9dbb('0xa2')])){throw new db[(_0x9dbb('0x21'))][(_0x9dbb('0x22'))](_0x9dbb('0xb5'));}switch(_0x2951a7[_0x9dbb('0x6c')]['channel']){case _0x9dbb('0xab'):return respondWithRpcPromise(_0x9dbb('0xf4'),_0x9dbb('0xf8'),{'id':_0x38adb4['id'],'name':_0x38adb4['name'],'pause':![]})['then'](function(){return db[_0x9dbb('0xb1')][_0x9dbb('0x3a')]({'paused':0x0},{'where':{'UserId':_0x38adb4['id']},'individualHooks':!![]});})['then'](function(){return db[_0x9dbb('0xf0')]['find']({'where':{'channel':_0x2951a7['body'][_0x9dbb('0xa2')],'membername':_0x38adb4['name'],'type':_0x9dbb('0xf5'),'exitAt':null}});})['then'](function(_0x38d829){if(_0x38d829){return _0x38d829[_0x9dbb('0x3a')]({'exitAt':moment()[_0x9dbb('0x7a')](_0x9dbb('0xeb')),'data2':_0x9dbb('0xfd')},{'individualHooks':!![]});}return null;})[_0x9dbb('0x3b')](function(){return _0x38adb4[_0x9dbb('0x3a')]({'voicePause':![]});});case _0x9dbb('0xfe'):case _0x9dbb('0xff'):case _0x9dbb('0x100'):case'sms':case _0x9dbb('0x101'):return db['MemberReport'][_0x9dbb('0x6d')]({'where':{'channel':_0x2951a7[_0x9dbb('0x6c')][_0x9dbb('0xa2')],'membername':_0x38adb4[_0x9dbb('0x48')],'type':'PAUSE','exitAt':null}})['then'](function(_0x21dc67){if(_0x21dc67){return _0x21dc67['update']({'exitAt':moment()[_0x9dbb('0x7a')](_0x9dbb('0xeb')),'data2':_0x9dbb('0xfd')},{'individualHooks':!![]});}return null;})[_0x9dbb('0x3b')](function(){var _0x13135c={};_[_0x9dbb('0x35')](_0x13135c,util[_0x9dbb('0x7a')](_0x9dbb('0x102'),_0x2951a7[_0x9dbb('0x6c')][_0x9dbb('0xa2')],'Pause'),![]);return _0x38adb4[_0x9dbb('0x3a')](_0x13135c);});default:return respondWithRpcPromise(_0x9dbb('0xf4'),_0x9dbb('0xf8'),{'id':_0x38adb4['id'],'name':_0x38adb4[_0x9dbb('0x48')],'pause':![]})['then'](function(){return db['UserVoiceQueueRt'][_0x9dbb('0x3a')]({'paused':0x0},{'where':{'UserId':_0x38adb4['id']}});})['then'](function(){return db[_0x9dbb('0xf0')][_0x9dbb('0xac')]({'where':{'membername':_0x38adb4['name'],'type':_0x9dbb('0xf5'),'exitAt':null}});})[_0x9dbb('0x3b')](function(_0x3860b2){var _0x594f32=[];_0x3860b2[_0x9dbb('0xea')](function(_0x56c875){_0x594f32['push'](_0x56c875[_0x9dbb('0x3a')]({'exitAt':moment()[_0x9dbb('0x7a')](_0x9dbb('0xeb')),'data2':_0x9dbb('0xfd')}));});return BPromise['all'](_0x594f32);})[_0x9dbb('0x3b')](function(){return _0x38adb4[_0x9dbb('0x3a')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0x9dbb('0x3b')](respondWithResult(_0x5861aa,null))[_0x9dbb('0x2e')](handleError(_0x5861aa,null));};exports[_0x9dbb('0x103')]=function(_0x17eba4,_0x1585df,_0x595d0c){var _0x5e32a0={};var _0x43073d={};var _0x53667c;var _0x2a6fe9;return db[_0x9dbb('0x4d')][_0x9dbb('0x9a')]({'where':{'id':_0x17eba4[_0x9dbb('0x66')]['id']}})['then'](handleEntityNotFound(_0x1585df,null))[_0x9dbb('0x3b')](function(_0x415cf4){if(_0x415cf4){_0x53667c=_0x415cf4;_0x43073d[_0x9dbb('0x50')]=_[_0x9dbb('0x52')](db[_0x9dbb('0x104')]['rawAttributes']);_0x43073d[_0x9dbb('0x51')]=_[_0x9dbb('0x52')](_0x17eba4[_0x9dbb('0x51')]);_0x43073d[_0x9dbb('0x53')]=_[_0x9dbb('0x54')](_0x43073d['model'],_0x43073d[_0x9dbb('0x51')]);_0x5e32a0[_0x9dbb('0x55')]=_['intersection'](_0x43073d['model'],qs[_0x9dbb('0x56')](_0x17eba4[_0x9dbb('0x51')][_0x9dbb('0x56')]));_0x5e32a0[_0x9dbb('0x55')]=_0x5e32a0['attributes'][_0x9dbb('0x57')]?_0x5e32a0[_0x9dbb('0x55')]:_0x43073d[_0x9dbb('0x50')];_0x5e32a0['order']=qs['sort'](_0x17eba4[_0x9dbb('0x51')][_0x9dbb('0x5a')]);_0x5e32a0[_0x9dbb('0x5b')]=qs[_0x9dbb('0x53')](_[_0x9dbb('0x5c')](_0x17eba4[_0x9dbb('0x51')],_0x43073d[_0x9dbb('0x53')]));if(_0x17eba4[_0x9dbb('0x51')][_0x9dbb('0x43')]){_0x5e32a0[_0x9dbb('0x5b')]=_['merge'](_0x5e32a0[_0x9dbb('0x5b')],{'$or':_['map'](_0x5e32a0['attributes'],function(_0x3d0940){var _0x11559b={};_0x11559b[_0x3d0940]={'$like':'%'+_0x17eba4[_0x9dbb('0x51')][_0x9dbb('0x43')]+'%'};return _0x11559b;})});}_0x5e32a0=_[_0x9dbb('0x5d')]({},_0x5e32a0,_0x17eba4[_0x9dbb('0x6a')]);return _0x53667c[_0x9dbb('0x103')](_0x5e32a0);}})['then'](function(_0x5cba28){if(_0x5cba28){_0x2a6fe9=_0x5cba28[_0x9dbb('0x57')];if(!_0x17eba4[_0x9dbb('0x51')]['hasOwnProperty']('nolimit')){_0x5e32a0[_0x9dbb('0x34')]=qs['limit'](_0x17eba4[_0x9dbb('0x51')][_0x9dbb('0x34')]);_0x5e32a0[_0x9dbb('0x33')]=qs[_0x9dbb('0x33')](_0x17eba4['query'][_0x9dbb('0x33')]);}return _0x53667c[_0x9dbb('0x103')](_0x5e32a0);}})[_0x9dbb('0x3b')](function(_0x53d9ab){if(_0x53d9ab){return _0x53d9ab?{'count':_0x2a6fe9,'rows':_0x53d9ab}:null;}})[_0x9dbb('0x3b')](respondWithResult(_0x1585df,null))[_0x9dbb('0x2e')](handleError(_0x1585df,null));};exports[_0x9dbb('0x105')]=function(_0x2fd7a5,_0x31aea3){return db[_0x9dbb('0x4d')][_0x9dbb('0x6d')]({'where':{'id':_0x2fd7a5[_0x9dbb('0x66')]['id']}})[_0x9dbb('0x3b')](handleEntityNotFound(_0x31aea3,null))[_0x9dbb('0x3b')](function(_0x18b069){if(_0x18b069){var _0x345ffe=_0x18b069[_0x9dbb('0x3d')]({'plain':!![]});return _0x18b069[_0x9dbb('0x105')](_0x2fd7a5['body']['ids'],_[_0x9dbb('0x71')](_0x2fd7a5[_0x9dbb('0x6c')],['ids','id'])||{})[_0x9dbb('0x3b')](function(){for(var _0x4e0985=0x0;_0x4e0985<_0x2fd7a5[_0x9dbb('0x6c')][_0x9dbb('0x70')][_0x9dbb('0x57')];_0x4e0985++){var _0x1dcf94=[];db['Team'][_0x9dbb('0x9a')]({'where':{'id':_0x2fd7a5['body'][_0x9dbb('0x70')][_0x4e0985]}})[_0x9dbb('0x3b')](function(_0x103802){_0x1dcf94[_0x9dbb('0xae')](_0x103802['getVoiceQueues']()[_0x9dbb('0x3b')](function(_0x1ddb8f){for(var _0x1b6b94=0x0;_0x1b6b94<_0x1ddb8f[_0x9dbb('0x57')];_0x1b6b94++){_0x1ddb8f[_0x1b6b94][_0x9dbb('0x106')](_0x9dbb('0xa2'),_0x9dbb('0x107'));}return _0x1ddb8f;}));_0x1dcf94['push'](_0x103802[_0x9dbb('0x108')]()[_0x9dbb('0x3b')](function(_0x1f74cf){for(var _0x4cad98=0x0;_0x4cad98<_0x1f74cf['length'];_0x4cad98++){_0x1f74cf[_0x4cad98]['setDataValue'](_0x9dbb('0xa2'),_0x9dbb('0x109'));}return _0x1f74cf;}));_0x1dcf94['push'](_0x103802['getMailQueues']()[_0x9dbb('0x3b')](function(_0x6d7c4b){for(var _0x1269b6=0x0;_0x1269b6<_0x6d7c4b['length'];_0x1269b6++){_0x6d7c4b[_0x1269b6][_0x9dbb('0x106')](_0x9dbb('0xa2'),_0x9dbb('0x10a'));}return _0x6d7c4b;}));_0x1dcf94[_0x9dbb('0xae')](_0x103802[_0x9dbb('0x10b')]()[_0x9dbb('0x3b')](function(_0x3588c4){for(var _0x4f29c0=0x0;_0x4f29c0<_0x3588c4['length'];_0x4f29c0++){_0x3588c4[_0x4f29c0][_0x9dbb('0x106')]('channel',_0x9dbb('0x10c'));}return _0x3588c4;}));_0x1dcf94[_0x9dbb('0xae')](_0x103802[_0x9dbb('0x10d')]()[_0x9dbb('0x3b')](function(_0x505703){for(var _0x1ffb67=0x0;_0x1ffb67<_0x505703[_0x9dbb('0x57')];_0x1ffb67++){_0x505703[_0x1ffb67][_0x9dbb('0x106')]('channel','Fax');}return _0x505703;}));_0x1dcf94['push'](_0x103802['getOpenchannelQueues']()[_0x9dbb('0x3b')](function(_0x11b142){for(var _0x57ff0f=0x0;_0x57ff0f<_0x11b142[_0x9dbb('0x57')];_0x57ff0f++){_0x11b142[_0x57ff0f][_0x9dbb('0x106')](_0x9dbb('0xa2'),_0x9dbb('0x10e'));}return _0x11b142;}));return BPromise[_0x9dbb('0xec')](_0x1dcf94);})['then'](function(_0x33d190){var _0x1e6628=_[_0x9dbb('0x10f')](_0x33d190);_0x1dcf94=[];return db[_0x9dbb('0x5e')][_0x9dbb('0x110')](function(_0x36ef2e){for(var _0x287c8a=0x0;_0x287c8a<_0x1e6628[_0x9dbb('0x57')];_0x287c8a++){_0x1dcf94['push'](_0x1e6628[_0x287c8a][_0x9dbb('0x111')](_0x345ffe['id']),{'transaction':_0x36ef2e});}return BPromise[_0x9dbb('0xec')](_0x1dcf94)[_0x9dbb('0x3b')](function(){if(_0x345ffe[_0x9dbb('0xad')]){return BPromise[_0x9dbb('0x112')](_['filter'](_0x1e6628,function(_0x58243a){return _0x58243a['getDataValue'](_0x9dbb('0xa2'))===_0x9dbb('0x107');}),function(_0x466734){return db[_0x9dbb('0xb1')][_0x9dbb('0xb2')]({'membername':_0x345ffe[_0x9dbb('0x48')],'UserId':_0x345ffe['id'],'queue_name':_0x466734[_0x9dbb('0x48')],'VoiceQueueId':_0x466734['id'],'interface':_[_0x9dbb('0x78')](_0x345ffe[_0x9dbb('0xaf')])?util[_0x9dbb('0x7a')](_0x9dbb('0xe3'),_0x345ffe[_0x9dbb('0x48')]):_0x345ffe['interface'],'paused':_0x345ffe[_0x9dbb('0xb0')]||![],'penalty':_0x345ffe[_0x9dbb('0xa7')]},{'transaction':_0x36ef2e});});}else{return;}})[_0x9dbb('0x3b')](function(){for(var _0x2a3c82=0x0;_0x2a3c82<_0x1e6628['length'];_0x2a3c82++){var _0x11651d=_0x1e6628[_0x2a3c82][_0x9dbb('0x113')]('channel');var _0x372ae9=_0x11651d+'QueueId';socket[_0x9dbb('0xa9')](_0x9dbb('0x3f')+_0x11651d+_0x9dbb('0xaa'),{'UserId':_0x345ffe['id'],['queueField']:_0x1e6628[_0x2a3c82]['id']});}});});});}});}})[_0x9dbb('0x3b')](respondWithStatusCode(_0x31aea3,null))['catch'](handleError(_0x31aea3,null));};exports[_0x9dbb('0x114')]=function(_0x39e550,_0x3e037b){return db[_0x9dbb('0x4d')][_0x9dbb('0x9a')]({'where':{'id':_0x39e550['params']['id']}})[_0x9dbb('0x3b')](handleEntityNotFound(_0x3e037b,null))[_0x9dbb('0x3b')](function(_0x2aa352){if(_0x2aa352){var _0x398800=_0x2aa352[_0x9dbb('0x3d')]({'plain':!![]});var _0xac7f71=_0x39e550['query']['ids'];return _0x2aa352[_0x9dbb('0x114')](_0xac7f71)[_0x9dbb('0x3b')](function(){for(var _0x4426ac=0x0;_0x4426ac<_0xac7f71[_0x9dbb('0x57')];_0x4426ac++){var _0x5a3abe=[];db[_0x9dbb('0x104')][_0x9dbb('0x9a')]({'where':{'id':_0xac7f71[_0x4426ac]}})[_0x9dbb('0x3b')](function(_0x15bce2){_0x5a3abe[_0x9dbb('0xae')](_0x15bce2['getVoiceQueues']()[_0x9dbb('0x3b')](function(_0x2bc3d2){for(var _0x431f40=0x0;_0x431f40<_0x2bc3d2[_0x9dbb('0x57')];_0x431f40++){_0x2bc3d2[_0x431f40]['setDataValue'](_0x9dbb('0xa2'),_0x9dbb('0x107'));}return _0x2bc3d2;}));_0x5a3abe[_0x9dbb('0xae')](_0x15bce2[_0x9dbb('0x108')]()[_0x9dbb('0x3b')](function(_0x33e380){for(var _0x368aad=0x0;_0x368aad<_0x33e380[_0x9dbb('0x57')];_0x368aad++){_0x33e380[_0x368aad][_0x9dbb('0x106')](_0x9dbb('0xa2'),'Chat');}return _0x33e380;}));_0x5a3abe[_0x9dbb('0xae')](_0x15bce2['getMailQueues']()['then'](function(_0x474d6e){for(var _0x3fe830=0x0;_0x3fe830<_0x474d6e['length'];_0x3fe830++){_0x474d6e[_0x3fe830][_0x9dbb('0x106')](_0x9dbb('0xa2'),'Mail');}return _0x474d6e;}));_0x5a3abe[_0x9dbb('0xae')](_0x15bce2[_0x9dbb('0x10b')]()[_0x9dbb('0x3b')](function(_0x5544ef){for(var _0x16b0ae=0x0;_0x16b0ae<_0x5544ef[_0x9dbb('0x57')];_0x16b0ae++){_0x5544ef[_0x16b0ae][_0x9dbb('0x106')](_0x9dbb('0xa2'),'Sms');}return _0x5544ef;}));_0x5a3abe['push'](_0x15bce2[_0x9dbb('0x10d')]()[_0x9dbb('0x3b')](function(_0x71a8e6){for(var _0x1b7a2d=0x0;_0x1b7a2d<_0x71a8e6[_0x9dbb('0x57')];_0x1b7a2d++){_0x71a8e6[_0x1b7a2d][_0x9dbb('0x106')](_0x9dbb('0xa2'),_0x9dbb('0x115'));}return _0x71a8e6;}));_0x5a3abe[_0x9dbb('0xae')](_0x15bce2[_0x9dbb('0x116')]()[_0x9dbb('0x3b')](function(_0x24ceeb){for(var _0x458a81=0x0;_0x458a81<_0x24ceeb[_0x9dbb('0x57')];_0x458a81++){_0x24ceeb[_0x458a81]['setDataValue']('channel',_0x9dbb('0x10e'));}return _0x24ceeb;}));return BPromise[_0x9dbb('0xec')](_0x5a3abe);})[_0x9dbb('0x3b')](function(_0xdbb338){var _0x4bf757=_[_0x9dbb('0x10f')](_0xdbb338);_0x5a3abe=[];return db[_0x9dbb('0x5e')]['transaction'](function(_0x5792ee){for(var _0x41608a=0x0;_0x41608a<_0x4bf757[_0x9dbb('0x57')];_0x41608a++){_0x5a3abe[_0x9dbb('0xae')](_0x4bf757[_0x41608a][_0x9dbb('0x117')](_0x398800['id']),{'transaction':_0x5792ee});}return BPromise['all'](_0x5a3abe)[_0x9dbb('0x3b')](function(){if(_0x398800[_0x9dbb('0xad')]){return BPromise['each'](_[_0x9dbb('0x43')](_0x4bf757,function(_0x3d4372){return _0x3d4372[_0x9dbb('0x113')](_0x9dbb('0xa2'))===_0x9dbb('0x107');}),function(_0x34f102){return db['UserVoiceQueueRt'][_0x9dbb('0x3c')]({'where':{'VoiceQueueId':_0x34f102['id'],'UserId':_0x398800['id']},'transaction':_0x5792ee});});}else{return;}})[_0x9dbb('0x3b')](function(){for(var _0x40edd0=0x0;_0x40edd0<_0x4bf757['length'];_0x40edd0++){var _0x187599=_0x4bf757[_0x40edd0]['getDataValue'](_0x9dbb('0xa2'));var _0x259e13=_0x187599+_0x9dbb('0xa8');socket[_0x9dbb('0xa9')](_0x9dbb('0x3f')+_0x187599+_0x9dbb('0x118'),{'UserId':_0x398800['id'],['queueField']:_0x4bf757[_0x40edd0]['id']});}});});});}});}})[_0x9dbb('0x3b')](respondWithStatusCode(_0x3e037b,null))[_0x9dbb('0x2e')](handleError(_0x3e037b,null));};exports[_0x9dbb('0x119')]=function(_0x5493d0,_0x22afe9,_0x3ef4ce){var _0x380664={};var _0x466186={};var _0x562767;var _0x253ae7;return db['User']['findOne']({'where':{'id':_0x5493d0[_0x9dbb('0x66')]['id']}})[_0x9dbb('0x3b')](handleEntityNotFound(_0x22afe9,null))[_0x9dbb('0x3b')](function(_0xa8b602){if(_0xa8b602){_0x562767=_0xa8b602;_0x466186[_0x9dbb('0x50')]=_[_0x9dbb('0x52')](db['CmList'][_0x9dbb('0x4e')]);_0x466186[_0x9dbb('0x51')]=_['keys'](_0x5493d0[_0x9dbb('0x51')]);_0x466186[_0x9dbb('0x53')]=_[_0x9dbb('0x54')](_0x466186['model'],_0x466186[_0x9dbb('0x51')]);_0x380664[_0x9dbb('0x55')]=_[_0x9dbb('0x54')](_0x466186[_0x9dbb('0x50')],qs[_0x9dbb('0x56')](_0x5493d0[_0x9dbb('0x51')]['fields']));_0x380664[_0x9dbb('0x55')]=_0x380664[_0x9dbb('0x55')][_0x9dbb('0x57')]?_0x380664['attributes']:_0x466186['model'];_0x380664[_0x9dbb('0x59')]=qs[_0x9dbb('0x5a')](_0x5493d0[_0x9dbb('0x51')][_0x9dbb('0x5a')]);_0x380664[_0x9dbb('0x5b')]=qs[_0x9dbb('0x53')](_[_0x9dbb('0x5c')](_0x5493d0[_0x9dbb('0x51')],_0x466186['filters']));if(_0x5493d0[_0x9dbb('0x51')][_0x9dbb('0x43')]){_0x380664[_0x9dbb('0x5b')]=_['merge'](_0x380664[_0x9dbb('0x5b')],{'$or':_[_0x9dbb('0x44')](_0x380664[_0x9dbb('0x55')],function(_0x141f86){var _0x1edb45={};_0x1edb45[_0x141f86]={'$like':'%'+_0x5493d0[_0x9dbb('0x51')][_0x9dbb('0x43')]+'%'};return _0x1edb45;})});}_0x380664=_['merge']({},_0x380664,_0x5493d0[_0x9dbb('0x6a')]);return _0x562767[_0x9dbb('0x119')](_0x380664);}})[_0x9dbb('0x3b')](function(_0x298ad2){if(_0x298ad2){_0x253ae7=_0x298ad2['length'];if(!_0x5493d0[_0x9dbb('0x51')][_0x9dbb('0xc9')](_0x9dbb('0x58'))){_0x380664['limit']=qs[_0x9dbb('0x34')](_0x5493d0[_0x9dbb('0x51')][_0x9dbb('0x34')]);_0x380664[_0x9dbb('0x33')]=qs[_0x9dbb('0x33')](_0x5493d0['query'][_0x9dbb('0x33')]);}return _0x562767[_0x9dbb('0x119')](_0x380664);}})[_0x9dbb('0x3b')](function(_0x251070){if(_0x251070){return _0x251070?{'count':_0x253ae7,'rows':_0x251070}:null;}})[_0x9dbb('0x3b')](respondWithResult(_0x22afe9,null))[_0x9dbb('0x2e')](handleError(_0x22afe9,null));};exports[_0x9dbb('0x11a')]=function(_0x258825,_0x543f9d,_0x4d316f){var _0x328753={};var _0xcf7f69={};var _0x3a88fb;var _0x3b9538;return db[_0x9dbb('0x4d')][_0x9dbb('0x9a')]({'where':{'id':_0x258825[_0x9dbb('0x66')]['id']}})[_0x9dbb('0x3b')](handleEntityNotFound(_0x543f9d,null))[_0x9dbb('0x3b')](function(_0x3a78d5){if(_0x3a78d5){_0x3a88fb=_0x3a78d5;_0xcf7f69[_0x9dbb('0x50')]=_['keys'](db[_0x9dbb('0x4d')][_0x9dbb('0x4e')]);_0xcf7f69[_0x9dbb('0x51')]=_[_0x9dbb('0x52')](_0x258825[_0x9dbb('0x51')]);_0xcf7f69['filters']=_[_0x9dbb('0x54')](_0xcf7f69[_0x9dbb('0x50')],_0xcf7f69[_0x9dbb('0x51')]);_0x328753['attributes']=_[_0x9dbb('0x54')](_0xcf7f69[_0x9dbb('0x50')],qs[_0x9dbb('0x56')](_0x258825[_0x9dbb('0x51')][_0x9dbb('0x56')]));_0x328753[_0x9dbb('0x55')]=_0x328753[_0x9dbb('0x55')][_0x9dbb('0x57')]?_0x328753[_0x9dbb('0x55')]:_0xcf7f69[_0x9dbb('0x50')];_0x328753[_0x9dbb('0x59')]=qs[_0x9dbb('0x5a')](_0x258825['query'][_0x9dbb('0x5a')]);_0x328753['where']=qs['filters'](_[_0x9dbb('0x5c')](_0x258825[_0x9dbb('0x51')],_0xcf7f69[_0x9dbb('0x53')]));if(_0x258825[_0x9dbb('0x51')][_0x9dbb('0x43')]){_0x328753[_0x9dbb('0x5b')]=_[_0x9dbb('0x5d')](_0x328753[_0x9dbb('0x5b')],{'$or':_[_0x9dbb('0x44')](_0x328753[_0x9dbb('0x55')],function(_0x6708d4){var _0x38301c={};_0x38301c[_0x6708d4]={'$like':'%'+_0x258825[_0x9dbb('0x51')][_0x9dbb('0x43')]+'%'};return _0x38301c;})});}_0x328753[_0x9dbb('0x50')]=db[_0x9dbb('0x4d')];_0x328753['as']=_0x9dbb('0x40');_0x328753=_[_0x9dbb('0x5d')]({},_0x328753,_0x258825[_0x9dbb('0x6a')]);return _0x3a88fb[_0x9dbb('0xe9')]({'include':[_0x328753]});}})[_0x9dbb('0x3b')](function(_0x4ce383){if(_0x4ce383){var _0x545797={},_0x50b15d=[],_0x541214=0x0;for(var _0x1946ce=0x0;_0x1946ce<_0x4ce383[_0x9dbb('0x57')];_0x1946ce+=0x1){for(var _0xac3729=0x0,_0x339d49;_0xac3729<_0x4ce383[_0x1946ce]['Agents'][_0x9dbb('0x57')];_0xac3729+=0x1){_0x339d49=_0x4ce383[_0x1946ce][_0x9dbb('0x40')][_0xac3729][_0x9dbb('0x3d')]({'plain':!![]});_0x545797[_0x339d49['id']]=_0x339d49;}}_0x545797=_[_0x9dbb('0x11b')](_0x545797);for(var _0x4c28f1=qs[_0x9dbb('0x33')](_0x258825[_0x9dbb('0x51')][_0x9dbb('0x33')]);_0x4c28f1<_0x545797[_0x9dbb('0x57')]&&_0x50b15d[_0x9dbb('0x57')]=_0x1a9eea){_0x138318=_0x1a9eea;_0x135f46=0xc8;}else{_0x135f46=0xce;}_0xe066d8[_0x6709('0x2d')](_0x135f46);return _0xe066d8[_0x6709('0x30')](_0x6709('0x31'),_0x5deff5+'-'+_0x138318+'/'+_0x1a9eea)[_0x6709('0x32')](_0x4ad1c3);}return null;};}function patchUpdates(_0x69593c){return function(_0x402e45){try{jsonpatch[_0x6709('0x33')](_0x402e45,_0x69593c,!![]);}catch(_0x5d399b){return BPromise[_0x6709('0x34')](_0x5d399b);}return _0x402e45[_0x6709('0x35')]();};}function saveUpdates(_0x3cfbe6,_0x27e929){return function(_0x5dc856){if(_0x5dc856){return _0x5dc856[_0x6709('0x36')](_0x3cfbe6)[_0x6709('0x37')](function(_0x124e01){return _0x124e01;});}return null;};}function removeEntity(_0x1bd075,_0x4fd344){return function(_0x3bfc6d){if(_0x3bfc6d){return _0x3bfc6d[_0x6709('0x38')]()['then'](function(){var _0x8952f1=_0x3bfc6d[_0x6709('0x39')]({'plain':!![]});var _0x5aa83b=[{'name':_0x6709('0x3a'),'value':_0x6709('0x3b'),'ignore':!![]},{'name':_0x6709('0x3c'),'value':_0x6709('0x3d'),'ignore':![]},{'name':_0x6709('0x3e'),'value':_0x6709('0x3f'),'ignore':![]}];var _0x2cd68b=_(_0x5aa83b)['filter'](_0x6709('0x40'))[_0x6709('0x41')]('value')[_0x6709('0x42')]();if(_[_0x6709('0x43')](_0x2cd68b,_0x8952f1[_0x6709('0x44')])){return;}var _0x2bb89c=_[_0x6709('0x45')](_0x5aa83b,[_0x6709('0x42'),_0x8952f1['role']])[_0x6709('0x46')];return db['UserProfileResource'][_0x6709('0x38')]({'where':{'type':_0x2bb89c,'resourceId':_0x8952f1['id']}})[_0x6709('0x37')](function(){return _0x3bfc6d;});})[_0x6709('0x37')](function(){_0x1bd075['status'](0xcc)[_0x6709('0x47')]();});}};}function handleEntityNotFound(_0x300c5b,_0x2d9879){return function(_0x3f06d8){if(!_0x3f06d8){_0x300c5b[_0x6709('0x48')](0x194);}return _0x3f06d8;};}function handleError(_0x1030ee,_0x450654){_0x450654=_0x450654||0x1f4;return function(_0x4fd4af){logger[_0x6709('0x29')](_0x4fd4af[_0x6709('0x49')]);if(_0x4fd4af[_0x6709('0x46')]){delete _0x4fd4af[_0x6709('0x46')];}_0x1030ee[_0x6709('0x2d')](_0x450654)[_0x6709('0x4a')](_0x4fd4af);};}exports[_0x6709('0x4b')]=function(_0x5ef9e2,_0x5abb53){var _0x265750={},_0x3f0da1={},_0x98a12c={'count':0x0,'rows':[]};var _0x42790d=_['map'](db['User']['rawAttributes'],function(_0x3d4237){return{'name':_0x3d4237[_0x6709('0x4c')],'type':_0x3d4237['type'][_0x6709('0x4d')]};});_0x3f0da1[_0x6709('0x4e')]=_['differenceBy'](_['map'](_0x42790d,_0x6709('0x46')),[_0x6709('0x4f'),_0x6709('0x50')]);_0x3f0da1[_0x6709('0x51')]=_[_0x6709('0x52')](_0x5ef9e2['query']);_0x3f0da1[_0x6709('0x53')]=_['intersection'](_0x3f0da1[_0x6709('0x4e')],_0x3f0da1[_0x6709('0x51')]);_0x265750[_0x6709('0x54')]=_['intersection'](_0x3f0da1[_0x6709('0x4e')],qs['fields'](_0x5ef9e2['query'][_0x6709('0x55')]));_0x265750[_0x6709('0x54')]=_0x265750[_0x6709('0x54')][_0x6709('0x56')]?_0x265750[_0x6709('0x54')]:_0x3f0da1[_0x6709('0x4e')];if(!_0x5ef9e2[_0x6709('0x51')][_0x6709('0x57')](_0x6709('0x58'))){_0x265750[_0x6709('0x2f')]=qs[_0x6709('0x2f')](_0x5ef9e2[_0x6709('0x51')][_0x6709('0x2f')]);_0x265750[_0x6709('0x2e')]=qs[_0x6709('0x2e')](_0x5ef9e2['query'][_0x6709('0x2e')]);}_0x265750['order']=qs['sort'](_0x5ef9e2[_0x6709('0x51')][_0x6709('0x59')]);_0x265750[_0x6709('0x5a')]=qs[_0x6709('0x53')](_[_0x6709('0x5b')](_0x5ef9e2[_0x6709('0x51')],_0x3f0da1[_0x6709('0x53')]));if(_0x5ef9e2[_0x6709('0x51')]['filter']){_0x265750[_0x6709('0x5a')]=_[_0x6709('0x5c')](_0x265750[_0x6709('0x5a')],{'$or':_[_0x6709('0x41')](_0x42790d,function(_0x4c01e3){if(_0x4c01e3[_0x6709('0x5d')]!=='VIRTUAL'){return db[_0x6709('0x5e')][_0x6709('0x5a')](db[_0x6709('0x5e')]['fn'](_0x6709('0x5f'),db[_0x6709('0x5e')]['col'](_0x4c01e3[_0x6709('0x46')])),{'$like':db[_0x6709('0x5e')]['fn'](_0x6709('0x5f'),'%'+_0x5ef9e2[_0x6709('0x51')][_0x6709('0x60')]+'%')});}})});}_0x265750=_['merge']({},_0x265750,_0x5ef9e2['options']);var _0x447aa5={'where':_0x265750['where']};return db['User'][_0x6709('0x61')](_0x447aa5)[_0x6709('0x37')](function(_0x1bf824){_0x98a12c[_0x6709('0x61')]=_0x1bf824;if(_0x5ef9e2[_0x6709('0x51')][_0x6709('0x62')]){_0x265750[_0x6709('0x63')]=[{'all':!![]}];}return db[_0x6709('0x64')][_0x6709('0x65')](_0x265750);})[_0x6709('0x37')](function(_0x3c6d1f){_0x98a12c['rows']=_0x3c6d1f;return _0x98a12c;})[_0x6709('0x37')](respondWithFilteredResult(_0x5abb53,_0x265750))[_0x6709('0x2c')](handleError(_0x5abb53,null));};exports['show']=function(_0x4bec85,_0x151ec8){var _0x1b7966={'raw':![],'where':{'id':_0x4bec85[_0x6709('0x66')]['id']}},_0x14bdd3={};_0x14bdd3['model']=_[_0x6709('0x67')](_['keys'](db[_0x6709('0x64')][_0x6709('0x68')]),[_0x6709('0x4f'),_0x6709('0x50')]);_0x14bdd3[_0x6709('0x51')]=_['keys'](_0x4bec85['query']);_0x14bdd3[_0x6709('0x53')]=_[_0x6709('0x69')](_0x14bdd3['model'],_0x14bdd3[_0x6709('0x51')]);_0x1b7966[_0x6709('0x54')]=_['intersection'](_0x14bdd3[_0x6709('0x4e')],qs[_0x6709('0x55')](_0x4bec85[_0x6709('0x51')][_0x6709('0x55')]));_0x1b7966['attributes']=_0x1b7966['attributes'][_0x6709('0x56')]?_0x1b7966['attributes']:_0x14bdd3[_0x6709('0x4e')];if(_0x4bec85[_0x6709('0x51')][_0x6709('0x62')]){_0x1b7966['include']=[{'all':!![]}];}_0x1b7966=_[_0x6709('0x5c')]({},_0x1b7966,_0x4bec85['options']);return db['User'][_0x6709('0x45')](_0x1b7966)['then'](handleEntityNotFound(_0x151ec8,null))[_0x6709('0x37')](respondWithResult(_0x151ec8,null))['catch'](handleError(_0x151ec8,null));};exports[_0x6709('0x6a')]=function(_0x34f790,_0x103261){return db[_0x6709('0x64')]['bulkCreate'](_0x34f790[_0x6709('0x6b')],{'raw':![],'individualHooks':!![]})[_0x6709('0x37')](respondWithResult(_0x103261,0xc9))[_0x6709('0x2c')](handleError(_0x103261,null));};exports[_0x6709('0x36')]=function(_0x210451,_0x3d4d1c){if(_0x210451[_0x6709('0x6b')]['id']){delete _0x210451['body']['id'];}delete _0x210451[_0x6709('0x6b')][_0x6709('0x44')];return db[_0x6709('0x64')][_0x6709('0x45')]({'where':{'id':_0x210451[_0x6709('0x66')]['id']}})[_0x6709('0x37')](handleEntityNotFound(_0x3d4d1c,null))[_0x6709('0x37')](saveUpdates(_0x210451[_0x6709('0x6b')],null))[_0x6709('0x37')](respondWithResult(_0x3d4d1c,null))['catch'](handleError(_0x3d4d1c,null));};exports[_0x6709('0x6c')]=function(_0x122080,_0x50f992){return db[_0x6709('0x64')][_0x6709('0x6c')]()[_0x6709('0x37')](respondWithResult(_0x50f992,null))[_0x6709('0x2c')](handleError(_0x50f992,null));};exports[_0x6709('0x6d')]=function(_0x1df26d,_0x32db99,_0x475449){return db[_0x6709('0x64')]['find']({'where':{'id':_0x1df26d[_0x6709('0x66')]['id']}})[_0x6709('0x37')](handleEntityNotFound(_0x32db99,null))[_0x6709('0x37')](function(_0x379020){if(_0x379020){return _0x379020[_0x6709('0x6d')](_0x1df26d[_0x6709('0x6b')][_0x6709('0x6e')],_[_0x6709('0x6f')](_0x1df26d[_0x6709('0x6b')],[_0x6709('0x6e'),'id'])||{});}})[_0x6709('0x37')](respondWithResult(_0x32db99,null))['catch'](handleError(_0x32db99,null));};var getLicense=function(_0x319b7e){return new BPromise(function(_0x47f73e,_0x566d6d){var _0x336b01=0x0;_0x319b7e[_0x6709('0x6b')][_0x6709('0x44')]===_0x6709('0x3d')&&_0x47f73e(_0x6709('0x70'));return db[_0x6709('0x64')][_0x6709('0x61')]({'where':{'$or':[{'role':_0x319b7e['body']['role']===_0x6709('0x3f')?'telephone':[_0x6709('0x71'),'user']}]}})[_0x6709('0x37')](function(_0x2f1faf){_0x336b01=_0x2f1faf;return require('../../config/license/util')['getLicense']();})['then'](function(_0x278148){var _0x2faf8f=_0x319b7e[_0x6709('0x6b')][_0x6709('0x44')]===_0x6709('0x3f')?_0x6709('0x72'):_0x6709('0x73');if(!_[_0x6709('0x74')](_0x278148[_0x2faf8f])&&_0x336b01>=_0x278148[_0x2faf8f]){return _0x566d6d({'message':_0x6709('0x75')});}return _0x47f73e(util[_0x6709('0x76')](_0x6709('0x77'),_0x2faf8f,_0x336b01));})[_0x6709('0x2c')](function(_0xde3469){return _0x566d6d(_0xde3469);});});};exports['create']=function(_0x296d9f,_0x549565){return getLicense(_0x296d9f)[_0x6709('0x37')](function(_0x31800f){if(!_0x296d9f['body']['internal']){var _0x18fe97;return db['Setting']['findById'](0x1)[_0x6709('0x37')](function(_0x3b19ae){return checkPasswordPattern(_0x3b19ae,_0x296d9f['body'][_0x6709('0x4f')],_0x3b19ae[_0x6709('0x78')]);})[_0x6709('0x37')](function(_0x3ef64c){_0x18fe97=_0x3ef64c[_0x6709('0x79')];return db['User']['max'](_0x6709('0x7a'));})[_0x6709('0x37')](function(_0x5906aa){if(_[_0x6709('0x74')](_0x5906aa)){if(_0x18fe97){_0x296d9f[_0x6709('0x6b')][_0x6709('0x7a')]=_0x18fe97;}else{_0x296d9f['body'][_0x6709('0x7a')]=0x1;}}else{if(_[_0x6709('0x74')](_0x18fe97)||_0x18fe97==_0x5906aa){_0x296d9f[_0x6709('0x6b')][_0x6709('0x7a')]=_0x5906aa+0x1;}else if(_0x18fe97>_0x5906aa){_0x296d9f['body']['internal']=_0x18fe97;}else{return db[_0x6709('0x5e')][_0x6709('0x51')](_0x6709('0x7b'),{'type':db[_0x6709('0x5e')][_0x6709('0x7c')]['SELECT']})[_0x6709('0x37')](function(_0x3e8e5c){if(_0x3e8e5c&&_0x3e8e5c['length']){for(var _0xea6d7=0x0,_0x12f077=_0x3e8e5c[_0x6709('0x56')];_0xea6d7<_0x12f077&&_[_0x6709('0x74')](_0x296d9f[_0x6709('0x6b')]['internal']);_0xea6d7++){if(_0x18fe97<=_0x3e8e5c[_0xea6d7][_0x6709('0x7d')]){_0x296d9f['body'][_0x6709('0x7a')]=_0x3e8e5c[_0xea6d7]['from'];}else if(_0x18fe97>_0x3e8e5c[_0xea6d7][_0x6709('0x7d')]&&_0x18fe97<=_0x3e8e5c[_0xea6d7]['to']){_0x296d9f[_0x6709('0x6b')][_0x6709('0x7a')]=_0x18fe97;}}}if(_[_0x6709('0x74')](_0x296d9f['body'][_0x6709('0x7a')])){_0x296d9f[_0x6709('0x6b')][_0x6709('0x7a')]=_0x5906aa+0x1;}});}}});}})[_0x6709('0x37')](function(){if(_0x296d9f[_0x6709('0x6b')][_0x6709('0x7e')]){_0x296d9f['body'][_0x6709('0x7f')]=_0x296d9f[_0x6709('0x6b')][_0x6709('0x7a')];_0x296d9f['body'][_0x6709('0x80')]={'mailbox':_0x296d9f[_0x6709('0x6b')]['internal'],'password':_0x296d9f[_0x6709('0x6b')][_0x6709('0x4f')],'fullname':_0x296d9f[_0x6709('0x6b')]['fullname'],'email':_0x296d9f[_0x6709('0x6b')][_0x6709('0x81')]};}if(_0x296d9f[_0x6709('0x6b')]&&_0x296d9f['body'][_0x6709('0x44')]===_0x6709('0x3d')){_0x296d9f[_0x6709('0x6b')][_0x6709('0x82')]=[_0x6709('0x83'),_0x6709('0x84'),'103',_0x6709('0x85'),_0x6709('0x86'),'105',_0x6709('0x87'),_0x6709('0x88'),_0x6709('0x89'),'109',_0x6709('0x8a'),_0x6709('0x8b')];}return db[_0x6709('0x64')][_0x6709('0x8c')](_0x296d9f[_0x6709('0x6b')],{'include':[{'model':db[_0x6709('0x80')],'as':_0x6709('0x80')}]});})['then'](function(_0x374666){if(_0x296d9f[_0x6709('0x6b')][_0x6709('0x44')]===_0x6709('0x3b'))return _0x374666;var _0x34096e=_0x296d9f[_0x6709('0x3b')][_0x6709('0x39')]({'plain':!![]});if(!_0x34096e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x34096e[_0x6709('0x44')]==='user'){var _0xae986a=_0x374666[_0x6709('0x39')]({'plain':!![]});var _0x1006d1=[{'name':_0x6709('0x3c'),'value':_0x6709('0x3d')},{'name':_0x6709('0x3e'),'value':_0x6709('0x3f')}];var _0x1c89d2=_[_0x6709('0x45')](_0x1006d1,[_0x6709('0x42'),_0xae986a[_0x6709('0x44')]])[_0x6709('0x46')];return db[_0x6709('0x8d')][_0x6709('0x45')]({'where':{'name':_0x1c89d2,'userProfileId':_0x34096e['userProfileId']},'raw':!![]})['then'](function(_0x3417bf){if(_0x3417bf&&_0x3417bf[_0x6709('0x8e')]===0x0){return db['UserProfileResource'][_0x6709('0x8c')]({'name':_0xae986a[_0x6709('0x46')],'resourceId':_0xae986a['id'],'type':_0x3417bf[_0x6709('0x46')],'sectionId':_0x3417bf['id']},{})[_0x6709('0x37')](function(){return _0x374666;});}else{return _0x374666;}})[_0x6709('0x2c')](function(_0x23fdf6){logger[_0x6709('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x23fdf6);throw _0x23fdf6;});}return _0x374666;})[_0x6709('0x37')](respondWithResult(_0x549565,0xc9))[_0x6709('0x2c')](handleError(_0x549565,null));};exports[_0x6709('0x8f')]=function(_0xa270a9,_0x5b1cc3,_0x5792e0){var _0x2d0f14=![];if(_0xa270a9[_0x6709('0x6b')]['id']){delete _0xa270a9[_0x6709('0x6b')]['id'];}return db[_0x6709('0x90')][_0x6709('0x91')]({'attributes':['id',_0x6709('0x78')]})[_0x6709('0x37')](function(_0xe17e9e){_0x2d0f14=_0xe17e9e[_0x6709('0x78')];return db[_0x6709('0x64')][_0x6709('0x45')]({'where':{'id':_0xa270a9[_0x6709('0x66')]['id']}});})['then'](function(_0x4767b7){if(_0x4767b7){if(_0x4767b7['id']==_0xa270a9[_0x6709('0x3b')]['id']){if(!_0xa270a9[_0x6709('0x6b')]['oldPassword']||!_0xa270a9[_0x6709('0x6b')][_0x6709('0x92')]){throw new db['Sequelize'][(_0x6709('0x22'))]('Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword');}if(!_0x4767b7[_0x6709('0x93')](_0xa270a9[_0x6709('0x6b')][_0x6709('0x94')])){throw new db[(_0x6709('0x21'))][(_0x6709('0x22'))](_0x6709('0x95'));}if(_0xa270a9[_0x6709('0x6b')][_0x6709('0x94')]==_0xa270a9['body'][_0x6709('0x92')]){throw new db[(_0x6709('0x21'))][(_0x6709('0x22'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}return _0x4767b7;}else if(_0xa270a9['user']['role']==_0x6709('0x71')){if(!_0xa270a9[_0x6709('0x6b')][_0x6709('0x92')]){throw new db[(_0x6709('0x21'))][(_0x6709('0x22'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}return _0x4767b7;}else if(_0xa270a9[_0x6709('0x3b')]['role']==_0x6709('0x3b')){if(!_0xa270a9[_0x6709('0x6b')][_0x6709('0x92')]){throw new db[(_0x6709('0x21'))]['ValidationError'](_0x6709('0x96'));}if(_0x4767b7[_0x6709('0x44')]!='agent'){throw new db[(_0x6709('0x21'))][(_0x6709('0x22'))](_0x6709('0x97'));}return _0x4767b7;}else{throw new db[(_0x6709('0x21'))][(_0x6709('0x22'))](_0x6709('0x97'));}}return null;})[_0x6709('0x37')](handleEntityNotFound(_0x5b1cc3,null))[_0x6709('0x37')](function(_0x4a8e76){return checkPasswordPattern(_0x4a8e76,_0xa270a9[_0x6709('0x6b')]['newPassword'],_0x2d0f14);})['then'](saveUpdates({'password':_0xa270a9['body']['newPassword'],'passwordResetAt':_0xa270a9['user']['id']==_0xa270a9['params']['id']?moment():null},null))['then'](respondWithResult(_0x5b1cc3,null))[_0x6709('0x2c')](handleError(_0x5b1cc3,null));};exports[_0x6709('0x98')]=function(_0x17e94d,_0x37fabb,_0x3932f4){var _0x158584=_0x17e94d[_0x6709('0x6b')][_0x6709('0x99')];return db['User'][_0x6709('0x45')]({'where':{'id':_0x17e94d[_0x6709('0x66')]['id']},'attributes':['id',_0x6709('0x46'),_0x6709('0x44'),_0x6709('0x9a'),_0x6709('0x9b'),_0x6709('0x9c'),_0x6709('0x9d')]})[_0x6709('0x37')](handleEntityNotFound(_0x37fabb,null))['then'](function(_0x4f73fb){if(_0x4f73fb){if(!utils[_0x6709('0x9e')](_0x158584)){throw new db['Sequelize']['ValidationError'](_0x6709('0x9f'));}return _0x4f73fb[_0x6709('0xa0')+_[_0x6709('0xa1')](_0x158584[_0x6709('0xa2')]())+_0x6709('0xa3')](_0x17e94d['body'][_0x6709('0x6e')],{'penalty':_0x17e94d['body'][_0x6709('0xa4')]||0x0})[_0x6709('0xa5')](function(_0x4f481f){for(var _0x484429=0x0;_0x484429<_0x17e94d[_0x6709('0x6b')][_0x6709('0x6e')]['length'];_0x484429+=0x1){var _0x27812b={'UserId':_0x17e94d[_0x6709('0x66')]['id']};_0x27812b[_[_0x6709('0xa1')](_0x158584[_0x6709('0xa2')]())+_0x6709('0xa6')]=_0x17e94d[_0x6709('0x6b')][_0x6709('0x6e')][_0x484429];socket['emit'](_0x6709('0x3b')+_[_0x6709('0xa1')](_0x158584[_0x6709('0xa2')]())+_0x6709('0xa7'),_0x27812b);}return _0x4f481f;})[_0x6709('0x37')](function(){if(_0x158584==='voice'){return db[_0x6709('0xa8')][_0x6709('0x65')]({'where':{'id':_0x17e94d['body']['ids']||[]},'raw':!![],'attributes':['id','name']});}})[_0x6709('0x37')](function(_0x4f6da6){var _0x3d402d=_0x4f73fb[_0x6709('0x39')]({'plain':!![]});var _0x2a296d=[];if(_0x158584===_0x6709('0xa9')&&_0x3d402d[_0x6709('0x44')]==='agent'&&_0x3d402d[_0x6709('0x9a')]){for(var _0x11b40a=0x0;_0x11b40a<_0x4f6da6[_0x6709('0x56')];_0x11b40a+=0x1){_0x2a296d[_0x6709('0xaa')]({'membername':_0x3d402d['name'],'UserId':_0x3d402d['id'],'queue_name':_0x4f6da6[_0x11b40a][_0x6709('0x46')],'VoiceQueueId':_0x4f6da6[_0x11b40a]['id'],'interface':_['isNil'](_0x3d402d['interface'])?util[_0x6709('0x76')]('SIP/%s',_0x3d402d[_0x6709('0x46')]):_0x3d402d[_0x6709('0x9d')],'paused':_0x3d402d['voicePause']||![],'penalty':_0x17e94d['body'][_0x6709('0xa4')]||0x0});}return BPromise[_0x6709('0xab')](_0x2a296d,function(_0x59542a){return db['UserVoiceQueueRt'][_0x6709('0xac')](_0x59542a);});}return _0x4f73fb;});}})[_0x6709('0x37')](respondWithStatusCode(_0x37fabb,null))['catch'](handleError(_0x37fabb,null));};exports[_0x6709('0xad')]=function(_0x41c2a2,_0x3dade9,_0x338feb){var _0x233e31;return db[_0x6709('0x64')][_0x6709('0x45')]({'where':{'id':_0x41c2a2[_0x6709('0x66')]['id']},'attributes':['id',_0x6709('0x46'),_0x6709('0x44')]})[_0x6709('0x37')](handleEntityNotFound(_0x3dade9,null))[_0x6709('0x37')](function(_0x464d2f){if(_0x464d2f){_0x233e31=_0x464d2f;if(!_0x41c2a2['query'][_0x6709('0x99')]||!utils[_0x6709('0x9e')](_0x41c2a2[_0x6709('0x51')]['channel'])){throw new db[(_0x6709('0x21'))]['ValidationError'](_0x6709('0x9f'));}return _0x464d2f['remove'+_[_0x6709('0xa1')](_0x41c2a2[_0x6709('0x51')][_0x6709('0x99')][_0x6709('0xa2')]())+_0x6709('0xa3')](_0x41c2a2['query'][_0x6709('0x6e')]);}})['then'](function(_0x3f2826){for(var _0x20b10c=0x0;_0x20b10c<_0x41c2a2[_0x6709('0x51')]['ids']['length'];_0x20b10c+=0x1){var _0x1fb84e={'UserId':_0x41c2a2[_0x6709('0x66')]['id']};_0x1fb84e[_[_0x6709('0xa1')](_0x41c2a2['query'][_0x6709('0x99')][_0x6709('0xa2')]())+_0x6709('0xa6')]=_0x41c2a2[_0x6709('0x51')][_0x6709('0x6e')][_0x20b10c];socket[_0x6709('0xae')](_0x6709('0x3b')+_['capitalize'](_0x41c2a2['query']['channel'][_0x6709('0xa2')]())+'Queue:remove',_0x1fb84e);}return _0x3f2826;})[_0x6709('0x37')](function(){if(_0x41c2a2[_0x6709('0x51')][_0x6709('0x99')]===_0x6709('0xa9')){return db[_0x6709('0xaf')]['destroy']({'where':{'UserId':_0x41c2a2['params']['id'],'VoiceQueueId':_0x41c2a2[_0x6709('0x51')][_0x6709('0x6e')]},'individualHooks':!![]})[_0x6709('0x37')](function(){return _0x233e31;});}return _0x233e31;})[_0x6709('0x37')](respondWithStatusCode(_0x3dade9,null))['catch'](handleError(_0x3dade9,null));};exports[_0x6709('0xb0')]=function(_0x18bf2a,_0xb17788,_0x27e527){_0x18bf2a[_0x6709('0x6b')][_0x6709('0xb1')]=_0x18bf2a[_0x6709('0xb2')][_0x6709('0xb3')];return db[_0x6709('0x64')][_0x6709('0x45')]({'where':{'id':_0x18bf2a[_0x6709('0x66')]['id']}})[_0x6709('0x37')](handleEntityNotFound(_0xb17788,null))[_0x6709('0x37')](saveUpdates(_0x18bf2a['body'],null))['then'](respondWithResult(_0xb17788,null))[_0x6709('0x2c')](handleError(_0xb17788,null));};exports['getAvatar']=function(_0x5f2677,_0x7cbb92,_0x5b9339){var _0x14be79=path[_0x6709('0xb4')](config[_0x6709('0xb5')],_0x6709('0xb6'));return db[_0x6709('0x64')][_0x6709('0x45')]({'where':{'id':_0x5f2677[_0x6709('0x66')]['id']},'attributes':['id',_0x6709('0xb1')],'raw':!![]})[_0x6709('0x37')](handleEntityNotFound(_0x7cbb92,null))['then'](function(_0x4bdc83){if(_0x4bdc83){if(_['isNil'](_0x4bdc83[_0x6709('0xb1')])){return _0x7cbb92[_0x6709('0xb7')](_0x14be79);}else{if(!fs[_0x6709('0xb8')](path[_0x6709('0xb4')](config[_0x6709('0xb5')],'server/files/images/',_0x4bdc83[_0x6709('0xb1')]))){return _0x7cbb92[_0x6709('0xb7')](_0x14be79);}return _0x7cbb92[_0x6709('0xb7')](path[_0x6709('0xb4')](config[_0x6709('0xb5')],_0x6709('0xb9'),_0x4bdc83['userpic']));}}})['catch'](handleError(_0x7cbb92,null));};exports['getContacts']=function(_0x53ce45,_0x20df1b,_0x2576d5){var _0x44f308={};var _0x5030e9={};var _0x4cc5cd;var _0x166855;return db[_0x6709('0x64')][_0x6709('0x91')]({'where':{'id':_0x53ce45[_0x6709('0x66')]['id']}})['then'](handleEntityNotFound(_0x20df1b,null))[_0x6709('0x37')](function(_0x4f7a5){if(_0x4f7a5){_0x4cc5cd=_0x4f7a5;_0x5030e9['model']=_['keys'](db[_0x6709('0xba')][_0x6709('0x68')]);_0x5030e9['query']=_['keys'](_0x53ce45['query']);_0x5030e9['filters']=_['intersection'](_0x5030e9[_0x6709('0x4e')],_0x5030e9[_0x6709('0x51')]);_0x44f308['attributes']=_[_0x6709('0x69')](_0x5030e9[_0x6709('0x4e')],qs[_0x6709('0x55')](_0x53ce45[_0x6709('0x51')][_0x6709('0x55')]));_0x44f308[_0x6709('0x54')]=_0x44f308[_0x6709('0x54')][_0x6709('0x56')]?_0x44f308[_0x6709('0x54')]:_0x5030e9[_0x6709('0x4e')];_0x44f308[_0x6709('0xbb')]=qs['sort'](_0x53ce45[_0x6709('0x51')][_0x6709('0x59')]);_0x44f308[_0x6709('0x5a')]=qs[_0x6709('0x53')](_[_0x6709('0x5b')](_0x53ce45[_0x6709('0x51')],_0x5030e9[_0x6709('0x53')]));if(_0x53ce45[_0x6709('0x51')]['filter']){_0x44f308['where']=_[_0x6709('0x5c')](_0x44f308[_0x6709('0x5a')],{'$or':_[_0x6709('0x41')](_0x44f308[_0x6709('0x54')],function(_0x421b40){var _0x56a88b={};_0x56a88b[_0x421b40]={'$like':'%'+_0x53ce45[_0x6709('0x51')][_0x6709('0x60')]+'%'};return _0x56a88b;})});}_0x44f308=_['merge']({},_0x44f308,_0x53ce45[_0x6709('0xbc')]);return _0x4cc5cd['getContacts'](_0x44f308);}})['then'](function(_0x13ac21){if(_0x13ac21){_0x166855=_0x13ac21[_0x6709('0x56')];if(_0x53ce45[_0x6709('0x51')]['hasOwnProperty'](_0x6709('0x62'))){_0x44f308[_0x6709('0x63')]=[{'model':db[_0x6709('0xbd')],'as':'List','required':![]},{'model':db[_0x6709('0xbe')],'as':_0x6709('0xbf'),'attributes':['id',_0x6709('0x46'),_0x6709('0xc0')],'where':_0x53ce45[_0x6709('0x51')][_0x6709('0xc1')]?{'id':_0x53ce45['query'][_0x6709('0xc1')]}:undefined,'required':_0x53ce45[_0x6709('0x51')][_0x6709('0xc1')]?!![]:![]}];}if(!_0x53ce45[_0x6709('0x51')][_0x6709('0x57')]('nolimit')){_0x44f308['limit']=qs[_0x6709('0x2f')](_0x53ce45['query']['limit']);_0x44f308['offset']=qs[_0x6709('0x2e')](_0x53ce45['query'][_0x6709('0x2e')]);}return _0x4cc5cd[_0x6709('0xc2')](_0x44f308);}})['then'](function(_0xefc289){if(_0xefc289){return _0xefc289?{'count':_0x166855,'rows':_0xefc289}:null;}})['then'](respondWithResult(_0x20df1b,null))[_0x6709('0x2c')](handleError(_0x20df1b,null));};exports[_0x6709('0xc3')]=function(_0x13f9c4,_0x554b8c,_0x4b7815){var _0x2eb9e0;var _0x58e8d8;var _0x241839={};var _0xdfe870;return db['User'][_0x6709('0x91')]({'where':{'id':_0x13f9c4[_0x6709('0x66')]['id']},'attributes':['id','name',_0x6709('0x44')]})[_0x6709('0x37')](handleEntityNotFound(_0x554b8c,null))[_0x6709('0x37')](function(_0x363591){if(!utils['isValidChannel'](_0x13f9c4[_0x6709('0x51')][_0x6709('0x99')])){throw new db[(_0x6709('0x21'))][(_0x6709('0x22'))](_0x6709('0x9f'));}_0x2eb9e0=_0x363591;var _0x53dc8e={};_0x53dc8e['model']=_[_0x6709('0x52')](db[_['capitalize'](_0x13f9c4[_0x6709('0x51')][_0x6709('0x99')])+_0x6709('0xc4')][_0x6709('0x68')]);_0x53dc8e[_0x6709('0x51')]=_[_0x6709('0x52')](_0x13f9c4[_0x6709('0x51')]);_0x53dc8e[_0x6709('0x53')]=_[_0x6709('0x69')](_0x53dc8e['model'],_0x53dc8e['query']);_0x241839[_0x6709('0x54')]=_[_0x6709('0x69')](_0x53dc8e[_0x6709('0x4e')],qs[_0x6709('0x55')](_0x13f9c4[_0x6709('0x51')]['fields']));_0x241839[_0x6709('0x54')]=_0x241839[_0x6709('0x54')][_0x6709('0x56')]?_0x241839['attributes']:_0x53dc8e[_0x6709('0x4e')];_0x241839[_0x6709('0xbb')]=qs[_0x6709('0x59')](_0x13f9c4[_0x6709('0x51')][_0x6709('0x59')]);_0x241839[_0x6709('0x5a')]=qs[_0x6709('0x53')](_['pick'](_0x13f9c4[_0x6709('0x51')],_0x53dc8e[_0x6709('0x53')]));if(_0x13f9c4[_0x6709('0x51')][_0x6709('0x60')]){_0x241839['where']=_[_0x6709('0x5c')](_0x241839[_0x6709('0x5a')],{'$or':_['map'](_0x241839[_0x6709('0x54')],function(_0x540f27){var _0x2af85e={};_0x2af85e[_0x540f27]={'$like':'%'+_0x13f9c4[_0x6709('0x51')][_0x6709('0x60')]+'%'};return _0x2af85e;})});}_0x241839=_['merge']({},_0x241839,_0x13f9c4[_0x6709('0xbc')]);switch(_0x2eb9e0[_0x6709('0x44')]){case'admin':return db[_[_0x6709('0xa1')](_0x13f9c4[_0x6709('0x51')][_0x6709('0x99')])+_0x6709('0xc4')]['findAll'](_0x241839);case _0x6709('0x3b'):case _0x6709('0x3d'):return _0x2eb9e0['get'+_[_0x6709('0xa1')](_0x13f9c4[_0x6709('0x51')][_0x6709('0x99')])+_0x6709('0xa3')](_0x241839);default:throw new db[(_0x6709('0x21'))][(_0x6709('0x22'))](_0x6709('0xc5'));}})[_0x6709('0x37')](function(_0x33c14c){_0xdfe870=_0x33c14c[_0x6709('0x56')];if(!_0x13f9c4[_0x6709('0x51')]['hasOwnProperty']('nolimit')){_0x241839['limit']=qs[_0x6709('0x2f')](_0x13f9c4[_0x6709('0x51')][_0x6709('0x2f')]);_0x241839[_0x6709('0x2e')]=qs[_0x6709('0x2e')](_0x13f9c4[_0x6709('0x51')][_0x6709('0x2e')]);}switch(_0x2eb9e0[_0x6709('0x44')]){case _0x6709('0x71'):return db[_[_0x6709('0xa1')](_0x13f9c4['query'][_0x6709('0x99')])+_0x6709('0xc4')][_0x6709('0x65')](_0x241839);case _0x6709('0x3b'):case'agent':return _0x2eb9e0['get'+_['capitalize'](_0x13f9c4[_0x6709('0x51')][_0x6709('0x99')])+'Queues'](_0x241839);}})[_0x6709('0x37')](function(_0x10e5aa){return{'count':_0xdfe870,'rows':_0x10e5aa};})[_0x6709('0x37')](respondWithResult(_0x554b8c,null))[_0x6709('0x2c')](handleError(_0x554b8c,null));};exports[_0x6709('0xc6')]=function(_0x5d14e5,_0x893e66,_0x3e0817){var _0x2dabac={};var _0x1fe96c={};var _0x28aa16;var _0x539975;return db[_0x6709('0x64')][_0x6709('0x91')]({'where':{'id':_0x5d14e5[_0x6709('0x66')]['id']}})[_0x6709('0x37')](handleEntityNotFound(_0x893e66,null))['then'](function(_0x399241){if(_0x399241){_0x28aa16=_0x399241;_0x1fe96c['model']=_[_0x6709('0x52')](db[_0x6709('0xaf')]['rawAttributes']);_0x1fe96c[_0x6709('0x51')]=_[_0x6709('0x52')](_0x5d14e5[_0x6709('0x51')]);_0x1fe96c[_0x6709('0x53')]=_[_0x6709('0x69')](_0x1fe96c[_0x6709('0x4e')],_0x1fe96c[_0x6709('0x51')]);_0x2dabac[_0x6709('0x54')]=_[_0x6709('0x69')](_0x1fe96c[_0x6709('0x4e')],qs[_0x6709('0x55')](_0x5d14e5[_0x6709('0x51')]['fields']));_0x2dabac[_0x6709('0x54')]=_0x2dabac[_0x6709('0x54')][_0x6709('0x56')]?_0x2dabac[_0x6709('0x54')]:_0x1fe96c['model'];_0x2dabac[_0x6709('0xbb')]=qs['sort'](_0x5d14e5[_0x6709('0x51')][_0x6709('0x59')]);_0x2dabac['where']=qs[_0x6709('0x53')](_[_0x6709('0x5b')](_0x5d14e5[_0x6709('0x51')],_0x1fe96c[_0x6709('0x53')]));if(_0x5d14e5[_0x6709('0x51')][_0x6709('0x60')]){_0x2dabac[_0x6709('0x5a')]=_[_0x6709('0x5c')](_0x2dabac['where'],{'$or':_[_0x6709('0x41')](_0x2dabac[_0x6709('0x54')],function(_0x279c97){var _0x143f0b={};_0x143f0b[_0x279c97]={'$like':'%'+_0x5d14e5['query']['filter']+'%'};return _0x143f0b;})});}_0x2dabac=_[_0x6709('0x5c')]({},_0x2dabac,_0x5d14e5[_0x6709('0xbc')]);return _0x28aa16[_0x6709('0xc6')](_0x2dabac);}})[_0x6709('0x37')](function(_0x1105fc){if(_0x1105fc){_0x539975=_0x1105fc[_0x6709('0x56')];if(!_0x5d14e5[_0x6709('0x51')][_0x6709('0x57')](_0x6709('0x58'))){_0x2dabac[_0x6709('0x2f')]=qs[_0x6709('0x2f')](_0x5d14e5[_0x6709('0x51')][_0x6709('0x2f')]);_0x2dabac[_0x6709('0x2e')]=qs['offset'](_0x5d14e5[_0x6709('0x51')]['offset']);}return _0x28aa16[_0x6709('0xc6')](_0x2dabac);}})[_0x6709('0x37')](function(_0x3cdd53){if(_0x3cdd53){return _0x3cdd53?{'count':_0x539975,'rows':_0x3cdd53}:null;}})['then'](respondWithResult(_0x893e66,null))[_0x6709('0x2c')](handleError(_0x893e66,null));};exports[_0x6709('0xc7')]=function(_0x1c2fb9,_0x3ea143,_0x295449){var _0x5278ff={};var _0x529689={};var _0xe68f09;var _0x5a0718;return db[_0x6709('0x64')][_0x6709('0x91')]({'where':{'id':_0x1c2fb9['params']['id']}})[_0x6709('0x37')](handleEntityNotFound(_0x3ea143,null))[_0x6709('0x37')](function(_0x5aef2e){if(_0x5aef2e){_0xe68f09=_0x5aef2e;_0x529689[_0x6709('0x4e')]=_[_0x6709('0x52')](db[_0x6709('0xc8')][_0x6709('0x68')]);_0x529689['query']=_[_0x6709('0x52')](_0x1c2fb9[_0x6709('0x51')]);_0x529689[_0x6709('0x53')]=_[_0x6709('0x69')](_0x529689[_0x6709('0x4e')],_0x529689[_0x6709('0x51')]);_0x5278ff[_0x6709('0x54')]=_[_0x6709('0x69')](_0x529689[_0x6709('0x4e')],qs[_0x6709('0x55')](_0x1c2fb9[_0x6709('0x51')][_0x6709('0x55')]));_0x5278ff[_0x6709('0x54')]=_0x5278ff[_0x6709('0x54')]['length']?_0x5278ff[_0x6709('0x54')]:_0x529689[_0x6709('0x4e')];_0x5278ff['order']=qs[_0x6709('0x59')](_0x1c2fb9[_0x6709('0x51')][_0x6709('0x59')]);_0x5278ff[_0x6709('0x5a')]=qs[_0x6709('0x53')](_[_0x6709('0x5b')](_0x1c2fb9[_0x6709('0x51')],_0x529689[_0x6709('0x53')]));if(_0x1c2fb9[_0x6709('0x51')][_0x6709('0x60')]){_0x5278ff[_0x6709('0x5a')]=_['merge'](_0x5278ff['where'],{'$or':_[_0x6709('0x41')](_0x5278ff[_0x6709('0x54')],function(_0x1ac29b){var _0x4cbb63={};_0x4cbb63[_0x1ac29b]={'$like':'%'+_0x1c2fb9[_0x6709('0x51')][_0x6709('0x60')]+'%'};return _0x4cbb63;})});}_0x5278ff=_['merge']({},_0x5278ff,_0x1c2fb9[_0x6709('0xbc')]);return _0xe68f09[_0x6709('0xc7')](_0x5278ff);}})[_0x6709('0x37')](function(_0x70e572){if(_0x70e572){_0x5a0718=_0x70e572['length'];if(!_0x1c2fb9['query'][_0x6709('0x57')]('nolimit')){_0x5278ff[_0x6709('0x2f')]=qs['limit'](_0x1c2fb9['query']['limit']);_0x5278ff[_0x6709('0x2e')]=qs[_0x6709('0x2e')](_0x1c2fb9[_0x6709('0x51')][_0x6709('0x2e')]);}return _0xe68f09[_0x6709('0xc7')](_0x5278ff);}})[_0x6709('0x37')](function(_0x5608ff){if(_0x5608ff){return _0x5608ff?{'count':_0x5a0718,'rows':_0x5608ff}:null;}})[_0x6709('0x37')](respondWithResult(_0x3ea143,null))[_0x6709('0x2c')](handleError(_0x3ea143,null));};exports[_0x6709('0xc9')]=function(_0x511ba7,_0x7e11ca,_0x5f2bfa){var _0x28da4a={'raw':!![],'where':{}};var _0x3bc389={};var _0x2904f5={'count':0x0,'rows':[]};return db[_0x6709('0x64')][_0x6709('0x91')]({'where':{'id':_0x511ba7[_0x6709('0x66')]['id']}})['then'](handleEntityNotFound(_0x7e11ca,null))[_0x6709('0x37')](function(_0x30c52b){if(_0x30c52b){_0x3bc389[_0x6709('0x4e')]=_['keys'](db[_0x6709('0xca')][_0x6709('0x68')]);_0x3bc389[_0x6709('0x51')]=_[_0x6709('0x52')](_0x511ba7[_0x6709('0x51')]);_0x3bc389['filters']=_[_0x6709('0x69')](_0x3bc389[_0x6709('0x4e')],_0x3bc389[_0x6709('0x51')]);_0x28da4a[_0x6709('0x54')]=_[_0x6709('0x69')](_0x3bc389[_0x6709('0x4e')],qs[_0x6709('0x55')](_0x511ba7[_0x6709('0x51')][_0x6709('0x55')]));_0x28da4a[_0x6709('0x54')]=_0x28da4a[_0x6709('0x54')][_0x6709('0x56')]?_0x28da4a[_0x6709('0x54')]:_0x3bc389[_0x6709('0x4e')];if(!_0x511ba7[_0x6709('0x51')][_0x6709('0x57')](_0x6709('0x58'))){_0x28da4a[_0x6709('0x2f')]=qs['limit'](_0x511ba7[_0x6709('0x51')]['limit']);_0x28da4a['offset']=qs['offset'](_0x511ba7[_0x6709('0x51')]['offset']);}_0x28da4a[_0x6709('0xbb')]=qs[_0x6709('0x59')](_0x511ba7['query'][_0x6709('0x59')]);_0x28da4a[_0x6709('0x5a')]=qs[_0x6709('0x53')](_['pick'](_0x511ba7[_0x6709('0x51')],_0x3bc389[_0x6709('0x53')]));_0x28da4a[_0x6709('0x5a')][_0x6709('0xcb')]=_0x30c52b['id'];if(_0x511ba7[_0x6709('0x51')]['filter']){_0x28da4a['where']=_[_0x6709('0x5c')](_0x28da4a[_0x6709('0x5a')],{'$or':_[_0x6709('0x41')](_0x28da4a['attributes'],function(_0x4ee014){var _0x14bbc8={};_0x14bbc8[_0x4ee014]={'$like':'%'+_0x511ba7[_0x6709('0x51')][_0x6709('0x60')]+'%'};return _0x14bbc8;})});}_0x28da4a=_[_0x6709('0x5c')]({},_0x28da4a,_0x511ba7['options']);return db['VoiceRecording']['count']({'where':_0x28da4a[_0x6709('0x5a')]})[_0x6709('0x37')](function(_0xc4d9d5){_0x2904f5[_0x6709('0x61')]=_0xc4d9d5;if(_0x511ba7[_0x6709('0x51')][_0x6709('0x62')]){_0x28da4a[_0x6709('0x63')]=[{'all':!![]}];}return db[_0x6709('0xca')]['findAll'](_0x28da4a);})[_0x6709('0x37')](function(_0x4d7087){_0x2904f5['rows']=_0x4d7087;return _0x2904f5;});}})[_0x6709('0x37')](respondWithFilteredResult(_0x7e11ca,_0x28da4a))[_0x6709('0x2c')](handleError(_0x7e11ca,null));};exports[_0x6709('0xcc')]=function(_0x4ee223,_0x2028d3,_0x5632ba){var _0x3efd1a={'raw':!![],'where':{}};var _0x3ff2d6={};var _0x174fe3={'count':0x0,'rows':[]};return db['User'][_0x6709('0x91')]({'where':{'id':_0x4ee223[_0x6709('0x66')]['id']}})[_0x6709('0x37')](handleEntityNotFound(_0x2028d3,null))[_0x6709('0x37')](function(_0x2592c5){if(_0x2592c5){_0x3ff2d6['model']=_[_0x6709('0x52')](db[_0x6709('0xcd')][_0x6709('0x68')]);_0x3ff2d6[_0x6709('0x51')]=_['keys'](_0x4ee223[_0x6709('0x51')]);_0x3ff2d6[_0x6709('0x53')]=_[_0x6709('0x69')](_0x3ff2d6['model'],_0x3ff2d6['query']);_0x3efd1a[_0x6709('0x54')]=_['intersection'](_0x3ff2d6[_0x6709('0x4e')],qs[_0x6709('0x55')](_0x4ee223[_0x6709('0x51')][_0x6709('0x55')]));_0x3efd1a['attributes']=_0x3efd1a[_0x6709('0x54')]['length']?_0x3efd1a[_0x6709('0x54')]:_0x3ff2d6['model'];if(!_0x4ee223['query'][_0x6709('0x57')](_0x6709('0x58'))){_0x3efd1a[_0x6709('0x2f')]=qs['limit'](_0x4ee223['query'][_0x6709('0x2f')]);_0x3efd1a['offset']=qs[_0x6709('0x2e')](_0x4ee223['query'][_0x6709('0x2e')]);}_0x3efd1a[_0x6709('0xbb')]=qs[_0x6709('0x59')](_0x4ee223['query'][_0x6709('0x59')]);_0x3efd1a[_0x6709('0x5a')]=qs['filters'](_[_0x6709('0x5b')](_0x4ee223[_0x6709('0x51')],_0x3ff2d6[_0x6709('0x53')]));_0x3efd1a[_0x6709('0x5a')][_0x6709('0xcb')]=_0x2592c5['id'];if(_0x4ee223[_0x6709('0x51')]['filter']){_0x3efd1a[_0x6709('0x5a')]=_['merge'](_0x3efd1a[_0x6709('0x5a')],{'$or':_['map'](_0x3efd1a['attributes'],function(_0x22e805){var _0x46a152={};_0x46a152[_0x22e805]={'$like':'%'+_0x4ee223['query'][_0x6709('0x60')]+'%'};return _0x46a152;})});}_0x3efd1a=_[_0x6709('0x5c')]({},_0x3efd1a,_0x4ee223[_0x6709('0xbc')]);return db[_0x6709('0xcd')][_0x6709('0x61')]({'where':_0x3efd1a[_0x6709('0x5a')]})['then'](function(_0x11c4b1){_0x174fe3[_0x6709('0x61')]=_0x11c4b1;if(_0x4ee223[_0x6709('0x51')]['includeAll']){_0x3efd1a[_0x6709('0x63')]=[{'all':!![]}];}return db[_0x6709('0xcd')][_0x6709('0x65')](_0x3efd1a);})[_0x6709('0x37')](function(_0x3dd430){_0x174fe3[_0x6709('0xce')]=_0x3dd430;return _0x174fe3;});}})[_0x6709('0x37')](respondWithFilteredResult(_0x2028d3,_0x3efd1a))['catch'](handleError(_0x2028d3,null));};exports[_0x6709('0xcf')]=function(_0x172280,_0x2c904e,_0x134d03){var _0x3614e0={};var _0x3ef287={};var _0x7ab43c;var _0x58d5b5;return db['User'][_0x6709('0x91')]({'where':{'id':_0x172280[_0x6709('0x66')]['id']}})[_0x6709('0x37')](handleEntityNotFound(_0x2c904e,null))['then'](function(_0xf16f95){if(_0xf16f95){_0x7ab43c=_0xf16f95;_0x3ef287['model']=_[_0x6709('0x52')](db[_0x6709('0xd0')]['rawAttributes']);_0x3ef287[_0x6709('0x51')]=_[_0x6709('0x52')](_0x172280['query']);_0x3ef287[_0x6709('0x53')]=_[_0x6709('0x69')](_0x3ef287[_0x6709('0x4e')],_0x3ef287[_0x6709('0x51')]);_0x3614e0[_0x6709('0x54')]=_['intersection'](_0x3ef287[_0x6709('0x4e')],qs[_0x6709('0x55')](_0x172280['query'][_0x6709('0x55')]));_0x3614e0[_0x6709('0x54')]=_0x3614e0[_0x6709('0x54')][_0x6709('0x56')]?_0x3614e0[_0x6709('0x54')]:_0x3ef287[_0x6709('0x4e')];_0x3614e0[_0x6709('0xbb')]=qs[_0x6709('0x59')](_0x172280[_0x6709('0x51')][_0x6709('0x59')]);_0x3614e0[_0x6709('0x5a')]=qs[_0x6709('0x53')](_[_0x6709('0x5b')](_0x172280[_0x6709('0x51')],_0x3ef287[_0x6709('0x53')]));if(_0x172280[_0x6709('0x51')]['filter']){_0x3614e0['where']=_[_0x6709('0x5c')](_0x3614e0[_0x6709('0x5a')],{'$or':_[_0x6709('0x41')](_0x3614e0[_0x6709('0x54')],function(_0x9ddffa){var _0xd93642={};_0xd93642[_0x9ddffa]={'$like':'%'+_0x172280[_0x6709('0x51')]['filter']+'%'};return _0xd93642;})});}_0x3614e0=_[_0x6709('0x5c')]({},_0x3614e0,_0x172280[_0x6709('0xbc')]);return _0x7ab43c[_0x6709('0xcf')](_0x3614e0);}})[_0x6709('0x37')](function(_0x41af23){if(_0x41af23){_0x58d5b5=_0x41af23[_0x6709('0x56')];if(!_0x172280[_0x6709('0x51')][_0x6709('0x57')](_0x6709('0x58'))){_0x3614e0[_0x6709('0x2f')]=qs['limit'](_0x172280[_0x6709('0x51')]['limit']);_0x3614e0['offset']=qs[_0x6709('0x2e')](_0x172280[_0x6709('0x51')][_0x6709('0x2e')]);}return _0x7ab43c[_0x6709('0xcf')](_0x3614e0);}})[_0x6709('0x37')](function(_0x3b34a0){if(_0x3b34a0){return _0x3b34a0?{'count':_0x58d5b5,'rows':_0x3b34a0}:null;}})[_0x6709('0x37')](respondWithResult(_0x2c904e,null))['catch'](handleError(_0x2c904e,null));};exports[_0x6709('0xd1')]=function(_0x37aa0d,_0x655278,_0x330abd){var _0x235423={};var _0x402ac8={};var _0x56ec9f;var _0x58a02f;return db[_0x6709('0x64')]['findOne']({'where':{'id':_0x37aa0d[_0x6709('0x66')]['id']}})[_0x6709('0x37')](handleEntityNotFound(_0x655278,null))[_0x6709('0x37')](function(_0x25541f){if(_0x25541f){_0x56ec9f=_0x25541f;_0x402ac8[_0x6709('0x4e')]=_[_0x6709('0x52')](db[_0x6709('0xd2')][_0x6709('0x68')]);_0x402ac8['query']=_['keys'](_0x37aa0d[_0x6709('0x51')]);_0x402ac8[_0x6709('0x53')]=_[_0x6709('0x69')](_0x402ac8[_0x6709('0x4e')],_0x402ac8['query']);_0x235423[_0x6709('0x54')]=_['intersection'](_0x402ac8[_0x6709('0x4e')],qs[_0x6709('0x55')](_0x37aa0d[_0x6709('0x51')][_0x6709('0x55')]));_0x235423[_0x6709('0x54')]=_0x235423[_0x6709('0x54')][_0x6709('0x56')]?_0x235423[_0x6709('0x54')]:_0x402ac8[_0x6709('0x4e')];_0x235423[_0x6709('0xbb')]=qs[_0x6709('0x59')](_0x37aa0d[_0x6709('0x51')]['sort']);_0x235423[_0x6709('0x5a')]=qs[_0x6709('0x53')](_[_0x6709('0x5b')](_0x37aa0d['query'],_0x402ac8[_0x6709('0x53')]));if(_0x37aa0d['query']['filter']){_0x235423[_0x6709('0x5a')]=_[_0x6709('0x5c')](_0x235423[_0x6709('0x5a')],{'$or':_[_0x6709('0x41')](_0x235423[_0x6709('0x54')],function(_0x26b5ea){var _0x5f1fb4={};_0x5f1fb4[_0x26b5ea]={'$like':'%'+_0x37aa0d[_0x6709('0x51')][_0x6709('0x60')]+'%'};return _0x5f1fb4;})});}_0x235423=_[_0x6709('0x5c')]({},_0x235423,_0x37aa0d['options']);return _0x56ec9f[_0x6709('0xd1')](_0x235423);}})[_0x6709('0x37')](function(_0x3c54e8){if(_0x3c54e8){_0x58a02f=_0x3c54e8[_0x6709('0x56')];if(!_0x37aa0d[_0x6709('0x51')]['hasOwnProperty'](_0x6709('0x58'))){_0x235423['limit']=qs[_0x6709('0x2f')](_0x37aa0d[_0x6709('0x51')][_0x6709('0x2f')]);_0x235423['offset']=qs[_0x6709('0x2e')](_0x37aa0d[_0x6709('0x51')][_0x6709('0x2e')]);}return _0x56ec9f[_0x6709('0xd1')](_0x235423);}})[_0x6709('0x37')](function(_0x5e8ff3){if(_0x5e8ff3){return _0x5e8ff3?{'count':_0x58a02f,'rows':_0x5e8ff3}:null;}})['then'](respondWithResult(_0x655278,null))[_0x6709('0x2c')](handleError(_0x655278,null));};exports['getMailInteractions']=function(_0x46eaae,_0x4bd2ba,_0x2e7aa8){var _0x5b40de={'raw':!![],'where':{}};var _0x28be39={};var _0x530187={'count':0x0,'rows':[]};return db[_0x6709('0x64')][_0x6709('0x91')]({'where':{'id':_0x46eaae[_0x6709('0x66')]['id']}})[_0x6709('0x37')](handleEntityNotFound(_0x4bd2ba,null))['then'](function(_0x530267){if(_0x530267){_0x28be39[_0x6709('0x4e')]=_[_0x6709('0x52')](db[_0x6709('0xd3')][_0x6709('0x68')]);_0x28be39[_0x6709('0x51')]=_[_0x6709('0x52')](_0x46eaae[_0x6709('0x51')]);_0x28be39['filters']=_['intersection'](_0x28be39[_0x6709('0x4e')],_0x28be39['query']);_0x5b40de['attributes']=_[_0x6709('0x69')](_0x28be39['model'],qs[_0x6709('0x55')](_0x46eaae[_0x6709('0x51')][_0x6709('0x55')]));_0x5b40de[_0x6709('0x54')]=_0x5b40de['attributes'][_0x6709('0x56')]?_0x5b40de[_0x6709('0x54')]:_0x28be39[_0x6709('0x4e')];if(!_0x46eaae[_0x6709('0x51')][_0x6709('0x57')](_0x6709('0x58'))){_0x5b40de[_0x6709('0x2f')]=qs['limit'](_0x46eaae[_0x6709('0x51')]['limit']);_0x5b40de[_0x6709('0x2e')]=qs[_0x6709('0x2e')](_0x46eaae[_0x6709('0x51')][_0x6709('0x2e')]);}_0x5b40de[_0x6709('0xbb')]=qs[_0x6709('0x59')](_0x46eaae[_0x6709('0x51')]['sort']);_0x5b40de[_0x6709('0x5a')]=qs[_0x6709('0x53')](_['pick'](_0x46eaae[_0x6709('0x51')],_0x28be39[_0x6709('0x53')]));_0x5b40de[_0x6709('0x5a')][_0x6709('0xcb')]=_0x530267['id'];if(_0x46eaae['query'][_0x6709('0x60')]){_0x5b40de[_0x6709('0x5a')]=_[_0x6709('0x5c')](_0x5b40de['where'],{'$or':_['map'](_0x5b40de[_0x6709('0x54')],function(_0x41e7a4){var _0x585f2c={};_0x585f2c[_0x41e7a4]={'$like':'%'+_0x46eaae[_0x6709('0x51')][_0x6709('0x60')]+'%'};return _0x585f2c;})});}_0x5b40de=_[_0x6709('0x5c')]({},_0x5b40de,_0x46eaae[_0x6709('0xbc')]);return db[_0x6709('0xd3')][_0x6709('0x61')]({'where':_0x5b40de['where']})[_0x6709('0x37')](function(_0x23c312){_0x530187['count']=_0x23c312;if(_0x46eaae[_0x6709('0x51')][_0x6709('0x62')]){_0x5b40de[_0x6709('0x63')]=[{'all':!![]}];}return db[_0x6709('0xd3')][_0x6709('0x65')](_0x5b40de);})['then'](function(_0x39d307){_0x530187[_0x6709('0xce')]=_0x39d307;return _0x530187;});}})[_0x6709('0x37')](respondWithFilteredResult(_0x4bd2ba,_0x5b40de))[_0x6709('0x2c')](handleError(_0x4bd2ba,null));};exports['getSmsInteractions']=function(_0x4102da,_0x345bc5,_0x4d9741){var _0x16b1ec={};var _0x266b26={};var _0x377ec5;var _0x32fe8f;return db['User'][_0x6709('0x91')]({'where':{'id':_0x4102da[_0x6709('0x66')]['id']}})['then'](handleEntityNotFound(_0x345bc5,null))[_0x6709('0x37')](function(_0xacd624){if(_0xacd624){_0x377ec5=_0xacd624;_0x266b26[_0x6709('0x4e')]=_[_0x6709('0x52')](db[_0x6709('0xd4')][_0x6709('0x68')]);_0x266b26[_0x6709('0x51')]=_['keys'](_0x4102da[_0x6709('0x51')]);_0x266b26['filters']=_[_0x6709('0x69')](_0x266b26[_0x6709('0x4e')],_0x266b26[_0x6709('0x51')]);_0x16b1ec['attributes']=_[_0x6709('0x69')](_0x266b26[_0x6709('0x4e')],qs['fields'](_0x4102da[_0x6709('0x51')][_0x6709('0x55')]));_0x16b1ec[_0x6709('0x54')]=_0x16b1ec[_0x6709('0x54')]['length']?_0x16b1ec[_0x6709('0x54')]:_0x266b26[_0x6709('0x4e')];_0x16b1ec[_0x6709('0xbb')]=qs[_0x6709('0x59')](_0x4102da[_0x6709('0x51')]['sort']);_0x16b1ec[_0x6709('0x5a')]=qs[_0x6709('0x53')](_['pick'](_0x4102da['query'],_0x266b26[_0x6709('0x53')]));if(_0x4102da['query'][_0x6709('0x60')]){_0x16b1ec[_0x6709('0x5a')]=_[_0x6709('0x5c')](_0x16b1ec[_0x6709('0x5a')],{'$or':_[_0x6709('0x41')](_0x16b1ec[_0x6709('0x54')],function(_0x3eb1f9){var _0x30daf0={};_0x30daf0[_0x3eb1f9]={'$like':'%'+_0x4102da[_0x6709('0x51')][_0x6709('0x60')]+'%'};return _0x30daf0;})});}_0x16b1ec=_['merge']({},_0x16b1ec,_0x4102da[_0x6709('0xbc')]);return _0x377ec5[_0x6709('0xd5')](_0x16b1ec);}})[_0x6709('0x37')](function(_0x5e49a7){if(_0x5e49a7){_0x32fe8f=_0x5e49a7[_0x6709('0x56')];if(!_0x4102da[_0x6709('0x51')][_0x6709('0x57')](_0x6709('0x58'))){_0x16b1ec[_0x6709('0x2f')]=qs[_0x6709('0x2f')](_0x4102da[_0x6709('0x51')]['limit']);_0x16b1ec[_0x6709('0x2e')]=qs[_0x6709('0x2e')](_0x4102da[_0x6709('0x51')]['offset']);}return _0x377ec5[_0x6709('0xd5')](_0x16b1ec);}})[_0x6709('0x37')](function(_0x347fd5){if(_0x347fd5){return _0x347fd5?{'count':_0x32fe8f,'rows':_0x347fd5}:null;}})[_0x6709('0x37')](respondWithResult(_0x345bc5,null))[_0x6709('0x2c')](handleError(_0x345bc5,null));};exports['getFaxInteractions']=function(_0x15e5b8,_0x3d4934,_0x4e1ac1){var _0x14e9df={};var _0x3cf2ed={};var _0x2455f3;var _0x445fcc;return db[_0x6709('0x64')][_0x6709('0x91')]({'where':{'id':_0x15e5b8['params']['id']}})[_0x6709('0x37')](handleEntityNotFound(_0x3d4934,null))[_0x6709('0x37')](function(_0x41d06c){if(_0x41d06c){_0x2455f3=_0x41d06c;_0x3cf2ed[_0x6709('0x4e')]=_[_0x6709('0x52')](db['FaxInteraction'][_0x6709('0x68')]);_0x3cf2ed['query']=_[_0x6709('0x52')](_0x15e5b8[_0x6709('0x51')]);_0x3cf2ed[_0x6709('0x53')]=_[_0x6709('0x69')](_0x3cf2ed[_0x6709('0x4e')],_0x3cf2ed['query']);_0x14e9df['attributes']=_[_0x6709('0x69')](_0x3cf2ed[_0x6709('0x4e')],qs[_0x6709('0x55')](_0x15e5b8[_0x6709('0x51')][_0x6709('0x55')]));_0x14e9df[_0x6709('0x54')]=_0x14e9df['attributes'][_0x6709('0x56')]?_0x14e9df[_0x6709('0x54')]:_0x3cf2ed[_0x6709('0x4e')];_0x14e9df['order']=qs[_0x6709('0x59')](_0x15e5b8[_0x6709('0x51')][_0x6709('0x59')]);_0x14e9df[_0x6709('0x5a')]=qs[_0x6709('0x53')](_[_0x6709('0x5b')](_0x15e5b8[_0x6709('0x51')],_0x3cf2ed[_0x6709('0x53')]));if(_0x15e5b8[_0x6709('0x51')][_0x6709('0x60')]){_0x14e9df[_0x6709('0x5a')]=_[_0x6709('0x5c')](_0x14e9df[_0x6709('0x5a')],{'$or':_[_0x6709('0x41')](_0x14e9df[_0x6709('0x54')],function(_0x9dcca0){var _0x2246a9={};_0x2246a9[_0x9dcca0]={'$like':'%'+_0x15e5b8['query']['filter']+'%'};return _0x2246a9;})});}_0x14e9df=_[_0x6709('0x5c')]({},_0x14e9df,_0x15e5b8[_0x6709('0xbc')]);return _0x2455f3[_0x6709('0xd6')](_0x14e9df);}})['then'](function(_0x1926be){if(_0x1926be){_0x445fcc=_0x1926be['length'];if(!_0x15e5b8['query'][_0x6709('0x57')]('nolimit')){_0x14e9df[_0x6709('0x2f')]=qs[_0x6709('0x2f')](_0x15e5b8[_0x6709('0x51')][_0x6709('0x2f')]);_0x14e9df[_0x6709('0x2e')]=qs[_0x6709('0x2e')](_0x15e5b8['query'][_0x6709('0x2e')]);}return _0x2455f3['getFaxInteractions'](_0x14e9df);}})[_0x6709('0x37')](function(_0x119080){if(_0x119080){return _0x119080?{'count':_0x445fcc,'rows':_0x119080}:null;}})['then'](respondWithResult(_0x3d4934,null))[_0x6709('0x2c')](handleError(_0x3d4934,null));};exports['login']=function(_0x3a91fb,_0x465bc6,_0xa159a7){var _0x4829f7;var _0x3ea0ec;var _0x2899b9;var _0x1d4cff=!_[_0x6709('0x74')](_0x3a91fb['params']['id'])?_0x3a91fb['params']['id']:!_[_0x6709('0x74')](_0x3a91fb[_0x6709('0x3b')]['id'])?_0x3a91fb[_0x6709('0x3b')]['id']:null;return db['User'][_0x6709('0x45')]({'where':{'id':_0x1d4cff,'role':{'$or':['admin','user',_0x6709('0x3d')]}},'attributes':['id',_0x6709('0x46'),_0x6709('0xd7'),_0x6709('0xd8'),_0x6709('0x44'),'internal','loginInPause']})['then'](function(_0x161374){if(_0x161374){if(_0x161374[_0x6709('0x44')]==='agent'){_0x4829f7=_0x161374;if(_0x3a91fb[_0x6709('0x6b')][_0x6709('0x9d')]){_0x2899b9=util[_0x6709('0x76')](_0x6709('0xd9'),_0x4829f7[_0x3a91fb['body'][_0x6709('0x9d')]]);}else if(_0x3a91fb[_0x6709('0x6b')][_0x6709('0xda')]){_0x2899b9=util[_0x6709('0x76')]('SIP/%s',_0x3a91fb[_0x6709('0x6b')]['intrf']);}else{_0x2899b9=util[_0x6709('0x76')](_0x6709('0xdb'),_0x4829f7[_0x6709('0x46')]);}socket['to'](util[_0x6709('0x76')](_0x6709('0xdc'),_0x4829f7[_0x6709('0x46')]))['emit'](_0x6709('0xdd'),{'ip':_0x3a91fb['headers']['x-forwarded-for']||_0x3a91fb['connection']['remoteAddress']||_0x3a91fb['socket']['remoteAddress']||_0x3a91fb[_0x6709('0xde')]['socket'][_0x6709('0xdf')]});return db[_0x6709('0xaf')][_0x6709('0x38')]({'where':{'membername':_0x4829f7[_0x6709('0x46')]},'individualHooks':!![]});}}else{throw new db[(_0x6709('0x21'))][(_0x6709('0x22'))]('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})[_0x6709('0x37')](function(){if(_0x4829f7){return _0x4829f7[_0x6709('0xe0')]({'raw':!![]});}})['then'](function(_0x175093){if(_0x4829f7){var _0x4a4aa7=[];if(_0x175093){_0x3ea0ec=_0x175093;if(_0x3ea0ec[_0x6709('0x56')]){for(var _0x333f6a=0x0;_0x333f6a<_0x3ea0ec[_0x6709('0x56')];_0x333f6a++){_0x4a4aa7[_0x6709('0xaa')]({'membername':_0x4829f7[_0x6709('0x46')],'UserId':_0x4829f7['id'],'queue_name':_0x3ea0ec[_0x333f6a][_0x6709('0x46')],'VoiceQueueId':_0x3ea0ec[_0x333f6a]['id'],'interface':_0x2899b9,'paused':_0x4829f7[_0x6709('0x9b')]||![],'penalty':_0x3ea0ec[_0x333f6a]['UserVoiceQueue.penalty']||0x0});}return BPromise[_0x6709('0xab')](_0x4a4aa7,function(_0x1759fc){return db[_0x6709('0xaf')][_0x6709('0xac')](_0x1759fc);});}}}})[_0x6709('0x37')](function(){if(_0x4829f7){return db['MemberReport'][_0x6709('0x65')]({'where':{'membername':_0x4829f7[_0x6709('0x46')],'exitAt':null}});}})[_0x6709('0x37')](function(_0x55b574){if(_0x4829f7){var _0x3c35bb=[];_0x55b574[_0x6709('0xe1')](function(_0x449319){_0x3c35bb['push'](_0x449319[_0x6709('0x36')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x6709('0xe2')](_0x3c35bb);}})['then'](function(){if(_0x4829f7){var _0x56edcb=[];var _0x1dffff=[];var _0x154d69=utils[_0x6709('0xe3')]();var _0x4fb0e9={'membername':_0x4829f7['name'],'interface':_0x2899b9,'enterAt':moment()[_0x6709('0x76')](_0x6709('0xe4')),'role':_0x4829f7[_0x6709('0x44')],'internal':_0x4829f7[_0x6709('0x7a')]};_0x154d69['forEach'](function(_0x42d5e1){_0x56edcb[_0x6709('0xaa')](_['merge']({'channel':_0x42d5e1,'type':_0x6709('0xe5'),'data1':_0x3a91fb[_0x6709('0x6b')]['device'],'data2':_0x2899b9},_0x4fb0e9));if(_0x4829f7['loginInPause']){_0x1dffff[_0x6709('0xaa')](_['merge']({'channel':_0x42d5e1,'type':_0x6709('0xe6'),'data1':'LOGININPAUSE'},_0x4fb0e9));}});return db[_0x6709('0xe7')]['bulkCreate'](_0x56edcb[_0x6709('0xe8')](_0x1dffff),{'individualHooks':!![]});}})[_0x6709('0x37')](function(){if(_0x4829f7){return _0x4829f7[_0x6709('0x36')]({'online':!![],'lastLoginAt':moment()[_0x6709('0x76')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x4829f7[_0x6709('0x9b')]||![],'mailPause':_0x4829f7['loginInPause']||![],'chatPause':_0x4829f7[_0x6709('0x9b')]||![],'faxPause':_0x4829f7[_0x6709('0x9b')]||![],'smsPause':_0x4829f7[_0x6709('0x9b')]||![],'openchannelPause':_0x4829f7[_0x6709('0x9b')]||![],'pauseType':_0x4829f7[_0x6709('0x9b')]?_0x6709('0xe9'):null,'interface':_0x2899b9,'lastPauseAt':moment()[_0x6709('0x76')](_0x6709('0xe4'))});}})[_0x6709('0x37')](function(_0x15757b){if(_0x3a91fb[_0x6709('0xea')]){return _0xa159a7();}else{return BPromise[_0x6709('0xeb')](_0x15757b)[_0x6709('0x37')](respondWithResult(_0x465bc6,null));}})[_0x6709('0x2c')](handleError(_0x465bc6,null));};exports['logout']=function(_0x4b9a89,_0x24b309,_0xf4908d){var _0x5ac61a;return db['User'][_0x6709('0x45')]({'where':{'id':_0x4b9a89['params']['id'],'role':_0x6709('0x3d')},'attributes':['id',_0x6709('0x46'),_0x6709('0x44')]})[_0x6709('0x37')](handleEntityNotFound(_0x24b309,null))[_0x6709('0x37')](function(_0x593611){if(_0x593611){_0x5ac61a=_0x593611;return db[_0x6709('0xaf')]['destroy']({'where':{'membername':_0x5ac61a['name']},'individualHooks':!![]});}})[_0x6709('0x37')](function(){return db[_0x6709('0xe7')][_0x6709('0x65')]({'where':{'membername':_0x5ac61a[_0x6709('0x46')],'exitAt':null}});})[_0x6709('0x37')](function(_0x34959d){var _0x461999=[];_0x34959d[_0x6709('0xe1')](function(_0x40caaf){_0x461999[_0x6709('0xaa')](_0x40caaf['update']({'exitAt':moment()[_0x6709('0x76')](_0x6709('0xe4'))}));});return BPromise[_0x6709('0xe2')](_0x461999);})[_0x6709('0x37')](function(){return _0x5ac61a['update']({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})['then'](respondWithResult(_0x24b309,null))['catch'](handleError(_0x24b309,null));};exports[_0x6709('0xec')]=function(_0x368f6e,_0xbfbee6,_0x402273){var _0x268974;return db[_0x6709('0xaf')][_0x6709('0x36')]({'paused':0x1},{'where':{'UserId':_0x368f6e[_0x6709('0x66')]['id']},'individualHooks':!![]})[_0x6709('0x37')](function(){return db[_0x6709('0x64')][_0x6709('0x45')]({'where':{'id':_0x368f6e[_0x6709('0x66')]['id'],'role':'agent'},'attributes':['id','name','role',_0x6709('0x7a'),_0x6709('0x9d')]});})[_0x6709('0x37')](handleEntityNotFound(_0xbfbee6,null))['then'](function(_0x2c4fe6){if(_0x2c4fe6){_0x268974=_0x2c4fe6;return respondWithRpcPromise(_0x6709('0xed'),_0x6709('0xec'),{'id':_0x268974['id'],'name':_0x268974[_0x6709('0x46')],'pause':!![]});}})['then'](function(){if(_0x268974){return db[_0x6709('0xe7')]['findAll']({'where':{'membername':_0x268974[_0x6709('0x46')],'type':_0x6709('0xe6'),'exitAt':null}});}})[_0x6709('0x37')](function(_0x22f3fa){if(_0x22f3fa[_0x6709('0x56')]){var _0xa65332=moment()[_0x6709('0x76')](_0x6709('0xe4'));for(var _0x2f09bb=0x0,_0x1c72c2=_0x22f3fa['length'];_0x2f09bb<_0x1c72c2;_0x2f09bb++){_0x22f3fa[_0x2f09bb][_0x6709('0xee')]({'exitAt':_0xa65332});}}})[_0x6709('0x37')](function(){var _0x5da3d3=[];var _0x380fd3=utils[_0x6709('0xe3')]();_0x380fd3[_0x6709('0xe1')](function(_0x4b2173){_0x5da3d3[_0x6709('0xaa')]({'channel':_0x4b2173,'membername':_0x268974[_0x6709('0x46')],'interface':_[_0x6709('0x74')](_0x268974['interface'])?util[_0x6709('0x76')](_0x6709('0xdb'),_0x268974[_0x6709('0x46')]):_0x268974['interface'],'type':'PAUSE','enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x368f6e[_0x6709('0x6b')][_0x6709('0x5d')]||_0x6709('0xef'),'role':_0x268974['role'],'internal':_0x268974[_0x6709('0x7a')]});});return db['MemberReport'][_0x6709('0x6a')](_0x5da3d3,{'individualHooks':!![]});})['then'](function(){return _0x268974[_0x6709('0x36')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x368f6e[_0x6709('0x6b')][_0x6709('0x5d')]||_0x6709('0xef'),'lastPauseAt':moment()[_0x6709('0x76')](_0x6709('0xe4'))});})[_0x6709('0x37')](respondWithResult(_0xbfbee6,null))[_0x6709('0x2c')](handleError(_0xbfbee6,null));};exports[_0x6709('0xf0')]=function(_0x37f542,_0x223a6b,_0x38437a){var _0x400a51;return db[_0x6709('0x64')][_0x6709('0x45')]({'where':{'id':_0x37f542['params']['id']},'attributes':['id','name',_0x6709('0x44'),_0x6709('0x9c'),_0x6709('0xf1'),'chatPause',_0x6709('0xf2'),'openchannelPause','smsPause',_0x6709('0xf3'),_0x6709('0xf4')]})[_0x6709('0x37')](handleEntityNotFound(_0x223a6b,null))[_0x6709('0x37')](function(_0xf0b565){if(_0xf0b565){_0x400a51=_0xf0b565;if(_0x37f542[_0x6709('0x6b')]['channel']&&!utils[_0x6709('0x9e')](_0x37f542[_0x6709('0x6b')][_0x6709('0x99')])){throw new db[(_0x6709('0x21'))][(_0x6709('0x22'))](_0x6709('0x9f'));}switch(_0x37f542[_0x6709('0x6b')][_0x6709('0x99')]){case _0x6709('0xa9'):return respondWithRpcPromise(_0x6709('0xed'),_0x6709('0xf0'),{'id':_0x400a51['id'],'name':_0x400a51['name'],'pause':![]})[_0x6709('0x37')](function(){return db['UserVoiceQueueRt'][_0x6709('0x36')]({'paused':0x0},{'where':{'UserId':_0x400a51['id']},'individualHooks':!![]});})[_0x6709('0x37')](function(){return db['MemberReport'][_0x6709('0x45')]({'where':{'channel':_0x37f542['body'][_0x6709('0x99')],'membername':_0x400a51['name'],'type':_0x6709('0xe6'),'exitAt':null}});})[_0x6709('0x37')](function(_0x1ab6de){if(_0x1ab6de){return _0x1ab6de[_0x6709('0x36')]({'exitAt':moment()['format'](_0x6709('0xe4')),'data2':_0x6709('0xf5')},{'individualHooks':!![]});}return null;})[_0x6709('0x37')](function(){return _0x400a51[_0x6709('0x36')]({'voicePause':![]});});case _0x6709('0xf6'):case'chat':case _0x6709('0xf7'):case'sms':case'openchannel':return db[_0x6709('0xe7')][_0x6709('0x45')]({'where':{'channel':_0x37f542[_0x6709('0x6b')]['channel'],'membername':_0x400a51[_0x6709('0x46')],'type':'PAUSE','exitAt':null}})[_0x6709('0x37')](function(_0x220eb0){if(_0x220eb0){return _0x220eb0[_0x6709('0x36')]({'exitAt':moment()['format'](_0x6709('0xe4')),'data2':_0x6709('0xf5')},{'individualHooks':!![]});}return null;})[_0x6709('0x37')](function(){var _0x3041b3={};_[_0x6709('0x30')](_0x3041b3,util[_0x6709('0x76')]('%s%s',_0x37f542[_0x6709('0x6b')][_0x6709('0x99')],_0x6709('0xf8')),![]);return _0x400a51[_0x6709('0x36')](_0x3041b3);});default:return respondWithRpcPromise(_0x6709('0xed'),_0x6709('0xf0'),{'id':_0x400a51['id'],'name':_0x400a51['name'],'pause':![]})[_0x6709('0x37')](function(){return db['UserVoiceQueueRt'][_0x6709('0x36')]({'paused':0x0},{'where':{'UserId':_0x400a51['id']}});})['then'](function(){return db[_0x6709('0xe7')][_0x6709('0x65')]({'where':{'membername':_0x400a51[_0x6709('0x46')],'type':'PAUSE','exitAt':null}});})[_0x6709('0x37')](function(_0xb5bbb8){var _0x359673=[];_0xb5bbb8['forEach'](function(_0x5a11a7){_0x359673['push'](_0x5a11a7[_0x6709('0x36')]({'exitAt':moment()['format'](_0x6709('0xe4')),'data2':_0x6709('0xf5')}));});return BPromise[_0x6709('0xe2')](_0x359673);})[_0x6709('0x37')](function(){return _0x400a51[_0x6709('0x36')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0x6709('0x37')](respondWithResult(_0x223a6b,null))['catch'](handleError(_0x223a6b,null));};exports[_0x6709('0xf9')]=function(_0x1dd7a8,_0x48029b,_0x3e286f){var _0x595c52={};var _0x140a3e={};var _0x5e27f1;var _0x2593de;return db['User'][_0x6709('0x91')]({'where':{'id':_0x1dd7a8[_0x6709('0x66')]['id']}})[_0x6709('0x37')](handleEntityNotFound(_0x48029b,null))[_0x6709('0x37')](function(_0x18ac6e){if(_0x18ac6e){_0x5e27f1=_0x18ac6e;_0x140a3e[_0x6709('0x4e')]=_[_0x6709('0x52')](db['Team'][_0x6709('0x68')]);_0x140a3e[_0x6709('0x51')]=_['keys'](_0x1dd7a8['query']);_0x140a3e[_0x6709('0x53')]=_[_0x6709('0x69')](_0x140a3e[_0x6709('0x4e')],_0x140a3e['query']);_0x595c52[_0x6709('0x54')]=_[_0x6709('0x69')](_0x140a3e[_0x6709('0x4e')],qs[_0x6709('0x55')](_0x1dd7a8[_0x6709('0x51')][_0x6709('0x55')]));_0x595c52['attributes']=_0x595c52[_0x6709('0x54')][_0x6709('0x56')]?_0x595c52['attributes']:_0x140a3e['model'];_0x595c52[_0x6709('0xbb')]=qs[_0x6709('0x59')](_0x1dd7a8['query'][_0x6709('0x59')]);_0x595c52[_0x6709('0x5a')]=qs[_0x6709('0x53')](_[_0x6709('0x5b')](_0x1dd7a8[_0x6709('0x51')],_0x140a3e[_0x6709('0x53')]));if(_0x1dd7a8[_0x6709('0x51')][_0x6709('0x60')]){_0x595c52[_0x6709('0x5a')]=_[_0x6709('0x5c')](_0x595c52[_0x6709('0x5a')],{'$or':_[_0x6709('0x41')](_0x595c52[_0x6709('0x54')],function(_0x45414d){var _0x17160f={};_0x17160f[_0x45414d]={'$like':'%'+_0x1dd7a8[_0x6709('0x51')][_0x6709('0x60')]+'%'};return _0x17160f;})});}_0x595c52=_[_0x6709('0x5c')]({},_0x595c52,_0x1dd7a8[_0x6709('0xbc')]);return _0x5e27f1['getTeams'](_0x595c52);}})[_0x6709('0x37')](function(_0x3b38c0){if(_0x3b38c0){_0x2593de=_0x3b38c0[_0x6709('0x56')];if(!_0x1dd7a8[_0x6709('0x51')]['hasOwnProperty'](_0x6709('0x58'))){_0x595c52['limit']=qs['limit'](_0x1dd7a8['query']['limit']);_0x595c52[_0x6709('0x2e')]=qs[_0x6709('0x2e')](_0x1dd7a8[_0x6709('0x51')][_0x6709('0x2e')]);}return _0x5e27f1[_0x6709('0xf9')](_0x595c52);}})['then'](function(_0x2cf2d9){if(_0x2cf2d9){return _0x2cf2d9?{'count':_0x2593de,'rows':_0x2cf2d9}:null;}})['then'](respondWithResult(_0x48029b,null))[_0x6709('0x2c')](handleError(_0x48029b,null));};exports[_0x6709('0xfa')]=function(_0x23ceff,_0x3d81db){return db[_0x6709('0x64')][_0x6709('0x45')]({'where':{'id':_0x23ceff['params']['id']}})[_0x6709('0x37')](handleEntityNotFound(_0x3d81db,null))[_0x6709('0x37')](function(_0x236eac){if(_0x236eac){var _0x17c21f=_0x236eac['get']({'plain':!![]});return _0x236eac[_0x6709('0xfa')](_0x23ceff[_0x6709('0x6b')][_0x6709('0x6e')],_['omit'](_0x23ceff[_0x6709('0x6b')],[_0x6709('0x6e'),'id'])||{})[_0x6709('0x37')](function(){for(var _0x4da67a=0x0;_0x4da67a<_0x23ceff[_0x6709('0x6b')]['ids'][_0x6709('0x56')];_0x4da67a++){var _0x3fdcfd=[];db[_0x6709('0xfb')][_0x6709('0x91')]({'where':{'id':_0x23ceff[_0x6709('0x6b')][_0x6709('0x6e')][_0x4da67a]}})['then'](function(_0x27632b){_0x3fdcfd['push'](_0x27632b[_0x6709('0xe0')]()[_0x6709('0x37')](function(_0x10e3c0){for(var _0x592a48=0x0;_0x592a48<_0x10e3c0[_0x6709('0x56')];_0x592a48++){_0x10e3c0[_0x592a48][_0x6709('0xfc')]('channel',_0x6709('0xfd'));}return _0x10e3c0;}));_0x3fdcfd[_0x6709('0xaa')](_0x27632b[_0x6709('0xfe')]()[_0x6709('0x37')](function(_0x5996f3){for(var _0x6ced8c=0x0;_0x6ced8c<_0x5996f3[_0x6709('0x56')];_0x6ced8c++){_0x5996f3[_0x6ced8c][_0x6709('0xfc')]('channel','Chat');}return _0x5996f3;}));_0x3fdcfd[_0x6709('0xaa')](_0x27632b['getMailQueues']()[_0x6709('0x37')](function(_0x2a1e87){for(var _0x523500=0x0;_0x523500<_0x2a1e87[_0x6709('0x56')];_0x523500++){_0x2a1e87[_0x523500][_0x6709('0xfc')](_0x6709('0x99'),_0x6709('0xff'));}return _0x2a1e87;}));_0x3fdcfd[_0x6709('0xaa')](_0x27632b['getSmsQueues']()['then'](function(_0x5dabe4){for(var _0x397622=0x0;_0x397622<_0x5dabe4[_0x6709('0x56')];_0x397622++){_0x5dabe4[_0x397622][_0x6709('0xfc')](_0x6709('0x99'),_0x6709('0x100'));}return _0x5dabe4;}));_0x3fdcfd[_0x6709('0xaa')](_0x27632b['getFaxQueues']()[_0x6709('0x37')](function(_0x3b0549){for(var _0x3c58b9=0x0;_0x3c58b9<_0x3b0549[_0x6709('0x56')];_0x3c58b9++){_0x3b0549[_0x3c58b9][_0x6709('0xfc')](_0x6709('0x99'),'Fax');}return _0x3b0549;}));_0x3fdcfd[_0x6709('0xaa')](_0x27632b[_0x6709('0x101')]()['then'](function(_0x590c81){for(var _0x47ab4c=0x0;_0x47ab4c<_0x590c81[_0x6709('0x56')];_0x47ab4c++){_0x590c81[_0x47ab4c][_0x6709('0xfc')]('channel','Openchannel');}return _0x590c81;}));return BPromise['all'](_0x3fdcfd);})[_0x6709('0x37')](function(_0xdfdb16){var _0x5551c0=_['flatten'](_0xdfdb16);_0x3fdcfd=[];return db[_0x6709('0x5e')][_0x6709('0x102')](function(_0x3b3396){for(var _0x124925=0x0;_0x124925<_0x5551c0[_0x6709('0x56')];_0x124925++){_0x3fdcfd[_0x6709('0xaa')](_0x5551c0[_0x124925][_0x6709('0x103')](_0x17c21f['id']),{'transaction':_0x3b3396});}return BPromise[_0x6709('0xe2')](_0x3fdcfd)['then'](function(){if(_0x17c21f[_0x6709('0x9a')]){return BPromise[_0x6709('0xab')](_[_0x6709('0x60')](_0x5551c0,function(_0x5e2d16){return _0x5e2d16[_0x6709('0x104')](_0x6709('0x99'))===_0x6709('0xfd');}),function(_0x3f45ba){return db[_0x6709('0xaf')][_0x6709('0xac')]({'membername':_0x17c21f[_0x6709('0x46')],'UserId':_0x17c21f['id'],'queue_name':_0x3f45ba[_0x6709('0x46')],'VoiceQueueId':_0x3f45ba['id'],'interface':_[_0x6709('0x74')](_0x17c21f[_0x6709('0x9d')])?util[_0x6709('0x76')]('SIP/%s',_0x17c21f[_0x6709('0x46')]):_0x17c21f['interface'],'paused':_0x17c21f[_0x6709('0x9c')]||![],'penalty':_0x17c21f[_0x6709('0xa4')]},{'transaction':_0x3b3396});});}else{return;}})[_0x6709('0x37')](function(){for(var _0x1245c0=0x0;_0x1245c0<_0x5551c0[_0x6709('0x56')];_0x1245c0++){var _0x3e2453=_0x5551c0[_0x1245c0][_0x6709('0x104')](_0x6709('0x99'));var _0x157980=_0x3e2453+_0x6709('0xa6');socket[_0x6709('0xae')](_0x6709('0x3b')+_0x3e2453+_0x6709('0xa7'),{'UserId':_0x17c21f['id'],['queueField']:_0x5551c0[_0x1245c0]['id']});}});});});}});}})[_0x6709('0x37')](respondWithStatusCode(_0x3d81db,null))[_0x6709('0x2c')](handleError(_0x3d81db,null));};exports['removeTeams']=function(_0x24b350,_0x29d948){return db['User'][_0x6709('0x91')]({'where':{'id':_0x24b350[_0x6709('0x66')]['id']}})[_0x6709('0x37')](handleEntityNotFound(_0x29d948,null))[_0x6709('0x37')](function(_0x3e6afe){if(_0x3e6afe){var _0x505adf=_0x3e6afe['get']({'plain':!![]});var _0x41b2e1=_0x24b350[_0x6709('0x51')][_0x6709('0x6e')];return _0x3e6afe['removeTeams'](_0x41b2e1)['then'](function(){for(var _0x1e0489=0x0;_0x1e0489<_0x41b2e1[_0x6709('0x56')];_0x1e0489++){var _0x1a46a3=[];db[_0x6709('0xfb')][_0x6709('0x91')]({'where':{'id':_0x41b2e1[_0x1e0489]}})[_0x6709('0x37')](function(_0x18c201){_0x1a46a3[_0x6709('0xaa')](_0x18c201[_0x6709('0xe0')]()['then'](function(_0x10b9a9){for(var _0xb134d8=0x0;_0xb134d8<_0x10b9a9['length'];_0xb134d8++){_0x10b9a9[_0xb134d8]['setDataValue'](_0x6709('0x99'),_0x6709('0xfd'));}return _0x10b9a9;}));_0x1a46a3['push'](_0x18c201[_0x6709('0xfe')]()['then'](function(_0x18a36){for(var _0x421df5=0x0;_0x421df5<_0x18a36[_0x6709('0x56')];_0x421df5++){_0x18a36[_0x421df5][_0x6709('0xfc')]('channel','Chat');}return _0x18a36;}));_0x1a46a3[_0x6709('0xaa')](_0x18c201[_0x6709('0x105')]()[_0x6709('0x37')](function(_0x415cb9){for(var _0x3f6e3e=0x0;_0x3f6e3e<_0x415cb9[_0x6709('0x56')];_0x3f6e3e++){_0x415cb9[_0x3f6e3e][_0x6709('0xfc')]('channel',_0x6709('0xff'));}return _0x415cb9;}));_0x1a46a3[_0x6709('0xaa')](_0x18c201['getSmsQueues']()[_0x6709('0x37')](function(_0x3ef7c6){for(var _0x55d838=0x0;_0x55d838<_0x3ef7c6[_0x6709('0x56')];_0x55d838++){_0x3ef7c6[_0x55d838]['setDataValue']('channel',_0x6709('0x100'));}return _0x3ef7c6;}));_0x1a46a3[_0x6709('0xaa')](_0x18c201[_0x6709('0x106')]()[_0x6709('0x37')](function(_0x4fd62d){for(var _0x477575=0x0;_0x477575<_0x4fd62d[_0x6709('0x56')];_0x477575++){_0x4fd62d[_0x477575]['setDataValue'](_0x6709('0x99'),_0x6709('0x107'));}return _0x4fd62d;}));_0x1a46a3[_0x6709('0xaa')](_0x18c201[_0x6709('0x101')]()[_0x6709('0x37')](function(_0x2aeee5){for(var _0x35c511=0x0;_0x35c511<_0x2aeee5[_0x6709('0x56')];_0x35c511++){_0x2aeee5[_0x35c511][_0x6709('0xfc')](_0x6709('0x99'),_0x6709('0x108'));}return _0x2aeee5;}));return BPromise['all'](_0x1a46a3);})[_0x6709('0x37')](function(_0x36e3b2){var _0x3db7cd=_['flatten'](_0x36e3b2);_0x1a46a3=[];return db[_0x6709('0x5e')][_0x6709('0x102')](function(_0x1dcd87){for(var _0x4ba6b5=0x0;_0x4ba6b5<_0x3db7cd[_0x6709('0x56')];_0x4ba6b5++){_0x1a46a3['push'](_0x3db7cd[_0x4ba6b5][_0x6709('0x109')](_0x505adf['id']),{'transaction':_0x1dcd87});}return BPromise[_0x6709('0xe2')](_0x1a46a3)[_0x6709('0x37')](function(){if(_0x505adf['online']){return BPromise[_0x6709('0xab')](_['filter'](_0x3db7cd,function(_0x14ee57){return _0x14ee57[_0x6709('0x104')](_0x6709('0x99'))==='Voice';}),function(_0x104e4a){return db[_0x6709('0xaf')][_0x6709('0x38')]({'where':{'VoiceQueueId':_0x104e4a['id'],'UserId':_0x505adf['id']},'transaction':_0x1dcd87});});}else{return;}})[_0x6709('0x37')](function(){for(var _0x3cb574=0x0;_0x3cb574<_0x3db7cd[_0x6709('0x56')];_0x3cb574++){var _0x22fc8a=_0x3db7cd[_0x3cb574][_0x6709('0x104')]('channel');var _0x37de30=_0x22fc8a+_0x6709('0xa6');socket['emit'](_0x6709('0x3b')+_0x22fc8a+_0x6709('0x10a'),{'UserId':_0x505adf['id'],['queueField']:_0x3db7cd[_0x3cb574]['id']});}});});});}});}})['then'](respondWithStatusCode(_0x29d948,null))[_0x6709('0x2c')](handleError(_0x29d948,null));};exports[_0x6709('0x10b')]=function(_0x42a905,_0x2cb0b1,_0x374e39){var _0x3793b0={};var _0x21a33f={};var _0x121c04;var _0x215151;return db[_0x6709('0x64')]['findOne']({'where':{'id':_0x42a905[_0x6709('0x66')]['id']}})['then'](handleEntityNotFound(_0x2cb0b1,null))[_0x6709('0x37')](function(_0x5592e1){if(_0x5592e1){_0x121c04=_0x5592e1;_0x21a33f[_0x6709('0x4e')]=_['keys'](db[_0x6709('0xbd')][_0x6709('0x68')]);_0x21a33f[_0x6709('0x51')]=_[_0x6709('0x52')](_0x42a905[_0x6709('0x51')]);_0x21a33f[_0x6709('0x53')]=_[_0x6709('0x69')](_0x21a33f[_0x6709('0x4e')],_0x21a33f['query']);_0x3793b0[_0x6709('0x54')]=_['intersection'](_0x21a33f[_0x6709('0x4e')],qs[_0x6709('0x55')](_0x42a905[_0x6709('0x51')][_0x6709('0x55')]));_0x3793b0[_0x6709('0x54')]=_0x3793b0[_0x6709('0x54')][_0x6709('0x56')]?_0x3793b0[_0x6709('0x54')]:_0x21a33f['model'];_0x3793b0['order']=qs[_0x6709('0x59')](_0x42a905[_0x6709('0x51')][_0x6709('0x59')]);_0x3793b0[_0x6709('0x5a')]=qs['filters'](_[_0x6709('0x5b')](_0x42a905['query'],_0x21a33f['filters']));if(_0x42a905[_0x6709('0x51')][_0x6709('0x60')]){_0x3793b0[_0x6709('0x5a')]=_[_0x6709('0x5c')](_0x3793b0[_0x6709('0x5a')],{'$or':_['map'](_0x3793b0['attributes'],function(_0x208d55){var _0xab1aee={};_0xab1aee[_0x208d55]={'$like':'%'+_0x42a905[_0x6709('0x51')][_0x6709('0x60')]+'%'};return _0xab1aee;})});}_0x3793b0=_[_0x6709('0x5c')]({},_0x3793b0,_0x42a905[_0x6709('0xbc')]);return _0x121c04[_0x6709('0x10b')](_0x3793b0);}})[_0x6709('0x37')](function(_0x5dfc0d){if(_0x5dfc0d){_0x215151=_0x5dfc0d[_0x6709('0x56')];if(!_0x42a905[_0x6709('0x51')]['hasOwnProperty'](_0x6709('0x58'))){_0x3793b0[_0x6709('0x2f')]=qs[_0x6709('0x2f')](_0x42a905[_0x6709('0x51')][_0x6709('0x2f')]);_0x3793b0[_0x6709('0x2e')]=qs['offset'](_0x42a905['query'][_0x6709('0x2e')]);}return _0x121c04[_0x6709('0x10b')](_0x3793b0);}})[_0x6709('0x37')](function(_0x376f3a){if(_0x376f3a){return _0x376f3a?{'count':_0x215151,'rows':_0x376f3a}:null;}})[_0x6709('0x37')](respondWithResult(_0x2cb0b1,null))[_0x6709('0x2c')](handleError(_0x2cb0b1,null));};exports[_0x6709('0x10c')]=function(_0x409276,_0x2b0df3,_0xfe5514){var _0x3ebf3e={};var _0x4913a7={};var _0x235f51;var _0x2027fa;return db['User']['findOne']({'where':{'id':_0x409276[_0x6709('0x66')]['id']}})['then'](handleEntityNotFound(_0x2b0df3,null))[_0x6709('0x37')](function(_0x423923){if(_0x423923){_0x235f51=_0x423923;_0x4913a7[_0x6709('0x4e')]=_[_0x6709('0x52')](db['User'][_0x6709('0x68')]);_0x4913a7[_0x6709('0x51')]=_[_0x6709('0x52')](_0x409276['query']);_0x4913a7['filters']=_['intersection'](_0x4913a7[_0x6709('0x4e')],_0x4913a7[_0x6709('0x51')]);_0x3ebf3e['attributes']=_[_0x6709('0x69')](_0x4913a7[_0x6709('0x4e')],qs['fields'](_0x409276[_0x6709('0x51')][_0x6709('0x55')]));_0x3ebf3e[_0x6709('0x54')]=_0x3ebf3e[_0x6709('0x54')]['length']?_0x3ebf3e[_0x6709('0x54')]:_0x4913a7[_0x6709('0x4e')];_0x3ebf3e[_0x6709('0xbb')]=qs[_0x6709('0x59')](_0x409276[_0x6709('0x51')][_0x6709('0x59')]);_0x3ebf3e[_0x6709('0x5a')]=qs[_0x6709('0x53')](_[_0x6709('0x5b')](_0x409276[_0x6709('0x51')],_0x4913a7[_0x6709('0x53')]));if(_0x409276[_0x6709('0x51')][_0x6709('0x60')]){_0x3ebf3e[_0x6709('0x5a')]=_[_0x6709('0x5c')](_0x3ebf3e[_0x6709('0x5a')],{'$or':_['map'](_0x3ebf3e['attributes'],function(_0x13c3c9){var _0x48f323={};_0x48f323[_0x13c3c9]={'$like':'%'+_0x409276[_0x6709('0x51')]['filter']+'%'};return _0x48f323;})});}_0x3ebf3e[_0x6709('0x4e')]=db[_0x6709('0x64')];_0x3ebf3e['as']=_0x6709('0x3c');_0x3ebf3e=_[_0x6709('0x5c')]({},_0x3ebf3e,_0x409276[_0x6709('0xbc')]);return _0x235f51['getVoiceQueues']({'include':[_0x3ebf3e]});}})['then'](function(_0x56b5d6){if(_0x56b5d6){var _0x67ec4e={},_0x1ea55e=[],_0x112730=0x0;for(var _0x34b44f=0x0;_0x34b44f<_0x56b5d6[_0x6709('0x56')];_0x34b44f+=0x1){for(var _0x2545a2=0x0,_0x3a206b;_0x2545a2<_0x56b5d6[_0x34b44f][_0x6709('0x3c')][_0x6709('0x56')];_0x2545a2+=0x1){_0x3a206b=_0x56b5d6[_0x34b44f][_0x6709('0x3c')][_0x2545a2]['get']({'plain':!![]});_0x67ec4e[_0x3a206b['id']]=_0x3a206b;}}_0x67ec4e=_[_0x6709('0x10d')](_0x67ec4e);for(var _0x287622=qs[_0x6709('0x2e')](_0x409276[_0x6709('0x51')][_0x6709('0x2e')]);_0x287622<_0x67ec4e[_0x6709('0x56')]&&_0x1ea55e[_0x6709('0x56')]=_0x252dbc[_0x2889('0x4e')]){throw new Error(_0x2889('0x4f'));}})[_0x2889('0xf')](function(){if(_0x3ca86e){return db['UserVoiceQueueRt'][_0x2889('0x4a')]({'where':{'membername':_0x3ca86e['name']},'individualHooks':!![]});}})[_0x2889('0xf')](function(){if(_0x3ca86e){return _0x3ca86e[_0x2889('0x50')]({'raw':!![]});}})['then'](function(_0x18320f){if(_0x3ca86e){if(_0x18320f){var _0x3d7288=[];_0x263d75=_0x18320f;if(_0x263d75['length']){for(var _0x4465af=0x0;_0x4465af<_0x263d75['length'];_0x4465af++){_0x3d7288[_0x2889('0x34')](db[_0x2889('0x47')][_0x2889('0x51')]({'membername':_0x3ca86e[_0x2889('0x35')],'UserId':_0x3ca86e['id'],'queue_name':_0x263d75[_0x4465af][_0x2889('0x35')],'VoiceQueueId':_0x263d75[_0x4465af]['id'],'interface':_0x238c57,'paused':_0x3ca86e[_0x2889('0x52')]||![],'penalty':_0x263d75[_0x4465af][_0x2889('0x53')]||0x0}));}return BPromise[_0x2889('0x48')](_0x3d7288);}}}})[_0x2889('0xf')](function(){if(_0x3ca86e){return db[_0x2889('0x2c')][_0x2889('0x1c')]({'where':{'membername':_0x3ca86e[_0x2889('0x35')],'exitAt':null}});}})[_0x2889('0xf')](function(_0x368ba6){if(_0x3ca86e){if(_0x368ba6&&_0x368ba6[_0x2889('0x2e')]){var _0x30eeeb=[];_0x368ba6[_0x2889('0x33')](function(_0x3cf783){_0x30eeeb['push'](_0x3cf783[_0x2889('0x2b')]({'exitAt':moment()['format'](_0x2889('0x30'))}));});return BPromise[_0x2889('0x48')](_0x30eeeb);}}})[_0x2889('0xf')](function(_0x4cffe8){if(_0x3ca86e){var _0x3cb014=[];var _0x4f1f3b=[];var _0x98af06=utils[_0x2889('0x32')]();var _0xf8c529={'membername':_0x3ca86e[_0x2889('0x35')],'interface':_0x238c57,'enterAt':moment()[_0x2889('0x2f')](_0x2889('0x30')),'role':_0x3ca86e[_0x2889('0x28')],'internal':_0x3ca86e[_0x2889('0x29')]};_0x98af06[_0x2889('0x33')](function(_0x19ad5a){_0x3cb014[_0x2889('0x34')](_[_0x2889('0x54')]({'channel':_0x19ad5a,'type':_0x2889('0x55'),'data1':_0x2889('0x56'),'data2':_0x238c57},_0xf8c529));if(_0x3ca86e[_0x2889('0x52')]){_0x4f1f3b[_0x2889('0x34')](_['merge']({'channel':_0x19ad5a,'type':'PAUSE','data1':_0x2889('0x57')},_0xf8c529));}});return db[_0x2889('0x2c')][_0x2889('0x3a')](_0x3cb014['concat'](_0x4f1f3b),{'individualHooks':!![]});}})[_0x2889('0xf')](function(){if(_0x3ca86e){return _0x3ca86e[_0x2889('0x2b')]({'online':!![],'lastLoginAt':moment()['format'](_0x2889('0x30')),'voicePause':_0x3ca86e[_0x2889('0x52')]||![],'mailPause':_0x3ca86e[_0x2889('0x52')]||![],'chatPause':_0x3ca86e[_0x2889('0x52')]||![],'faxPause':_0x3ca86e[_0x2889('0x52')]||![],'smsPause':_0x3ca86e[_0x2889('0x52')]||![],'openchannelPause':_0x3ca86e['loginInPause']||![],'pauseType':_0x3ca86e[_0x2889('0x52')]?_0x2889('0x57'):null,'lastPauseAt':moment()[_0x2889('0x2f')](_0x2889('0x30')),'interface':_0x238c57});}})[_0x2889('0xf')](function(_0x32d5e1){_0x466d9d(_0x32d5e1);})[_0x2889('0x19')](function(_0x287bdb){_0x57f047(_0x3a4197['error'](0x1f4,_0x287bdb[_0x2889('0x17')]));});});}; \ No newline at end of file +var _0xe634=['LogoutUser','destroy','forEach','LoginUser','phone','loginInPause','count','agent','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','UserVoiceQueue.penalty','LOGIN','merge','concat','LOGININPAUSE','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','socket.io-emitter','./user.socket','register','request','then','info','debug','request\x20sent','stringify','error','User,\x20%s,\x20%s','message','result','catch','GetUser','User','findAll','options','raw','where','attributes','include','map','model','ShowUser','find','PauseUser','name','role','update','MemberReport','PAUSE','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','push','isNil','interface','SIP/%s','body','type','DEFAULT\x20PAUSE','internal','uniqueid','bulkCreate','UnpauseUser','findOne','isValidChannel','Unknown\x20channel','channel','voice','system','chat','fax','sms','set','%s%s','Pause','UserVoiceQueueRt','all'];(function(_0x586974,_0x3038ee){var _0x432ab9=function(_0x5010e3){while(--_0x5010e3){_0x586974['push'](_0x586974['shift']());}};_0x432ab9(++_0x3038ee);}(_0xe634,0x17e));var _0x4e63=function(_0x3ac746,_0x561b5e){_0x3ac746=_0x3ac746-0x0;var _0x1b5d36=_0xe634[_0x3ac746];return _0x1b5d36;};'use strict';var _=require('lodash');var util=require(_0x4e63('0x0'));var moment=require(_0x4e63('0x1'));var BPromise=require(_0x4e63('0x2'));var rs=require(_0x4e63('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4e63('0x4'));var logger=require(_0x4e63('0x5'))(_0x4e63('0x6'));var config=require('../../config/environment');var jayson=require(_0x4e63('0x7'));var client=jayson[_0x4e63('0x8')]['http']({'port':0x232a});config[_0x4e63('0x9')]=_[_0x4e63('0xa')](config[_0x4e63('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x4e63('0xb'))(new Redis(config[_0x4e63('0x9')]));require(_0x4e63('0xc'))[_0x4e63('0xd')](socket);function respondWithRpcPromise(_0x10c353,_0x14787b,_0x3bce1f){return new BPromise(function(_0x4c4a7a,_0x2dae2f){return client[_0x4e63('0xe')](_0x10c353,_0x3bce1f)[_0x4e63('0xf')](function(_0x246208){logger[_0x4e63('0x10')]('User,\x20%s,\x20%s',_0x14787b,'request\x20sent');logger[_0x4e63('0x11')]('User,\x20%s,\x20%s,\x20%s',_0x14787b,_0x4e63('0x12'),JSON[_0x4e63('0x13')](_0x246208));if(_0x246208['error']){if(_0x246208[_0x4e63('0x14')]['code']===0x1f4){logger[_0x4e63('0x14')](_0x4e63('0x15'),_0x14787b,_0x246208[_0x4e63('0x14')]['message']);return _0x2dae2f(_0x246208[_0x4e63('0x14')][_0x4e63('0x16')]);}logger['error'](_0x4e63('0x15'),_0x14787b,_0x246208[_0x4e63('0x14')]['message']);return _0x4c4a7a(_0x246208['error']['message']);}else{logger[_0x4e63('0x10')]('User,\x20%s,\x20%s',_0x14787b,_0x4e63('0x12'));_0x4c4a7a(_0x246208[_0x4e63('0x17')][_0x4e63('0x16')]);}})[_0x4e63('0x18')](function(_0x41564a){logger[_0x4e63('0x14')]('User,\x20%s,\x20%s',_0x14787b,_0x41564a);_0x2dae2f(_0x41564a);});});}exports[_0x4e63('0x19')]=function(_0x191358){var _0x3519f4=this;return new Promise(function(_0x15525d,_0x361f5d){return db[_0x4e63('0x1a')][_0x4e63('0x1b')]({'raw':_0x191358[_0x4e63('0x1c')]?_0x191358[_0x4e63('0x1c')][_0x4e63('0x1d')]===undefined?!![]:![]:!![],'where':_0x191358[_0x4e63('0x1c')]?_0x191358[_0x4e63('0x1c')][_0x4e63('0x1e')]||null:null,'attributes':_0x191358[_0x4e63('0x1c')]?_0x191358['options'][_0x4e63('0x1f')]||null:null,'limit':_0x191358[_0x4e63('0x1c')]?_0x191358[_0x4e63('0x1c')]['limit']||null:null,'include':_0x191358['options']?_0x191358[_0x4e63('0x1c')][_0x4e63('0x20')]?_['map'](_0x191358[_0x4e63('0x1c')]['include'],function(_0x266ac1){return{'model':db[_0x266ac1['model']],'as':_0x266ac1['as'],'attributes':_0x266ac1[_0x4e63('0x1f')],'include':_0x266ac1[_0x4e63('0x20')]?_[_0x4e63('0x21')](_0x266ac1['include'],function(_0xad564){return{'model':db[_0xad564[_0x4e63('0x22')]],'as':_0xad564['as'],'attributes':_0xad564[_0x4e63('0x1f')],'include':_0xad564[_0x4e63('0x20')]?_[_0x4e63('0x21')](_0xad564[_0x4e63('0x20')],function(_0x5b6da7){return{'model':db[_0x5b6da7[_0x4e63('0x22')]],'as':_0x5b6da7['as'],'attributes':_0x5b6da7[_0x4e63('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x4e63('0xf')](function(_0x1a70d6){logger[_0x4e63('0x10')]('GetUser',_0x191358);logger[_0x4e63('0x11')](_0x4e63('0x19'),_0x191358,JSON[_0x4e63('0x13')](_0x1a70d6));_0x15525d(_0x1a70d6);})['catch'](function(_0x577b46){logger[_0x4e63('0x14')](_0x4e63('0x19'),_0x577b46[_0x4e63('0x16')],_0x191358);_0x361f5d(_0x3519f4['error'](0x1f4,_0x577b46['message']));});});};exports[_0x4e63('0x23')]=function(_0x3d238d){var _0x1c0059=this;return new Promise(function(_0x5cfcbc,_0x553e24){return db['User'][_0x4e63('0x24')]({'raw':_0x3d238d[_0x4e63('0x1c')]?_0x3d238d[_0x4e63('0x1c')][_0x4e63('0x1d')]===undefined?!![]:![]:!![],'where':_0x3d238d[_0x4e63('0x1c')]?_0x3d238d[_0x4e63('0x1c')][_0x4e63('0x1e')]||null:null,'attributes':_0x3d238d[_0x4e63('0x1c')]?_0x3d238d[_0x4e63('0x1c')][_0x4e63('0x1f')]||null:null,'include':_0x3d238d[_0x4e63('0x1c')]?_0x3d238d[_0x4e63('0x1c')][_0x4e63('0x20')]?_[_0x4e63('0x21')](_0x3d238d[_0x4e63('0x1c')][_0x4e63('0x20')],function(_0x1130d1){return{'model':db[_0x1130d1[_0x4e63('0x22')]],'as':_0x1130d1['as'],'attributes':_0x1130d1['attributes'],'include':_0x1130d1[_0x4e63('0x20')]?_[_0x4e63('0x21')](_0x1130d1[_0x4e63('0x20')],function(_0x8d5578){return{'model':db[_0x8d5578['model']],'as':_0x8d5578['as'],'attributes':_0x8d5578[_0x4e63('0x1f')],'include':_0x8d5578['include']?_['map'](_0x8d5578[_0x4e63('0x20')],function(_0x35165d){return{'model':db[_0x35165d[_0x4e63('0x22')]],'as':_0x35165d['as'],'attributes':_0x35165d['attributes']};}):[]};}):[]};}):[]:[]})[_0x4e63('0xf')](function(_0x30a0d9){logger[_0x4e63('0x10')](_0x4e63('0x23'),_0x3d238d);logger[_0x4e63('0x11')]('ShowUser',_0x3d238d,JSON[_0x4e63('0x13')](_0x30a0d9));_0x5cfcbc(_0x30a0d9);})[_0x4e63('0x18')](function(_0x87e96c){logger['error'](_0x4e63('0x23'),_0x87e96c[_0x4e63('0x16')],_0x3d238d);_0x553e24(_0x1c0059[_0x4e63('0x14')](0x1f4,_0x87e96c['message']));});});};exports[_0x4e63('0x25')]=function(_0x391724){var _0x25fafc=this;return new Promise(function(_0x2e0ea4,_0x25686b){var _0x3eaab5;return db['User'][_0x4e63('0x24')]({'where':_0x391724['options'][_0x4e63('0x1e')]||{},'attributes':['id',_0x4e63('0x26'),_0x4e63('0x27'),'internal','interface']})['then'](function(_0x498744){if(_0x498744){_0x3eaab5=_0x498744;return db['UserVoiceQueueRt'][_0x4e63('0x28')]({'paused':0x1},{'where':{'UserId':_0x3eaab5['id']},'individualHooks':!![]});}})[_0x4e63('0xf')](function(){if(_0x3eaab5){return db[_0x4e63('0x29')][_0x4e63('0x1b')]({'where':{'membername':_0x3eaab5[_0x4e63('0x26')],'type':_0x4e63('0x2a'),'exitAt':null}});}})[_0x4e63('0xf')](function(_0x2a7fd9){if(_0x3eaab5){if(_0x2a7fd9&&_0x2a7fd9[_0x4e63('0x2b')]){var _0x29c28f=moment()[_0x4e63('0x2c')](_0x4e63('0x2d'));for(var _0x3a5a5a=0x0,_0x11a1d1=_0x2a7fd9['length'];_0x3a5a5a<_0x11a1d1;_0x3a5a5a++){_0x2a7fd9[_0x3a5a5a][_0x4e63('0x2e')]({'exitAt':_0x29c28f});}}}})['then'](function(){if(_0x3eaab5){var _0x6adac1=[];var _0x283473=utils[_0x4e63('0x2f')]();_0x283473['forEach'](function(_0x50db7d){_0x6adac1[_0x4e63('0x30')]({'channel':_0x50db7d,'membername':_0x3eaab5[_0x4e63('0x26')],'interface':_[_0x4e63('0x31')](_0x3eaab5[_0x4e63('0x32')])?util[_0x4e63('0x2c')](_0x4e63('0x33'),_0x3eaab5[_0x4e63('0x26')]):_0x3eaab5[_0x4e63('0x32')],'type':_0x4e63('0x2a'),'enterAt':moment()[_0x4e63('0x2c')](_0x4e63('0x2d')),'data1':_0x391724[_0x4e63('0x34')][_0x4e63('0x35')]||_0x4e63('0x36'),'role':_0x3eaab5['role'],'internal':_0x3eaab5[_0x4e63('0x37')],'uniqueid':_0x391724['body'][_0x4e63('0x38')]||null});});return db[_0x4e63('0x29')][_0x4e63('0x39')](_0x6adac1,{'individualHooks':!![]});}})[_0x4e63('0xf')](function(){if(_0x3eaab5){return _0x3eaab5[_0x4e63('0x28')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x391724[_0x4e63('0x34')][_0x4e63('0x35')]||_0x4e63('0x36'),'lastPauseAt':moment()['format'](_0x4e63('0x2d'))});}})[_0x4e63('0xf')](function(_0x2b263){_0x2e0ea4(_0x2b263);})[_0x4e63('0x18')](function(_0x207d70){_0x25686b(_0x25fafc[_0x4e63('0x14')](0x1f4,_0x207d70['message']));});});};exports[_0x4e63('0x3a')]=function(_0x1b2b92){var _0x422a5d=this;return new Promise(function(_0x4fc0ee,_0x4c1899){var _0x271235;return db[_0x4e63('0x1a')][_0x4e63('0x3b')]({'where':_0x1b2b92[_0x4e63('0x1c')][_0x4e63('0x1e')]||{},'attributes':['id',_0x4e63('0x26')]})['then'](function(_0x5cf86c){if(_0x5cf86c){_0x271235=_0x5cf86c;if(_0x1b2b92[_0x4e63('0x34')]['channel']&&!utils[_0x4e63('0x3c')](_0x1b2b92['body']['channel'])){throw new Error(_0x4e63('0x3d'));}switch(_0x1b2b92['body'][_0x4e63('0x3e')]){case _0x4e63('0x3f'):return db['UserVoiceQueueRt'][_0x4e63('0x28')]({'paused':0x0},{'where':{'UserId':_0x271235['id']}})[_0x4e63('0xf')](function(){return db['MemberReport'][_0x4e63('0x24')]({'where':{'channel':_0x1b2b92[_0x4e63('0x34')][_0x4e63('0x3e')],'membername':_0x271235[_0x4e63('0x26')],'type':_0x4e63('0x2a'),'exitAt':null}});})['then'](function(_0xe8bab2){if(_0xe8bab2){return _0xe8bab2[_0x4e63('0x28')]({'exitAt':moment()[_0x4e63('0x2c')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x4e63('0x40')},{'individualHooks':!![]});}return null;})[_0x4e63('0xf')](function(){return _0x271235[_0x4e63('0x28')]({'voicePause':![]});});case'mail':case _0x4e63('0x41'):case _0x4e63('0x42'):case _0x4e63('0x43'):case'openchannel':return db[_0x4e63('0x29')][_0x4e63('0x24')]({'where':{'channel':_0x1b2b92[_0x4e63('0x34')][_0x4e63('0x3e')],'membername':_0x271235['name'],'type':'PAUSE','exitAt':null}})['then'](function(_0x25befc){return _0x25befc[_0x4e63('0x28')]({'exitAt':moment()['format'](_0x4e63('0x2d')),'data2':_0x4e63('0x40')},{'individualHooks':!![]});})[_0x4e63('0xf')](function(){var _0x18e951={};_[_0x4e63('0x44')](_0x18e951,util[_0x4e63('0x2c')](_0x4e63('0x45'),_0x1b2b92['body'][_0x4e63('0x3e')],_0x4e63('0x46')),![]);return _0x271235[_0x4e63('0x28')](_0x18e951);});default:return db[_0x4e63('0x47')]['update']({'paused':0x0},{'where':{'UserId':_0x271235['id']}})[_0x4e63('0xf')](function(){return db[_0x4e63('0x29')]['findAll']({'where':{'membername':_0x271235[_0x4e63('0x26')],'type':_0x4e63('0x2a'),'exitAt':null}});})[_0x4e63('0xf')](function(_0xf60cb1){var _0x51ea57=[];_0xf60cb1['forEach'](function(_0x42973b){_0x51ea57[_0x4e63('0x30')](_0x42973b[_0x4e63('0x28')]({'exitAt':moment()[_0x4e63('0x2c')](_0x4e63('0x2d')),'data2':'system'}));});return BPromise[_0x4e63('0x48')](_0x51ea57);})['then'](function(){return _0x271235['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0x4e63('0xf')](function(_0x3d82d1){_0x4fc0ee(_0x3d82d1);})[_0x4e63('0x18')](function(_0x99cb34){_0x4c1899(_0x422a5d[_0x4e63('0x14')](0x1f4,_0x99cb34['message']));});});};exports[_0x4e63('0x49')]=function(_0x2bfeae){var _0x579f3b=this;return new Promise(function(_0x242f11,_0xbb4171){var _0x4aba1d;return db[_0x4e63('0x1a')]['findOne']({'where':_0x2bfeae['options']['where']||{},'attributes':['id',_0x4e63('0x26')]})[_0x4e63('0xf')](function(_0x18b7a7){if(_0x18b7a7){_0x4aba1d=_0x18b7a7;return db[_0x4e63('0x47')][_0x4e63('0x4a')]({'where':{'membername':_0x4aba1d[_0x4e63('0x26')]},'individualHooks':!![]});}})[_0x4e63('0xf')](function(){if(_0x4aba1d){return db[_0x4e63('0x29')]['findAll']({'where':{'membername':_0x4aba1d[_0x4e63('0x26')],'exitAt':null}});}})[_0x4e63('0xf')](function(_0x4c4e64){if(_0x4aba1d){if(_0x4c4e64&&_0x4c4e64[_0x4e63('0x2b')]){var _0x4add18=[];_0x4c4e64[_0x4e63('0x4b')](function(_0x55385d){_0x4add18[_0x4e63('0x30')](_0x55385d[_0x4e63('0x28')]({'exitAt':moment()[_0x4e63('0x2c')](_0x4e63('0x2d'))}));});return BPromise[_0x4e63('0x48')](_0x4add18);}}})[_0x4e63('0xf')](function(){if(_0x4aba1d){return _0x4aba1d[_0x4e63('0x28')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x4e63('0xf')](function(_0x355e9c){_0x242f11(_0x355e9c);})['catch'](function(_0x45f63d){_0xbb4171(_0x579f3b[_0x4e63('0x14')](0x1f4,_0x45f63d[_0x4e63('0x16')]));});});};exports[_0x4e63('0x4c')]=function(_0x246be4){var _0x7d2c8a=this;return new Promise(function(_0x27eb60,_0x12e844){var _0x11698c;var _0x34a706;var _0x334976;var _0x1ed38d;return db[_0x4e63('0x1a')]['findOne']({'where':_0x246be4[_0x4e63('0x1c')]['where']||{},'attributes':['id',_0x4e63('0x26'),_0x4e63('0x27'),'mobile',_0x4e63('0x4d'),_0x4e63('0x37'),_0x4e63('0x4e'),_0x4e63('0x32')]})[_0x4e63('0xf')](function(_0x2ae8e0){if(_0x2ae8e0){_0x11698c=_0x2ae8e0;_0x1ed38d=_0x246be4[_0x4e63('0x34')]['interface']?_0x246be4[_0x4e63('0x34')]['interface']:util['format']('SIP/%s',_0x11698c[_0x4e63('0x26')]);return db[_0x4e63('0x1a')][_0x4e63('0x4f')]({'where':{'role':_0x4e63('0x50'),'online':!![],'id':{'$ne':_0x11698c['id']}}});}})[_0x4e63('0xf')](function(_0x35aad8){if(_0x35aad8){_0x334976=_0x35aad8;return require('../../config/license/util')[_0x4e63('0x51')]();}})[_0x4e63('0xf')](function(_0x542b36){if(_0x542b36&&_0x542b36[_0x4e63('0x52')]&&_0x334976>=_0x542b36[_0x4e63('0x52')]){throw new Error(_0x4e63('0x53'));}})[_0x4e63('0xf')](function(){if(_0x11698c){return db[_0x4e63('0x47')][_0x4e63('0x4a')]({'where':{'membername':_0x11698c[_0x4e63('0x26')]},'individualHooks':!![]});}})['then'](function(){if(_0x11698c){return _0x11698c[_0x4e63('0x54')]({'raw':!![]});}})['then'](function(_0xde31f7){if(_0x11698c){if(_0xde31f7){var _0x1f0800=[];_0x34a706=_0xde31f7;if(_0x34a706['length']){for(var _0x54c75b=0x0;_0x54c75b<_0x34a706[_0x4e63('0x2b')];_0x54c75b++){_0x1f0800[_0x4e63('0x30')](db[_0x4e63('0x47')][_0x4e63('0x55')]({'membername':_0x11698c['name'],'UserId':_0x11698c['id'],'queue_name':_0x34a706[_0x54c75b][_0x4e63('0x26')],'VoiceQueueId':_0x34a706[_0x54c75b]['id'],'interface':_0x1ed38d,'paused':_0x11698c['loginInPause']||![],'penalty':_0x34a706[_0x54c75b][_0x4e63('0x56')]||0x0}));}return BPromise[_0x4e63('0x48')](_0x1f0800);}}}})[_0x4e63('0xf')](function(){if(_0x11698c){return db[_0x4e63('0x29')]['findAll']({'where':{'membername':_0x11698c[_0x4e63('0x26')],'exitAt':null}});}})[_0x4e63('0xf')](function(_0x3e8050){if(_0x11698c){if(_0x3e8050&&_0x3e8050[_0x4e63('0x2b')]){var _0x9c317a=[];_0x3e8050[_0x4e63('0x4b')](function(_0x1a9e94){_0x9c317a['push'](_0x1a9e94['update']({'exitAt':moment()[_0x4e63('0x2c')](_0x4e63('0x2d'))}));});return BPromise[_0x4e63('0x48')](_0x9c317a);}}})[_0x4e63('0xf')](function(_0xfd47d6){if(_0x11698c){var _0x227ad7=[];var _0x4a4ceb=[];var _0x1c5538=utils[_0x4e63('0x2f')]();var _0x24a5a0={'membername':_0x11698c['name'],'interface':_0x1ed38d,'enterAt':moment()['format'](_0x4e63('0x2d')),'role':_0x11698c[_0x4e63('0x27')],'internal':_0x11698c[_0x4e63('0x37')]};_0x1c5538[_0x4e63('0x4b')](function(_0x59e33){_0x227ad7[_0x4e63('0x30')](_['merge']({'channel':_0x59e33,'type':_0x4e63('0x57'),'data1':'callysquare','data2':_0x1ed38d},_0x24a5a0));if(_0x11698c[_0x4e63('0x4e')]){_0x4a4ceb[_0x4e63('0x30')](_[_0x4e63('0x58')]({'channel':_0x59e33,'type':_0x4e63('0x2a'),'data1':'LOGININPAUSE'},_0x24a5a0));}});return db[_0x4e63('0x29')][_0x4e63('0x39')](_0x227ad7[_0x4e63('0x59')](_0x4a4ceb),{'individualHooks':!![]});}})[_0x4e63('0xf')](function(){if(_0x11698c){return _0x11698c[_0x4e63('0x28')]({'online':!![],'lastLoginAt':moment()[_0x4e63('0x2c')](_0x4e63('0x2d')),'voicePause':_0x11698c[_0x4e63('0x4e')]||![],'mailPause':_0x11698c['loginInPause']||![],'chatPause':_0x11698c[_0x4e63('0x4e')]||![],'faxPause':_0x11698c[_0x4e63('0x4e')]||![],'smsPause':_0x11698c[_0x4e63('0x4e')]||![],'openchannelPause':_0x11698c['loginInPause']||![],'pauseType':_0x11698c[_0x4e63('0x4e')]?_0x4e63('0x5a'):null,'lastPauseAt':moment()['format'](_0x4e63('0x2d')),'interface':_0x1ed38d});}})['then'](function(_0x5109f9){_0x27eb60(_0x5109f9);})['catch'](function(_0x4dfd0c){_0x12e844(_0x7d2c8a['error'](0x1f4,_0x4dfd0c[_0x4e63('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 18a7175..0050a31 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 _0x73f1=['removeListener','length','user:','./user.events','remove','emit'];(function(_0x3fb193,_0x553f1c){var _0x338eac=function(_0x232217){while(--_0x232217){_0x3fb193['push'](_0x3fb193['shift']());}};_0x338eac(++_0x553f1c);}(_0x73f1,0x165));var _0x173f=function(_0x24bb19,_0x555545){_0x24bb19=_0x24bb19-0x0;var _0x390ff9=_0x73f1[_0x24bb19];return _0x390ff9;};'use strict';var UserEvents=require(_0x173f('0x0'));var events=['save',_0x173f('0x1'),'update'];function createListener(_0x26cbd7,_0x1e25ea){return function(_0x67f003){_0x1e25ea[_0x173f('0x2')](_0x26cbd7,_0x67f003);};}function removeListener(_0x409ecb,_0x5ce76e){return function(){UserEvents[_0x173f('0x3')](_0x409ecb,_0x5ce76e);};}exports['register']=function(_0xfc489c){for(var _0x47a3c5=0x0,_0x27f914=events[_0x173f('0x4')];_0x47a3c5<_0x27f914;_0x47a3c5++){var _0x1aaa2b=events[_0x47a3c5];var _0x2e7119=createListener(_0x173f('0x5')+_0x1aaa2b,_0xfc489c);UserEvents['on'](_0x1aaa2b,_0x2e7119);}}; \ No newline at end of file +var _0x3d92=['update','emit','removeListener','register','length','user:','save','remove'];(function(_0x250ab7,_0x200335){var _0x284168=function(_0x50250a){while(--_0x50250a){_0x250ab7['push'](_0x250ab7['shift']());}};_0x284168(++_0x200335);}(_0x3d92,0xbe));var _0x23d9=function(_0x5f382f,_0x3f1432){_0x5f382f=_0x5f382f-0x0;var _0x3bb11b=_0x3d92[_0x5f382f];return _0x3bb11b;};'use strict';var UserEvents=require('./user.events');var events=[_0x23d9('0x0'),_0x23d9('0x1'),_0x23d9('0x2')];function createListener(_0x598552,_0x57cb77){return function(_0x587077){_0x57cb77[_0x23d9('0x3')](_0x598552,_0x587077);};}function removeListener(_0x573d23,_0x3b5dd6){return function(){UserEvents[_0x23d9('0x4')](_0x573d23,_0x3b5dd6);};}exports[_0x23d9('0x5')]=function(_0x1ff035){for(var _0x2584ef=0x0,_0xd0e8a0=events[_0x23d9('0x6')];_0x2584ef<_0xd0e8a0;_0x2584ef++){var _0x277154=events[_0x2584ef];var _0x893a22=createListener(_0x23d9('0x7')+_0x277154,_0x1ff035);UserEvents['on'](_0x277154,_0x893a22);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 7f6a5a2..80c3ad9 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 _0x2118=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer'];(function(_0x3c48eb,_0x211733){var _0x2565e7=function(_0x1cad33){while(--_0x1cad33){_0x3c48eb['push'](_0x3c48eb['shift']());}};_0x2565e7(++_0x211733);}(_0x2118,0x14c));var _0x8211=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x2118[_0x2be8c2];return _0x97f531;};'use strict';var multer=require(_0x8211('0x0'));var util=require('util');var path=require(_0x8211('0x1'));var timeout=require(_0x8211('0x2'));var express=require(_0x8211('0x3'));var router=express[_0x8211('0x4')]();var auth=require(_0x8211('0x5'));var interaction=require(_0x8211('0x6'));var config=require(_0x8211('0x7'));module[_0x8211('0x8')]=router; \ No newline at end of file +var _0x966d=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','util','path','connect-timeout'];(function(_0x3f5210,_0x32f195){var _0x53c3ab=function(_0x341fa0){while(--_0x341fa0){_0x3f5210['push'](_0x3f5210['shift']());}};_0x53c3ab(++_0x32f195);}(_0x966d,0x1e3));var _0xd966=function(_0x425ed8,_0x16bf1b){_0x425ed8=_0x425ed8-0x0;var _0x3c9a3a=_0x966d[_0x425ed8];return _0x3c9a3a;};'use strict';var multer=require('multer');var util=require(_0xd966('0x0'));var path=require(_0xd966('0x1'));var timeout=require(_0xd966('0x2'));var express=require(_0xd966('0x3'));var router=express[_0xd966('0x4')]();var auth=require(_0xd966('0x5'));var interaction=require(_0xd966('0x6'));var config=require(_0xd966('0x7'));module[_0xd966('0x8')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index ce006ff..1edb0e8 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 _0xd8b0=['exports','sequelize'];(function(_0x537563,_0x1eab9e){var _0x3d3f2=function(_0x3fdb0a){while(--_0x3fdb0a){_0x537563['push'](_0x537563['shift']());}};_0x3d3f2(++_0x1eab9e);}(_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')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x310202,_0x4c2c3b){var _0x27497e=function(_0x428416){while(--_0x428416){_0x310202['push'](_0x310202['shift']());}};_0x27497e(++_0x4c2c3b);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'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 0b345cd..cd3da36 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 _0x40d2=['define','UserChatQueue','user_has_chat_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes','exports'];(function(_0x91d019,_0x5223c4){var _0x19de1f=function(_0x3e1311){while(--_0x3e1311){_0x91d019['push'](_0x91d019['shift']());}};_0x19de1f(++_0x5223c4);}(_0x40d2,0x17d));var _0x240d=function(_0x37031f,_0x16a8e8){_0x37031f=_0x37031f-0x0;var _0x35192b=_0x40d2[_0x37031f];return _0x35192b;};'use strict';var _=require(_0x240d('0x0'));var util=require('util');var logger=require(_0x240d('0x1'))(_0x240d('0x2'));var moment=require(_0x240d('0x3'));var BPromise=require(_0x240d('0x4'));var rp=require(_0x240d('0x5'));var fs=require('fs');var path=require(_0x240d('0x6'));var rimraf=require(_0x240d('0x7'));var config=require(_0x240d('0x8'));var attributes=require(_0x240d('0x9'));module[_0x240d('0xa')]=function(_0x7b9a61,_0x22aca9){return _0x7b9a61[_0x240d('0xb')](_0x240d('0xc'),attributes,{'tableName':_0x240d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9f7c=['./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9f7c,0x113));var _0xc9f7=function(_0x244237,_0x4f3cb8){_0x244237=_0x244237-0x0;var _0x1464de=_0x9f7c[_0x244237];return _0x1464de;};'use strict';var _=require(_0xc9f7('0x0'));var util=require(_0xc9f7('0x1'));var logger=require(_0xc9f7('0x2'))(_0xc9f7('0x3'));var moment=require(_0xc9f7('0x4'));var BPromise=require(_0xc9f7('0x5'));var rp=require(_0xc9f7('0x6'));var fs=require('fs');var path=require(_0xc9f7('0x7'));var rimraf=require(_0xc9f7('0x8'));var config=require(_0xc9f7('0x9'));var attributes=require(_0xc9f7('0xa'));module[_0xc9f7('0xb')]=function(_0x19ab42,_0x391e96){return _0x19ab42[_0xc9f7('0xc')](_0xc9f7('0xd'),attributes,{'tableName':_0xc9f7('0xe'),'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 061ef07..72ec2aa 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 _0xe75f=['UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserChatQueue,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','debug'];(function(_0x31745e,_0x36d1c4){var _0x5563cd=function(_0x5d1a03){while(--_0x5d1a03){_0x31745e['push'](_0x31745e['shift']());}};_0x5563cd(++_0x36d1c4);}(_0xe75f,0x92));var _0xfe75=function(_0x5bb950,_0x4a9d73){_0x5bb950=_0x5bb950-0x0;var _0x5236a1=_0xe75f[_0x5bb950];return _0x5236a1;};'use strict';var _=require(_0xfe75('0x0'));var util=require(_0xfe75('0x1'));var moment=require('moment');var BPromise=require(_0xfe75('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfe75('0x3'));var db=require(_0xfe75('0x4'))['db'];var utils=require(_0xfe75('0x5'));var logger=require(_0xfe75('0x6'))('rpc');var config=require(_0xfe75('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xfe75('0x8')][_0xfe75('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x323e73,_0x57f021,_0x50b448){return new BPromise(function(_0x10a6e7,_0x21acc7){return client[_0xfe75('0xa')](_0x323e73,_0x50b448)[_0xfe75('0xb')](function(_0x281d34){logger[_0xfe75('0xc')]('UserChatQueue,\x20%s,\x20%s',_0x57f021,_0xfe75('0xd'));logger[_0xfe75('0xe')](_0xfe75('0xf'),_0x57f021,_0xfe75('0xd'),JSON[_0xfe75('0x10')](_0x281d34));if(_0x281d34[_0xfe75('0x11')]){if(_0x281d34[_0xfe75('0x11')][_0xfe75('0x12')]===0x1f4){logger['error'](_0xfe75('0x13'),_0x57f021,_0x281d34[_0xfe75('0x11')]['message']);return _0x21acc7(_0x281d34[_0xfe75('0x11')][_0xfe75('0x14')]);}logger[_0xfe75('0x11')](_0xfe75('0x13'),_0x57f021,_0x281d34[_0xfe75('0x11')][_0xfe75('0x14')]);return _0x10a6e7(_0x281d34[_0xfe75('0x11')][_0xfe75('0x14')]);}else{logger[_0xfe75('0xc')]('UserChatQueue,\x20%s,\x20%s',_0x57f021,_0xfe75('0xd'));_0x10a6e7(_0x281d34[_0xfe75('0x15')][_0xfe75('0x14')]);}})[_0xfe75('0x16')](function(_0x593d23){logger['error'](_0xfe75('0x13'),_0x57f021,_0x593d23);_0x21acc7(_0x593d23);});});} \ No newline at end of file +var _0xa231=['ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','moment','bluebird','randomstring'];(function(_0x56e177,_0xe5af5b){var _0x2cb0e4=function(_0x26cee1){while(--_0x26cee1){_0x56e177['push'](_0x56e177['shift']());}};_0x2cb0e4(++_0xe5af5b);}(_0xa231,0x18d));var _0x1a23=function(_0x4879b8,_0x55569f){_0x4879b8=_0x4879b8-0x0;var _0x34abae=_0xa231[_0x4879b8];return _0x34abae;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1a23('0x0'));var BPromise=require(_0x1a23('0x1'));var rs=require(_0x1a23('0x2'));var fs=require('fs');var Redis=require(_0x1a23('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1a23('0x4'))(_0x1a23('0x5'));var config=require(_0x1a23('0x6'));var jayson=require(_0x1a23('0x7'));var client=jayson[_0x1a23('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d4da4,_0x531182,_0x4b3275){return new BPromise(function(_0x51f5e4,_0x4926ed){return client[_0x1a23('0x9')](_0x5d4da4,_0x4b3275)['then'](function(_0x26b969){logger[_0x1a23('0xa')](_0x1a23('0xb'),_0x531182,_0x1a23('0xc'));logger[_0x1a23('0xd')](_0x1a23('0xe'),_0x531182,'request\x20sent',JSON[_0x1a23('0xf')](_0x26b969));if(_0x26b969[_0x1a23('0x10')]){if(_0x26b969[_0x1a23('0x10')][_0x1a23('0x11')]===0x1f4){logger[_0x1a23('0x10')](_0x1a23('0xb'),_0x531182,_0x26b969[_0x1a23('0x10')][_0x1a23('0x12')]);return _0x4926ed(_0x26b969[_0x1a23('0x10')][_0x1a23('0x12')]);}logger[_0x1a23('0x10')]('UserChatQueue,\x20%s,\x20%s',_0x531182,_0x26b969['error']['message']);return _0x51f5e4(_0x26b969[_0x1a23('0x10')][_0x1a23('0x12')]);}else{logger[_0x1a23('0xa')]('UserChatQueue,\x20%s,\x20%s',_0x531182,'request\x20sent');_0x51f5e4(_0x26b969['result']['message']);}})[_0x1a23('0x13')](function(_0x568793){logger[_0x1a23('0x10')](_0x1a23('0xb'),_0x531182,_0x568793);_0x4926ed(_0x568793);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 6d9bf50..e048a7c 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 _0x88b4=['../../config/environment','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service'];(function(_0x42ae6f,_0x5e2fa9){var _0x503692=function(_0x2fae71){while(--_0x2fae71){_0x42ae6f['push'](_0x42ae6f['shift']());}};_0x503692(++_0x5e2fa9);}(_0x88b4,0xf2));var _0x488b=function(_0x39609a,_0x28a563){_0x39609a=_0x39609a-0x0;var _0xecd92=_0x88b4[_0x39609a];return _0xecd92;};'use strict';var multer=require(_0x488b('0x0'));var util=require(_0x488b('0x1'));var path=require(_0x488b('0x2'));var timeout=require(_0x488b('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x488b('0x4'));var interaction=require(_0x488b('0x5'));var config=require(_0x488b('0x6'));module[_0x488b('0x7')]=router; \ No newline at end of file +var _0xd4b2=['../../components/interaction/service','../../config/environment','multer','util','path','express','../../components/auth/service'];(function(_0x34d061,_0x38271a){var _0x51c669=function(_0x146663){while(--_0x146663){_0x34d061['push'](_0x34d061['shift']());}};_0x51c669(++_0x38271a);}(_0xd4b2,0x95));var _0x2d4b=function(_0x487496,_0x249683){_0x487496=_0x487496-0x0;var _0x539dc8=_0xd4b2[_0x487496];return _0x539dc8;};'use strict';var multer=require(_0x2d4b('0x0'));var util=require(_0x2d4b('0x1'));var path=require(_0x2d4b('0x2'));var timeout=require('connect-timeout');var express=require(_0x2d4b('0x3'));var router=express['Router']();var auth=require(_0x2d4b('0x4'));var interaction=require(_0x2d4b('0x5'));var config=require(_0x2d4b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 902bd77..47654cb 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 _0xf4f4=['exports','INTEGER','STRING','sequelize'];(function(_0x5bf420,_0x2d068d){var _0x1c5255=function(_0x4964a2){while(--_0x4964a2){_0x5bf420['push'](_0x5bf420['shift']());}};_0x1c5255(++_0x2d068d);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x30c472,_0x317455){_0x30c472=_0x30c472-0x0;var _0x18ef1c=_0xf4f4[_0x30c472];return _0x18ef1c;};'use strict';var Sequelize=require(_0x4f4f('0x0'));module[_0x4f4f('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x4f4f('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x4f4f('0x3')]}}; \ No newline at end of file +var _0x36ee=['INTEGER','STRING'];(function(_0x4eec27,_0x5c496f){var _0x398f61=function(_0x346e19){while(--_0x346e19){_0x4eec27['push'](_0x4eec27['shift']());}};_0x398f61(++_0x5c496f);}(_0x36ee,0xe8));var _0xe36e=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x36ee[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xe36e('0x0')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0xe36e('0x1')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index eccdb4c..4939df7 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 _0xd33b=['bluebird','request-promise','path','rimraf','../../config/environment','define','UserFaxQueue','user_has_fax_queues','lodash','util','api','moment'];(function(_0x1d9c51,_0x14082f){var _0x2a6e18=function(_0x10798c){while(--_0x10798c){_0x1d9c51['push'](_0x1d9c51['shift']());}};_0x2a6e18(++_0x14082f);}(_0xd33b,0x74));var _0xbd33=function(_0x32572e,_0x5d45e3){_0x32572e=_0x32572e-0x0;var _0x55fe53=_0xd33b[_0x32572e];return _0x55fe53;};'use strict';var _=require(_0xbd33('0x0'));var util=require(_0xbd33('0x1'));var logger=require('../../config/logger')(_0xbd33('0x2'));var moment=require(_0xbd33('0x3'));var BPromise=require(_0xbd33('0x4'));var rp=require(_0xbd33('0x5'));var fs=require('fs');var path=require(_0xbd33('0x6'));var rimraf=require(_0xbd33('0x7'));var config=require(_0xbd33('0x8'));var attributes=require('./userFaxQueue.attributes');module['exports']=function(_0x4d5fec,_0x112362){return _0x4d5fec[_0xbd33('0x9')](_0xbd33('0xa'),attributes,{'tableName':_0xbd33('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x12ae=['define','UserFaxQueue','user_has_fax_queues','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes'];(function(_0x4fc143,_0x40e04c){var _0x3252db=function(_0xae2777){while(--_0xae2777){_0x4fc143['push'](_0x4fc143['shift']());}};_0x3252db(++_0x40e04c);}(_0x12ae,0x175));var _0xe12a=function(_0x29f270,_0x30846e){_0x29f270=_0x29f270-0x0;var _0x337a37=_0x12ae[_0x29f270];return _0x337a37;};'use strict';var _=require('lodash');var util=require(_0xe12a('0x0'));var logger=require(_0xe12a('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe12a('0x2'));var fs=require('fs');var path=require(_0xe12a('0x3'));var rimraf=require(_0xe12a('0x4'));var config=require(_0xe12a('0x5'));var attributes=require(_0xe12a('0x6'));module['exports']=function(_0x334f17,_0xca8264){return _0x334f17[_0xe12a('0x7')](_0xe12a('0x8'),attributes,{'tableName':_0xe12a('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 752f07f..20c0ca6 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 _0x5166=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x1be9b9,_0xd8a8ee){var _0x3fb7f8=function(_0x3e0699){while(--_0x3e0699){_0x1be9b9['push'](_0x1be9b9['shift']());}};_0x3fb7f8(++_0xd8a8ee);}(_0x5166,0xd0));var _0x6516=function(_0x1051ea,_0xe12f11){_0x1051ea=_0x1051ea-0x0;var _0x492f8b=_0x5166[_0x1051ea];return _0x492f8b;};'use strict';var _=require(_0x6516('0x0'));var util=require(_0x6516('0x1'));var moment=require(_0x6516('0x2'));var BPromise=require(_0x6516('0x3'));var rs=require(_0x6516('0x4'));var fs=require('fs');var Redis=require(_0x6516('0x5'));var db=require(_0x6516('0x6'))['db'];var utils=require(_0x6516('0x7'));var logger=require(_0x6516('0x8'))(_0x6516('0x9'));var config=require(_0x6516('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6516('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd39,_0x589009,_0x176fd2){return new BPromise(function(_0x4f31ba,_0x28963b){return client[_0x6516('0xc')](_0x24cd39,_0x176fd2)[_0x6516('0xd')](function(_0x1ee87b){logger['info'](_0x6516('0xe'),_0x589009,_0x6516('0xf'));logger[_0x6516('0x10')](_0x6516('0x11'),_0x589009,'request\x20sent',JSON['stringify'](_0x1ee87b));if(_0x1ee87b[_0x6516('0x12')]){if(_0x1ee87b['error'][_0x6516('0x13')]===0x1f4){logger[_0x6516('0x12')](_0x6516('0xe'),_0x589009,_0x1ee87b['error'][_0x6516('0x14')]);return _0x28963b(_0x1ee87b['error'][_0x6516('0x14')]);}logger[_0x6516('0x12')](_0x6516('0xe'),_0x589009,_0x1ee87b[_0x6516('0x12')][_0x6516('0x14')]);return _0x4f31ba(_0x1ee87b[_0x6516('0x12')]['message']);}else{logger[_0x6516('0x15')](_0x6516('0xe'),_0x589009,_0x6516('0xf'));_0x4f31ba(_0x1ee87b[_0x6516('0x16')][_0x6516('0x14')]);}})['catch'](function(_0x2490f5){logger[_0x6516('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x589009,_0x2490f5);_0x28963b(_0x2490f5);});});} \ No newline at end of file +var _0x719a=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment'];(function(_0x492a9e,_0x6fa20d){var _0x3fd27a=function(_0x368c09){while(--_0x368c09){_0x492a9e['push'](_0x492a9e['shift']());}};_0x3fd27a(++_0x6fa20d);}(_0x719a,0x16d));var _0xa719=function(_0x506967,_0x5567ef){_0x506967=_0x506967-0x0;var _0x4f4c5a=_0x719a[_0x506967];return _0x4f4c5a;};'use strict';var _=require(_0xa719('0x0'));var util=require(_0xa719('0x1'));var moment=require(_0xa719('0x2'));var BPromise=require(_0xa719('0x3'));var rs=require(_0xa719('0x4'));var fs=require('fs');var Redis=require(_0xa719('0x5'));var db=require(_0xa719('0x6'))['db'];var utils=require(_0xa719('0x7'));var logger=require('../../config/logger')(_0xa719('0x8'));var config=require(_0xa719('0x9'));var jayson=require(_0xa719('0xa'));var client=jayson[_0xa719('0xb')][_0xa719('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5767b9,_0x44876c,_0x4e489c){return new BPromise(function(_0x40c2ff,_0x110e6f){return client['request'](_0x5767b9,_0x4e489c)['then'](function(_0x277220){logger[_0xa719('0xd')](_0xa719('0xe'),_0x44876c,'request\x20sent');logger[_0xa719('0xf')](_0xa719('0x10'),_0x44876c,_0xa719('0x11'),JSON[_0xa719('0x12')](_0x277220));if(_0x277220[_0xa719('0x13')]){if(_0x277220[_0xa719('0x13')]['code']===0x1f4){logger[_0xa719('0x13')](_0xa719('0xe'),_0x44876c,_0x277220['error']['message']);return _0x110e6f(_0x277220['error'][_0xa719('0x14')]);}logger[_0xa719('0x13')]('UserFaxQueue,\x20%s,\x20%s',_0x44876c,_0x277220[_0xa719('0x13')][_0xa719('0x14')]);return _0x40c2ff(_0x277220[_0xa719('0x13')]['message']);}else{logger[_0xa719('0xd')](_0xa719('0xe'),_0x44876c,'request\x20sent');_0x40c2ff(_0x277220[_0xa719('0x15')][_0xa719('0x14')]);}})[_0xa719('0x16')](function(_0x507ba6){logger[_0xa719('0x13')](_0xa719('0xe'),_0x44876c,_0x507ba6);_0x110e6f(_0x507ba6);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 79bb55c..718678b 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 _0xa504=['util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','exports','multer'];(function(_0x4bdad2,_0x3bb56b){var _0x249aa7=function(_0x435fd5){while(--_0x435fd5){_0x4bdad2['push'](_0x4bdad2['shift']());}};_0x249aa7(++_0x3bb56b);}(_0xa504,0x14f));var _0x4a50=function(_0x38e370,_0x2f9d10){_0x38e370=_0x38e370-0x0;var _0x53a265=_0xa504[_0x38e370];return _0x53a265;};'use strict';var multer=require(_0x4a50('0x0'));var util=require(_0x4a50('0x1'));var path=require(_0x4a50('0x2'));var timeout=require(_0x4a50('0x3'));var express=require('express');var router=express[_0x4a50('0x4')]();var auth=require(_0x4a50('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4a50('0x6'));module[_0x4a50('0x7')]=router; \ No newline at end of file +var _0xbe64=['../../components/auth/service','../../components/interaction/service','exports','util','path','connect-timeout','express'];(function(_0x4d750a,_0x221a9b){var _0x11300b=function(_0xa8204c){while(--_0xa8204c){_0x4d750a['push'](_0x4d750a['shift']());}};_0x11300b(++_0x221a9b);}(_0xbe64,0x65));var _0x4be6=function(_0x199c03,_0x3254aa){_0x199c03=_0x199c03-0x0;var _0x11a7d4=_0xbe64[_0x199c03];return _0x11a7d4;};'use strict';var multer=require('multer');var util=require(_0x4be6('0x0'));var path=require(_0x4be6('0x1'));var timeout=require(_0x4be6('0x2'));var express=require(_0x4be6('0x3'));var router=express['Router']();var auth=require(_0x4be6('0x4'));var interaction=require(_0x4be6('0x5'));var config=require('../../config/environment');module[_0x4be6('0x6')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index ba0b1a5..55e5a5d 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 _0xd8b0=['exports','sequelize'];(function(_0x1830ce,_0x305798){var _0x2bce9f=function(_0x9ea7dc){while(--_0x9ea7dc){_0x1830ce['push'](_0x1830ce['shift']());}};_0x2bce9f(++_0x305798);}(_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')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0xdc0e64,_0x38bf67){var _0xb04e82=function(_0x638bea){while(--_0x638bea){_0xdc0e64['push'](_0xdc0e64['shift']());}};_0xb04e82(++_0x38bf67);}(_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')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index b356562..7c4bfdd 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 _0x757a=['define','user_has_mail_queues','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports'];(function(_0x4583f5,_0x48986e){var _0x16513b=function(_0x324230){while(--_0x324230){_0x4583f5['push'](_0x4583f5['shift']());}};_0x16513b(++_0x48986e);}(_0x757a,0xde));var _0xa757=function(_0x23bdc4,_0x2facb2){_0x23bdc4=_0x23bdc4-0x0;var _0x4c407e=_0x757a[_0x23bdc4];return _0x4c407e;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('UserMailQueue',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd8b0=['define','user_has_mail_queues','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4a89c4,_0x22c3f7){var _0x244576=function(_0x2a8fd2){while(--_0x2a8fd2){_0x4a89c4['push'](_0x4a89c4['shift']());}};_0x244576(++_0x22c3f7);}(_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('./userMailQueue.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('UserMailQueue',attributes,{'tableName':_0x0d8b('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 cddf19b..53752e6 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 _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserMailQueue,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4a39f2,_0x4ef331){var _0x1d8bc9=function(_0x44aa39){while(--_0x44aa39){_0x4a39f2['push'](_0x4a39f2['shift']());}};_0x1d8bc9(++_0x4ef331);}(_0x5fab,0x177));var _0xb5fa=function(_0x1c571e,_0x548a78){_0x1c571e=_0x1c571e-0x0;var _0x4c546e=_0x5fab[_0x1c571e];return _0x4c546e;};'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']('UserMailQueue,\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')]('UserMailQueue,\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']('UserMailQueue,\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 +var _0xbac8=['error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xa21e00,_0x57590b){var _0x46cadf=function(_0x8e55ef){while(--_0x8e55ef){_0xa21e00['push'](_0xa21e00['shift']());}};_0x46cadf(++_0x57590b);}(_0xbac8,0x140));var _0x8bac=function(_0x2585c2,_0x528ddd){_0x2585c2=_0x2585c2-0x0;var _0x156c82=_0xbac8[_0x2585c2];return _0x156c82;};'use strict';var _=require(_0x8bac('0x0'));var util=require(_0x8bac('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8bac('0x2'));var fs=require('fs');var Redis=require(_0x8bac('0x3'));var db=require(_0x8bac('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8bac('0x5'))(_0x8bac('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8bac('0x7')][_0x8bac('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3e95bb,_0x65a44b,_0x2e6c33){return new BPromise(function(_0x3a315c,_0x1593a1){return client[_0x8bac('0x9')](_0x3e95bb,_0x2e6c33)[_0x8bac('0xa')](function(_0x5a934f){logger[_0x8bac('0xb')](_0x8bac('0xc'),_0x65a44b,_0x8bac('0xd'));logger['debug'](_0x8bac('0xe'),_0x65a44b,'request\x20sent',JSON[_0x8bac('0xf')](_0x5a934f));if(_0x5a934f[_0x8bac('0x10')]){if(_0x5a934f['error'][_0x8bac('0x11')]===0x1f4){logger[_0x8bac('0x10')](_0x8bac('0xc'),_0x65a44b,_0x5a934f[_0x8bac('0x10')][_0x8bac('0x12')]);return _0x1593a1(_0x5a934f['error']['message']);}logger[_0x8bac('0x10')](_0x8bac('0xc'),_0x65a44b,_0x5a934f['error'][_0x8bac('0x12')]);return _0x3a315c(_0x5a934f['error']['message']);}else{logger[_0x8bac('0xb')](_0x8bac('0xc'),_0x65a44b,_0x8bac('0xd'));_0x3a315c(_0x5a934f[_0x8bac('0x13')][_0x8bac('0x12')]);}})[_0x8bac('0x14')](function(_0x50dba1){logger['error'](_0x8bac('0xc'),_0x65a44b,_0x50dba1);_0x1593a1(_0x50dba1);});});} \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 917eb71..e5b0ec0 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 _0x175b=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','exports','multer'];(function(_0x5f471d,_0x48a68a){var _0x1723df=function(_0x4d0c57){while(--_0x4d0c57){_0x5f471d['push'](_0x5f471d['shift']());}};_0x1723df(++_0x48a68a);}(_0x175b,0x1ca));var _0xb175=function(_0x4bb593,_0x272ed0){_0x4bb593=_0x4bb593-0x0;var _0x2da2d8=_0x175b[_0x4bb593];return _0x2da2d8;};'use strict';var multer=require(_0xb175('0x0'));var util=require(_0xb175('0x1'));var path=require(_0xb175('0x2'));var timeout=require(_0xb175('0x3'));var express=require(_0xb175('0x4'));var router=express[_0xb175('0x5')]();var auth=require(_0xb175('0x6'));var interaction=require(_0xb175('0x7'));var config=require('../../config/environment');module[_0xb175('0x8')]=router; \ No newline at end of file +var _0x7136=['multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x3ebbf8,_0x2bc93c){var _0x445a9d=function(_0x5e7f03){while(--_0x5e7f03){_0x3ebbf8['push'](_0x3ebbf8['shift']());}};_0x445a9d(++_0x2bc93c);}(_0x7136,0x1c0));var _0x6713=function(_0x8b3778,_0x4453db){_0x8b3778=_0x8b3778-0x0;var _0x53bdc8=_0x7136[_0x8b3778];return _0x53bdc8;};'use strict';var multer=require(_0x6713('0x0'));var util=require(_0x6713('0x1'));var path=require(_0x6713('0x2'));var timeout=require('connect-timeout');var express=require(_0x6713('0x3'));var router=express[_0x6713('0x4')]();var auth=require(_0x6713('0x5'));var interaction=require(_0x6713('0x6'));var config=require('../../config/environment');module[_0x6713('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 a23645e..da2cc4a 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 _0xd8b0=['exports','sequelize'];(function(_0x4884a7,_0x18e38a){var _0x56b60e=function(_0x2ba8a3){while(--_0x2ba8a3){_0x4884a7['push'](_0x4884a7['shift']());}};_0x56b60e(++_0x18e38a);}(_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')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x57112d,_0x9ea573){var _0x3c32b9=function(_0x349dda){while(--_0x349dda){_0x57112d['push'](_0x57112d['shift']());}};_0x3c32b9(++_0x9ea573);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'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 b05198f..9b1d9dd 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 _0x136d=['rimraf','../../config/environment','exports','define','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x281907,_0x4b36f8){var _0x4d254e=function(_0x319e55){while(--_0x319e55){_0x281907['push'](_0x281907['shift']());}};_0x4d254e(++_0x4b36f8);}(_0x136d,0x16c));var _0xd136=function(_0x2e4a0f,_0x3a9bb6){_0x2e4a0f=_0x2e4a0f-0x0;var _0x25a3cd=_0x136d[_0x2e4a0f];return _0x25a3cd;};'use strict';var _=require(_0xd136('0x0'));var util=require(_0xd136('0x1'));var logger=require(_0xd136('0x2'))(_0xd136('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd136('0x4'));var fs=require('fs');var path=require(_0xd136('0x5'));var rimraf=require(_0xd136('0x6'));var config=require(_0xd136('0x7'));var attributes=require('./userOpenchannelQueue.attributes');module[_0xd136('0x8')]=function(_0x3e7b70,_0x2f6a43){return _0x3e7b70[_0xd136('0x9')]('UserOpenchannelQueue',attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc4a0=['bluebird','request-promise','path','rimraf','./userOpenchannelQueue.attributes','define','user_has_openchannel_queues','../../config/logger','api','moment'];(function(_0x50bee0,_0x57c5fd){var _0x5de281=function(_0x2ad8af){while(--_0x2ad8af){_0x50bee0['push'](_0x50bee0['shift']());}};_0x5de281(++_0x57c5fd);}(_0xc4a0,0xb1));var _0x0c4a=function(_0x542f5f,_0x261625){_0x542f5f=_0x542f5f-0x0;var _0xcdef50=_0xc4a0[_0x542f5f];return _0xcdef50;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0c4a('0x0'))(_0x0c4a('0x1'));var moment=require(_0x0c4a('0x2'));var BPromise=require(_0x0c4a('0x3'));var rp=require(_0x0c4a('0x4'));var fs=require('fs');var path=require(_0x0c4a('0x5'));var rimraf=require(_0x0c4a('0x6'));var config=require('../../config/environment');var attributes=require(_0x0c4a('0x7'));module['exports']=function(_0x1adaa7,_0x4f230d){return _0x1adaa7[_0x0c4a('0x8')]('UserOpenchannelQueue',attributes,{'tableName':_0x0c4a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index 09524d6..6ef90b0 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 _0x8c40=['catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0x8c40,0x1a3));var _0x08c4=function(_0x5d879a,_0x491614){_0x5d879a=_0x5d879a-0x0;var _0x293d5c=_0x8c40[_0x5d879a];return _0x293d5c;};'use strict';var _=require(_0x08c4('0x0'));var util=require('util');var moment=require(_0x08c4('0x1'));var BPromise=require('bluebird');var rs=require(_0x08c4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x08c4('0x3'))['db'];var utils=require(_0x08c4('0x4'));var logger=require(_0x08c4('0x5'))(_0x08c4('0x6'));var config=require(_0x08c4('0x7'));var jayson=require(_0x08c4('0x8'));var client=jayson[_0x08c4('0x9')][_0x08c4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x49ac5d,_0x33b6fb,_0x4417c8){return new BPromise(function(_0x34ab02,_0x505b7d){return client['request'](_0x49ac5d,_0x4417c8)[_0x08c4('0xb')](function(_0x32e019){logger[_0x08c4('0xc')](_0x08c4('0xd'),_0x33b6fb,_0x08c4('0xe'));logger[_0x08c4('0xf')](_0x08c4('0x10'),_0x33b6fb,'request\x20sent',JSON['stringify'](_0x32e019));if(_0x32e019['error']){if(_0x32e019[_0x08c4('0x11')][_0x08c4('0x12')]===0x1f4){logger['error'](_0x08c4('0xd'),_0x33b6fb,_0x32e019[_0x08c4('0x11')]['message']);return _0x505b7d(_0x32e019[_0x08c4('0x11')]['message']);}logger[_0x08c4('0x11')](_0x08c4('0xd'),_0x33b6fb,_0x32e019[_0x08c4('0x11')][_0x08c4('0x13')]);return _0x34ab02(_0x32e019[_0x08c4('0x11')][_0x08c4('0x13')]);}else{logger['info'](_0x08c4('0xd'),_0x33b6fb,_0x08c4('0xe'));_0x34ab02(_0x32e019[_0x08c4('0x14')][_0x08c4('0x13')]);}})[_0x08c4('0x15')](function(_0x2e8ee){logger[_0x08c4('0x11')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x33b6fb,_0x2e8ee);_0x505b7d(_0x2e8ee);});});} \ No newline at end of file +var _0xa14f=['../../config/logger','../../config/environment','jayson/promise','http','request','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x267957,_0x4f1181){var _0x3047fe=function(_0xe9478e){while(--_0xe9478e){_0x267957['push'](_0x267957['shift']());}};_0x3047fe(++_0x4f1181);}(_0xa14f,0x164));var _0xfa14=function(_0x4d3ff8,_0x477ba4){_0x4d3ff8=_0x4d3ff8-0x0;var _0x32e27b=_0xa14f[_0x4d3ff8];return _0x32e27b;};'use strict';var _=require(_0xfa14('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xfa14('0x1'));var rs=require(_0xfa14('0x2'));var fs=require('fs');var Redis=require(_0xfa14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xfa14('0x4'));var logger=require(_0xfa14('0x5'))('rpc');var config=require(_0xfa14('0x6'));var jayson=require(_0xfa14('0x7'));var client=jayson['client'][_0xfa14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3cb362,_0x581c28,_0x11f0cd){return new BPromise(function(_0x1e34e6,_0x576aa4){return client[_0xfa14('0x9')](_0x3cb362,_0x11f0cd)['then'](function(_0x28f959){logger[_0xfa14('0xa')](_0xfa14('0xb'),_0x581c28,_0xfa14('0xc'));logger[_0xfa14('0xd')](_0xfa14('0xe'),_0x581c28,_0xfa14('0xc'),JSON[_0xfa14('0xf')](_0x28f959));if(_0x28f959['error']){if(_0x28f959[_0xfa14('0x10')]['code']===0x1f4){logger[_0xfa14('0x10')](_0xfa14('0xb'),_0x581c28,_0x28f959[_0xfa14('0x10')][_0xfa14('0x11')]);return _0x576aa4(_0x28f959['error'][_0xfa14('0x11')]);}logger[_0xfa14('0x10')](_0xfa14('0xb'),_0x581c28,_0x28f959[_0xfa14('0x10')][_0xfa14('0x11')]);return _0x1e34e6(_0x28f959[_0xfa14('0x10')]['message']);}else{logger[_0xfa14('0xa')](_0xfa14('0xb'),_0x581c28,_0xfa14('0xc'));_0x1e34e6(_0x28f959[_0xfa14('0x12')]['message']);}})['catch'](function(_0xe94487){logger[_0xfa14('0x10')](_0xfa14('0xb'),_0x581c28,_0xe94487);_0x576aa4(_0xe94487);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 46d42b2..9cd6ae1 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 _0x59cd=['put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','./userProfile.controller','isAuthenticated','index','/describe','/:id','show','get','/:id/sections','getSections','/:id/resources','getResources','post','create','/:id/clone','addSections','addResources'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0x59cd,0x19a));var _0xd59c=function(_0x4cbb8e,_0x1047c8){_0x4cbb8e=_0x4cbb8e-0x0;var _0x17846f=_0x59cd[_0x4cbb8e];return _0x17846f;};'use strict';var multer=require(_0xd59c('0x0'));var util=require(_0xd59c('0x1'));var path=require('path');var timeout=require(_0xd59c('0x2'));var express=require(_0xd59c('0x3'));var router=express[_0xd59c('0x4')]();var auth=require(_0xd59c('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd59c('0x6'));router['get']('/',auth[_0xd59c('0x7')](),controller[_0xd59c('0x8')]);router['get'](_0xd59c('0x9'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xd59c('0xa'),auth[_0xd59c('0x7')](),controller[_0xd59c('0xb')]);router[_0xd59c('0xc')](_0xd59c('0xd'),auth[_0xd59c('0x7')](),controller[_0xd59c('0xe')]);router[_0xd59c('0xc')](_0xd59c('0xf'),auth[_0xd59c('0x7')](),controller[_0xd59c('0x10')]);router[_0xd59c('0x11')]('/',auth[_0xd59c('0x7')](),controller[_0xd59c('0x12')]);router['post'](_0xd59c('0x13'),auth[_0xd59c('0x7')](),controller['clone']);router['post']('/:id/sections',auth['isAuthenticated'](),controller[_0xd59c('0x14')]);router['post'](_0xd59c('0xf'),auth[_0xd59c('0x7')](),controller[_0xd59c('0x15')]);router[_0xd59c('0x16')](_0xd59c('0xa'),auth[_0xd59c('0x7')](),controller[_0xd59c('0x17')]);router[_0xd59c('0x18')](_0xd59c('0xa'),auth[_0xd59c('0x7')](),controller[_0xd59c('0x19')]);router[_0xd59c('0x18')]('/:id/sections',auth['isAuthenticated'](),controller['removeSections']);router[_0xd59c('0x18')](_0xd59c('0xf'),auth[_0xd59c('0x7')](),controller['removeResources']);module[_0xd59c('0x1a')]=router; \ No newline at end of file +var _0xcac2=['/:id/clone','clone','addSections','put','update','delete','destroy','removeSections','removeResources','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','/:id','show','/:id/sections','getSections','/:id/resources','getResources'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xcac2,0xda));var _0x2cac=function(_0x10011e,_0x4ec99b){_0x10011e=_0x10011e-0x0;var _0x4f3705=_0xcac2[_0x10011e];return _0x4f3705;};'use strict';var multer=require(_0x2cac('0x0'));var util=require(_0x2cac('0x1'));var path=require(_0x2cac('0x2'));var timeout=require('connect-timeout');var express=require(_0x2cac('0x3'));var router=express[_0x2cac('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x2cac('0x5'));var config=require(_0x2cac('0x6'));var controller=require(_0x2cac('0x7'));router[_0x2cac('0x8')]('/',auth[_0x2cac('0x9')](),controller['index']);router['get']('/describe',auth[_0x2cac('0x9')](),controller['describe']);router[_0x2cac('0x8')](_0x2cac('0xa'),auth['isAuthenticated'](),controller[_0x2cac('0xb')]);router[_0x2cac('0x8')](_0x2cac('0xc'),auth['isAuthenticated'](),controller[_0x2cac('0xd')]);router[_0x2cac('0x8')](_0x2cac('0xe'),auth[_0x2cac('0x9')](),controller[_0x2cac('0xf')]);router['post']('/',auth[_0x2cac('0x9')](),controller['create']);router['post'](_0x2cac('0x10'),auth[_0x2cac('0x9')](),controller[_0x2cac('0x11')]);router['post']('/:id/sections',auth['isAuthenticated'](),controller[_0x2cac('0x12')]);router['post']('/:id/resources',auth[_0x2cac('0x9')](),controller['addResources']);router[_0x2cac('0x13')](_0x2cac('0xa'),auth['isAuthenticated'](),controller[_0x2cac('0x14')]);router[_0x2cac('0x15')](_0x2cac('0xa'),auth['isAuthenticated'](),controller[_0x2cac('0x16')]);router[_0x2cac('0x15')](_0x2cac('0xc'),auth[_0x2cac('0x9')](),controller[_0x2cac('0x17')]);router['delete'](_0x2cac('0xe'),auth['isAuthenticated'](),controller[_0x2cac('0x18')]);module[_0x2cac('0x19')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 3066fb4..bddbab8 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 _0xa600=['STRING','name','setDataValue','join','getDataValue','split','sequelize','exports'];(function(_0x25455e,_0x33ce14){var _0x77e74f=function(_0x448874){while(--_0x448874){_0x25455e['push'](_0x25455e['shift']());}};_0x77e74f(++_0x33ce14);}(_0xa600,0xa6));var _0x0a60=function(_0x2e914,_0x1c7566){_0x2e914=_0x2e914-0x0;var _0x936e45=_0xa600[_0x2e914];return _0x936e45;};'use strict';var Sequelize=require(_0x0a60('0x0'));module[_0x0a60('0x1')]={'name':{'type':Sequelize[_0x0a60('0x2')],'allowNull':![],'unique':_0x0a60('0x3')},'crudPermissions':{'type':Sequelize[_0x0a60('0x2')],'set':function(_0x1afd68){this[_0x0a60('0x4')]('crudPermissions',_0x1afd68?_0x1afd68[_0x0a60('0x5')](''):[]);},'get':function(){return this[_0x0a60('0x6')]('crudPermissions')?this[_0x0a60('0x6')]('crudPermissions')[_0x0a60('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x0a60('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xf219=['STRING','exports','name','setDataValue','crudPermissions','join','getDataValue','split'];(function(_0x5a6644,_0x45d612){var _0x3a2a5d=function(_0x54159e){while(--_0x54159e){_0x5a6644['push'](_0x5a6644['shift']());}};_0x3a2a5d(++_0x45d612);}(_0xf219,0x179));var _0x9f21=function(_0x54bb04,_0x3aaec2){_0x54bb04=_0x54bb04-0x0;var _0xf7a4f4=_0xf219[_0x54bb04];return _0xf7a4f4;};'use strict';var Sequelize=require('sequelize');module[_0x9f21('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9f21('0x1')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x59d29b){this[_0x9f21('0x2')](_0x9f21('0x3'),_0x59d29b?_0x59d29b[_0x9f21('0x4')](''):[]);},'get':function(){return this[_0x9f21('0x5')](_0x9f21('0x3'))?this[_0x9f21('0x5')](_0x9f21('0x3'))[_0x9f21('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x9f21('0x7')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index dc8a4d1..d7464cf 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 _0xda8b=['register','sendStatus','status','end','json','count','offset','limit','apply','reject','save','update','destroy','then','error','stack','name','index','UserProfile','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','include','findAll','catch','show','params','rawAttributes','find','create','body','clone','includeAll','get','createdAt','updatedAt','crudPermissions','omit','sequelize','UserProfileSection','each','autoAssociation','sectionId','userProfileId','UserProfileResource','describe','addSections','transaction','Resources','push','ids','getSections','isEmpty','includes','some','subsections','findOne','Dashboard','forEach','Plugin','addResources','removeResources','getResources','section','undefined','Sequelize','Unknown\x20section','mergeResources','ValidationError','Invalid\x20section\x20\x27','parentSections','ignore','union','childModel','all','nolimit','VIRTUAL','field','foreignKey','associatedResources','AnalyticExtractedReport','reportId','custom','CustomReports','rows','CmContact','Tag','Tags','ThroughTags','tag','value','toLowerCase','squareprojects','SquareProject','SquareOdbc','squarerecordings','SquareRecording','projectName','projects','JscriptyProject','contacts','Lists','ListId','CmList','companies','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','outboundroutes','VoiceExtension','contexts','voicemails','voicerecordings','VoiceRecording','Agents','User','role','agent','Telephones','VoiceQueues','queue','VoiceQueue','outbound','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','OpenchannelQueue','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','teams','Team','voicequeues','queuecampaigns','telephones','Users','user','ZendeskAccount','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','deskaccounts','DeskAccount','zohoaccounts','vtigeraccounts','dispositions','Disposition','customdashboards','intervals','sounds','Sound','templates','Template','triggers','Trigger','Trunk','Variable','plugins','extractedreports','Reports','metrics','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','defaults','redis','localhost','./userProfile.socket'];(function(_0x12d7ea,_0x338066){var _0x22db20=function(_0x565672){while(--_0x565672){_0x12d7ea['push'](_0x12d7ea['shift']());}};_0x22db20(++_0x338066);}(_0xda8b,0x1a3));var _0xbda8=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0xda8b[_0x1e7b16];return _0x37fadc;};'use strict';var pdf=require(_0xbda8('0x0'));var emlformat=require(_0xbda8('0x1'));var rimraf=require(_0xbda8('0x2'));var zipdir=require(_0xbda8('0x3'));var jsonpatch=require(_0xbda8('0x4'));var rp=require(_0xbda8('0x5'));var moment=require('moment');var BPromise=require(_0xbda8('0x6'));var Mustache=require('mustache');var util=require(_0xbda8('0x7'));var path=require(_0xbda8('0x8'));var sox=require(_0xbda8('0x9'));var csv=require('to-csv');var ejs=require(_0xbda8('0xa'));var fs=require('fs');var _=require(_0xbda8('0xb'));var squel=require(_0xbda8('0xc'));var crypto=require(_0xbda8('0xd'));var jsforce=require(_0xbda8('0xe'));var deskjs=require(_0xbda8('0xf'));var toCsv=require(_0xbda8('0x10'));var querystring=require('querystring');var Papa=require(_0xbda8('0x11'));var Redis=require(_0xbda8('0x12'));var authService=require(_0xbda8('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbda8('0x14'));var logger=require(_0xbda8('0x15'))(_0xbda8('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0xbda8('0x17')](config[_0xbda8('0x18')],{'host':_0xbda8('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbda8('0x18')]));require(_0xbda8('0x1a'))[_0xbda8('0x1b')](socket);function respondWithStatusCode(_0x4fef8a,_0xacc2fa){_0xacc2fa=_0xacc2fa||0xcc;return function(_0x446905){if(_0x446905){return _0x4fef8a[_0xbda8('0x1c')](_0xacc2fa);}return _0x4fef8a[_0xbda8('0x1d')](_0xacc2fa)[_0xbda8('0x1e')]();};}function respondWithResult(_0x32c7e7,_0xa7b945){_0xa7b945=_0xa7b945||0xc8;return function(_0x5db158){if(_0x5db158){return _0x32c7e7[_0xbda8('0x1d')](_0xa7b945)[_0xbda8('0x1f')](_0x5db158);}};}function respondWithFilteredResult(_0x14ab60,_0x22d126){return function(_0x5f1fc5){if(_0x5f1fc5){var _0x215827=_0x5f1fc5[_0xbda8('0x20')],_0x590c92=_0x22d126[_0xbda8('0x21')],_0x108631=_0x22d126[_0xbda8('0x21')]+_0x22d126[_0xbda8('0x22')],_0x1b0be9;if(_0x108631>=_0x215827){_0x108631=_0x215827;_0x1b0be9=0xc8;}else{_0x1b0be9=0xce;}_0x14ab60[_0xbda8('0x1d')](_0x1b0be9);return _0x14ab60['set']('Content-Range',_0x590c92+'-'+_0x108631+'/'+_0x215827)[_0xbda8('0x1f')](_0x5f1fc5);}return null;};}function patchUpdates(_0x48de77){return function(_0x49d273){try{jsonpatch[_0xbda8('0x23')](_0x49d273,_0x48de77,!![]);}catch(_0x5c7a97){return BPromise[_0xbda8('0x24')](_0x5c7a97);}return _0x49d273[_0xbda8('0x25')]();};}function saveUpdates(_0x21a9e3,_0x9382dd){return function(_0x36310f){if(_0x36310f){return _0x36310f[_0xbda8('0x26')](_0x21a9e3)['then'](function(_0x111d37){return _0x111d37;});}return null;};}function removeEntity(_0x4b43f8,_0x285b27){return function(_0x1a92cd){if(_0x1a92cd){return _0x1a92cd[_0xbda8('0x27')]()[_0xbda8('0x28')](function(){_0x4b43f8[_0xbda8('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20f387,_0x3a7c8b){return function(_0x175538){if(!_0x175538){_0x20f387[_0xbda8('0x1c')](0x194);}return _0x175538;};}function handleError(_0x11a4de,_0x2b2421){_0x2b2421=_0x2b2421||0x1f4;return function(_0xf1dcb4){logger[_0xbda8('0x29')](_0xf1dcb4[_0xbda8('0x2a')]);if(_0xf1dcb4['name']){delete _0xf1dcb4[_0xbda8('0x2b')];}_0x11a4de[_0xbda8('0x1d')](_0x2b2421)['send'](_0xf1dcb4);};}exports[_0xbda8('0x2c')]=function(_0x2a22a2,_0x5a8f58){var _0x5b7937={},_0x430624={},_0x2e4ca8={'count':0x0,'rows':[]};var _0x34503e=_['map'](db[_0xbda8('0x2d')]['rawAttributes'],function(_0x1ed604){return{'name':_0x1ed604[_0xbda8('0x2e')],'type':_0x1ed604[_0xbda8('0x2f')][_0xbda8('0x30')]};});_0x430624[_0xbda8('0x31')]=_[_0xbda8('0x32')](_0x34503e,_0xbda8('0x2b'));_0x430624[_0xbda8('0x33')]=_[_0xbda8('0x34')](_0x2a22a2[_0xbda8('0x33')]);_0x430624[_0xbda8('0x35')]=_[_0xbda8('0x36')](_0x430624[_0xbda8('0x31')],_0x430624[_0xbda8('0x33')]);_0x5b7937['attributes']=_[_0xbda8('0x36')](_0x430624[_0xbda8('0x31')],qs['fields'](_0x2a22a2[_0xbda8('0x33')][_0xbda8('0x37')]));_0x5b7937[_0xbda8('0x38')]=_0x5b7937[_0xbda8('0x38')][_0xbda8('0x39')]?_0x5b7937[_0xbda8('0x38')]:_0x430624[_0xbda8('0x31')];if(!_0x2a22a2['query'][_0xbda8('0x3a')]('nolimit')){_0x5b7937[_0xbda8('0x22')]=qs['limit'](_0x2a22a2[_0xbda8('0x33')]['limit']);_0x5b7937[_0xbda8('0x21')]=qs[_0xbda8('0x21')](_0x2a22a2[_0xbda8('0x33')][_0xbda8('0x21')]);}_0x5b7937[_0xbda8('0x3b')]=qs[_0xbda8('0x3c')](_0x2a22a2['query'][_0xbda8('0x3c')]);_0x5b7937['where']=qs[_0xbda8('0x35')](_[_0xbda8('0x3d')](_0x2a22a2[_0xbda8('0x33')],_0x430624[_0xbda8('0x35')]));if(_0x2a22a2[_0xbda8('0x33')][_0xbda8('0x3e')]){_0x5b7937[_0xbda8('0x3f')]=_['merge'](_0x5b7937[_0xbda8('0x3f')],{'$or':_[_0xbda8('0x32')](_0x34503e,function(_0x117e4b){if(_0x117e4b[_0xbda8('0x2f')]!=='VIRTUAL'){var _0x3e81da={};_0x3e81da[_0x117e4b['name']]={'$like':'%'+_0x2a22a2[_0xbda8('0x33')][_0xbda8('0x3e')]+'%'};return _0x3e81da;}})});}_0x5b7937=_[_0xbda8('0x40')]({},_0x5b7937,_0x2a22a2[_0xbda8('0x41')]);var _0xa409fb={'where':_0x5b7937[_0xbda8('0x3f')]};return db[_0xbda8('0x2d')][_0xbda8('0x20')](_0xa409fb)[_0xbda8('0x28')](function(_0x2d733f){_0x2e4ca8[_0xbda8('0x20')]=_0x2d733f;if(_0x2a22a2[_0xbda8('0x33')]['includeAll']){_0x5b7937[_0xbda8('0x42')]=[{'all':!![]}];}return db[_0xbda8('0x2d')][_0xbda8('0x43')](_0x5b7937);})[_0xbda8('0x28')](function(_0x54ebff){_0x2e4ca8['rows']=_0x54ebff;return _0x2e4ca8;})['then'](respondWithFilteredResult(_0x5a8f58,_0x5b7937))[_0xbda8('0x44')](handleError(_0x5a8f58,null));};exports[_0xbda8('0x45')]=function(_0x18c190,_0x4933f3){var _0x16d327={'raw':![],'where':{'id':_0x18c190[_0xbda8('0x46')]['id']}},_0x5639d3={};_0x5639d3[_0xbda8('0x31')]=_[_0xbda8('0x34')](db[_0xbda8('0x2d')][_0xbda8('0x47')]);_0x5639d3[_0xbda8('0x33')]=_[_0xbda8('0x34')](_0x18c190[_0xbda8('0x33')]);_0x5639d3[_0xbda8('0x35')]=_[_0xbda8('0x36')](_0x5639d3[_0xbda8('0x31')],_0x5639d3[_0xbda8('0x33')]);_0x16d327[_0xbda8('0x38')]=_[_0xbda8('0x36')](_0x5639d3[_0xbda8('0x31')],qs[_0xbda8('0x37')](_0x18c190[_0xbda8('0x33')][_0xbda8('0x37')]));_0x16d327['attributes']=_0x16d327[_0xbda8('0x38')]['length']?_0x16d327[_0xbda8('0x38')]:_0x5639d3['model'];if(_0x18c190[_0xbda8('0x33')]['includeAll']){_0x16d327[_0xbda8('0x42')]=[{'all':!![]}];}_0x16d327=_['merge']({},_0x16d327,_0x18c190[_0xbda8('0x41')]);return db[_0xbda8('0x2d')][_0xbda8('0x48')](_0x16d327)[_0xbda8('0x28')](handleEntityNotFound(_0x4933f3,null))[_0xbda8('0x28')](respondWithResult(_0x4933f3,null))[_0xbda8('0x44')](handleError(_0x4933f3,null));};exports['create']=function(_0x375f35,_0x1c615c){return db[_0xbda8('0x2d')][_0xbda8('0x49')](_0x375f35[_0xbda8('0x4a')],{})['then'](respondWithResult(_0x1c615c,0xc9))[_0xbda8('0x44')](handleError(_0x1c615c,null));};exports[_0xbda8('0x4b')]=function(_0x395a52,_0x2217ff){var _0x27d6a1={'where':{'id':_0x395a52[_0xbda8('0x46')]['id']}},_0x156f55={};_0x156f55[_0xbda8('0x31')]=_[_0xbda8('0x34')](db['UserProfile'][_0xbda8('0x47')]);_0x27d6a1['attributes']=_[_0xbda8('0x36')](_0x156f55['model'],qs[_0xbda8('0x37')](_0x395a52[_0xbda8('0x33')][_0xbda8('0x37')]));_0x27d6a1['attributes']=_0x27d6a1[_0xbda8('0x38')]['length']?_0x27d6a1[_0xbda8('0x38')]:_0x156f55['model'];if(_0x395a52[_0xbda8('0x33')][_0xbda8('0x4c')]){_0x27d6a1[_0xbda8('0x42')]=[{'all':!![]}];}_0x27d6a1=_[_0xbda8('0x40')]({},_0x27d6a1,_0x395a52[_0xbda8('0x41')]);return db[_0xbda8('0x2d')][_0xbda8('0x48')](_0x27d6a1)[_0xbda8('0x28')](handleEntityNotFound(_0x2217ff,null))['then'](function(_0x180392){if(_0x180392){var _0x5babc6=_0x180392[_0xbda8('0x4d')]({'plain':!![]});_0x5babc6=qs['omit'](_0x5babc6,['id',_0xbda8('0x4e'),_0xbda8('0x4f'),_0xbda8('0x50')]);_0x395a52['body']=_[_0xbda8('0x51')](_0x395a52[_0xbda8('0x4a')],['id','createdAt',_0xbda8('0x4f')]);return db[_0xbda8('0x52')]['transaction'](function(_0x15cc5e){return db[_0xbda8('0x2d')][_0xbda8('0x49')](_[_0xbda8('0x40')](_0x5babc6,_0x395a52[_0xbda8('0x4a')]),{'include':_0x395a52[_0xbda8('0x33')][_0xbda8('0x4c')]?[{'all':!![]}]:undefined,'transaction':_0x15cc5e})[_0xbda8('0x28')](function(_0x1bbd6d){var _0x46e443=_0x1bbd6d['get']({'plain':!![]});return db[_0xbda8('0x53')]['findAll']({'where':{'userProfileId':_0x395a52[_0xbda8('0x46')]['id']},'raw':!![]})[_0xbda8('0x28')](function(_0x47ea80){if(_0x47ea80){return BPromise[_0xbda8('0x54')](_0x47ea80,function(_0x3d0065){return new BPromise(function(_0x597e4a,_0x5800ba){if(_0x3d0065[_0xbda8('0x55')]===null||_0x3d0065[_0xbda8('0x55')]===0x1)_0x597e4a(null);return db['UserProfileResource'][_0xbda8('0x43')]({'where':{'sectionId':_0x3d0065['id']},'raw':!![]})[_0xbda8('0x28')](function(_0x30b91b){var _0x14ac85=_[_0xbda8('0x32')](_0x30b91b,function(_0x40920b){return qs[_0xbda8('0x51')](_0x40920b,['id','createdAt',_0xbda8('0x4f'),_0xbda8('0x56')]);});_0x597e4a(_0x14ac85);})[_0xbda8('0x44')](function(_0x355fc7){_0x5800ba(_0x355fc7);});})[_0xbda8('0x28')](function(_0x17b763){var _0x5d338e=qs[_0xbda8('0x51')](_0x3d0065,['id',_0xbda8('0x4e'),_0xbda8('0x4f')]);_0x5d338e[_0xbda8('0x57')]=_0x46e443['id'];if(_0x17b763)_0x5d338e['Resources']=_0x17b763;return _0x5d338e;})['then'](function(_0x1c7d47){return db[_0xbda8('0x53')]['create'](_0x1c7d47,{'include':[{'model':db[_0xbda8('0x58')],'as':'Resources'}],'raw':!![],'transaction':_0x15cc5e});});})[_0xbda8('0x28')](function(){return _0x46e443;});}});});});}})['then'](respondWithResult(_0x2217ff,0xc9))[_0xbda8('0x44')](handleError(_0x2217ff,null));};exports[_0xbda8('0x26')]=function(_0x22e266,_0x492f16){if(_0x22e266['body']['id']){delete _0x22e266[_0xbda8('0x4a')]['id'];}return db[_0xbda8('0x2d')][_0xbda8('0x48')]({'where':{'id':_0x22e266[_0xbda8('0x46')]['id']}})[_0xbda8('0x28')](handleEntityNotFound(_0x492f16,null))[_0xbda8('0x28')](saveUpdates(_0x22e266['body'],null))[_0xbda8('0x28')](respondWithResult(_0x492f16,null))['catch'](handleError(_0x492f16,null));};exports[_0xbda8('0x27')]=function(_0x51a603,_0x2cc780){return db['UserProfile']['find']({'where':{'id':_0x51a603[_0xbda8('0x46')]['id']}})['then'](handleEntityNotFound(_0x2cc780,null))[_0xbda8('0x28')](removeEntity(_0x2cc780,null))[_0xbda8('0x44')](handleError(_0x2cc780,null));};exports[_0xbda8('0x59')]=function(_0x5806dc,_0x27ee63){return db[_0xbda8('0x2d')][_0xbda8('0x59')]()[_0xbda8('0x28')](respondWithResult(_0x27ee63,null))['catch'](handleError(_0x27ee63,null));};exports[_0xbda8('0x5a')]=function(_0x158aec,_0x18f0e7){var _0x562231=_0x158aec[_0xbda8('0x4a')];return db['UserProfile'][_0xbda8('0x48')]({'where':{'id':_0x158aec[_0xbda8('0x46')]['id']}})[_0xbda8('0x28')](handleEntityNotFound(_0x18f0e7,null))[_0xbda8('0x28')](function(_0x178fd3){if(_0x178fd3){return db[_0xbda8('0x52')][_0xbda8('0x5b')](function(_0x4e7d03){return db[_0xbda8('0x53')][_0xbda8('0x27')]({'where':{'userProfileId':_0x158aec[_0xbda8('0x46')]['id'],'sectionId':_[_0xbda8('0x32')](_0x562231,function(_0x2a049f){return _0x2a049f[_0xbda8('0x56')];})},'transaction':_0x4e7d03})[_0xbda8('0x28')](function(){var _0x27b67e=_['map'](_0x562231,function(_0x2fd48d){_0x2fd48d['userProfileId']=_0x158aec[_0xbda8('0x46')]['id'];return _0x2fd48d;});var _0xac76d9=[];return BPromise[_0xbda8('0x54')](_0x27b67e,function(_0x286431){return db[_0xbda8('0x53')][_0xbda8('0x49')](_0x286431,{'include':[{'model':db[_0xbda8('0x58')],'as':_0xbda8('0x5c')}],'raw':!![],'transaction':_0x4e7d03})[_0xbda8('0x28')](function(_0x105e5f){_0xac76d9[_0xbda8('0x5d')](_0x105e5f[_0xbda8('0x4d')]({'plain':!![]}));});})['then'](function(){return _0xac76d9;});});});}})[_0xbda8('0x28')](function(_0x3c5819){return _0x3c5819;})[_0xbda8('0x28')](respondWithResult(_0x18f0e7,null))[_0xbda8('0x44')](handleError(_0x18f0e7,null));};exports['removeSections']=function(_0x5571bc,_0x5db5ba){var _0x1b254a;return db[_0xbda8('0x2d')]['find']({'where':{'id':_0x5571bc[_0xbda8('0x46')]['id']},'attributes':['id',_0xbda8('0x2b')]})['then'](handleEntityNotFound(_0x5db5ba,null))[_0xbda8('0x28')](function(_0xad25ee){if(_0xad25ee){_0x1b254a=_0xad25ee;return db[_0xbda8('0x53')][_0xbda8('0x27')]({'where':{'userProfileId':_0x5571bc[_0xbda8('0x46')]['id'],'sectionId':_0x5571bc[_0xbda8('0x33')][_0xbda8('0x5e')]}});}})['then'](function(){return _0x1b254a;})['then'](respondWithStatusCode(_0x5db5ba,null))[_0xbda8('0x44')](handleError(_0x5db5ba,null));};exports[_0xbda8('0x5f')]=function(_0x560e8a,_0x4899cd){var _0x3ffafc=[];var _0x126db0=[];return db[_0xbda8('0x53')]['findAll']({'where':{'userProfileId':_0x560e8a[_0xbda8('0x46')]['id']},'raw':!![]})['then'](function(_0x5809b0){_0x3ffafc=_[_0xbda8('0x3e')](_0x5809b0,function(_0x2d7279){return _0x2d7279['enabled']===0x1;});if(!_[_0xbda8('0x60')](_0x3ffafc)){return _[_0xbda8('0x32')](_0x3ffafc,function(_0x438933){return _0x438933['sectionId'];});}else{return;}})[_0xbda8('0x28')](function(_0x34b6fa){if(_0x34b6fa)_0x126db0=_0x34b6fa;if(_['includes'](_0x126db0,0x64)){var _0x265d05=_['find'](_0x3ffafc,{'sectionId':0x64});return hasDefaultDashboard(_0x265d05)[_0xbda8('0x28')](function(_0x456efa){return _[_0xbda8('0x32')](_0x3ffafc,function(_0x38834c){if(_0x38834c[_0xbda8('0x56')]===0x64){_0x38834c['subsections']=_0x456efa;}return _0x38834c;});});}else{return;}})[_0xbda8('0x28')](function(_0x5512c4){if(_0x5512c4)_0x3ffafc=_0x5512c4;if(_[_0xbda8('0x61')](_0x126db0,0x3eb)||_[_0xbda8('0x62')](_0x3ffafc,{'enabled':![],'sectionId':0x3eb})){var _0x3605c4=_['find'](_0x3ffafc,{'sectionId':0x3eb});return getCustomDashboards(_0x3605c4)[_0xbda8('0x28')](function(_0x4f14bb){return _[_0xbda8('0x32')](_0x3ffafc,function(_0x5f59d4){if(_0x5f59d4['sectionId']===0x3eb){_0x5f59d4[_0xbda8('0x63')]=_0x4f14bb;}return _0x5f59d4;});});}else{return;}})[_0xbda8('0x28')](function(_0x3687a0){if(_0x3687a0)_0x3ffafc=_0x3687a0;if(_[_0xbda8('0x61')](_0x126db0,0x709)||_['some'](_0x3ffafc,{'enabled':![],'sectionId':0x709})){var _0x2595bf=_[_0xbda8('0x48')](_0x3ffafc,{'sectionId':0x709});return getPlugins(_0x2595bf)[_0xbda8('0x28')](function(_0x5543a7){return _['map'](_0x3ffafc,function(_0x4d8dc5){if(_0x4d8dc5['sectionId']===0x709){_0x4d8dc5[_0xbda8('0x63')]=_0x5543a7;}return _0x4d8dc5;});});}else{return;}})[_0xbda8('0x28')](function(_0x1e78a0){if(_0x1e78a0)_0x3ffafc=_0x1e78a0;return _0x3ffafc;})['then'](respondWithResult(_0x4899cd,null))[_0xbda8('0x44')](handleError(_0x4899cd,null));};function hasDefaultDashboard(_0x44d545){var _0xb14d1f=[0x65];return new BPromise(function(_0x44096e,_0x4ccbac){try{if(_0x44d545[_0xbda8('0x55')]){_0x44096e(_0xb14d1f);}else{return db['UserProfileResource'][_0xbda8('0x64')]({'where':{'sectionId':_0x44d545['id']},'raw':!![]})[_0xbda8('0x28')](function(_0x9872c9){if(_0x9872c9){_0x44096e(_0xb14d1f);}});}}catch(_0x1daa75){_0x4ccbac(_0x1daa75);}});}function getCustomDashboards(_0x19af18){var _0x630e69=[];return new BPromise(function(_0x5bef71,_0x89262e){try{if(_0x19af18[_0xbda8('0x55')]){return db[_0xbda8('0x65')][_0xbda8('0x43')]({'raw':!![]})[_0xbda8('0x28')](function(_0x4d7489){_0x4d7489[_0xbda8('0x66')](function(_0x5f09b4){_0x630e69[_0xbda8('0x5d')](_0x5f09b4['id']+0x1869f);});_0x5bef71(_0x630e69);});}else{return db['UserProfileResource'][_0xbda8('0x43')]({'where':{'sectionId':_0x19af18['id']},'raw':!![]})[_0xbda8('0x28')](function(_0x362dc7){_0x362dc7['forEach'](function(_0x4cea4b){_0x630e69[_0xbda8('0x5d')](_0x4cea4b['resourceId']+0x1869f);});_0x5bef71(_0x630e69);});}}catch(_0x1ed652){_0x89262e(_0x1ed652);}});}function getPlugins(_0x4149b6){var _0x1c7de5=[];return new BPromise(function(_0xf83e70,_0x461748){try{if(_0x4149b6[_0xbda8('0x55')]){return db[_0xbda8('0x67')][_0xbda8('0x43')]({'raw':!![]})['then'](function(_0xd9b4f2){_0xd9b4f2[_0xbda8('0x66')](function(_0x5a829b){_0x1c7de5[_0xbda8('0x5d')](_0x5a829b['id']+0x15b38);});_0xf83e70(_0x1c7de5);});}else{return db[_0xbda8('0x58')]['findAll']({'where':{'sectionId':_0x4149b6['id']},'raw':!![]})['then'](function(_0x486ac1){_0x486ac1[_0xbda8('0x66')](function(_0x124207){_0x1c7de5[_0xbda8('0x5d')](_0x124207['resourceId']+0x15b38);});_0xf83e70(_0x1c7de5);});}}catch(_0x3ce0c0){_0x461748(_0x3ce0c0);}});}exports[_0xbda8('0x68')]=function(_0x568780,_0x2e318f){return db[_0xbda8('0x2d')][_0xbda8('0x48')]({'where':{'id':_0x568780[_0xbda8('0x46')]['id']}})[_0xbda8('0x28')](handleEntityNotFound(_0x2e318f,null))[_0xbda8('0x28')](function(_0x1ea203){if(_0x1ea203){return db['sequelize']['transaction'](function(_0x417c88){return db[_0xbda8('0x53')][_0xbda8('0x43')]({'where':{'userProfileId':_0x568780['params']['id']},'attributes':['id'],'raw':!![]})[_0xbda8('0x28')](function(_0x39f729){if(_0x39f729){return db[_0xbda8('0x53')][_0xbda8('0x27')]({'where':{'userProfileId':_0x568780[_0xbda8('0x46')]['id'],'id':_['map'](_0x39f729,function(_0x532cd2){return _0x532cd2['id'];})},'transaction':_0x417c88});}})[_0xbda8('0x28')](function(_0x22340d){var _0x146965=_[_0xbda8('0x32')](_0x568780[_0xbda8('0x4a')],function(_0x2d11c2){_0x2d11c2[_0xbda8('0x57')]=_0x568780[_0xbda8('0x46')]['id'];return _0x2d11c2;});return db[_0xbda8('0x53')]['bulkCreate'](_0x146965,{'raw':!![],'transaction':_0x417c88});})['then'](function(_0x18dd19){var _0x2d3525=_['filter'](_[_0xbda8('0x32')](_0x18dd19,function(_0xe4d778){return _0xe4d778[_0xbda8('0x4d')]({'plain':!![]});}),{'includeAll':![]});if(_0x2d3525){return db[_0xbda8('0x53')][_0xbda8('0x43')]({'where':{'userProfileId':_0x568780[_0xbda8('0x46')]['id'],'sectionId':_[_0xbda8('0x32')](_0x2d3525,function(_0x4b6329){return _0x4b6329[_0xbda8('0x56')];})},'attributes':['id',_0xbda8('0x56')],'raw':!![]})[_0xbda8('0x28')](function(_0x5383d){var _0x3fd88c=_['map'](_0x568780['body'],function(_0x216b31){_0x216b31[_0xbda8('0x57')]=_0x568780['params']['id'];return _0x216b31;});return db[_0xbda8('0x58')]['bulkCreate'](_0x3fd88c,{'raw':!![],'transaction':_0x417c88});});}})[_0xbda8('0x44')](handleError(_0x2e318f,null));});}})[_0xbda8('0x28')](function(_0x15b22b){var _0x5a161f=_[_0xbda8('0x32')](_0x15b22b,function(_0xb02830){return _0xb02830[_0xbda8('0x4d')]({'plain':!![]});});})['then'](respondWithResult(_0x2e318f,null))[_0xbda8('0x44')](handleError(_0x2e318f,null));};exports['removeResources']=function(_0x2ef155,_0x1c068b,_0x40e513){return db[_0xbda8('0x2d')][_0xbda8('0x48')]({'where':{'id':_0x2ef155[_0xbda8('0x46')]['id']}})['then'](handleEntityNotFound(_0x1c068b,null))['then'](function(_0x13975d){if(_0x13975d){return _0x13975d[_0xbda8('0x69')](_0x2ef155[_0xbda8('0x33')]['ids']);}})[_0xbda8('0x28')](respondWithStatusCode(_0x1c068b,null))[_0xbda8('0x44')](handleError(_0x1c068b,null));};exports[_0xbda8('0x6a')]=function(_0x3c1e15,_0x72bd2c){var _0x6bbce1={'raw':![],'where':{}};var _0x125729={};var _0xcaaeee={'count':0x0,'rows':[]};var _0x2024de=_0x3c1e15[_0xbda8('0x33')][_0xbda8('0x6b')];if(typeof _0x2024de===_0xbda8('0x6c')){throw new db[(_0xbda8('0x6d'))]['ValidationError'](_0xbda8('0x6e'));}var _0x3b3eb2=_0x3c1e15[_0xbda8('0x33')][_0xbda8('0x6f')]||![];var _0x163f5f=getQueryModels(_0x2024de,_0x3b3eb2);if(typeof _0x163f5f['childModel']===_0xbda8('0x6c')){throw new db['Sequelize'][(_0xbda8('0x70'))](_0xbda8('0x71')+_0x2024de+'\x27');}var _0x3d39ee=[];if(!_[_0xbda8('0x60')](_0x163f5f['parentSections'])){_0x3d39ee=_0x163f5f[_0xbda8('0x72')];}else{_0x3d39ee=[{'name':_0x2024de}];}return db['UserProfile'][_0xbda8('0x64')]({'where':{'id':_0x3c1e15[_0xbda8('0x46')]['id']}})['then'](handleEntityNotFound(_0x72bd2c,null))[_0xbda8('0x28')](function(_0x493c03){if(_0x493c03){var _0x5b3f3d=[];for(var _0x3a3ec1=0x0;_0x3a3ec1<_0x3d39ee[_0xbda8('0x39')];_0x3a3ec1++){_0x5b3f3d[_0xbda8('0x5d')](db['UserProfileSection']['findOne']({'where':{'userProfileId':_0x493c03['id'],'name':_0x3d39ee[_0x3a3ec1][_0xbda8('0x2b')]},'raw':!![]}));}return BPromise['all'](_0x5b3f3d);}})[_0xbda8('0x28')](function(_0x315e38){var _0x4145a3=_['filter'](_0x315e38,function(_0x7c95ae){return _0x7c95ae?_0x7c95ae:undefined;});var _0x1cdffb=_['filter'](_0x3d39ee,[_0xbda8('0x73'),!![]]);var _0x15ffff=_['isEmpty'](_0x4145a3)&&_[_0xbda8('0x60')](_0x1cdffb)?null:_[_0xbda8('0x74')](_0x1cdffb,_0x4145a3);if(_0x15ffff){var _0x16ba0a=[];for(var _0x495749=0x0;_0x495749<_0x15ffff[_0xbda8('0x39')];_0x495749++){var _0x3e8fcf=_['find'](_0x3d39ee,function(_0x42d75d){return _0x15ffff[_0x495749]?_0x42d75d[_0xbda8('0x2b')]===_0x15ffff[_0x495749][_0xbda8('0x2b')]:null;});if(_0x3e8fcf){if(_0x15ffff[_0x495749][_0xbda8('0x73')]){_0x16ba0a['push'](getAllResources(_0x163f5f[_0xbda8('0x75')],_0x15ffff[_0x495749]));}else{if(!_0x15ffff[_0x495749]['autoAssociation']){_0x16ba0a[_0xbda8('0x5d')](getAllowedResources(_0x3e8fcf,_0x15ffff[_0x495749],_0x163f5f[_0xbda8('0x75')]));}else{if(_0x3e8fcf[_0xbda8('0x31')]){_0x16ba0a[_0xbda8('0x5d')](getAllFilteredResources(_0x3e8fcf,_0x15ffff[_0x495749]));}}}}}return BPromise[_0xbda8('0x76')](_0x16ba0a);}else{return null;}})[_0xbda8('0x28')](function(_0x9339f4){var _0x406256=_0x9339f4;var _0x455fed=null;if(_0x406256){_0x455fed=_0x406256[_0xbda8('0x39')]===0x1?_0x406256[0x0]:null;}if(_0x455fed||_0x406256){var _0x50035b=db[_0x163f5f[_0xbda8('0x75')]][_0xbda8('0x47')];_0x125729[_0xbda8('0x31')]=_[_0xbda8('0x34')](_0x50035b);_0x125729[_0xbda8('0x33')]=_[_0xbda8('0x34')](_0x3c1e15['query']);_0x125729[_0xbda8('0x35')]=_['intersection'](_0x125729[_0xbda8('0x31')],_0x125729[_0xbda8('0x33')]);_0x6bbce1[_0xbda8('0x38')]=_[_0xbda8('0x36')](_0x125729[_0xbda8('0x31')],qs[_0xbda8('0x37')](_0x3c1e15[_0xbda8('0x33')][_0xbda8('0x37')]));_0x6bbce1['attributes']=_0x6bbce1[_0xbda8('0x38')][_0xbda8('0x39')]?_0x6bbce1[_0xbda8('0x38')]:_0x125729[_0xbda8('0x31')];if(!_0x3c1e15[_0xbda8('0x33')]['hasOwnProperty'](_0xbda8('0x77'))){_0x6bbce1['limit']=qs[_0xbda8('0x22')](_0x3c1e15[_0xbda8('0x33')][_0xbda8('0x22')]);_0x6bbce1[_0xbda8('0x21')]=qs[_0xbda8('0x21')](_0x3c1e15[_0xbda8('0x33')][_0xbda8('0x21')]);}_0x6bbce1['order']=qs['sort'](_0x3c1e15[_0xbda8('0x33')][_0xbda8('0x3c')]);_0x6bbce1[_0xbda8('0x3f')]=qs['filters'](_[_0xbda8('0x3d')](_0x3c1e15[_0xbda8('0x33')],_0x125729['filters']));if(_0x3c1e15[_0xbda8('0x33')][_0xbda8('0x3e')]){_0x6bbce1[_0xbda8('0x3f')]=_['merge'](_0x6bbce1[_0xbda8('0x3f')],{'$or':_[_0xbda8('0x32')](_0x50035b,function(_0x349c70){if(_0x349c70[_0xbda8('0x2f')][_0xbda8('0x30')]!==_0xbda8('0x78')){var _0x214d1d={};_0x214d1d[_0x349c70['field']]={'$like':'%'+_0x3c1e15['query'][_0xbda8('0x3e')]+'%'};return _0x214d1d;}})});}var _0x56bcb2=[];if(_0x455fed){var _0x2fbb17=_[_0xbda8('0x48')](_0x3d39ee,[_0xbda8('0x2b'),_0x455fed[_0xbda8('0x2b')]]);if(_0x2fbb17[_0xbda8('0x79')]){var _0x4b4d2c={};if(_0x163f5f['childModel']==='AnalyticExtractedReport'){_0x4b4d2c[_0x2fbb17[_0xbda8('0x7a')]]=_[_0xbda8('0x32')](_0x455fed[_0xbda8('0x7b')],'id');}else{_0x4b4d2c[_0x2fbb17[_0xbda8('0x7a')]]=_0x455fed[_0xbda8('0x7b')];}_0x56bcb2[_0xbda8('0x5d')](_0x4b4d2c);}else{_0x6bbce1['where']['id']=_0x455fed[_0xbda8('0x7b')];}}else{for(var _0x3384a9=0x0;_0x3384a9<_0x406256['length'];_0x3384a9++){var _0x2fbb17=_['find'](_0x3d39ee,['name',_0x406256[_0x3384a9]['name']]);if(_0x2fbb17[_0xbda8('0x79')]){var _0x4b4d2c={};_0x4b4d2c[_0x2fbb17[_0xbda8('0x7a')]]=_0x406256[_0x3384a9][_0xbda8('0x7b')];_0x56bcb2[_0xbda8('0x5d')](_0x4b4d2c);}else{if(!_0x6bbce1[_0xbda8('0x3f')]['id'])_0x6bbce1[_0xbda8('0x3f')]['id']=[];_0x406256[_0x3384a9][_0xbda8('0x7b')]['forEach'](function(_0x38969b){_0x6bbce1[_0xbda8('0x3f')]['id'][_0xbda8('0x5d')](_0x38969b);});}}}if(!_['isEmpty'](_0x56bcb2)){_0x6bbce1[_0xbda8('0x3f')]=_[_0xbda8('0x40')](_0x6bbce1[_0xbda8('0x3f')],{'$and':{'$or':_0x56bcb2}});}_0x6bbce1=_[_0xbda8('0x40')]({},_0x6bbce1,_0x3c1e15[_0xbda8('0x41')]);if(_0x455fed&&!_0x455fed[_0xbda8('0x55')]&&_0x163f5f[_0xbda8('0x75')]===_0xbda8('0x7c')){if(_0x3c1e15['query'][_0xbda8('0x4c')]){_0x6bbce1[_0xbda8('0x42')]=[{'all':!![]}];}return db[_0x163f5f['childModel']][_0xbda8('0x43')](_0x6bbce1)[_0xbda8('0x28')](function(_0x478598){var _0x75510d=[];_0x478598[_0xbda8('0x66')](function(_0x25c9f7){var _0x5be524;switch(_0x25c9f7['reportType']){case'default':_0x5be524=_[_0xbda8('0x48')](_0x455fed[_0xbda8('0x7b')],function(_0x2f52f5){return _0x2f52f5['id']===_0x25c9f7[_0xbda8('0x7d')]&&_0x2f52f5['type']==='DefaultReports';});break;case _0xbda8('0x7e'):_0x5be524=_[_0xbda8('0x48')](_0x455fed[_0xbda8('0x7b')],function(_0x549a44){return _0x549a44['id']===_0x25c9f7['reportId']&&_0x549a44[_0xbda8('0x2f')]===_0xbda8('0x7f');});break;}if(_0x5be524)_0x75510d[_0xbda8('0x5d')](_0x25c9f7);});_0xcaaeee[_0xbda8('0x20')]=_0x75510d[_0xbda8('0x39')];_0xcaaeee[_0xbda8('0x80')]=_0x75510d;return _0xcaaeee;});}else{return db[_0x163f5f['childModel']][_0xbda8('0x20')]({'where':_0x6bbce1[_0xbda8('0x3f')]})[_0xbda8('0x28')](function(_0x487632){_0xcaaeee[_0xbda8('0x20')]=_0x487632;if(_0x3c1e15['query'][_0xbda8('0x4c')]){if(_0x163f5f[_0xbda8('0x75')]===_0xbda8('0x81')){_0x6bbce1[_0xbda8('0x42')]=[{'model':db[_0xbda8('0x82')],'as':_0xbda8('0x83'),'attributes':['id',_0xbda8('0x2b'),'color'],'required':_0x3c1e15[_0xbda8('0x33')]['tag']?!![]:![]},{'model':db[_0xbda8('0x82')],'as':_0xbda8('0x84'),'attributes':['id',_0xbda8('0x2b'),'color'],'through':_0x3c1e15[_0xbda8('0x33')][_0xbda8('0x85')]?{'attributes':[],'where':{'TagId':_0x3c1e15['query'][_0xbda8('0x85')]||undefined}}:{},'required':_0x3c1e15[_0xbda8('0x33')][_0xbda8('0x85')]?!![]:![]}];}else{_0x6bbce1[_0xbda8('0x42')]=[{'all':!![]}];}}return db[_0x163f5f['childModel']][_0xbda8('0x43')](_0x6bbce1);})[_0xbda8('0x28')](function(_0xe80df6){_0xcaaeee[_0xbda8('0x80')]=_0xe80df6;return _0xcaaeee;});}}else{return _0xcaaeee;}})[_0xbda8('0x28')](respondWithFilteredResult(_0x72bd2c,_0x6bbce1))[_0xbda8('0x44')](handleError(_0x72bd2c,null));};function getAllResources(_0x3b3ada,_0x2a1da3){return new BPromise(function(_0x1e4322,_0x2c7a8f){if(_0x2a1da3){var _0x375071=_0x2a1da3['filter']?{[_0x2a1da3['filter'][_0xbda8('0x79')]]:_0x2a1da3['filter'][_0xbda8('0x86')]}:undefined;return db[_0x3b3ada][_0xbda8('0x43')]({'where':_0x375071,'raw':!![]})[_0xbda8('0x28')](function(_0x265474){_0x2a1da3['associatedResources']=_[_0xbda8('0x32')](_0x265474,'id');_0x1e4322(_0x2a1da3);})[_0xbda8('0x44')](function(_0x3fbf34){_0x2c7a8f(_0x3fbf34);});}else{_0x1e4322(null);}});}function getAllFilteredResources(_0x131aa7,_0x193fc0){return new BPromise(function(_0x19cc39,_0x159c6c){var _0x2271cf=_0x131aa7[_0xbda8('0x3e')]?{[_0x131aa7[_0xbda8('0x3e')][_0xbda8('0x79')]]:_0x131aa7[_0xbda8('0x3e')][_0xbda8('0x86')]}:undefined;return db[_0x131aa7[_0xbda8('0x31')]][_0xbda8('0x43')]({'where':_0x2271cf,'raw':!![]})[_0xbda8('0x28')](function(_0x511808){_0x193fc0[_0xbda8('0x7b')]=_[_0xbda8('0x32')](_0x511808,function(_0x2999d6){return _0x2999d6[_0xbda8('0x2b')];});_0x19cc39(_0x193fc0);})[_0xbda8('0x44')](function(_0x24f30e){_0x159c6c(_0x24f30e);});});}function getAllowedResources(_0x245ba3,_0x4308c3,_0x201edb){return new BPromise(function(_0x27e5ab,_0x59c245){if(_0x4308c3){return db[_0xbda8('0x58')]['findAll']({'where':{'sectionId':_0x4308c3['id']},'raw':!![]})[_0xbda8('0x28')](function(_0x487884){if(_0x245ba3['field']&&_0x245ba3[_0xbda8('0x79')]!=='id'){_0x4308c3['associatedResources']=_[_0xbda8('0x32')](_0x487884,function(_0x3a7623){return _0x3a7623[_0x245ba3[_0xbda8('0x79')]];});}else{if(_0x201edb===_0xbda8('0x7c')){_0x4308c3[_0xbda8('0x7b')]=_[_0xbda8('0x32')](_0x487884,function(_0x1d3daf){return{'id':_0x1d3daf['resourceId'],'type':_0x1d3daf[_0xbda8('0x2f')]};});}else{_0x4308c3[_0xbda8('0x7b')]=_[_0xbda8('0x32')](_0x487884,function(_0x3132f2){return _0x3132f2['resourceId'];});}}_0x27e5ab(_0x4308c3);})[_0xbda8('0x44')](function(_0x5ae251){_0x59c245(_0x5ae251);});}else{_0x27e5ab(null);}});}function getQueryModels(_0x2de77b,_0x242eba){var _0x3a96fd=_0x2de77b[_0xbda8('0x87')]();var _0x1dcc27={'childModel':undefined,'parentSections':[]};switch(_0x3a96fd){case _0xbda8('0x88'):_0x1dcc27[_0xbda8('0x75')]=_0xbda8('0x89');break;case'odbc':_0x1dcc27['childModel']=_0xbda8('0x8a');break;case _0xbda8('0x8b'):_0x1dcc27['childModel']=_0xbda8('0x8c');_0x1dcc27[_0xbda8('0x72')]=[{'name':'SquareProjects','field':'name','foreignKey':_0xbda8('0x8d')}];break;case _0xbda8('0x8e'):_0x1dcc27[_0xbda8('0x75')]=_0xbda8('0x8f');break;case _0xbda8('0x90'):_0x1dcc27[_0xbda8('0x75')]='CmContact';_0x1dcc27['parentSections']=[{'name':_0xbda8('0x91'),'field':'id','foreignKey':_0xbda8('0x92')}];break;case'lists':_0x1dcc27['childModel']=_0xbda8('0x93');break;case _0xbda8('0x94'):_0x1dcc27[_0xbda8('0x75')]='CmCompany';break;case _0xbda8('0x95'):_0x1dcc27[_0xbda8('0x75')]=_0xbda8('0x96');break;case _0xbda8('0x97'):_0x1dcc27[_0xbda8('0x75')]=_0xbda8('0x98');break;case _0xbda8('0x99'):_0x1dcc27['childModel']=_0xbda8('0x9a');break;case _0xbda8('0x9b'):_0x1dcc27[_0xbda8('0x75')]=_0xbda8('0x9c');break;case _0xbda8('0x9d'):_0x1dcc27['childModel']=_0xbda8('0x9e');break;case _0xbda8('0x9f'):case'internalroutes':case _0xbda8('0xa0'):_0x1dcc27[_0xbda8('0x75')]=_0xbda8('0xa1');break;case _0xbda8('0xa2'):_0x1dcc27[_0xbda8('0x75')]='VoiceContext';break;case _0xbda8('0xa3'):_0x1dcc27[_0xbda8('0x75')]='VoiceMail';break;case _0xbda8('0xa4'):_0x1dcc27[_0xbda8('0x75')]=_0xbda8('0xa5');_0x1dcc27['parentSections']=[{'name':_0xbda8('0xa6'),'field':_0xbda8('0x2b'),'foreignKey':'membername','model':_0xbda8('0xa7'),'filter':{'field':_0xbda8('0xa8'),'value':[_0xbda8('0xa9')]}},{'name':_0xbda8('0xaa'),'field':'name','foreignKey':'membername','model':_0xbda8('0xa7'),'filter':{'field':'role','value':['telephone']}},{'name':_0xbda8('0xab'),'field':'name','foreignKey':_0xbda8('0xac'),'model':_0xbda8('0xad'),'filter':{'field':_0xbda8('0x2f'),'value':['inbound']}},{'name':'QueueCampaigns','field':_0xbda8('0x2b'),'foreignKey':_0xbda8('0xac'),'model':'VoiceQueue','filter':{'field':_0xbda8('0x2f'),'value':[_0xbda8('0xae')]}}];break;case'musiconholds':_0x1dcc27[_0xbda8('0x75')]='VoiceMusicOnHold';break;case'chanspies':_0x1dcc27['childModel']=_0xbda8('0xaf');break;case _0xbda8('0xb0'):_0x1dcc27[_0xbda8('0x75')]=_0xbda8('0xb1');break;case _0xbda8('0xb2'):_0x1dcc27['childModel']=_0xbda8('0xb3');break;case'mailqueues':_0x1dcc27[_0xbda8('0x75')]=_0xbda8('0xb4');break;case _0xbda8('0xb5'):_0x1dcc27[_0xbda8('0x75')]=_0xbda8('0xb6');break;case _0xbda8('0xb7'):_0x1dcc27[_0xbda8('0x75')]=_0xbda8('0xb8');break;case'openchannelqueues':_0x1dcc27['childModel']=_0xbda8('0xb9');break;case'openchannelaccounts':_0x1dcc27['childModel']=_0xbda8('0xba');break;case _0xbda8('0xbb'):_0x1dcc27[_0xbda8('0x75')]=_0xbda8('0xbc');break;case _0xbda8('0xbd'):_0x1dcc27[_0xbda8('0x75')]=_0xbda8('0xbe');break;case _0xbda8('0xbf'):_0x1dcc27[_0xbda8('0x75')]=_0xbda8('0xc0');break;case _0xbda8('0xc1'):case _0xbda8('0xc2'):_0x1dcc27[_0xbda8('0x75')]=_0xbda8('0xad');if(_0x242eba){_0x1dcc27['parentSections']=[{'name':_0xbda8('0xab')},{'name':'QueueCampaigns'}];}break;case'users':case'agents':case _0xbda8('0xc3'):_0x1dcc27[_0xbda8('0x75')]=_0xbda8('0xa7');if(_0x242eba){_0x1dcc27[_0xbda8('0x72')]=[{'name':_0xbda8('0xc4'),'filter':{'field':_0xbda8('0xa8'),'value':['admin',_0xbda8('0xc5')]},'ignore':!![]},{'name':_0xbda8('0xa6')},{'name':_0xbda8('0xaa')}];}break;case'zendeskaccounts':_0x1dcc27[_0xbda8('0x75')]=_0xbda8('0xc6');break;case'salesforceaccounts':_0x1dcc27['childModel']=_0xbda8('0xc7');break;case _0xbda8('0xc8'):_0x1dcc27[_0xbda8('0x75')]=_0xbda8('0xc9');break;case _0xbda8('0xca'):_0x1dcc27[_0xbda8('0x75')]='SugarcrmAccount';break;case _0xbda8('0xcb'):_0x1dcc27[_0xbda8('0x75')]=_0xbda8('0xcc');break;case _0xbda8('0xcd'):_0x1dcc27[_0xbda8('0x75')]='ZohoAccount';break;case _0xbda8('0xce'):_0x1dcc27['childModel']=_0xbda8('0xa7');break;case'cannedanswers':_0x1dcc27[_0xbda8('0x75')]='CannedAnswer';break;case _0xbda8('0xcf'):_0x1dcc27['childModel']=_0xbda8('0xd0');break;case _0xbda8('0xd1'):_0x1dcc27[_0xbda8('0x75')]=_0xbda8('0x65');break;case _0xbda8('0xd2'):_0x1dcc27[_0xbda8('0x75')]='Interval';break;case'pauses':_0x1dcc27['childModel']='Pause';break;case'scheduler':_0x1dcc27['childModel']='Schedule';break;case _0xbda8('0xd3'):_0x1dcc27[_0xbda8('0x75')]=_0xbda8('0xd4');break;case'tags':_0x1dcc27[_0xbda8('0x75')]=_0xbda8('0x82');break;case _0xbda8('0xd5'):_0x1dcc27[_0xbda8('0x75')]=_0xbda8('0xd6');break;case _0xbda8('0xd7'):_0x1dcc27['childModel']=_0xbda8('0xd8');break;case'trunks':_0x1dcc27[_0xbda8('0x75')]=_0xbda8('0xd9');break;case'variables':_0x1dcc27[_0xbda8('0x75')]=_0xbda8('0xda');break;case _0xbda8('0xdb'):_0x1dcc27[_0xbda8('0x75')]=_0xbda8('0x67');break;case _0xbda8('0xdc'):_0x1dcc27[_0xbda8('0x75')]=_0xbda8('0x7c');_0x1dcc27['parentSections']=[{'name':_0xbda8('0xdd'),'field':'id','foreignKey':'reportId'}];break;case _0xbda8('0xde'):_0x1dcc27['childModel']='AnalyticMetric';break;default:return _0x1dcc27;}return _0x1dcc27;} \ No newline at end of file +var _0x2d80=['rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','order','where','pick','filter','merge','VIRTUAL','options','UserProfile','includeAll','include','rows','catch','show','params','find','create','body','clone','get','omit','createdAt','updatedAt','crudPermissions','sequelize','UserProfileSection','findAll','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','describe','addSections','push','ids','getSections','includes','subsections','some','forEach','resourceId','Plugin','addResources','transaction','bulkCreate','removeResources','getResources','section','undefined','Sequelize','ValidationError','Unknown\x20section','mergeResources','childModel','Invalid\x20section\x20\x27','isEmpty','parentSections','findOne','all','ignore','union','sort','type','key','field','AnalyticExtractedReport','foreignKey','associatedResources','reportId','DefaultReports','custom','CustomReports','CmContact','Tag','Tags','color','tag','ThroughTags','value','toLowerCase','squareprojects','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','projectName','projects','contacts','Lists','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatWebsite','faxqueues','faxaccounts','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','User','agent','Telephones','role','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','musiconholds','VoiceMusicOnHold','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','MailSubstatus','openchannelqueues','OpenchannelQueue','OpenchannelAccount','smsqueues','SmsQueue','SmsAccount','Team','voicequeues','queuecampaigns','users','agents','telephones','Users','admin','user','salesforceaccounts','SugarcrmAccount','deskaccounts','ZohoAccount','vtigeraccounts','cannedanswers','dispositions','Disposition','customdashboards','intervals','scheduler','Schedule','sounds','Sound','tags','templates','Template','Trigger','Trunk','variables','extractedreports','metrics','AnalyticMetric','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map'];(function(_0x576063,_0x49fdbd){var _0x44aa77=function(_0x3e57fe){while(--_0x3e57fe){_0x576063['push'](_0x576063['shift']());}};_0x44aa77(++_0x49fdbd);}(_0x2d80,0xb5));var _0x02d8=function(_0x3711e2,_0x1468e1){_0x3711e2=_0x3711e2-0x0;var _0x18a556=_0x2d80[_0x3711e2];return _0x18a556;};'use strict';var pdf=require(_0x02d8('0x0'));var emlformat=require(_0x02d8('0x1'));var rimraf=require(_0x02d8('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x02d8('0x3'));var rp=require(_0x02d8('0x4'));var moment=require(_0x02d8('0x5'));var BPromise=require(_0x02d8('0x6'));var Mustache=require(_0x02d8('0x7'));var util=require('util');var path=require(_0x02d8('0x8'));var sox=require(_0x02d8('0x9'));var csv=require(_0x02d8('0xa'));var ejs=require(_0x02d8('0xb'));var fs=require('fs');var _=require(_0x02d8('0xc'));var squel=require('squel');var crypto=require(_0x02d8('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x02d8('0xe'));var toCsv=require(_0x02d8('0xa'));var querystring=require(_0x02d8('0xf'));var Papa=require(_0x02d8('0x10'));var Redis=require(_0x02d8('0x11'));var authService=require(_0x02d8('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x02d8('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x02d8('0x14'));var utils=require('../../config/utils');var config=require(_0x02d8('0x15'));var db=require('../../mysqldb')['db'];config[_0x02d8('0x16')]=_[_0x02d8('0x17')](config['redis'],{'host':_0x02d8('0x18'),'port':0x18eb});var socket=require(_0x02d8('0x19'))(new Redis(config[_0x02d8('0x16')]));require('./userProfile.socket')[_0x02d8('0x1a')](socket);function respondWithStatusCode(_0x3fbf94,_0x1fc95f){_0x1fc95f=_0x1fc95f||0xcc;return function(_0x1fafcc){if(_0x1fafcc){return _0x3fbf94[_0x02d8('0x1b')](_0x1fc95f);}return _0x3fbf94['status'](_0x1fc95f)[_0x02d8('0x1c')]();};}function respondWithResult(_0x24788b,_0x1f2314){_0x1f2314=_0x1f2314||0xc8;return function(_0x25cfd3){if(_0x25cfd3){return _0x24788b[_0x02d8('0x1d')](_0x1f2314)[_0x02d8('0x1e')](_0x25cfd3);}};}function respondWithFilteredResult(_0x2ecb84,_0x302d19){return function(_0x2e310c){if(_0x2e310c){var _0x55f9e5=_0x2e310c[_0x02d8('0x1f')],_0x2d068f=_0x302d19['offset'],_0x3ce18e=_0x302d19[_0x02d8('0x20')]+_0x302d19[_0x02d8('0x21')],_0x302371;if(_0x3ce18e>=_0x55f9e5){_0x3ce18e=_0x55f9e5;_0x302371=0xc8;}else{_0x302371=0xce;}_0x2ecb84['status'](_0x302371);return _0x2ecb84[_0x02d8('0x22')](_0x02d8('0x23'),_0x2d068f+'-'+_0x3ce18e+'/'+_0x55f9e5)['json'](_0x2e310c);}return null;};}function patchUpdates(_0x520a75){return function(_0x225dd0){try{jsonpatch[_0x02d8('0x24')](_0x225dd0,_0x520a75,!![]);}catch(_0x2011d9){return BPromise[_0x02d8('0x25')](_0x2011d9);}return _0x225dd0[_0x02d8('0x26')]();};}function saveUpdates(_0x63d6c2,_0x1fbbe5){return function(_0x5995b8){if(_0x5995b8){return _0x5995b8[_0x02d8('0x27')](_0x63d6c2)[_0x02d8('0x28')](function(_0x460d2c){return _0x460d2c;});}return null;};}function removeEntity(_0x3d0c86,_0x3720a2){return function(_0x3927ef){if(_0x3927ef){return _0x3927ef[_0x02d8('0x29')]()[_0x02d8('0x28')](function(){_0x3d0c86['status'](0xcc)[_0x02d8('0x1c')]();});}};}function handleEntityNotFound(_0x5f4626,_0x6e4eb){return function(_0x5340b8){if(!_0x5340b8){_0x5f4626['sendStatus'](0x194);}return _0x5340b8;};}function handleError(_0x53771c,_0x4d5f4e){_0x4d5f4e=_0x4d5f4e||0x1f4;return function(_0x4106bc){logger[_0x02d8('0x2a')](_0x4106bc[_0x02d8('0x2b')]);if(_0x4106bc[_0x02d8('0x2c')]){delete _0x4106bc[_0x02d8('0x2c')];}_0x53771c['status'](_0x4d5f4e)[_0x02d8('0x2d')](_0x4106bc);};}exports[_0x02d8('0x2e')]=function(_0x2c9e1f,_0x198ff1){var _0x4f5253={},_0x4c55e3={},_0x54621e={'count':0x0,'rows':[]};var _0x156075=_[_0x02d8('0x2f')](db['UserProfile'][_0x02d8('0x30')],function(_0x47a43e){return{'name':_0x47a43e[_0x02d8('0x31')],'type':_0x47a43e['type']['key']};});_0x4c55e3[_0x02d8('0x32')]=_[_0x02d8('0x2f')](_0x156075,_0x02d8('0x2c'));_0x4c55e3['query']=_[_0x02d8('0x33')](_0x2c9e1f[_0x02d8('0x34')]);_0x4c55e3[_0x02d8('0x35')]=_[_0x02d8('0x36')](_0x4c55e3[_0x02d8('0x32')],_0x4c55e3['query']);_0x4f5253['attributes']=_[_0x02d8('0x36')](_0x4c55e3[_0x02d8('0x32')],qs[_0x02d8('0x37')](_0x2c9e1f['query'][_0x02d8('0x37')]));_0x4f5253[_0x02d8('0x38')]=_0x4f5253['attributes'][_0x02d8('0x39')]?_0x4f5253['attributes']:_0x4c55e3[_0x02d8('0x32')];if(!_0x2c9e1f['query']['hasOwnProperty']('nolimit')){_0x4f5253['limit']=qs['limit'](_0x2c9e1f[_0x02d8('0x34')][_0x02d8('0x21')]);_0x4f5253['offset']=qs['offset'](_0x2c9e1f['query'][_0x02d8('0x20')]);}_0x4f5253[_0x02d8('0x3a')]=qs['sort'](_0x2c9e1f[_0x02d8('0x34')]['sort']);_0x4f5253[_0x02d8('0x3b')]=qs[_0x02d8('0x35')](_[_0x02d8('0x3c')](_0x2c9e1f[_0x02d8('0x34')],_0x4c55e3[_0x02d8('0x35')]));if(_0x2c9e1f[_0x02d8('0x34')][_0x02d8('0x3d')]){_0x4f5253['where']=_[_0x02d8('0x3e')](_0x4f5253[_0x02d8('0x3b')],{'$or':_[_0x02d8('0x2f')](_0x156075,function(_0x14b45b){if(_0x14b45b['type']!==_0x02d8('0x3f')){var _0x4265b7={};_0x4265b7[_0x14b45b['name']]={'$like':'%'+_0x2c9e1f[_0x02d8('0x34')][_0x02d8('0x3d')]+'%'};return _0x4265b7;}})});}_0x4f5253=_[_0x02d8('0x3e')]({},_0x4f5253,_0x2c9e1f[_0x02d8('0x40')]);var _0xeb79c3={'where':_0x4f5253['where']};return db[_0x02d8('0x41')][_0x02d8('0x1f')](_0xeb79c3)[_0x02d8('0x28')](function(_0x3a2a88){_0x54621e[_0x02d8('0x1f')]=_0x3a2a88;if(_0x2c9e1f[_0x02d8('0x34')][_0x02d8('0x42')]){_0x4f5253[_0x02d8('0x43')]=[{'all':!![]}];}return db[_0x02d8('0x41')]['findAll'](_0x4f5253);})['then'](function(_0x46e37a){_0x54621e[_0x02d8('0x44')]=_0x46e37a;return _0x54621e;})[_0x02d8('0x28')](respondWithFilteredResult(_0x198ff1,_0x4f5253))[_0x02d8('0x45')](handleError(_0x198ff1,null));};exports[_0x02d8('0x46')]=function(_0x4d325e,_0x31a9cd){var _0x524229={'raw':![],'where':{'id':_0x4d325e[_0x02d8('0x47')]['id']}},_0x1e5d45={};_0x1e5d45['model']=_[_0x02d8('0x33')](db['UserProfile']['rawAttributes']);_0x1e5d45[_0x02d8('0x34')]=_[_0x02d8('0x33')](_0x4d325e['query']);_0x1e5d45[_0x02d8('0x35')]=_['intersection'](_0x1e5d45[_0x02d8('0x32')],_0x1e5d45['query']);_0x524229[_0x02d8('0x38')]=_[_0x02d8('0x36')](_0x1e5d45[_0x02d8('0x32')],qs[_0x02d8('0x37')](_0x4d325e['query'][_0x02d8('0x37')]));_0x524229[_0x02d8('0x38')]=_0x524229[_0x02d8('0x38')][_0x02d8('0x39')]?_0x524229[_0x02d8('0x38')]:_0x1e5d45[_0x02d8('0x32')];if(_0x4d325e[_0x02d8('0x34')][_0x02d8('0x42')]){_0x524229['include']=[{'all':!![]}];}_0x524229=_[_0x02d8('0x3e')]({},_0x524229,_0x4d325e[_0x02d8('0x40')]);return db[_0x02d8('0x41')][_0x02d8('0x48')](_0x524229)[_0x02d8('0x28')](handleEntityNotFound(_0x31a9cd,null))['then'](respondWithResult(_0x31a9cd,null))[_0x02d8('0x45')](handleError(_0x31a9cd,null));};exports[_0x02d8('0x49')]=function(_0x619032,_0xf9928b){return db['UserProfile'][_0x02d8('0x49')](_0x619032[_0x02d8('0x4a')],{})[_0x02d8('0x28')](respondWithResult(_0xf9928b,0xc9))[_0x02d8('0x45')](handleError(_0xf9928b,null));};exports[_0x02d8('0x4b')]=function(_0x23775d,_0x338f26){var _0x496330={'where':{'id':_0x23775d[_0x02d8('0x47')]['id']}},_0x33e883={};_0x33e883['model']=_['keys'](db[_0x02d8('0x41')][_0x02d8('0x30')]);_0x496330[_0x02d8('0x38')]=_[_0x02d8('0x36')](_0x33e883[_0x02d8('0x32')],qs['fields'](_0x23775d[_0x02d8('0x34')]['fields']));_0x496330['attributes']=_0x496330[_0x02d8('0x38')][_0x02d8('0x39')]?_0x496330[_0x02d8('0x38')]:_0x33e883[_0x02d8('0x32')];if(_0x23775d['query']['includeAll']){_0x496330[_0x02d8('0x43')]=[{'all':!![]}];}_0x496330=_['merge']({},_0x496330,_0x23775d['options']);return db[_0x02d8('0x41')][_0x02d8('0x48')](_0x496330)[_0x02d8('0x28')](handleEntityNotFound(_0x338f26,null))[_0x02d8('0x28')](function(_0x52014f){if(_0x52014f){var _0x1e323b=_0x52014f[_0x02d8('0x4c')]({'plain':!![]});_0x1e323b=qs[_0x02d8('0x4d')](_0x1e323b,['id',_0x02d8('0x4e'),_0x02d8('0x4f'),_0x02d8('0x50')]);_0x23775d[_0x02d8('0x4a')]=_[_0x02d8('0x4d')](_0x23775d[_0x02d8('0x4a')],['id',_0x02d8('0x4e'),'updatedAt']);return db[_0x02d8('0x51')]['transaction'](function(_0x4bb5fb){return db['UserProfile'][_0x02d8('0x49')](_[_0x02d8('0x3e')](_0x1e323b,_0x23775d['body']),{'include':_0x23775d[_0x02d8('0x34')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x4bb5fb})['then'](function(_0x3d5538){var _0x525ba7=_0x3d5538[_0x02d8('0x4c')]({'plain':!![]});return db[_0x02d8('0x52')][_0x02d8('0x53')]({'where':{'userProfileId':_0x23775d[_0x02d8('0x47')]['id']},'raw':!![]})[_0x02d8('0x28')](function(_0x1acf46){if(_0x1acf46){return BPromise[_0x02d8('0x54')](_0x1acf46,function(_0x36aeb6){return new BPromise(function(_0x2e5485,_0x3ed2bd){if(_0x36aeb6[_0x02d8('0x55')]===null||_0x36aeb6[_0x02d8('0x55')]===0x1)_0x2e5485(null);return db[_0x02d8('0x56')][_0x02d8('0x53')]({'where':{'sectionId':_0x36aeb6['id']},'raw':!![]})['then'](function(_0x15a580){var _0x5088de=_[_0x02d8('0x2f')](_0x15a580,function(_0x361521){return qs[_0x02d8('0x4d')](_0x361521,['id',_0x02d8('0x4e'),_0x02d8('0x4f'),_0x02d8('0x57')]);});_0x2e5485(_0x5088de);})[_0x02d8('0x45')](function(_0x1dd383){_0x3ed2bd(_0x1dd383);});})[_0x02d8('0x28')](function(_0xa60596){var _0x281c7d=qs[_0x02d8('0x4d')](_0x36aeb6,['id',_0x02d8('0x4e'),_0x02d8('0x4f')]);_0x281c7d[_0x02d8('0x58')]=_0x525ba7['id'];if(_0xa60596)_0x281c7d[_0x02d8('0x59')]=_0xa60596;return _0x281c7d;})['then'](function(_0x39fc33){return db[_0x02d8('0x52')]['create'](_0x39fc33,{'include':[{'model':db[_0x02d8('0x56')],'as':_0x02d8('0x59')}],'raw':!![],'transaction':_0x4bb5fb});});})[_0x02d8('0x28')](function(){return _0x525ba7;});}});});});}})[_0x02d8('0x28')](respondWithResult(_0x338f26,0xc9))[_0x02d8('0x45')](handleError(_0x338f26,null));};exports['update']=function(_0x34c61c,_0x89f465){if(_0x34c61c[_0x02d8('0x4a')]['id']){delete _0x34c61c[_0x02d8('0x4a')]['id'];}return db[_0x02d8('0x41')]['find']({'where':{'id':_0x34c61c[_0x02d8('0x47')]['id']}})['then'](handleEntityNotFound(_0x89f465,null))['then'](saveUpdates(_0x34c61c[_0x02d8('0x4a')],null))['then'](respondWithResult(_0x89f465,null))[_0x02d8('0x45')](handleError(_0x89f465,null));};exports[_0x02d8('0x29')]=function(_0x4231ce,_0x9dcd6e){return db[_0x02d8('0x41')][_0x02d8('0x48')]({'where':{'id':_0x4231ce[_0x02d8('0x47')]['id']}})[_0x02d8('0x28')](handleEntityNotFound(_0x9dcd6e,null))[_0x02d8('0x28')](removeEntity(_0x9dcd6e,null))[_0x02d8('0x45')](handleError(_0x9dcd6e,null));};exports[_0x02d8('0x5a')]=function(_0x17d95,_0x3dc04a){return db['UserProfile']['describe']()[_0x02d8('0x28')](respondWithResult(_0x3dc04a,null))['catch'](handleError(_0x3dc04a,null));};exports[_0x02d8('0x5b')]=function(_0x1ce335,_0xf63936){var _0xea19e3=_0x1ce335[_0x02d8('0x4a')];return db[_0x02d8('0x41')][_0x02d8('0x48')]({'where':{'id':_0x1ce335[_0x02d8('0x47')]['id']}})[_0x02d8('0x28')](handleEntityNotFound(_0xf63936,null))[_0x02d8('0x28')](function(_0x27664a){if(_0x27664a){return db['sequelize']['transaction'](function(_0x36e235){return db[_0x02d8('0x52')][_0x02d8('0x29')]({'where':{'userProfileId':_0x1ce335[_0x02d8('0x47')]['id'],'sectionId':_[_0x02d8('0x2f')](_0xea19e3,function(_0x5e1cc9){return _0x5e1cc9[_0x02d8('0x57')];})},'transaction':_0x36e235})['then'](function(){var _0x59c6c2=_[_0x02d8('0x2f')](_0xea19e3,function(_0x103f4a){_0x103f4a[_0x02d8('0x58')]=_0x1ce335[_0x02d8('0x47')]['id'];return _0x103f4a;});var _0x58a842=[];return BPromise[_0x02d8('0x54')](_0x59c6c2,function(_0x8f4fda){return db['UserProfileSection'][_0x02d8('0x49')](_0x8f4fda,{'include':[{'model':db[_0x02d8('0x56')],'as':_0x02d8('0x59')}],'raw':!![],'transaction':_0x36e235})[_0x02d8('0x28')](function(_0x7c2ad4){_0x58a842[_0x02d8('0x5c')](_0x7c2ad4['get']({'plain':!![]}));});})[_0x02d8('0x28')](function(){return _0x58a842;});});});}})[_0x02d8('0x28')](function(_0x3c6a43){return _0x3c6a43;})[_0x02d8('0x28')](respondWithResult(_0xf63936,null))[_0x02d8('0x45')](handleError(_0xf63936,null));};exports['removeSections']=function(_0xe18e69,_0x1b9e12){var _0x1b84dd;return db[_0x02d8('0x41')][_0x02d8('0x48')]({'where':{'id':_0xe18e69['params']['id']},'attributes':['id','name']})['then'](handleEntityNotFound(_0x1b9e12,null))['then'](function(_0x528a8e){if(_0x528a8e){_0x1b84dd=_0x528a8e;return db[_0x02d8('0x52')]['destroy']({'where':{'userProfileId':_0xe18e69[_0x02d8('0x47')]['id'],'sectionId':_0xe18e69[_0x02d8('0x34')][_0x02d8('0x5d')]}});}})[_0x02d8('0x28')](function(){return _0x1b84dd;})['then'](respondWithStatusCode(_0x1b9e12,null))[_0x02d8('0x45')](handleError(_0x1b9e12,null));};exports[_0x02d8('0x5e')]=function(_0x21bf9,_0x4d994b){var _0x3d195b=[];var _0xf7142f=[];return db['UserProfileSection'][_0x02d8('0x53')]({'where':{'userProfileId':_0x21bf9['params']['id']},'raw':!![]})[_0x02d8('0x28')](function(_0x41cbba){_0x3d195b=_[_0x02d8('0x3d')](_0x41cbba,function(_0x3e8b7a){return _0x3e8b7a['enabled']===0x1;});if(!_['isEmpty'](_0x3d195b)){return _[_0x02d8('0x2f')](_0x3d195b,function(_0x1e5006){return _0x1e5006[_0x02d8('0x57')];});}else{return;}})[_0x02d8('0x28')](function(_0x17e34e){if(_0x17e34e)_0xf7142f=_0x17e34e;if(_[_0x02d8('0x5f')](_0xf7142f,0x64)){var _0x683519=_[_0x02d8('0x48')](_0x3d195b,{'sectionId':0x64});return hasDefaultDashboard(_0x683519)['then'](function(_0x3b1820){return _['map'](_0x3d195b,function(_0xc8d633){if(_0xc8d633[_0x02d8('0x57')]===0x64){_0xc8d633[_0x02d8('0x60')]=_0x3b1820;}return _0xc8d633;});});}else{return;}})[_0x02d8('0x28')](function(_0x47404b){if(_0x47404b)_0x3d195b=_0x47404b;if(_['includes'](_0xf7142f,0x3eb)||_['some'](_0x3d195b,{'enabled':![],'sectionId':0x3eb})){var _0x334cc4=_[_0x02d8('0x48')](_0x3d195b,{'sectionId':0x3eb});return getCustomDashboards(_0x334cc4)[_0x02d8('0x28')](function(_0x40afa2){return _[_0x02d8('0x2f')](_0x3d195b,function(_0x2f50b6){if(_0x2f50b6[_0x02d8('0x57')]===0x3eb){_0x2f50b6['subsections']=_0x40afa2;}return _0x2f50b6;});});}else{return;}})['then'](function(_0x5e79b8){if(_0x5e79b8)_0x3d195b=_0x5e79b8;if(_[_0x02d8('0x5f')](_0xf7142f,0x709)||_[_0x02d8('0x61')](_0x3d195b,{'enabled':![],'sectionId':0x709})){var _0x2576fc=_[_0x02d8('0x48')](_0x3d195b,{'sectionId':0x709});return getPlugins(_0x2576fc)[_0x02d8('0x28')](function(_0x4e5397){return _[_0x02d8('0x2f')](_0x3d195b,function(_0x58f3bf){if(_0x58f3bf['sectionId']===0x709){_0x58f3bf[_0x02d8('0x60')]=_0x4e5397;}return _0x58f3bf;});});}else{return;}})[_0x02d8('0x28')](function(_0x3eb967){if(_0x3eb967)_0x3d195b=_0x3eb967;return _0x3d195b;})[_0x02d8('0x28')](respondWithResult(_0x4d994b,null))[_0x02d8('0x45')](handleError(_0x4d994b,null));};function hasDefaultDashboard(_0x134752){var _0x3b083d=[0x65];return new BPromise(function(_0x2fbb1f,_0x527379){try{if(_0x134752['autoAssociation']){_0x2fbb1f(_0x3b083d);}else{return db['UserProfileResource']['findOne']({'where':{'sectionId':_0x134752['id']},'raw':!![]})[_0x02d8('0x28')](function(_0x1bc3f6){if(_0x1bc3f6){_0x2fbb1f(_0x3b083d);}});}}catch(_0x507460){_0x527379(_0x507460);}});}function getCustomDashboards(_0x2d4b6b){var _0x382c24=[];return new BPromise(function(_0x1b2149,_0x4d31d9){try{if(_0x2d4b6b[_0x02d8('0x55')]){return db['Dashboard'][_0x02d8('0x53')]({'raw':!![]})[_0x02d8('0x28')](function(_0x436bea){_0x436bea[_0x02d8('0x62')](function(_0x1346cf){_0x382c24[_0x02d8('0x5c')](_0x1346cf['id']+0x1869f);});_0x1b2149(_0x382c24);});}else{return db[_0x02d8('0x56')][_0x02d8('0x53')]({'where':{'sectionId':_0x2d4b6b['id']},'raw':!![]})['then'](function(_0x77a86){_0x77a86[_0x02d8('0x62')](function(_0x37d38f){_0x382c24[_0x02d8('0x5c')](_0x37d38f[_0x02d8('0x63')]+0x1869f);});_0x1b2149(_0x382c24);});}}catch(_0x5e6bc1){_0x4d31d9(_0x5e6bc1);}});}function getPlugins(_0x218f1f){var _0x524e14=[];return new BPromise(function(_0x4ae58a,_0x576897){try{if(_0x218f1f['autoAssociation']){return db[_0x02d8('0x64')]['findAll']({'raw':!![]})[_0x02d8('0x28')](function(_0xcebc92){_0xcebc92['forEach'](function(_0x251d77){_0x524e14['push'](_0x251d77['id']+0x15b38);});_0x4ae58a(_0x524e14);});}else{return db[_0x02d8('0x56')][_0x02d8('0x53')]({'where':{'sectionId':_0x218f1f['id']},'raw':!![]})[_0x02d8('0x28')](function(_0x3fef8a){_0x3fef8a[_0x02d8('0x62')](function(_0x3f583f){_0x524e14[_0x02d8('0x5c')](_0x3f583f[_0x02d8('0x63')]+0x15b38);});_0x4ae58a(_0x524e14);});}}catch(_0x34cc40){_0x576897(_0x34cc40);}});}exports[_0x02d8('0x65')]=function(_0x21eab4,_0x47e636){return db[_0x02d8('0x41')][_0x02d8('0x48')]({'where':{'id':_0x21eab4[_0x02d8('0x47')]['id']}})['then'](handleEntityNotFound(_0x47e636,null))[_0x02d8('0x28')](function(_0x49e7d6){if(_0x49e7d6){return db['sequelize'][_0x02d8('0x66')](function(_0x2402ce){return db[_0x02d8('0x52')][_0x02d8('0x53')]({'where':{'userProfileId':_0x21eab4[_0x02d8('0x47')]['id']},'attributes':['id'],'raw':!![]})[_0x02d8('0x28')](function(_0x30d692){if(_0x30d692){return db['UserProfileSection'][_0x02d8('0x29')]({'where':{'userProfileId':_0x21eab4[_0x02d8('0x47')]['id'],'id':_[_0x02d8('0x2f')](_0x30d692,function(_0x5e7594){return _0x5e7594['id'];})},'transaction':_0x2402ce});}})[_0x02d8('0x28')](function(_0x4dc9c5){var _0x18e202=_[_0x02d8('0x2f')](_0x21eab4[_0x02d8('0x4a')],function(_0xe7aacf){_0xe7aacf[_0x02d8('0x58')]=_0x21eab4[_0x02d8('0x47')]['id'];return _0xe7aacf;});return db[_0x02d8('0x52')]['bulkCreate'](_0x18e202,{'raw':!![],'transaction':_0x2402ce});})['then'](function(_0x42582b){var _0x59a27f=_[_0x02d8('0x3d')](_[_0x02d8('0x2f')](_0x42582b,function(_0x9162d2){return _0x9162d2['get']({'plain':!![]});}),{'includeAll':![]});if(_0x59a27f){return db['UserProfileSection'][_0x02d8('0x53')]({'where':{'userProfileId':_0x21eab4[_0x02d8('0x47')]['id'],'sectionId':_[_0x02d8('0x2f')](_0x59a27f,function(_0x3e5577){return _0x3e5577[_0x02d8('0x57')];})},'attributes':['id','sectionId'],'raw':!![]})['then'](function(_0x8b5e15){var _0x302222=_[_0x02d8('0x2f')](_0x21eab4['body'],function(_0xe7a9a6){_0xe7a9a6[_0x02d8('0x58')]=_0x21eab4['params']['id'];return _0xe7a9a6;});return db[_0x02d8('0x56')][_0x02d8('0x67')](_0x302222,{'raw':!![],'transaction':_0x2402ce});});}})[_0x02d8('0x45')](handleError(_0x47e636,null));});}})[_0x02d8('0x28')](function(_0x2bbf9e){var _0x1f0ec4=_['map'](_0x2bbf9e,function(_0x5ab112){return _0x5ab112[_0x02d8('0x4c')]({'plain':!![]});});})[_0x02d8('0x28')](respondWithResult(_0x47e636,null))['catch'](handleError(_0x47e636,null));};exports[_0x02d8('0x68')]=function(_0x386aa4,_0x5bb89b,_0x2685f2){return db[_0x02d8('0x41')][_0x02d8('0x48')]({'where':{'id':_0x386aa4[_0x02d8('0x47')]['id']}})[_0x02d8('0x28')](handleEntityNotFound(_0x5bb89b,null))[_0x02d8('0x28')](function(_0x4391dd){if(_0x4391dd){return _0x4391dd[_0x02d8('0x68')](_0x386aa4[_0x02d8('0x34')][_0x02d8('0x5d')]);}})[_0x02d8('0x28')](respondWithStatusCode(_0x5bb89b,null))['catch'](handleError(_0x5bb89b,null));};exports[_0x02d8('0x69')]=function(_0x26dba5,_0x1506f8){var _0x10be60={'raw':![],'where':{}};var _0x288101={};var _0x4165ec={'count':0x0,'rows':[]};var _0x23807c=_0x26dba5[_0x02d8('0x34')][_0x02d8('0x6a')];if(typeof _0x23807c===_0x02d8('0x6b')){throw new db[(_0x02d8('0x6c'))][(_0x02d8('0x6d'))](_0x02d8('0x6e'));}var _0x2e78e0=_0x26dba5[_0x02d8('0x34')][_0x02d8('0x6f')]||![];var _0x54457e=getQueryModels(_0x23807c,_0x2e78e0);if(typeof _0x54457e[_0x02d8('0x70')]===_0x02d8('0x6b')){throw new db['Sequelize'][(_0x02d8('0x6d'))](_0x02d8('0x71')+_0x23807c+'\x27');}var _0x370dbd=[];if(!_[_0x02d8('0x72')](_0x54457e['parentSections'])){_0x370dbd=_0x54457e[_0x02d8('0x73')];}else{_0x370dbd=[{'name':_0x23807c}];}return db[_0x02d8('0x41')][_0x02d8('0x74')]({'where':{'id':_0x26dba5[_0x02d8('0x47')]['id']}})[_0x02d8('0x28')](handleEntityNotFound(_0x1506f8,null))[_0x02d8('0x28')](function(_0x597d80){if(_0x597d80){var _0xa455e4=[];for(var _0x2bb291=0x0;_0x2bb291<_0x370dbd[_0x02d8('0x39')];_0x2bb291++){_0xa455e4[_0x02d8('0x5c')](db[_0x02d8('0x52')]['findOne']({'where':{'userProfileId':_0x597d80['id'],'name':_0x370dbd[_0x2bb291][_0x02d8('0x2c')]},'raw':!![]}));}return BPromise[_0x02d8('0x75')](_0xa455e4);}})[_0x02d8('0x28')](function(_0x317b2d){var _0x517a45=_[_0x02d8('0x3d')](_0x317b2d,function(_0x883362){return _0x883362?_0x883362:undefined;});var _0x107379=_[_0x02d8('0x3d')](_0x370dbd,[_0x02d8('0x76'),!![]]);var _0x1f1174=_[_0x02d8('0x72')](_0x517a45)&&_[_0x02d8('0x72')](_0x107379)?null:_[_0x02d8('0x77')](_0x107379,_0x517a45);if(_0x1f1174){var _0x4f3149=[];for(var _0x1729ed=0x0;_0x1729ed<_0x1f1174['length'];_0x1729ed++){var _0x21cffb=_[_0x02d8('0x48')](_0x370dbd,function(_0x4da5fc){return _0x1f1174[_0x1729ed]?_0x4da5fc['name']===_0x1f1174[_0x1729ed][_0x02d8('0x2c')]:null;});if(_0x21cffb){if(_0x1f1174[_0x1729ed][_0x02d8('0x76')]){_0x4f3149[_0x02d8('0x5c')](getAllResources(_0x54457e['childModel'],_0x1f1174[_0x1729ed]));}else{if(!_0x1f1174[_0x1729ed][_0x02d8('0x55')]){_0x4f3149[_0x02d8('0x5c')](getAllowedResources(_0x21cffb,_0x1f1174[_0x1729ed],_0x54457e[_0x02d8('0x70')]));}else{if(_0x21cffb[_0x02d8('0x32')]){_0x4f3149[_0x02d8('0x5c')](getAllFilteredResources(_0x21cffb,_0x1f1174[_0x1729ed]));}}}}}return BPromise[_0x02d8('0x75')](_0x4f3149);}else{return null;}})[_0x02d8('0x28')](function(_0x3f85e3){var _0x1dee31=_0x3f85e3;var _0x4c0999=null;if(_0x1dee31){_0x4c0999=_0x1dee31[_0x02d8('0x39')]===0x1?_0x1dee31[0x0]:null;}if(_0x4c0999||_0x1dee31){var _0x1ef8d4=db[_0x54457e[_0x02d8('0x70')]][_0x02d8('0x30')];_0x288101[_0x02d8('0x32')]=_[_0x02d8('0x33')](_0x1ef8d4);_0x288101[_0x02d8('0x34')]=_[_0x02d8('0x33')](_0x26dba5['query']);_0x288101[_0x02d8('0x35')]=_[_0x02d8('0x36')](_0x288101[_0x02d8('0x32')],_0x288101[_0x02d8('0x34')]);_0x10be60[_0x02d8('0x38')]=_[_0x02d8('0x36')](_0x288101[_0x02d8('0x32')],qs[_0x02d8('0x37')](_0x26dba5['query'][_0x02d8('0x37')]));_0x10be60[_0x02d8('0x38')]=_0x10be60[_0x02d8('0x38')][_0x02d8('0x39')]?_0x10be60[_0x02d8('0x38')]:_0x288101[_0x02d8('0x32')];if(!_0x26dba5[_0x02d8('0x34')]['hasOwnProperty']('nolimit')){_0x10be60[_0x02d8('0x21')]=qs['limit'](_0x26dba5['query'][_0x02d8('0x21')]);_0x10be60[_0x02d8('0x20')]=qs[_0x02d8('0x20')](_0x26dba5[_0x02d8('0x34')][_0x02d8('0x20')]);}_0x10be60[_0x02d8('0x3a')]=qs['sort'](_0x26dba5[_0x02d8('0x34')][_0x02d8('0x78')]);_0x10be60[_0x02d8('0x3b')]=qs[_0x02d8('0x35')](_[_0x02d8('0x3c')](_0x26dba5[_0x02d8('0x34')],_0x288101[_0x02d8('0x35')]));if(_0x26dba5['query'][_0x02d8('0x3d')]){_0x10be60[_0x02d8('0x3b')]=_[_0x02d8('0x3e')](_0x10be60[_0x02d8('0x3b')],{'$or':_['map'](_0x1ef8d4,function(_0x32537e){if(_0x32537e[_0x02d8('0x79')][_0x02d8('0x7a')]!=='VIRTUAL'){var _0x56fc07={};_0x56fc07[_0x32537e[_0x02d8('0x7b')]]={'$like':'%'+_0x26dba5[_0x02d8('0x34')][_0x02d8('0x3d')]+'%'};return _0x56fc07;}})});}var _0x1425b3=[];if(_0x4c0999){var _0x42f1e3=_[_0x02d8('0x48')](_0x370dbd,[_0x02d8('0x2c'),_0x4c0999[_0x02d8('0x2c')]]);if(_0x42f1e3['field']){var _0x5c29de={};if(_0x54457e[_0x02d8('0x70')]===_0x02d8('0x7c')){_0x5c29de[_0x42f1e3[_0x02d8('0x7d')]]=_[_0x02d8('0x2f')](_0x4c0999['associatedResources'],'id');}else{_0x5c29de[_0x42f1e3[_0x02d8('0x7d')]]=_0x4c0999[_0x02d8('0x7e')];}_0x1425b3['push'](_0x5c29de);}else{_0x10be60[_0x02d8('0x3b')]['id']=_0x4c0999['associatedResources'];}}else{for(var _0x93c51=0x0;_0x93c51<_0x1dee31[_0x02d8('0x39')];_0x93c51++){var _0x42f1e3=_['find'](_0x370dbd,[_0x02d8('0x2c'),_0x1dee31[_0x93c51]['name']]);if(_0x42f1e3[_0x02d8('0x7b')]){var _0x5c29de={};_0x5c29de[_0x42f1e3[_0x02d8('0x7d')]]=_0x1dee31[_0x93c51][_0x02d8('0x7e')];_0x1425b3[_0x02d8('0x5c')](_0x5c29de);}else{if(!_0x10be60[_0x02d8('0x3b')]['id'])_0x10be60[_0x02d8('0x3b')]['id']=[];_0x1dee31[_0x93c51]['associatedResources'][_0x02d8('0x62')](function(_0x39b7a2){_0x10be60['where']['id']['push'](_0x39b7a2);});}}}if(!_['isEmpty'](_0x1425b3)){_0x10be60[_0x02d8('0x3b')]=_['merge'](_0x10be60['where'],{'$and':{'$or':_0x1425b3}});}_0x10be60=_[_0x02d8('0x3e')]({},_0x10be60,_0x26dba5[_0x02d8('0x40')]);if(_0x4c0999&&!_0x4c0999[_0x02d8('0x55')]&&_0x54457e[_0x02d8('0x70')]==='AnalyticExtractedReport'){if(_0x26dba5[_0x02d8('0x34')]['includeAll']){_0x10be60[_0x02d8('0x43')]=[{'all':!![]}];}return db[_0x54457e[_0x02d8('0x70')]][_0x02d8('0x53')](_0x10be60)[_0x02d8('0x28')](function(_0x4d4ac4){var _0x467f03=[];_0x4d4ac4['forEach'](function(_0x5b8074){var _0x1c6f4d;switch(_0x5b8074['reportType']){case'default':_0x1c6f4d=_['find'](_0x4c0999[_0x02d8('0x7e')],function(_0x1ed8cd){return _0x1ed8cd['id']===_0x5b8074[_0x02d8('0x7f')]&&_0x1ed8cd[_0x02d8('0x79')]===_0x02d8('0x80');});break;case _0x02d8('0x81'):_0x1c6f4d=_[_0x02d8('0x48')](_0x4c0999['associatedResources'],function(_0x3d044a){return _0x3d044a['id']===_0x5b8074[_0x02d8('0x7f')]&&_0x3d044a[_0x02d8('0x79')]===_0x02d8('0x82');});break;}if(_0x1c6f4d)_0x467f03[_0x02d8('0x5c')](_0x5b8074);});_0x4165ec['count']=_0x467f03[_0x02d8('0x39')];_0x4165ec['rows']=_0x467f03;return _0x4165ec;});}else{return db[_0x54457e[_0x02d8('0x70')]]['count']({'where':_0x10be60['where']})['then'](function(_0x707b3d){_0x4165ec['count']=_0x707b3d;if(_0x26dba5[_0x02d8('0x34')][_0x02d8('0x42')]){if(_0x54457e[_0x02d8('0x70')]===_0x02d8('0x83')){_0x10be60[_0x02d8('0x43')]=[{'model':db[_0x02d8('0x84')],'as':_0x02d8('0x85'),'attributes':['id',_0x02d8('0x2c'),_0x02d8('0x86')],'required':_0x26dba5['query'][_0x02d8('0x87')]?!![]:![]},{'model':db[_0x02d8('0x84')],'as':_0x02d8('0x88'),'attributes':['id',_0x02d8('0x2c'),_0x02d8('0x86')],'through':_0x26dba5[_0x02d8('0x34')][_0x02d8('0x87')]?{'attributes':[],'where':{'TagId':_0x26dba5[_0x02d8('0x34')][_0x02d8('0x87')]||undefined}}:{},'required':_0x26dba5[_0x02d8('0x34')][_0x02d8('0x87')]?!![]:![]}];}else{_0x10be60['include']=[{'all':!![]}];}}return db[_0x54457e['childModel']]['findAll'](_0x10be60);})[_0x02d8('0x28')](function(_0x871dd7){_0x4165ec[_0x02d8('0x44')]=_0x871dd7;return _0x4165ec;});}}else{return _0x4165ec;}})[_0x02d8('0x28')](respondWithFilteredResult(_0x1506f8,_0x10be60))[_0x02d8('0x45')](handleError(_0x1506f8,null));};function getAllResources(_0x476d7a,_0x23bed3){return new BPromise(function(_0xc0f4a8,_0x2d0688){if(_0x23bed3){var _0x3558d7=_0x23bed3[_0x02d8('0x3d')]?{[_0x23bed3[_0x02d8('0x3d')][_0x02d8('0x7b')]]:_0x23bed3[_0x02d8('0x3d')][_0x02d8('0x89')]}:undefined;return db[_0x476d7a]['findAll']({'where':_0x3558d7,'raw':!![]})['then'](function(_0x1fbbaa){_0x23bed3[_0x02d8('0x7e')]=_[_0x02d8('0x2f')](_0x1fbbaa,'id');_0xc0f4a8(_0x23bed3);})['catch'](function(_0x3665d6){_0x2d0688(_0x3665d6);});}else{_0xc0f4a8(null);}});}function getAllFilteredResources(_0x967ccd,_0x20fc55){return new BPromise(function(_0x51f058,_0x154af5){var _0x18ac12=_0x967ccd[_0x02d8('0x3d')]?{[_0x967ccd[_0x02d8('0x3d')][_0x02d8('0x7b')]]:_0x967ccd[_0x02d8('0x3d')]['value']}:undefined;return db[_0x967ccd['model']][_0x02d8('0x53')]({'where':_0x18ac12,'raw':!![]})[_0x02d8('0x28')](function(_0x4a188d){_0x20fc55[_0x02d8('0x7e')]=_[_0x02d8('0x2f')](_0x4a188d,function(_0x3b71e8){return _0x3b71e8[_0x02d8('0x2c')];});_0x51f058(_0x20fc55);})[_0x02d8('0x45')](function(_0xad5a0a){_0x154af5(_0xad5a0a);});});}function getAllowedResources(_0x49bf84,_0x7ec575,_0x454498){return new BPromise(function(_0x48b56a,_0x4aacdb){if(_0x7ec575){return db[_0x02d8('0x56')][_0x02d8('0x53')]({'where':{'sectionId':_0x7ec575['id']},'raw':!![]})['then'](function(_0x3dfc6a){if(_0x49bf84[_0x02d8('0x7b')]&&_0x49bf84[_0x02d8('0x7b')]!=='id'){_0x7ec575[_0x02d8('0x7e')]=_[_0x02d8('0x2f')](_0x3dfc6a,function(_0x4e0a4b){return _0x4e0a4b[_0x49bf84[_0x02d8('0x7b')]];});}else{if(_0x454498==='AnalyticExtractedReport'){_0x7ec575[_0x02d8('0x7e')]=_[_0x02d8('0x2f')](_0x3dfc6a,function(_0x5c8ef1){return{'id':_0x5c8ef1[_0x02d8('0x63')],'type':_0x5c8ef1[_0x02d8('0x79')]};});}else{_0x7ec575[_0x02d8('0x7e')]=_[_0x02d8('0x2f')](_0x3dfc6a,function(_0x12130f){return _0x12130f['resourceId'];});}}_0x48b56a(_0x7ec575);})[_0x02d8('0x45')](function(_0x22e244){_0x4aacdb(_0x22e244);});}else{_0x48b56a(null);}});}function getQueryModels(_0x576ea2,_0x43124f){var _0x20d36e=_0x576ea2[_0x02d8('0x8a')]();var _0x3871d0={'childModel':undefined,'parentSections':[]};switch(_0x20d36e){case _0x02d8('0x8b'):_0x3871d0[_0x02d8('0x70')]=_0x02d8('0x8c');break;case _0x02d8('0x8d'):_0x3871d0['childModel']=_0x02d8('0x8e');break;case _0x02d8('0x8f'):_0x3871d0['childModel']=_0x02d8('0x90');_0x3871d0[_0x02d8('0x73')]=[{'name':'SquareProjects','field':_0x02d8('0x2c'),'foreignKey':_0x02d8('0x91')}];break;case _0x02d8('0x92'):_0x3871d0[_0x02d8('0x70')]='JscriptyProject';break;case _0x02d8('0x93'):_0x3871d0['childModel']=_0x02d8('0x83');_0x3871d0[_0x02d8('0x73')]=[{'name':_0x02d8('0x94'),'field':'id','foreignKey':'ListId'}];break;case _0x02d8('0x95'):_0x3871d0[_0x02d8('0x70')]=_0x02d8('0x96');break;case _0x02d8('0x97'):_0x3871d0[_0x02d8('0x70')]=_0x02d8('0x98');break;case _0x02d8('0x99'):_0x3871d0['childModel']=_0x02d8('0x9a');break;case _0x02d8('0x9b'):_0x3871d0['childModel']='ChatQueue';break;case'chatwebsites':_0x3871d0[_0x02d8('0x70')]=_0x02d8('0x9c');break;case _0x02d8('0x9d'):_0x3871d0['childModel']='FaxQueue';break;case _0x02d8('0x9e'):_0x3871d0[_0x02d8('0x70')]='FaxAccount';break;case _0x02d8('0x9f'):case _0x02d8('0xa0'):case _0x02d8('0xa1'):_0x3871d0[_0x02d8('0x70')]=_0x02d8('0xa2');break;case _0x02d8('0xa3'):_0x3871d0[_0x02d8('0x70')]=_0x02d8('0xa4');break;case _0x02d8('0xa5'):_0x3871d0['childModel']=_0x02d8('0xa6');break;case _0x02d8('0xa7'):_0x3871d0['childModel']=_0x02d8('0xa8');_0x3871d0['parentSections']=[{'name':_0x02d8('0xa9'),'field':'name','foreignKey':_0x02d8('0xaa'),'model':_0x02d8('0xab'),'filter':{'field':'role','value':[_0x02d8('0xac')]}},{'name':_0x02d8('0xad'),'field':_0x02d8('0x2c'),'foreignKey':_0x02d8('0xaa'),'model':_0x02d8('0xab'),'filter':{'field':_0x02d8('0xae'),'value':['telephone']}},{'name':_0x02d8('0xaf'),'field':_0x02d8('0x2c'),'foreignKey':_0x02d8('0xb0'),'model':_0x02d8('0xb1'),'filter':{'field':_0x02d8('0x79'),'value':[_0x02d8('0xb2')]}},{'name':_0x02d8('0xb3'),'field':_0x02d8('0x2c'),'foreignKey':_0x02d8('0xb0'),'model':_0x02d8('0xb1'),'filter':{'field':'type','value':['outbound']}}];break;case _0x02d8('0xb4'):_0x3871d0['childModel']=_0x02d8('0xb5');break;case'chanspies':_0x3871d0[_0x02d8('0x70')]='VoiceChanSpy';break;case _0x02d8('0xb6'):_0x3871d0[_0x02d8('0x70')]=_0x02d8('0xb7');break;case _0x02d8('0xb8'):_0x3871d0[_0x02d8('0x70')]=_0x02d8('0xb9');break;case _0x02d8('0xba'):_0x3871d0[_0x02d8('0x70')]=_0x02d8('0xbb');break;case _0x02d8('0xbc'):_0x3871d0['childModel']=_0x02d8('0xbd');break;case'mailsubstatuses':_0x3871d0[_0x02d8('0x70')]=_0x02d8('0xbe');break;case _0x02d8('0xbf'):_0x3871d0[_0x02d8('0x70')]=_0x02d8('0xc0');break;case'openchannelaccounts':_0x3871d0[_0x02d8('0x70')]=_0x02d8('0xc1');break;case _0x02d8('0xc2'):_0x3871d0['childModel']=_0x02d8('0xc3');break;case'smsaccounts':_0x3871d0['childModel']=_0x02d8('0xc4');break;case'teams':_0x3871d0['childModel']=_0x02d8('0xc5');break;case _0x02d8('0xc6'):case _0x02d8('0xc7'):_0x3871d0[_0x02d8('0x70')]=_0x02d8('0xb1');if(_0x43124f){_0x3871d0[_0x02d8('0x73')]=[{'name':'VoiceQueues'},{'name':_0x02d8('0xb3')}];}break;case _0x02d8('0xc8'):case _0x02d8('0xc9'):case _0x02d8('0xca'):_0x3871d0[_0x02d8('0x70')]=_0x02d8('0xab');if(_0x43124f){_0x3871d0['parentSections']=[{'name':_0x02d8('0xcb'),'filter':{'field':_0x02d8('0xae'),'value':[_0x02d8('0xcc'),_0x02d8('0xcd')]},'ignore':!![]},{'name':_0x02d8('0xa9')},{'name':_0x02d8('0xad')}];}break;case'zendeskaccounts':_0x3871d0[_0x02d8('0x70')]='ZendeskAccount';break;case _0x02d8('0xce'):_0x3871d0[_0x02d8('0x70')]='SalesforceAccount';break;case'freshdeskaccounts':_0x3871d0[_0x02d8('0x70')]='FreshdeskAccount';break;case'sugarcrmaccounts':_0x3871d0[_0x02d8('0x70')]=_0x02d8('0xcf');break;case _0x02d8('0xd0'):_0x3871d0[_0x02d8('0x70')]='DeskAccount';break;case'zohoaccounts':_0x3871d0[_0x02d8('0x70')]=_0x02d8('0xd1');break;case _0x02d8('0xd2'):_0x3871d0[_0x02d8('0x70')]=_0x02d8('0xab');break;case _0x02d8('0xd3'):_0x3871d0[_0x02d8('0x70')]='CannedAnswer';break;case _0x02d8('0xd4'):_0x3871d0[_0x02d8('0x70')]=_0x02d8('0xd5');break;case _0x02d8('0xd6'):_0x3871d0[_0x02d8('0x70')]='Dashboard';break;case _0x02d8('0xd7'):_0x3871d0['childModel']='Interval';break;case'pauses':_0x3871d0[_0x02d8('0x70')]='Pause';break;case _0x02d8('0xd8'):_0x3871d0[_0x02d8('0x70')]=_0x02d8('0xd9');break;case _0x02d8('0xda'):_0x3871d0['childModel']=_0x02d8('0xdb');break;case _0x02d8('0xdc'):_0x3871d0['childModel']=_0x02d8('0x84');break;case _0x02d8('0xdd'):_0x3871d0[_0x02d8('0x70')]=_0x02d8('0xde');break;case'triggers':_0x3871d0[_0x02d8('0x70')]=_0x02d8('0xdf');break;case'trunks':_0x3871d0[_0x02d8('0x70')]=_0x02d8('0xe0');break;case _0x02d8('0xe1'):_0x3871d0['childModel']='Variable';break;case'plugins':_0x3871d0[_0x02d8('0x70')]='Plugin';break;case _0x02d8('0xe2'):_0x3871d0['childModel']=_0x02d8('0x7c');_0x3871d0['parentSections']=[{'name':'Reports','field':'id','foreignKey':_0x02d8('0x7f')}];break;case _0x02d8('0xe3'):_0x3871d0['childModel']=_0x02d8('0xe4');break;default:return _0x3871d0;}return _0x3871d0;} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 6f04f17..f539038 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 _0xdb88=['../../mysqldb','UserProfile','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x36c727,_0x2492ad){var _0x30e6c0=function(_0x5c1803){while(--_0x5c1803){_0x36c727['push'](_0x36c727['shift']());}};_0x30e6c0(++_0x2492ad);}(_0xdb88,0x6c));var _0x8db8=function(_0x2e9d2c,_0x2e97ad){_0x2e9d2c=_0x2e9d2c-0x0;var _0x233caa=_0xdb88[_0x2e9d2c];return _0x233caa;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x8db8('0x0'))['db'][_0x8db8('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x8db8('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8db8('0x3'),'afterDestroy':_0x8db8('0x4')};function emitEvent(_0x33cb95){return function(_0x17f88,_0x2e250b,_0x15f0e2){UserProfileEvents[_0x8db8('0x5')](_0x33cb95+':'+_0x17f88['id'],_0x17f88);UserProfileEvents['emit'](_0x33cb95,_0x17f88);_0x15f0e2(null);};}for(var e in events){if(events[_0x8db8('0x6')](e)){var event=events[e];UserProfile[_0x8db8('0x7')](e,emitEvent(event));}}module[_0x8db8('0x8')]=UserProfileEvents; \ No newline at end of file +var _0x7b48=['hasOwnProperty','hook','../../mysqldb','UserProfile','setMaxListeners','update','remove'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0x7b48,0xf7));var _0x87b4=function(_0x3a3fcc,_0x38afb3){_0x3a3fcc=_0x3a3fcc-0x0;var _0xe16438=_0x7b48[_0x3a3fcc];return _0xe16438;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x87b4('0x0'))['db'][_0x87b4('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x87b4('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x87b4('0x3'),'afterDestroy':_0x87b4('0x4')};function emitEvent(_0x4261b3){return function(_0x1618c2,_0x467a7e,_0x5a30c3){UserProfileEvents['emit'](_0x4261b3+':'+_0x1618c2['id'],_0x1618c2);UserProfileEvents['emit'](_0x4261b3,_0x1618c2);_0x5a30c3(null);};}for(var e in events){if(events[_0x87b4('0x5')](e)){var event=events[e];UserProfile[_0x87b4('0x6')](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 cf424ee..e88cc30 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 _0xf69d=['UserProfile','user_profiles','util','../../config/logger','moment','request-promise','rimraf','./userProfile.attributes','exports','define'];(function(_0x1c11a9,_0x1028ac){var _0xa12cb4=function(_0x187a1b){while(--_0x187a1b){_0x1c11a9['push'](_0x1c11a9['shift']());}};_0xa12cb4(++_0x1028ac);}(_0xf69d,0x17e));var _0xdf69=function(_0x1697bf,_0x319fc8){_0x1697bf=_0x1697bf-0x0;var _0xed8e6=_0xf69d[_0x1697bf];return _0xed8e6;};'use strict';var _=require('lodash');var util=require(_0xdf69('0x0'));var logger=require(_0xdf69('0x1'))('api');var moment=require(_0xdf69('0x2'));var BPromise=require('bluebird');var rp=require(_0xdf69('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdf69('0x4'));var config=require('../../config/environment');var attributes=require(_0xdf69('0x5'));module[_0xdf69('0x6')]=function(_0xe2ddb2,_0xe2c11f){return _0xe2ddb2[_0xdf69('0x7')](_0xdf69('0x8'),attributes,{'tableName':_0xdf69('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3445=['../../config/environment','exports','define','UserProfile','user_profiles','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x3e7e96,_0x5683ca){var _0x13f6f0=function(_0x320767){while(--_0x320767){_0x3e7e96['push'](_0x3e7e96['shift']());}};_0x13f6f0(++_0x5683ca);}(_0x3445,0xb9));var _0x5344=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3445[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5344('0x0'));var util=require(_0x5344('0x1'));var logger=require(_0x5344('0x2'))('api');var moment=require(_0x5344('0x3'));var BPromise=require(_0x5344('0x4'));var rp=require(_0x5344('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5344('0x6'));var config=require(_0x5344('0x7'));var attributes=require('./userProfile.attributes');module[_0x5344('0x8')]=function(_0x147a78,_0x16fe8d){return _0x147a78[_0x5344('0x9')](_0x5344('0xa'),attributes,{'tableName':_0x5344('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index d0bbe26..7e6b38d 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 _0xe14b=['ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','./userProfile.socket','register','request','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring'];(function(_0x57d671,_0x1a101c){var _0x450dfe=function(_0x53c457){while(--_0x53c457){_0x57d671['push'](_0x57d671['shift']());}};_0x450dfe(++_0x1a101c);}(_0xe14b,0x93));var _0xbe14=function(_0x2bced3,_0x59c962){_0x2bced3=_0x2bced3-0x0;var _0x5d9a81=_0xe14b[_0x2bced3];return _0x5d9a81;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});config[_0xbe14('0x9')]=_[_0xbe14('0xa')](config[_0xbe14('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xbe14('0xb'))[_0xbe14('0xc')](socket);function respondWithRpcPromise(_0xd68cd7,_0x90b4f,_0x53c7ea){return new BPromise(function(_0x5b9fc6,_0x113243){return client[_0xbe14('0xd')](_0xd68cd7,_0x53c7ea)['then'](function(_0x254c3b){logger[_0xbe14('0xe')](_0xbe14('0xf'),_0x90b4f,_0xbe14('0x10'));logger[_0xbe14('0x11')](_0xbe14('0x12'),_0x90b4f,_0xbe14('0x10'),JSON[_0xbe14('0x13')](_0x254c3b));if(_0x254c3b[_0xbe14('0x14')]){if(_0x254c3b[_0xbe14('0x14')][_0xbe14('0x15')]===0x1f4){logger[_0xbe14('0x14')](_0xbe14('0xf'),_0x90b4f,_0x254c3b['error']['message']);return _0x113243(_0x254c3b[_0xbe14('0x14')][_0xbe14('0x16')]);}logger[_0xbe14('0x14')](_0xbe14('0xf'),_0x90b4f,_0x254c3b['error'][_0xbe14('0x16')]);return _0x5b9fc6(_0x254c3b[_0xbe14('0x14')][_0xbe14('0x16')]);}else{logger[_0xbe14('0xe')](_0xbe14('0xf'),_0x90b4f,_0xbe14('0x10'));_0x5b9fc6(_0x254c3b[_0xbe14('0x17')]['message']);}})[_0xbe14('0x18')](function(_0x456ca8){logger[_0xbe14('0x14')](_0xbe14('0xf'),_0x90b4f,_0x456ca8);_0x113243(_0x456ca8);});});} \ No newline at end of file +var _0xa630=['debug','UserProfile,\x20%s,\x20%s,\x20%s','error','code','UserProfile,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent'];(function(_0xa5fd5f,_0x3926fa){var _0x8ac6d9=function(_0x47748e){while(--_0x47748e){_0xa5fd5f['push'](_0xa5fd5f['shift']());}};_0x8ac6d9(++_0x3926fa);}(_0xa630,0xbe));var _0x0a63=function(_0x183eac,_0x296f89){_0x183eac=_0x183eac-0x0;var _0x59c060=_0xa630[_0x183eac];return _0x59c060;};'use strict';var _=require(_0x0a63('0x0'));var util=require(_0x0a63('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0a63('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0a63('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x0a63('0x4'))(_0x0a63('0x5'));var config=require(_0x0a63('0x6'));var jayson=require(_0x0a63('0x7'));var client=jayson[_0x0a63('0x8')]['http']({'port':0x232a});config[_0x0a63('0x9')]=_[_0x0a63('0xa')](config[_0x0a63('0x9')],{'host':_0x0a63('0xb'),'port':0x18eb});var socket=require(_0x0a63('0xc'))(new Redis(config[_0x0a63('0x9')]));require('./userProfile.socket')[_0x0a63('0xd')](socket);function respondWithRpcPromise(_0xb714c7,_0x2dcbda,_0x218142){return new BPromise(function(_0x327bb0,_0x1cccac){return client[_0x0a63('0xe')](_0xb714c7,_0x218142)[_0x0a63('0xf')](function(_0x258511){logger[_0x0a63('0x10')]('UserProfile,\x20%s,\x20%s',_0x2dcbda,_0x0a63('0x11'));logger[_0x0a63('0x12')](_0x0a63('0x13'),_0x2dcbda,_0x0a63('0x11'),JSON['stringify'](_0x258511));if(_0x258511[_0x0a63('0x14')]){if(_0x258511['error'][_0x0a63('0x15')]===0x1f4){logger[_0x0a63('0x14')](_0x0a63('0x16'),_0x2dcbda,_0x258511[_0x0a63('0x14')][_0x0a63('0x17')]);return _0x1cccac(_0x258511[_0x0a63('0x14')][_0x0a63('0x17')]);}logger[_0x0a63('0x14')]('UserProfile,\x20%s,\x20%s',_0x2dcbda,_0x258511[_0x0a63('0x14')]['message']);return _0x327bb0(_0x258511[_0x0a63('0x14')][_0x0a63('0x17')]);}else{logger[_0x0a63('0x10')](_0x0a63('0x16'),_0x2dcbda,_0x0a63('0x11'));_0x327bb0(_0x258511[_0x0a63('0x18')][_0x0a63('0x17')]);}})[_0x0a63('0x19')](function(_0x2fd06c){logger[_0x0a63('0x14')](_0x0a63('0x16'),_0x2dcbda,_0x2fd06c);_0x1cccac(_0x2fd06c);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 3b8a584..6c854f3 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 _0x51ba=['./userProfile.events','save','remove','emit','removeListener','register','userProfile:'];(function(_0x2a7342,_0xdfb720){var _0x57c2fe=function(_0x552c45){while(--_0x552c45){_0x2a7342['push'](_0x2a7342['shift']());}};_0x57c2fe(++_0xdfb720);}(_0x51ba,0x188));var _0xa51b=function(_0x1e999b,_0x4b4897){_0x1e999b=_0x1e999b-0x0;var _0x18365a=_0x51ba[_0x1e999b];return _0x18365a;};'use strict';var UserProfileEvents=require(_0xa51b('0x0'));var events=[_0xa51b('0x1'),_0xa51b('0x2'),'update'];function createListener(_0x147b00,_0x22d2d4){return function(_0x1c872a){_0x22d2d4[_0xa51b('0x3')](_0x147b00,_0x1c872a);};}function removeListener(_0x4545cc,_0x595ba0){return function(){UserProfileEvents[_0xa51b('0x4')](_0x4545cc,_0x595ba0);};}exports[_0xa51b('0x5')]=function(_0x41242b){for(var _0x21bc22=0x0,_0x49beaf=events['length'];_0x21bc22<_0x49beaf;_0x21bc22++){var _0x4c4e4b=events[_0x21bc22];var _0x17c4c1=createListener(_0xa51b('0x6')+_0x4c4e4b,_0x41242b);UserProfileEvents['on'](_0x4c4e4b,_0x17c4c1);}}; \ No newline at end of file +var _0x42c7=['length','./userProfile.events','save','remove','update','emit','removeListener','register'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x42c7,0x99));var _0x742c=function(_0x13fee4,_0x5dc6e7){_0x13fee4=_0x13fee4-0x0;var _0xb9420c=_0x42c7[_0x13fee4];return _0xb9420c;};'use strict';var UserProfileEvents=require(_0x742c('0x0'));var events=[_0x742c('0x1'),_0x742c('0x2'),_0x742c('0x3')];function createListener(_0xd780f8,_0x51d7b3){return function(_0x38abf7){_0x51d7b3[_0x742c('0x4')](_0xd780f8,_0x38abf7);};}function removeListener(_0x197b90,_0x1dc0dd){return function(){UserProfileEvents[_0x742c('0x5')](_0x197b90,_0x1dc0dd);};}exports[_0x742c('0x6')]=function(_0xab722d){for(var _0x3d57eb=0x0,_0x3aa95a=events[_0x742c('0x7')];_0x3d57eb<_0x3aa95a;_0x3d57eb++){var _0x22aae5=events[_0x3d57eb];var _0x2d44c6=createListener('userProfile:'+_0x22aae5,_0xab722d);UserProfileEvents['on'](_0x22aae5,_0x2d44c6);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index f14d449..e5bff1b 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 _0x2357=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports','util','path'];(function(_0x44268d,_0xad8443){var _0x4be92d=function(_0x8a57ff){while(--_0x8a57ff){_0x44268d['push'](_0x44268d['shift']());}};_0x4be92d(++_0xad8443);}(_0x2357,0xa9));var _0x7235=function(_0x5e3428,_0x145322){_0x5e3428=_0x5e3428-0x0;var _0x43cd5f=_0x2357[_0x5e3428];return _0x43cd5f;};'use strict';var multer=require('multer');var util=require(_0x7235('0x0'));var path=require(_0x7235('0x1'));var timeout=require(_0x7235('0x2'));var express=require(_0x7235('0x3'));var router=express[_0x7235('0x4')]();var auth=require(_0x7235('0x5'));var interaction=require(_0x7235('0x6'));var config=require(_0x7235('0x7'));var controller=require('./userProfileResource.controller');router[_0x7235('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7235('0x8')](_0x7235('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x7235('0x8')](_0x7235('0xa'),auth[_0x7235('0xb')](),controller[_0x7235('0xc')]);router[_0x7235('0xd')]('/',auth[_0x7235('0xb')](),controller[_0x7235('0xe')]);router[_0x7235('0xf')](_0x7235('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x7235('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x7235('0x11')]);module[_0x7235('0x12')]=router; \ No newline at end of file +var _0x542d=['../../components/auth/service','../../components/interaction/service','./userProfileResource.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','update','exports','multer','util','path','connect-timeout','Router'];(function(_0x3392bd,_0x3a7451){var _0x1f6711=function(_0x21b5e6){while(--_0x21b5e6){_0x3392bd['push'](_0x3392bd['shift']());}};_0x1f6711(++_0x3a7451);}(_0x542d,0xf7));var _0xd542=function(_0x4cace2,_0x13644c){_0x4cace2=_0x4cace2-0x0;var _0x4e55e3=_0x542d[_0x4cace2];return _0x4e55e3;};'use strict';var multer=require(_0xd542('0x0'));var util=require(_0xd542('0x1'));var path=require(_0xd542('0x2'));var timeout=require(_0xd542('0x3'));var express=require('express');var router=express[_0xd542('0x4')]();var auth=require(_0xd542('0x5'));var interaction=require(_0xd542('0x6'));var config=require('../../config/environment');var controller=require(_0xd542('0x7'));router[_0xd542('0x8')]('/',auth[_0xd542('0x9')](),controller[_0xd542('0xa')]);router[_0xd542('0x8')](_0xd542('0xb'),auth[_0xd542('0x9')](),controller['describe']);router['get'](_0xd542('0xc'),auth[_0xd542('0x9')](),controller[_0xd542('0xd')]);router[_0xd542('0xe')]('/',auth[_0xd542('0x9')](),controller[_0xd542('0xf')]);router['put'](_0xd542('0xc'),auth[_0xd542('0x9')](),controller[_0xd542('0x10')]);router['delete'](_0xd542('0xc'),auth[_0xd542('0x9')](),controller['destroy']);module[_0xd542('0x11')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 00eb683..e886f0a 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 _0xc029=['STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc029,0x12b));var _0x9c02=function(_0x3340c8,_0x3d67d7){_0x3340c8=_0x3340c8-0x0;var _0x30ca8a=_0xc029[_0x3340c8];return _0x30ca8a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9c02('0x0')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0x9c02('0x0')],'allowNull':![]}}; \ No newline at end of file +var _0x9612=['sequelize','STRING'];(function(_0x210f9b,_0x2b2d68){var _0x25dc35=function(_0x2a153c){while(--_0x2a153c){_0x210f9b['push'](_0x210f9b['shift']());}};_0x25dc35(++_0x2b2d68);}(_0x9612,0x1de));var _0x2961=function(_0x36e184,_0x103d67){_0x36e184=_0x36e184-0x0;var _0x4f255c=_0x9612[_0x36e184];return _0x4f255c;};'use strict';var Sequelize=require(_0x2961('0x0'));module['exports']={'name':{'type':Sequelize[_0x2961('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0x2961('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index d6c3178..ee393a6 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 _0x8075=['set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','model','query','filters','intersection','fields','length','attributes','hasOwnProperty','limit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','UserProfileResource','findAll','rows','catch','show','keys','find','create','body','params','describe','rimraf','zip-dir','request-promise','moment','mustache','path','to-csv','lodash','squel','crypto','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','count','offset'];(function(_0x39915c,_0x183732){var _0x491c00=function(_0x89a30b){while(--_0x89a30b){_0x39915c['push'](_0x39915c['shift']());}};_0x491c00(++_0x183732);}(_0x8075,0x18d));var _0x5807=function(_0x50e368,_0x2a8b47){_0x50e368=_0x50e368-0x0;var _0x42a9ee=_0x8075[_0x50e368];return _0x42a9ee;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x5807('0x0'));var zipdir=require(_0x5807('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5807('0x2'));var moment=require(_0x5807('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5807('0x4'));var util=require('util');var path=require(_0x5807('0x5'));var sox=require('sox');var csv=require(_0x5807('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5807('0x7'));var squel=require(_0x5807('0x8'));var crypto=require(_0x5807('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x5807('0xa'));var toCsv=require(_0x5807('0x6'));var querystring=require('querystring');var Papa=require(_0x5807('0xb'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5807('0xc'));var as=require(_0x5807('0xd'));var hardwareService=require(_0x5807('0xe'));var logger=require(_0x5807('0xf'))(_0x5807('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x5807('0x11'))['db'];function respondWithStatusCode(_0x29840c,_0x30f004){_0x30f004=_0x30f004||0xcc;return function(_0x2ddadd){if(_0x2ddadd){return _0x29840c[_0x5807('0x12')](_0x30f004);}return _0x29840c[_0x5807('0x13')](_0x30f004)[_0x5807('0x14')]();};}function respondWithResult(_0x5ce5d5,_0x4e123a){_0x4e123a=_0x4e123a||0xc8;return function(_0x479c11){if(_0x479c11){return _0x5ce5d5[_0x5807('0x13')](_0x4e123a)['json'](_0x479c11);}};}function respondWithFilteredResult(_0x19cb9,_0x38154f){return function(_0x4b9ee6){if(_0x4b9ee6){var _0x315ce8=_0x4b9ee6[_0x5807('0x15')],_0xe60eb0=_0x38154f['offset'],_0x5654ab=_0x38154f[_0x5807('0x16')]+_0x38154f['limit'],_0x18be28;if(_0x5654ab>=_0x315ce8){_0x5654ab=_0x315ce8;_0x18be28=0xc8;}else{_0x18be28=0xce;}_0x19cb9[_0x5807('0x13')](_0x18be28);return _0x19cb9[_0x5807('0x17')](_0x5807('0x18'),_0xe60eb0+'-'+_0x5654ab+'/'+_0x315ce8)[_0x5807('0x19')](_0x4b9ee6);}return null;};}function patchUpdates(_0x127316){return function(_0xf69dfc){try{jsonpatch[_0x5807('0x1a')](_0xf69dfc,_0x127316,!![]);}catch(_0x273ae7){return BPromise[_0x5807('0x1b')](_0x273ae7);}return _0xf69dfc[_0x5807('0x1c')]();};}function saveUpdates(_0x4df9e1,_0x371510){return function(_0x278cb1){if(_0x278cb1){return _0x278cb1[_0x5807('0x1d')](_0x4df9e1)[_0x5807('0x1e')](function(_0x49bd8f){return _0x49bd8f;});}return null;};}function removeEntity(_0x3e56a7,_0x59e2fa){return function(_0x5ce0a1){if(_0x5ce0a1){return _0x5ce0a1[_0x5807('0x1f')]()[_0x5807('0x1e')](function(){_0x3e56a7[_0x5807('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a8105,_0x461003){return function(_0x2e64c4){if(!_0x2e64c4){_0x1a8105[_0x5807('0x12')](0x194);}return _0x2e64c4;};}function handleError(_0x110d51,_0x344eab){_0x344eab=_0x344eab||0x1f4;return function(_0x5677d2){logger[_0x5807('0x20')](_0x5677d2[_0x5807('0x21')]);if(_0x5677d2[_0x5807('0x22')]){delete _0x5677d2[_0x5807('0x22')];}_0x110d51[_0x5807('0x13')](_0x344eab)[_0x5807('0x23')](_0x5677d2);};}exports['index']=function(_0x6e2d21,_0x20ca56){var _0xb96345={},_0x3bb9bc={},_0x13934c={'count':0x0,'rows':[]};var _0x48b878=_[_0x5807('0x24')](db['UserProfileResource'][_0x5807('0x25')],function(_0x3bc4e5){return{'name':_0x3bc4e5[_0x5807('0x26')],'type':_0x3bc4e5['type']['key']};});_0x3bb9bc[_0x5807('0x27')]=_[_0x5807('0x24')](_0x48b878,_0x5807('0x22'));_0x3bb9bc[_0x5807('0x28')]=_['keys'](_0x6e2d21[_0x5807('0x28')]);_0x3bb9bc[_0x5807('0x29')]=_[_0x5807('0x2a')](_0x3bb9bc[_0x5807('0x27')],_0x3bb9bc[_0x5807('0x28')]);_0xb96345['attributes']=_[_0x5807('0x2a')](_0x3bb9bc[_0x5807('0x27')],qs[_0x5807('0x2b')](_0x6e2d21[_0x5807('0x28')]['fields']));_0xb96345['attributes']=_0xb96345['attributes'][_0x5807('0x2c')]?_0xb96345[_0x5807('0x2d')]:_0x3bb9bc[_0x5807('0x27')];if(!_0x6e2d21['query'][_0x5807('0x2e')]('nolimit')){_0xb96345[_0x5807('0x2f')]=qs[_0x5807('0x2f')](_0x6e2d21['query'][_0x5807('0x2f')]);_0xb96345[_0x5807('0x16')]=qs['offset'](_0x6e2d21[_0x5807('0x28')][_0x5807('0x16')]);}_0xb96345[_0x5807('0x30')]=qs[_0x5807('0x31')](_0x6e2d21[_0x5807('0x28')]['sort']);_0xb96345[_0x5807('0x32')]=qs[_0x5807('0x29')](_[_0x5807('0x33')](_0x6e2d21['query'],_0x3bb9bc['filters']));if(_0x6e2d21[_0x5807('0x28')][_0x5807('0x34')]){_0xb96345[_0x5807('0x32')]=_['merge'](_0xb96345[_0x5807('0x32')],{'$or':_[_0x5807('0x24')](_0x48b878,function(_0x3236a1){if(_0x3236a1[_0x5807('0x35')]!==_0x5807('0x36')){var _0xcd275d={};_0xcd275d[_0x3236a1[_0x5807('0x22')]]={'$like':'%'+_0x6e2d21[_0x5807('0x28')]['filter']+'%'};return _0xcd275d;}})});}_0xb96345=_[_0x5807('0x37')]({},_0xb96345,_0x6e2d21[_0x5807('0x38')]);var _0x3820d3={'where':_0xb96345[_0x5807('0x32')]};return db['UserProfileResource'][_0x5807('0x15')](_0x3820d3)[_0x5807('0x1e')](function(_0x4413f7){_0x13934c[_0x5807('0x15')]=_0x4413f7;if(_0x6e2d21[_0x5807('0x28')][_0x5807('0x39')]){_0xb96345[_0x5807('0x3a')]=[{'all':!![]}];}return db[_0x5807('0x3b')][_0x5807('0x3c')](_0xb96345);})[_0x5807('0x1e')](function(_0x8d58ed){_0x13934c[_0x5807('0x3d')]=_0x8d58ed;return _0x13934c;})['then'](respondWithFilteredResult(_0x20ca56,_0xb96345))[_0x5807('0x3e')](handleError(_0x20ca56,null));};exports[_0x5807('0x3f')]=function(_0x3fa77d,_0x1ec128){var _0x13396d={'raw':![],'where':{'id':_0x3fa77d['params']['id']}},_0x71f87b={};_0x71f87b['model']=_[_0x5807('0x40')](db['UserProfileResource'][_0x5807('0x25')]);_0x71f87b[_0x5807('0x28')]=_['keys'](_0x3fa77d[_0x5807('0x28')]);_0x71f87b[_0x5807('0x29')]=_['intersection'](_0x71f87b['model'],_0x71f87b[_0x5807('0x28')]);_0x13396d[_0x5807('0x2d')]=_[_0x5807('0x2a')](_0x71f87b[_0x5807('0x27')],qs[_0x5807('0x2b')](_0x3fa77d[_0x5807('0x28')][_0x5807('0x2b')]));_0x13396d[_0x5807('0x2d')]=_0x13396d[_0x5807('0x2d')][_0x5807('0x2c')]?_0x13396d[_0x5807('0x2d')]:_0x71f87b[_0x5807('0x27')];if(_0x3fa77d[_0x5807('0x28')][_0x5807('0x39')]){_0x13396d[_0x5807('0x3a')]=[{'all':!![]}];}_0x13396d=_[_0x5807('0x37')]({},_0x13396d,_0x3fa77d[_0x5807('0x38')]);return db[_0x5807('0x3b')][_0x5807('0x41')](_0x13396d)[_0x5807('0x1e')](handleEntityNotFound(_0x1ec128,null))[_0x5807('0x1e')](respondWithResult(_0x1ec128,null))[_0x5807('0x3e')](handleError(_0x1ec128,null));};exports[_0x5807('0x42')]=function(_0x537d68,_0x4f8b89){return db[_0x5807('0x3b')]['create'](_0x537d68[_0x5807('0x43')],{})[_0x5807('0x1e')](respondWithResult(_0x4f8b89,0xc9))[_0x5807('0x3e')](handleError(_0x4f8b89,null));};exports[_0x5807('0x1d')]=function(_0x2f3877,_0x54d51e){if(_0x2f3877[_0x5807('0x43')]['id']){delete _0x2f3877[_0x5807('0x43')]['id'];}return db['UserProfileResource'][_0x5807('0x41')]({'where':{'id':_0x2f3877[_0x5807('0x44')]['id']}})['then'](handleEntityNotFound(_0x54d51e,null))['then'](saveUpdates(_0x2f3877['body'],null))[_0x5807('0x1e')](respondWithResult(_0x54d51e,null))[_0x5807('0x3e')](handleError(_0x54d51e,null));};exports[_0x5807('0x1f')]=function(_0x322671,_0x25aeaa){return db['UserProfileResource'][_0x5807('0x41')]({'where':{'id':_0x322671[_0x5807('0x44')]['id']}})[_0x5807('0x1e')](handleEntityNotFound(_0x25aeaa,null))[_0x5807('0x1e')](removeEntity(_0x25aeaa,null))[_0x5807('0x3e')](handleError(_0x25aeaa,null));};exports[_0x5807('0x45')]=function(_0x5b6f11,_0x5d94df){return db[_0x5807('0x3b')][_0x5807('0x45')]()[_0x5807('0x1e')](respondWithResult(_0x5d94df,null))[_0x5807('0x3e')](handleError(_0x5d94df,null));}; \ No newline at end of file +var _0xf684=['util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','apply','reject','then','error','name','send','map','UserProfileResource','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','create','body','update','find','params','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0xf684,0x11a));var _0x4f68=function(_0x20029a,_0x594bd1){_0x20029a=_0x20029a-0x0;var _0x3bd50b=_0xf684[_0x20029a];return _0x3bd50b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4f68('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4f68('0x1'));var jsonpatch=require(_0x4f68('0x2'));var rp=require(_0x4f68('0x3'));var moment=require('moment');var BPromise=require(_0x4f68('0x4'));var Mustache=require(_0x4f68('0x5'));var util=require(_0x4f68('0x6'));var path=require(_0x4f68('0x7'));var sox=require(_0x4f68('0x8'));var csv=require(_0x4f68('0x9'));var ejs=require(_0x4f68('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4f68('0xb'));var crypto=require(_0x4f68('0xc'));var jsforce=require(_0x4f68('0xd'));var deskjs=require(_0x4f68('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4f68('0xf'));var Redis=require('ioredis');var authService=require(_0x4f68('0x10'));var qs=require(_0x4f68('0x11'));var as=require(_0x4f68('0x12'));var hardwareService=require(_0x4f68('0x13'));var logger=require(_0x4f68('0x14'))(_0x4f68('0x15'));var utils=require(_0x4f68('0x16'));var config=require(_0x4f68('0x17'));var db=require(_0x4f68('0x18'))['db'];function respondWithStatusCode(_0x4d2ff8,_0xa37e4a){_0xa37e4a=_0xa37e4a||0xcc;return function(_0x33bd17){if(_0x33bd17){return _0x4d2ff8[_0x4f68('0x19')](_0xa37e4a);}return _0x4d2ff8['status'](_0xa37e4a)['end']();};}function respondWithResult(_0x3ccb23,_0xa0c6cb){_0xa0c6cb=_0xa0c6cb||0xc8;return function(_0x147dc8){if(_0x147dc8){return _0x3ccb23[_0x4f68('0x1a')](_0xa0c6cb)['json'](_0x147dc8);}};}function respondWithFilteredResult(_0x2382ce,_0x1a3ee1){return function(_0x39c1a4){if(_0x39c1a4){var _0x3d0d6b=_0x39c1a4[_0x4f68('0x1b')],_0x54a590=_0x1a3ee1[_0x4f68('0x1c')],_0x42fbf2=_0x1a3ee1[_0x4f68('0x1c')]+_0x1a3ee1[_0x4f68('0x1d')],_0x12b6ad;if(_0x42fbf2>=_0x3d0d6b){_0x42fbf2=_0x3d0d6b;_0x12b6ad=0xc8;}else{_0x12b6ad=0xce;}_0x2382ce[_0x4f68('0x1a')](_0x12b6ad);return _0x2382ce[_0x4f68('0x1e')](_0x4f68('0x1f'),_0x54a590+'-'+_0x42fbf2+'/'+_0x3d0d6b)['json'](_0x39c1a4);}return null;};}function patchUpdates(_0x3e6b61){return function(_0xf1695a){try{jsonpatch[_0x4f68('0x20')](_0xf1695a,_0x3e6b61,!![]);}catch(_0x289ebd){return BPromise[_0x4f68('0x21')](_0x289ebd);}return _0xf1695a['save']();};}function saveUpdates(_0x54b5e3,_0x129a3f){return function(_0x187c99){if(_0x187c99){return _0x187c99['update'](_0x54b5e3)['then'](function(_0x505591){return _0x505591;});}return null;};}function removeEntity(_0x343243,_0x46b401){return function(_0x5e731d){if(_0x5e731d){return _0x5e731d['destroy']()[_0x4f68('0x22')](function(){_0x343243[_0x4f68('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3243c5,_0x7362e5){return function(_0x29d183){if(!_0x29d183){_0x3243c5[_0x4f68('0x19')](0x194);}return _0x29d183;};}function handleError(_0xd71f8,_0x193f98){_0x193f98=_0x193f98||0x1f4;return function(_0x1b802a){logger[_0x4f68('0x23')](_0x1b802a['stack']);if(_0x1b802a[_0x4f68('0x24')]){delete _0x1b802a['name'];}_0xd71f8[_0x4f68('0x1a')](_0x193f98)[_0x4f68('0x25')](_0x1b802a);};}exports['index']=function(_0x549389,_0x52ba6f){var _0x4a7dad={},_0x158497={},_0x109dc3={'count':0x0,'rows':[]};var _0x595f25=_[_0x4f68('0x26')](db[_0x4f68('0x27')][_0x4f68('0x28')],function(_0x10d27f){return{'name':_0x10d27f['fieldName'],'type':_0x10d27f[_0x4f68('0x29')][_0x4f68('0x2a')]};});_0x158497[_0x4f68('0x2b')]=_[_0x4f68('0x26')](_0x595f25,_0x4f68('0x24'));_0x158497['query']=_[_0x4f68('0x2c')](_0x549389[_0x4f68('0x2d')]);_0x158497['filters']=_[_0x4f68('0x2e')](_0x158497[_0x4f68('0x2b')],_0x158497[_0x4f68('0x2d')]);_0x4a7dad[_0x4f68('0x2f')]=_[_0x4f68('0x2e')](_0x158497[_0x4f68('0x2b')],qs['fields'](_0x549389['query'][_0x4f68('0x30')]));_0x4a7dad[_0x4f68('0x2f')]=_0x4a7dad[_0x4f68('0x2f')][_0x4f68('0x31')]?_0x4a7dad['attributes']:_0x158497[_0x4f68('0x2b')];if(!_0x549389[_0x4f68('0x2d')][_0x4f68('0x32')]('nolimit')){_0x4a7dad[_0x4f68('0x1d')]=qs[_0x4f68('0x1d')](_0x549389[_0x4f68('0x2d')]['limit']);_0x4a7dad[_0x4f68('0x1c')]=qs[_0x4f68('0x1c')](_0x549389[_0x4f68('0x2d')][_0x4f68('0x1c')]);}_0x4a7dad['order']=qs[_0x4f68('0x33')](_0x549389['query']['sort']);_0x4a7dad['where']=qs[_0x4f68('0x34')](_[_0x4f68('0x35')](_0x549389['query'],_0x158497[_0x4f68('0x34')]));if(_0x549389[_0x4f68('0x2d')][_0x4f68('0x36')]){_0x4a7dad[_0x4f68('0x37')]=_[_0x4f68('0x38')](_0x4a7dad[_0x4f68('0x37')],{'$or':_[_0x4f68('0x26')](_0x595f25,function(_0x2a4c53){if(_0x2a4c53[_0x4f68('0x29')]!==_0x4f68('0x39')){var _0x551124={};_0x551124[_0x2a4c53[_0x4f68('0x24')]]={'$like':'%'+_0x549389['query'][_0x4f68('0x36')]+'%'};return _0x551124;}})});}_0x4a7dad=_[_0x4f68('0x38')]({},_0x4a7dad,_0x549389[_0x4f68('0x3a')]);var _0x250832={'where':_0x4a7dad[_0x4f68('0x37')]};return db[_0x4f68('0x27')][_0x4f68('0x1b')](_0x250832)[_0x4f68('0x22')](function(_0x3716f6){_0x109dc3[_0x4f68('0x1b')]=_0x3716f6;if(_0x549389['query'][_0x4f68('0x3b')]){_0x4a7dad[_0x4f68('0x3c')]=[{'all':!![]}];}return db[_0x4f68('0x27')][_0x4f68('0x3d')](_0x4a7dad);})[_0x4f68('0x22')](function(_0x46ead5){_0x109dc3[_0x4f68('0x3e')]=_0x46ead5;return _0x109dc3;})[_0x4f68('0x22')](respondWithFilteredResult(_0x52ba6f,_0x4a7dad))[_0x4f68('0x3f')](handleError(_0x52ba6f,null));};exports[_0x4f68('0x40')]=function(_0x2a5d49,_0x478633){var _0x37a231={'raw':![],'where':{'id':_0x2a5d49['params']['id']}},_0x183e73={};_0x183e73[_0x4f68('0x2b')]=_[_0x4f68('0x2c')](db['UserProfileResource'][_0x4f68('0x28')]);_0x183e73[_0x4f68('0x2d')]=_[_0x4f68('0x2c')](_0x2a5d49['query']);_0x183e73[_0x4f68('0x34')]=_[_0x4f68('0x2e')](_0x183e73[_0x4f68('0x2b')],_0x183e73['query']);_0x37a231[_0x4f68('0x2f')]=_[_0x4f68('0x2e')](_0x183e73['model'],qs[_0x4f68('0x30')](_0x2a5d49[_0x4f68('0x2d')]['fields']));_0x37a231['attributes']=_0x37a231[_0x4f68('0x2f')][_0x4f68('0x31')]?_0x37a231[_0x4f68('0x2f')]:_0x183e73['model'];if(_0x2a5d49[_0x4f68('0x2d')]['includeAll']){_0x37a231[_0x4f68('0x3c')]=[{'all':!![]}];}_0x37a231=_[_0x4f68('0x38')]({},_0x37a231,_0x2a5d49['options']);return db[_0x4f68('0x27')]['find'](_0x37a231)[_0x4f68('0x22')](handleEntityNotFound(_0x478633,null))[_0x4f68('0x22')](respondWithResult(_0x478633,null))['catch'](handleError(_0x478633,null));};exports[_0x4f68('0x41')]=function(_0x4ded3b,_0x3302ba){return db['UserProfileResource'][_0x4f68('0x41')](_0x4ded3b[_0x4f68('0x42')],{})[_0x4f68('0x22')](respondWithResult(_0x3302ba,0xc9))['catch'](handleError(_0x3302ba,null));};exports[_0x4f68('0x43')]=function(_0x4ae9f0,_0x2bf19e){if(_0x4ae9f0[_0x4f68('0x42')]['id']){delete _0x4ae9f0[_0x4f68('0x42')]['id'];}return db['UserProfileResource'][_0x4f68('0x44')]({'where':{'id':_0x4ae9f0[_0x4f68('0x45')]['id']}})[_0x4f68('0x22')](handleEntityNotFound(_0x2bf19e,null))['then'](saveUpdates(_0x4ae9f0[_0x4f68('0x42')],null))[_0x4f68('0x22')](respondWithResult(_0x2bf19e,null))[_0x4f68('0x3f')](handleError(_0x2bf19e,null));};exports[_0x4f68('0x46')]=function(_0x4aa874,_0x1e8d50){return db[_0x4f68('0x27')][_0x4f68('0x44')]({'where':{'id':_0x4aa874['params']['id']}})['then'](handleEntityNotFound(_0x1e8d50,null))[_0x4f68('0x22')](removeEntity(_0x1e8d50,null))[_0x4f68('0x3f')](handleError(_0x1e8d50,null));};exports[_0x4f68('0x47')]=function(_0x4df342,_0x12e45e){return db[_0x4f68('0x27')][_0x4f68('0x47')]()[_0x4f68('0x22')](respondWithResult(_0x12e45e,null))[_0x4f68('0x3f')](handleError(_0x12e45e,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index c9b34a7..47323d1 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 _0xf863=['resourceId','sectionId','lodash','util','../../config/logger','api','request-promise','path','rimraf','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex'];(function(_0x2184da,_0x52d519){var _0x969754=function(_0x2779e6){while(--_0x2779e6){_0x2184da['push'](_0x2184da['shift']());}};_0x969754(++_0x52d519);}(_0xf863,0xc5));var _0x3f86=function(_0xb66f45,_0x37325e){_0xb66f45=_0xb66f45-0x0;var _0x2d7bb=_0xf863[_0xb66f45];return _0x2d7bb;};'use strict';var _=require(_0x3f86('0x0'));var util=require(_0x3f86('0x1'));var logger=require(_0x3f86('0x2'))(_0x3f86('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3f86('0x4'));var fs=require('fs');var path=require(_0x3f86('0x5'));var rimraf=require(_0x3f86('0x6'));var config=require('../../config/environment');var attributes=require(_0x3f86('0x7'));module[_0x3f86('0x8')]=function(_0x4db83f,_0x28ab1e){return _0x4db83f[_0x3f86('0x9')](_0x3f86('0xa'),attributes,{'tableName':_0x3f86('0xb'),'paranoid':![],'indexes':[{'name':_0x3f86('0xc'),'fields':[_0x3f86('0xd'),_0x3f86('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9bfb=['user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./userProfileResource.attributes','define'];(function(_0x29789f,_0xe2138a){var _0x40cf4b=function(_0x1d635b){while(--_0x1d635b){_0x29789f['push'](_0x29789f['shift']());}};_0x40cf4b(++_0xe2138a);}(_0x9bfb,0x163));var _0xb9bf=function(_0x50c154,_0x4e08a2){_0x50c154=_0x50c154-0x0;var _0x23aad4=_0x9bfb[_0x50c154];return _0x23aad4;};'use strict';var _=require(_0xb9bf('0x0'));var util=require('util');var logger=require(_0xb9bf('0x1'))('api');var moment=require(_0xb9bf('0x2'));var BPromise=require(_0xb9bf('0x3'));var rp=require(_0xb9bf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb9bf('0x5'));var config=require(_0xb9bf('0x6'));var attributes=require(_0xb9bf('0x7'));module['exports']=function(_0x5c8914,_0x486099){return _0x5c8914[_0xb9bf('0x8')]('UserProfileResource',attributes,{'tableName':_0xb9bf('0x9'),'paranoid':![],'indexes':[{'name':_0xb9bf('0xa'),'fields':[_0xb9bf('0xb'),_0xb9bf('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 8a15e22..eb167cc 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 _0x4732=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','request','then','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','moment','bluebird'];(function(_0x1ed77a,_0x92675b){var _0x537a70=function(_0x27b944){while(--_0x27b944){_0x1ed77a['push'](_0x1ed77a['shift']());}};_0x537a70(++_0x92675b);}(_0x4732,0x167));var _0x2473=function(_0x3b594b,_0x5835c3){_0x3b594b=_0x3b594b-0x0;var _0x1ea5f8=_0x4732[_0x3b594b];return _0x1ea5f8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2473('0x0'));var BPromise=require(_0x2473('0x1'));var rs=require(_0x2473('0x2'));var fs=require('fs');var Redis=require(_0x2473('0x3'));var db=require(_0x2473('0x4'))['db'];var utils=require(_0x2473('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x2473('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5416c7,_0x19527b,_0x46ead5){return new BPromise(function(_0x137491,_0x4b6105){return client[_0x2473('0x7')](_0x5416c7,_0x46ead5)[_0x2473('0x8')](function(_0x33409e){logger['info'](_0x2473('0x9'),_0x19527b,_0x2473('0xa'));logger[_0x2473('0xb')](_0x2473('0xc'),_0x19527b,_0x2473('0xa'),JSON[_0x2473('0xd')](_0x33409e));if(_0x33409e[_0x2473('0xe')]){if(_0x33409e[_0x2473('0xe')][_0x2473('0xf')]===0x1f4){logger['error'](_0x2473('0x9'),_0x19527b,_0x33409e[_0x2473('0xe')]['message']);return _0x4b6105(_0x33409e['error'][_0x2473('0x10')]);}logger[_0x2473('0xe')](_0x2473('0x9'),_0x19527b,_0x33409e[_0x2473('0xe')][_0x2473('0x10')]);return _0x137491(_0x33409e[_0x2473('0xe')][_0x2473('0x10')]);}else{logger[_0x2473('0x11')](_0x2473('0x9'),_0x19527b,'request\x20sent');_0x137491(_0x33409e[_0x2473('0x12')][_0x2473('0x10')]);}})['catch'](function(_0x2e9c79){logger[_0x2473('0xe')](_0x2473('0x9'),_0x19527b,_0x2e9c79);_0x4b6105(_0x2e9c79);});});} \ No newline at end of file +var _0x22ee=['../../config/environment','jayson/promise','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','UserProfileResource,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3db8f2,_0x3dd89b){var _0x19526b=function(_0xf302da){while(--_0xf302da){_0x3db8f2['push'](_0x3db8f2['shift']());}};_0x19526b(++_0x3dd89b);}(_0x22ee,0x98));var _0xe22e=function(_0x2507ed,_0x16a100){_0x2507ed=_0x2507ed-0x0;var _0xe40a94=_0x22ee[_0x2507ed];return _0xe40a94;};'use strict';var _=require(_0xe22e('0x0'));var util=require(_0xe22e('0x1'));var moment=require(_0xe22e('0x2'));var BPromise=require(_0xe22e('0x3'));var rs=require(_0xe22e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe22e('0x5'))['db'];var utils=require(_0xe22e('0x6'));var logger=require(_0xe22e('0x7'))(_0xe22e('0x8'));var config=require(_0xe22e('0x9'));var jayson=require(_0xe22e('0xa'));var client=jayson[_0xe22e('0xb')][_0xe22e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2744d9,_0x32f05a,_0x4abc5b){return new BPromise(function(_0x46496d,_0x1d65e5){return client[_0xe22e('0xd')](_0x2744d9,_0x4abc5b)[_0xe22e('0xe')](function(_0x1e46ec){logger[_0xe22e('0xf')](_0xe22e('0x10'),_0x32f05a,_0xe22e('0x11'));logger['debug'](_0xe22e('0x12'),_0x32f05a,_0xe22e('0x11'),JSON['stringify'](_0x1e46ec));if(_0x1e46ec[_0xe22e('0x13')]){if(_0x1e46ec[_0xe22e('0x13')][_0xe22e('0x14')]===0x1f4){logger[_0xe22e('0x13')](_0xe22e('0x10'),_0x32f05a,_0x1e46ec[_0xe22e('0x13')][_0xe22e('0x15')]);return _0x1d65e5(_0x1e46ec[_0xe22e('0x13')][_0xe22e('0x15')]);}logger[_0xe22e('0x13')](_0xe22e('0x10'),_0x32f05a,_0x1e46ec[_0xe22e('0x13')][_0xe22e('0x15')]);return _0x46496d(_0x1e46ec[_0xe22e('0x13')][_0xe22e('0x15')]);}else{logger['info'](_0xe22e('0x10'),_0x32f05a,'request\x20sent');_0x46496d(_0x1e46ec[_0xe22e('0x16')][_0xe22e('0x15')]);}})['catch'](function(_0xf2e3c7){logger['error'](_0xe22e('0x10'),_0x32f05a,_0xf2e3c7);_0x1d65e5(_0xf2e3c7);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 80093b6..ec59569 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 _0x1376=['index','/describe','describe','/:id','show','create','put','update','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1376,0xd2));var _0x6137=function(_0x543cf4,_0x55d686){_0x543cf4=_0x543cf4-0x0;var _0x108aa4=_0x1376[_0x543cf4];return _0x108aa4;};'use strict';var multer=require('multer');var util=require(_0x6137('0x0'));var path=require('path');var timeout=require(_0x6137('0x1'));var express=require(_0x6137('0x2'));var router=express[_0x6137('0x3')]();var auth=require(_0x6137('0x4'));var interaction=require(_0x6137('0x5'));var config=require(_0x6137('0x6'));var controller=require(_0x6137('0x7'));router[_0x6137('0x8')]('/',auth[_0x6137('0x9')](),controller[_0x6137('0xa')]);router[_0x6137('0x8')](_0x6137('0xb'),auth[_0x6137('0x9')](),controller[_0x6137('0xc')]);router[_0x6137('0x8')](_0x6137('0xd'),auth[_0x6137('0x9')](),controller[_0x6137('0xe')]);router['post']('/',auth[_0x6137('0x9')](),controller[_0x6137('0xf')]);router[_0x6137('0x10')](_0x6137('0xd'),auth['isAuthenticated'](),controller[_0x6137('0x11')]);router['delete'](_0x6137('0xd'),auth[_0x6137('0x9')](),controller[_0x6137('0x12')]);module[_0x6137('0x13')]=router; \ No newline at end of file +var _0xf13e=['put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./userProfileSection.controller','get','isAuthenticated','/describe','show','post','create'];(function(_0x155f58,_0x4d0489){var _0x51fb9d=function(_0x5d93ae){while(--_0x5d93ae){_0x155f58['push'](_0x155f58['shift']());}};_0x51fb9d(++_0x4d0489);}(_0xf13e,0x6a));var _0xef13=function(_0x4298af,_0x4bdefd){_0x4298af=_0x4298af-0x0;var _0x54589e=_0xf13e[_0x4298af];return _0x54589e;};'use strict';var multer=require(_0xef13('0x0'));var util=require(_0xef13('0x1'));var path=require(_0xef13('0x2'));var timeout=require(_0xef13('0x3'));var express=require(_0xef13('0x4'));var router=express[_0xef13('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xef13('0x6'));var controller=require(_0xef13('0x7'));router[_0xef13('0x8')]('/',auth[_0xef13('0x9')](),controller['index']);router[_0xef13('0x8')](_0xef13('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xef13('0x8')]('/:id',auth[_0xef13('0x9')](),controller[_0xef13('0xb')]);router[_0xef13('0xc')]('/',auth[_0xef13('0x9')](),controller[_0xef13('0xd')]);router[_0xef13('0xe')]('/:id',auth[_0xef13('0x9')](),controller[_0xef13('0xf')]);router[_0xef13('0x10')](_0xef13('0x11'),auth[_0xef13('0x9')](),controller[_0xef13('0x12')]);module[_0xef13('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 5451e45..23ee70d 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 _0x6f49=['join','getDataValue','crudPermissions','split','exports','STRING','INTEGER','BOOLEAN','setDataValue'];(function(_0x49ed71,_0x51cad5){var _0x355863=function(_0x22ab09){while(--_0x22ab09){_0x49ed71['push'](_0x49ed71['shift']());}};_0x355863(++_0x51cad5);}(_0x6f49,0xa6));var _0x96f4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6f49[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module[_0x96f4('0x0')]={'name':{'type':Sequelize[_0x96f4('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x96f4('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x96f4('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x96f4('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x589e2b){this[_0x96f4('0x4')]('crudPermissions',_0x589e2b?_0x589e2b[_0x96f4('0x5')](''):[]);},'get':function(){return this[_0x96f4('0x6')](_0x96f4('0x7'))?this['getDataValue'](_0x96f4('0x7'))[_0x96f4('0x8')](''):[];}}}; \ No newline at end of file +var _0x95d9=['STRING','BOOLEAN','setDataValue','crudPermissions','join','getDataValue','split','sequelize','exports'];(function(_0x25c108,_0x3621cc){var _0x4a9d93=function(_0x5f3946){while(--_0x5f3946){_0x25c108['push'](_0x25c108['shift']());}};_0x4a9d93(++_0x3621cc);}(_0x95d9,0x97));var _0x995d=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0x95d9[_0x243b2f];return _0xcb3c2d;};'use strict';var Sequelize=require(_0x995d('0x0'));module[_0x995d('0x1')]={'name':{'type':Sequelize[_0x995d('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x995d('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x995d('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x995d('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x995d('0x2')],'set':function(_0x5b44d3){this[_0x995d('0x4')](_0x995d('0x5'),_0x5b44d3?_0x5b44d3[_0x995d('0x6')](''):[]);},'get':function(){return this[_0x995d('0x7')](_0x995d('0x5'))?this['getDataValue'](_0x995d('0x5'))[_0x995d('0x8')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 73e87e2..8ca4d6c 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 _0xfad9=['to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','UserProfileSection','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','options','find','create','body','describe','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox'];(function(_0x36e557,_0x582535){var _0x4072f7=function(_0x552ed5){while(--_0x552ed5){_0x36e557['push'](_0x36e557['shift']());}};_0x4072f7(++_0x582535);}(_0xfad9,0x17e));var _0x9fad=function(_0x1a4748,_0x40c46e){_0x1a4748=_0x1a4748-0x0;var _0x28ca99=_0xfad9[_0x1a4748];return _0x28ca99;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9fad('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9fad('0x1'));var jsonpatch=require(_0x9fad('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9fad('0x3'));var Mustache=require(_0x9fad('0x4'));var util=require(_0x9fad('0x5'));var path=require(_0x9fad('0x6'));var sox=require(_0x9fad('0x7'));var csv=require(_0x9fad('0x8'));var ejs=require(_0x9fad('0x9'));var fs=require('fs');var _=require(_0x9fad('0xa'));var squel=require(_0x9fad('0xb'));var crypto=require(_0x9fad('0xc'));var jsforce=require(_0x9fad('0xd'));var deskjs=require(_0x9fad('0xe'));var toCsv=require(_0x9fad('0x8'));var querystring=require(_0x9fad('0xf'));var Papa=require(_0x9fad('0x10'));var Redis=require(_0x9fad('0x11'));var authService=require(_0x9fad('0x12'));var qs=require(_0x9fad('0x13'));var as=require(_0x9fad('0x14'));var hardwareService=require(_0x9fad('0x15'));var logger=require(_0x9fad('0x16'))(_0x9fad('0x17'));var utils=require(_0x9fad('0x18'));var config=require(_0x9fad('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x6dbcf7,_0x5c158f){_0x5c158f=_0x5c158f||0xcc;return function(_0x2f5f06){if(_0x2f5f06){return _0x6dbcf7[_0x9fad('0x1a')](_0x5c158f);}return _0x6dbcf7['status'](_0x5c158f)[_0x9fad('0x1b')]();};}function respondWithResult(_0xacafba,_0x1457a1){_0x1457a1=_0x1457a1||0xc8;return function(_0x2037e9){if(_0x2037e9){return _0xacafba[_0x9fad('0x1c')](_0x1457a1)[_0x9fad('0x1d')](_0x2037e9);}};}function respondWithFilteredResult(_0x5dd2c6,_0x56a911){return function(_0x1e34a9){if(_0x1e34a9){var _0x2d006b=_0x1e34a9[_0x9fad('0x1e')],_0x9ad482=_0x56a911[_0x9fad('0x1f')],_0x20ec6=_0x56a911[_0x9fad('0x1f')]+_0x56a911[_0x9fad('0x20')],_0xaf6bdc;if(_0x20ec6>=_0x2d006b){_0x20ec6=_0x2d006b;_0xaf6bdc=0xc8;}else{_0xaf6bdc=0xce;}_0x5dd2c6[_0x9fad('0x1c')](_0xaf6bdc);return _0x5dd2c6[_0x9fad('0x21')](_0x9fad('0x22'),_0x9ad482+'-'+_0x20ec6+'/'+_0x2d006b)[_0x9fad('0x1d')](_0x1e34a9);}return null;};}function patchUpdates(_0x20081a){return function(_0x57d09e){try{jsonpatch['apply'](_0x57d09e,_0x20081a,!![]);}catch(_0x3af61e){return BPromise[_0x9fad('0x23')](_0x3af61e);}return _0x57d09e[_0x9fad('0x24')]();};}function saveUpdates(_0x5aab51,_0x29cde2){return function(_0x250bce){if(_0x250bce){return _0x250bce[_0x9fad('0x25')](_0x5aab51)[_0x9fad('0x26')](function(_0x1565fe){return _0x1565fe;});}return null;};}function removeEntity(_0x399384,_0x4b5b05){return function(_0x1e9d2a){if(_0x1e9d2a){return _0x1e9d2a[_0x9fad('0x27')]()[_0x9fad('0x26')](function(){_0x399384[_0x9fad('0x1c')](0xcc)[_0x9fad('0x1b')]();});}};}function handleEntityNotFound(_0x3ea365,_0x507590){return function(_0x5aac43){if(!_0x5aac43){_0x3ea365[_0x9fad('0x1a')](0x194);}return _0x5aac43;};}function handleError(_0x3b7bc4,_0x1ca69e){_0x1ca69e=_0x1ca69e||0x1f4;return function(_0x3c66f7){logger[_0x9fad('0x28')](_0x3c66f7[_0x9fad('0x29')]);if(_0x3c66f7[_0x9fad('0x2a')]){delete _0x3c66f7[_0x9fad('0x2a')];}_0x3b7bc4['status'](_0x1ca69e)[_0x9fad('0x2b')](_0x3c66f7);};}exports[_0x9fad('0x2c')]=function(_0x1f2f4d,_0xed3ee9){var _0xa3300={},_0x5b1d56={},_0x37d1cb={'count':0x0,'rows':[]};var _0x16fe67=_[_0x9fad('0x2d')](db[_0x9fad('0x2e')][_0x9fad('0x2f')],function(_0x27cc80){return{'name':_0x27cc80[_0x9fad('0x30')],'type':_0x27cc80[_0x9fad('0x31')][_0x9fad('0x32')]};});_0x5b1d56[_0x9fad('0x33')]=_[_0x9fad('0x2d')](_0x16fe67,_0x9fad('0x2a'));_0x5b1d56[_0x9fad('0x34')]=_[_0x9fad('0x35')](_0x1f2f4d[_0x9fad('0x34')]);_0x5b1d56['filters']=_[_0x9fad('0x36')](_0x5b1d56['model'],_0x5b1d56[_0x9fad('0x34')]);_0xa3300['attributes']=_[_0x9fad('0x36')](_0x5b1d56[_0x9fad('0x33')],qs[_0x9fad('0x37')](_0x1f2f4d[_0x9fad('0x34')][_0x9fad('0x37')]));_0xa3300[_0x9fad('0x38')]=_0xa3300[_0x9fad('0x38')][_0x9fad('0x39')]?_0xa3300['attributes']:_0x5b1d56['model'];if(!_0x1f2f4d['query'][_0x9fad('0x3a')](_0x9fad('0x3b'))){_0xa3300[_0x9fad('0x20')]=qs[_0x9fad('0x20')](_0x1f2f4d[_0x9fad('0x34')][_0x9fad('0x20')]);_0xa3300['offset']=qs[_0x9fad('0x1f')](_0x1f2f4d['query'][_0x9fad('0x1f')]);}_0xa3300[_0x9fad('0x3c')]=qs[_0x9fad('0x3d')](_0x1f2f4d[_0x9fad('0x34')][_0x9fad('0x3d')]);_0xa3300[_0x9fad('0x3e')]=qs[_0x9fad('0x3f')](_['pick'](_0x1f2f4d['query'],_0x5b1d56[_0x9fad('0x3f')]));if(_0x1f2f4d[_0x9fad('0x34')][_0x9fad('0x40')]){_0xa3300[_0x9fad('0x3e')]=_[_0x9fad('0x41')](_0xa3300['where'],{'$or':_[_0x9fad('0x2d')](_0x16fe67,function(_0x5b2ac9){if(_0x5b2ac9['type']!==_0x9fad('0x42')){var _0x35f9e1={};_0x35f9e1[_0x5b2ac9[_0x9fad('0x2a')]]={'$like':'%'+_0x1f2f4d['query'][_0x9fad('0x40')]+'%'};return _0x35f9e1;}})});}_0xa3300=_[_0x9fad('0x41')]({},_0xa3300,_0x1f2f4d['options']);var _0x20116f={'where':_0xa3300['where']};return db[_0x9fad('0x2e')]['count'](_0x20116f)[_0x9fad('0x26')](function(_0x5c7dee){_0x37d1cb[_0x9fad('0x1e')]=_0x5c7dee;if(_0x1f2f4d[_0x9fad('0x34')][_0x9fad('0x43')]){_0xa3300[_0x9fad('0x44')]=[{'all':!![]}];}return db['UserProfileSection']['findAll'](_0xa3300);})[_0x9fad('0x26')](function(_0x44da35){_0x37d1cb[_0x9fad('0x45')]=_0x44da35;return _0x37d1cb;})['then'](respondWithFilteredResult(_0xed3ee9,_0xa3300))[_0x9fad('0x46')](handleError(_0xed3ee9,null));};exports[_0x9fad('0x47')]=function(_0x3cd372,_0xe13c3b){var _0x47a08f={'raw':![],'where':{'id':_0x3cd372[_0x9fad('0x48')]['id']}},_0x1834c7={};_0x1834c7[_0x9fad('0x33')]=_[_0x9fad('0x35')](db[_0x9fad('0x2e')][_0x9fad('0x2f')]);_0x1834c7[_0x9fad('0x34')]=_[_0x9fad('0x35')](_0x3cd372['query']);_0x1834c7[_0x9fad('0x3f')]=_[_0x9fad('0x36')](_0x1834c7[_0x9fad('0x33')],_0x1834c7['query']);_0x47a08f['attributes']=_[_0x9fad('0x36')](_0x1834c7[_0x9fad('0x33')],qs['fields'](_0x3cd372[_0x9fad('0x34')]['fields']));_0x47a08f['attributes']=_0x47a08f[_0x9fad('0x38')][_0x9fad('0x39')]?_0x47a08f[_0x9fad('0x38')]:_0x1834c7[_0x9fad('0x33')];if(_0x3cd372[_0x9fad('0x34')][_0x9fad('0x43')]){_0x47a08f[_0x9fad('0x44')]=[{'all':!![]}];}_0x47a08f=_['merge']({},_0x47a08f,_0x3cd372[_0x9fad('0x49')]);return db[_0x9fad('0x2e')][_0x9fad('0x4a')](_0x47a08f)['then'](handleEntityNotFound(_0xe13c3b,null))[_0x9fad('0x26')](respondWithResult(_0xe13c3b,null))[_0x9fad('0x46')](handleError(_0xe13c3b,null));};exports['create']=function(_0x466ee0,_0x25b8fc){return db[_0x9fad('0x2e')][_0x9fad('0x4b')](_0x466ee0[_0x9fad('0x4c')],{})[_0x9fad('0x26')](respondWithResult(_0x25b8fc,0xc9))[_0x9fad('0x46')](handleError(_0x25b8fc,null));};exports[_0x9fad('0x25')]=function(_0x38bbfa,_0x5b06dd){if(_0x38bbfa[_0x9fad('0x4c')]['id']){delete _0x38bbfa[_0x9fad('0x4c')]['id'];}return db[_0x9fad('0x2e')]['find']({'where':{'id':_0x38bbfa[_0x9fad('0x48')]['id']}})[_0x9fad('0x26')](handleEntityNotFound(_0x5b06dd,null))['then'](saveUpdates(_0x38bbfa[_0x9fad('0x4c')],null))['then'](respondWithResult(_0x5b06dd,null))[_0x9fad('0x46')](handleError(_0x5b06dd,null));};exports[_0x9fad('0x27')]=function(_0x2ba481,_0x3e7377){return db[_0x9fad('0x2e')][_0x9fad('0x4a')]({'where':{'id':_0x2ba481[_0x9fad('0x48')]['id']}})['then'](handleEntityNotFound(_0x3e7377,null))['then'](removeEntity(_0x3e7377,null))[_0x9fad('0x46')](handleError(_0x3e7377,null));};exports[_0x9fad('0x4d')]=function(_0x30d193,_0x39d72b){return db['UserProfileSection'][_0x9fad('0x4d')]()[_0x9fad('0x26')](respondWithResult(_0x39d72b,null))['catch'](handleError(_0x39d72b,null));}; \ No newline at end of file +var _0x975e=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','UserProfileSection','rawAttributes','type','key','model','map','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','includeAll','include','catch','show','keys','find','create','body','params','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x975e,0xcb));var _0xe975=function(_0x2a4bfb,_0x192fc2){_0x2a4bfb=_0x2a4bfb-0x0;var _0x3b1057=_0x975e[_0x2a4bfb];return _0x3b1057;};'use strict';var pdf=require(_0xe975('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe975('0x1'));var zipdir=require(_0xe975('0x2'));var jsonpatch=require(_0xe975('0x3'));var rp=require(_0xe975('0x4'));var moment=require(_0xe975('0x5'));var BPromise=require(_0xe975('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe975('0x7'));var sox=require(_0xe975('0x8'));var csv=require(_0xe975('0x9'));var ejs=require(_0xe975('0xa'));var fs=require('fs');var _=require(_0xe975('0xb'));var squel=require(_0xe975('0xc'));var crypto=require('crypto');var jsforce=require(_0xe975('0xd'));var deskjs=require(_0xe975('0xe'));var toCsv=require(_0xe975('0x9'));var querystring=require(_0xe975('0xf'));var Papa=require(_0xe975('0x10'));var Redis=require(_0xe975('0x11'));var authService=require(_0xe975('0x12'));var qs=require(_0xe975('0x13'));var as=require(_0xe975('0x14'));var hardwareService=require(_0xe975('0x15'));var logger=require('../../config/logger')(_0xe975('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x58b7b2,_0x2bab98){_0x2bab98=_0x2bab98||0xcc;return function(_0x19fc65){if(_0x19fc65){return _0x58b7b2[_0xe975('0x17')](_0x2bab98);}return _0x58b7b2[_0xe975('0x18')](_0x2bab98)[_0xe975('0x19')]();};}function respondWithResult(_0x2dadba,_0x2a3d70){_0x2a3d70=_0x2a3d70||0xc8;return function(_0x4b6144){if(_0x4b6144){return _0x2dadba[_0xe975('0x18')](_0x2a3d70)[_0xe975('0x1a')](_0x4b6144);}};}function respondWithFilteredResult(_0x9c53a6,_0x319d66){return function(_0x45c1c6){if(_0x45c1c6){var _0x19522e=_0x45c1c6['count'],_0x3e1036=_0x319d66[_0xe975('0x1b')],_0x59ab29=_0x319d66[_0xe975('0x1b')]+_0x319d66[_0xe975('0x1c')],_0x546081;if(_0x59ab29>=_0x19522e){_0x59ab29=_0x19522e;_0x546081=0xc8;}else{_0x546081=0xce;}_0x9c53a6[_0xe975('0x18')](_0x546081);return _0x9c53a6['set'](_0xe975('0x1d'),_0x3e1036+'-'+_0x59ab29+'/'+_0x19522e)[_0xe975('0x1a')](_0x45c1c6);}return null;};}function patchUpdates(_0x1e6829){return function(_0x2fd9cb){try{jsonpatch[_0xe975('0x1e')](_0x2fd9cb,_0x1e6829,!![]);}catch(_0x47a91f){return BPromise[_0xe975('0x1f')](_0x47a91f);}return _0x2fd9cb[_0xe975('0x20')]();};}function saveUpdates(_0xdf550,_0x2d648e){return function(_0xdc50ff){if(_0xdc50ff){return _0xdc50ff[_0xe975('0x21')](_0xdf550)['then'](function(_0x57c0ca){return _0x57c0ca;});}return null;};}function removeEntity(_0x16b87f,_0x4f71dc){return function(_0x92244e){if(_0x92244e){return _0x92244e[_0xe975('0x22')]()[_0xe975('0x23')](function(){_0x16b87f[_0xe975('0x18')](0xcc)[_0xe975('0x19')]();});}};}function handleEntityNotFound(_0x5dba4c,_0x5e4479){return function(_0x1534df){if(!_0x1534df){_0x5dba4c[_0xe975('0x17')](0x194);}return _0x1534df;};}function handleError(_0xe7802d,_0x21ed02){_0x21ed02=_0x21ed02||0x1f4;return function(_0x513bc3){logger['error'](_0x513bc3[_0xe975('0x24')]);if(_0x513bc3[_0xe975('0x25')]){delete _0x513bc3[_0xe975('0x25')];}_0xe7802d[_0xe975('0x18')](_0x21ed02)[_0xe975('0x26')](_0x513bc3);};}exports[_0xe975('0x27')]=function(_0x5e777a,_0x90e512){var _0xb77e36={},_0x54140e={},_0x519ded={'count':0x0,'rows':[]};var _0x5b3c17=_['map'](db[_0xe975('0x28')][_0xe975('0x29')],function(_0x2b84aa){return{'name':_0x2b84aa['fieldName'],'type':_0x2b84aa[_0xe975('0x2a')][_0xe975('0x2b')]};});_0x54140e[_0xe975('0x2c')]=_[_0xe975('0x2d')](_0x5b3c17,_0xe975('0x25'));_0x54140e['query']=_['keys'](_0x5e777a['query']);_0x54140e['filters']=_[_0xe975('0x2e')](_0x54140e['model'],_0x54140e[_0xe975('0x2f')]);_0xb77e36[_0xe975('0x30')]=_[_0xe975('0x2e')](_0x54140e[_0xe975('0x2c')],qs['fields'](_0x5e777a[_0xe975('0x2f')][_0xe975('0x31')]));_0xb77e36[_0xe975('0x30')]=_0xb77e36[_0xe975('0x30')][_0xe975('0x32')]?_0xb77e36[_0xe975('0x30')]:_0x54140e[_0xe975('0x2c')];if(!_0x5e777a[_0xe975('0x2f')][_0xe975('0x33')](_0xe975('0x34'))){_0xb77e36[_0xe975('0x1c')]=qs[_0xe975('0x1c')](_0x5e777a[_0xe975('0x2f')][_0xe975('0x1c')]);_0xb77e36[_0xe975('0x1b')]=qs[_0xe975('0x1b')](_0x5e777a['query'][_0xe975('0x1b')]);}_0xb77e36[_0xe975('0x35')]=qs[_0xe975('0x36')](_0x5e777a[_0xe975('0x2f')][_0xe975('0x36')]);_0xb77e36[_0xe975('0x37')]=qs['filters'](_[_0xe975('0x38')](_0x5e777a[_0xe975('0x2f')],_0x54140e[_0xe975('0x39')]));if(_0x5e777a[_0xe975('0x2f')]['filter']){_0xb77e36[_0xe975('0x37')]=_[_0xe975('0x3a')](_0xb77e36[_0xe975('0x37')],{'$or':_[_0xe975('0x2d')](_0x5b3c17,function(_0x38bc9d){if(_0x38bc9d[_0xe975('0x2a')]!==_0xe975('0x3b')){var _0xbb92={};_0xbb92[_0x38bc9d[_0xe975('0x25')]]={'$like':'%'+_0x5e777a['query'][_0xe975('0x3c')]+'%'};return _0xbb92;}})});}_0xb77e36=_['merge']({},_0xb77e36,_0x5e777a[_0xe975('0x3d')]);var _0x522df3={'where':_0xb77e36[_0xe975('0x37')]};return db[_0xe975('0x28')]['count'](_0x522df3)[_0xe975('0x23')](function(_0x17ac43){_0x519ded['count']=_0x17ac43;if(_0x5e777a[_0xe975('0x2f')][_0xe975('0x3e')]){_0xb77e36[_0xe975('0x3f')]=[{'all':!![]}];}return db['UserProfileSection']['findAll'](_0xb77e36);})[_0xe975('0x23')](function(_0x356ef8){_0x519ded['rows']=_0x356ef8;return _0x519ded;})[_0xe975('0x23')](respondWithFilteredResult(_0x90e512,_0xb77e36))[_0xe975('0x40')](handleError(_0x90e512,null));};exports[_0xe975('0x41')]=function(_0x38d879,_0x2f0b82){var _0x597a3c={'raw':![],'where':{'id':_0x38d879['params']['id']}},_0x164a72={};_0x164a72['model']=_[_0xe975('0x42')](db['UserProfileSection'][_0xe975('0x29')]);_0x164a72[_0xe975('0x2f')]=_[_0xe975('0x42')](_0x38d879['query']);_0x164a72[_0xe975('0x39')]=_[_0xe975('0x2e')](_0x164a72[_0xe975('0x2c')],_0x164a72[_0xe975('0x2f')]);_0x597a3c[_0xe975('0x30')]=_[_0xe975('0x2e')](_0x164a72[_0xe975('0x2c')],qs[_0xe975('0x31')](_0x38d879[_0xe975('0x2f')][_0xe975('0x31')]));_0x597a3c[_0xe975('0x30')]=_0x597a3c[_0xe975('0x30')][_0xe975('0x32')]?_0x597a3c[_0xe975('0x30')]:_0x164a72[_0xe975('0x2c')];if(_0x38d879[_0xe975('0x2f')][_0xe975('0x3e')]){_0x597a3c['include']=[{'all':!![]}];}_0x597a3c=_[_0xe975('0x3a')]({},_0x597a3c,_0x38d879[_0xe975('0x3d')]);return db['UserProfileSection'][_0xe975('0x43')](_0x597a3c)[_0xe975('0x23')](handleEntityNotFound(_0x2f0b82,null))[_0xe975('0x23')](respondWithResult(_0x2f0b82,null))[_0xe975('0x40')](handleError(_0x2f0b82,null));};exports[_0xe975('0x44')]=function(_0x21b082,_0xbcc283){return db[_0xe975('0x28')][_0xe975('0x44')](_0x21b082['body'],{})[_0xe975('0x23')](respondWithResult(_0xbcc283,0xc9))[_0xe975('0x40')](handleError(_0xbcc283,null));};exports[_0xe975('0x21')]=function(_0x2627d4,_0x2bccb1){if(_0x2627d4[_0xe975('0x45')]['id']){delete _0x2627d4['body']['id'];}return db['UserProfileSection'][_0xe975('0x43')]({'where':{'id':_0x2627d4['params']['id']}})[_0xe975('0x23')](handleEntityNotFound(_0x2bccb1,null))[_0xe975('0x23')](saveUpdates(_0x2627d4[_0xe975('0x45')],null))[_0xe975('0x23')](respondWithResult(_0x2bccb1,null))['catch'](handleError(_0x2bccb1,null));};exports[_0xe975('0x22')]=function(_0x241cb2,_0x979a79){return db[_0xe975('0x28')][_0xe975('0x43')]({'where':{'id':_0x241cb2[_0xe975('0x46')]['id']}})[_0xe975('0x23')](handleEntityNotFound(_0x979a79,null))[_0xe975('0x23')](removeEntity(_0x979a79,null))[_0xe975('0x40')](handleError(_0x979a79,null));};exports[_0xe975('0x47')]=function(_0x33f38b,_0x2ea281){return db[_0xe975('0x28')][_0xe975('0x47')]()['then'](respondWithResult(_0x2ea281,null))[_0xe975('0x40')](handleError(_0x2ea281,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 0829869..6a9fd1c 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 _0x7e36=['path','rimraf','exports','UserProfileSection','compositeIndex','sectionId','userProfileId','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0xc9e9bf,_0x108b89){var _0x360e6d=function(_0x1d8f81){while(--_0x1d8f81){_0xc9e9bf['push'](_0xc9e9bf['shift']());}};_0x360e6d(++_0x108b89);}(_0x7e36,0x166));var _0x67e3=function(_0x309251,_0x59a3d3){_0x309251=_0x309251-0x0;var _0x3c6e84=_0x7e36[_0x309251];return _0x3c6e84;};'use strict';var _=require(_0x67e3('0x0'));var util=require(_0x67e3('0x1'));var logger=require(_0x67e3('0x2'))(_0x67e3('0x3'));var moment=require(_0x67e3('0x4'));var BPromise=require('bluebird');var rp=require(_0x67e3('0x5'));var fs=require('fs');var path=require(_0x67e3('0x6'));var rimraf=require(_0x67e3('0x7'));var config=require('../../config/environment');var attributes=require('./userProfileSection.attributes');module[_0x67e3('0x8')]=function(_0x582a7d,_0x5c036a){return _0x582a7d['define'](_0x67e3('0x9'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0x67e3('0xa'),'fields':[_0x67e3('0xb'),_0x67e3('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6d94=['userProfileId','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./userProfileSection.attributes','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6d94,0x14b));var _0x46d9=function(_0x5ec699,_0x5e863d){_0x5ec699=_0x5ec699-0x0;var _0x1b367e=_0x6d94[_0x5ec699];return _0x1b367e;};'use strict';var _=require(_0x46d9('0x0'));var util=require(_0x46d9('0x1'));var logger=require(_0x46d9('0x2'))(_0x46d9('0x3'));var moment=require(_0x46d9('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x46d9('0x5'));var rimraf=require(_0x46d9('0x6'));var config=require(_0x46d9('0x7'));var attributes=require(_0x46d9('0x8'));module['exports']=function(_0x13e730,_0x574d34){return _0x13e730[_0x46d9('0x9')](_0x46d9('0xa'),attributes,{'tableName':_0x46d9('0xb'),'paranoid':![],'indexes':[{'name':_0x46d9('0xc'),'fields':[_0x46d9('0xd'),_0x46d9('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 1a9b236..e1cb699 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 _0x070f=['request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x3f4891,_0x4e6f62){var _0x54f2d8=function(_0x2b11ee){while(--_0x2b11ee){_0x3f4891['push'](_0x3f4891['shift']());}};_0x54f2d8(++_0x4e6f62);}(_0x070f,0xf3));var _0xf070=function(_0x5e83ba,_0x264dc6){_0x5e83ba=_0x5e83ba-0x0;var _0x4b0e35=_0x070f[_0x5e83ba];return _0x4b0e35;};'use strict';var _=require(_0xf070('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf070('0x1'));var rs=require(_0xf070('0x2'));var fs=require('fs');var Redis=require(_0xf070('0x3'));var db=require(_0xf070('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf070('0x5'))(_0xf070('0x6'));var config=require(_0xf070('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf070('0x8')][_0xf070('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x50e80b,_0x334b2b,_0x4a7516){return new BPromise(function(_0x43da4f,_0x4289ba){return client[_0xf070('0xa')](_0x50e80b,_0x4a7516)[_0xf070('0xb')](function(_0x2ea7f7){logger[_0xf070('0xc')](_0xf070('0xd'),_0x334b2b,_0xf070('0xe'));logger[_0xf070('0xf')](_0xf070('0x10'),_0x334b2b,_0xf070('0xe'),JSON[_0xf070('0x11')](_0x2ea7f7));if(_0x2ea7f7[_0xf070('0x12')]){if(_0x2ea7f7[_0xf070('0x12')][_0xf070('0x13')]===0x1f4){logger[_0xf070('0x12')](_0xf070('0xd'),_0x334b2b,_0x2ea7f7[_0xf070('0x12')][_0xf070('0x14')]);return _0x4289ba(_0x2ea7f7[_0xf070('0x12')][_0xf070('0x14')]);}logger[_0xf070('0x12')](_0xf070('0xd'),_0x334b2b,_0x2ea7f7[_0xf070('0x12')][_0xf070('0x14')]);return _0x43da4f(_0x2ea7f7[_0xf070('0x12')][_0xf070('0x14')]);}else{logger[_0xf070('0xc')](_0xf070('0xd'),_0x334b2b,_0xf070('0xe'));_0x43da4f(_0x2ea7f7[_0xf070('0x15')][_0xf070('0x14')]);}})[_0xf070('0x16')](function(_0x46a4c8){logger[_0xf070('0x12')](_0xf070('0xd'),_0x334b2b,_0x46a4c8);_0x4289ba(_0x46a4c8);});});} \ No newline at end of file +var _0xbbea=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileSection,\x20%s,\x20%s','message'];(function(_0x45ccde,_0x27ca45){var _0x3503c8=function(_0x4526b3){while(--_0x4526b3){_0x45ccde['push'](_0x45ccde['shift']());}};_0x3503c8(++_0x27ca45);}(_0xbbea,0xda));var _0xabbe=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xbbea[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xabbe('0x0'));var util=require(_0xabbe('0x1'));var moment=require(_0xabbe('0x2'));var BPromise=require(_0xabbe('0x3'));var rs=require(_0xabbe('0x4'));var fs=require('fs');var Redis=require(_0xabbe('0x5'));var db=require(_0xabbe('0x6'))['db'];var utils=require(_0xabbe('0x7'));var logger=require(_0xabbe('0x8'))(_0xabbe('0x9'));var config=require(_0xabbe('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0xabbe('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a3961,_0x319dc1,_0x46d85){return new BPromise(function(_0x426a20,_0x82050a){return client['request'](_0x1a3961,_0x46d85)[_0xabbe('0xc')](function(_0x41047c){logger[_0xabbe('0xd')]('UserProfileSection,\x20%s,\x20%s',_0x319dc1,_0xabbe('0xe'));logger[_0xabbe('0xf')](_0xabbe('0x10'),_0x319dc1,_0xabbe('0xe'),JSON[_0xabbe('0x11')](_0x41047c));if(_0x41047c[_0xabbe('0x12')]){if(_0x41047c[_0xabbe('0x12')][_0xabbe('0x13')]===0x1f4){logger[_0xabbe('0x12')](_0xabbe('0x14'),_0x319dc1,_0x41047c[_0xabbe('0x12')][_0xabbe('0x15')]);return _0x82050a(_0x41047c['error']['message']);}logger['error']('UserProfileSection,\x20%s,\x20%s',_0x319dc1,_0x41047c[_0xabbe('0x12')][_0xabbe('0x15')]);return _0x426a20(_0x41047c['error'][_0xabbe('0x15')]);}else{logger[_0xabbe('0xd')](_0xabbe('0x14'),_0x319dc1,_0xabbe('0xe'));_0x426a20(_0x41047c[_0xabbe('0x16')][_0xabbe('0x15')]);}})[_0xabbe('0x17')](function(_0x3886c2){logger[_0xabbe('0x12')](_0xabbe('0x14'),_0x319dc1,_0x3886c2);_0x82050a(_0x3886c2);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index a38ed45..0f58add 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 _0x8e24=['connect-timeout','express','../../components/interaction/service','exports','multer','util'];(function(_0x55869c,_0x1d5393){var _0x6aef06=function(_0x35923c){while(--_0x35923c){_0x55869c['push'](_0x55869c['shift']());}};_0x6aef06(++_0x1d5393);}(_0x8e24,0xf4));var _0x48e2=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0x8e24[_0x39096d];return _0x13da4f;};'use strict';var multer=require(_0x48e2('0x0'));var util=require(_0x48e2('0x1'));var path=require('path');var timeout=require(_0x48e2('0x2'));var express=require(_0x48e2('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x48e2('0x4'));var config=require('../../config/environment');module[_0x48e2('0x5')]=router; \ No newline at end of file +var _0x58ee=['multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x58ee,0x1dd));var _0xe58e=function(_0x3b2cbc,_0x421cb6){_0x3b2cbc=_0x3b2cbc-0x0;var _0x4bbccc=_0x58ee[_0x3b2cbc];return _0x4bbccc;};'use strict';var multer=require(_0xe58e('0x0'));var util=require(_0xe58e('0x1'));var path=require(_0xe58e('0x2'));var timeout=require('connect-timeout');var express=require(_0xe58e('0x3'));var router=express[_0xe58e('0x4')]();var auth=require(_0xe58e('0x5'));var interaction=require(_0xe58e('0x6'));var config=require(_0xe58e('0x7'));module[_0xe58e('0x8')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index d0f8e49..966bbf6 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 _0xbaf0=['exports','INTEGER'];(function(_0x4f2801,_0x366dd1){var _0x3ac22a=function(_0x39862a){while(--_0x39862a){_0x4f2801['push'](_0x4f2801['shift']());}};_0x3ac22a(++_0x366dd1);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'penalty':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xbaf0=['exports','INTEGER'];(function(_0x26393b,_0x449a84){var _0x57230a=function(_0x583888){while(--_0x583888){_0x26393b['push'](_0x26393b['shift']());}};_0x57230a(++_0x449a84);}(_0xbaf0,0x12a));var _0x0baf=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbaf0[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'penalty':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 72cd9d2..2a03719 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 _0x9793=['request-promise','path','rimraf','../../config/environment','exports','define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api','bluebird'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x9793,0x18e));var _0x3979=function(_0x221f36,_0x55f016){_0x221f36=_0x221f36-0x0;var _0x1a1b14=_0x9793[_0x221f36];return _0x1a1b14;};'use strict';var _=require(_0x3979('0x0'));var util=require(_0x3979('0x1'));var logger=require(_0x3979('0x2'))(_0x3979('0x3'));var moment=require('moment');var BPromise=require(_0x3979('0x4'));var rp=require(_0x3979('0x5'));var fs=require('fs');var path=require(_0x3979('0x6'));var rimraf=require(_0x3979('0x7'));var config=require(_0x3979('0x8'));var attributes=require('./userSmsQueue.attributes');module[_0x3979('0x9')]=function(_0x5bcffd,_0x20a668){return _0x5bcffd[_0x3979('0xa')](_0x3979('0xb'),attributes,{'tableName':_0x3979('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf29c=['../../config/environment','define','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x272bd4,_0x55b2d7){var _0x314e0b=function(_0x3b0f78){while(--_0x3b0f78){_0x272bd4['push'](_0x272bd4['shift']());}};_0x314e0b(++_0x55b2d7);}(_0xf29c,0x7a));var _0xcf29=function(_0x200018,_0x47b0e4){_0x200018=_0x200018-0x0;var _0x5172ca=_0xf29c[_0x200018];return _0x5172ca;};'use strict';var _=require('lodash');var util=require(_0xcf29('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xcf29('0x1'));var BPromise=require(_0xcf29('0x2'));var rp=require(_0xcf29('0x3'));var fs=require('fs');var path=require(_0xcf29('0x4'));var rimraf=require(_0xcf29('0x5'));var config=require(_0xcf29('0x6'));var attributes=require('./userSmsQueue.attributes');module['exports']=function(_0x20fd5c,_0x29353d){return _0x20fd5c[_0xcf29('0x7')]('UserSmsQueue',attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index 6f1e225..0e84df8 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 _0x2f79=['then','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http'];(function(_0x590966,_0x218632){var _0x2b304e=function(_0x32049d){while(--_0x32049d){_0x590966['push'](_0x590966['shift']());}};_0x2b304e(++_0x218632);}(_0x2f79,0xf2));var _0x92f7=function(_0x37656c,_0x50bded){_0x37656c=_0x37656c-0x0;var _0x5d2447=_0x2f79[_0x37656c];return _0x5d2447;};'use strict';var _=require(_0x92f7('0x0'));var util=require(_0x92f7('0x1'));var moment=require('moment');var BPromise=require(_0x92f7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x92f7('0x3'));var db=require(_0x92f7('0x4'))['db'];var utils=require(_0x92f7('0x5'));var logger=require(_0x92f7('0x6'))(_0x92f7('0x7'));var config=require(_0x92f7('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x92f7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x48c98c,_0x483ab8,_0x484f61){return new BPromise(function(_0x4e2f3d,_0x42744e){return client['request'](_0x48c98c,_0x484f61)[_0x92f7('0xa')](function(_0xa068c7){logger['info'](_0x92f7('0xb'),_0x483ab8,_0x92f7('0xc'));logger[_0x92f7('0xd')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x483ab8,_0x92f7('0xc'),JSON[_0x92f7('0xe')](_0xa068c7));if(_0xa068c7[_0x92f7('0xf')]){if(_0xa068c7[_0x92f7('0xf')][_0x92f7('0x10')]===0x1f4){logger[_0x92f7('0xf')](_0x92f7('0xb'),_0x483ab8,_0xa068c7[_0x92f7('0xf')][_0x92f7('0x11')]);return _0x42744e(_0xa068c7[_0x92f7('0xf')][_0x92f7('0x11')]);}logger['error'](_0x92f7('0xb'),_0x483ab8,_0xa068c7[_0x92f7('0xf')][_0x92f7('0x11')]);return _0x4e2f3d(_0xa068c7[_0x92f7('0xf')][_0x92f7('0x11')]);}else{logger[_0x92f7('0x12')]('UserSmsQueue,\x20%s,\x20%s',_0x483ab8,_0x92f7('0xc'));_0x4e2f3d(_0xa068c7[_0x92f7('0x13')][_0x92f7('0x11')]);}})[_0x92f7('0x14')](function(_0x1db15b){logger[_0x92f7('0xf')]('UserSmsQueue,\x20%s,\x20%s',_0x483ab8,_0x1db15b);_0x42744e(_0x1db15b);});});} \ No newline at end of file +var _0x074b=['bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x074b,0x148));var _0xb074=function(_0x1f3124,_0x135b7b){_0x1f3124=_0x1f3124-0x0;var _0xa6a88d=_0x074b[_0x1f3124];return _0xa6a88d;};'use strict';var _=require('lodash');var util=require(_0xb074('0x0'));var moment=require(_0xb074('0x1'));var BPromise=require(_0xb074('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb074('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb074('0x4'));var logger=require(_0xb074('0x5'))(_0xb074('0x6'));var config=require(_0xb074('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb074('0x8')][_0xb074('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x12c3d2,_0x5d876b,_0x58cced){return new BPromise(function(_0xe94b7,_0x142a0e){return client['request'](_0x12c3d2,_0x58cced)[_0xb074('0xa')](function(_0x45acc7){logger[_0xb074('0xb')](_0xb074('0xc'),_0x5d876b,_0xb074('0xd'));logger[_0xb074('0xe')](_0xb074('0xf'),_0x5d876b,_0xb074('0xd'),JSON[_0xb074('0x10')](_0x45acc7));if(_0x45acc7[_0xb074('0x11')]){if(_0x45acc7[_0xb074('0x11')][_0xb074('0x12')]===0x1f4){logger[_0xb074('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x5d876b,_0x45acc7[_0xb074('0x11')][_0xb074('0x13')]);return _0x142a0e(_0x45acc7[_0xb074('0x11')][_0xb074('0x13')]);}logger[_0xb074('0x11')](_0xb074('0xc'),_0x5d876b,_0x45acc7[_0xb074('0x11')][_0xb074('0x13')]);return _0xe94b7(_0x45acc7[_0xb074('0x11')][_0xb074('0x13')]);}else{logger[_0xb074('0xb')](_0xb074('0xc'),_0x5d876b,_0xb074('0xd'));_0xe94b7(_0x45acc7[_0xb074('0x14')][_0xb074('0x13')]);}})[_0xb074('0x15')](function(_0x38731b){logger[_0xb074('0x11')](_0xb074('0xc'),_0x5d876b,_0x38731b);_0x142a0e(_0x38731b);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index 3f33ea7..aea0008 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 _0x600a=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer'];(function(_0x3c4062,_0x3767fc){var _0x3f5bf3=function(_0x105e55){while(--_0x105e55){_0x3c4062['push'](_0x3c4062['shift']());}};_0x3f5bf3(++_0x3767fc);}(_0x600a,0x104));var _0xa600=function(_0xa9eaa0,_0x4ba2b4){_0xa9eaa0=_0xa9eaa0-0x0;var _0x30897a=_0x600a[_0xa9eaa0];return _0x30897a;};'use strict';var multer=require(_0xa600('0x0'));var util=require(_0xa600('0x1'));var path=require(_0xa600('0x2'));var timeout=require(_0xa600('0x3'));var express=require(_0xa600('0x4'));var router=express['Router']();var auth=require(_0xa600('0x5'));var interaction=require(_0xa600('0x6'));var config=require(_0xa600('0x7'));module[_0xa600('0x8')]=router; \ No newline at end of file +var _0x560b=['path','connect-timeout','Router','../../components/auth/service','../../config/environment','exports','multer'];(function(_0x45754d,_0xa2d6e4){var _0x42bff4=function(_0x919ecf){while(--_0x919ecf){_0x45754d['push'](_0x45754d['shift']());}};_0x42bff4(++_0xa2d6e4);}(_0x560b,0x172));var _0xb560=function(_0x388e9e,_0x50a394){_0x388e9e=_0x388e9e-0x0;var _0x13b2b2=_0x560b[_0x388e9e];return _0x13b2b2;};'use strict';var multer=require(_0xb560('0x0'));var util=require('util');var path=require(_0xb560('0x1'));var timeout=require(_0xb560('0x2'));var express=require('express');var router=express[_0xb560('0x3')]();var auth=require(_0xb560('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb560('0x5'));module[_0xb560('0x6')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 95c661e..357d583 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 _0xd8b0=['exports','sequelize'];(function(_0x18c3ca,_0x3c800f){var _0xa9521a=function(_0x1a1c89){while(--_0x1a1c89){_0x18c3ca['push'](_0x18c3ca['shift']());}};_0xa9521a(++_0x3c800f);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x51fe86,_0x422b66){var _0x3557d4=function(_0x524a6a){while(--_0x524a6a){_0x51fe86['push'](_0x51fe86['shift']());}};_0x3557d4(++_0x422b66);}(_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')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 8d0e50a..df53169 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 _0x7fbe=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0xd07e81,_0x1ccacd){_0xd07e81=_0xd07e81-0x0;var _0x379364=_0x7fbe[_0xd07e81];return _0x379364;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7fb('0x0'))(_0xe7fb('0x1'));var moment=require(_0xe7fb('0x2'));var BPromise=require(_0xe7fb('0x3'));var rp=require(_0xe7fb('0x4'));var fs=require('fs');var path=require(_0xe7fb('0x5'));var rimraf=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var attributes=require(_0xe7fb('0x8'));module[_0xe7fb('0x9')]=function(_0x290172,_0x12d1b0){return _0x290172[_0xe7fb('0xa')](_0xe7fb('0xb'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2123=['request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x21a549,_0x5c2f88){var _0x59791b=function(_0x30a5f6){while(--_0x30a5f6){_0x21a549['push'](_0x21a549['shift']());}};_0x59791b(++_0x5c2f88);}(_0x2123,0x190));var _0x3212=function(_0xa78156,_0x126ab1){_0xa78156=_0xa78156-0x0;var _0x4ffb54=_0x2123[_0xa78156];return _0x4ffb54;};'use strict';var _=require(_0x3212('0x0'));var util=require(_0x3212('0x1'));var logger=require(_0x3212('0x2'))(_0x3212('0x3'));var moment=require(_0x3212('0x4'));var BPromise=require(_0x3212('0x5'));var rp=require(_0x3212('0x6'));var fs=require('fs');var path=require(_0x3212('0x7'));var rimraf=require(_0x3212('0x8'));var config=require(_0x3212('0x9'));var attributes=require(_0x3212('0xa'));module[_0x3212('0xb')]=function(_0x5d9d36,_0x3859e4){return _0x5d9d36[_0x3212('0xc')](_0x3212('0xd'),attributes,{'tableName':'user_has_voice_queues','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 81e47b9..7cd6725 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 _0xf380=['../../config/environment','jayson/promise','client','then','info','UserVoiceQueue,\x20%s,\x20%s','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x371f37,_0x2faa9e){var _0x185d25=function(_0x2c3549){while(--_0x2c3549){_0x371f37['push'](_0x371f37['shift']());}};_0x185d25(++_0x2faa9e);}(_0xf380,0x117));var _0x0f38=function(_0x588410,_0x54e730){_0x588410=_0x588410-0x0;var _0x5d7d21=_0xf380[_0x588410];return _0x5d7d21;};'use strict';var _=require(_0x0f38('0x0'));var util=require(_0x0f38('0x1'));var moment=require('moment');var BPromise=require(_0x0f38('0x2'));var rs=require(_0x0f38('0x3'));var fs=require('fs');var Redis=require(_0x0f38('0x4'));var db=require(_0x0f38('0x5'))['db'];var utils=require(_0x0f38('0x6'));var logger=require(_0x0f38('0x7'))(_0x0f38('0x8'));var config=require(_0x0f38('0x9'));var jayson=require(_0x0f38('0xa'));var client=jayson[_0x0f38('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17720a,_0x49b513,_0x55a006){return new BPromise(function(_0x19a733,_0x1e56ef){return client['request'](_0x17720a,_0x55a006)[_0x0f38('0xc')](function(_0x5d0533){logger[_0x0f38('0xd')](_0x0f38('0xe'),_0x49b513,'request\x20sent');logger[_0x0f38('0xf')](_0x0f38('0x10'),_0x49b513,_0x0f38('0x11'),JSON[_0x0f38('0x12')](_0x5d0533));if(_0x5d0533['error']){if(_0x5d0533[_0x0f38('0x13')][_0x0f38('0x14')]===0x1f4){logger[_0x0f38('0x13')](_0x0f38('0xe'),_0x49b513,_0x5d0533[_0x0f38('0x13')][_0x0f38('0x15')]);return _0x1e56ef(_0x5d0533[_0x0f38('0x13')]['message']);}logger[_0x0f38('0x13')](_0x0f38('0xe'),_0x49b513,_0x5d0533[_0x0f38('0x13')][_0x0f38('0x15')]);return _0x19a733(_0x5d0533[_0x0f38('0x13')]['message']);}else{logger['info'](_0x0f38('0xe'),_0x49b513,_0x0f38('0x11'));_0x19a733(_0x5d0533[_0x0f38('0x16')][_0x0f38('0x15')]);}})[_0x0f38('0x17')](function(_0x598bf){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x49b513,_0x598bf);_0x1e56ef(_0x598bf);});});} \ No newline at end of file +var _0x1c7f=['error','code','message','info','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s'];(function(_0x420310,_0x45f13a){var _0x32c5e4=function(_0x1e0f07){while(--_0x1e0f07){_0x420310['push'](_0x420310['shift']());}};_0x32c5e4(++_0x45f13a);}(_0x1c7f,0xbd));var _0xf1c7=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x1c7f[_0x433a86];return _0x23000c;};'use strict';var _=require(_0xf1c7('0x0'));var util=require(_0xf1c7('0x1'));var moment=require('moment');var BPromise=require(_0xf1c7('0x2'));var rs=require(_0xf1c7('0x3'));var fs=require('fs');var Redis=require(_0xf1c7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf1c7('0x5'));var logger=require(_0xf1c7('0x6'))(_0xf1c7('0x7'));var config=require(_0xf1c7('0x8'));var jayson=require(_0xf1c7('0x9'));var client=jayson[_0xf1c7('0xa')][_0xf1c7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xb74ca8,_0x4ae3e3,_0x1a043c){return new BPromise(function(_0x160432,_0x4100e2){return client[_0xf1c7('0xc')](_0xb74ca8,_0x1a043c)[_0xf1c7('0xd')](function(_0x1b0dd6){logger['info'](_0xf1c7('0xe'),_0x4ae3e3,_0xf1c7('0xf'));logger[_0xf1c7('0x10')](_0xf1c7('0x11'),_0x4ae3e3,_0xf1c7('0xf'),JSON['stringify'](_0x1b0dd6));if(_0x1b0dd6[_0xf1c7('0x12')]){if(_0x1b0dd6['error'][_0xf1c7('0x13')]===0x1f4){logger[_0xf1c7('0x12')](_0xf1c7('0xe'),_0x4ae3e3,_0x1b0dd6['error'][_0xf1c7('0x14')]);return _0x4100e2(_0x1b0dd6[_0xf1c7('0x12')][_0xf1c7('0x14')]);}logger['error'](_0xf1c7('0xe'),_0x4ae3e3,_0x1b0dd6[_0xf1c7('0x12')]['message']);return _0x160432(_0x1b0dd6[_0xf1c7('0x12')]['message']);}else{logger[_0xf1c7('0x15')]('UserVoiceQueue,\x20%s,\x20%s',_0x4ae3e3,_0xf1c7('0xf'));_0x160432(_0x1b0dd6['result'][_0xf1c7('0x14')]);}})[_0xf1c7('0x16')](function(_0x6afc84){logger[_0xf1c7('0x12')](_0xf1c7('0xe'),_0x4ae3e3,_0x6afc84);_0x4100e2(_0x6afc84);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 3deca9d..9d31e94 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 _0x47e8=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util','path','connect-timeout'];(function(_0x461153,_0x5f4925){var _0x3eb98e=function(_0x18d05e){while(--_0x18d05e){_0x461153['push'](_0x461153['shift']());}};_0x3eb98e(++_0x5f4925);}(_0x47e8,0xf4));var _0x847e=function(_0x253e1f,_0xd247f0){_0x253e1f=_0x253e1f-0x0;var _0x1adb58=_0x47e8[_0x253e1f];return _0x1adb58;};'use strict';var multer=require(_0x847e('0x0'));var util=require(_0x847e('0x1'));var path=require(_0x847e('0x2'));var timeout=require(_0x847e('0x3'));var express=require(_0x847e('0x4'));var router=express['Router']();var auth=require(_0x847e('0x5'));var interaction=require(_0x847e('0x6'));var config=require(_0x847e('0x7'));module['exports']=router; \ No newline at end of file +var _0x4075=['exports','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x161a33,_0x32b981){var _0x1afe4b=function(_0x59fec1){while(--_0x59fec1){_0x161a33['push'](_0x161a33['shift']());}};_0x1afe4b(++_0x32b981);}(_0x4075,0x71));var _0x5407=function(_0x15cdcb,_0x4340e9){_0x15cdcb=_0x15cdcb-0x0;var _0x37b069=_0x4075[_0x15cdcb];return _0x37b069;};'use strict';var multer=require(_0x5407('0x0'));var util=require('util');var path=require(_0x5407('0x1'));var timeout=require(_0x5407('0x2'));var express=require(_0x5407('0x3'));var router=express[_0x5407('0x4')]();var auth=require(_0x5407('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x5407('0x6')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index f06e177..b091cd0 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 _0x53a0=['sequelize','Required\x20by\x20Asterisk','INTEGER','STRING','queue_interface'];(function(_0x26dc4b,_0x54c6c7){var _0x54b066=function(_0x23d46c){while(--_0x23d46c){_0x26dc4b['push'](_0x26dc4b['shift']());}};_0x54b066(++_0x54c6c7);}(_0x53a0,0x172));var _0x053a=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x53a0[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0x053a('0x0'));module['exports']={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x053a('0x1')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x053a('0x1')},'UserId':{'type':Sequelize[_0x053a('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x053a('0x3')],'allowNull':![],'unique':_0x053a('0x4'),'comment':_0x053a('0x1')},'VoiceQueueId':{'type':Sequelize[_0x053a('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0x053a('0x3')],'allowNull':![],'unique':_0x053a('0x4'),'comment':_0x053a('0x1')},'penalty':{'type':Sequelize[_0x053a('0x2')](0xb),'defaultValue':0x0,'comment':_0x053a('0x1')},'paused':{'type':Sequelize[_0x053a('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file +var _0x1f33=['exports','Required\x20by\x20Asterisk','INTEGER','STRING','queue_interface','sequelize'];(function(_0x46aa6f,_0xf7b072){var _0x44759c=function(_0x97a501){while(--_0x97a501){_0x46aa6f['push'](_0x46aa6f['shift']());}};_0x44759c(++_0xf7b072);}(_0x1f33,0xc5));var _0x31f3=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x1f33[_0x138adb];return _0x1b27f2;};'use strict';var Sequelize=require(_0x31f3('0x0'));module[_0x31f3('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x31f3('0x2')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0x31f3('0x3')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x31f3('0x4')],'allowNull':![],'unique':_0x31f3('0x5'),'comment':_0x31f3('0x2')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0x31f3('0x4')],'allowNull':![],'unique':_0x31f3('0x5'),'comment':_0x31f3('0x2')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x31f3('0x3')](0xb),'defaultValue':0x0,'comment':_0x31f3('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 12c8a3c..fed409e 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 _0x006d=['save','update','remove','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x006d,0xa7));var _0xd006=function(_0x810f15,_0x3c3941){_0x810f15=_0x810f15-0x0;var _0x5bb2e8=_0x006d[_0x810f15];return _0x5bb2e8;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0xd006('0x0'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd006('0x1'),'afterUpdate':_0xd006('0x2'),'afterDestroy':_0xd006('0x3')};function emitEvent(_0x2bad25){return function(_0x8216a4,_0x457a8e,_0x4cd1ca){UserVoiceQueueRtEvents[_0xd006('0x4')](_0x2bad25+':'+_0x8216a4['id'],_0x8216a4);UserVoiceQueueRtEvents[_0xd006('0x4')](_0x2bad25,_0x8216a4);_0x4cd1ca(null);};}for(var e in events){if(events[_0xd006('0x5')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0xd006('0x6')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x9669=['emit','hasOwnProperty','hook','exports','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','update','remove'];(function(_0x44cca6,_0x5e9271){var _0x175d04=function(_0x26d9e4){while(--_0x26d9e4){_0x44cca6['push'](_0x44cca6['shift']());}};_0x175d04(++_0x5e9271);}(_0x9669,0xfe));var _0x9966=function(_0x370737,_0x29ef34){_0x370737=_0x370737-0x0;var _0x39ffeb=_0x9669[_0x370737];return _0x39ffeb;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x9966('0x0'))['db'][_0x9966('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x9966('0x2')](0x0);var events={'afterCreate':_0x9966('0x3'),'afterUpdate':_0x9966('0x4'),'afterDestroy':_0x9966('0x5')};function emitEvent(_0x456082){return function(_0x8f3b8a,_0x2a34a4,_0x2bbe2c){UserVoiceQueueRtEvents[_0x9966('0x6')](_0x456082+':'+_0x8f3b8a['id'],_0x8f3b8a);UserVoiceQueueRtEvents[_0x9966('0x6')](_0x456082,_0x8f3b8a);_0x2bbe2c(null);};}for(var e in events){if(events[_0x9966('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0x9966('0x8')](e,emitEvent(event));}}module[_0x9966('0x9')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 6f9ee3f..c8881a5 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 _0x86d4=['path','../../config/environment','./userVoiceQueueRt.attributes','exports','define','user_has_voice_queues_rt','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x56ff5e,_0x257c79){var _0x26d7c6=function(_0x3cd248){while(--_0x3cd248){_0x56ff5e['push'](_0x56ff5e['shift']());}};_0x26d7c6(++_0x257c79);}(_0x86d4,0xf8));var _0x486d=function(_0x4a7956,_0x3bccce){_0x4a7956=_0x4a7956-0x0;var _0x34658f=_0x86d4[_0x4a7956];return _0x34658f;};'use strict';var _=require(_0x486d('0x0'));var util=require(_0x486d('0x1'));var logger=require(_0x486d('0x2'))('api');var moment=require('moment');var BPromise=require(_0x486d('0x3'));var rp=require(_0x486d('0x4'));var fs=require('fs');var path=require(_0x486d('0x5'));var rimraf=require('rimraf');var config=require(_0x486d('0x6'));var attributes=require(_0x486d('0x7'));module[_0x486d('0x8')]=function(_0x49abd9,_0x1590b2){return _0x49abd9[_0x486d('0x9')]('UserVoiceQueueRt',attributes,{'tableName':_0x486d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x29c6=['path','./userVoiceQueueRt.attributes','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x130415,_0x5d3205){var _0x599c0d=function(_0x413f36){while(--_0x413f36){_0x130415['push'](_0x130415['shift']());}};_0x599c0d(++_0x5d3205);}(_0x29c6,0x1f1));var _0x629c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x29c6[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x629c('0x0'));var util=require(_0x629c('0x1'));var logger=require(_0x629c('0x2'))(_0x629c('0x3'));var moment=require(_0x629c('0x4'));var BPromise=require(_0x629c('0x5'));var rp=require(_0x629c('0x6'));var fs=require('fs');var path=require(_0x629c('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x629c('0x8'));module['exports']=function(_0xf17d4c,_0x48c367){return _0xf17d4c['define']('UserVoiceQueueRt',attributes,{'tableName':'user_has_voice_queues_rt','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 d7053d5..d3bfc97 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 _0xa0b4=['result','catch','GetVoiceQueueRtPauses','findAll','options','raw','where','sequelize','COUNT','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','then','UserVoiceQueueRt,\x20%s,\x20%s','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info'];(function(_0x371b29,_0x2d33ed){var _0x434d79=function(_0x3966cf){while(--_0x3966cf){_0x371b29['push'](_0x371b29['shift']());}};_0x434d79(++_0x2d33ed);}(_0xa0b4,0xc4));var _0x4a0b=function(_0xe92779,_0x34b950){_0xe92779=_0xe92779-0x0;var _0x2c015b=_0xa0b4[_0xe92779];return _0x2c015b;};'use strict';var _=require(_0x4a0b('0x0'));var util=require('util');var moment=require(_0x4a0b('0x1'));var BPromise=require(_0x4a0b('0x2'));var rs=require(_0x4a0b('0x3'));var fs=require('fs');var Redis=require(_0x4a0b('0x4'));var db=require(_0x4a0b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4a0b('0x6'))(_0x4a0b('0x7'));var config=require(_0x4a0b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4a0b('0x9')][_0x4a0b('0xa')]({'port':0x232a});config[_0x4a0b('0xb')]=_[_0x4a0b('0xc')](config[_0x4a0b('0xb')],{'host':_0x4a0b('0xd'),'port':0x18eb});var socket=require(_0x4a0b('0xe'))(new Redis(config[_0x4a0b('0xb')]));require('./userVoiceQueueRt.socket')[_0x4a0b('0xf')](socket);function respondWithRpcPromise(_0x5033da,_0x59a630,_0x10fccd){return new BPromise(function(_0x4881f1,_0x47d3d0){return client['request'](_0x5033da,_0x10fccd)[_0x4a0b('0x10')](function(_0x2bcd16){logger['info'](_0x4a0b('0x11'),_0x59a630,'request\x20sent');logger[_0x4a0b('0x12')](_0x4a0b('0x13'),_0x59a630,_0x4a0b('0x14'),JSON[_0x4a0b('0x15')](_0x2bcd16));if(_0x2bcd16[_0x4a0b('0x16')]){if(_0x2bcd16['error'][_0x4a0b('0x17')]===0x1f4){logger[_0x4a0b('0x16')](_0x4a0b('0x11'),_0x59a630,_0x2bcd16[_0x4a0b('0x16')][_0x4a0b('0x18')]);return _0x47d3d0(_0x2bcd16[_0x4a0b('0x16')]['message']);}logger['error'](_0x4a0b('0x11'),_0x59a630,_0x2bcd16['error'][_0x4a0b('0x18')]);return _0x4881f1(_0x2bcd16[_0x4a0b('0x16')]['message']);}else{logger[_0x4a0b('0x19')](_0x4a0b('0x11'),_0x59a630,_0x4a0b('0x14'));_0x4881f1(_0x2bcd16[_0x4a0b('0x1a')][_0x4a0b('0x18')]);}})[_0x4a0b('0x1b')](function(_0x3c78a1){logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x59a630,_0x3c78a1);_0x47d3d0(_0x3c78a1);});});}exports[_0x4a0b('0x1c')]=function(_0x40e659){var _0x4b36a9=this;return new Promise(function(_0x402afe,_0x28f895){return db['UserVoiceQueueRt'][_0x4a0b('0x1d')]({'raw':_0x40e659[_0x4a0b('0x1e')]?_0x40e659[_0x4a0b('0x1e')][_0x4a0b('0x1f')]===undefined?!![]:![]:!![],'where':_0x40e659[_0x4a0b('0x1e')]?_0x40e659['options'][_0x4a0b('0x20')]||null:null,'attributes':[[db[_0x4a0b('0x21')]['fn'](_0x4a0b('0x22'),db[_0x4a0b('0x21')]['fn']('IF',db['sequelize']['literal'](_0x4a0b('0x23')))),_0x4a0b('0x24')]]})[_0x4a0b('0x10')](function(_0x449f88){logger[_0x4a0b('0x19')]('GetVoiceQueueRtPauses',_0x40e659);logger[_0x4a0b('0x12')](_0x4a0b('0x1c'),_0x40e659,JSON[_0x4a0b('0x15')](_0x449f88));_0x402afe(_0x449f88);})[_0x4a0b('0x1b')](function(_0x217c6b){logger['error'](_0x4a0b('0x1c'),_0x217c6b['message'],_0x40e659);_0x28f895(_0x4b36a9[_0x4a0b('0x16')](0x1f4,_0x217c6b['message']));});});}; \ No newline at end of file +var _0x5eac=['options','raw','where','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','debug','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','GetVoiceQueueRtPauses','findAll'];(function(_0x2ba609,_0x391585){var _0x563793=function(_0x3f28f5){while(--_0x3f28f5){_0x2ba609['push'](_0x2ba609['shift']());}};_0x563793(++_0x391585);}(_0x5eac,0x1dd));var _0xc5ea=function(_0x4e87cc,_0x306dba){_0x4e87cc=_0x4e87cc-0x0;var _0x663308=_0x5eac[_0x4e87cc];return _0x663308;};'use strict';var _=require(_0xc5ea('0x0'));var util=require(_0xc5ea('0x1'));var moment=require(_0xc5ea('0x2'));var BPromise=require(_0xc5ea('0x3'));var rs=require(_0xc5ea('0x4'));var fs=require('fs');var Redis=require(_0xc5ea('0x5'));var db=require(_0xc5ea('0x6'))['db'];var utils=require(_0xc5ea('0x7'));var logger=require(_0xc5ea('0x8'))(_0xc5ea('0x9'));var config=require(_0xc5ea('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xc5ea('0xb')][_0xc5ea('0xc')]({'port':0x232a});config[_0xc5ea('0xd')]=_[_0xc5ea('0xe')](config[_0xc5ea('0xd')],{'host':_0xc5ea('0xf'),'port':0x18eb});var socket=require(_0xc5ea('0x10'))(new Redis(config[_0xc5ea('0xd')]));require(_0xc5ea('0x11'))[_0xc5ea('0x12')](socket);function respondWithRpcPromise(_0x122158,_0x40c78f,_0x4140d4){return new BPromise(function(_0x4574f0,_0xd6da2b){return client[_0xc5ea('0x13')](_0x122158,_0x4140d4)['then'](function(_0x54bdfc){logger['info'](_0xc5ea('0x14'),_0x40c78f,_0xc5ea('0x15'));logger['debug']('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x40c78f,_0xc5ea('0x15'),JSON['stringify'](_0x54bdfc));if(_0x54bdfc[_0xc5ea('0x16')]){if(_0x54bdfc[_0xc5ea('0x16')][_0xc5ea('0x17')]===0x1f4){logger[_0xc5ea('0x16')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x40c78f,_0x54bdfc[_0xc5ea('0x16')][_0xc5ea('0x18')]);return _0xd6da2b(_0x54bdfc['error'][_0xc5ea('0x18')]);}logger[_0xc5ea('0x16')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x40c78f,_0x54bdfc[_0xc5ea('0x16')]['message']);return _0x4574f0(_0x54bdfc['error'][_0xc5ea('0x18')]);}else{logger[_0xc5ea('0x19')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x40c78f,_0xc5ea('0x15'));_0x4574f0(_0x54bdfc[_0xc5ea('0x1a')][_0xc5ea('0x18')]);}})[_0xc5ea('0x1b')](function(_0x2c05c4){logger['error'](_0xc5ea('0x14'),_0x40c78f,_0x2c05c4);_0xd6da2b(_0x2c05c4);});});}exports[_0xc5ea('0x1c')]=function(_0x47d9ed){var _0x4ee915=this;return new Promise(function(_0x17805e,_0x5d2f8d){return db['UserVoiceQueueRt'][_0xc5ea('0x1d')]({'raw':_0x47d9ed[_0xc5ea('0x1e')]?_0x47d9ed['options'][_0xc5ea('0x1f')]===undefined?!![]:![]:!![],'where':_0x47d9ed[_0xc5ea('0x1e')]?_0x47d9ed[_0xc5ea('0x1e')][_0xc5ea('0x20')]||null:null,'attributes':[[db[_0xc5ea('0x21')]['fn']('COUNT',db[_0xc5ea('0x21')]['fn']('IF',db['sequelize'][_0xc5ea('0x22')](_0xc5ea('0x23')))),_0xc5ea('0x24')]]})['then'](function(_0x352955){logger[_0xc5ea('0x19')](_0xc5ea('0x1c'),_0x47d9ed);logger[_0xc5ea('0x25')](_0xc5ea('0x1c'),_0x47d9ed,JSON[_0xc5ea('0x26')](_0x352955));_0x17805e(_0x352955);})[_0xc5ea('0x1b')](function(_0x73269f){logger[_0xc5ea('0x16')](_0xc5ea('0x1c'),_0x73269f[_0xc5ea('0x18')],_0x47d9ed);_0x5d2f8d(_0x4ee915[_0xc5ea('0x16')](0x1f4,_0x73269f[_0xc5ea('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index d5341fe..63e3491 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 _0x35c6=['emit','removeListener','register','./userVoiceQueueRt.events','save','remove'];(function(_0x337216,_0x4184e2){var _0x113fdb=function(_0x34e656){while(--_0x34e656){_0x337216['push'](_0x337216['shift']());}};_0x113fdb(++_0x4184e2);}(_0x35c6,0x93));var _0x635c=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x35c6[_0x19e35c];return _0x3e1fe8;};'use strict';var UserVoiceQueueRtEvents=require(_0x635c('0x0'));var events=[_0x635c('0x1'),_0x635c('0x2'),'update'];function createListener(_0x2969a5,_0xb01248){return function(_0x1f9ace){_0xb01248[_0x635c('0x3')](_0x2969a5,_0x1f9ace);};}function removeListener(_0x148357,_0xa77705){return function(){UserVoiceQueueRtEvents[_0x635c('0x4')](_0x148357,_0xa77705);};}exports[_0x635c('0x5')]=function(_0x4588aa){for(var _0x2c24e4=0x0,_0x408f02=events['length'];_0x2c24e4<_0x408f02;_0x2c24e4++){var _0x3af2b2=events[_0x2c24e4];var _0x1e2226=createListener('userVoiceQueueRt:'+_0x3af2b2,_0x4588aa);UserVoiceQueueRtEvents['on'](_0x3af2b2,_0x1e2226);}}; \ No newline at end of file +var _0xa732=['./userVoiceQueueRt.events','emit','removeListener','register','length','userVoiceQueueRt:'];(function(_0xef4c2,_0x29f60e){var _0x34f86c=function(_0x906526){while(--_0x906526){_0xef4c2['push'](_0xef4c2['shift']());}};_0x34f86c(++_0x29f60e);}(_0xa732,0x9c));var _0x2a73=function(_0x5eb47e,_0x34d1e5){_0x5eb47e=_0x5eb47e-0x0;var _0x390b47=_0xa732[_0x5eb47e];return _0x390b47;};'use strict';var UserVoiceQueueRtEvents=require(_0x2a73('0x0'));var events=['save','remove','update'];function createListener(_0x56665c,_0x34e55f){return function(_0x33e0f6){_0x34e55f[_0x2a73('0x1')](_0x56665c,_0x33e0f6);};}function removeListener(_0x595d3a,_0x25af0d){return function(){UserVoiceQueueRtEvents[_0x2a73('0x2')](_0x595d3a,_0x25af0d);};}exports[_0x2a73('0x3')]=function(_0x145c36){for(var _0x30e006=0x0,_0xab6dac=events[_0x2a73('0x4')];_0x30e006<_0xab6dac;_0x30e006++){var _0x3fb96a=events[_0x30e006];var _0x1b28d0=createListener(_0x2a73('0x5')+_0x3fb96a,_0x145c36);UserVoiceQueueRtEvents['on'](_0x3fb96a,_0x1b28d0);}}; \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index f64132d..3e20b9a 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 _0xe097=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','show','create','put','/:id','update','delete','destroy','exports','util'];(function(_0x40e448,_0x57b325){var _0x60e36c=function(_0x526372){while(--_0x526372){_0x40e448['push'](_0x40e448['shift']());}};_0x60e36c(++_0x57b325);}(_0xe097,0x1b9));var _0x7e09=function(_0x556a93,_0x2fde7c){_0x556a93=_0x556a93-0x0;var _0xe278b3=_0xe097[_0x556a93];return _0xe278b3;};'use strict';var multer=require('multer');var util=require(_0x7e09('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7e09('0x1'));var router=express['Router']();var auth=require(_0x7e09('0x2'));var interaction=require(_0x7e09('0x3'));var config=require(_0x7e09('0x4'));var controller=require(_0x7e09('0x5'));router[_0x7e09('0x6')]('/',auth[_0x7e09('0x7')](),controller[_0x7e09('0x8')]);router[_0x7e09('0x6')]('/:id',auth[_0x7e09('0x7')](),controller[_0x7e09('0x9')]);router['post']('/',auth[_0x7e09('0x7')](),controller[_0x7e09('0xa')]);router[_0x7e09('0xb')](_0x7e09('0xc'),auth['isAuthenticated'](),controller[_0x7e09('0xd')]);router[_0x7e09('0xe')](_0x7e09('0xc'),auth[_0x7e09('0x7')](),controller[_0x7e09('0xf')]);module[_0x7e09('0x10')]=router; \ No newline at end of file +var _0x6349=['isAuthenticated','/:id','show','post','update','delete','exports','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x28a871,_0x37cd25){var _0x2849de=function(_0x535d97){while(--_0x535d97){_0x28a871['push'](_0x28a871['shift']());}};_0x2849de(++_0x37cd25);}(_0x6349,0x69));var _0x9634=function(_0x217416,_0x12446d){_0x217416=_0x217416-0x0;var _0x5da7ee=_0x6349[_0x217416];return _0x5da7ee;};'use strict';var multer=require('multer');var util=require(_0x9634('0x0'));var path=require(_0x9634('0x1'));var timeout=require(_0x9634('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x9634('0x3'));var interaction=require(_0x9634('0x4'));var config=require(_0x9634('0x5'));var controller=require('./variable.controller');router[_0x9634('0x6')]('/',auth[_0x9634('0x7')](),controller['index']);router['get'](_0x9634('0x8'),auth['isAuthenticated'](),controller[_0x9634('0x9')]);router[_0x9634('0xa')]('/',auth[_0x9634('0x7')](),controller['create']);router['put'](_0x9634('0x8'),auth[_0x9634('0x7')](),controller[_0x9634('0xb')]);router[_0x9634('0xc')](_0x9634('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x9634('0xd')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 9641629..6b26177 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 _0xa9b0=['sequelize','exports','STRING','name'];(function(_0x56831a,_0x3e4b71){var _0x530c1e=function(_0x7c7183){while(--_0x7c7183){_0x56831a['push'](_0x56831a['shift']());}};_0x530c1e(++_0x3e4b71);}(_0xa9b0,0xf8));var _0x0a9b=function(_0x2132a3,_0x4639e9){_0x2132a3=_0x2132a3-0x0;var _0x21890c=_0xa9b0[_0x2132a3];return _0x21890c;};'use strict';var Sequelize=require(_0x0a9b('0x0'));module[_0x0a9b('0x1')]={'name':{'type':Sequelize[_0x0a9b('0x2')],'unique':_0x0a9b('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x0a9b('0x2')]}}; \ No newline at end of file +var _0xf299=['STRING','name','sequelize'];(function(_0x58809f,_0x4aa7b9){var _0x4f2e07=function(_0xefe7b7){while(--_0xefe7b7){_0x58809f['push'](_0x58809f['shift']());}};_0x4f2e07(++_0x4aa7b9);}(_0xf299,0x1a9));var _0x9f29=function(_0x31c86f,_0x355ee7){_0x31c86f=_0x31c86f-0x0;var _0x5251f7=_0xf299[_0x31c86f];return _0x5251f7;};'use strict';var Sequelize=require(_0x9f29('0x0'));module['exports']={'name':{'type':Sequelize[_0x9f29('0x1')],'unique':_0x9f29('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9f29('0x1')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index d154e95..3b9ee0e 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 _0x044c=['Content-Range','apply','reject','save','update','destroy','then','error','stack','send','index','map','Variable','rawAttributes','fieldName','key','model','name','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','catch','show','params','intersection','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','set'];(function(_0x59b439,_0x14ae7b){var _0x521ea3=function(_0x5af627){while(--_0x5af627){_0x59b439['push'](_0x59b439['shift']());}};_0x521ea3(++_0x14ae7b);}(_0x044c,0x1d1));var _0xc044=function(_0x179775,_0x403b57){_0x179775=_0x179775-0x0;var _0x17ee82=_0x044c[_0x179775];return _0x17ee82;};'use strict';var pdf=require(_0xc044('0x0'));var emlformat=require(_0xc044('0x1'));var rimraf=require(_0xc044('0x2'));var zipdir=require(_0xc044('0x3'));var jsonpatch=require(_0xc044('0x4'));var rp=require(_0xc044('0x5'));var moment=require(_0xc044('0x6'));var BPromise=require(_0xc044('0x7'));var Mustache=require(_0xc044('0x8'));var util=require(_0xc044('0x9'));var path=require(_0xc044('0xa'));var sox=require('sox');var csv=require(_0xc044('0xb'));var ejs=require(_0xc044('0xc'));var fs=require('fs');var _=require(_0xc044('0xd'));var squel=require('squel');var crypto=require(_0xc044('0xe'));var jsforce=require(_0xc044('0xf'));var deskjs=require(_0xc044('0x10'));var toCsv=require(_0xc044('0xb'));var querystring=require(_0xc044('0x11'));var Papa=require(_0xc044('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc044('0x13'));var as=require(_0xc044('0x14'));var hardwareService=require(_0xc044('0x15'));var logger=require(_0xc044('0x16'))(_0xc044('0x17'));var utils=require('../../config/utils');var config=require(_0xc044('0x18'));var db=require(_0xc044('0x19'))['db'];function respondWithStatusCode(_0x27966f,_0xf0a615){_0xf0a615=_0xf0a615||0xcc;return function(_0x1ad3ad){if(_0x1ad3ad){return _0x27966f[_0xc044('0x1a')](_0xf0a615);}return _0x27966f['status'](_0xf0a615)[_0xc044('0x1b')]();};}function respondWithResult(_0x20fbc3,_0x1398d6){_0x1398d6=_0x1398d6||0xc8;return function(_0x3f5397){if(_0x3f5397){return _0x20fbc3[_0xc044('0x1c')](_0x1398d6)[_0xc044('0x1d')](_0x3f5397);}};}function respondWithFilteredResult(_0x1ccc5c,_0x3c60c7){return function(_0x5ceba2){if(_0x5ceba2){var _0x641a63=_0x5ceba2['count'],_0x4ca66a=_0x3c60c7[_0xc044('0x1e')],_0x57c64b=_0x3c60c7[_0xc044('0x1e')]+_0x3c60c7[_0xc044('0x1f')],_0x590bc4;if(_0x57c64b>=_0x641a63){_0x57c64b=_0x641a63;_0x590bc4=0xc8;}else{_0x590bc4=0xce;}_0x1ccc5c['status'](_0x590bc4);return _0x1ccc5c[_0xc044('0x20')](_0xc044('0x21'),_0x4ca66a+'-'+_0x57c64b+'/'+_0x641a63)['json'](_0x5ceba2);}return null;};}function patchUpdates(_0x2290bb){return function(_0x31b0df){try{jsonpatch[_0xc044('0x22')](_0x31b0df,_0x2290bb,!![]);}catch(_0x14f214){return BPromise[_0xc044('0x23')](_0x14f214);}return _0x31b0df[_0xc044('0x24')]();};}function saveUpdates(_0x448267,_0xce03bc){return function(_0x20b44d){if(_0x20b44d){return _0x20b44d[_0xc044('0x25')](_0x448267)['then'](function(_0x8fcf47){return _0x8fcf47;});}return null;};}function removeEntity(_0x45b844,_0x4410f3){return function(_0x5358fa){if(_0x5358fa){return _0x5358fa[_0xc044('0x26')]()[_0xc044('0x27')](function(){var _0x5b3143=_0x5358fa['get']({'plain':!![]});var _0x44cd5c='Variables';return db['UserProfileResource'][_0xc044('0x26')]({'where':{'type':_0x44cd5c,'resourceId':_0x5b3143['id']}})[_0xc044('0x27')](function(){return _0x5358fa;});})[_0xc044('0x27')](function(){_0x45b844[_0xc044('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x95767a,_0x3a980b){return function(_0x2a8a22){if(!_0x2a8a22){_0x95767a[_0xc044('0x1a')](0x194);}return _0x2a8a22;};}function handleError(_0x558b0f,_0x3f39e7){_0x3f39e7=_0x3f39e7||0x1f4;return function(_0x5bbe0d){logger[_0xc044('0x28')](_0x5bbe0d[_0xc044('0x29')]);if(_0x5bbe0d['name']){delete _0x5bbe0d['name'];}_0x558b0f[_0xc044('0x1c')](_0x3f39e7)[_0xc044('0x2a')](_0x5bbe0d);};}exports[_0xc044('0x2b')]=function(_0x37fc35,_0x353635){var _0xb2c48b={},_0x3fd79b={},_0x1d6157={'count':0x0,'rows':[]};var _0x396a8b=_[_0xc044('0x2c')](db[_0xc044('0x2d')][_0xc044('0x2e')],function(_0x215489){return{'name':_0x215489[_0xc044('0x2f')],'type':_0x215489['type'][_0xc044('0x30')]};});_0x3fd79b[_0xc044('0x31')]=_['map'](_0x396a8b,_0xc044('0x32'));_0x3fd79b[_0xc044('0x33')]=_[_0xc044('0x34')](_0x37fc35[_0xc044('0x33')]);_0x3fd79b[_0xc044('0x35')]=_['intersection'](_0x3fd79b[_0xc044('0x31')],_0x3fd79b[_0xc044('0x33')]);_0xb2c48b[_0xc044('0x36')]=_['intersection'](_0x3fd79b[_0xc044('0x31')],qs[_0xc044('0x37')](_0x37fc35['query'][_0xc044('0x37')]));_0xb2c48b[_0xc044('0x36')]=_0xb2c48b[_0xc044('0x36')][_0xc044('0x38')]?_0xb2c48b[_0xc044('0x36')]:_0x3fd79b[_0xc044('0x31')];if(!_0x37fc35[_0xc044('0x33')][_0xc044('0x39')]('nolimit')){_0xb2c48b[_0xc044('0x1f')]=qs[_0xc044('0x1f')](_0x37fc35[_0xc044('0x33')][_0xc044('0x1f')]);_0xb2c48b[_0xc044('0x1e')]=qs[_0xc044('0x1e')](_0x37fc35[_0xc044('0x33')][_0xc044('0x1e')]);}_0xb2c48b[_0xc044('0x3a')]=qs[_0xc044('0x3b')](_0x37fc35['query'][_0xc044('0x3b')]);_0xb2c48b['where']=qs[_0xc044('0x35')](_['pick'](_0x37fc35[_0xc044('0x33')],_0x3fd79b['filters']));if(_0x37fc35[_0xc044('0x33')]['filter']){_0xb2c48b[_0xc044('0x3c')]=_[_0xc044('0x3d')](_0xb2c48b['where'],{'$or':_[_0xc044('0x2c')](_0x396a8b,function(_0x169332){if(_0x169332['type']!==_0xc044('0x3e')){var _0x5629d4={};_0x5629d4[_0x169332['name']]={'$like':'%'+_0x37fc35[_0xc044('0x33')][_0xc044('0x3f')]+'%'};return _0x5629d4;}})});}_0xb2c48b=_[_0xc044('0x3d')]({},_0xb2c48b,_0x37fc35[_0xc044('0x40')]);var _0x4250fe={'where':_0xb2c48b['where']};return db[_0xc044('0x2d')][_0xc044('0x41')](_0x4250fe)[_0xc044('0x27')](function(_0x2993b2){_0x1d6157[_0xc044('0x41')]=_0x2993b2;if(_0x37fc35[_0xc044('0x33')][_0xc044('0x42')]){_0xb2c48b[_0xc044('0x43')]=[{'all':!![]}];}return db[_0xc044('0x2d')][_0xc044('0x44')](_0xb2c48b);})[_0xc044('0x27')](function(_0x1d2dc7){_0x1d6157['rows']=_0x1d2dc7;return _0x1d6157;})[_0xc044('0x27')](respondWithFilteredResult(_0x353635,_0xb2c48b))[_0xc044('0x45')](handleError(_0x353635,null));};exports[_0xc044('0x46')]=function(_0x3177eb,_0x28fcb5){var _0x1bf075={'raw':!![],'where':{'id':_0x3177eb[_0xc044('0x47')]['id']}},_0x1da80b={};_0x1da80b[_0xc044('0x31')]=_[_0xc044('0x34')](db[_0xc044('0x2d')][_0xc044('0x2e')]);_0x1da80b['query']=_[_0xc044('0x34')](_0x3177eb[_0xc044('0x33')]);_0x1da80b['filters']=_[_0xc044('0x48')](_0x1da80b['model'],_0x1da80b[_0xc044('0x33')]);_0x1bf075[_0xc044('0x36')]=_[_0xc044('0x48')](_0x1da80b[_0xc044('0x31')],qs[_0xc044('0x37')](_0x3177eb[_0xc044('0x33')][_0xc044('0x37')]));_0x1bf075[_0xc044('0x36')]=_0x1bf075[_0xc044('0x36')][_0xc044('0x38')]?_0x1bf075[_0xc044('0x36')]:_0x1da80b[_0xc044('0x31')];if(_0x3177eb['query']['includeAll']){_0x1bf075[_0xc044('0x43')]=[{'all':!![]}];}_0x1bf075=_['merge']({},_0x1bf075,_0x3177eb['options']);return db['Variable'][_0xc044('0x49')](_0x1bf075)['then'](handleEntityNotFound(_0x28fcb5,null))[_0xc044('0x27')](respondWithResult(_0x28fcb5,null))['catch'](handleError(_0x28fcb5,null));};exports[_0xc044('0x4a')]=function(_0x2025dd,_0x1f45d2){return db[_0xc044('0x2d')]['create'](_0x2025dd['body'],{})[_0xc044('0x27')](function(_0x4b72dd){var _0x4f0504=_0x2025dd[_0xc044('0x4b')][_0xc044('0x4c')]({'plain':!![]});if(!_0x4f0504)throw new Error(_0xc044('0x4d'));if(_0x4f0504[_0xc044('0x4e')]===_0xc044('0x4b')){var _0x24dfb3=_0x4b72dd[_0xc044('0x4c')]({'plain':!![]});var _0x5d59bc='Variables';return db['UserProfileSection']['find']({'where':{'name':_0x5d59bc,'userProfileId':_0x4f0504['userProfileId']},'raw':!![]})[_0xc044('0x27')](function(_0x5da0cc){if(_0x5da0cc&&_0x5da0cc[_0xc044('0x4f')]===0x0){return db[_0xc044('0x50')][_0xc044('0x4a')]({'name':_0x24dfb3[_0xc044('0x32')],'resourceId':_0x24dfb3['id'],'type':_0x5da0cc[_0xc044('0x32')],'sectionId':_0x5da0cc['id']},{})['then'](function(){return _0x4b72dd;});}else{return _0x4b72dd;}})['catch'](function(_0x2fecd5){logger[_0xc044('0x28')](_0xc044('0x51'),_0x2fecd5);throw _0x2fecd5;});}return _0x4b72dd;})[_0xc044('0x27')](respondWithResult(_0x1f45d2,0xc9))[_0xc044('0x45')](handleError(_0x1f45d2,null));};exports['update']=function(_0x54cdcc,_0x51fd00){if(_0x54cdcc[_0xc044('0x52')]['id']){delete _0x54cdcc[_0xc044('0x52')]['id'];}return db[_0xc044('0x2d')][_0xc044('0x49')]({'where':{'id':_0x54cdcc[_0xc044('0x47')]['id']}})[_0xc044('0x27')](handleEntityNotFound(_0x51fd00,null))[_0xc044('0x27')](saveUpdates(_0x54cdcc[_0xc044('0x52')],null))['then'](respondWithResult(_0x51fd00,null))[_0xc044('0x45')](handleError(_0x51fd00,null));};exports['destroy']=function(_0x412a41,_0x15e222){return db[_0xc044('0x2d')][_0xc044('0x49')]({'where':{'id':_0x412a41[_0xc044('0x47')]['id']}})[_0xc044('0x27')](handleEntityNotFound(_0x15e222,null))[_0xc044('0x27')](removeEntity(_0x15e222,null))[_0xc044('0x45')](handleError(_0x15e222,null));}; \ No newline at end of file +var _0x7b72=['sendStatus','stack','name','send','index','map','Variable','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','VIRTUAL','filter','merge','options','includeAll','include','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','update','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','count','offset','Content-Range','apply','reject','save','then','destroy','get','Variables','UserProfileResource'];(function(_0x187499,_0x5e416a){var _0x2965fe=function(_0xc6645e){while(--_0xc6645e){_0x187499['push'](_0x187499['shift']());}};_0x2965fe(++_0x5e416a);}(_0x7b72,0xcd));var _0x27b7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7b72[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x27b7('0x0'));var emlformat=require(_0x27b7('0x1'));var rimraf=require(_0x27b7('0x2'));var zipdir=require(_0x27b7('0x3'));var jsonpatch=require(_0x27b7('0x4'));var rp=require(_0x27b7('0x5'));var moment=require(_0x27b7('0x6'));var BPromise=require(_0x27b7('0x7'));var Mustache=require(_0x27b7('0x8'));var util=require(_0x27b7('0x9'));var path=require(_0x27b7('0xa'));var sox=require(_0x27b7('0xb'));var csv=require(_0x27b7('0xc'));var ejs=require(_0x27b7('0xd'));var fs=require('fs');var _=require(_0x27b7('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x27b7('0xf'));var deskjs=require(_0x27b7('0x10'));var toCsv=require(_0x27b7('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x27b7('0x11'));var authService=require(_0x27b7('0x12'));var qs=require(_0x27b7('0x13'));var as=require(_0x27b7('0x14'));var hardwareService=require(_0x27b7('0x15'));var logger=require(_0x27b7('0x16'))(_0x27b7('0x17'));var utils=require(_0x27b7('0x18'));var config=require(_0x27b7('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x43367b,_0x537ec4){_0x537ec4=_0x537ec4||0xcc;return function(_0x49d99b){if(_0x49d99b){return _0x43367b['sendStatus'](_0x537ec4);}return _0x43367b[_0x27b7('0x1a')](_0x537ec4)['end']();};}function respondWithResult(_0x1844e1,_0x2703f3){_0x2703f3=_0x2703f3||0xc8;return function(_0x36a6fc){if(_0x36a6fc){return _0x1844e1[_0x27b7('0x1a')](_0x2703f3)['json'](_0x36a6fc);}};}function respondWithFilteredResult(_0x41d1a2,_0xe46ee5){return function(_0x21481f){if(_0x21481f){var _0xcba1fa=_0x21481f[_0x27b7('0x1b')],_0x49a19b=_0xe46ee5[_0x27b7('0x1c')],_0x54ea7e=_0xe46ee5[_0x27b7('0x1c')]+_0xe46ee5['limit'],_0x354372;if(_0x54ea7e>=_0xcba1fa){_0x54ea7e=_0xcba1fa;_0x354372=0xc8;}else{_0x354372=0xce;}_0x41d1a2[_0x27b7('0x1a')](_0x354372);return _0x41d1a2['set'](_0x27b7('0x1d'),_0x49a19b+'-'+_0x54ea7e+'/'+_0xcba1fa)['json'](_0x21481f);}return null;};}function patchUpdates(_0x328d69){return function(_0x4ecb31){try{jsonpatch[_0x27b7('0x1e')](_0x4ecb31,_0x328d69,!![]);}catch(_0x38c54a){return BPromise[_0x27b7('0x1f')](_0x38c54a);}return _0x4ecb31[_0x27b7('0x20')]();};}function saveUpdates(_0x3c3ae8,_0x176d58){return function(_0x2fc7c5){if(_0x2fc7c5){return _0x2fc7c5['update'](_0x3c3ae8)[_0x27b7('0x21')](function(_0x100601){return _0x100601;});}return null;};}function removeEntity(_0x3b650f,_0x355556){return function(_0x3a57c4){if(_0x3a57c4){return _0x3a57c4[_0x27b7('0x22')]()[_0x27b7('0x21')](function(){var _0x9a1720=_0x3a57c4[_0x27b7('0x23')]({'plain':!![]});var _0x450800=_0x27b7('0x24');return db[_0x27b7('0x25')][_0x27b7('0x22')]({'where':{'type':_0x450800,'resourceId':_0x9a1720['id']}})[_0x27b7('0x21')](function(){return _0x3a57c4;});})['then'](function(){_0x3b650f[_0x27b7('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fd4b8,_0xd8ecf2){return function(_0xe96d15){if(!_0xe96d15){_0x4fd4b8[_0x27b7('0x26')](0x194);}return _0xe96d15;};}function handleError(_0x549832,_0x24bee7){_0x24bee7=_0x24bee7||0x1f4;return function(_0x1e2f2a){logger['error'](_0x1e2f2a[_0x27b7('0x27')]);if(_0x1e2f2a[_0x27b7('0x28')]){delete _0x1e2f2a[_0x27b7('0x28')];}_0x549832[_0x27b7('0x1a')](_0x24bee7)[_0x27b7('0x29')](_0x1e2f2a);};}exports[_0x27b7('0x2a')]=function(_0x5eabe5,_0x2d8ac1){var _0x46f195={},_0x3efacc={},_0x1329f0={'count':0x0,'rows':[]};var _0x34e97e=_[_0x27b7('0x2b')](db[_0x27b7('0x2c')][_0x27b7('0x2d')],function(_0x1e1672){return{'name':_0x1e1672['fieldName'],'type':_0x1e1672[_0x27b7('0x2e')]['key']};});_0x3efacc[_0x27b7('0x2f')]=_[_0x27b7('0x2b')](_0x34e97e,_0x27b7('0x28'));_0x3efacc[_0x27b7('0x30')]=_[_0x27b7('0x31')](_0x5eabe5[_0x27b7('0x30')]);_0x3efacc[_0x27b7('0x32')]=_[_0x27b7('0x33')](_0x3efacc[_0x27b7('0x2f')],_0x3efacc[_0x27b7('0x30')]);_0x46f195['attributes']=_[_0x27b7('0x33')](_0x3efacc[_0x27b7('0x2f')],qs[_0x27b7('0x34')](_0x5eabe5[_0x27b7('0x30')][_0x27b7('0x34')]));_0x46f195[_0x27b7('0x35')]=_0x46f195[_0x27b7('0x35')][_0x27b7('0x36')]?_0x46f195['attributes']:_0x3efacc[_0x27b7('0x2f')];if(!_0x5eabe5[_0x27b7('0x30')][_0x27b7('0x37')](_0x27b7('0x38'))){_0x46f195['limit']=qs['limit'](_0x5eabe5[_0x27b7('0x30')][_0x27b7('0x39')]);_0x46f195['offset']=qs[_0x27b7('0x1c')](_0x5eabe5[_0x27b7('0x30')][_0x27b7('0x1c')]);}_0x46f195[_0x27b7('0x3a')]=qs['sort'](_0x5eabe5[_0x27b7('0x30')][_0x27b7('0x3b')]);_0x46f195[_0x27b7('0x3c')]=qs[_0x27b7('0x32')](_['pick'](_0x5eabe5[_0x27b7('0x30')],_0x3efacc['filters']));if(_0x5eabe5[_0x27b7('0x30')]['filter']){_0x46f195['where']=_['merge'](_0x46f195['where'],{'$or':_[_0x27b7('0x2b')](_0x34e97e,function(_0x3da077){if(_0x3da077[_0x27b7('0x2e')]!==_0x27b7('0x3d')){var _0x393e6d={};_0x393e6d[_0x3da077['name']]={'$like':'%'+_0x5eabe5[_0x27b7('0x30')][_0x27b7('0x3e')]+'%'};return _0x393e6d;}})});}_0x46f195=_[_0x27b7('0x3f')]({},_0x46f195,_0x5eabe5[_0x27b7('0x40')]);var _0x29465e={'where':_0x46f195[_0x27b7('0x3c')]};return db[_0x27b7('0x2c')][_0x27b7('0x1b')](_0x29465e)[_0x27b7('0x21')](function(_0x5ee0ae){_0x1329f0[_0x27b7('0x1b')]=_0x5ee0ae;if(_0x5eabe5[_0x27b7('0x30')][_0x27b7('0x41')]){_0x46f195[_0x27b7('0x42')]=[{'all':!![]}];}return db[_0x27b7('0x2c')]['findAll'](_0x46f195);})['then'](function(_0x26cec0){_0x1329f0[_0x27b7('0x43')]=_0x26cec0;return _0x1329f0;})[_0x27b7('0x21')](respondWithFilteredResult(_0x2d8ac1,_0x46f195))[_0x27b7('0x44')](handleError(_0x2d8ac1,null));};exports[_0x27b7('0x45')]=function(_0x370d44,_0x2b8ddb){var _0x35fd35={'raw':!![],'where':{'id':_0x370d44['params']['id']}},_0x10a4b5={};_0x10a4b5['model']=_[_0x27b7('0x31')](db[_0x27b7('0x2c')][_0x27b7('0x2d')]);_0x10a4b5[_0x27b7('0x30')]=_['keys'](_0x370d44[_0x27b7('0x30')]);_0x10a4b5[_0x27b7('0x32')]=_[_0x27b7('0x33')](_0x10a4b5[_0x27b7('0x2f')],_0x10a4b5[_0x27b7('0x30')]);_0x35fd35[_0x27b7('0x35')]=_[_0x27b7('0x33')](_0x10a4b5[_0x27b7('0x2f')],qs['fields'](_0x370d44['query']['fields']));_0x35fd35['attributes']=_0x35fd35[_0x27b7('0x35')][_0x27b7('0x36')]?_0x35fd35[_0x27b7('0x35')]:_0x10a4b5[_0x27b7('0x2f')];if(_0x370d44['query'][_0x27b7('0x41')]){_0x35fd35[_0x27b7('0x42')]=[{'all':!![]}];}_0x35fd35=_['merge']({},_0x35fd35,_0x370d44[_0x27b7('0x40')]);return db[_0x27b7('0x2c')][_0x27b7('0x46')](_0x35fd35)[_0x27b7('0x21')](handleEntityNotFound(_0x2b8ddb,null))[_0x27b7('0x21')](respondWithResult(_0x2b8ddb,null))[_0x27b7('0x44')](handleError(_0x2b8ddb,null));};exports[_0x27b7('0x47')]=function(_0x9cf5a0,_0x1e0daf){return db[_0x27b7('0x2c')][_0x27b7('0x47')](_0x9cf5a0[_0x27b7('0x48')],{})[_0x27b7('0x21')](function(_0x5e7b80){var _0x4d3b86=_0x9cf5a0[_0x27b7('0x49')][_0x27b7('0x23')]({'plain':!![]});if(!_0x4d3b86)throw new Error(_0x27b7('0x4a'));if(_0x4d3b86[_0x27b7('0x4b')]===_0x27b7('0x49')){var _0x33fd2c=_0x5e7b80[_0x27b7('0x23')]({'plain':!![]});var _0x2ec7e1=_0x27b7('0x24');return db[_0x27b7('0x4c')]['find']({'where':{'name':_0x2ec7e1,'userProfileId':_0x4d3b86['userProfileId']},'raw':!![]})[_0x27b7('0x21')](function(_0x1b52e2){if(_0x1b52e2&&_0x1b52e2[_0x27b7('0x4d')]===0x0){return db[_0x27b7('0x25')][_0x27b7('0x47')]({'name':_0x33fd2c[_0x27b7('0x28')],'resourceId':_0x33fd2c['id'],'type':_0x1b52e2[_0x27b7('0x28')],'sectionId':_0x1b52e2['id']},{})[_0x27b7('0x21')](function(){return _0x5e7b80;});}else{return _0x5e7b80;}})[_0x27b7('0x44')](function(_0x6bd2f0){logger[_0x27b7('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x6bd2f0);throw _0x6bd2f0;});}return _0x5e7b80;})[_0x27b7('0x21')](respondWithResult(_0x1e0daf,0xc9))[_0x27b7('0x44')](handleError(_0x1e0daf,null));};exports[_0x27b7('0x4f')]=function(_0x2de778,_0x4aa0bd){if(_0x2de778['body']['id']){delete _0x2de778['body']['id'];}return db[_0x27b7('0x2c')]['find']({'where':{'id':_0x2de778[_0x27b7('0x50')]['id']}})[_0x27b7('0x21')](handleEntityNotFound(_0x4aa0bd,null))[_0x27b7('0x21')](saveUpdates(_0x2de778[_0x27b7('0x48')],null))['then'](respondWithResult(_0x4aa0bd,null))[_0x27b7('0x44')](handleError(_0x4aa0bd,null));};exports['destroy']=function(_0x42b294,_0x3f0b47){return db[_0x27b7('0x2c')][_0x27b7('0x46')]({'where':{'id':_0x42b294[_0x27b7('0x50')]['id']}})[_0x27b7('0x21')](handleEntityNotFound(_0x3f0b47,null))[_0x27b7('0x21')](removeEntity(_0x3f0b47,null))[_0x27b7('0x44')](handleError(_0x3f0b47,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index a020f0a..21aa15f 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 _0xd353=['path','../../config/environment','./variable.attributes','exports','define','Variable','lodash','util','api','moment'];(function(_0x445449,_0x4f9e76){var _0x1735a0=function(_0x38c191){while(--_0x38c191){_0x445449['push'](_0x445449['shift']());}};_0x1735a0(++_0x4f9e76);}(_0xd353,0x7e));var _0x3d35=function(_0x26ed16,_0x1040cb){_0x26ed16=_0x26ed16-0x0;var _0x4da028=_0xd353[_0x26ed16];return _0x4da028;};'use strict';var _=require(_0x3d35('0x0'));var util=require(_0x3d35('0x1'));var logger=require('../../config/logger')(_0x3d35('0x2'));var moment=require(_0x3d35('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3d35('0x4'));var rimraf=require('rimraf');var config=require(_0x3d35('0x5'));var attributes=require(_0x3d35('0x6'));module[_0x3d35('0x7')]=function(_0xb43971,_0x16965f){return _0xb43971[_0x3d35('0x8')](_0x3d35('0x9'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd882=['../../config/logger','api','moment','../../config/environment','./variable.attributes','exports','define','Variable','tools_variables','lodash'];(function(_0x37d3dc,_0x41e6f3){var _0xfbc6a8=function(_0x7ac1cd){while(--_0x7ac1cd){_0x37d3dc['push'](_0x37d3dc['shift']());}};_0xfbc6a8(++_0x41e6f3);}(_0xd882,0xd1));var _0x2d88=function(_0xa5e821,_0x4dd2f6){_0xa5e821=_0xa5e821-0x0;var _0x62d0cd=_0xd882[_0xa5e821];return _0x62d0cd;};'use strict';var _=require(_0x2d88('0x0'));var util=require('util');var logger=require(_0x2d88('0x1'))(_0x2d88('0x2'));var moment=require(_0x2d88('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(_0x2d88('0x4'));var attributes=require(_0x2d88('0x5'));module[_0x2d88('0x6')]=function(_0x29c0a0,_0x3f5fd4){return _0x29c0a0[_0x2d88('0x7')](_0x2d88('0x8'),attributes,{'tableName':_0x2d88('0x9'),'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 9b896fa..c3e2e89 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 _0x3ab3=['lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','Variable','find','options','raw','where','attributes','map','include','ShowVariable','debug'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x3ab3,0xd9));var _0x33ab=function(_0x1839fa,_0x2d18ba){_0x1839fa=_0x1839fa-0x0;var _0x599af0=_0x3ab3[_0x1839fa];return _0x599af0;};'use strict';var _=require(_0x33ab('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x33ab('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x33ab('0x2'));var db=require(_0x33ab('0x3'))['db'];var utils=require(_0x33ab('0x4'));var logger=require(_0x33ab('0x5'))(_0x33ab('0x6'));var config=require(_0x33ab('0x7'));var jayson=require(_0x33ab('0x8'));var client=jayson[_0x33ab('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x574e87,_0x161f9a,_0x39d327){return new BPromise(function(_0x2a4568,_0x24fe1b){return client[_0x33ab('0xa')](_0x574e87,_0x39d327)[_0x33ab('0xb')](function(_0x16982a){logger[_0x33ab('0xc')](_0x33ab('0xd'),_0x161f9a,_0x33ab('0xe'));logger['debug'](_0x33ab('0xf'),_0x161f9a,_0x33ab('0xe'),JSON[_0x33ab('0x10')](_0x16982a));if(_0x16982a['error']){if(_0x16982a[_0x33ab('0x11')][_0x33ab('0x12')]===0x1f4){logger[_0x33ab('0x11')](_0x33ab('0xd'),_0x161f9a,_0x16982a['error']['message']);return _0x24fe1b(_0x16982a['error'][_0x33ab('0x13')]);}logger[_0x33ab('0x11')](_0x33ab('0xd'),_0x161f9a,_0x16982a[_0x33ab('0x11')][_0x33ab('0x13')]);return _0x2a4568(_0x16982a[_0x33ab('0x11')][_0x33ab('0x13')]);}else{logger['info']('Variable,\x20%s,\x20%s',_0x161f9a,_0x33ab('0xe'));_0x2a4568(_0x16982a['result'][_0x33ab('0x13')]);}})[_0x33ab('0x14')](function(_0x3d101c){logger[_0x33ab('0x11')](_0x33ab('0xd'),_0x161f9a,_0x3d101c);_0x24fe1b(_0x3d101c);});});}exports['ShowVariable']=function(_0x5370aa){var _0x588642=this;return new Promise(function(_0x53a99a,_0x5ab676){return db[_0x33ab('0x15')][_0x33ab('0x16')]({'raw':_0x5370aa[_0x33ab('0x17')]?_0x5370aa[_0x33ab('0x17')][_0x33ab('0x18')]===undefined?!![]:![]:!![],'where':_0x5370aa[_0x33ab('0x17')]?_0x5370aa['options'][_0x33ab('0x19')]||null:null,'attributes':_0x5370aa[_0x33ab('0x17')]?_0x5370aa[_0x33ab('0x17')][_0x33ab('0x1a')]||null:null,'include':_0x5370aa[_0x33ab('0x17')]?_0x5370aa[_0x33ab('0x17')]['include']?_[_0x33ab('0x1b')](_0x5370aa['options'][_0x33ab('0x1c')],function(_0x3061d5){return{'model':db[_0x3061d5['model']],'as':_0x3061d5['as'],'attributes':_0x3061d5[_0x33ab('0x1a')],'include':_0x3061d5[_0x33ab('0x1c')]?_[_0x33ab('0x1b')](_0x3061d5[_0x33ab('0x1c')],function(_0x47301c){return{'model':db[_0x47301c['model']],'as':_0x47301c['as'],'attributes':_0x47301c[_0x33ab('0x1a')],'include':_0x47301c['include']?_[_0x33ab('0x1b')](_0x47301c[_0x33ab('0x1c')],function(_0x2dd541){return{'model':db[_0x2dd541['model']],'as':_0x2dd541['as'],'attributes':_0x2dd541[_0x33ab('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x33ab('0xb')](function(_0x219602){logger['info'](_0x33ab('0x1d'),_0x5370aa);logger[_0x33ab('0x1e')]('ShowVariable',_0x5370aa,JSON['stringify'](_0x219602));_0x53a99a(_0x219602);})['catch'](function(_0x799add){logger[_0x33ab('0x11')]('ShowVariable',_0x799add[_0x33ab('0x13')],_0x5370aa);_0x5ab676(_0x588642['error'](0x1f4,_0x799add['message']));});});}; \ No newline at end of file +var _0x9cc9=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowVariable','Variable','find','options','where','attributes','include','model','map','debug','lodash','util','moment'];(function(_0x1deee5,_0x1d4485){var _0x1d6c3a=function(_0x433abf){while(--_0x433abf){_0x1deee5['push'](_0x1deee5['shift']());}};_0x1d6c3a(++_0x1d4485);}(_0x9cc9,0xa7));var _0x99cc=function(_0x2a3a32,_0x4d1b72){_0x2a3a32=_0x2a3a32-0x0;var _0x33e455=_0x9cc9[_0x2a3a32];return _0x33e455;};'use strict';var _=require(_0x99cc('0x0'));var util=require(_0x99cc('0x1'));var moment=require(_0x99cc('0x2'));var BPromise=require(_0x99cc('0x3'));var rs=require(_0x99cc('0x4'));var fs=require('fs');var Redis=require(_0x99cc('0x5'));var db=require(_0x99cc('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x99cc('0x7'))(_0x99cc('0x8'));var config=require(_0x99cc('0x9'));var jayson=require(_0x99cc('0xa'));var client=jayson[_0x99cc('0xb')][_0x99cc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x14cb67,_0x9cb26e,_0x20c1a5){return new BPromise(function(_0x499215,_0x35dff1){return client[_0x99cc('0xd')](_0x14cb67,_0x20c1a5)[_0x99cc('0xe')](function(_0x2965c6){logger[_0x99cc('0xf')](_0x99cc('0x10'),_0x9cb26e,_0x99cc('0x11'));logger['debug']('Variable,\x20%s,\x20%s,\x20%s',_0x9cb26e,_0x99cc('0x11'),JSON[_0x99cc('0x12')](_0x2965c6));if(_0x2965c6['error']){if(_0x2965c6[_0x99cc('0x13')][_0x99cc('0x14')]===0x1f4){logger[_0x99cc('0x13')](_0x99cc('0x10'),_0x9cb26e,_0x2965c6[_0x99cc('0x13')]['message']);return _0x35dff1(_0x2965c6['error'][_0x99cc('0x15')]);}logger[_0x99cc('0x13')]('Variable,\x20%s,\x20%s',_0x9cb26e,_0x2965c6[_0x99cc('0x13')]['message']);return _0x499215(_0x2965c6[_0x99cc('0x13')]['message']);}else{logger['info'](_0x99cc('0x10'),_0x9cb26e,_0x99cc('0x11'));_0x499215(_0x2965c6[_0x99cc('0x16')][_0x99cc('0x15')]);}})[_0x99cc('0x17')](function(_0x23f64b){logger[_0x99cc('0x13')](_0x99cc('0x10'),_0x9cb26e,_0x23f64b);_0x35dff1(_0x23f64b);});});}exports[_0x99cc('0x18')]=function(_0x518ae3){var _0x5c09fa=this;return new Promise(function(_0x2c92b7,_0x8f69e5){return db[_0x99cc('0x19')][_0x99cc('0x1a')]({'raw':_0x518ae3[_0x99cc('0x1b')]?_0x518ae3[_0x99cc('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x518ae3['options']?_0x518ae3[_0x99cc('0x1b')][_0x99cc('0x1c')]||null:null,'attributes':_0x518ae3[_0x99cc('0x1b')]?_0x518ae3[_0x99cc('0x1b')][_0x99cc('0x1d')]||null:null,'include':_0x518ae3['options']?_0x518ae3[_0x99cc('0x1b')][_0x99cc('0x1e')]?_['map'](_0x518ae3['options'][_0x99cc('0x1e')],function(_0x55e187){return{'model':db[_0x55e187[_0x99cc('0x1f')]],'as':_0x55e187['as'],'attributes':_0x55e187[_0x99cc('0x1d')],'include':_0x55e187[_0x99cc('0x1e')]?_[_0x99cc('0x20')](_0x55e187[_0x99cc('0x1e')],function(_0x5f0d7b){return{'model':db[_0x5f0d7b[_0x99cc('0x1f')]],'as':_0x5f0d7b['as'],'attributes':_0x5f0d7b[_0x99cc('0x1d')],'include':_0x5f0d7b['include']?_['map'](_0x5f0d7b['include'],function(_0x2aaef7){return{'model':db[_0x2aaef7['model']],'as':_0x2aaef7['as'],'attributes':_0x2aaef7[_0x99cc('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x99cc('0xe')](function(_0x3e12a1){logger['info'](_0x99cc('0x18'),_0x518ae3);logger[_0x99cc('0x21')](_0x99cc('0x18'),_0x518ae3,JSON[_0x99cc('0x12')](_0x3e12a1));_0x2c92b7(_0x3e12a1);})[_0x99cc('0x17')](function(_0x5dac8c){logger['error'](_0x99cc('0x18'),_0x5dac8c[_0x99cc('0x15')],_0x518ae3);_0x8f69e5(_0x5c09fa[_0x99cc('0x13')](0x1f4,_0x5dac8c[_0x99cc('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 6f41914..730e473 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 _0x2ba4=['/restart','restart','migrations','exports','express','Router','../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated','canUpdate','fetch','/reset','reset','/pull','pull'];(function(_0x12c50f,_0x29be50){var _0x36dc8e=function(_0x283fad){while(--_0x283fad){_0x12c50f['push'](_0x12c50f['shift']());}};_0x36dc8e(++_0x29be50);}(_0x2ba4,0x148));var _0x42ba=function(_0x81e32c,_0x40fb99){_0x81e32c=_0x81e32c-0x0;var _0xf2a4ba=_0x2ba4[_0x81e32c];return _0xf2a4ba;};'use strict';var express=require(_0x42ba('0x0'));var router=express[_0x42ba('0x1')]();var auth=require(_0x42ba('0x2'));var controller=require(_0x42ba('0x3'));router[_0x42ba('0x4')]('/',controller[_0x42ba('0x5')]);router[_0x42ba('0x4')](_0x42ba('0x6'),auth[_0x42ba('0x7')](),auth[_0x42ba('0x8')](),controller[_0x42ba('0x9')]);router['get'](_0x42ba('0xa'),auth['isAuthenticated'](),auth[_0x42ba('0x8')](),controller[_0x42ba('0xb')]);router[_0x42ba('0x4')](_0x42ba('0xc'),auth[_0x42ba('0x7')](),auth[_0x42ba('0x8')](),controller[_0x42ba('0xd')]);router[_0x42ba('0x4')](_0x42ba('0xe'),auth[_0x42ba('0x7')](),controller[_0x42ba('0xf')]);router[_0x42ba('0x4')]('/migrations',controller[_0x42ba('0x10')]);module[_0x42ba('0x11')]=router; \ No newline at end of file +var _0x95c8=['migrations','exports','express','Router','./version.controller','get','index','/fetch','fetch','/reset','canUpdate','reset','isAuthenticated','restart'];(function(_0x4a0ad7,_0x64b2){var _0x423f0b=function(_0x34e0dd){while(--_0x34e0dd){_0x4a0ad7['push'](_0x4a0ad7['shift']());}};_0x423f0b(++_0x64b2);}(_0x95c8,0x128));var _0x895c=function(_0x5c4a17,_0x243b1b){_0x5c4a17=_0x5c4a17-0x0;var _0x233226=_0x95c8[_0x5c4a17];return _0x233226;};'use strict';var express=require(_0x895c('0x0'));var router=express[_0x895c('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x895c('0x2'));router[_0x895c('0x3')]('/',controller[_0x895c('0x4')]);router['get'](_0x895c('0x5'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x895c('0x6')]);router[_0x895c('0x3')](_0x895c('0x7'),auth['isAuthenticated'](),auth[_0x895c('0x8')](),controller[_0x895c('0x9')]);router[_0x895c('0x3')]('/pull',auth['isAuthenticated'](),auth[_0x895c('0x8')](),controller['pull']);router[_0x895c('0x3')]('/restart',auth[_0x895c('0xa')](),controller[_0x895c('0xb')]);router[_0x895c('0x3')]('/migrations',controller[_0x895c('0xc')]);module[_0x895c('0xd')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index cd4201d..6c2d43e 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 _0xc7da=['git\x20reset\x20--hard\x20FETCH_HEAD','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','length','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.','server','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','join','catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','version','compare-versions','exec','../../mysqldb','../../config/pm2','../../config/logger','update','simple-git','root','index','exports','query','latest','tags','2.0.0','json','status','fetch','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','--hard','FETCH_HEAD'];(function(_0x5734e1,_0x3e1d75){var _0x22c784=function(_0x4fe1eb){while(--_0x4fe1eb){_0x5734e1['push'](_0x5734e1['shift']());}};_0x22c784(++_0x3e1d75);}(_0xc7da,0xf2));var _0xac7d=function(_0x1ccced,_0x4b99b6){_0x1ccced=_0x1ccced-0x0;var _0x3ec8bf=_0xc7da[_0x1ccced];return _0x3ec8bf;};'use strict';var Umzug=require(_0xac7d('0x0'));var path=require(_0xac7d('0x1'));var fs=require('fs');var _=require(_0xac7d('0x2'));var pkginfo=require('pkginfo')(module,_0xac7d('0x3'));var compareVersions=require(_0xac7d('0x4'));var exec=require('child_process')[_0xac7d('0x5')];var db=require(_0xac7d('0x6'))['db'];var config=require('../../config/environment');var pm2=require(_0xac7d('0x7'));var logger=require(_0xac7d('0x8'))(_0xac7d('0x9'));var git=require(_0xac7d('0xa'))(config[_0xac7d('0xb')]);exports[_0xac7d('0xc')]=function(_0x48ca59,_0x44eb2b){var _0x457e2d={'current':module[_0xac7d('0xd')][_0xac7d('0x3')],'phonebar':0x2};if(_0x48ca59[_0xac7d('0xe')]&&_0x48ca59[_0xac7d('0xe')][_0xac7d('0xf')]){return git['fetch']()[_0xac7d('0x10')](function(_0x2fd75b,_0x3eaee6){_0x457e2d['latest']=(_0x2fd75b?module[_0xac7d('0xd')][_0xac7d('0x3')]:_0x3eaee6[_0xac7d('0xf')])||_0xac7d('0x11');return _0x44eb2b['status'](0xc8)[_0xac7d('0x12')](_0x457e2d);});}else{return _0x44eb2b[_0xac7d('0x13')](0xc8)[_0xac7d('0x12')](_0x457e2d);}};exports[_0xac7d('0x14')]=function(_0x17ff89,_0x5678d7){return git[_0xac7d('0x14')](['origin',_0xac7d('0x15')],function(_0x425235){if(_0x425235){logger[_0xac7d('0x16')](_0x425235);return _0x5678d7[_0xac7d('0x13')](0x1f4)['json'](_0x425235);}logger[_0xac7d('0x17')](_0xac7d('0x18'));return _0x5678d7[_0xac7d('0x13')](0xc8)[_0xac7d('0x12')]({'output':_0xac7d('0x19')});});};exports['reset']=function(_0x7df8e0,_0x3cb12d){return git['reset']([_0xac7d('0x1a'),_0xac7d('0x1b')],function(_0x170704){if(_0x170704){logger[_0xac7d('0x16')](_0x170704);return _0x3cb12d['status'](0x1f4)[_0xac7d('0x12')](_0x170704);}logger[_0xac7d('0x17')](_0xac7d('0x1c'));return _0x3cb12d['status'](0xc8)[_0xac7d('0x12')]({'output':'git\x20reset\x20--hard'});});};exports[_0xac7d('0x1d')]=function(_0x3eedf8,_0x3ffdac){exec(_0xac7d('0x1e'),function(_0x321689,_0x365269,_0x5a006e){logger['info'](_0x365269);logger[_0xac7d('0x17')](_0x5a006e);if(_0x321689){logger[_0xac7d('0x16')](_0x321689);return _0x3ffdac['status'](0x1f4)[_0xac7d('0x12')](_0x321689);}return _0x3ffdac[_0xac7d('0x13')](0xc8)[_0xac7d('0x12')]({'output':_0x365269});});};exports[_0xac7d('0x1f')]=function(_0x43aa8e,_0xc8a7f0){return pm2[_0xac7d('0x1f')](_0xac7d('0x20'))[_0xac7d('0x21')](function(_0x26a8c4){logger['info'](_0xac7d('0x22'),_0x26a8c4);return _0xc8a7f0[_0xac7d('0x13')](0xc8)[_0xac7d('0x12')]({'output':_0xac7d('0x23')});})['catch'](function(_0x579b99){logger['error'](_0x579b99);return _0xc8a7f0[_0xac7d('0x13')](0x1f4)[_0xac7d('0x12')](_0x579b99);});};exports[_0xac7d('0x24')]=function(_0x5bd39b,_0x51df23){var _0x506b88=fs['readdirSync'](path['join'](config['root'],'server',_0xac7d('0x24')));var _0x1109b1=[];for(var _0x35be2f=0x0;_0x35be2f<_0x506b88[_0xac7d('0x25')];_0x35be2f++){var _0x15a950=_0x506b88[_0x35be2f]['replace']('.js','');if(compareVersions(module[_0xac7d('0xd')][_0xac7d('0x3')],_0x15a950)===-0x1){_0x1109b1[_0xac7d('0x26')](_0x15a950);}}if(_0x1109b1[_0xac7d('0x25')]){var _0x39dc77=_0x1109b1[_0xac7d('0x27')](compareVersions);var _0x3ba58d=new Umzug({'storage':_0xac7d('0x28'),'storageOptions':{'model':db[_0xac7d('0x29')],'modelName':_0xac7d('0x29'),'columnName':_0xac7d('0x3')},'migrations':{'params':[db[_0xac7d('0x28')][_0xac7d('0x2a')](),db[_0xac7d('0x28')][_0xac7d('0x2b')],function(){throw new Error(_0xac7d('0x2c'));}],'path':path['join'](config[_0xac7d('0xb')],_0xac7d('0x2d'),_0xac7d('0x24')),'pattern':/\.js$/}});_0x3ba58d['up']({'migrations':_[_0xac7d('0x2e')](_0x39dc77,function(_0x204717){return _0x204717+'.js';})})[_0xac7d('0x21')](function(){return _0x51df23['status'](0xc8)['json']({'output':_0xac7d('0x2f')+module[_0xac7d('0xd')][_0xac7d('0x3')]+_0xac7d('0x30')+_[_0xac7d('0x31')](_0x39dc77),'migrations':_[_0xac7d('0x32')](_0x39dc77)});})[_0xac7d('0x33')](function(_0x1e48df){if(_0x1e48df instanceof db[_0xac7d('0x28')][_0xac7d('0x34')]){return _0x51df23[_0xac7d('0x13')](0xc8)['json']({'output':'Database\x20already\x20up-to-date'});}else{return _0x51df23[_0xac7d('0x13')](0x1f4)['json'](_0x1e48df);}});}else{return _0x51df23[_0xac7d('0x13')](0xc8)[_0xac7d('0x12')]({'output':_0xac7d('0x35')});}}; \ No newline at end of file +var _0x5f7b=['getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','server','map','.js','then','Database\x20migrated\x20successfully\x20from\x20version\x20','last','catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/logger','simple-git','root','exports','query','latest','fetch','tags','json','status','origin','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','pm2\x20restart\x20motion\x20%s','migrations','readdirSync','join','length','replace','sort','sequelize'];(function(_0x10cb68,_0x3f36a8){var _0x1ae083=function(_0x38d13e){while(--_0x38d13e){_0x10cb68['push'](_0x10cb68['shift']());}};_0x1ae083(++_0x3f36a8);}(_0x5f7b,0x14a));var _0xb5f7=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x5f7b[_0x27af45];return _0x18df21;};'use strict';var Umzug=require(_0xb5f7('0x0'));var path=require(_0xb5f7('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0xb5f7('0x2'))(module,_0xb5f7('0x3'));var compareVersions=require(_0xb5f7('0x4'));var exec=require(_0xb5f7('0x5'))[_0xb5f7('0x6')];var db=require(_0xb5f7('0x7'))['db'];var config=require(_0xb5f7('0x8'));var pm2=require('../../config/pm2');var logger=require(_0xb5f7('0x9'))('update');var git=require(_0xb5f7('0xa'))(config[_0xb5f7('0xb')]);exports['index']=function(_0x3087a5,_0x2d49ba){var _0x4e09dd={'current':module[_0xb5f7('0xc')][_0xb5f7('0x3')],'phonebar':0x2};if(_0x3087a5[_0xb5f7('0xd')]&&_0x3087a5[_0xb5f7('0xd')][_0xb5f7('0xe')]){return git[_0xb5f7('0xf')]()[_0xb5f7('0x10')](function(_0x4d88a7,_0x2f20db){_0x4e09dd['latest']=(_0x4d88a7?module['exports'][_0xb5f7('0x3')]:_0x2f20db[_0xb5f7('0xe')])||'2.0.0';return _0x2d49ba['status'](0xc8)[_0xb5f7('0x11')](_0x4e09dd);});}else{return _0x2d49ba[_0xb5f7('0x12')](0xc8)[_0xb5f7('0x11')](_0x4e09dd);}};exports[_0xb5f7('0xf')]=function(_0xc790ad,_0x5168fa){return git[_0xb5f7('0xf')]([_0xb5f7('0x13'),_0xb5f7('0x14')],function(_0x375815){if(_0x375815){logger[_0xb5f7('0x15')](_0x375815);return _0x5168fa[_0xb5f7('0x12')](0x1f4)['json'](_0x375815);}logger[_0xb5f7('0x16')](_0xb5f7('0x17'));return _0x5168fa['status'](0xc8)[_0xb5f7('0x11')]({'output':_0xb5f7('0x18')});});};exports['reset']=function(_0x4e76bb,_0x286b7f){return git[_0xb5f7('0x19')](['--hard',_0xb5f7('0x1a')],function(_0x2b3f7a){if(_0x2b3f7a){logger[_0xb5f7('0x15')](_0x2b3f7a);return _0x286b7f[_0xb5f7('0x12')](0x1f4)[_0xb5f7('0x11')](_0x2b3f7a);}logger[_0xb5f7('0x16')](_0xb5f7('0x1b'));return _0x286b7f[_0xb5f7('0x12')](0xc8)['json']({'output':_0xb5f7('0x1c')});});};exports[_0xb5f7('0x1d')]=function(_0x27a320,_0x44a6c9){exec(_0xb5f7('0x1e'),function(_0x3be337,_0x59ce1e,_0x45d9ef){logger['info'](_0x59ce1e);logger[_0xb5f7('0x16')](_0x45d9ef);if(_0x3be337){logger[_0xb5f7('0x15')](_0x3be337);return _0x44a6c9['status'](0x1f4)[_0xb5f7('0x11')](_0x3be337);}return _0x44a6c9['status'](0xc8)[_0xb5f7('0x11')]({'output':_0x59ce1e});});};exports[_0xb5f7('0x1f')]=function(_0x3f4d70,_0x4d3bbc){return pm2[_0xb5f7('0x1f')](_0xb5f7('0x20'))['then'](function(_0x43fdf4){logger[_0xb5f7('0x16')](_0xb5f7('0x21'),_0x43fdf4);return _0x4d3bbc[_0xb5f7('0x12')](0xc8)[_0xb5f7('0x11')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})['catch'](function(_0x2c4d35){logger[_0xb5f7('0x15')](_0x2c4d35);return _0x4d3bbc[_0xb5f7('0x12')](0x1f4)[_0xb5f7('0x11')](_0x2c4d35);});};exports[_0xb5f7('0x22')]=function(_0x26fd7e,_0x35f8fc){var _0x4b9575=fs[_0xb5f7('0x23')](path[_0xb5f7('0x24')](config[_0xb5f7('0xb')],'server','migrations'));var _0x33e2c1=[];for(var _0x1fec8e=0x0;_0x1fec8e<_0x4b9575[_0xb5f7('0x25')];_0x1fec8e++){var _0xf8e211=_0x4b9575[_0x1fec8e][_0xb5f7('0x26')]('.js','');if(compareVersions(module[_0xb5f7('0xc')][_0xb5f7('0x3')],_0xf8e211)===-0x1){_0x33e2c1['push'](_0xf8e211);}}if(_0x33e2c1[_0xb5f7('0x25')]){var _0x24a71e=_0x33e2c1[_0xb5f7('0x27')](compareVersions);var _0x54c173=new Umzug({'storage':_0xb5f7('0x28'),'storageOptions':{'model':db['Migration'],'modelName':'Migration','columnName':_0xb5f7('0x3')},'migrations':{'params':[db[_0xb5f7('0x28')][_0xb5f7('0x29')](),db['sequelize'][_0xb5f7('0x2a')],function(){throw new Error(_0xb5f7('0x2b'));}],'path':path[_0xb5f7('0x24')](config['root'],_0xb5f7('0x2c'),_0xb5f7('0x22')),'pattern':/\.js$/}});_0x54c173['up']({'migrations':_[_0xb5f7('0x2d')](_0x24a71e,function(_0x18b45c){return _0x18b45c+_0xb5f7('0x2e');})})[_0xb5f7('0x2f')](function(){return _0x35f8fc['status'](0xc8)[_0xb5f7('0x11')]({'output':_0xb5f7('0x30')+module[_0xb5f7('0xc')][_0xb5f7('0x3')]+'\x20to\x20'+_[_0xb5f7('0x31')](_0x24a71e),'migrations':_[_0xb5f7('0x24')](_0x24a71e)});})[_0xb5f7('0x32')](function(_0x32549a){if(_0x32549a instanceof db[_0xb5f7('0x28')][_0xb5f7('0x33')]){return _0x35f8fc['status'](0xc8)[_0xb5f7('0x11')]({'output':_0xb5f7('0x34')});}else{return _0x35f8fc[_0xb5f7('0x12')](0x1f4)[_0xb5f7('0x11')](_0x32549a);}});}else{return _0x35f8fc[_0xb5f7('0x12')](0xc8)['json']({'output':_0xb5f7('0x34')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index c8b20bc..bc224b4 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 _0xfdc3=['./voiceAgentReport.controller','get','isAuthenticated','index','/describe','show','post','create','/:id','delete','exports','multer','util','path','connect-timeout','../../components/auth/service','../../config/environment'];(function(_0x4b6070,_0x504673){var _0x446c0a=function(_0x37684c){while(--_0x37684c){_0x4b6070['push'](_0x4b6070['shift']());}};_0x446c0a(++_0x504673);}(_0xfdc3,0xa4));var _0x3fdc=function(_0x424edf,_0x184352){_0x424edf=_0x424edf-0x0;var _0xe9b044=_0xfdc3[_0x424edf];return _0xe9b044;};'use strict';var multer=require(_0x3fdc('0x0'));var util=require(_0x3fdc('0x1'));var path=require(_0x3fdc('0x2'));var timeout=require(_0x3fdc('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x3fdc('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3fdc('0x5'));var controller=require(_0x3fdc('0x6'));router[_0x3fdc('0x7')]('/',auth[_0x3fdc('0x8')](),controller[_0x3fdc('0x9')]);router[_0x3fdc('0x7')](_0x3fdc('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x3fdc('0x7')]('/:id',auth[_0x3fdc('0x8')](),controller[_0x3fdc('0xb')]);router[_0x3fdc('0xc')]('/',auth[_0x3fdc('0x8')](),controller[_0x3fdc('0xd')]);router['put'](_0x3fdc('0xe'),auth[_0x3fdc('0x8')](),controller['update']);router[_0x3fdc('0xf')](_0x3fdc('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x3fdc('0x10')]=router; \ No newline at end of file +var _0x59e7=['/:id','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','get','isAuthenticated','index','/describe','describe'];(function(_0x5b5207,_0x3d9dcf){var _0x472745=function(_0x5a3d5c){while(--_0x5a3d5c){_0x5b5207['push'](_0x5b5207['shift']());}};_0x472745(++_0x3d9dcf);}(_0x59e7,0xc5));var _0x759e=function(_0x1169c1,_0x5458f0){_0x1169c1=_0x1169c1-0x0;var _0x281a50=_0x59e7[_0x1169c1];return _0x281a50;};'use strict';var multer=require(_0x759e('0x0'));var util=require(_0x759e('0x1'));var path=require(_0x759e('0x2'));var timeout=require(_0x759e('0x3'));var express=require(_0x759e('0x4'));var router=express[_0x759e('0x5')]();var auth=require(_0x759e('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceAgentReport.controller');router[_0x759e('0x7')]('/',auth[_0x759e('0x8')](),controller[_0x759e('0x9')]);router['get'](_0x759e('0xa'),auth[_0x759e('0x8')](),controller[_0x759e('0xb')]);router[_0x759e('0x7')](_0x759e('0xc'),auth[_0x759e('0x8')](),controller['show']);router[_0x759e('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x759e('0xe')](_0x759e('0xc'),auth[_0x759e('0x8')](),controller[_0x759e('0xf')]);router[_0x759e('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x759e('0x11')]);module[_0x759e('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 34448e2..153eaec 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 _0x326f=['STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize'];(function(_0x4e4482,_0x49bb5d){var _0x375965=function(_0x2fdfd7){while(--_0x2fdfd7){_0x4e4482['push'](_0x4e4482['shift']());}};_0x375965(++_0x49bb5d);}(_0x326f,0xd1));var _0xf326=function(_0x1c9543,_0x163ab2){_0x1c9543=_0x1c9543-0x0;var _0x3ade4d=_0x326f[_0x1c9543];return _0x3ade4d;};'use strict';var Sequelize=require(_0xf326('0x0'));module['exports']={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xf326('0x1')]},'calleridnum':{'type':Sequelize[_0xf326('0x1')]},'calleridname':{'type':Sequelize[_0xf326('0x1')]},'queue':{'type':Sequelize[_0xf326('0x1')]},'interface':{'type':Sequelize[_0xf326('0x1')]},'membername':{'type':Sequelize[_0xf326('0x1')]},'agentcalledAt':{'type':Sequelize[_0xf326('0x2')]},'agentconnectAt':{'type':Sequelize[_0xf326('0x2')]},'agentcompleteAt':{'type':Sequelize[_0xf326('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0xf326('0x2')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xf326('0x3')]},'agentcomplete':{'type':Sequelize[_0xf326('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xf326('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xf326('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xf326('0x1')]},'lastevent':{'type':Sequelize[_0xf326('0x1')]},'channel':{'type':Sequelize[_0xf326('0x1')]},'channelstate':{'type':Sequelize[_0xf326('0x3')]},'channelstatedesc':{'type':Sequelize[_0xf326('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xf326('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xf326('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xf326('0x1')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xf326('0x1')]},'destchannelstate':{'type':Sequelize[_0xf326('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xf326('0x1')]},'destcalleridname':{'type':Sequelize[_0xf326('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xf326('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xf326('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xf326('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xf326('0x1')]},'destuniqueid':{'type':Sequelize[_0xf326('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xf326('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0xf326('0x1')]},'transfer':{'type':Sequelize[_0xf326('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xf326('0x1')],'comment':_0xf326('0x5')},'transferexten':{'type':Sequelize[_0xf326('0x1')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0xf326('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x425d=['sequelize','STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x308de9,_0x1b4dc7){var _0x13891a=function(_0x4ef7fb){while(--_0x4ef7fb){_0x308de9['push'](_0x308de9['shift']());}};_0x13891a(++_0x1b4dc7);}(_0x425d,0x1e0));var _0xd425=function(_0x2bbe8d,_0x5156c2){_0x2bbe8d=_0x2bbe8d-0x0;var _0x539e7a=_0x425d[_0x2bbe8d];return _0x539e7a;};'use strict';var Sequelize=require(_0xd425('0x0'));module['exports']={'type':{'type':Sequelize[_0xd425('0x1')]},'uniqueid':{'type':Sequelize[_0xd425('0x1')]},'calleridnum':{'type':Sequelize[_0xd425('0x1')]},'calleridname':{'type':Sequelize[_0xd425('0x1')]},'queue':{'type':Sequelize[_0xd425('0x1')]},'interface':{'type':Sequelize[_0xd425('0x1')]},'membername':{'type':Sequelize[_0xd425('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xd425('0x2')]},'agentcompleteAt':{'type':Sequelize[_0xd425('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0xd425('0x2')]},'agentdumpAt':{'type':Sequelize[_0xd425('0x2')]},'holdtime':{'type':Sequelize[_0xd425('0x3')]},'agentcomplete':{'type':Sequelize[_0xd425('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xd425('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xd425('0x3')]},'agentacw':{'type':Sequelize[_0xd425('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xd425('0x3')]},'reason':{'type':Sequelize[_0xd425('0x1')]},'lastevent':{'type':Sequelize[_0xd425('0x1')]},'channel':{'type':Sequelize[_0xd425('0x1')]},'channelstate':{'type':Sequelize[_0xd425('0x3')]},'channelstatedesc':{'type':Sequelize[_0xd425('0x1')]},'connectedlinenum':{'type':Sequelize[_0xd425('0x1')]},'connectedlinename':{'type':Sequelize[_0xd425('0x1')]},'language':{'type':Sequelize[_0xd425('0x1')]},'accountcode':{'type':Sequelize[_0xd425('0x1')]},'context':{'type':Sequelize[_0xd425('0x1')]},'exten':{'type':Sequelize[_0xd425('0x1')]},'priority':{'type':Sequelize[_0xd425('0x1')]},'destchannel':{'type':Sequelize[_0xd425('0x1')]},'destchannelstate':{'type':Sequelize[_0xd425('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xd425('0x1')]},'destcalleridnum':{'type':Sequelize[_0xd425('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xd425('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xd425('0x1')]},'destlanguage':{'type':Sequelize[_0xd425('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xd425('0x1')]},'destexten':{'type':Sequelize[_0xd425('0x1')]},'destpriority':{'type':Sequelize[_0xd425('0x1')]},'destuniqueid':{'type':Sequelize[_0xd425('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xd425('0x1')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0xd425('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xd425('0x1')],'comment':_0xd425('0x5')},'transferexten':{'type':Sequelize[_0xd425('0x1')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0xd425('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 4afe5c6..8f20bd0 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 _0x3788=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','Content-Range','reject','update','then','destroy','end','error','stack','name','send','index','map','VoiceAgentReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','create','body','find','describe','html-pdf','eml-format','rimraf'];(function(_0x126908,_0x4b9ab9){var _0x3c6b8b=function(_0x45374e){while(--_0x45374e){_0x126908['push'](_0x126908['shift']());}};_0x3c6b8b(++_0x4b9ab9);}(_0x3788,0x11d));var _0x8378=function(_0x1f2c39,_0x66d502){_0x1f2c39=_0x1f2c39-0x0;var _0x15618c=_0x3788[_0x1f2c39];return _0x15618c;};'use strict';var pdf=require(_0x8378('0x0'));var emlformat=require(_0x8378('0x1'));var rimraf=require(_0x8378('0x2'));var zipdir=require(_0x8378('0x3'));var jsonpatch=require(_0x8378('0x4'));var rp=require(_0x8378('0x5'));var moment=require(_0x8378('0x6'));var BPromise=require(_0x8378('0x7'));var Mustache=require(_0x8378('0x8'));var util=require(_0x8378('0x9'));var path=require(_0x8378('0xa'));var sox=require('sox');var csv=require(_0x8378('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x8378('0xc'));var crypto=require(_0x8378('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8378('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8378('0xf'));var Papa=require(_0x8378('0x10'));var Redis=require(_0x8378('0x11'));var authService=require(_0x8378('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8378('0x13'));var logger=require(_0x8378('0x14'))(_0x8378('0x15'));var utils=require(_0x8378('0x16'));var config=require(_0x8378('0x17'));var db=require(_0x8378('0x18'))['db'];function respondWithStatusCode(_0x39d61e,_0x1852fe){_0x1852fe=_0x1852fe||0xcc;return function(_0xad0af2){if(_0xad0af2){return _0x39d61e[_0x8378('0x19')](_0x1852fe);}return _0x39d61e[_0x8378('0x1a')](_0x1852fe)['end']();};}function respondWithResult(_0xb2b957,_0x24ac1d){_0x24ac1d=_0x24ac1d||0xc8;return function(_0x1a6aba){if(_0x1a6aba){return _0xb2b957[_0x8378('0x1a')](_0x24ac1d)['json'](_0x1a6aba);}};}function respondWithFilteredResult(_0x20c4f4,_0x3b0dbe){return function(_0x476958){if(_0x476958){var _0x53da4a=_0x476958[_0x8378('0x1b')],_0x560c42=_0x3b0dbe['offset'],_0x24fd4=_0x3b0dbe[_0x8378('0x1c')]+_0x3b0dbe['limit'],_0x249145;if(_0x24fd4>=_0x53da4a){_0x24fd4=_0x53da4a;_0x249145=0xc8;}else{_0x249145=0xce;}_0x20c4f4['status'](_0x249145);return _0x20c4f4['set'](_0x8378('0x1d'),_0x560c42+'-'+_0x24fd4+'/'+_0x53da4a)['json'](_0x476958);}return null;};}function patchUpdates(_0x59d416){return function(_0x5ab006){try{jsonpatch['apply'](_0x5ab006,_0x59d416,!![]);}catch(_0x56cd6d){return BPromise[_0x8378('0x1e')](_0x56cd6d);}return _0x5ab006['save']();};}function saveUpdates(_0x27dc4f,_0x311fd6){return function(_0xdb8d56){if(_0xdb8d56){return _0xdb8d56[_0x8378('0x1f')](_0x27dc4f)[_0x8378('0x20')](function(_0x28ef1c){return _0x28ef1c;});}return null;};}function removeEntity(_0x50e0d5,_0x3ecef8){return function(_0x6e81b6){if(_0x6e81b6){return _0x6e81b6[_0x8378('0x21')]()[_0x8378('0x20')](function(){_0x50e0d5[_0x8378('0x1a')](0xcc)[_0x8378('0x22')]();});}};}function handleEntityNotFound(_0x2d582d,_0x5e3a79){return function(_0x3b3b77){if(!_0x3b3b77){_0x2d582d['sendStatus'](0x194);}return _0x3b3b77;};}function handleError(_0x789c6,_0x340db6){_0x340db6=_0x340db6||0x1f4;return function(_0x22e8ac){logger[_0x8378('0x23')](_0x22e8ac[_0x8378('0x24')]);if(_0x22e8ac[_0x8378('0x25')]){delete _0x22e8ac[_0x8378('0x25')];}_0x789c6[_0x8378('0x1a')](_0x340db6)[_0x8378('0x26')](_0x22e8ac);};}exports[_0x8378('0x27')]=function(_0x4ada5b,_0x575b61){var _0x3249cd={},_0x2ab5e3={},_0x3ad6f9={'count':0x0,'rows':[]};var _0x1d04e6=_[_0x8378('0x28')](db[_0x8378('0x29')][_0x8378('0x2a')],function(_0x349c9a){return{'name':_0x349c9a[_0x8378('0x2b')],'type':_0x349c9a[_0x8378('0x2c')][_0x8378('0x2d')]};});_0x2ab5e3[_0x8378('0x2e')]=_[_0x8378('0x28')](_0x1d04e6,_0x8378('0x25'));_0x2ab5e3[_0x8378('0x2f')]=_[_0x8378('0x30')](_0x4ada5b[_0x8378('0x2f')]);_0x2ab5e3[_0x8378('0x31')]=_[_0x8378('0x32')](_0x2ab5e3[_0x8378('0x2e')],_0x2ab5e3[_0x8378('0x2f')]);_0x3249cd['attributes']=_[_0x8378('0x32')](_0x2ab5e3['model'],qs[_0x8378('0x33')](_0x4ada5b[_0x8378('0x2f')]['fields']));_0x3249cd[_0x8378('0x34')]=_0x3249cd[_0x8378('0x34')][_0x8378('0x35')]?_0x3249cd[_0x8378('0x34')]:_0x2ab5e3[_0x8378('0x2e')];if(!_0x4ada5b[_0x8378('0x2f')][_0x8378('0x36')](_0x8378('0x37'))){_0x3249cd[_0x8378('0x38')]=qs['limit'](_0x4ada5b[_0x8378('0x2f')]['limit']);_0x3249cd[_0x8378('0x1c')]=qs[_0x8378('0x1c')](_0x4ada5b['query'][_0x8378('0x1c')]);}_0x3249cd['order']=qs[_0x8378('0x39')](_0x4ada5b[_0x8378('0x2f')][_0x8378('0x39')]);_0x3249cd[_0x8378('0x3a')]=qs[_0x8378('0x31')](_['pick'](_0x4ada5b[_0x8378('0x2f')],_0x2ab5e3[_0x8378('0x31')]));if(_0x4ada5b[_0x8378('0x2f')][_0x8378('0x3b')]){_0x3249cd[_0x8378('0x3a')]=_[_0x8378('0x3c')](_0x3249cd[_0x8378('0x3a')],{'$or':_[_0x8378('0x28')](_0x1d04e6,function(_0x177df0){if(_0x177df0[_0x8378('0x2c')]!==_0x8378('0x3d')){var _0x1f749e={};_0x1f749e[_0x177df0['name']]={'$like':'%'+_0x4ada5b[_0x8378('0x2f')]['filter']+'%'};return _0x1f749e;}})});}_0x3249cd=_[_0x8378('0x3c')]({},_0x3249cd,_0x4ada5b['options']);var _0x548715={'where':_0x3249cd['where']};return db[_0x8378('0x29')][_0x8378('0x1b')](_0x548715)[_0x8378('0x20')](function(_0x34a545){_0x3ad6f9['count']=_0x34a545;if(_0x4ada5b['query']['includeAll']){_0x3249cd[_0x8378('0x3e')]=[{'all':!![]}];}return db[_0x8378('0x29')][_0x8378('0x3f')](_0x3249cd);})[_0x8378('0x20')](function(_0x47dc2d){_0x3ad6f9[_0x8378('0x40')]=_0x47dc2d;return _0x3ad6f9;})[_0x8378('0x20')](respondWithFilteredResult(_0x575b61,_0x3249cd))[_0x8378('0x41')](handleError(_0x575b61,null));};exports[_0x8378('0x42')]=function(_0x314fc5,_0x232626){var _0x56d192={'raw':![],'where':{'id':_0x314fc5[_0x8378('0x43')]['id']}},_0xf25dca={};_0xf25dca[_0x8378('0x2e')]=_[_0x8378('0x30')](db['VoiceAgentReport'][_0x8378('0x2a')]);_0xf25dca[_0x8378('0x2f')]=_[_0x8378('0x30')](_0x314fc5['query']);_0xf25dca[_0x8378('0x31')]=_[_0x8378('0x32')](_0xf25dca[_0x8378('0x2e')],_0xf25dca[_0x8378('0x2f')]);_0x56d192[_0x8378('0x34')]=_[_0x8378('0x32')](_0xf25dca['model'],qs['fields'](_0x314fc5[_0x8378('0x2f')][_0x8378('0x33')]));_0x56d192['attributes']=_0x56d192[_0x8378('0x34')][_0x8378('0x35')]?_0x56d192[_0x8378('0x34')]:_0xf25dca['model'];if(_0x314fc5['query']['includeAll']){_0x56d192[_0x8378('0x3e')]=[{'all':!![]}];}_0x56d192=_[_0x8378('0x3c')]({},_0x56d192,_0x314fc5['options']);return db[_0x8378('0x29')]['find'](_0x56d192)[_0x8378('0x20')](handleEntityNotFound(_0x232626,null))[_0x8378('0x20')](respondWithResult(_0x232626,null))[_0x8378('0x41')](handleError(_0x232626,null));};exports[_0x8378('0x44')]=function(_0x4d7943,_0x556eb1){return db[_0x8378('0x29')][_0x8378('0x44')](_0x4d7943[_0x8378('0x45')],{})[_0x8378('0x20')](respondWithResult(_0x556eb1,0xc9))['catch'](handleError(_0x556eb1,null));};exports[_0x8378('0x1f')]=function(_0x48d7de,_0x3c3384){if(_0x48d7de[_0x8378('0x45')]['id']){delete _0x48d7de['body']['id'];}return db['VoiceAgentReport']['find']({'where':{'id':_0x48d7de[_0x8378('0x43')]['id']}})['then'](handleEntityNotFound(_0x3c3384,null))[_0x8378('0x20')](saveUpdates(_0x48d7de[_0x8378('0x45')],null))[_0x8378('0x20')](respondWithResult(_0x3c3384,null))[_0x8378('0x41')](handleError(_0x3c3384,null));};exports[_0x8378('0x21')]=function(_0xaf201f,_0x130355){return db[_0x8378('0x29')][_0x8378('0x46')]({'where':{'id':_0xaf201f[_0x8378('0x43')]['id']}})[_0x8378('0x20')](handleEntityNotFound(_0x130355,null))[_0x8378('0x20')](removeEntity(_0x130355,null))[_0x8378('0x41')](handleError(_0x130355,null));};exports[_0x8378('0x47')]=function(_0x576c18,_0x53ce18){return db[_0x8378('0x29')][_0x8378('0x47')]()[_0x8378('0x20')](respondWithResult(_0x53ce18,null))[_0x8378('0x41')](handleError(_0x53ce18,null));}; \ No newline at end of file +var _0x9f73=['params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','map','VoiceAgentReport','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','includeAll','findAll','rows','catch','rawAttributes','include','options','find','create','body'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0x9f73,0xd7));var _0x39f7=function(_0x1c2021,_0x44d3fd){_0x1c2021=_0x1c2021-0x0;var _0x65ce08=_0x9f73[_0x1c2021];return _0x65ce08;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x39f7('0x0'));var rimraf=require(_0x39f7('0x1'));var zipdir=require(_0x39f7('0x2'));var jsonpatch=require(_0x39f7('0x3'));var rp=require(_0x39f7('0x4'));var moment=require(_0x39f7('0x5'));var BPromise=require(_0x39f7('0x6'));var Mustache=require('mustache');var util=require(_0x39f7('0x7'));var path=require(_0x39f7('0x8'));var sox=require(_0x39f7('0x9'));var csv=require(_0x39f7('0xa'));var ejs=require(_0x39f7('0xb'));var fs=require('fs');var _=require(_0x39f7('0xc'));var squel=require('squel');var crypto=require(_0x39f7('0xd'));var jsforce=require(_0x39f7('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x39f7('0xf'));var Redis=require(_0x39f7('0x10'));var authService=require(_0x39f7('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x39f7('0x12'))(_0x39f7('0x13'));var utils=require('../../config/utils');var config=require(_0x39f7('0x14'));var db=require(_0x39f7('0x15'))['db'];function respondWithStatusCode(_0x10a558,_0x515c87){_0x515c87=_0x515c87||0xcc;return function(_0x2e0136){if(_0x2e0136){return _0x10a558[_0x39f7('0x16')](_0x515c87);}return _0x10a558[_0x39f7('0x17')](_0x515c87)[_0x39f7('0x18')]();};}function respondWithResult(_0x32154b,_0x15eaa1){_0x15eaa1=_0x15eaa1||0xc8;return function(_0x5c0018){if(_0x5c0018){return _0x32154b[_0x39f7('0x17')](_0x15eaa1)[_0x39f7('0x19')](_0x5c0018);}};}function respondWithFilteredResult(_0x3556c0,_0xe93399){return function(_0x415a2a){if(_0x415a2a){var _0x549f68=_0x415a2a[_0x39f7('0x1a')],_0x5101ef=_0xe93399[_0x39f7('0x1b')],_0x4cab46=_0xe93399[_0x39f7('0x1b')]+_0xe93399[_0x39f7('0x1c')],_0x83e576;if(_0x4cab46>=_0x549f68){_0x4cab46=_0x549f68;_0x83e576=0xc8;}else{_0x83e576=0xce;}_0x3556c0[_0x39f7('0x17')](_0x83e576);return _0x3556c0[_0x39f7('0x1d')](_0x39f7('0x1e'),_0x5101ef+'-'+_0x4cab46+'/'+_0x549f68)[_0x39f7('0x19')](_0x415a2a);}return null;};}function patchUpdates(_0x2ef774){return function(_0x3c5c30){try{jsonpatch[_0x39f7('0x1f')](_0x3c5c30,_0x2ef774,!![]);}catch(_0x31eb17){return BPromise[_0x39f7('0x20')](_0x31eb17);}return _0x3c5c30[_0x39f7('0x21')]();};}function saveUpdates(_0x1d4d27,_0x3f3f8b){return function(_0x219167){if(_0x219167){return _0x219167[_0x39f7('0x22')](_0x1d4d27)[_0x39f7('0x23')](function(_0x27844d){return _0x27844d;});}return null;};}function removeEntity(_0x21976f,_0x5d85e9){return function(_0x393e8b){if(_0x393e8b){return _0x393e8b[_0x39f7('0x24')]()[_0x39f7('0x23')](function(){_0x21976f[_0x39f7('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30371a,_0x10598b){return function(_0x2f6a20){if(!_0x2f6a20){_0x30371a[_0x39f7('0x16')](0x194);}return _0x2f6a20;};}function handleError(_0x2864fb,_0x2ec9cd){_0x2ec9cd=_0x2ec9cd||0x1f4;return function(_0x5d64bb){logger[_0x39f7('0x25')](_0x5d64bb['stack']);if(_0x5d64bb[_0x39f7('0x26')]){delete _0x5d64bb[_0x39f7('0x26')];}_0x2864fb['status'](_0x2ec9cd)[_0x39f7('0x27')](_0x5d64bb);};}exports['index']=function(_0x3c3e51,_0x394966){var _0xa2acc9={},_0x510269={},_0x29c098={'count':0x0,'rows':[]};var _0x3c3dbe=_[_0x39f7('0x28')](db[_0x39f7('0x29')]['rawAttributes'],function(_0x2a00ab){return{'name':_0x2a00ab['fieldName'],'type':_0x2a00ab[_0x39f7('0x2a')][_0x39f7('0x2b')]};});_0x510269['model']=_[_0x39f7('0x28')](_0x3c3dbe,'name');_0x510269[_0x39f7('0x2c')]=_['keys'](_0x3c3e51[_0x39f7('0x2c')]);_0x510269[_0x39f7('0x2d')]=_[_0x39f7('0x2e')](_0x510269[_0x39f7('0x2f')],_0x510269[_0x39f7('0x2c')]);_0xa2acc9['attributes']=_[_0x39f7('0x2e')](_0x510269[_0x39f7('0x2f')],qs[_0x39f7('0x30')](_0x3c3e51['query'][_0x39f7('0x30')]));_0xa2acc9[_0x39f7('0x31')]=_0xa2acc9[_0x39f7('0x31')][_0x39f7('0x32')]?_0xa2acc9[_0x39f7('0x31')]:_0x510269[_0x39f7('0x2f')];if(!_0x3c3e51[_0x39f7('0x2c')][_0x39f7('0x33')](_0x39f7('0x34'))){_0xa2acc9[_0x39f7('0x1c')]=qs['limit'](_0x3c3e51[_0x39f7('0x2c')][_0x39f7('0x1c')]);_0xa2acc9[_0x39f7('0x1b')]=qs['offset'](_0x3c3e51[_0x39f7('0x2c')]['offset']);}_0xa2acc9[_0x39f7('0x35')]=qs['sort'](_0x3c3e51['query'][_0x39f7('0x36')]);_0xa2acc9['where']=qs['filters'](_[_0x39f7('0x37')](_0x3c3e51[_0x39f7('0x2c')],_0x510269[_0x39f7('0x2d')]));if(_0x3c3e51[_0x39f7('0x2c')][_0x39f7('0x38')]){_0xa2acc9['where']=_['merge'](_0xa2acc9['where'],{'$or':_[_0x39f7('0x28')](_0x3c3dbe,function(_0x199ba7){if(_0x199ba7[_0x39f7('0x2a')]!=='VIRTUAL'){var _0x28d358={};_0x28d358[_0x199ba7[_0x39f7('0x26')]]={'$like':'%'+_0x3c3e51[_0x39f7('0x2c')][_0x39f7('0x38')]+'%'};return _0x28d358;}})});}_0xa2acc9=_[_0x39f7('0x39')]({},_0xa2acc9,_0x3c3e51['options']);var _0x77a75={'where':_0xa2acc9[_0x39f7('0x3a')]};return db[_0x39f7('0x29')]['count'](_0x77a75)[_0x39f7('0x23')](function(_0x2adb24){_0x29c098[_0x39f7('0x1a')]=_0x2adb24;if(_0x3c3e51['query'][_0x39f7('0x3b')]){_0xa2acc9['include']=[{'all':!![]}];}return db['VoiceAgentReport'][_0x39f7('0x3c')](_0xa2acc9);})[_0x39f7('0x23')](function(_0x2ff66f){_0x29c098[_0x39f7('0x3d')]=_0x2ff66f;return _0x29c098;})[_0x39f7('0x23')](respondWithFilteredResult(_0x394966,_0xa2acc9))[_0x39f7('0x3e')](handleError(_0x394966,null));};exports['show']=function(_0x54720b,_0x1a8272){var _0x5970e0={'raw':![],'where':{'id':_0x54720b['params']['id']}},_0x36af15={};_0x36af15[_0x39f7('0x2f')]=_['keys'](db[_0x39f7('0x29')][_0x39f7('0x3f')]);_0x36af15[_0x39f7('0x2c')]=_['keys'](_0x54720b[_0x39f7('0x2c')]);_0x36af15[_0x39f7('0x2d')]=_['intersection'](_0x36af15[_0x39f7('0x2f')],_0x36af15[_0x39f7('0x2c')]);_0x5970e0[_0x39f7('0x31')]=_[_0x39f7('0x2e')](_0x36af15[_0x39f7('0x2f')],qs[_0x39f7('0x30')](_0x54720b[_0x39f7('0x2c')][_0x39f7('0x30')]));_0x5970e0[_0x39f7('0x31')]=_0x5970e0['attributes'][_0x39f7('0x32')]?_0x5970e0[_0x39f7('0x31')]:_0x36af15['model'];if(_0x54720b['query'][_0x39f7('0x3b')]){_0x5970e0[_0x39f7('0x40')]=[{'all':!![]}];}_0x5970e0=_[_0x39f7('0x39')]({},_0x5970e0,_0x54720b[_0x39f7('0x41')]);return db['VoiceAgentReport'][_0x39f7('0x42')](_0x5970e0)['then'](handleEntityNotFound(_0x1a8272,null))[_0x39f7('0x23')](respondWithResult(_0x1a8272,null))[_0x39f7('0x3e')](handleError(_0x1a8272,null));};exports['create']=function(_0x15874c,_0x55764c){return db[_0x39f7('0x29')][_0x39f7('0x43')](_0x15874c[_0x39f7('0x44')],{})[_0x39f7('0x23')](respondWithResult(_0x55764c,0xc9))['catch'](handleError(_0x55764c,null));};exports['update']=function(_0x427dfe,_0x72cd64){if(_0x427dfe[_0x39f7('0x44')]['id']){delete _0x427dfe[_0x39f7('0x44')]['id'];}return db['VoiceAgentReport']['find']({'where':{'id':_0x427dfe[_0x39f7('0x45')]['id']}})[_0x39f7('0x23')](handleEntityNotFound(_0x72cd64,null))[_0x39f7('0x23')](saveUpdates(_0x427dfe[_0x39f7('0x44')],null))[_0x39f7('0x23')](respondWithResult(_0x72cd64,null))['catch'](handleError(_0x72cd64,null));};exports['destroy']=function(_0x7659c4,_0x2910c6){return db[_0x39f7('0x29')][_0x39f7('0x42')]({'where':{'id':_0x7659c4[_0x39f7('0x45')]['id']}})['then'](handleEntityNotFound(_0x2910c6,null))[_0x39f7('0x23')](removeEntity(_0x2910c6,null))['catch'](handleError(_0x2910c6,null));};exports[_0x39f7('0x46')]=function(_0x5b8351,_0x122140){return db['VoiceAgentReport']['describe']()[_0x39f7('0x23')](respondWithResult(_0x122140,null))['catch'](handleError(_0x122140,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index 9455235..5e78910 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 _0x0f9f=['rimraf','../../config/environment','./voiceAgentReport.attributes','VoiceAgentReport','report_agent','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4f979d,_0x1b0c05){var _0x39ec28=function(_0x592fcf){while(--_0x592fcf){_0x4f979d['push'](_0x4f979d['shift']());}};_0x39ec28(++_0x1b0c05);}(_0x0f9f,0xae));var _0xf0f9=function(_0x45cf7c,_0x49fed2){_0x45cf7c=_0x45cf7c-0x0;var _0x2a9193=_0x0f9f[_0x45cf7c];return _0x2a9193;};'use strict';var _=require(_0xf0f9('0x0'));var util=require(_0xf0f9('0x1'));var logger=require(_0xf0f9('0x2'))(_0xf0f9('0x3'));var moment=require(_0xf0f9('0x4'));var BPromise=require(_0xf0f9('0x5'));var rp=require(_0xf0f9('0x6'));var fs=require('fs');var path=require(_0xf0f9('0x7'));var rimraf=require(_0xf0f9('0x8'));var config=require(_0xf0f9('0x9'));var attributes=require(_0xf0f9('0xa'));module['exports']=function(_0xcc39d6,_0x4540a2){return _0xcc39d6['define'](_0xf0f9('0xb'),attributes,{'tableName':_0xf0f9('0xc'),'paranoid':![],'indexes':[{'fields':[_0xf0f9('0xd'),'destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x09f4=['VoiceAgentReport','report_agent','uniqueid','destuniqueid','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports'];(function(_0x89a743,_0x490387){var _0x52b7bb=function(_0x2c3296){while(--_0x2c3296){_0x89a743['push'](_0x89a743['shift']());}};_0x52b7bb(++_0x490387);}(_0x09f4,0xe4));var _0x409f=function(_0x35d210,_0xf33d3f){_0x35d210=_0x35d210-0x0;var _0x229fa7=_0x09f4[_0x35d210];return _0x229fa7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x409f('0x0'))(_0x409f('0x1'));var moment=require(_0x409f('0x2'));var BPromise=require(_0x409f('0x3'));var rp=require(_0x409f('0x4'));var fs=require('fs');var path=require(_0x409f('0x5'));var rimraf=require(_0x409f('0x6'));var config=require(_0x409f('0x7'));var attributes=require(_0x409f('0x8'));module[_0x409f('0x9')]=function(_0x2ca9ed,_0x4a17e8){return _0x2ca9ed['define'](_0x409f('0xa'),attributes,{'tableName':_0x409f('0xb'),'paranoid':![],'indexes':[{'fields':[_0x409f('0xc'),_0x409f('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 c637771..6ac0b57 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 _0xeffc=['body','options','raw','stringify','catch','update','then','UpdateVoiceAgentReport','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','VoiceAgentReport,\x20%s,\x20%s','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','CreateVoiceAgentReport','VoiceAgentReport','create'];(function(_0x210ffd,_0x217b82){var _0x3b4bbd=function(_0x55a24f){while(--_0x55a24f){_0x210ffd['push'](_0x210ffd['shift']());}};_0x3b4bbd(++_0x217b82);}(_0xeffc,0x128));var _0xceff=function(_0x364788,_0xb60e5e){_0x364788=_0x364788-0x0;var _0x314ac1=_0xeffc[_0x364788];return _0x314ac1;};'use strict';var _=require(_0xceff('0x0'));var util=require(_0xceff('0x1'));var moment=require('moment');var BPromise=require(_0xceff('0x2'));var rs=require(_0xceff('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xceff('0x4'))['db'];var utils=require(_0xceff('0x5'));var logger=require(_0xceff('0x6'))(_0xceff('0x7'));var config=require(_0xceff('0x8'));var jayson=require(_0xceff('0x9'));var client=jayson[_0xceff('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x439e2d,_0x5bf669,_0x2d0a2a){return new BPromise(function(_0x2324a1,_0x46d0f3){return client[_0xceff('0xb')](_0x439e2d,_0x2d0a2a)['then'](function(_0x5d5425){logger['info'](_0xceff('0xc'),_0x5bf669,'request\x20sent');logger[_0xceff('0xd')](_0xceff('0xe'),_0x5bf669,_0xceff('0xf'),JSON['stringify'](_0x5d5425));if(_0x5d5425[_0xceff('0x10')]){if(_0x5d5425[_0xceff('0x10')][_0xceff('0x11')]===0x1f4){logger['error'](_0xceff('0xc'),_0x5bf669,_0x5d5425[_0xceff('0x10')]['message']);return _0x46d0f3(_0x5d5425[_0xceff('0x10')]['message']);}logger['error'](_0xceff('0xc'),_0x5bf669,_0x5d5425[_0xceff('0x10')][_0xceff('0x12')]);return _0x2324a1(_0x5d5425['error'][_0xceff('0x12')]);}else{logger[_0xceff('0x13')](_0xceff('0xc'),_0x5bf669,'request\x20sent');_0x2324a1(_0x5d5425[_0xceff('0x14')]['message']);}})['catch'](function(_0x5390d1){logger['error'](_0xceff('0xc'),_0x5bf669,_0x5390d1);_0x46d0f3(_0x5390d1);});});}exports[_0xceff('0x15')]=function(_0x110ce0){var _0x468cb9=this;return new Promise(function(_0x346783,_0x2e930f){return db[_0xceff('0x16')][_0xceff('0x17')](_0x110ce0[_0xceff('0x18')],{'raw':_0x110ce0['options']?_0x110ce0[_0xceff('0x19')][_0xceff('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x47b2ce){logger[_0xceff('0x13')](_0xceff('0x15'),_0x110ce0);logger[_0xceff('0xd')](_0xceff('0x15'),_0x110ce0,JSON[_0xceff('0x1b')](_0x47b2ce));_0x346783(_0x47b2ce);})[_0xceff('0x1c')](function(_0x4e82d7){logger[_0xceff('0x10')]('CreateVoiceAgentReport',_0x4e82d7[_0xceff('0x12')],_0x110ce0);_0x2e930f(_0x468cb9[_0xceff('0x10')](0x1f4,_0x4e82d7[_0xceff('0x12')]));});});};exports['UpdateVoiceAgentReport']=function(_0x50b9af){var _0x10efbf=this;return new Promise(function(_0x346e15,_0x1da6ec){return db[_0xceff('0x16')][_0xceff('0x1d')](_0x50b9af[_0xceff('0x18')],{'raw':_0x50b9af[_0xceff('0x19')]?_0x50b9af[_0xceff('0x19')][_0xceff('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50b9af[_0xceff('0x19')]?_0x50b9af[_0xceff('0x19')]['where']||null:null,'attributes':_0x50b9af[_0xceff('0x19')]?_0x50b9af[_0xceff('0x19')]['attributes']||null:null,'limit':_0x50b9af[_0xceff('0x19')]?_0x50b9af[_0xceff('0x19')]['limit']||null:null})[_0xceff('0x1e')](function(_0x201859){logger[_0xceff('0x13')](_0xceff('0x1f'),_0x50b9af);logger[_0xceff('0xd')](_0xceff('0x1f'),_0x50b9af,JSON['stringify'](_0x201859));_0x346e15(_0x201859);})[_0xceff('0x1c')](function(_0x48e117){logger['error']('UpdateVoiceAgentReport',_0x48e117[_0xceff('0x12')],_0x50b9af);_0x1da6ec(_0x10efbf['error'](0x1f4,_0x48e117[_0xceff('0x12')]));});});}; \ No newline at end of file +var _0xed52=['raw','where','attributes','limit','lodash','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','UpdateVoiceAgentReport','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xed52,0x12d));var _0x2ed5=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0xed52[_0x54d4a8];return _0x3b321b;};'use strict';var _=require(_0x2ed5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2ed5('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2ed5('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x2ed5('0x3'));var logger=require(_0x2ed5('0x4'))('rpc');var config=require(_0x2ed5('0x5'));var jayson=require(_0x2ed5('0x6'));var client=jayson[_0x2ed5('0x7')][_0x2ed5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x45ed38,_0x2ff5dd,_0x264bc8){return new BPromise(function(_0xb152e2,_0x2205d5){return client[_0x2ed5('0x9')](_0x45ed38,_0x264bc8)[_0x2ed5('0xa')](function(_0x380d4d){logger['info'](_0x2ed5('0xb'),_0x2ff5dd,_0x2ed5('0xc'));logger[_0x2ed5('0xd')](_0x2ed5('0xe'),_0x2ff5dd,_0x2ed5('0xc'),JSON[_0x2ed5('0xf')](_0x380d4d));if(_0x380d4d[_0x2ed5('0x10')]){if(_0x380d4d['error'][_0x2ed5('0x11')]===0x1f4){logger[_0x2ed5('0x10')](_0x2ed5('0xb'),_0x2ff5dd,_0x380d4d[_0x2ed5('0x10')]['message']);return _0x2205d5(_0x380d4d[_0x2ed5('0x10')][_0x2ed5('0x12')]);}logger[_0x2ed5('0x10')](_0x2ed5('0xb'),_0x2ff5dd,_0x380d4d['error'][_0x2ed5('0x12')]);return _0xb152e2(_0x380d4d[_0x2ed5('0x10')][_0x2ed5('0x12')]);}else{logger[_0x2ed5('0x13')](_0x2ed5('0xb'),_0x2ff5dd,_0x2ed5('0xc'));_0xb152e2(_0x380d4d[_0x2ed5('0x14')][_0x2ed5('0x12')]);}})[_0x2ed5('0x15')](function(_0x18de24){logger[_0x2ed5('0x10')](_0x2ed5('0xb'),_0x2ff5dd,_0x18de24);_0x2205d5(_0x18de24);});});}exports[_0x2ed5('0x16')]=function(_0x130b5e){var _0x4c70e1=this;return new Promise(function(_0x3670a0,_0x4e3afe){return db[_0x2ed5('0x17')][_0x2ed5('0x18')](_0x130b5e[_0x2ed5('0x19')],{'raw':_0x130b5e[_0x2ed5('0x1a')]?_0x130b5e['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x37fada){logger['info'](_0x2ed5('0x16'),_0x130b5e);logger[_0x2ed5('0xd')]('CreateVoiceAgentReport',_0x130b5e,JSON['stringify'](_0x37fada));_0x3670a0(_0x37fada);})[_0x2ed5('0x15')](function(_0x560d30){logger[_0x2ed5('0x10')]('CreateVoiceAgentReport',_0x560d30['message'],_0x130b5e);_0x4e3afe(_0x4c70e1[_0x2ed5('0x10')](0x1f4,_0x560d30[_0x2ed5('0x12')]));});});};exports[_0x2ed5('0x1b')]=function(_0x49d1fe){var _0xf6789b=this;return new Promise(function(_0x5f476d,_0x25e97a){return db['VoiceAgentReport'][_0x2ed5('0x1c')](_0x49d1fe[_0x2ed5('0x19')],{'raw':_0x49d1fe[_0x2ed5('0x1a')]?_0x49d1fe[_0x2ed5('0x1a')][_0x2ed5('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x49d1fe[_0x2ed5('0x1a')]?_0x49d1fe['options'][_0x2ed5('0x1e')]||null:null,'attributes':_0x49d1fe[_0x2ed5('0x1a')]?_0x49d1fe[_0x2ed5('0x1a')][_0x2ed5('0x1f')]||null:null,'limit':_0x49d1fe[_0x2ed5('0x1a')]?_0x49d1fe[_0x2ed5('0x1a')][_0x2ed5('0x20')]||null:null})['then'](function(_0x584698){logger[_0x2ed5('0x13')](_0x2ed5('0x1b'),_0x49d1fe);logger[_0x2ed5('0xd')](_0x2ed5('0x1b'),_0x49d1fe,JSON[_0x2ed5('0xf')](_0x584698));_0x5f476d(_0x584698);})[_0x2ed5('0x15')](function(_0x2802fd){logger[_0x2ed5('0x10')](_0x2ed5('0x1b'),_0x2802fd[_0x2ed5('0x12')],_0x49d1fe);_0x25e97a(_0xf6789b[_0x2ed5('0x10')](0x1f4,_0x2802fd[_0x2ed5('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 3b840d4..7740123 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 _0x67c0=['update','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','isAuthenticated','index','/describe','describe','get','post','create','/:id'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0x67c0,0x1bb));var _0x067c=function(_0x137e4c,_0x4cd8cc){_0x137e4c=_0x137e4c-0x0;var _0x67faef=_0x67c0[_0x137e4c];return _0x67faef;};'use strict';var multer=require('multer');var util=require(_0x067c('0x0'));var path=require(_0x067c('0x1'));var timeout=require(_0x067c('0x2'));var express=require(_0x067c('0x3'));var router=express[_0x067c('0x4')]();var auth=require(_0x067c('0x5'));var interaction=require(_0x067c('0x6'));var config=require(_0x067c('0x7'));var controller=require(_0x067c('0x8'));router['get']('/',auth[_0x067c('0x9')](),controller[_0x067c('0xa')]);router['get'](_0x067c('0xb'),auth[_0x067c('0x9')](),controller[_0x067c('0xc')]);router[_0x067c('0xd')]('/:id',auth[_0x067c('0x9')](),controller['show']);router[_0x067c('0xe')]('/',auth[_0x067c('0x9')](),controller[_0x067c('0xf')]);router['put'](_0x067c('0x10'),auth[_0x067c('0x9')](),controller[_0x067c('0x11')]);router[_0x067c('0x12')]('/:id',auth[_0x067c('0x9')](),controller[_0x067c('0x13')]);module['exports']=router; \ No newline at end of file +var _0x434e=['create','put','update','destroy','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post'];(function(_0x519b97,_0x489579){var _0x360510=function(_0x5d6d90){while(--_0x5d6d90){_0x519b97['push'](_0x519b97['shift']());}};_0x360510(++_0x489579);}(_0x434e,0x1bc));var _0xe434=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x434e[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0xe434('0x0'));var util=require(_0xe434('0x1'));var path=require(_0xe434('0x2'));var timeout=require(_0xe434('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xe434('0x4'));var interaction=require(_0xe434('0x5'));var config=require(_0xe434('0x6'));var controller=require(_0xe434('0x7'));router[_0xe434('0x8')]('/',auth['isAuthenticated'](),controller[_0xe434('0x9')]);router[_0xe434('0x8')](_0xe434('0xa'),auth[_0xe434('0xb')](),controller[_0xe434('0xc')]);router[_0xe434('0x8')](_0xe434('0xd'),auth[_0xe434('0xb')](),controller[_0xe434('0xe')]);router[_0xe434('0xf')]('/',auth[_0xe434('0xb')](),controller[_0xe434('0x10')]);router[_0xe434('0x11')](_0xe434('0xd'),auth[_0xe434('0xb')](),controller[_0xe434('0x12')]);router['delete'](_0xe434('0xd'),auth[_0xe434('0xb')](),controller[_0xe434('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index ecd6192..93eb944 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 _0x9957=['ENUM','internal','outbound','inbound-fax','outbound-fax','DATE','INTEGER','sequelize','exports','STRING'];(function(_0x9da6af,_0x440221){var _0x11df13=function(_0x53bb5f){while(--_0x53bb5f){_0x9da6af['push'](_0x9da6af['shift']());}};_0x11df13(++_0x440221);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')]},'type':{'type':Sequelize[_0x7995('0x3')]('inbound',_0x7995('0x4'),_0x7995('0x5'),_0x7995('0x6'),_0x7995('0x7'),'dialer')},'tag':{'type':Sequelize[_0x7995('0x2')]},'accountcode':{'type':Sequelize[_0x7995('0x2')]},'source':{'type':Sequelize[_0x7995('0x2')]},'destination':{'type':Sequelize[_0x7995('0x2')]},'destinationcontext':{'type':Sequelize[_0x7995('0x2')]},'callerid':{'type':Sequelize[_0x7995('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x7995('0x2')]},'lastapplication':{'type':Sequelize[_0x7995('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x7995('0x8')]},'systemanswertime':{'type':Sequelize[_0x7995('0x8')]},'answertime':{'type':Sequelize[_0x7995('0x8')]},'endtime':{'type':Sequelize[_0x7995('0x8')]},'duration':{'type':Sequelize[_0x7995('0x9')]},'billableseconds':{'type':Sequelize[_0x7995('0x9')]},'mohtime':{'type':Sequelize[_0x7995('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x7995('0x2')]},'userfield':{'type':Sequelize[_0x7995('0x2')]},'userDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x7995('0x2')]},'prefix':{'type':Sequelize[_0x7995('0x2')]},'routeid':{'type':Sequelize[_0x7995('0x9')]},'sipcallid':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0x9957=['ENUM','internal','outbound','inbound-fax','outbound-fax','DATE','INTEGER','sequelize','exports','STRING'];(function(_0x1ce60d,_0x4e0304){var _0x44a839=function(_0x5c57d0){while(--_0x5c57d0){_0x1ce60d['push'](_0x1ce60d['shift']());}};_0x44a839(++_0x4e0304);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')]},'type':{'type':Sequelize[_0x7995('0x3')]('inbound',_0x7995('0x4'),_0x7995('0x5'),_0x7995('0x6'),_0x7995('0x7'),'dialer')},'tag':{'type':Sequelize[_0x7995('0x2')]},'accountcode':{'type':Sequelize[_0x7995('0x2')]},'source':{'type':Sequelize[_0x7995('0x2')]},'destination':{'type':Sequelize[_0x7995('0x2')]},'destinationcontext':{'type':Sequelize[_0x7995('0x2')]},'callerid':{'type':Sequelize[_0x7995('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x7995('0x2')]},'lastapplication':{'type':Sequelize[_0x7995('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x7995('0x8')]},'systemanswertime':{'type':Sequelize[_0x7995('0x8')]},'answertime':{'type':Sequelize[_0x7995('0x8')]},'endtime':{'type':Sequelize[_0x7995('0x8')]},'duration':{'type':Sequelize[_0x7995('0x9')]},'billableseconds':{'type':Sequelize[_0x7995('0x9')]},'mohtime':{'type':Sequelize[_0x7995('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x7995('0x2')]},'userfield':{'type':Sequelize[_0x7995('0x2')]},'userDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x7995('0x2')]},'prefix':{'type':Sequelize[_0x7995('0x2')]},'routeid':{'type':Sequelize[_0x7995('0x9')]},'sipcallid':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index ccc84a0..b089944 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 _0x9404=['sendStatus','status','end','json','count','offset','limit','set','reject','update','then','destroy','error','stack','name','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','fullname','alias','User','VoiceCallReport','findAll','show','params','length','find','catch','describe','body','uniqueid','user','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x2c5d3f,_0x1f41c7){var _0x5a1a65=function(_0x8c7f05){while(--_0x8c7f05){_0x2c5d3f['push'](_0x2c5d3f['shift']());}};_0x5a1a65(++_0x1f41c7);}(_0x9404,0x161));var _0x4940=function(_0x939a46,_0x5e6b85){_0x939a46=_0x939a46-0x0;var _0x5e5546=_0x9404[_0x939a46];return _0x5e5546;};'use strict';var pdf=require(_0x4940('0x0'));var emlformat=require(_0x4940('0x1'));var rimraf=require(_0x4940('0x2'));var zipdir=require(_0x4940('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4940('0x4'));var moment=require(_0x4940('0x5'));var BPromise=require(_0x4940('0x6'));var Mustache=require('mustache');var util=require(_0x4940('0x7'));var path=require('path');var sox=require(_0x4940('0x8'));var csv=require(_0x4940('0x9'));var ejs=require(_0x4940('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4940('0xb'));var crypto=require(_0x4940('0xc'));var jsforce=require(_0x4940('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4940('0x9'));var querystring=require(_0x4940('0xe'));var Papa=require('papaparse');var Redis=require(_0x4940('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x4940('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4940('0x11'))(_0x4940('0x12'));var utils=require(_0x4940('0x13'));var config=require(_0x4940('0x14'));var db=require(_0x4940('0x15'))['db'];function respondWithStatusCode(_0x58918c,_0x228a37){_0x228a37=_0x228a37||0xcc;return function(_0x32e0e2){if(_0x32e0e2){return _0x58918c[_0x4940('0x16')](_0x228a37);}return _0x58918c[_0x4940('0x17')](_0x228a37)[_0x4940('0x18')]();};}function respondWithResult(_0x24e125,_0x36fa79){_0x36fa79=_0x36fa79||0xc8;return function(_0x208274){if(_0x208274){return _0x24e125[_0x4940('0x17')](_0x36fa79)[_0x4940('0x19')](_0x208274);}};}function respondWithFilteredResult(_0x2f38ef,_0x1b140a){return function(_0x2a7b31){if(_0x2a7b31){var _0x59a9ab=_0x2a7b31[_0x4940('0x1a')],_0x10a5dd=_0x1b140a[_0x4940('0x1b')],_0xdbd60b=_0x1b140a['offset']+_0x1b140a[_0x4940('0x1c')],_0x1ab709;if(_0xdbd60b>=_0x59a9ab){_0xdbd60b=_0x59a9ab;_0x1ab709=0xc8;}else{_0x1ab709=0xce;}_0x2f38ef[_0x4940('0x17')](_0x1ab709);return _0x2f38ef[_0x4940('0x1d')]('Content-Range',_0x10a5dd+'-'+_0xdbd60b+'/'+_0x59a9ab)[_0x4940('0x19')](_0x2a7b31);}return null;};}function patchUpdates(_0x16505f){return function(_0x443341){try{jsonpatch['apply'](_0x443341,_0x16505f,!![]);}catch(_0x59f2aa){return BPromise[_0x4940('0x1e')](_0x59f2aa);}return _0x443341['save']();};}function saveUpdates(_0x1a8e07,_0x363d31){return function(_0x45280a){if(_0x45280a){return _0x45280a[_0x4940('0x1f')](_0x1a8e07)[_0x4940('0x20')](function(_0x5b812a){return _0x5b812a;});}return null;};}function removeEntity(_0x583620,_0x475756){return function(_0x4b7e46){if(_0x4b7e46){return _0x4b7e46[_0x4940('0x21')]()['then'](function(){_0x583620[_0x4940('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x19d715,_0x31e4da){return function(_0x1ca891){if(!_0x1ca891){_0x19d715[_0x4940('0x16')](0x194);}return _0x1ca891;};}function handleError(_0x5755e4,_0x264d59){_0x264d59=_0x264d59||0x1f4;return function(_0x5f2309){logger[_0x4940('0x22')](_0x5f2309[_0x4940('0x23')]);if(_0x5f2309[_0x4940('0x24')]){delete _0x5f2309[_0x4940('0x24')];}_0x5755e4[_0x4940('0x17')](_0x264d59)['send'](_0x5f2309);};}exports[_0x4940('0x25')]=function(_0x33ce10,_0x3c9593){var _0x3aeeda={},_0x344a1a={},_0x2f3681={'count':0x0,'rows':[]};var _0x186b75=_[_0x4940('0x26')](db['VoiceCallReport'][_0x4940('0x27')],function(_0xb4fa36){return{'name':_0xb4fa36['fieldName'],'type':_0xb4fa36[_0x4940('0x28')][_0x4940('0x29')]};});_0x344a1a[_0x4940('0x2a')]=_[_0x4940('0x26')](_0x186b75,_0x4940('0x24'));_0x344a1a[_0x4940('0x2b')]=_[_0x4940('0x2c')](_0x33ce10[_0x4940('0x2b')]);_0x344a1a[_0x4940('0x2d')]=_[_0x4940('0x2e')](_0x344a1a['model'],_0x344a1a[_0x4940('0x2b')]);_0x3aeeda[_0x4940('0x2f')]=_[_0x4940('0x2e')](_0x344a1a['model'],qs[_0x4940('0x30')](_0x33ce10[_0x4940('0x2b')]['fields']));_0x3aeeda[_0x4940('0x2f')]=_0x3aeeda[_0x4940('0x2f')]['length']?_0x3aeeda['attributes']:_0x344a1a['model'];if(!_0x33ce10[_0x4940('0x2b')][_0x4940('0x31')](_0x4940('0x32'))){_0x3aeeda['limit']=qs[_0x4940('0x1c')](_0x33ce10[_0x4940('0x2b')][_0x4940('0x1c')]);_0x3aeeda[_0x4940('0x1b')]=qs['offset'](_0x33ce10['query'][_0x4940('0x1b')]);}_0x3aeeda[_0x4940('0x33')]=qs[_0x4940('0x34')](_0x33ce10[_0x4940('0x2b')]['sort']);_0x3aeeda[_0x4940('0x35')]=qs[_0x4940('0x2d')](_[_0x4940('0x36')](_0x33ce10[_0x4940('0x2b')],_0x344a1a[_0x4940('0x2d')]));if(_0x33ce10[_0x4940('0x2b')][_0x4940('0x37')]){_0x3aeeda[_0x4940('0x35')]=_[_0x4940('0x38')](_0x3aeeda[_0x4940('0x35')],{'$or':_[_0x4940('0x26')](_0x186b75,function(_0x2e21f3){if(_0x2e21f3[_0x4940('0x28')]!==_0x4940('0x39')){var _0x59c998={};_0x59c998[_0x2e21f3['name']]={'$like':'%'+_0x33ce10['query'][_0x4940('0x37')]+'%'};return _0x59c998;}})});}_0x3aeeda=_[_0x4940('0x38')]({},_0x3aeeda,_0x33ce10[_0x4940('0x3a')]);var _0x43ffe6={'where':_0x3aeeda[_0x4940('0x35')]};return db['VoiceCallReport'][_0x4940('0x1a')](_0x43ffe6)[_0x4940('0x20')](function(_0x4cc5df){_0x2f3681[_0x4940('0x1a')]=_0x4cc5df;if(_0x33ce10[_0x4940('0x2b')][_0x4940('0x3b')]){_0x3aeeda[_0x4940('0x3c')]=[{'attributes':['id',_0x4940('0x24'),_0x4940('0x3d'),_0x4940('0x3e')],'model':db[_0x4940('0x3f')],'as':_0x4940('0x3f')}];}return db[_0x4940('0x40')][_0x4940('0x41')](_0x3aeeda);})['then'](function(_0x171e3e){_0x2f3681['rows']=_0x171e3e;return _0x2f3681;})['then'](respondWithFilteredResult(_0x3c9593,_0x3aeeda))['catch'](handleError(_0x3c9593,null));};exports[_0x4940('0x42')]=function(_0x46c3af,_0x520b19){var _0x2e2222={'raw':!![],'where':{'id':_0x46c3af[_0x4940('0x43')]['id']}},_0x34f9fa={};_0x34f9fa['model']=_[_0x4940('0x2c')](db[_0x4940('0x40')][_0x4940('0x27')]);_0x34f9fa['query']=_[_0x4940('0x2c')](_0x46c3af['query']);_0x34f9fa[_0x4940('0x2d')]=_[_0x4940('0x2e')](_0x34f9fa[_0x4940('0x2a')],_0x34f9fa[_0x4940('0x2b')]);_0x2e2222[_0x4940('0x2f')]=_[_0x4940('0x2e')](_0x34f9fa[_0x4940('0x2a')],qs[_0x4940('0x30')](_0x46c3af[_0x4940('0x2b')]['fields']));_0x2e2222[_0x4940('0x2f')]=_0x2e2222[_0x4940('0x2f')][_0x4940('0x44')]?_0x2e2222[_0x4940('0x2f')]:_0x34f9fa[_0x4940('0x2a')];if(_0x46c3af[_0x4940('0x2b')][_0x4940('0x3b')]){_0x2e2222[_0x4940('0x3c')]=[{'all':!![]}];}_0x2e2222=_[_0x4940('0x38')]({},_0x2e2222,_0x46c3af[_0x4940('0x3a')]);return db[_0x4940('0x40')][_0x4940('0x45')](_0x2e2222)['then'](handleEntityNotFound(_0x520b19,null))['then'](respondWithResult(_0x520b19,null))[_0x4940('0x46')](handleError(_0x520b19,null));};exports['create']=function(_0x15b8fe,_0x23552c){return db[_0x4940('0x40')]['create'](_0x15b8fe['body'],{})[_0x4940('0x20')](respondWithResult(_0x23552c,0xc9))[_0x4940('0x46')](handleError(_0x23552c,null));};exports['destroy']=function(_0x5cc63d,_0x53ecbe){return db[_0x4940('0x40')]['find']({'where':{'id':_0x5cc63d[_0x4940('0x43')]['id']}})[_0x4940('0x20')](handleEntityNotFound(_0x53ecbe,null))[_0x4940('0x20')](removeEntity(_0x53ecbe,null))['catch'](handleError(_0x53ecbe,null));};exports[_0x4940('0x47')]=function(_0x401f04,_0x399f52){return db[_0x4940('0x40')][_0x4940('0x47')]()[_0x4940('0x20')](respondWithResult(_0x399f52,null))['catch'](handleError(_0x399f52,null));};exports['update']=function(_0x3beebc,_0x443390){if(_0x3beebc[_0x4940('0x48')]['uniqueid']){delete _0x3beebc[_0x4940('0x48')][_0x4940('0x49')];}return db[_0x4940('0x40')]['find']({'where':{'uniqueid':_0x3beebc[_0x4940('0x43')]['id'],'UserId':{'$or':[null,_0x3beebc[_0x4940('0x4a')]['id']]}}})[_0x4940('0x20')](handleEntityNotFound(_0x443390,null))['then'](saveUpdates(_0x3beebc['body'],null))[_0x4940('0x20')](respondWithResult(_0x443390,null))['catch'](handleError(_0x443390,null));}; \ No newline at end of file +var _0x9eed=['error','stack','name','send','index','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','filter','merge','VIRTUAL','options','VoiceCallReport','then','includeAll','fullname','alias','User','findAll','rows','catch','params','rawAttributes','include','create','body','describe','uniqueid','find','user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy'];(function(_0x54691e,_0x28b041){var _0x5520b2=function(_0x501a05){while(--_0x501a05){_0x54691e['push'](_0x54691e['shift']());}};_0x5520b2(++_0x28b041);}(_0x9eed,0x1b6));var _0xd9ee=function(_0x49bceb,_0x57d24e){_0x49bceb=_0x49bceb-0x0;var _0x3a537a=_0x9eed[_0x49bceb];return _0x3a537a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd9ee('0x0'));var rimraf=require(_0xd9ee('0x1'));var zipdir=require(_0xd9ee('0x2'));var jsonpatch=require(_0xd9ee('0x3'));var rp=require(_0xd9ee('0x4'));var moment=require(_0xd9ee('0x5'));var BPromise=require(_0xd9ee('0x6'));var Mustache=require(_0xd9ee('0x7'));var util=require(_0xd9ee('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xd9ee('0x9'));var ejs=require(_0xd9ee('0xa'));var fs=require('fs');var _=require(_0xd9ee('0xb'));var squel=require(_0xd9ee('0xc'));var crypto=require(_0xd9ee('0xd'));var jsforce=require(_0xd9ee('0xe'));var deskjs=require(_0xd9ee('0xf'));var toCsv=require(_0xd9ee('0x9'));var querystring=require('querystring');var Papa=require(_0xd9ee('0x10'));var Redis=require('ioredis');var authService=require(_0xd9ee('0x11'));var qs=require(_0xd9ee('0x12'));var as=require(_0xd9ee('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd9ee('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xd9ee('0x15'));var db=require(_0xd9ee('0x16'))['db'];function respondWithStatusCode(_0x2182e0,_0x1078b4){_0x1078b4=_0x1078b4||0xcc;return function(_0x17bded){if(_0x17bded){return _0x2182e0[_0xd9ee('0x17')](_0x1078b4);}return _0x2182e0[_0xd9ee('0x18')](_0x1078b4)[_0xd9ee('0x19')]();};}function respondWithResult(_0x339d3e,_0x2495a6){_0x2495a6=_0x2495a6||0xc8;return function(_0x5822ad){if(_0x5822ad){return _0x339d3e[_0xd9ee('0x18')](_0x2495a6)[_0xd9ee('0x1a')](_0x5822ad);}};}function respondWithFilteredResult(_0x4d6650,_0x3f5939){return function(_0x3b03bc){if(_0x3b03bc){var _0x585a9b=_0x3b03bc[_0xd9ee('0x1b')],_0x4852c1=_0x3f5939['offset'],_0x1e9b5c=_0x3f5939[_0xd9ee('0x1c')]+_0x3f5939['limit'],_0x533cb4;if(_0x1e9b5c>=_0x585a9b){_0x1e9b5c=_0x585a9b;_0x533cb4=0xc8;}else{_0x533cb4=0xce;}_0x4d6650[_0xd9ee('0x18')](_0x533cb4);return _0x4d6650[_0xd9ee('0x1d')](_0xd9ee('0x1e'),_0x4852c1+'-'+_0x1e9b5c+'/'+_0x585a9b)[_0xd9ee('0x1a')](_0x3b03bc);}return null;};}function patchUpdates(_0x2388e7){return function(_0x4b55b7){try{jsonpatch[_0xd9ee('0x1f')](_0x4b55b7,_0x2388e7,!![]);}catch(_0x5ba0a3){return BPromise[_0xd9ee('0x20')](_0x5ba0a3);}return _0x4b55b7[_0xd9ee('0x21')]();};}function saveUpdates(_0x4f39a3,_0x473306){return function(_0x68de9){if(_0x68de9){return _0x68de9[_0xd9ee('0x22')](_0x4f39a3)['then'](function(_0x37848b){return _0x37848b;});}return null;};}function removeEntity(_0x1007f7,_0x1aab1c){return function(_0x535839){if(_0x535839){return _0x535839[_0xd9ee('0x23')]()['then'](function(){_0x1007f7[_0xd9ee('0x18')](0xcc)[_0xd9ee('0x19')]();});}};}function handleEntityNotFound(_0x1889b2,_0x345427){return function(_0x18d683){if(!_0x18d683){_0x1889b2['sendStatus'](0x194);}return _0x18d683;};}function handleError(_0x37c5f5,_0xbfa1c5){_0xbfa1c5=_0xbfa1c5||0x1f4;return function(_0x108f50){logger[_0xd9ee('0x24')](_0x108f50[_0xd9ee('0x25')]);if(_0x108f50[_0xd9ee('0x26')]){delete _0x108f50[_0xd9ee('0x26')];}_0x37c5f5['status'](_0xbfa1c5)[_0xd9ee('0x27')](_0x108f50);};}exports[_0xd9ee('0x28')]=function(_0xf2e277,_0x45c09f){var _0x4af70a={},_0x3439a1={},_0x253a62={'count':0x0,'rows':[]};var _0x361d46=_[_0xd9ee('0x29')](db['VoiceCallReport']['rawAttributes'],function(_0x23c737){return{'name':_0x23c737[_0xd9ee('0x2a')],'type':_0x23c737[_0xd9ee('0x2b')]['key']};});_0x3439a1[_0xd9ee('0x2c')]=_[_0xd9ee('0x29')](_0x361d46,_0xd9ee('0x26'));_0x3439a1[_0xd9ee('0x2d')]=_[_0xd9ee('0x2e')](_0xf2e277['query']);_0x3439a1[_0xd9ee('0x2f')]=_[_0xd9ee('0x30')](_0x3439a1[_0xd9ee('0x2c')],_0x3439a1[_0xd9ee('0x2d')]);_0x4af70a[_0xd9ee('0x31')]=_[_0xd9ee('0x30')](_0x3439a1[_0xd9ee('0x2c')],qs[_0xd9ee('0x32')](_0xf2e277[_0xd9ee('0x2d')][_0xd9ee('0x32')]));_0x4af70a[_0xd9ee('0x31')]=_0x4af70a[_0xd9ee('0x31')][_0xd9ee('0x33')]?_0x4af70a[_0xd9ee('0x31')]:_0x3439a1[_0xd9ee('0x2c')];if(!_0xf2e277[_0xd9ee('0x2d')][_0xd9ee('0x34')](_0xd9ee('0x35'))){_0x4af70a[_0xd9ee('0x36')]=qs[_0xd9ee('0x36')](_0xf2e277[_0xd9ee('0x2d')]['limit']);_0x4af70a[_0xd9ee('0x1c')]=qs[_0xd9ee('0x1c')](_0xf2e277[_0xd9ee('0x2d')][_0xd9ee('0x1c')]);}_0x4af70a[_0xd9ee('0x37')]=qs['sort'](_0xf2e277[_0xd9ee('0x2d')]['sort']);_0x4af70a[_0xd9ee('0x38')]=qs[_0xd9ee('0x2f')](_['pick'](_0xf2e277['query'],_0x3439a1['filters']));if(_0xf2e277[_0xd9ee('0x2d')][_0xd9ee('0x39')]){_0x4af70a['where']=_[_0xd9ee('0x3a')](_0x4af70a[_0xd9ee('0x38')],{'$or':_[_0xd9ee('0x29')](_0x361d46,function(_0x1238fc){if(_0x1238fc[_0xd9ee('0x2b')]!==_0xd9ee('0x3b')){var _0x50a5ea={};_0x50a5ea[_0x1238fc['name']]={'$like':'%'+_0xf2e277[_0xd9ee('0x2d')]['filter']+'%'};return _0x50a5ea;}})});}_0x4af70a=_['merge']({},_0x4af70a,_0xf2e277[_0xd9ee('0x3c')]);var _0x140c7f={'where':_0x4af70a[_0xd9ee('0x38')]};return db[_0xd9ee('0x3d')][_0xd9ee('0x1b')](_0x140c7f)[_0xd9ee('0x3e')](function(_0x1ea007){_0x253a62[_0xd9ee('0x1b')]=_0x1ea007;if(_0xf2e277['query'][_0xd9ee('0x3f')]){_0x4af70a['include']=[{'attributes':['id',_0xd9ee('0x26'),_0xd9ee('0x40'),_0xd9ee('0x41')],'model':db[_0xd9ee('0x42')],'as':_0xd9ee('0x42')}];}return db[_0xd9ee('0x3d')][_0xd9ee('0x43')](_0x4af70a);})[_0xd9ee('0x3e')](function(_0x33825e){_0x253a62[_0xd9ee('0x44')]=_0x33825e;return _0x253a62;})[_0xd9ee('0x3e')](respondWithFilteredResult(_0x45c09f,_0x4af70a))[_0xd9ee('0x45')](handleError(_0x45c09f,null));};exports['show']=function(_0x5cd6c9,_0x2527d9){var _0x245588={'raw':!![],'where':{'id':_0x5cd6c9[_0xd9ee('0x46')]['id']}},_0x1195b7={};_0x1195b7['model']=_[_0xd9ee('0x2e')](db[_0xd9ee('0x3d')][_0xd9ee('0x47')]);_0x1195b7[_0xd9ee('0x2d')]=_['keys'](_0x5cd6c9[_0xd9ee('0x2d')]);_0x1195b7[_0xd9ee('0x2f')]=_[_0xd9ee('0x30')](_0x1195b7[_0xd9ee('0x2c')],_0x1195b7[_0xd9ee('0x2d')]);_0x245588['attributes']=_['intersection'](_0x1195b7['model'],qs[_0xd9ee('0x32')](_0x5cd6c9[_0xd9ee('0x2d')][_0xd9ee('0x32')]));_0x245588['attributes']=_0x245588[_0xd9ee('0x31')][_0xd9ee('0x33')]?_0x245588[_0xd9ee('0x31')]:_0x1195b7[_0xd9ee('0x2c')];if(_0x5cd6c9[_0xd9ee('0x2d')][_0xd9ee('0x3f')]){_0x245588[_0xd9ee('0x48')]=[{'all':!![]}];}_0x245588=_['merge']({},_0x245588,_0x5cd6c9['options']);return db[_0xd9ee('0x3d')]['find'](_0x245588)[_0xd9ee('0x3e')](handleEntityNotFound(_0x2527d9,null))[_0xd9ee('0x3e')](respondWithResult(_0x2527d9,null))['catch'](handleError(_0x2527d9,null));};exports['create']=function(_0x187463,_0x144477){return db['VoiceCallReport'][_0xd9ee('0x49')](_0x187463[_0xd9ee('0x4a')],{})[_0xd9ee('0x3e')](respondWithResult(_0x144477,0xc9))[_0xd9ee('0x45')](handleError(_0x144477,null));};exports[_0xd9ee('0x23')]=function(_0x2f05eb,_0x2bd841){return db[_0xd9ee('0x3d')]['find']({'where':{'id':_0x2f05eb['params']['id']}})['then'](handleEntityNotFound(_0x2bd841,null))[_0xd9ee('0x3e')](removeEntity(_0x2bd841,null))[_0xd9ee('0x45')](handleError(_0x2bd841,null));};exports[_0xd9ee('0x4b')]=function(_0x58cf90,_0x1b1813){return db[_0xd9ee('0x3d')][_0xd9ee('0x4b')]()['then'](respondWithResult(_0x1b1813,null))['catch'](handleError(_0x1b1813,null));};exports[_0xd9ee('0x22')]=function(_0x42ce9a,_0x3bc995){if(_0x42ce9a[_0xd9ee('0x4a')][_0xd9ee('0x4c')]){delete _0x42ce9a['body'][_0xd9ee('0x4c')];}return db[_0xd9ee('0x3d')][_0xd9ee('0x4d')]({'where':{'uniqueid':_0x42ce9a['params']['id'],'UserId':{'$or':[null,_0x42ce9a[_0xd9ee('0x4e')]['id']]}}})[_0xd9ee('0x3e')](handleEntityNotFound(_0x3bc995,null))[_0xd9ee('0x3e')](saveUpdates(_0x42ce9a['body'],null))['then'](respondWithResult(_0x3bc995,null))[_0xd9ee('0x45')](handleError(_0x3bc995,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 079201f..27d67dd 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 _0xedee=['path','rimraf','../../config/environment','./voiceCallReport.attributes','define','VoiceCallReport','report_call','uniqueid','lodash','util','api','moment','bluebird','request-promise'];(function(_0x4bf007,_0x114bc1){var _0x211a1b=function(_0xc57023){while(--_0xc57023){_0x4bf007['push'](_0x4bf007['shift']());}};_0x211a1b(++_0x114bc1);}(_0xedee,0x1ac));var _0xeede=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xedee[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xeede('0x0'));var util=require(_0xeede('0x1'));var logger=require('../../config/logger')(_0xeede('0x2'));var moment=require(_0xeede('0x3'));var BPromise=require(_0xeede('0x4'));var rp=require(_0xeede('0x5'));var fs=require('fs');var path=require(_0xeede('0x6'));var rimraf=require(_0xeede('0x7'));var config=require(_0xeede('0x8'));var attributes=require(_0xeede('0x9'));module['exports']=function(_0x1e9660,_0x206520){return _0x1e9660[_0xeede('0xa')](_0xeede('0xb'),attributes,{'tableName':_0xeede('0xc'),'paranoid':![],'indexes':[{'fields':[_0xeede('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd3d4=['request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','report_call','lodash','util','../../config/logger','api','bluebird'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd3d4,0xbe));var _0x4d3d=function(_0x7aaac8,_0x3a4233){_0x7aaac8=_0x7aaac8-0x0;var _0x4a8013=_0xd3d4[_0x7aaac8];return _0x4a8013;};'use strict';var _=require(_0x4d3d('0x0'));var util=require(_0x4d3d('0x1'));var logger=require(_0x4d3d('0x2'))(_0x4d3d('0x3'));var moment=require('moment');var BPromise=require(_0x4d3d('0x4'));var rp=require(_0x4d3d('0x5'));var fs=require('fs');var path=require(_0x4d3d('0x6'));var rimraf=require(_0x4d3d('0x7'));var config=require(_0x4d3d('0x8'));var attributes=require(_0x4d3d('0x9'));module[_0x4d3d('0xa')]=function(_0x5bac09,_0xb6d75d){return _0x5bac09[_0x4d3d('0xb')]('VoiceCallReport',attributes,{'tableName':_0x4d3d('0xc'),'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 56c6a2a..3142e8b 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 _0xcd9b=['http','request','then','info','VoiceCallReport,\x20%s,\x20%s','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','attributes','limit','include','model','map','stringify','CreateVoiceCallReport','body','UpdateVoiceCallReport','update','where','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4270fd,_0x2840b5){var _0x5ee38c=function(_0x29f354){while(--_0x29f354){_0x4270fd['push'](_0x4270fd['shift']());}};_0x5ee38c(++_0x2840b5);}(_0xcd9b,0xea));var _0xbcd9=function(_0x20804f,_0x582fe0){_0x20804f=_0x20804f-0x0;var _0x37c8c9=_0xcd9b[_0x20804f];return _0x37c8c9;};'use strict';var _=require(_0xbcd9('0x0'));var util=require(_0xbcd9('0x1'));var moment=require(_0xbcd9('0x2'));var BPromise=require(_0xbcd9('0x3'));var rs=require(_0xbcd9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbcd9('0x5'))['db'];var utils=require(_0xbcd9('0x6'));var logger=require(_0xbcd9('0x7'))(_0xbcd9('0x8'));var config=require(_0xbcd9('0x9'));var jayson=require(_0xbcd9('0xa'));var client=jayson[_0xbcd9('0xb')][_0xbcd9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x7ea603,_0x32dbb3,_0x3fb6f0){return new BPromise(function(_0x1be6dd,_0x2fd7a2){return client[_0xbcd9('0xd')](_0x7ea603,_0x3fb6f0)[_0xbcd9('0xe')](function(_0x90480a){logger[_0xbcd9('0xf')](_0xbcd9('0x10'),_0x32dbb3,'request\x20sent');logger[_0xbcd9('0x11')](_0xbcd9('0x12'),_0x32dbb3,'request\x20sent',JSON['stringify'](_0x90480a));if(_0x90480a[_0xbcd9('0x13')]){if(_0x90480a[_0xbcd9('0x13')][_0xbcd9('0x14')]===0x1f4){logger['error'](_0xbcd9('0x10'),_0x32dbb3,_0x90480a[_0xbcd9('0x13')][_0xbcd9('0x15')]);return _0x2fd7a2(_0x90480a['error'][_0xbcd9('0x15')]);}logger[_0xbcd9('0x13')](_0xbcd9('0x10'),_0x32dbb3,_0x90480a[_0xbcd9('0x13')][_0xbcd9('0x15')]);return _0x1be6dd(_0x90480a[_0xbcd9('0x13')]['message']);}else{logger['info'](_0xbcd9('0x10'),_0x32dbb3,_0xbcd9('0x16'));_0x1be6dd(_0x90480a[_0xbcd9('0x17')][_0xbcd9('0x15')]);}})[_0xbcd9('0x18')](function(_0x1f06fe){logger[_0xbcd9('0x13')]('VoiceCallReport,\x20%s,\x20%s',_0x32dbb3,_0x1f06fe);_0x2fd7a2(_0x1f06fe);});});}exports[_0xbcd9('0x19')]=function(_0x31b8aa){var _0x128f3d=this;return new Promise(function(_0x8f5929,_0x20ad00){return db[_0xbcd9('0x1a')][_0xbcd9('0x1b')]({'raw':_0x31b8aa[_0xbcd9('0x1c')]?_0x31b8aa['options'][_0xbcd9('0x1d')]===undefined?!![]:![]:!![],'where':_0x31b8aa['options']?_0x31b8aa[_0xbcd9('0x1c')]['where']||null:null,'attributes':_0x31b8aa[_0xbcd9('0x1c')]?_0x31b8aa[_0xbcd9('0x1c')][_0xbcd9('0x1e')]||null:null,'limit':_0x31b8aa[_0xbcd9('0x1c')]?_0x31b8aa[_0xbcd9('0x1c')][_0xbcd9('0x1f')]||null:null,'include':_0x31b8aa[_0xbcd9('0x1c')]?_0x31b8aa[_0xbcd9('0x1c')][_0xbcd9('0x20')]?_['map'](_0x31b8aa[_0xbcd9('0x1c')][_0xbcd9('0x20')],function(_0x5181fb){return{'model':db[_0x5181fb[_0xbcd9('0x21')]],'as':_0x5181fb['as'],'attributes':_0x5181fb['attributes'],'include':_0x5181fb[_0xbcd9('0x20')]?_['map'](_0x5181fb['include'],function(_0x1959f3){return{'model':db[_0x1959f3['model']],'as':_0x1959f3['as'],'attributes':_0x1959f3['attributes'],'include':_0x1959f3[_0xbcd9('0x20')]?_[_0xbcd9('0x22')](_0x1959f3[_0xbcd9('0x20')],function(_0x3da47a){return{'model':db[_0x3da47a['model']],'as':_0x3da47a['as'],'attributes':_0x3da47a[_0xbcd9('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xbcd9('0xe')](function(_0x4ce75e){logger[_0xbcd9('0xf')]('GetVoiceCallReport',_0x31b8aa);logger[_0xbcd9('0x11')](_0xbcd9('0x19'),_0x31b8aa,JSON[_0xbcd9('0x23')](_0x4ce75e));_0x8f5929(_0x4ce75e);})[_0xbcd9('0x18')](function(_0x371598){logger[_0xbcd9('0x13')]('GetVoiceCallReport',_0x371598[_0xbcd9('0x15')],_0x31b8aa);_0x20ad00(_0x128f3d[_0xbcd9('0x13')](0x1f4,_0x371598['message']));});});};exports[_0xbcd9('0x24')]=function(_0x136c5d){var _0x41720d=this;return new Promise(function(_0xe7a22f,_0x2919b0){return db[_0xbcd9('0x1a')]['create'](_0x136c5d[_0xbcd9('0x25')],{'raw':_0x136c5d[_0xbcd9('0x1c')]?_0x136c5d['options'][_0xbcd9('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0xae0b1f){logger['info'](_0xbcd9('0x24'),_0x136c5d);logger['debug'](_0xbcd9('0x24'),_0x136c5d,JSON[_0xbcd9('0x23')](_0xae0b1f));_0xe7a22f(_0xae0b1f);})['catch'](function(_0x1817ae){logger[_0xbcd9('0x13')](_0xbcd9('0x24'),_0x1817ae['message'],_0x136c5d);_0x2919b0(_0x41720d[_0xbcd9('0x13')](0x1f4,_0x1817ae[_0xbcd9('0x15')]));});});};exports[_0xbcd9('0x26')]=function(_0xc21fa8){var _0x24e14d=this;return new Promise(function(_0xc026f7,_0x47d3f5){return db[_0xbcd9('0x1a')][_0xbcd9('0x27')](_0xc21fa8[_0xbcd9('0x25')],{'raw':_0xc21fa8[_0xbcd9('0x1c')]?_0xc21fa8[_0xbcd9('0x1c')][_0xbcd9('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xc21fa8[_0xbcd9('0x1c')]?_0xc21fa8[_0xbcd9('0x1c')][_0xbcd9('0x28')]||null:null,'attributes':_0xc21fa8[_0xbcd9('0x1c')]?_0xc21fa8[_0xbcd9('0x1c')][_0xbcd9('0x1e')]||null:null,'limit':_0xc21fa8[_0xbcd9('0x1c')]?_0xc21fa8[_0xbcd9('0x1c')]['limit']||null:null})[_0xbcd9('0xe')](function(_0x179c59){logger['info'](_0xbcd9('0x26'),_0xc21fa8);logger[_0xbcd9('0x11')](_0xbcd9('0x26'),_0xc21fa8,JSON[_0xbcd9('0x23')](_0x179c59));_0xc026f7(_0x179c59);})[_0xbcd9('0x18')](function(_0x8c1c98){logger[_0xbcd9('0x13')]('UpdateVoiceCallReport',_0x8c1c98[_0xbcd9('0x15')],_0xc21fa8);_0x47d3f5(_0x24e14d['error'](0x1f4,_0x8c1c98['message']));});});}; \ No newline at end of file +var _0x129e=['attributes','include','map','model','CreateVoiceCallReport','create','body','raw','UpdateVoiceCallReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceCallReport,\x20%s,\x20%s','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','where'];(function(_0x356bf4,_0x29522d){var _0x293740=function(_0xbf30a8){while(--_0xbf30a8){_0x356bf4['push'](_0x356bf4['shift']());}};_0x293740(++_0x29522d);}(_0x129e,0x1ab));var _0xe129=function(_0x1b4489,_0x2e80ab){_0x1b4489=_0x1b4489-0x0;var _0x129078=_0x129e[_0x1b4489];return _0x129078;};'use strict';var _=require(_0xe129('0x0'));var util=require(_0xe129('0x1'));var moment=require(_0xe129('0x2'));var BPromise=require('bluebird');var rs=require(_0xe129('0x3'));var fs=require('fs');var Redis=require(_0xe129('0x4'));var db=require(_0xe129('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe129('0x6'))(_0xe129('0x7'));var config=require(_0xe129('0x8'));var jayson=require(_0xe129('0x9'));var client=jayson[_0xe129('0xa')][_0xe129('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x376648,_0x575327,_0x1e6f23){return new BPromise(function(_0x46b609,_0x576765){return client[_0xe129('0xc')](_0x376648,_0x1e6f23)[_0xe129('0xd')](function(_0x369fed){logger[_0xe129('0xe')]('VoiceCallReport,\x20%s,\x20%s',_0x575327,'request\x20sent');logger['debug'](_0xe129('0xf'),_0x575327,_0xe129('0x10'),JSON[_0xe129('0x11')](_0x369fed));if(_0x369fed[_0xe129('0x12')]){if(_0x369fed[_0xe129('0x12')][_0xe129('0x13')]===0x1f4){logger['error'](_0xe129('0x14'),_0x575327,_0x369fed[_0xe129('0x12')][_0xe129('0x15')]);return _0x576765(_0x369fed[_0xe129('0x12')]['message']);}logger[_0xe129('0x12')](_0xe129('0x14'),_0x575327,_0x369fed[_0xe129('0x12')][_0xe129('0x15')]);return _0x46b609(_0x369fed['error']['message']);}else{logger[_0xe129('0xe')]('VoiceCallReport,\x20%s,\x20%s',_0x575327,_0xe129('0x10'));_0x46b609(_0x369fed[_0xe129('0x16')][_0xe129('0x15')]);}})[_0xe129('0x17')](function(_0x2830de){logger[_0xe129('0x12')](_0xe129('0x14'),_0x575327,_0x2830de);_0x576765(_0x2830de);});});}exports[_0xe129('0x18')]=function(_0x2ebd51){var _0x1b9df3=this;return new Promise(function(_0x4e74c8,_0x51ace5){return db[_0xe129('0x19')][_0xe129('0x1a')]({'raw':_0x2ebd51['options']?_0x2ebd51[_0xe129('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x2ebd51['options']?_0x2ebd51[_0xe129('0x1b')][_0xe129('0x1c')]||null:null,'attributes':_0x2ebd51[_0xe129('0x1b')]?_0x2ebd51[_0xe129('0x1b')][_0xe129('0x1d')]||null:null,'limit':_0x2ebd51[_0xe129('0x1b')]?_0x2ebd51['options']['limit']||null:null,'include':_0x2ebd51[_0xe129('0x1b')]?_0x2ebd51[_0xe129('0x1b')][_0xe129('0x1e')]?_[_0xe129('0x1f')](_0x2ebd51[_0xe129('0x1b')][_0xe129('0x1e')],function(_0x20e703){return{'model':db[_0x20e703['model']],'as':_0x20e703['as'],'attributes':_0x20e703[_0xe129('0x1d')],'include':_0x20e703['include']?_['map'](_0x20e703[_0xe129('0x1e')],function(_0x45434f){return{'model':db[_0x45434f[_0xe129('0x20')]],'as':_0x45434f['as'],'attributes':_0x45434f[_0xe129('0x1d')],'include':_0x45434f['include']?_[_0xe129('0x1f')](_0x45434f[_0xe129('0x1e')],function(_0x430d22){return{'model':db[_0x430d22[_0xe129('0x20')]],'as':_0x430d22['as'],'attributes':_0x430d22[_0xe129('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xe129('0xd')](function(_0xba139a){logger['info'](_0xe129('0x18'),_0x2ebd51);logger['debug'](_0xe129('0x18'),_0x2ebd51,JSON[_0xe129('0x11')](_0xba139a));_0x4e74c8(_0xba139a);})[_0xe129('0x17')](function(_0x4b9c28){logger[_0xe129('0x12')](_0xe129('0x18'),_0x4b9c28[_0xe129('0x15')],_0x2ebd51);_0x51ace5(_0x1b9df3[_0xe129('0x12')](0x1f4,_0x4b9c28[_0xe129('0x15')]));});});};exports[_0xe129('0x21')]=function(_0x317f1b){var _0x110167=this;return new Promise(function(_0x149822,_0x15d808){return db[_0xe129('0x19')][_0xe129('0x22')](_0x317f1b[_0xe129('0x23')],{'raw':_0x317f1b['options']?_0x317f1b[_0xe129('0x1b')][_0xe129('0x24')]===undefined?!![]:![]:!![]})[_0xe129('0xd')](function(_0x38923a){logger[_0xe129('0xe')]('CreateVoiceCallReport',_0x317f1b);logger['debug'](_0xe129('0x21'),_0x317f1b,JSON[_0xe129('0x11')](_0x38923a));_0x149822(_0x38923a);})[_0xe129('0x17')](function(_0x2a7a4b){logger[_0xe129('0x12')](_0xe129('0x21'),_0x2a7a4b['message'],_0x317f1b);_0x15d808(_0x110167[_0xe129('0x12')](0x1f4,_0x2a7a4b[_0xe129('0x15')]));});});};exports[_0xe129('0x25')]=function(_0x1a7646){var _0x291889=this;return new Promise(function(_0xb30ac0,_0x3dd44c){return db[_0xe129('0x19')]['update'](_0x1a7646[_0xe129('0x23')],{'raw':_0x1a7646[_0xe129('0x1b')]?_0x1a7646[_0xe129('0x1b')][_0xe129('0x24')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a7646['options']?_0x1a7646[_0xe129('0x1b')][_0xe129('0x1c')]||null:null,'attributes':_0x1a7646['options']?_0x1a7646[_0xe129('0x1b')][_0xe129('0x1d')]||null:null,'limit':_0x1a7646[_0xe129('0x1b')]?_0x1a7646[_0xe129('0x1b')]['limit']||null:null})[_0xe129('0xd')](function(_0x2edb3d){logger[_0xe129('0xe')](_0xe129('0x25'),_0x1a7646);logger['debug'](_0xe129('0x25'),_0x1a7646,JSON['stringify'](_0x2edb3d));_0xb30ac0(_0x2edb3d);})[_0xe129('0x17')](function(_0x5176dc){logger[_0xe129('0x12')](_0xe129('0x25'),_0x5176dc[_0xe129('0x15')],_0x1a7646);_0x3dd44c(_0x291889[_0xe129('0x12')](0x1f4,_0x5176dc[_0xe129('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index d8d9f7e..dba9cb6 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 _0xbe2a=['../../config/environment','get','isAuthenticated','index','/:id','post','create','put','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x527619,_0x4a5784){var _0x5afb73=function(_0x397e02){while(--_0x397e02){_0x527619['push'](_0x527619['shift']());}};_0x5afb73(++_0x4a5784);}(_0xbe2a,0x1d9));var _0xabe2=function(_0x15817b,_0x3aeaad){_0x15817b=_0x15817b-0x0;var _0x26d843=_0xbe2a[_0x15817b];return _0x26d843;};'use strict';var multer=require(_0xabe2('0x0'));var util=require(_0xabe2('0x1'));var path=require(_0xabe2('0x2'));var timeout=require(_0xabe2('0x3'));var express=require(_0xabe2('0x4'));var router=express[_0xabe2('0x5')]();var auth=require(_0xabe2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xabe2('0x7'));var controller=require('./voiceChanSpy.controller');router[_0xabe2('0x8')]('/',auth[_0xabe2('0x9')](),controller[_0xabe2('0xa')]);router[_0xabe2('0x8')](_0xabe2('0xb'),auth[_0xabe2('0x9')](),controller['show']);router[_0xabe2('0xc')]('/',auth[_0xabe2('0x9')](),controller[_0xabe2('0xd')]);router[_0xabe2('0xe')](_0xabe2('0xb'),auth[_0xabe2('0x9')](),controller['update']);router[_0xabe2('0xf')](_0xabe2('0xb'),auth[_0xabe2('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x0272=['update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','post','create','/:id'];(function(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0x0272,0x15a));var _0x2027=function(_0x31af80,_0x581f7c){_0x31af80=_0x31af80-0x0;var _0x5935ef=_0x0272[_0x31af80];return _0x5935ef;};'use strict';var multer=require(_0x2027('0x0'));var util=require(_0x2027('0x1'));var path=require('path');var timeout=require(_0x2027('0x2'));var express=require(_0x2027('0x3'));var router=express[_0x2027('0x4')]();var auth=require(_0x2027('0x5'));var interaction=require(_0x2027('0x6'));var config=require(_0x2027('0x7'));var controller=require('./voiceChanSpy.controller');router['get']('/',auth[_0x2027('0x8')](),controller[_0x2027('0x9')]);router[_0x2027('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x2027('0xb')]('/',auth['isAuthenticated'](),controller[_0x2027('0xc')]);router['put'](_0x2027('0xd'),auth[_0x2027('0x8')](),controller[_0x2027('0xe')]);router[_0x2027('0xf')]('/:id',auth[_0x2027('0x8')](),controller[_0x2027('0x10')]);module[_0x2027('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 201c344..1728b4a 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 _0x8e34=['STRING','name','options','getDataValue','split','BOOLEAN','sequelize'];(function(_0x166e96,_0x55191d){var _0x553d73=function(_0x586142){while(--_0x586142){_0x166e96['push'](_0x166e96['shift']());}};_0x553d73(++_0x55191d);}(_0x8e34,0x1bf));var _0x48e3=function(_0x52572f,_0x117f95){_0x52572f=_0x52572f-0x0;var _0x2e9a29=_0x8e34[_0x52572f];return _0x2e9a29;};'use strict';var Sequelize=require(_0x48e3('0x0'));module['exports']={'name':{'type':Sequelize[_0x48e3('0x1')]},'prefix':{'type':Sequelize['STRING'],'unique':_0x48e3('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x48e3('0x1')],'set':function(_0xc5a108){this['setDataValue'](_0x48e3('0x3'),_0xc5a108?_0xc5a108['join'](''):[]);},'get':function(){return this['getDataValue'](_0x48e3('0x3'))?this[_0x48e3('0x4')](_0x48e3('0x3'))[_0x48e3('0x5')](''):[];}},'auth':{'type':Sequelize[_0x48e3('0x6')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0x48e3('0x6')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x48e3('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xfa78=['getDataValue','split','BOOLEAN','STRING','setDataValue','options','join'];(function(_0x8a997a,_0x2afe0a){var _0x42cac8=function(_0x4314b1){while(--_0x4314b1){_0x8a997a['push'](_0x8a997a['shift']());}};_0x42cac8(++_0x2afe0a);}(_0xfa78,0x122));var _0x8fa7=function(_0x15f946,_0x4fb3aa){_0x15f946=_0x15f946-0x0;var _0x13b9a5=_0xfa78[_0x15f946];return _0x13b9a5;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x8fa7('0x0')],'unique':'name','allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x42a8c2){this[_0x8fa7('0x1')](_0x8fa7('0x2'),_0x42a8c2?_0x42a8c2[_0x8fa7('0x3')](''):[]);},'get':function(){return this[_0x8fa7('0x4')](_0x8fa7('0x2'))?this[_0x8fa7('0x4')](_0x8fa7('0x2'))[_0x8fa7('0x5')](''):[];}},'auth':{'type':Sequelize[_0x8fa7('0x6')],'defaultValue':![]},'password':{'type':Sequelize[_0x8fa7('0x0')]},'record':{'type':Sequelize[_0x8fa7('0x6')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 9b82d04..7bbb0cc 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 _0x4231=['VoiceChanSpy','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','options','include','findAll','show','params','keys','rawAttributes','merge','catch','create','body','user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','reject','save','update','then','destroy','get','ChanSpies','error','stack','name','send','map'];(function(_0x5568ed,_0x61f3be){var _0x406c98=function(_0x3cc9a7){while(--_0x3cc9a7){_0x5568ed['push'](_0x5568ed['shift']());}};_0x406c98(++_0x61f3be);}(_0x4231,0x77));var _0x1423=function(_0x5f3ef9,_0x4c8a49){_0x5f3ef9=_0x5f3ef9-0x0;var _0x4d978b=_0x4231[_0x5f3ef9];return _0x4d978b;};'use strict';var pdf=require(_0x1423('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1423('0x1'));var zipdir=require(_0x1423('0x2'));var jsonpatch=require(_0x1423('0x3'));var rp=require(_0x1423('0x4'));var moment=require(_0x1423('0x5'));var BPromise=require(_0x1423('0x6'));var Mustache=require(_0x1423('0x7'));var util=require(_0x1423('0x8'));var path=require(_0x1423('0x9'));var sox=require(_0x1423('0xa'));var csv=require('to-csv');var ejs=require(_0x1423('0xb'));var fs=require('fs');var _=require(_0x1423('0xc'));var squel=require(_0x1423('0xd'));var crypto=require(_0x1423('0xe'));var jsforce=require(_0x1423('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1423('0x10'));var Papa=require('papaparse');var Redis=require(_0x1423('0x11'));var authService=require(_0x1423('0x12'));var qs=require(_0x1423('0x13'));var as=require(_0x1423('0x14'));var hardwareService=require(_0x1423('0x15'));var logger=require('../../config/logger')(_0x1423('0x16'));var utils=require(_0x1423('0x17'));var config=require(_0x1423('0x18'));var db=require(_0x1423('0x19'))['db'];function respondWithStatusCode(_0x236d93,_0x16e071){_0x16e071=_0x16e071||0xcc;return function(_0x2f4f88){if(_0x2f4f88){return _0x236d93[_0x1423('0x1a')](_0x16e071);}return _0x236d93[_0x1423('0x1b')](_0x16e071)[_0x1423('0x1c')]();};}function respondWithResult(_0x3bb550,_0x2eb14c){_0x2eb14c=_0x2eb14c||0xc8;return function(_0x40dfc7){if(_0x40dfc7){return _0x3bb550[_0x1423('0x1b')](_0x2eb14c)['json'](_0x40dfc7);}};}function respondWithFilteredResult(_0xb7a7eb,_0x55d2fd){return function(_0x1869ee){if(_0x1869ee){var _0x2d1562=_0x1869ee[_0x1423('0x1d')],_0x5efea7=_0x55d2fd[_0x1423('0x1e')],_0x2ae947=_0x55d2fd['offset']+_0x55d2fd[_0x1423('0x1f')],_0x7f2fdc;if(_0x2ae947>=_0x2d1562){_0x2ae947=_0x2d1562;_0x7f2fdc=0xc8;}else{_0x7f2fdc=0xce;}_0xb7a7eb[_0x1423('0x1b')](_0x7f2fdc);return _0xb7a7eb['set'](_0x1423('0x20'),_0x5efea7+'-'+_0x2ae947+'/'+_0x2d1562)[_0x1423('0x21')](_0x1869ee);}return null;};}function patchUpdates(_0x55f8c7){return function(_0x5de591){try{jsonpatch[_0x1423('0x22')](_0x5de591,_0x55f8c7,!![]);}catch(_0x3be11a){return BPromise[_0x1423('0x23')](_0x3be11a);}return _0x5de591[_0x1423('0x24')]();};}function saveUpdates(_0x477bfa,_0xe5d54){return function(_0x4ef041){if(_0x4ef041){return _0x4ef041[_0x1423('0x25')](_0x477bfa)[_0x1423('0x26')](function(_0x16c5df){return _0x16c5df;});}return null;};}function removeEntity(_0xadeb1b,_0x3dca1f){return function(_0x408e88){if(_0x408e88){return _0x408e88[_0x1423('0x27')]()[_0x1423('0x26')](function(){var _0x4402b7=_0x408e88[_0x1423('0x28')]({'plain':!![]});var _0x4a000f=_0x1423('0x29');return db['UserProfileResource'][_0x1423('0x27')]({'where':{'type':_0x4a000f,'resourceId':_0x4402b7['id']}})['then'](function(){return _0x408e88;});})[_0x1423('0x26')](function(){_0xadeb1b[_0x1423('0x1b')](0xcc)[_0x1423('0x1c')]();});}};}function handleEntityNotFound(_0x4eb35b,_0x10a694){return function(_0xa7d357){if(!_0xa7d357){_0x4eb35b['sendStatus'](0x194);}return _0xa7d357;};}function handleError(_0x2322fc,_0x4133a0){_0x4133a0=_0x4133a0||0x1f4;return function(_0x327eb7){logger[_0x1423('0x2a')](_0x327eb7[_0x1423('0x2b')]);if(_0x327eb7[_0x1423('0x2c')]){delete _0x327eb7['name'];}_0x2322fc[_0x1423('0x1b')](_0x4133a0)[_0x1423('0x2d')](_0x327eb7);};}exports['index']=function(_0x4ae52b,_0x1efebc){var _0x2744e3={},_0x4ace48={},_0x15fb69={'count':0x0,'rows':[]};var _0x55684b=_[_0x1423('0x2e')](db[_0x1423('0x2f')]['rawAttributes'],function(_0x139198){return{'name':_0x139198[_0x1423('0x30')],'type':_0x139198[_0x1423('0x31')][_0x1423('0x32')]};});_0x4ace48[_0x1423('0x33')]=_['map'](_0x55684b,_0x1423('0x2c'));_0x4ace48[_0x1423('0x34')]=_['keys'](_0x4ae52b[_0x1423('0x34')]);_0x4ace48[_0x1423('0x35')]=_[_0x1423('0x36')](_0x4ace48[_0x1423('0x33')],_0x4ace48[_0x1423('0x34')]);_0x2744e3['attributes']=_['intersection'](_0x4ace48[_0x1423('0x33')],qs['fields'](_0x4ae52b['query'][_0x1423('0x37')]));_0x2744e3[_0x1423('0x38')]=_0x2744e3[_0x1423('0x38')][_0x1423('0x39')]?_0x2744e3[_0x1423('0x38')]:_0x4ace48[_0x1423('0x33')];if(!_0x4ae52b[_0x1423('0x34')][_0x1423('0x3a')](_0x1423('0x3b'))){_0x2744e3['limit']=qs['limit'](_0x4ae52b[_0x1423('0x34')][_0x1423('0x1f')]);_0x2744e3[_0x1423('0x1e')]=qs[_0x1423('0x1e')](_0x4ae52b[_0x1423('0x34')][_0x1423('0x1e')]);}_0x2744e3[_0x1423('0x3c')]=qs['sort'](_0x4ae52b[_0x1423('0x34')][_0x1423('0x3d')]);_0x2744e3[_0x1423('0x3e')]=qs['filters'](_['pick'](_0x4ae52b[_0x1423('0x34')],_0x4ace48[_0x1423('0x35')]));if(_0x4ae52b['query'][_0x1423('0x3f')]){_0x2744e3[_0x1423('0x3e')]=_['merge'](_0x2744e3[_0x1423('0x3e')],{'$or':_[_0x1423('0x2e')](_0x55684b,function(_0x38f586){if(_0x38f586[_0x1423('0x31')]!==_0x1423('0x40')){var _0x48a804={};_0x48a804[_0x38f586[_0x1423('0x2c')]]={'$like':'%'+_0x4ae52b['query'][_0x1423('0x3f')]+'%'};return _0x48a804;}})});}_0x2744e3=_['merge']({},_0x2744e3,_0x4ae52b[_0x1423('0x41')]);var _0x2d2700={'where':_0x2744e3[_0x1423('0x3e')]};return db[_0x1423('0x2f')]['count'](_0x2d2700)[_0x1423('0x26')](function(_0x23272f){_0x15fb69[_0x1423('0x1d')]=_0x23272f;if(_0x4ae52b[_0x1423('0x34')]['includeAll']){_0x2744e3[_0x1423('0x42')]=[{'all':!![]}];}return db[_0x1423('0x2f')][_0x1423('0x43')](_0x2744e3);})[_0x1423('0x26')](function(_0x3a9cc5){_0x15fb69['rows']=_0x3a9cc5;return _0x15fb69;})[_0x1423('0x26')](respondWithFilteredResult(_0x1efebc,_0x2744e3))['catch'](handleError(_0x1efebc,null));};exports[_0x1423('0x44')]=function(_0x1faa5a,_0xc5f054){var _0x5576c9={'raw':![],'where':{'id':_0x1faa5a[_0x1423('0x45')]['id']}},_0x464804={};_0x464804[_0x1423('0x33')]=_[_0x1423('0x46')](db[_0x1423('0x2f')][_0x1423('0x47')]);_0x464804[_0x1423('0x34')]=_['keys'](_0x1faa5a[_0x1423('0x34')]);_0x464804[_0x1423('0x35')]=_[_0x1423('0x36')](_0x464804[_0x1423('0x33')],_0x464804['query']);_0x5576c9[_0x1423('0x38')]=_[_0x1423('0x36')](_0x464804['model'],qs[_0x1423('0x37')](_0x1faa5a[_0x1423('0x34')][_0x1423('0x37')]));_0x5576c9['attributes']=_0x5576c9[_0x1423('0x38')][_0x1423('0x39')]?_0x5576c9['attributes']:_0x464804[_0x1423('0x33')];if(_0x1faa5a[_0x1423('0x34')]['includeAll']){_0x5576c9[_0x1423('0x42')]=[{'all':!![]}];}_0x5576c9=_[_0x1423('0x48')]({},_0x5576c9,_0x1faa5a[_0x1423('0x41')]);return db[_0x1423('0x2f')]['find'](_0x5576c9)[_0x1423('0x26')](handleEntityNotFound(_0xc5f054,null))[_0x1423('0x26')](respondWithResult(_0xc5f054,null))[_0x1423('0x49')](handleError(_0xc5f054,null));};exports[_0x1423('0x4a')]=function(_0x27383b,_0x108e0a){return db['VoiceChanSpy'][_0x1423('0x4a')](_0x27383b[_0x1423('0x4b')],{})[_0x1423('0x26')](function(_0x22c2fc){var _0x16dde5=_0x27383b[_0x1423('0x4c')][_0x1423('0x28')]({'plain':!![]});if(!_0x16dde5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x16dde5[_0x1423('0x4d')]===_0x1423('0x4c')){var _0x39ef9b=_0x22c2fc[_0x1423('0x28')]({'plain':!![]});var _0x1a8e40=_0x1423('0x29');return db[_0x1423('0x4e')]['find']({'where':{'name':_0x1a8e40,'userProfileId':_0x16dde5[_0x1423('0x4f')]},'raw':!![]})['then'](function(_0x33182b){if(_0x33182b&&_0x33182b['autoAssociation']===0x0){return db[_0x1423('0x50')][_0x1423('0x4a')]({'name':_0x39ef9b[_0x1423('0x2c')],'resourceId':_0x39ef9b['id'],'type':_0x33182b[_0x1423('0x2c')],'sectionId':_0x33182b['id']},{})[_0x1423('0x26')](function(){return _0x22c2fc;});}else{return _0x22c2fc;}})[_0x1423('0x49')](function(_0x4e41ac){logger['error'](_0x1423('0x51'),_0x4e41ac);throw _0x4e41ac;});}return _0x22c2fc;})[_0x1423('0x26')](respondWithResult(_0x108e0a,0xc9))[_0x1423('0x49')](handleError(_0x108e0a,null));};exports[_0x1423('0x25')]=function(_0x25ece0,_0x5d2681){if(_0x25ece0[_0x1423('0x4b')]['id']){delete _0x25ece0[_0x1423('0x4b')]['id'];}return db['VoiceChanSpy'][_0x1423('0x52')]({'where':{'id':_0x25ece0[_0x1423('0x45')]['id']}})[_0x1423('0x26')](handleEntityNotFound(_0x5d2681,null))['then'](saveUpdates(_0x25ece0['body'],null))[_0x1423('0x26')](respondWithResult(_0x5d2681,null))[_0x1423('0x49')](handleError(_0x5d2681,null));};exports['destroy']=function(_0x1f390f,_0x280e7f){return db[_0x1423('0x2f')][_0x1423('0x52')]({'where':{'id':_0x1f390f[_0x1423('0x45')]['id']}})['then'](handleEntityNotFound(_0x280e7f,null))[_0x1423('0x26')](removeEntity(_0x280e7f,null))[_0x1423('0x49')](handleError(_0x280e7f,null));}; \ No newline at end of file +var _0xdd22=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','status','json','count','offset','limit','apply','reject','save','update','then','destroy','get','ChanSpies','UserProfileResource','end','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','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','rimraf','zip-dir'];(function(_0x167a4c,_0x3b1673){var _0x10337e=function(_0x1916e7){while(--_0x1916e7){_0x167a4c['push'](_0x167a4c['shift']());}};_0x10337e(++_0x3b1673);}(_0xdd22,0x189));var _0x2dd2=function(_0x3731c2,_0x686035){_0x3731c2=_0x3731c2-0x0;var _0x5a50e3=_0xdd22[_0x3731c2];return _0x5a50e3;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x2dd2('0x0'));var zipdir=require(_0x2dd2('0x1'));var jsonpatch=require(_0x2dd2('0x2'));var rp=require(_0x2dd2('0x3'));var moment=require(_0x2dd2('0x4'));var BPromise=require(_0x2dd2('0x5'));var Mustache=require(_0x2dd2('0x6'));var util=require(_0x2dd2('0x7'));var path=require(_0x2dd2('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x2dd2('0x9'));var crypto=require(_0x2dd2('0xa'));var jsforce=require(_0x2dd2('0xb'));var deskjs=require(_0x2dd2('0xc'));var toCsv=require(_0x2dd2('0xd'));var querystring=require(_0x2dd2('0xe'));var Papa=require(_0x2dd2('0xf'));var Redis=require('ioredis');var authService=require(_0x2dd2('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2dd2('0x11'));var logger=require(_0x2dd2('0x12'))('api');var utils=require(_0x2dd2('0x13'));var config=require(_0x2dd2('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1087e1,_0x445514){_0x445514=_0x445514||0xcc;return function(_0x1fcadd){if(_0x1fcadd){return _0x1087e1['sendStatus'](_0x445514);}return _0x1087e1[_0x2dd2('0x15')](_0x445514)['end']();};}function respondWithResult(_0x43aaa5,_0x5882db){_0x5882db=_0x5882db||0xc8;return function(_0x1d201d){if(_0x1d201d){return _0x43aaa5[_0x2dd2('0x15')](_0x5882db)[_0x2dd2('0x16')](_0x1d201d);}};}function respondWithFilteredResult(_0x40f270,_0x6d3eab){return function(_0x5aa51d){if(_0x5aa51d){var _0x2d0fcf=_0x5aa51d[_0x2dd2('0x17')],_0x4f17df=_0x6d3eab[_0x2dd2('0x18')],_0x167d94=_0x6d3eab[_0x2dd2('0x18')]+_0x6d3eab[_0x2dd2('0x19')],_0x5881ab;if(_0x167d94>=_0x2d0fcf){_0x167d94=_0x2d0fcf;_0x5881ab=0xc8;}else{_0x5881ab=0xce;}_0x40f270[_0x2dd2('0x15')](_0x5881ab);return _0x40f270['set']('Content-Range',_0x4f17df+'-'+_0x167d94+'/'+_0x2d0fcf)[_0x2dd2('0x16')](_0x5aa51d);}return null;};}function patchUpdates(_0x5f4462){return function(_0x27a56e){try{jsonpatch[_0x2dd2('0x1a')](_0x27a56e,_0x5f4462,!![]);}catch(_0x116c36){return BPromise[_0x2dd2('0x1b')](_0x116c36);}return _0x27a56e[_0x2dd2('0x1c')]();};}function saveUpdates(_0x7969e7,_0x1c6b77){return function(_0x1b6398){if(_0x1b6398){return _0x1b6398[_0x2dd2('0x1d')](_0x7969e7)[_0x2dd2('0x1e')](function(_0x10af11){return _0x10af11;});}return null;};}function removeEntity(_0x21e509,_0x3d7399){return function(_0x4f152a){if(_0x4f152a){return _0x4f152a[_0x2dd2('0x1f')]()['then'](function(){var _0x23d66d=_0x4f152a[_0x2dd2('0x20')]({'plain':!![]});var _0x4d2c88=_0x2dd2('0x21');return db[_0x2dd2('0x22')][_0x2dd2('0x1f')]({'where':{'type':_0x4d2c88,'resourceId':_0x23d66d['id']}})[_0x2dd2('0x1e')](function(){return _0x4f152a;});})[_0x2dd2('0x1e')](function(){_0x21e509[_0x2dd2('0x15')](0xcc)[_0x2dd2('0x23')]();});}};}function handleEntityNotFound(_0x21ae33,_0x67ce89){return function(_0x4c7e26){if(!_0x4c7e26){_0x21ae33['sendStatus'](0x194);}return _0x4c7e26;};}function handleError(_0x36c3b4,_0x94f74c){_0x94f74c=_0x94f74c||0x1f4;return function(_0xe43dfe){logger['error'](_0xe43dfe['stack']);if(_0xe43dfe[_0x2dd2('0x24')]){delete _0xe43dfe[_0x2dd2('0x24')];}_0x36c3b4[_0x2dd2('0x15')](_0x94f74c)[_0x2dd2('0x25')](_0xe43dfe);};}exports[_0x2dd2('0x26')]=function(_0x1bd186,_0x4cf43c){var _0x3029ef={},_0x22ef6a={},_0x287fe0={'count':0x0,'rows':[]};var _0x6dabca=_[_0x2dd2('0x27')](db[_0x2dd2('0x28')][_0x2dd2('0x29')],function(_0x3f9a11){return{'name':_0x3f9a11[_0x2dd2('0x2a')],'type':_0x3f9a11[_0x2dd2('0x2b')][_0x2dd2('0x2c')]};});_0x22ef6a[_0x2dd2('0x2d')]=_[_0x2dd2('0x27')](_0x6dabca,_0x2dd2('0x24'));_0x22ef6a[_0x2dd2('0x2e')]=_['keys'](_0x1bd186[_0x2dd2('0x2e')]);_0x22ef6a['filters']=_[_0x2dd2('0x2f')](_0x22ef6a['model'],_0x22ef6a[_0x2dd2('0x2e')]);_0x3029ef['attributes']=_[_0x2dd2('0x2f')](_0x22ef6a[_0x2dd2('0x2d')],qs[_0x2dd2('0x30')](_0x1bd186[_0x2dd2('0x2e')]['fields']));_0x3029ef[_0x2dd2('0x31')]=_0x3029ef[_0x2dd2('0x31')][_0x2dd2('0x32')]?_0x3029ef['attributes']:_0x22ef6a[_0x2dd2('0x2d')];if(!_0x1bd186[_0x2dd2('0x2e')]['hasOwnProperty'](_0x2dd2('0x33'))){_0x3029ef[_0x2dd2('0x19')]=qs[_0x2dd2('0x19')](_0x1bd186['query'][_0x2dd2('0x19')]);_0x3029ef['offset']=qs[_0x2dd2('0x18')](_0x1bd186[_0x2dd2('0x2e')][_0x2dd2('0x18')]);}_0x3029ef[_0x2dd2('0x34')]=qs[_0x2dd2('0x35')](_0x1bd186['query']['sort']);_0x3029ef[_0x2dd2('0x36')]=qs[_0x2dd2('0x37')](_[_0x2dd2('0x38')](_0x1bd186['query'],_0x22ef6a['filters']));if(_0x1bd186[_0x2dd2('0x2e')][_0x2dd2('0x39')]){_0x3029ef[_0x2dd2('0x36')]=_[_0x2dd2('0x3a')](_0x3029ef[_0x2dd2('0x36')],{'$or':_[_0x2dd2('0x27')](_0x6dabca,function(_0x6dede9){if(_0x6dede9[_0x2dd2('0x2b')]!==_0x2dd2('0x3b')){var _0x159f85={};_0x159f85[_0x6dede9[_0x2dd2('0x24')]]={'$like':'%'+_0x1bd186['query']['filter']+'%'};return _0x159f85;}})});}_0x3029ef=_[_0x2dd2('0x3a')]({},_0x3029ef,_0x1bd186['options']);var _0x561a8e={'where':_0x3029ef[_0x2dd2('0x36')]};return db[_0x2dd2('0x28')][_0x2dd2('0x17')](_0x561a8e)[_0x2dd2('0x1e')](function(_0x190db3){_0x287fe0[_0x2dd2('0x17')]=_0x190db3;if(_0x1bd186[_0x2dd2('0x2e')][_0x2dd2('0x3c')]){_0x3029ef[_0x2dd2('0x3d')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0x2dd2('0x3e')](_0x3029ef);})[_0x2dd2('0x1e')](function(_0x31ea51){_0x287fe0[_0x2dd2('0x3f')]=_0x31ea51;return _0x287fe0;})['then'](respondWithFilteredResult(_0x4cf43c,_0x3029ef))[_0x2dd2('0x40')](handleError(_0x4cf43c,null));};exports[_0x2dd2('0x41')]=function(_0x588cff,_0x2145ff){var _0x42c170={'raw':![],'where':{'id':_0x588cff[_0x2dd2('0x42')]['id']}},_0x2f853c={};_0x2f853c[_0x2dd2('0x2d')]=_[_0x2dd2('0x43')](db['VoiceChanSpy']['rawAttributes']);_0x2f853c['query']=_['keys'](_0x588cff[_0x2dd2('0x2e')]);_0x2f853c[_0x2dd2('0x37')]=_[_0x2dd2('0x2f')](_0x2f853c[_0x2dd2('0x2d')],_0x2f853c['query']);_0x42c170[_0x2dd2('0x31')]=_[_0x2dd2('0x2f')](_0x2f853c[_0x2dd2('0x2d')],qs[_0x2dd2('0x30')](_0x588cff[_0x2dd2('0x2e')][_0x2dd2('0x30')]));_0x42c170[_0x2dd2('0x31')]=_0x42c170['attributes']['length']?_0x42c170[_0x2dd2('0x31')]:_0x2f853c[_0x2dd2('0x2d')];if(_0x588cff[_0x2dd2('0x2e')][_0x2dd2('0x3c')]){_0x42c170[_0x2dd2('0x3d')]=[{'all':!![]}];}_0x42c170=_[_0x2dd2('0x3a')]({},_0x42c170,_0x588cff['options']);return db[_0x2dd2('0x28')][_0x2dd2('0x44')](_0x42c170)[_0x2dd2('0x1e')](handleEntityNotFound(_0x2145ff,null))['then'](respondWithResult(_0x2145ff,null))[_0x2dd2('0x40')](handleError(_0x2145ff,null));};exports[_0x2dd2('0x45')]=function(_0x2c7f07,_0x22ddb8){return db[_0x2dd2('0x28')][_0x2dd2('0x45')](_0x2c7f07[_0x2dd2('0x46')],{})[_0x2dd2('0x1e')](function(_0x293761){var _0x3f53d2=_0x2c7f07[_0x2dd2('0x47')][_0x2dd2('0x20')]({'plain':!![]});if(!_0x3f53d2)throw new Error(_0x2dd2('0x48'));if(_0x3f53d2[_0x2dd2('0x49')]===_0x2dd2('0x47')){var _0x2ae0d3=_0x293761[_0x2dd2('0x20')]({'plain':!![]});var _0x1cefb4='ChanSpies';return db[_0x2dd2('0x4a')]['find']({'where':{'name':_0x1cefb4,'userProfileId':_0x3f53d2[_0x2dd2('0x4b')]},'raw':!![]})['then'](function(_0x51dfb6){if(_0x51dfb6&&_0x51dfb6[_0x2dd2('0x4c')]===0x0){return db[_0x2dd2('0x22')][_0x2dd2('0x45')]({'name':_0x2ae0d3[_0x2dd2('0x24')],'resourceId':_0x2ae0d3['id'],'type':_0x51dfb6[_0x2dd2('0x24')],'sectionId':_0x51dfb6['id']},{})[_0x2dd2('0x1e')](function(){return _0x293761;});}else{return _0x293761;}})[_0x2dd2('0x40')](function(_0x4c75cc){logger[_0x2dd2('0x4d')](_0x2dd2('0x4e'),_0x4c75cc);throw _0x4c75cc;});}return _0x293761;})[_0x2dd2('0x1e')](respondWithResult(_0x22ddb8,0xc9))[_0x2dd2('0x40')](handleError(_0x22ddb8,null));};exports['update']=function(_0x3bdfd8,_0x4734e9){if(_0x3bdfd8[_0x2dd2('0x46')]['id']){delete _0x3bdfd8[_0x2dd2('0x46')]['id'];}return db[_0x2dd2('0x28')]['find']({'where':{'id':_0x3bdfd8['params']['id']}})[_0x2dd2('0x1e')](handleEntityNotFound(_0x4734e9,null))[_0x2dd2('0x1e')](saveUpdates(_0x3bdfd8['body'],null))['then'](respondWithResult(_0x4734e9,null))[_0x2dd2('0x40')](handleError(_0x4734e9,null));};exports[_0x2dd2('0x1f')]=function(_0x4bda0b,_0x3738dd){return db[_0x2dd2('0x28')]['find']({'where':{'id':_0x4bda0b[_0x2dd2('0x42')]['id']}})[_0x2dd2('0x1e')](handleEntityNotFound(_0x3738dd,null))[_0x2dd2('0x1e')](removeEntity(_0x3738dd,null))['catch'](handleError(_0x3738dd,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index b5bb049..b35d222 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 _0x5718=['options','join','StopMixMonitor','internal','concat','User','findAll','then','catch','exports','define','VoiceChanSpy','voice_chanspy','length','VoiceExtension','destroy','util','bluebird','./voiceChanSpy.attributes','from-sip','format','%s%s','system','push','merge','Set','chanspy','record','${UNIQUEID}.%s,ab','recordingFormat','auth','Authenticate','password','SIP/%s,%s','name'];(function(_0xeef582,_0x36a3c3){var _0xd15d75=function(_0x248adb){while(--_0x248adb){_0xeef582['push'](_0xeef582['shift']());}};_0xd15d75(++_0x36a3c3);}(_0x5718,0x1b4));var _0x8571=function(_0x1146b0,_0x5ff33){_0x1146b0=_0x1146b0-0x0;var _0x5f5a21=_0x5718[_0x1146b0];return _0x5f5a21;};'use strict';var _=require('lodash');var util=require(_0x8571('0x0'));var BPromise=require(_0x8571('0x1'));var attributes=require(_0x8571('0x2'));var getUserApplications=function(_0xfe93a2,_0x4693f3,_0x121b70){var _0x3d7ddf=0x1;var _0x5d8ede=[];var _0x1ae42e={'context':_0x4693f3['context']||_0x8571('0x3'),'exten':util[_0x8571('0x4')](_0x8571('0x5'),_0xfe93a2['prefix'],_0x121b70),'type':_0x8571('0x6'),'isApp':![],'ChanSpyId':_0xfe93a2['id'],'UserId':_0x4693f3['id']};_0x5d8ede[_0x8571('0x7')](_[_0x8571('0x8')]({'app':_0x8571('0x9'),'appdata':util[_0x8571('0x4')]('CDR(type)=%s',_0x8571('0xa')),'priority':_0x3d7ddf++},_0x1ae42e));if(_0xfe93a2[_0x8571('0xb')]){_0x5d8ede['push'](_[_0x8571('0x8')]({'app':'MixMonitor','appdata':util[_0x8571('0x4')](_0x8571('0xc'),_0xfe93a2[_0x8571('0xd')]),'priority':_0x3d7ddf++},_0x1ae42e));}if(_0xfe93a2[_0x8571('0xe')]){_0x5d8ede[_0x8571('0x7')](_[_0x8571('0x8')]({'app':_0x8571('0xf'),'appdata':_0xfe93a2[_0x8571('0x10')],'priority':_0x3d7ddf++},_0x1ae42e));}_0x5d8ede[_0x8571('0x7')](_[_0x8571('0x8')]({'app':'ChanSpy','appdata':util[_0x8571('0x4')](_0x8571('0x11'),_0x4693f3[_0x8571('0x12')],_0xfe93a2[_0x8571('0x13')]?_0xfe93a2['options'][_0x8571('0x14')](''):''),'priority':_0x3d7ddf++},_0x1ae42e));if(_0xfe93a2[_0x8571('0xb')]){_0x5d8ede[_0x8571('0x7')](_[_0x8571('0x8')]({'app':_0x8571('0x15'),'priority':_0x3d7ddf++},_0x1ae42e));}return _0x5d8ede;};var getChanSpyApplications=function(_0x202fb7,_0x2f84b7){var _0x2f09e0=[];for(var _0x561ffa=0x0,_0x340a62=0x1;_0x561ffa<_0x2f84b7['length'];_0x561ffa++,_0x340a62=0x1){_0x2f09e0=_0x2f09e0['concat'](getUserApplications(_0x202fb7,_0x2f84b7[_0x561ffa],_0x2f84b7[_0x561ffa]['internal']));if(_0x2f84b7[_0x561ffa][_0x8571('0x16')]!=_0x2f84b7[_0x561ffa][_0x8571('0x12')]){_0x2f09e0=_0x2f09e0[_0x8571('0x17')](getUserApplications(_0x202fb7,_0x2f84b7[_0x561ffa],_0x2f84b7[_0x561ffa][_0x8571('0x12')]));}}return _0x2f09e0;};var getChanSpyPromise=function(_0x263e72,_0x521e6d){return new BPromise(function(_0x47e7a9,_0x8e8c6c){return _0x263e72[_0x8571('0x18')][_0x8571('0x19')]({'attributes':['id',_0x8571('0x12'),'internal'],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0x8571('0x1a')](function(_0x5d6a3c){if(_0x5d6a3c){return _0x47e7a9(getChanSpyApplications(_0x521e6d,_0x5d6a3c));}return _0x47e7a9([]);})[_0x8571('0x1b')](function(_0x506cdc){_0x8e8c6c(_0x506cdc);});});};module[_0x8571('0x1c')]=function(_0x18a975,_0x2c7be1){var _0x441501=_0x18a975['models'];return _0x18a975[_0x8571('0x1d')](_0x8571('0x1e'),attributes,{'tableName':_0x8571('0x1f'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x51336a,_0x566b41,_0xb2ca7c){return getChanSpyPromise(_0x441501,_0x51336a)[_0x8571('0x1a')](function(_0x30f318){if(_0x30f318&&_0x30f318[_0x8571('0x20')]){return _0x441501['VoiceExtension']['bulkCreate'](_0x30f318);}})['then'](function(){_0xb2ca7c();})[_0x8571('0x1b')](function(_0x332a39){_0xb2ca7c(_0x332a39);});},'afterUpdate':function(_0x3dc83f,_0x5d8179,_0x5b8174){return _0x441501[_0x8571('0x21')][_0x8571('0x22')]({'where':{'ChanSpyId':_0x3dc83f['id']}})[_0x8571('0x1a')](function(){return getChanSpyPromise(_0x441501,_0x3dc83f);})['then'](function(_0x507584){if(_0x507584&&_0x507584['length']){return _0x441501[_0x8571('0x21')]['bulkCreate'](_0x507584);}})['then'](function(){_0x5b8174();})[_0x8571('0x1b')](function(_0x2c33bd){_0x5b8174(_0x2c33bd);});},'afterDestroy':function(_0x2bfbc0,_0x38cf78,_0x402d92){return _0x441501['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0x2bfbc0['id']}})[_0x8571('0x1a')](function(){_0x402d92();})[_0x8571('0x1b')](function(_0x43795a){_0x402d92(_0x43795a);});}}});}; \ No newline at end of file +var _0x903c=['${UNIQUEID}.%s,ab','auth','password','ChanSpy','options','join','StopMixMonitor','length','concat','internal','name','User','findAll','agent','catch','exports','models','define','voice_chanspy','VoiceExtension','bulkCreate','then','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','prefix','system','push','CDR(type)=%s','record','merge','MixMonitor'];(function(_0x2140c5,_0x5c66cd){var _0x5f123f=function(_0x58bdbd){while(--_0x58bdbd){_0x2140c5['push'](_0x2140c5['shift']());}};_0x5f123f(++_0x5c66cd);}(_0x903c,0xd0));var _0xc903=function(_0x3d1b44,_0x28d01b){_0x3d1b44=_0x3d1b44-0x0;var _0x143aa7=_0x903c[_0x3d1b44];return _0x143aa7;};'use strict';var _=require(_0xc903('0x0'));var util=require(_0xc903('0x1'));var BPromise=require(_0xc903('0x2'));var attributes=require(_0xc903('0x3'));var getUserApplications=function(_0x2a1d66,_0x1bc125,_0x1a5de3){var _0x24aea1=0x1;var _0x49e244=[];var _0x5373c0={'context':_0x1bc125[_0xc903('0x4')]||_0xc903('0x5'),'exten':util[_0xc903('0x6')]('%s%s',_0x2a1d66[_0xc903('0x7')],_0x1a5de3),'type':_0xc903('0x8'),'isApp':![],'ChanSpyId':_0x2a1d66['id'],'UserId':_0x1bc125['id']};_0x49e244[_0xc903('0x9')](_['merge']({'app':'Set','appdata':util[_0xc903('0x6')](_0xc903('0xa'),'chanspy'),'priority':_0x24aea1++},_0x5373c0));if(_0x2a1d66[_0xc903('0xb')]){_0x49e244['push'](_[_0xc903('0xc')]({'app':_0xc903('0xd'),'appdata':util['format'](_0xc903('0xe'),_0x2a1d66['recordingFormat']),'priority':_0x24aea1++},_0x5373c0));}if(_0x2a1d66[_0xc903('0xf')]){_0x49e244[_0xc903('0x9')](_['merge']({'app':'Authenticate','appdata':_0x2a1d66[_0xc903('0x10')],'priority':_0x24aea1++},_0x5373c0));}_0x49e244[_0xc903('0x9')](_[_0xc903('0xc')]({'app':_0xc903('0x11'),'appdata':util[_0xc903('0x6')]('SIP/%s,%s',_0x1bc125['name'],_0x2a1d66[_0xc903('0x12')]?_0x2a1d66[_0xc903('0x12')][_0xc903('0x13')](''):''),'priority':_0x24aea1++},_0x5373c0));if(_0x2a1d66[_0xc903('0xb')]){_0x49e244['push'](_[_0xc903('0xc')]({'app':_0xc903('0x14'),'priority':_0x24aea1++},_0x5373c0));}return _0x49e244;};var getChanSpyApplications=function(_0x1522b0,_0x43fe0c){var _0x112031=[];for(var _0xc18d11=0x0,_0x4f36b1=0x1;_0xc18d11<_0x43fe0c[_0xc903('0x15')];_0xc18d11++,_0x4f36b1=0x1){_0x112031=_0x112031[_0xc903('0x16')](getUserApplications(_0x1522b0,_0x43fe0c[_0xc18d11],_0x43fe0c[_0xc18d11][_0xc903('0x17')]));if(_0x43fe0c[_0xc18d11][_0xc903('0x17')]!=_0x43fe0c[_0xc18d11][_0xc903('0x18')]){_0x112031=_0x112031[_0xc903('0x16')](getUserApplications(_0x1522b0,_0x43fe0c[_0xc18d11],_0x43fe0c[_0xc18d11][_0xc903('0x18')]));}}return _0x112031;};var getChanSpyPromise=function(_0x40dab0,_0x24d10d){return new BPromise(function(_0x44e9d3,_0x10f3fd){return _0x40dab0[_0xc903('0x19')][_0xc903('0x1a')]({'attributes':['id','name',_0xc903('0x17')],'where':{'role':_0xc903('0x1b'),'chanspy':!![]},'raw':!![]})['then'](function(_0x11d8bc){if(_0x11d8bc){return _0x44e9d3(getChanSpyApplications(_0x24d10d,_0x11d8bc));}return _0x44e9d3([]);})[_0xc903('0x1c')](function(_0x352456){_0x10f3fd(_0x352456);});});};module[_0xc903('0x1d')]=function(_0x4a4658,_0x41e67a){var _0x3f1a77=_0x4a4658[_0xc903('0x1e')];return _0x4a4658[_0xc903('0x1f')]('VoiceChanSpy',attributes,{'tableName':_0xc903('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2fa591,_0x50ab37,_0x2e14da){return getChanSpyPromise(_0x3f1a77,_0x2fa591)['then'](function(_0x6a259){if(_0x6a259&&_0x6a259[_0xc903('0x15')]){return _0x3f1a77[_0xc903('0x21')][_0xc903('0x22')](_0x6a259);}})[_0xc903('0x23')](function(){_0x2e14da();})[_0xc903('0x1c')](function(_0x8a2b1a){_0x2e14da(_0x8a2b1a);});},'afterUpdate':function(_0x438202,_0x173311,_0x17f17b){return _0x3f1a77[_0xc903('0x21')][_0xc903('0x24')]({'where':{'ChanSpyId':_0x438202['id']}})['then'](function(){return getChanSpyPromise(_0x3f1a77,_0x438202);})[_0xc903('0x23')](function(_0x417bac){if(_0x417bac&&_0x417bac[_0xc903('0x15')]){return _0x3f1a77['VoiceExtension'][_0xc903('0x22')](_0x417bac);}})[_0xc903('0x23')](function(){_0x17f17b();})[_0xc903('0x1c')](function(_0x31650c){_0x17f17b(_0x31650c);});},'afterDestroy':function(_0x12ada3,_0x4e4650,_0x12c34c){return _0x3f1a77['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0x12ada3['id']}})[_0xc903('0x23')](function(){_0x12c34c();})[_0xc903('0x1c')](function(_0x2112a8){_0x12c34c(_0x2112a8);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 1581c34..fc70948 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 _0x7cb6=['stringify','error','code','VoiceChanSpy,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x487995,_0x2d7f45){var _0x15d6b7=function(_0x43b684){while(--_0x43b684){_0x487995['push'](_0x487995['shift']());}};_0x15d6b7(++_0x2d7f45);}(_0x7cb6,0x11b));var _0x67cb=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x7cb6[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require(_0x67cb('0x0'));var moment=require(_0x67cb('0x1'));var BPromise=require(_0x67cb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x67cb('0x3'));var db=require(_0x67cb('0x4'))['db'];var utils=require(_0x67cb('0x5'));var logger=require(_0x67cb('0x6'))(_0x67cb('0x7'));var config=require('../../config/environment');var jayson=require(_0x67cb('0x8'));var client=jayson[_0x67cb('0x9')][_0x67cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x33af45,_0x3c2f54,_0x2440a7){return new BPromise(function(_0x25f8f1,_0x4976aa){return client[_0x67cb('0xb')](_0x33af45,_0x2440a7)['then'](function(_0xd023ee){logger[_0x67cb('0xc')]('VoiceChanSpy,\x20%s,\x20%s',_0x3c2f54,'request\x20sent');logger[_0x67cb('0xd')](_0x67cb('0xe'),_0x3c2f54,_0x67cb('0xf'),JSON[_0x67cb('0x10')](_0xd023ee));if(_0xd023ee[_0x67cb('0x11')]){if(_0xd023ee[_0x67cb('0x11')][_0x67cb('0x12')]===0x1f4){logger[_0x67cb('0x11')](_0x67cb('0x13'),_0x3c2f54,_0xd023ee[_0x67cb('0x11')][_0x67cb('0x14')]);return _0x4976aa(_0xd023ee[_0x67cb('0x11')][_0x67cb('0x14')]);}logger[_0x67cb('0x11')](_0x67cb('0x13'),_0x3c2f54,_0xd023ee[_0x67cb('0x11')][_0x67cb('0x14')]);return _0x25f8f1(_0xd023ee[_0x67cb('0x11')][_0x67cb('0x14')]);}else{logger[_0x67cb('0xc')](_0x67cb('0x13'),_0x3c2f54,_0x67cb('0xf'));_0x25f8f1(_0xd023ee[_0x67cb('0x15')][_0x67cb('0x14')]);}})[_0x67cb('0x16')](function(_0x32825a){logger['error'](_0x67cb('0x13'),_0x3c2f54,_0x32825a);_0x4976aa(_0x32825a);});});} \ No newline at end of file +var _0x07bb=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x07bb,0x1cb));var _0xb07b=function(_0x45c762,_0x5aa7a4){_0x45c762=_0x45c762-0x0;var _0x26a215=_0x07bb[_0x45c762];return _0x26a215;};'use strict';var _=require(_0xb07b('0x0'));var util=require('util');var moment=require(_0xb07b('0x1'));var BPromise=require(_0xb07b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb07b('0x3'))['db'];var utils=require(_0xb07b('0x4'));var logger=require(_0xb07b('0x5'))(_0xb07b('0x6'));var config=require('../../config/environment');var jayson=require(_0xb07b('0x7'));var client=jayson[_0xb07b('0x8')][_0xb07b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xef9334,_0x406934,_0x2aff47){return new BPromise(function(_0x457688,_0x1823d5){return client[_0xb07b('0xa')](_0xef9334,_0x2aff47)[_0xb07b('0xb')](function(_0x430cc1){logger[_0xb07b('0xc')](_0xb07b('0xd'),_0x406934,_0xb07b('0xe'));logger[_0xb07b('0xf')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x406934,_0xb07b('0xe'),JSON[_0xb07b('0x10')](_0x430cc1));if(_0x430cc1[_0xb07b('0x11')]){if(_0x430cc1[_0xb07b('0x11')][_0xb07b('0x12')]===0x1f4){logger[_0xb07b('0x11')](_0xb07b('0xd'),_0x406934,_0x430cc1['error']['message']);return _0x1823d5(_0x430cc1[_0xb07b('0x11')][_0xb07b('0x13')]);}logger[_0xb07b('0x11')](_0xb07b('0xd'),_0x406934,_0x430cc1[_0xb07b('0x11')]['message']);return _0x457688(_0x430cc1['error']['message']);}else{logger['info'](_0xb07b('0xd'),_0x406934,_0xb07b('0xe'));_0x457688(_0x430cc1[_0xb07b('0x14')][_0xb07b('0x13')]);}})[_0xb07b('0x15')](function(_0x5a6d12){logger[_0xb07b('0x11')](_0xb07b('0xd'),_0x406934,_0x5a6d12);_0x1823d5(_0x5a6d12);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index a8cb2bc..b325c93 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 _0xb01c=['../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','create','put','update','destroy','exports','multer','util','path','../../components/auth/service'];(function(_0x595013,_0x65a215){var _0x2a29e3=function(_0x307bf8){while(--_0x307bf8){_0x595013['push'](_0x595013['shift']());}};_0x2a29e3(++_0x65a215);}(_0xb01c,0x74));var _0xcb01=function(_0x4fe343,_0x325ce2){_0x4fe343=_0x4fe343-0x0;var _0x482745=_0xb01c[_0x4fe343];return _0x482745;};'use strict';var multer=require(_0xcb01('0x0'));var util=require(_0xcb01('0x1'));var path=require(_0xcb01('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0xcb01('0x3'));var interaction=require(_0xcb01('0x4'));var config=require(_0xcb01('0x5'));var controller=require('./voiceContext.controller');router[_0xcb01('0x6')]('/',auth['isAuthenticated'](),controller[_0xcb01('0x7')]);router[_0xcb01('0x6')](_0xcb01('0x8'),auth[_0xcb01('0x9')](),controller['show']);router['post']('/',auth[_0xcb01('0x9')](),controller[_0xcb01('0xa')]);router[_0xcb01('0xb')]('/:id',auth[_0xcb01('0x9')](),controller[_0xcb01('0xc')]);router['delete'](_0xcb01('0x8'),auth['isAuthenticated'](),controller[_0xcb01('0xd')]);module[_0xcb01('0xe')]=router; \ No newline at end of file +var _0x4798=['get','/:id','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./voiceContext.controller','isAuthenticated','index'];(function(_0x9f664f,_0x247636){var _0x4318d9=function(_0x404156){while(--_0x404156){_0x9f664f['push'](_0x9f664f['shift']());}};_0x4318d9(++_0x247636);}(_0x4798,0xce));var _0x8479=function(_0x479011,_0x3f5155){_0x479011=_0x479011-0x0;var _0x4f3c39=_0x4798[_0x479011];return _0x4f3c39;};'use strict';var multer=require(_0x8479('0x0'));var util=require(_0x8479('0x1'));var path=require(_0x8479('0x2'));var timeout=require(_0x8479('0x3'));var express=require('express');var router=express[_0x8479('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x8479('0x5'));var config=require(_0x8479('0x6'));var controller=require(_0x8479('0x7'));router['get']('/',auth[_0x8479('0x8')](),controller[_0x8479('0x9')]);router[_0x8479('0xa')](_0x8479('0xb'),auth[_0x8479('0x8')](),controller['show']);router[_0x8479('0xc')]('/',auth[_0x8479('0x8')](),controller['create']);router[_0x8479('0xd')](_0x8479('0xb'),auth[_0x8479('0x8')](),controller[_0x8479('0xe')]);router[_0x8479('0xf')](_0x8479('0xb'),auth['isAuthenticated'](),controller[_0x8479('0x10')]);module[_0x8479('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 9eeb585..5ecdee2 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 _0x3e74=['name','sequelize','STRING'];(function(_0x1306e9,_0x4fd1ce){var _0x15eafb=function(_0x16ebed){while(--_0x16ebed){_0x1306e9['push'](_0x1306e9['shift']());}};_0x15eafb(++_0x4fd1ce);}(_0x3e74,0x175));var _0x43e7=function(_0x4be282,_0x3214da){_0x4be282=_0x4be282-0x0;var _0x411988=_0x3e74[_0x4be282];return _0x411988;};'use strict';var Sequelize=require(_0x43e7('0x0'));module['exports']={'name':{'type':Sequelize[_0x43e7('0x1')],'unique':_0x43e7('0x2')},'description':{'type':Sequelize[_0x43e7('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0x3e74=['name','sequelize','STRING'];(function(_0xc3b5ef,_0x300f79){var _0x3d13bc=function(_0xcd7632){while(--_0xcd7632){_0xc3b5ef['push'](_0xc3b5ef['shift']());}};_0x3d13bc(++_0x300f79);}(_0x3e74,0x175));var _0x43e7=function(_0x43529a,_0x4914f8){_0x43529a=_0x43529a-0x0;var _0x4636fc=_0x3e74[_0x43529a];return _0x4636fc;};'use strict';var Sequelize=require(_0x43e7('0x0'));module['exports']={'name':{'type':Sequelize[_0x43e7('0x1')],'unique':_0x43e7('0x2')},'description':{'type':Sequelize[_0x43e7('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 be5abb6..2128c3c 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 _0xb4d7=['zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','jayson/promise','client','http','Sequelize','ValidationError','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','error','message','result','sendStatus','end','json','offset','limit','status','set','Content-Range','apply','reject','save','destroy','get','Contexts','UserProfileResource','name','send','map','rawAttributes','key','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','type','VIRTUAL','VoiceContext','count','includeAll','include','findAll','rows','show','keys','options','find','catch','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','update','params','chan_sip.so','Reload','html-pdf'];(function(_0x11b0cc,_0x4df2e1){var _0x17f510=function(_0x1d7cc8){while(--_0x1d7cc8){_0x11b0cc['push'](_0x11b0cc['shift']());}};_0x17f510(++_0x4df2e1);}(_0xb4d7,0x125));var _0x7b4d=function(_0x434642,_0x4d42ca){_0x434642=_0x434642-0x0;var _0x20acd8=_0xb4d7[_0x434642];return _0x20acd8;};'use strict';var pdf=require(_0x7b4d('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7b4d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7b4d('0x2'));var moment=require(_0x7b4d('0x3'));var BPromise=require(_0x7b4d('0x4'));var Mustache=require('mustache');var util=require(_0x7b4d('0x5'));var path=require(_0x7b4d('0x6'));var sox=require(_0x7b4d('0x7'));var csv=require(_0x7b4d('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7b4d('0x9'));var squel=require(_0x7b4d('0xa'));var crypto=require('crypto');var jsforce=require(_0x7b4d('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x7b4d('0x8'));var querystring=require('querystring');var Papa=require(_0x7b4d('0xc'));var Redis=require(_0x7b4d('0xd'));var authService=require(_0x7b4d('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x7b4d('0xf'));var hardwareService=require(_0x7b4d('0x10'));var logger=require('../../config/logger')(_0x7b4d('0x11'));var utils=require(_0x7b4d('0x12'));var config=require('../../config/environment');var db=require(_0x7b4d('0x13'))['db'];var jayson=require(_0x7b4d('0x14'));var client=jayson[_0x7b4d('0x15')][_0x7b4d('0x16')]({'port':0x232a});function checkPasswordPattern(_0xf94fc7,_0x1ef17e,_0x1125df){if(_0x1125df){var _0x5400c5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5400c5['test'](_0x1ef17e)){return _0xf94fc7;}else{throw new db[(_0x7b4d('0x17'))][(_0x7b4d('0x18'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0xf94fc7;}}function respondWithRpcPromise(_0x383d91,_0x848b2d,_0x2decf3,_0x4efbba){return new BPromise(function(_0x83b20b,_0x169804){var _0x26616a=_0x4efbba||client;return _0x26616a['request'](_0x383d91,_0x2decf3)[_0x7b4d('0x19')](function(_0x2dcb63){logger[_0x7b4d('0x1a')](_0x7b4d('0x1b'),_0x848b2d,_0x7b4d('0x1c'));logger[_0x7b4d('0x1d')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x848b2d,_0x7b4d('0x1c'),JSON['stringify'](_0x2dcb63));if(_0x2dcb63[_0x7b4d('0x1e')]){if(_0x2dcb63['error']['code']===0x1f4){logger[_0x7b4d('0x1e')]('VoiceContext,\x20%s,\x20%s',_0x848b2d,_0x2dcb63['error'][_0x7b4d('0x1f')]);return _0x169804(_0x2dcb63[_0x7b4d('0x1e')]['message']);}logger[_0x7b4d('0x1e')](_0x7b4d('0x1b'),_0x848b2d,_0x2dcb63['error'][_0x7b4d('0x1f')]);return _0x83b20b(_0x2dcb63['error'][_0x7b4d('0x1f')]);}else{logger[_0x7b4d('0x1a')](_0x7b4d('0x1b'),_0x848b2d,_0x7b4d('0x1c'));_0x83b20b(_0x2dcb63[_0x7b4d('0x20')][_0x7b4d('0x1f')]);}})['catch'](function(_0x3588c1){logger[_0x7b4d('0x1e')](_0x7b4d('0x1b'),_0x848b2d,_0x3588c1);_0x169804(_0x3588c1);});});}function respondWithStatusCode(_0x41bf0f,_0x380a1e){_0x380a1e=_0x380a1e||0xcc;return function(_0x3e83b2){if(_0x3e83b2){return _0x41bf0f[_0x7b4d('0x21')](_0x380a1e);}return _0x41bf0f['status'](_0x380a1e)[_0x7b4d('0x22')]();};}function respondWithResult(_0x5d52d7,_0x23c285){_0x23c285=_0x23c285||0xc8;return function(_0x8acab8){if(_0x8acab8){return _0x5d52d7['status'](_0x23c285)[_0x7b4d('0x23')](_0x8acab8);}};}function respondWithFilteredResult(_0x1d1d6b,_0x5d8ac9){return function(_0x459e86){if(_0x459e86){var _0x47fdf4=_0x459e86['count'],_0x38b021=_0x5d8ac9[_0x7b4d('0x24')],_0x2bc6bb=_0x5d8ac9[_0x7b4d('0x24')]+_0x5d8ac9[_0x7b4d('0x25')],_0x3e989b;if(_0x2bc6bb>=_0x47fdf4){_0x2bc6bb=_0x47fdf4;_0x3e989b=0xc8;}else{_0x3e989b=0xce;}_0x1d1d6b[_0x7b4d('0x26')](_0x3e989b);return _0x1d1d6b[_0x7b4d('0x27')](_0x7b4d('0x28'),_0x38b021+'-'+_0x2bc6bb+'/'+_0x47fdf4)[_0x7b4d('0x23')](_0x459e86);}return null;};}function patchUpdates(_0x533501){return function(_0x4bc5d9){try{jsonpatch[_0x7b4d('0x29')](_0x4bc5d9,_0x533501,!![]);}catch(_0x40f0b9){return BPromise[_0x7b4d('0x2a')](_0x40f0b9);}return _0x4bc5d9[_0x7b4d('0x2b')]();};}function saveUpdates(_0x3e39e3,_0xdf5f56){return function(_0x21624c){if(_0x21624c){return _0x21624c['update'](_0x3e39e3)[_0x7b4d('0x19')](function(_0xabfbc5){return _0xabfbc5;});}return null;};}function removeEntity(_0x21b1cd,_0x4ac455){return function(_0x503c06){if(_0x503c06){return _0x503c06[_0x7b4d('0x2c')]()[_0x7b4d('0x19')](function(){var _0x18945c=_0x503c06[_0x7b4d('0x2d')]({'plain':!![]});var _0x4bab4f=_0x7b4d('0x2e');return db[_0x7b4d('0x2f')]['destroy']({'where':{'type':_0x4bab4f,'resourceId':_0x18945c['id']}})[_0x7b4d('0x19')](function(){return _0x503c06;});})[_0x7b4d('0x19')](function(){_0x21b1cd[_0x7b4d('0x26')](0xcc)[_0x7b4d('0x22')]();});}};}function handleEntityNotFound(_0x3aa1fa,_0x3f1c32){return function(_0x442f1f){if(!_0x442f1f){_0x3aa1fa[_0x7b4d('0x21')](0x194);}return _0x442f1f;};}function handleError(_0x3ac6db,_0x527f9d){_0x527f9d=_0x527f9d||0x1f4;return function(_0x56e727){logger[_0x7b4d('0x1e')](_0x56e727['stack']);if(_0x56e727[_0x7b4d('0x30')]){delete _0x56e727['name'];}_0x3ac6db[_0x7b4d('0x26')](_0x527f9d)[_0x7b4d('0x31')](_0x56e727);};}exports['index']=function(_0x17d834,_0x1a2861){var _0xe55b4c={},_0x4a2309={},_0x4af23a={'count':0x0,'rows':[]};var _0x361289=_[_0x7b4d('0x32')](db['VoiceContext'][_0x7b4d('0x33')],function(_0x29e21e){return{'name':_0x29e21e['fieldName'],'type':_0x29e21e['type'][_0x7b4d('0x34')]};});_0x4a2309['model']=_[_0x7b4d('0x32')](_0x361289,_0x7b4d('0x30'));_0x4a2309[_0x7b4d('0x35')]=_['keys'](_0x17d834[_0x7b4d('0x35')]);_0x4a2309['filters']=_[_0x7b4d('0x36')](_0x4a2309[_0x7b4d('0x37')],_0x4a2309[_0x7b4d('0x35')]);_0xe55b4c['attributes']=_[_0x7b4d('0x36')](_0x4a2309[_0x7b4d('0x37')],qs[_0x7b4d('0x38')](_0x17d834[_0x7b4d('0x35')][_0x7b4d('0x38')]));_0xe55b4c[_0x7b4d('0x39')]=_0xe55b4c[_0x7b4d('0x39')][_0x7b4d('0x3a')]?_0xe55b4c[_0x7b4d('0x39')]:_0x4a2309[_0x7b4d('0x37')];if(!_0x17d834[_0x7b4d('0x35')][_0x7b4d('0x3b')](_0x7b4d('0x3c'))){_0xe55b4c[_0x7b4d('0x25')]=qs[_0x7b4d('0x25')](_0x17d834[_0x7b4d('0x35')][_0x7b4d('0x25')]);_0xe55b4c['offset']=qs[_0x7b4d('0x24')](_0x17d834[_0x7b4d('0x35')]['offset']);}_0xe55b4c['order']=qs[_0x7b4d('0x3d')](_0x17d834[_0x7b4d('0x35')][_0x7b4d('0x3d')]);_0xe55b4c[_0x7b4d('0x3e')]=qs[_0x7b4d('0x3f')](_['pick'](_0x17d834[_0x7b4d('0x35')],_0x4a2309['filters']));if(_0x17d834[_0x7b4d('0x35')][_0x7b4d('0x40')]){_0xe55b4c['where']=_[_0x7b4d('0x41')](_0xe55b4c[_0x7b4d('0x3e')],{'$or':_[_0x7b4d('0x32')](_0x361289,function(_0x275cbf){if(_0x275cbf[_0x7b4d('0x42')]!==_0x7b4d('0x43')){var _0x4c7bea={};_0x4c7bea[_0x275cbf[_0x7b4d('0x30')]]={'$like':'%'+_0x17d834['query'][_0x7b4d('0x40')]+'%'};return _0x4c7bea;}})});}_0xe55b4c=_[_0x7b4d('0x41')]({},_0xe55b4c,_0x17d834['options']);var _0x370e86={'where':_0xe55b4c[_0x7b4d('0x3e')]};return db[_0x7b4d('0x44')][_0x7b4d('0x45')](_0x370e86)[_0x7b4d('0x19')](function(_0x40ecf3){_0x4af23a[_0x7b4d('0x45')]=_0x40ecf3;if(_0x17d834[_0x7b4d('0x35')][_0x7b4d('0x46')]){_0xe55b4c[_0x7b4d('0x47')]=[{'all':!![]}];}return db[_0x7b4d('0x44')][_0x7b4d('0x48')](_0xe55b4c);})[_0x7b4d('0x19')](function(_0x5362be){_0x4af23a[_0x7b4d('0x49')]=_0x5362be;return _0x4af23a;})[_0x7b4d('0x19')](respondWithFilteredResult(_0x1a2861,_0xe55b4c))['catch'](handleError(_0x1a2861,null));};exports[_0x7b4d('0x4a')]=function(_0x2676bb,_0x5dd6fc){var _0x5104c0={'raw':![],'where':{'id':_0x2676bb['params']['id']}},_0xd28254={};_0xd28254[_0x7b4d('0x37')]=_['keys'](db[_0x7b4d('0x44')]['rawAttributes']);_0xd28254[_0x7b4d('0x35')]=_[_0x7b4d('0x4b')](_0x2676bb[_0x7b4d('0x35')]);_0xd28254['filters']=_[_0x7b4d('0x36')](_0xd28254['model'],_0xd28254[_0x7b4d('0x35')]);_0x5104c0[_0x7b4d('0x39')]=_['intersection'](_0xd28254['model'],qs[_0x7b4d('0x38')](_0x2676bb[_0x7b4d('0x35')][_0x7b4d('0x38')]));_0x5104c0[_0x7b4d('0x39')]=_0x5104c0[_0x7b4d('0x39')][_0x7b4d('0x3a')]?_0x5104c0[_0x7b4d('0x39')]:_0xd28254[_0x7b4d('0x37')];if(_0x2676bb[_0x7b4d('0x35')][_0x7b4d('0x46')]){_0x5104c0[_0x7b4d('0x47')]=[{'all':!![]}];}_0x5104c0=_['merge']({},_0x5104c0,_0x2676bb[_0x7b4d('0x4c')]);return db[_0x7b4d('0x44')][_0x7b4d('0x4d')](_0x5104c0)[_0x7b4d('0x19')](handleEntityNotFound(_0x5dd6fc,null))[_0x7b4d('0x19')](respondWithResult(_0x5dd6fc,null))[_0x7b4d('0x4e')](handleError(_0x5dd6fc,null));};exports[_0x7b4d('0x4f')]=function(_0x552ffd,_0x2e19a4,_0x106692){var _0x5c88ce;return db[_0x7b4d('0x44')]['create'](_0x552ffd[_0x7b4d('0x50')],{'raw':!![]})['then'](function(_0x397666){_0x5c88ce=_0x397666;return db[_0x7b4d('0x44')]['findAll']({'raw':!![]});})[_0x7b4d('0x19')](function(_0x4d94f2){var _0x18567a=fs[_0x7b4d('0x51')](path[_0x7b4d('0x52')](config[_0x7b4d('0x53')],_0x7b4d('0x54')),_0x7b4d('0x55'));var _0x1d7c59=ejs[_0x7b4d('0x56')](_0x18567a,{'contexts':_0x4d94f2||[]});fs[_0x7b4d('0x57')](_0x7b4d('0x58'),_0x1d7c59);})[_0x7b4d('0x19')](function(){return respondWithRpcPromise('Reload',_0x7b4d('0x4f'),{'module':'chan_sip.so'});})[_0x7b4d('0x19')](function(){var _0xacdfe7=_0x552ffd[_0x7b4d('0x59')]['get']({'plain':!![]});if(!_0xacdfe7)throw new Error(_0x7b4d('0x5a'));if(_0xacdfe7[_0x7b4d('0x5b')]==='user'){var _0x1f6e91=_0x5c88ce[_0x7b4d('0x2d')]({'plain':!![]});return db[_0x7b4d('0x5c')][_0x7b4d('0x4d')]({'where':{'name':'Contexts','userProfileId':_0xacdfe7['userProfileId']},'raw':!![]})[_0x7b4d('0x19')](function(_0x4bf1f2){if(_0x4bf1f2&&_0x4bf1f2[_0x7b4d('0x5d')]===0x0){return db[_0x7b4d('0x2f')][_0x7b4d('0x4f')]({'name':_0x1f6e91['name'],'resourceId':_0x1f6e91['id'],'type':_0x4bf1f2[_0x7b4d('0x30')],'sectionId':_0x4bf1f2['id']},{})['then'](function(){return _0x5c88ce;});}else{return _0x5c88ce;}})[_0x7b4d('0x4e')](function(_0x413c2d){logger[_0x7b4d('0x1e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x413c2d);throw _0x413c2d;});}return _0x5c88ce;})['then'](respondWithResult(_0x2e19a4,0xc9))['catch'](handleError(_0x2e19a4,null));};exports[_0x7b4d('0x5e')]=function(_0x541a2c,_0x46571b,_0x3846d2){var _0x101cc8;return db[_0x7b4d('0x44')][_0x7b4d('0x4d')]({'where':{'id':_0x541a2c[_0x7b4d('0x5f')]['id']}})[_0x7b4d('0x19')](handleEntityNotFound(_0x46571b,null))[_0x7b4d('0x19')](saveUpdates(_0x541a2c[_0x7b4d('0x50')],null))['then'](function(_0x167d64){if(_0x167d64){_0x101cc8=_0x167d64;return db[_0x7b4d('0x44')][_0x7b4d('0x48')]({'raw':!![]});}})[_0x7b4d('0x19')](function(_0x373c30){var _0xe807dc=fs[_0x7b4d('0x51')](path[_0x7b4d('0x52')](config[_0x7b4d('0x53')],_0x7b4d('0x54')),_0x7b4d('0x55'));var _0x262849=ejs[_0x7b4d('0x56')](_0xe807dc,{'contexts':_0x373c30||[]});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x262849);})[_0x7b4d('0x19')](function(){return respondWithRpcPromise('Reload',_0x7b4d('0x5e'),{'module':_0x7b4d('0x60')});})[_0x7b4d('0x19')](function(){return _0x101cc8;})['then'](respondWithResult(_0x46571b,null))['catch'](handleError(_0x46571b,null));};exports['destroy']=function(_0x3a67ba,_0xfff06a,_0x473ec3){var _0x4341f2;return db[_0x7b4d('0x44')][_0x7b4d('0x4d')]({'where':{'id':_0x3a67ba[_0x7b4d('0x5f')]['id']}})['then'](handleEntityNotFound(_0xfff06a,null))[_0x7b4d('0x19')](removeEntity(_0xfff06a,null))[_0x7b4d('0x19')](function(){return db['VoiceContext'][_0x7b4d('0x48')]({'raw':!![]});})[_0x7b4d('0x19')](function(_0x5839a2){var _0x5cc3eb=fs[_0x7b4d('0x51')](path[_0x7b4d('0x52')](config['root'],_0x7b4d('0x54')),_0x7b4d('0x55'));var _0x4c0cd2=ejs['render'](_0x5cc3eb,{'contexts':_0x5839a2});fs[_0x7b4d('0x57')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x4c0cd2);return respondWithRpcPromise(_0x7b4d('0x61'),_0x7b4d('0x2c'),{'module':_0x7b4d('0x60')});})[_0x7b4d('0x4e')](handleError(_0xfff06a,null));}; \ No newline at end of file +var _0xedef=['jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','jayson/promise','client','http','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~!@#$%^&-_=+[{]}.','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','limit','set','Content-Range','apply','reject','destroy','get','Contexts','UserProfileResource','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','VoiceContext','findAll','rows','find','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','render','writeFileSync','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','crypto'];(function(_0x3d2555,_0x6e443e){var _0x597430=function(_0x554ed4){while(--_0x554ed4){_0x3d2555['push'](_0x3d2555['shift']());}};_0x597430(++_0x6e443e);}(_0xedef,0x18d));var _0xfede=function(_0x4ce05e,_0x56609c){_0x4ce05e=_0x4ce05e-0x0;var _0x51a3e2=_0xedef[_0x4ce05e];return _0x51a3e2;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfede('0x0'));var rimraf=require(_0xfede('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfede('0x2'));var moment=require(_0xfede('0x3'));var BPromise=require(_0xfede('0x4'));var Mustache=require(_0xfede('0x5'));var util=require(_0xfede('0x6'));var path=require(_0xfede('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfede('0x8'));var fs=require('fs');var _=require(_0xfede('0x9'));var squel=require('squel');var crypto=require(_0xfede('0xa'));var jsforce=require(_0xfede('0xb'));var deskjs=require(_0xfede('0xc'));var toCsv=require(_0xfede('0xd'));var querystring=require(_0xfede('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfede('0xf'));var qs=require(_0xfede('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfede('0x11'));var logger=require(_0xfede('0x12'))(_0xfede('0x13'));var utils=require('../../config/utils');var config=require(_0xfede('0x14'));var db=require('../../mysqldb')['db'];var jayson=require(_0xfede('0x15'));var client=jayson[_0xfede('0x16')][_0xfede('0x17')]({'port':0x232a});function checkPasswordPattern(_0x5b077f,_0xbce9b7,_0x1f583a){if(_0x1f583a){var _0x513f22=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x513f22[_0xfede('0x18')](_0xbce9b7)){return _0x5b077f;}else{throw new db[(_0xfede('0x19'))]['ValidationError'](_0xfede('0x1a'));}}else{return _0x5b077f;}}function respondWithRpcPromise(_0xa34ba4,_0x23d859,_0x3000d1,_0x519e4){return new BPromise(function(_0x526075,_0x2a9d7b){var _0x4a239e=_0x519e4||client;return _0x4a239e['request'](_0xa34ba4,_0x3000d1)[_0xfede('0x1b')](function(_0x4ba5ee){logger[_0xfede('0x1c')](_0xfede('0x1d'),_0x23d859,_0xfede('0x1e'));logger[_0xfede('0x1f')](_0xfede('0x20'),_0x23d859,'request\x20sent',JSON[_0xfede('0x21')](_0x4ba5ee));if(_0x4ba5ee['error']){if(_0x4ba5ee[_0xfede('0x22')][_0xfede('0x23')]===0x1f4){logger['error'](_0xfede('0x1d'),_0x23d859,_0x4ba5ee[_0xfede('0x22')]['message']);return _0x2a9d7b(_0x4ba5ee['error']['message']);}logger['error'](_0xfede('0x1d'),_0x23d859,_0x4ba5ee[_0xfede('0x22')][_0xfede('0x24')]);return _0x526075(_0x4ba5ee['error'][_0xfede('0x24')]);}else{logger[_0xfede('0x1c')](_0xfede('0x1d'),_0x23d859,_0xfede('0x1e'));_0x526075(_0x4ba5ee[_0xfede('0x25')][_0xfede('0x24')]);}})[_0xfede('0x26')](function(_0x5f1484){logger[_0xfede('0x22')](_0xfede('0x1d'),_0x23d859,_0x5f1484);_0x2a9d7b(_0x5f1484);});});}function respondWithStatusCode(_0x29fb68,_0x4dfc5d){_0x4dfc5d=_0x4dfc5d||0xcc;return function(_0x4ad8b6){if(_0x4ad8b6){return _0x29fb68[_0xfede('0x27')](_0x4dfc5d);}return _0x29fb68[_0xfede('0x28')](_0x4dfc5d)[_0xfede('0x29')]();};}function respondWithResult(_0x27862b,_0x17529a){_0x17529a=_0x17529a||0xc8;return function(_0x29eb2c){if(_0x29eb2c){return _0x27862b['status'](_0x17529a)[_0xfede('0x2a')](_0x29eb2c);}};}function respondWithFilteredResult(_0x5dcc16,_0x1c2b92){return function(_0x170400){if(_0x170400){var _0x30177b=_0x170400[_0xfede('0x2b')],_0x3d62bc=_0x1c2b92['offset'],_0x53813a=_0x1c2b92['offset']+_0x1c2b92[_0xfede('0x2c')],_0x42866a;if(_0x53813a>=_0x30177b){_0x53813a=_0x30177b;_0x42866a=0xc8;}else{_0x42866a=0xce;}_0x5dcc16['status'](_0x42866a);return _0x5dcc16[_0xfede('0x2d')](_0xfede('0x2e'),_0x3d62bc+'-'+_0x53813a+'/'+_0x30177b)['json'](_0x170400);}return null;};}function patchUpdates(_0x3e3a62){return function(_0x31a772){try{jsonpatch[_0xfede('0x2f')](_0x31a772,_0x3e3a62,!![]);}catch(_0x56a411){return BPromise[_0xfede('0x30')](_0x56a411);}return _0x31a772['save']();};}function saveUpdates(_0x3d868a,_0x4006c9){return function(_0x4876cf){if(_0x4876cf){return _0x4876cf['update'](_0x3d868a)[_0xfede('0x1b')](function(_0x240479){return _0x240479;});}return null;};}function removeEntity(_0x43d58c,_0x9a4736){return function(_0x1f4765){if(_0x1f4765){return _0x1f4765[_0xfede('0x31')]()[_0xfede('0x1b')](function(){var _0x3f8f02=_0x1f4765[_0xfede('0x32')]({'plain':!![]});var _0x1f87ce=_0xfede('0x33');return db[_0xfede('0x34')][_0xfede('0x31')]({'where':{'type':_0x1f87ce,'resourceId':_0x3f8f02['id']}})['then'](function(){return _0x1f4765;});})[_0xfede('0x1b')](function(){_0x43d58c[_0xfede('0x28')](0xcc)[_0xfede('0x29')]();});}};}function handleEntityNotFound(_0x3c1507,_0x325de8){return function(_0x5cc429){if(!_0x5cc429){_0x3c1507[_0xfede('0x27')](0x194);}return _0x5cc429;};}function handleError(_0x2e3d94,_0x57e3fb){_0x57e3fb=_0x57e3fb||0x1f4;return function(_0x2b34e9){logger['error'](_0x2b34e9['stack']);if(_0x2b34e9[_0xfede('0x35')]){delete _0x2b34e9[_0xfede('0x35')];}_0x2e3d94[_0xfede('0x28')](_0x57e3fb)['send'](_0x2b34e9);};}exports[_0xfede('0x36')]=function(_0x42c6fe,_0x354ee2){var _0x2a9f55={},_0x30d36f={},_0x59b704={'count':0x0,'rows':[]};var _0x285117=_[_0xfede('0x37')](db['VoiceContext'][_0xfede('0x38')],function(_0x5e4c31){return{'name':_0x5e4c31[_0xfede('0x39')],'type':_0x5e4c31[_0xfede('0x3a')][_0xfede('0x3b')]};});_0x30d36f[_0xfede('0x3c')]=_[_0xfede('0x37')](_0x285117,_0xfede('0x35'));_0x30d36f[_0xfede('0x3d')]=_[_0xfede('0x3e')](_0x42c6fe['query']);_0x30d36f[_0xfede('0x3f')]=_[_0xfede('0x40')](_0x30d36f['model'],_0x30d36f[_0xfede('0x3d')]);_0x2a9f55['attributes']=_[_0xfede('0x40')](_0x30d36f[_0xfede('0x3c')],qs['fields'](_0x42c6fe[_0xfede('0x3d')][_0xfede('0x41')]));_0x2a9f55[_0xfede('0x42')]=_0x2a9f55[_0xfede('0x42')][_0xfede('0x43')]?_0x2a9f55[_0xfede('0x42')]:_0x30d36f[_0xfede('0x3c')];if(!_0x42c6fe[_0xfede('0x3d')][_0xfede('0x44')](_0xfede('0x45'))){_0x2a9f55['limit']=qs[_0xfede('0x2c')](_0x42c6fe[_0xfede('0x3d')][_0xfede('0x2c')]);_0x2a9f55[_0xfede('0x46')]=qs[_0xfede('0x46')](_0x42c6fe[_0xfede('0x3d')][_0xfede('0x46')]);}_0x2a9f55['order']=qs['sort'](_0x42c6fe[_0xfede('0x3d')][_0xfede('0x47')]);_0x2a9f55['where']=qs['filters'](_[_0xfede('0x48')](_0x42c6fe[_0xfede('0x3d')],_0x30d36f[_0xfede('0x3f')]));if(_0x42c6fe[_0xfede('0x3d')][_0xfede('0x49')]){_0x2a9f55[_0xfede('0x4a')]=_[_0xfede('0x4b')](_0x2a9f55[_0xfede('0x4a')],{'$or':_[_0xfede('0x37')](_0x285117,function(_0x3713e6){if(_0x3713e6['type']!==_0xfede('0x4c')){var _0x38cc40={};_0x38cc40[_0x3713e6[_0xfede('0x35')]]={'$like':'%'+_0x42c6fe[_0xfede('0x3d')]['filter']+'%'};return _0x38cc40;}})});}_0x2a9f55=_[_0xfede('0x4b')]({},_0x2a9f55,_0x42c6fe[_0xfede('0x4d')]);var _0x1120bb={'where':_0x2a9f55['where']};return db['VoiceContext']['count'](_0x1120bb)['then'](function(_0x1af675){_0x59b704['count']=_0x1af675;if(_0x42c6fe['query'][_0xfede('0x4e')]){_0x2a9f55[_0xfede('0x4f')]=[{'all':!![]}];}return db[_0xfede('0x50')][_0xfede('0x51')](_0x2a9f55);})[_0xfede('0x1b')](function(_0x35f284){_0x59b704[_0xfede('0x52')]=_0x35f284;return _0x59b704;})['then'](respondWithFilteredResult(_0x354ee2,_0x2a9f55))['catch'](handleError(_0x354ee2,null));};exports['show']=function(_0x4c89a3,_0x2cee08){var _0x357ffa={'raw':![],'where':{'id':_0x4c89a3['params']['id']}},_0x5eea88={};_0x5eea88[_0xfede('0x3c')]=_[_0xfede('0x3e')](db[_0xfede('0x50')][_0xfede('0x38')]);_0x5eea88['query']=_['keys'](_0x4c89a3[_0xfede('0x3d')]);_0x5eea88[_0xfede('0x3f')]=_[_0xfede('0x40')](_0x5eea88[_0xfede('0x3c')],_0x5eea88[_0xfede('0x3d')]);_0x357ffa[_0xfede('0x42')]=_['intersection'](_0x5eea88['model'],qs[_0xfede('0x41')](_0x4c89a3['query'][_0xfede('0x41')]));_0x357ffa[_0xfede('0x42')]=_0x357ffa[_0xfede('0x42')][_0xfede('0x43')]?_0x357ffa[_0xfede('0x42')]:_0x5eea88[_0xfede('0x3c')];if(_0x4c89a3['query'][_0xfede('0x4e')]){_0x357ffa[_0xfede('0x4f')]=[{'all':!![]}];}_0x357ffa=_[_0xfede('0x4b')]({},_0x357ffa,_0x4c89a3[_0xfede('0x4d')]);return db[_0xfede('0x50')][_0xfede('0x53')](_0x357ffa)[_0xfede('0x1b')](handleEntityNotFound(_0x2cee08,null))[_0xfede('0x1b')](respondWithResult(_0x2cee08,null))[_0xfede('0x26')](handleError(_0x2cee08,null));};exports[_0xfede('0x54')]=function(_0x41b45f,_0x379148,_0x227280){var _0x52cf21;return db[_0xfede('0x50')][_0xfede('0x54')](_0x41b45f[_0xfede('0x55')],{'raw':!![]})[_0xfede('0x1b')](function(_0xaf48db){_0x52cf21=_0xaf48db;return db[_0xfede('0x50')]['findAll']({'raw':!![]});})[_0xfede('0x1b')](function(_0x70f580){var _0x35f7df=fs[_0xfede('0x56')](path[_0xfede('0x57')](config[_0xfede('0x58')],_0xfede('0x59')),_0xfede('0x5a'));var _0x5acf9c=ejs['render'](_0x35f7df,{'contexts':_0x70f580||[]});fs['writeFileSync'](_0xfede('0x5b'),_0x5acf9c);})[_0xfede('0x1b')](function(){return respondWithRpcPromise(_0xfede('0x5c'),_0xfede('0x54'),{'module':_0xfede('0x5d')});})[_0xfede('0x1b')](function(){var _0x5db8f8=_0x41b45f[_0xfede('0x5e')][_0xfede('0x32')]({'plain':!![]});if(!_0x5db8f8)throw new Error(_0xfede('0x5f'));if(_0x5db8f8['role']===_0xfede('0x5e')){var _0xb00009=_0x52cf21[_0xfede('0x32')]({'plain':!![]});return db[_0xfede('0x60')]['find']({'where':{'name':_0xfede('0x33'),'userProfileId':_0x5db8f8['userProfileId']},'raw':!![]})[_0xfede('0x1b')](function(_0x552bf0){if(_0x552bf0&&_0x552bf0[_0xfede('0x61')]===0x0){return db[_0xfede('0x34')][_0xfede('0x54')]({'name':_0xb00009['name'],'resourceId':_0xb00009['id'],'type':_0x552bf0['name'],'sectionId':_0x552bf0['id']},{})[_0xfede('0x1b')](function(){return _0x52cf21;});}else{return _0x52cf21;}})[_0xfede('0x26')](function(_0x3e21bb){logger[_0xfede('0x22')](_0xfede('0x62'),_0x3e21bb);throw _0x3e21bb;});}return _0x52cf21;})[_0xfede('0x1b')](respondWithResult(_0x379148,0xc9))['catch'](handleError(_0x379148,null));};exports[_0xfede('0x63')]=function(_0x34c813,_0x1117c5,_0x2d5abc){var _0x18fc83;return db['VoiceContext']['find']({'where':{'id':_0x34c813['params']['id']}})[_0xfede('0x1b')](handleEntityNotFound(_0x1117c5,null))[_0xfede('0x1b')](saveUpdates(_0x34c813[_0xfede('0x55')],null))['then'](function(_0xfbdcdb){if(_0xfbdcdb){_0x18fc83=_0xfbdcdb;return db[_0xfede('0x50')]['findAll']({'raw':!![]});}})['then'](function(_0x599585){var _0x2bf2d8=fs[_0xfede('0x56')](path[_0xfede('0x57')](config[_0xfede('0x58')],'server/files/templates/context.ejs'),_0xfede('0x5a'));var _0x348818=ejs[_0xfede('0x64')](_0x2bf2d8,{'contexts':_0x599585||[]});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x348818);})[_0xfede('0x1b')](function(){return respondWithRpcPromise(_0xfede('0x5c'),_0xfede('0x63'),{'module':_0xfede('0x5d')});})['then'](function(){return _0x18fc83;})[_0xfede('0x1b')](respondWithResult(_0x1117c5,null))[_0xfede('0x26')](handleError(_0x1117c5,null));};exports['destroy']=function(_0x485239,_0x1d1272,_0x12daaf){var _0x1db2ca;return db['VoiceContext'][_0xfede('0x53')]({'where':{'id':_0x485239['params']['id']}})[_0xfede('0x1b')](handleEntityNotFound(_0x1d1272,null))[_0xfede('0x1b')](removeEntity(_0x1d1272,null))['then'](function(){return db[_0xfede('0x50')][_0xfede('0x51')]({'raw':!![]});})[_0xfede('0x1b')](function(_0x263dbe){var _0x385fc0=fs[_0xfede('0x56')](path[_0xfede('0x57')](config['root'],_0xfede('0x59')),'utf8');var _0x438560=ejs[_0xfede('0x64')](_0x385fc0,{'contexts':_0x263dbe});fs[_0xfede('0x65')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x438560);return respondWithRpcPromise('Reload','destroy',{'module':_0xfede('0x5d')});})[_0xfede('0x26')](handleError(_0x1d1272,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 41d59c3..e6578e5 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 _0x13a2=['bluebird','rimraf','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','util','../../config/logger','api','moment'];(function(_0xe56790,_0x5f304d){var _0x145cf7=function(_0x49aeb1){while(--_0x49aeb1){_0xe56790['push'](_0xe56790['shift']());}};_0x145cf7(++_0x5f304d);}(_0x13a2,0x17c));var _0x213a=function(_0x1caabb,_0x109b68){_0x1caabb=_0x1caabb-0x0;var _0x184164=_0x13a2[_0x1caabb];return _0x184164;};'use strict';var _=require('lodash');var util=require(_0x213a('0x0'));var logger=require(_0x213a('0x1'))(_0x213a('0x2'));var moment=require(_0x213a('0x3'));var BPromise=require(_0x213a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x213a('0x5'));var config=require(_0x213a('0x6'));var attributes=require(_0x213a('0x7'));module[_0x213a('0x8')]=function(_0x15721b,_0x23f781){return _0x15721b[_0x213a('0x9')](_0x213a('0xa'),attributes,{'tableName':_0x213a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9349=['util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./voiceContext.attributes','exports','define','voice_contexts'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x9349,0x16b));var _0x9934=function(_0x52fca8,_0x55f264){_0x52fca8=_0x52fca8-0x0;var _0x61160e=_0x9349[_0x52fca8];return _0x61160e;};'use strict';var _=require('lodash');var util=require(_0x9934('0x0'));var logger=require(_0x9934('0x1'))(_0x9934('0x2'));var moment=require('moment');var BPromise=require(_0x9934('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9934('0x4'));var rimraf=require(_0x9934('0x5'));var config=require(_0x9934('0x6'));var attributes=require(_0x9934('0x7'));module[_0x9934('0x8')]=function(_0xf4aeca,_0x1d6777){return _0xf4aeca[_0x9934('0x9')]('VoiceContext',attributes,{'tableName':_0x9934('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 f2344ba..5de315a 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 _0x2d1f=['code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2d1f,0x143));var _0xf2d1=function(_0x1596d6,_0x53aff2){_0x1596d6=_0x1596d6-0x0;var _0x939024=_0x2d1f[_0x1596d6];return _0x939024;};'use strict';var _=require(_0xf2d1('0x0'));var util=require(_0xf2d1('0x1'));var moment=require('moment');var BPromise=require(_0xf2d1('0x2'));var rs=require(_0xf2d1('0x3'));var fs=require('fs');var Redis=require(_0xf2d1('0x4'));var db=require(_0xf2d1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf2d1('0x6'))('rpc');var config=require(_0xf2d1('0x7'));var jayson=require(_0xf2d1('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4c8f5d,_0x1214fe,_0x414166){return new BPromise(function(_0x19aa6e,_0x5ba9bd){return client[_0xf2d1('0x9')](_0x4c8f5d,_0x414166)[_0xf2d1('0xa')](function(_0x4844d0){logger[_0xf2d1('0xb')](_0xf2d1('0xc'),_0x1214fe,_0xf2d1('0xd'));logger[_0xf2d1('0xe')](_0xf2d1('0xf'),_0x1214fe,_0xf2d1('0xd'),JSON['stringify'](_0x4844d0));if(_0x4844d0['error']){if(_0x4844d0[_0xf2d1('0x10')][_0xf2d1('0x11')]===0x1f4){logger[_0xf2d1('0x10')](_0xf2d1('0xc'),_0x1214fe,_0x4844d0[_0xf2d1('0x10')][_0xf2d1('0x12')]);return _0x5ba9bd(_0x4844d0[_0xf2d1('0x10')][_0xf2d1('0x12')]);}logger[_0xf2d1('0x10')](_0xf2d1('0xc'),_0x1214fe,_0x4844d0['error']['message']);return _0x19aa6e(_0x4844d0['error'][_0xf2d1('0x12')]);}else{logger['info']('VoiceContext,\x20%s,\x20%s',_0x1214fe,'request\x20sent');_0x19aa6e(_0x4844d0[_0xf2d1('0x13')]['message']);}})['catch'](function(_0x528df4){logger[_0xf2d1('0x10')]('VoiceContext,\x20%s,\x20%s',_0x1214fe,_0x528df4);_0x5ba9bd(_0x528df4);});});} \ No newline at end of file +var _0x8ef7=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','VoiceContext,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x4207f4,_0x1f778b){var _0x29a621=function(_0xa6f5b7){while(--_0xa6f5b7){_0x4207f4['push'](_0x4207f4['shift']());}};_0x29a621(++_0x1f778b);}(_0x8ef7,0x1af));var _0x78ef=function(_0x1e84ba,_0x277ce4){_0x1e84ba=_0x1e84ba-0x0;var _0xc6d97e=_0x8ef7[_0x1e84ba];return _0xc6d97e;};'use strict';var _=require(_0x78ef('0x0'));var util=require(_0x78ef('0x1'));var moment=require(_0x78ef('0x2'));var BPromise=require(_0x78ef('0x3'));var rs=require(_0x78ef('0x4'));var fs=require('fs');var Redis=require(_0x78ef('0x5'));var db=require(_0x78ef('0x6'))['db'];var utils=require(_0x78ef('0x7'));var logger=require(_0x78ef('0x8'))(_0x78ef('0x9'));var config=require(_0x78ef('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x78ef('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48b571,_0x544090,_0x28387f){return new BPromise(function(_0x2fa879,_0x36ead9){return client[_0x78ef('0xc')](_0x48b571,_0x28387f)[_0x78ef('0xd')](function(_0x2c4fad){logger[_0x78ef('0xe')]('VoiceContext,\x20%s,\x20%s',_0x544090,_0x78ef('0xf'));logger[_0x78ef('0x10')](_0x78ef('0x11'),_0x544090,_0x78ef('0xf'),JSON[_0x78ef('0x12')](_0x2c4fad));if(_0x2c4fad['error']){if(_0x2c4fad['error']['code']===0x1f4){logger['error']('VoiceContext,\x20%s,\x20%s',_0x544090,_0x2c4fad[_0x78ef('0x13')][_0x78ef('0x14')]);return _0x36ead9(_0x2c4fad[_0x78ef('0x13')][_0x78ef('0x14')]);}logger['error'](_0x78ef('0x15'),_0x544090,_0x2c4fad['error'][_0x78ef('0x14')]);return _0x2fa879(_0x2c4fad[_0x78ef('0x13')]['message']);}else{logger[_0x78ef('0xe')](_0x78ef('0x15'),_0x544090,_0x78ef('0xf'));_0x2fa879(_0x2c4fad[_0x78ef('0x16')]['message']);}})['catch'](function(_0x5bd2da){logger['error']('VoiceContext,\x20%s,\x20%s',_0x544090,_0x5bd2da);_0x36ead9(_0x5bd2da);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 42130e5..6304afe 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 _0x16f7=['index','get','/describe','describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','isAuthenticated'];(function(_0x1d4709,_0x1c3db5){var _0x59338d=function(_0x2ce94b){while(--_0x2ce94b){_0x1d4709['push'](_0x1d4709['shift']());}};_0x59338d(++_0x1c3db5);}(_0x16f7,0x166));var _0x716f=function(_0x2eb0b5,_0x340601){_0x2eb0b5=_0x2eb0b5-0x0;var _0x1c93f9=_0x16f7[_0x2eb0b5];return _0x1c93f9;};'use strict';var multer=require(_0x716f('0x0'));var util=require(_0x716f('0x1'));var path=require(_0x716f('0x2'));var timeout=require(_0x716f('0x3'));var express=require(_0x716f('0x4'));var router=express[_0x716f('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x716f('0x6'));var config=require(_0x716f('0x7'));var controller=require(_0x716f('0x8'));router['get']('/',auth[_0x716f('0x9')](),controller[_0x716f('0xa')]);router[_0x716f('0xb')](_0x716f('0xc'),auth[_0x716f('0x9')](),controller[_0x716f('0xd')]);router[_0x716f('0xb')]('/:id',auth[_0x716f('0x9')](),controller[_0x716f('0xe')]);router[_0x716f('0xf')]('/',auth[_0x716f('0x9')](),controller[_0x716f('0x10')]);router[_0x716f('0x11')](_0x716f('0x12'),auth[_0x716f('0x9')](),controller[_0x716f('0x13')]);router[_0x716f('0x14')]('/:id',auth[_0x716f('0x9')](),controller[_0x716f('0x15')]);module[_0x716f('0x16')]=router; \ No newline at end of file +var _0x9968=['update','delete','destroy','exports','multer','util','connect-timeout','express','Router','./voiceDialReport.controller','get','/describe','isAuthenticated','describe','/:id','post','create','put'];(function(_0x4fb943,_0xad4546){var _0x44a1b4=function(_0x592bc9){while(--_0x592bc9){_0x4fb943['push'](_0x4fb943['shift']());}};_0x44a1b4(++_0xad4546);}(_0x9968,0x190));var _0x8996=function(_0x3559ab,_0x156473){_0x3559ab=_0x3559ab-0x0;var _0x59db0c=_0x9968[_0x3559ab];return _0x59db0c;};'use strict';var multer=require(_0x8996('0x0'));var util=require(_0x8996('0x1'));var path=require('path');var timeout=require(_0x8996('0x2'));var express=require(_0x8996('0x3'));var router=express[_0x8996('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8996('0x5'));router[_0x8996('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8996('0x6')](_0x8996('0x7'),auth[_0x8996('0x8')](),controller[_0x8996('0x9')]);router['get'](_0x8996('0xa'),auth[_0x8996('0x8')](),controller['show']);router[_0x8996('0xb')]('/',auth[_0x8996('0x8')](),controller[_0x8996('0xc')]);router[_0x8996('0xd')](_0x8996('0xa'),auth['isAuthenticated'](),controller[_0x8996('0xe')]);router[_0x8996('0xf')](_0x8996('0xa'),auth[_0x8996('0x8')](),controller[_0x8996('0x10')]);module[_0x8996('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index a581d4b..f5889b6 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 _0x16a4=['INTEGER','DATE','sequelize','exports','STRING'];(function(_0x5b2498,_0x234c5d){var _0x1994db=function(_0x16b86a){while(--_0x16b86a){_0x5b2498['push'](_0x5b2498['shift']());}};_0x1994db(++_0x234c5d);}(_0x16a4,0xde));var _0x416a=function(_0x383053,_0x3cf211){_0x383053=_0x383053-0x0;var _0x1e8854=_0x16a4[_0x383053];return _0x1e8854;};'use strict';var Sequelize=require(_0x416a('0x0'));module[_0x416a('0x1')]={'privilege':{'type':Sequelize[_0x416a('0x2')]},'channel':{'type':Sequelize[_0x416a('0x2')]},'channelstate':{'type':Sequelize[_0x416a('0x3')]},'channelstatedesc':{'type':Sequelize[_0x416a('0x2')]},'calleridnum':{'type':Sequelize[_0x416a('0x2')]},'calleridname':{'type':Sequelize[_0x416a('0x2')]},'connectedlinenum':{'type':Sequelize[_0x416a('0x2')]},'connectedlinename':{'type':Sequelize[_0x416a('0x2')]},'language':{'type':Sequelize[_0x416a('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x416a('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x416a('0x2')]},'linkedid':{'type':Sequelize[_0x416a('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x416a('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x416a('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x416a('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x416a('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x416a('0x2')]},'destaccountcode':{'type':Sequelize[_0x416a('0x2')]},'destcontext':{'type':Sequelize[_0x416a('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x416a('0x3')]},'destuniqueid':{'type':Sequelize[_0x416a('0x2')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0x416a('0x2')]},'dialstatus':{'type':Sequelize[_0x416a('0x2')]},'starttime':{'type':Sequelize[_0x416a('0x4')]},'answertime':{'type':Sequelize[_0x416a('0x4')]},'endtime':{'type':Sequelize[_0x416a('0x4')]},'lastevent':{'type':Sequelize[_0x416a('0x2')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x416a('0x3')]},'duration':{'type':Sequelize[_0x416a('0x3')]},'holdtime':{'type':Sequelize[_0x416a('0x3')]},'billableseconds':{'type':Sequelize[_0x416a('0x3')]}}; \ No newline at end of file +var _0x60f2=['INTEGER','DATE','called,connect,complete','exports','STRING'];(function(_0x4c7a25,_0x151661){var _0x49618e=function(_0x4e7e51){while(--_0x4e7e51){_0x4c7a25['push'](_0x4c7a25['shift']());}};_0x49618e(++_0x151661);}(_0x60f2,0x143));var _0x260f=function(_0x3afa7c,_0x3ca142){_0x3afa7c=_0x3afa7c-0x0;var _0x5ae5eb=_0x60f2[_0x3afa7c];return _0x5ae5eb;};'use strict';var Sequelize=require('sequelize');module[_0x260f('0x0')]={'privilege':{'type':Sequelize[_0x260f('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x260f('0x2')]},'channelstatedesc':{'type':Sequelize[_0x260f('0x1')]},'calleridnum':{'type':Sequelize[_0x260f('0x1')]},'calleridname':{'type':Sequelize[_0x260f('0x1')]},'connectedlinenum':{'type':Sequelize[_0x260f('0x1')]},'connectedlinename':{'type':Sequelize[_0x260f('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x260f('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x260f('0x1')]},'priority':{'type':Sequelize[_0x260f('0x2')]},'uniqueid':{'type':Sequelize[_0x260f('0x1')]},'linkedid':{'type':Sequelize[_0x260f('0x1')]},'destchannel':{'type':Sequelize[_0x260f('0x1')]},'destchannelstate':{'type':Sequelize[_0x260f('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x260f('0x1')]},'destcalleridnum':{'type':Sequelize[_0x260f('0x1')]},'destcalleridname':{'type':Sequelize[_0x260f('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x260f('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x260f('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x260f('0x1')]},'destcontext':{'type':Sequelize[_0x260f('0x1')]},'destexten':{'type':Sequelize[_0x260f('0x1')]},'destpriority':{'type':Sequelize[_0x260f('0x2')]},'destuniqueid':{'type':Sequelize[_0x260f('0x1')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0x260f('0x1')]},'dialstatus':{'type':Sequelize[_0x260f('0x1')]},'starttime':{'type':Sequelize[_0x260f('0x3')]},'answertime':{'type':Sequelize[_0x260f('0x3')]},'endtime':{'type':Sequelize[_0x260f('0x3')]},'lastevent':{'type':Sequelize[_0x260f('0x1')],'comment':_0x260f('0x4')},'routeId':{'type':Sequelize[_0x260f('0x2')]},'duration':{'type':Sequelize[_0x260f('0x2')]},'holdtime':{'type':Sequelize[_0x260f('0x2')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index ead5631..546951d 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 _0xc2fe=['then','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','filter','merge','VIRTUAL','options','VoiceDialReport','includeAll','include','rows','catch','show','params','keys','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','update'];(function(_0x1450bb,_0x3011b2){var _0x1c7c63=function(_0x1fb4ce){while(--_0x1fb4ce){_0x1450bb['push'](_0x1450bb['shift']());}};_0x1c7c63(++_0x3011b2);}(_0xc2fe,0xb8));var _0xec2f=function(_0x4df916,_0x431d51){_0x4df916=_0x4df916-0x0;var _0x47ef41=_0xc2fe[_0x4df916];return _0x47ef41;};'use strict';var pdf=require(_0xec2f('0x0'));var emlformat=require(_0xec2f('0x1'));var rimraf=require(_0xec2f('0x2'));var zipdir=require(_0xec2f('0x3'));var jsonpatch=require(_0xec2f('0x4'));var rp=require(_0xec2f('0x5'));var moment=require(_0xec2f('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xec2f('0x7'));var util=require(_0xec2f('0x8'));var path=require(_0xec2f('0x9'));var sox=require(_0xec2f('0xa'));var csv=require(_0xec2f('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xec2f('0xc'));var squel=require(_0xec2f('0xd'));var crypto=require(_0xec2f('0xe'));var jsforce=require(_0xec2f('0xf'));var deskjs=require(_0xec2f('0x10'));var toCsv=require(_0xec2f('0xb'));var querystring=require(_0xec2f('0x11'));var Papa=require(_0xec2f('0x12'));var Redis=require(_0xec2f('0x13'));var authService=require(_0xec2f('0x14'));var qs=require(_0xec2f('0x15'));var as=require(_0xec2f('0x16'));var hardwareService=require(_0xec2f('0x17'));var logger=require(_0xec2f('0x18'))(_0xec2f('0x19'));var utils=require(_0xec2f('0x1a'));var config=require(_0xec2f('0x1b'));var db=require(_0xec2f('0x1c'))['db'];function respondWithStatusCode(_0xb9cbb9,_0x13a356){_0x13a356=_0x13a356||0xcc;return function(_0x1f9271){if(_0x1f9271){return _0xb9cbb9[_0xec2f('0x1d')](_0x13a356);}return _0xb9cbb9[_0xec2f('0x1e')](_0x13a356)['end']();};}function respondWithResult(_0xa1c1a,_0x295bbf){_0x295bbf=_0x295bbf||0xc8;return function(_0x8b7150){if(_0x8b7150){return _0xa1c1a['status'](_0x295bbf)[_0xec2f('0x1f')](_0x8b7150);}};}function respondWithFilteredResult(_0x1275fe,_0x570447){return function(_0x7c1e44){if(_0x7c1e44){var _0x3a8bc0=_0x7c1e44[_0xec2f('0x20')],_0x394eb9=_0x570447[_0xec2f('0x21')],_0x1fed0d=_0x570447[_0xec2f('0x21')]+_0x570447[_0xec2f('0x22')],_0x5a1e53;if(_0x1fed0d>=_0x3a8bc0){_0x1fed0d=_0x3a8bc0;_0x5a1e53=0xc8;}else{_0x5a1e53=0xce;}_0x1275fe['status'](_0x5a1e53);return _0x1275fe[_0xec2f('0x23')]('Content-Range',_0x394eb9+'-'+_0x1fed0d+'/'+_0x3a8bc0)[_0xec2f('0x1f')](_0x7c1e44);}return null;};}function patchUpdates(_0x11b709){return function(_0x3e73fa){try{jsonpatch[_0xec2f('0x24')](_0x3e73fa,_0x11b709,!![]);}catch(_0x2e52d7){return BPromise['reject'](_0x2e52d7);}return _0x3e73fa['save']();};}function saveUpdates(_0x31443c,_0x3e924e){return function(_0x2b9ba6){if(_0x2b9ba6){return _0x2b9ba6[_0xec2f('0x25')](_0x31443c)[_0xec2f('0x26')](function(_0x49ae89){return _0x49ae89;});}return null;};}function removeEntity(_0x909bee,_0x1fc625){return function(_0x28cc4c){if(_0x28cc4c){return _0x28cc4c['destroy']()[_0xec2f('0x26')](function(){_0x909bee[_0xec2f('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d94a8,_0x482705){return function(_0x27e361){if(!_0x27e361){_0x2d94a8[_0xec2f('0x1d')](0x194);}return _0x27e361;};}function handleError(_0x46e31f,_0x5cca2a){_0x5cca2a=_0x5cca2a||0x1f4;return function(_0x783504){logger['error'](_0x783504[_0xec2f('0x27')]);if(_0x783504[_0xec2f('0x28')]){delete _0x783504['name'];}_0x46e31f[_0xec2f('0x1e')](_0x5cca2a)[_0xec2f('0x29')](_0x783504);};}exports[_0xec2f('0x2a')]=function(_0x377d4c,_0x48371d){var _0x2c772d={},_0x5e9601={},_0x14f446={'count':0x0,'rows':[]};var _0xb08045=_[_0xec2f('0x2b')](db['VoiceDialReport'][_0xec2f('0x2c')],function(_0x2bacf2){return{'name':_0x2bacf2[_0xec2f('0x2d')],'type':_0x2bacf2[_0xec2f('0x2e')][_0xec2f('0x2f')]};});_0x5e9601[_0xec2f('0x30')]=_[_0xec2f('0x2b')](_0xb08045,_0xec2f('0x28'));_0x5e9601[_0xec2f('0x31')]=_['keys'](_0x377d4c[_0xec2f('0x31')]);_0x5e9601[_0xec2f('0x32')]=_[_0xec2f('0x33')](_0x5e9601[_0xec2f('0x30')],_0x5e9601[_0xec2f('0x31')]);_0x2c772d[_0xec2f('0x34')]=_[_0xec2f('0x33')](_0x5e9601[_0xec2f('0x30')],qs['fields'](_0x377d4c[_0xec2f('0x31')][_0xec2f('0x35')]));_0x2c772d[_0xec2f('0x34')]=_0x2c772d[_0xec2f('0x34')][_0xec2f('0x36')]?_0x2c772d[_0xec2f('0x34')]:_0x5e9601[_0xec2f('0x30')];if(!_0x377d4c[_0xec2f('0x31')]['hasOwnProperty']('nolimit')){_0x2c772d['limit']=qs[_0xec2f('0x22')](_0x377d4c[_0xec2f('0x31')]['limit']);_0x2c772d[_0xec2f('0x21')]=qs['offset'](_0x377d4c['query'][_0xec2f('0x21')]);}_0x2c772d[_0xec2f('0x37')]=qs[_0xec2f('0x38')](_0x377d4c[_0xec2f('0x31')][_0xec2f('0x38')]);_0x2c772d[_0xec2f('0x39')]=qs[_0xec2f('0x32')](_['pick'](_0x377d4c['query'],_0x5e9601[_0xec2f('0x32')]));if(_0x377d4c[_0xec2f('0x31')][_0xec2f('0x3a')]){_0x2c772d['where']=_[_0xec2f('0x3b')](_0x2c772d[_0xec2f('0x39')],{'$or':_[_0xec2f('0x2b')](_0xb08045,function(_0x225c9b){if(_0x225c9b[_0xec2f('0x2e')]!==_0xec2f('0x3c')){var _0x8ccb15={};_0x8ccb15[_0x225c9b['name']]={'$like':'%'+_0x377d4c[_0xec2f('0x31')][_0xec2f('0x3a')]+'%'};return _0x8ccb15;}})});}_0x2c772d=_[_0xec2f('0x3b')]({},_0x2c772d,_0x377d4c[_0xec2f('0x3d')]);var _0x61571a={'where':_0x2c772d[_0xec2f('0x39')]};return db[_0xec2f('0x3e')][_0xec2f('0x20')](_0x61571a)[_0xec2f('0x26')](function(_0x3ad024){_0x14f446['count']=_0x3ad024;if(_0x377d4c[_0xec2f('0x31')][_0xec2f('0x3f')]){_0x2c772d[_0xec2f('0x40')]=[{'all':!![]}];}return db[_0xec2f('0x3e')]['findAll'](_0x2c772d);})[_0xec2f('0x26')](function(_0x895dde){_0x14f446[_0xec2f('0x41')]=_0x895dde;return _0x14f446;})[_0xec2f('0x26')](respondWithFilteredResult(_0x48371d,_0x2c772d))[_0xec2f('0x42')](handleError(_0x48371d,null));};exports[_0xec2f('0x43')]=function(_0x23dab0,_0x40e074){var _0x45e230={'raw':!![],'where':{'id':_0x23dab0[_0xec2f('0x44')]['id']}},_0x3ca139={};_0x3ca139[_0xec2f('0x30')]=_[_0xec2f('0x45')](db[_0xec2f('0x3e')][_0xec2f('0x2c')]);_0x3ca139[_0xec2f('0x31')]=_[_0xec2f('0x45')](_0x23dab0[_0xec2f('0x31')]);_0x3ca139[_0xec2f('0x32')]=_[_0xec2f('0x33')](_0x3ca139['model'],_0x3ca139['query']);_0x45e230[_0xec2f('0x34')]=_[_0xec2f('0x33')](_0x3ca139['model'],qs[_0xec2f('0x35')](_0x23dab0[_0xec2f('0x31')][_0xec2f('0x35')]));_0x45e230[_0xec2f('0x34')]=_0x45e230[_0xec2f('0x34')][_0xec2f('0x36')]?_0x45e230[_0xec2f('0x34')]:_0x3ca139[_0xec2f('0x30')];if(_0x23dab0[_0xec2f('0x31')]['includeAll']){_0x45e230[_0xec2f('0x40')]=[{'all':!![]}];}_0x45e230=_[_0xec2f('0x3b')]({},_0x45e230,_0x23dab0[_0xec2f('0x3d')]);return db[_0xec2f('0x3e')][_0xec2f('0x46')](_0x45e230)[_0xec2f('0x26')](handleEntityNotFound(_0x40e074,null))[_0xec2f('0x26')](respondWithResult(_0x40e074,null))[_0xec2f('0x42')](handleError(_0x40e074,null));};exports[_0xec2f('0x47')]=function(_0x27f4a4,_0x51466a){return db[_0xec2f('0x3e')][_0xec2f('0x47')](_0x27f4a4['body'],{})[_0xec2f('0x26')](respondWithResult(_0x51466a,0xc9))['catch'](handleError(_0x51466a,null));};exports[_0xec2f('0x25')]=function(_0x26b2ee,_0xefc826){if(_0x26b2ee[_0xec2f('0x48')]['id']){delete _0x26b2ee[_0xec2f('0x48')]['id'];}return db['VoiceDialReport'][_0xec2f('0x46')]({'where':{'id':_0x26b2ee[_0xec2f('0x44')]['id']}})[_0xec2f('0x26')](handleEntityNotFound(_0xefc826,null))[_0xec2f('0x26')](saveUpdates(_0x26b2ee[_0xec2f('0x48')],null))[_0xec2f('0x26')](respondWithResult(_0xefc826,null))[_0xec2f('0x42')](handleError(_0xefc826,null));};exports['destroy']=function(_0x591ed9,_0x42bb2f){return db[_0xec2f('0x3e')][_0xec2f('0x46')]({'where':{'id':_0x591ed9[_0xec2f('0x44')]['id']}})[_0xec2f('0x26')](handleEntityNotFound(_0x42bb2f,null))[_0xec2f('0x26')](removeEntity(_0x42bb2f,null))[_0xec2f('0x42')](handleError(_0x42bb2f,null));};exports[_0xec2f('0x49')]=function(_0x248dc4,_0x2e5123){return db[_0xec2f('0x3e')][_0xec2f('0x49')]()[_0xec2f('0x26')](respondWithResult(_0x2e5123,null))['catch'](handleError(_0x2e5123,null));}; \ No newline at end of file +var _0xf624=['request-promise','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','name','index','map','VoiceDialReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','options','includeAll','include','rows','catch','show','params','fields','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x16fdeb,_0x46d28e){var _0x1ea06f=function(_0x5b86d8){while(--_0x5b86d8){_0x16fdeb['push'](_0x16fdeb['shift']());}};_0x1ea06f(++_0x46d28e);}(_0xf624,0x110));var _0x4f62=function(_0x568eff,_0x1543e7){_0x568eff=_0x568eff-0x0;var _0x53ca0d=_0xf624[_0x568eff];return _0x53ca0d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4f62('0x0'));var rimraf=require(_0x4f62('0x1'));var zipdir=require(_0x4f62('0x2'));var jsonpatch=require(_0x4f62('0x3'));var rp=require(_0x4f62('0x4'));var moment=require('moment');var BPromise=require(_0x4f62('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4f62('0x6'));var sox=require(_0x4f62('0x7'));var csv=require(_0x4f62('0x8'));var ejs=require(_0x4f62('0x9'));var fs=require('fs');var _=require(_0x4f62('0xa'));var squel=require(_0x4f62('0xb'));var crypto=require(_0x4f62('0xc'));var jsforce=require(_0x4f62('0xd'));var deskjs=require(_0x4f62('0xe'));var toCsv=require(_0x4f62('0x8'));var querystring=require(_0x4f62('0xf'));var Papa=require('papaparse');var Redis=require(_0x4f62('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4f62('0x11'));var hardwareService=require(_0x4f62('0x12'));var logger=require(_0x4f62('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x4f62('0x14'));var db=require(_0x4f62('0x15'))['db'];function respondWithStatusCode(_0x2d41c0,_0x22790f){_0x22790f=_0x22790f||0xcc;return function(_0x574579){if(_0x574579){return _0x2d41c0[_0x4f62('0x16')](_0x22790f);}return _0x2d41c0[_0x4f62('0x17')](_0x22790f)[_0x4f62('0x18')]();};}function respondWithResult(_0x1f9124,_0x31d1ca){_0x31d1ca=_0x31d1ca||0xc8;return function(_0x324a3c){if(_0x324a3c){return _0x1f9124[_0x4f62('0x17')](_0x31d1ca)['json'](_0x324a3c);}};}function respondWithFilteredResult(_0x280cfb,_0x27c4d3){return function(_0x430019){if(_0x430019){var _0x5b5d5d=_0x430019[_0x4f62('0x19')],_0x31120e=_0x27c4d3['offset'],_0xdaf002=_0x27c4d3[_0x4f62('0x1a')]+_0x27c4d3[_0x4f62('0x1b')],_0x30b513;if(_0xdaf002>=_0x5b5d5d){_0xdaf002=_0x5b5d5d;_0x30b513=0xc8;}else{_0x30b513=0xce;}_0x280cfb[_0x4f62('0x17')](_0x30b513);return _0x280cfb[_0x4f62('0x1c')](_0x4f62('0x1d'),_0x31120e+'-'+_0xdaf002+'/'+_0x5b5d5d)['json'](_0x430019);}return null;};}function patchUpdates(_0x1c5fcc){return function(_0x4c250c){try{jsonpatch[_0x4f62('0x1e')](_0x4c250c,_0x1c5fcc,!![]);}catch(_0x5925a2){return BPromise[_0x4f62('0x1f')](_0x5925a2);}return _0x4c250c['save']();};}function saveUpdates(_0x367d91,_0x471ef0){return function(_0x300dd6){if(_0x300dd6){return _0x300dd6[_0x4f62('0x20')](_0x367d91)[_0x4f62('0x21')](function(_0x319802){return _0x319802;});}return null;};}function removeEntity(_0x937f6c,_0x11a90a){return function(_0x3c36ea){if(_0x3c36ea){return _0x3c36ea[_0x4f62('0x22')]()['then'](function(){_0x937f6c[_0x4f62('0x17')](0xcc)[_0x4f62('0x18')]();});}};}function handleEntityNotFound(_0x512b94,_0xce8317){return function(_0x4fd45f){if(!_0x4fd45f){_0x512b94[_0x4f62('0x16')](0x194);}return _0x4fd45f;};}function handleError(_0x373702,_0x268d8a){_0x268d8a=_0x268d8a||0x1f4;return function(_0x558f8f){logger[_0x4f62('0x23')](_0x558f8f['stack']);if(_0x558f8f[_0x4f62('0x24')]){delete _0x558f8f[_0x4f62('0x24')];}_0x373702[_0x4f62('0x17')](_0x268d8a)['send'](_0x558f8f);};}exports[_0x4f62('0x25')]=function(_0x4befba,_0xc23735){var _0x9a6ac8={},_0x57632d={},_0x351567={'count':0x0,'rows':[]};var _0x451ce2=_[_0x4f62('0x26')](db[_0x4f62('0x27')][_0x4f62('0x28')],function(_0x15d5d3){return{'name':_0x15d5d3['fieldName'],'type':_0x15d5d3[_0x4f62('0x29')][_0x4f62('0x2a')]};});_0x57632d[_0x4f62('0x2b')]=_[_0x4f62('0x26')](_0x451ce2,'name');_0x57632d[_0x4f62('0x2c')]=_[_0x4f62('0x2d')](_0x4befba['query']);_0x57632d[_0x4f62('0x2e')]=_[_0x4f62('0x2f')](_0x57632d[_0x4f62('0x2b')],_0x57632d[_0x4f62('0x2c')]);_0x9a6ac8[_0x4f62('0x30')]=_[_0x4f62('0x2f')](_0x57632d[_0x4f62('0x2b')],qs['fields'](_0x4befba['query']['fields']));_0x9a6ac8[_0x4f62('0x30')]=_0x9a6ac8[_0x4f62('0x30')][_0x4f62('0x31')]?_0x9a6ac8[_0x4f62('0x30')]:_0x57632d[_0x4f62('0x2b')];if(!_0x4befba[_0x4f62('0x2c')][_0x4f62('0x32')](_0x4f62('0x33'))){_0x9a6ac8[_0x4f62('0x1b')]=qs[_0x4f62('0x1b')](_0x4befba['query'][_0x4f62('0x1b')]);_0x9a6ac8[_0x4f62('0x1a')]=qs['offset'](_0x4befba[_0x4f62('0x2c')][_0x4f62('0x1a')]);}_0x9a6ac8[_0x4f62('0x34')]=qs[_0x4f62('0x35')](_0x4befba['query']['sort']);_0x9a6ac8['where']=qs[_0x4f62('0x2e')](_['pick'](_0x4befba[_0x4f62('0x2c')],_0x57632d[_0x4f62('0x2e')]));if(_0x4befba['query'][_0x4f62('0x36')]){_0x9a6ac8['where']=_['merge'](_0x9a6ac8[_0x4f62('0x37')],{'$or':_[_0x4f62('0x26')](_0x451ce2,function(_0x289042){if(_0x289042[_0x4f62('0x29')]!==_0x4f62('0x38')){var _0x1f681a={};_0x1f681a[_0x289042['name']]={'$like':'%'+_0x4befba['query'][_0x4f62('0x36')]+'%'};return _0x1f681a;}})});}_0x9a6ac8=_['merge']({},_0x9a6ac8,_0x4befba[_0x4f62('0x39')]);var _0xe02b3e={'where':_0x9a6ac8[_0x4f62('0x37')]};return db[_0x4f62('0x27')][_0x4f62('0x19')](_0xe02b3e)[_0x4f62('0x21')](function(_0x50cfea){_0x351567[_0x4f62('0x19')]=_0x50cfea;if(_0x4befba[_0x4f62('0x2c')][_0x4f62('0x3a')]){_0x9a6ac8[_0x4f62('0x3b')]=[{'all':!![]}];}return db[_0x4f62('0x27')]['findAll'](_0x9a6ac8);})[_0x4f62('0x21')](function(_0x7ebb0d){_0x351567[_0x4f62('0x3c')]=_0x7ebb0d;return _0x351567;})[_0x4f62('0x21')](respondWithFilteredResult(_0xc23735,_0x9a6ac8))[_0x4f62('0x3d')](handleError(_0xc23735,null));};exports[_0x4f62('0x3e')]=function(_0x2e3be6,_0x5040a9){var _0x159db3={'raw':!![],'where':{'id':_0x2e3be6[_0x4f62('0x3f')]['id']}},_0x56ba67={};_0x56ba67[_0x4f62('0x2b')]=_[_0x4f62('0x2d')](db[_0x4f62('0x27')][_0x4f62('0x28')]);_0x56ba67[_0x4f62('0x2c')]=_['keys'](_0x2e3be6[_0x4f62('0x2c')]);_0x56ba67['filters']=_[_0x4f62('0x2f')](_0x56ba67['model'],_0x56ba67[_0x4f62('0x2c')]);_0x159db3['attributes']=_['intersection'](_0x56ba67[_0x4f62('0x2b')],qs[_0x4f62('0x40')](_0x2e3be6[_0x4f62('0x2c')][_0x4f62('0x40')]));_0x159db3[_0x4f62('0x30')]=_0x159db3[_0x4f62('0x30')][_0x4f62('0x31')]?_0x159db3[_0x4f62('0x30')]:_0x56ba67[_0x4f62('0x2b')];if(_0x2e3be6['query'][_0x4f62('0x3a')]){_0x159db3[_0x4f62('0x3b')]=[{'all':!![]}];}_0x159db3=_['merge']({},_0x159db3,_0x2e3be6[_0x4f62('0x39')]);return db[_0x4f62('0x27')]['find'](_0x159db3)[_0x4f62('0x21')](handleEntityNotFound(_0x5040a9,null))[_0x4f62('0x21')](respondWithResult(_0x5040a9,null))[_0x4f62('0x3d')](handleError(_0x5040a9,null));};exports[_0x4f62('0x41')]=function(_0x2a65da,_0x358d84){return db[_0x4f62('0x27')][_0x4f62('0x41')](_0x2a65da[_0x4f62('0x42')],{})[_0x4f62('0x21')](respondWithResult(_0x358d84,0xc9))[_0x4f62('0x3d')](handleError(_0x358d84,null));};exports[_0x4f62('0x20')]=function(_0x1fbfd0,_0x103103){if(_0x1fbfd0[_0x4f62('0x42')]['id']){delete _0x1fbfd0[_0x4f62('0x42')]['id'];}return db[_0x4f62('0x27')][_0x4f62('0x43')]({'where':{'id':_0x1fbfd0[_0x4f62('0x3f')]['id']}})[_0x4f62('0x21')](handleEntityNotFound(_0x103103,null))[_0x4f62('0x21')](saveUpdates(_0x1fbfd0[_0x4f62('0x42')],null))[_0x4f62('0x21')](respondWithResult(_0x103103,null))[_0x4f62('0x3d')](handleError(_0x103103,null));};exports[_0x4f62('0x22')]=function(_0x9e2d98,_0x45ad5b){return db[_0x4f62('0x27')][_0x4f62('0x43')]({'where':{'id':_0x9e2d98[_0x4f62('0x3f')]['id']}})['then'](handleEntityNotFound(_0x45ad5b,null))[_0x4f62('0x21')](removeEntity(_0x45ad5b,null))[_0x4f62('0x3d')](handleError(_0x45ad5b,null));};exports[_0x4f62('0x44')]=function(_0x15fcf6,_0x47cdd4){return db['VoiceDialReport']['describe']()[_0x4f62('0x21')](respondWithResult(_0x47cdd4,null))['catch'](handleError(_0x47cdd4,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index a97fafe..3cadad1 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 _0xbf81=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceDialReport','uniqueid','lodash','../../config/logger'];(function(_0x1e40df,_0x18b1a5){var _0x4bfb7b=function(_0x3d5ca4){while(--_0x3d5ca4){_0x1e40df['push'](_0x1e40df['shift']());}};_0x4bfb7b(++_0x18b1a5);}(_0xbf81,0xf5));var _0x1bf8=function(_0x45513e,_0x433f83){_0x45513e=_0x45513e-0x0;var _0x59331f=_0xbf81[_0x45513e];return _0x59331f;};'use strict';var _=require(_0x1bf8('0x0'));var util=require('util');var logger=require(_0x1bf8('0x1'))(_0x1bf8('0x2'));var moment=require(_0x1bf8('0x3'));var BPromise=require(_0x1bf8('0x4'));var rp=require(_0x1bf8('0x5'));var fs=require('fs');var path=require(_0x1bf8('0x6'));var rimraf=require(_0x1bf8('0x7'));var config=require(_0x1bf8('0x8'));var attributes=require('./voiceDialReport.attributes');module[_0x1bf8('0x9')]=function(_0x574850,_0x119f75){return _0x574850[_0x1bf8('0xa')](_0x1bf8('0xb'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0x1bf8('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x05b5=['exports','define','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','api','moment','path','../../config/environment'];(function(_0x3f3bdd,_0x265788){var _0x1abba9=function(_0x543413){while(--_0x543413){_0x3f3bdd['push'](_0x3f3bdd['shift']());}};_0x1abba9(++_0x265788);}(_0x05b5,0xf5));var _0x505b=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x05b5[_0x465028];return _0xb783d4;};'use strict';var _=require(_0x505b('0x0'));var util=require(_0x505b('0x1'));var logger=require(_0x505b('0x2'))(_0x505b('0x3'));var moment=require(_0x505b('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x505b('0x5'));var rimraf=require('rimraf');var config=require(_0x505b('0x6'));var attributes=require('./voiceDialReport.attributes');module[_0x505b('0x7')]=function(_0x405652,_0x32399a){return _0x405652[_0x505b('0x8')](_0x505b('0x9'),attributes,{'tableName':_0x505b('0xa'),'paranoid':![],'indexes':[{'fields':[_0x505b('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 19f50f0..7fb8d9d 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 _0xf9bb=['code','message','result','CreateVoiceDialReport','create','body','options','raw','debug','UpdateVoiceDialReport','update','where','attributes','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x25e4b6,_0x56fb93){var _0xcf75ae=function(_0x1bc379){while(--_0x1bc379){_0x25e4b6['push'](_0x25e4b6['shift']());}};_0xcf75ae(++_0x56fb93);}(_0xf9bb,0x14d));var _0xbf9b=function(_0x4218d0,_0x18aa4c){_0x4218d0=_0x4218d0-0x0;var _0x2c142c=_0xf9bb[_0x4218d0];return _0x2c142c;};'use strict';var _=require(_0xbf9b('0x0'));var util=require(_0xbf9b('0x1'));var moment=require(_0xbf9b('0x2'));var BPromise=require('bluebird');var rs=require(_0xbf9b('0x3'));var fs=require('fs');var Redis=require(_0xbf9b('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf9b('0x5'))(_0xbf9b('0x6'));var config=require(_0xbf9b('0x7'));var jayson=require(_0xbf9b('0x8'));var client=jayson[_0xbf9b('0x9')][_0xbf9b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52e0ef,_0x4e1979,_0x236a22){return new BPromise(function(_0x493147,_0x17c197){return client[_0xbf9b('0xb')](_0x52e0ef,_0x236a22)[_0xbf9b('0xc')](function(_0xf3c89c){logger[_0xbf9b('0xd')](_0xbf9b('0xe'),_0x4e1979,_0xbf9b('0xf'));logger['debug'](_0xbf9b('0x10'),_0x4e1979,_0xbf9b('0xf'),JSON[_0xbf9b('0x11')](_0xf3c89c));if(_0xf3c89c[_0xbf9b('0x12')]){if(_0xf3c89c[_0xbf9b('0x12')][_0xbf9b('0x13')]===0x1f4){logger['error'](_0xbf9b('0xe'),_0x4e1979,_0xf3c89c[_0xbf9b('0x12')]['message']);return _0x17c197(_0xf3c89c[_0xbf9b('0x12')][_0xbf9b('0x14')]);}logger[_0xbf9b('0x12')](_0xbf9b('0xe'),_0x4e1979,_0xf3c89c['error']['message']);return _0x493147(_0xf3c89c[_0xbf9b('0x12')][_0xbf9b('0x14')]);}else{logger[_0xbf9b('0xd')](_0xbf9b('0xe'),_0x4e1979,_0xbf9b('0xf'));_0x493147(_0xf3c89c[_0xbf9b('0x15')][_0xbf9b('0x14')]);}})['catch'](function(_0x2676fd){logger[_0xbf9b('0x12')]('VoiceDialReport,\x20%s,\x20%s',_0x4e1979,_0x2676fd);_0x17c197(_0x2676fd);});});}exports[_0xbf9b('0x16')]=function(_0x13daa2){var _0x16a2fc=this;return new Promise(function(_0x1dac71,_0x258365){return db['VoiceDialReport'][_0xbf9b('0x17')](_0x13daa2[_0xbf9b('0x18')],{'raw':_0x13daa2[_0xbf9b('0x19')]?_0x13daa2[_0xbf9b('0x19')][_0xbf9b('0x1a')]===undefined?!![]:![]:!![]})[_0xbf9b('0xc')](function(_0x612506){logger[_0xbf9b('0xd')](_0xbf9b('0x16'),_0x13daa2);logger[_0xbf9b('0x1b')]('CreateVoiceDialReport',_0x13daa2,JSON[_0xbf9b('0x11')](_0x612506));_0x1dac71(_0x612506);})['catch'](function(_0x4c098a){logger[_0xbf9b('0x12')](_0xbf9b('0x16'),_0x4c098a['message'],_0x13daa2);_0x258365(_0x16a2fc['error'](0x1f4,_0x4c098a['message']));});});};exports[_0xbf9b('0x1c')]=function(_0x54d34f){var _0x24336c=this;return new Promise(function(_0x3f6db2,_0x3c633e){return db['VoiceDialReport'][_0xbf9b('0x1d')](_0x54d34f[_0xbf9b('0x18')],{'raw':_0x54d34f[_0xbf9b('0x19')]?_0x54d34f[_0xbf9b('0x19')][_0xbf9b('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54d34f[_0xbf9b('0x19')]?_0x54d34f[_0xbf9b('0x19')][_0xbf9b('0x1e')]||null:null,'attributes':_0x54d34f[_0xbf9b('0x19')]?_0x54d34f['options'][_0xbf9b('0x1f')]||null:null,'limit':_0x54d34f[_0xbf9b('0x19')]?_0x54d34f['options']['limit']||null:null})[_0xbf9b('0xc')](function(_0x3591de){logger[_0xbf9b('0xd')](_0xbf9b('0x1c'),_0x54d34f);logger[_0xbf9b('0x1b')](_0xbf9b('0x1c'),_0x54d34f,JSON['stringify'](_0x3591de));_0x3f6db2(_0x3591de);})['catch'](function(_0x49d77f){logger[_0xbf9b('0x12')](_0xbf9b('0x1c'),_0x49d77f[_0xbf9b('0x14')],_0x54d34f);_0x3c633e(_0x24336c[_0xbf9b('0x12')](0x1f4,_0x49d77f[_0xbf9b('0x14')]));});});}; \ No newline at end of file +var _0xecd5=['options','raw','update','body','where','attributes','limit','UpdateVoiceDialReport','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','CreateVoiceDialReport','VoiceDialReport','create'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xecd5,0x110));var _0x5ecd=function(_0x2731df,_0x4d8da3){_0x2731df=_0x2731df-0x0;var _0x59ef61=_0xecd5[_0x2731df];return _0x59ef61;};'use strict';var _=require('lodash');var util=require(_0x5ecd('0x0'));var moment=require(_0x5ecd('0x1'));var BPromise=require(_0x5ecd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5ecd('0x3'));var db=require(_0x5ecd('0x4'))['db'];var utils=require(_0x5ecd('0x5'));var logger=require(_0x5ecd('0x6'))('rpc');var config=require(_0x5ecd('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5ecd('0x8')][_0x5ecd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a1870,_0x42c752,_0x26d951){return new BPromise(function(_0x2cb71b,_0x946412){return client[_0x5ecd('0xa')](_0x4a1870,_0x26d951)[_0x5ecd('0xb')](function(_0x305f1b){logger[_0x5ecd('0xc')](_0x5ecd('0xd'),_0x42c752,_0x5ecd('0xe'));logger[_0x5ecd('0xf')](_0x5ecd('0x10'),_0x42c752,'request\x20sent',JSON[_0x5ecd('0x11')](_0x305f1b));if(_0x305f1b['error']){if(_0x305f1b['error'][_0x5ecd('0x12')]===0x1f4){logger[_0x5ecd('0x13')]('VoiceDialReport,\x20%s,\x20%s',_0x42c752,_0x305f1b['error'][_0x5ecd('0x14')]);return _0x946412(_0x305f1b[_0x5ecd('0x13')][_0x5ecd('0x14')]);}logger[_0x5ecd('0x13')]('VoiceDialReport,\x20%s,\x20%s',_0x42c752,_0x305f1b[_0x5ecd('0x13')][_0x5ecd('0x14')]);return _0x2cb71b(_0x305f1b['error'][_0x5ecd('0x14')]);}else{logger[_0x5ecd('0xc')]('VoiceDialReport,\x20%s,\x20%s',_0x42c752,_0x5ecd('0xe'));_0x2cb71b(_0x305f1b['result'][_0x5ecd('0x14')]);}})[_0x5ecd('0x15')](function(_0x1e8e64){logger[_0x5ecd('0x13')](_0x5ecd('0xd'),_0x42c752,_0x1e8e64);_0x946412(_0x1e8e64);});});}exports[_0x5ecd('0x16')]=function(_0x231da2){var _0x189c3b=this;return new Promise(function(_0x3078ea,_0x1f7309){return db[_0x5ecd('0x17')][_0x5ecd('0x18')](_0x231da2['body'],{'raw':_0x231da2[_0x5ecd('0x19')]?_0x231da2[_0x5ecd('0x19')][_0x5ecd('0x1a')]===undefined?!![]:![]:!![]})[_0x5ecd('0xb')](function(_0xea18b7){logger['info'](_0x5ecd('0x16'),_0x231da2);logger['debug'](_0x5ecd('0x16'),_0x231da2,JSON[_0x5ecd('0x11')](_0xea18b7));_0x3078ea(_0xea18b7);})[_0x5ecd('0x15')](function(_0x3c8e2b){logger[_0x5ecd('0x13')]('CreateVoiceDialReport',_0x3c8e2b[_0x5ecd('0x14')],_0x231da2);_0x1f7309(_0x189c3b[_0x5ecd('0x13')](0x1f4,_0x3c8e2b[_0x5ecd('0x14')]));});});};exports['UpdateVoiceDialReport']=function(_0xe80905){var _0x2dd9f0=this;return new Promise(function(_0x257d4a,_0x29116a){return db[_0x5ecd('0x17')][_0x5ecd('0x1b')](_0xe80905[_0x5ecd('0x1c')],{'raw':_0xe80905[_0x5ecd('0x19')]?_0xe80905['options'][_0x5ecd('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe80905['options']?_0xe80905[_0x5ecd('0x19')][_0x5ecd('0x1d')]||null:null,'attributes':_0xe80905[_0x5ecd('0x19')]?_0xe80905[_0x5ecd('0x19')][_0x5ecd('0x1e')]||null:null,'limit':_0xe80905['options']?_0xe80905[_0x5ecd('0x19')][_0x5ecd('0x1f')]||null:null})[_0x5ecd('0xb')](function(_0x38c87d){logger[_0x5ecd('0xc')](_0x5ecd('0x20'),_0xe80905);logger[_0x5ecd('0xf')](_0x5ecd('0x20'),_0xe80905,JSON[_0x5ecd('0x11')](_0x38c87d));_0x257d4a(_0x38c87d);})[_0x5ecd('0x15')](function(_0x16d1d0){logger[_0x5ecd('0x13')](_0x5ecd('0x20'),_0x16d1d0[_0x5ecd('0x14')],_0xe80905);_0x29116a(_0x2dd9f0[_0x5ecd('0x13')](0x1f4,_0x16d1d0[_0x5ecd('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index dd0adc0..3047974 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 _0x43f9=['util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','post','create','/:id/applications','delete','destroy','exports','multer'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x43f9,0x167));var _0x943f=function(_0x37a35b,_0x5896cf){_0x37a35b=_0x37a35b-0x0;var _0x46e006=_0x43f9[_0x37a35b];return _0x46e006;};'use strict';var multer=require(_0x943f('0x0'));var util=require(_0x943f('0x1'));var path=require(_0x943f('0x2'));var timeout=require(_0x943f('0x3'));var express=require(_0x943f('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x943f('0x5'));var config=require(_0x943f('0x6'));var controller=require(_0x943f('0x7'));router[_0x943f('0x8')]('/',auth[_0x943f('0x9')](),controller[_0x943f('0xa')]);router[_0x943f('0x8')](_0x943f('0xb'),auth[_0x943f('0x9')](),controller['show']);router[_0x943f('0xc')]('/',auth['isAuthenticated'](),controller[_0x943f('0xd')]);router[_0x943f('0xc')](_0x943f('0xe'),auth['isAuthenticated'](),controller['addApplications']);router['put'](_0x943f('0xb'),auth[_0x943f('0x9')](),controller['update']);router[_0x943f('0xf')]('/:id',auth[_0x943f('0x9')](),controller[_0x943f('0x10')]);module[_0x943f('0x11')]=router; \ No newline at end of file +var _0xe025=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/applications','multer','util','path','connect-timeout'];(function(_0x4b24ba,_0x15fee8){var _0x2d0c2e=function(_0x539fe9){while(--_0x539fe9){_0x4b24ba['push'](_0x4b24ba['shift']());}};_0x2d0c2e(++_0x15fee8);}(_0xe025,0x146));var _0x5e02=function(_0x4d17d6,_0x345314){_0x4d17d6=_0x4d17d6-0x0;var _0xacbf03=_0xe025[_0x4d17d6];return _0xacbf03;};'use strict';var multer=require(_0x5e02('0x0'));var util=require(_0x5e02('0x1'));var path=require(_0x5e02('0x2'));var timeout=require(_0x5e02('0x3'));var express=require(_0x5e02('0x4'));var router=express[_0x5e02('0x5')]();var auth=require(_0x5e02('0x6'));var interaction=require(_0x5e02('0x7'));var config=require(_0x5e02('0x8'));var controller=require('./voiceExtension.controller');router[_0x5e02('0x9')]('/',auth['isAuthenticated'](),controller[_0x5e02('0xa')]);router[_0x5e02('0x9')](_0x5e02('0xb'),auth[_0x5e02('0xc')](),controller[_0x5e02('0xd')]);router['post']('/',auth[_0x5e02('0xc')](),controller['create']);router['post'](_0x5e02('0xe'),auth[_0x5e02('0xc')](),controller['addApplications']);router['put'](_0x5e02('0xb'),auth[_0x5e02('0xc')](),controller['update']);router['delete'](_0x5e02('0xb'),auth[_0x5e02('0xc')](),controller['destroy']);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 165ba5e..4fc94dd 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 _0xa9e0=['*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','inbound','outbound','internal','system'];(function(_0x296079,_0x14e860){var _0x268dda=function(_0x3603d3){while(--_0x3603d3){_0x296079['push'](_0x296079['shift']());}};_0x268dda(++_0x14e860);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'context':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0a9e('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x0a9e('0x3')},'tag':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x4')},'appdata':{'type':Sequelize[_0x0a9e('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),'inbound-fax','outbound-fax',_0x0a9e('0x8'),'any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x9')},'IntervalId':{'type':Sequelize[_0x0a9e('0xa')]},'isApp':{'type':Sequelize[_0x0a9e('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x0a9e('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x0a9e('0xc')],'get':function(_0xd5b662){return this[_0x0a9e('0xd')](_0x0a9e('0xe'));}}}; \ No newline at end of file +var _0xa9e0=['*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','inbound','outbound','internal','system'];(function(_0x5ae8c0,_0x50ccd0){var _0x48716e=function(_0x123cee){while(--_0x123cee){_0x5ae8c0['push'](_0x5ae8c0['shift']());}};_0x48716e(++_0x50ccd0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'context':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0a9e('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x0a9e('0x3')},'tag':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x4')},'appdata':{'type':Sequelize[_0x0a9e('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),'inbound-fax','outbound-fax',_0x0a9e('0x8'),'any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x9')},'IntervalId':{'type':Sequelize[_0x0a9e('0xa')]},'isApp':{'type':Sequelize[_0x0a9e('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x0a9e('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x0a9e('0xc')],'get':function(_0xd5b662){return this[_0x0a9e('0xd')](_0x0a9e('0xe'));}}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index c2ae997..c110788 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 _0x0ffc=['includes','find','type','name','UserProfileResource','destroy','stack','index','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','options','VoiceExtension','includeAll','include','rows','catch','show','params','create','body','startsWith','exten','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','InboundRoutes','InternalRoutes','UserProfileSection','userProfileId','autoAssociation','error','context','description','recordingFormat','mandatoryDisposition','findOne','sequelize','transaction','VoiceExtensionId','bulkCreate','cast(priority\x20as\x20unsigned)','html-pdf','rimraf','request-promise','moment','util','path','sox','to-csv','ejs','lodash','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','update','then','get','inbound','OutboundRoutes','outbound','internal','filter','ignore','map','value'];(function(_0x21b069,_0x4f6fd0){var _0x2fea7d=function(_0x345193){while(--_0x345193){_0x21b069['push'](_0x21b069['shift']());}};_0x2fea7d(++_0x4f6fd0);}(_0x0ffc,0x108));var _0xc0ff=function(_0x91cf86,_0x45b219){_0x91cf86=_0x91cf86-0x0;var _0x445daa=_0x0ffc[_0x91cf86];return _0x445daa;};'use strict';var pdf=require(_0xc0ff('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc0ff('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc0ff('0x2'));var moment=require(_0xc0ff('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc0ff('0x4'));var path=require(_0xc0ff('0x5'));var sox=require(_0xc0ff('0x6'));var csv=require(_0xc0ff('0x7'));var ejs=require(_0xc0ff('0x8'));var fs=require('fs');var _=require(_0xc0ff('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc0ff('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc0ff('0xb'));var Papa=require(_0xc0ff('0xc'));var Redis=require(_0xc0ff('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xc0ff('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc0ff('0xf'));var logger=require(_0xc0ff('0x10'))(_0xc0ff('0x11'));var utils=require(_0xc0ff('0x12'));var config=require(_0xc0ff('0x13'));var db=require(_0xc0ff('0x14'))['db'];config['redis']=_[_0xc0ff('0x15')](config[_0xc0ff('0x16')],{'host':_0xc0ff('0x17'),'port':0x18eb});var socket=require(_0xc0ff('0x18'))(new Redis(config['redis']));require(_0xc0ff('0x19'))[_0xc0ff('0x1a')](socket);function respondWithStatusCode(_0x55792c,_0x48a6ba){_0x48a6ba=_0x48a6ba||0xcc;return function(_0x507b7f){if(_0x507b7f){return _0x55792c[_0xc0ff('0x1b')](_0x48a6ba);}return _0x55792c[_0xc0ff('0x1c')](_0x48a6ba)[_0xc0ff('0x1d')]();};}function respondWithResult(_0x5fe275,_0x18851b){_0x18851b=_0x18851b||0xc8;return function(_0x5421c7){if(_0x5421c7){return _0x5fe275[_0xc0ff('0x1c')](_0x18851b)[_0xc0ff('0x1e')](_0x5421c7);}};}function respondWithFilteredResult(_0x49fb4c,_0x6f9dc6){return function(_0x7ef9e3){if(_0x7ef9e3){var _0x45ebcb=_0x7ef9e3[_0xc0ff('0x1f')],_0x3e0107=_0x6f9dc6[_0xc0ff('0x20')],_0x2fcbcc=_0x6f9dc6[_0xc0ff('0x20')]+_0x6f9dc6[_0xc0ff('0x21')],_0x3a5f10;if(_0x2fcbcc>=_0x45ebcb){_0x2fcbcc=_0x45ebcb;_0x3a5f10=0xc8;}else{_0x3a5f10=0xce;}_0x49fb4c[_0xc0ff('0x1c')](_0x3a5f10);return _0x49fb4c['set'](_0xc0ff('0x22'),_0x3e0107+'-'+_0x2fcbcc+'/'+_0x45ebcb)[_0xc0ff('0x1e')](_0x7ef9e3);}return null;};}function patchUpdates(_0xa1e371){return function(_0x272548){try{jsonpatch[_0xc0ff('0x23')](_0x272548,_0xa1e371,!![]);}catch(_0x635c58){return BPromise[_0xc0ff('0x24')](_0x635c58);}return _0x272548['save']();};}function saveUpdates(_0x3ddc53,_0x38b03b){return function(_0x3fa69d){if(_0x3fa69d){return _0x3fa69d[_0xc0ff('0x25')](_0x3ddc53)[_0xc0ff('0x26')](function(_0x3006d6){return _0x3006d6;});}return null;};}function removeEntity(_0x137847,_0x150a08){return function(_0x11359c){if(_0x11359c){return _0x11359c['destroy']()[_0xc0ff('0x26')](function(){var _0x4da895=_0x11359c[_0xc0ff('0x27')]({'plain':!![]});var _0x4275c6=[{'name':'InboundRoutes','value':_0xc0ff('0x28'),'ignore':![]},{'name':_0xc0ff('0x29'),'value':_0xc0ff('0x2a'),'ignore':![]},{'name':'InternalRoutes','value':_0xc0ff('0x2b'),'ignore':![]}];var _0x23b23d=_(_0x4275c6)[_0xc0ff('0x2c')](_0xc0ff('0x2d'))[_0xc0ff('0x2e')](_0xc0ff('0x2f'))[_0xc0ff('0x2f')]();if(_[_0xc0ff('0x30')](_0x23b23d,_0x4da895['type'])){return;}var _0x31e109=_[_0xc0ff('0x31')](_0x4275c6,['value',_0x4da895[_0xc0ff('0x32')]])[_0xc0ff('0x33')];return db[_0xc0ff('0x34')][_0xc0ff('0x35')]({'where':{'type':_0x31e109,'resourceId':_0x4da895['id']}})[_0xc0ff('0x26')](function(){return _0x11359c;});})['then'](function(){_0x137847['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4dbd5a,_0x3c5839){return function(_0x34c41c){if(!_0x34c41c){_0x4dbd5a[_0xc0ff('0x1b')](0x194);}return _0x34c41c;};}function handleError(_0x2e27a5,_0x517ce7){_0x517ce7=_0x517ce7||0x1f4;return function(_0x12032b){logger['error'](_0x12032b[_0xc0ff('0x36')]);if(_0x12032b[_0xc0ff('0x33')]){delete _0x12032b[_0xc0ff('0x33')];}_0x2e27a5[_0xc0ff('0x1c')](_0x517ce7)['send'](_0x12032b);};}exports[_0xc0ff('0x37')]=function(_0x167ae5,_0x5e7f58){var _0x596fe7={},_0x2c836e={},_0x15983c={'count':0x0,'rows':[]};var _0x5e3509=_[_0xc0ff('0x2e')](db['VoiceExtension'][_0xc0ff('0x38')],function(_0x3c7c5e){return{'name':_0x3c7c5e[_0xc0ff('0x39')],'type':_0x3c7c5e[_0xc0ff('0x32')]['key']};});_0x2c836e[_0xc0ff('0x3a')]=_[_0xc0ff('0x2e')](_0x5e3509,_0xc0ff('0x33'));_0x2c836e[_0xc0ff('0x3b')]=_[_0xc0ff('0x3c')](_0x167ae5[_0xc0ff('0x3b')]);_0x2c836e[_0xc0ff('0x3d')]=_[_0xc0ff('0x3e')](_0x2c836e[_0xc0ff('0x3a')],_0x2c836e[_0xc0ff('0x3b')]);_0x596fe7[_0xc0ff('0x3f')]=_[_0xc0ff('0x3e')](_0x2c836e[_0xc0ff('0x3a')],qs[_0xc0ff('0x40')](_0x167ae5[_0xc0ff('0x3b')]['fields']));_0x596fe7[_0xc0ff('0x3f')]=_0x596fe7[_0xc0ff('0x3f')][_0xc0ff('0x41')]?_0x596fe7[_0xc0ff('0x3f')]:_0x2c836e[_0xc0ff('0x3a')];if(!_0x167ae5[_0xc0ff('0x3b')][_0xc0ff('0x42')](_0xc0ff('0x43'))){_0x596fe7['limit']=qs[_0xc0ff('0x21')](_0x167ae5[_0xc0ff('0x3b')][_0xc0ff('0x21')]);_0x596fe7[_0xc0ff('0x20')]=qs['offset'](_0x167ae5[_0xc0ff('0x3b')]['offset']);}_0x596fe7[_0xc0ff('0x44')]=qs['sort'](_0x167ae5[_0xc0ff('0x3b')]['sort']);_0x596fe7[_0xc0ff('0x45')]=qs[_0xc0ff('0x3d')](_[_0xc0ff('0x46')](_0x167ae5[_0xc0ff('0x3b')],_0x2c836e[_0xc0ff('0x3d')]));if(_0x167ae5[_0xc0ff('0x3b')]['filter']){_0x596fe7['where']=_[_0xc0ff('0x47')](_0x596fe7[_0xc0ff('0x45')],{'$or':_[_0xc0ff('0x2e')](_0x5e3509,function(_0x314248){if(_0x314248[_0xc0ff('0x32')]!==_0xc0ff('0x48')){var _0x3cda12={};_0x3cda12[_0x314248[_0xc0ff('0x33')]]={'$like':'%'+_0x167ae5[_0xc0ff('0x3b')][_0xc0ff('0x2c')]+'%'};return _0x3cda12;}})});}_0x596fe7=_[_0xc0ff('0x47')]({},_0x596fe7,_0x167ae5[_0xc0ff('0x49')]);var _0x2eb06a={'where':_0x596fe7[_0xc0ff('0x45')]};return db[_0xc0ff('0x4a')]['count'](_0x2eb06a)['then'](function(_0x360035){_0x15983c[_0xc0ff('0x1f')]=_0x360035;if(_0x167ae5[_0xc0ff('0x3b')][_0xc0ff('0x4b')]){_0x596fe7[_0xc0ff('0x4c')]=[{'all':!![]}];}return db['VoiceExtension']['findAll'](_0x596fe7);})[_0xc0ff('0x26')](function(_0x203149){_0x15983c[_0xc0ff('0x4d')]=_0x203149;return _0x15983c;})[_0xc0ff('0x26')](respondWithFilteredResult(_0x5e7f58,_0x596fe7))[_0xc0ff('0x4e')](handleError(_0x5e7f58,null));};exports[_0xc0ff('0x4f')]=function(_0x4c1b56,_0xa0b902){var _0x9b922a={'raw':![],'where':{'id':_0x4c1b56[_0xc0ff('0x50')]['id']}},_0x73df7a={};_0x73df7a['model']=_[_0xc0ff('0x3c')](db[_0xc0ff('0x4a')]['rawAttributes']);_0x73df7a[_0xc0ff('0x3b')]=_[_0xc0ff('0x3c')](_0x4c1b56[_0xc0ff('0x3b')]);_0x73df7a['filters']=_[_0xc0ff('0x3e')](_0x73df7a[_0xc0ff('0x3a')],_0x73df7a[_0xc0ff('0x3b')]);_0x9b922a[_0xc0ff('0x3f')]=_[_0xc0ff('0x3e')](_0x73df7a[_0xc0ff('0x3a')],qs['fields'](_0x4c1b56[_0xc0ff('0x3b')][_0xc0ff('0x40')]));_0x9b922a[_0xc0ff('0x3f')]=_0x9b922a['attributes'][_0xc0ff('0x41')]?_0x9b922a[_0xc0ff('0x3f')]:_0x73df7a['model'];if(_0x4c1b56[_0xc0ff('0x3b')]['includeAll']){_0x9b922a['include']=[{'all':!![]}];}_0x9b922a=_[_0xc0ff('0x47')]({},_0x9b922a,_0x4c1b56[_0xc0ff('0x49')]);return db[_0xc0ff('0x4a')]['find'](_0x9b922a)['then'](handleEntityNotFound(_0xa0b902,null))[_0xc0ff('0x26')](respondWithResult(_0xa0b902,null))[_0xc0ff('0x4e')](handleError(_0xa0b902,null));};exports['destroy']=function(_0x391625,_0x6c2147){return db[_0xc0ff('0x4a')][_0xc0ff('0x31')]({'where':{'id':_0x391625[_0xc0ff('0x50')]['id']}})[_0xc0ff('0x26')](handleEntityNotFound(_0x6c2147,null))[_0xc0ff('0x26')](removeEntity(_0x6c2147,null))[_0xc0ff('0x4e')](handleError(_0x6c2147,null));};exports[_0xc0ff('0x51')]=function(_0x46540c,_0x564997){if(_0x46540c[_0xc0ff('0x52')][_0xc0ff('0x32')]===_0xc0ff('0x2a')&&!_[_0xc0ff('0x53')](_0x46540c[_0xc0ff('0x52')][_0xc0ff('0x54')],'_')){_0x46540c[_0xc0ff('0x52')][_0xc0ff('0x54')]='_'['concat'](_0x46540c[_0xc0ff('0x52')][_0xc0ff('0x54')]);}return db['VoiceExtension']['create'](_0x46540c['body'],{'raw':![]})['then'](function(_0x2f8ea6){var _0x4e4d9a=_0x46540c[_0xc0ff('0x55')][_0xc0ff('0x27')]({'plain':!![]});if(!_0x4e4d9a)throw new Error(_0xc0ff('0x56'));if(_0x4e4d9a[_0xc0ff('0x57')]===_0xc0ff('0x55')){var _0x4b0597=_0x2f8ea6['get']({'plain':!![]});var _0x12fdc9=[{'name':_0xc0ff('0x58'),'value':_0xc0ff('0x28')},{'name':_0xc0ff('0x29'),'value':_0xc0ff('0x2a')},{'name':_0xc0ff('0x59'),'value':_0xc0ff('0x2b')}];var _0xc59a97=_[_0xc0ff('0x31')](_0x12fdc9,[_0xc0ff('0x2f'),_0x4b0597[_0xc0ff('0x32')]])['name'];return db[_0xc0ff('0x5a')][_0xc0ff('0x31')]({'where':{'name':_0xc59a97,'userProfileId':_0x4e4d9a[_0xc0ff('0x5b')]},'raw':!![]})['then'](function(_0x4a4d0b){if(_0x4a4d0b&&_0x4a4d0b[_0xc0ff('0x5c')]===0x0){return db[_0xc0ff('0x34')]['create']({'name':_0x4b0597[_0xc0ff('0x33')],'resourceId':_0x4b0597['id'],'type':_0x4a4d0b[_0xc0ff('0x33')],'sectionId':_0x4a4d0b['id']},{})['then'](function(){return _0x2f8ea6;});}else{return _0x2f8ea6;}})['catch'](function(_0x2960fd){logger[_0xc0ff('0x5d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2960fd);throw _0x2960fd;});}return _0x2f8ea6;})[_0xc0ff('0x26')](respondWithResult(_0x564997,0xc9))[_0xc0ff('0x4e')](handleError(_0x564997,null));};exports[_0xc0ff('0x25')]=function(_0x20bfca,_0x39448b){if(_0x20bfca[_0xc0ff('0x52')]['id']){delete _0x20bfca['body']['id'];}return db['VoiceExtension'][_0xc0ff('0x31')]({'where':{'id':_0x20bfca[_0xc0ff('0x50')]['id']}})['then'](handleEntityNotFound(_0x39448b,null))[_0xc0ff('0x26')](function(_0x582bca){if(_0x582bca){return db[_0xc0ff('0x4a')][_0xc0ff('0x25')](_[_0xc0ff('0x46')](_0x20bfca[_0xc0ff('0x52')],[_0xc0ff('0x54'),_0xc0ff('0x5e'),_0xc0ff('0x5f'),_0xc0ff('0x60'),'cutdigits',_0xc0ff('0x61')]),{'where':{'context':_0x582bca['context'],'exten':_0x582bca[_0xc0ff('0x54')]},'individualHooks':!![]})[_0xc0ff('0x26')](function(_0x3a97d1){return _0x3a97d1;});}return null;})[_0xc0ff('0x26')](respondWithStatusCode(_0x39448b,null))[_0xc0ff('0x4e')](handleError(_0x39448b,null));};exports['addApplications']=function(_0x371ca1,_0x34584b,_0x567fc1){return db[_0xc0ff('0x4a')][_0xc0ff('0x62')]({'where':{'id':_0x371ca1[_0xc0ff('0x50')]['id']}})['then'](handleEntityNotFound(_0x34584b,null))['then'](function(_0x161541){if(_0x161541){return db[_0xc0ff('0x63')][_0xc0ff('0x64')](function(_0x168506){return db[_0xc0ff('0x4a')][_0xc0ff('0x35')]({'where':{'VoiceExtensionId':_0x371ca1[_0xc0ff('0x50')]['id']},'transaction':_0x168506})[_0xc0ff('0x26')](function(_0x35a5c9){var _0x30c182=_[_0xc0ff('0x2e')](_0x371ca1['body'],function(_0x5b0ee9){_0x5b0ee9[_0xc0ff('0x65')]=_0x371ca1[_0xc0ff('0x50')]['id'];return _0x5b0ee9;});return db['VoiceExtension'][_0xc0ff('0x66')](_0x30c182,{'transaction':_0x168506});});})[_0xc0ff('0x26')](function(){return db['VoiceExtension']['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x371ca1[_0xc0ff('0x50')]['id']},'order':_0xc0ff('0x67')});});}})['then'](respondWithResult(_0x34584b,null))['catch'](handleError(_0x34584b,null));}; \ No newline at end of file +var _0xb9f1=['order','sort','where','pick','merge','VIRTUAL','options','include','show','params','create','startsWith','body','exten','concat','user','role','InboundRoutes','UserProfileSection','userProfileId','autoAssociation','catch','context','description','cutdigits','mandatoryDisposition','addApplications','findOne','sequelize','transaction','VoiceExtensionId','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./voiceExtension.socket','register','status','end','count','offset','json','apply','reject','update','then','get','inbound','outbound','InternalRoutes','internal','filter','map','value','includes','type','find','name','UserProfileResource','destroy','sendStatus','error','stack','send','VoiceExtension','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit'];(function(_0x2eac08,_0x549aeb){var _0x4d5afc=function(_0x588a25){while(--_0x588a25){_0x2eac08['push'](_0x2eac08['shift']());}};_0x4d5afc(++_0x549aeb);}(_0xb9f1,0xfc));var _0x1b9f=function(_0x593a56,_0x5a0c8a){_0x593a56=_0x593a56-0x0;var _0x1f82f9=_0xb9f1[_0x593a56];return _0x1f82f9;};'use strict';var pdf=require(_0x1b9f('0x0'));var emlformat=require(_0x1b9f('0x1'));var rimraf=require(_0x1b9f('0x2'));var zipdir=require(_0x1b9f('0x3'));var jsonpatch=require(_0x1b9f('0x4'));var rp=require(_0x1b9f('0x5'));var moment=require(_0x1b9f('0x6'));var BPromise=require(_0x1b9f('0x7'));var Mustache=require(_0x1b9f('0x8'));var util=require(_0x1b9f('0x9'));var path=require(_0x1b9f('0xa'));var sox=require(_0x1b9f('0xb'));var csv=require(_0x1b9f('0xc'));var ejs=require(_0x1b9f('0xd'));var fs=require('fs');var _=require(_0x1b9f('0xe'));var squel=require(_0x1b9f('0xf'));var crypto=require(_0x1b9f('0x10'));var jsforce=require(_0x1b9f('0x11'));var deskjs=require(_0x1b9f('0x12'));var toCsv=require(_0x1b9f('0xc'));var querystring=require(_0x1b9f('0x13'));var Papa=require(_0x1b9f('0x14'));var Redis=require('ioredis');var authService=require(_0x1b9f('0x15'));var qs=require(_0x1b9f('0x16'));var as=require(_0x1b9f('0x17'));var hardwareService=require(_0x1b9f('0x18'));var logger=require(_0x1b9f('0x19'))(_0x1b9f('0x1a'));var utils=require(_0x1b9f('0x1b'));var config=require('../../config/environment');var db=require(_0x1b9f('0x1c'))['db'];config[_0x1b9f('0x1d')]=_[_0x1b9f('0x1e')](config[_0x1b9f('0x1d')],{'host':'localhost','port':0x18eb});var socket=require(_0x1b9f('0x1f'))(new Redis(config[_0x1b9f('0x1d')]));require(_0x1b9f('0x20'))[_0x1b9f('0x21')](socket);function respondWithStatusCode(_0xf1fedf,_0x4f6fcc){_0x4f6fcc=_0x4f6fcc||0xcc;return function(_0x2c7cc8){if(_0x2c7cc8){return _0xf1fedf['sendStatus'](_0x4f6fcc);}return _0xf1fedf[_0x1b9f('0x22')](_0x4f6fcc)[_0x1b9f('0x23')]();};}function respondWithResult(_0x43b2e4,_0x4a3551){_0x4a3551=_0x4a3551||0xc8;return function(_0x31694f){if(_0x31694f){return _0x43b2e4[_0x1b9f('0x22')](_0x4a3551)['json'](_0x31694f);}};}function respondWithFilteredResult(_0x2a4e71,_0x412cfd){return function(_0x230f52){if(_0x230f52){var _0x56930f=_0x230f52[_0x1b9f('0x24')],_0x515ca2=_0x412cfd[_0x1b9f('0x25')],_0x4c75c6=_0x412cfd[_0x1b9f('0x25')]+_0x412cfd['limit'],_0x1de6c8;if(_0x4c75c6>=_0x56930f){_0x4c75c6=_0x56930f;_0x1de6c8=0xc8;}else{_0x1de6c8=0xce;}_0x2a4e71[_0x1b9f('0x22')](_0x1de6c8);return _0x2a4e71['set']('Content-Range',_0x515ca2+'-'+_0x4c75c6+'/'+_0x56930f)[_0x1b9f('0x26')](_0x230f52);}return null;};}function patchUpdates(_0x31b01f){return function(_0x36e92a){try{jsonpatch[_0x1b9f('0x27')](_0x36e92a,_0x31b01f,!![]);}catch(_0x14f18f){return BPromise[_0x1b9f('0x28')](_0x14f18f);}return _0x36e92a['save']();};}function saveUpdates(_0x327c95,_0x10506c){return function(_0x386fd9){if(_0x386fd9){return _0x386fd9[_0x1b9f('0x29')](_0x327c95)[_0x1b9f('0x2a')](function(_0x5bc85a){return _0x5bc85a;});}return null;};}function removeEntity(_0x101833,_0x4d1152){return function(_0x188db6){if(_0x188db6){return _0x188db6['destroy']()['then'](function(){var _0x154b42=_0x188db6[_0x1b9f('0x2b')]({'plain':!![]});var _0x540cb5=[{'name':'InboundRoutes','value':_0x1b9f('0x2c'),'ignore':![]},{'name':'OutboundRoutes','value':_0x1b9f('0x2d'),'ignore':![]},{'name':_0x1b9f('0x2e'),'value':_0x1b9f('0x2f'),'ignore':![]}];var _0x12aafa=_(_0x540cb5)[_0x1b9f('0x30')]('ignore')[_0x1b9f('0x31')](_0x1b9f('0x32'))[_0x1b9f('0x32')]();if(_[_0x1b9f('0x33')](_0x12aafa,_0x154b42[_0x1b9f('0x34')])){return;}var _0x40e687=_[_0x1b9f('0x35')](_0x540cb5,[_0x1b9f('0x32'),_0x154b42['type']])[_0x1b9f('0x36')];return db[_0x1b9f('0x37')][_0x1b9f('0x38')]({'where':{'type':_0x40e687,'resourceId':_0x154b42['id']}})[_0x1b9f('0x2a')](function(){return _0x188db6;});})[_0x1b9f('0x2a')](function(){_0x101833[_0x1b9f('0x22')](0xcc)[_0x1b9f('0x23')]();});}};}function handleEntityNotFound(_0x3dcce1,_0x3bff67){return function(_0x2e9cd8){if(!_0x2e9cd8){_0x3dcce1[_0x1b9f('0x39')](0x194);}return _0x2e9cd8;};}function handleError(_0x3c38e9,_0x8f51c8){_0x8f51c8=_0x8f51c8||0x1f4;return function(_0x31d36e){logger[_0x1b9f('0x3a')](_0x31d36e[_0x1b9f('0x3b')]);if(_0x31d36e[_0x1b9f('0x36')]){delete _0x31d36e[_0x1b9f('0x36')];}_0x3c38e9[_0x1b9f('0x22')](_0x8f51c8)[_0x1b9f('0x3c')](_0x31d36e);};}exports['index']=function(_0x13c688,_0x360be7){var _0x1a954b={},_0x5388bd={},_0x3e9ebf={'count':0x0,'rows':[]};var _0x416731=_['map'](db[_0x1b9f('0x3d')][_0x1b9f('0x3e')],function(_0x1933d1){return{'name':_0x1933d1[_0x1b9f('0x3f')],'type':_0x1933d1[_0x1b9f('0x34')][_0x1b9f('0x40')]};});_0x5388bd[_0x1b9f('0x41')]=_[_0x1b9f('0x31')](_0x416731,_0x1b9f('0x36'));_0x5388bd['query']=_['keys'](_0x13c688[_0x1b9f('0x42')]);_0x5388bd[_0x1b9f('0x43')]=_[_0x1b9f('0x44')](_0x5388bd['model'],_0x5388bd['query']);_0x1a954b[_0x1b9f('0x45')]=_[_0x1b9f('0x44')](_0x5388bd[_0x1b9f('0x41')],qs[_0x1b9f('0x46')](_0x13c688[_0x1b9f('0x42')][_0x1b9f('0x46')]));_0x1a954b[_0x1b9f('0x45')]=_0x1a954b[_0x1b9f('0x45')][_0x1b9f('0x47')]?_0x1a954b[_0x1b9f('0x45')]:_0x5388bd[_0x1b9f('0x41')];if(!_0x13c688[_0x1b9f('0x42')][_0x1b9f('0x48')](_0x1b9f('0x49'))){_0x1a954b[_0x1b9f('0x4a')]=qs['limit'](_0x13c688['query'][_0x1b9f('0x4a')]);_0x1a954b['offset']=qs[_0x1b9f('0x25')](_0x13c688[_0x1b9f('0x42')][_0x1b9f('0x25')]);}_0x1a954b[_0x1b9f('0x4b')]=qs[_0x1b9f('0x4c')](_0x13c688['query'][_0x1b9f('0x4c')]);_0x1a954b[_0x1b9f('0x4d')]=qs[_0x1b9f('0x43')](_[_0x1b9f('0x4e')](_0x13c688[_0x1b9f('0x42')],_0x5388bd['filters']));if(_0x13c688[_0x1b9f('0x42')][_0x1b9f('0x30')]){_0x1a954b[_0x1b9f('0x4d')]=_[_0x1b9f('0x4f')](_0x1a954b[_0x1b9f('0x4d')],{'$or':_['map'](_0x416731,function(_0x6fdecd){if(_0x6fdecd[_0x1b9f('0x34')]!==_0x1b9f('0x50')){var _0x3bafae={};_0x3bafae[_0x6fdecd[_0x1b9f('0x36')]]={'$like':'%'+_0x13c688[_0x1b9f('0x42')]['filter']+'%'};return _0x3bafae;}})});}_0x1a954b=_[_0x1b9f('0x4f')]({},_0x1a954b,_0x13c688[_0x1b9f('0x51')]);var _0x31036b={'where':_0x1a954b[_0x1b9f('0x4d')]};return db[_0x1b9f('0x3d')][_0x1b9f('0x24')](_0x31036b)[_0x1b9f('0x2a')](function(_0x10e17b){_0x3e9ebf[_0x1b9f('0x24')]=_0x10e17b;if(_0x13c688[_0x1b9f('0x42')]['includeAll']){_0x1a954b[_0x1b9f('0x52')]=[{'all':!![]}];}return db['VoiceExtension']['findAll'](_0x1a954b);})[_0x1b9f('0x2a')](function(_0x1d9ef6){_0x3e9ebf['rows']=_0x1d9ef6;return _0x3e9ebf;})['then'](respondWithFilteredResult(_0x360be7,_0x1a954b))['catch'](handleError(_0x360be7,null));};exports[_0x1b9f('0x53')]=function(_0x560e6b,_0x5c52b5){var _0x597f56={'raw':![],'where':{'id':_0x560e6b[_0x1b9f('0x54')]['id']}},_0x45e041={};_0x45e041[_0x1b9f('0x41')]=_['keys'](db['VoiceExtension'][_0x1b9f('0x3e')]);_0x45e041[_0x1b9f('0x42')]=_['keys'](_0x560e6b[_0x1b9f('0x42')]);_0x45e041['filters']=_[_0x1b9f('0x44')](_0x45e041['model'],_0x45e041['query']);_0x597f56[_0x1b9f('0x45')]=_[_0x1b9f('0x44')](_0x45e041[_0x1b9f('0x41')],qs[_0x1b9f('0x46')](_0x560e6b[_0x1b9f('0x42')][_0x1b9f('0x46')]));_0x597f56[_0x1b9f('0x45')]=_0x597f56[_0x1b9f('0x45')]['length']?_0x597f56[_0x1b9f('0x45')]:_0x45e041[_0x1b9f('0x41')];if(_0x560e6b[_0x1b9f('0x42')]['includeAll']){_0x597f56[_0x1b9f('0x52')]=[{'all':!![]}];}_0x597f56=_['merge']({},_0x597f56,_0x560e6b[_0x1b9f('0x51')]);return db[_0x1b9f('0x3d')][_0x1b9f('0x35')](_0x597f56)['then'](handleEntityNotFound(_0x5c52b5,null))[_0x1b9f('0x2a')](respondWithResult(_0x5c52b5,null))['catch'](handleError(_0x5c52b5,null));};exports[_0x1b9f('0x38')]=function(_0x43d1d4,_0x130487){return db[_0x1b9f('0x3d')]['find']({'where':{'id':_0x43d1d4[_0x1b9f('0x54')]['id']}})['then'](handleEntityNotFound(_0x130487,null))['then'](removeEntity(_0x130487,null))['catch'](handleError(_0x130487,null));};exports[_0x1b9f('0x55')]=function(_0x30a46b,_0x30e882){if(_0x30a46b['body']['type']===_0x1b9f('0x2d')&&!_[_0x1b9f('0x56')](_0x30a46b[_0x1b9f('0x57')][_0x1b9f('0x58')],'_')){_0x30a46b[_0x1b9f('0x57')][_0x1b9f('0x58')]='_'[_0x1b9f('0x59')](_0x30a46b[_0x1b9f('0x57')][_0x1b9f('0x58')]);}return db[_0x1b9f('0x3d')][_0x1b9f('0x55')](_0x30a46b[_0x1b9f('0x57')],{'raw':![]})[_0x1b9f('0x2a')](function(_0xfa983){var _0x462e9d=_0x30a46b[_0x1b9f('0x5a')]['get']({'plain':!![]});if(!_0x462e9d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x462e9d[_0x1b9f('0x5b')]===_0x1b9f('0x5a')){var _0x4d9cc9=_0xfa983[_0x1b9f('0x2b')]({'plain':!![]});var _0x431677=[{'name':_0x1b9f('0x5c'),'value':_0x1b9f('0x2c')},{'name':'OutboundRoutes','value':_0x1b9f('0x2d')},{'name':'InternalRoutes','value':_0x1b9f('0x2f')}];var _0x1240aa=_['find'](_0x431677,[_0x1b9f('0x32'),_0x4d9cc9['type']])[_0x1b9f('0x36')];return db[_0x1b9f('0x5d')][_0x1b9f('0x35')]({'where':{'name':_0x1240aa,'userProfileId':_0x462e9d[_0x1b9f('0x5e')]},'raw':!![]})[_0x1b9f('0x2a')](function(_0x1a8465){if(_0x1a8465&&_0x1a8465[_0x1b9f('0x5f')]===0x0){return db[_0x1b9f('0x37')][_0x1b9f('0x55')]({'name':_0x4d9cc9[_0x1b9f('0x36')],'resourceId':_0x4d9cc9['id'],'type':_0x1a8465[_0x1b9f('0x36')],'sectionId':_0x1a8465['id']},{})[_0x1b9f('0x2a')](function(){return _0xfa983;});}else{return _0xfa983;}})[_0x1b9f('0x60')](function(_0xb2e623){logger[_0x1b9f('0x3a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xb2e623);throw _0xb2e623;});}return _0xfa983;})['then'](respondWithResult(_0x30e882,0xc9))[_0x1b9f('0x60')](handleError(_0x30e882,null));};exports[_0x1b9f('0x29')]=function(_0x187516,_0x104f1c){if(_0x187516[_0x1b9f('0x57')]['id']){delete _0x187516[_0x1b9f('0x57')]['id'];}return db[_0x1b9f('0x3d')][_0x1b9f('0x35')]({'where':{'id':_0x187516[_0x1b9f('0x54')]['id']}})[_0x1b9f('0x2a')](handleEntityNotFound(_0x104f1c,null))[_0x1b9f('0x2a')](function(_0x3de50c){if(_0x3de50c){return db[_0x1b9f('0x3d')]['update'](_['pick'](_0x187516['body'],[_0x1b9f('0x58'),_0x1b9f('0x61'),_0x1b9f('0x62'),'recordingFormat',_0x1b9f('0x63'),_0x1b9f('0x64')]),{'where':{'context':_0x3de50c[_0x1b9f('0x61')],'exten':_0x3de50c[_0x1b9f('0x58')]},'individualHooks':!![]})[_0x1b9f('0x2a')](function(_0x133ac7){return _0x133ac7;});}return null;})[_0x1b9f('0x2a')](respondWithStatusCode(_0x104f1c,null))[_0x1b9f('0x60')](handleError(_0x104f1c,null));};exports[_0x1b9f('0x65')]=function(_0x4d3778,_0x294c71,_0x3abb67){return db[_0x1b9f('0x3d')][_0x1b9f('0x66')]({'where':{'id':_0x4d3778[_0x1b9f('0x54')]['id']}})['then'](handleEntityNotFound(_0x294c71,null))[_0x1b9f('0x2a')](function(_0x3cdbc1){if(_0x3cdbc1){return db[_0x1b9f('0x67')][_0x1b9f('0x68')](function(_0x3b47fb){return db[_0x1b9f('0x3d')][_0x1b9f('0x38')]({'where':{'VoiceExtensionId':_0x4d3778[_0x1b9f('0x54')]['id']},'transaction':_0x3b47fb})[_0x1b9f('0x2a')](function(_0x4a0967){var _0x23db38=_[_0x1b9f('0x31')](_0x4d3778[_0x1b9f('0x57')],function(_0x4e0768){_0x4e0768[_0x1b9f('0x69')]=_0x4d3778[_0x1b9f('0x54')]['id'];return _0x4e0768;});return db[_0x1b9f('0x3d')][_0x1b9f('0x6a')](_0x23db38,{'transaction':_0x3b47fb});});})[_0x1b9f('0x2a')](function(){return db['VoiceExtension'][_0x1b9f('0x6b')]({'where':{'isApp':!![],'VoiceExtensionId':_0x4d3778[_0x1b9f('0x54')]['id']},'order':_0x1b9f('0x6c')});});}})[_0x1b9f('0x2a')](respondWithResult(_0x294c71,null))['catch'](handleError(_0x294c71,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index ffca20f..ea3b7a9 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 _0x0f42=['VoiceExtension','setMaxListeners','update','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x0f42,0x126));var _0x20f4=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x0f42[_0x17d9e3];return _0x14192d;};'use strict';var EventEmitter=require(_0x20f4('0x0'));var VoiceExtension=require(_0x20f4('0x1'))['db'][_0x20f4('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x20f4('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x20f4('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1eb4ca){return function(_0x4a2add,_0x1b1f1a,_0x30ee00){VoiceExtensionEvents[_0x20f4('0x5')](_0x1eb4ca+':'+_0x4a2add['id'],_0x4a2add);VoiceExtensionEvents['emit'](_0x1eb4ca,_0x4a2add);_0x30ee00(null);};}for(var e in events){if(events[_0x20f4('0x6')](e)){var event=events[e];VoiceExtension[_0x20f4('0x7')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file +var _0xdade=['VoiceExtension','update','remove','emit','hook','exports','../../mysqldb'];(function(_0x4e5e7d,_0x3c8421){var _0x490677=function(_0x45e94b){while(--_0x45e94b){_0x4e5e7d['push'](_0x4e5e7d['shift']());}};_0x490677(++_0x3c8421);}(_0xdade,0x13a));var _0xedad=function(_0x460f81,_0x553431){_0x460f81=_0x460f81-0x0;var _0x423f0d=_0xdade[_0x460f81];return _0x423f0d;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0xedad('0x0'))['db'][_0xedad('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xedad('0x2'),'afterDestroy':_0xedad('0x3')};function emitEvent(_0x489d67){return function(_0x12cbb6,_0x5af30f,_0x13d1b1){VoiceExtensionEvents[_0xedad('0x4')](_0x489d67+':'+_0x12cbb6['id'],_0x12cbb6);VoiceExtensionEvents[_0xedad('0x4')](_0x489d67,_0x12cbb6);_0x13d1b1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0xedad('0x5')](e,emitEvent(event));}}module[_0xedad('0x6')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 72fbbef..0c7820f 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 _0xead0=['bluebird','path','rimraf','../../config/environment','./voiceExtension.attributes','exports','define','VoiceExtension','voice_extensions','lodash','util','../../config/logger','api','moment'];(function(_0x59cb93,_0x547bd3){var _0x15938a=function(_0x30e919){while(--_0x30e919){_0x59cb93['push'](_0x59cb93['shift']());}};_0x15938a(++_0x547bd3);}(_0xead0,0xe9));var _0x0ead=function(_0x2a75cd,_0x247962){_0x2a75cd=_0x2a75cd-0x0;var _0x2319bc=_0xead0[_0x2a75cd];return _0x2319bc;};'use strict';var _=require(_0x0ead('0x0'));var util=require(_0x0ead('0x1'));var logger=require(_0x0ead('0x2'))(_0x0ead('0x3'));var moment=require(_0x0ead('0x4'));var BPromise=require(_0x0ead('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0ead('0x6'));var rimraf=require(_0x0ead('0x7'));var config=require(_0x0ead('0x8'));var attributes=require(_0x0ead('0x9'));module[_0x0ead('0xa')]=function(_0x5b96cd,_0xf8be08){return _0x5b96cd[_0x0ead('0xb')](_0x0ead('0xc'),attributes,{'tableName':_0x0ead('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7147=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceExtension.attributes','exports','voice_extensions'];(function(_0x74ba2b,_0x37a94a){var _0x13b788=function(_0x47914e){while(--_0x47914e){_0x74ba2b['push'](_0x74ba2b['shift']());}};_0x13b788(++_0x37a94a);}(_0x7147,0xdc));var _0x7714=function(_0x22bdd3,_0x552e50){_0x22bdd3=_0x22bdd3-0x0;var _0x44d9d9=_0x7147[_0x22bdd3];return _0x44d9d9;};'use strict';var _=require('lodash');var util=require(_0x7714('0x0'));var logger=require(_0x7714('0x1'))(_0x7714('0x2'));var moment=require(_0x7714('0x3'));var BPromise=require(_0x7714('0x4'));var rp=require(_0x7714('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7714('0x6'));var config=require(_0x7714('0x7'));var attributes=require(_0x7714('0x8'));module[_0x7714('0x9')]=function(_0x4826f1,_0x55b4d5){return _0x4826f1['define']('VoiceExtension',attributes,{'tableName':_0x7714('0xa'),'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 46beeec..0c25898 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 _0x81ee=['code','message','catch','GetVoiceExtension','findAll','options','raw','attributes','limit','include','map','model','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xe74768,_0x4c0bf9){var _0x302e8a=function(_0x5ba5c8){while(--_0x5ba5c8){_0xe74768['push'](_0xe74768['shift']());}};_0x302e8a(++_0x4c0bf9);}(_0x81ee,0x1c8));var _0xe81e=function(_0x180ab9,_0x2489af){_0x180ab9=_0x180ab9-0x0;var _0x2bd2d8=_0x81ee[_0x180ab9];return _0x2bd2d8;};'use strict';var _=require(_0xe81e('0x0'));var util=require('util');var moment=require(_0xe81e('0x1'));var BPromise=require('bluebird');var rs=require(_0xe81e('0x2'));var fs=require('fs');var Redis=require(_0xe81e('0x3'));var db=require(_0xe81e('0x4'))['db'];var utils=require(_0xe81e('0x5'));var logger=require(_0xe81e('0x6'))(_0xe81e('0x7'));var config=require(_0xe81e('0x8'));var jayson=require(_0xe81e('0x9'));var client=jayson[_0xe81e('0xa')][_0xe81e('0xb')]({'port':0x232a});config['redis']=_[_0xe81e('0xc')](config[_0xe81e('0xd')],{'host':_0xe81e('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe81e('0xd')]));require('./voiceExtension.socket')[_0xe81e('0xf')](socket);function respondWithRpcPromise(_0x2c8397,_0x17ff3e,_0x2a13ea){return new BPromise(function(_0x3ce66c,_0xfe30b3){return client[_0xe81e('0x10')](_0x2c8397,_0x2a13ea)[_0xe81e('0x11')](function(_0x59eba0){logger[_0xe81e('0x12')](_0xe81e('0x13'),_0x17ff3e,_0xe81e('0x14'));logger[_0xe81e('0x15')](_0xe81e('0x16'),_0x17ff3e,_0xe81e('0x14'),JSON[_0xe81e('0x17')](_0x59eba0));if(_0x59eba0[_0xe81e('0x18')]){if(_0x59eba0['error'][_0xe81e('0x19')]===0x1f4){logger[_0xe81e('0x18')](_0xe81e('0x13'),_0x17ff3e,_0x59eba0[_0xe81e('0x18')][_0xe81e('0x1a')]);return _0xfe30b3(_0x59eba0[_0xe81e('0x18')][_0xe81e('0x1a')]);}logger[_0xe81e('0x18')](_0xe81e('0x13'),_0x17ff3e,_0x59eba0['error'][_0xe81e('0x1a')]);return _0x3ce66c(_0x59eba0[_0xe81e('0x18')][_0xe81e('0x1a')]);}else{logger[_0xe81e('0x12')](_0xe81e('0x13'),_0x17ff3e,_0xe81e('0x14'));_0x3ce66c(_0x59eba0['result'][_0xe81e('0x1a')]);}})[_0xe81e('0x1b')](function(_0x1ef290){logger['error'](_0xe81e('0x13'),_0x17ff3e,_0x1ef290);_0xfe30b3(_0x1ef290);});});}exports[_0xe81e('0x1c')]=function(_0x1f3266){var _0x39be4a=this;return new Promise(function(_0xdb1183,_0x160944){return db['VoiceExtension'][_0xe81e('0x1d')]({'raw':_0x1f3266[_0xe81e('0x1e')]?_0x1f3266[_0xe81e('0x1e')][_0xe81e('0x1f')]===undefined?!![]:![]:!![],'where':_0x1f3266['options']?_0x1f3266['options']['where']||null:null,'attributes':_0x1f3266[_0xe81e('0x1e')]?_0x1f3266[_0xe81e('0x1e')][_0xe81e('0x20')]||null:null,'limit':_0x1f3266['options']?_0x1f3266[_0xe81e('0x1e')][_0xe81e('0x21')]||null:null,'include':_0x1f3266[_0xe81e('0x1e')]?_0x1f3266[_0xe81e('0x1e')][_0xe81e('0x22')]?_[_0xe81e('0x23')](_0x1f3266[_0xe81e('0x1e')]['include'],function(_0x5e3138){return{'model':db[_0x5e3138[_0xe81e('0x24')]],'as':_0x5e3138['as'],'attributes':_0x5e3138[_0xe81e('0x20')],'include':_0x5e3138[_0xe81e('0x22')]?_['map'](_0x5e3138[_0xe81e('0x22')],function(_0x161d06){return{'model':db[_0x161d06[_0xe81e('0x24')]],'as':_0x161d06['as'],'attributes':_0x161d06['attributes'],'include':_0x161d06['include']?_['map'](_0x161d06[_0xe81e('0x22')],function(_0x4ecb97){return{'model':db[_0x4ecb97[_0xe81e('0x24')]],'as':_0x4ecb97['as'],'attributes':_0x4ecb97[_0xe81e('0x20')]};}):[]};}):[]};}):[]:[]})[_0xe81e('0x11')](function(_0x4b813d){logger['info'](_0xe81e('0x1c'),_0x1f3266);logger[_0xe81e('0x15')](_0xe81e('0x1c'),_0x1f3266,JSON[_0xe81e('0x17')](_0x4b813d));_0xdb1183(_0x4b813d);})[_0xe81e('0x1b')](function(_0x2d0881){logger[_0xe81e('0x18')]('GetVoiceExtension',_0x2d0881['message'],_0x1f3266);_0x160944(_0x39be4a[_0xe81e('0x18')](0x1f4,_0x2d0881[_0xe81e('0x1a')]));});});}; \ No newline at end of file +var _0x0647=['message','GetVoiceExtension','VoiceExtension','options','raw','attributes','limit','include','map','model','stringify','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','request','then','info','VoiceExtension,\x20%s,\x20%s','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x0647,0x160));var _0x7064=function(_0x2a0738,_0x3c0bc5){_0x2a0738=_0x2a0738-0x0;var _0x159679=_0x0647[_0x2a0738];return _0x159679;};'use strict';var _=require('lodash');var util=require(_0x7064('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7064('0x1'));var fs=require('fs');var Redis=require(_0x7064('0x2'));var db=require(_0x7064('0x3'))['db'];var utils=require(_0x7064('0x4'));var logger=require(_0x7064('0x5'))(_0x7064('0x6'));var config=require(_0x7064('0x7'));var jayson=require(_0x7064('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x7064('0x9')]=_[_0x7064('0xa')](config[_0x7064('0x9')],{'host':_0x7064('0xb'),'port':0x18eb});var socket=require(_0x7064('0xc'))(new Redis(config[_0x7064('0x9')]));require(_0x7064('0xd'))['register'](socket);function respondWithRpcPromise(_0xd6fb6e,_0x151d6f,_0x21b43f){return new BPromise(function(_0x186b3c,_0x1e6355){return client[_0x7064('0xe')](_0xd6fb6e,_0x21b43f)[_0x7064('0xf')](function(_0x4f355a){logger[_0x7064('0x10')](_0x7064('0x11'),_0x151d6f,'request\x20sent');logger[_0x7064('0x12')](_0x7064('0x13'),_0x151d6f,'request\x20sent',JSON['stringify'](_0x4f355a));if(_0x4f355a[_0x7064('0x14')]){if(_0x4f355a['error'][_0x7064('0x15')]===0x1f4){logger['error'](_0x7064('0x11'),_0x151d6f,_0x4f355a['error'][_0x7064('0x16')]);return _0x1e6355(_0x4f355a['error'][_0x7064('0x16')]);}logger[_0x7064('0x14')](_0x7064('0x11'),_0x151d6f,_0x4f355a[_0x7064('0x14')][_0x7064('0x16')]);return _0x186b3c(_0x4f355a[_0x7064('0x14')][_0x7064('0x16')]);}else{logger['info']('VoiceExtension,\x20%s,\x20%s',_0x151d6f,'request\x20sent');_0x186b3c(_0x4f355a['result']['message']);}})['catch'](function(_0x4f99fb){logger[_0x7064('0x14')](_0x7064('0x11'),_0x151d6f,_0x4f99fb);_0x1e6355(_0x4f99fb);});});}exports[_0x7064('0x17')]=function(_0x845e0f){var _0x4f0ed7=this;return new Promise(function(_0x15d45c,_0x10019a){return db[_0x7064('0x18')]['findAll']({'raw':_0x845e0f[_0x7064('0x19')]?_0x845e0f[_0x7064('0x19')][_0x7064('0x1a')]===undefined?!![]:![]:!![],'where':_0x845e0f['options']?_0x845e0f[_0x7064('0x19')]['where']||null:null,'attributes':_0x845e0f[_0x7064('0x19')]?_0x845e0f[_0x7064('0x19')][_0x7064('0x1b')]||null:null,'limit':_0x845e0f['options']?_0x845e0f['options'][_0x7064('0x1c')]||null:null,'include':_0x845e0f['options']?_0x845e0f[_0x7064('0x19')][_0x7064('0x1d')]?_[_0x7064('0x1e')](_0x845e0f[_0x7064('0x19')][_0x7064('0x1d')],function(_0x798c9){return{'model':db[_0x798c9[_0x7064('0x1f')]],'as':_0x798c9['as'],'attributes':_0x798c9['attributes'],'include':_0x798c9[_0x7064('0x1d')]?_[_0x7064('0x1e')](_0x798c9[_0x7064('0x1d')],function(_0x10e02e){return{'model':db[_0x10e02e[_0x7064('0x1f')]],'as':_0x10e02e['as'],'attributes':_0x10e02e[_0x7064('0x1b')],'include':_0x10e02e[_0x7064('0x1d')]?_[_0x7064('0x1e')](_0x10e02e['include'],function(_0x10adc7){return{'model':db[_0x10adc7['model']],'as':_0x10adc7['as'],'attributes':_0x10adc7[_0x7064('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1662ab){logger[_0x7064('0x10')](_0x7064('0x17'),_0x845e0f);logger[_0x7064('0x12')](_0x7064('0x17'),_0x845e0f,JSON[_0x7064('0x20')](_0x1662ab));_0x15d45c(_0x1662ab);})[_0x7064('0x21')](function(_0x3d9ece){logger[_0x7064('0x14')](_0x7064('0x17'),_0x3d9ece['message'],_0x845e0f);_0x10019a(_0x4f0ed7[_0x7064('0x14')](0x1f4,_0x3d9ece[_0x7064('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 0e7c28d..6fe790a 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 _0x9d52=['voiceExtension:','./voiceExtension.events','save','remove','emit','removeListener','register'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x9d52,0x1e4));var _0x29d5=function(_0x4953da,_0x5adaca){_0x4953da=_0x4953da-0x0;var _0x2d3780=_0x9d52[_0x4953da];return _0x2d3780;};'use strict';var VoiceExtensionEvents=require(_0x29d5('0x0'));var events=[_0x29d5('0x1'),_0x29d5('0x2'),'update'];function createListener(_0x32032d,_0x4619aa){return function(_0x5c1e1a){_0x4619aa[_0x29d5('0x3')](_0x32032d,_0x5c1e1a);};}function removeListener(_0x4e1ce9,_0x356c02){return function(){VoiceExtensionEvents[_0x29d5('0x4')](_0x4e1ce9,_0x356c02);};}exports[_0x29d5('0x5')]=function(_0xf3f79f){for(var _0x111f2d=0x0,_0x5c74cc=events['length'];_0x111f2d<_0x5c74cc;_0x111f2d++){var _0x1d2bd2=events[_0x111f2d];var _0x2c321d=createListener(_0x29d5('0x6')+_0x1d2bd2,_0xf3f79f);VoiceExtensionEvents['on'](_0x1d2bd2,_0x2c321d);}}; \ No newline at end of file +var _0xc2f1=['emit','length','voiceExtension:','./voiceExtension.events','save','remove'];(function(_0x1d75dc,_0x333bdd){var _0x8375ad=function(_0x571550){while(--_0x571550){_0x1d75dc['push'](_0x1d75dc['shift']());}};_0x8375ad(++_0x333bdd);}(_0xc2f1,0x99));var _0x1c2f=function(_0x5f412c,_0x35ae66){_0x5f412c=_0x5f412c-0x0;var _0x236248=_0xc2f1[_0x5f412c];return _0x236248;};'use strict';var VoiceExtensionEvents=require(_0x1c2f('0x0'));var events=[_0x1c2f('0x1'),_0x1c2f('0x2'),'update'];function createListener(_0x4c3f7b,_0x339b66){return function(_0x25ec73){_0x339b66[_0x1c2f('0x3')](_0x4c3f7b,_0x25ec73);};}function removeListener(_0x4f403b,_0x2442c6){return function(){VoiceExtensionEvents['removeListener'](_0x4f403b,_0x2442c6);};}exports['register']=function(_0x3d7d59){for(var _0x595daf=0x0,_0x1991f8=events[_0x1c2f('0x4')];_0x595daf<_0x1991f8;_0x595daf++){var _0x1426c4=events[_0x595daf];var _0xd108fd=createListener(_0x1c2f('0x5')+_0x1426c4,_0x3d7d59);VoiceExtensionEvents['on'](_0x1426c4,_0xd108fd);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index ee1846c..3dc5e3d 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 _0xb18e=['show','/:id/messages','getMessages','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x2a69c0,_0x22feae){var _0x42d208=function(_0xed9264){while(--_0xed9264){_0x2a69c0['push'](_0x2a69c0['shift']());}};_0x42d208(++_0x22feae);}(_0xb18e,0x199));var _0xeb18=function(_0x329664,_0x130748){_0x329664=_0x329664-0x0;var _0x4e346e=_0xb18e[_0x329664];return _0x4e346e;};'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 auth=require(_0xeb18('0x4'));var interaction=require(_0xeb18('0x5'));var config=require(_0xeb18('0x6'));var controller=require('./voiceMail.controller');router[_0xeb18('0x7')]('/',auth[_0xeb18('0x8')](),controller[_0xeb18('0x9')]);router[_0xeb18('0x7')](_0xeb18('0xa'),auth[_0xeb18('0x8')](),controller[_0xeb18('0xb')]);router['get'](_0xeb18('0xc'),auth[_0xeb18('0x8')](),controller[_0xeb18('0xd')]);router[_0xeb18('0xe')]('/',auth[_0xeb18('0x8')](),controller[_0xeb18('0xf')]);router[_0xeb18('0x10')](_0xeb18('0xa'),auth['isAuthenticated'](),controller[_0xeb18('0x11')]);router[_0xeb18('0x12')](_0xeb18('0xa'),auth[_0xeb18('0x8')](),controller[_0xeb18('0x13')]);module[_0xeb18('0x14')]=router; \ No newline at end of file +var _0x5bc9=['index','show','getMessages','create','put','/:id','destroy','multer','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated'];(function(_0x49d1dd,_0x9fcdc4){var _0xef5662=function(_0x3163a0){while(--_0x3163a0){_0x49d1dd['push'](_0x49d1dd['shift']());}};_0xef5662(++_0x9fcdc4);}(_0x5bc9,0x77));var _0x95bc=function(_0x57357b,_0x45f1a7){_0x57357b=_0x57357b-0x0;var _0x170100=_0x5bc9[_0x57357b];return _0x170100;};'use strict';var multer=require(_0x95bc('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x95bc('0x1'));var router=express[_0x95bc('0x2')]();var auth=require(_0x95bc('0x3'));var interaction=require(_0x95bc('0x4'));var config=require(_0x95bc('0x5'));var controller=require(_0x95bc('0x6'));router[_0x95bc('0x7')]('/',auth[_0x95bc('0x8')](),controller[_0x95bc('0x9')]);router[_0x95bc('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x95bc('0xa')]);router[_0x95bc('0x7')]('/:id/messages',auth['isAuthenticated'](),controller[_0x95bc('0xb')]);router['post']('/',auth[_0x95bc('0x8')](),controller[_0x95bc('0xc')]);router[_0x95bc('0xd')](_0x95bc('0xe'),auth[_0x95bc('0x8')](),controller['update']);router['delete'](_0x95bc('0xe'),auth['isAuthenticated'](),controller[_0x95bc('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 6b7e0e0..c0d924d 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 _0x34b7=['TIMESTAMP','INTEGER','getDataValue','fullname','\x20-\x20','mailbox','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','yes','ENUM','TINYINT(4)'];(function(_0x4c5ae2,_0xcfb7c5){var _0x562717=function(_0x26a4af){while(--_0x26a4af){_0x4c5ae2['push'](_0x4c5ae2['shift']());}};_0x562717(++_0xcfb7c5);}(_0x34b7,0x196));var _0x734b=function(_0xf9e76,_0x2e6b9a){_0xf9e76=_0xf9e76-0x0;var _0x119a9b=_0x34b7[_0xf9e76];return _0x119a9b;};'use strict';var Sequelize=require('sequelize');module['exports']={'customer_id':{'type':Sequelize[_0x734b('0x0')]},'context':{'type':Sequelize[_0x734b('0x0')],'defaultValue':_0x734b('0x1'),'unique':_0x734b('0x2')},'mailbox':{'type':Sequelize[_0x734b('0x0')],'defaultValue':'','allowNull':![],'unique':_0x734b('0x2')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x734b('0x0')],'validate':{'isEmail':!![]},'set':function(_0x2fde69){this[_0x734b('0x3')](_0x734b('0x4'),typeof _0x2fde69===_0x734b('0x5')&&_0x2fde69[_0x734b('0x6')]()?_0x2fde69['trim']():null);}},'pager':{'type':Sequelize[_0x734b('0x0')]},'tz':{'type':Sequelize[_0x734b('0x0')],'defaultValue':'central'},'attach':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x734b('0x7'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0x734b('0x7'),'no'),'defaultValue':_0x734b('0x7'),'allowNull':![]},'dialout':{'type':Sequelize[_0x734b('0x0')]},'callback':{'type':Sequelize[_0x734b('0x0')]},'review':{'type':Sequelize[_0x734b('0x8')](_0x734b('0x7'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x734b('0x8')](_0x734b('0x7'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x734b('0x8')](_0x734b('0x7'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x734b('0x8')](_0x734b('0x7'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x734b('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x734b('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x734b('0x8')](_0x734b('0x7'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x734b('0x8')](_0x734b('0x7'),'no'),'defaultValue':_0x734b('0x7'),'allowNull':![]},'forcename':{'type':Sequelize[_0x734b('0x8')](_0x734b('0x7'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x734b('0x8')](_0x734b('0x7'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x734b('0x8')](_0x734b('0x7'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x734b('0xa')},'emailsubject':{'type':Sequelize[_0x734b('0x0')]},'emailbody':{'type':Sequelize[_0x734b('0x0')]},'maxsecs':{'type':Sequelize[_0x734b('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x734b('0xc')](_0x734b('0xd'))+_0x734b('0xe')+this[_0x734b('0xc')](_0x734b('0xf'));}}}; \ No newline at end of file +var _0x0abf=['ENUM','TINYINT(4)','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','STRING','setDataValue','email','string','trim','central','yes'];(function(_0x51e366,_0x245c51){var _0x32849c=function(_0x5bbbf0){while(--_0x5bbbf0){_0x51e366['push'](_0x51e366['shift']());}};_0x32849c(++_0x245c51);}(_0x0abf,0xe8));var _0xf0ab=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x0abf[_0x6c993a];return _0x27f547;};'use strict';var Sequelize=require(_0xf0ab('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0xf0ab('0x1')]},'context':{'type':Sequelize[_0xf0ab('0x1')],'defaultValue':'from-voicemail','unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0xf0ab('0x1')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0xf0ab('0x1')]},'fullname':{'type':Sequelize[_0xf0ab('0x1')]},'email':{'type':Sequelize[_0xf0ab('0x1')],'validate':{'isEmail':!![]},'set':function(_0xbb1f91){this[_0xf0ab('0x2')](_0xf0ab('0x3'),typeof _0xbb1f91===_0xf0ab('0x4')&&_0xbb1f91['trim']()?_0xbb1f91[_0xf0ab('0x5')]():null);}},'pager':{'type':Sequelize[_0xf0ab('0x1')]},'tz':{'type':Sequelize[_0xf0ab('0x1')],'defaultValue':_0xf0ab('0x6')},'attach':{'type':Sequelize['ENUM'](_0xf0ab('0x7'),'no'),'defaultValue':_0xf0ab('0x7'),'allowNull':![]},'saycid':{'type':Sequelize[_0xf0ab('0x8')]('yes','no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0xf0ab('0x1')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0xf0ab('0x8')](_0xf0ab('0x7'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xf0ab('0x8')](_0xf0ab('0x7'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xf0ab('0x8')](_0xf0ab('0x7'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xf0ab('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xf0ab('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xf0ab('0x8')](_0xf0ab('0x7'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xf0ab('0x8')](_0xf0ab('0x7'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xf0ab('0x8')](_0xf0ab('0x7'),'no'),'defaultValue':_0xf0ab('0x7'),'allowNull':![]},'forcename':{'type':Sequelize[_0xf0ab('0x8')](_0xf0ab('0x7'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xf0ab('0x8')](_0xf0ab('0x7'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xf0ab('0x8')](_0xf0ab('0x7'),'no'),'defaultValue':_0xf0ab('0x7'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0xf0ab('0x1')]},'emailbody':{'type':Sequelize[_0xf0ab('0x1')]},'maxsecs':{'type':Sequelize[_0xf0ab('0xa')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xf0ab('0xa')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xf0ab('0xb')],'get':function(){return this[_0xf0ab('0xc')](_0xf0ab('0xd'))+_0xf0ab('0xe')+this[_0xf0ab('0xc')](_0xf0ab('0xf'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index bc19aed..e453807 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 _0x0748=['fieldName','key','map','keys','query','intersection','model','attributes','fields','order','sort','filters','pick','filter','merge','where','type','options','VoiceMail','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','user','UserProfileSection','find','userProfileId','autoAssociation','getMessages','findOne','VoiceMailMessage','nolimit','mailbox','findAndCountAll','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','json','count','offset','limit','Content-Range','apply','save','update','then','destroy','get','Voicemails','UserProfileResource','sendStatus','error','stack','name','send','index'];(function(_0x2b17c9,_0x4f9625){var _0x46007d=function(_0x385d4e){while(--_0x385d4e){_0x2b17c9['push'](_0x2b17c9['shift']());}};_0x46007d(++_0x4f9625);}(_0x0748,0xce));var _0x8074=function(_0x3d4876,_0x366386){_0x3d4876=_0x3d4876-0x0;var _0x58ca9d=_0x0748[_0x3d4876];return _0x58ca9d;};'use strict';var pdf=require(_0x8074('0x0'));var emlformat=require(_0x8074('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8074('0x2'));var rp=require(_0x8074('0x3'));var moment=require(_0x8074('0x4'));var BPromise=require(_0x8074('0x5'));var Mustache=require(_0x8074('0x6'));var util=require('util');var path=require(_0x8074('0x7'));var sox=require('sox');var csv=require(_0x8074('0x8'));var ejs=require(_0x8074('0x9'));var fs=require('fs');var _=require(_0x8074('0xa'));var squel=require(_0x8074('0xb'));var crypto=require('crypto');var jsforce=require(_0x8074('0xc'));var deskjs=require(_0x8074('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8074('0xe'));var Redis=require(_0x8074('0xf'));var authService=require(_0x8074('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8074('0x11'));var hardwareService=require(_0x8074('0x12'));var logger=require(_0x8074('0x13'))(_0x8074('0x14'));var utils=require('../../config/utils');var config=require(_0x8074('0x15'));var db=require(_0x8074('0x16'))['db'];function respondWithStatusCode(_0x4454d0,_0x49ab3b){_0x49ab3b=_0x49ab3b||0xcc;return function(_0x5b8f27){if(_0x5b8f27){return _0x4454d0['sendStatus'](_0x49ab3b);}return _0x4454d0[_0x8074('0x17')](_0x49ab3b)['end']();};}function respondWithResult(_0x1168f0,_0x5258d2){_0x5258d2=_0x5258d2||0xc8;return function(_0x24ec6d){if(_0x24ec6d){return _0x1168f0[_0x8074('0x17')](_0x5258d2)[_0x8074('0x18')](_0x24ec6d);}};}function respondWithFilteredResult(_0x761e21,_0x46c8be){return function(_0x4f3cc1){if(_0x4f3cc1){var _0x2b1e76=_0x4f3cc1[_0x8074('0x19')],_0x457e66=_0x46c8be[_0x8074('0x1a')],_0x170e41=_0x46c8be[_0x8074('0x1a')]+_0x46c8be[_0x8074('0x1b')],_0x45c45b;if(_0x170e41>=_0x2b1e76){_0x170e41=_0x2b1e76;_0x45c45b=0xc8;}else{_0x45c45b=0xce;}_0x761e21[_0x8074('0x17')](_0x45c45b);return _0x761e21['set'](_0x8074('0x1c'),_0x457e66+'-'+_0x170e41+'/'+_0x2b1e76)[_0x8074('0x18')](_0x4f3cc1);}return null;};}function patchUpdates(_0x5eaf1d){return function(_0x2420e9){try{jsonpatch[_0x8074('0x1d')](_0x2420e9,_0x5eaf1d,!![]);}catch(_0x4b838f){return BPromise['reject'](_0x4b838f);}return _0x2420e9[_0x8074('0x1e')]();};}function saveUpdates(_0x2a08e5,_0x1a8f3b){return function(_0x1ead2a){if(_0x1ead2a){return _0x1ead2a[_0x8074('0x1f')](_0x2a08e5)[_0x8074('0x20')](function(_0x26f97d){return _0x26f97d;});}return null;};}function removeEntity(_0x319041,_0x4e713b){return function(_0x41d722){if(_0x41d722){return _0x41d722[_0x8074('0x21')]()[_0x8074('0x20')](function(){var _0x24abcb=_0x41d722[_0x8074('0x22')]({'plain':!![]});var _0x252fe9=_0x8074('0x23');return db[_0x8074('0x24')][_0x8074('0x21')]({'where':{'type':_0x252fe9,'resourceId':_0x24abcb['id']}})['then'](function(){return _0x41d722;});})[_0x8074('0x20')](function(){_0x319041['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x459c90,_0x80a1f9){return function(_0x2dadb6){if(!_0x2dadb6){_0x459c90[_0x8074('0x25')](0x194);}return _0x2dadb6;};}function handleError(_0x56a395,_0x57ac9f){_0x57ac9f=_0x57ac9f||0x1f4;return function(_0x3354a2){logger[_0x8074('0x26')](_0x3354a2[_0x8074('0x27')]);if(_0x3354a2[_0x8074('0x28')]){delete _0x3354a2[_0x8074('0x28')];}_0x56a395[_0x8074('0x17')](_0x57ac9f)[_0x8074('0x29')](_0x3354a2);};}exports[_0x8074('0x2a')]=function(_0x5848a3,_0x3200c6){var _0x4b99be={},_0x2af335={},_0x40677e={'count':0x0,'rows':[]};var _0x4ddd3c=_['map'](db['VoiceMail']['rawAttributes'],function(_0xb169be){return{'name':_0xb169be[_0x8074('0x2b')],'type':_0xb169be['type'][_0x8074('0x2c')]};});_0x2af335['model']=_[_0x8074('0x2d')](_0x4ddd3c,_0x8074('0x28'));_0x2af335['query']=_[_0x8074('0x2e')](_0x5848a3[_0x8074('0x2f')]);_0x2af335['filters']=_[_0x8074('0x30')](_0x2af335[_0x8074('0x31')],_0x2af335[_0x8074('0x2f')]);_0x4b99be[_0x8074('0x32')]=_['intersection'](_0x2af335[_0x8074('0x31')],qs[_0x8074('0x33')](_0x5848a3['query'][_0x8074('0x33')]));_0x4b99be[_0x8074('0x32')]=_0x4b99be[_0x8074('0x32')]['length']?_0x4b99be['attributes']:_0x2af335['model'];if(!_0x5848a3['query']['hasOwnProperty']('nolimit')){_0x4b99be[_0x8074('0x1b')]=qs[_0x8074('0x1b')](_0x5848a3[_0x8074('0x2f')][_0x8074('0x1b')]);_0x4b99be['offset']=qs[_0x8074('0x1a')](_0x5848a3[_0x8074('0x2f')]['offset']);}_0x4b99be[_0x8074('0x34')]=qs[_0x8074('0x35')](_0x5848a3[_0x8074('0x2f')]['sort']);_0x4b99be['where']=qs[_0x8074('0x36')](_[_0x8074('0x37')](_0x5848a3[_0x8074('0x2f')],_0x2af335[_0x8074('0x36')]));if(_0x5848a3[_0x8074('0x2f')][_0x8074('0x38')]){_0x4b99be['where']=_[_0x8074('0x39')](_0x4b99be[_0x8074('0x3a')],{'$or':_['map'](_0x4ddd3c,function(_0x1369fc){if(_0x1369fc[_0x8074('0x3b')]!=='VIRTUAL'){var _0x44b53f={};_0x44b53f[_0x1369fc[_0x8074('0x28')]]={'$like':'%'+_0x5848a3[_0x8074('0x2f')][_0x8074('0x38')]+'%'};return _0x44b53f;}})});}_0x4b99be=_[_0x8074('0x39')]({},_0x4b99be,_0x5848a3[_0x8074('0x3c')]);var _0x548ed={'where':_0x4b99be[_0x8074('0x3a')]};return db[_0x8074('0x3d')][_0x8074('0x19')](_0x548ed)[_0x8074('0x20')](function(_0x37e794){_0x40677e[_0x8074('0x19')]=_0x37e794;if(_0x5848a3[_0x8074('0x2f')][_0x8074('0x3e')]){_0x4b99be[_0x8074('0x3f')]=[{'all':!![]}];}return db[_0x8074('0x3d')][_0x8074('0x40')](_0x4b99be);})['then'](function(_0x512283){_0x40677e[_0x8074('0x41')]=_0x512283;return _0x40677e;})[_0x8074('0x20')](respondWithFilteredResult(_0x3200c6,_0x4b99be))[_0x8074('0x42')](handleError(_0x3200c6,null));};exports[_0x8074('0x43')]=function(_0x3f9ebb,_0x1015b3){var _0x2f34f3={'raw':!![],'where':{'id':_0x3f9ebb[_0x8074('0x44')]['id']}},_0x1010be={};_0x1010be[_0x8074('0x31')]=_[_0x8074('0x2e')](db['VoiceMail'][_0x8074('0x45')]);_0x1010be[_0x8074('0x2f')]=_[_0x8074('0x2e')](_0x3f9ebb[_0x8074('0x2f')]);_0x1010be[_0x8074('0x36')]=_[_0x8074('0x30')](_0x1010be['model'],_0x1010be[_0x8074('0x2f')]);_0x2f34f3['attributes']=_['intersection'](_0x1010be[_0x8074('0x31')],qs[_0x8074('0x33')](_0x3f9ebb[_0x8074('0x2f')]['fields']));_0x2f34f3['attributes']=_0x2f34f3[_0x8074('0x32')]['length']?_0x2f34f3[_0x8074('0x32')]:_0x1010be['model'];if(_0x3f9ebb[_0x8074('0x2f')]['includeAll']){_0x2f34f3[_0x8074('0x3f')]=[{'all':!![]}];}_0x2f34f3=_['merge']({},_0x2f34f3,_0x3f9ebb['options']);return db[_0x8074('0x3d')]['find'](_0x2f34f3)[_0x8074('0x20')](handleEntityNotFound(_0x1015b3,null))['then'](respondWithResult(_0x1015b3,null))[_0x8074('0x42')](handleError(_0x1015b3,null));};exports['create']=function(_0x4c3fe6,_0x3f57be){return db[_0x8074('0x3d')][_0x8074('0x46')](_0x4c3fe6[_0x8074('0x47')],{})[_0x8074('0x20')](function(_0x3d3b69){var _0x3c2186=_0x4c3fe6[_0x8074('0x48')]['get']({'plain':!![]});if(!_0x3c2186)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3c2186['role']===_0x8074('0x48')){var _0x30bef7=_0x3d3b69[_0x8074('0x22')]({'plain':!![]});var _0x55588a=_0x8074('0x23');return db[_0x8074('0x49')][_0x8074('0x4a')]({'where':{'name':_0x55588a,'userProfileId':_0x3c2186[_0x8074('0x4b')]},'raw':!![]})[_0x8074('0x20')](function(_0xeb0973){if(_0xeb0973&&_0xeb0973[_0x8074('0x4c')]===0x0){return db['UserProfileResource']['create']({'name':_0x30bef7[_0x8074('0x28')],'resourceId':_0x30bef7['id'],'type':_0xeb0973[_0x8074('0x28')],'sectionId':_0xeb0973['id']},{})['then'](function(){return _0x3d3b69;});}else{return _0x3d3b69;}})['catch'](function(_0xfc8d57){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xfc8d57);throw _0xfc8d57;});}return _0x3d3b69;})['then'](respondWithResult(_0x3f57be,0xc9))['catch'](handleError(_0x3f57be,null));};exports[_0x8074('0x1f')]=function(_0x47c16c,_0x4f0904){if(_0x47c16c['body']['id']){delete _0x47c16c['body']['id'];}return db[_0x8074('0x3d')][_0x8074('0x4a')]({'where':{'id':_0x47c16c[_0x8074('0x44')]['id']}})[_0x8074('0x20')](handleEntityNotFound(_0x4f0904,null))[_0x8074('0x20')](saveUpdates(_0x47c16c[_0x8074('0x47')],null))[_0x8074('0x20')](respondWithResult(_0x4f0904,null))[_0x8074('0x42')](handleError(_0x4f0904,null));};exports[_0x8074('0x21')]=function(_0x518347,_0x2accbe){return db[_0x8074('0x3d')][_0x8074('0x4a')]({'where':{'id':_0x518347[_0x8074('0x44')]['id']}})[_0x8074('0x20')](handleEntityNotFound(_0x2accbe,null))['then'](removeEntity(_0x2accbe,null))['catch'](handleError(_0x2accbe,null));};exports[_0x8074('0x4d')]=function(_0x1fb1f0,_0x84ecfe,_0x215162){return db[_0x8074('0x3d')][_0x8074('0x4e')]({'where':{'id':_0x1fb1f0[_0x8074('0x44')]['id']}})['then'](handleEntityNotFound(_0x84ecfe,null))[_0x8074('0x20')](function(_0x369d8d){var _0x5b3203;var _0x245148={},_0x15b27e={};_0x15b27e[_0x8074('0x31')]=_[_0x8074('0x2e')](db[_0x8074('0x4f')][_0x8074('0x45')]);_0x15b27e[_0x8074('0x2f')]=_[_0x8074('0x2e')](_0x1fb1f0[_0x8074('0x2f')]);_0x15b27e[_0x8074('0x36')]=_[_0x8074('0x30')](_0x15b27e[_0x8074('0x31')],_0x15b27e[_0x8074('0x2f')]);_0x245148['attributes']=_[_0x8074('0x30')](_0x15b27e[_0x8074('0x31')],qs[_0x8074('0x33')](_0x1fb1f0[_0x8074('0x2f')][_0x8074('0x33')]));_0x245148[_0x8074('0x32')]=_0x245148[_0x8074('0x32')]['length']?_0x245148[_0x8074('0x32')]:_0x15b27e['model'];if(!_0x1fb1f0[_0x8074('0x2f')]['hasOwnProperty'](_0x8074('0x50'))){_0x245148[_0x8074('0x1b')]=qs[_0x8074('0x1b')](_0x1fb1f0[_0x8074('0x2f')]['limit']);_0x245148[_0x8074('0x1a')]=qs[_0x8074('0x1a')](_0x1fb1f0[_0x8074('0x2f')][_0x8074('0x1a')]);}_0x245148[_0x8074('0x34')]=qs[_0x8074('0x35')](_0x1fb1f0[_0x8074('0x2f')][_0x8074('0x35')]);_0x245148['where']=qs['filters'](_[_0x8074('0x37')](_0x1fb1f0[_0x8074('0x2f')],_0x15b27e[_0x8074('0x36')]));if(_0x1fb1f0[_0x8074('0x2f')][_0x8074('0x38')]){_0x245148[_0x8074('0x3a')]=_[_0x8074('0x39')](_0x245148[_0x8074('0x3a')],{'$or':_[_0x8074('0x2d')](_0x245148[_0x8074('0x32')],function(_0x3ba99b){var _0x22793d={};_0x22793d[_0x3ba99b]={'$like':'%'+_0x1fb1f0[_0x8074('0x2f')][_0x8074('0x38')]+'%'};return _0x22793d;})});}_0x245148[_0x8074('0x3a')]=_[_0x8074('0x39')](_0x245148[_0x8074('0x3a')],{'mailboxuser':_0x369d8d[_0x8074('0x51')]});_0x245148=_[_0x8074('0x39')]({},_0x245148,_0x1fb1f0['options']);return db[_0x8074('0x4f')][_0x8074('0x52')](_0x245148)[_0x8074('0x20')](respondWithFilteredResult(_0x84ecfe,_0x245148));})[_0x8074('0x42')](handleError(_0x84ecfe,null));}; \ No newline at end of file +var _0x889c=['then','get','Voicemails','UserProfileResource','destroy','error','stack','name','index','map','VoiceMail','fieldName','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','pick','filters','filter','where','merge','VIRTUAL','options','findAll','rows','catch','show','params','rawAttributes','length','includeAll','include','find','user','role','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','VoiceMailMessage','order','mailbox','findAndCountAll','html-pdf','rimraf','moment','mustache','util','path','sox','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','reject','save','update'];(function(_0x5e4cae,_0x232c74){var _0x364835=function(_0x2e8e59){while(--_0x2e8e59){_0x5e4cae['push'](_0x5e4cae['shift']());}};_0x364835(++_0x232c74);}(_0x889c,0xd2));var _0xc889=function(_0x2b2bb0,_0x31c452){_0x2b2bb0=_0x2b2bb0-0x0;var _0x5823ad=_0x889c[_0x2b2bb0];return _0x5823ad;};'use strict';var pdf=require(_0xc889('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc889('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc889('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xc889('0x3'));var util=require(_0xc889('0x4'));var path=require(_0xc889('0x5'));var sox=require(_0xc889('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xc889('0x7'));var jsforce=require(_0xc889('0x8'));var deskjs=require(_0xc889('0x9'));var toCsv=require(_0xc889('0xa'));var querystring=require('querystring');var Papa=require(_0xc889('0xb'));var Redis=require('ioredis');var authService=require(_0xc889('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0xc889('0xd'));var hardwareService=require(_0xc889('0xe'));var logger=require(_0xc889('0xf'))(_0xc889('0x10'));var utils=require(_0xc889('0x11'));var config=require(_0xc889('0x12'));var db=require(_0xc889('0x13'))['db'];function respondWithStatusCode(_0x1943d3,_0x20b5a7){_0x20b5a7=_0x20b5a7||0xcc;return function(_0x12dfc5){if(_0x12dfc5){return _0x1943d3[_0xc889('0x14')](_0x20b5a7);}return _0x1943d3[_0xc889('0x15')](_0x20b5a7)['end']();};}function respondWithResult(_0xd44a13,_0x5cbeda){_0x5cbeda=_0x5cbeda||0xc8;return function(_0x541e9b){if(_0x541e9b){return _0xd44a13[_0xc889('0x15')](_0x5cbeda)[_0xc889('0x16')](_0x541e9b);}};}function respondWithFilteredResult(_0xcf1ff3,_0x2bdefb){return function(_0x1c1d43){if(_0x1c1d43){var _0x756f8e=_0x1c1d43[_0xc889('0x17')],_0x2d0dd0=_0x2bdefb[_0xc889('0x18')],_0x36fe22=_0x2bdefb['offset']+_0x2bdefb[_0xc889('0x19')],_0x3c96f3;if(_0x36fe22>=_0x756f8e){_0x36fe22=_0x756f8e;_0x3c96f3=0xc8;}else{_0x3c96f3=0xce;}_0xcf1ff3[_0xc889('0x15')](_0x3c96f3);return _0xcf1ff3['set'](_0xc889('0x1a'),_0x2d0dd0+'-'+_0x36fe22+'/'+_0x756f8e)[_0xc889('0x16')](_0x1c1d43);}return null;};}function patchUpdates(_0x486c61){return function(_0x2ddb64){try{jsonpatch['apply'](_0x2ddb64,_0x486c61,!![]);}catch(_0xb21765){return BPromise[_0xc889('0x1b')](_0xb21765);}return _0x2ddb64[_0xc889('0x1c')]();};}function saveUpdates(_0x1f7653,_0x120c67){return function(_0x34fd3d){if(_0x34fd3d){return _0x34fd3d[_0xc889('0x1d')](_0x1f7653)['then'](function(_0x22527c){return _0x22527c;});}return null;};}function removeEntity(_0x594bb0,_0x4b1f3e){return function(_0x2b4d03){if(_0x2b4d03){return _0x2b4d03['destroy']()[_0xc889('0x1e')](function(){var _0x449379=_0x2b4d03[_0xc889('0x1f')]({'plain':!![]});var _0x27fb70=_0xc889('0x20');return db[_0xc889('0x21')][_0xc889('0x22')]({'where':{'type':_0x27fb70,'resourceId':_0x449379['id']}})[_0xc889('0x1e')](function(){return _0x2b4d03;});})['then'](function(){_0x594bb0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x450bb9,_0x58f1b4){return function(_0x34ecce){if(!_0x34ecce){_0x450bb9[_0xc889('0x14')](0x194);}return _0x34ecce;};}function handleError(_0x49e0d1,_0x10a0d0){_0x10a0d0=_0x10a0d0||0x1f4;return function(_0x278572){logger[_0xc889('0x23')](_0x278572[_0xc889('0x24')]);if(_0x278572[_0xc889('0x25')]){delete _0x278572[_0xc889('0x25')];}_0x49e0d1[_0xc889('0x15')](_0x10a0d0)['send'](_0x278572);};}exports[_0xc889('0x26')]=function(_0x5b741e,_0x2c36f0){var _0x306b31={},_0x4a829c={},_0x55f4cb={'count':0x0,'rows':[]};var _0xb2e1b7=_[_0xc889('0x27')](db[_0xc889('0x28')]['rawAttributes'],function(_0x4f7134){return{'name':_0x4f7134[_0xc889('0x29')],'type':_0x4f7134[_0xc889('0x2a')][_0xc889('0x2b')]};});_0x4a829c['model']=_[_0xc889('0x27')](_0xb2e1b7,_0xc889('0x25'));_0x4a829c[_0xc889('0x2c')]=_[_0xc889('0x2d')](_0x5b741e[_0xc889('0x2c')]);_0x4a829c['filters']=_[_0xc889('0x2e')](_0x4a829c[_0xc889('0x2f')],_0x4a829c['query']);_0x306b31[_0xc889('0x30')]=_[_0xc889('0x2e')](_0x4a829c[_0xc889('0x2f')],qs['fields'](_0x5b741e[_0xc889('0x2c')][_0xc889('0x31')]));_0x306b31['attributes']=_0x306b31[_0xc889('0x30')]['length']?_0x306b31[_0xc889('0x30')]:_0x4a829c['model'];if(!_0x5b741e[_0xc889('0x2c')][_0xc889('0x32')](_0xc889('0x33'))){_0x306b31[_0xc889('0x19')]=qs['limit'](_0x5b741e[_0xc889('0x2c')][_0xc889('0x19')]);_0x306b31['offset']=qs['offset'](_0x5b741e[_0xc889('0x2c')][_0xc889('0x18')]);}_0x306b31['order']=qs[_0xc889('0x34')](_0x5b741e[_0xc889('0x2c')][_0xc889('0x34')]);_0x306b31['where']=qs['filters'](_[_0xc889('0x35')](_0x5b741e[_0xc889('0x2c')],_0x4a829c[_0xc889('0x36')]));if(_0x5b741e['query'][_0xc889('0x37')]){_0x306b31[_0xc889('0x38')]=_[_0xc889('0x39')](_0x306b31[_0xc889('0x38')],{'$or':_['map'](_0xb2e1b7,function(_0x5d95cb){if(_0x5d95cb[_0xc889('0x2a')]!==_0xc889('0x3a')){var _0x4a70af={};_0x4a70af[_0x5d95cb[_0xc889('0x25')]]={'$like':'%'+_0x5b741e[_0xc889('0x2c')][_0xc889('0x37')]+'%'};return _0x4a70af;}})});}_0x306b31=_[_0xc889('0x39')]({},_0x306b31,_0x5b741e[_0xc889('0x3b')]);var _0x6b4f65={'where':_0x306b31['where']};return db[_0xc889('0x28')]['count'](_0x6b4f65)[_0xc889('0x1e')](function(_0x22c267){_0x55f4cb['count']=_0x22c267;if(_0x5b741e[_0xc889('0x2c')]['includeAll']){_0x306b31['include']=[{'all':!![]}];}return db[_0xc889('0x28')][_0xc889('0x3c')](_0x306b31);})['then'](function(_0x20b471){_0x55f4cb[_0xc889('0x3d')]=_0x20b471;return _0x55f4cb;})[_0xc889('0x1e')](respondWithFilteredResult(_0x2c36f0,_0x306b31))[_0xc889('0x3e')](handleError(_0x2c36f0,null));};exports[_0xc889('0x3f')]=function(_0x4e2d31,_0x5335e1){var _0x17344a={'raw':!![],'where':{'id':_0x4e2d31[_0xc889('0x40')]['id']}},_0x5ef57c={};_0x5ef57c['model']=_[_0xc889('0x2d')](db[_0xc889('0x28')][_0xc889('0x41')]);_0x5ef57c[_0xc889('0x2c')]=_[_0xc889('0x2d')](_0x4e2d31[_0xc889('0x2c')]);_0x5ef57c[_0xc889('0x36')]=_['intersection'](_0x5ef57c[_0xc889('0x2f')],_0x5ef57c[_0xc889('0x2c')]);_0x17344a[_0xc889('0x30')]=_[_0xc889('0x2e')](_0x5ef57c[_0xc889('0x2f')],qs[_0xc889('0x31')](_0x4e2d31[_0xc889('0x2c')][_0xc889('0x31')]));_0x17344a[_0xc889('0x30')]=_0x17344a['attributes'][_0xc889('0x42')]?_0x17344a[_0xc889('0x30')]:_0x5ef57c[_0xc889('0x2f')];if(_0x4e2d31['query'][_0xc889('0x43')]){_0x17344a[_0xc889('0x44')]=[{'all':!![]}];}_0x17344a=_[_0xc889('0x39')]({},_0x17344a,_0x4e2d31[_0xc889('0x3b')]);return db[_0xc889('0x28')][_0xc889('0x45')](_0x17344a)[_0xc889('0x1e')](handleEntityNotFound(_0x5335e1,null))['then'](respondWithResult(_0x5335e1,null))[_0xc889('0x3e')](handleError(_0x5335e1,null));};exports['create']=function(_0x1eab9d,_0x145dea){return db['VoiceMail']['create'](_0x1eab9d['body'],{})[_0xc889('0x1e')](function(_0x4b45bf){var _0x14db7e=_0x1eab9d[_0xc889('0x46')][_0xc889('0x1f')]({'plain':!![]});if(!_0x14db7e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x14db7e[_0xc889('0x47')]==='user'){var _0x1a5e9b=_0x4b45bf[_0xc889('0x1f')]({'plain':!![]});var _0x2dacd1=_0xc889('0x20');return db[_0xc889('0x48')]['find']({'where':{'name':_0x2dacd1,'userProfileId':_0x14db7e['userProfileId']},'raw':!![]})[_0xc889('0x1e')](function(_0x183a9b){if(_0x183a9b&&_0x183a9b['autoAssociation']===0x0){return db[_0xc889('0x21')][_0xc889('0x49')]({'name':_0x1a5e9b['name'],'resourceId':_0x1a5e9b['id'],'type':_0x183a9b[_0xc889('0x25')],'sectionId':_0x183a9b['id']},{})[_0xc889('0x1e')](function(){return _0x4b45bf;});}else{return _0x4b45bf;}})[_0xc889('0x3e')](function(_0x49034c){logger[_0xc889('0x23')](_0xc889('0x4a'),_0x49034c);throw _0x49034c;});}return _0x4b45bf;})[_0xc889('0x1e')](respondWithResult(_0x145dea,0xc9))[_0xc889('0x3e')](handleError(_0x145dea,null));};exports[_0xc889('0x1d')]=function(_0x17c4a2,_0x2c133d){if(_0x17c4a2[_0xc889('0x4b')]['id']){delete _0x17c4a2['body']['id'];}return db[_0xc889('0x28')]['find']({'where':{'id':_0x17c4a2[_0xc889('0x40')]['id']}})[_0xc889('0x1e')](handleEntityNotFound(_0x2c133d,null))['then'](saveUpdates(_0x17c4a2['body'],null))['then'](respondWithResult(_0x2c133d,null))['catch'](handleError(_0x2c133d,null));};exports[_0xc889('0x22')]=function(_0x22a7ce,_0x3a4b70){return db[_0xc889('0x28')]['find']({'where':{'id':_0x22a7ce[_0xc889('0x40')]['id']}})['then'](handleEntityNotFound(_0x3a4b70,null))['then'](removeEntity(_0x3a4b70,null))[_0xc889('0x3e')](handleError(_0x3a4b70,null));};exports['getMessages']=function(_0x4e2d58,_0x5d860d,_0x4f6090){return db['VoiceMail']['findOne']({'where':{'id':_0x4e2d58[_0xc889('0x40')]['id']}})['then'](handleEntityNotFound(_0x5d860d,null))[_0xc889('0x1e')](function(_0x48699f){var _0x206395;var _0x5d04df={},_0x357a2f={};_0x357a2f['model']=_[_0xc889('0x2d')](db[_0xc889('0x4c')][_0xc889('0x41')]);_0x357a2f[_0xc889('0x2c')]=_[_0xc889('0x2d')](_0x4e2d58[_0xc889('0x2c')]);_0x357a2f['filters']=_[_0xc889('0x2e')](_0x357a2f['model'],_0x357a2f[_0xc889('0x2c')]);_0x5d04df['attributes']=_[_0xc889('0x2e')](_0x357a2f[_0xc889('0x2f')],qs[_0xc889('0x31')](_0x4e2d58[_0xc889('0x2c')]['fields']));_0x5d04df[_0xc889('0x30')]=_0x5d04df['attributes'][_0xc889('0x42')]?_0x5d04df[_0xc889('0x30')]:_0x357a2f['model'];if(!_0x4e2d58[_0xc889('0x2c')][_0xc889('0x32')]('nolimit')){_0x5d04df['limit']=qs[_0xc889('0x19')](_0x4e2d58[_0xc889('0x2c')][_0xc889('0x19')]);_0x5d04df[_0xc889('0x18')]=qs[_0xc889('0x18')](_0x4e2d58[_0xc889('0x2c')]['offset']);}_0x5d04df[_0xc889('0x4d')]=qs['sort'](_0x4e2d58[_0xc889('0x2c')][_0xc889('0x34')]);_0x5d04df[_0xc889('0x38')]=qs[_0xc889('0x36')](_[_0xc889('0x35')](_0x4e2d58[_0xc889('0x2c')],_0x357a2f[_0xc889('0x36')]));if(_0x4e2d58[_0xc889('0x2c')][_0xc889('0x37')]){_0x5d04df[_0xc889('0x38')]=_[_0xc889('0x39')](_0x5d04df['where'],{'$or':_[_0xc889('0x27')](_0x5d04df[_0xc889('0x30')],function(_0x1e59fc){var _0x210ae1={};_0x210ae1[_0x1e59fc]={'$like':'%'+_0x4e2d58[_0xc889('0x2c')]['filter']+'%'};return _0x210ae1;})});}_0x5d04df[_0xc889('0x38')]=_['merge'](_0x5d04df[_0xc889('0x38')],{'mailboxuser':_0x48699f[_0xc889('0x4e')]});_0x5d04df=_[_0xc889('0x39')]({},_0x5d04df,_0x4e2d58[_0xc889('0x3b')]);return db[_0xc889('0x4c')][_0xc889('0x4f')](_0x5d04df)[_0xc889('0x1e')](respondWithFilteredResult(_0x5d860d,_0x5d04df));})[_0xc889('0x3e')](handleError(_0x5d860d,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index e60642b..f9b85a1 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 _0x1fcd=['../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','mailbox_context','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3acbd7,_0x3c2815){var _0x4241ec=function(_0x4eca75){while(--_0x4eca75){_0x3acbd7['push'](_0x3acbd7['shift']());}};_0x4241ec(++_0x3c2815);}(_0x1fcd,0x19e));var _0xd1fc=function(_0xc67528,_0x24e2fb){_0xc67528=_0xc67528-0x0;var _0x38e26d=_0x1fcd[_0xc67528];return _0x38e26d;};'use strict';var _=require('lodash');var util=require(_0xd1fc('0x0'));var logger=require(_0xd1fc('0x1'))(_0xd1fc('0x2'));var moment=require(_0xd1fc('0x3'));var BPromise=require(_0xd1fc('0x4'));var rp=require(_0xd1fc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd1fc('0x6'));var attributes=require(_0xd1fc('0x7'));module[_0xd1fc('0x8')]=function(_0x2e4af4,_0x2433b3){return _0x2e4af4[_0xd1fc('0x9')](_0xd1fc('0xa'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0xd1fc('0xb'),'fields':['mailbox','context']}],'timestamps':!![]});}; \ No newline at end of file +var _0x9931=['define','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','exports'];(function(_0x5c1e7f,_0x48c06d){var _0x263ee7=function(_0x40a1b1){while(--_0x40a1b1){_0x5c1e7f['push'](_0x5c1e7f['shift']());}};_0x263ee7(++_0x48c06d);}(_0x9931,0x1b6));var _0x1993=function(_0x3c510f,_0x55ea25){_0x3c510f=_0x3c510f-0x0;var _0x11f260=_0x9931[_0x3c510f];return _0x11f260;};'use strict';var _=require('lodash');var util=require(_0x1993('0x0'));var logger=require('../../config/logger')(_0x1993('0x1'));var moment=require(_0x1993('0x2'));var BPromise=require(_0x1993('0x3'));var rp=require(_0x1993('0x4'));var fs=require('fs');var path=require(_0x1993('0x5'));var rimraf=require(_0x1993('0x6'));var config=require(_0x1993('0x7'));var attributes=require(_0x1993('0x8'));module[_0x1993('0x9')]=function(_0x708836,_0x2a518e){return _0x708836[_0x1993('0xa')](_0x1993('0xb'),attributes,{'tableName':_0x1993('0xc'),'paranoid':![],'indexes':[{'name':_0x1993('0xd'),'fields':[_0x1993('0xe'),_0x1993('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 7ccccad..fcc8a5b 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 _0x4d3d=['message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','request','info','VoiceMail,\x20%s,\x20%s','request\x20sent','VoiceMail,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x5773d4,_0x280ba5){var _0x4d2c01=function(_0x3d2f23){while(--_0x3d2f23){_0x5773d4['push'](_0x5773d4['shift']());}};_0x4d2c01(++_0x280ba5);}(_0x4d3d,0x146));var _0xd4d3=function(_0x46728b,_0x376bc6){_0x46728b=_0x46728b-0x0;var _0x5aa8e2=_0x4d3d[_0x46728b];return _0x5aa8e2;};'use strict';var _=require(_0xd4d3('0x0'));var util=require(_0xd4d3('0x1'));var moment=require(_0xd4d3('0x2'));var BPromise=require(_0xd4d3('0x3'));var rs=require(_0xd4d3('0x4'));var fs=require('fs');var Redis=require(_0xd4d3('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd4d3('0x6'))('rpc');var config=require(_0xd4d3('0x7'));var jayson=require(_0xd4d3('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x6eaaa7,_0x489325,_0x12289d){return new BPromise(function(_0x88d46c,_0x3439ba){return client[_0xd4d3('0x9')](_0x6eaaa7,_0x12289d)['then'](function(_0x5190c7){logger[_0xd4d3('0xa')](_0xd4d3('0xb'),_0x489325,_0xd4d3('0xc'));logger['debug'](_0xd4d3('0xd'),_0x489325,_0xd4d3('0xc'),JSON['stringify'](_0x5190c7));if(_0x5190c7[_0xd4d3('0xe')]){if(_0x5190c7[_0xd4d3('0xe')][_0xd4d3('0xf')]===0x1f4){logger[_0xd4d3('0xe')](_0xd4d3('0xb'),_0x489325,_0x5190c7[_0xd4d3('0xe')][_0xd4d3('0x10')]);return _0x3439ba(_0x5190c7[_0xd4d3('0xe')][_0xd4d3('0x10')]);}logger[_0xd4d3('0xe')]('VoiceMail,\x20%s,\x20%s',_0x489325,_0x5190c7[_0xd4d3('0xe')][_0xd4d3('0x10')]);return _0x88d46c(_0x5190c7['error'][_0xd4d3('0x10')]);}else{logger[_0xd4d3('0xa')](_0xd4d3('0xb'),_0x489325,'request\x20sent');_0x88d46c(_0x5190c7['result']['message']);}})[_0xd4d3('0x11')](function(_0x1ad8cf){logger[_0xd4d3('0xe')]('VoiceMail,\x20%s,\x20%s',_0x489325,_0x1ad8cf);_0x3439ba(_0x1ad8cf);});});} \ No newline at end of file +var _0x7356=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','catch','lodash','util','bluebird'];(function(_0x4665b8,_0x234a28){var _0x54ba4c=function(_0x38064a){while(--_0x38064a){_0x4665b8['push'](_0x4665b8['shift']());}};_0x54ba4c(++_0x234a28);}(_0x7356,0xe4));var _0x6735=function(_0x2e70ff,_0xd14f1e){_0x2e70ff=_0x2e70ff-0x0;var _0x81718d=_0x7356[_0x2e70ff];return _0x81718d;};'use strict';var _=require(_0x6735('0x0'));var util=require(_0x6735('0x1'));var moment=require('moment');var BPromise=require(_0x6735('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6735('0x3'));var db=require(_0x6735('0x4'))['db'];var utils=require(_0x6735('0x5'));var logger=require(_0x6735('0x6'))(_0x6735('0x7'));var config=require(_0x6735('0x8'));var jayson=require(_0x6735('0x9'));var client=jayson['client'][_0x6735('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3edb46,_0x56fc37,_0x1b2784){return new BPromise(function(_0x170709,_0x4247a0){return client[_0x6735('0xb')](_0x3edb46,_0x1b2784)[_0x6735('0xc')](function(_0x5c4871){logger[_0x6735('0xd')](_0x6735('0xe'),_0x56fc37,_0x6735('0xf'));logger['debug']('VoiceMail,\x20%s,\x20%s,\x20%s',_0x56fc37,'request\x20sent',JSON[_0x6735('0x10')](_0x5c4871));if(_0x5c4871['error']){if(_0x5c4871['error'][_0x6735('0x11')]===0x1f4){logger[_0x6735('0x12')](_0x6735('0xe'),_0x56fc37,_0x5c4871['error']['message']);return _0x4247a0(_0x5c4871[_0x6735('0x12')][_0x6735('0x13')]);}logger['error'](_0x6735('0xe'),_0x56fc37,_0x5c4871[_0x6735('0x12')][_0x6735('0x13')]);return _0x170709(_0x5c4871[_0x6735('0x12')][_0x6735('0x13')]);}else{logger[_0x6735('0xd')]('VoiceMail,\x20%s,\x20%s',_0x56fc37,_0x6735('0xf'));_0x170709(_0x5c4871['result']['message']);}})[_0x6735('0x14')](function(_0x2b400b){logger[_0x6735('0x12')](_0x6735('0xe'),_0x56fc37,_0x2b400b);_0x4247a0(_0x2b400b);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index a3b54ea..cff7351 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 _0x7a54=['show','/:id/download','create','/:id','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated'];(function(_0x3d3adf,_0x4c66c8){var _0x26aa15=function(_0xb70509){while(--_0xb70509){_0x3d3adf['push'](_0x3d3adf['shift']());}};_0x26aa15(++_0x4c66c8);}(_0x7a54,0x106));var _0x47a5=function(_0x34705e,_0x1c31c5){_0x34705e=_0x34705e-0x0;var _0x48f908=_0x7a54[_0x34705e];return _0x48f908;};'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 auth=require('../../components/auth/service');var interaction=require(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var controller=require(_0x47a5('0x7'));router[_0x47a5('0x8')]('/',auth[_0x47a5('0x9')](),controller['index']);router[_0x47a5('0x8')]('/:id',auth[_0x47a5('0x9')](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0x47a5('0x9')](),controller[_0x47a5('0xc')]);router['put'](_0x47a5('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x47a5('0xe')](_0x47a5('0xd'),auth[_0x47a5('0x9')](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file +var _0x53ec=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./voiceMailMessage.controller','get','index','/:id','isAuthenticated','/:id/download','download','post','create','put','delete'];(function(_0x328973,_0x28fb70){var _0x2d5974=function(_0x523b94){while(--_0x523b94){_0x328973['push'](_0x328973['shift']());}};_0x2d5974(++_0x28fb70);}(_0x53ec,0x192));var _0xc53e=function(_0x4217e5,_0x4b69e6){_0x4217e5=_0x4217e5-0x0;var _0xb02bc5=_0x53ec[_0x4217e5];return _0xb02bc5;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xc53e('0x6'));var config=require('../../config/environment');var controller=require(_0xc53e('0x7'));router[_0xc53e('0x8')]('/',auth['isAuthenticated'](),controller[_0xc53e('0x9')]);router['get'](_0xc53e('0xa'),auth[_0xc53e('0xb')](),controller['show']);router[_0xc53e('0x8')](_0xc53e('0xc'),auth[_0xc53e('0xb')](),controller[_0xc53e('0xd')]);router[_0xc53e('0xe')]('/',auth[_0xc53e('0xb')](),controller[_0xc53e('0xf')]);router[_0xc53e('0x10')](_0xc53e('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xc53e('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xc53e('0x12')]);module[_0xc53e('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index b561919..57719bf 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 _0xda58=['STRING','long','sequelize','exports','VIRTUAL','getDataValue','INTEGER'];(function(_0x25b7fd,_0x479a63){var _0x1c712e=function(_0x31cc60){while(--_0x31cc60){_0x25b7fd['push'](_0x25b7fd['shift']());}};_0x1c712e(++_0x479a63);}(_0xda58,0x87));var _0x8da5=function(_0x50c0e4,_0x30ea5c){_0x50c0e4=_0x50c0e4-0x0;var _0x463edf=_0xda58[_0x50c0e4];return _0x463edf;};'use strict';var Sequelize=require(_0x8da5('0x0'));module[_0x8da5('0x1')]={'name':{'type':Sequelize[_0x8da5('0x2')],'get':function(_0x438d1e){return this[_0x8da5('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x8da5('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x8da5('0x5')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x8da5('0x5')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0x8da5('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0x8da5('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x8da5('0x5')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x8da5('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0x8da5('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x8da5('0x5')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','allowNull':![]}}; \ No newline at end of file +var _0xcdb7=['getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP','sequelize','exports','VIRTUAL'];(function(_0x4aaebe,_0x19f82c){var _0x37c690=function(_0x22e1d8){while(--_0x22e1d8){_0x4aaebe['push'](_0x4aaebe['shift']());}};_0x37c690(++_0x19f82c);}(_0xcdb7,0x12f));var _0x7cdb=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xcdb7[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0x7cdb('0x0'));module[_0x7cdb('0x1')]={'name':{'type':Sequelize[_0x7cdb('0x2')],'get':function(_0x260350){return this[_0x7cdb('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x7cdb('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0x7cdb('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x7cdb('0x5')],'defaultValue':''},'callerid':{'type':Sequelize[_0x7cdb('0x5')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0x7cdb('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x7cdb('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x7cdb('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0x7cdb('0x6')](_0x7cdb('0x7')),'defaultValue':null},'flag':{'type':Sequelize[_0x7cdb('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x7cdb('0x5')],'defaultValue':''},'stamp':{'type':_0x7cdb('0x8'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 146d01c..67488a8 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 _0x5089=['../../config/logger','api','../../config/environment','sendStatus','status','end','count','offset','set','Content-Range','json','reject','update','then','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','type','model','differenceBy','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','show','keys','length','includeAll','catch','create','body','find','params','destroy','download','recording','msg_id','Sequelize','VoiceMailMessage\x20not\x20found','attachment','attachment;\x20filename=\x22','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x43a8d6,_0x354988){var _0x5b300d=function(_0x2734c8){while(--_0x2734c8){_0x43a8d6['push'](_0x43a8d6['shift']());}};_0x5b300d(++_0x354988);}(_0x5089,0x1bb));var _0x9508=function(_0xcf4569,_0x1ce755){_0xcf4569=_0xcf4569-0x0;var _0x7fef=_0x5089[_0xcf4569];return _0x7fef;};'use strict';var pdf=require(_0x9508('0x0'));var emlformat=require(_0x9508('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x9508('0x2'));var jsonpatch=require(_0x9508('0x3'));var rp=require(_0x9508('0x4'));var moment=require(_0x9508('0x5'));var BPromise=require(_0x9508('0x6'));var Mustache=require('mustache');var util=require(_0x9508('0x7'));var path=require('path');var sox=require(_0x9508('0x8'));var csv=require(_0x9508('0x9'));var ejs=require(_0x9508('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9508('0xb'));var crypto=require(_0x9508('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9508('0xd'));var toCsv=require(_0x9508('0x9'));var querystring=require('querystring');var Papa=require(_0x9508('0xe'));var Redis=require('ioredis');var authService=require(_0x9508('0xf'));var qs=require(_0x9508('0x10'));var as=require(_0x9508('0x11'));var hardwareService=require(_0x9508('0x12'));var logger=require(_0x9508('0x13'))(_0x9508('0x14'));var utils=require('../../config/utils');var config=require(_0x9508('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c4fd9,_0x396896){_0x396896=_0x396896||0xcc;return function(_0x554c90){if(_0x554c90){return _0x2c4fd9[_0x9508('0x16')](_0x396896);}return _0x2c4fd9[_0x9508('0x17')](_0x396896)[_0x9508('0x18')]();};}function respondWithResult(_0x4701de,_0x51ef92){_0x51ef92=_0x51ef92||0xc8;return function(_0x440709){if(_0x440709){return _0x4701de[_0x9508('0x17')](_0x51ef92)['json'](_0x440709);}};}function respondWithFilteredResult(_0x2a281d,_0x539746){return function(_0x25d4d6){if(_0x25d4d6){var _0x418889=_0x25d4d6[_0x9508('0x19')],_0x374c03=_0x539746[_0x9508('0x1a')],_0x255a03=_0x539746[_0x9508('0x1a')]+_0x539746['limit'],_0x127340;if(_0x255a03>=_0x418889){_0x255a03=_0x418889;_0x127340=0xc8;}else{_0x127340=0xce;}_0x2a281d[_0x9508('0x17')](_0x127340);return _0x2a281d[_0x9508('0x1b')](_0x9508('0x1c'),_0x374c03+'-'+_0x255a03+'/'+_0x418889)[_0x9508('0x1d')](_0x25d4d6);}return null;};}function patchUpdates(_0x23c30e){return function(_0x22a9fe){try{jsonpatch['apply'](_0x22a9fe,_0x23c30e,!![]);}catch(_0x4cbf6a){return BPromise[_0x9508('0x1e')](_0x4cbf6a);}return _0x22a9fe['save']();};}function saveUpdates(_0x2272e2,_0x4e9e9f){return function(_0x3ba927){if(_0x3ba927){return _0x3ba927[_0x9508('0x1f')](_0x2272e2)[_0x9508('0x20')](function(_0x1dfc6c){return _0x1dfc6c;});}return null;};}function removeEntity(_0x1edf1b,_0x2f8106){return function(_0x20eb53){if(_0x20eb53){return _0x20eb53['destroy']()['then'](function(){_0x1edf1b[_0x9508('0x17')](0xcc)[_0x9508('0x18')]();});}};}function handleEntityNotFound(_0x39e6b0,_0xf70830){return function(_0x16c54f){if(!_0x16c54f){_0x39e6b0[_0x9508('0x16')](0x194);}return _0x16c54f;};}function handleError(_0x4b68e9,_0x5e9a80){_0x5e9a80=_0x5e9a80||0x1f4;return function(_0x46d23f){logger['error'](_0x46d23f['stack']);if(_0x46d23f[_0x9508('0x21')]){delete _0x46d23f['name'];}_0x4b68e9['status'](_0x5e9a80)[_0x9508('0x22')](_0x46d23f);};}exports[_0x9508('0x23')]=function(_0x57c7ae,_0x49246b){var _0x32b0dd={},_0x22b2e2={},_0x4529a8={'count':0x0,'rows':[]};var _0x1f7755=_[_0x9508('0x24')](db[_0x9508('0x25')][_0x9508('0x26')],function(_0x414534){return{'name':_0x414534[_0x9508('0x27')],'type':_0x414534[_0x9508('0x28')]['key']};});_0x22b2e2[_0x9508('0x29')]=_[_0x9508('0x2a')](_[_0x9508('0x24')](_0x1f7755,'name'),[_0x9508('0x21')]);_0x22b2e2[_0x9508('0x2b')]=_['keys'](_0x57c7ae[_0x9508('0x2b')]);_0x22b2e2[_0x9508('0x2c')]=_['intersection'](_0x22b2e2[_0x9508('0x29')],_0x22b2e2[_0x9508('0x2b')]);_0x32b0dd[_0x9508('0x2d')]=_[_0x9508('0x2e')](_0x22b2e2['model'],qs['fields'](_0x57c7ae[_0x9508('0x2b')][_0x9508('0x2f')]));_0x32b0dd[_0x9508('0x2d')]=_0x32b0dd['attributes']['length']?_0x32b0dd[_0x9508('0x2d')]:_0x22b2e2[_0x9508('0x29')];if(!_0x57c7ae[_0x9508('0x2b')][_0x9508('0x30')](_0x9508('0x31'))){_0x32b0dd[_0x9508('0x32')]=qs[_0x9508('0x32')](_0x57c7ae[_0x9508('0x2b')][_0x9508('0x32')]);_0x32b0dd[_0x9508('0x1a')]=qs['offset'](_0x57c7ae[_0x9508('0x2b')][_0x9508('0x1a')]);}_0x32b0dd['order']=qs[_0x9508('0x33')](_0x57c7ae[_0x9508('0x2b')][_0x9508('0x33')]);_0x32b0dd[_0x9508('0x34')]=qs[_0x9508('0x2c')](_[_0x9508('0x35')](_0x57c7ae[_0x9508('0x2b')],_0x22b2e2[_0x9508('0x2c')]));if(_0x57c7ae[_0x9508('0x2b')][_0x9508('0x36')]){_0x32b0dd[_0x9508('0x34')]=_['merge'](_0x32b0dd[_0x9508('0x34')],{'$or':_['map'](_0x1f7755,function(_0x1390a7){if(_0x1390a7[_0x9508('0x28')]!==_0x9508('0x37')){var _0x5644b6={};_0x5644b6[_0x1390a7['name']]={'$like':'%'+_0x57c7ae[_0x9508('0x2b')][_0x9508('0x36')]+'%'};return _0x5644b6;}})});}_0x32b0dd=_[_0x9508('0x38')]({},_0x32b0dd,_0x57c7ae[_0x9508('0x39')]);var _0x4eb600={'where':_0x32b0dd[_0x9508('0x34')]};return db['VoiceMailMessage'][_0x9508('0x19')](_0x4eb600)[_0x9508('0x20')](function(_0x5205f8){_0x4529a8[_0x9508('0x19')]=_0x5205f8;if(_0x57c7ae[_0x9508('0x2b')]['includeAll']){_0x32b0dd[_0x9508('0x3a')]=[{'all':!![]}];}return db[_0x9508('0x25')][_0x9508('0x3b')](_0x32b0dd);})[_0x9508('0x20')](function(_0x4e2561){_0x4529a8['rows']=_0x4e2561;return _0x4529a8;})[_0x9508('0x20')](respondWithFilteredResult(_0x49246b,_0x32b0dd))['catch'](handleError(_0x49246b,null));};exports[_0x9508('0x3c')]=function(_0x22c135,_0x10e8f5){var _0x4215e9={'raw':!![],'where':{'id':_0x22c135['params']['id']}},_0x4a4556={};_0x4a4556['model']=_[_0x9508('0x3d')](db['VoiceMailMessage'][_0x9508('0x26')]);_0x4a4556['query']=_[_0x9508('0x3d')](_0x22c135[_0x9508('0x2b')]);_0x4a4556[_0x9508('0x2c')]=_[_0x9508('0x2e')](_0x4a4556['model'],_0x4a4556[_0x9508('0x2b')]);_0x4215e9[_0x9508('0x2d')]=_[_0x9508('0x2e')](_0x4a4556['model'],qs[_0x9508('0x2f')](_0x22c135[_0x9508('0x2b')]['fields']));_0x4215e9[_0x9508('0x2d')]=_0x4215e9['attributes'][_0x9508('0x3e')]?_0x4215e9['attributes']:_0x4a4556['model'];if(_0x22c135[_0x9508('0x2b')][_0x9508('0x3f')]){_0x4215e9[_0x9508('0x3a')]=[{'all':!![]}];}_0x4215e9=_[_0x9508('0x38')]({},_0x4215e9,_0x22c135[_0x9508('0x39')]);return db[_0x9508('0x25')]['find'](_0x4215e9)[_0x9508('0x20')](handleEntityNotFound(_0x10e8f5,null))[_0x9508('0x20')](respondWithResult(_0x10e8f5,null))[_0x9508('0x40')](handleError(_0x10e8f5,null));};exports['create']=function(_0x2ee9e,_0xe81056){return db[_0x9508('0x25')][_0x9508('0x41')](_0x2ee9e['body'],{})[_0x9508('0x20')](respondWithResult(_0xe81056,0xc9))['catch'](handleError(_0xe81056,null));};exports[_0x9508('0x1f')]=function(_0xef021a,_0x52f88f){if(_0xef021a[_0x9508('0x42')]['id']){delete _0xef021a[_0x9508('0x42')]['id'];}return db['VoiceMailMessage'][_0x9508('0x43')]({'where':{'id':_0xef021a[_0x9508('0x44')]['id']}})['then'](handleEntityNotFound(_0x52f88f,null))[_0x9508('0x20')](saveUpdates(_0xef021a['body'],null))[_0x9508('0x20')](respondWithResult(_0x52f88f,null))['catch'](handleError(_0x52f88f,null));};exports[_0x9508('0x45')]=function(_0x55a023,_0x49ac4f){return db['VoiceMailMessage']['find']({'where':{'id':_0x55a023[_0x9508('0x44')]['id']}})[_0x9508('0x20')](handleEntityNotFound(_0x49ac4f,null))[_0x9508('0x20')](removeEntity(_0x49ac4f,null))[_0x9508('0x40')](handleError(_0x49ac4f,null));};exports[_0x9508('0x46')]=function(_0x4542a2,_0x2b9854,_0x1e58c2){return db[_0x9508('0x25')]['find']({'where':{'id':_0x4542a2[_0x9508('0x44')]['id']},'attributes':['id',_0x9508('0x47'),_0x9508('0x48')]})[_0x9508('0x20')](handleEntityNotFound(_0x2b9854,null))[_0x9508('0x20')](function(_0x539f5c){if(_0x539f5c){if(!_0x539f5c['recording']){throw new db[(_0x9508('0x49'))]['ValidationError'](_0x9508('0x4a'));}var _0x3049ba={'Content-Type':'audio/wav','Content-Disposition':_0x9508('0x4b')};if(_0x539f5c['msg_id']){_0x3049ba['Content-Disposition']=_0x9508('0x4c')+_0x539f5c[_0x9508('0x48')]+'.wav\x22';}_0x2b9854[_0x9508('0x1b')](_0x3049ba);return _0x2b9854[_0x9508('0x22')](new Buffer(_0x539f5c[_0x9508('0x47')]));}})[_0x9508('0x40')](handleError(_0x2b9854,null));}; \ No newline at end of file +var _0x5178=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','update','then','destroy','error','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','length','nolimit','sort','where','merge','VIRTUAL','filter','options','findAll','rows','catch','show','params','fields','includeAll','include','find','body','recording','msg_id','Sequelize','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','to-csv','ioredis','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5178,0x171));var _0x8517=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x5178[_0x1facfa];return _0x9ec701;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8517('0x0'));var rimraf=require(_0x8517('0x1'));var zipdir=require(_0x8517('0x2'));var jsonpatch=require(_0x8517('0x3'));var rp=require(_0x8517('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8517('0x5'));var util=require(_0x8517('0x6'));var path=require('path');var sox=require(_0x8517('0x7'));var csv=require('to-csv');var ejs=require(_0x8517('0x8'));var fs=require('fs');var _=require(_0x8517('0x9'));var squel=require(_0x8517('0xa'));var crypto=require(_0x8517('0xb'));var jsforce=require(_0x8517('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8517('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8517('0xe'));var authService=require(_0x8517('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x8517('0x10'));var hardwareService=require(_0x8517('0x11'));var logger=require(_0x8517('0x12'))(_0x8517('0x13'));var utils=require(_0x8517('0x14'));var config=require(_0x8517('0x15'));var db=require(_0x8517('0x16'))['db'];function respondWithStatusCode(_0x12388f,_0x4b9768){_0x4b9768=_0x4b9768||0xcc;return function(_0x9c57de){if(_0x9c57de){return _0x12388f[_0x8517('0x17')](_0x4b9768);}return _0x12388f[_0x8517('0x18')](_0x4b9768)[_0x8517('0x19')]();};}function respondWithResult(_0x284a05,_0x49eba7){_0x49eba7=_0x49eba7||0xc8;return function(_0x385219){if(_0x385219){return _0x284a05[_0x8517('0x18')](_0x49eba7)[_0x8517('0x1a')](_0x385219);}};}function respondWithFilteredResult(_0x100280,_0x411d29){return function(_0x18a984){if(_0x18a984){var _0x260a15=_0x18a984[_0x8517('0x1b')],_0x30cea1=_0x411d29[_0x8517('0x1c')],_0x504a92=_0x411d29['offset']+_0x411d29[_0x8517('0x1d')],_0x2953dd;if(_0x504a92>=_0x260a15){_0x504a92=_0x260a15;_0x2953dd=0xc8;}else{_0x2953dd=0xce;}_0x100280[_0x8517('0x18')](_0x2953dd);return _0x100280[_0x8517('0x1e')](_0x8517('0x1f'),_0x30cea1+'-'+_0x504a92+'/'+_0x260a15)[_0x8517('0x1a')](_0x18a984);}return null;};}function patchUpdates(_0x24ca7e){return function(_0x1bfbc1){try{jsonpatch['apply'](_0x1bfbc1,_0x24ca7e,!![]);}catch(_0xd37bf1){return BPromise['reject'](_0xd37bf1);}return _0x1bfbc1['save']();};}function saveUpdates(_0x23f7d2,_0x157bea){return function(_0xf35d95){if(_0xf35d95){return _0xf35d95[_0x8517('0x20')](_0x23f7d2)[_0x8517('0x21')](function(_0xdfde16){return _0xdfde16;});}return null;};}function removeEntity(_0x512458,_0x4b145f){return function(_0x2dd1df){if(_0x2dd1df){return _0x2dd1df[_0x8517('0x22')]()[_0x8517('0x21')](function(){_0x512458[_0x8517('0x18')](0xcc)[_0x8517('0x19')]();});}};}function handleEntityNotFound(_0x2e6e47,_0x5f02ee){return function(_0x181500){if(!_0x181500){_0x2e6e47[_0x8517('0x17')](0x194);}return _0x181500;};}function handleError(_0x5578f0,_0x7f4cf8){_0x7f4cf8=_0x7f4cf8||0x1f4;return function(_0x2febd5){logger[_0x8517('0x23')](_0x2febd5['stack']);if(_0x2febd5[_0x8517('0x24')]){delete _0x2febd5['name'];}_0x5578f0[_0x8517('0x18')](_0x7f4cf8)[_0x8517('0x25')](_0x2febd5);};}exports[_0x8517('0x26')]=function(_0x2b0c19,_0x238f2c){var _0x300e3f={},_0x481ceb={},_0x39764e={'count':0x0,'rows':[]};var _0x51d516=_[_0x8517('0x27')](db[_0x8517('0x28')][_0x8517('0x29')],function(_0x355aa6){return{'name':_0x355aa6[_0x8517('0x2a')],'type':_0x355aa6[_0x8517('0x2b')]['key']};});_0x481ceb[_0x8517('0x2c')]=_['differenceBy'](_[_0x8517('0x27')](_0x51d516,_0x8517('0x24')),[_0x8517('0x24')]);_0x481ceb[_0x8517('0x2d')]=_[_0x8517('0x2e')](_0x2b0c19[_0x8517('0x2d')]);_0x481ceb[_0x8517('0x2f')]=_[_0x8517('0x30')](_0x481ceb[_0x8517('0x2c')],_0x481ceb['query']);_0x300e3f[_0x8517('0x31')]=_[_0x8517('0x30')](_0x481ceb[_0x8517('0x2c')],qs['fields'](_0x2b0c19['query']['fields']));_0x300e3f[_0x8517('0x31')]=_0x300e3f[_0x8517('0x31')][_0x8517('0x32')]?_0x300e3f[_0x8517('0x31')]:_0x481ceb[_0x8517('0x2c')];if(!_0x2b0c19[_0x8517('0x2d')]['hasOwnProperty'](_0x8517('0x33'))){_0x300e3f[_0x8517('0x1d')]=qs[_0x8517('0x1d')](_0x2b0c19['query'][_0x8517('0x1d')]);_0x300e3f['offset']=qs[_0x8517('0x1c')](_0x2b0c19[_0x8517('0x2d')]['offset']);}_0x300e3f['order']=qs[_0x8517('0x34')](_0x2b0c19[_0x8517('0x2d')][_0x8517('0x34')]);_0x300e3f[_0x8517('0x35')]=qs['filters'](_['pick'](_0x2b0c19[_0x8517('0x2d')],_0x481ceb[_0x8517('0x2f')]));if(_0x2b0c19[_0x8517('0x2d')]['filter']){_0x300e3f[_0x8517('0x35')]=_[_0x8517('0x36')](_0x300e3f['where'],{'$or':_[_0x8517('0x27')](_0x51d516,function(_0x58c759){if(_0x58c759[_0x8517('0x2b')]!==_0x8517('0x37')){var _0x57ca29={};_0x57ca29[_0x58c759[_0x8517('0x24')]]={'$like':'%'+_0x2b0c19[_0x8517('0x2d')][_0x8517('0x38')]+'%'};return _0x57ca29;}})});}_0x300e3f=_[_0x8517('0x36')]({},_0x300e3f,_0x2b0c19[_0x8517('0x39')]);var _0x22592a={'where':_0x300e3f[_0x8517('0x35')]};return db[_0x8517('0x28')][_0x8517('0x1b')](_0x22592a)[_0x8517('0x21')](function(_0x475d71){_0x39764e[_0x8517('0x1b')]=_0x475d71;if(_0x2b0c19[_0x8517('0x2d')]['includeAll']){_0x300e3f['include']=[{'all':!![]}];}return db[_0x8517('0x28')][_0x8517('0x3a')](_0x300e3f);})[_0x8517('0x21')](function(_0x30942f){_0x39764e[_0x8517('0x3b')]=_0x30942f;return _0x39764e;})['then'](respondWithFilteredResult(_0x238f2c,_0x300e3f))[_0x8517('0x3c')](handleError(_0x238f2c,null));};exports[_0x8517('0x3d')]=function(_0x531ca7,_0x1472f3){var _0x34fd09={'raw':!![],'where':{'id':_0x531ca7[_0x8517('0x3e')]['id']}},_0x32fba6={};_0x32fba6['model']=_[_0x8517('0x2e')](db[_0x8517('0x28')]['rawAttributes']);_0x32fba6[_0x8517('0x2d')]=_[_0x8517('0x2e')](_0x531ca7[_0x8517('0x2d')]);_0x32fba6['filters']=_[_0x8517('0x30')](_0x32fba6[_0x8517('0x2c')],_0x32fba6[_0x8517('0x2d')]);_0x34fd09[_0x8517('0x31')]=_[_0x8517('0x30')](_0x32fba6[_0x8517('0x2c')],qs[_0x8517('0x3f')](_0x531ca7['query'][_0x8517('0x3f')]));_0x34fd09[_0x8517('0x31')]=_0x34fd09['attributes'][_0x8517('0x32')]?_0x34fd09[_0x8517('0x31')]:_0x32fba6[_0x8517('0x2c')];if(_0x531ca7[_0x8517('0x2d')][_0x8517('0x40')]){_0x34fd09[_0x8517('0x41')]=[{'all':!![]}];}_0x34fd09=_['merge']({},_0x34fd09,_0x531ca7[_0x8517('0x39')]);return db[_0x8517('0x28')][_0x8517('0x42')](_0x34fd09)['then'](handleEntityNotFound(_0x1472f3,null))[_0x8517('0x21')](respondWithResult(_0x1472f3,null))[_0x8517('0x3c')](handleError(_0x1472f3,null));};exports['create']=function(_0x10ed6a,_0x1d81c1){return db['VoiceMailMessage']['create'](_0x10ed6a['body'],{})[_0x8517('0x21')](respondWithResult(_0x1d81c1,0xc9))[_0x8517('0x3c')](handleError(_0x1d81c1,null));};exports['update']=function(_0x13a3a4,_0x5b0ea3){if(_0x13a3a4['body']['id']){delete _0x13a3a4[_0x8517('0x43')]['id'];}return db[_0x8517('0x28')][_0x8517('0x42')]({'where':{'id':_0x13a3a4[_0x8517('0x3e')]['id']}})['then'](handleEntityNotFound(_0x5b0ea3,null))[_0x8517('0x21')](saveUpdates(_0x13a3a4[_0x8517('0x43')],null))[_0x8517('0x21')](respondWithResult(_0x5b0ea3,null))['catch'](handleError(_0x5b0ea3,null));};exports[_0x8517('0x22')]=function(_0x8ef7a8,_0x2276ed){return db[_0x8517('0x28')][_0x8517('0x42')]({'where':{'id':_0x8ef7a8[_0x8517('0x3e')]['id']}})[_0x8517('0x21')](handleEntityNotFound(_0x2276ed,null))['then'](removeEntity(_0x2276ed,null))[_0x8517('0x3c')](handleError(_0x2276ed,null));};exports['download']=function(_0x5d3ff4,_0x2752b6,_0x776ee2){return db[_0x8517('0x28')][_0x8517('0x42')]({'where':{'id':_0x5d3ff4['params']['id']},'attributes':['id',_0x8517('0x44'),_0x8517('0x45')]})['then'](handleEntityNotFound(_0x2752b6,null))['then'](function(_0x3bdbb4){if(_0x3bdbb4){if(!_0x3bdbb4[_0x8517('0x44')]){throw new db[(_0x8517('0x46'))]['ValidationError'](_0x8517('0x47'));}var _0x5c7e2f={'Content-Type':_0x8517('0x48'),'Content-Disposition':_0x8517('0x49')};if(_0x3bdbb4[_0x8517('0x45')]){_0x5c7e2f[_0x8517('0x4a')]=_0x8517('0x4b')+_0x3bdbb4[_0x8517('0x45')]+_0x8517('0x4c');}_0x2752b6[_0x8517('0x1e')](_0x5c7e2f);return _0x2752b6[_0x8517('0x25')](new Buffer(_0x3bdbb4['recording']));}})['catch'](handleError(_0x2752b6,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 16f0bd6..d09a5bc 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 _0x9cc3=['util','api','moment','bluebird','path','rimraf','./voiceMailMessage.attributes','exports','VoiceMailMessage','voice_voicemail_messages','dir','lodash'];(function(_0x241ce6,_0x53d750){var _0x1d5d4c=function(_0x44ceb2){while(--_0x44ceb2){_0x241ce6['push'](_0x241ce6['shift']());}};_0x1d5d4c(++_0x53d750);}(_0x9cc3,0x77));var _0x39cc=function(_0x1cf747,_0x1f49be){_0x1cf747=_0x1cf747-0x0;var _0x2e8238=_0x9cc3[_0x1cf747];return _0x2e8238;};'use strict';var _=require(_0x39cc('0x0'));var util=require(_0x39cc('0x1'));var logger=require('../../config/logger')(_0x39cc('0x2'));var moment=require(_0x39cc('0x3'));var BPromise=require(_0x39cc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x39cc('0x5'));var rimraf=require(_0x39cc('0x6'));var config=require('../../config/environment');var attributes=require(_0x39cc('0x7'));module[_0x39cc('0x8')]=function(_0x5c013f,_0x40290b){return _0x5c013f['define'](_0x39cc('0x9'),attributes,{'tableName':_0x39cc('0xa'),'paranoid':![],'indexes':[{'name':_0x39cc('0xb'),'fields':[_0x39cc('0xb')]}],'timestamps':![]});}; \ No newline at end of file +var _0xab90=['../../config/logger','path','rimraf','../../config/environment','define','VoiceMailMessage','voice_voicemail_messages','dir','util'];(function(_0x5dac9d,_0x1aaa22){var _0x4199a4=function(_0x43f803){while(--_0x43f803){_0x5dac9d['push'](_0x5dac9d['shift']());}};_0x4199a4(++_0x1aaa22);}(_0xab90,0x1b8));var _0x0ab9=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xab90[_0x36c5b0];return _0xf19333;};'use strict';var _=require('lodash');var util=require(_0x0ab9('0x0'));var logger=require(_0x0ab9('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0ab9('0x2'));var rimraf=require(_0x0ab9('0x3'));var config=require(_0x0ab9('0x4'));var attributes=require('./voiceMailMessage.attributes');module['exports']=function(_0x4925b5,_0x1705f5){return _0x4925b5[_0x0ab9('0x5')](_0x0ab9('0x6'),attributes,{'tableName':_0x0ab9('0x7'),'paranoid':![],'indexes':[{'name':_0x0ab9('0x8'),'fields':[_0x0ab9('0x8')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index f936741..6f49f5b 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 _0x7a54=['info','VoiceMailMessage,\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(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a54,0x106));var _0x47a5=function(_0x3ceee4,_0xec5cb8){_0x3ceee4=_0x3ceee4-0x0;var _0x1c8506=_0x7a54[_0x3ceee4];return _0x1c8506;};'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')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x66fa=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','VoiceMailMessage,\x20%s,\x20%s','message','catch','lodash'];(function(_0x2a664f,_0x24a60c){var _0x5794d1=function(_0x5ddaf2){while(--_0x5ddaf2){_0x2a664f['push'](_0x2a664f['shift']());}};_0x5794d1(++_0x24a60c);}(_0x66fa,0x117));var _0xa66f=function(_0x20ade1,_0x4ccc9f){_0x20ade1=_0x20ade1-0x0;var _0x57555a=_0x66fa[_0x20ade1];return _0x57555a;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var moment=require('moment');var BPromise=require(_0xa66f('0x2'));var rs=require(_0xa66f('0x3'));var fs=require('fs');var Redis=require(_0xa66f('0x4'));var db=require(_0xa66f('0x5'))['db'];var utils=require(_0xa66f('0x6'));var logger=require(_0xa66f('0x7'))(_0xa66f('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa66f('0x9')][_0xa66f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f0b78,_0x1d02fc,_0x38b58b){return new BPromise(function(_0x5096bf,_0x39c1ef){return client['request'](_0x2f0b78,_0x38b58b)[_0xa66f('0xb')](function(_0x597c7c){logger[_0xa66f('0xc')]('VoiceMailMessage,\x20%s,\x20%s',_0x1d02fc,'request\x20sent');logger['debug'](_0xa66f('0xd'),_0x1d02fc,_0xa66f('0xe'),JSON['stringify'](_0x597c7c));if(_0x597c7c[_0xa66f('0xf')]){if(_0x597c7c['error'][_0xa66f('0x10')]===0x1f4){logger['error'](_0xa66f('0x11'),_0x1d02fc,_0x597c7c[_0xa66f('0xf')][_0xa66f('0x12')]);return _0x39c1ef(_0x597c7c['error']['message']);}logger[_0xa66f('0xf')]('VoiceMailMessage,\x20%s,\x20%s',_0x1d02fc,_0x597c7c['error']['message']);return _0x5096bf(_0x597c7c[_0xa66f('0xf')][_0xa66f('0x12')]);}else{logger[_0xa66f('0xc')](_0xa66f('0x11'),_0x1d02fc,_0xa66f('0xe'));_0x5096bf(_0x597c7c['result']['message']);}})[_0xa66f('0x13')](function(_0x32d338){logger[_0xa66f('0xf')](_0xa66f('0x11'),_0x1d02fc,_0x32d338);_0x39c1ef(_0x32d338);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 352c93d..facf840 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 _0x702e=['index','get','/:id','isAuthenticated','show','/:id/sounds','getSounds','post','update','delete','/:id/sounds/:id2','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4f6e2e,_0x27a727){var _0x15f72d=function(_0x38c767){while(--_0x38c767){_0x4f6e2e['push'](_0x4f6e2e['shift']());}};_0x15f72d(++_0x27a727);}(_0x702e,0x14c));var _0xe702=function(_0x147449,_0x13bd1d){_0x147449=_0x147449-0x0;var _0x5d502a=_0x702e[_0x147449];return _0x5d502a;};'use strict';var multer=require('multer');var util=require(_0xe702('0x0'));var path=require(_0xe702('0x1'));var timeout=require(_0xe702('0x2'));var express=require(_0xe702('0x3'));var router=express[_0xe702('0x4')]();var auth=require(_0xe702('0x5'));var interaction=require(_0xe702('0x6'));var config=require(_0xe702('0x7'));var controller=require('./voiceMusicOnHold.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xe702('0x8')]);router[_0xe702('0x9')](_0xe702('0xa'),auth[_0xe702('0xb')](),controller[_0xe702('0xc')]);router['get'](_0xe702('0xd'),auth[_0xe702('0xb')](),controller[_0xe702('0xe')]);router[_0xe702('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe702('0xf')](_0xe702('0xd'),auth[_0xe702('0xb')](),controller['addSound']);router['put'](_0xe702('0xa'),auth[_0xe702('0xb')](),controller[_0xe702('0x10')]);router[_0xe702('0x11')](_0xe702('0xa'),auth[_0xe702('0xb')](),controller['destroy']);router[_0xe702('0x11')](_0xe702('0x12'),auth['isAuthenticated'](),controller['removeSound']);module[_0xe702('0x13')]=router; \ No newline at end of file +var _0x0d63=['../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','index','get','/:id','isAuthenticated','show','post','create','/:id/sounds','update','delete','/:id/sounds/:id2','removeSound','exports','multer','util','path','connect-timeout','Router'];(function(_0x34f357,_0x4a7a1b){var _0x40a3c7=function(_0xfdc253){while(--_0xfdc253){_0x34f357['push'](_0x34f357['shift']());}};_0x40a3c7(++_0x4a7a1b);}(_0x0d63,0x1de));var _0x30d6=function(_0x4df7be,_0x174cea){_0x4df7be=_0x4df7be-0x0;var _0x3c15a4=_0x0d63[_0x4df7be];return _0x3c15a4;};'use strict';var multer=require(_0x30d6('0x0'));var util=require(_0x30d6('0x1'));var path=require(_0x30d6('0x2'));var timeout=require(_0x30d6('0x3'));var express=require('express');var router=express[_0x30d6('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x30d6('0x5'));var config=require(_0x30d6('0x6'));var controller=require(_0x30d6('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x30d6('0x8')]);router[_0x30d6('0x9')](_0x30d6('0xa'),auth[_0x30d6('0xb')](),controller[_0x30d6('0xc')]);router[_0x30d6('0x9')]('/:id/sounds',auth[_0x30d6('0xb')](),controller['getSounds']);router[_0x30d6('0xd')]('/',auth[_0x30d6('0xb')](),controller[_0x30d6('0xe')]);router[_0x30d6('0xd')](_0x30d6('0xf'),auth[_0x30d6('0xb')](),controller['addSound']);router['put']('/:id',auth[_0x30d6('0xb')](),controller[_0x30d6('0x10')]);router[_0x30d6('0x11')](_0x30d6('0xa'),auth[_0x30d6('0xb')](),controller['destroy']);router[_0x30d6('0x11')](_0x30d6('0x12'),auth[_0x30d6('0xb')](),controller[_0x30d6('0x13')]);module[_0x30d6('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index a30030e..9097e06 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 _0x122a=['mp3nb','quietmp3nb','quietmp3','mp3','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','STRING','name','custom','files'];(function(_0x106f9b,_0x138d1d){var _0x238269=function(_0x5ce79e){while(--_0x5ce79e){_0x106f9b['push'](_0x106f9b['shift']());}};_0x238269(++_0x138d1d);}(_0x122a,0x180));var _0xa122=function(_0x3243b3,_0x4c16f8){_0x3243b3=_0x3243b3-0x0;var _0x1fede6=_0x122a[_0x3243b3];return _0x1fede6;};'use strict';var Sequelize=require(_0xa122('0x0'));module[_0xa122('0x1')]={'name':{'type':Sequelize[_0xa122('0x2')],'allowNull':![],'unique':_0xa122('0x3')},'mode':{'type':Sequelize['ENUM'](_0xa122('0x4'),_0xa122('0x5'),_0xa122('0x6'),_0xa122('0x7'),_0xa122('0x8'),_0xa122('0x9')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0xa122('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0xa122('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0xa122('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0xa122('0x2')],'allowNull':!![],'defaultValue':_0xa122('0xa')},'format':{'type':Sequelize[_0xa122('0x2')],'allowNull':!![]},'stamp':{'type':_0xa122('0xb')},'defaultEntry':{'type':Sequelize[_0xa122('0xc')],'defaultValue':0x0}}; \ No newline at end of file +var _0x83dd=['quietmp3nb','quietmp3','mp3','alpha','TIMESTAMP','BOOLEAN','STRING','ENUM','custom','files','mp3nb'];(function(_0x2ceed2,_0x350c02){var _0x4a4993=function(_0x314955){while(--_0x314955){_0x2ceed2['push'](_0x2ceed2['shift']());}};_0x4a4993(++_0x350c02);}(_0x83dd,0x12f));var _0xd83d=function(_0x582926,_0x27061d){_0x582926=_0x582926-0x0;var _0x1d4afd=_0x83dd[_0x582926];return _0x1d4afd;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd83d('0x0')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0xd83d('0x1')](_0xd83d('0x2'),_0xd83d('0x3'),_0xd83d('0x4'),_0xd83d('0x5'),_0xd83d('0x6'),_0xd83d('0x7')),'allowNull':!![],'defaultValue':_0xd83d('0x3')},'directory':{'type':Sequelize[_0xd83d('0x0')],'allowNull':!![]},'application':{'type':Sequelize[_0xd83d('0x0')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xd83d('0x8')},'format':{'type':Sequelize[_0xd83d('0x0')],'allowNull':!![]},'stamp':{'type':_0xd83d('0x9')},'defaultEntry':{'type':Sequelize[_0xd83d('0xa')],'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 788cd23..3846bbd 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 _0x0177=['removeSound','id2','getSounds','eml-format','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','destroy','MusicOnHolds','UserProfileResource','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','VoiceMusicOnHold','catch','show','params','keys','options','find','body','create','sequelize','mode','files','directory','join','root','server/files/moh','mkdirSync','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','autoAssociation','transaction','readdirSync','forEach','unlinkSync','rmdirSync','message','addSound','Sound','save_name','createdAt','server/files/sounds/converted','format','basename','extname','converted_format','%s.%s','symlinkSync','Sequelize','ValidationError','findOne'];(function(_0x48affa,_0x52ed60){var _0x4ee41d=function(_0x5d4b26){while(--_0x5d4b26){_0x48affa['push'](_0x48affa['shift']());}};_0x4ee41d(++_0x52ed60);}(_0x0177,0xdd));var _0x7017=function(_0x4acfbb,_0x84923f){_0x4acfbb=_0x4acfbb-0x0;var _0x528283=_0x0177[_0x4acfbb];return _0x528283;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7017('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7017('0x1'));var rp=require('request-promise');var moment=require(_0x7017('0x2'));var BPromise=require(_0x7017('0x3'));var Mustache=require(_0x7017('0x4'));var util=require('util');var path=require('path');var sox=require(_0x7017('0x5'));var csv=require(_0x7017('0x6'));var ejs=require(_0x7017('0x7'));var fs=require('fs');var _=require(_0x7017('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7017('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x7017('0x6'));var querystring=require(_0x7017('0xa'));var Papa=require(_0x7017('0xb'));var Redis=require(_0x7017('0xc'));var authService=require(_0x7017('0xd'));var qs=require(_0x7017('0xe'));var as=require(_0x7017('0xf'));var hardwareService=require(_0x7017('0x10'));var logger=require('../../config/logger')(_0x7017('0x11'));var utils=require('../../config/utils');var config=require(_0x7017('0x12'));var db=require(_0x7017('0x13'))['db'];function respondWithStatusCode(_0x5bf4f3,_0x56c738){_0x56c738=_0x56c738||0xcc;return function(_0x5b9e62){if(_0x5b9e62){return _0x5bf4f3[_0x7017('0x14')](_0x56c738);}return _0x5bf4f3[_0x7017('0x15')](_0x56c738)[_0x7017('0x16')]();};}function respondWithResult(_0x5673be,_0x1c1492){_0x1c1492=_0x1c1492||0xc8;return function(_0x4d118d){if(_0x4d118d){return _0x5673be[_0x7017('0x15')](_0x1c1492)[_0x7017('0x17')](_0x4d118d);}};}function respondWithFilteredResult(_0x10ecd4,_0x5df8bf){return function(_0x498505){if(_0x498505){var _0x3e39ce=_0x498505[_0x7017('0x18')],_0xb43b64=_0x5df8bf[_0x7017('0x19')],_0x3be07e=_0x5df8bf[_0x7017('0x19')]+_0x5df8bf[_0x7017('0x1a')],_0x131dd6;if(_0x3be07e>=_0x3e39ce){_0x3be07e=_0x3e39ce;_0x131dd6=0xc8;}else{_0x131dd6=0xce;}_0x10ecd4[_0x7017('0x15')](_0x131dd6);return _0x10ecd4[_0x7017('0x1b')]('Content-Range',_0xb43b64+'-'+_0x3be07e+'/'+_0x3e39ce)[_0x7017('0x17')](_0x498505);}return null;};}function patchUpdates(_0x319bb7){return function(_0x27af4f){try{jsonpatch[_0x7017('0x1c')](_0x27af4f,_0x319bb7,!![]);}catch(_0x4f8c45){return BPromise[_0x7017('0x1d')](_0x4f8c45);}return _0x27af4f[_0x7017('0x1e')]();};}function saveUpdates(_0x4426d2,_0x225f67){return function(_0x46e6ba){if(_0x46e6ba){return _0x46e6ba[_0x7017('0x1f')](_0x4426d2)['then'](function(_0x47909b){return _0x47909b;});}return null;};}function removeEntity(_0x8df2b5,_0x555b9a){return function(_0x430a2d){if(_0x430a2d){return _0x430a2d[_0x7017('0x20')]()['then'](function(){var _0x5df6aa=_0x430a2d['get']({'plain':!![]});var _0x328934=_0x7017('0x21');return db[_0x7017('0x22')][_0x7017('0x20')]({'where':{'type':_0x328934,'resourceId':_0x5df6aa['id']}})[_0x7017('0x23')](function(){return _0x430a2d;});})[_0x7017('0x23')](function(){_0x8df2b5[_0x7017('0x15')](0xcc)[_0x7017('0x16')]();});}};}function handleEntityNotFound(_0x31d25d,_0x162bc1){return function(_0x4aa39c){if(!_0x4aa39c){_0x31d25d['sendStatus'](0x194);}return _0x4aa39c;};}function handleError(_0x12bd40,_0x2ef4b9){_0x2ef4b9=_0x2ef4b9||0x1f4;return function(_0xfe7091){logger[_0x7017('0x24')](_0xfe7091[_0x7017('0x25')]);if(_0xfe7091[_0x7017('0x26')]){delete _0xfe7091[_0x7017('0x26')];}_0x12bd40[_0x7017('0x15')](_0x2ef4b9)[_0x7017('0x27')](_0xfe7091);};}exports['index']=function(_0x1df9f4,_0x582d79){var _0x19d15d={},_0x3d923e={},_0x1b2cd9={'count':0x0,'rows':[]};var _0x16e581=_[_0x7017('0x28')](db['VoiceMusicOnHold'][_0x7017('0x29')],function(_0x63b27e){return{'name':_0x63b27e[_0x7017('0x2a')],'type':_0x63b27e[_0x7017('0x2b')][_0x7017('0x2c')]};});_0x3d923e[_0x7017('0x2d')]=_[_0x7017('0x28')](_0x16e581,_0x7017('0x26'));_0x3d923e['query']=_['keys'](_0x1df9f4[_0x7017('0x2e')]);_0x3d923e[_0x7017('0x2f')]=_[_0x7017('0x30')](_0x3d923e[_0x7017('0x2d')],_0x3d923e[_0x7017('0x2e')]);_0x19d15d[_0x7017('0x31')]=_[_0x7017('0x30')](_0x3d923e[_0x7017('0x2d')],qs[_0x7017('0x32')](_0x1df9f4['query'][_0x7017('0x32')]));_0x19d15d[_0x7017('0x31')]=_0x19d15d[_0x7017('0x31')][_0x7017('0x33')]?_0x19d15d[_0x7017('0x31')]:_0x3d923e['model'];if(!_0x1df9f4[_0x7017('0x2e')][_0x7017('0x34')](_0x7017('0x35'))){_0x19d15d[_0x7017('0x1a')]=qs[_0x7017('0x1a')](_0x1df9f4[_0x7017('0x2e')][_0x7017('0x1a')]);_0x19d15d[_0x7017('0x19')]=qs[_0x7017('0x19')](_0x1df9f4[_0x7017('0x2e')][_0x7017('0x19')]);}_0x19d15d[_0x7017('0x36')]=qs[_0x7017('0x37')](_0x1df9f4[_0x7017('0x2e')][_0x7017('0x37')]);_0x19d15d[_0x7017('0x38')]=qs[_0x7017('0x2f')](_[_0x7017('0x39')](_0x1df9f4[_0x7017('0x2e')],_0x3d923e[_0x7017('0x2f')]));if(_0x1df9f4[_0x7017('0x2e')][_0x7017('0x3a')]){_0x19d15d[_0x7017('0x38')]=_[_0x7017('0x3b')](_0x19d15d[_0x7017('0x38')],{'$or':_[_0x7017('0x28')](_0x16e581,function(_0x1705e9){if(_0x1705e9['type']!==_0x7017('0x3c')){var _0x6b1759={};_0x6b1759[_0x1705e9[_0x7017('0x26')]]={'$like':'%'+_0x1df9f4[_0x7017('0x2e')]['filter']+'%'};return _0x6b1759;}})});}_0x19d15d=_[_0x7017('0x3b')]({},_0x19d15d,_0x1df9f4['options']);var _0x294d99={'where':_0x19d15d['where']};return db['VoiceMusicOnHold'][_0x7017('0x18')](_0x294d99)[_0x7017('0x23')](function(_0x5a83a6){_0x1b2cd9[_0x7017('0x18')]=_0x5a83a6;if(_0x1df9f4[_0x7017('0x2e')][_0x7017('0x3d')]){_0x19d15d[_0x7017('0x3e')]=[{'all':!![]}];}return db[_0x7017('0x3f')]['findAll'](_0x19d15d);})[_0x7017('0x23')](function(_0x51667c){_0x1b2cd9['rows']=_0x51667c;return _0x1b2cd9;})['then'](respondWithFilteredResult(_0x582d79,_0x19d15d))[_0x7017('0x40')](handleError(_0x582d79,null));};exports[_0x7017('0x41')]=function(_0x2ea653,_0x2c3cfa){var _0x535d43={'raw':![],'where':{'id':_0x2ea653[_0x7017('0x42')]['id']}},_0x262b51={};_0x262b51[_0x7017('0x2d')]=_[_0x7017('0x43')](db[_0x7017('0x3f')][_0x7017('0x29')]);_0x262b51[_0x7017('0x2e')]=_[_0x7017('0x43')](_0x2ea653[_0x7017('0x2e')]);_0x262b51[_0x7017('0x2f')]=_[_0x7017('0x30')](_0x262b51[_0x7017('0x2d')],_0x262b51['query']);_0x535d43[_0x7017('0x31')]=_[_0x7017('0x30')](_0x262b51[_0x7017('0x2d')],qs[_0x7017('0x32')](_0x2ea653[_0x7017('0x2e')]['fields']));_0x535d43['attributes']=_0x535d43[_0x7017('0x31')][_0x7017('0x33')]?_0x535d43['attributes']:_0x262b51[_0x7017('0x2d')];if(_0x2ea653[_0x7017('0x2e')][_0x7017('0x3d')]){_0x535d43[_0x7017('0x3e')]=[{'all':!![]}];}_0x535d43=_['merge']({},_0x535d43,_0x2ea653[_0x7017('0x44')]);return db['VoiceMusicOnHold'][_0x7017('0x45')](_0x535d43)[_0x7017('0x23')](handleEntityNotFound(_0x2c3cfa,null))[_0x7017('0x23')](respondWithResult(_0x2c3cfa,null))[_0x7017('0x40')](handleError(_0x2c3cfa,null));};exports[_0x7017('0x1f')]=function(_0x27838a,_0x3ab50e){if(_0x27838a[_0x7017('0x46')]['id']){delete _0x27838a[_0x7017('0x46')]['id'];}return db[_0x7017('0x3f')][_0x7017('0x45')]({'where':{'id':_0x27838a['params']['id']}})[_0x7017('0x23')](handleEntityNotFound(_0x3ab50e,null))[_0x7017('0x23')](saveUpdates(_0x27838a[_0x7017('0x46')],null))[_0x7017('0x23')](respondWithResult(_0x3ab50e,null))[_0x7017('0x40')](handleError(_0x3ab50e,null));};exports[_0x7017('0x47')]=function(_0x3c476c,_0x486f5f,_0x4264f6){return db[_0x7017('0x48')]['transaction'](function(_0x25ecd3){if(_0x3c476c[_0x7017('0x46')][_0x7017('0x49')]===_0x7017('0x4a')){_0x3c476c[_0x7017('0x46')][_0x7017('0x4b')]=path[_0x7017('0x4c')](config[_0x7017('0x4d')],_0x7017('0x4e'),_0x3c476c[_0x7017('0x46')][_0x7017('0x26')]);}return db[_0x7017('0x3f')][_0x7017('0x47')](_0x3c476c[_0x7017('0x46')],{'transaction':_0x25ecd3})['then'](function(_0x4c5e34){if(_0x3c476c[_0x7017('0x46')][_0x7017('0x49')]==='files'){fs[_0x7017('0x4f')](_0x4c5e34[_0x7017('0x4b')],parseInt('0777',0x8));}var _0x2e160c=_0x3c476c[_0x7017('0x50')]['get']({'plain':!![]});if(!_0x2e160c)throw new Error(_0x7017('0x51'));if(_0x2e160c[_0x7017('0x52')]===_0x7017('0x50')){var _0x417c62=_0x4c5e34[_0x7017('0x53')]({'plain':!![]});return db[_0x7017('0x54')]['find']({'where':{'name':_0x7017('0x21'),'userProfileId':_0x2e160c['userProfileId']},'raw':!![]})['then'](function(_0x1b215a){if(_0x1b215a&&_0x1b215a[_0x7017('0x55')]===0x0){return db[_0x7017('0x22')][_0x7017('0x47')]({'name':_0x417c62[_0x7017('0x26')],'resourceId':_0x417c62['id'],'type':_0x1b215a[_0x7017('0x26')],'sectionId':_0x1b215a['id']},{})[_0x7017('0x23')](function(){return _0x4c5e34;});}else{return _0x4c5e34;}})[_0x7017('0x40')](function(_0x276749){logger[_0x7017('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x276749);});}return _0x4c5e34;});})[_0x7017('0x23')](respondWithResult(_0x486f5f,0xc9))[_0x7017('0x40')](handleError(_0x486f5f,null));};exports[_0x7017('0x20')]=function(_0x3110d6,_0x2857f2,_0x2db84c){var _0x4b4bc0;return db['VoiceMusicOnHold']['find']({'where':{'id':_0x3110d6[_0x7017('0x42')]['id']}})[_0x7017('0x23')](function(_0x25c350){if(_0x25c350){return db[_0x7017('0x48')][_0x7017('0x56')](function(_0x23a485){return _0x25c350[_0x7017('0x20')]({'transaction':_0x23a485,'raw':!![]})[_0x7017('0x23')](function(_0x366d2e){if(_0x366d2e[_0x7017('0x4b')]){fs[_0x7017('0x57')](_0x366d2e['directory'])[_0x7017('0x58')](function(_0x10bef){fs[_0x7017('0x59')](path[_0x7017('0x4c')](_0x366d2e[_0x7017('0x4b')],_0x10bef));});fs[_0x7017('0x5a')](_0x366d2e[_0x7017('0x4b')]);}return _0x366d2e;});})[_0x7017('0x40')](function(_0x854a68){throw new db['Sequelize']['ValidationError'](_0x854a68[_0x7017('0x5b')]);});}})[_0x7017('0x23')](handleEntityNotFound(_0x2857f2,null))['then'](removeEntity(_0x2857f2,null))[_0x7017('0x40')](handleError(_0x2857f2,null));};exports[_0x7017('0x5c')]=function(_0x1c7007,_0x2cbca6,_0x3d168c){return db['sequelize'][_0x7017('0x56')](function(_0x1b7c02){var _0x28328e;return db[_0x7017('0x3f')]['find']({'where':{'id':_0x1c7007[_0x7017('0x42')]['id']}})[_0x7017('0x23')](function(_0x3a960d){if(_0x3a960d){_0x28328e=_0x3a960d;return _0x3a960d[_0x7017('0x5c')](_0x1c7007[_0x7017('0x46')]['id'],{'transaction':_0x1b7c02});}})[_0x7017('0x23')](function(_0x395e1a){if(_0x395e1a){return db[_0x7017('0x5d')]['findOne']({'where':{'id':_0x1c7007[_0x7017('0x46')]['id']},'attributes':['id',_0x7017('0x26'),_0x7017('0x5e'),'converted_format',_0x7017('0x5f')],'raw':!![]});}})[_0x7017('0x23')](function(_0x53737e){if(_0x53737e){var _0x5c5fd6=path[_0x7017('0x4c')](config[_0x7017('0x4d')],_0x7017('0x60'),util[_0x7017('0x61')]('%s.%s',path[_0x7017('0x62')](_0x53737e[_0x7017('0x5e')],path[_0x7017('0x63')](_0x53737e[_0x7017('0x5e')])),_0x53737e[_0x7017('0x64')]));var _0x2c38da=path[_0x7017('0x4c')](config[_0x7017('0x4d')],_0x7017('0x4e'),_0x28328e[_0x7017('0x26')],util[_0x7017('0x61')](_0x7017('0x65'),_0x53737e['name'],_0x53737e[_0x7017('0x64')]));fs[_0x7017('0x66')](_0x5c5fd6,_0x2c38da);return _0x53737e;}})[_0x7017('0x40')](function(_0x3d8a5d){throw new db[(_0x7017('0x67'))][(_0x7017('0x68'))](_0x3d8a5d[_0x7017('0x5b')]);});})['then'](handleEntityNotFound(_0x2cbca6,null))[_0x7017('0x23')](respondWithResult(_0x2cbca6,0xc9))[_0x7017('0x40')](handleError(_0x2cbca6,null));};exports['removeSound']=function(_0x89754f,_0x4d3ce4,_0xde1a72){return db[_0x7017('0x48')][_0x7017('0x56')](function(_0x421d60){var _0x3255cb;return db[_0x7017('0x3f')][_0x7017('0x69')]({'where':{'id':_0x89754f['params']['id']}})[_0x7017('0x23')](handleEntityNotFound(_0x4d3ce4,null))['then'](function(_0x2f6a1d){if(_0x2f6a1d){_0x3255cb=_0x2f6a1d;return _0x2f6a1d[_0x7017('0x6a')](_0x89754f[_0x7017('0x42')][_0x7017('0x6b')]);}})[_0x7017('0x23')](function(_0xb46d5e){if(_0xb46d5e){return db[_0x7017('0x5d')][_0x7017('0x69')]({'where':{'id':_0x89754f[_0x7017('0x42')][_0x7017('0x6b')]},'attributes':['id','name','save_name',_0x7017('0x64'),_0x7017('0x5f')],'raw':!![]});}})['then'](function(_0x3a7c65){if(_0x3a7c65){fs[_0x7017('0x59')](path['join'](_0x3255cb[_0x7017('0x4b')],util['format'](_0x7017('0x65'),_0x3a7c65[_0x7017('0x26')],_0x3a7c65[_0x7017('0x64')])));return _0x3a7c65;}})['catch'](function(_0x445256){throw new db[(_0x7017('0x67'))][(_0x7017('0x68'))](_0x445256[_0x7017('0x5b')]);});})[_0x7017('0x23')](handleEntityNotFound(_0x4d3ce4,null))[_0x7017('0x23')](respondWithStatusCode(_0x4d3ce4,0xcc))['catch'](handleError(_0x4d3ce4,null));};exports[_0x7017('0x6c')]=function(_0x1a45ee,_0x53d7d4,_0x2a9609){var _0x4a3fdb={};var _0x28fe56={};var _0x5e6d50;var _0x22c685;return db[_0x7017('0x3f')]['findOne']({'where':{'id':_0x1a45ee[_0x7017('0x42')]['id']}})['then'](handleEntityNotFound(_0x53d7d4,null))[_0x7017('0x23')](function(_0x10795d){if(_0x10795d){_0x5e6d50=_0x10795d;_0x28fe56[_0x7017('0x2d')]=_[_0x7017('0x43')](db[_0x7017('0x5d')][_0x7017('0x29')]);_0x28fe56[_0x7017('0x2e')]=_[_0x7017('0x43')](_0x1a45ee[_0x7017('0x2e')]);_0x28fe56[_0x7017('0x2f')]=_['intersection'](_0x28fe56[_0x7017('0x2d')],_0x28fe56['query']);_0x4a3fdb[_0x7017('0x31')]=_[_0x7017('0x30')](_0x28fe56[_0x7017('0x2d')],qs[_0x7017('0x32')](_0x1a45ee[_0x7017('0x2e')][_0x7017('0x32')]));_0x4a3fdb[_0x7017('0x31')]=_0x4a3fdb['attributes'][_0x7017('0x33')]?_0x4a3fdb[_0x7017('0x31')]:_0x28fe56[_0x7017('0x2d')];_0x4a3fdb[_0x7017('0x36')]=qs[_0x7017('0x37')](_0x1a45ee['query'][_0x7017('0x37')]);_0x4a3fdb['where']=qs[_0x7017('0x2f')](_['pick'](_0x1a45ee[_0x7017('0x2e')],_0x28fe56[_0x7017('0x2f')]));if(_0x1a45ee[_0x7017('0x2e')][_0x7017('0x3a')]){_0x4a3fdb[_0x7017('0x38')]=_[_0x7017('0x3b')](_0x4a3fdb[_0x7017('0x38')],{'$or':_['map'](_0x4a3fdb[_0x7017('0x31')],function(_0x503407){var _0x2a3a24={};_0x2a3a24[_0x503407]={'$like':'%'+_0x1a45ee[_0x7017('0x2e')][_0x7017('0x3a')]+'%'};return _0x2a3a24;})});}_0x4a3fdb=_[_0x7017('0x3b')]({},_0x4a3fdb,_0x1a45ee[_0x7017('0x44')]);return _0x5e6d50[_0x7017('0x6c')](_0x4a3fdb);}})[_0x7017('0x23')](function(_0x4bdf16){if(_0x4bdf16){_0x22c685=_0x4bdf16['length'];if(!_0x1a45ee['query']['hasOwnProperty']('nolimit')){_0x4a3fdb['limit']=qs[_0x7017('0x1a')](_0x1a45ee[_0x7017('0x2e')][_0x7017('0x1a')]);_0x4a3fdb[_0x7017('0x19')]=qs[_0x7017('0x19')](_0x1a45ee[_0x7017('0x2e')][_0x7017('0x19')]);}return _0x5e6d50[_0x7017('0x6c')](_0x4a3fdb);}})[_0x7017('0x23')](function(_0x3b5935){if(_0x3b5935){return _0x3b5935?{'count':_0x22c685,'rows':_0x3b5935}:null;}})[_0x7017('0x23')](respondWithResult(_0x53d7d4,null))[_0x7017('0x40')](handleError(_0x53d7d4,null));}; \ No newline at end of file +var _0x03b8=['rmdirSync','message','addSound','Sound','findOne','save_name','converted_format','createdAt','root','format','basename','symlinkSync','ValidationError','removeSound','id2','unlinkSync','%s.%s','getSounds','html-pdf','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','get','MusicOnHolds','destroy','end','stack','name','send','VoiceMusicOnHold','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','includeAll','rows','catch','params','rawAttributes','include','options','body','find','create','sequelize','mode','files','join','server/files/moh','mkdirSync','directory','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','readdirSync','forEach'];(function(_0x28699c,_0x2cf307){var _0x5a71d6=function(_0xec3c15){while(--_0xec3c15){_0x28699c['push'](_0x28699c['shift']());}};_0x5a71d6(++_0x2cf307);}(_0x03b8,0x159));var _0x803b=function(_0x466342,_0x90eb9b){_0x466342=_0x466342-0x0;var _0x41ddea=_0x03b8[_0x466342];return _0x41ddea;};'use strict';var pdf=require(_0x803b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x803b('0x1'));var zipdir=require(_0x803b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x803b('0x3'));var BPromise=require(_0x803b('0x4'));var Mustache=require(_0x803b('0x5'));var util=require(_0x803b('0x6'));var path=require(_0x803b('0x7'));var sox=require('sox');var csv=require(_0x803b('0x8'));var ejs=require(_0x803b('0x9'));var fs=require('fs');var _=require(_0x803b('0xa'));var squel=require(_0x803b('0xb'));var crypto=require('crypto');var jsforce=require(_0x803b('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x803b('0x8'));var querystring=require(_0x803b('0xd'));var Papa=require(_0x803b('0xe'));var Redis=require(_0x803b('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x803b('0x10'));var as=require(_0x803b('0x11'));var hardwareService=require(_0x803b('0x12'));var logger=require('../../config/logger')(_0x803b('0x13'));var utils=require(_0x803b('0x14'));var config=require(_0x803b('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54ab6f,_0x1ab7d9){_0x1ab7d9=_0x1ab7d9||0xcc;return function(_0x55b6e7){if(_0x55b6e7){return _0x54ab6f[_0x803b('0x16')](_0x1ab7d9);}return _0x54ab6f[_0x803b('0x17')](_0x1ab7d9)['end']();};}function respondWithResult(_0x459616,_0x4ddf61){_0x4ddf61=_0x4ddf61||0xc8;return function(_0x15fcb4){if(_0x15fcb4){return _0x459616[_0x803b('0x17')](_0x4ddf61)[_0x803b('0x18')](_0x15fcb4);}};}function respondWithFilteredResult(_0x402d7c,_0x253e56){return function(_0x1786e1){if(_0x1786e1){var _0x4cc775=_0x1786e1[_0x803b('0x19')],_0x1d3c19=_0x253e56['offset'],_0x1a666f=_0x253e56[_0x803b('0x1a')]+_0x253e56[_0x803b('0x1b')],_0x4e20e;if(_0x1a666f>=_0x4cc775){_0x1a666f=_0x4cc775;_0x4e20e=0xc8;}else{_0x4e20e=0xce;}_0x402d7c['status'](_0x4e20e);return _0x402d7c[_0x803b('0x1c')](_0x803b('0x1d'),_0x1d3c19+'-'+_0x1a666f+'/'+_0x4cc775)['json'](_0x1786e1);}return null;};}function patchUpdates(_0x14972e){return function(_0x199d52){try{jsonpatch[_0x803b('0x1e')](_0x199d52,_0x14972e,!![]);}catch(_0x2dc5cf){return BPromise[_0x803b('0x1f')](_0x2dc5cf);}return _0x199d52[_0x803b('0x20')]();};}function saveUpdates(_0x5575a4,_0x2c6ba1){return function(_0x50c7a7){if(_0x50c7a7){return _0x50c7a7[_0x803b('0x21')](_0x5575a4)[_0x803b('0x22')](function(_0x27ea35){return _0x27ea35;});}return null;};}function removeEntity(_0x614fb5,_0x676051){return function(_0x6bac73){if(_0x6bac73){return _0x6bac73['destroy']()[_0x803b('0x22')](function(){var _0x34c022=_0x6bac73[_0x803b('0x23')]({'plain':!![]});var _0x510ca6=_0x803b('0x24');return db['UserProfileResource'][_0x803b('0x25')]({'where':{'type':_0x510ca6,'resourceId':_0x34c022['id']}})[_0x803b('0x22')](function(){return _0x6bac73;});})[_0x803b('0x22')](function(){_0x614fb5['status'](0xcc)[_0x803b('0x26')]();});}};}function handleEntityNotFound(_0x10f984,_0x182543){return function(_0x152339){if(!_0x152339){_0x10f984[_0x803b('0x16')](0x194);}return _0x152339;};}function handleError(_0x4bb85c,_0x3e5ce0){_0x3e5ce0=_0x3e5ce0||0x1f4;return function(_0x124a08){logger['error'](_0x124a08[_0x803b('0x27')]);if(_0x124a08[_0x803b('0x28')]){delete _0x124a08['name'];}_0x4bb85c[_0x803b('0x17')](_0x3e5ce0)[_0x803b('0x29')](_0x124a08);};}exports['index']=function(_0x2a7d41,_0x111261){var _0x5c255d={},_0x34d510={},_0x44d4e2={'count':0x0,'rows':[]};var _0x37c734=_['map'](db[_0x803b('0x2a')]['rawAttributes'],function(_0x32b24b){return{'name':_0x32b24b[_0x803b('0x2b')],'type':_0x32b24b['type']['key']};});_0x34d510[_0x803b('0x2c')]=_['map'](_0x37c734,'name');_0x34d510[_0x803b('0x2d')]=_[_0x803b('0x2e')](_0x2a7d41[_0x803b('0x2d')]);_0x34d510[_0x803b('0x2f')]=_[_0x803b('0x30')](_0x34d510['model'],_0x34d510[_0x803b('0x2d')]);_0x5c255d[_0x803b('0x31')]=_['intersection'](_0x34d510[_0x803b('0x2c')],qs[_0x803b('0x32')](_0x2a7d41['query']['fields']));_0x5c255d[_0x803b('0x31')]=_0x5c255d[_0x803b('0x31')][_0x803b('0x33')]?_0x5c255d[_0x803b('0x31')]:_0x34d510[_0x803b('0x2c')];if(!_0x2a7d41[_0x803b('0x2d')][_0x803b('0x34')](_0x803b('0x35'))){_0x5c255d[_0x803b('0x1b')]=qs['limit'](_0x2a7d41[_0x803b('0x2d')][_0x803b('0x1b')]);_0x5c255d['offset']=qs[_0x803b('0x1a')](_0x2a7d41['query'][_0x803b('0x1a')]);}_0x5c255d[_0x803b('0x36')]=qs[_0x803b('0x37')](_0x2a7d41[_0x803b('0x2d')]['sort']);_0x5c255d[_0x803b('0x38')]=qs[_0x803b('0x2f')](_[_0x803b('0x39')](_0x2a7d41[_0x803b('0x2d')],_0x34d510[_0x803b('0x2f')]));if(_0x2a7d41[_0x803b('0x2d')][_0x803b('0x3a')]){_0x5c255d[_0x803b('0x38')]=_[_0x803b('0x3b')](_0x5c255d[_0x803b('0x38')],{'$or':_[_0x803b('0x3c')](_0x37c734,function(_0x3bc4e2){if(_0x3bc4e2[_0x803b('0x3d')]!==_0x803b('0x3e')){var _0x2da4c2={};_0x2da4c2[_0x3bc4e2[_0x803b('0x28')]]={'$like':'%'+_0x2a7d41['query']['filter']+'%'};return _0x2da4c2;}})});}_0x5c255d=_[_0x803b('0x3b')]({},_0x5c255d,_0x2a7d41['options']);var _0x183de5={'where':_0x5c255d['where']};return db['VoiceMusicOnHold'][_0x803b('0x19')](_0x183de5)['then'](function(_0x45d5a2){_0x44d4e2['count']=_0x45d5a2;if(_0x2a7d41[_0x803b('0x2d')][_0x803b('0x3f')]){_0x5c255d['include']=[{'all':!![]}];}return db[_0x803b('0x2a')]['findAll'](_0x5c255d);})[_0x803b('0x22')](function(_0x896b7c){_0x44d4e2[_0x803b('0x40')]=_0x896b7c;return _0x44d4e2;})[_0x803b('0x22')](respondWithFilteredResult(_0x111261,_0x5c255d))[_0x803b('0x41')](handleError(_0x111261,null));};exports['show']=function(_0x232e73,_0x3c8cb9){var _0xa27c6a={'raw':![],'where':{'id':_0x232e73[_0x803b('0x42')]['id']}},_0x5a5a6a={};_0x5a5a6a['model']=_[_0x803b('0x2e')](db['VoiceMusicOnHold'][_0x803b('0x43')]);_0x5a5a6a[_0x803b('0x2d')]=_['keys'](_0x232e73['query']);_0x5a5a6a[_0x803b('0x2f')]=_[_0x803b('0x30')](_0x5a5a6a['model'],_0x5a5a6a['query']);_0xa27c6a['attributes']=_[_0x803b('0x30')](_0x5a5a6a['model'],qs[_0x803b('0x32')](_0x232e73[_0x803b('0x2d')][_0x803b('0x32')]));_0xa27c6a[_0x803b('0x31')]=_0xa27c6a[_0x803b('0x31')][_0x803b('0x33')]?_0xa27c6a[_0x803b('0x31')]:_0x5a5a6a[_0x803b('0x2c')];if(_0x232e73[_0x803b('0x2d')][_0x803b('0x3f')]){_0xa27c6a[_0x803b('0x44')]=[{'all':!![]}];}_0xa27c6a=_[_0x803b('0x3b')]({},_0xa27c6a,_0x232e73[_0x803b('0x45')]);return db[_0x803b('0x2a')]['find'](_0xa27c6a)[_0x803b('0x22')](handleEntityNotFound(_0x3c8cb9,null))[_0x803b('0x22')](respondWithResult(_0x3c8cb9,null))[_0x803b('0x41')](handleError(_0x3c8cb9,null));};exports['update']=function(_0x430f71,_0x8c2b3c){if(_0x430f71[_0x803b('0x46')]['id']){delete _0x430f71[_0x803b('0x46')]['id'];}return db[_0x803b('0x2a')][_0x803b('0x47')]({'where':{'id':_0x430f71[_0x803b('0x42')]['id']}})['then'](handleEntityNotFound(_0x8c2b3c,null))[_0x803b('0x22')](saveUpdates(_0x430f71['body'],null))[_0x803b('0x22')](respondWithResult(_0x8c2b3c,null))[_0x803b('0x41')](handleError(_0x8c2b3c,null));};exports[_0x803b('0x48')]=function(_0x5bb1c5,_0x25b5e8,_0x44c4fa){return db[_0x803b('0x49')]['transaction'](function(_0x595971){if(_0x5bb1c5[_0x803b('0x46')][_0x803b('0x4a')]===_0x803b('0x4b')){_0x5bb1c5[_0x803b('0x46')]['directory']=path[_0x803b('0x4c')](config['root'],_0x803b('0x4d'),_0x5bb1c5[_0x803b('0x46')][_0x803b('0x28')]);}return db['VoiceMusicOnHold'][_0x803b('0x48')](_0x5bb1c5[_0x803b('0x46')],{'transaction':_0x595971})['then'](function(_0x2f922a){if(_0x5bb1c5[_0x803b('0x46')][_0x803b('0x4a')]==='files'){fs[_0x803b('0x4e')](_0x2f922a[_0x803b('0x4f')],parseInt('0777',0x8));}var _0x600f83=_0x5bb1c5[_0x803b('0x50')][_0x803b('0x23')]({'plain':!![]});if(!_0x600f83)throw new Error(_0x803b('0x51'));if(_0x600f83[_0x803b('0x52')]===_0x803b('0x50')){var _0x2ab251=_0x2f922a['get']({'plain':!![]});return db[_0x803b('0x53')][_0x803b('0x47')]({'where':{'name':_0x803b('0x24'),'userProfileId':_0x600f83[_0x803b('0x54')]},'raw':!![]})['then'](function(_0x40b706){if(_0x40b706&&_0x40b706[_0x803b('0x55')]===0x0){return db[_0x803b('0x56')][_0x803b('0x48')]({'name':_0x2ab251[_0x803b('0x28')],'resourceId':_0x2ab251['id'],'type':_0x40b706[_0x803b('0x28')],'sectionId':_0x40b706['id']},{})[_0x803b('0x22')](function(){return _0x2f922a;});}else{return _0x2f922a;}})[_0x803b('0x41')](function(_0x3e65d6){logger['error'](_0x803b('0x57'),_0x3e65d6);});}return _0x2f922a;});})[_0x803b('0x22')](respondWithResult(_0x25b5e8,0xc9))['catch'](handleError(_0x25b5e8,null));};exports[_0x803b('0x25')]=function(_0x65c2ba,_0x185fe5,_0x2832ca){var _0x2afbba;return db[_0x803b('0x2a')]['find']({'where':{'id':_0x65c2ba[_0x803b('0x42')]['id']}})[_0x803b('0x22')](function(_0x239c3c){if(_0x239c3c){return db[_0x803b('0x49')][_0x803b('0x58')](function(_0x5d6424){return _0x239c3c[_0x803b('0x25')]({'transaction':_0x5d6424,'raw':!![]})[_0x803b('0x22')](function(_0x458a98){if(_0x458a98[_0x803b('0x4f')]){fs[_0x803b('0x59')](_0x458a98['directory'])[_0x803b('0x5a')](function(_0x2812c1){fs['unlinkSync'](path[_0x803b('0x4c')](_0x458a98['directory'],_0x2812c1));});fs[_0x803b('0x5b')](_0x458a98[_0x803b('0x4f')]);}return _0x458a98;});})['catch'](function(_0x590b56){throw new db['Sequelize']['ValidationError'](_0x590b56[_0x803b('0x5c')]);});}})[_0x803b('0x22')](handleEntityNotFound(_0x185fe5,null))[_0x803b('0x22')](removeEntity(_0x185fe5,null))['catch'](handleError(_0x185fe5,null));};exports[_0x803b('0x5d')]=function(_0x53ad0d,_0x5f862a,_0x1c38b3){return db[_0x803b('0x49')]['transaction'](function(_0x2185ca){var _0x2a6299;return db['VoiceMusicOnHold'][_0x803b('0x47')]({'where':{'id':_0x53ad0d[_0x803b('0x42')]['id']}})['then'](function(_0x2688e8){if(_0x2688e8){_0x2a6299=_0x2688e8;return _0x2688e8[_0x803b('0x5d')](_0x53ad0d[_0x803b('0x46')]['id'],{'transaction':_0x2185ca});}})[_0x803b('0x22')](function(_0x57db21){if(_0x57db21){return db[_0x803b('0x5e')][_0x803b('0x5f')]({'where':{'id':_0x53ad0d[_0x803b('0x46')]['id']},'attributes':['id',_0x803b('0x28'),_0x803b('0x60'),_0x803b('0x61'),_0x803b('0x62')],'raw':!![]});}})[_0x803b('0x22')](function(_0x3c1d8d){if(_0x3c1d8d){var _0x432973=path['join'](config[_0x803b('0x63')],'server/files/sounds/converted',util[_0x803b('0x64')]('%s.%s',path[_0x803b('0x65')](_0x3c1d8d['save_name'],path['extname'](_0x3c1d8d[_0x803b('0x60')])),_0x3c1d8d[_0x803b('0x61')]));var _0x5eb7a9=path[_0x803b('0x4c')](config[_0x803b('0x63')],_0x803b('0x4d'),_0x2a6299[_0x803b('0x28')],util[_0x803b('0x64')]('%s.%s',_0x3c1d8d[_0x803b('0x28')],_0x3c1d8d['converted_format']));fs[_0x803b('0x66')](_0x432973,_0x5eb7a9);return _0x3c1d8d;}})[_0x803b('0x41')](function(_0x174272){throw new db['Sequelize'][(_0x803b('0x67'))](_0x174272[_0x803b('0x5c')]);});})['then'](handleEntityNotFound(_0x5f862a,null))[_0x803b('0x22')](respondWithResult(_0x5f862a,0xc9))['catch'](handleError(_0x5f862a,null));};exports['removeSound']=function(_0x18a03a,_0x667509,_0x36bc2d){return db[_0x803b('0x49')][_0x803b('0x58')](function(_0x3c0a13){var _0x4fce4b;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x18a03a[_0x803b('0x42')]['id']}})[_0x803b('0x22')](handleEntityNotFound(_0x667509,null))['then'](function(_0x310f2d){if(_0x310f2d){_0x4fce4b=_0x310f2d;return _0x310f2d[_0x803b('0x68')](_0x18a03a[_0x803b('0x42')][_0x803b('0x69')]);}})[_0x803b('0x22')](function(_0x2158cc){if(_0x2158cc){return db[_0x803b('0x5e')]['findOne']({'where':{'id':_0x18a03a[_0x803b('0x42')]['id2']},'attributes':['id',_0x803b('0x28'),'save_name',_0x803b('0x61'),_0x803b('0x62')],'raw':!![]});}})[_0x803b('0x22')](function(_0x57c909){if(_0x57c909){fs[_0x803b('0x6a')](path[_0x803b('0x4c')](_0x4fce4b['directory'],util[_0x803b('0x64')](_0x803b('0x6b'),_0x57c909[_0x803b('0x28')],_0x57c909[_0x803b('0x61')])));return _0x57c909;}})[_0x803b('0x41')](function(_0x55a0f7){throw new db['Sequelize'][(_0x803b('0x67'))](_0x55a0f7[_0x803b('0x5c')]);});})[_0x803b('0x22')](handleEntityNotFound(_0x667509,null))['then'](respondWithStatusCode(_0x667509,0xcc))[_0x803b('0x41')](handleError(_0x667509,null));};exports[_0x803b('0x6c')]=function(_0x2e6497,_0x17be2d,_0x18b8fb){var _0x5a78ea={};var _0x17a7a3={};var _0x45ee50;var _0x52f739;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x2e6497[_0x803b('0x42')]['id']}})[_0x803b('0x22')](handleEntityNotFound(_0x17be2d,null))[_0x803b('0x22')](function(_0x4a6834){if(_0x4a6834){_0x45ee50=_0x4a6834;_0x17a7a3[_0x803b('0x2c')]=_[_0x803b('0x2e')](db[_0x803b('0x5e')]['rawAttributes']);_0x17a7a3[_0x803b('0x2d')]=_[_0x803b('0x2e')](_0x2e6497[_0x803b('0x2d')]);_0x17a7a3[_0x803b('0x2f')]=_[_0x803b('0x30')](_0x17a7a3['model'],_0x17a7a3[_0x803b('0x2d')]);_0x5a78ea['attributes']=_['intersection'](_0x17a7a3[_0x803b('0x2c')],qs[_0x803b('0x32')](_0x2e6497[_0x803b('0x2d')][_0x803b('0x32')]));_0x5a78ea[_0x803b('0x31')]=_0x5a78ea[_0x803b('0x31')][_0x803b('0x33')]?_0x5a78ea[_0x803b('0x31')]:_0x17a7a3[_0x803b('0x2c')];_0x5a78ea[_0x803b('0x36')]=qs['sort'](_0x2e6497[_0x803b('0x2d')][_0x803b('0x37')]);_0x5a78ea[_0x803b('0x38')]=qs[_0x803b('0x2f')](_['pick'](_0x2e6497[_0x803b('0x2d')],_0x17a7a3[_0x803b('0x2f')]));if(_0x2e6497[_0x803b('0x2d')][_0x803b('0x3a')]){_0x5a78ea[_0x803b('0x38')]=_[_0x803b('0x3b')](_0x5a78ea['where'],{'$or':_['map'](_0x5a78ea[_0x803b('0x31')],function(_0x5af47b){var _0x4cb79f={};_0x4cb79f[_0x5af47b]={'$like':'%'+_0x2e6497[_0x803b('0x2d')]['filter']+'%'};return _0x4cb79f;})});}_0x5a78ea=_[_0x803b('0x3b')]({},_0x5a78ea,_0x2e6497[_0x803b('0x45')]);return _0x45ee50[_0x803b('0x6c')](_0x5a78ea);}})[_0x803b('0x22')](function(_0x52932c){if(_0x52932c){_0x52f739=_0x52932c[_0x803b('0x33')];if(!_0x2e6497[_0x803b('0x2d')]['hasOwnProperty']('nolimit')){_0x5a78ea[_0x803b('0x1b')]=qs[_0x803b('0x1b')](_0x2e6497[_0x803b('0x2d')]['limit']);_0x5a78ea[_0x803b('0x1a')]=qs[_0x803b('0x1a')](_0x2e6497[_0x803b('0x2d')][_0x803b('0x1a')]);}return _0x45ee50[_0x803b('0x6c')](_0x5a78ea);}})[_0x803b('0x22')](function(_0x341676){if(_0x341676){return _0x341676?{'count':_0x52f739,'rows':_0x341676}:null;}})[_0x803b('0x22')](respondWithResult(_0x17be2d,null))['catch'](handleError(_0x17be2d,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index e9ae3ec..41e5744 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 _0xb48e=['bluebird','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','VoiceMusicOnHold','voice_musiconhold','../../config/logger'];(function(_0x430f44,_0x4ae21b){var _0x1f6b0f=function(_0x35968f){while(--_0x35968f){_0x430f44['push'](_0x430f44['shift']());}};_0x1f6b0f(++_0x4ae21b);}(_0xb48e,0xd7));var _0xeb48=function(_0x542da8,_0xcfe635){_0x542da8=_0x542da8-0x0;var _0x3d1e35=_0xb48e[_0x542da8];return _0x3d1e35;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xeb48('0x0'))('api');var moment=require('moment');var BPromise=require(_0xeb48('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xeb48('0x2'));var config=require(_0xeb48('0x3'));var attributes=require(_0xeb48('0x4'));module[_0xeb48('0x5')]=function(_0x99bffc,_0x390521){return _0x99bffc['define'](_0xeb48('0x6'),attributes,{'tableName':_0xeb48('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1b20=['../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x33aa44,_0x286c09){var _0xe833ef=function(_0x5bc32d){while(--_0x5bc32d){_0x33aa44['push'](_0x33aa44['shift']());}};_0xe833ef(++_0x286c09);}(_0x1b20,0x66));var _0x01b2=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x1b20[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var util=require(_0x01b2('0x0'));var logger=require(_0x01b2('0x1'))('api');var moment=require('moment');var BPromise=require(_0x01b2('0x2'));var rp=require(_0x01b2('0x3'));var fs=require('fs');var path=require(_0x01b2('0x4'));var rimraf=require(_0x01b2('0x5'));var config=require(_0x01b2('0x6'));var attributes=require(_0x01b2('0x7'));module[_0x01b2('0x8')]=function(_0x28de4a,_0x46e745){return _0x28de4a[_0x01b2('0x9')](_0x01b2('0xa'),attributes,{'tableName':_0x01b2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index 9487937..8740b6f 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 _0xeba8=['request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x19987c,_0x59cab3){var _0x547a58=function(_0x585e5b){while(--_0x585e5b){_0x19987c['push'](_0x19987c['shift']());}};_0x547a58(++_0x59cab3);}(_0xeba8,0x7f));var _0x8eba=function(_0x503306,_0x356f2f){_0x503306=_0x503306-0x0;var _0x44a99d=_0xeba8[_0x503306];return _0x44a99d;};'use strict';var _=require(_0x8eba('0x0'));var util=require(_0x8eba('0x1'));var moment=require('moment');var BPromise=require(_0x8eba('0x2'));var rs=require(_0x8eba('0x3'));var fs=require('fs');var Redis=require(_0x8eba('0x4'));var db=require(_0x8eba('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8eba('0x6'));var config=require(_0x8eba('0x7'));var jayson=require(_0x8eba('0x8'));var client=jayson[_0x8eba('0x9')][_0x8eba('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2baed2,_0x99115e,_0x15fa5f){return new BPromise(function(_0x4a9cab,_0x3fecb9){return client[_0x8eba('0xb')](_0x2baed2,_0x15fa5f)[_0x8eba('0xc')](function(_0x1af517){logger[_0x8eba('0xd')](_0x8eba('0xe'),_0x99115e,'request\x20sent');logger[_0x8eba('0xf')](_0x8eba('0x10'),_0x99115e,_0x8eba('0x11'),JSON[_0x8eba('0x12')](_0x1af517));if(_0x1af517[_0x8eba('0x13')]){if(_0x1af517[_0x8eba('0x13')]['code']===0x1f4){logger['error'](_0x8eba('0xe'),_0x99115e,_0x1af517['error']['message']);return _0x3fecb9(_0x1af517[_0x8eba('0x13')]['message']);}logger[_0x8eba('0x13')](_0x8eba('0xe'),_0x99115e,_0x1af517[_0x8eba('0x13')][_0x8eba('0x14')]);return _0x4a9cab(_0x1af517[_0x8eba('0x13')]['message']);}else{logger[_0x8eba('0xd')](_0x8eba('0xe'),_0x99115e,'request\x20sent');_0x4a9cab(_0x1af517[_0x8eba('0x15')][_0x8eba('0x14')]);}})[_0x8eba('0x16')](function(_0x5df55f){logger[_0x8eba('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x99115e,_0x5df55f);_0x3fecb9(_0x5df55f);});});} \ No newline at end of file +var _0x0b5c=['debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent'];(function(_0x59de73,_0xaee008){var _0x448e82=function(_0x31ff39){while(--_0x31ff39){_0x59de73['push'](_0x59de73['shift']());}};_0x448e82(++_0xaee008);}(_0x0b5c,0x1aa));var _0xc0b5=function(_0x13114d,_0x199cd5){_0x13114d=_0x13114d-0x0;var _0x49a026=_0x0b5c[_0x13114d];return _0x49a026;};'use strict';var _=require(_0xc0b5('0x0'));var util=require(_0xc0b5('0x1'));var moment=require(_0xc0b5('0x2'));var BPromise=require(_0xc0b5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc0b5('0x4'))['db'];var utils=require(_0xc0b5('0x5'));var logger=require(_0xc0b5('0x6'))(_0xc0b5('0x7'));var config=require(_0xc0b5('0x8'));var jayson=require(_0xc0b5('0x9'));var client=jayson[_0xc0b5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x207892,_0x4b1b49,_0x335431){return new BPromise(function(_0x250d77,_0x32354){return client[_0xc0b5('0xb')](_0x207892,_0x335431)['then'](function(_0x400a68){logger['info'](_0xc0b5('0xc'),_0x4b1b49,_0xc0b5('0xd'));logger[_0xc0b5('0xe')](_0xc0b5('0xf'),_0x4b1b49,_0xc0b5('0xd'),JSON[_0xc0b5('0x10')](_0x400a68));if(_0x400a68[_0xc0b5('0x11')]){if(_0x400a68[_0xc0b5('0x11')]['code']===0x1f4){logger[_0xc0b5('0x11')](_0xc0b5('0xc'),_0x4b1b49,_0x400a68['error'][_0xc0b5('0x12')]);return _0x32354(_0x400a68[_0xc0b5('0x11')][_0xc0b5('0x12')]);}logger[_0xc0b5('0x11')](_0xc0b5('0xc'),_0x4b1b49,_0x400a68[_0xc0b5('0x11')]['message']);return _0x250d77(_0x400a68[_0xc0b5('0x11')][_0xc0b5('0x12')]);}else{logger[_0xc0b5('0x13')](_0xc0b5('0xc'),_0x4b1b49,_0xc0b5('0xd'));_0x250d77(_0x400a68[_0xc0b5('0x14')][_0xc0b5('0x12')]);}})[_0xc0b5('0x15')](function(_0x4e5063){logger[_0xc0b5('0x11')](_0xc0b5('0xc'),_0x4b1b49,_0x4e5063);_0x32354(_0x4e5063);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 4e725eb..c61f62c 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 _0x867c=['get','isAuthenticated','/describe','show','/:id/users','getAgents','post','create','addAgents','put','/:id','update','delete','destroy','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2f81ef,_0x33953a){var _0x1ca14d=function(_0x35a783){while(--_0x35a783){_0x2f81ef['push'](_0x2f81ef['shift']());}};_0x1ca14d(++_0x33953a);}(_0x867c,0x88));var _0xc867=function(_0xd7b0a4,_0x53c7d3){_0xd7b0a4=_0xd7b0a4-0x0;var _0x184e9e=_0x867c[_0xd7b0a4];return _0x184e9e;};'use strict';var multer=require(_0xc867('0x0'));var util=require('util');var path=require(_0xc867('0x1'));var timeout=require(_0xc867('0x2'));var express=require(_0xc867('0x3'));var router=express[_0xc867('0x4')]();var auth=require(_0xc867('0x5'));var interaction=require(_0xc867('0x6'));var config=require(_0xc867('0x7'));var controller=require('./voicePrefix.controller');router[_0xc867('0x8')]('/',auth[_0xc867('0x9')](),controller['index']);router[_0xc867('0x8')](_0xc867('0xa'),auth[_0xc867('0x9')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xc867('0xb')]);router['get'](_0xc867('0xc'),auth[_0xc867('0x9')](),controller[_0xc867('0xd')]);router[_0xc867('0xe')]('/',auth[_0xc867('0x9')](),controller[_0xc867('0xf')]);router[_0xc867('0xe')](_0xc867('0xc'),auth[_0xc867('0x9')](),controller[_0xc867('0x10')]);router[_0xc867('0x11')](_0xc867('0x12'),auth[_0xc867('0x9')](),controller[_0xc867('0x13')]);router[_0xc867('0x14')](_0xc867('0x12'),auth[_0xc867('0x9')](),controller[_0xc867('0x15')]);router[_0xc867('0x14')]('/:id/users',auth[_0xc867('0x9')](),controller[_0xc867('0x16')]);module[_0xc867('0x17')]=router; \ No newline at end of file +var _0xc04f=['../../config/environment','./voicePrefix.controller','isAuthenticated','index','get','describe','/:id','/:id/users','getAgents','create','post','addAgents','put','update','delete','destroy','removeAgents','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xc04f,0x125));var _0xfc04=function(_0x353598,_0x33e234){_0x353598=_0x353598-0x0;var _0x4cf82e=_0xc04f[_0x353598];return _0x4cf82e;};'use strict';var multer=require('multer');var util=require(_0xfc04('0x0'));var path=require(_0xfc04('0x1'));var timeout=require('connect-timeout');var express=require(_0xfc04('0x2'));var router=express[_0xfc04('0x3')]();var auth=require(_0xfc04('0x4'));var interaction=require(_0xfc04('0x5'));var config=require(_0xfc04('0x6'));var controller=require(_0xfc04('0x7'));router['get']('/',auth[_0xfc04('0x8')](),controller[_0xfc04('0x9')]);router[_0xfc04('0xa')]('/describe',auth[_0xfc04('0x8')](),controller[_0xfc04('0xb')]);router[_0xfc04('0xa')](_0xfc04('0xc'),auth[_0xfc04('0x8')](),controller['show']);router[_0xfc04('0xa')](_0xfc04('0xd'),auth[_0xfc04('0x8')](),controller[_0xfc04('0xe')]);router['post']('/',auth[_0xfc04('0x8')](),controller[_0xfc04('0xf')]);router[_0xfc04('0x10')](_0xfc04('0xd'),auth[_0xfc04('0x8')](),controller[_0xfc04('0x11')]);router[_0xfc04('0x12')](_0xfc04('0xc'),auth[_0xfc04('0x8')](),controller[_0xfc04('0x13')]);router[_0xfc04('0x14')](_0xfc04('0xc'),auth[_0xfc04('0x8')](),controller[_0xfc04('0x15')]);router[_0xfc04('0x14')]('/:id/users',auth[_0xfc04('0x8')](),controller[_0xfc04('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index b90e455..e2e54d5 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 _0x77f1=['getDataValue','INTEGER','exports','STRING','name'];(function(_0x5a6644,_0x45d612){var _0x3a2a5d=function(_0x54159e){while(--_0x54159e){_0x5a6644['push'](_0x5a6644['shift']());}};_0x3a2a5d(++_0x45d612);}(_0x77f1,0x1dd));var _0x177f=function(_0x1bc602,_0x3d10e0){_0x1bc602=_0x1bc602-0x0;var _0x502f97=_0x77f1[_0x1bc602];return _0x502f97;};'use strict';var Sequelize=require('sequelize');module[_0x177f('0x0')]={'name':{'type':Sequelize[_0x177f('0x1')],'allowNull':![],'unique':_0x177f('0x2')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x5cec85){return'system-'+this[_0x177f('0x3')](_0x177f('0x2'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0x177f('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0x177f('0x4')]}}; \ No newline at end of file +var _0x00cd=['STRING','name','VIRTUAL','system-','getDataValue','INTEGER','sequelize'];(function(_0x32b30c,_0x2d5ec8){var _0xcfc212=function(_0x42e668){while(--_0x42e668){_0x32b30c['push'](_0x32b30c['shift']());}};_0xcfc212(++_0x2d5ec8);}(_0x00cd,0x1cd));var _0xd00c=function(_0x24875d,_0x4fb24d){_0x24875d=_0x24875d-0x0;var _0x181471=_0x00cd[_0x24875d];return _0x181471;};'use strict';var Sequelize=require(_0xd00c('0x0'));module['exports']={'name':{'type':Sequelize[_0xd00c('0x1')],'allowNull':![],'unique':_0xd00c('0x2')},'prefix':{'type':Sequelize[_0xd00c('0x3')],'get':function(_0x4a6bac){return _0xd00c('0x4')+this[_0xd00c('0x5')](_0xd00c('0x2'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0xd00c('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0xd00c('0x6')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 67042d5..65e4a55 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 _0x7054=['addAgents','omit','ids','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','getAgents','findOne','User','nolimit','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','util','path','sox','to-csv','squel','crypto','jsforce','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','defaults','localhost','redis','register','sendStatus','status','end','json','count','offset','set','apply','reject','save','update','then','destroy','get','VoicePrefixes','UserProfileResource','error','stack','name','send','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','VoicePrefix','includeAll','findAll','rows','catch','show','params','include','find','describe','create','sequelize','transaction','body','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','system','description','priority','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtension','bulkCreate','Extensions\x20creation\x20failed','prefix','callerIdAll','push','PREFIX-CALLERIDALL=','No\x20callerid\x20available','${EXTEN:','charAt','findById'];(function(_0x5121b2,_0x3911bd){var _0x5ee728=function(_0x18cefa){while(--_0x18cefa){_0x5121b2['push'](_0x5121b2['shift']());}};_0x5ee728(++_0x3911bd);}(_0x7054,0xf3));var _0x4705=function(_0x26d678,_0x273258){_0x26d678=_0x26d678-0x0;var _0x4ad538=_0x7054[_0x26d678];return _0x4ad538;};'use strict';var pdf=require(_0x4705('0x0'));var emlformat=require(_0x4705('0x1'));var rimraf=require(_0x4705('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4705('0x3'));var rp=require(_0x4705('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4705('0x5'));var path=require(_0x4705('0x6'));var sox=require(_0x4705('0x7'));var csv=require(_0x4705('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x4705('0x9'));var crypto=require(_0x4705('0xa'));var jsforce=require(_0x4705('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4705('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x4705('0xd'));var as=require(_0x4705('0xe'));var hardwareService=require(_0x4705('0xf'));var logger=require(_0x4705('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x4705('0x11'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x4705('0x12')](config['redis'],{'host':_0x4705('0x13'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4705('0x14')]));require('./voicePrefix.socket')[_0x4705('0x15')](socket);function respondWithStatusCode(_0x453822,_0x2e1bc9){_0x2e1bc9=_0x2e1bc9||0xcc;return function(_0x36e0a8){if(_0x36e0a8){return _0x453822[_0x4705('0x16')](_0x2e1bc9);}return _0x453822[_0x4705('0x17')](_0x2e1bc9)[_0x4705('0x18')]();};}function respondWithResult(_0x5696bd,_0x57a272){_0x57a272=_0x57a272||0xc8;return function(_0x14f1ee){if(_0x14f1ee){return _0x5696bd[_0x4705('0x17')](_0x57a272)[_0x4705('0x19')](_0x14f1ee);}};}function respondWithFilteredResult(_0x486601,_0x2dca8e){return function(_0x267239){if(_0x267239){var _0x2af992=_0x267239[_0x4705('0x1a')],_0x5bff4e=_0x2dca8e[_0x4705('0x1b')],_0x8dd6d4=_0x2dca8e[_0x4705('0x1b')]+_0x2dca8e['limit'],_0x173d8c;if(_0x8dd6d4>=_0x2af992){_0x8dd6d4=_0x2af992;_0x173d8c=0xc8;}else{_0x173d8c=0xce;}_0x486601[_0x4705('0x17')](_0x173d8c);return _0x486601[_0x4705('0x1c')]('Content-Range',_0x5bff4e+'-'+_0x8dd6d4+'/'+_0x2af992)[_0x4705('0x19')](_0x267239);}return null;};}function patchUpdates(_0x43e85a){return function(_0x6c274){try{jsonpatch[_0x4705('0x1d')](_0x6c274,_0x43e85a,!![]);}catch(_0x216ff1){return BPromise[_0x4705('0x1e')](_0x216ff1);}return _0x6c274[_0x4705('0x1f')]();};}function saveUpdates(_0x373a0a,_0x446d83){return function(_0x174b3){if(_0x174b3){return _0x174b3[_0x4705('0x20')](_0x373a0a)[_0x4705('0x21')](function(_0x2d7609){return _0x2d7609;});}return null;};}function removeEntity(_0x22a7cf,_0x5e0bcd){return function(_0x22753d){if(_0x22753d){return _0x22753d[_0x4705('0x22')]()[_0x4705('0x21')](function(){var _0x43ef4b=_0x22753d[_0x4705('0x23')]({'plain':!![]});var _0x143893=_0x4705('0x24');return db[_0x4705('0x25')]['destroy']({'where':{'type':_0x143893,'resourceId':_0x43ef4b['id']}})['then'](function(){return _0x22753d;});})[_0x4705('0x21')](function(){_0x22a7cf[_0x4705('0x17')](0xcc)[_0x4705('0x18')]();});}};}function handleEntityNotFound(_0x23cee7,_0x19b58c){return function(_0x231a62){if(!_0x231a62){_0x23cee7[_0x4705('0x16')](0x194);}return _0x231a62;};}function handleError(_0x3cc9d4,_0x15f71f){_0x15f71f=_0x15f71f||0x1f4;return function(_0x11f487){logger[_0x4705('0x26')](_0x11f487[_0x4705('0x27')]);if(_0x11f487[_0x4705('0x28')]){delete _0x11f487[_0x4705('0x28')];}_0x3cc9d4[_0x4705('0x17')](_0x15f71f)[_0x4705('0x29')](_0x11f487);};}exports['index']=function(_0x59dfd2,_0x2f914b){var _0x3fd2ca={},_0x188922={},_0x530c97={'count':0x0,'rows':[]};var _0x53d6ad=_['map'](db['VoicePrefix']['rawAttributes'],function(_0x417d14){return{'name':_0x417d14['fieldName'],'type':_0x417d14[_0x4705('0x2a')][_0x4705('0x2b')]};});_0x188922['model']=_['map'](_0x53d6ad,'name');_0x188922[_0x4705('0x2c')]=_[_0x4705('0x2d')](_0x59dfd2['query']);_0x188922[_0x4705('0x2e')]=_['intersection'](_0x188922[_0x4705('0x2f')],_0x188922[_0x4705('0x2c')]);_0x3fd2ca[_0x4705('0x30')]=_[_0x4705('0x31')](_0x188922[_0x4705('0x2f')],qs[_0x4705('0x32')](_0x59dfd2[_0x4705('0x2c')][_0x4705('0x32')]));_0x3fd2ca['attributes']=_0x3fd2ca[_0x4705('0x30')][_0x4705('0x33')]?_0x3fd2ca[_0x4705('0x30')]:_0x188922[_0x4705('0x2f')];if(!_0x59dfd2[_0x4705('0x2c')][_0x4705('0x34')]('nolimit')){_0x3fd2ca[_0x4705('0x35')]=qs[_0x4705('0x35')](_0x59dfd2[_0x4705('0x2c')][_0x4705('0x35')]);_0x3fd2ca[_0x4705('0x1b')]=qs[_0x4705('0x1b')](_0x59dfd2[_0x4705('0x2c')][_0x4705('0x1b')]);}_0x3fd2ca[_0x4705('0x36')]=qs[_0x4705('0x37')](_0x59dfd2[_0x4705('0x2c')][_0x4705('0x37')]);_0x3fd2ca[_0x4705('0x38')]=qs[_0x4705('0x2e')](_[_0x4705('0x39')](_0x59dfd2[_0x4705('0x2c')],_0x188922['filters']));if(_0x59dfd2[_0x4705('0x2c')][_0x4705('0x3a')]){_0x3fd2ca['where']=_[_0x4705('0x3b')](_0x3fd2ca[_0x4705('0x38')],{'$or':_[_0x4705('0x3c')](_0x53d6ad,function(_0x2d1d6b){if(_0x2d1d6b[_0x4705('0x2a')]!==_0x4705('0x3d')){var _0x9743bf={};_0x9743bf[_0x2d1d6b[_0x4705('0x28')]]={'$like':'%'+_0x59dfd2[_0x4705('0x2c')][_0x4705('0x3a')]+'%'};return _0x9743bf;}})});}_0x3fd2ca=_[_0x4705('0x3b')]({},_0x3fd2ca,_0x59dfd2[_0x4705('0x3e')]);var _0x688457={'where':_0x3fd2ca['where']};return db[_0x4705('0x3f')]['count'](_0x688457)['then'](function(_0x516fbe){_0x530c97[_0x4705('0x1a')]=_0x516fbe;if(_0x59dfd2[_0x4705('0x2c')][_0x4705('0x40')]){_0x3fd2ca['include']=[{'all':!![]}];}return db[_0x4705('0x3f')][_0x4705('0x41')](_0x3fd2ca);})[_0x4705('0x21')](function(_0x199dcc){_0x530c97[_0x4705('0x42')]=_0x199dcc;return _0x530c97;})[_0x4705('0x21')](respondWithFilteredResult(_0x2f914b,_0x3fd2ca))[_0x4705('0x43')](handleError(_0x2f914b,null));};exports[_0x4705('0x44')]=function(_0x56ee9a,_0x22a29d){var _0x3eced6={'raw':![],'where':{'id':_0x56ee9a[_0x4705('0x45')]['id']}},_0x5dc411={};_0x5dc411[_0x4705('0x2f')]=_['keys'](db[_0x4705('0x3f')]['rawAttributes']);_0x5dc411['query']=_['keys'](_0x56ee9a[_0x4705('0x2c')]);_0x5dc411[_0x4705('0x2e')]=_[_0x4705('0x31')](_0x5dc411[_0x4705('0x2f')],_0x5dc411[_0x4705('0x2c')]);_0x3eced6[_0x4705('0x30')]=_['intersection'](_0x5dc411[_0x4705('0x2f')],qs[_0x4705('0x32')](_0x56ee9a['query']['fields']));_0x3eced6[_0x4705('0x30')]=_0x3eced6['attributes'][_0x4705('0x33')]?_0x3eced6[_0x4705('0x30')]:_0x5dc411[_0x4705('0x2f')];if(_0x56ee9a[_0x4705('0x2c')][_0x4705('0x40')]){_0x3eced6[_0x4705('0x46')]=[{'all':!![]}];}_0x3eced6=_[_0x4705('0x3b')]({},_0x3eced6,_0x56ee9a[_0x4705('0x3e')]);return db[_0x4705('0x3f')][_0x4705('0x47')](_0x3eced6)[_0x4705('0x21')](handleEntityNotFound(_0x22a29d,null))[_0x4705('0x21')](respondWithResult(_0x22a29d,null))['catch'](handleError(_0x22a29d,null));};exports['destroy']=function(_0x2bf44b,_0xdaa58){return db[_0x4705('0x3f')]['find']({'where':{'id':_0x2bf44b[_0x4705('0x45')]['id']}})[_0x4705('0x21')](handleEntityNotFound(_0xdaa58,null))[_0x4705('0x21')](removeEntity(_0xdaa58,null))[_0x4705('0x43')](handleError(_0xdaa58,null));};exports[_0x4705('0x48')]=function(_0x2978d1,_0x1dd9fc){return db[_0x4705('0x3f')][_0x4705('0x48')]()[_0x4705('0x21')](respondWithResult(_0x1dd9fc,null))[_0x4705('0x43')](handleError(_0x1dd9fc,null));};exports[_0x4705('0x49')]=function(_0x49df6c,_0x1c830f){var _0x51a846;return db[_0x4705('0x4a')][_0x4705('0x4b')](function(_0x2fd7ea){return db[_0x4705('0x3f')][_0x4705('0x49')](_0x49df6c[_0x4705('0x4c')],{'transaction':_0x2fd7ea})[_0x4705('0x21')](function(_0x23b01a){_0x51a846=_0x23b01a[_0x4705('0x23')]({'plain':!![]});return db['VoiceExtension'][_0x4705('0x47')]({'where':{'id':_0x51a846[_0x4705('0x4d')]},'raw':!![]})[_0x4705('0x21')](function(_0x33cb8d){return createVoicePrefixExtensions(_0x51a846,_0x33cb8d,_0x2fd7ea);});});})[_0x4705('0x21')](function(){var _0x2d2e6b=_0x49df6c[_0x4705('0x4e')][_0x4705('0x23')]({'plain':!![]});if(!_0x2d2e6b)throw new Error(_0x4705('0x4f'));if(_0x2d2e6b[_0x4705('0x50')]===_0x4705('0x4e')){var _0x3d92bd=_0x51a846;return db[_0x4705('0x51')][_0x4705('0x47')]({'where':{'name':_0x4705('0x24'),'userProfileId':_0x2d2e6b[_0x4705('0x52')]},'raw':!![]})[_0x4705('0x21')](function(_0x384197){if(_0x384197&&_0x384197[_0x4705('0x53')]===0x0){return db['UserProfileResource'][_0x4705('0x49')]({'name':_0x3d92bd[_0x4705('0x28')],'resourceId':_0x3d92bd['id'],'type':_0x384197[_0x4705('0x28')],'sectionId':_0x384197['id']},{})[_0x4705('0x21')](function(){return _0x51a846;});}else{return _0x51a846;}})[_0x4705('0x43')](function(_0x2db1ba){logger['error'](_0x4705('0x54'),_0x2db1ba);throw _0x2db1ba;});}return _0x51a846;})['then'](respondWithResult(_0x1c830f,null))[_0x4705('0x43')](handleError(_0x1c830f,null));};function Extension(_0x2160db,_0x3520cf,_0x4e8f68,_0x4b4720){this[_0x4705('0x55')]=_0x4705('0x56');this[_0x4705('0x57')]=_0x2160db;this['app']=_0x4e8f68;this[_0x4705('0x2a')]=_0x4705('0x58');this[_0x4705('0x59')]='Voice\x20Prefix\x20Extension';this[_0x4705('0x5a')]=_0x3520cf;this['appdata']=_0x4b4720;}function createVoicePrefixExtensions(_0x4aa7f2,_0x1fe723,_0x89e836){return new BPromise(function(_0x474c12,_0xbf928d){var _0x223c19=new Extension(formatPrefixName(_0x4aa7f2['prefix']),0x1,_0x4705('0x5b'),_0x4705('0x5c'));_0x223c19[_0x4705('0x5d')]=_0x4aa7f2['id'];return db[_0x4705('0x5e')]['create'](_0x223c19,{'transaction':_0x89e836})[_0x4705('0x21')](function(_0x3cc50e){var _0x4ddaec=_0x3cc50e[_0x4705('0x23')]({'plain':!![]});var _0x3d7f52=_[_0x4705('0x3c')](addVoicePrefixExtensions(_0x4aa7f2,_0x1fe723),function(_0x9ff2ed){_0x9ff2ed[_0x4705('0x4d')]=_0x4ddaec['id'];_0x9ff2ed[_0x4705('0x5d')]=_0x4aa7f2['id'];return _0x9ff2ed;});return db[_0x4705('0x5e')][_0x4705('0x5f')](_0x3d7f52,{'transaction':_0x89e836})[_0x4705('0x21')](function(_0x2a96c5){if(!_0x2a96c5){return _0xbf928d(_0x4705('0x60'));}else{return _0x474c12(_0x2a96c5);}})[_0x4705('0x43')](function(_0x31baab){return _0xbf928d(_0x31baab);});});;});};function addVoicePrefixExtensions(_0x1a9f69,_0x1fa270){var _0x35c06d=[];var _0x4ec33e=formatPrefixName(_0x1a9f69[_0x4705('0x61')]);_0x35c06d['push'](new Extension(_0x4ec33e,0x2,'Set','CDR(prefix)='+_0x1a9f69[_0x4705('0x28')]));if(_0x1a9f69[_0x4705('0x62')]){_0x35c06d[_0x4705('0x63')](new Extension(_0x4ec33e,0x3,'Set',_0x4705('0x64')+_0x1a9f69[_0x4705('0x62')]));}else{_0x35c06d[_0x4705('0x63')](new Extension(_0x4ec33e,0x3,_0x4705('0x5b'),_0x4705('0x65')));}_0x35c06d[_0x4705('0x63')](new Extension(_0x4ec33e,0x4,'goto',_0x1fa270[_0x4705('0x55')]+','+_0x4705('0x66')+(0x8+_0x1a9f69[_0x4705('0x28')][_0x4705('0x33')])+'}'+','+0x1));return _0x35c06d;}function formatPrefixName(_0x5aa7b1){var _0x55a899='_';for(var _0x15a7bd=0x0;_0x15a7bd<_0x5aa7b1[_0x4705('0x33')];_0x15a7bd++){if(_0x5aa7b1[_0x4705('0x67')](_0x15a7bd)=='-'){_0x55a899+=_0x5aa7b1['charAt'](_0x15a7bd);}else{_0x55a899+='['+_0x5aa7b1[_0x4705('0x67')](_0x15a7bd)+']';}}_0x55a899+='.';return _0x55a899;}exports[_0x4705('0x20')]=function(_0x38b4e0,_0x98b115,_0x48d216){var _0x578a80=_0x38b4e0[_0x4705('0x4c')];_0x578a80[_0x4705('0x61')]='system-'+_0x578a80[_0x4705('0x28')]+'-';return db[_0x4705('0x4a')]['transaction'](function(_0x57c256){return db['VoicePrefix'][_0x4705('0x20')](_0x578a80,{'where':{'id':_0x578a80['id']},'transaction':_0x57c256})['then'](function(){return db['VoiceExtension']['destroy']({'where':{'VoicePrefixId':_0x578a80['id']},'transaction':_0x57c256})[_0x4705('0x21')](function(){return db[_0x4705('0x5e')]['find']({'where':{'id':_0x578a80[_0x4705('0x4d')]},'raw':!![]})[_0x4705('0x21')](function(_0x4c7c7c){return createVoicePrefixExtensions(_0x578a80,_0x4c7c7c,_0x57c256);});});});})[_0x4705('0x21')](function(){return db[_0x4705('0x3f')][_0x4705('0x68')](_0x578a80['id']);})[_0x4705('0x21')](respondWithResult(_0x98b115,null))[_0x4705('0x43')](handleError(_0x98b115,null));};exports[_0x4705('0x69')]=function(_0x4210c0,_0x340959,_0x3a0c62){return db[_0x4705('0x3f')][_0x4705('0x47')]({'where':{'id':_0x4210c0[_0x4705('0x45')]['id']}})['then'](handleEntityNotFound(_0x340959,null))[_0x4705('0x21')](function(_0x5d6e1f){if(_0x5d6e1f){return _0x5d6e1f[_0x4705('0x69')](_0x4210c0[_0x4705('0x4c')]['ids'],_[_0x4705('0x6a')](_0x4210c0[_0x4705('0x4c')],[_0x4705('0x6b'),'id'])||{})['spread'](function(_0x43d734){for(var _0x2702e3=0x0;_0x2702e3<_0x4210c0[_0x4705('0x4c')][_0x4705('0x6b')][_0x4705('0x33')];_0x2702e3+=0x1){socket[_0x4705('0x6c')](_0x4705('0x6d'),{'UserId':_0x4210c0['body'][_0x4705('0x6b')][_0x2702e3],'VoicePrefixId':_0x4210c0[_0x4705('0x45')]['id']});}return _0x43d734;});}})[_0x4705('0x21')](respondWithResult(_0x340959,null))[_0x4705('0x43')](handleError(_0x340959,null));};exports[_0x4705('0x6e')]=function(_0x1c9141,_0x2e924f,_0x2b5d94){return db['VoicePrefix'][_0x4705('0x47')]({'where':{'id':_0x1c9141[_0x4705('0x45')]['id']}})[_0x4705('0x21')](handleEntityNotFound(_0x2e924f,null))['then'](function(_0x3ebb41){if(_0x3ebb41){return _0x3ebb41[_0x4705('0x6e')](_0x1c9141[_0x4705('0x2c')][_0x4705('0x6b')])['then'](function(){if(_['isArray'](_0x1c9141[_0x4705('0x2c')]['ids'])){for(var _0x5d26a6=0x0;_0x5d26a6<_0x1c9141[_0x4705('0x2c')][_0x4705('0x6b')][_0x4705('0x33')];_0x5d26a6+=0x1){socket[_0x4705('0x6c')](_0x4705('0x6f'),{'UserId':Number(_0x1c9141[_0x4705('0x2c')][_0x4705('0x6b')][_0x5d26a6]),'VoicePrefixId':Number(_0x1c9141['params']['id'])});}}else{socket[_0x4705('0x6c')](_0x4705('0x6f'),{'UserId':Number(_0x1c9141[_0x4705('0x2c')]['ids']),'VoicePrefixId':Number(_0x1c9141[_0x4705('0x45')]['id'])});}});}})[_0x4705('0x21')](respondWithStatusCode(_0x2e924f,null))[_0x4705('0x43')](handleError(_0x2e924f,null));};exports[_0x4705('0x70')]=function(_0x367665,_0x4f1254,_0x59fdfb){var _0x4c07ed={};var _0x221bb4={};var _0x342c6a;var _0x314037;return db['VoicePrefix'][_0x4705('0x71')]({'where':{'id':_0x367665[_0x4705('0x45')]['id']}})[_0x4705('0x21')](handleEntityNotFound(_0x4f1254,null))[_0x4705('0x21')](function(_0x273412){if(_0x273412){_0x342c6a=_0x273412;_0x221bb4[_0x4705('0x2f')]=_[_0x4705('0x2d')](db[_0x4705('0x72')]['rawAttributes']);_0x221bb4[_0x4705('0x2c')]=_[_0x4705('0x2d')](_0x367665[_0x4705('0x2c')]);_0x221bb4['filters']=_[_0x4705('0x31')](_0x221bb4[_0x4705('0x2f')],_0x221bb4[_0x4705('0x2c')]);_0x4c07ed[_0x4705('0x30')]=_[_0x4705('0x31')](_0x221bb4[_0x4705('0x2f')],qs[_0x4705('0x32')](_0x367665[_0x4705('0x2c')][_0x4705('0x32')]));_0x4c07ed[_0x4705('0x30')]=_0x4c07ed[_0x4705('0x30')][_0x4705('0x33')]?_0x4c07ed[_0x4705('0x30')]:_0x221bb4[_0x4705('0x2f')];_0x4c07ed[_0x4705('0x36')]=qs[_0x4705('0x37')](_0x367665[_0x4705('0x2c')][_0x4705('0x37')]);_0x4c07ed[_0x4705('0x38')]=qs[_0x4705('0x2e')](_[_0x4705('0x39')](_0x367665[_0x4705('0x2c')],_0x221bb4['filters']));if(_0x367665[_0x4705('0x2c')][_0x4705('0x3a')]){_0x4c07ed['where']=_[_0x4705('0x3b')](_0x4c07ed[_0x4705('0x38')],{'$or':_[_0x4705('0x3c')](_0x4c07ed['attributes'],function(_0x2a470f){var _0x4b2a1a={};_0x4b2a1a[_0x2a470f]={'$like':'%'+_0x367665[_0x4705('0x2c')][_0x4705('0x3a')]+'%'};return _0x4b2a1a;})});}_0x4c07ed=_[_0x4705('0x3b')]({},_0x4c07ed,_0x367665[_0x4705('0x3e')]);return _0x342c6a[_0x4705('0x70')](_0x4c07ed);}})['then'](function(_0x3fd994){if(_0x3fd994){_0x314037=_0x3fd994['length'];if(!_0x367665[_0x4705('0x2c')][_0x4705('0x34')](_0x4705('0x73'))){_0x4c07ed[_0x4705('0x35')]=qs[_0x4705('0x35')](_0x367665[_0x4705('0x2c')][_0x4705('0x35')]);_0x4c07ed[_0x4705('0x1b')]=qs[_0x4705('0x1b')](_0x367665[_0x4705('0x2c')][_0x4705('0x1b')]);}return _0x342c6a['getAgents'](_0x4c07ed);}})[_0x4705('0x21')](function(_0x156f63){if(_0x156f63){return _0x156f63?{'count':_0x314037,'rows':_0x156f63}:null;}})[_0x4705('0x21')](respondWithResult(_0x4f1254,null))[_0x4705('0x43')](handleError(_0x4f1254,null));}; \ No newline at end of file +var _0xa67f=['PREFIX-CALLERIDALL=','callerIdAll','No\x20callerid\x20available','goto','${EXTEN:','charAt','body','system-','sequelize','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','rawAttributes','nolimit','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','sendStatus','status','end','count','offset','limit','Content-Range','json','reject','save','update','then','destroy','get','UserProfileResource','name','index','map','VoicePrefix','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','options','find','params','describe','transaction','create','VoiceExtension','user','role','UserProfileSection','VoicePrefixes','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','app','system','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set'];(function(_0x11f416,_0x49b1e5){var _0x518c03=function(_0x4d0c0f){while(--_0x4d0c0f){_0x11f416['push'](_0x11f416['shift']());}};_0x518c03(++_0x49b1e5);}(_0xa67f,0x173));var _0xfa67=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xa67f[_0x50a0c2];return _0x5ebadd;};'use strict';var pdf=require(_0xfa67('0x0'));var emlformat=require(_0xfa67('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfa67('0x2'));var rp=require(_0xfa67('0x3'));var moment=require(_0xfa67('0x4'));var BPromise=require(_0xfa67('0x5'));var Mustache=require(_0xfa67('0x6'));var util=require('util');var path=require(_0xfa67('0x7'));var sox=require(_0xfa67('0x8'));var csv=require(_0xfa67('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xfa67('0xa'));var squel=require(_0xfa67('0xb'));var crypto=require(_0xfa67('0xc'));var jsforce=require(_0xfa67('0xd'));var deskjs=require(_0xfa67('0xe'));var toCsv=require(_0xfa67('0x9'));var querystring=require('querystring');var Papa=require(_0xfa67('0xf'));var Redis=require(_0xfa67('0x10'));var authService=require(_0xfa67('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfa67('0x12'));var logger=require('../../config/logger')(_0xfa67('0x13'));var utils=require(_0xfa67('0x14'));var config=require('../../config/environment');var db=require(_0xfa67('0x15'))['db'];config[_0xfa67('0x16')]=_[_0xfa67('0x17')](config[_0xfa67('0x16')],{'host':_0xfa67('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfa67('0x16')]));require('./voicePrefix.socket')['register'](socket);function respondWithStatusCode(_0x77582b,_0x5002da){_0x5002da=_0x5002da||0xcc;return function(_0x48209b){if(_0x48209b){return _0x77582b[_0xfa67('0x19')](_0x5002da);}return _0x77582b[_0xfa67('0x1a')](_0x5002da)[_0xfa67('0x1b')]();};}function respondWithResult(_0x1d7043,_0x156ee8){_0x156ee8=_0x156ee8||0xc8;return function(_0xcf57eb){if(_0xcf57eb){return _0x1d7043['status'](_0x156ee8)['json'](_0xcf57eb);}};}function respondWithFilteredResult(_0x3e9a2c,_0x3d18f9){return function(_0x31ec3f){if(_0x31ec3f){var _0x48cccc=_0x31ec3f[_0xfa67('0x1c')],_0x5a7346=_0x3d18f9[_0xfa67('0x1d')],_0x4f3ea8=_0x3d18f9[_0xfa67('0x1d')]+_0x3d18f9[_0xfa67('0x1e')],_0x40afa0;if(_0x4f3ea8>=_0x48cccc){_0x4f3ea8=_0x48cccc;_0x40afa0=0xc8;}else{_0x40afa0=0xce;}_0x3e9a2c[_0xfa67('0x1a')](_0x40afa0);return _0x3e9a2c['set'](_0xfa67('0x1f'),_0x5a7346+'-'+_0x4f3ea8+'/'+_0x48cccc)[_0xfa67('0x20')](_0x31ec3f);}return null;};}function patchUpdates(_0x4e5e5f){return function(_0x45d97c){try{jsonpatch['apply'](_0x45d97c,_0x4e5e5f,!![]);}catch(_0x35cf15){return BPromise[_0xfa67('0x21')](_0x35cf15);}return _0x45d97c[_0xfa67('0x22')]();};}function saveUpdates(_0x2b1460,_0x3f6473){return function(_0x4c250f){if(_0x4c250f){return _0x4c250f[_0xfa67('0x23')](_0x2b1460)[_0xfa67('0x24')](function(_0x4fb7a4){return _0x4fb7a4;});}return null;};}function removeEntity(_0x3f0f6a,_0x2a7b11){return function(_0x871d02){if(_0x871d02){return _0x871d02[_0xfa67('0x25')]()[_0xfa67('0x24')](function(){var _0x5d76d4=_0x871d02[_0xfa67('0x26')]({'plain':!![]});var _0x15eaf8='VoicePrefixes';return db[_0xfa67('0x27')][_0xfa67('0x25')]({'where':{'type':_0x15eaf8,'resourceId':_0x5d76d4['id']}})[_0xfa67('0x24')](function(){return _0x871d02;});})[_0xfa67('0x24')](function(){_0x3f0f6a[_0xfa67('0x1a')](0xcc)[_0xfa67('0x1b')]();});}};}function handleEntityNotFound(_0x506e59,_0x30a251){return function(_0x33c896){if(!_0x33c896){_0x506e59[_0xfa67('0x19')](0x194);}return _0x33c896;};}function handleError(_0x2a5709,_0x581a4b){_0x581a4b=_0x581a4b||0x1f4;return function(_0x3678c7){logger['error'](_0x3678c7['stack']);if(_0x3678c7[_0xfa67('0x28')]){delete _0x3678c7[_0xfa67('0x28')];}_0x2a5709[_0xfa67('0x1a')](_0x581a4b)['send'](_0x3678c7);};}exports[_0xfa67('0x29')]=function(_0x3bba38,_0x3105b6){var _0xae0f1d={},_0x220138={},_0x4b2de8={'count':0x0,'rows':[]};var _0x1793f7=_[_0xfa67('0x2a')](db[_0xfa67('0x2b')]['rawAttributes'],function(_0x51fe5c){return{'name':_0x51fe5c['fieldName'],'type':_0x51fe5c[_0xfa67('0x2c')][_0xfa67('0x2d')]};});_0x220138['model']=_[_0xfa67('0x2a')](_0x1793f7,_0xfa67('0x28'));_0x220138['query']=_[_0xfa67('0x2e')](_0x3bba38[_0xfa67('0x2f')]);_0x220138[_0xfa67('0x30')]=_[_0xfa67('0x31')](_0x220138[_0xfa67('0x32')],_0x220138['query']);_0xae0f1d[_0xfa67('0x33')]=_[_0xfa67('0x31')](_0x220138[_0xfa67('0x32')],qs[_0xfa67('0x34')](_0x3bba38[_0xfa67('0x2f')][_0xfa67('0x34')]));_0xae0f1d[_0xfa67('0x33')]=_0xae0f1d[_0xfa67('0x33')][_0xfa67('0x35')]?_0xae0f1d[_0xfa67('0x33')]:_0x220138[_0xfa67('0x32')];if(!_0x3bba38[_0xfa67('0x2f')][_0xfa67('0x36')]('nolimit')){_0xae0f1d['limit']=qs[_0xfa67('0x1e')](_0x3bba38[_0xfa67('0x2f')][_0xfa67('0x1e')]);_0xae0f1d[_0xfa67('0x1d')]=qs['offset'](_0x3bba38[_0xfa67('0x2f')][_0xfa67('0x1d')]);}_0xae0f1d[_0xfa67('0x37')]=qs['sort'](_0x3bba38[_0xfa67('0x2f')][_0xfa67('0x38')]);_0xae0f1d[_0xfa67('0x39')]=qs[_0xfa67('0x30')](_[_0xfa67('0x3a')](_0x3bba38[_0xfa67('0x2f')],_0x220138['filters']));if(_0x3bba38[_0xfa67('0x2f')][_0xfa67('0x3b')]){_0xae0f1d['where']=_[_0xfa67('0x3c')](_0xae0f1d[_0xfa67('0x39')],{'$or':_['map'](_0x1793f7,function(_0x1c5d71){if(_0x1c5d71[_0xfa67('0x2c')]!==_0xfa67('0x3d')){var _0x1f13af={};_0x1f13af[_0x1c5d71['name']]={'$like':'%'+_0x3bba38[_0xfa67('0x2f')]['filter']+'%'};return _0x1f13af;}})});}_0xae0f1d=_[_0xfa67('0x3c')]({},_0xae0f1d,_0x3bba38['options']);var _0x37e996={'where':_0xae0f1d['where']};return db[_0xfa67('0x2b')][_0xfa67('0x1c')](_0x37e996)[_0xfa67('0x24')](function(_0x250d09){_0x4b2de8[_0xfa67('0x1c')]=_0x250d09;if(_0x3bba38[_0xfa67('0x2f')][_0xfa67('0x3e')]){_0xae0f1d[_0xfa67('0x3f')]=[{'all':!![]}];}return db['VoicePrefix'][_0xfa67('0x40')](_0xae0f1d);})[_0xfa67('0x24')](function(_0x372fcd){_0x4b2de8['rows']=_0x372fcd;return _0x4b2de8;})[_0xfa67('0x24')](respondWithFilteredResult(_0x3105b6,_0xae0f1d))[_0xfa67('0x41')](handleError(_0x3105b6,null));};exports[_0xfa67('0x42')]=function(_0x4fafd3,_0x155320){var _0xe02b0d={'raw':![],'where':{'id':_0x4fafd3['params']['id']}},_0x19d820={};_0x19d820[_0xfa67('0x32')]=_[_0xfa67('0x2e')](db['VoicePrefix']['rawAttributes']);_0x19d820[_0xfa67('0x2f')]=_[_0xfa67('0x2e')](_0x4fafd3[_0xfa67('0x2f')]);_0x19d820[_0xfa67('0x30')]=_[_0xfa67('0x31')](_0x19d820[_0xfa67('0x32')],_0x19d820['query']);_0xe02b0d[_0xfa67('0x33')]=_[_0xfa67('0x31')](_0x19d820[_0xfa67('0x32')],qs['fields'](_0x4fafd3[_0xfa67('0x2f')][_0xfa67('0x34')]));_0xe02b0d[_0xfa67('0x33')]=_0xe02b0d[_0xfa67('0x33')][_0xfa67('0x35')]?_0xe02b0d['attributes']:_0x19d820[_0xfa67('0x32')];if(_0x4fafd3[_0xfa67('0x2f')]['includeAll']){_0xe02b0d['include']=[{'all':!![]}];}_0xe02b0d=_[_0xfa67('0x3c')]({},_0xe02b0d,_0x4fafd3[_0xfa67('0x43')]);return db[_0xfa67('0x2b')][_0xfa67('0x44')](_0xe02b0d)[_0xfa67('0x24')](handleEntityNotFound(_0x155320,null))[_0xfa67('0x24')](respondWithResult(_0x155320,null))['catch'](handleError(_0x155320,null));};exports[_0xfa67('0x25')]=function(_0x4ab2b6,_0x16b5fd){return db[_0xfa67('0x2b')][_0xfa67('0x44')]({'where':{'id':_0x4ab2b6[_0xfa67('0x45')]['id']}})['then'](handleEntityNotFound(_0x16b5fd,null))[_0xfa67('0x24')](removeEntity(_0x16b5fd,null))['catch'](handleError(_0x16b5fd,null));};exports[_0xfa67('0x46')]=function(_0x4576c2,_0x2098dd){return db[_0xfa67('0x2b')][_0xfa67('0x46')]()[_0xfa67('0x24')](respondWithResult(_0x2098dd,null))[_0xfa67('0x41')](handleError(_0x2098dd,null));};exports['create']=function(_0x50f39d,_0x2efa0b){var _0x121bdb;return db['sequelize'][_0xfa67('0x47')](function(_0x35356a){return db[_0xfa67('0x2b')][_0xfa67('0x48')](_0x50f39d['body'],{'transaction':_0x35356a})[_0xfa67('0x24')](function(_0x291e97){_0x121bdb=_0x291e97[_0xfa67('0x26')]({'plain':!![]});return db[_0xfa67('0x49')][_0xfa67('0x44')]({'where':{'id':_0x121bdb['VoiceExtensionId']},'raw':!![]})[_0xfa67('0x24')](function(_0x2da5f1){return createVoicePrefixExtensions(_0x121bdb,_0x2da5f1,_0x35356a);});});})['then'](function(){var _0x414f79=_0x50f39d[_0xfa67('0x4a')][_0xfa67('0x26')]({'plain':!![]});if(!_0x414f79)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x414f79[_0xfa67('0x4b')]==='user'){var _0x19b58b=_0x121bdb;return db[_0xfa67('0x4c')]['find']({'where':{'name':_0xfa67('0x4d'),'userProfileId':_0x414f79['userProfileId']},'raw':!![]})[_0xfa67('0x24')](function(_0x46624d){if(_0x46624d&&_0x46624d['autoAssociation']===0x0){return db[_0xfa67('0x27')][_0xfa67('0x48')]({'name':_0x19b58b[_0xfa67('0x28')],'resourceId':_0x19b58b['id'],'type':_0x46624d['name'],'sectionId':_0x46624d['id']},{})['then'](function(){return _0x121bdb;});}else{return _0x121bdb;}})[_0xfa67('0x41')](function(_0x2f7cc3){logger['error'](_0xfa67('0x4e'),_0x2f7cc3);throw _0x2f7cc3;});}return _0x121bdb;})[_0xfa67('0x24')](respondWithResult(_0x2efa0b,null))['catch'](handleError(_0x2efa0b,null));};function Extension(_0x491cae,_0x151120,_0x3affe3,_0x336ebe){this[_0xfa67('0x4f')]=_0xfa67('0x50');this['exten']=_0x491cae;this[_0xfa67('0x51')]=_0x3affe3;this[_0xfa67('0x2c')]=_0xfa67('0x52');this['description']='Voice\x20Prefix\x20Extension';this[_0xfa67('0x53')]=_0x151120;this[_0xfa67('0x54')]=_0x336ebe;}function createVoicePrefixExtensions(_0x3e6c22,_0x40d807,_0x534589){return new BPromise(function(_0xac3061,_0x22a556){var _0x125d1c=new Extension(formatPrefixName(_0x3e6c22[_0xfa67('0x55')]),0x1,_0xfa67('0x56'),_0xfa67('0x57'));_0x125d1c[_0xfa67('0x58')]=_0x3e6c22['id'];return db['VoiceExtension'][_0xfa67('0x48')](_0x125d1c,{'transaction':_0x534589})['then'](function(_0x3ed5b9){var _0x38a567=_0x3ed5b9[_0xfa67('0x26')]({'plain':!![]});var _0xb9eb47=_[_0xfa67('0x2a')](addVoicePrefixExtensions(_0x3e6c22,_0x40d807),function(_0x2cc675){_0x2cc675['VoiceExtensionId']=_0x38a567['id'];_0x2cc675[_0xfa67('0x58')]=_0x3e6c22['id'];return _0x2cc675;});return db[_0xfa67('0x49')][_0xfa67('0x59')](_0xb9eb47,{'transaction':_0x534589})[_0xfa67('0x24')](function(_0x3034f2){if(!_0x3034f2){return _0x22a556(_0xfa67('0x5a'));}else{return _0xac3061(_0x3034f2);}})[_0xfa67('0x41')](function(_0x30fc25){return _0x22a556(_0x30fc25);});});;});};function addVoicePrefixExtensions(_0x466516,_0xb23e20){var _0x598588=[];var _0x3c3b1e=formatPrefixName(_0x466516[_0xfa67('0x55')]);_0x598588['push'](new Extension(_0x3c3b1e,0x2,'Set','CDR(prefix)='+_0x466516[_0xfa67('0x28')]));if(_0x466516['callerIdAll']){_0x598588[_0xfa67('0x5b')](new Extension(_0x3c3b1e,0x3,_0xfa67('0x5c'),_0xfa67('0x5d')+_0x466516[_0xfa67('0x5e')]));}else{_0x598588[_0xfa67('0x5b')](new Extension(_0x3c3b1e,0x3,_0xfa67('0x56'),_0xfa67('0x5f')));}_0x598588['push'](new Extension(_0x3c3b1e,0x4,_0xfa67('0x60'),_0xb23e20['context']+','+_0xfa67('0x61')+(0x8+_0x466516[_0xfa67('0x28')][_0xfa67('0x35')])+'}'+','+0x1));return _0x598588;}function formatPrefixName(_0x384a0b){var _0x6a3c09='_';for(var _0x57e468=0x0;_0x57e468<_0x384a0b['length'];_0x57e468++){if(_0x384a0b['charAt'](_0x57e468)=='-'){_0x6a3c09+=_0x384a0b[_0xfa67('0x62')](_0x57e468);}else{_0x6a3c09+='['+_0x384a0b[_0xfa67('0x62')](_0x57e468)+']';}}_0x6a3c09+='.';return _0x6a3c09;}exports['update']=function(_0x280aee,_0x587254,_0x538b27){var _0x3b7a0d=_0x280aee[_0xfa67('0x63')];_0x3b7a0d[_0xfa67('0x55')]=_0xfa67('0x64')+_0x3b7a0d[_0xfa67('0x28')]+'-';return db[_0xfa67('0x65')]['transaction'](function(_0x272b4a){return db[_0xfa67('0x2b')][_0xfa67('0x23')](_0x3b7a0d,{'where':{'id':_0x3b7a0d['id']},'transaction':_0x272b4a})[_0xfa67('0x24')](function(){return db['VoiceExtension']['destroy']({'where':{'VoicePrefixId':_0x3b7a0d['id']},'transaction':_0x272b4a})['then'](function(){return db['VoiceExtension'][_0xfa67('0x44')]({'where':{'id':_0x3b7a0d['VoiceExtensionId']},'raw':!![]})[_0xfa67('0x24')](function(_0x394695){return createVoicePrefixExtensions(_0x3b7a0d,_0x394695,_0x272b4a);});});});})['then'](function(){return db[_0xfa67('0x2b')]['findById'](_0x3b7a0d['id']);})[_0xfa67('0x24')](respondWithResult(_0x587254,null))['catch'](handleError(_0x587254,null));};exports[_0xfa67('0x66')]=function(_0x2180cf,_0x562b55,_0xab917f){return db[_0xfa67('0x2b')]['find']({'where':{'id':_0x2180cf[_0xfa67('0x45')]['id']}})[_0xfa67('0x24')](handleEntityNotFound(_0x562b55,null))[_0xfa67('0x24')](function(_0x2b73b2){if(_0x2b73b2){return _0x2b73b2[_0xfa67('0x66')](_0x2180cf[_0xfa67('0x63')][_0xfa67('0x67')],_[_0xfa67('0x68')](_0x2180cf[_0xfa67('0x63')],[_0xfa67('0x67'),'id'])||{})[_0xfa67('0x69')](function(_0xe52fa7){for(var _0x3dba65=0x0;_0x3dba65<_0x2180cf['body'][_0xfa67('0x67')][_0xfa67('0x35')];_0x3dba65+=0x1){socket[_0xfa67('0x6a')](_0xfa67('0x6b'),{'UserId':_0x2180cf['body'][_0xfa67('0x67')][_0x3dba65],'VoicePrefixId':_0x2180cf[_0xfa67('0x45')]['id']});}return _0xe52fa7;});}})['then'](respondWithResult(_0x562b55,null))[_0xfa67('0x41')](handleError(_0x562b55,null));};exports[_0xfa67('0x6c')]=function(_0x49655f,_0x3a5941,_0x4d3984){return db[_0xfa67('0x2b')][_0xfa67('0x44')]({'where':{'id':_0x49655f[_0xfa67('0x45')]['id']}})[_0xfa67('0x24')](handleEntityNotFound(_0x3a5941,null))[_0xfa67('0x24')](function(_0x56f41f){if(_0x56f41f){return _0x56f41f[_0xfa67('0x6c')](_0x49655f[_0xfa67('0x2f')][_0xfa67('0x67')])[_0xfa67('0x24')](function(){if(_[_0xfa67('0x6d')](_0x49655f['query'][_0xfa67('0x67')])){for(var _0x16d6ef=0x0;_0x16d6ef<_0x49655f[_0xfa67('0x2f')]['ids']['length'];_0x16d6ef+=0x1){socket[_0xfa67('0x6a')]('userVoicePrefix:remove',{'UserId':Number(_0x49655f[_0xfa67('0x2f')][_0xfa67('0x67')][_0x16d6ef]),'VoicePrefixId':Number(_0x49655f['params']['id'])});}}else{socket[_0xfa67('0x6a')](_0xfa67('0x6e'),{'UserId':Number(_0x49655f[_0xfa67('0x2f')]['ids']),'VoicePrefixId':Number(_0x49655f[_0xfa67('0x45')]['id'])});}});}})[_0xfa67('0x24')](respondWithStatusCode(_0x3a5941,null))[_0xfa67('0x41')](handleError(_0x3a5941,null));};exports[_0xfa67('0x6f')]=function(_0x220693,_0x211beb,_0x218b64){var _0x52beb1={};var _0x4a79fd={};var _0x258fc9;var _0x2e6410;return db['VoicePrefix'][_0xfa67('0x70')]({'where':{'id':_0x220693[_0xfa67('0x45')]['id']}})['then'](handleEntityNotFound(_0x211beb,null))[_0xfa67('0x24')](function(_0x3c7e5c){if(_0x3c7e5c){_0x258fc9=_0x3c7e5c;_0x4a79fd['model']=_[_0xfa67('0x2e')](db[_0xfa67('0x71')][_0xfa67('0x72')]);_0x4a79fd[_0xfa67('0x2f')]=_[_0xfa67('0x2e')](_0x220693['query']);_0x4a79fd[_0xfa67('0x30')]=_[_0xfa67('0x31')](_0x4a79fd['model'],_0x4a79fd[_0xfa67('0x2f')]);_0x52beb1[_0xfa67('0x33')]=_[_0xfa67('0x31')](_0x4a79fd['model'],qs[_0xfa67('0x34')](_0x220693[_0xfa67('0x2f')]['fields']));_0x52beb1[_0xfa67('0x33')]=_0x52beb1['attributes'][_0xfa67('0x35')]?_0x52beb1['attributes']:_0x4a79fd[_0xfa67('0x32')];_0x52beb1[_0xfa67('0x37')]=qs[_0xfa67('0x38')](_0x220693[_0xfa67('0x2f')][_0xfa67('0x38')]);_0x52beb1[_0xfa67('0x39')]=qs[_0xfa67('0x30')](_[_0xfa67('0x3a')](_0x220693['query'],_0x4a79fd[_0xfa67('0x30')]));if(_0x220693[_0xfa67('0x2f')][_0xfa67('0x3b')]){_0x52beb1[_0xfa67('0x39')]=_[_0xfa67('0x3c')](_0x52beb1['where'],{'$or':_['map'](_0x52beb1['attributes'],function(_0x80ae86){var _0x3e7326={};_0x3e7326[_0x80ae86]={'$like':'%'+_0x220693[_0xfa67('0x2f')]['filter']+'%'};return _0x3e7326;})});}_0x52beb1=_[_0xfa67('0x3c')]({},_0x52beb1,_0x220693[_0xfa67('0x43')]);return _0x258fc9[_0xfa67('0x6f')](_0x52beb1);}})[_0xfa67('0x24')](function(_0x939dc8){if(_0x939dc8){_0x2e6410=_0x939dc8[_0xfa67('0x35')];if(!_0x220693['query'][_0xfa67('0x36')](_0xfa67('0x73'))){_0x52beb1['limit']=qs[_0xfa67('0x1e')](_0x220693[_0xfa67('0x2f')][_0xfa67('0x1e')]);_0x52beb1['offset']=qs[_0xfa67('0x1d')](_0x220693[_0xfa67('0x2f')][_0xfa67('0x1d')]);}return _0x258fc9[_0xfa67('0x6f')](_0x52beb1);}})[_0xfa67('0x24')](function(_0x2f710f){if(_0x2f710f){return _0x2f710f?{'count':_0x2e6410,'rows':_0x2f710f}:null;}})[_0xfa67('0x24')](respondWithResult(_0x211beb,null))[_0xfa67('0x41')](handleError(_0x211beb,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 18a1a62..c3a7f10 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 _0xedd9=['../../mysqldb','VoicePrefix','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0xedd9,0xfc));var _0x9edd=function(_0x2d0901,_0x40f15b){_0x2d0901=_0x2d0901-0x0;var _0x3ac26d=_0xedd9[_0x2d0901];return _0x3ac26d;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0x9edd('0x0'))['db'][_0x9edd('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x9edd('0x2')](0x0);var events={'afterCreate':_0x9edd('0x3'),'afterUpdate':_0x9edd('0x4'),'afterDestroy':_0x9edd('0x5')};function emitEvent(_0x3e6d3a){return function(_0x36b53f,_0x5943b3,_0x33679f){VoicePrefixEvents[_0x9edd('0x6')](_0x3e6d3a+':'+_0x36b53f['id'],_0x36b53f);VoicePrefixEvents[_0x9edd('0x6')](_0x3e6d3a,_0x36b53f);_0x33679f(null);};}for(var e in events){if(events[_0x9edd('0x7')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0x9edd('0x8')]=VoicePrefixEvents; \ No newline at end of file +var _0x70e0=['emit','events','../../mysqldb','VoicePrefix','update','remove'];(function(_0x493a95,_0x4cfccb){var _0x1cac44=function(_0x4a7ac0){while(--_0x4a7ac0){_0x493a95['push'](_0x493a95['shift']());}};_0x1cac44(++_0x4cfccb);}(_0x70e0,0x17b));var _0x070e=function(_0x4552fd,_0x28c48f){_0x4552fd=_0x4552fd-0x0;var _0x18919d=_0x70e0[_0x4552fd];return _0x18919d;};'use strict';var EventEmitter=require(_0x070e('0x0'));var VoicePrefix=require(_0x070e('0x1'))['db'][_0x070e('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x070e('0x3'),'afterDestroy':_0x070e('0x4')};function emitEvent(_0x277d32){return function(_0x2593e5,_0x5c90fc,_0x7bce9b){VoicePrefixEvents['emit'](_0x277d32+':'+_0x2593e5['id'],_0x2593e5);VoicePrefixEvents[_0x070e('0x5')](_0x277d32,_0x2593e5);_0x7bce9b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index fb8f64f..bc32d46 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 _0xc3b1=['../../config/environment','define','VoicePrefix','voice_prefixes','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4e0174,_0x347ca3){var _0x21b5db=function(_0x2f4b40){while(--_0x2f4b40){_0x4e0174['push'](_0x4e0174['shift']());}};_0x21b5db(++_0x347ca3);}(_0xc3b1,0x1b4));var _0x1c3b=function(_0x327990,_0x33d4fd){_0x327990=_0x327990-0x0;var _0x38f7ea=_0xc3b1[_0x327990];return _0x38f7ea;};'use strict';var _=require('lodash');var util=require(_0x1c3b('0x0'));var logger=require(_0x1c3b('0x1'))(_0x1c3b('0x2'));var moment=require(_0x1c3b('0x3'));var BPromise=require(_0x1c3b('0x4'));var rp=require(_0x1c3b('0x5'));var fs=require('fs');var path=require(_0x1c3b('0x6'));var rimraf=require(_0x1c3b('0x7'));var config=require(_0x1c3b('0x8'));var attributes=require('./voicePrefix.attributes');module['exports']=function(_0x43b299,_0x68ea){return _0x43b299[_0x1c3b('0x9')](_0x1c3b('0xa'),attributes,{'tableName':_0x1c3b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb225=['./voicePrefix.attributes','define','VoicePrefix','voice_prefixes','util','api','moment','request-promise','path','rimraf'];(function(_0x1c8c28,_0x3ee093){var _0x1f59b4=function(_0x29bcc0){while(--_0x29bcc0){_0x1c8c28['push'](_0x1c8c28['shift']());}};_0x1f59b4(++_0x3ee093);}(_0xb225,0xe0));var _0x5b22=function(_0x420d8d,_0x78b67f){_0x420d8d=_0x420d8d-0x0;var _0x4865d7=_0xb225[_0x420d8d];return _0x4865d7;};'use strict';var _=require('lodash');var util=require(_0x5b22('0x0'));var logger=require('../../config/logger')(_0x5b22('0x1'));var moment=require(_0x5b22('0x2'));var BPromise=require('bluebird');var rp=require(_0x5b22('0x3'));var fs=require('fs');var path=require(_0x5b22('0x4'));var rimraf=require(_0x5b22('0x5'));var config=require('../../config/environment');var attributes=require(_0x5b22('0x6'));module['exports']=function(_0x580e0e,_0x17bbac){return _0x580e0e[_0x5b22('0x7')](_0x5b22('0x8'),attributes,{'tableName':_0x5b22('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index 10baf55..f04ec48 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 _0x9a4b=['socket.io-emitter','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost'];(function(_0x29ccbb,_0x202d1c){var _0x3ed49a=function(_0x1e94e7){while(--_0x1e94e7){_0x29ccbb['push'](_0x29ccbb['shift']());}};_0x3ed49a(++_0x202d1c);}(_0x9a4b,0x134));var _0xb9a4=function(_0x43073b,_0x26cd7c){_0x43073b=_0x43073b-0x0;var _0x5210e3=_0x9a4b[_0x43073b];return _0x5210e3;};'use strict';var _=require(_0xb9a4('0x0'));var util=require(_0xb9a4('0x1'));var moment=require(_0xb9a4('0x2'));var BPromise=require(_0xb9a4('0x3'));var rs=require(_0xb9a4('0x4'));var fs=require('fs');var Redis=require(_0xb9a4('0x5'));var db=require(_0xb9a4('0x6'))['db'];var utils=require(_0xb9a4('0x7'));var logger=require(_0xb9a4('0x8'))(_0xb9a4('0x9'));var config=require(_0xb9a4('0xa'));var jayson=require(_0xb9a4('0xb'));var client=jayson[_0xb9a4('0xc')]['http']({'port':0x232a});config['redis']=_[_0xb9a4('0xd')](config[_0xb9a4('0xe')],{'host':_0xb9a4('0xf'),'port':0x18eb});var socket=require(_0xb9a4('0x10'))(new Redis(config[_0xb9a4('0xe')]));require('./voicePrefix.socket')['register'](socket);function respondWithRpcPromise(_0x3a5645,_0x571a4d,_0x7641b5){return new BPromise(function(_0x1643be,_0x5a9ebb){return client['request'](_0x3a5645,_0x7641b5)[_0xb9a4('0x11')](function(_0x58cc90){logger['info'](_0xb9a4('0x12'),_0x571a4d,_0xb9a4('0x13'));logger[_0xb9a4('0x14')](_0xb9a4('0x15'),_0x571a4d,_0xb9a4('0x13'),JSON[_0xb9a4('0x16')](_0x58cc90));if(_0x58cc90[_0xb9a4('0x17')]){if(_0x58cc90[_0xb9a4('0x17')]['code']===0x1f4){logger['error'](_0xb9a4('0x12'),_0x571a4d,_0x58cc90['error'][_0xb9a4('0x18')]);return _0x5a9ebb(_0x58cc90[_0xb9a4('0x17')][_0xb9a4('0x18')]);}logger[_0xb9a4('0x17')]('VoicePrefix,\x20%s,\x20%s',_0x571a4d,_0x58cc90['error'][_0xb9a4('0x18')]);return _0x1643be(_0x58cc90[_0xb9a4('0x17')][_0xb9a4('0x18')]);}else{logger[_0xb9a4('0x19')](_0xb9a4('0x12'),_0x571a4d,_0xb9a4('0x13'));_0x1643be(_0x58cc90[_0xb9a4('0x1a')][_0xb9a4('0x18')]);}})['catch'](function(_0x178738){logger['error'](_0xb9a4('0x12'),_0x571a4d,_0x178738);_0x5a9ebb(_0x178738);});});} \ No newline at end of file +var _0x78b9=['socket.io-emitter','./voicePrefix.socket','register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost'];(function(_0x28c939,_0x110e29){var _0x527fe9=function(_0x1df2a6){while(--_0x1df2a6){_0x28c939['push'](_0x28c939['shift']());}};_0x527fe9(++_0x110e29);}(_0x78b9,0x9a));var _0x978b=function(_0x467887,_0x3a9598){_0x467887=_0x467887-0x0;var _0x2122d7=_0x78b9[_0x467887];return _0x2122d7;};'use strict';var _=require(_0x978b('0x0'));var util=require(_0x978b('0x1'));var moment=require(_0x978b('0x2'));var BPromise=require(_0x978b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x978b('0x4'));var db=require(_0x978b('0x5'))['db'];var utils=require(_0x978b('0x6'));var logger=require(_0x978b('0x7'))(_0x978b('0x8'));var config=require('../../config/environment');var jayson=require(_0x978b('0x9'));var client=jayson[_0x978b('0xa')][_0x978b('0xb')]({'port':0x232a});config[_0x978b('0xc')]=_['defaults'](config[_0x978b('0xc')],{'host':_0x978b('0xd'),'port':0x18eb});var socket=require(_0x978b('0xe'))(new Redis(config['redis']));require(_0x978b('0xf'))[_0x978b('0x10')](socket);function respondWithRpcPromise(_0x43489e,_0x101fe1,_0x190b96){return new BPromise(function(_0x4e5be5,_0x2b3937){return client[_0x978b('0x11')](_0x43489e,_0x190b96)[_0x978b('0x12')](function(_0x3ee190){logger[_0x978b('0x13')](_0x978b('0x14'),_0x101fe1,_0x978b('0x15'));logger[_0x978b('0x16')](_0x978b('0x17'),_0x101fe1,_0x978b('0x15'),JSON['stringify'](_0x3ee190));if(_0x3ee190['error']){if(_0x3ee190[_0x978b('0x18')][_0x978b('0x19')]===0x1f4){logger[_0x978b('0x18')]('VoicePrefix,\x20%s,\x20%s',_0x101fe1,_0x3ee190[_0x978b('0x18')]['message']);return _0x2b3937(_0x3ee190['error'][_0x978b('0x1a')]);}logger['error'](_0x978b('0x14'),_0x101fe1,_0x3ee190['error'][_0x978b('0x1a')]);return _0x4e5be5(_0x3ee190[_0x978b('0x18')][_0x978b('0x1a')]);}else{logger[_0x978b('0x13')](_0x978b('0x14'),_0x101fe1,_0x978b('0x15'));_0x4e5be5(_0x3ee190['result'][_0x978b('0x1a')]);}})[_0x978b('0x1b')](function(_0x36d402){logger['error'](_0x978b('0x14'),_0x101fe1,_0x36d402);_0x2b3937(_0x36d402);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 067b9a5..dbe5422 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 _0x5466=['register','remove','update','emit'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x5466,0x12d));var _0x6546=function(_0x7f04ce,_0x51d650){_0x7f04ce=_0x7f04ce-0x0;var _0x5ee6c7=_0x5466[_0x7f04ce];return _0x5ee6c7;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=['save',_0x6546('0x0'),_0x6546('0x1')];function createListener(_0x5459c7,_0x3e2872){return function(_0x4c708d){_0x3e2872[_0x6546('0x2')](_0x5459c7,_0x4c708d);};}function removeListener(_0x2cd9c7,_0x27e397){return function(){VoicePrefixEvents['removeListener'](_0x2cd9c7,_0x27e397);};}exports[_0x6546('0x3')]=function(_0x5f191c){for(var _0x5db8a6=0x0,_0x3dee21=events['length'];_0x5db8a6<_0x3dee21;_0x5db8a6++){var _0x533ae5=events[_0x5db8a6];var _0x5893a2=createListener('voicePrefix:'+_0x533ae5,_0x5f191c);VoicePrefixEvents['on'](_0x533ae5,_0x5893a2);}}; \ No newline at end of file +var _0x569d=['save','update','emit','register','length','voicePrefix:','./voicePrefix.events'];(function(_0x2e5410,_0x517b85){var _0x3cc1de=function(_0x562fbb){while(--_0x562fbb){_0x2e5410['push'](_0x2e5410['shift']());}};_0x3cc1de(++_0x517b85);}(_0x569d,0x180));var _0xd569=function(_0xaad974,_0x396049){_0xaad974=_0xaad974-0x0;var _0x3801e9=_0x569d[_0xaad974];return _0x3801e9;};'use strict';var VoicePrefixEvents=require(_0xd569('0x0'));var events=[_0xd569('0x1'),'remove',_0xd569('0x2')];function createListener(_0x3b2795,_0x5a3a2d){return function(_0xa998e6){_0x5a3a2d[_0xd569('0x3')](_0x3b2795,_0xa998e6);};}function removeListener(_0x15226d,_0x259a78){return function(){VoicePrefixEvents['removeListener'](_0x15226d,_0x259a78);};}exports[_0xd569('0x4')]=function(_0x28008b){for(var _0x373d5b=0x0,_0x3879b4=events[_0xd569('0x5')];_0x373d5b<_0x3879b4;_0x373d5b++){var _0x5e374e=events[_0x373d5b];var _0x3f365b=createListener(_0xd569('0x6')+_0x5e374e,_0x28008b);VoicePrefixEvents['on'](_0x5e374e,_0x3f365b);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 6f96db9..61d7303 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 _0x8f27=['post','addTeams','put','update','delete','destroy','removeAgents','removeBlackLists','exports','util','path','Router','../../components/auth/service','../../components/interaction/service','./voiceQueue.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','/:id/users','/:id/members','getMembers','/:id/lists','getLists','/:id/blacklists','/:id/clone','clone'];(function(_0x648163,_0x241576){var _0x199d4d=function(_0x23055d){while(--_0x23055d){_0x648163['push'](_0x648163['shift']());}};_0x199d4d(++_0x241576);}(_0x8f27,0x131));var _0x78f2=function(_0x2f4d5f,_0xda7f63){_0x2f4d5f=_0x2f4d5f-0x0;var _0x13dfeb=_0x8f27[_0x2f4d5f];return _0x13dfeb;};'use strict';var multer=require('multer');var util=require(_0x78f2('0x0'));var path=require(_0x78f2('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x78f2('0x2')]();var auth=require(_0x78f2('0x3'));var interaction=require(_0x78f2('0x4'));var config=require('../../config/environment');var controller=require(_0x78f2('0x5'));router[_0x78f2('0x6')]('/',auth[_0x78f2('0x7')](),controller[_0x78f2('0x8')]);router[_0x78f2('0x6')](_0x78f2('0x9'),auth[_0x78f2('0x7')](),controller[_0x78f2('0xa')]);router[_0x78f2('0x6')](_0x78f2('0xb'),auth[_0x78f2('0x7')](),controller[_0x78f2('0xc')]);router[_0x78f2('0x6')](_0x78f2('0xd'),auth[_0x78f2('0x7')](),controller[_0x78f2('0xe')]);router[_0x78f2('0x6')](_0x78f2('0xf'),auth[_0x78f2('0x7')](),controller['getHopperFinals']);router['get'](_0x78f2('0x10'),auth[_0x78f2('0x7')](),controller[_0x78f2('0x11')]);router[_0x78f2('0x6')](_0x78f2('0x12'),auth[_0x78f2('0x7')](),controller[_0x78f2('0x13')]);router[_0x78f2('0x6')](_0x78f2('0x14'),auth[_0x78f2('0x7')](),controller['getAgents']);router[_0x78f2('0x6')](_0x78f2('0x15'),auth['isAuthenticated'](),controller[_0x78f2('0x16')]);router['get'](_0x78f2('0x17'),auth[_0x78f2('0x7')](),controller[_0x78f2('0x18')]);router[_0x78f2('0x6')](_0x78f2('0x19'),auth[_0x78f2('0x7')](),controller['getBlackLists']);router['post']('/',auth[_0x78f2('0x7')](),controller['create']);router['post'](_0x78f2('0x1a'),auth[_0x78f2('0x7')](),controller[_0x78f2('0x1b')]);router[_0x78f2('0x1c')]('/:id/teams',auth[_0x78f2('0x7')](),controller[_0x78f2('0x1d')]);router[_0x78f2('0x1c')]('/:id/users',auth[_0x78f2('0x7')](),controller['addAgents']);router[_0x78f2('0x1c')]('/:id/lists',auth[_0x78f2('0x7')](),controller['addLists']);router['post'](_0x78f2('0x19'),auth[_0x78f2('0x7')](),controller['addBlackLists']);router[_0x78f2('0x1e')](_0x78f2('0x9'),auth[_0x78f2('0x7')](),controller[_0x78f2('0x1f')]);router[_0x78f2('0x20')](_0x78f2('0x9'),auth[_0x78f2('0x7')](),controller[_0x78f2('0x21')]);router[_0x78f2('0x20')]('/:id/teams',auth[_0x78f2('0x7')](),controller['removeTeams']);router[_0x78f2('0x20')](_0x78f2('0x14'),auth[_0x78f2('0x7')](),controller[_0x78f2('0x22')]);router[_0x78f2('0x20')]('/:id/lists',auth['isAuthenticated'](),controller['removeLists']);router['delete'](_0x78f2('0x19'),auth[_0x78f2('0x7')](),controller[_0x78f2('0x23')]);module[_0x78f2('0x24')]=router; \ No newline at end of file +var _0xc32c=['express','Router','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','getTeams','/:id/users','/:id/members','/:id/lists','getLists','create','post','/:id/clone','clone','addTeams','addAgents','/:id/blacklists','/:id','destroy','delete','/:id/teams','removeTeams','removeAgents','removeLists','exports','multer','util','path'];(function(_0x1a096a,_0x43d86a){var _0x24ae8b=function(_0xf9796){while(--_0xf9796){_0x1a096a['push'](_0x1a096a['shift']());}};_0x24ae8b(++_0x43d86a);}(_0xc32c,0x15c));var _0xcc32=function(_0x55daf2,_0x1b48de){_0x55daf2=_0x55daf2-0x0;var _0x1c8500=_0xc32c[_0x55daf2];return _0x1c8500;};'use strict';var multer=require(_0xcc32('0x0'));var util=require(_0xcc32('0x1'));var path=require(_0xcc32('0x2'));var timeout=require('connect-timeout');var express=require(_0xcc32('0x3'));var router=express[_0xcc32('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xcc32('0x5'));var config=require(_0xcc32('0x6'));var controller=require(_0xcc32('0x7'));router[_0xcc32('0x8')]('/',auth[_0xcc32('0x9')](),controller['index']);router[_0xcc32('0x8')]('/:id',auth[_0xcc32('0x9')](),controller[_0xcc32('0xa')]);router['get'](_0xcc32('0xb'),auth[_0xcc32('0x9')](),controller[_0xcc32('0xc')]);router[_0xcc32('0x8')](_0xcc32('0xd'),auth[_0xcc32('0x9')](),controller[_0xcc32('0xe')]);router[_0xcc32('0x8')](_0xcc32('0xf'),auth[_0xcc32('0x9')](),controller[_0xcc32('0x10')]);router['get'](_0xcc32('0x11'),auth[_0xcc32('0x9')](),controller[_0xcc32('0x12')]);router[_0xcc32('0x8')]('/:id/teams',auth[_0xcc32('0x9')](),controller[_0xcc32('0x13')]);router['get'](_0xcc32('0x14'),auth[_0xcc32('0x9')](),controller['getAgents']);router[_0xcc32('0x8')](_0xcc32('0x15'),auth['isAuthenticated'](),controller['getMembers']);router[_0xcc32('0x8')](_0xcc32('0x16'),auth['isAuthenticated'](),controller[_0xcc32('0x17')]);router[_0xcc32('0x8')]('/:id/blacklists',auth['isAuthenticated'](),controller['getBlackLists']);router['post']('/',auth[_0xcc32('0x9')](),controller[_0xcc32('0x18')]);router[_0xcc32('0x19')](_0xcc32('0x1a'),auth[_0xcc32('0x9')](),controller[_0xcc32('0x1b')]);router[_0xcc32('0x19')]('/:id/teams',auth[_0xcc32('0x9')](),controller[_0xcc32('0x1c')]);router['post'](_0xcc32('0x14'),auth[_0xcc32('0x9')](),controller[_0xcc32('0x1d')]);router[_0xcc32('0x19')](_0xcc32('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0xcc32('0x19')](_0xcc32('0x1e'),auth[_0xcc32('0x9')](),controller['addBlackLists']);router['put']('/:id',auth[_0xcc32('0x9')](),controller['update']);router['delete'](_0xcc32('0x1f'),auth[_0xcc32('0x9')](),controller[_0xcc32('0x20')]);router[_0xcc32('0x21')](_0xcc32('0x22'),auth[_0xcc32('0x9')](),controller[_0xcc32('0x23')]);router[_0xcc32('0x21')](_0xcc32('0x14'),auth['isAuthenticated'](),controller[_0xcc32('0x24')]);router[_0xcc32('0x21')](_0xcc32('0x16'),auth[_0xcc32('0x9')](),controller[_0xcc32('0x25')]);router[_0xcc32('0x21')](_0xcc32('0x1e'),auth[_0xcc32('0x9')](),controller['removeBlackLists']);module[_0xcc32('0x26')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index c46a367..4c3b646 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 _0x2020=['#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports','name','ENUM','outbound','inbound','STRING','ringall','leastrecent','fewestcalls','rrmemory','linear','wrandom','rrordered','setDataValue','strategy','getDataValue','type','booked','roundrobin','progressive','predictive','power','INTEGER','yes','once','TEXT','join','periodic_announce','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence'];(function(_0x373ee9,_0x185060){var _0x15670a=function(_0x3d41ec){while(--_0x3d41ec){_0x373ee9['push'](_0x373ee9['shift']());}};_0x15670a(++_0x185060);}(_0x2020,0xe3));var _0x0202=function(_0x17d990,_0x5ea20a){_0x17d990=_0x17d990-0x0;var _0x4112e2=_0x2020[_0x17d990];return _0x4112e2;};'use strict';var Sequelize=require(_0x0202('0x0'));module[_0x0202('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0202('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x0202('0x3')]('inbound',_0x0202('0x4')),'allowNull':![],'defaultValue':_0x0202('0x5')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':'default'},'announce':{'type':Sequelize[_0x0202('0x6')],'defaultValue':''},'strategy':{'type':Sequelize[_0x0202('0x3')]('rr',_0x0202('0x7'),_0x0202('0x8'),_0x0202('0x9'),'random',_0x0202('0xa'),_0x0202('0xb'),_0x0202('0xc'),_0x0202('0xd')),'allowNull':![],'defaultValue':'ringall','set':function(_0x4079e3){this[_0x0202('0xe')](_0x0202('0xf'),_0x4079e3?_0x4079e3:_0x0202('0xa'));},'get':function(){var _0xcb565b=this[_0x0202('0x10')](_0x0202('0x11'));var _0x3d97ca=this[_0x0202('0x10')]('dialMethod');var _0x2338b5=this[_0x0202('0x10')]('strategy');if(_0xcb565b===_0x0202('0x5')){return _0x2338b5;}if(_0x3d97ca===_0x0202('0x12')&&_0x2338b5==='rrmemory'||_0x3d97ca===_0x0202('0x12')&&_0x2338b5===_0x0202('0x13')){return _0x2338b5;}if(_0x3d97ca===_0x0202('0x14')||_0x3d97ca===_0x0202('0x15')||_0x3d97ca===_0x0202('0x16')){return _0x2338b5;}return null;}},'servicelevel':{'type':Sequelize[_0x0202('0x17')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x0202('0x17')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0x0202('0x17')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x0202('0x17')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0x0202('0x18'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0x0202('0x3')](_0x0202('0x18'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x0202('0x17')](0xb)},'autopausebusy':{'type':Sequelize[_0x0202('0x3')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x0202('0x3')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x0202('0x17')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x0202('0x3')](_0x0202('0x18'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x0202('0x18'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x0202('0x18'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0x0202('0x18'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x0202('0x6')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x0202('0x6')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x0202('0x3')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x0202('0x3')](_0x0202('0x18'),'no'),'defaultValue':_0x0202('0x18')},'announce_holdtime':{'type':Sequelize[_0x0202('0x3')]('yes','no',_0x0202('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x0202('0x6')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x0202('0x3')]('yes','no')},'announce_position_limit':{'type':Sequelize[_0x0202('0x17')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x0202('0x6')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x0202('0x6')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x0202('0x6')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x0202('0x6')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x0202('0x6')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x0202('0x6')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x0202('0x6')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x0202('0x6')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x0202('0x6')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0x0202('0x6')]},'queue_quantity2':{'type':Sequelize[_0x0202('0x6')]},'queue_periodic_announce':{'type':Sequelize[_0x0202('0x6')]},'queue_less_than':{'type':Sequelize[_0x0202('0x6')]},'periodic_announce':{'type':Sequelize[_0x0202('0x1a')],'set':function(_0x556ca5){this[_0x0202('0xe')]('periodic_announce',_0x556ca5?_0x556ca5[_0x0202('0x1b')](','):[]);},'get':function(){return this['getDataValue'](_0x0202('0x1c'))?this['getDataValue'](_0x0202('0x1c'))[_0x0202('0x1d')](','):[];}},'joinempty':{'type':Sequelize[_0x0202('0x6')],'defaultValue':_0x0202('0x18'),'set':function(_0x5774d5){this['setDataValue'](_0x0202('0x1e'),_0x5774d5?_0x5774d5[_0x0202('0x1b')](','):[]);},'get':function(){return this['getDataValue'](_0x0202('0x1e'))?this[_0x0202('0x10')](_0x0202('0x1e'))[_0x0202('0x1d')](','):[];}},'leavewhenempty':{'type':Sequelize[_0x0202('0x6')],'defaultValue':'no','set':function(_0x557a74){this[_0x0202('0xe')](_0x0202('0x1f'),_0x557a74?_0x557a74['join'](','):[]);},'get':function(){return this['getDataValue'](_0x0202('0x1f'))?this['getDataValue'](_0x0202('0x1f'))[_0x0202('0x1d')](','):[];}},'reportholdtime':{'type':Sequelize[_0x0202('0x3')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x0202('0x18'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x0202('0x17')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x0202('0x3')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0202('0x6')]},'acw':{'type':Sequelize[_0x0202('0x20')],'defaultValue':0x0,'set':function(_0x255bf6){this['setDataValue'](_0x0202('0x21'),_0x255bf6);if(_0x255bf6){if(this[_0x0202('0x10')](_0x0202('0x22'))<0x2){this['setDataValue'](_0x0202('0x22'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x0202('0x20')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize['ENUM']('preview',_0x0202('0x14'),_0x0202('0x16'),_0x0202('0x15'),'booked'),'defaultValue':_0x0202('0x14'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0x0202('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x0202('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x0202('0x24')},'dialPowerLevel':{'type':Sequelize[_0x0202('0x25')](0x2)[_0x0202('0x23')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0x0202('0x3')](_0x0202('0x26'),'dropRate'),'defaultValue':_0x0202('0x27'),'comment':_0x0202('0x28')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x0202('0x25')](0x2)[_0x0202('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x0202('0x29')},'dialPredictiveInterval':{'type':Sequelize[_0x0202('0x17')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x0202('0x6')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x0202('0x17')](0x3)[_0x0202('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0202('0x2a')},'dialQueueOptions':{'type':Sequelize[_0x0202('0x6')],'defaultValue':_0x0202('0x2b'),'comment':_0x0202('0x2c')},'dialQueueTimeout':{'type':Sequelize[_0x0202('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0202('0x2d')},'dialQueueProject':{'type':Sequelize[_0x0202('0x6')],'comment':_0x0202('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0202('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0202('0x2f')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x0202('0x17')](0x5)[_0x0202('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0202('0x30')},'dialBusyMaxRetry':{'type':Sequelize[_0x0202('0x17')](0x3)[_0x0202('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0202('0x31')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0202('0x17')](0x5)[_0x0202('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0202('0x23')],'defaultValue':0x3,'comment':_0x0202('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0202('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x0202('0x17')](0x3)[_0x0202('0x23')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x0202('0x6')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0202('0x6')],'defaultValue':_0x0202('0x33')},'dialPrefix':{'type':Sequelize[_0x0202('0x6')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x0202('0x3')](_0x0202('0x34'),_0x0202('0x35'),_0x0202('0x36')),'defaultValue':_0x0202('0x34')},'dialAMDActive':{'type':Sequelize[_0x0202('0x20')],'defaultValue':0x0,'comment':_0x0202('0x37')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0202('0x38')},'dialAMDGreeting':{'type':Sequelize[_0x0202('0x17')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0202('0x39')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0202('0x17')](0x9)[_0x0202('0x23')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0202('0x17')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0202('0x3a')},'dialAMDMinWordLength':{'type':Sequelize[_0x0202('0x17')](0x9)[_0x0202('0x23')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0202('0x3b')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x0202('0x3c')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x0202('0x23')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0202('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0202('0x17')](0x9)[_0x0202('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0202('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0x0202('0x17')](0x5)[_0x0202('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x0202('0x3f')},'dialRecallInQueue':{'type':Sequelize[_0x0202('0x20')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0x0202('0x3')](_0x0202('0x40'),_0x0202('0x41')),'defaultValue':_0x0202('0x40')},'dialQueueProject2':{'type':Sequelize[_0x0202('0x6')],'comment':_0x0202('0x2e')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x0202('0x20')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0202('0x17')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0202('0x42')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x0202('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0202('0x43')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0202('0x17')],'allowNull':!![],'comment':_0x0202('0x44')},'mandatoryDisposition':{'type':Sequelize[_0x0202('0x20')],'defaultValue':![],'comment':_0x0202('0x45'),'set':function(_0x47cc1a){if(!_0x47cc1a)this[_0x0202('0xe')]('mandatoryDispositionPauseId',null);this[_0x0202('0xe')](_0x0202('0x46'),_0x47cc1a);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x0202('0x23')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0x6904=['mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','inbound','outbound','default','ringall','leastrecent','random','rrmemory','linear','rrordered','setDataValue','strategy','getDataValue','type','booked','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','split','joinempty','join','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','onlyIfOpen','always','#AMD\x20Initial\x20Silence','#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)','#AMD\x20Maximum\x20Word\x20Length','#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)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x6904,0x136));var _0x4690=function(_0x57add2,_0x4f2b7d){_0x57add2=_0x57add2-0x0;var _0x4e3670=_0x6904[_0x57add2];return _0x4e3670;};'use strict';var Sequelize=require(_0x4690('0x0'));module[_0x4690('0x1')]={'name':{'type':Sequelize[_0x4690('0x2')],'allowNull':![],'unique':_0x4690('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x4690('0x4')](_0x4690('0x5'),_0x4690('0x6')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0x4690('0x2')],'defaultValue':_0x4690('0x7')},'announce':{'type':Sequelize[_0x4690('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x4690('0x4')]('rr',_0x4690('0x8'),_0x4690('0x9'),'fewestcalls',_0x4690('0xa'),_0x4690('0xb'),_0x4690('0xc'),'wrandom',_0x4690('0xd')),'allowNull':![],'defaultValue':_0x4690('0x8'),'set':function(_0x5835ab){this[_0x4690('0xe')](_0x4690('0xf'),_0x5835ab?_0x5835ab:_0x4690('0xb'));},'get':function(){var _0x42edc6=this[_0x4690('0x10')](_0x4690('0x11'));var _0xf593e2=this[_0x4690('0x10')]('dialMethod');var _0x1da804=this[_0x4690('0x10')](_0x4690('0xf'));if(_0x42edc6==='inbound'){return _0x1da804;}if(_0xf593e2===_0x4690('0x12')&&_0x1da804===_0x4690('0xb')||_0xf593e2===_0x4690('0x12')&&_0x1da804==='roundrobin'){return _0x1da804;}if(_0xf593e2==='progressive'||_0xf593e2===_0x4690('0x13')||_0xf593e2===_0x4690('0x14')){return _0x1da804;}return null;}},'servicelevel':{'type':Sequelize[_0x4690('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x4690('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x4690('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x4690('0x15')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x4690('0x2')]},'weight':{'type':Sequelize[_0x4690('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x4690('0x15')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x4690('0x4')](_0x4690('0x16'),'no'),'defaultValue':_0x4690('0x16')},'autopause':{'type':Sequelize[_0x4690('0x4')](_0x4690('0x16'),'no',_0x4690('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x4690('0x15')](0xb)},'autopausebusy':{'type':Sequelize[_0x4690('0x4')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0x4690('0x16'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x4690('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x4690('0x4')](_0x4690('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x4690('0x4')](_0x4690('0x16'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x4690('0x4')](_0x4690('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0x4690('0x16'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x4690('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x4690('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x4690('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x4690('0x4')](_0x4690('0x16'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x4690('0x16'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0x4690('0x4')]('yes','no',_0x4690('0x18')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x4690('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x4690('0x4')](_0x4690('0x16'),'no')},'announce_position_limit':{'type':Sequelize[_0x4690('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x4690('0x2')]},'queue_youarenext':{'type':Sequelize[_0x4690('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x4690('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x4690('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x4690('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x4690('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x4690('0x2')]},'queue_quantity1':{'type':Sequelize[_0x4690('0x2')]},'queue_quantity2':{'type':Sequelize[_0x4690('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x4690('0x2')]},'queue_less_than':{'type':Sequelize[_0x4690('0x2')]},'periodic_announce':{'type':Sequelize[_0x4690('0x19')],'set':function(_0x4769fe){this['setDataValue'](_0x4690('0x1a'),_0x4769fe?_0x4769fe['join'](','):[]);},'get':function(){return this[_0x4690('0x10')](_0x4690('0x1a'))?this[_0x4690('0x10')](_0x4690('0x1a'))[_0x4690('0x1b')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0x4690('0x16'),'set':function(_0x454c78){this['setDataValue'](_0x4690('0x1c'),_0x454c78?_0x454c78[_0x4690('0x1d')](','):[]);},'get':function(){return this[_0x4690('0x10')](_0x4690('0x1c'))?this[_0x4690('0x10')]('joinempty')[_0x4690('0x1b')](','):[];}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x1d8a0e){this[_0x4690('0xe')](_0x4690('0x1e'),_0x1d8a0e?_0x1d8a0e['join'](','):[]);},'get':function(){return this[_0x4690('0x10')](_0x4690('0x1e'))?this[_0x4690('0x10')](_0x4690('0x1e'))[_0x4690('0x1b')](','):[];}},'reportholdtime':{'type':Sequelize[_0x4690('0x4')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x4690('0x4')](_0x4690('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x4690('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0x4690('0x16'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x4690('0x2')]},'description':{'type':Sequelize[_0x4690('0x2')]},'acw':{'type':Sequelize[_0x4690('0x1f')],'defaultValue':0x0,'set':function(_0x175761){this['setDataValue'](_0x4690('0x20'),_0x175761);if(_0x175761){if(this['getDataValue'](_0x4690('0x21'))<0x2){this[_0x4690('0xe')](_0x4690('0x21'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x4690('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x4690('0x1f')],'defaultValue':0x0,'comment':_0x4690('0x22')},'dialMethod':{'type':Sequelize[_0x4690('0x4')](_0x4690('0x23'),_0x4690('0x24'),_0x4690('0x14'),_0x4690('0x13'),_0x4690('0x12')),'defaultValue':'progressive','comment':_0x4690('0x25')},'dialLimitChannel':{'type':Sequelize[_0x4690('0x15')](0x4)[_0x4690('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x4690('0x27')},'dialLimitQueue':{'type':Sequelize[_0x4690('0x15')](0x4)[_0x4690('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x4690('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x4690('0x28')},'dialPredictiveOptimization':{'type':Sequelize[_0x4690('0x4')]('agentBusyFactor',_0x4690('0x29')),'defaultValue':_0x4690('0x29'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x4690('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x4690('0x2a')},'dialPredictiveInterval':{'type':Sequelize[_0x4690('0x15')](0x3)[_0x4690('0x26')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x4690('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize[_0x4690('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x4690('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x4690('0x15')](0x3)[_0x4690('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4690('0x2c')},'dialQueueOptions':{'type':Sequelize[_0x4690('0x2')],'defaultValue':_0x4690('0x2d'),'comment':_0x4690('0x2e')},'dialQueueTimeout':{'type':Sequelize[_0x4690('0x15')](0x3)[_0x4690('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0x4690('0x2f')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4690('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4690('0x30')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x4690('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4690('0x31')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4690('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4690('0x32')},'dialBusyRetryFrequency':{'type':Sequelize[_0x4690('0x15')](0x5)[_0x4690('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4690('0x33')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x4690('0x15')](0x3)[_0x4690('0x26')],'defaultValue':0x3,'comment':_0x4690('0x34')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x4690('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4690('0x35')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x4690('0x36')},'dialTimezone':{'type':Sequelize[_0x4690('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x4690('0x2')],'defaultValue':_0x4690('0x37')},'dialPrefix':{'type':Sequelize[_0x4690('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x4690('0x4')]('always',_0x4690('0x38'),_0x4690('0x39')),'defaultValue':_0x4690('0x3a')},'dialAMDActive':{'type':Sequelize[_0x4690('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x4690('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x4690('0x3b')},'dialAMDGreeting':{'type':Sequelize[_0x4690('0x15')](0x9)[_0x4690('0x26')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x4690('0x3c')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x4690('0x15')](0x9)[_0x4690('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x4690('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4690('0x3d')},'dialAMDMinWordLength':{'type':Sequelize[_0x4690('0x15')](0x9)[_0x4690('0x26')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x4690('0x3e')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x4690('0x26')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x4690('0x3f')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x4690('0x15')](0x9)[_0x4690('0x26')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x4690('0x40')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x4690('0x15')](0x5)[_0x4690('0x26')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x4690('0x41')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x4690('0x15')](0x9)[_0x4690('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4690('0x42')},'dialRecallMeTimeout':{'type':Sequelize[_0x4690('0x15')](0x5)[_0x4690('0x26')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x4690('0x43')},'dialRecallInQueue':{'type':Sequelize[_0x4690('0x1f')],'defaultValue':0x0,'comment':_0x4690('0x44')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x4690('0x45'),_0x4690('0x46')),'defaultValue':_0x4690('0x45')},'dialQueueProject2':{'type':Sequelize[_0x4690('0x2')],'comment':_0x4690('0x2f')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x4690('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x4690('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x4690('0x15')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4690('0x47')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4690('0x48')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4690('0x15')],'allowNull':!![],'comment':_0x4690('0x49')},'mandatoryDisposition':{'type':Sequelize[_0x4690('0x1f')],'defaultValue':![],'comment':_0x4690('0x4a'),'set':function(_0x32d3d2){if(!_0x32d3d2)this[_0x4690('0xe')](_0x4690('0x4b'),null);this[_0x4690('0xe')](_0x4690('0x4c'),_0x32d3d2);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x4690('0x26')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x4690('0x15')](0x3)[_0x4690('0x26')],'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 3ee6966..f11f06c 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 _0x9db7=['rows','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','addTeams','teams','User','Agents','online','interface','flatMap','forEach','penalty','each','UserVoiceQueue','UserVoiceQueueRt','isNil','format','SIP/%s','voicePause','emit','userVoiceQueue:save','removeTeams','Team','ids','select','field','tq.TeamId','from','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','isEmpty','removeAgents','addAgents','upsert','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','NOW()','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','onlyIfOpen','COALESCE(phone,\x27\x27)','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','localhost','redis','register','sendStatus','status','end','json','offset','set','apply','reject','save','update','then','destroy','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value','type','UserProfileResource','stack','name','index','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','VIRTUAL','merge','VoiceQueue','count','includeAll','include','findAll','show','params','keys','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','options','omit','updatedAt','createdAt','error','findOne','CmHopper','order','VoiceQueueId'];(function(_0x373052,_0x1a0475){var _0x3af4f5=function(_0xa5baa7){while(--_0xa5baa7){_0x373052['push'](_0x373052['shift']());}};_0x3af4f5(++_0x1a0475);}(_0x9db7,0x1bf));var _0x79db=function(_0x250efc,_0x1fe85d){_0x250efc=_0x250efc-0x0;var _0x4345bf=_0x9db7[_0x250efc];return _0x4345bf;};'use strict';var pdf=require(_0x79db('0x0'));var emlformat=require(_0x79db('0x1'));var rimraf=require(_0x79db('0x2'));var zipdir=require(_0x79db('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x79db('0x4'));var moment=require('moment');var BPromise=require(_0x79db('0x5'));var Mustache=require(_0x79db('0x6'));var util=require('util');var path=require(_0x79db('0x7'));var sox=require(_0x79db('0x8'));var csv=require(_0x79db('0x9'));var ejs=require(_0x79db('0xa'));var fs=require('fs');var _=require(_0x79db('0xb'));var squel=require(_0x79db('0xc'));var crypto=require(_0x79db('0xd'));var jsforce=require(_0x79db('0xe'));var deskjs=require(_0x79db('0xf'));var toCsv=require(_0x79db('0x9'));var querystring=require(_0x79db('0x10'));var Papa=require(_0x79db('0x11'));var Redis=require('ioredis');var authService=require(_0x79db('0x12'));var qs=require(_0x79db('0x13'));var as=require(_0x79db('0x14'));var hardwareService=require(_0x79db('0x15'));var logger=require(_0x79db('0x16'))(_0x79db('0x17'));var utils=require(_0x79db('0x18'));var config=require(_0x79db('0x19'));var db=require(_0x79db('0x1a'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x79db('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x79db('0x1c')]));require('./voiceQueue.socket')[_0x79db('0x1d')](socket);function respondWithStatusCode(_0x2387d7,_0x9262ee){_0x9262ee=_0x9262ee||0xcc;return function(_0x3ab2cc){if(_0x3ab2cc){return _0x2387d7[_0x79db('0x1e')](_0x9262ee);}return _0x2387d7[_0x79db('0x1f')](_0x9262ee)[_0x79db('0x20')]();};}function respondWithResult(_0x495ec8,_0xa1cc87){_0xa1cc87=_0xa1cc87||0xc8;return function(_0x65ad19){if(_0x65ad19){return _0x495ec8[_0x79db('0x1f')](_0xa1cc87)[_0x79db('0x21')](_0x65ad19);}};}function respondWithFilteredResult(_0x2eeee7,_0x4a9f30){return function(_0x475a77){if(_0x475a77){var _0x43912f=_0x475a77['count'],_0x200c87=_0x4a9f30[_0x79db('0x22')],_0x77f6d0=_0x4a9f30[_0x79db('0x22')]+_0x4a9f30['limit'],_0x2532d4;if(_0x77f6d0>=_0x43912f){_0x77f6d0=_0x43912f;_0x2532d4=0xc8;}else{_0x2532d4=0xce;}_0x2eeee7[_0x79db('0x1f')](_0x2532d4);return _0x2eeee7[_0x79db('0x23')]('Content-Range',_0x200c87+'-'+_0x77f6d0+'/'+_0x43912f)[_0x79db('0x21')](_0x475a77);}return null;};}function patchUpdates(_0x3be8e0){return function(_0x3ac29d){try{jsonpatch[_0x79db('0x24')](_0x3ac29d,_0x3be8e0,!![]);}catch(_0x4c36ae){return BPromise[_0x79db('0x25')](_0x4c36ae);}return _0x3ac29d[_0x79db('0x26')]();};}function saveUpdates(_0x150a6d,_0x3b3ad9){return function(_0x3e8c8b){if(_0x3e8c8b){return _0x3e8c8b[_0x79db('0x27')](_0x150a6d)[_0x79db('0x28')](function(_0x21feec){return _0x21feec;});}return null;};}function removeEntity(_0x25a360,_0x319888){return function(_0x4d319a){if(_0x4d319a){return _0x4d319a[_0x79db('0x29')]()[_0x79db('0x28')](function(){var _0x592c38=_0x4d319a['get']({'plain':!![]});var _0x3d9fb4=[{'name':_0x79db('0x2a'),'value':_0x79db('0x2b'),'ignore':![]},{'name':_0x79db('0x2c'),'value':_0x79db('0x2d'),'ignore':![]}];var _0x3def02=_(_0x3d9fb4)[_0x79db('0x2e')](_0x79db('0x2f'))[_0x79db('0x30')](_0x79db('0x31'))[_0x79db('0x31')]();if(_['includes'](_0x3def02,_0x592c38[_0x79db('0x32')])){return;}var _0x5756b1=_['find'](_0x3d9fb4,[_0x79db('0x31'),_0x592c38[_0x79db('0x32')]])['name'];return db[_0x79db('0x33')][_0x79db('0x29')]({'where':{'type':_0x5756b1,'resourceId':_0x592c38['id']}})[_0x79db('0x28')](function(){return _0x4d319a;});})['then'](function(){_0x25a360[_0x79db('0x1f')](0xcc)[_0x79db('0x20')]();});}};}function handleEntityNotFound(_0x5e6778,_0x835267){return function(_0x2da725){if(!_0x2da725){_0x5e6778[_0x79db('0x1e')](0x194);}return _0x2da725;};}function handleError(_0x2e694e,_0x4b2157){_0x4b2157=_0x4b2157||0x1f4;return function(_0x1202a5){logger['error'](_0x1202a5[_0x79db('0x34')]);if(_0x1202a5['name']){delete _0x1202a5[_0x79db('0x35')];}_0x2e694e[_0x79db('0x1f')](_0x4b2157)['send'](_0x1202a5);};}exports[_0x79db('0x36')]=function(_0x4a63ce,_0x3906ca){var _0x36ba70={},_0x448341={},_0x268561={'count':0x0,'rows':[]};var _0x20551c=_[_0x79db('0x30')](db['VoiceQueue'][_0x79db('0x37')],function(_0x59d8e8){return{'name':_0x59d8e8['fieldName'],'type':_0x59d8e8[_0x79db('0x32')][_0x79db('0x38')]};});_0x448341[_0x79db('0x39')]=_[_0x79db('0x30')](_0x20551c,_0x79db('0x35'));_0x448341[_0x79db('0x3a')]=_['keys'](_0x4a63ce['query']);_0x448341[_0x79db('0x3b')]=_[_0x79db('0x3c')](_0x448341[_0x79db('0x39')],_0x448341['query']);_0x36ba70[_0x79db('0x3d')]=_['intersection'](_0x448341[_0x79db('0x39')],qs[_0x79db('0x3e')](_0x4a63ce[_0x79db('0x3a')][_0x79db('0x3e')]));_0x36ba70[_0x79db('0x3d')]=_0x36ba70[_0x79db('0x3d')][_0x79db('0x3f')]?_0x36ba70[_0x79db('0x3d')]:_0x448341[_0x79db('0x39')];if(!_0x4a63ce[_0x79db('0x3a')][_0x79db('0x40')](_0x79db('0x41'))){_0x36ba70[_0x79db('0x42')]=qs[_0x79db('0x42')](_0x4a63ce[_0x79db('0x3a')][_0x79db('0x42')]);_0x36ba70[_0x79db('0x22')]=qs[_0x79db('0x22')](_0x4a63ce[_0x79db('0x3a')][_0x79db('0x22')]);}_0x36ba70['order']=qs[_0x79db('0x43')](_0x4a63ce[_0x79db('0x3a')][_0x79db('0x43')]);_0x36ba70[_0x79db('0x44')]=qs[_0x79db('0x3b')](_[_0x79db('0x45')](_0x4a63ce[_0x79db('0x3a')],_0x448341[_0x79db('0x3b')]));if(_0x4a63ce[_0x79db('0x3a')]['filter']){_0x36ba70[_0x79db('0x44')]=_['merge'](_0x36ba70[_0x79db('0x44')],{'$or':_[_0x79db('0x30')](_0x20551c,function(_0x539b75){if(_0x539b75[_0x79db('0x32')]!==_0x79db('0x46')){var _0x1090d5={};_0x1090d5[_0x539b75['name']]={'$like':'%'+_0x4a63ce[_0x79db('0x3a')]['filter']+'%'};return _0x1090d5;}})});}_0x36ba70=_[_0x79db('0x47')]({},_0x36ba70,_0x4a63ce['options']);var _0x22ca48={'where':_0x36ba70[_0x79db('0x44')]};return db[_0x79db('0x48')][_0x79db('0x49')](_0x22ca48)[_0x79db('0x28')](function(_0x57de0c){_0x268561['count']=_0x57de0c;if(_0x4a63ce[_0x79db('0x3a')][_0x79db('0x4a')]){_0x36ba70[_0x79db('0x4b')]=[{'all':!![]}];}return db[_0x79db('0x48')][_0x79db('0x4c')](_0x36ba70);})[_0x79db('0x28')](function(_0x946882){_0x268561['rows']=_0x946882;return _0x268561;})[_0x79db('0x28')](respondWithFilteredResult(_0x3906ca,_0x36ba70))['catch'](handleError(_0x3906ca,null));};exports[_0x79db('0x4d')]=function(_0x2b3e40,_0x4610a1){var _0x5f34c9={'raw':![],'where':{'id':_0x2b3e40[_0x79db('0x4e')]['id']}},_0x35d799={};_0x35d799['model']=_[_0x79db('0x4f')](db[_0x79db('0x48')][_0x79db('0x37')]);_0x35d799['query']=_[_0x79db('0x4f')](_0x2b3e40[_0x79db('0x3a')]);_0x35d799['filters']=_[_0x79db('0x3c')](_0x35d799[_0x79db('0x39')],_0x35d799[_0x79db('0x3a')]);_0x5f34c9[_0x79db('0x3d')]=_[_0x79db('0x3c')](_0x35d799[_0x79db('0x39')],qs[_0x79db('0x3e')](_0x2b3e40[_0x79db('0x3a')][_0x79db('0x3e')]));_0x5f34c9[_0x79db('0x3d')]=_0x5f34c9[_0x79db('0x3d')][_0x79db('0x3f')]?_0x5f34c9[_0x79db('0x3d')]:_0x35d799[_0x79db('0x39')];if(_0x2b3e40[_0x79db('0x3a')][_0x79db('0x4a')]){_0x5f34c9[_0x79db('0x4b')]=[{'all':!![]}];}_0x5f34c9=_['merge']({},_0x5f34c9,_0x2b3e40['options']);return db['VoiceQueue'][_0x79db('0x50')](_0x5f34c9)[_0x79db('0x28')](handleEntityNotFound(_0x4610a1,null))[_0x79db('0x28')](respondWithResult(_0x4610a1,null))[_0x79db('0x51')](handleError(_0x4610a1,null));};exports['create']=function(_0x2db464,_0x22eb1a){return db[_0x79db('0x48')][_0x79db('0x52')](_0x2db464[_0x79db('0x53')],{})['then'](function(_0x262663){var _0x430cac=_0x2db464[_0x79db('0x54')][_0x79db('0x55')]({'plain':!![]});if(!_0x430cac)throw new Error(_0x79db('0x56'));if(_0x430cac[_0x79db('0x57')]===_0x79db('0x54')){var _0x69a52e=_0x262663['get']({'plain':!![]});var _0x5b22f1=[{'name':'VoiceQueues','value':_0x79db('0x2b')},{'name':_0x79db('0x2c'),'value':_0x79db('0x2d')}];var _0x14bb46=_['find'](_0x5b22f1,[_0x79db('0x31'),_0x69a52e['type']])[_0x79db('0x35')];return db[_0x79db('0x58')][_0x79db('0x50')]({'where':{'name':_0x14bb46,'userProfileId':_0x430cac[_0x79db('0x59')]},'raw':!![]})['then'](function(_0x346c5f){if(_0x346c5f&&_0x346c5f[_0x79db('0x5a')]===0x0){return db['UserProfileResource'][_0x79db('0x52')]({'name':_0x69a52e['name'],'resourceId':_0x69a52e['id'],'type':_0x346c5f[_0x79db('0x35')],'sectionId':_0x346c5f['id']},{})['then'](function(){return _0x262663;});}else{return _0x262663;}})[_0x79db('0x51')](function(_0x17283d){logger['error'](_0x79db('0x5b'),_0x17283d);throw _0x17283d;});}return _0x262663;})['then'](respondWithResult(_0x22eb1a,0xc9))[_0x79db('0x51')](handleError(_0x22eb1a,null));};exports[_0x79db('0x5c')]=function(_0x4a2889,_0x174945){var _0x2026d7={'where':{'id':_0x4a2889['params']['id']}},_0x1f1f37={};_0x1f1f37[_0x79db('0x39')]=_[_0x79db('0x4f')](db[_0x79db('0x48')][_0x79db('0x37')]);_0x2026d7[_0x79db('0x3d')]=_[_0x79db('0x3c')](_0x1f1f37['model'],qs[_0x79db('0x3e')](_0x4a2889[_0x79db('0x3a')][_0x79db('0x3e')]));_0x2026d7[_0x79db('0x3d')]=_0x2026d7['attributes'][_0x79db('0x3f')]?_0x2026d7[_0x79db('0x3d')]:_0x1f1f37[_0x79db('0x39')];if(_0x4a2889['query'][_0x79db('0x4a')]){_0x2026d7[_0x79db('0x4b')]=[{'all':!![]}];}_0x2026d7=_[_0x79db('0x47')]({},_0x2026d7,_0x4a2889[_0x79db('0x5d')]);return db[_0x79db('0x48')][_0x79db('0x50')](_0x2026d7)[_0x79db('0x28')](handleEntityNotFound(_0x174945,null))[_0x79db('0x28')](function(_0x499f24){if(_0x499f24){var _0x51b691=_0x499f24[_0x79db('0x55')]({'plain':!![]});_0x51b691=qs[_0x79db('0x5e')](_0x51b691,['id','createdAt',_0x79db('0x5f')]);_0x4a2889[_0x79db('0x53')]=_[_0x79db('0x5e')](_0x4a2889['body'],['id',_0x79db('0x60'),_0x79db('0x5f')]);return db[_0x79db('0x48')][_0x79db('0x52')](_['merge'](_0x51b691,_0x4a2889[_0x79db('0x53')]),{'include':_0x4a2889['query'][_0x79db('0x4a')]?[{'all':!![]}]:undefined})[_0x79db('0x28')](function(_0x337f54){var _0x41e0e6=_0x4a2889[_0x79db('0x54')][_0x79db('0x55')]({'plain':!![]});if(!_0x41e0e6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x41e0e6[_0x79db('0x57')]==='user'){var _0x49205f=_0x337f54['get']({'plain':!![]});var _0x1c35fc=[{'name':'VoiceQueues','value':_0x79db('0x2b')},{'name':'QueueCampaigns','value':_0x79db('0x2d')}];var _0x52f0c7=_[_0x79db('0x50')](_0x1c35fc,[_0x79db('0x31'),_0x49205f[_0x79db('0x32')]])[_0x79db('0x35')];return db[_0x79db('0x58')][_0x79db('0x50')]({'where':{'name':_0x52f0c7,'userProfileId':_0x41e0e6[_0x79db('0x59')]},'raw':!![]})[_0x79db('0x28')](function(_0x3fc39f){if(_0x3fc39f&&_0x3fc39f['autoAssociation']===0x0){return db[_0x79db('0x33')][_0x79db('0x52')]({'name':_0x49205f[_0x79db('0x35')],'resourceId':_0x49205f['id'],'type':_0x3fc39f[_0x79db('0x35')],'sectionId':_0x3fc39f['id']},{})[_0x79db('0x28')](function(){return _0x337f54;});}else{return _0x337f54;}})['catch'](function(_0x11e1b6){logger[_0x79db('0x61')](_0x79db('0x5b'),_0x11e1b6);throw _0x11e1b6;});}return _0x337f54;});}})[_0x79db('0x28')](respondWithResult(_0x174945,0xc9))[_0x79db('0x51')](handleError(_0x174945,null));};exports[_0x79db('0x27')]=function(_0x29aaef,_0x3beb7e){if(_0x29aaef['body']['id']){delete _0x29aaef['body']['id'];}return db[_0x79db('0x48')][_0x79db('0x50')]({'where':{'id':_0x29aaef[_0x79db('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3beb7e,null))['then'](saveUpdates(_0x29aaef[_0x79db('0x53')],null))['then'](respondWithResult(_0x3beb7e,null))[_0x79db('0x51')](handleError(_0x3beb7e,null));};exports['destroy']=function(_0x43182c,_0x303a13){return db[_0x79db('0x48')][_0x79db('0x50')]({'where':{'id':_0x43182c[_0x79db('0x4e')]['id']}})[_0x79db('0x28')](handleEntityNotFound(_0x303a13,null))[_0x79db('0x28')](removeEntity(_0x303a13,null))[_0x79db('0x51')](handleError(_0x303a13,null));};exports['getHoppers']=function(_0x3f19a4,_0x4184ee,_0x271506){var _0x29ba92={'raw':![],'where':{}};var _0x14c098={};var _0x36c95e={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x79db('0x62')]({'where':{'id':_0x3f19a4[_0x79db('0x4e')]['id']}})[_0x79db('0x28')](handleEntityNotFound(_0x4184ee,null))[_0x79db('0x28')](function(_0x239a2f){if(_0x239a2f){_0x14c098[_0x79db('0x39')]=_[_0x79db('0x4f')](db[_0x79db('0x63')][_0x79db('0x37')]);_0x14c098[_0x79db('0x3a')]=_[_0x79db('0x4f')](_0x3f19a4[_0x79db('0x3a')]);_0x14c098[_0x79db('0x3b')]=_[_0x79db('0x3c')](_0x14c098[_0x79db('0x39')],_0x14c098[_0x79db('0x3a')]);_0x29ba92['attributes']=_[_0x79db('0x3c')](_0x14c098[_0x79db('0x39')],qs[_0x79db('0x3e')](_0x3f19a4[_0x79db('0x3a')][_0x79db('0x3e')]));_0x29ba92[_0x79db('0x3d')]=_0x29ba92[_0x79db('0x3d')][_0x79db('0x3f')]?_0x29ba92[_0x79db('0x3d')]:_0x14c098[_0x79db('0x39')];if(!_0x3f19a4[_0x79db('0x3a')][_0x79db('0x40')](_0x79db('0x41'))){_0x29ba92[_0x79db('0x42')]=qs[_0x79db('0x42')](_0x3f19a4[_0x79db('0x3a')][_0x79db('0x42')]);_0x29ba92[_0x79db('0x22')]=qs['offset'](_0x3f19a4[_0x79db('0x3a')][_0x79db('0x22')]);}_0x29ba92[_0x79db('0x64')]=qs[_0x79db('0x43')](_0x3f19a4[_0x79db('0x3a')][_0x79db('0x43')]);_0x29ba92['where']=qs[_0x79db('0x3b')](_[_0x79db('0x45')](_0x3f19a4[_0x79db('0x3a')],_0x14c098[_0x79db('0x3b')]));_0x29ba92[_0x79db('0x44')][_0x79db('0x65')]=_0x239a2f['id'];if(_0x3f19a4[_0x79db('0x3a')][_0x79db('0x2e')]){_0x29ba92[_0x79db('0x44')]=_['merge'](_0x29ba92[_0x79db('0x44')],{'$or':_['map'](_0x29ba92[_0x79db('0x3d')],function(_0x37ac87){var _0x5e42fb={};_0x5e42fb[_0x37ac87]={'$like':'%'+_0x3f19a4[_0x79db('0x3a')][_0x79db('0x2e')]+'%'};return _0x5e42fb;})});}_0x29ba92=_['merge']({},_0x29ba92,_0x3f19a4[_0x79db('0x5d')]);return db['CmHopper'][_0x79db('0x49')]({'where':_0x29ba92[_0x79db('0x44')]})[_0x79db('0x28')](function(_0x5ef25a){_0x36c95e[_0x79db('0x49')]=_0x5ef25a;if(_0x3f19a4['query'][_0x79db('0x4a')]){_0x29ba92['include']=[{'all':!![]}];}return db[_0x79db('0x63')]['findAll'](_0x29ba92);})[_0x79db('0x28')](function(_0x2dc5c4){_0x36c95e[_0x79db('0x66')]=_0x2dc5c4;return _0x36c95e;});}})[_0x79db('0x28')](respondWithFilteredResult(_0x4184ee,_0x29ba92))['catch'](handleError(_0x4184ee,null));};exports['getHopperHistories']=function(_0x444121,_0x4dd10c,_0x2150d5){var _0xe7a6eb={'raw':!![],'where':{}};var _0x5cf085={};var _0x10962e={'count':0x0,'rows':[]};return db[_0x79db('0x48')]['findOne']({'where':{'id':_0x444121[_0x79db('0x4e')]['id']}})[_0x79db('0x28')](handleEntityNotFound(_0x4dd10c,null))[_0x79db('0x28')](function(_0x22a5e8){if(_0x22a5e8){_0x5cf085[_0x79db('0x39')]=_[_0x79db('0x4f')](db['CmHopperHistory'][_0x79db('0x37')]);_0x5cf085[_0x79db('0x3a')]=_[_0x79db('0x4f')](_0x444121['query']);_0x5cf085['filters']=_[_0x79db('0x3c')](_0x5cf085[_0x79db('0x39')],_0x5cf085[_0x79db('0x3a')]);_0xe7a6eb[_0x79db('0x3d')]=_[_0x79db('0x3c')](_0x5cf085[_0x79db('0x39')],qs[_0x79db('0x3e')](_0x444121[_0x79db('0x3a')][_0x79db('0x3e')]));_0xe7a6eb[_0x79db('0x3d')]=_0xe7a6eb[_0x79db('0x3d')][_0x79db('0x3f')]?_0xe7a6eb[_0x79db('0x3d')]:_0x5cf085['model'];if(!_0x444121[_0x79db('0x3a')][_0x79db('0x40')]('nolimit')){_0xe7a6eb[_0x79db('0x42')]=qs[_0x79db('0x42')](_0x444121[_0x79db('0x3a')][_0x79db('0x42')]);_0xe7a6eb[_0x79db('0x22')]=qs[_0x79db('0x22')](_0x444121[_0x79db('0x3a')][_0x79db('0x22')]);}_0xe7a6eb[_0x79db('0x64')]=qs['sort'](_0x444121[_0x79db('0x3a')][_0x79db('0x43')]);_0xe7a6eb[_0x79db('0x44')]=qs[_0x79db('0x3b')](_['pick'](_0x444121[_0x79db('0x3a')],_0x5cf085[_0x79db('0x3b')]));_0xe7a6eb['where']['VoiceQueueId']=_0x22a5e8['id'];if(_0x444121['query']['filter']){_0xe7a6eb[_0x79db('0x44')]=_[_0x79db('0x47')](_0xe7a6eb['where'],{'$or':_[_0x79db('0x30')](_0xe7a6eb[_0x79db('0x3d')],function(_0x39d828){var _0x250173={};_0x250173[_0x39d828]={'$like':'%'+_0x444121[_0x79db('0x3a')][_0x79db('0x2e')]+'%'};return _0x250173;})});}_0xe7a6eb=_[_0x79db('0x47')]({},_0xe7a6eb,_0x444121[_0x79db('0x5d')]);return db[_0x79db('0x67')]['count']({'where':_0xe7a6eb[_0x79db('0x44')]})['then'](function(_0x4c9d1c){_0x10962e[_0x79db('0x49')]=_0x4c9d1c;if(_0x444121[_0x79db('0x3a')][_0x79db('0x4a')]){_0xe7a6eb[_0x79db('0x4b')]=[{'all':!![]}];}return db[_0x79db('0x67')]['findAll'](_0xe7a6eb);})[_0x79db('0x28')](function(_0x117eba){_0x10962e[_0x79db('0x66')]=_0x117eba;return _0x10962e;});}})[_0x79db('0x28')](respondWithFilteredResult(_0x4dd10c,_0xe7a6eb))['catch'](handleError(_0x4dd10c,null));};exports[_0x79db('0x68')]=function(_0x5682e5,_0x5ae803,_0x472a43){var _0x66f6f1={'raw':!![],'where':{}};var _0x281741={};var _0x44c027={'count':0x0,'rows':[]};return db[_0x79db('0x48')][_0x79db('0x62')]({'where':{'id':_0x5682e5['params']['id']}})['then'](handleEntityNotFound(_0x5ae803,null))['then'](function(_0x497bb9){if(_0x497bb9){_0x281741['model']=_[_0x79db('0x4f')](db[_0x79db('0x69')][_0x79db('0x37')]);_0x281741[_0x79db('0x3a')]=_['keys'](_0x5682e5[_0x79db('0x3a')]);_0x281741[_0x79db('0x3b')]=_[_0x79db('0x3c')](_0x281741[_0x79db('0x39')],_0x281741[_0x79db('0x3a')]);_0x66f6f1[_0x79db('0x3d')]=_[_0x79db('0x3c')](_0x281741['model'],qs['fields'](_0x5682e5[_0x79db('0x3a')]['fields']));_0x66f6f1['attributes']=_0x66f6f1[_0x79db('0x3d')][_0x79db('0x3f')]?_0x66f6f1[_0x79db('0x3d')]:_0x281741[_0x79db('0x39')];if(!_0x5682e5[_0x79db('0x3a')]['hasOwnProperty'](_0x79db('0x41'))){_0x66f6f1[_0x79db('0x42')]=qs[_0x79db('0x42')](_0x5682e5['query'][_0x79db('0x42')]);_0x66f6f1[_0x79db('0x22')]=qs[_0x79db('0x22')](_0x5682e5[_0x79db('0x3a')]['offset']);}_0x66f6f1[_0x79db('0x64')]=qs[_0x79db('0x43')](_0x5682e5[_0x79db('0x3a')][_0x79db('0x43')]);_0x66f6f1[_0x79db('0x44')]=qs[_0x79db('0x3b')](_[_0x79db('0x45')](_0x5682e5['query'],_0x281741[_0x79db('0x3b')]));_0x66f6f1['where'][_0x79db('0x65')]=_0x497bb9['id'];if(_0x5682e5[_0x79db('0x3a')][_0x79db('0x2e')]){_0x66f6f1[_0x79db('0x44')]=_[_0x79db('0x47')](_0x66f6f1[_0x79db('0x44')],{'$or':_[_0x79db('0x30')](_0x66f6f1['attributes'],function(_0xe1512b){var _0x434b86={};_0x434b86[_0xe1512b]={'$like':'%'+_0x5682e5['query'][_0x79db('0x2e')]+'%'};return _0x434b86;})});}_0x66f6f1=_[_0x79db('0x47')]({},_0x66f6f1,_0x5682e5[_0x79db('0x5d')]);return db[_0x79db('0x69')]['count']({'where':_0x66f6f1['where']})[_0x79db('0x28')](function(_0x32fc29){_0x44c027[_0x79db('0x49')]=_0x32fc29;if(_0x5682e5['query']['includeAll']){_0x66f6f1[_0x79db('0x4b')]=[{'all':!![]}];}return db[_0x79db('0x69')]['findAll'](_0x66f6f1);})[_0x79db('0x28')](function(_0x432369){_0x44c027[_0x79db('0x66')]=_0x432369;return _0x44c027;});}})['then'](respondWithFilteredResult(_0x5ae803,_0x66f6f1))[_0x79db('0x51')](handleError(_0x5ae803,null));};exports[_0x79db('0x6a')]=function(_0x4b0f45,_0xea9f2b,_0x211728){var _0x239988={'raw':!![],'where':{}};var _0x4fd29b={};var _0x4563b8={'count':0x0,'rows':[]};return db[_0x79db('0x48')][_0x79db('0x62')]({'where':{'id':_0x4b0f45[_0x79db('0x4e')]['id']}})[_0x79db('0x28')](handleEntityNotFound(_0xea9f2b,null))[_0x79db('0x28')](function(_0x18d1e6){if(_0x18d1e6){_0x4fd29b[_0x79db('0x39')]=_[_0x79db('0x4f')](db[_0x79db('0x6b')][_0x79db('0x37')]);_0x4fd29b[_0x79db('0x3a')]=_['keys'](_0x4b0f45[_0x79db('0x3a')]);_0x4fd29b[_0x79db('0x3b')]=_[_0x79db('0x3c')](_0x4fd29b[_0x79db('0x39')],_0x4fd29b['query']);_0x239988[_0x79db('0x3d')]=_[_0x79db('0x3c')](_0x4fd29b[_0x79db('0x39')],qs[_0x79db('0x3e')](_0x4b0f45['query'][_0x79db('0x3e')]));_0x239988[_0x79db('0x3d')]=_0x239988['attributes'][_0x79db('0x3f')]?_0x239988['attributes']:_0x4fd29b[_0x79db('0x39')];if(!_0x4b0f45[_0x79db('0x3a')][_0x79db('0x40')](_0x79db('0x41'))){_0x239988[_0x79db('0x42')]=qs[_0x79db('0x42')](_0x4b0f45[_0x79db('0x3a')][_0x79db('0x42')]);_0x239988['offset']=qs[_0x79db('0x22')](_0x4b0f45[_0x79db('0x3a')]['offset']);}_0x239988[_0x79db('0x64')]=qs['sort'](_0x4b0f45[_0x79db('0x3a')]['sort']);_0x239988[_0x79db('0x44')]=qs[_0x79db('0x3b')](_[_0x79db('0x45')](_0x4b0f45[_0x79db('0x3a')],_0x4fd29b[_0x79db('0x3b')]));_0x239988[_0x79db('0x44')]['VoiceQueueId']=_0x18d1e6['id'];if(_0x4b0f45[_0x79db('0x3a')][_0x79db('0x2e')]){_0x239988[_0x79db('0x44')]=_[_0x79db('0x47')](_0x239988[_0x79db('0x44')],{'$or':_[_0x79db('0x30')](_0x239988[_0x79db('0x3d')],function(_0x2a67fc){var _0x7a88dd={};_0x7a88dd[_0x2a67fc]={'$like':'%'+_0x4b0f45[_0x79db('0x3a')][_0x79db('0x2e')]+'%'};return _0x7a88dd;})});}_0x239988=_[_0x79db('0x47')]({},_0x239988,_0x4b0f45[_0x79db('0x5d')]);return db[_0x79db('0x6b')][_0x79db('0x49')]({'where':_0x239988['where']})[_0x79db('0x28')](function(_0x14b8ef){_0x4563b8[_0x79db('0x49')]=_0x14b8ef;if(_0x4b0f45[_0x79db('0x3a')][_0x79db('0x4a')]){_0x239988[_0x79db('0x4b')]=[{'all':!![]}];}return db[_0x79db('0x6b')][_0x79db('0x4c')](_0x239988);})[_0x79db('0x28')](function(_0x13616f){_0x4563b8[_0x79db('0x66')]=_0x13616f;return _0x4563b8;});}})[_0x79db('0x28')](respondWithFilteredResult(_0xea9f2b,_0x239988))['catch'](handleError(_0xea9f2b,null));};exports[_0x79db('0x6c')]=function(_0x42a85f,_0x3ca75f,_0x154678){var _0x2a9260={};var _0x4ee57f={};var _0x3bbab7;var _0x2a431d;return db[_0x79db('0x48')]['findOne']({'where':{'id':_0x42a85f[_0x79db('0x4e')]['id']}})[_0x79db('0x28')](handleEntityNotFound(_0x3ca75f,null))[_0x79db('0x28')](function(_0x3fafdf){if(_0x3fafdf){_0x3bbab7=_0x3fafdf;_0x4ee57f[_0x79db('0x39')]=_[_0x79db('0x4f')](db['Team']['rawAttributes']);_0x4ee57f[_0x79db('0x3a')]=_[_0x79db('0x4f')](_0x42a85f[_0x79db('0x3a')]);_0x4ee57f['filters']=_[_0x79db('0x3c')](_0x4ee57f[_0x79db('0x39')],_0x4ee57f[_0x79db('0x3a')]);_0x2a9260[_0x79db('0x3d')]=_[_0x79db('0x3c')](_0x4ee57f[_0x79db('0x39')],qs['fields'](_0x42a85f[_0x79db('0x3a')]['fields']));_0x2a9260[_0x79db('0x3d')]=_0x2a9260[_0x79db('0x3d')][_0x79db('0x3f')]?_0x2a9260['attributes']:_0x4ee57f[_0x79db('0x39')];_0x2a9260['order']=qs[_0x79db('0x43')](_0x42a85f[_0x79db('0x3a')][_0x79db('0x43')]);_0x2a9260['where']=qs[_0x79db('0x3b')](_[_0x79db('0x45')](_0x42a85f[_0x79db('0x3a')],_0x4ee57f[_0x79db('0x3b')]));if(_0x42a85f['query']['filter']){_0x2a9260['where']=_[_0x79db('0x47')](_0x2a9260[_0x79db('0x44')],{'$or':_[_0x79db('0x30')](_0x2a9260['attributes'],function(_0x50f00d){var _0x25ce12={};_0x25ce12[_0x50f00d]={'$like':'%'+_0x42a85f[_0x79db('0x3a')][_0x79db('0x2e')]+'%'};return _0x25ce12;})});}_0x2a9260=_['merge']({},_0x2a9260,_0x42a85f[_0x79db('0x5d')]);return _0x3bbab7[_0x79db('0x6c')](_0x2a9260);}})[_0x79db('0x28')](function(_0x583515){if(_0x583515){_0x2a431d=_0x583515[_0x79db('0x3f')];if(!_0x42a85f[_0x79db('0x3a')][_0x79db('0x40')](_0x79db('0x41'))){_0x2a9260[_0x79db('0x42')]=qs[_0x79db('0x42')](_0x42a85f[_0x79db('0x3a')]['limit']);_0x2a9260[_0x79db('0x22')]=qs['offset'](_0x42a85f[_0x79db('0x3a')][_0x79db('0x22')]);}return _0x3bbab7[_0x79db('0x6c')](_0x2a9260);}})['then'](function(_0x1ee030){if(_0x1ee030){return _0x1ee030?{'count':_0x2a431d,'rows':_0x1ee030}:null;}})[_0x79db('0x28')](respondWithResult(_0x3ca75f,null))[_0x79db('0x51')](handleError(_0x3ca75f,null));};exports[_0x79db('0x6d')]=function(_0x543f36,_0x22a991,_0x4a6120){var _0x2527e1=_0x543f36['body'][_0x79db('0x6e')];var _0x238b84=_[_0x79db('0x30')](_0x2527e1,'id');return db['Team'][_0x79db('0x4c')]({'where':{'id':_0x238b84},'attributes':['id'],'include':[{'model':db[_0x79db('0x6f')],'as':_0x79db('0x70'),'attributes':['id','name',_0x79db('0x71'),'voicePause',_0x79db('0x72')],'raw':!![]}]})[_0x79db('0x28')](function(_0x1fc257){if(_0x1fc257){var _0x269ab6=_[_0x79db('0x73')](_0x1fc257,function(_0x2232c5){var _0x314d46=_0x2232c5['get']({'plain':!![]});_0x314d46[_0x79db('0x70')][_0x79db('0x74')](function(_0x46a3a2){_0x46a3a2[_0x79db('0x75')]=_[_0x79db('0x50')](_0x2527e1,{'id':_0x314d46['id']})['penalty'];});return _0x314d46[_0x79db('0x70')];});return db[_0x79db('0x48')][_0x79db('0x50')]({'where':{'id':_0x543f36[_0x79db('0x4e')]['id']}})[_0x79db('0x28')](function(_0x58e46b){return db['sequelize']['transaction'](function(_0x483021){return _0x58e46b[_0x79db('0x6d')](_0x238b84,{'transaction':_0x483021})['then'](function(){return BPromise[_0x79db('0x76')](_0x269ab6,function(_0x347de0){return db[_0x79db('0x77')]['findOrCreate']({'where':{'UserId':_0x347de0['id'],'VoiceQueueId':_0x543f36[_0x79db('0x4e')]['id']},'defaults':{'penalty':_0x347de0['penalty']},'transaction':_0x483021});});})[_0x79db('0x28')](function(){return BPromise[_0x79db('0x76')](_[_0x79db('0x2e')](_0x269ab6,{'online':!![]}),function(_0x36bca5){return db[_0x79db('0x78')]['upsert']({'membername':_0x36bca5[_0x79db('0x35')],'UserId':_0x36bca5['id'],'queue_name':_0x58e46b[_0x79db('0x35')],'VoiceQueueId':_0x58e46b['id'],'interface':_[_0x79db('0x79')](_0x36bca5[_0x79db('0x72')])?util[_0x79db('0x7a')](_0x79db('0x7b'),_0x36bca5['name']):_0x36bca5['interface'],'paused':_0x36bca5[_0x79db('0x7c')]||![],'penalty':_0x36bca5[_0x79db('0x75')]},{'transaction':_0x483021});});})[_0x79db('0x28')](function(){_0x269ab6['forEach'](function(_0x10a7a5){socket[_0x79db('0x7d')](_0x79db('0x7e'),{'UserId':_0x10a7a5['id'],'VoiceQueueId':_0x58e46b['id']});});});});});}})[_0x79db('0x28')](respondWithStatusCode(_0x22a991,null))[_0x79db('0x51')](handleError(_0x22a991,null));};exports[_0x79db('0x7f')]=function(_0x539a8a,_0x2ac639,_0x2837d0){return db[_0x79db('0x80')][_0x79db('0x4c')]({'where':{'id':_0x539a8a[_0x79db('0x3a')][_0x79db('0x81')]},'attributes':['id'],'include':[{'model':db[_0x79db('0x6f')],'as':_0x79db('0x70'),'attributes':['id'],'raw':!![]}]})[_0x79db('0x28')](handleEntityNotFound(_0x2ac639,null))['then'](function(_0x136e49){var _0x48ec0a=_[_0x79db('0x30')](_0x136e49,'id');var _0x429afd=[];var _0x42323c=[];var _0x28c454=squel[_0x79db('0x82')]();_0x28c454[_0x79db('0x83')](_0x79db('0x84'))[_0x79db('0x85')](_0x79db('0x86'),'tq')['join'](_0x79db('0x87'),'ut',_0x79db('0x88'))['where'](_0x79db('0x89'),_0x539a8a['params']['id']);for(var _0x1b6a48=0x0;_0x1b6a48<_0x136e49[_0x79db('0x3f')];_0x1b6a48+=0x1){let _0x4e4b61=_0x136e49[_0x1b6a48];for(var _0x1c7195=0x0;_0x1c7195<_0x4e4b61['Agents']['length'];_0x1c7195+=0x1){let _0x3c8611=_0x4e4b61[_0x79db('0x70')][_0x1c7195];var _0x3af691=_0x28c454[_0x79db('0x5c')]();_0x3af691[_0x79db('0x44')](_0x79db('0x8a'),_0x3c8611['id']);_0x42323c[_0x79db('0x8b')](db[_0x79db('0x8c')][_0x79db('0x3a')](_0x3af691[_0x79db('0x8d')](),{'type':db[_0x79db('0x8c')][_0x79db('0x8e')][_0x79db('0x8f')]})[_0x79db('0x28')](function(_0x3cc1a2){if(_0x3cc1a2[_0x79db('0x3f')]===0x1){return _0x3c8611['id'];}else{var _0xe731d8=_[_0x79db('0x90')](_['map'](_0x3cc1a2,_0x79db('0x91')),function(_0x5d1a41){return _[_0x79db('0x92')](_0x48ec0a,_0x5d1a41);});if(_0xe731d8){return _0x3c8611['id'];}}}));}}return BPromise[_0x79db('0x93')](_0x42323c)['then'](function(_0x2cf409){_0x429afd=_(_0x429afd)['union'](_0x2cf409)['compact']()[_0x79db('0x31')]();return db['VoiceQueue']['find']({'where':{'id':_0x539a8a[_0x79db('0x4e')]['id']}})['then'](function(_0x2dce8c){return db[_0x79db('0x8c')]['transaction'](function(_0x2b495d){return _0x2dce8c['removeTeams'](_0x539a8a[_0x79db('0x3a')]['ids'],{'transaction':_0x2b495d})[_0x79db('0x28')](function(){if(!_[_0x79db('0x94')](_0x429afd)){return _0x2dce8c[_0x79db('0x95')](_0x429afd,{'transaction':_0x2b495d})[_0x79db('0x28')](function(){return db[_0x79db('0x78')][_0x79db('0x29')]({'where':{'VoiceQueueId':_0x539a8a[_0x79db('0x4e')]['id'],'UserId':_0x429afd},'transaction':_0x2b495d});});}})[_0x79db('0x28')](function(){_0x429afd['forEach'](function(_0x27f3df){socket['emit']('userVoiceQueue:remove',{'UserId':_0x27f3df,'VoiceQueueId':_0x2dce8c['id']});});});});});});})[_0x79db('0x28')](respondWithStatusCode(_0x2ac639,null))[_0x79db('0x51')](handleError(_0x2ac639,null));};exports[_0x79db('0x96')]=function(_0x2967f8,_0x2ba161,_0x204410){var _0x4ca876,_0x4e47af;return db['VoiceQueue'][_0x79db('0x50')]({'where':{'id':_0x2967f8['params']['id']}})[_0x79db('0x28')](handleEntityNotFound(_0x2ba161,null))[_0x79db('0x28')](function(_0xf159ae){if(_0xf159ae){_0x4e47af=_0xf159ae;return _0xf159ae[_0x79db('0x96')](_0x2967f8[_0x79db('0x53')]['ids'],_[_0x79db('0x5e')](_0x2967f8['body'],[_0x79db('0x81'),'id'])||{})['spread'](function(_0x52c4f0){for(var _0x301a5b=0x0;_0x301a5b<_0x2967f8[_0x79db('0x53')]['ids'][_0x79db('0x3f')];_0x301a5b+=0x1){socket[_0x79db('0x7d')]('userVoiceQueue:save',{'UserId':_0x2967f8[_0x79db('0x53')]['ids'][_0x301a5b],'VoiceQueueId':_0x2967f8[_0x79db('0x4e')]['id']});}return _0x52c4f0;});}})['then'](function(_0x4f5ee1){_0x4ca876=_0x4f5ee1||[];if(_0x4e47af){return db['User']['findAll']({'where':{'id':_0x2967f8[_0x79db('0x53')][_0x79db('0x81')]},'attributes':['id',_0x79db('0x35'),_0x79db('0x71'),_0x79db('0x7c'),_0x79db('0x72')],'raw':!![]});}})[_0x79db('0x28')](function(_0x4e504a){if(!_[_0x79db('0x94')](_0x4e504a)){var _0x3268fd=[];for(var _0x265ad4=0x0;_0x265ad4<_0x4e504a[_0x79db('0x3f')];_0x265ad4++){if(_0x4e504a[_0x265ad4][_0x79db('0x71')]){_0x3268fd[_0x79db('0x8b')](db[_0x79db('0x78')][_0x79db('0x97')]({'membername':_0x4e504a[_0x265ad4][_0x79db('0x35')],'UserId':_0x4e504a[_0x265ad4]['id'],'queue_name':_0x4e47af[_0x79db('0x35')],'VoiceQueueId':_0x4e47af['id'],'interface':_[_0x79db('0x79')](_0x4e504a[_0x265ad4][_0x79db('0x72')])?util['format'](_0x79db('0x7b'),_0x4e504a[_0x265ad4][_0x79db('0x35')]):_0x4e504a[_0x265ad4][_0x79db('0x72')],'paused':_0x4e504a[_0x265ad4]['voicePause']||![],'penalty':_0x2967f8[_0x79db('0x53')]['penalty']||0x0}));}}return BPromise['all'](_0x3268fd);}})[_0x79db('0x28')](function(){return _0x4ca876;})['then'](respondWithResult(_0x2ba161,null))[_0x79db('0x51')](handleError(_0x2ba161,null));};exports[_0x79db('0x95')]=function(_0x52703c,_0x18d024,_0xb08129){return db[_0x79db('0x48')]['find']({'where':{'id':_0x52703c[_0x79db('0x4e')]['id']}})[_0x79db('0x28')](handleEntityNotFound(_0x18d024,null))['then'](function(_0x43bc08){if(_0x43bc08){return _0x43bc08[_0x79db('0x95')](_0x52703c[_0x79db('0x3a')][_0x79db('0x81')])[_0x79db('0x28')](function(){if(_[_0x79db('0x98')](_0x52703c['query'][_0x79db('0x81')])){for(var _0x50f537=0x0;_0x50f537<_0x52703c[_0x79db('0x3a')][_0x79db('0x81')][_0x79db('0x3f')];_0x50f537+=0x1){socket[_0x79db('0x7d')](_0x79db('0x99'),{'UserId':Number(_0x52703c['query'][_0x79db('0x81')][_0x50f537]),'VoiceQueueId':Number(_0x52703c[_0x79db('0x4e')]['id'])});}}else{socket[_0x79db('0x7d')](_0x79db('0x99'),{'UserId':Number(_0x52703c[_0x79db('0x3a')][_0x79db('0x81')]),'VoiceQueueId':Number(_0x52703c['params']['id'])});}});}})[_0x79db('0x28')](function(_0x3f170d){return db[_0x79db('0x78')][_0x79db('0x29')]({'where':{'VoiceQueueId':_0x52703c['params']['id'],'UserId':_0x52703c[_0x79db('0x3a')][_0x79db('0x81')]}})['then'](function(){return _0x3f170d;});})[_0x79db('0x28')](respondWithStatusCode(_0x18d024,null))[_0x79db('0x51')](handleError(_0x18d024,null));};exports[_0x79db('0x9a')]=function(_0xf0bc45,_0x5792f4,_0xfb24d6){var _0x5521d0={};var _0x492c7d={};var _0x31c593;var _0xaafd4b;return db[_0x79db('0x48')][_0x79db('0x62')]({'where':{'id':_0xf0bc45[_0x79db('0x4e')]['id']}})[_0x79db('0x28')](handleEntityNotFound(_0x5792f4,null))['then'](function(_0x5992a0){if(_0x5992a0){_0x31c593=_0x5992a0;_0x492c7d[_0x79db('0x39')]=_[_0x79db('0x4f')](db['User']['rawAttributes']);_0x492c7d[_0x79db('0x3a')]=_[_0x79db('0x4f')](_0xf0bc45[_0x79db('0x3a')]);_0x492c7d[_0x79db('0x3b')]=_[_0x79db('0x3c')](_0x492c7d[_0x79db('0x39')],_0x492c7d[_0x79db('0x3a')]);_0x5521d0[_0x79db('0x3d')]=_[_0x79db('0x3c')](_0x492c7d[_0x79db('0x39')],qs[_0x79db('0x3e')](_0xf0bc45[_0x79db('0x3a')]['fields']));_0x5521d0[_0x79db('0x3d')]=_0x5521d0[_0x79db('0x3d')]['length']?_0x5521d0[_0x79db('0x3d')]:_0x492c7d['model'];_0x5521d0[_0x79db('0x64')]=qs['sort'](_0xf0bc45['query'][_0x79db('0x43')]);_0x5521d0[_0x79db('0x44')]=qs[_0x79db('0x3b')](_[_0x79db('0x45')](_0xf0bc45[_0x79db('0x3a')],_0x492c7d['filters']));if(_0xf0bc45[_0x79db('0x3a')]['filter']){_0x5521d0[_0x79db('0x44')]=_[_0x79db('0x47')](_0x5521d0[_0x79db('0x44')],{'$or':_[_0x79db('0x30')](_0x5521d0[_0x79db('0x3d')],function(_0x2378f8){var _0x1cd30c={};_0x1cd30c[_0x2378f8]={'$like':'%'+_0xf0bc45[_0x79db('0x3a')][_0x79db('0x2e')]+'%'};return _0x1cd30c;})});}_0x5521d0=_[_0x79db('0x47')]({},_0x5521d0,_0xf0bc45['options']);return _0x31c593[_0x79db('0x9a')](_0x5521d0);}})[_0x79db('0x28')](function(_0x3455c9){if(_0x3455c9){_0xaafd4b=_0x3455c9[_0x79db('0x3f')];if(!_0xf0bc45[_0x79db('0x3a')]['hasOwnProperty']('nolimit')){_0x5521d0[_0x79db('0x42')]=qs[_0x79db('0x42')](_0xf0bc45[_0x79db('0x3a')][_0x79db('0x42')]);_0x5521d0[_0x79db('0x22')]=qs['offset'](_0xf0bc45[_0x79db('0x3a')]['offset']);}return _0x31c593[_0x79db('0x9a')](_0x5521d0);}})[_0x79db('0x28')](function(_0x248e53){if(_0x248e53){return _0x248e53?{'count':_0xaafd4b,'rows':_0x248e53}:null;}})['then'](respondWithResult(_0x5792f4,null))[_0x79db('0x51')](handleError(_0x5792f4,null));};exports['getMembers']=function(_0xf52d9c,_0xb43f8e,_0x177cb6){var _0x42625b={};var _0x2d1059={};var _0x467045;var _0x59bee0;return db[_0x79db('0x48')][_0x79db('0x62')]({'where':{'id':_0xf52d9c[_0x79db('0x4e')]['id']}})[_0x79db('0x28')](handleEntityNotFound(_0xb43f8e,null))[_0x79db('0x28')](function(_0x227f2c){if(_0x227f2c){_0x467045=_0x227f2c;_0x2d1059[_0x79db('0x39')]=_[_0x79db('0x4f')](db[_0x79db('0x78')][_0x79db('0x37')]);_0x2d1059[_0x79db('0x3a')]=_[_0x79db('0x4f')](_0xf52d9c[_0x79db('0x3a')]);_0x2d1059['filters']=_[_0x79db('0x3c')](_0x2d1059[_0x79db('0x39')],_0x2d1059[_0x79db('0x3a')]);_0x42625b[_0x79db('0x3d')]=_['intersection'](_0x2d1059[_0x79db('0x39')],qs[_0x79db('0x3e')](_0xf52d9c['query'][_0x79db('0x3e')]));_0x42625b['attributes']=_0x42625b[_0x79db('0x3d')][_0x79db('0x3f')]?_0x42625b[_0x79db('0x3d')]:_0x2d1059[_0x79db('0x39')];_0x42625b[_0x79db('0x64')]=qs[_0x79db('0x43')](_0xf52d9c['query'][_0x79db('0x43')]);_0x42625b[_0x79db('0x44')]=qs[_0x79db('0x3b')](_['pick'](_0xf52d9c[_0x79db('0x3a')],_0x2d1059[_0x79db('0x3b')]));if(_0xf52d9c[_0x79db('0x3a')]['filter']){_0x42625b[_0x79db('0x44')]=_['merge'](_0x42625b[_0x79db('0x44')],{'$or':_['map'](_0x42625b[_0x79db('0x3d')],function(_0x5b530e){var _0x13b7dd={};_0x13b7dd[_0x5b530e]={'$like':'%'+_0xf52d9c['query'][_0x79db('0x2e')]+'%'};return _0x13b7dd;})});}_0x42625b=_[_0x79db('0x47')]({},_0x42625b,_0xf52d9c[_0x79db('0x5d')]);return _0x467045[_0x79db('0x9b')](_0x42625b);}})['then'](function(_0x934cff){if(_0x934cff){_0x59bee0=_0x934cff[_0x79db('0x3f')];if(!_0xf52d9c[_0x79db('0x3a')]['hasOwnProperty'](_0x79db('0x41'))){_0x42625b[_0x79db('0x42')]=qs[_0x79db('0x42')](_0xf52d9c['query']['limit']);_0x42625b[_0x79db('0x22')]=qs[_0x79db('0x22')](_0xf52d9c['query'][_0x79db('0x22')]);}return _0x467045[_0x79db('0x9b')](_0x42625b);}})[_0x79db('0x28')](function(_0xf9b761){return _0xf9b761?{'count':_0x59bee0,'rows':_0xf9b761}:null;})[_0x79db('0x28')](respondWithResult(_0xb43f8e,null))[_0x79db('0x51')](handleError(_0xb43f8e,null));};exports[_0x79db('0x9c')]=function(_0x46a6db,_0x8e57e,_0x54c44c){var _0x3a7fc6={};var _0x40a24d={};var _0x13a3de;var _0x302c82;return db[_0x79db('0x48')][_0x79db('0x62')]({'where':{'id':_0x46a6db[_0x79db('0x4e')]['id']}})[_0x79db('0x28')](handleEntityNotFound(_0x8e57e,null))['then'](function(_0x151abf){if(_0x151abf){_0x13a3de=_0x151abf;_0x40a24d[_0x79db('0x39')]=_[_0x79db('0x4f')](db[_0x79db('0x9d')][_0x79db('0x37')]);_0x40a24d[_0x79db('0x3a')]=_['keys'](_0x46a6db['query']);_0x40a24d[_0x79db('0x3b')]=_[_0x79db('0x3c')](_0x40a24d[_0x79db('0x39')],_0x40a24d[_0x79db('0x3a')]);_0x3a7fc6[_0x79db('0x3d')]=_[_0x79db('0x3c')](_0x40a24d[_0x79db('0x39')],qs[_0x79db('0x3e')](_0x46a6db[_0x79db('0x3a')][_0x79db('0x3e')]));_0x3a7fc6[_0x79db('0x3d')]=_0x3a7fc6[_0x79db('0x3d')]['length']?_0x3a7fc6[_0x79db('0x3d')]:_0x40a24d[_0x79db('0x39')];_0x3a7fc6[_0x79db('0x64')]=qs[_0x79db('0x43')](_0x46a6db['query'][_0x79db('0x43')]);_0x3a7fc6[_0x79db('0x44')]=qs[_0x79db('0x3b')](_[_0x79db('0x45')](_0x46a6db['query'],_0x40a24d['filters']));if(_0x46a6db[_0x79db('0x3a')][_0x79db('0x2e')]){_0x3a7fc6[_0x79db('0x44')]=_[_0x79db('0x47')](_0x3a7fc6[_0x79db('0x44')],{'$or':_[_0x79db('0x30')](_0x3a7fc6[_0x79db('0x3d')],function(_0x569ce2){var _0x704692={};_0x704692[_0x569ce2]={'$like':'%'+_0x46a6db[_0x79db('0x3a')][_0x79db('0x2e')]+'%'};return _0x704692;})});}_0x3a7fc6=_[_0x79db('0x47')]({},_0x3a7fc6,_0x46a6db[_0x79db('0x5d')]);return _0x13a3de[_0x79db('0x9c')](_0x3a7fc6);}})[_0x79db('0x28')](function(_0x23a7b){if(_0x23a7b){_0x302c82=_0x23a7b['length'];if(!_0x46a6db[_0x79db('0x3a')][_0x79db('0x40')](_0x79db('0x41'))){_0x3a7fc6[_0x79db('0x42')]=qs[_0x79db('0x42')](_0x46a6db[_0x79db('0x3a')][_0x79db('0x42')]);_0x3a7fc6[_0x79db('0x22')]=qs[_0x79db('0x22')](_0x46a6db['query'][_0x79db('0x22')]);}return _0x13a3de['getLists'](_0x3a7fc6);}})[_0x79db('0x28')](function(_0x411abb){if(_0x411abb){return _0x411abb?{'count':_0x302c82,'rows':_0x411abb}:null;}})[_0x79db('0x28')](respondWithResult(_0x8e57e,null))['catch'](handleError(_0x8e57e,null));};exports['addLists']=function(_0x1cd0a5,_0x48106f,_0x465543){var _0x117e0a,_0x3d9a8a;return db[_0x79db('0x48')][_0x79db('0x50')]({'where':{'id':_0x1cd0a5[_0x79db('0x4e')]['id']}})['then'](handleEntityNotFound(_0x48106f,null))[_0x79db('0x28')](function(_0x46f82c){if(_0x46f82c){_0x3d9a8a=_0x46f82c;return _0x46f82c['addLists'](_0x1cd0a5[_0x79db('0x53')][_0x79db('0x81')],_[_0x79db('0x5e')](_0x1cd0a5[_0x79db('0x53')],[_0x79db('0x81'),'id'])||{});}return null;})['spread'](function(_0x4c2f4d){var _0xb02aa5;_0x117e0a=_0x4c2f4d||[];var _0x56d93e=[];if(_0x4c2f4d){for(var _0x12c8e1=0x0;_0x12c8e1<_0x4c2f4d[_0x79db('0x3f')];_0x12c8e1+=0x1){var _0x115da4=_0x4c2f4d[_0x12c8e1][_0x79db('0x55')]({'plain':!![]});_0x3d9a8a[_0x79db('0x9e')]=_0x1cd0a5[_0x79db('0x53')][_0x79db('0x9e')]?_0x1cd0a5[_0x79db('0x53')]['dialCheckDuplicateType']:_0x3d9a8a['dialCheckDuplicateType'];switch(_0x3d9a8a['dialCheckDuplicateType']){case _0x79db('0x9f'):_0xb02aa5=squel['insert']()[_0x79db('0xa0')](_0x79db('0xa1'))[_0x79db('0xa2')]([_0x79db('0xa3'),_0x79db('0xa4'),_0x79db('0xa5'),_0x79db('0xa6'),'VoiceQueueId',_0x79db('0x60'),_0x79db('0x5f')],squel[_0x79db('0x82')]()['field'](_0x79db('0xa3'),_0x79db('0xa3'))[_0x79db('0x83')](_0x79db('0xa7'),'scheduledAt')[_0x79db('0x83')]('id',_0x79db('0xa5'))[_0x79db('0x83')](_0x115da4[_0x79db('0xa8')]['toString'](),'ListId')[_0x79db('0x83')](_0x1cd0a5[_0x79db('0x4e')]['id'][_0x79db('0x8d')](),_0x79db('0x65'))[_0x79db('0x83')](_0x79db('0xa7'),_0x79db('0x60'))['field'](_0x79db('0xa7'),_0x79db('0x5f'))[_0x79db('0x85')](_0x79db('0xa9'))[_0x79db('0x44')](_0x79db('0xaa'))['where'](_0x79db('0xab'),_0x115da4[_0x79db('0xa8')][_0x79db('0x8d')]())[_0x79db('0x44')](_0x79db('0xac'))[_0x79db('0x44')](_0x79db('0xad'),squel[_0x79db('0x82')]()[_0x79db('0x83')]('COALESCE(calleridnum,\x27\x27)')[_0x79db('0x85')](_0x79db('0xae'))['where']('VoiceQueueId\x20=\x20?',_0x1cd0a5[_0x79db('0x4e')]['id'][_0x79db('0x8d')]()))['where'](_0x79db('0xad'),squel[_0x79db('0x82')]()[_0x79db('0x83')]('COALESCE(phone,\x27\x27)')['from'](_0x79db('0xa1'))[_0x79db('0x44')](_0x79db('0x89'),_0x1cd0a5[_0x79db('0x4e')]['id'][_0x79db('0x8d')]())))['toString']();break;case _0x79db('0xaf'):_0xb02aa5=squel['insert']()['into'](_0x79db('0xa1'))[_0x79db('0xa2')]([_0x79db('0xa3'),_0x79db('0xa4'),'ContactId','ListId',_0x79db('0x65'),'createdAt',_0x79db('0x5f')],squel[_0x79db('0x82')]()['field'](_0x79db('0xa3'),'phone')[_0x79db('0x83')]('NOW()',_0x79db('0xa4'))['field']('id','ContactId')[_0x79db('0x83')](_0x115da4['CmListId'][_0x79db('0x8d')](),_0x79db('0xa6'))[_0x79db('0x83')](_0x1cd0a5[_0x79db('0x4e')]['id']['toString'](),_0x79db('0x65'))[_0x79db('0x83')](_0x79db('0xa7'),'createdAt')[_0x79db('0x83')](_0x79db('0xa7'),_0x79db('0x5f'))['from']('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0x79db('0x44')]('ListId\x20=\x20?',_0x115da4[_0x79db('0xa8')][_0x79db('0x8d')]())['where'](_0x79db('0xac'))[_0x79db('0x44')](_0x79db('0xad'),squel[_0x79db('0x82')]()[_0x79db('0x83')](_0x79db('0xb0'))[_0x79db('0x85')](_0x79db('0xa1'))[_0x79db('0x44')](_0x79db('0x89'),_0x1cd0a5[_0x79db('0x4e')]['id'][_0x79db('0x8d')]())))['toString']();break;default:_0xb02aa5=squel['insert']()['into'](_0x79db('0xa1'))['fromQuery'](['phone',_0x79db('0xa4'),_0x79db('0xa5'),_0x79db('0xa6'),_0x79db('0x65'),_0x79db('0x60'),_0x79db('0x5f')],squel['select']()[_0x79db('0x83')](_0x79db('0xa3'),_0x79db('0xa3'))[_0x79db('0x83')]('NOW()',_0x79db('0xa4'))['field']('id','ContactId')[_0x79db('0x83')](_0x115da4[_0x79db('0xa8')]['toString'](),_0x79db('0xa6'))[_0x79db('0x83')](_0x1cd0a5[_0x79db('0x4e')]['id']['toString'](),'VoiceQueueId')[_0x79db('0x83')]('NOW()',_0x79db('0x60'))['field'](_0x79db('0xa7'),_0x79db('0x5f'))[_0x79db('0x85')](_0x79db('0xa9'))[_0x79db('0x44')](_0x79db('0xaa'))[_0x79db('0x44')](_0x79db('0xab'),_0x115da4[_0x79db('0xa8')][_0x79db('0x8d')]())[_0x79db('0x44')](_0x79db('0xac')))[_0x79db('0x8d')]();}_0x56d93e[_0x79db('0x8b')](db[_0x79db('0x8c')][_0x79db('0x3a')](_0xb02aa5));}return BPromise[_0x79db('0x93')](_0x56d93e);}})[_0x79db('0x28')](function(){return _0x117e0a;})[_0x79db('0x28')](respondWithResult(_0x48106f,null))[_0x79db('0x51')](handleError(_0x48106f,null));};exports[_0x79db('0xb1')]=function(_0x1d8b72,_0x3987c8,_0x3a41c1){return db[_0x79db('0x48')][_0x79db('0x50')]({'where':{'id':_0x1d8b72['params']['id']}})['then'](handleEntityNotFound(_0x3987c8,null))[_0x79db('0x28')](function(_0x25e295){if(_0x25e295){return _0x25e295[_0x79db('0xb1')](_0x1d8b72[_0x79db('0x3a')]['ids']);}})[_0x79db('0x28')](function(_0x54fc44){if(_0x54fc44){return db['CmHopper'][_0x79db('0x29')]({'where':{'ListId':_0x1d8b72[_0x79db('0x3a')]['ids'],'VoiceQueueId':_0x1d8b72[_0x79db('0x4e')]['id']}})[_0x79db('0x28')](function(){return _0x54fc44;});}})[_0x79db('0x28')](respondWithStatusCode(_0x3987c8,null))[_0x79db('0x51')](handleError(_0x3987c8,null));};exports[_0x79db('0xb2')]=function(_0x5978a4,_0x2811eb,_0x4778b9){var _0x30aa23={};var _0x58927f={};var _0x26c17c;var _0x278085;return db[_0x79db('0x48')][_0x79db('0x62')]({'where':{'id':_0x5978a4[_0x79db('0x4e')]['id']}})[_0x79db('0x28')](handleEntityNotFound(_0x2811eb,null))[_0x79db('0x28')](function(_0x27be26){if(_0x27be26){_0x26c17c=_0x27be26;_0x58927f[_0x79db('0x39')]=_[_0x79db('0x4f')](db['CmList']['rawAttributes']);_0x58927f[_0x79db('0x3a')]=_[_0x79db('0x4f')](_0x5978a4[_0x79db('0x3a')]);_0x58927f[_0x79db('0x3b')]=_[_0x79db('0x3c')](_0x58927f['model'],_0x58927f['query']);_0x30aa23[_0x79db('0x3d')]=_[_0x79db('0x3c')](_0x58927f[_0x79db('0x39')],qs[_0x79db('0x3e')](_0x5978a4[_0x79db('0x3a')][_0x79db('0x3e')]));_0x30aa23[_0x79db('0x3d')]=_0x30aa23[_0x79db('0x3d')][_0x79db('0x3f')]?_0x30aa23[_0x79db('0x3d')]:_0x58927f[_0x79db('0x39')];_0x30aa23['order']=qs[_0x79db('0x43')](_0x5978a4['query']['sort']);_0x30aa23[_0x79db('0x44')]=qs['filters'](_[_0x79db('0x45')](_0x5978a4[_0x79db('0x3a')],_0x58927f[_0x79db('0x3b')]));if(_0x5978a4[_0x79db('0x3a')][_0x79db('0x2e')]){_0x30aa23[_0x79db('0x44')]=_[_0x79db('0x47')](_0x30aa23[_0x79db('0x44')],{'$or':_['map'](_0x30aa23['attributes'],function(_0xd4ee01){var _0x4e1041={};_0x4e1041[_0xd4ee01]={'$like':'%'+_0x5978a4['query'][_0x79db('0x2e')]+'%'};return _0x4e1041;})});}_0x30aa23=_['merge']({},_0x30aa23,_0x5978a4[_0x79db('0x5d')]);return _0x26c17c['getBlackLists'](_0x30aa23);}})[_0x79db('0x28')](function(_0x34f94a){if(_0x34f94a){_0x278085=_0x34f94a['length'];if(!_0x5978a4[_0x79db('0x3a')][_0x79db('0x40')](_0x79db('0x41'))){_0x30aa23[_0x79db('0x42')]=qs[_0x79db('0x42')](_0x5978a4[_0x79db('0x3a')][_0x79db('0x42')]);_0x30aa23[_0x79db('0x22')]=qs[_0x79db('0x22')](_0x5978a4[_0x79db('0x3a')][_0x79db('0x22')]);}return _0x26c17c[_0x79db('0xb2')](_0x30aa23);}})[_0x79db('0x28')](function(_0x232548){if(_0x232548){return _0x232548?{'count':_0x278085,'rows':_0x232548}:null;}})['then'](respondWithResult(_0x2811eb,null))[_0x79db('0x51')](handleError(_0x2811eb,null));};exports[_0x79db('0xb3')]=function(_0x1b92e2,_0x3a7908,_0x71471d){var _0x189e27,_0xfeddf3;return db[_0x79db('0x48')][_0x79db('0x50')]({'where':{'id':_0x1b92e2[_0x79db('0x4e')]['id']}})[_0x79db('0x28')](handleEntityNotFound(_0x3a7908,null))[_0x79db('0x28')](function(_0x10baeb){if(_0x10baeb){_0xfeddf3=_0x10baeb;return _0x10baeb['addBlackLists'](_0x1b92e2['body'][_0x79db('0x81')],_[_0x79db('0x5e')](_0x1b92e2['body'],[_0x79db('0x81'),'id'])||{});}return null;})[_0x79db('0xb4')](function(_0x3aa8f6){var _0x40baa2;_0x189e27=_0x3aa8f6||[];var _0x56322f=[];if(_0x3aa8f6){for(var _0x6cf012=0x0;_0x6cf012<_0x3aa8f6[_0x79db('0x3f')];_0x6cf012+=0x1){var _0x542440=_0x3aa8f6[_0x6cf012][_0x79db('0x55')]({'plain':!![]});_0x40baa2=squel['insert']()['into'](_0x79db('0xb5'))['fromQuery']([_0x79db('0xa3'),_0x79db('0xa5'),_0x79db('0xa6'),_0x79db('0x65'),_0x79db('0x60'),'updatedAt'],squel[_0x79db('0x82')]()['field']('phone',_0x79db('0xa3'))[_0x79db('0x83')]('id',_0x79db('0xa5'))['field'](_0x542440['CmListId'][_0x79db('0x8d')](),_0x79db('0xa6'))[_0x79db('0x83')](_0x1b92e2[_0x79db('0x4e')]['id'][_0x79db('0x8d')](),_0x79db('0x65'))[_0x79db('0x83')](_0x79db('0xa7'),_0x79db('0x60'))['field'](_0x79db('0xa7'),_0x79db('0x5f'))[_0x79db('0x85')](_0x79db('0xa9'))[_0x79db('0x44')]('deletedAt\x20IS\x20NULL')['where'](_0x79db('0xab'),_0x542440[_0x79db('0xa8')][_0x79db('0x8d')]())[_0x79db('0x44')](_0x79db('0xac')))[_0x79db('0x8d')]();_0x56322f['push'](db['sequelize']['query'](_0x40baa2));}return BPromise[_0x79db('0x93')](_0x56322f);}})[_0x79db('0x28')](function(){return _0x189e27;})['then'](respondWithResult(_0x3a7908,null))['catch'](handleError(_0x3a7908,null));};exports[_0x79db('0xb6')]=function(_0x4c4bf4,_0x4e7a16,_0x2d1d6b){return db[_0x79db('0x48')][_0x79db('0x50')]({'where':{'id':_0x4c4bf4[_0x79db('0x4e')]['id']}})[_0x79db('0x28')](handleEntityNotFound(_0x4e7a16,null))[_0x79db('0x28')](function(_0x3efe26){if(_0x3efe26){return _0x3efe26[_0x79db('0xb6')](_0x4c4bf4[_0x79db('0x3a')][_0x79db('0x81')]);}})[_0x79db('0x28')](function(_0x3a8eed){if(_0x3a8eed){return db[_0x79db('0x6b')][_0x79db('0x29')]({'where':{'ListId':_0x4c4bf4[_0x79db('0x3a')][_0x79db('0x81')],'VoiceQueueId':_0x4c4bf4['params']['id']}})['then'](function(){return _0x3a8eed;});}})[_0x79db('0x28')](respondWithStatusCode(_0x4e7a16,null))[_0x79db('0x51')](handleError(_0x4e7a16,null));}; \ No newline at end of file +var _0x6017=['util','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','get','QueueCampaigns','filter','ignore','map','value','type','name','UserProfileResource','error','stack','index','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VoiceQueue','includeAll','include','findAll','rows','show','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','VoiceQueues','inbound','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','outbound','findOne','CmHopper','pick','getHopperHistories','CmHopperHistory','order','VoiceQueueId','getHopperFinals','CmHopperFinal','CmHopperBlack','getTeams','addTeams','teams','Team','User','Agents','online','voicePause','flatMap','forEach','penalty','sequelize','each','UserVoiceQueue','UserVoiceQueueRt','format','interface','emit','ids','select','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','every','TeamId','all','union','compact','transaction','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','userVoiceQueue:save','upsert','isNil','SIP/%s','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','into','ContactId','ListId','field','phone','NOW()','scheduledAt','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','insert','deletedAt\x20IS\x20NULL','fromQuery','cm_contacts','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird'];(function(_0x596174,_0x1cd426){var _0x56431c=function(_0x49b741){while(--_0x49b741){_0x596174['push'](_0x596174['shift']());}};_0x56431c(++_0x1cd426);}(_0x6017,0xae));var _0x7601=function(_0x3edf25,_0x60f6b3){_0x3edf25=_0x3edf25-0x0;var _0x32798d=_0x6017[_0x3edf25];return _0x32798d;};'use strict';var pdf=require(_0x7601('0x0'));var emlformat=require(_0x7601('0x1'));var rimraf=require(_0x7601('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7601('0x3'));var rp=require(_0x7601('0x4'));var moment=require('moment');var BPromise=require(_0x7601('0x5'));var Mustache=require('mustache');var util=require(_0x7601('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x7601('0x7'));var ejs=require(_0x7601('0x8'));var fs=require('fs');var _=require(_0x7601('0x9'));var squel=require(_0x7601('0xa'));var crypto=require(_0x7601('0xb'));var jsforce=require(_0x7601('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x7601('0x7'));var querystring=require(_0x7601('0xd'));var Papa=require(_0x7601('0xe'));var Redis=require('ioredis');var authService=require(_0x7601('0xf'));var qs=require(_0x7601('0x10'));var as=require(_0x7601('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7601('0x12'))(_0x7601('0x13'));var utils=require(_0x7601('0x14'));var config=require(_0x7601('0x15'));var db=require(_0x7601('0x16'))['db'];config[_0x7601('0x17')]=_[_0x7601('0x18')](config[_0x7601('0x17')],{'host':_0x7601('0x19'),'port':0x18eb});var socket=require(_0x7601('0x1a'))(new Redis(config['redis']));require(_0x7601('0x1b'))['register'](socket);function respondWithStatusCode(_0x4be36a,_0x2b8cbc){_0x2b8cbc=_0x2b8cbc||0xcc;return function(_0x6da06c){if(_0x6da06c){return _0x4be36a[_0x7601('0x1c')](_0x2b8cbc);}return _0x4be36a[_0x7601('0x1d')](_0x2b8cbc)[_0x7601('0x1e')]();};}function respondWithResult(_0x3a1706,_0xdd9b16){_0xdd9b16=_0xdd9b16||0xc8;return function(_0xdfb58a){if(_0xdfb58a){return _0x3a1706['status'](_0xdd9b16)[_0x7601('0x1f')](_0xdfb58a);}};}function respondWithFilteredResult(_0xe312e4,_0x5329e6){return function(_0x17ed47){if(_0x17ed47){var _0x5c3fb7=_0x17ed47[_0x7601('0x20')],_0x5f530e=_0x5329e6[_0x7601('0x21')],_0x22520e=_0x5329e6[_0x7601('0x21')]+_0x5329e6[_0x7601('0x22')],_0x403e38;if(_0x22520e>=_0x5c3fb7){_0x22520e=_0x5c3fb7;_0x403e38=0xc8;}else{_0x403e38=0xce;}_0xe312e4[_0x7601('0x1d')](_0x403e38);return _0xe312e4['set'](_0x7601('0x23'),_0x5f530e+'-'+_0x22520e+'/'+_0x5c3fb7)[_0x7601('0x1f')](_0x17ed47);}return null;};}function patchUpdates(_0x4ed321){return function(_0x204292){try{jsonpatch[_0x7601('0x24')](_0x204292,_0x4ed321,!![]);}catch(_0x37ee6c){return BPromise[_0x7601('0x25')](_0x37ee6c);}return _0x204292[_0x7601('0x26')]();};}function saveUpdates(_0x12f3f6,_0x4cbf1e){return function(_0x1fa3bc){if(_0x1fa3bc){return _0x1fa3bc[_0x7601('0x27')](_0x12f3f6)[_0x7601('0x28')](function(_0x3a3629){return _0x3a3629;});}return null;};}function removeEntity(_0x57e7a6,_0x2b9bd){return function(_0x53425f){if(_0x53425f){return _0x53425f[_0x7601('0x29')]()['then'](function(){var _0x5e6be1=_0x53425f[_0x7601('0x2a')]({'plain':!![]});var _0x1eb68c=[{'name':'VoiceQueues','value':'inbound','ignore':![]},{'name':_0x7601('0x2b'),'value':'outbound','ignore':![]}];var _0x57f6e9=_(_0x1eb68c)[_0x7601('0x2c')](_0x7601('0x2d'))[_0x7601('0x2e')]('value')[_0x7601('0x2f')]();if(_['includes'](_0x57f6e9,_0x5e6be1[_0x7601('0x30')])){return;}var _0xa05dda=_['find'](_0x1eb68c,['value',_0x5e6be1[_0x7601('0x30')]])[_0x7601('0x31')];return db[_0x7601('0x32')][_0x7601('0x29')]({'where':{'type':_0xa05dda,'resourceId':_0x5e6be1['id']}})[_0x7601('0x28')](function(){return _0x53425f;});})[_0x7601('0x28')](function(){_0x57e7a6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x27f423,_0x170d27){return function(_0xa483c4){if(!_0xa483c4){_0x27f423[_0x7601('0x1c')](0x194);}return _0xa483c4;};}function handleError(_0x1b3ec1,_0x5eead0){_0x5eead0=_0x5eead0||0x1f4;return function(_0x5ceb46){logger[_0x7601('0x33')](_0x5ceb46[_0x7601('0x34')]);if(_0x5ceb46[_0x7601('0x31')]){delete _0x5ceb46[_0x7601('0x31')];}_0x1b3ec1[_0x7601('0x1d')](_0x5eead0)['send'](_0x5ceb46);};}exports[_0x7601('0x35')]=function(_0xc1e02c,_0x5552a1){var _0x7f4acb={},_0x1bc4dc={},_0x246aaf={'count':0x0,'rows':[]};var _0x35a89f=_[_0x7601('0x2e')](db['VoiceQueue'][_0x7601('0x36')],function(_0x321a92){return{'name':_0x321a92[_0x7601('0x37')],'type':_0x321a92[_0x7601('0x30')]['key']};});_0x1bc4dc[_0x7601('0x38')]=_['map'](_0x35a89f,'name');_0x1bc4dc[_0x7601('0x39')]=_[_0x7601('0x3a')](_0xc1e02c[_0x7601('0x39')]);_0x1bc4dc[_0x7601('0x3b')]=_[_0x7601('0x3c')](_0x1bc4dc[_0x7601('0x38')],_0x1bc4dc[_0x7601('0x39')]);_0x7f4acb[_0x7601('0x3d')]=_[_0x7601('0x3c')](_0x1bc4dc[_0x7601('0x38')],qs[_0x7601('0x3e')](_0xc1e02c[_0x7601('0x39')][_0x7601('0x3e')]));_0x7f4acb[_0x7601('0x3d')]=_0x7f4acb['attributes'][_0x7601('0x3f')]?_0x7f4acb[_0x7601('0x3d')]:_0x1bc4dc[_0x7601('0x38')];if(!_0xc1e02c[_0x7601('0x39')][_0x7601('0x40')](_0x7601('0x41'))){_0x7f4acb['limit']=qs[_0x7601('0x22')](_0xc1e02c[_0x7601('0x39')]['limit']);_0x7f4acb[_0x7601('0x21')]=qs['offset'](_0xc1e02c[_0x7601('0x39')]['offset']);}_0x7f4acb['order']=qs['sort'](_0xc1e02c[_0x7601('0x39')][_0x7601('0x42')]);_0x7f4acb[_0x7601('0x43')]=qs[_0x7601('0x3b')](_['pick'](_0xc1e02c[_0x7601('0x39')],_0x1bc4dc['filters']));if(_0xc1e02c[_0x7601('0x39')][_0x7601('0x2c')]){_0x7f4acb[_0x7601('0x43')]=_[_0x7601('0x44')](_0x7f4acb[_0x7601('0x43')],{'$or':_[_0x7601('0x2e')](_0x35a89f,function(_0x5c2215){if(_0x5c2215[_0x7601('0x30')]!=='VIRTUAL'){var _0x81b852={};_0x81b852[_0x5c2215[_0x7601('0x31')]]={'$like':'%'+_0xc1e02c['query']['filter']+'%'};return _0x81b852;}})});}_0x7f4acb=_['merge']({},_0x7f4acb,_0xc1e02c['options']);var _0x2f3394={'where':_0x7f4acb[_0x7601('0x43')]};return db[_0x7601('0x45')][_0x7601('0x20')](_0x2f3394)[_0x7601('0x28')](function(_0x15fc13){_0x246aaf[_0x7601('0x20')]=_0x15fc13;if(_0xc1e02c[_0x7601('0x39')][_0x7601('0x46')]){_0x7f4acb[_0x7601('0x47')]=[{'all':!![]}];}return db[_0x7601('0x45')][_0x7601('0x48')](_0x7f4acb);})[_0x7601('0x28')](function(_0xc9be4){_0x246aaf[_0x7601('0x49')]=_0xc9be4;return _0x246aaf;})[_0x7601('0x28')](respondWithFilteredResult(_0x5552a1,_0x7f4acb))['catch'](handleError(_0x5552a1,null));};exports[_0x7601('0x4a')]=function(_0x472339,_0x740a4d){var _0x3865dc={'raw':![],'where':{'id':_0x472339['params']['id']}},_0x27305e={};_0x27305e[_0x7601('0x38')]=_['keys'](db[_0x7601('0x45')][_0x7601('0x36')]);_0x27305e['query']=_['keys'](_0x472339[_0x7601('0x39')]);_0x27305e[_0x7601('0x3b')]=_[_0x7601('0x3c')](_0x27305e[_0x7601('0x38')],_0x27305e[_0x7601('0x39')]);_0x3865dc[_0x7601('0x3d')]=_['intersection'](_0x27305e[_0x7601('0x38')],qs['fields'](_0x472339['query'][_0x7601('0x3e')]));_0x3865dc[_0x7601('0x3d')]=_0x3865dc[_0x7601('0x3d')]['length']?_0x3865dc[_0x7601('0x3d')]:_0x27305e[_0x7601('0x38')];if(_0x472339['query'][_0x7601('0x46')]){_0x3865dc[_0x7601('0x47')]=[{'all':!![]}];}_0x3865dc=_[_0x7601('0x44')]({},_0x3865dc,_0x472339[_0x7601('0x4b')]);return db[_0x7601('0x45')][_0x7601('0x4c')](_0x3865dc)[_0x7601('0x28')](handleEntityNotFound(_0x740a4d,null))['then'](respondWithResult(_0x740a4d,null))[_0x7601('0x4d')](handleError(_0x740a4d,null));};exports[_0x7601('0x4e')]=function(_0x41d8bb,_0x5877e9){return db[_0x7601('0x45')][_0x7601('0x4e')](_0x41d8bb[_0x7601('0x4f')],{})[_0x7601('0x28')](function(_0x3df2c2){var _0x5b6cdd=_0x41d8bb[_0x7601('0x50')][_0x7601('0x2a')]({'plain':!![]});if(!_0x5b6cdd)throw new Error(_0x7601('0x51'));if(_0x5b6cdd[_0x7601('0x52')]===_0x7601('0x50')){var _0x5e5d39=_0x3df2c2['get']({'plain':!![]});var _0x1903f8=[{'name':_0x7601('0x53'),'value':_0x7601('0x54')},{'name':_0x7601('0x2b'),'value':'outbound'}];var _0x1615f3=_[_0x7601('0x4c')](_0x1903f8,[_0x7601('0x2f'),_0x5e5d39[_0x7601('0x30')]])[_0x7601('0x31')];return db[_0x7601('0x55')][_0x7601('0x4c')]({'where':{'name':_0x1615f3,'userProfileId':_0x5b6cdd[_0x7601('0x56')]},'raw':!![]})[_0x7601('0x28')](function(_0xb77fc5){if(_0xb77fc5&&_0xb77fc5[_0x7601('0x57')]===0x0){return db[_0x7601('0x32')][_0x7601('0x4e')]({'name':_0x5e5d39['name'],'resourceId':_0x5e5d39['id'],'type':_0xb77fc5[_0x7601('0x31')],'sectionId':_0xb77fc5['id']},{})['then'](function(){return _0x3df2c2;});}else{return _0x3df2c2;}})['catch'](function(_0x23a323){logger[_0x7601('0x33')](_0x7601('0x58'),_0x23a323);throw _0x23a323;});}return _0x3df2c2;})[_0x7601('0x28')](respondWithResult(_0x5877e9,0xc9))[_0x7601('0x4d')](handleError(_0x5877e9,null));};exports[_0x7601('0x59')]=function(_0x107ac0,_0xfcbc69){var _0x4ac971={'where':{'id':_0x107ac0[_0x7601('0x5a')]['id']}},_0x1b5d59={};_0x1b5d59[_0x7601('0x38')]=_[_0x7601('0x3a')](db[_0x7601('0x45')][_0x7601('0x36')]);_0x4ac971[_0x7601('0x3d')]=_['intersection'](_0x1b5d59[_0x7601('0x38')],qs['fields'](_0x107ac0[_0x7601('0x39')]['fields']));_0x4ac971[_0x7601('0x3d')]=_0x4ac971[_0x7601('0x3d')][_0x7601('0x3f')]?_0x4ac971[_0x7601('0x3d')]:_0x1b5d59[_0x7601('0x38')];if(_0x107ac0[_0x7601('0x39')][_0x7601('0x46')]){_0x4ac971[_0x7601('0x47')]=[{'all':!![]}];}_0x4ac971=_[_0x7601('0x44')]({},_0x4ac971,_0x107ac0[_0x7601('0x4b')]);return db['VoiceQueue'][_0x7601('0x4c')](_0x4ac971)[_0x7601('0x28')](handleEntityNotFound(_0xfcbc69,null))[_0x7601('0x28')](function(_0x18dfa7){if(_0x18dfa7){var _0x2c9534=_0x18dfa7['get']({'plain':!![]});_0x2c9534=qs[_0x7601('0x5b')](_0x2c9534,['id',_0x7601('0x5c'),_0x7601('0x5d')]);_0x107ac0[_0x7601('0x4f')]=_[_0x7601('0x5b')](_0x107ac0[_0x7601('0x4f')],['id',_0x7601('0x5c'),_0x7601('0x5d')]);return db[_0x7601('0x45')][_0x7601('0x4e')](_[_0x7601('0x44')](_0x2c9534,_0x107ac0[_0x7601('0x4f')]),{'include':_0x107ac0[_0x7601('0x39')][_0x7601('0x46')]?[{'all':!![]}]:undefined})[_0x7601('0x28')](function(_0x55833b){var _0x118619=_0x107ac0['user'][_0x7601('0x2a')]({'plain':!![]});if(!_0x118619)throw new Error(_0x7601('0x51'));if(_0x118619[_0x7601('0x52')]===_0x7601('0x50')){var _0x9c85e4=_0x55833b[_0x7601('0x2a')]({'plain':!![]});var _0x3aa9cd=[{'name':'VoiceQueues','value':_0x7601('0x54')},{'name':_0x7601('0x2b'),'value':_0x7601('0x5e')}];var _0x4b6561=_[_0x7601('0x4c')](_0x3aa9cd,['value',_0x9c85e4['type']])[_0x7601('0x31')];return db[_0x7601('0x55')]['find']({'where':{'name':_0x4b6561,'userProfileId':_0x118619[_0x7601('0x56')]},'raw':!![]})['then'](function(_0x52da8f){if(_0x52da8f&&_0x52da8f[_0x7601('0x57')]===0x0){return db[_0x7601('0x32')]['create']({'name':_0x9c85e4[_0x7601('0x31')],'resourceId':_0x9c85e4['id'],'type':_0x52da8f['name'],'sectionId':_0x52da8f['id']},{})['then'](function(){return _0x55833b;});}else{return _0x55833b;}})[_0x7601('0x4d')](function(_0x53edd8){logger['error'](_0x7601('0x58'),_0x53edd8);throw _0x53edd8;});}return _0x55833b;});}})[_0x7601('0x28')](respondWithResult(_0xfcbc69,0xc9))[_0x7601('0x4d')](handleError(_0xfcbc69,null));};exports[_0x7601('0x27')]=function(_0x9ec15c,_0x4cc25a){if(_0x9ec15c[_0x7601('0x4f')]['id']){delete _0x9ec15c['body']['id'];}return db[_0x7601('0x45')][_0x7601('0x4c')]({'where':{'id':_0x9ec15c[_0x7601('0x5a')]['id']}})[_0x7601('0x28')](handleEntityNotFound(_0x4cc25a,null))[_0x7601('0x28')](saveUpdates(_0x9ec15c['body'],null))[_0x7601('0x28')](respondWithResult(_0x4cc25a,null))[_0x7601('0x4d')](handleError(_0x4cc25a,null));};exports['destroy']=function(_0x5a3426,_0x271b83){return db[_0x7601('0x45')][_0x7601('0x4c')]({'where':{'id':_0x5a3426[_0x7601('0x5a')]['id']}})[_0x7601('0x28')](handleEntityNotFound(_0x271b83,null))[_0x7601('0x28')](removeEntity(_0x271b83,null))['catch'](handleError(_0x271b83,null));};exports['getHoppers']=function(_0xebd556,_0x59988c,_0x321e7a){var _0x3c1824={'raw':![],'where':{}};var _0x72cbe8={};var _0x47206c={'count':0x0,'rows':[]};return db[_0x7601('0x45')][_0x7601('0x5f')]({'where':{'id':_0xebd556[_0x7601('0x5a')]['id']}})[_0x7601('0x28')](handleEntityNotFound(_0x59988c,null))['then'](function(_0x1c9a36){if(_0x1c9a36){_0x72cbe8[_0x7601('0x38')]=_[_0x7601('0x3a')](db[_0x7601('0x60')][_0x7601('0x36')]);_0x72cbe8[_0x7601('0x39')]=_['keys'](_0xebd556['query']);_0x72cbe8[_0x7601('0x3b')]=_[_0x7601('0x3c')](_0x72cbe8[_0x7601('0x38')],_0x72cbe8[_0x7601('0x39')]);_0x3c1824['attributes']=_[_0x7601('0x3c')](_0x72cbe8[_0x7601('0x38')],qs['fields'](_0xebd556[_0x7601('0x39')]['fields']));_0x3c1824[_0x7601('0x3d')]=_0x3c1824[_0x7601('0x3d')][_0x7601('0x3f')]?_0x3c1824[_0x7601('0x3d')]:_0x72cbe8[_0x7601('0x38')];if(!_0xebd556[_0x7601('0x39')][_0x7601('0x40')](_0x7601('0x41'))){_0x3c1824[_0x7601('0x22')]=qs[_0x7601('0x22')](_0xebd556['query'][_0x7601('0x22')]);_0x3c1824['offset']=qs[_0x7601('0x21')](_0xebd556[_0x7601('0x39')][_0x7601('0x21')]);}_0x3c1824['order']=qs[_0x7601('0x42')](_0xebd556[_0x7601('0x39')][_0x7601('0x42')]);_0x3c1824[_0x7601('0x43')]=qs[_0x7601('0x3b')](_[_0x7601('0x61')](_0xebd556['query'],_0x72cbe8['filters']));_0x3c1824[_0x7601('0x43')]['VoiceQueueId']=_0x1c9a36['id'];if(_0xebd556[_0x7601('0x39')][_0x7601('0x2c')]){_0x3c1824[_0x7601('0x43')]=_[_0x7601('0x44')](_0x3c1824[_0x7601('0x43')],{'$or':_[_0x7601('0x2e')](_0x3c1824['attributes'],function(_0x48d826){var _0x20582c={};_0x20582c[_0x48d826]={'$like':'%'+_0xebd556['query'][_0x7601('0x2c')]+'%'};return _0x20582c;})});}_0x3c1824=_['merge']({},_0x3c1824,_0xebd556[_0x7601('0x4b')]);return db[_0x7601('0x60')][_0x7601('0x20')]({'where':_0x3c1824[_0x7601('0x43')]})['then'](function(_0x4aa85f){_0x47206c['count']=_0x4aa85f;if(_0xebd556[_0x7601('0x39')][_0x7601('0x46')]){_0x3c1824[_0x7601('0x47')]=[{'all':!![]}];}return db[_0x7601('0x60')]['findAll'](_0x3c1824);})[_0x7601('0x28')](function(_0x1fef0d){_0x47206c['rows']=_0x1fef0d;return _0x47206c;});}})[_0x7601('0x28')](respondWithFilteredResult(_0x59988c,_0x3c1824))['catch'](handleError(_0x59988c,null));};exports[_0x7601('0x62')]=function(_0x4e37fb,_0x16fd98,_0x44e2ac){var _0xfd7b3e={'raw':!![],'where':{}};var _0x31d0cb={};var _0x5dcc61={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x4e37fb[_0x7601('0x5a')]['id']}})[_0x7601('0x28')](handleEntityNotFound(_0x16fd98,null))[_0x7601('0x28')](function(_0x29269c){if(_0x29269c){_0x31d0cb['model']=_[_0x7601('0x3a')](db[_0x7601('0x63')][_0x7601('0x36')]);_0x31d0cb[_0x7601('0x39')]=_['keys'](_0x4e37fb[_0x7601('0x39')]);_0x31d0cb[_0x7601('0x3b')]=_[_0x7601('0x3c')](_0x31d0cb[_0x7601('0x38')],_0x31d0cb['query']);_0xfd7b3e[_0x7601('0x3d')]=_[_0x7601('0x3c')](_0x31d0cb['model'],qs[_0x7601('0x3e')](_0x4e37fb['query'][_0x7601('0x3e')]));_0xfd7b3e[_0x7601('0x3d')]=_0xfd7b3e[_0x7601('0x3d')][_0x7601('0x3f')]?_0xfd7b3e['attributes']:_0x31d0cb['model'];if(!_0x4e37fb[_0x7601('0x39')][_0x7601('0x40')](_0x7601('0x41'))){_0xfd7b3e[_0x7601('0x22')]=qs['limit'](_0x4e37fb[_0x7601('0x39')][_0x7601('0x22')]);_0xfd7b3e[_0x7601('0x21')]=qs['offset'](_0x4e37fb['query'][_0x7601('0x21')]);}_0xfd7b3e[_0x7601('0x64')]=qs['sort'](_0x4e37fb[_0x7601('0x39')][_0x7601('0x42')]);_0xfd7b3e[_0x7601('0x43')]=qs[_0x7601('0x3b')](_[_0x7601('0x61')](_0x4e37fb[_0x7601('0x39')],_0x31d0cb[_0x7601('0x3b')]));_0xfd7b3e[_0x7601('0x43')][_0x7601('0x65')]=_0x29269c['id'];if(_0x4e37fb[_0x7601('0x39')][_0x7601('0x2c')]){_0xfd7b3e['where']=_[_0x7601('0x44')](_0xfd7b3e[_0x7601('0x43')],{'$or':_['map'](_0xfd7b3e[_0x7601('0x3d')],function(_0x5bbc82){var _0x56178f={};_0x56178f[_0x5bbc82]={'$like':'%'+_0x4e37fb[_0x7601('0x39')][_0x7601('0x2c')]+'%'};return _0x56178f;})});}_0xfd7b3e=_[_0x7601('0x44')]({},_0xfd7b3e,_0x4e37fb[_0x7601('0x4b')]);return db[_0x7601('0x63')][_0x7601('0x20')]({'where':_0xfd7b3e[_0x7601('0x43')]})[_0x7601('0x28')](function(_0x396d25){_0x5dcc61[_0x7601('0x20')]=_0x396d25;if(_0x4e37fb['query'][_0x7601('0x46')]){_0xfd7b3e[_0x7601('0x47')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x7601('0x48')](_0xfd7b3e);})['then'](function(_0xc91b38){_0x5dcc61['rows']=_0xc91b38;return _0x5dcc61;});}})[_0x7601('0x28')](respondWithFilteredResult(_0x16fd98,_0xfd7b3e))[_0x7601('0x4d')](handleError(_0x16fd98,null));};exports[_0x7601('0x66')]=function(_0xe134c3,_0x246da6,_0x2f29ee){var _0x131a58={'raw':!![],'where':{}};var _0x450e35={};var _0x5cb82e={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x7601('0x5f')]({'where':{'id':_0xe134c3[_0x7601('0x5a')]['id']}})['then'](handleEntityNotFound(_0x246da6,null))[_0x7601('0x28')](function(_0x3ecbe7){if(_0x3ecbe7){_0x450e35[_0x7601('0x38')]=_[_0x7601('0x3a')](db[_0x7601('0x67')][_0x7601('0x36')]);_0x450e35[_0x7601('0x39')]=_[_0x7601('0x3a')](_0xe134c3['query']);_0x450e35[_0x7601('0x3b')]=_[_0x7601('0x3c')](_0x450e35[_0x7601('0x38')],_0x450e35[_0x7601('0x39')]);_0x131a58[_0x7601('0x3d')]=_['intersection'](_0x450e35[_0x7601('0x38')],qs[_0x7601('0x3e')](_0xe134c3[_0x7601('0x39')][_0x7601('0x3e')]));_0x131a58[_0x7601('0x3d')]=_0x131a58['attributes']['length']?_0x131a58[_0x7601('0x3d')]:_0x450e35[_0x7601('0x38')];if(!_0xe134c3[_0x7601('0x39')][_0x7601('0x40')](_0x7601('0x41'))){_0x131a58['limit']=qs[_0x7601('0x22')](_0xe134c3[_0x7601('0x39')][_0x7601('0x22')]);_0x131a58[_0x7601('0x21')]=qs[_0x7601('0x21')](_0xe134c3[_0x7601('0x39')][_0x7601('0x21')]);}_0x131a58[_0x7601('0x64')]=qs['sort'](_0xe134c3['query'][_0x7601('0x42')]);_0x131a58['where']=qs[_0x7601('0x3b')](_[_0x7601('0x61')](_0xe134c3['query'],_0x450e35['filters']));_0x131a58['where'][_0x7601('0x65')]=_0x3ecbe7['id'];if(_0xe134c3['query'][_0x7601('0x2c')]){_0x131a58['where']=_[_0x7601('0x44')](_0x131a58[_0x7601('0x43')],{'$or':_['map'](_0x131a58[_0x7601('0x3d')],function(_0x5aff53){var _0x55f9dd={};_0x55f9dd[_0x5aff53]={'$like':'%'+_0xe134c3['query']['filter']+'%'};return _0x55f9dd;})});}_0x131a58=_[_0x7601('0x44')]({},_0x131a58,_0xe134c3['options']);return db[_0x7601('0x67')]['count']({'where':_0x131a58['where']})[_0x7601('0x28')](function(_0x8d400f){_0x5cb82e['count']=_0x8d400f;if(_0xe134c3['query'][_0x7601('0x46')]){_0x131a58[_0x7601('0x47')]=[{'all':!![]}];}return db[_0x7601('0x67')][_0x7601('0x48')](_0x131a58);})['then'](function(_0x3fb762){_0x5cb82e[_0x7601('0x49')]=_0x3fb762;return _0x5cb82e;});}})[_0x7601('0x28')](respondWithFilteredResult(_0x246da6,_0x131a58))['catch'](handleError(_0x246da6,null));};exports['getHopperBlacks']=function(_0x57146e,_0x284431,_0x3b7c30){var _0x27e841={'raw':!![],'where':{}};var _0x3aae80={};var _0x4448ab={'count':0x0,'rows':[]};return db[_0x7601('0x45')][_0x7601('0x5f')]({'where':{'id':_0x57146e[_0x7601('0x5a')]['id']}})[_0x7601('0x28')](handleEntityNotFound(_0x284431,null))['then'](function(_0x54019f){if(_0x54019f){_0x3aae80[_0x7601('0x38')]=_[_0x7601('0x3a')](db[_0x7601('0x68')]['rawAttributes']);_0x3aae80[_0x7601('0x39')]=_[_0x7601('0x3a')](_0x57146e['query']);_0x3aae80[_0x7601('0x3b')]=_['intersection'](_0x3aae80[_0x7601('0x38')],_0x3aae80[_0x7601('0x39')]);_0x27e841[_0x7601('0x3d')]=_[_0x7601('0x3c')](_0x3aae80[_0x7601('0x38')],qs[_0x7601('0x3e')](_0x57146e[_0x7601('0x39')][_0x7601('0x3e')]));_0x27e841['attributes']=_0x27e841[_0x7601('0x3d')][_0x7601('0x3f')]?_0x27e841[_0x7601('0x3d')]:_0x3aae80[_0x7601('0x38')];if(!_0x57146e['query'][_0x7601('0x40')](_0x7601('0x41'))){_0x27e841[_0x7601('0x22')]=qs[_0x7601('0x22')](_0x57146e[_0x7601('0x39')][_0x7601('0x22')]);_0x27e841[_0x7601('0x21')]=qs['offset'](_0x57146e['query']['offset']);}_0x27e841['order']=qs[_0x7601('0x42')](_0x57146e['query'][_0x7601('0x42')]);_0x27e841[_0x7601('0x43')]=qs[_0x7601('0x3b')](_[_0x7601('0x61')](_0x57146e[_0x7601('0x39')],_0x3aae80[_0x7601('0x3b')]));_0x27e841[_0x7601('0x43')][_0x7601('0x65')]=_0x54019f['id'];if(_0x57146e['query'][_0x7601('0x2c')]){_0x27e841['where']=_['merge'](_0x27e841['where'],{'$or':_['map'](_0x27e841['attributes'],function(_0x1f2b29){var _0x1f695b={};_0x1f695b[_0x1f2b29]={'$like':'%'+_0x57146e[_0x7601('0x39')][_0x7601('0x2c')]+'%'};return _0x1f695b;})});}_0x27e841=_[_0x7601('0x44')]({},_0x27e841,_0x57146e['options']);return db['CmHopperBlack'][_0x7601('0x20')]({'where':_0x27e841[_0x7601('0x43')]})[_0x7601('0x28')](function(_0x59c7c9){_0x4448ab[_0x7601('0x20')]=_0x59c7c9;if(_0x57146e[_0x7601('0x39')][_0x7601('0x46')]){_0x27e841[_0x7601('0x47')]=[{'all':!![]}];}return db[_0x7601('0x68')][_0x7601('0x48')](_0x27e841);})[_0x7601('0x28')](function(_0x492d85){_0x4448ab[_0x7601('0x49')]=_0x492d85;return _0x4448ab;});}})[_0x7601('0x28')](respondWithFilteredResult(_0x284431,_0x27e841))[_0x7601('0x4d')](handleError(_0x284431,null));};exports[_0x7601('0x69')]=function(_0x5c0d8e,_0x6269be,_0x3f0853){var _0x274e1f={};var _0x25d2e9={};var _0x3d3a7b;var _0x20cc28;return db[_0x7601('0x45')]['findOne']({'where':{'id':_0x5c0d8e['params']['id']}})[_0x7601('0x28')](handleEntityNotFound(_0x6269be,null))[_0x7601('0x28')](function(_0x3cba3a){if(_0x3cba3a){_0x3d3a7b=_0x3cba3a;_0x25d2e9[_0x7601('0x38')]=_['keys'](db['Team']['rawAttributes']);_0x25d2e9['query']=_[_0x7601('0x3a')](_0x5c0d8e[_0x7601('0x39')]);_0x25d2e9[_0x7601('0x3b')]=_['intersection'](_0x25d2e9['model'],_0x25d2e9[_0x7601('0x39')]);_0x274e1f[_0x7601('0x3d')]=_[_0x7601('0x3c')](_0x25d2e9[_0x7601('0x38')],qs[_0x7601('0x3e')](_0x5c0d8e[_0x7601('0x39')][_0x7601('0x3e')]));_0x274e1f[_0x7601('0x3d')]=_0x274e1f[_0x7601('0x3d')][_0x7601('0x3f')]?_0x274e1f[_0x7601('0x3d')]:_0x25d2e9[_0x7601('0x38')];_0x274e1f[_0x7601('0x64')]=qs['sort'](_0x5c0d8e[_0x7601('0x39')][_0x7601('0x42')]);_0x274e1f[_0x7601('0x43')]=qs[_0x7601('0x3b')](_['pick'](_0x5c0d8e[_0x7601('0x39')],_0x25d2e9['filters']));if(_0x5c0d8e[_0x7601('0x39')][_0x7601('0x2c')]){_0x274e1f['where']=_[_0x7601('0x44')](_0x274e1f[_0x7601('0x43')],{'$or':_['map'](_0x274e1f[_0x7601('0x3d')],function(_0x1bc39c){var _0x1bbc98={};_0x1bbc98[_0x1bc39c]={'$like':'%'+_0x5c0d8e[_0x7601('0x39')][_0x7601('0x2c')]+'%'};return _0x1bbc98;})});}_0x274e1f=_['merge']({},_0x274e1f,_0x5c0d8e[_0x7601('0x4b')]);return _0x3d3a7b[_0x7601('0x69')](_0x274e1f);}})[_0x7601('0x28')](function(_0x59ed35){if(_0x59ed35){_0x20cc28=_0x59ed35[_0x7601('0x3f')];if(!_0x5c0d8e['query'][_0x7601('0x40')](_0x7601('0x41'))){_0x274e1f[_0x7601('0x22')]=qs[_0x7601('0x22')](_0x5c0d8e[_0x7601('0x39')][_0x7601('0x22')]);_0x274e1f[_0x7601('0x21')]=qs['offset'](_0x5c0d8e[_0x7601('0x39')][_0x7601('0x21')]);}return _0x3d3a7b['getTeams'](_0x274e1f);}})['then'](function(_0x12f7ad){if(_0x12f7ad){return _0x12f7ad?{'count':_0x20cc28,'rows':_0x12f7ad}:null;}})[_0x7601('0x28')](respondWithResult(_0x6269be,null))[_0x7601('0x4d')](handleError(_0x6269be,null));};exports[_0x7601('0x6a')]=function(_0x1aa456,_0x4cfaa3,_0x555520){var _0x28c847=_0x1aa456[_0x7601('0x4f')][_0x7601('0x6b')];var _0x334373=_[_0x7601('0x2e')](_0x28c847,'id');return db[_0x7601('0x6c')][_0x7601('0x48')]({'where':{'id':_0x334373},'attributes':['id'],'include':[{'model':db[_0x7601('0x6d')],'as':_0x7601('0x6e'),'attributes':['id',_0x7601('0x31'),_0x7601('0x6f'),_0x7601('0x70'),'interface'],'raw':!![]}]})[_0x7601('0x28')](function(_0x401646){if(_0x401646){var _0x429656=_[_0x7601('0x71')](_0x401646,function(_0x39b9f1){var _0x209592=_0x39b9f1[_0x7601('0x2a')]({'plain':!![]});_0x209592[_0x7601('0x6e')][_0x7601('0x72')](function(_0x3db9bf){_0x3db9bf[_0x7601('0x73')]=_[_0x7601('0x4c')](_0x28c847,{'id':_0x209592['id']})[_0x7601('0x73')];});return _0x209592[_0x7601('0x6e')];});return db[_0x7601('0x45')]['find']({'where':{'id':_0x1aa456[_0x7601('0x5a')]['id']}})['then'](function(_0x1ef186){return db[_0x7601('0x74')]['transaction'](function(_0x36fef3){return _0x1ef186[_0x7601('0x6a')](_0x334373,{'transaction':_0x36fef3})[_0x7601('0x28')](function(){return BPromise[_0x7601('0x75')](_0x429656,function(_0x5c3425){return db[_0x7601('0x76')]['findOrCreate']({'where':{'UserId':_0x5c3425['id'],'VoiceQueueId':_0x1aa456['params']['id']},'defaults':{'penalty':_0x5c3425['penalty']},'transaction':_0x36fef3});});})[_0x7601('0x28')](function(){return BPromise['each'](_[_0x7601('0x2c')](_0x429656,{'online':!![]}),function(_0x356de5){return db[_0x7601('0x77')]['upsert']({'membername':_0x356de5[_0x7601('0x31')],'UserId':_0x356de5['id'],'queue_name':_0x1ef186['name'],'VoiceQueueId':_0x1ef186['id'],'interface':_['isNil'](_0x356de5['interface'])?util[_0x7601('0x78')]('SIP/%s',_0x356de5[_0x7601('0x31')]):_0x356de5[_0x7601('0x79')],'paused':_0x356de5[_0x7601('0x70')]||![],'penalty':_0x356de5[_0x7601('0x73')]},{'transaction':_0x36fef3});});})['then'](function(){_0x429656[_0x7601('0x72')](function(_0x16b33e){socket[_0x7601('0x7a')]('userVoiceQueue:save',{'UserId':_0x16b33e['id'],'VoiceQueueId':_0x1ef186['id']});});});});});}})['then'](respondWithStatusCode(_0x4cfaa3,null))[_0x7601('0x4d')](handleError(_0x4cfaa3,null));};exports['removeTeams']=function(_0x328502,_0x21c724,_0x28220d){return db[_0x7601('0x6c')][_0x7601('0x48')]({'where':{'id':_0x328502[_0x7601('0x39')][_0x7601('0x7b')]},'attributes':['id'],'include':[{'model':db[_0x7601('0x6d')],'as':_0x7601('0x6e'),'attributes':['id'],'raw':!![]}]})[_0x7601('0x28')](handleEntityNotFound(_0x21c724,null))[_0x7601('0x28')](function(_0x2ffbfc){var _0x284d39=_[_0x7601('0x2e')](_0x2ffbfc,'id');var _0x1d7cbe=[];var _0x51bc07=[];var _0x25d1a1=squel[_0x7601('0x7c')]();_0x25d1a1['field'](_0x7601('0x7d'))[_0x7601('0x7e')](_0x7601('0x7f'),'tq')[_0x7601('0x80')](_0x7601('0x81'),'ut',_0x7601('0x82'))['where'](_0x7601('0x83'),_0x328502[_0x7601('0x5a')]['id']);for(var _0x1b1f26=0x0;_0x1b1f26<_0x2ffbfc['length'];_0x1b1f26+=0x1){let _0x51f3fa=_0x2ffbfc[_0x1b1f26];for(var _0x2f93b2=0x0;_0x2f93b2<_0x51f3fa['Agents'][_0x7601('0x3f')];_0x2f93b2+=0x1){let _0x574585=_0x51f3fa['Agents'][_0x2f93b2];var _0x343569=_0x25d1a1[_0x7601('0x59')]();_0x343569['where'](_0x7601('0x84'),_0x574585['id']);_0x51bc07[_0x7601('0x85')](db[_0x7601('0x74')]['query'](_0x343569[_0x7601('0x86')](),{'type':db[_0x7601('0x74')]['QueryTypes']['SELECT']})[_0x7601('0x28')](function(_0x4a03d8){if(_0x4a03d8['length']===0x1){return _0x574585['id'];}else{var _0x1357b8=_[_0x7601('0x87')](_[_0x7601('0x2e')](_0x4a03d8,_0x7601('0x88')),function(_0x118a83){return _['includes'](_0x284d39,_0x118a83);});if(_0x1357b8){return _0x574585['id'];}}}));}}return BPromise[_0x7601('0x89')](_0x51bc07)[_0x7601('0x28')](function(_0x3f7e42){_0x1d7cbe=_(_0x1d7cbe)[_0x7601('0x8a')](_0x3f7e42)[_0x7601('0x8b')]()[_0x7601('0x2f')]();return db[_0x7601('0x45')][_0x7601('0x4c')]({'where':{'id':_0x328502[_0x7601('0x5a')]['id']}})[_0x7601('0x28')](function(_0x29a51f){return db[_0x7601('0x74')][_0x7601('0x8c')](function(_0x5b73d0){return _0x29a51f['removeTeams'](_0x328502[_0x7601('0x39')][_0x7601('0x7b')],{'transaction':_0x5b73d0})[_0x7601('0x28')](function(){if(!_[_0x7601('0x8d')](_0x1d7cbe)){return _0x29a51f[_0x7601('0x8e')](_0x1d7cbe,{'transaction':_0x5b73d0})[_0x7601('0x28')](function(){return db[_0x7601('0x77')][_0x7601('0x29')]({'where':{'VoiceQueueId':_0x328502[_0x7601('0x5a')]['id'],'UserId':_0x1d7cbe},'transaction':_0x5b73d0});});}})[_0x7601('0x28')](function(){_0x1d7cbe[_0x7601('0x72')](function(_0x3862b5){socket[_0x7601('0x7a')](_0x7601('0x8f'),{'UserId':_0x3862b5,'VoiceQueueId':_0x29a51f['id']});});});});});});})[_0x7601('0x28')](respondWithStatusCode(_0x21c724,null))[_0x7601('0x4d')](handleError(_0x21c724,null));};exports[_0x7601('0x90')]=function(_0x3cb512,_0x4c8af4,_0x3791d9){var _0x3e9422,_0x5c58d0;return db[_0x7601('0x45')][_0x7601('0x4c')]({'where':{'id':_0x3cb512[_0x7601('0x5a')]['id']}})[_0x7601('0x28')](handleEntityNotFound(_0x4c8af4,null))['then'](function(_0x5dce1e){if(_0x5dce1e){_0x5c58d0=_0x5dce1e;return _0x5dce1e[_0x7601('0x90')](_0x3cb512['body'][_0x7601('0x7b')],_['omit'](_0x3cb512[_0x7601('0x4f')],[_0x7601('0x7b'),'id'])||{})['spread'](function(_0x583e16){for(var _0x585cac=0x0;_0x585cac<_0x3cb512['body'][_0x7601('0x7b')]['length'];_0x585cac+=0x1){socket[_0x7601('0x7a')](_0x7601('0x91'),{'UserId':_0x3cb512['body']['ids'][_0x585cac],'VoiceQueueId':_0x3cb512[_0x7601('0x5a')]['id']});}return _0x583e16;});}})[_0x7601('0x28')](function(_0x5937b1){_0x3e9422=_0x5937b1||[];if(_0x5c58d0){return db[_0x7601('0x6d')]['findAll']({'where':{'id':_0x3cb512['body'][_0x7601('0x7b')]},'attributes':['id',_0x7601('0x31'),'online','voicePause',_0x7601('0x79')],'raw':!![]});}})[_0x7601('0x28')](function(_0x418b85){if(!_[_0x7601('0x8d')](_0x418b85)){var _0x4372da=[];for(var _0x446ae4=0x0;_0x446ae4<_0x418b85[_0x7601('0x3f')];_0x446ae4++){if(_0x418b85[_0x446ae4][_0x7601('0x6f')]){_0x4372da[_0x7601('0x85')](db[_0x7601('0x77')][_0x7601('0x92')]({'membername':_0x418b85[_0x446ae4][_0x7601('0x31')],'UserId':_0x418b85[_0x446ae4]['id'],'queue_name':_0x5c58d0[_0x7601('0x31')],'VoiceQueueId':_0x5c58d0['id'],'interface':_[_0x7601('0x93')](_0x418b85[_0x446ae4]['interface'])?util[_0x7601('0x78')](_0x7601('0x94'),_0x418b85[_0x446ae4][_0x7601('0x31')]):_0x418b85[_0x446ae4][_0x7601('0x79')],'paused':_0x418b85[_0x446ae4][_0x7601('0x70')]||![],'penalty':_0x3cb512[_0x7601('0x4f')][_0x7601('0x73')]||0x0}));}}return BPromise[_0x7601('0x89')](_0x4372da);}})['then'](function(){return _0x3e9422;})[_0x7601('0x28')](respondWithResult(_0x4c8af4,null))[_0x7601('0x4d')](handleError(_0x4c8af4,null));};exports['removeAgents']=function(_0x3028f7,_0x298dad,_0x2be7e8){return db['VoiceQueue'][_0x7601('0x4c')]({'where':{'id':_0x3028f7[_0x7601('0x5a')]['id']}})[_0x7601('0x28')](handleEntityNotFound(_0x298dad,null))[_0x7601('0x28')](function(_0x50351c){if(_0x50351c){return _0x50351c[_0x7601('0x8e')](_0x3028f7['query'][_0x7601('0x7b')])[_0x7601('0x28')](function(){if(_[_0x7601('0x95')](_0x3028f7['query'][_0x7601('0x7b')])){for(var _0x9f5bb5=0x0;_0x9f5bb5<_0x3028f7['query']['ids'][_0x7601('0x3f')];_0x9f5bb5+=0x1){socket['emit'](_0x7601('0x8f'),{'UserId':Number(_0x3028f7[_0x7601('0x39')]['ids'][_0x9f5bb5]),'VoiceQueueId':Number(_0x3028f7[_0x7601('0x5a')]['id'])});}}else{socket[_0x7601('0x7a')]('userVoiceQueue:remove',{'UserId':Number(_0x3028f7[_0x7601('0x39')][_0x7601('0x7b')]),'VoiceQueueId':Number(_0x3028f7[_0x7601('0x5a')]['id'])});}});}})['then'](function(_0x33c794){return db[_0x7601('0x77')]['destroy']({'where':{'VoiceQueueId':_0x3028f7[_0x7601('0x5a')]['id'],'UserId':_0x3028f7[_0x7601('0x39')][_0x7601('0x7b')]}})[_0x7601('0x28')](function(){return _0x33c794;});})['then'](respondWithStatusCode(_0x298dad,null))[_0x7601('0x4d')](handleError(_0x298dad,null));};exports['getAgents']=function(_0x44df64,_0x15d28,_0x3f30c8){var _0x235038={};var _0x2b6002={};var _0x10ff27;var _0x4c06a3;return db['VoiceQueue']['findOne']({'where':{'id':_0x44df64[_0x7601('0x5a')]['id']}})[_0x7601('0x28')](handleEntityNotFound(_0x15d28,null))[_0x7601('0x28')](function(_0x2db31d){if(_0x2db31d){_0x10ff27=_0x2db31d;_0x2b6002[_0x7601('0x38')]=_['keys'](db['User'][_0x7601('0x36')]);_0x2b6002['query']=_[_0x7601('0x3a')](_0x44df64[_0x7601('0x39')]);_0x2b6002[_0x7601('0x3b')]=_[_0x7601('0x3c')](_0x2b6002[_0x7601('0x38')],_0x2b6002[_0x7601('0x39')]);_0x235038[_0x7601('0x3d')]=_[_0x7601('0x3c')](_0x2b6002['model'],qs['fields'](_0x44df64[_0x7601('0x39')][_0x7601('0x3e')]));_0x235038[_0x7601('0x3d')]=_0x235038[_0x7601('0x3d')][_0x7601('0x3f')]?_0x235038[_0x7601('0x3d')]:_0x2b6002['model'];_0x235038[_0x7601('0x64')]=qs['sort'](_0x44df64['query']['sort']);_0x235038[_0x7601('0x43')]=qs[_0x7601('0x3b')](_[_0x7601('0x61')](_0x44df64['query'],_0x2b6002['filters']));if(_0x44df64['query'][_0x7601('0x2c')]){_0x235038[_0x7601('0x43')]=_[_0x7601('0x44')](_0x235038[_0x7601('0x43')],{'$or':_[_0x7601('0x2e')](_0x235038[_0x7601('0x3d')],function(_0x18c7a1){var _0x5538c4={};_0x5538c4[_0x18c7a1]={'$like':'%'+_0x44df64['query'][_0x7601('0x2c')]+'%'};return _0x5538c4;})});}_0x235038=_[_0x7601('0x44')]({},_0x235038,_0x44df64[_0x7601('0x4b')]);return _0x10ff27[_0x7601('0x96')](_0x235038);}})['then'](function(_0x5f75e0){if(_0x5f75e0){_0x4c06a3=_0x5f75e0[_0x7601('0x3f')];if(!_0x44df64['query'][_0x7601('0x40')](_0x7601('0x41'))){_0x235038[_0x7601('0x22')]=qs[_0x7601('0x22')](_0x44df64[_0x7601('0x39')][_0x7601('0x22')]);_0x235038[_0x7601('0x21')]=qs['offset'](_0x44df64['query'][_0x7601('0x21')]);}return _0x10ff27['getAgents'](_0x235038);}})[_0x7601('0x28')](function(_0x15483f){if(_0x15483f){return _0x15483f?{'count':_0x4c06a3,'rows':_0x15483f}:null;}})['then'](respondWithResult(_0x15d28,null))[_0x7601('0x4d')](handleError(_0x15d28,null));};exports[_0x7601('0x97')]=function(_0x342d5d,_0x3f80e5,_0x5da079){var _0x55f812={};var _0x2d72f1={};var _0x5c620a;var _0x2174c0;return db['VoiceQueue'][_0x7601('0x5f')]({'where':{'id':_0x342d5d[_0x7601('0x5a')]['id']}})[_0x7601('0x28')](handleEntityNotFound(_0x3f80e5,null))[_0x7601('0x28')](function(_0x3b7fb2){if(_0x3b7fb2){_0x5c620a=_0x3b7fb2;_0x2d72f1[_0x7601('0x38')]=_['keys'](db[_0x7601('0x77')][_0x7601('0x36')]);_0x2d72f1[_0x7601('0x39')]=_['keys'](_0x342d5d[_0x7601('0x39')]);_0x2d72f1[_0x7601('0x3b')]=_[_0x7601('0x3c')](_0x2d72f1['model'],_0x2d72f1[_0x7601('0x39')]);_0x55f812[_0x7601('0x3d')]=_['intersection'](_0x2d72f1[_0x7601('0x38')],qs['fields'](_0x342d5d[_0x7601('0x39')][_0x7601('0x3e')]));_0x55f812[_0x7601('0x3d')]=_0x55f812[_0x7601('0x3d')]['length']?_0x55f812['attributes']:_0x2d72f1[_0x7601('0x38')];_0x55f812['order']=qs[_0x7601('0x42')](_0x342d5d[_0x7601('0x39')][_0x7601('0x42')]);_0x55f812['where']=qs[_0x7601('0x3b')](_[_0x7601('0x61')](_0x342d5d[_0x7601('0x39')],_0x2d72f1['filters']));if(_0x342d5d['query'][_0x7601('0x2c')]){_0x55f812[_0x7601('0x43')]=_[_0x7601('0x44')](_0x55f812[_0x7601('0x43')],{'$or':_[_0x7601('0x2e')](_0x55f812[_0x7601('0x3d')],function(_0x1a3ce2){var _0x344618={};_0x344618[_0x1a3ce2]={'$like':'%'+_0x342d5d[_0x7601('0x39')][_0x7601('0x2c')]+'%'};return _0x344618;})});}_0x55f812=_[_0x7601('0x44')]({},_0x55f812,_0x342d5d[_0x7601('0x4b')]);return _0x5c620a[_0x7601('0x97')](_0x55f812);}})['then'](function(_0x260ecb){if(_0x260ecb){_0x2174c0=_0x260ecb[_0x7601('0x3f')];if(!_0x342d5d[_0x7601('0x39')][_0x7601('0x40')](_0x7601('0x41'))){_0x55f812[_0x7601('0x22')]=qs[_0x7601('0x22')](_0x342d5d['query'][_0x7601('0x22')]);_0x55f812['offset']=qs[_0x7601('0x21')](_0x342d5d[_0x7601('0x39')][_0x7601('0x21')]);}return _0x5c620a[_0x7601('0x97')](_0x55f812);}})['then'](function(_0x52684e){return _0x52684e?{'count':_0x2174c0,'rows':_0x52684e}:null;})[_0x7601('0x28')](respondWithResult(_0x3f80e5,null))['catch'](handleError(_0x3f80e5,null));};exports[_0x7601('0x98')]=function(_0x375f5c,_0x31e69d,_0x11a39d){var _0x1ccfb8={};var _0x3d871b={};var _0x753a66;var _0x5d0d2e;return db['VoiceQueue'][_0x7601('0x5f')]({'where':{'id':_0x375f5c[_0x7601('0x5a')]['id']}})[_0x7601('0x28')](handleEntityNotFound(_0x31e69d,null))[_0x7601('0x28')](function(_0x155721){if(_0x155721){_0x753a66=_0x155721;_0x3d871b[_0x7601('0x38')]=_[_0x7601('0x3a')](db[_0x7601('0x99')]['rawAttributes']);_0x3d871b[_0x7601('0x39')]=_[_0x7601('0x3a')](_0x375f5c[_0x7601('0x39')]);_0x3d871b[_0x7601('0x3b')]=_['intersection'](_0x3d871b[_0x7601('0x38')],_0x3d871b[_0x7601('0x39')]);_0x1ccfb8[_0x7601('0x3d')]=_[_0x7601('0x3c')](_0x3d871b[_0x7601('0x38')],qs[_0x7601('0x3e')](_0x375f5c[_0x7601('0x39')][_0x7601('0x3e')]));_0x1ccfb8[_0x7601('0x3d')]=_0x1ccfb8['attributes'][_0x7601('0x3f')]?_0x1ccfb8['attributes']:_0x3d871b['model'];_0x1ccfb8[_0x7601('0x64')]=qs[_0x7601('0x42')](_0x375f5c['query']['sort']);_0x1ccfb8[_0x7601('0x43')]=qs['filters'](_['pick'](_0x375f5c[_0x7601('0x39')],_0x3d871b[_0x7601('0x3b')]));if(_0x375f5c[_0x7601('0x39')]['filter']){_0x1ccfb8[_0x7601('0x43')]=_[_0x7601('0x44')](_0x1ccfb8['where'],{'$or':_[_0x7601('0x2e')](_0x1ccfb8[_0x7601('0x3d')],function(_0x20d098){var _0xadf09e={};_0xadf09e[_0x20d098]={'$like':'%'+_0x375f5c['query'][_0x7601('0x2c')]+'%'};return _0xadf09e;})});}_0x1ccfb8=_['merge']({},_0x1ccfb8,_0x375f5c[_0x7601('0x4b')]);return _0x753a66['getLists'](_0x1ccfb8);}})[_0x7601('0x28')](function(_0x56201f){if(_0x56201f){_0x5d0d2e=_0x56201f[_0x7601('0x3f')];if(!_0x375f5c[_0x7601('0x39')]['hasOwnProperty'](_0x7601('0x41'))){_0x1ccfb8[_0x7601('0x22')]=qs['limit'](_0x375f5c[_0x7601('0x39')][_0x7601('0x22')]);_0x1ccfb8['offset']=qs[_0x7601('0x21')](_0x375f5c[_0x7601('0x39')][_0x7601('0x21')]);}return _0x753a66[_0x7601('0x98')](_0x1ccfb8);}})['then'](function(_0x269276){if(_0x269276){return _0x269276?{'count':_0x5d0d2e,'rows':_0x269276}:null;}})[_0x7601('0x28')](respondWithResult(_0x31e69d,null))[_0x7601('0x4d')](handleError(_0x31e69d,null));};exports[_0x7601('0x9a')]=function(_0x516a8a,_0x27dbbf,_0x453ef5){var _0x20e97d,_0x4c2998;return db[_0x7601('0x45')][_0x7601('0x4c')]({'where':{'id':_0x516a8a[_0x7601('0x5a')]['id']}})[_0x7601('0x28')](handleEntityNotFound(_0x27dbbf,null))['then'](function(_0x319ee0){if(_0x319ee0){_0x4c2998=_0x319ee0;return _0x319ee0[_0x7601('0x9a')](_0x516a8a[_0x7601('0x4f')][_0x7601('0x7b')],_[_0x7601('0x5b')](_0x516a8a[_0x7601('0x4f')],['ids','id'])||{});}return null;})['spread'](function(_0x1a1a03){var _0xd8a449;_0x20e97d=_0x1a1a03||[];var _0x21acf0=[];if(_0x1a1a03){for(var _0x105063=0x0;_0x105063<_0x1a1a03[_0x7601('0x3f')];_0x105063+=0x1){var _0x5435d4=_0x1a1a03[_0x105063]['get']({'plain':!![]});_0x4c2998[_0x7601('0x9b')]=_0x516a8a[_0x7601('0x4f')][_0x7601('0x9b')]?_0x516a8a[_0x7601('0x4f')][_0x7601('0x9b')]:_0x4c2998['dialCheckDuplicateType'];switch(_0x4c2998['dialCheckDuplicateType']){case'always':_0xd8a449=squel['insert']()[_0x7601('0x9c')]('cm_hopper')['fromQuery'](['phone','scheduledAt',_0x7601('0x9d'),_0x7601('0x9e'),_0x7601('0x65'),_0x7601('0x5c'),_0x7601('0x5d')],squel[_0x7601('0x7c')]()[_0x7601('0x9f')](_0x7601('0xa0'),_0x7601('0xa0'))[_0x7601('0x9f')](_0x7601('0xa1'),_0x7601('0xa2'))['field']('id',_0x7601('0x9d'))[_0x7601('0x9f')](_0x5435d4['CmListId'][_0x7601('0x86')](),_0x7601('0x9e'))['field'](_0x516a8a[_0x7601('0x5a')]['id'][_0x7601('0x86')](),'VoiceQueueId')[_0x7601('0x9f')](_0x7601('0xa1'),_0x7601('0x5c'))['field'](_0x7601('0xa1'),_0x7601('0x5d'))[_0x7601('0x7e')]('cm_contacts')[_0x7601('0x43')]('deletedAt\x20IS\x20NULL')[_0x7601('0x43')](_0x7601('0xa3'),_0x5435d4[_0x7601('0xa4')][_0x7601('0x86')]())['where'](_0x7601('0xa5'))[_0x7601('0x43')]('phone\x20NOT\x20IN\x20(?)',squel[_0x7601('0x7c')]()[_0x7601('0x9f')]('COALESCE(calleridnum,\x27\x27)')[_0x7601('0x7e')](_0x7601('0xa6'))[_0x7601('0x43')](_0x7601('0x83'),_0x516a8a[_0x7601('0x5a')]['id'][_0x7601('0x86')]()))[_0x7601('0x43')](_0x7601('0xa7'),squel[_0x7601('0x7c')]()[_0x7601('0x9f')](_0x7601('0xa8'))[_0x7601('0x7e')](_0x7601('0xa9'))[_0x7601('0x43')](_0x7601('0x83'),_0x516a8a[_0x7601('0x5a')]['id'][_0x7601('0x86')]())))[_0x7601('0x86')]();break;case _0x7601('0xaa'):_0xd8a449=squel[_0x7601('0xab')]()[_0x7601('0x9c')](_0x7601('0xa9'))['fromQuery'](['phone','scheduledAt','ContactId','ListId',_0x7601('0x65'),'createdAt',_0x7601('0x5d')],squel[_0x7601('0x7c')]()[_0x7601('0x9f')](_0x7601('0xa0'),'phone')[_0x7601('0x9f')](_0x7601('0xa1'),_0x7601('0xa2'))[_0x7601('0x9f')]('id',_0x7601('0x9d'))[_0x7601('0x9f')](_0x5435d4['CmListId'][_0x7601('0x86')](),_0x7601('0x9e'))['field'](_0x516a8a[_0x7601('0x5a')]['id']['toString'](),'VoiceQueueId')[_0x7601('0x9f')](_0x7601('0xa1'),'createdAt')[_0x7601('0x9f')]('NOW()','updatedAt')['from']('cm_contacts')[_0x7601('0x43')](_0x7601('0xac'))['where']('ListId\x20=\x20?',_0x5435d4[_0x7601('0xa4')][_0x7601('0x86')]())[_0x7601('0x43')](_0x7601('0xa5'))[_0x7601('0x43')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x7601('0x9f')](_0x7601('0xa8'))[_0x7601('0x7e')]('cm_hopper')[_0x7601('0x43')](_0x7601('0x83'),_0x516a8a[_0x7601('0x5a')]['id']['toString']())))[_0x7601('0x86')]();break;default:_0xd8a449=squel[_0x7601('0xab')]()['into'](_0x7601('0xa9'))[_0x7601('0xad')]([_0x7601('0xa0'),_0x7601('0xa2'),_0x7601('0x9d'),_0x7601('0x9e'),_0x7601('0x65'),_0x7601('0x5c'),_0x7601('0x5d')],squel['select']()[_0x7601('0x9f')](_0x7601('0xa0'),'phone')[_0x7601('0x9f')](_0x7601('0xa1'),_0x7601('0xa2'))[_0x7601('0x9f')]('id',_0x7601('0x9d'))[_0x7601('0x9f')](_0x5435d4[_0x7601('0xa4')][_0x7601('0x86')](),_0x7601('0x9e'))[_0x7601('0x9f')](_0x516a8a['params']['id'][_0x7601('0x86')](),'VoiceQueueId')[_0x7601('0x9f')](_0x7601('0xa1'),_0x7601('0x5c'))[_0x7601('0x9f')](_0x7601('0xa1'),_0x7601('0x5d'))[_0x7601('0x7e')](_0x7601('0xae'))[_0x7601('0x43')](_0x7601('0xac'))[_0x7601('0x43')](_0x7601('0xa3'),_0x5435d4[_0x7601('0xa4')][_0x7601('0x86')]())[_0x7601('0x43')](_0x7601('0xa5')))[_0x7601('0x86')]();}_0x21acf0[_0x7601('0x85')](db['sequelize'][_0x7601('0x39')](_0xd8a449));}return BPromise[_0x7601('0x89')](_0x21acf0);}})[_0x7601('0x28')](function(){return _0x20e97d;})['then'](respondWithResult(_0x27dbbf,null))[_0x7601('0x4d')](handleError(_0x27dbbf,null));};exports[_0x7601('0xaf')]=function(_0x18527d,_0x3628d2,_0x511774){return db[_0x7601('0x45')][_0x7601('0x4c')]({'where':{'id':_0x18527d[_0x7601('0x5a')]['id']}})[_0x7601('0x28')](handleEntityNotFound(_0x3628d2,null))[_0x7601('0x28')](function(_0x962323){if(_0x962323){return _0x962323[_0x7601('0xaf')](_0x18527d[_0x7601('0x39')][_0x7601('0x7b')]);}})['then'](function(_0x116594){if(_0x116594){return db['CmHopper'][_0x7601('0x29')]({'where':{'ListId':_0x18527d[_0x7601('0x39')][_0x7601('0x7b')],'VoiceQueueId':_0x18527d[_0x7601('0x5a')]['id']}})[_0x7601('0x28')](function(){return _0x116594;});}})[_0x7601('0x28')](respondWithStatusCode(_0x3628d2,null))[_0x7601('0x4d')](handleError(_0x3628d2,null));};exports['getBlackLists']=function(_0x453019,_0x4b74c8,_0x39006){var _0x4ed82a={};var _0x901361={};var _0x23d914;var _0x4bea77;return db[_0x7601('0x45')]['findOne']({'where':{'id':_0x453019[_0x7601('0x5a')]['id']}})[_0x7601('0x28')](handleEntityNotFound(_0x4b74c8,null))[_0x7601('0x28')](function(_0x10f22d){if(_0x10f22d){_0x23d914=_0x10f22d;_0x901361[_0x7601('0x38')]=_[_0x7601('0x3a')](db[_0x7601('0x99')][_0x7601('0x36')]);_0x901361[_0x7601('0x39')]=_[_0x7601('0x3a')](_0x453019[_0x7601('0x39')]);_0x901361[_0x7601('0x3b')]=_['intersection'](_0x901361[_0x7601('0x38')],_0x901361[_0x7601('0x39')]);_0x4ed82a['attributes']=_['intersection'](_0x901361[_0x7601('0x38')],qs[_0x7601('0x3e')](_0x453019[_0x7601('0x39')][_0x7601('0x3e')]));_0x4ed82a['attributes']=_0x4ed82a[_0x7601('0x3d')][_0x7601('0x3f')]?_0x4ed82a[_0x7601('0x3d')]:_0x901361[_0x7601('0x38')];_0x4ed82a[_0x7601('0x64')]=qs[_0x7601('0x42')](_0x453019[_0x7601('0x39')][_0x7601('0x42')]);_0x4ed82a['where']=qs['filters'](_[_0x7601('0x61')](_0x453019[_0x7601('0x39')],_0x901361[_0x7601('0x3b')]));if(_0x453019[_0x7601('0x39')]['filter']){_0x4ed82a[_0x7601('0x43')]=_[_0x7601('0x44')](_0x4ed82a[_0x7601('0x43')],{'$or':_[_0x7601('0x2e')](_0x4ed82a[_0x7601('0x3d')],function(_0x22b1bf){var _0x28a16a={};_0x28a16a[_0x22b1bf]={'$like':'%'+_0x453019['query'][_0x7601('0x2c')]+'%'};return _0x28a16a;})});}_0x4ed82a=_[_0x7601('0x44')]({},_0x4ed82a,_0x453019[_0x7601('0x4b')]);return _0x23d914['getBlackLists'](_0x4ed82a);}})[_0x7601('0x28')](function(_0x240201){if(_0x240201){_0x4bea77=_0x240201[_0x7601('0x3f')];if(!_0x453019[_0x7601('0x39')]['hasOwnProperty']('nolimit')){_0x4ed82a['limit']=qs[_0x7601('0x22')](_0x453019[_0x7601('0x39')]['limit']);_0x4ed82a['offset']=qs[_0x7601('0x21')](_0x453019['query'][_0x7601('0x21')]);}return _0x23d914[_0x7601('0xb0')](_0x4ed82a);}})[_0x7601('0x28')](function(_0x47681b){if(_0x47681b){return _0x47681b?{'count':_0x4bea77,'rows':_0x47681b}:null;}})[_0x7601('0x28')](respondWithResult(_0x4b74c8,null))[_0x7601('0x4d')](handleError(_0x4b74c8,null));};exports[_0x7601('0xb1')]=function(_0xeb1087,_0xec0d6a,_0x12c2d6){var _0x3636b1,_0x3c5802;return db[_0x7601('0x45')][_0x7601('0x4c')]({'where':{'id':_0xeb1087[_0x7601('0x5a')]['id']}})['then'](handleEntityNotFound(_0xec0d6a,null))[_0x7601('0x28')](function(_0x36b094){if(_0x36b094){_0x3c5802=_0x36b094;return _0x36b094['addBlackLists'](_0xeb1087[_0x7601('0x4f')][_0x7601('0x7b')],_[_0x7601('0x5b')](_0xeb1087[_0x7601('0x4f')],['ids','id'])||{});}return null;})['spread'](function(_0xdd9210){var _0x4dbd6b;_0x3636b1=_0xdd9210||[];var _0x52e239=[];if(_0xdd9210){for(var _0x3f67de=0x0;_0x3f67de<_0xdd9210[_0x7601('0x3f')];_0x3f67de+=0x1){var _0x2691df=_0xdd9210[_0x3f67de]['get']({'plain':!![]});_0x4dbd6b=squel[_0x7601('0xab')]()[_0x7601('0x9c')](_0x7601('0xb2'))[_0x7601('0xad')](['phone',_0x7601('0x9d'),_0x7601('0x9e'),'VoiceQueueId',_0x7601('0x5c'),_0x7601('0x5d')],squel['select']()['field']('phone','phone')[_0x7601('0x9f')]('id',_0x7601('0x9d'))[_0x7601('0x9f')](_0x2691df[_0x7601('0xa4')]['toString'](),_0x7601('0x9e'))[_0x7601('0x9f')](_0xeb1087[_0x7601('0x5a')]['id'][_0x7601('0x86')](),_0x7601('0x65'))['field'](_0x7601('0xa1'),'createdAt')['field'](_0x7601('0xa1'),_0x7601('0x5d'))[_0x7601('0x7e')](_0x7601('0xae'))['where'](_0x7601('0xac'))['where'](_0x7601('0xa3'),_0x2691df[_0x7601('0xa4')][_0x7601('0x86')]())['where'](_0x7601('0xa5')))[_0x7601('0x86')]();_0x52e239[_0x7601('0x85')](db['sequelize']['query'](_0x4dbd6b));}return BPromise[_0x7601('0x89')](_0x52e239);}})[_0x7601('0x28')](function(){return _0x3636b1;})[_0x7601('0x28')](respondWithResult(_0xec0d6a,null))['catch'](handleError(_0xec0d6a,null));};exports[_0x7601('0xb3')]=function(_0x196352,_0x2eb4c0,_0x1209d4){return db[_0x7601('0x45')]['find']({'where':{'id':_0x196352['params']['id']}})[_0x7601('0x28')](handleEntityNotFound(_0x2eb4c0,null))[_0x7601('0x28')](function(_0x53be28){if(_0x53be28){return _0x53be28[_0x7601('0xb3')](_0x196352[_0x7601('0x39')]['ids']);}})['then'](function(_0x2a24b4){if(_0x2a24b4){return db[_0x7601('0x68')][_0x7601('0x29')]({'where':{'ListId':_0x196352[_0x7601('0x39')]['ids'],'VoiceQueueId':_0x196352[_0x7601('0x5a')]['id']}})[_0x7601('0x28')](function(){return _0x2a24b4;});}})[_0x7601('0x28')](respondWithStatusCode(_0x2eb4c0,null))[_0x7601('0x4d')](handleError(_0x2eb4c0,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 3503af1..882ff44 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 _0xe10a=['hasOwnProperty','events','../../mysqldb','VoiceQueue','setMaxListeners','save','remove','emit'];(function(_0x5a9007,_0x502608){var _0x22c52f=function(_0x45d533){while(--_0x45d533){_0x5a9007['push'](_0x5a9007['shift']());}};_0x22c52f(++_0x502608);}(_0xe10a,0x199));var _0xae10=function(_0x331c66,_0x25d7b8){_0x331c66=_0x331c66-0x0;var _0x1cba92=_0xe10a[_0x331c66];return _0x1cba92;};'use strict';var EventEmitter=require(_0xae10('0x0'));var VoiceQueue=require(_0xae10('0x1'))['db'][_0xae10('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xae10('0x3')](0x0);var events={'afterCreate':_0xae10('0x4'),'afterUpdate':'update','afterDestroy':_0xae10('0x5')};function emitEvent(_0x183741){return function(_0x33fb45,_0x524225,_0x87f80c){VoiceQueueEvents[_0xae10('0x6')](_0x183741+':'+_0x33fb45['id'],_0x33fb45);VoiceQueueEvents[_0xae10('0x6')](_0x183741,_0x33fb45);_0x87f80c(null);};}for(var e in events){if(events[_0xae10('0x7')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file +var _0x2707=['save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','VoiceQueue','setMaxListeners'];(function(_0x59ee87,_0x5151ef){var _0x3c4476=function(_0x5787c5){while(--_0x5787c5){_0x59ee87['push'](_0x59ee87['shift']());}};_0x3c4476(++_0x5151ef);}(_0x2707,0xec));var _0x7270=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0x2707[_0x220f3f];return _0x1f170e;};'use strict';var EventEmitter=require(_0x7270('0x0'));var VoiceQueue=require(_0x7270('0x1'))['db'][_0x7270('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x7270('0x3')](0x0);var events={'afterCreate':_0x7270('0x4'),'afterUpdate':_0x7270('0x5'),'afterDestroy':_0x7270('0x6')};function emitEvent(_0x4b8df0){return function(_0x5b824b,_0x3efef4,_0x2d048f){VoiceQueueEvents[_0x7270('0x7')](_0x4b8df0+':'+_0x5b824b['id'],_0x5b824b);VoiceQueueEvents[_0x7270('0x7')](_0x4b8df0,_0x5b824b);_0x2d048f(null);};}for(var e in events){if(events[_0x7270('0x8')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x7270('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 215e581..d98183f 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 _0x8433=['api','moment','rimraf','../../config/environment','define','VoiceQueue','voice_queues','lodash','util'];(function(_0x416aed,_0x556c97){var _0x2cbadc=function(_0x36cd40){while(--_0x36cd40){_0x416aed['push'](_0x416aed['shift']());}};_0x2cbadc(++_0x556c97);}(_0x8433,0x14b));var _0x3843=function(_0x415603,_0x21320c){_0x415603=_0x415603-0x0;var _0x131e72=_0x8433[_0x415603];return _0x131e72;};'use strict';var _=require(_0x3843('0x0'));var util=require(_0x3843('0x1'));var logger=require('../../config/logger')(_0x3843('0x2'));var moment=require(_0x3843('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3843('0x4'));var config=require(_0x3843('0x5'));var attributes=require('./voiceQueue.attributes');module['exports']=function(_0x2b8c7e,_0x16a1f0){return _0x2b8c7e[_0x3843('0x6')](_0x3843('0x7'),attributes,{'tableName':_0x3843('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4c6c=['voice_queues','lodash','../../config/logger','api','moment','bluebird','path','rimraf','./voiceQueue.attributes','exports','define'];(function(_0x4363a8,_0x20b81c){var _0x193ab8=function(_0x3d55d3){while(--_0x3d55d3){_0x4363a8['push'](_0x4363a8['shift']());}};_0x193ab8(++_0x20b81c);}(_0x4c6c,0x18d));var _0xc4c6=function(_0x24dc47,_0x18856f){_0x24dc47=_0x24dc47-0x0;var _0x4de018=_0x4c6c[_0x24dc47];return _0x4de018;};'use strict';var _=require(_0xc4c6('0x0'));var util=require('util');var logger=require(_0xc4c6('0x1'))(_0xc4c6('0x2'));var moment=require(_0xc4c6('0x3'));var BPromise=require(_0xc4c6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc4c6('0x5'));var rimraf=require(_0xc4c6('0x6'));var config=require('../../config/environment');var attributes=require(_0xc4c6('0x7'));module[_0xc4c6('0x8')]=function(_0x19d372,_0x23471b){return _0x19d372[_0xc4c6('0x9')]('VoiceQueue',attributes,{'tableName':_0xc4c6('0xa'),'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 93cf2de..a9a8819 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 _0xf254=['info','request\x20sent','debug','stringify','error','VoiceQueue,\x20%s,\x20%s','message','result','catch','GetVoiceQueue','options','raw','where','limit','include','map','model','attributes','find','ShowVoiceQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./voiceQueue.socket','register','request','then'];(function(_0x32f26d,_0x2c0b5d){var _0x5d9ddc=function(_0x1f0e26){while(--_0x1f0e26){_0x32f26d['push'](_0x32f26d['shift']());}};_0x5d9ddc(++_0x2c0b5d);}(_0xf254,0x89));var _0x4f25=function(_0x14b4b2,_0x42aed0){_0x14b4b2=_0x14b4b2-0x0;var _0x2710fd=_0xf254[_0x14b4b2];return _0x2710fd;};'use strict';var _=require(_0x4f25('0x0'));var util=require(_0x4f25('0x1'));var moment=require(_0x4f25('0x2'));var BPromise=require(_0x4f25('0x3'));var rs=require(_0x4f25('0x4'));var fs=require('fs');var Redis=require(_0x4f25('0x5'));var db=require(_0x4f25('0x6'))['db'];var utils=require(_0x4f25('0x7'));var logger=require(_0x4f25('0x8'))('rpc');var config=require(_0x4f25('0x9'));var jayson=require(_0x4f25('0xa'));var client=jayson[_0x4f25('0xb')]['http']({'port':0x232a});config[_0x4f25('0xc')]=_[_0x4f25('0xd')](config[_0x4f25('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x4f25('0xe'))(new Redis(config[_0x4f25('0xc')]));require(_0x4f25('0xf'))[_0x4f25('0x10')](socket);function respondWithRpcPromise(_0x1712a0,_0x4eb1b0,_0x7d1ee6){return new BPromise(function(_0x509fd1,_0x19d315){return client[_0x4f25('0x11')](_0x1712a0,_0x7d1ee6)[_0x4f25('0x12')](function(_0x14b826){logger[_0x4f25('0x13')]('VoiceQueue,\x20%s,\x20%s',_0x4eb1b0,_0x4f25('0x14'));logger[_0x4f25('0x15')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x4eb1b0,_0x4f25('0x14'),JSON[_0x4f25('0x16')](_0x14b826));if(_0x14b826[_0x4f25('0x17')]){if(_0x14b826[_0x4f25('0x17')]['code']===0x1f4){logger[_0x4f25('0x17')](_0x4f25('0x18'),_0x4eb1b0,_0x14b826[_0x4f25('0x17')][_0x4f25('0x19')]);return _0x19d315(_0x14b826[_0x4f25('0x17')]['message']);}logger[_0x4f25('0x17')]('VoiceQueue,\x20%s,\x20%s',_0x4eb1b0,_0x14b826[_0x4f25('0x17')][_0x4f25('0x19')]);return _0x509fd1(_0x14b826[_0x4f25('0x17')][_0x4f25('0x19')]);}else{logger[_0x4f25('0x13')](_0x4f25('0x18'),_0x4eb1b0,_0x4f25('0x14'));_0x509fd1(_0x14b826[_0x4f25('0x1a')][_0x4f25('0x19')]);}})[_0x4f25('0x1b')](function(_0x4ac2a7){logger[_0x4f25('0x17')](_0x4f25('0x18'),_0x4eb1b0,_0x4ac2a7);_0x19d315(_0x4ac2a7);});});}exports[_0x4f25('0x1c')]=function(_0x14213c){var _0x32bf8a=this;return new Promise(function(_0x320c08,_0x22420b){return db['VoiceQueue']['findAll']({'raw':_0x14213c[_0x4f25('0x1d')]?_0x14213c[_0x4f25('0x1d')][_0x4f25('0x1e')]===undefined?!![]:![]:!![],'where':_0x14213c['options']?_0x14213c[_0x4f25('0x1d')][_0x4f25('0x1f')]||null:null,'attributes':_0x14213c[_0x4f25('0x1d')]?_0x14213c[_0x4f25('0x1d')]['attributes']||null:null,'limit':_0x14213c['options']?_0x14213c[_0x4f25('0x1d')][_0x4f25('0x20')]||null:null,'include':_0x14213c[_0x4f25('0x1d')]?_0x14213c[_0x4f25('0x1d')][_0x4f25('0x21')]?_[_0x4f25('0x22')](_0x14213c[_0x4f25('0x1d')][_0x4f25('0x21')],function(_0x1f0ff2){return{'model':db[_0x1f0ff2[_0x4f25('0x23')]],'as':_0x1f0ff2['as'],'attributes':_0x1f0ff2[_0x4f25('0x24')],'include':_0x1f0ff2[_0x4f25('0x21')]?_[_0x4f25('0x22')](_0x1f0ff2[_0x4f25('0x21')],function(_0xceda3d){return{'model':db[_0xceda3d[_0x4f25('0x23')]],'as':_0xceda3d['as'],'attributes':_0xceda3d[_0x4f25('0x24')],'include':_0xceda3d[_0x4f25('0x21')]?_['map'](_0xceda3d[_0x4f25('0x21')],function(_0xb1a61b){return{'model':db[_0xb1a61b[_0x4f25('0x23')]],'as':_0xb1a61b['as'],'attributes':_0xb1a61b[_0x4f25('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3f7035){logger[_0x4f25('0x13')](_0x4f25('0x1c'),_0x14213c);logger[_0x4f25('0x15')](_0x4f25('0x1c'),_0x14213c,JSON['stringify'](_0x3f7035));_0x320c08(_0x3f7035);})[_0x4f25('0x1b')](function(_0x49f400){logger[_0x4f25('0x17')](_0x4f25('0x1c'),_0x49f400[_0x4f25('0x19')],_0x14213c);_0x22420b(_0x32bf8a['error'](0x1f4,_0x49f400[_0x4f25('0x19')]));});});};exports['ShowVoiceQueue']=function(_0x10c515){var _0x480d75=this;return new Promise(function(_0x5a97f6,_0x40ffb9){return db['VoiceQueue'][_0x4f25('0x25')]({'raw':_0x10c515['options']?_0x10c515['options'][_0x4f25('0x1e')]===undefined?!![]:![]:!![],'where':_0x10c515['options']?_0x10c515[_0x4f25('0x1d')][_0x4f25('0x1f')]||null:null,'attributes':_0x10c515[_0x4f25('0x1d')]?_0x10c515[_0x4f25('0x1d')][_0x4f25('0x24')]||null:null,'include':_0x10c515[_0x4f25('0x1d')]?_0x10c515[_0x4f25('0x1d')][_0x4f25('0x21')]?_[_0x4f25('0x22')](_0x10c515[_0x4f25('0x1d')][_0x4f25('0x21')],function(_0x4f45d7){return{'model':db[_0x4f45d7[_0x4f25('0x23')]],'as':_0x4f45d7['as'],'attributes':_0x4f45d7[_0x4f25('0x24')],'include':_0x4f45d7[_0x4f25('0x21')]?_[_0x4f25('0x22')](_0x4f45d7[_0x4f25('0x21')],function(_0x3c92b3){return{'model':db[_0x3c92b3[_0x4f25('0x23')]],'as':_0x3c92b3['as'],'attributes':_0x3c92b3[_0x4f25('0x24')],'include':_0x3c92b3[_0x4f25('0x21')]?_[_0x4f25('0x22')](_0x3c92b3[_0x4f25('0x21')],function(_0x174c04){return{'model':db[_0x174c04['model']],'as':_0x174c04['as'],'attributes':_0x174c04[_0x4f25('0x24')]};}):[]};}):[]};}):[]:[]})[_0x4f25('0x12')](function(_0x4eb8a8){logger['info'](_0x4f25('0x26'),_0x10c515);logger[_0x4f25('0x15')](_0x4f25('0x26'),_0x10c515,JSON[_0x4f25('0x16')](_0x4eb8a8));_0x5a97f6(_0x4eb8a8);})[_0x4f25('0x1b')](function(_0x36d118){logger[_0x4f25('0x17')](_0x4f25('0x26'),_0x36d118['message'],_0x10c515);_0x40ffb9(_0x480d75[_0x4f25('0x17')](0x1f4,_0x36d118[_0x4f25('0x19')]));});});}; \ No newline at end of file +var _0x7d5e=['model','debug','catch','ShowVoiceQueue','find','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','socket.io-emitter','redis','./voiceQueue.socket','register','request','then','info','request\x20sent','stringify','error','code','message','VoiceQueue,\x20%s,\x20%s','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','limit','include','map'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x7d5e,0xcd));var _0xe7d5=function(_0x147455,_0x20091b){_0x147455=_0x147455-0x0;var _0xf5ada5=_0x7d5e[_0x147455];return _0xf5ada5;};'use strict';var _=require(_0xe7d5('0x0'));var util=require(_0xe7d5('0x1'));var moment=require('moment');var BPromise=require(_0xe7d5('0x2'));var rs=require(_0xe7d5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe7d5('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe7d5('0x5'))(_0xe7d5('0x6'));var config=require(_0xe7d5('0x7'));var jayson=require(_0xe7d5('0x8'));var client=jayson[_0xe7d5('0x9')][_0xe7d5('0xa')]({'port':0x232a});config['redis']=_[_0xe7d5('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe7d5('0xc'))(new Redis(config[_0xe7d5('0xd')]));require(_0xe7d5('0xe'))[_0xe7d5('0xf')](socket);function respondWithRpcPromise(_0x2dfe31,_0x5edfd5,_0xfeb04e){return new BPromise(function(_0x2b6bee,_0x461aa1){return client[_0xe7d5('0x10')](_0x2dfe31,_0xfeb04e)[_0xe7d5('0x11')](function(_0x2d3ea1){logger[_0xe7d5('0x12')]('VoiceQueue,\x20%s,\x20%s',_0x5edfd5,_0xe7d5('0x13'));logger['debug']('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x5edfd5,_0xe7d5('0x13'),JSON[_0xe7d5('0x14')](_0x2d3ea1));if(_0x2d3ea1['error']){if(_0x2d3ea1[_0xe7d5('0x15')][_0xe7d5('0x16')]===0x1f4){logger[_0xe7d5('0x15')]('VoiceQueue,\x20%s,\x20%s',_0x5edfd5,_0x2d3ea1[_0xe7d5('0x15')][_0xe7d5('0x17')]);return _0x461aa1(_0x2d3ea1[_0xe7d5('0x15')][_0xe7d5('0x17')]);}logger['error'](_0xe7d5('0x18'),_0x5edfd5,_0x2d3ea1[_0xe7d5('0x15')][_0xe7d5('0x17')]);return _0x2b6bee(_0x2d3ea1[_0xe7d5('0x15')][_0xe7d5('0x17')]);}else{logger[_0xe7d5('0x12')](_0xe7d5('0x18'),_0x5edfd5,_0xe7d5('0x13'));_0x2b6bee(_0x2d3ea1['result'][_0xe7d5('0x17')]);}})['catch'](function(_0x53b2f){logger[_0xe7d5('0x15')](_0xe7d5('0x18'),_0x5edfd5,_0x53b2f);_0x461aa1(_0x53b2f);});});}exports[_0xe7d5('0x19')]=function(_0x472ce0){var _0x4391db=this;return new Promise(function(_0x475e78,_0x5496e0){return db[_0xe7d5('0x1a')][_0xe7d5('0x1b')]({'raw':_0x472ce0[_0xe7d5('0x1c')]?_0x472ce0['options'][_0xe7d5('0x1d')]===undefined?!![]:![]:!![],'where':_0x472ce0[_0xe7d5('0x1c')]?_0x472ce0['options'][_0xe7d5('0x1e')]||null:null,'attributes':_0x472ce0[_0xe7d5('0x1c')]?_0x472ce0[_0xe7d5('0x1c')][_0xe7d5('0x1f')]||null:null,'limit':_0x472ce0[_0xe7d5('0x1c')]?_0x472ce0[_0xe7d5('0x1c')][_0xe7d5('0x20')]||null:null,'include':_0x472ce0[_0xe7d5('0x1c')]?_0x472ce0['options'][_0xe7d5('0x21')]?_[_0xe7d5('0x22')](_0x472ce0[_0xe7d5('0x1c')][_0xe7d5('0x21')],function(_0x1e2217){return{'model':db[_0x1e2217[_0xe7d5('0x23')]],'as':_0x1e2217['as'],'attributes':_0x1e2217[_0xe7d5('0x1f')],'include':_0x1e2217[_0xe7d5('0x21')]?_['map'](_0x1e2217[_0xe7d5('0x21')],function(_0x55990c){return{'model':db[_0x55990c[_0xe7d5('0x23')]],'as':_0x55990c['as'],'attributes':_0x55990c[_0xe7d5('0x1f')],'include':_0x55990c[_0xe7d5('0x21')]?_[_0xe7d5('0x22')](_0x55990c['include'],function(_0xe37fd3){return{'model':db[_0xe37fd3[_0xe7d5('0x23')]],'as':_0xe37fd3['as'],'attributes':_0xe37fd3['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x12205c){logger[_0xe7d5('0x12')](_0xe7d5('0x19'),_0x472ce0);logger[_0xe7d5('0x24')]('GetVoiceQueue',_0x472ce0,JSON[_0xe7d5('0x14')](_0x12205c));_0x475e78(_0x12205c);})[_0xe7d5('0x25')](function(_0x4d9b9f){logger[_0xe7d5('0x15')]('GetVoiceQueue',_0x4d9b9f[_0xe7d5('0x17')],_0x472ce0);_0x5496e0(_0x4391db[_0xe7d5('0x15')](0x1f4,_0x4d9b9f[_0xe7d5('0x17')]));});});};exports[_0xe7d5('0x26')]=function(_0x95780a){var _0x3c8f35=this;return new Promise(function(_0x41f81f,_0x4a326b){return db[_0xe7d5('0x1a')][_0xe7d5('0x27')]({'raw':_0x95780a[_0xe7d5('0x1c')]?_0x95780a[_0xe7d5('0x1c')][_0xe7d5('0x1d')]===undefined?!![]:![]:!![],'where':_0x95780a['options']?_0x95780a[_0xe7d5('0x1c')][_0xe7d5('0x1e')]||null:null,'attributes':_0x95780a[_0xe7d5('0x1c')]?_0x95780a[_0xe7d5('0x1c')][_0xe7d5('0x1f')]||null:null,'include':_0x95780a['options']?_0x95780a[_0xe7d5('0x1c')][_0xe7d5('0x21')]?_[_0xe7d5('0x22')](_0x95780a['options'][_0xe7d5('0x21')],function(_0x4b21c5){return{'model':db[_0x4b21c5['model']],'as':_0x4b21c5['as'],'attributes':_0x4b21c5[_0xe7d5('0x1f')],'include':_0x4b21c5[_0xe7d5('0x21')]?_[_0xe7d5('0x22')](_0x4b21c5['include'],function(_0x2d0c34){return{'model':db[_0x2d0c34[_0xe7d5('0x23')]],'as':_0x2d0c34['as'],'attributes':_0x2d0c34[_0xe7d5('0x1f')],'include':_0x2d0c34[_0xe7d5('0x21')]?_[_0xe7d5('0x22')](_0x2d0c34[_0xe7d5('0x21')],function(_0x1f6e67){return{'model':db[_0x1f6e67['model']],'as':_0x1f6e67['as'],'attributes':_0x1f6e67[_0xe7d5('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x534a05){logger[_0xe7d5('0x12')](_0xe7d5('0x26'),_0x95780a);logger['debug']('ShowVoiceQueue',_0x95780a,JSON[_0xe7d5('0x14')](_0x534a05));_0x41f81f(_0x534a05);})[_0xe7d5('0x25')](function(_0x25829b){logger[_0xe7d5('0x15')](_0xe7d5('0x26'),_0x25829b['message'],_0x95780a);_0x4a326b(_0x3c8f35[_0xe7d5('0x15')](0x1f4,_0x25829b[_0xe7d5('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index feb0bd2..b088b78 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 _0x5bc5=['register','length','./voiceQueue.events','save','remove','update','emit','removeListener'];(function(_0x54defc,_0x627178){var _0x1955d3=function(_0x299afe){while(--_0x299afe){_0x54defc['push'](_0x54defc['shift']());}};_0x1955d3(++_0x627178);}(_0x5bc5,0xb2));var _0x55bc=function(_0x35e92e,_0x21581b){_0x35e92e=_0x35e92e-0x0;var _0x1205a8=_0x5bc5[_0x35e92e];return _0x1205a8;};'use strict';var VoiceQueueEvents=require(_0x55bc('0x0'));var events=[_0x55bc('0x1'),_0x55bc('0x2'),_0x55bc('0x3')];function createListener(_0x19006b,_0x2e077d){return function(_0x2ebc5a){_0x2e077d[_0x55bc('0x4')](_0x19006b,_0x2ebc5a);};}function removeListener(_0xa94795,_0x1ea633){return function(){VoiceQueueEvents[_0x55bc('0x5')](_0xa94795,_0x1ea633);};}exports[_0x55bc('0x6')]=function(_0x188eb6){for(var _0x5d5f1d=0x0,_0x4d78d6=events[_0x55bc('0x7')];_0x5d5f1d<_0x4d78d6;_0x5d5f1d++){var _0x2a612b=events[_0x5d5f1d];var _0x38839e=createListener('voiceQueue:'+_0x2a612b,_0x188eb6);VoiceQueueEvents['on'](_0x2a612b,_0x38839e);}}; \ No newline at end of file +var _0x2cbb=['./voiceQueue.events','save'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x2cbb,0x178));var _0xb2cb=function(_0x13bcbb,_0x2eb915){_0x13bcbb=_0x13bcbb-0x0;var _0x457c81=_0x2cbb[_0x13bcbb];return _0x457c81;};'use strict';var VoiceQueueEvents=require(_0xb2cb('0x0'));var events=[_0xb2cb('0x1'),'remove','update'];function createListener(_0x1b009e,_0x1c0055){return function(_0x5c13b1){_0x1c0055['emit'](_0x1b009e,_0x5c13b1);};}function removeListener(_0x3db66d,_0x245ba5){return function(){VoiceQueueEvents['removeListener'](_0x3db66d,_0x245ba5);};}exports['register']=function(_0x1b91ac){for(var _0x42328d=0x0,_0x19e052=events['length'];_0x42328d<_0x19e052;_0x42328d++){var _0x3acf6c=events[_0x42328d];var _0x44e7b1=createListener('voiceQueue:'+_0x3acf6c,_0x1b91ac);VoiceQueueEvents['on'](_0x3acf6c,_0x44e7b1);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 8651231..7b0c482 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 _0x8f9d=['./voiceQueueReport.controller','get','index','/describe','isAuthenticated','describe','/index','show','post','create','put','/:id','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x9d12b0,_0x3c9821){var _0x59a9b0=function(_0x2aa1b8){while(--_0x2aa1b8){_0x9d12b0['push'](_0x9d12b0['shift']());}};_0x59a9b0(++_0x3c9821);}(_0x8f9d,0x93));var _0xd8f9=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x8f9d[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0xd8f9('0x0'));var util=require('util');var path=require(_0xd8f9('0x1'));var timeout=require('connect-timeout');var express=require(_0xd8f9('0x2'));var router=express[_0xd8f9('0x3')]();var auth=require(_0xd8f9('0x4'));var interaction=require(_0xd8f9('0x5'));var config=require(_0xd8f9('0x6'));var controller=require(_0xd8f9('0x7'));router[_0xd8f9('0x8')]('/',auth['isAuthenticated'](),controller[_0xd8f9('0x9')]);router[_0xd8f9('0x8')](_0xd8f9('0xa'),auth[_0xd8f9('0xb')](),controller[_0xd8f9('0xc')]);router['get'](_0xd8f9('0xd'),auth[_0xd8f9('0xb')](),controller['getVoiceQueuesReport']);router[_0xd8f9('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xd8f9('0xe')]);router[_0xd8f9('0xf')]('/',auth[_0xd8f9('0xb')](),controller[_0xd8f9('0x10')]);router[_0xd8f9('0x11')](_0xd8f9('0x12'),auth[_0xd8f9('0xb')](),controller['update']);router[_0xd8f9('0x13')]('/:id',auth[_0xd8f9('0xb')](),controller[_0xd8f9('0x14')]);module[_0xd8f9('0x15')]=router; \ No newline at end of file +var _0x6365=['./voiceQueueReport.controller','isAuthenticated','index','get','/describe','describe','getVoiceQueuesReport','/:id','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x40d79f,_0x321da4){var _0x1a5688=function(_0x12792a){while(--_0x12792a){_0x40d79f['push'](_0x40d79f['shift']());}};_0x1a5688(++_0x321da4);}(_0x6365,0x148));var _0x5636=function(_0x300020,_0x2cf69c){_0x300020=_0x300020-0x0;var _0x350b85=_0x6365[_0x300020];return _0x350b85;};'use strict';var multer=require(_0x5636('0x0'));var util=require(_0x5636('0x1'));var path=require(_0x5636('0x2'));var timeout=require(_0x5636('0x3'));var express=require('express');var router=express[_0x5636('0x4')]();var auth=require(_0x5636('0x5'));var interaction=require(_0x5636('0x6'));var config=require(_0x5636('0x7'));var controller=require(_0x5636('0x8'));router['get']('/',auth[_0x5636('0x9')](),controller[_0x5636('0xa')]);router[_0x5636('0xb')](_0x5636('0xc'),auth['isAuthenticated'](),controller[_0x5636('0xd')]);router[_0x5636('0xb')]('/index',auth['isAuthenticated'](),controller[_0x5636('0xe')]);router[_0x5636('0xb')](_0x5636('0xf'),auth[_0x5636('0x9')](),controller['show']);router['post']('/',auth[_0x5636('0x9')](),controller['create']);router[_0x5636('0x10')](_0x5636('0xf'),auth[_0x5636('0x9')](),controller[_0x5636('0x11')]);router[_0x5636('0x12')](_0x5636('0xf'),auth['isAuthenticated'](),controller[_0x5636('0x13')]);module[_0x5636('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index e91b5e9..36e592f 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 _0x0c97=['YYYY-MM-DD\x20HH:mm:ss','diff','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0c97,0x9f));var _0x70c9=function(_0x4ab3fb,_0x776775){_0x4ab3fb=_0x4ab3fb-0x0;var _0x34fe1e=_0x0c97[_0x4ab3fb];return _0x34fe1e;};'use strict';var Sequelize=require(_0x70c9('0x0'));var moment=require(_0x70c9('0x1'));module[_0x70c9('0x2')]={'type':{'type':Sequelize[_0x70c9('0x3')]},'uniqueid':{'type':Sequelize[_0x70c9('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x70c9('0x3')]},'queue':{'type':Sequelize[_0x70c9('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x70c9('0x4')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x5e7e95){var _0x446cf3=moment(_0x5e7e95);var _0x2ff16e=moment(this[_0x70c9('0x5')]('queuecallerjoinAt'))['format'](_0x70c9('0x6'));var _0x23b418=_0x446cf3[_0x70c9('0x7')](_0x2ff16e,'seconds');this[_0x70c9('0x8')](_0x70c9('0x9'),_0x5e7e95);this[_0x70c9('0x8')](_0x70c9('0xa'),_0x23b418||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x70c9('0xb')]},'queuecallerabandon':{'type':Sequelize[_0x70c9('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0x70c9('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x70c9('0x4')]},'queuecallerexit':{'type':Sequelize[_0x70c9('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x70c9('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x70c9('0x3')],'comment':_0x70c9('0xd')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x70c9('0x3')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x70c9('0x3')]},'accountcode':{'type':Sequelize[_0x70c9('0x3')]},'context':{'type':Sequelize[_0x70c9('0x3')]},'exten':{'type':Sequelize[_0x70c9('0x3')]},'priority':{'type':Sequelize[_0x70c9('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x70c9('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x70c9('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x70c9('0x3')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x70c9('0x3')],'comment':_0x70c9('0xe')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x70c9('0x3')]},'disposition':{'type':Sequelize[_0x70c9('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x70c9('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1280=['diff','queuecallerleaveAt','setDataValue','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x386187,_0x1ad2ac){var _0x4abeaa=function(_0x251f63){while(--_0x251f63){_0x386187['push'](_0x386187['shift']());}};_0x4abeaa(++_0x1ad2ac);}(_0x1280,0x98));var _0x0128=function(_0x10e983,_0x2f4eda){_0x10e983=_0x10e983-0x0;var _0x324138=_0x1280[_0x10e983];return _0x324138;};'use strict';var Sequelize=require(_0x0128('0x0'));var moment=require(_0x0128('0x1'));module[_0x0128('0x2')]={'type':{'type':Sequelize[_0x0128('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x0128('0x3')]},'calleridname':{'type':Sequelize[_0x0128('0x3')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0x0128('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x0128('0x4')],'set':function(_0x36a9c4){var _0x474259=moment(_0x36a9c4);var _0x1eb3b6=moment(this[_0x0128('0x5')]('queuecallerjoinAt'))[_0x0128('0x6')](_0x0128('0x7'));var _0x5719b0=_0x474259[_0x0128('0x8')](_0x1eb3b6,'seconds');this['setDataValue'](_0x0128('0x9'),_0x36a9c4);this[_0x0128('0xa')](_0x0128('0xb'),_0x5719b0||null);}},'position':{'type':Sequelize[_0x0128('0xc')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0x0128('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x0128('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x0128('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x0128('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x0128('0x3')],'comment':_0x0128('0xe')},'originalposition':{'type':Sequelize[_0x0128('0xc')]},'channel':{'type':Sequelize[_0x0128('0x3')]},'connectedlinenum':{'type':Sequelize[_0x0128('0x3')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x0128('0x3')]},'exten':{'type':Sequelize[_0x0128('0x3')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x0128('0xc')]},'mohtime':{'type':Sequelize[_0x0128('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x0128('0x3')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x0128('0x3')],'comment':_0x0128('0xf')},'transferexten':{'type':Sequelize[_0x0128('0x3')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0x0128('0xc')],'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 369c79f..3378db3 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 _0x5f2f=['stack','name','send','map','VoiceQueueReport','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','find','create','body','catch','destroy','describe','getVoiceQueuesReport','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','status','end','json','count','offset','set','reject','save','update','then','sendStatus','error'];(function(_0x21a101,_0x1ce9b1){var _0x331037=function(_0x7d0e7b){while(--_0x7d0e7b){_0x21a101['push'](_0x21a101['shift']());}};_0x331037(++_0x1ce9b1);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3cb788,_0x186eb7){_0x3cb788=_0x3cb788-0x0;var _0x56deab=_0x5f2f[_0x3cb788];return _0x56deab;};'use strict';var pdf=require(_0xf5f2('0x0'));var emlformat=require(_0xf5f2('0x1'));var rimraf=require(_0xf5f2('0x2'));var zipdir=require(_0xf5f2('0x3'));var jsonpatch=require(_0xf5f2('0x4'));var rp=require(_0xf5f2('0x5'));var moment=require(_0xf5f2('0x6'));var BPromise=require(_0xf5f2('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf5f2('0x8'));var sox=require(_0xf5f2('0x9'));var csv=require(_0xf5f2('0xa'));var ejs=require(_0xf5f2('0xb'));var fs=require('fs');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('0xa'));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 db=require(_0xf5f2('0x16'))['db'];config[_0xf5f2('0x17')]=_[_0xf5f2('0x18')](config[_0xf5f2('0x17')],{'host':_0xf5f2('0x19'),'port':0x18eb});var socket=require(_0xf5f2('0x1a'))(new Redis(config['redis']));require(_0xf5f2('0x1b'))[_0xf5f2('0x1c')](socket);function respondWithStatusCode(_0x269909,_0x1c1a5c){_0x1c1a5c=_0x1c1a5c||0xcc;return function(_0x422b55){if(_0x422b55){return _0x269909['sendStatus'](_0x1c1a5c);}return _0x269909[_0xf5f2('0x1d')](_0x1c1a5c)[_0xf5f2('0x1e')]();};}function respondWithResult(_0x17d656,_0x1b6dd2){_0x1b6dd2=_0x1b6dd2||0xc8;return function(_0x23e23a){if(_0x23e23a){return _0x17d656[_0xf5f2('0x1d')](_0x1b6dd2)[_0xf5f2('0x1f')](_0x23e23a);}};}function respondWithFilteredResult(_0x395a5a,_0x11f702){return function(_0x228ace){if(_0x228ace){var _0x20fccd=_0x228ace[_0xf5f2('0x20')],_0x28e097=_0x11f702[_0xf5f2('0x21')],_0x4ff59b=_0x11f702[_0xf5f2('0x21')]+_0x11f702['limit'],_0x3ee69;if(_0x4ff59b>=_0x20fccd){_0x4ff59b=_0x20fccd;_0x3ee69=0xc8;}else{_0x3ee69=0xce;}_0x395a5a[_0xf5f2('0x1d')](_0x3ee69);return _0x395a5a[_0xf5f2('0x22')]('Content-Range',_0x28e097+'-'+_0x4ff59b+'/'+_0x20fccd)['json'](_0x228ace);}return null;};}function patchUpdates(_0x2d2805){return function(_0x388e6c){try{jsonpatch['apply'](_0x388e6c,_0x2d2805,!![]);}catch(_0x45b74f){return BPromise[_0xf5f2('0x23')](_0x45b74f);}return _0x388e6c[_0xf5f2('0x24')]();};}function saveUpdates(_0x39c024,_0x36f1cb){return function(_0x4c691a){if(_0x4c691a){return _0x4c691a[_0xf5f2('0x25')](_0x39c024)[_0xf5f2('0x26')](function(_0x4e8bda){return _0x4e8bda;});}return null;};}function removeEntity(_0x2833fe,_0x287ad5){return function(_0x5bdf4a){if(_0x5bdf4a){return _0x5bdf4a['destroy']()[_0xf5f2('0x26')](function(){_0x2833fe[_0xf5f2('0x1d')](0xcc)[_0xf5f2('0x1e')]();});}};}function handleEntityNotFound(_0x1a5bb3,_0xf6c58d){return function(_0x788a8d){if(!_0x788a8d){_0x1a5bb3[_0xf5f2('0x27')](0x194);}return _0x788a8d;};}function handleError(_0x281ec8,_0x294414){_0x294414=_0x294414||0x1f4;return function(_0x4ab014){logger[_0xf5f2('0x28')](_0x4ab014[_0xf5f2('0x29')]);if(_0x4ab014[_0xf5f2('0x2a')]){delete _0x4ab014[_0xf5f2('0x2a')];}_0x281ec8[_0xf5f2('0x1d')](_0x294414)[_0xf5f2('0x2b')](_0x4ab014);};}exports['index']=function(_0x53cb96,_0x22c826){var _0x14c829={},_0x11c771={},_0x5027ab={'count':0x0,'rows':[]};var _0x5a2c7e=_[_0xf5f2('0x2c')](db[_0xf5f2('0x2d')][_0xf5f2('0x2e')],function(_0x153924){return{'name':_0x153924[_0xf5f2('0x2f')],'type':_0x153924['type']['key']};});_0x11c771[_0xf5f2('0x30')]=_['map'](_0x5a2c7e,_0xf5f2('0x2a'));_0x11c771['query']=_[_0xf5f2('0x31')](_0x53cb96[_0xf5f2('0x32')]);_0x11c771[_0xf5f2('0x33')]=_[_0xf5f2('0x34')](_0x11c771[_0xf5f2('0x30')],_0x11c771[_0xf5f2('0x32')]);_0x14c829[_0xf5f2('0x35')]=_[_0xf5f2('0x34')](_0x11c771['model'],qs[_0xf5f2('0x36')](_0x53cb96[_0xf5f2('0x32')][_0xf5f2('0x36')]));_0x14c829[_0xf5f2('0x35')]=_0x14c829[_0xf5f2('0x35')][_0xf5f2('0x37')]?_0x14c829[_0xf5f2('0x35')]:_0x11c771['model'];if(!_0x53cb96[_0xf5f2('0x32')][_0xf5f2('0x38')]('nolimit')){_0x14c829[_0xf5f2('0x39')]=qs['limit'](_0x53cb96[_0xf5f2('0x32')][_0xf5f2('0x39')]);_0x14c829[_0xf5f2('0x21')]=qs[_0xf5f2('0x21')](_0x53cb96['query']['offset']);}_0x14c829[_0xf5f2('0x3a')]=qs[_0xf5f2('0x3b')](_0x53cb96[_0xf5f2('0x32')]['sort']);_0x14c829[_0xf5f2('0x3c')]=qs['filters'](_[_0xf5f2('0x3d')](_0x53cb96['query'],_0x11c771[_0xf5f2('0x33')]));if(_0x53cb96[_0xf5f2('0x32')]['filter']){_0x14c829[_0xf5f2('0x3c')]=_[_0xf5f2('0x3e')](_0x14c829[_0xf5f2('0x3c')],{'$or':_[_0xf5f2('0x2c')](_0x5a2c7e,function(_0x542cd6){if(_0x542cd6['type']!==_0xf5f2('0x3f')){var _0x140a11={};_0x140a11[_0x542cd6[_0xf5f2('0x2a')]]={'$like':'%'+_0x53cb96[_0xf5f2('0x32')][_0xf5f2('0x40')]+'%'};return _0x140a11;}})});}_0x14c829=_[_0xf5f2('0x3e')]({},_0x14c829,_0x53cb96[_0xf5f2('0x41')]);var _0x4c0ac7={'where':_0x14c829[_0xf5f2('0x3c')]};return db[_0xf5f2('0x2d')]['count'](_0x4c0ac7)[_0xf5f2('0x26')](function(_0x3f3895){_0x5027ab[_0xf5f2('0x20')]=_0x3f3895;if(_0x53cb96[_0xf5f2('0x32')][_0xf5f2('0x42')]){_0x14c829[_0xf5f2('0x43')]=[{'all':!![]}];}return db[_0xf5f2('0x2d')][_0xf5f2('0x44')](_0x14c829);})['then'](function(_0x31c3c){_0x5027ab[_0xf5f2('0x45')]=_0x31c3c;return _0x5027ab;})[_0xf5f2('0x26')](respondWithFilteredResult(_0x22c826,_0x14c829))['catch'](handleError(_0x22c826,null));};exports['show']=function(_0x59eb00,_0x76d21b){var _0x2ad13c={'raw':![],'where':{'id':_0x59eb00[_0xf5f2('0x46')]['id']}},_0x4c8d8e={};_0x4c8d8e[_0xf5f2('0x30')]=_[_0xf5f2('0x31')](db[_0xf5f2('0x2d')][_0xf5f2('0x2e')]);_0x4c8d8e[_0xf5f2('0x32')]=_[_0xf5f2('0x31')](_0x59eb00[_0xf5f2('0x32')]);_0x4c8d8e[_0xf5f2('0x33')]=_[_0xf5f2('0x34')](_0x4c8d8e[_0xf5f2('0x30')],_0x4c8d8e[_0xf5f2('0x32')]);_0x2ad13c[_0xf5f2('0x35')]=_[_0xf5f2('0x34')](_0x4c8d8e['model'],qs[_0xf5f2('0x36')](_0x59eb00['query'][_0xf5f2('0x36')]));_0x2ad13c[_0xf5f2('0x35')]=_0x2ad13c[_0xf5f2('0x35')][_0xf5f2('0x37')]?_0x2ad13c[_0xf5f2('0x35')]:_0x4c8d8e[_0xf5f2('0x30')];if(_0x59eb00['query'][_0xf5f2('0x42')]){_0x2ad13c[_0xf5f2('0x43')]=[{'all':!![]}];}_0x2ad13c=_[_0xf5f2('0x3e')]({},_0x2ad13c,_0x59eb00[_0xf5f2('0x41')]);return db[_0xf5f2('0x2d')][_0xf5f2('0x47')](_0x2ad13c)[_0xf5f2('0x26')](handleEntityNotFound(_0x76d21b,null))[_0xf5f2('0x26')](respondWithResult(_0x76d21b,null))['catch'](handleError(_0x76d21b,null));};exports[_0xf5f2('0x48')]=function(_0x33ec29,_0x45db9a){return db['VoiceQueueReport'][_0xf5f2('0x48')](_0x33ec29[_0xf5f2('0x49')],{})[_0xf5f2('0x26')](respondWithResult(_0x45db9a,0xc9))['catch'](handleError(_0x45db9a,null));};exports['update']=function(_0x7bb942,_0x27c472){if(_0x7bb942['body']['id']){delete _0x7bb942[_0xf5f2('0x49')]['id'];}return db['VoiceQueueReport'][_0xf5f2('0x47')]({'where':{'id':_0x7bb942['params']['id']}})[_0xf5f2('0x26')](handleEntityNotFound(_0x27c472,null))['then'](saveUpdates(_0x7bb942[_0xf5f2('0x49')],null))[_0xf5f2('0x26')](respondWithResult(_0x27c472,null))[_0xf5f2('0x4a')](handleError(_0x27c472,null));};exports[_0xf5f2('0x4b')]=function(_0x4fa738,_0x3154c1){return db[_0xf5f2('0x2d')]['find']({'where':{'id':_0x4fa738['params']['id']}})[_0xf5f2('0x26')](handleEntityNotFound(_0x3154c1,null))[_0xf5f2('0x26')](removeEntity(_0x3154c1,null))['catch'](handleError(_0x3154c1,null));};exports[_0xf5f2('0x4c')]=function(_0xe0ce7f,_0x29c9b6){return db[_0xf5f2('0x2d')]['describe']()['then'](respondWithResult(_0x29c9b6,null))[_0xf5f2('0x4a')](handleError(_0x29c9b6,null));};exports[_0xf5f2('0x4d')]=function(_0x4b62fc,_0x40eef){var _0x43fc49={},_0x255125={},_0x14029e={'count':0x0,'rows':[]};_0x255125[_0xf5f2('0x30')]=_[_0xf5f2('0x31')](db[_0xf5f2('0x2d')]['rawAttributes']);_0x255125['query']=_[_0xf5f2('0x31')](_0x4b62fc[_0xf5f2('0x32')]);_0x255125[_0xf5f2('0x33')]=_[_0xf5f2('0x34')](_0x255125[_0xf5f2('0x30')],_0x255125['query']);_0x43fc49[_0xf5f2('0x35')]=_[_0xf5f2('0x34')](_0x255125[_0xf5f2('0x30')],qs['fields'](_0x4b62fc[_0xf5f2('0x32')]['fields']));_0x43fc49[_0xf5f2('0x35')]=_0x43fc49[_0xf5f2('0x35')][_0xf5f2('0x37')]?_0x43fc49[_0xf5f2('0x35')]:_0x255125['model'];if(!_0x4b62fc['query'][_0xf5f2('0x38')]('nolimit')){_0x43fc49[_0xf5f2('0x39')]=qs[_0xf5f2('0x39')](_0x4b62fc['query'][_0xf5f2('0x39')]);_0x43fc49[_0xf5f2('0x21')]=qs[_0xf5f2('0x21')](_0x4b62fc['query'][_0xf5f2('0x21')]);}_0x43fc49[_0xf5f2('0x3a')]=qs[_0xf5f2('0x3b')](_0x4b62fc[_0xf5f2('0x32')]['sort']);_0x43fc49[_0xf5f2('0x3c')]=qs['filters'](_[_0xf5f2('0x3d')](_0x4b62fc[_0xf5f2('0x32')],_0x255125[_0xf5f2('0x33')]));if(_0x4b62fc[_0xf5f2('0x32')][_0xf5f2('0x40')]){_0x43fc49['where']=_[_0xf5f2('0x3e')](_0x43fc49[_0xf5f2('0x3c')],{'$or':_[_0xf5f2('0x2c')](_0x43fc49[_0xf5f2('0x35')],function(_0x2c5733){var _0x5359b5={};_0x5359b5[_0x2c5733]={'$like':'%'+_0x4b62fc[_0xf5f2('0x32')]['filter']+'%'};return _0x5359b5;})});}_0x43fc49=_['merge']({},_0x43fc49,_0x4b62fc[_0xf5f2('0x41')]);var _0x4802c5={'where':_0x43fc49[_0xf5f2('0x3c')]};return db[_0xf5f2('0x2d')][_0xf5f2('0x20')](_0x4802c5)[_0xf5f2('0x26')](function(_0x5767fc){_0x14029e[_0xf5f2('0x20')]=_0x5767fc;if(_0x4b62fc[_0xf5f2('0x32')][_0xf5f2('0x42')]){_0x43fc49[_0xf5f2('0x43')]=[{'all':!![]}];}return db[_0xf5f2('0x2d')][_0xf5f2('0x44')](_0x43fc49);})[_0xf5f2('0x26')](function(_0x4a7be9){_0x14029e[_0xf5f2('0x45')]=_0x4a7be9;return _0x14029e;})[_0xf5f2('0x26')](respondWithFilteredResult(_0x40eef,_0x43fc49,_0xf5f2('0x4d')))[_0xf5f2('0x4a')](handleError(_0x40eef,null,'getVoiceQueuesReport'));}; \ No newline at end of file +var _0x2ef3=['intersection','attributes','length','order','sort','where','filters','pick','filter','map','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','fields','find','create','body','update','params','destroy','describe','getVoiceQueuesReport','hasOwnProperty','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','then','error','stack','name','index','VoiceQueueReport','rawAttributes','fieldName','type','key','model','keys','query'];(function(_0x273d71,_0x11c3a4){var _0x264e15=function(_0x4344c3){while(--_0x4344c3){_0x273d71['push'](_0x273d71['shift']());}};_0x264e15(++_0x11c3a4);}(_0x2ef3,0xba));var _0x32ef=function(_0x318a08,_0x49ec33){_0x318a08=_0x318a08-0x0;var _0x1c4a2a=_0x2ef3[_0x318a08];return _0x1c4a2a;};'use strict';var pdf=require(_0x32ef('0x0'));var emlformat=require(_0x32ef('0x1'));var rimraf=require(_0x32ef('0x2'));var zipdir=require(_0x32ef('0x3'));var jsonpatch=require(_0x32ef('0x4'));var rp=require(_0x32ef('0x5'));var moment=require('moment');var BPromise=require(_0x32ef('0x6'));var Mustache=require(_0x32ef('0x7'));var util=require('util');var path=require(_0x32ef('0x8'));var sox=require(_0x32ef('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');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('0xf'));var querystring=require(_0x32ef('0x10'));var Papa=require(_0x32ef('0x11'));var Redis=require(_0x32ef('0x12'));var authService=require(_0x32ef('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x14'));var logger=require(_0x32ef('0x15'))(_0x32ef('0x16'));var utils=require(_0x32ef('0x17'));var config=require('../../config/environment');var db=require(_0x32ef('0x18'))['db'];config['redis']=_[_0x32ef('0x19')](config['redis'],{'host':_0x32ef('0x1a'),'port':0x18eb});var socket=require(_0x32ef('0x1b'))(new Redis(config['redis']));require('./voiceQueueReport.socket')[_0x32ef('0x1c')](socket);function respondWithStatusCode(_0x4d8009,_0x326fce){_0x326fce=_0x326fce||0xcc;return function(_0x40a6e6){if(_0x40a6e6){return _0x4d8009[_0x32ef('0x1d')](_0x326fce);}return _0x4d8009[_0x32ef('0x1e')](_0x326fce)['end']();};}function respondWithResult(_0x55bf0b,_0x531e30){_0x531e30=_0x531e30||0xc8;return function(_0x13db1a){if(_0x13db1a){return _0x55bf0b[_0x32ef('0x1e')](_0x531e30)[_0x32ef('0x1f')](_0x13db1a);}};}function respondWithFilteredResult(_0x53a5ca,_0x5d559b){return function(_0x1eb468){if(_0x1eb468){var _0x1a9476=_0x1eb468[_0x32ef('0x20')],_0x286bfb=_0x5d559b['offset'],_0x57863c=_0x5d559b[_0x32ef('0x21')]+_0x5d559b[_0x32ef('0x22')],_0xbe37f6;if(_0x57863c>=_0x1a9476){_0x57863c=_0x1a9476;_0xbe37f6=0xc8;}else{_0xbe37f6=0xce;}_0x53a5ca[_0x32ef('0x1e')](_0xbe37f6);return _0x53a5ca[_0x32ef('0x23')](_0x32ef('0x24'),_0x286bfb+'-'+_0x57863c+'/'+_0x1a9476)[_0x32ef('0x1f')](_0x1eb468);}return null;};}function patchUpdates(_0x4de441){return function(_0x3c5b78){try{jsonpatch['apply'](_0x3c5b78,_0x4de441,!![]);}catch(_0x309866){return BPromise[_0x32ef('0x25')](_0x309866);}return _0x3c5b78['save']();};}function saveUpdates(_0x1af371,_0x97780){return function(_0x5e8898){if(_0x5e8898){return _0x5e8898['update'](_0x1af371)['then'](function(_0x22f2d7){return _0x22f2d7;});}return null;};}function removeEntity(_0xb30fab,_0x225feb){return function(_0x478bef){if(_0x478bef){return _0x478bef['destroy']()[_0x32ef('0x26')](function(){_0xb30fab['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x278495,_0x14d4b3){return function(_0x371540){if(!_0x371540){_0x278495[_0x32ef('0x1d')](0x194);}return _0x371540;};}function handleError(_0x15ce54,_0x234175){_0x234175=_0x234175||0x1f4;return function(_0x1874ea){logger[_0x32ef('0x27')](_0x1874ea[_0x32ef('0x28')]);if(_0x1874ea[_0x32ef('0x29')]){delete _0x1874ea[_0x32ef('0x29')];}_0x15ce54[_0x32ef('0x1e')](_0x234175)['send'](_0x1874ea);};}exports[_0x32ef('0x2a')]=function(_0x2f5d06,_0x5a04cd){var _0x12de1a={},_0x3c569d={},_0x30b250={'count':0x0,'rows':[]};var _0x26e207=_['map'](db[_0x32ef('0x2b')][_0x32ef('0x2c')],function(_0x31dbc3){return{'name':_0x31dbc3[_0x32ef('0x2d')],'type':_0x31dbc3[_0x32ef('0x2e')][_0x32ef('0x2f')]};});_0x3c569d[_0x32ef('0x30')]=_['map'](_0x26e207,_0x32ef('0x29'));_0x3c569d['query']=_[_0x32ef('0x31')](_0x2f5d06[_0x32ef('0x32')]);_0x3c569d['filters']=_[_0x32ef('0x33')](_0x3c569d[_0x32ef('0x30')],_0x3c569d[_0x32ef('0x32')]);_0x12de1a[_0x32ef('0x34')]=_[_0x32ef('0x33')](_0x3c569d['model'],qs['fields'](_0x2f5d06[_0x32ef('0x32')]['fields']));_0x12de1a[_0x32ef('0x34')]=_0x12de1a[_0x32ef('0x34')][_0x32ef('0x35')]?_0x12de1a[_0x32ef('0x34')]:_0x3c569d[_0x32ef('0x30')];if(!_0x2f5d06[_0x32ef('0x32')]['hasOwnProperty']('nolimit')){_0x12de1a['limit']=qs[_0x32ef('0x22')](_0x2f5d06[_0x32ef('0x32')][_0x32ef('0x22')]);_0x12de1a['offset']=qs['offset'](_0x2f5d06[_0x32ef('0x32')][_0x32ef('0x21')]);}_0x12de1a[_0x32ef('0x36')]=qs['sort'](_0x2f5d06['query'][_0x32ef('0x37')]);_0x12de1a[_0x32ef('0x38')]=qs[_0x32ef('0x39')](_[_0x32ef('0x3a')](_0x2f5d06[_0x32ef('0x32')],_0x3c569d[_0x32ef('0x39')]));if(_0x2f5d06[_0x32ef('0x32')][_0x32ef('0x3b')]){_0x12de1a[_0x32ef('0x38')]=_['merge'](_0x12de1a[_0x32ef('0x38')],{'$or':_[_0x32ef('0x3c')](_0x26e207,function(_0x14b54f){if(_0x14b54f['type']!==_0x32ef('0x3d')){var _0x17e489={};_0x17e489[_0x14b54f[_0x32ef('0x29')]]={'$like':'%'+_0x2f5d06[_0x32ef('0x32')][_0x32ef('0x3b')]+'%'};return _0x17e489;}})});}_0x12de1a=_[_0x32ef('0x3e')]({},_0x12de1a,_0x2f5d06[_0x32ef('0x3f')]);var _0x1cebed={'where':_0x12de1a[_0x32ef('0x38')]};return db[_0x32ef('0x2b')][_0x32ef('0x20')](_0x1cebed)[_0x32ef('0x26')](function(_0x48e071){_0x30b250[_0x32ef('0x20')]=_0x48e071;if(_0x2f5d06[_0x32ef('0x32')][_0x32ef('0x40')]){_0x12de1a[_0x32ef('0x41')]=[{'all':!![]}];}return db[_0x32ef('0x2b')][_0x32ef('0x42')](_0x12de1a);})[_0x32ef('0x26')](function(_0x596d5a){_0x30b250['rows']=_0x596d5a;return _0x30b250;})[_0x32ef('0x26')](respondWithFilteredResult(_0x5a04cd,_0x12de1a))[_0x32ef('0x43')](handleError(_0x5a04cd,null));};exports[_0x32ef('0x44')]=function(_0x765c63,_0x5dca14){var _0x2901a1={'raw':![],'where':{'id':_0x765c63['params']['id']}},_0x1f323a={};_0x1f323a[_0x32ef('0x30')]=_['keys'](db[_0x32ef('0x2b')][_0x32ef('0x2c')]);_0x1f323a[_0x32ef('0x32')]=_[_0x32ef('0x31')](_0x765c63[_0x32ef('0x32')]);_0x1f323a[_0x32ef('0x39')]=_[_0x32ef('0x33')](_0x1f323a[_0x32ef('0x30')],_0x1f323a[_0x32ef('0x32')]);_0x2901a1[_0x32ef('0x34')]=_['intersection'](_0x1f323a[_0x32ef('0x30')],qs['fields'](_0x765c63[_0x32ef('0x32')][_0x32ef('0x45')]));_0x2901a1[_0x32ef('0x34')]=_0x2901a1['attributes'][_0x32ef('0x35')]?_0x2901a1[_0x32ef('0x34')]:_0x1f323a[_0x32ef('0x30')];if(_0x765c63[_0x32ef('0x32')][_0x32ef('0x40')]){_0x2901a1[_0x32ef('0x41')]=[{'all':!![]}];}_0x2901a1=_[_0x32ef('0x3e')]({},_0x2901a1,_0x765c63['options']);return db['VoiceQueueReport'][_0x32ef('0x46')](_0x2901a1)[_0x32ef('0x26')](handleEntityNotFound(_0x5dca14,null))[_0x32ef('0x26')](respondWithResult(_0x5dca14,null))[_0x32ef('0x43')](handleError(_0x5dca14,null));};exports[_0x32ef('0x47')]=function(_0xd67dc9,_0x44ad11){return db[_0x32ef('0x2b')][_0x32ef('0x47')](_0xd67dc9[_0x32ef('0x48')],{})[_0x32ef('0x26')](respondWithResult(_0x44ad11,0xc9))[_0x32ef('0x43')](handleError(_0x44ad11,null));};exports[_0x32ef('0x49')]=function(_0x4c2534,_0x420f00){if(_0x4c2534[_0x32ef('0x48')]['id']){delete _0x4c2534[_0x32ef('0x48')]['id'];}return db[_0x32ef('0x2b')][_0x32ef('0x46')]({'where':{'id':_0x4c2534[_0x32ef('0x4a')]['id']}})[_0x32ef('0x26')](handleEntityNotFound(_0x420f00,null))[_0x32ef('0x26')](saveUpdates(_0x4c2534[_0x32ef('0x48')],null))[_0x32ef('0x26')](respondWithResult(_0x420f00,null))[_0x32ef('0x43')](handleError(_0x420f00,null));};exports[_0x32ef('0x4b')]=function(_0x272377,_0x326445){return db[_0x32ef('0x2b')][_0x32ef('0x46')]({'where':{'id':_0x272377[_0x32ef('0x4a')]['id']}})[_0x32ef('0x26')](handleEntityNotFound(_0x326445,null))['then'](removeEntity(_0x326445,null))['catch'](handleError(_0x326445,null));};exports[_0x32ef('0x4c')]=function(_0x259c32,_0xa9bf19){return db[_0x32ef('0x2b')][_0x32ef('0x4c')]()[_0x32ef('0x26')](respondWithResult(_0xa9bf19,null))[_0x32ef('0x43')](handleError(_0xa9bf19,null));};exports[_0x32ef('0x4d')]=function(_0x15b640,_0x368bf1){var _0x3697a7={},_0x4a6fd2={},_0x21216d={'count':0x0,'rows':[]};_0x4a6fd2[_0x32ef('0x30')]=_[_0x32ef('0x31')](db[_0x32ef('0x2b')][_0x32ef('0x2c')]);_0x4a6fd2[_0x32ef('0x32')]=_['keys'](_0x15b640[_0x32ef('0x32')]);_0x4a6fd2[_0x32ef('0x39')]=_[_0x32ef('0x33')](_0x4a6fd2['model'],_0x4a6fd2[_0x32ef('0x32')]);_0x3697a7['attributes']=_[_0x32ef('0x33')](_0x4a6fd2[_0x32ef('0x30')],qs['fields'](_0x15b640[_0x32ef('0x32')]['fields']));_0x3697a7[_0x32ef('0x34')]=_0x3697a7[_0x32ef('0x34')][_0x32ef('0x35')]?_0x3697a7[_0x32ef('0x34')]:_0x4a6fd2[_0x32ef('0x30')];if(!_0x15b640[_0x32ef('0x32')][_0x32ef('0x4e')]('nolimit')){_0x3697a7['limit']=qs[_0x32ef('0x22')](_0x15b640['query']['limit']);_0x3697a7[_0x32ef('0x21')]=qs[_0x32ef('0x21')](_0x15b640[_0x32ef('0x32')][_0x32ef('0x21')]);}_0x3697a7[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0x15b640[_0x32ef('0x32')][_0x32ef('0x37')]);_0x3697a7[_0x32ef('0x38')]=qs[_0x32ef('0x39')](_['pick'](_0x15b640['query'],_0x4a6fd2[_0x32ef('0x39')]));if(_0x15b640[_0x32ef('0x32')]['filter']){_0x3697a7[_0x32ef('0x38')]=_[_0x32ef('0x3e')](_0x3697a7[_0x32ef('0x38')],{'$or':_['map'](_0x3697a7[_0x32ef('0x34')],function(_0x3c31d0){var _0x20dcc5={};_0x20dcc5[_0x3c31d0]={'$like':'%'+_0x15b640['query']['filter']+'%'};return _0x20dcc5;})});}_0x3697a7=_[_0x32ef('0x3e')]({},_0x3697a7,_0x15b640['options']);var _0x17f447={'where':_0x3697a7['where']};return db['VoiceQueueReport'][_0x32ef('0x20')](_0x17f447)[_0x32ef('0x26')](function(_0x10cb37){_0x21216d['count']=_0x10cb37;if(_0x15b640[_0x32ef('0x32')][_0x32ef('0x40')]){_0x3697a7[_0x32ef('0x41')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x32ef('0x42')](_0x3697a7);})[_0x32ef('0x26')](function(_0x4c3bab){_0x21216d['rows']=_0x4c3bab;return _0x21216d;})[_0x32ef('0x26')](respondWithFilteredResult(_0x368bf1,_0x3697a7,_0x32ef('0x4d')))[_0x32ef('0x43')](handleError(_0x368bf1,null,_0x32ef('0x4d')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 36944f5..5c9847a 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 _0xa810=['../../mysqldb','setMaxListeners','save','update','remove','emit','hook','exports','events'];(function(_0x4be6e7,_0x43448a){var _0x2cfbfe=function(_0x28ba0a){while(--_0x28ba0a){_0x4be6e7['push'](_0x4be6e7['shift']());}};_0x2cfbfe(++_0x43448a);}(_0xa810,0x1dc));var _0x0a81=function(_0x26e424,_0xfcf210){_0x26e424=_0x26e424-0x0;var _0x2c81d6=_0xa810[_0x26e424];return _0x2c81d6;};'use strict';var EventEmitter=require(_0x0a81('0x0'));var VoiceQueueReport=require(_0x0a81('0x1'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x0a81('0x2')](0x0);var events={'afterCreate':_0x0a81('0x3'),'afterUpdate':_0x0a81('0x4'),'afterDestroy':_0x0a81('0x5')};function emitEvent(_0x43e76c){return function(_0x11d871,_0x26c410,_0x577770){VoiceQueueReportEvents[_0x0a81('0x6')](_0x43e76c+':'+_0x11d871['id'],_0x11d871);VoiceQueueReportEvents['emit'](_0x43e76c,_0x11d871);_0x577770(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0x0a81('0x7')](e,emitEvent(event));}}module[_0x0a81('0x8')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x6030=['hook','exports','../../mysqldb','VoiceQueueReport','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x54b4bd,_0x2f3bc4){var _0x520f1b=function(_0x14089c){while(--_0x14089c){_0x54b4bd['push'](_0x54b4bd['shift']());}};_0x520f1b(++_0x2f3bc4);}(_0x6030,0x9b));var _0x0603=function(_0x15bf2a,_0x48c779){_0x15bf2a=_0x15bf2a-0x0;var _0x421257=_0x6030[_0x15bf2a];return _0x421257;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0x0603('0x0'))['db'][_0x0603('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x0603('0x2')](0x0);var events={'afterCreate':_0x0603('0x3'),'afterUpdate':_0x0603('0x4'),'afterDestroy':'remove'};function emitEvent(_0x59fd06){return function(_0x3b8ea6,_0x46a9d1,_0xf2e0ac){VoiceQueueReportEvents[_0x0603('0x5')](_0x59fd06+':'+_0x3b8ea6['id'],_0x3b8ea6);VoiceQueueReportEvents[_0x0603('0x5')](_0x59fd06,_0x3b8ea6);_0xf2e0ac(null);};}for(var e in events){if(events[_0x0603('0x6')](e)){var event=events[e];VoiceQueueReport[_0x0603('0x7')](e,emitEvent(event));}}module[_0x0603('0x8')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 9419d38..6272329 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 _0x5f2f=['VoiceQueueReport','uniqueid','calleridnum','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./voiceQueueReport.attributes','exports','define'];(function(_0x24003a,_0x4f4649){var _0x1d76b0=function(_0x5d020c){while(--_0x5d020c){_0x24003a['push'](_0x24003a['shift']());}};_0x1d76b0(++_0x4f4649);}(_0x5f2f,0x73));var _0xf5f2=function(_0x240c19,_0x11de1b){_0x240c19=_0x240c19-0x0;var _0x18d022=_0x5f2f[_0x240c19];return _0x18d022;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var logger=require(_0xf5f2('0x2'))(_0xf5f2('0x3'));var moment=require(_0xf5f2('0x4'));var BPromise=require(_0xf5f2('0x5'));var rp=require(_0xf5f2('0x6'));var fs=require('fs');var path=require(_0xf5f2('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf5f2('0x8'));module[_0xf5f2('0x9')]=function(_0xad7f65,_0x3eebf6){return _0xad7f65[_0xf5f2('0xa')](_0xf5f2('0xb'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0xf5f2('0xc')]},{'fields':[_0xf5f2('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5f2f=['VoiceQueueReport','uniqueid','calleridnum','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./voiceQueueReport.attributes','exports','define'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4e5614,_0xe3a300){_0x4e5614=_0x4e5614-0x0;var _0x19f6e4=_0x5f2f[_0x4e5614];return _0x19f6e4;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var logger=require(_0xf5f2('0x2'))(_0xf5f2('0x3'));var moment=require(_0xf5f2('0x4'));var BPromise=require(_0xf5f2('0x5'));var rp=require(_0xf5f2('0x6'));var fs=require('fs');var path=require(_0xf5f2('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf5f2('0x8'));module[_0xf5f2('0x9')]=function(_0xad7f65,_0x3eebf6){return _0xad7f65[_0xf5f2('0xa')](_0xf5f2('0xb'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0xf5f2('0xc')]},{'fields':[_0xf5f2('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index bbaff56..8ae3a91 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 _0x0d06=['register','then','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','options','raw','where','attributes','limit','include','model','info','create','body','CreateVoiceQueueReport','debug','UpdateVoiceQueueReport','update','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0d06,0x1f2));var _0x60d0=function(_0x19e08e,_0x178f46){_0x19e08e=_0x19e08e-0x0;var _0x14c229=_0x0d06[_0x19e08e];return _0x14c229;};'use strict';var _=require(_0x60d0('0x0'));var util=require(_0x60d0('0x1'));var moment=require(_0x60d0('0x2'));var BPromise=require(_0x60d0('0x3'));var rs=require(_0x60d0('0x4'));var fs=require('fs');var Redis=require(_0x60d0('0x5'));var db=require(_0x60d0('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x60d0('0x7'))(_0x60d0('0x8'));var config=require(_0x60d0('0x9'));var jayson=require(_0x60d0('0xa'));var client=jayson[_0x60d0('0xb')][_0x60d0('0xc')]({'port':0x232a});config[_0x60d0('0xd')]=_[_0x60d0('0xe')](config[_0x60d0('0xd')],{'host':_0x60d0('0xf'),'port':0x18eb});var socket=require(_0x60d0('0x10'))(new Redis(config[_0x60d0('0xd')]));require(_0x60d0('0x11'))[_0x60d0('0x12')](socket);function respondWithRpcPromise(_0xe9b0c0,_0x1396d3,_0x5e581a){return new BPromise(function(_0x2b44ee,_0x1f592c){return client['request'](_0xe9b0c0,_0x5e581a)[_0x60d0('0x13')](function(_0x44917b){logger['info'](_0x60d0('0x14'),_0x1396d3,_0x60d0('0x15'));logger['debug']('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x1396d3,_0x60d0('0x15'),JSON[_0x60d0('0x16')](_0x44917b));if(_0x44917b[_0x60d0('0x17')]){if(_0x44917b['error']['code']===0x1f4){logger['error'](_0x60d0('0x14'),_0x1396d3,_0x44917b[_0x60d0('0x17')]['message']);return _0x1f592c(_0x44917b[_0x60d0('0x17')][_0x60d0('0x18')]);}logger['error'](_0x60d0('0x14'),_0x1396d3,_0x44917b['error']['message']);return _0x2b44ee(_0x44917b[_0x60d0('0x17')][_0x60d0('0x18')]);}else{logger['info'](_0x60d0('0x14'),_0x1396d3,'request\x20sent');_0x2b44ee(_0x44917b[_0x60d0('0x19')][_0x60d0('0x18')]);}})[_0x60d0('0x1a')](function(_0x33d043){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x1396d3,_0x33d043);_0x1f592c(_0x33d043);});});}exports[_0x60d0('0x1b')]=function(_0x27b77b){var _0x47ef9d=this;return new Promise(function(_0x172f57,_0x34dd04){return db[_0x60d0('0x1c')]['findAll']({'raw':_0x27b77b['options']?_0x27b77b[_0x60d0('0x1d')][_0x60d0('0x1e')]===undefined?!![]:![]:!![],'where':_0x27b77b[_0x60d0('0x1d')]?_0x27b77b[_0x60d0('0x1d')][_0x60d0('0x1f')]||null:null,'attributes':_0x27b77b['options']?_0x27b77b[_0x60d0('0x1d')][_0x60d0('0x20')]||null:null,'limit':_0x27b77b[_0x60d0('0x1d')]?_0x27b77b[_0x60d0('0x1d')][_0x60d0('0x21')]||null:null,'include':_0x27b77b[_0x60d0('0x1d')]?_0x27b77b[_0x60d0('0x1d')][_0x60d0('0x22')]?_['map'](_0x27b77b[_0x60d0('0x1d')]['include'],function(_0x3de4e1){return{'model':db[_0x3de4e1[_0x60d0('0x23')]],'as':_0x3de4e1['as'],'attributes':_0x3de4e1[_0x60d0('0x20')],'include':_0x3de4e1[_0x60d0('0x22')]?_['map'](_0x3de4e1[_0x60d0('0x22')],function(_0x2e91b3){return{'model':db[_0x2e91b3[_0x60d0('0x23')]],'as':_0x2e91b3['as'],'attributes':_0x2e91b3['attributes'],'include':_0x2e91b3['include']?_['map'](_0x2e91b3[_0x60d0('0x22')],function(_0xc10883){return{'model':db[_0xc10883[_0x60d0('0x23')]],'as':_0xc10883['as'],'attributes':_0xc10883['attributes']};}):[]};}):[]};}):[]:[]})[_0x60d0('0x13')](function(_0x36392e){logger[_0x60d0('0x24')]('GetVoiceQueueReport',_0x27b77b);logger['debug'](_0x60d0('0x1b'),_0x27b77b,JSON[_0x60d0('0x16')](_0x36392e));_0x172f57(_0x36392e);})[_0x60d0('0x1a')](function(_0x2f7ad4){logger[_0x60d0('0x17')](_0x60d0('0x1b'),_0x2f7ad4[_0x60d0('0x18')],_0x27b77b);_0x34dd04(_0x47ef9d[_0x60d0('0x17')](0x1f4,_0x2f7ad4[_0x60d0('0x18')]));});});};exports['CreateVoiceQueueReport']=function(_0x128a0f){var _0x15c208=this;return new Promise(function(_0x3849af,_0x715e29){return db['VoiceQueueReport'][_0x60d0('0x25')](_0x128a0f[_0x60d0('0x26')],{'raw':_0x128a0f[_0x60d0('0x1d')]?_0x128a0f[_0x60d0('0x1d')][_0x60d0('0x1e')]===undefined?!![]:![]:!![]})[_0x60d0('0x13')](function(_0x4d4ff8){logger[_0x60d0('0x24')](_0x60d0('0x27'),_0x128a0f);logger[_0x60d0('0x28')](_0x60d0('0x27'),_0x128a0f,JSON[_0x60d0('0x16')](_0x4d4ff8));_0x3849af(_0x4d4ff8);})['catch'](function(_0x12570d){logger['error']('CreateVoiceQueueReport',_0x12570d[_0x60d0('0x18')],_0x128a0f);_0x715e29(_0x15c208['error'](0x1f4,_0x12570d[_0x60d0('0x18')]));});});};exports[_0x60d0('0x29')]=function(_0x23ae49){var _0x1a7047=this;return new Promise(function(_0x5a777a,_0x3d4cb8){return db['VoiceQueueReport'][_0x60d0('0x2a')](_0x23ae49[_0x60d0('0x26')],{'raw':_0x23ae49[_0x60d0('0x1d')]?_0x23ae49[_0x60d0('0x1d')][_0x60d0('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23ae49[_0x60d0('0x1d')]?_0x23ae49[_0x60d0('0x1d')][_0x60d0('0x1f')]||null:null,'attributes':_0x23ae49[_0x60d0('0x1d')]?_0x23ae49['options'][_0x60d0('0x20')]||null:null,'limit':_0x23ae49[_0x60d0('0x1d')]?_0x23ae49[_0x60d0('0x1d')]['limit']||null:null})[_0x60d0('0x13')](function(_0x2ef33b){logger['info'](_0x60d0('0x29'),_0x23ae49);logger['debug'](_0x60d0('0x29'),_0x23ae49,JSON[_0x60d0('0x16')](_0x2ef33b));_0x5a777a(_0x2ef33b);})[_0x60d0('0x1a')](function(_0x2fc2c7){logger[_0x60d0('0x17')](_0x60d0('0x29'),_0x2fc2c7['message'],_0x23ae49);_0x3d4cb8(_0x1a7047[_0x60d0('0x17')](0x1f4,_0x2fc2c7[_0x60d0('0x18')]));});});}; \ No newline at end of file +var _0x4f9e=['redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetVoiceQueueReport','VoiceQueueReport','findAll','options','where','attributes','include','model','map','catch','create','body','raw','CreateVoiceQueueReport','UpdateVoiceQueueReport','update','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xbbfe59,_0x46067f){var _0x28a2a4=function(_0xfe230){while(--_0xfe230){_0xbbfe59['push'](_0xbbfe59['shift']());}};_0x28a2a4(++_0x46067f);}(_0x4f9e,0x1b6));var _0xe4f9=function(_0x1177d5,_0x22b649){_0x1177d5=_0x1177d5-0x0;var _0xc3ddc2=_0x4f9e[_0x1177d5];return _0xc3ddc2;};'use strict';var _=require(_0xe4f9('0x0'));var util=require(_0xe4f9('0x1'));var moment=require('moment');var BPromise=require(_0xe4f9('0x2'));var rs=require(_0xe4f9('0x3'));var fs=require('fs');var Redis=require(_0xe4f9('0x4'));var db=require(_0xe4f9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe4f9('0x6'))(_0xe4f9('0x7'));var config=require(_0xe4f9('0x8'));var jayson=require(_0xe4f9('0x9'));var client=jayson[_0xe4f9('0xa')][_0xe4f9('0xb')]({'port':0x232a});config[_0xe4f9('0xc')]=_['defaults'](config[_0xe4f9('0xc')],{'host':_0xe4f9('0xd'),'port':0x18eb});var socket=require(_0xe4f9('0xe'))(new Redis(config[_0xe4f9('0xc')]));require(_0xe4f9('0xf'))[_0xe4f9('0x10')](socket);function respondWithRpcPromise(_0x3c97ae,_0x270902,_0xb23d3b){return new BPromise(function(_0x57a977,_0x3cda28){return client[_0xe4f9('0x11')](_0x3c97ae,_0xb23d3b)[_0xe4f9('0x12')](function(_0x1f5ff1){logger[_0xe4f9('0x13')](_0xe4f9('0x14'),_0x270902,_0xe4f9('0x15'));logger[_0xe4f9('0x16')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x270902,_0xe4f9('0x15'),JSON[_0xe4f9('0x17')](_0x1f5ff1));if(_0x1f5ff1['error']){if(_0x1f5ff1[_0xe4f9('0x18')][_0xe4f9('0x19')]===0x1f4){logger[_0xe4f9('0x18')](_0xe4f9('0x14'),_0x270902,_0x1f5ff1[_0xe4f9('0x18')]['message']);return _0x3cda28(_0x1f5ff1['error']['message']);}logger[_0xe4f9('0x18')]('VoiceQueueReport,\x20%s,\x20%s',_0x270902,_0x1f5ff1['error'][_0xe4f9('0x1a')]);return _0x57a977(_0x1f5ff1['error'][_0xe4f9('0x1a')]);}else{logger[_0xe4f9('0x13')]('VoiceQueueReport,\x20%s,\x20%s',_0x270902,'request\x20sent');_0x57a977(_0x1f5ff1[_0xe4f9('0x1b')][_0xe4f9('0x1a')]);}})['catch'](function(_0x946188){logger['error'](_0xe4f9('0x14'),_0x270902,_0x946188);_0x3cda28(_0x946188);});});}exports[_0xe4f9('0x1c')]=function(_0x34b442){var _0xd9e09e=this;return new Promise(function(_0x3f4aa1,_0x27ecb5){return db[_0xe4f9('0x1d')][_0xe4f9('0x1e')]({'raw':_0x34b442[_0xe4f9('0x1f')]?_0x34b442[_0xe4f9('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x34b442['options']?_0x34b442[_0xe4f9('0x1f')][_0xe4f9('0x20')]||null:null,'attributes':_0x34b442[_0xe4f9('0x1f')]?_0x34b442[_0xe4f9('0x1f')][_0xe4f9('0x21')]||null:null,'limit':_0x34b442[_0xe4f9('0x1f')]?_0x34b442[_0xe4f9('0x1f')]['limit']||null:null,'include':_0x34b442[_0xe4f9('0x1f')]?_0x34b442[_0xe4f9('0x1f')][_0xe4f9('0x22')]?_['map'](_0x34b442[_0xe4f9('0x1f')]['include'],function(_0x3a0170){return{'model':db[_0x3a0170[_0xe4f9('0x23')]],'as':_0x3a0170['as'],'attributes':_0x3a0170[_0xe4f9('0x21')],'include':_0x3a0170[_0xe4f9('0x22')]?_[_0xe4f9('0x24')](_0x3a0170['include'],function(_0x4c33e1){return{'model':db[_0x4c33e1[_0xe4f9('0x23')]],'as':_0x4c33e1['as'],'attributes':_0x4c33e1[_0xe4f9('0x21')],'include':_0x4c33e1[_0xe4f9('0x22')]?_[_0xe4f9('0x24')](_0x4c33e1[_0xe4f9('0x22')],function(_0x1ace21){return{'model':db[_0x1ace21['model']],'as':_0x1ace21['as'],'attributes':_0x1ace21[_0xe4f9('0x21')]};}):[]};}):[]};}):[]:[]})[_0xe4f9('0x12')](function(_0x44a771){logger[_0xe4f9('0x13')](_0xe4f9('0x1c'),_0x34b442);logger[_0xe4f9('0x16')](_0xe4f9('0x1c'),_0x34b442,JSON['stringify'](_0x44a771));_0x3f4aa1(_0x44a771);})[_0xe4f9('0x25')](function(_0x3ff0cb){logger[_0xe4f9('0x18')](_0xe4f9('0x1c'),_0x3ff0cb[_0xe4f9('0x1a')],_0x34b442);_0x27ecb5(_0xd9e09e[_0xe4f9('0x18')](0x1f4,_0x3ff0cb['message']));});});};exports['CreateVoiceQueueReport']=function(_0x3822a2){var _0x1e7125=this;return new Promise(function(_0x2a3f62,_0x509245){return db[_0xe4f9('0x1d')][_0xe4f9('0x26')](_0x3822a2[_0xe4f9('0x27')],{'raw':_0x3822a2[_0xe4f9('0x1f')]?_0x3822a2[_0xe4f9('0x1f')][_0xe4f9('0x28')]===undefined?!![]:![]:!![]})[_0xe4f9('0x12')](function(_0x1caefa){logger[_0xe4f9('0x13')]('CreateVoiceQueueReport',_0x3822a2);logger[_0xe4f9('0x16')](_0xe4f9('0x29'),_0x3822a2,JSON[_0xe4f9('0x17')](_0x1caefa));_0x2a3f62(_0x1caefa);})[_0xe4f9('0x25')](function(_0x41e192){logger['error'](_0xe4f9('0x29'),_0x41e192['message'],_0x3822a2);_0x509245(_0x1e7125['error'](0x1f4,_0x41e192['message']));});});};exports[_0xe4f9('0x2a')]=function(_0x4cff5c){var _0x1b453d=this;return new Promise(function(_0x593340,_0x44ca63){return db[_0xe4f9('0x1d')][_0xe4f9('0x2b')](_0x4cff5c[_0xe4f9('0x27')],{'raw':_0x4cff5c['options']?_0x4cff5c[_0xe4f9('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4cff5c[_0xe4f9('0x1f')]?_0x4cff5c[_0xe4f9('0x1f')][_0xe4f9('0x20')]||null:null,'attributes':_0x4cff5c[_0xe4f9('0x1f')]?_0x4cff5c[_0xe4f9('0x1f')][_0xe4f9('0x21')]||null:null,'limit':_0x4cff5c[_0xe4f9('0x1f')]?_0x4cff5c[_0xe4f9('0x1f')][_0xe4f9('0x2c')]||null:null})[_0xe4f9('0x12')](function(_0x135b67){logger[_0xe4f9('0x13')](_0xe4f9('0x2a'),_0x4cff5c);logger['debug']('UpdateVoiceQueueReport',_0x4cff5c,JSON['stringify'](_0x135b67));_0x593340(_0x135b67);})['catch'](function(_0x8f4c25){logger[_0xe4f9('0x18')](_0xe4f9('0x2a'),_0x8f4c25[_0xe4f9('0x1a')],_0x4cff5c);_0x44ca63(_0x1b453d[_0xe4f9('0x18')](0x1f4,_0x8f4c25[_0xe4f9('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 0f863c6..5b30579 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 _0xa6d6=['save','update','emit','removeListener','register','length','voiceQueueReport:','./voiceQueueReport.events'];(function(_0x1ff26f,_0x24704d){var _0x2fed9b=function(_0x4ea6e0){while(--_0x4ea6e0){_0x1ff26f['push'](_0x1ff26f['shift']());}};_0x2fed9b(++_0x24704d);}(_0xa6d6,0x127));var _0x6a6d=function(_0x81c991,_0x2058c4){_0x81c991=_0x81c991-0x0;var _0x306e28=_0xa6d6[_0x81c991];return _0x306e28;};'use strict';var VoiceQueueReportEvents=require(_0x6a6d('0x0'));var events=[_0x6a6d('0x1'),'remove',_0x6a6d('0x2')];function createListener(_0x31ea66,_0x4eca97){return function(_0xf04e17){_0x4eca97[_0x6a6d('0x3')](_0x31ea66,_0xf04e17);};}function removeListener(_0xb18427,_0x31a209){return function(){VoiceQueueReportEvents[_0x6a6d('0x4')](_0xb18427,_0x31a209);};}exports[_0x6a6d('0x5')]=function(_0x48875f){for(var _0x3a8ba0=0x0,_0x229a5b=events[_0x6a6d('0x6')];_0x3a8ba0<_0x229a5b;_0x3a8ba0++){var _0x9f28b2=events[_0x3a8ba0];var _0x254072=createListener(_0x6a6d('0x7')+_0x9f28b2,_0x48875f);VoiceQueueReportEvents['on'](_0x9f28b2,_0x254072);}}; \ No newline at end of file +var _0xced6=['register','length','voiceQueueReport:','remove','emit','removeListener'];(function(_0x2d2fc5,_0x37bbf5){var _0x33bb1e=function(_0x120c50){while(--_0x120c50){_0x2d2fc5['push'](_0x2d2fc5['shift']());}};_0x33bb1e(++_0x37bbf5);}(_0xced6,0x1dd));var _0x6ced=function(_0xd06b04,_0x7743e2){_0xd06b04=_0xd06b04-0x0;var _0x57e663=_0xced6[_0xd06b04];return _0x57e663;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=['save',_0x6ced('0x0'),'update'];function createListener(_0x590bfa,_0x3dda57){return function(_0x506752){_0x3dda57[_0x6ced('0x1')](_0x590bfa,_0x506752);};}function removeListener(_0xb5d18,_0x2b3d8e){return function(){VoiceQueueReportEvents[_0x6ced('0x2')](_0xb5d18,_0x2b3d8e);};}exports[_0x6ced('0x3')]=function(_0x3f027b){for(var _0x204fae=0x0,_0x5bcceb=events[_0x6ced('0x4')];_0x204fae<_0x5bcceb;_0x204fae++){var _0x472cef=events[_0x204fae];var _0x449ae8=createListener(_0x6ced('0x5')+_0x472cef,_0x3f027b);VoiceQueueReportEvents['on'](_0x472cef,_0x449ae8);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index d4ebfa5..7b091f4 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 _0x578a=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','put','update','delete','destroy','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x578a,0x1db));var _0xa578=function(_0x299784,_0xb0918f){_0x299784=_0x299784-0x0;var _0x5ab008=_0x578a[_0x299784];return _0x5ab008;};'use strict';var multer=require(_0xa578('0x0'));var util=require(_0xa578('0x1'));var path=require(_0xa578('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa578('0x3')]();var auth=require(_0xa578('0x4'));var interaction=require(_0xa578('0x5'));var config=require(_0xa578('0x6'));var controller=require('./voiceQueuesLog.controller');router[_0xa578('0x7')]('/',auth[_0xa578('0x8')](),controller[_0xa578('0x9')]);router['get'](_0xa578('0xa'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xa578('0x8')](),controller['create']);router[_0xa578('0xb')](_0xa578('0xa'),auth[_0xa578('0x8')](),controller[_0xa578('0xc')]);router[_0xa578('0xd')]('/:id',auth[_0xa578('0x8')](),controller[_0xa578('0xe')]);module[_0xa578('0xf')]=router; \ No newline at end of file +var _0x5d87=['/:id','show','post','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5d87,0x16b));var _0x75d8=function(_0x23cefa,_0x27b232){_0x23cefa=_0x23cefa-0x0;var _0x2ae6cf=_0x5d87[_0x23cefa];return _0x2ae6cf;};'use strict';var multer=require(_0x75d8('0x0'));var util=require(_0x75d8('0x1'));var path=require(_0x75d8('0x2'));var timeout=require(_0x75d8('0x3'));var express=require(_0x75d8('0x4'));var router=express[_0x75d8('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x75d8('0x6'));var config=require(_0x75d8('0x7'));var controller=require('./voiceQueuesLog.controller');router[_0x75d8('0x8')]('/',auth[_0x75d8('0x9')](),controller[_0x75d8('0xa')]);router[_0x75d8('0x8')](_0x75d8('0xb'),auth[_0x75d8('0x9')](),controller[_0x75d8('0xc')]);router[_0x75d8('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x75d8('0xb'),auth[_0x75d8('0x9')](),controller['update']);router[_0x75d8('0xe')](_0x75d8('0xb'),auth[_0x75d8('0x9')](),controller[_0x75d8('0xf')]);module[_0x75d8('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 6523012..981d5d8 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 _0x5677=['exports','STRING','DATE','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment'];(function(_0x2be104,_0x46adbb){var _0x2f9838=function(_0x59260b){while(--_0x59260b){_0x2be104['push'](_0x2be104['shift']());}};_0x2f9838(++_0x46adbb);}(_0x5677,0xac));var _0x7567=function(_0x249e96,_0x3ea39d){_0x249e96=_0x249e96-0x0;var _0x17444c=_0x5677[_0x249e96];return _0x17444c;};'use strict';var Sequelize=require(_0x7567('0x0'));var moment=require(_0x7567('0x1'));module[_0x7567('0x2')]={'time':{'type':Sequelize[_0x7567('0x3')]},'callid':{'type':Sequelize[_0x7567('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x7567('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x7567('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x7567('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x7567('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x7567('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x7567('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x7567('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x7567('0x4')],'allowNull':![],'defaultValue':moment()['format'](_0x7567('0x5'))}}; \ No newline at end of file +var _0xeda6=['sequelize','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x10a2c0,_0x4b8bf5){var _0x3c30c1=function(_0xc5284c){while(--_0xc5284c){_0x10a2c0['push'](_0x10a2c0['shift']());}};_0x3c30c1(++_0x4b8bf5);}(_0xeda6,0x136));var _0x6eda=function(_0x43698b,_0x586e8d){_0x43698b=_0x43698b-0x0;var _0x369340=_0xeda6[_0x43698b];return _0x369340;};'use strict';var Sequelize=require(_0x6eda('0x0'));var moment=require('moment');module['exports']={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x6eda('0x1')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x6eda('0x1')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x6eda('0x1')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x6eda('0x1')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x6eda('0x1')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x6eda('0x1')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x6eda('0x1')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x6eda('0x2')],'allowNull':![],'defaultValue':moment()[_0x6eda('0x3')](_0x6eda('0x4'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 4353b5d..55a5660 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 _0xa57f=['include','findAll','rows','show','keys','merge','find','catch','create','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','end','status','json','count','offset','limit','Content-Range','reject','save','update','then','error','name','send','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','VIRTUAL','options'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa57f,0xe6));var _0xfa57=function(_0x24a277,_0x1ccd31){_0x24a277=_0x24a277-0x0;var _0x3bd5a9=_0xa57f[_0x24a277];return _0x3bd5a9;};'use strict';var pdf=require(_0xfa57('0x0'));var emlformat=require(_0xfa57('0x1'));var rimraf=require(_0xfa57('0x2'));var zipdir=require(_0xfa57('0x3'));var jsonpatch=require(_0xfa57('0x4'));var rp=require('request-promise');var moment=require(_0xfa57('0x5'));var BPromise=require(_0xfa57('0x6'));var Mustache=require(_0xfa57('0x7'));var util=require(_0xfa57('0x8'));var path=require(_0xfa57('0x9'));var sox=require(_0xfa57('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xfa57('0xb'));var squel=require(_0xfa57('0xc'));var crypto=require(_0xfa57('0xd'));var jsforce=require(_0xfa57('0xe'));var deskjs=require(_0xfa57('0xf'));var toCsv=require(_0xfa57('0x10'));var querystring=require(_0xfa57('0x11'));var Papa=require(_0xfa57('0x12'));var Redis=require(_0xfa57('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xfa57('0x14'));var as=require(_0xfa57('0x15'));var hardwareService=require(_0xfa57('0x16'));var logger=require(_0xfa57('0x17'))('api');var utils=require(_0xfa57('0x18'));var config=require(_0xfa57('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3a319f,_0x3add10){_0x3add10=_0x3add10||0xcc;return function(_0xc661cb){if(_0xc661cb){return _0x3a319f[_0xfa57('0x1a')](_0x3add10);}return _0x3a319f['status'](_0x3add10)[_0xfa57('0x1b')]();};}function respondWithResult(_0x395f05,_0x14d1a5){_0x14d1a5=_0x14d1a5||0xc8;return function(_0x11a53d){if(_0x11a53d){return _0x395f05[_0xfa57('0x1c')](_0x14d1a5)[_0xfa57('0x1d')](_0x11a53d);}};}function respondWithFilteredResult(_0x3cc607,_0x5c85f1){return function(_0x5d405b){if(_0x5d405b){var _0x4c89f1=_0x5d405b[_0xfa57('0x1e')],_0x4a231e=_0x5c85f1[_0xfa57('0x1f')],_0x2a2a62=_0x5c85f1[_0xfa57('0x1f')]+_0x5c85f1[_0xfa57('0x20')],_0x4aba2b;if(_0x2a2a62>=_0x4c89f1){_0x2a2a62=_0x4c89f1;_0x4aba2b=0xc8;}else{_0x4aba2b=0xce;}_0x3cc607[_0xfa57('0x1c')](_0x4aba2b);return _0x3cc607['set'](_0xfa57('0x21'),_0x4a231e+'-'+_0x2a2a62+'/'+_0x4c89f1)[_0xfa57('0x1d')](_0x5d405b);}return null;};}function patchUpdates(_0x218280){return function(_0x3de7ef){try{jsonpatch['apply'](_0x3de7ef,_0x218280,!![]);}catch(_0x35d868){return BPromise[_0xfa57('0x22')](_0x35d868);}return _0x3de7ef[_0xfa57('0x23')]();};}function saveUpdates(_0x5ac428,_0x42dab6){return function(_0x112e67){if(_0x112e67){return _0x112e67[_0xfa57('0x24')](_0x5ac428)[_0xfa57('0x25')](function(_0x1b03f7){return _0x1b03f7;});}return null;};}function removeEntity(_0x552693,_0x2e131c){return function(_0x117d6a){if(_0x117d6a){return _0x117d6a['destroy']()['then'](function(){_0x552693['status'](0xcc)[_0xfa57('0x1b')]();});}};}function handleEntityNotFound(_0x4e8e6c,_0x7406b6){return function(_0x153c6c){if(!_0x153c6c){_0x4e8e6c[_0xfa57('0x1a')](0x194);}return _0x153c6c;};}function handleError(_0x154509,_0x3f8c42){_0x3f8c42=_0x3f8c42||0x1f4;return function(_0x569a8d){logger[_0xfa57('0x26')](_0x569a8d['stack']);if(_0x569a8d['name']){delete _0x569a8d[_0xfa57('0x27')];}_0x154509[_0xfa57('0x1c')](_0x3f8c42)[_0xfa57('0x28')](_0x569a8d);};}exports[_0xfa57('0x29')]=function(_0xca7688,_0x5b2a81){var _0x4bf720={},_0x1e5a82={},_0x54ce69={'count':0x0,'rows':[]};var _0xd5a77d=_[_0xfa57('0x2a')](db[_0xfa57('0x2b')][_0xfa57('0x2c')],function(_0x4efb54){return{'name':_0x4efb54[_0xfa57('0x2d')],'type':_0x4efb54[_0xfa57('0x2e')]['key']};});_0x1e5a82[_0xfa57('0x2f')]=_[_0xfa57('0x2a')](_0xd5a77d,_0xfa57('0x27'));_0x1e5a82[_0xfa57('0x30')]=_['keys'](_0xca7688['query']);_0x1e5a82['filters']=_[_0xfa57('0x31')](_0x1e5a82[_0xfa57('0x2f')],_0x1e5a82[_0xfa57('0x30')]);_0x4bf720['attributes']=_[_0xfa57('0x31')](_0x1e5a82[_0xfa57('0x2f')],qs[_0xfa57('0x32')](_0xca7688[_0xfa57('0x30')][_0xfa57('0x32')]));_0x4bf720[_0xfa57('0x33')]=_0x4bf720[_0xfa57('0x33')][_0xfa57('0x34')]?_0x4bf720['attributes']:_0x1e5a82['model'];if(!_0xca7688[_0xfa57('0x30')][_0xfa57('0x35')](_0xfa57('0x36'))){_0x4bf720[_0xfa57('0x20')]=qs[_0xfa57('0x20')](_0xca7688['query'][_0xfa57('0x20')]);_0x4bf720[_0xfa57('0x1f')]=qs[_0xfa57('0x1f')](_0xca7688['query'][_0xfa57('0x1f')]);}_0x4bf720['order']=qs['sort'](_0xca7688[_0xfa57('0x30')][_0xfa57('0x37')]);_0x4bf720[_0xfa57('0x38')]=qs[_0xfa57('0x39')](_[_0xfa57('0x3a')](_0xca7688[_0xfa57('0x30')],_0x1e5a82[_0xfa57('0x39')]));if(_0xca7688[_0xfa57('0x30')][_0xfa57('0x3b')]){_0x4bf720['where']=_['merge'](_0x4bf720[_0xfa57('0x38')],{'$or':_['map'](_0xd5a77d,function(_0x313eab){if(_0x313eab[_0xfa57('0x2e')]!==_0xfa57('0x3c')){var _0x27c9b5={};_0x27c9b5[_0x313eab[_0xfa57('0x27')]]={'$like':'%'+_0xca7688['query'][_0xfa57('0x3b')]+'%'};return _0x27c9b5;}})});}_0x4bf720=_['merge']({},_0x4bf720,_0xca7688[_0xfa57('0x3d')]);var _0x481a59={'where':_0x4bf720[_0xfa57('0x38')]};return db[_0xfa57('0x2b')][_0xfa57('0x1e')](_0x481a59)['then'](function(_0x345486){_0x54ce69[_0xfa57('0x1e')]=_0x345486;if(_0xca7688[_0xfa57('0x30')]['includeAll']){_0x4bf720[_0xfa57('0x3e')]=[{'all':!![]}];}return db['VoiceQueuesLog'][_0xfa57('0x3f')](_0x4bf720);})[_0xfa57('0x25')](function(_0x3881e2){_0x54ce69[_0xfa57('0x40')]=_0x3881e2;return _0x54ce69;})[_0xfa57('0x25')](respondWithFilteredResult(_0x5b2a81,_0x4bf720))['catch'](handleError(_0x5b2a81,null));};exports[_0xfa57('0x41')]=function(_0x216271,_0x3d744f){var _0x30490e={'raw':!![],'where':{'id':_0x216271['params']['id']}},_0x585bb7={};_0x585bb7[_0xfa57('0x2f')]=_[_0xfa57('0x42')](db[_0xfa57('0x2b')][_0xfa57('0x2c')]);_0x585bb7[_0xfa57('0x30')]=_[_0xfa57('0x42')](_0x216271[_0xfa57('0x30')]);_0x585bb7[_0xfa57('0x39')]=_[_0xfa57('0x31')](_0x585bb7['model'],_0x585bb7['query']);_0x30490e['attributes']=_[_0xfa57('0x31')](_0x585bb7[_0xfa57('0x2f')],qs[_0xfa57('0x32')](_0x216271[_0xfa57('0x30')][_0xfa57('0x32')]));_0x30490e[_0xfa57('0x33')]=_0x30490e[_0xfa57('0x33')][_0xfa57('0x34')]?_0x30490e[_0xfa57('0x33')]:_0x585bb7[_0xfa57('0x2f')];if(_0x216271[_0xfa57('0x30')]['includeAll']){_0x30490e[_0xfa57('0x3e')]=[{'all':!![]}];}_0x30490e=_[_0xfa57('0x43')]({},_0x30490e,_0x216271[_0xfa57('0x3d')]);return db['VoiceQueuesLog'][_0xfa57('0x44')](_0x30490e)[_0xfa57('0x25')](handleEntityNotFound(_0x3d744f,null))[_0xfa57('0x25')](respondWithResult(_0x3d744f,null))[_0xfa57('0x45')](handleError(_0x3d744f,null));};exports[_0xfa57('0x46')]=function(_0x5ab8b4,_0x26285a){return db[_0xfa57('0x2b')]['create'](_0x5ab8b4[_0xfa57('0x47')],{})[_0xfa57('0x25')](respondWithResult(_0x26285a,0xc9))[_0xfa57('0x45')](handleError(_0x26285a,null));};exports[_0xfa57('0x24')]=function(_0x58a34b,_0x1f9dfb){if(_0x58a34b[_0xfa57('0x47')]['id']){delete _0x58a34b[_0xfa57('0x47')]['id'];}return db['VoiceQueuesLog'][_0xfa57('0x44')]({'where':{'id':_0x58a34b[_0xfa57('0x48')]['id']}})[_0xfa57('0x25')](handleEntityNotFound(_0x1f9dfb,null))['then'](saveUpdates(_0x58a34b[_0xfa57('0x47')],null))[_0xfa57('0x25')](respondWithResult(_0x1f9dfb,null))[_0xfa57('0x45')](handleError(_0x1f9dfb,null));};exports['destroy']=function(_0x1d4b59,_0x19e4ee){return db[_0xfa57('0x2b')][_0xfa57('0x44')]({'where':{'id':_0x1d4b59[_0xfa57('0x48')]['id']}})[_0xfa57('0x25')](handleEntityNotFound(_0x19e4ee,null))[_0xfa57('0x25')](removeEntity(_0x19e4ee,null))[_0xfa57('0x45')](handleError(_0x19e4ee,null));}; \ No newline at end of file +var _0xd6d9=['count','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','end','stack','name','send','index','map','VoiceQueuesLog','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','where','pick','merge','filter','options','include','findAll','rows','show','params','find','create','body','catch','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xd6d9,0xf6));var _0x9d6d=function(_0x408165,_0x5bb6bb){_0x408165=_0x408165-0x0;var _0x194dda=_0xd6d9[_0x408165];return _0x194dda;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9d6d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9d6d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9d6d('0x2'));var moment=require(_0x9d6d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9d6d('0x4'));var util=require(_0x9d6d('0x5'));var path=require(_0x9d6d('0x6'));var sox=require(_0x9d6d('0x7'));var csv=require(_0x9d6d('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9d6d('0x9'));var squel=require(_0x9d6d('0xa'));var crypto=require('crypto');var jsforce=require(_0x9d6d('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x9d6d('0x8'));var querystring=require(_0x9d6d('0xc'));var Papa=require(_0x9d6d('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9d6d('0xe'));var hardwareService=require(_0x9d6d('0xf'));var logger=require('../../config/logger')(_0x9d6d('0x10'));var utils=require(_0x9d6d('0x11'));var config=require(_0x9d6d('0x12'));var db=require(_0x9d6d('0x13'))['db'];function respondWithStatusCode(_0x7d1254,_0x219b76){_0x219b76=_0x219b76||0xcc;return function(_0x3ba8ff){if(_0x3ba8ff){return _0x7d1254[_0x9d6d('0x14')](_0x219b76);}return _0x7d1254[_0x9d6d('0x15')](_0x219b76)['end']();};}function respondWithResult(_0x16c9a6,_0x5101d0){_0x5101d0=_0x5101d0||0xc8;return function(_0xbc3191){if(_0xbc3191){return _0x16c9a6[_0x9d6d('0x15')](_0x5101d0)['json'](_0xbc3191);}};}function respondWithFilteredResult(_0x4e55fe,_0xe111b1){return function(_0x509b3d){if(_0x509b3d){var _0x5bffe2=_0x509b3d[_0x9d6d('0x16')],_0x1a7520=_0xe111b1[_0x9d6d('0x17')],_0x11ede0=_0xe111b1[_0x9d6d('0x17')]+_0xe111b1[_0x9d6d('0x18')],_0x71c398;if(_0x11ede0>=_0x5bffe2){_0x11ede0=_0x5bffe2;_0x71c398=0xc8;}else{_0x71c398=0xce;}_0x4e55fe['status'](_0x71c398);return _0x4e55fe[_0x9d6d('0x19')](_0x9d6d('0x1a'),_0x1a7520+'-'+_0x11ede0+'/'+_0x5bffe2)[_0x9d6d('0x1b')](_0x509b3d);}return null;};}function patchUpdates(_0x53c702){return function(_0x59e061){try{jsonpatch['apply'](_0x59e061,_0x53c702,!![]);}catch(_0x2d318e){return BPromise[_0x9d6d('0x1c')](_0x2d318e);}return _0x59e061[_0x9d6d('0x1d')]();};}function saveUpdates(_0x56a6ff,_0x2b525a){return function(_0x2ce1ba){if(_0x2ce1ba){return _0x2ce1ba[_0x9d6d('0x1e')](_0x56a6ff)[_0x9d6d('0x1f')](function(_0x26d875){return _0x26d875;});}return null;};}function removeEntity(_0x8947d1,_0x1677dd){return function(_0x5818a2){if(_0x5818a2){return _0x5818a2[_0x9d6d('0x20')]()[_0x9d6d('0x1f')](function(){_0x8947d1['status'](0xcc)[_0x9d6d('0x21')]();});}};}function handleEntityNotFound(_0x2ff7d1,_0x1071e6){return function(_0x3d5881){if(!_0x3d5881){_0x2ff7d1[_0x9d6d('0x14')](0x194);}return _0x3d5881;};}function handleError(_0x2880a0,_0x32dcfc){_0x32dcfc=_0x32dcfc||0x1f4;return function(_0x8fb586){logger['error'](_0x8fb586[_0x9d6d('0x22')]);if(_0x8fb586['name']){delete _0x8fb586[_0x9d6d('0x23')];}_0x2880a0[_0x9d6d('0x15')](_0x32dcfc)[_0x9d6d('0x24')](_0x8fb586);};}exports[_0x9d6d('0x25')]=function(_0x12fdef,_0x53ec01){var _0x44424e={},_0x533608={},_0x345012={'count':0x0,'rows':[]};var _0x3b032e=_[_0x9d6d('0x26')](db[_0x9d6d('0x27')][_0x9d6d('0x28')],function(_0x522d04){return{'name':_0x522d04['fieldName'],'type':_0x522d04[_0x9d6d('0x29')][_0x9d6d('0x2a')]};});_0x533608['model']=_['map'](_0x3b032e,_0x9d6d('0x23'));_0x533608[_0x9d6d('0x2b')]=_[_0x9d6d('0x2c')](_0x12fdef[_0x9d6d('0x2b')]);_0x533608[_0x9d6d('0x2d')]=_[_0x9d6d('0x2e')](_0x533608[_0x9d6d('0x2f')],_0x533608[_0x9d6d('0x2b')]);_0x44424e[_0x9d6d('0x30')]=_[_0x9d6d('0x2e')](_0x533608['model'],qs['fields'](_0x12fdef[_0x9d6d('0x2b')][_0x9d6d('0x31')]));_0x44424e[_0x9d6d('0x30')]=_0x44424e[_0x9d6d('0x30')][_0x9d6d('0x32')]?_0x44424e[_0x9d6d('0x30')]:_0x533608[_0x9d6d('0x2f')];if(!_0x12fdef[_0x9d6d('0x2b')][_0x9d6d('0x33')](_0x9d6d('0x34'))){_0x44424e['limit']=qs['limit'](_0x12fdef[_0x9d6d('0x2b')]['limit']);_0x44424e[_0x9d6d('0x17')]=qs['offset'](_0x12fdef[_0x9d6d('0x2b')][_0x9d6d('0x17')]);}_0x44424e['order']=qs['sort'](_0x12fdef[_0x9d6d('0x2b')]['sort']);_0x44424e[_0x9d6d('0x35')]=qs[_0x9d6d('0x2d')](_[_0x9d6d('0x36')](_0x12fdef[_0x9d6d('0x2b')],_0x533608[_0x9d6d('0x2d')]));if(_0x12fdef['query']['filter']){_0x44424e[_0x9d6d('0x35')]=_[_0x9d6d('0x37')](_0x44424e['where'],{'$or':_[_0x9d6d('0x26')](_0x3b032e,function(_0x3218aa){if(_0x3218aa['type']!=='VIRTUAL'){var _0x5ed009={};_0x5ed009[_0x3218aa[_0x9d6d('0x23')]]={'$like':'%'+_0x12fdef[_0x9d6d('0x2b')][_0x9d6d('0x38')]+'%'};return _0x5ed009;}})});}_0x44424e=_['merge']({},_0x44424e,_0x12fdef[_0x9d6d('0x39')]);var _0x1582c5={'where':_0x44424e[_0x9d6d('0x35')]};return db['VoiceQueuesLog'][_0x9d6d('0x16')](_0x1582c5)[_0x9d6d('0x1f')](function(_0x1baae5){_0x345012[_0x9d6d('0x16')]=_0x1baae5;if(_0x12fdef[_0x9d6d('0x2b')]['includeAll']){_0x44424e[_0x9d6d('0x3a')]=[{'all':!![]}];}return db[_0x9d6d('0x27')][_0x9d6d('0x3b')](_0x44424e);})[_0x9d6d('0x1f')](function(_0x3edbf9){_0x345012[_0x9d6d('0x3c')]=_0x3edbf9;return _0x345012;})[_0x9d6d('0x1f')](respondWithFilteredResult(_0x53ec01,_0x44424e))['catch'](handleError(_0x53ec01,null));};exports[_0x9d6d('0x3d')]=function(_0x2ab442,_0x1d060c){var _0x2b5058={'raw':!![],'where':{'id':_0x2ab442[_0x9d6d('0x3e')]['id']}},_0x49dda5={};_0x49dda5['model']=_['keys'](db[_0x9d6d('0x27')]['rawAttributes']);_0x49dda5[_0x9d6d('0x2b')]=_[_0x9d6d('0x2c')](_0x2ab442[_0x9d6d('0x2b')]);_0x49dda5[_0x9d6d('0x2d')]=_['intersection'](_0x49dda5['model'],_0x49dda5[_0x9d6d('0x2b')]);_0x2b5058[_0x9d6d('0x30')]=_['intersection'](_0x49dda5['model'],qs[_0x9d6d('0x31')](_0x2ab442[_0x9d6d('0x2b')][_0x9d6d('0x31')]));_0x2b5058[_0x9d6d('0x30')]=_0x2b5058[_0x9d6d('0x30')]['length']?_0x2b5058[_0x9d6d('0x30')]:_0x49dda5[_0x9d6d('0x2f')];if(_0x2ab442['query']['includeAll']){_0x2b5058['include']=[{'all':!![]}];}_0x2b5058=_[_0x9d6d('0x37')]({},_0x2b5058,_0x2ab442[_0x9d6d('0x39')]);return db['VoiceQueuesLog'][_0x9d6d('0x3f')](_0x2b5058)[_0x9d6d('0x1f')](handleEntityNotFound(_0x1d060c,null))[_0x9d6d('0x1f')](respondWithResult(_0x1d060c,null))['catch'](handleError(_0x1d060c,null));};exports[_0x9d6d('0x40')]=function(_0x11efc1,_0x29146b){return db['VoiceQueuesLog'][_0x9d6d('0x40')](_0x11efc1[_0x9d6d('0x41')],{})[_0x9d6d('0x1f')](respondWithResult(_0x29146b,0xc9))[_0x9d6d('0x42')](handleError(_0x29146b,null));};exports[_0x9d6d('0x1e')]=function(_0x575679,_0x5d7b84){if(_0x575679[_0x9d6d('0x41')]['id']){delete _0x575679[_0x9d6d('0x41')]['id'];}return db[_0x9d6d('0x27')][_0x9d6d('0x3f')]({'where':{'id':_0x575679[_0x9d6d('0x3e')]['id']}})['then'](handleEntityNotFound(_0x5d7b84,null))[_0x9d6d('0x1f')](saveUpdates(_0x575679[_0x9d6d('0x41')],null))[_0x9d6d('0x1f')](respondWithResult(_0x5d7b84,null))[_0x9d6d('0x42')](handleError(_0x5d7b84,null));};exports[_0x9d6d('0x20')]=function(_0x2d63e7,_0x3686e4){return db[_0x9d6d('0x27')][_0x9d6d('0x3f')]({'where':{'id':_0x2d63e7[_0x9d6d('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3686e4,null))[_0x9d6d('0x1f')](removeEntity(_0x3686e4,null))[_0x9d6d('0x42')](handleError(_0x3686e4,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 7de3aa6..2491568 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 _0xaff8=['dtm','../../config/logger','moment','bluebird','../../config/environment','exports','VoiceQueuesLog','voice_queues_log','event_dtm','event'];(function(_0x2a99ea,_0x1bfb13){var _0x5887ae=function(_0x55dfc2){while(--_0x55dfc2){_0x2a99ea['push'](_0x2a99ea['shift']());}};_0x5887ae(++_0x1bfb13);}(_0xaff8,0x97));var _0x8aff=function(_0x5d90b8,_0x528b3a){_0x5d90b8=_0x5d90b8-0x0;var _0x5712b3=_0xaff8[_0x5d90b8];return _0x5712b3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8aff('0x0'))('api');var moment=require(_0x8aff('0x1'));var BPromise=require(_0x8aff('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8aff('0x3'));var attributes=require('./voiceQueuesLog.attributes');module[_0x8aff('0x4')]=function(_0x28fa54,_0x46eeac){return _0x28fa54['define'](_0x8aff('0x5'),attributes,{'tableName':_0x8aff('0x6'),'paranoid':![],'indexes':[{'name':_0x8aff('0x7'),'fields':[_0x8aff('0x8'),_0x8aff('0x9')]}],'timestamps':![]});}; \ No newline at end of file +var _0x259d=['define','voice_queues_log','event_dtm','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceQueuesLog.attributes'];(function(_0x55a00d,_0x55c33b){var _0x558e78=function(_0x153d9){while(--_0x153d9){_0x55a00d['push'](_0x55a00d['shift']());}};_0x558e78(++_0x55c33b);}(_0x259d,0x163));var _0xd259=function(_0x474cd0,_0x57e9f0){_0x474cd0=_0x474cd0-0x0;var _0x4ec7e6=_0x259d[_0x474cd0];return _0x4ec7e6;};'use strict';var _=require(_0xd259('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd259('0x1'));var moment=require(_0xd259('0x2'));var BPromise=require(_0xd259('0x3'));var rp=require(_0xd259('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd259('0x5'));var config=require(_0xd259('0x6'));var attributes=require(_0xd259('0x7'));module['exports']=function(_0xa35536,_0x24c7ac){return _0xa35536[_0xd259('0x8')]('VoiceQueuesLog',attributes,{'tableName':_0xd259('0x9'),'paranoid':![],'indexes':[{'name':_0xd259('0xa'),'fields':['event','dtm']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index dd979aa..417403f 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 _0x34b7=['stringify','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s'];(function(_0x58bcb1,_0x223008){var _0x48fdb6=function(_0x146aa2){while(--_0x146aa2){_0x58bcb1['push'](_0x58bcb1['shift']());}};_0x48fdb6(++_0x223008);}(_0x34b7,0x196));var _0x734b=function(_0xa25342,_0x24522b){_0xa25342=_0xa25342-0x0;var _0x52be43=_0x34b7[_0xa25342];return _0x52be43;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x734b('0x0'));var BPromise=require(_0x734b('0x1'));var rs=require(_0x734b('0x2'));var fs=require('fs');var Redis=require(_0x734b('0x3'));var db=require(_0x734b('0x4'))['db'];var utils=require(_0x734b('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x734b('0x6'));var jayson=require(_0x734b('0x7'));var client=jayson[_0x734b('0x8')][_0x734b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x28918a,_0x35d685,_0x58e2f1){return new BPromise(function(_0x1eb803,_0x2e7932){return client['request'](_0x28918a,_0x58e2f1)['then'](function(_0x5f4b3a){logger[_0x734b('0xa')]('VoiceQueuesLog,\x20%s,\x20%s',_0x35d685,_0x734b('0xb'));logger[_0x734b('0xc')](_0x734b('0xd'),_0x35d685,_0x734b('0xb'),JSON[_0x734b('0xe')](_0x5f4b3a));if(_0x5f4b3a[_0x734b('0xf')]){if(_0x5f4b3a[_0x734b('0xf')][_0x734b('0x10')]===0x1f4){logger[_0x734b('0xf')](_0x734b('0x11'),_0x35d685,_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);return _0x2e7932(_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);}logger['error'](_0x734b('0x11'),_0x35d685,_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);return _0x1eb803(_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);}else{logger[_0x734b('0xa')](_0x734b('0x11'),_0x35d685,_0x734b('0xb'));_0x1eb803(_0x5f4b3a[_0x734b('0x13')][_0x734b('0x12')]);}})[_0x734b('0x14')](function(_0x4d2d23){logger[_0x734b('0xf')](_0x734b('0x11'),_0x35d685,_0x4d2d23);_0x2e7932(_0x4d2d23);});});} \ No newline at end of file +var _0x3c81=['VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x27cef9,_0x1f672e){var _0x1f3b73=function(_0x19cdd2){while(--_0x19cdd2){_0x27cef9['push'](_0x27cef9['shift']());}};_0x1f3b73(++_0x1f672e);}(_0x3c81,0x102));var _0x13c8=function(_0x3f57e2,_0x2911c5){_0x3f57e2=_0x3f57e2-0x0;var _0x3cdf38=_0x3c81[_0x3f57e2];return _0x3cdf38;};'use strict';var _=require(_0x13c8('0x0'));var util=require(_0x13c8('0x1'));var moment=require('moment');var BPromise=require(_0x13c8('0x2'));var rs=require(_0x13c8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x13c8('0x4'));var config=require(_0x13c8('0x5'));var jayson=require(_0x13c8('0x6'));var client=jayson[_0x13c8('0x7')][_0x13c8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f0bd2,_0x445b69,_0x4f7bcc){return new BPromise(function(_0x17c228,_0x4905c3){return client[_0x13c8('0x9')](_0x3f0bd2,_0x4f7bcc)[_0x13c8('0xa')](function(_0x189ce6){logger[_0x13c8('0xb')](_0x13c8('0xc'),_0x445b69,_0x13c8('0xd'));logger[_0x13c8('0xe')](_0x13c8('0xf'),_0x445b69,_0x13c8('0xd'),JSON[_0x13c8('0x10')](_0x189ce6));if(_0x189ce6[_0x13c8('0x11')]){if(_0x189ce6[_0x13c8('0x11')][_0x13c8('0x12')]===0x1f4){logger[_0x13c8('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0x445b69,_0x189ce6[_0x13c8('0x11')][_0x13c8('0x13')]);return _0x4905c3(_0x189ce6[_0x13c8('0x11')][_0x13c8('0x13')]);}logger['error'](_0x13c8('0xc'),_0x445b69,_0x189ce6['error']['message']);return _0x17c228(_0x189ce6['error'][_0x13c8('0x13')]);}else{logger['info'](_0x13c8('0xc'),_0x445b69,_0x13c8('0xd'));_0x17c228(_0x189ce6[_0x13c8('0x14')][_0x13c8('0x13')]);}})['catch'](function(_0x13a9e1){logger[_0x13c8('0x11')](_0x13c8('0xc'),_0x445b69,_0x13a9e1);_0x4905c3(_0x13a9e1);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 23ae717..ee785ee 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 _0x9318=['describe','show','/:id/download','download','downloads','post','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe'];(function(_0x2011d1,_0x531f0f){var _0x4490a4=function(_0x4ff74e){while(--_0x4ff74e){_0x2011d1['push'](_0x2011d1['shift']());}};_0x4490a4(++_0x531f0f);}(_0x9318,0xda));var _0x8931=function(_0x746906,_0x350b60){_0x746906=_0x746906-0x0;var _0x107e62=_0x9318[_0x746906];return _0x107e62;};'use strict';var multer=require(_0x8931('0x0'));var util=require('util');var path=require(_0x8931('0x1'));var timeout=require(_0x8931('0x2'));var express=require(_0x8931('0x3'));var router=express[_0x8931('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x8931('0x5'));var config=require(_0x8931('0x6'));var controller=require(_0x8931('0x7'));router[_0x8931('0x8')]('/',auth[_0x8931('0x9')](),controller[_0x8931('0xa')]);router[_0x8931('0x8')](_0x8931('0xb'),auth[_0x8931('0x9')](),controller[_0x8931('0xc')]);router[_0x8931('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x8931('0xd')]);router[_0x8931('0x8')](_0x8931('0xe'),auth['isAuthenticated'](),controller[_0x8931('0xf')]);router['get']('/:id/downloads',controller[_0x8931('0x10')]);router[_0x8931('0x11')]('/',auth[_0x8931('0x9')](),controller['create']);router['put'](_0x8931('0x12'),auth[_0x8931('0x9')](),controller[_0x8931('0x13')]);router[_0x8931('0x14')]('/:id',auth[_0x8931('0x9')](),controller[_0x8931('0x15')]);module[_0x8931('0x16')]=router; \ No newline at end of file +var _0x55af=['update','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','show','/:id/download','downloads','post','create','put'];(function(_0x1a080d,_0x37142d){var _0x33a348=function(_0x14d535){while(--_0x14d535){_0x1a080d['push'](_0x1a080d['shift']());}};_0x33a348(++_0x37142d);}(_0x55af,0x190));var _0xf55a=function(_0x2cb02c,_0x15a6af){_0x2cb02c=_0x2cb02c-0x0;var _0x438f44=_0x55af[_0x2cb02c];return _0x438f44;};'use strict';var multer=require(_0xf55a('0x0'));var util=require(_0xf55a('0x1'));var path=require(_0xf55a('0x2'));var timeout=require('connect-timeout');var express=require(_0xf55a('0x3'));var router=express['Router']();var auth=require(_0xf55a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf55a('0x5'));var controller=require(_0xf55a('0x6'));router[_0xf55a('0x7')]('/',auth[_0xf55a('0x8')](),controller[_0xf55a('0x9')]);router[_0xf55a('0x7')](_0xf55a('0xa'),auth['isAuthenticated'](),controller[_0xf55a('0xb')]);router['get']('/:id',auth[_0xf55a('0x8')](),controller[_0xf55a('0xc')]);router[_0xf55a('0x7')](_0xf55a('0xd'),auth[_0xf55a('0x8')](),controller['download']);router[_0xf55a('0x7')]('/:id/downloads',controller[_0xf55a('0xe')]);router[_0xf55a('0xf')]('/',auth[_0xf55a('0x8')](),controller[_0xf55a('0x10')]);router[_0xf55a('0x11')]('/:id',auth[_0xf55a('0x8')](),controller[_0xf55a('0x12')]);router[_0xf55a('0x13')]('/:id',auth[_0xf55a('0x8')](),controller[_0xf55a('0x14')]);module[_0xf55a('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 94b467f..0b2496c 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 _0x8b56=['moment','path','exports','value','extname','getDataValue','STRING','setDataValue','DATE','createdAt','format','MM-DD-YYYY\x20HH:mm','toString','updatedAt','sequelize'];(function(_0x448893,_0x1fe50e){var _0x5bbf8c=function(_0x1e59ff){while(--_0x1e59ff){_0x448893['push'](_0x448893['shift']());}};_0x5bbf8c(++_0x1fe50e);}(_0x8b56,0xb3));var _0x68b5=function(_0x4bfa7f,_0x567fbd){_0x4bfa7f=_0x4bfa7f-0x0;var _0x3a0e58=_0x8b56[_0x4bfa7f];return _0x3a0e58;};'use strict';var Sequelize=require(_0x68b5('0x0'));var moment=require(_0x68b5('0x1'));var path=require(_0x68b5('0x2'));module[_0x68b5('0x3')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0x68b5('0x4'))?path[_0x68b5('0x5')](this[_0x68b5('0x6')](_0x68b5('0x4'))):undefined;}},'uniqueid':{'type':Sequelize[_0x68b5('0x7')]},'channel':{'type':Sequelize['STRING'],'set':function(_0x5a8b62){if(_0x5a8b62){this[_0x68b5('0x8')]('channel',_0x5a8b62);this['setDataValue']('membername',_0x5a8b62['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x68b5('0x7')]},'calleridname':{'type':Sequelize[_0x68b5('0x7')]},'connectedlinenum':{'type':Sequelize[_0x68b5('0x7')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x68b5('0x7')]},'context':{'type':Sequelize[_0x68b5('0x7')]},'exten':{'type':Sequelize[_0x68b5('0x7')]},'value':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0x68b5('0x7')]},'userDisposition':{'type':Sequelize[_0x68b5('0x7')]},'createdAt':{'type':Sequelize[_0x68b5('0x9')],'get':function(){return moment(this[_0x68b5('0x6')](_0x68b5('0xa')))[_0x68b5('0xb')](_0x68b5('0xc'))[_0x68b5('0xd')]();}},'updatedAt':{'type':Sequelize[_0x68b5('0x9')],'get':function(){return moment(this[_0x68b5('0x6')](_0x68b5('0xe')))[_0x68b5('0xb')](_0x68b5('0xc'))[_0x68b5('0xd')]();}}}; \ No newline at end of file +var _0xa22c=['MM-DD-YYYY\x20HH:mm','toString','updatedAt','format','sequelize','moment','path','exports','VIRTUAL','getDataValue','extname','STRING','setDataValue','channel','membername','split','INTEGER','DATE','createdAt'];(function(_0x3cb6dc,_0x120dd3){var _0x47ec89=function(_0x55150a){while(--_0x55150a){_0x3cb6dc['push'](_0x3cb6dc['shift']());}};_0x47ec89(++_0x120dd3);}(_0xa22c,0x193));var _0xca22=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa22c[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xca22('0x0'));var moment=require(_0xca22('0x1'));var path=require(_0xca22('0x2'));module[_0xca22('0x3')]={'format':{'type':Sequelize[_0xca22('0x4')],'get':function(){return this[_0xca22('0x5')]('value')?path[_0xca22('0x6')](this[_0xca22('0x5')]('value')):undefined;}},'uniqueid':{'type':Sequelize[_0xca22('0x7')]},'channel':{'type':Sequelize[_0xca22('0x7')],'set':function(_0x28977c){if(_0x28977c){this[_0xca22('0x8')](_0xca22('0x9'),_0x28977c);this[_0xca22('0x8')](_0xca22('0xa'),_0x28977c[_0xca22('0xb')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0xca22('0x7')]},'calleridnum':{'type':Sequelize[_0xca22('0x7')]},'calleridname':{'type':Sequelize[_0xca22('0x7')]},'connectedlinenum':{'type':Sequelize[_0xca22('0x7')]},'connectedlinename':{'type':Sequelize[_0xca22('0x7')]},'accountcode':{'type':Sequelize[_0xca22('0x7')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xca22('0x7')]},'value':{'type':Sequelize[_0xca22('0x7')]},'type':{'type':Sequelize[_0xca22('0x7')]},'rating':{'type':Sequelize[_0xca22('0xc')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0xca22('0x7')]},'userDisposition':{'type':Sequelize[_0xca22('0x7')]},'createdAt':{'type':Sequelize[_0xca22('0xd')],'get':function(){return moment(this['getDataValue'](_0xca22('0xe')))['format'](_0xca22('0xf'))[_0xca22('0x10')]();}},'updatedAt':{'type':Sequelize[_0xca22('0xd')],'get':function(){return moment(this[_0xca22('0x5')](_0xca22('0x11')))[_0xca22('0x12')](_0xca22('0xf'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index 035dbcf..e430fa2 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 _0x4024=['show','params','find','create','body','describe','uniqueid','value','%s.cypher','existsSync','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','download','extname','unlink','send','Not\x20found','downloads','../../components/encryptor','sequelize','MD5','col','token','push','decryptFile','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','error','html-pdf','eml-format','zip-dir','fast-json-patch','moment','mustache','util','to-csv','ejs','lodash','crypto','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','apply','save','update','then','destroy','stack','name','index','map','rawAttributes','fieldName','type','key','differenceBy','format','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','VoiceRecording','includeAll','include','findAll','rows','catch'];(function(_0x1a9c3f,_0x4cc5d2){var _0x1184f4=function(_0x2d8455){while(--_0x2d8455){_0x1a9c3f['push'](_0x1a9c3f['shift']());}};_0x1184f4(++_0x4cc5d2);}(_0x4024,0x89));var _0x4402=function(_0x1413c4,_0x47f820){_0x1413c4=_0x1413c4-0x0;var _0x1edec3=_0x4024[_0x1413c4];return _0x1edec3;};'use strict';var pdf=require(_0x4402('0x0'));var emlformat=require(_0x4402('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4402('0x2'));var jsonpatch=require(_0x4402('0x3'));var rp=require('request-promise');var moment=require(_0x4402('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4402('0x5'));var util=require(_0x4402('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x4402('0x7'));var ejs=require(_0x4402('0x8'));var fs=require('fs');var _=require(_0x4402('0x9'));var squel=require('squel');var crypto=require(_0x4402('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4402('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4402('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x4402('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4402('0xd'));var logger=require('../../config/logger')(_0x4402('0xe'));var utils=require(_0x4402('0xf'));var config=require('../../config/environment');var db=require(_0x4402('0x10'))['db'];function respondWithStatusCode(_0x302c4d,_0xa819e9){_0xa819e9=_0xa819e9||0xcc;return function(_0x4c9032){if(_0x4c9032){return _0x302c4d[_0x4402('0x11')](_0xa819e9);}return _0x302c4d[_0x4402('0x12')](_0xa819e9)[_0x4402('0x13')]();};}function respondWithResult(_0x19d2f4,_0x248ad9){_0x248ad9=_0x248ad9||0xc8;return function(_0x31710c){if(_0x31710c){return _0x19d2f4[_0x4402('0x12')](_0x248ad9)[_0x4402('0x14')](_0x31710c);}};}function respondWithFilteredResult(_0x295ac5,_0x263a57){return function(_0x375166){if(_0x375166){var _0xc03f65=_0x375166[_0x4402('0x15')],_0x2a2ce8=_0x263a57[_0x4402('0x16')],_0x19fe7b=_0x263a57[_0x4402('0x16')]+_0x263a57[_0x4402('0x17')],_0xfd9853;if(_0x19fe7b>=_0xc03f65){_0x19fe7b=_0xc03f65;_0xfd9853=0xc8;}else{_0xfd9853=0xce;}_0x295ac5[_0x4402('0x12')](_0xfd9853);return _0x295ac5['set']('Content-Range',_0x2a2ce8+'-'+_0x19fe7b+'/'+_0xc03f65)[_0x4402('0x14')](_0x375166);}return null;};}function patchUpdates(_0x2a7afc){return function(_0x5681c5){try{jsonpatch[_0x4402('0x18')](_0x5681c5,_0x2a7afc,!![]);}catch(_0x192855){return BPromise['reject'](_0x192855);}return _0x5681c5[_0x4402('0x19')]();};}function saveUpdates(_0x4e0340,_0x55cc8c){return function(_0x1b9599){if(_0x1b9599){return _0x1b9599[_0x4402('0x1a')](_0x4e0340)[_0x4402('0x1b')](function(_0x49bc21){return _0x49bc21;});}return null;};}function removeEntity(_0x42509b,_0x57a25e){return function(_0x47ab54){if(_0x47ab54){return _0x47ab54[_0x4402('0x1c')]()[_0x4402('0x1b')](function(){_0x42509b[_0x4402('0x12')](0xcc)[_0x4402('0x13')]();});}};}function handleEntityNotFound(_0x258d10,_0x2e6fee){return function(_0x289a3e){if(!_0x289a3e){_0x258d10[_0x4402('0x11')](0x194);}return _0x289a3e;};}function handleError(_0x24a9b8,_0x4d6846){_0x4d6846=_0x4d6846||0x1f4;return function(_0x1409a9){logger['error'](_0x1409a9[_0x4402('0x1d')]);if(_0x1409a9[_0x4402('0x1e')]){delete _0x1409a9[_0x4402('0x1e')];}_0x24a9b8[_0x4402('0x12')](_0x4d6846)['send'](_0x1409a9);};}exports[_0x4402('0x1f')]=function(_0x4e9cb5,_0x59d52f){var _0x1be54d={},_0x395e49={},_0x327d60={'count':0x0,'rows':[]};var _0xabf61b=_[_0x4402('0x20')](db['VoiceRecording'][_0x4402('0x21')],function(_0x52e625){return{'name':_0x52e625[_0x4402('0x22')],'type':_0x52e625[_0x4402('0x23')][_0x4402('0x24')]};});_0x395e49['model']=_[_0x4402('0x25')](_[_0x4402('0x20')](_0xabf61b,_0x4402('0x1e')),[_0x4402('0x26')]);_0x395e49[_0x4402('0x27')]=_[_0x4402('0x28')](_0x4e9cb5[_0x4402('0x27')]);_0x395e49[_0x4402('0x29')]=_[_0x4402('0x2a')](_0x395e49[_0x4402('0x2b')],_0x395e49[_0x4402('0x27')]);_0x1be54d['attributes']=_[_0x4402('0x2a')](_0x395e49['model'],qs[_0x4402('0x2c')](_0x4e9cb5['query'][_0x4402('0x2c')]));_0x1be54d[_0x4402('0x2d')]=_0x1be54d[_0x4402('0x2d')][_0x4402('0x2e')]?_0x1be54d[_0x4402('0x2d')]:_0x395e49['model'];if(!_0x4e9cb5[_0x4402('0x27')][_0x4402('0x2f')](_0x4402('0x30'))){_0x1be54d['limit']=qs[_0x4402('0x17')](_0x4e9cb5[_0x4402('0x27')]['limit']);_0x1be54d[_0x4402('0x16')]=qs[_0x4402('0x16')](_0x4e9cb5[_0x4402('0x27')][_0x4402('0x16')]);}_0x1be54d[_0x4402('0x31')]=qs[_0x4402('0x32')](_0x4e9cb5[_0x4402('0x27')][_0x4402('0x32')]);_0x1be54d[_0x4402('0x33')]=qs['filters'](_[_0x4402('0x34')](_0x4e9cb5[_0x4402('0x27')],_0x395e49[_0x4402('0x29')]));if(_0x4e9cb5['query'][_0x4402('0x35')]){_0x1be54d[_0x4402('0x33')]=_['merge'](_0x1be54d['where'],{'$or':_[_0x4402('0x20')](_0xabf61b,function(_0x5b7c2e){if(_0x5b7c2e[_0x4402('0x23')]!==_0x4402('0x36')){var _0x5569a2={};_0x5569a2[_0x5b7c2e['name']]={'$like':'%'+_0x4e9cb5['query'][_0x4402('0x35')]+'%'};return _0x5569a2;}})});}_0x1be54d=_[_0x4402('0x37')]({},_0x1be54d,_0x4e9cb5[_0x4402('0x38')]);var _0x3fd8ce={'where':_0x1be54d['where']};return db[_0x4402('0x39')][_0x4402('0x15')](_0x3fd8ce)[_0x4402('0x1b')](function(_0x57843d){_0x327d60[_0x4402('0x15')]=_0x57843d;if(_0x4e9cb5['query'][_0x4402('0x3a')]){_0x1be54d[_0x4402('0x3b')]=[{'all':!![]}];}return db['VoiceRecording'][_0x4402('0x3c')](_0x1be54d);})['then'](function(_0x423628){_0x327d60[_0x4402('0x3d')]=_0x423628;return _0x327d60;})['then'](respondWithFilteredResult(_0x59d52f,_0x1be54d))[_0x4402('0x3e')](handleError(_0x59d52f,null));};exports[_0x4402('0x3f')]=function(_0x250f09,_0x23c43a){var _0x54e1b7={'raw':![],'where':{'id':_0x250f09[_0x4402('0x40')]['id']}},_0x540440={};_0x540440['model']=_[_0x4402('0x28')](db[_0x4402('0x39')][_0x4402('0x21')]);_0x540440[_0x4402('0x27')]=_[_0x4402('0x28')](_0x250f09[_0x4402('0x27')]);_0x540440[_0x4402('0x29')]=_[_0x4402('0x2a')](_0x540440[_0x4402('0x2b')],_0x540440[_0x4402('0x27')]);_0x54e1b7['attributes']=_[_0x4402('0x2a')](_0x540440[_0x4402('0x2b')],qs['fields'](_0x250f09[_0x4402('0x27')][_0x4402('0x2c')]));_0x54e1b7['attributes']=_0x54e1b7[_0x4402('0x2d')][_0x4402('0x2e')]?_0x54e1b7[_0x4402('0x2d')]:_0x540440[_0x4402('0x2b')];if(_0x250f09[_0x4402('0x27')]['includeAll']){_0x54e1b7[_0x4402('0x3b')]=[{'all':!![]}];}_0x54e1b7=_[_0x4402('0x37')]({},_0x54e1b7,_0x250f09[_0x4402('0x38')]);return db[_0x4402('0x39')][_0x4402('0x41')](_0x54e1b7)[_0x4402('0x1b')](handleEntityNotFound(_0x23c43a,null))[_0x4402('0x1b')](respondWithResult(_0x23c43a,null))[_0x4402('0x3e')](handleError(_0x23c43a,null));};exports[_0x4402('0x42')]=function(_0x100489,_0x22b463){return db['VoiceRecording'][_0x4402('0x42')](_0x100489['body'],{})[_0x4402('0x1b')](respondWithResult(_0x22b463,0xc9))[_0x4402('0x3e')](handleError(_0x22b463,null));};exports['update']=function(_0x82f63a,_0x3f9973){if(_0x82f63a[_0x4402('0x43')]['id']){delete _0x82f63a[_0x4402('0x43')]['id'];}return db[_0x4402('0x39')][_0x4402('0x41')]({'where':{'id':_0x82f63a['params']['id']}})[_0x4402('0x1b')](handleEntityNotFound(_0x3f9973,null))[_0x4402('0x1b')](saveUpdates(_0x82f63a[_0x4402('0x43')],null))[_0x4402('0x1b')](respondWithResult(_0x3f9973,null))[_0x4402('0x3e')](handleError(_0x3f9973,null));};exports[_0x4402('0x44')]=function(_0x43cfbd,_0x2e3934){return db[_0x4402('0x39')]['describe']()['then'](respondWithResult(_0x2e3934,null))['catch'](handleError(_0x2e3934,null));};exports['download']=function(_0x257010,_0x29e67b,_0x3876a9){var _0x3fe6b4=require('../../components/encryptor');var _0x169bb2=![];var _0x12d6de={};if(_0x257010[_0x4402('0x27')][_0x4402('0x23')]&&_0x257010[_0x4402('0x27')][_0x4402('0x23')]===_0x4402('0x45')){_0x12d6de['uniqueid']=_0x257010[_0x4402('0x40')]['id'];}else{_0x12d6de['id']=_0x257010[_0x4402('0x40')]['id'];}return db[_0x4402('0x39')][_0x4402('0x41')]({'where':_0x12d6de,'attributes':['id',_0x4402('0x46')],'raw':!![]})[_0x4402('0x1b')](handleEntityNotFound(_0x29e67b,null))['then'](function(_0xe8a8e9){if(_0xe8a8e9){var _0x642ab4=_0xe8a8e9[_0x4402('0x46')];var _0x295c9b=util[_0x4402('0x26')](_0x4402('0x47'),_0x642ab4);if(fs[_0x4402('0x48')](_0x295c9b)){_0x169bb2=!![];return _0x3fe6b4['decryptFile'](_0x295c9b,_0x642ab4,config['secrets'][_0x4402('0x49')])[_0x4402('0x1b')](function(){return _0xe8a8e9;});}return _0xe8a8e9;}})[_0x4402('0x1b')](function(_0x52475a){if(_0x52475a){var _0x5a076a=_0x52475a[_0x4402('0x46')];if(!fs[_0x4402('0x48')](_0x5a076a)){throw new db[(_0x4402('0x4a'))][(_0x4402('0x4b'))](_0x4402('0x4c'));}if(_0x52475a[_0x4402('0x4d')]){return _0x29e67b[_0x4402('0x4e')](_0x5a076a,_0x52475a[_0x4402('0x4d')]+path[_0x4402('0x4f')](_0x5a076a),function(){if(_0x169bb2){fs[_0x4402('0x50')](_0x5a076a);}});}else{return _0x29e67b[_0x4402('0x4e')](_0x5a076a,function(_0x43e876){if(_0x169bb2){fs[_0x4402('0x50')](_0x5a076a);}});}}})['catch'](function(_0x25afd0){if(_0x25afd0['message']===_0x4402('0x4c')){_0x29e67b['status'](0x194)[_0x4402('0x51')](_0x4402('0x52'));}else{return handleError(_0x29e67b,null);}});};exports[_0x4402('0x53')]=function(_0x31e36c,_0x1f298c,_0x3cff5b){var _0x4a73ec=require(_0x4402('0x54'));var _0x25c1fc=![];var _0xa390ce={'$and':[db[_0x4402('0x55')][_0x4402('0x33')](db['sequelize']['fn'](_0x4402('0x56'),db[_0x4402('0x55')][_0x4402('0x57')](_0x4402('0x45'))),_0x31e36c[_0x4402('0x27')][_0x4402('0x58')])]};if(_0x31e36c[_0x4402('0x27')][_0x4402('0x23')]&&_0x31e36c['query'][_0x4402('0x23')]===_0x4402('0x45')){_0xa390ce['$and'][_0x4402('0x59')]({'uniqueid':_0x31e36c[_0x4402('0x40')]['id']});}else{_0xa390ce['$and']['push']({'id':_0x31e36c[_0x4402('0x40')]['id']});}return db[_0x4402('0x39')][_0x4402('0x41')]({'where':_0xa390ce,'attributes':['id','value'],'raw':!![]})[_0x4402('0x1b')](handleEntityNotFound(_0x1f298c,null))[_0x4402('0x1b')](function(_0x30e49b){if(_0x30e49b){var _0x55f261=util[_0x4402('0x26')](_0x4402('0x47'),_0x30e49b[_0x4402('0x46')]);if(fs['existsSync'](_0x55f261)){_0x25c1fc=!![];return _0x4a73ec[_0x4402('0x5a')](_0x55f261,_0x30e49b[_0x4402('0x46')],config['secrets']['recording'])[_0x4402('0x1b')](function(){return _0x30e49b;});}return _0x30e49b;}})['then'](function(_0x46cf7a){if(_0x46cf7a){if(!fs[_0x4402('0x48')](_0x46cf7a['value'])){throw new db['Sequelize'][(_0x4402('0x4b'))](_0x4402('0x4c'));}if(_0x46cf7a[_0x4402('0x4d')]){return _0x1f298c[_0x4402('0x4e')](_0x46cf7a['value'],_0x46cf7a[_0x4402('0x4d')]+path[_0x4402('0x4f')](_0x46cf7a[_0x4402('0x46')]),function(){if(_0x25c1fc){fs[_0x4402('0x50')](_0x46cf7a[_0x4402('0x46')]);}});}else{return _0x1f298c[_0x4402('0x4e')](_0x46cf7a[_0x4402('0x46')],function(_0x4b3dcc){if(_0x25c1fc){fs[_0x4402('0x50')](_0x46cf7a[_0x4402('0x46')]);}});}}})['catch'](handleError(_0x1f298c,null));};exports['destroy']=function(_0x2bee9d,_0x4aaa60){return db[_0x4402('0x39')]['find']({'where':{'id':_0x2bee9d[_0x4402('0x40')]['id']}})[_0x4402('0x1b')](function(_0x22260b){if(!_0x22260b)throw new ReferenceError(_0x4402('0x5b'));return _0x22260b;})[_0x4402('0x1b')](function(_0x1c1857){var _0x436a74=_0x1c1857[_0x4402('0x46')];logger[_0x4402('0x5c')](_0x4402('0x5d'),_0x436a74);if(!_[_0x4402('0x5e')](_0x1c1857[_0x4402('0x46')])&&fs[_0x4402('0x48')](_0x436a74)){logger[_0x4402('0x5c')](_0x4402('0x5f')+_0x436a74+_0x4402('0x60'));fs['unlinkSync'](_0x436a74);}_0x436a74=_0x436a74+_0x4402('0x61');if(!_[_0x4402('0x5e')](_0x1c1857[_0x4402('0x46')])&&fs['existsSync'](_0x436a74)){logger[_0x4402('0x5c')]('File:\x20\x22'+_0x436a74+_0x4402('0x60'));fs[_0x4402('0x62')](_0x436a74);}return _0x1c1857;})[_0x4402('0x1b')](function(_0x3bca70){if(!_0x3bca70)throw new InternalError();return _0x3bca70['destroy']();})[_0x4402('0x1b')](function(){_0x4aaa60['status'](0xcc)[_0x4402('0x13')]();})[_0x4402('0x3e')](function(_0x24ee20){var _0x5574df=0x1f4;if(e instanceof ReferenceError){_0x5574df=0x194;}else if(e instanceof InternalError){_0x5574df=0x1f4;}logger[_0x4402('0x63')](_0x24ee20['stack']);if(_0x24ee20[_0x4402('0x1e')]){delete _0x24ee20[_0x4402('0x1e')];}_0x4aaa60[_0x4402('0x12')](_0x5574df)[_0x4402('0x51')](_0x24ee20);});}; \ No newline at end of file +var _0x4fc2=['type','key','model','format','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','create','body','update','find','params','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','unlink','Not\x20found','sequelize','col','token','push','$and','extname','info','cancellazione\x20fisica\x20documento\x20%s','isNil','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','then','destroy','error','stack','name','send','index','map','VoiceRecording','fieldName'];(function(_0x2debd5,_0x1069e6){var _0x1769d1=function(_0x43c2a9){while(--_0x43c2a9){_0x2debd5['push'](_0x2debd5['shift']());}};_0x1769d1(++_0x1069e6);}(_0x4fc2,0x111));var _0x24fc=function(_0x366a7d,_0x57fbf7){_0x366a7d=_0x366a7d-0x0;var _0x124285=_0x4fc2[_0x366a7d];return _0x124285;};'use strict';var pdf=require(_0x24fc('0x0'));var emlformat=require(_0x24fc('0x1'));var rimraf=require(_0x24fc('0x2'));var zipdir=require(_0x24fc('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x24fc('0x4'));var moment=require(_0x24fc('0x5'));var BPromise=require(_0x24fc('0x6'));var Mustache=require('mustache');var util=require(_0x24fc('0x7'));var path=require(_0x24fc('0x8'));var sox=require('sox');var csv=require(_0x24fc('0x9'));var ejs=require(_0x24fc('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x24fc('0xb'));var crypto=require(_0x24fc('0xc'));var jsforce=require(_0x24fc('0xd'));var deskjs=require(_0x24fc('0xe'));var toCsv=require(_0x24fc('0x9'));var querystring=require(_0x24fc('0xf'));var Papa=require('papaparse');var Redis=require(_0x24fc('0x10'));var authService=require(_0x24fc('0x11'));var qs=require(_0x24fc('0x12'));var as=require(_0x24fc('0x13'));var hardwareService=require(_0x24fc('0x14'));var logger=require(_0x24fc('0x15'))(_0x24fc('0x16'));var utils=require(_0x24fc('0x17'));var config=require('../../config/environment');var db=require(_0x24fc('0x18'))['db'];function respondWithStatusCode(_0x1cde5d,_0x5cc65e){_0x5cc65e=_0x5cc65e||0xcc;return function(_0x306873){if(_0x306873){return _0x1cde5d[_0x24fc('0x19')](_0x5cc65e);}return _0x1cde5d[_0x24fc('0x1a')](_0x5cc65e)[_0x24fc('0x1b')]();};}function respondWithResult(_0x30f19b,_0x326276){_0x326276=_0x326276||0xc8;return function(_0x537b5c){if(_0x537b5c){return _0x30f19b[_0x24fc('0x1a')](_0x326276)[_0x24fc('0x1c')](_0x537b5c);}};}function respondWithFilteredResult(_0x2ffed3,_0x42cbe8){return function(_0x4acd36){if(_0x4acd36){var _0x2ac989=_0x4acd36[_0x24fc('0x1d')],_0x588543=_0x42cbe8[_0x24fc('0x1e')],_0x4af098=_0x42cbe8[_0x24fc('0x1e')]+_0x42cbe8['limit'],_0x3385c7;if(_0x4af098>=_0x2ac989){_0x4af098=_0x2ac989;_0x3385c7=0xc8;}else{_0x3385c7=0xce;}_0x2ffed3[_0x24fc('0x1a')](_0x3385c7);return _0x2ffed3[_0x24fc('0x1f')](_0x24fc('0x20'),_0x588543+'-'+_0x4af098+'/'+_0x2ac989)[_0x24fc('0x1c')](_0x4acd36);}return null;};}function patchUpdates(_0x4c5a43){return function(_0x5eabee){try{jsonpatch[_0x24fc('0x21')](_0x5eabee,_0x4c5a43,!![]);}catch(_0x304881){return BPromise['reject'](_0x304881);}return _0x5eabee[_0x24fc('0x22')]();};}function saveUpdates(_0x36a771,_0xbf1d6b){return function(_0x2d0e3d){if(_0x2d0e3d){return _0x2d0e3d['update'](_0x36a771)[_0x24fc('0x23')](function(_0x545939){return _0x545939;});}return null;};}function removeEntity(_0x339b50,_0x591c8f){return function(_0x3ed464){if(_0x3ed464){return _0x3ed464[_0x24fc('0x24')]()[_0x24fc('0x23')](function(){_0x339b50['status'](0xcc)[_0x24fc('0x1b')]();});}};}function handleEntityNotFound(_0x552035,_0x35a9c7){return function(_0x2bb93a){if(!_0x2bb93a){_0x552035[_0x24fc('0x19')](0x194);}return _0x2bb93a;};}function handleError(_0x34b5b2,_0x3296fc){_0x3296fc=_0x3296fc||0x1f4;return function(_0x262e11){logger[_0x24fc('0x25')](_0x262e11[_0x24fc('0x26')]);if(_0x262e11[_0x24fc('0x27')]){delete _0x262e11[_0x24fc('0x27')];}_0x34b5b2['status'](_0x3296fc)[_0x24fc('0x28')](_0x262e11);};}exports[_0x24fc('0x29')]=function(_0x3ee302,_0x5bb4c8){var _0xf2f77d={},_0x3d1ec8={},_0x35f9f9={'count':0x0,'rows':[]};var _0x290f84=_[_0x24fc('0x2a')](db[_0x24fc('0x2b')]['rawAttributes'],function(_0x240ae7){return{'name':_0x240ae7[_0x24fc('0x2c')],'type':_0x240ae7[_0x24fc('0x2d')][_0x24fc('0x2e')]};});_0x3d1ec8[_0x24fc('0x2f')]=_['differenceBy'](_['map'](_0x290f84,'name'),[_0x24fc('0x30')]);_0x3d1ec8['query']=_[_0x24fc('0x31')](_0x3ee302[_0x24fc('0x32')]);_0x3d1ec8[_0x24fc('0x33')]=_[_0x24fc('0x34')](_0x3d1ec8['model'],_0x3d1ec8[_0x24fc('0x32')]);_0xf2f77d[_0x24fc('0x35')]=_['intersection'](_0x3d1ec8[_0x24fc('0x2f')],qs[_0x24fc('0x36')](_0x3ee302['query']['fields']));_0xf2f77d[_0x24fc('0x35')]=_0xf2f77d['attributes'][_0x24fc('0x37')]?_0xf2f77d[_0x24fc('0x35')]:_0x3d1ec8['model'];if(!_0x3ee302[_0x24fc('0x32')][_0x24fc('0x38')](_0x24fc('0x39'))){_0xf2f77d[_0x24fc('0x3a')]=qs[_0x24fc('0x3a')](_0x3ee302[_0x24fc('0x32')][_0x24fc('0x3a')]);_0xf2f77d[_0x24fc('0x1e')]=qs[_0x24fc('0x1e')](_0x3ee302['query'][_0x24fc('0x1e')]);}_0xf2f77d[_0x24fc('0x3b')]=qs[_0x24fc('0x3c')](_0x3ee302[_0x24fc('0x32')][_0x24fc('0x3c')]);_0xf2f77d['where']=qs['filters'](_[_0x24fc('0x3d')](_0x3ee302['query'],_0x3d1ec8[_0x24fc('0x33')]));if(_0x3ee302[_0x24fc('0x32')][_0x24fc('0x3e')]){_0xf2f77d[_0x24fc('0x3f')]=_['merge'](_0xf2f77d[_0x24fc('0x3f')],{'$or':_['map'](_0x290f84,function(_0x65771d){if(_0x65771d[_0x24fc('0x2d')]!==_0x24fc('0x40')){var _0x2485d8={};_0x2485d8[_0x65771d[_0x24fc('0x27')]]={'$like':'%'+_0x3ee302['query'][_0x24fc('0x3e')]+'%'};return _0x2485d8;}})});}_0xf2f77d=_[_0x24fc('0x41')]({},_0xf2f77d,_0x3ee302[_0x24fc('0x42')]);var _0x22a75c={'where':_0xf2f77d['where']};return db[_0x24fc('0x2b')][_0x24fc('0x1d')](_0x22a75c)['then'](function(_0xf40435){_0x35f9f9['count']=_0xf40435;if(_0x3ee302[_0x24fc('0x32')][_0x24fc('0x43')]){_0xf2f77d[_0x24fc('0x44')]=[{'all':!![]}];}return db[_0x24fc('0x2b')][_0x24fc('0x45')](_0xf2f77d);})[_0x24fc('0x23')](function(_0x77b959){_0x35f9f9[_0x24fc('0x46')]=_0x77b959;return _0x35f9f9;})['then'](respondWithFilteredResult(_0x5bb4c8,_0xf2f77d))[_0x24fc('0x47')](handleError(_0x5bb4c8,null));};exports[_0x24fc('0x48')]=function(_0x32f72c,_0x4fee9f){var _0x14a8b4={'raw':![],'where':{'id':_0x32f72c['params']['id']}},_0x1e3b52={};_0x1e3b52[_0x24fc('0x2f')]=_[_0x24fc('0x31')](db[_0x24fc('0x2b')]['rawAttributes']);_0x1e3b52[_0x24fc('0x32')]=_[_0x24fc('0x31')](_0x32f72c['query']);_0x1e3b52[_0x24fc('0x33')]=_[_0x24fc('0x34')](_0x1e3b52[_0x24fc('0x2f')],_0x1e3b52[_0x24fc('0x32')]);_0x14a8b4['attributes']=_[_0x24fc('0x34')](_0x1e3b52[_0x24fc('0x2f')],qs[_0x24fc('0x36')](_0x32f72c[_0x24fc('0x32')][_0x24fc('0x36')]));_0x14a8b4['attributes']=_0x14a8b4[_0x24fc('0x35')][_0x24fc('0x37')]?_0x14a8b4[_0x24fc('0x35')]:_0x1e3b52[_0x24fc('0x2f')];if(_0x32f72c['query'][_0x24fc('0x43')]){_0x14a8b4[_0x24fc('0x44')]=[{'all':!![]}];}_0x14a8b4=_['merge']({},_0x14a8b4,_0x32f72c['options']);return db[_0x24fc('0x2b')]['find'](_0x14a8b4)['then'](handleEntityNotFound(_0x4fee9f,null))[_0x24fc('0x23')](respondWithResult(_0x4fee9f,null))['catch'](handleError(_0x4fee9f,null));};exports[_0x24fc('0x49')]=function(_0x264854,_0x5052c8){return db['VoiceRecording'][_0x24fc('0x49')](_0x264854[_0x24fc('0x4a')],{})[_0x24fc('0x23')](respondWithResult(_0x5052c8,0xc9))[_0x24fc('0x47')](handleError(_0x5052c8,null));};exports[_0x24fc('0x4b')]=function(_0x6c6754,_0x166f6c){if(_0x6c6754[_0x24fc('0x4a')]['id']){delete _0x6c6754['body']['id'];}return db['VoiceRecording'][_0x24fc('0x4c')]({'where':{'id':_0x6c6754[_0x24fc('0x4d')]['id']}})[_0x24fc('0x23')](handleEntityNotFound(_0x166f6c,null))['then'](saveUpdates(_0x6c6754['body'],null))[_0x24fc('0x23')](respondWithResult(_0x166f6c,null))[_0x24fc('0x47')](handleError(_0x166f6c,null));};exports[_0x24fc('0x4e')]=function(_0x134f64,_0x21f8b8){return db[_0x24fc('0x2b')][_0x24fc('0x4e')]()[_0x24fc('0x23')](respondWithResult(_0x21f8b8,null))[_0x24fc('0x47')](handleError(_0x21f8b8,null));};exports[_0x24fc('0x4f')]=function(_0x434700,_0x676f02,_0x5ec1c0){var _0x1c9a28=require(_0x24fc('0x50'));var _0x32a466=![];var _0xb0fc00={};if(_0x434700[_0x24fc('0x32')]['type']&&_0x434700[_0x24fc('0x32')]['type']===_0x24fc('0x51')){_0xb0fc00[_0x24fc('0x51')]=_0x434700[_0x24fc('0x4d')]['id'];}else{_0xb0fc00['id']=_0x434700[_0x24fc('0x4d')]['id'];}return db[_0x24fc('0x2b')][_0x24fc('0x4c')]({'where':_0xb0fc00,'attributes':['id','value'],'raw':!![]})[_0x24fc('0x23')](handleEntityNotFound(_0x676f02,null))[_0x24fc('0x23')](function(_0xc49d9f){if(_0xc49d9f){var _0x31a2ef=_0xc49d9f[_0x24fc('0x52')];var _0x870767=util['format'](_0x24fc('0x53'),_0x31a2ef);if(fs[_0x24fc('0x54')](_0x870767)){_0x32a466=!![];return _0x1c9a28[_0x24fc('0x55')](_0x870767,_0x31a2ef,config[_0x24fc('0x56')][_0x24fc('0x57')])[_0x24fc('0x23')](function(){return _0xc49d9f;});}return _0xc49d9f;}})[_0x24fc('0x23')](function(_0x584888){if(_0x584888){var _0xd673f8=_0x584888[_0x24fc('0x52')];if(!fs['existsSync'](_0xd673f8)){throw new db[(_0x24fc('0x58'))][(_0x24fc('0x59'))](_0x24fc('0x5a'));}if(_0x584888[_0x24fc('0x5b')]){return _0x676f02[_0x24fc('0x4f')](_0xd673f8,_0x584888[_0x24fc('0x5b')]+path['extname'](_0xd673f8),function(){if(_0x32a466){fs[_0x24fc('0x5c')](_0xd673f8);}});}else{return _0x676f02['download'](_0xd673f8,function(_0x3e9644){if(_0x32a466){fs[_0x24fc('0x5c')](_0xd673f8);}});}}})['catch'](function(_0x435442){if(_0x435442['message']===_0x24fc('0x5a')){_0x676f02['status'](0x194)[_0x24fc('0x28')](_0x24fc('0x5d'));}else{return handleError(_0x676f02,null);}});};exports['downloads']=function(_0x2edef7,_0x5d6539,_0x191bc6){var _0x16dc59=require('../../components/encryptor');var _0xd1638f=![];var _0x3ec1a8={'$and':[db[_0x24fc('0x5e')][_0x24fc('0x3f')](db[_0x24fc('0x5e')]['fn']('MD5',db[_0x24fc('0x5e')][_0x24fc('0x5f')](_0x24fc('0x51'))),_0x2edef7[_0x24fc('0x32')][_0x24fc('0x60')])]};if(_0x2edef7['query']['type']&&_0x2edef7[_0x24fc('0x32')][_0x24fc('0x2d')]==='uniqueid'){_0x3ec1a8['$and'][_0x24fc('0x61')]({'uniqueid':_0x2edef7[_0x24fc('0x4d')]['id']});}else{_0x3ec1a8[_0x24fc('0x62')][_0x24fc('0x61')]({'id':_0x2edef7['params']['id']});}return db[_0x24fc('0x2b')][_0x24fc('0x4c')]({'where':_0x3ec1a8,'attributes':['id',_0x24fc('0x52')],'raw':!![]})[_0x24fc('0x23')](handleEntityNotFound(_0x5d6539,null))[_0x24fc('0x23')](function(_0x3e896f){if(_0x3e896f){var _0x26ac2e=util[_0x24fc('0x30')](_0x24fc('0x53'),_0x3e896f[_0x24fc('0x52')]);if(fs[_0x24fc('0x54')](_0x26ac2e)){_0xd1638f=!![];return _0x16dc59[_0x24fc('0x55')](_0x26ac2e,_0x3e896f[_0x24fc('0x52')],config[_0x24fc('0x56')][_0x24fc('0x57')])['then'](function(){return _0x3e896f;});}return _0x3e896f;}})[_0x24fc('0x23')](function(_0x3cff00){if(_0x3cff00){if(!fs[_0x24fc('0x54')](_0x3cff00[_0x24fc('0x52')])){throw new db[(_0x24fc('0x58'))][(_0x24fc('0x59'))](_0x24fc('0x5a'));}if(_0x3cff00[_0x24fc('0x5b')]){return _0x5d6539['download'](_0x3cff00[_0x24fc('0x52')],_0x3cff00[_0x24fc('0x5b')]+path[_0x24fc('0x63')](_0x3cff00[_0x24fc('0x52')]),function(){if(_0xd1638f){fs['unlink'](_0x3cff00[_0x24fc('0x52')]);}});}else{return _0x5d6539[_0x24fc('0x4f')](_0x3cff00['value'],function(_0x4c880f){if(_0xd1638f){fs['unlink'](_0x3cff00[_0x24fc('0x52')]);}});}}})[_0x24fc('0x47')](handleError(_0x5d6539,null));};exports[_0x24fc('0x24')]=function(_0x2c6a97,_0x333a34){return db[_0x24fc('0x2b')]['find']({'where':{'id':_0x2c6a97[_0x24fc('0x4d')]['id']}})[_0x24fc('0x23')](function(_0x5a2c09){if(!_0x5a2c09)throw new ReferenceError('Entity\x20not\x20found');return _0x5a2c09;})[_0x24fc('0x23')](function(_0x2f5101){var _0x3cc8c4=_0x2f5101['value'];logger[_0x24fc('0x64')](_0x24fc('0x65'),_0x3cc8c4);if(!_[_0x24fc('0x66')](_0x2f5101['value'])&&fs['existsSync'](_0x3cc8c4)){logger['info']('File:\x20\x22'+_0x3cc8c4+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x24fc('0x67')](_0x3cc8c4);}_0x3cc8c4=_0x3cc8c4+_0x24fc('0x68');if(!_[_0x24fc('0x66')](_0x2f5101[_0x24fc('0x52')])&&fs['existsSync'](_0x3cc8c4)){logger[_0x24fc('0x64')]('File:\x20\x22'+_0x3cc8c4+_0x24fc('0x69'));fs['unlinkSync'](_0x3cc8c4);}return _0x2f5101;})[_0x24fc('0x23')](function(_0x3a7cff){if(!_0x3a7cff)throw new InternalError();return _0x3a7cff[_0x24fc('0x24')]();})[_0x24fc('0x23')](function(){_0x333a34[_0x24fc('0x1a')](0xcc)[_0x24fc('0x1b')]();})[_0x24fc('0x47')](function(_0x591ec6){var _0x45513e=0x1f4;if(e instanceof ReferenceError){_0x45513e=0x194;}else if(e instanceof InternalError){_0x45513e=0x1f4;}logger[_0x24fc('0x25')](_0x591ec6[_0x24fc('0x26')]);if(_0x591ec6['name']){delete _0x591ec6['name'];}_0x333a34[_0x24fc('0x1a')](_0x45513e)[_0x24fc('0x28')](_0x591ec6);});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index c7caea2..7cbc5e9 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 _0xa66e=['uniqueid','lodash','../../config/logger','moment','bluebird','path','rimraf','./voiceRecording.attributes','VoiceRecording','voice_recordings'];(function(_0x361704,_0x3af61c){var _0x258953=function(_0x53ca46){while(--_0x53ca46){_0x361704['push'](_0x361704['shift']());}};_0x258953(++_0x3af61c);}(_0xa66e,0x1c3));var _0xea66=function(_0x4facda,_0x2936a1){_0x4facda=_0x4facda-0x0;var _0x7a12ad=_0xa66e[_0x4facda];return _0x7a12ad;};'use strict';var _=require(_0xea66('0x0'));var util=require('util');var logger=require(_0xea66('0x1'))('api');var moment=require(_0xea66('0x2'));var BPromise=require(_0xea66('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xea66('0x4'));var rimraf=require(_0xea66('0x5'));var config=require('../../config/environment');var attributes=require(_0xea66('0x6'));module['exports']=function(_0x38461b,_0x378caa){return _0x38461b['define'](_0xea66('0x7'),attributes,{'tableName':_0xea66('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xea66('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbe82=['rimraf','./voiceRecording.attributes','exports','VoiceRecording','voice_recordings','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1096fb,_0xd5abf2){var _0x174cc5=function(_0xcaef46){while(--_0xcaef46){_0x1096fb['push'](_0x1096fb['shift']());}};_0x174cc5(++_0xd5abf2);}(_0xbe82,0x1cd));var _0x2be8=function(_0x13081b,_0xd6654e){_0x13081b=_0x13081b-0x0;var _0xcc2aad=_0xbe82[_0x13081b];return _0xcc2aad;};'use strict';var _=require(_0x2be8('0x0'));var util=require(_0x2be8('0x1'));var logger=require(_0x2be8('0x2'))(_0x2be8('0x3'));var moment=require(_0x2be8('0x4'));var BPromise=require(_0x2be8('0x5'));var rp=require(_0x2be8('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2be8('0x7'));var config=require('../../config/environment');var attributes=require(_0x2be8('0x8'));module[_0x2be8('0x9')]=function(_0x231ab4,_0x6b7604){return _0x231ab4['define'](_0x2be8('0xa'),attributes,{'tableName':_0x2be8('0xb'),'paranoid':![],'indexes':[{'name':_0x2be8('0xc'),'fields':[_0x2be8('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 4344b9a..50be2f5 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 _0xa9e0=['findOne','callRecordingEncryption','create','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','VoiceRecording','update','body','options','raw','then','UpdateVoiceRecording','stringify','CreateVoiceRecording'];(function(_0x1c0b34,_0x425ab7){var _0x148223=function(_0x5092fa){while(--_0x5092fa){_0x1c0b34['push'](_0x1c0b34['shift']());}};_0x148223(++_0x425ab7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'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['UpdateVoiceRecording']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')](_0x459eb1[_0x0a9e('0x16')],{'raw':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')][_0x0a9e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['where']||null:null,'attributes':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['attributes']||null:null,'limit':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1['options']['limit']||null:null})[_0x0a9e('0x19')](function(_0x432e56){logger[_0x0a9e('0xa')](_0x0a9e('0x1a'),_0x459eb1);logger['debug'](_0x0a9e('0x1a'),_0x459eb1,JSON[_0x0a9e('0x1b')](_0x432e56));_0x106033(_0x432e56);})[_0x0a9e('0x13')](function(_0x4d00e6){logger[_0x0a9e('0x10')](_0x0a9e('0x1a'),_0x4d00e6[_0x0a9e('0x11')],_0x459eb1);_0x205fd6(_0x478723['error'](0x1f4,_0x4d00e6['message']));});});};exports[_0x0a9e('0x1c')]=function(_0x3a8e58){var _0x40c424=this;return new Promise(function(_0x33161b,_0x526cf3){var _0x384319=require('../../components/encryptor');var _0x45a1e7;return db['Setting'][_0x0a9e('0x1d')]({'attributes':['id',_0x0a9e('0x1e')],'where':{'id':0x1},'raw':!![]})[_0x0a9e('0x19')](function(_0x14433c){_0x45a1e7=_0x14433c;return db[_0x0a9e('0x14')][_0x0a9e('0x1f')](_0x3a8e58[_0x0a9e('0x16')]);})[_0x0a9e('0x19')](function(_0x5a101a){if(_0x45a1e7[_0x0a9e('0x1e')]&&fs[_0x0a9e('0x20')](_0x5a101a[_0x0a9e('0x21')])){var _0x2ec755=util['format'](_0x0a9e('0x22'),_0x5a101a[_0x0a9e('0x21')]);return _0x384319[_0x0a9e('0x23')](_0x5a101a[_0x0a9e('0x21')],_0x2ec755,config[_0x0a9e('0x24')][_0x0a9e('0x25')])[_0x0a9e('0x19')](function(){fs[_0x0a9e('0x26')](_0x5a101a[_0x0a9e('0x21')]);logger['info'](_0x0a9e('0x27'));return _0x5a101a;});}return _0x5a101a;})['then'](function(_0x2407f9){logger[_0x0a9e('0xa')](_0x0a9e('0x1c'),_0x3a8e58);logger[_0x0a9e('0xd')](_0x0a9e('0x1c'),_0x3a8e58,JSON['stringify'](_0x2407f9));_0x33161b(_0x2407f9);})[_0x0a9e('0x13')](function(_0x46f0a5){logger[_0x0a9e('0x10')](_0x0a9e('0x1c'),_0x46f0a5[_0x0a9e('0x11')],_0x3a8e58);_0x526cf3(_0x40c424[_0x0a9e('0x10')](0x1f4,_0x46f0a5[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0xa9e0=['findOne','callRecordingEncryption','create','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','VoiceRecording','update','body','options','raw','then','UpdateVoiceRecording','stringify','CreateVoiceRecording'];(function(_0x46399a,_0x108f44){var _0x3f97ca=function(_0xb8ca74){while(--_0xb8ca74){_0x46399a['push'](_0x46399a['shift']());}};_0x3f97ca(++_0x108f44);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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['UpdateVoiceRecording']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')](_0x459eb1[_0x0a9e('0x16')],{'raw':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')][_0x0a9e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['where']||null:null,'attributes':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['attributes']||null:null,'limit':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1['options']['limit']||null:null})[_0x0a9e('0x19')](function(_0x432e56){logger[_0x0a9e('0xa')](_0x0a9e('0x1a'),_0x459eb1);logger['debug'](_0x0a9e('0x1a'),_0x459eb1,JSON[_0x0a9e('0x1b')](_0x432e56));_0x106033(_0x432e56);})[_0x0a9e('0x13')](function(_0x4d00e6){logger[_0x0a9e('0x10')](_0x0a9e('0x1a'),_0x4d00e6[_0x0a9e('0x11')],_0x459eb1);_0x205fd6(_0x478723['error'](0x1f4,_0x4d00e6['message']));});});};exports[_0x0a9e('0x1c')]=function(_0x3a8e58){var _0x40c424=this;return new Promise(function(_0x33161b,_0x526cf3){var _0x384319=require('../../components/encryptor');var _0x45a1e7;return db['Setting'][_0x0a9e('0x1d')]({'attributes':['id',_0x0a9e('0x1e')],'where':{'id':0x1},'raw':!![]})[_0x0a9e('0x19')](function(_0x14433c){_0x45a1e7=_0x14433c;return db[_0x0a9e('0x14')][_0x0a9e('0x1f')](_0x3a8e58[_0x0a9e('0x16')]);})[_0x0a9e('0x19')](function(_0x5a101a){if(_0x45a1e7[_0x0a9e('0x1e')]&&fs[_0x0a9e('0x20')](_0x5a101a[_0x0a9e('0x21')])){var _0x2ec755=util['format'](_0x0a9e('0x22'),_0x5a101a[_0x0a9e('0x21')]);return _0x384319[_0x0a9e('0x23')](_0x5a101a[_0x0a9e('0x21')],_0x2ec755,config[_0x0a9e('0x24')][_0x0a9e('0x25')])[_0x0a9e('0x19')](function(){fs[_0x0a9e('0x26')](_0x5a101a[_0x0a9e('0x21')]);logger['info'](_0x0a9e('0x27'));return _0x5a101a;});}return _0x5a101a;})['then'](function(_0x2407f9){logger[_0x0a9e('0xa')](_0x0a9e('0x1c'),_0x3a8e58);logger[_0x0a9e('0xd')](_0x0a9e('0x1c'),_0x3a8e58,JSON['stringify'](_0x2407f9));_0x33161b(_0x2407f9);})[_0x0a9e('0x13')](function(_0x46f0a5){logger[_0x0a9e('0x10')](_0x0a9e('0x1c'),_0x46f0a5[_0x0a9e('0x11')],_0x3a8e58);_0x526cf3(_0x40c424[_0x0a9e('0x10')](0x1f4,_0x46f0a5[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 342a57f..45f9ec5 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 _0x6d38=['path','connect-timeout','../../components/auth/service','../../config/environment','./voiceTransferReport.controller','get','index','/:id','isAuthenticated','create','put','update','delete','destroy','exports','util'];(function(_0x2a536d,_0x1e8fc2){var _0x5e428f=function(_0x3b7cfb){while(--_0x3b7cfb){_0x2a536d['push'](_0x2a536d['shift']());}};_0x5e428f(++_0x1e8fc2);}(_0x6d38,0x1ef));var _0x86d3=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x6d38[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require('multer');var util=require(_0x86d3('0x0'));var path=require(_0x86d3('0x1'));var timeout=require(_0x86d3('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x86d3('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x86d3('0x4'));var controller=require(_0x86d3('0x5'));router[_0x86d3('0x6')]('/',auth['isAuthenticated'](),controller[_0x86d3('0x7')]);router[_0x86d3('0x6')](_0x86d3('0x8'),auth[_0x86d3('0x9')](),controller['show']);router['post']('/',auth[_0x86d3('0x9')](),controller[_0x86d3('0xa')]);router[_0x86d3('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x86d3('0xc')]);router[_0x86d3('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x86d3('0xe')]);module[_0x86d3('0xf')]=router; \ No newline at end of file +var _0xc6ac=['show','post','create','put','/:id','update','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x2c099e,_0x20d460){_0x2c099e=_0x2c099e-0x0;var _0x47323a=_0xc6ac[_0x2c099e];return _0x47323a;};'use strict';var multer=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var path=require(_0xcc6a('0x2'));var timeout=require(_0xcc6a('0x3'));var express=require(_0xcc6a('0x4'));var router=express[_0xcc6a('0x5')]();var auth=require(_0xcc6a('0x6'));var interaction=require(_0xcc6a('0x7'));var config=require(_0xcc6a('0x8'));var controller=require(_0xcc6a('0x9'));router[_0xcc6a('0xa')]('/',auth[_0xcc6a('0xb')](),controller[_0xcc6a('0xc')]);router[_0xcc6a('0xa')]('/:id',auth[_0xcc6a('0xb')](),controller[_0xcc6a('0xd')]);router[_0xcc6a('0xe')]('/',auth['isAuthenticated'](),controller[_0xcc6a('0xf')]);router[_0xcc6a('0x10')](_0xcc6a('0x11'),auth[_0xcc6a('0xb')](),controller[_0xcc6a('0x12')]);router['delete'](_0xcc6a('0x11'),auth[_0xcc6a('0xb')](),controller[_0xcc6a('0x13')]);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 cf9ad6a..6fc6231 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 _0x92b7=['ENUM','blind','attended','STRING','Yes','sequelize','moment','exports'];(function(_0x3a44ee,_0x16b578){var _0x3aea83=function(_0x2cd2ae){while(--_0x2cd2ae){_0x3a44ee['push'](_0x3a44ee['shift']());}};_0x3aea83(++_0x16b578);}(_0x92b7,0x7d));var _0x792b=function(_0x44745f,_0x432d7e){_0x44745f=_0x44745f-0x0;var _0xac7f24=_0x92b7[_0x44745f];return _0xac7f24;};'use strict';var Sequelize=require(_0x792b('0x0'));var moment=require(_0x792b('0x1'));module[_0x792b('0x2')]={'type':{'type':Sequelize[_0x792b('0x3')](_0x792b('0x4'),_0x792b('0x5'))},'result':{'type':Sequelize[_0x792b('0x6')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0x792b('0x6')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0x792b('0x6')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x792b('0x6')]},'transferercontext':{'type':Sequelize[_0x792b('0x6')]},'transfererexten':{'type':Sequelize[_0x792b('0x6')]},'transfererlinkedid':{'type':Sequelize[_0x792b('0x6')]},'transfereechannel':{'type':Sequelize[_0x792b('0x6')]},'transfereecalleridnum':{'type':Sequelize[_0x792b('0x6')]},'transfereecalleridname':{'type':Sequelize[_0x792b('0x6')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x792b('0x6')]},'transfereeconnectedlinename':{'type':Sequelize[_0x792b('0x6')]},'transfereeaccountcode':{'type':Sequelize[_0x792b('0x6')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x792b('0x6')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize['ENUM'](_0x792b('0x7'),'No')},'context':{'type':Sequelize[_0x792b('0x6')]},'extension':{'type':Sequelize[_0x792b('0x6')]}}; \ No newline at end of file +var _0xa94e=['STRING','Yes','moment','exports','ENUM','blind','attended'];(function(_0x14de23,_0x4105d0){var _0x12e204=function(_0x3c272f){while(--_0x3c272f){_0x14de23['push'](_0x14de23['shift']());}};_0x12e204(++_0x4105d0);}(_0xa94e,0x1b4));var _0xea94=function(_0x18b2ff,_0x2aed2e){_0x18b2ff=_0x18b2ff-0x0;var _0x2ef996=_0xa94e[_0x18b2ff];return _0x2ef996;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xea94('0x0'));module[_0xea94('0x1')]={'type':{'type':Sequelize[_0xea94('0x2')](_0xea94('0x3'),_0xea94('0x4'))},'result':{'type':Sequelize[_0xea94('0x5')]},'transfererchannel':{'type':Sequelize[_0xea94('0x5')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0xea94('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0xea94('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0xea94('0x5')]},'transfereraccountcode':{'type':Sequelize[_0xea94('0x5')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0xea94('0x5')]},'transfererlinkedid':{'type':Sequelize[_0xea94('0x5')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0xea94('0x5')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0xea94('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0xea94('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0xea94('0x5')]},'transfereecontext':{'type':Sequelize[_0xea94('0x5')]},'transfereeexten':{'type':Sequelize[_0xea94('0x5')]},'transfereelinkedid':{'type':Sequelize[_0xea94('0x5')]},'isexternal':{'type':Sequelize[_0xea94('0x2')](_0xea94('0x6'),'No')},'context':{'type':Sequelize[_0xea94('0x5')]},'extension':{'type':Sequelize[_0xea94('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index ab1f610..c7805d8 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 _0xac4a=['set','apply','reject','save','update','destroy','then','sendStatus','error','send','index','map','VoiceTransferReport','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','keys','rawAttributes','find','create','params','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','json','count','offset','limit'];(function(_0x73cc18,_0x404ae7){var _0x45cfec=function(_0x3aafc8){while(--_0x3aafc8){_0x73cc18['push'](_0x73cc18['shift']());}};_0x45cfec(++_0x404ae7);}(_0xac4a,0x13f));var _0xaac4=function(_0x124dd5,_0x1db154){_0x124dd5=_0x124dd5-0x0;var _0x2857d7=_0xac4a[_0x124dd5];return _0x2857d7;};'use strict';var pdf=require(_0xaac4('0x0'));var emlformat=require(_0xaac4('0x1'));var rimraf=require(_0xaac4('0x2'));var zipdir=require(_0xaac4('0x3'));var jsonpatch=require(_0xaac4('0x4'));var rp=require(_0xaac4('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xaac4('0x6'));var util=require(_0xaac4('0x7'));var path=require(_0xaac4('0x8'));var sox=require('sox');var csv=require(_0xaac4('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xaac4('0xa'));var squel=require('squel');var crypto=require(_0xaac4('0xb'));var jsforce=require(_0xaac4('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaac4('0xd'));var Papa=require('papaparse');var Redis=require(_0xaac4('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaac4('0xf'));var hardwareService=require(_0xaac4('0x10'));var logger=require(_0xaac4('0x11'))(_0xaac4('0x12'));var utils=require(_0xaac4('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2348c2,_0x2e2d02){_0x2e2d02=_0x2e2d02||0xcc;return function(_0x45e512){if(_0x45e512){return _0x2348c2['sendStatus'](_0x2e2d02);}return _0x2348c2[_0xaac4('0x14')](_0x2e2d02)[_0xaac4('0x15')]();};}function respondWithResult(_0x5bcacd,_0xf06b1d){_0xf06b1d=_0xf06b1d||0xc8;return function(_0x2b20d0){if(_0x2b20d0){return _0x5bcacd[_0xaac4('0x14')](_0xf06b1d)[_0xaac4('0x16')](_0x2b20d0);}};}function respondWithFilteredResult(_0x187624,_0x2fbeb7){return function(_0x31b7e5){if(_0x31b7e5){var _0x1df9ae=_0x31b7e5[_0xaac4('0x17')],_0x233278=_0x2fbeb7[_0xaac4('0x18')],_0xb8466e=_0x2fbeb7['offset']+_0x2fbeb7[_0xaac4('0x19')],_0x35bc32;if(_0xb8466e>=_0x1df9ae){_0xb8466e=_0x1df9ae;_0x35bc32=0xc8;}else{_0x35bc32=0xce;}_0x187624['status'](_0x35bc32);return _0x187624[_0xaac4('0x1a')]('Content-Range',_0x233278+'-'+_0xb8466e+'/'+_0x1df9ae)[_0xaac4('0x16')](_0x31b7e5);}return null;};}function patchUpdates(_0x27fe7b){return function(_0xa22b76){try{jsonpatch[_0xaac4('0x1b')](_0xa22b76,_0x27fe7b,!![]);}catch(_0x3cbcb1){return BPromise[_0xaac4('0x1c')](_0x3cbcb1);}return _0xa22b76[_0xaac4('0x1d')]();};}function saveUpdates(_0x25b946,_0x4166ee){return function(_0x480fb0){if(_0x480fb0){return _0x480fb0[_0xaac4('0x1e')](_0x25b946)['then'](function(_0x3303f1){return _0x3303f1;});}return null;};}function removeEntity(_0x2013b7,_0x43625c){return function(_0x477b77){if(_0x477b77){return _0x477b77[_0xaac4('0x1f')]()[_0xaac4('0x20')](function(){_0x2013b7['status'](0xcc)[_0xaac4('0x15')]();});}};}function handleEntityNotFound(_0x27a84d,_0x174860){return function(_0x4f10ec){if(!_0x4f10ec){_0x27a84d[_0xaac4('0x21')](0x194);}return _0x4f10ec;};}function handleError(_0x2dcc59,_0xb2577b){_0xb2577b=_0xb2577b||0x1f4;return function(_0x577b3d){logger[_0xaac4('0x22')](_0x577b3d['stack']);if(_0x577b3d['name']){delete _0x577b3d['name'];}_0x2dcc59['status'](_0xb2577b)[_0xaac4('0x23')](_0x577b3d);};}exports[_0xaac4('0x24')]=function(_0x22cda2,_0xe93120){var _0x3c1445={},_0x249a5d={},_0x43b122={'count':0x0,'rows':[]};var _0x2d68b6=_[_0xaac4('0x25')](db[_0xaac4('0x26')]['rawAttributes'],function(_0x316445){return{'name':_0x316445[_0xaac4('0x27')],'type':_0x316445[_0xaac4('0x28')][_0xaac4('0x29')]};});_0x249a5d[_0xaac4('0x2a')]=_[_0xaac4('0x25')](_0x2d68b6,'name');_0x249a5d[_0xaac4('0x2b')]=_['keys'](_0x22cda2[_0xaac4('0x2b')]);_0x249a5d[_0xaac4('0x2c')]=_[_0xaac4('0x2d')](_0x249a5d[_0xaac4('0x2a')],_0x249a5d['query']);_0x3c1445['attributes']=_['intersection'](_0x249a5d[_0xaac4('0x2a')],qs[_0xaac4('0x2e')](_0x22cda2[_0xaac4('0x2b')][_0xaac4('0x2e')]));_0x3c1445[_0xaac4('0x2f')]=_0x3c1445[_0xaac4('0x2f')][_0xaac4('0x30')]?_0x3c1445[_0xaac4('0x2f')]:_0x249a5d[_0xaac4('0x2a')];if(!_0x22cda2[_0xaac4('0x2b')][_0xaac4('0x31')](_0xaac4('0x32'))){_0x3c1445[_0xaac4('0x19')]=qs[_0xaac4('0x19')](_0x22cda2[_0xaac4('0x2b')]['limit']);_0x3c1445['offset']=qs[_0xaac4('0x18')](_0x22cda2[_0xaac4('0x2b')][_0xaac4('0x18')]);}_0x3c1445['order']=qs[_0xaac4('0x33')](_0x22cda2[_0xaac4('0x2b')][_0xaac4('0x33')]);_0x3c1445[_0xaac4('0x34')]=qs[_0xaac4('0x2c')](_[_0xaac4('0x35')](_0x22cda2[_0xaac4('0x2b')],_0x249a5d['filters']));if(_0x22cda2[_0xaac4('0x2b')][_0xaac4('0x36')]){_0x3c1445[_0xaac4('0x34')]=_['merge'](_0x3c1445[_0xaac4('0x34')],{'$or':_['map'](_0x2d68b6,function(_0x577b5b){if(_0x577b5b[_0xaac4('0x28')]!==_0xaac4('0x37')){var _0x2da28a={};_0x2da28a[_0x577b5b['name']]={'$like':'%'+_0x22cda2['query'][_0xaac4('0x36')]+'%'};return _0x2da28a;}})});}_0x3c1445=_[_0xaac4('0x38')]({},_0x3c1445,_0x22cda2[_0xaac4('0x39')]);var _0x268295={'where':_0x3c1445[_0xaac4('0x34')]};return db[_0xaac4('0x26')]['count'](_0x268295)['then'](function(_0x220bdc){_0x43b122[_0xaac4('0x17')]=_0x220bdc;if(_0x22cda2['query'][_0xaac4('0x3a')]){_0x3c1445[_0xaac4('0x3b')]=[{'all':!![]}];}return db[_0xaac4('0x26')]['findAll'](_0x3c1445);})[_0xaac4('0x20')](function(_0x4a4773){_0x43b122[_0xaac4('0x3c')]=_0x4a4773;return _0x43b122;})['then'](respondWithFilteredResult(_0xe93120,_0x3c1445))[_0xaac4('0x3d')](handleError(_0xe93120,null));};exports[_0xaac4('0x3e')]=function(_0x3dcade,_0x33bf83){var _0x51e59d={'raw':!![],'where':{'id':_0x3dcade['params']['id']}},_0x247fea={};_0x247fea['model']=_[_0xaac4('0x3f')](db[_0xaac4('0x26')][_0xaac4('0x40')]);_0x247fea[_0xaac4('0x2b')]=_[_0xaac4('0x3f')](_0x3dcade[_0xaac4('0x2b')]);_0x247fea[_0xaac4('0x2c')]=_[_0xaac4('0x2d')](_0x247fea['model'],_0x247fea[_0xaac4('0x2b')]);_0x51e59d[_0xaac4('0x2f')]=_[_0xaac4('0x2d')](_0x247fea[_0xaac4('0x2a')],qs['fields'](_0x3dcade[_0xaac4('0x2b')][_0xaac4('0x2e')]));_0x51e59d[_0xaac4('0x2f')]=_0x51e59d['attributes'][_0xaac4('0x30')]?_0x51e59d[_0xaac4('0x2f')]:_0x247fea[_0xaac4('0x2a')];if(_0x3dcade[_0xaac4('0x2b')]['includeAll']){_0x51e59d[_0xaac4('0x3b')]=[{'all':!![]}];}_0x51e59d=_[_0xaac4('0x38')]({},_0x51e59d,_0x3dcade[_0xaac4('0x39')]);return db['VoiceTransferReport'][_0xaac4('0x41')](_0x51e59d)[_0xaac4('0x20')](handleEntityNotFound(_0x33bf83,null))[_0xaac4('0x20')](respondWithResult(_0x33bf83,null))[_0xaac4('0x3d')](handleError(_0x33bf83,null));};exports[_0xaac4('0x42')]=function(_0x1ad713,_0x25e1b1){return db[_0xaac4('0x26')][_0xaac4('0x42')](_0x1ad713['body'],{})[_0xaac4('0x20')](respondWithResult(_0x25e1b1,0xc9))[_0xaac4('0x3d')](handleError(_0x25e1b1,null));};exports[_0xaac4('0x1e')]=function(_0x360420,_0x130bb5){if(_0x360420['body']['id']){delete _0x360420['body']['id'];}return db[_0xaac4('0x26')][_0xaac4('0x41')]({'where':{'id':_0x360420[_0xaac4('0x43')]['id']}})[_0xaac4('0x20')](handleEntityNotFound(_0x130bb5,null))['then'](saveUpdates(_0x360420[_0xaac4('0x44')],null))['then'](respondWithResult(_0x130bb5,null))[_0xaac4('0x3d')](handleError(_0x130bb5,null));};exports[_0xaac4('0x1f')]=function(_0x487203,_0x282de3){return db[_0xaac4('0x26')][_0xaac4('0x41')]({'where':{'id':_0x487203['params']['id']}})['then'](handleEntityNotFound(_0x282de3,null))[_0xaac4('0x20')](removeEntity(_0x282de3,null))[_0xaac4('0x3d')](handleError(_0x282de3,null));}; \ No newline at end of file +var _0xb7e7=['ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','name','send','index','VoiceTransferReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','length','find','create','body','html-pdf','rimraf','fast-json-patch','moment','mustache','util','path'];(function(_0x3340c2,_0x384151){var _0x1e8987=function(_0x18c3ee){while(--_0x18c3ee){_0x3340c2['push'](_0x3340c2['shift']());}};_0x1e8987(++_0x384151);}(_0xb7e7,0x121));var _0x7b7e=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0xb7e7[_0x4b2436];return _0x4f5ab2;};'use strict';var pdf=require(_0x7b7e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7b7e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7b7e('0x2'));var rp=require('request-promise');var moment=require(_0x7b7e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7b7e('0x4'));var util=require(_0x7b7e('0x5'));var path=require(_0x7b7e('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7b7e('0x7'));var fs=require('fs');var _=require(_0x7b7e('0x8'));var squel=require(_0x7b7e('0x9'));var crypto=require('crypto');var jsforce=require(_0x7b7e('0xa'));var deskjs=require(_0x7b7e('0xb'));var toCsv=require(_0x7b7e('0xc'));var querystring=require(_0x7b7e('0xd'));var Papa=require(_0x7b7e('0xe'));var Redis=require(_0x7b7e('0xf'));var authService=require(_0x7b7e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7b7e('0x11'));var hardwareService=require(_0x7b7e('0x12'));var logger=require(_0x7b7e('0x13'))(_0x7b7e('0x14'));var utils=require(_0x7b7e('0x15'));var config=require(_0x7b7e('0x16'));var db=require(_0x7b7e('0x17'))['db'];function respondWithStatusCode(_0x55620b,_0xaadda){_0xaadda=_0xaadda||0xcc;return function(_0x54d8ce){if(_0x54d8ce){return _0x55620b[_0x7b7e('0x18')](_0xaadda);}return _0x55620b[_0x7b7e('0x19')](_0xaadda)['end']();};}function respondWithResult(_0x422d3a,_0x5976ac){_0x5976ac=_0x5976ac||0xc8;return function(_0x4c6011){if(_0x4c6011){return _0x422d3a[_0x7b7e('0x19')](_0x5976ac)[_0x7b7e('0x1a')](_0x4c6011);}};}function respondWithFilteredResult(_0xf067da,_0x457ec5){return function(_0x3d2fb2){if(_0x3d2fb2){var _0x5703fd=_0x3d2fb2[_0x7b7e('0x1b')],_0x51baf6=_0x457ec5[_0x7b7e('0x1c')],_0xc7f087=_0x457ec5[_0x7b7e('0x1c')]+_0x457ec5[_0x7b7e('0x1d')],_0x36444d;if(_0xc7f087>=_0x5703fd){_0xc7f087=_0x5703fd;_0x36444d=0xc8;}else{_0x36444d=0xce;}_0xf067da[_0x7b7e('0x19')](_0x36444d);return _0xf067da[_0x7b7e('0x1e')](_0x7b7e('0x1f'),_0x51baf6+'-'+_0xc7f087+'/'+_0x5703fd)[_0x7b7e('0x1a')](_0x3d2fb2);}return null;};}function patchUpdates(_0x12e8e9){return function(_0x14f4fe){try{jsonpatch[_0x7b7e('0x20')](_0x14f4fe,_0x12e8e9,!![]);}catch(_0x3bec7d){return BPromise[_0x7b7e('0x21')](_0x3bec7d);}return _0x14f4fe[_0x7b7e('0x22')]();};}function saveUpdates(_0x3a7b8b,_0x49eddb){return function(_0x69262b){if(_0x69262b){return _0x69262b[_0x7b7e('0x23')](_0x3a7b8b)[_0x7b7e('0x24')](function(_0x4c0647){return _0x4c0647;});}return null;};}function removeEntity(_0x313122,_0xbf0cb3){return function(_0x14243b){if(_0x14243b){return _0x14243b[_0x7b7e('0x25')]()[_0x7b7e('0x24')](function(){_0x313122[_0x7b7e('0x19')](0xcc)[_0x7b7e('0x26')]();});}};}function handleEntityNotFound(_0x10a66a,_0x53bbb3){return function(_0x5d6215){if(!_0x5d6215){_0x10a66a['sendStatus'](0x194);}return _0x5d6215;};}function handleError(_0x26ee14,_0x22598e){_0x22598e=_0x22598e||0x1f4;return function(_0x23bfa3){logger['error'](_0x23bfa3['stack']);if(_0x23bfa3['name']){delete _0x23bfa3[_0x7b7e('0x27')];}_0x26ee14[_0x7b7e('0x19')](_0x22598e)[_0x7b7e('0x28')](_0x23bfa3);};}exports[_0x7b7e('0x29')]=function(_0x3ceaf5,_0x48fad1){var _0x6a1e71={},_0x21a15={},_0x4c46b8={'count':0x0,'rows':[]};var _0x57b9da=_['map'](db[_0x7b7e('0x2a')][_0x7b7e('0x2b')],function(_0x503625){return{'name':_0x503625[_0x7b7e('0x2c')],'type':_0x503625['type'][_0x7b7e('0x2d')]};});_0x21a15[_0x7b7e('0x2e')]=_[_0x7b7e('0x2f')](_0x57b9da,'name');_0x21a15[_0x7b7e('0x30')]=_[_0x7b7e('0x31')](_0x3ceaf5[_0x7b7e('0x30')]);_0x21a15[_0x7b7e('0x32')]=_[_0x7b7e('0x33')](_0x21a15['model'],_0x21a15[_0x7b7e('0x30')]);_0x6a1e71['attributes']=_[_0x7b7e('0x33')](_0x21a15[_0x7b7e('0x2e')],qs[_0x7b7e('0x34')](_0x3ceaf5[_0x7b7e('0x30')][_0x7b7e('0x34')]));_0x6a1e71[_0x7b7e('0x35')]=_0x6a1e71[_0x7b7e('0x35')]['length']?_0x6a1e71['attributes']:_0x21a15[_0x7b7e('0x2e')];if(!_0x3ceaf5[_0x7b7e('0x30')]['hasOwnProperty'](_0x7b7e('0x36'))){_0x6a1e71[_0x7b7e('0x1d')]=qs[_0x7b7e('0x1d')](_0x3ceaf5['query'][_0x7b7e('0x1d')]);_0x6a1e71[_0x7b7e('0x1c')]=qs[_0x7b7e('0x1c')](_0x3ceaf5[_0x7b7e('0x30')][_0x7b7e('0x1c')]);}_0x6a1e71[_0x7b7e('0x37')]=qs[_0x7b7e('0x38')](_0x3ceaf5[_0x7b7e('0x30')][_0x7b7e('0x38')]);_0x6a1e71[_0x7b7e('0x39')]=qs[_0x7b7e('0x32')](_[_0x7b7e('0x3a')](_0x3ceaf5[_0x7b7e('0x30')],_0x21a15[_0x7b7e('0x32')]));if(_0x3ceaf5[_0x7b7e('0x30')][_0x7b7e('0x3b')]){_0x6a1e71['where']=_[_0x7b7e('0x3c')](_0x6a1e71[_0x7b7e('0x39')],{'$or':_[_0x7b7e('0x2f')](_0x57b9da,function(_0x242609){if(_0x242609[_0x7b7e('0x3d')]!==_0x7b7e('0x3e')){var _0x7f15={};_0x7f15[_0x242609[_0x7b7e('0x27')]]={'$like':'%'+_0x3ceaf5[_0x7b7e('0x30')][_0x7b7e('0x3b')]+'%'};return _0x7f15;}})});}_0x6a1e71=_['merge']({},_0x6a1e71,_0x3ceaf5[_0x7b7e('0x3f')]);var _0x1fa75b={'where':_0x6a1e71[_0x7b7e('0x39')]};return db[_0x7b7e('0x2a')]['count'](_0x1fa75b)[_0x7b7e('0x24')](function(_0x35b31a){_0x4c46b8[_0x7b7e('0x1b')]=_0x35b31a;if(_0x3ceaf5['query']['includeAll']){_0x6a1e71[_0x7b7e('0x40')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0x7b7e('0x41')](_0x6a1e71);})[_0x7b7e('0x24')](function(_0x4de331){_0x4c46b8[_0x7b7e('0x42')]=_0x4de331;return _0x4c46b8;})[_0x7b7e('0x24')](respondWithFilteredResult(_0x48fad1,_0x6a1e71))[_0x7b7e('0x43')](handleError(_0x48fad1,null));};exports[_0x7b7e('0x44')]=function(_0x38d32f,_0x435de5){var _0xc888e4={'raw':!![],'where':{'id':_0x38d32f[_0x7b7e('0x45')]['id']}},_0x1d9bb9={};_0x1d9bb9['model']=_['keys'](db[_0x7b7e('0x2a')]['rawAttributes']);_0x1d9bb9[_0x7b7e('0x30')]=_['keys'](_0x38d32f['query']);_0x1d9bb9[_0x7b7e('0x32')]=_['intersection'](_0x1d9bb9[_0x7b7e('0x2e')],_0x1d9bb9['query']);_0xc888e4[_0x7b7e('0x35')]=_[_0x7b7e('0x33')](_0x1d9bb9[_0x7b7e('0x2e')],qs[_0x7b7e('0x34')](_0x38d32f['query'][_0x7b7e('0x34')]));_0xc888e4[_0x7b7e('0x35')]=_0xc888e4[_0x7b7e('0x35')][_0x7b7e('0x46')]?_0xc888e4[_0x7b7e('0x35')]:_0x1d9bb9[_0x7b7e('0x2e')];if(_0x38d32f['query']['includeAll']){_0xc888e4['include']=[{'all':!![]}];}_0xc888e4=_[_0x7b7e('0x3c')]({},_0xc888e4,_0x38d32f[_0x7b7e('0x3f')]);return db[_0x7b7e('0x2a')][_0x7b7e('0x47')](_0xc888e4)[_0x7b7e('0x24')](handleEntityNotFound(_0x435de5,null))[_0x7b7e('0x24')](respondWithResult(_0x435de5,null))['catch'](handleError(_0x435de5,null));};exports[_0x7b7e('0x48')]=function(_0x42e560,_0x5a0832){return db['VoiceTransferReport'][_0x7b7e('0x48')](_0x42e560[_0x7b7e('0x49')],{})[_0x7b7e('0x24')](respondWithResult(_0x5a0832,0xc9))[_0x7b7e('0x43')](handleError(_0x5a0832,null));};exports[_0x7b7e('0x23')]=function(_0xb46776,_0x590154){if(_0xb46776[_0x7b7e('0x49')]['id']){delete _0xb46776['body']['id'];}return db[_0x7b7e('0x2a')][_0x7b7e('0x47')]({'where':{'id':_0xb46776[_0x7b7e('0x45')]['id']}})[_0x7b7e('0x24')](handleEntityNotFound(_0x590154,null))['then'](saveUpdates(_0xb46776[_0x7b7e('0x49')],null))[_0x7b7e('0x24')](respondWithResult(_0x590154,null))[_0x7b7e('0x43')](handleError(_0x590154,null));};exports[_0x7b7e('0x25')]=function(_0x1f9d0f,_0x5cce7c){return db[_0x7b7e('0x2a')][_0x7b7e('0x47')]({'where':{'id':_0x1f9d0f[_0x7b7e('0x45')]['id']}})[_0x7b7e('0x24')](handleEntityNotFound(_0x5cce7c,null))[_0x7b7e('0x24')](removeEntity(_0x5cce7c,null))['catch'](handleError(_0x5cce7c,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index bd04293..f47ce82 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 _0x9bc1=['moment','bluebird','request-promise','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','VoiceTransferReport','report_call_transfer','lodash','util'];(function(_0x384de7,_0x50e853){var _0x2ca4a1=function(_0x43eb2a){while(--_0x43eb2a){_0x384de7['push'](_0x384de7['shift']());}};_0x2ca4a1(++_0x50e853);}(_0x9bc1,0x1c1));var _0x19bc=function(_0x36b8b4,_0x2c2fc8){_0x36b8b4=_0x36b8b4-0x0;var _0x16dda2=_0x9bc1[_0x36b8b4];return _0x16dda2;};'use strict';var _=require(_0x19bc('0x0'));var util=require(_0x19bc('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x19bc('0x2'));var BPromise=require(_0x19bc('0x3'));var rp=require(_0x19bc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x19bc('0x5'));var config=require(_0x19bc('0x6'));var attributes=require(_0x19bc('0x7'));module[_0x19bc('0x8')]=function(_0x2e44a5,_0x481f2c){return _0x2e44a5['define'](_0x19bc('0x9'),attributes,{'tableName':_0x19bc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9626=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','define','VoiceTransferReport','report_call_transfer','lodash','util'];(function(_0x2805d3,_0x353390){var _0x68167b=function(_0xb4e8a3){while(--_0xb4e8a3){_0x2805d3['push'](_0x2805d3['shift']());}};_0x68167b(++_0x353390);}(_0x9626,0x196));var _0x6962=function(_0x1e8e6f,_0x284995){_0x1e8e6f=_0x1e8e6f-0x0;var _0x32a85c=_0x9626[_0x1e8e6f];return _0x32a85c;};'use strict';var _=require(_0x6962('0x0'));var util=require(_0x6962('0x1'));var logger=require(_0x6962('0x2'))('api');var moment=require(_0x6962('0x3'));var BPromise=require('bluebird');var rp=require(_0x6962('0x4'));var fs=require('fs');var path=require(_0x6962('0x5'));var rimraf=require(_0x6962('0x6'));var config=require(_0x6962('0x7'));var attributes=require('./voiceTransferReport.attributes');module[_0x6962('0x8')]=function(_0x4da270,_0x188f79){return _0x4da270[_0x6962('0x9')](_0x6962('0xa'),attributes,{'tableName':_0x6962('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index d608315..615aa73 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 _0x0b42=['CreateVoiceTransferReport','body','options','raw','stringify','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x58ab89,_0xf01b2d){var _0xb93c04=function(_0x29e1b2){while(--_0x29e1b2){_0x58ab89['push'](_0x58ab89['shift']());}};_0xb93c04(++_0xf01b2d);}(_0x0b42,0x92));var _0x20b4=function(_0x193a75,_0x510032){_0x193a75=_0x193a75-0x0;var _0x1ddf39=_0x0b42[_0x193a75];return _0x1ddf39;};'use strict';var _=require('lodash');var util=require(_0x20b4('0x0'));var moment=require('moment');var BPromise=require(_0x20b4('0x1'));var rs=require(_0x20b4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x20b4('0x3'))['db'];var utils=require(_0x20b4('0x4'));var logger=require(_0x20b4('0x5'))(_0x20b4('0x6'));var config=require(_0x20b4('0x7'));var jayson=require(_0x20b4('0x8'));var client=jayson[_0x20b4('0x9')][_0x20b4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5213be,_0x55d09c,_0x38fe7f){return new BPromise(function(_0x1816c2,_0x4c512d){return client[_0x20b4('0xb')](_0x5213be,_0x38fe7f)[_0x20b4('0xc')](function(_0x3ed81b){logger[_0x20b4('0xd')](_0x20b4('0xe'),_0x55d09c,_0x20b4('0xf'));logger[_0x20b4('0x10')](_0x20b4('0x11'),_0x55d09c,_0x20b4('0xf'),JSON['stringify'](_0x3ed81b));if(_0x3ed81b['error']){if(_0x3ed81b[_0x20b4('0x12')][_0x20b4('0x13')]===0x1f4){logger['error'](_0x20b4('0xe'),_0x55d09c,_0x3ed81b[_0x20b4('0x12')][_0x20b4('0x14')]);return _0x4c512d(_0x3ed81b[_0x20b4('0x12')]['message']);}logger['error'](_0x20b4('0xe'),_0x55d09c,_0x3ed81b[_0x20b4('0x12')][_0x20b4('0x14')]);return _0x1816c2(_0x3ed81b[_0x20b4('0x12')]['message']);}else{logger[_0x20b4('0xd')](_0x20b4('0xe'),_0x55d09c,'request\x20sent');_0x1816c2(_0x3ed81b[_0x20b4('0x15')][_0x20b4('0x14')]);}})['catch'](function(_0x3b9f5a){logger[_0x20b4('0x12')](_0x20b4('0xe'),_0x55d09c,_0x3b9f5a);_0x4c512d(_0x3b9f5a);});});}exports[_0x20b4('0x16')]=function(_0x47dab8){var _0x567704=this;return new Promise(function(_0x13d218,_0x307314){return db['VoiceTransferReport']['create'](_0x47dab8[_0x20b4('0x17')],{'raw':_0x47dab8[_0x20b4('0x18')]?_0x47dab8[_0x20b4('0x18')][_0x20b4('0x19')]===undefined?!![]:![]:!![]})[_0x20b4('0xc')](function(_0x32f7aa){logger['info'](_0x20b4('0x16'),_0x47dab8);logger['debug']('CreateVoiceTransferReport',_0x47dab8,JSON[_0x20b4('0x1a')](_0x32f7aa));_0x13d218(_0x32f7aa);})[_0x20b4('0x1b')](function(_0x37735c){logger[_0x20b4('0x12')](_0x20b4('0x16'),_0x37735c[_0x20b4('0x14')],_0x47dab8);_0x307314(_0x567704[_0x20b4('0x12')](0x1f4,_0x37735c[_0x20b4('0x14')]));});});}; \ No newline at end of file +var _0x7079=['error','code','message','result','catch','CreateVoiceTransferReport','create','body','options','raw','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x17e53b,_0x1d0b04){var _0x502952=function(_0xb5a42c){while(--_0xb5a42c){_0x17e53b['push'](_0x17e53b['shift']());}};_0x502952(++_0x1d0b04);}(_0x7079,0x192));var _0x9707=function(_0x1ee80f,_0xaac60e){_0x1ee80f=_0x1ee80f-0x0;var _0x380a84=_0x7079[_0x1ee80f];return _0x380a84;};'use strict';var _=require('lodash');var util=require(_0x9707('0x0'));var moment=require('moment');var BPromise=require(_0x9707('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9707('0x2'));var db=require(_0x9707('0x3'))['db'];var utils=require(_0x9707('0x4'));var logger=require(_0x9707('0x5'))(_0x9707('0x6'));var config=require(_0x9707('0x7'));var jayson=require(_0x9707('0x8'));var client=jayson[_0x9707('0x9')][_0x9707('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x96bb56,_0xb56b6a,_0x378c17){return new BPromise(function(_0x52ecad,_0x2b6cc5){return client[_0x9707('0xb')](_0x96bb56,_0x378c17)['then'](function(_0x1e2eef){logger[_0x9707('0xc')](_0x9707('0xd'),_0xb56b6a,_0x9707('0xe'));logger[_0x9707('0xf')](_0x9707('0x10'),_0xb56b6a,'request\x20sent',JSON[_0x9707('0x11')](_0x1e2eef));if(_0x1e2eef[_0x9707('0x12')]){if(_0x1e2eef['error'][_0x9707('0x13')]===0x1f4){logger['error'](_0x9707('0xd'),_0xb56b6a,_0x1e2eef[_0x9707('0x12')][_0x9707('0x14')]);return _0x2b6cc5(_0x1e2eef['error'][_0x9707('0x14')]);}logger[_0x9707('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0xb56b6a,_0x1e2eef['error'][_0x9707('0x14')]);return _0x52ecad(_0x1e2eef['error'][_0x9707('0x14')]);}else{logger[_0x9707('0xc')](_0x9707('0xd'),_0xb56b6a,_0x9707('0xe'));_0x52ecad(_0x1e2eef[_0x9707('0x15')][_0x9707('0x14')]);}})[_0x9707('0x16')](function(_0x1730b1){logger[_0x9707('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0xb56b6a,_0x1730b1);_0x2b6cc5(_0x1730b1);});});}exports[_0x9707('0x17')]=function(_0x494053){var _0x3e1ec0=this;return new Promise(function(_0x580847,_0x3979b6){return db['VoiceTransferReport'][_0x9707('0x18')](_0x494053[_0x9707('0x19')],{'raw':_0x494053[_0x9707('0x1a')]?_0x494053[_0x9707('0x1a')][_0x9707('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x51c314){logger[_0x9707('0xc')](_0x9707('0x17'),_0x494053);logger[_0x9707('0xf')](_0x9707('0x17'),_0x494053,JSON[_0x9707('0x11')](_0x51c314));_0x580847(_0x51c314);})[_0x9707('0x16')](function(_0x366c12){logger[_0x9707('0x12')]('CreateVoiceTransferReport',_0x366c12[_0x9707('0x14')],_0x494053);_0x3979b6(_0x3e1ec0[_0x9707('0x12')](0x1f4,_0x366c12[_0x9707('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index c60876b..b282c7d 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 _0x57d4=['canUpdate','originate','/hangup','hangup','/answer','/hold','/unhold','unhold','/calls','calls','/transfer','exports','express','Router','./webbar.controller','post','/originate','isAuthenticated'];(function(_0x3af80f,_0x1addb2){var _0x251242=function(_0x57b6b){while(--_0x57b6b){_0x3af80f['push'](_0x3af80f['shift']());}};_0x251242(++_0x1addb2);}(_0x57d4,0x78));var _0x457d=function(_0x2a0ec4,_0x2dc94e){_0x2a0ec4=_0x2a0ec4-0x0;var _0x1d7ecf=_0x57d4[_0x2a0ec4];return _0x1d7ecf;};'use strict';var express=require(_0x457d('0x0'));var router=express[_0x457d('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x457d('0x2'));router[_0x457d('0x3')](_0x457d('0x4'),auth[_0x457d('0x5')](),auth[_0x457d('0x6')](),controller[_0x457d('0x7')]);router[_0x457d('0x3')](_0x457d('0x8'),auth[_0x457d('0x5')](),auth[_0x457d('0x6')](),controller[_0x457d('0x9')]);router['post'](_0x457d('0xa'),auth[_0x457d('0x5')](),auth['canUpdate'](),controller['answer']);router[_0x457d('0x3')](_0x457d('0xb'),auth[_0x457d('0x5')](),auth['canUpdate'](),controller['hold']);router['post'](_0x457d('0xc'),auth[_0x457d('0x5')](),auth[_0x457d('0x6')](),controller[_0x457d('0xd')]);router[_0x457d('0x3')](_0x457d('0xe'),auth[_0x457d('0x5')](),auth[_0x457d('0x6')](),controller[_0x457d('0xf')]);router['post'](_0x457d('0x10'),auth[_0x457d('0x5')](),auth['canUpdate'](),controller['transfer']);module[_0x457d('0x11')]=router; \ No newline at end of file +var _0x097c=['hangup','/hold','hold','/unhold','/calls','calls','/transfer','express','Router','../../components/auth/service','post','/originate','isAuthenticated','canUpdate'];(function(_0x53cad8,_0x61a647){var _0x3f6f88=function(_0x5d3022){while(--_0x5d3022){_0x53cad8['push'](_0x53cad8['shift']());}};_0x3f6f88(++_0x61a647);}(_0x097c,0x1d5));var _0xc097=function(_0x484b79,_0x205f03){_0x484b79=_0x484b79-0x0;var _0x4183bd=_0x097c[_0x484b79];return _0x4183bd;};'use strict';var express=require(_0xc097('0x0'));var router=express[_0xc097('0x1')]();var auth=require(_0xc097('0x2'));var controller=require('./webbar.controller');router[_0xc097('0x3')](_0xc097('0x4'),auth[_0xc097('0x5')](),auth[_0xc097('0x6')](),controller['originate']);router[_0xc097('0x3')]('/hangup',auth[_0xc097('0x5')](),auth[_0xc097('0x6')](),controller[_0xc097('0x7')]);router[_0xc097('0x3')]('/answer',auth[_0xc097('0x5')](),auth['canUpdate'](),controller['answer']);router[_0xc097('0x3')](_0xc097('0x8'),auth[_0xc097('0x5')](),auth[_0xc097('0x6')](),controller[_0xc097('0x9')]);router[_0xc097('0x3')](_0xc097('0xa'),auth[_0xc097('0x5')](),auth[_0xc097('0x6')](),controller['unhold']);router[_0xc097('0x3')](_0xc097('0xb'),auth['isAuthenticated'](),auth[_0xc097('0x6')](),controller[_0xc097('0xc')]);router[_0xc097('0x3')](_0xc097('0xd'),auth[_0xc097('0x5')](),auth[_0xc097('0x6')](),controller['transfer']);module['exports']=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 92442d9..8260a9c 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 _0x70e0=['answer','sessionId','webbar:answer','answer\x20executed!','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','calls','calls\x20fired:','filter','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','bluebird','jayson/promise','client','http','webbarapi','redis','socket.io-emitter','validate','number','userId\x20is\x20required','string','callNumber\x20is\x20required','sessionId\x20is\x20required','info','stringify','emit','handleError:','error','stack','name','status','send','NotFound','request','then','code','message','User','findOne','agent','VoiceChannels','all','rows','UserId','length','sessionId\x20','\x20not\x20found!','originate','body','json','callNumber','callbackUrl','format','webbar:originate','catch','hangup','userId','entityFound:','user:%s','hangup\x20executed!'];(function(_0x1c5703,_0x5da707){var _0x20e6c2=function(_0x34081e){while(--_0x34081e){_0x1c5703['push'](_0x1c5703['shift']());}};_0x20e6c2(++_0x5da707);}(_0x70e0,0x17b));var _0x070e=function(_0x74527d,_0x275464){_0x74527d=_0x74527d-0x0;var _0x104dc0=_0x70e0[_0x74527d];return _0x104dc0;};'use strict';var path=require(_0x070e('0x0'));var fs=require('fs');var _=require(_0x070e('0x1'));var db=require(_0x070e('0x2'))['db'];var config=require('../../config/environment');var util=require('util');var BPromise=require(_0x070e('0x3'));var jayson=require(_0x070e('0x4'));var amiClient=jayson[_0x070e('0x5')][_0x070e('0x6')]({'port':0x232a});var logger=require('../../config/logger')(_0x070e('0x7'));var Redis=require('ioredis');config[_0x070e('0x8')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x070e('0x9'))(new Redis(config[_0x070e('0x8')]));var Schema=require(_0x070e('0xa'));var originateValidation=new Schema({'userId':{'type':_0x070e('0xb'),'required':[!![],_0x070e('0xc')]},'callNumber':{'type':_0x070e('0xd'),'required':[!![],_0x070e('0xe')]},'callerId':{'type':'string'},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0x070e('0xb'),'required':[!![],_0x070e('0xc')]},'sessionId':{'type':_0x070e('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x070e('0xb'),'required':[!![],_0x070e('0xc')]},'sessionId':{'type':_0x070e('0xd'),'required':[!![],_0x070e('0xf')]}});var transferValidation=new Schema({'userId':{'type':_0x070e('0xb'),'required':[!![],_0x070e('0xc')]},'sessionId':{'type':_0x070e('0xd'),'required':[!![],_0x070e('0xf')]},'transferNumber':{'type':'string','required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0x070e('0xb'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x070e('0xc')]},'sessionId':{'type':_0x070e('0xd'),'required':[!![],'sessionId\x20is\x20required']}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0x070e('0xc')]}});var conferenceValidation=new Schema({'userId':{'type':_0x070e('0xb'),'required':[!![],_0x070e('0xc')]}});function emit(_0x19d9da,_0x5bc71e,_0x49861b){logger[_0x070e('0x10')](_0x19d9da,_0x5bc71e,JSON[_0x070e('0x11')](_0x49861b));io['to'](_0x19d9da)[_0x070e('0x12')](_0x5bc71e,_0x49861b);}function handleError(_0x2060cc){return function(_0x364b3f){console['log'](_0x070e('0x13'),_0x364b3f,_0x364b3f instanceof RangeError);logger[_0x070e('0x14')](_0x364b3f[_0x070e('0x15')]);if(_0x364b3f instanceof RangeError){if(_0x364b3f[_0x070e('0x16')]){delete _0x364b3f[_0x070e('0x16')];}_0x2060cc['status'](0x194)['send'](_0x364b3f);}else{if(_0x364b3f['name']){delete _0x364b3f[_0x070e('0x16')];}_0x2060cc[_0x070e('0x17')](0x1f4)[_0x070e('0x18')](_0x364b3f);}};}function checkError(){return function(_0x4be0d7){if(!_0x4be0d7){throw new RangeError(_0x070e('0x19'));}return _0x4be0d7;};}function respondWithRpcPromise(_0x5dc5d2,_0xf8dd5d){return new BPromise(function(_0x3f6985,_0x27a01e){var _0x33e8c6=amiClient;return _0x33e8c6[_0x070e('0x1a')](_0x5dc5d2,_0xf8dd5d)[_0x070e('0x1b')](function(_0xe405e){if(_0xe405e[_0x070e('0x14')]){if(_0xe405e['error'][_0x070e('0x1c')]===0x1f4){return _0x27a01e(_0xe405e[_0x070e('0x14')][_0x070e('0x1d')]);}return _0x3f6985(_0xe405e['error'][_0x070e('0x1d')]);}else{_0x3f6985(_0xe405e['result']);}})['catch'](function(_0x2ccbd7){_0x27a01e(_0x2ccbd7);});});}function getAgent(_0x25f6e){return db[_0x070e('0x1e')][_0x070e('0x1f')]({'where':{'id':_0x25f6e,'role':_0x070e('0x20')}})['then'](checkError());}function getAgentCheckSession(_0x374c54,_0x219e48){return new BPromise(function(_0x1d72d6,_0x1d2a34){var _0x43dd96=respondWithRpcPromise(_0x070e('0x21'));var _0x1a1892=getAgent(_0x374c54);Promise[_0x070e('0x22')]([_0x43dd96,_0x1a1892])['then'](function(_0x282344){var _0x351641=_0x282344[0x0];var _0x3a16d0=_0x282344[0x1];var _0x56fc12=_['filter'](_0x351641[_0x070e('0x23')],function(_0x46065c){return _0x46065c[_0x070e('0x24')]==_0x3a16d0['id']&&_0x46065c['sessionId']==_0x219e48;});if(_0x56fc12[_0x070e('0x25')]==0x1){_0x1d72d6(_0x3a16d0);}else{_0x1d2a34(new RangeError(_0x070e('0x26')+_0x219e48+_0x070e('0x27')));}});});}exports[_0x070e('0x28')]=function(_0x53d473,_0x5bf522){logger['info']('originate\x20fired:',_0x53d473[_0x070e('0x29')]);var _0x4e0a7d=originateValidation[_0x070e('0xa')](_0x53d473[_0x070e('0x29')]);if(_0x4e0a7d['length']>0x0){return _0x5bf522['status'](0x190)[_0x070e('0x2a')](_0x4e0a7d);}var _0x3454c7=_0x53d473['body']['userId'];var _0x41ade4=_0x53d473[_0x070e('0x29')][_0x070e('0x2b')];var _0x31fdc5=_0x53d473[_0x070e('0x29')]['callerId'];var _0x482cc2=_0x53d473[_0x070e('0x29')][_0x070e('0x2c')];return getAgent(_0x3454c7)[_0x070e('0x1b')](function(_0xf57ed){logger[_0x070e('0x10')]('entityFound:',_0xf57ed[_0x070e('0x16')]);emit(util[_0x070e('0x2d')]('user:%s',_0xf57ed[_0x070e('0x16')]),_0x070e('0x2e'),{'callNumber':_0x41ade4,'callerId':_0x31fdc5,'callbackUrl':_0x482cc2});return _0x5bf522['status'](0xc8)['json']({'error':![],'message':'originate\x20executed!'});})[_0x070e('0x2f')](handleError(_0x5bf522));};exports[_0x070e('0x30')]=function(_0x39dfaa,_0x334733){logger[_0x070e('0x10')]('hangup\x20fired:',_0x39dfaa[_0x070e('0x29')]);var _0xa1bb20=hangupValidation[_0x070e('0xa')](_0x39dfaa['body']);if(_0xa1bb20[_0x070e('0x25')]>0x0){return _0x334733[_0x070e('0x17')](0x190)[_0x070e('0x2a')](_0xa1bb20);}var _0x54b72f=_0x39dfaa[_0x070e('0x29')][_0x070e('0x31')];var _0x4800a9=_0x39dfaa[_0x070e('0x29')]['sessionId'];return getAgent(_0x54b72f)[_0x070e('0x1b')](function(_0x146bf6){logger[_0x070e('0x10')](_0x070e('0x32'),_0x146bf6[_0x070e('0x16')]);emit(util['format'](_0x070e('0x33'),_0x146bf6['name']),'webbar:hangup',{'sessionId':_0x4800a9});return _0x334733[_0x070e('0x17')](0xc8)[_0x070e('0x2a')]({'error':![],'message':_0x070e('0x34')});})['catch'](handleError(_0x334733));};exports[_0x070e('0x35')]=function(_0x1223be,_0x556bf3){logger[_0x070e('0x10')]('answer\x20fired:',_0x1223be[_0x070e('0x29')]);var _0x5851ab=answerValidation['validate'](_0x1223be['body']);if(_0x5851ab[_0x070e('0x25')]>0x0){return _0x556bf3[_0x070e('0x17')](0x190)[_0x070e('0x2a')](_0x5851ab);}var _0x29dccd=_0x1223be[_0x070e('0x29')]['userId'];var _0x18607f=_0x1223be['body'][_0x070e('0x36')];return getAgent(_0x29dccd)[_0x070e('0x1b')](function(_0xff760c){logger['info']('entityFound:',_0xff760c[_0x070e('0x16')]);emit(util['format'](_0x070e('0x33'),_0xff760c[_0x070e('0x16')]),_0x070e('0x37'),{'sessionId':_0x18607f});return _0x556bf3['status'](0xc8)[_0x070e('0x2a')]({'error':![],'message':_0x070e('0x38')});})['catch'](handleError(_0x556bf3));};exports['hold']=function(_0x35f302,_0x945901){logger[_0x070e('0x10')](_0x070e('0x39'),_0x35f302[_0x070e('0x29')]);var _0x5500d0=holdValidation[_0x070e('0xa')](_0x35f302[_0x070e('0x29')]);if(_0x5500d0[_0x070e('0x25')]>0x0){return _0x945901[_0x070e('0x17')](0x190)[_0x070e('0x2a')](_0x5500d0);}var _0xcd1c61=_0x35f302[_0x070e('0x29')][_0x070e('0x31')];var _0xd67987=_0x35f302[_0x070e('0x29')][_0x070e('0x36')];return getAgent(_0xcd1c61)[_0x070e('0x1b')](function(_0x5254f8){logger[_0x070e('0x10')](_0x070e('0x32'),_0x5254f8['name']);emit(util[_0x070e('0x2d')](_0x070e('0x33'),_0x5254f8[_0x070e('0x16')]),_0x070e('0x3a'),{'sessionId':_0xd67987});return _0x945901[_0x070e('0x17')](0xc8)[_0x070e('0x2a')]({'error':![],'message':_0x070e('0x3b')});})[_0x070e('0x2f')](handleError(_0x945901));};exports[_0x070e('0x3c')]=function(_0x5744c5,_0x251696){logger['info'](_0x070e('0x3d'),_0x5744c5[_0x070e('0x29')]);var _0x4abbe9=unholdValidation[_0x070e('0xa')](_0x5744c5[_0x070e('0x29')]);if(_0x4abbe9[_0x070e('0x25')]>0x0){return _0x251696[_0x070e('0x17')](0x190)[_0x070e('0x2a')](_0x4abbe9);}var _0x1e8a4f=_0x5744c5[_0x070e('0x29')]['userId'];var _0x296978=_0x5744c5['body']['sessionId'];return getAgent(_0x1e8a4f)[_0x070e('0x1b')](function(_0x3d1b5e){logger[_0x070e('0x10')](_0x070e('0x32'),_0x3d1b5e[_0x070e('0x16')]);emit(util[_0x070e('0x2d')](_0x070e('0x33'),_0x3d1b5e[_0x070e('0x16')]),'webbar:unhold',{'sessionId':_0x296978});return _0x251696[_0x070e('0x17')](0xc8)['json']({'error':![],'message':'unhold\x20executed!'});})[_0x070e('0x2f')](handleError(_0x251696));};exports[_0x070e('0x3e')]=function(_0x589aee,_0x26af08){logger[_0x070e('0x10')](_0x070e('0x3f'),_0x26af08[_0x070e('0x29')]);var _0x1aacfc=callsValidation[_0x070e('0xa')](_0x589aee[_0x070e('0x29')]);if(_0x1aacfc['length']>0x0){return _0x26af08['status'](0x190)['json'](_0x1aacfc);}var _0x3087e5=_0x589aee[_0x070e('0x29')][_0x070e('0x31')];var _0x2f8fcb=respondWithRpcPromise('VoiceChannels');var _0x25f34c=getAgent(_0x3087e5);return Promise['all']([_0x2f8fcb,_0x25f34c])[_0x070e('0x1b')](function(_0x1cbb7e){var _0x476804=_0x1cbb7e[0x0];var _0x24f303=_0x1cbb7e[0x1];var _0x3ab11c=_[_0x070e('0x40')](_0x476804['rows'],function(_0x20ff87){return _0x20ff87[_0x070e('0x24')]==_0x24f303['id'];});return _0x26af08[_0x070e('0x17')](0xc8)['json']({'count':_0x3ab11c[_0x070e('0x25')],'rows':_0x3ab11c});})[_0x070e('0x2f')](handleError(_0x26af08));};exports['conference']=function(_0x1f1df5,_0x4e8dfc){logger[_0x070e('0x10')]('conference\x20fired:',_0x1f1df5['body']);var _0x4b354d=conferenceValidation[_0x070e('0xa')](_0x1f1df5[_0x070e('0x29')]);if(_0x4b354d[_0x070e('0x25')]>0x0){return _0x4e8dfc[_0x070e('0x17')](0x190)[_0x070e('0x2a')](_0x4b354d);}var _0x3a00bb=_0x1f1df5['body'][_0x070e('0x31')];return getAgent(_0x3a00bb)['then'](function(_0xae78a4){logger['info'](_0x070e('0x32'),_0xae78a4[_0x070e('0x16')]);emit(util['format'](_0x070e('0x33'),_0xae78a4['name']),_0x070e('0x41'));return _0x4e8dfc[_0x070e('0x17')](0xc8)[_0x070e('0x2a')]({'error':![],'message':_0x070e('0x42')});})[_0x070e('0x2f')](handleError(_0x4e8dfc));};exports[_0x070e('0x43')]=function(_0x3efd7e,_0x148f1d){logger[_0x070e('0x10')](_0x070e('0x44'),_0x3efd7e[_0x070e('0x29')]);var _0x16887c=transferValidation[_0x070e('0xa')](_0x3efd7e[_0x070e('0x29')]);if(_0x16887c['length']>0x0){return _0x148f1d[_0x070e('0x17')](0x190)[_0x070e('0x2a')](_0x16887c);}var _0x381c83=_0x3efd7e[_0x070e('0x29')]['userId'];var _0x2ccd8d=_0x3efd7e[_0x070e('0x29')][_0x070e('0x36')];var _0x5625a9=_0x3efd7e[_0x070e('0x29')][_0x070e('0x45')];return getAgent(_0x381c83)['then'](function(_0x5251d6){logger[_0x070e('0x10')](_0x070e('0x32'),_0x5251d6[_0x070e('0x16')]);emit(util['format'](_0x070e('0x33'),_0x5251d6['name']),_0x070e('0x46'),{'sessionId':_0x2ccd8d,'transferNumber':_0x5625a9});return _0x148f1d[_0x070e('0x17')](0xc8)[_0x070e('0x2a')]({'error':![],'message':_0x070e('0x47')});})[_0x070e('0x2f')](handleError(_0x148f1d));}; \ No newline at end of file +var _0xd691=['userId\x20is\x20required','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','name','status','send','NotFound','request','then','code','message','result','catch','User','findOne','agent','VoiceChannels','all','rows','UserId','sessionId','length','sessionId\x20','originate\x20fired:','body','json','userId','callerId','entityFound:','format','user:%s','webbar:originate','hangup','hangup\x20fired:','webbar:hangup','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','filter','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','util','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','socket.io-emitter','validate','number'];(function(_0x10d1f8,_0x2d2ad7){var _0x2f6f5d=function(_0x3a18a9){while(--_0x3a18a9){_0x10d1f8['push'](_0x10d1f8['shift']());}};_0x2f6f5d(++_0x2d2ad7);}(_0xd691,0xe6));var _0x1d69=function(_0x38fbc2,_0x641aa1){_0x38fbc2=_0x38fbc2-0x0;var _0x43c7d4=_0xd691[_0x38fbc2];return _0x43c7d4;};'use strict';var path=require(_0x1d69('0x0'));var fs=require('fs');var _=require(_0x1d69('0x1'));var db=require(_0x1d69('0x2'))['db'];var config=require('../../config/environment');var util=require(_0x1d69('0x3'));var BPromise=require(_0x1d69('0x4'));var jayson=require(_0x1d69('0x5'));var amiClient=jayson[_0x1d69('0x6')][_0x1d69('0x7')]({'port':0x232a});var logger=require(_0x1d69('0x8'))(_0x1d69('0x9'));var Redis=require(_0x1d69('0xa'));config[_0x1d69('0xb')]=_[_0x1d69('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x1d69('0xd'))(new Redis(config['redis']));var Schema=require(_0x1d69('0xe'));var originateValidation=new Schema({'userId':{'type':_0x1d69('0xf'),'required':[!![],_0x1d69('0x10')]},'callNumber':{'type':_0x1d69('0x11'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0x1d69('0x11')},'callbackUrl':{'type':_0x1d69('0x11')}});var hangupValidation=new Schema({'userId':{'type':_0x1d69('0xf'),'required':[!![],_0x1d69('0x10')]},'sessionId':{'type':_0x1d69('0x11'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x1d69('0x11'),'required':[!![],_0x1d69('0x12')]}});var transferValidation=new Schema({'userId':{'type':_0x1d69('0xf'),'required':[!![],_0x1d69('0x10')]},'sessionId':{'type':_0x1d69('0x11'),'required':[!![],_0x1d69('0x12')]},'transferNumber':{'type':_0x1d69('0x11'),'required':[!![],_0x1d69('0x13')]}});var holdValidation=new Schema({'userId':{'type':_0x1d69('0xf'),'required':[!![],_0x1d69('0x10')]},'sessionId':{'type':_0x1d69('0x11'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x1d69('0xf'),'required':[!![],_0x1d69('0x10')]},'sessionId':{'type':'string','required':[!![],'sessionId\x20is\x20required']}});var callsValidation=new Schema({'userId':{'type':_0x1d69('0xf'),'required':[!![],_0x1d69('0x10')]}});var conferenceValidation=new Schema({'userId':{'type':_0x1d69('0xf'),'required':[!![],_0x1d69('0x10')]}});function emit(_0x3ec720,_0x383771,_0x5af8c6){logger[_0x1d69('0x14')](_0x3ec720,_0x383771,JSON[_0x1d69('0x15')](_0x5af8c6));io['to'](_0x3ec720)[_0x1d69('0x16')](_0x383771,_0x5af8c6);}function handleError(_0x53915f){return function(_0x4cebea){console[_0x1d69('0x17')](_0x1d69('0x18'),_0x4cebea,_0x4cebea instanceof RangeError);logger[_0x1d69('0x19')](_0x4cebea['stack']);if(_0x4cebea instanceof RangeError){if(_0x4cebea[_0x1d69('0x1a')]){delete _0x4cebea[_0x1d69('0x1a')];}_0x53915f[_0x1d69('0x1b')](0x194)[_0x1d69('0x1c')](_0x4cebea);}else{if(_0x4cebea[_0x1d69('0x1a')]){delete _0x4cebea[_0x1d69('0x1a')];}_0x53915f[_0x1d69('0x1b')](0x1f4)[_0x1d69('0x1c')](_0x4cebea);}};}function checkError(){return function(_0x5c90eb){if(!_0x5c90eb){throw new RangeError(_0x1d69('0x1d'));}return _0x5c90eb;};}function respondWithRpcPromise(_0x122238,_0x1786e1){return new BPromise(function(_0x228d18,_0x5807d5){var _0x3e38cd=amiClient;return _0x3e38cd[_0x1d69('0x1e')](_0x122238,_0x1786e1)[_0x1d69('0x1f')](function(_0x54783d){if(_0x54783d['error']){if(_0x54783d['error'][_0x1d69('0x20')]===0x1f4){return _0x5807d5(_0x54783d[_0x1d69('0x19')][_0x1d69('0x21')]);}return _0x228d18(_0x54783d[_0x1d69('0x19')]['message']);}else{_0x228d18(_0x54783d[_0x1d69('0x22')]);}})[_0x1d69('0x23')](function(_0x51e91b){_0x5807d5(_0x51e91b);});});}function getAgent(_0x377913){return db[_0x1d69('0x24')][_0x1d69('0x25')]({'where':{'id':_0x377913,'role':_0x1d69('0x26')}})[_0x1d69('0x1f')](checkError());}function getAgentCheckSession(_0x247130,_0x5cca6a){return new BPromise(function(_0x23043c,_0x2c837e){var _0x3c6b2b=respondWithRpcPromise(_0x1d69('0x27'));var _0x3c0962=getAgent(_0x247130);Promise[_0x1d69('0x28')]([_0x3c6b2b,_0x3c0962])[_0x1d69('0x1f')](function(_0x215052){var _0x156825=_0x215052[0x0];var _0x15fa6e=_0x215052[0x1];var _0x2e3a8b=_['filter'](_0x156825[_0x1d69('0x29')],function(_0x5bbbe3){return _0x5bbbe3[_0x1d69('0x2a')]==_0x15fa6e['id']&&_0x5bbbe3[_0x1d69('0x2b')]==_0x5cca6a;});if(_0x2e3a8b[_0x1d69('0x2c')]==0x1){_0x23043c(_0x15fa6e);}else{_0x2c837e(new RangeError(_0x1d69('0x2d')+_0x5cca6a+'\x20not\x20found!'));}});});}exports['originate']=function(_0x2ac88d,_0x4f357e){logger[_0x1d69('0x14')](_0x1d69('0x2e'),_0x2ac88d[_0x1d69('0x2f')]);var _0x2d9698=originateValidation[_0x1d69('0xe')](_0x2ac88d[_0x1d69('0x2f')]);if(_0x2d9698[_0x1d69('0x2c')]>0x0){return _0x4f357e[_0x1d69('0x1b')](0x190)[_0x1d69('0x30')](_0x2d9698);}var _0x425a1a=_0x2ac88d[_0x1d69('0x2f')][_0x1d69('0x31')];var _0x224c10=_0x2ac88d[_0x1d69('0x2f')]['callNumber'];var _0x453b6c=_0x2ac88d[_0x1d69('0x2f')][_0x1d69('0x32')];var _0x35d90c=_0x2ac88d[_0x1d69('0x2f')]['callbackUrl'];return getAgent(_0x425a1a)[_0x1d69('0x1f')](function(_0x234f3f){logger[_0x1d69('0x14')](_0x1d69('0x33'),_0x234f3f['name']);emit(util[_0x1d69('0x34')](_0x1d69('0x35'),_0x234f3f[_0x1d69('0x1a')]),_0x1d69('0x36'),{'callNumber':_0x224c10,'callerId':_0x453b6c,'callbackUrl':_0x35d90c});return _0x4f357e[_0x1d69('0x1b')](0xc8)['json']({'error':![],'message':'originate\x20executed!'});})['catch'](handleError(_0x4f357e));};exports[_0x1d69('0x37')]=function(_0x232ddd,_0x5c8d79){logger[_0x1d69('0x14')](_0x1d69('0x38'),_0x232ddd[_0x1d69('0x2f')]);var _0x497e02=hangupValidation[_0x1d69('0xe')](_0x232ddd[_0x1d69('0x2f')]);if(_0x497e02[_0x1d69('0x2c')]>0x0){return _0x5c8d79[_0x1d69('0x1b')](0x190)['json'](_0x497e02);}var _0x42abeb=_0x232ddd[_0x1d69('0x2f')][_0x1d69('0x31')];var _0x3c09bb=_0x232ddd['body'][_0x1d69('0x2b')];return getAgent(_0x42abeb)[_0x1d69('0x1f')](function(_0x1667fa){logger[_0x1d69('0x14')](_0x1d69('0x33'),_0x1667fa[_0x1d69('0x1a')]);emit(util[_0x1d69('0x34')]('user:%s',_0x1667fa[_0x1d69('0x1a')]),_0x1d69('0x39'),{'sessionId':_0x3c09bb});return _0x5c8d79['status'](0xc8)[_0x1d69('0x30')]({'error':![],'message':'hangup\x20executed!'});})[_0x1d69('0x23')](handleError(_0x5c8d79));};exports[_0x1d69('0x3a')]=function(_0x437264,_0xc052d6){logger['info'](_0x1d69('0x3b'),_0x437264[_0x1d69('0x2f')]);var _0xa01974=answerValidation['validate'](_0x437264[_0x1d69('0x2f')]);if(_0xa01974['length']>0x0){return _0xc052d6['status'](0x190)[_0x1d69('0x30')](_0xa01974);}var _0x3862c1=_0x437264['body'][_0x1d69('0x31')];var _0x5010e5=_0x437264[_0x1d69('0x2f')][_0x1d69('0x2b')];return getAgent(_0x3862c1)['then'](function(_0x3c57ba){logger[_0x1d69('0x14')](_0x1d69('0x33'),_0x3c57ba['name']);emit(util[_0x1d69('0x34')](_0x1d69('0x35'),_0x3c57ba[_0x1d69('0x1a')]),_0x1d69('0x3c'),{'sessionId':_0x5010e5});return _0xc052d6[_0x1d69('0x1b')](0xc8)[_0x1d69('0x30')]({'error':![],'message':_0x1d69('0x3d')});})[_0x1d69('0x23')](handleError(_0xc052d6));};exports[_0x1d69('0x3e')]=function(_0x13612a,_0x44d13b){logger[_0x1d69('0x14')](_0x1d69('0x3f'),_0x13612a[_0x1d69('0x2f')]);var _0xfd262c=holdValidation[_0x1d69('0xe')](_0x13612a['body']);if(_0xfd262c[_0x1d69('0x2c')]>0x0){return _0x44d13b[_0x1d69('0x1b')](0x190)[_0x1d69('0x30')](_0xfd262c);}var _0x58951a=_0x13612a['body'][_0x1d69('0x31')];var _0x52556c=_0x13612a[_0x1d69('0x2f')][_0x1d69('0x2b')];return getAgent(_0x58951a)[_0x1d69('0x1f')](function(_0x5185bb){logger['info'](_0x1d69('0x33'),_0x5185bb['name']);emit(util[_0x1d69('0x34')]('user:%s',_0x5185bb['name']),_0x1d69('0x40'),{'sessionId':_0x52556c});return _0x44d13b[_0x1d69('0x1b')](0xc8)[_0x1d69('0x30')]({'error':![],'message':_0x1d69('0x41')});})[_0x1d69('0x23')](handleError(_0x44d13b));};exports[_0x1d69('0x42')]=function(_0x3f0092,_0x3ebee9){logger['info'](_0x1d69('0x43'),_0x3f0092[_0x1d69('0x2f')]);var _0x184ca4=unholdValidation[_0x1d69('0xe')](_0x3f0092['body']);if(_0x184ca4[_0x1d69('0x2c')]>0x0){return _0x3ebee9['status'](0x190)[_0x1d69('0x30')](_0x184ca4);}var _0x321e38=_0x3f0092[_0x1d69('0x2f')]['userId'];var _0x29d058=_0x3f0092['body'][_0x1d69('0x2b')];return getAgent(_0x321e38)[_0x1d69('0x1f')](function(_0x3e9e41){logger['info'](_0x1d69('0x33'),_0x3e9e41['name']);emit(util[_0x1d69('0x34')](_0x1d69('0x35'),_0x3e9e41[_0x1d69('0x1a')]),_0x1d69('0x44'),{'sessionId':_0x29d058});return _0x3ebee9[_0x1d69('0x1b')](0xc8)[_0x1d69('0x30')]({'error':![],'message':_0x1d69('0x45')});})[_0x1d69('0x23')](handleError(_0x3ebee9));};exports[_0x1d69('0x46')]=function(_0x3c6c27,_0x32170c){logger[_0x1d69('0x14')](_0x1d69('0x47'),_0x32170c[_0x1d69('0x2f')]);var _0xc97711=callsValidation[_0x1d69('0xe')](_0x3c6c27[_0x1d69('0x2f')]);if(_0xc97711['length']>0x0){return _0x32170c[_0x1d69('0x1b')](0x190)[_0x1d69('0x30')](_0xc97711);}var _0x568410=_0x3c6c27[_0x1d69('0x2f')]['userId'];var _0x3b26c6=respondWithRpcPromise(_0x1d69('0x27'));var _0x54128e=getAgent(_0x568410);return Promise['all']([_0x3b26c6,_0x54128e])[_0x1d69('0x1f')](function(_0x3b705d){var _0x329076=_0x3b705d[0x0];var _0x5d74da=_0x3b705d[0x1];var _0x583551=_[_0x1d69('0x48')](_0x329076[_0x1d69('0x29')],function(_0x3c2949){return _0x3c2949[_0x1d69('0x2a')]==_0x5d74da['id'];});return _0x32170c[_0x1d69('0x1b')](0xc8)[_0x1d69('0x30')]({'count':_0x583551[_0x1d69('0x2c')],'rows':_0x583551});})[_0x1d69('0x23')](handleError(_0x32170c));};exports[_0x1d69('0x49')]=function(_0x13100f,_0x2ce8be){logger[_0x1d69('0x14')](_0x1d69('0x4a'),_0x13100f['body']);var _0x3a9137=conferenceValidation[_0x1d69('0xe')](_0x13100f[_0x1d69('0x2f')]);if(_0x3a9137['length']>0x0){return _0x2ce8be[_0x1d69('0x1b')](0x190)[_0x1d69('0x30')](_0x3a9137);}var _0x3691c7=_0x13100f[_0x1d69('0x2f')][_0x1d69('0x31')];return getAgent(_0x3691c7)[_0x1d69('0x1f')](function(_0xffa8b7){logger[_0x1d69('0x14')](_0x1d69('0x33'),_0xffa8b7[_0x1d69('0x1a')]);emit(util[_0x1d69('0x34')](_0x1d69('0x35'),_0xffa8b7[_0x1d69('0x1a')]),_0x1d69('0x4b'));return _0x2ce8be[_0x1d69('0x1b')](0xc8)['json']({'error':![],'message':_0x1d69('0x4c')});})[_0x1d69('0x23')](handleError(_0x2ce8be));};exports[_0x1d69('0x4d')]=function(_0x1e6800,_0x33baff){logger['info'](_0x1d69('0x4e'),_0x1e6800[_0x1d69('0x2f')]);var _0x34c03a=transferValidation['validate'](_0x1e6800[_0x1d69('0x2f')]);if(_0x34c03a[_0x1d69('0x2c')]>0x0){return _0x33baff[_0x1d69('0x1b')](0x190)['json'](_0x34c03a);}var _0x9d5a28=_0x1e6800[_0x1d69('0x2f')]['userId'];var _0x7981fe=_0x1e6800['body']['sessionId'];var _0x63dab7=_0x1e6800['body'][_0x1d69('0x4f')];return getAgent(_0x9d5a28)['then'](function(_0x41f48a){logger[_0x1d69('0x14')](_0x1d69('0x33'),_0x41f48a[_0x1d69('0x1a')]);emit(util[_0x1d69('0x34')](_0x1d69('0x35'),_0x41f48a['name']),_0x1d69('0x50'),{'sessionId':_0x7981fe,'transferNumber':_0x63dab7});return _0x33baff['status'](0xc8)[_0x1d69('0x30')]({'error':![],'message':_0x1d69('0x51')});})[_0x1d69('0x23')](handleError(_0x33baff));}; \ No newline at end of file diff --git a/server/app.js b/server/app.js index 11b0a06..83ea633 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9834=['start','online','name','join','Offline\x20apps:','filter','status','None','seedDB','./config/seedDB','./config/license','default','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./mysqldb','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','sequelize','sync','then','info'];(function(_0x4e82f8,_0x40cd29){var _0x1dbf4e=function(_0x563ce0){while(--_0x563ce0){_0x4e82f8['push'](_0x4e82f8['shift']());}};_0x1dbf4e(++_0x40cd29);}(_0x9834,0x17b));var _0x4983=function(_0x5d96af,_0x487a53){_0x5d96af=_0x5d96af-0x0;var _0x38256c=_0x9834[_0x5d96af];return _0x38256c;};'use strict';var _=require(_0x4983('0x0'));var mysqldb=require(_0x4983('0x1'));var rpc=require('./rpc');var config=require('./config/environment');var logger=require(_0x4983('0x2'))(_0x4983('0x3'));var pm2=require(_0x4983('0x4'));var pm2Config=require(_0x4983('0x5'));var schedule=require(_0x4983('0x6'));var chat=require('./config/schedule/chat');function main(){return mysqldb['db'][_0x4983('0x7')][_0x4983('0x8')]()[_0x4983('0x9')](function(){return rpc['listen']();})[_0x4983('0x9')](function(_0x293f8c){logger[_0x4983('0xa')](_0x293f8c);return chat[_0x4983('0xb')]();})[_0x4983('0x9')](function(){return schedule[_0x4983('0xb')]();})[_0x4983('0x9')](function(_0x44439f){logger[_0x4983('0xa')](_0x44439f);return pm2['start'](pm2Config);})['then'](function(_0x454cba){logger[_0x4983('0xa')]('Online\x20apps:',_['map'](_['filter'](_0x454cba,{'status':_0x4983('0xc')}),_0x4983('0xd'))[_0x4983('0xe')]());logger['info'](_0x4983('0xf'),_['map'](_[_0x4983('0x10')](_0x454cba,function(_0x2d68ba){return _0x2d68ba[_0x4983('0x11')]!==_0x4983('0xc');}),_0x4983('0xd'))[_0x4983('0xe')]()||_0x4983('0x12'));config[_0x4983('0x13')]&&require(_0x4983('0x14'))['default']();require(_0x4983('0x15'))[_0x4983('0x16')]();})[_0x4983('0x17')](function(_0x232b9c){logger[_0x4983('0x18')](_0x4983('0x19'),_0x232b9c);process['exit'](0x1);});}main(); \ No newline at end of file +var _0x94d2=['sequelize','sync','listen','then','info','start','Online\x20apps:','join','Offline\x20apps:','map','filter','status','online','None','./config/seedDB','default','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./mysqldb','./rpc','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule'];(function(_0x188b10,_0x4324ca){var _0x32f60a=function(_0x58f00e){while(--_0x58f00e){_0x188b10['push'](_0x188b10['shift']());}};_0x32f60a(++_0x4324ca);}(_0x94d2,0x130));var _0x294d=function(_0x4382bc,_0x231a2d){_0x4382bc=_0x4382bc-0x0;var _0x13c82a=_0x94d2[_0x4382bc];return _0x13c82a;};'use strict';var _=require(_0x294d('0x0'));var mysqldb=require(_0x294d('0x1'));var rpc=require(_0x294d('0x2'));var config=require('./config/environment');var logger=require(_0x294d('0x3'))(_0x294d('0x4'));var pm2=require(_0x294d('0x5'));var pm2Config=require(_0x294d('0x6'));var schedule=require(_0x294d('0x7'));var chat=require('./config/schedule/chat');function main(){return mysqldb['db'][_0x294d('0x8')][_0x294d('0x9')]()['then'](function(){return rpc[_0x294d('0xa')]();})[_0x294d('0xb')](function(_0x13e8d6){logger[_0x294d('0xc')](_0x13e8d6);return chat['start']();})[_0x294d('0xb')](function(){return schedule[_0x294d('0xd')]();})[_0x294d('0xb')](function(_0x3a00de){logger[_0x294d('0xc')](_0x3a00de);return pm2[_0x294d('0xd')](pm2Config);})['then'](function(_0x421c76){logger[_0x294d('0xc')](_0x294d('0xe'),_['map'](_['filter'](_0x421c76,{'status':'online'}),'name')[_0x294d('0xf')]());logger[_0x294d('0xc')](_0x294d('0x10'),_[_0x294d('0x11')](_[_0x294d('0x12')](_0x421c76,function(_0x50f8d8){return _0x50f8d8[_0x294d('0x13')]!==_0x294d('0x14');}),'name')[_0x294d('0xf')]()||_0x294d('0x15'));config['seedDB']&&require(_0x294d('0x16'))[_0x294d('0x17')]();require('./config/license')[_0x294d('0x17')]();})[_0x294d('0x18')](function(_0x147590){logger['error'](_0x294d('0x19'),_0x147590);process['exit'](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 3f8c243..8b66eda 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 _0xc03e=['alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','isChatInteractionAuthorized','isAuthenticated','use','ChatInteraction','params','then','closed','status','unmanaged','disposition','Unmanaged.','Forbidden.','catch','headers','authorization','startsWith','Basic','User','find','pass','json','Wrong\x20credentials.','user','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','../../config/license/util','getLicense','update','Forbidden','isMiddleware','motion.token','redirect','/dashboards/general','send','retrieveApiKey','apiKeyNonce','isNil','apiKeyIat','generateApiKey','regenerateApiKey','promisify','sign','secret','payload','randomBytes','toString','floor','now','HS512','../../mysqldb','lodash','express-jwt','basic-auth','crypto','bluebird','secrets','session','role','fullname','name','internal','userpic','permissions','md5secret','voicePause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','allowmessenger','passwordResetAt'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xc03e,0x15a));var _0xec03=function(_0xca8958,_0x25eed8){_0xca8958=_0xca8958-0x0;var _0x3d7165=_0xc03e[_0xca8958];return _0x3d7165;};'use strict';var db=require(_0xec03('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require('../../config/license/hardware');var _=require(_0xec03('0x1'));var jwt=require('jsonwebtoken');var expressJwt=require(_0xec03('0x2'));var compose=require('composable-middleware');var basicAuth=require(_0xec03('0x3'));var crypto=require(_0xec03('0x4'));var BPromise=require(_0xec03('0x5'));var validateJwt=expressJwt({'secret':config[_0xec03('0x6')][_0xec03('0x7')]});var userAttributes=['id',_0xec03('0x8'),_0xec03('0x9'),_0xec03('0xa'),_0xec03('0xb'),'email',_0xec03('0xc'),_0xec03('0xd'),_0xec03('0xe'),_0xec03('0xf'),'chatPause',_0xec03('0x10'),_0xec03('0x11'),_0xec03('0x12'),_0xec03('0x13'),_0xec03('0x14'),_0xec03('0x15'),_0xec03('0x16'),_0xec03('0x17'),'crudPermissions',_0xec03('0x18'),_0xec03('0x19'),_0xec03('0x1a'),_0xec03('0x1b'),_0xec03('0x1c'),_0xec03('0x1d'),_0xec03('0x1e'),_0xec03('0x1f'),'phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl',_0xec03('0x20'),_0xec03('0x21'),_0xec03('0x22'),_0xec03('0x23')];exports[_0xec03('0x24')]=function(){return this[_0xec03('0x25')](!![])[_0xec03('0x26')](function(_0x1d1b45,_0x5c2f1a,_0x1fae17){if(_0x1d1b45['user']){_0x1fae17();}else{return db[_0xec03('0x27')]['findOne']({'where':{'id':_0x1d1b45[_0xec03('0x28')]['id']},'attributes':['id','closed','disposition'],'raw':!![]})[_0xec03('0x29')](function(_0x327167){if(_0x327167&&_0x327167[_0xec03('0x2a')]){return _0x5c2f1a[_0xec03('0x2b')](_0x327167['disposition']===_0xec03('0x2c')?0x195:0x193)['json']({'message':_0x327167[_0xec03('0x2d')]===_0xec03('0x2c')?_0xec03('0x2e'):_0xec03('0x2f')});}else{_0x1fae17();}})[_0xec03('0x30')](function(_0x41b729){_0x1fae17(_0x41b729);});}});};exports[_0xec03('0x25')]=function isAuthenticated(_0x3b6ddf){return compose()['use'](function(_0x205fc9,_0x568c36,_0xa16d53){if(_0x205fc9[_0xec03('0x31')][_0xec03('0x32')]){if(_[_0xec03('0x33')](_0x205fc9['headers'][_0xec03('0x32')],_0xec03('0x34'))){var _0x4f35c9=basicAuth(_0x205fc9);db[_0xec03('0x35')][_0xec03('0x36')]({'where':{'name':_0x4f35c9[_0xec03('0xa')]}})[_0xec03('0x29')](function(_0x1c6870){if(!_0x1c6870||!_0x1c6870['authenticate'](_0x4f35c9[_0xec03('0x37')])){return _0x568c36[_0xec03('0x2b')](0x191)[_0xec03('0x38')]({'message':_0xec03('0x39')});}_0x205fc9[_0xec03('0x3a')]={'id':_0x1c6870['id']};_0xa16d53();})['catch'](function(_0x15cb11){_0xa16d53(_0x15cb11);});}else if(_[_0xec03('0x33')](_0x205fc9['headers']['authorization'],_0xec03('0x3b'))){validateJwt(_0x205fc9,_0x568c36,_0xa16d53);}else{if(_0x3b6ddf){_0xa16d53();}else{return _0x568c36[_0xec03('0x2b')](0x193)[_0xec03('0x38')]({'message':_0xec03('0x3c')});}}}else if(_0x205fc9[_0xec03('0x3d')][_0xec03('0x3e')]){var _0xda963b={'audience':hardwareConf[_0xec03('0x3f')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x205fc9[_0xec03('0x3d')][_0xec03('0x3e')],_0xda963b)[_0xec03('0x29')](function(_0x145a13){return db[_0xec03('0x35')][_0xec03('0x36')]({'where':{'id':_0x145a13[_0xec03('0x40')]}})[_0xec03('0x29')](function(_0x159875){if(!_0x159875||!_['isEqual'](_0x159875['apiKeyNonce'],_0x145a13['nonce'])){return _0x568c36[_0xec03('0x2b')](0x193)[_0xec03('0x38')]({'message':_0xec03('0x41')});}_0x205fc9[_0xec03('0x3a')]={'id':_0x159875['id']};_0xa16d53();});})['catch'](function(_0x576d5e){_0xa16d53(_0x576d5e);});}else if(_0x3b6ddf){_0xa16d53();}else{return _0x568c36['status'](0x193)['json']({'message':_0xec03('0x3c')});}})[_0xec03('0x26')](function(_0x320ca7,_0x3756db,_0x11c75b){if(_0x320ca7[_0xec03('0x3a')]){db[_0xec03('0x35')][_0xec03('0x36')]({'where':{'id':_0x320ca7[_0xec03('0x3a')]['id']},'attributes':userAttributes})[_0xec03('0x29')](function(_0x46f163){if(!_0x46f163){return _0x3756db[_0xec03('0x2b')](0x194)['json']({'message':_0xec03('0x42')});}_0x320ca7[_0xec03('0x3a')]=_0x46f163;_0x11c75b();})[_0xec03('0x30')](function(_0x5558d4){_0x11c75b(_0x5558d4);});}else if(_0x3b6ddf){_0x11c75b();}else{return _0x3756db[_0xec03('0x2b')](0x194)[_0xec03('0x38')]({'message':_0xec03('0x43')});}});};exports[_0xec03('0x44')]=function canUpdate(){return compose()[_0xec03('0x26')](function(_0x3618f8,_0x124324,_0x3c55b7){return require(_0xec03('0x45'))[_0xec03('0x46')]()[_0xec03('0x29')](function(_0x4c8dc5){if(_0x4c8dc5[_0xec03('0x47')]){_0x3c55b7();}else{return _0x124324[_0xec03('0x2b')](0x193)[_0xec03('0x38')]({'message':_0xec03('0x48')});}})[_0xec03('0x30')](function(_0x750733){_0x3c55b7(_0x750733);});});};exports[_0xec03('0x49')]=function(_0xa95d46,_0x4f95c9,_0x454e91){_0xa95d46['isMiddleware']=!![];return _0x454e91();};exports['signToken']=function signToken(_0x1c2d46){return signJwt(_0x1c2d46);};exports['setTokenCookie']=function(_0x548b81,_0x312d0b){if(!_0x548b81[_0xec03('0x3a')]){return _0x312d0b['status'](0x194)[_0xec03('0x38')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x4d1b34={'payload':{'id':_0x548b81['user']['id'],'role':_0x548b81[_0xec03('0x3a')][_0xec03('0x8')]},'options':{'expiresIn':0x15180}};return signJwt(_0x4d1b34)[_0xec03('0x29')](function(_0xf3d24e){_0x312d0b['cookie'](_0xec03('0x4a'),_0xf3d24e);_0x312d0b[_0xec03('0x4b')](_0xec03('0x4c'));})[_0xec03('0x30')](function(_0x5f9bb6){return _0x312d0b[_0xec03('0x2b')](0x1f4)[_0xec03('0x4d')](_0x5f9bb6);});};exports[_0xec03('0x4e')]=function(_0x11d8dd){if(_['isNil'](_0x11d8dd[_0xec03('0x4f')])||_[_0xec03('0x50')](_0x11d8dd[_0xec03('0x51')])){return null;}else{return createJwt(_0x11d8dd);}};exports[_0xec03('0x52')]=function(_0x5b1701){_0x5b1701[_0xec03('0x4f')]=generateNonce();_0x5b1701[_0xec03('0x51')]=generateIssuedAt();return createJwt(_0x5b1701);};exports[_0xec03('0x53')]=function(_0xfdadb1,_0x25d241){var _0x2191ef=_0xfdadb1['query']['apikey'];if(_0x2191ef){var _0x1eaf7d={'nonce':_0x25d241[_0xec03('0x4f')],'iat':_0x25d241[_0xec03('0x51')],'audience':hardwareConf[_0xec03('0x3f')](),'issuer':hardwareConf[_0xec03('0x3f')]()};return verifyJwt(_0x2191ef,_0x1eaf7d)['then'](function(){return generateApiKey(_0x25d241);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};function signJwt(_0x2de04f){var _0x561d0f=BPromise[_0xec03('0x54')](jwt[_0xec03('0x55')],{'context':jwt});var _0x1a3a8d=_0x2de04f[_0xec03('0x56')]||config['secrets'][_0xec03('0x7')];return new BPromise(function(_0x14a61c,_0x3c7e18){_0x561d0f(_0x2de04f[_0xec03('0x57')],_0x1a3a8d,_0x2de04f['options'])[_0xec03('0x29')](function(_0x4ff827){_0x14a61c(_0x4ff827);})[_0xec03('0x30')](function(_0x4073ad){_0x3c7e18(_0x4073ad);});});}function verifyJwt(_0xdb9a99,_0x1c6b87,_0x2eba66){var _0x15fe1d=BPromise[_0xec03('0x54')](jwt['verify'],{'context':jwt});var _0x321e6e=_0x2eba66||config[_0xec03('0x6')][_0xec03('0x7')];return new BPromise(function(_0x107bae,_0x53a51e){_0x15fe1d(_0xdb9a99,_0x321e6e,_0x1c6b87)[_0xec03('0x29')](function(_0x4dc234){_0x107bae(_0x4dc234);})[_0xec03('0x30')](function(_0x3825f9){_0x53a51e(_0x3825f9);});});}function generateNonce(){return crypto[_0xec03('0x58')](0x10)[_0xec03('0x59')]('hex');}function generateIssuedAt(){return Math[_0xec03('0x5a')](Date[_0xec03('0x5b')]()/0x3e8)[_0xec03('0x59')]();}function createJwt(_0x527287){var _0x32a5af={'payload':{'iat':_0x527287['apiKeyIat'],'nonce':_0x527287[_0xec03('0x4f')]},'options':{'algorithm':_0xec03('0x5c'),'subject':_0x527287['id'][_0xec03('0x59')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x32a5af)[_0xec03('0x29')](function(_0x3932ba){return{'iat':_0x527287[_0xec03('0x51')],'nonce':_0x527287[_0xec03('0x4f')],'token':_0x3932ba};});} \ No newline at end of file +var _0x7579=['bluebird','secrets','role','fullname','name','email','permissions','md5secret','voicePause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','isChatInteractionAuthorized','use','user','ChatInteraction','params','closed','disposition','then','status','unmanaged','Unmanaged.','Forbidden.','catch','authorization','startsWith','Basic','User','find','authenticate','Wrong\x20credentials.','headers','Bearer','json','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','../../config/license/util','update','isMiddleware','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','secret','payload','options','promisify','verify','session','randomBytes','hex','floor','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','lodash','jsonwebtoken','express-jwt','basic-auth','crypto'];(function(_0x5d4182,_0xa553d5){var _0x5e7cc7=function(_0x116b0a){while(--_0x116b0a){_0x5d4182['push'](_0x5d4182['shift']());}};_0x5e7cc7(++_0xa553d5);}(_0x7579,0x1e2));var _0x9757=function(_0x1fb3a7,_0x41fe14){_0x1fb3a7=_0x1fb3a7-0x0;var _0x117e62=_0x7579[_0x1fb3a7];return _0x117e62;};'use strict';var db=require(_0x9757('0x0'))['db'];var config=require(_0x9757('0x1'));var hardwareConf=require(_0x9757('0x2'));var _=require(_0x9757('0x3'));var jwt=require(_0x9757('0x4'));var expressJwt=require(_0x9757('0x5'));var compose=require('composable-middleware');var basicAuth=require(_0x9757('0x6'));var crypto=require(_0x9757('0x7'));var BPromise=require(_0x9757('0x8'));var validateJwt=expressJwt({'secret':config[_0x9757('0x9')]['session']});var userAttributes=['id',_0x9757('0xa'),_0x9757('0xb'),_0x9757('0xc'),'internal',_0x9757('0xd'),'userpic',_0x9757('0xe'),_0x9757('0xf'),_0x9757('0x10'),'chatPause',_0x9757('0x11'),_0x9757('0x12'),_0x9757('0x13'),_0x9757('0x14'),_0x9757('0x15'),_0x9757('0x16'),_0x9757('0x17'),_0x9757('0x18'),_0x9757('0x19'),_0x9757('0x1a'),_0x9757('0x1b'),'alias',_0x9757('0x1c'),_0x9757('0x1d'),_0x9757('0x1e'),'phoneBarEnableDtmfTone',_0x9757('0x1f'),_0x9757('0x20'),_0x9757('0x21'),_0x9757('0x22'),_0x9757('0x23'),_0x9757('0x24'),_0x9757('0x25'),'userProfileId'];exports[_0x9757('0x26')]=function(){return this['isAuthenticated'](!![])[_0x9757('0x27')](function(_0xcc8f94,_0xad2a22,_0x1e4000){if(_0xcc8f94[_0x9757('0x28')]){_0x1e4000();}else{return db[_0x9757('0x29')]['findOne']({'where':{'id':_0xcc8f94[_0x9757('0x2a')]['id']},'attributes':['id',_0x9757('0x2b'),_0x9757('0x2c')],'raw':!![]})[_0x9757('0x2d')](function(_0x3716de){if(_0x3716de&&_0x3716de[_0x9757('0x2b')]){return _0xad2a22[_0x9757('0x2e')](_0x3716de['disposition']===_0x9757('0x2f')?0x195:0x193)['json']({'message':_0x3716de['disposition']===_0x9757('0x2f')?_0x9757('0x30'):_0x9757('0x31')});}else{_0x1e4000();}})[_0x9757('0x32')](function(_0x559135){_0x1e4000(_0x559135);});}});};exports['isAuthenticated']=function isAuthenticated(_0x53d21c){return compose()[_0x9757('0x27')](function(_0x32054f,_0x3bec93,_0x21435e){if(_0x32054f['headers'][_0x9757('0x33')]){if(_[_0x9757('0x34')](_0x32054f['headers'][_0x9757('0x33')],_0x9757('0x35'))){var _0x58caa8=basicAuth(_0x32054f);db[_0x9757('0x36')][_0x9757('0x37')]({'where':{'name':_0x58caa8[_0x9757('0xc')]}})[_0x9757('0x2d')](function(_0x115e33){if(!_0x115e33||!_0x115e33[_0x9757('0x38')](_0x58caa8['pass'])){return _0x3bec93[_0x9757('0x2e')](0x191)['json']({'message':_0x9757('0x39')});}_0x32054f[_0x9757('0x28')]={'id':_0x115e33['id']};_0x21435e();})['catch'](function(_0x490e10){_0x21435e(_0x490e10);});}else if(_[_0x9757('0x34')](_0x32054f[_0x9757('0x3a')][_0x9757('0x33')],_0x9757('0x3b'))){validateJwt(_0x32054f,_0x3bec93,_0x21435e);}else{if(_0x53d21c){_0x21435e();}else{return _0x3bec93['status'](0x193)[_0x9757('0x3c')]({'message':_0x9757('0x3d')});}}}else if(_0x32054f[_0x9757('0x3e')][_0x9757('0x3f')]){var _0x815c25={'audience':hardwareConf[_0x9757('0x40')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x32054f[_0x9757('0x3e')][_0x9757('0x3f')],_0x815c25)[_0x9757('0x2d')](function(_0x35edcc){return db[_0x9757('0x36')][_0x9757('0x37')]({'where':{'id':_0x35edcc[_0x9757('0x41')]}})['then'](function(_0x335212){if(!_0x335212||!_[_0x9757('0x42')](_0x335212[_0x9757('0x43')],_0x35edcc[_0x9757('0x44')])){return _0x3bec93[_0x9757('0x2e')](0x193)[_0x9757('0x3c')]({'message':_0x9757('0x45')});}_0x32054f[_0x9757('0x28')]={'id':_0x335212['id']};_0x21435e();});})['catch'](function(_0x2c24af){_0x21435e(_0x2c24af);});}else if(_0x53d21c){_0x21435e();}else{return _0x3bec93['status'](0x193)[_0x9757('0x3c')]({'message':_0x9757('0x3d')});}})['use'](function(_0x248656,_0x9389cd,_0x584017){if(_0x248656[_0x9757('0x28')]){db[_0x9757('0x36')][_0x9757('0x37')]({'where':{'id':_0x248656[_0x9757('0x28')]['id']},'attributes':userAttributes})[_0x9757('0x2d')](function(_0x1e3b74){if(!_0x1e3b74){return _0x9389cd[_0x9757('0x2e')](0x194)['json']({'message':_0x9757('0x46')});}_0x248656[_0x9757('0x28')]=_0x1e3b74;_0x584017();})[_0x9757('0x32')](function(_0x4f2ea4){_0x584017(_0x4f2ea4);});}else if(_0x53d21c){_0x584017();}else{return _0x9389cd[_0x9757('0x2e')](0x194)[_0x9757('0x3c')]({'message':_0x9757('0x47')});}});};exports[_0x9757('0x48')]=function canUpdate(){return compose()[_0x9757('0x27')](function(_0x959db3,_0x241a81,_0x27e55c){return require(_0x9757('0x49'))['getLicense']()['then'](function(_0x2cf830){if(_0x2cf830[_0x9757('0x4a')]){_0x27e55c();}else{return _0x241a81[_0x9757('0x2e')](0x193)[_0x9757('0x3c')]({'message':'Forbidden'});}})[_0x9757('0x32')](function(_0x4dfa93){_0x27e55c(_0x4dfa93);});});};exports[_0x9757('0x4b')]=function(_0x337dcc,_0x2df1a8,_0x59f7ca){_0x337dcc[_0x9757('0x4b')]=!![];return _0x59f7ca();};exports[_0x9757('0x4c')]=function signToken(_0x3d98c8){return signJwt(_0x3d98c8);};exports['setTokenCookie']=function(_0x37b223,_0x5eea8b){if(!_0x37b223['user']){return _0x5eea8b[_0x9757('0x2e')](0x194)[_0x9757('0x3c')]({'message':_0x9757('0x4d')});}var _0x23b08c={'payload':{'id':_0x37b223[_0x9757('0x28')]['id'],'role':_0x37b223['user']['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x23b08c)['then'](function(_0x6761e9){_0x5eea8b[_0x9757('0x4e')](_0x9757('0x4f'),_0x6761e9);_0x5eea8b['redirect'](_0x9757('0x50'));})[_0x9757('0x32')](function(_0x58f7fc){return _0x5eea8b[_0x9757('0x2e')](0x1f4)[_0x9757('0x51')](_0x58f7fc);});};exports[_0x9757('0x52')]=function(_0xa84122){if(_['isNil'](_0xa84122[_0x9757('0x43')])||_[_0x9757('0x53')](_0xa84122[_0x9757('0x54')])){return null;}else{return createJwt(_0xa84122);}};exports[_0x9757('0x55')]=function(_0x3dc58b){_0x3dc58b[_0x9757('0x43')]=generateNonce();_0x3dc58b[_0x9757('0x54')]=generateIssuedAt();return createJwt(_0x3dc58b);};exports[_0x9757('0x56')]=function(_0x22b3d4,_0x5c977e){var _0x5f3588=_0x22b3d4[_0x9757('0x3e')][_0x9757('0x3f')];if(_0x5f3588){var _0x164593={'nonce':_0x5c977e['apiKeyNonce'],'iat':_0x5c977e[_0x9757('0x54')],'audience':hardwareConf[_0x9757('0x40')](),'issuer':hardwareConf[_0x9757('0x40')]()};return verifyJwt(_0x5f3588,_0x164593)['then'](function(){return generateApiKey(_0x5c977e);});}else{throw{'message':_0x9757('0x57')};}};function signJwt(_0x33e418){var _0x497542=BPromise['promisify'](jwt['sign'],{'context':jwt});var _0x45771a=_0x33e418[_0x9757('0x58')]||config[_0x9757('0x9')]['session'];return new BPromise(function(_0x279295,_0x5aaadf){_0x497542(_0x33e418[_0x9757('0x59')],_0x45771a,_0x33e418[_0x9757('0x5a')])['then'](function(_0x877e84){_0x279295(_0x877e84);})[_0x9757('0x32')](function(_0xc1bb11){_0x5aaadf(_0xc1bb11);});});}function verifyJwt(_0x4487a4,_0x118d02,_0x5c8b70){var _0x820ace=BPromise[_0x9757('0x5b')](jwt[_0x9757('0x5c')],{'context':jwt});var _0x1b1a5a=_0x5c8b70||config[_0x9757('0x9')][_0x9757('0x5d')];return new BPromise(function(_0x7a5cb9,_0x4e3ebc){_0x820ace(_0x4487a4,_0x1b1a5a,_0x118d02)['then'](function(_0x37e535){_0x7a5cb9(_0x37e535);})['catch'](function(_0x53c910){_0x4e3ebc(_0x53c910);});});}function generateNonce(){return crypto[_0x9757('0x5e')](0x10)['toString'](_0x9757('0x5f'));}function generateIssuedAt(){return Math[_0x9757('0x60')](Date['now']()/0x3e8)['toString']();}function createJwt(_0x26cb8c){var _0x502321={'payload':{'iat':_0x26cb8c[_0x9757('0x54')],'nonce':_0x26cb8c['apiKeyNonce']},'options':{'algorithm':_0x9757('0x61'),'subject':_0x26cb8c['id']['toString'](),'issuer':hardwareConf[_0x9757('0x40')](),'audience':hardwareConf[_0x9757('0x40')]()}};return signJwt(_0x502321)[_0x9757('0x2d')](function(_0x3241c5){return{'iat':_0x26cb8c[_0x9757('0x54')],'nonce':_0x26cb8c[_0x9757('0x43')],'token':_0x3241c5};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 5feb98b..746c79a 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 _0x70e0=['createDecipher','algorithm','data','close','unlink','crypto','bluebird','aes192','hasOwnProperty','createReadStream','createWriteStream','createCipher','update','binary','write','end','final'];(function(_0x2747f1,_0x40069b){var _0x40eb07=function(_0x2b47fa){while(--_0x2b47fa){_0x2747f1['push'](_0x2747f1['shift']());}};_0x40eb07(++_0x40069b);}(_0x70e0,0x17b));var _0x070e=function(_0xb5f3c2,_0x728f91){_0xb5f3c2=_0xb5f3c2-0x0;var _0x5079db=_0x70e0[_0xb5f3c2];return _0x5079db;};'use strict';var crypto=require(_0x070e('0x0'));var fs=require('fs');var BPromise=require(_0x070e('0x1'));var defaultOptions={'algorithm':_0x070e('0x2')};function combineOptions(_0x4d95bb){var _0x579b83={};for(var _0x16e651 in defaultOptions){if(defaultOptions[_0x070e('0x3')](_0x16e651)){_0x579b83[_0x16e651]=defaultOptions[_0x16e651];}}if(_0x4d95bb){for(var _0x277d32 in _0x4d95bb){if(_0x4d95bb[_0x070e('0x3')](_0x277d32)){_0x579b83[_0x277d32]=_0x4d95bb[_0x277d32];}}}return _0x579b83;}exports['encryptFile']=function(_0x7bce9b,_0x579a6b,_0x46fe68,_0x4b041d){return new BPromise(function(_0x56e420,_0x5032e5){_0x4b041d=combineOptions(_0x4b041d);var _0x35ab0c=new Buffer(_0x46fe68);var _0x1e11f0=fs[_0x070e('0x4')](_0x7bce9b);var _0x2611e6=fs[_0x070e('0x5')](_0x579a6b);var _0x68a09e=crypto[_0x070e('0x6')](_0x4b041d['algorithm'],_0x35ab0c);_0x1e11f0['on']('data',function(_0x50f4eb){var _0x2e3e5e=new Buffer(_0x68a09e[_0x070e('0x7')](_0x50f4eb),_0x070e('0x8'));_0x2611e6[_0x070e('0x9')](_0x2e3e5e);});_0x1e11f0['on'](_0x070e('0xa'),function(){try{var _0x25cfe1=new Buffer(_0x68a09e[_0x070e('0xb')](_0x070e('0x8')),_0x070e('0x8'));_0x2611e6[_0x070e('0x9')](_0x25cfe1);_0x2611e6['end']();_0x2611e6['on']('close',function(){return _0x56e420(_0x579a6b);});}catch(_0x24baba){fs['unlink'](_0x579a6b);return _0x5032e5(_0x24baba);}});});};exports['decryptFile']=function(_0x5bae0f,_0x11d2ce,_0x14c3fd,_0x51d14d){return new BPromise(function(_0x5d3a38,_0x373d86){_0x51d14d=combineOptions(_0x51d14d);var _0xeae1a5=new Buffer(_0x14c3fd);var _0x180897=fs[_0x070e('0x4')](_0x5bae0f);var _0x5bc71e=fs['createWriteStream'](_0x11d2ce);var _0x17e2e4=crypto[_0x070e('0xc')](_0x51d14d[_0x070e('0xd')],_0xeae1a5);_0x180897['on'](_0x070e('0xe'),function(_0x364b3f){var _0x5037eb=new Buffer(_0x17e2e4[_0x070e('0x7')](_0x364b3f),_0x070e('0x8'));_0x5bc71e[_0x070e('0x9')](_0x5037eb);});_0x180897['on'](_0x070e('0xa'),function(){try{var _0x259893=new Buffer(_0x17e2e4['final']('binary'),'binary');_0x5bc71e[_0x070e('0x9')](_0x259893);_0x5bc71e[_0x070e('0xa')]();_0x5bc71e['on'](_0x070e('0xf'),function(){return _0x5d3a38(_0x11d2ce);});}catch(_0x4be0d7){fs[_0x070e('0x10')](_0x11d2ce);return _0x373d86(_0x4be0d7);}});});}; \ No newline at end of file +var _0xa9e0=['update','close','crypto','bluebird','aes192','hasOwnProperty','encryptFile','createReadStream','createCipher','algorithm','data','final','binary','write','end','unlink','decryptFile'];(function(_0x15659a,_0x5e2142){var _0x21ef80=function(_0x36cce6){while(--_0x36cce6){_0x15659a['push'](_0x15659a['shift']());}};_0x21ef80(++_0x5e2142);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'use strict';var crypto=require(_0x0a9e('0x0'));var fs=require('fs');var BPromise=require(_0x0a9e('0x1'));var defaultOptions={'algorithm':_0x0a9e('0x2')};function combineOptions(_0x5dd881){var _0x550fbc={};for(var _0x18d5c9 in defaultOptions){if(defaultOptions['hasOwnProperty'](_0x18d5c9)){_0x550fbc[_0x18d5c9]=defaultOptions[_0x18d5c9];}}if(_0x5dd881){for(var _0x333808 in _0x5dd881){if(_0x5dd881[_0x0a9e('0x3')](_0x333808)){_0x550fbc[_0x333808]=_0x5dd881[_0x333808];}}}return _0x550fbc;}exports[_0x0a9e('0x4')]=function(_0x991246,_0x981158,_0x57b080,_0x219af0){return new BPromise(function(_0x441e3a,_0x2cc193){_0x219af0=combineOptions(_0x219af0);var _0x5f41ea=new Buffer(_0x57b080);var _0x503809=fs[_0x0a9e('0x5')](_0x991246);var _0x56465b=fs['createWriteStream'](_0x981158);var _0x39753a=crypto[_0x0a9e('0x6')](_0x219af0[_0x0a9e('0x7')],_0x5f41ea);_0x503809['on'](_0x0a9e('0x8'),function(_0xfeb75b){var _0xbd1168=new Buffer(_0x39753a['update'](_0xfeb75b),'binary');_0x56465b['write'](_0xbd1168);});_0x503809['on']('end',function(){try{var _0x273d4d=new Buffer(_0x39753a[_0x0a9e('0x9')](_0x0a9e('0xa')),_0x0a9e('0xa'));_0x56465b[_0x0a9e('0xb')](_0x273d4d);_0x56465b[_0x0a9e('0xc')]();_0x56465b['on']('close',function(){return _0x441e3a(_0x981158);});}catch(_0x4283ce){fs[_0x0a9e('0xd')](_0x981158);return _0x2cc193(_0x4283ce);}});});};exports[_0x0a9e('0xe')]=function(_0x281129,_0x44dcfd,_0x4d5611,_0x52a03d){return new BPromise(function(_0x22dccb,_0x5d0880){_0x52a03d=combineOptions(_0x52a03d);var _0x1985b6=new Buffer(_0x4d5611);var _0x519dfd=fs[_0x0a9e('0x5')](_0x281129);var _0x12066b=fs['createWriteStream'](_0x44dcfd);var _0x225616=crypto['createDecipher'](_0x52a03d[_0x0a9e('0x7')],_0x1985b6);_0x519dfd['on'](_0x0a9e('0x8'),function(_0x106033){var _0x205fd6=new Buffer(_0x225616[_0x0a9e('0xf')](_0x106033),_0x0a9e('0xa'));_0x12066b[_0x0a9e('0xb')](_0x205fd6);});_0x519dfd['on'](_0x0a9e('0xc'),function(){try{var _0x1314ae=new Buffer(_0x225616[_0x0a9e('0x9')](_0x0a9e('0xa')),_0x0a9e('0xa'));_0x12066b['write'](_0x1314ae);_0x12066b[_0x0a9e('0xc')]();_0x12066b['on'](_0x0a9e('0x10'),function(){return _0x22dccb(_0x44dcfd);});}catch(_0x53682f){fs[_0x0a9e('0xd')](_0x44dcfd);return _0x5d0880(_0x53682f);}});});}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 7f6f1b2..672c676 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=['Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','path','lodash','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'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'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];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}));return analyticExtractedReport(_0x0a9e('0x28'));});}main(); \ No newline at end of file +var _0x153f=['split','%s\x20limit\x20%d\x20OFFSET\x20%d','push','dirname','basename','.csv','existsSync','join','mkdirSync','each','csv','%s.%s','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','CSV','Setting','find','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length'];(function(_0x4695ba,_0x5a7f2a){var _0x524b7d=function(_0xfc9707){while(--_0xfc9707){_0x4695ba['push'](_0x4695ba['shift']());}};_0x524b7d(++_0x5a7f2a);}(_0x153f,0x15b));var _0xf153=function(_0x5e744b,_0x357ef2){_0x5e744b=_0x5e744b-0x0;var _0x428e36=_0x153f[_0x5e744b];return _0x428e36;};'use strict';var util=require(_0xf153('0x0'));var path=require(_0xf153('0x1'));var _=require(_0xf153('0x2'));var csv=require(_0xf153('0x3'));var fs=require('fs');var BPromise=require(_0xf153('0x4'));var zipdir=require(_0xf153('0x5'));var rimraf=require(_0xf153('0x6'));var db=require('../../mysqldb')['db'];var dbH=require(_0xf153('0x7'))['dbH'];var logger=require(_0xf153('0x8'))(_0xf153('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0xf153('0xa')][0x2]);var QUERY=process[_0xf153('0xa')][0x3];var PATH=process[_0xf153('0xa')][0x4];function analyticExtractedReport(_0x4c8ae5,_0x17ba96){var _0x143497={'status':_0x4c8ae5};var _0x224f88={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x17ba96){_0x143497[_0xf153('0xb')]=_0x17ba96;}return db[_0xf153('0xc')][_0xf153('0xd')](_0x143497,_0x224f88);}function main(){var _0x44845c=0x1388;var _0x15a18b;logger[_0xf153('0xe')](util[_0xf153('0xf')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xf153('0x10')));return db[_0xf153('0x11')][_0xf153('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xf153('0x13')]})[_0xf153('0x14')](function(_0x65756d){if(_0x65756d){_0x15a18b=_0x65756d;_0x44845c=_0x15a18b[_0xf153('0x13')]||0x1388;}})[_0xf153('0x14')](function(){return dbH[_0xf153('0x15')][_0xf153('0x16')](util[_0xf153('0xf')](_0xf153('0x17'),QUERY),{'type':dbH['sequelize'][_0xf153('0x18')][_0xf153('0x19')]});})[_0xf153('0x14')](function(_0x406e6f){if(!_0x406e6f[0x0][_0xf153('0x1a')]){return analyticExtractedReport(_0xf153('0x1b'));}var _0x273a90=[];var _0x287bc6=0x0;var _0x47fbfe=!![];if(_0x406e6f&&_0x406e6f[_0xf153('0x1c')]){var _0x564eeb=_0x406e6f[0x0][_0xf153('0x1a')]%(_0x287bc6+_0x44845c);if(_0x15a18b[_0xf153('0x1d')]){for(;_0x47fbfe;_0x287bc6+=_0x44845c,_0x564eeb=_0x406e6f[0x0][_0xf153('0x1a')]%(_0x287bc6+_0x44845c)){if(_0x564eeb==0x0||_0x564eeb==_0x406e6f[0x0][_0xf153('0x1a')]){_0x47fbfe=![];}_0x273a90['push'](dbH[_0xf153('0x15')][_0xf153('0x16')](util[_0xf153('0xf')](_0xf153('0x1e'),QUERY,_0x44845c,_0x287bc6),{'type':dbH[_0xf153('0x15')][_0xf153('0x18')][_0xf153('0x19')]}));}}else{_0x273a90[_0xf153('0x1f')](dbH[_0xf153('0x15')][_0xf153('0x16')](QUERY,{'type':dbH[_0xf153('0x15')][_0xf153('0x18')]['SELECT']}));}}var _0xcd5762=path[_0xf153('0x20')](PATH);var _0x3d3e41=path[_0xf153('0x21')](PATH,_0xf153('0x22'));var _0x3e94b5=_0x15a18b[_0xf153('0x1d')]&&_0x273a90[_0xf153('0x1c')]>0x1;var _0xf67cde=[];if(!fs[_0xf153('0x23')](path[_0xf153('0x24')](_0xcd5762,_0x3d3e41))&&_0x3e94b5){fs[_0xf153('0x25')](path[_0xf153('0x24')](_0xcd5762,_0x3d3e41));}return BPromise[_0xf153('0x26')](_0x273a90,function(_0xe490f8){_0xf67cde[_0xf153('0x1f')](_0xe490f8);})[_0xf153('0x14')](function(){for(var _0x703adb=0x0;_0x703adb<_0xf67cde[_0xf153('0x1c')];_0x703adb+=0x1){var _0x17f7a4;var _0x48ebdc=_0xf67cde[_0x703adb];if(_0x3e94b5){_0x17f7a4=path[_0xf153('0x24')](_0xcd5762,_0x3d3e41,util[_0xf153('0xf')]('%s%d.%s',_0x3d3e41,_0x703adb,_0xf153('0x27')));}else{_0x17f7a4=path[_0xf153('0x24')](_0xcd5762,util['format'](_0xf153('0x28'),_0x3d3e41,_0xf153('0x27')));}fs[_0xf153('0x29')](_0x17f7a4,csv(_0x48ebdc));}})[_0xf153('0x14')](function(){if(_0x3e94b5){zipdir(path[_0xf153('0x24')](_0xcd5762,_0x3d3e41),{'saveTo':path[_0xf153('0x24')](_0xcd5762,util[_0xf153('0xf')](_0xf153('0x28'),_0x3d3e41,_0xf153('0x2a')))},function(_0x8e31bf,_0x13b541){});rimraf(path[_0xf153('0x24')](_0xcd5762,_0x3d3e41),function(){});}})['then'](function(){logger[_0xf153('0xe')](util[_0xf153('0xf')](_0xf153('0x2b'),EXTRACTED_REPORT_ID,_0xf153('0x10')));return analyticExtractedReport('Completed',_0x3e94b5?util['format'](_0xf153('0x28'),_0x3d3e41,_0x3e94b5?'zip':'csv'):null);});})[_0xf153('0x2c')](function(_0x4ab958){logger[_0xf153('0xe')](util['format'](_0xf153('0x2d'),EXTRACTED_REPORT_ID,_0xf153('0x10')),util['inspect'](_0x4ab958,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xf153('0x2e'));});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 69ff9c8..8585c20 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 _0xd8b0=['format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','existsSync','join','mkdirSync','each','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','endDate','landscape','black','body','toString','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','%s%d.%s','pdf','pipe','finish','error','log','err','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','lodash','bluebird','pdfmake/src/printer','zip-dir','rimraf','../../mysqldb','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','hasOwnProperty','tableHeader','num','Empty','dirname','basename','.pdf','Setting','find','split','splitSizePdf','then','length','push','sequelize','query'];(function(_0x2b0e44,_0x16abbb){var _0x3df06e=function(_0x2965f6){while(--_0x2965f6){_0x2b0e44['push'](_0x2b0e44['shift']());}};_0x3df06e(++_0x16abbb);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var fs=require('fs');var BPromise=require(_0x0d8b('0x1'));var util=require('util');var path=require('path');var moment=require('moment');var PdfPrinter=require(_0x0d8b('0x2'));var zipdir=require(_0x0d8b('0x3'));var rimraf=require(_0x0d8b('0x4'));var db=require(_0x0d8b('0x5'))['db'];var dbH=require(_0x0d8b('0x5'))['dbH'];var logger=require('../../config/logger')(_0x0d8b('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0x0d8b('0x7')][0x2]);var QUERY=process[_0x0d8b('0x7')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x0d8b('0x7')][0x5];var FORMAT=_0x0d8b('0x8');var _extractedReport;function analyticExtractedReport(_0x58e4e2,_0x129310){var _0x348e65={'status':_0x58e4e2};var _0x3b027f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x129310){_0x348e65[_0x0d8b('0x9')]=_0x129310;}return db[_0x0d8b('0xa')][_0x0d8b('0xb')](_0x348e65,_0x3b027f);}function getHeader(_0x2c5e9e){var _0x28f87c=[];for(var _0x48fa16 in _0x2c5e9e){if(_0x2c5e9e[_0x0d8b('0xc')](_0x48fa16)){_0x28f87c['push']({'text':_0x48fa16,'style':_0x0d8b('0xd')});}}return _0x28f87c;}function extractReport(_0xc574a3){var _0x340cc4=0x1388;var _0x92cdd8;if(!_0xc574a3[0x0][_0x0d8b('0xe')]){return analyticExtractedReport(_0x0d8b('0xf'));}var _0x15dd0f=[];var _0x31a8cc=0x0;var _0x1d4bbc=!![];var _0x2ce75e=path[_0x0d8b('0x10')](PATH);var _0xe65334=path[_0x0d8b('0x11')](PATH,_0x0d8b('0x12'));var _0x4f6f21=![];var _0x23eb7b=[];return db[_0x0d8b('0x13')][_0x0d8b('0x14')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x0d8b('0x15'),_0x0d8b('0x16')]})['then'](function(_0x106a01){if(_0x106a01){_0x92cdd8=_0x106a01;_0x340cc4=_0x92cdd8[_0x0d8b('0x16')]||0x3e8;}})[_0x0d8b('0x17')](function(){if(_0xc574a3&&_0xc574a3[_0x0d8b('0x18')]){var _0x333674=_0xc574a3[0x0][_0x0d8b('0xe')]%(_0x31a8cc+_0x340cc4);if(_0x92cdd8[_0x0d8b('0x15')]){for(;_0x1d4bbc;_0x31a8cc+=_0x340cc4,_0x333674=_0xc574a3[0x0][_0x0d8b('0xe')]%(_0x31a8cc+_0x340cc4)){if(_0x333674==0x0||_0x333674==_0xc574a3[0x0]['num']){_0x1d4bbc=![];}_0x15dd0f[_0x0d8b('0x19')](dbH[_0x0d8b('0x1a')][_0x0d8b('0x1b')](util[_0x0d8b('0x1c')](_0x0d8b('0x1d'),QUERY,_0x340cc4,_0x31a8cc),{'type':dbH[_0x0d8b('0x1a')][_0x0d8b('0x1e')][_0x0d8b('0x1f')]}));}}else{_0x15dd0f['push'](dbH['sequelize'][_0x0d8b('0x1b')](QUERY,{'type':dbH['sequelize']['QueryTypes']['SELECT']}));}}_0x4f6f21=_0x92cdd8[_0x0d8b('0x15')]&&_0x15dd0f[_0x0d8b('0x18')]>0x1;if(!fs[_0x0d8b('0x20')](path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334))&&_0x4f6f21){fs[_0x0d8b('0x22')](path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334));}return BPromise[_0x0d8b('0x23')](_0x15dd0f,function(_0x4562cb){_0x23eb7b[_0x0d8b('0x19')](_0x4562cb);});})['then'](function(){return BPromise[_0x0d8b('0x23')](_0x15dd0f,function(_0x4463ee,_0x5363e3){var _0xe1ef20;var _0x4a0ae4=util[_0x0d8b('0x1c')](_0x0d8b('0x24'),NAME,_extractedReport[_0x0d8b('0x25')],moment(_extractedReport['startDate'])['format'](FORMAT),moment(_extractedReport[_0x0d8b('0x26')])[_0x0d8b('0x1c')](FORMAT));var _0x4c05ee={'pageSize':'A4','pageOrientation':_0x0d8b('0x27'),'content':[{'text':_0x4a0ae4,'style':'header'}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x0d8b('0x28')}}};var _0x4b59e5={'headerRows':0x1,'body':[]};_0x4b59e5[_0x0d8b('0x29')]['push'](getHeader(_0x4463ee[0x0]));var _0x2ab00d;for(var _0x546bf6=0x0;_0x546bf6<_0x4463ee[_0x0d8b('0x18')];_0x546bf6+=0x1){_0x2ab00d=[];for(var _0x544735 in _0x4463ee[_0x546bf6]){if(_0x4463ee[_0x546bf6][_0x0d8b('0xc')](_0x544735)){_0x2ab00d[_0x0d8b('0x19')](_0x4463ee[_0x546bf6][_0x544735]?_[_0x0d8b('0x2a')](_0x4463ee[_0x546bf6][_0x544735]):'');}}_0x4b59e5['body']['push'](_0x2ab00d);}_0x4c05ee['content'][_0x0d8b('0x19')]({'table':_0x4b59e5});return new BPromise(function(_0x5515d2,_0x3cdf3c){var _0x54f6f3=new PdfPrinter({'Roboto':{'normal':__dirname+'/fonts/Roboto-Regular.ttf','bold':__dirname+_0x0d8b('0x2b'),'italics':__dirname+_0x0d8b('0x2c'),'bolditalics':__dirname+_0x0d8b('0x2d')}});var _0xdeee5d=_0x54f6f3[_0x0d8b('0x2e')](_0x4c05ee);if(_0x4f6f21){_0xe1ef20=path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334,util[_0x0d8b('0x1c')](_0x0d8b('0x2f'),_0xe65334,_0x5363e3,'pdf'));}else{_0xe1ef20=path[_0x0d8b('0x21')](_0x2ce75e,util[_0x0d8b('0x1c')]('%s.%s',_0xe65334,_0x0d8b('0x30')));}var _0x23f7f6=_0xdeee5d[_0x0d8b('0x31')](fs['createWriteStream'](_0xe1ef20));_0x23f7f6['on'](_0x0d8b('0x32'),function(){_0x5515d2();});_0x23f7f6['on'](_0x0d8b('0x33'),function(_0x206157){console[_0x0d8b('0x34')](_0x0d8b('0x35'),_0x206157);_0x3cdf3c(_0x206157);});_0xdeee5d['end']();});});})[_0x0d8b('0x17')](function(){if(_0x4f6f21){return new BPromise(function(_0x1649fc,_0x5ad0fe){zipdir(path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334),{'saveTo':path[_0x0d8b('0x21')](_0x2ce75e,util[_0x0d8b('0x1c')](_0x0d8b('0x36'),_0xe65334,_0x0d8b('0x37')))},function(_0x519088){if(_0x519088){_0x5ad0fe(_0x519088);}else{_0x1649fc();}});});}})['then'](function(){if(_0x4f6f21){rimraf(path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334),function(){});}})['then'](function(){logger['info'](util[_0x0d8b('0x1c')](_0x0d8b('0x38'),EXTRACTED_REPORT_ID,_0x0d8b('0x39')));return analyticExtractedReport(_0x0d8b('0x3a'),_0x4f6f21?util[_0x0d8b('0x1c')](_0x0d8b('0x36'),_0xe65334,_0x4f6f21?'zip':_0x0d8b('0x30')):null);});}function main(){logger[_0x0d8b('0x3b')](util[_0x0d8b('0x1c')](_0x0d8b('0x3c'),EXTRACTED_REPORT_ID,_0x0d8b('0x3d')));return db[_0x0d8b('0xa')][_0x0d8b('0x3e')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x1d06b6){_extractedReport=_0x1d06b6;return dbH[_0x0d8b('0x1a')][_0x0d8b('0x1b')](util[_0x0d8b('0x1c')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x0d8b('0x1a')]['QueryTypes'][_0x0d8b('0x1f')]});})[_0x0d8b('0x17')](extractReport)[_0x0d8b('0x3f')](function(_0x26ac10){logger[_0x0d8b('0x3b')](util[_0x0d8b('0x1c')](_0x0d8b('0x40'),EXTRACTED_REPORT_ID,_0x0d8b('0x3d')),util[_0x0d8b('0x41')](_0x26ac10,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x0d8b('0x42'));});}main(); \ No newline at end of file +var _0x5f2f=['hasOwnProperty','push','num','Empty','dirname','basename','Setting','find','split','splitSizePdf','then','length','query','format','QueryTypes','SELECT','sequelize','existsSync','join','mkdirSync','each','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','endDate','landscape','body','toString','content','/fonts/Roboto-Regular.ttf','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','%s%d.%s','pdf','%s.%s','createWriteStream','finish','err','end','info','CSV','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','lodash','bluebird','util','path','moment','pdfmake/src/printer','zip-dir','rimraf','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport'];(function(_0x2d196c,_0x5804a1){var _0x4c1fcd=function(_0x138a9f){while(--_0x138a9f){_0x2d196c['push'](_0x2d196c['shift']());}};_0x4c1fcd(++_0x5804a1);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1ad6fb,_0x276e32){_0x1ad6fb=_0x1ad6fb-0x0;var _0x2f1219=_0x5f2f[_0x1ad6fb];return _0x2f1219;};'use strict';var _=require(_0xf5f2('0x0'));var fs=require('fs');var BPromise=require(_0xf5f2('0x1'));var util=require(_0xf5f2('0x2'));var path=require(_0xf5f2('0x3'));var moment=require(_0xf5f2('0x4'));var PdfPrinter=require(_0xf5f2('0x5'));var zipdir=require(_0xf5f2('0x6'));var rimraf=require(_0xf5f2('0x7'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xf5f2('0x8')];var logger=require(_0xf5f2('0x9'))(_0xf5f2('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0xf5f2('0xb')][0x2]);var QUERY=process[_0xf5f2('0xb')][0x3];var PATH=process[_0xf5f2('0xb')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xf5f2('0xc');var _extractedReport;function analyticExtractedReport(_0x46cd9c,_0x2ec345){var _0x56a69f={'status':_0x46cd9c};var _0x375da4={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2ec345){_0x56a69f[_0xf5f2('0xd')]=_0x2ec345;}return db[_0xf5f2('0xe')]['update'](_0x56a69f,_0x375da4);}function getHeader(_0x977a59){var _0x4ebbbe=[];for(var _0x53fb33 in _0x977a59){if(_0x977a59[_0xf5f2('0xf')](_0x53fb33)){_0x4ebbbe[_0xf5f2('0x10')]({'text':_0x53fb33,'style':'tableHeader'});}}return _0x4ebbbe;}function extractReport(_0x336f6b){var _0x14b51f=0x1388;var _0x331482;if(!_0x336f6b[0x0][_0xf5f2('0x11')]){return analyticExtractedReport(_0xf5f2('0x12'));}var _0x3e5956=[];var _0x5c01b8=0x0;var _0x5850f4=!![];var _0xea612c=path[_0xf5f2('0x13')](PATH);var _0x1c1a5c=path[_0xf5f2('0x14')](PATH,'.pdf');var _0xafe430=![];var _0x286197=[];return db[_0xf5f2('0x15')][_0xf5f2('0x16')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xf5f2('0x17'),_0xf5f2('0x18')]})[_0xf5f2('0x19')](function(_0x395a5a){if(_0x395a5a){_0x331482=_0x395a5a;_0x14b51f=_0x331482[_0xf5f2('0x18')]||0x3e8;}})[_0xf5f2('0x19')](function(){if(_0x336f6b&&_0x336f6b[_0xf5f2('0x1a')]){var _0x28e097=_0x336f6b[0x0][_0xf5f2('0x11')]%(_0x5c01b8+_0x14b51f);if(_0x331482[_0xf5f2('0x17')]){for(;_0x5850f4;_0x5c01b8+=_0x14b51f,_0x28e097=_0x336f6b[0x0][_0xf5f2('0x11')]%(_0x5c01b8+_0x14b51f)){if(_0x28e097==0x0||_0x28e097==_0x336f6b[0x0][_0xf5f2('0x11')]){_0x5850f4=![];}_0x3e5956[_0xf5f2('0x10')](dbH['sequelize'][_0xf5f2('0x1b')](util[_0xf5f2('0x1c')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x14b51f,_0x5c01b8),{'type':dbH['sequelize'][_0xf5f2('0x1d')][_0xf5f2('0x1e')]}));}}else{_0x3e5956['push'](dbH[_0xf5f2('0x1f')][_0xf5f2('0x1b')](QUERY,{'type':dbH[_0xf5f2('0x1f')][_0xf5f2('0x1d')][_0xf5f2('0x1e')]}));}}_0xafe430=_0x331482['split']&&_0x3e5956[_0xf5f2('0x1a')]>0x1;if(!fs[_0xf5f2('0x20')](path[_0xf5f2('0x21')](_0xea612c,_0x1c1a5c))&&_0xafe430){fs[_0xf5f2('0x22')](path[_0xf5f2('0x21')](_0xea612c,_0x1c1a5c));}return BPromise['each'](_0x3e5956,function(_0x529f07){_0x286197[_0xf5f2('0x10')](_0x529f07);});})[_0xf5f2('0x19')](function(){return BPromise[_0xf5f2('0x23')](_0x3e5956,function(_0x1a5bb3,_0xf6c58d){var _0x788a8d;var _0x13a3be=util[_0xf5f2('0x1c')](_0xf5f2('0x24'),NAME,_extractedReport['name'],moment(_extractedReport[_0xf5f2('0x25')])[_0xf5f2('0x1c')](FORMAT),moment(_extractedReport[_0xf5f2('0x26')])[_0xf5f2('0x1c')](FORMAT));var _0x198c73={'pageSize':'A4','pageOrientation':_0xf5f2('0x27'),'content':[{'text':_0x13a3be,'style':'header'}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'}}};var _0x22c826={'headerRows':0x1,'body':[]};_0x22c826[_0xf5f2('0x28')][_0xf5f2('0x10')](getHeader(_0x1a5bb3[0x0]));var _0x5027ab;for(var _0x5a2c7e=0x0;_0x5a2c7e<_0x1a5bb3[_0xf5f2('0x1a')];_0x5a2c7e+=0x1){_0x5027ab=[];for(var _0x50b8a2 in _0x1a5bb3[_0x5a2c7e]){if(_0x1a5bb3[_0x5a2c7e][_0xf5f2('0xf')](_0x50b8a2)){_0x5027ab[_0xf5f2('0x10')](_0x1a5bb3[_0x5a2c7e][_0x50b8a2]?_[_0xf5f2('0x29')](_0x1a5bb3[_0x5a2c7e][_0x50b8a2]):'');}}_0x22c826['body']['push'](_0x5027ab);}_0x198c73[_0xf5f2('0x2a')]['push']({'table':_0x22c826});return new BPromise(function(_0xb744b9,_0x58a4df){var _0x45b643=new PdfPrinter({'Roboto':{'normal':__dirname+_0xf5f2('0x2b'),'bold':__dirname+_0xf5f2('0x2c'),'italics':__dirname+_0xf5f2('0x2d'),'bolditalics':__dirname+_0xf5f2('0x2e')}});var _0x277eee=_0x45b643[_0xf5f2('0x2f')](_0x198c73);if(_0xafe430){_0x788a8d=path[_0xf5f2('0x21')](_0xea612c,_0x1c1a5c,util['format'](_0xf5f2('0x30'),_0x1c1a5c,_0xf6c58d,_0xf5f2('0x31')));}else{_0x788a8d=path[_0xf5f2('0x21')](_0xea612c,util[_0xf5f2('0x1c')](_0xf5f2('0x32'),_0x1c1a5c,_0xf5f2('0x31')));}var _0x297c0c=_0x277eee['pipe'](fs[_0xf5f2('0x33')](_0x788a8d));_0x297c0c['on'](_0xf5f2('0x34'),function(){_0xb744b9();});_0x297c0c['on']('error',function(_0x3fc168){console['log'](_0xf5f2('0x35'),_0x3fc168);_0x58a4df(_0x3fc168);});_0x277eee[_0xf5f2('0x36')]();});});})[_0xf5f2('0x19')](function(){if(_0xafe430){return new BPromise(function(_0x2e3cca,_0x59a6dd){zipdir(path['join'](_0xea612c,_0x1c1a5c),{'saveTo':path[_0xf5f2('0x21')](_0xea612c,util[_0xf5f2('0x1c')](_0xf5f2('0x32'),_0x1c1a5c,'zip'))},function(_0x41447f){if(_0x41447f){_0x59a6dd(_0x41447f);}else{_0x2e3cca();}});});}})['then'](function(){if(_0xafe430){rimraf(path[_0xf5f2('0x21')](_0xea612c,_0x1c1a5c),function(){});}})['then'](function(){logger[_0xf5f2('0x37')](util[_0xf5f2('0x1c')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xf5f2('0x38')));return analyticExtractedReport(_0xf5f2('0x39'),_0xafe430?util[_0xf5f2('0x1c')](_0xf5f2('0x32'),_0x1c1a5c,_0xafe430?'zip':'pdf'):null);});}function main(){logger[_0xf5f2('0x37')](util[_0xf5f2('0x1c')](_0xf5f2('0x3a'),EXTRACTED_REPORT_ID,_0xf5f2('0x3b')));return db[_0xf5f2('0xe')][_0xf5f2('0x3c')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xf5f2('0x19')](function(_0x4c0ac7){_extractedReport=_0x4c0ac7;return dbH[_0xf5f2('0x1f')][_0xf5f2('0x1b')](util['format'](_0xf5f2('0x3d'),QUERY),{'type':dbH[_0xf5f2('0x1f')][_0xf5f2('0x1d')][_0xf5f2('0x1e')]});})[_0xf5f2('0x19')](extractReport)[_0xf5f2('0x3e')](function(_0x462ea3){logger[_0xf5f2('0x37')](util['format'](_0xf5f2('0x3f'),EXTRACTED_REPORT_ID,_0xf5f2('0x3b')),util[_0xf5f2('0x40')](_0x462ea3,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main(); \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 2128dbc..0b23c25 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 _0xc27c=['rimraf','../../mysqldb','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','split','then','splitSizeXlsx','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','Empty','length','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','existsSync','mkdirSync','join','each','xlsx','%s.%s','zip','XLSX','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','path','lodash','zip-dir'];(function(_0x4709c8,_0x3384ca){var _0x478cdd=function(_0x5193ce){while(--_0x5193ce){_0x4709c8['push'](_0x4709c8['shift']());}};_0x478cdd(++_0x3384ca);}(_0xc27c,0x129));var _0xcc27=function(_0x3d3ffe,_0xb0c6f1){_0x3d3ffe=_0x3d3ffe-0x0;var _0x5ac288=_0xc27c[_0x3d3ffe];return _0x5ac288;};'use strict';var util=require(_0xcc27('0x0'));var path=require(_0xcc27('0x1'));var _=require(_0xcc27('0x2'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require('bluebird');var zipdir=require(_0xcc27('0x3'));var rimraf=require(_0xcc27('0x4'));var db=require(_0xcc27('0x5'))['db'];var dbH=require(_0xcc27('0x5'))['dbH'];var logger=require(_0xcc27('0x6'))(_0xcc27('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0xcc27('0x8')][0x2]);var QUERY=process[_0xcc27('0x8')][0x3];var PATH=process[_0xcc27('0x8')][0x4];function analyticExtractedReport(_0x3df816,_0x32c53a){var _0x2b5461={'status':_0x3df816};var _0x44e1dc={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x32c53a){_0x2b5461[_0xcc27('0x9')]=_0x32c53a;}return db[_0xcc27('0xa')][_0xcc27('0xb')](_0x2b5461,_0x44e1dc);}function main(){var _0x5f1e31=0x1388;var _0x4a0dc3;logger[_0xcc27('0xc')](util[_0xcc27('0xd')](_0xcc27('0xe'),EXTRACTED_REPORT_ID,'XLSX'));return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xcc27('0xf'),'splitSizeXlsx']})[_0xcc27('0x10')](function(_0x98102d){if(_0x98102d){_0x4a0dc3=_0x98102d;_0x5f1e31=_0x4a0dc3[_0xcc27('0x11')]||0x1388;}})[_0xcc27('0x10')](function(){return dbH['sequelize'][_0xcc27('0x12')](util[_0xcc27('0xd')](_0xcc27('0x13'),QUERY),{'type':dbH[_0xcc27('0x14')][_0xcc27('0x15')][_0xcc27('0x16')]});})[_0xcc27('0x10')](function(_0x351945){if(!_0x351945[0x0][_0xcc27('0x17')]){return analyticExtractedReport(_0xcc27('0x18'));}var _0xd9ceb4=[];var _0x4566dd=0x0;var _0x4b697f=!![];if(_0x4a0dc3[_0xcc27('0xf')]){if(_0x351945&&_0x351945[_0xcc27('0x19')]){var _0x194bc3=_0x351945[0x0][_0xcc27('0x17')]%(_0x4566dd+_0x5f1e31);for(;_0x4b697f;_0x4566dd+=_0x5f1e31,_0x194bc3=_0x351945[0x0]['num']%(_0x4566dd+_0x5f1e31)){if(_0x194bc3==0x0||_0x194bc3==_0x351945[0x0]['num']){_0x4b697f=![];}_0xd9ceb4[_0xcc27('0x1a')](dbH['sequelize'][_0xcc27('0x12')](util[_0xcc27('0xd')](_0xcc27('0x1b'),QUERY,_0x5f1e31,_0x4566dd),{'type':dbH[_0xcc27('0x14')]['QueryTypes'][_0xcc27('0x16')]}));}}}else{_0xd9ceb4[_0xcc27('0x1a')](dbH[_0xcc27('0x14')]['query'](QUERY,{'type':dbH[_0xcc27('0x14')][_0xcc27('0x15')][_0xcc27('0x16')]}));}var _0xc1de49=path[_0xcc27('0x1c')](PATH);var _0x97292e=path[_0xcc27('0x1d')](PATH,'.xlsx');var _0x258b84=_0x4a0dc3[_0xcc27('0xf')]&&_0xd9ceb4[_0xcc27('0x19')]>0x1;var _0x47fda1=[];if(!fs[_0xcc27('0x1e')](path['join'](_0xc1de49,_0x97292e))&&_0x258b84){fs[_0xcc27('0x1f')](path[_0xcc27('0x20')](_0xc1de49,_0x97292e));}return BPromise[_0xcc27('0x21')](_0xd9ceb4,function(_0x119d35){_0x47fda1[_0xcc27('0x1a')](_0x119d35);})['then'](function(){for(var _0x326301=0x0;_0x326301<_0x47fda1['length'];_0x326301+=0x1){var _0x9d2b71;var _0x290bd5=_0x47fda1[_0x326301];if(_0x258b84){_0x9d2b71=path['join'](_0xc1de49,_0x97292e,util[_0xcc27('0xd')]('%s%d.%s',_0x97292e,_0x326301,_0xcc27('0x22')));}else{_0x9d2b71=path['join'](_0xc1de49,util[_0xcc27('0xd')](_0xcc27('0x23'),_0x97292e,_0xcc27('0x22')));}fs['writeFileSync'](_0x9d2b71,json2xls(_0x290bd5),'binary');}})[_0xcc27('0x10')](function(){if(_0x258b84){zipdir(path[_0xcc27('0x20')](_0xc1de49,_0x97292e),{'saveTo':path[_0xcc27('0x20')](_0xc1de49,util[_0xcc27('0xd')](_0xcc27('0x23'),_0x97292e,_0xcc27('0x24')))},function(_0x1c7549,_0x35a298){});rimraf(path[_0xcc27('0x20')](_0xc1de49,_0x97292e),function(){});}})[_0xcc27('0x10')](function(){logger[_0xcc27('0xc')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xcc27('0x25')));return analyticExtractedReport(_0xcc27('0x26'),_0x258b84?util[_0xcc27('0xd')]('%s.%s',_0x97292e,_0x258b84?'zip':_0xcc27('0x22')):null);});})[_0xcc27('0x27')](function(_0x1bd56e){logger[_0xcc27('0xc')](util[_0xcc27('0xd')](_0xcc27('0x28'),EXTRACTED_REPORT_ID,_0xcc27('0x25')),util[_0xcc27('0x29')](_0x1bd56e,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xcc27('0x2a'));});}main(); \ No newline at end of file +var _0x7355=['argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeXlsx','then','sequelize','query','SELECT','num','length','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','each','%s%d.%s','xlsx','join','writeFileSync','binary','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','path','lodash','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7355,0x7e));var _0x5735=function(_0x442a42,_0x12ff3e){_0x442a42=_0x442a42-0x0;var _0x7d14bc=_0x7355[_0x442a42];return _0x7d14bc;};'use strict';var util=require(_0x5735('0x0'));var path=require(_0x5735('0x1'));var _=require(_0x5735('0x2'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0x5735('0x3'));var zipdir=require(_0x5735('0x4'));var rimraf=require(_0x5735('0x5'));var db=require('../../mysqldb')['db'];var dbH=require(_0x5735('0x6'))[_0x5735('0x7')];var logger=require(_0x5735('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x5735('0x9')][0x3];var PATH=process[_0x5735('0x9')][0x4];function analyticExtractedReport(_0x19d259,_0xc869ef){var _0x5740ef={'status':_0x19d259};var _0x5a5ce0={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xc869ef){_0x5740ef[_0x5735('0xa')]=_0xc869ef;}return db[_0x5735('0xb')][_0x5735('0xc')](_0x5740ef,_0x5a5ce0);}function main(){var _0xe0ddc0=0x1388;var _0xdb95db;logger[_0x5735('0xd')](util[_0x5735('0xe')](_0x5735('0xf'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0x5735('0x10')][_0x5735('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x5735('0x12'),_0x5735('0x13')]})[_0x5735('0x14')](function(_0x3443b2){if(_0x3443b2){_0xdb95db=_0x3443b2;_0xe0ddc0=_0xdb95db[_0x5735('0x13')]||0x1388;}})[_0x5735('0x14')](function(){return dbH[_0x5735('0x15')][_0x5735('0x16')](util[_0x5735('0xe')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x5735('0x15')]['QueryTypes'][_0x5735('0x17')]});})[_0x5735('0x14')](function(_0xb1ea5c){if(!_0xb1ea5c[0x0][_0x5735('0x18')]){return analyticExtractedReport('Empty');}var _0x52773f=[];var _0x1eee84=0x0;var _0x47d15c=!![];if(_0xdb95db[_0x5735('0x12')]){if(_0xb1ea5c&&_0xb1ea5c[_0x5735('0x19')]){var _0x231a2b=_0xb1ea5c[0x0][_0x5735('0x18')]%(_0x1eee84+_0xe0ddc0);for(;_0x47d15c;_0x1eee84+=_0xe0ddc0,_0x231a2b=_0xb1ea5c[0x0][_0x5735('0x18')]%(_0x1eee84+_0xe0ddc0)){if(_0x231a2b==0x0||_0x231a2b==_0xb1ea5c[0x0][_0x5735('0x18')]){_0x47d15c=![];}_0x52773f[_0x5735('0x1a')](dbH[_0x5735('0x15')][_0x5735('0x16')](util[_0x5735('0xe')](_0x5735('0x1b'),QUERY,_0xe0ddc0,_0x1eee84),{'type':dbH['sequelize'][_0x5735('0x1c')][_0x5735('0x17')]}));}}}else{_0x52773f[_0x5735('0x1a')](dbH[_0x5735('0x15')][_0x5735('0x16')](QUERY,{'type':dbH[_0x5735('0x15')][_0x5735('0x1c')][_0x5735('0x17')]}));}var _0x33cdaa=path[_0x5735('0x1d')](PATH);var _0x5820a8=path[_0x5735('0x1e')](PATH,'.xlsx');var _0x3b5ace=_0xdb95db[_0x5735('0x12')]&&_0x52773f[_0x5735('0x19')]>0x1;var _0x2456d9=[];if(!fs['existsSync'](path['join'](_0x33cdaa,_0x5820a8))&&_0x3b5ace){fs['mkdirSync'](path['join'](_0x33cdaa,_0x5820a8));}return BPromise[_0x5735('0x1f')](_0x52773f,function(_0x1c663f){_0x2456d9[_0x5735('0x1a')](_0x1c663f);})[_0x5735('0x14')](function(){for(var _0x19b2c9=0x0;_0x19b2c9<_0x2456d9[_0x5735('0x19')];_0x19b2c9+=0x1){var _0x43b55a;var _0x595b3f=_0x2456d9[_0x19b2c9];if(_0x3b5ace){_0x43b55a=path['join'](_0x33cdaa,_0x5820a8,util['format'](_0x5735('0x20'),_0x5820a8,_0x19b2c9,_0x5735('0x21')));}else{_0x43b55a=path[_0x5735('0x22')](_0x33cdaa,util['format']('%s.%s',_0x5820a8,'xlsx'));}fs[_0x5735('0x23')](_0x43b55a,json2xls(_0x595b3f),_0x5735('0x24'));}})['then'](function(){if(_0x3b5ace){zipdir(path['join'](_0x33cdaa,_0x5820a8),{'saveTo':path[_0x5735('0x22')](_0x33cdaa,util[_0x5735('0xe')](_0x5735('0x25'),_0x5820a8,_0x5735('0x26')))},function(_0x498873,_0x471adc){});rimraf(path['join'](_0x33cdaa,_0x5820a8),function(){});}})[_0x5735('0x14')](function(){logger['info'](util[_0x5735('0xe')](_0x5735('0x27'),EXTRACTED_REPORT_ID,_0x5735('0x28')));return analyticExtractedReport('Completed',_0x3b5ace?util[_0x5735('0xe')](_0x5735('0x25'),_0x5820a8,_0x3b5ace?_0x5735('0x26'):'xlsx'):null);});})[_0x5735('0x29')](function(_0x448ed8){logger['info'](util[_0x5735('0xe')](_0x5735('0x2a'),EXTRACTED_REPORT_ID,_0x5735('0x28')),util[_0x5735('0x2b')](_0x448ed8,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x5735('0x2c'));});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index e316fbd..acee30c 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 _0xa8ea=['XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','*,*,*,*','interval','map','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice',',${EXTEN},','last','Hangup','concat','transaction','destroy','bulkCreate','sortBy','catch','error','rewrite','lodash','util','models','Interval','findAll','then','intervals','VoiceExtension','IntervalId','exten','filter','groupBy','queue','playback','hasOwnProperty','priority','extension','find','push','type','Set','format','CDR(type)=%s','context','VoiceExtensionId','outbound','extensions','CDR(destination)=','${EXTEN:','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}'];(function(_0xffe386,_0x314497){var _0x236905=function(_0x4eef74){while(--_0x4eef74){_0xffe386['push'](_0xffe386['shift']());}};_0x236905(++_0x314497);}(_0xa8ea,0xfb));var _0xaa8e=function(_0x5afbe8,_0x11721b){_0x5afbe8=_0x5afbe8-0x0;var _0x3026cd=_0xa8ea[_0x5afbe8];return _0x3026cd;};'use strict';var _=require(_0xaa8e('0x0'));var util=require(_0xaa8e('0x1'));function rewrite(_0x147372,_0xbf7fad){var _0x55472c=this;return _0x147372[_0xaa8e('0x2')][_0xaa8e('0x3')][_0xaa8e('0x4')]({'raw':!![]})[_0xaa8e('0x5')](function(_0x3352b8){_0x55472c[_0xaa8e('0x6')]=_0x3352b8;return _0x147372[_0xaa8e('0x2')][_0xaa8e('0x7')][_0xaa8e('0x4')]({'where':{'IntervalId':_0xbf7fad[_0xaa8e('0x8')]},'raw':!![]});})['then'](function(_0x3c1211){return _0x147372[_0xaa8e('0x2')]['VoiceExtension']['findAll']({'where':{'exten':{'$in':_['uniq'](_['map'](_0x3c1211,_0xaa8e('0x9')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0xaa8e('0x5')](function(_0x933d9f){var _0x4e5d4e=_['filter'](_0x933d9f,{'priority':'1'});var _0x381a4d=_[_0xaa8e('0xa')](_0x933d9f,{'isApp':0x1});var _0x513462=_[_0xaa8e('0xb')](_0x381a4d,_0xaa8e('0x9'));var _0x2f947c=[_0xaa8e('0xc'),_0xaa8e('0xd')];var _0x476de6=[];var _0x47d9dc=[];for(var _0x5f584f in _0x513462){if(_0x513462[_0xaa8e('0xe')](_0x5f584f)){_0x55472c[_0xaa8e('0xf')]=0x2;_0x55472c['extensions']=[];_0x55472c[_0xaa8e('0x10')]=_[_0xaa8e('0x11')](_0x4e5d4e,{'exten':_0x513462[_0x5f584f][0x0]['exten']});_0x55472c['extensions'][_0xaa8e('0x12')]({'type':_0x513462[_0x5f584f][0x0][_0xaa8e('0x13')],'app':_0xaa8e('0x14'),'appdata':util[_0xaa8e('0x15')](_0xaa8e('0x16'),_0x513462[_0x5f584f][0x0]['type']),'context':_0x513462[_0x5f584f][0x0][_0xaa8e('0x17')],'exten':_0x513462[_0x5f584f][0x0][_0xaa8e('0x9')],'priority':_0x55472c[_0xaa8e('0xf')]++,'VoiceExtensionId':_0x513462[_0x5f584f][0x0][_0xaa8e('0x18')]});if(_0x513462[_0x5f584f][0x0]['type']===_0xaa8e('0x19')){if(_0x55472c[_0xaa8e('0x10')]){_0x55472c[_0xaa8e('0x1a')]['push']({'type':_0x513462[_0x5f584f][0x0][_0xaa8e('0x13')],'app':_0xaa8e('0x14'),'appdata':_0xaa8e('0x1b')+(_0x55472c[_0xaa8e('0x10')]['cutdigits']?_0xaa8e('0x1c')+_0x55472c[_0xaa8e('0x10')][_0xaa8e('0x1d')]+'}':_0xaa8e('0x1e')),'context':_0x513462[_0x5f584f][0x0][_0xaa8e('0x17')],'exten':_0x513462[_0x5f584f][0x0][_0xaa8e('0x9')],'priority':_0x55472c['priority']++,'VoiceExtensionId':_0x513462[_0x5f584f][0x0][_0xaa8e('0x18')]});}_0x55472c[_0xaa8e('0x1a')][_0xaa8e('0x12')]({'type':_0x513462[_0x5f584f][0x0]['type'],'app':_0xaa8e('0x14'),'appdata':'CDR(routeid)='+_0x513462[_0x5f584f][0x0][_0xaa8e('0x18')],'context':_0x513462[_0x5f584f][0x0][_0xaa8e('0x17')],'exten':_0x513462[_0x5f584f][0x0][_0xaa8e('0x9')],'priority':_0x55472c['priority']++,'VoiceExtensionId':_0x513462[_0x5f584f][0x0]['VoiceExtensionId']});var _0x4be553=_0x55472c[_0xaa8e('0xf')]++;_0x55472c['extensions'][_0xaa8e('0x12')]({'type':_0x513462[_0x5f584f][0x0]['type'],'app':_0xaa8e('0x1f'),'appdata':_0xaa8e('0x20')+(_0x4be553+0x2)+'):Goto('+(_0x4be553+0x1)+')','context':_0x513462[_0x5f584f][0x0][_0xaa8e('0x17')],'exten':_0x513462[_0x5f584f][0x0][_0xaa8e('0x9')],'priority':_0x4be553,'VoiceExtensionId':_0x513462[_0x5f584f][0x0]['VoiceExtensionId']});if(_0x55472c[_0xaa8e('0x10')]){_0x55472c[_0xaa8e('0x1a')][_0xaa8e('0x12')]({'type':_0x513462[_0x5f584f][0x0][_0xaa8e('0x13')],'app':'Set','appdata':_0x55472c[_0xaa8e('0x10')]['cutdigits']?_0xaa8e('0x21')+_0x55472c[_0xaa8e('0x10')][_0xaa8e('0x1d')]+'}':'CDR(prefix)=noprefix','context':_0x513462[_0x5f584f][0x0][_0xaa8e('0x17')],'exten':_0x513462[_0x5f584f][0x0][_0xaa8e('0x9')],'priority':_0x55472c[_0xaa8e('0xf')]++,'VoiceExtensionId':_0x513462[_0x5f584f][0x0][_0xaa8e('0x18')]});}_0x55472c[_0xaa8e('0x1a')][_0xaa8e('0x12')]({'type':_0x513462[_0x5f584f][0x0][_0xaa8e('0x13')],'app':_0xaa8e('0x14'),'appdata':'outboundrouteid='+_0x513462[_0x5f584f][0x0][_0xaa8e('0x18')],'context':_0x513462[_0x5f584f][0x0][_0xaa8e('0x17')],'exten':_0x513462[_0x5f584f][0x0][_0xaa8e('0x9')],'priority':_0x55472c[_0xaa8e('0xf')]++,'VoiceExtensionId':_0x513462[_0x5f584f][0x0][_0xaa8e('0x18')]});if(_0x55472c[_0xaa8e('0x10')]&&_0x55472c[_0xaa8e('0x10')][_0xaa8e('0xe')](_0xaa8e('0x22'))&&_0x55472c[_0xaa8e('0x10')]['recordingFormat']!==_0xaa8e('0x23')){_0x55472c[_0xaa8e('0x1a')][_0xaa8e('0x12')]({'type':_0x513462[_0x5f584f][0x0][_0xaa8e('0x13')],'app':_0xaa8e('0x14'),'appdata':_0xaa8e('0x24'),'context':_0x513462[_0x5f584f][0x0][_0xaa8e('0x17')],'exten':_0x513462[_0x5f584f][0x0][_0xaa8e('0x9')],'priority':_0x55472c[_0xaa8e('0xf')]++,'VoiceExtensionId':_0x513462[_0x5f584f][0x0][_0xaa8e('0x18')]});_0x55472c[_0xaa8e('0x1a')][_0xaa8e('0x12')]({'type':_0x513462[_0x5f584f][0x0][_0xaa8e('0x13')],'app':_0xaa8e('0x14'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x55472c[_0xaa8e('0x10')]['recordingFormat']||'wav','context':_0x513462[_0x5f584f][0x0][_0xaa8e('0x17')],'exten':_0x513462[_0x5f584f][0x0][_0xaa8e('0x9')],'priority':_0x55472c['priority']++,'VoiceExtensionId':_0x513462[_0x5f584f][0x0][_0xaa8e('0x18')]});}}_0x55472c['extensions'][_0xaa8e('0x12')]({'type':_0x513462[_0x5f584f][0x0][_0xaa8e('0x13')],'app':_0xaa8e('0x14'),'appdata':_0xaa8e('0x25'),'context':_0x513462[_0x5f584f][0x0][_0xaa8e('0x17')],'exten':_0x513462[_0x5f584f][0x0][_0xaa8e('0x9')],'priority':_0x55472c['priority']++,'VoiceExtensionId':_0x513462[_0x5f584f][0x0]['VoiceExtensionId']});_0x55472c[_0xaa8e('0x1a')][_0xaa8e('0x12')]({'type':_0x513462[_0x5f584f][0x0][_0xaa8e('0x13')],'app':_0xaa8e('0x14'),'appdata':_0xaa8e('0x26'),'context':_0x513462[_0x5f584f][0x0][_0xaa8e('0x17')],'exten':_0x513462[_0x5f584f][0x0][_0xaa8e('0x9')],'priority':_0x55472c[_0xaa8e('0xf')]++,'VoiceExtensionId':_0x513462[_0x5f584f][0x0]['VoiceExtensionId']});_0x55472c[_0xaa8e('0x1a')][_0xaa8e('0x12')]({'type':_0x513462[_0x5f584f][0x0][_0xaa8e('0x13')],'app':_0xaa8e('0x14'),'appdata':_0xaa8e('0x27'),'context':_0x513462[_0x5f584f][0x0][_0xaa8e('0x17')],'exten':_0x513462[_0x5f584f][0x0][_0xaa8e('0x9')],'priority':_0x55472c[_0xaa8e('0xf')]++,'VoiceExtensionId':_0x513462[_0x5f584f][0x0][_0xaa8e('0x18')]});for(var _0x111353=0x0,_0x1ef928=0x0;_0x111353<_0x513462[_0x5f584f][_0xaa8e('0x28')];_0x111353+=0x1,_0x1ef928=0x0){var _0x5ebcdf=_0x513462[_0x5f584f][_0x111353];if(_0x5ebcdf[_0xaa8e('0x13')]){_0x5ebcdf[_0xaa8e('0x13')]=_0x5ebcdf[_0xaa8e('0x13')][_0xaa8e('0x29')]();}var _0x2a9590=[];var _0x3b6216=[];delete _0x5ebcdf['id'];delete _0x5ebcdf[_0xaa8e('0x2a')];delete _0x5ebcdf[_0xaa8e('0x2b')];var _0x2795d2=_0x5ebcdf['interval']!==_0xaa8e('0x2c')?[_0x5ebcdf[_0xaa8e('0x2d')]]:_0x5ebcdf[_0xaa8e('0x8')]?_[_0xaa8e('0x2e')](_[_0xaa8e('0xa')](_0x55472c['intervals'],{'IntervalId':_0x5ebcdf[_0xaa8e('0x8')]}),_0xaa8e('0x2d')):[];if(_0x5ebcdf[_0xaa8e('0xe')](_0xaa8e('0x2f'))){if(_0x5ebcdf[_0xaa8e('0x2f')]&&_0x5ebcdf[_0xaa8e('0x2f')]!=='--'){_0x2a9590[_0xaa8e('0x12')]({'type':_0x5ebcdf[_0xaa8e('0x13')],'app':_0xaa8e('0x14'),'appdata':_0xaa8e('0x30')+_0x5ebcdf[_0xaa8e('0x2f')],'context':_0x5ebcdf[_0xaa8e('0x17')],'exten':_0x5ebcdf[_0xaa8e('0x9')],'priority':_0x2795d2[_0xaa8e('0x28')]+_0x55472c[_0xaa8e('0xf')]+_0x1ef928++,'VoiceExtensionId':_0x5ebcdf[_0xaa8e('0x18')]});}}if(_0x5ebcdf['type']===_0xaa8e('0x19')&&_0x5ebcdf[_0xaa8e('0xe')](_0xaa8e('0x31'))){if(_0x5ebcdf[_0xaa8e('0x31')]){_0x2a9590['push']({'type':_0x5ebcdf[_0xaa8e('0x13')],'app':_0xaa8e('0x1f'),'appdata':_0xaa8e('0x32')+_0x5ebcdf[_0xaa8e('0x31')]+')','context':_0x5ebcdf['context'],'exten':_0x5ebcdf[_0xaa8e('0x9')],'priority':_0x2795d2[_0xaa8e('0x28')]+_0x55472c[_0xaa8e('0xf')]+_0x1ef928++,'VoiceExtensionId':_0x5ebcdf[_0xaa8e('0x18')]});}else{_0x2a9590['push']({'type':_0x5ebcdf['type'],'app':'ExecIf','appdata':_0xaa8e('0x33'),'context':_0x5ebcdf[_0xaa8e('0x17')],'exten':_0x5ebcdf[_0xaa8e('0x9')],'priority':_0x2795d2[_0xaa8e('0x28')]+_0x55472c['priority']+_0x1ef928++,'VoiceExtensionId':_0x5ebcdf[_0xaa8e('0x18')]});}}if(_0x5ebcdf[_0xaa8e('0xe')](_0xaa8e('0x34'))){if(_0x2f947c[_0xaa8e('0x35')](_0x5ebcdf[_0xaa8e('0x36')][_0xaa8e('0x29')]())>=0x0&&_0x5ebcdf[_0xaa8e('0x37')]!==_0xaa8e('0x38')){if(_0x5ebcdf[_0xaa8e('0x34')]){_0x2a9590['push']({'type':_0x5ebcdf[_0xaa8e('0x13')],'app':_0xaa8e('0x1f'),'appdata':_0xaa8e('0x39'),'context':_0x5ebcdf['context'],'exten':_0x5ebcdf[_0xaa8e('0x9')],'priority':_0x2795d2['length']+_0x55472c[_0xaa8e('0xf')]+_0x1ef928++,'VoiceExtensionId':_0x5ebcdf[_0xaa8e('0x18')]});_0x2a9590['push']({'type':_0x5ebcdf[_0xaa8e('0x13')],'app':_0xaa8e('0x14'),'appdata':_0xaa8e('0x3a'),'context':_0x5ebcdf[_0xaa8e('0x17')],'exten':_0x5ebcdf[_0xaa8e('0x9')],'priority':_0x2795d2[_0xaa8e('0x28')]+_0x55472c[_0xaa8e('0xf')]+_0x1ef928++,'VoiceExtensionId':_0x5ebcdf[_0xaa8e('0x18')]});}else{_0x2a9590[_0xaa8e('0x12')]({'type':_0x5ebcdf['type'],'app':'ExecIf','appdata':_0xaa8e('0x3b'),'context':_0x5ebcdf[_0xaa8e('0x17')],'exten':_0x5ebcdf[_0xaa8e('0x9')],'priority':_0x2795d2[_0xaa8e('0x28')]+_0x55472c[_0xaa8e('0xf')]+_0x1ef928++,'VoiceExtensionId':_0x5ebcdf[_0xaa8e('0x18')]});_0x2a9590['push']({'type':_0x5ebcdf['type'],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x5ebcdf[_0xaa8e('0x17')],'exten':_0x5ebcdf['exten'],'priority':_0x2795d2[_0xaa8e('0x28')]+_0x55472c[_0xaa8e('0xf')]+_0x1ef928++,'VoiceExtensionId':_0x5ebcdf[_0xaa8e('0x18')]});}}}for(var _0x4e52ac=0x0;_0x4e52ac<_0x2795d2[_0xaa8e('0x28')];_0x4e52ac+=0x1){var _0x5345f2=_0x55472c[_0xaa8e('0xf')]+_0x2795d2[_0xaa8e('0x28')];var _0x488d4e=_0x4e52ac===_0x2795d2[_0xaa8e('0x28')]-0x1?_0x55472c[_0xaa8e('0xf')]+_0x2a9590[_0xaa8e('0x28')]+_0x3b6216[_0xaa8e('0x28')]+0x2:_0x55472c[_0xaa8e('0xf')]+_0x4e52ac+0x1;_0x2a9590[_0xaa8e('0x3c')](_0x4e52ac,0x0,{'type':_0x5ebcdf[_0xaa8e('0x13')],'app':'GotoIfTime','appdata':_0x2795d2[_0x4e52ac]+'?'+_0x5ebcdf['context']+_0xaa8e('0x3d')+_0x5345f2+':'+_0x5ebcdf['context']+_0xaa8e('0x3d')+_0x488d4e,'exten':_0x5ebcdf[_0xaa8e('0x9')],'context':_0x5ebcdf['context'],'priority':_0x55472c[_0xaa8e('0xf')]+_0x4e52ac,'VoiceExtensionId':_0x513462[_0x5f584f][0x0][_0xaa8e('0x18')]});}_0x5ebcdf['priority']=_0x2a9590[_0xaa8e('0x28')]?_[_0xaa8e('0x3e')](_0x2a9590)[_0xaa8e('0xf')]+0x1:_0x55472c[_0xaa8e('0xf')];_0x55472c[_0xaa8e('0xf')]=(_0x3b6216[_0xaa8e('0x28')]?_[_0xaa8e('0x3e')](_0x3b6216)[_0xaa8e('0xf')]:_0x5ebcdf[_0xaa8e('0xf')])+0x1;_0x55472c[_0xaa8e('0x1a')]=_['concat'](_0x55472c['extensions'],_0x2a9590,[_0x5ebcdf],_0x3b6216);}_0x55472c[_0xaa8e('0x1a')][_0xaa8e('0x12')]({'type':_0x513462[_0x5f584f][0x0][_0xaa8e('0x13')],'app':_0xaa8e('0x3f'),'exten':_0x513462[_0x5f584f][0x0][_0xaa8e('0x9')],'context':_0x513462[_0x5f584f][0x0][_0xaa8e('0x17')],'priority':_0x55472c[_0xaa8e('0xf')],'VoiceExtensionId':_0x513462[_0x5f584f][0x0]['VoiceExtensionId']});_0x476de6[_0xaa8e('0x12')](_0x513462[_0x5f584f][0x0][_0xaa8e('0x18')]);_0x47d9dc=_[_0xaa8e('0x40')](_0x47d9dc,_0x55472c[_0xaa8e('0x1a')]);}}return _0x147372[_0xaa8e('0x41')](function(_0x2bafc2){return _0x147372[_0xaa8e('0x2')][_0xaa8e('0x7')][_0xaa8e('0x42')]({'where':{'VoiceExtensionId':{'$in':_0x476de6}},'transaction':_0x2bafc2})[_0xaa8e('0x5')](function(_0x128c7a){return _0x147372[_0xaa8e('0x2')][_0xaa8e('0x7')][_0xaa8e('0x43')](_[_0xaa8e('0x44')](_0x47d9dc,_0xaa8e('0xf')),{'transaction':_0x2bafc2});});});})[_0xaa8e('0x45')](function(_0x239f3b){console[_0xaa8e('0x46')](_0x239f3b);});}exports[_0xaa8e('0x47')]=rewrite; \ No newline at end of file +var _0x9651=['findAll','then','intervals','models','IntervalId','VoiceExtension','uniq','map','filter','groupBy','queue','hasOwnProperty','extensions','extension','find','exten','push','type','Set','format','CDR(type)=%s','context','priority','VoiceExtensionId','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','*,*,*,*','interval','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','indexOf','app','toLowerCase','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','transaction','destroy','bulkCreate','sortBy','catch','error','rewrite','util','Interval'];(function(_0xd77bf5,_0x42b453){var _0x48e838=function(_0x32d312){while(--_0x32d312){_0xd77bf5['push'](_0xd77bf5['shift']());}};_0x48e838(++_0x42b453);}(_0x9651,0x166));var _0x1965=function(_0x5725c2,_0x1c7aee){_0x5725c2=_0x5725c2-0x0;var _0x3073b2=_0x9651[_0x5725c2];return _0x3073b2;};'use strict';var _=require('lodash');var util=require(_0x1965('0x0'));function rewrite(_0x4c5399,_0x249b3c){var _0x120ada=this;return _0x4c5399['models'][_0x1965('0x1')][_0x1965('0x2')]({'raw':!![]})[_0x1965('0x3')](function(_0x3d09d3){_0x120ada[_0x1965('0x4')]=_0x3d09d3;return _0x4c5399[_0x1965('0x5')]['VoiceExtension'][_0x1965('0x2')]({'where':{'IntervalId':_0x249b3c[_0x1965('0x6')]},'raw':!![]});})['then'](function(_0x50f925){return _0x4c5399[_0x1965('0x5')][_0x1965('0x7')][_0x1965('0x2')]({'where':{'exten':{'$in':_[_0x1965('0x8')](_[_0x1965('0x9')](_0x50f925,'exten'))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})['then'](function(_0x90b8c1){var _0x35e0e7=_[_0x1965('0xa')](_0x90b8c1,{'priority':'1'});var _0x3d0792=_[_0x1965('0xa')](_0x90b8c1,{'isApp':0x1});var _0xf131a=_[_0x1965('0xb')](_0x3d0792,'exten');var _0xe28598=[_0x1965('0xc'),'playback'];var _0x2b665f=[];var _0x1a502e=[];for(var _0x1e229a in _0xf131a){if(_0xf131a[_0x1965('0xd')](_0x1e229a)){_0x120ada['priority']=0x2;_0x120ada[_0x1965('0xe')]=[];_0x120ada[_0x1965('0xf')]=_[_0x1965('0x10')](_0x35e0e7,{'exten':_0xf131a[_0x1e229a][0x0][_0x1965('0x11')]});_0x120ada[_0x1965('0xe')][_0x1965('0x12')]({'type':_0xf131a[_0x1e229a][0x0][_0x1965('0x13')],'app':_0x1965('0x14'),'appdata':util[_0x1965('0x15')](_0x1965('0x16'),_0xf131a[_0x1e229a][0x0][_0x1965('0x13')]),'context':_0xf131a[_0x1e229a][0x0][_0x1965('0x17')],'exten':_0xf131a[_0x1e229a][0x0][_0x1965('0x11')],'priority':_0x120ada[_0x1965('0x18')]++,'VoiceExtensionId':_0xf131a[_0x1e229a][0x0][_0x1965('0x19')]});if(_0xf131a[_0x1e229a][0x0][_0x1965('0x13')]===_0x1965('0x1a')){if(_0x120ada[_0x1965('0xf')]){_0x120ada[_0x1965('0xe')][_0x1965('0x12')]({'type':_0xf131a[_0x1e229a][0x0]['type'],'app':_0x1965('0x14'),'appdata':_0x1965('0x1b')+(_0x120ada[_0x1965('0xf')][_0x1965('0x1c')]?_0x1965('0x1d')+_0x120ada[_0x1965('0xf')][_0x1965('0x1c')]+'}':_0x1965('0x1e')),'context':_0xf131a[_0x1e229a][0x0]['context'],'exten':_0xf131a[_0x1e229a][0x0][_0x1965('0x11')],'priority':_0x120ada[_0x1965('0x18')]++,'VoiceExtensionId':_0xf131a[_0x1e229a][0x0][_0x1965('0x19')]});}_0x120ada['extensions']['push']({'type':_0xf131a[_0x1e229a][0x0]['type'],'app':'Set','appdata':_0x1965('0x1f')+_0xf131a[_0x1e229a][0x0]['VoiceExtensionId'],'context':_0xf131a[_0x1e229a][0x0][_0x1965('0x17')],'exten':_0xf131a[_0x1e229a][0x0][_0x1965('0x11')],'priority':_0x120ada[_0x1965('0x18')]++,'VoiceExtensionId':_0xf131a[_0x1e229a][0x0][_0x1965('0x19')]});var _0x3a3ff4=_0x120ada[_0x1965('0x18')]++;_0x120ada[_0x1965('0xe')]['push']({'type':_0xf131a[_0x1e229a][0x0]['type'],'app':_0x1965('0x20'),'appdata':_0x1965('0x21')+(_0x3a3ff4+0x2)+_0x1965('0x22')+(_0x3a3ff4+0x1)+')','context':_0xf131a[_0x1e229a][0x0][_0x1965('0x17')],'exten':_0xf131a[_0x1e229a][0x0][_0x1965('0x11')],'priority':_0x3a3ff4,'VoiceExtensionId':_0xf131a[_0x1e229a][0x0][_0x1965('0x19')]});if(_0x120ada['extension']){_0x120ada[_0x1965('0xe')]['push']({'type':_0xf131a[_0x1e229a][0x0][_0x1965('0x13')],'app':'Set','appdata':_0x120ada['extension'][_0x1965('0x1c')]?'CDR(prefix)=${EXTEN:0:'+_0x120ada[_0x1965('0xf')][_0x1965('0x1c')]+'}':'CDR(prefix)=noprefix','context':_0xf131a[_0x1e229a][0x0][_0x1965('0x17')],'exten':_0xf131a[_0x1e229a][0x0][_0x1965('0x11')],'priority':_0x120ada[_0x1965('0x18')]++,'VoiceExtensionId':_0xf131a[_0x1e229a][0x0]['VoiceExtensionId']});}_0x120ada[_0x1965('0xe')]['push']({'type':_0xf131a[_0x1e229a][0x0]['type'],'app':_0x1965('0x14'),'appdata':_0x1965('0x23')+_0xf131a[_0x1e229a][0x0][_0x1965('0x19')],'context':_0xf131a[_0x1e229a][0x0][_0x1965('0x17')],'exten':_0xf131a[_0x1e229a][0x0][_0x1965('0x11')],'priority':_0x120ada['priority']++,'VoiceExtensionId':_0xf131a[_0x1e229a][0x0][_0x1965('0x19')]});if(_0x120ada[_0x1965('0xf')]&&_0x120ada[_0x1965('0xf')]['hasOwnProperty'](_0x1965('0x24'))&&_0x120ada[_0x1965('0xf')][_0x1965('0x24')]!==_0x1965('0x25')){_0x120ada[_0x1965('0xe')][_0x1965('0x12')]({'type':_0xf131a[_0x1e229a][0x0][_0x1965('0x13')],'app':_0x1965('0x14'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0xf131a[_0x1e229a][0x0][_0x1965('0x17')],'exten':_0xf131a[_0x1e229a][0x0][_0x1965('0x11')],'priority':_0x120ada[_0x1965('0x18')]++,'VoiceExtensionId':_0xf131a[_0x1e229a][0x0][_0x1965('0x19')]});_0x120ada[_0x1965('0xe')][_0x1965('0x12')]({'type':_0xf131a[_0x1e229a][0x0][_0x1965('0x13')],'app':_0x1965('0x14'),'appdata':_0x1965('0x26')+_0x120ada[_0x1965('0xf')][_0x1965('0x24')]||_0x1965('0x27'),'context':_0xf131a[_0x1e229a][0x0][_0x1965('0x17')],'exten':_0xf131a[_0x1e229a][0x0]['exten'],'priority':_0x120ada[_0x1965('0x18')]++,'VoiceExtensionId':_0xf131a[_0x1e229a][0x0][_0x1965('0x19')]});}}_0x120ada[_0x1965('0xe')][_0x1965('0x12')]({'type':_0xf131a[_0x1e229a][0x0][_0x1965('0x13')],'app':'Set','appdata':_0x1965('0x28'),'context':_0xf131a[_0x1e229a][0x0]['context'],'exten':_0xf131a[_0x1e229a][0x0][_0x1965('0x11')],'priority':_0x120ada[_0x1965('0x18')]++,'VoiceExtensionId':_0xf131a[_0x1e229a][0x0][_0x1965('0x19')]});_0x120ada[_0x1965('0xe')][_0x1965('0x12')]({'type':_0xf131a[_0x1e229a][0x0][_0x1965('0x13')],'app':_0x1965('0x14'),'appdata':_0x1965('0x29'),'context':_0xf131a[_0x1e229a][0x0][_0x1965('0x17')],'exten':_0xf131a[_0x1e229a][0x0][_0x1965('0x11')],'priority':_0x120ada['priority']++,'VoiceExtensionId':_0xf131a[_0x1e229a][0x0][_0x1965('0x19')]});_0x120ada['extensions']['push']({'type':_0xf131a[_0x1e229a][0x0][_0x1965('0x13')],'app':_0x1965('0x14'),'appdata':_0x1965('0x2a'),'context':_0xf131a[_0x1e229a][0x0][_0x1965('0x17')],'exten':_0xf131a[_0x1e229a][0x0][_0x1965('0x11')],'priority':_0x120ada[_0x1965('0x18')]++,'VoiceExtensionId':_0xf131a[_0x1e229a][0x0][_0x1965('0x19')]});for(var _0x37bbfa=0x0,_0x4dfd46=0x0;_0x37bbfa<_0xf131a[_0x1e229a][_0x1965('0x2b')];_0x37bbfa+=0x1,_0x4dfd46=0x0){var _0x5390c0=_0xf131a[_0x1e229a][_0x37bbfa];if(_0x5390c0[_0x1965('0x13')]){_0x5390c0['type']=_0x5390c0[_0x1965('0x13')]['toLowerCase']();}var _0x2c894d=[];var _0x259db7=[];delete _0x5390c0['id'];delete _0x5390c0['createdAt'];delete _0x5390c0['updatedAt'];var _0xe181fb=_0x5390c0['interval']!==_0x1965('0x2c')?[_0x5390c0[_0x1965('0x2d')]]:_0x5390c0['IntervalId']?_[_0x1965('0x9')](_[_0x1965('0xa')](_0x120ada['intervals'],{'IntervalId':_0x5390c0[_0x1965('0x6')]}),_0x1965('0x2d')):[];if(_0x5390c0[_0x1965('0xd')]('tag')){if(_0x5390c0[_0x1965('0x2e')]&&_0x5390c0['tag']!=='--'){_0x2c894d['push']({'type':_0x5390c0[_0x1965('0x13')],'app':'Set','appdata':_0x1965('0x2f')+_0x5390c0[_0x1965('0x2e')],'context':_0x5390c0[_0x1965('0x17')],'exten':_0x5390c0[_0x1965('0x11')],'priority':_0xe181fb[_0x1965('0x2b')]+_0x120ada[_0x1965('0x18')]+_0x4dfd46++,'VoiceExtensionId':_0x5390c0[_0x1965('0x19')]});}}if(_0x5390c0[_0x1965('0x13')]===_0x1965('0x1a')&&_0x5390c0[_0x1965('0xd')](_0x1965('0x30'))){if(_0x5390c0['callerID']){_0x2c894d[_0x1965('0x12')]({'type':_0x5390c0[_0x1965('0x13')],'app':_0x1965('0x20'),'appdata':_0x1965('0x31')+_0x5390c0['callerID']+')','context':_0x5390c0[_0x1965('0x17')],'exten':_0x5390c0[_0x1965('0x11')],'priority':_0xe181fb[_0x1965('0x2b')]+_0x120ada[_0x1965('0x18')]+_0x4dfd46++,'VoiceExtensionId':_0x5390c0[_0x1965('0x19')]});}else{_0x2c894d[_0x1965('0x12')]({'type':_0x5390c0['type'],'app':_0x1965('0x20'),'appdata':_0x1965('0x32'),'context':_0x5390c0[_0x1965('0x17')],'exten':_0x5390c0[_0x1965('0x11')],'priority':_0xe181fb[_0x1965('0x2b')]+_0x120ada[_0x1965('0x18')]+_0x4dfd46++,'VoiceExtensionId':_0x5390c0[_0x1965('0x19')]});}}if(_0x5390c0[_0x1965('0xd')]('answer')){if(_0xe28598[_0x1965('0x33')](_0x5390c0[_0x1965('0x34')][_0x1965('0x35')]())>=0x0&&_0x5390c0['appType']!==_0x1965('0x36')){if(_0x5390c0[_0x1965('0x37')]){_0x2c894d[_0x1965('0x12')]({'type':_0x5390c0['type'],'app':_0x1965('0x20'),'appdata':_0x1965('0x38'),'context':_0x5390c0['context'],'exten':_0x5390c0[_0x1965('0x11')],'priority':_0xe181fb[_0x1965('0x2b')]+_0x120ada['priority']+_0x4dfd46++,'VoiceExtensionId':_0x5390c0[_0x1965('0x19')]});_0x2c894d[_0x1965('0x12')]({'type':_0x5390c0['type'],'app':_0x1965('0x14'),'appdata':_0x1965('0x39'),'context':_0x5390c0['context'],'exten':_0x5390c0[_0x1965('0x11')],'priority':_0xe181fb['length']+_0x120ada[_0x1965('0x18')]+_0x4dfd46++,'VoiceExtensionId':_0x5390c0[_0x1965('0x19')]});}else{_0x2c894d[_0x1965('0x12')]({'type':_0x5390c0[_0x1965('0x13')],'app':'ExecIf','appdata':_0x1965('0x3a'),'context':_0x5390c0[_0x1965('0x17')],'exten':_0x5390c0['exten'],'priority':_0xe181fb[_0x1965('0x2b')]+_0x120ada[_0x1965('0x18')]+_0x4dfd46++,'VoiceExtensionId':_0x5390c0[_0x1965('0x19')]});_0x2c894d[_0x1965('0x12')]({'type':_0x5390c0['type'],'app':_0x1965('0x14'),'appdata':_0x1965('0x3b'),'context':_0x5390c0['context'],'exten':_0x5390c0[_0x1965('0x11')],'priority':_0xe181fb[_0x1965('0x2b')]+_0x120ada['priority']+_0x4dfd46++,'VoiceExtensionId':_0x5390c0[_0x1965('0x19')]});}}}for(var _0x249ff0=0x0;_0x249ff0<_0xe181fb[_0x1965('0x2b')];_0x249ff0+=0x1){var _0x4c1d28=_0x120ada[_0x1965('0x18')]+_0xe181fb[_0x1965('0x2b')];var _0x846412=_0x249ff0===_0xe181fb[_0x1965('0x2b')]-0x1?_0x120ada['priority']+_0x2c894d[_0x1965('0x2b')]+_0x259db7['length']+0x2:_0x120ada[_0x1965('0x18')]+_0x249ff0+0x1;_0x2c894d[_0x1965('0x3c')](_0x249ff0,0x0,{'type':_0x5390c0[_0x1965('0x13')],'app':_0x1965('0x3d'),'appdata':_0xe181fb[_0x249ff0]+'?'+_0x5390c0[_0x1965('0x17')]+_0x1965('0x3e')+_0x4c1d28+':'+_0x5390c0[_0x1965('0x17')]+',${EXTEN},'+_0x846412,'exten':_0x5390c0['exten'],'context':_0x5390c0['context'],'priority':_0x120ada[_0x1965('0x18')]+_0x249ff0,'VoiceExtensionId':_0xf131a[_0x1e229a][0x0][_0x1965('0x19')]});}_0x5390c0[_0x1965('0x18')]=_0x2c894d[_0x1965('0x2b')]?_[_0x1965('0x3f')](_0x2c894d)[_0x1965('0x18')]+0x1:_0x120ada[_0x1965('0x18')];_0x120ada['priority']=(_0x259db7[_0x1965('0x2b')]?_[_0x1965('0x3f')](_0x259db7)['priority']:_0x5390c0[_0x1965('0x18')])+0x1;_0x120ada[_0x1965('0xe')]=_[_0x1965('0x40')](_0x120ada[_0x1965('0xe')],_0x2c894d,[_0x5390c0],_0x259db7);}_0x120ada['extensions']['push']({'type':_0xf131a[_0x1e229a][0x0][_0x1965('0x13')],'app':'Hangup','exten':_0xf131a[_0x1e229a][0x0][_0x1965('0x11')],'context':_0xf131a[_0x1e229a][0x0][_0x1965('0x17')],'priority':_0x120ada[_0x1965('0x18')],'VoiceExtensionId':_0xf131a[_0x1e229a][0x0][_0x1965('0x19')]});_0x2b665f[_0x1965('0x12')](_0xf131a[_0x1e229a][0x0][_0x1965('0x19')]);_0x1a502e=_[_0x1965('0x40')](_0x1a502e,_0x120ada[_0x1965('0xe')]);}}return _0x4c5399[_0x1965('0x41')](function(_0x5c6a44){return _0x4c5399[_0x1965('0x5')]['VoiceExtension'][_0x1965('0x42')]({'where':{'VoiceExtensionId':{'$in':_0x2b665f}},'transaction':_0x5c6a44})[_0x1965('0x3')](function(_0x29b22e){return _0x4c5399['models'][_0x1965('0x7')][_0x1965('0x43')](_[_0x1965('0x44')](_0x1a502e,_0x1965('0x18')),{'transaction':_0x5c6a44});});});})[_0x1965('0x45')](function(_0x4f4fa9){console[_0x1965('0x46')](_0x4f4fa9);});}exports[_0x1965('0x47')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index bc06756..9d7b337 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 _0xcb91=['generalCheckHopper','Error\x20processing\x20rows\x20block:','resolve','emit','contact:csv_','unlinkSync','exit','SIGINT','CSV\x20import\x20process\x20stopped!','createReadStream','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','lodash','squel','papaparse','ioredis','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','null','Missing\x20filepath\x20parameter!','undefined','zipObject','split','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','birthDate','YYYY-MM-DD','email','ListId','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','catch','stringify','cmContact','checkHopper','inspect','insert','cm_hopper','phone','ContactId','createdAt','updatedAt','select','field','NOW()','scheduledAt','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','where','\x20=\x20?','into','fromQuery','id\x20IN\x20?','str','phone\x20IS\x20NOT\x20NULL','calleridnum','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','findAll','outbound','dialCheckDuplicateType','CmList','Lists','always','sequelize','query','VoiceQueueId','all','VoiceQueue','BlackLists','get','CampaignId','onlyIfOpen','cmContact,\x20%s,\x20%s'];(function(_0x46d580,_0x29f961){var _0x418acc=function(_0x187343){while(--_0x187343){_0x46d580['push'](_0x46d580['shift']());}};_0x418acc(++_0x29f961);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x274638,_0x578968){_0x274638=_0x274638-0x0;var _0x5755df=_0xcb91[_0x274638];return _0x5755df;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x1cb9('0x0'));var fs=require('fs');var squel=require(_0x1cb9('0x1'));var Papa=require(_0x1cb9('0x2'));var Redis=require(_0x1cb9('0x3'));var db=require('../../../mysqldb')['db'];var config=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('api');config[_0x1cb9('0x6')]=_[_0x1cb9('0x7')](config['redis'],{'host':_0x1cb9('0x8'),'port':0x18eb});var socket=require(_0x1cb9('0x9'))(new Redis(config['redis']));require(_0x1cb9('0xa'))[_0x1cb9('0xb')](socket);try{if(!process['argv'][0x2]||process[_0x1cb9('0xc')][0x2]==='undefined'||process['argv'][0x2]===_0x1cb9('0xd')){throw new Error(_0x1cb9('0xe'));}var FILEPATH=process[_0x1cb9('0xc')][0x2];if(!process[_0x1cb9('0xc')][0x3]||process[_0x1cb9('0xc')][0x3]==='undefined'||process[_0x1cb9('0xc')][0x3]===_0x1cb9('0xd')||!process[_0x1cb9('0xc')][0x4]||process[_0x1cb9('0xc')][0x4]===_0x1cb9('0xf')||process['argv'][0x4]==='null'){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0x1cb9('0x10')](process[_0x1cb9('0xc')][0x3][_0x1cb9('0x11')](','),process[_0x1cb9('0xc')][0x4]['split'](','));if(!process[_0x1cb9('0xc')][0x5]||process[_0x1cb9('0xc')][0x5]===_0x1cb9('0xf')||process[_0x1cb9('0xc')][0x5]===_0x1cb9('0xd')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x1cb9('0xc')][0x6]&&process[_0x1cb9('0xc')][0x6]!==_0x1cb9('0xf')&&process[_0x1cb9('0xc')][0x6]!==_0x1cb9('0xd')?process[_0x1cb9('0xc')][0x6]:null;var DUPLICATES=process[_0x1cb9('0xc')][0x7]&&process['argv'][0x7]!=='undefined'&&process[_0x1cb9('0xc')][0x7]!==_0x1cb9('0xd')?process[_0x1cb9('0xc')][0x7]:null;if(!process[_0x1cb9('0xc')][0x8]||process[_0x1cb9('0xc')][0x8]===_0x1cb9('0xf')||process[_0x1cb9('0xc')][0x8]==='null'){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x1cb9('0xc')][0x8];}catch(_0x5dbfae){logger[_0x1cb9('0x12')](_0x5dbfae);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(_0x2265ea,_0x523b26,_0x599275,_0x2e3854){var _0x325637={'message':_0x523b26};_0x325637[_0x2265ea]=!![];if(_0x599275){_0x325637[_0x1cb9('0x13')]=_0x599275;}if(_0x2e3854){_0x325637[_0x1cb9('0x14')]=_0x2e3854;}return _0x325637;}function isEmail(_0x45b8d3){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))*$/[_0x1cb9('0x15')](_0x45b8d3);}function checkRow(_0x59ebea,_0x55b232,_0x6c6f61){return new BPromise(function(_0x557199,_0x10a419){if(_[_0x1cb9('0x16')](_0x59ebea)){return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),_0x1cb9('0x17'),null,_0x6c6f61));}if(_0x59ebea[_0x1cb9('0x18')]&&_0x59ebea['errors'][_0x1cb9('0x19')]){var _0x9df250=_['map'](_0x59ebea[_0x1cb9('0x18')],_0x1cb9('0x1a'))[_0x1cb9('0x1b')](';');return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),_0x9df250,null,_0x6c6f61));}var _0x406821={};for(var _0x21d6f5 in FIELDS){if(FIELDS[_0x1cb9('0x1c')](_0x21d6f5)&&FIELDS[_0x21d6f5]){_0x406821[_0x21d6f5]=_0x59ebea[_0x1cb9('0x1d')][0x0][FIELDS[_0x21d6f5]]||_0x59ebea[_0x1cb9('0x1d')][0x0]['\ufeff'+FIELDS[_0x21d6f5]];}}if(!_0x406821[_0x1cb9('0x1e')]){return _0x10a419(handleCheckRowError('error',_0x1cb9('0x1f'),null,_0x6c6f61));}if(!_0x406821['phone']){return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),'phone\x20not\x20specified!',null,_0x6c6f61));}if(_0x406821[_0x1cb9('0x20')]){var _0x41011c=moment(_0x406821[_0x1cb9('0x20')],_0x1cb9('0x21'));if(!_0x41011c['isValid']()){return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x6c6f61));}}if(_0x406821[_0x1cb9('0x22')]){if(!isEmail(_0x406821[_0x1cb9('0x22')])){return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),'email\x20format\x20is\x20not\x20valid!',null,_0x6c6f61));}}_0x406821[_0x1cb9('0x23')]=LISTID;_0x406821['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x1cb9('0x19')]&&_0x55b232){var _0x58f4f5={};for(var _0x2164e3=0x0,_0x42a688=DUPLICATES[_0x1cb9('0x19')];_0x2164e3<_0x42a688;_0x2164e3+=0x1){_0x58f4f5[DUPLICATES[_0x2164e3]]=_0x406821[DUPLICATES[_0x2164e3]];}var _0xae910=_['find'](_0x55b232,_0x58f4f5);if(_0xae910){return _0x10a419(handleCheckRowError(_0x1cb9('0x24'),_0x1cb9('0x25'),_0xae910,_0x6c6f61));}}return db[_0x1cb9('0x26')][_0x1cb9('0x27')](_0x406821,{'raw':!![],'hooks':![],'fields':_[_0x1cb9('0x28')](_0x406821)})[_0x1cb9('0x29')](function(_0xc6d5fd){if(DUPLICATES&&DUPLICATES[_0x1cb9('0x19')]&&_0x55b232){_0x55b232[_0x1cb9('0x2a')](_[_0x1cb9('0x2b')](_0x406821,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0xc6d5fd['id'];return _0x557199();})[_0x1cb9('0x2c')](function(_0x26b950){return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),'Error\x20while\x20creating\x20contact:\x20'+(_0x26b950['message']||JSON[_0x1cb9('0x2d')](_0x26b950)),null,_0x6c6f61));});});}function checkHopper(){function _0x30f7e4(){return function(_0x91c937){logger[_0x1cb9('0x12')](_0x1cb9('0x2e'),_0x1cb9('0x2f'),util[_0x1cb9('0x30')](_0x91c937,{'showHidden':![],'depth':null}));};}var _0x3f5637=function(_0x4d3e39,_0x2aa59b){var _0x1482c4=squel[_0x1cb9('0x31')]()['into'](_0x1cb9('0x32'))['fromQuery']([_0x1cb9('0x33'),'scheduledAt',_0x1cb9('0x34'),_0x1cb9('0x23'),_0x2aa59b,_0x1cb9('0x35'),_0x1cb9('0x36')],squel[_0x1cb9('0x37')]()[_0x1cb9('0x38')](_0x1cb9('0x33'),'phone')['field'](_0x1cb9('0x39'),_0x1cb9('0x3a'))[_0x1cb9('0x38')]('id',_0x1cb9('0x34'))[_0x1cb9('0x38')](LISTID[_0x1cb9('0x3b')](),_0x1cb9('0x23'))['field'](_0x4d3e39['id'][_0x1cb9('0x3b')](),_0x2aa59b)['field']('NOW()','createdAt')[_0x1cb9('0x38')](_0x1cb9('0x39'),_0x1cb9('0x36'))[_0x1cb9('0x3c')](_0x1cb9('0x3d'))['where'](_0x1cb9('0x3e'))['where'](_0x1cb9('0x3f'),LISTID[_0x1cb9('0x3b')]())[_0x1cb9('0x40')]('phone\x20IS\x20NOT\x20NULL')[_0x1cb9('0x40')]('phone\x20NOT\x20IN\x20(?)',squel[_0x1cb9('0x37')]()[_0x1cb9('0x38')]('phone')['from'](_0x1cb9('0x32'))[_0x1cb9('0x40')](_0x2aa59b+_0x1cb9('0x41'),_0x4d3e39['id'][_0x1cb9('0x3b')]())))[_0x1cb9('0x3b')]();return _0x1482c4;};var _0x58832e=function(_0x11d877,_0x5594fc){var _0x4c59e7=squel['insert']()[_0x1cb9('0x42')](_0x1cb9('0x32'))[_0x1cb9('0x43')]([_0x1cb9('0x33'),_0x1cb9('0x3a'),_0x1cb9('0x34'),_0x1cb9('0x23'),_0x5594fc,_0x1cb9('0x35'),_0x1cb9('0x36')],squel[_0x1cb9('0x37')]()[_0x1cb9('0x38')]('phone',_0x1cb9('0x33'))[_0x1cb9('0x38')](_0x1cb9('0x39'),'scheduledAt')[_0x1cb9('0x38')]('id',_0x1cb9('0x34'))[_0x1cb9('0x38')](LISTID[_0x1cb9('0x3b')](),_0x1cb9('0x23'))['field'](_0x11d877['id'][_0x1cb9('0x3b')](),_0x5594fc)['field'](_0x1cb9('0x39'),'createdAt')[_0x1cb9('0x38')](_0x1cb9('0x39'),_0x1cb9('0x36'))[_0x1cb9('0x3c')]('cm_contacts')[_0x1cb9('0x40')](_0x1cb9('0x3e'))[_0x1cb9('0x40')](_0x1cb9('0x3f'),LISTID[_0x1cb9('0x3b')]())[_0x1cb9('0x40')](_0x1cb9('0x44'),squel[_0x1cb9('0x45')](hopperContacts))[_0x1cb9('0x40')](_0x1cb9('0x46'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x1cb9('0x37')]()[_0x1cb9('0x38')](_0x1cb9('0x47'))[_0x1cb9('0x3c')](_0x1cb9('0x48'))[_0x1cb9('0x40')](_0x5594fc+_0x1cb9('0x41'),_0x11d877['id'][_0x1cb9('0x3b')]()))[_0x1cb9('0x40')](_0x1cb9('0x49'),squel['select']()[_0x1cb9('0x38')]('phone')[_0x1cb9('0x3c')]('cm_hopper')[_0x1cb9('0x40')](_0x5594fc+'\x20=\x20?',_0x11d877['id']['toString']())))[_0x1cb9('0x3b')]();return _0x4c59e7;};function _0x3b0c2e(_0x303da3,_0x4bce54){var _0x3c157f=squel[_0x1cb9('0x31')]()['into']('cm_hopper')[_0x1cb9('0x43')]([_0x1cb9('0x33'),_0x1cb9('0x3a'),_0x1cb9('0x34'),_0x1cb9('0x23'),_0x4bce54,_0x1cb9('0x35'),_0x1cb9('0x36')],squel['select']()[_0x1cb9('0x38')](_0x1cb9('0x33'),_0x1cb9('0x33'))['field'](_0x1cb9('0x39'),_0x1cb9('0x3a'))[_0x1cb9('0x38')]('id',_0x1cb9('0x34'))[_0x1cb9('0x38')](LISTID[_0x1cb9('0x3b')](),'ListId')[_0x1cb9('0x38')](_0x303da3['id'][_0x1cb9('0x3b')](),_0x4bce54)[_0x1cb9('0x38')](_0x1cb9('0x39'),_0x1cb9('0x35'))[_0x1cb9('0x38')](_0x1cb9('0x39'),_0x1cb9('0x36'))[_0x1cb9('0x3c')](_0x1cb9('0x3d'))[_0x1cb9('0x40')]('deletedAt\x20IS\x20NULL')[_0x1cb9('0x40')](_0x1cb9('0x3f'),LISTID[_0x1cb9('0x3b')]())[_0x1cb9('0x40')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x1cb9('0x40')](_0x1cb9('0x46')))[_0x1cb9('0x3b')]();return _0x3c157f;}function _0x173db5(_0x3c2f9c,_0x75c734){var _0xc515a6=squel[_0x1cb9('0x31')]()['into']('cm_hopper_black')[_0x1cb9('0x43')](['phone','ContactId','ListId',_0x75c734,'createdAt','updatedAt'],squel[_0x1cb9('0x37')]()[_0x1cb9('0x38')](_0x1cb9('0x33'),_0x1cb9('0x33'))[_0x1cb9('0x38')]('id',_0x1cb9('0x34'))['field'](LISTID[_0x1cb9('0x3b')](),_0x1cb9('0x23'))['field'](_0x3c2f9c['id']['toString'](),_0x75c734)[_0x1cb9('0x38')](_0x1cb9('0x39'),_0x1cb9('0x35'))[_0x1cb9('0x38')](_0x1cb9('0x39'),'updatedAt')['from']('cm_contacts')[_0x1cb9('0x40')](_0x1cb9('0x3e'))[_0x1cb9('0x40')](_0x1cb9('0x3f'),LISTID[_0x1cb9('0x3b')]())['where'](_0x1cb9('0x44'),squel[_0x1cb9('0x45')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0x1cb9('0x3b')]();return _0xc515a6;}return db['VoiceQueue'][_0x1cb9('0x4a')]({'where':{'type':_0x1cb9('0x4b')},'attributes':['id',_0x1cb9('0x4c')],'include':[{'model':db[_0x1cb9('0x4d')],'as':_0x1cb9('0x4e'),'where':{'id':LISTID}}]})[_0x1cb9('0x29')](function(_0x4aeeff){var _0xde0d93=[];if(_0x4aeeff){var _0x15fc04;for(var _0x330fc1=0x0,_0x17c361;_0x330fc1<_0x4aeeff['length'];_0x330fc1+=0x1){_0x17c361=_0x4aeeff[_0x330fc1]['get']({'plain':!![]});switch(_0x17c361[_0x1cb9('0x4c')]){case _0x1cb9('0x4f'):_0xde0d93[_0x1cb9('0x2a')](db[_0x1cb9('0x50')][_0x1cb9('0x51')](_0x58832e(_0x17c361,_0x1cb9('0x52')))['then'](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));break;case'onlyIfOpen':_0xde0d93[_0x1cb9('0x2a')](db[_0x1cb9('0x50')]['query'](_0x3f5637(_0x17c361,_0x1cb9('0x52')))[_0x1cb9('0x29')](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));break;default:_0xde0d93['push'](db[_0x1cb9('0x50')][_0x1cb9('0x51')](_0x3b0c2e(_0x17c361,_0x1cb9('0x52')))[_0x1cb9('0x29')](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));}}}return _0xde0d93;})[_0x1cb9('0x53')]()['then'](function(){return db[_0x1cb9('0x54')][_0x1cb9('0x4a')]({'where':{'type':_0x1cb9('0x4b')},'attributes':['id'],'include':[{'model':db[_0x1cb9('0x4d')],'as':_0x1cb9('0x55'),'where':{'id':LISTID}}]})[_0x1cb9('0x29')](function(_0x128a41){var _0x37bcd9=[];if(_0x128a41){var _0x4cd544;for(var _0x28bac2=0x0,_0x78e9c;_0x28bac2<_0x128a41['length'];_0x28bac2+=0x1){_0x78e9c=_0x128a41[_0x28bac2][_0x1cb9('0x56')]({'plain':!![]});_0x37bcd9['push'](db[_0x1cb9('0x50')]['query'](_0x173db5(_0x78e9c,'VoiceQueueId'))[_0x1cb9('0x29')](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));}}return _0x37bcd9;})['all']();})[_0x1cb9('0x29')](function(){return db['Campaign'][_0x1cb9('0x4a')]({'attributes':['id',_0x1cb9('0x4c')],'include':[{'model':db[_0x1cb9('0x4d')],'as':_0x1cb9('0x4e'),'where':{'id':LISTID}}]})['then'](function(_0x45ca54){var _0x3d25a3=[];if(_0x45ca54){for(var _0x2a157d=0x0,_0x27cc3c;_0x2a157d<_0x45ca54[_0x1cb9('0x19')];_0x2a157d+=0x1){_0x27cc3c=_0x45ca54[_0x2a157d][_0x1cb9('0x56')]({'plain':!![]});switch(_0x27cc3c['dialCheckDuplicateType']){case _0x1cb9('0x4f'):_0x3d25a3[_0x1cb9('0x2a')](db[_0x1cb9('0x50')][_0x1cb9('0x51')](_0x58832e(_0x27cc3c,_0x1cb9('0x57')))[_0x1cb9('0x29')](function(){})['catch'](_0x30f7e4()));break;case _0x1cb9('0x58'):_0x3d25a3[_0x1cb9('0x2a')](db['sequelize'][_0x1cb9('0x51')](_0x3f5637(_0x27cc3c,_0x1cb9('0x57')))[_0x1cb9('0x29')](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));break;default:_0x3d25a3[_0x1cb9('0x2a')](db[_0x1cb9('0x50')][_0x1cb9('0x51')](_0x3b0c2e(_0x27cc3c,'CampaignId'))[_0x1cb9('0x29')](function(){})['catch'](_0x30f7e4()));}}}return _0x3d25a3;})[_0x1cb9('0x53')]();})[_0x1cb9('0x29')](function(){return db['Campaign'][_0x1cb9('0x4a')]({'attributes':['id'],'include':[{'model':db[_0x1cb9('0x4d')],'as':_0x1cb9('0x55'),'where':{'id':LISTID}}]})[_0x1cb9('0x29')](function(_0x56f23d){var _0x113367=[];if(_0x56f23d){for(var _0x39b0cb=0x0,_0x429371;_0x39b0cb<_0x56f23d['length'];_0x39b0cb+=0x1){_0x429371=_0x56f23d[_0x39b0cb][_0x1cb9('0x56')]({'plain':!![]});_0x113367[_0x1cb9('0x2a')](db[_0x1cb9('0x50')][_0x1cb9('0x51')](_0x173db5(_0x429371,_0x1cb9('0x57')))[_0x1cb9('0x29')](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));}}return _0x113367;})['all']();})[_0x1cb9('0x2c')](function(_0x4b15a4){logger[_0x1cb9('0x12')](_0x1cb9('0x59'),_0x1cb9('0x5a'),_0x4b15a4[_0x1cb9('0x1a')]);});}var processPromises=function(_0x4bdbd2){return BPromise[_0x1cb9('0x53')](promises)[_0x1cb9('0x29')](function(_0x5e68a1){})[_0x1cb9('0x2c')](function(_0x416508){logger[_0x1cb9('0x12')](_0x1cb9('0x5b'),JSON[_0x1cb9('0x2d')](_0x416508));})['finally'](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x4bdbd2){return _0x4bdbd2['resume']();}});};var endCsv=function(){return BPromise[_0x1cb9('0x5c')]()[_0x1cb9('0x29')](function(){if(hopperContacts){return checkHopper();}})[_0x1cb9('0x29')](function(){socket[_0x1cb9('0x5d')](_0x1cb9('0x5e')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x1cb9('0x5f')](FILEPATH);}catch(_0x1e6402){logger[_0x1cb9('0x12')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x1cb9('0x2d')](_0x1e6402));}finally{process[_0x1cb9('0x60')](0x0);}});};process['on'](_0x1cb9('0x61'),function(){logger['info'](_0x1cb9('0x62'));endCsv();});function main(){return BPromise[_0x1cb9('0x5c')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x1cb9('0x11')](',');return db[_0x1cb9('0x26')][_0x1cb9('0x4a')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x1cb9('0x29')](function(_0x5cb5e5){var _0x2c0416=fs[_0x1cb9('0x63')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x2c0416,{'header':!![],'skipEmptyLines':!![],'step':function(_0x5bd78d,_0x1f2d69){total+=0x1;var _0x3ba0a5=total;promises['push'](checkRow(_0x5bd78d,_0x5cb5e5,_0x3ba0a5)['then'](function(){success+=0x1;})[_0x1cb9('0x2c')](function(_0x3486e5){if(_0x3486e5['error']){errors+=0x1;delete _0x3486e5['error'];}else if(_0x3486e5[_0x1cb9('0x24')]){duplicates+=0x1;delete _0x3486e5['duplicate'];}rows['push'](_0x3486e5);}));if(total%0xc8===0x0){_0x1f2d69['pause']();return processPromises(_0x1f2d69);}},'complete':function(){return processPromises()[_0x1cb9('0x29')](function(){logger['info'](_0x1cb9('0x64'));endCsv();});},'error':function(_0x3c717b,_0x33ec43){logger['info'](_0x1cb9('0x65'),JSON[_0x1cb9('0x2d')](_0x3c717b));endCsv();}});})[_0x1cb9('0x2c')](function(_0x4c54b5){logger[_0x1cb9('0x12')](_0x1cb9('0x66'),JSON[_0x1cb9('0x2d')](_0x4c54b5));});}main(); \ No newline at end of file +var _0xd8b0=['find','Duplicate\x20Contact','CmContact','keys','then','push','pick','catch','message','stringify','cmContact','checkHopper','inspect','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','ListId','toString','NOW()','from','cm_contacts','where','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','ListId\x20=\x20?','id\x20IN\x20?','insert','deletedAt\x20IS\x20NULL','str','cm_hopper_black','VoiceQueue','outbound','Lists','get','dialCheckDuplicateType','always','sequelize','VoiceQueueId','onlyIfOpen','query','all','CmList','Campaign','findAll','CampaignId','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','info','createReadStream','parse','duplicate','pause','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','contact','index','test','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','map','hasOwnProperty','data','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','email','CompanyId','length'];(function(_0x2415af,_0x29585a){var _0x2ff2e4=function(_0x369011){while(--_0x369011){_0x2415af['push'](_0x2415af['shift']());}};_0x2ff2e4(++_0x29585a);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var BPromise=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var _=require('lodash');var fs=require('fs');var squel=require('squel');var Papa=require('papaparse');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var config=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));config['redis']=_['defaults'](config[_0x0d8b('0x7')],{'host':_0x0d8b('0x8'),'port':0x18eb});var socket=require(_0x0d8b('0x9'))(new Redis(config['redis']));require(_0x0d8b('0xa'))[_0x0d8b('0xb')](socket);try{if(!process['argv'][0x2]||process[_0x0d8b('0xc')][0x2]===_0x0d8b('0xd')||process[_0x0d8b('0xc')][0x2]===_0x0d8b('0xe')){throw new Error(_0x0d8b('0xf'));}var FILEPATH=process[_0x0d8b('0xc')][0x2];if(!process[_0x0d8b('0xc')][0x3]||process[_0x0d8b('0xc')][0x3]==='undefined'||process[_0x0d8b('0xc')][0x3]==='null'||!process[_0x0d8b('0xc')][0x4]||process[_0x0d8b('0xc')][0x4]===_0x0d8b('0xd')||process[_0x0d8b('0xc')][0x4]===_0x0d8b('0xe')){throw new Error(_0x0d8b('0x10'));}var FIELDS=_[_0x0d8b('0x11')](process[_0x0d8b('0xc')][0x3][_0x0d8b('0x12')](','),process[_0x0d8b('0xc')][0x4][_0x0d8b('0x12')](','));if(!process[_0x0d8b('0xc')][0x5]||process[_0x0d8b('0xc')][0x5]===_0x0d8b('0xd')||process['argv'][0x5]===_0x0d8b('0xe')){throw new Error(_0x0d8b('0x13'));}var LISTID=process[_0x0d8b('0xc')][0x5];var COMPANYID=process[_0x0d8b('0xc')][0x6]&&process[_0x0d8b('0xc')][0x6]!=='undefined'&&process[_0x0d8b('0xc')][0x6]!==_0x0d8b('0xe')?process[_0x0d8b('0xc')][0x6]:null;var DUPLICATES=process[_0x0d8b('0xc')][0x7]&&process[_0x0d8b('0xc')][0x7]!==_0x0d8b('0xd')&&process[_0x0d8b('0xc')][0x7]!==_0x0d8b('0xe')?process['argv'][0x7]:null;if(!process[_0x0d8b('0xc')][0x8]||process[_0x0d8b('0xc')][0x8]===_0x0d8b('0xd')||process[_0x0d8b('0xc')][0x8]===_0x0d8b('0xe')){throw new Error(_0x0d8b('0x14'));}var SOCKET_TIMESTAMP=process[_0x0d8b('0xc')][0x8];}catch(_0x352c17){logger['error'](_0x352c17);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(_0x4f0a1a,_0x33fb87,_0x54a9a7,_0x56c729){var _0x5527d8={'message':_0x33fb87};_0x5527d8[_0x4f0a1a]=!![];if(_0x54a9a7){_0x5527d8[_0x0d8b('0x15')]=_0x54a9a7;}if(_0x56c729){_0x5527d8[_0x0d8b('0x16')]=_0x56c729;}return _0x5527d8;}function isEmail(_0x214778){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))*$/[_0x0d8b('0x17')](_0x214778);}function checkRow(_0x221071,_0x2c64e2,_0x30980c){return new BPromise(function(_0x4562cb,_0x27b695){if(_['isNil'](_0x221071)){return _0x27b695(handleCheckRowError(_0x0d8b('0x18'),_0x0d8b('0x19'),null,_0x30980c));}if(_0x221071['errors']&&_0x221071[_0x0d8b('0x1a')]['length']){var _0x3dd149=_[_0x0d8b('0x1b')](_0x221071[_0x0d8b('0x1a')],'message')['join'](';');return _0x27b695(handleCheckRowError(_0x0d8b('0x18'),_0x3dd149,null,_0x30980c));}var _0x3ef745={};for(var _0x4c05ee in FIELDS){if(FIELDS[_0x0d8b('0x1c')](_0x4c05ee)&&FIELDS[_0x4c05ee]){_0x3ef745[_0x4c05ee]=_0x221071['data'][0x0][FIELDS[_0x4c05ee]]||_0x221071[_0x0d8b('0x1d')][0x0]['\ufeff'+FIELDS[_0x4c05ee]];}}if(!_0x3ef745['firstName']){return _0x27b695(handleCheckRowError(_0x0d8b('0x18'),'firstName\x20not\x20specified!',null,_0x30980c));}if(!_0x3ef745[_0x0d8b('0x1e')]){return _0x27b695(handleCheckRowError('error',_0x0d8b('0x1f'),null,_0x30980c));}if(_0x3ef745['birthDate']){var _0x3c8887=moment(_0x3ef745[_0x0d8b('0x20')],_0x0d8b('0x21'));if(!_0x3c8887['isValid']()){return _0x27b695(handleCheckRowError('error','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x30980c));}}if(_0x3ef745[_0x0d8b('0x22')]){if(!isEmail(_0x3ef745['email'])){return _0x27b695(handleCheckRowError(_0x0d8b('0x18'),'email\x20format\x20is\x20not\x20valid!',null,_0x30980c));}}_0x3ef745['ListId']=LISTID;_0x3ef745[_0x0d8b('0x23')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x0d8b('0x24')]&&_0x2c64e2){var _0x109c14={};for(var _0xdeee5d=0x0,_0x183220=DUPLICATES[_0x0d8b('0x24')];_0xdeee5d<_0x183220;_0xdeee5d+=0x1){_0x109c14[DUPLICATES[_0xdeee5d]]=_0x3ef745[DUPLICATES[_0xdeee5d]];}var _0x4a99d3=_[_0x0d8b('0x25')](_0x2c64e2,_0x109c14);if(_0x4a99d3){return _0x27b695(handleCheckRowError('duplicate',_0x0d8b('0x26'),_0x4a99d3,_0x30980c));}}return db[_0x0d8b('0x27')]['create'](_0x3ef745,{'raw':!![],'hooks':![],'fields':_[_0x0d8b('0x28')](_0x3ef745)})[_0x0d8b('0x29')](function(_0x18a905){if(DUPLICATES&&DUPLICATES['length']&&_0x2c64e2){_0x2c64e2[_0x0d8b('0x2a')](_[_0x0d8b('0x2b')](_0x3ef745,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x18a905['id'];return _0x4562cb();})[_0x0d8b('0x2c')](function(_0x31ceba){return _0x27b695(handleCheckRowError(_0x0d8b('0x18'),'Error\x20while\x20creating\x20contact:\x20'+(_0x31ceba[_0x0d8b('0x2d')]||JSON[_0x0d8b('0x2e')](_0x31ceba)),null,_0x30980c));});});}function checkHopper(){function _0x5ad0fe(){return function(_0x1180ac){logger[_0x0d8b('0x18')](_0x0d8b('0x2f'),_0x0d8b('0x30'),util[_0x0d8b('0x31')](_0x1180ac,{'showHidden':![],'depth':null}));};}var _0x519088=function(_0x497a71,_0x41b4f9){var _0x5c2c04=squel['insert']()[_0x0d8b('0x32')](_0x0d8b('0x33'))[_0x0d8b('0x34')]([_0x0d8b('0x1e'),_0x0d8b('0x35'),_0x0d8b('0x36'),'ListId',_0x41b4f9,_0x0d8b('0x37'),_0x0d8b('0x38')],squel[_0x0d8b('0x39')]()[_0x0d8b('0x3a')](_0x0d8b('0x1e'),_0x0d8b('0x1e'))[_0x0d8b('0x3a')]('NOW()',_0x0d8b('0x35'))[_0x0d8b('0x3a')]('id',_0x0d8b('0x36'))[_0x0d8b('0x3a')](LISTID['toString'](),_0x0d8b('0x3b'))['field'](_0x497a71['id'][_0x0d8b('0x3c')](),_0x41b4f9)[_0x0d8b('0x3a')](_0x0d8b('0x3d'),_0x0d8b('0x37'))[_0x0d8b('0x3a')](_0x0d8b('0x3d'),_0x0d8b('0x38'))[_0x0d8b('0x3e')](_0x0d8b('0x3f'))[_0x0d8b('0x40')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',LISTID['toString']())['where'](_0x0d8b('0x41'))[_0x0d8b('0x40')](_0x0d8b('0x42'),squel['select']()['field'](_0x0d8b('0x1e'))[_0x0d8b('0x3e')](_0x0d8b('0x33'))['where'](_0x41b4f9+_0x0d8b('0x43'),_0x497a71['id'][_0x0d8b('0x3c')]())))['toString']();return _0x5c2c04;};var _0x4d7bb0=function(_0x372740,_0x495870){var _0x1e22e5=squel['insert']()['into'](_0x0d8b('0x33'))[_0x0d8b('0x34')](['phone','scheduledAt','ContactId','ListId',_0x495870,_0x0d8b('0x37'),_0x0d8b('0x38')],squel[_0x0d8b('0x39')]()['field'](_0x0d8b('0x1e'),_0x0d8b('0x1e'))[_0x0d8b('0x3a')](_0x0d8b('0x3d'),_0x0d8b('0x35'))[_0x0d8b('0x3a')]('id',_0x0d8b('0x36'))[_0x0d8b('0x3a')](LISTID[_0x0d8b('0x3c')](),_0x0d8b('0x3b'))[_0x0d8b('0x3a')](_0x372740['id'][_0x0d8b('0x3c')](),_0x495870)[_0x0d8b('0x3a')](_0x0d8b('0x3d'),_0x0d8b('0x37'))[_0x0d8b('0x3a')](_0x0d8b('0x3d'),_0x0d8b('0x38'))[_0x0d8b('0x3e')]('cm_contacts')[_0x0d8b('0x40')]('deletedAt\x20IS\x20NULL')['where'](_0x0d8b('0x44'),LISTID[_0x0d8b('0x3c')]())[_0x0d8b('0x40')](_0x0d8b('0x45'),squel['str'](hopperContacts))[_0x0d8b('0x40')](_0x0d8b('0x41'))[_0x0d8b('0x40')](_0x0d8b('0x42'),squel[_0x0d8b('0x39')]()['field']('calleridnum')['from']('cm_hopper_final')[_0x0d8b('0x40')](_0x495870+_0x0d8b('0x43'),_0x372740['id']['toString']()))['where'](_0x0d8b('0x42'),squel[_0x0d8b('0x39')]()['field']('phone')[_0x0d8b('0x3e')](_0x0d8b('0x33'))[_0x0d8b('0x40')](_0x495870+_0x0d8b('0x43'),_0x372740['id'][_0x0d8b('0x3c')]())))['toString']();return _0x1e22e5;};function _0x2de903(_0x2afe34,_0x5481fc){var _0x580580=squel[_0x0d8b('0x46')]()[_0x0d8b('0x32')]('cm_hopper')['fromQuery']([_0x0d8b('0x1e'),_0x0d8b('0x35'),_0x0d8b('0x36'),_0x0d8b('0x3b'),_0x5481fc,'createdAt',_0x0d8b('0x38')],squel['select']()['field'](_0x0d8b('0x1e'),_0x0d8b('0x1e'))['field']('NOW()',_0x0d8b('0x35'))[_0x0d8b('0x3a')]('id',_0x0d8b('0x36'))[_0x0d8b('0x3a')](LISTID[_0x0d8b('0x3c')](),_0x0d8b('0x3b'))[_0x0d8b('0x3a')](_0x2afe34['id'][_0x0d8b('0x3c')](),_0x5481fc)['field'](_0x0d8b('0x3d'),_0x0d8b('0x37'))[_0x0d8b('0x3a')](_0x0d8b('0x3d'),_0x0d8b('0x38'))[_0x0d8b('0x3e')](_0x0d8b('0x3f'))[_0x0d8b('0x40')](_0x0d8b('0x47'))['where'](_0x0d8b('0x44'),LISTID[_0x0d8b('0x3c')]())[_0x0d8b('0x40')](_0x0d8b('0x45'),squel[_0x0d8b('0x48')](hopperContacts))['where'](_0x0d8b('0x41')))[_0x0d8b('0x3c')]();return _0x580580;}function _0x181d49(_0x17a87f,_0x1d6cd4){var _0x59ada2=squel['insert']()[_0x0d8b('0x32')](_0x0d8b('0x49'))[_0x0d8b('0x34')]([_0x0d8b('0x1e'),'ContactId',_0x0d8b('0x3b'),_0x1d6cd4,_0x0d8b('0x37'),_0x0d8b('0x38')],squel['select']()[_0x0d8b('0x3a')]('phone',_0x0d8b('0x1e'))[_0x0d8b('0x3a')]('id',_0x0d8b('0x36'))[_0x0d8b('0x3a')](LISTID[_0x0d8b('0x3c')](),_0x0d8b('0x3b'))['field'](_0x17a87f['id'][_0x0d8b('0x3c')](),_0x1d6cd4)['field'](_0x0d8b('0x3d'),_0x0d8b('0x37'))[_0x0d8b('0x3a')](_0x0d8b('0x3d'),'updatedAt')[_0x0d8b('0x3e')](_0x0d8b('0x3f'))[_0x0d8b('0x40')](_0x0d8b('0x47'))[_0x0d8b('0x40')](_0x0d8b('0x44'),LISTID[_0x0d8b('0x3c')]())[_0x0d8b('0x40')](_0x0d8b('0x45'),squel[_0x0d8b('0x48')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0x0d8b('0x3c')]();return _0x59ada2;}return db[_0x0d8b('0x4a')]['findAll']({'where':{'type':_0x0d8b('0x4b')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db['CmList'],'as':_0x0d8b('0x4c'),'where':{'id':LISTID}}]})[_0x0d8b('0x29')](function(_0x4f4b4d){var _0x587128=[];if(_0x4f4b4d){var _0x1900e3;for(var _0x1c007b=0x0,_0x70e4b2;_0x1c007b<_0x4f4b4d[_0x0d8b('0x24')];_0x1c007b+=0x1){_0x70e4b2=_0x4f4b4d[_0x1c007b][_0x0d8b('0x4d')]({'plain':!![]});switch(_0x70e4b2[_0x0d8b('0x4e')]){case _0x0d8b('0x4f'):_0x587128['push'](db[_0x0d8b('0x50')]['query'](_0x4d7bb0(_0x70e4b2,_0x0d8b('0x51')))[_0x0d8b('0x29')](function(){})[_0x0d8b('0x2c')](_0x5ad0fe()));break;case _0x0d8b('0x52'):_0x587128['push'](db[_0x0d8b('0x50')]['query'](_0x519088(_0x70e4b2,_0x0d8b('0x51')))[_0x0d8b('0x29')](function(){})[_0x0d8b('0x2c')](_0x5ad0fe()));break;default:_0x587128[_0x0d8b('0x2a')](db[_0x0d8b('0x50')][_0x0d8b('0x53')](_0x2de903(_0x70e4b2,_0x0d8b('0x51')))[_0x0d8b('0x29')](function(){})[_0x0d8b('0x2c')](_0x5ad0fe()));}}}return _0x587128;})[_0x0d8b('0x54')]()['then'](function(){return db[_0x0d8b('0x4a')]['findAll']({'where':{'type':_0x0d8b('0x4b')},'attributes':['id'],'include':[{'model':db[_0x0d8b('0x55')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x0d8b('0x29')](function(_0x56e03c){var _0x10c318=[];if(_0x56e03c){var _0x445a00;for(var _0x24f75=0x0,_0x259ac9;_0x24f75<_0x56e03c[_0x0d8b('0x24')];_0x24f75+=0x1){_0x259ac9=_0x56e03c[_0x24f75][_0x0d8b('0x4d')]({'plain':!![]});_0x10c318[_0x0d8b('0x2a')](db[_0x0d8b('0x50')]['query'](_0x181d49(_0x259ac9,_0x0d8b('0x51')))[_0x0d8b('0x29')](function(){})['catch'](_0x5ad0fe()));}}return _0x10c318;})[_0x0d8b('0x54')]();})[_0x0d8b('0x29')](function(){return db[_0x0d8b('0x56')][_0x0d8b('0x57')]({'attributes':['id',_0x0d8b('0x4e')],'include':[{'model':db[_0x0d8b('0x55')],'as':_0x0d8b('0x4c'),'where':{'id':LISTID}}]})[_0x0d8b('0x29')](function(_0x466082){var _0x5007c0=[];if(_0x466082){for(var _0xe35028=0x0,_0x16df83;_0xe35028<_0x466082['length'];_0xe35028+=0x1){_0x16df83=_0x466082[_0xe35028][_0x0d8b('0x4d')]({'plain':!![]});switch(_0x16df83[_0x0d8b('0x4e')]){case _0x0d8b('0x4f'):_0x5007c0['push'](db['sequelize'][_0x0d8b('0x53')](_0x4d7bb0(_0x16df83,_0x0d8b('0x58')))[_0x0d8b('0x29')](function(){})['catch'](_0x5ad0fe()));break;case'onlyIfOpen':_0x5007c0[_0x0d8b('0x2a')](db[_0x0d8b('0x50')][_0x0d8b('0x53')](_0x519088(_0x16df83,_0x0d8b('0x58')))[_0x0d8b('0x29')](function(){})[_0x0d8b('0x2c')](_0x5ad0fe()));break;default:_0x5007c0[_0x0d8b('0x2a')](db[_0x0d8b('0x50')][_0x0d8b('0x53')](_0x2de903(_0x16df83,_0x0d8b('0x58')))[_0x0d8b('0x29')](function(){})[_0x0d8b('0x2c')](_0x5ad0fe()));}}}return _0x5007c0;})[_0x0d8b('0x54')]();})['then'](function(){return db[_0x0d8b('0x56')][_0x0d8b('0x57')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':'BlackLists','where':{'id':LISTID}}]})[_0x0d8b('0x29')](function(_0x1dad9f){var _0x3573b4=[];if(_0x1dad9f){for(var _0x14b1b8=0x0,_0x23e2e0;_0x14b1b8<_0x1dad9f[_0x0d8b('0x24')];_0x14b1b8+=0x1){_0x23e2e0=_0x1dad9f[_0x14b1b8]['get']({'plain':!![]});_0x3573b4['push'](db['sequelize'][_0x0d8b('0x53')](_0x181d49(_0x23e2e0,_0x0d8b('0x58')))[_0x0d8b('0x29')](function(){})[_0x0d8b('0x2c')](_0x5ad0fe()));}}return _0x3573b4;})[_0x0d8b('0x54')]();})[_0x0d8b('0x2c')](function(_0x5ef461){logger[_0x0d8b('0x18')](_0x0d8b('0x59'),'generalCheckHopper',_0x5ef461[_0x0d8b('0x2d')]);});}var processPromises=function(_0x57e3c2){return BPromise[_0x0d8b('0x54')](promises)[_0x0d8b('0x29')](function(_0x9dfa5a){})[_0x0d8b('0x2c')](function(_0x10c7ab){logger[_0x0d8b('0x18')](_0x0d8b('0x5a'),JSON[_0x0d8b('0x2e')](_0x10c7ab));})[_0x0d8b('0x5b')](function(){socket[_0x0d8b('0x5c')](_0x0d8b('0x5d')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x57e3c2){return _0x57e3c2[_0x0d8b('0x5e')]();}});};var endCsv=function(){return BPromise['resolve']()['then'](function(){if(hopperContacts){return checkHopper();}})[_0x0d8b('0x29')](function(){socket[_0x0d8b('0x5c')](_0x0d8b('0x5d')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x0d8b('0x5f')](FILEPATH);}catch(_0xf91ecd){logger[_0x0d8b('0x18')](_0x0d8b('0x60'),JSON['stringify'](_0xf91ecd));}finally{process[_0x0d8b('0x61')](0x0);}});};process['on']('SIGINT',function(){logger[_0x0d8b('0x62')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise['resolve']()[_0x0d8b('0x29')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x0d8b('0x12')](',');return db[_0x0d8b('0x27')][_0x0d8b('0x57')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x0d8b('0x29')](function(_0x2eece2){var _0x3c7b9b=fs[_0x0d8b('0x63')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x0d8b('0x64')](_0x3c7b9b,{'header':!![],'skipEmptyLines':!![],'step':function(_0x20a8b6,_0x3a6014){total+=0x1;var _0x180539=total;promises['push'](checkRow(_0x20a8b6,_0x2eece2,_0x180539)[_0x0d8b('0x29')](function(){success+=0x1;})[_0x0d8b('0x2c')](function(_0x8be77c){if(_0x8be77c['error']){errors+=0x1;delete _0x8be77c['error'];}else if(_0x8be77c[_0x0d8b('0x65')]){duplicates+=0x1;delete _0x8be77c[_0x0d8b('0x65')];}rows[_0x0d8b('0x2a')](_0x8be77c);}));if(total%0xc8===0x0){_0x3a6014[_0x0d8b('0x66')]();return processPromises(_0x3a6014);}},'complete':function(){return processPromises()[_0x0d8b('0x29')](function(){logger[_0x0d8b('0x62')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x1a96ce,_0x3d6267){logger[_0x0d8b('0x62')](_0x0d8b('0x67'),JSON[_0x0d8b('0x2e')](_0x1a96ce));endCsv();}});})['catch'](function(_0x4dbcfc){logger[_0x0d8b('0x18')](_0x0d8b('0x68'),JSON[_0x0d8b('0x2e')](_0x4dbcfc));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 13db4a8..83a3993 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 _0xeb3c=['id\x20IN\x20?','min_id','info','Received\x20SIGINT','push','code','message','sequelize','query','spread','catch','main','send','start','binding','socket_timestamp','root','server/files/tmp','.csv','keys','writeFileSync','parse','createReadStream','data','length','rows','errors','hasOwnProperty','replace','scheduledat','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','priority','isNumber','includes','agent\x20not\x20exists','email\x20wrong\x20format','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','\x20not\x20specified','SystemRow','emit','contact:import:','Abort\x20parser','abort','error','step','duplicates','cm_contacts_','\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','CompanyId','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns','CampaignId','campaigns_has_cm_blacklists','then','affectedRows','unlink','exit','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','SIGINT','uncaughtException','path','lodash','papaparse','util','moment','squel','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','insert','into','cm_hopper','fromQuery','ContactId','ListId','createdAt','updatedAt','UserId','recallme','fields','from','cm_contacts','cm_contacts.ListId\x20=\x20','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','\x22always\x22','toString','cm_hopper_black','.CmListId\x20=\x20?','ListId\x20=\x20?','concat',')\x20NOT\x20IN\x20?'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xeb3c,0xcc));var _0xceb3=function(_0x4d07cc,_0x587613){_0x4d07cc=_0x4d07cc-0x0;var _0x42de3b=_0xeb3c[_0x4d07cc];return _0x42de3b;};'use strict';var fs=require('fs');var path=require(_0xceb3('0x0'));var _=require(_0xceb3('0x1'));var Papa=require(_0xceb3('0x2'));var util=require(_0xceb3('0x3'));var BPromise=require('bluebird');var moment=require(_0xceb3('0x4'));var squel=require(_0xceb3('0x5'));var Redis=require('ioredis');var db=require(_0xceb3('0x6'))['db'];var config=require(_0xceb3('0x7'));var logger=require(_0xceb3('0x8'))(_0xceb3('0x9'));config[_0xceb3('0xa')]=_['defaults'](config[_0xceb3('0xa')],{'host':_0xceb3('0xb'),'port':0x18eb});var socket=require(_0xceb3('0xc'))(new Redis(config[_0xceb3('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xceb3('0xd')](_0xceb3('0xe'));function isEmail(_0x3aa043){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))*$/[_0xceb3('0xf')](_0x3aa043);}function selectNotIn(_0x5f07dd,_0x3877d2,_0x4608a4,_0x41402f,_0x563aae){return squel[_0xceb3('0x10')]()[_0xceb3('0x11')](_0xceb3('0x12'))['from'](_0x41402f)[_0xceb3('0x13')](_0x3877d2,null,_0x3877d2+_0xceb3('0x14')+_0x41402f+'.'+_0x4608a4)[_0xceb3('0x15')](_0x41402f+'.'+_0x4608a4+_0xceb3('0x16')+_0x5f07dd+'.'+_0x4608a4)[_0xceb3('0x15')](_0x3877d2+_0xceb3('0x17')+_0x563aae['join']()+')');}function insertCmHopper(_0x86731d,_0x1b0171,_0x4d7c68,_0x15e5b7,_0x43e3eb){var _0x4b4fe2=[_0xceb3('0x18'),_0xceb3('0x19'),_0xceb3('0x1a'),_0xceb3('0x1b'),_0x1b0171+'.'+_0x15e5b7,_0xceb3('0x1c'),_0xceb3('0x1d'),'cm_contacts.priority','cm_contacts.UserId','\x22'+_0x43e3eb+'\x22'];return squel[_0xceb3('0x1e')]()[_0xceb3('0x1f')](_0xceb3('0x20'))[_0xceb3('0x21')]([_0xceb3('0x12'),'scheduledat',_0xceb3('0x22'),_0xceb3('0x23'),_0x15e5b7,_0xceb3('0x24'),_0xceb3('0x25'),'priority',_0xceb3('0x26'),_0xceb3('0x27')],squel['select']()[_0xceb3('0x28')](_0x4b4fe2)[_0xceb3('0x29')](_0x1b0171)['join'](_0xceb3('0x2a'),null,_0xceb3('0x2b')+_0x1b0171+'.CmListId')[_0xceb3('0x13')](_0x4d7c68,null,_0x4d7c68+_0xceb3('0x14')+_0x1b0171+'.'+_0x15e5b7)[_0xceb3('0x15')](_0x1b0171+'.CmListId\x20=\x20?',_0x86731d)['where'](_0xceb3('0x2c'),NOW)['where'](_0xceb3('0x2d'),selectNotIn(_0x1b0171,_0x4d7c68,_0x15e5b7,'cm_hopper',['\x22always\x22',_0xceb3('0x2e')]))['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x1b0171,_0x4d7c68,_0x15e5b7,_0xceb3('0x20'),[_0xceb3('0x2f')])))[_0xceb3('0x30')]();}function insertCmHopperBlack(_0x2f8e5c,_0x48f59b,_0x1873ea,_0xcf1405){var _0x313e32=[_0xceb3('0x18'),_0xceb3('0x1a'),'cm_contacts.ListId',_0x48f59b+'.'+_0xcf1405,_0xceb3('0x1c'),_0xceb3('0x1d')];return squel[_0xceb3('0x1e')]()[_0xceb3('0x1f')](_0xceb3('0x31'))[_0xceb3('0x21')](['phone','ContactId','ListId',_0xcf1405,_0xceb3('0x24'),_0xceb3('0x25')],squel[_0xceb3('0x10')]()[_0xceb3('0x28')](_0x313e32)['from'](_0x48f59b)['join'](_0xceb3('0x2a'),null,_0xceb3('0x2b')+_0x48f59b+'.CmListId')['join'](_0x1873ea,null,_0x1873ea+'.id\x20=\x20'+_0x48f59b+'.'+_0xcf1405)['where'](_0x48f59b+_0xceb3('0x32'),_0x2f8e5c)[_0xceb3('0x15')](_0xceb3('0x2c'),NOW)[_0xceb3('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0xceb3('0x10')]()[_0xceb3('0x11')](_0xceb3('0x12'))[_0xceb3('0x29')](_0xceb3('0x31'))[_0xceb3('0x15')](_0xceb3('0x33'),_0x2f8e5c)[_0xceb3('0x15')](_0xcf1405+'\x20=\x20?',_0x48f59b+'.'+_0xcf1405)))[_0xceb3('0x30')]();}function insertCmContact(_0x1f71ed,_0x46d7c3,_0x40cd77,_0x307177){var _0x1557af=_[_0xceb3('0x34')](_['keys'](_0x307177),[_0xceb3('0x23'),'CompanyId',_0xceb3('0x24'),'updatedAt']);return squel[_0xceb3('0x1e')]()[_0xceb3('0x1f')](_0xceb3('0x2a'))['fromQuery'](_0x1557af,squel[_0xceb3('0x10')]()['fields'](_0x1557af)[_0xceb3('0x29')](_0x46d7c3)[_0xceb3('0x15')]('('+_0x40cd77[_0xceb3('0x13')](',')+_0xceb3('0x35'),squel[_0xceb3('0x10')]()[_0xceb3('0x28')](_0x40cd77)[_0xceb3('0x29')]('cm_contacts')[_0xceb3('0x15')]('ListId\x20=\x20?',_0x1f71ed))[_0xceb3('0x15')](_0xceb3('0x36'),squel[_0xceb3('0x10')]()['field']('MIN(id)',_0xceb3('0x37'))['from'](_0x46d7c3)['group'](_0x40cd77[_0xceb3('0x13')](','))))[_0xceb3('0x30')]();}function handleStop(){logger[_0xceb3('0x38')](_0xceb3('0x39'));stopped=!![];}function handleUncaughtException(_0x41493c){logger['error'](_0x41493c['message']);process['exit'](0x1);}function handleError(_0x20c731,_0xca1f13){stats['errors'][_0xceb3('0x3a')]({'name':_0xca1f13[_0xceb3('0x3b')],'message':_0xca1f13[_0xceb3('0x3c')],'row':_0x20c731});}function handleQuery(_0x48ddb5){logger[_0xceb3('0x38')](_0x48ddb5);return db[_0xceb3('0x3d')][_0xceb3('0x3e')](_0x48ddb5)[_0xceb3('0x3f')](function(_0x3d1697){results[_0xceb3('0x3a')](_0x3d1697);})[_0xceb3('0x40')](function(_0x1773ef){logger['error'](_0x1773ef[_0xceb3('0x3c')]);});}function main(_0x4ef78d,_0x4577e4,_0x5c2efc,_0x4d52a8){logger['info'](_0xceb3('0x41'),_0x4ef78d,JSON['stringify'](_0x4577e4));process[_0xceb3('0x42')](_0xceb3('0x43'));var _0x13ddc7=_0x4577e4[_0xceb3('0x44')];var _0x205e05=_0x4577e4[_0xceb3('0x45')];var _0x3bbc4e=path[_0xceb3('0x13')](config[_0xceb3('0x46')],_0xceb3('0x47'),_0x205e05+_0xceb3('0x48'));var _0xa2eaa8=_[_0xceb3('0x49')](_0x13ddc7)[_0xceb3('0x13')]();logger['info']('header',_0xa2eaa8);fs[_0xceb3('0x4a')](_0x3bbc4e,_0xa2eaa8+'\x0a');Papa[_0xceb3('0x4b')](fs[_0xceb3('0x4c')](_0x4ef78d),{'header':!![],'skipEmptyLines':!![],'step':function(_0x2f788c,_0x1fa75d){try{for(var _0x4a57d9=0x0,_0x123066=[];_0x4a57d9<_0x2f788c[_0xceb3('0x4d')][_0xceb3('0x4e')];_0x4a57d9++){stats[_0xceb3('0x4f')]+=0x1;if(_0x2f788c[_0xceb3('0x50')][_0x4a57d9]){handleError(_0x2f788c['data'][_0x4a57d9],_0x2f788c[_0xceb3('0x50')][_0x4a57d9]);}else{var _0x4e94d5=[];for(var _0x1cca6f in _0x13ddc7){if(_0x13ddc7[_0xceb3('0x51')](_0x1cca6f)){if(_0x2f788c[_0xceb3('0x4d')][_0x4a57d9][_0x13ddc7[_0x1cca6f]]){var _0x5642fb=_['trim'](_0x2f788c[_0xceb3('0x4d')][_0x4a57d9][_0x13ddc7[_0x1cca6f]][_0xceb3('0x52')](/"/g,'\x27'));switch(_0x1cca6f){case _0xceb3('0x53'):var _0x1b370b=moment(_0x5642fb,_0xceb3('0xe'),!![]);if(_0x1b370b[_0xceb3('0x54')]()){_0x123066['push']('\x22'+_0x5642fb+'\x22');}else{_0x4e94d5[_0xceb3('0x3a')](_0xceb3('0x55'));}break;case _0xceb3('0x56'):var _0x1cd890=parseInt(_0x5642fb);_0x5642fb=_['isNaN'](_0x1cd890)||_0x1cd890<0x0||_0x1cd890>0x4?_0x4d52a8?0x3:0x2:_0x1cd890;_0x123066['push']('\x22'+_0x5642fb+'\x22');break;case _0xceb3('0x26'):var _0x4dfec9=parseInt(_0x5642fb);if(_[_0xceb3('0x57')](_0x4dfec9)&&_[_0xceb3('0x58')](_0x5c2efc,_0x4dfec9)){_0x123066['push']('\x22'+_0x4dfec9+'\x22');}else{_0x4e94d5[_0xceb3('0x3a')](_0xceb3('0x59'));}break;case'email':if(isEmail(_0x5642fb)){_0x123066['push']('\x22'+_0x5642fb+'\x22');}else{_0x4e94d5[_0xceb3('0x3a')](_0xceb3('0x5a'));}break;case'dateOfBirth':var _0x20202b=moment(_0x5642fb,_0xceb3('0x5b'),!![]);if(_0x20202b[_0xceb3('0x54')]()){_0x123066[_0xceb3('0x3a')]('\x22'+_0x5642fb+'\x22');}else{_0x4e94d5[_0xceb3('0x3a')](_0xceb3('0x5c'));}break;default:_0x123066['push']('\x22'+_0x5642fb+'\x22');}}else{switch(_0x1cca6f){case'firstName':case'phone':_0x4e94d5[_0xceb3('0x3a')](_0x1cca6f+_0xceb3('0x5d'));break;default:_0x123066[_0xceb3('0x3a')]('\x22\x22');}}}}if(_0x4e94d5[_0xceb3('0x4e')]){handleError(_0x2f788c[_0xceb3('0x4d')][_0x4a57d9],{'code':_0xceb3('0x5e'),'message':_0x4e94d5[_0xceb3('0x13')]()});}else{fs['appendFileSync'](_0x3bbc4e,_0x123066[_0xceb3('0x13')]()+'\x0a');}_0x123066=[];}if(!(stats['rows']%0xc8)){socket[_0xceb3('0x5f')](_0xceb3('0x60')+_0x205e05,stats);stats[_0xceb3('0x50')]=[];}}if(stopped){logger[_0xceb3('0x38')](_0xceb3('0x61'));_0x1fa75d[_0xceb3('0x62')]();}}catch(_0x54e525){handleError(_0x2f788c[_0xceb3('0x4d')][_0x4a57d9],{'code':'SystemError','message':_0x54e525[_0xceb3('0x3c')]});logger[_0xceb3('0x63')](_0xceb3('0x64'),_0x54e525[_0xceb3('0x3c')]);}},'complete':function(){try{var _0xa6f4cf=[];var _0x10a793=_0xceb3('0x2a');if(_0x4577e4[_0xceb3('0x65')]&&_0x4577e4['duplicates'][_0xceb3('0x4e')]){_0x10a793=_0xceb3('0x66')+_0x205e05;_0xa6f4cf[_0xceb3('0x3a')]('CREATE\x20TABLE\x20'+_0x10a793+_0xceb3('0x67'));}var _0x29cdde=util['format'](_0xceb3('0x68'),_0x3bbc4e,_0x10a793,_0xa2eaa8,_0x4577e4[_0xceb3('0x23')],_0x4577e4[_0xceb3('0x69')]||null,NOW,NOW);if(_[_0xceb3('0x6a')](_0x13ddc7['scheduledat'])){_0x29cdde+=_0xceb3('0x6b');}_0xa6f4cf['push'](_0x29cdde);if(_0x4577e4[_0xceb3('0x65')]&&_0x4577e4['duplicates'][_0xceb3('0x4e')]){_0xa6f4cf['push'](insertCmContact(_0x4577e4[_0xceb3('0x23')],_0x10a793,_0x4577e4[_0xceb3('0x65')],_0x13ddc7));_0xa6f4cf[_0xceb3('0x3a')](_0xceb3('0x6c')+_0x10a793+';');}_0xa6f4cf[_0xceb3('0x3a')](insertCmHopper(_0x4577e4[_0xceb3('0x23')],'voice_queues_has_cm_lists','voice_queues',_0xceb3('0x6d'),_0x4d52a8));_0xa6f4cf[_0xceb3('0x3a')](insertCmHopperBlack(_0x4577e4[_0xceb3('0x23')],_0xceb3('0x6e'),'voice_queues',_0xceb3('0x6d')));_0xa6f4cf[_0xceb3('0x3a')](insertCmHopper(_0x4577e4[_0xceb3('0x23')],'campaigns_has_cm_lists',_0xceb3('0x6f'),_0xceb3('0x70'),_0x4d52a8));_0xa6f4cf['push'](insertCmHopperBlack(_0x4577e4[_0xceb3('0x23')],_0xceb3('0x71'),_0xceb3('0x6f'),'CampaignId'));BPromise['each'](_0xa6f4cf,handleQuery)[_0xceb3('0x72')](function(_0x1d8280){stats['finish']=!![];stats[_0xceb3('0x73')]=_0x4577e4[_0xceb3('0x65')]&&_0x4577e4[_0xceb3('0x65')]['length']?results[0x2]['affectedRows']:results[0x0][_0xceb3('0x73')];socket[_0xceb3('0x5f')]('contact:import:'+_0x205e05,stats);fs[_0xceb3('0x74')](_0x4ef78d);fs[_0xceb3('0x74')](_0x3bbc4e);process[_0xceb3('0x75')](0x0);})[_0xceb3('0x40')](function(_0x107ebe){logger[_0xceb3('0x63')](_0x107ebe['message']);process[_0xceb3('0x75')](0x1);});}catch(_0x5936a9){logger[_0xceb3('0x63')](_0xceb3('0x76'),_0x5936a9[_0xceb3('0x3c')]);process[_0xceb3('0x75')](0x1);}},'error':function(_0x53993e,_0x3a91ae,_0x5bd517,_0x3d2bcc){throw new Error(_0x3d2bcc);}});}function validate(){if(process[_0xceb3('0x77')]&&process[_0xceb3('0x77')][_0xceb3('0x4e')]<0x4){throw new Error(_0xceb3('0x78'));}var _0x115c37=path[_0xceb3('0x13')](config[_0xceb3('0x46')],_0xceb3('0x47'),process['argv'][0x2]);if(!fs[_0xceb3('0x79')](_0x115c37)){throw new Error(_0xceb3('0x7a'));}var _0x590fa7={};try{_0x590fa7=JSON[_0xceb3('0x4b')](process[_0xceb3('0x77')][0x3]);if(!_0x590fa7[_0xceb3('0x44')]){throw new Error(_0xceb3('0x7b'));}if(!_0x590fa7['binding'][_0xceb3('0x12')]){throw new Error('phone\x20is\x20mandatory');}if(!_0x590fa7[_0xceb3('0x44')]['firstName']){throw new Error('firstName\x20is\x20mandatory');}var _0x229858=0x0;if(_0x590fa7['binding']['UserId']){_0x229858=0x1;}if(!_0x590fa7[_0xceb3('0x23')]){throw new Error(_0xceb3('0x7c'));}}catch(_0x1a228d){throw new Error(_0xceb3('0x7d'));}var _0x124a87=[];try{_0x124a87=_[_0xceb3('0x7e')](JSON[_0xceb3('0x4b')](process[_0xceb3('0x77')][0x4]),'id');}catch(_0x30d3ca){logger[_0xceb3('0x38')]('No\x20agent\x20available');}main(_0x115c37,_0x590fa7,_0x124a87,_0x229858);}validate();process['on'](_0xceb3('0x7f'),handleStop);process['on'](_0xceb3('0x80'),handleUncaughtException); \ No newline at end of file +var _0xa844=['scheduledat',',\x20scheduledAt\x20=\x20NOW()','voice_queues_has_cm_lists','voice_queues','voice_queues_has_cm_blacklists','VoiceQueueId','campaigns_has_cm_lists','campaigns','CampaignId','finish','affectedRows','unlink','exit','complete','arguments\x20\x20\x20','argv','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','SIGINT','uncaughtException','lodash','util','bluebird','moment','squel','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','insert','into','fromQuery','createdAt','updatedAt','priority','recallme','fields','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_hopper','\x22always\x22','toString','cm_contacts.id','cm_hopper_black','ListId','cm_contacts','cm_contacts.phone\x20NOT\x20IN\x20(?)','ListId\x20=\x20?','keys','CompanyId','id\x20IN\x20?','MIN(id)','min_id','info','Received\x20SIGINT','error','message','errors','push','sequelize','spread','catch','stringify','send','binding','socket_timestamp','root','server/files/tmp','.csv','header','writeFileSync','parse','createReadStream','data','hasOwnProperty','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','UserId','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','length','SystemRow','appendFileSync','rows','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','isNil'];(function(_0x1b4069,_0x5461ab){var _0x12b093=function(_0x1e594d){while(--_0x1e594d){_0x1b4069['push'](_0x1b4069['shift']());}};_0x12b093(++_0x5461ab);}(_0xa844,0x9b));var _0x4a84=function(_0xb47721,_0x3f9dc6){_0xb47721=_0xb47721-0x0;var _0x18242f=_0xa844[_0xb47721];return _0x18242f;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x4a84('0x0'));var Papa=require('papaparse');var util=require(_0x4a84('0x1'));var BPromise=require(_0x4a84('0x2'));var moment=require(_0x4a84('0x3'));var squel=require(_0x4a84('0x4'));var Redis=require('ioredis');var db=require(_0x4a84('0x5'))['db'];var config=require(_0x4a84('0x6'));var logger=require(_0x4a84('0x7'))(_0x4a84('0x8'));config[_0x4a84('0x9')]=_[_0x4a84('0xa')](config[_0x4a84('0x9')],{'host':_0x4a84('0xb'),'port':0x18eb});var socket=require(_0x4a84('0xc'))(new Redis(config[_0x4a84('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x4a84('0xd')](_0x4a84('0xe'));function isEmail(_0x341308){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))*$/[_0x4a84('0xf')](_0x341308);}function selectNotIn(_0x39b650,_0x3a5083,_0x4dafc0,_0x2c42c7,_0x379ac8){return squel[_0x4a84('0x10')]()[_0x4a84('0x11')](_0x4a84('0x12'))[_0x4a84('0x13')](_0x2c42c7)[_0x4a84('0x14')](_0x3a5083,null,_0x3a5083+_0x4a84('0x15')+_0x2c42c7+'.'+_0x4dafc0)[_0x4a84('0x16')](_0x2c42c7+'.'+_0x4dafc0+_0x4a84('0x17')+_0x39b650+'.'+_0x4dafc0)[_0x4a84('0x16')](_0x3a5083+_0x4a84('0x18')+_0x379ac8[_0x4a84('0x14')]()+')');}function insertCmHopper(_0x8f6b14,_0x4444ae,_0x2ed2a9,_0x26aef0,_0x57206e){var _0x2db2a7=[_0x4a84('0x19'),'cm_contacts.scheduledat','cm_contacts.id',_0x4a84('0x1a'),_0x4444ae+'.'+_0x26aef0,_0x4a84('0x1b'),_0x4a84('0x1c'),'cm_contacts.priority',_0x4a84('0x1d'),'\x22'+_0x57206e+'\x22'];return squel[_0x4a84('0x1e')]()[_0x4a84('0x1f')]('cm_hopper')[_0x4a84('0x20')]([_0x4a84('0x12'),'scheduledat','ContactId','ListId',_0x26aef0,_0x4a84('0x21'),_0x4a84('0x22'),_0x4a84('0x23'),'UserId',_0x4a84('0x24')],squel[_0x4a84('0x10')]()[_0x4a84('0x25')](_0x2db2a7)[_0x4a84('0x13')](_0x4444ae)['join']('cm_contacts',null,_0x4a84('0x26')+_0x4444ae+_0x4a84('0x27'))[_0x4a84('0x14')](_0x2ed2a9,null,_0x2ed2a9+_0x4a84('0x15')+_0x4444ae+'.'+_0x26aef0)['where'](_0x4444ae+_0x4a84('0x28'),_0x8f6b14)[_0x4a84('0x16')](_0x4a84('0x29'),NOW)[_0x4a84('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x4444ae,_0x2ed2a9,_0x26aef0,_0x4a84('0x2a'),[_0x4a84('0x2b'),'\x22onlyIfOpen\x22']))['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x4444ae,_0x2ed2a9,_0x26aef0,_0x4a84('0x2a'),[_0x4a84('0x2b')])))[_0x4a84('0x2c')]();}function insertCmHopperBlack(_0x4cdb61,_0x265cd5,_0x1009c4,_0x74145a){var _0x44b389=[_0x4a84('0x19'),_0x4a84('0x2d'),'cm_contacts.ListId',_0x265cd5+'.'+_0x74145a,'cm_contacts.createdAt',_0x4a84('0x1c')];return squel[_0x4a84('0x1e')]()[_0x4a84('0x1f')](_0x4a84('0x2e'))[_0x4a84('0x20')]([_0x4a84('0x12'),'ContactId',_0x4a84('0x2f'),_0x74145a,_0x4a84('0x21'),_0x4a84('0x22')],squel['select']()['fields'](_0x44b389)[_0x4a84('0x13')](_0x265cd5)[_0x4a84('0x14')](_0x4a84('0x30'),null,_0x4a84('0x26')+_0x265cd5+_0x4a84('0x27'))[_0x4a84('0x14')](_0x1009c4,null,_0x1009c4+_0x4a84('0x15')+_0x265cd5+'.'+_0x74145a)[_0x4a84('0x16')](_0x265cd5+_0x4a84('0x28'),_0x4cdb61)[_0x4a84('0x16')](_0x4a84('0x29'),NOW)['where'](_0x4a84('0x31'),squel[_0x4a84('0x10')]()[_0x4a84('0x11')](_0x4a84('0x12'))[_0x4a84('0x13')](_0x4a84('0x2e'))['where'](_0x4a84('0x32'),_0x4cdb61)[_0x4a84('0x16')](_0x74145a+'\x20=\x20?',_0x265cd5+'.'+_0x74145a)))['toString']();}function insertCmContact(_0x34205c,_0x1f3493,_0x294ed3,_0x13a220){var _0x49676f=_['concat'](_[_0x4a84('0x33')](_0x13a220),[_0x4a84('0x2f'),_0x4a84('0x34'),'createdAt',_0x4a84('0x22')]);return squel[_0x4a84('0x1e')]()[_0x4a84('0x1f')]('cm_contacts')[_0x4a84('0x20')](_0x49676f,squel[_0x4a84('0x10')]()[_0x4a84('0x25')](_0x49676f)['from'](_0x1f3493)['where']('('+_0x294ed3[_0x4a84('0x14')](',')+')\x20NOT\x20IN\x20?',squel['select']()[_0x4a84('0x25')](_0x294ed3)[_0x4a84('0x13')](_0x4a84('0x30'))[_0x4a84('0x16')](_0x4a84('0x32'),_0x34205c))['where'](_0x4a84('0x35'),squel['select']()[_0x4a84('0x11')](_0x4a84('0x36'),_0x4a84('0x37'))['from'](_0x1f3493)['group'](_0x294ed3[_0x4a84('0x14')](','))))[_0x4a84('0x2c')]();}function handleStop(){logger[_0x4a84('0x38')](_0x4a84('0x39'));stopped=!![];}function handleUncaughtException(_0x5b8033){logger[_0x4a84('0x3a')](_0x5b8033[_0x4a84('0x3b')]);process['exit'](0x1);}function handleError(_0x1fe7eb,_0x292cfa){stats[_0x4a84('0x3c')][_0x4a84('0x3d')]({'name':_0x292cfa['code'],'message':_0x292cfa[_0x4a84('0x3b')],'row':_0x1fe7eb});}function handleQuery(_0x197d92){logger[_0x4a84('0x38')](_0x197d92);return db[_0x4a84('0x3e')]['query'](_0x197d92)[_0x4a84('0x3f')](function(_0x5b5100){results[_0x4a84('0x3d')](_0x5b5100);})[_0x4a84('0x40')](function(_0x50147a){logger[_0x4a84('0x3a')](_0x50147a[_0x4a84('0x3b')]);});}function main(_0x15b712,_0x5e7fa5,_0x3b3e9f,_0x510c2e){logger[_0x4a84('0x38')]('main',_0x15b712,JSON[_0x4a84('0x41')](_0x5e7fa5));process[_0x4a84('0x42')]('start');var _0x4f9903=_0x5e7fa5[_0x4a84('0x43')];var _0x4879fb=_0x5e7fa5[_0x4a84('0x44')];var _0x5d2cc3=path[_0x4a84('0x14')](config[_0x4a84('0x45')],_0x4a84('0x46'),_0x4879fb+_0x4a84('0x47'));var _0x351c5c=_[_0x4a84('0x33')](_0x4f9903)[_0x4a84('0x14')]();logger[_0x4a84('0x38')](_0x4a84('0x48'),_0x351c5c);fs[_0x4a84('0x49')](_0x5d2cc3,_0x351c5c+'\x0a');Papa[_0x4a84('0x4a')](fs[_0x4a84('0x4b')](_0x15b712),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3a411b,_0x230da1){try{for(var _0x5bfaf2=0x0,_0x5ea841=[];_0x5bfaf2<_0x3a411b[_0x4a84('0x4c')]['length'];_0x5bfaf2++){stats['rows']+=0x1;if(_0x3a411b[_0x4a84('0x3c')][_0x5bfaf2]){handleError(_0x3a411b['data'][_0x5bfaf2],_0x3a411b['errors'][_0x5bfaf2]);}else{var _0x170fd1=[];for(var _0x3512c9 in _0x4f9903){if(_0x4f9903[_0x4a84('0x4d')](_0x3512c9)){if(_0x3a411b[_0x4a84('0x4c')][_0x5bfaf2][_0x4f9903[_0x3512c9]]){var _0x3fa27e=_['trim'](_0x3a411b[_0x4a84('0x4c')][_0x5bfaf2][_0x4f9903[_0x3512c9]][_0x4a84('0x4e')](/"/g,'\x27'));switch(_0x3512c9){case'scheduledat':var _0x19656a=moment(_0x3fa27e,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x19656a[_0x4a84('0x4f')]()){_0x5ea841[_0x4a84('0x3d')]('\x22'+_0x3fa27e+'\x22');}else{_0x170fd1[_0x4a84('0x3d')](_0x4a84('0x50'));}break;case _0x4a84('0x23'):var _0x5e414f=parseInt(_0x3fa27e);_0x3fa27e=_[_0x4a84('0x51')](_0x5e414f)||_0x5e414f<0x0||_0x5e414f>0x4?_0x510c2e?0x3:0x2:_0x5e414f;_0x5ea841['push']('\x22'+_0x3fa27e+'\x22');break;case _0x4a84('0x52'):var _0x3f57ab=parseInt(_0x3fa27e);if(_[_0x4a84('0x53')](_0x3f57ab)&&_[_0x4a84('0x54')](_0x3b3e9f,_0x3f57ab)){_0x5ea841[_0x4a84('0x3d')]('\x22'+_0x3f57ab+'\x22');}else{_0x170fd1[_0x4a84('0x3d')](_0x4a84('0x55'));}break;case _0x4a84('0x56'):if(isEmail(_0x3fa27e)){_0x5ea841['push']('\x22'+_0x3fa27e+'\x22');}else{_0x170fd1[_0x4a84('0x3d')](_0x4a84('0x57'));}break;case _0x4a84('0x58'):var _0x40b754=moment(_0x3fa27e,_0x4a84('0x59'),!![]);if(_0x40b754[_0x4a84('0x4f')]()){_0x5ea841[_0x4a84('0x3d')]('\x22'+_0x3fa27e+'\x22');}else{_0x170fd1[_0x4a84('0x3d')](_0x4a84('0x5a'));}break;default:_0x5ea841[_0x4a84('0x3d')]('\x22'+_0x3fa27e+'\x22');}}else{switch(_0x3512c9){case _0x4a84('0x5b'):case'phone':_0x170fd1[_0x4a84('0x3d')](_0x3512c9+_0x4a84('0x5c'));break;default:_0x5ea841[_0x4a84('0x3d')]('\x22\x22');}}}}if(_0x170fd1[_0x4a84('0x5d')]){handleError(_0x3a411b[_0x4a84('0x4c')][_0x5bfaf2],{'code':_0x4a84('0x5e'),'message':_0x170fd1[_0x4a84('0x14')]()});}else{fs[_0x4a84('0x5f')](_0x5d2cc3,_0x5ea841[_0x4a84('0x14')]()+'\x0a');}_0x5ea841=[];}if(!(stats[_0x4a84('0x60')]%0xc8)){socket['emit'](_0x4a84('0x61')+_0x4879fb,stats);stats[_0x4a84('0x3c')]=[];}}if(stopped){logger[_0x4a84('0x38')](_0x4a84('0x62'));_0x230da1[_0x4a84('0x63')]();}}catch(_0x52b42a){handleError(_0x3a411b[_0x4a84('0x4c')][_0x5bfaf2],{'code':_0x4a84('0x64'),'message':_0x52b42a['message']});logger[_0x4a84('0x3a')](_0x4a84('0x65'),_0x52b42a[_0x4a84('0x3b')]);}},'complete':function(){try{var _0x2425b9=[];var _0x1c1341=_0x4a84('0x30');if(_0x5e7fa5['duplicates']&&_0x5e7fa5[_0x4a84('0x66')]['length']){_0x1c1341=_0x4a84('0x67')+_0x4879fb;_0x2425b9[_0x4a84('0x3d')](_0x4a84('0x68')+_0x1c1341+_0x4a84('0x69'));}var _0xe29327=util['format']('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x5d2cc3,_0x1c1341,_0x351c5c,_0x5e7fa5[_0x4a84('0x2f')],_0x5e7fa5[_0x4a84('0x34')]||null,NOW,NOW);if(_[_0x4a84('0x6a')](_0x4f9903[_0x4a84('0x6b')])){_0xe29327+=_0x4a84('0x6c');}_0x2425b9['push'](_0xe29327);if(_0x5e7fa5[_0x4a84('0x66')]&&_0x5e7fa5['duplicates'][_0x4a84('0x5d')]){_0x2425b9[_0x4a84('0x3d')](insertCmContact(_0x5e7fa5['ListId'],_0x1c1341,_0x5e7fa5[_0x4a84('0x66')],_0x4f9903));_0x2425b9['push']('DROP\x20TABLE\x20'+_0x1c1341+';');}_0x2425b9[_0x4a84('0x3d')](insertCmHopper(_0x5e7fa5[_0x4a84('0x2f')],_0x4a84('0x6d'),_0x4a84('0x6e'),'VoiceQueueId',_0x510c2e));_0x2425b9[_0x4a84('0x3d')](insertCmHopperBlack(_0x5e7fa5[_0x4a84('0x2f')],_0x4a84('0x6f'),_0x4a84('0x6e'),_0x4a84('0x70')));_0x2425b9[_0x4a84('0x3d')](insertCmHopper(_0x5e7fa5[_0x4a84('0x2f')],_0x4a84('0x71'),_0x4a84('0x72'),'CampaignId',_0x510c2e));_0x2425b9[_0x4a84('0x3d')](insertCmHopperBlack(_0x5e7fa5[_0x4a84('0x2f')],'campaigns_has_cm_blacklists','campaigns',_0x4a84('0x73')));BPromise['each'](_0x2425b9,handleQuery)['then'](function(_0x3221d3){stats[_0x4a84('0x74')]=!![];stats[_0x4a84('0x75')]=_0x5e7fa5[_0x4a84('0x66')]&&_0x5e7fa5[_0x4a84('0x66')][_0x4a84('0x5d')]?results[0x2][_0x4a84('0x75')]:results[0x0]['affectedRows'];socket['emit'](_0x4a84('0x61')+_0x4879fb,stats);fs[_0x4a84('0x76')](_0x15b712);fs['unlink'](_0x5d2cc3);process[_0x4a84('0x77')](0x0);})[_0x4a84('0x40')](function(_0x198047){logger[_0x4a84('0x3a')](_0x198047[_0x4a84('0x3b')]);process[_0x4a84('0x77')](0x1);});}catch(_0x369f88){logger['error'](_0x4a84('0x78'),_0x369f88[_0x4a84('0x3b')]);process[_0x4a84('0x77')](0x1);}},'error':function(_0x538927,_0x1b709d,_0x557875,_0x3acda7){throw new Error(_0x3acda7);}});}function validate(){if(process['argv']&&process['argv'][_0x4a84('0x5d')]<0x4){throw new Error(_0x4a84('0x79'));}var _0x4fd2a7=path[_0x4a84('0x14')](config[_0x4a84('0x45')],'server/files/tmp',process[_0x4a84('0x7a')][0x2]);if(!fs['existsSync'](_0x4fd2a7)){throw new Error(_0x4a84('0x7b'));}var _0x24a992={};try{_0x24a992=JSON[_0x4a84('0x4a')](process['argv'][0x3]);if(!_0x24a992[_0x4a84('0x43')]){throw new Error(_0x4a84('0x7c'));}if(!_0x24a992[_0x4a84('0x43')]['phone']){throw new Error(_0x4a84('0x7d'));}if(!_0x24a992[_0x4a84('0x43')][_0x4a84('0x5b')]){throw new Error('firstName\x20is\x20mandatory');}var _0x13f3a6=0x0;if(_0x24a992[_0x4a84('0x43')][_0x4a84('0x52')]){_0x13f3a6=0x1;}if(!_0x24a992[_0x4a84('0x2f')]){throw new Error(_0x4a84('0x7e'));}}catch(_0x3b14be){throw new Error(_0x4a84('0x7f'));}var _0x457797=[];try{_0x457797=_[_0x4a84('0x80')](JSON[_0x4a84('0x4a')](process['argv'][0x4]),'id');}catch(_0x33c070){logger[_0x4a84('0x38')]('No\x20agent\x20available');}main(_0x4fd2a7,_0x24a992,_0x457797,_0x13f3a6);}validate();process['on'](_0x4a84('0x81'),handleStop);process['on'](_0x4a84('0x82'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 6d13632..23a097b 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 _0x9348=['string','toLowerCase','voice','inbound','push','variable','queue','outbound','getDescriptions','***\x20Call\x20Info\x20***','Caller\x20Number','calleridnum','keyValue','Caller\x20Name','Call\x20To','destexten','Queue','UniqueId','uniqueid','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','destcalleridnum','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','membername','starttime','Answer\x20Time','Complete\x20Time','endtime','Billable\x20Time','billableseconds','getSubjects'];(function(_0x4f2781,_0x1f6bcc){var _0x28a2e6=function(_0x1bdb6a){while(--_0x1bdb6a){_0x4f2781['push'](_0x4f2781['shift']());}};_0x28a2e6(++_0x1f6bcc);}(_0x9348,0x10d));var _0x8934=function(_0x368db2,_0x492ad7){_0x368db2=_0x368db2-0x0;var _0x4f2bb1=_0x9348[_0x368db2];return _0x4f2bb1;};'use strict';exports[_0x8934('0x0')]=function(_0x23f716,_0x472223){var _0x135b2c=[{'type':_0x8934('0x1'),'content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x23f716[_0x8934('0x2')]()){case _0x8934('0x3'):switch(_0x472223['toLowerCase']()){case _0x8934('0x4'):_0x135b2c[_0x8934('0x5')]({'type':_0x8934('0x6'),'content':'','variableName':_0x8934('0x7')});_0x135b2c[_0x8934('0x5')]({'type':_0x8934('0x6'),'content':'','variableName':'calleridnum'});break;case _0x8934('0x8'):_0x135b2c[_0x8934('0x5')]({'type':_0x8934('0x1'),'content':'Outbound\x20Call','variableName':null});_0x135b2c['push']({'type':'variable','content':'','variableName':'destcalleridnum'});break;}}return _0x135b2c;};exports[_0x8934('0x9')]=function(_0x554432,_0xe1adf4){var _0x8a88c0=[];switch(_0x554432[_0x8934('0x2')]()){case _0x8934('0x3'):switch(_0xe1adf4[_0x8934('0x2')]()){case _0x8934('0x4'):_0x8a88c0=[{'type':_0x8934('0x1'),'content':_0x8934('0xa'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x8934('0xb'),'keyType':_0x8934('0x6'),'variableName':_0x8934('0xc')},{'type':_0x8934('0xd'),'content':'','key':_0x8934('0xe'),'keyType':_0x8934('0x6'),'variableName':'calleridname'},{'type':_0x8934('0xd'),'content':'','key':_0x8934('0xf'),'keyType':_0x8934('0x6'),'variableName':_0x8934('0x10')},{'type':_0x8934('0xd'),'content':'','key':_0x8934('0x11'),'keyType':_0x8934('0x6'),'variableName':_0x8934('0x7')},{'type':'keyValue','content':'','key':_0x8934('0x12'),'keyType':_0x8934('0x6'),'variableName':_0x8934('0x13')},{'type':'keyValue','content':'','key':'Date','keyType':'variable','variableName':_0x8934('0x14')},{'type':'string','content':_0x8934('0x15'),'key':null,'keyType':null,'variableName':null},{'type':_0x8934('0xd'),'content':'','key':_0x8934('0x16'),'keyType':_0x8934('0x6'),'variableName':_0x8934('0x17')},{'type':'keyValue','content':'','key':_0x8934('0x18'),'keyType':'variable','variableName':_0x8934('0x19')},{'type':_0x8934('0x1'),'content':_0x8934('0x1a'),'key':null,'keyType':null,'variableName':null},{'type':_0x8934('0xd'),'content':'','key':_0x8934('0x1b'),'keyType':_0x8934('0x6'),'variableName':_0x8934('0x14')},{'type':'keyValue','content':'','key':_0x8934('0x1c'),'keyType':_0x8934('0x6'),'variableName':_0x8934('0x1d')},{'type':_0x8934('0xd'),'content':'','key':_0x8934('0x1e'),'keyType':'variable','variableName':_0x8934('0x1f')},{'type':_0x8934('0xd'),'content':'','key':_0x8934('0x20'),'keyType':'variable','variableName':_0x8934('0x21')},{'type':'keyValue','content':'','key':_0x8934('0x22'),'keyType':_0x8934('0x6'),'variableName':_0x8934('0x23')}];break;case'outbound':_0x8a88c0=[{'type':_0x8934('0x1'),'content':_0x8934('0xa'),'variableName':null},{'type':_0x8934('0xd'),'content':'','key':_0x8934('0x24'),'keyType':'variable','keyContent':'','variableName':_0x8934('0x19')},{'type':_0x8934('0xd'),'content':'','key':_0x8934('0x25'),'keyType':_0x8934('0x6'),'keyContent':'','variableName':_0x8934('0x26')},{'type':_0x8934('0xd'),'content':'','key':_0x8934('0x12'),'keyType':_0x8934('0x6'),'keyContent':'','variableName':_0x8934('0x13')},{'type':_0x8934('0xd'),'content':'','key':'Date','keyType':_0x8934('0x6'),'keyContent':'','variableName':_0x8934('0x27')},{'type':'string','content':_0x8934('0x1a')},{'type':_0x8934('0xd'),'content':'','key':_0x8934('0x28'),'keyType':_0x8934('0x6'),'keyContent':'','variableName':'answertime'},{'type':_0x8934('0xd'),'content':'','key':_0x8934('0x29'),'keyType':_0x8934('0x6'),'keyContent':'','variableName':_0x8934('0x2a')},{'type':_0x8934('0xd'),'content':'','key':'Duration','keyType':_0x8934('0x6'),'keyContent':'','variableName':'duration'},{'type':'keyValue','content':'','key':_0x8934('0x2b'),'keyType':_0x8934('0x6'),'keyContent':'','variableName':_0x8934('0x2c')}];break;}}return _0x8a88c0;}; \ No newline at end of file +var _0x9f4d=['calleridnum','destcalleridnum','getDescriptions','inbound','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','outbound','Called\x20Number','membername','UniqueId','starttime','Answer\x20Time','answertime','Complete\x20Time','duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice','push','queue','variable'];(function(_0x2d99e1,_0x3539b0){var _0x21890a=function(_0x281edd){while(--_0x281edd){_0x2d99e1['push'](_0x2d99e1['shift']());}};_0x21890a(++_0x3539b0);}(_0x9f4d,0xb0));var _0xd9f4=function(_0xab6a2b,_0x403a6b){_0xab6a2b=_0xab6a2b-0x0;var _0x33edba=_0x9f4d[_0xab6a2b];return _0x33edba;};'use strict';exports[_0xd9f4('0x0')]=function(_0x3861ca,_0x34f803){var _0xd40ae2=[{'type':_0xd9f4('0x1'),'content':_0xd9f4('0x2'),'variableName':null}];switch(_0x3861ca[_0xd9f4('0x3')]()){case _0xd9f4('0x4'):switch(_0x34f803[_0xd9f4('0x3')]()){case'inbound':_0xd40ae2[_0xd9f4('0x5')]({'type':'variable','content':'','variableName':_0xd9f4('0x6')});_0xd40ae2[_0xd9f4('0x5')]({'type':_0xd9f4('0x7'),'content':'','variableName':_0xd9f4('0x8')});break;case'outbound':_0xd40ae2[_0xd9f4('0x5')]({'type':_0xd9f4('0x1'),'content':'Outbound\x20Call','variableName':null});_0xd40ae2[_0xd9f4('0x5')]({'type':'variable','content':'','variableName':_0xd9f4('0x9')});break;}}return _0xd40ae2;};exports[_0xd9f4('0xa')]=function(_0x2deeb5,_0x429d90){var _0x2bd084=[];switch(_0x2deeb5['toLowerCase']()){case _0xd9f4('0x4'):switch(_0x429d90[_0xd9f4('0x3')]()){case _0xd9f4('0xb'):_0x2bd084=[{'type':_0xd9f4('0x1'),'content':_0xd9f4('0xc'),'key':null,'keyType':null,'variableName':null},{'type':_0xd9f4('0xd'),'content':'','key':_0xd9f4('0xe'),'keyType':_0xd9f4('0x7'),'variableName':'calleridnum'},{'type':_0xd9f4('0xd'),'content':'','key':_0xd9f4('0xf'),'keyType':_0xd9f4('0x7'),'variableName':_0xd9f4('0x10')},{'type':_0xd9f4('0xd'),'content':'','key':_0xd9f4('0x11'),'keyType':_0xd9f4('0x7'),'variableName':_0xd9f4('0x12')},{'type':_0xd9f4('0xd'),'content':'','key':_0xd9f4('0x13'),'keyType':_0xd9f4('0x7'),'variableName':_0xd9f4('0x6')},{'type':_0xd9f4('0xd'),'content':'','key':'UniqueId','keyType':'variable','variableName':'uniqueid'},{'type':'keyValue','content':'','key':_0xd9f4('0x14'),'keyType':_0xd9f4('0x7'),'variableName':_0xd9f4('0x15')},{'type':'string','content':_0xd9f4('0x16'),'key':null,'keyType':null,'variableName':null},{'type':_0xd9f4('0xd'),'content':'','key':_0xd9f4('0x17'),'keyType':'variable','variableName':_0xd9f4('0x18')},{'type':'keyValue','content':'','key':_0xd9f4('0x19'),'keyType':_0xd9f4('0x7'),'variableName':_0xd9f4('0x9')},{'type':'string','content':_0xd9f4('0x1a'),'key':null,'keyType':null,'variableName':null},{'type':_0xd9f4('0xd'),'content':'','key':'Agent\x20Ring','keyType':'variable','variableName':_0xd9f4('0x15')},{'type':'keyValue','content':'','key':_0xd9f4('0x1b'),'keyType':_0xd9f4('0x7'),'variableName':_0xd9f4('0x1c')},{'type':_0xd9f4('0xd'),'content':'','key':_0xd9f4('0x1d'),'keyType':_0xd9f4('0x7'),'variableName':_0xd9f4('0x1e')},{'type':_0xd9f4('0xd'),'content':'','key':_0xd9f4('0x1f'),'keyType':'variable','variableName':_0xd9f4('0x20')},{'type':_0xd9f4('0xd'),'content':'','key':_0xd9f4('0x21'),'keyType':_0xd9f4('0x7'),'variableName':_0xd9f4('0x22')}];break;case _0xd9f4('0x23'):_0x2bd084=[{'type':_0xd9f4('0x1'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0xd9f4('0xd'),'content':'','key':_0xd9f4('0x24'),'keyType':_0xd9f4('0x7'),'keyContent':'','variableName':_0xd9f4('0x9')},{'type':'keyValue','content':'','key':'Member\x20Name','keyType':'variable','keyContent':'','variableName':_0xd9f4('0x25')},{'type':'keyValue','content':'','key':_0xd9f4('0x26'),'keyType':_0xd9f4('0x7'),'keyContent':'','variableName':'uniqueid'},{'type':'keyValue','content':'','key':_0xd9f4('0x14'),'keyType':_0xd9f4('0x7'),'keyContent':'','variableName':_0xd9f4('0x27')},{'type':_0xd9f4('0x1'),'content':_0xd9f4('0x1a')},{'type':_0xd9f4('0xd'),'content':'','key':_0xd9f4('0x28'),'keyType':_0xd9f4('0x7'),'keyContent':'','variableName':_0xd9f4('0x29')},{'type':_0xd9f4('0xd'),'content':'','key':_0xd9f4('0x2a'),'keyType':_0xd9f4('0x7'),'keyContent':'','variableName':'endtime'},{'type':_0xd9f4('0xd'),'content':'','key':'Duration','keyType':_0xd9f4('0x7'),'keyContent':'','variableName':_0xd9f4('0x2b')},{'type':_0xd9f4('0xd'),'content':'','key':_0xd9f4('0x2c'),'keyType':_0xd9f4('0x7'),'keyContent':'','variableName':_0xd9f4('0x2d')}];break;}}return _0x2bd084;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index cd771f4..6ccfc0d 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 _0xed3d=['findOne','then','update','info','error','tracked','user','query','body','omit','html','phone','fax','mobile','lodash','openchannel-interactions','../../config/logger','fax-interactions','sms-interactions','chat-interactions','upperFirst','InteractionId','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','role','stringify'];(function(_0x5c444b,_0x1d8496){var _0x338272=function(_0x4726ff){while(--_0x4726ff){_0x5c444b['push'](_0x5c444b['shift']());}};_0x338272(++_0x1d8496);}(_0xed3d,0x16d));var _0xded3=function(_0x5e94a5,_0x6a98c3){_0x5e94a5=_0x5e94a5-0x0;var _0x37ee72=_0xed3d[_0x5e94a5];return _0x37ee72;};'use strict';var _=require(_0xded3('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require('../../config/logger')(_0xded3('0x1')),'mail':require('../../config/logger')('mail-interactions'),'fax':require(_0xded3('0x2'))(_0xded3('0x3')),'sms':require('../../config/logger')(_0xded3('0x4')),'chat':require('../../config/logger')(_0xded3('0x5'))};function getInteractionId(_0xe1965f,_0x5b0833,_0x27ec80){if(_0xe1965f&&_0xe1965f[_[_0xded3('0x6')](_0x27ec80)+_0xded3('0x7')]){return _0xe1965f[_['upperFirst'](_0x27ec80)+_0xded3('0x7')];}else if(_0xe1965f&&_0xe1965f['id']){return _0xe1965f['id'];}else if(_0x5b0833&&_0x5b0833['id']){return _0x5b0833['id'];}else{return'unknown';}}function log(_0x558262,_0x509070,_0x23f15e,_0x36091d,_0x18d8fe,_0x4b7662){loggers[_0x18d8fe[_0xded3('0x8')]()][_0x558262](_0xded3('0x9'),_0x4b7662[_0xded3('0xa')](),_0x509070?_0x509070['id']:null,_0x509070?_0x509070['name']:null,_0x509070?_0x509070[_0xded3('0xb')]:null,getInteractionId(_0x23f15e,_0x36091d,_0x18d8fe),_0x23f15e?JSON[_0xded3('0xc')](_0x23f15e):'null');}function updateUser(_0x5af8ce,_0x4e0dbe,_0x12a20e,_0x3d3d2b,_0x3afd4a){db[_[_0xded3('0x6')](_0x3d3d2b)+'Interaction'][_0xded3('0xd')]({'where':{'id':getInteractionId(_0x4e0dbe,_0x12a20e,_0x3d3d2b)}})[_0xded3('0xe')](function(_0x473fe9){if(_0x473fe9){return _0x473fe9[_0xded3('0xf')]({'UserId':_0x5af8ce?_0x5af8ce['id']:null});}})['then'](function(_0x2215a){if(_0x2215a){log(_0xded3('0x10'),_0x5af8ce,_0x4e0dbe,_0x12a20e,_0x3d3d2b,_0x3afd4a);}})['catch'](function(){log(_0xded3('0x11'),_0x5af8ce,_0x4e0dbe,_0x12a20e,_0x3d3d2b,_0x3afd4a);});}exports[_0xded3('0x12')]=function(_0x25087b,_0x544fd3){return function(_0x3ccc3f,_0xd9bb05,_0x2a9182){var _0x17c80d=_0x3ccc3f[_0xded3('0x13')];var _0x3ec994={};var _0x3647f5=_0x3ccc3f[_0xded3('0x14')];if(_0x3ec994){_0x3ec994=_['clone'](_0x3ccc3f[_0xded3('0x15')]);_0x3ec994=_[_0xded3('0x16')](_0x3ec994,[_0xded3('0x15'),_0xded3('0x17'),_0xded3('0x18'),_0xded3('0x19'),_0xded3('0x1a')]);}updateUser(_0x17c80d,_0x3ec994,_0x3647f5,_0x25087b,_0x544fd3);_0x2a9182(null);};}; \ No newline at end of file +var _0x5112=['body','omit','html','phone','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','role','stringify','null','findOne','then','update','info','error','tracked','user','query'];(function(_0x589f71,_0x212326){var _0x5763bd=function(_0x2cb8e1){while(--_0x2cb8e1){_0x589f71['push'](_0x589f71['shift']());}};_0x5763bd(++_0x212326);}(_0x5112,0xb3));var _0x2511=function(_0x43dc7e,_0x49a390){_0x43dc7e=_0x43dc7e-0x0;var _0x21e12d=_0x5112[_0x43dc7e];return _0x21e12d;};'use strict';var _=require(_0x2511('0x0'));var db=require(_0x2511('0x1'))['db'];var loggers={'openchannel':require(_0x2511('0x2'))(_0x2511('0x3')),'mail':require(_0x2511('0x2'))(_0x2511('0x4')),'fax':require(_0x2511('0x2'))(_0x2511('0x5')),'sms':require(_0x2511('0x2'))(_0x2511('0x6')),'chat':require(_0x2511('0x2'))('chat-interactions')};function getInteractionId(_0x3f0425,_0x43d48f,_0x5d5e82){if(_0x3f0425&&_0x3f0425[_[_0x2511('0x7')](_0x5d5e82)+_0x2511('0x8')]){return _0x3f0425[_[_0x2511('0x7')](_0x5d5e82)+_0x2511('0x8')];}else if(_0x3f0425&&_0x3f0425['id']){return _0x3f0425['id'];}else if(_0x43d48f&&_0x43d48f['id']){return _0x43d48f['id'];}else{return _0x2511('0x9');}}function log(_0x5729e3,_0x4858c4,_0x55daa5,_0xd8b0f5,_0x9abaae,_0x2071e6){loggers[_0x9abaae[_0x2511('0xa')]()][_0x5729e3](_0x2511('0xb'),_0x2071e6[_0x2511('0xc')](),_0x4858c4?_0x4858c4['id']:null,_0x4858c4?_0x4858c4['name']:null,_0x4858c4?_0x4858c4[_0x2511('0xd')]:null,getInteractionId(_0x55daa5,_0xd8b0f5,_0x9abaae),_0x55daa5?JSON[_0x2511('0xe')](_0x55daa5):_0x2511('0xf'));}function updateUser(_0x2a6c74,_0x12209d,_0xe223c6,_0x114a63,_0x3b07fa){db[_['upperFirst'](_0x114a63)+'Interaction'][_0x2511('0x10')]({'where':{'id':getInteractionId(_0x12209d,_0xe223c6,_0x114a63)}})[_0x2511('0x11')](function(_0x2db43b){if(_0x2db43b){return _0x2db43b[_0x2511('0x12')]({'UserId':_0x2a6c74?_0x2a6c74['id']:null});}})[_0x2511('0x11')](function(_0x6f324f){if(_0x6f324f){log(_0x2511('0x13'),_0x2a6c74,_0x12209d,_0xe223c6,_0x114a63,_0x3b07fa);}})['catch'](function(){log(_0x2511('0x14'),_0x2a6c74,_0x12209d,_0xe223c6,_0x114a63,_0x3b07fa);});}exports[_0x2511('0x15')]=function(_0x2dba4f,_0x37f694){return function(_0x4d1f74,_0xabebb4,_0x50ce46){var _0x1ac6d3=_0x4d1f74[_0x2511('0x16')];var _0x88025d={};var _0x3a86a6=_0x4d1f74[_0x2511('0x17')];if(_0x88025d){_0x88025d=_['clone'](_0x4d1f74[_0x2511('0x18')]);_0x88025d=_[_0x2511('0x19')](_0x88025d,[_0x2511('0x18'),_0x2511('0x1a'),_0x2511('0x1b'),'fax',_0x2511('0x1c')]);}updateUser(_0x1ac6d3,_0x88025d,_0x3a86a6,_0x2dba4f,_0x37f694);_0x50ce46(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index fa7bac3..58263c3 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 _0x6e08=['crypto','util','composable-middleware','../../mysqldb','../../config/environment','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','parse','hasOwnProperty','License','then','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','user','isUserLimit'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x6e08,0xfa));var _0x86e0=function(_0x1bbb5a,_0x186179){_0x1bbb5a=_0x1bbb5a-0x0;var _0x4e27af=_0x6e08[_0x1bbb5a];return _0x4e27af;};'use strict';var crypto=require(_0x86e0('0x0'));var util=require(_0x86e0('0x1'));var compose=require(_0x86e0('0x2'));var db=require(_0x86e0('0x3'))['db'];var config=require(_0x86e0('0x4'));function getValueFromLicense(_0x1517d8,_0x53fabe){if(_0x1517d8&&_0x53fabe){if(_0x53fabe['data1']&&_0x53fabe[_0x86e0('0x5')]){var _0x409f5c=_0x53fabe['data1'];var _0x2feb39=_0x53fabe[_0x86e0('0x5')];var _0x534764=_0x409f5c[_0x86e0('0x6')]('-')[0x4];var _0x1728d2=_0x409f5c['split']('-')[0x0];var _0x55eed0=crypto[_0x86e0('0x7')](_0x86e0('0x8'),util[_0x86e0('0x9')](_0x86e0('0xa'),_0x534764,_0x409f5c,_0x1728d2));var _0x124bd2=_0x55eed0[_0x86e0('0xb')](_0x2feb39,_0x86e0('0xc'),_0x86e0('0xd'));_0x124bd2+=_0x55eed0[_0x86e0('0xe')]('utf8');var _0x93fe95=JSON[_0x86e0('0xf')](_0x124bd2);return _0x93fe95[_0x86e0('0x10')](_0x1517d8)?_0x93fe95[_0x1517d8]:null;}}return null;}function isLimit(_0x4069f9,_0x652dd,_0x102dcd,_0x5bd7f5){var _0x13419f=_0x652dd;return compose()['use'](function(_0x2c6758,_0x518bf2,_0x1386a2){return db[_0x86e0('0x11')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0x86e0('0x12')](function(_0x226ba2){var _0x24c4b9=getValueFromLicense(_0x4069f9,_0x226ba2);return _0x24c4b9?_0x24c4b9:_0x13419f;})[_0x86e0('0x12')](function(_0x347925){_0x13419f=_0x347925;return _0x102dcd['count'](_0x5bd7f5);})[_0x86e0('0x12')](function(_0x49f200){if(_0x49f200>=_0x13419f){return _0x518bf2['status'](0x193)[_0x86e0('0x13')]({'message':util['format'](_0x86e0('0x14'),_0x4069f9)});}_0x1386a2();})[_0x86e0('0x15')](function(_0x4d55a1){_0x1386a2(_0x4d55a1);});});}function isUserLimit(){return isLimit(_0x86e0('0x16'),0x1,db['User'],{'where':{'$or':[{'role':'admin'},{'role':_0x86e0('0x17')}]}});}exports[_0x86e0('0x18')]=isUserLimit; \ No newline at end of file +var _0xc1f4=['update','base64','utf8','final','parse','use','License','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','users','User','admin','user','isUserLimit','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s'];(function(_0x198675,_0x3f80d1){var _0x5cb92a=function(_0x42c816){while(--_0x42c816){_0x198675['push'](_0x198675['shift']());}};_0x5cb92a(++_0x3f80d1);}(_0xc1f4,0x1a6));var _0x4c1f=function(_0x221a0f,_0x3970f6){_0x221a0f=_0x221a0f-0x0;var _0x30309e=_0xc1f4[_0x221a0f];return _0x30309e;};'use strict';var crypto=require('crypto');var util=require('util');var compose=require(_0x4c1f('0x0'));var db=require(_0x4c1f('0x1'))['db'];var config=require(_0x4c1f('0x2'));function getValueFromLicense(_0x1cebcc,_0x3c6d35){if(_0x1cebcc&&_0x3c6d35){if(_0x3c6d35[_0x4c1f('0x3')]&&_0x3c6d35[_0x4c1f('0x4')]){var _0x13815a=_0x3c6d35['data1'];var _0x44238e=_0x3c6d35[_0x4c1f('0x4')];var _0x13346a=_0x13815a[_0x4c1f('0x5')]('-')[0x4];var _0x4018f0=_0x13815a[_0x4c1f('0x5')]('-')[0x0];var _0x1b8e12=crypto[_0x4c1f('0x6')](_0x4c1f('0x7'),util[_0x4c1f('0x8')](_0x4c1f('0x9'),_0x13346a,_0x13815a,_0x4018f0));var _0x14b3d7=_0x1b8e12[_0x4c1f('0xa')](_0x44238e,_0x4c1f('0xb'),_0x4c1f('0xc'));_0x14b3d7+=_0x1b8e12[_0x4c1f('0xd')](_0x4c1f('0xc'));var _0x5aa218=JSON[_0x4c1f('0xe')](_0x14b3d7);return _0x5aa218['hasOwnProperty'](_0x1cebcc)?_0x5aa218[_0x1cebcc]:null;}}return null;}function isLimit(_0x29ffd9,_0x34a4f0,_0x3fefc1,_0x31242d){var _0x485ef0=_0x34a4f0;return compose()[_0x4c1f('0xf')](function(_0x166ec9,_0xd1d789,_0x455db4){return db[_0x4c1f('0x10')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0x4c1f('0x11')](function(_0x31a3ac){var _0x16d271=getValueFromLicense(_0x29ffd9,_0x31a3ac);return _0x16d271?_0x16d271:_0x485ef0;})[_0x4c1f('0x11')](function(_0x5d7227){_0x485ef0=_0x5d7227;return _0x3fefc1[_0x4c1f('0x12')](_0x31242d);})[_0x4c1f('0x11')](function(_0x2afb1d){if(_0x2afb1d>=_0x485ef0){return _0xd1d789[_0x4c1f('0x13')](0x193)[_0x4c1f('0x14')]({'message':util[_0x4c1f('0x8')](_0x4c1f('0x15'),_0x29ffd9)});}_0x455db4();})['catch'](function(_0x428d8e){_0x455db4(_0x428d8e);});});}function isUserLimit(){return isLimit(_0x4c1f('0x16'),0x1,db[_0x4c1f('0x17')],{'where':{'$or':[{'role':_0x4c1f('0x18')},{'role':_0x4c1f('0x19')}]}});}exports[_0x4c1f('0x1a')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 4672a52..9ce7b5c 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 _0x1eb7=['start','shift','pop','utcOffset','hours','minutes','seconds','parseSearch','sqlOperator','startsWith','[$and]','[$or]','split','length','slice','forEach','match','filter','indexOf','map','buildExpression','DATE','operator','$eq','value','includes','$gt','add','format','YYYY-MM-DD','castTo','text','\x20AS\x20','field','$ne','$notIn','\x20IS\x20NULL)','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','>\x20?','$lte','<=\x20?','$gte','>=\x20?','$between','BETWEEN\x20?\x20AND\x20?','$in'];(function(_0xe28d4a,_0x9d4786){var _0x5ad00a=function(_0x27b4d2){while(--_0x27b4d2){_0xe28d4a['push'](_0xe28d4a['shift']());}};_0x5ad00a(++_0x9d4786);}(_0x1eb7,0xa9));var _0x71eb=function(_0x4c0c73,_0x2c0df7){_0x4c0c73=_0x4c0c73-0x0;var _0x598850=_0x1eb7[_0x4c0c73];return _0x598850;};'use strict';var _=require('lodash');var moment=require('moment');exports[_0x71eb('0x0')]=function(_0x5aaa32){var _0x166b24={'conditions':[]};_0x166b24[_0x71eb('0x1')]=_[_0x71eb('0x2')](_0x5aaa32,'[$or]')?'or':'and';var _0xd2424a=_0x5aaa32['replace'](_0x71eb('0x3'),'')['replace'](_0x71eb('0x4'),'')[_0x71eb('0x5')]('||');for(var _0x276d4a=0x0;_0x276d4a<_0xd2424a[_0x71eb('0x6')];_0x276d4a++){var _0x5e193e=_0xd2424a[_0x276d4a]['split'](':=');var _0x2a7506=_0x5e193e[0x0];var _0x17194e=_0x5e193e[_0x71eb('0x7')](0x1);_0x17194e[_0x71eb('0x8')](function(_0x181c39){var _0x57b763=_0x181c39['split']('[')['shift']();var _0x36c8a0=_0x181c39[_0x71eb('0x9')](/\[(.*?)\]/g);_0x36c8a0[_0x71eb('0x8')](function(_0x2dd29f){var _0x4d7f49=_0x2dd29f[_0x71eb('0x5')]('[')[_0x71eb('0xa')](function(_0x9eb3a6){return _0x9eb3a6[_0x71eb('0xb')](']')>-0x1;})[_0x71eb('0xc')](function(_0x38c2a9){return _0x38c2a9[_0x71eb('0x5')](']')[0x0];})[0x0];_0x166b24['conditions']['push']({'field':_0x2a7506,'operator':_0x57b763,'value':_0x4d7f49});});});}return _0x166b24;};exports[_0x71eb('0xd')]=function(_0x2c424b,_0x3d4c3d,_0xf41997){var _0x354833={};if(_0x3d4c3d===_0x71eb('0xe')){if(_0xf41997[_0x71eb('0xf')]===_0x71eb('0x10')){_0xf41997[_0x71eb('0xf')]='$between';_0xf41997[_0x71eb('0x11')]+=','+_0xf41997[_0x71eb('0x11')];}else if(_[_0x71eb('0x12')]([_0x71eb('0x13'),'$lte'],_0xf41997[_0x71eb('0xf')])){_0xf41997[_0x71eb('0x11')]=moment(_0xf41997[_0x71eb('0x11')])[_0x71eb('0x14')](0x1,'days')[_0x71eb('0x15')](_0x71eb('0x16'));}}if(_0xf41997[_0x71eb('0x17')]){_0x3d4c3d=_0xf41997['castTo'];_0x354833[_0x71eb('0x18')]='CAST('+_0x2c424b+'.'+_0xf41997['field']+_0x71eb('0x19')+_0xf41997['castTo']+')\x20'+parseOperator(_0xf41997[_0x71eb('0xf')]);}else{_0x354833[_0x71eb('0x18')]=_0x2c424b+'.'+_0xf41997[_0x71eb('0x1a')]+'\x20'+parseOperator(_0xf41997[_0x71eb('0xf')]);}if(_[_0x71eb('0x12')]([_0x71eb('0x1b'),_0x71eb('0x1c')],_0xf41997[_0x71eb('0xf')]))_0x354833[_0x71eb('0x18')]='('+_0x354833[_0x71eb('0x18')]+'\x20OR\x20'+_0x2c424b+'.'+_0xf41997['field']+_0x71eb('0x1d');_0x354833[_0x71eb('0x11')]=parseValue(_0x3d4c3d,_0xf41997['operator'],_0xf41997[_0x71eb('0x11')]);return _0x354833;};function parseOperator(_0x4c6339){var _0x416e5a;switch(_0x4c6339){case'$in':_0x416e5a=_0x71eb('0x1e');break;case _0x71eb('0x1c'):_0x416e5a=_0x71eb('0x1f');break;case _0x71eb('0x10'):_0x416e5a=_0x71eb('0x20');break;case _0x71eb('0x1b'):_0x416e5a=_0x71eb('0x21');break;case _0x71eb('0x22'):case _0x71eb('0x23'):case _0x71eb('0x24'):_0x416e5a=_0x71eb('0x25');break;case _0x71eb('0x26'):_0x416e5a='<\x20?';break;case'$gt':_0x416e5a=_0x71eb('0x27');break;case _0x71eb('0x28'):_0x416e5a=_0x71eb('0x29');break;case _0x71eb('0x2a'):_0x416e5a=_0x71eb('0x2b');break;case _0x71eb('0x2c'):_0x416e5a=_0x71eb('0x2d');break;}return _0x416e5a;}function parseValue(_0x416e8f,_0xbdbecc,_0xf2a647){var _0x156306={'start':undefined,'end':undefined};switch(_0xbdbecc){case _0x71eb('0x2e'):case _0x71eb('0x1c'):_0x156306[_0x71eb('0x2f')]=_0xf2a647[_0x71eb('0x5')](',');break;case'$substring':_0x156306['start']='%'+_0xf2a647+'%';break;case _0x71eb('0x23'):_0x156306[_0x71eb('0x2f')]=_0xf2a647+'%';break;case _0x71eb('0x24'):_0x156306['start']='%'+_0xf2a647;break;case _0x71eb('0x2c'):var _0x56e4f7=_0xf2a647[_0x71eb('0x5')](',');var _0xf2a647=_0x56e4f7[_0x71eb('0x30')]();var _0x1772a9=_0x56e4f7[_0x71eb('0x31')]();if(_0x416e8f===_0x71eb('0xe')){_0xf2a647=moment(_0xf2a647)['utcOffset'](0x0,!![])['format']();_0x1772a9=moment(_0x1772a9)[_0x71eb('0x32')](0x0,!![])[_0x71eb('0x14')](0x17,_0x71eb('0x33'))[_0x71eb('0x14')](0x3b,_0x71eb('0x34'))[_0x71eb('0x14')](0x3b,_0x71eb('0x35'))[_0x71eb('0x15')]();}_0x156306={'start':_0xf2a647,'end':_0x1772a9};break;default:_0x156306['start']=_0xf2a647;break;}return _0x156306;} \ No newline at end of file +var _0xed2a=['start','$substring','pop','hours','minutes','seconds','lodash','moment','parseSearch','sqlOperator','[$or]','replace','[$and]','split','length','slice','forEach','shift','match','filter','indexOf','map','conditions','push','buildExpression','DATE','$eq','operator','$between','value','includes','$gt','$lte','add','format','YYYY-MM-DD','castTo','text','CAST(','field','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','$in'];(function(_0x4024a8,_0x24792b){var _0x4d7178=function(_0xdb2f5d){while(--_0xdb2f5d){_0x4024a8['push'](_0x4024a8['shift']());}};_0x4d7178(++_0x24792b);}(_0xed2a,0x7c));var _0xaed2=function(_0x5302bd,_0x55238a){_0x5302bd=_0x5302bd-0x0;var _0x3e751b=_0xed2a[_0x5302bd];return _0x3e751b;};'use strict';var _=require(_0xaed2('0x0'));var moment=require(_0xaed2('0x1'));exports[_0xaed2('0x2')]=function(_0x43c9a0){var _0x5af94b={'conditions':[]};_0x5af94b[_0xaed2('0x3')]=_['startsWith'](_0x43c9a0,_0xaed2('0x4'))?'or':'and';var _0x3154ed=_0x43c9a0[_0xaed2('0x5')](_0xaed2('0x6'),'')[_0xaed2('0x5')]('[$or]','')[_0xaed2('0x7')]('||');for(var _0x5669b4=0x0;_0x5669b4<_0x3154ed[_0xaed2('0x8')];_0x5669b4++){var _0x216b06=_0x3154ed[_0x5669b4][_0xaed2('0x7')](':=');var _0x52d466=_0x216b06[0x0];var _0x4e0315=_0x216b06[_0xaed2('0x9')](0x1);_0x4e0315[_0xaed2('0xa')](function(_0x115500){var _0x54dbb7=_0x115500[_0xaed2('0x7')]('[')[_0xaed2('0xb')]();var _0x1ae908=_0x115500[_0xaed2('0xc')](/\[(.*?)\]/g);_0x1ae908[_0xaed2('0xa')](function(_0x28fc76){var _0x48bda9=_0x28fc76['split']('[')[_0xaed2('0xd')](function(_0x14d095){return _0x14d095[_0xaed2('0xe')](']')>-0x1;})[_0xaed2('0xf')](function(_0x52660f){return _0x52660f[_0xaed2('0x7')](']')[0x0];})[0x0];_0x5af94b[_0xaed2('0x10')][_0xaed2('0x11')]({'field':_0x52d466,'operator':_0x54dbb7,'value':_0x48bda9});});});}return _0x5af94b;};exports[_0xaed2('0x12')]=function(_0x2e32f8,_0x5121d5,_0x37eed8){var _0x34f552={};if(_0x5121d5===_0xaed2('0x13')){if(_0x37eed8['operator']===_0xaed2('0x14')){_0x37eed8[_0xaed2('0x15')]=_0xaed2('0x16');_0x37eed8[_0xaed2('0x17')]+=','+_0x37eed8[_0xaed2('0x17')];}else if(_[_0xaed2('0x18')]([_0xaed2('0x19'),_0xaed2('0x1a')],_0x37eed8['operator'])){_0x37eed8['value']=moment(_0x37eed8[_0xaed2('0x17')])[_0xaed2('0x1b')](0x1,'days')[_0xaed2('0x1c')](_0xaed2('0x1d'));}}if(_0x37eed8['castTo']){_0x5121d5=_0x37eed8[_0xaed2('0x1e')];_0x34f552[_0xaed2('0x1f')]=_0xaed2('0x20')+_0x2e32f8+'.'+_0x37eed8[_0xaed2('0x21')]+'\x20AS\x20'+_0x37eed8['castTo']+')\x20'+parseOperator(_0x37eed8[_0xaed2('0x15')]);}else{_0x34f552['text']=_0x2e32f8+'.'+_0x37eed8[_0xaed2('0x21')]+'\x20'+parseOperator(_0x37eed8[_0xaed2('0x15')]);}if(_[_0xaed2('0x18')]([_0xaed2('0x22'),_0xaed2('0x23')],_0x37eed8['operator']))_0x34f552[_0xaed2('0x1f')]='('+_0x34f552['text']+_0xaed2('0x24')+_0x2e32f8+'.'+_0x37eed8[_0xaed2('0x21')]+_0xaed2('0x25');_0x34f552[_0xaed2('0x17')]=parseValue(_0x5121d5,_0x37eed8[_0xaed2('0x15')],_0x37eed8[_0xaed2('0x17')]);return _0x34f552;};function parseOperator(_0x24377b){var _0x2a7f34;switch(_0x24377b){case'$in':_0x2a7f34=_0xaed2('0x26');break;case _0xaed2('0x23'):_0x2a7f34=_0xaed2('0x27');break;case _0xaed2('0x14'):_0x2a7f34=_0xaed2('0x28');break;case _0xaed2('0x22'):_0x2a7f34=_0xaed2('0x29');break;case'$substring':case _0xaed2('0x2a'):case _0xaed2('0x2b'):_0x2a7f34=_0xaed2('0x2c');break;case _0xaed2('0x2d'):_0x2a7f34=_0xaed2('0x2e');break;case _0xaed2('0x19'):_0x2a7f34=_0xaed2('0x2f');break;case _0xaed2('0x1a'):_0x2a7f34=_0xaed2('0x30');break;case _0xaed2('0x31'):_0x2a7f34=_0xaed2('0x32');break;case'$between':_0x2a7f34=_0xaed2('0x33');break;}return _0x2a7f34;}function parseValue(_0x155342,_0x41e146,_0x3c7b15){var _0x3bdf68={'start':undefined,'end':undefined};switch(_0x41e146){case _0xaed2('0x34'):case _0xaed2('0x23'):_0x3bdf68[_0xaed2('0x35')]=_0x3c7b15[_0xaed2('0x7')](',');break;case _0xaed2('0x36'):_0x3bdf68[_0xaed2('0x35')]='%'+_0x3c7b15+'%';break;case'$startsWith':_0x3bdf68[_0xaed2('0x35')]=_0x3c7b15+'%';break;case'$endsWith':_0x3bdf68['start']='%'+_0x3c7b15;break;case _0xaed2('0x16'):var _0x4116ca=_0x3c7b15[_0xaed2('0x7')](',');var _0x3c7b15=_0x4116ca[_0xaed2('0xb')]();var _0x27d3f3=_0x4116ca[_0xaed2('0x37')]();if(_0x155342===_0xaed2('0x13')){_0x3c7b15=moment(_0x3c7b15)['utcOffset'](0x0,!![])['format']();_0x27d3f3=moment(_0x27d3f3)['utcOffset'](0x0,!![])['add'](0x17,_0xaed2('0x38'))[_0xaed2('0x1b')](0x3b,_0xaed2('0x39'))[_0xaed2('0x1b')](0x3b,_0xaed2('0x3a'))[_0xaed2('0x1c')]();}_0x3bdf68={'start':_0x3c7b15,'end':_0x27d3f3};break;default:_0x3bdf68[_0xaed2('0x35')]=_0x3c7b15;break;}return _0x3bdf68;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index dd0d993..a592f5a 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 _0x2e7f=['toString','join','lodash','sequelize','fields','split','filters','isArray','parse','limit','offset','sort','map','indexOf','cast','priority','substr','DESC','col','unsigned','isEmpty','length','isObject','isString','unset','isNumeric','match','^[0-9]*$','getFullTextValue','forEach','push'];(function(_0x21084f,_0x59cf12){var _0xa677de=function(_0x1888ae){while(--_0x1888ae){_0x21084f['push'](_0x21084f['shift']());}};_0xa677de(++_0x59cf12);}(_0x2e7f,0x195));var _0xf2e7=function(_0x628346,_0x4a392d){_0x628346=_0x628346-0x0;var _0x47c8c8=_0x2e7f[_0x628346];return _0x47c8c8;};'use strict';var _=require(_0xf2e7('0x0'));var sequelize=require(_0xf2e7('0x1'));var LIMIT_VALUE=0xfa;exports[_0xf2e7('0x2')]=function(_0x1f254e){var _0x3f9d26=null;if(_0x1f254e){_0x3f9d26=_0x1f254e[_0xf2e7('0x3')](',');}return _0x3f9d26;};exports[_0xf2e7('0x4')]=function(_0x269015){var _0x369adf={};if(!_['isEmpty'](_0x269015)){_0x369adf={};_['forOwn'](_0x269015,function(_0x5cfec1,_0x4e0d51){try{_0x369adf[_0x4e0d51]=_[_0xf2e7('0x5')](_0x5cfec1)?_0x5cfec1:JSON[_0xf2e7('0x6')](_0x5cfec1);}catch(_0x3ed899){_0x369adf[_0x4e0d51]=_0x5cfec1[_0xf2e7('0x3')](',');}});}return _0x369adf;};exports[_0xf2e7('0x7')]=function(_0x3a0bd3){_0x3a0bd3=parseInt(_0x3a0bd3,0xa);if(!_0x3a0bd3||_0x3a0bd3<0x0){_0x3a0bd3=LIMIT_VALUE;}return _0x3a0bd3;};exports[_0xf2e7('0x8')]=function(_0x5ec92b){_0x5ec92b=parseInt(_0x5ec92b,0xa);if(!_0x5ec92b||_0x5ec92b<0x0){_0x5ec92b=0x0;}return _0x5ec92b;};exports[_0xf2e7('0x9')]=function(_0x151c76){var _0x1b0ea3,_0x30d07a=null;if(_0x151c76){_0x1b0ea3=_0x151c76[_0xf2e7('0x3')](',');_0x30d07a=_[_0xf2e7('0xa')](_0x1b0ea3,function(_0x2ede42){if(_0x2ede42[_0xf2e7('0xb')]('-')===0x0){return[_0x2ede42==='priority'?sequelize[_0xf2e7('0xc')](sequelize['col'](_0xf2e7('0xd')),'unsigned'):_0x2ede42[_0xf2e7('0xe')](0x1),_0xf2e7('0xf')];}else{return[_0x2ede42===_0xf2e7('0xd')?sequelize[_0xf2e7('0xc')](sequelize[_0xf2e7('0x10')](_0xf2e7('0xd')),_0xf2e7('0x11')):_0x2ede42,'ASC'];}});}return _0x30d07a;};exports['omit']=function(_0x16df88,_0x5e375b){if(_[_0xf2e7('0x12')](_0x16df88)){return _0x16df88;}if(_[_0xf2e7('0x5')](_0x16df88)){for(var _0x397e10=0x0;_0x397e10<_0x16df88[_0xf2e7('0x13')];_0x397e10+=0x1){_0x16df88[_0x397e10]=this['omit'](_0x16df88[_0x397e10],_0x5e375b);}return _0x16df88;}if(!_[_0xf2e7('0x14')](_0x16df88)){return _0x16df88;}if(_[_0xf2e7('0x15')](_0x5e375b)){_0x5e375b=[_0x5e375b];}if(!_[_0xf2e7('0x5')](_0x5e375b)){return _0x16df88;}for(var _0x4df1af=0x0;_0x4df1af<_0x5e375b[_0xf2e7('0x13')];_0x4df1af+=0x1){_[_0xf2e7('0x16')](_0x16df88,_0x5e375b[_0x4df1af]);}for(var _0x4fb105 in _0x16df88){if(_0x16df88['hasOwnProperty'](_0x4fb105)){_0x16df88[_0x4fb105]=this['omit'](_0x16df88[_0x4fb105],_0x5e375b);}}return _0x16df88;};exports[_0xf2e7('0x17')]=function(_0x80f1c3){return _0x80f1c3[_0xf2e7('0x18')](RegExp(_0xf2e7('0x19')))?!![]:![];};exports['isEmail']=function(_0x53dd86){return _0x53dd86[_0xf2e7('0x18')](/^\S+@\S+$/)?!![]:![];};exports[_0xf2e7('0x1a')]=function(_0x1d8117){var _0x174458=[];_0x1d8117[_0xf2e7('0x3')]('\x20')[_0xf2e7('0x1b')](function(_0x18806c){_0x174458[_0xf2e7('0x1c')]('+'+_0x18806c[_0xf2e7('0x1d')]()+'*');});return _0x174458[_0xf2e7('0x1e')]('\x20');}; \ No newline at end of file +var _0xdb92=['col','unsigned','ASC','omit','length','isObject','unset','isNumeric','match','^[0-9]*$','isEmail','getFullTextValue','toString','lodash','fields','split','filters','isEmpty','forOwn','isArray','parse','limit','offset','sort','map','indexOf','priority','cast'];(function(_0xba9891,_0x5c2cb4){var _0x6eaba5=function(_0x14cbdc){while(--_0x14cbdc){_0xba9891['push'](_0xba9891['shift']());}};_0x6eaba5(++_0x5c2cb4);}(_0xdb92,0x99));var _0x2db9=function(_0x23c0cf,_0x466df3){_0x23c0cf=_0x23c0cf-0x0;var _0x4e91e9=_0xdb92[_0x23c0cf];return _0x4e91e9;};'use strict';var _=require(_0x2db9('0x0'));var sequelize=require('sequelize');var LIMIT_VALUE=0xfa;exports[_0x2db9('0x1')]=function(_0x5346e2){var _0x1eba81=null;if(_0x5346e2){_0x1eba81=_0x5346e2[_0x2db9('0x2')](',');}return _0x1eba81;};exports[_0x2db9('0x3')]=function(_0xe47096){var _0x171e4a={};if(!_[_0x2db9('0x4')](_0xe47096)){_0x171e4a={};_[_0x2db9('0x5')](_0xe47096,function(_0xd062d6,_0x3a420f){try{_0x171e4a[_0x3a420f]=_[_0x2db9('0x6')](_0xd062d6)?_0xd062d6:JSON[_0x2db9('0x7')](_0xd062d6);}catch(_0x54f531){_0x171e4a[_0x3a420f]=_0xd062d6[_0x2db9('0x2')](',');}});}return _0x171e4a;};exports[_0x2db9('0x8')]=function(_0x1b7291){_0x1b7291=parseInt(_0x1b7291,0xa);if(!_0x1b7291||_0x1b7291<0x0){_0x1b7291=LIMIT_VALUE;}return _0x1b7291;};exports[_0x2db9('0x9')]=function(_0x33666f){_0x33666f=parseInt(_0x33666f,0xa);if(!_0x33666f||_0x33666f<0x0){_0x33666f=0x0;}return _0x33666f;};exports[_0x2db9('0xa')]=function(_0x186dc8){var _0x1c8f69,_0x456064=null;if(_0x186dc8){_0x1c8f69=_0x186dc8[_0x2db9('0x2')](',');_0x456064=_[_0x2db9('0xb')](_0x1c8f69,function(_0x199b16){if(_0x199b16[_0x2db9('0xc')]('-')===0x0){return[_0x199b16===_0x2db9('0xd')?sequelize[_0x2db9('0xe')](sequelize[_0x2db9('0xf')]('priority'),_0x2db9('0x10')):_0x199b16['substr'](0x1),'DESC'];}else{return[_0x199b16===_0x2db9('0xd')?sequelize[_0x2db9('0xe')](sequelize[_0x2db9('0xf')](_0x2db9('0xd')),'unsigned'):_0x199b16,_0x2db9('0x11')];}});}return _0x456064;};exports[_0x2db9('0x12')]=function(_0x1d763d,_0x26f28c){if(_[_0x2db9('0x4')](_0x1d763d)){return _0x1d763d;}if(_[_0x2db9('0x6')](_0x1d763d)){for(var _0x7c7670=0x0;_0x7c7670<_0x1d763d[_0x2db9('0x13')];_0x7c7670+=0x1){_0x1d763d[_0x7c7670]=this[_0x2db9('0x12')](_0x1d763d[_0x7c7670],_0x26f28c);}return _0x1d763d;}if(!_[_0x2db9('0x14')](_0x1d763d)){return _0x1d763d;}if(_['isString'](_0x26f28c)){_0x26f28c=[_0x26f28c];}if(!_[_0x2db9('0x6')](_0x26f28c)){return _0x1d763d;}for(var _0x2f1cd6=0x0;_0x2f1cd6<_0x26f28c[_0x2db9('0x13')];_0x2f1cd6+=0x1){_[_0x2db9('0x15')](_0x1d763d,_0x26f28c[_0x2f1cd6]);}for(var _0x1e1146 in _0x1d763d){if(_0x1d763d['hasOwnProperty'](_0x1e1146)){_0x1d763d[_0x1e1146]=this[_0x2db9('0x12')](_0x1d763d[_0x1e1146],_0x26f28c);}}return _0x1d763d;};exports[_0x2db9('0x16')]=function(_0x5babe8){return _0x5babe8[_0x2db9('0x17')](RegExp(_0x2db9('0x18')))?!![]:![];};exports[_0x2db9('0x19')]=function(_0x114cb5){return _0x114cb5[_0x2db9('0x17')](/^\S+@\S+$/)?!![]:![];};exports[_0x2db9('0x1a')]=function(_0x2c0a9c){var _0x1add35=[];_0x2c0a9c[_0x2db9('0x2')]('\x20')['forEach'](function(_0x5b20f3){_0x1add35['push']('+'+_0x5b20f3[_0x2db9('0x1b')]()+'*');});return _0x1add35['join']('\x20');}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 50c8d44..7201ec2 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x41ab=['path','cors','./environment','../mysqldb','get','env','production','set','appPath','join','development','test','root','client','use','json\x20replacer','toISOString','split','views','engine','ejs','renderFile','view\x20engine','urlencoded','50mb','express','serve-favicon','body-parser','method-override','cookie-parser','errorhandler'];(function(_0x529abc,_0x17b97e){var _0x453afa=function(_0x536263){while(--_0x536263){_0x529abc['push'](_0x529abc['shift']());}};_0x453afa(++_0x17b97e);}(_0x41ab,0xf2));var _0xb41a=function(_0x259a74,_0xb4ad8a){_0x259a74=_0x259a74-0x0;var _0x226336=_0x41ab[_0x259a74];return _0x226336;};'use strict';var express=require(_0xb41a('0x0'));var favicon=require(_0xb41a('0x1'));var bodyParser=require(_0xb41a('0x2'));var methodOverride=require(_0xb41a('0x3'));var cookieParser=require(_0xb41a('0x4'));var errorHandler=require(_0xb41a('0x5'));var path=require(_0xb41a('0x6'));var passport=require('passport');var cors=require(_0xb41a('0x7'));var moment=require('moment');var config=require(_0xb41a('0x8'));var db=require(_0xb41a('0x9'))['db'];exports['default']=function(_0x1061b8){var _0x3ac730=_0x1061b8[_0xb41a('0xa')](_0xb41a('0xb'));if(_0x3ac730===_0xb41a('0xc')){_0x1061b8[_0xb41a('0xd')](_0xb41a('0xe'),path[_0xb41a('0xf')](config['root'],'public'));}if(_0x3ac730===_0xb41a('0x10')||_0x3ac730===_0xb41a('0x11')){_0x1061b8['set'](_0xb41a('0xe'),path[_0xb41a('0xf')](config[_0xb41a('0x12')],_0xb41a('0x13')));_0x1061b8[_0xb41a('0x14')](errorHandler());}_0x1061b8[_0xb41a('0xd')](_0xb41a('0x15'),function(_0x59dc04,_0x236cca){if(this[_0x59dc04]instanceof Date){_0x236cca=this[_0x59dc04][_0xb41a('0x16')]()[_0xb41a('0x17')]('.')[0x0]+'Z';}return _0x236cca;});_0x1061b8['use'](express['static'](_0x1061b8['get'](_0xb41a('0xe'))));_0x1061b8[_0xb41a('0xd')](_0xb41a('0x18'),config[_0xb41a('0x12')]+'/server/views');_0x1061b8[_0xb41a('0x19')]('html',require(_0xb41a('0x1a'))[_0xb41a('0x1b')]);_0x1061b8[_0xb41a('0xd')](_0xb41a('0x1c'),'html');_0x1061b8[_0xb41a('0x14')](bodyParser[_0xb41a('0x1d')]({'limit':_0xb41a('0x1e'),'extended':!![]}));_0x1061b8[_0xb41a('0x14')](bodyParser['json']({'limit':_0xb41a('0x1e')}));_0x1061b8[_0xb41a('0x14')](cors());_0x1061b8[_0xb41a('0x14')](methodOverride());_0x1061b8[_0xb41a('0x14')](cookieParser());_0x1061b8['use'](passport['initialize']());}; \ No newline at end of file +var _0x2003=['cors','moment','./environment','../mysqldb','get','env','production','set','appPath','join','root','public','development','test','use','json\x20replacer','split','views','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','50mb','json','express','serve-favicon','body-parser','cookie-parser','errorhandler','path','passport'];(function(_0x4181e9,_0x1c11d2){var _0x29cc26=function(_0x4a375e){while(--_0x4a375e){_0x4181e9['push'](_0x4181e9['shift']());}};_0x29cc26(++_0x1c11d2);}(_0x2003,0x12b));var _0x3200=function(_0x507ac5,_0x33aaee){_0x507ac5=_0x507ac5-0x0;var _0x12c1bc=_0x2003[_0x507ac5];return _0x12c1bc;};'use strict';var express=require(_0x3200('0x0'));var favicon=require(_0x3200('0x1'));var bodyParser=require(_0x3200('0x2'));var methodOverride=require('method-override');var cookieParser=require(_0x3200('0x3'));var errorHandler=require(_0x3200('0x4'));var path=require(_0x3200('0x5'));var passport=require(_0x3200('0x6'));var cors=require(_0x3200('0x7'));var moment=require(_0x3200('0x8'));var config=require(_0x3200('0x9'));var db=require(_0x3200('0xa'))['db'];exports['default']=function(_0x1c7f2b){var _0x545779=_0x1c7f2b[_0x3200('0xb')](_0x3200('0xc'));if(_0x545779===_0x3200('0xd')){_0x1c7f2b[_0x3200('0xe')](_0x3200('0xf'),path[_0x3200('0x10')](config[_0x3200('0x11')],_0x3200('0x12')));}if(_0x545779===_0x3200('0x13')||_0x545779===_0x3200('0x14')){_0x1c7f2b[_0x3200('0xe')](_0x3200('0xf'),path['join'](config[_0x3200('0x11')],'client'));_0x1c7f2b[_0x3200('0x15')](errorHandler());}_0x1c7f2b['set'](_0x3200('0x16'),function(_0x36c642,_0xdd4807){if(this[_0x36c642]instanceof Date){_0xdd4807=this[_0x36c642]['toISOString']()[_0x3200('0x17')]('.')[0x0]+'Z';}return _0xdd4807;});_0x1c7f2b[_0x3200('0x15')](express['static'](_0x1c7f2b[_0x3200('0xb')](_0x3200('0xf'))));_0x1c7f2b[_0x3200('0xe')](_0x3200('0x18'),config[_0x3200('0x11')]+_0x3200('0x19'));_0x1c7f2b[_0x3200('0x1a')](_0x3200('0x1b'),require(_0x3200('0x1c'))[_0x3200('0x1d')]);_0x1c7f2b[_0x3200('0xe')](_0x3200('0x1e'),_0x3200('0x1b'));_0x1c7f2b[_0x3200('0x15')](bodyParser[_0x3200('0x1f')]({'limit':_0x3200('0x20'),'extended':!![]}));_0x1c7f2b[_0x3200('0x15')](bodyParser[_0x3200('0x21')]({'limit':_0x3200('0x20')}));_0x1c7f2b['use'](cors());_0x1c7f2b[_0x3200('0x15')](methodOverride());_0x1c7f2b[_0x3200('0x15')](cookieParser());_0x1c7f2b[_0x3200('0x15')](passport['initialize']());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 66eb7b9..c36d05c 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 _0x08d9=['win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress','substring','lodash','bimedia-machine-uuid','execSync','orderBy','keys','length','family','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','model','join','createHash','md5','update','digest','hex'];(function(_0x3a58ad,_0x374fec){var _0xad57a3=function(_0x4c370f){while(--_0x4c370f){_0x3a58ad['push'](_0x3a58ad['shift']());}};_0xad57a3(++_0x374fec);}(_0x08d9,0xc2));var _0x908d=function(_0x4de0e7,_0x1c1eef){_0x4de0e7=_0x4de0e7-0x0;var _0x1385af=_0x08d9[_0x4de0e7];return _0x1385af;};'use strict';var _=require(_0x908d('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0x908d('0x1'));var exec=require('child_process')[_0x908d('0x2')];function getInterfaces(){var _0x739218=[];var _0x38a571=os['networkInterfaces']();var _0x53cef4=_[_0x908d('0x3')](_[_0x908d('0x4')](_0x38a571));for(var _0x1fa63e=0x0;_0x1fa63e<_0x53cef4[_0x908d('0x5')];_0x1fa63e++){var _0xb63409=_0x38a571[_0x53cef4[_0x1fa63e]]['filter'](function(_0x52cd93){return _0x52cd93[_0x908d('0x6')]===_0x908d('0x7')&&_0x52cd93[_0x908d('0x8')]===![];});_0x739218=_0x739218[_0x908d('0x9')](_0xb63409);}return _0x739218;}function getFirstInterface(){var _0x44b888=_[_0x908d('0xa')](getInterfaces());return{'macAddress':_0x44b888&&_0x44b888[_0x908d('0xb')]?_0x44b888[_0x908d('0xb')]:_0x908d('0xc'),'ipAddress':_0x44b888&&_0x44b888['address']?_0x44b888[_0x908d('0xd')]:_0x908d('0xe')};}exports[_0x908d('0xf')]=getFirstInterface;function getCPUhash(){var _0x114027=_[_0x908d('0x3')](os['cpus']()['map'](function(_0x588cc3){return _0x588cc3[_0x908d('0x10')];}))[_0x908d('0x11')](':');return crypto[_0x908d('0x12')](_0x908d('0x13'))[_0x908d('0x14')](_0x114027)[_0x908d('0x15')](_0x908d('0x16'));}exports['getUuid']=function(){switch(os['platform']()){case _0x908d('0x17'):return exec(_0x908d('0x18'),{'encoding':_0x908d('0x19')})[_0x908d('0x1a')]('\x0d\x0a','');default:var _0x5d7f40=getFirstInterface();var _0x4c56f2=getCPUhash();var _0x16895a=_0x4c56f2+'|'+os[_0x908d('0x1b')]()+'|'+_0x5d7f40[_0x908d('0x1c')]+'|'+_0x5d7f40[_0x908d('0x1d')];var _0x4cc9ba=crypto[_0x908d('0x12')](_0x908d('0x13'))[_0x908d('0x14')](_0x16895a)[_0x908d('0x15')](_0x908d('0x16'));return _0x4cc9ba[_0x908d('0x1e')](0x0,0x8)+'-'+_0x4cc9ba[_0x908d('0x1e')](0x8,0xc)+'-'+_0x4cc9ba['substring'](0xc,0x10)+'-'+_0x4cc9ba[_0x908d('0x1e')](0x10,0x14)+'-'+_0x4cc9ba[_0x908d('0x1e')](0x14);}}; \ No newline at end of file +var _0x5b20=['bimedia-machine-uuid','child_process','execSync','networkInterfaces','orderBy','keys','length','family','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','map','model','join','md5','update','digest','platform','win32','replace','hostname','macAddress','ipAddress','createHash','hex','substring','lodash','crypto'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0x5b20,0x86));var _0x05b2=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x5b20[_0x27af45];return _0x18df21;};'use strict';var _=require(_0x05b2('0x0'));var os=require('os');var crypto=require(_0x05b2('0x1'));var machine=require(_0x05b2('0x2'));var exec=require(_0x05b2('0x3'))[_0x05b2('0x4')];function getInterfaces(){var _0x54e72e=[];var _0x3f63b3=os[_0x05b2('0x5')]();var _0x19cb65=_[_0x05b2('0x6')](_[_0x05b2('0x7')](_0x3f63b3));for(var _0x4a446b=0x0;_0x4a446b<_0x19cb65[_0x05b2('0x8')];_0x4a446b++){var _0x83fd18=_0x3f63b3[_0x19cb65[_0x4a446b]]['filter'](function(_0x24f11f){return _0x24f11f[_0x05b2('0x9')]===_0x05b2('0xa')&&_0x24f11f[_0x05b2('0xb')]===![];});_0x54e72e=_0x54e72e[_0x05b2('0xc')](_0x83fd18);}return _0x54e72e;}function getFirstInterface(){var _0x328008=_[_0x05b2('0xd')](getInterfaces());return{'macAddress':_0x328008&&_0x328008[_0x05b2('0xe')]?_0x328008[_0x05b2('0xe')]:_0x05b2('0xf'),'ipAddress':_0x328008&&_0x328008[_0x05b2('0x10')]?_0x328008[_0x05b2('0x10')]:_0x05b2('0x11')};}exports[_0x05b2('0x12')]=getFirstInterface;function getCPUhash(){var _0x155644=_[_0x05b2('0x6')](os['cpus']()[_0x05b2('0x13')](function(_0x12ca67){return _0x12ca67[_0x05b2('0x14')];}))[_0x05b2('0x15')](':');return crypto['createHash'](_0x05b2('0x16'))[_0x05b2('0x17')](_0x155644)[_0x05b2('0x18')]('hex');}exports['getUuid']=function(){switch(os[_0x05b2('0x19')]()){case _0x05b2('0x1a'):return exec('dmidecode\x20--string\x20system-uuid',{'encoding':'utf8'})[_0x05b2('0x1b')]('\x0d\x0a','');default:var _0x3fe466=getFirstInterface();var _0x3a544c=getCPUhash();var _0x189114=_0x3a544c+'|'+os[_0x05b2('0x1c')]()+'|'+_0x3fe466[_0x05b2('0x1d')]+'|'+_0x3fe466[_0x05b2('0x1e')];var _0x25f36e=crypto[_0x05b2('0x1f')](_0x05b2('0x16'))[_0x05b2('0x17')](_0x189114)[_0x05b2('0x18')](_0x05b2('0x20'));return _0x25f36e[_0x05b2('0x21')](0x0,0x8)+'-'+_0x25f36e[_0x05b2('0x21')](0x8,0xc)+'-'+_0x25f36e[_0x05b2('0x21')](0xc,0x10)+'-'+_0x25f36e['substring'](0x10,0x14)+'-'+_0x25f36e[_0x05b2('0x21')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 32a35b4..4cf5bab 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 _0xc7da=['moment','bluebird','pkginfo','../../mysqldb','../environment','../logger','license','../../api/jira/jira.controller','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','version','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','catch','createCipher','aes-256-ctr','secrets','session','utf8','final','base64','update','User','findOne','admin','email','|reason|','|uuid|','|machineUuid|','|name|','fullname','then','getFirstInterface','ipAddress','openIssue','MOTLICENSE','Motion\x20License\x20Alert','Alert','get','active','data2','info','data1','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','uuid','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','days','message','getUuid','License','SERVICE\x20LICENSE\x20STARTED\x20%s','util','crypto'];(function(_0x3aaf0a,_0x450970){var _0x33e6bc=function(_0x1db54d){while(--_0x1db54d){_0x3aaf0a['push'](_0x3aaf0a['shift']());}};_0x33e6bc(++_0x450970);}(_0xc7da,0xf2));var _0xac7d=function(_0x154a84,_0x29a628){_0x154a84=_0x154a84-0x0;var _0x141065=_0xc7da[_0x154a84];return _0x141065;};'use strict';var util=require(_0xac7d('0x0'));var crypto=require(_0xac7d('0x1'));var moment=require(_0xac7d('0x2'));var rp=require('request-promise');var BPromise=require(_0xac7d('0x3'));var pkginfo=require(_0xac7d('0x4'))(module,'version');var db=require(_0xac7d('0x5'))['db'];var config=require(_0xac7d('0x6'));var hardware=require('./hardware');var logger=require(_0xac7d('0x7'))(_0xac7d('0x8'));var jira=require(_0xac7d('0x9'));var HOST=_0xac7d('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x268265){return new BPromise(function(_0x153ce5,_0x48ca59){var _0x44eb2b=util[_0xac7d('0xb')](_0xac7d('0xc'),HOST,_0x268265,module[_0xac7d('0xd')][_0xac7d('0xe')]);if(oldToken){_0x44eb2b=util[_0xac7d('0xb')](_0xac7d('0xf'),HOST,_0x268265,module['exports'][_0xac7d('0xe')],oldToken);}var _0x2fd75b={'uri':_0x44eb2b,'method':_0xac7d('0x10'),'timeout':0xea60,'json':!![]};return rp(_0x2fd75b)['then'](function(_0x238069){_0x153ce5(_0x238069);})[_0xac7d('0x11')](function(_0x1c5b3c){_0x48ca59(_0x1c5b3c);});});}function encryptDate(_0x20f674){var _0x5a44f6=crypto[_0xac7d('0x12')](_0xac7d('0x13'),config[_0xac7d('0x14')][_0xac7d('0x15')]);var _0x17ff89=_0x5a44f6['update'](_0x20f674,_0xac7d('0x16'),'base64');_0x17ff89+=_0x5a44f6[_0xac7d('0x17')](_0xac7d('0x18'));return _0x17ff89;}function decryptDate(_0x34980f){var _0x355209=crypto['createDecipher'](_0xac7d('0x13'),config[_0xac7d('0x14')][_0xac7d('0x15')]);var _0x12813a=_0x355209[_0xac7d('0x19')](_0x34980f,'base64',_0xac7d('0x16'));_0x12813a+=_0x355209[_0xac7d('0x17')]('utf8');return _0x12813a;}function sendJiraAlert(_0x2e4790,_0x2d2494,_0x170704){var _0x3cb94e='||FIELD||VALUE||\x0a';return db[_0xac7d('0x1a')][_0xac7d('0x1b')]({'where':{'role':_0xac7d('0x1c')},'attributes':['fullname',_0xac7d('0x1d')],'raw':!![]})['then'](function(_0x3189fe){ADMIN=_0x3189fe;_0x3cb94e+=_0xac7d('0x1e')+_0x170704+'|\x0a';_0x3cb94e+=_0xac7d('0x1f')+_0x2e4790+'|\x0a';_0x3cb94e+=_0xac7d('0x20')+_0x2d2494+'|\x0a';_0x3cb94e+=_0xac7d('0x21')+ADMIN[_0xac7d('0x22')]+'|\x0a';_0x3cb94e+='|email|'+ADMIN['email']+'|\x0a';return _0x3cb94e;})[_0xac7d('0x23')](function(_0x6d2c50){var _0x5098bb=hardware[_0xac7d('0x24')]()[_0xac7d('0x25')];return jira[_0xac7d('0x26')]({'key':_0xac7d('0x27'),'summary':_0xac7d('0x28'),'description':_0x6d2c50,'issuetype':_0xac7d('0x29'),'oldToken':_0x2e4790,'newToken':_0x2d2494,'email':ADMIN[_0xac7d('0x1d')],'name':ADMIN[_0xac7d('0x22')],'reason':GRAY_PERIOD_REASON,'ip':_0x5098bb});});}function manageLicense(_0x42e313,_0x26a8c4){var _0x594d6e=_0x26a8c4[_0xac7d('0x2a')]({'plain':!![]});httpRequest(_0x42e313)[_0xac7d('0x23')](function(_0x31e220){if(oldToken){oldToken=undefined;}if(_0x31e220[_0xac7d('0x2b')]){if(!_0x594d6e['license']&&_0x594d6e['license']!=_0x31e220['license']||_0x594d6e[_0xac7d('0x8')]&&_0x594d6e[_0xac7d('0x2c')]){logger[_0xac7d('0x2d')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x594d6e[_0xac7d('0x8')]&&!_0x594d6e['data2']&&_0x594d6e['license']!=_0x31e220['license']){logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x594d6e[_0xac7d('0x8')]&&!_0x594d6e[_0xac7d('0x2c')]&&_0x594d6e[_0xac7d('0x8')]==_0x31e220[_0xac7d('0x8')]){return _0x26a8c4;}return _0x26a8c4[_0xac7d('0x19')]({'data1':_0x42e313,'data2':null,'license':_0x31e220['license']});}else{if(_0x31e220['license']||_0x594d6e[_0xac7d('0x8')]){if(!_0x594d6e[_0xac7d('0x2c')]){if(_0x594d6e[_0xac7d('0x2e')]==_0x42e313){GRAY_PERIOD_REASON=_0xac7d('0x2f');logger[_0xac7d('0x2d')](_0xac7d('0x30'));}else{GRAY_PERIOD_REASON=_0xac7d('0x31');oldToken=_0x594d6e[_0xac7d('0x2e')];logger[_0xac7d('0x2d')](_0xac7d('0x32'),_0x594d6e[_0xac7d('0x2e')],_0x42e313);}sendJiraAlert(_0x594d6e[_0xac7d('0x2e')],_0x31e220[_0xac7d('0x33')],GRAY_PERIOD_REASON);logger[_0xac7d('0x2d')](_0xac7d('0x34'),GRAY_PERIOD_REASON[_0xac7d('0x35')](),moment()['format'](_0xac7d('0x36')));return _0x26a8c4[_0xac7d('0x19')]({'data2':encryptDate(moment()[_0xac7d('0xb')](_0xac7d('0x36')))});}else{if(moment()[_0xac7d('0x37')](decryptDate(_0x594d6e['data2']),_0xac7d('0x38'))>DAYS){logger['info']('DEMO\x20START\x20AT\x20%s',moment()[_0xac7d('0xb')](_0xac7d('0x36')));return _0x26a8c4[_0xac7d('0x19')]({'data1':_0x42e313,'data2':null,'license':null});}}}else{if(_0x594d6e[_0xac7d('0x2e')]!=_0x42e313){logger[_0xac7d('0x2d')](_0xac7d('0x32'),_0x594d6e[_0xac7d('0x2e')],_0x42e313);return _0x26a8c4[_0xac7d('0x19')]({'data1':_0x42e313,'data2':null,'license':null});}}}return _0x26a8c4;})[_0xac7d('0x23')](function(_0x3a0bc2){_0x26a8c4=_0x3a0bc2;})[_0xac7d('0x11')](function(_0x54dc7d){logger['error'](_0x54dc7d[_0xac7d('0x39')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0xac7d('0x3a')](),_0x26a8c4);},TIME);});}function defaultLicense(){var _0x793575=hardware[_0xac7d('0x3a')]();if(_0x793575){return db[_0xac7d('0x3b')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x793575}})['spread'](function(_0xa7e739,_0x38bcfa){logger[_0xac7d('0x2d')](_0xac7d('0x3c'),_0x793575);manageLicense(_0x793575,_0xa7e739);})[_0xac7d('0x11')](function(_0x533bd2){logger['error'](_0x533bd2[_0xac7d('0x39')]);});}}exports['default']=defaultLicense; \ No newline at end of file +var _0x8383=['||FIELD||VALUE||\x0a','findOne','admin','fullname','email','|uuid|','|name|','|email|','getFirstInterface','openIssue','Motion\x20License\x20Alert','Alert','get','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','Disabled','data1','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','uuid','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','format','YYYY-MM-DD\x20HH:mm','diff','days','DEMO\x20START\x20AT\x20%s','error','message','finally','getUuid','License','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','request-promise','bluebird','pkginfo','version','../../mysqldb','../environment','./hardware','../logger','license','../../api/jira/jira.controller','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','createCipher','secrets','update','utf8','base64','final','createDecipher','aes-256-ctr'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x8383,0x98));var _0x3838=function(_0x643c9,_0x47b5d8){_0x643c9=_0x643c9-0x0;var _0x5d6f21=_0x8383[_0x643c9];return _0x5d6f21;};'use strict';var util=require(_0x3838('0x0'));var crypto=require('crypto');var moment=require('moment');var rp=require(_0x3838('0x1'));var BPromise=require(_0x3838('0x2'));var pkginfo=require(_0x3838('0x3'))(module,_0x3838('0x4'));var db=require(_0x3838('0x5'))['db'];var config=require(_0x3838('0x6'));var hardware=require(_0x3838('0x7'));var logger=require(_0x3838('0x8'))(_0x3838('0x9'));var jira=require(_0x3838('0xa'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x239750){return new BPromise(function(_0x235001,_0x4cf52b){var _0x2abbda=util['format'](_0x3838('0xb'),HOST,_0x239750,module[_0x3838('0xc')][_0x3838('0x4')]);if(oldToken){_0x2abbda=util['format'](_0x3838('0xd'),HOST,_0x239750,module[_0x3838('0xc')][_0x3838('0x4')],oldToken);}var _0x545100={'uri':_0x2abbda,'method':_0x3838('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x545100)[_0x3838('0xf')](function(_0x9161a2){_0x235001(_0x9161a2);})[_0x3838('0x10')](function(_0x5f33d5){_0x4cf52b(_0x5f33d5);});});}function encryptDate(_0x3572d6){var _0x276d98=crypto[_0x3838('0x11')]('aes-256-ctr',config[_0x3838('0x12')]['session']);var _0x38e779=_0x276d98[_0x3838('0x13')](_0x3572d6,_0x3838('0x14'),_0x3838('0x15'));_0x38e779+=_0x276d98[_0x3838('0x16')]('base64');return _0x38e779;}function decryptDate(_0x284ec1){var _0xb4bf82=crypto[_0x3838('0x17')](_0x3838('0x18'),config[_0x3838('0x12')]['session']);var _0x464fd9=_0xb4bf82[_0x3838('0x13')](_0x284ec1,_0x3838('0x15'),'utf8');_0x464fd9+=_0xb4bf82[_0x3838('0x16')](_0x3838('0x14'));return _0x464fd9;}function sendJiraAlert(_0x4a9a7a,_0xf69d52,_0x2fe3c8){var _0x50c9a1=_0x3838('0x19');return db['User'][_0x3838('0x1a')]({'where':{'role':_0x3838('0x1b')},'attributes':[_0x3838('0x1c'),_0x3838('0x1d')],'raw':!![]})[_0x3838('0xf')](function(_0x58175e){ADMIN=_0x58175e;_0x50c9a1+='|reason|'+_0x2fe3c8+'|\x0a';_0x50c9a1+=_0x3838('0x1e')+_0x4a9a7a+'|\x0a';_0x50c9a1+='|machineUuid|'+_0xf69d52+'|\x0a';_0x50c9a1+=_0x3838('0x1f')+ADMIN[_0x3838('0x1c')]+'|\x0a';_0x50c9a1+=_0x3838('0x20')+ADMIN[_0x3838('0x1d')]+'|\x0a';return _0x50c9a1;})[_0x3838('0xf')](function(_0x30e98f){var _0xbd0fd1=hardware[_0x3838('0x21')]()['ipAddress'];return jira[_0x3838('0x22')]({'key':'MOTLICENSE','summary':_0x3838('0x23'),'description':_0x30e98f,'issuetype':_0x3838('0x24'),'oldToken':_0x4a9a7a,'newToken':_0xf69d52,'email':ADMIN['email'],'name':ADMIN[_0x3838('0x1c')],'reason':GRAY_PERIOD_REASON,'ip':_0xbd0fd1});});}function manageLicense(_0x265099,_0x5b181a){var _0x12cf42=_0x5b181a[_0x3838('0x25')]({'plain':!![]});httpRequest(_0x265099)['then'](function(_0x1754b2){if(oldToken){oldToken=undefined;}if(_0x1754b2['active']){if(!_0x12cf42[_0x3838('0x9')]&&_0x12cf42['license']!=_0x1754b2['license']||_0x12cf42[_0x3838('0x9')]&&_0x12cf42[_0x3838('0x26')]){logger[_0x3838('0x27')](_0x3838('0x28'));}if(_0x12cf42[_0x3838('0x9')]&&!_0x12cf42['data2']&&_0x12cf42[_0x3838('0x9')]!=_0x1754b2[_0x3838('0x9')]){logger[_0x3838('0x27')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x12cf42[_0x3838('0x9')]&&!_0x12cf42['data2']&&_0x12cf42[_0x3838('0x9')]==_0x1754b2['license']){return _0x5b181a;}return _0x5b181a[_0x3838('0x13')]({'data1':_0x265099,'data2':null,'license':_0x1754b2[_0x3838('0x9')]});}else{if(_0x1754b2['license']||_0x12cf42[_0x3838('0x9')]){if(!_0x12cf42['data2']){if(_0x12cf42['data1']==_0x265099){GRAY_PERIOD_REASON=_0x3838('0x29');logger[_0x3838('0x27')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON='Changed';oldToken=_0x12cf42[_0x3838('0x2a')];logger['info'](_0x3838('0x2b'),_0x12cf42[_0x3838('0x2a')],_0x265099);}sendJiraAlert(_0x12cf42[_0x3838('0x2a')],_0x1754b2[_0x3838('0x2c')],GRAY_PERIOD_REASON);logger[_0x3838('0x27')](_0x3838('0x2d'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0x3838('0x2e')](_0x3838('0x2f')));return _0x5b181a[_0x3838('0x13')]({'data2':encryptDate(moment()[_0x3838('0x2e')](_0x3838('0x2f')))});}else{if(moment()[_0x3838('0x30')](decryptDate(_0x12cf42[_0x3838('0x26')]),_0x3838('0x31'))>DAYS){logger[_0x3838('0x27')](_0x3838('0x32'),moment()[_0x3838('0x2e')]('YYYY-MM-DD\x20HH:mm'));return _0x5b181a[_0x3838('0x13')]({'data1':_0x265099,'data2':null,'license':null});}}}else{if(_0x12cf42[_0x3838('0x2a')]!=_0x265099){logger[_0x3838('0x27')](_0x3838('0x2b'),_0x12cf42['data1'],_0x265099);return _0x5b181a[_0x3838('0x13')]({'data1':_0x265099,'data2':null,'license':null});}}}return _0x5b181a;})[_0x3838('0xf')](function(_0x23b711){_0x5b181a=_0x23b711;})[_0x3838('0x10')](function(_0x4d727c){logger[_0x3838('0x33')](_0x4d727c[_0x3838('0x34')]);})[_0x3838('0x35')](function(){setTimeout(function(){manageLicense(hardware[_0x3838('0x36')](),_0x5b181a);},TIME);});}function defaultLicense(){var _0x5ea658=hardware[_0x3838('0x36')]();if(_0x5ea658){return db[_0x3838('0x37')][_0x3838('0x38')]({'where':{'id':0x1},'defaults':{'data1':_0x5ea658}})['spread'](function(_0x5b3383,_0x403078){logger[_0x3838('0x27')](_0x3838('0x39'),_0x5ea658);manageLicense(_0x5ea658,_0x5b3383);})[_0x3838('0x10')](function(_0x341588){logger[_0x3838('0x33')](_0x341588[_0x3838('0x34')]);});}}exports[_0x3838('0x3a')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index db1e2ea..3a9ae2f 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 _0x79ad=['Breaking\x20license','message','2027-01-01T00:00:00.000Z','Demo\x20license','getLicense','License','find','defaults','then','checkLicense','lodash','moment','./hardware','../environment','../../mysqldb','license','isEmpty','License\x20key\x20value\x20not\x20found','data1','split','createDecipher','aes-256-ctr','%s:%s:%s','update','base64','utf8','demo','uuid','machineUuid','getUuid','session','final','gray','deadline','days','grayReason','disabled'];(function(_0x33bc64,_0x4d1e92){var _0x3fdd34=function(_0x4b40a4){while(--_0x4b40a4){_0x33bc64['push'](_0x33bc64['shift']());}};_0x3fdd34(++_0x4d1e92);}(_0x79ad,0xc3));var _0xd79a=function(_0xe54f96,_0x1a7891){_0xe54f96=_0xe54f96-0x0;var _0x14bc27=_0x79ad[_0xe54f96];return _0x14bc27;};'use strict';var crypto=require('crypto');var util=require('util');var _=require(_0xd79a('0x0'));var moment=require(_0xd79a('0x1'));var hardware=require(_0xd79a('0x2'));var config=require(_0xd79a('0x3'));var db=require(_0xd79a('0x4'))['db'];function checkLicense(_0x22c7e3,_0x44abec){if(_0x22c7e3){try{var _0x2266ae=_0x44abec||_0x22c7e3[_0xd79a('0x5')];if(_[_0xd79a('0x6')](_0x2266ae)){throw new Error(_0xd79a('0x7'));}var _0x2ef50b=_0x22c7e3[_0xd79a('0x8')];var _0x2db5ee=_0x22c7e3['data2'];var _0x257f92=_0x2ef50b[_0xd79a('0x9')]('-')[0x4];var _0x4153cf=_0x2ef50b[_0xd79a('0x9')]('-')[0x0];var _0x4cfce1=crypto[_0xd79a('0xa')](_0xd79a('0xb'),util['format'](_0xd79a('0xc'),_0x257f92,_0x2ef50b,_0x4153cf));var _0x5bc556=_0x4cfce1[_0xd79a('0xd')](_0x2266ae,_0xd79a('0xe'),'utf8');_0x5bc556+=_0x4cfce1['final'](_0xd79a('0xf'));var _0x12180a=JSON['parse'](_0x5bc556);_0x12180a[_0xd79a('0x10')]=![];_0x12180a[_0xd79a('0x11')]=_0x2ef50b;_0x12180a[_0xd79a('0x12')]=hardware[_0xd79a('0x13')]();if(_0x2db5ee){var _0x117e63=crypto[_0xd79a('0xa')]('aes-256-ctr',config['secrets'][_0xd79a('0x14')]);var _0x57a9e0=_0x117e63[_0xd79a('0xd')](_0x2db5ee,_0xd79a('0xe'),_0xd79a('0xf'));_0x57a9e0+=_0x117e63[_0xd79a('0x15')]('utf8');_0x12180a[_0xd79a('0x16')]=_0x57a9e0;_0x12180a[_0xd79a('0x17')]=moment(_0x57a9e0)['add'](0x7,_0xd79a('0x18'))['format']();_0x12180a[_0xd79a('0x19')]=_0x12180a[_0xd79a('0x11')]!=_0x12180a[_0xd79a('0x12')]?'changed':_0xd79a('0x1a');}return _0x12180a;}catch(_0x171904){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xd79a('0x1b'),'uuid':_0x22c7e3[_0xd79a('0x8')],'machineUuid':hardware[_0xd79a('0x13')](),'message':_0x171904[_0xd79a('0x1c')],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xd79a('0x1d'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xd79a('0x1e'),'uuid':_0x22c7e3[_0xd79a('0x8')],'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}exports[_0xd79a('0x1f')]=function(_0x24d605){return db[_0xd79a('0x20')][_0xd79a('0x21')](_[_0xd79a('0x22')](_0x24d605,{'raw':!![],'where':{'id':0x1}}))[_0xd79a('0x23')](function(_0x8f55a){return checkLicense(_0x8f55a,null);});};exports[_0xd79a('0x24')]=checkLicense; \ No newline at end of file +var _0x0a34=['aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','parse','uuid','getUuid','secrets','session','gray','deadline','add','grayReason','machineUuid','changed','disabled','2027-01-01T00:00:00.000Z','Breaking\x20license','data1','message','Demo\x20license','getLicense','License','defaults','then','checkLicense','crypto','util','lodash','moment','../environment','../../mysqldb','License\x20key\x20value\x20not\x20found','split','createDecipher'];(function(_0x2cd246,_0x4b90f6){var _0x3dff91=function(_0x6086e0){while(--_0x6086e0){_0x2cd246['push'](_0x2cd246['shift']());}};_0x3dff91(++_0x4b90f6);}(_0x0a34,0x101));var _0x40a3=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x0a34[_0xdea41a];return _0x15d0d8;};'use strict';var crypto=require(_0x40a3('0x0'));var util=require(_0x40a3('0x1'));var _=require(_0x40a3('0x2'));var moment=require(_0x40a3('0x3'));var hardware=require('./hardware');var config=require(_0x40a3('0x4'));var db=require(_0x40a3('0x5'))['db'];function checkLicense(_0x758ad5,_0x34cf41){if(_0x758ad5){try{var _0x9ba5fa=_0x34cf41||_0x758ad5['license'];if(_['isEmpty'](_0x9ba5fa)){throw new Error(_0x40a3('0x6'));}var _0xa78f9=_0x758ad5['data1'];var _0x4d8686=_0x758ad5['data2'];var _0x51c46b=_0xa78f9[_0x40a3('0x7')]('-')[0x4];var _0x36bd52=_0xa78f9[_0x40a3('0x7')]('-')[0x0];var _0x248bf7=crypto[_0x40a3('0x8')](_0x40a3('0x9'),util[_0x40a3('0xa')](_0x40a3('0xb'),_0x51c46b,_0xa78f9,_0x36bd52));var _0x473676=_0x248bf7[_0x40a3('0xc')](_0x9ba5fa,_0x40a3('0xd'),_0x40a3('0xe'));_0x473676+=_0x248bf7[_0x40a3('0xf')](_0x40a3('0xe'));var _0x4dfb0a=JSON[_0x40a3('0x10')](_0x473676);_0x4dfb0a['demo']=![];_0x4dfb0a[_0x40a3('0x11')]=_0xa78f9;_0x4dfb0a['machineUuid']=hardware[_0x40a3('0x12')]();if(_0x4d8686){var _0x1f7953=crypto[_0x40a3('0x8')]('aes-256-ctr',config[_0x40a3('0x13')][_0x40a3('0x14')]);var _0x370c4b=_0x1f7953['update'](_0x4d8686,'base64',_0x40a3('0xe'));_0x370c4b+=_0x1f7953['final']('utf8');_0x4dfb0a[_0x40a3('0x15')]=_0x370c4b;_0x4dfb0a[_0x40a3('0x16')]=moment(_0x370c4b)[_0x40a3('0x17')](0x7,'days')[_0x40a3('0xa')]();_0x4dfb0a[_0x40a3('0x18')]=_0x4dfb0a[_0x40a3('0x11')]!=_0x4dfb0a[_0x40a3('0x19')]?_0x40a3('0x1a'):_0x40a3('0x1b');}return _0x4dfb0a;}catch(_0xe396ee){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x40a3('0x1c'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x40a3('0x1d'),'uuid':_0x758ad5[_0x40a3('0x1e')],'machineUuid':hardware[_0x40a3('0x12')](),'message':_0xe396ee[_0x40a3('0x1f')],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x40a3('0x1c'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x40a3('0x20'),'uuid':_0x758ad5[_0x40a3('0x1e')],'machineUuid':hardware[_0x40a3('0x12')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}exports[_0x40a3('0x21')]=function(_0x26be2c){return db[_0x40a3('0x22')]['find'](_[_0x40a3('0x23')](_0x26be2c,{'raw':!![],'where':{'id':0x1}}))[_0x40a3('0x24')](function(_0x828acf){return checkLicense(_0x828acf,null);});};exports[_0x40a3('0x25')]=checkLicense; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index 1653298..a81ca97 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 _0x943f=['myappanuglar-secret','app-id','http://localhost:9000'];(function(_0x540fba,_0x11cac3){var _0x377ad4=function(_0x281b7b){while(--_0x281b7b){_0x540fba['push'](_0x540fba['shift']());}};_0x377ad4(++_0x11cac3);}(_0x943f,0xa7));var _0xf943=function(_0x4a2a17,_0x23e07b){_0x4a2a17=_0x4a2a17-0x0;var _0x2e3361=_0x943f[_0x4a2a17];return _0x2e3361;};'use strict';module['exports']={'DOMAIN':_0xf943('0x0'),'SESSION_SECRET':_0xf943('0x1'),'GOOGLE_ID':_0xf943('0x2'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file +var _0x896a=['http://localhost:9000','myappanuglar-secret','app-id','exports'];(function(_0x1e4cfc,_0x16e831){var _0x3eb56e=function(_0x21d6f2){while(--_0x21d6f2){_0x1e4cfc['push'](_0x1e4cfc['shift']());}};_0x3eb56e(++_0x16e831);}(_0x896a,0x117));var _0xa896=function(_0x2da9e6,_0x3ba64f){_0x2da9e6=_0x2da9e6-0x0;var _0x3aff7f=_0x896a[_0x2da9e6];return _0x3aff7f;};'use strict';module[_0xa896('0x0')]={'DOMAIN':_0xa896('0x1'),'SESSION_SECRET':_0xa896('0x2'),'GOOGLE_ID':_0xa896('0x3'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 871b932..de57a24 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x99ef=['%s-%s.log','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','exports','transports','File','%s-%s','error','info','env','debugLevel','moment','winston','path','INFO','join','/var','log','format'];(function(_0x444124,_0x4132b6){var _0x343315=function(_0x522e52){while(--_0x522e52){_0x444124['push'](_0x444124['shift']());}};_0x343315(++_0x4132b6);}(_0x99ef,0x109));var _0xf99e=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x99ef[_0x1589dd];return _0x1bddd1;};'use strict';var moment=require(_0xf99e('0x0'));var winston=require(_0xf99e('0x1'));var util=require('util');var path=require(_0xf99e('0x2'));var debugLevel=_0xf99e('0x3');function filename(_0x4b9ee1,_0x3b4145){return path[_0xf99e('0x4')](_0xf99e('0x5'),_0xf99e('0x6'),'xcally',util[_0xf99e('0x7')](_0xf99e('0x8'),_0x4b9ee1,_0x3b4145));}function formatter(_0x50c0a5,_0x43c4dc){return util[_0xf99e('0x7')](_0xf99e('0x9'),moment()[_0xf99e('0x7')](_0xf99e('0xa')),_0x43c4dc[_0xf99e('0xb')][_0xf99e('0xc')](),_0x50c0a5,_0x43c4dc['message']);}module[_0xf99e('0xd')]=function(_0x275f37){return new winston['Logger']({'transports':[new winston[(_0xf99e('0xe'))][(_0xf99e('0xf'))]({'name':util[_0xf99e('0x7')](_0xf99e('0x10'),_0x275f37,_0xf99e('0x11')),'filename':filename(_0x275f37,_0xf99e('0x11')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1f9578){return formatter(_0x275f37,_0x1f9578);}}),new winston['transports'][(_0xf99e('0xf'))]({'name':util[_0xf99e('0x7')](_0xf99e('0x10'),_0x275f37,_0xf99e('0x12')),'filename':filename(_0x275f37,'info'),'level':_0xf99e('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x180c91){return formatter(_0x275f37,_0x180c91);}}),new winston[(_0xf99e('0xe'))]['Console']({'level':process[_0xf99e('0x13')][_0xf99e('0x14')]||debugLevel,'json':![],'formatter':function(_0x5a6f25){return formatter(_0x275f37,_0x5a6f25);}})]});}; \ No newline at end of file +var _0xbc98=['util','path','INFO','/var','log','format','%s-%s.log','[%s]\x20[%s]\x20%s\x20-\x20%s','level','toUpperCase','message','Logger','File','%s-%s','error','transports','info','Console','env','moment','winston'];(function(_0x2968fd,_0x29ce46){var _0x40ff1c=function(_0x31e88d){while(--_0x31e88d){_0x2968fd['push'](_0x2968fd['shift']());}};_0x40ff1c(++_0x29ce46);}(_0xbc98,0x91));var _0x8bc9=function(_0x36b7e7,_0x50aa83){_0x36b7e7=_0x36b7e7-0x0;var _0x42ce9f=_0xbc98[_0x36b7e7];return _0x42ce9f;};'use strict';var moment=require(_0x8bc9('0x0'));var winston=require(_0x8bc9('0x1'));var util=require(_0x8bc9('0x2'));var path=require(_0x8bc9('0x3'));var debugLevel=_0x8bc9('0x4');function filename(_0x154612,_0x347c6b){return path['join'](_0x8bc9('0x5'),_0x8bc9('0x6'),'xcally',util[_0x8bc9('0x7')](_0x8bc9('0x8'),_0x154612,_0x347c6b));}function formatter(_0x3e34cd,_0x16fff4){return util[_0x8bc9('0x7')](_0x8bc9('0x9'),moment()[_0x8bc9('0x7')]('YYYY-MM-DD\x20HH:mm:ss'),_0x16fff4[_0x8bc9('0xa')][_0x8bc9('0xb')](),_0x3e34cd,_0x16fff4[_0x8bc9('0xc')]);}module['exports']=function(_0x2a254d){return new winston[(_0x8bc9('0xd'))]({'transports':[new winston['transports'][(_0x8bc9('0xe'))]({'name':util[_0x8bc9('0x7')](_0x8bc9('0xf'),_0x2a254d,_0x8bc9('0x10')),'filename':filename(_0x2a254d,'error'),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2bf02a){return formatter(_0x2a254d,_0x2bf02a);}}),new winston[(_0x8bc9('0x11'))][(_0x8bc9('0xe'))]({'name':util[_0x8bc9('0x7')]('%s-%s',_0x2a254d,'info'),'filename':filename(_0x2a254d,_0x8bc9('0x12')),'level':_0x8bc9('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xd2c554){return formatter(_0x2a254d,_0xd2c554);}}),new winston['transports'][(_0x8bc9('0x13'))]({'level':process[_0x8bc9('0x14')]['debugLevel']||debugLevel,'json':![],'formatter':function(_0x1a67a1){return formatter(_0x2a254d,_0x1a67a1);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index d3ab5da..80df221 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 _0x0360=['../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','../../services/express/index.js','ami','join','../../services/ami/index.js','../../services/agi/index.js','email'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x0360,0xae));var _0x0036=function(_0x2d82e6,_0x356578){_0x2d82e6=_0x2d82e6-0x0;var _0x33d0d1=_0x0360[_0x2d82e6];return _0x33d0d1;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':'express','script':path['join'](__dirname,_0x0036('0x0'))},{'name':_0x0036('0x1'),'script':path[_0x0036('0x2')](__dirname,_0x0036('0x3'))},{'name':'agi','script':path[_0x0036('0x2')](__dirname,_0x0036('0x4'))},{'name':_0x0036('0x5'),'script':path[_0x0036('0x2')](__dirname,_0x0036('0x6'))},{'name':_0x0036('0x7'),'script':path[_0x0036('0x2')](__dirname,_0x0036('0x8'))},{'name':_0x0036('0x9'),'script':path[_0x0036('0x2')](__dirname,_0x0036('0xa'))}]};module[_0x0036('0xb')]=config; \ No newline at end of file +var _0xdeb7=['express','join','ami','../../services/ami/index.js','agi','email','../../services/email/index.js','routing','../../services/routing/index.js','../../services/xdr/index.js','exports','path'];(function(_0x4f9fec,_0x52d70c){var _0x4d47d6=function(_0x3a35ec){while(--_0x3a35ec){_0x4f9fec['push'](_0x4f9fec['shift']());}};_0x4d47d6(++_0x52d70c);}(_0xdeb7,0x77));var _0x7deb=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xdeb7[_0x2641f9];return _0x585741;};'use strict';var path=require(_0x7deb('0x0'));var os=require('os');var config={'apps':[{'name':_0x7deb('0x1'),'script':path[_0x7deb('0x2')](__dirname,'../../services/express/index.js')},{'name':_0x7deb('0x3'),'script':path[_0x7deb('0x2')](__dirname,_0x7deb('0x4'))},{'name':_0x7deb('0x5'),'script':path[_0x7deb('0x2')](__dirname,'../../services/agi/index.js')},{'name':_0x7deb('0x6'),'script':path[_0x7deb('0x2')](__dirname,_0x7deb('0x7'))},{'name':_0x7deb('0x8'),'script':path[_0x7deb('0x2')](__dirname,_0x7deb('0x9'))},{'name':'xdr','script':path[_0x7deb('0x2')](__dirname,_0x7deb('0xa'))}]};module[_0x7deb('0xb')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 4449bf7..42b86cb 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 _0xcc30=['restart','list','describe','delete','dump','pm2','bluebird','connected','start','disconnect','stop','then'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xcc30,0x1a9));var _0x0cc3=function(_0x158e3b,_0x4534b){_0x158e3b=_0x158e3b-0x0;var _0x551a1d=_0xcc30[_0x158e3b];return _0x551a1d;};'use strict';var pm2=require(_0x0cc3('0x0'));var BPromise=require(_0x0cc3('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0xe2cd51,_0x383a20){return pm2['connect'](function(_0x302798){if(_0x302798){return _0x383a20(_0x302798);}return _0xe2cd51(_0x0cc3('0x2'));});});};exports[_0x0cc3('0x3')]=function(_0x3191b1){return connect()['then'](function(){return new BPromise(function(_0x36e1f4,_0x469b2b){return pm2[_0x0cc3('0x3')](_0x3191b1,function(_0x1d64b9,_0x3d6372){if(_0x1d64b9){return _0x469b2b(_0x1d64b9);}pm2[_0x0cc3('0x4')]();return _0x36e1f4(_0x3d6372);});});});};exports[_0x0cc3('0x5')]=function(_0x519661){return connect()[_0x0cc3('0x6')](function(){return new BPromise(function(_0x266a34,_0x364d6c){return pm2[_0x0cc3('0x5')](_0x519661,function(_0x57b80c,_0x524882){if(_0x57b80c){return _0x364d6c(_0x57b80c);}pm2[_0x0cc3('0x4')]();return _0x266a34(_0x524882);});});});};exports[_0x0cc3('0x7')]=function(_0x387b18){return connect()['then'](function(){return new BPromise(function(_0x5e5793,_0x2529d6){return pm2['restart'](_0x387b18,function(_0x1e0f41,_0x3f5860){if(_0x1e0f41){return _0x2529d6(_0x1e0f41);}pm2[_0x0cc3('0x4')]();return _0x5e5793(_0x3f5860);});});});};exports[_0x0cc3('0x8')]=function(){return connect()['then'](function(){return new BPromise(function(_0x15ee2c,_0x1293be){return pm2[_0x0cc3('0x8')](function(_0x6df54c,_0x1e1799){if(_0x6df54c){return _0x1293be(_0x6df54c);}pm2[_0x0cc3('0x4')]();return _0x15ee2c(_0x1e1799);});});});};exports['describe']=function(_0x3c22e1){return connect()[_0x0cc3('0x6')](function(){return new BPromise(function(_0x439ec8,_0x46c93a){return pm2[_0x0cc3('0x9')](_0x3c22e1,function(_0x1e91bd,_0x1b2056){if(_0x1e91bd){return _0x46c93a(_0x1e91bd);}pm2[_0x0cc3('0x4')]();return _0x439ec8(_0x1b2056);});});});};exports[_0x0cc3('0xa')]=function(_0xf231f){return connect()[_0x0cc3('0x6')](function(){return new BPromise(function(_0x5e1991,_0x1b2b30){return pm2['delete'](_0xf231f,function(_0x48400f,_0x3a7878){if(_0x48400f){return _0x1b2b30(_0x48400f);}pm2[_0x0cc3('0x4')]();return _0x5e1991(_0x3a7878);});});});};exports['dump']=function(){return connect()[_0x0cc3('0x6')](function(){return new BPromise(function(_0x942d0b,_0x495f88){return pm2[_0x0cc3('0xb')](function(_0x1b59c2){if(_0x1b59c2){return _0x495f88(_0x1b59c2);}return _0x942d0b('saved');});});});}; \ No newline at end of file +var _0x770d=['start','then','disconnect','stop','restart','list','describe','delete','dump','saved','pm2','bluebird','./config','connect'];(function(_0x2e5b76,_0x216f34){var _0x38c628=function(_0x5886f3){while(--_0x5886f3){_0x2e5b76['push'](_0x2e5b76['shift']());}};_0x38c628(++_0x216f34);}(_0x770d,0x122));var _0xd770=function(_0x1b9366,_0x5844be){_0x1b9366=_0x1b9366-0x0;var _0x39e185=_0x770d[_0x1b9366];return _0x39e185;};'use strict';var pm2=require(_0xd770('0x0'));var BPromise=require(_0xd770('0x1'));var config=require(_0xd770('0x2'));function connect(){return new BPromise(function(_0x22bfe5,_0x286d89){return pm2[_0xd770('0x3')](function(_0x742a9a){if(_0x742a9a){return _0x286d89(_0x742a9a);}return _0x22bfe5('connected');});});};exports[_0xd770('0x4')]=function(_0x3ac59f){return connect()[_0xd770('0x5')](function(){return new BPromise(function(_0x3a065e,_0x5d3b18){return pm2['start'](_0x3ac59f,function(_0x2d73bd,_0x251860){if(_0x2d73bd){return _0x5d3b18(_0x2d73bd);}pm2[_0xd770('0x6')]();return _0x3a065e(_0x251860);});});});};exports[_0xd770('0x7')]=function(_0xe597a3){return connect()[_0xd770('0x5')](function(){return new BPromise(function(_0x8a6d4a,_0x52296d){return pm2[_0xd770('0x7')](_0xe597a3,function(_0x36f62b,_0x38da18){if(_0x36f62b){return _0x52296d(_0x36f62b);}pm2[_0xd770('0x6')]();return _0x8a6d4a(_0x38da18);});});});};exports[_0xd770('0x8')]=function(_0x478b61){return connect()[_0xd770('0x5')](function(){return new BPromise(function(_0x1a1c5b,_0x1ced49){return pm2[_0xd770('0x8')](_0x478b61,function(_0x285521,_0x25f443){if(_0x285521){return _0x1ced49(_0x285521);}pm2[_0xd770('0x6')]();return _0x1a1c5b(_0x25f443);});});});};exports[_0xd770('0x9')]=function(){return connect()['then'](function(){return new BPromise(function(_0x4875f1,_0x28120b){return pm2[_0xd770('0x9')](function(_0x206000,_0x4561bb){if(_0x206000){return _0x28120b(_0x206000);}pm2['disconnect']();return _0x4875f1(_0x4561bb);});});});};exports[_0xd770('0xa')]=function(_0x3babaf){return connect()[_0xd770('0x5')](function(){return new BPromise(function(_0x1249f2,_0x47a84f){return pm2[_0xd770('0xa')](_0x3babaf,function(_0x58017e,_0x600d02){if(_0x58017e){return _0x47a84f(_0x58017e);}pm2[_0xd770('0x6')]();return _0x1249f2(_0x600d02);});});});};exports[_0xd770('0xb')]=function(_0x3040c6){return connect()[_0xd770('0x5')](function(){return new BPromise(function(_0x38f458,_0x2659a5){return pm2[_0xd770('0xb')](_0x3040c6,function(_0x42964b,_0x54b52b){if(_0x42964b){return _0x2659a5(_0x42964b);}pm2[_0xd770('0x6')]();return _0x38f458(_0x54b52b);});});});};exports['dump']=function(){return connect()[_0xd770('0x5')](function(){return new BPromise(function(_0x5d802e,_0x28ac07){return pm2[_0xd770('0xc')](function(_0x10e4b1){if(_0x10e4b1){return _0x28ac07(_0x10e4b1);}return _0x5d802e(_0xd770('0xd'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 3e47a1b..1703784 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 _0xda66=['error','lodash','moment','ioredis','../../mysqldb','redis','defaults','socket.io-emitter','Setting','chatTimeout','ChatInteraction','findAll','subtract','minutes','then','update','format','length','emit','catch'];(function(_0x4574eb,_0x449821){var _0x1cfd44=function(_0x209c9d){while(--_0x209c9d){_0x4574eb['push'](_0x4574eb['shift']());}};_0x1cfd44(++_0x449821);}(_0xda66,0x155));var _0x6da6=function(_0x467ef6,_0x932cef){_0x467ef6=_0x467ef6-0x0;var _0x3e4aa2=_0xda66[_0x467ef6];return _0x3e4aa2;};'use strict';var _=require(_0x6da6('0x0'));var moment=require(_0x6da6('0x1'));var Redis=require(_0x6da6('0x2'));var db=require(_0x6da6('0x3'))['db'];var config=require('../../config/environment');config[_0x6da6('0x4')]=_[_0x6da6('0x5')](config[_0x6da6('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x6da6('0x6'))(new Redis(config['redis']));function closeInteractions(){var _0x4cea22=0x0;var _0x101721=[];return db[_0x6da6('0x7')]['find']({'raw':!![],'attributes':['id',_0x6da6('0x8')],'where':{'id':0x1}})['then'](function(_0x474b71){_0x4cea22=_0x474b71['chatTimeout'];if(_0x4cea22){return db[_0x6da6('0x9')][_0x6da6('0xa')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x6da6('0xb')](_0x474b71[_0x6da6('0x8')],_0x6da6('0xc'))}}});}else{return[];}})[_0x6da6('0xd')](function(_0x5de359){_0x101721=_0x5de359;if(_0x4cea22){return db[_0x6da6('0x9')][_0x6da6('0xe')]({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()[_0x6da6('0xf')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_['map'](_0x101721||[],'id')}});}})[_0x6da6('0xd')](function(_0x18ae04){for(var _0x2ec232=0x0;_0x2ec232<_0x101721[_0x6da6('0x10')];_0x2ec232++){io[_0x6da6('0x11')]('chatInteraction:update',{'id':_0x101721[_0x2ec232]['id'],'closed':!![]});}})[_0x6da6('0x12')](function(_0x560d1f){console[_0x6da6('0x13')](_0x560d1f);});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x6bc5=['timeout','format','YYYY-MM-DD\x20HH:mm:ss','map','length','emit','chatInteraction:update','catch','error','start','ioredis','../../config/environment','redis','socket.io-emitter','Setting','find','chatTimeout','then','findAll','lastMsgAt','subtract'];(function(_0x253cb4,_0x56f924){var _0x3ba076=function(_0x1dd544){while(--_0x1dd544){_0x253cb4['push'](_0x253cb4['shift']());}};_0x3ba076(++_0x56f924);}(_0x6bc5,0x16f));var _0x56bc=function(_0x20da61,_0x40f13b){_0x20da61=_0x20da61-0x0;var _0x3067bd=_0x6bc5[_0x20da61];return _0x3067bd;};'use strict';var _=require('lodash');var moment=require('moment');var Redis=require(_0x56bc('0x0'));var db=require('../../mysqldb')['db'];var config=require(_0x56bc('0x1'));config[_0x56bc('0x2')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x56bc('0x3'))(new Redis(config[_0x56bc('0x2')]));function closeInteractions(){var _0x14d821=0x0;var _0x314224=[];return db[_0x56bc('0x4')][_0x56bc('0x5')]({'raw':!![],'attributes':['id',_0x56bc('0x6')],'where':{'id':0x1}})[_0x56bc('0x7')](function(_0x27f8a9){_0x14d821=_0x27f8a9[_0x56bc('0x6')];if(_0x14d821){return db['ChatInteraction'][_0x56bc('0x8')]({'raw':!![],'attributes':['id',_0x56bc('0x9')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x56bc('0xa')](_0x27f8a9[_0x56bc('0x6')],'minutes')}}});}else{return[];}})['then'](function(_0x214cb8){_0x314224=_0x214cb8;if(_0x14d821){return db['ChatInteraction']['update']({'closeReason':'system','disposition':_0x56bc('0xb'),'closed':!![],'closedAt':moment()[_0x56bc('0xc')](_0x56bc('0xd'))},{'where':{'id':_[_0x56bc('0xe')](_0x314224||[],'id')}});}})[_0x56bc('0x7')](function(_0x5a6390){for(var _0x406982=0x0;_0x406982<_0x314224[_0x56bc('0xf')];_0x406982++){io[_0x56bc('0x10')](_0x56bc('0x11'),{'id':_0x314224[_0x406982]['id'],'closed':!![]});}})[_0x56bc('0x12')](function(_0x3c46ba){console[_0x56bc('0x13')](_0x3c46ba);});}exports[_0x56bc('0x14')]=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 4de4fcb..745043e 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 _0xc73c=['YYYY-MM-DD\x20HH:mm:ss','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','runReport','catch','CustomReportId','no\x20report\x20id','findAll','MailServerOut','jobs','map','toString','keyBy','intersection','difference','length','stop','deleteJob','toRun','index','my\x20id','resolve','run\x20job','cron','active','startAt','endAt','add','start','add\x20cron','exists','update','update\x20cron','stop\x20cron','run','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure','authentication','auth','pass','format','\x22%s\x22\x20<%s>','name','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractUnit','../../files/reports','basename','savename','zip','join','existsSync','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','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','then','error','error\x20mail','email\x20sent','data','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','subtractNumber'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xc73c,0x138));var _0xcc73=function(_0x54f72b,_0x4e8ff0){_0x54f72b=_0x54f72b-0x0;var _0xfbe732=_0xc73c[_0x54f72b];return _0xfbe732;};'use strict';var fs=require('fs');var util=require('util');var path=require('path');var _=require(_0xcc73('0x0'));var moment=require(_0xcc73('0x1'));var CronJobManager=require(_0xcc73('0x2'));var jayson=require(_0xcc73('0x3'));var BPromise=require(_0xcc73('0x4'));var logger=require(_0xcc73('0x5'))(_0xcc73('0x6'));var db=require(_0xcc73('0x7'))['db'];var analyticCustomReportController=require(_0xcc73('0x8'));var analyticDefaultReportController=require(_0xcc73('0x9'));var client=jayson[_0xcc73('0xa')][_0xcc73('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x1f0cb3,_0x4e76db){return function(){logger[_0xcc73('0xc')](_0xcc73('0xd'),_0x1f0cb3[_0xcc73('0xe')]);var _0x1d3c35=!![];var _0x24f15b={'tls':{'rejectUnauthorized':![]}};if(_0x1f0cb3[_0xcc73('0xf')][_0xcc73('0x10')][_0xcc73('0x11')]){_0x24f15b[_0xcc73('0x11')]=_0x1f0cb3['MailAccount'][_0xcc73('0x10')]['service'];}else{_0x24f15b[_0xcc73('0x12')]=_0x1f0cb3[_0xcc73('0xf')][_0xcc73('0x10')][_0xcc73('0x12')];_0x24f15b[_0xcc73('0x13')]=_0x1f0cb3[_0xcc73('0xf')][_0xcc73('0x10')][_0xcc73('0x13')];_0x24f15b[_0xcc73('0x14')]=_0x1f0cb3[_0xcc73('0xf')]['Smtp'][_0xcc73('0x14')];}if(_0x1f0cb3[_0xcc73('0xf')][_0xcc73('0x10')][_0xcc73('0x15')]){_0x24f15b[_0xcc73('0x16')]={'user':_0x1f0cb3['MailAccount']['Smtp']['user'],'pass':_0x1f0cb3['MailAccount'][_0xcc73('0x10')][_0xcc73('0x17')]};}var _0x31aa6e={'account':_0x24f15b,'message':{'from':util[_0xcc73('0x18')](_0xcc73('0x19'),_0x1f0cb3[_0xcc73('0xf')][_0xcc73('0x1a')],_0x1f0cb3['MailAccount']['email']||_0x1f0cb3[_0xcc73('0xf')][_0xcc73('0x10')][_0xcc73('0x1b')]),'to':_0x1f0cb3[_0xcc73('0xe')],'cc':_0x1f0cb3['cc'],'bcc':_0x1f0cb3[_0xcc73('0x1c')],'subject':util[_0xcc73('0x18')](_0xcc73('0x1d'),_0x4e76db[_0xcc73('0x1a')],_0x1f0cb3['subtractNumber'],_0x1f0cb3[_0xcc73('0x1e')])}};var _0x577aaa=path['join'](__dirname,_0xcc73('0x1f'));var _0x198041=_0x4e76db['savename'];var _0x833fc5=util[_0xcc73('0x18')]('%s.%s',path[_0xcc73('0x20')](_0x4e76db['savename'],path['extname'](_0x4e76db[_0xcc73('0x21')])),_0xcc73('0x22'));var _0x385f0a=path[_0xcc73('0x23')](_0x577aaa,_0x198041);var _0x29c60b=path[_0xcc73('0x23')](_0x577aaa,_0x833fc5);if(fs[_0xcc73('0x24')](_0x385f0a)){_0x4e76db['status']=_0xcc73('0x25');_0x31aa6e[_0xcc73('0x26')][_0xcc73('0x27')]=[{'filename':_0x198041,'path':_0x385f0a}];_0x31aa6e['message'][_0xcc73('0x28')]=util['format'](_0xcc73('0x29'),JSON[_0xcc73('0x2a')](_0x4e76db,null,0x2));}else if(fs[_0xcc73('0x24')](_0x29c60b)){_0x4e76db['status']='Sent';_0x31aa6e['message'][_0xcc73('0x27')]=[{'filename':_0x833fc5,'path':_0x29c60b}];}else{_0x31aa6e[_0xcc73('0x26')][_0xcc73('0x28')]=_0xcc73('0x2b');if(!_0x1f0cb3[_0xcc73('0x2c')]){_0x1d3c35=![];logger[_0xcc73('0xc')](_0xcc73('0x2d'));}}if(_0x1d3c35){return client['request'](_0xcc73('0x2e'),_0x31aa6e)[_0xcc73('0x2f')](function(_0x89dcdb){if(_0x89dcdb[_0xcc73('0x30')]){return logger['error'](_0xcc73('0x31'),JSON[_0xcc73('0x2a')](_0x89dcdb));}return logger['info'](_0xcc73('0x32'));})['catch'](function(_0x5dcbbc){return logger[_0xcc73('0x30')]('error\x20mail',JSON[_0xcc73('0x2a')](_0x5dcbbc));});}};}function handleError(){return function(_0x553832){return logger['error'](JSON[_0xcc73('0x2a')](_0x553832));};}function handleResult(_0xc144cf){return function(_0x894493){logger[_0xcc73('0xc')](_0xcc73('0x33'),JSON['stringify'](_0x894493));if(_0xc144cf[_0xcc73('0xf')]&&_0xc144cf['MailAccount']['Smtp']&&!_[_0xcc73('0x34')](_0xc144cf[_0xcc73('0xe')])){setTimeout(handleSendEmail(_0xc144cf,_0x894493),0x3c*0x3e8);}};}function handleJob(_0x19dd40){return function(){try{if(_['isNil'](_0x19dd40['subtractNumber'])){return logger['info']('subtractNumber\x20null\x20or\x20undefined');}if(_[_0xcc73('0x34')](_0x19dd40[_0xcc73('0x1e')])){return logger['info'](_0xcc73('0x35'));}var _0x4325ea={'startDate':moment()[_0xcc73('0x36')](_0x19dd40[_0xcc73('0x37')],_0x19dd40[_0xcc73('0x1e')])['format'](_0xcc73('0x38')),'endDate':moment()[_0xcc73('0x18')](_0xcc73('0x38')),'type':'scheduled','output':_0x19dd40[_0xcc73('0x39')],'name':_0x19dd40['name']};if(!_[_0xcc73('0x34')](_0x19dd40['DefaultReportId'])){logger[_0xcc73('0xc')](_0xcc73('0x3a'),_0x19dd40[_0xcc73('0x3b')]);return analyticDefaultReportController[_0xcc73('0x3c')]({'id':_0x19dd40['DefaultReportId']},_0x4325ea)[_0xcc73('0x2f')](handleResult(_0x19dd40))[_0xcc73('0x3d')](handleError());}if(!_[_0xcc73('0x34')](_0x19dd40['CustomReportId'])){logger['info']('exec\x20custom\x20report\x20id:%s',_0x19dd40[_0xcc73('0x3e')]);return analyticCustomReportController[_0xcc73('0x3c')]({'id':_0x19dd40[_0xcc73('0x3e')]},_0x4325ea)[_0xcc73('0x2f')](handleResult(_0x19dd40))[_0xcc73('0x3d')](handleError());}}catch(_0x11a7e5){logger['error'](JSON['stringify'](_0x11a7e5));}return logger[_0xcc73('0xc')](_0xcc73('0x3f'));};}function getJobs(_0x484911){var _0x5909a3={};if(_0x484911){_0x5909a3['id']=_0x484911;}return db['Schedule'][_0xcc73('0x40')]({'where':_0x5909a3,'include':[{'model':db[_0xcc73('0xf')],'attributes':['id',_0xcc73('0x1a'),_0xcc73('0xe')],'include':[{'model':db[_0xcc73('0x41')],'as':_0xcc73('0x10')}]}]})[_0xcc73('0x2f')](function(_0x57e3f6){var _0x5406dc=_['keys'](manager[_0xcc73('0x42')]);var _0x396cf3=_[_0xcc73('0x43')](_0x57e3f6,function(_0xa1735c){return _0xa1735c['id'][_0xcc73('0x44')]();});var _0x58f910=_[_0xcc73('0x45')](_0x57e3f6,function(_0x408143){return _0x408143['id']['toString']();});var _0x540c55=_0x484911?_0x396cf3:_['difference'](_0x396cf3,_0x5406dc);var _0x7547dc=_[_0xcc73('0x46')](_0x396cf3,_0x5406dc);var _0x15790e=_[_0xcc73('0x47')](_0x5406dc,_0x396cf3);var _0x1aedd2;var _0x5d4993;for(_0x1aedd2=0x0;_0x1aedd2<_0x15790e[_0xcc73('0x48')]&&!_0x484911;_0x1aedd2+=0x1){_0x5d4993=_0x15790e[_0x1aedd2][_0xcc73('0x44')]();if(manager['exists'](_0x5d4993)){manager[_0xcc73('0x49')](_0x5d4993);manager[_0xcc73('0x4a')](_0x5d4993);logger[_0xcc73('0xc')]('delete\x20cron',_0x5d4993);}}logger[_0xcc73('0xc')](_0xcc73('0x4b'),JSON[_0xcc73('0x2a')](_0x540c55));for(_0x1aedd2=0x0;_0x1aedd2<_0x540c55[_0xcc73('0x48')];_0x1aedd2+=0x1){_0x5d4993=_0x540c55[_0x1aedd2][_0xcc73('0x44')]();logger['info'](_0xcc73('0x4c'),_0x5d4993);if(_0x484911){logger[_0xcc73('0xc')](_0xcc73('0x4d'),_0x484911);logger['info'](JSON[_0xcc73('0x2a')](_0x58f910[_0x5d4993]));BPromise[_0xcc73('0x4e')]()[_0xcc73('0x2f')](handleJob(_0x58f910[_0x5d4993]));logger[_0xcc73('0xc')](_0xcc73('0x4f'),_0x58f910[_0x5d4993][_0xcc73('0x1a')],_0x58f910[_0x5d4993][_0xcc73('0x50')]);}else if(_0x58f910[_0x5d4993][_0xcc73('0x50')]&&_0x58f910[_0x5d4993][_0xcc73('0x51')]&&moment()['isBetween'](_0x58f910[_0x5d4993][_0xcc73('0x52')],_0x58f910[_0x5d4993][_0xcc73('0x53')])){manager[_0xcc73('0x54')](_0x5d4993,_0x58f910[_0x5d4993]['cron'],handleJob(_0x58f910[_0x5d4993]));manager[_0xcc73('0x55')](_0x5d4993);logger[_0xcc73('0xc')](_0xcc73('0x56'),_0x58f910[_0x5d4993][_0xcc73('0x1a')],_0x58f910[_0x5d4993]['cron']);}else if(manager[_0xcc73('0x57')](_0x5d4993)){manager[_0xcc73('0x49')](_0x5d4993);manager[_0xcc73('0x4a')](_0x5d4993);logger[_0xcc73('0xc')]('stop\x20cron',_0x58f910[_0x5d4993]['name'],_0x58f910[_0x5d4993][_0xcc73('0x50')]);}}for(_0x1aedd2=0x0,_0x5d4993;_0x1aedd2<_0x7547dc['length']&&!_0x484911;_0x1aedd2+=0x1){_0x5d4993=_0x7547dc[_0x1aedd2]['toString']();if(manager['exists'](_0x5d4993)){if(_0x58f910[_0x5d4993][_0xcc73('0x50')]&&_0x58f910[_0x5d4993]['active']&&moment()['isBetween'](_0x58f910[_0x5d4993][_0xcc73('0x52')],_0x58f910[_0x5d4993][_0xcc73('0x53')])){manager[_0xcc73('0x58')](_0x5d4993,_0x58f910[_0x5d4993][_0xcc73('0x50')],handleJob(_0x58f910[_0x5d4993]));logger[_0xcc73('0xc')](_0xcc73('0x59'),_0x58f910[_0x5d4993][_0xcc73('0x1a')],_0x58f910[_0x5d4993][_0xcc73('0x50')]);}else{manager[_0xcc73('0x49')](_0x5d4993);manager[_0xcc73('0x4a')](_0x5d4993);logger[_0xcc73('0xc')](_0xcc73('0x5a'),_0x58f910[_0x5d4993][_0xcc73('0x1a')],_0x58f910[_0x5d4993][_0xcc73('0x50')]);}}}})[_0xcc73('0x3d')](function(_0x457847){logger['error'](JSON[_0xcc73('0x2a')](_0x457847));});}exports[_0xcc73('0x5b')]=function(_0x15be2d){return getJobs(_0x15be2d);};exports[_0xcc73('0x55')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xabc3=['jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure','authentication','auth','user','pass','format','\x22%s\x22\x20<%s>','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','extname','zip','existsSync','Sent','message','attachments','text','status','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','email\x20sent','catch','error\x20mail','stringify','data','subtractNumber\x20null\x20or\x20undefined','isNil','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','output','name','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','MailServerOut','keys','jobs','map','toString','keyBy','difference','intersection','length','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','cron','active','startAt','add','start','add\x20cron','exists','stop\x20cron','isBetween','endAt','update','run','util','path','lodash','moment','cron-job-manager'];(function(_0x2d57d7,_0x4a779c){var _0x2a954c=function(_0x4325a3){while(--_0x4325a3){_0x2d57d7['push'](_0x2d57d7['shift']());}};_0x2a954c(++_0x4a779c);}(_0xabc3,0x183));var _0x3abc=function(_0xbe047b,_0x3cf6e9){_0xbe047b=_0xbe047b-0x0;var _0x40dd7d=_0xabc3[_0xbe047b];return _0x40dd7d;};'use strict';var fs=require('fs');var util=require(_0x3abc('0x0'));var path=require(_0x3abc('0x1'));var _=require(_0x3abc('0x2'));var moment=require(_0x3abc('0x3'));var CronJobManager=require(_0x3abc('0x4'));var jayson=require(_0x3abc('0x5'));var BPromise=require(_0x3abc('0x6'));var logger=require(_0x3abc('0x7'))(_0x3abc('0x8'));var db=require(_0x3abc('0x9'))['db'];var analyticCustomReportController=require(_0x3abc('0xa'));var analyticDefaultReportController=require(_0x3abc('0xb'));var client=jayson[_0x3abc('0xc')][_0x3abc('0xd')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x6540a8,_0x32861f){return function(){logger[_0x3abc('0xe')](_0x3abc('0xf'),_0x6540a8[_0x3abc('0x10')]);var _0x26cd6e=!![];var _0x6d57e5={'tls':{'rejectUnauthorized':![]}};if(_0x6540a8[_0x3abc('0x11')][_0x3abc('0x12')][_0x3abc('0x13')]){_0x6d57e5['service']=_0x6540a8[_0x3abc('0x11')][_0x3abc('0x12')][_0x3abc('0x13')];}else{_0x6d57e5[_0x3abc('0x14')]=_0x6540a8[_0x3abc('0x11')][_0x3abc('0x12')]['host'];_0x6d57e5[_0x3abc('0x15')]=_0x6540a8['MailAccount'][_0x3abc('0x12')]['port'];_0x6d57e5[_0x3abc('0x16')]=_0x6540a8['MailAccount']['Smtp'][_0x3abc('0x16')];}if(_0x6540a8['MailAccount'][_0x3abc('0x12')][_0x3abc('0x17')]){_0x6d57e5[_0x3abc('0x18')]={'user':_0x6540a8[_0x3abc('0x11')][_0x3abc('0x12')][_0x3abc('0x19')],'pass':_0x6540a8[_0x3abc('0x11')][_0x3abc('0x12')][_0x3abc('0x1a')]};}var _0x118e11={'account':_0x6d57e5,'message':{'from':util[_0x3abc('0x1b')](_0x3abc('0x1c'),_0x6540a8[_0x3abc('0x11')]['name'],_0x6540a8['MailAccount']['email']||_0x6540a8[_0x3abc('0x11')]['Smtp'][_0x3abc('0x19')]),'to':_0x6540a8['email'],'cc':_0x6540a8['cc'],'bcc':_0x6540a8[_0x3abc('0x1d')],'subject':util['format'](_0x3abc('0x1e'),_0x32861f['name'],_0x6540a8[_0x3abc('0x1f')],_0x6540a8[_0x3abc('0x20')])}};var _0x9f98e7=path[_0x3abc('0x21')](__dirname,_0x3abc('0x22'));var _0x566bd0=_0x32861f[_0x3abc('0x23')];var _0x54b129=util[_0x3abc('0x1b')]('%s.%s',path['basename'](_0x32861f['savename'],path[_0x3abc('0x24')](_0x32861f[_0x3abc('0x23')])),_0x3abc('0x25'));var _0x12ef73=path[_0x3abc('0x21')](_0x9f98e7,_0x566bd0);var _0x5a032d=path[_0x3abc('0x21')](_0x9f98e7,_0x54b129);if(fs[_0x3abc('0x26')](_0x12ef73)){_0x32861f['status']=_0x3abc('0x27');_0x118e11[_0x3abc('0x28')][_0x3abc('0x29')]=[{'filename':_0x566bd0,'path':_0x12ef73}];_0x118e11[_0x3abc('0x28')][_0x3abc('0x2a')]=util[_0x3abc('0x1b')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON['stringify'](_0x32861f,null,0x2));}else if(fs[_0x3abc('0x26')](_0x5a032d)){_0x32861f[_0x3abc('0x2b')]=_0x3abc('0x27');_0x118e11[_0x3abc('0x28')][_0x3abc('0x29')]=[{'filename':_0x54b129,'path':_0x5a032d}];}else{_0x118e11['message'][_0x3abc('0x2a')]=_0x3abc('0x2c');if(!_0x6540a8[_0x3abc('0x2d')]){_0x26cd6e=![];logger[_0x3abc('0xe')](_0x3abc('0x2e'));}}if(_0x26cd6e){return client[_0x3abc('0x2f')](_0x3abc('0x30'),_0x118e11)[_0x3abc('0x31')](function(_0xe5e093){if(_0xe5e093[_0x3abc('0x32')]){return logger[_0x3abc('0x32')]('error\x20mail',JSON['stringify'](_0xe5e093));}return logger[_0x3abc('0xe')](_0x3abc('0x33'));})[_0x3abc('0x34')](function(_0x3f2311){return logger['error'](_0x3abc('0x35'),JSON[_0x3abc('0x36')](_0x3f2311));});}};}function handleError(){return function(_0x5fcbea){return logger[_0x3abc('0x32')](JSON[_0x3abc('0x36')](_0x5fcbea));};}function handleResult(_0x54c9dc){return function(_0x95ea4a){logger[_0x3abc('0xe')](_0x3abc('0x37'),JSON[_0x3abc('0x36')](_0x95ea4a));if(_0x54c9dc[_0x3abc('0x11')]&&_0x54c9dc[_0x3abc('0x11')][_0x3abc('0x12')]&&!_['isNil'](_0x54c9dc[_0x3abc('0x10')])){setTimeout(handleSendEmail(_0x54c9dc,_0x95ea4a),0x3c*0x3e8);}};}function handleJob(_0x4404d2){return function(){try{if(_['isNil'](_0x4404d2[_0x3abc('0x1f')])){return logger['info'](_0x3abc('0x38'));}if(_[_0x3abc('0x39')](_0x4404d2[_0x3abc('0x20')])){return logger[_0x3abc('0xe')](_0x3abc('0x3a'));}var _0x356d85={'startDate':moment()['subtract'](_0x4404d2[_0x3abc('0x1f')],_0x4404d2['subtractUnit'])[_0x3abc('0x1b')](_0x3abc('0x3b')),'endDate':moment()[_0x3abc('0x1b')](_0x3abc('0x3b')),'type':'scheduled','output':_0x4404d2[_0x3abc('0x3c')],'name':_0x4404d2[_0x3abc('0x3d')]};if(!_[_0x3abc('0x39')](_0x4404d2[_0x3abc('0x3e')])){logger[_0x3abc('0xe')](_0x3abc('0x3f'),_0x4404d2[_0x3abc('0x3e')]);return analyticDefaultReportController[_0x3abc('0x40')]({'id':_0x4404d2['DefaultReportId']},_0x356d85)['then'](handleResult(_0x4404d2))['catch'](handleError());}if(!_[_0x3abc('0x39')](_0x4404d2[_0x3abc('0x41')])){logger['info'](_0x3abc('0x42'),_0x4404d2[_0x3abc('0x41')]);return analyticCustomReportController['runReport']({'id':_0x4404d2['CustomReportId']},_0x356d85)[_0x3abc('0x31')](handleResult(_0x4404d2))[_0x3abc('0x34')](handleError());}}catch(_0x454962){logger['error'](JSON['stringify'](_0x454962));}return logger[_0x3abc('0xe')](_0x3abc('0x43'));};}function getJobs(_0x162951){var _0x5ac4c7={};if(_0x162951){_0x5ac4c7['id']=_0x162951;}return db[_0x3abc('0x44')][_0x3abc('0x45')]({'where':_0x5ac4c7,'include':[{'model':db['MailAccount'],'attributes':['id',_0x3abc('0x3d'),_0x3abc('0x10')],'include':[{'model':db[_0x3abc('0x46')],'as':_0x3abc('0x12')}]}]})[_0x3abc('0x31')](function(_0x38f437){var _0x324149=_[_0x3abc('0x47')](manager[_0x3abc('0x48')]);var _0x297b7c=_[_0x3abc('0x49')](_0x38f437,function(_0x2041ea){return _0x2041ea['id'][_0x3abc('0x4a')]();});var _0x486040=_[_0x3abc('0x4b')](_0x38f437,function(_0x396c60){return _0x396c60['id']['toString']();});var _0x5d52c3=_0x162951?_0x297b7c:_[_0x3abc('0x4c')](_0x297b7c,_0x324149);var _0x587fbe=_[_0x3abc('0x4d')](_0x297b7c,_0x324149);var _0x364756=_['difference'](_0x324149,_0x297b7c);var _0x2c7085;var _0x2d28e2;for(_0x2c7085=0x0;_0x2c7085<_0x364756[_0x3abc('0x4e')]&&!_0x162951;_0x2c7085+=0x1){_0x2d28e2=_0x364756[_0x2c7085][_0x3abc('0x4a')]();if(manager['exists'](_0x2d28e2)){manager[_0x3abc('0x4f')](_0x2d28e2);manager[_0x3abc('0x50')](_0x2d28e2);logger[_0x3abc('0xe')](_0x3abc('0x51'),_0x2d28e2);}}logger[_0x3abc('0xe')](_0x3abc('0x52'),JSON[_0x3abc('0x36')](_0x5d52c3));for(_0x2c7085=0x0;_0x2c7085<_0x5d52c3['length'];_0x2c7085+=0x1){_0x2d28e2=_0x5d52c3[_0x2c7085][_0x3abc('0x4a')]();logger[_0x3abc('0xe')](_0x3abc('0x53'),_0x2d28e2);if(_0x162951){logger[_0x3abc('0xe')](_0x3abc('0x54'),_0x162951);logger[_0x3abc('0xe')](JSON[_0x3abc('0x36')](_0x486040[_0x2d28e2]));BPromise[_0x3abc('0x55')]()[_0x3abc('0x31')](handleJob(_0x486040[_0x2d28e2]));logger[_0x3abc('0xe')]('run\x20job',_0x486040[_0x2d28e2][_0x3abc('0x3d')],_0x486040[_0x2d28e2][_0x3abc('0x56')]);}else if(_0x486040[_0x2d28e2][_0x3abc('0x56')]&&_0x486040[_0x2d28e2][_0x3abc('0x57')]&&moment()['isBetween'](_0x486040[_0x2d28e2][_0x3abc('0x58')],_0x486040[_0x2d28e2]['endAt'])){manager[_0x3abc('0x59')](_0x2d28e2,_0x486040[_0x2d28e2][_0x3abc('0x56')],handleJob(_0x486040[_0x2d28e2]));manager[_0x3abc('0x5a')](_0x2d28e2);logger['info'](_0x3abc('0x5b'),_0x486040[_0x2d28e2][_0x3abc('0x3d')],_0x486040[_0x2d28e2][_0x3abc('0x56')]);}else if(manager[_0x3abc('0x5c')](_0x2d28e2)){manager['stop'](_0x2d28e2);manager['deleteJob'](_0x2d28e2);logger[_0x3abc('0xe')](_0x3abc('0x5d'),_0x486040[_0x2d28e2][_0x3abc('0x3d')],_0x486040[_0x2d28e2][_0x3abc('0x56')]);}}for(_0x2c7085=0x0,_0x2d28e2;_0x2c7085<_0x587fbe[_0x3abc('0x4e')]&&!_0x162951;_0x2c7085+=0x1){_0x2d28e2=_0x587fbe[_0x2c7085]['toString']();if(manager['exists'](_0x2d28e2)){if(_0x486040[_0x2d28e2]['cron']&&_0x486040[_0x2d28e2][_0x3abc('0x57')]&&moment()[_0x3abc('0x5e')](_0x486040[_0x2d28e2]['startAt'],_0x486040[_0x2d28e2][_0x3abc('0x5f')])){manager[_0x3abc('0x60')](_0x2d28e2,_0x486040[_0x2d28e2][_0x3abc('0x56')],handleJob(_0x486040[_0x2d28e2]));logger[_0x3abc('0xe')]('update\x20cron',_0x486040[_0x2d28e2][_0x3abc('0x3d')],_0x486040[_0x2d28e2][_0x3abc('0x56')]);}else{manager[_0x3abc('0x4f')](_0x2d28e2);manager[_0x3abc('0x50')](_0x2d28e2);logger['info'](_0x3abc('0x5d'),_0x486040[_0x2d28e2][_0x3abc('0x3d')],_0x486040[_0x2d28e2][_0x3abc('0x56')]);}}}})[_0x3abc('0x34')](function(_0x10041b){logger[_0x3abc('0x32')](JSON[_0x3abc('0x36')](_0x10041b));});}exports[_0x3abc('0x61')]=function(_0x23be1c){return getJobs(_0x23be1c);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index a6689da..762be53 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4148=['util','push','Innocenzo','innocenzo.biondo','@xcally.com','now','Biondo','CmContact','bulkCreate','then','log','finished\x20populating','CmHopper','destroy','contacts2','hopper2','catch'];(function(_0x13e792,_0x34f752){var _0x24fc08=function(_0x43601d){while(--_0x43601d){_0x13e792['push'](_0x13e792['shift']());}};_0x24fc08(++_0x34f752);}(_0x4148,0x1cb));var _0x8414=function(_0x2d5678,_0xdfb48f){_0x2d5678=_0x2d5678-0x0;var _0x4ad11a=_0x4148[_0x2d5678];return _0x4ad11a;};'use strict';var util=require(_0x8414('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x8414('0x1')]({'id':i,'firstName':_0x8414('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x8414('0x3')+i+_0x8414('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x8414('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x8414('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x8414('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x8414('0x1')]({'id':i,'firstName':_0x8414('0x2')+i,'lastName':_0x8414('0x6')+i,'phone':0xf879fb460+i,'email':_0x8414('0x3')+i+_0x8414('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x8414('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x8414('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x8414('0x5')](),'updatedAt':Date[_0x8414('0x5')]()});}db[_0x8414('0x7')]['destroy']({'where':{}})['then'](function(){return db['CmContact'][_0x8414('0x8')](contacts);})[_0x8414('0x9')](function(){console[_0x8414('0xa')](_0x8414('0xb'),'contacts1');return db[_0x8414('0xc')][_0x8414('0xd')]({'where':{}});})[_0x8414('0x9')](function(){return db['CmHopper']['bulkCreate'](hopper);})[_0x8414('0x9')](function(){console[_0x8414('0xa')]('finished\x20populating','hopper1');return db[_0x8414('0x7')][_0x8414('0x8')](contacts2);})[_0x8414('0x9')](function(){console['log'](_0x8414('0xb'),_0x8414('0xe'));return db[_0x8414('0xc')][_0x8414('0x8')](hopper2);})['then'](function(){console['log']('finished\x20populating',_0x8414('0xf'));})[_0x8414('0x10')](function(_0xd9be30){console[_0x8414('0xa')](_0xd9be30);}); \ No newline at end of file +var _0x9606=['hopper1','contacts2','hopper2','util','../mysqldb','push','Biondo','innocenzo.biondo','@xcally.com','now','Innocenzo','CmContact','destroy','finished\x20populating','contacts1','CmHopper','then','bulkCreate','log'];(function(_0x4a75ae,_0x1a9b88){var _0x36fbd7=function(_0x25464d){while(--_0x25464d){_0x4a75ae['push'](_0x4a75ae['shift']());}};_0x36fbd7(++_0x1a9b88);}(_0x9606,0x9b));var _0x6960=function(_0x11ee8a,_0x24cc68){_0x11ee8a=_0x11ee8a-0x0;var _0x37581c=_0x9606[_0x11ee8a];return _0x37581c;};'use strict';var util=require(_0x6960('0x0'));var db=require(_0x6960('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x6960('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x6960('0x3')+i,'phone':0xf879fb460+i,'email':_0x6960('0x4')+i+_0x6960('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x6960('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x6960('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x6960('0x6')](),'updatedAt':Date[_0x6960('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x6960('0x2')]({'id':i,'firstName':_0x6960('0x7')+i,'lastName':_0x6960('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x6960('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x6960('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x6960('0x6')](),'updatedAt':Date[_0x6960('0x6')]()});}db[_0x6960('0x8')][_0x6960('0x9')]({'where':{}})['then'](function(){return db[_0x6960('0x8')]['bulkCreate'](contacts);})['then'](function(){console['log'](_0x6960('0xa'),_0x6960('0xb'));return db[_0x6960('0xc')][_0x6960('0x9')]({'where':{}});})[_0x6960('0xd')](function(){return db[_0x6960('0xc')][_0x6960('0xe')](hopper);})[_0x6960('0xd')](function(){console[_0x6960('0xf')](_0x6960('0xa'),_0x6960('0x10'));return db['CmContact'][_0x6960('0xe')](contacts2);})['then'](function(){console['log'](_0x6960('0xa'),_0x6960('0x11'));return db['CmHopper'][_0x6960('0xe')](hopper2);})['then'](function(){console[_0x6960('0xf')](_0x6960('0xa'),_0x6960('0x12'));})['catch'](function(_0x26829c){console['log'](_0x26829c);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index de70c22..ad5f34f 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf418=['catch','util','../mysqldb','push','%s%s','format','agent','password','friend','udp','yes','/etc/pki/tls/certs/motion.crt','User','log'];(function(_0x14e202,_0x206725){var _0x2036aa=function(_0x34b93b){while(--_0x34b93b){_0x14e202['push'](_0x14e202['shift']());}};_0x2036aa(++_0x206725);}(_0xf418,0x143));var _0x8f41=function(_0x44e904,_0x3884cc){_0x44e904=_0x44e904-0x0;var _0x51c632=_0xf418[_0x44e904];return _0x51c632;};'use strict';var util=require(_0x8f41('0x0'));var db=require(_0x8f41('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x8f41('0x2')]({'name':util['format'](_0x8f41('0x3'),'agent',i),'fullname':util[_0x8f41('0x4')](_0x8f41('0x3'),_0x8f41('0x5'),i),'email':util['format']('%s%s@xcally.com',_0x8f41('0x5'),i),'role':_0x8f41('0x5'),'password':_0x8f41('0x6'),'internal':0xfa0+i,'type':_0x8f41('0x7'),'transport':[_0x8f41('0x8'),'ws','wss'],'disallow':['all'],'allow':['ulaw'],'defaultuser':util['format'](_0x8f41('0x3'),_0x8f41('0x5'),i),'encryption':_0x8f41('0x9'),'avpf':_0x8f41('0x9'),'force_avp':_0x8f41('0x9'),'icesupport':'yes','dtlsenable':_0x8f41('0x9'),'dtlsverify':'no','dtlscertfile':_0x8f41('0xa'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':'actpass','callerid':util['format']('\x22%s\x22\x20<%s>',util[_0x8f41('0x4')](_0x8f41('0x3'),_0x8f41('0x5'),i),0xfa0+i)});}db[_0x8f41('0xb')]['bulkCreate'](users)['then'](function(){console[_0x8f41('0xc')]('add\x20user');})[_0x8f41('0xd')](function(_0x2d8496){console[_0x8f41('0xc')](_0x2d8496);}); \ No newline at end of file +var _0x6993=['ulaw','yes','/etc/pki/tls/private/motion.key','actpass','User','then','log','add\x20user','catch','util','../mysqldb','push','%s%s','agent','format','%s%s@xcally.com','password','friend','udp','wss','all'];(function(_0x1cc961,_0x2c42ee){var _0x471d86=function(_0x44e422){while(--_0x44e422){_0x1cc961['push'](_0x1cc961['shift']());}};_0x471d86(++_0x2c42ee);}(_0x6993,0xb1));var _0x3699=function(_0xf168d3,_0x43dcfc){_0xf168d3=_0xf168d3-0x0;var _0x17fb54=_0x6993[_0xf168d3];return _0x17fb54;};'use strict';var util=require(_0x3699('0x0'));var db=require(_0x3699('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x3699('0x2')]({'name':util['format'](_0x3699('0x3'),'agent',i),'fullname':util['format'](_0x3699('0x3'),_0x3699('0x4'),i),'email':util[_0x3699('0x5')](_0x3699('0x6'),_0x3699('0x4'),i),'role':'agent','password':_0x3699('0x7'),'internal':0xfa0+i,'type':_0x3699('0x8'),'transport':[_0x3699('0x9'),'ws',_0x3699('0xa')],'disallow':[_0x3699('0xb')],'allow':[_0x3699('0xc')],'defaultuser':util[_0x3699('0x5')](_0x3699('0x3'),'agent',i),'encryption':_0x3699('0xd'),'avpf':'yes','force_avp':_0x3699('0xd'),'icesupport':_0x3699('0xd'),'dtlsenable':_0x3699('0xd'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0x3699('0xe'),'dtlssetup':_0x3699('0xf'),'callerid':util['format']('\x22%s\x22\x20<%s>',util[_0x3699('0x5')](_0x3699('0x3'),_0x3699('0x4'),i),0xfa0+i)});}db[_0x3699('0x10')]['bulkCreate'](users)[_0x3699('0x11')](function(){console[_0x3699('0x12')](_0x3699('0x13'));})[_0x3699('0x14')](function(_0x24a1b6){console[_0x3699('0x12')](_0x24a1b6);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 6121aed..11b18ce 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xae3a=['find','userProfileId','query','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','ChatQueue','OpenchannelQueue','FaxQueue','MailQueue','OpenchannelQueues','Trunk','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getOpenchannelQueues','all','length','chat','fax','sms','openchannel','telephone:%s','trunk:%s','removeChatInteractions','emit','user_has_chat_interactions:remove','leave','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','catch','log','join','default','request','connection','remoteAddress','connectedAt','SocketIO\x20','address','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','Agents','User','role','agent','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','findAll','Telephones','Trunks','IvrCampaigns','resourceId','map','where','telephone','Campaign','format','%s:queue:%s','user:%s','handshake'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xae3a,0xf8));var _0xaae3=function(_0x321728,_0x1fbc48){_0x321728=_0x321728-0x0;var _0x211876=_0xae3a[_0x321728];return _0x211876;};'use strict';var _=require(_0xaae3('0x0'));var util=require(_0xaae3('0x1'));var BPromise=require(_0xaae3('0x2'));var db=require(_0xaae3('0x3'))['db'];var config=require(_0xaae3('0x4'));var queryQueues={'attributes':['id',_0xaae3('0x5')],'include':[{'as':_0xaae3('0x6'),'model':db[_0xaae3('0x7')],'attributes':['id','name',_0xaae3('0x8')],'raw':!![],'where':{'role':_0xaae3('0x9')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xaae3('0x5')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0xaae3('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0xaae3('0x5')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0xaae3('0xa')],'where':{'type':_0xaae3('0xb')}};function getAssociatedResources(_0x373558,_0x313453,_0xd6868a){return db[_0xaae3('0xc')][_0xaae3('0xd')]({'where':{'name':_0x373558,'userProfileId':_0x313453},'raw':!![]})[_0xaae3('0xe')](function(_0x1912b2){if(_0x1912b2){if(_0x1912b2[_0xaae3('0xf')]){switch(_0x373558){case _0xaae3('0x10'):case _0xaae3('0x11'):case _0xaae3('0x12'):case _0xaae3('0x13'):case _0xaae3('0x14'):case'OpenchannelQueues':return db[_0xd6868a][_0xaae3('0x15')](queryQueues);case _0xaae3('0x16'):return db[_0xd6868a][_0xaae3('0x15')](queryTelephones);case _0xaae3('0x17'):return db[_0xd6868a][_0xaae3('0x15')](queryTrunks);case _0xaae3('0x18'):return db[_0xd6868a][_0xaae3('0x15')](queryCampaigns);}}else{return db['UserProfileResource'][_0xaae3('0x15')]({'attributes':[_0xaae3('0x19')],'where':{'sectionId':_0x1912b2['id']},'raw':!![]})['then'](function(_0x5dbe6e){if(_0x5dbe6e){var _0xcde6f={'where':{'id':_[_0xaae3('0x1a')](_0x5dbe6e,_0xaae3('0x19'))},'raw':!![]};switch(_0xd6868a){case _0xaae3('0x7'):_0xcde6f[_0xaae3('0x1b')][_0xaae3('0x8')]=_0xaae3('0x1c');break;case _0xaae3('0x1d'):_0xcde6f['where'][_0xaae3('0xa')]=_0xaae3('0xb');break;}return db[_0xd6868a][_0xaae3('0x15')](_0xcde6f);}else{return[];}});}}else{return[];}})[_0xaae3('0xe')](function(_0x3d4cab){return _0x3d4cab;});}function joinOrLeaveQueues(_0x902e72,_0x29a583,_0x2cd4b0,_0x5466c9){_0x902e72[_0x29a583](util[_0xaae3('0x1e')](_0xaae3('0x1f'),_0x2cd4b0,_0x5466c9[_0xaae3('0x5')]));if(_0x5466c9['Agents']){for(var _0x40ebc5=0x0;_0x40ebc5<_0x5466c9[_0xaae3('0x6')]['length'];_0x40ebc5+=0x1){_0x902e72[_0x29a583](util['format'](_0xaae3('0x20'),_0x5466c9['Agents'][_0x40ebc5][_0xaae3('0x5')]));}}}function joinOrLeave(_0x550d0a,_0x4e4db7,_0x52a8fa){var _0x3c7ff3;if(_0x550d0a[_0xaae3('0x21')]['query']['id']){db[_0xaae3('0x7')][_0xaae3('0x22')]({'attributes':['id',_0xaae3('0x5'),_0xaae3('0x8'),_0xaae3('0x23')],'where':{'id':_0x550d0a['handshake'][_0xaae3('0x24')]['id']},'include':[{'model':db[_0xaae3('0x25')],'as':_0xaae3('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0xaae3('0x27')],'as':_0xaae3('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0xaae3('0x29')],'as':_0xaae3('0x2a'),'attributes':['id'],'raw':!![]},{'model':db[_0xaae3('0x2b')],'as':_0xaae3('0x2c'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]}]})[_0xaae3('0xe')](function(_0x490222){if(_0x490222){_0x3c7ff3=_0x490222;_0x550d0a[_0x4e4db7](util['format'](_0xaae3('0x20'),_0x490222[_0xaae3('0x5')]));var _0x221073=[];switch(_0x490222[_0xaae3('0x8')]){case _0xaae3('0x2d'):_0x550d0a[_0x4e4db7](_0xaae3('0x2e'));_0x550d0a[_0x4e4db7](_0xaae3('0x2f'));if(queryQueues[_0xaae3('0x30')](_0xaae3('0x31'))){delete queryQueues['include'];}_0x221073['push'](db['VoiceQueue'][_0xaae3('0x15')](queryQueues));_0x221073[_0xaae3('0x32')](db[_0xaae3('0x33')][_0xaae3('0x15')](queryQueues));_0x221073[_0xaae3('0x32')](db['FaxQueue'][_0xaae3('0x15')](queryQueues));_0x221073[_0xaae3('0x32')](db['SmsQueue'][_0xaae3('0x15')](queryQueues));_0x221073[_0xaae3('0x32')](db['MailQueue']['findAll'](queryQueues));_0x221073[_0xaae3('0x32')](db[_0xaae3('0x34')][_0xaae3('0x15')](queryQueues));_0x221073[_0xaae3('0x32')](db[_0xaae3('0x7')][_0xaae3('0x15')](queryTelephones));_0x221073[_0xaae3('0x32')](db['Trunk'][_0xaae3('0x15')](queryTrunks));_0x221073['push'](db[_0xaae3('0x1d')][_0xaae3('0x15')](queryCampaigns));_0x221073[_0xaae3('0x32')](db['User']['findAll'](queryAgents));break;case'user':_0x550d0a[_0x4e4db7](_0xaae3('0x2e'));_0x550d0a[_0x4e4db7](_0xaae3('0x2f'));_0x221073[_0xaae3('0x32')](getAssociatedResources(_0xaae3('0x10'),_0x490222[_0xaae3('0x23')],'VoiceQueue'));_0x221073[_0xaae3('0x32')](getAssociatedResources(_0xaae3('0x11'),_0x490222[_0xaae3('0x23')],'ChatQueue'));_0x221073['push'](getAssociatedResources('FaxQueues',_0x490222[_0xaae3('0x23')],_0xaae3('0x35')));_0x221073[_0xaae3('0x32')](getAssociatedResources(_0xaae3('0x13'),_0x490222[_0xaae3('0x23')],'SmsQueue'));_0x221073[_0xaae3('0x32')](getAssociatedResources(_0xaae3('0x14'),_0x490222[_0xaae3('0x23')],_0xaae3('0x36')));_0x221073['push'](getAssociatedResources(_0xaae3('0x37'),_0x490222[_0xaae3('0x23')],_0xaae3('0x34')));_0x221073[_0xaae3('0x32')](getAssociatedResources(_0xaae3('0x16'),_0x490222[_0xaae3('0x23')],_0xaae3('0x7')));_0x221073[_0xaae3('0x32')](getAssociatedResources(_0xaae3('0x17'),_0x490222[_0xaae3('0x23')],_0xaae3('0x38')));_0x221073[_0xaae3('0x32')](getAssociatedResources(_0xaae3('0x18'),_0x490222[_0xaae3('0x23')],'Campaign'));_0x221073[_0xaae3('0x32')](db['User'][_0xaae3('0x15')](queryAgents));break;case _0xaae3('0x9'):_0x550d0a[_0x4e4db7](_0xaae3('0x2e'));_0x550d0a[_0x4e4db7](_0xaae3('0x2f'));_0x221073[_0xaae3('0x32')](_0x490222[_0xaae3('0x39')]({'attributes':['id',_0xaae3('0x5')]}));_0x221073['push'](_0x490222[_0xaae3('0x3a')]({'attributes':['id','name']}));_0x221073[_0xaae3('0x32')](_0x490222[_0xaae3('0x3b')]({'attributes':['id',_0xaae3('0x5')]}));_0x221073['push'](_0x490222[_0xaae3('0x3c')]({'attributes':['id','name']}));_0x221073['push'](_0x490222['getMailQueues']({'attributes':['id','name']}));_0x221073[_0xaae3('0x32')](_0x490222[_0xaae3('0x3d')]({'attributes':['id',_0xaae3('0x5')]}));break;}return BPromise[_0xaae3('0x3e')](_0x221073);}})[_0xaae3('0xe')](function(_0x10905a){if(_0x10905a&&_0x10905a['length']){for(var _0x55d059=0x0;_0x55d059<_0x10905a[_0xaae3('0x3f')];_0x55d059+=0x1){for(var _0x50209a=0x0;_0x50209a<_0x10905a[_0x55d059][_0xaae3('0x3f')];_0x50209a+=0x1){switch(_0x55d059){case 0x0:joinOrLeaveQueues(_0x550d0a,_0x4e4db7,'voice',_0x10905a[_0x55d059][_0x50209a]);break;case 0x1:joinOrLeaveQueues(_0x550d0a,_0x4e4db7,_0xaae3('0x40'),_0x10905a[_0x55d059][_0x50209a]);break;case 0x2:joinOrLeaveQueues(_0x550d0a,_0x4e4db7,_0xaae3('0x41'),_0x10905a[_0x55d059][_0x50209a]);break;case 0x3:joinOrLeaveQueues(_0x550d0a,_0x4e4db7,_0xaae3('0x42'),_0x10905a[_0x55d059][_0x50209a]);break;case 0x4:joinOrLeaveQueues(_0x550d0a,_0x4e4db7,'mail',_0x10905a[_0x55d059][_0x50209a]);break;case 0x5:joinOrLeaveQueues(_0x550d0a,_0x4e4db7,_0xaae3('0x43'),_0x10905a[_0x55d059][_0x50209a]);break;case 0x6:_0x550d0a[_0x4e4db7](util[_0xaae3('0x1e')](_0xaae3('0x44'),_0x10905a[_0x55d059][_0x50209a][_0xaae3('0x5')]));break;case 0x7:_0x550d0a[_0x4e4db7](util[_0xaae3('0x1e')](_0xaae3('0x45'),_0x10905a[_0x55d059][_0x50209a][_0xaae3('0x5')]));break;case 0x8:_0x550d0a[_0x4e4db7](util[_0xaae3('0x1e')]('campaign:%s:%s',_0x10905a[_0x55d059][_0x50209a]['type'],_0x10905a[_0x55d059][_0x50209a][_0xaae3('0x5')]));break;case 0x9:_0x550d0a[_0x4e4db7](util[_0xaae3('0x1e')](_0xaae3('0x20'),_0x10905a[_0x55d059][_0x50209a][_0xaae3('0x5')]));break;}}}}})[_0xaae3('0xe')](function(){if(_0x4e4db7==='leave'){var _0x2a9ccf=_[_0xaae3('0x1a')](_0x3c7ff3[_0xaae3('0x26')],'id');return _0x3c7ff3[_0xaae3('0x46')](_0x2a9ccf)[_0xaae3('0xe')](function(){for(var _0x17859d=0x0;_0x17859d<_0x2a9ccf[_0xaae3('0x3f')];_0x17859d+=0x1){_0x52a8fa[_0xaae3('0x47')](_0xaae3('0x48'),{'ChatInteractionId':Number(_0x2a9ccf[_0x17859d]),'UserId':Number(_0x3c7ff3['id'])});}});}})['then'](function(){if(_0x4e4db7===_0xaae3('0x49')){var _0x5f31e6=_[_0xaae3('0x1a')](_0x3c7ff3[_0xaae3('0x28')],'id');return _0x3c7ff3[_0xaae3('0x4a')](_0x5f31e6)['then'](function(){for(var _0x42fabd=0x0;_0x42fabd<_0x5f31e6[_0xaae3('0x3f')];_0x42fabd+=0x1){_0x52a8fa[_0xaae3('0x47')](_0xaae3('0x4b'),{'MailInteractionId':Number(_0x5f31e6[_0x42fabd]),'UserId':Number(_0x3c7ff3['id'])});}});}})[_0xaae3('0xe')](function(){if(_0x4e4db7===_0xaae3('0x49')){var _0x445862=_[_0xaae3('0x1a')](_0x3c7ff3[_0xaae3('0x2a')],'id');return _0x3c7ff3[_0xaae3('0x4c')](_0x445862)[_0xaae3('0xe')](function(){for(var _0x1a93da=0x0;_0x1a93da<_0x445862['length'];_0x1a93da+=0x1){_0x52a8fa[_0xaae3('0x47')](_0xaae3('0x4d'),{'FaxInteractionId':Number(_0x445862[_0x1a93da]),'UserId':Number(_0x3c7ff3['id'])});}});}})[_0xaae3('0xe')](function(){if(_0x4e4db7===_0xaae3('0x49')){var _0xee400a=_[_0xaae3('0x1a')](_0x3c7ff3[_0xaae3('0x2c')],'id');return _0x3c7ff3[_0xaae3('0x4e')](_0xee400a)[_0xaae3('0xe')](function(){for(var _0x136052=0x0;_0x136052<_0xee400a[_0xaae3('0x3f')];_0x136052+=0x1){_0x52a8fa[_0xaae3('0x47')](_0xaae3('0x4f'),{'SmsInteractionId':Number(_0xee400a[_0x136052]),'UserId':Number(_0x3c7ff3['id'])});}});}})[_0xaae3('0xe')](function(){if(_0x4e4db7===_0xaae3('0x49')){var _0x524f28=_[_0xaae3('0x1a')](_0x3c7ff3['OpenchannelInteractions'],'id');return _0x3c7ff3[_0xaae3('0x50')](_0x524f28)[_0xaae3('0xe')](function(){for(var _0x252790=0x0;_0x252790<_0x524f28['length'];_0x252790+=0x1){_0x52a8fa[_0xaae3('0x47')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x524f28[_0x252790]),'UserId':Number(_0x3c7ff3['id'])});}});}})[_0xaae3('0x51')](function(_0x48ac8f){_0x550d0a[_0xaae3('0x52')](_0x48ac8f);});}}function onDisconnect(_0x134f06,_0x4f89cc){joinOrLeave(_0x134f06,_0xaae3('0x49'),_0x4f89cc);}function onConnect(_0x36b38f){joinOrLeave(_0x36b38f,_0xaae3('0x53'));}exports[_0xaae3('0x54')]=function(_0x2d73a9){_0x2d73a9['on']('connection',function(_0x25011e){_0x25011e['setMaxListeners'](0x0);_0x25011e['address']=_0x25011e[_0xaae3('0x55')][_0xaae3('0x56')][_0xaae3('0x57')]+':'+_0x25011e['request'][_0xaae3('0x56')]['remotePort'];_0x25011e[_0xaae3('0x58')]=new Date();_0x25011e[_0xaae3('0x52')]=function(_0x52449b){console[_0xaae3('0x52')](_0xaae3('0x59')+_0x25011e['nsp'][_0xaae3('0x5')]+'['+_0x25011e[_0xaae3('0x5a')]+']',_0x52449b);};_0x25011e['on'](_0xaae3('0x5b'),function(){onDisconnect(_0x25011e,_0x2d73a9);_0x25011e['log'](_0xaae3('0x5c'));});onConnect(_0x25011e);_0x25011e[_0xaae3('0x52')](_0xaae3('0x5d'));});}; \ No newline at end of file +var _0x6e02=['user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','catch','log','join','default','connection','setMaxListeners','request','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','lodash','util','../mysqldb','name','Agents','role','telephone','agent','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','FaxQueues','SmsQueues','MailQueues','findAll','Telephones','IvrCampaigns','UserProfileResource','resourceId','map','User','where','Campaign','format','%s:queue:%s','user:%s','handshake','query','find','userProfileId','ChatInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','FaxQueue','MailQueue','Trunk','VoiceQueue','ChatQueues','ChatQueue','Trunks','getVoiceQueues','getChatQueues','getSmsQueues','getMailQueues','all','length','chat','fax','sms','mail','telephone:%s','trunk:%s','leave','ChatInteractions','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','user_has_fax_interactions:remove','removeSmsInteractions'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x6e02,0x120));var _0x26e0=function(_0x45dafa,_0x171e29){_0x45dafa=_0x45dafa-0x0;var _0xeb385a=_0x6e02[_0x45dafa];return _0xeb385a;};'use strict';var _=require(_0x26e0('0x0'));var util=require(_0x26e0('0x1'));var BPromise=require('bluebird');var db=require(_0x26e0('0x2'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0x26e0('0x3')],'include':[{'as':_0x26e0('0x4'),'model':db['User'],'attributes':['id','name',_0x26e0('0x5')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x26e0('0x3')],'where':{'role':_0x26e0('0x6')}};var queryTrunks={'raw':!![],'attributes':['id',_0x26e0('0x3')]};var queryAgents={'raw':!![],'attributes':['id',_0x26e0('0x3')],'where':{'role':_0x26e0('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x26e0('0x3'),_0x26e0('0x8')],'where':{'type':_0x26e0('0x9')}};function getAssociatedResources(_0x35d015,_0x4a25a6,_0x4ea99e){return db[_0x26e0('0xa')][_0x26e0('0xb')]({'where':{'name':_0x35d015,'userProfileId':_0x4a25a6},'raw':!![]})[_0x26e0('0xc')](function(_0x423e5a){if(_0x423e5a){if(_0x423e5a[_0x26e0('0xd')]){switch(_0x35d015){case _0x26e0('0xe'):case'ChatQueues':case _0x26e0('0xf'):case _0x26e0('0x10'):case _0x26e0('0x11'):case'OpenchannelQueues':return db[_0x4ea99e][_0x26e0('0x12')](queryQueues);case _0x26e0('0x13'):return db[_0x4ea99e][_0x26e0('0x12')](queryTelephones);case'Trunks':return db[_0x4ea99e][_0x26e0('0x12')](queryTrunks);case _0x26e0('0x14'):return db[_0x4ea99e][_0x26e0('0x12')](queryCampaigns);}}else{return db[_0x26e0('0x15')][_0x26e0('0x12')]({'attributes':[_0x26e0('0x16')],'where':{'sectionId':_0x423e5a['id']},'raw':!![]})[_0x26e0('0xc')](function(_0x374218){if(_0x374218){var _0x288d24={'where':{'id':_[_0x26e0('0x17')](_0x374218,_0x26e0('0x16'))},'raw':!![]};switch(_0x4ea99e){case _0x26e0('0x18'):_0x288d24[_0x26e0('0x19')][_0x26e0('0x5')]='telephone';break;case _0x26e0('0x1a'):_0x288d24[_0x26e0('0x19')][_0x26e0('0x8')]='ivr';break;}return db[_0x4ea99e]['findAll'](_0x288d24);}else{return[];}});}}else{return[];}})['then'](function(_0x59ff94){return _0x59ff94;});}function joinOrLeaveQueues(_0x392721,_0x58f170,_0x1637f7,_0xfac150){_0x392721[_0x58f170](util[_0x26e0('0x1b')](_0x26e0('0x1c'),_0x1637f7,_0xfac150[_0x26e0('0x3')]));if(_0xfac150[_0x26e0('0x4')]){for(var _0x51b7be=0x0;_0x51b7be<_0xfac150[_0x26e0('0x4')]['length'];_0x51b7be+=0x1){_0x392721[_0x58f170](util[_0x26e0('0x1b')](_0x26e0('0x1d'),_0xfac150[_0x26e0('0x4')][_0x51b7be]['name']));}}}function joinOrLeave(_0x21043d,_0x35383c,_0x3a48a7){var _0x31be44;if(_0x21043d[_0x26e0('0x1e')][_0x26e0('0x1f')]['id']){db[_0x26e0('0x18')][_0x26e0('0x20')]({'attributes':['id',_0x26e0('0x3'),'role',_0x26e0('0x21')],'where':{'id':_0x21043d[_0x26e0('0x1e')]['query']['id']},'include':[{'model':db[_0x26e0('0x22')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0x26e0('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x26e0('0x24')],'as':_0x26e0('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x26e0('0x26')],'as':_0x26e0('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x26e0('0x28')],'as':_0x26e0('0x29'),'attributes':['id'],'raw':!![]}]})[_0x26e0('0xc')](function(_0x1d8195){if(_0x1d8195){_0x31be44=_0x1d8195;_0x21043d[_0x35383c](util['format'](_0x26e0('0x1d'),_0x1d8195['name']));var _0xfdc70e=[];switch(_0x1d8195[_0x26e0('0x5')]){case _0x26e0('0x2a'):_0x21043d[_0x35383c](_0x26e0('0x2b'));_0x21043d[_0x35383c](_0x26e0('0x2c'));if(queryQueues[_0x26e0('0x2d')](_0x26e0('0x2e'))){delete queryQueues[_0x26e0('0x2e')];}_0xfdc70e['push'](db['VoiceQueue']['findAll'](queryQueues));_0xfdc70e['push'](db['ChatQueue'][_0x26e0('0x12')](queryQueues));_0xfdc70e[_0x26e0('0x2f')](db[_0x26e0('0x30')][_0x26e0('0x12')](queryQueues));_0xfdc70e['push'](db['SmsQueue'][_0x26e0('0x12')](queryQueues));_0xfdc70e[_0x26e0('0x2f')](db[_0x26e0('0x31')][_0x26e0('0x12')](queryQueues));_0xfdc70e[_0x26e0('0x2f')](db['OpenchannelQueue'][_0x26e0('0x12')](queryQueues));_0xfdc70e[_0x26e0('0x2f')](db[_0x26e0('0x18')][_0x26e0('0x12')](queryTelephones));_0xfdc70e[_0x26e0('0x2f')](db[_0x26e0('0x32')][_0x26e0('0x12')](queryTrunks));_0xfdc70e[_0x26e0('0x2f')](db[_0x26e0('0x1a')][_0x26e0('0x12')](queryCampaigns));_0xfdc70e[_0x26e0('0x2f')](db[_0x26e0('0x18')]['findAll'](queryAgents));break;case'user':_0x21043d[_0x35383c]('voice:inbound');_0x21043d[_0x35383c](_0x26e0('0x2c'));_0xfdc70e[_0x26e0('0x2f')](getAssociatedResources('VoiceQueues',_0x1d8195['userProfileId'],_0x26e0('0x33')));_0xfdc70e[_0x26e0('0x2f')](getAssociatedResources(_0x26e0('0x34'),_0x1d8195[_0x26e0('0x21')],_0x26e0('0x35')));_0xfdc70e['push'](getAssociatedResources(_0x26e0('0xf'),_0x1d8195[_0x26e0('0x21')],_0x26e0('0x30')));_0xfdc70e[_0x26e0('0x2f')](getAssociatedResources(_0x26e0('0x10'),_0x1d8195[_0x26e0('0x21')],'SmsQueue'));_0xfdc70e[_0x26e0('0x2f')](getAssociatedResources('MailQueues',_0x1d8195['userProfileId'],'MailQueue'));_0xfdc70e[_0x26e0('0x2f')](getAssociatedResources('OpenchannelQueues',_0x1d8195[_0x26e0('0x21')],'OpenchannelQueue'));_0xfdc70e['push'](getAssociatedResources(_0x26e0('0x13'),_0x1d8195[_0x26e0('0x21')],_0x26e0('0x18')));_0xfdc70e[_0x26e0('0x2f')](getAssociatedResources(_0x26e0('0x36'),_0x1d8195['userProfileId'],_0x26e0('0x32')));_0xfdc70e[_0x26e0('0x2f')](getAssociatedResources('IvrCampaigns',_0x1d8195[_0x26e0('0x21')],'Campaign'));_0xfdc70e[_0x26e0('0x2f')](db[_0x26e0('0x18')][_0x26e0('0x12')](queryAgents));break;case _0x26e0('0x7'):_0x21043d[_0x35383c]('voice:inbound');_0x21043d[_0x35383c](_0x26e0('0x2c'));_0xfdc70e['push'](_0x1d8195[_0x26e0('0x37')]({'attributes':['id',_0x26e0('0x3')]}));_0xfdc70e['push'](_0x1d8195[_0x26e0('0x38')]({'attributes':['id',_0x26e0('0x3')]}));_0xfdc70e['push'](_0x1d8195['getFaxQueues']({'attributes':['id',_0x26e0('0x3')]}));_0xfdc70e['push'](_0x1d8195[_0x26e0('0x39')]({'attributes':['id','name']}));_0xfdc70e['push'](_0x1d8195[_0x26e0('0x3a')]({'attributes':['id',_0x26e0('0x3')]}));_0xfdc70e[_0x26e0('0x2f')](_0x1d8195['getOpenchannelQueues']({'attributes':['id',_0x26e0('0x3')]}));break;}return BPromise[_0x26e0('0x3b')](_0xfdc70e);}})['then'](function(_0x1390bb){if(_0x1390bb&&_0x1390bb['length']){for(var _0x2cd276=0x0;_0x2cd276<_0x1390bb[_0x26e0('0x3c')];_0x2cd276+=0x1){for(var _0x31f156=0x0;_0x31f156<_0x1390bb[_0x2cd276][_0x26e0('0x3c')];_0x31f156+=0x1){switch(_0x2cd276){case 0x0:joinOrLeaveQueues(_0x21043d,_0x35383c,'voice',_0x1390bb[_0x2cd276][_0x31f156]);break;case 0x1:joinOrLeaveQueues(_0x21043d,_0x35383c,_0x26e0('0x3d'),_0x1390bb[_0x2cd276][_0x31f156]);break;case 0x2:joinOrLeaveQueues(_0x21043d,_0x35383c,_0x26e0('0x3e'),_0x1390bb[_0x2cd276][_0x31f156]);break;case 0x3:joinOrLeaveQueues(_0x21043d,_0x35383c,_0x26e0('0x3f'),_0x1390bb[_0x2cd276][_0x31f156]);break;case 0x4:joinOrLeaveQueues(_0x21043d,_0x35383c,_0x26e0('0x40'),_0x1390bb[_0x2cd276][_0x31f156]);break;case 0x5:joinOrLeaveQueues(_0x21043d,_0x35383c,'openchannel',_0x1390bb[_0x2cd276][_0x31f156]);break;case 0x6:_0x21043d[_0x35383c](util[_0x26e0('0x1b')](_0x26e0('0x41'),_0x1390bb[_0x2cd276][_0x31f156]['name']));break;case 0x7:_0x21043d[_0x35383c](util[_0x26e0('0x1b')](_0x26e0('0x42'),_0x1390bb[_0x2cd276][_0x31f156][_0x26e0('0x3')]));break;case 0x8:_0x21043d[_0x35383c](util[_0x26e0('0x1b')]('campaign:%s:%s',_0x1390bb[_0x2cd276][_0x31f156][_0x26e0('0x8')],_0x1390bb[_0x2cd276][_0x31f156][_0x26e0('0x3')]));break;case 0x9:_0x21043d[_0x35383c](util['format']('user:%s',_0x1390bb[_0x2cd276][_0x31f156][_0x26e0('0x3')]));break;}}}}})[_0x26e0('0xc')](function(){if(_0x35383c===_0x26e0('0x43')){var _0xb7c719=_[_0x26e0('0x17')](_0x31be44[_0x26e0('0x44')],'id');return _0x31be44[_0x26e0('0x45')](_0xb7c719)['then'](function(){for(var _0x157700=0x0;_0x157700<_0xb7c719[_0x26e0('0x3c')];_0x157700+=0x1){_0x3a48a7[_0x26e0('0x46')](_0x26e0('0x47'),{'ChatInteractionId':Number(_0xb7c719[_0x157700]),'UserId':Number(_0x31be44['id'])});}});}})[_0x26e0('0xc')](function(){if(_0x35383c===_0x26e0('0x43')){var _0x3736d4=_[_0x26e0('0x17')](_0x31be44[_0x26e0('0x23')],'id');return _0x31be44[_0x26e0('0x48')](_0x3736d4)['then'](function(){for(var _0x3e26b2=0x0;_0x3e26b2<_0x3736d4[_0x26e0('0x3c')];_0x3e26b2+=0x1){_0x3a48a7[_0x26e0('0x46')](_0x26e0('0x49'),{'MailInteractionId':Number(_0x3736d4[_0x3e26b2]),'UserId':Number(_0x31be44['id'])});}});}})[_0x26e0('0xc')](function(){if(_0x35383c===_0x26e0('0x43')){var _0x2fe16e=_['map'](_0x31be44[_0x26e0('0x25')],'id');return _0x31be44['removeFaxInteractions'](_0x2fe16e)[_0x26e0('0xc')](function(){for(var _0x3c91ca=0x0;_0x3c91ca<_0x2fe16e['length'];_0x3c91ca+=0x1){_0x3a48a7[_0x26e0('0x46')](_0x26e0('0x4a'),{'FaxInteractionId':Number(_0x2fe16e[_0x3c91ca]),'UserId':Number(_0x31be44['id'])});}});}})['then'](function(){if(_0x35383c===_0x26e0('0x43')){var _0x55fa6b=_[_0x26e0('0x17')](_0x31be44[_0x26e0('0x27')],'id');return _0x31be44[_0x26e0('0x4b')](_0x55fa6b)['then'](function(){for(var _0x34d548=0x0;_0x34d548<_0x55fa6b['length'];_0x34d548+=0x1){_0x3a48a7[_0x26e0('0x46')](_0x26e0('0x4c'),{'SmsInteractionId':Number(_0x55fa6b[_0x34d548]),'UserId':Number(_0x31be44['id'])});}});}})[_0x26e0('0xc')](function(){if(_0x35383c===_0x26e0('0x43')){var _0x5b0312=_[_0x26e0('0x17')](_0x31be44[_0x26e0('0x29')],'id');return _0x31be44[_0x26e0('0x4d')](_0x5b0312)[_0x26e0('0xc')](function(){for(var _0x4f0562=0x0;_0x4f0562<_0x5b0312[_0x26e0('0x3c')];_0x4f0562+=0x1){_0x3a48a7[_0x26e0('0x46')](_0x26e0('0x4e'),{'OpenchannelInteractionId':Number(_0x5b0312[_0x4f0562]),'UserId':Number(_0x31be44['id'])});}});}})[_0x26e0('0x4f')](function(_0x233554){_0x21043d[_0x26e0('0x50')](_0x233554);});}}function onDisconnect(_0x44e4b7,_0x37a77b){joinOrLeave(_0x44e4b7,_0x26e0('0x43'),_0x37a77b);}function onConnect(_0x43c519){joinOrLeave(_0x43c519,_0x26e0('0x51'));}exports[_0x26e0('0x52')]=function(_0x5f2f57){_0x5f2f57['on'](_0x26e0('0x53'),function(_0x3cbfc0){_0x3cbfc0[_0x26e0('0x54')](0x0);_0x3cbfc0['address']=_0x3cbfc0['request'][_0x26e0('0x53')]['remoteAddress']+':'+_0x3cbfc0[_0x26e0('0x55')][_0x26e0('0x53')][_0x26e0('0x56')];_0x3cbfc0[_0x26e0('0x57')]=new Date();_0x3cbfc0[_0x26e0('0x50')]=function(_0x17efd4){console[_0x26e0('0x50')](_0x26e0('0x58')+_0x3cbfc0[_0x26e0('0x59')][_0x26e0('0x3')]+'['+_0x3cbfc0['address']+']',_0x17efd4);};_0x3cbfc0['on'](_0x26e0('0x5a'),function(){onDisconnect(_0x3cbfc0,_0x5f2f57);_0x3cbfc0[_0x26e0('0x50')]('DISCONNECTED');});onConnect(_0x3cbfc0);_0x3cbfc0[_0x26e0('0x50')]('CONNECTED');});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 424b4e8..62843d9 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 _0x129d=['OpenchannelInteraction','OpenchannelMessage','request','then','info','Trigger,\x20%s','error','code','EventManager','catch','get','channel','event','direction','UserId','User','find','interface','name','incomingmessage','outgoingmessage','opened','changed','closed','format','SIP/%s','hasOwnProperty','model','hook','toLowerCase','condition','util','../../mysqldb','jayson/promise','../logger','client','ChatInteraction','Chat','ChatMessage','afterCreate','newmessage','SmsInteraction','newinteraction','Sms','afterUpdate','closedinteraction','SmsMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x129d,0x163));var _0xd129=function(_0x54958e,_0x439c16){_0x54958e=_0x54958e-0x0;var _0x1d1c00=_0x129d[_0x54958e];return _0x1d1c00;};'use strict';var util=require(_0xd129('0x0'));var db=require(_0xd129('0x1'))['db'];var jayson=require(_0xd129('0x2'));var logger=require(_0xd129('0x3'))('triggers');var client=jayson[_0xd129('0x4')]['http']({'port':0x232a});var triggers=[{'channel':'Chat','model':_0xd129('0x5'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0xd129('0x6'),'model':'ChatInteraction','event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0xd129('0x6'),'model':_0xd129('0x7'),'event':_0xd129('0x8'),'condition':_0xd129('0x9'),'callback':afterCreateMessage},{'channel':'Sms','model':_0xd129('0xa'),'event':_0xd129('0x8'),'condition':_0xd129('0xb'),'callback':afterCreate},{'channel':_0xd129('0xc'),'model':_0xd129('0xa'),'event':_0xd129('0xd'),'condition':_0xd129('0xe'),'callback':afterUpdate},{'channel':'Sms','model':_0xd129('0xf'),'event':_0xd129('0x8'),'condition':_0xd129('0x9'),'callback':afterCreateMessage},{'channel':_0xd129('0x10'),'model':_0xd129('0x11'),'event':_0xd129('0x8'),'condition':_0xd129('0xb'),'callback':afterCreate},{'channel':_0xd129('0x10'),'model':_0xd129('0x11'),'event':_0xd129('0xd'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xd129('0x10'),'model':_0xd129('0x12'),'event':_0xd129('0x8'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0xd129('0x13'),'model':_0xd129('0x14'),'event':'afterCreate','condition':_0xd129('0xb'),'callback':afterCreate},{'channel':_0xd129('0x13'),'model':'MailInteraction','event':_0xd129('0xd'),'condition':_0xd129('0xe'),'callback':afterUpdate},{'channel':'Mail','model':_0xd129('0x15'),'event':_0xd129('0x8'),'condition':_0xd129('0x9'),'callback':afterCreateMessage},{'channel':_0xd129('0x16'),'model':_0xd129('0x17'),'event':_0xd129('0x8'),'condition':_0xd129('0xb'),'callback':afterCreate},{'channel':_0xd129('0x16'),'model':_0xd129('0x17'),'event':_0xd129('0xd'),'condition':_0xd129('0xe'),'callback':afterUpdate},{'channel':_0xd129('0x16'),'model':_0xd129('0x18'),'event':_0xd129('0x8'),'condition':_0xd129('0x9'),'callback':afterCreateMessage}];function request(_0x535354){return client[_0xd129('0x19')]('EventManager',_0x535354)[_0xd129('0x1a')](function(_0x5b1634){logger[_0xd129('0x1b')](_0xd129('0x1c'),'EventManager',_0x5b1634);if(_0x5b1634[_0xd129('0x1d')]){if(_0x5b1634[_0xd129('0x1d')][_0xd129('0x1e')]===0x1f4){logger[_0xd129('0x1d')]('Trigger,\x20%s',_0xd129('0x1f'),_0x5b1634[_0xd129('0x1d')]);}}})[_0xd129('0x20')](function(_0x5196be){logger[_0xd129('0x1d')]('Trigger,\x20%s',_0xd129('0x1f'),_0x5196be);});}function afterCreateMessage(_0x57b005,_0x203060){return function(_0x545c63,_0x376e8a){_0x545c63=_0x545c63[_0xd129('0x21')]({'plain':!![]});_0x545c63[_0xd129('0x22')]=_0x57b005;_0x545c63[_0xd129('0x23')]=_0x545c63[_0xd129('0x24')];if(_0x545c63[_0xd129('0x25')]){return db[_0xd129('0x26')][_0xd129('0x27')]({'where':{'id':_0x545c63['UserId']},'attributes':['id','name'],'raw':!![]})['then'](function(_0x5a12b5){_0x545c63[_0xd129('0x28')]=util['format']('SIP/%s',_0x5a12b5[_0xd129('0x29')]);_0x545c63[_0xd129('0x22')]=_0x57b005;return request({'event':_0xd129('0x2a'),'message':_0x545c63});})[_0xd129('0x20')](function(_0x5bfe22){console[_0xd129('0x1d')](_0x5bfe22);});}else{return request({'event':_0xd129('0x2b'),'message':_0x545c63});}};}function afterCreate(_0x4a1322,_0x674f47){return function(_0x531fbf,_0xf8db94){_0x531fbf=_0x531fbf['get']({'plain':!![]});_0x531fbf['channel']=_0x4a1322;_0x531fbf[_0xd129('0x23')]=_0xd129('0x2c');return request({'event':_0x674f47,'message':_0x531fbf});};}function afterUpdate(_0x491d4c,_0x1fc786){return function(_0xd41e43,_0x4db42b){if(_0xd41e43[_0xd129('0x2d')]('closed')&&_0xd41e43[_0xd129('0x2e')]){_0xd41e43=_0xd41e43['get']({'plain':!![]});_0xd41e43[_0xd129('0x22')]=_0x491d4c;_0xd41e43[_0xd129('0x23')]='closed';if(_0xd41e43[_0xd129('0x25')]){return db[_0xd129('0x26')]['find']({'where':{'id':_0xd41e43[_0xd129('0x25')]},'attributes':['id',_0xd129('0x29')],'raw':!![]})['then'](function(_0xcff7ac){_0xd41e43['interface']=util[_0xd129('0x2f')](_0xd129('0x30'),_0xcff7ac[_0xd129('0x29')]);return request({'event':_0x1fc786,'message':_0xd41e43});})['catch'](function(_0x477953){console[_0xd129('0x1d')](_0x477953);});}else{return request({'event':_0x1fc786,'message':_0xd41e43});}}};}exports['default']=function(){for(var _0x4703f8=0x0;_0x4703f8=_0x82ff5f[_0x1ee7('0x10')]){throw Error(_0x1ee7('0x11'));}_0x50867f(_0x2a3943);})[_0x1ee7('0x12')](function(_0x5b875f){_0x4071dd(_0x5b875f);});});}; \ No newline at end of file +var _0xab99=['updateAttributes','User','count','agent','then','agents','lodash','bluebird','../mysqldb','./license/util','voice','mail','chat','fax','sms','isValidChannel','toLowerCase','clearBlockUser','blockedAt'];(function(_0xb23ce0,_0xd3041f){var _0xc7f719=function(_0x2b9cd2){while(--_0x2b9cd2){_0xb23ce0['push'](_0xb23ce0['shift']());}};_0xc7f719(++_0xd3041f);}(_0xab99,0x16f));var _0x9ab9=function(_0x2f34be,_0x211388){_0x2f34be=_0x2f34be-0x0;var _0x2ec2e4=_0xab99[_0x2f34be];return _0x2ec2e4;};'use strict';var _=require(_0x9ab9('0x0'));var BPromise=require(_0x9ab9('0x1'));var db=require(_0x9ab9('0x2'))['db'];var util=require(_0x9ab9('0x3'));var channels=[_0x9ab9('0x4'),_0x9ab9('0x5'),_0x9ab9('0x6'),_0x9ab9('0x7'),_0x9ab9('0x8'),'openchannel'];exports['getChannels']=function(){return channels;};exports[_0x9ab9('0x9')]=function(_0x35f368){_0x35f368=_0x35f368[_0x9ab9('0xa')]();return _['includes'](channels,_0x35f368);};exports[_0x9ab9('0xb')]=function(_0x2ef420,_0x5cce99,_0xefbbbf,_0x933307){var _0x1ca7fc={'loginAttempts':_0x5cce99,'blocked':_0xefbbbf};if(!_['isUndefined'](_0x933307)){_0x1ca7fc[_0x9ab9('0xc')]=_0x933307;}return _0x2ef420[_0x9ab9('0xd')](_0x1ca7fc);};exports['getLicense']=function(_0x34088d){return new BPromise(function(_0x384828,_0xb9c3cf){var _0x4b7793=0x0;if(_0x34088d['role']!=='agent'){_0x384828(_0x34088d);}db[_0x9ab9('0xe')][_0x9ab9('0xf')]({'where':{'role':_0x9ab9('0x10'),'online':!![],'id':{'$ne':_0x34088d['id']}}})['then'](function(_0x35b6de){_0x4b7793=_0x35b6de;return util['getLicense']();})[_0x9ab9('0x11')](function(_0xd4516c){if(_0xd4516c&&_0xd4516c[_0x9ab9('0x12')]&&_0x4b7793>=_0xd4516c[_0x9ab9('0x12')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x384828(_0x34088d);})['catch'](function(_0x4784e1){_0xb9c3cf(_0x4784e1);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index de825cf..36e85f8 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x65c5=['json','404','status'];(function(_0x3e274d,_0x35f95f){var _0x352bf9=function(_0x3e0e40){while(--_0x3e0e40){_0x3e274d['push'](_0x3e274d['shift']());}};_0x352bf9(++_0x35f95f);}(_0x65c5,0x1c0));var _0x565c=function(_0x17707b,_0x569963){_0x17707b=_0x17707b-0x0;var _0x14bd2d=_0x65c5[_0x17707b];return _0x14bd2d;};'use strict';module['exports'][0x194]=function pageNotFound(_0x152342,_0x207799){var _0x17b5b1=_0x565c('0x0');var _0x376b33=0x194;var _0x229458={'status':_0x376b33};_0x207799[_0x565c('0x1')](_0x229458[_0x565c('0x1')]);_0x207799['render'](_0x17b5b1,{},function(_0x31e037,_0x54495c){if(_0x31e037){return _0x207799[_0x565c('0x1')](_0x229458[_0x565c('0x1')])[_0x565c('0x2')](_0x229458);}_0x207799['send'](_0x54495c);});}; \ No newline at end of file +var _0x784a=['render','json','send','exports','404','status'];(function(_0x3cceb7,_0x70a0ab){var _0xe6af7f=function(_0x4dfef5){while(--_0x4dfef5){_0x3cceb7['push'](_0x3cceb7['shift']());}};_0xe6af7f(++_0x70a0ab);}(_0x784a,0xe7));var _0xa784=function(_0xb61065,_0x159992){_0xb61065=_0xb61065-0x0;var _0x3f3fcb=_0x784a[_0xb61065];return _0x3f3fcb;};'use strict';module[_0xa784('0x0')][0x194]=function pageNotFound(_0x268075,_0x460d8c){var _0x8783fe=_0xa784('0x1');var _0x37c8d0=0x194;var _0x2eced6={'status':_0x37c8d0};_0x460d8c[_0xa784('0x2')](_0x2eced6[_0xa784('0x2')]);_0x460d8c[_0xa784('0x3')](_0x8783fe,{},function(_0x31372b,_0x1b8f26){if(_0x31372b){return _0x460d8c[_0xa784('0x2')](_0x2eced6[_0xa784('0x2')])[_0xa784('0x4')](_0x2eced6);}_0x460d8c[_0xa784('0x5')](_0x1b8f26);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 28f51a1..a2b9c0d 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6108=['user_has_teams','user_has_mail_interactions','user_has_openchannel_interactions','VoiceQueues','MailQueue','MailQueues','ChatQueues','FaxQueue','FaxQueues','UserFaxQueue','OpenchannelQueue','OpenchannelQueues','VoicePrefix','ChatWebsites','user_has_chat_websites','FaxAccount','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccount','OpenchannelAccounts','user_has_openchannel_accounts','user_has_sms_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','VoiceMusicOnHold','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','Lists','voice_queues_has_cm_lists','Agents','Teams','team_has_voice_queues','BlackLists','voice_queues_has_cm_blacklists','mailboxuser','VoiceMailMessage','mailbox','QueueCalls','AgentReports','uniqueid','Contact','ContactId','MailServerIn','MailAccountId','MailServerOut','Dispositions','CannedAnswer','Answers','Interactions','List','ListId','Template','TemplateId','team_has_mail_queues','Messages','MailInteractionId','Account','Owner','Tag','Tags','mail_interaction_has_tags','Users','Interaction','restrict','TagId','FaxAccountId','Exntensions','mandatoryDispositionPauseId','FaxInteractionId','fax_interaction_has_tags','ThroughTags','AttachmentId','SmsAccountId','SmsApplication','SmsInteractionId','SmsQueueId','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatWebsiteId','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatMessage','ChatOfflineMessage','ChatGroupId','CompanyId','HopperHistories','MailInteractions','Company','cm_contact_has_tags','Agent','Queue','CampaignId','OwnerId','All','OneAll','AutomationAllId','Any','OneAny','Actions','AutomationId','Intervals','ChatApplications','FaxApplications','SmsApplications','Schedule','DefaultReportId','CustomReportId','Mohs','AllCondition','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','MetricId','SalesforceAccount','Configurations','AccountId','Subjects','SubjectId','DescriptionId','FieldId','Subject','Field','VariableId','SugarcrmConfiguration','Descriptions','SugarcrmAccount','Description','DeskConfiguration','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerAccount','VtigerField','Dynamics365Configuration','SessionId','SmsQueueReport','ProjectId','team_has_chat_queues','team_has_fax_queues','team_has_sms_queues','SmsQueues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromAgent','FaxTransferReport','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','OpenchannelTransferReport','FromOpenchannelAccountId','ToSmsQueueId','ToSmsAccountId','Queues','user_has_voice_prefixes','userProfileId','UserProfileSections','Resources','exports','path','sequelize','lodash','jstz','defaultsDeep','xC@LL1234','127.0.0.1','mysql','utf8mb4','utf8','sequelizeHistory','xcall','name','utf8_general_ci','database','username','password','options','import','../api/user/user.model','VoiceChanSpy','VoiceContext','../api/voiceContext/voiceContext.model','../api/voiceExtension/voiceExtension.model','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','VoiceTransferReport','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailQueue/mailQueue.model','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','../api/smsApplication/smsApplication.model','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','Pause','../api/pause/pause.model','Cdr','VoiceQueuesLog','../api/schedule/schedule.model','Sound','../api/sound/sound.model','../api/tag/tag.model','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceConfiguration','SalesforceField','../api/intSalesforceField/intSalesforceField.model','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','DeskAccount','../api/intDeskAccount/intDeskAccount.model','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','Network','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','JscriptySessionReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/license/license.model','Campaign','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','../api/faxTransferReport/faxTransferReport.model','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/voicePrefix/voicePrefix.model','UserProfile','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','User','hasOne','cascade','UserId','hasMany','Recordings','VoiceQueuesRt','VoiceExtension','Extensions','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteraction','SmsInteractions','FaxInteractions','belongsTo','Groups','chat_group_has_users','belongsToMany','Contacts','cm_user_has_contacts','cm_user_has_lists'];(function(_0x169d0e,_0x1d1feb){var _0x3451a0=function(_0x5a9c41){while(--_0x5a9c41){_0x169d0e['push'](_0x169d0e['shift']());}};_0x3451a0(++_0x1d1feb);}(_0x6108,0xbc));var _0x8610=function(_0x1f94e1,_0x3671c9){_0x1f94e1=_0x1f94e1-0x0;var _0x374bd7=_0x6108[_0x1f94e1];return _0x374bd7;};'use strict';var path=require(_0x8610('0x0'));var config=require('../config/environment');var Sequelize=require(_0x8610('0x1'));var _=require(_0x8610('0x2'));var jstz=require(_0x8610('0x3'));var timezone=jstz['determine']();config['sequelize']=_[_0x8610('0x4')](config[_0x8610('0x1')],{'database':'motion2','username':'xcall','password':_0x8610('0x5'),'options':{'host':_0x8610('0x6'),'port':0xcea,'dialect':_0x8610('0x7'),'dialectOptions':{'charset':_0x8610('0x8')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x8610('0x9'),'collate':'utf8_general_ci'}}});config[_0x8610('0xa')]=_[_0x8610('0x4')](config[_0x8610('0xa')],{'database':'motion2','username':_0x8610('0xb'),'password':_0x8610('0x5'),'options':{'host':_0x8610('0x6'),'port':0xcea,'dialect':_0x8610('0x7'),'dialectOptions':{'charset':_0x8610('0x8')},'logging':![],'timezone':timezone[_0x8610('0xc')](),'define':{'charset':'utf8','collate':_0x8610('0xd')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x8610('0x1')][_0x8610('0xe')],config['sequelize'][_0x8610('0xf')],config['sequelize'][_0x8610('0x10')],config[_0x8610('0x1')][_0x8610('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x8610('0xa')][_0x8610('0xe')],config['sequelizeHistory']['username'],config[_0x8610('0xa')][_0x8610('0x10')],config[_0x8610('0xa')]['options'])};db['User']=db['sequelize'][_0x8610('0x12')](_0x8610('0x13'));db[_0x8610('0x14')]=db[_0x8610('0x1')]['import']('../api/voiceChanSpy/voiceChanSpy.model');db[_0x8610('0x15')]=db['sequelize']['import'](_0x8610('0x16'));db['VoiceExtension']=db['sequelize'][_0x8610('0x12')](_0x8610('0x17'));db['VoiceMusicOnHold']=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0x18'));db[_0x8610('0x19')]=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0x1a'));db[_0x8610('0x1b')]=db[_0x8610('0x1')][_0x8610('0x12')]('../api/voiceRecording/voiceRecording.model');db[_0x8610('0x1c')]=db['sequelize'][_0x8610('0x12')](_0x8610('0x1d'));db[_0x8610('0x1e')]=db['sequelize'][_0x8610('0x12')]('../api/voiceMail/voiceMail.model');db['VoiceMailMessage']=db['sequelize']['import'](_0x8610('0x1f'));db[_0x8610('0x20')]=db['sequelize'][_0x8610('0x12')]('../api/voiceCallReport/voiceCallReport.model');db[_0x8610('0x21')]=db[_0x8610('0x1')]['import'](_0x8610('0x22'));db[_0x8610('0x23')]=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0x24'));db[_0x8610('0x25')]=db['sequelize'][_0x8610('0x12')](_0x8610('0x26'));db[_0x8610('0x27')]=db['sequelize'][_0x8610('0x12')]('../api/memberReport/memberReport.model');db[_0x8610('0x28')]=db['sequelize']['import'](_0x8610('0x29'));db[_0x8610('0x2a')]=db[_0x8610('0x1')]['import']('../api/voiceTransferReport/voiceTransferReport.model');db[_0x8610('0x2b')]=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0x2c'));db[_0x8610('0x2d')]=db[_0x8610('0x1')]['import'](_0x8610('0x2e'));db[_0x8610('0x2f')]=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0x30'));db[_0x8610('0x31')]=db[_0x8610('0x1')][_0x8610('0x12')]('../api/userMailQueue/userMailQueue.model');db['UserFaxQueue']=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0x32'));db[_0x8610('0x33')]=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0x34'));db[_0x8610('0x35')]=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0x36'));db['MailServerIn']=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0x37'));db['MailServerOut']=db['sequelize'][_0x8610('0x12')](_0x8610('0x38'));db[_0x8610('0x39')]=db[_0x8610('0x1')][_0x8610('0x12')]('../api/mailAccount/mailAccount.model');db['MailQueue']=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0x3a'));db['MailSubstatus']=db['sequelize'][_0x8610('0x12')](_0x8610('0x3b'));db[_0x8610('0x3c')]=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0x3d'));db[_0x8610('0x3e')]=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0x3f'));db[_0x8610('0x40')]=db['sequelize']['import'](_0x8610('0x41'));db[_0x8610('0x42')]=db[_0x8610('0x1')]['import']('../api/mailQueueReport/mailQueueReport.model');db[_0x8610('0x43')]=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0x44'));db[_0x8610('0x45')]=db['sequelize'][_0x8610('0x12')]('../api/dashboardItem/dashboardItem.model');db['FaxAccount']=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0x46'));db[_0x8610('0x47')]=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0x48'));db[_0x8610('0x49')]=db['sequelize'][_0x8610('0x12')](_0x8610('0x4a'));db[_0x8610('0x4b')]=db[_0x8610('0x1')]['import'](_0x8610('0x4c'));db['FaxQueue']=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0x4d'));db[_0x8610('0x4e')]=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0x4f'));db[_0x8610('0x50')]=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0x51'));db['SmsApplication']=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0x52'));db['SmsInteraction']=db[_0x8610('0x1')]['import'](_0x8610('0x53'));db[_0x8610('0x54')]=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0x55'));db[_0x8610('0x56')]=db['sequelize']['import'](_0x8610('0x57'));db['OpenchannelAccount']=db['sequelize']['import'](_0x8610('0x58'));db[_0x8610('0x59')]=db[_0x8610('0x1')][_0x8610('0x12')]('../api/openchannelApplication/openchannelApplication.model');db[_0x8610('0x5a')]=db['sequelize']['import'](_0x8610('0x5b'));db[_0x8610('0x5c')]=db[_0x8610('0x1')][_0x8610('0x12')]('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db['sequelize'][_0x8610('0x12')](_0x8610('0x5d'));db[_0x8610('0x5e')]=db[_0x8610('0x1')][_0x8610('0x12')]('../api/chatWebsite/chatWebsite.model');db[_0x8610('0x5f')]=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0x60'));db[_0x8610('0x61')]=db['sequelize'][_0x8610('0x12')](_0x8610('0x62'));db[_0x8610('0x63')]=db[_0x8610('0x1')]['import'](_0x8610('0x64'));db['ChatMessage']=db[_0x8610('0x1')]['import']('../api/chatMessage/chatMessage.model');db['ChatOfflineMessage']=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0x65'));db[_0x8610('0x66')]=db['sequelize'][_0x8610('0x12')](_0x8610('0x67'));db[_0x8610('0x68')]=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0x69'));db[_0x8610('0x6a')]=db['sequelize']['import']('../api/chatProactiveAction/chatProactiveAction.model');db['CmCompany']=db['sequelize'][_0x8610('0x12')](_0x8610('0x6b'));db[_0x8610('0x6c')]=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0x6d'));db[_0x8610('0x6e')]=db[_0x8610('0x1')][_0x8610('0x12')]('../api/cmHopper/cmHopper.model');db[_0x8610('0x6f')]=db[_0x8610('0x1')]['import'](_0x8610('0x70'));db[_0x8610('0x71')]=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0x72'));db[_0x8610('0x73')]=db[_0x8610('0x1')]['import'](_0x8610('0x74'));db[_0x8610('0x75')]=db['sequelize'][_0x8610('0x12')](_0x8610('0x76'));db[_0x8610('0x77')]=db[_0x8610('0x1')]['import'](_0x8610('0x78'));db[_0x8610('0x79')]=db[_0x8610('0x1')]['import']('../api/action/action.model');db[_0x8610('0x7a')]=db[_0x8610('0x1')]['import'](_0x8610('0x7b'));db['CannedAnswer']=db['sequelize'][_0x8610('0x12')](_0x8610('0x7c'));db[_0x8610('0x7d')]=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0x7e'));db[_0x8610('0x7f')]=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0x80'));db[_0x8610('0x81')]=db['sequelize'][_0x8610('0x12')]('../api/interval/interval.model');db[_0x8610('0x82')]=db['sequelize'][_0x8610('0x12')](_0x8610('0x83'));db[_0x8610('0x84')]=db[_0x8610('0x1')][_0x8610('0x12')]('../api/cdr/cdr.model');db[_0x8610('0x85')]=db[_0x8610('0x1')][_0x8610('0x12')]('../api/voiceQueuesLog/voiceQueuesLog.model');db['Schedule']=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0x86'));db[_0x8610('0x87')]=db['sequelize'][_0x8610('0x12')](_0x8610('0x88'));db['Tag']=db[_0x8610('0x1')]['import'](_0x8610('0x89'));db['Template']=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0x8a'));db[_0x8610('0x8b')]=db['sequelize'][_0x8610('0x12')](_0x8610('0x8c'));db[_0x8610('0x8d')]=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0x8e'));db[_0x8610('0x8f')]=db[_0x8610('0x1')]['import'](_0x8610('0x90'));db[_0x8610('0x91')]=db[_0x8610('0x1')][_0x8610('0x12')]('../api/integrationReport/integrationReport.model');db[_0x8610('0x92')]=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0x93'));db[_0x8610('0x94')]=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0x95'));db['AnalyticExtractedReport']=db[_0x8610('0x1')]['import'](_0x8610('0x96'));db[_0x8610('0x97')]=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0x98'));db[_0x8610('0x99')]=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0x9a'));db[_0x8610('0x9b')]=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0x9c'));db['SalesforceAccount']=db[_0x8610('0x1')][_0x8610('0x12')]('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0x8610('0x9d')]=db['sequelize'][_0x8610('0x12')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0x8610('0x9e')]=db[_0x8610('0x1')]['import'](_0x8610('0x9f'));db['SugarcrmAccount']=db[_0x8610('0x1')]['import']('../api/intSugarcrmAccount/intSugarcrmAccount.model');db['SugarcrmConfiguration']=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0xa0'));db[_0x8610('0xa1')]=db[_0x8610('0x1')]['import']('../api/intSugarcrmField/intSugarcrmField.model');db[_0x8610('0xa2')]=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0xa3'));db['DeskConfiguration']=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0xa4'));db[_0x8610('0xa5')]=db[_0x8610('0x1')]['import'](_0x8610('0xa6'));db[_0x8610('0xa7')]=db['sequelize']['import'](_0x8610('0xa8'));db[_0x8610('0xa9')]=db['sequelize'][_0x8610('0x12')](_0x8610('0xaa'));db[_0x8610('0xab')]=db[_0x8610('0x1')][_0x8610('0x12')]('../api/intZohoField/intZohoField.model');db[_0x8610('0xac')]=db[_0x8610('0x1')][_0x8610('0x12')]('../api/intZendeskAccount/intZendeskAccount.model');db[_0x8610('0xad')]=db['sequelize'][_0x8610('0x12')](_0x8610('0xae'));db[_0x8610('0xaf')]=db[_0x8610('0x1')]['import'](_0x8610('0xb0'));db[_0x8610('0xb1')]=db['sequelize'][_0x8610('0x12')](_0x8610('0xb2'));db[_0x8610('0xb3')]=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0xb4'));db[_0x8610('0xb5')]=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0xb6'));db['VtigerAccount']=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0xb7'));db[_0x8610('0xb8')]=db['sequelize'][_0x8610('0x12')](_0x8610('0xb9'));db['VtigerField']=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0xba'));db[_0x8610('0xbb')]=db[_0x8610('0x1')]['import'](_0x8610('0xbc'));db[_0x8610('0xbd')]=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0xbe'));db[_0x8610('0xbf')]=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0xc0'));db[_0x8610('0xc1')]=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0xc2'));db['Dynamics365Configuration']=db['sequelize']['import']('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0x8610('0xc3')]=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0xc4'));db[_0x8610('0xc5')]=db['sequelize'][_0x8610('0x12')](_0x8610('0xc6'));db[_0x8610('0xc7')]=db['sequelize'][_0x8610('0x12')](_0x8610('0xc8'));db[_0x8610('0xc9')]=db[_0x8610('0x1')][_0x8610('0x12')]('../api/intFreshsalesField/intFreshsalesField.model');db[_0x8610('0x8f')]=db[_0x8610('0x1')]['import'](_0x8610('0x90'));db[_0x8610('0xca')]=db[_0x8610('0x1')][_0x8610('0x12')]('../api/network/network.model');db[_0x8610('0xcb')]=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0xcc'));db[_0x8610('0xcd')]=db[_0x8610('0x1')][_0x8610('0x12')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x8610('0xce')]=db['sequelize'][_0x8610('0x12')](_0x8610('0xcf'));db[_0x8610('0xd0')]=db[_0x8610('0x1')][_0x8610('0x12')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0x8610('0xd1')]=db['sequelize'][_0x8610('0x12')]('../api/jscriptySessionReport/jscriptySessionReport.model');db['SmsQueueReport']=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0xd2'));db['SquareReport']=db[_0x8610('0x1')]['import'](_0x8610('0xd3'));db[_0x8610('0xd4')]=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0xd5'));db[_0x8610('0xd6')]=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0xd7'));db[_0x8610('0xd8')]=db[_0x8610('0x1')]['import'](_0x8610('0xd9'));db[_0x8610('0xda')]=db[_0x8610('0x1')]['import'](_0x8610('0xdb'));db[_0x8610('0xdc')]=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0xdd'));db[_0x8610('0xde')]=db['sequelize'][_0x8610('0x12')](_0x8610('0xdf'));db[_0x8610('0xe0')]=db[_0x8610('0x1')]['import'](_0x8610('0xe1'));db[_0x8610('0xe2')]=db[_0x8610('0x1')][_0x8610('0x12')]('../api/team/team.model');db['License']=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0xe3'));db[_0x8610('0xe4')]=db[_0x8610('0x1')][_0x8610('0x12')]('../api/campaign/campaign.model');db['Migration']=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0xe5'));db[_0x8610('0xe6')]=db['sequelize'][_0x8610('0x12')](_0x8610('0xe7'));db['Plugin']=db['sequelize'][_0x8610('0x12')](_0x8610('0xe8'));db[_0x8610('0xe9')]=db[_0x8610('0x1')]['import'](_0x8610('0xea'));db[_0x8610('0xeb')]=db['sequelize']['import'](_0x8610('0xec'));db['FaxTransferReport']=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0xed'));db['OpenchannelTransferReport']=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0xee'));db[_0x8610('0xef')]=db[_0x8610('0x1')]['import'](_0x8610('0xf0'));db[_0x8610('0xf1')]=db[_0x8610('0x1')]['import']('../api/cmList/cmList.model');db['VoicePrefix']=db[_0x8610('0x1')][_0x8610('0x12')](_0x8610('0xf2'));db[_0x8610('0xf3')]=db[_0x8610('0x1')][_0x8610('0x12')]('../api/userProfile/userProfile.model');db[_0x8610('0xf4')]=db[_0x8610('0x1')]['import'](_0x8610('0xf5'));db[_0x8610('0xf6')]=db['sequelize'][_0x8610('0x12')](_0x8610('0xf7'));db[_0x8610('0xf8')][_0x8610('0xf9')](db[_0x8610('0x1e')],{'as':_0x8610('0x1e'),'onDelete':_0x8610('0xfa'),'foreignKey':_0x8610('0xfb')});db[_0x8610('0xf8')][_0x8610('0xfc')](db[_0x8610('0x1b')],{'as':_0x8610('0xfd'),'foreignKey':'UserId'});db[_0x8610('0xf8')][_0x8610('0xfc')](db[_0x8610('0x2b')],{'as':_0x8610('0xfe'),'foreignKey':_0x8610('0xfb')});db['User'][_0x8610('0xfc')](db[_0x8610('0xff')],{'as':_0x8610('0x100'),'onDelete':_0x8610('0xfa'),'hooks':!![]});db['User'][_0x8610('0xfc')](db[_0x8610('0x71')],{'as':_0x8610('0x101'),'foreignKey':'UserId'});db[_0x8610('0xf8')][_0x8610('0xfc')](db['CmHopperHistory'],{'as':_0x8610('0x102'),'foreignKey':_0x8610('0xfb')});db[_0x8610('0xf8')][_0x8610('0xfc')](db[_0x8610('0x75')],{'as':'ReportAgentPreview','foreignKey':_0x8610('0xfb')});db[_0x8610('0xf8')][_0x8610('0xfc')](db[_0x8610('0x5a')],{'as':_0x8610('0x103'),'foreignKey':_0x8610('0xfb')});db[_0x8610('0xf8')]['hasMany'](db[_0x8610('0x63')],{'as':_0x8610('0x104'),'foreignKey':_0x8610('0xfb')});db[_0x8610('0xf8')][_0x8610('0xfc')](db[_0x8610('0x105')],{'as':_0x8610('0x106'),'foreignKey':'UserId'});db[_0x8610('0xf8')][_0x8610('0xfc')](db[_0x8610('0x49')],{'as':_0x8610('0x107'),'foreignKey':'UserId'});db[_0x8610('0xf8')][_0x8610('0xfc')](db[_0x8610('0x3c')],{'as':'MailInteractions','foreignKey':_0x8610('0xfb')});db[_0x8610('0xf8')][_0x8610('0x108')](db[_0x8610('0xf3')],{'as':'UserProfile','foreignKey':'userProfileId'});db[_0x8610('0xf8')]['belongsToMany'](db[_0x8610('0x68')],{'as':_0x8610('0x109'),'through':_0x8610('0x10a')});db[_0x8610('0xf8')][_0x8610('0x10b')](db[_0x8610('0x6c')],{'as':_0x8610('0x10c'),'through':_0x8610('0x10d')});db[_0x8610('0xf8')][_0x8610('0x10b')](db['CmList'],{'as':'Lists','through':_0x8610('0x10e')});db[_0x8610('0xf8')][_0x8610('0x10b')](db[_0x8610('0xe2')],{'through':_0x8610('0x10f')});db[_0x8610('0xf8')][_0x8610('0x10b')](db[_0x8610('0x3c')],{'as':'MailInteractions','through':_0x8610('0x110')});db[_0x8610('0xf8')]['belongsToMany'](db[_0x8610('0x63')],{'as':_0x8610('0x104'),'through':'user_has_chat_interactions'});db[_0x8610('0xf8')]['belongsToMany'](db[_0x8610('0x49')],{'as':'FaxInteractions','through':'user_has_fax_interactions'});db[_0x8610('0xf8')][_0x8610('0x10b')](db[_0x8610('0x105')],{'as':_0x8610('0x106'),'through':'user_has_sms_interactions'});db['User'][_0x8610('0x10b')](db[_0x8610('0x5a')],{'as':'OpenchannelInteractions','through':_0x8610('0x111')});db[_0x8610('0xf8')][_0x8610('0x10b')](db[_0x8610('0x19')],{'as':_0x8610('0x112'),'through':'UserVoiceQueue','required':![]});db[_0x8610('0xf8')][_0x8610('0x10b')](db[_0x8610('0x113')],{'as':_0x8610('0x114'),'through':_0x8610('0x31'),'required':![]});db[_0x8610('0xf8')][_0x8610('0x10b')](db[_0x8610('0x66')],{'as':_0x8610('0x115'),'through':_0x8610('0x2f'),'required':![],'hooks':!![]});db[_0x8610('0xf8')]['belongsToMany'](db[_0x8610('0x116')],{'as':_0x8610('0x117'),'through':_0x8610('0x118'),'required':![]});db[_0x8610('0xf8')][_0x8610('0x10b')](db['SmsQueue'],{'as':'SmsQueues','through':_0x8610('0x33'),'required':![]});db[_0x8610('0xf8')][_0x8610('0x10b')](db[_0x8610('0x119')],{'as':_0x8610('0x11a'),'through':_0x8610('0x35'),'required':![]});db[_0x8610('0xf8')]['belongsToMany'](db['CmList'],{'through':_0x8610('0x10e')});db[_0x8610('0xf8')][_0x8610('0x10b')](db[_0x8610('0x11b')],{'as':'VoicePrefixes','through':'user_has_voice_prefixes','required':![]});db[_0x8610('0xf8')][_0x8610('0x10b')](db[_0x8610('0x5e')],{'as':_0x8610('0x11c'),'through':_0x8610('0x11d')});db[_0x8610('0xf8')]['belongsToMany'](db[_0x8610('0x11e')],{'as':'FaxAccounts','through':_0x8610('0x11f')});db[_0x8610('0xf8')][_0x8610('0x10b')](db[_0x8610('0x39')],{'as':_0x8610('0x120'),'through':_0x8610('0x121')});db[_0x8610('0xf8')][_0x8610('0x10b')](db[_0x8610('0x122')],{'as':_0x8610('0x123'),'through':_0x8610('0x124')});db['User']['belongsToMany'](db[_0x8610('0x50')],{'as':'SmsAccounts','through':_0x8610('0x125')});db[_0x8610('0xf8')][_0x8610('0x10b')](db['SquareProject'],{'as':_0x8610('0x126'),'through':_0x8610('0x127')});db[_0x8610('0x14')][_0x8610('0xfc')](db[_0x8610('0xff')],{'as':_0x8610('0x128'),'onDelete':'cascade','foreignKey':_0x8610('0x129')});db[_0x8610('0x15')][_0x8610('0xfc')](db[_0x8610('0xff')],{'onDelete':_0x8610('0xfa')});db[_0x8610('0xff')][_0x8610('0xfc')](db[_0x8610('0xff')],{'as':_0x8610('0x12a'),'onDelete':_0x8610('0xfa')});db[_0x8610('0x12b')]['belongsToMany'](db[_0x8610('0x87')],{'as':'Sounds','through':_0x8610('0x12c')});db[_0x8610('0x19')][_0x8610('0xfc')](db[_0x8610('0x2b')],{'as':_0x8610('0x12d'),'foreignKey':_0x8610('0x12e')});db[_0x8610('0x19')]['hasMany'](db['CmHopper'],{'as':_0x8610('0x12f'),'foreignKey':_0x8610('0x12e')});db[_0x8610('0x19')]['hasMany'](db[_0x8610('0x71')],{'as':'HopperFinals','foreignKey':_0x8610('0x12e')});db['VoiceQueue'][_0x8610('0xfc')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0x8610('0x12e')});db['VoiceQueue']['hasMany'](db[_0x8610('0x75')],{'as':_0x8610('0x75'),'foreignKey':_0x8610('0x12e')});db['VoiceQueue'][_0x8610('0xfc')](db[_0x8610('0x6f')],{'as':_0x8610('0x130'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x8610('0xfc')](db[_0x8610('0xd1')],{'as':_0x8610('0x131'),'foreignKey':_0x8610('0x12e')});db['VoiceQueue'][_0x8610('0x108')](db[_0x8610('0x28')],{'as':_0x8610('0x28'),'foreignKey':_0x8610('0x132')});db[_0x8610('0x19')][_0x8610('0x108')](db[_0x8610('0x28')],{'as':_0x8610('0x133'),'foreignKey':_0x8610('0x134')});db[_0x8610('0x19')][_0x8610('0x108')](db['Interval'],{'as':_0x8610('0x81'),'foreignKey':_0x8610('0x135')});db['VoiceQueue'][_0x8610('0x108')](db[_0x8610('0x82')],{'as':_0x8610('0x136'),'foreignKey':'mandatoryDispositionPauseId'});db['VoiceQueue'][_0x8610('0x10b')](db[_0x8610('0xf1')],{'as':_0x8610('0x137'),'through':_0x8610('0x138')});db['VoiceQueue']['belongsToMany'](db['User'],{'as':_0x8610('0x139'),'through':_0x8610('0x2d')});db[_0x8610('0x19')][_0x8610('0x10b')](db[_0x8610('0xe2')],{'as':_0x8610('0x13a'),'through':_0x8610('0x13b')});db[_0x8610('0x19')]['belongsToMany'](db[_0x8610('0xf1')],{'as':_0x8610('0x13c'),'through':_0x8610('0x13d')});db[_0x8610('0x1b')][_0x8610('0x108')](db[_0x8610('0xf8')],{'as':_0x8610('0xf8'),'foreignKey':_0x8610('0xfb')});db[_0x8610('0x1c')][_0x8610('0x108')](db[_0x8610('0xf8')],{'as':_0x8610('0xf8'),'foreignKey':_0x8610('0xfb')});db[_0x8610('0x1e')][_0x8610('0xfc')](db['VoiceMailMessage'],{'as':'Messages','onDelete':_0x8610('0xfa'),'foreignKey':_0x8610('0x13e'),'sourceKey':'mailbox'});db[_0x8610('0x13f')][_0x8610('0x108')](db['VoiceMail'],{'foreignKey':_0x8610('0x13e'),'targetKey':_0x8610('0x140')});db[_0x8610('0x20')][_0x8610('0xfc')](db[_0x8610('0x25')],{'as':_0x8610('0x141'),'foreignKey':'uniqueid','constraints':![]});db[_0x8610('0x20')][_0x8610('0xfc')](db['VoiceAgentReport'],{'as':_0x8610('0x142'),'foreignKey':_0x8610('0x143'),'constraints':![]});db[_0x8610('0x20')][_0x8610('0x108')](db[_0x8610('0xf8')],{'as':_0x8610('0xf8'),'foreignKey':_0x8610('0xfb')});db[_0x8610('0x20')]['belongsTo'](db['CmContact'],{'as':_0x8610('0x144'),'foreignKey':_0x8610('0x145')});db[_0x8610('0x146')][_0x8610('0x108')](db['MailAccount'],{'as':_0x8610('0x39'),'foreignKey':_0x8610('0x147')});db['MailServerOut'][_0x8610('0x108')](db[_0x8610('0x39')],{'as':_0x8610('0x39'),'foreignKey':'MailAccountId'});db[_0x8610('0x39')][_0x8610('0xf9')](db[_0x8610('0x146')],{'as':'Imap','onDelete':_0x8610('0xfa')});db[_0x8610('0x39')][_0x8610('0xf9')](db[_0x8610('0x148')],{'as':'Smtp','onDelete':_0x8610('0xfa')});db['MailAccount'][_0x8610('0xfc')](db[_0x8610('0x7d')],{'as':_0x8610('0x149'),'foreignKey':'MailAccountId'});db[_0x8610('0x39')][_0x8610('0xfc')](db[_0x8610('0x14a')],{'as':_0x8610('0x14b'),'foreignKey':_0x8610('0x147')});db[_0x8610('0x39')][_0x8610('0xfc')](db[_0x8610('0x3e')],{'as':'Messages','foreignKey':_0x8610('0x147')});db['MailAccount']['hasMany'](db[_0x8610('0x3c')],{'as':_0x8610('0x14c')});db[_0x8610('0x39')][_0x8610('0xfc')](db['MailApplication'],{'as':_0x8610('0x12a')});db['MailAccount'][_0x8610('0x108')](db[_0x8610('0xf1')],{'as':_0x8610('0x14d'),'foreignKey':_0x8610('0x14e')});db['MailAccount']['belongsTo'](db[_0x8610('0x14f')],{'as':_0x8610('0x14f'),'foreignKey':_0x8610('0x150')});db[_0x8610('0x39')][_0x8610('0x108')](db[_0x8610('0x82')],{'as':_0x8610('0x136'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x8610('0x39')][_0x8610('0x10b')](db[_0x8610('0xf8')],{'as':_0x8610('0x139'),'through':_0x8610('0x121')});db[_0x8610('0x113')]['belongsToMany'](db[_0x8610('0xf8')],{'as':_0x8610('0x139'),'through':_0x8610('0x31')});db[_0x8610('0x113')][_0x8610('0x10b')](db['Team'],{'through':_0x8610('0x151'),'as':_0x8610('0x13a')});db[_0x8610('0x3c')][_0x8610('0xfc')](db[_0x8610('0x3e')],{'as':_0x8610('0x152'),'onDelete':_0x8610('0xfa'),'foreignKey':_0x8610('0x153')});db[_0x8610('0x3c')][_0x8610('0x108')](db[_0x8610('0x39')],{'as':_0x8610('0x154'),'foreignKey':'MailAccountId'});db[_0x8610('0x3c')]['belongsTo'](db[_0x8610('0x6c')],{'as':'Contact','foreignKey':_0x8610('0x145')});db[_0x8610('0x3c')][_0x8610('0x108')](db[_0x8610('0xf8')],{'as':_0x8610('0x155'),'foreignKey':_0x8610('0xfb')});db[_0x8610('0x3c')][_0x8610('0x10b')](db[_0x8610('0x156')],{'through':'mail_interaction_has_tags','as':_0x8610('0x157')});db[_0x8610('0x3c')][_0x8610('0x10b')](db[_0x8610('0x156')],{'through':_0x8610('0x158'),'as':'ThroughTags'});db[_0x8610('0x3c')][_0x8610('0x10b')](db[_0x8610('0xf8')],{'as':_0x8610('0x159'),'through':_0x8610('0x110'),'foreignKey':_0x8610('0x153')});db[_0x8610('0x3e')][_0x8610('0xfc')](db['Attachment'],{'as':'Attachments','onDelete':'cascade'});db[_0x8610('0x3e')][_0x8610('0x108')](db[_0x8610('0xf8')],{'as':_0x8610('0xf8')});db['MailMessage'][_0x8610('0x108')](db[_0x8610('0x6c')],{'onDelete':_0x8610('0xfa'),'as':_0x8610('0x144')});db[_0x8610('0x3e')]['belongsTo'](db[_0x8610('0x3c')],{'as':_0x8610('0x15a'),'foreignKey':_0x8610('0x153')});db['MailMessage'][_0x8610('0x108')](db[_0x8610('0x39')],{'as':_0x8610('0x154'),'foreignKey':'MailAccountId'});db[_0x8610('0x40')][_0x8610('0x108')](db[_0x8610('0xf8')],{'onDelete':'restrict'});db[_0x8610('0x40')]['belongsTo'](db[_0x8610('0x113')],{'onDelete':_0x8610('0x15b')});db[_0x8610('0x40')]['belongsTo'](db[_0x8610('0x39')],{'onDelete':_0x8610('0x15b')});db[_0x8610('0x40')]['belongsTo'](db[_0x8610('0x81')],{'onDelete':'restrict','foreignKey':_0x8610('0x135')});db[_0x8610('0x40')][_0x8610('0x108')](db[_0x8610('0x156')],{'onDelete':_0x8610('0x15b'),'foreignKey':_0x8610('0x15c')});db['MailQueueReport'][_0x8610('0x108')](db[_0x8610('0x39')],{});db[_0x8610('0x42')][_0x8610('0x108')](db[_0x8610('0xf1')],{'as':_0x8610('0x14d'),'foreignKey':_0x8610('0x14e')});db['MailQueueReport'][_0x8610('0x108')](db[_0x8610('0x6c')],{'as':_0x8610('0x144'),'foreignKey':'ContactId'});db['MailQueueReport'][_0x8610('0x108')](db[_0x8610('0x3c')],{});db[_0x8610('0x42')][_0x8610('0x108')](db[_0x8610('0x3e')],{});db['MailQueueReport']['belongsTo'](db['User'],{});db[_0x8610('0x42')][_0x8610('0x108')](db[_0x8610('0x113')],{});db[_0x8610('0x43')][_0x8610('0xfc')](db[_0x8610('0x45')],{'as':'Items','onDelete':_0x8610('0xfa')});db[_0x8610('0x11e')]['hasMany'](db[_0x8610('0x7d')],{'as':_0x8610('0x149'),'foreignKey':_0x8610('0x15d')});db[_0x8610('0x11e')][_0x8610('0xfc')](db[_0x8610('0x14a')],{'as':_0x8610('0x14b'),'foreignKey':_0x8610('0x15d')});db['FaxAccount'][_0x8610('0xfc')](db[_0x8610('0x49')],{'as':_0x8610('0x14c')});db[_0x8610('0x11e')][_0x8610('0xfc')](db[_0x8610('0x47')],{'as':'Applications'});db['FaxAccount'][_0x8610('0xfc')](db[_0x8610('0xff')],{'as':_0x8610('0x15e'),'onDelete':_0x8610('0xfa')});db[_0x8610('0x11e')][_0x8610('0xfc')](db[_0x8610('0x4b')],{'as':_0x8610('0x152')});db['FaxAccount'][_0x8610('0x108')](db[_0x8610('0x28')],{'as':'Trunk'});db[_0x8610('0x11e')]['belongsTo'](db[_0x8610('0xf1')],{'as':_0x8610('0x14d'),'foreignKey':_0x8610('0x14e')});db['FaxAccount'][_0x8610('0x108')](db['Pause'],{'as':_0x8610('0x136'),'foreignKey':_0x8610('0x15f')});db[_0x8610('0x11e')][_0x8610('0x10b')](db[_0x8610('0xf8')],{'as':'Agents','through':_0x8610('0x11f')});db[_0x8610('0x47')]['belongsTo'](db[_0x8610('0xf8')],{'onDelete':'restrict'});db[_0x8610('0x47')][_0x8610('0x108')](db['FaxQueue'],{'onDelete':_0x8610('0x15b')});db[_0x8610('0x47')][_0x8610('0x108')](db['FaxAccount'],{'onDelete':_0x8610('0x15b')});db[_0x8610('0x47')][_0x8610('0x108')](db['Tag'],{'onDelete':_0x8610('0x15b'),'foreignKey':_0x8610('0x15c')});db[_0x8610('0x49')]['hasMany'](db[_0x8610('0x4b')],{'as':_0x8610('0x152'),'onDelete':_0x8610('0xfa'),'foreignKey':_0x8610('0x160')});db[_0x8610('0x49')][_0x8610('0x108')](db[_0x8610('0x11e')],{'as':'Account','foreignKey':_0x8610('0x15d')});db[_0x8610('0x49')][_0x8610('0x108')](db['CmContact'],{'as':_0x8610('0x144'),'foreignKey':'ContactId'});db[_0x8610('0x49')][_0x8610('0x108')](db[_0x8610('0xf8')],{'as':_0x8610('0x155'),'foreignKey':_0x8610('0xfb')});db[_0x8610('0x49')][_0x8610('0x10b')](db[_0x8610('0x156')],{'through':_0x8610('0x161'),'as':'Tags'});db[_0x8610('0x49')][_0x8610('0x10b')](db[_0x8610('0x156')],{'through':_0x8610('0x161'),'as':_0x8610('0x162')});db[_0x8610('0x49')][_0x8610('0x10b')](db['User'],{'as':_0x8610('0x159'),'through':'user_has_fax_interactions','foreignKey':_0x8610('0x160')});db[_0x8610('0x4b')][_0x8610('0x108')](db['User'],{'onDelete':_0x8610('0xfa'),'as':'User'});db[_0x8610('0x4b')][_0x8610('0x108')](db[_0x8610('0x49')],{'as':_0x8610('0x15a'),'foreignKey':_0x8610('0x160')});db[_0x8610('0x4b')][_0x8610('0x108')](db[_0x8610('0x6c')],{'onDelete':'cascade','as':_0x8610('0x144')});db[_0x8610('0x4b')][_0x8610('0x108')](db[_0x8610('0xe6')],{'as':'Attachment','foreignKey':_0x8610('0x163')});db[_0x8610('0x4b')][_0x8610('0x108')](db[_0x8610('0x11e')],{'as':_0x8610('0x154'),'foreignKey':_0x8610('0x15d')});db[_0x8610('0x116')][_0x8610('0x10b')](db[_0x8610('0xf8')],{'as':'Agents','through':'UserFaxQueue'});db['FaxQueue'][_0x8610('0x10b')](db[_0x8610('0xe2')],{'through':'team_has_fax_queues','as':'Teams'});db[_0x8610('0x4e')][_0x8610('0x108')](db['FaxAccount'],{});db[_0x8610('0x4e')][_0x8610('0x108')](db[_0x8610('0xf1')],{'as':_0x8610('0x14d'),'foreignKey':_0x8610('0x14e')});db[_0x8610('0x4e')][_0x8610('0x108')](db[_0x8610('0x6c')],{'as':_0x8610('0x144'),'foreignKey':_0x8610('0x145')});db[_0x8610('0x4e')]['belongsTo'](db[_0x8610('0x49')],{});db[_0x8610('0x4e')][_0x8610('0x108')](db[_0x8610('0x4b')],{});db['FaxQueueReport'][_0x8610('0x108')](db['User'],{});db['FaxQueueReport'][_0x8610('0x108')](db[_0x8610('0x116')],{});db[_0x8610('0x50')][_0x8610('0xfc')](db[_0x8610('0x7d')],{'as':'Dispositions','foreignKey':_0x8610('0x164')});db['SmsAccount'][_0x8610('0xfc')](db['CannedAnswer'],{'as':_0x8610('0x14b'),'foreignKey':'SmsAccountId'});db[_0x8610('0x50')][_0x8610('0xfc')](db['SmsMessage'],{'as':_0x8610('0x152'),'foreignKey':_0x8610('0x164')});db[_0x8610('0x50')]['hasMany'](db[_0x8610('0x105')],{'as':_0x8610('0x14c')});db['SmsAccount'][_0x8610('0xfc')](db[_0x8610('0x165')],{'as':'Applications'});db[_0x8610('0x50')][_0x8610('0x108')](db['CmList'],{'as':_0x8610('0x14d'),'foreignKey':'ListId'});db[_0x8610('0x50')][_0x8610('0x108')](db['Pause'],{'as':_0x8610('0x136'),'foreignKey':_0x8610('0x15f')});db[_0x8610('0x50')][_0x8610('0x10b')](db[_0x8610('0xf8')],{'as':_0x8610('0x139'),'through':_0x8610('0x125')});db[_0x8610('0x165')][_0x8610('0x108')](db[_0x8610('0xf8')],{'onDelete':_0x8610('0x15b')});db[_0x8610('0x165')][_0x8610('0x108')](db[_0x8610('0x56')],{'onDelete':'restrict'});db[_0x8610('0x165')]['belongsTo'](db[_0x8610('0x50')],{'onDelete':_0x8610('0x15b')});db[_0x8610('0x165')]['belongsTo'](db[_0x8610('0x81')],{'onDelete':'restrict','foreignKey':_0x8610('0x135')});db[_0x8610('0x165')][_0x8610('0x108')](db['Tag'],{'onDelete':_0x8610('0x15b'),'foreignKey':'TagId'});db[_0x8610('0x105')]['hasMany'](db[_0x8610('0x54')],{'as':_0x8610('0x152'),'onDelete':_0x8610('0xfa'),'foreignKey':_0x8610('0x166')});db[_0x8610('0x105')][_0x8610('0x108')](db[_0x8610('0x50')],{'as':'Account','foreignKey':_0x8610('0x164')});db[_0x8610('0x105')][_0x8610('0x108')](db[_0x8610('0x6c')],{'as':_0x8610('0x144'),'foreignKey':_0x8610('0x145')});db[_0x8610('0x105')][_0x8610('0x108')](db[_0x8610('0xf8')],{'as':'Owner','foreignKey':_0x8610('0xfb')});db['SmsInteraction'][_0x8610('0x10b')](db[_0x8610('0x156')],{'through':'sms_interaction_has_tags','as':_0x8610('0x157')});db[_0x8610('0x105')][_0x8610('0x10b')](db[_0x8610('0x156')],{'through':'sms_interaction_has_tags','as':_0x8610('0x162')});db['SmsInteraction'][_0x8610('0x10b')](db[_0x8610('0xf8')],{'as':'Users','through':'user_has_sms_interactions','foreignKey':_0x8610('0x166')});db[_0x8610('0x54')][_0x8610('0x108')](db[_0x8610('0xf8')],{'as':'User'});db[_0x8610('0x54')][_0x8610('0x108')](db['CmContact'],{'onDelete':_0x8610('0xfa'),'as':_0x8610('0x144')});db[_0x8610('0x54')][_0x8610('0x108')](db[_0x8610('0x105')],{'onDelete':_0x8610('0xfa'),'as':_0x8610('0x15a'),'foreignKey':_0x8610('0x166')});db['SmsMessage'][_0x8610('0x108')](db[_0x8610('0x50')],{'as':_0x8610('0x154'),'foreignKey':_0x8610('0x164')});db[_0x8610('0x56')][_0x8610('0x10b')](db['User'],{'as':_0x8610('0x139'),'through':_0x8610('0x33'),'foreignKey':_0x8610('0x167')});db[_0x8610('0x56')][_0x8610('0x10b')](db[_0x8610('0xe2')],{'through':'team_has_sms_queues','as':_0x8610('0x13a')});db[_0x8610('0x122')][_0x8610('0xfc')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x8610('0x168')});db[_0x8610('0x122')][_0x8610('0xfc')](db[_0x8610('0x14a')],{'as':_0x8610('0x14b'),'foreignKey':_0x8610('0x168')});db[_0x8610('0x122')][_0x8610('0xfc')](db[_0x8610('0x5a')],{'as':_0x8610('0x14c'),'foreignKey':'OpenchannelAccountId'});db[_0x8610('0x122')][_0x8610('0xfc')](db[_0x8610('0x5c')],{'as':_0x8610('0x152'),'foreignKey':_0x8610('0x168')});db[_0x8610('0x122')][_0x8610('0xfc')](db[_0x8610('0x59')],{'as':_0x8610('0x12a'),'foreignKey':_0x8610('0x168')});db[_0x8610('0x122')][_0x8610('0x108')](db[_0x8610('0xf1')],{'as':'List','foreignKey':_0x8610('0x14e')});db[_0x8610('0x122')][_0x8610('0x108')](db[_0x8610('0x82')],{'as':'mandatoryDispositionPause','foreignKey':_0x8610('0x15f')});db[_0x8610('0x122')][_0x8610('0x10b')](db[_0x8610('0xf8')],{'as':_0x8610('0x139'),'through':_0x8610('0x124')});db[_0x8610('0x59')][_0x8610('0x108')](db[_0x8610('0xf8')],{'onDelete':'restrict'});db[_0x8610('0x59')][_0x8610('0x108')](db['OpenchannelQueue'],{'onDelete':_0x8610('0x15b'),'foreignKey':_0x8610('0x169')});db[_0x8610('0x59')][_0x8610('0x108')](db[_0x8610('0x122')],{'onDelete':'restrict','foreignKey':_0x8610('0x168')});db['OpenchannelApplication'][_0x8610('0x108')](db['Interval'],{'onDelete':'restrict','foreignKey':_0x8610('0x135')});db[_0x8610('0x59')][_0x8610('0x108')](db[_0x8610('0x156')],{'onDelete':_0x8610('0x15b'),'foreignKey':_0x8610('0x15c')});db[_0x8610('0x5a')]['hasMany'](db[_0x8610('0x5c')],{'as':'Messages','onDelete':_0x8610('0xfa'),'foreignKey':_0x8610('0x16a')});db[_0x8610('0x5a')][_0x8610('0x108')](db[_0x8610('0x122')],{'as':_0x8610('0x154'),'foreignKey':_0x8610('0x168')});db['OpenchannelInteraction'][_0x8610('0x108')](db[_0x8610('0x6c')],{'as':_0x8610('0x144'),'foreignKey':'ContactId'});db[_0x8610('0x5a')][_0x8610('0x108')](db['User'],{'as':_0x8610('0x155'),'foreignKey':'UserId'});db[_0x8610('0x5a')][_0x8610('0x10b')](db['Tag'],{'through':_0x8610('0x16b'),'as':'Tags'});db[_0x8610('0x5a')][_0x8610('0x10b')](db['Tag'],{'through':_0x8610('0x16b'),'as':_0x8610('0x162')});db[_0x8610('0x5a')][_0x8610('0x10b')](db[_0x8610('0xf8')],{'as':_0x8610('0x159'),'through':_0x8610('0x111'),'foreignKey':_0x8610('0x16a')});db['OpenchannelMessage'][_0x8610('0x108')](db[_0x8610('0xf8')],{'onDelete':_0x8610('0xfa'),'as':_0x8610('0xf8')});db[_0x8610('0x5c')][_0x8610('0x108')](db[_0x8610('0x6c')],{'onDelete':_0x8610('0xfa'),'as':_0x8610('0x144')});db[_0x8610('0x5c')][_0x8610('0x108')](db['OpenchannelInteraction'],{'onDelete':_0x8610('0xfa'),'as':_0x8610('0x15a'),'foreignKey':'OpenchannelInteractionId'});db[_0x8610('0x5c')]['belongsTo'](db[_0x8610('0xe6')],{'as':_0x8610('0xe6'),'foreignKey':_0x8610('0x163')});db[_0x8610('0x5c')]['belongsTo'](db[_0x8610('0x122')],{'as':'Account','foreignKey':'OpenchannelAccountId'});db['OpenchannelQueue'][_0x8610('0x10b')](db[_0x8610('0xf8')],{'as':'Agents','through':_0x8610('0x35'),'foreignKey':_0x8610('0x169')});db['OpenchannelQueue'][_0x8610('0x10b')](db[_0x8610('0xe2')],{'through':_0x8610('0x16c'),'as':_0x8610('0x13a')});db[_0x8610('0x5e')][_0x8610('0xfc')](db[_0x8610('0x7d')],{'as':_0x8610('0x149'),'foreignKey':_0x8610('0x16d')});db[_0x8610('0x5e')][_0x8610('0xfc')](db[_0x8610('0x14a')],{'as':_0x8610('0x14b'),'foreignKey':_0x8610('0x16d')});db[_0x8610('0x5e')][_0x8610('0xfc')](db[_0x8610('0x6a')],{'as':'ProactiveActions'});db[_0x8610('0x5e')][_0x8610('0xfc')](db['ChatInteraction'],{'as':'Interactions'});db[_0x8610('0x5e')]['hasMany'](db['ChatApplication'],{'as':'Applications'});db[_0x8610('0x5e')]['hasMany'](db['ChatMessage'],{'as':_0x8610('0x152')});db['ChatWebsite'][_0x8610('0x108')](db[_0x8610('0xf1')],{'as':_0x8610('0x14d'),'foreignKey':_0x8610('0x14e')});db[_0x8610('0x5e')][_0x8610('0x108')](db['Interval'],{'as':_0x8610('0x81'),'foreignKey':_0x8610('0x135')});db[_0x8610('0x5e')][_0x8610('0x108')](db[_0x8610('0x82')],{'as':_0x8610('0x136'),'foreignKey':_0x8610('0x15f')});db['ChatWebsite'][_0x8610('0x10b')](db[_0x8610('0xf8')],{'as':_0x8610('0x139'),'through':_0x8610('0x11d')});db[_0x8610('0x5f')]['belongsTo'](db[_0x8610('0x122')],{});db[_0x8610('0x5f')]['belongsTo'](db[_0x8610('0xf1')],{'as':_0x8610('0x14d'),'foreignKey':'ListId'});db[_0x8610('0x5f')]['belongsTo'](db[_0x8610('0x6c')],{'as':_0x8610('0x144'),'foreignKey':_0x8610('0x145')});db[_0x8610('0x5f')][_0x8610('0x108')](db[_0x8610('0x5a')],{});db['OpenchannelQueueReport']['belongsTo'](db[_0x8610('0x5c')],{});db[_0x8610('0x5f')][_0x8610('0x108')](db[_0x8610('0xf8')],{});db[_0x8610('0x5f')][_0x8610('0x108')](db[_0x8610('0x119')],{});db['ChatApplication'][_0x8610('0x108')](db[_0x8610('0xf8')],{'as':'Agent','foreignKey':'UserId','onDelete':_0x8610('0x15b')});db[_0x8610('0x61')][_0x8610('0x108')](db[_0x8610('0x66')],{'as':'Queue','foreignKey':_0x8610('0x16e'),'onDelete':'restrict'});db[_0x8610('0x61')]['belongsTo'](db[_0x8610('0x5e')],{'as':_0x8610('0x16f'),'foreignKey':_0x8610('0x16d'),'onDelete':'restrict'});db[_0x8610('0x61')]['belongsTo'](db[_0x8610('0x156')],{'onDelete':'restrict','foreignKey':_0x8610('0x15c')});db[_0x8610('0x63')][_0x8610('0xfc')](db['ChatMessage'],{'as':_0x8610('0x152'),'onDelete':_0x8610('0xfa'),'foreignKey':_0x8610('0x170')});db['ChatInteraction']['belongsTo'](db[_0x8610('0x5e')],{'as':'Account','foreignKey':_0x8610('0x16d')});db[_0x8610('0x63')][_0x8610('0x108')](db['CmContact'],{'as':_0x8610('0x144'),'foreignKey':_0x8610('0x145')});db['ChatInteraction']['belongsTo'](db[_0x8610('0xf8')],{'as':_0x8610('0x155'),'foreignKey':_0x8610('0xfb')});db[_0x8610('0x63')][_0x8610('0x10b')](db['Tag'],{'through':_0x8610('0x171'),'as':_0x8610('0x157')});db[_0x8610('0x63')]['belongsToMany'](db['Tag'],{'through':_0x8610('0x171'),'as':_0x8610('0x162')});db[_0x8610('0x63')][_0x8610('0x10b')](db['User'],{'as':_0x8610('0x159'),'through':_0x8610('0x172'),'foreignKey':_0x8610('0x170')});db[_0x8610('0x173')][_0x8610('0x108')](db['User'],{'onDelete':_0x8610('0xfa'),'as':_0x8610('0xf8')});db[_0x8610('0x173')][_0x8610('0x108')](db[_0x8610('0x6c')],{'onDelete':_0x8610('0xfa'),'as':_0x8610('0x144'),'foreignKey':_0x8610('0x145')});db['ChatMessage'][_0x8610('0x108')](db[_0x8610('0x63')],{'onDelete':_0x8610('0xfa'),'as':_0x8610('0x15a'),'foreignKey':_0x8610('0x170')});db[_0x8610('0x173')]['belongsTo'](db[_0x8610('0xe6')],{'as':_0x8610('0xe6'),'foreignKey':_0x8610('0x163')});db[_0x8610('0x173')][_0x8610('0x108')](db[_0x8610('0x5e')],{'as':_0x8610('0x154'),'foreignKey':_0x8610('0x16d')});db['ChatOfflineMessage']['belongsTo'](db[_0x8610('0x6c')],{'onDelete':_0x8610('0xfa'),'as':_0x8610('0x144'),'foreignKey':'ContactId'});db[_0x8610('0x174')][_0x8610('0x108')](db[_0x8610('0x5e')],{'as':_0x8610('0x154'),'foreignKey':_0x8610('0x16d')});db[_0x8610('0x66')][_0x8610('0x10b')](db[_0x8610('0xf8')],{'as':_0x8610('0x139'),'through':_0x8610('0x2f'),'hooks':!![]});db['ChatQueue'][_0x8610('0x10b')](db['Team'],{'through':'team_has_chat_queues','as':_0x8610('0x13a')});db[_0x8610('0x68')][_0x8610('0xfc')](db['ChatInternalMessage'],{'as':'Messages','foreignKey':_0x8610('0x175'),'onDelete':'cascade'});db['ChatGroup'][_0x8610('0x10b')](db['User'],{'as':_0x8610('0x12d'),'through':_0x8610('0x10a')});db['ChatProactiveAction']['belongsTo'](db[_0x8610('0x5e')],{'as':'Website','foreignKey':_0x8610('0x16d')});db['CmCompany']['hasMany'](db['CmContact'],{'as':_0x8610('0x10c'),'foreignKey':_0x8610('0x176')});db['CmContact'][_0x8610('0xfc')](db[_0x8610('0x6e')],{'as':'Hoppers','foreignKey':'ContactId'});db['CmContact'][_0x8610('0xfc')](db['CmHopperFinal'],{'as':_0x8610('0x101'),'foreignKey':'ContactId'});db[_0x8610('0x6c')][_0x8610('0xfc')](db[_0x8610('0x73')],{'as':_0x8610('0x177'),'foreignKey':_0x8610('0x145')});db['CmContact'][_0x8610('0xfc')](db[_0x8610('0x75')],{'as':_0x8610('0x75'),'foreignKey':_0x8610('0x145')});db[_0x8610('0x6c')][_0x8610('0xfc')](db[_0x8610('0xd1')],{'as':_0x8610('0x131'),'foreignKey':_0x8610('0x145')});db[_0x8610('0x6c')]['hasMany'](db[_0x8610('0x5a')],{'as':_0x8610('0x103'),'foreignKey':_0x8610('0x145'),'onDelete':_0x8610('0x15b')});db[_0x8610('0x6c')][_0x8610('0xfc')](db['ChatInteraction'],{'as':_0x8610('0x104'),'foreignKey':_0x8610('0x145'),'onDelete':_0x8610('0x15b')});db[_0x8610('0x6c')]['hasMany'](db[_0x8610('0x105')],{'as':'SmsInteractions','foreignKey':_0x8610('0x145'),'onDelete':_0x8610('0x15b')});db[_0x8610('0x6c')][_0x8610('0xfc')](db[_0x8610('0x49')],{'as':_0x8610('0x107'),'foreignKey':_0x8610('0x145'),'onDelete':_0x8610('0x15b')});db[_0x8610('0x6c')][_0x8610('0xfc')](db[_0x8610('0x3c')],{'as':_0x8610('0x178'),'foreignKey':_0x8610('0x145'),'onDelete':_0x8610('0x15b')});db[_0x8610('0x6c')]['belongsTo'](db['CmCompany'],{'as':_0x8610('0x179'),'foreignKey':_0x8610('0x176')});db[_0x8610('0x6c')][_0x8610('0x108')](db['CmList'],{'as':'List','foreignKey':'ListId','onDelete':_0x8610('0xfa')});db[_0x8610('0x6c')][_0x8610('0x10b')](db[_0x8610('0xf8')],{'as':_0x8610('0x159'),'through':'cm_user_has_contacts'});db[_0x8610('0x6c')][_0x8610('0x10b')](db[_0x8610('0x156')],{'as':_0x8610('0x157'),'through':_0x8610('0x17a')});db[_0x8610('0x6c')]['belongsToMany'](db[_0x8610('0x156')],{'through':'cm_contact_has_tags','as':_0x8610('0x162')});db[_0x8610('0x6e')]['belongsTo'](db[_0x8610('0x6c')],{'as':_0x8610('0x144'),'foreignKey':'ContactId','onDelete':_0x8610('0xfa')});db['CmHopper'][_0x8610('0x108')](db[_0x8610('0xf1')],{'as':_0x8610('0x14d'),'foreignKey':'ListId','onDelete':_0x8610('0xfa')});db[_0x8610('0x6e')]['belongsTo'](db['User'],{'as':_0x8610('0x17b'),'foreignKey':_0x8610('0xfb')});db[_0x8610('0x6e')][_0x8610('0x108')](db[_0x8610('0x19')],{'as':_0x8610('0x17c'),'foreignKey':'VoiceQueueId','onDelete':_0x8610('0xfa')});db[_0x8610('0x6e')][_0x8610('0x108')](db[_0x8610('0xe4')],{'as':'Campaign','foreignKey':_0x8610('0x17d'),'onDelete':_0x8610('0xfa')});db[_0x8610('0x6e')]['belongsTo'](db[_0x8610('0xf8')],{'as':_0x8610('0x155'),'foreignKey':_0x8610('0x17e')});db[_0x8610('0x6f')]['belongsTo'](db[_0x8610('0x6c')],{'as':_0x8610('0x144'),'foreignKey':_0x8610('0x145'),'onDelete':'cascade'});db[_0x8610('0x6f')]['belongsTo'](db[_0x8610('0xf1')],{'as':_0x8610('0x14d'),'foreignKey':_0x8610('0x14e'),'onDelete':_0x8610('0xfa')});db['CmHopperBlack'][_0x8610('0x108')](db['VoiceQueue'],{'as':'Queue','foreignKey':_0x8610('0x12e'),'onDelete':_0x8610('0xfa')});db[_0x8610('0x6f')][_0x8610('0x108')](db[_0x8610('0xe4')],{'as':_0x8610('0xe4'),'foreignKey':_0x8610('0x17d'),'onDelete':_0x8610('0xfa')});db[_0x8610('0x7a')][_0x8610('0xfc')](db[_0x8610('0x7f')],{'as':{'plural':_0x8610('0x17f'),'singular':_0x8610('0x180')},'foreignKey':_0x8610('0x181'),'onDelete':_0x8610('0xfa'),'hooks':!![]});db[_0x8610('0x7a')][_0x8610('0xfc')](db['Condition'],{'as':{'plural':_0x8610('0x182'),'singular':_0x8610('0x183')},'foreignKey':'AutomationAnyId','onDelete':_0x8610('0xfa'),'hooks':!![]});db[_0x8610('0x7a')][_0x8610('0xfc')](db[_0x8610('0x79')],{'as':_0x8610('0x184'),'foreignKey':_0x8610('0x185'),'onDelete':_0x8610('0xfa'),'hooks':!![]});db[_0x8610('0x81')][_0x8610('0xfc')](db[_0x8610('0x81')],{'as':_0x8610('0x186'),'foreignKey':_0x8610('0x135'),'onDelete':'cascade','hooks':!![],'required':![]});db[_0x8610('0x81')]['hasMany'](db['VoiceExtension'],{'as':'Extensions','foreignKey':_0x8610('0x135'),'onDelete':_0x8610('0x15b')});db['Interval'][_0x8610('0xfc')](db['MailApplication'],{'as':'MailApplications','foreignKey':_0x8610('0x135')});db[_0x8610('0x81')][_0x8610('0xfc')](db[_0x8610('0x61')],{'as':_0x8610('0x187'),'foreignKey':_0x8610('0x135')});db[_0x8610('0x81')][_0x8610('0xfc')](db[_0x8610('0x47')],{'as':_0x8610('0x188'),'foreignKey':_0x8610('0x135')});db[_0x8610('0x81')][_0x8610('0xfc')](db[_0x8610('0x165')],{'as':_0x8610('0x189'),'foreignKey':_0x8610('0x135')});db[_0x8610('0x18a')][_0x8610('0x108')](db['MailAccount'],{});db[_0x8610('0x18a')][_0x8610('0x108')](db['AnalyticDefaultReport'],{'foreignKey':_0x8610('0x18b')});db[_0x8610('0x18a')][_0x8610('0x108')](db['AnalyticCustomReport'],{'foreignKey':_0x8610('0x18c')});db[_0x8610('0x87')][_0x8610('0x10b')](db['VoiceMusicOnHold'],{'as':_0x8610('0x18d'),'through':'moh_has_sounds','onDelete':_0x8610('0x15b')});db[_0x8610('0x156')]['belongsToMany'](db[_0x8610('0x6c')],{'through':_0x8610('0x17a')});db[_0x8610('0x156')][_0x8610('0x10b')](db['ChatInteraction'],{'through':_0x8610('0x171')});db[_0x8610('0x156')][_0x8610('0x10b')](db['MailInteraction'],{'through':_0x8610('0x158')});db['Tag'][_0x8610('0x10b')](db['SmsInteraction'],{'through':'sms_interaction_has_tags'});db[_0x8610('0x156')][_0x8610('0x10b')](db[_0x8610('0x49')],{'through':'fax_interaction_has_tags'});db[_0x8610('0x156')][_0x8610('0x10b')](db['OpenchannelInteraction'],{'through':_0x8610('0x16b')});db['Trigger'][_0x8610('0xfc')](db[_0x8610('0x7f')],{'as':{'plural':'AllConditions','singular':_0x8610('0x18e')},'foreignKey':'TriggerAllId','onDelete':'cascade','hooks':!![]});db['Trigger'][_0x8610('0xfc')](db[_0x8610('0x7f')],{'as':{'plural':_0x8610('0x18f'),'singular':_0x8610('0x190')},'foreignKey':_0x8610('0x191'),'onDelete':_0x8610('0xfa'),'hooks':!![]});db[_0x8610('0x8b')][_0x8610('0xfc')](db[_0x8610('0x79')],{'as':_0x8610('0x184'),'foreignKey':_0x8610('0x192'),'onDelete':'cascade','hooks':!![]});db[_0x8610('0x92')][_0x8610('0xfc')](db[_0x8610('0x99')],{'as':_0x8610('0x193'),'onDelete':_0x8610('0xfa'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport']['hasMany'](db['AnalyticFieldReport'],{'as':_0x8610('0x193'),'onDelete':_0x8610('0xfa'),'foreignKey':_0x8610('0x18b')});db[_0x8610('0x97')][_0x8610('0xfc')](db[_0x8610('0x99')],{'as':_0x8610('0x193'),'onDelete':'cascade','foreignKey':'MetricId'});db[_0x8610('0x99')]['belongsTo'](db['AnalyticMetric'],{'foreignKey':_0x8610('0x194')});db[_0x8610('0x195')][_0x8610('0xfc')](db['SalesforceConfiguration'],{'as':_0x8610('0x196'),'onDelete':_0x8610('0xfa'),'foreignKey':_0x8610('0x197')});db['SalesforceConfiguration'][_0x8610('0xfc')](db['SalesforceField'],{'as':_0x8610('0x198'),'onDelete':_0x8610('0xfa'),'foreignKey':_0x8610('0x199')});db[_0x8610('0x9d')][_0x8610('0xfc')](db['SalesforceField'],{'as':'Descriptions','onDelete':_0x8610('0xfa'),'foreignKey':_0x8610('0x19a')});db[_0x8610('0x9d')]['hasMany'](db[_0x8610('0x9e')],{'as':_0x8610('0x193'),'onDelete':_0x8610('0xfa'),'foreignKey':_0x8610('0x19b')});db['SalesforceConfiguration'][_0x8610('0x108')](db[_0x8610('0x195')],{'as':_0x8610('0x154'),'foreignKey':'AccountId'});db[_0x8610('0x9e')][_0x8610('0xfc')](db[_0x8610('0x9e')],{'as':_0x8610('0x19c'),'foreignKey':'SubjectId'});db[_0x8610('0x9e')][_0x8610('0xfc')](db[_0x8610('0x9e')],{'as':'Description','foreignKey':_0x8610('0x19a')});db[_0x8610('0x9e')][_0x8610('0xfc')](db['SalesforceField'],{'as':_0x8610('0x19d'),'foreignKey':_0x8610('0x19b')});db[_0x8610('0x9e')][_0x8610('0x108')](db[_0x8610('0x8d')],{'as':_0x8610('0x8d'),'foreignKey':_0x8610('0x19e')});db['SugarcrmAccount'][_0x8610('0xfc')](db['SugarcrmConfiguration'],{'as':_0x8610('0x196'),'onDelete':_0x8610('0xfa'),'foreignKey':_0x8610('0x197')});db['SugarcrmConfiguration']['hasMany'](db[_0x8610('0xa1')],{'as':_0x8610('0x198'),'onDelete':_0x8610('0xfa'),'foreignKey':'SubjectId'});db[_0x8610('0x19f')]['hasMany'](db[_0x8610('0xa1')],{'as':_0x8610('0x1a0'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x8610('0x19f')][_0x8610('0xfc')](db[_0x8610('0xa1')],{'as':_0x8610('0x193'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0x8610('0x19f')][_0x8610('0x108')](db[_0x8610('0x1a1')],{'as':'Account','foreignKey':_0x8610('0x197')});db[_0x8610('0xa1')][_0x8610('0xfc')](db['SugarcrmField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x8610('0xa1')][_0x8610('0xfc')](db[_0x8610('0xa1')],{'as':_0x8610('0x1a2'),'foreignKey':_0x8610('0x19a')});db[_0x8610('0xa1')]['hasMany'](db['SugarcrmField'],{'as':_0x8610('0x19d'),'foreignKey':_0x8610('0x19b')});db[_0x8610('0xa1')]['belongsTo'](db[_0x8610('0x8d')],{'as':_0x8610('0x8d'),'foreignKey':_0x8610('0x19e')});db[_0x8610('0xa2')][_0x8610('0xfc')](db[_0x8610('0x1a3')],{'as':_0x8610('0x196'),'onDelete':'cascade','foreignKey':_0x8610('0x197')});db[_0x8610('0x1a3')]['hasMany'](db['DeskField'],{'as':_0x8610('0x198'),'onDelete':'cascade','foreignKey':_0x8610('0x199')});db['DeskConfiguration'][_0x8610('0xfc')](db['DeskField'],{'as':_0x8610('0x1a0'),'onDelete':_0x8610('0xfa'),'foreignKey':_0x8610('0x19a')});db[_0x8610('0x1a3')][_0x8610('0xfc')](db['DeskField'],{'as':'Fields','onDelete':_0x8610('0xfa'),'foreignKey':_0x8610('0x19b')});db[_0x8610('0x1a3')][_0x8610('0x108')](db[_0x8610('0xa2')],{'as':_0x8610('0x154'),'foreignKey':_0x8610('0x197')});db[_0x8610('0x1a3')][_0x8610('0x10b')](db[_0x8610('0x156')],{'through':'int_desk_configuration_has_tags'});db[_0x8610('0xa5')]['hasMany'](db[_0x8610('0xa5')],{'as':_0x8610('0x19c'),'foreignKey':_0x8610('0x199')});db[_0x8610('0xa5')][_0x8610('0xfc')](db[_0x8610('0xa5')],{'as':_0x8610('0x1a2'),'foreignKey':_0x8610('0x19a')});db[_0x8610('0xa5')][_0x8610('0xfc')](db['DeskField'],{'as':_0x8610('0x19d'),'foreignKey':_0x8610('0x19b')});db['DeskField']['belongsTo'](db[_0x8610('0x8d')],{'as':_0x8610('0x8d'),'foreignKey':_0x8610('0x19e')});db['ZohoAccount']['hasMany'](db[_0x8610('0xa9')],{'as':_0x8610('0x196'),'onDelete':_0x8610('0xfa'),'foreignKey':_0x8610('0x197')});db[_0x8610('0xa9')]['hasMany'](db[_0x8610('0xab')],{'as':'Subjects','onDelete':_0x8610('0xfa'),'foreignKey':_0x8610('0x199')});db['ZohoConfiguration']['hasMany'](db[_0x8610('0xab')],{'as':_0x8610('0x1a0'),'onDelete':_0x8610('0xfa'),'foreignKey':'DescriptionId'});db[_0x8610('0xa9')][_0x8610('0xfc')](db[_0x8610('0xab')],{'as':_0x8610('0x193'),'onDelete':_0x8610('0xfa'),'foreignKey':_0x8610('0x19b')});db[_0x8610('0xa9')]['belongsTo'](db[_0x8610('0xa7')],{'as':_0x8610('0x154'),'foreignKey':'AccountId'});db[_0x8610('0xab')][_0x8610('0xfc')](db['ZohoField'],{'as':_0x8610('0x19c'),'foreignKey':'SubjectId'});db[_0x8610('0xab')][_0x8610('0xfc')](db[_0x8610('0xab')],{'as':'Description','foreignKey':_0x8610('0x19a')});db['ZohoField'][_0x8610('0xfc')](db[_0x8610('0xab')],{'as':'Field','foreignKey':'FieldId'});db[_0x8610('0xab')]['belongsTo'](db['Variable'],{'as':_0x8610('0x8d'),'foreignKey':_0x8610('0x19e')});db[_0x8610('0xac')]['hasMany'](db[_0x8610('0xad')],{'as':_0x8610('0x196'),'onDelete':_0x8610('0xfa'),'foreignKey':_0x8610('0x197')});db['ZendeskConfiguration'][_0x8610('0xfc')](db[_0x8610('0xaf')],{'as':_0x8610('0x198'),'foreignKey':_0x8610('0x199')});db[_0x8610('0xad')][_0x8610('0xfc')](db[_0x8610('0xaf')],{'as':'Descriptions','foreignKey':_0x8610('0x19a')});db[_0x8610('0xad')][_0x8610('0xfc')](db[_0x8610('0xaf')],{'as':_0x8610('0x193'),'foreignKey':_0x8610('0x19b')});db['ZendeskConfiguration'][_0x8610('0x108')](db[_0x8610('0xac')],{'as':'Account','foreignKey':_0x8610('0x197')});db[_0x8610('0xad')][_0x8610('0x10b')](db[_0x8610('0x156')],{'through':_0x8610('0x1a4')});db['ZendeskField'][_0x8610('0xfc')](db[_0x8610('0xaf')],{'as':_0x8610('0x19c'),'foreignKey':'SubjectId'});db[_0x8610('0xaf')][_0x8610('0xfc')](db[_0x8610('0xaf')],{'as':_0x8610('0x1a2'),'foreignKey':_0x8610('0x19a')});db[_0x8610('0xaf')][_0x8610('0xfc')](db[_0x8610('0xaf')],{'as':_0x8610('0x19d'),'foreignKey':_0x8610('0x19b')});db['ZendeskField'][_0x8610('0x108')](db['Variable'],{'as':_0x8610('0x8d'),'foreignKey':_0x8610('0x19e')});db[_0x8610('0xb1')][_0x8610('0xfc')](db['FreshdeskConfiguration'],{'as':_0x8610('0x196'),'onDelete':_0x8610('0xfa'),'foreignKey':_0x8610('0x197')});db['FreshdeskConfiguration']['hasMany'](db[_0x8610('0xb5')],{'as':_0x8610('0x198'),'onDelete':_0x8610('0xfa'),'foreignKey':'SubjectId'});db[_0x8610('0xb3')]['hasMany'](db[_0x8610('0xb5')],{'as':_0x8610('0x1a0'),'onDelete':_0x8610('0xfa'),'foreignKey':_0x8610('0x19a')});db[_0x8610('0xb3')][_0x8610('0xfc')](db[_0x8610('0xb5')],{'as':'Fields','onDelete':_0x8610('0xfa'),'foreignKey':'FieldId'});db[_0x8610('0xb3')][_0x8610('0x108')](db[_0x8610('0xb1')],{'as':_0x8610('0x154'),'foreignKey':'AccountId'});db[_0x8610('0xb3')][_0x8610('0x10b')](db[_0x8610('0x156')],{'through':_0x8610('0x1a5')});db[_0x8610('0xb5')][_0x8610('0xfc')](db[_0x8610('0xb5')],{'as':_0x8610('0x19c'),'foreignKey':'SubjectId'});db[_0x8610('0xb5')][_0x8610('0xfc')](db[_0x8610('0xb5')],{'as':_0x8610('0x1a2'),'foreignKey':_0x8610('0x19a')});db['FreshdeskField'][_0x8610('0xfc')](db[_0x8610('0xb5')],{'as':_0x8610('0x19d'),'foreignKey':_0x8610('0x19b')});db[_0x8610('0xb5')]['belongsTo'](db[_0x8610('0x8d')],{'as':_0x8610('0x8d'),'foreignKey':'VariableId'});db[_0x8610('0x1a6')][_0x8610('0xfc')](db['VtigerConfiguration'],{'as':_0x8610('0x196'),'onDelete':_0x8610('0xfa'),'foreignKey':_0x8610('0x197')});db['VtigerConfiguration'][_0x8610('0xfc')](db[_0x8610('0x1a7')],{'as':_0x8610('0x198'),'foreignKey':'SubjectId'});db[_0x8610('0xb8')]['hasMany'](db[_0x8610('0x1a7')],{'as':'Descriptions','foreignKey':_0x8610('0x19a')});db[_0x8610('0xb8')]['hasMany'](db[_0x8610('0x1a7')],{'as':_0x8610('0x193'),'foreignKey':'FieldId'});db[_0x8610('0xb8')][_0x8610('0x108')](db[_0x8610('0x1a6')],{'as':'Account','foreignKey':'AccountId'});db[_0x8610('0x1a7')][_0x8610('0xfc')](db[_0x8610('0x1a7')],{'as':_0x8610('0x19c'),'foreignKey':_0x8610('0x199')});db[_0x8610('0x1a7')][_0x8610('0xfc')](db['VtigerField'],{'as':_0x8610('0x1a2'),'foreignKey':'DescriptionId'});db[_0x8610('0x1a7')]['hasMany'](db['VtigerField'],{'as':'Field','foreignKey':_0x8610('0x19b')});db[_0x8610('0x1a7')][_0x8610('0x108')](db['Variable'],{'as':_0x8610('0x8d'),'foreignKey':_0x8610('0x19e')});db[_0x8610('0xbb')]['hasMany'](db['ServicenowConfiguration'],{'as':_0x8610('0x196'),'onDelete':_0x8610('0xfa'),'foreignKey':_0x8610('0x197')});db[_0x8610('0xbd')][_0x8610('0xfc')](db[_0x8610('0xbf')],{'as':_0x8610('0x198'),'foreignKey':'SubjectId'});db[_0x8610('0xbd')]['hasMany'](db[_0x8610('0xbf')],{'as':_0x8610('0x1a0'),'foreignKey':_0x8610('0x19a')});db[_0x8610('0xbd')]['hasMany'](db[_0x8610('0xbf')],{'as':'Fields','foreignKey':_0x8610('0x19b')});db['ServicenowConfiguration'][_0x8610('0x108')](db[_0x8610('0xbb')],{'as':_0x8610('0x154'),'foreignKey':_0x8610('0x197')});db['ServicenowField'][_0x8610('0xfc')](db[_0x8610('0xbf')],{'as':_0x8610('0x19c'),'foreignKey':_0x8610('0x199')});db[_0x8610('0xbf')]['hasMany'](db['ServicenowField'],{'as':_0x8610('0x1a2'),'foreignKey':_0x8610('0x19a')});db['ServicenowField'][_0x8610('0xfc')](db[_0x8610('0xbf')],{'as':_0x8610('0x19d'),'foreignKey':_0x8610('0x19b')});db[_0x8610('0xbf')][_0x8610('0x108')](db[_0x8610('0x8d')],{'as':_0x8610('0x8d'),'foreignKey':_0x8610('0x19e')});db['Dynamics365Account']['hasMany'](db[_0x8610('0x1a8')],{'as':_0x8610('0x196'),'onDelete':_0x8610('0xfa'),'foreignKey':'AccountId'});db[_0x8610('0x1a8')][_0x8610('0xfc')](db[_0x8610('0xc3')],{'as':'Subjects','onDelete':_0x8610('0xfa'),'foreignKey':'SubjectId'});db[_0x8610('0x1a8')][_0x8610('0xfc')](db[_0x8610('0xc3')],{'as':_0x8610('0x1a0'),'onDelete':_0x8610('0xfa'),'foreignKey':_0x8610('0x19a')});db[_0x8610('0x1a8')]['hasMany'](db[_0x8610('0xc3')],{'as':_0x8610('0x193'),'onDelete':'cascade','foreignKey':_0x8610('0x19b')});db[_0x8610('0x1a8')]['belongsTo'](db[_0x8610('0xc1')],{'as':_0x8610('0x154'),'foreignKey':_0x8610('0x197')});db[_0x8610('0xc3')]['hasMany'](db[_0x8610('0xc3')],{'as':_0x8610('0x19c'),'foreignKey':_0x8610('0x199')});db[_0x8610('0xc3')][_0x8610('0xfc')](db[_0x8610('0xc3')],{'as':_0x8610('0x1a2'),'foreignKey':'DescriptionId'});db[_0x8610('0xc3')][_0x8610('0xfc')](db[_0x8610('0xc3')],{'as':_0x8610('0x19d'),'foreignKey':_0x8610('0x19b')});db['Dynamics365Field'][_0x8610('0x108')](db['Variable'],{'as':_0x8610('0x8d'),'foreignKey':_0x8610('0x19e')});db[_0x8610('0xc5')][_0x8610('0xfc')](db[_0x8610('0xc7')],{'as':_0x8610('0x196'),'onDelete':_0x8610('0xfa'),'foreignKey':_0x8610('0x197')});db[_0x8610('0xc7')][_0x8610('0xfc')](db['FreshsalesField'],{'as':_0x8610('0x198'),'foreignKey':_0x8610('0x199')});db[_0x8610('0xc7')][_0x8610('0xfc')](db['FreshsalesField'],{'as':'Descriptions','foreignKey':_0x8610('0x19a')});db[_0x8610('0xc7')]['hasMany'](db[_0x8610('0xc9')],{'as':'Fields','foreignKey':_0x8610('0x19b')});db['FreshsalesConfiguration'][_0x8610('0x108')](db[_0x8610('0xc5')],{'as':'Account','foreignKey':_0x8610('0x197')});db['FreshsalesField'][_0x8610('0xfc')](db[_0x8610('0xc9')],{'as':_0x8610('0x19c'),'foreignKey':'SubjectId'});db[_0x8610('0xc9')][_0x8610('0xfc')](db[_0x8610('0xc9')],{'as':'Description','foreignKey':_0x8610('0x19a')});db[_0x8610('0xc9')][_0x8610('0xfc')](db[_0x8610('0xc9')],{'as':_0x8610('0x19d'),'foreignKey':_0x8610('0x19b')});db[_0x8610('0xc9')]['belongsTo'](db[_0x8610('0x8d')],{'as':'Variable','foreignKey':_0x8610('0x19e')});db[_0x8610('0xcb')][_0x8610('0x108')](db[_0x8610('0x5e')],{});db[_0x8610('0xcb')]['belongsTo'](db[_0x8610('0xf1')],{'as':'List','foreignKey':_0x8610('0x14e')});db['ChatQueueReport'][_0x8610('0x108')](db[_0x8610('0x6c')],{'as':_0x8610('0x144'),'foreignKey':_0x8610('0x145')});db[_0x8610('0xcb')][_0x8610('0x108')](db[_0x8610('0x63')],{});db['ChatQueueReport'][_0x8610('0x108')](db[_0x8610('0x173')],{});db[_0x8610('0xcb')][_0x8610('0x108')](db['User'],{});db[_0x8610('0xcb')][_0x8610('0x108')](db[_0x8610('0x66')],{});db[_0x8610('0xcd')]['belongsTo'](db[_0x8610('0xf8')],{'onDelete':_0x8610('0xfa'),'foreignKey':'FromId'});db[_0x8610('0xcd')]['belongsTo'](db[_0x8610('0xf8')],{'onDelete':_0x8610('0xfa'),'foreignKey':'ToId'});db[_0x8610('0xd1')]['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':_0x8610('0x1a9'),'onDelete':_0x8610('0xfa')});db[_0x8610('0xd1')][_0x8610('0xfc')](db['JscriptyAnswerReport'],{'foreignKey':_0x8610('0x1a9'),'onDelete':'cascade'});db[_0x8610('0x1aa')][_0x8610('0x108')](db[_0x8610('0x50')],{});db['SmsQueueReport'][_0x8610('0x108')](db[_0x8610('0xf1')],{'as':_0x8610('0x14d'),'foreignKey':_0x8610('0x14e')});db[_0x8610('0x1aa')][_0x8610('0x108')](db[_0x8610('0x6c')],{'as':_0x8610('0x144'),'foreignKey':_0x8610('0x145')});db[_0x8610('0x1aa')][_0x8610('0x108')](db['SmsInteraction'],{});db[_0x8610('0x1aa')][_0x8610('0x108')](db[_0x8610('0x54')],{});db[_0x8610('0x1aa')][_0x8610('0x108')](db[_0x8610('0xf8')],{});db[_0x8610('0x1aa')][_0x8610('0x108')](db[_0x8610('0x56')],{});db[_0x8610('0xd6')]['hasMany'](db[_0x8610('0xd1')],{'foreignKey':_0x8610('0x1ab')});db[_0x8610('0xd6')][_0x8610('0xfc')](db[_0x8610('0xd0')],{'foreignKey':'ProjectId'});db['JscriptyProject'][_0x8610('0xfc')](db[_0x8610('0xce')],{'foreignKey':_0x8610('0x1ab')});db['SquareProject'][_0x8610('0x10b')](db[_0x8610('0xf8')],{'as':'Users','through':_0x8610('0x127')});db[_0x8610('0xe2')][_0x8610('0x10b')](db[_0x8610('0xf8')],{'as':_0x8610('0x139'),'through':_0x8610('0x10f')});db[_0x8610('0xe2')][_0x8610('0x10b')](db[_0x8610('0x19')],{'through':_0x8610('0x13b'),'as':_0x8610('0x112')});db[_0x8610('0xe2')][_0x8610('0x10b')](db[_0x8610('0x113')],{'through':_0x8610('0x151'),'as':_0x8610('0x114')});db[_0x8610('0xe2')]['belongsToMany'](db[_0x8610('0x66')],{'through':_0x8610('0x1ac'),'as':_0x8610('0x115')});db[_0x8610('0xe2')][_0x8610('0x10b')](db[_0x8610('0x116')],{'through':_0x8610('0x1ad'),'as':_0x8610('0x117')});db['Team'][_0x8610('0x10b')](db[_0x8610('0x56')],{'through':_0x8610('0x1ae'),'as':_0x8610('0x1af')});db['Team']['belongsToMany'](db['OpenchannelQueue'],{'through':_0x8610('0x16c'),'as':_0x8610('0x11a')});db[_0x8610('0xe4')][_0x8610('0xfc')](db[_0x8610('0x6e')],{'as':_0x8610('0x12f'),'foreignKey':_0x8610('0x17d')});db[_0x8610('0xe4')][_0x8610('0xfc')](db[_0x8610('0x71')],{'as':'HopperFinals','foreignKey':_0x8610('0x17d')});db['Campaign'][_0x8610('0xfc')](db[_0x8610('0x73')],{'as':_0x8610('0x177'),'foreignKey':_0x8610('0x17d')});db[_0x8610('0xe4')][_0x8610('0xfc')](db[_0x8610('0x6f')],{'as':_0x8610('0x130'),'foreignKey':'CampaignId'});db[_0x8610('0xe4')][_0x8610('0x108')](db[_0x8610('0x28')],{'as':_0x8610('0x28'),'foreignKey':'TrunkId'});db[_0x8610('0xe4')][_0x8610('0x108')](db[_0x8610('0x28')],{'as':'TrunkBackup','foreignKey':_0x8610('0x134')});db[_0x8610('0xe4')][_0x8610('0x108')](db[_0x8610('0x81')],{'as':_0x8610('0x81'),'foreignKey':_0x8610('0x135')});db[_0x8610('0xe4')]['belongsTo'](db[_0x8610('0xdc')],{'as':'SquareProject','foreignKey':_0x8610('0x1b0')});db[_0x8610('0xe4')]['belongsToMany'](db[_0x8610('0xf1')],{'as':_0x8610('0x137'),'through':_0x8610('0x1b1')});db['Campaign'][_0x8610('0x10b')](db['CmList'],{'as':_0x8610('0x13c'),'through':_0x8610('0x1b2')});db[_0x8610('0xe9')][_0x8610('0x108')](db[_0x8610('0x3e')],{});db[_0x8610('0xe9')][_0x8610('0x108')](db['MailInteraction'],{});db[_0x8610('0xe9')][_0x8610('0x108')](db['MailAccount'],{'foreignKey':_0x8610('0x1b3'),'as':_0x8610('0x1b4')});db['MailTransferReport'][_0x8610('0x108')](db['User'],{'foreignKey':_0x8610('0x1b5'),'as':'FromAgent'});db[_0x8610('0xe9')]['belongsTo'](db['User'],{'foreignKey':_0x8610('0x1b6'),'as':_0x8610('0x1b7')});db[_0x8610('0xe9')][_0x8610('0x108')](db[_0x8610('0x113')],{'foreignKey':_0x8610('0x1b8'),'as':_0x8610('0x1b9')});db[_0x8610('0xe9')][_0x8610('0x108')](db['MailAccount'],{'foreignKey':_0x8610('0x1ba'),'as':_0x8610('0x1bb')});db['ChatTransferReport'][_0x8610('0x108')](db[_0x8610('0x173')],{});db[_0x8610('0xeb')][_0x8610('0x108')](db[_0x8610('0x63')],{});db[_0x8610('0xeb')]['belongsTo'](db[_0x8610('0x5e')],{'foreignKey':'FromChatWebsiteId','as':_0x8610('0x1b4')});db[_0x8610('0xeb')][_0x8610('0x108')](db[_0x8610('0xf8')],{'foreignKey':_0x8610('0x1b5'),'as':_0x8610('0x1bc')});db['ChatTransferReport'][_0x8610('0x108')](db[_0x8610('0xf8')],{'foreignKey':'ToUserId','as':_0x8610('0x1b7')});db[_0x8610('0xeb')]['belongsTo'](db[_0x8610('0x66')],{'foreignKey':'ToChatQueueId','as':_0x8610('0x1b9')});db['ChatTransferReport'][_0x8610('0x108')](db[_0x8610('0x5e')],{'foreignKey':'ToChatWebsiteId','as':_0x8610('0x1bb')});db[_0x8610('0x1bd')][_0x8610('0x108')](db[_0x8610('0x4b')],{});db[_0x8610('0x1bd')][_0x8610('0x108')](db[_0x8610('0x49')],{});db[_0x8610('0x1bd')][_0x8610('0x108')](db[_0x8610('0x11e')],{'foreignKey':_0x8610('0x1be'),'as':'FromAccount'});db[_0x8610('0x1bd')][_0x8610('0x108')](db[_0x8610('0xf8')],{'foreignKey':_0x8610('0x1b5'),'as':_0x8610('0x1bc')});db[_0x8610('0x1bd')][_0x8610('0x108')](db[_0x8610('0xf8')],{'foreignKey':_0x8610('0x1b6'),'as':'ToAgent'});db[_0x8610('0x1bd')][_0x8610('0x108')](db[_0x8610('0x116')],{'foreignKey':_0x8610('0x1bf'),'as':_0x8610('0x1b9')});db[_0x8610('0x1bd')][_0x8610('0x108')](db[_0x8610('0x11e')],{'foreignKey':_0x8610('0x1c0'),'as':'ToAccount'});db[_0x8610('0x1c1')][_0x8610('0x108')](db[_0x8610('0x5c')],{});db[_0x8610('0x1c1')][_0x8610('0x108')](db['OpenchannelInteraction'],{});db[_0x8610('0x1c1')][_0x8610('0x108')](db[_0x8610('0x122')],{'foreignKey':_0x8610('0x1c2'),'as':_0x8610('0x1b4')});db[_0x8610('0x1c1')][_0x8610('0x108')](db[_0x8610('0xf8')],{'foreignKey':_0x8610('0x1b5'),'as':'FromAgent'});db[_0x8610('0x1c1')][_0x8610('0x108')](db[_0x8610('0xf8')],{'foreignKey':_0x8610('0x1b6'),'as':'ToAgent'});db[_0x8610('0x1c1')][_0x8610('0x108')](db['OpenchannelQueue'],{'foreignKey':'ToOpenchannelQueueId','as':_0x8610('0x1b9')});db[_0x8610('0x1c1')][_0x8610('0x108')](db['OpenchannelAccount'],{'foreignKey':'ToOpenchannelAccountId','as':_0x8610('0x1bb')});db['SmsTransferReport']['belongsTo'](db[_0x8610('0x54')],{});db[_0x8610('0xef')][_0x8610('0x108')](db[_0x8610('0x105')],{});db['SmsTransferReport'][_0x8610('0x108')](db[_0x8610('0x50')],{'foreignKey':'FromSmsAccountId','as':_0x8610('0x1b4')});db[_0x8610('0xef')][_0x8610('0x108')](db[_0x8610('0xf8')],{'foreignKey':_0x8610('0x1b5'),'as':'FromAgent'});db['SmsTransferReport'][_0x8610('0x108')](db[_0x8610('0xf8')],{'foreignKey':_0x8610('0x1b6'),'as':_0x8610('0x1b7')});db[_0x8610('0xef')]['belongsTo'](db[_0x8610('0x56')],{'foreignKey':_0x8610('0x1c3'),'as':'ToQueue'});db[_0x8610('0xef')]['belongsTo'](db[_0x8610('0x50')],{'foreignKey':_0x8610('0x1c4'),'as':_0x8610('0x1bb')});db[_0x8610('0xf1')][_0x8610('0xfc')](db[_0x8610('0x7d')],{'as':_0x8610('0x149'),'foreignKey':_0x8610('0x14e')});db[_0x8610('0xf1')][_0x8610('0xfc')](db['CmCustomField'],{'as':'CustomFields','foreignKey':_0x8610('0x14e')});db[_0x8610('0xf1')][_0x8610('0xfc')](db[_0x8610('0x6c')],{'as':_0x8610('0x10c'),'onDelete':_0x8610('0xfa'),'foreignKey':_0x8610('0x14e')});db[_0x8610('0xf1')][_0x8610('0xfc')](db['CmHopperFinal'],{'as':_0x8610('0x101'),'foreignKey':'ListId'});db[_0x8610('0xf1')][_0x8610('0xfc')](db['CmHopperHistory'],{'as':_0x8610('0x102'),'foreignKey':_0x8610('0x14e')});db[_0x8610('0xf1')]['hasMany'](db[_0x8610('0x75')],{'as':_0x8610('0x75'),'foreignKey':'ListId'});db[_0x8610('0xf1')]['belongsToMany'](db[_0x8610('0x19')],{'as':_0x8610('0x1c5'),'through':_0x8610('0x138')});db[_0x8610('0xf1')][_0x8610('0x10b')](db[_0x8610('0xf8')],{'as':_0x8610('0x139'),'through':_0x8610('0x10e')});db[_0x8610('0x11b')][_0x8610('0xfc')](db[_0x8610('0xff')],{'as':'Extensions','onDelete':'restrict'});db[_0x8610('0x11b')][_0x8610('0x10b')](db[_0x8610('0xf8')],{'as':_0x8610('0x139'),'through':_0x8610('0x1c6')});db[_0x8610('0xf3')][_0x8610('0xfc')](db[_0x8610('0xf8')],{'as':_0x8610('0x159'),'foreignKey':_0x8610('0x1c7')});db[_0x8610('0xf3')][_0x8610('0xfc')](db['UserProfileSection'],{'as':_0x8610('0x1c8'),'foreignKey':'userProfileId','onDelete':_0x8610('0xfa')});db[_0x8610('0xf4')]['hasMany'](db[_0x8610('0xf6')],{'as':_0x8610('0x1c9'),'foreignKey':'sectionId','onDelete':'cascade'});module[_0x8610('0x1ca')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xdcf2=['../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../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','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','License','../api/license/license.model','Campaign','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','../api/userProfileSection/userProfileSection.model','UserProfileResource','hasOne','cascade','UserId','hasMany','Recordings','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteractions','FaxInteractions','MailInteractions','belongsTo','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','VoiceQueues','UserVoiceQueue','MailQueues','FaxQueues','SmsQueues','OpenchannelQueue','OpenchannelQueues','user_has_voice_prefixes','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccount','OpenchannelAccounts','SmsAccount','SmsAccounts','SpiedAgents','ChanSpyId','Applications','Sound','Sounds','moh_has_sounds','Members','VoiceQueueId','CmHopper','Hoppers','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','Agents','team_has_voice_queues','BlackLists','voice_queues_has_cm_blacklists','VoiceMailMessage','mailboxuser','ContactId','MailAccountId','Smtp','Dispositions','Messages','MailInteraction','Interactions','ListId','TemplateId','team_has_mail_queues','Teams','MailInteractionId','Contact','Owner','mail_interaction_has_tags','Tags','Users','Attachments','Interaction','restrict','TagId','MailQueueReport','List','Items','FaxAccountId','CannedAnswer','Answers','Exntensions','FaxInteractionId','fax_interaction_has_tags','ThroughTags','FaxMessage','AttachmentId','Account','team_has_fax_queues','FaxQueueReport','SmsAccountId','SmsMessage','user_has_sms_accounts','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','user_has_openchannel_accounts','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','ChatApplication','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','ChatOfflineMessage','ChatQueue','team_has_chat_queues','ChatGroupId','CompanyId','SmsInteractions','Company','cm_contact_has_tags','OwnerId','CampaignId','All','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','AutomationId','Intervals','Extensions','FaxApplications','SmsApplications','Schedule','DefaultReportId','CustomReportId','Mohs','AllCondition','TriggerAllId','Trigger','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','AnalyticMetric','MetricId','Configurations','AccountId','Subjects','SubjectId','Descriptions','FieldId','Subject','DescriptionId','Field','Variable','VariableId','SugarcrmField','SugarcrmAccount','int_desk_configuration_has_tags','Description','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskField','int_freshdesk_configuration_has_tags','VtigerField','ServicenowAccount','ServicenowConfiguration','FreshsalesAccount','ToId','SessionId','ProjectId','user_has_square_projects','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToQueue','ToMailAccountId','ToAccount','ChatTransferReport','FromChatWebsiteId','ToAgent','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','UserProfileSections','userProfileId','Resources','sectionId','exports','path','sequelize','determine','defaultsDeep','motion2','xcall','mysql','utf8mb4','name','utf8_general_ci','sequelizeHistory','xC@LL1234','127.0.0.1','database','username','password','options','User','VoiceChanSpy','import','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxMessage/faxMessage.model','FaxQueue','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','ChatWebsite','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','CmContact','../api/cmContact/cmContact.model','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','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','../api/sound/sound.model','Tag','../api/tag/tag.model','../api/trigger/trigger.model','Integration','../api/integration/integration.model','IntegrationReport','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','AnalyticTreeReport','SalesforceAccount','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerField/intVtigerField.model','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0xdcf2,0x115));var _0x2dcf=function(_0xb614e8,_0x302855){_0xb614e8=_0xb614e8-0x0;var _0x1b3bb1=_0xdcf2[_0xb614e8];return _0x1b3bb1;};'use strict';var path=require(_0x2dcf('0x0'));var config=require('../config/environment');var Sequelize=require(_0x2dcf('0x1'));var _=require('lodash');var jstz=require('jstz');var timezone=jstz[_0x2dcf('0x2')]();config[_0x2dcf('0x1')]=_[_0x2dcf('0x3')](config[_0x2dcf('0x1')],{'database':_0x2dcf('0x4'),'username':_0x2dcf('0x5'),'password':'xC@LL1234','options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x2dcf('0x6'),'dialectOptions':{'charset':_0x2dcf('0x7')},'logging':![],'timezone':timezone[_0x2dcf('0x8')](),'define':{'charset':'utf8','collate':_0x2dcf('0x9')}}});config['sequelizeHistory']=_['defaultsDeep'](config[_0x2dcf('0xa')],{'database':_0x2dcf('0x4'),'username':_0x2dcf('0x5'),'password':_0x2dcf('0xb'),'options':{'host':_0x2dcf('0xc'),'port':0xcea,'dialect':_0x2dcf('0x6'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x2dcf('0x1')][_0x2dcf('0xd')],config['sequelize'][_0x2dcf('0xe')],config[_0x2dcf('0x1')][_0x2dcf('0xf')],config['sequelize'][_0x2dcf('0x10')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x2dcf('0xa')][_0x2dcf('0xd')],config[_0x2dcf('0xa')]['username'],config['sequelizeHistory'][_0x2dcf('0xf')],config[_0x2dcf('0xa')][_0x2dcf('0x10')])};db[_0x2dcf('0x11')]=db['sequelize']['import']('../api/user/user.model');db[_0x2dcf('0x12')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0x14'));db[_0x2dcf('0x15')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0x16'));db[_0x2dcf('0x17')]=db['sequelize']['import'](_0x2dcf('0x18'));db[_0x2dcf('0x19')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0x1a'));db[_0x2dcf('0x1b')]=db['sequelize'][_0x2dcf('0x13')](_0x2dcf('0x1c'));db[_0x2dcf('0x1d')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0x1e'));db[_0x2dcf('0x1f')]=db[_0x2dcf('0x1')]['import'](_0x2dcf('0x20'));db[_0x2dcf('0x21')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0x22'));db['VoiceMailMessage']=db['sequelize'][_0x2dcf('0x13')](_0x2dcf('0x23'));db[_0x2dcf('0x24')]=db['sequelize'][_0x2dcf('0x13')](_0x2dcf('0x25'));db[_0x2dcf('0x26')]=db['sequelize'][_0x2dcf('0x13')](_0x2dcf('0x27'));db[_0x2dcf('0x28')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0x29'));db[_0x2dcf('0x2a')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0x2b'));db[_0x2dcf('0x2c')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')]('../api/memberReport/memberReport.model');db[_0x2dcf('0x2d')]=db[_0x2dcf('0x1')]['import'](_0x2dcf('0x2e'));db[_0x2dcf('0x2f')]=db['sequelize']['import'](_0x2dcf('0x30'));db[_0x2dcf('0x31')]=db['sequelize'][_0x2dcf('0x13')](_0x2dcf('0x32'));db['UserVoiceQueue']=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0x33'));db[_0x2dcf('0x34')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0x35'));db[_0x2dcf('0x36')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0x37'));db[_0x2dcf('0x38')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0x39'));db[_0x2dcf('0x3a')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')]('../api/userSmsQueue/userSmsQueue.model');db[_0x2dcf('0x3b')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0x2dcf('0x3c')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0x3d'));db[_0x2dcf('0x3e')]=db['sequelize']['import'](_0x2dcf('0x3f'));db[_0x2dcf('0x40')]=db[_0x2dcf('0x1')]['import'](_0x2dcf('0x41'));db[_0x2dcf('0x42')]=db['sequelize']['import'](_0x2dcf('0x43'));db[_0x2dcf('0x44')]=db['sequelize'][_0x2dcf('0x13')](_0x2dcf('0x45'));db['MailInteraction']=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0x46'));db[_0x2dcf('0x47')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0x48'));db[_0x2dcf('0x49')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0x4a'));db['MailQueueReport']=db[_0x2dcf('0x1')]['import'](_0x2dcf('0x4b'));db['Dashboard']=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0x4c'));db[_0x2dcf('0x4d')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0x4e'));db[_0x2dcf('0x4f')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0x50'));db[_0x2dcf('0x51')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0x52'));db[_0x2dcf('0x53')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')]('../api/faxInteraction/faxInteraction.model');db['FaxMessage']=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0x54'));db[_0x2dcf('0x55')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')]('../api/faxQueue/faxQueue.model');db['FaxQueueReport']=db['sequelize'][_0x2dcf('0x13')]('../api/faxQueueReport/faxQueueReport.model');db['SmsAccount']=db['sequelize'][_0x2dcf('0x13')](_0x2dcf('0x56'));db[_0x2dcf('0x57')]=db['sequelize'][_0x2dcf('0x13')](_0x2dcf('0x58'));db[_0x2dcf('0x59')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')]('../api/smsInteraction/smsInteraction.model');db['SmsMessage']=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0x5a'));db[_0x2dcf('0x5b')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0x5c'));db['OpenchannelAccount']=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0x5d'));db[_0x2dcf('0x5e')]=db['sequelize']['import'](_0x2dcf('0x5f'));db[_0x2dcf('0x60')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x2dcf('0x61')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0x62'));db['OpenchannelQueue']=db[_0x2dcf('0x1')][_0x2dcf('0x13')]('../api/openchannelQueue/openchannelQueue.model');db[_0x2dcf('0x63')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')]('../api/chatWebsite/chatWebsite.model');db[_0x2dcf('0x64')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0x65'));db['ChatApplication']=db[_0x2dcf('0x1')][_0x2dcf('0x13')]('../api/chatApplication/chatApplication.model');db[_0x2dcf('0x66')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0x67'));db[_0x2dcf('0x68')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0x69'));db['ChatOfflineMessage']=db['sequelize']['import'](_0x2dcf('0x6a'));db['ChatQueue']=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0x6b'));db[_0x2dcf('0x6c')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0x6d'));db[_0x2dcf('0x6e')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0x6f'));db[_0x2dcf('0x70')]=db['sequelize']['import']('../api/cmCompany/cmCompany.model');db[_0x2dcf('0x71')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0x72'));db['CmHopper']=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0x73'));db[_0x2dcf('0x74')]=db[_0x2dcf('0x1')]['import'](_0x2dcf('0x75'));db[_0x2dcf('0x76')]=db['sequelize'][_0x2dcf('0x13')](_0x2dcf('0x77'));db[_0x2dcf('0x78')]=db[_0x2dcf('0x1')]['import']('../api/cmHopperHistory/cmHopperHistory.model');db[_0x2dcf('0x79')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0x7a'));db[_0x2dcf('0x7b')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0x7c'));db[_0x2dcf('0x7d')]=db[_0x2dcf('0x1')]['import'](_0x2dcf('0x7e'));db[_0x2dcf('0x7f')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')]('../api/automation/automation.model');db['CannedAnswer']=db[_0x2dcf('0x1')][_0x2dcf('0x13')]('../api/cannedAnswer/cannedAnswer.model');db[_0x2dcf('0x80')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0x81'));db[_0x2dcf('0x82')]=db['sequelize'][_0x2dcf('0x13')](_0x2dcf('0x83'));db[_0x2dcf('0x84')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0x85'));db[_0x2dcf('0x86')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0x87'));db[_0x2dcf('0x88')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0x89'));db['VoiceQueuesLog']=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0x8a'));db['Schedule']=db[_0x2dcf('0x1')][_0x2dcf('0x13')]('../api/schedule/schedule.model');db['Sound']=db[_0x2dcf('0x1')]['import'](_0x2dcf('0x8b'));db[_0x2dcf('0x8c')]=db['sequelize']['import'](_0x2dcf('0x8d'));db['Template']=db[_0x2dcf('0x1')]['import']('../api/template/template.model');db['Trigger']=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0x8e'));db['Variable']=db[_0x2dcf('0x1')]['import']('../api/variable/variable.model');db[_0x2dcf('0x8f')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0x90'));db[_0x2dcf('0x91')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')]('../api/integrationReport/integrationReport.model');db[_0x2dcf('0x92')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0x93'));db[_0x2dcf('0x94')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0x2dcf('0x95')]=db['sequelize'][_0x2dcf('0x13')](_0x2dcf('0x96'));db['AnalyticMetric']=db[_0x2dcf('0x1')]['import'](_0x2dcf('0x97'));db[_0x2dcf('0x98')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')]('../api/analyticFieldReport/analyticFieldReport.model');db[_0x2dcf('0x99')]=db['sequelize'][_0x2dcf('0x13')]('../api/analyticTreeReport/analyticTreeReport.model');db[_0x2dcf('0x9a')]=db[_0x2dcf('0x1')]['import']('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0x2dcf('0x9b')]=db[_0x2dcf('0x1')]['import'](_0x2dcf('0x9c'));db[_0x2dcf('0x9d')]=db['sequelize'][_0x2dcf('0x13')]('../api/intSalesforceField/intSalesforceField.model');db['SugarcrmAccount']=db['sequelize'][_0x2dcf('0x13')](_0x2dcf('0x9e'));db[_0x2dcf('0x9f')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0xa0'));db['SugarcrmField']=db[_0x2dcf('0x1')]['import'](_0x2dcf('0xa1'));db[_0x2dcf('0xa2')]=db[_0x2dcf('0x1')]['import'](_0x2dcf('0xa3'));db[_0x2dcf('0xa4')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0xa5'));db[_0x2dcf('0xa6')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0xa7'));db[_0x2dcf('0xa8')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')]('../api/intZohoAccount/intZohoAccount.model');db[_0x2dcf('0xa9')]=db['sequelize'][_0x2dcf('0x13')](_0x2dcf('0xaa'));db[_0x2dcf('0xab')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')]('../api/intZohoField/intZohoField.model');db[_0x2dcf('0xac')]=db['sequelize'][_0x2dcf('0x13')](_0x2dcf('0xad'));db['ZendeskConfiguration']=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0xae'));db[_0x2dcf('0xaf')]=db['sequelize'][_0x2dcf('0x13')]('../api/intZendeskField/intZendeskField.model');db[_0x2dcf('0xb0')]=db['sequelize'][_0x2dcf('0x13')](_0x2dcf('0xb1'));db[_0x2dcf('0xb2')]=db['sequelize'][_0x2dcf('0x13')](_0x2dcf('0xb3'));db['FreshdeskField']=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0xb4'));db[_0x2dcf('0xb5')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0xb6'));db[_0x2dcf('0xb7')]=db['sequelize'][_0x2dcf('0x13')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db['VtigerField']=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0xb8'));db['ServicenowAccount']=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0xb9'));db['ServicenowConfiguration']=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0xba'));db[_0x2dcf('0xbb')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')]('../api/intServicenowField/intServicenowField.model');db[_0x2dcf('0xbc')]=db[_0x2dcf('0x1')]['import'](_0x2dcf('0xbd'));db[_0x2dcf('0xbe')]=db['sequelize'][_0x2dcf('0x13')](_0x2dcf('0xbf'));db[_0x2dcf('0xc0')]=db[_0x2dcf('0x1')]['import']('../api/intDynamics365Field/intDynamics365Field.model');db['FreshsalesAccount']=db['sequelize'][_0x2dcf('0x13')](_0x2dcf('0xc1'));db[_0x2dcf('0xc2')]=db[_0x2dcf('0x1')]['import'](_0x2dcf('0xc3'));db[_0x2dcf('0xc4')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0xc5'));db[_0x2dcf('0x8f')]=db[_0x2dcf('0x1')]['import']('../api/integration/integration.model');db[_0x2dcf('0xc6')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0xc7'));db[_0x2dcf('0xc8')]=db[_0x2dcf('0x1')]['import'](_0x2dcf('0xc9'));db[_0x2dcf('0xca')]=db['sequelize'][_0x2dcf('0x13')](_0x2dcf('0xcb'));db[_0x2dcf('0xcc')]=db['sequelize'][_0x2dcf('0x13')](_0x2dcf('0xcd'));db[_0x2dcf('0xce')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0x2dcf('0xcf')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0xd0'));db[_0x2dcf('0xd1')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0xd2'));db[_0x2dcf('0xd3')]=db[_0x2dcf('0x1')]['import'](_0x2dcf('0xd4'));db[_0x2dcf('0xd5')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')]('../api/squareReportDetail/squareReportDetail.model');db[_0x2dcf('0xd6')]=db[_0x2dcf('0x1')]['import'](_0x2dcf('0xd7'));db[_0x2dcf('0xd8')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')]('../api/setting/setting.model');db[_0x2dcf('0xd9')]=db['sequelize'][_0x2dcf('0x13')](_0x2dcf('0xda'));db[_0x2dcf('0xdb')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0xdc'));db['SquareRecording']=db['sequelize'][_0x2dcf('0x13')](_0x2dcf('0xdd'));db[_0x2dcf('0xde')]=db['sequelize']['import'](_0x2dcf('0xdf'));db[_0x2dcf('0xe0')]=db['sequelize'][_0x2dcf('0x13')]('../api/team/team.model');db[_0x2dcf('0xe1')]=db[_0x2dcf('0x1')]['import'](_0x2dcf('0xe2'));db[_0x2dcf('0xe3')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')]('../api/campaign/campaign.model');db[_0x2dcf('0xe4')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0xe5'));db[_0x2dcf('0xe6')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0xe7'));db[_0x2dcf('0xe8')]=db[_0x2dcf('0x1')]['import'](_0x2dcf('0xe9'));db[_0x2dcf('0xea')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0xeb'));db['ChatTransferReport']=db['sequelize'][_0x2dcf('0x13')]('../api/chatTransferReport/chatTransferReport.model');db[_0x2dcf('0xec')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0xed'));db[_0x2dcf('0xee')]=db['sequelize'][_0x2dcf('0x13')](_0x2dcf('0xef'));db[_0x2dcf('0xf0')]=db['sequelize'][_0x2dcf('0x13')](_0x2dcf('0xf1'));db[_0x2dcf('0xf2')]=db['sequelize']['import'](_0x2dcf('0xf3'));db[_0x2dcf('0xf4')]=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0xf5'));db[_0x2dcf('0xf6')]=db['sequelize'][_0x2dcf('0x13')](_0x2dcf('0xf7'));db['UserProfileSection']=db[_0x2dcf('0x1')][_0x2dcf('0x13')](_0x2dcf('0xf8'));db[_0x2dcf('0xf9')]=db[_0x2dcf('0x1')]['import']('../api/userProfileResource/userProfileResource.model');db[_0x2dcf('0x11')][_0x2dcf('0xfa')](db['VoiceMail'],{'as':_0x2dcf('0x21'),'onDelete':_0x2dcf('0xfb'),'foreignKey':_0x2dcf('0xfc')});db[_0x2dcf('0x11')][_0x2dcf('0xfd')](db['VoiceRecording'],{'as':_0x2dcf('0xfe'),'foreignKey':_0x2dcf('0xfc')});db[_0x2dcf('0x11')][_0x2dcf('0xfd')](db[_0x2dcf('0x31')],{'as':'VoiceQueuesRt','foreignKey':_0x2dcf('0xfc')});db[_0x2dcf('0x11')][_0x2dcf('0xfd')](db[_0x2dcf('0x17')],{'as':'Extensions','onDelete':_0x2dcf('0xfb'),'hooks':!![]});db['User'][_0x2dcf('0xfd')](db[_0x2dcf('0x76')],{'as':_0x2dcf('0xff'),'foreignKey':_0x2dcf('0xfc')});db['User']['hasMany'](db['CmHopperHistory'],{'as':_0x2dcf('0x100'),'foreignKey':_0x2dcf('0xfc')});db[_0x2dcf('0x11')]['hasMany'](db[_0x2dcf('0x79')],{'as':_0x2dcf('0x79'),'foreignKey':_0x2dcf('0xfc')});db[_0x2dcf('0x11')][_0x2dcf('0xfd')](db[_0x2dcf('0x60')],{'as':_0x2dcf('0x101'),'foreignKey':_0x2dcf('0xfc')});db['User'][_0x2dcf('0xfd')](db[_0x2dcf('0x66')],{'as':_0x2dcf('0x102'),'foreignKey':_0x2dcf('0xfc')});db[_0x2dcf('0x11')]['hasMany'](db[_0x2dcf('0x59')],{'as':'SmsInteractions','foreignKey':'UserId'});db['User'][_0x2dcf('0xfd')](db[_0x2dcf('0x53')],{'as':_0x2dcf('0x103'),'foreignKey':_0x2dcf('0xfc')});db[_0x2dcf('0x11')][_0x2dcf('0xfd')](db['MailInteraction'],{'as':_0x2dcf('0x104'),'foreignKey':_0x2dcf('0xfc')});db[_0x2dcf('0x11')][_0x2dcf('0x105')](db[_0x2dcf('0xf6')],{'as':_0x2dcf('0xf6'),'foreignKey':'userProfileId'});db[_0x2dcf('0x11')][_0x2dcf('0x106')](db[_0x2dcf('0x6c')],{'as':_0x2dcf('0x107'),'through':_0x2dcf('0x108')});db[_0x2dcf('0x11')][_0x2dcf('0x106')](db[_0x2dcf('0x71')],{'as':_0x2dcf('0x109'),'through':_0x2dcf('0x10a')});db[_0x2dcf('0x11')][_0x2dcf('0x106')](db[_0x2dcf('0xf2')],{'as':_0x2dcf('0x10b'),'through':_0x2dcf('0x10c')});db[_0x2dcf('0x11')][_0x2dcf('0x106')](db[_0x2dcf('0xe0')],{'through':_0x2dcf('0x10d')});db[_0x2dcf('0x11')][_0x2dcf('0x106')](db['MailInteraction'],{'as':_0x2dcf('0x104'),'through':_0x2dcf('0x10e')});db[_0x2dcf('0x11')][_0x2dcf('0x106')](db[_0x2dcf('0x66')],{'as':_0x2dcf('0x102'),'through':_0x2dcf('0x10f')});db[_0x2dcf('0x11')][_0x2dcf('0x106')](db['FaxInteraction'],{'as':_0x2dcf('0x103'),'through':_0x2dcf('0x110')});db['User'][_0x2dcf('0x106')](db[_0x2dcf('0x59')],{'as':'SmsInteractions','through':_0x2dcf('0x111')});db[_0x2dcf('0x11')][_0x2dcf('0x106')](db['OpenchannelInteraction'],{'as':_0x2dcf('0x101'),'through':_0x2dcf('0x112')});db[_0x2dcf('0x11')]['belongsToMany'](db[_0x2dcf('0x1b')],{'as':_0x2dcf('0x113'),'through':_0x2dcf('0x114'),'required':![]});db[_0x2dcf('0x11')]['belongsToMany'](db[_0x2dcf('0x42')],{'as':_0x2dcf('0x115'),'through':_0x2dcf('0x36'),'required':![]});db[_0x2dcf('0x11')]['belongsToMany'](db['ChatQueue'],{'as':'ChatQueues','through':'UserChatQueue','required':![],'hooks':!![]});db[_0x2dcf('0x11')][_0x2dcf('0x106')](db[_0x2dcf('0x55')],{'as':_0x2dcf('0x116'),'through':_0x2dcf('0x38'),'required':![]});db[_0x2dcf('0x11')][_0x2dcf('0x106')](db[_0x2dcf('0x5b')],{'as':_0x2dcf('0x117'),'through':_0x2dcf('0x3a'),'required':![]});db[_0x2dcf('0x11')][_0x2dcf('0x106')](db[_0x2dcf('0x118')],{'as':_0x2dcf('0x119'),'through':_0x2dcf('0x3b'),'required':![]});db['User'][_0x2dcf('0x106')](db[_0x2dcf('0xf2')],{'through':_0x2dcf('0x10c')});db[_0x2dcf('0x11')]['belongsToMany'](db[_0x2dcf('0xf4')],{'as':'VoicePrefixes','through':_0x2dcf('0x11a'),'required':![]});db[_0x2dcf('0x11')][_0x2dcf('0x106')](db[_0x2dcf('0x63')],{'as':_0x2dcf('0x11b'),'through':_0x2dcf('0x11c')});db[_0x2dcf('0x11')]['belongsToMany'](db[_0x2dcf('0x4f')],{'as':_0x2dcf('0x11d'),'through':_0x2dcf('0x11e')});db[_0x2dcf('0x11')][_0x2dcf('0x106')](db['MailAccount'],{'as':_0x2dcf('0x11f'),'through':_0x2dcf('0x120')});db['User']['belongsToMany'](db[_0x2dcf('0x121')],{'as':_0x2dcf('0x122'),'through':'user_has_openchannel_accounts'});db[_0x2dcf('0x11')][_0x2dcf('0x106')](db[_0x2dcf('0x123')],{'as':_0x2dcf('0x124'),'through':'user_has_sms_accounts'});db['User'][_0x2dcf('0x106')](db['SquareProject'],{'as':'SquareProjects','through':'user_has_square_projects'});db['VoiceChanSpy'][_0x2dcf('0xfd')](db[_0x2dcf('0x17')],{'as':_0x2dcf('0x125'),'onDelete':'cascade','foreignKey':_0x2dcf('0x126')});db['VoiceContext'][_0x2dcf('0xfd')](db['VoiceExtension'],{'onDelete':'cascade'});db['VoiceExtension'][_0x2dcf('0xfd')](db[_0x2dcf('0x17')],{'as':_0x2dcf('0x127'),'onDelete':'cascade'});db[_0x2dcf('0x19')][_0x2dcf('0x106')](db[_0x2dcf('0x128')],{'as':_0x2dcf('0x129'),'through':_0x2dcf('0x12a')});db[_0x2dcf('0x1b')][_0x2dcf('0xfd')](db[_0x2dcf('0x31')],{'as':_0x2dcf('0x12b'),'foreignKey':_0x2dcf('0x12c')});db[_0x2dcf('0x1b')][_0x2dcf('0xfd')](db[_0x2dcf('0x12d')],{'as':_0x2dcf('0x12e'),'foreignKey':_0x2dcf('0x12c')});db[_0x2dcf('0x1b')]['hasMany'](db[_0x2dcf('0x76')],{'as':_0x2dcf('0xff'),'foreignKey':_0x2dcf('0x12c')});db[_0x2dcf('0x1b')]['hasMany'](db[_0x2dcf('0x78')],{'as':_0x2dcf('0x12f'),'foreignKey':_0x2dcf('0x12c')});db[_0x2dcf('0x1b')][_0x2dcf('0xfd')](db['ReportAgentPreview'],{'as':_0x2dcf('0x79'),'foreignKey':_0x2dcf('0x12c')});db[_0x2dcf('0x1b')][_0x2dcf('0xfd')](db[_0x2dcf('0x74')],{'as':_0x2dcf('0x130'),'foreignKey':_0x2dcf('0x12c')});db[_0x2dcf('0x1b')][_0x2dcf('0xfd')](db[_0x2dcf('0xcf')],{'as':_0x2dcf('0x131'),'foreignKey':_0x2dcf('0x12c')});db['VoiceQueue']['belongsTo'](db[_0x2dcf('0x2d')],{'as':'Trunk','foreignKey':_0x2dcf('0x132')});db[_0x2dcf('0x1b')][_0x2dcf('0x105')](db['Trunk'],{'as':_0x2dcf('0x133'),'foreignKey':_0x2dcf('0x134')});db[_0x2dcf('0x1b')]['belongsTo'](db['Interval'],{'as':'Interval','foreignKey':_0x2dcf('0x135')});db['VoiceQueue'][_0x2dcf('0x105')](db['Pause'],{'as':_0x2dcf('0x136'),'foreignKey':_0x2dcf('0x137')});db['VoiceQueue']['belongsToMany'](db['CmList'],{'as':'Lists','through':'voice_queues_has_cm_lists'});db['VoiceQueue'][_0x2dcf('0x106')](db['User'],{'as':_0x2dcf('0x138'),'through':'UserVoiceQueue'});db[_0x2dcf('0x1b')]['belongsToMany'](db[_0x2dcf('0xe0')],{'as':'Teams','through':_0x2dcf('0x139')});db[_0x2dcf('0x1b')][_0x2dcf('0x106')](db['CmList'],{'as':_0x2dcf('0x13a'),'through':_0x2dcf('0x13b')});db['VoiceRecording'][_0x2dcf('0x105')](db[_0x2dcf('0x11')],{'as':_0x2dcf('0x11'),'foreignKey':_0x2dcf('0xfc')});db[_0x2dcf('0x1f')][_0x2dcf('0x105')](db[_0x2dcf('0x11')],{'as':_0x2dcf('0x11'),'foreignKey':_0x2dcf('0xfc')});db[_0x2dcf('0x21')][_0x2dcf('0xfd')](db[_0x2dcf('0x13c')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x2dcf('0x13d'),'sourceKey':'mailbox'});db[_0x2dcf('0x13c')][_0x2dcf('0x105')](db[_0x2dcf('0x21')],{'foreignKey':'mailboxuser','targetKey':'mailbox'});db[_0x2dcf('0x24')][_0x2dcf('0xfd')](db['VoiceQueueReport'],{'as':'QueueCalls','foreignKey':'uniqueid','constraints':![]});db['VoiceCallReport']['hasMany'](db[_0x2dcf('0x28')],{'as':'AgentReports','foreignKey':'uniqueid','constraints':![]});db[_0x2dcf('0x24')][_0x2dcf('0x105')](db[_0x2dcf('0x11')],{'as':'User','foreignKey':'UserId'});db[_0x2dcf('0x24')][_0x2dcf('0x105')](db[_0x2dcf('0x71')],{'as':'Contact','foreignKey':_0x2dcf('0x13e')});db[_0x2dcf('0x3c')][_0x2dcf('0x105')](db[_0x2dcf('0x40')],{'as':_0x2dcf('0x40'),'foreignKey':_0x2dcf('0x13f')});db[_0x2dcf('0x3e')][_0x2dcf('0x105')](db['MailAccount'],{'as':_0x2dcf('0x40'),'foreignKey':'MailAccountId'});db[_0x2dcf('0x40')][_0x2dcf('0xfa')](db[_0x2dcf('0x3c')],{'as':'Imap','onDelete':_0x2dcf('0xfb')});db[_0x2dcf('0x40')][_0x2dcf('0xfa')](db['MailServerOut'],{'as':_0x2dcf('0x140'),'onDelete':'cascade'});db[_0x2dcf('0x40')][_0x2dcf('0xfd')](db[_0x2dcf('0x80')],{'as':_0x2dcf('0x141'),'foreignKey':_0x2dcf('0x13f')});db[_0x2dcf('0x40')]['hasMany'](db['CannedAnswer'],{'as':'Answers','foreignKey':'MailAccountId'});db[_0x2dcf('0x40')][_0x2dcf('0xfd')](db[_0x2dcf('0x47')],{'as':_0x2dcf('0x142'),'foreignKey':_0x2dcf('0x13f')});db[_0x2dcf('0x40')][_0x2dcf('0xfd')](db[_0x2dcf('0x143')],{'as':_0x2dcf('0x144')});db[_0x2dcf('0x40')][_0x2dcf('0xfd')](db[_0x2dcf('0x49')],{'as':_0x2dcf('0x127')});db[_0x2dcf('0x40')][_0x2dcf('0x105')](db[_0x2dcf('0xf2')],{'as':'List','foreignKey':_0x2dcf('0x145')});db['MailAccount'][_0x2dcf('0x105')](db['Template'],{'as':'Template','foreignKey':_0x2dcf('0x146')});db[_0x2dcf('0x40')][_0x2dcf('0x105')](db[_0x2dcf('0x86')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db['MailAccount'][_0x2dcf('0x106')](db['User'],{'as':_0x2dcf('0x138'),'through':'user_has_mail_accounts'});db['MailQueue']['belongsToMany'](db[_0x2dcf('0x11')],{'as':'Agents','through':_0x2dcf('0x36')});db[_0x2dcf('0x42')][_0x2dcf('0x106')](db[_0x2dcf('0xe0')],{'through':_0x2dcf('0x147'),'as':_0x2dcf('0x148')});db['MailInteraction'][_0x2dcf('0xfd')](db[_0x2dcf('0x47')],{'as':_0x2dcf('0x142'),'onDelete':_0x2dcf('0xfb'),'foreignKey':_0x2dcf('0x149')});db[_0x2dcf('0x143')]['belongsTo'](db[_0x2dcf('0x40')],{'as':'Account','foreignKey':'MailAccountId'});db[_0x2dcf('0x143')][_0x2dcf('0x105')](db[_0x2dcf('0x71')],{'as':_0x2dcf('0x14a'),'foreignKey':_0x2dcf('0x13e')});db[_0x2dcf('0x143')][_0x2dcf('0x105')](db[_0x2dcf('0x11')],{'as':_0x2dcf('0x14b'),'foreignKey':_0x2dcf('0xfc')});db['MailInteraction'][_0x2dcf('0x106')](db[_0x2dcf('0x8c')],{'through':_0x2dcf('0x14c'),'as':_0x2dcf('0x14d')});db[_0x2dcf('0x143')][_0x2dcf('0x106')](db[_0x2dcf('0x8c')],{'through':'mail_interaction_has_tags','as':'ThroughTags'});db[_0x2dcf('0x143')]['belongsToMany'](db[_0x2dcf('0x11')],{'as':_0x2dcf('0x14e'),'through':'user_has_mail_interactions','foreignKey':_0x2dcf('0x149')});db['MailMessage'][_0x2dcf('0xfd')](db[_0x2dcf('0xe6')],{'as':_0x2dcf('0x14f'),'onDelete':_0x2dcf('0xfb')});db[_0x2dcf('0x47')][_0x2dcf('0x105')](db[_0x2dcf('0x11')],{'as':_0x2dcf('0x11')});db['MailMessage'][_0x2dcf('0x105')](db[_0x2dcf('0x71')],{'onDelete':_0x2dcf('0xfb'),'as':'Contact'});db[_0x2dcf('0x47')][_0x2dcf('0x105')](db[_0x2dcf('0x143')],{'as':_0x2dcf('0x150'),'foreignKey':_0x2dcf('0x149')});db[_0x2dcf('0x47')][_0x2dcf('0x105')](db[_0x2dcf('0x40')],{'as':'Account','foreignKey':_0x2dcf('0x13f')});db[_0x2dcf('0x49')]['belongsTo'](db[_0x2dcf('0x11')],{'onDelete':_0x2dcf('0x151')});db[_0x2dcf('0x49')][_0x2dcf('0x105')](db[_0x2dcf('0x42')],{'onDelete':_0x2dcf('0x151')});db[_0x2dcf('0x49')]['belongsTo'](db[_0x2dcf('0x40')],{'onDelete':_0x2dcf('0x151')});db[_0x2dcf('0x49')][_0x2dcf('0x105')](db[_0x2dcf('0x84')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0x2dcf('0x49')]['belongsTo'](db['Tag'],{'onDelete':_0x2dcf('0x151'),'foreignKey':_0x2dcf('0x152')});db[_0x2dcf('0x153')]['belongsTo'](db['MailAccount'],{});db['MailQueueReport'][_0x2dcf('0x105')](db[_0x2dcf('0xf2')],{'as':_0x2dcf('0x154'),'foreignKey':_0x2dcf('0x145')});db['MailQueueReport']['belongsTo'](db[_0x2dcf('0x71')],{'as':_0x2dcf('0x14a'),'foreignKey':_0x2dcf('0x13e')});db['MailQueueReport'][_0x2dcf('0x105')](db[_0x2dcf('0x143')],{});db['MailQueueReport']['belongsTo'](db[_0x2dcf('0x47')],{});db[_0x2dcf('0x153')][_0x2dcf('0x105')](db['User'],{});db[_0x2dcf('0x153')][_0x2dcf('0x105')](db['MailQueue'],{});db['Dashboard']['hasMany'](db['DashboardItem'],{'as':_0x2dcf('0x155'),'onDelete':_0x2dcf('0xfb')});db['FaxAccount']['hasMany'](db[_0x2dcf('0x80')],{'as':_0x2dcf('0x141'),'foreignKey':_0x2dcf('0x156')});db[_0x2dcf('0x4f')][_0x2dcf('0xfd')](db[_0x2dcf('0x157')],{'as':_0x2dcf('0x158'),'foreignKey':'FaxAccountId'});db[_0x2dcf('0x4f')][_0x2dcf('0xfd')](db[_0x2dcf('0x53')],{'as':_0x2dcf('0x144')});db[_0x2dcf('0x4f')]['hasMany'](db[_0x2dcf('0x51')],{'as':_0x2dcf('0x127')});db[_0x2dcf('0x4f')]['hasMany'](db[_0x2dcf('0x17')],{'as':_0x2dcf('0x159'),'onDelete':_0x2dcf('0xfb')});db['FaxAccount'][_0x2dcf('0xfd')](db['FaxMessage'],{'as':_0x2dcf('0x142')});db['FaxAccount'][_0x2dcf('0x105')](db['Trunk'],{'as':'Trunk'});db[_0x2dcf('0x4f')][_0x2dcf('0x105')](db['CmList'],{'as':'List','foreignKey':'ListId'});db['FaxAccount'][_0x2dcf('0x105')](db[_0x2dcf('0x86')],{'as':_0x2dcf('0x136'),'foreignKey':_0x2dcf('0x137')});db[_0x2dcf('0x4f')][_0x2dcf('0x106')](db['User'],{'as':_0x2dcf('0x138'),'through':_0x2dcf('0x11e')});db[_0x2dcf('0x51')]['belongsTo'](db[_0x2dcf('0x11')],{'onDelete':'restrict'});db[_0x2dcf('0x51')][_0x2dcf('0x105')](db[_0x2dcf('0x55')],{'onDelete':_0x2dcf('0x151')});db[_0x2dcf('0x51')][_0x2dcf('0x105')](db[_0x2dcf('0x4f')],{'onDelete':_0x2dcf('0x151')});db[_0x2dcf('0x51')][_0x2dcf('0x105')](db['Tag'],{'onDelete':_0x2dcf('0x151'),'foreignKey':_0x2dcf('0x152')});db[_0x2dcf('0x53')][_0x2dcf('0xfd')](db['FaxMessage'],{'as':_0x2dcf('0x142'),'onDelete':_0x2dcf('0xfb'),'foreignKey':_0x2dcf('0x15a')});db['FaxInteraction'][_0x2dcf('0x105')](db[_0x2dcf('0x4f')],{'as':'Account','foreignKey':'FaxAccountId'});db[_0x2dcf('0x53')]['belongsTo'](db[_0x2dcf('0x71')],{'as':_0x2dcf('0x14a'),'foreignKey':_0x2dcf('0x13e')});db['FaxInteraction']['belongsTo'](db[_0x2dcf('0x11')],{'as':_0x2dcf('0x14b'),'foreignKey':'UserId'});db[_0x2dcf('0x53')]['belongsToMany'](db[_0x2dcf('0x8c')],{'through':_0x2dcf('0x15b'),'as':'Tags'});db['FaxInteraction'][_0x2dcf('0x106')](db[_0x2dcf('0x8c')],{'through':_0x2dcf('0x15b'),'as':_0x2dcf('0x15c')});db['FaxInteraction'][_0x2dcf('0x106')](db['User'],{'as':_0x2dcf('0x14e'),'through':_0x2dcf('0x110'),'foreignKey':_0x2dcf('0x15a')});db[_0x2dcf('0x15d')]['belongsTo'](db['User'],{'onDelete':_0x2dcf('0xfb'),'as':'User'});db['FaxMessage'][_0x2dcf('0x105')](db[_0x2dcf('0x53')],{'as':_0x2dcf('0x150'),'foreignKey':_0x2dcf('0x15a')});db[_0x2dcf('0x15d')][_0x2dcf('0x105')](db[_0x2dcf('0x71')],{'onDelete':'cascade','as':_0x2dcf('0x14a')});db[_0x2dcf('0x15d')][_0x2dcf('0x105')](db[_0x2dcf('0xe6')],{'as':'Attachment','foreignKey':_0x2dcf('0x15e')});db['FaxMessage'][_0x2dcf('0x105')](db[_0x2dcf('0x4f')],{'as':_0x2dcf('0x15f'),'foreignKey':'FaxAccountId'});db[_0x2dcf('0x55')][_0x2dcf('0x106')](db[_0x2dcf('0x11')],{'as':_0x2dcf('0x138'),'through':_0x2dcf('0x38')});db['FaxQueue']['belongsToMany'](db['Team'],{'through':_0x2dcf('0x160'),'as':_0x2dcf('0x148')});db[_0x2dcf('0x161')][_0x2dcf('0x105')](db['FaxAccount'],{});db[_0x2dcf('0x161')][_0x2dcf('0x105')](db[_0x2dcf('0xf2')],{'as':_0x2dcf('0x154'),'foreignKey':_0x2dcf('0x145')});db[_0x2dcf('0x161')][_0x2dcf('0x105')](db[_0x2dcf('0x71')],{'as':_0x2dcf('0x14a'),'foreignKey':'ContactId'});db[_0x2dcf('0x161')]['belongsTo'](db[_0x2dcf('0x53')],{});db['FaxQueueReport']['belongsTo'](db[_0x2dcf('0x15d')],{});db[_0x2dcf('0x161')][_0x2dcf('0x105')](db['User'],{});db[_0x2dcf('0x161')][_0x2dcf('0x105')](db[_0x2dcf('0x55')],{});db[_0x2dcf('0x123')][_0x2dcf('0xfd')](db[_0x2dcf('0x80')],{'as':_0x2dcf('0x141'),'foreignKey':_0x2dcf('0x162')});db[_0x2dcf('0x123')][_0x2dcf('0xfd')](db[_0x2dcf('0x157')],{'as':_0x2dcf('0x158'),'foreignKey':_0x2dcf('0x162')});db[_0x2dcf('0x123')]['hasMany'](db[_0x2dcf('0x163')],{'as':_0x2dcf('0x142'),'foreignKey':_0x2dcf('0x162')});db['SmsAccount'][_0x2dcf('0xfd')](db[_0x2dcf('0x59')],{'as':'Interactions'});db[_0x2dcf('0x123')][_0x2dcf('0xfd')](db[_0x2dcf('0x57')],{'as':_0x2dcf('0x127')});db[_0x2dcf('0x123')][_0x2dcf('0x105')](db[_0x2dcf('0xf2')],{'as':_0x2dcf('0x154'),'foreignKey':_0x2dcf('0x145')});db[_0x2dcf('0x123')][_0x2dcf('0x105')](db[_0x2dcf('0x86')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db['SmsAccount'][_0x2dcf('0x106')](db[_0x2dcf('0x11')],{'as':_0x2dcf('0x138'),'through':_0x2dcf('0x164')});db[_0x2dcf('0x57')][_0x2dcf('0x105')](db[_0x2dcf('0x11')],{'onDelete':_0x2dcf('0x151')});db[_0x2dcf('0x57')]['belongsTo'](db[_0x2dcf('0x5b')],{'onDelete':_0x2dcf('0x151')});db[_0x2dcf('0x57')][_0x2dcf('0x105')](db[_0x2dcf('0x123')],{'onDelete':_0x2dcf('0x151')});db[_0x2dcf('0x57')][_0x2dcf('0x105')](db['Interval'],{'onDelete':_0x2dcf('0x151'),'foreignKey':_0x2dcf('0x135')});db[_0x2dcf('0x57')][_0x2dcf('0x105')](db['Tag'],{'onDelete':_0x2dcf('0x151'),'foreignKey':'TagId'});db[_0x2dcf('0x59')]['hasMany'](db[_0x2dcf('0x163')],{'as':_0x2dcf('0x142'),'onDelete':_0x2dcf('0xfb'),'foreignKey':_0x2dcf('0x165')});db[_0x2dcf('0x59')]['belongsTo'](db[_0x2dcf('0x123')],{'as':_0x2dcf('0x15f'),'foreignKey':_0x2dcf('0x162')});db[_0x2dcf('0x59')][_0x2dcf('0x105')](db[_0x2dcf('0x71')],{'as':_0x2dcf('0x14a'),'foreignKey':_0x2dcf('0x13e')});db[_0x2dcf('0x59')][_0x2dcf('0x105')](db[_0x2dcf('0x11')],{'as':_0x2dcf('0x14b'),'foreignKey':_0x2dcf('0xfc')});db[_0x2dcf('0x59')][_0x2dcf('0x106')](db['Tag'],{'through':'sms_interaction_has_tags','as':_0x2dcf('0x14d')});db[_0x2dcf('0x59')]['belongsToMany'](db['Tag'],{'through':_0x2dcf('0x166'),'as':_0x2dcf('0x15c')});db[_0x2dcf('0x59')][_0x2dcf('0x106')](db[_0x2dcf('0x11')],{'as':_0x2dcf('0x14e'),'through':_0x2dcf('0x111'),'foreignKey':_0x2dcf('0x165')});db[_0x2dcf('0x163')][_0x2dcf('0x105')](db['User'],{'as':_0x2dcf('0x11')});db[_0x2dcf('0x163')][_0x2dcf('0x105')](db[_0x2dcf('0x71')],{'onDelete':_0x2dcf('0xfb'),'as':'Contact'});db[_0x2dcf('0x163')][_0x2dcf('0x105')](db[_0x2dcf('0x59')],{'onDelete':_0x2dcf('0xfb'),'as':_0x2dcf('0x150'),'foreignKey':_0x2dcf('0x165')});db[_0x2dcf('0x163')][_0x2dcf('0x105')](db[_0x2dcf('0x123')],{'as':_0x2dcf('0x15f'),'foreignKey':_0x2dcf('0x162')});db['SmsQueue'][_0x2dcf('0x106')](db[_0x2dcf('0x11')],{'as':'Agents','through':_0x2dcf('0x3a'),'foreignKey':_0x2dcf('0x167')});db[_0x2dcf('0x5b')][_0x2dcf('0x106')](db[_0x2dcf('0xe0')],{'through':_0x2dcf('0x168'),'as':'Teams'});db[_0x2dcf('0x121')][_0x2dcf('0xfd')](db[_0x2dcf('0x80')],{'as':_0x2dcf('0x141'),'foreignKey':_0x2dcf('0x169')});db[_0x2dcf('0x121')]['hasMany'](db[_0x2dcf('0x157')],{'as':'Answers','foreignKey':_0x2dcf('0x169')});db['OpenchannelAccount']['hasMany'](db[_0x2dcf('0x60')],{'as':_0x2dcf('0x144'),'foreignKey':_0x2dcf('0x169')});db[_0x2dcf('0x121')][_0x2dcf('0xfd')](db[_0x2dcf('0x61')],{'as':'Messages','foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x2dcf('0xfd')](db[_0x2dcf('0x5e')],{'as':_0x2dcf('0x127'),'foreignKey':_0x2dcf('0x169')});db[_0x2dcf('0x121')][_0x2dcf('0x105')](db[_0x2dcf('0xf2')],{'as':_0x2dcf('0x154'),'foreignKey':_0x2dcf('0x145')});db[_0x2dcf('0x121')][_0x2dcf('0x105')](db[_0x2dcf('0x86')],{'as':_0x2dcf('0x136'),'foreignKey':_0x2dcf('0x137')});db[_0x2dcf('0x121')][_0x2dcf('0x106')](db[_0x2dcf('0x11')],{'as':_0x2dcf('0x138'),'through':_0x2dcf('0x16a')});db['OpenchannelApplication'][_0x2dcf('0x105')](db['User'],{'onDelete':_0x2dcf('0x151')});db['OpenchannelApplication'][_0x2dcf('0x105')](db[_0x2dcf('0x118')],{'onDelete':_0x2dcf('0x151'),'foreignKey':_0x2dcf('0x16b')});db[_0x2dcf('0x5e')]['belongsTo'](db[_0x2dcf('0x121')],{'onDelete':_0x2dcf('0x151'),'foreignKey':_0x2dcf('0x169')});db[_0x2dcf('0x5e')][_0x2dcf('0x105')](db[_0x2dcf('0x84')],{'onDelete':_0x2dcf('0x151'),'foreignKey':'IntervalId'});db[_0x2dcf('0x5e')][_0x2dcf('0x105')](db[_0x2dcf('0x8c')],{'onDelete':_0x2dcf('0x151'),'foreignKey':_0x2dcf('0x152')});db['OpenchannelInteraction'][_0x2dcf('0xfd')](db[_0x2dcf('0x61')],{'as':_0x2dcf('0x142'),'onDelete':_0x2dcf('0xfb'),'foreignKey':_0x2dcf('0x16c')});db['OpenchannelInteraction'][_0x2dcf('0x105')](db[_0x2dcf('0x121')],{'as':_0x2dcf('0x15f'),'foreignKey':_0x2dcf('0x169')});db[_0x2dcf('0x60')][_0x2dcf('0x105')](db['CmContact'],{'as':_0x2dcf('0x14a'),'foreignKey':_0x2dcf('0x13e')});db['OpenchannelInteraction'][_0x2dcf('0x105')](db[_0x2dcf('0x11')],{'as':'Owner','foreignKey':_0x2dcf('0xfc')});db['OpenchannelInteraction'][_0x2dcf('0x106')](db[_0x2dcf('0x8c')],{'through':_0x2dcf('0x16d'),'as':_0x2dcf('0x14d')});db['OpenchannelInteraction'][_0x2dcf('0x106')](db[_0x2dcf('0x8c')],{'through':_0x2dcf('0x16d'),'as':_0x2dcf('0x15c')});db[_0x2dcf('0x60')]['belongsToMany'](db[_0x2dcf('0x11')],{'as':_0x2dcf('0x14e'),'through':_0x2dcf('0x112'),'foreignKey':_0x2dcf('0x16c')});db[_0x2dcf('0x61')][_0x2dcf('0x105')](db['User'],{'onDelete':_0x2dcf('0xfb'),'as':_0x2dcf('0x11')});db[_0x2dcf('0x61')][_0x2dcf('0x105')](db[_0x2dcf('0x71')],{'onDelete':_0x2dcf('0xfb'),'as':_0x2dcf('0x14a')});db[_0x2dcf('0x61')][_0x2dcf('0x105')](db['OpenchannelInteraction'],{'onDelete':_0x2dcf('0xfb'),'as':_0x2dcf('0x150'),'foreignKey':_0x2dcf('0x16c')});db[_0x2dcf('0x61')][_0x2dcf('0x105')](db[_0x2dcf('0xe6')],{'as':'Attachment','foreignKey':_0x2dcf('0x15e')});db['OpenchannelMessage'][_0x2dcf('0x105')](db[_0x2dcf('0x121')],{'as':_0x2dcf('0x15f'),'foreignKey':_0x2dcf('0x169')});db['OpenchannelQueue']['belongsToMany'](db['User'],{'as':_0x2dcf('0x138'),'through':_0x2dcf('0x3b'),'foreignKey':_0x2dcf('0x16b')});db[_0x2dcf('0x118')][_0x2dcf('0x106')](db[_0x2dcf('0xe0')],{'through':_0x2dcf('0x16e'),'as':_0x2dcf('0x148')});db[_0x2dcf('0x63')]['hasMany'](db[_0x2dcf('0x80')],{'as':_0x2dcf('0x141'),'foreignKey':_0x2dcf('0x16f')});db[_0x2dcf('0x63')]['hasMany'](db[_0x2dcf('0x157')],{'as':_0x2dcf('0x158'),'foreignKey':'ChatWebsiteId'});db[_0x2dcf('0x63')][_0x2dcf('0xfd')](db[_0x2dcf('0x6e')],{'as':_0x2dcf('0x170')});db[_0x2dcf('0x63')][_0x2dcf('0xfd')](db['ChatInteraction'],{'as':_0x2dcf('0x144')});db[_0x2dcf('0x63')][_0x2dcf('0xfd')](db['ChatApplication'],{'as':_0x2dcf('0x127')});db[_0x2dcf('0x63')][_0x2dcf('0xfd')](db[_0x2dcf('0x68')],{'as':_0x2dcf('0x142')});db[_0x2dcf('0x63')][_0x2dcf('0x105')](db['CmList'],{'as':'List','foreignKey':_0x2dcf('0x145')});db[_0x2dcf('0x63')][_0x2dcf('0x105')](db['Interval'],{'as':'Interval','foreignKey':_0x2dcf('0x135')});db[_0x2dcf('0x63')]['belongsTo'](db[_0x2dcf('0x86')],{'as':_0x2dcf('0x136'),'foreignKey':_0x2dcf('0x137')});db[_0x2dcf('0x63')][_0x2dcf('0x106')](db['User'],{'as':_0x2dcf('0x138'),'through':_0x2dcf('0x11c')});db[_0x2dcf('0x64')]['belongsTo'](db[_0x2dcf('0x121')],{});db[_0x2dcf('0x64')][_0x2dcf('0x105')](db[_0x2dcf('0xf2')],{'as':_0x2dcf('0x154'),'foreignKey':'ListId'});db[_0x2dcf('0x64')][_0x2dcf('0x105')](db['CmContact'],{'as':_0x2dcf('0x14a'),'foreignKey':_0x2dcf('0x13e')});db[_0x2dcf('0x64')]['belongsTo'](db['OpenchannelInteraction'],{});db[_0x2dcf('0x64')]['belongsTo'](db[_0x2dcf('0x61')],{});db[_0x2dcf('0x64')][_0x2dcf('0x105')](db[_0x2dcf('0x11')],{});db['OpenchannelQueueReport']['belongsTo'](db[_0x2dcf('0x118')],{});db[_0x2dcf('0x171')][_0x2dcf('0x105')](db[_0x2dcf('0x11')],{'as':_0x2dcf('0x172'),'foreignKey':_0x2dcf('0xfc'),'onDelete':_0x2dcf('0x151')});db[_0x2dcf('0x171')][_0x2dcf('0x105')](db['ChatQueue'],{'as':_0x2dcf('0x173'),'foreignKey':_0x2dcf('0x174'),'onDelete':_0x2dcf('0x151')});db['ChatApplication'][_0x2dcf('0x105')](db[_0x2dcf('0x63')],{'as':_0x2dcf('0x175'),'foreignKey':'ChatWebsiteId','onDelete':_0x2dcf('0x151')});db['ChatApplication'][_0x2dcf('0x105')](db['Tag'],{'onDelete':_0x2dcf('0x151'),'foreignKey':_0x2dcf('0x152')});db[_0x2dcf('0x66')]['hasMany'](db[_0x2dcf('0x68')],{'as':_0x2dcf('0x142'),'onDelete':_0x2dcf('0xfb'),'foreignKey':_0x2dcf('0x176')});db['ChatInteraction'][_0x2dcf('0x105')](db['ChatWebsite'],{'as':_0x2dcf('0x15f'),'foreignKey':_0x2dcf('0x16f')});db[_0x2dcf('0x66')]['belongsTo'](db[_0x2dcf('0x71')],{'as':'Contact','foreignKey':_0x2dcf('0x13e')});db['ChatInteraction'][_0x2dcf('0x105')](db['User'],{'as':_0x2dcf('0x14b'),'foreignKey':_0x2dcf('0xfc')});db[_0x2dcf('0x66')]['belongsToMany'](db[_0x2dcf('0x8c')],{'through':_0x2dcf('0x177'),'as':_0x2dcf('0x14d')});db[_0x2dcf('0x66')][_0x2dcf('0x106')](db[_0x2dcf('0x8c')],{'through':_0x2dcf('0x177'),'as':'ThroughTags'});db[_0x2dcf('0x66')]['belongsToMany'](db[_0x2dcf('0x11')],{'as':'Users','through':_0x2dcf('0x10f'),'foreignKey':_0x2dcf('0x176')});db[_0x2dcf('0x68')][_0x2dcf('0x105')](db[_0x2dcf('0x11')],{'onDelete':_0x2dcf('0xfb'),'as':'User'});db[_0x2dcf('0x68')][_0x2dcf('0x105')](db[_0x2dcf('0x71')],{'onDelete':_0x2dcf('0xfb'),'as':_0x2dcf('0x14a'),'foreignKey':_0x2dcf('0x13e')});db[_0x2dcf('0x68')][_0x2dcf('0x105')](db[_0x2dcf('0x66')],{'onDelete':_0x2dcf('0xfb'),'as':_0x2dcf('0x150'),'foreignKey':_0x2dcf('0x176')});db[_0x2dcf('0x68')][_0x2dcf('0x105')](db['Attachment'],{'as':_0x2dcf('0xe6'),'foreignKey':_0x2dcf('0x15e')});db['ChatMessage'][_0x2dcf('0x105')](db[_0x2dcf('0x63')],{'as':_0x2dcf('0x15f'),'foreignKey':_0x2dcf('0x16f')});db[_0x2dcf('0x178')][_0x2dcf('0x105')](db[_0x2dcf('0x71')],{'onDelete':'cascade','as':_0x2dcf('0x14a'),'foreignKey':'ContactId'});db[_0x2dcf('0x178')]['belongsTo'](db[_0x2dcf('0x63')],{'as':_0x2dcf('0x15f'),'foreignKey':_0x2dcf('0x16f')});db[_0x2dcf('0x179')][_0x2dcf('0x106')](db['User'],{'as':_0x2dcf('0x138'),'through':'UserChatQueue','hooks':!![]});db['ChatQueue'][_0x2dcf('0x106')](db[_0x2dcf('0xe0')],{'through':_0x2dcf('0x17a'),'as':_0x2dcf('0x148')});db[_0x2dcf('0x6c')][_0x2dcf('0xfd')](db['ChatInternalMessage'],{'as':_0x2dcf('0x142'),'foreignKey':_0x2dcf('0x17b'),'onDelete':_0x2dcf('0xfb')});db['ChatGroup'][_0x2dcf('0x106')](db[_0x2dcf('0x11')],{'as':_0x2dcf('0x12b'),'through':'chat_group_has_users'});db[_0x2dcf('0x6e')][_0x2dcf('0x105')](db['ChatWebsite'],{'as':'Website','foreignKey':_0x2dcf('0x16f')});db[_0x2dcf('0x70')][_0x2dcf('0xfd')](db['CmContact'],{'as':'Contacts','foreignKey':_0x2dcf('0x17c')});db[_0x2dcf('0x71')][_0x2dcf('0xfd')](db[_0x2dcf('0x12d')],{'as':_0x2dcf('0x12e'),'foreignKey':_0x2dcf('0x13e')});db[_0x2dcf('0x71')][_0x2dcf('0xfd')](db[_0x2dcf('0x76')],{'as':_0x2dcf('0xff'),'foreignKey':_0x2dcf('0x13e')});db[_0x2dcf('0x71')][_0x2dcf('0xfd')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0x2dcf('0x13e')});db[_0x2dcf('0x71')][_0x2dcf('0xfd')](db[_0x2dcf('0x79')],{'as':_0x2dcf('0x79'),'foreignKey':_0x2dcf('0x13e')});db[_0x2dcf('0x71')]['hasMany'](db[_0x2dcf('0xcf')],{'as':_0x2dcf('0x131'),'foreignKey':_0x2dcf('0x13e')});db[_0x2dcf('0x71')][_0x2dcf('0xfd')](db[_0x2dcf('0x60')],{'as':'OpenchannelInteractions','foreignKey':_0x2dcf('0x13e'),'onDelete':_0x2dcf('0x151')});db[_0x2dcf('0x71')]['hasMany'](db[_0x2dcf('0x66')],{'as':_0x2dcf('0x102'),'foreignKey':_0x2dcf('0x13e'),'onDelete':'restrict'});db[_0x2dcf('0x71')]['hasMany'](db['SmsInteraction'],{'as':_0x2dcf('0x17d'),'foreignKey':'ContactId','onDelete':_0x2dcf('0x151')});db[_0x2dcf('0x71')][_0x2dcf('0xfd')](db[_0x2dcf('0x53')],{'as':_0x2dcf('0x103'),'foreignKey':_0x2dcf('0x13e'),'onDelete':'restrict'});db[_0x2dcf('0x71')]['hasMany'](db[_0x2dcf('0x143')],{'as':_0x2dcf('0x104'),'foreignKey':_0x2dcf('0x13e'),'onDelete':_0x2dcf('0x151')});db[_0x2dcf('0x71')][_0x2dcf('0x105')](db[_0x2dcf('0x70')],{'as':_0x2dcf('0x17e'),'foreignKey':_0x2dcf('0x17c')});db[_0x2dcf('0x71')][_0x2dcf('0x105')](db[_0x2dcf('0xf2')],{'as':_0x2dcf('0x154'),'foreignKey':_0x2dcf('0x145'),'onDelete':_0x2dcf('0xfb')});db['CmContact'][_0x2dcf('0x106')](db[_0x2dcf('0x11')],{'as':_0x2dcf('0x14e'),'through':_0x2dcf('0x10a')});db['CmContact'][_0x2dcf('0x106')](db['Tag'],{'as':_0x2dcf('0x14d'),'through':'cm_contact_has_tags'});db[_0x2dcf('0x71')][_0x2dcf('0x106')](db[_0x2dcf('0x8c')],{'through':_0x2dcf('0x17f'),'as':_0x2dcf('0x15c')});db[_0x2dcf('0x12d')]['belongsTo'](db[_0x2dcf('0x71')],{'as':'Contact','foreignKey':_0x2dcf('0x13e'),'onDelete':_0x2dcf('0xfb')});db[_0x2dcf('0x12d')]['belongsTo'](db['CmList'],{'as':_0x2dcf('0x154'),'foreignKey':_0x2dcf('0x145'),'onDelete':_0x2dcf('0xfb')});db[_0x2dcf('0x12d')]['belongsTo'](db[_0x2dcf('0x11')],{'as':'Agent','foreignKey':_0x2dcf('0xfc')});db[_0x2dcf('0x12d')][_0x2dcf('0x105')](db[_0x2dcf('0x1b')],{'as':_0x2dcf('0x173'),'foreignKey':_0x2dcf('0x12c'),'onDelete':_0x2dcf('0xfb')});db[_0x2dcf('0x12d')][_0x2dcf('0x105')](db[_0x2dcf('0xe3')],{'as':_0x2dcf('0xe3'),'foreignKey':'CampaignId','onDelete':_0x2dcf('0xfb')});db[_0x2dcf('0x12d')]['belongsTo'](db['User'],{'as':_0x2dcf('0x14b'),'foreignKey':_0x2dcf('0x180')});db[_0x2dcf('0x74')][_0x2dcf('0x105')](db['CmContact'],{'as':_0x2dcf('0x14a'),'foreignKey':_0x2dcf('0x13e'),'onDelete':_0x2dcf('0xfb')});db[_0x2dcf('0x74')][_0x2dcf('0x105')](db[_0x2dcf('0xf2')],{'as':_0x2dcf('0x154'),'foreignKey':_0x2dcf('0x145'),'onDelete':'cascade'});db[_0x2dcf('0x74')][_0x2dcf('0x105')](db['VoiceQueue'],{'as':_0x2dcf('0x173'),'foreignKey':_0x2dcf('0x12c'),'onDelete':'cascade'});db[_0x2dcf('0x74')]['belongsTo'](db[_0x2dcf('0xe3')],{'as':_0x2dcf('0xe3'),'foreignKey':_0x2dcf('0x181'),'onDelete':_0x2dcf('0xfb')});db[_0x2dcf('0x7f')][_0x2dcf('0xfd')](db['Condition'],{'as':{'plural':_0x2dcf('0x182'),'singular':_0x2dcf('0x183')},'foreignKey':_0x2dcf('0x184'),'onDelete':'cascade','hooks':!![]});db['Automation'][_0x2dcf('0xfd')](db['Condition'],{'as':{'plural':_0x2dcf('0x185'),'singular':_0x2dcf('0x186')},'foreignKey':_0x2dcf('0x187'),'onDelete':_0x2dcf('0xfb'),'hooks':!![]});db[_0x2dcf('0x7f')]['hasMany'](db[_0x2dcf('0x7d')],{'as':_0x2dcf('0x188'),'foreignKey':_0x2dcf('0x189'),'onDelete':_0x2dcf('0xfb'),'hooks':!![]});db[_0x2dcf('0x84')][_0x2dcf('0xfd')](db['Interval'],{'as':_0x2dcf('0x18a'),'foreignKey':_0x2dcf('0x135'),'onDelete':_0x2dcf('0xfb'),'hooks':!![],'required':![]});db[_0x2dcf('0x84')]['hasMany'](db[_0x2dcf('0x17')],{'as':_0x2dcf('0x18b'),'foreignKey':_0x2dcf('0x135'),'onDelete':_0x2dcf('0x151')});db[_0x2dcf('0x84')][_0x2dcf('0xfd')](db[_0x2dcf('0x49')],{'as':'MailApplications','foreignKey':_0x2dcf('0x135')});db['Interval'][_0x2dcf('0xfd')](db['ChatApplication'],{'as':'ChatApplications','foreignKey':_0x2dcf('0x135')});db[_0x2dcf('0x84')][_0x2dcf('0xfd')](db['FaxApplication'],{'as':_0x2dcf('0x18c'),'foreignKey':_0x2dcf('0x135')});db[_0x2dcf('0x84')][_0x2dcf('0xfd')](db['SmsApplication'],{'as':_0x2dcf('0x18d'),'foreignKey':'IntervalId'});db[_0x2dcf('0x18e')][_0x2dcf('0x105')](db[_0x2dcf('0x40')],{});db[_0x2dcf('0x18e')][_0x2dcf('0x105')](db[_0x2dcf('0x94')],{'foreignKey':_0x2dcf('0x18f')});db[_0x2dcf('0x18e')][_0x2dcf('0x105')](db[_0x2dcf('0x92')],{'foreignKey':_0x2dcf('0x190')});db[_0x2dcf('0x128')][_0x2dcf('0x106')](db[_0x2dcf('0x19')],{'as':_0x2dcf('0x191'),'through':'moh_has_sounds','onDelete':'restrict'});db[_0x2dcf('0x8c')][_0x2dcf('0x106')](db[_0x2dcf('0x71')],{'through':_0x2dcf('0x17f')});db[_0x2dcf('0x8c')]['belongsToMany'](db[_0x2dcf('0x66')],{'through':'chat_interaction_has_tags'});db[_0x2dcf('0x8c')][_0x2dcf('0x106')](db['MailInteraction'],{'through':_0x2dcf('0x14c')});db['Tag']['belongsToMany'](db[_0x2dcf('0x59')],{'through':_0x2dcf('0x166')});db[_0x2dcf('0x8c')][_0x2dcf('0x106')](db['FaxInteraction'],{'through':_0x2dcf('0x15b')});db[_0x2dcf('0x8c')][_0x2dcf('0x106')](db[_0x2dcf('0x60')],{'through':_0x2dcf('0x16d')});db['Trigger'][_0x2dcf('0xfd')](db[_0x2dcf('0x82')],{'as':{'plural':'AllConditions','singular':_0x2dcf('0x192')},'foreignKey':_0x2dcf('0x193'),'onDelete':_0x2dcf('0xfb'),'hooks':!![]});db[_0x2dcf('0x194')][_0x2dcf('0xfd')](db[_0x2dcf('0x82')],{'as':{'plural':_0x2dcf('0x195'),'singular':_0x2dcf('0x196')},'foreignKey':_0x2dcf('0x197'),'onDelete':_0x2dcf('0xfb'),'hooks':!![]});db[_0x2dcf('0x194')]['hasMany'](db[_0x2dcf('0x7d')],{'as':_0x2dcf('0x188'),'foreignKey':_0x2dcf('0x198'),'onDelete':'cascade','hooks':!![]});db[_0x2dcf('0x92')][_0x2dcf('0xfd')](db[_0x2dcf('0x98')],{'as':_0x2dcf('0x199'),'onDelete':_0x2dcf('0xfb'),'foreignKey':_0x2dcf('0x190'),'hooks':!![]});db[_0x2dcf('0x94')][_0x2dcf('0xfd')](db[_0x2dcf('0x98')],{'as':_0x2dcf('0x199'),'onDelete':_0x2dcf('0xfb'),'foreignKey':_0x2dcf('0x18f')});db['AnalyticMetric'][_0x2dcf('0xfd')](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0x2dcf('0xfb'),'foreignKey':'MetricId'});db[_0x2dcf('0x98')][_0x2dcf('0x105')](db[_0x2dcf('0x19a')],{'foreignKey':_0x2dcf('0x19b')});db[_0x2dcf('0x9a')][_0x2dcf('0xfd')](db[_0x2dcf('0x9b')],{'as':_0x2dcf('0x19c'),'onDelete':_0x2dcf('0xfb'),'foreignKey':_0x2dcf('0x19d')});db[_0x2dcf('0x9b')][_0x2dcf('0xfd')](db['SalesforceField'],{'as':_0x2dcf('0x19e'),'onDelete':_0x2dcf('0xfb'),'foreignKey':_0x2dcf('0x19f')});db[_0x2dcf('0x9b')][_0x2dcf('0xfd')](db[_0x2dcf('0x9d')],{'as':_0x2dcf('0x1a0'),'onDelete':_0x2dcf('0xfb'),'foreignKey':'DescriptionId'});db[_0x2dcf('0x9b')]['hasMany'](db[_0x2dcf('0x9d')],{'as':_0x2dcf('0x199'),'onDelete':_0x2dcf('0xfb'),'foreignKey':_0x2dcf('0x1a1')});db[_0x2dcf('0x9b')]['belongsTo'](db[_0x2dcf('0x9a')],{'as':_0x2dcf('0x15f'),'foreignKey':'AccountId'});db['SalesforceField']['hasMany'](db['SalesforceField'],{'as':_0x2dcf('0x1a2'),'foreignKey':_0x2dcf('0x19f')});db['SalesforceField'][_0x2dcf('0xfd')](db['SalesforceField'],{'as':'Description','foreignKey':_0x2dcf('0x1a3')});db[_0x2dcf('0x9d')]['hasMany'](db[_0x2dcf('0x9d')],{'as':_0x2dcf('0x1a4'),'foreignKey':'FieldId'});db[_0x2dcf('0x9d')][_0x2dcf('0x105')](db[_0x2dcf('0x1a5')],{'as':_0x2dcf('0x1a5'),'foreignKey':_0x2dcf('0x1a6')});db['SugarcrmAccount']['hasMany'](db[_0x2dcf('0x9f')],{'as':_0x2dcf('0x19c'),'onDelete':_0x2dcf('0xfb'),'foreignKey':_0x2dcf('0x19d')});db[_0x2dcf('0x9f')]['hasMany'](db[_0x2dcf('0x1a7')],{'as':_0x2dcf('0x19e'),'onDelete':'cascade','foreignKey':_0x2dcf('0x19f')});db[_0x2dcf('0x9f')]['hasMany'](db[_0x2dcf('0x1a7')],{'as':_0x2dcf('0x1a0'),'onDelete':_0x2dcf('0xfb'),'foreignKey':_0x2dcf('0x1a3')});db[_0x2dcf('0x9f')]['hasMany'](db[_0x2dcf('0x1a7')],{'as':_0x2dcf('0x199'),'onDelete':'cascade','foreignKey':'FieldId'});db['SugarcrmConfiguration'][_0x2dcf('0x105')](db[_0x2dcf('0x1a8')],{'as':_0x2dcf('0x15f'),'foreignKey':_0x2dcf('0x19d')});db[_0x2dcf('0x1a7')][_0x2dcf('0xfd')](db[_0x2dcf('0x1a7')],{'as':_0x2dcf('0x1a2'),'foreignKey':'SubjectId'});db[_0x2dcf('0x1a7')][_0x2dcf('0xfd')](db['SugarcrmField'],{'as':'Description','foreignKey':_0x2dcf('0x1a3')});db[_0x2dcf('0x1a7')][_0x2dcf('0xfd')](db[_0x2dcf('0x1a7')],{'as':_0x2dcf('0x1a4'),'foreignKey':'FieldId'});db[_0x2dcf('0x1a7')][_0x2dcf('0x105')](db['Variable'],{'as':'Variable','foreignKey':_0x2dcf('0x1a6')});db[_0x2dcf('0xa2')]['hasMany'](db[_0x2dcf('0xa4')],{'as':_0x2dcf('0x19c'),'onDelete':_0x2dcf('0xfb'),'foreignKey':_0x2dcf('0x19d')});db[_0x2dcf('0xa4')][_0x2dcf('0xfd')](db[_0x2dcf('0xa6')],{'as':'Subjects','onDelete':_0x2dcf('0xfb'),'foreignKey':'SubjectId'});db[_0x2dcf('0xa4')][_0x2dcf('0xfd')](db['DeskField'],{'as':_0x2dcf('0x1a0'),'onDelete':_0x2dcf('0xfb'),'foreignKey':'DescriptionId'});db[_0x2dcf('0xa4')][_0x2dcf('0xfd')](db[_0x2dcf('0xa6')],{'as':'Fields','onDelete':_0x2dcf('0xfb'),'foreignKey':_0x2dcf('0x1a1')});db[_0x2dcf('0xa4')][_0x2dcf('0x105')](db['DeskAccount'],{'as':_0x2dcf('0x15f'),'foreignKey':'AccountId'});db['DeskConfiguration'][_0x2dcf('0x106')](db[_0x2dcf('0x8c')],{'through':_0x2dcf('0x1a9')});db['DeskField'][_0x2dcf('0xfd')](db[_0x2dcf('0xa6')],{'as':_0x2dcf('0x1a2'),'foreignKey':_0x2dcf('0x19f')});db[_0x2dcf('0xa6')]['hasMany'](db[_0x2dcf('0xa6')],{'as':'Description','foreignKey':_0x2dcf('0x1a3')});db[_0x2dcf('0xa6')][_0x2dcf('0xfd')](db[_0x2dcf('0xa6')],{'as':_0x2dcf('0x1a4'),'foreignKey':'FieldId'});db['DeskField'][_0x2dcf('0x105')](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db[_0x2dcf('0xa8')][_0x2dcf('0xfd')](db['ZohoConfiguration'],{'as':'Configurations','onDelete':_0x2dcf('0xfb'),'foreignKey':_0x2dcf('0x19d')});db[_0x2dcf('0xa9')][_0x2dcf('0xfd')](db[_0x2dcf('0xab')],{'as':_0x2dcf('0x19e'),'onDelete':_0x2dcf('0xfb'),'foreignKey':_0x2dcf('0x19f')});db[_0x2dcf('0xa9')][_0x2dcf('0xfd')](db[_0x2dcf('0xab')],{'as':_0x2dcf('0x1a0'),'onDelete':_0x2dcf('0xfb'),'foreignKey':_0x2dcf('0x1a3')});db[_0x2dcf('0xa9')][_0x2dcf('0xfd')](db['ZohoField'],{'as':_0x2dcf('0x199'),'onDelete':'cascade','foreignKey':_0x2dcf('0x1a1')});db[_0x2dcf('0xa9')][_0x2dcf('0x105')](db[_0x2dcf('0xa8')],{'as':'Account','foreignKey':'AccountId'});db['ZohoField'][_0x2dcf('0xfd')](db[_0x2dcf('0xab')],{'as':_0x2dcf('0x1a2'),'foreignKey':'SubjectId'});db[_0x2dcf('0xab')][_0x2dcf('0xfd')](db['ZohoField'],{'as':_0x2dcf('0x1aa'),'foreignKey':'DescriptionId'});db[_0x2dcf('0xab')]['hasMany'](db[_0x2dcf('0xab')],{'as':_0x2dcf('0x1a4'),'foreignKey':_0x2dcf('0x1a1')});db[_0x2dcf('0xab')][_0x2dcf('0x105')](db[_0x2dcf('0x1a5')],{'as':_0x2dcf('0x1a5'),'foreignKey':_0x2dcf('0x1a6')});db[_0x2dcf('0xac')][_0x2dcf('0xfd')](db['ZendeskConfiguration'],{'as':_0x2dcf('0x19c'),'onDelete':_0x2dcf('0xfb'),'foreignKey':'AccountId'});db[_0x2dcf('0x1ab')][_0x2dcf('0xfd')](db[_0x2dcf('0xaf')],{'as':'Subjects','foreignKey':_0x2dcf('0x19f')});db[_0x2dcf('0x1ab')][_0x2dcf('0xfd')](db['ZendeskField'],{'as':'Descriptions','foreignKey':_0x2dcf('0x1a3')});db[_0x2dcf('0x1ab')][_0x2dcf('0xfd')](db[_0x2dcf('0xaf')],{'as':_0x2dcf('0x199'),'foreignKey':_0x2dcf('0x1a1')});db[_0x2dcf('0x1ab')][_0x2dcf('0x105')](db['ZendeskAccount'],{'as':_0x2dcf('0x15f'),'foreignKey':_0x2dcf('0x19d')});db[_0x2dcf('0x1ab')][_0x2dcf('0x106')](db['Tag'],{'through':_0x2dcf('0x1ac')});db[_0x2dcf('0xaf')]['hasMany'](db[_0x2dcf('0xaf')],{'as':_0x2dcf('0x1a2'),'foreignKey':_0x2dcf('0x19f')});db['ZendeskField'][_0x2dcf('0xfd')](db[_0x2dcf('0xaf')],{'as':'Description','foreignKey':_0x2dcf('0x1a3')});db[_0x2dcf('0xaf')][_0x2dcf('0xfd')](db[_0x2dcf('0xaf')],{'as':_0x2dcf('0x1a4'),'foreignKey':_0x2dcf('0x1a1')});db[_0x2dcf('0xaf')]['belongsTo'](db[_0x2dcf('0x1a5')],{'as':_0x2dcf('0x1a5'),'foreignKey':_0x2dcf('0x1a6')});db[_0x2dcf('0xb0')][_0x2dcf('0xfd')](db[_0x2dcf('0xb2')],{'as':_0x2dcf('0x19c'),'onDelete':_0x2dcf('0xfb'),'foreignKey':_0x2dcf('0x19d')});db[_0x2dcf('0xb2')][_0x2dcf('0xfd')](db[_0x2dcf('0x1ad')],{'as':_0x2dcf('0x19e'),'onDelete':_0x2dcf('0xfb'),'foreignKey':_0x2dcf('0x19f')});db['FreshdeskConfiguration'][_0x2dcf('0xfd')](db[_0x2dcf('0x1ad')],{'as':_0x2dcf('0x1a0'),'onDelete':_0x2dcf('0xfb'),'foreignKey':'DescriptionId'});db[_0x2dcf('0xb2')]['hasMany'](db[_0x2dcf('0x1ad')],{'as':_0x2dcf('0x199'),'onDelete':_0x2dcf('0xfb'),'foreignKey':_0x2dcf('0x1a1')});db[_0x2dcf('0xb2')][_0x2dcf('0x105')](db[_0x2dcf('0xb0')],{'as':'Account','foreignKey':_0x2dcf('0x19d')});db[_0x2dcf('0xb2')]['belongsToMany'](db[_0x2dcf('0x8c')],{'through':_0x2dcf('0x1ae')});db[_0x2dcf('0x1ad')][_0x2dcf('0xfd')](db[_0x2dcf('0x1ad')],{'as':_0x2dcf('0x1a2'),'foreignKey':_0x2dcf('0x19f')});db[_0x2dcf('0x1ad')]['hasMany'](db['FreshdeskField'],{'as':_0x2dcf('0x1aa'),'foreignKey':_0x2dcf('0x1a3')});db[_0x2dcf('0x1ad')][_0x2dcf('0xfd')](db['FreshdeskField'],{'as':'Field','foreignKey':_0x2dcf('0x1a1')});db[_0x2dcf('0x1ad')][_0x2dcf('0x105')](db[_0x2dcf('0x1a5')],{'as':_0x2dcf('0x1a5'),'foreignKey':'VariableId'});db[_0x2dcf('0xb5')][_0x2dcf('0xfd')](db[_0x2dcf('0xb7')],{'as':_0x2dcf('0x19c'),'onDelete':'cascade','foreignKey':_0x2dcf('0x19d')});db[_0x2dcf('0xb7')][_0x2dcf('0xfd')](db[_0x2dcf('0x1af')],{'as':_0x2dcf('0x19e'),'foreignKey':_0x2dcf('0x19f')});db['VtigerConfiguration'][_0x2dcf('0xfd')](db[_0x2dcf('0x1af')],{'as':_0x2dcf('0x1a0'),'foreignKey':_0x2dcf('0x1a3')});db[_0x2dcf('0xb7')][_0x2dcf('0xfd')](db[_0x2dcf('0x1af')],{'as':_0x2dcf('0x199'),'foreignKey':_0x2dcf('0x1a1')});db['VtigerConfiguration'][_0x2dcf('0x105')](db[_0x2dcf('0xb5')],{'as':_0x2dcf('0x15f'),'foreignKey':_0x2dcf('0x19d')});db[_0x2dcf('0x1af')][_0x2dcf('0xfd')](db[_0x2dcf('0x1af')],{'as':_0x2dcf('0x1a2'),'foreignKey':_0x2dcf('0x19f')});db[_0x2dcf('0x1af')]['hasMany'](db[_0x2dcf('0x1af')],{'as':_0x2dcf('0x1aa'),'foreignKey':'DescriptionId'});db['VtigerField'][_0x2dcf('0xfd')](db[_0x2dcf('0x1af')],{'as':_0x2dcf('0x1a4'),'foreignKey':_0x2dcf('0x1a1')});db['VtigerField']['belongsTo'](db[_0x2dcf('0x1a5')],{'as':_0x2dcf('0x1a5'),'foreignKey':_0x2dcf('0x1a6')});db[_0x2dcf('0x1b0')][_0x2dcf('0xfd')](db['ServicenowConfiguration'],{'as':_0x2dcf('0x19c'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x2dcf('0x1b1')][_0x2dcf('0xfd')](db[_0x2dcf('0xbb')],{'as':_0x2dcf('0x19e'),'foreignKey':_0x2dcf('0x19f')});db[_0x2dcf('0x1b1')][_0x2dcf('0xfd')](db[_0x2dcf('0xbb')],{'as':'Descriptions','foreignKey':_0x2dcf('0x1a3')});db[_0x2dcf('0x1b1')][_0x2dcf('0xfd')](db[_0x2dcf('0xbb')],{'as':_0x2dcf('0x199'),'foreignKey':_0x2dcf('0x1a1')});db[_0x2dcf('0x1b1')][_0x2dcf('0x105')](db[_0x2dcf('0x1b0')],{'as':'Account','foreignKey':_0x2dcf('0x19d')});db[_0x2dcf('0xbb')][_0x2dcf('0xfd')](db[_0x2dcf('0xbb')],{'as':_0x2dcf('0x1a2'),'foreignKey':_0x2dcf('0x19f')});db[_0x2dcf('0xbb')]['hasMany'](db['ServicenowField'],{'as':_0x2dcf('0x1aa'),'foreignKey':_0x2dcf('0x1a3')});db[_0x2dcf('0xbb')][_0x2dcf('0xfd')](db['ServicenowField'],{'as':'Field','foreignKey':_0x2dcf('0x1a1')});db[_0x2dcf('0xbb')]['belongsTo'](db[_0x2dcf('0x1a5')],{'as':_0x2dcf('0x1a5'),'foreignKey':_0x2dcf('0x1a6')});db[_0x2dcf('0xbc')][_0x2dcf('0xfd')](db['Dynamics365Configuration'],{'as':_0x2dcf('0x19c'),'onDelete':_0x2dcf('0xfb'),'foreignKey':_0x2dcf('0x19d')});db[_0x2dcf('0xbe')]['hasMany'](db[_0x2dcf('0xc0')],{'as':_0x2dcf('0x19e'),'onDelete':_0x2dcf('0xfb'),'foreignKey':'SubjectId'});db[_0x2dcf('0xbe')][_0x2dcf('0xfd')](db[_0x2dcf('0xc0')],{'as':_0x2dcf('0x1a0'),'onDelete':_0x2dcf('0xfb'),'foreignKey':'DescriptionId'});db[_0x2dcf('0xbe')]['hasMany'](db[_0x2dcf('0xc0')],{'as':_0x2dcf('0x199'),'onDelete':_0x2dcf('0xfb'),'foreignKey':_0x2dcf('0x1a1')});db[_0x2dcf('0xbe')][_0x2dcf('0x105')](db[_0x2dcf('0xbc')],{'as':_0x2dcf('0x15f'),'foreignKey':_0x2dcf('0x19d')});db[_0x2dcf('0xc0')][_0x2dcf('0xfd')](db[_0x2dcf('0xc0')],{'as':_0x2dcf('0x1a2'),'foreignKey':_0x2dcf('0x19f')});db[_0x2dcf('0xc0')]['hasMany'](db[_0x2dcf('0xc0')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x2dcf('0xc0')][_0x2dcf('0xfd')](db['Dynamics365Field'],{'as':_0x2dcf('0x1a4'),'foreignKey':_0x2dcf('0x1a1')});db[_0x2dcf('0xc0')][_0x2dcf('0x105')](db[_0x2dcf('0x1a5')],{'as':_0x2dcf('0x1a5'),'foreignKey':'VariableId'});db['FreshsalesAccount'][_0x2dcf('0xfd')](db['FreshsalesConfiguration'],{'as':_0x2dcf('0x19c'),'onDelete':_0x2dcf('0xfb'),'foreignKey':_0x2dcf('0x19d')});db['FreshsalesConfiguration'][_0x2dcf('0xfd')](db[_0x2dcf('0xc4')],{'as':_0x2dcf('0x19e'),'foreignKey':_0x2dcf('0x19f')});db[_0x2dcf('0xc2')][_0x2dcf('0xfd')](db['FreshsalesField'],{'as':_0x2dcf('0x1a0'),'foreignKey':'DescriptionId'});db[_0x2dcf('0xc2')][_0x2dcf('0xfd')](db[_0x2dcf('0xc4')],{'as':_0x2dcf('0x199'),'foreignKey':_0x2dcf('0x1a1')});db[_0x2dcf('0xc2')][_0x2dcf('0x105')](db[_0x2dcf('0x1b2')],{'as':_0x2dcf('0x15f'),'foreignKey':_0x2dcf('0x19d')});db[_0x2dcf('0xc4')][_0x2dcf('0xfd')](db['FreshsalesField'],{'as':_0x2dcf('0x1a2'),'foreignKey':_0x2dcf('0x19f')});db[_0x2dcf('0xc4')][_0x2dcf('0xfd')](db[_0x2dcf('0xc4')],{'as':_0x2dcf('0x1aa'),'foreignKey':_0x2dcf('0x1a3')});db[_0x2dcf('0xc4')][_0x2dcf('0xfd')](db[_0x2dcf('0xc4')],{'as':'Field','foreignKey':_0x2dcf('0x1a1')});db['FreshsalesField']['belongsTo'](db['Variable'],{'as':_0x2dcf('0x1a5'),'foreignKey':_0x2dcf('0x1a6')});db['ChatQueueReport']['belongsTo'](db[_0x2dcf('0x63')],{});db['ChatQueueReport']['belongsTo'](db['CmList'],{'as':_0x2dcf('0x154'),'foreignKey':_0x2dcf('0x145')});db[_0x2dcf('0xc8')]['belongsTo'](db[_0x2dcf('0x71')],{'as':_0x2dcf('0x14a'),'foreignKey':_0x2dcf('0x13e')});db['ChatQueueReport'][_0x2dcf('0x105')](db[_0x2dcf('0x66')],{});db[_0x2dcf('0xc8')]['belongsTo'](db[_0x2dcf('0x68')],{});db[_0x2dcf('0xc8')]['belongsTo'](db['User'],{});db[_0x2dcf('0xc8')]['belongsTo'](db[_0x2dcf('0x179')],{});db['ChatInternalMessage']['belongsTo'](db[_0x2dcf('0x11')],{'onDelete':'cascade','foreignKey':'FromId'});db['ChatInternalMessage'][_0x2dcf('0x105')](db[_0x2dcf('0x11')],{'onDelete':'cascade','foreignKey':_0x2dcf('0x1b3')});db[_0x2dcf('0xcf')][_0x2dcf('0xfd')](db[_0x2dcf('0xce')],{'foreignKey':_0x2dcf('0x1b4'),'onDelete':_0x2dcf('0xfb')});db[_0x2dcf('0xcf')][_0x2dcf('0xfd')](db[_0x2dcf('0xcc')],{'foreignKey':_0x2dcf('0x1b4'),'onDelete':_0x2dcf('0xfb')});db[_0x2dcf('0xd1')][_0x2dcf('0x105')](db[_0x2dcf('0x123')],{});db['SmsQueueReport']['belongsTo'](db[_0x2dcf('0xf2')],{'as':_0x2dcf('0x154'),'foreignKey':_0x2dcf('0x145')});db['SmsQueueReport'][_0x2dcf('0x105')](db[_0x2dcf('0x71')],{'as':'Contact','foreignKey':_0x2dcf('0x13e')});db['SmsQueueReport']['belongsTo'](db[_0x2dcf('0x59')],{});db[_0x2dcf('0xd1')][_0x2dcf('0x105')](db[_0x2dcf('0x163')],{});db[_0x2dcf('0xd1')][_0x2dcf('0x105')](db[_0x2dcf('0x11')],{});db[_0x2dcf('0xd1')][_0x2dcf('0x105')](db[_0x2dcf('0x5b')],{});db[_0x2dcf('0xd6')]['hasMany'](db[_0x2dcf('0xcf')],{'foreignKey':'ProjectId'});db['JscriptyProject'][_0x2dcf('0xfd')](db[_0x2dcf('0xce')],{'foreignKey':_0x2dcf('0x1b5')});db[_0x2dcf('0xd6')][_0x2dcf('0xfd')](db['JscriptyAnswerReport'],{'foreignKey':_0x2dcf('0x1b5')});db['SquareProject'][_0x2dcf('0x106')](db[_0x2dcf('0x11')],{'as':_0x2dcf('0x14e'),'through':_0x2dcf('0x1b6')});db[_0x2dcf('0xe0')][_0x2dcf('0x106')](db[_0x2dcf('0x11')],{'as':'Agents','through':_0x2dcf('0x10d')});db['Team']['belongsToMany'](db[_0x2dcf('0x1b')],{'through':_0x2dcf('0x139'),'as':_0x2dcf('0x113')});db['Team'][_0x2dcf('0x106')](db[_0x2dcf('0x42')],{'through':_0x2dcf('0x147'),'as':_0x2dcf('0x115')});db[_0x2dcf('0xe0')]['belongsToMany'](db[_0x2dcf('0x179')],{'through':_0x2dcf('0x17a'),'as':'ChatQueues'});db[_0x2dcf('0xe0')]['belongsToMany'](db['FaxQueue'],{'through':'team_has_fax_queues','as':'FaxQueues'});db[_0x2dcf('0xe0')][_0x2dcf('0x106')](db[_0x2dcf('0x5b')],{'through':'team_has_sms_queues','as':'SmsQueues'});db['Team'][_0x2dcf('0x106')](db[_0x2dcf('0x118')],{'through':_0x2dcf('0x16e'),'as':_0x2dcf('0x119')});db['Campaign'][_0x2dcf('0xfd')](db[_0x2dcf('0x12d')],{'as':_0x2dcf('0x12e'),'foreignKey':_0x2dcf('0x181')});db['Campaign'][_0x2dcf('0xfd')](db[_0x2dcf('0x76')],{'as':_0x2dcf('0xff'),'foreignKey':_0x2dcf('0x181')});db[_0x2dcf('0xe3')][_0x2dcf('0xfd')](db['CmHopperHistory'],{'as':_0x2dcf('0x12f'),'foreignKey':'CampaignId'});db['Campaign'][_0x2dcf('0xfd')](db['CmHopperBlack'],{'as':'HopperBlacks','foreignKey':_0x2dcf('0x181')});db[_0x2dcf('0xe3')][_0x2dcf('0x105')](db[_0x2dcf('0x2d')],{'as':'Trunk','foreignKey':_0x2dcf('0x132')});db[_0x2dcf('0xe3')][_0x2dcf('0x105')](db[_0x2dcf('0x2d')],{'as':_0x2dcf('0x133'),'foreignKey':'TrunkBackupId'});db[_0x2dcf('0xe3')][_0x2dcf('0x105')](db['Interval'],{'as':_0x2dcf('0x84'),'foreignKey':'IntervalId'});db[_0x2dcf('0xe3')][_0x2dcf('0x105')](db[_0x2dcf('0xdb')],{'as':_0x2dcf('0xdb'),'foreignKey':'SquareProjectId'});db[_0x2dcf('0xe3')][_0x2dcf('0x106')](db['CmList'],{'as':_0x2dcf('0x10b'),'through':_0x2dcf('0x1b7')});db[_0x2dcf('0xe3')][_0x2dcf('0x106')](db[_0x2dcf('0xf2')],{'as':_0x2dcf('0x13a'),'through':_0x2dcf('0x1b8')});db[_0x2dcf('0xea')][_0x2dcf('0x105')](db[_0x2dcf('0x47')],{});db[_0x2dcf('0xea')][_0x2dcf('0x105')](db[_0x2dcf('0x143')],{});db['MailTransferReport'][_0x2dcf('0x105')](db['MailAccount'],{'foreignKey':_0x2dcf('0x1b9'),'as':_0x2dcf('0x1ba')});db['MailTransferReport'][_0x2dcf('0x105')](db[_0x2dcf('0x11')],{'foreignKey':_0x2dcf('0x1bb'),'as':_0x2dcf('0x1bc')});db[_0x2dcf('0xea')][_0x2dcf('0x105')](db['User'],{'foreignKey':_0x2dcf('0x1bd'),'as':'ToAgent'});db[_0x2dcf('0xea')][_0x2dcf('0x105')](db[_0x2dcf('0x42')],{'foreignKey':'ToMailQueueId','as':_0x2dcf('0x1be')});db['MailTransferReport']['belongsTo'](db[_0x2dcf('0x40')],{'foreignKey':_0x2dcf('0x1bf'),'as':_0x2dcf('0x1c0')});db[_0x2dcf('0x1c1')][_0x2dcf('0x105')](db[_0x2dcf('0x68')],{});db[_0x2dcf('0x1c1')]['belongsTo'](db['ChatInteraction'],{});db['ChatTransferReport'][_0x2dcf('0x105')](db[_0x2dcf('0x63')],{'foreignKey':_0x2dcf('0x1c2'),'as':_0x2dcf('0x1ba')});db[_0x2dcf('0x1c1')][_0x2dcf('0x105')](db[_0x2dcf('0x11')],{'foreignKey':_0x2dcf('0x1bb'),'as':_0x2dcf('0x1bc')});db['ChatTransferReport'][_0x2dcf('0x105')](db[_0x2dcf('0x11')],{'foreignKey':_0x2dcf('0x1bd'),'as':_0x2dcf('0x1c3')});db[_0x2dcf('0x1c1')][_0x2dcf('0x105')](db[_0x2dcf('0x179')],{'foreignKey':_0x2dcf('0x1c4'),'as':'ToQueue'});db[_0x2dcf('0x1c1')][_0x2dcf('0x105')](db['ChatWebsite'],{'foreignKey':_0x2dcf('0x1c5'),'as':_0x2dcf('0x1c0')});db[_0x2dcf('0xec')][_0x2dcf('0x105')](db[_0x2dcf('0x15d')],{});db[_0x2dcf('0xec')][_0x2dcf('0x105')](db[_0x2dcf('0x53')],{});db['FaxTransferReport'][_0x2dcf('0x105')](db[_0x2dcf('0x4f')],{'foreignKey':_0x2dcf('0x1c6'),'as':_0x2dcf('0x1ba')});db[_0x2dcf('0xec')][_0x2dcf('0x105')](db[_0x2dcf('0x11')],{'foreignKey':'FromUserId','as':_0x2dcf('0x1bc')});db['FaxTransferReport'][_0x2dcf('0x105')](db[_0x2dcf('0x11')],{'foreignKey':_0x2dcf('0x1bd'),'as':_0x2dcf('0x1c3')});db[_0x2dcf('0xec')]['belongsTo'](db[_0x2dcf('0x55')],{'foreignKey':_0x2dcf('0x1c7'),'as':_0x2dcf('0x1be')});db[_0x2dcf('0xec')][_0x2dcf('0x105')](db[_0x2dcf('0x4f')],{'foreignKey':'ToFaxAccountId','as':_0x2dcf('0x1c0')});db['OpenchannelTransferReport'][_0x2dcf('0x105')](db[_0x2dcf('0x61')],{});db[_0x2dcf('0xee')]['belongsTo'](db[_0x2dcf('0x60')],{});db['OpenchannelTransferReport'][_0x2dcf('0x105')](db[_0x2dcf('0x121')],{'foreignKey':'FromOpenchannelAccountId','as':'FromAccount'});db[_0x2dcf('0xee')][_0x2dcf('0x105')](db[_0x2dcf('0x11')],{'foreignKey':'FromUserId','as':_0x2dcf('0x1bc')});db[_0x2dcf('0xee')][_0x2dcf('0x105')](db[_0x2dcf('0x11')],{'foreignKey':_0x2dcf('0x1bd'),'as':_0x2dcf('0x1c3')});db[_0x2dcf('0xee')]['belongsTo'](db['OpenchannelQueue'],{'foreignKey':_0x2dcf('0x1c8'),'as':_0x2dcf('0x1be')});db[_0x2dcf('0xee')][_0x2dcf('0x105')](db[_0x2dcf('0x121')],{'foreignKey':_0x2dcf('0x1c9'),'as':_0x2dcf('0x1c0')});db[_0x2dcf('0xf0')][_0x2dcf('0x105')](db[_0x2dcf('0x163')],{});db['SmsTransferReport'][_0x2dcf('0x105')](db[_0x2dcf('0x59')],{});db[_0x2dcf('0xf0')]['belongsTo'](db[_0x2dcf('0x123')],{'foreignKey':_0x2dcf('0x1ca'),'as':_0x2dcf('0x1ba')});db[_0x2dcf('0xf0')][_0x2dcf('0x105')](db['User'],{'foreignKey':'FromUserId','as':_0x2dcf('0x1bc')});db[_0x2dcf('0xf0')][_0x2dcf('0x105')](db['User'],{'foreignKey':_0x2dcf('0x1bd'),'as':_0x2dcf('0x1c3')});db[_0x2dcf('0xf0')]['belongsTo'](db[_0x2dcf('0x5b')],{'foreignKey':_0x2dcf('0x1cb'),'as':_0x2dcf('0x1be')});db['SmsTransferReport'][_0x2dcf('0x105')](db[_0x2dcf('0x123')],{'foreignKey':_0x2dcf('0x1cc'),'as':_0x2dcf('0x1c0')});db[_0x2dcf('0xf2')][_0x2dcf('0xfd')](db[_0x2dcf('0x80')],{'as':_0x2dcf('0x141'),'foreignKey':_0x2dcf('0x145')});db[_0x2dcf('0xf2')][_0x2dcf('0xfd')](db[_0x2dcf('0x7b')],{'as':_0x2dcf('0x1cd'),'foreignKey':'ListId'});db[_0x2dcf('0xf2')]['hasMany'](db['CmContact'],{'as':_0x2dcf('0x109'),'onDelete':'cascade','foreignKey':_0x2dcf('0x145')});db[_0x2dcf('0xf2')][_0x2dcf('0xfd')](db[_0x2dcf('0x76')],{'as':_0x2dcf('0xff'),'foreignKey':'ListId'});db['CmList'][_0x2dcf('0xfd')](db[_0x2dcf('0x78')],{'as':_0x2dcf('0x100'),'foreignKey':_0x2dcf('0x145')});db[_0x2dcf('0xf2')][_0x2dcf('0xfd')](db[_0x2dcf('0x79')],{'as':_0x2dcf('0x79'),'foreignKey':'ListId'});db[_0x2dcf('0xf2')][_0x2dcf('0x106')](db['VoiceQueue'],{'as':_0x2dcf('0x1ce'),'through':'voice_queues_has_cm_lists'});db[_0x2dcf('0xf2')][_0x2dcf('0x106')](db['User'],{'as':'Agents','through':_0x2dcf('0x10c')});db[_0x2dcf('0xf4')][_0x2dcf('0xfd')](db[_0x2dcf('0x17')],{'as':'Extensions','onDelete':_0x2dcf('0x151')});db[_0x2dcf('0xf4')][_0x2dcf('0x106')](db['User'],{'as':_0x2dcf('0x138'),'through':_0x2dcf('0x11a')});db[_0x2dcf('0xf6')]['hasMany'](db[_0x2dcf('0x11')],{'as':_0x2dcf('0x14e'),'foreignKey':'userProfileId'});db[_0x2dcf('0xf6')][_0x2dcf('0xfd')](db['UserProfileSection'],{'as':_0x2dcf('0x1cf'),'foreignKey':_0x2dcf('0x1d0'),'onDelete':_0x2dcf('0xfb')});db['UserProfileSection'][_0x2dcf('0xfd')](db['UserProfileResource'],{'as':_0x2dcf('0x1d1'),'foreignKey':_0x2dcf('0x1d2'),'onDelete':_0x2dcf('0xfb')});module[_0x2dcf('0x1d3')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index d4b72ce..9f47059 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfcc4=['./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','./api/smsInteraction','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelInteraction','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/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/companies','./api/cmCompany','/api/cm/contacts','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_history','./api/cmHopperHistory','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','./api/condition','/api/intervals','./api/interval','./api/pause','/api/cdr','./api/cdr','./api/voiceQueuesLog','/api/schedules','/api/sounds','./api/sound','/api/tags','./api/tag','/api/templates','./api/template','/api/triggers','/api/variables','./api/variable','/api/integrations','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','/api/analytics/tree_reports','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','./api/intZendeskConfiguration','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowConfiguration','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','/api/networks','./api/network','/api/chat/reports/queue','/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/setting','/api/square/odbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/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/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/auth/local','./api/authLocal','/api/auth/google','/api/jira','./api/jira','/api/rpc','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/apidoc','join','/www','static','root','/demo','/snippet','snippet','1.0.16','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','appPath','/index.html','path','express','express-winston','util','./config/environment','./config/logger','api','use','logger','format','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','user','name','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','device','role','agent_id','agent_name','test','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/recordings','/api/screen/recordings','./api/screenRecording','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','/api/members/reports','./api/memberReport','/api/trunks','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailSubstatus','/api/mail/interactions','/api/mail/messages','/api/mail/applications','./api/mailQueueReport','/api/dashboards','./api/dashboardItem','/api/fax/accounts','/api/fax/applications','/api/fax/interactions'];(function(_0x33c637,_0x597c26){var _0x14aa20=function(_0x32a8b5){while(--_0x32a8b5){_0x33c637['push'](_0x33c637['shift']());}};_0x14aa20(++_0x597c26);}(_0xfcc4,0xca));var _0x4fcc=function(_0x3c86dc,_0x5d22fc){_0x3c86dc=_0x3c86dc-0x0;var _0x4aeb79=_0xfcc4[_0x3c86dc];return _0x4aeb79;};'use strict';var path=require(_0x4fcc('0x0'));var express=require(_0x4fcc('0x1'));var ewinston=require(_0x4fcc('0x2'));var util=require(_0x4fcc('0x3'));var errors=require('./errors');var config=require(_0x4fcc('0x4'));var logger=require(_0x4fcc('0x5'))(_0x4fcc('0x6'));var authLogger=require(_0x4fcc('0x5'))('auth');exports['default']=function(_0x520870){_0x520870[_0x4fcc('0x7')](ewinston[_0x4fcc('0x8')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x158b46,_0x27b63b){return util[_0x4fcc('0x9')](_0x4fcc('0xa'),_0x158b46[_0x4fcc('0xb')],_0x158b46[_0x4fcc('0xc')][_0x4fcc('0xd')]?_0x158b46[_0x4fcc('0xc')]['x-forwarded-for']:_0x158b46[_0x4fcc('0xe')][_0x4fcc('0xf')]||_0x158b46['ip'],_0x158b46[_0x4fcc('0x10')],_0x27b63b[_0x4fcc('0x11')],_0x27b63b[_0x4fcc('0x12')],_0x158b46[_0x4fcc('0x13')]?_0x158b46[_0x4fcc('0x13')]['id']:null,_0x158b46['user']?_0x158b46[_0x4fcc('0x13')][_0x4fcc('0x14')]:null,_0x158b46[_0x4fcc('0x13')]?_0x158b46[_0x4fcc('0x13')]['role']:null);}}));_0x520870[_0x4fcc('0x7')](ewinston[_0x4fcc('0x8')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x232cc1,_0x1170ad){var _0x142e9a=_0x4fcc('0x15');if(_0x232cc1[_0x4fcc('0x16')]&&_0x232cc1['body'][_0x4fcc('0x17')]&&_0x232cc1[_0x4fcc('0x16')]['agent_id']){_0x142e9a='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util['format'](_0x142e9a,_0x232cc1[_0x4fcc('0xb')],_0x232cc1['headers'][_0x4fcc('0xd')]?_0x232cc1['headers'][_0x4fcc('0xd')]:_0x232cc1['connection'][_0x4fcc('0xf')]||_0x232cc1['ip'],_0x232cc1[_0x4fcc('0x10')],_0x1170ad[_0x4fcc('0x11')],_0x1170ad[_0x4fcc('0x12')],_0x232cc1[_0x4fcc('0x13')]?_0x232cc1[_0x4fcc('0x13')]['id']:null,_0x232cc1[_0x4fcc('0x13')]?_0x232cc1['user'][_0x4fcc('0x14')]:null,_0x232cc1[_0x4fcc('0x13')]?_0x232cc1[_0x4fcc('0x13')][_0x4fcc('0x18')]:null,_0x232cc1[_0x4fcc('0x16')]&&_0x232cc1[_0x4fcc('0x16')]['device']?_0x232cc1['body']['device']:'other',_0x232cc1[_0x4fcc('0x16')]&&_0x232cc1[_0x4fcc('0x16')][_0x4fcc('0x19')]?_0x232cc1[_0x4fcc('0x16')][_0x4fcc('0x19')]:'',_0x232cc1[_0x4fcc('0x16')]&&_0x232cc1[_0x4fcc('0x16')]['agent_name']?_0x232cc1[_0x4fcc('0x16')][_0x4fcc('0x1a')]:'');},'ignoreRoute':function(_0x46ea84){var _0x5ece58=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x5ece58[_0x4fcc('0x1b')](_0x46ea84[_0x4fcc('0x10')]);}}));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x1c'),require(_0x4fcc('0x1d')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x1e'),require(_0x4fcc('0x1f')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x20'),require(_0x4fcc('0x21')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x22'),require(_0x4fcc('0x23')));_0x520870['use'](_0x4fcc('0x24'),require(_0x4fcc('0x25')));_0x520870[_0x4fcc('0x7')]('/api/voice/queues',require('./api/voiceQueue'));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x26'),require('./api/voiceRecording'));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x27'),require(_0x4fcc('0x28')));_0x520870[_0x4fcc('0x7')]('/api/voice/mails',require(_0x4fcc('0x29')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x2a'),require(_0x4fcc('0x2b')));_0x520870[_0x4fcc('0x7')]('/api/voice/calls/reports',require('./api/voiceCallReport'));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x2c'),require(_0x4fcc('0x2d')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x2e'),require(_0x4fcc('0x2f')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x30'),require('./api/voiceQueueReport'));_0x520870['use'](_0x4fcc('0x31'),require(_0x4fcc('0x32')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x33'),require('./api/trunk'));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x34'),require(_0x4fcc('0x35')));_0x520870['use'](_0x4fcc('0x36'),require('./api/mailServerOut'));_0x520870[_0x4fcc('0x7')]('/api/mail/accounts',require('./api/mailAccount'));_0x520870[_0x4fcc('0x7')]('/api/mail/queues',require('./api/mailQueue'));_0x520870[_0x4fcc('0x7')]('/api/mail/substatuses',require(_0x4fcc('0x37')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x38'),require('./api/mailInteraction'));_0x520870['use'](_0x4fcc('0x39'),require('./api/mailMessage'));_0x520870['use'](_0x4fcc('0x3a'),require('./api/mailApplication'));_0x520870['use']('/api/mail/reports/queue',require(_0x4fcc('0x3b')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x3c'),require('./api/dashboard'));_0x520870[_0x4fcc('0x7')]('/api/dashboards/items',require(_0x4fcc('0x3d')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x3e'),require('./api/faxAccount'));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x3f'),require('./api/faxApplication'));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x40'),require(_0x4fcc('0x41')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x42'),require(_0x4fcc('0x43')));_0x520870['use'](_0x4fcc('0x44'),require(_0x4fcc('0x45')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x46'),require('./api/faxQueueReport'));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x47'),require(_0x4fcc('0x48')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x49'),require(_0x4fcc('0x4a')));_0x520870[_0x4fcc('0x7')]('/api/sms/interactions',require(_0x4fcc('0x4b')));_0x520870[_0x4fcc('0x7')]('/api/sms/messages',require(_0x4fcc('0x4c')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x4d'),require(_0x4fcc('0x4e')));_0x520870['use'](_0x4fcc('0x4f'),require(_0x4fcc('0x50')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x51'),require(_0x4fcc('0x52')));_0x520870[_0x4fcc('0x7')]('/api/openchannel/interactions',require(_0x4fcc('0x53')));_0x520870[_0x4fcc('0x7')]('/api/openchannel/messages',require(_0x4fcc('0x54')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x55'),require(_0x4fcc('0x56')));_0x520870[_0x4fcc('0x7')]('/api/chat/websites',require('./api/chatWebsite'));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x57'),require(_0x4fcc('0x58')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x59'),require(_0x4fcc('0x5a')));_0x520870['use'](_0x4fcc('0x5b'),require(_0x4fcc('0x5c')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x5d'),require(_0x4fcc('0x5e')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x5f'),require(_0x4fcc('0x60')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x61'),require(_0x4fcc('0x62')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x63'),require(_0x4fcc('0x64')));_0x520870['use'](_0x4fcc('0x65'),require('./api/chatProactiveAction'));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x66'),require(_0x4fcc('0x67')));_0x520870['use'](_0x4fcc('0x68'),require('./api/cmContact'));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x69'),require(_0x4fcc('0x6a')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x6b'),require(_0x4fcc('0x6c')));_0x520870[_0x4fcc('0x7')]('/api/cm/hopper_final',require('./api/cmHopperFinal'));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x6d'),require(_0x4fcc('0x6e')));_0x520870[_0x4fcc('0x7')]('/api/cm/custom_fields',require('./api/cmCustomField'));_0x520870[_0x4fcc('0x7')]('/api/actions',require(_0x4fcc('0x6f')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x70'),require(_0x4fcc('0x71')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x72'),require(_0x4fcc('0x73')));_0x520870['use'](_0x4fcc('0x74'),require(_0x4fcc('0x75')));_0x520870[_0x4fcc('0x7')]('/api/conditions',require(_0x4fcc('0x76')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x77'),require(_0x4fcc('0x78')));_0x520870['use']('/api/pauses',require(_0x4fcc('0x79')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x7a'),require(_0x4fcc('0x7b')));_0x520870['use']('/api/voiceQueuesLog',require(_0x4fcc('0x7c')));_0x520870['use'](_0x4fcc('0x7d'),require('./api/schedule'));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x7e'),require(_0x4fcc('0x7f')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x80'),require(_0x4fcc('0x81')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x82'),require(_0x4fcc('0x83')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x84'),require('./api/trigger'));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x85'),require(_0x4fcc('0x86')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x87'),require('./api/integration'));_0x520870['use']('/api/integrations/reports',require(_0x4fcc('0x88')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x89'),require(_0x4fcc('0x8a')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x8b'),require(_0x4fcc('0x8c')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x8d'),require(_0x4fcc('0x8e')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x8f'),require('./api/analyticMetric'));_0x520870[_0x4fcc('0x7')]('/api/analytics/field_reports',require('./api/analyticFieldReport'));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x90'),require('./api/analyticTreeReport'));_0x520870['use']('/api/integrations/salesforce/accounts',require('./api/intSalesforceAccount'));_0x520870['use'](_0x4fcc('0x91'),require('./api/intSalesforceConfiguration'));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x92'),require(_0x4fcc('0x93')));_0x520870['use']('/api/integrations/sugarcrm/accounts',require(_0x4fcc('0x94')));_0x520870['use'](_0x4fcc('0x95'),require(_0x4fcc('0x96')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x97'),require(_0x4fcc('0x98')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x99'),require('./api/intDeskAccount'));_0x520870['use']('/api/integrations/desk/configurations',require('./api/intDeskConfiguration'));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x9a'),require(_0x4fcc('0x9b')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x9c'),require(_0x4fcc('0x9d')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x9e'),require(_0x4fcc('0x9f')));_0x520870[_0x4fcc('0x7')]('/api/integrations/zoho/fields',require('./api/intZohoField'));_0x520870[_0x4fcc('0x7')]('/api/integrations/zendesk/accounts',require('./api/intZendeskAccount'));_0x520870['use']('/api/integrations/zendesk/configurations',require(_0x4fcc('0xa0')));_0x520870['use']('/api/integrations/zendesk/fields',require('./api/intZendeskField'));_0x520870[_0x4fcc('0x7')](_0x4fcc('0xa1'),require(_0x4fcc('0xa2')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0xa3'),require(_0x4fcc('0xa4')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0xa5'),require(_0x4fcc('0xa6')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0xa7'),require(_0x4fcc('0xa8')));_0x520870[_0x4fcc('0x7')]('/api/integrations/vtiger/configurations',require(_0x4fcc('0xa9')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0xaa'),require(_0x4fcc('0xab')));_0x520870['use'](_0x4fcc('0xac'),require('./api/intServicenowAccount'));_0x520870['use']('/api/integrations/servicenow/configurations',require(_0x4fcc('0xad')));_0x520870[_0x4fcc('0x7')]('/api/integrations/servicenow/fields',require(_0x4fcc('0xae')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0xaf'),require(_0x4fcc('0xb0')));_0x520870['use'](_0x4fcc('0xb1'),require('./api/intDynamics365Configuration'));_0x520870['use'](_0x4fcc('0xb2'),require(_0x4fcc('0xb3')));_0x520870['use'](_0x4fcc('0xb4'),require(_0x4fcc('0xb5')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0xb6'),require(_0x4fcc('0xb7')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0xb8'),require('./api/intFreshsalesField'));_0x520870[_0x4fcc('0x7')](_0x4fcc('0xb9'),require(_0x4fcc('0xba')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0xbb'),require('./api/chatQueueReport'));_0x520870[_0x4fcc('0x7')](_0x4fcc('0xbc'),require('./api/chatInternalMessage'));_0x520870[_0x4fcc('0x7')](_0x4fcc('0xbd'),require('./api/jscriptyAnswerReport'));_0x520870[_0x4fcc('0x7')](_0x4fcc('0xbe'),require(_0x4fcc('0xbf')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0xc0'),require(_0x4fcc('0xc1')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0xc2'),require(_0x4fcc('0xc3')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0xc4'),require(_0x4fcc('0xc5')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0xc6'),require(_0x4fcc('0xc7')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0xc8'),require(_0x4fcc('0xc9')));_0x520870['use']('/api/settings',require(_0x4fcc('0xca')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0xcb'),require('./api/squareOdbc'));_0x520870[_0x4fcc('0x7')](_0x4fcc('0xcc'),require(_0x4fcc('0xcd')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0xce'),require(_0x4fcc('0xcf')));_0x520870['use'](_0x4fcc('0xd0'),require(_0x4fcc('0xd1')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0xd2'),require(_0x4fcc('0xd3')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0xd4'),require(_0x4fcc('0xd5')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0xd6'),require(_0x4fcc('0xd7')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0xd8'),require(_0x4fcc('0xd9')));_0x520870['use'](_0x4fcc('0xda'),require(_0x4fcc('0xdb')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0xdc'),require(_0x4fcc('0xdd')));_0x520870[_0x4fcc('0x7')]('/api/mail/reports/transfer',require(_0x4fcc('0xde')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0xdf'),require(_0x4fcc('0xe0')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0xe1'),require('./api/faxTransferReport'));_0x520870[_0x4fcc('0x7')](_0x4fcc('0xe2'),require(_0x4fcc('0xe3')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0xe4'),require(_0x4fcc('0xe5')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0xe6'),require(_0x4fcc('0xe7')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0xe8'),require(_0x4fcc('0xe9')));_0x520870[_0x4fcc('0x7')]('/api/userProfiles',require(_0x4fcc('0xea')));_0x520870[_0x4fcc('0x7')]('/api/userProfile/sections',require(_0x4fcc('0xeb')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0xec'),require(_0x4fcc('0xed')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0xee'),require(_0x4fcc('0xef')));_0x520870['use'](_0x4fcc('0xf0'),require('./api/authGoogle'));_0x520870[_0x4fcc('0x7')](_0x4fcc('0xf1'),require(_0x4fcc('0xf2')));_0x520870['use'](_0x4fcc('0xf3'),require('./api/rpc'));_0x520870['use']('/api/version',require('./api/version'));_0x520870[_0x4fcc('0x7')](_0x4fcc('0xf4'),require(_0x4fcc('0xf5')));_0x520870['use'](_0x4fcc('0xf6'),require(_0x4fcc('0xf7')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0xf8'),require(_0x4fcc('0xf9')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0xfa'),express['static'](path[_0x4fcc('0xfb')](config['root'],_0x4fcc('0xfa'))));_0x520870[_0x4fcc('0x7')](_0x4fcc('0xfc'),express[_0x4fcc('0xfd')](path['join'](config[_0x4fcc('0xfe')],_0x4fcc('0xfc'))));_0x520870[_0x4fcc('0x7')](_0x4fcc('0xff'),express[_0x4fcc('0xfd')](path['join'](config['root'],'/demo')));_0x520870[_0x4fcc('0x7')](_0x4fcc('0x100'),express['static'](path[_0x4fcc('0xfb')](config[_0x4fcc('0xfe')],_0x4fcc('0x101'),_0x4fcc('0x102'))));_0x520870['use'](_0x4fcc('0x103'),express[_0x4fcc('0xfd')](path[_0x4fcc('0xfb')](config[_0x4fcc('0xfe')],_0x4fcc('0x104'))));_0x520870[_0x4fcc('0x105')](_0x4fcc('0x106'))['get'](errors[0x194]);_0x520870['route']('/*')[_0x4fcc('0x107')](function(_0x52a635,_0x168b5c){_0x168b5c[_0x4fcc('0x108')](path['resolve'](_0x520870[_0x4fcc('0x107')](_0x4fcc('0x109'))+_0x4fcc('0x10a')));});}; \ No newline at end of file +var _0xa515=['/api/screen/recordings','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','./api/mailQueue','/api/mail/substatuses','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','/api/dashboards/items','./api/dashboardItem','./api/faxApplication','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','/api/chat/websites','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','./api/chatProactiveAction','/api/cm/companies','./api/cmContact','/api/cm/hopper','./api/cmHopper','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','./api/interval','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/sound','./api/tag','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/default_reports','./api/analyticDefaultReport','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/configurations','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','./api/intFreshsalesConfiguration','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/internal/messages','./api/chatInternalMessage','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','./api/smsQueueReport','./api/squareReport','./api/squareReportDetail','/api/settings','./api/setting','./api/squareOdbc','/api/square/projects','./api/squareRecording','/api/square/messages','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','./api/migration','/api/attachments','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','/api/userProfile/sections','./api/userProfileSection','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','/api/rpc','./api/rpc','./api/system','./api/pm2','/api/webbar','/apidoc','static','root','/www','/demo','join','/snippet','1.0.16','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','/index.html','util','./errors','./config/environment','api','./config/logger','default','use','logger','format','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','method','headers','x-forwarded-for','connection','statusCode','responseTime','user','name','role','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','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/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue'];(function(_0x577b07,_0x4795c3){var _0x471305=function(_0x46a70b){while(--_0x46a70b){_0x577b07['push'](_0x577b07['shift']());}};_0x471305(++_0x4795c3);}(_0xa515,0xe0));var _0x5a51=function(_0x3f7042,_0x1411ba){_0x3f7042=_0x3f7042-0x0;var _0x43167e=_0xa515[_0x3f7042];return _0x43167e;};'use strict';var path=require('path');var express=require('express');var ewinston=require('express-winston');var util=require(_0x5a51('0x0'));var errors=require(_0x5a51('0x1'));var config=require(_0x5a51('0x2'));var logger=require('./config/logger')(_0x5a51('0x3'));var authLogger=require(_0x5a51('0x4'))('auth');exports[_0x5a51('0x5')]=function(_0x4d5f5a){_0x4d5f5a[_0x5a51('0x6')](ewinston[_0x5a51('0x7')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x3f46d3,_0x3a2741){return util[_0x5a51('0x8')](_0x5a51('0x9'),_0x3f46d3[_0x5a51('0xa')],_0x3f46d3[_0x5a51('0xb')][_0x5a51('0xc')]?_0x3f46d3[_0x5a51('0xb')][_0x5a51('0xc')]:_0x3f46d3[_0x5a51('0xd')]['remoteAddress']||_0x3f46d3['ip'],_0x3f46d3['url'],_0x3a2741[_0x5a51('0xe')],_0x3a2741[_0x5a51('0xf')],_0x3f46d3[_0x5a51('0x10')]?_0x3f46d3[_0x5a51('0x10')]['id']:null,_0x3f46d3['user']?_0x3f46d3['user'][_0x5a51('0x11')]:null,_0x3f46d3[_0x5a51('0x10')]?_0x3f46d3[_0x5a51('0x10')][_0x5a51('0x12')]:null);}}));_0x4d5f5a['use'](ewinston['logger']({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x26b2ee,_0x551ace){var _0x38e9d8=_0x5a51('0x13');if(_0x26b2ee[_0x5a51('0x14')]&&_0x26b2ee[_0x5a51('0x14')][_0x5a51('0x15')]&&_0x26b2ee['body'][_0x5a51('0x16')]){_0x38e9d8=_0x5a51('0x17');}return util[_0x5a51('0x8')](_0x38e9d8,_0x26b2ee['method'],_0x26b2ee['headers'][_0x5a51('0xc')]?_0x26b2ee[_0x5a51('0xb')][_0x5a51('0xc')]:_0x26b2ee[_0x5a51('0xd')][_0x5a51('0x18')]||_0x26b2ee['ip'],_0x26b2ee[_0x5a51('0x19')],_0x551ace[_0x5a51('0xe')],_0x551ace[_0x5a51('0xf')],_0x26b2ee[_0x5a51('0x10')]?_0x26b2ee[_0x5a51('0x10')]['id']:null,_0x26b2ee[_0x5a51('0x10')]?_0x26b2ee[_0x5a51('0x10')][_0x5a51('0x11')]:null,_0x26b2ee[_0x5a51('0x10')]?_0x26b2ee['user'][_0x5a51('0x12')]:null,_0x26b2ee[_0x5a51('0x14')]&&_0x26b2ee[_0x5a51('0x14')][_0x5a51('0x15')]?_0x26b2ee[_0x5a51('0x14')][_0x5a51('0x15')]:_0x5a51('0x1a'),_0x26b2ee[_0x5a51('0x14')]&&_0x26b2ee[_0x5a51('0x14')][_0x5a51('0x16')]?_0x26b2ee['body'][_0x5a51('0x16')]:'',_0x26b2ee[_0x5a51('0x14')]&&_0x26b2ee['body'][_0x5a51('0x1b')]?_0x26b2ee['body'][_0x5a51('0x1b')]:'');},'ignoreRoute':function(_0x50b4e9){var _0x26f0eb=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x26f0eb[_0x5a51('0x1c')](_0x50b4e9[_0x5a51('0x19')]);}}));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0x1d'),require('./api/user'));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0x1e'),require(_0x5a51('0x1f')));_0x4d5f5a['use'](_0x5a51('0x20'),require(_0x5a51('0x21')));_0x4d5f5a[_0x5a51('0x6')]('/api/voice/extensions',require(_0x5a51('0x22')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0x23'),require(_0x5a51('0x24')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0x25'),require(_0x5a51('0x26')));_0x4d5f5a[_0x5a51('0x6')]('/api/voice/recordings',require('./api/voiceRecording'));_0x4d5f5a['use'](_0x5a51('0x27'),require('./api/screenRecording'));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0x28'),require(_0x5a51('0x29')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0x2a'),require(_0x5a51('0x2b')));_0x4d5f5a[_0x5a51('0x6')]('/api/voice/calls/reports',require(_0x5a51('0x2c')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0x2d'),require(_0x5a51('0x2e')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0x2f'),require(_0x5a51('0x30')));_0x4d5f5a[_0x5a51('0x6')]('/api/voice/queues/reports',require('./api/voiceQueueReport'));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0x31'),require(_0x5a51('0x32')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0x33'),require(_0x5a51('0x34')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0x35'),require(_0x5a51('0x36')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0x37'),require(_0x5a51('0x38')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0x39'),require(_0x5a51('0x3a')));_0x4d5f5a['use']('/api/mail/queues',require(_0x5a51('0x3b')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0x3c'),require('./api/mailSubstatus'));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0x3d'),require(_0x5a51('0x3e')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0x3f'),require(_0x5a51('0x40')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0x41'),require(_0x5a51('0x42')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0x43'),require('./api/mailQueueReport'));_0x4d5f5a[_0x5a51('0x6')]('/api/dashboards',require('./api/dashboard'));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0x44'),require(_0x5a51('0x45')));_0x4d5f5a['use']('/api/fax/accounts',require('./api/faxAccount'));_0x4d5f5a['use']('/api/fax/applications',require(_0x5a51('0x46')));_0x4d5f5a[_0x5a51('0x6')]('/api/fax/interactions',require(_0x5a51('0x47')));_0x4d5f5a['use'](_0x5a51('0x48'),require(_0x5a51('0x49')));_0x4d5f5a['use'](_0x5a51('0x4a'),require('./api/faxQueue'));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0x4b'),require(_0x5a51('0x4c')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0x4d'),require(_0x5a51('0x4e')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0x4f'),require(_0x5a51('0x50')));_0x4d5f5a[_0x5a51('0x6')]('/api/sms/interactions',require('./api/smsInteraction'));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0x51'),require(_0x5a51('0x52')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0x53'),require(_0x5a51('0x54')));_0x4d5f5a[_0x5a51('0x6')]('/api/openchannel/accounts',require(_0x5a51('0x55')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0x56'),require(_0x5a51('0x57')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0x58'),require(_0x5a51('0x59')));_0x4d5f5a['use'](_0x5a51('0x5a'),require(_0x5a51('0x5b')));_0x4d5f5a['use'](_0x5a51('0x5c'),require('./api/openchannelQueue'));_0x4d5f5a['use'](_0x5a51('0x5d'),require(_0x5a51('0x5e')));_0x4d5f5a[_0x5a51('0x6')]('/api/openchannel/reports/queue',require(_0x5a51('0x5f')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0x60'),require(_0x5a51('0x61')));_0x4d5f5a['use'](_0x5a51('0x62'),require(_0x5a51('0x63')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0x64'),require(_0x5a51('0x65')));_0x4d5f5a['use'](_0x5a51('0x66'),require(_0x5a51('0x67')));_0x4d5f5a[_0x5a51('0x6')]('/api/chat/queues',require(_0x5a51('0x68')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0x69'),require('./api/chatGroup'));_0x4d5f5a[_0x5a51('0x6')]('/api/chat/proactive_actions',require(_0x5a51('0x6a')));_0x4d5f5a['use'](_0x5a51('0x6b'),require('./api/cmCompany'));_0x4d5f5a[_0x5a51('0x6')]('/api/cm/contacts',require(_0x5a51('0x6c')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0x6d'),require(_0x5a51('0x6e')));_0x4d5f5a[_0x5a51('0x6')]('/api/cm/hopper_black',require(_0x5a51('0x6f')));_0x4d5f5a['use'](_0x5a51('0x70'),require(_0x5a51('0x71')));_0x4d5f5a[_0x5a51('0x6')]('/api/cm/hopper_history',require('./api/cmHopperHistory'));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0x72'),require(_0x5a51('0x73')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0x74'),require(_0x5a51('0x75')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0x76'),require(_0x5a51('0x77')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0x78'),require(_0x5a51('0x79')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0x7a'),require(_0x5a51('0x7b')));_0x4d5f5a['use'](_0x5a51('0x7c'),require(_0x5a51('0x7d')));_0x4d5f5a[_0x5a51('0x6')]('/api/intervals',require(_0x5a51('0x7e')));_0x4d5f5a[_0x5a51('0x6')]('/api/pauses',require('./api/pause'));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0x7f'),require(_0x5a51('0x80')));_0x4d5f5a['use'](_0x5a51('0x81'),require(_0x5a51('0x82')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0x83'),require('./api/schedule'));_0x4d5f5a[_0x5a51('0x6')]('/api/sounds',require(_0x5a51('0x84')));_0x4d5f5a[_0x5a51('0x6')]('/api/tags',require(_0x5a51('0x85')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0x86'),require(_0x5a51('0x87')));_0x4d5f5a['use'](_0x5a51('0x88'),require(_0x5a51('0x89')));_0x4d5f5a['use'](_0x5a51('0x8a'),require(_0x5a51('0x8b')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0x8c'),require(_0x5a51('0x8d')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0x8e'),require(_0x5a51('0x8f')));_0x4d5f5a[_0x5a51('0x6')]('/api/analytics/custom_reports',require('./api/analyticCustomReport'));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0x90'),require(_0x5a51('0x91')));_0x4d5f5a['use']('/api/analytics/extracted_reports',require('./api/analyticExtractedReport'));_0x4d5f5a[_0x5a51('0x6')]('/api/analytics/metrics',require(_0x5a51('0x92')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0x93'),require(_0x5a51('0x94')));_0x4d5f5a[_0x5a51('0x6')]('/api/analytics/tree_reports',require(_0x5a51('0x95')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0x96'),require(_0x5a51('0x97')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0x98'),require(_0x5a51('0x99')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0x9a'),require('./api/intSalesforceField'));_0x4d5f5a['use'](_0x5a51('0x9b'),require(_0x5a51('0x9c')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0x9d'),require(_0x5a51('0x9e')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0x9f'),require(_0x5a51('0xa0')));_0x4d5f5a[_0x5a51('0x6')]('/api/integrations/desk/accounts',require(_0x5a51('0xa1')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0xa2'),require(_0x5a51('0xa3')));_0x4d5f5a['use']('/api/integrations/desk/fields',require(_0x5a51('0xa4')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0xa5'),require(_0x5a51('0xa6')));_0x4d5f5a[_0x5a51('0x6')]('/api/integrations/zoho/configurations',require(_0x5a51('0xa7')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0xa8'),require(_0x5a51('0xa9')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0xaa'),require(_0x5a51('0xab')));_0x4d5f5a[_0x5a51('0x6')]('/api/integrations/zendesk/configurations',require(_0x5a51('0xac')));_0x4d5f5a['use'](_0x5a51('0xad'),require(_0x5a51('0xae')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0xaf'),require('./api/intFreshdeskAccount'));_0x4d5f5a['use'](_0x5a51('0xb0'),require(_0x5a51('0xb1')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0xb2'),require(_0x5a51('0xb3')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0xb4'),require(_0x5a51('0xb5')));_0x4d5f5a['use'](_0x5a51('0xb6'),require('./api/intVtigerConfiguration'));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0xb7'),require(_0x5a51('0xb8')));_0x4d5f5a[_0x5a51('0x6')]('/api/integrations/servicenow/accounts',require('./api/intServicenowAccount'));_0x4d5f5a['use'](_0x5a51('0xb9'),require('./api/intServicenowConfiguration'));_0x4d5f5a['use']('/api/integrations/servicenow/fields',require('./api/intServicenowField'));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0xba'),require(_0x5a51('0xbb')));_0x4d5f5a[_0x5a51('0x6')]('/api/integrations/dynamics365/configurations',require(_0x5a51('0xbc')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0xbd'),require(_0x5a51('0xbe')));_0x4d5f5a[_0x5a51('0x6')]('/api/integrations/freshsales/accounts',require('./api/intFreshsalesAccount'));_0x4d5f5a[_0x5a51('0x6')]('/api/integrations/freshsales/configurations',require(_0x5a51('0xbf')));_0x4d5f5a[_0x5a51('0x6')]('/api/integrations/freshsales/fields',require(_0x5a51('0xc0')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0xc1'),require(_0x5a51('0xc2')));_0x4d5f5a[_0x5a51('0x6')]('/api/chat/reports/queue',require('./api/chatQueueReport'));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0xc3'),require(_0x5a51('0xc4')));_0x4d5f5a[_0x5a51('0x6')]('/api/jscripty/answers/reports',require(_0x5a51('0xc5')));_0x4d5f5a['use'](_0x5a51('0xc6'),require(_0x5a51('0xc7')));_0x4d5f5a['use'](_0x5a51('0xc8'),require(_0x5a51('0xc9')));_0x4d5f5a[_0x5a51('0x6')]('/api/sms/reports/queue',require(_0x5a51('0xca')));_0x4d5f5a[_0x5a51('0x6')]('/api/square/reports',require(_0x5a51('0xcb')));_0x4d5f5a[_0x5a51('0x6')]('/api/square/details/reports',require(_0x5a51('0xcc')));_0x4d5f5a[_0x5a51('0x6')]('/api/jscripty/projects',require('./api/jscriptyProject'));_0x4d5f5a['use'](_0x5a51('0xcd'),require(_0x5a51('0xce')));_0x4d5f5a[_0x5a51('0x6')]('/api/square/odbc',require(_0x5a51('0xcf')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0xd0'),require('./api/squareProject'));_0x4d5f5a[_0x5a51('0x6')]('/api/square/recordings',require(_0x5a51('0xd1')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0xd2'),require('./api/squareMessage'));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0xd3'),require(_0x5a51('0xd4')));_0x4d5f5a['use'](_0x5a51('0xd5'),require(_0x5a51('0xd6')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0xd7'),require(_0x5a51('0xd8')));_0x4d5f5a[_0x5a51('0x6')]('/api/migrations',require(_0x5a51('0xd9')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0xda'),require('./api/attachment'));_0x4d5f5a['use']('/api/plugins',require(_0x5a51('0xdb')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0xdc'),require(_0x5a51('0xdd')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0xde'),require(_0x5a51('0xdf')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0xe0'),require(_0x5a51('0xe1')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0xe2'),require(_0x5a51('0xe3')));_0x4d5f5a['use'](_0x5a51('0xe4'),require(_0x5a51('0xe5')));_0x4d5f5a['use'](_0x5a51('0xe6'),require(_0x5a51('0xe7')));_0x4d5f5a['use'](_0x5a51('0xe8'),require(_0x5a51('0xe9')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0xea'),require('./api/userProfile'));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0xeb'),require(_0x5a51('0xec')));_0x4d5f5a[_0x5a51('0x6')]('/api/userProfile/resources',require('./api/userProfileResource'));_0x4d5f5a[_0x5a51('0x6')]('/api/auth/local',require(_0x5a51('0xed')));_0x4d5f5a['use'](_0x5a51('0xee'),require(_0x5a51('0xef')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0xf0'),require(_0x5a51('0xf1')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0xf2'),require(_0x5a51('0xf3')));_0x4d5f5a[_0x5a51('0x6')]('/api/version',require('./api/version'));_0x4d5f5a['use']('/api/system',require(_0x5a51('0xf4')));_0x4d5f5a['use']('/api/pm2',require(_0x5a51('0xf5')));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0xf6'),require('./api/webbar'));_0x4d5f5a['use'](_0x5a51('0xf7'),express[_0x5a51('0xf8')](path['join'](config[_0x5a51('0xf9')],_0x5a51('0xf7'))));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0xfa'),express['static'](path['join'](config[_0x5a51('0xf9')],_0x5a51('0xfa'))));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0xfb'),express[_0x5a51('0xf8')](path[_0x5a51('0xfc')](config[_0x5a51('0xf9')],_0x5a51('0xfb'))));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0xfd'),express[_0x5a51('0xf8')](path['join'](config['root'],'snippet',_0x5a51('0xfe'))));_0x4d5f5a[_0x5a51('0x6')](_0x5a51('0xff'),express[_0x5a51('0xf8')](path[_0x5a51('0xfc')](config[_0x5a51('0xf9')],_0x5a51('0x100'))));_0x4d5f5a[_0x5a51('0x101')](_0x5a51('0x102'))[_0x5a51('0x103')](errors[0x194]);_0x4d5f5a[_0x5a51('0x101')]('/*')['get'](function(_0x573ff9,_0x586bb2){_0x586bb2[_0x5a51('0x104')](path[_0x5a51('0x105')](_0x4d5f5a[_0x5a51('0x103')]('appPath')+_0x5a51('0x106')));});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index f036dce..1c576f1 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9afc=['../api/reportAgentPreview/reportAgentPreview.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareMessage/squareMessage.rpc','../api/attachment/attachment.rpc','server','http','rpc','port','localhost','error','listen','jayson/promise','bluebird','../config/environment','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/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc'];(function(_0x542b7a,_0x39c5d5){var _0xb0fafd=function(_0x4f32d7){while(--_0x4f32d7){_0x542b7a['push'](_0x542b7a['shift']());}};_0xb0fafd(++_0x39c5d5);}(_0x9afc,0x110));var _0xc9af=function(_0x16dbcd,_0x274516){_0x16dbcd=_0x16dbcd-0x0;var _0x34706e=_0x9afc[_0x16dbcd];return _0x34706e;};'use strict';var jayson=require(_0xc9af('0x0'));var BPromise=require(_0xc9af('0x1'));var _=require('lodash');var config=require(_0xc9af('0x2'));exports['listen']=function(){return new BPromise(function(_0x2c24d8,_0x9e02cf){var _0x429bcc={};_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require(_0xc9af('0x4')));_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require(_0xc9af('0x5')));_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require(_0xc9af('0x6')));_0x429bcc=_['merge'](_0x429bcc,require('../api/voiceRecording/voiceRecording.rpc'));_0x429bcc=_['merge'](_0x429bcc,require(_0xc9af('0x7')));_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require(_0xc9af('0x8')));_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require(_0xc9af('0x9')));_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require('../api/memberReport/memberReport.rpc'));_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require(_0xc9af('0xa')));_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require(_0xc9af('0xb')));_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require(_0xc9af('0xc')));_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require(_0xc9af('0xd')));_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require('../api/mailAccount/mailAccount.rpc'));_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require('../api/mailQueue/mailQueue.rpc'));_0x429bcc=_['merge'](_0x429bcc,require(_0xc9af('0xe')));_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require(_0xc9af('0xf')));_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require(_0xc9af('0x10')));_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require(_0xc9af('0x11')));_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require(_0xc9af('0x12')));_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require('../api/faxApplication/faxApplication.rpc'));_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require(_0xc9af('0x13')));_0x429bcc=_['merge'](_0x429bcc,require(_0xc9af('0x14')));_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require('../api/faxQueue/faxQueue.rpc'));_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require(_0xc9af('0x15')));_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require(_0xc9af('0x16')));_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require(_0xc9af('0x17')));_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require(_0xc9af('0x18')));_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require('../api/smsQueue/smsQueue.rpc'));_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require(_0xc9af('0x19')));_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require(_0xc9af('0x1a')));_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x429bcc=_['merge'](_0x429bcc,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require(_0xc9af('0x1b')));_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require(_0xc9af('0x1c')));_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require(_0xc9af('0x1d')));_0x429bcc=_['merge'](_0x429bcc,require(_0xc9af('0x1e')));_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require('../api/cmHopper/cmHopper.rpc'));_0x429bcc=_['merge'](_0x429bcc,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x429bcc=_['merge'](_0x429bcc,require(_0xc9af('0x1f')));_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require(_0xc9af('0x20')));_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require(_0xc9af('0x21')));_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require('../api/interval/interval.rpc'));_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require(_0xc9af('0x22')));_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require(_0xc9af('0x23')));_0x429bcc=_['merge'](_0x429bcc,require(_0xc9af('0x24')));_0x429bcc=_['merge'](_0x429bcc,require(_0xc9af('0x25')));_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require(_0xc9af('0x26')));_0x429bcc=_['merge'](_0x429bcc,require(_0xc9af('0x27')));_0x429bcc=_['merge'](_0x429bcc,require(_0xc9af('0x28')));_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require(_0xc9af('0x29')));_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require(_0xc9af('0x2a')));_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require(_0xc9af('0x2b')));_0x429bcc=_['merge'](_0x429bcc,require(_0xc9af('0x2c')));_0x429bcc=_['merge'](_0x429bcc,require(_0xc9af('0x2d')));_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require(_0xc9af('0x2e')));_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require(_0xc9af('0x2f')));_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require(_0xc9af('0x30')));_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require(_0xc9af('0x31')));_0x429bcc=_['merge'](_0x429bcc,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x429bcc=_['merge'](_0x429bcc,require(_0xc9af('0x32')));_0x429bcc=_['merge'](_0x429bcc,require(_0xc9af('0x33')));_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require('../api/squareOdbc/squareOdbc.rpc'));_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require('../api/squareProject/squareProject.rpc'));_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require('../api/squareRecording/squareRecording.rpc'));_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require(_0xc9af('0x34')));_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require('../api/campaign/campaign.rpc'));_0x429bcc=_['merge'](_0x429bcc,require(_0xc9af('0x35')));_0x429bcc=_[_0xc9af('0x3')](_0x429bcc,require('../api/plugin/plugin.rpc'));var _0x486232=jayson[_0xc9af('0x36')](_0x429bcc)[_0xc9af('0x37')]();var _0x5adcd9=config[_0xc9af('0x38')]['port']||config[_0xc9af('0x39')]+0x1;var _0x44e54c=config[_0xc9af('0x38')]['ip']||_0xc9af('0x3a');_0x486232['on'](_0xc9af('0x3b'),function(_0x696fee){return _0x9e02cf(_0x696fee);});_0x486232[_0xc9af('0x3c')](_0x5adcd9,_0x44e54c,function(){console['log']('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x44e54c,_0x5adcd9);require('../config/triggers')['default']();return _0x2c24d8('RPC\x20listening\x20on\x20'+_0x44e54c+':'+_0x5adcd9);});});}; \ No newline at end of file +var _0x8227=['../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','server','http','rpc','port','localhost','error','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc'];(function(_0x2eccd6,_0x1619e6){var _0x1ba661=function(_0x1e543a){while(--_0x1e543a){_0x2eccd6['push'](_0x2eccd6['shift']());}};_0x1ba661(++_0x1619e6);}(_0x8227,0x69));var _0x7822=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8227[_0x321bb2];return _0x9c12ed;};'use strict';var jayson=require(_0x7822('0x0'));var BPromise=require(_0x7822('0x1'));var _=require(_0x7822('0x2'));var config=require(_0x7822('0x3'));exports[_0x7822('0x4')]=function(){return new BPromise(function(_0x5e4eb8,_0x51cd2e){var _0xf9c7ed={};_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require(_0x7822('0x6')));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require('../api/voiceExtension/voiceExtension.rpc'));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require('../api/voiceQueue/voiceQueue.rpc'));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require(_0x7822('0x7')));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require(_0x7822('0x8')));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require('../api/voiceDialReport/voiceDialReport.rpc'));_0xf9c7ed=_['merge'](_0xf9c7ed,require(_0x7822('0x9')));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require(_0x7822('0xa')));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require(_0x7822('0xb')));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require(_0x7822('0xc')));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require(_0x7822('0xd')));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require(_0x7822('0xe')));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require(_0x7822('0xf')));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require(_0x7822('0x10')));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require('../api/mailQueue/mailQueue.rpc'));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require(_0x7822('0x11')));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require(_0x7822('0x12')));_0xf9c7ed=_['merge'](_0xf9c7ed,require(_0x7822('0x13')));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require(_0x7822('0x14')));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require(_0x7822('0x15')));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require(_0x7822('0x16')));_0xf9c7ed=_['merge'](_0xf9c7ed,require(_0x7822('0x17')));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require('../api/faxMessage/faxMessage.rpc'));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require(_0x7822('0x18')));_0xf9c7ed=_['merge'](_0xf9c7ed,require(_0x7822('0x19')));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require(_0x7822('0x1a')));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require(_0x7822('0x1b')));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require(_0x7822('0x1c')));_0xf9c7ed=_['merge'](_0xf9c7ed,require('../api/smsQueue/smsQueue.rpc'));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require(_0x7822('0x1d')));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require(_0x7822('0x1e')));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require('../api/openchannelMessage/openchannelMessage.rpc'));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require(_0x7822('0x1f')));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require(_0x7822('0x20')));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require('../api/chatInteraction/chatInteraction.rpc'));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require(_0x7822('0x21')));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require(_0x7822('0x22')));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require(_0x7822('0x23')));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require('../api/cmHopper/cmHopper.rpc'));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require(_0x7822('0x24')));_0xf9c7ed=_['merge'](_0xf9c7ed,require(_0x7822('0x25')));_0xf9c7ed=_['merge'](_0xf9c7ed,require(_0x7822('0x26')));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require(_0x7822('0x27')));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require(_0x7822('0x28')));_0xf9c7ed=_['merge'](_0xf9c7ed,require(_0x7822('0x29')));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require('../api/sound/sound.rpc'));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require('../api/template/template.rpc'));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require(_0x7822('0x2a')));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require(_0x7822('0x2b')));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require(_0x7822('0x2c')));_0xf9c7ed=_['merge'](_0xf9c7ed,require(_0x7822('0x2d')));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require(_0x7822('0x2e')));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require('../api/intZohoAccount/intZohoAccount.rpc'));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require(_0x7822('0x2f')));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require(_0x7822('0x30')));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require(_0x7822('0x31')));_0xf9c7ed=_['merge'](_0xf9c7ed,require(_0x7822('0x32')));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require(_0x7822('0x33')));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require(_0x7822('0x34')));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require(_0x7822('0x35')));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require(_0x7822('0x36')));_0xf9c7ed=_['merge'](_0xf9c7ed,require(_0x7822('0x37')));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require(_0x7822('0x38')));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require(_0x7822('0x39')));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require('../api/squareProject/squareProject.rpc'));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require(_0x7822('0x3a')));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require(_0x7822('0x3b')));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require('../api/campaign/campaign.rpc'));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require(_0x7822('0x3c')));_0xf9c7ed=_[_0x7822('0x5')](_0xf9c7ed,require(_0x7822('0x3d')));var _0x51f71b=jayson[_0x7822('0x3e')](_0xf9c7ed)[_0x7822('0x3f')]();var _0x274c31=config[_0x7822('0x40')]['port']||config[_0x7822('0x41')]+0x1;var _0x4831fa=config[_0x7822('0x40')]['ip']||_0x7822('0x42');_0x51f71b['on'](_0x7822('0x43'),function(_0x182ada){return _0x51cd2e(_0x182ada);});_0x51f71b['listen'](_0x274c31,_0x4831fa,function(){console['log']('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x4831fa,_0x274c31);require(_0x7822('0x44'))[_0x7822('0x45')]();return _0x5e4eb8(_0x7822('0x46')+_0x4831fa+':'+_0x274c31);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 877d791..08ead19 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 _0x70e0=['format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','join','EXEC\x20%s\x20%s','setExtension','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','setPriority','GOTO\x20%s\x20%s\x20%s','getVariable','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','./error','setEncoding','utf8','headers','emit','ready','line','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','substr','indexOf','length','match','error','code','close','E_AGI_SOCKET_CLOSE','E_AGI_SOCKET_TIMEOUT','destroy','pipe','write','inherits','prototype','command','sync','answer','getData','sendRequest'];(function(_0x57b762,_0x22253a){var _0x3f8c76=function(_0x34258a){while(--_0x34258a){_0x57b762['push'](_0x57b762['shift']());}};_0x3f8c76(++_0x22253a);}(_0x70e0,0x17b));var _0x070e=function(_0x43ab21,_0x5abb68){_0x43ab21=_0x43ab21-0x0;var _0x5822b9=_0x70e0[_0x43ab21];return _0x5822b9;};'use strict';var util=require(_0x070e('0x0'));var _=require(_0x070e('0x1'));var EventEmitter=require(_0x070e('0x2'))['EventEmitter'];var AGIReply=require('./reply');var AGIError=require(_0x070e('0x3'));function AGIChannel(_0xee173){var _0x277d32=this,_0x2593e5=new AGIReply(),_0x5c90fc=![],_0x7bce9b={};EventEmitter['call'](_0x277d32);_0xee173[_0x070e('0x4')]('utf8');_0xee173['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x2593e5['setEncoding'](_0x070e('0x5'));_0x2593e5['on'](_0x070e('0x6'),function(_0x604664){for(var _0x2611e6 in _0x604664){_0x277d32[_0x2611e6]=_0x604664[_0x2611e6];}_0x277d32[_0x070e('0x7')](_0x070e('0x8'));});_0x2593e5['on'](_0x070e('0x9'),function(_0x4e99e6){if(_0x4e99e6['toLowerCase']()==_0x070e('0xa')){_0x277d32[_0x070e('0x7')](_0x070e('0xa'));return;}if(_0x4e99e6[_0x070e('0xb')](0x0,0xb)==_0x070e('0xc')){_0x5c90fc=!![];}if(_0x5c90fc){_0x7bce9b['rx']+=_0x4e99e6+'\x0a';if(_0x4e99e6[_0x070e('0xd')](_0x070e('0xe'))!=-0x1){_0x5c90fc=![];}}else{_0x7bce9b['rx']=_0x4e99e6;}if(_0x5c90fc){return;}if(typeof _0x7bce9b['cb']==_0x070e('0xf')){var _0x39d2b9=_0x7bce9b['rx']['substring'](0x0,0x3),_0x5bf079=null,_0x2930b8=null;_0x39d2b9=parseInt(_0x39d2b9);if(isNaN(_0x39d2b9)){_0x7bce9b['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x39d2b9!=0xc8){_0x7bce9b['cb'](null,{'code':_0x39d2b9,'result':-0x1,'extra':'KO'});return;}_0x5bf079=_0x7bce9b['rx'][_0x070e('0xb')](0x4)['replace']('result=','');if(_0x5bf079['indexOf']('\x20')!=-0x1){_0x5bf079=_0x5bf079[_0x070e('0x10')](0x0,_0x5bf079[_0x070e('0x11')]('\x20'));}if(_['startsWith'](_0x5bf079,'-1')){_0x5bf079=parseInt(_0x5bf079);}_0x2930b8=_0x7bce9b['rx']['split']('\x20');if(_0x2930b8[_0x070e('0x12')]==0x3){_0x2930b8=_0x2930b8[0x2][_0x070e('0xb')](0x1,_0x2930b8[0x2][_0x070e('0x12')]-0x1);}else if(_0x2930b8[_0x070e('0x12')]>0x3){var _0x5bc71e=/\((.+)\)/;var _0x49861b=_0x7bce9b['rx'][_0x070e('0x13')](_0x5bc71e);if(_0x49861b){_0x2930b8=_0x49861b[0x1];}else{_0x2930b8=null;}}else{_0x2930b8=null;}_0x7bce9b['cb'](null,{'code':_0x39d2b9,'result':_0x5bf079,'extra':_0x2930b8});}});_0xee173['on'](_0x070e('0x14'),function(_0x38f6e6){_0x277d32[_0x070e('0x7')](_0x070e('0x14'),new AGIError('E_AGI_SOCKET_ERROR',_0x38f6e6[_0x070e('0x15')]));});_0xee173['on'](_0x070e('0x16'),function(){_0x277d32[_0x070e('0x7')](_0x070e('0x16'),new AGIError(_0x070e('0x17')));});_0xee173['on']('timeout',function(){_0x277d32['emit']('timeout',new AGIError(_0x070e('0x18')));_0xee173[_0x070e('0x19')]();});_0xee173[_0x070e('0x1a')](_0x2593e5);this['command']=function(_0x5b184,_0x5dc5d2){var _0x5b184=_0x5b184||'',_0x5dc5d2=typeof _0x5dc5d2==_0x070e('0xf')?_0x5dc5d2:new Function();_0x7bce9b={'tx':_0x5b184,'rx':'','cb':_0x5dc5d2};_0xee173[_0x070e('0x1b')](_0x5b184+'\x0a');},this[_0x070e('0x16')]=function(){_0xee173[_0x070e('0x19')]();};}util[_0x070e('0x1c')](AGIChannel,EventEmitter);AGIChannel[_0x070e('0x1d')]['sendRequest']=function(_0x2f8055){return this[_0x070e('0x1e')][_0x070e('0x1f')](this,_0x2f8055);};AGIChannel['prototype'][_0x070e('0x20')]=function(){return this['sendRequest']('ANSWER');};AGIChannel[_0x070e('0x1d')][_0x070e('0x21')]=function(_0x41deb1,_0x1743cc,_0x4763c6){_0x41deb1=_0x41deb1===undefined?'beep':_0x41deb1;_0x1743cc=_0x1743cc===undefined?'5':_0x1743cc;_0x4763c6=_0x4763c6===undefined?'1':_0x4763c6;return this[_0x070e('0x22')](util[_0x070e('0x23')](_0x070e('0x24'),_0x41deb1,_0x1743cc*0x3e8,_0x4763c6));};AGIChannel[_0x070e('0x1d')][_0x070e('0x25')]=function(_0x28d7f2){_0x28d7f2=_0x28d7f2||_0x070e('0x26');return this[_0x070e('0x22')](util['format'](_0x070e('0x27'),_0x28d7f2));};AGIChannel[_0x070e('0x1d')][_0x070e('0x28')]=function(_0x56fc12,_0x5c5f0d){if(_[_0x070e('0x29')](_0x5c5f0d)){return this[_0x070e('0x22')](util[_0x070e('0x23')]('EXEC\x20%s\x20%s',_0x56fc12,_0x5c5f0d[_0x070e('0x2a')](',')));}return this[_0x070e('0x22')](util[_0x070e('0x23')](_0x070e('0x2b'),_0x56fc12,_0x5c5f0d));};AGIChannel['prototype']['setContext']=function(_0x523b75){return this['sendRequest'](util[_0x070e('0x23')]('SET\x20CONTEXT\x20%s',_0x523b75));};AGIChannel[_0x070e('0x1d')][_0x070e('0x2c')]=function(_0x4f8130){return this['sendRequest'](util[_0x070e('0x23')](_0x070e('0x2d'),_0x4f8130));};AGIChannel['prototype']['setPriority']=function(_0x41ade4){return this[_0x070e('0x22')](util[_0x070e('0x23')](_0x070e('0x2e'),_0x41ade4));};AGIChannel[_0x070e('0x1d')]['hangup']=function(){return this['sendRequest'](_0x070e('0x2f'));};AGIChannel[_0x070e('0x1d')][_0x070e('0x30')]=function(_0xf57ed,_0xf11439){var _0x4deaf8=_[_0x070e('0x31')](_0xf11439)||_[_0x070e('0x32')](_0xf11439)?_0xf11439['toString']():_0xf11439;return this[_0x070e('0x22')](util[_0x070e('0x23')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0xf57ed,_0x4deaf8?_0x4deaf8['toString']()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x070e('0x1d')][_0x070e('0x33')]=function(_0x39dfaa,_0x334733){return this[_0x070e('0x22')](util['format'](_0x070e('0x34'),_0x39dfaa,_0x334733));};AGIChannel[_0x070e('0x1d')][_0x070e('0x35')]=function(_0x487276,_0x268c5d){return this[_0x070e('0x22')](util[_0x070e('0x23')]('SAY\x20DIGITS\x20%s\x20%s',_0x487276,_0x268c5d));};AGIChannel[_0x070e('0x1d')][_0x070e('0x36')]=function(_0x4800a9,_0x173602){return this['sendRequest'](util[_0x070e('0x23')](_0x070e('0x37'),_0x4800a9,_0x173602));};AGIChannel[_0x070e('0x1d')][_0x070e('0x38')]=function(_0xd03404,_0x47b929,_0xd18220){_0x47b929=_0x47b929||this['extension'];_0xd18220=_0xd18220||0x1;this['setContext'](_0xd03404);this[_0x070e('0x2c')](_0x47b929);this[_0x070e('0x39')](_0xd18220);return this[_0x070e('0x25')](util['format'](_0x070e('0x3a'),_0xd03404,_0x47b929,_0xd18220));};AGIChannel[_0x070e('0x1d')][_0x070e('0x3b')]=function(_0x7dc240){return this['sendRequest'](util[_0x070e('0x23')]('GET\x20VARIABLE\x20\x22%s\x22',_0x7dc240));};AGIChannel['prototype']['recordFile']=function(_0x3feb83,_0x926533,_0x26b3e2,_0x29dccd,_0x34f23e,_0x562aa4){_0x926533=_0x926533||_0x070e('0x3c');_0x26b3e2=_0x26b3e2||'';_0x29dccd=_0x29dccd===undefined?-0x1:_0x29dccd==='-1'?-0x1:_0x29dccd*0x3e8;_0x34f23e=_0x34f23e===undefined?'':'s='+_0x34f23e;_0x562aa4=_0x562aa4?'BEEP':'';return this[_0x070e('0x22')](util[_0x070e('0x23')](_0x070e('0x3d'),_0x3feb83,_0x926533,_0x26b3e2,_0x29dccd,_0x562aa4,_0x34f23e));};AGIChannel['prototype']['streamFile']=function(_0x261a27,_0x5ee4b8){_0x5ee4b8=_0x5ee4b8||'';return this[_0x070e('0x22')](util[_0x070e('0x23')](_0x070e('0x3e'),_0x261a27,_0x5ee4b8));};AGIChannel['prototype'][_0x070e('0x3f')]=function(_0x20a1ee){return this['exec']('AGI',_0x20a1ee);};AGIChannel[_0x070e('0x1d')][_0x070e('0x40')]=function(_0x2d43ce){return this[_0x070e('0x28')](_0x070e('0x41'),_0x2d43ce);};AGIChannel['prototype'][_0x070e('0x14')]=function(_0x3f6c64,_0x427fa7){this[_0x070e('0x25')](util[_0x070e('0x23')](_0x070e('0x42'),_0x3f6c64['id'],_0x3f6c64[_0x070e('0x43')],_0x427fa7));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x070e('0x44')]=AGIChannel; \ No newline at end of file +var _0x34e8=['toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','no\x20code','replace','indexOf','substr','startsWith','length','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','command','function','write','inherits','sendRequest','prototype','answer','beep','format','NO\x20MESSAGE','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isNumber','toString','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','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','WAIT','noop','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','EventEmitter','./error','call','utf8','setEncoding','headers','emit','ready','line'];(function(_0x3bc171,_0x878cb6){var _0x551ff8=function(_0x432a5c){while(--_0x432a5c){_0x3bc171['push'](_0x3bc171['shift']());}};_0x551ff8(++_0x878cb6);}(_0x34e8,0x12c));var _0x834e=function(_0x26bafc,_0x2d90ce){_0x26bafc=_0x26bafc-0x0;var _0x77c3eb=_0x34e8[_0x26bafc];return _0x77c3eb;};'use strict';var util=require(_0x834e('0x0'));var _=require(_0x834e('0x1'));var EventEmitter=require(_0x834e('0x2'))[_0x834e('0x3')];var AGIReply=require('./reply');var AGIError=require(_0x834e('0x4'));function AGIChannel(_0x21e2e0){var _0x472111=this,_0x31bf20=new AGIReply(),_0x289ef2=![],_0x19a3e0={};EventEmitter[_0x834e('0x5')](_0x472111);_0x21e2e0['setEncoding'](_0x834e('0x6'));_0x21e2e0['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x31bf20[_0x834e('0x7')](_0x834e('0x6'));_0x31bf20['on'](_0x834e('0x8'),function(_0x2e69e2){for(var _0x33ea05 in _0x2e69e2){_0x472111[_0x33ea05]=_0x2e69e2[_0x33ea05];}_0x472111[_0x834e('0x9')](_0x834e('0xa'));});_0x31bf20['on'](_0x834e('0xb'),function(_0x3bdda9){if(_0x3bdda9[_0x834e('0xc')]()==_0x834e('0xd')){_0x472111[_0x834e('0x9')](_0x834e('0xd'));return;}if(_0x3bdda9[_0x834e('0xe')](0x0,0xb)==_0x834e('0xf')){_0x289ef2=!![];}if(_0x289ef2){_0x19a3e0['rx']+=_0x3bdda9+'\x0a';if(_0x3bdda9[_0x834e('0x10')](_0x834e('0x11'))!=-0x1){_0x289ef2=![];}}else{_0x19a3e0['rx']=_0x3bdda9;}if(_0x289ef2){return;}if(typeof _0x19a3e0['cb']=='function'){var _0x5e5b6d=_0x19a3e0['rx'][_0x834e('0xe')](0x0,0x3),_0x6cd9b9=null,_0x58a27e=null;_0x5e5b6d=parseInt(_0x5e5b6d);if(isNaN(_0x5e5b6d)){_0x19a3e0['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x834e('0x12')});return;}if(_0x5e5b6d!=0xc8){_0x19a3e0['cb'](null,{'code':_0x5e5b6d,'result':-0x1,'extra':'KO'});return;}_0x6cd9b9=_0x19a3e0['rx'][_0x834e('0xe')](0x4)[_0x834e('0x13')]('result=','');if(_0x6cd9b9[_0x834e('0x14')]('\x20')!=-0x1){_0x6cd9b9=_0x6cd9b9[_0x834e('0x15')](0x0,_0x6cd9b9['indexOf']('\x20'));}if(_[_0x834e('0x16')](_0x6cd9b9,'-1')){_0x6cd9b9=parseInt(_0x6cd9b9);}_0x58a27e=_0x19a3e0['rx']['split']('\x20');if(_0x58a27e[_0x834e('0x17')]==0x3){_0x58a27e=_0x58a27e[0x2][_0x834e('0xe')](0x1,_0x58a27e[0x2]['length']-0x1);}else if(_0x58a27e[_0x834e('0x17')]>0x3){var _0x22106e=/\((.+)\)/;var _0x370fb5=_0x19a3e0['rx']['match'](_0x22106e);if(_0x370fb5){_0x58a27e=_0x370fb5[0x1];}else{_0x58a27e=null;}}else{_0x58a27e=null;}_0x19a3e0['cb'](null,{'code':_0x5e5b6d,'result':_0x6cd9b9,'extra':_0x58a27e});}});_0x21e2e0['on'](_0x834e('0x18'),function(_0x211e9a){_0x472111[_0x834e('0x9')](_0x834e('0x18'),new AGIError(_0x834e('0x19'),_0x211e9a[_0x834e('0x1a')]));});_0x21e2e0['on'](_0x834e('0x1b'),function(){_0x472111['emit'](_0x834e('0x1b'),new AGIError(_0x834e('0x1c')));});_0x21e2e0['on'](_0x834e('0x1d'),function(){_0x472111[_0x834e('0x9')]('timeout',new AGIError(_0x834e('0x1e')));_0x21e2e0[_0x834e('0x1f')]();});_0x21e2e0['pipe'](_0x31bf20);this[_0x834e('0x20')]=function(_0x28d687,_0x8d406e){var _0x28d687=_0x28d687||'',_0x8d406e=typeof _0x8d406e==_0x834e('0x21')?_0x8d406e:new Function();_0x19a3e0={'tx':_0x28d687,'rx':'','cb':_0x8d406e};_0x21e2e0[_0x834e('0x22')](_0x28d687+'\x0a');},this['close']=function(){_0x21e2e0[_0x834e('0x1f')]();};}util[_0x834e('0x23')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x834e('0x24')]=function(_0x2e1983){return this[_0x834e('0x20')]['sync'](this,_0x2e1983);};AGIChannel[_0x834e('0x25')][_0x834e('0x26')]=function(){return this['sendRequest']('ANSWER');};AGIChannel[_0x834e('0x25')]['getData']=function(_0x2826ec,_0x3f1b0b,_0x3db026){_0x2826ec=_0x2826ec===undefined?_0x834e('0x27'):_0x2826ec;_0x3f1b0b=_0x3f1b0b===undefined?'5':_0x3f1b0b;_0x3db026=_0x3db026===undefined?'1':_0x3db026;return this[_0x834e('0x24')](util[_0x834e('0x28')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x2826ec,_0x3f1b0b*0x3e8,_0x3db026));};AGIChannel['prototype']['noop']=function(_0x58c1d7){_0x58c1d7=_0x58c1d7||_0x834e('0x29');return this[_0x834e('0x24')](util[_0x834e('0x28')]('VERBOSE\x20\x22%s\x22',_0x58c1d7));};AGIChannel[_0x834e('0x25')][_0x834e('0x2a')]=function(_0x1f3671,_0x1e026a){if(_[_0x834e('0x2b')](_0x1e026a)){return this[_0x834e('0x24')](util[_0x834e('0x28')](_0x834e('0x2c'),_0x1f3671,_0x1e026a[_0x834e('0x2d')](',')));}return this['sendRequest'](util[_0x834e('0x28')]('EXEC\x20%s\x20%s',_0x1f3671,_0x1e026a));};AGIChannel[_0x834e('0x25')][_0x834e('0x2e')]=function(_0x9ab921){return this[_0x834e('0x24')](util[_0x834e('0x28')](_0x834e('0x2f'),_0x9ab921));};AGIChannel[_0x834e('0x25')][_0x834e('0x30')]=function(_0x358c31){return this[_0x834e('0x24')](util['format'](_0x834e('0x31'),_0x358c31));};AGIChannel[_0x834e('0x25')][_0x834e('0x32')]=function(_0xaf01f4){return this['sendRequest'](util[_0x834e('0x28')](_0x834e('0x33'),_0xaf01f4));};AGIChannel['prototype']['hangup']=function(){return this['sendRequest'](_0x834e('0x34'));};AGIChannel[_0x834e('0x25')][_0x834e('0x35')]=function(_0x34fefb,_0x339e28){var _0x1b76dd=_['isBoolean'](_0x339e28)||_[_0x834e('0x36')](_0x339e28)?_0x339e28['toString']():_0x339e28;return this[_0x834e('0x24')](util[_0x834e('0x28')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x34fefb,_0x1b76dd?_0x1b76dd[_0x834e('0x37')]()[_0x834e('0x13')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype']['sayNumber']=function(_0x388711,_0xd0d43a){return this[_0x834e('0x24')](util[_0x834e('0x28')](_0x834e('0x38'),_0x388711,_0xd0d43a));};AGIChannel['prototype'][_0x834e('0x39')]=function(_0x548d1d,_0x50c243){return this[_0x834e('0x24')](util['format'](_0x834e('0x3a'),_0x548d1d,_0x50c243));};AGIChannel[_0x834e('0x25')][_0x834e('0x3b')]=function(_0x3c59af,_0x2b7933){return this['sendRequest'](util[_0x834e('0x28')](_0x834e('0x3c'),_0x3c59af,_0x2b7933));};AGIChannel[_0x834e('0x25')]['continueAt']=function(_0x35380e,_0x16ac45,_0x57b89a){_0x16ac45=_0x16ac45||this[_0x834e('0x3d')];_0x57b89a=_0x57b89a||0x1;this['setContext'](_0x35380e);this[_0x834e('0x30')](_0x16ac45);this[_0x834e('0x32')](_0x57b89a);return this['noop'](util['format'](_0x834e('0x3e'),_0x35380e,_0x16ac45,_0x57b89a));};AGIChannel[_0x834e('0x25')][_0x834e('0x3f')]=function(_0xbc1571){return this[_0x834e('0x24')](util[_0x834e('0x28')](_0x834e('0x40'),_0xbc1571));};AGIChannel['prototype'][_0x834e('0x41')]=function(_0x5abb7a,_0x321efa,_0x540685,_0x1df5b0,_0x5a5807,_0x361f60){_0x321efa=_0x321efa||_0x834e('0x42');_0x540685=_0x540685||'';_0x1df5b0=_0x1df5b0===undefined?-0x1:_0x1df5b0==='-1'?-0x1:_0x1df5b0*0x3e8;_0x5a5807=_0x5a5807===undefined?'':'s='+_0x5a5807;_0x361f60=_0x361f60?'BEEP':'';return this[_0x834e('0x24')](util[_0x834e('0x28')](_0x834e('0x43'),_0x5abb7a,_0x321efa,_0x540685,_0x1df5b0,_0x361f60,_0x5a5807));};AGIChannel[_0x834e('0x25')][_0x834e('0x44')]=function(_0x1a7149,_0xfa28da){_0xfa28da=_0xfa28da||'';return this[_0x834e('0x24')](util[_0x834e('0x28')](_0x834e('0x45'),_0x1a7149,_0xfa28da));};AGIChannel['prototype'][_0x834e('0x46')]=function(_0x6fff27){return this['exec'](_0x834e('0x47'),_0x6fff27);};AGIChannel[_0x834e('0x25')][_0x834e('0x48')]=function(_0x2112d5){return this[_0x834e('0x2a')](_0x834e('0x49'),_0x2112d5);};AGIChannel['prototype']['error']=function(_0x954d4b,_0x1a5444){this[_0x834e('0x4a')](util[_0x834e('0x28')](_0x834e('0x4b'),_0x954d4b['id'],_0x954d4b[_0x834e('0x4c')],_0x1a5444));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x834e('0x4d')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index c5e7af6..40cf43b 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 _0xf4e5=['name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','message'];(function(_0x8b51d8,_0x549f97){var _0x2717e3=function(_0xd3b96b){while(--_0xd3b96b){_0x8b51d8['push'](_0x8b51d8['shift']());}};_0x2717e3(++_0x549f97);}(_0xf4e5,0xd4));var _0x5f4e=function(_0x85b728,_0xdc5901){_0x85b728=_0x85b728-0x0;var _0x323c50=_0xf4e5[_0x85b728];return _0x323c50;};'use strict';var util=require(_0x5f4e('0x0'));var error={'E_AGI_UNDEFINED':_0x5f4e('0x1'),'E_AGI_ARGUMENT_PORT':_0x5f4e('0x2'),'E_AGI_SERVER_ERROR':_0x5f4e('0x3'),'E_AGI_SERVER_CLOSE':_0x5f4e('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0x5f4e('0x5'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0x5f4e('0x6'),'E_AGI_SOCKET_TIMEOUT':_0x5f4e('0x7'),'E_AGI_COMMAND_EMPTY':_0x5f4e('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0x5f4e('0x9')};function AGIError(_0x44e9e4){var _0x44e9e4=_0x44e9e4||null,_0xbb7fcc=_0xbb7fcc||[],_0x29199a=0x1,_0x223ef1='';if(!error[_0x44e9e4]){_0x44e9e4=_0x5f4e('0xa');}_0xbb7fcc[_0x5f4e('0xb')](error[_0x44e9e4]);while(arguments[_0x29199a]){_0xbb7fcc[_0x5f4e('0xb')](arguments[_0x29199a]);_0x29199a++;}_0x223ef1=util['format']['apply'](util,_0xbb7fcc);this[_0x5f4e('0xc')]=_0x223ef1;this[_0x5f4e('0xd')]=_0x44e9e4;}module[_0x5f4e('0xe')]=AGIError; \ No newline at end of file +var _0x4c4e=['Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','apply','message','name','exports','util','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.'];(function(_0x588a94,_0x45b43d){var _0x147aa4=function(_0x2b0d4c){while(--_0x2b0d4c){_0x588a94['push'](_0x588a94['shift']());}};_0x147aa4(++_0x45b43d);}(_0x4c4e,0x152));var _0xe4c4=function(_0x527f37,_0x645db7){_0x527f37=_0x527f37-0x0;var _0x26dd92=_0x4c4e[_0x527f37];return _0x26dd92;};'use strict';var util=require(_0xe4c4('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0xe4c4('0x1'),'E_AGI_SERVER_ERROR':_0xe4c4('0x2'),'E_AGI_SERVER_CLOSE':_0xe4c4('0x3'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0xe4c4('0x4'),'E_AGI_SOCKET_ERROR':_0xe4c4('0x5'),'E_AGI_SOCKET_CLOSE':_0xe4c4('0x6'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0xe4c4('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0xe4c4('0x8')};function AGIError(_0x1a12a6){var _0x1a12a6=_0x1a12a6||null,_0xad105=_0xad105||[],_0x22085a=0x1,_0x329d29='';if(!error[_0x1a12a6]){_0x1a12a6=_0xe4c4('0x9');}_0xad105[_0xe4c4('0xa')](error[_0x1a12a6]);while(arguments[_0x22085a]){_0xad105['push'](arguments[_0x22085a]);_0x22085a++;}_0x329d29=util['format'][_0xe4c4('0xb')](util,_0xad105);this[_0xe4c4('0xc')]=_0x329d29;this[_0xe4c4('0xd')]=_0x1a12a6;}module[_0xe4c4('0xe')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 8f9788a..53657a1 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 _0xb8a0=['relations','getVertex','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','agicommand','vswitch','target','invalid','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','agi','menu','getsecretdigits','addVertex','vertices','edges','prototype','addEdge','push','numberOfEdges','size'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb8a0,0x1d5));var _0x0b8a=function(_0x308af2,_0x4031b0){_0x308af2=_0x308af2-0x0;var _0x48d198=_0xb8a0[_0x308af2];return _0x48d198;};'use strict';var _=require('lodash');var logger=require('../../../config/logger')(_0x0b8a('0x0'));var verticesWithRetry=[_0x0b8a('0x1'),'getdigits',_0x0b8a('0x2')];var Graph=function(){this['vertices']={};this['edges']={};this['numberOfEdges']=0x0;};Graph['prototype'][_0x0b8a('0x3')]=function(_0x1ce9fb){this[_0x0b8a('0x4')][_0x1ce9fb['id']]=_0x1ce9fb;this[_0x0b8a('0x5')][_0x1ce9fb['id']]=[];};Graph[_0x0b8a('0x6')][_0x0b8a('0x7')]=function(_0x33a5bd,_0x463015,_0x29ebdc){this[_0x0b8a('0x5')][_0x33a5bd][_0x0b8a('0x8')]({'target':_0x463015,'condition':_0x29ebdc});this[_0x0b8a('0x9')]+=0x1;};Graph[_0x0b8a('0x6')][_0x0b8a('0xa')]=function(){return _[_0x0b8a('0xa')](this[_0x0b8a('0x4')]);};Graph[_0x0b8a('0x6')][_0x0b8a('0xb')]=function(){return this[_0x0b8a('0x9')];};Graph[_0x0b8a('0x6')][_0x0b8a('0xc')]=function(_0x16d587){return this['vertices'][_0x16d587];};Graph[_0x0b8a('0x6')][_0x0b8a('0xd')]=function(_0x3c96c9,_0x33f027){if(!this[_0x0b8a('0x4')][_0x3c96c9]){return logger[_0x0b8a('0xe')](_0x0b8a('0xf'));}var _0x4066ef=_0x33f027(this[_0x0b8a('0x4')][_0x3c96c9]);if(!_0x4066ef){return logger['info'](_0x0b8a('0x10'));}if(this[_0x0b8a('0x5')][_0x3c96c9][_0x0b8a('0x11')]===0x0){return logger['info'](_0x0b8a('0x12'));}for(var _0x2f9867=0x0,_0x1c5ac2=[],_0x5a2623=![];_0x2f9867\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','timeout','evtHangup','hangup','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','agicommand','gotoc','context','extension','priority','response','code','result','toString','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','vertex','agicommand\x20not\x20found','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]','connection','xml2json','lodash','syncho','util','moment','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./mailRpc','./graph','defaults','error','stack','log','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\x20%s','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','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','arg_1','toJson','mxGraphModel','root','retry','addVertex','omit','hasOwnProperty','isArray'];(function(_0x30126c,_0x43a5a3){var _0x184d7f=function(_0x34f445){while(--_0x34f445){_0x30126c['push'](_0x30126c['shift']());}};_0x184d7f(++_0x43a5a3);}(_0x2123,0x190));var _0x3212=function(_0xface47,_0x24551c){_0xface47=_0xface47-0x0;var _0x52d326=_0x2123[_0xface47];return _0x52d326;};'use strict';var parser=require(_0x3212('0x0'));var _=require(_0x3212('0x1'));var syncho=require(_0x3212('0x2'));var util=require(_0x3212('0x3'));var moment=require(_0x3212('0x4'));var config=require(_0x3212('0x5'));var logger=require(_0x3212('0x6'))(_0x3212('0x7'));var utilLicense=require(_0x3212('0x8'));var rpc=require(_0x3212('0x9'));var mailRpc=require(_0x3212('0xa'));var Graph=require(_0x3212('0xb'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x3212('0x7')]=_[_0x3212('0xc')](config[_0x3212('0x7')],{'ip':'127.0.0.1','port':0x11dd});function connectionHandler(_0x3e17a3){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x3e17a3);agiHandler(_0x3e17a3);}catch(_0x313265){logger[_0x3212('0xd')](_0x313265[_0x3212('0xe')]);}});});}function listeningHandler(){console[_0x3212('0xf')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config['agi'][_0x3212('0x10')]);logger[_0x3212('0x11')](util[_0x3212('0x12')](_0x3212('0x13'),config[_0x3212('0x7')]['ip'],config[_0x3212('0x7')][_0x3212('0x10')]));}function errorHandler(_0x359cef){if(_0x359cef&&_0x359cef[_0x3212('0x14')]&&_0x359cef[_0x3212('0x15')]){logger[_0x3212('0xd')](util[_0x3212('0x12')](_0x3212('0x16'),_0x359cef[_0x3212('0x14')],_0x359cef[_0x3212('0x15')]));}else{logger[_0x3212('0xd')](util[_0x3212('0x12')](_0x3212('0x17'),_0x359cef[_0x3212('0xe')]));}}function closeHandler(){logger[_0x3212('0x11')](util[_0x3212('0x12')](_0x3212('0x18'),this['arg_1'],this[_0x3212('0x19')],this[_0x3212('0x1a')],this[_0x3212('0x1b')],this[_0x3212('0x1c')]));try{createSquareReport(this);}catch(_0x521f3f){logger[_0x3212('0xd')](_0x521f3f[_0x3212('0xe')]);}}function timeoutHandler(){logger['info'](util['format'](_0x3212('0x1d'),this['arg_1'],this[_0x3212('0x19')],this[_0x3212('0x1a')],this[_0x3212('0x1b')],this[_0x3212('0x1c')]));}function hangupHandler(){logger[_0x3212('0x11')](util['format'](_0x3212('0x1e'),this[_0x3212('0x1f')],this['calleridname'],this[_0x3212('0x1a')],this[_0x3212('0x1b')],this[_0x3212('0x1c')]));this['evtHangup']=!![];}function getRoot(_0x5d27d5){return parser[_0x3212('0x20')](_0x5d27d5,{'object':!![]})[_0x3212('0x21')][_0x3212('0x22')];}function addVertex(_0x3b1c35,_0x3ceb3c,_0x436ecd){_0x3ceb3c['agicommand']=_0x436ecd;if(_0x3ceb3c['hasOwnProperty'](_0x3212('0x23'))){_0x3ceb3c['maxRetry']=parseInt(_0x3ceb3c[_0x3212('0x23')],0xa);}_0x3b1c35[_0x3212('0x24')](_[_0x3212('0x25')](_0x3ceb3c,'mxCell'));}function initGraph(_0x2d1b92,_0x32f7fd){var _0x851b91=new Graph();for(var _0x4de92e in _0x2d1b92){if(_0x2d1b92[_0x3212('0x26')](_0x4de92e)){if(_[_0x3212('0x27')](_0x2d1b92[_0x4de92e])){for(var _0x108eee=0x0;_0x108eee<_0x2d1b92[_0x4de92e][_0x3212('0x28')];_0x108eee+=0x1){addVertex(_0x851b91,_0x2d1b92[_0x4de92e][_0x108eee],_0x4de92e);}}else{addVertex(_0x851b91,_0x2d1b92[_0x4de92e],_0x4de92e);}}}for(var _0x21f003=0x0;_0x21f003<_0x32f7fd[_0x3212('0x28')];_0x21f003+=0x1){if(_0x32f7fd[_0x21f003][_0x3212('0x29')]&&_0x32f7fd[_0x21f003][_0x3212('0x2a')]){_0x851b91[_0x3212('0x2b')](_0x32f7fd[_0x21f003][_0x3212('0x29')],_0x32f7fd[_0x21f003][_0x3212('0x2a')],_0x32f7fd[_0x21f003][_0x3212('0x2c')]);}}return _0x851b91;}function getSquareProject(_0x57613f,_0x1e2660){rpc[_0x3212('0x2d')](_0x57613f)[_0x3212('0x2e')](function(_0x1cbab5){_0x1e2660(null,_0x1cbab5);})[_0x3212('0x2f')](function(_0x309420){_0x1e2660(null,_0x309420);});}function createSquareReport(_0x3a7883,_0x5059bd){rpc[_0x3212('0x30')](_0x3a7883)['then'](function(_0x164b1f){if(_0x5059bd){_0x5059bd(null,_0x164b1f);}})['catch'](function(_0x2fae5d){if(_0x5059bd){_0x5059bd(null,_0x2fae5d);}});}function setChannelVariables(_0x4ddc8f){for(var _0x4d17bb in _0x4ddc8f){if(_0x4ddc8f[_0x3212('0x26')](_0x4d17bb)){if(_0x4d17bb['indexOf'](_0x3212('0x31'))===0x0){_0x4ddc8f[_0x4d17bb[_0x3212('0x32')](0x4)]=_0x4ddc8f[_0x4d17bb];delete _0x4ddc8f[_0x4d17bb];}}}}function getLogFromObject(_0x2c664b){return util['inspect'](_0x2c664b,{'showHidden':![],'depth':null});}function agiHandler(_0x35f3fc){var _0x412740,_0x1f3b2c,_0x487ce4,_0x4ccbd1,_0xa3d7b0;logger[_0x3212('0x33')](_0x3212('0x34'),JSON[_0x3212('0x35')](_0x35f3fc,null,0x2));logger['info'](util[_0x3212('0x12')](_0x3212('0x36'),_0x35f3fc[_0x3212('0x1f')],_0x35f3fc['calleridname'],_0x35f3fc[_0x3212('0x1a')],_0x35f3fc[_0x3212('0x1b')],_0x35f3fc[_0x3212('0x1c')]));_0x35f3fc['on'](_0x3212('0xd'),errorHandler);_0x35f3fc['on']('close',closeHandler);_0x35f3fc['on'](_0x3212('0x37'),timeoutHandler);_0x35f3fc[_0x3212('0x38')]=![];_0x35f3fc['on'](_0x3212('0x39'),hangupHandler);var _0x39ffd0=getSquareProject['sync'](null,_0x35f3fc['arg_1']);if(_0x39ffd0){if(_0x39ffd0['production']){_0x412740=getRoot(_0x39ffd0['production']);if(_0x412740&&_0x412740[_0x3212('0x3a')]){logger[_0x3212('0x33')](_0x3212('0x22'),JSON[_0x3212('0x35')](_0x412740,null,0x2));_0x35f3fc['joinAt']=moment()[_0x3212('0x12')](_0x3212('0x3b'));_0x1f3b2c=initGraph(_[_0x3212('0x25')](_0x412740,_0x3212('0x3c')),_0x412740['mxCell']);_0x487ce4=new Vertices(_0x35f3fc,rpc,mailRpc);logger['info'](util[_0x3212('0x12')](_0x3212('0x3d'),_0x35f3fc[_0x3212('0x1f')],_0x35f3fc[_0x3212('0x19')],_0x35f3fc[_0x3212('0x1a')],_0x35f3fc[_0x3212('0x1b')],_0x35f3fc[_0x3212('0x1c')]));_0x1f3b2c['traverseBFS'](_0x412740[_0x3212('0x3a')]['id'],function(_0x3768a){try{_0x3768a=_0x487ce4[_0x3212('0x3e')](_0x3768a);logger[_0x3212('0x33')]('vertex',JSON[_0x3212('0x35')](_0x3768a,null,0x2));if(_0x3768a[_0x3212('0x3f')]===_0x3212('0x40')){logger[_0x3212('0x11')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x35f3fc[_0x3212('0x41')]=_0x3768a['context']||_0x35f3fc[_0x3212('0x41')];_0x35f3fc[_0x3212('0x42')]=_0x3768a[_0x3212('0x42')];_0x35f3fc[_0x3212('0x43')]=_0x3768a[_0x3212('0x43')]?_0x3768a[_0x3212('0x43')]-0x1:0x1;return null;}else if(_0x3768a&&_0x487ce4[_0x3768a[_0x3212('0x3f')]]){_0xa3d7b0=_0x487ce4[_0x3768a[_0x3212('0x3f')]](_0x3768a);logger['info'](_0x3212('0x44'),JSON[_0x3212('0x35')](_0xa3d7b0,null,0x2));if(_0xa3d7b0&&_0xa3d7b0[_0x3212('0x45')]===AGI_CODE_SUCCESS&&_0xa3d7b0[_0x3212('0x46')]!==AGI_RESULT_ERROR&&!_0x35f3fc[_0x3212('0x38')]){logger[_0x3212('0x33')](_0x3212('0x44'),getLogFromObject(_0xa3d7b0));return _['isUndefined'](_0xa3d7b0[_0x3212('0x46')])?null:_0xa3d7b0[_0x3212('0x46')][_0x3212('0x47')]();}else{logger[_0x3212('0xd')]('response',getLogFromObject(_0xa3d7b0));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0x51e82d){logger[_0x3212('0xd')](_0x51e82d['stack']);return null;}});if(_0x412740[_0x3212('0x48')]){logger[_0x3212('0x11')](util[_0x3212('0x12')](_0x3212('0x49'),_0x35f3fc['arg_1'],_0x35f3fc[_0x3212('0x19')],_0x35f3fc[_0x3212('0x1a')],_0x35f3fc[_0x3212('0x1b')],_0x35f3fc['uniqueid']));_0x1f3b2c[_0x3212('0x4a')](_0x412740[_0x3212('0x48')]['id'],function(_0x3e1345){try{_0x3e1345=_0x487ce4[_0x3212('0x3e')](_0x3e1345);logger['debug'](_0x3212('0x4b'),JSON[_0x3212('0x35')](_0x3e1345,null,0x2));if(_0x3e1345&&_0x487ce4[_0x3e1345['agicommand']]){_0xa3d7b0=_0x487ce4[_0x3e1345[_0x3212('0x3f')]](_0x3e1345);if(_0xa3d7b0){logger[_0x3212('0x33')](_0x3212('0x44'),getLogFromObject(_0xa3d7b0));return _['isUndefined'](_0xa3d7b0['result'])?null:_0xa3d7b0[_0x3212('0x46')][_0x3212('0x47')]();}else{logger[_0x3212('0xd')]('response',getLogFromObject(_0xa3d7b0));return null;}}else{logger[_0x3212('0xd')](_0x3212('0x4c'));return null;}}catch(_0x4ee235){logger[_0x3212('0xd')](_0x4ee235[_0x3212('0xe')]);return null;}});}logger[_0x3212('0x11')](util['format']('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x35f3fc[_0x3212('0x1f')],_0x35f3fc[_0x3212('0x19')],_0x35f3fc[_0x3212('0x1a')],_0x35f3fc[_0x3212('0x1b')],_0x35f3fc['uniqueid']));logger[_0x3212('0x11')](util[_0x3212('0x12')](_0x3212('0x4d'),_0x35f3fc['context'],_0x35f3fc[_0x3212('0x42')],parseInt(_0x35f3fc['priority'],0xa)+0x1));_0x35f3fc[_0x3212('0x4e')](_0x35f3fc[_0x3212('0x41')],_0x35f3fc[_0x3212('0x42')],parseInt(_0x35f3fc[_0x3212('0x43')],0xa)+0x1);_0x35f3fc['close']();}}else{logger[_0x3212('0xd')](util[_0x3212('0x12')]('Project\x20%s\x20not\x20published',_0x35f3fc[_0x3212('0x1f')]));_0x35f3fc[_0x3212('0x4e')](_0x35f3fc[_0x3212('0x41')],_0x35f3fc[_0x3212('0x42')],parseInt(_0x35f3fc[_0x3212('0x43')],0xa)+0x1);_0x35f3fc[_0x3212('0x4f')]();}}else{logger[_0x3212('0xd')](util['format'](_0x3212('0x50'),_0x35f3fc[_0x3212('0x1f')]));_0x35f3fc[_0x3212('0x4e')](_0x35f3fc[_0x3212('0x41')],_0x35f3fc['extension'],parseInt(_0x35f3fc['priority'],0xa)+0x1);_0x35f3fc['close']();}}function main(){var _0x52a506;return utilLicense[_0x3212('0x51')]()['then'](function(_0x44742a){if(_0x44742a){if(_0x44742a[_0x3212('0x52')]){if(_0x44742a[_0x3212('0x53')]&&_0x44742a[_0x3212('0x53')]>0x0){logger[_0x3212('0x11')](util[_0x3212('0x12')](_0x3212('0x54'),_0x44742a[_0x3212('0x53')]));_0x52a506=_0x44742a[_0x3212('0x53')];}else{logger[_0x3212('0x11')](_0x3212('0x55'));}}else{logger['info']('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x52a506=-0x1;}}})['catch'](function(_0x1f111a){logger[_0x3212('0xd')](_0x3212('0x56'),_0x1f111a[_0x3212('0xe')]);})[_0x3212('0x48')](function(){var _0x81656=require('./server')(config['agi'][_0x3212('0x10')],config[_0x3212('0x7')]['ip'],_0x52a506);_0x81656['on']('error',errorHandler);_0x81656['on']('listening',listeningHandler);_0x81656['on'](_0x3212('0x57'),connectionHandler);_0x81656['on'](_0x3212('0x4f'),closeHandler);});}main(); \ No newline at end of file +var _0x8958=['[%s]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','mxGraphModel','root','retry','maxRetry','addVertex','mxCell','hasOwnProperty','length','source','target','value','catch','then','indexOf','agi_','inspect','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','joinAt','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','start','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','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','agicommand','isUndefined','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','context','extension','Project\x20%s\x20not\x20published','continueAt','Project\x20%s\x20not\x20found','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]','connection','lodash','../../config/logger','../../config/license/util','./rpc','./mailRpc','./vertices','agi','defaults','127.0.0.1','nextTick','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','name','message'];(function(_0x3ee378,_0x7aeb2d){var _0x503bcf=function(_0x5cff41){while(--_0x5cff41){_0x3ee378['push'](_0x3ee378['shift']());}};_0x503bcf(++_0x7aeb2d);}(_0x8958,0x93));var _0x8895=function(_0x584c4b,_0x57cefc){_0x584c4b=_0x584c4b-0x0;var _0x320ecd=_0x8958[_0x584c4b];return _0x320ecd;};'use strict';var parser=require('xml2json');var _=require(_0x8895('0x0'));var syncho=require('syncho');var util=require('util');var moment=require('moment');var config=require('../../config/environment');var logger=require(_0x8895('0x1'))('agi');var utilLicense=require(_0x8895('0x2'));var rpc=require(_0x8895('0x3'));var mailRpc=require(_0x8895('0x4'));var Graph=require('./graph');var Vertices=require(_0x8895('0x5'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x8895('0x6')]=_[_0x8895('0x7')](config[_0x8895('0x6')],{'ip':_0x8895('0x8'),'port':0x11dd});function connectionHandler(_0x51376b){process[_0x8895('0x9')](function(){syncho(function(){try{setChannelVariables(_0x51376b);agiHandler(_0x51376b);}catch(_0xc2be9f){logger[_0x8895('0xa')](_0xc2be9f[_0x8895('0xb')]);}});});}function listeningHandler(){console[_0x8895('0xc')](_0x8895('0xd'),config[_0x8895('0x6')][_0x8895('0xe')]);logger[_0x8895('0xf')](util[_0x8895('0x10')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0x8895('0x6')]['ip'],config[_0x8895('0x6')][_0x8895('0xe')]));}function errorHandler(_0x301bec){if(_0x301bec&&_0x301bec[_0x8895('0x11')]&&_0x301bec[_0x8895('0x12')]){logger['error'](util[_0x8895('0x10')](_0x8895('0x13'),_0x301bec[_0x8895('0x11')],_0x301bec['message']));}else{logger['error'](util[_0x8895('0x10')]('[ERROR]\x20%s',_0x301bec[_0x8895('0xb')]));}}function closeHandler(){logger[_0x8895('0xf')](util[_0x8895('0x10')](_0x8895('0x14'),this[_0x8895('0x15')],this['calleridname'],this[_0x8895('0x16')],this[_0x8895('0x17')],this[_0x8895('0x18')]));try{createSquareReport(this);}catch(_0xcdd661){logger[_0x8895('0xa')](_0xcdd661[_0x8895('0xb')]);}}function timeoutHandler(){logger[_0x8895('0xf')](util[_0x8895('0x10')](_0x8895('0x19'),this[_0x8895('0x15')],this[_0x8895('0x1a')],this[_0x8895('0x16')],this[_0x8895('0x17')],this['uniqueid']));}function hangupHandler(){logger['info'](util['format'](_0x8895('0x1b'),this[_0x8895('0x15')],this[_0x8895('0x1a')],this[_0x8895('0x16')],this[_0x8895('0x17')],this[_0x8895('0x18')]));this[_0x8895('0x1c')]=!![];}function getRoot(_0xc1ce17){return parser['toJson'](_0xc1ce17,{'object':!![]})[_0x8895('0x1d')][_0x8895('0x1e')];}function addVertex(_0x2a403,_0x1f71f3,_0x29223d){_0x1f71f3['agicommand']=_0x29223d;if(_0x1f71f3['hasOwnProperty'](_0x8895('0x1f'))){_0x1f71f3[_0x8895('0x20')]=parseInt(_0x1f71f3[_0x8895('0x1f')],0xa);}_0x2a403[_0x8895('0x21')](_['omit'](_0x1f71f3,_0x8895('0x22')));}function initGraph(_0x1e8ac9,_0x187a15){var _0x5486a6=new Graph();for(var _0x4aee03 in _0x1e8ac9){if(_0x1e8ac9[_0x8895('0x23')](_0x4aee03)){if(_['isArray'](_0x1e8ac9[_0x4aee03])){for(var _0x3d51b0=0x0;_0x3d51b0<_0x1e8ac9[_0x4aee03][_0x8895('0x24')];_0x3d51b0+=0x1){addVertex(_0x5486a6,_0x1e8ac9[_0x4aee03][_0x3d51b0],_0x4aee03);}}else{addVertex(_0x5486a6,_0x1e8ac9[_0x4aee03],_0x4aee03);}}}for(var _0x10b48f=0x0;_0x10b48f<_0x187a15[_0x8895('0x24')];_0x10b48f+=0x1){if(_0x187a15[_0x10b48f][_0x8895('0x25')]&&_0x187a15[_0x10b48f]['target']){_0x5486a6['addEdge'](_0x187a15[_0x10b48f][_0x8895('0x25')],_0x187a15[_0x10b48f][_0x8895('0x26')],_0x187a15[_0x10b48f][_0x8895('0x27')]);}}return _0x5486a6;}function getSquareProject(_0x16b65b,_0x19b6dd){rpc['getSquareProject'](_0x16b65b)['then'](function(_0x46ae32){_0x19b6dd(null,_0x46ae32);})[_0x8895('0x28')](function(_0x1c16f6){_0x19b6dd(null,_0x1c16f6);});}function createSquareReport(_0x29f565,_0x1eabb6){rpc['createSquareReport'](_0x29f565)[_0x8895('0x29')](function(_0x5d2f33){if(_0x1eabb6){_0x1eabb6(null,_0x5d2f33);}})[_0x8895('0x28')](function(_0x5b2b19){if(_0x1eabb6){_0x1eabb6(null,_0x5b2b19);}});}function setChannelVariables(_0x40ba14){for(var _0x1a3fe5 in _0x40ba14){if(_0x40ba14[_0x8895('0x23')](_0x1a3fe5)){if(_0x1a3fe5[_0x8895('0x2a')](_0x8895('0x2b'))===0x0){_0x40ba14[_0x1a3fe5['substring'](0x4)]=_0x40ba14[_0x1a3fe5];delete _0x40ba14[_0x1a3fe5];}}}}function getLogFromObject(_0x2c54a0){return util[_0x8895('0x2c')](_0x2c54a0,{'showHidden':![],'depth':null});}function agiHandler(_0x1b5359){var _0x34cb11,_0x330692,_0x574f0e,_0x2880a6,_0x5f0a79;logger[_0x8895('0x2d')]('variables',JSON[_0x8895('0x2e')](_0x1b5359,null,0x2));logger[_0x8895('0xf')](util[_0x8895('0x10')](_0x8895('0x2f'),_0x1b5359[_0x8895('0x15')],_0x1b5359['calleridname'],_0x1b5359[_0x8895('0x16')],_0x1b5359['dnid'],_0x1b5359[_0x8895('0x18')]));_0x1b5359['on'](_0x8895('0xa'),errorHandler);_0x1b5359['on'](_0x8895('0x30'),closeHandler);_0x1b5359['on'](_0x8895('0x31'),timeoutHandler);_0x1b5359[_0x8895('0x1c')]=![];_0x1b5359['on'](_0x8895('0x32'),hangupHandler);var _0x4b7fe0=getSquareProject[_0x8895('0x33')](null,_0x1b5359[_0x8895('0x15')]);if(_0x4b7fe0){if(_0x4b7fe0['production']){_0x34cb11=getRoot(_0x4b7fe0[_0x8895('0x34')]);if(_0x34cb11&&_0x34cb11['start']){logger[_0x8895('0x2d')](_0x8895('0x1e'),JSON['stringify'](_0x34cb11,null,0x2));_0x1b5359[_0x8895('0x35')]=moment()[_0x8895('0x10')]('YYYY-MM-DD\x20HH:mm:ss');_0x330692=initGraph(_['omit'](_0x34cb11,_0x8895('0x22')),_0x34cb11[_0x8895('0x22')]);_0x574f0e=new Vertices(_0x1b5359,rpc,mailRpc);logger[_0x8895('0xf')](util[_0x8895('0x10')](_0x8895('0x36'),_0x1b5359['arg_1'],_0x1b5359[_0x8895('0x1a')],_0x1b5359[_0x8895('0x16')],_0x1b5359[_0x8895('0x17')],_0x1b5359[_0x8895('0x18')]));_0x330692[_0x8895('0x37')](_0x34cb11[_0x8895('0x38')]['id'],function(_0x4a7e22){try{_0x4a7e22=_0x574f0e[_0x8895('0x39')](_0x4a7e22);logger['debug'](_0x8895('0x3a'),JSON[_0x8895('0x2e')](_0x4a7e22,null,0x2));if(_0x4a7e22['agicommand']===_0x8895('0x3b')){logger['info'](_0x8895('0x3c'));_0x1b5359['context']=_0x4a7e22['context']||_0x1b5359['context'];_0x1b5359['extension']=_0x4a7e22['extension'];_0x1b5359['priority']=_0x4a7e22[_0x8895('0x3d')]?_0x4a7e22[_0x8895('0x3d')]-0x1:0x1;return null;}else if(_0x4a7e22&&_0x574f0e[_0x4a7e22['agicommand']]){_0x5f0a79=_0x574f0e[_0x4a7e22['agicommand']](_0x4a7e22);logger[_0x8895('0xf')](_0x8895('0x3e'),JSON['stringify'](_0x5f0a79,null,0x2));if(_0x5f0a79&&_0x5f0a79[_0x8895('0x3f')]===AGI_CODE_SUCCESS&&_0x5f0a79[_0x8895('0x40')]!==AGI_RESULT_ERROR&&!_0x1b5359[_0x8895('0x1c')]){logger[_0x8895('0x2d')](_0x8895('0x3e'),getLogFromObject(_0x5f0a79));return _['isUndefined'](_0x5f0a79['result'])?null:_0x5f0a79['result'][_0x8895('0x41')]();}else{logger['error'](_0x8895('0x3e'),getLogFromObject(_0x5f0a79));return null;}}else{logger[_0x8895('0xa')](_0x8895('0x42'));return null;}}catch(_0x28aaa9){logger['error'](_0x28aaa9[_0x8895('0xb')]);return null;}});if(_0x34cb11[_0x8895('0x43')]){logger[_0x8895('0xf')](util[_0x8895('0x10')](_0x8895('0x44'),_0x1b5359[_0x8895('0x15')],_0x1b5359[_0x8895('0x1a')],_0x1b5359[_0x8895('0x16')],_0x1b5359['dnid'],_0x1b5359[_0x8895('0x18')]));_0x330692[_0x8895('0x37')](_0x34cb11['finally']['id'],function(_0x35db2d){try{_0x35db2d=_0x574f0e['clear'](_0x35db2d);logger['debug'](_0x8895('0x3a'),JSON[_0x8895('0x2e')](_0x35db2d,null,0x2));if(_0x35db2d&&_0x574f0e[_0x35db2d[_0x8895('0x45')]]){_0x5f0a79=_0x574f0e[_0x35db2d['agicommand']](_0x35db2d);if(_0x5f0a79){logger[_0x8895('0x2d')]('response',getLogFromObject(_0x5f0a79));return _[_0x8895('0x46')](_0x5f0a79[_0x8895('0x40')])?null:_0x5f0a79[_0x8895('0x40')][_0x8895('0x41')]();}else{logger[_0x8895('0xa')](_0x8895('0x3e'),getLogFromObject(_0x5f0a79));return null;}}else{logger[_0x8895('0xa')]('agicommand\x20not\x20found');return null;}}catch(_0x47c4b9){logger[_0x8895('0xa')](_0x47c4b9[_0x8895('0xb')]);return null;}});}logger['info'](util[_0x8895('0x10')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x1b5359['arg_1'],_0x1b5359[_0x8895('0x1a')],_0x1b5359['callerid'],_0x1b5359[_0x8895('0x17')],_0x1b5359[_0x8895('0x18')]));logger[_0x8895('0xf')](util[_0x8895('0x10')](_0x8895('0x47'),_0x1b5359[_0x8895('0x48')],_0x1b5359[_0x8895('0x49')],parseInt(_0x1b5359[_0x8895('0x3d')],0xa)+0x1));_0x1b5359['continueAt'](_0x1b5359[_0x8895('0x48')],_0x1b5359[_0x8895('0x49')],parseInt(_0x1b5359[_0x8895('0x3d')],0xa)+0x1);_0x1b5359['close']();}}else{logger[_0x8895('0xa')](util[_0x8895('0x10')](_0x8895('0x4a'),_0x1b5359[_0x8895('0x15')]));_0x1b5359[_0x8895('0x4b')](_0x1b5359[_0x8895('0x48')],_0x1b5359[_0x8895('0x49')],parseInt(_0x1b5359[_0x8895('0x3d')],0xa)+0x1);_0x1b5359[_0x8895('0x30')]();}}else{logger[_0x8895('0xa')](util['format'](_0x8895('0x4c'),_0x1b5359[_0x8895('0x15')]));_0x1b5359[_0x8895('0x4b')](_0x1b5359[_0x8895('0x48')],_0x1b5359[_0x8895('0x49')],parseInt(_0x1b5359['priority'],0xa)+0x1);_0x1b5359[_0x8895('0x30')]();}}function main(){var _0x38c88f;return utilLicense[_0x8895('0x4d')]()[_0x8895('0x29')](function(_0x37a7b4){if(_0x37a7b4){if(_0x37a7b4['voice']){if(_0x37a7b4[_0x8895('0x4e')]&&_0x37a7b4[_0x8895('0x4e')]>0x0){logger[_0x8895('0xf')](util['format'](_0x8895('0x4f'),_0x37a7b4[_0x8895('0x4e')]));_0x38c88f=_0x37a7b4[_0x8895('0x4e')];}else{logger['info'](_0x8895('0x50'));}}else{logger[_0x8895('0xf')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x38c88f=-0x1;}}})[_0x8895('0x28')](function(_0x26f68c){logger['error'](_0x8895('0x51'),_0x26f68c[_0x8895('0xb')]);})[_0x8895('0x43')](function(){var _0x3caa6c=require('./server')(config['agi'][_0x8895('0xe')],config[_0x8895('0x6')]['ip'],_0x38c88f);_0x3caa6c['on'](_0x8895('0xa'),errorHandler);_0x3caa6c['on']('listening',listeningHandler);_0x3caa6c['on'](_0x8895('0x52'),connectionHandler);_0x3caa6c['on'](_0x8895('0x30'),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 a475479..d3d5d71 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 _0x9957=['result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message'];(function(_0x4530ee,_0x1949f4){var _0x2de8ff=function(_0x23f9a8){while(--_0x23f9a8){_0x4530ee['push'](_0x4530ee['shift']());}};_0x2de8ff(++_0x1949f4);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var BPromise=require(_0x7995('0x0'));var jayson=require(_0x7995('0x1'));var client=jayson[_0x7995('0x2')][_0x7995('0x3')]({'port':0x232b});function request(_0x5b96eb,_0x86c128){return new BPromise(function(_0x3c58eb,_0x1902b4){return client[_0x7995('0x4')](_0x5b96eb,_0x86c128)['then'](function(_0x744bea){if(_0x744bea[_0x7995('0x5')]){return _0x1902b4(_0x744bea[_0x7995('0x5')][_0x7995('0x6')]);}else{return _0x3c58eb(_0x744bea[_0x7995('0x7')]);}})[_0x7995('0x8')](function(_0x4996ca){return _0x1902b4(_0x4996ca);});});}exports[_0x7995('0x9')]=function(_0x1cad37,_0x4a64f7){return request(_0x7995('0xa'),{'account':_0x1cad37,'message':_0x4a64f7});}; \ No newline at end of file +var _0x34e8=['catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','then','error','message'];(function(_0x4c19d7,_0x219aac){var _0x6b122e=function(_0x30332b){while(--_0x30332b){_0x4c19d7['push'](_0x4c19d7['shift']());}};_0x6b122e(++_0x219aac);}(_0x34e8,0x12c));var _0x834e=function(_0x472843,_0x55df0a){_0x472843=_0x472843-0x0;var _0x1609b9=_0x34e8[_0x472843];return _0x1609b9;};'use strict';var BPromise=require(_0x834e('0x0'));var jayson=require(_0x834e('0x1'));var client=jayson[_0x834e('0x2')][_0x834e('0x3')]({'port':0x232b});function request(_0x530939,_0x832422){return new BPromise(function(_0x21e2e0,_0x472111){return client[_0x834e('0x4')](_0x530939,_0x832422)[_0x834e('0x5')](function(_0x19a3e0){if(_0x19a3e0[_0x834e('0x6')]){return _0x472111(_0x19a3e0['error'][_0x834e('0x7')]);}else{return _0x21e2e0(_0x19a3e0['result']);}})[_0x834e('0x8')](function(_0x3cc2e3){return _0x472111(_0x3cc2e3);});});}exports[_0x834e('0x9')]=function(_0x2e69e2,_0x33ea05){return request(_0x834e('0xa'),{'account':_0x2e69e2,'message':_0x33ea05});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 65662df..f96018e 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 _0x5f2f=['exports','util','stream','Transform','call','_localBuffer','_inBody','inherits','\x0d\x0a\x0d\x0a','toString','substring','length','split','slice','trim','headers','indexOf','emit','line'];(function(_0x21e0cc,_0x2094c4){var _0x3a29a9=function(_0x1a02ce){while(--_0x1a02ce){_0x21e0cc['push'](_0x21e0cc['shift']());}};_0x3a29a9(++_0x2094c4);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1bdc27,_0x2c318a){_0x1bdc27=_0x1bdc27-0x0;var _0x914a74=_0x5f2f[_0x1bdc27];return _0x914a74;};'use strict';var util=require(_0xf5f2('0x0'));var Transform=require(_0xf5f2('0x1'))[_0xf5f2('0x2')];function AGIReply(_0x1a7be1){Transform[_0xf5f2('0x3')](this,_0x1a7be1);this[_0xf5f2('0x4')]='';this[_0xf5f2('0x5')]=![];}util[_0xf5f2('0x6')](AGIReply,Transform);AGIReply['prototype']['_transform']=function(_0x1665c7,_0x192215,_0xad7f65){var _0x3eebf6='\x0a',_0x3133bc=['\x0a\x0a',_0xf5f2('0x7')],_0x473100=-0x1,_0x5907aa=-0x1,_0x466882='',_0x46cd9c=0x0,_0x2ec345='',_0x56a69f='';this[_0xf5f2('0x4')]+=_0x1665c7[_0xf5f2('0x8')]();_0x2ec345=this['_localBuffer'];if(!this[_0xf5f2('0x5')]){_0x46cd9c=0x0;while(_0x3133bc[_0x46cd9c]){while((_0x5907aa=_0x2ec345['indexOf'](_0x3133bc[_0x46cd9c]))!=-0x1){_0x466882=_0x3133bc[_0x46cd9c];_0x56a69f=_0x2ec345['substring'](0x0,_0x5907aa);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x5907aa+_0x466882[_0xf5f2('0xa')]);var _0x4b78cd=_0x56a69f[_0xf5f2('0xb')](_0x3eebf6),_0x336f6b=0x0,_0x14b51f={},_0x331482='',_0x3f2997='',_0x59bb6c=-0x1;while(_0x4b78cd[_0x336f6b]){_0x59bb6c=_0x4b78cd[_0x336f6b]['indexOf'](':');if(_0x59bb6c!=-0x1){_0x331482=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](0x0,_0x59bb6c)[_0xf5f2('0xd')]();_0x3f2997=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](_0x59bb6c+0x1)[_0xf5f2('0xd')]();if(_0x331482[_0xf5f2('0xa')]>0x0){_0x14b51f[_0x331482]=_0x3f2997;}}else{}_0x336f6b++;}this['emit'](_0xf5f2('0xe'),_0x14b51f);this[_0xf5f2('0x5')]=!![];}_0x46cd9c++;}this[_0xf5f2('0x4')]=_0x2ec345;}else{while((_0x473100=_0x2ec345[_0xf5f2('0xf')](_0x3eebf6))!=-0x1){_0x56a69f=_0x2ec345[_0xf5f2('0x9')](0x0,_0x473100);this[_0xf5f2('0x10')](_0xf5f2('0x11'),_0x56a69f);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x473100+_0x3eebf6[_0xf5f2('0xa')]);}this[_0xf5f2('0x4')]=_0x2ec345;}_0xad7f65();};module[_0xf5f2('0x12')]=AGIReply; \ No newline at end of file +var _0x5f2f=['exports','util','stream','Transform','call','_localBuffer','_inBody','inherits','\x0d\x0a\x0d\x0a','toString','substring','length','split','slice','trim','headers','indexOf','emit','line'];(function(_0x1e9738,_0x249de6){var _0x4e967a=function(_0x12f4cb){while(--_0x12f4cb){_0x1e9738['push'](_0x1e9738['shift']());}};_0x4e967a(++_0x249de6);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3ba857,_0x44b549){_0x3ba857=_0x3ba857-0x0;var _0x466c57=_0x5f2f[_0x3ba857];return _0x466c57;};'use strict';var util=require(_0xf5f2('0x0'));var Transform=require(_0xf5f2('0x1'))[_0xf5f2('0x2')];function AGIReply(_0x1a7be1){Transform[_0xf5f2('0x3')](this,_0x1a7be1);this[_0xf5f2('0x4')]='';this[_0xf5f2('0x5')]=![];}util[_0xf5f2('0x6')](AGIReply,Transform);AGIReply['prototype']['_transform']=function(_0x1665c7,_0x192215,_0xad7f65){var _0x3eebf6='\x0a',_0x3133bc=['\x0a\x0a',_0xf5f2('0x7')],_0x473100=-0x1,_0x5907aa=-0x1,_0x466882='',_0x46cd9c=0x0,_0x2ec345='',_0x56a69f='';this[_0xf5f2('0x4')]+=_0x1665c7[_0xf5f2('0x8')]();_0x2ec345=this['_localBuffer'];if(!this[_0xf5f2('0x5')]){_0x46cd9c=0x0;while(_0x3133bc[_0x46cd9c]){while((_0x5907aa=_0x2ec345['indexOf'](_0x3133bc[_0x46cd9c]))!=-0x1){_0x466882=_0x3133bc[_0x46cd9c];_0x56a69f=_0x2ec345['substring'](0x0,_0x5907aa);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x5907aa+_0x466882[_0xf5f2('0xa')]);var _0x4b78cd=_0x56a69f[_0xf5f2('0xb')](_0x3eebf6),_0x336f6b=0x0,_0x14b51f={},_0x331482='',_0x3f2997='',_0x59bb6c=-0x1;while(_0x4b78cd[_0x336f6b]){_0x59bb6c=_0x4b78cd[_0x336f6b]['indexOf'](':');if(_0x59bb6c!=-0x1){_0x331482=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](0x0,_0x59bb6c)[_0xf5f2('0xd')]();_0x3f2997=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](_0x59bb6c+0x1)[_0xf5f2('0xd')]();if(_0x331482[_0xf5f2('0xa')]>0x0){_0x14b51f[_0x331482]=_0x3f2997;}}else{}_0x336f6b++;}this['emit'](_0xf5f2('0xe'),_0x14b51f);this[_0xf5f2('0x5')]=!![];}_0x46cd9c++;}this[_0xf5f2('0x4')]=_0x2ec345;}else{while((_0x473100=_0x2ec345[_0xf5f2('0xf')](_0x3eebf6))!=-0x1){_0x56a69f=_0x2ec345[_0xf5f2('0x9')](0x0,_0x473100);this[_0xf5f2('0x10')](_0xf5f2('0x11'),_0x56a69f);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x473100+_0x3eebf6[_0xf5f2('0xa')]);}this[_0xf5f2('0x4')]=_0x2ec345;}_0xad7f65();};module[_0xf5f2('0x12')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index ca218c0..e772bd6 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 _0x8a9d=['util','jayson/promise','http','request','error','catch','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','name','email','getSquareProjectById','getVoiceQueueById','ShowVariable','ShowSquareOdbc','getUserById','ShowUser','ShowTrunk','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','phone','ListId','then','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','bluebird','moment'];(function(_0x6a837b,_0x23dc5a){var _0x502a3e=function(_0x4a4e83){while(--_0x4a4e83){_0x6a837b['push'](_0x6a837b['shift']());}};_0x502a3e(++_0x23dc5a);}(_0x8a9d,0x1ed));var _0xd8a9=function(_0xf72786,_0x1a0ddd){_0xf72786=_0xf72786-0x0;var _0x113f3e=_0x8a9d[_0xf72786];return _0x113f3e;};'use strict';var BPromise=require(_0xd8a9('0x0'));var moment=require(_0xd8a9('0x1'));var _=require('lodash');var util=require(_0xd8a9('0x2'));var jayson=require(_0xd8a9('0x3'));var client=jayson['client'][_0xd8a9('0x4')]({'port':0x2329});function request(_0x4c3805,_0x5ee117){return new BPromise(function(_0x1b6f39,_0x2982fe){return client[_0xd8a9('0x5')](_0x4c3805,_0x5ee117)['then'](function(_0x2645b2){if(_0x2645b2[_0xd8a9('0x6')]){return _0x2982fe(_0x2645b2[_0xd8a9('0x6')]['message']);}else{return _0x1b6f39(_0x2645b2['result']);}})[_0xd8a9('0x7')](function(_0x2be37e){return _0x2982fe(_0x2be37e);});});}exports['getSquareProject']=function(_0x3a851f){return request(_0xd8a9('0x8'),{'options':{'raw':![],'where':{'name':_0x3a851f},'attributes':[_0xd8a9('0x9')]}});};exports[_0xd8a9('0xa')]=function(_0x20eccc){return request(_0xd8a9('0xb'),{'options':{'raw':![],'where':{'id':_0x20eccc},'include':[{'model':_0xd8a9('0xc'),'as':_0xd8a9('0xd')}],'attributes':['id',_0xd8a9('0xe'),_0xd8a9('0xf')]}});};exports[_0xd8a9('0x10')]=function(_0x2e6787){return request(_0xd8a9('0x8'),{'options':{'where':{'id':_0x2e6787},'attributes':[_0xd8a9('0xe')]}});};exports[_0xd8a9('0x11')]=function(_0x46998e){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x46998e},'attributes':[_0xd8a9('0xe')]}});};exports['getVariableById']=function(_0x46cf9d){return request(_0xd8a9('0x12'),{'options':{'where':{'id':_0x46cf9d},'attributes':[_0xd8a9('0xe')]}});};exports['getSquareOdbcById']=function(_0x4eaa0c){return request(_0xd8a9('0x13'),{'options':{'where':{'id':_0x4eaa0c},'attributes':['dsn']}});};exports[_0xd8a9('0x14')]=function(_0x379eb0){return request(_0xd8a9('0x15'),{'options':{'where':{'id':_0x379eb0},'attributes':[_0xd8a9('0xe')]}});};exports['getTrunkById']=function(_0x34ce6a){return request(_0xd8a9('0x16'),{'options':{'where':{'id':_0x34ce6a},'attributes':[_0xd8a9('0xe')]}});};exports['getSoundById']=function(_0x354c43){return request(_0xd8a9('0x17'),{'options':{'where':{'id':_0x354c43},'attributes':[_0xd8a9('0x18')]}});};exports[_0xd8a9('0x19')]=function(_0x3c597b){return request(_0xd8a9('0x1a'),{'options':{'raw':![],'where':{'id':_0x3c597b},'include':[{'model':_0xd8a9('0x1b'),'as':_0xd8a9('0x1c')}]}});};exports[_0xd8a9('0x1d')]=function(_0x228f65){return request('ShowSmsAccount',{'options':{'where':{'id':_0x228f65},'attributes':['id',_0xd8a9('0xe')]}});};exports[_0xd8a9('0x1e')]=function(_0x17af6d){return request(_0xd8a9('0x1f'),{'body':_0x17af6d});};exports[_0xd8a9('0x20')]=function(_0x4eba54){return request(_0xd8a9('0x21'),{'body':_0x4eba54});};exports[_0xd8a9('0x22')]=function(_0xedcee3){return request(_0xd8a9('0x23'),{'body':_['merge'](_0xedcee3,{'project_name':_0xedcee3['arg_1'],'prev_project_name':_0xedcee3['arg_2']||'','is_subproject':_0xedcee3['arg_2']?!![]:![],'leaveAt':moment()[_0xd8a9('0x24')](_0xd8a9('0x25'))})});};exports[_0xd8a9('0x26')]=function(_0x1e62ef){return request(_0xd8a9('0x27'),{'body':_0x1e62ef});};exports[_0xd8a9('0x28')]=function(_0xf7237){return request(_0xd8a9('0x29'),{'body':_0xf7237});};exports[_0xd8a9('0x2a')]=function(_0x598457){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x598457[_0xd8a9('0x2b')],'ListId':_0x598457[_0xd8a9('0x2c')]}}})[_0xd8a9('0x2d')](function(_0x53d003){if(_0x53d003){return _0x53d003;}return request(_0xd8a9('0x2e'),{'body':_0x598457});});};exports[_0xd8a9('0x2f')]=function(_0x3b542c){return request(_0xd8a9('0x30'),{'options':{'where':{'id':_0x3b542c},'attributes':[_0xd8a9('0xe')]}});};exports[_0xd8a9('0x31')]=function(_0x52ea4d,_0x78fe4a){return request(_0xd8a9('0x32'),{'body':{'interface':_0x78fe4a},'options':{'where':_0x52ea4d}});};exports[_0xd8a9('0x33')]=function(_0x34dab0,_0x27be5e,_0xd55c36){return request(_0xd8a9('0x34'),{'body':{'type':_0x27be5e,'uniqueid':_0xd55c36},'options':{'where':_0x34dab0}});};exports[_0xd8a9('0x35')]=function(_0x1b9bab){return request(_0xd8a9('0x36'),{'body':{},'options':{'where':_0x1b9bab}});};exports['agentLogout']=function(_0x3417db){return request('LogoutUser',{'body':{},'options':{'where':_0x3417db}});}; \ No newline at end of file +var _0x3c67=['name','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','Intervals','getSmsAccountById','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','createSquareReport','merge','arg_1','arg_2','format','CreateSquareRecording','CreateSquareMessage','createCmContact','ShowCmHopper','phone','ListId','CreateCmContact','ShowPause','agentLogin','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','moment','lodash','util','jayson/promise','client','http','then','error','result','catch','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','getVoiceQueueById','ShowVoiceQueue'];(function(_0x11d282,_0x1dad54){var _0x15d397=function(_0x5624ee){while(--_0x5624ee){_0x11d282['push'](_0x11d282['shift']());}};_0x15d397(++_0x1dad54);}(_0x3c67,0x131));var _0x73c6=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x3c67[_0x4ff09b];return _0x3f5c2e;};'use strict';var BPromise=require('bluebird');var moment=require(_0x73c6('0x0'));var _=require(_0x73c6('0x1'));var util=require(_0x73c6('0x2'));var jayson=require(_0x73c6('0x3'));var client=jayson[_0x73c6('0x4')][_0x73c6('0x5')]({'port':0x2329});function request(_0x2e14a6,_0x3fc0f5){return new BPromise(function(_0x2dd20d,_0x31c6b2){return client['request'](_0x2e14a6,_0x3fc0f5)[_0x73c6('0x6')](function(_0x401f19){if(_0x401f19[_0x73c6('0x7')]){return _0x31c6b2(_0x401f19['error']['message']);}else{return _0x2dd20d(_0x401f19[_0x73c6('0x8')]);}})[_0x73c6('0x9')](function(_0x574f6b){return _0x31c6b2(_0x574f6b);});});}exports[_0x73c6('0xa')]=function(_0x363d3a){return request(_0x73c6('0xb'),{'options':{'raw':![],'where':{'name':_0x363d3a},'attributes':[_0x73c6('0xc')]}});};exports[_0x73c6('0xd')]=function(_0x5526af){return request(_0x73c6('0xe'),{'options':{'raw':![],'where':{'id':_0x5526af},'include':[{'model':_0x73c6('0xf'),'as':_0x73c6('0x10')}],'attributes':['id','name','email']}});};exports['getSquareProjectById']=function(_0x2b28c5){return request(_0x73c6('0xb'),{'options':{'where':{'id':_0x2b28c5},'attributes':['name']}});};exports[_0x73c6('0x11')]=function(_0x17d035){return request(_0x73c6('0x12'),{'options':{'where':{'id':_0x17d035},'attributes':[_0x73c6('0x13')]}});};exports[_0x73c6('0x14')]=function(_0xc97c10){return request(_0x73c6('0x15'),{'options':{'where':{'id':_0xc97c10},'attributes':[_0x73c6('0x13')]}});};exports[_0x73c6('0x16')]=function(_0x58935e){return request(_0x73c6('0x17'),{'options':{'where':{'id':_0x58935e},'attributes':['dsn']}});};exports['getUserById']=function(_0x10aae7){return request('ShowUser',{'options':{'where':{'id':_0x10aae7},'attributes':['name']}});};exports[_0x73c6('0x18')]=function(_0x6e466e){return request(_0x73c6('0x19'),{'options':{'where':{'id':_0x6e466e},'attributes':['name']}});};exports[_0x73c6('0x1a')]=function(_0x4b7eb4){return request(_0x73c6('0x1b'),{'options':{'where':{'id':_0x4b7eb4},'attributes':[_0x73c6('0x1c')]}});};exports['getIntervalById']=function(_0x1c2a4f){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x1c2a4f},'include':[{'model':'Interval','as':_0x73c6('0x1d')}]}});};exports[_0x73c6('0x1e')]=function(_0xcf4c33){return request('ShowSmsAccount',{'options':{'where':{'id':_0xcf4c33},'attributes':['id',_0x73c6('0x13')]}});};exports[_0x73c6('0x1f')]=function(_0x4d0d31){return request(_0x73c6('0x20'),{'body':_0x4d0d31});};exports[_0x73c6('0x21')]=function(_0x1ced9a){return request('CreateSquareDetailsReport',{'body':_0x1ced9a});};exports[_0x73c6('0x22')]=function(_0x55da6f){return request('CreateSquareReport',{'body':_[_0x73c6('0x23')](_0x55da6f,{'project_name':_0x55da6f[_0x73c6('0x24')],'prev_project_name':_0x55da6f[_0x73c6('0x25')]||'','is_subproject':_0x55da6f[_0x73c6('0x25')]?!![]:![],'leaveAt':moment()[_0x73c6('0x26')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports['createSquareRecording']=function(_0x2cf0ca){return request(_0x73c6('0x27'),{'body':_0x2cf0ca});};exports['createSquareMessage']=function(_0x16dd23){return request(_0x73c6('0x28'),{'body':_0x16dd23});};exports[_0x73c6('0x29')]=function(_0x5d5fd8){return request(_0x73c6('0x2a'),{'options':{'raw':![],'where':{'phone':_0x5d5fd8[_0x73c6('0x2b')],'ListId':_0x5d5fd8[_0x73c6('0x2c')]}}})[_0x73c6('0x6')](function(_0x4b3a41){if(_0x4b3a41){return _0x4b3a41;}return request(_0x73c6('0x2d'),{'body':_0x5d5fd8});});};exports['getPauseById']=function(_0x48c215){return request(_0x73c6('0x2e'),{'options':{'where':{'id':_0x48c215},'attributes':[_0x73c6('0x13')]}});};exports[_0x73c6('0x2f')]=function(_0x27bf35,_0x169cf8){return request('LoginUser',{'body':{'interface':_0x169cf8},'options':{'where':_0x27bf35}});};exports[_0x73c6('0x30')]=function(_0x38b6dd,_0x46c02d,_0x4762e6){return request(_0x73c6('0x31'),{'body':{'type':_0x46c02d,'uniqueid':_0x4762e6},'options':{'where':_0x38b6dd}});};exports[_0x73c6('0x32')]=function(_0x4d1c01){return request(_0x73c6('0x33'),{'body':{},'options':{'where':_0x4d1c01}});};exports[_0x73c6('0x34')]=function(_0x29d31e){return request(_0x73c6('0x35'),{'body':{},'options':{'where':_0x29d31e}});}; \ 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 857b3f8..a40834a 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 _0xbb53=['exports','./polly','./lex'];(function(_0x7be489,_0x163f78){var _0x13db2b=function(_0x3c92bb){while(--_0x3c92bb){_0x7be489['push'](_0x7be489['shift']());}};_0x13db2b(++_0x163f78);}(_0xbb53,0x121));var _0x3bb5=function(_0x30cfa3,_0x12044d){_0x30cfa3=_0x30cfa3-0x0;var _0x344cff=_0xbb53[_0x30cfa3];return _0x344cff;};var polly=require(_0x3bb5('0x0'));var lex=require(_0x3bb5('0x1'));module[_0x3bb5('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xac31=['exports','./polly','./lex'];(function(_0x2c43f8,_0x261d10){var _0x3c0c0f=function(_0x15f093){while(--_0x15f093){_0x2c43f8['push'](_0x2c43f8['shift']());}};_0x3c0c0f(++_0x261d10);}(_0xac31,0xca));var _0x1ac3=function(_0x441274,_0x554017){_0x441274=_0x441274-0x0;var _0x469a5=_0xac31[_0x441274];return _0x469a5;};var polly=require(_0x1ac3('0x0'));var lex=require(_0x1ac3('0x1'));module[_0x1ac3('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 70ac801..bbf1112 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 _0x544a=['exports','./lib/api'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x544a,0xbd));var _0xa544=function(_0x2b9651,_0x29209b){_0x2b9651=_0x2b9651-0x0;var _0x2e6471=_0x544a[_0x2b9651];return _0x2e6471;};'use strict';var lex=require(_0xa544('0x0'));module[_0xa544('0x1')]=function(_0x311c86,_0x5d759f,_0x544b38,_0x46d7b6,_0x5026f6,_0x42b8f1){return lex(_0x311c86,_0x5d759f,_0x544b38,_0x46d7b6,_0x5026f6,_0x42b8f1);}; \ No newline at end of file +var _0x579c=['./lib/api','exports'];(function(_0x17714d,_0x74d207){var _0x3b1bfa=function(_0x2d94ed){while(--_0x2d94ed){_0x17714d['push'](_0x17714d['shift']());}};_0x3b1bfa(++_0x74d207);}(_0x579c,0xda));var _0xc579=function(_0x28de6e,_0x4a5c62){_0x28de6e=_0x28de6e-0x0;var _0x35720c=_0x579c[_0x28de6e];return _0x35720c;};'use strict';var lex=require(_0xc579('0x0'));module[_0xc579('0x1')]=function(_0x2757c6,_0x1db849,_0x397136,_0x586948,_0x1e2808,_0x5399d7){return lex(_0x2757c6,_0x1db849,_0x397136,_0x586948,_0x1e2808,_0x5399d7);}; \ 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 364e94f..e86a8b8 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 _0x06d3=['slots','slot_','exports','LexRuntime','$LATEST','bluebird','aws-sdk'];(function(_0x360ea3,_0x3a092a){var _0x13c62b=function(_0x11386e){while(--_0x11386e){_0x360ea3['push'](_0x360ea3['shift']());}};_0x13c62b(++_0x3a092a);}(_0x06d3,0x17f));var _0x306d=function(_0x4086ea,_0x22e1be){_0x4086ea=_0x4086ea-0x0;var _0x373253=_0x06d3[_0x4086ea];return _0x373253;};'use strict';var BPromise=require(_0x306d('0x0'));var AWS=require(_0x306d('0x1'));function lexResult(_0x47f200,_0x43b8d5){return new BPromise(function(_0x13e490,_0x24f04d){_0x47f200['postText'](_0x43b8d5,function(_0xfb094a,_0x273c8f){if(_0xfb094a){_0x24f04d(_0xfb094a);}if(_0x273c8f[_0x306d('0x2')]){for(const _0x14c38e in _0x273c8f[_0x306d('0x2')]){if(_0x273c8f['slots']['hasOwnProperty'](_0x14c38e)){var _0x353f2d=_0x273c8f[_0x306d('0x2')][_0x14c38e];_0x273c8f[_0x306d('0x3')+_0x14c38e]=_0x353f2d;}}}_0x13e490(_0x273c8f);});});}module[_0x306d('0x4')]=function(_0x2dff2f,_0x2e6995,_0x3131cf,_0x4a0b7c,_0x1dc46c,_0x15ffb1){var _0x4f6727=new AWS[(_0x306d('0x5'))]({'accessKeyId':_0x2e6995,'secretAccessKey':_0x3131cf,'region':_0x4a0b7c});var _0x573772={'botAlias':_0x306d('0x6'),'botName':_0x15ffb1,'inputText':_0x1dc46c,'userId':_0x2dff2f};return lexResult(_0x4f6727,_0x573772);}; \ No newline at end of file +var _0x7b93=['slots','exports','LexRuntime','$LATEST','bluebird','aws-sdk','postText'];(function(_0x26e46c,_0x25c0a6){var _0x510c98=function(_0xf492fc){while(--_0xf492fc){_0x26e46c['push'](_0x26e46c['shift']());}};_0x510c98(++_0x25c0a6);}(_0x7b93,0xba));var _0x37b9=function(_0x55186e,_0xd9123e){_0x55186e=_0x55186e-0x0;var _0x32e59f=_0x7b93[_0x55186e];return _0x32e59f;};'use strict';var BPromise=require(_0x37b9('0x0'));var AWS=require(_0x37b9('0x1'));function lexResult(_0xc030e9,_0x4eb205){return new BPromise(function(_0x368aac,_0x13bece){_0xc030e9[_0x37b9('0x2')](_0x4eb205,function(_0x1413ed,_0x392fa6){if(_0x1413ed){_0x13bece(_0x1413ed);}if(_0x392fa6[_0x37b9('0x3')]){for(const _0x3bf749 in _0x392fa6[_0x37b9('0x3')]){if(_0x392fa6[_0x37b9('0x3')]['hasOwnProperty'](_0x3bf749)){var _0x359d92=_0x392fa6['slots'][_0x3bf749];_0x392fa6['slot_'+_0x3bf749]=_0x359d92;}}}_0x368aac(_0x392fa6);});});}module[_0x37b9('0x4')]=function(_0x2be6f1,_0x32bc79,_0x165796,_0x5f4480,_0x5ac08e,_0x2f8d42){var _0x4cc114=new AWS[(_0x37b9('0x5'))]({'accessKeyId':_0x32bc79,'secretAccessKey':_0x165796,'region':_0x5f4480});var _0x207eb9={'botAlias':_0x37b9('0x6'),'botName':_0x2f8d42,'inputText':_0x5ac08e,'userId':_0x2be6f1};return lexResult(_0x4cc114,_0x207eb9);}; \ 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 2e98697..0b95003 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 _0x2662=['./lib/api'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x2662,0x96));var _0x2266=function(_0x9e1c51,_0x313d03){_0x9e1c51=_0x9e1c51-0x0;var _0x4231c7=_0x2662[_0x9e1c51];return _0x4231c7;};'use strict';var polly=require(_0x2266('0x0'));module['exports']=function(_0x1ea33c,_0x578df6,_0x4ac2ec,_0x2a314a,_0x5aac58,_0x4c76da,_0x54f502){return polly(_0x1ea33c,_0x578df6,_0x4ac2ec,_0x2a314a,_0x5aac58,_0x4c76da,_0x54f502);}; \ No newline at end of file +var _0xbfdf=['exports','./lib/api'];(function(_0x2cf437,_0x5b0508){var _0x2f1fd2=function(_0x30f000){while(--_0x30f000){_0x2cf437['push'](_0x2cf437['shift']());}};_0x2f1fd2(++_0x5b0508);}(_0xbfdf,0xcf));var _0xfbfd=function(_0x3c5788,_0xa42ed4){_0x3c5788=_0x3c5788-0x0;var _0x58c36a=_0xbfdf[_0x3c5788];return _0x58c36a;};'use strict';var polly=require(_0xfbfd('0x0'));module[_0xfbfd('0x1')]=function(_0x35526f,_0x1a4fb0,_0x57862d,_0x389dd3,_0x5371a2,_0x3f76e7,_0x542ee3){return polly(_0x35526f,_0x1a4fb0,_0x57862d,_0x389dd3,_0x5371a2,_0x3f76e7,_0x542ee3);}; \ 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 4e8875b..36df7dd 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 _0x33b1=['No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile'];(function(_0x13f77b,_0xd2350d){var _0x9e1bbe=function(_0x53bbb9){while(--_0x53bbb9){_0x13f77b['push'](_0x13f77b['shift']());}};_0x9e1bbe(++_0xd2350d);}(_0x33b1,0x1a9));var _0x133b=function(_0x179aa7,_0x938f63){_0x179aa7=_0x179aa7-0x0;var _0x10e47e=_0x33b1[_0x179aa7];return _0x10e47e;};'use strict';var fs=require('fs');var path=require(_0x133b('0x0'));var BPromise=require(_0x133b('0x1'));var rs=require(_0x133b('0x2'));var AWS=require(_0x133b('0x3'));function pollyResult(_0x184891,_0x4369e9,_0x1db400){return new BPromise(function(_0x5a82ff,_0x294ac1){_0x184891[_0x133b('0x4')](_0x4369e9,function(_0x1e79f9,_0x1cafd6){if(_0x1e79f9){_0x294ac1(_0x1e79f9);}else if(_0x1cafd6){if(_0x1cafd6[_0x133b('0x5')]instanceof Buffer){fs[_0x133b('0x6')](_0x1db400,_0x1cafd6[_0x133b('0x5')],function(_0x2e3ce3){if(_0x2e3ce3){_0x294ac1(_0x2e3ce3);}else{_0x5a82ff();}});}else{_0x294ac1(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x294ac1(new Error(_0x133b('0x7')));}});});}module[_0x133b('0x8')]=function(_0x4a9508,_0x272ac8,_0x1cd081,_0xedd2b5,_0x28e3a2,_0x2ca4eb,_0x22dbe3){var _0xffe322=new AWS[(_0x133b('0x9'))]({'accessKeyId':_0x4a9508,'secretAccessKey':_0x272ac8,'region':_0x1cd081});var _0x26dfc0={'Text':_0x28e3a2,'TextType':_0x2ca4eb||_0x133b('0xa'),'OutputFormat':_0x133b('0xb'),'VoiceId':_0xedd2b5};return pollyResult(_0xffe322,_0x26dfc0,_0x22dbe3);}; \ No newline at end of file +var _0xa733=['synthesizeSpeech','writeFile','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','aws-sdk'];(function(_0x318750,_0x356faf){var _0x1dbb54=function(_0x19d27f){while(--_0x19d27f){_0x318750['push'](_0x318750['shift']());}};_0x1dbb54(++_0x356faf);}(_0xa733,0x127));var _0x3a73=function(_0x1f2688,_0x8d42fc){_0x1f2688=_0x1f2688-0x0;var _0xc5f6f5=_0xa733[_0x1f2688];return _0xc5f6f5;};'use strict';var fs=require('fs');var path=require(_0x3a73('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var AWS=require(_0x3a73('0x1'));function pollyResult(_0x2d9c37,_0x7b0b28,_0x14c096){return new BPromise(function(_0x5306b0,_0x16c38f){_0x2d9c37[_0x3a73('0x2')](_0x7b0b28,function(_0x21521d,_0x5d3178){if(_0x21521d){_0x16c38f(_0x21521d);}else if(_0x5d3178){if(_0x5d3178['AudioStream']instanceof Buffer){fs[_0x3a73('0x3')](_0x14c096,_0x5d3178[_0x3a73('0x4')],function(_0x785440){if(_0x785440){_0x16c38f(_0x785440);}else{_0x5306b0();}});}else{_0x16c38f(new Error(_0x3a73('0x5')));}}else{_0x16c38f(new Error(_0x3a73('0x6')));}});});}module[_0x3a73('0x7')]=function(_0x718b56,_0x1e405d,_0x118823,_0x3cabd9,_0x521c84,_0x2cf416,_0x1cbcc2){var _0x5b3eb4=new AWS[(_0x3a73('0x8'))]({'accessKeyId':_0x718b56,'secretAccessKey':_0x1e405d,'region':_0x118823});var _0x84e880={'Text':_0x521c84,'TextType':_0x2cf416||_0x3a73('0x9'),'OutputFormat':_0x3a73('0xa'),'VoiceId':_0x3cabd9};return pollyResult(_0x5b3eb4,_0x84e880,_0x1cbcc2);}; \ 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 79a26bb..ce08fbf 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. * // * * // ************************************************************************* -'use strict';var asr=require('./lib/api');module['exports']=function(_0x5f95f6,_0x25d6d5,_0x2fed00,_0xde5bbd){return asr(_0x5f95f6,_0x25d6d5,_0x2fed00);}; \ No newline at end of file +var _0xaf73=['exports'];(function(_0x503ffd,_0x8ecde){var _0x160437=function(_0x2d45dd){while(--_0x2d45dd){_0x503ffd['push'](_0x503ffd['shift']());}};_0x160437(++_0x8ecde);}(_0xaf73,0xb3));var _0x3af7=function(_0xa9ab54,_0xb77788){_0xa9ab54=_0xa9ab54-0x0;var _0x481e46=_0xaf73[_0xa9ab54];return _0x481e46;};'use strict';var asr=require('./lib/api');module[_0x3af7('0x0')]=function(_0x12342c,_0x2c59c6,_0x487457,_0x1e9c26){return asr(_0x12342c,_0x2c59c6,_0x487457);}; \ 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 1833f16..3e9227c 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 _0x2a81=['length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','toString','base64','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','string'];(function(_0x4152fa,_0x6dc7a3){var _0x3c3779=function(_0x13f093){while(--_0x13f093){_0x4152fa['push'](_0x4152fa['shift']());}};_0x3c3779(++_0x6dc7a3);}(_0x2a81,0xa4));var _0x12a8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2a81[_0x3dd15e];return _0x231fd0;};'use strict';var url=require(_0x12a8('0x0'));var BPromise=require(_0x12a8('0x1'));var fs=require('fs');var host=_0x12a8('0x2');module['exports']=function(_0x3ba59a,_0x284a91,_0x56ba8e){return new BPromise(function(_0x29ec1b,_0x24165f){var _0x30eea7;if(typeof _0x3ba59a!==_0x12a8('0x3')||_0x3ba59a[_0x12a8('0x4')]===0x0){return _0x24165f(_0x12a8('0x5'));}if(typeof _0x284a91!==_0x12a8('0x3')||_0x284a91[_0x12a8('0x4')]===0x0){return _0x24165f(_0x12a8('0x6'));}if(typeof _0x56ba8e!==_0x12a8('0x7')&&(typeof _0x56ba8e!==_0x12a8('0x3')||_0x56ba8e[_0x12a8('0x4')]===0x0)){return _0x24165f(_0x12a8('0x8'));}try{_0x30eea7=fs['readFileSync'](_0x3ba59a)[_0x12a8('0x9')](_0x12a8('0xa'));}catch(_0x4f9fb6){return _0x24165f(_0x4f9fb6);}return _0x29ec1b({'method':'POST','uri':host+_0x12a8('0xb')+_0x284a91,'body':{'config':{'encoding':_0x12a8('0xc'),'sampleRateHertz':_0x12a8('0xd'),'languageCode':_0x56ba8e},'audio':{'content':_0x30eea7}},'json':!![]});});}; \ No newline at end of file +var _0xda9b=['bluebird','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','toString','base64','/v1/speech:recognize?key=','LINEAR16','url'];(function(_0x2ff86e,_0x1d543e){var _0x471b38=function(_0x5f5b36){while(--_0x5f5b36){_0x2ff86e['push'](_0x2ff86e['shift']());}};_0x471b38(++_0x1d543e);}(_0xda9b,0x6f));var _0xbda9=function(_0x5e2c06,_0x3b89f2){_0x5e2c06=_0x5e2c06-0x0;var _0x28f456=_0xda9b[_0x5e2c06];return _0x28f456;};'use strict';var url=require(_0xbda9('0x0'));var BPromise=require(_0xbda9('0x1'));var fs=require('fs');var host=_0xbda9('0x2');module[_0xbda9('0x3')]=function(_0x3f78dd,_0x2c7202,_0x8d777b){return new BPromise(function(_0x1a652c,_0x4c19f3){var _0x35502f;if(typeof _0x3f78dd!==_0xbda9('0x4')||_0x3f78dd[_0xbda9('0x5')]===0x0){return _0x4c19f3(_0xbda9('0x6'));}if(typeof _0x2c7202!==_0xbda9('0x4')||_0x2c7202[_0xbda9('0x5')]===0x0){return _0x4c19f3(_0xbda9('0x7'));}if(typeof _0x8d777b!==_0xbda9('0x8')&&(typeof _0x8d777b!==_0xbda9('0x4')||_0x8d777b[_0xbda9('0x5')]===0x0)){return _0x4c19f3(_0xbda9('0x9'));}try{_0x35502f=fs['readFileSync'](_0x3f78dd)[_0xbda9('0xa')](_0xbda9('0xb'));}catch(_0x1d7bf1){return _0x4c19f3(_0x1d7bf1);}return _0x1a652c({'method':'POST','uri':host+_0xbda9('0xc')+_0x2c7202,'body':{'config':{'encoding':_0xbda9('0xd'),'sampleRateHertz':'8000','languageCode':_0x8d777b},'audio':{'content':_0x35502f}},'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 ecb80a4..3962159 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 _0xe02a=['./asr'];(function(_0x1796b2,_0x2d7220){var _0x18397f=function(_0x5a93e5){while(--_0x5a93e5){_0x1796b2['push'](_0x1796b2['shift']());}};_0x18397f(++_0x2d7220);}(_0xe02a,0xa3));var _0xae02=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xe02a[_0x59ee6f];return _0x4c0979;};var asr=require(_0xae02('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0x2761=['./asr'];(function(_0x3cc5f8,_0x4498d4){var _0x4435dd=function(_0x2ded40){while(--_0x2ded40){_0x3cc5f8['push'](_0x3cc5f8['shift']());}};_0x4435dd(++_0x4498d4);}(_0x2761,0x1c1));var _0x1276=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2761[_0x3dd15e];return _0x231fd0;};var asr=require(_0x1276('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 b804b80..45e64b6 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 _0x0588=['chmodSync','777','split','readFileSync','https://texttospeech.googleapis.com/v1/','ssml','input','audioConfig','MP3','.mp3','from','.wav','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','join','googleASR\x20confidence','catch','[%s]\x20%s:%s','message','googleDialogflow','stringify','result','source','action','fulfillment','speech','score','status','endConversation','metadata','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','confidence','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','nda','text','channelData','CustomAction','AudioFromTts','Data','audiofile','dirName','http','https','url','parse','bluebird','sox','request-promise','querystring','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','get','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','info','finish\x20download\x20file','close','error','unlink','download\x20error','end','data','transcode','wav','error\x20convert','finish\x20to\x20convert','resolve','tmp','generate','writeFileSync','base64','then'];(function(_0x429ab9,_0x3572de){var _0x51feef=function(_0x5917cc){while(--_0x5917cc){_0x429ab9['push'](_0x429ab9['shift']());}};_0x51feef(++_0x3572de);}(_0x0588,0x15c));var _0x8058=function(_0x526467,_0x332d27){_0x526467=_0x526467-0x0;var _0x331f3c=_0x0588[_0x526467];return _0x331f3c;};'use strict';var fs=require('fs');var path=require('path');var http=require(_0x8058('0x0'));var https=require(_0x8058('0x1'));var urlParse=require(_0x8058('0x2'))[_0x8058('0x3')];var BPromise=require(_0x8058('0x4'));var rs=require('randomstring');var sox=require(_0x8058('0x5'));var rp=require(_0x8058('0x6'));var util=require('util');var querystring=require(_0x8058('0x7'));var tts=require('google-tts-api');var apiai=require('apiai-promise');var md5=require('md5');var google=require('./google');var aws=require('./aws');var tilde=require(_0x8058('0x8'));var sestek=require('./sestek');var logger=require(_0x8058('0x9'))(_0x8058('0xa'));var ISPEECH_API=_0x8058('0xb');function downloadFile(_0x3158b0,_0x14f8d2){return new BPromise(function(_0x26ec0f,_0x4fa115){var _0x2109d5=urlParse(_0x3158b0);var _0x7d0f3c=_0x2109d5[_0x8058('0xc')]===_0x8058('0xd')?https:http;var _0x2ff03d={'host':_0x2109d5[_0x8058('0xe')],'path':_0x2109d5['path'],'headers':{'user-agent':_0x8058('0xf')}};_0x7d0f3c[_0x8058('0x10')](_0x2ff03d,function(_0x71276){if(_0x71276[_0x8058('0x11')]!==0xc8){logger['error'](_0x8058('0x12')+_0x3158b0+_0x8058('0x13')+_0x71276[_0x8058('0x11')]+'\x20('+_0x71276[_0x8058('0x14')]+')');_0x4fa115(new Error('request\x20to\x20'+_0x3158b0+'\x20failed,\x20status\x20code\x20=\x20'+_0x71276[_0x8058('0x11')]+'\x20('+_0x71276[_0x8058('0x14')]+')'));return;}var _0x35ad28=fs[_0x8058('0x15')](_0x14f8d2);_0x35ad28['on']('finish',function(){logger[_0x8058('0x16')](_0x8058('0x17'));_0x35ad28[_0x8058('0x18')](_0x26ec0f);});_0x35ad28['on'](_0x8058('0x19'),function(_0x22de50){fs[_0x8058('0x1a')](_0x14f8d2);logger[_0x8058('0x19')](_0x8058('0x1b'),_0x22de50);_0x4fa115(_0x22de50);});_0x71276['pipe'](_0x35ad28);})['on'](_0x8058('0x19'),function(_0x1c7d05){logger[_0x8058('0x19')](_0x1c7d05);_0x4fa115(_0x1c7d05);})[_0x8058('0x1c')]();});}function uploadFile(_0x1d3a76){return new BPromise(function(_0x58cf1f,_0x36ee78){var _0x53f7ed=urlParse(_0x1d3a76);var _0x1128d3=_0x53f7ed[_0x8058('0xc')]===_0x8058('0xd')?https:http;var _0x33d0f9={'host':_0x53f7ed[_0x8058('0xe')],'path':_0x53f7ed['path'],'headers':{'user-agent':_0x8058('0xf')}};_0x1128d3[_0x8058('0x10')](_0x33d0f9,function(_0x5e14ef){if(_0x5e14ef[_0x8058('0x11')]!==0xc8){_0x36ee78(new Error(_0x8058('0x12')+_0x1d3a76+_0x8058('0x13')+_0x5e14ef[_0x8058('0x11')]+'\x20('+_0x5e14ef[_0x8058('0x14')]+')'));return;}var _0xd43400='';_0x5e14ef['on'](_0x8058('0x1d'),function(_0x4f288a){_0xd43400+=_0x4f288a;});_0x5e14ef['on']('end',function(){_0x58cf1f(_0xd43400);});})['on'](_0x8058('0x19'),function(_0x55cb45){_0x36ee78(_0x55cb45);})[_0x8058('0x1c')]();});}function convertFile(_0x2990a2,_0x16f37b){return new BPromise(function(_0x104edb,_0x3c9fde){var _0x6b0480=sox[_0x8058('0x1e')](_0x2990a2,_0x16f37b,{'sampleRate':0x1f40,'format':_0x8058('0x1f'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x6b0480['on'](_0x8058('0x19'),function(_0x1042fd){logger['error'](_0x8058('0x20'),_0x1042fd);_0x3c9fde(_0x1042fd);});_0x6b0480['on']('end',function(){logger[_0x8058('0x16')](_0x8058('0x21'));_0x104edb();});_0x6b0480['start']();});}function base64Decode(_0x32d009,_0x169a18){var _0x12a552=path[_0x8058('0x22')](__dirname,_0x8058('0x23'),rs[_0x8058('0x24')](0x4)+'.wav');fs[_0x8058('0x25')](_0x12a552,_0x32d009,_0x8058('0x26'));return convertFile(_0x12a552,_0x169a18)[_0x8058('0x27')](function(){try{fs[_0x8058('0x1a')](_0x12a552);fs[_0x8058('0x28')](_0x169a18,_0x8058('0x29'));}catch(_0x4a02b6){logger[_0x8058('0x19')](_0x4a02b6);}return _0x169a18[_0x8058('0x2a')]('.')[0x0];});}function base64Encode(_0x13ebb4){var _0x5c83ad=fs[_0x8058('0x2b')](_0x13ebb4);return new Buffer(_0x5c83ad)['toString'](_0x8058('0x26'));}exports['googleCloudTTS']=function(_0x51376a,_0xd8fbfc,_0x114196,_0x30a54a,_0xcbb1a9,_0x21d521){var _0x2309dd,_0x1bd152;var _0x1e1c61=_0x8058('0x2c');var _0x1e9dad='?key='+_0x51376a;var _0x9eb0ff={};if(_0xd8fbfc===_0x8058('0x2d')){_0x9eb0ff['input']={'ssml':_0x114196};}else{_0x9eb0ff[_0x8058('0x2e')]={'text':_0x114196};};_0x9eb0ff['voice']={'languageCode':_0x30a54a,'ssmlGender':_0xcbb1a9};_0x9eb0ff[_0x8058('0x2f')]={'audioEncoding':_0x8058('0x30'),'sampleRateHertz':0x1f40};var _0x1a394d={'url':_0x1e1c61+'text:synthesize'+_0x1e9dad,'method':'POST','json':!![],'body':_0x9eb0ff};return rp(_0x1a394d)[_0x8058('0x27')](function(_0x57a286){return new BPromise(function(_0x47acc4,_0x99a895){_0x2309dd=path['resolve'](__dirname,_0x8058('0x23'),rs[_0x8058('0x24')](0x4)+_0x8058('0x31'));var _0x50665c=Buffer[_0x8058('0x32')](_0x57a286['audioContent'],_0x8058('0x26'));return fs['writeFile'](_0x2309dd,_0x50665c,function(_0x23b70b){_0x99a895(_0x23b70b);},function(_0x4cee70){fs[_0x8058('0x28')](_0x2309dd,_0x8058('0x29'));_0x47acc4(_0x4cee70);});});})[_0x8058('0x27')](function(_0x438abc){_0x1bd152=path[_0x8058('0x22')](__dirname,_0x8058('0x23'),rs[_0x8058('0x24')](0x4)+_0x8058('0x33'));return convertFile(_0x2309dd,_0x1bd152);})['then'](function(){try{fs['unlink'](_0x2309dd);fs[_0x8058('0x28')](_0x1bd152,_0x8058('0x29'));}catch(_0x225b66){logger['error'](_0x225b66);}logger['info']('googleCloudTTS\x20path',_0x1bd152['split']('.')[0x0]);return _0x1bd152['split']('.')[0x0];});};exports['googleTTS']=function(_0x55b3b3,_0x56a7c2){var _0x3a7c22,_0xf88f5f;return tts(_0x55b3b3,_0x56a7c2||'en',0x1)[_0x8058('0x27')](function(_0x2a1499){logger[_0x8058('0x16')](_0x2a1499);_0x3a7c22=path['resolve'](__dirname,_0x8058('0x23'),rs['generate'](0x4)+_0x8058('0x31'));return downloadFile(_0x2a1499,_0x3a7c22);})['then'](function(){_0xf88f5f=path[_0x8058('0x22')](__dirname,_0x8058('0x23'),rs['generate'](0x4)+_0x8058('0x33'));return convertFile(_0x3a7c22,_0xf88f5f);})[_0x8058('0x27')](function(){try{fs[_0x8058('0x1a')](_0x3a7c22);fs[_0x8058('0x28')](_0xf88f5f,'777');}catch(_0x105a71){logger[_0x8058('0x19')](_0x105a71);}logger[_0x8058('0x16')](_0x8058('0x34'),_0xf88f5f['split']('.')[0x0]);return _0xf88f5f[_0x8058('0x2a')]('.')[0x0];});};exports[_0x8058('0x35')]=function(_0x487fe2,_0x32b0a6,_0x2be8e9){return google[_0x8058('0x36')](_0x487fe2,_0x32b0a6,_0x2be8e9)[_0x8058('0x27')](function(_0x1bbaf7){logger[_0x8058('0x16')](_0x1bbaf7[_0x8058('0x37')]);return rp(_0x1bbaf7);})[_0x8058('0x27')](function(_0x3744c2){var _0x393388='';var _0x5d0ae4=0x0;try{fs[_0x8058('0x1a')](_0x487fe2);}catch(_0x227fb1){logger[_0x8058('0x19')](_0x227fb1);}if(_0x3744c2&&_0x3744c2[_0x8058('0x38')]){_0x393388=_0x3744c2[_0x8058('0x38')][_0x8058('0x39')](function(_0x520fee){return _0x520fee&&_0x520fee['alternatives'][0x0]&&_0x520fee[_0x8058('0x3a')][0x0][_0x8058('0x3b')]?_0x520fee[_0x8058('0x3a')][0x0]['transcript']:'';})[_0x8058('0x3c')]('\x0a');_0x5d0ae4=_0x3744c2['results'][_0x8058('0x39')](function(_0x3ba59c){return _0x3ba59c&&_0x3ba59c[_0x8058('0x3a')][0x0]&&_0x3ba59c[_0x8058('0x3a')][0x0]['confidence']?_0x3ba59c[_0x8058('0x3a')][0x0]['confidence']:0x0;})[_0x8058('0x3c')]('\x0a');}logger[_0x8058('0x16')]('googleASR\x20transcription',_0x393388);logger[_0x8058('0x16')](_0x8058('0x3d'),_0x5d0ae4);return{'transcript':_0x393388,'confidence':_0x5d0ae4};})[_0x8058('0x3e')](function(_0x3a9611){logger[_0x8058('0x19')](_0x8058('0x3f'),_0x3a9611[_0x8058('0x11')],_0x3a9611['name'],_0x3a9611[_0x8058('0x40')]);});};exports[_0x8058('0x41')]=function(_0x47d206,_0x40d294,_0x467664,_0x1fd940){var _0x173a7d=apiai(_0x40d294,{'language':_0x1fd940||'en'});return _0x173a7d['textRequest'](_0x467664,{'sessionId':md5(_0x47d206)})[_0x8058('0x27')](function(_0x5d83ea){logger[_0x8058('0x16')](JSON[_0x8058('0x42')](_0x5d83ea));return{'source':_0x5d83ea[_0x8058('0x43')][_0x8058('0x44')],'resolvedQuery':_0x5d83ea[_0x8058('0x43')]['resolvedQuery'],'action':_0x5d83ea[_0x8058('0x43')][_0x8058('0x45')],'actionIncomplete':_0x5d83ea[_0x8058('0x43')]['actionIncomplete'],'speech':_0x5d83ea['result'][_0x8058('0x46')][_0x8058('0x47')],'score':_0x5d83ea[_0x8058('0x43')][_0x8058('0x48')],'statusCode':_0x5d83ea[_0x8058('0x49')]['code'],'endConversation':_0x5d83ea['result']['metadata'][_0x8058('0x4a')]||![],'isFallbackIntent':_0x5d83ea[_0x8058('0x43')][_0x8058('0x4b')]['isFallbackIntent']};});};exports[_0x8058('0x4c')]=function(_0x1b0da0,_0x29064e,_0x41de49,_0x47fa8d){return tilde['asr'](_0x1b0da0,_0x29064e,_0x41de49,_0x47fa8d)['then'](function(_0x2d514f){try{fs[_0x8058('0x1a')](_0x1b0da0);}catch(_0x1f001a){logger['error'](_0x1f001a);}logger[_0x8058('0x16')](_0x8058('0x4d'),_0x2d514f['transcript']);logger[_0x8058('0x16')](_0x8058('0x4e'),_0x2d514f[_0x8058('0x4f')]);return _0x2d514f;});};exports['awsPolly']=function(_0x3cf3e3,_0x26c0bb,_0x51afb5,_0x3f5fef,_0x1934c1,_0x4a406b){var _0x483e1e=path[_0x8058('0x22')](__dirname,_0x8058('0x23'),rs[_0x8058('0x24')](0x4)+'.mp3');var _0x2a2514;return aws[_0x8058('0x50')](_0x3cf3e3,_0x26c0bb,_0x51afb5,_0x3f5fef,_0x1934c1,_0x4a406b,_0x483e1e)[_0x8058('0x27')](function(){_0x2a2514=path[_0x8058('0x22')](__dirname,_0x8058('0x23'),rs[_0x8058('0x24')](0x4)+_0x8058('0x33'));return convertFile(_0x483e1e,_0x2a2514);})[_0x8058('0x27')](function(){try{fs['unlink'](_0x483e1e);fs[_0x8058('0x28')](_0x2a2514,'777');}catch(_0x12cb22){logger['error'](_0x12cb22);}return _0x2a2514['split']('.')[0x0];});};exports[_0x8058('0x51')]=function(_0x571c94,_0x474ae7,_0x16f989,_0x4ff951,_0x1a7484,_0x4dd6c5){return aws[_0x8058('0x52')](_0x571c94,_0x474ae7,_0x16f989,_0x4ff951,_0x1a7484,_0x4dd6c5)[_0x8058('0x27')](function(_0x150007){logger[_0x8058('0x16')](JSON[_0x8058('0x42')](_0x150007));return _0x150007;});};exports[_0x8058('0x53')]=function(_0x3a3281,_0x55c8ae,_0xa3b9a5,_0x5e55ea){var _0x12a7c1=util[_0x8058('0x54')](_0x8058('0x55'),ISPEECH_API,_0x3a3281,encodeURIComponent(_0x55c8ae),_0xa3b9a5,_0x5e55ea);var _0x4aad4e=path[_0x8058('0x22')](__dirname,'tmp',rs[_0x8058('0x24')](0x4)+'.mp3');var _0x362e60;return downloadFile(_0x12a7c1,_0x4aad4e)[_0x8058('0x27')](function(){_0x362e60=path[_0x8058('0x22')](__dirname,_0x8058('0x23'),rs[_0x8058('0x24')](0x4)+'.wav');return convertFile(_0x4aad4e,_0x362e60);})[_0x8058('0x27')](function(){try{fs[_0x8058('0x1a')](_0x4aad4e);fs[_0x8058('0x28')](_0x362e60,_0x8058('0x29'));}catch(_0x462fa1){logger[_0x8058('0x19')](_0x462fa1);}return _0x362e60[_0x8058('0x2a')]('.')[0x0];});};exports[_0x8058('0x56')]=function(_0x2c9ff3,_0x4f106c,_0x283cf7,_0x4d59ee){var _0x4d75e9=util[_0x8058('0x54')](_0x8058('0x57'),ISPEECH_API,_0x4f106c,_0x283cf7,base64Encode(_0x2c9ff3),_0x4d59ee?util['format'](_0x8058('0x58'),encodeURIComponent(_0x4d59ee)):'freeform=3');return uploadFile(_0x4d75e9)[_0x8058('0x27')](function(_0x2c46fd){return querystring[_0x8058('0x3')](_0x2c46fd);});};exports['sestekNDA']=function(_0x18bba4,_0x500727){return sestek[_0x8058('0x59')](_0x18bba4,_0x500727)[_0x8058('0x27')](function(_0x4479da){logger[_0x8058('0x16')](JSON[_0x8058('0x42')](_0x4479da));var _0x5bc0ae={'speech':_0x4479da[_0x8058('0x5a')],'action':_0x4479da['channelData']?_0x4479da[_0x8058('0x5b')][_0x8058('0x5c')]:undefined,'actiondata':_0x4479da['channelData']?_0x4479da['channelData']['CustomActionData']:undefined};if(_0x4479da['channelData']&&_0x4479da[_0x8058('0x5b')]['AudioFromTts']){return base64Decode(_0x4479da[_0x8058('0x5b')][_0x8058('0x5d')][_0x8058('0x5e')],path['resolve'](__dirname,'tmp',rs[_0x8058('0x24')](0x4)+_0x8058('0x33')))[_0x8058('0x27')](function(_0x45caba){_0x5bc0ae[_0x8058('0x5f')]=_0x45caba;return _0x5bc0ae;});}return _0x5bc0ae;});};exports[_0x8058('0x60')]=function(){return __dirname;}; \ No newline at end of file +var _0x1986=['bluebird','sox','request-promise','util','google-tts-api','md5','./google','./tilde','./sestek','agi','protocol','WHAT_EVER','get','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusCode','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','error','unlink','download\x20error','pipe','end','https:','host','data','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','writeFileSync','base64','chmodSync','777','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','text:synthesize','POST','then','.mp3','from','audioContent','.wav','googleCloudTTS\x20path','split','goggleTTS\x20path','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','source','result','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','status','code','metadata','isFallbackIntent','tildeASR','Tilde\x20ASR\x20transcription','awsPolly','polly','stringify','ispeechTTS','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','format','model=%s','freeform=3','parse','sestekNDA','nda','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','path','https','url'];(function(_0x190417,_0x54dc0d){var _0x110e9c=function(_0x517b86){while(--_0x517b86){_0x190417['push'](_0x190417['shift']());}};_0x110e9c(++_0x54dc0d);}(_0x1986,0xdf));var _0x6198=function(_0x122d77,_0x5908ac){_0x122d77=_0x122d77-0x0;var _0x34148b=_0x1986[_0x122d77];return _0x34148b;};'use strict';var fs=require('fs');var path=require(_0x6198('0x0'));var http=require('http');var https=require(_0x6198('0x1'));var urlParse=require(_0x6198('0x2'))['parse'];var BPromise=require(_0x6198('0x3'));var rs=require('randomstring');var sox=require(_0x6198('0x4'));var rp=require(_0x6198('0x5'));var util=require(_0x6198('0x6'));var querystring=require('querystring');var tts=require(_0x6198('0x7'));var apiai=require('apiai-promise');var md5=require(_0x6198('0x8'));var google=require(_0x6198('0x9'));var aws=require('./aws');var tilde=require(_0x6198('0xa'));var sestek=require(_0x6198('0xb'));var logger=require('../../../config/logger')(_0x6198('0xc'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x189bd0,_0x5b90f7){return new BPromise(function(_0x3713a0,_0x280281){var _0x24e293=urlParse(_0x189bd0);var _0x61a636=_0x24e293[_0x6198('0xd')]==='https:'?https:http;var _0x4d4495={'host':_0x24e293['host'],'path':_0x24e293[_0x6198('0x0')],'headers':{'user-agent':_0x6198('0xe')}};_0x61a636[_0x6198('0xf')](_0x4d4495,function(_0x39469a){if(_0x39469a['statusCode']!==0xc8){logger['error'](_0x6198('0x10')+_0x189bd0+_0x6198('0x11')+_0x39469a[_0x6198('0x12')]+'\x20('+_0x39469a['statusMessage']+')');_0x280281(new Error(_0x6198('0x10')+_0x189bd0+'\x20failed,\x20status\x20code\x20=\x20'+_0x39469a[_0x6198('0x12')]+'\x20('+_0x39469a[_0x6198('0x13')]+')'));return;}var _0x51bf24=fs[_0x6198('0x14')](_0x5b90f7);_0x51bf24['on'](_0x6198('0x15'),function(){logger[_0x6198('0x16')](_0x6198('0x17'));_0x51bf24[_0x6198('0x18')](_0x3713a0);});_0x51bf24['on'](_0x6198('0x19'),function(_0x274728){fs[_0x6198('0x1a')](_0x5b90f7);logger['error'](_0x6198('0x1b'),_0x274728);_0x280281(_0x274728);});_0x39469a[_0x6198('0x1c')](_0x51bf24);})['on'](_0x6198('0x19'),function(_0x5e135d){logger[_0x6198('0x19')](_0x5e135d);_0x280281(_0x5e135d);})[_0x6198('0x1d')]();});}function uploadFile(_0x466857){return new BPromise(function(_0x682d6b,_0x5abe1f){var _0x1ea7d2=urlParse(_0x466857);var _0xa21f4c=_0x1ea7d2[_0x6198('0xd')]===_0x6198('0x1e')?https:http;var _0x1a7de5={'host':_0x1ea7d2[_0x6198('0x1f')],'path':_0x1ea7d2['path'],'headers':{'user-agent':_0x6198('0xe')}};_0xa21f4c[_0x6198('0xf')](_0x1a7de5,function(_0x5eb0e0){if(_0x5eb0e0[_0x6198('0x12')]!==0xc8){_0x5abe1f(new Error(_0x6198('0x10')+_0x466857+_0x6198('0x11')+_0x5eb0e0[_0x6198('0x12')]+'\x20('+_0x5eb0e0[_0x6198('0x13')]+')'));return;}var _0x24fc16='';_0x5eb0e0['on'](_0x6198('0x20'),function(_0x47e3f9){_0x24fc16+=_0x47e3f9;});_0x5eb0e0['on'](_0x6198('0x1d'),function(){_0x682d6b(_0x24fc16);});})['on'](_0x6198('0x19'),function(_0x1838ae){_0x5abe1f(_0x1838ae);})[_0x6198('0x1d')]();});}function convertFile(_0xf66680,_0x2e1ce4){return new BPromise(function(_0x25e10e,_0x220347){var _0x166c67=sox[_0x6198('0x21')](_0xf66680,_0x2e1ce4,{'sampleRate':0x1f40,'format':_0x6198('0x22'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x166c67['on'](_0x6198('0x19'),function(_0x48666c){logger[_0x6198('0x19')](_0x6198('0x23'),_0x48666c);_0x220347(_0x48666c);});_0x166c67['on']('end',function(){logger[_0x6198('0x16')](_0x6198('0x24'));_0x25e10e();});_0x166c67[_0x6198('0x25')]();});}function base64Decode(_0x4e304a,_0x519d80){var _0x310f0d=path[_0x6198('0x26')](__dirname,_0x6198('0x27'),rs[_0x6198('0x28')](0x4)+'.wav');fs[_0x6198('0x29')](_0x310f0d,_0x4e304a,_0x6198('0x2a'));return convertFile(_0x310f0d,_0x519d80)['then'](function(){try{fs[_0x6198('0x1a')](_0x310f0d);fs[_0x6198('0x2b')](_0x519d80,_0x6198('0x2c'));}catch(_0x5c5b7f){logger[_0x6198('0x19')](_0x5c5b7f);}return _0x519d80['split']('.')[0x0];});}function base64Encode(_0x43f5ae){var _0x43ecba=fs[_0x6198('0x2d')](_0x43f5ae);return new Buffer(_0x43ecba)[_0x6198('0x2e')](_0x6198('0x2a'));}exports[_0x6198('0x2f')]=function(_0x1d91a0,_0xb1f555,_0x21a67f,_0x487790,_0x190f52,_0x680304){var _0x1a4a16,_0x391c45;var _0x47b4ef=_0x6198('0x30');var _0x469498=_0x6198('0x31')+_0x1d91a0;var _0x4ae6b8={};if(_0xb1f555===_0x6198('0x32')){_0x4ae6b8[_0x6198('0x33')]={'ssml':_0x21a67f};}else{_0x4ae6b8[_0x6198('0x33')]={'text':_0x21a67f};};_0x4ae6b8[_0x6198('0x34')]={'languageCode':_0x487790,'ssmlGender':_0x190f52};_0x4ae6b8[_0x6198('0x35')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x30496c={'url':_0x47b4ef+_0x6198('0x36')+_0x469498,'method':_0x6198('0x37'),'json':!![],'body':_0x4ae6b8};return rp(_0x30496c)[_0x6198('0x38')](function(_0x241142){return new BPromise(function(_0x24f2a5,_0x1c1d91){_0x1a4a16=path['resolve'](__dirname,_0x6198('0x27'),rs[_0x6198('0x28')](0x4)+_0x6198('0x39'));var _0x4dfef4=Buffer[_0x6198('0x3a')](_0x241142[_0x6198('0x3b')],_0x6198('0x2a'));return fs['writeFile'](_0x1a4a16,_0x4dfef4,function(_0xc743fe){_0x1c1d91(_0xc743fe);},function(_0x3c98b3){fs[_0x6198('0x2b')](_0x1a4a16,_0x6198('0x2c'));_0x24f2a5(_0x3c98b3);});});})['then'](function(_0x440c50){_0x391c45=path[_0x6198('0x26')](__dirname,_0x6198('0x27'),rs['generate'](0x4)+_0x6198('0x3c'));return convertFile(_0x1a4a16,_0x391c45);})['then'](function(){try{fs[_0x6198('0x1a')](_0x1a4a16);fs[_0x6198('0x2b')](_0x391c45,'777');}catch(_0x10c7ce){logger[_0x6198('0x19')](_0x10c7ce);}logger[_0x6198('0x16')](_0x6198('0x3d'),_0x391c45[_0x6198('0x3e')]('.')[0x0]);return _0x391c45[_0x6198('0x3e')]('.')[0x0];});};exports['googleTTS']=function(_0x34d7bd,_0x5c4f15){var _0x21bcdf,_0x483d76;return tts(_0x34d7bd,_0x5c4f15||'en',0x1)[_0x6198('0x38')](function(_0x35da71){logger[_0x6198('0x16')](_0x35da71);_0x21bcdf=path[_0x6198('0x26')](__dirname,'tmp',rs['generate'](0x4)+_0x6198('0x39'));return downloadFile(_0x35da71,_0x21bcdf);})[_0x6198('0x38')](function(){_0x483d76=path[_0x6198('0x26')](__dirname,'tmp',rs[_0x6198('0x28')](0x4)+_0x6198('0x3c'));return convertFile(_0x21bcdf,_0x483d76);})[_0x6198('0x38')](function(){try{fs[_0x6198('0x1a')](_0x21bcdf);fs[_0x6198('0x2b')](_0x483d76,_0x6198('0x2c'));}catch(_0x557140){logger[_0x6198('0x19')](_0x557140);}logger[_0x6198('0x16')](_0x6198('0x3f'),_0x483d76[_0x6198('0x3e')]('.')[0x0]);return _0x483d76[_0x6198('0x3e')]('.')[0x0];});};exports['googleASR']=function(_0x3161e3,_0x529b29,_0x34e320){return google[_0x6198('0x40')](_0x3161e3,_0x529b29,_0x34e320)['then'](function(_0x3bbb4c){logger['info'](_0x3bbb4c[_0x6198('0x41')]);return rp(_0x3bbb4c);})['then'](function(_0x40ec32){var _0x1101d8='';var _0x337cc9=0x0;try{fs[_0x6198('0x1a')](_0x3161e3);}catch(_0x4411b3){logger[_0x6198('0x19')](_0x4411b3);}if(_0x40ec32&&_0x40ec32[_0x6198('0x42')]){_0x1101d8=_0x40ec32['results'][_0x6198('0x43')](function(_0x134c6c){return _0x134c6c&&_0x134c6c[_0x6198('0x44')][0x0]&&_0x134c6c['alternatives'][0x0]['transcript']?_0x134c6c[_0x6198('0x44')][0x0][_0x6198('0x45')]:'';})[_0x6198('0x46')]('\x0a');_0x337cc9=_0x40ec32['results']['map'](function(_0x3465d7){return _0x3465d7&&_0x3465d7[_0x6198('0x44')][0x0]&&_0x3465d7['alternatives'][0x0][_0x6198('0x47')]?_0x3465d7[_0x6198('0x44')][0x0]['confidence']:0x0;})[_0x6198('0x46')]('\x0a');}logger['info'](_0x6198('0x48'),_0x1101d8);logger[_0x6198('0x16')](_0x6198('0x49'),_0x337cc9);return{'transcript':_0x1101d8,'confidence':_0x337cc9};})[_0x6198('0x4a')](function(_0x514237){logger['error'](_0x6198('0x4b'),_0x514237[_0x6198('0x12')],_0x514237[_0x6198('0x4c')],_0x514237[_0x6198('0x4d')]);});};exports[_0x6198('0x4e')]=function(_0x8eda73,_0x430cca,_0x5366ab,_0x5ced7e){var _0x2bd595=apiai(_0x430cca,{'language':_0x5ced7e||'en'});return _0x2bd595[_0x6198('0x4f')](_0x5366ab,{'sessionId':md5(_0x8eda73)})[_0x6198('0x38')](function(_0x196774){logger['info'](JSON['stringify'](_0x196774));return{'source':_0x196774['result'][_0x6198('0x50')],'resolvedQuery':_0x196774[_0x6198('0x51')][_0x6198('0x52')],'action':_0x196774[_0x6198('0x51')][_0x6198('0x53')],'actionIncomplete':_0x196774['result'][_0x6198('0x54')],'speech':_0x196774[_0x6198('0x51')][_0x6198('0x55')][_0x6198('0x56')],'score':_0x196774['result'][_0x6198('0x57')],'statusCode':_0x196774[_0x6198('0x58')][_0x6198('0x59')],'endConversation':_0x196774[_0x6198('0x51')][_0x6198('0x5a')]['endConversation']||![],'isFallbackIntent':_0x196774[_0x6198('0x51')]['metadata'][_0x6198('0x5b')]};});};exports[_0x6198('0x5c')]=function(_0x544aa3,_0x248604,_0x487b6c,_0x14dcee){return tilde[_0x6198('0x40')](_0x544aa3,_0x248604,_0x487b6c,_0x14dcee)[_0x6198('0x38')](function(_0x5910bc){try{fs[_0x6198('0x1a')](_0x544aa3);}catch(_0x1601f9){logger[_0x6198('0x19')](_0x1601f9);}logger[_0x6198('0x16')](_0x6198('0x5d'),_0x5910bc[_0x6198('0x45')]);logger[_0x6198('0x16')]('Tilde\x20ASR\x20confidence',_0x5910bc[_0x6198('0x47')]);return _0x5910bc;});};exports[_0x6198('0x5e')]=function(_0x3c24bb,_0x2524eb,_0x330318,_0x1706ce,_0x30f7c1,_0x45f055){var _0x2f975e=path[_0x6198('0x26')](__dirname,_0x6198('0x27'),rs['generate'](0x4)+_0x6198('0x39'));var _0x57a203;return aws[_0x6198('0x5f')](_0x3c24bb,_0x2524eb,_0x330318,_0x1706ce,_0x30f7c1,_0x45f055,_0x2f975e)['then'](function(){_0x57a203=path['resolve'](__dirname,'tmp',rs[_0x6198('0x28')](0x4)+_0x6198('0x3c'));return convertFile(_0x2f975e,_0x57a203);})[_0x6198('0x38')](function(){try{fs[_0x6198('0x1a')](_0x2f975e);fs[_0x6198('0x2b')](_0x57a203,_0x6198('0x2c'));}catch(_0x29c971){logger[_0x6198('0x19')](_0x29c971);}return _0x57a203['split']('.')[0x0];});};exports['awsLex']=function(_0x11e33a,_0x180a96,_0x590798,_0x20638d,_0x2edbe7,_0x2ff7e9){return aws['lex'](_0x11e33a,_0x180a96,_0x590798,_0x20638d,_0x2edbe7,_0x2ff7e9)[_0x6198('0x38')](function(_0x31046a){logger[_0x6198('0x16')](JSON[_0x6198('0x60')](_0x31046a));return _0x31046a;});};exports[_0x6198('0x61')]=function(_0x4f10f2,_0x1d2687,_0x49bcc2,_0x400ede){var _0x3fcd72=util['format'](_0x6198('0x62'),ISPEECH_API,_0x4f10f2,encodeURIComponent(_0x1d2687),_0x49bcc2,_0x400ede);var _0x5e354d=path[_0x6198('0x26')](__dirname,_0x6198('0x27'),rs[_0x6198('0x28')](0x4)+_0x6198('0x39'));var _0xe92057;return downloadFile(_0x3fcd72,_0x5e354d)[_0x6198('0x38')](function(){_0xe92057=path[_0x6198('0x26')](__dirname,_0x6198('0x27'),rs[_0x6198('0x28')](0x4)+_0x6198('0x3c'));return convertFile(_0x5e354d,_0xe92057);})[_0x6198('0x38')](function(){try{fs[_0x6198('0x1a')](_0x5e354d);fs['chmodSync'](_0xe92057,_0x6198('0x2c'));}catch(_0x169c74){logger[_0x6198('0x19')](_0x169c74);}return _0xe92057[_0x6198('0x3e')]('.')[0x0];});};exports[_0x6198('0x63')]=function(_0x48c652,_0x5d2ec9,_0x16fb3d,_0x102662){var _0x3ec928=util[_0x6198('0x64')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x5d2ec9,_0x16fb3d,base64Encode(_0x48c652),_0x102662?util[_0x6198('0x64')](_0x6198('0x65'),encodeURIComponent(_0x102662)):_0x6198('0x66'));return uploadFile(_0x3ec928)[_0x6198('0x38')](function(_0x3518eb){return querystring[_0x6198('0x67')](_0x3518eb);});};exports[_0x6198('0x68')]=function(_0x3919e2,_0x533cae){return sestek[_0x6198('0x69')](_0x3919e2,_0x533cae)['then'](function(_0x33633a){logger[_0x6198('0x16')](JSON['stringify'](_0x33633a));var _0x3774db={'speech':_0x33633a['text'],'action':_0x33633a[_0x6198('0x6a')]?_0x33633a[_0x6198('0x6a')][_0x6198('0x6b')]:undefined,'actiondata':_0x33633a[_0x6198('0x6a')]?_0x33633a['channelData'][_0x6198('0x6c')]:undefined};if(_0x33633a[_0x6198('0x6a')]&&_0x33633a[_0x6198('0x6a')][_0x6198('0x6d')]){return base64Decode(_0x33633a[_0x6198('0x6a')][_0x6198('0x6d')][_0x6198('0x6e')],path[_0x6198('0x26')](__dirname,_0x6198('0x27'),rs['generate'](0x4)+_0x6198('0x3c')))['then'](function(_0x1d9099){_0x3774db[_0x6198('0x6f')]=_0x1d9099;return _0x3774db;});}return _0x3774db;});};exports[_0x6198('0x70')]=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 26ae5d5..512d011 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 _0xf902=['exports','./nda'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf902,0xc1));var _0x2f90=function(_0x350c20,_0x279a81){_0x350c20=_0x350c20-0x0;var _0x47e262=_0xf902[_0x350c20];return _0x47e262;};var nda=require(_0x2f90('0x0'));module[_0x2f90('0x1')]={'nda':nda}; \ No newline at end of file +var _0xace7=['./nda'];(function(_0x7d4dc8,_0x14d70e){var _0x20b216=function(_0x3575b0){while(--_0x3575b0){_0x7d4dc8['push'](_0x7d4dc8['shift']());}};_0x20b216(++_0x14d70e);}(_0xace7,0xae));var _0x7ace=function(_0x5c38a2,_0x40e4e4){_0x5c38a2=_0x5c38a2-0x0;var _0x22869c=_0xace7[_0x5c38a2];return _0x22869c;};var nda=require(_0x7ace('0x0'));module['exports']={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index ffaabed..fc1133f 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 _0x2452=['extension','Bearer\x20','project','body','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','channelData','CustomAction','custom_action_data','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','POST','resolve','ndauth_url','/token','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','message','Nda','uniqueid','callerid','calleridname','dnid'];(function(_0x317b0d,_0x191134){var _0x362755=function(_0x46e164){while(--_0x46e164){_0x317b0d['push'](_0x317b0d['shift']());}};_0x362755(++_0x191134);}(_0x2452,0x1bc));var _0x2245=function(_0x28b4cd,_0x573ff1){_0x28b4cd=_0x28b4cd-0x0;var _0x4229cc=_0x2452[_0x28b4cd];return _0x4229cc;};'use strict';var rp=require(_0x2245('0x0'));var url=require(_0x2245('0x1'));var logger=require(_0x2245('0x2'))('agi');module['exports']=function(_0x28d3e2,_0x2f9449){var _0xa70e46={'method':_0x2245('0x3'),'uri':url[_0x2245('0x4')](_0x2f9449[_0x2245('0x5')],_0x2245('0x6')),'form':{'grant_type':_0x2245('0x7'),'username':_0x2f9449[_0x2245('0x8')],'password':_0x2f9449['password']},'json':!![]};return rp(_0xa70e46)[_0x2245('0x9')](function(_0x597386){var _0xab9262={'method':_0x2245('0x3'),'uri':url['resolve'](_0x2f9449[_0x2245('0xa')],_0x2245('0xb')),'body':{'type':_0x2f9449['ndaactivity_type']||_0x2245('0xc'),'channelId':_0x2245('0xd'),'conversation':{'id':_0x28d3e2[_0x2245('0xe')]},'from':{'id':_0x28d3e2[_0x2245('0xf')],'name':_0x28d3e2[_0x2245('0x10')]},'recipient':{'id':_0x28d3e2[_0x2245('0x11')],'name':_0x28d3e2[_0x2245('0x12')]},'text':_0x2f9449['text'],'channelData':{}},'headers':{'Authorization':_0x2245('0x13')+_0x597386['access_token']},'json':!![]};if(_0x2f9449[_0x2245('0x14')]){_0xab9262[_0x2245('0x15')]['channelData'][_0x2245('0x16')]=_0x2f9449[_0x2245('0x14')];}if(_0x2f9449[_0x2245('0x17')]=='1'){_0xab9262[_0x2245('0x15')]['channelData'][_0x2245('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x2245('0x19')};}if(_0x2f9449[_0x2245('0x1a')]){_0xab9262[_0x2245('0x15')][_0x2245('0x1b')][_0x2245('0x1c')]=_0x2f9449['custom_action'];if(_0x2f9449[_0x2245('0x1d')]){_0xab9262[_0x2245('0x15')][_0x2245('0x1b')][_0x2245('0x1e')]=_0x2f9449['custom_action_data'];}}logger[_0x2245('0x1f')](JSON[_0x2245('0x20')](_0xab9262));return rp(_0xab9262);});}; \ No newline at end of file +var _0x4297=['project','channelData','body','AudioOutputSettings','audio/wav','custom_action','custom_action_data','CustomActionData','info','stringify','url','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','password','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','Nda','callerid','dnid','extension','Bearer\x20','access_token'];(function(_0x4819bc,_0x475d9c){var _0x4ae3d6=function(_0x490ad1){while(--_0x490ad1){_0x4819bc['push'](_0x4819bc['shift']());}};_0x4ae3d6(++_0x475d9c);}(_0x4297,0x183));var _0x7429=function(_0x2d364e,_0x301c5e){_0x2d364e=_0x2d364e-0x0;var _0x1b9312=_0x4297[_0x2d364e];return _0x1b9312;};'use strict';var rp=require('request-promise');var url=require(_0x7429('0x0'));var logger=require(_0x7429('0x1'))(_0x7429('0x2'));module[_0x7429('0x3')]=function(_0x44c704,_0x3c9e96){var _0xa9c5c4={'method':_0x7429('0x4'),'uri':url[_0x7429('0x5')](_0x3c9e96[_0x7429('0x6')],_0x7429('0x7')),'form':{'grant_type':_0x7429('0x8'),'username':_0x3c9e96['username'],'password':_0x3c9e96[_0x7429('0x8')]},'json':!![]};return rp(_0xa9c5c4)[_0x7429('0x9')](function(_0x1b7a05){var _0x30656a={'method':_0x7429('0x4'),'uri':url[_0x7429('0x5')](_0x3c9e96[_0x7429('0xa')],_0x7429('0xb')),'body':{'type':_0x3c9e96[_0x7429('0xc')]||'message','channelId':_0x7429('0xd'),'conversation':{'id':_0x44c704['uniqueid']},'from':{'id':_0x44c704[_0x7429('0xe')],'name':_0x44c704['calleridname']},'recipient':{'id':_0x44c704[_0x7429('0xf')],'name':_0x44c704[_0x7429('0x10')]},'text':_0x3c9e96['text'],'channelData':{}},'headers':{'Authorization':_0x7429('0x11')+_0x1b7a05[_0x7429('0x12')]},'json':!![]};if(_0x3c9e96[_0x7429('0x13')]){_0x30656a['body'][_0x7429('0x14')]['ProjectName']=_0x3c9e96[_0x7429('0x13')];}if(_0x3c9e96['ndagenerate_audio']=='1'){_0x30656a[_0x7429('0x15')][_0x7429('0x14')][_0x7429('0x16')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x7429('0x17')};}if(_0x3c9e96[_0x7429('0x18')]){_0x30656a['body'][_0x7429('0x14')]['CustomAction']=_0x3c9e96['custom_action'];if(_0x3c9e96[_0x7429('0x19')]){_0x30656a[_0x7429('0x15')][_0x7429('0x14')][_0x7429('0x1a')]=_0x3c9e96[_0x7429('0x19')];}}logger[_0x7429('0x1b')](JSON[_0x7429('0x1c')](_0x30656a));return rp(_0x30656a);});}; \ 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 090f8ba..78fc9be 100644 --- a/server/services/agi/scripts/tilde/asr/index.js +++ b/server/services/agi/scripts/tilde/asr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x27f8=['exports','./lib/api'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x27f8,0x8f));var _0x827f=function(_0x3d8995,_0x5f4f4b){_0x3d8995=_0x3d8995-0x0;var _0x5dd8ed=_0x27f8[_0x3d8995];return _0x5dd8ed;};'use strict';var asr=require(_0x827f('0x0'));module[_0x827f('0x1')]=function(_0x41f280,_0x283a76,_0x113d84,_0xd1192){return asr(_0x41f280,_0x283a76,_0x113d84,_0xd1192);}; \ No newline at end of file +var _0xa69a=['./lib/api','exports'];(function(_0x3c310f,_0x39af10){var _0x5058d7=function(_0x3057ce){while(--_0x3057ce){_0x3c310f['push'](_0x3c310f['shift']());}};_0x5058d7(++_0x39af10);}(_0xa69a,0xc4));var _0xaa69=function(_0x4123f3,_0x3aa327){_0x4123f3=_0x4123f3-0x0;var _0x3353b7=_0xa69a[_0x4123f3];return _0x3353b7;};'use strict';var asr=require(_0xaa69('0x0'));module[_0xaa69('0x1')]=function(_0x229bd5,_0x61d43b,_0x30a89b,_0x888fe7){return asr(_0x229bd5,_0x61d43b,_0x30a89b,_0x888fe7);}; \ 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 e4e3f9d..9566286 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 _0x4601=['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','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','createReadStream','close','EOS','error','Tilde\x20ASR\x20send\x20error','stringify','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.','Tilde\x20ASR\x20parse\x20error','Error\x20Tilde\x20ASR\x20socket','isNil','message','bluebird','lodash','crypto','../../../../../../config/logger'];(function(_0x2d97fe,_0xd37bc5){var _0x43ea67=function(_0x5d4537){while(--_0x5d4537){_0x2d97fe['push'](_0x2d97fe['shift']());}};_0x43ea67(++_0xd37bc5);}(_0x4601,0xbf));var _0x1460=function(_0x51b718,_0x29c390){_0x51b718=_0x51b718-0x0;var _0x3ce78f=_0x4601[_0x51b718];return _0x3ce78f;};'use strict';var BPromise=require(_0x1460('0x0'));var _=require(_0x1460('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0x1460('0x2'));var logger=require(_0x1460('0x3'))(_0x1460('0x4'));module[_0x1460('0x5')]=function(_0x20e84f,_0x50e35e,_0xc60a5a,_0x54b3a2){return new BPromise(function(_0x3b0ba9,_0x2abf1c){logger[_0x1460('0x6')](_0x1460('0x7'),_0x54b3a2||_0x1460('0x8'));var _0x25b842=new WebSocket(_0x54b3a2||_0x1460('0x8'),{'perMessageDeflate':![]});var _0x452fa2='';var _0xfa6c8f='0';var _0xb99562='1';var _0x112a60=_0x1460('0x9');function _0x234149(_0x122885){var _0x304a61=crypto['createHash'](_0x1460('0xa'));_0x304a61['update'](_0x122885);return _0x304a61[_0x1460('0xb')](_0x1460('0xc'));}function _0xb86090(){try{logger['info'](_0x1460('0xd'));var _0x595aed=moment()[_0x1460('0xe')]();var _0x158c20=_0x234149(_0x595aed+_0x50e35e+_0xc60a5a);_0x25b842[_0x1460('0xf')](JSON['stringify']({'appID':_0x50e35e,'timestamp':_0x595aed,'appKey':_0x158c20}));var _0x2fdd03=fs[_0x1460('0x10')](_0x20e84f);_0x2fdd03['on']('data',function(_0x586bd2){_0x25b842[_0x1460('0xf')](_0x586bd2);});_0x2fdd03['on'](_0x1460('0x11'),function(){_0x25b842[_0x1460('0xf')](_0x1460('0x12'));});}catch(_0x282e17){logger[_0x1460('0x13')](_0x1460('0x14'),JSON[_0x1460('0x15')](_0x282e17));_0x25b842['terminate']();}}function _0x282986(_0x2d3833){try{if(_0x2d3833){var _0x3432b1=JSON[_0x1460('0x16')](_0x2d3833);switch(_0x3432b1[_0x1460('0x17')]){case 0x0:if(_0x3432b1[_0x1460('0x18')]){if(_0x3432b1[_0x1460('0x18')][_0x1460('0x19')]){logger[_0x1460('0x6')](_0x1460('0x1a'),JSON[_0x1460('0x15')](_0x3432b1[_0x1460('0x18')][_0x1460('0x1b')]));_0x452fa2=_0x3432b1[_0x1460('0x18')][_0x1460('0x1b')][0x0][_0x1460('0x1c')];_0xfa6c8f=_0x3432b1[_0x1460('0x18')][_0x1460('0x1b')][0x0]['likelihood'];_0xb99562='0';_0x112a60=_0x1460('0x1d');_0x25b842[_0x1460('0x1e')]();}}break;case 0x1:logger['info'](_0x1460('0x9'));_0xb99562='1';_0x112a60='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0x1460('0x6')](_0x1460('0x1f'));_0xb99562='2';_0x112a60=_0x1460('0x1f');break;case 0x9:logger[_0x1460('0x6')](_0x1460('0x20'));_0xb99562='9';_0x112a60='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0x1460('0x6')]('Authentication\x20failed.');_0xb99562='10';_0x112a60=_0x1460('0x21');break;case 0xb:logger['info'](_0x1460('0x22'));_0xb99562='11';_0x112a60=_0x1460('0x22');}}}catch(_0x18b270){logger[_0x1460('0x13')](_0x1460('0x23'),JSON[_0x1460('0x15')](_0x18b270));_0x25b842[_0x1460('0x1e')]();}}function _0x308f5c(){logger[_0x1460('0x6')]('Close\x20Tilde\x20ASR\x20socket');_0x3b0ba9({'transcript':_0x452fa2,'confidence':_0xfa6c8f,'status':_0xb99562,'status_message':_0x112a60});}function _0x1543d4(_0xaf580f){logger[_0x1460('0x13')](_0x1460('0x24'));if(!_[_0x1460('0x25')](_0xaf580f)){logger[_0x1460('0x13')](_['isObject'](_0xaf580f)?JSON[_0x1460('0x15')](_0xaf580f):_0xaf580f);}}_0x25b842['on']('open',_0xb86090);_0x25b842['on'](_0x1460('0x26'),_0x282986);_0x25b842['on']('close',_0x308f5c);_0x25b842['on'](_0x1460('0x13'),_0x1543d4);});}; \ No newline at end of file +var _0xeb8e=['send','EOS','error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','transcript','hypotheses','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isObject','open','message','lodash','moment','../../../../../../config/logger','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','hex','Open\x20Tilde\x20ASR\x20socket','unix','stringify','data','close'];(function(_0x1ce8a1,_0x5a44c2){var _0x427f17=function(_0x998d1d){while(--_0x998d1d){_0x1ce8a1['push'](_0x1ce8a1['shift']());}};_0x427f17(++_0x5a44c2);}(_0xeb8e,0x157));var _0xeeb8=function(_0x12c4b8,_0x47db12){_0x12c4b8=_0x12c4b8-0x0;var _0x474576=_0xeb8e[_0x12c4b8];return _0x474576;};'use strict';var BPromise=require('bluebird');var _=require(_0xeeb8('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xeeb8('0x1'));var crypto=require('crypto');var logger=require(_0xeeb8('0x2'))('agi');module[_0xeeb8('0x3')]=function(_0x2fd841,_0xd140dd,_0x495e11,_0x2037c5){return new BPromise(function(_0x2a311b,_0x453b71){logger[_0xeeb8('0x4')](_0xeeb8('0x5'),_0x2037c5||_0xeeb8('0x6'));var _0x2ab166=new WebSocket(_0x2037c5||_0xeeb8('0x6'),{'perMessageDeflate':![]});var _0x4a10eb='';var _0x89f5e5='0';var _0x539330='1';var _0x8fe044=_0xeeb8('0x7');function _0x59fb2c(_0x20a176){var _0x34b8d0=crypto['createHash'](_0xeeb8('0x8'));_0x34b8d0[_0xeeb8('0x9')](_0x20a176);return _0x34b8d0[_0xeeb8('0xa')](_0xeeb8('0xb'));}function _0x3610f9(){try{logger['info'](_0xeeb8('0xc'));var _0x32ae30=moment()[_0xeeb8('0xd')]();var _0x2f9267=_0x59fb2c(_0x32ae30+_0xd140dd+_0x495e11);_0x2ab166['send'](JSON[_0xeeb8('0xe')]({'appID':_0xd140dd,'timestamp':_0x32ae30,'appKey':_0x2f9267}));var _0xc80671=fs['createReadStream'](_0x2fd841);_0xc80671['on'](_0xeeb8('0xf'),function(_0x46289e){_0x2ab166['send'](_0x46289e);});_0xc80671['on'](_0xeeb8('0x10'),function(){_0x2ab166[_0xeeb8('0x11')](_0xeeb8('0x12'));});}catch(_0x408374){logger[_0xeeb8('0x13')]('Tilde\x20ASR\x20send\x20error',JSON['stringify'](_0x408374));_0x2ab166[_0xeeb8('0x14')]();}}function _0xb7d12a(_0x5cf5e2){try{if(_0x5cf5e2){var _0x2913fe=JSON[_0xeeb8('0x15')](_0x5cf5e2);switch(_0x2913fe[_0xeeb8('0x16')]){case 0x0:if(_0x2913fe['result']){if(_0x2913fe[_0xeeb8('0x17')][_0xeeb8('0x18')]){logger['info'](_0xeeb8('0x19'),JSON[_0xeeb8('0xe')](_0x2913fe['result']['hypotheses']));_0x4a10eb=_0x2913fe[_0xeeb8('0x17')]['hypotheses'][0x0][_0xeeb8('0x1a')];_0x89f5e5=_0x2913fe[_0xeeb8('0x17')][_0xeeb8('0x1b')][0x0][_0xeeb8('0x1c')];_0x539330='0';_0x8fe044=_0xeeb8('0x1d');_0x2ab166[_0xeeb8('0x14')]();}}break;case 0x1:logger['info']('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x539330='1';_0x8fe044=_0xeeb8('0x7');break;case 0x2:logger[_0xeeb8('0x4')](_0xeeb8('0x1e'));_0x539330='2';_0x8fe044=_0xeeb8('0x1e');break;case 0x9:logger[_0xeeb8('0x4')](_0xeeb8('0x1f'));_0x539330='9';_0x8fe044=_0xeeb8('0x1f');break;case 0xa:logger['info'](_0xeeb8('0x20'));_0x539330='10';_0x8fe044='Authentication\x20failed.';break;case 0xb:logger[_0xeeb8('0x4')](_0xeeb8('0x21'));_0x539330='11';_0x8fe044=_0xeeb8('0x21');}}}catch(_0x337c4c){logger[_0xeeb8('0x13')](_0xeeb8('0x22'),JSON[_0xeeb8('0xe')](_0x337c4c));_0x2ab166[_0xeeb8('0x14')]();}}function _0x43767b(){logger[_0xeeb8('0x4')](_0xeeb8('0x23'));_0x2a311b({'transcript':_0x4a10eb,'confidence':_0x89f5e5,'status':_0x539330,'status_message':_0x8fe044});}function _0x358218(_0x21a774){logger['error'](_0xeeb8('0x24'));if(!_['isNil'](_0x21a774)){logger['error'](_[_0xeeb8('0x25')](_0x21a774)?JSON[_0xeeb8('0xe')](_0x21a774):_0x21a774);}}_0x2ab166['on'](_0xeeb8('0x26'),_0x3610f9);_0x2ab166['on'](_0xeeb8('0x27'),_0xb7d12a);_0x2ab166['on'](_0xeeb8('0x10'),_0x43767b);_0x2ab166['on'](_0xeeb8('0x13'),_0x358218);});}; \ 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 27fe75f..b5f5d0d 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 _0x8069=['exports','./asr'];(function(_0x174500,_0x592210){var _0x375496=function(_0x1b78c9){while(--_0x1b78c9){_0x174500['push'](_0x174500['shift']());}};_0x375496(++_0x592210);}(_0x8069,0xbb));var _0x9806=function(_0x212bc0,_0x5c42d){_0x212bc0=_0x212bc0-0x0;var _0x4a26d5=_0x8069[_0x212bc0];return _0x4a26d5;};var asr=require(_0x9806('0x0'));module[_0x9806('0x1')]={'asr':asr}; \ No newline at end of file +var _0xe511=['exports','./asr'];(function(_0x404474,_0x4ab0a0){var _0x1c9f32=function(_0x566ebd){while(--_0x566ebd){_0x404474['push'](_0x404474['shift']());}};_0x1c9f32(++_0x4ab0a0);}(_0xe511,0x143));var _0x1e51=function(_0xd8eaa9,_0x1c3121){_0xd8eaa9=_0xd8eaa9-0x0;var _0x4ab53f=_0xe511[_0xd8eaa9];return _0x4ab53f;};var asr=require(_0x1e51('0x0'));module[_0x1e51('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index d201b05..8bc8802 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 _0xfe60=['nextTick','inherits','exports','net','EventEmitter','./error','./channel','127.0.0.1','call','error','listening','connection','getConnections','emit','E_AGI_SERVER_ERROR','ready','code','close','E_AGI_SERVER_CLOSE'];(function(_0x339d2c,_0x315e95){var _0x1764c2=function(_0x5dab48){while(--_0x5dab48){_0x339d2c['push'](_0x339d2c['shift']());}};_0x1764c2(++_0x315e95);}(_0xfe60,0x1cb));var _0x0fe6=function(_0xd70a79,_0x4e87c9){_0xd70a79=_0xd70a79-0x0;var _0x389754=_0xfe60[_0xd70a79];return _0x389754;};'use strict';var util=require('util');var net=require(_0x0fe6('0x0'));var EventEmitter=require('events')[_0x0fe6('0x1')];var AGIError=require(_0x0fe6('0x2'));var AGIChannel=require(_0x0fe6('0x3'));var AGIServer=function(_0x4aa401,_0x40740,_0x244c56){var _0x402912=this,_0x4aa401=_0x4aa401||0x11dd,_0x40740=_0x40740||_0x0fe6('0x4'),_0x1281fc=null,_0x13b947=0x0;EventEmitter[_0x0fe6('0x5')](_0x402912);function _0x24e88f(){if(!_0x4aa401){_0x402912['emit'](_0x0fe6('0x6'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x1281fc=net['createServer']();_0x1281fc['listen'](_0x4aa401,_0x40740);_0x1281fc['on'](_0x0fe6('0x7'),function(){_0x402912['emit'](_0x0fe6('0x7'));});_0x1281fc['on'](_0x0fe6('0x8'),function(_0x1a14f3){_0x1281fc[_0x0fe6('0x9')](function(_0x299994,_0x2498a0){if(_0x299994){_0x402912[_0x0fe6('0xa')]('error',new AGIError(_0x0fe6('0xb'),_0x299994));}else if(_0x244c56&&_0x244c56<0x0){_0x402912[_0x0fe6('0xa')](_0x0fe6('0x6'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x1a14f3['destroy']();}else if(_0x244c56&&_0x244c56>0x0&&_0x244c56<_0x2498a0){_0x13b947+=0x1;_0x402912[_0x0fe6('0xa')]('error',new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x13b947));_0x1a14f3['destroy']();}else{var _0x225253=new AGIChannel(_0x1a14f3);_0x225253['on'](_0x0fe6('0xc'),function(){_0x402912[_0x0fe6('0xa')](_0x0fe6('0x8'),_0x225253);});}});});_0x1281fc['on'](_0x0fe6('0x6'),function(_0x16f2f6){_0x402912[_0x0fe6('0xa')](_0x0fe6('0x6'),new AGIError(_0x0fe6('0xb'),_0x16f2f6[_0x0fe6('0xd')]));});_0x1281fc['on'](_0x0fe6('0xe'),function(){_0x402912[_0x0fe6('0xa')]('close',new AGIError(_0x0fe6('0xf')));});}process[_0x0fe6('0x10')](function(){_0x24e88f();});};util[_0x0fe6('0x11')](AGIServer,EventEmitter);module[_0x0fe6('0x12')]=function(_0x38bdeb,_0x3738bd,_0xf351d5){return new AGIServer(_0x38bdeb,_0x3738bd,_0xf351d5);}; \ No newline at end of file +var _0x8ec7=['call','emit','error','E_AGI_ARGUMENT_PORT','listen','listening','connection','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','net','EventEmitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8ec7,0x1f1));var _0x78ec=function(_0x1c7137,_0x4c7c26){_0x1c7137=_0x1c7137-0x0;var _0xeb4432=_0x8ec7[_0x1c7137];return _0xeb4432;};'use strict';var util=require(_0x78ec('0x0'));var net=require(_0x78ec('0x1'));var EventEmitter=require('events')[_0x78ec('0x2')];var AGIError=require('./error');var AGIChannel=require('./channel');var AGIServer=function(_0x1271a1,_0x3b9496,_0x5d3971){var _0x207477=this,_0x1271a1=_0x1271a1||0x11dd,_0x3b9496=_0x3b9496||'127.0.0.1',_0x1f4732=null,_0xef2f90=0x0;EventEmitter[_0x78ec('0x3')](_0x207477);function _0x4ca55e(){if(!_0x1271a1){_0x207477[_0x78ec('0x4')](_0x78ec('0x5'),new AGIError(_0x78ec('0x6')));return![];}_0x1f4732=net['createServer']();_0x1f4732[_0x78ec('0x7')](_0x1271a1,_0x3b9496);_0x1f4732['on'](_0x78ec('0x8'),function(){_0x207477[_0x78ec('0x4')](_0x78ec('0x8'));});_0x1f4732['on'](_0x78ec('0x9'),function(_0x485f57){_0x1f4732['getConnections'](function(_0x283aa2,_0x44f5ec){if(_0x283aa2){_0x207477[_0x78ec('0x4')]('error',new AGIError(_0x78ec('0xa'),_0x283aa2));}else if(_0x5d3971&&_0x5d3971<0x0){_0x207477[_0x78ec('0x4')](_0x78ec('0x5'),new AGIError(_0x78ec('0xb')));_0x485f57[_0x78ec('0xc')]();}else if(_0x5d3971&&_0x5d3971>0x0&&_0x5d3971<_0x44f5ec){_0xef2f90+=0x1;_0x207477[_0x78ec('0x4')](_0x78ec('0x5'),new AGIError(_0x78ec('0xd'),_0xef2f90));_0x485f57[_0x78ec('0xc')]();}else{var _0x36b7ca=new AGIChannel(_0x485f57);_0x36b7ca['on'](_0x78ec('0xe'),function(){_0x207477['emit'](_0x78ec('0x9'),_0x36b7ca);});}});});_0x1f4732['on'](_0x78ec('0x5'),function(_0x3c179b){_0x207477[_0x78ec('0x4')](_0x78ec('0x5'),new AGIError('E_AGI_SERVER_ERROR',_0x3c179b['code']));});_0x1f4732['on']('close',function(){_0x207477['emit'](_0x78ec('0xf'),new AGIError(_0x78ec('0x10')));});}process[_0x78ec('0x11')](function(){_0x4ca55e();});};util[_0x78ec('0x12')](AGIServer,EventEmitter);module[_0x78ec('0x13')]=function(_0x222b14,_0x767521,_0x396a6d){return new AGIServer(_0x222b14,_0x767521,_0x396a6d);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index baa9f09..26c9850 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 _0xa9e0=['replaceAllVariables','saveRestApiResult','%s.%s','replaceObjectAllVariables','split','length','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','retry','maxRetry','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','answer','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','no\x20list\x20selected','delay','add','callback_priority','noop','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','phone','custom_app','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','no\x20text\x20configured','lumenvoxasr','grammar','no\x20grammar\x20configured','MRCPRecog','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','RECOG_CONFIDENCE()','SESTEK_ASR_CONFIDENCE','RECOG_INPUT()','SESTEK_ASR_TRANSCRIPT','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','forEach','keys','setVariable','%s_ROWS_COUNT','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','toUpperCase','out','Dialogflow\x20Result\x20%s','speech','Dialogflow\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','maxdigit','test','mindigit','no\x20variable\x20found','hiddendigitspos','substr','generate','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','streamFile','unlink','.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','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','beep','NOBEEP','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','%s/recordings/%s','recordFile','intKey','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','context','extension','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','login','findBy','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','no\x20find\x20by\x20configured','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','menu','digit','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','agentPause','playback','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','getVoiceQueue','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','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','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','statusMessage','variable\x20%s\x20set','saydigits','sayDigits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','subject','service','host','port','secure','authentication','auth','template_id','debug','Trying\x20SendMail\x20with\x20account\x20%s','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','createSmsMessage','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','getSquareProject','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','127.0.0.1','AGI','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','agentUnpause','voicemail','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','exports','path','util','lodash','randomstring','mustache','request-promise','../../config/logger','agi','../../config/environment','/var/opt/motion2/server/files','rawHeaders','rawBody','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','then','name','catch','getVoiceQueueById','getSquareProjectById','getSquareOdbc','getSquareOdbcById','getUser','getUserById','getTrunk','getSound','getSoundById','getSoundPath','save_name','getMailAccount','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','format','getQueryOdbc','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','getSmsAccount','getSmsAccountById','createSquareDetailsReport','uniqueid','label','agicommand','callerid','createSquareRecording','calleridname','priority','dnid','arg_1','file','createSquareMessage','createCmContact','isEmpty','isNil','lastName','scheduledAt','Callback\x20scheduled\x20at\x20','toString','getPause','getPauseById','agent','error','agentLogout','agentLogin','internal','LOCAL','shellCommand','exec','trim','replace','apiKey','google_cloud_tts_text_type','text','languageCode','audioEncoding','MP3','googleTTS','restAPI','method','timeout','number','includes','POST','PUT','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','render','url','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','message','options','googleDialogflow','dialogflow_language','sestekNDA','ispeechTTS','ispeech_tts_language','en-US','ispeechASR','key','isConfigured','model','awsPolly','aws_access_key_id','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_secret_access_key','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','uri','clear','clone','hasOwnProperty','isString','isPlainObject','recursiveNodeIndex','isArray'];(function(_0x4d82ea,_0x4d459f){var _0x257f4a=function(_0x424c4f){while(--_0x424c4f){_0x4d82ea['push'](_0x4d82ea['shift']());}};_0x257f4a(++_0x4d459f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'use strict';var fs=require('fs');var path=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var sh=require('shelljs');var odbc=require('odbc')();var rs=require(_0x0a9e('0x3'));var moment=require('moment');var Mustache=require(_0x0a9e('0x4'));var rp=require(_0x0a9e('0x5'));var logger=require(_0x0a9e('0x6'))(_0x0a9e('0x7'));var config=require(_0x0a9e('0x8'));var scripts=require('./scripts');var FILES_PATH=_0x0a9e('0x9');var recursiveMapAttributes=[_0x0a9e('0xa'),_0x0a9e('0xb')];var verticesWithRetry=['menu','getdigits',_0x0a9e('0xc')];var AGIVertices=function(_0x56465b,_0x52cace,_0x39753a){this[_0x0a9e('0xd')]=_0x56465b;this[_0x0a9e('0xe')]=_0x52cace;this[_0x0a9e('0xf')]=_0x39753a;};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x11')]=function(_0x4a4c56,_0x50dfb2){this['rpc']['getVariableById'](_0x4a4c56)[_0x0a9e('0x12')](function(_0x36471c){_0x50dfb2(null,_0x36471c?_0x36471c[_0x0a9e('0x13')]:![]);})[_0x0a9e('0x14')](function(_0x32d742){_0x50dfb2(_0x32d742);});};AGIVertices[_0x0a9e('0x10')]['getVoiceQueue']=function(_0x4283ce,_0x239b12){this[_0x0a9e('0xe')][_0x0a9e('0x15')](_0x4283ce)[_0x0a9e('0x12')](function(_0x4d5611){_0x239b12(null,_0x4d5611?_0x4d5611['name']:![]);})[_0x0a9e('0x14')](function(_0x5d0880){_0x239b12(_0x5d0880);});};AGIVertices[_0x0a9e('0x10')]['getSquareProject']=function(_0x16033c,_0x12066b){this['rpc'][_0x0a9e('0x16')](_0x16033c)['then'](function(_0x459eb1){_0x12066b(null,_0x459eb1?_0x459eb1[_0x0a9e('0x13')]:![]);})[_0x0a9e('0x14')](function(_0x205fd6){_0x12066b(_0x205fd6);});};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x17')]=function(_0x530eb7,_0x20559e){this[_0x0a9e('0xe')][_0x0a9e('0x18')](_0x530eb7)[_0x0a9e('0x12')](function(_0x105080){_0x20559e(null,_0x105080?_0x105080['dsn']:![]);})[_0x0a9e('0x14')](function(_0x155cce){_0x20559e(_0x155cce);});};AGIVertices['prototype'][_0x0a9e('0x19')]=function(_0x5a09ef,_0x588269){this[_0x0a9e('0xe')][_0x0a9e('0x1a')](_0x5a09ef)[_0x0a9e('0x12')](function(_0x30bae6){_0x588269(null,_0x30bae6?_0x30bae6['name']:![]);})[_0x0a9e('0x14')](function(_0x2fb0e4){_0x588269(_0x2fb0e4);});};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x1b')]=function(_0x370d86,_0x42ac8f){this[_0x0a9e('0xe')]['getTrunkById'](_0x370d86)['then'](function(_0x197ec0){_0x42ac8f(null,_0x197ec0?_0x197ec0[_0x0a9e('0x13')]:![]);})[_0x0a9e('0x14')](function(_0x33161b){_0x42ac8f(_0x33161b);});};AGIVertices['prototype'][_0x0a9e('0x1c')]=function(_0x479bc4,_0x45a1e7){var _0x5bfb33=this;this[_0x0a9e('0xe')][_0x0a9e('0x1d')](_0x479bc4)[_0x0a9e('0x12')](function(_0x14433c){_0x45a1e7(null,_0x14433c?_0x5bfb33[_0x0a9e('0x1e')](_0x14433c[_0x0a9e('0x1f')]):![]);})[_0x0a9e('0x14')](function(_0x14de77){_0x45a1e7(_0x14de77);});};AGIVertices['prototype'][_0x0a9e('0x20')]=function(_0x468813,_0x2b1f27){this[_0x0a9e('0xe')]['getMailAccountById'](_0x468813)[_0x0a9e('0x12')](function(_0x40e7a3){_0x2b1f27(null,_0x40e7a3?_0x40e7a3:![]);})[_0x0a9e('0x14')](function(_0x824a4f){_0x2b1f27(_0x824a4f);});};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x21')]=function(_0x296f41,_0x2e8759,_0x1dbde2){this['mailRpc'][_0x0a9e('0x21')](_0x296f41,_0x2e8759)['then'](function(){_0x1dbde2(null);})[_0x0a9e('0x14')](function(_0x3ae878){_0x1dbde2(_0x3ae878);});};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x22')]=function(_0x25ce3a,_0x5180f1){this[_0x0a9e('0xe')][_0x0a9e('0x23')](_0x25ce3a)[_0x0a9e('0x12')](function(_0x2da5c0){if(_0x2da5c0){if(_0x2da5c0[_0x0a9e('0x24')]){_0x5180f1(null,[_0x2da5c0[_0x0a9e('0x25')]]);}else{_0x5180f1(null,_[_0x0a9e('0x26')](_0x2da5c0[_0x0a9e('0x27')],'interval'));}}else{_0x5180f1(null,![]);}})[_0x0a9e('0x14')](function(_0x5e7238){_0x5180f1(_0x5e7238);});};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x1e')]=function(_0x2b7e7f){return util[_0x0a9e('0x28')]('%s/sounds/converted/%s',FILES_PATH,_0x2b7e7f);};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x29')]=function(_0x1fa90d,_0x15de0e,_0x4853b1){odbc['open'](_0x1fa90d,function(_0x1e8694){if(_0x1e8694){logger['error'](_0x0a9e('0x2a'),_0x1e8694);_0x4853b1(_0x1e8694);}else{logger[_0x0a9e('0x2b')](_0x0a9e('0x2c'));odbc[_0x0a9e('0x2d')](_0x15de0e,function(_0x4f41ae,_0x31916f){if(_0x4f41ae){logger[_0x0a9e('0x2b')](_0x0a9e('0x2e'),_0x15de0e);_0x4853b1(_0x4f41ae);}else{logger['info'](_0x0a9e('0x2f'),_0x15de0e);odbc[_0x0a9e('0x30')](function(_0x289467){if(_0x289467){logger['error']('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x289467);}_0x4853b1(null,_0x31916f);});}});}});};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x31')]=function(_0x5adda1,_0x2b814e){this[_0x0a9e('0xe')][_0x0a9e('0x32')](_0x5adda1)[_0x0a9e('0x12')](function(_0x4b38d9){_0x2b814e(null,_0x4b38d9?_0x4b38d9:![]);})['catch'](function(_0x15e37d){_0x2b814e(_0x15e37d);});};AGIVertices[_0x0a9e('0x10')]['createSmsMessage']=function(_0x183991,_0x1dec2e){this[_0x0a9e('0xe')]['createSmsMessage'](_0x183991)[_0x0a9e('0x12')](function(_0x2cfea9){_0x1dec2e(null,_0x2cfea9);})[_0x0a9e('0x14')](function(_0x43dd5b){_0x1dec2e(_0x43dd5b);});};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x33')]=function(_0x2881b3,_0x45a9b8,_0x23b089){this[_0x0a9e('0xe')][_0x0a9e('0x33')]({'uniqueid':this[_0x0a9e('0xd')][_0x0a9e('0x34')],'node':_0x2881b3[_0x0a9e('0x35')],'application':_0x2881b3[_0x0a9e('0x36')],'data':_0x45a9b8||null,'project_name':this['channel']['arg_1'],'callerid':this[_0x0a9e('0xd')][_0x0a9e('0x37')]})[_0x0a9e('0x12')](function(_0x315881){if(_0x23b089){_0x23b089(null,_0x315881);}})[_0x0a9e('0x14')](function(_0xc9a702){if(_0x23b089){_0x23b089(_0xc9a702);}});};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x38')]=function(_0x432fcc,_0x25c6e6,_0x2c2cb0,_0x35ed4a){this['rpc'][_0x0a9e('0x38')]({'uniqueid':this[_0x0a9e('0xd')][_0x0a9e('0x34')],'callerid':this[_0x0a9e('0xd')][_0x0a9e('0x37')],'calleridname':this[_0x0a9e('0xd')][_0x0a9e('0x39')],'context':this[_0x0a9e('0xd')]['context'],'extension':this[_0x0a9e('0xd')]['extension'],'priority':this[_0x0a9e('0xd')][_0x0a9e('0x3a')],'accountcode':this[_0x0a9e('0xd')]['accountcode'],'dnid':this[_0x0a9e('0xd')][_0x0a9e('0x3b')],'projectName':this[_0x0a9e('0xd')][_0x0a9e('0x3c')],'saveName':_0x25c6e6,'filename':_0x432fcc[_0x0a9e('0x3d')]||_0x25c6e6,'savePath':_0x2c2cb0})[_0x0a9e('0x12')](function(_0x45bf7f){_0x35ed4a(null,_0x45bf7f);})['catch'](function(_0x13f44d){_0x35ed4a(_0x13f44d);});};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x3e')]=function(_0x16f976,_0x409789,_0x992c77){this[_0x0a9e('0xe')][_0x0a9e('0x3e')]({'uniqueid':this[_0x0a9e('0xd')]['uniqueid'],'body':_0x16f976,'direction':_0x409789})[_0x0a9e('0x12')](function(_0x3fe430){if(_0x992c77){_0x992c77(null,_0x3fe430);}})['catch'](function(_0x4ae14b){if(_0x992c77){_0x992c77(_0x4ae14b);}});};AGIVertices['prototype'][_0x0a9e('0x3f')]=function(_0x4317e3,_0x37edaa){this[_0x0a9e('0xe')][_0x0a9e('0x3f')]({'firstName':_[_0x0a9e('0x40')](_0x4317e3[_0x0a9e('0x13')])||_[_0x0a9e('0x41')](_0x4317e3['name'])?'callback_'+Math['random']():_0x4317e3[_0x0a9e('0x13')],'lastName':_[_0x0a9e('0x40')](_0x4317e3[_0x0a9e('0x42')])||_['isNil'](_0x4317e3[_0x0a9e('0x42')])?null:_0x4317e3[_0x0a9e('0x42')],'phone':_0x4317e3['phone'],'ListId':_0x4317e3['list_id'],'scheduledAt':_0x4317e3[_0x0a9e('0x43')],'callbackUniqueid':this['channel'][_0x0a9e('0x34')],'tags':'callback','description':_0x0a9e('0x44')+_0x4317e3[_0x0a9e('0x43')][_0x0a9e('0x45')](),'priority':_0x4317e3['callback_priority']})[_0x0a9e('0x12')](function(_0x1bf38a){_0x37edaa(null,_0x1bf38a);})['catch'](function(_0x50f687){_0x37edaa(_0x50f687);});};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x46')]=function(_0x49c095,_0x145931){this['rpc'][_0x0a9e('0x47')](_0x49c095)['then'](function(_0xe22ccc){_0x145931(null,_0xe22ccc?_0xe22ccc['name']:![]);})['catch'](function(_0x5df0ad){_0x145931(_0x5df0ad);});};AGIVertices[_0x0a9e('0x10')]['agentPause']=function(_0x2f7092,_0x65432,_0x3cfd00){var _0x19b4df={'role':_0x0a9e('0x48')};_0x19b4df[_0x2f7092]=this[_0x0a9e('0xd')][_0x0a9e('0x37')];this[_0x0a9e('0xe')]['agentPause'](_0x19b4df,_0x65432,this[_0x0a9e('0xd')][_0x0a9e('0x34')])[_0x0a9e('0x12')](function(_0x30c491){_0x3cfd00(null,_[_0x0a9e('0x41')](_0x30c491)?![]:!![]);})[_0x0a9e('0x14')](function(_0x5d86e9){logger[_0x0a9e('0x49')](_0x5d86e9);_0x3cfd00(null,![]);});};AGIVertices[_0x0a9e('0x10')]['agentUnpause']=function(_0x3649cc,_0x5cc8fb){var _0x20c668={'role':'agent'};_0x20c668[_0x3649cc]=this['channel']['callerid'];this[_0x0a9e('0xe')]['agentUnpause'](_0x20c668)[_0x0a9e('0x12')](function(_0x1fc70e){_0x5cc8fb(null,_[_0x0a9e('0x41')](_0x1fc70e)?![]:!![]);})[_0x0a9e('0x14')](function(_0x1cca9f){logger[_0x0a9e('0x49')](_0x1cca9f);_0x5cc8fb(null,![]);});};AGIVertices['prototype'][_0x0a9e('0x4a')]=function(_0x5854cc,_0xca4ade){var _0x1f07cb={'role':_0x0a9e('0x48')};_0x1f07cb[_0x5854cc]=this['channel'][_0x0a9e('0x37')];this[_0x0a9e('0xe')][_0x0a9e('0x4a')](_0x1f07cb)[_0x0a9e('0x12')](function(_0x497d91){_0xca4ade(null,_[_0x0a9e('0x41')](_0x497d91)?![]:!![]);})[_0x0a9e('0x14')](function(_0x54327c){logger[_0x0a9e('0x49')](_0x54327c);_0xca4ade(null,![]);});};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x4b')]=function(_0x409b29,_0x401837){var _0x4d4a35={'role':_0x0a9e('0x48')};_0x4d4a35[_0x409b29]=this[_0x0a9e('0xd')][_0x0a9e('0x37')];var _0x47bb43=_0x409b29!=_0x0a9e('0x4c')?util['format']('%s/%s@from-sip/n',_0x0a9e('0x4d'),this[_0x0a9e('0xd')][_0x0a9e('0x37')]):undefined;this[_0x0a9e('0xe')][_0x0a9e('0x4b')](_0x4d4a35,_0x47bb43)[_0x0a9e('0x12')](function(_0x387489){_0x401837(null,_[_0x0a9e('0x41')](_0x387489)?![]:!![]);})[_0x0a9e('0x14')](function(_0x1cc4f3){logger[_0x0a9e('0x49')](_0x1cc4f3);_0x401837(null,![]);});};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x4e')]=function(_0x2b8192,_0x320898){sh[_0x0a9e('0x4f')](_[_0x0a9e('0x50')](_0x2b8192),function(_0x4257c9,_0x5150a4){var _0x1b0b98=_0x5150a4[_0x0a9e('0x51')](/(\r\n|\n|\r)/gm,'');_0x320898(null,_0x1b0b98);});};AGIVertices[_0x0a9e('0x10')]['googleCloudTTS']=function(_0x1148a1,_0x30944e){scripts['googleCloudTTS'](_0x1148a1[_0x0a9e('0x52')],_0x1148a1[_0x0a9e('0x53')]||_0x0a9e('0x54'),_0x1148a1[_0x0a9e('0x54')],_0x1148a1[_0x0a9e('0x55')]||'en-US',_0x1148a1['ssmlGender']||'MALE',_0x1148a1[_0x0a9e('0x56')]||_0x0a9e('0x57'))[_0x0a9e('0x12')](function(_0x23a7d3){_0x30944e(null,_0x23a7d3);})[_0x0a9e('0x14')](function(_0x380ab3){_0x30944e(_0x380ab3);});};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x58')]=function(_0x5512d1,_0x235f8f){scripts[_0x0a9e('0x58')](_0x5512d1[_0x0a9e('0x54')],_0x5512d1['google_tts_language']||'en',0x1)[_0x0a9e('0x12')](function(_0x583b2e){_0x235f8f(null,_0x583b2e);})[_0x0a9e('0x14')](function(_0x44351d){_0x235f8f(_0x44351d);});};AGIVertices['prototype'][_0x0a9e('0x59')]=function(_0x75912a,_0x2cc7a7){var _0x317c0c={'uri':_0x75912a['url'],'method':_0x75912a[_0x0a9e('0x5a')],'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x75912a[_0x0a9e('0x5b')])===_0x0a9e('0x5c')&&parseInt(_0x75912a[_0x0a9e('0x5b')])>=0x1?parseInt(_0x75912a['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x0a9e('0x5d')]([_0x0a9e('0x5e'),_0x0a9e('0x5f')],_0x317c0c[_0x0a9e('0x5a')]['toUpperCase']())){try{_0x317c0c[_0x0a9e('0x60')]=_0x75912a[_0x0a9e('0xb')]?JSON[_0x0a9e('0x61')](_0x75912a[_0x0a9e('0xb')]):{};}catch(_0x332367){logger[_0x0a9e('0x49')](_0x0a9e('0x62'),_0x332367);}}try{_0x317c0c[_0x0a9e('0x63')]=_0x75912a[_0x0a9e('0xa')]?JSON[_0x0a9e('0x61')](_0x75912a[_0x0a9e('0xa')]):{};}catch(_0x1f10ef){logger[_0x0a9e('0x49')](_0x0a9e('0x64'),_0x1f10ef);}if(_0x75912a['computedVariables']){try{var _0xf4120f=require(_0x75912a[_0x0a9e('0x65')])[_0x0a9e('0x66')](this,_0x317c0c);_0x317c0c['uri']=Mustache[_0x0a9e('0x67')](_0x75912a[_0x0a9e('0x68')],_0xf4120f,{},['$$','$$']);if(_0x317c0c[_0x0a9e('0x63')]){_0x317c0c[_0x0a9e('0x63')]=JSON['parse'](Mustache['render'](JSON[_0x0a9e('0x69')](_0x317c0c[_0x0a9e('0x63')]),_0xf4120f,{},['$$','$$']));}if(_0x317c0c['body']){_0x317c0c[_0x0a9e('0x60')]=JSON['parse'](Mustache[_0x0a9e('0x67')](JSON[_0x0a9e('0x69')](_0x317c0c['body']),_0xf4120f,{},['$$','$$']));}}catch(_0x28a942){logger[_0x0a9e('0x49')](_0x0a9e('0x6a'),_0x28a942);}}rp(_0x317c0c)[_0x0a9e('0x12')](function(_0x3755fe){var _0x1f42a0={'statusCode':_0x3755fe[_0x0a9e('0x6b')]||0xc8,'statusMessage':_0x3755fe['statusMessage']||'OK','headers':_0x3755fe[_0x0a9e('0x63')]||{},'body':_0x3755fe[_0x0a9e('0x60')]||{}};_0x2cc7a7(null,_0x1f42a0);})[_0x0a9e('0x14')](function(_0x16e5b9){var _0x492543={'statusCode':_0x16e5b9[_0x0a9e('0x6b')]||0x1f4,'statusMessage':_0x16e5b9[_0x0a9e('0x6c')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x16e5b9[_0x0a9e('0x6d')]['headers']||{},'body':_0x16e5b9[_0x0a9e('0x6d')][_0x0a9e('0x60')]||{}};_0x2cc7a7(null,_0x492543);});};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x6e')]=function(_0x5af453,_0x51ccd7){scripts[_0x0a9e('0x6e')](this[_0x0a9e('0xd')][_0x0a9e('0x34')],_0x5af453['key'],_0x5af453[_0x0a9e('0x54')],_0x5af453[_0x0a9e('0x6f')]||'en')['then'](function(_0x4e46b2){_0x51ccd7(null,_0x4e46b2);})[_0x0a9e('0x14')](function(_0x56acca){_0x51ccd7(_0x56acca);});};AGIVertices['prototype']['sestekNDA']=function(_0x81d748,_0xf3601c){scripts[_0x0a9e('0x70')](this[_0x0a9e('0xd')],_0x81d748)[_0x0a9e('0x12')](function(_0x2600de){_0xf3601c(null,_0x2600de);})['catch'](function(_0x5fd5db){_0xf3601c(_0x5fd5db);});};AGIVertices['prototype'][_0x0a9e('0x71')]=function(_0x2aabab,_0x18ad56){scripts[_0x0a9e('0x71')](_0x2aabab['key'],_0x2aabab[_0x0a9e('0x54')],_0x2aabab[_0x0a9e('0x72')]||_0x0a9e('0x73'),_0x2aabab['speed'])[_0x0a9e('0x12')](function(_0x21e592){_0x18ad56(null,_0x21e592);})[_0x0a9e('0x14')](function(_0x22063c){_0x18ad56(_0x22063c);});};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x74')]=function(_0x32b9bd,_0x11ac43,_0x509efe){scripts[_0x0a9e('0x74')](_0x11ac43,_0x32b9bd[_0x0a9e('0x75')],_0x32b9bd['ispeech_asr_language']||_0x0a9e('0x73'),this[_0x0a9e('0x76')](_0x32b9bd[_0x0a9e('0x77')])?_0x32b9bd['model']:undefined)[_0x0a9e('0x12')](function(_0x52ec10){_0x509efe(null,_0x52ec10);})[_0x0a9e('0x14')](function(_0x2b5148){_0x509efe(_0x2b5148);});};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x78')]=function(_0x842d6f,_0x16341a){scripts[_0x0a9e('0x78')](_0x842d6f[_0x0a9e('0x79')],_0x842d6f['aws_secret_access_key'],_0x842d6f[_0x0a9e('0x7a')],_0x842d6f[_0x0a9e('0x7b')]||_0x0a9e('0x7c'),_0x842d6f[_0x0a9e('0x54')],_0x842d6f[_0x0a9e('0x7d')]||_0x0a9e('0x54'))[_0x0a9e('0x12')](function(_0x33f0c9){_0x16341a(null,_0x33f0c9);})[_0x0a9e('0x14')](function(_0x31af8c){_0x16341a(_0x31af8c);});};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x7e')]=function(_0x18273f,_0x4989f9){scripts[_0x0a9e('0x7e')](this[_0x0a9e('0xd')][_0x0a9e('0x34')],_0x18273f[_0x0a9e('0x79')],_0x18273f[_0x0a9e('0x7f')],_0x18273f['aws_lex_region'],_0x18273f[_0x0a9e('0x54')],_0x18273f[_0x0a9e('0x80')])['then'](function(_0x23b447){_0x4989f9(null,_0x23b447);})['catch'](function(_0x45d113){_0x4989f9(_0x45d113);});};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x81')]=function(_0xf8c6c4,_0x4f4d2d,_0x3ceba6){scripts['googleASR'](_0x4f4d2d,_0xf8c6c4[_0x0a9e('0x75')],_0xf8c6c4[_0x0a9e('0x82')]||'en-US')[_0x0a9e('0x12')](function(_0x63c9f7){_0x3ceba6(null,_0x63c9f7);})[_0x0a9e('0x14')](function(_0x4ab276){_0x3ceba6(_0x4ab276);});};AGIVertices['prototype'][_0x0a9e('0x83')]=function(_0x6ba2be,_0x1707dc,_0x413190){scripts[_0x0a9e('0x83')](_0x1707dc,_0x6ba2be[_0x0a9e('0x84')],_0x6ba2be[_0x0a9e('0x85')],_0x6ba2be[_0x0a9e('0x86')])[_0x0a9e('0x12')](function(_0x586510){_0x413190(null,_0x586510);})[_0x0a9e('0x14')](function(_0x517081){_0x413190(_0x517081);});};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x87')]=function(_0x34e745){var _0x28ce92=_[_0x0a9e('0x5d')](verticesWithRetry,_0x34e745['agicommand'])?_0x34e745:_[_0x0a9e('0x88')](_0x34e745);for(var _0x4667bf in _0x28ce92){if(_0x28ce92[_0x0a9e('0x89')](_0x4667bf)){if(_0x28ce92[_0x4667bf]&&_[_0x0a9e('0x8a')](_0x28ce92[_0x4667bf])){if(_[_0x0a9e('0x5d')](recursiveMapAttributes,_0x4667bf)){_0x28ce92[_0x4667bf]=this['replaceObjectAllVariables'](_0x28ce92[_0x4667bf]);}else{_0x28ce92[_0x4667bf]=this['replaceAllVariables'](_0x28ce92[_0x4667bf]);}}}}return _0x28ce92;};AGIVertices[_0x0a9e('0x10')]['recursiveNodeIndex']=function(_0x25eae0){for(var _0x4658df in _0x25eae0){if(_0x25eae0[_0x0a9e('0x89')](_0x4658df)){if(_[_0x0a9e('0x8b')](_0x25eae0[_0x4658df])){this[_0x0a9e('0x8c')](_0x25eae0[_0x4658df]);}else if(_[_0x0a9e('0x8d')](_0x25eae0[_0x4658df])){for(var _0x596312=0x0;_0x596312<_0x25eae0[_0x4658df]['length'];_0x596312++){this[_0x0a9e('0x8c')](_0x25eae0[_0x4658df][_0x596312]);}}else if(_['isString'](_0x25eae0[_0x4658df])){_0x25eae0[_0x4658df]=this[_0x0a9e('0x8e')](_0x25eae0[_0x4658df]);}}}};AGIVertices['prototype'][_0x0a9e('0x8f')]=function(_0x564db2,_0x558d60){for(var _0x1c49dc in _0x564db2){if(_0x564db2[_0x0a9e('0x89')](_0x1c49dc)){if(_['isPlainObject'](_0x564db2[_0x1c49dc])){if(!_[_0x0a9e('0x40')](_0x564db2[_0x1c49dc])){this[_0x0a9e('0x8f')](_0x564db2[_0x1c49dc],util[_0x0a9e('0x28')](_0x0a9e('0x90'),_0x558d60,_0x1c49dc));}}else{if(_0x564db2[_0x1c49dc]){this[_0x0a9e('0xd')]['setVariable'](util['format'](_0x0a9e('0x90'),_0x558d60,_0x1c49dc),_0x564db2[_0x1c49dc]);}}}}};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x91')]=function(_0x24beb6){try{var _0x59303b=JSON['parse'](_0x24beb6);this[_0x0a9e('0x8c')](_0x59303b);return JSON[_0x0a9e('0x69')](_0x59303b);}catch(_0x5416a9){return this[_0x0a9e('0x8e')](_0x24beb6);}};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x8e')]=function(_0x2427d5){var _0x23b25b=_0x2427d5[_0x0a9e('0x92')]('{');for(var _0x1ef1b0=0x1;_0x1ef1b0<_0x23b25b[_0x0a9e('0x93')];_0x1ef1b0+=0x1){var _0x40dd2a=_0x23b25b[_0x1ef1b0][_0x0a9e('0x92')]('}');if(_0x40dd2a['length']>0x1){_0x2427d5=_0x2427d5[_0x0a9e('0x94')]('{'+_0x40dd2a[0x0]+'}',this[_0x0a9e('0xd')][_0x0a9e('0x11')](_0x40dd2a[0x0])[_0x0a9e('0x95')]||_0x40dd2a[0x0]);}}if(_0x23b25b[_0x0a9e('0x93')]===0x1){return _0x2427d5['toString']();}return this['replaceAllVariables'](_0x2427d5);};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x96')]=function(_0x466bbf,_0x2fea95){var _0x34f7b5=this['channel'][_0x0a9e('0x11')](_0x466bbf);if(_0x34f7b5[_0x0a9e('0x97')]===-0x1){return _0x34f7b5;}logger[_0x0a9e('0x2b')](util['format'](_0x0a9e('0x98'),_0x2fea95,_0x34f7b5['extra']));return this[_0x0a9e('0xd')]['setVariable'](_0x2fea95,_0x34f7b5[_0x0a9e('0x95')]);};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x76')]=function(_0x5c500c){return _0x5c500c&&_0x5c500c!=='0'&&_0x5c500c!=='-1'&&_0x5c500c!=='';};AGIVertices[_0x0a9e('0x10')]['maxRetry']=function(_0x4383da){this[_0x0a9e('0x33')][_0x0a9e('0x66')](this,_0x4383da,'-');_0x4383da[_0x0a9e('0x99')]=_0x4383da[_0x0a9e('0x9a')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x7')]=function(_0xe89aaa){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')](_0x0a9e('0x9b'),_0xe89aaa[_0x0a9e('0x35')]));return this[_0x0a9e('0xd')][_0x0a9e('0x7')]([_0xe89aaa[_0x0a9e('0x9c')],_0xe89aaa[_0x0a9e('0x9d')]]);};AGIVertices['prototype']['answer']=function(_0x6eaaf0){logger['info'](util[_0x0a9e('0x28')](_0x0a9e('0x9e'),_0x6eaaf0['label']));if(this[_0x0a9e('0x76')](_0x6eaaf0[_0x0a9e('0x5b')])){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x6eaaf0[_0x0a9e('0x5b')]));var _0x26cb76=this[_0x0a9e('0xd')][_0x0a9e('0x9f')](_0x6eaaf0['timeout']);if(_0x26cb76[_0x0a9e('0x97')]===-0x1){return _0x26cb76;}}return this[_0x0a9e('0xd')][_0x0a9e('0xa0')]();};AGIVertices['prototype'][_0x0a9e('0xa1')]=function(_0x270df8){logger[_0x0a9e('0x2b')](util['format'](_0x0a9e('0xa2'),_0x270df8[_0x0a9e('0x35')]));if(!this[_0x0a9e('0x76')](_0x270df8[_0x0a9e('0xa3')])){return this[_0x0a9e('0xd')]['error'](_0x270df8,_0x0a9e('0xa4'));}_0x270df8[_0x0a9e('0x43')]=moment();if(this['isConfigured'](_0x270df8[_0x0a9e('0xa5')])){_0x270df8[_0x0a9e('0x43')]=moment()[_0x0a9e('0xa6')](_0x270df8['delay'],'minutes');}if(!this['isConfigured'](_0x270df8[_0x0a9e('0xa7')])){_0x270df8[_0x0a9e('0xa7')]=0x2;}this['createCmContact'][_0x0a9e('0x66')](this,_0x270df8);return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](util['format'](_0x0a9e('0xa9'),_0x270df8[_0x0a9e('0xaa')],_0x270df8[_0x0a9e('0xa3')],_0x270df8[_0x0a9e('0x43')]));};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0xab')]=function(_0x40e6e7){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x40e6e7[_0x0a9e('0x35')]));var _0x5526a7=this[_0x0a9e('0xd')][_0x0a9e('0x4f')](_0x40e6e7[_0x0a9e('0xac')],_0x40e6e7[_0x0a9e('0x6d')]);if(_0x5526a7[_0x0a9e('0x97')]===-0x1){return _0x5526a7;}return this[_0x0a9e('0xd')]['noop'](util[_0x0a9e('0x28')](_0x0a9e('0xad'),_0x40e6e7[_0x0a9e('0xac')],_0x40e6e7[_0x0a9e('0x6d')]));};AGIVertices['prototype'][_0x0a9e('0xae')]=function(_0x3c9135){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')](_0x0a9e('0xaf'),_0x3c9135[_0x0a9e('0x35')]));if(!this[_0x0a9e('0x76')](_0x3c9135[_0x0a9e('0x54')])){return this[_0x0a9e('0xd')][_0x0a9e('0xa8')]('no\x20text\x20configured');}var _0x2272bc='\x22'+_0x3c9135[_0x0a9e('0x54')]+'\x22';if(this[_0x0a9e('0x76')](_0x3c9135[_0x0a9e('0x6d')])){_0x2272bc+=','+_0x3c9135[_0x0a9e('0x6d')];}var _0x253f74=this[_0x0a9e('0xd')][_0x0a9e('0x4f')]('MRCPSynth',_0x2272bc);if(_0x253f74[_0x0a9e('0x97')]===-0x1){return _0x253f74;}return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](util['format'](_0x0a9e('0xb0'),_0x2272bc));};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0xb1')]=function(_0x97d5b5){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')](_0x0a9e('0xb2'),_0x97d5b5[_0x0a9e('0x35')]));if(!this[_0x0a9e('0x76')](_0x97d5b5[_0x0a9e('0x54')])){return this['channel'][_0x0a9e('0xa8')](_0x0a9e('0xb3'));}var _0x15a9ed='\x22'+_0x97d5b5[_0x0a9e('0x54')]+'\x22';if(this[_0x0a9e('0x76')](_0x97d5b5[_0x0a9e('0x6d')])){_0x15a9ed+=','+_0x97d5b5['options'];}var _0x382687=this['channel']['exec']('MRCPSynth',_0x15a9ed);if(_0x382687[_0x0a9e('0x97')]===-0x1){return _0x382687;}return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](util[_0x0a9e('0x28')]('Executed\x20command\x20MRCPSynth\x20%s',_0x15a9ed));};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0xb4')]=function(_0x3ddbc7){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x3ddbc7['label']));if(!this[_0x0a9e('0x76')](_0x3ddbc7[_0x0a9e('0xb5')])){return this[_0x0a9e('0xd')]['noop'](_0x0a9e('0xb6'));}var _0x248a9a=_0x3ddbc7[_0x0a9e('0xb5')];if(this['isConfigured'](_0x3ddbc7[_0x0a9e('0x6d')])){_0x248a9a+=','+_0x3ddbc7[_0x0a9e('0x6d')];}var _0x15ba6b=this['channel'][_0x0a9e('0x4f')](_0x0a9e('0xb7'),_0x248a9a);if(_0x15ba6b[_0x0a9e('0x97')]===-0x1){return _0x15ba6b;}var _0x549e03=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0x0a9e('0xb8'));if(_0x549e03[_0x0a9e('0x97')]===-0x1){return _0x549e03;}var _0xcbc73c=this[_0x0a9e('0x96')]('RECOG_INPUT()',_0x0a9e('0xb9'));if(_0xcbc73c['result']===-0x1){return _0xcbc73c;}var _0x3b4af9=this[_0x0a9e('0x96')](_0x0a9e('0xba'),'LUMENVOX_ASR_INSTANCE');if(_0x3b4af9[_0x0a9e('0x97')]===-0x1){return _0x3b4af9;}return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](util['format'](_0x0a9e('0xbb'),_0x248a9a));};AGIVertices['prototype'][_0x0a9e('0xbc')]=function(_0x5c57e1){logger[_0x0a9e('0x2b')](util['format'](_0x0a9e('0xbd'),_0x5c57e1[_0x0a9e('0x35')]));if(!this[_0x0a9e('0x76')](_0x5c57e1[_0x0a9e('0xb5')])){return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](_0x0a9e('0xb6'));}var _0x5acdc9=_0x5c57e1[_0x0a9e('0xb5')];if(this[_0x0a9e('0x76')](_0x5c57e1['options'])){_0x5acdc9+=','+_0x5c57e1[_0x0a9e('0x6d')];}var _0x3753ca=this['channel'][_0x0a9e('0x4f')](_0x0a9e('0xb7'),_0x5acdc9);if(_0x3753ca[_0x0a9e('0x97')]===-0x1){return _0x3753ca;}var _0x569528=this[_0x0a9e('0x96')](_0x0a9e('0xbe'),_0x0a9e('0xbf'));if(_0x569528[_0x0a9e('0x97')]===-0x1){return _0x569528;}var _0x2003bc=this[_0x0a9e('0x96')](_0x0a9e('0xc0'),_0x0a9e('0xc1'));if(_0x2003bc[_0x0a9e('0x97')]===-0x1){return _0x2003bc;}var _0x426c3c=this['getAndSetVariable'](_0x0a9e('0xba'),'SESTEK_ASR_INSTANCE');if(_0x426c3c[_0x0a9e('0x97')]===-0x1){return _0x426c3c;}return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](util[_0x0a9e('0x28')](_0x0a9e('0xbb'),_0x5acdc9));};AGIVertices[_0x0a9e('0x10')]['database']=function(_0x119708){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x119708[_0x0a9e('0x35')]));if(!this[_0x0a9e('0x76')](_0x119708[_0x0a9e('0xc2')])){return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x119708,_0x0a9e('0xc3'));}var _0x1e93f5=this['getSquareOdbc'][_0x0a9e('0x66')](this,_0x119708[_0x0a9e('0xc2')]);if(!_0x1e93f5){return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x119708,_0x0a9e('0xc4'));}if(!this[_0x0a9e('0x76')](_0x119708[_0x0a9e('0x2d')])){return this['channel']['error'](_0x119708,_0x0a9e('0xc5'));}var _0x3f507c=_0x119708[_0x0a9e('0x2d')][_0x0a9e('0x51')](/(\r\n|\n|\r)/gm,'\x20');this[_0x0a9e('0xd')][_0x0a9e('0xa8')](util[_0x0a9e('0x28')]('query:\x20%s',_0x3f507c));var _0x39ea62=this[_0x0a9e('0x29')][_0x0a9e('0x66')](this,_0x1e93f5,_0x3f507c);this[_0x0a9e('0x33')][_0x0a9e('0x66')](this,_0x119708,_0x3f507c);if(!this[_0x0a9e('0x76')](_0x119708[_0x0a9e('0xc6')])){return this['channel'][_0x0a9e('0xa8')](_0x0a9e('0xc7'));}var _0x231826=this['getVariable'][_0x0a9e('0x66')](this,_0x119708[_0x0a9e('0xc6')]);if(!_0x231826){return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x119708,'no\x20variable\x20found');}var _0x38892b=this;var _0xcbbea0=0x0;if(_0x39ea62[_0x0a9e('0x93')]){_0xcbbea0=_0x39ea62[_0x0a9e('0x93')];_0x39ea62[_0x0a9e('0xc8')](function(_0x20c130,_0x3e365c){Object[_0x0a9e('0xc9')](_0x20c130)['forEach'](function(_0x3ede01){_0x38892b[_0x0a9e('0xd')][_0x0a9e('0xca')](util[_0x0a9e('0x28')]('%s[%s][%s]',_0x231826,_0x3e365c,_0x3ede01),_0x20c130[_0x3ede01]);});});}this['channel'][_0x0a9e('0xca')](util[_0x0a9e('0x28')](_0x0a9e('0xcb'),_0x231826),_0xcbbea0);return this['channel'][_0x0a9e('0xa8')](util[_0x0a9e('0x28')]('variable\x20%s\x20set',_0x231826));};AGIVertices[_0x0a9e('0x10')]['dial']=function(_0x35cc2a){logger['debug'](util['format']('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x35cc2a[_0x0a9e('0x35')]));if(!this[_0x0a9e('0x76')](_0x35cc2a[_0x0a9e('0xcc')])){return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x35cc2a,_0x0a9e('0xcd'));}var _0x48fbef=this[_0x0a9e('0x19')][_0x0a9e('0x66')](this,_0x35cc2a[_0x0a9e('0xcc')]);if(!_0x48fbef){return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x35cc2a,_0x0a9e('0xce'));}var _0x31c937=this['channel']['exec'](_0x0a9e('0xcf'),[util['format'](_0x0a9e('0xd0'),_0x48fbef),_0x35cc2a[_0x0a9e('0x5b')],_0x35cc2a[_0x0a9e('0xd1')],_0x35cc2a[_0x0a9e('0x68')]]);if(_0x31c937[_0x0a9e('0x97')]===-0x1){return _0x31c937;}return this[_0x0a9e('0xd')]['noop'](util[_0x0a9e('0x28')]('Executed\x20command\x20%s','DIAL'));};AGIVertices[_0x0a9e('0x10')]['dialogflow']=function(_0x38dceb){logger['info'](util['format'](_0x0a9e('0xd2'),_0x38dceb['label']));if(!this[_0x0a9e('0x76')](_0x38dceb[_0x0a9e('0x75')])){return this[_0x0a9e('0xd')]['noop'](_0x0a9e('0xd3'));}if(!this[_0x0a9e('0x76')](_0x38dceb[_0x0a9e('0x54')])){return this['channel']['noop'](_0x0a9e('0xb3'));}this[_0x0a9e('0xd')][_0x0a9e('0xd4')]=!![];this[_0x0a9e('0x33')](_0x38dceb);this[_0x0a9e('0x3e')](_0x38dceb[_0x0a9e('0x54')],'in');this[_0x0a9e('0xd')][_0x0a9e('0xa8')](util[_0x0a9e('0x28')](_0x0a9e('0xd5'),_0x38dceb['text']));var _0x51fa33=this['googleDialogflow'][_0x0a9e('0x66')](this,_0x38dceb);if(_0x51fa33){for(var _0x19dcc2 in _0x51fa33){if(_0x51fa33[_0x0a9e('0x89')](_0x19dcc2)){this[_0x0a9e('0xd')][_0x0a9e('0xca')](util[_0x0a9e('0x28')](_0x0a9e('0xd6'),_0x19dcc2[_0x0a9e('0xd7')]()),_0x51fa33[_0x19dcc2]);}}this['createSquareMessage'](_0x51fa33['speech'],_0x0a9e('0xd8'));return this[_0x0a9e('0xd')]['noop'](util[_0x0a9e('0x28')](_0x0a9e('0xd9'),_0x51fa33[_0x0a9e('0xda')]));}return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x38dceb,_0x0a9e('0xdb'));};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0xdc')]=function(_0x59f8f7){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')](_0x0a9e('0xdd'),_0x59f8f7['label']));if(!this[_0x0a9e('0x76')](_0x59f8f7[_0x0a9e('0xde')])){return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](_0x0a9e('0xdf'));}if(!this[_0x0a9e('0x76')](_0x59f8f7[_0x0a9e('0xe0')])){return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](_0x0a9e('0xe1'));}if(!this[_0x0a9e('0x76')](_0x59f8f7[_0x0a9e('0xe2')])){return this['channel']['noop'](_0x0a9e('0xe3'));}if(!this[_0x0a9e('0x76')](_0x59f8f7[_0x0a9e('0xe4')])){return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](_0x0a9e('0xb3'));}this[_0x0a9e('0xd')]['bot']=!![];this[_0x0a9e('0x33')](_0x59f8f7);this['createSquareMessage'](_0x59f8f7[_0x0a9e('0x54')],'in');this[_0x0a9e('0xd')][_0x0a9e('0xa8')](util[_0x0a9e('0x28')](_0x0a9e('0xe5'),_0x59f8f7[_0x0a9e('0x54')]));var _0x465003=this[_0x0a9e('0x70')][_0x0a9e('0x66')](this,_0x59f8f7);if(_0x465003){for(var _0x32a199 in _0x465003){if(_0x465003[_0x0a9e('0x89')](_0x32a199)){this[_0x0a9e('0xd')][_0x0a9e('0xca')](util[_0x0a9e('0x28')](_0x0a9e('0xe6'),_0x32a199[_0x0a9e('0xd7')]()),_0x465003[_0x32a199]);}}this['createSquareMessage'](_0x465003['speech'],_0x0a9e('0xd8'));if(_0x465003[_0x0a9e('0xe7')]){this['channel']['noop'](util[_0x0a9e('0x28')](_0x0a9e('0xe8'),_0x465003[_0x0a9e('0xe7')]));var _0x596178=this[_0x0a9e('0xd')]['streamFile'](_0x465003[_0x0a9e('0xe7')]);try{fs['unlink'](_0x465003[_0x0a9e('0xe7')]+'.wav');}catch(_0x122e7d){logger[_0x0a9e('0x49')](_0x122e7d);}return _0x596178;}else{return this[_0x0a9e('0xd')]['noop'](util[_0x0a9e('0x28')]('SestekNDA\x20Result\x20%s',_0x465003['speech']));}}return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x59f8f7,_0x0a9e('0xe9'));};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0xea')]=function(_0x7b05ba){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')](_0x0a9e('0xeb'),_0x7b05ba[_0x0a9e('0x35')]));return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](_0x0a9e('0xea'));};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0xec')]=function(_0x65141c){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')](_0x0a9e('0xed'),_0x65141c['label']));var _0x233e48='';if(_0x65141c[_0x0a9e('0xee')]){if(!this[_0x0a9e('0x76')](_0x65141c[_0x0a9e('0xee')])){return this['channel']['error'](_0x65141c,'no\x20trunk\x20selected');}else{var _0x2b8823=parseInt(_0x65141c['trunk_id'],0xa);if(isNaN(_0x2b8823)){_0x233e48=_0x65141c[_0x0a9e('0xee')];}else{_0x233e48=this[_0x0a9e('0x1b')][_0x0a9e('0x66')](this,_0x65141c[_0x0a9e('0xee')]);if(!_0x233e48){return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x65141c,_0x0a9e('0xef'));}}}}else if(_0x65141c[_0x0a9e('0xf0')]){_0x233e48=_0x65141c[_0x0a9e('0xf0')];}else{return this[_0x0a9e('0xd')]['error'](_0x65141c,_0x0a9e('0xf1'));}var _0x47a018=this[_0x0a9e('0xd')]['exec'](_0x0a9e('0xcf'),[util[_0x0a9e('0x28')](_0x0a9e('0xf2'),_0x233e48,_0x65141c['phone']),_0x65141c[_0x0a9e('0x5b')],_0x65141c[_0x0a9e('0xd1')],_0x65141c['url']]);if(_0x47a018['result']===-0x1){return _0x47a018;}return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](util[_0x0a9e('0x28')]('Executed\x20command\x20%s','DIAL'));};AGIVertices['prototype'][_0x0a9e('0xf3')]=function(_0x22c591){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')](_0x0a9e('0xf4'),_0x22c591[_0x0a9e('0x35')]));return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](_0x0a9e('0xf3'));};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0xf5')]=function(_0x2f4de1){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')](_0x0a9e('0xf6'),_0x2f4de1[_0x0a9e('0x35')]));if(_0x2f4de1[_0x0a9e('0x99')]===0x0){return this[_0x0a9e('0x9a')](_0x2f4de1);}_0x2f4de1['retry']-=0x1;if(!this[_0x0a9e('0x76')](_0x2f4de1[_0x0a9e('0xf7')])){return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x2f4de1,_0x0a9e('0xf8'));}var _0x37d5c9=this['getSound'][_0x0a9e('0x66')](this,_0x2f4de1[_0x0a9e('0xf7')]);if(!_0x37d5c9){return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x2f4de1,_0x0a9e('0xf9'));}if(!this[_0x0a9e('0x76')](_0x2f4de1[_0x0a9e('0xc6')])){return this[_0x0a9e('0xd')][_0x0a9e('0x49')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x5d27c1=this[_0x0a9e('0xd')][_0x0a9e('0xfa')](_0x37d5c9,_0x2f4de1['response'],_0x2f4de1[_0x0a9e('0xfb')]);var _0x306aa5=_0x5d27c1['result']?_0x5d27c1[_0x0a9e('0x97')]['toString']():'';logger[_0x0a9e('0x2b')](_0x0a9e('0xfc'),JSON['stringify'](_0x5d27c1));if(_0x5d27c1[_0x0a9e('0x97')]===-0x1){this[_0x0a9e('0x33')]['sync'](this,_0x2f4de1,_0x306aa5);return _0x5d27c1;}else if(_0x5d27c1[_0x0a9e('0x95')]===_0x0a9e('0x5b')){_0x5d27c1['result']=_0x306aa5[_0x0a9e('0x93')]>=parseInt(_0x2f4de1[_0x0a9e('0xfd')])?'x':'i';}else{_0x5d27c1[_0x0a9e('0x97')]=_0x306aa5[_0x0a9e('0x93')]>=parseInt(_0x2f4de1[_0x0a9e('0xfd')])&&_0x306aa5[_0x0a9e('0x93')]<=parseInt(_0x2f4de1['maxdigit'])?'x':'i';}var _0x1e5b09=this[_0x0a9e('0x11')]['sync'](this,_0x2f4de1[_0x0a9e('0xc6')]);if(!_0x1e5b09){return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x2f4de1,_0x0a9e('0xfe'));}this[_0x0a9e('0xd')][_0x0a9e('0xca')](_0x1e5b09,_0x306aa5);if(this[_0x0a9e('0x76')](_0x2f4de1['hiddendigitsnum'])){var _0x49e1b8=parseInt(_0x2f4de1['hiddendigitsnum'],0xa);var _0x55d764=rs['generate']({'charset':'*','length':_0x49e1b8});var _0x269038=_0x306aa5[_0x0a9e('0x93')];if(_0x269038>0x0){if(_0x269038>_0x49e1b8){this['createSquareDetailsReport']['sync'](this,_0x2f4de1,_0x2f4de1[_0x0a9e('0xff')]==='first'?_0x55d764+_0x306aa5[_0x0a9e('0x100')](_0x49e1b8):_0x306aa5[_0x0a9e('0x100')](0x0,_0x269038-_0x49e1b8)+_0x55d764);}else{this[_0x0a9e('0x33')][_0x0a9e('0x66')](this,_0x2f4de1,rs[_0x0a9e('0x101')]({'charset':'*','length':_0x269038}));}}else{this[_0x0a9e('0x33')]['sync'](this,_0x2f4de1,'');}}else{this[_0x0a9e('0x33')][_0x0a9e('0x66')](this,_0x2f4de1,_0x306aa5);}return _0x5d27c1;};AGIVertices['prototype'][_0x0a9e('0xc')]=function(_0x1c0d54){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')](_0x0a9e('0x102'),_0x1c0d54[_0x0a9e('0x35')]));return this[_0x0a9e('0xf5')](_0x1c0d54);};AGIVertices['prototype'][_0x0a9e('0x103')]=function(_0x508395){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x508395[_0x0a9e('0x35')]));this[_0x0a9e('0x33')]['sync'](this,_0x508395,_0x508395[_0x0a9e('0x104')]);return this['channel'][_0x0a9e('0xa8')](util[_0x0a9e('0x28')]('GOAL\x20%s',_0x508395[_0x0a9e('0x104')]));};AGIVertices['prototype'][_0x0a9e('0x105')]=function(_0x179137){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')](_0x0a9e('0x106'),_0x179137[_0x0a9e('0x35')]));if(!this[_0x0a9e('0x76')](_0x179137['aws_access_key_id'])||!this[_0x0a9e('0x76')](_0x179137[_0x0a9e('0x7f')])){return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](_0x0a9e('0x107'));}if(!this['isConfigured'](_0x179137[_0x0a9e('0x54')])){return this['channel']['noop'](_0x0a9e('0xb3'));}this['channel'][_0x0a9e('0xa8')](util[_0x0a9e('0x28')]('Trying\x20aws\x20Polly\x20%s',_0x179137[_0x0a9e('0x54')]));var _0x4043e7=this[_0x0a9e('0x78')][_0x0a9e('0x66')](this,_0x179137);if(_0x4043e7){this[_0x0a9e('0xd')][_0x0a9e('0xa8')](util[_0x0a9e('0x28')](_0x0a9e('0x108'),_0x4043e7));var _0x3d02ae=this['channel'][_0x0a9e('0x109')](_0x4043e7);try{fs[_0x0a9e('0x10a')](_0x4043e7+_0x0a9e('0x10b'));}catch(_0x43403c){logger['error'](_0x43403c);}return _0x3d02ae;}return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x179137,_0x0a9e('0x10c'));};AGIVertices['prototype'][_0x0a9e('0x10d')]=function(_0x2191c6){logger[_0x0a9e('0x2b')](util['format'](_0x0a9e('0x10e'),_0x2191c6['label']));if(!this[_0x0a9e('0x76')](_0x2191c6[_0x0a9e('0x79')])||!this[_0x0a9e('0x76')](_0x2191c6[_0x0a9e('0x7f')])){return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](_0x0a9e('0x107'));}if(!this['isConfigured'](_0x2191c6[_0x0a9e('0x80')])){return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](_0x0a9e('0x10f'));}if(!this[_0x0a9e('0x76')](_0x2191c6[_0x0a9e('0x54')])){return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](_0x0a9e('0xb3'));}this[_0x0a9e('0xd')][_0x0a9e('0xd4')]=!![];this[_0x0a9e('0x33')](_0x2191c6);this[_0x0a9e('0x3e')](_0x2191c6[_0x0a9e('0x54')],'in');this[_0x0a9e('0xd')][_0x0a9e('0xa8')](util[_0x0a9e('0x28')](_0x0a9e('0x110'),_0x2191c6[_0x0a9e('0x54')]));var _0x611e46=this[_0x0a9e('0x7e')][_0x0a9e('0x66')](this,_0x2191c6);if(_0x611e46){for(var _0x213a64 in _0x611e46){if(_0x611e46['hasOwnProperty'](_0x213a64)&&_[_0x0a9e('0x8a')](_0x611e46[_0x213a64])){this[_0x0a9e('0xd')][_0x0a9e('0xca')](util['format'](_0x0a9e('0x111'),_0x213a64['toUpperCase']()),_0x611e46[_0x213a64]);}}if(_[_0x0a9e('0x41')](_0x611e46[_0x0a9e('0x6c')])){return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](_0x0a9e('0x112'));}else{this[_0x0a9e('0x3e')](_0x611e46[_0x0a9e('0x6c')],_0x0a9e('0xd8'));return this['channel'][_0x0a9e('0xa8')](util[_0x0a9e('0x28')]('Amazon\x20Lex\x20Result\x20%s',_0x611e46[_0x0a9e('0x6c')]));}}return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x2191c6,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x113')]=function(_0x315299){logger[_0x0a9e('0x2b')](util['format'](_0x0a9e('0x114'),_0x315299[_0x0a9e('0x35')],_0x315299[_0x0a9e('0x5b')]));if(!this[_0x0a9e('0x76')](_0x315299[_0x0a9e('0x75')])){return this['channel'][_0x0a9e('0xa8')](_0x0a9e('0xd3'));}var _0x4df303=_0x0a9e('0x115');var _0x2d20a0=util[_0x0a9e('0x28')]('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x45ef37=util[_0x0a9e('0x28')](_0x0a9e('0x90'),_0x2d20a0,_0x4df303);var _0x283bbb=!![];if(_0x315299[_0x0a9e('0x116')]===_0x0a9e('0x117')){_0x283bbb=![];}var _0x312e02=this[_0x0a9e('0xd')]['recordFile'](_0x2d20a0,_0x4df303,_0x315299['intKey'],_0x315299[_0x0a9e('0x5b')],undefined,_0x283bbb);if(_0x312e02['result']!==-0x1){this[_0x0a9e('0xd')][_0x0a9e('0xa8')](util[_0x0a9e('0x28')](_0x0a9e('0x118'),_0x45ef37));var _0x57b11b=this[_0x0a9e('0x81')][_0x0a9e('0x66')](this,_0x315299,_0x45ef37);if(_0x57b11b){for(var _0x546bc9 in _0x57b11b){if(_0x57b11b[_0x0a9e('0x89')](_0x546bc9)){this['channel'][_0x0a9e('0xca')](util[_0x0a9e('0x28')](_0x0a9e('0x119'),_0x546bc9[_0x0a9e('0xd7')]()),_0x57b11b[_0x546bc9]);}}return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](util['format'](_0x0a9e('0x11a'),JSON['stringify'](_0x57b11b)));}}return _0x312e02;};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x11b')]=function(_0x4229e6){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')](_0x0a9e('0x11c'),_0x4229e6[_0x0a9e('0x35')]));if(!this['isConfigured'](_0x4229e6[_0x0a9e('0x84')])){return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](_0x0a9e('0x11d'));}if(!this[_0x0a9e('0x76')](_0x4229e6['appsecret'])){return this[_0x0a9e('0xd')][_0x0a9e('0xa8')]('no\x20appsecret\x20configured');}var _0x55bb89=_0x0a9e('0x115');var _0x11b33b=util[_0x0a9e('0x28')](_0x0a9e('0x11e'),FILES_PATH,rs[_0x0a9e('0x101')](0x4));var _0x1f1f36=util['format'](_0x0a9e('0x90'),_0x11b33b,_0x55bb89);var _0x13782b=!![];if(_0x4229e6[_0x0a9e('0x116')]==='NOBEEP'){_0x13782b=![];}var _0x294e90=this[_0x0a9e('0xd')][_0x0a9e('0x11f')](_0x11b33b,_0x55bb89,_0x4229e6[_0x0a9e('0x120')],_0x4229e6['timeout'],undefined,_0x13782b);if(_0x294e90['result']!==-0x1){this[_0x0a9e('0xd')][_0x0a9e('0xa8')](util[_0x0a9e('0x28')](_0x0a9e('0x121'),_0x1f1f36));var _0x1ba7b2=this[_0x0a9e('0x83')][_0x0a9e('0x66')](this,_0x4229e6,_0x1f1f36);if(_0x1ba7b2){for(var _0x23dd12 in _0x1ba7b2){if(_0x1ba7b2['hasOwnProperty'](_0x23dd12)){this[_0x0a9e('0xd')]['setVariable'](util[_0x0a9e('0x28')](_0x0a9e('0x122'),_0x23dd12[_0x0a9e('0xd7')]()),_0x1ba7b2[_0x23dd12]);}}return this['channel']['noop'](util[_0x0a9e('0x28')]('TildeASR\x20Result\x20%s',JSON[_0x0a9e('0x69')](_0x1ba7b2)));}}return _0x294e90;};AGIVertices['prototype']['gotoc']=function(_0x229d20){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')](_0x0a9e('0x123'),_0x229d20[_0x0a9e('0x35')]));return this[_0x0a9e('0xd')][_0x0a9e('0x124')](_0x229d20[_0x0a9e('0x125')],_0x229d20[_0x0a9e('0x126')],_0x229d20[_0x0a9e('0x3a')]);};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x127')]=function(_0x2b2e49){logger['info'](util['format'](_0x0a9e('0x128'),_0x2b2e49['label']));if(!this[_0x0a9e('0x76')](_0x2b2e49[_0x0a9e('0x129')])){return this[_0x0a9e('0xd')]['error'](_0x2b2e49,'no\x20condition\x20configured');}try{var _0x428009=eval(_0x2b2e49[_0x0a9e('0x129')])?_0x0a9e('0x12a'):_0x0a9e('0x12b');this[_0x0a9e('0xd')][_0x0a9e('0xa8')](util[_0x0a9e('0x28')]('EVAL\x20CONDITION\x20%s\x20%s',_0x2b2e49[_0x0a9e('0x129')],_0x428009));return{'code':0xc8,'result':_0x428009};}catch(_0x5799a6){return{'code':0xc8,'result':_0x0a9e('0x12b')};}};AGIVertices[_0x0a9e('0x10')]['gotoiftime']=function(_0x1fe77c){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')](_0x0a9e('0x12c'),_0x1fe77c[_0x0a9e('0x35')]));if(!this[_0x0a9e('0x76')](_0x1fe77c['interval_id'])){return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x1fe77c,_0x0a9e('0x12d'));}var _0x5d81af=this[_0x0a9e('0x22')][_0x0a9e('0x66')](this,_0x1fe77c[_0x0a9e('0x12e')]);if(!_0x5d81af){return this['channel'][_0x0a9e('0x49')](_0x1fe77c,_0x0a9e('0x12f'));}for(var _0x37257e=0x0;_0x37257e<_0x5d81af[_0x0a9e('0x93')];_0x37257e+=0x1){var _0x1d39bd=this[_0x0a9e('0xd')]['getVariable'](util['format'](_0x0a9e('0x130'),_0x5d81af[_0x37257e]));if(_0x1d39bd[_0x0a9e('0x97')]===-0x1){return _0x1d39bd;}logger['info'](util[_0x0a9e('0x28')](_0x0a9e('0x131'),_0x5d81af[_0x37257e],_0x1d39bd[_0x0a9e('0x95')]));if(_0x1d39bd[_0x0a9e('0x95')]===_0x0a9e('0x12a')){logger[_0x0a9e('0x2b')](util['format'](_0x0a9e('0x131'),_0x5d81af[_0x37257e],_0x0a9e('0x12a')));this[_0x0a9e('0xd')]['noop'](util[_0x0a9e('0x28')](_0x0a9e('0x131'),_0x5d81af[_0x37257e],_0x0a9e('0x12a')));return{'code':0xc8,'result':_0x0a9e('0x12a')};}else{logger['info'](util['format'](_0x0a9e('0x131'),_0x5d81af[_0x37257e],_0x0a9e('0x12b')));this[_0x0a9e('0xd')]['noop'](util[_0x0a9e('0x28')](_0x0a9e('0x131'),_0x5d81af[_0x37257e],_0x0a9e('0x12b')));}}return{'code':0xc8,'result':_0x0a9e('0x12b')};};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x132')]=function(_0x37c14b){logger[_0x0a9e('0x2b')](util['format']('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x37c14b[_0x0a9e('0x35')]));return this[_0x0a9e('0xd')]['hangup']();};AGIVertices[_0x0a9e('0x10')]['ispeechasr']=function(_0x1f80cb){logger[_0x0a9e('0x2b')](util['format'](_0x0a9e('0x133'),_0x1f80cb[_0x0a9e('0x35')]));if(!this['isConfigured'](_0x1f80cb[_0x0a9e('0x75')])){return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](_0x0a9e('0xd3'));}var _0x434df7=_0x0a9e('0x115');var _0x25b2b9=util['format'](_0x0a9e('0x11e'),FILES_PATH,rs[_0x0a9e('0x101')](0x4));var _0x448946=util[_0x0a9e('0x28')](_0x0a9e('0x90'),_0x25b2b9,_0x434df7);var _0x256228=!![];if(_0x1f80cb[_0x0a9e('0x116')]==='NOBEEP'){_0x256228=![];}var _0x4dbec7=this[_0x0a9e('0xd')][_0x0a9e('0x11f')](_0x25b2b9,_0x434df7,_0x1f80cb[_0x0a9e('0x120')],_0x1f80cb['timeout'],undefined,_0x256228);if(_0x4dbec7['result']!==-0x1){this[_0x0a9e('0xd')]['noop'](util[_0x0a9e('0x28')](_0x0a9e('0x134'),_0x448946));var _0x112789=this[_0x0a9e('0x74')][_0x0a9e('0x66')](this,_0x1f80cb,_0x448946);if(_0x112789){for(var _0x13c6df in _0x112789){if(_0x112789[_0x0a9e('0x89')](_0x13c6df)){this[_0x0a9e('0xd')][_0x0a9e('0xca')](util['format']('ISPEECH_ASR_%s',_0x13c6df[_0x0a9e('0xd7')]()),_0x112789[_0x13c6df]);}}return this['channel'][_0x0a9e('0xa8')](util[_0x0a9e('0x28')](_0x0a9e('0x135'),JSON[_0x0a9e('0x69')](_0x112789)));}}return _0x4dbec7;};AGIVertices['prototype'][_0x0a9e('0x136')]=function(_0x2ee2fc){logger[_0x0a9e('0x2b')](util['format'](_0x0a9e('0x137'),_0x2ee2fc[_0x0a9e('0x35')]));if(!this[_0x0a9e('0x76')](_0x2ee2fc['key'])){return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](_0x0a9e('0xd3'));}if(!this[_0x0a9e('0x76')](_0x2ee2fc[_0x0a9e('0x54')])){return this[_0x0a9e('0xd')]['noop']('no\x20text\x20configured');}this[_0x0a9e('0xd')][_0x0a9e('0xa8')](util[_0x0a9e('0x28')]('Trying\x20ispeech\x20TTS\x20%s',_0x2ee2fc['text']));var _0x2a5c2a=this[_0x0a9e('0x71')][_0x0a9e('0x66')](this,_0x2ee2fc);if(_0x2a5c2a){this['channel']['noop'](util[_0x0a9e('0x28')](_0x0a9e('0x134'),_0x2a5c2a));var _0x33046a=this[_0x0a9e('0xd')][_0x0a9e('0x109')](_0x2a5c2a,_0x2ee2fc['intKey']);try{fs[_0x0a9e('0x10a')](_0x2a5c2a+'.wav');}catch(_0x385f4e){logger[_0x0a9e('0x49')](_0x385f4e);}return _0x33046a;}return this['channel'][_0x0a9e('0x49')](_0x2ee2fc,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x138')]=function(_0x43e749){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x43e749[_0x0a9e('0x35')]));if(!this[_0x0a9e('0x76')](_0x43e749[_0x0a9e('0x139')])){return this['channel'][_0x0a9e('0x49')](_0x43e749,'no\x20find\x20by\x20configured');}logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')](_0x0a9e('0x13a'),this['channel'][_0x0a9e('0x37')],_0x43e749[_0x0a9e('0x139')]));var _0x310f89=this[_0x0a9e('0x4b')][_0x0a9e('0x66')](this,_0x43e749[_0x0a9e('0x139')]);if(_0x310f89){logger['info'](util[_0x0a9e('0x28')](_0x0a9e('0x13b'),this[_0x0a9e('0xd')][_0x0a9e('0x37')],_0x43e749[_0x0a9e('0x139')]));this[_0x0a9e('0xd')][_0x0a9e('0xa8')](util[_0x0a9e('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x0a9e('0xd')][_0x0a9e('0x37')],_0x43e749[_0x0a9e('0x139')]));return{'code':0xc8,'result':_0x0a9e('0x13c')};}else{logger['info'](util[_0x0a9e('0x28')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x0a9e('0xd')][_0x0a9e('0x37')],_0x43e749[_0x0a9e('0x139')]));this['channel'][_0x0a9e('0xa8')](util[_0x0a9e('0x28')](_0x0a9e('0x13d'),this[_0x0a9e('0xd')]['callerid'],_0x43e749[_0x0a9e('0x139')]));return{'code':0xc8,'result':_0x0a9e('0x13e')};}};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x13f')]=function(_0x17500e){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x17500e[_0x0a9e('0x35')]));if(!this[_0x0a9e('0x76')](_0x17500e[_0x0a9e('0x139')])){return this[_0x0a9e('0xd')]['error'](_0x17500e,_0x0a9e('0x140'));}logger['info'](util[_0x0a9e('0x28')](_0x0a9e('0x13a'),this[_0x0a9e('0xd')][_0x0a9e('0x37')],_0x17500e[_0x0a9e('0x139')]));var _0x478b46=this[_0x0a9e('0x4a')]['sync'](this,_0x17500e[_0x0a9e('0x139')]);if(_0x478b46){logger['info'](util[_0x0a9e('0x28')](_0x0a9e('0x13b'),this['channel'][_0x0a9e('0x37')],_0x17500e[_0x0a9e('0x139')]));this[_0x0a9e('0xd')][_0x0a9e('0xa8')](util['format'](_0x0a9e('0x13b'),this[_0x0a9e('0xd')]['callerid'],_0x17500e[_0x0a9e('0x139')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util['format'](_0x0a9e('0x13d'),this[_0x0a9e('0xd')]['callerid'],_0x17500e[_0x0a9e('0x139')]));this[_0x0a9e('0xd')]['noop'](util[_0x0a9e('0x28')](_0x0a9e('0x13d'),this[_0x0a9e('0xd')][_0x0a9e('0x37')],_0x17500e[_0x0a9e('0x139')]));return{'code':0xc8,'result':_0x0a9e('0x13e')};}};AGIVertices[_0x0a9e('0x10')]['math']=function(_0x3d7738){logger['info'](util[_0x0a9e('0x28')](_0x0a9e('0x141'),_0x3d7738[_0x0a9e('0x35')]));if(!this[_0x0a9e('0x76')](_0x3d7738[_0x0a9e('0x142')])){return this[_0x0a9e('0xd')]['error'](_0x3d7738,_0x0a9e('0x143'));}this[_0x0a9e('0xd')][_0x0a9e('0xa8')](util['format'](_0x0a9e('0x144'),_0x3d7738[_0x0a9e('0x142')]));var _0xd886e5=eval(_0x3d7738[_0x0a9e('0x142')]);if(!this[_0x0a9e('0x76')](_0x3d7738[_0x0a9e('0xc6')])){return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](_0x0a9e('0xc7'));}var _0x1ca28d=this[_0x0a9e('0x11')][_0x0a9e('0x66')](this,_0x3d7738[_0x0a9e('0xc6')]);if(!_0x1ca28d){return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x3d7738,_0x0a9e('0xfe'));}if(_['isArray'](_0xd886e5)){var _0x20ebd0=this;_0xd886e5[_0x0a9e('0xc8')](function(_0x1f88ef,_0x5c6e53){_0x20ebd0[_0x0a9e('0xd')][_0x0a9e('0xca')](util[_0x0a9e('0x28')](_0x0a9e('0x145'),_0x1ca28d,_0x5c6e53),_0x1f88ef);});return this['channel'][_0x0a9e('0xa8')](util[_0x0a9e('0x28')](_0x0a9e('0x146'),_0x1ca28d));}else{return this[_0x0a9e('0xd')]['setVariable'](_0x1ca28d,_0xd886e5);}};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x147')]=function(_0x132455){logger[_0x0a9e('0x2b')](util['format']('Enter\x20in\x20MENU\x20(%s)\x20block',_0x132455[_0x0a9e('0x35')]));if(_0x132455[_0x0a9e('0x99')]===0x0){return this[_0x0a9e('0x9a')](_0x132455);}_0x132455[_0x0a9e('0x99')]-=0x1;if(!this[_0x0a9e('0x76')](_0x132455[_0x0a9e('0xf7')])){return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x132455,_0x0a9e('0xf8'));}var _0x84117=this[_0x0a9e('0x1c')][_0x0a9e('0x66')](this,_0x132455[_0x0a9e('0xf7')]);if(!_0x84117){return this[_0x0a9e('0xd')]['error'](_0x132455,_0x0a9e('0xf9'));}var _0x5ce227=this[_0x0a9e('0xd')]['getData'](_0x84117,_0x132455['response'],_0x132455[_0x0a9e('0x148')]);var _0x51ec16=_0x5ce227[_0x0a9e('0x97')];if(_0x5ce227[_0x0a9e('0x97')]===-0x1){this[_0x0a9e('0x33')][_0x0a9e('0x66')](this,_0x132455,'-1');return _0x5ce227;}else if(_0x5ce227['extra']==='timeout'){_0x5ce227[_0x0a9e('0x97')]=_0x5ce227[_0x0a9e('0x97')][_0x0a9e('0x93')]>0x0?_0x5ce227[_0x0a9e('0x97')]:'t';}else if(_['isEmpty'](_0x5ce227[_0x0a9e('0x97')])){_0x5ce227[_0x0a9e('0x97')]='#';_0x51ec16='#';}if(!this[_0x0a9e('0x76')](_0x132455[_0x0a9e('0xc6')])){this[_0x0a9e('0xd')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x35b0e6=this[_0x0a9e('0x11')][_0x0a9e('0x66')](this,_0x132455[_0x0a9e('0xc6')]);if(!_0x35b0e6){return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x132455,_0x0a9e('0xfe'));}this['channel'][_0x0a9e('0xca')](_0x35b0e6,_0x51ec16);}this[_0x0a9e('0x33')][_0x0a9e('0x66')](this,_0x132455,_0x51ec16);return _0x5ce227;};AGIVertices['prototype']['noop']=function(_0x521fd9){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x521fd9[_0x0a9e('0x35')]));return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](_0x521fd9['output']||_0x521fd9['label']);};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x149')]=function(_0xf10a48){logger[_0x0a9e('0x2b')](util['format'](_0x0a9e('0x14a'),_0xf10a48['label']));if(!this['isConfigured'](_0xf10a48[_0x0a9e('0x139')])){return this['channel'][_0x0a9e('0x49')](_0xf10a48,_0x0a9e('0x140'));}logger[_0x0a9e('0x2b')](util['format'](_0x0a9e('0x13a'),this[_0x0a9e('0xd')][_0x0a9e('0x37')],_0xf10a48['findBy']));var _0x5b20fa=this[_0x0a9e('0x46')][_0x0a9e('0x66')](this,_0xf10a48[_0x0a9e('0x14b')]);var _0x21fcaa=this[_0x0a9e('0x14c')][_0x0a9e('0x66')](this,_0xf10a48['findBy'],_0x5b20fa);if(_0x21fcaa){logger['info'](util[_0x0a9e('0x28')](_0x0a9e('0x13b'),this['channel']['callerid'],_0xf10a48['findBy']));this['channel']['noop'](util['format'](_0x0a9e('0x13b'),this['channel'][_0x0a9e('0x37')],_0xf10a48[_0x0a9e('0x139')]));return{'code':0xc8,'result':_0x0a9e('0x13c')};}else{logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')](_0x0a9e('0x13d'),this[_0x0a9e('0xd')]['callerid'],_0xf10a48[_0x0a9e('0x139')]));this[_0x0a9e('0xd')][_0x0a9e('0xa8')](util[_0x0a9e('0x28')](_0x0a9e('0x13b'),this[_0x0a9e('0xd')][_0x0a9e('0x37')],_0xf10a48[_0x0a9e('0x139')]));return{'code':0xc8,'result':_0x0a9e('0x13e')};}};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x14d')]=function(_0x5d48c2){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x5d48c2[_0x0a9e('0x35')]));if(!this['isConfigured'](_0x5d48c2[_0x0a9e('0xf7')])){return this[_0x0a9e('0xd')]['error'](_0x5d48c2,'no\x20file\x20audio\x20selected');}var _0x3fc37e=this['getSound'][_0x0a9e('0x66')](this,_0x5d48c2[_0x0a9e('0xf7')]);if(!_0x3fc37e){return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x5d48c2,_0x0a9e('0xf9'));}var _0x5f2d17=this[_0x0a9e('0xd')]['exec']('PLAYBACK',[_0x3fc37e,_0x5d48c2[_0x0a9e('0xd1')]]);if(_0x5f2d17[_0x0a9e('0x97')]===-0x1){return _0x5f2d17;}return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](util[_0x0a9e('0x28')]('Executed\x20command\x20%s\x20%s',_0x0a9e('0x14e'),_0x3fc37e));};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x14f')]=function(_0x27569c){logger['info'](util[_0x0a9e('0x28')](_0x0a9e('0x150'),_0x27569c['label']));if(!this[_0x0a9e('0x76')](_0x27569c[_0x0a9e('0x151')])){return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x27569c,'no\x20queue\x20selected');}var _0x1696de='';var _0x457bbd=parseInt(_0x27569c[_0x0a9e('0x151')],0xa);if(isNaN(_0x457bbd)){_0x1696de=_0x27569c[_0x0a9e('0x151')];}else{_0x1696de=this[_0x0a9e('0x152')]['sync'](this,_0x27569c[_0x0a9e('0x151')]);if(!_0x1696de){return this[_0x0a9e('0xd')]['error'](_0x27569c,_0x0a9e('0x153'));}}var _0x4b0d44='';if(this[_0x0a9e('0x76')](_0x27569c[_0x0a9e('0xf7')])){var _0x41354f=this[_0x0a9e('0x1c')][_0x0a9e('0x66')](this,_0x27569c[_0x0a9e('0xf7')]);if(_0x41354f){_0x4b0d44=_0x41354f;}}this[_0x0a9e('0x33')][_0x0a9e('0x66')](this,_0x27569c,_0x1696de);if(_0x27569c[_0x0a9e('0xd1')][_0x0a9e('0x154')]('x')<0x0){_0x27569c[_0x0a9e('0xd1')]+='x';}if(_0x27569c[_0x0a9e('0xd1')][_0x0a9e('0x154')]('X')<0x0){_0x27569c[_0x0a9e('0xd1')]+='X';}this[_0x0a9e('0xd')]['setVariable'](_0x0a9e('0x155'),_0x1696de?_0x1696de[_0x0a9e('0x156')]():'');var _0x3c7717=this[_0x0a9e('0xd')][_0x0a9e('0x4f')](_0x0a9e('0x157'),[_0x1696de,_0x27569c[_0x0a9e('0xd1')],_0x27569c[_0x0a9e('0x68')],_0x4b0d44,_0x27569c['timeout'],_0x27569c['agi'],_0x27569c['macro'],_0x27569c['gosub'],'',_0x27569c[_0x0a9e('0x158')]]);if(_0x3c7717['result']===-0x1){return _0x3c7717;}return this['channel']['noop'](util[_0x0a9e('0x28')](_0x0a9e('0xad'),_0x0a9e('0x157'),_0x1696de));};AGIVertices[_0x0a9e('0x10')]['record']=function(_0x55a8c5){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')](_0x0a9e('0x159'),_0x55a8c5[_0x0a9e('0x35')]));var _0x5522de=_0x55a8c5[_0x0a9e('0x15a')]||_0x0a9e('0x115');var _0x33adc3=util[_0x0a9e('0x28')](_0x0a9e('0x15b'),this[_0x0a9e('0xd')]['uniqueid'],rs[_0x0a9e('0x101')](0x5));var _0x5056d5=util['format'](_0x0a9e('0x15c'),FILES_PATH,_0x33adc3,_0x5522de);var _0x58117c=util[_0x0a9e('0x28')](_0x0a9e('0x11e'),FILES_PATH,_0x33adc3);this[_0x0a9e('0x38')][_0x0a9e('0x66')](this,_0x55a8c5,_0x33adc3,_0x5056d5);this[_0x0a9e('0xd')][_0x0a9e('0xca')](_0x0a9e('0x15d'),_0x33adc3);logger[_0x0a9e('0x2b')](_0x0a9e('0x15e'),_0x58117c,_0x5522de,_0x55a8c5['escape_digits'],_0x55a8c5[_0x0a9e('0x5b')]);return this[_0x0a9e('0xd')]['recordFile'](_0x58117c,_0x5522de,_0x55a8c5[_0x0a9e('0x15f')],_0x55a8c5[_0x0a9e('0x5b')],undefined,!![]);};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x160')]=function(_0x5a1649){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')](_0x0a9e('0x161'),_0x5a1649[_0x0a9e('0x35')]));if(!this[_0x0a9e('0x76')](_0x5a1649['url'])){return this['channel'][_0x0a9e('0xa8')]('no\x20url\x20configured');}var _0x2859e2=this['restAPI'][_0x0a9e('0x66')](this,_0x5a1649);logger['info'](util[_0x0a9e('0x28')]('Response:',util[_0x0a9e('0x162')](_0x2859e2,{'showHidden':![],'depth':null})));if(!this[_0x0a9e('0x76')](_0x5a1649[_0x0a9e('0xc6')])){return this['channel']['noop'](_0x0a9e('0x163'));}var _0x52abeb=this[_0x0a9e('0x11')]['sync'](this,_0x5a1649[_0x0a9e('0xc6')]);if(!_0x52abeb){return this['channel'][_0x0a9e('0x49')](_0x5a1649,_0x0a9e('0xfe'));}this['channel'][_0x0a9e('0xca')](util[_0x0a9e('0x28')](_0x0a9e('0x164'),_0x52abeb),_0x2859e2[_0x0a9e('0x6b')]?_0x2859e2[_0x0a9e('0x6b')]:_0x0a9e('0x165'));this[_0x0a9e('0xd')][_0x0a9e('0xca')](util[_0x0a9e('0x28')]('%s_STATUS_MESSAGE',_0x52abeb),_0x2859e2[_0x0a9e('0x166')]?_0x2859e2[_0x0a9e('0x166')]:'OK');if(_0x2859e2[_0x0a9e('0x60')]){try{this[_0x0a9e('0x8f')](_0x2859e2[_0x0a9e('0x60')],_0x52abeb);}catch(_0x481664){logger['error'](util[_0x0a9e('0x28')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x52abeb));}}return this[_0x0a9e('0xd')]['noop'](util[_0x0a9e('0x28')](_0x0a9e('0x167'),_0x52abeb));};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x168')]=function(_0x2bf5fc){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x2bf5fc['label']));return this[_0x0a9e('0xd')][_0x0a9e('0x169')](_0x2bf5fc['digits'][_0x0a9e('0x51')](/\s+/g,''),_0x2bf5fc[_0x0a9e('0x15f')]);};AGIVertices[_0x0a9e('0x10')]['saynumber']=function(_0x55ed81){logger['info'](util[_0x0a9e('0x28')](_0x0a9e('0x16a'),_0x55ed81[_0x0a9e('0x35')]));return this[_0x0a9e('0xd')]['sayNumber'](_0x55ed81[_0x0a9e('0x5c')][_0x0a9e('0x51')](/\s+/g,''),_0x55ed81[_0x0a9e('0x15f')]);};AGIVertices['prototype'][_0x0a9e('0x16b')]=function(_0x55a6c9){logger['info'](util[_0x0a9e('0x28')](_0x0a9e('0x16c'),_0x55a6c9['label']));return this['channel'][_0x0a9e('0x16d')](_0x55a6c9['text'],_0x55a6c9[_0x0a9e('0x15f')]);};AGIVertices['prototype'][_0x0a9e('0x16e')]=function(_0xb5209d){logger[_0x0a9e('0x2b')](util['format']('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0xb5209d[_0x0a9e('0x35')]));if(!this[_0x0a9e('0x76')](_0xb5209d[_0x0a9e('0x16f')])){return this[_0x0a9e('0xd')]['noop'](_0x0a9e('0x170'));}var _0x136d28=this['getMailAccount'][_0x0a9e('0x66')](this,_0xb5209d[_0x0a9e('0x16f')]);if(!_0x136d28||!_0x136d28[_0x0a9e('0x171')]){return this['channel'][_0x0a9e('0x49')](_0xb5209d,_0x0a9e('0x172'));}var _0xb1fd37={'from':util[_0x0a9e('0x28')](_0x0a9e('0x173'),_0x136d28[_0x0a9e('0x13')],_0x136d28[_0x0a9e('0x174')]||_0x136d28[_0x0a9e('0x171')][_0x0a9e('0x175')]),'to':_0xb5209d['to']||'','cc':_0xb5209d['cc']||'','bcc':_0xb5209d[_0x0a9e('0x176')]||'','subject':_0xb5209d[_0x0a9e('0x177')],'html':_0xb5209d[_0x0a9e('0x54')],'text':_0xb5209d[_0x0a9e('0x54')]};var _0x34ff77={'tls':{'rejectUnauthorized':![]}};if(_0x136d28[_0x0a9e('0x171')][_0x0a9e('0x178')]){_0x34ff77[_0x0a9e('0x178')]=_0x136d28[_0x0a9e('0x171')][_0x0a9e('0x178')];}else{_0x34ff77[_0x0a9e('0x179')]=_0x136d28[_0x0a9e('0x171')][_0x0a9e('0x179')];_0x34ff77['port']=_0x136d28[_0x0a9e('0x171')][_0x0a9e('0x17a')];_0x34ff77[_0x0a9e('0x17b')]=_0x136d28['Smtp'][_0x0a9e('0x17b')];}if(_0x136d28[_0x0a9e('0x171')][_0x0a9e('0x17c')]){_0x34ff77[_0x0a9e('0x17d')]={'user':_0x136d28['Smtp'][_0x0a9e('0x175')],'pass':_0x136d28[_0x0a9e('0x171')]['pass']};}if(this[_0x0a9e('0x76')](_0xb5209d[_0x0a9e('0x17e')])){}logger[_0x0a9e('0x17f')]('sendMail\x20message',JSON['stringify'](_0xb1fd37));this[_0x0a9e('0x33')][_0x0a9e('0x66')](this,_0xb5209d,_0xb5209d[_0x0a9e('0x16f')]);this['channel']['noop'](util[_0x0a9e('0x28')](_0x0a9e('0x180'),_0x136d28[_0x0a9e('0x13')]));this[_0x0a9e('0x21')]['sync'](this,_0x34ff77,_0xb1fd37);return this[_0x0a9e('0xd')]['noop']('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x181')]=function(_0x195e3c){logger['info'](util[_0x0a9e('0x28')](_0x0a9e('0x182'),_0x195e3c[_0x0a9e('0x35')]));return this['channel']['noop'](_0x0a9e('0x183'));};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x184')]=function(_0x5f099e){logger['info'](util[_0x0a9e('0x28')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x5f099e['label']));if(!this['isConfigured'](_0x5f099e[_0x0a9e('0x185')])){return this[_0x0a9e('0xd')][_0x0a9e('0xa8')]('no\x20sms\x20account\x20configured');}var _0x1e0ca4=this[_0x0a9e('0x31')]['sync'](this,_0x5f099e[_0x0a9e('0x185')]);if(!_0x1e0ca4){return this['channel'][_0x0a9e('0x49')](_0x5f099e,_0x0a9e('0x186'));}var _0x497284={'body':_0x5f099e[_0x0a9e('0x187')],'phone':_0x5f099e['to']||'','SmsAccountId':_0x1e0ca4['id']};logger[_0x0a9e('0x17f')](_0x0a9e('0x188'),JSON['stringify'](_0x497284));this[_0x0a9e('0x33')][_0x0a9e('0x66')](this,_0x5f099e,_0x5f099e[_0x0a9e('0x185')]);this['channel'][_0x0a9e('0xa8')](util[_0x0a9e('0x28')](_0x0a9e('0x189'),_0x1e0ca4['name']));this[_0x0a9e('0x18a')][_0x0a9e('0x66')](this,_0x497284);return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](_0x0a9e('0x18b'));};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x18c')]=function(_0x20bd76){logger['info'](util[_0x0a9e('0x28')](_0x0a9e('0x18d'),_0x20bd76[_0x0a9e('0x35')]));if(!this[_0x0a9e('0x76')](_0x20bd76['variable_id'])){return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x20bd76,'no\x20variable\x20selected');}var _0x1f88d5=this[_0x0a9e('0x11')][_0x0a9e('0x66')](this,_0x20bd76[_0x0a9e('0xc6')]);if(!_0x1f88d5){return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x20bd76,_0x0a9e('0xfe'));}return this[_0x0a9e('0xd')]['setVariable'](_0x1f88d5,_0x20bd76[_0x0a9e('0x18e')]);};AGIVertices['prototype'][_0x0a9e('0x18f')]=function(_0x248256){logger['info'](util[_0x0a9e('0x28')](_0x0a9e('0x190'),_0x248256['label']));this[_0x0a9e('0xd')][_0x0a9e('0xa8')]('START\x20CALLY\x20SQUARE');if(_0x248256[_0x0a9e('0xa0')]==='yes'){this['channel']['noop'](_0x0a9e('0x191'));return this[_0x0a9e('0xd')]['answer']();}return this[_0x0a9e('0xd')][_0x0a9e('0xa8')]('Skipped\x20Answer');};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x192')]=function(_0x4bdcd3){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')](_0x0a9e('0x193'),_0x4bdcd3['label']));if(!this[_0x0a9e('0x76')](_0x4bdcd3[_0x0a9e('0x194')])){return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x4bdcd3,_0x0a9e('0x195'));}var _0x54571c=this[_0x0a9e('0x196')]['sync'](this,_0x4bdcd3[_0x0a9e('0x194')]);if(!this[_0x0a9e('0x76')](_0x54571c)){return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x4bdcd3,util[_0x0a9e('0x28')](_0x0a9e('0x197'),_0x4bdcd3[_0x0a9e('0x194')]));}if(_0x54571c===this[_0x0a9e('0xd')][_0x0a9e('0x3c')]){return this['channel'][_0x0a9e('0x49')](_0x4bdcd3,_0x0a9e('0x198'));}this[_0x0a9e('0x33')]['sync'](this,_0x4bdcd3,_0x54571c);var _0x48782d=this['channel']['exec']('AGI',util[_0x0a9e('0x28')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0x0a9e('0x7')][_0x0a9e('0x179')]||_0x0a9e('0x199'),_0x54571c,this[_0x0a9e('0xd')][_0x0a9e('0x3c')]));if(_0x48782d[_0x0a9e('0x97')]===-0x1){return _0x48782d;}return this['channel'][_0x0a9e('0xa8')](util['format']('Executed\x20command\x20%s\x20%s',_0x0a9e('0x19a'),_0x54571c));};AGIVertices['prototype'][_0x0a9e('0x19b')]=function(_0x5ba16e){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')](_0x0a9e('0x19c'),_0x5ba16e[_0x0a9e('0x35')]));var _0x17f6a4=this['shellCommand'][_0x0a9e('0x66')](this,_0x5ba16e[_0x0a9e('0x9c')]);this['createSquareDetailsReport'][_0x0a9e('0x66')](this,_0x5ba16e,_0x5ba16e[_0x0a9e('0x9c')]);if(this['isConfigured'](_0x5ba16e[_0x0a9e('0xc6')])){var _0x26320a=this[_0x0a9e('0x11')][_0x0a9e('0x66')](this,_0x5ba16e[_0x0a9e('0xc6')]);if(_0x26320a){this[_0x0a9e('0xd')][_0x0a9e('0xca')](_0x26320a,_0x17f6a4);return this['channel'][_0x0a9e('0xa8')](util[_0x0a9e('0x28')](_0x0a9e('0x19d'),_0x5ba16e[_0x0a9e('0x9c')],_0x26320a));}}return this['channel'][_0x0a9e('0xa8')](util[_0x0a9e('0x28')](_0x0a9e('0x19e'),_0x5ba16e[_0x0a9e('0x9c')]));};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x19f')]=function(_0x43106c){logger[_0x0a9e('0x2b')](util['format'](_0x0a9e('0x1a0'),_0x43106c[_0x0a9e('0x35')]));if(!this[_0x0a9e('0x76')](_0x43106c['apiKey'])){return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](_0x0a9e('0x1a1'));}if(!this[_0x0a9e('0x76')](_0x43106c[_0x0a9e('0x54')])){return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](_0x0a9e('0xb3'));}this[_0x0a9e('0xd')][_0x0a9e('0xa8')](util['format'](_0x0a9e('0x1a2'),_0x43106c[_0x0a9e('0x54')]));var _0x21f245=this['googleCloudTTS']['sync'](this,_0x43106c);if(_0x21f245){this[_0x0a9e('0xd')][_0x0a9e('0xa8')](util[_0x0a9e('0x28')](_0x0a9e('0x1a3'),_0x21f245));var _0x2cbfa3=this[_0x0a9e('0xd')][_0x0a9e('0x109')](_0x21f245);try{fs[_0x0a9e('0x10a')](_0x21f245+_0x0a9e('0x10b'));}catch(_0x491c2b){logger[_0x0a9e('0x49')](_0x491c2b);}return _0x2cbfa3;}return this[_0x0a9e('0xd')]['error'](_0x43106c,_0x0a9e('0x1a4'));};AGIVertices[_0x0a9e('0x10')]['tts']=function(_0x5bfbb6){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')](_0x0a9e('0x1a5'),_0x5bfbb6[_0x0a9e('0x35')]));if(!this[_0x0a9e('0x76')](_0x5bfbb6['text'])){return this[_0x0a9e('0xd')]['noop']('no\x20text\x20configured');}this['channel'][_0x0a9e('0xa8')](util['format']('Trying\x20Google\x20TTS\x20%s',_0x5bfbb6['text']));var _0x3ef164=this[_0x0a9e('0x58')][_0x0a9e('0x66')](this,_0x5bfbb6);if(_0x3ef164){this[_0x0a9e('0xd')]['noop'](util[_0x0a9e('0x28')]('Google\x20TTS\x20%s\x20file\x20created',_0x3ef164));var _0x4c81d4=this[_0x0a9e('0xd')][_0x0a9e('0x109')](_0x3ef164);try{fs[_0x0a9e('0x10a')](_0x3ef164+'.wav');}catch(_0x4820a3){logger['error'](_0x4820a3);}return _0x4c81d4;}return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x5bfbb6,_0x0a9e('0x1a6'));};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x1a7')]=function(_0x57779b){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')](_0x0a9e('0x1a8'),_0x57779b[_0x0a9e('0x35')]));if(!this[_0x0a9e('0x76')](_0x57779b[_0x0a9e('0x139')])){return this['channel'][_0x0a9e('0x49')](_0x57779b,_0x0a9e('0x140'));}logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')](_0x0a9e('0x13a'),this[_0x0a9e('0xd')][_0x0a9e('0x37')],_0x57779b[_0x0a9e('0x139')]));var _0x33ad34=this[_0x0a9e('0x1a9')][_0x0a9e('0x66')](this,_0x57779b[_0x0a9e('0x139')]);if(_0x33ad34){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')](_0x0a9e('0x13b'),this[_0x0a9e('0xd')][_0x0a9e('0x37')],_0x57779b[_0x0a9e('0x139')]));this['channel'][_0x0a9e('0xa8')](util[_0x0a9e('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x57779b[_0x0a9e('0x139')]));return{'code':0xc8,'result':_0x0a9e('0x13c')};}else{logger['info'](util[_0x0a9e('0x28')](_0x0a9e('0x13d'),this['channel'][_0x0a9e('0x37')],_0x57779b['findBy']));this[_0x0a9e('0xd')]['noop'](util[_0x0a9e('0x28')](_0x0a9e('0x13d'),this[_0x0a9e('0xd')][_0x0a9e('0x37')],_0x57779b['findBy']));return{'code':0xc8,'result':_0x0a9e('0x13e')};}};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x1aa')]=function(_0x4bc0ba){logger['info'](util['format']('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x4bc0ba[_0x0a9e('0x35')]));var _0xb4b8af=this[_0x0a9e('0xd')][_0x0a9e('0x4f')](_0x0a9e('0x1ab'),[_0x4bc0ba['mailbox'],_0x4bc0ba[_0x0a9e('0x6d')]]);if(_0xb4b8af[_0x0a9e('0x97')]===-0x1){return _0xb4b8af;}return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](util['format'](_0x0a9e('0xad'),_0x0a9e('0x1ab'),_0x4bc0ba[_0x0a9e('0x1ac')]));};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x1ad')]=function(_0x498a0b){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')](_0x0a9e('0x1ae'),_0x498a0b['label']));if(!this[_0x0a9e('0x76')](_0x498a0b['variable_id'])){return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x498a0b,_0x0a9e('0x1af'));}var _0xda737b=this[_0x0a9e('0x11')]['sync'](this,_0x498a0b[_0x0a9e('0xc6')]);if(!_0xda737b){return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x498a0b,_0x0a9e('0xfe'));}var _0xccdd65=this['channel'][_0x0a9e('0x11')](_0xda737b);return{'code':0xc8,'result':_0xccdd65[_0x0a9e('0x95')]?_0xccdd65[_0x0a9e('0x95')]:'-'};};String['prototype'][_0x0a9e('0x94')]=function(_0x488216,_0x479441){return this[_0x0a9e('0x92')](_0x488216)['join'](_0x479441);};module[_0x0a9e('0x1b0')]=AGIVertices; \ No newline at end of file +var _0xa9e0=['replaceAllVariables','saveRestApiResult','%s.%s','replaceObjectAllVariables','split','length','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','retry','maxRetry','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','answer','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','no\x20list\x20selected','delay','add','callback_priority','noop','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','phone','custom_app','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','no\x20text\x20configured','lumenvoxasr','grammar','no\x20grammar\x20configured','MRCPRecog','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','RECOG_CONFIDENCE()','SESTEK_ASR_CONFIDENCE','RECOG_INPUT()','SESTEK_ASR_TRANSCRIPT','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','forEach','keys','setVariable','%s_ROWS_COUNT','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','toUpperCase','out','Dialogflow\x20Result\x20%s','speech','Dialogflow\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','maxdigit','test','mindigit','no\x20variable\x20found','hiddendigitspos','substr','generate','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','streamFile','unlink','.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','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','beep','NOBEEP','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','%s/recordings/%s','recordFile','intKey','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','context','extension','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','login','findBy','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','no\x20find\x20by\x20configured','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','menu','digit','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','agentPause','playback','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','getVoiceQueue','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','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','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','statusMessage','variable\x20%s\x20set','saydigits','sayDigits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','subject','service','host','port','secure','authentication','auth','template_id','debug','Trying\x20SendMail\x20with\x20account\x20%s','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','createSmsMessage','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','getSquareProject','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','127.0.0.1','AGI','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','agentUnpause','voicemail','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','exports','path','util','lodash','randomstring','mustache','request-promise','../../config/logger','agi','../../config/environment','/var/opt/motion2/server/files','rawHeaders','rawBody','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','then','name','catch','getVoiceQueueById','getSquareProjectById','getSquareOdbc','getSquareOdbcById','getUser','getUserById','getTrunk','getSound','getSoundById','getSoundPath','save_name','getMailAccount','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','format','getQueryOdbc','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','getSmsAccount','getSmsAccountById','createSquareDetailsReport','uniqueid','label','agicommand','callerid','createSquareRecording','calleridname','priority','dnid','arg_1','file','createSquareMessage','createCmContact','isEmpty','isNil','lastName','scheduledAt','Callback\x20scheduled\x20at\x20','toString','getPause','getPauseById','agent','error','agentLogout','agentLogin','internal','LOCAL','shellCommand','exec','trim','replace','apiKey','google_cloud_tts_text_type','text','languageCode','audioEncoding','MP3','googleTTS','restAPI','method','timeout','number','includes','POST','PUT','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','render','url','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','message','options','googleDialogflow','dialogflow_language','sestekNDA','ispeechTTS','ispeech_tts_language','en-US','ispeechASR','key','isConfigured','model','awsPolly','aws_access_key_id','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_secret_access_key','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','uri','clear','clone','hasOwnProperty','isString','isPlainObject','recursiveNodeIndex','isArray'];(function(_0x12e073,_0x4d43db){var _0x267748=function(_0x381284){while(--_0x381284){_0x12e073['push'](_0x12e073['shift']());}};_0x267748(++_0x4d43db);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'use strict';var fs=require('fs');var path=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var sh=require('shelljs');var odbc=require('odbc')();var rs=require(_0x0a9e('0x3'));var moment=require('moment');var Mustache=require(_0x0a9e('0x4'));var rp=require(_0x0a9e('0x5'));var logger=require(_0x0a9e('0x6'))(_0x0a9e('0x7'));var config=require(_0x0a9e('0x8'));var scripts=require('./scripts');var FILES_PATH=_0x0a9e('0x9');var recursiveMapAttributes=[_0x0a9e('0xa'),_0x0a9e('0xb')];var verticesWithRetry=['menu','getdigits',_0x0a9e('0xc')];var AGIVertices=function(_0x56465b,_0x52cace,_0x39753a){this[_0x0a9e('0xd')]=_0x56465b;this[_0x0a9e('0xe')]=_0x52cace;this[_0x0a9e('0xf')]=_0x39753a;};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x11')]=function(_0x4a4c56,_0x50dfb2){this['rpc']['getVariableById'](_0x4a4c56)[_0x0a9e('0x12')](function(_0x36471c){_0x50dfb2(null,_0x36471c?_0x36471c[_0x0a9e('0x13')]:![]);})[_0x0a9e('0x14')](function(_0x32d742){_0x50dfb2(_0x32d742);});};AGIVertices[_0x0a9e('0x10')]['getVoiceQueue']=function(_0x4283ce,_0x239b12){this[_0x0a9e('0xe')][_0x0a9e('0x15')](_0x4283ce)[_0x0a9e('0x12')](function(_0x4d5611){_0x239b12(null,_0x4d5611?_0x4d5611['name']:![]);})[_0x0a9e('0x14')](function(_0x5d0880){_0x239b12(_0x5d0880);});};AGIVertices[_0x0a9e('0x10')]['getSquareProject']=function(_0x16033c,_0x12066b){this['rpc'][_0x0a9e('0x16')](_0x16033c)['then'](function(_0x459eb1){_0x12066b(null,_0x459eb1?_0x459eb1[_0x0a9e('0x13')]:![]);})[_0x0a9e('0x14')](function(_0x205fd6){_0x12066b(_0x205fd6);});};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x17')]=function(_0x530eb7,_0x20559e){this[_0x0a9e('0xe')][_0x0a9e('0x18')](_0x530eb7)[_0x0a9e('0x12')](function(_0x105080){_0x20559e(null,_0x105080?_0x105080['dsn']:![]);})[_0x0a9e('0x14')](function(_0x155cce){_0x20559e(_0x155cce);});};AGIVertices['prototype'][_0x0a9e('0x19')]=function(_0x5a09ef,_0x588269){this[_0x0a9e('0xe')][_0x0a9e('0x1a')](_0x5a09ef)[_0x0a9e('0x12')](function(_0x30bae6){_0x588269(null,_0x30bae6?_0x30bae6['name']:![]);})[_0x0a9e('0x14')](function(_0x2fb0e4){_0x588269(_0x2fb0e4);});};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x1b')]=function(_0x370d86,_0x42ac8f){this[_0x0a9e('0xe')]['getTrunkById'](_0x370d86)['then'](function(_0x197ec0){_0x42ac8f(null,_0x197ec0?_0x197ec0[_0x0a9e('0x13')]:![]);})[_0x0a9e('0x14')](function(_0x33161b){_0x42ac8f(_0x33161b);});};AGIVertices['prototype'][_0x0a9e('0x1c')]=function(_0x479bc4,_0x45a1e7){var _0x5bfb33=this;this[_0x0a9e('0xe')][_0x0a9e('0x1d')](_0x479bc4)[_0x0a9e('0x12')](function(_0x14433c){_0x45a1e7(null,_0x14433c?_0x5bfb33[_0x0a9e('0x1e')](_0x14433c[_0x0a9e('0x1f')]):![]);})[_0x0a9e('0x14')](function(_0x14de77){_0x45a1e7(_0x14de77);});};AGIVertices['prototype'][_0x0a9e('0x20')]=function(_0x468813,_0x2b1f27){this[_0x0a9e('0xe')]['getMailAccountById'](_0x468813)[_0x0a9e('0x12')](function(_0x40e7a3){_0x2b1f27(null,_0x40e7a3?_0x40e7a3:![]);})[_0x0a9e('0x14')](function(_0x824a4f){_0x2b1f27(_0x824a4f);});};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x21')]=function(_0x296f41,_0x2e8759,_0x1dbde2){this['mailRpc'][_0x0a9e('0x21')](_0x296f41,_0x2e8759)['then'](function(){_0x1dbde2(null);})[_0x0a9e('0x14')](function(_0x3ae878){_0x1dbde2(_0x3ae878);});};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x22')]=function(_0x25ce3a,_0x5180f1){this[_0x0a9e('0xe')][_0x0a9e('0x23')](_0x25ce3a)[_0x0a9e('0x12')](function(_0x2da5c0){if(_0x2da5c0){if(_0x2da5c0[_0x0a9e('0x24')]){_0x5180f1(null,[_0x2da5c0[_0x0a9e('0x25')]]);}else{_0x5180f1(null,_[_0x0a9e('0x26')](_0x2da5c0[_0x0a9e('0x27')],'interval'));}}else{_0x5180f1(null,![]);}})[_0x0a9e('0x14')](function(_0x5e7238){_0x5180f1(_0x5e7238);});};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x1e')]=function(_0x2b7e7f){return util[_0x0a9e('0x28')]('%s/sounds/converted/%s',FILES_PATH,_0x2b7e7f);};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x29')]=function(_0x1fa90d,_0x15de0e,_0x4853b1){odbc['open'](_0x1fa90d,function(_0x1e8694){if(_0x1e8694){logger['error'](_0x0a9e('0x2a'),_0x1e8694);_0x4853b1(_0x1e8694);}else{logger[_0x0a9e('0x2b')](_0x0a9e('0x2c'));odbc[_0x0a9e('0x2d')](_0x15de0e,function(_0x4f41ae,_0x31916f){if(_0x4f41ae){logger[_0x0a9e('0x2b')](_0x0a9e('0x2e'),_0x15de0e);_0x4853b1(_0x4f41ae);}else{logger['info'](_0x0a9e('0x2f'),_0x15de0e);odbc[_0x0a9e('0x30')](function(_0x289467){if(_0x289467){logger['error']('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x289467);}_0x4853b1(null,_0x31916f);});}});}});};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x31')]=function(_0x5adda1,_0x2b814e){this[_0x0a9e('0xe')][_0x0a9e('0x32')](_0x5adda1)[_0x0a9e('0x12')](function(_0x4b38d9){_0x2b814e(null,_0x4b38d9?_0x4b38d9:![]);})['catch'](function(_0x15e37d){_0x2b814e(_0x15e37d);});};AGIVertices[_0x0a9e('0x10')]['createSmsMessage']=function(_0x183991,_0x1dec2e){this[_0x0a9e('0xe')]['createSmsMessage'](_0x183991)[_0x0a9e('0x12')](function(_0x2cfea9){_0x1dec2e(null,_0x2cfea9);})[_0x0a9e('0x14')](function(_0x43dd5b){_0x1dec2e(_0x43dd5b);});};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x33')]=function(_0x2881b3,_0x45a9b8,_0x23b089){this[_0x0a9e('0xe')][_0x0a9e('0x33')]({'uniqueid':this[_0x0a9e('0xd')][_0x0a9e('0x34')],'node':_0x2881b3[_0x0a9e('0x35')],'application':_0x2881b3[_0x0a9e('0x36')],'data':_0x45a9b8||null,'project_name':this['channel']['arg_1'],'callerid':this[_0x0a9e('0xd')][_0x0a9e('0x37')]})[_0x0a9e('0x12')](function(_0x315881){if(_0x23b089){_0x23b089(null,_0x315881);}})[_0x0a9e('0x14')](function(_0xc9a702){if(_0x23b089){_0x23b089(_0xc9a702);}});};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x38')]=function(_0x432fcc,_0x25c6e6,_0x2c2cb0,_0x35ed4a){this['rpc'][_0x0a9e('0x38')]({'uniqueid':this[_0x0a9e('0xd')][_0x0a9e('0x34')],'callerid':this[_0x0a9e('0xd')][_0x0a9e('0x37')],'calleridname':this[_0x0a9e('0xd')][_0x0a9e('0x39')],'context':this[_0x0a9e('0xd')]['context'],'extension':this[_0x0a9e('0xd')]['extension'],'priority':this[_0x0a9e('0xd')][_0x0a9e('0x3a')],'accountcode':this[_0x0a9e('0xd')]['accountcode'],'dnid':this[_0x0a9e('0xd')][_0x0a9e('0x3b')],'projectName':this[_0x0a9e('0xd')][_0x0a9e('0x3c')],'saveName':_0x25c6e6,'filename':_0x432fcc[_0x0a9e('0x3d')]||_0x25c6e6,'savePath':_0x2c2cb0})[_0x0a9e('0x12')](function(_0x45bf7f){_0x35ed4a(null,_0x45bf7f);})['catch'](function(_0x13f44d){_0x35ed4a(_0x13f44d);});};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x3e')]=function(_0x16f976,_0x409789,_0x992c77){this[_0x0a9e('0xe')][_0x0a9e('0x3e')]({'uniqueid':this[_0x0a9e('0xd')]['uniqueid'],'body':_0x16f976,'direction':_0x409789})[_0x0a9e('0x12')](function(_0x3fe430){if(_0x992c77){_0x992c77(null,_0x3fe430);}})['catch'](function(_0x4ae14b){if(_0x992c77){_0x992c77(_0x4ae14b);}});};AGIVertices['prototype'][_0x0a9e('0x3f')]=function(_0x4317e3,_0x37edaa){this[_0x0a9e('0xe')][_0x0a9e('0x3f')]({'firstName':_[_0x0a9e('0x40')](_0x4317e3[_0x0a9e('0x13')])||_[_0x0a9e('0x41')](_0x4317e3['name'])?'callback_'+Math['random']():_0x4317e3[_0x0a9e('0x13')],'lastName':_[_0x0a9e('0x40')](_0x4317e3[_0x0a9e('0x42')])||_['isNil'](_0x4317e3[_0x0a9e('0x42')])?null:_0x4317e3[_0x0a9e('0x42')],'phone':_0x4317e3['phone'],'ListId':_0x4317e3['list_id'],'scheduledAt':_0x4317e3[_0x0a9e('0x43')],'callbackUniqueid':this['channel'][_0x0a9e('0x34')],'tags':'callback','description':_0x0a9e('0x44')+_0x4317e3[_0x0a9e('0x43')][_0x0a9e('0x45')](),'priority':_0x4317e3['callback_priority']})[_0x0a9e('0x12')](function(_0x1bf38a){_0x37edaa(null,_0x1bf38a);})['catch'](function(_0x50f687){_0x37edaa(_0x50f687);});};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x46')]=function(_0x49c095,_0x145931){this['rpc'][_0x0a9e('0x47')](_0x49c095)['then'](function(_0xe22ccc){_0x145931(null,_0xe22ccc?_0xe22ccc['name']:![]);})['catch'](function(_0x5df0ad){_0x145931(_0x5df0ad);});};AGIVertices[_0x0a9e('0x10')]['agentPause']=function(_0x2f7092,_0x65432,_0x3cfd00){var _0x19b4df={'role':_0x0a9e('0x48')};_0x19b4df[_0x2f7092]=this[_0x0a9e('0xd')][_0x0a9e('0x37')];this[_0x0a9e('0xe')]['agentPause'](_0x19b4df,_0x65432,this[_0x0a9e('0xd')][_0x0a9e('0x34')])[_0x0a9e('0x12')](function(_0x30c491){_0x3cfd00(null,_[_0x0a9e('0x41')](_0x30c491)?![]:!![]);})[_0x0a9e('0x14')](function(_0x5d86e9){logger[_0x0a9e('0x49')](_0x5d86e9);_0x3cfd00(null,![]);});};AGIVertices[_0x0a9e('0x10')]['agentUnpause']=function(_0x3649cc,_0x5cc8fb){var _0x20c668={'role':'agent'};_0x20c668[_0x3649cc]=this['channel']['callerid'];this[_0x0a9e('0xe')]['agentUnpause'](_0x20c668)[_0x0a9e('0x12')](function(_0x1fc70e){_0x5cc8fb(null,_[_0x0a9e('0x41')](_0x1fc70e)?![]:!![]);})[_0x0a9e('0x14')](function(_0x1cca9f){logger[_0x0a9e('0x49')](_0x1cca9f);_0x5cc8fb(null,![]);});};AGIVertices['prototype'][_0x0a9e('0x4a')]=function(_0x5854cc,_0xca4ade){var _0x1f07cb={'role':_0x0a9e('0x48')};_0x1f07cb[_0x5854cc]=this['channel'][_0x0a9e('0x37')];this[_0x0a9e('0xe')][_0x0a9e('0x4a')](_0x1f07cb)[_0x0a9e('0x12')](function(_0x497d91){_0xca4ade(null,_[_0x0a9e('0x41')](_0x497d91)?![]:!![]);})[_0x0a9e('0x14')](function(_0x54327c){logger[_0x0a9e('0x49')](_0x54327c);_0xca4ade(null,![]);});};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x4b')]=function(_0x409b29,_0x401837){var _0x4d4a35={'role':_0x0a9e('0x48')};_0x4d4a35[_0x409b29]=this[_0x0a9e('0xd')][_0x0a9e('0x37')];var _0x47bb43=_0x409b29!=_0x0a9e('0x4c')?util['format']('%s/%s@from-sip/n',_0x0a9e('0x4d'),this[_0x0a9e('0xd')][_0x0a9e('0x37')]):undefined;this[_0x0a9e('0xe')][_0x0a9e('0x4b')](_0x4d4a35,_0x47bb43)[_0x0a9e('0x12')](function(_0x387489){_0x401837(null,_[_0x0a9e('0x41')](_0x387489)?![]:!![]);})[_0x0a9e('0x14')](function(_0x1cc4f3){logger[_0x0a9e('0x49')](_0x1cc4f3);_0x401837(null,![]);});};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x4e')]=function(_0x2b8192,_0x320898){sh[_0x0a9e('0x4f')](_[_0x0a9e('0x50')](_0x2b8192),function(_0x4257c9,_0x5150a4){var _0x1b0b98=_0x5150a4[_0x0a9e('0x51')](/(\r\n|\n|\r)/gm,'');_0x320898(null,_0x1b0b98);});};AGIVertices[_0x0a9e('0x10')]['googleCloudTTS']=function(_0x1148a1,_0x30944e){scripts['googleCloudTTS'](_0x1148a1[_0x0a9e('0x52')],_0x1148a1[_0x0a9e('0x53')]||_0x0a9e('0x54'),_0x1148a1[_0x0a9e('0x54')],_0x1148a1[_0x0a9e('0x55')]||'en-US',_0x1148a1['ssmlGender']||'MALE',_0x1148a1[_0x0a9e('0x56')]||_0x0a9e('0x57'))[_0x0a9e('0x12')](function(_0x23a7d3){_0x30944e(null,_0x23a7d3);})[_0x0a9e('0x14')](function(_0x380ab3){_0x30944e(_0x380ab3);});};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x58')]=function(_0x5512d1,_0x235f8f){scripts[_0x0a9e('0x58')](_0x5512d1[_0x0a9e('0x54')],_0x5512d1['google_tts_language']||'en',0x1)[_0x0a9e('0x12')](function(_0x583b2e){_0x235f8f(null,_0x583b2e);})[_0x0a9e('0x14')](function(_0x44351d){_0x235f8f(_0x44351d);});};AGIVertices['prototype'][_0x0a9e('0x59')]=function(_0x75912a,_0x2cc7a7){var _0x317c0c={'uri':_0x75912a['url'],'method':_0x75912a[_0x0a9e('0x5a')],'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x75912a[_0x0a9e('0x5b')])===_0x0a9e('0x5c')&&parseInt(_0x75912a[_0x0a9e('0x5b')])>=0x1?parseInt(_0x75912a['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x0a9e('0x5d')]([_0x0a9e('0x5e'),_0x0a9e('0x5f')],_0x317c0c[_0x0a9e('0x5a')]['toUpperCase']())){try{_0x317c0c[_0x0a9e('0x60')]=_0x75912a[_0x0a9e('0xb')]?JSON[_0x0a9e('0x61')](_0x75912a[_0x0a9e('0xb')]):{};}catch(_0x332367){logger[_0x0a9e('0x49')](_0x0a9e('0x62'),_0x332367);}}try{_0x317c0c[_0x0a9e('0x63')]=_0x75912a[_0x0a9e('0xa')]?JSON[_0x0a9e('0x61')](_0x75912a[_0x0a9e('0xa')]):{};}catch(_0x1f10ef){logger[_0x0a9e('0x49')](_0x0a9e('0x64'),_0x1f10ef);}if(_0x75912a['computedVariables']){try{var _0xf4120f=require(_0x75912a[_0x0a9e('0x65')])[_0x0a9e('0x66')](this,_0x317c0c);_0x317c0c['uri']=Mustache[_0x0a9e('0x67')](_0x75912a[_0x0a9e('0x68')],_0xf4120f,{},['$$','$$']);if(_0x317c0c[_0x0a9e('0x63')]){_0x317c0c[_0x0a9e('0x63')]=JSON['parse'](Mustache['render'](JSON[_0x0a9e('0x69')](_0x317c0c[_0x0a9e('0x63')]),_0xf4120f,{},['$$','$$']));}if(_0x317c0c['body']){_0x317c0c[_0x0a9e('0x60')]=JSON['parse'](Mustache[_0x0a9e('0x67')](JSON[_0x0a9e('0x69')](_0x317c0c['body']),_0xf4120f,{},['$$','$$']));}}catch(_0x28a942){logger[_0x0a9e('0x49')](_0x0a9e('0x6a'),_0x28a942);}}rp(_0x317c0c)[_0x0a9e('0x12')](function(_0x3755fe){var _0x1f42a0={'statusCode':_0x3755fe[_0x0a9e('0x6b')]||0xc8,'statusMessage':_0x3755fe['statusMessage']||'OK','headers':_0x3755fe[_0x0a9e('0x63')]||{},'body':_0x3755fe[_0x0a9e('0x60')]||{}};_0x2cc7a7(null,_0x1f42a0);})[_0x0a9e('0x14')](function(_0x16e5b9){var _0x492543={'statusCode':_0x16e5b9[_0x0a9e('0x6b')]||0x1f4,'statusMessage':_0x16e5b9[_0x0a9e('0x6c')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x16e5b9[_0x0a9e('0x6d')]['headers']||{},'body':_0x16e5b9[_0x0a9e('0x6d')][_0x0a9e('0x60')]||{}};_0x2cc7a7(null,_0x492543);});};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x6e')]=function(_0x5af453,_0x51ccd7){scripts[_0x0a9e('0x6e')](this[_0x0a9e('0xd')][_0x0a9e('0x34')],_0x5af453['key'],_0x5af453[_0x0a9e('0x54')],_0x5af453[_0x0a9e('0x6f')]||'en')['then'](function(_0x4e46b2){_0x51ccd7(null,_0x4e46b2);})[_0x0a9e('0x14')](function(_0x56acca){_0x51ccd7(_0x56acca);});};AGIVertices['prototype']['sestekNDA']=function(_0x81d748,_0xf3601c){scripts[_0x0a9e('0x70')](this[_0x0a9e('0xd')],_0x81d748)[_0x0a9e('0x12')](function(_0x2600de){_0xf3601c(null,_0x2600de);})['catch'](function(_0x5fd5db){_0xf3601c(_0x5fd5db);});};AGIVertices['prototype'][_0x0a9e('0x71')]=function(_0x2aabab,_0x18ad56){scripts[_0x0a9e('0x71')](_0x2aabab['key'],_0x2aabab[_0x0a9e('0x54')],_0x2aabab[_0x0a9e('0x72')]||_0x0a9e('0x73'),_0x2aabab['speed'])[_0x0a9e('0x12')](function(_0x21e592){_0x18ad56(null,_0x21e592);})[_0x0a9e('0x14')](function(_0x22063c){_0x18ad56(_0x22063c);});};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x74')]=function(_0x32b9bd,_0x11ac43,_0x509efe){scripts[_0x0a9e('0x74')](_0x11ac43,_0x32b9bd[_0x0a9e('0x75')],_0x32b9bd['ispeech_asr_language']||_0x0a9e('0x73'),this[_0x0a9e('0x76')](_0x32b9bd[_0x0a9e('0x77')])?_0x32b9bd['model']:undefined)[_0x0a9e('0x12')](function(_0x52ec10){_0x509efe(null,_0x52ec10);})[_0x0a9e('0x14')](function(_0x2b5148){_0x509efe(_0x2b5148);});};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x78')]=function(_0x842d6f,_0x16341a){scripts[_0x0a9e('0x78')](_0x842d6f[_0x0a9e('0x79')],_0x842d6f['aws_secret_access_key'],_0x842d6f[_0x0a9e('0x7a')],_0x842d6f[_0x0a9e('0x7b')]||_0x0a9e('0x7c'),_0x842d6f[_0x0a9e('0x54')],_0x842d6f[_0x0a9e('0x7d')]||_0x0a9e('0x54'))[_0x0a9e('0x12')](function(_0x33f0c9){_0x16341a(null,_0x33f0c9);})[_0x0a9e('0x14')](function(_0x31af8c){_0x16341a(_0x31af8c);});};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x7e')]=function(_0x18273f,_0x4989f9){scripts[_0x0a9e('0x7e')](this[_0x0a9e('0xd')][_0x0a9e('0x34')],_0x18273f[_0x0a9e('0x79')],_0x18273f[_0x0a9e('0x7f')],_0x18273f['aws_lex_region'],_0x18273f[_0x0a9e('0x54')],_0x18273f[_0x0a9e('0x80')])['then'](function(_0x23b447){_0x4989f9(null,_0x23b447);})['catch'](function(_0x45d113){_0x4989f9(_0x45d113);});};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x81')]=function(_0xf8c6c4,_0x4f4d2d,_0x3ceba6){scripts['googleASR'](_0x4f4d2d,_0xf8c6c4[_0x0a9e('0x75')],_0xf8c6c4[_0x0a9e('0x82')]||'en-US')[_0x0a9e('0x12')](function(_0x63c9f7){_0x3ceba6(null,_0x63c9f7);})[_0x0a9e('0x14')](function(_0x4ab276){_0x3ceba6(_0x4ab276);});};AGIVertices['prototype'][_0x0a9e('0x83')]=function(_0x6ba2be,_0x1707dc,_0x413190){scripts[_0x0a9e('0x83')](_0x1707dc,_0x6ba2be[_0x0a9e('0x84')],_0x6ba2be[_0x0a9e('0x85')],_0x6ba2be[_0x0a9e('0x86')])[_0x0a9e('0x12')](function(_0x586510){_0x413190(null,_0x586510);})[_0x0a9e('0x14')](function(_0x517081){_0x413190(_0x517081);});};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x87')]=function(_0x34e745){var _0x28ce92=_[_0x0a9e('0x5d')](verticesWithRetry,_0x34e745['agicommand'])?_0x34e745:_[_0x0a9e('0x88')](_0x34e745);for(var _0x4667bf in _0x28ce92){if(_0x28ce92[_0x0a9e('0x89')](_0x4667bf)){if(_0x28ce92[_0x4667bf]&&_[_0x0a9e('0x8a')](_0x28ce92[_0x4667bf])){if(_[_0x0a9e('0x5d')](recursiveMapAttributes,_0x4667bf)){_0x28ce92[_0x4667bf]=this['replaceObjectAllVariables'](_0x28ce92[_0x4667bf]);}else{_0x28ce92[_0x4667bf]=this['replaceAllVariables'](_0x28ce92[_0x4667bf]);}}}}return _0x28ce92;};AGIVertices[_0x0a9e('0x10')]['recursiveNodeIndex']=function(_0x25eae0){for(var _0x4658df in _0x25eae0){if(_0x25eae0[_0x0a9e('0x89')](_0x4658df)){if(_[_0x0a9e('0x8b')](_0x25eae0[_0x4658df])){this[_0x0a9e('0x8c')](_0x25eae0[_0x4658df]);}else if(_[_0x0a9e('0x8d')](_0x25eae0[_0x4658df])){for(var _0x596312=0x0;_0x596312<_0x25eae0[_0x4658df]['length'];_0x596312++){this[_0x0a9e('0x8c')](_0x25eae0[_0x4658df][_0x596312]);}}else if(_['isString'](_0x25eae0[_0x4658df])){_0x25eae0[_0x4658df]=this[_0x0a9e('0x8e')](_0x25eae0[_0x4658df]);}}}};AGIVertices['prototype'][_0x0a9e('0x8f')]=function(_0x564db2,_0x558d60){for(var _0x1c49dc in _0x564db2){if(_0x564db2[_0x0a9e('0x89')](_0x1c49dc)){if(_['isPlainObject'](_0x564db2[_0x1c49dc])){if(!_[_0x0a9e('0x40')](_0x564db2[_0x1c49dc])){this[_0x0a9e('0x8f')](_0x564db2[_0x1c49dc],util[_0x0a9e('0x28')](_0x0a9e('0x90'),_0x558d60,_0x1c49dc));}}else{if(_0x564db2[_0x1c49dc]){this[_0x0a9e('0xd')]['setVariable'](util['format'](_0x0a9e('0x90'),_0x558d60,_0x1c49dc),_0x564db2[_0x1c49dc]);}}}}};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x91')]=function(_0x24beb6){try{var _0x59303b=JSON['parse'](_0x24beb6);this[_0x0a9e('0x8c')](_0x59303b);return JSON[_0x0a9e('0x69')](_0x59303b);}catch(_0x5416a9){return this[_0x0a9e('0x8e')](_0x24beb6);}};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x8e')]=function(_0x2427d5){var _0x23b25b=_0x2427d5[_0x0a9e('0x92')]('{');for(var _0x1ef1b0=0x1;_0x1ef1b0<_0x23b25b[_0x0a9e('0x93')];_0x1ef1b0+=0x1){var _0x40dd2a=_0x23b25b[_0x1ef1b0][_0x0a9e('0x92')]('}');if(_0x40dd2a['length']>0x1){_0x2427d5=_0x2427d5[_0x0a9e('0x94')]('{'+_0x40dd2a[0x0]+'}',this[_0x0a9e('0xd')][_0x0a9e('0x11')](_0x40dd2a[0x0])[_0x0a9e('0x95')]||_0x40dd2a[0x0]);}}if(_0x23b25b[_0x0a9e('0x93')]===0x1){return _0x2427d5['toString']();}return this['replaceAllVariables'](_0x2427d5);};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x96')]=function(_0x466bbf,_0x2fea95){var _0x34f7b5=this['channel'][_0x0a9e('0x11')](_0x466bbf);if(_0x34f7b5[_0x0a9e('0x97')]===-0x1){return _0x34f7b5;}logger[_0x0a9e('0x2b')](util['format'](_0x0a9e('0x98'),_0x2fea95,_0x34f7b5['extra']));return this[_0x0a9e('0xd')]['setVariable'](_0x2fea95,_0x34f7b5[_0x0a9e('0x95')]);};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x76')]=function(_0x5c500c){return _0x5c500c&&_0x5c500c!=='0'&&_0x5c500c!=='-1'&&_0x5c500c!=='';};AGIVertices[_0x0a9e('0x10')]['maxRetry']=function(_0x4383da){this[_0x0a9e('0x33')][_0x0a9e('0x66')](this,_0x4383da,'-');_0x4383da[_0x0a9e('0x99')]=_0x4383da[_0x0a9e('0x9a')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x7')]=function(_0xe89aaa){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')](_0x0a9e('0x9b'),_0xe89aaa[_0x0a9e('0x35')]));return this[_0x0a9e('0xd')][_0x0a9e('0x7')]([_0xe89aaa[_0x0a9e('0x9c')],_0xe89aaa[_0x0a9e('0x9d')]]);};AGIVertices['prototype']['answer']=function(_0x6eaaf0){logger['info'](util[_0x0a9e('0x28')](_0x0a9e('0x9e'),_0x6eaaf0['label']));if(this[_0x0a9e('0x76')](_0x6eaaf0[_0x0a9e('0x5b')])){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x6eaaf0[_0x0a9e('0x5b')]));var _0x26cb76=this[_0x0a9e('0xd')][_0x0a9e('0x9f')](_0x6eaaf0['timeout']);if(_0x26cb76[_0x0a9e('0x97')]===-0x1){return _0x26cb76;}}return this[_0x0a9e('0xd')][_0x0a9e('0xa0')]();};AGIVertices['prototype'][_0x0a9e('0xa1')]=function(_0x270df8){logger[_0x0a9e('0x2b')](util['format'](_0x0a9e('0xa2'),_0x270df8[_0x0a9e('0x35')]));if(!this[_0x0a9e('0x76')](_0x270df8[_0x0a9e('0xa3')])){return this[_0x0a9e('0xd')]['error'](_0x270df8,_0x0a9e('0xa4'));}_0x270df8[_0x0a9e('0x43')]=moment();if(this['isConfigured'](_0x270df8[_0x0a9e('0xa5')])){_0x270df8[_0x0a9e('0x43')]=moment()[_0x0a9e('0xa6')](_0x270df8['delay'],'minutes');}if(!this['isConfigured'](_0x270df8[_0x0a9e('0xa7')])){_0x270df8[_0x0a9e('0xa7')]=0x2;}this['createCmContact'][_0x0a9e('0x66')](this,_0x270df8);return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](util['format'](_0x0a9e('0xa9'),_0x270df8[_0x0a9e('0xaa')],_0x270df8[_0x0a9e('0xa3')],_0x270df8[_0x0a9e('0x43')]));};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0xab')]=function(_0x40e6e7){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x40e6e7[_0x0a9e('0x35')]));var _0x5526a7=this[_0x0a9e('0xd')][_0x0a9e('0x4f')](_0x40e6e7[_0x0a9e('0xac')],_0x40e6e7[_0x0a9e('0x6d')]);if(_0x5526a7[_0x0a9e('0x97')]===-0x1){return _0x5526a7;}return this[_0x0a9e('0xd')]['noop'](util[_0x0a9e('0x28')](_0x0a9e('0xad'),_0x40e6e7[_0x0a9e('0xac')],_0x40e6e7[_0x0a9e('0x6d')]));};AGIVertices['prototype'][_0x0a9e('0xae')]=function(_0x3c9135){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')](_0x0a9e('0xaf'),_0x3c9135[_0x0a9e('0x35')]));if(!this[_0x0a9e('0x76')](_0x3c9135[_0x0a9e('0x54')])){return this[_0x0a9e('0xd')][_0x0a9e('0xa8')]('no\x20text\x20configured');}var _0x2272bc='\x22'+_0x3c9135[_0x0a9e('0x54')]+'\x22';if(this[_0x0a9e('0x76')](_0x3c9135[_0x0a9e('0x6d')])){_0x2272bc+=','+_0x3c9135[_0x0a9e('0x6d')];}var _0x253f74=this[_0x0a9e('0xd')][_0x0a9e('0x4f')]('MRCPSynth',_0x2272bc);if(_0x253f74[_0x0a9e('0x97')]===-0x1){return _0x253f74;}return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](util['format'](_0x0a9e('0xb0'),_0x2272bc));};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0xb1')]=function(_0x97d5b5){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')](_0x0a9e('0xb2'),_0x97d5b5[_0x0a9e('0x35')]));if(!this[_0x0a9e('0x76')](_0x97d5b5[_0x0a9e('0x54')])){return this['channel'][_0x0a9e('0xa8')](_0x0a9e('0xb3'));}var _0x15a9ed='\x22'+_0x97d5b5[_0x0a9e('0x54')]+'\x22';if(this[_0x0a9e('0x76')](_0x97d5b5[_0x0a9e('0x6d')])){_0x15a9ed+=','+_0x97d5b5['options'];}var _0x382687=this['channel']['exec']('MRCPSynth',_0x15a9ed);if(_0x382687[_0x0a9e('0x97')]===-0x1){return _0x382687;}return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](util[_0x0a9e('0x28')]('Executed\x20command\x20MRCPSynth\x20%s',_0x15a9ed));};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0xb4')]=function(_0x3ddbc7){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x3ddbc7['label']));if(!this[_0x0a9e('0x76')](_0x3ddbc7[_0x0a9e('0xb5')])){return this[_0x0a9e('0xd')]['noop'](_0x0a9e('0xb6'));}var _0x248a9a=_0x3ddbc7[_0x0a9e('0xb5')];if(this['isConfigured'](_0x3ddbc7[_0x0a9e('0x6d')])){_0x248a9a+=','+_0x3ddbc7[_0x0a9e('0x6d')];}var _0x15ba6b=this['channel'][_0x0a9e('0x4f')](_0x0a9e('0xb7'),_0x248a9a);if(_0x15ba6b[_0x0a9e('0x97')]===-0x1){return _0x15ba6b;}var _0x549e03=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0x0a9e('0xb8'));if(_0x549e03[_0x0a9e('0x97')]===-0x1){return _0x549e03;}var _0xcbc73c=this[_0x0a9e('0x96')]('RECOG_INPUT()',_0x0a9e('0xb9'));if(_0xcbc73c['result']===-0x1){return _0xcbc73c;}var _0x3b4af9=this[_0x0a9e('0x96')](_0x0a9e('0xba'),'LUMENVOX_ASR_INSTANCE');if(_0x3b4af9[_0x0a9e('0x97')]===-0x1){return _0x3b4af9;}return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](util['format'](_0x0a9e('0xbb'),_0x248a9a));};AGIVertices['prototype'][_0x0a9e('0xbc')]=function(_0x5c57e1){logger[_0x0a9e('0x2b')](util['format'](_0x0a9e('0xbd'),_0x5c57e1[_0x0a9e('0x35')]));if(!this[_0x0a9e('0x76')](_0x5c57e1[_0x0a9e('0xb5')])){return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](_0x0a9e('0xb6'));}var _0x5acdc9=_0x5c57e1[_0x0a9e('0xb5')];if(this[_0x0a9e('0x76')](_0x5c57e1['options'])){_0x5acdc9+=','+_0x5c57e1[_0x0a9e('0x6d')];}var _0x3753ca=this['channel'][_0x0a9e('0x4f')](_0x0a9e('0xb7'),_0x5acdc9);if(_0x3753ca[_0x0a9e('0x97')]===-0x1){return _0x3753ca;}var _0x569528=this[_0x0a9e('0x96')](_0x0a9e('0xbe'),_0x0a9e('0xbf'));if(_0x569528[_0x0a9e('0x97')]===-0x1){return _0x569528;}var _0x2003bc=this[_0x0a9e('0x96')](_0x0a9e('0xc0'),_0x0a9e('0xc1'));if(_0x2003bc[_0x0a9e('0x97')]===-0x1){return _0x2003bc;}var _0x426c3c=this['getAndSetVariable'](_0x0a9e('0xba'),'SESTEK_ASR_INSTANCE');if(_0x426c3c[_0x0a9e('0x97')]===-0x1){return _0x426c3c;}return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](util[_0x0a9e('0x28')](_0x0a9e('0xbb'),_0x5acdc9));};AGIVertices[_0x0a9e('0x10')]['database']=function(_0x119708){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x119708[_0x0a9e('0x35')]));if(!this[_0x0a9e('0x76')](_0x119708[_0x0a9e('0xc2')])){return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x119708,_0x0a9e('0xc3'));}var _0x1e93f5=this['getSquareOdbc'][_0x0a9e('0x66')](this,_0x119708[_0x0a9e('0xc2')]);if(!_0x1e93f5){return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x119708,_0x0a9e('0xc4'));}if(!this[_0x0a9e('0x76')](_0x119708[_0x0a9e('0x2d')])){return this['channel']['error'](_0x119708,_0x0a9e('0xc5'));}var _0x3f507c=_0x119708[_0x0a9e('0x2d')][_0x0a9e('0x51')](/(\r\n|\n|\r)/gm,'\x20');this[_0x0a9e('0xd')][_0x0a9e('0xa8')](util[_0x0a9e('0x28')]('query:\x20%s',_0x3f507c));var _0x39ea62=this[_0x0a9e('0x29')][_0x0a9e('0x66')](this,_0x1e93f5,_0x3f507c);this[_0x0a9e('0x33')][_0x0a9e('0x66')](this,_0x119708,_0x3f507c);if(!this[_0x0a9e('0x76')](_0x119708[_0x0a9e('0xc6')])){return this['channel'][_0x0a9e('0xa8')](_0x0a9e('0xc7'));}var _0x231826=this['getVariable'][_0x0a9e('0x66')](this,_0x119708[_0x0a9e('0xc6')]);if(!_0x231826){return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x119708,'no\x20variable\x20found');}var _0x38892b=this;var _0xcbbea0=0x0;if(_0x39ea62[_0x0a9e('0x93')]){_0xcbbea0=_0x39ea62[_0x0a9e('0x93')];_0x39ea62[_0x0a9e('0xc8')](function(_0x20c130,_0x3e365c){Object[_0x0a9e('0xc9')](_0x20c130)['forEach'](function(_0x3ede01){_0x38892b[_0x0a9e('0xd')][_0x0a9e('0xca')](util[_0x0a9e('0x28')]('%s[%s][%s]',_0x231826,_0x3e365c,_0x3ede01),_0x20c130[_0x3ede01]);});});}this['channel'][_0x0a9e('0xca')](util[_0x0a9e('0x28')](_0x0a9e('0xcb'),_0x231826),_0xcbbea0);return this['channel'][_0x0a9e('0xa8')](util[_0x0a9e('0x28')]('variable\x20%s\x20set',_0x231826));};AGIVertices[_0x0a9e('0x10')]['dial']=function(_0x35cc2a){logger['debug'](util['format']('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x35cc2a[_0x0a9e('0x35')]));if(!this[_0x0a9e('0x76')](_0x35cc2a[_0x0a9e('0xcc')])){return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x35cc2a,_0x0a9e('0xcd'));}var _0x48fbef=this[_0x0a9e('0x19')][_0x0a9e('0x66')](this,_0x35cc2a[_0x0a9e('0xcc')]);if(!_0x48fbef){return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x35cc2a,_0x0a9e('0xce'));}var _0x31c937=this['channel']['exec'](_0x0a9e('0xcf'),[util['format'](_0x0a9e('0xd0'),_0x48fbef),_0x35cc2a[_0x0a9e('0x5b')],_0x35cc2a[_0x0a9e('0xd1')],_0x35cc2a[_0x0a9e('0x68')]]);if(_0x31c937[_0x0a9e('0x97')]===-0x1){return _0x31c937;}return this[_0x0a9e('0xd')]['noop'](util[_0x0a9e('0x28')]('Executed\x20command\x20%s','DIAL'));};AGIVertices[_0x0a9e('0x10')]['dialogflow']=function(_0x38dceb){logger['info'](util['format'](_0x0a9e('0xd2'),_0x38dceb['label']));if(!this[_0x0a9e('0x76')](_0x38dceb[_0x0a9e('0x75')])){return this[_0x0a9e('0xd')]['noop'](_0x0a9e('0xd3'));}if(!this[_0x0a9e('0x76')](_0x38dceb[_0x0a9e('0x54')])){return this['channel']['noop'](_0x0a9e('0xb3'));}this[_0x0a9e('0xd')][_0x0a9e('0xd4')]=!![];this[_0x0a9e('0x33')](_0x38dceb);this[_0x0a9e('0x3e')](_0x38dceb[_0x0a9e('0x54')],'in');this[_0x0a9e('0xd')][_0x0a9e('0xa8')](util[_0x0a9e('0x28')](_0x0a9e('0xd5'),_0x38dceb['text']));var _0x51fa33=this['googleDialogflow'][_0x0a9e('0x66')](this,_0x38dceb);if(_0x51fa33){for(var _0x19dcc2 in _0x51fa33){if(_0x51fa33[_0x0a9e('0x89')](_0x19dcc2)){this[_0x0a9e('0xd')][_0x0a9e('0xca')](util[_0x0a9e('0x28')](_0x0a9e('0xd6'),_0x19dcc2[_0x0a9e('0xd7')]()),_0x51fa33[_0x19dcc2]);}}this['createSquareMessage'](_0x51fa33['speech'],_0x0a9e('0xd8'));return this[_0x0a9e('0xd')]['noop'](util[_0x0a9e('0x28')](_0x0a9e('0xd9'),_0x51fa33[_0x0a9e('0xda')]));}return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x38dceb,_0x0a9e('0xdb'));};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0xdc')]=function(_0x59f8f7){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')](_0x0a9e('0xdd'),_0x59f8f7['label']));if(!this[_0x0a9e('0x76')](_0x59f8f7[_0x0a9e('0xde')])){return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](_0x0a9e('0xdf'));}if(!this[_0x0a9e('0x76')](_0x59f8f7[_0x0a9e('0xe0')])){return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](_0x0a9e('0xe1'));}if(!this[_0x0a9e('0x76')](_0x59f8f7[_0x0a9e('0xe2')])){return this['channel']['noop'](_0x0a9e('0xe3'));}if(!this[_0x0a9e('0x76')](_0x59f8f7[_0x0a9e('0xe4')])){return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](_0x0a9e('0xb3'));}this[_0x0a9e('0xd')]['bot']=!![];this[_0x0a9e('0x33')](_0x59f8f7);this['createSquareMessage'](_0x59f8f7[_0x0a9e('0x54')],'in');this[_0x0a9e('0xd')][_0x0a9e('0xa8')](util[_0x0a9e('0x28')](_0x0a9e('0xe5'),_0x59f8f7[_0x0a9e('0x54')]));var _0x465003=this[_0x0a9e('0x70')][_0x0a9e('0x66')](this,_0x59f8f7);if(_0x465003){for(var _0x32a199 in _0x465003){if(_0x465003[_0x0a9e('0x89')](_0x32a199)){this[_0x0a9e('0xd')][_0x0a9e('0xca')](util[_0x0a9e('0x28')](_0x0a9e('0xe6'),_0x32a199[_0x0a9e('0xd7')]()),_0x465003[_0x32a199]);}}this['createSquareMessage'](_0x465003['speech'],_0x0a9e('0xd8'));if(_0x465003[_0x0a9e('0xe7')]){this['channel']['noop'](util[_0x0a9e('0x28')](_0x0a9e('0xe8'),_0x465003[_0x0a9e('0xe7')]));var _0x596178=this[_0x0a9e('0xd')]['streamFile'](_0x465003[_0x0a9e('0xe7')]);try{fs['unlink'](_0x465003[_0x0a9e('0xe7')]+'.wav');}catch(_0x122e7d){logger[_0x0a9e('0x49')](_0x122e7d);}return _0x596178;}else{return this[_0x0a9e('0xd')]['noop'](util[_0x0a9e('0x28')]('SestekNDA\x20Result\x20%s',_0x465003['speech']));}}return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x59f8f7,_0x0a9e('0xe9'));};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0xea')]=function(_0x7b05ba){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')](_0x0a9e('0xeb'),_0x7b05ba[_0x0a9e('0x35')]));return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](_0x0a9e('0xea'));};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0xec')]=function(_0x65141c){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')](_0x0a9e('0xed'),_0x65141c['label']));var _0x233e48='';if(_0x65141c[_0x0a9e('0xee')]){if(!this[_0x0a9e('0x76')](_0x65141c[_0x0a9e('0xee')])){return this['channel']['error'](_0x65141c,'no\x20trunk\x20selected');}else{var _0x2b8823=parseInt(_0x65141c['trunk_id'],0xa);if(isNaN(_0x2b8823)){_0x233e48=_0x65141c[_0x0a9e('0xee')];}else{_0x233e48=this[_0x0a9e('0x1b')][_0x0a9e('0x66')](this,_0x65141c[_0x0a9e('0xee')]);if(!_0x233e48){return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x65141c,_0x0a9e('0xef'));}}}}else if(_0x65141c[_0x0a9e('0xf0')]){_0x233e48=_0x65141c[_0x0a9e('0xf0')];}else{return this[_0x0a9e('0xd')]['error'](_0x65141c,_0x0a9e('0xf1'));}var _0x47a018=this[_0x0a9e('0xd')]['exec'](_0x0a9e('0xcf'),[util[_0x0a9e('0x28')](_0x0a9e('0xf2'),_0x233e48,_0x65141c['phone']),_0x65141c[_0x0a9e('0x5b')],_0x65141c[_0x0a9e('0xd1')],_0x65141c['url']]);if(_0x47a018['result']===-0x1){return _0x47a018;}return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](util[_0x0a9e('0x28')]('Executed\x20command\x20%s','DIAL'));};AGIVertices['prototype'][_0x0a9e('0xf3')]=function(_0x22c591){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')](_0x0a9e('0xf4'),_0x22c591[_0x0a9e('0x35')]));return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](_0x0a9e('0xf3'));};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0xf5')]=function(_0x2f4de1){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')](_0x0a9e('0xf6'),_0x2f4de1[_0x0a9e('0x35')]));if(_0x2f4de1[_0x0a9e('0x99')]===0x0){return this[_0x0a9e('0x9a')](_0x2f4de1);}_0x2f4de1['retry']-=0x1;if(!this[_0x0a9e('0x76')](_0x2f4de1[_0x0a9e('0xf7')])){return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x2f4de1,_0x0a9e('0xf8'));}var _0x37d5c9=this['getSound'][_0x0a9e('0x66')](this,_0x2f4de1[_0x0a9e('0xf7')]);if(!_0x37d5c9){return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x2f4de1,_0x0a9e('0xf9'));}if(!this[_0x0a9e('0x76')](_0x2f4de1[_0x0a9e('0xc6')])){return this[_0x0a9e('0xd')][_0x0a9e('0x49')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x5d27c1=this[_0x0a9e('0xd')][_0x0a9e('0xfa')](_0x37d5c9,_0x2f4de1['response'],_0x2f4de1[_0x0a9e('0xfb')]);var _0x306aa5=_0x5d27c1['result']?_0x5d27c1[_0x0a9e('0x97')]['toString']():'';logger[_0x0a9e('0x2b')](_0x0a9e('0xfc'),JSON['stringify'](_0x5d27c1));if(_0x5d27c1[_0x0a9e('0x97')]===-0x1){this[_0x0a9e('0x33')]['sync'](this,_0x2f4de1,_0x306aa5);return _0x5d27c1;}else if(_0x5d27c1[_0x0a9e('0x95')]===_0x0a9e('0x5b')){_0x5d27c1['result']=_0x306aa5[_0x0a9e('0x93')]>=parseInt(_0x2f4de1[_0x0a9e('0xfd')])?'x':'i';}else{_0x5d27c1[_0x0a9e('0x97')]=_0x306aa5[_0x0a9e('0x93')]>=parseInt(_0x2f4de1[_0x0a9e('0xfd')])&&_0x306aa5[_0x0a9e('0x93')]<=parseInt(_0x2f4de1['maxdigit'])?'x':'i';}var _0x1e5b09=this[_0x0a9e('0x11')]['sync'](this,_0x2f4de1[_0x0a9e('0xc6')]);if(!_0x1e5b09){return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x2f4de1,_0x0a9e('0xfe'));}this[_0x0a9e('0xd')][_0x0a9e('0xca')](_0x1e5b09,_0x306aa5);if(this[_0x0a9e('0x76')](_0x2f4de1['hiddendigitsnum'])){var _0x49e1b8=parseInt(_0x2f4de1['hiddendigitsnum'],0xa);var _0x55d764=rs['generate']({'charset':'*','length':_0x49e1b8});var _0x269038=_0x306aa5[_0x0a9e('0x93')];if(_0x269038>0x0){if(_0x269038>_0x49e1b8){this['createSquareDetailsReport']['sync'](this,_0x2f4de1,_0x2f4de1[_0x0a9e('0xff')]==='first'?_0x55d764+_0x306aa5[_0x0a9e('0x100')](_0x49e1b8):_0x306aa5[_0x0a9e('0x100')](0x0,_0x269038-_0x49e1b8)+_0x55d764);}else{this[_0x0a9e('0x33')][_0x0a9e('0x66')](this,_0x2f4de1,rs[_0x0a9e('0x101')]({'charset':'*','length':_0x269038}));}}else{this[_0x0a9e('0x33')]['sync'](this,_0x2f4de1,'');}}else{this[_0x0a9e('0x33')][_0x0a9e('0x66')](this,_0x2f4de1,_0x306aa5);}return _0x5d27c1;};AGIVertices['prototype'][_0x0a9e('0xc')]=function(_0x1c0d54){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')](_0x0a9e('0x102'),_0x1c0d54[_0x0a9e('0x35')]));return this[_0x0a9e('0xf5')](_0x1c0d54);};AGIVertices['prototype'][_0x0a9e('0x103')]=function(_0x508395){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x508395[_0x0a9e('0x35')]));this[_0x0a9e('0x33')]['sync'](this,_0x508395,_0x508395[_0x0a9e('0x104')]);return this['channel'][_0x0a9e('0xa8')](util[_0x0a9e('0x28')]('GOAL\x20%s',_0x508395[_0x0a9e('0x104')]));};AGIVertices['prototype'][_0x0a9e('0x105')]=function(_0x179137){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')](_0x0a9e('0x106'),_0x179137[_0x0a9e('0x35')]));if(!this[_0x0a9e('0x76')](_0x179137['aws_access_key_id'])||!this[_0x0a9e('0x76')](_0x179137[_0x0a9e('0x7f')])){return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](_0x0a9e('0x107'));}if(!this['isConfigured'](_0x179137[_0x0a9e('0x54')])){return this['channel']['noop'](_0x0a9e('0xb3'));}this['channel'][_0x0a9e('0xa8')](util[_0x0a9e('0x28')]('Trying\x20aws\x20Polly\x20%s',_0x179137[_0x0a9e('0x54')]));var _0x4043e7=this[_0x0a9e('0x78')][_0x0a9e('0x66')](this,_0x179137);if(_0x4043e7){this[_0x0a9e('0xd')][_0x0a9e('0xa8')](util[_0x0a9e('0x28')](_0x0a9e('0x108'),_0x4043e7));var _0x3d02ae=this['channel'][_0x0a9e('0x109')](_0x4043e7);try{fs[_0x0a9e('0x10a')](_0x4043e7+_0x0a9e('0x10b'));}catch(_0x43403c){logger['error'](_0x43403c);}return _0x3d02ae;}return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x179137,_0x0a9e('0x10c'));};AGIVertices['prototype'][_0x0a9e('0x10d')]=function(_0x2191c6){logger[_0x0a9e('0x2b')](util['format'](_0x0a9e('0x10e'),_0x2191c6['label']));if(!this[_0x0a9e('0x76')](_0x2191c6[_0x0a9e('0x79')])||!this[_0x0a9e('0x76')](_0x2191c6[_0x0a9e('0x7f')])){return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](_0x0a9e('0x107'));}if(!this['isConfigured'](_0x2191c6[_0x0a9e('0x80')])){return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](_0x0a9e('0x10f'));}if(!this[_0x0a9e('0x76')](_0x2191c6[_0x0a9e('0x54')])){return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](_0x0a9e('0xb3'));}this[_0x0a9e('0xd')][_0x0a9e('0xd4')]=!![];this[_0x0a9e('0x33')](_0x2191c6);this[_0x0a9e('0x3e')](_0x2191c6[_0x0a9e('0x54')],'in');this[_0x0a9e('0xd')][_0x0a9e('0xa8')](util[_0x0a9e('0x28')](_0x0a9e('0x110'),_0x2191c6[_0x0a9e('0x54')]));var _0x611e46=this[_0x0a9e('0x7e')][_0x0a9e('0x66')](this,_0x2191c6);if(_0x611e46){for(var _0x213a64 in _0x611e46){if(_0x611e46['hasOwnProperty'](_0x213a64)&&_[_0x0a9e('0x8a')](_0x611e46[_0x213a64])){this[_0x0a9e('0xd')][_0x0a9e('0xca')](util['format'](_0x0a9e('0x111'),_0x213a64['toUpperCase']()),_0x611e46[_0x213a64]);}}if(_[_0x0a9e('0x41')](_0x611e46[_0x0a9e('0x6c')])){return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](_0x0a9e('0x112'));}else{this[_0x0a9e('0x3e')](_0x611e46[_0x0a9e('0x6c')],_0x0a9e('0xd8'));return this['channel'][_0x0a9e('0xa8')](util[_0x0a9e('0x28')]('Amazon\x20Lex\x20Result\x20%s',_0x611e46[_0x0a9e('0x6c')]));}}return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x2191c6,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x113')]=function(_0x315299){logger[_0x0a9e('0x2b')](util['format'](_0x0a9e('0x114'),_0x315299[_0x0a9e('0x35')],_0x315299[_0x0a9e('0x5b')]));if(!this[_0x0a9e('0x76')](_0x315299[_0x0a9e('0x75')])){return this['channel'][_0x0a9e('0xa8')](_0x0a9e('0xd3'));}var _0x4df303=_0x0a9e('0x115');var _0x2d20a0=util[_0x0a9e('0x28')]('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x45ef37=util[_0x0a9e('0x28')](_0x0a9e('0x90'),_0x2d20a0,_0x4df303);var _0x283bbb=!![];if(_0x315299[_0x0a9e('0x116')]===_0x0a9e('0x117')){_0x283bbb=![];}var _0x312e02=this[_0x0a9e('0xd')]['recordFile'](_0x2d20a0,_0x4df303,_0x315299['intKey'],_0x315299[_0x0a9e('0x5b')],undefined,_0x283bbb);if(_0x312e02['result']!==-0x1){this[_0x0a9e('0xd')][_0x0a9e('0xa8')](util[_0x0a9e('0x28')](_0x0a9e('0x118'),_0x45ef37));var _0x57b11b=this[_0x0a9e('0x81')][_0x0a9e('0x66')](this,_0x315299,_0x45ef37);if(_0x57b11b){for(var _0x546bc9 in _0x57b11b){if(_0x57b11b[_0x0a9e('0x89')](_0x546bc9)){this['channel'][_0x0a9e('0xca')](util[_0x0a9e('0x28')](_0x0a9e('0x119'),_0x546bc9[_0x0a9e('0xd7')]()),_0x57b11b[_0x546bc9]);}}return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](util['format'](_0x0a9e('0x11a'),JSON['stringify'](_0x57b11b)));}}return _0x312e02;};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x11b')]=function(_0x4229e6){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')](_0x0a9e('0x11c'),_0x4229e6[_0x0a9e('0x35')]));if(!this['isConfigured'](_0x4229e6[_0x0a9e('0x84')])){return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](_0x0a9e('0x11d'));}if(!this[_0x0a9e('0x76')](_0x4229e6['appsecret'])){return this[_0x0a9e('0xd')][_0x0a9e('0xa8')]('no\x20appsecret\x20configured');}var _0x55bb89=_0x0a9e('0x115');var _0x11b33b=util[_0x0a9e('0x28')](_0x0a9e('0x11e'),FILES_PATH,rs[_0x0a9e('0x101')](0x4));var _0x1f1f36=util['format'](_0x0a9e('0x90'),_0x11b33b,_0x55bb89);var _0x13782b=!![];if(_0x4229e6[_0x0a9e('0x116')]==='NOBEEP'){_0x13782b=![];}var _0x294e90=this[_0x0a9e('0xd')][_0x0a9e('0x11f')](_0x11b33b,_0x55bb89,_0x4229e6[_0x0a9e('0x120')],_0x4229e6['timeout'],undefined,_0x13782b);if(_0x294e90['result']!==-0x1){this[_0x0a9e('0xd')][_0x0a9e('0xa8')](util[_0x0a9e('0x28')](_0x0a9e('0x121'),_0x1f1f36));var _0x1ba7b2=this[_0x0a9e('0x83')][_0x0a9e('0x66')](this,_0x4229e6,_0x1f1f36);if(_0x1ba7b2){for(var _0x23dd12 in _0x1ba7b2){if(_0x1ba7b2['hasOwnProperty'](_0x23dd12)){this[_0x0a9e('0xd')]['setVariable'](util[_0x0a9e('0x28')](_0x0a9e('0x122'),_0x23dd12[_0x0a9e('0xd7')]()),_0x1ba7b2[_0x23dd12]);}}return this['channel']['noop'](util[_0x0a9e('0x28')]('TildeASR\x20Result\x20%s',JSON[_0x0a9e('0x69')](_0x1ba7b2)));}}return _0x294e90;};AGIVertices['prototype']['gotoc']=function(_0x229d20){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')](_0x0a9e('0x123'),_0x229d20[_0x0a9e('0x35')]));return this[_0x0a9e('0xd')][_0x0a9e('0x124')](_0x229d20[_0x0a9e('0x125')],_0x229d20[_0x0a9e('0x126')],_0x229d20[_0x0a9e('0x3a')]);};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x127')]=function(_0x2b2e49){logger['info'](util['format'](_0x0a9e('0x128'),_0x2b2e49['label']));if(!this[_0x0a9e('0x76')](_0x2b2e49[_0x0a9e('0x129')])){return this[_0x0a9e('0xd')]['error'](_0x2b2e49,'no\x20condition\x20configured');}try{var _0x428009=eval(_0x2b2e49[_0x0a9e('0x129')])?_0x0a9e('0x12a'):_0x0a9e('0x12b');this[_0x0a9e('0xd')][_0x0a9e('0xa8')](util[_0x0a9e('0x28')]('EVAL\x20CONDITION\x20%s\x20%s',_0x2b2e49[_0x0a9e('0x129')],_0x428009));return{'code':0xc8,'result':_0x428009};}catch(_0x5799a6){return{'code':0xc8,'result':_0x0a9e('0x12b')};}};AGIVertices[_0x0a9e('0x10')]['gotoiftime']=function(_0x1fe77c){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')](_0x0a9e('0x12c'),_0x1fe77c[_0x0a9e('0x35')]));if(!this[_0x0a9e('0x76')](_0x1fe77c['interval_id'])){return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x1fe77c,_0x0a9e('0x12d'));}var _0x5d81af=this[_0x0a9e('0x22')][_0x0a9e('0x66')](this,_0x1fe77c[_0x0a9e('0x12e')]);if(!_0x5d81af){return this['channel'][_0x0a9e('0x49')](_0x1fe77c,_0x0a9e('0x12f'));}for(var _0x37257e=0x0;_0x37257e<_0x5d81af[_0x0a9e('0x93')];_0x37257e+=0x1){var _0x1d39bd=this[_0x0a9e('0xd')]['getVariable'](util['format'](_0x0a9e('0x130'),_0x5d81af[_0x37257e]));if(_0x1d39bd[_0x0a9e('0x97')]===-0x1){return _0x1d39bd;}logger['info'](util[_0x0a9e('0x28')](_0x0a9e('0x131'),_0x5d81af[_0x37257e],_0x1d39bd[_0x0a9e('0x95')]));if(_0x1d39bd[_0x0a9e('0x95')]===_0x0a9e('0x12a')){logger[_0x0a9e('0x2b')](util['format'](_0x0a9e('0x131'),_0x5d81af[_0x37257e],_0x0a9e('0x12a')));this[_0x0a9e('0xd')]['noop'](util[_0x0a9e('0x28')](_0x0a9e('0x131'),_0x5d81af[_0x37257e],_0x0a9e('0x12a')));return{'code':0xc8,'result':_0x0a9e('0x12a')};}else{logger['info'](util['format'](_0x0a9e('0x131'),_0x5d81af[_0x37257e],_0x0a9e('0x12b')));this[_0x0a9e('0xd')]['noop'](util[_0x0a9e('0x28')](_0x0a9e('0x131'),_0x5d81af[_0x37257e],_0x0a9e('0x12b')));}}return{'code':0xc8,'result':_0x0a9e('0x12b')};};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x132')]=function(_0x37c14b){logger[_0x0a9e('0x2b')](util['format']('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x37c14b[_0x0a9e('0x35')]));return this[_0x0a9e('0xd')]['hangup']();};AGIVertices[_0x0a9e('0x10')]['ispeechasr']=function(_0x1f80cb){logger[_0x0a9e('0x2b')](util['format'](_0x0a9e('0x133'),_0x1f80cb[_0x0a9e('0x35')]));if(!this['isConfigured'](_0x1f80cb[_0x0a9e('0x75')])){return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](_0x0a9e('0xd3'));}var _0x434df7=_0x0a9e('0x115');var _0x25b2b9=util['format'](_0x0a9e('0x11e'),FILES_PATH,rs[_0x0a9e('0x101')](0x4));var _0x448946=util[_0x0a9e('0x28')](_0x0a9e('0x90'),_0x25b2b9,_0x434df7);var _0x256228=!![];if(_0x1f80cb[_0x0a9e('0x116')]==='NOBEEP'){_0x256228=![];}var _0x4dbec7=this[_0x0a9e('0xd')][_0x0a9e('0x11f')](_0x25b2b9,_0x434df7,_0x1f80cb[_0x0a9e('0x120')],_0x1f80cb['timeout'],undefined,_0x256228);if(_0x4dbec7['result']!==-0x1){this[_0x0a9e('0xd')]['noop'](util[_0x0a9e('0x28')](_0x0a9e('0x134'),_0x448946));var _0x112789=this[_0x0a9e('0x74')][_0x0a9e('0x66')](this,_0x1f80cb,_0x448946);if(_0x112789){for(var _0x13c6df in _0x112789){if(_0x112789[_0x0a9e('0x89')](_0x13c6df)){this[_0x0a9e('0xd')][_0x0a9e('0xca')](util['format']('ISPEECH_ASR_%s',_0x13c6df[_0x0a9e('0xd7')]()),_0x112789[_0x13c6df]);}}return this['channel'][_0x0a9e('0xa8')](util[_0x0a9e('0x28')](_0x0a9e('0x135'),JSON[_0x0a9e('0x69')](_0x112789)));}}return _0x4dbec7;};AGIVertices['prototype'][_0x0a9e('0x136')]=function(_0x2ee2fc){logger[_0x0a9e('0x2b')](util['format'](_0x0a9e('0x137'),_0x2ee2fc[_0x0a9e('0x35')]));if(!this[_0x0a9e('0x76')](_0x2ee2fc['key'])){return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](_0x0a9e('0xd3'));}if(!this[_0x0a9e('0x76')](_0x2ee2fc[_0x0a9e('0x54')])){return this[_0x0a9e('0xd')]['noop']('no\x20text\x20configured');}this[_0x0a9e('0xd')][_0x0a9e('0xa8')](util[_0x0a9e('0x28')]('Trying\x20ispeech\x20TTS\x20%s',_0x2ee2fc['text']));var _0x2a5c2a=this[_0x0a9e('0x71')][_0x0a9e('0x66')](this,_0x2ee2fc);if(_0x2a5c2a){this['channel']['noop'](util[_0x0a9e('0x28')](_0x0a9e('0x134'),_0x2a5c2a));var _0x33046a=this[_0x0a9e('0xd')][_0x0a9e('0x109')](_0x2a5c2a,_0x2ee2fc['intKey']);try{fs[_0x0a9e('0x10a')](_0x2a5c2a+'.wav');}catch(_0x385f4e){logger[_0x0a9e('0x49')](_0x385f4e);}return _0x33046a;}return this['channel'][_0x0a9e('0x49')](_0x2ee2fc,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x138')]=function(_0x43e749){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x43e749[_0x0a9e('0x35')]));if(!this[_0x0a9e('0x76')](_0x43e749[_0x0a9e('0x139')])){return this['channel'][_0x0a9e('0x49')](_0x43e749,'no\x20find\x20by\x20configured');}logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')](_0x0a9e('0x13a'),this['channel'][_0x0a9e('0x37')],_0x43e749[_0x0a9e('0x139')]));var _0x310f89=this[_0x0a9e('0x4b')][_0x0a9e('0x66')](this,_0x43e749[_0x0a9e('0x139')]);if(_0x310f89){logger['info'](util[_0x0a9e('0x28')](_0x0a9e('0x13b'),this[_0x0a9e('0xd')][_0x0a9e('0x37')],_0x43e749[_0x0a9e('0x139')]));this[_0x0a9e('0xd')][_0x0a9e('0xa8')](util[_0x0a9e('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x0a9e('0xd')][_0x0a9e('0x37')],_0x43e749[_0x0a9e('0x139')]));return{'code':0xc8,'result':_0x0a9e('0x13c')};}else{logger['info'](util[_0x0a9e('0x28')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x0a9e('0xd')][_0x0a9e('0x37')],_0x43e749[_0x0a9e('0x139')]));this['channel'][_0x0a9e('0xa8')](util[_0x0a9e('0x28')](_0x0a9e('0x13d'),this[_0x0a9e('0xd')]['callerid'],_0x43e749[_0x0a9e('0x139')]));return{'code':0xc8,'result':_0x0a9e('0x13e')};}};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x13f')]=function(_0x17500e){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x17500e[_0x0a9e('0x35')]));if(!this[_0x0a9e('0x76')](_0x17500e[_0x0a9e('0x139')])){return this[_0x0a9e('0xd')]['error'](_0x17500e,_0x0a9e('0x140'));}logger['info'](util[_0x0a9e('0x28')](_0x0a9e('0x13a'),this[_0x0a9e('0xd')][_0x0a9e('0x37')],_0x17500e[_0x0a9e('0x139')]));var _0x478b46=this[_0x0a9e('0x4a')]['sync'](this,_0x17500e[_0x0a9e('0x139')]);if(_0x478b46){logger['info'](util[_0x0a9e('0x28')](_0x0a9e('0x13b'),this['channel'][_0x0a9e('0x37')],_0x17500e[_0x0a9e('0x139')]));this[_0x0a9e('0xd')][_0x0a9e('0xa8')](util['format'](_0x0a9e('0x13b'),this[_0x0a9e('0xd')]['callerid'],_0x17500e[_0x0a9e('0x139')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util['format'](_0x0a9e('0x13d'),this[_0x0a9e('0xd')]['callerid'],_0x17500e[_0x0a9e('0x139')]));this[_0x0a9e('0xd')]['noop'](util[_0x0a9e('0x28')](_0x0a9e('0x13d'),this[_0x0a9e('0xd')][_0x0a9e('0x37')],_0x17500e[_0x0a9e('0x139')]));return{'code':0xc8,'result':_0x0a9e('0x13e')};}};AGIVertices[_0x0a9e('0x10')]['math']=function(_0x3d7738){logger['info'](util[_0x0a9e('0x28')](_0x0a9e('0x141'),_0x3d7738[_0x0a9e('0x35')]));if(!this[_0x0a9e('0x76')](_0x3d7738[_0x0a9e('0x142')])){return this[_0x0a9e('0xd')]['error'](_0x3d7738,_0x0a9e('0x143'));}this[_0x0a9e('0xd')][_0x0a9e('0xa8')](util['format'](_0x0a9e('0x144'),_0x3d7738[_0x0a9e('0x142')]));var _0xd886e5=eval(_0x3d7738[_0x0a9e('0x142')]);if(!this[_0x0a9e('0x76')](_0x3d7738[_0x0a9e('0xc6')])){return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](_0x0a9e('0xc7'));}var _0x1ca28d=this[_0x0a9e('0x11')][_0x0a9e('0x66')](this,_0x3d7738[_0x0a9e('0xc6')]);if(!_0x1ca28d){return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x3d7738,_0x0a9e('0xfe'));}if(_['isArray'](_0xd886e5)){var _0x20ebd0=this;_0xd886e5[_0x0a9e('0xc8')](function(_0x1f88ef,_0x5c6e53){_0x20ebd0[_0x0a9e('0xd')][_0x0a9e('0xca')](util[_0x0a9e('0x28')](_0x0a9e('0x145'),_0x1ca28d,_0x5c6e53),_0x1f88ef);});return this['channel'][_0x0a9e('0xa8')](util[_0x0a9e('0x28')](_0x0a9e('0x146'),_0x1ca28d));}else{return this[_0x0a9e('0xd')]['setVariable'](_0x1ca28d,_0xd886e5);}};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x147')]=function(_0x132455){logger[_0x0a9e('0x2b')](util['format']('Enter\x20in\x20MENU\x20(%s)\x20block',_0x132455[_0x0a9e('0x35')]));if(_0x132455[_0x0a9e('0x99')]===0x0){return this[_0x0a9e('0x9a')](_0x132455);}_0x132455[_0x0a9e('0x99')]-=0x1;if(!this[_0x0a9e('0x76')](_0x132455[_0x0a9e('0xf7')])){return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x132455,_0x0a9e('0xf8'));}var _0x84117=this[_0x0a9e('0x1c')][_0x0a9e('0x66')](this,_0x132455[_0x0a9e('0xf7')]);if(!_0x84117){return this[_0x0a9e('0xd')]['error'](_0x132455,_0x0a9e('0xf9'));}var _0x5ce227=this[_0x0a9e('0xd')]['getData'](_0x84117,_0x132455['response'],_0x132455[_0x0a9e('0x148')]);var _0x51ec16=_0x5ce227[_0x0a9e('0x97')];if(_0x5ce227[_0x0a9e('0x97')]===-0x1){this[_0x0a9e('0x33')][_0x0a9e('0x66')](this,_0x132455,'-1');return _0x5ce227;}else if(_0x5ce227['extra']==='timeout'){_0x5ce227[_0x0a9e('0x97')]=_0x5ce227[_0x0a9e('0x97')][_0x0a9e('0x93')]>0x0?_0x5ce227[_0x0a9e('0x97')]:'t';}else if(_['isEmpty'](_0x5ce227[_0x0a9e('0x97')])){_0x5ce227[_0x0a9e('0x97')]='#';_0x51ec16='#';}if(!this[_0x0a9e('0x76')](_0x132455[_0x0a9e('0xc6')])){this[_0x0a9e('0xd')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x35b0e6=this[_0x0a9e('0x11')][_0x0a9e('0x66')](this,_0x132455[_0x0a9e('0xc6')]);if(!_0x35b0e6){return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x132455,_0x0a9e('0xfe'));}this['channel'][_0x0a9e('0xca')](_0x35b0e6,_0x51ec16);}this[_0x0a9e('0x33')][_0x0a9e('0x66')](this,_0x132455,_0x51ec16);return _0x5ce227;};AGIVertices['prototype']['noop']=function(_0x521fd9){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x521fd9[_0x0a9e('0x35')]));return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](_0x521fd9['output']||_0x521fd9['label']);};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x149')]=function(_0xf10a48){logger[_0x0a9e('0x2b')](util['format'](_0x0a9e('0x14a'),_0xf10a48['label']));if(!this['isConfigured'](_0xf10a48[_0x0a9e('0x139')])){return this['channel'][_0x0a9e('0x49')](_0xf10a48,_0x0a9e('0x140'));}logger[_0x0a9e('0x2b')](util['format'](_0x0a9e('0x13a'),this[_0x0a9e('0xd')][_0x0a9e('0x37')],_0xf10a48['findBy']));var _0x5b20fa=this[_0x0a9e('0x46')][_0x0a9e('0x66')](this,_0xf10a48[_0x0a9e('0x14b')]);var _0x21fcaa=this[_0x0a9e('0x14c')][_0x0a9e('0x66')](this,_0xf10a48['findBy'],_0x5b20fa);if(_0x21fcaa){logger['info'](util[_0x0a9e('0x28')](_0x0a9e('0x13b'),this['channel']['callerid'],_0xf10a48['findBy']));this['channel']['noop'](util['format'](_0x0a9e('0x13b'),this['channel'][_0x0a9e('0x37')],_0xf10a48[_0x0a9e('0x139')]));return{'code':0xc8,'result':_0x0a9e('0x13c')};}else{logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')](_0x0a9e('0x13d'),this[_0x0a9e('0xd')]['callerid'],_0xf10a48[_0x0a9e('0x139')]));this[_0x0a9e('0xd')][_0x0a9e('0xa8')](util[_0x0a9e('0x28')](_0x0a9e('0x13b'),this[_0x0a9e('0xd')][_0x0a9e('0x37')],_0xf10a48[_0x0a9e('0x139')]));return{'code':0xc8,'result':_0x0a9e('0x13e')};}};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x14d')]=function(_0x5d48c2){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x5d48c2[_0x0a9e('0x35')]));if(!this['isConfigured'](_0x5d48c2[_0x0a9e('0xf7')])){return this[_0x0a9e('0xd')]['error'](_0x5d48c2,'no\x20file\x20audio\x20selected');}var _0x3fc37e=this['getSound'][_0x0a9e('0x66')](this,_0x5d48c2[_0x0a9e('0xf7')]);if(!_0x3fc37e){return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x5d48c2,_0x0a9e('0xf9'));}var _0x5f2d17=this[_0x0a9e('0xd')]['exec']('PLAYBACK',[_0x3fc37e,_0x5d48c2[_0x0a9e('0xd1')]]);if(_0x5f2d17[_0x0a9e('0x97')]===-0x1){return _0x5f2d17;}return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](util[_0x0a9e('0x28')]('Executed\x20command\x20%s\x20%s',_0x0a9e('0x14e'),_0x3fc37e));};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x14f')]=function(_0x27569c){logger['info'](util[_0x0a9e('0x28')](_0x0a9e('0x150'),_0x27569c['label']));if(!this[_0x0a9e('0x76')](_0x27569c[_0x0a9e('0x151')])){return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x27569c,'no\x20queue\x20selected');}var _0x1696de='';var _0x457bbd=parseInt(_0x27569c[_0x0a9e('0x151')],0xa);if(isNaN(_0x457bbd)){_0x1696de=_0x27569c[_0x0a9e('0x151')];}else{_0x1696de=this[_0x0a9e('0x152')]['sync'](this,_0x27569c[_0x0a9e('0x151')]);if(!_0x1696de){return this[_0x0a9e('0xd')]['error'](_0x27569c,_0x0a9e('0x153'));}}var _0x4b0d44='';if(this[_0x0a9e('0x76')](_0x27569c[_0x0a9e('0xf7')])){var _0x41354f=this[_0x0a9e('0x1c')][_0x0a9e('0x66')](this,_0x27569c[_0x0a9e('0xf7')]);if(_0x41354f){_0x4b0d44=_0x41354f;}}this[_0x0a9e('0x33')][_0x0a9e('0x66')](this,_0x27569c,_0x1696de);if(_0x27569c[_0x0a9e('0xd1')][_0x0a9e('0x154')]('x')<0x0){_0x27569c[_0x0a9e('0xd1')]+='x';}if(_0x27569c[_0x0a9e('0xd1')][_0x0a9e('0x154')]('X')<0x0){_0x27569c[_0x0a9e('0xd1')]+='X';}this[_0x0a9e('0xd')]['setVariable'](_0x0a9e('0x155'),_0x1696de?_0x1696de[_0x0a9e('0x156')]():'');var _0x3c7717=this[_0x0a9e('0xd')][_0x0a9e('0x4f')](_0x0a9e('0x157'),[_0x1696de,_0x27569c[_0x0a9e('0xd1')],_0x27569c[_0x0a9e('0x68')],_0x4b0d44,_0x27569c['timeout'],_0x27569c['agi'],_0x27569c['macro'],_0x27569c['gosub'],'',_0x27569c[_0x0a9e('0x158')]]);if(_0x3c7717['result']===-0x1){return _0x3c7717;}return this['channel']['noop'](util[_0x0a9e('0x28')](_0x0a9e('0xad'),_0x0a9e('0x157'),_0x1696de));};AGIVertices[_0x0a9e('0x10')]['record']=function(_0x55a8c5){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')](_0x0a9e('0x159'),_0x55a8c5[_0x0a9e('0x35')]));var _0x5522de=_0x55a8c5[_0x0a9e('0x15a')]||_0x0a9e('0x115');var _0x33adc3=util[_0x0a9e('0x28')](_0x0a9e('0x15b'),this[_0x0a9e('0xd')]['uniqueid'],rs[_0x0a9e('0x101')](0x5));var _0x5056d5=util['format'](_0x0a9e('0x15c'),FILES_PATH,_0x33adc3,_0x5522de);var _0x58117c=util[_0x0a9e('0x28')](_0x0a9e('0x11e'),FILES_PATH,_0x33adc3);this[_0x0a9e('0x38')][_0x0a9e('0x66')](this,_0x55a8c5,_0x33adc3,_0x5056d5);this[_0x0a9e('0xd')][_0x0a9e('0xca')](_0x0a9e('0x15d'),_0x33adc3);logger[_0x0a9e('0x2b')](_0x0a9e('0x15e'),_0x58117c,_0x5522de,_0x55a8c5['escape_digits'],_0x55a8c5[_0x0a9e('0x5b')]);return this[_0x0a9e('0xd')]['recordFile'](_0x58117c,_0x5522de,_0x55a8c5[_0x0a9e('0x15f')],_0x55a8c5[_0x0a9e('0x5b')],undefined,!![]);};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x160')]=function(_0x5a1649){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')](_0x0a9e('0x161'),_0x5a1649[_0x0a9e('0x35')]));if(!this[_0x0a9e('0x76')](_0x5a1649['url'])){return this['channel'][_0x0a9e('0xa8')]('no\x20url\x20configured');}var _0x2859e2=this['restAPI'][_0x0a9e('0x66')](this,_0x5a1649);logger['info'](util[_0x0a9e('0x28')]('Response:',util[_0x0a9e('0x162')](_0x2859e2,{'showHidden':![],'depth':null})));if(!this[_0x0a9e('0x76')](_0x5a1649[_0x0a9e('0xc6')])){return this['channel']['noop'](_0x0a9e('0x163'));}var _0x52abeb=this[_0x0a9e('0x11')]['sync'](this,_0x5a1649[_0x0a9e('0xc6')]);if(!_0x52abeb){return this['channel'][_0x0a9e('0x49')](_0x5a1649,_0x0a9e('0xfe'));}this['channel'][_0x0a9e('0xca')](util[_0x0a9e('0x28')](_0x0a9e('0x164'),_0x52abeb),_0x2859e2[_0x0a9e('0x6b')]?_0x2859e2[_0x0a9e('0x6b')]:_0x0a9e('0x165'));this[_0x0a9e('0xd')][_0x0a9e('0xca')](util[_0x0a9e('0x28')]('%s_STATUS_MESSAGE',_0x52abeb),_0x2859e2[_0x0a9e('0x166')]?_0x2859e2[_0x0a9e('0x166')]:'OK');if(_0x2859e2[_0x0a9e('0x60')]){try{this[_0x0a9e('0x8f')](_0x2859e2[_0x0a9e('0x60')],_0x52abeb);}catch(_0x481664){logger['error'](util[_0x0a9e('0x28')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x52abeb));}}return this[_0x0a9e('0xd')]['noop'](util[_0x0a9e('0x28')](_0x0a9e('0x167'),_0x52abeb));};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x168')]=function(_0x2bf5fc){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x2bf5fc['label']));return this[_0x0a9e('0xd')][_0x0a9e('0x169')](_0x2bf5fc['digits'][_0x0a9e('0x51')](/\s+/g,''),_0x2bf5fc[_0x0a9e('0x15f')]);};AGIVertices[_0x0a9e('0x10')]['saynumber']=function(_0x55ed81){logger['info'](util[_0x0a9e('0x28')](_0x0a9e('0x16a'),_0x55ed81[_0x0a9e('0x35')]));return this[_0x0a9e('0xd')]['sayNumber'](_0x55ed81[_0x0a9e('0x5c')][_0x0a9e('0x51')](/\s+/g,''),_0x55ed81[_0x0a9e('0x15f')]);};AGIVertices['prototype'][_0x0a9e('0x16b')]=function(_0x55a6c9){logger['info'](util[_0x0a9e('0x28')](_0x0a9e('0x16c'),_0x55a6c9['label']));return this['channel'][_0x0a9e('0x16d')](_0x55a6c9['text'],_0x55a6c9[_0x0a9e('0x15f')]);};AGIVertices['prototype'][_0x0a9e('0x16e')]=function(_0xb5209d){logger[_0x0a9e('0x2b')](util['format']('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0xb5209d[_0x0a9e('0x35')]));if(!this[_0x0a9e('0x76')](_0xb5209d[_0x0a9e('0x16f')])){return this[_0x0a9e('0xd')]['noop'](_0x0a9e('0x170'));}var _0x136d28=this['getMailAccount'][_0x0a9e('0x66')](this,_0xb5209d[_0x0a9e('0x16f')]);if(!_0x136d28||!_0x136d28[_0x0a9e('0x171')]){return this['channel'][_0x0a9e('0x49')](_0xb5209d,_0x0a9e('0x172'));}var _0xb1fd37={'from':util[_0x0a9e('0x28')](_0x0a9e('0x173'),_0x136d28[_0x0a9e('0x13')],_0x136d28[_0x0a9e('0x174')]||_0x136d28[_0x0a9e('0x171')][_0x0a9e('0x175')]),'to':_0xb5209d['to']||'','cc':_0xb5209d['cc']||'','bcc':_0xb5209d[_0x0a9e('0x176')]||'','subject':_0xb5209d[_0x0a9e('0x177')],'html':_0xb5209d[_0x0a9e('0x54')],'text':_0xb5209d[_0x0a9e('0x54')]};var _0x34ff77={'tls':{'rejectUnauthorized':![]}};if(_0x136d28[_0x0a9e('0x171')][_0x0a9e('0x178')]){_0x34ff77[_0x0a9e('0x178')]=_0x136d28[_0x0a9e('0x171')][_0x0a9e('0x178')];}else{_0x34ff77[_0x0a9e('0x179')]=_0x136d28[_0x0a9e('0x171')][_0x0a9e('0x179')];_0x34ff77['port']=_0x136d28[_0x0a9e('0x171')][_0x0a9e('0x17a')];_0x34ff77[_0x0a9e('0x17b')]=_0x136d28['Smtp'][_0x0a9e('0x17b')];}if(_0x136d28[_0x0a9e('0x171')][_0x0a9e('0x17c')]){_0x34ff77[_0x0a9e('0x17d')]={'user':_0x136d28['Smtp'][_0x0a9e('0x175')],'pass':_0x136d28[_0x0a9e('0x171')]['pass']};}if(this[_0x0a9e('0x76')](_0xb5209d[_0x0a9e('0x17e')])){}logger[_0x0a9e('0x17f')]('sendMail\x20message',JSON['stringify'](_0xb1fd37));this[_0x0a9e('0x33')][_0x0a9e('0x66')](this,_0xb5209d,_0xb5209d[_0x0a9e('0x16f')]);this['channel']['noop'](util[_0x0a9e('0x28')](_0x0a9e('0x180'),_0x136d28[_0x0a9e('0x13')]));this[_0x0a9e('0x21')]['sync'](this,_0x34ff77,_0xb1fd37);return this[_0x0a9e('0xd')]['noop']('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x181')]=function(_0x195e3c){logger['info'](util[_0x0a9e('0x28')](_0x0a9e('0x182'),_0x195e3c[_0x0a9e('0x35')]));return this['channel']['noop'](_0x0a9e('0x183'));};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x184')]=function(_0x5f099e){logger['info'](util[_0x0a9e('0x28')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x5f099e['label']));if(!this['isConfigured'](_0x5f099e[_0x0a9e('0x185')])){return this[_0x0a9e('0xd')][_0x0a9e('0xa8')]('no\x20sms\x20account\x20configured');}var _0x1e0ca4=this[_0x0a9e('0x31')]['sync'](this,_0x5f099e[_0x0a9e('0x185')]);if(!_0x1e0ca4){return this['channel'][_0x0a9e('0x49')](_0x5f099e,_0x0a9e('0x186'));}var _0x497284={'body':_0x5f099e[_0x0a9e('0x187')],'phone':_0x5f099e['to']||'','SmsAccountId':_0x1e0ca4['id']};logger[_0x0a9e('0x17f')](_0x0a9e('0x188'),JSON['stringify'](_0x497284));this[_0x0a9e('0x33')][_0x0a9e('0x66')](this,_0x5f099e,_0x5f099e[_0x0a9e('0x185')]);this['channel'][_0x0a9e('0xa8')](util[_0x0a9e('0x28')](_0x0a9e('0x189'),_0x1e0ca4['name']));this[_0x0a9e('0x18a')][_0x0a9e('0x66')](this,_0x497284);return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](_0x0a9e('0x18b'));};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x18c')]=function(_0x20bd76){logger['info'](util[_0x0a9e('0x28')](_0x0a9e('0x18d'),_0x20bd76[_0x0a9e('0x35')]));if(!this[_0x0a9e('0x76')](_0x20bd76['variable_id'])){return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x20bd76,'no\x20variable\x20selected');}var _0x1f88d5=this[_0x0a9e('0x11')][_0x0a9e('0x66')](this,_0x20bd76[_0x0a9e('0xc6')]);if(!_0x1f88d5){return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x20bd76,_0x0a9e('0xfe'));}return this[_0x0a9e('0xd')]['setVariable'](_0x1f88d5,_0x20bd76[_0x0a9e('0x18e')]);};AGIVertices['prototype'][_0x0a9e('0x18f')]=function(_0x248256){logger['info'](util[_0x0a9e('0x28')](_0x0a9e('0x190'),_0x248256['label']));this[_0x0a9e('0xd')][_0x0a9e('0xa8')]('START\x20CALLY\x20SQUARE');if(_0x248256[_0x0a9e('0xa0')]==='yes'){this['channel']['noop'](_0x0a9e('0x191'));return this[_0x0a9e('0xd')]['answer']();}return this[_0x0a9e('0xd')][_0x0a9e('0xa8')]('Skipped\x20Answer');};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x192')]=function(_0x4bdcd3){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')](_0x0a9e('0x193'),_0x4bdcd3['label']));if(!this[_0x0a9e('0x76')](_0x4bdcd3[_0x0a9e('0x194')])){return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x4bdcd3,_0x0a9e('0x195'));}var _0x54571c=this[_0x0a9e('0x196')]['sync'](this,_0x4bdcd3[_0x0a9e('0x194')]);if(!this[_0x0a9e('0x76')](_0x54571c)){return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x4bdcd3,util[_0x0a9e('0x28')](_0x0a9e('0x197'),_0x4bdcd3[_0x0a9e('0x194')]));}if(_0x54571c===this[_0x0a9e('0xd')][_0x0a9e('0x3c')]){return this['channel'][_0x0a9e('0x49')](_0x4bdcd3,_0x0a9e('0x198'));}this[_0x0a9e('0x33')]['sync'](this,_0x4bdcd3,_0x54571c);var _0x48782d=this['channel']['exec']('AGI',util[_0x0a9e('0x28')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0x0a9e('0x7')][_0x0a9e('0x179')]||_0x0a9e('0x199'),_0x54571c,this[_0x0a9e('0xd')][_0x0a9e('0x3c')]));if(_0x48782d[_0x0a9e('0x97')]===-0x1){return _0x48782d;}return this['channel'][_0x0a9e('0xa8')](util['format']('Executed\x20command\x20%s\x20%s',_0x0a9e('0x19a'),_0x54571c));};AGIVertices['prototype'][_0x0a9e('0x19b')]=function(_0x5ba16e){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')](_0x0a9e('0x19c'),_0x5ba16e[_0x0a9e('0x35')]));var _0x17f6a4=this['shellCommand'][_0x0a9e('0x66')](this,_0x5ba16e[_0x0a9e('0x9c')]);this['createSquareDetailsReport'][_0x0a9e('0x66')](this,_0x5ba16e,_0x5ba16e[_0x0a9e('0x9c')]);if(this['isConfigured'](_0x5ba16e[_0x0a9e('0xc6')])){var _0x26320a=this[_0x0a9e('0x11')][_0x0a9e('0x66')](this,_0x5ba16e[_0x0a9e('0xc6')]);if(_0x26320a){this[_0x0a9e('0xd')][_0x0a9e('0xca')](_0x26320a,_0x17f6a4);return this['channel'][_0x0a9e('0xa8')](util[_0x0a9e('0x28')](_0x0a9e('0x19d'),_0x5ba16e[_0x0a9e('0x9c')],_0x26320a));}}return this['channel'][_0x0a9e('0xa8')](util[_0x0a9e('0x28')](_0x0a9e('0x19e'),_0x5ba16e[_0x0a9e('0x9c')]));};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x19f')]=function(_0x43106c){logger[_0x0a9e('0x2b')](util['format'](_0x0a9e('0x1a0'),_0x43106c[_0x0a9e('0x35')]));if(!this[_0x0a9e('0x76')](_0x43106c['apiKey'])){return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](_0x0a9e('0x1a1'));}if(!this[_0x0a9e('0x76')](_0x43106c[_0x0a9e('0x54')])){return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](_0x0a9e('0xb3'));}this[_0x0a9e('0xd')][_0x0a9e('0xa8')](util['format'](_0x0a9e('0x1a2'),_0x43106c[_0x0a9e('0x54')]));var _0x21f245=this['googleCloudTTS']['sync'](this,_0x43106c);if(_0x21f245){this[_0x0a9e('0xd')][_0x0a9e('0xa8')](util[_0x0a9e('0x28')](_0x0a9e('0x1a3'),_0x21f245));var _0x2cbfa3=this[_0x0a9e('0xd')][_0x0a9e('0x109')](_0x21f245);try{fs[_0x0a9e('0x10a')](_0x21f245+_0x0a9e('0x10b'));}catch(_0x491c2b){logger[_0x0a9e('0x49')](_0x491c2b);}return _0x2cbfa3;}return this[_0x0a9e('0xd')]['error'](_0x43106c,_0x0a9e('0x1a4'));};AGIVertices[_0x0a9e('0x10')]['tts']=function(_0x5bfbb6){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')](_0x0a9e('0x1a5'),_0x5bfbb6[_0x0a9e('0x35')]));if(!this[_0x0a9e('0x76')](_0x5bfbb6['text'])){return this[_0x0a9e('0xd')]['noop']('no\x20text\x20configured');}this['channel'][_0x0a9e('0xa8')](util['format']('Trying\x20Google\x20TTS\x20%s',_0x5bfbb6['text']));var _0x3ef164=this[_0x0a9e('0x58')][_0x0a9e('0x66')](this,_0x5bfbb6);if(_0x3ef164){this[_0x0a9e('0xd')]['noop'](util[_0x0a9e('0x28')]('Google\x20TTS\x20%s\x20file\x20created',_0x3ef164));var _0x4c81d4=this[_0x0a9e('0xd')][_0x0a9e('0x109')](_0x3ef164);try{fs[_0x0a9e('0x10a')](_0x3ef164+'.wav');}catch(_0x4820a3){logger['error'](_0x4820a3);}return _0x4c81d4;}return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x5bfbb6,_0x0a9e('0x1a6'));};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x1a7')]=function(_0x57779b){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')](_0x0a9e('0x1a8'),_0x57779b[_0x0a9e('0x35')]));if(!this[_0x0a9e('0x76')](_0x57779b[_0x0a9e('0x139')])){return this['channel'][_0x0a9e('0x49')](_0x57779b,_0x0a9e('0x140'));}logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')](_0x0a9e('0x13a'),this[_0x0a9e('0xd')][_0x0a9e('0x37')],_0x57779b[_0x0a9e('0x139')]));var _0x33ad34=this[_0x0a9e('0x1a9')][_0x0a9e('0x66')](this,_0x57779b[_0x0a9e('0x139')]);if(_0x33ad34){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')](_0x0a9e('0x13b'),this[_0x0a9e('0xd')][_0x0a9e('0x37')],_0x57779b[_0x0a9e('0x139')]));this['channel'][_0x0a9e('0xa8')](util[_0x0a9e('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x57779b[_0x0a9e('0x139')]));return{'code':0xc8,'result':_0x0a9e('0x13c')};}else{logger['info'](util[_0x0a9e('0x28')](_0x0a9e('0x13d'),this['channel'][_0x0a9e('0x37')],_0x57779b['findBy']));this[_0x0a9e('0xd')]['noop'](util[_0x0a9e('0x28')](_0x0a9e('0x13d'),this[_0x0a9e('0xd')][_0x0a9e('0x37')],_0x57779b['findBy']));return{'code':0xc8,'result':_0x0a9e('0x13e')};}};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x1aa')]=function(_0x4bc0ba){logger['info'](util['format']('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x4bc0ba[_0x0a9e('0x35')]));var _0xb4b8af=this[_0x0a9e('0xd')][_0x0a9e('0x4f')](_0x0a9e('0x1ab'),[_0x4bc0ba['mailbox'],_0x4bc0ba[_0x0a9e('0x6d')]]);if(_0xb4b8af[_0x0a9e('0x97')]===-0x1){return _0xb4b8af;}return this[_0x0a9e('0xd')][_0x0a9e('0xa8')](util['format'](_0x0a9e('0xad'),_0x0a9e('0x1ab'),_0x4bc0ba[_0x0a9e('0x1ac')]));};AGIVertices[_0x0a9e('0x10')][_0x0a9e('0x1ad')]=function(_0x498a0b){logger[_0x0a9e('0x2b')](util[_0x0a9e('0x28')](_0x0a9e('0x1ae'),_0x498a0b['label']));if(!this[_0x0a9e('0x76')](_0x498a0b['variable_id'])){return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x498a0b,_0x0a9e('0x1af'));}var _0xda737b=this[_0x0a9e('0x11')]['sync'](this,_0x498a0b[_0x0a9e('0xc6')]);if(!_0xda737b){return this[_0x0a9e('0xd')][_0x0a9e('0x49')](_0x498a0b,_0x0a9e('0xfe'));}var _0xccdd65=this['channel'][_0x0a9e('0x11')](_0xda737b);return{'code':0xc8,'result':_0xccdd65[_0x0a9e('0x95')]?_0xccdd65[_0x0a9e('0x95')]:'-'};};String['prototype'][_0x0a9e('0x94')]=function(_0x488216,_0x479441){return this[_0x0a9e('0x92')](_0x488216)['join'](_0x479441);};module[_0x0a9e('0x1b0')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 722ec5a..e4ef306 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 _0xf2ca=['[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','agentconnect','syncAgentConnect','hanguprequest','bind','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','milliseconds','diff','seconds','prototype','startAcw','channels','interface','ACW','mandatoryDisposition','mandatoryDispositionPause','name','QueuePause','then','getAgent','voicePause','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','format','YYYY-MM-DD\x20HH:mm:ss','queue','updateAcw','lastPauseAt','timer','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','info','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','uniqueid','[TIMER][STOP][AGENT:%s]','saveUnpause','update','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','message','syncAgentConnectPreview','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','[%s][HANGUP:UNIQUEID]','linkedid','isUndefined','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid'];(function(_0x31aa4b,_0x468550){var _0x49f208=function(_0x53468e){while(--_0x53468e){_0x31aa4b['push'](_0x31aa4b['shift']());}};_0x49f208(++_0x468550);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x22b70f,_0x4c853f){_0x22b70f=_0x22b70f-0x0;var _0x100985=_0xf2ca[_0x22b70f];return _0x100985;};'use strict';var util=require(_0xaf2c('0x0'));var _=require(_0xaf2c('0x1'));var moment=require(_0xaf2c('0x2'));var ami=require('../ami');var logger=require(_0xaf2c('0x3'))(_0xaf2c('0x4'));var RpcUser=require(_0xaf2c('0x5'));var RpcVoiceAgentReport=require(_0xaf2c('0x6'));function Acw(_0x3a724c){this[_0xaf2c('0x7')]=_0x3a724c['voiceQueues'];this[_0xaf2c('0x8')]=_0x3a724c[_0xaf2c('0x8')];this[_0xaf2c('0x9')]=_0x3a724c[_0xaf2c('0x9')];this['channels']={};ami['on'](_0xaf2c('0xa'),this[_0xaf2c('0xb')]['bind'](this));ami['on'](_0xaf2c('0xc'),this['syncHangupRequest'][_0xaf2c('0xd')](this));ami['on']('hangup',this[_0xaf2c('0xe')][_0xaf2c('0xd')](this));ami['on'](_0xaf2c('0xf'),this[_0xaf2c('0x10')]['bind'](this));ami['on']('attendedtransfer',this[_0xaf2c('0x11')][_0xaf2c('0xd')](this));ami['on'](_0xaf2c('0x12'),this[_0xaf2c('0x13')][_0xaf2c('0xd')](this));ami['on']('custom:agentConnectPreview',this['syncAgentConnectPreview'][_0xaf2c('0xd')](this));}function getDiff(_0x8eaf9b){var _0x935959=moment()[_0xaf2c('0x14')](0x0);var _0x293ca6=moment(_0x8eaf9b)[_0xaf2c('0x14')](0x0);return _0x935959[_0xaf2c('0x15')](_0x293ca6,_0xaf2c('0x16'));}Acw[_0xaf2c('0x17')][_0xaf2c('0x18')]=function(_0x6ac8e){try{var _0x2b4d13=this;var _0x26bf7b=this[_0xaf2c('0x19')][_0x6ac8e][_0xaf2c('0x1a')];var _0x54c34a=this[_0xaf2c('0x19')][_0x6ac8e]['queue'];var _0x278a28=this[_0xaf2c('0x7')][_0x54c34a];var _0x1d544a=![];var _0x578492=_0xaf2c('0x1b');if(_0x278a28[_0xaf2c('0x1c')]){if(_0x278a28[_0xaf2c('0x1d')][_0xaf2c('0x1e')]){_0x1d544a=!![];_0x578492=_0x278a28[_0xaf2c('0x1d')][_0xaf2c('0x1e')];}}ami['Action']({'action':_0xaf2c('0x1f'),'interface':_0x26bf7b,'paused':!![],'reason':_0x578492})[_0xaf2c('0x20')](function(_0x8ffe13){if(_0x2b4d13[_0xaf2c('0x8')][_0x26bf7b]){return RpcUser[_0xaf2c('0x21')](_0x2b4d13['agents'][_0x26bf7b]['id'])[_0xaf2c('0x20')](function(_0xbf6f62){if(_0xbf6f62&&!_0xbf6f62[_0xaf2c('0x22')]){logger['info']('[%s][START][AGENT:%s][QUEUE:%s]',_0x6ac8e,_0x26bf7b,_0x54c34a);var _0x29cbdf=_0x2b4d13[_0xaf2c('0x19')][_0x6ac8e][_0xaf2c('0x23')]&&_0x2b4d13[_0xaf2c('0x19')][_0x6ac8e]['destlinkedid']?_0x2b4d13[_0xaf2c('0x19')][_0x6ac8e][_0xaf2c('0x24')]:_0x6ac8e;return RpcUser[_0xaf2c('0x25')](_0x2b4d13[_0xaf2c('0x8')][_0x26bf7b],_0x578492,_0x29cbdf)[_0xaf2c('0x20')](function(_0xff396f){if(!_0x1d544a){_0x2b4d13[_0xaf2c('0x9')][_0x26bf7b]={};logger['info'](_0xaf2c('0x26'),_0x6ac8e,_0x2b4d13[_0xaf2c('0x7')][_0x54c34a][_0xaf2c('0x27')],_0x26bf7b,_0x54c34a);_0x2b4d13[_0xaf2c('0x9')][_0x26bf7b]['timer']=setTimeout(_0x2b4d13[_0xaf2c('0x28')]['bind'](_0x2b4d13,_0x26bf7b),_0x2b4d13[_0xaf2c('0x7')][_0x54c34a][_0xaf2c('0x27')]*0x3e8);_0x2b4d13[_0xaf2c('0x9')][_0x26bf7b]['lastPauseAt']=moment()[_0xaf2c('0x29')](_0xaf2c('0x2a'));_0x2b4d13[_0xaf2c('0x9')][_0x26bf7b]['uniqueid']=_0x6ac8e;_0x2b4d13[_0xaf2c('0x9')][_0x26bf7b][_0xaf2c('0x2b')]=_0x54c34a;_0x2b4d13[_0xaf2c('0x9')][_0x26bf7b][_0xaf2c('0x2c')]=function(){var _0x59d858=getDiff(_0x2b4d13[_0xaf2c('0x9')][_0x26bf7b][_0xaf2c('0x2d')]);clearTimeout(_0x2b4d13[_0xaf2c('0x9')][_0x26bf7b]['timer']);_0x2b4d13['timers'][_0x26bf7b][_0xaf2c('0x2e')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x59d858},_0x2b4d13[_0xaf2c('0x9')][_0x26bf7b]['uniqueid'],_0x26bf7b)[_0xaf2c('0x20')](function(_0x1e4de2){logger['info'](_0xaf2c('0x2f'),_0x6ac8e,_0x59d858,_0x1e4de2);})[_0xaf2c('0x30')](function(_0x54db57){logger[_0xaf2c('0x31')](_0xaf2c('0x32'),_0x6ac8e,_0x54db57);});delete _0x2b4d13[_0xaf2c('0x9')][_0x26bf7b];};}});}else{logger[_0xaf2c('0x33')](_0xaf2c('0x34'),_0x6ac8e,_0x26bf7b,_0x54c34a);}});}})[_0xaf2c('0x30')](function(_0x5b1a7c){logger[_0xaf2c('0x31')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x6ac8e,_0x2b4d13[_0xaf2c('0x7')][_0x54c34a]['acwTimeout'],_0x26bf7b,_0x54c34a);})[_0xaf2c('0x35')](function(){delete _0x2b4d13['channels'][_0x6ac8e];});}catch(_0x2f3d16){logger['error'](_0xaf2c('0x36'),_0x2f3d16['message']);}};Acw[_0xaf2c('0x17')][_0xaf2c('0x28')]=function(_0x1a6929){try{var _0x14ec58=this;if(_0x14ec58[_0xaf2c('0x9')][_0x1a6929]){_0x14ec58['timers'][_0x1a6929]['timer']=![];var _0x6f428d=_0x14ec58[_0xaf2c('0x9')][_0x1a6929][_0xaf2c('0x37')];var _0xa44813=_0x14ec58[_0xaf2c('0x9')][_0x1a6929][_0xaf2c('0x2b')];var _0x573db3=_0x14ec58[_0xaf2c('0x7')][_0xa44813][_0xaf2c('0x27')];logger['info'](_0xaf2c('0x38'),_0x1a6929);RpcUser[_0xaf2c('0x39')](this[_0xaf2c('0x8')][_0x1a6929]);RpcVoiceAgentReport[_0xaf2c('0x3a')]({'acwtime':_0x573db3,'agentacw':!![]},_0x6f428d,_0x1a6929)[_0xaf2c('0x20')](function(_0x1e8eaf){logger[_0xaf2c('0x33')](_0xaf2c('0x2f'),_0x6f428d,_0x573db3,_0x1e8eaf);})[_0xaf2c('0x30')](function(_0x106eb9){logger[_0xaf2c('0x31')](_0xaf2c('0x32'),_0x6f428d,_0x106eb9);});}else{logger[_0xaf2c('0x31')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x1a6929);if(_0x14ec58['timers']){logger['info'](_0xaf2c('0x3b'),JSON[_0xaf2c('0x3c')](_0x14ec58[_0xaf2c('0x9')]));}}}catch(_0x381502){logger[_0xaf2c('0x31')](_0xaf2c('0x3d'),_0x381502['message']);}};Acw[_0xaf2c('0x17')][_0xaf2c('0xb')]=function(_0xc59393){try{if(this['voiceQueues'][_0xc59393['queue']]&&(this[_0xaf2c('0x7')][_0xc59393['queue']][_0xaf2c('0x4')]||this[_0xaf2c('0x7')][_0xc59393[_0xaf2c('0x2b')]][_0xaf2c('0x1c')])){if(this['agents'][_0xc59393[_0xaf2c('0x1a')]]){this['channels'][_0xc59393[_0xaf2c('0x37')]]={'queue':_0xc59393[_0xaf2c('0x2b')],'interface':_0xc59393['interface'],'destlinkedid':_0xc59393[_0xaf2c('0x24')]};}}}catch(_0x4a2317){logger[_0xaf2c('0x31')](_0xaf2c('0x3e'),_0x4a2317[_0xaf2c('0x3f')]);}};Acw[_0xaf2c('0x17')][_0xaf2c('0x40')]=function(_0x98d9f3){try{if(this[_0xaf2c('0x7')][_0x98d9f3[_0xaf2c('0x2b')]]&&(this[_0xaf2c('0x7')][_0x98d9f3['queue']]['acw']||this[_0xaf2c('0x7')][_0x98d9f3['queue']]['mandatoryDisposition'])){if(this['agents'][_0x98d9f3[_0xaf2c('0x1a')]]){this[_0xaf2c('0x19')][_0x98d9f3[_0xaf2c('0x37')]]={'queue':_0x98d9f3[_0xaf2c('0x2b')],'interface':_0x98d9f3['interface']};}}}catch(_0x219ea3){logger['error'](_0xaf2c('0x41'),_0x219ea3['message']);}};Acw[_0xaf2c('0x17')][_0xaf2c('0x42')]=function(_0x2d01b7){try{if(this[_0xaf2c('0x19')][_0x2d01b7[_0xaf2c('0x37')]]&&_['isUndefined'](this[_0xaf2c('0x19')][_0x2d01b7[_0xaf2c('0x37')]]['attended'])){logger['info'](_0xaf2c('0x43'),_0x2d01b7['uniqueid']);this[_0xaf2c('0x18')](_0x2d01b7[_0xaf2c('0x37')]);}else if(this[_0xaf2c('0x19')][_0x2d01b7[_0xaf2c('0x44')]]&&_[_0xaf2c('0x45')](this[_0xaf2c('0x19')][_0x2d01b7[_0xaf2c('0x44')]][_0xaf2c('0x23')])){logger[_0xaf2c('0x33')](_0xaf2c('0x46'),_0x2d01b7[_0xaf2c('0x44')]);this['startAcw'](_0x2d01b7[_0xaf2c('0x44')]);}}catch(_0x57547e){logger['error']('[ACW][syncHangupRequest]\x20%s',_0x57547e['message']);}};Acw[_0xaf2c('0x17')][_0xaf2c('0xe')]=function(_0x551061){try{if(this[_0xaf2c('0x19')][_0x551061[_0xaf2c('0x37')]]&&this[_0xaf2c('0x19')][_0x551061[_0xaf2c('0x37')]][_0xaf2c('0x23')]){logger[_0xaf2c('0x33')](_0xaf2c('0x47'),_0x551061['uniqueid']);this[_0xaf2c('0x18')](_0x551061[_0xaf2c('0x37')]);}else if(this['channels'][_0x551061[_0xaf2c('0x44')]]&&this[_0xaf2c('0x19')][_0x551061[_0xaf2c('0x44')]][_0xaf2c('0x23')]){logger[_0xaf2c('0x33')](_0xaf2c('0x48'),_0x551061[_0xaf2c('0x44')]);this[_0xaf2c('0x18')](_0x551061[_0xaf2c('0x44')]);}}catch(_0x300254){logger[_0xaf2c('0x31')](_0xaf2c('0x49'),_0x300254[_0xaf2c('0x3f')]);}};Acw[_0xaf2c('0x17')][_0xaf2c('0x11')]=function(_0x2d6677){try{if(!_[_0xaf2c('0x4a')](this[_0xaf2c('0x19')][_0x2d6677[_0xaf2c('0x4b')]])){this[_0xaf2c('0x18')](_0x2d6677['transfereeuniqueid']);if(this[_0xaf2c('0x19')][_0x2d6677[_0xaf2c('0x4c')]]){this[_0xaf2c('0x19')][_0x2d6677['secondtransfereruniqueid']][_0xaf2c('0x23')]=!![];this['channels'][_0x2d6677[_0xaf2c('0x4d')]]=this[_0xaf2c('0x19')][_0x2d6677[_0xaf2c('0x4c')]];delete this[_0xaf2c('0x19')][_0x2d6677[_0xaf2c('0x4c')]];}}else if(!_[_0xaf2c('0x4a')](this[_0xaf2c('0x19')][_0x2d6677[_0xaf2c('0x4d')]])){this[_0xaf2c('0x18')](_0x2d6677['transfertargetuniqueid']);if(this[_0xaf2c('0x19')][_0x2d6677[_0xaf2c('0x4e')]]){this[_0xaf2c('0x19')][_0x2d6677[_0xaf2c('0x4e')]][_0xaf2c('0x23')]=!![];this['channels'][_0x2d6677[_0xaf2c('0x4b')]]=this[_0xaf2c('0x19')][_0x2d6677['origtransfereruniqueid']];delete this[_0xaf2c('0x19')][_0x2d6677[_0xaf2c('0x4e')]];}}}catch(_0x4b7070){logger['error'](_0xaf2c('0x4f'),_0x4b7070[_0xaf2c('0x3f')]);}};Acw[_0xaf2c('0x17')][_0xaf2c('0x13')]=function(_0x4cc55a){try{if(this[_0xaf2c('0x19')][_0x4cc55a[_0xaf2c('0x50')]]){logger['info'](_0xaf2c('0x51'),JSON['stringify'](_0x4cc55a[_0xaf2c('0x50')]));this[_0xaf2c('0x18')](_0x4cc55a[_0xaf2c('0x50')]);}else if(this[_0xaf2c('0x19')][_0x4cc55a[_0xaf2c('0x52')]]){logger[_0xaf2c('0x33')](_0xaf2c('0x53'),JSON[_0xaf2c('0x3c')](_0x4cc55a[_0xaf2c('0x52')]));this[_0xaf2c('0x18')](_0x4cc55a['transfererlinkedid']);}}catch(_0x79d962){logger[_0xaf2c('0x31')](_0xaf2c('0x54'),_0x79d962[_0xaf2c('0x3f')]);}};Acw[_0xaf2c('0x17')]['syncAgentRingNoAnswer']=function(_0xbfb776){try{if(this[_0xaf2c('0x7')][_0xbfb776[_0xaf2c('0x2b')]]&&this[_0xaf2c('0x7')][_0xbfb776[_0xaf2c('0x2b')]]['autopause']==='all'){if(this[_0xaf2c('0x8')][_0xbfb776[_0xaf2c('0x1a')]]){logger['info'](_0xaf2c('0x55'),_0xbfb776[_0xaf2c('0x37')],_0xbfb776[_0xaf2c('0x1a')],_0xbfb776['queue']);return RpcUser[_0xaf2c('0x25')](this[_0xaf2c('0x8')][_0xbfb776[_0xaf2c('0x1a')]],_0xaf2c('0x56'),_0xbfb776['uniqueid']);}}}catch(_0x32d552){logger[_0xaf2c('0x31')](_0xaf2c('0x57'),_0x32d552[_0xaf2c('0x3f')]);}};module[_0xaf2c('0x58')]=Acw; \ No newline at end of file +var _0x3e74=['acwTimeout','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','updateAcw','lastPauseAt','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','[ACW][STOP]\x20%s','acw','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','message','attended','isUndefined','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','autopause','all','exports','util','moment','../ami','../../../config/logger','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','agentringnoanswer','syncAttendedTransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','seconds','prototype','startAcw','interface','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','timer'];(function(_0x207811,_0x3420a6){var _0x170d56=function(_0x4340b7){while(--_0x4340b7){_0x207811['push'](_0x207811['shift']());}};_0x170d56(++_0x3420a6);}(_0x3e74,0x175));var _0x43e7=function(_0x1f3649,_0x14d3b2){_0x1f3649=_0x1f3649-0x0;var _0x4d2d08=_0x3e74[_0x1f3649];return _0x4d2d08;};'use strict';var util=require(_0x43e7('0x0'));var _=require('lodash');var moment=require(_0x43e7('0x1'));var ami=require(_0x43e7('0x2'));var logger=require(_0x43e7('0x3'))('acw');var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x43e7('0x4'));function Acw(_0x4f9bbe){this[_0x43e7('0x5')]=_0x4f9bbe[_0x43e7('0x5')];this[_0x43e7('0x6')]=_0x4f9bbe[_0x43e7('0x6')];this[_0x43e7('0x7')]=_0x4f9bbe['timers'];this[_0x43e7('0x8')]={};ami['on'](_0x43e7('0x9'),this[_0x43e7('0xa')][_0x43e7('0xb')](this));ami['on'](_0x43e7('0xc'),this['syncHangupRequest'][_0x43e7('0xb')](this));ami['on']('hangup',this['syncHangup'][_0x43e7('0xb')](this));ami['on'](_0x43e7('0xd'),this['syncAgentRingNoAnswer'][_0x43e7('0xb')](this));ami['on']('attendedtransfer',this[_0x43e7('0xe')][_0x43e7('0xb')](this));ami['on']('blindtransfer',this[_0x43e7('0xf')][_0x43e7('0xb')](this));ami['on'](_0x43e7('0x10'),this[_0x43e7('0x11')]['bind'](this));}function getDiff(_0x583d85){var _0x2fcb36=moment()[_0x43e7('0x12')](0x0);var _0x44b0bd=moment(_0x583d85)['milliseconds'](0x0);return _0x2fcb36['diff'](_0x44b0bd,_0x43e7('0x13'));}Acw[_0x43e7('0x14')][_0x43e7('0x15')]=function(_0x328445){try{var _0x4de324=this;var _0x5c4eaa=this[_0x43e7('0x8')][_0x328445][_0x43e7('0x16')];var _0x273a32=this['channels'][_0x328445]['queue'];var _0x446986=this[_0x43e7('0x5')][_0x273a32];var _0x9037d3=![];var _0x140657=_0x43e7('0x17');if(_0x446986[_0x43e7('0x18')]){if(_0x446986[_0x43e7('0x19')][_0x43e7('0x1a')]){_0x9037d3=!![];_0x140657=_0x446986[_0x43e7('0x19')][_0x43e7('0x1a')];}}ami[_0x43e7('0x1b')]({'action':_0x43e7('0x1c'),'interface':_0x5c4eaa,'paused':!![],'reason':_0x140657})['then'](function(_0xef1a5a){if(_0x4de324[_0x43e7('0x6')][_0x5c4eaa]){return RpcUser['getAgent'](_0x4de324[_0x43e7('0x6')][_0x5c4eaa]['id'])[_0x43e7('0x1d')](function(_0x3945bb){if(_0x3945bb&&!_0x3945bb[_0x43e7('0x1e')]){logger[_0x43e7('0x1f')](_0x43e7('0x20'),_0x328445,_0x5c4eaa,_0x273a32);var _0x54a9e7=_0x4de324[_0x43e7('0x8')][_0x328445]['attended']&&_0x4de324['channels'][_0x328445][_0x43e7('0x21')]?_0x4de324[_0x43e7('0x8')][_0x328445]['destlinkedid']:_0x328445;return RpcUser[_0x43e7('0x22')](_0x4de324['agents'][_0x5c4eaa],_0x140657,_0x54a9e7)[_0x43e7('0x1d')](function(_0x5c5e67){if(!_0x9037d3){_0x4de324[_0x43e7('0x7')][_0x5c4eaa]={};logger[_0x43e7('0x1f')](_0x43e7('0x23'),_0x328445,_0x4de324[_0x43e7('0x5')][_0x273a32]['acwTimeout'],_0x5c4eaa,_0x273a32);_0x4de324['timers'][_0x5c4eaa][_0x43e7('0x24')]=setTimeout(_0x4de324['stopAcw'][_0x43e7('0xb')](_0x4de324,_0x5c4eaa),_0x4de324[_0x43e7('0x5')][_0x273a32][_0x43e7('0x25')]*0x3e8);_0x4de324[_0x43e7('0x7')][_0x5c4eaa]['lastPauseAt']=moment()[_0x43e7('0x26')](_0x43e7('0x27'));_0x4de324[_0x43e7('0x7')][_0x5c4eaa][_0x43e7('0x28')]=_0x328445;_0x4de324[_0x43e7('0x7')][_0x5c4eaa][_0x43e7('0x29')]=_0x273a32;_0x4de324[_0x43e7('0x7')][_0x5c4eaa][_0x43e7('0x2a')]=function(){var _0x3bf475=getDiff(_0x4de324[_0x43e7('0x7')][_0x5c4eaa][_0x43e7('0x2b')]);clearTimeout(_0x4de324[_0x43e7('0x7')][_0x5c4eaa][_0x43e7('0x24')]);_0x4de324[_0x43e7('0x7')][_0x5c4eaa]['timer']=![];RpcVoiceAgentReport[_0x43e7('0x2c')]({'acwtime':_0x3bf475},_0x4de324[_0x43e7('0x7')][_0x5c4eaa][_0x43e7('0x28')],_0x5c4eaa)[_0x43e7('0x1d')](function(_0x4251c8){logger['info'](_0x43e7('0x2d'),_0x328445,_0x3bf475,_0x4251c8);})[_0x43e7('0x2e')](function(_0x30d47e){logger[_0x43e7('0x2f')]('[%s][UPDATE][ERRORS:%s]',_0x328445,_0x30d47e);});delete _0x4de324['timers'][_0x5c4eaa];};}});}else{logger['info'](_0x43e7('0x30'),_0x328445,_0x5c4eaa,_0x273a32);}});}})[_0x43e7('0x2e')](function(_0x117c07){logger[_0x43e7('0x2f')](_0x43e7('0x23'),_0x328445,_0x4de324[_0x43e7('0x5')][_0x273a32]['acwTimeout'],_0x5c4eaa,_0x273a32);})['finally'](function(){delete _0x4de324['channels'][_0x328445];});}catch(_0x59e5b2){logger['error']('[ACW][START]\x20%s',_0x59e5b2['message']);}};Acw[_0x43e7('0x14')]['stopAcw']=function(_0x2b4bfd){try{var _0x8e9f40=this;if(_0x8e9f40[_0x43e7('0x7')][_0x2b4bfd]){_0x8e9f40[_0x43e7('0x7')][_0x2b4bfd][_0x43e7('0x24')]=![];var _0x449803=_0x8e9f40[_0x43e7('0x7')][_0x2b4bfd]['uniqueid'];var _0x5332d9=_0x8e9f40['timers'][_0x2b4bfd][_0x43e7('0x29')];var _0xfe70e9=_0x8e9f40[_0x43e7('0x5')][_0x5332d9][_0x43e7('0x25')];logger[_0x43e7('0x1f')](_0x43e7('0x31'),_0x2b4bfd);RpcUser[_0x43e7('0x32')](this[_0x43e7('0x6')][_0x2b4bfd]);RpcVoiceAgentReport['update']({'acwtime':_0xfe70e9,'agentacw':!![]},_0x449803,_0x2b4bfd)[_0x43e7('0x1d')](function(_0x2b0ffe){logger['info'](_0x43e7('0x2d'),_0x449803,_0xfe70e9,_0x2b0ffe);})['catch'](function(_0x44d8e4){logger[_0x43e7('0x2f')](_0x43e7('0x33'),_0x449803,_0x44d8e4);});}else{logger[_0x43e7('0x2f')](_0x43e7('0x34'),_0x2b4bfd);if(_0x8e9f40[_0x43e7('0x7')]){logger['info']('[ACW][TIMERS]',JSON[_0x43e7('0x35')](_0x8e9f40[_0x43e7('0x7')]));}}}catch(_0x44b6ae){logger[_0x43e7('0x2f')](_0x43e7('0x36'),_0x44b6ae['message']);}};Acw[_0x43e7('0x14')][_0x43e7('0xa')]=function(_0x575439){try{if(this[_0x43e7('0x5')][_0x575439['queue']]&&(this[_0x43e7('0x5')][_0x575439['queue']][_0x43e7('0x37')]||this[_0x43e7('0x5')][_0x575439[_0x43e7('0x29')]][_0x43e7('0x18')])){if(this['agents'][_0x575439['interface']]){this[_0x43e7('0x8')][_0x575439[_0x43e7('0x28')]]={'queue':_0x575439[_0x43e7('0x29')],'interface':_0x575439[_0x43e7('0x16')],'destlinkedid':_0x575439['destlinkedid']};}}}catch(_0x583047){logger['error'](_0x43e7('0x38'),_0x583047['message']);}};Acw[_0x43e7('0x14')]['syncAgentConnectPreview']=function(_0x5b28db){try{if(this[_0x43e7('0x5')][_0x5b28db['queue']]&&(this[_0x43e7('0x5')][_0x5b28db[_0x43e7('0x29')]][_0x43e7('0x37')]||this[_0x43e7('0x5')][_0x5b28db['queue']][_0x43e7('0x18')])){if(this[_0x43e7('0x6')][_0x5b28db[_0x43e7('0x16')]]){this[_0x43e7('0x8')][_0x5b28db[_0x43e7('0x28')]]={'queue':_0x5b28db[_0x43e7('0x29')],'interface':_0x5b28db['interface']};}}}catch(_0x4930a2){logger[_0x43e7('0x2f')](_0x43e7('0x39'),_0x4930a2[_0x43e7('0x3a')]);}};Acw['prototype']['syncHangupRequest']=function(_0x56489b){try{if(this[_0x43e7('0x8')][_0x56489b[_0x43e7('0x28')]]&&_['isUndefined'](this[_0x43e7('0x8')][_0x56489b[_0x43e7('0x28')]][_0x43e7('0x3b')])){logger['info']('[%s][HANGUP:UNIQUEID]',_0x56489b['uniqueid']);this['startAcw'](_0x56489b[_0x43e7('0x28')]);}else if(this[_0x43e7('0x8')][_0x56489b['linkedid']]&&_[_0x43e7('0x3c')](this[_0x43e7('0x8')][_0x56489b[_0x43e7('0x3d')]][_0x43e7('0x3b')])){logger['info'](_0x43e7('0x3e'),_0x56489b['linkedid']);this['startAcw'](_0x56489b[_0x43e7('0x3d')]);}}catch(_0x12f9ba){logger[_0x43e7('0x2f')](_0x43e7('0x3f'),_0x12f9ba[_0x43e7('0x3a')]);}};Acw[_0x43e7('0x14')][_0x43e7('0x40')]=function(_0x256ddd){try{if(this[_0x43e7('0x8')][_0x256ddd[_0x43e7('0x28')]]&&this['channels'][_0x256ddd[_0x43e7('0x28')]][_0x43e7('0x3b')]){logger['info'](_0x43e7('0x41'),_0x256ddd['uniqueid']);this[_0x43e7('0x15')](_0x256ddd[_0x43e7('0x28')]);}else if(this[_0x43e7('0x8')][_0x256ddd[_0x43e7('0x3d')]]&&this[_0x43e7('0x8')][_0x256ddd['linkedid']]['attended']){logger[_0x43e7('0x1f')](_0x43e7('0x42'),_0x256ddd[_0x43e7('0x3d')]);this[_0x43e7('0x15')](_0x256ddd[_0x43e7('0x3d')]);}}catch(_0x25bb44){logger[_0x43e7('0x2f')](_0x43e7('0x43'),_0x25bb44[_0x43e7('0x3a')]);}};Acw[_0x43e7('0x14')][_0x43e7('0xe')]=function(_0x4ace49){try{if(!_[_0x43e7('0x44')](this[_0x43e7('0x8')][_0x4ace49['transfereeuniqueid']])){this[_0x43e7('0x15')](_0x4ace49[_0x43e7('0x45')]);if(this[_0x43e7('0x8')][_0x4ace49['secondtransfereruniqueid']]){this['channels'][_0x4ace49[_0x43e7('0x46')]][_0x43e7('0x3b')]=!![];this['channels'][_0x4ace49[_0x43e7('0x47')]]=this['channels'][_0x4ace49['secondtransfereruniqueid']];delete this[_0x43e7('0x8')][_0x4ace49[_0x43e7('0x46')]];}}else if(!_[_0x43e7('0x44')](this[_0x43e7('0x8')][_0x4ace49[_0x43e7('0x47')]])){this['startAcw'](_0x4ace49[_0x43e7('0x47')]);if(this[_0x43e7('0x8')][_0x4ace49['origtransfereruniqueid']]){this[_0x43e7('0x8')][_0x4ace49[_0x43e7('0x48')]][_0x43e7('0x3b')]=!![];this['channels'][_0x4ace49['transfereeuniqueid']]=this['channels'][_0x4ace49[_0x43e7('0x48')]];delete this[_0x43e7('0x8')][_0x4ace49[_0x43e7('0x48')]];}}}catch(_0x3a6404){logger['error']('[ACW][syncAttendedTransfer]\x20%s',_0x3a6404[_0x43e7('0x3a')]);}};Acw[_0x43e7('0x14')][_0x43e7('0xf')]=function(_0x5dd349){try{if(this['channels'][_0x5dd349[_0x43e7('0x49')]]){logger[_0x43e7('0x1f')](_0x43e7('0x4a'),JSON[_0x43e7('0x35')](_0x5dd349[_0x43e7('0x49')]));this[_0x43e7('0x15')](_0x5dd349[_0x43e7('0x49')]);}else if(this[_0x43e7('0x8')][_0x5dd349[_0x43e7('0x4b')]]){logger[_0x43e7('0x1f')](_0x43e7('0x4c'),JSON['stringify'](_0x5dd349['transfererlinkedid']));this[_0x43e7('0x15')](_0x5dd349['transfererlinkedid']);}}catch(_0x501616){logger['error'](_0x43e7('0x4d'),_0x501616[_0x43e7('0x3a')]);}};Acw['prototype'][_0x43e7('0x4e')]=function(_0x135791){try{if(this[_0x43e7('0x5')][_0x135791['queue']]&&this[_0x43e7('0x5')][_0x135791[_0x43e7('0x29')]][_0x43e7('0x4f')]===_0x43e7('0x50')){if(this[_0x43e7('0x6')][_0x135791[_0x43e7('0x16')]]){logger[_0x43e7('0x1f')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x135791[_0x43e7('0x28')],_0x135791[_0x43e7('0x16')],_0x135791[_0x43e7('0x29')]);return RpcUser['savePause'](this['agents'][_0x135791[_0x43e7('0x16')]],'Auto-Pause',_0x135791['uniqueid']);}}}catch(_0x1b793d){logger[_0x43e7('0x2f')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x1b793d[_0x43e7('0x3a')]);}};module[_0x43e7('0x51')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index e2427db..5c586c6 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 _0x290d=['sippeerstatus','actionCoreShowChannels','coreshowchannels','once','connect','shutdown','info','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipShowRegistry','actionQueueSummary','catch','log','close','exports','asterisk-manager','bluebird','moment','util','../../config/logger','ami','asterisk','port','username','password','keepConnected','Action','promisify','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','actionDeviceStateList','devicestatelist'];(function(_0x205b44,_0x551a7a){var _0x2fed4d=function(_0x588d9f){while(--_0x588d9f){_0x205b44['push'](_0x205b44['shift']());}};_0x2fed4d(++_0x551a7a);}(_0x290d,0x131));var _0xd290=function(_0x2ef314,_0x3a9a7e){_0x2ef314=_0x2ef314-0x0;var _0x101981=_0x290d[_0x2ef314];return _0x101981;};'use strict';var Manager=require(_0xd290('0x0'));var BPromise=require(_0xd290('0x1'));var moment=require(_0xd290('0x2'));var util=require(_0xd290('0x3'));var _=require('lodash');var logger=require(_0xd290('0x4'))(_0xd290('0x5'));var config=require('../../config/environment');var ami=new Manager(config[_0xd290('0x6')][_0xd290('0x7')],config[_0xd290('0x6')]['ip'],config[_0xd290('0x6')][_0xd290('0x8')],config['asterisk'][_0xd290('0x9')],!![]);ami[_0xd290('0xa')]();ami[_0xd290('0xb')]=BPromise[_0xd290('0xc')](ami['action']);function error(_0x7394a4){logger[_0xd290('0xd')](util[_0xd290('0xe')](_0xd290('0xf'),config[_0xd290('0x6')][_0xd290('0x8')],config['asterisk']['ip'],config[_0xd290('0x6')]['port'],util[_0xd290('0x10')](_0x7394a4,![],null)));}function close(){logger[_0xd290('0xd')](util[_0xd290('0xe')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config['asterisk']['username'],config[_0xd290('0x6')]['ip'],config['asterisk'][_0xd290('0x7')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0xd290('0xb')]({'action':'sipshowregistry'});};};ami[_0xd290('0x11')]=function(){return function(){return ami[_0xd290('0xb')]({'action':_0xd290('0x12')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0xd290('0xb')]({'action':_0xd290('0x13')});};};ami['actionQueueSummary']=function(){return function(){return ami[_0xd290('0xb')]({'action':'queuesummary'});};};ami[_0xd290('0x14')]=function(){return function(){return ami[_0xd290('0xb')]({'action':_0xd290('0x15')});};};function connect(_0x301a87){logger['info'](util[_0xd290('0xe')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0xd290('0x6')][_0xd290('0x8')],config['asterisk']['ip'],config[_0xd290('0x6')][_0xd290('0x7')]));ami[_0xd290('0x16')]('error',error);ami[_0xd290('0x16')]('close',close);}ami['on'](_0xd290('0x17'),connect);ami['on'](_0xd290('0x18'),function(_0x216956){logger[_0xd290('0x19')](util[_0xd290('0xe')](_0xd290('0x1a'),config['asterisk'][_0xd290('0x8')],config[_0xd290('0x6')]['ip'],config[_0xd290('0x6')][_0xd290('0x7')],util[_0xd290('0x10')](_0x216956,![],null)));});ami['on']('fullybooted',function(_0x25fda9){logger['info'](util[_0xd290('0xe')](_0xd290('0x1b'),config['asterisk'][_0xd290('0x8')],config['asterisk']['ip'],config[_0xd290('0x6')][_0xd290('0x7')]));return BPromise[_0xd290('0x1c')]()[_0xd290('0x1d')](ami[_0xd290('0x1e')]())['then'](ami[_0xd290('0x11')]())['then'](ami['actionSipPeerStatus']())[_0xd290('0x1d')](ami[_0xd290('0x1f')]())[_0xd290('0x1d')](ami[_0xd290('0x14')]())[_0xd290('0x20')](function(_0x104162){console[_0xd290('0x21')](_0x104162);});});ami[_0xd290('0x16')](_0xd290('0xd'),error);ami[_0xd290('0x16')](_0xd290('0x22'),close);module[_0xd290('0x23')]=ami; \ No newline at end of file +var _0xb190=['resolve','then','actionSipShowRegistry','catch','log','exports','asterisk-manager','moment','util','../../config/logger','asterisk','port','username','password','keepConnected','Action','error','inspect','format','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','actionCoreShowChannels','coreshowchannels','once','connect','shutdown','info','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s'];(function(_0x40cb2a,_0x5dad10){var _0xa27bfa=function(_0x3ab52b){while(--_0x3ab52b){_0x40cb2a['push'](_0x40cb2a['shift']());}};_0xa27bfa(++_0x5dad10);}(_0xb190,0xb5));var _0x0b19=function(_0x5de1a8,_0x1465e8){_0x5de1a8=_0x5de1a8-0x0;var _0x22e302=_0xb190[_0x5de1a8];return _0x22e302;};'use strict';var Manager=require(_0x0b19('0x0'));var BPromise=require('bluebird');var moment=require(_0x0b19('0x1'));var util=require(_0x0b19('0x2'));var _=require('lodash');var logger=require(_0x0b19('0x3'))('ami');var config=require('../../config/environment');var ami=new Manager(config[_0x0b19('0x4')][_0x0b19('0x5')],config['asterisk']['ip'],config[_0x0b19('0x4')][_0x0b19('0x6')],config['asterisk'][_0x0b19('0x7')],!![]);ami[_0x0b19('0x8')]();ami[_0x0b19('0x9')]=BPromise['promisify'](ami['action']);function error(_0x2c4e56){logger[_0x0b19('0xa')](util['format']('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config['asterisk'][_0x0b19('0x6')],config[_0x0b19('0x4')]['ip'],config[_0x0b19('0x4')]['port'],util[_0x0b19('0xb')](_0x2c4e56,![],null)));}function close(){logger[_0x0b19('0xa')](util[_0x0b19('0xc')](_0x0b19('0xd'),config[_0x0b19('0x4')]['username'],config[_0x0b19('0x4')]['ip'],config[_0x0b19('0x4')][_0x0b19('0x5')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x0b19('0x9')]({'action':_0x0b19('0xe')});};};ami[_0x0b19('0xf')]=function(){return function(){return ami[_0x0b19('0x9')]({'action':_0x0b19('0x10')});};};ami[_0x0b19('0x11')]=function(){return function(){return ami[_0x0b19('0x9')]({'action':_0x0b19('0x12')});};};ami[_0x0b19('0x13')]=function(){return function(){return ami['Action']({'action':'queuesummary'});};};ami[_0x0b19('0x14')]=function(){return function(){return ami[_0x0b19('0x9')]({'action':_0x0b19('0x15')});};};function connect(_0xe49823){logger['info'](util['format']('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0x0b19('0x4')][_0x0b19('0x6')],config[_0x0b19('0x4')]['ip'],config[_0x0b19('0x4')][_0x0b19('0x5')]));ami[_0x0b19('0x16')](_0x0b19('0xa'),error);ami['once']('close',close);}ami['on'](_0x0b19('0x17'),connect);ami['on'](_0x0b19('0x18'),function(_0x28b697){logger[_0x0b19('0x19')](util[_0x0b19('0xc')](_0x0b19('0x1a'),config[_0x0b19('0x4')][_0x0b19('0x6')],config[_0x0b19('0x4')]['ip'],config[_0x0b19('0x4')][_0x0b19('0x5')],util[_0x0b19('0xb')](_0x28b697,![],null)));});ami['on'](_0x0b19('0x1b'),function(_0x4199e1){logger[_0x0b19('0x19')](util[_0x0b19('0xc')](_0x0b19('0x1c'),config[_0x0b19('0x4')]['username'],config[_0x0b19('0x4')]['ip'],config['asterisk']['port']));return BPromise[_0x0b19('0x1d')]()[_0x0b19('0x1e')](ami[_0x0b19('0x1f')]())['then'](ami['actionDeviceStateList']())[_0x0b19('0x1e')](ami[_0x0b19('0x11')]())['then'](ami['actionQueueSummary']())[_0x0b19('0x1e')](ami[_0x0b19('0x14')]())[_0x0b19('0x20')](function(_0x2f7cde){console[_0x0b19('0x21')](_0x2f7cde);});});ami['once'](_0x0b19('0xa'),error);ami[_0x0b19('0x16')]('close',close);module[_0x0b19('0x22')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index b65ea6a..58e0a4b 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 _0x334b=['exports','jayson/promise','bluebird','../../config/logger','http','Request','request','debug','rpc','memberReport','error','message','result','catch'];(function(_0x150ccc,_0x1e1157){var _0x47673a=function(_0x58f753){while(--_0x58f753){_0x150ccc['push'](_0x150ccc['shift']());}};_0x47673a(++_0x1e1157);}(_0x334b,0x17b));var _0xb334=function(_0x3eb018,_0x503b39){_0x3eb018=_0x3eb018-0x0;var _0x1f8120=_0x334b[_0x3eb018];return _0x1f8120;};'use strict';var jayson=require(_0xb334('0x0'));var BPromise=require(_0xb334('0x1'));var logger=require(_0xb334('0x2'))('ami');var client=jayson['client'][_0xb334('0x3')]({'port':0x2329});client[_0xb334('0x4')]=function(_0x42d386,_0x4f2d00){return new BPromise(function(_0xc8cbaa,_0x2b5ced){return client[_0xb334('0x5')](_0x42d386,_0x4f2d00)['then'](function(_0x333911){logger[_0xb334('0x6')](_0xb334('0x7'),_0xb334('0x8'),_0x42d386,_0x4f2d00,_0x333911);if(_0x333911['error']){logger[_0xb334('0x9')](_0xb334('0x7'),_0xb334('0x8'),_0x42d386,_0x333911[_0xb334('0x9')][_0xb334('0xa')],_0x4f2d00);return _0x2b5ced(_0x333911['error'][_0xb334('0xa')]);}else{return _0xc8cbaa(_0x333911[_0xb334('0xb')]);}})[_0xb334('0xc')](function(_0x24d0af){logger[_0xb334('0x9')]('rpc','memberReport',_0x42d386,_0x24d0af,_0x4f2d00);return _0x2b5ced(_0x24d0af);});});};module[_0xb334('0xd')]=client; \ No newline at end of file +var _0x31e6=['then','debug','memberReport','error','rpc','message','exports','jayson/promise','bluebird','ami','client','Request'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x31e6,0x187));var _0x631e=function(_0x3ca135,_0x5211e8){_0x3ca135=_0x3ca135-0x0;var _0xfc3b79=_0x31e6[_0x3ca135];return _0xfc3b79;};'use strict';var jayson=require(_0x631e('0x0'));var BPromise=require(_0x631e('0x1'));var logger=require('../../config/logger')(_0x631e('0x2'));var client=jayson[_0x631e('0x3')]['http']({'port':0x2329});client[_0x631e('0x4')]=function(_0x2d5f9f,_0x596e58){return new BPromise(function(_0x4fe449,_0x155997){return client['request'](_0x2d5f9f,_0x596e58)[_0x631e('0x5')](function(_0x1b2f34){logger[_0x631e('0x6')]('rpc',_0x631e('0x7'),_0x2d5f9f,_0x596e58,_0x1b2f34);if(_0x1b2f34[_0x631e('0x8')]){logger[_0x631e('0x8')](_0x631e('0x9'),_0x631e('0x7'),_0x2d5f9f,_0x1b2f34[_0x631e('0x8')][_0x631e('0xa')],_0x596e58);return _0x155997(_0x1b2f34[_0x631e('0x8')][_0x631e('0xa')]);}else{return _0x4fe449(_0x1b2f34['result']);}})['catch'](function(_0x89182){logger[_0x631e('0x8')](_0x631e('0x9'),_0x631e('0x7'),_0x2d5f9f,_0x89182,_0x596e58);return _0x155997(_0x89182);});});};module[_0x631e('0xb')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 3bd986c..ccdbdb3 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 _0xc2b2=['callbackuniqueid','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','exports','util','lodash','moment','isNil','string','voiceQueue','name','Contact','firstName','lastName','number','phone','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback'];(function(_0x5cab28,_0x307622){var _0xa3554d=function(_0x330139){while(--_0x330139){_0x5cab28['push'](_0x5cab28['shift']());}};_0xa3554d(++_0x307622);}(_0xc2b2,0xd3));var _0x2c2b=function(_0x5def8f,_0x58261e){_0x5def8f=_0x5def8f-0x0;var _0x36ee2b=_0xc2b2[_0x5def8f];return _0x36ee2b;};'use strict';var util=require(_0x2c2b('0x0'));var _=require(_0x2c2b('0x1'));var moment=require(_0x2c2b('0x2'));function checkNameSurname(_0x401d95,_0x1cc827,_0x17c9b5){var _0xec9dfa='';if(!_[_0x2c2b('0x3')](_0x1cc827)&&_0x2c2b('0x4')===typeof _0x1cc827){_0xec9dfa+=_0x1cc827;}if(!_['isNil'](_0x17c9b5)&&_0x2c2b('0x4')===typeof _0x17c9b5){_0xec9dfa+='\x20'+_0x17c9b5;}if(_0xec9dfa!==''){return _0xec9dfa;}return _0x401d95;}function Action(_0xa91f09,_0x2d093b,_0x92ac9d){this[_0x2c2b('0x5')]=_0xa91f09;this['uniqueid']=_0x92ac9d||undefined;this[_0x2c2b('0x6')]=checkNameSurname(_0x2d093b[_0x2c2b('0x7')]['phone'],_0x2d093b[_0x2c2b('0x7')][_0x2c2b('0x8')],_0x2d093b[_0x2c2b('0x7')][_0x2c2b('0x9')]);this[_0x2c2b('0xa')]=_0x2d093b[_0x2c2b('0x7')][_0x2c2b('0xb')];this['queue']=_0xa91f09[_0x2c2b('0x6')];this[_0x2c2b('0xc')]=_0x2d093b[_0x2c2b('0xc')]||![];this[_0x2c2b('0xd')]=_0xa91f09[_0x2c2b('0xd')];this[_0x2c2b('0xe')]=_0xa91f09[_0x2c2b('0xe')]||0x3;this['scheduledat']=_0x2d093b[_0x2c2b('0xf')];this[_0x2c2b('0x10')]=_0x2d093b[_0x2c2b('0x10')];this['countcongestionretry']=_0x2d093b[_0x2c2b('0x11')];this[_0x2c2b('0x12')]=_0x2d093b[_0x2c2b('0x12')];this['ContactId']=_0x2d093b['ContactId'];this['ListId']=_0x2d093b[_0x2c2b('0x13')];this['UserId']=_0x2d093b[_0x2c2b('0x14')];this[_0x2c2b('0x15')]=_0x2d093b[_0x2c2b('0x15')];this[_0x2c2b('0x16')]=_0x2d093b[_0x2c2b('0x16')];this[_0x2c2b('0x17')]=_0x2d093b['id'];this[_0x2c2b('0x18')]=_0x2d093b['Contact'][_0x2c2b('0x8')]||'';this[_0x2c2b('0x19')]=moment()[_0x2c2b('0x1a')](_0x2c2b('0x1b'));this[_0x2c2b('0x1c')]=_0x2d093b[_0x2c2b('0x1c')];this[_0x2c2b('0x1d')]=_0x2d093b[_0x2c2b('0x1d')];this['callbackat']=_0x2d093b['callbackat'];this[_0x2c2b('0x1e')]=_0x2d093b[_0x2c2b('0x1e')];this[_0x2c2b('0x1f')]='';this[_0x2c2b('0x20')]='';}Action[_0x2c2b('0x21')][_0x2c2b('0x22')]=function(){return util['format'](_0x2c2b('0x23'),this[_0x2c2b('0x6')],this[_0x2c2b('0x5')][_0x2c2b('0x24')]>0x0?this[_0x2c2b('0xa')][_0x2c2b('0x25')](this[_0x2c2b('0x5')][_0x2c2b('0x24')]):this[_0x2c2b('0xa')]);};Action[_0x2c2b('0x21')][_0x2c2b('0x26')]=function(){return this['queue'];};module[_0x2c2b('0x27')]=Action; \ No newline at end of file +var _0x49f8=['getQueue','exports','util','lodash','string','voiceQueue','Contact','phone','lastName','number','queue','name','active','type','dialQueueTimeout','countbusyretry','countcongestionretry','countnoanswerretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','firstName','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring'];(function(_0x4e1716,_0x2b0b69){var _0x8b3da8=function(_0x2fea5c){while(--_0x2fea5c){_0x4e1716['push'](_0x4e1716['shift']());}};_0x8b3da8(++_0x2b0b69);}(_0x49f8,0x105));var _0x849f=function(_0x358000,_0x4efb0e){_0x358000=_0x358000-0x0;var _0x53d1c0=_0x49f8[_0x358000];return _0x53d1c0;};'use strict';var util=require(_0x849f('0x0'));var _=require(_0x849f('0x1'));var moment=require('moment');function checkNameSurname(_0x5a4c98,_0x45d0ec,_0x20f9a4){var _0x1bc1f6='';if(!_['isNil'](_0x45d0ec)&&'string'===typeof _0x45d0ec){_0x1bc1f6+=_0x45d0ec;}if(!_['isNil'](_0x20f9a4)&&_0x849f('0x2')===typeof _0x20f9a4){_0x1bc1f6+='\x20'+_0x20f9a4;}if(_0x1bc1f6!==''){return _0x1bc1f6;}return _0x5a4c98;}function Action(_0x3e37b5,_0x43aa94,_0x15562f){this[_0x849f('0x3')]=_0x3e37b5;this['uniqueid']=_0x15562f||undefined;this['name']=checkNameSurname(_0x43aa94[_0x849f('0x4')][_0x849f('0x5')],_0x43aa94[_0x849f('0x4')]['firstName'],_0x43aa94[_0x849f('0x4')][_0x849f('0x6')]);this[_0x849f('0x7')]=_0x43aa94['Contact']['phone'];this[_0x849f('0x8')]=_0x3e37b5[_0x849f('0x9')];this[_0x849f('0xa')]=_0x43aa94[_0x849f('0xa')]||![];this[_0x849f('0xb')]=_0x3e37b5[_0x849f('0xb')];this['dialQueueTimeout']=_0x3e37b5[_0x849f('0xc')]||0x3;this['scheduledat']=_0x43aa94['scheduledat'];this[_0x849f('0xd')]=_0x43aa94[_0x849f('0xd')];this[_0x849f('0xe')]=_0x43aa94['countcongestionretry'];this[_0x849f('0xf')]=_0x43aa94[_0x849f('0xf')];this[_0x849f('0x10')]=_0x43aa94[_0x849f('0x10')];this[_0x849f('0x11')]=_0x43aa94[_0x849f('0x11')];this[_0x849f('0x12')]=_0x43aa94[_0x849f('0x12')];this[_0x849f('0x13')]=_0x43aa94[_0x849f('0x13')];this[_0x849f('0x14')]=_0x43aa94[_0x849f('0x14')];this['idHopper']=_0x43aa94['id'];this[_0x849f('0x15')]=_0x43aa94['Contact'][_0x849f('0x16')]||'';this['starttime']=moment()['format'](_0x849f('0x17'));this[_0x849f('0x18')]=_0x43aa94[_0x849f('0x18')];this['callbackuniqueid']=_0x43aa94[_0x849f('0x19')];this[_0x849f('0x1a')]=_0x43aa94['callbackat'];this[_0x849f('0x1b')]=_0x43aa94[_0x849f('0x1b')];this[_0x849f('0x1c')]='';this[_0x849f('0x1d')]='';}Action[_0x849f('0x1e')][_0x849f('0x1f')]=function(){return util['format'](_0x849f('0x20'),this[_0x849f('0x9')],this['voiceQueue'][_0x849f('0x21')]>0x0?this[_0x849f('0x7')][_0x849f('0x22')](this[_0x849f('0x3')][_0x849f('0x21')]):this[_0x849f('0x7')]);};Action[_0x849f('0x1e')][_0x849f('0x23')]=function(){return this[_0x849f('0x8')];};module[_0x849f('0x24')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index e194bb3..3674930 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 _0x10b6=['countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','name','number','starttime','responsetime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry'];(function(_0x5d7a39,_0x3e0f31){var _0x5e6dfd=function(_0x4cd13b){while(--_0x4cd13b){_0x5d7a39['push'](_0x5d7a39['shift']());}};_0x5e6dfd(++_0x3e0f31);}(_0x10b6,0x1aa));var _0x610b=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x10b6[_0x501510];return _0x1e6ee5;};'use strict';var util=require('util');var _=require(_0x610b('0x0'));var moment=require(_0x610b('0x1'));function getSeconds(_0x11f14c,_0x58ec88){var _0x4621b4=moment(_0x11f14c)[_0x610b('0x2')](0x0);var _0x175c2c=moment(_0x58ec88)['milliseconds'](0x0);return _0x4621b4[_0x610b('0x3')](_0x175c2c,_0x610b('0x4'));}function AgentComplete(_0x4b1638,_0x572dbc){this[_0x610b('0x5')]=0x4;this[_0x610b('0x6')]=_0x610b('0x7');this['scheduledat']=_0x4b1638[_0x610b('0x8')];this[_0x610b('0x9')]=_0x4b1638[_0x610b('0x9')];this[_0x610b('0xa')]=_0x4b1638[_0x610b('0x9')]===_0x610b('0xb')?_0x610b('0xc'):_0x4b1638[_0x610b('0x9')];this[_0x610b('0xd')]=_0x4b1638[_0x610b('0xd')];this[_0x610b('0xe')]=_0x4b1638[_0x610b('0xe')];this[_0x610b('0xf')]=_0x4b1638['countnoanswerretry'];this[_0x610b('0x10')]=_0x4b1638[_0x610b('0xd')]+_0x4b1638[_0x610b('0xe')]+_0x4b1638[_0x610b('0xf')];this[_0x610b('0x11')]=_0x572dbc[_0x610b('0x11')];this[_0x610b('0x12')]=_0x4b1638[_0x610b('0x13')];this['calleridnum']=_0x4b1638[_0x610b('0x14')];this[_0x610b('0x15')]=_0x4b1638['starttime'];this[_0x610b('0x16')]=_0x4b1638[_0x610b('0x16')];this[_0x610b('0x17')]=_0x4b1638[_0x610b('0x17')];this[_0x610b('0x18')]=moment()['format'](_0x610b('0x19'));this[_0x610b('0x1a')]=getSeconds(_0x4b1638['responsetime'],_0x4b1638['starttime']);this[_0x610b('0x1b')]=getSeconds(_0x4b1638[_0x610b('0x17')],_0x4b1638[_0x610b('0x16')]);this[_0x610b('0x1c')]=getSeconds(this['endtime'],_0x4b1638['answertime']);this[_0x610b('0xc')]=_0x572dbc[_0x610b('0xc')];this['membername']=_0x572dbc['membername'];this['reason']=_0x572dbc[_0x610b('0x1d')];this[_0x610b('0x1e')]=_0x4b1638[_0x610b('0x1e')];this[_0x610b('0x1f')]=_0x4b1638[_0x610b('0x1f')];this[_0x610b('0x20')]=_0x4b1638[_0x610b('0x20')];this[_0x610b('0x21')]=_0x4b1638[_0x610b('0x21')];this[_0x610b('0x22')]=_0x4b1638[_0x610b('0x22')];this['ListId']=_0x4b1638['ListId'];this[_0x610b('0x23')]=_0x4b1638['UserId'];this[_0x610b('0x24')]=_0x4b1638[_0x610b('0x24')];this[_0x610b('0x25')]=_0x4b1638[_0x610b('0x25')];this[_0x610b('0x26')]=_0x4b1638[_0x610b('0x26')]||'';this[_0x610b('0x27')]=_0x4b1638[_0x610b('0x27')]||'';}module['exports']=AgentComplete; \ No newline at end of file +var _0xd440=['CampaignId','originatecalleridnum','originatecalleridname','util','moment','milliseconds','diff','state','Answer','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId'];(function(_0x2e6dd7,_0x36f0ff){var _0x33b630=function(_0x500e33){while(--_0x500e33){_0x2e6dd7['push'](_0x2e6dd7['shift']());}};_0x33b630(++_0x36f0ff);}(_0xd440,0x78));var _0x0d44=function(_0x46349f,_0x5b43b5){_0x46349f=_0x46349f-0x0;var _0x352f72=_0xd440[_0x46349f];return _0x352f72;};'use strict';var util=require(_0x0d44('0x0'));var _=require('lodash');var moment=require(_0x0d44('0x1'));function getSeconds(_0x48c202,_0x1f8735){var _0x1cae58=moment(_0x48c202)[_0x0d44('0x2')](0x0);var _0x1bffb1=moment(_0x1f8735)[_0x0d44('0x2')](0x0);return _0x1cae58[_0x0d44('0x3')](_0x1bffb1,'seconds');}function AgentComplete(_0x16168d,_0x1ddc49){this[_0x0d44('0x4')]=0x4;this['statedesc']=_0x0d44('0x5');this[_0x0d44('0x6')]=_0x16168d[_0x0d44('0x6')];this[_0x0d44('0x7')]=_0x16168d[_0x0d44('0x7')];this['campaigntype']=_0x16168d[_0x0d44('0x7')]===_0x0d44('0x8')?_0x0d44('0x9'):_0x16168d[_0x0d44('0x7')];this['countbusyretry']=_0x16168d[_0x0d44('0xa')];this[_0x0d44('0xb')]=_0x16168d[_0x0d44('0xb')];this[_0x0d44('0xc')]=_0x16168d[_0x0d44('0xc')];this['countglobal']=_0x16168d['countbusyretry']+_0x16168d[_0x0d44('0xb')]+_0x16168d['countnoanswerretry'];this[_0x0d44('0xd')]=_0x1ddc49[_0x0d44('0xd')];this[_0x0d44('0xe')]=_0x16168d[_0x0d44('0xf')];this[_0x0d44('0x10')]=_0x16168d[_0x0d44('0x11')];this[_0x0d44('0x12')]=_0x16168d[_0x0d44('0x12')];this[_0x0d44('0x13')]=_0x16168d[_0x0d44('0x13')];this[_0x0d44('0x14')]=_0x16168d[_0x0d44('0x14')];this[_0x0d44('0x15')]=moment()[_0x0d44('0x16')](_0x0d44('0x17'));this['ringtime']=getSeconds(_0x16168d['responsetime'],_0x16168d[_0x0d44('0x12')]);this[_0x0d44('0x18')]=getSeconds(_0x16168d['answertime'],_0x16168d['responsetime']);this[_0x0d44('0x19')]=getSeconds(this['endtime'],_0x16168d[_0x0d44('0x14')]);this[_0x0d44('0x9')]=_0x1ddc49[_0x0d44('0x9')];this[_0x0d44('0x1a')]=_0x1ddc49[_0x0d44('0x1a')];this[_0x0d44('0x1b')]=_0x1ddc49[_0x0d44('0x1b')];this[_0x0d44('0x1c')]=_0x16168d[_0x0d44('0x1c')];this[_0x0d44('0x1d')]=_0x16168d[_0x0d44('0x1d')];this['callbackat']=_0x16168d[_0x0d44('0x1e')];this[_0x0d44('0x1f')]=_0x16168d[_0x0d44('0x1f')];this[_0x0d44('0x20')]=_0x16168d[_0x0d44('0x20')];this[_0x0d44('0x21')]=_0x16168d[_0x0d44('0x21')];this['UserId']=_0x16168d[_0x0d44('0x22')];this['VoiceQueueId']=_0x16168d[_0x0d44('0x23')];this[_0x0d44('0x24')]=_0x16168d[_0x0d44('0x24')];this['originatecalleridnum']=_0x16168d[_0x0d44('0x25')]||'';this[_0x0d44('0x26')]=_0x16168d[_0x0d44('0x26')]||'';}module['exports']=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index ac932bf..4ed00d0 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 _0xc051=['countcongestionretry','countnoanswerretry','countglobal','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','uniqueid','scheduledat','type','outbound','queue','countbusyretry'];(function(_0x41ab5c,_0x14800f){var _0xab348=function(_0x46ea20){while(--_0x46ea20){_0x41ab5c['push'](_0x41ab5c['shift']());}};_0xab348(++_0x14800f);}(_0xc051,0xb5));var _0x1c05=function(_0x4bdda4,_0x51e189){_0x4bdda4=_0x4bdda4-0x0;var _0x1feba7=_0xc051[_0x4bdda4];return _0x1feba7;};'use strict';var util=require(_0x1c05('0x0'));var _=require(_0x1c05('0x1'));var moment=require('moment');function getSeconds(_0x49a96e,_0x502bb6){var _0x3d0368=moment(_0x49a96e)[_0x1c05('0x2')](0x0);var _0xd5f638=moment(_0x502bb6)['milliseconds'](0x0);return _0x3d0368[_0x1c05('0x3')](_0xd5f638,_0x1c05('0x4'));}function Final(_0x1c5069){this[_0x1c05('0x5')]=_0x1c5069[_0x1c05('0x5')];this[_0x1c05('0x6')]=_0x1c5069[_0x1c05('0x6')];this[_0x1c05('0x7')]=_0x1c5069[_0x1c05('0x7')];this['campaigntype']=_0x1c5069[_0x1c05('0x7')]===_0x1c05('0x8')?_0x1c05('0x9'):_0x1c5069[_0x1c05('0x7')];this['countbusyretry']=_0x1c5069[_0x1c05('0xa')];this[_0x1c05('0xb')]=_0x1c5069[_0x1c05('0xb')];this[_0x1c05('0xc')]=_0x1c5069['countnoanswerretry'];this[_0x1c05('0xd')]=_0x1c5069['countbusyretry']+_0x1c5069[_0x1c05('0xb')]+_0x1c5069[_0x1c05('0xc')];this[_0x1c05('0x9')]=_0x1c5069[_0x1c05('0x9')];this[_0x1c05('0xe')]=_0x1c5069[_0x1c05('0xe')];this[_0x1c05('0xf')]=_0x1c5069[_0x1c05('0xf')];this[_0x1c05('0x10')]=_0x1c5069[_0x1c05('0x10')];this[_0x1c05('0x11')]=_0x1c5069[_0x1c05('0x11')];this['endtime']=_0x1c5069[_0x1c05('0x11')];this[_0x1c05('0x12')]=_0x1c5069[_0x1c05('0x12')]||0x0;this['holdtime']=_0x1c5069[_0x1c05('0x13')]||0x0;this['talktime']=_0x1c5069[_0x1c05('0x14')]||0x0;this[_0x1c05('0x15')]=_0x1c5069[_0x1c05('0x15')];this[_0x1c05('0x16')]=_0x1c5069[_0x1c05('0x16')];this['callbackat']=_0x1c5069[_0x1c05('0x17')];this[_0x1c05('0x18')]=_0x1c5069[_0x1c05('0x18')];this['ContactId']=_0x1c5069[_0x1c05('0x19')];this[_0x1c05('0x1a')]=_0x1c5069[_0x1c05('0x1a')];this['UserId']=_0x1c5069[_0x1c05('0x1b')];this[_0x1c05('0x1c')]=_0x1c5069['VoiceQueueId'];this['CampaignId']=_0x1c5069[_0x1c05('0x1d')];this['originatecalleridnum']=_0x1c5069['originatecalleridnum']||'';this['originatecalleridname']=_0x1c5069[_0x1c05('0x1e')]||'';}module[_0x1c05('0x1f')]=Final; \ No newline at end of file +var _0x5ae9=['campaigntype','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','milliseconds','diff','uniqueid','scheduledat'];(function(_0x41ad25,_0x980bd1){var _0x542261=function(_0x3a5c3e){while(--_0x3a5c3e){_0x41ad25['push'](_0x41ad25['shift']());}};_0x542261(++_0x980bd1);}(_0x5ae9,0x19b));var _0x95ae=function(_0x163f58,_0x1c8ae4){_0x163f58=_0x163f58-0x0;var _0x472ed9=_0x5ae9[_0x163f58];return _0x472ed9;};'use strict';var util=require(_0x95ae('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x41873e,_0x39dedc){var _0x4e8950=moment(_0x41873e)[_0x95ae('0x1')](0x0);var _0x43c580=moment(_0x39dedc)['milliseconds'](0x0);return _0x4e8950[_0x95ae('0x2')](_0x43c580,'seconds');}function Final(_0x2b05e6){this[_0x95ae('0x3')]=_0x2b05e6[_0x95ae('0x3')];this[_0x95ae('0x4')]=_0x2b05e6[_0x95ae('0x4')];this['type']=_0x2b05e6['type'];this[_0x95ae('0x5')]=_0x2b05e6[_0x95ae('0x6')]===_0x95ae('0x7')?_0x95ae('0x8'):_0x2b05e6['type'];this['countbusyretry']=_0x2b05e6[_0x95ae('0x9')];this[_0x95ae('0xa')]=_0x2b05e6[_0x95ae('0xa')];this[_0x95ae('0xb')]=_0x2b05e6['countnoanswerretry'];this['countglobal']=_0x2b05e6[_0x95ae('0x9')]+_0x2b05e6['countcongestionretry']+_0x2b05e6[_0x95ae('0xb')];this[_0x95ae('0x8')]=_0x2b05e6['queue'];this[_0x95ae('0xc')]=_0x2b05e6[_0x95ae('0xc')];this[_0x95ae('0xd')]=_0x2b05e6['calleridnum'];this[_0x95ae('0xe')]=_0x2b05e6[_0x95ae('0xe')];this[_0x95ae('0xf')]=_0x2b05e6['responsetime'];this[_0x95ae('0x10')]=_0x2b05e6['responsetime'];this[_0x95ae('0x11')]=_0x2b05e6['ringtime']||0x0;this[_0x95ae('0x12')]=_0x2b05e6[_0x95ae('0x12')]||0x0;this[_0x95ae('0x13')]=_0x2b05e6[_0x95ae('0x13')]||0x0;this[_0x95ae('0x14')]=_0x2b05e6[_0x95ae('0x14')];this[_0x95ae('0x15')]=_0x2b05e6[_0x95ae('0x15')];this[_0x95ae('0x16')]=_0x2b05e6['callbackat'];this[_0x95ae('0x17')]=_0x2b05e6[_0x95ae('0x17')];this['ContactId']=_0x2b05e6[_0x95ae('0x18')];this[_0x95ae('0x19')]=_0x2b05e6['ListId'];this['UserId']=_0x2b05e6[_0x95ae('0x1a')];this[_0x95ae('0x1b')]=_0x2b05e6[_0x95ae('0x1b')];this[_0x95ae('0x1c')]=_0x2b05e6[_0x95ae('0x1c')];this['originatecalleridnum']=_0x2b05e6[_0x95ae('0x1d')]||'';this[_0x95ae('0x1e')]=_0x2b05e6[_0x95ae('0x1e')]||'';}module[_0x95ae('0x1f')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index da7cfe8..3c92a10 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 _0xa9e0=['countglobal','countcongestionretry','countnoanswerretry','uniqueid','name','calleridnum','number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','type','outbound','queue','countbusyretry'];(function(_0x55d911,_0x2b768c){var _0x3104c2=function(_0x1b4386){while(--_0x1b4386){_0x55d911['push'](_0x55d911['shift']());}};_0x3104c2(++_0x2b768c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function getSeconds(_0x5dd881,_0x550fbc){var _0x18d5c9=moment(_0x5dd881)['milliseconds'](0x0);var _0x333808=moment(_0x550fbc)[_0x0a9e('0x3')](0x0);return _0x18d5c9[_0x0a9e('0x4')](_0x333808,_0x0a9e('0x5'));}function Hangup(_0x981158,_0x57b080){this[_0x0a9e('0x6')]=0x4;this[_0x0a9e('0x7')]=_0x0a9e('0x8');this['scheduledat']=_0x981158['scheduledat'];this[_0x0a9e('0x9')]=_0x981158['type'];this['campaigntype']=_0x981158[_0x0a9e('0x9')]===_0x0a9e('0xa')?_0x0a9e('0xb'):_0x981158[_0x0a9e('0x9')];this[_0x0a9e('0xc')]=_0x981158[_0x0a9e('0xc')];this['countcongestionretry']=_0x981158['countcongestionretry'];this['countnoanswerretry']=_0x981158['countnoanswerretry'];this[_0x0a9e('0xd')]=_0x981158[_0x0a9e('0xc')]+_0x981158[_0x0a9e('0xe')]+_0x981158[_0x0a9e('0xf')];this[_0x0a9e('0x10')]=_0x57b080[_0x0a9e('0x10')];this['calleridname']=_0x981158[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x981158[_0x0a9e('0x13')];this[_0x0a9e('0x14')]=_0x981158[_0x0a9e('0x14')];this[_0x0a9e('0x15')]=_0x981158['responsetime'];this[_0x0a9e('0x16')]=moment()['format'](_0x0a9e('0x17'));this['ringtime']=getSeconds(_0x981158[_0x0a9e('0x15')],_0x981158[_0x0a9e('0x14')]);this['holdtime']=0x0;this[_0x0a9e('0x18')]=getSeconds(this['endtime'],_0x981158[_0x0a9e('0x15')]);this[_0x0a9e('0xb')]=_0x981158[_0x0a9e('0xb')];this[_0x0a9e('0x19')]=_0x0a9e('0x1a');this[_0x0a9e('0x1b')]=_0x57b080[_0x0a9e('0x1c')];this[_0x0a9e('0x1d')]=_0x981158[_0x0a9e('0x1d')];this[_0x0a9e('0x1e')]=_0x981158[_0x0a9e('0x1e')];this[_0x0a9e('0x1f')]=_0x981158['callbackat'];this[_0x0a9e('0x20')]=_0x981158[_0x0a9e('0x20')];this['ContactId']=_0x981158[_0x0a9e('0x21')];this['ListId']=_0x981158['ListId'];this[_0x0a9e('0x22')]=_0x981158[_0x0a9e('0x22')];this[_0x0a9e('0x23')]=_0x981158[_0x0a9e('0x23')];this['CampaignId']=_0x981158[_0x0a9e('0x24')];}module[_0x0a9e('0x25')]=Hangup; \ No newline at end of file +var _0x9957=['state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','seconds'];(function(_0x122d04,_0x3788ee){var _0x282ca0=function(_0x968a45){while(--_0x968a45){_0x122d04['push'](_0x122d04['shift']());}};_0x282ca0(++_0x3788ee);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var util=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));function getSeconds(_0x10a05d,_0x5b96eb){var _0x86c128=moment(_0x10a05d)[_0x7995('0x3')](0x0);var _0x1902b4=moment(_0x5b96eb)[_0x7995('0x3')](0x0);return _0x86c128['diff'](_0x1902b4,_0x7995('0x4'));}function Hangup(_0x1a36d8,_0x137b6b){this[_0x7995('0x5')]=0x4;this[_0x7995('0x6')]=_0x7995('0x7');this['scheduledat']=_0x1a36d8[_0x7995('0x8')];this[_0x7995('0x9')]=_0x1a36d8['type'];this[_0x7995('0xa')]=_0x1a36d8[_0x7995('0x9')]===_0x7995('0xb')?_0x7995('0xc'):_0x1a36d8[_0x7995('0x9')];this[_0x7995('0xd')]=_0x1a36d8[_0x7995('0xd')];this['countcongestionretry']=_0x1a36d8[_0x7995('0xe')];this[_0x7995('0xf')]=_0x1a36d8['countnoanswerretry'];this[_0x7995('0x10')]=_0x1a36d8[_0x7995('0xd')]+_0x1a36d8[_0x7995('0xe')]+_0x1a36d8[_0x7995('0xf')];this[_0x7995('0x11')]=_0x137b6b[_0x7995('0x11')];this[_0x7995('0x12')]=_0x1a36d8['name'];this['calleridnum']=_0x1a36d8[_0x7995('0x13')];this[_0x7995('0x14')]=_0x1a36d8[_0x7995('0x14')];this[_0x7995('0x15')]=_0x1a36d8[_0x7995('0x15')];this[_0x7995('0x16')]=moment()[_0x7995('0x17')](_0x7995('0x18'));this['ringtime']=getSeconds(_0x1a36d8[_0x7995('0x15')],_0x1a36d8['starttime']);this[_0x7995('0x19')]=0x0;this[_0x7995('0x1a')]=getSeconds(this[_0x7995('0x16')],_0x1a36d8[_0x7995('0x15')]);this[_0x7995('0xc')]=_0x1a36d8[_0x7995('0xc')];this['membername']='IVR';this[_0x7995('0x1b')]=_0x137b6b['cause-txt'];this['callback']=_0x1a36d8[_0x7995('0x1c')];this[_0x7995('0x1d')]=_0x1a36d8['callbackuniqueid'];this[_0x7995('0x1e')]=_0x1a36d8['callbackat'];this['recallme']=_0x1a36d8[_0x7995('0x1f')];this[_0x7995('0x20')]=_0x1a36d8[_0x7995('0x20')];this[_0x7995('0x21')]=_0x1a36d8[_0x7995('0x21')];this[_0x7995('0x22')]=_0x1a36d8['UserId'];this[_0x7995('0x23')]=_0x1a36d8[_0x7995('0x23')];this[_0x7995('0x24')]=_0x1a36d8[_0x7995('0x24')];}module[_0x7995('0x25')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 0b3336c..bb1a59b 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 _0x5097=['seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','calleridname','name','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','util','lodash'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x5097,0xbe));var _0x7509=function(_0x3a0ff8,_0x3241c2){_0x3a0ff8=_0x3a0ff8-0x0;var _0x59f33a=_0x5097[_0x3a0ff8];return _0x59f33a;};'use strict';var util=require(_0x7509('0x0'));var _=require(_0x7509('0x1'));var moment=require('moment');function getSeconds(_0x21adfd,_0x5d90d4){var _0x4c4518=moment(_0x21adfd)['milliseconds'](0x0);var _0x391f21=moment(_0x5d90d4)['milliseconds'](0x0);return _0x4c4518['diff'](_0x391f21,_0x7509('0x2'));}function History(_0x188c1d){this[_0x7509('0x3')]=_0x188c1d[_0x7509('0x3')];this['scheduledat']=_0x188c1d[_0x7509('0x4')]||undefined;this['type']=_0x188c1d[_0x7509('0x5')];this[_0x7509('0x6')]=_0x188c1d['type']===_0x7509('0x7')?_0x7509('0x8'):_0x188c1d[_0x7509('0x5')];this[_0x7509('0x9')]=_0x188c1d['countbusyretry'];this['countcongestionretry']=_0x188c1d[_0x7509('0xa')];this['countnoanswerretry']=_0x188c1d[_0x7509('0xb')];this['countglobal']=_0x188c1d[_0x7509('0x9')]+_0x188c1d[_0x7509('0xa')]+_0x188c1d[_0x7509('0xb')];this[_0x7509('0x8')]=_0x188c1d[_0x7509('0x8')];this[_0x7509('0xc')]=_0x188c1d[_0x7509('0xd')];this[_0x7509('0xe')]=_0x188c1d['number'];this[_0x7509('0xf')]=_0x188c1d['starttime'];this[_0x7509('0x10')]=_0x188c1d[_0x7509('0x10')];this[_0x7509('0x11')]=_0x188c1d[_0x7509('0x10')];this[_0x7509('0x12')]=getSeconds(_0x188c1d['responsetime'],_0x188c1d[_0x7509('0xf')]);this[_0x7509('0x13')]=0x0;this[_0x7509('0x14')]=0x0;this[_0x7509('0x15')]=_0x188c1d['callback'];this[_0x7509('0x16')]=_0x188c1d[_0x7509('0x16')];this[_0x7509('0x17')]=_0x188c1d['callbackat'];this[_0x7509('0x18')]=_0x188c1d[_0x7509('0x18')];this[_0x7509('0x19')]=_0x188c1d[_0x7509('0x19')];this['ListId']=_0x188c1d[_0x7509('0x1a')];this[_0x7509('0x1b')]=_0x188c1d[_0x7509('0x1b')];this[_0x7509('0x1c')]=_0x188c1d[_0x7509('0x1c')];this[_0x7509('0x1d')]=_0x188c1d[_0x7509('0x1d')];this[_0x7509('0x1e')]=_0x188c1d[_0x7509('0x1e')]||'';this['originatecalleridname']=_0x188c1d['originatecalleridname']||'';}module[_0x7509('0x1f')]=History; \ No newline at end of file +var _0x372f=['calleridnum','number','starttime','responsetime','endtime','ringtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','queue','calleridname'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x372f,0x1d2));var _0xf372=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x372f[_0x432682];return _0x463d05;};'use strict';var util=require(_0xf372('0x0'));var _=require('lodash');var moment=require(_0xf372('0x1'));function getSeconds(_0x129c35,_0x305044){var _0x6d2634=moment(_0x129c35)[_0xf372('0x2')](0x0);var _0x561a2e=moment(_0x305044)[_0xf372('0x2')](0x0);return _0x6d2634['diff'](_0x561a2e,_0xf372('0x3'));}function History(_0x73e9e8){this[_0xf372('0x4')]=_0x73e9e8[_0xf372('0x4')];this[_0xf372('0x5')]=_0x73e9e8[_0xf372('0x5')]||undefined;this['type']=_0x73e9e8[_0xf372('0x6')];this[_0xf372('0x7')]=_0x73e9e8[_0xf372('0x6')]==='outbound'?'queue':_0x73e9e8['type'];this[_0xf372('0x8')]=_0x73e9e8[_0xf372('0x8')];this[_0xf372('0x9')]=_0x73e9e8[_0xf372('0x9')];this[_0xf372('0xa')]=_0x73e9e8[_0xf372('0xa')];this[_0xf372('0xb')]=_0x73e9e8['countbusyretry']+_0x73e9e8[_0xf372('0x9')]+_0x73e9e8[_0xf372('0xa')];this[_0xf372('0xc')]=_0x73e9e8[_0xf372('0xc')];this[_0xf372('0xd')]=_0x73e9e8['name'];this[_0xf372('0xe')]=_0x73e9e8[_0xf372('0xf')];this[_0xf372('0x10')]=_0x73e9e8[_0xf372('0x10')];this[_0xf372('0x11')]=_0x73e9e8[_0xf372('0x11')];this[_0xf372('0x12')]=_0x73e9e8[_0xf372('0x11')];this[_0xf372('0x13')]=getSeconds(_0x73e9e8[_0xf372('0x11')],_0x73e9e8[_0xf372('0x10')]);this['holdtime']=0x0;this['talktime']=0x0;this[_0xf372('0x14')]=_0x73e9e8[_0xf372('0x14')];this[_0xf372('0x15')]=_0x73e9e8['callbackuniqueid'];this[_0xf372('0x16')]=_0x73e9e8[_0xf372('0x16')];this[_0xf372('0x17')]=_0x73e9e8[_0xf372('0x17')];this[_0xf372('0x18')]=_0x73e9e8['ContactId'];this[_0xf372('0x19')]=_0x73e9e8[_0xf372('0x19')];this[_0xf372('0x1a')]=_0x73e9e8[_0xf372('0x1a')];this[_0xf372('0x1b')]=_0x73e9e8['VoiceQueueId'];this[_0xf372('0x1c')]=_0x73e9e8[_0xf372('0x1c')];this[_0xf372('0x1d')]=_0x73e9e8[_0xf372('0x1d')]||'';this[_0xf372('0x1e')]=_0x73e9e8['originatecalleridname']||'';}module[_0xf372('0x1f')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index c7f613b..e32e813 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 _0xf6cd=['[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','avgHandleTime','[averageHandleTime]\x20','[rescheduleContact]\x20','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','saveInDb','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','Success','isTrunkReachable','trunks','SIP/%s','status','reachable','unmonitored','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','HANGUP','HangupInAMD','membername','AMD','[syncHangupInAMD][createHistory]','value','Machine','amd','[syncMachine][createHistory]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','[syncMachineIvr]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','Unknow','reason','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','YYYY-MM-DD\x20HH:mm:ss','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','syncQueueCallerAbandon','droptime','responsetime','Drop','dropreason','TIMEOUT','outboundDropCallsDayCallersExit','Abandoned','syncQueueMember','actionid','locked','paused','agents','stateinterface','queueBooked','push','pick','idHopper','[unlockQueueStatus][undefined]','queueStatusComplete','[booked][unlockQueueStatus]','rescheduleContact','_rr','length','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','run','[Catch][Preview][syncQueueStatusComplete]','finally','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','\x20Intervals\x20is\x20null\x20','Failure','\x20Intervals\x20is\x20empty\x20','TIMEZONE_UNKNOW','command','interval','content','indexOf','iftime\x20%s,%s','timezones','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','checkDialMethod','dialMethod','progressive','handlePower','power','dialPowerLevel','Queue','handleIvr','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','[syncQueueSummary]','launchHandleIvr','[syncCampaigns]','\x5cw{0,','pow','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueTimeout','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','tags','createdAt','updatedAt','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','trim','dialCutDigit','substring','SIP/%s/%s%s','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','isSuccess','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countnoanswerretry','dialGlobalMaxRetry','add','dialNoAnswerRetryFrequency','minutes','countbusyretry','dialBusyRetryFrequency','dialCongestionMaxRetry','countcongestionretry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','[syncAgentComplete][createHistory][0]','stateGlobal','reason\x200\x20no\x20such\x20number....','NoAnswer','countglobal','[syncAgentComplete][createHistory][3]','dialNoAnswerMaxRetry','createStateFinal','reason\x203\x20ringing\x20no\x20answer','Busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','predictiveIntervalErlangCallsDroppedCalls','Dropped\x20calls\x20day','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','averageHandleTime','getDataPredictive','Predictive\x20after\x20first\x20interval','dialPredictiveInterval','recalculate\x20predictive\x20at',')\x20are\x20less\x20than\x20threshold\x20(','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','dialRecallMeTimeout','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose]','BLACKLIST','[Originate][MoveBlacklist]','limitCalls','temp','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','checkContactBlack','[actionOriginateIvr]\x20','[getContactCampaign2]','floor','dialLimitQueue','not_inuse','countReScheduled','ACTIVE','[handlePredictive][limitChannel]','tryOriginatePredictive','Contact.phone','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','[busyFactor]','Umin\x20=\x20','exports','util','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/environment/','dialer','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','sequence','preview','voiceQueues','campaigns','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBookedRR','syncAgentConnect','bind','originateresponse','syncOriginateResponse','syncAgentComplete','custom:queuesummary','syncHangup','syncNewExten','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','type','strategy','answered','available','loggedIn','pTalking','sumBillable','sumHoldTime','talking','total','unmanaged','abandoned','dialActive','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','Trunk','active','callerid','voice:queue:%s','voice_queue:save','ivr','format','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\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','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','merge','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','outbound','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','hasOwnProperty','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','[getContactDialer2][ReScheduled]','AVAILABLE_CONTACTS_FINISHED','sendMessageOneNotActive','waiting','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','state','statedesc','endtime','starttime','clearZombieChannels','[actions]','isNil','Action','channel','catch','updateOriginated','[Dialer][checkChannel]','queue','[Dialer][checkChannel][ivr]','resolve','then','[countReScheduled]\x20','checkIsBlackList'];(function(_0x2bf888,_0x374f0b){var _0x3038d6=function(_0xe1b6d9){while(--_0xe1b6d9){_0x2bf888['push'](_0x2bf888['shift']());}};_0x3038d6(++_0x374f0b);}(_0xf6cd,0x13c));var _0xdf6c=function(_0x3c6310,_0x13601d){_0x3c6310=_0x3c6310-0x0;var _0x320122=_0xf6cd[_0x3c6310];return _0x320122;};'use strict';var util=require(_0xdf6c('0x0'));var _=require(_0xdf6c('0x1'));var BPromise=require(_0xdf6c('0x2'));var uuid=require(_0xdf6c('0x3'));var moment=require(_0xdf6c('0x4'));var rr=require('rr');var md5=require(_0xdf6c('0x5'));var Redis=require(_0xdf6c('0x6'));var config=require(_0xdf6c('0x7'));var logger=require('../../../config/logger')(_0xdf6c('0x8'));var loggerBooked=require(_0xdf6c('0x9'))(_0xdf6c('0xa'));var loggerPredictive=require(_0xdf6c('0x9'))(_0xdf6c('0xb'));var loggerPredictiveCalls=require(_0xdf6c('0x9'))(_0xdf6c('0xc'));var loggerSyncQueueSummary=require(_0xdf6c('0x9'))(_0xdf6c('0xd'));var ami=require('../ami');config[_0xdf6c('0xe')]=_[_0xdf6c('0xf')](config[_0xdf6c('0xe')],{'host':_0xdf6c('0x10'),'port':0x18eb});var io=require(_0xdf6c('0x11'))(new Redis(config['redis']));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0xdf6c('0x12'));var voiceQueueRt=require(_0xdf6c('0x13'));var Action=require(_0xdf6c('0x14'));var History=require(_0xdf6c('0x15'));var Final=require('./final');var AgentComplete=require(_0xdf6c('0x16'));var QueueCallerAbandon=require(_0xdf6c('0x17'));var Hangup=require(_0xdf6c('0x18'));var ipAgi=process[_0xdf6c('0x19')][_0xdf6c('0x1a')]||_0xdf6c('0x1b');var strategy={'rrmemory':_0xdf6c('0x1c'),'roundrobin':_0xdf6c('0x1d')};var Sequence=function(){};Sequence[_0xdf6c('0x1e')][_0xdf6c('0x1f')]=function(_0x5ebda5){this[_0xdf6c('0x20')]=this[_0xdf6c('0x20')]?this[_0xdf6c('0x20')]['finally'](_0x5ebda5):_0x5ebda5();};function Dialer(_0x54c2aa,_0xa8cff1){this[_0xdf6c('0x21')]=new Sequence();this[_0xdf6c('0x22')]=_0xa8cff1;this['voiceQueues']=_0x54c2aa[_0xdf6c('0x23')];this[_0xdf6c('0x24')]=_0x54c2aa[_0xdf6c('0x24')];this['agents']=_0x54c2aa['agents'];this['trunks']=_0x54c2aa['trunks'];this[_0xdf6c('0x25')]=config[_0xdf6c('0x25')]||0x2;this[_0xdf6c('0x26')]={};this[_0xdf6c('0x27')]={};this[_0xdf6c('0x28')]={};this[_0xdf6c('0x29')]={};this[_0xdf6c('0x2a')]={};this[_0xdf6c('0x2b')]={};this[_0xdf6c('0x2c')]={};this[_0xdf6c('0x2d')]={};this['queueBooked']={};this[_0xdf6c('0x2e')]={};ami['on']('agentconnect',this[_0xdf6c('0x2f')][_0xdf6c('0x30')](this));ami['on']('queuecallerabandon',this['syncQueueCallerAbandon'][_0xdf6c('0x30')](this));ami['on'](_0xdf6c('0x31'),this[_0xdf6c('0x32')][_0xdf6c('0x30')](this));ami['on']('agentcomplete',this[_0xdf6c('0x33')][_0xdf6c('0x30')](this));ami['on'](_0xdf6c('0x34'),this[_0xdf6c('0xd')][_0xdf6c('0x30')](this));ami['on']('hangup',this[_0xdf6c('0x35')][_0xdf6c('0x30')](this));ami['on']('newexten',this[_0xdf6c('0x36')][_0xdf6c('0x30')](this));ami['on']('varset',this['syncVarSet'][_0xdf6c('0x30')](this));ami['on']('queuemember',this['syncQueueMember'][_0xdf6c('0x30')](this));ami['on']('queuestatuscomplete',this[_0xdf6c('0x37')][_0xdf6c('0x30')](this));this[_0xdf6c('0x38')]();this[_0xdf6c('0x39')]();}function isNotNull(_0x5e892d){return _0x5e892d!==null&&!_[_0xdf6c('0x3a')](_0x5e892d);}function checkIsLoggedIn(_0x1d37c1,_0x2eddfd){return function(){if(_0x2eddfd<=0x0){_0x1d37c1[_0xdf6c('0x3b')]=_0xdf6c('0x3c');throw _0x1d37c1[_0xdf6c('0x3d')]+_0xdf6c('0x3e');}};}function isActive(_0x564cff){return _0x564cff;}function checkIsActive(_0xaac70c,_0x54bfd9){return function(){if(!isActive(_0x54bfd9)){_0xaac70c[_0xdf6c('0x3b')]='NOT_ACTIVE';throw _0xaac70c[_0xdf6c('0x3d')]+_0xdf6c('0x3f');}};}function checkInterval(_0x47a2dc){return function(){if(!isNotNull(_0x47a2dc[_0xdf6c('0x40')])){_0x47a2dc[_0xdf6c('0x3b')]=_0xdf6c('0x41');throw _0x47a2dc[_0xdf6c('0x3d')]+_0xdf6c('0x42');}if(!isNotNull(_0x47a2dc[_0xdf6c('0x40')][_0xdf6c('0x43')])){_0x47a2dc[_0xdf6c('0x3b')]=_0xdf6c('0x41');throw _0x47a2dc[_0xdf6c('0x3d')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0xdf6c('0x44')](_0x47a2dc[_0xdf6c('0x40')][_0xdf6c('0x43')]))){_0x47a2dc[_0xdf6c('0x3b')]=_0xdf6c('0x41');throw _0x47a2dc[_0xdf6c('0x3d')]+_0xdf6c('0x42');}};}function msgResponse(_0x538d8a,_0x241020,_0x25e4d2){return{'action':_0x538d8a,'response':_0x241020,'message':_0x25e4d2,'stack':_0x25e4d2};}function myreject(_0x406551){return function(_0x569330){return _0x406551(msgResponse(_0xdf6c('0x45'),_0xdf6c('0x46'),JSON[_0xdf6c('0x47')](_0x569330)));};}function getSeconds(_0x35233f,_0x2a2fa5){var _0x1b105f=moment(_0x35233f)[_0xdf6c('0x48')](0x0);var _0x877863=moment(_0x2a2fa5)['milliseconds'](0x0);return _0x1b105f[_0xdf6c('0x49')](_0x877863,_0xdf6c('0x4a'));}function emit(_0x2d92e2,_0x447e64,_0xd14365){io['to'](_0x2d92e2)['emit'](_0x447e64,_0xd14365);}function emitVoiceQueueSummary(_0x29571f){if(_0x29571f[_0xdf6c('0x4b')]==='outbound'){var _0x4cb5e4={'id':_0x29571f['id'],'name':_0x29571f[_0xdf6c('0x3d')],'strategy':_0x29571f[_0xdf6c('0x4c')],'answered':_0x29571f[_0xdf6c('0x4d')],'available':_0x29571f[_0xdf6c('0x4e')],'loggedIn':_0x29571f[_0xdf6c('0x4f')],'pTalking':_0x29571f[_0xdf6c('0x50')],'sumBillable':_0x29571f[_0xdf6c('0x51')],'sumDuration':_0x29571f['sumDuration'],'sumHoldTime':_0x29571f[_0xdf6c('0x52')]||0x0,'talking':_0x29571f[_0xdf6c('0x53')],'total':_0x29571f[_0xdf6c('0x54')],'type':_0x29571f[_0xdf6c('0x4b')],'unmanaged':_0x29571f[_0xdf6c('0x55')],'abandoned':_0x29571f[_0xdf6c('0x56')],'waiting':_0x29571f['waiting'],'loggedInDb':_0x29571f['loggedInDb'],'dialActive':_0x29571f[_0xdf6c('0x57')],'dialMethod':_0x29571f['dialMethod'],'dialOriginateCallerIdName':_0x29571f[_0xdf6c('0x58')],'dialOriginateCallerIdNumber':_0x29571f['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x29571f[_0xdf6c('0x59')],'dialPrefix':_0x29571f[_0xdf6c('0x5a')],'outboundAnswerAgiCallsDay':_0x29571f[_0xdf6c('0x5b')],'outboundAnswerCallsDay':_0x29571f[_0xdf6c('0x5c')],'outboundBlacklistCallsDay':_0x29571f[_0xdf6c('0x5d')],'outboundBusyCallsDay':_0x29571f[_0xdf6c('0x5e')],'outboundCongestionCallsDay':_0x29571f['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x29571f[_0xdf6c('0x5f')],'outboundDropCallsDayCallersExit':_0x29571f['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x29571f[_0xdf6c('0x60')],'outboundNoAnswerCallsDay':_0x29571f[_0xdf6c('0x61')],'outboundNoSuchCallsDay':_0x29571f[_0xdf6c('0x62')],'outboundOriginateFailureCallsDay':_0x29571f[_0xdf6c('0x63')],'outboundReCallsDay':_0x29571f[_0xdf6c('0x64')],'outboundRejectCallsDay':_0x29571f[_0xdf6c('0x65')],'outboundUnknownCallsDay':_0x29571f[_0xdf6c('0x66')],'predictiveIntervalAnsweredCalls':_0x29571f[_0xdf6c('0x67')],'predictiveIntervalAvgHoldtime':_0x29571f[_0xdf6c('0x68')],'predictiveIntervalAvgTalktime':_0x29571f[_0xdf6c('0x69')],'predictiveIntervalDroppedCallsCallersExit':_0x29571f[_0xdf6c('0x6a')],'predictiveIntervalDroppedCallsTimeout':_0x29571f['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x29571f[_0xdf6c('0x6b')],'predictiveIntervalErlangCallsDroppedCalls':_0x29571f['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x29571f[_0xdf6c('0x6c')],'predictiveIntervalMultiplicativeFactor':_0x29571f[_0xdf6c('0x6d')],'predictiveIntervalPauses':_0x29571f['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x29571f[_0xdf6c('0x6e')],'predictiveIntervalTotalCalls':_0x29571f[_0xdf6c('0x6f')],'message':_0x29571f[_0xdf6c('0x3b')],'originated':_0x29571f[_0xdf6c('0x70')],'erlangCalls':_0x29571f[_0xdf6c('0x71')],'erlangCallToSecond':_0x29571f[_0xdf6c('0x72')],'erlangAbandonmentRate':_0x29571f[_0xdf6c('0x73')],'erlangBusyFactor':_0x29571f['erlangBusyFactor'],'startPredictive':_0x29571f['startPredictive'],'startProgressive':_0x29571f[_0xdf6c('0x2c')]};if(_0x29571f[_0xdf6c('0x74')]){_0x4cb5e4[_0xdf6c('0x74')]={'id':_0x29571f[_0xdf6c('0x74')]['id'],'name':_0x29571f[_0xdf6c('0x74')]['name'],'active':_0x29571f[_0xdf6c('0x74')][_0xdf6c('0x75')],'callerid':_0x29571f[_0xdf6c('0x74')][_0xdf6c('0x76')]};}if(_0x29571f[_0xdf6c('0x40')]){_0x4cb5e4[_0xdf6c('0x40')]={'id':_0x29571f['Interval']['id'],'name':_0x29571f[_0xdf6c('0x40')]['name']};}var _0x2c59c1=md5(JSON[_0xdf6c('0x47')](_0x4cb5e4));if(_0x29571f[_0xdf6c('0x5')]!==_0x2c59c1){_0x29571f['md5']=_0x2c59c1;emit(util['format'](_0xdf6c('0x77'),_0x4cb5e4[_0xdf6c('0x3d')]),_0xdf6c('0x78'),_0x4cb5e4);}}}function emitCampaignSummary(_0xefd31b){if(_0xefd31b[_0xdf6c('0x4b')]===_0xdf6c('0x79')){emit(util[_0xdf6c('0x7a')](_0xdf6c('0x7b'),_0xefd31b[_0xdf6c('0x3d')]),_0xdf6c('0x7c'),_0xefd31b);}}function checkGetDataPredictive(_0x32b212){if(isNotNull(_0x32b212)){if(!_[_0xdf6c('0x44')](_0x32b212)){loggerPredictive[_0xdf6c('0x7d')](_0xdf6c('0x7e'));loggerPredictive[_0xdf6c('0x7d')](_0xdf6c('0x7f'),_0x32b212[_0xdf6c('0x6f')]);loggerPredictive[_0xdf6c('0x7d')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x32b212[_0xdf6c('0x67')]);loggerPredictive[_0xdf6c('0x7d')](_0xdf6c('0x80'),_0x32b212[_0xdf6c('0x81')]);loggerPredictive[_0xdf6c('0x7d')](_0xdf6c('0x82'),_0x32b212[_0xdf6c('0x6a')]);loggerPredictive[_0xdf6c('0x7d')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x32b212[_0xdf6c('0x68')]);loggerPredictive[_0xdf6c('0x7d')](_0xdf6c('0x83'),_0x32b212['predictiveIntervalAvgTalktime']);loggerPredictive[_0xdf6c('0x7d')]('---------------------------');if(_0x32b212[_0xdf6c('0x6f')]>0x0){if(!_['isUndefined'](_0x32b212[_0xdf6c('0x69')])&&_0x32b212['predictiveIntervalAvgTalktime']>0x0){return!![];}else{loggerPredictive[_0xdf6c('0x7d')](_0xdf6c('0x84'));}if(!_[_0xdf6c('0x3a')](_0x32b212[_0xdf6c('0x68')])&&_0x32b212[_0xdf6c('0x68')]>0x0){return!![];}else{loggerPredictive[_0xdf6c('0x7d')](_0xdf6c('0x85'));}}else{loggerPredictive['info'](_0xdf6c('0x86'));}}else{loggerPredictive[_0xdf6c('0x7d')](_0xdf6c('0x87'));}}else{loggerPredictive[_0xdf6c('0x7d')](_0xdf6c('0x87'));}return![];}function mergeDataErlangB(_0x54ac0e){return function(_0xe19a55){loggerPredictive[_0xdf6c('0x7d')](_0xdf6c('0x88'));loggerPredictive[_0xdf6c('0x7d')](_0xdf6c('0x89'),_0xe19a55['erlangCalls']);loggerPredictive['info'](_0xdf6c('0x8a'),_0xe19a55[_0xdf6c('0x72')]);loggerPredictive[_0xdf6c('0x7d')](_0xdf6c('0x8b'),_0xe19a55[_0xdf6c('0x73')]);loggerPredictive[_0xdf6c('0x7d')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xe19a55[_0xdf6c('0x8c')]);loggerPredictive[_0xdf6c('0x7d')](_0xdf6c('0x8b'),_0xe19a55[_0xdf6c('0x73')]);loggerPredictive[_0xdf6c('0x7d')]('---------------------------');_[_0xdf6c('0x8d')](_0x54ac0e,_0xe19a55);};}function getDiff(_0x1a0b56){var _0x583446=moment()[_0xdf6c('0x48')](0x0);var _0x1b08a7=moment(_0x1a0b56)[_0xdf6c('0x48')](0x0);return _0x583446[_0xdf6c('0x49')](_0x1b08a7,_0xdf6c('0x4a'));}function ifInterval(_0x435ad2,_0x1ca527){if(_[_0xdf6c('0x3a')](_0x1ca527)){return![];}if(getDiff(_0x1ca527)<_0x435ad2*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0xf289d6){if(isNotNull(_0xf289d6)){if(!_['isUndefined'](_0xf289d6[_0xdf6c('0x2c')])){_0xf289d6[_0xdf6c('0x2c')]=undefined;loggerPredictive[_0xdf6c('0x7d')](_0xf289d6[_0xdf6c('0x3d')],'clearing\x20variable\x20start\x20progressive');}if(!_['isUndefined'](_0xf289d6['startPredictive'])){_0xf289d6[_0xdf6c('0x2b')]=undefined;loggerPredictive[_0xdf6c('0x7d')](_0xf289d6['name'],_0xdf6c('0x8e'));}if(!_[_0xdf6c('0x3a')](_0xf289d6[_0xdf6c('0x8f')])){clearInterval(_0xf289d6[_0xdf6c('0x8f')]);_0xf289d6[_0xdf6c('0x8f')]=undefined;loggerPredictive[_0xdf6c('0x7d')](_0xf289d6[_0xdf6c('0x3d')],_0xdf6c('0x90'));}}}function erlangb(_0x4d7176,_0x29bad4){if(_0x29bad4===0x0){return 0x0;}var _0x31e30a=0x1;for(var _0x592886=0x1;_0x592886<=_0x29bad4;_0x592886+=0x1){_0x31e30a=0x1+_0x31e30a*_0x592886/_0x4d7176;}return 0x1/_0x31e30a;}function isVoiceQueueOutbound(_0x26dca2){return _0x26dca2===_0xdf6c('0x91');}function isNotPreview(_0x2abd43){return _0x2abd43!==_0xdf6c('0x22');}function isCampaignIvr(_0x4299a0){return _0x4299a0===_0xdf6c('0x79');}function getCallerId(_0x2dd9bf,_0x407bc7,_0x2622cf){if(!_[_0xdf6c('0x3a')](_0x2622cf)&&_0xdf6c('0x92')===typeof _0x2622cf&&!_[_0xdf6c('0x44')](_0x2622cf)){if(!_['isUndefined'](_0x407bc7)&&'string'===typeof _0x407bc7&&!_[_0xdf6c('0x44')](_0x407bc7)){return util[_0xdf6c('0x7a')](_0xdf6c('0x93'),_0x407bc7,_0x2622cf);}return util['format'](_0xdf6c('0x93'),_0x2622cf,_0x2622cf);}if(!_[_0xdf6c('0x3a')](_0x2dd9bf)&&_0xdf6c('0x92')===typeof _0x2dd9bf&&!_[_0xdf6c('0x44')](_0x2dd9bf)){return _0x2dd9bf;}return _0xdf6c('0x94');}function loggerCatchQueueSummary(_0x3b4b36,_0x161957){return function(_0x2d2b62){freeVariablesPredictive(_0x161957);emitVoiceQueueSummary(_0x161957);emitCampaignSummary(_0x161957);loggerSyncQueueSummary[_0xdf6c('0x95')](_0x3b4b36,util[_0xdf6c('0x96')](_0x2d2b62,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x72aa3a,_0x537aa7){return function(_0x33178e){loggerPredictive[_0xdf6c('0x95')](_0x537aa7[_0xdf6c('0x3d')],_0x72aa3a);loggerPredictive['error'](_0x33178e['stack']);freeVariablesPredictive(_0x537aa7);};}function loggerCatch(_0x50f8ac){return function(_0x38bd4e){logger['error'](_0x50f8ac,util[_0xdf6c('0x96')](_0x38bd4e,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0xc452fc){return _0xc452fc&&!_[_0xdf6c('0x3a')](_0xc452fc)&&_0xc452fc['length']>0x0;}function decremetOriginate(_0x10d706){if(!_['isUndefined'](_0x10d706)&&_0x10d706!==null){if(_0x10d706[_0xdf6c('0x97')](_0xdf6c('0x70'))){if(_0x10d706[_0xdf6c('0x70')]>0x0){_0x10d706[_0xdf6c('0x70')]-=0x1;}else{logger[_0xdf6c('0x95')](_0xdf6c('0x98'));}}}else{logger['error'](_0xdf6c('0x99'));}}function checkContactLowerLimitOriginate(_0x3c6950,_0x2dd1e3,_0x2f4d47){if(_0x2dd1e3>_0x2f4d47){for(var _0x30da73=0x0;_0x30da73<_0x2dd1e3-_0x2f4d47;_0x30da73+=0x1){decremetOriginate(_0x3c6950);}}}function loggerGetContactDialer(_0x1d9061,_0x26db69,_0x9f2a19){return function(_0xd5fdad){checkContactLowerLimitOriginate(_0x26db69,_0x9f2a19,0x0);logger['error'](_0x1d9061,util[_0xdf6c('0x96')](_0xd5fdad,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x3791fa){return function(_0x2f17bb){if(isNotNull(_0x2f17bb)&&isNotNull(_0x2f17bb[0x0])){if(_0x2f17bb[0x0][_0xdf6c('0x9a')]>0x0){_0x3791fa[_0xdf6c('0x3b')]='RESCHEDULED_CONTACTS';logger[_0xdf6c('0x7d')](_0xdf6c('0x9b')+_0x3791fa['name'],_0x2f17bb[0x0][_0xdf6c('0x9a')],'contacts');}else{_0x3791fa['message']=_0xdf6c('0x9c');logger[_0xdf6c('0x7d')]('[getContactDialer2][Empty]'+_0x3791fa[_0xdf6c('0x3d')]);}}};}function notSendMessagesQueue(_0x204407){if(_0x204407[_0xdf6c('0x9d')]){freeVariablesPredictive(_0x204407);if(_0x204407['originated']===0x0&&_0x204407[_0xdf6c('0x53')]===0x0&&_0x204407[_0xdf6c('0x9e')]===0x0&&(_0x204407[_0xdf6c('0x50')]||0x0)===0x0){_0x204407['sendMessageOneNotActive']=![];_0x204407[_0xdf6c('0x4e')]=0x0;_0x204407[_0xdf6c('0x3b')]='NOT_ACTIVE';loggerSyncQueueSummary[_0xdf6c('0x95')](_0xdf6c('0x9f'),_0x204407[_0xdf6c('0x3d')],_0xdf6c('0xa0'));}else{_0x204407[_0xdf6c('0x3b')]='IS_DISACTIVED';loggerSyncQueueSummary[_0xdf6c('0x95')](_0xdf6c('0x9f'),_0x204407['name'],'is\x20disactive');}emitVoiceQueueSummary(_0x204407);}}function notSendMessagesCampaign(_0x5e89dc){if(_0x5e89dc['sendMessageOneNotActive']){if(_0x5e89dc[_0xdf6c('0x70')]===0x0){_0x5e89dc[_0xdf6c('0x9d')]=![];_0x5e89dc['message']=_0xdf6c('0xa1');loggerSyncQueueSummary[_0xdf6c('0x95')](_0xdf6c('0xa2'),_0x5e89dc[_0xdf6c('0x3d')],'is\x20not\x20active');}else{_0x5e89dc[_0xdf6c('0x3b')]='IS_DISACTIVED';loggerSyncQueueSummary['error'](_0xdf6c('0xa2'),_0x5e89dc[_0xdf6c('0x3d')],_0xdf6c('0xa3'));}emitCampaignSummary(_0x5e89dc);}}function createObjHistory(_0x57b1dc,_0x18956d,_0xfabd11,_0x2963f7,_0x1d0f70){_0x57b1dc[_0xdf6c('0x3b')]=_0xfabd11;var _0x42e1f0=new Action(_0x57b1dc,_0x18956d);var _0x23c5bb=new History(_0x42e1f0);_0x23c5bb[_0xdf6c('0xa4')]=_0x2963f7;_0x23c5bb[_0xdf6c('0xa5')]=_0x1d0f70;_0x23c5bb[_0xdf6c('0xa6')]=_0x42e1f0[_0xdf6c('0xa7')];return _0x23c5bb;}Dialer[_0xdf6c('0x1e')][_0xdf6c('0x39')]=function(){var _0x58d0ce=this;setInterval(function(){_0x58d0ce[_0xdf6c('0xa8')](_0x58d0ce['uniqueId'],'[uniqueid]');_0x58d0ce['clearZombieChannels'](_0x58d0ce[_0xdf6c('0x27')],_0xdf6c('0xa9'));},0x32c8);};Dialer[_0xdf6c('0x1e')]['clearZombieChannels']=function(_0x3babb7,_0x58f202){var _0x327cd1=this;for(var _0x1057d9 in _0x3babb7){if(_0x3babb7[_0xdf6c('0x97')](_0x1057d9)){this[_0xdf6c('0x21')][_0xdf6c('0x1f')](function(){if(!_[_0xdf6c('0xaa')](_0x3babb7[_0x1057d9])){return ami[_0xdf6c('0xab')]({'action':'status','channel':_0x3babb7[_0x1057d9][_0xdf6c('0xac')]})[_0xdf6c('0xad')](function(_0x8af0ff){if(_0x8af0ff['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x3babb7[_0x1057d9]&&_0x3babb7[_0x1057d9][_0xdf6c('0x4b')]!==_0xdf6c('0x79')){_0x327cd1[_0xdf6c('0xae')](_0x327cd1[_0xdf6c('0x23')][_0x3babb7[_0x1057d9]['queue']]);logger['error'](_0xdf6c('0xaf'),_0x58f202,_0x1057d9,_0x3babb7[_0x1057d9][_0xdf6c('0xb0')]);delete _0x3babb7[_0x1057d9];}if(_0x3babb7[_0x1057d9]&&_0x3babb7[_0x1057d9][_0xdf6c('0x4b')]===_0xdf6c('0x79')){_0x327cd1['updateOriginated'](_0x327cd1[_0xdf6c('0x24')][_0x3babb7[_0x1057d9]['queue']]);logger[_0xdf6c('0x95')](_0xdf6c('0xb1'),_0x58f202,_0x1057d9,_0x3babb7[_0x1057d9]['queue']);delete _0x3babb7[_0x1057d9];}},0x2328);}});}});}}};Dialer[_0xdf6c('0x1e')]['countReScheduled']=function(_0x3ef08b){return BPromise[_0xdf6c('0xb2')]()[_0xdf6c('0xb3')](cmHopper['countReScheduled'](_0x3ef08b))[_0xdf6c('0xad')](loggerCatch(_0xdf6c('0xb4')));};Dialer[_0xdf6c('0x1e')][_0xdf6c('0xb5')]=function(_0x84fe2f){return BPromise['resolve']()[_0xdf6c('0xb3')](cmHopperBlack[_0xdf6c('0xb5')](_0x84fe2f))[_0xdf6c('0xad')](loggerCatch(_0xdf6c('0xb6')));};Dialer[_0xdf6c('0x1e')][_0xdf6c('0xb7')]=function(_0x4045cd){return BPromise[_0xdf6c('0xb2')]()[_0xdf6c('0xb3')](cmHopperBlack['checkIsBlackListIvr'](_0x4045cd))[_0xdf6c('0xad')](loggerCatch(_0xdf6c('0xb8')));};Dialer['prototype']['averageHandleTime']=function(_0x12f79f){return BPromise['resolve']()[_0xdf6c('0xb3')](cmHopperHistory[_0xdf6c('0xb9')](_0x12f79f))[_0xdf6c('0xad')](loggerCatch(_0xdf6c('0xba')));};Dialer['prototype']['rescheduleContact']=function(_0x51c22f){return BPromise[_0xdf6c('0xb2')]()[_0xdf6c('0xb3')](cmHopper['rescheduleContact'](_0x51c22f))[_0xdf6c('0xad')](loggerCatch(_0xdf6c('0xbb')));};Dialer[_0xdf6c('0x1e')]['getContactDialer']=function(_0x37b2b5,_0x2ea0f3,_0x2047b5,_0xb960d6){return BPromise[_0xdf6c('0xb2')]()['then'](cmHopper[_0xdf6c('0xbc')](_0x37b2b5,_0x2ea0f3,_0x2047b5,_0xb960d6))['catch'](loggerCatch(_0xdf6c('0xbd')));};Dialer['prototype'][_0xdf6c('0xbe')]=function(_0x4bd240,_0x26a285,_0x115d61){return BPromise[_0xdf6c('0xb2')]()[_0xdf6c('0xb3')](cmHopper[_0xdf6c('0xbe')](_0x4bd240,_0x26a285,_0x115d61))[_0xdf6c('0xad')](loggerCatch(_0xdf6c('0xbd')));};Dialer[_0xdf6c('0x1e')][_0xdf6c('0xbf')]=function(_0x15215a){return BPromise[_0xdf6c('0xb2')]()[_0xdf6c('0xb3')](voiceQueueRt[_0xdf6c('0xbf')](_0x15215a))[_0xdf6c('0xad')](loggerCatch(_0xdf6c('0xc0')));};Dialer[_0xdf6c('0x1e')]['moveContactManagedDialer']=function(_0x4c6da4){return BPromise['resolve']()['then'](cmHopper[_0xdf6c('0xc1')](_0x4c6da4))[_0xdf6c('0xad')](loggerCatch(_0xdf6c('0xc2')));};Dialer['prototype'][_0xdf6c('0xc3')]=function(_0x211d67){return BPromise[_0xdf6c('0xb2')]()[_0xdf6c('0xb3')](cmHopperHistory[_0xdf6c('0xc3')](_0x211d67))[_0xdf6c('0xad')](loggerCatch(_0xdf6c('0xc4')));};Dialer['prototype'][_0xdf6c('0xae')]=function(_0x2726c9){if(!_[_0xdf6c('0x3a')](_0x2726c9)&&_0x2726c9!==null){if(_0x2726c9[_0xdf6c('0x97')]('originated')){if(_0x2726c9['originated']>0x0){_0x2726c9[_0xdf6c('0x70')]-=0x1;}else{logger[_0xdf6c('0x95')](_0xdf6c('0xc5'));}}}else{logger[_0xdf6c('0x95')](_0xdf6c('0xc6'));}};Dialer['prototype'][_0xdf6c('0xc7')]=function(_0x2b0e5c,_0xb2cee5){var _0x1c9a88=this;return function(_0x54c5c2){_0x1c9a88[_0xdf6c('0xae')](_0xb2cee5);logger[_0xdf6c('0x95')](_0x2b0e5c,util[_0xdf6c('0x96')](_0x54c5c2,{'showHidden':![],'depth':null}));};};Dialer[_0xdf6c('0x1e')][_0xdf6c('0xc8')]=function(_0x232ce9,_0x2ca433,_0x11e4c0){var _0x60f183={'state':0x19,'statedesc':'notFound'};this[_0xdf6c('0xae')](_0x2ca433);this[_0xdf6c('0xc9')](_[_0xdf6c('0x8d')](_0x60f183,_['pick'](_0x11e4c0,[_0xdf6c('0xca'),_0xdf6c('0xcb'),_0xdf6c('0xcc'),_0xdf6c('0xcd'),_0xdf6c('0xce')])),_0xdf6c('0xcf'),_0xdf6c('0xd0'));logger[_0xdf6c('0x95')](_0x232ce9);};Dialer[_0xdf6c('0x1e')]['isSuccess']=function(_0x3dd52a){return _0x3dd52a===_0xdf6c('0xd1');};Dialer['prototype'][_0xdf6c('0xd2')]=function(_0x45a5f0){return!_[_0xdf6c('0x3a')](_0x45a5f0)&&_0x45a5f0&&!_[_0xdf6c('0x3a')](_0x45a5f0[_0xdf6c('0x3d')])&&!_[_0xdf6c('0x3a')](_0x45a5f0[_0xdf6c('0x75')])&&_0x45a5f0[_0xdf6c('0x75')]&&(this[_0xdf6c('0xd3')][util['format'](_0xdf6c('0xd4'),_0x45a5f0[_0xdf6c('0x3d')])][_0xdf6c('0xd5')]===_0xdf6c('0xd6')||this['trunks'][util[_0xdf6c('0x7a')]('SIP/%s',_0x45a5f0[_0xdf6c('0x3d')])][_0xdf6c('0xd5')]===_0xdf6c('0xd7'));};Dialer['prototype']['saveInDb']=function(_0x19dae7,_0x422388,_0xee6a49){this[_0xdf6c('0xc3')](_0x19dae7)[_0xdf6c('0xad')](loggerCatch(_0x422388));this[_0xdf6c('0xc1')](_0x19dae7)['catch'](loggerCatch(_0xee6a49));};Dialer[_0xdf6c('0x1e')]['syncVarSet']=function(_0x256c1d){var _0xec88b1=this[_0xdf6c('0x29')][_0x256c1d[_0xdf6c('0xd8')]];var _0x54f202;if(!_[_0xdf6c('0xaa')](_0x256c1d)&&!_[_0xdf6c('0xaa')](_0x256c1d['variable'])&&!_[_0xdf6c('0xaa')](_0x256c1d[_0xdf6c('0xd9')][_0xdf6c('0xda')])&&_0x256c1d[_0xdf6c('0xdb')]===_0xdf6c('0xdc')&&_0xec88b1){if(_0xec88b1[_0xdf6c('0x4b')]!==_0xdf6c('0x79')&&this[_0xdf6c('0x23')][_0xec88b1[_0xdf6c('0xb0')]][_0xdf6c('0xdd')]&&_0x256c1d['value']===_0xdf6c('0xde')){delete this[_0xdf6c('0x29')][_0x256c1d[_0xdf6c('0xd8')]];this['updateOriginated'](this[_0xdf6c('0x23')][_0xec88b1[_0xdf6c('0xb0')]]);this[_0xdf6c('0x23')][_0xec88b1[_0xdf6c('0xb0')]][_0xdf6c('0x5c')]+=0x1;this[_0xdf6c('0x23')][_0xec88b1[_0xdf6c('0xb0')]][_0xdf6c('0x5b')]+=0x1;_0x54f202=new Hangup(_0xec88b1,_0x256c1d);_0x54f202[_0xdf6c('0xa4')]=0x12;_0x54f202[_0xdf6c('0xa5')]=_0xdf6c('0xdf');_0x54f202[_0xdf6c('0xe0')]=_0xdf6c('0xe1');this[_0xdf6c('0xc9')](_0x54f202,_0xdf6c('0xe2'),'[syncHangupInAMD]');}if(_0xec88b1[_0xdf6c('0x4b')]!==_0xdf6c('0x79')&&this[_0xdf6c('0x23')][_0xec88b1[_0xdf6c('0xb0')]][_0xdf6c('0xdd')]&&_0x256c1d[_0xdf6c('0xe3')]==='MACHINE'){delete this[_0xdf6c('0x29')][_0x256c1d[_0xdf6c('0xd8')]];this[_0xdf6c('0xae')](this[_0xdf6c('0x23')][_0xec88b1[_0xdf6c('0xb0')]]);this[_0xdf6c('0x23')][_0xec88b1[_0xdf6c('0xb0')]][_0xdf6c('0x5c')]+=0x1;this[_0xdf6c('0x23')][_0xec88b1[_0xdf6c('0xb0')]][_0xdf6c('0x5b')]+=0x1;_0x54f202=new Hangup(_0xec88b1,_0x256c1d);_0x54f202[_0xdf6c('0xa4')]=0x13;_0x54f202[_0xdf6c('0xa5')]=_0xdf6c('0xe4');_0x54f202['membername']=_0xdf6c('0xe1');_0x54f202[_0xdf6c('0xe5')]=!![];this['saveInDb'](_0x54f202,_0xdf6c('0xe6'),'[syncMachine]');}if(_0xec88b1[_0xdf6c('0x4b')]===_0xdf6c('0x79')&&this['campaigns'][_0xec88b1[_0xdf6c('0xb0')]][_0xdf6c('0xdd')]&&_0x256c1d[_0xdf6c('0xe3')]==='HANGUP'){delete this[_0xdf6c('0x29')][_0x256c1d[_0xdf6c('0xd8')]];this[_0xdf6c('0xae')](this[_0xdf6c('0x24')][_0xec88b1[_0xdf6c('0xb0')]]);_0x54f202=new Hangup(_0xec88b1,_0x256c1d);_0x54f202[_0xdf6c('0xa4')]=0x12;_0x54f202[_0xdf6c('0xa5')]='HangupInAMD';_0x54f202[_0xdf6c('0xe0')]=_0xdf6c('0xe1');this[_0xdf6c('0xc9')](_0x54f202,_0xdf6c('0xe7'),_0xdf6c('0xe8'));}if(_0xec88b1[_0xdf6c('0x4b')]==='ivr'&&this[_0xdf6c('0x24')][_0xec88b1[_0xdf6c('0xb0')]][_0xdf6c('0xdd')]&&_0x256c1d[_0xdf6c('0xe3')]===_0xdf6c('0xe9')){delete this[_0xdf6c('0x29')][_0x256c1d['uniqueid']];this[_0xdf6c('0xae')](this[_0xdf6c('0x24')][_0xec88b1[_0xdf6c('0xb0')]]);_0x54f202=new Hangup(_0xec88b1,_0x256c1d);_0x54f202[_0xdf6c('0xa4')]=0x13;_0x54f202[_0xdf6c('0xa5')]=_0xdf6c('0xe4');_0x54f202[_0xdf6c('0xe0')]=_0xdf6c('0xe1');_0x54f202[_0xdf6c('0xe5')]=!![];this['saveInDb'](_0x54f202,'[syncMachineIvr][createHistory]',_0xdf6c('0xea'));}}};Dialer['prototype'][_0xdf6c('0x35')]=function(_0x5ca519){var _0x1f7464=this[_0xdf6c('0x29')][_0x5ca519[_0xdf6c('0xd8')]];var _0x39311a=this;var _0x1d648c;if(_0x1f7464&&_0x1f7464[_0xdf6c('0x4b')]===_0xdf6c('0x79')){delete this['uniqueId'][_0x5ca519['uniqueid']];this['updateOriginated'](this['campaigns'][_0x1f7464[_0xdf6c('0xb0')]]);this[_0xdf6c('0x24')][_0x1f7464[_0xdf6c('0xb0')]][_0xdf6c('0xeb')]+=0x1;_0x1d648c=new Hangup(_0x1f7464,_0x5ca519);this[_0xdf6c('0xc3')](_0x1d648c)[_0xdf6c('0xad')](loggerCatch(_0xdf6c('0xec')));this[_0xdf6c('0xc1')](_0x1d648c)[_0xdf6c('0xad')](loggerCatch(_0xdf6c('0xed')));}if(_0x1f7464&&_0x1f7464[_0xdf6c('0x4b')]!==_0xdf6c('0x79')&&isNotNull(this[_0xdf6c('0x23')][_0x1f7464[_0xdf6c('0xb0')]][_0xdf6c('0xee')])){delete this[_0xdf6c('0x29')][_0x5ca519['uniqueid']];this['updateOriginated'](this[_0xdf6c('0x23')][_0x1f7464[_0xdf6c('0xb0')]]);this[_0xdf6c('0x23')][_0x1f7464['queue']][_0xdf6c('0x5c')]+=0x1;this['voiceQueues'][_0x1f7464['queue']][_0xdf6c('0x5b')]+=0x1;_0x1d648c=new Hangup(_0x1f7464,_0x5ca519);_0x1d648c[_0xdf6c('0xa4')]=0x10;_0x1d648c[_0xdf6c('0xa5')]=_0xdf6c('0xef');_0x1d648c[_0xdf6c('0xe0')]=_0xdf6c('0xf0');this['createHistory'](_0x1d648c)['catch'](loggerCatch(_0xdf6c('0xec')));this[_0xdf6c('0xc1')](_0x1d648c)[_0xdf6c('0xad')](loggerCatch(_0xdf6c('0xed')));}if(_0x1f7464&&_0x1f7464['type']!==_0xdf6c('0x79')&&!isNotNull(this[_0xdf6c('0x23')][_0x1f7464['queue']]['dialQueueProject'])){delete this['uniqueId'][_0x5ca519[_0xdf6c('0xd8')]];this['updateOriginated'](this[_0xdf6c('0x23')][_0x1f7464[_0xdf6c('0xb0')]]);this['voiceQueues'][_0x1f7464[_0xdf6c('0xb0')]][_0xdf6c('0x66')]+=0x1;_0x1d648c=new Hangup(_0x1f7464,_0x5ca519);_0x1d648c['state']=0xc;_0x1d648c[_0xdf6c('0xa5')]=_0x5ca519['cause-txt'];_0x1d648c[_0xdf6c('0xe0')]=_0xdf6c('0xf1');this[_0xdf6c('0xc3')](_0x1d648c)[_0xdf6c('0xad')](loggerCatch(_0xdf6c('0xec')));this[_0xdf6c('0xc1')](_0x1d648c)[_0xdf6c('0xad')](loggerCatch(_0xdf6c('0xed')));}};Dialer[_0xdf6c('0x1e')]['syncAgentComplete']=function(_0x5d52f9){var _0x57551a=this[_0xdf6c('0x29')][_0x5d52f9[_0xdf6c('0xd8')]];var _0x8d99bc=this;if(this[_0xdf6c('0x23')][_0x5d52f9[_0xdf6c('0xb0')]]){if(_0x57551a&&_0x57551a[_0xdf6c('0x4b')]!==_0xdf6c('0x79')){delete this[_0xdf6c('0x29')][_0x5d52f9[_0xdf6c('0xd8')]];this[_0xdf6c('0x23')][_0x5d52f9['queue']]['outboundAnswerCallsDay']+=0x1;var _0x7a5c4c=new AgentComplete(_0x57551a,_0x5d52f9);if(_0x5d52f9[_0xdf6c('0xf2')]==='agent'){_0x7a5c4c[_0xdf6c('0xf3')]=this['voiceQueues'][_0x5d52f9[_0xdf6c('0xb0')]][_0xdf6c('0xf4')]&&this[_0xdf6c('0x23')][_0x5d52f9[_0xdf6c('0xb0')]][_0xdf6c('0xf5')]?moment()[_0xdf6c('0x7a')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0xdf6c('0xc3')](_0x7a5c4c)[_0xdf6c('0xad')](loggerCatch(_0xdf6c('0xf6')));this[_0xdf6c('0xc1')](_0x7a5c4c)['catch'](loggerCatch(_0xdf6c('0xf7')));}}};Dialer['prototype'][_0xdf6c('0x2f')]=function(_0x45fa5d){if(this[_0xdf6c('0x23')][_0x45fa5d[_0xdf6c('0xb0')]]){if(this[_0xdf6c('0x29')][_0x45fa5d[_0xdf6c('0xd8')]]&&this['uniqueId'][_0x45fa5d['uniqueid']][_0xdf6c('0x4b')]!==_0xdf6c('0x79')){this[_0xdf6c('0xae')](this[_0xdf6c('0x23')][_0x45fa5d['queue']]);this[_0xdf6c('0x29')][_0x45fa5d[_0xdf6c('0xd8')]][_0xdf6c('0xf8')]=moment()[_0xdf6c('0x7a')](_0xdf6c('0xf9'));}}};Dialer[_0xdf6c('0x1e')][_0xdf6c('0xfa')]=function(_0x40849d){this[_0xdf6c('0xc3')](_0x40849d)[_0xdf6c('0xad')](loggerCatch(_0xdf6c('0xf6')));this[_0xdf6c('0xc1')](_0x40849d)['catch'](loggerCatch(_0xdf6c('0xfb')));};Dialer[_0xdf6c('0x1e')][_0xdf6c('0xfc')]=function(_0x52e250){var _0x373dae=this[_0xdf6c('0x29')][_0x52e250[_0xdf6c('0xd8')]];var _0x31a050=this;if(this[_0xdf6c('0x23')][_0x52e250['queue']]){if(_0x373dae&&_0x373dae[_0xdf6c('0x4b')]!=='ivr'){delete this['uniqueId'][_0x52e250[_0xdf6c('0xd8')]];this[_0xdf6c('0xae')](this[_0xdf6c('0x23')][_0x52e250[_0xdf6c('0xb0')]]);_0x373dae[_0xdf6c('0xfd')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x27780d=new QueueCallerAbandon(_0x373dae,_0x52e250);if(getSeconds(_0x373dae[_0xdf6c('0xfd')],_0x373dae[_0xdf6c('0xfe')])>=_0x373dae['dialQueueTimeout']){this['voiceQueues'][_0x52e250[_0xdf6c('0xb0')]][_0xdf6c('0x81')]+=0x1;this[_0xdf6c('0x23')][_0x52e250[_0xdf6c('0xb0')]]['outboundDropCallsDayTimeout']+=0x1;this[_0xdf6c('0x23')][_0x52e250[_0xdf6c('0xb0')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x27780d[_0xdf6c('0xa4')]=0xa;_0x27780d[_0xdf6c('0xa5')]=_0xdf6c('0xff');_0x27780d[_0xdf6c('0x100')]=_0xdf6c('0x101');_0x27780d['agiafterat']=this[_0xdf6c('0x23')][_0x52e250[_0xdf6c('0xb0')]]['dialQueueProject2']?moment()[_0xdf6c('0x7a')](_0xdf6c('0xf9')):undefined;this['queueCallerAbandonCreateState'](_0x27780d);}else{this[_0xdf6c('0x23')][_0x52e250['queue']][_0xdf6c('0x6a')]+=0x1;this['voiceQueues'][_0x52e250[_0xdf6c('0xb0')]][_0xdf6c('0x102')]+=0x1;_0x27780d[_0xdf6c('0xa4')]=0xb;_0x27780d[_0xdf6c('0xa5')]=_0xdf6c('0x103');_0x27780d['dropreason']='CALLEREXIT';this[_0xdf6c('0xfa')](_0x27780d);}}}};Dialer[_0xdf6c('0x1e')][_0xdf6c('0x36')]=function(_0x4f81a6){if(this[_0xdf6c('0x27')][_0x4f81a6[_0xdf6c('0xd8')]]){this[_0xdf6c('0x27')][_0x4f81a6[_0xdf6c('0xd8')]][_0xdf6c('0xac')]=_0x4f81a6['channel'];}if(this[_0xdf6c('0x29')][_0x4f81a6[_0xdf6c('0xd8')]]){this[_0xdf6c('0x29')][_0x4f81a6[_0xdf6c('0xd8')]]['channel']=_0x4f81a6['channel'];}};Dialer[_0xdf6c('0x1e')][_0xdf6c('0x104')]=function(_0x1608d5){if(strategy[this[_0xdf6c('0x23')][this[_0xdf6c('0x27')][_0x1608d5['actionid']][_0xdf6c('0xb0')]][_0xdf6c('0x4c')]]===_0xdf6c('0x1d')){if(this['actions'][_0x1608d5[_0xdf6c('0x105')]]&&_[_0xdf6c('0xaa')](this[_0xdf6c('0x27')][_0x1608d5['actionid']][_0xdf6c('0x106')])&&_0x1608d5[_0xdf6c('0xd5')]==='1'&&_0x1608d5[_0xdf6c('0x107')]==='0'){if(this[_0xdf6c('0x108')][_0x1608d5[_0xdf6c('0x109')]]){if(!this[_0xdf6c('0x108')][_0x1608d5['stateinterface']][_0xdf6c('0x106')]){this['agents'][_0x1608d5[_0xdf6c('0x109')]][_0xdf6c('0x106')]=!![];this[_0xdf6c('0x27')][_0x1608d5[_0xdf6c('0x105')]][_0xdf6c('0x106')]=!![];this['actions'][_0x1608d5[_0xdf6c('0x105')]]['stateinterface']=_0x1608d5[_0xdf6c('0x109')];}}}}else if((strategy[this['voiceQueues'][this[_0xdf6c('0x27')][_0x1608d5[_0xdf6c('0x105')]][_0xdf6c('0xb0')]][_0xdf6c('0x4c')]]||'rrmemory')==='rrmemory'){if(this['actions'][_0x1608d5[_0xdf6c('0x105')]]){if(this[_0xdf6c('0x108')][_0x1608d5[_0xdf6c('0x109')]]){this[_0xdf6c('0x27')][_0x1608d5[_0xdf6c('0x105')]][_0xdf6c('0x109')]=_0x1608d5[_0xdf6c('0x109')];if(_[_0xdf6c('0xaa')](this[_0xdf6c('0x10a')][this[_0xdf6c('0x27')][_0x1608d5[_0xdf6c('0x105')]][_0xdf6c('0xb0')]])){this[_0xdf6c('0x10a')][this[_0xdf6c('0x27')][_0x1608d5[_0xdf6c('0x105')]][_0xdf6c('0xb0')]]=[];}this[_0xdf6c('0x10a')][this['actions'][_0x1608d5[_0xdf6c('0x105')]][_0xdf6c('0xb0')]][_0xdf6c('0x10b')](_['merge'](_[_0xdf6c('0x10c')](this[_0xdf6c('0x27')][_0x1608d5['actionid']],[_0xdf6c('0x10d'),_0xdf6c('0x109')]),{'status':_0x1608d5[_0xdf6c('0xd5')],'paused':_0x1608d5[_0xdf6c('0x107')]}));}}}};function unlockQueueStatus(_0x779282,_0x454193){setTimeout(function(){if(_[_0xdf6c('0x3a')](_0x779282['queueStatusComplete'])){loggerBooked[_0xdf6c('0x95')](_0xdf6c('0x10e'),_0x454193);}_0x779282[_0xdf6c('0x10f')]=!![];loggerBooked[_0xdf6c('0x7d')](_0xdf6c('0x110'),_0x454193,JSON[_0xdf6c('0x47')](_[_0xdf6c('0x10c')](_0x779282,[_0xdf6c('0x3d'),_0xdf6c('0x10f')])));},0x1f3);}Dialer[_0xdf6c('0x1e')][_0xdf6c('0x37')]=function(_0x353bc4){var _0x2b4d8c=this;var _0x4c37b1=_0x2b4d8c[_0xdf6c('0x23')][_0x2b4d8c[_0xdf6c('0x27')][_0x353bc4[_0xdf6c('0x105')]]['queue']];if(strategy[this[_0xdf6c('0x23')][this['actions'][_0x353bc4['actionid']]['queue']][_0xdf6c('0x4c')]]===_0xdf6c('0x1d')){if(this[_0xdf6c('0x27')][_0x353bc4['actionid']]&&this[_0xdf6c('0x27')][_0x353bc4[_0xdf6c('0x105')]][_0xdf6c('0x109')]){this[_0xdf6c('0x22')]['run'](this[_0xdf6c('0x27')][_0x353bc4[_0xdf6c('0x105')]][_0xdf6c('0x10d')],this[_0xdf6c('0x27')][_0x353bc4[_0xdf6c('0x105')]][_0xdf6c('0x109')])[_0xdf6c('0xad')](function(_0x5f0273){logger[_0xdf6c('0x95')]('[Catch][Preview][syncQueueStatusComplete]',util[_0xdf6c('0x96')](_0x5f0273,{'showHidden':![],'depth':null}));})['finally'](function(){_0x2b4d8c[_0xdf6c('0xae')](_0x2b4d8c[_0xdf6c('0x23')][_0x2b4d8c['actions'][_0x353bc4[_0xdf6c('0x105')]]['queue']]);_0x2b4d8c[_0xdf6c('0x108')][_0x2b4d8c[_0xdf6c('0x27')][_0x353bc4[_0xdf6c('0x105')]]['stateinterface']]['locked']=![];delete _0x2b4d8c[_0xdf6c('0x27')][_0x353bc4[_0xdf6c('0x105')]];unlockQueueStatus(_0x4c37b1);});}else{this[_0xdf6c('0xae')](this[_0xdf6c('0x23')][this[_0xdf6c('0x27')][_0x353bc4[_0xdf6c('0x105')]]['queue']]);this[_0xdf6c('0x111')]({'active':![],'ContactId':this[_0xdf6c('0x27')][_0x353bc4[_0xdf6c('0x105')]][_0xdf6c('0xca')],'ListId':this[_0xdf6c('0x27')][_0x353bc4['actionid']][_0xdf6c('0xcb')],'VoiceQueueId':this[_0xdf6c('0x27')][_0x353bc4[_0xdf6c('0x105')]][_0xdf6c('0xcd')]||undefined,'CampaignId':this['actions'][_0x353bc4[_0xdf6c('0x105')]][_0xdf6c('0xce')]||undefined})[_0xdf6c('0xad')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0xdf6c('0x27')][_0x353bc4[_0xdf6c('0x105')]];unlockQueueStatus(_0x4c37b1);}}else if((strategy[this[_0xdf6c('0x23')][this[_0xdf6c('0x27')][_0x353bc4['actionid']][_0xdf6c('0xb0')]][_0xdf6c('0x4c')]]||_0xdf6c('0x1c'))===_0xdf6c('0x1c')){var _0x27b3d3;if(this[_0xdf6c('0x27')][_0x353bc4[_0xdf6c('0x105')]]&&!_[_0xdf6c('0x44')](this[_0xdf6c('0x10a')][this[_0xdf6c('0x27')][_0x353bc4[_0xdf6c('0x105')]][_0xdf6c('0xb0')]])){if(this[_0xdf6c('0x2e')][_0x2b4d8c[_0xdf6c('0x27')][_0x353bc4[_0xdf6c('0x105')]][_0xdf6c('0xb0')]]){this[_0xdf6c('0x2e')][_0x2b4d8c[_0xdf6c('0x27')][_0x353bc4[_0xdf6c('0x105')]][_0xdf6c('0xb0')]]=this[_0xdf6c('0x2e')][this[_0xdf6c('0x27')][_0x353bc4['actionid']][_0xdf6c('0xb0')]]?this['queueBookedRR'][this[_0xdf6c('0x27')][_0x353bc4[_0xdf6c('0x105')]][_0xdf6c('0xb0')]]:this[_0xdf6c('0x10a')][this[_0xdf6c('0x27')][_0x353bc4[_0xdf6c('0x105')]][_0xdf6c('0xb0')]]?this[_0xdf6c('0x10a')][this[_0xdf6c('0x27')][_0x353bc4['actionid']][_0xdf6c('0xb0')]][_0xdf6c('0x112')]||0x0:0x0;}this[_0xdf6c('0x10a')][this[_0xdf6c('0x27')][_0x353bc4[_0xdf6c('0x105')]]['queue']][_0xdf6c('0x112')]=this[_0xdf6c('0x2e')][this[_0xdf6c('0x27')][_0x353bc4[_0xdf6c('0x105')]]['queue']];for(var _0x258b28=0x0;_0x258b28=0x0?!![]:![];})[_0xdf6c('0xad')](myreject(_0x85677c)));}}else{_0x2d3471[_0xdf6c('0x10b')](ami[_0xdf6c('0xab')]({'action':'command','command':util['format'](_0xdf6c('0x12f'),_0x5ceb4d,!_['isUndefined'](config[_0xdf6c('0x130')][_0x1758eb])?_0x1758eb:'')})['then'](function(_0x343200){return _0x343200['content'][_0xdf6c('0x12e')](_0xdf6c('0x131'))>=0x0?!![]:![];})['catch'](myreject(_0x85677c)));}BPromise[_0xdf6c('0x132')](_0x2d3471)['then'](function(_0x4039cf){var _0x535ad8=_[_0xdf6c('0x133')](_0x4039cf);if(_0x535ad8){return _0x37849e(_0x535ad8);}else{_0x5f4dbc[_0xdf6c('0x3b')]=_0x15637c?_0xdf6c('0x134'):'INTERVAL_IS_OVERTIME';return _0x85677c(msgResponse(_0xdf6c('0x135'),_0xdf6c('0x128'),_0xdf6c('0x136')+_0x15637c+'\x20'+_0x5d68c9+'\x20Interval\x20is\x20overtime:\x20'+util[_0xdf6c('0x96')](_0x5ceb4d,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x1758eb));}})['catch'](function(_0x49896b){return _0x85677c(msgResponse(_0xdf6c('0x126'),_0xdf6c('0x128'),JSON[_0xdf6c('0x47')](_0x49896b)));});});};Dialer[_0xdf6c('0x1e')][_0xdf6c('0x137')]=function(_0x421a27){var _0x3c5afc=this;return function(){switch(_0x421a27[_0xdf6c('0x138')]){case _0xdf6c('0x139'):freeVariablesPredictive(_0x421a27);_0x3c5afc[_0xdf6c('0x13a')](_0x421a27,0x1);break;case _0xdf6c('0x13b'):freeVariablesPredictive(_0x421a27);_0x3c5afc['handlePower'](_0x421a27,_0x421a27[_0xdf6c('0x13c')]);break;case'predictive':_0x3c5afc[_0xdf6c('0xb')](_0x421a27);break;case _0xdf6c('0xa'):freeVariablesPredictive(_0x421a27);_0x3c5afc[_0xdf6c('0x13a')](_0x421a27,0x1);break;default:freeVariablesPredictive(_0x421a27);logger[_0xdf6c('0x95')](_0xdf6c('0x13d'),_0x421a27[_0xdf6c('0x3d')],'method\x20not\x20recognized');}};};Dialer[_0xdf6c('0x1e')]['launchHandleIvr']=function(_0x4d4bf0){var _0xc390f2=this;return function(){_0xc390f2[_0xdf6c('0x13e')](_0x4d4bf0);};};Dialer['prototype']['syncQueueSummary']=function(_0x48305c){var _0x182534=this;if(isNotPreview(_0x48305c['dialMethod'])){if(isVoiceQueueOutbound(_0x48305c[_0xdf6c('0x4b')])&&isActive(_0x48305c['dialActive'])){_0x48305c[_0xdf6c('0x9d')]=!![];BPromise[_0xdf6c('0xb2')]()[_0xdf6c('0xb3')](checkIsLoggedIn(_0x48305c,_0x48305c[_0xdf6c('0x4f')]))[_0xdf6c('0xb3')](checkIsActive(_0x48305c,_0x48305c[_0xdf6c('0x57')]))[_0xdf6c('0xb3')](checkInterval(_0x48305c))[_0xdf6c('0xb3')](_0x182534[_0xdf6c('0x121')](_0x48305c))['then'](_0x182534['checkIfTime'](_0x48305c[_0xdf6c('0x13f')],_0x48305c[_0xdf6c('0x140')],_0x48305c[_0xdf6c('0x3d')],_0x48305c))[_0xdf6c('0xb3')](_0x182534[_0xdf6c('0x141')](_0x48305c['Interval'],_0x48305c['dialTimezone'],_0x48305c[_0xdf6c('0x3d')],_0x48305c))[_0xdf6c('0xb3')](_0x182534[_0xdf6c('0x137')](_0x48305c))['catch'](loggerCatchQueueSummary(_0xdf6c('0x142'),_0x48305c));}else{notSendMessagesQueue(_0x48305c);}}else{freeVariablesPredictive(_0x48305c);}};Dialer[_0xdf6c('0x1e')][_0xdf6c('0x120')]=function(){var _0x356200=this;var _0x2ee806;for(var _0x5f0289 in this[_0xdf6c('0x24')]){if(this[_0xdf6c('0x24')][_0xdf6c('0x97')](_0x5f0289)){_0x2ee806=this['campaigns'][_0x5f0289];if(isCampaignIvr(_0x2ee806[_0xdf6c('0x4b')])&&isActive(_0x2ee806['active'])){_0x2ee806[_0xdf6c('0x9d')]=!![];BPromise[_0xdf6c('0xb2')]()[_0xdf6c('0xb3')](checkIsActive(_0x2ee806,_0x2ee806['active']))[_0xdf6c('0xb3')](checkInterval(_0x2ee806))[_0xdf6c('0xb3')](_0x356200[_0xdf6c('0x121')](_0x2ee806))[_0xdf6c('0xb3')](_0x356200[_0xdf6c('0x125')](_0x2ee806[_0xdf6c('0x13f')],_0x2ee806[_0xdf6c('0x140')],_0x2ee806['name'],_0x2ee806))[_0xdf6c('0xb3')](_0x356200[_0xdf6c('0x141')](_0x2ee806['Interval'],_0x2ee806[_0xdf6c('0x140')],_0x2ee806[_0xdf6c('0x3d')],_0x2ee806))[_0xdf6c('0xb3')](_0x356200[_0xdf6c('0x143')](_0x2ee806))[_0xdf6c('0xad')](loggerCatchQueueSummary(_0xdf6c('0x144'),_0x2ee806));}else{notSendMessagesCampaign(_0x2ee806);}}}};function getCallerIdRandom(_0x1a039c,_0x4a47e0){var _0x147859,_0x2f3280,_0x6b788a;if(_0x4a47e0<=0x0){_0x4a47e0=0x1;}_0x147859=new RegExp(_0xdf6c('0x145')+_0x4a47e0+'}$');_0x2f3280=Math[_0xdf6c('0x146')](0xa,_0x4a47e0-0x1);_0x6b788a=Math[_0xdf6c('0x146')](0xa,_0x4a47e0)-0x1;return util[_0xdf6c('0x7a')]('%s',_['replace'](_0x1a039c,_0x147859,_[_0xdf6c('0x147')](_0x2f3280,_0x6b788a)));}function extractCalleridName(_0x4f3a4a){var _0x4076d3=_0x4f3a4a[_0xdf6c('0x148')](/"(.*?)"/);return _0x4076d3?_0x4076d3[0x1]:_0x4f3a4a;}function extractCalleridNumber(_0x31e3f1){var _0x2878f6=_0x31e3f1['match'](/<(.*?)>/);return _0x2878f6?_0x2878f6[0x1]:_0x31e3f1;}Dialer['prototype'][_0xdf6c('0x149')]=function(_0x301b1a,_0x4daa37){var _0x2bdebe=this;var _0x18c8ad=uuid['v4']();this['actions'][_0x18c8ad]=new Action(_0x301b1a,_0x4daa37,_0x18c8ad);return new BPromise(function(_0x34dd8f,_0x8db22f){if(_[_0xdf6c('0x3a')](_0x301b1a)&&_0xdf6c('0x14a')!==typeof _0x301b1a){return _0x8db22f(msgResponse(_0xdf6c('0x14b'),_0xdf6c('0x128'),_0xdf6c('0x14c')));}if(_[_0xdf6c('0x3a')](_0x4daa37[_0xdf6c('0x14d')][_0xdf6c('0x14e')])||_0x4daa37[_0xdf6c('0x14d')][_0xdf6c('0x14e')]===null){return _0x8db22f(msgResponse(_0xdf6c('0x14b'),_0xdf6c('0x128'),_0xdf6c('0x14f')));}var _0x53c569={'XMD-CALLERID':_0x2bdebe['actions'][_0x18c8ad]['getCaller'](),'XMD-AGI':_0x301b1a[_0xdf6c('0xee')]?util[_0xdf6c('0x7a')](_0xdf6c('0x150'),ipAgi,_0x301b1a[_0xdf6c('0xee')]):_0xdf6c('0x151'),'XMD-AGIAFTER':_0x301b1a[_0xdf6c('0xf4')]?util['format'](_0xdf6c('0x150'),ipAgi,_0x301b1a[_0xdf6c('0xf4')]):'NONE','XMD-QUEUE':_0x301b1a[_0xdf6c('0x4b')]===_0xdf6c('0x91')?util['format'](_0xdf6c('0x152'),_0x301b1a[_0xdf6c('0x3d')],_0x301b1a['dialQueueOptions']||'',_0x301b1a['dialAgiAfterHangupAgent']?'c':'',_0x301b1a[_0xdf6c('0x153')]||0x3):_0xdf6c('0x151'),'XMD-CONTACTID':_0x4daa37[_0xdf6c('0xca')],'XMD-CDRTYPE':_0xdf6c('0x8'),'CALLERID(all)':_0x2bdebe[_0xdf6c('0x27')][_0x18c8ad]['getCaller'](),'XMD-AMD':_0x301b1a[_0xdf6c('0xdd')]?'ACTIVE':_0xdf6c('0x151'),'XMD-DESTINATION':_0xdf6c('0xdc')};if(_0x301b1a[_0xdf6c('0xdd')]){_0x53c569[_0xdf6c('0x154')]=_0x301b1a[_0xdf6c('0x155')]||0x9c4;_0x53c569['XMD-AMDGREETING']=_0x301b1a[_0xdf6c('0x156')]||0x5dc;_0x53c569[_0xdf6c('0x157')]=_0x301b1a['dialAMDAfterGreetingSilence']||0x320;_0x53c569[_0xdf6c('0x158')]=_0x301b1a['dialAMDTotalAnalysisTime']||0x1388;_0x53c569[_0xdf6c('0x159')]=_0x301b1a[_0xdf6c('0x15a')]||0x64;_0x53c569[_0xdf6c('0x15b')]=_0x301b1a['dialAMDBetweenWordsSilence']||0x32;_0x53c569[_0xdf6c('0x15c')]=_0x301b1a[_0xdf6c('0x15d')]||0x3;_0x53c569[_0xdf6c('0x15e')]=_0x301b1a[_0xdf6c('0x15f')]||0x100;_0x53c569['XMD-AMDMAXIMUMWORDLENGTH']=_0x301b1a[_0xdf6c('0x160')]||0x1388;}if(_0x301b1a[_0xdf6c('0x4b')]==='outbound'){_0x53c569['XMD-VOICEQUEUEID']=_0x4daa37[_0xdf6c('0xcd')];}else{_0x53c569['XMD-CAMPAIGNID']=_0x4daa37['CampaignId'];}for(var _0x2ef396 in _0x4daa37[_0xdf6c('0x14d')]){if(_0x4daa37['Contact']['hasOwnProperty'](_0x2ef396)){if(isNotNull(_0x4daa37[_0xdf6c('0x14d')][_0x2ef396])&&_0x2ef396!=='id'&&_0x2ef396!==_0xdf6c('0x161')&&_0x2ef396!==_0xdf6c('0x162')&&_0x2ef396!==_0xdf6c('0x163')){_0x53c569[util[_0xdf6c('0x7a')]('%s%s',_0xdf6c('0x164'),_[_0xdf6c('0x165')](_0x2ef396))]=_0x4daa37[_0xdf6c('0x14d')][_0x2ef396];}}}var _0x454181=_0x2bdebe[_0xdf6c('0xd2')](_0x301b1a[_0xdf6c('0x74')])?getCallerId(_0x301b1a[_0xdf6c('0x74')]['callerid'],_0x301b1a['dialOriginateCallerIdName'],_0x301b1a[_0xdf6c('0x166')]>0x0?getCallerIdRandom(_0x301b1a[_0xdf6c('0x167')],_0x301b1a[_0xdf6c('0x166')]):_0x301b1a['dialOriginateCallerIdNumber']):getCallerId(_[_0xdf6c('0xaa')](_0x301b1a['TrunkBackup'])?_0x301b1a[_0xdf6c('0x74')][_0xdf6c('0x76')]:_0x301b1a['TrunkBackup'][_0xdf6c('0x76')],_0x301b1a['dialOriginateCallerIdName'],_0x301b1a['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x301b1a[_0xdf6c('0x167')],_0x301b1a[_0xdf6c('0x166')]):_0x301b1a[_0xdf6c('0x167')]);if(_0x454181){_0x53c569[_0xdf6c('0x168')]=_0x2bdebe[_0xdf6c('0x27')][_0x18c8ad][_0xdf6c('0x169')]=extractCalleridName(_0x454181);_0x53c569[_0xdf6c('0x16a')]=_0x2bdebe[_0xdf6c('0x27')][_0x18c8ad][_0xdf6c('0x16b')]=extractCalleridNumber(_0x454181);}return ami['Action']({'actionid':_0x18c8ad,'action':_0xdf6c('0x14b'),'channel':_0x2bdebe[_0xdf6c('0xd2')](_0x301b1a[_0xdf6c('0x74')])?util[_0xdf6c('0x7a')]('SIP/%s/%s%s',_0x301b1a[_0xdf6c('0x74')]['name'],isNotNull(_0x301b1a[_0xdf6c('0x5a')])?_0x301b1a['dialPrefix'][_0xdf6c('0x16c')]()||'':'',_0x301b1a[_0xdf6c('0x16d')]>0x0?_0x4daa37[_0xdf6c('0x14d')][_0xdf6c('0x14e')][_0xdf6c('0x16e')](_0x301b1a['dialCutDigit']):_0x4daa37[_0xdf6c('0x14d')][_0xdf6c('0x14e')]):util[_0xdf6c('0x7a')](_0xdf6c('0x16f'),_['isNil'](_0x301b1a['TrunkBackup'])?_0x301b1a[_0xdf6c('0x74')][_0xdf6c('0x3d')]:_0x301b1a[_0xdf6c('0x122')][_0xdf6c('0x3d')],isNotNull(_0x301b1a[_0xdf6c('0x5a')])?_0x301b1a['dialPrefix']['trim']()||'':'',_0x301b1a[_0xdf6c('0x16d')]>0x0?_0x4daa37['Contact'][_0xdf6c('0x14e')]['substring'](_0x301b1a[_0xdf6c('0x16d')]):_0x4daa37[_0xdf6c('0x14d')][_0xdf6c('0x14e')]),'callerid':_0x454181,'Exten':_0xdf6c('0xdc'),'Context':_0xdf6c('0x170'),'Priority':'1','variable':_0x53c569,'timeout':(_0x301b1a['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x18c8ad})[_0xdf6c('0xb3')](function(_0x529886){return _0x34dd8f(_0x529886);})[_0xdf6c('0xad')](function(_0x40ad9a){_0x301b1a[_0xdf6c('0x63')]+=0x1;var _0x4906dc=new History(_0x2bdebe[_0xdf6c('0x27')][_0x18c8ad]);logger[_0xdf6c('0x95')](util['format'](_0xdf6c('0x171'),JSON[_0xdf6c('0x47')](_0x40ad9a)));_0x4906dc['state']=0xe;_0x4906dc['statedesc']=_0xdf6c('0x172');_0x4906dc[_0xdf6c('0xa7')]=moment()[_0xdf6c('0x7a')](_0xdf6c('0xf9'));_0x4906dc[_0xdf6c('0xa6')]=_0x4906dc['starttime'];_0x2bdebe['createHistory'](_0x4906dc)[_0xdf6c('0xad')](loggerCatch(_0xdf6c('0x173')));_0x2bdebe[_0xdf6c('0xc1')](_0x4906dc)[_0xdf6c('0xad')](loggerCatch(_0xdf6c('0x173')))[_0xdf6c('0x11a')](function(){delete _0x2bdebe['actions'][_0x18c8ad];return _0x8db22f(msgResponse(_0xdf6c('0x14b'),_0xdf6c('0x46'),_0xdf6c('0x174')));});});});};Dialer[_0xdf6c('0x1e')]['syncOriginateResponse']=function(_0x130e95){var _0xb890db=this['actions'][_0x130e95[_0xdf6c('0x105')]];var _0x52f19d=this;if(_0xb890db){delete this[_0xdf6c('0x27')][_0x130e95[_0xdf6c('0x105')]];_0xb890db[_0xdf6c('0xfe')]=moment()[_0xdf6c('0x7a')](_0xdf6c('0xf9'));var _0x69bc86=_0xb890db['type']===_0xdf6c('0x79')?this[_0xdf6c('0x24')][_0xb890db[_0xdf6c('0xb0')]]:this[_0xdf6c('0x23')][_0xb890db[_0xdf6c('0x175')]()];if(!this[_0xdf6c('0x176')](_0x130e95['response'])){this[_0xdf6c('0xae')](_0x69bc86);return this[_0xdf6c('0x177')](_0xb890db,_0x69bc86,_0x130e95)['then'](function(_0xdfa37b){})[_0xdf6c('0xad')](loggerCatch(_0xdf6c('0x178')));}else{this[_0xdf6c('0x29')][_0x130e95['uniqueid']]=_0xb890db;}}};Dialer['prototype'][_0xdf6c('0x179')]=function(_0x48bdb1,_0x4144ad,_0x2574b1){var _0x312048=new History(_0x4144ad);if(_0x312048['countbusyretry']+_0x312048['countcongestionretry']+_0x312048[_0xdf6c('0x17a')]>=_0x2574b1[_0xdf6c('0x17b')]-0x1){return!![];}switch(_0x48bdb1){case 0x3:if(_0x312048[_0xdf6c('0x17a')]>=_0x2574b1['dialNoAnswerMaxRetry']-0x1){return!![];}else{this[_0xdf6c('0x111')]({'active':![],'countnoanswerretry':_0x312048[_0xdf6c('0x17a')]+=0x1,'scheduledat':moment()[_0xdf6c('0x17c')](_0x2574b1[_0xdf6c('0x17d')],_0xdf6c('0x17e'))[_0xdf6c('0x7a')](_0xdf6c('0xf9')),'ContactId':_0x312048[_0xdf6c('0xca')],'ListId':_0x312048[_0xdf6c('0xcb')],'VoiceQueueId':_0x312048[_0xdf6c('0xcd')]||undefined,'CampaignId':_0x312048[_0xdf6c('0xce')]||undefined})[_0xdf6c('0xad')](loggerCatch('[rescheduleContact][NoAnswer]'));}break;case 0x5:if(_0x312048[_0xdf6c('0x17f')]>=_0x2574b1['dialBusyMaxRetry']-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countbusyretry':_0x312048[_0xdf6c('0x17f')]+=0x1,'scheduledat':moment()['add'](_0x2574b1[_0xdf6c('0x180')],_0xdf6c('0x17e'))[_0xdf6c('0x7a')](_0xdf6c('0xf9')),'ContactId':_0x312048[_0xdf6c('0xca')],'ListId':_0x312048[_0xdf6c('0xcb')],'VoiceQueueId':_0x312048[_0xdf6c('0xcd')]||undefined,'CampaignId':_0x312048[_0xdf6c('0xce')]||undefined})[_0xdf6c('0xad')](loggerCatch('[rescheduleContact]\x20[Busy]'));}break;case 0x8:if(_0x312048['countcongestionretry']>=_0x2574b1[_0xdf6c('0x181')]-0x1){return!![];}else{this[_0xdf6c('0x111')]({'active':![],'countcongestionretry':_0x312048[_0xdf6c('0x182')]+=0x1,'scheduledat':moment()[_0xdf6c('0x17c')](_0x2574b1[_0xdf6c('0x183')],_0xdf6c('0x17e'))[_0xdf6c('0x7a')](_0xdf6c('0xf9')),'ContactId':_0x312048['ContactId'],'ListId':_0x312048[_0xdf6c('0xcb')],'VoiceQueueId':_0x312048[_0xdf6c('0xcd')]||undefined,'CampaignId':_0x312048[_0xdf6c('0xce')]||undefined})['catch'](loggerCatch(_0xdf6c('0x184')));}break;default:return!![];}};Dialer[_0xdf6c('0x1e')][_0xdf6c('0x177')]=function(_0x53cbdc,_0x4e9795,_0x1e3743){var _0x1d834a=this;var _0x34ed47=new History(_0x53cbdc);return new BPromise(function(_0x2bf16f,_0x452969){if(_['isUndefined'](_0x4e9795)&&_0xdf6c('0x14a')!==typeof _0x4e9795){return _0x452969(msgResponse(_0xdf6c('0x185'),_0xdf6c('0x128'),_0xdf6c('0x186')));}if(_[_0xdf6c('0x3a')](_0x1e3743)&&_0xdf6c('0x14a')!==typeof _0x1e3743){return _0x452969(msgResponse(_0xdf6c('0x185'),_0xdf6c('0x128'),_0xdf6c('0x187')));}switch(_0x1e3743[_0xdf6c('0xf2')]){case'0':_0x4e9795[_0xdf6c('0x62')]+=0x1;_0x34ed47[_0xdf6c('0xa4')]=0x0;_0x34ed47[_0xdf6c('0xa5')]=_0xdf6c('0x188');_0x1d834a['createHistory'](_0x34ed47)['catch'](loggerCatch(_0xdf6c('0x189')));if(_0x1d834a[_0xdf6c('0x179')](0x0,_0x53cbdc,_0x4e9795)){if(_0x34ed47[_0xdf6c('0x17f')]+_0x34ed47[_0xdf6c('0x182')]+_0x34ed47[_0xdf6c('0x17a')]>=_0x4e9795['dialGlobalMaxRetry']){_0x1d834a[_0xdf6c('0x18a')](_0x34ed47,_0x2bf16f,_0x452969,_0xdf6c('0x18b'));}else{_0x1d834a['createStateFinal'](_0x34ed47,_0x2bf16f,_0x452969,_0xdf6c('0x18b'));}}break;case'3':_0x4e9795[_0xdf6c('0x61')]+=0x1;_0x34ed47['state']=0x3;_0x34ed47['statedesc']=_0xdf6c('0x18c');_0x34ed47[_0xdf6c('0x17a')]+=0x1;_0x34ed47[_0xdf6c('0x18d')]+=0x1;_0x1d834a[_0xdf6c('0xc3')](_0x34ed47)['catch'](loggerCatch(_0xdf6c('0x18e')));if(_0x1d834a[_0xdf6c('0x179')](0x3,_0x53cbdc,_0x4e9795)){if(_0x34ed47[_0xdf6c('0x17a')]>=_0x4e9795[_0xdf6c('0x18f')]){_0x1d834a[_0xdf6c('0x190')](_0x34ed47,_0x2bf16f,_0x452969,_0xdf6c('0x191'));}else{_0x1d834a['stateGlobal'](_0x34ed47,_0x2bf16f,_0x452969,_0xdf6c('0x191'));}}break;case'5':_0x4e9795[_0xdf6c('0x5e')]+=0x1;_0x34ed47[_0xdf6c('0xa4')]=0x5;_0x34ed47[_0xdf6c('0xa5')]=_0xdf6c('0x192');_0x34ed47[_0xdf6c('0x17f')]+=0x1;_0x34ed47[_0xdf6c('0x18d')]+=0x1;_0x1d834a[_0xdf6c('0xc3')](_0x34ed47)[_0xdf6c('0xad')](loggerCatch(_0xdf6c('0x193')));if(_0x1d834a[_0xdf6c('0x179')](0x5,_0x53cbdc,_0x4e9795)){if(_0x34ed47[_0xdf6c('0x17f')]>=_0x4e9795['dialBusyMaxRetry']){_0x1d834a[_0xdf6c('0x190')](_0x34ed47,_0x2bf16f,_0x452969,_0xdf6c('0x194'));}else{_0x1d834a[_0xdf6c('0x18a')](_0x34ed47,_0x2bf16f,_0x452969,_0xdf6c('0x194'));}}break;case'8':_0x4e9795['outboundCongestionCallsDay']+=0x1;_0x34ed47[_0xdf6c('0xa4')]=0x8;_0x34ed47[_0xdf6c('0xa5')]=_0xdf6c('0x195');_0x34ed47[_0xdf6c('0x182')]+=0x1;_0x34ed47[_0xdf6c('0x18d')]+=0x1;_0x1d834a[_0xdf6c('0xc3')](_0x34ed47)[_0xdf6c('0xad')](loggerCatch(_0xdf6c('0x196')));if(_0x1d834a[_0xdf6c('0x179')](0x8,_0x53cbdc,_0x4e9795)){if(_0x34ed47[_0xdf6c('0x182')]>=_0x4e9795['dialCongestionMaxRetry']){_0x1d834a['createStateFinal'](_0x34ed47,_0x2bf16f,_0x452969,_0xdf6c('0x197'));}else{_0x1d834a[_0xdf6c('0x18a')](_0x34ed47,_0x2bf16f,_0x452969,_0xdf6c('0x197'));}}break;default:_0x4e9795[_0xdf6c('0x66')]+=0x1;_0x34ed47[_0xdf6c('0xa4')]=0xc;_0x34ed47[_0xdf6c('0xa5')]=_0x1e3743[_0xdf6c('0xf2')];_0x1d834a[_0xdf6c('0xc3')](_0x34ed47)['catch'](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x1d834a[_0xdf6c('0x179')](_0x1e3743[_0xdf6c('0xf2')],_0x53cbdc,_0x4e9795)){if(_0x34ed47[_0xdf6c('0x17f')]+_0x34ed47[_0xdf6c('0x182')]+_0x34ed47[_0xdf6c('0x17a')]>=_0x4e9795['dialGlobalMaxRetry']){_0x1d834a[_0xdf6c('0x18a')](_0x34ed47,_0x2bf16f,_0x452969,_0x1e3743[_0xdf6c('0xf2')]);}else{_0x1d834a[_0xdf6c('0x190')](_0x34ed47,_0x2bf16f,_0x452969,_0x1e3743[_0xdf6c('0xf2')]);}}}});};Dialer[_0xdf6c('0x1e')]['stateGlobal']=function(_0x44b478,_0x13d4aa,_0x38b78d,_0x34e338){var _0x226386=new Final(_0x44b478);_0x226386[_0xdf6c('0xa4')]=0xf;_0x226386[_0xdf6c('0xa5')]=_0xdf6c('0x198');this[_0xdf6c('0x190')](_0x226386,_0x13d4aa,_0x38b78d,_0x34e338);};Dialer[_0xdf6c('0x1e')][_0xdf6c('0x190')]=function(_0x23c7f2,_0x402dc2,_0x407ca4,_0x25e22b){this[_0xdf6c('0xc1')](_0x23c7f2)[_0xdf6c('0xb3')](function(_0xaa4933){return _0x402dc2(msgResponse(_0xdf6c('0x185'),_0xdf6c('0xd1'),_0x25e22b));})[_0xdf6c('0xad')](function(_0x4ee0b1){return _0x407ca4(msgResponse(_0xdf6c('0x199'),_0xdf6c('0x128'),_0xdf6c('0x19a')));});};Dialer[_0xdf6c('0x1e')][_0xdf6c('0xb')]=function(_0x24fb40){var _0x5e70ef=this;var _0x3c37e2=_0x24fb40[_0xdf6c('0x19b')]/0x64;var _0x2da580=_0x24fb40['outboundDropCallsDayTimeout']/(_0x24fb40[_0xdf6c('0x60')]+_0x24fb40[_0xdf6c('0x5c')]);var _0x4bcd13=Math[_0xdf6c('0x19c')](_0x24fb40[_0xdf6c('0x6e')]*(_0x24fb40['predictiveIntervalMaxThreshold']/0x64));var _0x54738d=Math[_0xdf6c('0x19c')](_0x24fb40[_0xdf6c('0x6e')]*(_0x24fb40['predictiveIntervalMinThreshold']/0x64));var _0x498d50=_0x24fb40['available']+_0x24fb40[_0xdf6c('0x53')];var _0x598bd5=Math['floor'](_0x24fb40[_0xdf6c('0x71')]*_0x24fb40[_0xdf6c('0x73')]*_0x24fb40[_0xdf6c('0x6c')]*_0x24fb40[_0xdf6c('0x6d')]);if(_['isUndefined'](_0x24fb40['startProgressive'])){if(!_[_0xdf6c('0x3a')](_0x24fb40['startPredictive'])){_0x24fb40[_0xdf6c('0x2b')]=undefined;loggerPredictive[_0xdf6c('0x95')](_0xdf6c('0x19d'),_0xdf6c('0x19e'));}if(!_[_0xdf6c('0x3a')](_0x24fb40[_0xdf6c('0x8f')])){loggerPredictive['error'](_0xdf6c('0x19d'),_0xdf6c('0x19f'));clearInterval(_0x24fb40[_0xdf6c('0x8f')]);_0x24fb40[_0xdf6c('0x8f')]=undefined;}_0x24fb40[_0xdf6c('0x2c')]=moment()[_0xdf6c('0x7a')](_0xdf6c('0xf9'));loggerPredictive[_0xdf6c('0x7d')](_0x24fb40[_0xdf6c('0x3d')],_0xdf6c('0x1a0'),_0x24fb40['startProgressive']);this['handlePower'](_0x24fb40,0x1);}else if(ifInterval(_0x24fb40['dialPredictiveInterval'],_0x24fb40[_0xdf6c('0x2c')])){this[_0xdf6c('0x13a')](_0x24fb40,0x1);loggerPredictiveCalls[_0xdf6c('0x7d')](_0xdf6c('0x1a1'),_0x24fb40[_0xdf6c('0x2c')],_0x24fb40[_0xdf6c('0x3d')]);_0x24fb40[_0xdf6c('0x71')]=0x0;_0x24fb40[_0xdf6c('0x1a2')]=0x0;}else if(_0x3c37e2<_0x2da580&&_0x24fb40['dialPredictiveOptimization']==='dropRate'){freeVariablesPredictive(_0x24fb40);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0xdf6c('0x1a3'),_0x2da580,_0xdf6c('0x2c'),_0x24fb40[_0xdf6c('0x3d')]);}else if(_0x598bd5<_0x24fb40['predictiveIntervalErlangCallsDroppedCalls']&&_0x24fb40[_0xdf6c('0x1a4')]===_0xdf6c('0x1a5')){freeVariablesPredictive(_0x24fb40);loggerPredictive[_0xdf6c('0x7d')](_0xdf6c('0x1a6'),_0xdf6c('0x1a7'),_0x598bd5,_0xdf6c('0x1a8'),_0x24fb40['predictiveIntervalErlangCallsDroppedCalls'],_0xdf6c('0x2c'),_0x24fb40[_0xdf6c('0x3d')]);}else if(!ifInterval(_0x24fb40['dialPredictiveInterval'],_0x24fb40['startProgressive'])&&_[_0xdf6c('0x3a')](_0x24fb40[_0xdf6c('0x2b')])&&!_[_0xdf6c('0x3a')](_0x24fb40[_0xdf6c('0x2c')])){_0x24fb40[_0xdf6c('0x2b')]=moment()[_0xdf6c('0x7a')](_0xdf6c('0xf9'));loggerPredictive[_0xdf6c('0x7d')](_0x24fb40[_0xdf6c('0x3d')],_0xdf6c('0x1a9'),_0x24fb40[_0xdf6c('0x2b')]);this[_0xdf6c('0x1aa')](_0x24fb40['dialPredictiveInterval'])[_0xdf6c('0xb3')](this[_0xdf6c('0x1ab')](_0x24fb40))['then'](mergeDataErlangB(_0x24fb40))[_0xdf6c('0xb3')](this['startMethodPredictive'](_0x24fb40))[_0xdf6c('0xad')](loggerCatchPredictive(_0xdf6c('0x1ac'),_0x24fb40));}else if(!ifInterval(_0x24fb40[_0xdf6c('0x1ad')],_0x24fb40[_0xdf6c('0x2b')])){_0x24fb40[_0xdf6c('0x1a2')]=0x0;_0x24fb40[_0xdf6c('0x2b')]=moment()[_0xdf6c('0x7a')](_0xdf6c('0xf9'));loggerPredictive[_0xdf6c('0x7d')](_0x24fb40['name'],_0xdf6c('0x1ae'),_0x24fb40[_0xdf6c('0x2b')]);clearInterval(_0x24fb40['handlePredictive']);_0x24fb40['handlePredictive']=undefined;this[_0xdf6c('0x1aa')](_0x24fb40['dialPredictiveInterval'])['then'](this[_0xdf6c('0x1ab')](_0x24fb40))[_0xdf6c('0xb3')](mergeDataErlangB(_0x24fb40))['then'](this['startMethodPredictive'](_0x24fb40))[_0xdf6c('0xad')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x24fb40));}else if(_0x24fb40['predictiveIntervalAvailable']&&_0x498d50<_0x24fb40[_0xdf6c('0x6e')]-_0x54738d){freeVariablesPredictive(_0x24fb40);loggerPredictive[_0xdf6c('0x7d')](_0x24fb40[_0xdf6c('0x3d')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x498d50,_0xdf6c('0x1af'),_0x24fb40['predictiveIntervalAvailable'],'-',_0x54738d,'=',_0x24fb40[_0xdf6c('0x6e')]-_0x54738d,')');}else if(_0x24fb40['predictiveIntervalAvailable']&&_0x498d50>_0x24fb40[_0xdf6c('0x6e')]+_0x4bcd13){freeVariablesPredictive(_0x24fb40);loggerPredictive[_0xdf6c('0x7d')](_0x24fb40[_0xdf6c('0x3d')],_0xdf6c('0x1b0'),_0x498d50,')\x20are\x20more\x20than\x20threshold\x20(',_0x24fb40['predictiveIntervalAvailable'],'+',_0x4bcd13,'=',_0x24fb40[_0xdf6c('0x6e')]+_0x4bcd13,')');}};Dialer[_0xdf6c('0x1e')][_0xdf6c('0x1ab')]=function(_0x1911b2){var _0x14abfb=this;return function(_0x2c6289){return new BPromise(function(_0x15fcbc,_0x11fe1f){_[_0xdf6c('0x8d')](_0x1911b2,_0x2c6289[0x0]);if(checkGetDataPredictive(_0x2c6289[0x0])){var _0x19bd6c=_0x1911b2[_0xdf6c('0x6e')]=_0x1911b2[_0xdf6c('0x53')]+_0x1911b2['available'];var _0x42cb6d=_0x1911b2['dialPredictiveInterval']*0x3c;var _0xc7cfe5=_0x2c6289[0x0]['predictiveIntervalAvgTalktime']+_0x2c6289[0x0][_0xdf6c('0x68')];var _0x4c16f0=(_0x2c6289[0x0][_0xdf6c('0x67')]+_0x2c6289[0x0][_0xdf6c('0x81')]+_0x2c6289[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x2c6289[0x0][_0xdf6c('0x6f')];_0x1911b2[_0xdf6c('0x6c')]=_0x4c16f0>0x0?_0x4c16f0:0x1;switch(_0x1911b2[_0xdf6c('0x1a4')]){case _0xdf6c('0x1a5'):var _0x1f8c1b=_0x1911b2[_0xdf6c('0x19b')]/0x64;return _0x14abfb[_0xdf6c('0x1b1')](_0x19bd6c,_0x42cb6d,_0xc7cfe5,_0x4c16f0,_0x1f8c1b)[_0xdf6c('0xb3')](function(_0x4f3c71){return _0x15fcbc(_0x4f3c71);});case _0xdf6c('0x1b2'):var _0x45ed4f=_0x1911b2['dialPredictiveOptimizationPercentage']/0x64;return _0x14abfb[_0xdf6c('0x1b3')](_0x19bd6c,_0x42cb6d,_0xc7cfe5,_0x4c16f0,_0x45ed4f)[_0xdf6c('0xb3')](function(_0x44adc8){return _0x15fcbc(_0x44adc8);});default:return _0x11fe1f(msgResponse(_0xdf6c('0x1b4'),_0xdf6c('0x128'),_0xdf6c('0x1b5')));}}else{return _0x11fe1f(msgResponse('[getDataPredictive]',_0xdf6c('0x128'),_0xdf6c('0x1b6')));}});};};Dialer['prototype'][_0xdf6c('0x1b7')]=function(_0x2cd21c){var _0x5c5c99=this;return function(_0x1cdc8d){return new BPromise(function(_0x419527,_0x3e87ef){_['merge'](_0x2cd21c,_0x1cdc8d[0x0]);if(checkGetDataPredictive(_0x1cdc8d[0x0])){loggerPredictive[_0xdf6c('0x7d')](JSON[_0xdf6c('0x47')](_0x1cdc8d[0x0]));if(_0x2cd21c[_0xdf6c('0x1a4')]==='dropRate'){return _0x5c5c99[_0xdf6c('0xbf')](_0x2cd21c['id'])[_0xdf6c('0xb3')](function(_0x4f2703){var _0x21aae2=_0x2cd21c[_0xdf6c('0x4f')]-_0x4f2703[0x0][_0xdf6c('0x1b8')];var _0x470149=_0x2cd21c[_0xdf6c('0x1ad')]*0x3c;var _0x84a9f5=_0x1cdc8d[0x0][_0xdf6c('0x69')]+_0x1cdc8d[0x0][_0xdf6c('0x68')];var _0x2c75d8=(_0x1cdc8d[0x0][_0xdf6c('0x67')]+_0x1cdc8d[0x0][_0xdf6c('0x81')]+_0x1cdc8d[0x0][_0xdf6c('0x6a')])/_0x1cdc8d[0x0]['predictiveIntervalTotalCalls'];var _0x122963=_0x2cd21c[_0xdf6c('0x19b')]/0x64;_0x2cd21c[_0xdf6c('0x1b9')]=_0x4f2703[0x0][_0xdf6c('0x1b8')]||0x0;_0x2cd21c[_0xdf6c('0x6c')]=_0x2c75d8>0x0?_0x2c75d8:0x1;return _0x5c5c99[_0xdf6c('0x1b1')](_0x21aae2,_0x470149,_0x84a9f5,_0x2c75d8,_0x122963);})[_0xdf6c('0xb3')](function(_0x1459c6){return _0x419527(_0x1459c6);})[_0xdf6c('0xad')](function(_0x259be9){return _0x3e87ef(msgResponse(_0xdf6c('0x1ba'),_0xdf6c('0x128'),JSON[_0xdf6c('0x47')](_0x259be9)));});}if(_0x2cd21c[_0xdf6c('0x1a4')]===_0xdf6c('0x1b2')){return _0x5c5c99[_0xdf6c('0xbf')](_0x2cd21c['id'])['then'](function(_0x7a7f04){var _0x2b8c42=_0x2cd21c[_0xdf6c('0x4f')]-_0x7a7f04[0x0][_0xdf6c('0x1b8')];var _0x3ac20b=_0x2cd21c['dialPredictiveInterval']*0x3c;var _0xf4159=_0x1cdc8d[0x0][_0xdf6c('0x69')]+_0x1cdc8d[0x0][_0xdf6c('0x68')];var _0x2e3a03=(_0x1cdc8d[0x0][_0xdf6c('0x67')]+_0x1cdc8d[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x1cdc8d[0x0][_0xdf6c('0x6a')])/_0x1cdc8d[0x0][_0xdf6c('0x6f')];var _0x5d14fe=_0x2cd21c[_0xdf6c('0x19b')]/0x64;_0x2cd21c[_0xdf6c('0x1b9')]=_0x7a7f04[0x0][_0xdf6c('0x1b8')]||0x0;_0x2cd21c[_0xdf6c('0x6c')]=_0x2e3a03>0x0?_0x2e3a03:0x1;return _0x5c5c99[_0xdf6c('0x1b3')](_0x2b8c42,_0x3ac20b,_0xf4159,_0x2e3a03,_0x5d14fe);})[_0xdf6c('0xb3')](function(_0x157d6a){return _0x419527(_0x157d6a);})[_0xdf6c('0xad')](function(_0x4781f5){return _0x3e87ef(msgResponse(_0xdf6c('0x1ba'),_0xdf6c('0x128'),JSON[_0xdf6c('0x47')](_0x4781f5)));});}}else{return _0x3e87ef(msgResponse(_0xdf6c('0x1b4'),_0xdf6c('0x128'),_0xdf6c('0x1b6')));}});};};Dialer['prototype']['startMethodPredictive']=function(_0x1ea47b){var _0x25d9bc=this;return function(){var _0x4f9e57=0x0;var _0x1301ba=Math['floor'](_0x1ea47b[_0xdf6c('0x72')]*0x3e8);if(_0x1301ba>0x0){_0x1301ba=_0x1301ba<0x64?0x64:_0x1301ba;loggerPredictive[_0xdf6c('0x7d')](_0x1ea47b['name'],_0xdf6c('0x1bb'),_0x1301ba,'milliseconds');_0x1ea47b[_0xdf6c('0x8f')]=setInterval(function(){_0x25d9bc[_0xdf6c('0x8f')](_0x1ea47b);loggerPredictiveCalls[_0xdf6c('0x7d')](_0xdf6c('0x1bc'),_0x4f9e57+=0x1);},_0x1301ba);}else{loggerPredictive[_0xdf6c('0x7d')](_0x1ea47b[_0xdf6c('0x3d')],_0xdf6c('0x1bd'));}};};Dialer[_0xdf6c('0x1e')]['checkContactBlack']=function(_0x3a2ac9,_0x26532a){var _0xcf84b8=this;return function(_0x2ee331){if(_['isEmpty'](_0x2ee331)){if(_[_0xdf6c('0xaa')](_0x26532a['UserId'])||!_0x26532a[_0xdf6c('0x1be')]){if(_0x3a2ac9[_0xdf6c('0x138')]===_0xdf6c('0xa')){_0x3a2ac9[_0xdf6c('0x10f')]=_[_0xdf6c('0x3a')](_0x3a2ac9[_0xdf6c('0x10f')])?!![]:_0x3a2ac9[_0xdf6c('0x10f')];var _0x3a96b3=uuid['v4']();_0xcf84b8[_0xdf6c('0x27')][_0x3a96b3]=new Action(_0x3a2ac9,_0x26532a,_0x3a96b3);loggerBooked[_0xdf6c('0x7d')](_0xdf6c('0x1bf'),_0x3a96b3,_0xdf6c('0x1c0'),JSON[_0xdf6c('0x47')](_0x3a2ac9[_0xdf6c('0x10f')]),_0xdf6c('0x1c1'),_0x3a2ac9[_0xdf6c('0x3d')]);if(_0x3a2ac9[_0xdf6c('0x10f')]){_0x3a2ac9[_0xdf6c('0x10f')]=![];_0xcf84b8[_0xdf6c('0x10a')][_0xcf84b8[_0xdf6c('0x27')][_0x3a96b3][_0xdf6c('0xb0')]]=[];ami[_0xdf6c('0xab')]({'actionid':_0x3a96b3,'action':_0xdf6c('0x1c2'),'queue':_0x3a2ac9[_0xdf6c('0x3d')]})['catch'](function(_0xc26f1e){_0xcf84b8[_0xdf6c('0xae')](_0x3a2ac9);_0xcf84b8[_0xdf6c('0x111')]({'active':![],'ContactId':_0xcf84b8['actions'][_0x3a96b3][_0xdf6c('0xca')],'ListId':_0xcf84b8[_0xdf6c('0x27')][_0x3a96b3][_0xdf6c('0xcb')],'VoiceQueueId':_0xcf84b8[_0xdf6c('0x27')][_0x3a96b3][_0xdf6c('0xcd')]||undefined,'CampaignId':_0xcf84b8[_0xdf6c('0x27')][_0x3a96b3]['CampaignId']||undefined})[_0xdf6c('0xad')](loggerCatch(_0xdf6c('0x1c3')));delete _0xcf84b8[_0xdf6c('0x27')][_0x3a96b3];});}else{loggerBooked[_0xdf6c('0x7d')]('[booked][checkContactBlack][else]',JSON[_0xdf6c('0x47')](_0x3a2ac9['queueStatusComplete']),_0xdf6c('0x1c1'),_0x3a2ac9[_0xdf6c('0x3d')]);_0xcf84b8[_0xdf6c('0xae')](_0x3a2ac9);_0xcf84b8[_0xdf6c('0x111')]({'active':![],'ContactId':_0xcf84b8['actions'][_0x3a96b3][_0xdf6c('0xca')],'ListId':_0xcf84b8[_0xdf6c('0x27')][_0x3a96b3][_0xdf6c('0xcb')],'VoiceQueueId':_0xcf84b8[_0xdf6c('0x27')][_0x3a96b3][_0xdf6c('0xcd')]||undefined,'CampaignId':_0xcf84b8['actions'][_0x3a96b3]['CampaignId']||undefined})[_0xdf6c('0xad')](loggerCatch(_0xdf6c('0x1c3')));delete _0xcf84b8[_0xdf6c('0x27')][_0x3a96b3];}}else{return _0xcf84b8['actionOriginate'](_0x3a2ac9,_0x26532a);}}else{if(getDiff(_0x26532a['scheduledat'])<_0x3a2ac9[_0xdf6c('0x1c4')]*0x3c){_0xcf84b8[_0xdf6c('0x22')][_0xdf6c('0x118')](_0x26532a['id'])[_0xdf6c('0x11a')](function(){_0xcf84b8[_0xdf6c('0xae')](_0x3a2ac9);});}else{_0x3a2ac9['outboundReCallsDay']+=0x1;_0xcf84b8[_0xdf6c('0xae')](_0x3a2ac9);if(_0x3a2ac9['dialRecallInQueue']){_0xcf84b8[_0xdf6c('0x111')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x26532a[_0xdf6c('0xca')],'ListId':_0x26532a[_0xdf6c('0xcb')],'VoiceQueueId':_0x26532a[_0xdf6c('0xcd')]||undefined,'CampaignId':_0x26532a[_0xdf6c('0xce')]||undefined})['catch'](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0xcf84b8['createHistory'](createObjHistory(_0x3a2ac9,_0x26532a,_0xdf6c('0x1c5'),0x17,_0xdf6c('0x1c6')))['catch'](loggerCatch(_0xdf6c('0x1c7')));}else{_0xcf84b8['saveInDb'](createObjHistory(_0x3a2ac9,_0x26532a,_0xdf6c('0x1c8'),0x16,_0xdf6c('0x1c9')),'[Originate][HistoryRecallClose][historyCatch]',_0xdf6c('0x1ca'));}}}}else{_0x3a2ac9['outboundBlacklistCallsDay']+=0x1;_0xcf84b8[_0xdf6c('0xc9')](createObjHistory(_0x3a2ac9,_0x26532a,_0xdf6c('0x1cb'),0xd,'Blacklist'),'[Originate][historyBlacklist]',_0xdf6c('0x1cc'));throw'inBlackList';}};};Dialer[_0xdf6c('0x1e')]['handleIvr']=function(_0x16d7ff){var _0xb6ab94=this;var _0x233b90=[];var _0xabfd7b=_0x16d7ff[_0xdf6c('0x1cd')]-_0x16d7ff[_0xdf6c('0x70')]-_0x16d7ff[_0xdf6c('0x1ce')];emitCampaignSummary(_0x16d7ff);if(_0xabfd7b>0x0){if(_0xabfd7b>this[_0xdf6c('0x25')]){_0xabfd7b=this['maxNumberOriginate'];}_0x16d7ff[_0xdf6c('0x1ce')]+=_0xabfd7b;this[_0xdf6c('0xbe')](_0x16d7ff['id'],_0xabfd7b,_0x16d7ff[_0xdf6c('0x1cf')])[_0xdf6c('0xb3')](function(_0x32e4f8){_0x16d7ff[_0xdf6c('0x1ce')]-=_0xabfd7b;_0x16d7ff[_0xdf6c('0x1ce')]=_0x16d7ff[_0xdf6c('0x1ce')]>0x0?_0x16d7ff[_0xdf6c('0x1ce')]:0x0;if(!checkContactEmpty(_0x32e4f8)){_0x16d7ff[_0xdf6c('0x3b')]=_0xdf6c('0x9c');logger[_0xdf6c('0x7d')](_0xdf6c('0x1d0')+_0x16d7ff['name']);}else{_0x16d7ff[_0xdf6c('0x70')]+=_0x32e4f8[_0xdf6c('0x113')];_0x16d7ff[_0xdf6c('0x3b')]=_0xdf6c('0x1d1');for(var _0x3da811=0x0;_0x3da811<_0x32e4f8[_0xdf6c('0x113')];_0x3da811+=0x1){_0x16d7ff[_0xdf6c('0x1d2')]+=0x1;if(_[_0xdf6c('0xaa')](_0x32e4f8[_0x3da811])||_[_0xdf6c('0xaa')](_0x32e4f8[_0x3da811][_0xdf6c('0x14d')])||_['isNil'](_0x32e4f8[_0x3da811][_0xdf6c('0x14d')]['phone'])){_0xb6ab94[_0xdf6c('0xc8')](_0xdf6c('0x1d3'),_0x16d7ff,_0x32e4f8[_0x3da811]);}else{_0xb6ab94[_0xdf6c('0xb7')](_[_0xdf6c('0x10c')](_0x32e4f8[_0x3da811],[_0xdf6c('0xce'),'Contact.phone']))[_0xdf6c('0xb3')](_0xb6ab94[_0xdf6c('0x1d4')](_0x16d7ff,_0x32e4f8[_0x3da811]))[_0xdf6c('0xad')](_0xb6ab94[_0xdf6c('0xc7')](_0xdf6c('0x1d5'),_0x16d7ff));}}}})['catch'](loggerGetContactDialer(_0xdf6c('0x1d6'),_0x16d7ff,_0xabfd7b));}};Dialer[_0xdf6c('0x1e')][_0xdf6c('0x13a')]=function(_0x1ae0fb,_0x5c73e9){var _0x209ff4=this;var _0x5e20e5=[];var _0x2e9da5=_0x5c73e9>=0x1?_0x5c73e9:0x1;var _0x3b03c1=[];if(_0x1ae0fb['dialMethod']==='booked'){_0x2e9da5=0x1;}var _0x383f16=Math[_0xdf6c('0x1d7')](_0x1ae0fb[_0xdf6c('0x4e')]*_0x2e9da5)-_0x1ae0fb[_0xdf6c('0x70')]-_0x1ae0fb[_0xdf6c('0x1ce')];emitVoiceQueueSummary(_0x1ae0fb);if(_0x1ae0fb[_0xdf6c('0x1d8')]>0x0){var _0x237b53=_0x1ae0fb[_0xdf6c('0x1d8')]-_0x1ae0fb[_0xdf6c('0x70')]-_0x1ae0fb[_0xdf6c('0x53')]-_0x1ae0fb[_0xdf6c('0x1ce')]-_0x1ae0fb[_0xdf6c('0x50')];if(_0x383f16>_0x237b53){_0x383f16=_0x237b53;}}if(_0x383f16>0x0){if(_0x1ae0fb[_0xdf6c('0x138')]===_0xdf6c('0xa')){_0x383f16=0x1;}if(_0x383f16>this[_0xdf6c('0x25')]){_0x383f16=this['maxNumberOriginate'];}_0x1ae0fb[_0xdf6c('0x1ce')]+=_0x383f16;for(var _0x440a3a in this[_0xdf6c('0x108')]){if(this[_0xdf6c('0x108')][_0xdf6c('0x97')](_0x440a3a)){if(this['agents'][_0x440a3a][_0xdf6c('0xa4')]===_0xdf6c('0x1d9')&&this[_0xdf6c('0x108')][_0x440a3a][_0xdf6c('0xd5')]===_0xdf6c('0xd6')){_0x5e20e5[_0xdf6c('0x10b')](this[_0xdf6c('0x108')][_0x440a3a]['id']);}}}this[_0xdf6c('0xbc')](_0x1ae0fb['id'],_0x5e20e5,_0x383f16,_0x1ae0fb[_0xdf6c('0x1cf')])[_0xdf6c('0xb3')](function(_0x2603f8){_0x1ae0fb[_0xdf6c('0x1ce')]-=_0x383f16;_0x1ae0fb[_0xdf6c('0x1ce')]=_0x1ae0fb['temp']>0x0?_0x1ae0fb[_0xdf6c('0x1ce')]:0x0;if(!checkContactEmpty(_0x2603f8)){_0x209ff4[_0xdf6c('0x1da')](_0x1ae0fb)[_0xdf6c('0xb3')](sendMessageReschedule(_0x1ae0fb))[_0xdf6c('0xad')](loggerCatch('[countReScheduled]\x20'));}else{_0x1ae0fb[_0xdf6c('0x70')]+=_0x2603f8[_0xdf6c('0x113')];_0x1ae0fb[_0xdf6c('0x3b')]=_0x1ae0fb[_0xdf6c('0x138')]===_0xdf6c('0xa')?_0xdf6c('0x1db'):'RUNNING';for(var _0x40765b=0x0;_0x40765b<_0x2603f8['length'];_0x40765b+=0x1){if(_[_0xdf6c('0xaa')](_0x2603f8[_0x40765b])||_[_0xdf6c('0xaa')](_0x2603f8[_0x40765b][_0xdf6c('0x14d')])||_['isNil'](_0x2603f8[_0x40765b][_0xdf6c('0x14d')][_0xdf6c('0x14e')])){_0x209ff4[_0xdf6c('0xc8')](_0xdf6c('0x1d3'),_0x1ae0fb,_0x2603f8[_0x40765b]);}else{_0x209ff4['checkIsBlackList'](_[_0xdf6c('0x10c')](_0x2603f8[_0x40765b],[_0xdf6c('0xcd'),'Contact.phone']))[_0xdf6c('0xb3')](_0x209ff4[_0xdf6c('0x1d4')](_0x1ae0fb,_0x2603f8[_0x40765b]))[_0xdf6c('0xad')](_0x209ff4[_0xdf6c('0xc7')]('[actionOriginate]\x20',_0x1ae0fb));}}}})[_0xdf6c('0xad')](loggerGetContactDialer('[getContactDialer2]',_0x1ae0fb,_0x383f16));}};Dialer['prototype'][_0xdf6c('0x8f')]=function(_0x5a8b87){var _0x1e0d34=this;if(_0x5a8b87[_0xdf6c('0x1d8')]>0x0){var _0x5afe0e=_0x5a8b87[_0xdf6c('0x1d8')]-_0x5a8b87[_0xdf6c('0x70')]-_0x5a8b87['talking'];if(_0x5afe0e>0x0){this['tryOriginatePredictive'](_0x5a8b87);}else{loggerPredictiveCalls['info'](_0xdf6c('0x1dc'));}}else{this[_0xdf6c('0x1dd')](_0x5a8b87);}};Dialer[_0xdf6c('0x1e')][_0xdf6c('0x1dd')]=function(_0x49bbb5){var _0x875b94=this;var _0x5a1798=[];_0x49bbb5['originated']+=0x1;for(var _0x22fb3a in this[_0xdf6c('0x108')]){if(this[_0xdf6c('0x108')]['hasOwnProperty'](_0x22fb3a)){if(this[_0xdf6c('0x108')][_0x22fb3a][_0xdf6c('0xa4')]===_0xdf6c('0x1d9')&&this['agents'][_0x22fb3a]['status']===_0xdf6c('0xd6')){_0x5a1798[_0xdf6c('0x10b')](this[_0xdf6c('0x108')][_0x22fb3a]['id']);}}}this[_0xdf6c('0xbc')](_0x49bbb5['id'],_0x5a1798,0x1,_0x49bbb5[_0xdf6c('0x1cf')])[_0xdf6c('0xb3')](function(_0x1b5b43){if(!checkContactEmpty(_0x1b5b43)){checkContactLowerLimitOriginate(_0x49bbb5,0x1,0x0);_0x875b94[_0xdf6c('0x1da')](_0x49bbb5)[_0xdf6c('0xb3')](sendMessageReschedule(_0x49bbb5))[_0xdf6c('0xad')](loggerCatch(_0xdf6c('0xb4')));}else{_0x49bbb5[_0xdf6c('0x3b')]=_0xdf6c('0x1d1');if(_['isNil'](_0x1b5b43[0x0])||_[_0xdf6c('0xaa')](_0x1b5b43[0x0][_0xdf6c('0x14d')])||_[_0xdf6c('0xaa')](_0x1b5b43[0x0][_0xdf6c('0x14d')][_0xdf6c('0x14e')])){_0x875b94[_0xdf6c('0xc8')](_0xdf6c('0x1d3'),_0x49bbb5,_0x1b5b43[0x0]);}else{_0x875b94[_0xdf6c('0xb5')](_['pick'](_0x1b5b43[0x0],[_0xdf6c('0xcd'),_0xdf6c('0x1de')]))['then'](_0x875b94['checkContactBlack'](_0x49bbb5,_0x1b5b43[0x0]))['catch'](_0x875b94['loggerHandler'](_0xdf6c('0x1df'),_0x49bbb5));}}})[_0xdf6c('0xad')](loggerGetContactDialer(_0xdf6c('0x1e0'),_0x49bbb5,0x1));emitVoiceQueueSummary(_0x49bbb5);};Dialer[_0xdf6c('0x1e')]['abandonmentRate']=function(_0x2ed822,_0x31277c,_0x1bd4da,_0x44fea6,_0x1ddb9a,_0x47470d){loggerPredictive['info'](_0xdf6c('0x1e1'));loggerPredictive['info'](_0xdf6c('0x1e2'),_0x2ed822);loggerPredictive[_0xdf6c('0x7d')](_0xdf6c('0x1e3'),_0x31277c);loggerPredictive[_0xdf6c('0x7d')](_0xdf6c('0x1e4'),_0x1bd4da);loggerPredictive[_0xdf6c('0x7d')](_0xdf6c('0x1e5'),_0x44fea6);loggerPredictive[_0xdf6c('0x7d')](_0xdf6c('0x1e6'),_0x1ddb9a);loggerPredictive[_0xdf6c('0x7d')]('---------------------------');return new BPromise(function(_0x3d3524,_0x537e65){if(_0x2ed822<=0x0||isNaN(_0x2ed822)){return _0x537e65(msgResponse(_0xdf6c('0x1e7'),_0xdf6c('0x46'),_0xdf6c('0x1e8')+_0x2ed822));}if(_0x1bd4da<=0x0||isNaN(_0x1bd4da)){return _0x537e65(msgResponse(_0xdf6c('0x1e7'),_0xdf6c('0x46'),_0xdf6c('0x1e9')+_0x1bd4da));}if(_0x44fea6<=0x0||isNaN(_0x44fea6)){return _0x537e65(msgResponse(_0xdf6c('0x1e7'),_0xdf6c('0x46'),_0xdf6c('0x1ea')+_0x44fea6));}if(_0x31277c<=0x0||isNaN(_0x31277c)){return _0x537e65(msgResponse('[abandonmentRate]',_0xdf6c('0x46'),_0xdf6c('0x1eb')+_0x31277c));}if(_0x1ddb9a<=0x0||isNaN(_0x1ddb9a)){return _0x537e65(msgResponse(_0xdf6c('0x1e7'),_0xdf6c('0x46'),'Amax\x20=\x20'+_0x1ddb9a));}_0x47470d=_0x47470d||0x0;var _0x4e6fb1=0x1/_0x1bd4da;var _0x4c9f3e=0x0;var _0x39c74f=0x0;var _0x352c7e=0x0;var _0x3eeaca=0x0;for(var _0x425c68=0x0;_0x352c7e<_0x1ddb9a;_0x425c68+=0x1){_0x39c74f=_0x425c68/_0x31277c;_0x4c9f3e=(_0x44fea6*_0x39c74f+_0x47470d)/_0x4e6fb1;_0x352c7e=erlangb(_0x4c9f3e,_0x2ed822);_0x3eeaca=_0x4c9f3e/_0x2ed822*(0x1-erlangb(_0x4c9f3e,_0x2ed822));}return _0x3d3524({'erlangCalls':_0x425c68,'erlangCallToSecond':_0x31277c/_0x425c68,'erlangAbandonmentRate':_0x352c7e,'erlangBusyFactor':_0x3eeaca});});};Dialer['prototype'][_0xdf6c('0x1b3')]=function(_0x1f8fdc,_0x5506cf,_0x3e888c,_0x2b77d4,_0x1d8321,_0x448d12){loggerPredictive[_0xdf6c('0x7d')](_0xdf6c('0x1ec'));loggerPredictive[_0xdf6c('0x7d')](_0xdf6c('0x1e2'),_0x1f8fdc);loggerPredictive['info']('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5506cf);loggerPredictive['info'](_0xdf6c('0x1e4'),_0x3e888c);loggerPredictive[_0xdf6c('0x7d')](_0xdf6c('0x1e5'),_0x2b77d4);loggerPredictive[_0xdf6c('0x7d')](_0xdf6c('0x1ed'),_0x1d8321);loggerPredictive['info'](_0xdf6c('0x1ee'));return new BPromise(function(_0x17182d,_0x920f13){if(_0x1f8fdc<=0x0||isNaN(_0x1f8fdc)){return _0x920f13(msgResponse(_0xdf6c('0x1ef'),_0xdf6c('0x46'),'m\x20=\x20'+_0x1f8fdc));}if(_0x3e888c<=0x0||isNaN(_0x3e888c)){return _0x920f13(msgResponse('[busyFactor]',_0xdf6c('0x46'),'Ts\x20=\x20'+_0x3e888c));}if(_0x2b77d4<=0x0||isNaN(_0x2b77d4)){return _0x920f13(msgResponse(_0xdf6c('0x1ef'),_0xdf6c('0x46'),_0xdf6c('0x1ea')+_0x2b77d4));}if(_0x5506cf<=0x0||isNaN(_0x5506cf)){return _0x920f13(msgResponse(_0xdf6c('0x1ef'),_0xdf6c('0x46'),'interval\x20=\x20'+_0x5506cf));}if(_0x1d8321<=0x0||isNaN(_0x1d8321)){return _0x920f13(msgResponse(_0xdf6c('0x1ef'),_0xdf6c('0x46'),_0xdf6c('0x1f0')+_0x1d8321));}_0x448d12=_0x448d12||0x0;var _0x419cc3=0x1/_0x3e888c;var _0x27cec6=0x0;var _0x4c4080=0x0;var _0x47f225=0x0;var _0x491ad5=0x0;for(var _0x300f1c=0x0;_0x491ad5<_0x1d8321;_0x300f1c+=0x1){_0x4c4080=_0x300f1c/_0x5506cf;_0x27cec6=(_0x2b77d4*_0x4c4080+_0x448d12)/_0x419cc3;_0x47f225=erlangb(_0x27cec6,_0x1f8fdc);_0x491ad5=_0x27cec6/_0x1f8fdc*(0x1-erlangb(_0x27cec6,_0x1f8fdc));}return _0x17182d({'erlangCalls':_0x300f1c,'erlangCallToSecond':_0x5506cf/_0x300f1c,'erlangAbandonmentRate':_0x47f225,'erlangBusyFactor':_0x491ad5});});};module[_0xdf6c('0x1f1')]=Dialer; \ No newline at end of file +var _0x4965=['starttime','clearZombieChannels','uniqueId','[uniqueid]','actions','[actions]','Action','No\x20such\x20channel','updateOriginated','[Dialer][checkChannel]','queue','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','[countReScheduled]\x20','checkIsBlackList','catch','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','saveInDb','pick','ListId','UserId','VoiceQueueId','[emptyContact][createHistory]','isSuccess','Success','SIP/%s','status','reachable','isNil','variable','exten','value','uniqueid','HangupInAMD','AMD','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','dialAMDActive','Machine','amd','[syncMachine]','HANGUP','membername','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','ivrAnswerCallsDay','[syncHangupIvr]','dialQueueProject','AGI','syncAgentComplete','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete][createHistory]','[syncAgentComplete]','syncAgentConnect','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','TIMEOUT','Abandoned','channel','syncQueueMember','actionid','locked','paused','agents','stateinterface','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','roundrobin','run','[Catch][Preview][syncQueueStatusComplete]','ContactId','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','[booked][RR][finaly]','contactAgent-idHopper:\x20','[booked][unlock]','CampaignId','[unlock2][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','isTrunkReachable','\x20trunk\x20is\x20not\x20reachable','ifTime','Failure','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','interval','content','indexOf','true','all','GLOBAL_INTERVAL_IS_OVERTIME','Timezone:\x20','checkDialMethod','progressive','power','handlePower','dialPowerLevel','Queue','method\x20not\x20recognized','launchHandleIvr','dialMethod','checkIfTime','dialTimezone','checkIfTimeIntervals','[syncQueueSummary]','[syncCampaigns]','pow','random','match','actionOriginate','object','voiceQueue\x20is\x20undefine','phone','Contact','originate','contact\x20is\x20undefine','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','tags','createdAt','%s%s','XMD-','toUpper','callerid','dialRandomLastDigitCallerIdNumber','TrunkBackup','originatecalleridname','originatecalleridnum','trim','dialCutDigit','substring','SIP/%s/%s%s','from-sip','OriginateError','[originate][error]','syncOriginateResponse','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countbusyretry','countnoanswerretry','dialGlobalMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','minutes','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','add','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','countcongestionretry','dialCongestionMaxRetry','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','stateGlobal','reason\x200\x20no\x20such\x20number....','createStateFinal','NoAnswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','countglobal','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','reason\x208\x20congestion','Global','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','predictiveIntervalMaxThreshold','round','predictiveIntervalMinThreshold','talking','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dialPredictiveOptimization','started\x20in\x20predictive\x20at','averageHandleTime','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalPauses','outboundQueuePauses','[CatchErlangB]','agentBusyFactor','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','handleIvr','limitCalls','temp','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','[getContactCampaign2][Empty]','ivrTotalCallsDays','emptyContact','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','RUNNING','[getContactDialer2]','tryOriginatePredictive','[actionOriginate]\x20','[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','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','exports','bluebird','moment','ioredis','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperBlack','./action','./final','./queueCallerAbandon','./hangup','XCALLY_IP_AGI','127.0.0.1','rrmemory','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','trunks','maxNumberOriginate','channels','optionPredictive','startPredictive','queueBooked','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','agentcomplete','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','AGENTS_NOT_LOGGED','\x20AGENTS\x20NOT\x20LOGGED','message','NOT_ACTIVE','\x20NOT\x20Active','INTERVAL_IS_NULL','name','Interval','Intervals','\x20INTERVAL_IS_NULL','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','type','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','Trunk','active','md5','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','---------------------------','isUndefined','predictiveIntervalAvgTalktime','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','merge','startProgressive','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','inspect','error','stack','length','hasOwnProperty','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','[getContactDialer2][ReScheduled]','contacts','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','IS_DISACTIVED','state','statedesc'];(function(_0x313fc8,_0x2cfa5d){var _0x4bb12f=function(_0xaca71a){while(--_0xaca71a){_0x313fc8['push'](_0x313fc8['shift']());}};_0x4bb12f(++_0x2cfa5d);}(_0x4965,0x140));var _0x5496=function(_0x39017c,_0x15f210){_0x39017c=_0x39017c-0x0;var _0x584624=_0x4965[_0x39017c];return _0x584624;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0x5496('0x0'));var uuid=require('uuid');var moment=require(_0x5496('0x1'));var rr=require('rr');var md5=require('md5');var Redis=require(_0x5496('0x2'));var config=require(_0x5496('0x3'));var logger=require(_0x5496('0x4'))(_0x5496('0x5'));var loggerBooked=require(_0x5496('0x4'))(_0x5496('0x6'));var loggerPredictive=require('../../../config/logger')(_0x5496('0x7'));var loggerPredictiveCalls=require(_0x5496('0x4'))(_0x5496('0x8'));var loggerSyncQueueSummary=require(_0x5496('0x4'))(_0x5496('0x9'));var ami=require(_0x5496('0xa'));config[_0x5496('0xb')]=_[_0x5496('0xc')](config['redis'],{'host':_0x5496('0xd'),'port':0x18eb});var io=require(_0x5496('0xe'))(new Redis(config[_0x5496('0xb')]));var cmHopper=require(_0x5496('0xf'));var cmHopperFinal=require(_0x5496('0x10'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x5496('0x11'));var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require(_0x5496('0x12'));var History=require('./history');var Final=require(_0x5496('0x13'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0x5496('0x14'));var Hangup=require(_0x5496('0x15'));var ipAgi=process['env'][_0x5496('0x16')]||_0x5496('0x17');var strategy={'rrmemory':_0x5496('0x18'),'roundrobin':'roundrobin'};var Sequence=function(){};Sequence[_0x5496('0x19')][_0x5496('0x1a')]=function(_0x570de3){this[_0x5496('0x1b')]=this[_0x5496('0x1b')]?this[_0x5496('0x1b')][_0x5496('0x1c')](_0x570de3):_0x570de3();};function Dialer(_0x406163,_0x4510c4){this[_0x5496('0x1d')]=new Sequence();this[_0x5496('0x1e')]=_0x4510c4;this[_0x5496('0x1f')]=_0x406163[_0x5496('0x1f')];this[_0x5496('0x20')]=_0x406163[_0x5496('0x20')];this['agents']=_0x406163['agents'];this[_0x5496('0x21')]=_0x406163['trunks'];this[_0x5496('0x22')]=config['maxNumberOriginate']||0x2;this[_0x5496('0x23')]={};this['actions']={};this['contactsId']={};this['uniqueId']={};this[_0x5496('0x24')]={};this[_0x5496('0x25')]={};this['startProgressive']={};this['ivrOriginated']={};this[_0x5496('0x26')]={};this['queueBookedRR']={};ami['on']('agentconnect',this['syncAgentConnect'][_0x5496('0x27')](this));ami['on'](_0x5496('0x28'),this[_0x5496('0x29')][_0x5496('0x27')](this));ami['on'](_0x5496('0x2a'),this['syncOriginateResponse'][_0x5496('0x27')](this));ami['on'](_0x5496('0x2b'),this['syncAgentComplete'][_0x5496('0x27')](this));ami['on']('custom:queuesummary',this[_0x5496('0x9')][_0x5496('0x27')](this));ami['on'](_0x5496('0x2c'),this[_0x5496('0x2d')][_0x5496('0x27')](this));ami['on'](_0x5496('0x2e'),this[_0x5496('0x2f')][_0x5496('0x27')](this));ami['on'](_0x5496('0x30'),this[_0x5496('0x31')]['bind'](this));ami['on'](_0x5496('0x32'),this['syncQueueMember']['bind'](this));ami['on'](_0x5496('0x33'),this[_0x5496('0x34')][_0x5496('0x27')](this));this[_0x5496('0x35')]();this[_0x5496('0x36')]();}function isNotNull(_0x872ea9){return _0x872ea9!==null&&!_['isUndefined'](_0x872ea9);}function checkIsLoggedIn(_0xf54143,_0x12907a){return function(){if(_0x12907a<=0x0){_0xf54143['message']=_0x5496('0x37');throw _0xf54143['name']+_0x5496('0x38');}};}function isActive(_0x248e14){return _0x248e14;}function checkIsActive(_0x17c9ae,_0x586769){return function(){if(!isActive(_0x586769)){_0x17c9ae[_0x5496('0x39')]=_0x5496('0x3a');throw _0x17c9ae['name']+_0x5496('0x3b');}};}function checkInterval(_0x48884a){return function(){if(!isNotNull(_0x48884a['Interval'])){_0x48884a[_0x5496('0x39')]=_0x5496('0x3c');throw _0x48884a[_0x5496('0x3d')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x48884a[_0x5496('0x3e')][_0x5496('0x3f')])){_0x48884a[_0x5496('0x39')]=_0x5496('0x3c');throw _0x48884a[_0x5496('0x3d')]+_0x5496('0x40');}if(!isNotNull(_[_0x5496('0x41')](_0x48884a[_0x5496('0x3e')]['Intervals']))){_0x48884a[_0x5496('0x39')]='INTERVAL_IS_NULL';throw _0x48884a['name']+_0x5496('0x40');}};}function msgResponse(_0x2da0e1,_0x573b1b,_0x876bb7){return{'action':_0x2da0e1,'response':_0x573b1b,'message':_0x876bb7,'stack':_0x876bb7};}function myreject(_0x783229){return function(_0x2f9bf6){return _0x783229(msgResponse(_0x5496('0x42'),_0x5496('0x43'),JSON[_0x5496('0x44')](_0x2f9bf6)));};}function getSeconds(_0x585763,_0x223a34){var _0x2767fd=moment(_0x585763)[_0x5496('0x45')](0x0);var _0x5d869b=moment(_0x223a34)[_0x5496('0x45')](0x0);return _0x2767fd[_0x5496('0x46')](_0x5d869b,_0x5496('0x47'));}function emit(_0x324432,_0x462440,_0x1f14ca){io['to'](_0x324432)[_0x5496('0x48')](_0x462440,_0x1f14ca);}function emitVoiceQueueSummary(_0x3d0d24){if(_0x3d0d24[_0x5496('0x49')]===_0x5496('0x4a')){var _0x573c1c={'id':_0x3d0d24['id'],'name':_0x3d0d24['name'],'strategy':_0x3d0d24[_0x5496('0x4b')],'answered':_0x3d0d24[_0x5496('0x4c')],'available':_0x3d0d24[_0x5496('0x4d')],'loggedIn':_0x3d0d24[_0x5496('0x4e')],'pTalking':_0x3d0d24[_0x5496('0x4f')],'sumBillable':_0x3d0d24[_0x5496('0x50')],'sumDuration':_0x3d0d24[_0x5496('0x51')],'sumHoldTime':_0x3d0d24[_0x5496('0x52')]||0x0,'talking':_0x3d0d24['talking'],'total':_0x3d0d24['total'],'type':_0x3d0d24['type'],'unmanaged':_0x3d0d24[_0x5496('0x53')],'abandoned':_0x3d0d24[_0x5496('0x54')],'waiting':_0x3d0d24[_0x5496('0x55')],'loggedInDb':_0x3d0d24[_0x5496('0x56')],'dialActive':_0x3d0d24[_0x5496('0x57')],'dialMethod':_0x3d0d24['dialMethod'],'dialOriginateCallerIdName':_0x3d0d24[_0x5496('0x58')],'dialOriginateCallerIdNumber':_0x3d0d24[_0x5496('0x59')],'dialOriginateTimeout':_0x3d0d24[_0x5496('0x5a')],'dialPrefix':_0x3d0d24[_0x5496('0x5b')],'outboundAnswerAgiCallsDay':_0x3d0d24[_0x5496('0x5c')],'outboundAnswerCallsDay':_0x3d0d24[_0x5496('0x5d')],'outboundBlacklistCallsDay':_0x3d0d24[_0x5496('0x5e')],'outboundBusyCallsDay':_0x3d0d24[_0x5496('0x5f')],'outboundCongestionCallsDay':_0x3d0d24[_0x5496('0x60')],'outboundDropCallsDayACS':_0x3d0d24[_0x5496('0x61')],'outboundDropCallsDayCallersExit':_0x3d0d24[_0x5496('0x62')],'outboundDropCallsDayTimeout':_0x3d0d24['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x3d0d24[_0x5496('0x63')],'outboundNoSuchCallsDay':_0x3d0d24[_0x5496('0x64')],'outboundOriginateFailureCallsDay':_0x3d0d24[_0x5496('0x65')],'outboundReCallsDay':_0x3d0d24[_0x5496('0x66')],'outboundRejectCallsDay':_0x3d0d24[_0x5496('0x67')],'outboundUnknownCallsDay':_0x3d0d24[_0x5496('0x68')],'predictiveIntervalAnsweredCalls':_0x3d0d24[_0x5496('0x69')],'predictiveIntervalAvgHoldtime':_0x3d0d24[_0x5496('0x6a')],'predictiveIntervalAvgTalktime':_0x3d0d24['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x3d0d24['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x3d0d24[_0x5496('0x6b')],'predictiveIntervalErlangCalls':_0x3d0d24[_0x5496('0x6c')],'predictiveIntervalErlangCallsDroppedCalls':_0x3d0d24[_0x5496('0x6d')],'predictiveIntervalHitRate':_0x3d0d24[_0x5496('0x6e')],'predictiveIntervalMultiplicativeFactor':_0x3d0d24[_0x5496('0x6f')],'predictiveIntervalPauses':_0x3d0d24['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x3d0d24[_0x5496('0x70')],'predictiveIntervalTotalCalls':_0x3d0d24[_0x5496('0x71')],'message':_0x3d0d24[_0x5496('0x39')],'originated':_0x3d0d24[_0x5496('0x72')],'erlangCalls':_0x3d0d24[_0x5496('0x73')],'erlangCallToSecond':_0x3d0d24[_0x5496('0x74')],'erlangAbandonmentRate':_0x3d0d24['erlangAbandonmentRate'],'erlangBusyFactor':_0x3d0d24[_0x5496('0x75')],'startPredictive':_0x3d0d24[_0x5496('0x25')],'startProgressive':_0x3d0d24['startProgressive']};if(_0x3d0d24[_0x5496('0x76')]){_0x573c1c[_0x5496('0x76')]={'id':_0x3d0d24[_0x5496('0x76')]['id'],'name':_0x3d0d24[_0x5496('0x76')][_0x5496('0x3d')],'active':_0x3d0d24[_0x5496('0x76')][_0x5496('0x77')],'callerid':_0x3d0d24['Trunk']['callerid']};}if(_0x3d0d24['Interval']){_0x573c1c[_0x5496('0x3e')]={'id':_0x3d0d24[_0x5496('0x3e')]['id'],'name':_0x3d0d24[_0x5496('0x3e')]['name']};}var _0x5b64be=md5(JSON[_0x5496('0x44')](_0x573c1c));if(_0x3d0d24[_0x5496('0x78')]!==_0x5b64be){_0x3d0d24[_0x5496('0x78')]=_0x5b64be;emit(util[_0x5496('0x79')](_0x5496('0x7a'),_0x573c1c['name']),_0x5496('0x7b'),_0x573c1c);}}}function emitCampaignSummary(_0x2cd1bd){if(_0x2cd1bd[_0x5496('0x49')]===_0x5496('0x7c')){emit(util[_0x5496('0x79')](_0x5496('0x7d'),_0x2cd1bd[_0x5496('0x3d')]),_0x5496('0x7e'),_0x2cd1bd);}}function checkGetDataPredictive(_0x18d52c){if(isNotNull(_0x18d52c)){if(!_[_0x5496('0x41')](_0x18d52c)){loggerPredictive[_0x5496('0x7f')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x5496('0x7f')](_0x5496('0x80'),_0x18d52c['predictiveIntervalTotalCalls']);loggerPredictive[_0x5496('0x7f')](_0x5496('0x81'),_0x18d52c[_0x5496('0x69')]);loggerPredictive[_0x5496('0x7f')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x18d52c[_0x5496('0x6b')]);loggerPredictive['info'](_0x5496('0x82'),_0x18d52c['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive['info'](_0x5496('0x83'),_0x18d52c['predictiveIntervalAvgHoldtime']);loggerPredictive['info'](_0x5496('0x84'),_0x18d52c['predictiveIntervalAvgTalktime']);loggerPredictive[_0x5496('0x7f')](_0x5496('0x85'));if(_0x18d52c['predictiveIntervalTotalCalls']>0x0){if(!_[_0x5496('0x86')](_0x18d52c[_0x5496('0x87')])&&_0x18d52c['predictiveIntervalAvgTalktime']>0x0){return!![];}else{loggerPredictive['info'](_0x5496('0x88'));}if(!_[_0x5496('0x86')](_0x18d52c[_0x5496('0x6a')])&&_0x18d52c[_0x5496('0x6a')]>0x0){return!![];}else{loggerPredictive[_0x5496('0x7f')](_0x5496('0x89'));}}else{loggerPredictive[_0x5496('0x7f')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x5496('0x7f')](_0x5496('0x8a'));}}else{loggerPredictive[_0x5496('0x7f')](_0x5496('0x8a'));}return![];}function mergeDataErlangB(_0x5b1781){return function(_0x5089ea){loggerPredictive[_0x5496('0x7f')]('---------\x20ErlangB\x20---------');loggerPredictive[_0x5496('0x7f')](_0x5496('0x8b'),_0x5089ea['erlangCalls']);loggerPredictive[_0x5496('0x7f')](_0x5496('0x8c'),_0x5089ea['erlangCallToSecond']);loggerPredictive[_0x5496('0x7f')](_0x5496('0x8d'),_0x5089ea[_0x5496('0x8e')]);loggerPredictive[_0x5496('0x7f')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5089ea[_0x5496('0x75')]);loggerPredictive[_0x5496('0x7f')](_0x5496('0x8d'),_0x5089ea[_0x5496('0x8e')]);loggerPredictive[_0x5496('0x7f')](_0x5496('0x85'));_[_0x5496('0x8f')](_0x5b1781,_0x5089ea);};}function getDiff(_0x4dfafd){var _0x1b2de5=moment()[_0x5496('0x45')](0x0);var _0x517536=moment(_0x4dfafd)['milliseconds'](0x0);return _0x1b2de5['diff'](_0x517536,'seconds');}function ifInterval(_0x4c5a9f,_0x45a05c){if(_['isUndefined'](_0x45a05c)){return![];}if(getDiff(_0x45a05c)<_0x4c5a9f*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x2c7216){if(isNotNull(_0x2c7216)){if(!_['isUndefined'](_0x2c7216['startProgressive'])){_0x2c7216[_0x5496('0x90')]=undefined;loggerPredictive[_0x5496('0x7f')](_0x2c7216['name'],_0x5496('0x91'));}if(!_['isUndefined'](_0x2c7216[_0x5496('0x25')])){_0x2c7216[_0x5496('0x25')]=undefined;loggerPredictive[_0x5496('0x7f')](_0x2c7216[_0x5496('0x3d')],_0x5496('0x92'));}if(!_[_0x5496('0x86')](_0x2c7216[_0x5496('0x93')])){clearInterval(_0x2c7216['handlePredictive']);_0x2c7216[_0x5496('0x93')]=undefined;loggerPredictive[_0x5496('0x7f')](_0x2c7216[_0x5496('0x3d')],_0x5496('0x94'));}}}function erlangb(_0x46fcb8,_0xf4d93f){if(_0xf4d93f===0x0){return 0x0;}var _0x1abdfd=0x1;for(var _0x54f79f=0x1;_0x54f79f<=_0xf4d93f;_0x54f79f+=0x1){_0x1abdfd=0x1+_0x1abdfd*_0x54f79f/_0x46fcb8;}return 0x1/_0x1abdfd;}function isVoiceQueueOutbound(_0x1fb84b){return _0x1fb84b===_0x5496('0x4a');}function isNotPreview(_0x3b8e6f){return _0x3b8e6f!==_0x5496('0x1e');}function isCampaignIvr(_0x3a3562){return _0x3a3562===_0x5496('0x7c');}function getCallerId(_0x293a35,_0x5dd280,_0x3815e5){if(!_[_0x5496('0x86')](_0x3815e5)&&'string'===typeof _0x3815e5&&!_[_0x5496('0x41')](_0x3815e5)){if(!_[_0x5496('0x86')](_0x5dd280)&&_0x5496('0x95')===typeof _0x5dd280&&!_[_0x5496('0x41')](_0x5dd280)){return util[_0x5496('0x79')](_0x5496('0x96'),_0x5dd280,_0x3815e5);}return util[_0x5496('0x79')](_0x5496('0x96'),_0x3815e5,_0x3815e5);}if(!_[_0x5496('0x86')](_0x293a35)&&'string'===typeof _0x293a35&&!_[_0x5496('0x41')](_0x293a35)){return _0x293a35;}return _0x5496('0x97');}function loggerCatchQueueSummary(_0x28c61b,_0xb24347){return function(_0x31f814){freeVariablesPredictive(_0xb24347);emitVoiceQueueSummary(_0xb24347);emitCampaignSummary(_0xb24347);loggerSyncQueueSummary['error'](_0x28c61b,util[_0x5496('0x98')](_0x31f814,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x14c1ab,_0x1894c5){return function(_0x338a84){loggerPredictive[_0x5496('0x99')](_0x1894c5[_0x5496('0x3d')],_0x14c1ab);loggerPredictive['error'](_0x338a84[_0x5496('0x9a')]);freeVariablesPredictive(_0x1894c5);};}function loggerCatch(_0x1fd1c0){return function(_0x1ed9b0){logger[_0x5496('0x99')](_0x1fd1c0,util[_0x5496('0x98')](_0x1ed9b0,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x4e9be7){return _0x4e9be7&&!_[_0x5496('0x86')](_0x4e9be7)&&_0x4e9be7[_0x5496('0x9b')]>0x0;}function decremetOriginate(_0x30f94a){if(!_[_0x5496('0x86')](_0x30f94a)&&_0x30f94a!==null){if(_0x30f94a[_0x5496('0x9c')](_0x5496('0x72'))){if(_0x30f94a[_0x5496('0x72')]>0x0){_0x30f94a[_0x5496('0x72')]-=0x1;}else{logger['error'](_0x5496('0x9d'));}}}else{logger['error'](_0x5496('0x9e'));}}function checkContactLowerLimitOriginate(_0x4b497e,_0x39e8e9,_0x3feeec){if(_0x39e8e9>_0x3feeec){for(var _0x472606=0x0;_0x472606<_0x39e8e9-_0x3feeec;_0x472606+=0x1){decremetOriginate(_0x4b497e);}}}function loggerGetContactDialer(_0x1dc5cc,_0x35964b,_0x1d2499){return function(_0x2cd695){checkContactLowerLimitOriginate(_0x35964b,_0x1d2499,0x0);logger[_0x5496('0x99')](_0x1dc5cc,util[_0x5496('0x98')](_0x2cd695,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x159be8){return function(_0x4e2045){if(isNotNull(_0x4e2045)&&isNotNull(_0x4e2045[0x0])){if(_0x4e2045[0x0][_0x5496('0x9f')]>0x0){_0x159be8[_0x5496('0x39')]='RESCHEDULED_CONTACTS';logger[_0x5496('0x7f')](_0x5496('0xa0')+_0x159be8['name'],_0x4e2045[0x0][_0x5496('0x9f')],_0x5496('0xa1'));}else{_0x159be8[_0x5496('0x39')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x5496('0x7f')]('[getContactDialer2][Empty]'+_0x159be8['name']);}}};}function notSendMessagesQueue(_0x55af49){if(_0x55af49[_0x5496('0xa2')]){freeVariablesPredictive(_0x55af49);if(_0x55af49[_0x5496('0x72')]===0x0&&_0x55af49['talking']===0x0&&_0x55af49[_0x5496('0x55')]===0x0&&(_0x55af49[_0x5496('0x4f')]||0x0)===0x0){_0x55af49['sendMessageOneNotActive']=![];_0x55af49[_0x5496('0x4d')]=0x0;_0x55af49[_0x5496('0x39')]=_0x5496('0x3a');loggerSyncQueueSummary[_0x5496('0x99')](_0x5496('0xa3'),_0x55af49[_0x5496('0x3d')],_0x5496('0xa4'));}else{_0x55af49['message']='IS_DISACTIVED';loggerSyncQueueSummary[_0x5496('0x99')](_0x5496('0xa3'),_0x55af49[_0x5496('0x3d')],_0x5496('0xa5'));}emitVoiceQueueSummary(_0x55af49);}}function notSendMessagesCampaign(_0x11ca3f){if(_0x11ca3f['sendMessageOneNotActive']){if(_0x11ca3f['originated']===0x0){_0x11ca3f[_0x5496('0xa2')]=![];_0x11ca3f[_0x5496('0x39')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x5496('0x99')](_0x5496('0xa6'),_0x11ca3f[_0x5496('0x3d')],'is\x20not\x20active');}else{_0x11ca3f['message']=_0x5496('0xa7');loggerSyncQueueSummary['error'](_0x5496('0xa6'),_0x11ca3f[_0x5496('0x3d')],_0x5496('0xa5'));}emitCampaignSummary(_0x11ca3f);}}function createObjHistory(_0x3eefee,_0x3bf4ea,_0x575703,_0x3784af,_0x286e0d){_0x3eefee['message']=_0x575703;var _0x301c9b=new Action(_0x3eefee,_0x3bf4ea);var _0x7ed718=new History(_0x301c9b);_0x7ed718[_0x5496('0xa8')]=_0x3784af;_0x7ed718[_0x5496('0xa9')]=_0x286e0d;_0x7ed718['endtime']=_0x301c9b[_0x5496('0xaa')];return _0x7ed718;}Dialer[_0x5496('0x19')][_0x5496('0x36')]=function(){var _0x66ff5b=this;setInterval(function(){_0x66ff5b[_0x5496('0xab')](_0x66ff5b[_0x5496('0xac')],_0x5496('0xad'));_0x66ff5b[_0x5496('0xab')](_0x66ff5b[_0x5496('0xae')],_0x5496('0xaf'));},0x32c8);};Dialer[_0x5496('0x19')]['clearZombieChannels']=function(_0x49a71c,_0x1a9533){var _0xaff295=this;for(var _0x15ab9d in _0x49a71c){if(_0x49a71c[_0x5496('0x9c')](_0x15ab9d)){this[_0x5496('0x1d')][_0x5496('0x1a')](function(){if(!_['isNil'](_0x49a71c[_0x15ab9d])){return ami[_0x5496('0xb0')]({'action':'status','channel':_0x49a71c[_0x15ab9d]['channel']})['catch'](function(_0x5ecda6){if(_0x5ecda6[_0x5496('0x39')]===_0x5496('0xb1')){setTimeout(function(){if(_0x49a71c[_0x15ab9d]&&_0x49a71c[_0x15ab9d]['type']!==_0x5496('0x7c')){_0xaff295[_0x5496('0xb2')](_0xaff295[_0x5496('0x1f')][_0x49a71c[_0x15ab9d]['queue']]);logger['error'](_0x5496('0xb3'),_0x1a9533,_0x15ab9d,_0x49a71c[_0x15ab9d][_0x5496('0xb4')]);delete _0x49a71c[_0x15ab9d];}if(_0x49a71c[_0x15ab9d]&&_0x49a71c[_0x15ab9d][_0x5496('0x49')]===_0x5496('0x7c')){_0xaff295[_0x5496('0xb2')](_0xaff295[_0x5496('0x20')][_0x49a71c[_0x15ab9d][_0x5496('0xb4')]]);logger[_0x5496('0x99')](_0x5496('0xb5'),_0x1a9533,_0x15ab9d,_0x49a71c[_0x15ab9d]['queue']);delete _0x49a71c[_0x15ab9d];}},0x2328);}});}});}}};Dialer[_0x5496('0x19')][_0x5496('0xb6')]=function(_0x215f2a){return BPromise[_0x5496('0xb7')]()[_0x5496('0xb8')](cmHopper[_0x5496('0xb6')](_0x215f2a))['catch'](loggerCatch(_0x5496('0xb9')));};Dialer[_0x5496('0x19')][_0x5496('0xba')]=function(_0x21ad49){return BPromise[_0x5496('0xb7')]()[_0x5496('0xb8')](cmHopperBlack[_0x5496('0xba')](_0x21ad49))[_0x5496('0xbb')](loggerCatch(_0x5496('0xbc')));};Dialer['prototype']['checkIsBlackListIvr']=function(_0x5154cf){return BPromise[_0x5496('0xb7')]()[_0x5496('0xb8')](cmHopperBlack[_0x5496('0xbd')](_0x5154cf))[_0x5496('0xbb')](loggerCatch(_0x5496('0xbe')));};Dialer[_0x5496('0x19')]['averageHandleTime']=function(_0x2a6c66){return BPromise[_0x5496('0xb7')]()[_0x5496('0xb8')](cmHopperHistory[_0x5496('0xbf')](_0x2a6c66))[_0x5496('0xbb')](loggerCatch(_0x5496('0xc0')));};Dialer[_0x5496('0x19')][_0x5496('0xc1')]=function(_0x472eac){return BPromise[_0x5496('0xb7')]()[_0x5496('0xb8')](cmHopper[_0x5496('0xc1')](_0x472eac))['catch'](loggerCatch(_0x5496('0xc2')));};Dialer[_0x5496('0x19')]['getContactDialer']=function(_0x2e79ce,_0xa587e7,_0x5a9db0,_0x4a148b){return BPromise[_0x5496('0xb7')]()[_0x5496('0xb8')](cmHopper[_0x5496('0xc3')](_0x2e79ce,_0xa587e7,_0x5a9db0,_0x4a148b))[_0x5496('0xbb')](loggerCatch(_0x5496('0xc4')));};Dialer[_0x5496('0x19')][_0x5496('0xc5')]=function(_0x482bba,_0x48d772,_0x5ea3f2){return BPromise[_0x5496('0xb7')]()[_0x5496('0xb8')](cmHopper['getContactDialerIvr'](_0x482bba,_0x48d772,_0x5ea3f2))['catch'](loggerCatch(_0x5496('0xc4')));};Dialer[_0x5496('0x19')][_0x5496('0xc6')]=function(_0x113671){return BPromise[_0x5496('0xb7')]()[_0x5496('0xb8')](voiceQueueRt[_0x5496('0xc6')](_0x113671))['catch'](loggerCatch(_0x5496('0xc7')));};Dialer[_0x5496('0x19')]['moveContactManagedDialer']=function(_0x1e9afa){return BPromise[_0x5496('0xb7')]()['then'](cmHopper[_0x5496('0xc8')](_0x1e9afa))[_0x5496('0xbb')](loggerCatch(_0x5496('0xc9')));};Dialer[_0x5496('0x19')]['createHistory']=function(_0x17b410){return BPromise[_0x5496('0xb7')]()[_0x5496('0xb8')](cmHopperHistory[_0x5496('0xca')](_0x17b410))[_0x5496('0xbb')](loggerCatch('[createHistory]\x20'));};Dialer[_0x5496('0x19')][_0x5496('0xb2')]=function(_0x1b5f0e){if(!_[_0x5496('0x86')](_0x1b5f0e)&&_0x1b5f0e!==null){if(_0x1b5f0e[_0x5496('0x9c')](_0x5496('0x72'))){if(_0x1b5f0e[_0x5496('0x72')]>0x0){_0x1b5f0e[_0x5496('0x72')]-=0x1;}else{logger[_0x5496('0x99')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger['error'](_0x5496('0xcb'));}};Dialer['prototype'][_0x5496('0xcc')]=function(_0x5336aa,_0x568dfb){var _0xe8d2b8=this;return function(_0x166f7d){_0xe8d2b8[_0x5496('0xb2')](_0x568dfb);logger['error'](_0x5336aa,util[_0x5496('0x98')](_0x166f7d,{'showHidden':![],'depth':null}));};};Dialer[_0x5496('0x19')]['emptyContact']=function(_0x22e3d5,_0x246590,_0x47c6c1){var _0xb3e39={'state':0x19,'statedesc':'notFound'};this[_0x5496('0xb2')](_0x246590);this[_0x5496('0xcd')](_[_0x5496('0x8f')](_0xb3e39,_[_0x5496('0xce')](_0x47c6c1,['ContactId',_0x5496('0xcf'),_0x5496('0xd0'),_0x5496('0xd1'),'CampaignId'])),_0x5496('0xd2'),'[emptyContact]');logger[_0x5496('0x99')](_0x22e3d5);};Dialer[_0x5496('0x19')][_0x5496('0xd3')]=function(_0x3158ab){return _0x3158ab===_0x5496('0xd4');};Dialer[_0x5496('0x19')]['isTrunkReachable']=function(_0x279025){return!_[_0x5496('0x86')](_0x279025)&&_0x279025&&!_[_0x5496('0x86')](_0x279025[_0x5496('0x3d')])&&!_[_0x5496('0x86')](_0x279025[_0x5496('0x77')])&&_0x279025['active']&&(this['trunks'][util['format'](_0x5496('0xd5'),_0x279025['name'])][_0x5496('0xd6')]===_0x5496('0xd7')||this['trunks'][util[_0x5496('0x79')](_0x5496('0xd5'),_0x279025[_0x5496('0x3d')])]['status']==='unmonitored');};Dialer[_0x5496('0x19')][_0x5496('0xcd')]=function(_0x498d32,_0x40bc8d,_0x3bbf6a){this['createHistory'](_0x498d32)['catch'](loggerCatch(_0x40bc8d));this[_0x5496('0xc8')](_0x498d32)[_0x5496('0xbb')](loggerCatch(_0x3bbf6a));};Dialer['prototype']['syncVarSet']=function(_0x556734){var _0x488758=this[_0x5496('0xac')][_0x556734['uniqueid']];var _0x4b6adb;if(!_[_0x5496('0xd8')](_0x556734)&&!_[_0x5496('0xd8')](_0x556734['variable'])&&!_[_0x5496('0xd8')](_0x556734[_0x5496('0xd9')]['amdstatus'])&&_0x556734[_0x5496('0xda')]==='xcally-motion-dialer'&&_0x488758){if(_0x488758[_0x5496('0x49')]!==_0x5496('0x7c')&&this[_0x5496('0x1f')][_0x488758['queue']]['dialAMDActive']&&_0x556734[_0x5496('0xdb')]==='HANGUP'){delete this[_0x5496('0xac')][_0x556734[_0x5496('0xdc')]];this[_0x5496('0xb2')](this[_0x5496('0x1f')][_0x488758[_0x5496('0xb4')]]);this[_0x5496('0x1f')][_0x488758[_0x5496('0xb4')]][_0x5496('0x5d')]+=0x1;this[_0x5496('0x1f')][_0x488758[_0x5496('0xb4')]]['outboundAnswerAgiCallsDay']+=0x1;_0x4b6adb=new Hangup(_0x488758,_0x556734);_0x4b6adb[_0x5496('0xa8')]=0x12;_0x4b6adb[_0x5496('0xa9')]=_0x5496('0xdd');_0x4b6adb['membername']=_0x5496('0xde');this[_0x5496('0xcd')](_0x4b6adb,_0x5496('0xdf'),_0x5496('0xe0'));}if(_0x488758[_0x5496('0x49')]!==_0x5496('0x7c')&&this[_0x5496('0x1f')][_0x488758[_0x5496('0xb4')]][_0x5496('0xe1')]&&_0x556734[_0x5496('0xdb')]==='MACHINE'){delete this['uniqueId'][_0x556734['uniqueid']];this[_0x5496('0xb2')](this[_0x5496('0x1f')][_0x488758[_0x5496('0xb4')]]);this[_0x5496('0x1f')][_0x488758[_0x5496('0xb4')]]['outboundAnswerCallsDay']+=0x1;this[_0x5496('0x1f')][_0x488758['queue']][_0x5496('0x5c')]+=0x1;_0x4b6adb=new Hangup(_0x488758,_0x556734);_0x4b6adb[_0x5496('0xa8')]=0x13;_0x4b6adb[_0x5496('0xa9')]=_0x5496('0xe2');_0x4b6adb['membername']='AMD';_0x4b6adb[_0x5496('0xe3')]=!![];this['saveInDb'](_0x4b6adb,'[syncMachine][createHistory]',_0x5496('0xe4'));}if(_0x488758[_0x5496('0x49')]===_0x5496('0x7c')&&this[_0x5496('0x20')][_0x488758['queue']][_0x5496('0xe1')]&&_0x556734['value']===_0x5496('0xe5')){delete this[_0x5496('0xac')][_0x556734[_0x5496('0xdc')]];this[_0x5496('0xb2')](this[_0x5496('0x20')][_0x488758[_0x5496('0xb4')]]);_0x4b6adb=new Hangup(_0x488758,_0x556734);_0x4b6adb[_0x5496('0xa8')]=0x12;_0x4b6adb['statedesc']=_0x5496('0xdd');_0x4b6adb[_0x5496('0xe6')]='AMD';this[_0x5496('0xcd')](_0x4b6adb,_0x5496('0xe7'),_0x5496('0xe8'));}if(_0x488758[_0x5496('0x49')]==='ivr'&&this[_0x5496('0x20')][_0x488758['queue']][_0x5496('0xe1')]&&_0x556734[_0x5496('0xdb')]===_0x5496('0xe9')){delete this['uniqueId'][_0x556734['uniqueid']];this[_0x5496('0xb2')](this[_0x5496('0x20')][_0x488758['queue']]);_0x4b6adb=new Hangup(_0x488758,_0x556734);_0x4b6adb[_0x5496('0xa8')]=0x13;_0x4b6adb[_0x5496('0xa9')]=_0x5496('0xe2');_0x4b6adb[_0x5496('0xe6')]=_0x5496('0xde');_0x4b6adb[_0x5496('0xe3')]=!![];this[_0x5496('0xcd')](_0x4b6adb,'[syncMachineIvr][createHistory]','[syncMachineIvr]');}}};Dialer[_0x5496('0x19')]['syncHangup']=function(_0x56f01b){var _0x50e82f=this['uniqueId'][_0x56f01b['uniqueid']];var _0x25a2a6=this;var _0x57104d;if(_0x50e82f&&_0x50e82f[_0x5496('0x49')]===_0x5496('0x7c')){delete this[_0x5496('0xac')][_0x56f01b['uniqueid']];this[_0x5496('0xb2')](this[_0x5496('0x20')][_0x50e82f['queue']]);this['campaigns'][_0x50e82f['queue']][_0x5496('0xea')]+=0x1;_0x57104d=new Hangup(_0x50e82f,_0x56f01b);this[_0x5496('0xca')](_0x57104d)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x5496('0xc8')](_0x57104d)['catch'](loggerCatch(_0x5496('0xeb')));}if(_0x50e82f&&_0x50e82f[_0x5496('0x49')]!=='ivr'&&isNotNull(this[_0x5496('0x1f')][_0x50e82f[_0x5496('0xb4')]][_0x5496('0xec')])){delete this['uniqueId'][_0x56f01b[_0x5496('0xdc')]];this[_0x5496('0xb2')](this[_0x5496('0x1f')][_0x50e82f[_0x5496('0xb4')]]);this[_0x5496('0x1f')][_0x50e82f['queue']][_0x5496('0x5d')]+=0x1;this[_0x5496('0x1f')][_0x50e82f[_0x5496('0xb4')]][_0x5496('0x5c')]+=0x1;_0x57104d=new Hangup(_0x50e82f,_0x56f01b);_0x57104d['state']=0x10;_0x57104d[_0x5496('0xa9')]='AnswerAGI';_0x57104d['membername']=_0x5496('0xed');this[_0x5496('0xca')](_0x57104d)[_0x5496('0xbb')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x5496('0xc8')](_0x57104d)[_0x5496('0xbb')](loggerCatch(_0x5496('0xeb')));}if(_0x50e82f&&_0x50e82f['type']!==_0x5496('0x7c')&&!isNotNull(this['voiceQueues'][_0x50e82f[_0x5496('0xb4')]]['dialQueueProject'])){delete this[_0x5496('0xac')][_0x56f01b[_0x5496('0xdc')]];this[_0x5496('0xb2')](this[_0x5496('0x1f')][_0x50e82f[_0x5496('0xb4')]]);this[_0x5496('0x1f')][_0x50e82f['queue']][_0x5496('0x68')]+=0x1;_0x57104d=new Hangup(_0x50e82f,_0x56f01b);_0x57104d[_0x5496('0xa8')]=0xc;_0x57104d['statedesc']=_0x56f01b['cause-txt'];_0x57104d['membername']='Unknow';this[_0x5496('0xca')](_0x57104d)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x5496('0xc8')](_0x57104d)[_0x5496('0xbb')](loggerCatch(_0x5496('0xeb')));}};Dialer['prototype'][_0x5496('0xee')]=function(_0x399cc9){var _0x4abbbd=this[_0x5496('0xac')][_0x399cc9['uniqueid']];var _0x27d6d6=this;if(this[_0x5496('0x1f')][_0x399cc9[_0x5496('0xb4')]]){if(_0x4abbbd&&_0x4abbbd[_0x5496('0x49')]!==_0x5496('0x7c')){delete this[_0x5496('0xac')][_0x399cc9[_0x5496('0xdc')]];this[_0x5496('0x1f')][_0x399cc9[_0x5496('0xb4')]][_0x5496('0x5d')]+=0x1;var _0x29146b=new AgentComplete(_0x4abbbd,_0x399cc9);if(_0x399cc9[_0x5496('0xef')]===_0x5496('0xf0')){_0x29146b[_0x5496('0xf1')]=this[_0x5496('0x1f')][_0x399cc9[_0x5496('0xb4')]][_0x5496('0xf2')]&&this[_0x5496('0x1f')][_0x399cc9[_0x5496('0xb4')]][_0x5496('0xf3')]?moment()['format'](_0x5496('0xf4')):undefined;}this[_0x5496('0xca')](_0x29146b)[_0x5496('0xbb')](loggerCatch(_0x5496('0xf5')));this[_0x5496('0xc8')](_0x29146b)[_0x5496('0xbb')](loggerCatch(_0x5496('0xf6')));}}};Dialer[_0x5496('0x19')][_0x5496('0xf7')]=function(_0x151c4d){if(this[_0x5496('0x1f')][_0x151c4d[_0x5496('0xb4')]]){if(this[_0x5496('0xac')][_0x151c4d[_0x5496('0xdc')]]&&this[_0x5496('0xac')][_0x151c4d[_0x5496('0xdc')]][_0x5496('0x49')]!==_0x5496('0x7c')){this['updateOriginated'](this[_0x5496('0x1f')][_0x151c4d[_0x5496('0xb4')]]);this['uniqueId'][_0x151c4d[_0x5496('0xdc')]][_0x5496('0xf8')]=moment()[_0x5496('0x79')](_0x5496('0xf4'));}}};Dialer[_0x5496('0x19')][_0x5496('0xf9')]=function(_0x373955){this[_0x5496('0xca')](_0x373955)[_0x5496('0xbb')](loggerCatch(_0x5496('0xf5')));this[_0x5496('0xc8')](_0x373955)[_0x5496('0xbb')](loggerCatch(_0x5496('0xfa')));};Dialer[_0x5496('0x19')][_0x5496('0x29')]=function(_0x43fc8e){var _0x597c6b=this['uniqueId'][_0x43fc8e[_0x5496('0xdc')]];var _0xa9877=this;if(this[_0x5496('0x1f')][_0x43fc8e[_0x5496('0xb4')]]){if(_0x597c6b&&_0x597c6b['type']!==_0x5496('0x7c')){delete this['uniqueId'][_0x43fc8e[_0x5496('0xdc')]];this[_0x5496('0xb2')](this[_0x5496('0x1f')][_0x43fc8e['queue']]);_0x597c6b[_0x5496('0xfb')]=moment()[_0x5496('0x79')](_0x5496('0xf4'));var _0x492d5b=new QueueCallerAbandon(_0x597c6b,_0x43fc8e);if(getSeconds(_0x597c6b[_0x5496('0xfb')],_0x597c6b[_0x5496('0xfc')])>=_0x597c6b[_0x5496('0xfd')]){this[_0x5496('0x1f')][_0x43fc8e[_0x5496('0xb4')]][_0x5496('0x6b')]+=0x1;this[_0x5496('0x1f')][_0x43fc8e[_0x5496('0xb4')]][_0x5496('0xfe')]+=0x1;this[_0x5496('0x1f')][_0x43fc8e[_0x5496('0xb4')]][_0x5496('0x6d')]+=0x1;_0x492d5b['state']=0xa;_0x492d5b['statedesc']='Drop';_0x492d5b['dropreason']=_0x5496('0xff');_0x492d5b[_0x5496('0xf1')]=this['voiceQueues'][_0x43fc8e[_0x5496('0xb4')]][_0x5496('0xf2')]?moment()[_0x5496('0x79')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;this['queueCallerAbandonCreateState'](_0x492d5b);}else{this['voiceQueues'][_0x43fc8e[_0x5496('0xb4')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0x5496('0x1f')][_0x43fc8e[_0x5496('0xb4')]]['outboundDropCallsDayCallersExit']+=0x1;_0x492d5b[_0x5496('0xa8')]=0xb;_0x492d5b[_0x5496('0xa9')]=_0x5496('0x100');_0x492d5b['dropreason']='CALLEREXIT';this[_0x5496('0xf9')](_0x492d5b);}}}};Dialer[_0x5496('0x19')][_0x5496('0x2f')]=function(_0x2a1cb6){if(this['actions'][_0x2a1cb6['uniqueid']]){this[_0x5496('0xae')][_0x2a1cb6[_0x5496('0xdc')]][_0x5496('0x101')]=_0x2a1cb6[_0x5496('0x101')];}if(this[_0x5496('0xac')][_0x2a1cb6[_0x5496('0xdc')]]){this['uniqueId'][_0x2a1cb6['uniqueid']][_0x5496('0x101')]=_0x2a1cb6[_0x5496('0x101')];}};Dialer[_0x5496('0x19')][_0x5496('0x102')]=function(_0x297044){if(strategy[this[_0x5496('0x1f')][this['actions'][_0x297044['actionid']][_0x5496('0xb4')]][_0x5496('0x4b')]]==='roundrobin'){if(this[_0x5496('0xae')][_0x297044[_0x5496('0x103')]]&&_[_0x5496('0xd8')](this['actions'][_0x297044[_0x5496('0x103')]][_0x5496('0x104')])&&_0x297044[_0x5496('0xd6')]==='1'&&_0x297044[_0x5496('0x105')]==='0'){if(this[_0x5496('0x106')][_0x297044[_0x5496('0x107')]]){if(!this['agents'][_0x297044[_0x5496('0x107')]][_0x5496('0x104')]){this[_0x5496('0x106')][_0x297044[_0x5496('0x107')]][_0x5496('0x104')]=!![];this[_0x5496('0xae')][_0x297044['actionid']][_0x5496('0x104')]=!![];this[_0x5496('0xae')][_0x297044[_0x5496('0x103')]][_0x5496('0x107')]=_0x297044[_0x5496('0x107')];}}}}else if((strategy[this[_0x5496('0x1f')][this[_0x5496('0xae')][_0x297044['actionid']][_0x5496('0xb4')]][_0x5496('0x4b')]]||_0x5496('0x18'))===_0x5496('0x18')){if(this[_0x5496('0xae')][_0x297044[_0x5496('0x103')]]){if(this['agents'][_0x297044[_0x5496('0x107')]]){this[_0x5496('0xae')][_0x297044[_0x5496('0x103')]][_0x5496('0x107')]=_0x297044[_0x5496('0x107')];if(_[_0x5496('0xd8')](this[_0x5496('0x26')][this['actions'][_0x297044[_0x5496('0x103')]][_0x5496('0xb4')]])){this[_0x5496('0x26')][this['actions'][_0x297044[_0x5496('0x103')]][_0x5496('0xb4')]]=[];}this[_0x5496('0x26')][this[_0x5496('0xae')][_0x297044[_0x5496('0x103')]]['queue']][_0x5496('0x108')](_[_0x5496('0x8f')](_['pick'](this[_0x5496('0xae')][_0x297044[_0x5496('0x103')]],[_0x5496('0x109'),'stateinterface']),{'status':_0x297044[_0x5496('0xd6')],'paused':_0x297044[_0x5496('0x105')]}));}}}};function unlockQueueStatus(_0x598575,_0x49bb20){setTimeout(function(){if(_[_0x5496('0x86')](_0x598575[_0x5496('0x10a')])){loggerBooked[_0x5496('0x99')](_0x5496('0x10b'),_0x49bb20);}_0x598575[_0x5496('0x10a')]=!![];loggerBooked['info'](_0x5496('0x10c'),_0x49bb20,JSON['stringify'](_[_0x5496('0xce')](_0x598575,['name',_0x5496('0x10a')])));},0x1f3);}Dialer[_0x5496('0x19')][_0x5496('0x34')]=function(_0x1bbfe1){var _0x352efa=this;var _0x105eac=_0x352efa[_0x5496('0x1f')][_0x352efa[_0x5496('0xae')][_0x1bbfe1['actionid']]['queue']];if(strategy[this[_0x5496('0x1f')][this[_0x5496('0xae')][_0x1bbfe1[_0x5496('0x103')]][_0x5496('0xb4')]][_0x5496('0x4b')]]===_0x5496('0x10d')){if(this[_0x5496('0xae')][_0x1bbfe1[_0x5496('0x103')]]&&this[_0x5496('0xae')][_0x1bbfe1['actionid']][_0x5496('0x107')]){this[_0x5496('0x1e')][_0x5496('0x10e')](this['actions'][_0x1bbfe1[_0x5496('0x103')]][_0x5496('0x109')],this[_0x5496('0xae')][_0x1bbfe1[_0x5496('0x103')]][_0x5496('0x107')])['catch'](function(_0x444bcf){logger['error'](_0x5496('0x10f'),util['inspect'](_0x444bcf,{'showHidden':![],'depth':null}));})[_0x5496('0x1c')](function(){_0x352efa[_0x5496('0xb2')](_0x352efa[_0x5496('0x1f')][_0x352efa[_0x5496('0xae')][_0x1bbfe1['actionid']]['queue']]);_0x352efa[_0x5496('0x106')][_0x352efa[_0x5496('0xae')][_0x1bbfe1[_0x5496('0x103')]][_0x5496('0x107')]][_0x5496('0x104')]=![];delete _0x352efa[_0x5496('0xae')][_0x1bbfe1['actionid']];unlockQueueStatus(_0x105eac);});}else{this[_0x5496('0xb2')](this[_0x5496('0x1f')][this['actions'][_0x1bbfe1[_0x5496('0x103')]][_0x5496('0xb4')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0x5496('0xae')][_0x1bbfe1[_0x5496('0x103')]][_0x5496('0x110')],'ListId':this[_0x5496('0xae')][_0x1bbfe1['actionid']][_0x5496('0xcf')],'VoiceQueueId':this[_0x5496('0xae')][_0x1bbfe1[_0x5496('0x103')]]['VoiceQueueId']||undefined,'CampaignId':this['actions'][_0x1bbfe1[_0x5496('0x103')]]['CampaignId']||undefined})[_0x5496('0xbb')](loggerCatch(_0x5496('0x111')));delete this['actions'][_0x1bbfe1[_0x5496('0x103')]];unlockQueueStatus(_0x105eac);}}else if((strategy[this[_0x5496('0x1f')][this[_0x5496('0xae')][_0x1bbfe1[_0x5496('0x103')]]['queue']]['strategy']]||_0x5496('0x18'))===_0x5496('0x18')){var _0x3ede4b;if(this[_0x5496('0xae')][_0x1bbfe1[_0x5496('0x103')]]&&!_['isEmpty'](this['queueBooked'][this['actions'][_0x1bbfe1[_0x5496('0x103')]][_0x5496('0xb4')]])){if(this[_0x5496('0x112')][_0x352efa[_0x5496('0xae')][_0x1bbfe1[_0x5496('0x103')]][_0x5496('0xb4')]]){this['queueBookedRR'][_0x352efa[_0x5496('0xae')][_0x1bbfe1[_0x5496('0x103')]]['queue']]=this['queueBookedRR'][this[_0x5496('0xae')][_0x1bbfe1['actionid']][_0x5496('0xb4')]]?this[_0x5496('0x112')][this[_0x5496('0xae')][_0x1bbfe1[_0x5496('0x103')]][_0x5496('0xb4')]]:this[_0x5496('0x26')][this[_0x5496('0xae')][_0x1bbfe1['actionid']][_0x5496('0xb4')]]?this[_0x5496('0x26')][this[_0x5496('0xae')][_0x1bbfe1[_0x5496('0x103')]][_0x5496('0xb4')]][_0x5496('0x113')]||0x0:0x0;}this[_0x5496('0x26')][this[_0x5496('0xae')][_0x1bbfe1['actionid']][_0x5496('0xb4')]][_0x5496('0x113')]=this['queueBookedRR'][this['actions'][_0x1bbfe1[_0x5496('0x103')]][_0x5496('0xb4')]];for(var _0x2389aa=0x0;_0x2389aa=0x0?!![]:![];})['catch'](myreject(_0xfb1a2b)));}}else{_0x37019e[_0x5496('0x108')](ami['Action']({'action':_0x5496('0x127'),'command':util[_0x5496('0x79')](_0x5496('0x128'),_0x2af672,!_['isUndefined'](config[_0x5496('0x123')][_0x5d7a8a])?_0x5d7a8a:'')})['then'](function(_0x53e515){return _0x53e515[_0x5496('0x12a')][_0x5496('0x12b')](_0x5496('0x12c'))>=0x0?!![]:![];})['catch'](myreject(_0xfb1a2b)));}BPromise[_0x5496('0x12d')](_0x37019e)[_0x5496('0xb8')](function(_0xf3d5a8){var _0x5e675f=_['some'](_0xf3d5a8);if(_0x5e675f){return _0x39563c(_0x5e675f);}else{_0x3193f3[_0x5496('0x39')]=_0x1c5b41?_0x5496('0x12e'):'INTERVAL_IS_OVERTIME';return _0xfb1a2b(msgResponse('[ifTime][promiseAll]',_0x5496('0x121'),'Global:\x20'+_0x1c5b41+'\x20'+_0x5e29f7+'\x20Interval\x20is\x20overtime:\x20'+util['inspect'](_0x2af672,{'showHidden':![],'depth':null})+_0x5496('0x12f')+_0x5d7a8a));}})['catch'](function(_0x2f04ce){return _0xfb1a2b(msgResponse('ifTime','Failure',JSON['stringify'](_0x2f04ce)));});});};Dialer[_0x5496('0x19')][_0x5496('0x130')]=function(_0x456333){var _0x2c373f=this;return function(){switch(_0x456333['dialMethod']){case _0x5496('0x131'):freeVariablesPredictive(_0x456333);_0x2c373f['handlePower'](_0x456333,0x1);break;case _0x5496('0x132'):freeVariablesPredictive(_0x456333);_0x2c373f[_0x5496('0x133')](_0x456333,_0x456333[_0x5496('0x134')]);break;case _0x5496('0x7'):_0x2c373f['predictive'](_0x456333);break;case _0x5496('0x6'):freeVariablesPredictive(_0x456333);_0x2c373f['handlePower'](_0x456333,0x1);break;default:freeVariablesPredictive(_0x456333);logger[_0x5496('0x99')](_0x5496('0x135'),_0x456333[_0x5496('0x3d')],_0x5496('0x136'));}};};Dialer[_0x5496('0x19')][_0x5496('0x137')]=function(_0x5255e8){var _0x4f7c42=this;return function(){_0x4f7c42['handleIvr'](_0x5255e8);};};Dialer[_0x5496('0x19')][_0x5496('0x9')]=function(_0x4f1a62){var _0x507170=this;if(isNotPreview(_0x4f1a62[_0x5496('0x138')])){if(isVoiceQueueOutbound(_0x4f1a62[_0x5496('0x49')])&&isActive(_0x4f1a62[_0x5496('0x57')])){_0x4f1a62[_0x5496('0xa2')]=!![];BPromise[_0x5496('0xb7')]()[_0x5496('0xb8')](checkIsLoggedIn(_0x4f1a62,_0x4f1a62[_0x5496('0x4e')]))['then'](checkIsActive(_0x4f1a62,_0x4f1a62[_0x5496('0x57')]))[_0x5496('0xb8')](checkInterval(_0x4f1a62))[_0x5496('0xb8')](_0x507170[_0x5496('0x11d')](_0x4f1a62))[_0x5496('0xb8')](_0x507170[_0x5496('0x139')](_0x4f1a62['dialGlobalInterval'],_0x4f1a62[_0x5496('0x13a')],_0x4f1a62['name'],_0x4f1a62))[_0x5496('0xb8')](_0x507170[_0x5496('0x13b')](_0x4f1a62[_0x5496('0x3e')],_0x4f1a62[_0x5496('0x13a')],_0x4f1a62['name'],_0x4f1a62))[_0x5496('0xb8')](_0x507170[_0x5496('0x130')](_0x4f1a62))[_0x5496('0xbb')](loggerCatchQueueSummary(_0x5496('0x13c'),_0x4f1a62));}else{notSendMessagesQueue(_0x4f1a62);}}else{freeVariablesPredictive(_0x4f1a62);}};Dialer['prototype'][_0x5496('0x11c')]=function(){var _0x1f3252=this;var _0x2d255d;for(var _0x38ee44 in this['campaigns']){if(this[_0x5496('0x20')][_0x5496('0x9c')](_0x38ee44)){_0x2d255d=this[_0x5496('0x20')][_0x38ee44];if(isCampaignIvr(_0x2d255d['type'])&&isActive(_0x2d255d['active'])){_0x2d255d['sendMessageOneNotActive']=!![];BPromise[_0x5496('0xb7')]()[_0x5496('0xb8')](checkIsActive(_0x2d255d,_0x2d255d[_0x5496('0x77')]))[_0x5496('0xb8')](checkInterval(_0x2d255d))[_0x5496('0xb8')](_0x1f3252[_0x5496('0x11d')](_0x2d255d))[_0x5496('0xb8')](_0x1f3252[_0x5496('0x139')](_0x2d255d['dialGlobalInterval'],_0x2d255d[_0x5496('0x13a')],_0x2d255d[_0x5496('0x3d')],_0x2d255d))[_0x5496('0xb8')](_0x1f3252[_0x5496('0x13b')](_0x2d255d[_0x5496('0x3e')],_0x2d255d[_0x5496('0x13a')],_0x2d255d[_0x5496('0x3d')],_0x2d255d))[_0x5496('0xb8')](_0x1f3252[_0x5496('0x137')](_0x2d255d))[_0x5496('0xbb')](loggerCatchQueueSummary(_0x5496('0x13d'),_0x2d255d));}else{notSendMessagesCampaign(_0x2d255d);}}}};function getCallerIdRandom(_0x4d5495,_0x5a34da){var _0x1ffc77,_0x398f5b,_0x1168db;if(_0x5a34da<=0x0){_0x5a34da=0x1;}_0x1ffc77=new RegExp('\x5cw{0,'+_0x5a34da+'}$');_0x398f5b=Math[_0x5496('0x13e')](0xa,_0x5a34da-0x1);_0x1168db=Math[_0x5496('0x13e')](0xa,_0x5a34da)-0x1;return util['format']('%s',_['replace'](_0x4d5495,_0x1ffc77,_[_0x5496('0x13f')](_0x398f5b,_0x1168db)));}function extractCalleridName(_0x4d3f11){var _0x6b89fd=_0x4d3f11[_0x5496('0x140')](/"(.*?)"/);return _0x6b89fd?_0x6b89fd[0x1]:_0x4d3f11;}function extractCalleridNumber(_0x5f4c3d){var _0x309203=_0x5f4c3d[_0x5496('0x140')](/<(.*?)>/);return _0x309203?_0x309203[0x1]:_0x5f4c3d;}Dialer['prototype'][_0x5496('0x141')]=function(_0x45583f,_0x1051ff){var _0x59dfcb=this;var _0x2dd041=uuid['v4']();this[_0x5496('0xae')][_0x2dd041]=new Action(_0x45583f,_0x1051ff,_0x2dd041);return new BPromise(function(_0x439f84,_0x123a69){if(_['isUndefined'](_0x45583f)&&_0x5496('0x142')!==typeof _0x45583f){return _0x123a69(msgResponse('originate',_0x5496('0x121'),_0x5496('0x143')));}if(_[_0x5496('0x86')](_0x1051ff['Contact'][_0x5496('0x144')])||_0x1051ff[_0x5496('0x145')][_0x5496('0x144')]===null){return _0x123a69(msgResponse(_0x5496('0x146'),_0x5496('0x121'),_0x5496('0x147')));}var _0x3750b6={'XMD-CALLERID':_0x59dfcb['actions'][_0x2dd041]['getCaller'](),'XMD-AGI':_0x45583f[_0x5496('0xec')]?util[_0x5496('0x79')]('\x22agi://%s/square,%s\x22',ipAgi,_0x45583f[_0x5496('0xec')]):_0x5496('0x148'),'XMD-AGIAFTER':_0x45583f['dialQueueProject2']?util[_0x5496('0x79')]('\x22agi://%s/square,%s\x22',ipAgi,_0x45583f[_0x5496('0xf2')]):_0x5496('0x148'),'XMD-QUEUE':_0x45583f[_0x5496('0x49')]===_0x5496('0x4a')?util['format'](_0x5496('0x149'),_0x45583f[_0x5496('0x3d')],_0x45583f[_0x5496('0x14a')]||'',_0x45583f[_0x5496('0xf3')]?'c':'',_0x45583f['dialQueueTimeout']||0x3):_0x5496('0x148'),'XMD-CONTACTID':_0x1051ff['ContactId'],'XMD-CDRTYPE':_0x5496('0x5'),'CALLERID(all)':_0x59dfcb[_0x5496('0xae')][_0x2dd041]['getCaller'](),'XMD-AMD':_0x45583f[_0x5496('0xe1')]?_0x5496('0x14b'):'NONE','XMD-DESTINATION':'xcally-motion-dialer'};if(_0x45583f[_0x5496('0xe1')]){_0x3750b6[_0x5496('0x14c')]=_0x45583f[_0x5496('0x14d')]||0x9c4;_0x3750b6['XMD-AMDGREETING']=_0x45583f[_0x5496('0x14e')]||0x5dc;_0x3750b6[_0x5496('0x14f')]=_0x45583f['dialAMDAfterGreetingSilence']||0x320;_0x3750b6['XMD-AMDTOTALANALYSISTIME']=_0x45583f[_0x5496('0x150')]||0x1388;_0x3750b6[_0x5496('0x151')]=_0x45583f['dialAMDMinWordLength']||0x64;_0x3750b6['XMD-AMDBETWEENWORDSSILENCE']=_0x45583f[_0x5496('0x152')]||0x32;_0x3750b6[_0x5496('0x153')]=_0x45583f[_0x5496('0x154')]||0x3;_0x3750b6[_0x5496('0x155')]=_0x45583f[_0x5496('0x156')]||0x100;_0x3750b6[_0x5496('0x157')]=_0x45583f[_0x5496('0x158')]||0x1388;}if(_0x45583f['type']==='outbound'){_0x3750b6['XMD-VOICEQUEUEID']=_0x1051ff[_0x5496('0xd1')];}else{_0x3750b6['XMD-CAMPAIGNID']=_0x1051ff['CampaignId'];}for(var _0x265a9b in _0x1051ff['Contact']){if(_0x1051ff[_0x5496('0x145')][_0x5496('0x9c')](_0x265a9b)){if(isNotNull(_0x1051ff[_0x5496('0x145')][_0x265a9b])&&_0x265a9b!=='id'&&_0x265a9b!==_0x5496('0x159')&&_0x265a9b!==_0x5496('0x15a')&&_0x265a9b!=='updatedAt'){_0x3750b6[util[_0x5496('0x79')](_0x5496('0x15b'),_0x5496('0x15c'),_[_0x5496('0x15d')](_0x265a9b))]=_0x1051ff['Contact'][_0x265a9b];}}}var _0x3024ac=_0x59dfcb['isTrunkReachable'](_0x45583f[_0x5496('0x76')])?getCallerId(_0x45583f[_0x5496('0x76')][_0x5496('0x15e')],_0x45583f[_0x5496('0x58')],_0x45583f[_0x5496('0x15f')]>0x0?getCallerIdRandom(_0x45583f['dialOriginateCallerIdNumber'],_0x45583f['dialRandomLastDigitCallerIdNumber']):_0x45583f['dialOriginateCallerIdNumber']):getCallerId(_['isNil'](_0x45583f[_0x5496('0x160')])?_0x45583f[_0x5496('0x76')]['callerid']:_0x45583f['TrunkBackup'][_0x5496('0x15e')],_0x45583f[_0x5496('0x58')],_0x45583f[_0x5496('0x15f')]>0x0?getCallerIdRandom(_0x45583f[_0x5496('0x59')],_0x45583f[_0x5496('0x15f')]):_0x45583f[_0x5496('0x59')]);if(_0x3024ac){_0x3750b6['XMD-ORIGINATECALLERIDNAME']=_0x59dfcb[_0x5496('0xae')][_0x2dd041][_0x5496('0x161')]=extractCalleridName(_0x3024ac);_0x3750b6['XMD-ORIGINATECALLERIDNUM']=_0x59dfcb['actions'][_0x2dd041][_0x5496('0x162')]=extractCalleridNumber(_0x3024ac);}return ami[_0x5496('0xb0')]({'actionid':_0x2dd041,'action':_0x5496('0x146'),'channel':_0x59dfcb[_0x5496('0x11e')](_0x45583f[_0x5496('0x76')])?util[_0x5496('0x79')]('SIP/%s/%s%s',_0x45583f[_0x5496('0x76')][_0x5496('0x3d')],isNotNull(_0x45583f[_0x5496('0x5b')])?_0x45583f[_0x5496('0x5b')][_0x5496('0x163')]()||'':'',_0x45583f[_0x5496('0x164')]>0x0?_0x1051ff[_0x5496('0x145')][_0x5496('0x144')][_0x5496('0x165')](_0x45583f[_0x5496('0x164')]):_0x1051ff[_0x5496('0x145')][_0x5496('0x144')]):util['format'](_0x5496('0x166'),_[_0x5496('0xd8')](_0x45583f[_0x5496('0x160')])?_0x45583f[_0x5496('0x76')][_0x5496('0x3d')]:_0x45583f['TrunkBackup'][_0x5496('0x3d')],isNotNull(_0x45583f['dialPrefix'])?_0x45583f[_0x5496('0x5b')]['trim']()||'':'',_0x45583f[_0x5496('0x164')]>0x0?_0x1051ff[_0x5496('0x145')][_0x5496('0x144')][_0x5496('0x165')](_0x45583f[_0x5496('0x164')]):_0x1051ff[_0x5496('0x145')]['phone']),'callerid':_0x3024ac,'Exten':'xcally-motion-dialer','Context':_0x5496('0x167'),'Priority':'1','variable':_0x3750b6,'timeout':(_0x45583f['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x2dd041})[_0x5496('0xb8')](function(_0x394204){return _0x439f84(_0x394204);})[_0x5496('0xbb')](function(_0x159fae){_0x45583f[_0x5496('0x65')]+=0x1;var _0x213e0a=new History(_0x59dfcb[_0x5496('0xae')][_0x2dd041]);logger[_0x5496('0x99')](util['format']('[originateError]:\x20%s',JSON[_0x5496('0x44')](_0x159fae)));_0x213e0a['state']=0xe;_0x213e0a[_0x5496('0xa9')]=_0x5496('0x168');_0x213e0a['starttime']=moment()[_0x5496('0x79')](_0x5496('0xf4'));_0x213e0a['endtime']=_0x213e0a[_0x5496('0xaa')];_0x59dfcb['createHistory'](_0x213e0a)[_0x5496('0xbb')](loggerCatch(_0x5496('0x169')));_0x59dfcb['moveContactManagedDialer'](_0x213e0a)[_0x5496('0xbb')](loggerCatch(_0x5496('0x169')))[_0x5496('0x1c')](function(){delete _0x59dfcb[_0x5496('0xae')][_0x2dd041];return _0x123a69(msgResponse(_0x5496('0x146'),_0x5496('0x43'),'originate\x20action\x20Error'));});});});};Dialer[_0x5496('0x19')][_0x5496('0x16a')]=function(_0x25b12e){var _0x273110=this['actions'][_0x25b12e[_0x5496('0x103')]];var _0x815c39=this;if(_0x273110){delete this['actions'][_0x25b12e[_0x5496('0x103')]];_0x273110[_0x5496('0xfc')]=moment()[_0x5496('0x79')]('YYYY-MM-DD\x20HH:mm:ss');var _0x5e8ab2=_0x273110[_0x5496('0x49')]===_0x5496('0x7c')?this['campaigns'][_0x273110[_0x5496('0xb4')]]:this[_0x5496('0x1f')][_0x273110[_0x5496('0x16b')]()];if(!this[_0x5496('0xd3')](_0x25b12e[_0x5496('0x16c')])){this[_0x5496('0xb2')](_0x5e8ab2);return this[_0x5496('0x16d')](_0x273110,_0x5e8ab2,_0x25b12e)[_0x5496('0xb8')](function(_0x5ced66){})[_0x5496('0xbb')](loggerCatch(_0x5496('0x16e')));}else{this[_0x5496('0xac')][_0x25b12e['uniqueid']]=_0x273110;}}};Dialer[_0x5496('0x19')][_0x5496('0x16f')]=function(_0x385714,_0xd77d1f,_0x2b9e02){var _0x4b3a66=new History(_0xd77d1f);if(_0x4b3a66[_0x5496('0x170')]+_0x4b3a66['countcongestionretry']+_0x4b3a66[_0x5496('0x171')]>=_0x2b9e02[_0x5496('0x172')]-0x1){return!![];}switch(_0x385714){case 0x3:if(_0x4b3a66[_0x5496('0x171')]>=_0x2b9e02[_0x5496('0x173')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnoanswerretry':_0x4b3a66[_0x5496('0x171')]+=0x1,'scheduledat':moment()['add'](_0x2b9e02[_0x5496('0x174')],_0x5496('0x175'))[_0x5496('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4b3a66[_0x5496('0x110')],'ListId':_0x4b3a66[_0x5496('0xcf')],'VoiceQueueId':_0x4b3a66[_0x5496('0xd1')]||undefined,'CampaignId':_0x4b3a66['CampaignId']||undefined})[_0x5496('0xbb')](loggerCatch(_0x5496('0x176')));}break;case 0x5:if(_0x4b3a66[_0x5496('0x170')]>=_0x2b9e02[_0x5496('0x177')]-0x1){return!![];}else{this[_0x5496('0xc1')]({'active':![],'countbusyretry':_0x4b3a66[_0x5496('0x170')]+=0x1,'scheduledat':moment()[_0x5496('0x178')](_0x2b9e02[_0x5496('0x179')],'minutes')[_0x5496('0x79')](_0x5496('0xf4')),'ContactId':_0x4b3a66[_0x5496('0x110')],'ListId':_0x4b3a66[_0x5496('0xcf')],'VoiceQueueId':_0x4b3a66[_0x5496('0xd1')]||undefined,'CampaignId':_0x4b3a66[_0x5496('0x11a')]||undefined})[_0x5496('0xbb')](loggerCatch(_0x5496('0x17a')));}break;case 0x8:if(_0x4b3a66[_0x5496('0x17b')]>=_0x2b9e02[_0x5496('0x17c')]-0x1){return!![];}else{this[_0x5496('0xc1')]({'active':![],'countcongestionretry':_0x4b3a66[_0x5496('0x17b')]+=0x1,'scheduledat':moment()[_0x5496('0x178')](_0x2b9e02['dialCongestionRetryFrequency'],_0x5496('0x175'))['format'](_0x5496('0xf4')),'ContactId':_0x4b3a66['ContactId'],'ListId':_0x4b3a66[_0x5496('0xcf')],'VoiceQueueId':_0x4b3a66[_0x5496('0xd1')]||undefined,'CampaignId':_0x4b3a66['CampaignId']||undefined})[_0x5496('0xbb')](loggerCatch('[rescheduleContact]\x20[Congestion]'));}break;default:return!![];}};Dialer[_0x5496('0x19')]['callProgressDetecting']=function(_0x5a6c0d,_0xb184,_0xa229d5){var _0x2d5600=this;var _0x3dfe24=new History(_0x5a6c0d);return new BPromise(function(_0x25e917,_0x4e1244){if(_[_0x5496('0x86')](_0xb184)&&'object'!==typeof _0xb184){return _0x4e1244(msgResponse(_0x5496('0x17d'),_0x5496('0x121'),_0x5496('0x17e')));}if(_['isUndefined'](_0xa229d5)&&'object'!==typeof _0xa229d5){return _0x4e1244(msgResponse('[callProgressDetecting]','Failure',_0x5496('0x17f')));}switch(_0xa229d5[_0x5496('0xef')]){case'0':_0xb184[_0x5496('0x64')]+=0x1;_0x3dfe24[_0x5496('0xa8')]=0x0;_0x3dfe24[_0x5496('0xa9')]=_0x5496('0x180');_0x2d5600[_0x5496('0xca')](_0x3dfe24)[_0x5496('0xbb')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x2d5600['checkRetriveMax'](0x0,_0x5a6c0d,_0xb184)){if(_0x3dfe24[_0x5496('0x170')]+_0x3dfe24[_0x5496('0x17b')]+_0x3dfe24[_0x5496('0x171')]>=_0xb184[_0x5496('0x172')]){_0x2d5600[_0x5496('0x181')](_0x3dfe24,_0x25e917,_0x4e1244,_0x5496('0x182'));}else{_0x2d5600[_0x5496('0x183')](_0x3dfe24,_0x25e917,_0x4e1244,_0x5496('0x182'));}}break;case'3':_0xb184[_0x5496('0x63')]+=0x1;_0x3dfe24[_0x5496('0xa8')]=0x3;_0x3dfe24[_0x5496('0xa9')]=_0x5496('0x184');_0x3dfe24['countnoanswerretry']+=0x1;_0x3dfe24['countglobal']+=0x1;_0x2d5600[_0x5496('0xca')](_0x3dfe24)['catch'](loggerCatch(_0x5496('0x185')));if(_0x2d5600[_0x5496('0x16f')](0x3,_0x5a6c0d,_0xb184)){if(_0x3dfe24[_0x5496('0x171')]>=_0xb184[_0x5496('0x173')]){_0x2d5600[_0x5496('0x183')](_0x3dfe24,_0x25e917,_0x4e1244,_0x5496('0x186'));}else{_0x2d5600[_0x5496('0x181')](_0x3dfe24,_0x25e917,_0x4e1244,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0xb184[_0x5496('0x5f')]+=0x1;_0x3dfe24[_0x5496('0xa8')]=0x5;_0x3dfe24[_0x5496('0xa9')]=_0x5496('0x187');_0x3dfe24['countbusyretry']+=0x1;_0x3dfe24[_0x5496('0x188')]+=0x1;_0x2d5600[_0x5496('0xca')](_0x3dfe24)[_0x5496('0xbb')](loggerCatch(_0x5496('0x189')));if(_0x2d5600['checkRetriveMax'](0x5,_0x5a6c0d,_0xb184)){if(_0x3dfe24['countbusyretry']>=_0xb184[_0x5496('0x177')]){_0x2d5600[_0x5496('0x183')](_0x3dfe24,_0x25e917,_0x4e1244,'reason\x205\x20busy');}else{_0x2d5600['stateGlobal'](_0x3dfe24,_0x25e917,_0x4e1244,_0x5496('0x18a'));}}break;case'8':_0xb184[_0x5496('0x60')]+=0x1;_0x3dfe24[_0x5496('0xa8')]=0x8;_0x3dfe24[_0x5496('0xa9')]=_0x5496('0x18b');_0x3dfe24[_0x5496('0x17b')]+=0x1;_0x3dfe24[_0x5496('0x188')]+=0x1;_0x2d5600[_0x5496('0xca')](_0x3dfe24)['catch'](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x2d5600[_0x5496('0x16f')](0x8,_0x5a6c0d,_0xb184)){if(_0x3dfe24[_0x5496('0x17b')]>=_0xb184[_0x5496('0x17c')]){_0x2d5600[_0x5496('0x183')](_0x3dfe24,_0x25e917,_0x4e1244,'reason\x208\x20congestion');}else{_0x2d5600[_0x5496('0x181')](_0x3dfe24,_0x25e917,_0x4e1244,_0x5496('0x18c'));}}break;default:_0xb184[_0x5496('0x68')]+=0x1;_0x3dfe24[_0x5496('0xa8')]=0xc;_0x3dfe24[_0x5496('0xa9')]=_0xa229d5['reason'];_0x2d5600[_0x5496('0xca')](_0x3dfe24)[_0x5496('0xbb')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x2d5600[_0x5496('0x16f')](_0xa229d5[_0x5496('0xef')],_0x5a6c0d,_0xb184)){if(_0x3dfe24[_0x5496('0x170')]+_0x3dfe24[_0x5496('0x17b')]+_0x3dfe24[_0x5496('0x171')]>=_0xb184['dialGlobalMaxRetry']){_0x2d5600[_0x5496('0x181')](_0x3dfe24,_0x25e917,_0x4e1244,_0xa229d5['reason']);}else{_0x2d5600['createStateFinal'](_0x3dfe24,_0x25e917,_0x4e1244,_0xa229d5[_0x5496('0xef')]);}}}});};Dialer[_0x5496('0x19')]['stateGlobal']=function(_0x3483bc,_0x1682d7,_0x238d95,_0x5f082a){var _0x2fc9cc=new Final(_0x3483bc);_0x2fc9cc[_0x5496('0xa8')]=0xf;_0x2fc9cc[_0x5496('0xa9')]=_0x5496('0x18d');this['createStateFinal'](_0x2fc9cc,_0x1682d7,_0x238d95,_0x5f082a);};Dialer['prototype']['createStateFinal']=function(_0xc99c93,_0x5ed17e,_0x3493ae,_0x7e6dd0){this[_0x5496('0xc8')](_0xc99c93)[_0x5496('0xb8')](function(_0x222476){return _0x5ed17e(msgResponse(_0x5496('0x17d'),_0x5496('0xd4'),_0x7e6dd0));})[_0x5496('0xbb')](function(_0x35186a){return _0x3493ae(msgResponse(_0x5496('0x18e'),_0x5496('0x121'),'contact\x20not\x20moved'));});};Dialer[_0x5496('0x19')][_0x5496('0x7')]=function(_0x14af8c){var _0x4ac1b5=this;var _0x471a1c=_0x14af8c[_0x5496('0x18f')]/0x64;var _0x338f0d=_0x14af8c[_0x5496('0xfe')]/(_0x14af8c[_0x5496('0xfe')]+_0x14af8c['outboundAnswerCallsDay']);var _0x32c7ca=Math['round'](_0x14af8c[_0x5496('0x70')]*(_0x14af8c[_0x5496('0x190')]/0x64));var _0x537223=Math[_0x5496('0x191')](_0x14af8c[_0x5496('0x70')]*(_0x14af8c[_0x5496('0x192')]/0x64));var _0x495053=_0x14af8c['available']+_0x14af8c[_0x5496('0x193')];var _0x369e2f=Math[_0x5496('0x194')](_0x14af8c['erlangCalls']*_0x14af8c[_0x5496('0x8e')]*_0x14af8c['predictiveIntervalHitRate']*_0x14af8c[_0x5496('0x6f')]);if(_[_0x5496('0x86')](_0x14af8c['startProgressive'])){if(!_[_0x5496('0x86')](_0x14af8c['startPredictive'])){_0x14af8c['startPredictive']=undefined;loggerPredictive[_0x5496('0x99')](_0x5496('0x195'),_0x5496('0x196'));}if(!_['isUndefined'](_0x14af8c[_0x5496('0x93')])){loggerPredictive['error'](_0x5496('0x195'),_0x5496('0x197'));clearInterval(_0x14af8c[_0x5496('0x93')]);_0x14af8c[_0x5496('0x93')]=undefined;}_0x14af8c[_0x5496('0x90')]=moment()['format'](_0x5496('0xf4'));loggerPredictive[_0x5496('0x7f')](_0x14af8c[_0x5496('0x3d')],'collection\x20data\x20in\x20progressive\x20at',_0x14af8c[_0x5496('0x90')]);this['handlePower'](_0x14af8c,0x1);}else if(ifInterval(_0x14af8c[_0x5496('0x198')],_0x14af8c[_0x5496('0x90')])){this[_0x5496('0x133')](_0x14af8c,0x1);loggerPredictiveCalls[_0x5496('0x7f')](_0x5496('0x199'),_0x14af8c[_0x5496('0x90')],_0x14af8c[_0x5496('0x3d')]);_0x14af8c[_0x5496('0x73')]=0x0;_0x14af8c[_0x5496('0x6d')]=0x0;}else if(_0x471a1c<_0x338f0d&&_0x14af8c['dialPredictiveOptimization']===_0x5496('0x19a')){freeVariablesPredictive(_0x14af8c);loggerPredictive[_0x5496('0x7f')](_0x5496('0x19b'),_0x5496('0x19c'),_0x338f0d,_0x5496('0x90'),_0x14af8c[_0x5496('0x3d')]);}else if(_0x369e2f<_0x14af8c['predictiveIntervalErlangCallsDroppedCalls']&&_0x14af8c[_0x5496('0x19d')]===_0x5496('0x19a')){freeVariablesPredictive(_0x14af8c);loggerPredictive[_0x5496('0x7f')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20',_0x369e2f,'Drop\x20in\x20this\x20interval',_0x14af8c[_0x5496('0x6d')],_0x5496('0x90'),_0x14af8c[_0x5496('0x3d')]);}else if(!ifInterval(_0x14af8c[_0x5496('0x198')],_0x14af8c[_0x5496('0x90')])&&_['isUndefined'](_0x14af8c[_0x5496('0x25')])&&!_[_0x5496('0x86')](_0x14af8c[_0x5496('0x90')])){_0x14af8c[_0x5496('0x25')]=moment()['format'](_0x5496('0xf4'));loggerPredictive[_0x5496('0x7f')](_0x14af8c['name'],_0x5496('0x19e'),_0x14af8c[_0x5496('0x25')]);this[_0x5496('0x19f')](_0x14af8c[_0x5496('0x198')])[_0x5496('0xb8')](this['getDataPredictive'](_0x14af8c))[_0x5496('0xb8')](mergeDataErlangB(_0x14af8c))[_0x5496('0xb8')](this['startMethodPredictive'](_0x14af8c))[_0x5496('0xbb')](loggerCatchPredictive(_0x5496('0x1a0'),_0x14af8c));}else if(!ifInterval(_0x14af8c[_0x5496('0x198')],_0x14af8c[_0x5496('0x25')])){_0x14af8c['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x14af8c['startPredictive']=moment()[_0x5496('0x79')](_0x5496('0xf4'));loggerPredictive[_0x5496('0x7f')](_0x14af8c['name'],_0x5496('0x1a1'),_0x14af8c['startPredictive']);clearInterval(_0x14af8c[_0x5496('0x93')]);_0x14af8c['handlePredictive']=undefined;this['averageHandleTime'](_0x14af8c[_0x5496('0x198')])['then'](this[_0x5496('0x1a2')](_0x14af8c))['then'](mergeDataErlangB(_0x14af8c))[_0x5496('0xb8')](this[_0x5496('0x1a3')](_0x14af8c))[_0x5496('0xbb')](loggerCatchPredictive(_0x5496('0x1a4'),_0x14af8c));}else if(_0x14af8c[_0x5496('0x70')]&&_0x495053<_0x14af8c[_0x5496('0x70')]-_0x537223){freeVariablesPredictive(_0x14af8c);loggerPredictive[_0x5496('0x7f')](_0x14af8c[_0x5496('0x3d')],_0x5496('0x1a5'),_0x495053,_0x5496('0x1a6'),_0x14af8c[_0x5496('0x70')],'-',_0x537223,'=',_0x14af8c['predictiveIntervalAvailable']-_0x537223,')');}else if(_0x14af8c[_0x5496('0x70')]&&_0x495053>_0x14af8c[_0x5496('0x70')]+_0x32c7ca){freeVariablesPredictive(_0x14af8c);loggerPredictive[_0x5496('0x7f')](_0x14af8c[_0x5496('0x3d')],_0x5496('0x1a5'),_0x495053,_0x5496('0x1a7'),_0x14af8c[_0x5496('0x70')],'+',_0x32c7ca,'=',_0x14af8c['predictiveIntervalAvailable']+_0x32c7ca,')');}};Dialer[_0x5496('0x19')][_0x5496('0x1a2')]=function(_0x10aa35){var _0x2a4122=this;return function(_0x37a9ae){return new BPromise(function(_0x15e9da,_0x46fb1d){_[_0x5496('0x8f')](_0x10aa35,_0x37a9ae[0x0]);if(checkGetDataPredictive(_0x37a9ae[0x0])){var _0x3cd397=_0x10aa35[_0x5496('0x70')]=_0x10aa35[_0x5496('0x193')]+_0x10aa35[_0x5496('0x4d')];var _0x3258ab=_0x10aa35[_0x5496('0x198')]*0x3c;var _0x3c6ad5=_0x37a9ae[0x0][_0x5496('0x87')]+_0x37a9ae[0x0][_0x5496('0x6a')];var _0x27fb35=(_0x37a9ae[0x0][_0x5496('0x69')]+_0x37a9ae[0x0][_0x5496('0x6b')]+_0x37a9ae[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x37a9ae[0x0]['predictiveIntervalTotalCalls'];_0x10aa35[_0x5496('0x6e')]=_0x27fb35>0x0?_0x27fb35:0x1;switch(_0x10aa35[_0x5496('0x19d')]){case _0x5496('0x19a'):var _0x1a2d3a=_0x10aa35[_0x5496('0x18f')]/0x64;return _0x2a4122[_0x5496('0x1a8')](_0x3cd397,_0x3258ab,_0x3c6ad5,_0x27fb35,_0x1a2d3a)[_0x5496('0xb8')](function(_0x3dcc82){return _0x15e9da(_0x3dcc82);});case'agentBusyFactor':var _0x566410=_0x10aa35[_0x5496('0x18f')]/0x64;return _0x2a4122[_0x5496('0x1a9')](_0x3cd397,_0x3258ab,_0x3c6ad5,_0x27fb35,_0x566410)[_0x5496('0xb8')](function(_0xfac000){return _0x15e9da(_0xfac000);});default:return _0x46fb1d(msgResponse(_0x5496('0x1aa'),_0x5496('0x121'),_0x5496('0x1ab')));}}else{return _0x46fb1d(msgResponse('[getDataPredictive]',_0x5496('0x121'),_0x5496('0x1ac')));}});};};Dialer['prototype'][_0x5496('0x1ad')]=function(_0x33977f){var _0x3a69c5=this;return function(_0x3c703f){return new BPromise(function(_0x4fc72d,_0x67724b){_[_0x5496('0x8f')](_0x33977f,_0x3c703f[0x0]);if(checkGetDataPredictive(_0x3c703f[0x0])){loggerPredictive[_0x5496('0x7f')](JSON[_0x5496('0x44')](_0x3c703f[0x0]));if(_0x33977f[_0x5496('0x19d')]===_0x5496('0x19a')){return _0x3a69c5[_0x5496('0xc6')](_0x33977f['id'])[_0x5496('0xb8')](function(_0x5bd3db){var _0xfbf162=_0x33977f[_0x5496('0x4e')]-_0x5bd3db[0x0]['outboundQueuePauses'];var _0xde7e7=_0x33977f[_0x5496('0x198')]*0x3c;var _0x4b9064=_0x3c703f[0x0]['predictiveIntervalAvgTalktime']+_0x3c703f[0x0][_0x5496('0x6a')];var _0x4ef147=(_0x3c703f[0x0][_0x5496('0x69')]+_0x3c703f[0x0][_0x5496('0x6b')]+_0x3c703f[0x0][_0x5496('0x1ae')])/_0x3c703f[0x0]['predictiveIntervalTotalCalls'];var _0x46723d=_0x33977f[_0x5496('0x18f')]/0x64;_0x33977f[_0x5496('0x1af')]=_0x5bd3db[0x0][_0x5496('0x1b0')]||0x0;_0x33977f[_0x5496('0x6e')]=_0x4ef147>0x0?_0x4ef147:0x1;return _0x3a69c5[_0x5496('0x1a8')](_0xfbf162,_0xde7e7,_0x4b9064,_0x4ef147,_0x46723d);})[_0x5496('0xb8')](function(_0x4efeae){return _0x4fc72d(_0x4efeae);})[_0x5496('0xbb')](function(_0x35ffe5){return _0x67724b(msgResponse(_0x5496('0x1b1'),'Failure',JSON['stringify'](_0x35ffe5)));});}if(_0x33977f[_0x5496('0x19d')]===_0x5496('0x1b2')){return _0x3a69c5[_0x5496('0xc6')](_0x33977f['id'])[_0x5496('0xb8')](function(_0x1d841b){var _0x18fdbb=_0x33977f[_0x5496('0x4e')]-_0x1d841b[0x0][_0x5496('0x1b0')];var _0x3e2c0e=_0x33977f['dialPredictiveInterval']*0x3c;var _0x34e243=_0x3c703f[0x0]['predictiveIntervalAvgTalktime']+_0x3c703f[0x0][_0x5496('0x6a')];var _0x2cab15=(_0x3c703f[0x0][_0x5496('0x69')]+_0x3c703f[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x3c703f[0x0][_0x5496('0x1ae')])/_0x3c703f[0x0][_0x5496('0x71')];var _0x2294c0=_0x33977f[_0x5496('0x18f')]/0x64;_0x33977f['predictiveIntervalPauses']=_0x1d841b[0x0]['outboundQueuePauses']||0x0;_0x33977f['predictiveIntervalHitRate']=_0x2cab15>0x0?_0x2cab15:0x1;return _0x3a69c5[_0x5496('0x1a9')](_0x18fdbb,_0x3e2c0e,_0x34e243,_0x2cab15,_0x2294c0);})[_0x5496('0xb8')](function(_0x5b3cfe){return _0x4fc72d(_0x5b3cfe);})[_0x5496('0xbb')](function(_0x1b55c4){return _0x67724b(msgResponse(_0x5496('0x1b1'),'Failure',JSON['stringify'](_0x1b55c4)));});}}else{return _0x67724b(msgResponse(_0x5496('0x1aa'),_0x5496('0x121'),_0x5496('0x1ac')));}});};};Dialer[_0x5496('0x19')][_0x5496('0x1a3')]=function(_0xaee971){var _0x1e318a=this;return function(){var _0x441e37=0x0;var _0x3b7894=Math[_0x5496('0x194')](_0xaee971[_0x5496('0x74')]*0x3e8);if(_0x3b7894>0x0){_0x3b7894=_0x3b7894<0x64?0x64:_0x3b7894;loggerPredictive[_0x5496('0x7f')](_0xaee971[_0x5496('0x3d')],_0x5496('0x1b3'),_0x3b7894,_0x5496('0x45'));_0xaee971[_0x5496('0x93')]=setInterval(function(){_0x1e318a[_0x5496('0x93')](_0xaee971);loggerPredictiveCalls[_0x5496('0x7f')](_0x5496('0x1b4'),_0x441e37+=0x1);},_0x3b7894);}else{loggerPredictive[_0x5496('0x7f')](_0xaee971['name'],_0x5496('0x1b5'));}};};Dialer[_0x5496('0x19')][_0x5496('0x1b6')]=function(_0x2f73e4,_0x542560){var _0x49cf24=this;return function(_0x2b7c55){if(_[_0x5496('0x41')](_0x2b7c55)){if(_['isNil'](_0x542560['UserId'])||!_0x542560[_0x5496('0x1b7')]){if(_0x2f73e4['dialMethod']==='booked'){_0x2f73e4[_0x5496('0x10a')]=_['isUndefined'](_0x2f73e4[_0x5496('0x10a')])?!![]:_0x2f73e4[_0x5496('0x10a')];var _0x3f8657=uuid['v4']();_0x49cf24[_0x5496('0xae')][_0x3f8657]=new Action(_0x2f73e4,_0x542560,_0x3f8657);loggerBooked[_0x5496('0x7f')](_0x5496('0x1b8'),_0x3f8657,_0x5496('0x1b9'),JSON[_0x5496('0x44')](_0x2f73e4[_0x5496('0x10a')]),_0x5496('0x1ba'),_0x2f73e4[_0x5496('0x3d')]);if(_0x2f73e4[_0x5496('0x10a')]){_0x2f73e4['queueStatusComplete']=![];_0x49cf24[_0x5496('0x26')][_0x49cf24[_0x5496('0xae')][_0x3f8657][_0x5496('0xb4')]]=[];ami[_0x5496('0xb0')]({'actionid':_0x3f8657,'action':_0x5496('0x1bb'),'queue':_0x2f73e4[_0x5496('0x3d')]})[_0x5496('0xbb')](function(_0x1405d6){_0x49cf24[_0x5496('0xb2')](_0x2f73e4);_0x49cf24[_0x5496('0xc1')]({'active':![],'ContactId':_0x49cf24[_0x5496('0xae')][_0x3f8657][_0x5496('0x110')],'ListId':_0x49cf24['actions'][_0x3f8657][_0x5496('0xcf')],'VoiceQueueId':_0x49cf24[_0x5496('0xae')][_0x3f8657][_0x5496('0xd1')]||undefined,'CampaignId':_0x49cf24[_0x5496('0xae')][_0x3f8657]['CampaignId']||undefined})[_0x5496('0xbb')](loggerCatch(_0x5496('0x1bc')));delete _0x49cf24[_0x5496('0xae')][_0x3f8657];});}else{loggerBooked[_0x5496('0x7f')]('[booked][checkContactBlack][else]',JSON[_0x5496('0x44')](_0x2f73e4[_0x5496('0x10a')]),'Queue:\x20',_0x2f73e4[_0x5496('0x3d')]);_0x49cf24[_0x5496('0xb2')](_0x2f73e4);_0x49cf24[_0x5496('0xc1')]({'active':![],'ContactId':_0x49cf24[_0x5496('0xae')][_0x3f8657]['ContactId'],'ListId':_0x49cf24[_0x5496('0xae')][_0x3f8657][_0x5496('0xcf')],'VoiceQueueId':_0x49cf24[_0x5496('0xae')][_0x3f8657][_0x5496('0xd1')]||undefined,'CampaignId':_0x49cf24[_0x5496('0xae')][_0x3f8657][_0x5496('0x11a')]||undefined})[_0x5496('0xbb')](loggerCatch(_0x5496('0x1bc')));delete _0x49cf24[_0x5496('0xae')][_0x3f8657];}}else{return _0x49cf24[_0x5496('0x141')](_0x2f73e4,_0x542560);}}else{if(getDiff(_0x542560['scheduledat'])<_0x2f73e4['dialRecallMeTimeout']*0x3c){_0x49cf24[_0x5496('0x1e')][_0x5496('0x10e')](_0x542560['id'])[_0x5496('0x1c')](function(){_0x49cf24[_0x5496('0xb2')](_0x2f73e4);});}else{_0x2f73e4[_0x5496('0x66')]+=0x1;_0x49cf24['updateOriginated'](_0x2f73e4);if(_0x2f73e4[_0x5496('0x1bd')]){_0x49cf24[_0x5496('0xc1')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x542560[_0x5496('0x110')],'ListId':_0x542560[_0x5496('0xcf')],'VoiceQueueId':_0x542560[_0x5496('0xd1')]||undefined,'CampaignId':_0x542560[_0x5496('0x11a')]||undefined})[_0x5496('0xbb')](loggerCatch(_0x5496('0x1be')));_0x49cf24[_0x5496('0xca')](createObjHistory(_0x2f73e4,_0x542560,_0x5496('0x1bf'),0x17,'RecallInQueue'))[_0x5496('0xbb')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x49cf24[_0x5496('0xcd')](createObjHistory(_0x2f73e4,_0x542560,_0x5496('0x1c0'),0x16,_0x5496('0x1c1')),_0x5496('0x1c2'),_0x5496('0x1c3'));}}}}else{_0x2f73e4['outboundBlacklistCallsDay']+=0x1;_0x49cf24[_0x5496('0xcd')](createObjHistory(_0x2f73e4,_0x542560,_0x5496('0x1c4'),0xd,'Blacklist'),_0x5496('0x1c5'),_0x5496('0x1c6'));throw _0x5496('0x1c7');}};};Dialer[_0x5496('0x19')][_0x5496('0x1c8')]=function(_0x1ea9c7){var _0x16224d=this;var _0x195896=[];var _0x25f40b=_0x1ea9c7[_0x5496('0x1c9')]-_0x1ea9c7[_0x5496('0x72')]-_0x1ea9c7[_0x5496('0x1ca')];emitCampaignSummary(_0x1ea9c7);if(_0x25f40b>0x0){if(_0x25f40b>this['maxNumberOriginate']){_0x25f40b=this['maxNumberOriginate'];}_0x1ea9c7['temp']+=_0x25f40b;this[_0x5496('0xc5')](_0x1ea9c7['id'],_0x25f40b,_0x1ea9c7[_0x5496('0x1cb')])[_0x5496('0xb8')](function(_0x559704){_0x1ea9c7['temp']-=_0x25f40b;_0x1ea9c7[_0x5496('0x1ca')]=_0x1ea9c7[_0x5496('0x1ca')]>0x0?_0x1ea9c7[_0x5496('0x1ca')]:0x0;if(!checkContactEmpty(_0x559704)){_0x1ea9c7[_0x5496('0x39')]=_0x5496('0x1cc');logger['info'](_0x5496('0x1cd')+_0x1ea9c7[_0x5496('0x3d')]);}else{_0x1ea9c7[_0x5496('0x72')]+=_0x559704[_0x5496('0x9b')];_0x1ea9c7[_0x5496('0x39')]='RUNNING';for(var _0x195d01=0x0;_0x195d01<_0x559704[_0x5496('0x9b')];_0x195d01+=0x1){_0x1ea9c7[_0x5496('0x1ce')]+=0x1;if(_[_0x5496('0xd8')](_0x559704[_0x195d01])||_[_0x5496('0xd8')](_0x559704[_0x195d01][_0x5496('0x145')])||_[_0x5496('0xd8')](_0x559704[_0x195d01]['Contact'][_0x5496('0x144')])){_0x16224d[_0x5496('0x1cf')]('[actionOriginate]\x20',_0x1ea9c7,_0x559704[_0x195d01]);}else{_0x16224d[_0x5496('0xbd')](_[_0x5496('0xce')](_0x559704[_0x195d01],['CampaignId',_0x5496('0x1d0')]))[_0x5496('0xb8')](_0x16224d['checkContactBlack'](_0x1ea9c7,_0x559704[_0x195d01]))[_0x5496('0xbb')](_0x16224d['loggerHandler'](_0x5496('0x1d1'),_0x1ea9c7));}}}})[_0x5496('0xbb')](loggerGetContactDialer(_0x5496('0x1d2'),_0x1ea9c7,_0x25f40b));}};Dialer[_0x5496('0x19')][_0x5496('0x133')]=function(_0x36815e,_0x5134b6){var _0x47d6ab=this;var _0xe46e68=[];var _0x34eca3=_0x5134b6>=0x1?_0x5134b6:0x1;var _0x4fd3a3=[];if(_0x36815e[_0x5496('0x138')]===_0x5496('0x6')){_0x34eca3=0x1;}var _0x53d12f=Math[_0x5496('0x194')](_0x36815e['available']*_0x34eca3)-_0x36815e[_0x5496('0x72')]-_0x36815e['temp'];emitVoiceQueueSummary(_0x36815e);if(_0x36815e['dialLimitQueue']>0x0){var _0x18e673=_0x36815e[_0x5496('0x1d3')]-_0x36815e['originated']-_0x36815e['talking']-_0x36815e['temp']-_0x36815e[_0x5496('0x4f')];if(_0x53d12f>_0x18e673){_0x53d12f=_0x18e673;}}if(_0x53d12f>0x0){if(_0x36815e[_0x5496('0x138')]===_0x5496('0x6')){_0x53d12f=0x1;}if(_0x53d12f>this[_0x5496('0x22')]){_0x53d12f=this[_0x5496('0x22')];}_0x36815e['temp']+=_0x53d12f;for(var _0x5829e5 in this[_0x5496('0x106')]){if(this[_0x5496('0x106')][_0x5496('0x9c')](_0x5829e5)){if(this[_0x5496('0x106')][_0x5829e5][_0x5496('0xa8')]===_0x5496('0x1d4')&&this[_0x5496('0x106')][_0x5829e5][_0x5496('0xd6')]===_0x5496('0xd7')){_0xe46e68[_0x5496('0x108')](this['agents'][_0x5829e5]['id']);}}}this[_0x5496('0xc3')](_0x36815e['id'],_0xe46e68,_0x53d12f,_0x36815e[_0x5496('0x1cb')])['then'](function(_0xc86ab1){_0x36815e[_0x5496('0x1ca')]-=_0x53d12f;_0x36815e['temp']=_0x36815e[_0x5496('0x1ca')]>0x0?_0x36815e[_0x5496('0x1ca')]:0x0;if(!checkContactEmpty(_0xc86ab1)){_0x47d6ab[_0x5496('0xb6')](_0x36815e)[_0x5496('0xb8')](sendMessageReschedule(_0x36815e))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x36815e['originated']+=_0xc86ab1[_0x5496('0x9b')];_0x36815e[_0x5496('0x39')]=_0x36815e['dialMethod']===_0x5496('0x6')?'ACTIVE':_0x5496('0x1d5');for(var _0x37be38=0x0;_0x37be38<_0xc86ab1[_0x5496('0x9b')];_0x37be38+=0x1){if(_['isNil'](_0xc86ab1[_0x37be38])||_[_0x5496('0xd8')](_0xc86ab1[_0x37be38][_0x5496('0x145')])||_['isNil'](_0xc86ab1[_0x37be38]['Contact'][_0x5496('0x144')])){_0x47d6ab[_0x5496('0x1cf')]('[actionOriginate]\x20',_0x36815e,_0xc86ab1[_0x37be38]);}else{_0x47d6ab[_0x5496('0xba')](_[_0x5496('0xce')](_0xc86ab1[_0x37be38],[_0x5496('0xd1'),_0x5496('0x1d0')]))['then'](_0x47d6ab['checkContactBlack'](_0x36815e,_0xc86ab1[_0x37be38]))[_0x5496('0xbb')](_0x47d6ab[_0x5496('0xcc')]('[actionOriginate]\x20',_0x36815e));}}}})[_0x5496('0xbb')](loggerGetContactDialer(_0x5496('0x1d6'),_0x36815e,_0x53d12f));}};Dialer['prototype'][_0x5496('0x93')]=function(_0x2ced6b){var _0x3ba636=this;if(_0x2ced6b[_0x5496('0x1d3')]>0x0){var _0x1e9098=_0x2ced6b[_0x5496('0x1d3')]-_0x2ced6b['originated']-_0x2ced6b[_0x5496('0x193')];if(_0x1e9098>0x0){this[_0x5496('0x1d7')](_0x2ced6b);}else{loggerPredictiveCalls[_0x5496('0x7f')]('[handlePredictive][limitChannel]');}}else{this[_0x5496('0x1d7')](_0x2ced6b);}};Dialer[_0x5496('0x19')][_0x5496('0x1d7')]=function(_0x406ec1){var _0x11770d=this;var _0x30515f=[];_0x406ec1[_0x5496('0x72')]+=0x1;for(var _0x4ad7f0 in this[_0x5496('0x106')]){if(this[_0x5496('0x106')]['hasOwnProperty'](_0x4ad7f0)){if(this[_0x5496('0x106')][_0x4ad7f0]['state']===_0x5496('0x1d4')&&this[_0x5496('0x106')][_0x4ad7f0][_0x5496('0xd6')]==='reachable'){_0x30515f[_0x5496('0x108')](this[_0x5496('0x106')][_0x4ad7f0]['id']);}}}this[_0x5496('0xc3')](_0x406ec1['id'],_0x30515f,0x1,_0x406ec1['dialOrderByScheduledAt'])[_0x5496('0xb8')](function(_0x574488){if(!checkContactEmpty(_0x574488)){checkContactLowerLimitOriginate(_0x406ec1,0x1,0x0);_0x11770d['countReScheduled'](_0x406ec1)[_0x5496('0xb8')](sendMessageReschedule(_0x406ec1))[_0x5496('0xbb')](loggerCatch(_0x5496('0xb9')));}else{_0x406ec1[_0x5496('0x39')]=_0x5496('0x1d5');if(_[_0x5496('0xd8')](_0x574488[0x0])||_['isNil'](_0x574488[0x0]['Contact'])||_[_0x5496('0xd8')](_0x574488[0x0]['Contact'][_0x5496('0x144')])){_0x11770d[_0x5496('0x1cf')](_0x5496('0x1d8'),_0x406ec1,_0x574488[0x0]);}else{_0x11770d[_0x5496('0xba')](_[_0x5496('0xce')](_0x574488[0x0],['VoiceQueueId','Contact.phone']))[_0x5496('0xb8')](_0x11770d[_0x5496('0x1b6')](_0x406ec1,_0x574488[0x0]))[_0x5496('0xbb')](_0x11770d[_0x5496('0xcc')](_0x5496('0x1d9'),_0x406ec1));}}})[_0x5496('0xbb')](loggerGetContactDialer(_0x5496('0x1da'),_0x406ec1,0x1));emitVoiceQueueSummary(_0x406ec1);};Dialer['prototype'][_0x5496('0x1a8')]=function(_0x14f48a,_0x8011dc,_0x17a764,_0x4d0bec,_0x15b612,_0x5934f2){loggerPredictive[_0x5496('0x7f')](_0x5496('0x1db'));loggerPredictive[_0x5496('0x7f')]('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x14f48a);loggerPredictive['info']('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x8011dc);loggerPredictive[_0x5496('0x7f')](_0x5496('0x1dc'),_0x17a764);loggerPredictive[_0x5496('0x7f')](_0x5496('0x1dd'),_0x4d0bec);loggerPredictive[_0x5496('0x7f')](_0x5496('0x1de'),_0x15b612);loggerPredictive['info'](_0x5496('0x85'));return new BPromise(function(_0x138f17,_0x598b24){if(_0x14f48a<=0x0||isNaN(_0x14f48a)){return _0x598b24(msgResponse(_0x5496('0x1df'),_0x5496('0x43'),_0x5496('0x1e0')+_0x14f48a));}if(_0x17a764<=0x0||isNaN(_0x17a764)){return _0x598b24(msgResponse(_0x5496('0x1df'),'Error',_0x5496('0x1e1')+_0x17a764));}if(_0x4d0bec<=0x0||isNaN(_0x4d0bec)){return _0x598b24(msgResponse(_0x5496('0x1df'),_0x5496('0x43'),_0x5496('0x1e2')+_0x4d0bec));}if(_0x8011dc<=0x0||isNaN(_0x8011dc)){return _0x598b24(msgResponse(_0x5496('0x1df'),_0x5496('0x43'),_0x5496('0x1e3')+_0x8011dc));}if(_0x15b612<=0x0||isNaN(_0x15b612)){return _0x598b24(msgResponse(_0x5496('0x1df'),_0x5496('0x43'),_0x5496('0x1e4')+_0x15b612));}_0x5934f2=_0x5934f2||0x0;var _0x2a6a72=0x1/_0x17a764;var _0x5f0a43=0x0;var _0x3b7dc2=0x0;var _0x39f520=0x0;var _0x595989=0x0;for(var _0x290d06=0x0;_0x39f520<_0x15b612;_0x290d06+=0x1){_0x3b7dc2=_0x290d06/_0x8011dc;_0x5f0a43=(_0x4d0bec*_0x3b7dc2+_0x5934f2)/_0x2a6a72;_0x39f520=erlangb(_0x5f0a43,_0x14f48a);_0x595989=_0x5f0a43/_0x14f48a*(0x1-erlangb(_0x5f0a43,_0x14f48a));}return _0x138f17({'erlangCalls':_0x290d06,'erlangCallToSecond':_0x8011dc/_0x290d06,'erlangAbandonmentRate':_0x39f520,'erlangBusyFactor':_0x595989});});};Dialer[_0x5496('0x19')][_0x5496('0x1a9')]=function(_0x5482f3,_0x2b5f92,_0x3ee188,_0xfc3ffc,_0x17917e,_0x207fc4){loggerPredictive[_0x5496('0x7f')](_0x5496('0x1e5'));loggerPredictive[_0x5496('0x7f')]('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5482f3);loggerPredictive[_0x5496('0x7f')](_0x5496('0x1e6'),_0x2b5f92);loggerPredictive[_0x5496('0x7f')](_0x5496('0x1dc'),_0x3ee188);loggerPredictive[_0x5496('0x7f')](_0x5496('0x1dd'),_0xfc3ffc);loggerPredictive[_0x5496('0x7f')](_0x5496('0x1e7'),_0x17917e);loggerPredictive['info'](_0x5496('0x85'));return new BPromise(function(_0x424206,_0x5810ef){if(_0x5482f3<=0x0||isNaN(_0x5482f3)){return _0x5810ef(msgResponse('[busyFactor]',_0x5496('0x43'),'m\x20=\x20'+_0x5482f3));}if(_0x3ee188<=0x0||isNaN(_0x3ee188)){return _0x5810ef(msgResponse(_0x5496('0x1e8'),_0x5496('0x43'),_0x5496('0x1e1')+_0x3ee188));}if(_0xfc3ffc<=0x0||isNaN(_0xfc3ffc)){return _0x5810ef(msgResponse('[busyFactor]','Error',_0x5496('0x1e2')+_0xfc3ffc));}if(_0x2b5f92<=0x0||isNaN(_0x2b5f92)){return _0x5810ef(msgResponse(_0x5496('0x1e8'),_0x5496('0x43'),_0x5496('0x1e3')+_0x2b5f92));}if(_0x17917e<=0x0||isNaN(_0x17917e)){return _0x5810ef(msgResponse('[busyFactor]',_0x5496('0x43'),'Umin\x20=\x20'+_0x17917e));}_0x207fc4=_0x207fc4||0x0;var _0x19fd29=0x1/_0x3ee188;var _0x461f48=0x0;var _0x11d850=0x0;var _0x242c95=0x0;var _0x12cb45=0x0;for(var _0x27e139=0x0;_0x12cb45<_0x17917e;_0x27e139+=0x1){_0x11d850=_0x27e139/_0x2b5f92;_0x461f48=(_0xfc3ffc*_0x11d850+_0x207fc4)/_0x19fd29;_0x242c95=erlangb(_0x461f48,_0x5482f3);_0x12cb45=_0x461f48/_0x5482f3*(0x1-erlangb(_0x461f48,_0x5482f3));}return _0x424206({'erlangCalls':_0x27e139,'erlangCallToSecond':_0x2b5f92/_0x27e139,'erlangAbandonmentRate':_0x242c95,'erlangBusyFactor':_0x12cb45});});};module[_0x5496('0x1e9')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index fdea175..36f01fe 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 _0x0214=['scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','calleridnum','number','starttime','responsetime','droptime','holdtime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','milliseconds','diff','seconds'];(function(_0xcd640c,_0x5bfefc){var _0x22d335=function(_0x22a5cb){while(--_0x22a5cb){_0xcd640c['push'](_0xcd640c['shift']());}};_0x22d335(++_0x5bfefc);}(_0x0214,0xf0));var _0x4021=function(_0xccd4d3,_0xec2028){_0xccd4d3=_0xccd4d3-0x0;var _0xca752=_0x0214[_0xccd4d3];return _0xca752;};'use strict';var util=require(_0x4021('0x0'));var _=require(_0x4021('0x1'));var moment=require('moment');function getSeconds(_0x52fe88,_0x1aaec0){var _0x3a94ab=moment(_0x52fe88)[_0x4021('0x2')](0x0);var _0x23001a=moment(_0x1aaec0)['milliseconds'](0x0);return _0x3a94ab[_0x4021('0x3')](_0x23001a,_0x4021('0x4'));}function QueueCallerAbandon(_0x8aefc0,_0xfe186c){this['scheduledat']=_0x8aefc0[_0x4021('0x5')];this[_0x4021('0x6')]=_0x8aefc0[_0x4021('0x6')];this['campaigntype']=_0x8aefc0[_0x4021('0x6')]===_0x4021('0x7')?_0x4021('0x8'):_0x8aefc0[_0x4021('0x6')];this[_0x4021('0x9')]=_0x8aefc0[_0x4021('0x9')];this['countcongestionretry']=_0x8aefc0[_0x4021('0xa')];this['countnoanswerretry']=_0x8aefc0[_0x4021('0xb')];this[_0x4021('0xc')]=_0x8aefc0[_0x4021('0x9')]+_0x8aefc0[_0x4021('0xa')]+_0x8aefc0[_0x4021('0xb')];this[_0x4021('0xd')]=_0xfe186c[_0x4021('0xd')];this[_0x4021('0xe')]=_0x8aefc0['name'];this[_0x4021('0xf')]=_0x8aefc0[_0x4021('0x10')];this[_0x4021('0x11')]=_0x8aefc0[_0x4021('0x11')];this[_0x4021('0x12')]=_0x8aefc0['responsetime'];this[_0x4021('0x13')]=_0x8aefc0[_0x4021('0x13')];this['endtime']=this['droptime'];this['ringtime']=getSeconds(_0x8aefc0[_0x4021('0x12')],_0x8aefc0['starttime']);this[_0x4021('0x14')]=getSeconds(this[_0x4021('0x13')],_0x8aefc0[_0x4021('0x12')]);this['talktime']=0x0;this[_0x4021('0x8')]=_0xfe186c[_0x4021('0x8')];this[_0x4021('0x15')]=_0xfe186c[_0x4021('0x16')];this[_0x4021('0x17')]=_0xfe186c[_0x4021('0x17')];this[_0x4021('0x18')]=_0x8aefc0['callback'];this[_0x4021('0x19')]=_0x8aefc0[_0x4021('0x19')];this['callbackat']=_0x8aefc0[_0x4021('0x1a')];this[_0x4021('0x1b')]=_0x8aefc0['recallme'];this[_0x4021('0x1c')]=_0x8aefc0['ContactId'];this[_0x4021('0x1d')]=_0x8aefc0['ListId'];this['UserId']=_0x8aefc0[_0x4021('0x1e')];this[_0x4021('0x1f')]=_0x8aefc0[_0x4021('0x1f')];this[_0x4021('0x20')]=_0x8aefc0['CampaignId'];this['originatecalleridnum']=_0x8aefc0[_0x4021('0x21')]||'';this[_0x4021('0x22')]=_0x8aefc0[_0x4021('0x22')]||'';}module['exports']=QueueCallerAbandon; \ No newline at end of file +var _0xcaa8=['milliseconds','diff','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','name','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','membername','connectedlinename','reason','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','exports','lodash'];(function(_0x45b2c3,_0x4f7b9e){var _0x5079ed=function(_0x39731c){while(--_0x39731c){_0x45b2c3['push'](_0x45b2c3['shift']());}};_0x5079ed(++_0x4f7b9e);}(_0xcaa8,0xd1));var _0x8caa=function(_0x166c90,_0x2bc454){_0x166c90=_0x166c90-0x0;var _0x58be86=_0xcaa8[_0x166c90];return _0x58be86;};'use strict';var util=require('util');var _=require(_0x8caa('0x0'));var moment=require('moment');function getSeconds(_0x459cea,_0x5d871f){var _0x161fbd=moment(_0x459cea)[_0x8caa('0x1')](0x0);var _0x5d3f43=moment(_0x5d871f)['milliseconds'](0x0);return _0x161fbd[_0x8caa('0x2')](_0x5d3f43,'seconds');}function QueueCallerAbandon(_0x45c92a,_0x11adc4){this[_0x8caa('0x3')]=_0x45c92a[_0x8caa('0x3')];this[_0x8caa('0x4')]=_0x45c92a[_0x8caa('0x4')];this['campaigntype']=_0x45c92a[_0x8caa('0x4')]===_0x8caa('0x5')?_0x8caa('0x6'):_0x45c92a[_0x8caa('0x4')];this[_0x8caa('0x7')]=_0x45c92a[_0x8caa('0x7')];this['countcongestionretry']=_0x45c92a[_0x8caa('0x8')];this['countnoanswerretry']=_0x45c92a[_0x8caa('0x9')];this[_0x8caa('0xa')]=_0x45c92a[_0x8caa('0x7')]+_0x45c92a[_0x8caa('0x8')]+_0x45c92a[_0x8caa('0x9')];this['uniqueid']=_0x11adc4[_0x8caa('0xb')];this['calleridname']=_0x45c92a[_0x8caa('0xc')];this[_0x8caa('0xd')]=_0x45c92a[_0x8caa('0xe')];this[_0x8caa('0xf')]=_0x45c92a[_0x8caa('0xf')];this[_0x8caa('0x10')]=_0x45c92a[_0x8caa('0x10')];this['droptime']=_0x45c92a[_0x8caa('0x11')];this[_0x8caa('0x12')]=this[_0x8caa('0x11')];this[_0x8caa('0x13')]=getSeconds(_0x45c92a['responsetime'],_0x45c92a[_0x8caa('0xf')]);this[_0x8caa('0x14')]=getSeconds(this[_0x8caa('0x11')],_0x45c92a['responsetime']);this[_0x8caa('0x15')]=0x0;this[_0x8caa('0x6')]=_0x11adc4[_0x8caa('0x6')];this[_0x8caa('0x16')]=_0x11adc4[_0x8caa('0x17')];this['reason']=_0x11adc4[_0x8caa('0x18')];this['callback']=_0x45c92a['callback'];this['callbackuniqueid']=_0x45c92a[_0x8caa('0x19')];this[_0x8caa('0x1a')]=_0x45c92a[_0x8caa('0x1a')];this[_0x8caa('0x1b')]=_0x45c92a[_0x8caa('0x1b')];this[_0x8caa('0x1c')]=_0x45c92a[_0x8caa('0x1c')];this[_0x8caa('0x1d')]=_0x45c92a['ListId'];this[_0x8caa('0x1e')]=_0x45c92a[_0x8caa('0x1e')];this[_0x8caa('0x1f')]=_0x45c92a[_0x8caa('0x1f')];this['CampaignId']=_0x45c92a['CampaignId'];this['originatecalleridnum']=_0x45c92a[_0x8caa('0x20')]||'';this[_0x8caa('0x21')]=_0x45c92a['originatecalleridname']||'';}module[_0x8caa('0x22')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 02fed10..ed8325d 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 _0x161c=['format','%s/%s/%s','tech','fax','localstationid','headerinfo','path','exports','util','moment','channel'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x161c,0x189));var _0xc161=function(_0xe799d6,_0x29d0fc){_0xe799d6=_0xe799d6-0x0;var _0x77e6e=_0x161c[_0xe799d6];return _0x77e6e;};'use strict';var util=require(_0xc161('0x0'));var _=require('lodash');var moment=require(_0xc161('0x1'));function Action(_0x3f6b54,_0x1598cd,_0x39dd15){this['uniqueid']=_0x3f6b54||undefined;this[_0xc161('0x2')]=util[_0xc161('0x3')](_0xc161('0x4'),_0x1598cd[_0xc161('0x5')],_0x1598cd['Trunk']['name'],_0x39dd15[_0xc161('0x6')]);this[_0xc161('0x7')]=_0x1598cd[_0xc161('0x7')];this[_0xc161('0x8')]=_0x1598cd[_0xc161('0x8')];this[_0xc161('0x9')]=_0x39dd15['path'];this['AttachmentId']=_0x39dd15['AttachmentId'];}module[_0xc161('0xa')]=Action; \ No newline at end of file +var _0x75f5=['path','AttachmentId','exports','util','moment','channel','format','%s/%s/%s','name','localstationid','headerinfo'];(function(_0x4ba328,_0x4fd2fd){var _0x3fbd12=function(_0x8c0025){while(--_0x8c0025){_0x4ba328['push'](_0x4ba328['shift']());}};_0x3fbd12(++_0x4fd2fd);}(_0x75f5,0x1a5));var _0x575f=function(_0x212721,_0x1c0edc){_0x212721=_0x212721-0x0;var _0x369f08=_0x75f5[_0x212721];return _0x369f08;};'use strict';var util=require(_0x575f('0x0'));var _=require('lodash');var moment=require(_0x575f('0x1'));function Action(_0x36f1fc,_0x12a3fc,_0x14494d){this['uniqueid']=_0x36f1fc||undefined;this[_0x575f('0x2')]=util[_0x575f('0x3')](_0x575f('0x4'),_0x12a3fc['tech'],_0x12a3fc['Trunk'][_0x575f('0x5')],_0x14494d['fax']);this[_0x575f('0x6')]=_0x12a3fc[_0x575f('0x6')];this[_0x575f('0x7')]=_0x12a3fc['headerinfo'];this[_0x575f('0x8')]=_0x14494d[_0x575f('0x8')];this[_0x575f('0x9')]=_0x14494d[_0x575f('0x9')];}module[_0x575f('0xa')]=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index a39a045..34f6223 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 _0xfefa=['reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','lodash','bluebird','uuid','path','tiff2pdf','../../../config/logger','fax','./rpcDb','./channel','./util/util','../rpc/attachment','channels','faxAccounts','trunks','newchannel','syncNewchannel','syncVarSet','bind','newstate','syncNewState','faxstatus','syncFaxStatus','syncReceiveFax','syncHangup','prototype','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','\x20syncNewchannel\x20','info','variable','value','channelstatedesc','syncNewExten','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','notify','.pdf','catch','error','\x20notify\x20','\x20receiveFax\x20','stringify','pick','response','reason','update','AttachmentId','then','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','actions','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','SENDING\x20FAILED:\x20','faxstatusstring','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','ext','isTrunkReachable','isNil','active','SIP/%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfefa,0x71));var _0xafef=function(_0x313d07,_0x4342e8){_0x313d07=_0x313d07-0x0;var _0x3bf5bb=_0xfefa[_0x313d07];return _0x3bf5bb;};'use strict';var util=require('util');var _=require(_0xafef('0x0'));var BPromise=require(_0xafef('0x1'));var uuid=require(_0xafef('0x2'));var moment=require('moment');var path=require(_0xafef('0x3'));var tiff2pdf=require(_0xafef('0x4'));var gs=require('./util/gs');var logger=require(_0xafef('0x5'))(_0xafef('0x6'));var ami=require('../ami');var rpcDb=require(_0xafef('0x7'));var Channel=require(_0xafef('0x8'));var ut=require(_0xafef('0x9'));var Action=require('./action');var faxAccount=require('../rpc/faxAccount');var attachment=require(_0xafef('0xa'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x1c5607){this[_0xafef('0xb')]={};this[_0xafef('0xc')]=_0x1c5607[_0xafef('0xc')];this[_0xafef('0xd')]=_0x1c5607[_0xafef('0xd')];this['actions']={};ami['on'](_0xafef('0xe'),this[_0xafef('0xf')]['bind'](this));ami['on']('varset',this[_0xafef('0x10')][_0xafef('0x11')](this));ami['on'](_0xafef('0x12'),this[_0xafef('0x13')][_0xafef('0x11')](this));ami['on']('newexten',this['syncNewExten'][_0xafef('0x11')](this));ami['on'](_0xafef('0x14'),this[_0xafef('0x15')][_0xafef('0x11')](this));ami['on']('receivefax',this[_0xafef('0x16')][_0xafef('0x11')](this));ami['on']('hangup',this[_0xafef('0x17')][_0xafef('0x11')](this));ami['on']('originateresponse',this['syncOriginateResponse']['bind'](this));}Fax[_0xafef('0x18')][_0xafef('0xf')]=function(_0x3b3183){if(_0x3b3183[_0xafef('0x19')]===_0xafef('0x1a')){for(var _0x3bd59b in this[_0xafef('0xc')]){if(this[_0xafef('0xc')][_0xafef('0x1b')](_0x3bd59b)){if(_0x3b3183[_0xafef('0x1c')]===this[_0xafef('0xc')][_0x3bd59b][_0xafef('0x1d')]){this['channels'][_0x3b3183[_0xafef('0x1e')]]={};this[_0xafef('0xb')][_0x3b3183[_0xafef('0x1e')]][_0xafef('0x1f')]=_0x3b3183[_0xafef('0x1f')];this[_0xafef('0xb')][_0x3b3183[_0xafef('0x1e')]]['id']=this[_0xafef('0xc')][_0x3bd59b]['id'];this[_0xafef('0xb')][_0x3b3183['uniqueid']][_0xafef('0x20')]=this['faxAccounts'][_0x3bd59b][_0xafef('0x20')];logger['info'](_0x3b3183[_0xafef('0x1e')],_0xafef('0x21'));}}}}if(this['actions'][_0x3b3183[_0xafef('0x1e')]]){this[_0xafef('0xb')][_0x3b3183[_0xafef('0x1e')]]={};this[_0xafef('0xb')][_0x3b3183[_0xafef('0x1e')]][_0xafef('0x1f')]=_0x3b3183[_0xafef('0x1f')];logger[_0xafef('0x22')](_0x3b3183[_0xafef('0x1e')],_0xafef('0x21'));}};Fax[_0xafef('0x18')][_0xafef('0x10')]=function(_0x24bc04){if(this[_0xafef('0xb')][_0x24bc04[_0xafef('0x1e')]]){for(var _0xdeb137 in _0x24bc04[_0xafef('0x23')]){if(_0x24bc04[_0xafef('0x23')][_0xafef('0x1b')](_0xdeb137)){this['channels'][_0x24bc04[_0xafef('0x1e')]][_0xdeb137]=_0x24bc04[_0xafef('0x24')];}}}};Fax[_0xafef('0x18')][_0xafef('0x13')]=function(_0x1e600b){if(this['channels'][_0x1e600b[_0xafef('0x1e')]]){this[_0xafef('0xb')][_0x1e600b[_0xafef('0x1e')]]['channelstate']=_0x1e600b['channelstate'];this[_0xafef('0xb')][_0x1e600b[_0xafef('0x1e')]][_0xafef('0x25')]=_0x1e600b['channelstatedesc'];}};Fax[_0xafef('0x18')][_0xafef('0x26')]=function(_0x145a09){if(this[_0xafef('0xb')][_0x145a09[_0xafef('0x1e')]]){for(var _0x376341 in _0x145a09[_0xafef('0x23')]){if(_0x145a09[_0xafef('0x23')][_0xafef('0x1b')](_0x376341)){this[_0xafef('0xb')][_0x145a09['uniqueid']][_0x376341]=_0x145a09[_0xafef('0x24')];}}}};Fax[_0xafef('0x18')][_0xafef('0x15')]=function(_0x34626b){if(this[_0xafef('0xb')][_0x34626b[_0xafef('0x1e')]]){this[_0xafef('0xb')][_0x34626b[_0xafef('0x1e')]][_0xafef('0x27')]=_0x34626b[_0xafef('0x27')];this[_0xafef('0xb')][_0x34626b[_0xafef('0x1e')]]['status']=_0x34626b[_0xafef('0x28')];this[_0xafef('0xb')][_0x34626b['uniqueid']][_0xafef('0x1d')]=_0x34626b[_0xafef('0x1d')];this[_0xafef('0xb')][_0x34626b[_0xafef('0x1e')]][_0xafef('0x29')]=_0x34626b[_0xafef('0x29')];logger[_0xafef('0x22')](_0x34626b[_0xafef('0x1e')],_0xafef('0x2a'));}};Fax[_0xafef('0x18')]['syncReceiveFax']=function(_0x1e1801){var _0x23cd8f=this;if(this[_0xafef('0xb')][_0x1e1801[_0xafef('0x1e')]]){var _0x938621=this[_0xafef('0xb')][_0x1e1801[_0xafef('0x1e')]]['id'];this[_0xafef('0xb')][_0x1e1801[_0xafef('0x1e')]][_0xafef('0x2b')]=_0x1e1801[_0xafef('0x2b')];this[_0xafef('0xb')][_0x1e1801[_0xafef('0x1e')]][_0xafef('0x2c')]=_0x1e1801[_0xafef('0x2c')];this[_0xafef('0xb')][_0x1e1801[_0xafef('0x1e')]][_0xafef('0x1d')]=_0x1e1801[_0xafef('0x1d')];this[_0xafef('0xb')][_0x1e1801[_0xafef('0x1e')]][_0xafef('0x2d')]=_0x1e1801['resolution'];this[_0xafef('0xb')][_0x1e1801['uniqueid']][_0xafef('0x2e')]=_0x1e1801[_0xafef('0x2e')];this[_0xafef('0xb')][_0x1e1801[_0xafef('0x1e')]][_0xafef('0x29')]=_0x1e1801[_0xafef('0x29')];this[_0xafef('0xb')][_0x1e1801[_0xafef('0x1e')]][_0xafef('0x2f')]=_0x1e1801['calleridnum'];if(this[_0xafef('0xb')][_0x1e1801[_0xafef('0x1e')]][_0xafef('0x2c')]>0x0){tiff2pdf(_0x1e1801[_0xafef('0x29')],_0xafef('0x30'),function(_0x3572ed){logger[_0xafef('0x22')](_0x1e1801[_0xafef('0x1e')],_0xafef('0x31'),_0x3572ed[_0xafef('0x32')]);attachment[_0xafef('0x33')]({'name':path[_0xafef('0x34')](_0x1e1801[_0xafef('0x29')])['name'],'basename':path[_0xafef('0x34')](_0x1e1801[_0xafef('0x29')])[_0xafef('0x20')]+'.pdf','type':'application/pdf'})['then'](function(_0x1f26bb){faxAccount[_0xafef('0x35')](_0x938621,{'from':_0x1e1801[_0xafef('0x2f')],'mapKey':_0xafef('0x6'),'body':path[_0xafef('0x34')](_0x1e1801[_0xafef('0x29')])['name']+_0xafef('0x36'),'AttachmentId':_0x1f26bb['id']})[_0xafef('0x37')](function(_0x2c3926){logger[_0xafef('0x38')](_0x1e1801[_0xafef('0x1e')],_0xafef('0x39'),JSON['stringify'](_0x2c3926));});})[_0xafef('0x37')](function(_0x432b00){logger[_0xafef('0x38')](_0x1e1801[_0xafef('0x1e')],_0xafef('0x3a'),JSON[_0xafef('0x3b')](_0x432b00));});});}logger[_0xafef('0x22')](_0x1e1801[_0xafef('0x1e')],_0xafef('0x3a'));}};Fax[_0xafef('0x18')]['syncOriginateResponse']=function(_0x235152){if(this['actions'][_0x235152[_0xafef('0x1e')]]){_['merge'](this['channels'][_0x235152[_0xafef('0x1e')]],_[_0xafef('0x3c')](_0x235152,[_0xafef('0x3d'),_0xafef('0x3e')]));}};function updateStatus(_0x14d25c){if(_0x14d25c['AttachmentId']){faxMessage[_0xafef('0x3f')](_0x14d25c[_0xafef('0x40')],{'failMessage':'SENDING\x20FAILED\x20'})[_0xafef('0x41')](function(_0x2d1373){ut[_0xafef('0x42')]('[Fax][Message][Error][Updated]',_0x2d1373);})[_0xafef('0x37')](function(_0x4edf5e){ut[_0xafef('0x42')](_0xafef('0x43'),_0x4edf5e);});}else{ut[_0xafef('0x42')](_0xafef('0x44'));}}Fax[_0xafef('0x18')][_0xafef('0x45')]=function(_0x4d834f,_0x3feaca,_0x342eb2){var _0xfd6699=this;var _0x5b500f={};if(_0x3feaca){_0x5b500f={'read':_0x3feaca};}else{_0x5b500f={'failMessage':_0x342eb2};}if(this[_0xafef('0x46')][_0x4d834f]['AttachmentId']){faxMessage['update'](this[_0xafef('0x46')][_0x4d834f][_0xafef('0x40')],_0x5b500f)['then'](function(_0x369bd7){ut[_0xafef('0x42')]('[Fax][Message][Updated]',_0x369bd7);})[_0xafef('0x37')](function(_0x53dc8e){ut[_0xafef('0x42')]('[Fax][Message][NoUpdate1]',_0x53dc8e);})['finally'](function(){delete _0xfd6699[_0xafef('0xb')][_0x4d834f];delete _0xfd6699['actions'][_0x4d834f];});}else{ut[_0xafef('0x42')](_0xafef('0x47'));delete this[_0xafef('0xb')][_0x4d834f];delete this['actions'][_0x4d834f];}};Fax[_0xafef('0x18')][_0xafef('0x17')]=function(_0x332dab){var _0x47e080=this;if(this[_0xafef('0xb')][_0x332dab[_0xafef('0x1e')]]){if(this[_0xafef('0x46')][_0x332dab[_0xafef('0x1e')]]){this[_0xafef('0xb')][_0x332dab['uniqueid']]['id']=this[_0xafef('0x46')][_0x332dab[_0xafef('0x1e')]]['id'];this['channels'][_0x332dab[_0xafef('0x1e')]][_0xafef('0x20')]=this[_0xafef('0x46')][_0x332dab[_0xafef('0x1e')]][_0xafef('0x20')];}logger[_0xafef('0x22')](_0x332dab[_0xafef('0x1e')],this['actions'][_0x332dab[_0xafef('0x1e')]]?_0xafef('0x48'):'\x20hangup\x20faxRiceive\x20',JSON[_0xafef('0x3b')](this[_0xafef('0xb')][_0x332dab[_0xafef('0x1e')]]));if(this[_0xafef('0x46')][_0x332dab[_0xafef('0x1e')]]){if(this[_0xafef('0xb')][_0x332dab['uniqueid']]['faxpages']>0x0&&this[_0xafef('0xb')][_0x332dab[_0xafef('0x1e')]][_0xafef('0x14')]==='SUCCESS'){this['updateStatus'](_0x332dab[_0xafef('0x1e')],!![]);}else{this['updateStatus'](_0x332dab[_0xafef('0x1e')],![],this[_0xafef('0xb')][_0x332dab[_0xafef('0x1e')]]['faxstatusstring']?_0xafef('0x49')+this[_0xafef('0xb')][_0x332dab[_0xafef('0x1e')]][_0xafef('0x4a')]:_0xafef('0x4b'));}}}};Fax[_0xafef('0x18')][_0xafef('0x4c')]=function(_0x5cc5cf){var _0x50b80e=this;return new BPromise(function(_0x3e9ea3,_0x5f2082){_0x50b80e[_0xafef('0x4d')](_0x5cc5cf,_0x50b80e['faxAccounts'][_0x5cc5cf[_0xafef('0x4e')]])['then'](function(_0xccadd4){ut[_0xafef('0x42')](_0xafef('0x4f'),_0xccadd4);_0x3e9ea3(ut[_0xafef('0x32')]('Fax\x20received'));})[_0xafef('0x37')](function(_0x13ceeb){ut[_0xafef('0x42')]('[Fax][execOriginate][failure]',_0x13ceeb);updateStatus(_0x5cc5cf);_0x5f2082(ut[_0xafef('0x32')](_0xafef('0x50')));});});};Fax['prototype'][_0xafef('0x51')]=function(_0x227623){var _0x4e40b7=this;return new BPromise(function(_0x196711,_0x4f0358){var _0x549256=_0x4e40b7[_0xafef('0x52')](_0x4e40b7[_0xafef('0xc')][_0x227623['FaxAccountId']][_0xafef('0x53')],_0x227623);if(_0x549256[_0xafef('0x54')]){_0x196711(ut['message'](_0xafef('0x55')));}else{_0x4f0358(ut[_0xafef('0x32')](_0x549256[_0xafef('0x32')]));}});};function originate(_0x647b52,_0x22ac8e,_0x2a0311){return new BPromise(function(_0x31061c,_0x4caa81){if(_0x2a0311){var _0x34a69f=util[_0xafef('0x56')](_0xafef('0x57'),path['parse'](_0x647b52['path'])[_0xafef('0x20')],_0x647b52[_0xafef('0x3')]);gs[_0xafef('0x58')](_0x34a69f)[_0xafef('0x41')](function(){_0x647b52[_0xafef('0x3')]=util[_0xafef('0x56')](_0xafef('0x59'),path[_0xafef('0x34')](_0x647b52['path'])['dir'],path['parse'](_0x647b52[_0xafef('0x3')])['name']);_0x22ac8e[_0xafef('0x5a')]=_0x647b52['path'];ut[_0xafef('0x42')](_0xafef('0x5b'),'');ami[_0xafef('0x5c')](ut[_0xafef('0x5d')](_0x647b52,_0x22ac8e))[_0xafef('0x41')](function(_0x3e8ff5){_0x31061c(_0x3e8ff5);})['catch'](function(_0x4f4b04){_0x4caa81(_0x4f4b04);});})[_0xafef('0x37')](function(_0x39b667){_0x4caa81(_0x39b667);});}else{ami[_0xafef('0x5c')](ut[_0xafef('0x5d')](_0x647b52,_0x22ac8e))[_0xafef('0x41')](function(_0x1a01d5){_0x31061c(_0x1a01d5);})[_0xafef('0x37')](function(_0x20fd72){_0x4caa81(_0x20fd72);});}});}Fax[_0xafef('0x18')][_0xafef('0x4d')]=function(_0x4edcbb,_0x29b8b8){var _0xff7b42=this;return new BPromise(function(_0x2483ae,_0x1a178b){var _0xfdcae4=uuid['v4']();var _0x2c1659=ut['addVariables'](_0x4edcbb,_0x29b8b8);_0xff7b42['actions'][_0xfdcae4]=new Action(_0xfdcae4,_0x29b8b8,_0x4edcbb);var _0xf26781=_0xff7b42[_0xafef('0x46')][_0xfdcae4];if(path[_0xafef('0x34')](_0x4edcbb[_0xafef('0x3')])[_0xafef('0x5e')]===_0xafef('0x36')){originate(_0xf26781,_0x2c1659,!![])['then'](function(_0x191f9e){_0x2483ae(_0x191f9e);})['catch'](function(_0x4a9099){_0x1a178b(_0x4a9099);});}else{originate(_0xf26781,_0x2c1659,![])[_0xafef('0x41')](function(_0x155982){_0x2483ae(_0x155982);})['catch'](function(_0x37ad3e){_0x1a178b(_0x37ad3e);});}});};Fax[_0xafef('0x18')][_0xafef('0x5f')]=function(_0x45f236){return!_[_0xafef('0x60')](_0x45f236)&&!_[_0xafef('0x60')](_0x45f236[_0xafef('0x20')])&&!_[_0xafef('0x60')](_0x45f236[_0xafef('0x61')])&&_0x45f236[_0xafef('0x61')]&&!_['isNil'](this[_0xafef('0xd')][util[_0xafef('0x56')](_0xafef('0x62'),_0x45f236[_0xafef('0x20')])])&&!_['isNil'](this[_0xafef('0xd')][util['format']('SIP/%s',_0x45f236[_0xafef('0x20')])][_0xafef('0x28')])&&(this[_0xafef('0xd')][util[_0xafef('0x56')](_0xafef('0x62'),_0x45f236[_0xafef('0x20')])][_0xafef('0x28')]===_0xafef('0x63')||this[_0xafef('0xd')][util[_0xafef('0x56')](_0xafef('0x62'),_0x45f236[_0xafef('0x20')])]['status']===_0xafef('0x64'));};Fax[_0xafef('0x18')][_0xafef('0x52')]=function(_0x44a8f4,_0x1992c5){if(!this[_0xafef('0x5f')](_0x44a8f4)){ut[_0xafef('0x42')](_0xafef('0x65'),_['isNil'](_0x44a8f4)?'':_0x44a8f4['name']+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':'Trunk\x20not\x20working'};}if(_[_0xafef('0x60')](_0x1992c5[_0xafef('0x6')])){ut['logger']('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0xafef('0x3b')](_0x1992c5));return{'isValid':![],'message':_0xafef('0x66')};}if(_['isNil'](_0x1992c5[_0xafef('0x3')])){ut[_0xafef('0x42')](_0xafef('0x67'),JSON[_0xafef('0x3b')](_0x1992c5));return{'isValid':![],'message':_0xafef('0x68')};}return{'isValid':!![],'message':_0xafef('0x69')};};module['exports']=Fax; \ No newline at end of file +var _0x2713=['newexten','syncNewExten','faxstatus','syncFaxStatus','syncReceiveFax','syncHangup','originateresponse','prototype','syncNewchannel','context','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','syncVarSet','variable','hasOwnProperty','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','syncOriginateResponse','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','[Fax][Message][NoUpdate2]','\x20hangup\x20faxRiceive\x20','SUCCESS','faxstatusstring','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','[Fax][execOriginate][failure]','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','fax','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','util','lodash','bluebird','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','bind','varset','newstate','syncNewState'];(function(_0x467e9e,_0x3ab542){var _0xa37a0c=function(_0x4585ea){while(--_0x4585ea){_0x467e9e['push'](_0x467e9e['shift']());}};_0xa37a0c(++_0x3ab542);}(_0x2713,0x1db));var _0x3271=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x2713[_0x2c91e9];return _0x13f0ff;};'use strict';var util=require(_0x3271('0x0'));var _=require(_0x3271('0x1'));var BPromise=require(_0x3271('0x2'));var uuid=require(_0x3271('0x3'));var moment=require(_0x3271('0x4'));var path=require(_0x3271('0x5'));var tiff2pdf=require(_0x3271('0x6'));var gs=require(_0x3271('0x7'));var logger=require(_0x3271('0x8'))('fax');var ami=require(_0x3271('0x9'));var rpcDb=require(_0x3271('0xa'));var Channel=require(_0x3271('0xb'));var ut=require(_0x3271('0xc'));var Action=require(_0x3271('0xd'));var faxAccount=require(_0x3271('0xe'));var attachment=require(_0x3271('0xf'));var faxMessage=require(_0x3271('0x10'));function Fax(_0x2f5bce){this[_0x3271('0x11')]={};this['faxAccounts']=_0x2f5bce[_0x3271('0x12')];this[_0x3271('0x13')]=_0x2f5bce['trunks'];this[_0x3271('0x14')]={};ami['on']('newchannel',this['syncNewchannel'][_0x3271('0x15')](this));ami['on'](_0x3271('0x16'),this['syncVarSet'][_0x3271('0x15')](this));ami['on'](_0x3271('0x17'),this[_0x3271('0x18')]['bind'](this));ami['on'](_0x3271('0x19'),this[_0x3271('0x1a')][_0x3271('0x15')](this));ami['on'](_0x3271('0x1b'),this[_0x3271('0x1c')][_0x3271('0x15')](this));ami['on']('receivefax',this[_0x3271('0x1d')][_0x3271('0x15')](this));ami['on']('hangup',this[_0x3271('0x1e')][_0x3271('0x15')](this));ami['on'](_0x3271('0x1f'),this['syncOriginateResponse'][_0x3271('0x15')](this));}Fax[_0x3271('0x20')][_0x3271('0x21')]=function(_0xcb0ae7){if(_0xcb0ae7[_0x3271('0x22')]==='from-voip-provider'){for(var _0x47cb33 in this[_0x3271('0x12')]){if(this[_0x3271('0x12')]['hasOwnProperty'](_0x47cb33)){if(_0xcb0ae7[_0x3271('0x23')]===this[_0x3271('0x12')][_0x47cb33][_0x3271('0x24')]){this['channels'][_0xcb0ae7[_0x3271('0x25')]]={};this[_0x3271('0x11')][_0xcb0ae7[_0x3271('0x25')]][_0x3271('0x26')]=_0xcb0ae7[_0x3271('0x26')];this[_0x3271('0x11')][_0xcb0ae7['uniqueid']]['id']=this[_0x3271('0x12')][_0x47cb33]['id'];this[_0x3271('0x11')][_0xcb0ae7[_0x3271('0x25')]]['name']=this[_0x3271('0x12')][_0x47cb33][_0x3271('0x27')];logger[_0x3271('0x28')](_0xcb0ae7[_0x3271('0x25')],_0x3271('0x29'));}}}}if(this[_0x3271('0x14')][_0xcb0ae7[_0x3271('0x25')]]){this[_0x3271('0x11')][_0xcb0ae7['uniqueid']]={};this[_0x3271('0x11')][_0xcb0ae7[_0x3271('0x25')]][_0x3271('0x26')]=_0xcb0ae7['channel'];logger['info'](_0xcb0ae7[_0x3271('0x25')],_0x3271('0x29'));}};Fax[_0x3271('0x20')][_0x3271('0x2a')]=function(_0x4dd2d6){if(this[_0x3271('0x11')][_0x4dd2d6[_0x3271('0x25')]]){for(var _0x580231 in _0x4dd2d6[_0x3271('0x2b')]){if(_0x4dd2d6['variable'][_0x3271('0x2c')](_0x580231)){this[_0x3271('0x11')][_0x4dd2d6[_0x3271('0x25')]][_0x580231]=_0x4dd2d6[_0x3271('0x2d')];}}}};Fax['prototype'][_0x3271('0x18')]=function(_0x38834c){if(this[_0x3271('0x11')][_0x38834c[_0x3271('0x25')]]){this[_0x3271('0x11')][_0x38834c[_0x3271('0x25')]][_0x3271('0x2e')]=_0x38834c[_0x3271('0x2e')];this['channels'][_0x38834c[_0x3271('0x25')]][_0x3271('0x2f')]=_0x38834c[_0x3271('0x2f')];}};Fax[_0x3271('0x20')][_0x3271('0x1a')]=function(_0x4e1356){if(this[_0x3271('0x11')][_0x4e1356['uniqueid']]){for(var _0x236286 in _0x4e1356[_0x3271('0x2b')]){if(_0x4e1356['variable'][_0x3271('0x2c')](_0x236286)){this[_0x3271('0x11')][_0x4e1356[_0x3271('0x25')]][_0x236286]=_0x4e1356[_0x3271('0x2d')];}}}};Fax['prototype'][_0x3271('0x1c')]=function(_0x1d17e1){if(this['channels'][_0x1d17e1['uniqueid']]){this[_0x3271('0x11')][_0x1d17e1[_0x3271('0x25')]]['operation']=_0x1d17e1[_0x3271('0x30')];this[_0x3271('0x11')][_0x1d17e1[_0x3271('0x25')]][_0x3271('0x31')]=_0x1d17e1[_0x3271('0x31')];this[_0x3271('0x11')][_0x1d17e1[_0x3271('0x25')]][_0x3271('0x24')]=_0x1d17e1[_0x3271('0x24')];this[_0x3271('0x11')][_0x1d17e1[_0x3271('0x25')]]['filename']=_0x1d17e1[_0x3271('0x32')];logger[_0x3271('0x28')](_0x1d17e1[_0x3271('0x25')],_0x3271('0x33'));}};Fax['prototype']['syncReceiveFax']=function(_0xacc7c4){var _0x297b33=this;if(this[_0x3271('0x11')][_0xacc7c4[_0x3271('0x25')]]){var _0x499e48=this[_0x3271('0x11')][_0xacc7c4[_0x3271('0x25')]]['id'];this[_0x3271('0x11')][_0xacc7c4[_0x3271('0x25')]][_0x3271('0x34')]=_0xacc7c4['remotestationid'];this[_0x3271('0x11')][_0xacc7c4[_0x3271('0x25')]][_0x3271('0x35')]=_0xacc7c4['pagestransferred'];this[_0x3271('0x11')][_0xacc7c4['uniqueid']][_0x3271('0x24')]=_0xacc7c4[_0x3271('0x24')];this[_0x3271('0x11')][_0xacc7c4[_0x3271('0x25')]][_0x3271('0x36')]=_0xacc7c4[_0x3271('0x36')];this['channels'][_0xacc7c4[_0x3271('0x25')]][_0x3271('0x37')]=_0xacc7c4[_0x3271('0x37')];this[_0x3271('0x11')][_0xacc7c4[_0x3271('0x25')]][_0x3271('0x32')]=_0xacc7c4[_0x3271('0x32')];this['channels'][_0xacc7c4['uniqueid']][_0x3271('0x38')]=_0xacc7c4[_0x3271('0x38')];if(this[_0x3271('0x11')][_0xacc7c4[_0x3271('0x25')]][_0x3271('0x35')]>0x0){tiff2pdf(_0xacc7c4['filename'],_0x3271('0x39'),function(_0x2ae6c0){logger[_0x3271('0x28')](_0xacc7c4['uniqueid'],_0x3271('0x3a'),_0x2ae6c0[_0x3271('0x3b')]);attachment[_0x3271('0x3c')]({'name':path[_0x3271('0x3d')](_0xacc7c4['filename'])[_0x3271('0x27')],'basename':path['parse'](_0xacc7c4[_0x3271('0x32')])[_0x3271('0x27')]+_0x3271('0x3e'),'type':_0x3271('0x3f')})[_0x3271('0x40')](function(_0x298f2a){faxAccount[_0x3271('0x41')](_0x499e48,{'from':_0xacc7c4[_0x3271('0x38')],'mapKey':'fax','body':path['parse'](_0xacc7c4[_0x3271('0x32')])[_0x3271('0x27')]+_0x3271('0x3e'),'AttachmentId':_0x298f2a['id']})[_0x3271('0x42')](function(_0x21537f){logger[_0x3271('0x43')](_0xacc7c4[_0x3271('0x25')],_0x3271('0x44'),JSON[_0x3271('0x45')](_0x21537f));});})[_0x3271('0x42')](function(_0x12bd3c){logger['error'](_0xacc7c4['uniqueid'],_0x3271('0x46'),JSON[_0x3271('0x45')](_0x12bd3c));});});}logger[_0x3271('0x28')](_0xacc7c4[_0x3271('0x25')],_0x3271('0x46'));}};Fax['prototype'][_0x3271('0x47')]=function(_0x435fbc){if(this[_0x3271('0x14')][_0x435fbc[_0x3271('0x25')]]){_['merge'](this[_0x3271('0x11')][_0x435fbc[_0x3271('0x25')]],_[_0x3271('0x48')](_0x435fbc,[_0x3271('0x49'),_0x3271('0x4a')]));}};function updateStatus(_0x3c931c){if(_0x3c931c[_0x3271('0x4b')]){faxMessage[_0x3271('0x4c')](_0x3c931c[_0x3271('0x4b')],{'failMessage':_0x3271('0x4d')})[_0x3271('0x40')](function(_0x12db93){ut[_0x3271('0x4e')](_0x3271('0x4f'),_0x12db93);})['catch'](function(_0x2d1d4c){ut[_0x3271('0x4e')](_0x3271('0x50'),_0x2d1d4c);});}else{ut[_0x3271('0x4e')](_0x3271('0x51'));}}Fax[_0x3271('0x20')][_0x3271('0x52')]=function(_0xb02efa,_0xc7c0c4,_0x1a504e){var _0x3806cb=this;var _0x4f114b={};if(_0xc7c0c4){_0x4f114b={'read':_0xc7c0c4};}else{_0x4f114b={'failMessage':_0x1a504e};}if(this['actions'][_0xb02efa][_0x3271('0x4b')]){faxMessage[_0x3271('0x4c')](this[_0x3271('0x14')][_0xb02efa][_0x3271('0x4b')],_0x4f114b)[_0x3271('0x40')](function(_0x2717ea){ut[_0x3271('0x4e')](_0x3271('0x53'),_0x2717ea);})[_0x3271('0x42')](function(_0x356319){ut[_0x3271('0x4e')](_0x3271('0x54'),_0x356319);})['finally'](function(){delete _0x3806cb[_0x3271('0x11')][_0xb02efa];delete _0x3806cb[_0x3271('0x14')][_0xb02efa];});}else{ut[_0x3271('0x4e')](_0x3271('0x55'));delete this[_0x3271('0x11')][_0xb02efa];delete this[_0x3271('0x14')][_0xb02efa];}};Fax[_0x3271('0x20')][_0x3271('0x1e')]=function(_0x3520a0){var _0x4de017=this;if(this[_0x3271('0x11')][_0x3520a0[_0x3271('0x25')]]){if(this[_0x3271('0x14')][_0x3520a0[_0x3271('0x25')]]){this[_0x3271('0x11')][_0x3520a0[_0x3271('0x25')]]['id']=this[_0x3271('0x14')][_0x3520a0[_0x3271('0x25')]]['id'];this['channels'][_0x3520a0['uniqueid']]['name']=this[_0x3271('0x14')][_0x3520a0[_0x3271('0x25')]][_0x3271('0x27')];}logger[_0x3271('0x28')](_0x3520a0[_0x3271('0x25')],this[_0x3271('0x14')][_0x3520a0[_0x3271('0x25')]]?'\x20hangup\x20sendFile\x20':_0x3271('0x56'),JSON['stringify'](this['channels'][_0x3520a0[_0x3271('0x25')]]));if(this[_0x3271('0x14')][_0x3520a0['uniqueid']]){if(this['channels'][_0x3520a0[_0x3271('0x25')]]['faxpages']>0x0&&this['channels'][_0x3520a0['uniqueid']]['faxstatus']===_0x3271('0x57')){this[_0x3271('0x52')](_0x3520a0[_0x3271('0x25')],!![]);}else{this[_0x3271('0x52')](_0x3520a0[_0x3271('0x25')],![],this[_0x3271('0x11')][_0x3520a0[_0x3271('0x25')]]['faxstatusstring']?'SENDING\x20FAILED:\x20'+this['channels'][_0x3520a0['uniqueid']][_0x3271('0x58')]:_0x3271('0x59'));}}}};Fax[_0x3271('0x20')][_0x3271('0x5a')]=function(_0x2b92a9){var _0x1435dc=this;return new BPromise(function(_0x2254e3,_0x5af862){_0x1435dc[_0x3271('0x5b')](_0x2b92a9,_0x1435dc[_0x3271('0x12')][_0x2b92a9[_0x3271('0x5c')]])[_0x3271('0x40')](function(_0x40480a){ut[_0x3271('0x4e')](_0x3271('0x5d'),_0x40480a);_0x2254e3(ut[_0x3271('0x3b')]('Fax\x20received'));})[_0x3271('0x42')](function(_0x1cc081){ut['logger'](_0x3271('0x5e'),_0x1cc081);updateStatus(_0x2b92a9);_0x5af862(ut[_0x3271('0x3b')]('Fax\x20failed'));});});};Fax[_0x3271('0x20')][_0x3271('0x5f')]=function(_0x5268f2){var _0x4c3d34=this;return new BPromise(function(_0xaa6a89,_0xd46032){var _0x469dc7=_0x4c3d34[_0x3271('0x60')](_0x4c3d34['faxAccounts'][_0x5268f2[_0x3271('0x5c')]][_0x3271('0x61')],_0x5268f2);if(_0x469dc7[_0x3271('0x62')]){_0xaa6a89(ut[_0x3271('0x3b')](_0x3271('0x63')));}else{_0xd46032(ut[_0x3271('0x3b')](_0x469dc7[_0x3271('0x3b')]));}});};function originate(_0x32fbc6,_0x148131,_0x2166a9){return new BPromise(function(_0xdb1c1a,_0x460b81){if(_0x2166a9){var _0x820055=util[_0x3271('0x64')](_0x3271('0x65'),path['parse'](_0x32fbc6[_0x3271('0x5')])[_0x3271('0x27')],_0x32fbc6[_0x3271('0x5')]);gs[_0x3271('0x66')](_0x820055)[_0x3271('0x40')](function(){_0x32fbc6[_0x3271('0x5')]=util['format'](_0x3271('0x67'),path[_0x3271('0x3d')](_0x32fbc6['path'])[_0x3271('0x68')],path[_0x3271('0x3d')](_0x32fbc6['path'])[_0x3271('0x27')]);_0x148131[_0x3271('0x69')]=_0x32fbc6[_0x3271('0x5')];ut['logger'](_0x3271('0x6a'),'');ami['Action'](ut[_0x3271('0x6b')](_0x32fbc6,_0x148131))['then'](function(_0x851fb4){_0xdb1c1a(_0x851fb4);})[_0x3271('0x42')](function(_0x3b3b7f){_0x460b81(_0x3b3b7f);});})[_0x3271('0x42')](function(_0x590dd7){_0x460b81(_0x590dd7);});}else{ami['Action'](ut[_0x3271('0x6b')](_0x32fbc6,_0x148131))[_0x3271('0x40')](function(_0x4cf9e8){_0xdb1c1a(_0x4cf9e8);})[_0x3271('0x42')](function(_0x5674ed){_0x460b81(_0x5674ed);});}});}Fax['prototype'][_0x3271('0x5b')]=function(_0xec228a,_0x25a5f7){var _0x2ae260=this;return new BPromise(function(_0x5c51eb,_0x540960){var _0x37cbf9=uuid['v4']();var _0x534348=ut[_0x3271('0x6c')](_0xec228a,_0x25a5f7);_0x2ae260[_0x3271('0x14')][_0x37cbf9]=new Action(_0x37cbf9,_0x25a5f7,_0xec228a);var _0x7894e6=_0x2ae260[_0x3271('0x14')][_0x37cbf9];if(path['parse'](_0xec228a['path'])[_0x3271('0x6d')]===_0x3271('0x3e')){originate(_0x7894e6,_0x534348,!![])[_0x3271('0x40')](function(_0x8a595e){_0x5c51eb(_0x8a595e);})['catch'](function(_0x4c6a05){_0x540960(_0x4c6a05);});}else{originate(_0x7894e6,_0x534348,![])[_0x3271('0x40')](function(_0x16ed7d){_0x5c51eb(_0x16ed7d);})[_0x3271('0x42')](function(_0x1a71c7){_0x540960(_0x1a71c7);});}});};Fax[_0x3271('0x20')][_0x3271('0x6e')]=function(_0x2b6dd7){return!_['isNil'](_0x2b6dd7)&&!_[_0x3271('0x6f')](_0x2b6dd7[_0x3271('0x27')])&&!_[_0x3271('0x6f')](_0x2b6dd7[_0x3271('0x70')])&&_0x2b6dd7['active']&&!_[_0x3271('0x6f')](this[_0x3271('0x13')][util[_0x3271('0x64')](_0x3271('0x71'),_0x2b6dd7[_0x3271('0x27')])])&&!_[_0x3271('0x6f')](this[_0x3271('0x13')][util[_0x3271('0x64')](_0x3271('0x71'),_0x2b6dd7['name'])][_0x3271('0x31')])&&(this[_0x3271('0x13')][util[_0x3271('0x64')]('SIP/%s',_0x2b6dd7[_0x3271('0x27')])][_0x3271('0x31')]===_0x3271('0x72')||this[_0x3271('0x13')][util['format'](_0x3271('0x71'),_0x2b6dd7[_0x3271('0x27')])]['status']===_0x3271('0x73'));};Fax[_0x3271('0x20')][_0x3271('0x60')]=function(_0x72597d,_0x3d467a){if(!this[_0x3271('0x6e')](_0x72597d)){ut['logger'](_0x3271('0x74'),_[_0x3271('0x6f')](_0x72597d)?'':_0x72597d[_0x3271('0x27')]+_0x3271('0x75'));return{'isValid':![],'message':_0x3271('0x76')};}if(_['isNil'](_0x3d467a[_0x3271('0x77')])){ut['logger'](_0x3271('0x78'),JSON[_0x3271('0x45')](_0x3d467a));return{'isValid':![],'message':_0x3271('0x79')};}if(_['isNil'](_0x3d467a['path'])){ut[_0x3271('0x4e')](_0x3271('0x7a'),JSON['stringify'](_0x3d467a));return{'isValid':![],'message':_0x3271('0x7b')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x3271('0x7c')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 16eb3f2..96cb7af 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 _0x1b20=['then','[Notify]\x20','util','bluebird','../rpc/faxAccount','error','inspect','notify','resolve'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x1b20,0xa4));var _0x01b2=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x1b20[_0x502c7d];return _0x30b7ed;};'use strict';var util=require(_0x01b2('0x0'));var BPromise=require(_0x01b2('0x1'));var logger=require('../../../config/logger')('preview');var _=require('lodash');var faxAccount=require(_0x01b2('0x2'));function loggerCatch(_0x4eca58){return function(_0x4ee128){logger[_0x01b2('0x3')](_0x4eca58,util[_0x01b2('0x4')](_0x4ee128,{'showHidden':![],'depth':null}));};}exports[_0x01b2('0x5')]=function(_0x4adca7,_0x363609){return BPromise[_0x01b2('0x6')]()[_0x01b2('0x7')](faxAccount[_0x01b2('0x5')](_0x4adca7,_0x363609))['catch'](loggerCatch(_0x01b2('0x8')));}; \ No newline at end of file +var _0x5ac3=['catch','[Notify]\x20','../../../config/logger','preview','error','resolve','then','notify'];(function(_0x314047,_0x6440f2){var _0x5ae6b8=function(_0x2ca9b3){while(--_0x2ca9b3){_0x314047['push'](_0x314047['shift']());}};_0x5ae6b8(++_0x6440f2);}(_0x5ac3,0x1da));var _0x35ac=function(_0x4b51e4,_0x11e019){_0x4b51e4=_0x4b51e4-0x0;var _0x5a56f0=_0x5ac3[_0x4b51e4];return _0x5a56f0;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0x35ac('0x0'))(_0x35ac('0x1'));var _=require('lodash');var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x19899e){return function(_0x52e4ed){logger[_0x35ac('0x2')](_0x19899e,util['inspect'](_0x52e4ed,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x6e0c67,_0x352dd8){return BPromise[_0x35ac('0x3')]()[_0x35ac('0x4')](faxAccount[_0x35ac('0x5')](_0x6e0c67,_0x352dd8))[_0x35ac('0x6')](loggerCatch(_0x35ac('0x7')));}; \ 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 2bd2c34..3a014f7 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 _0x508d=['Exec\x20gs','\x20Error\x20:','inspect','util','fax','bluebird','child_process','exec','execute','info'];(function(_0x3d7c58,_0x5113cb){var _0x330b65=function(_0x3bdff9){while(--_0x3bdff9){_0x3d7c58['push'](_0x3d7c58['shift']());}};_0x330b65(++_0x5113cb);}(_0x508d,0x189));var _0xd508=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x508d[_0x1928c9];return _0x51b5fb;};'use strict';var util=require(_0xd508('0x0'));var logger=require('../../../../config/logger')(_0xd508('0x1'));var BPromise=require(_0xd508('0x2'));var exec=require(_0xd508('0x3'))[_0xd508('0x4')];exports[_0xd508('0x5')]=function(_0x52cbc6){return new BPromise(function(_0x5519fe,_0x2bc1b8){exec(_0x52cbc6,function(_0x5b728e,_0x55abb2,_0x2d5b46){logger[_0xd508('0x6')](_0xd508('0x7'),_0x55abb2);if(_0x5b728e){logger['info'](_0xd508('0x7'),_0xd508('0x8'),util[_0xd508('0x9')](_0x5b728e,{'showHidden':![],'depth':null}),_0x55abb2,_0x2d5b46);_0x2bc1b8(_0x5b728e);}_0x5519fe(_0x55abb2);});});}; \ No newline at end of file +var _0xc238=['execute','Exec\x20gs','info','inspect','util','../../../../config/logger','fax','child_process'];(function(_0x416861,_0x519444){var _0x4fab84=function(_0x461202){while(--_0x461202){_0x416861['push'](_0x416861['shift']());}};_0x4fab84(++_0x519444);}(_0xc238,0xb4));var _0x8c23=function(_0x34e5a3,_0x1827e8){_0x34e5a3=_0x34e5a3-0x0;var _0x4d752c=_0xc238[_0x34e5a3];return _0x4d752c;};'use strict';var util=require(_0x8c23('0x0'));var logger=require(_0x8c23('0x1'))(_0x8c23('0x2'));var BPromise=require('bluebird');var exec=require(_0x8c23('0x3'))['exec'];exports[_0x8c23('0x4')]=function(_0x1025b9){return new BPromise(function(_0xc2bfe2,_0x1844a3){exec(_0x1025b9,function(_0x402ceb,_0x27a243,_0x2ac9b6){logger['info'](_0x8c23('0x5'),_0x27a243);if(_0x402ceb){logger[_0x8c23('0x6')](_0x8c23('0x5'),'\x20Error\x20:',util[_0x8c23('0x7')](_0x402ceb,{'showHidden':![],'depth':null}),_0x27a243,_0x2ac9b6);_0x1844a3(_0x402ceb);}_0xc2bfe2(_0x27a243);});});}; \ 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 a074542..adea4e8 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 _0x2f68=['variablesAction','originate','channel','from-sip','\x22%s\x22\x20<%s>','headerinfo','uniqueid','lodash','moment','../../../../config/logger','fax','inspect','addVariables','minrate','maxrate','format','modem','gateway','t38timeout','localstationid','path'];(function(_0x2f7703,_0x21e706){var _0x320cb7=function(_0x8afb3b){while(--_0x8afb3b){_0x2f7703['push'](_0x2f7703['shift']());}};_0x320cb7(++_0x21e706);}(_0x2f68,0x9a));var _0x82f6=function(_0x12d010,_0x1813ef){_0x12d010=_0x12d010-0x0;var _0x5c28f9=_0x2f68[_0x12d010];return _0x5c28f9;};'use strict';var util=require('util');var _=require(_0x82f6('0x0'));var moment=require(_0x82f6('0x1'));var logger=require(_0x82f6('0x2'))(_0x82f6('0x3'));exports['message']=function(_0x43dc65){return{'message':_0x43dc65};};exports['logger']=function(_0x2a06dc,_0x2ab73d){logger['info'](_0x2a06dc,util[_0x82f6('0x4')](_0x2ab73d,{'showHidden':![],'depth':null}));};exports[_0x82f6('0x5')]=function(_0x542737,_0x5a8089){var _0x1bc0be={'XMF-ECM':_0x5a8089['ecm'],'XMF-HEADERINFO':_0x5a8089['headerinfo'],'XMF-MINRATE':_0x5a8089[_0x82f6('0x6')],'XMF-MAXRATE':_0x5a8089[_0x82f6('0x7')],'XMF-MODEM':util[_0x82f6('0x8')]('\x22%s\x22',_0x5a8089[_0x82f6('0x9')]),'XMF-GATEWAY':_0x5a8089[_0x82f6('0xa')],'XMF-FAXDETECT':_0x5a8089['faxdetect'],'XMF-T38TIMEOUT':_0x5a8089[_0x82f6('0xb')],'XMF-LOCALSTATIONID':_0x5a8089[_0x82f6('0xc')],'XMF-PATH':_0x542737[_0x82f6('0xd')]};return _0x1bc0be;};exports[_0x82f6('0xe')]=function(_0x1a68c4,_0x34bd7c){return{'actionid':_0x1a68c4['uniqueid'],'action':_0x82f6('0xf'),'channel':_0x1a68c4[_0x82f6('0x10')],'Exten':'xcally-motion-fax','Context':_0x82f6('0x11'),'Priority':'1','callerid':util[_0x82f6('0x8')](_0x82f6('0x12'),_0x1a68c4[_0x82f6('0x13')]?_0x1a68c4[_0x82f6('0x13')]:'',_0x1a68c4[_0x82f6('0xc')]),'variable':_0x34bd7c,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x1a68c4[_0x82f6('0x14')]};}; \ No newline at end of file +var _0xe706=['\x22%s\x22\x20<%s>','util','lodash','moment','fax','message','logger','info','inspect','addVariables','ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','path','uniqueid','originate','channel','xcally-motion-fax','from-sip'];(function(_0x3f0ab4,_0x35e988){var _0x53a940=function(_0x352c9f){while(--_0x352c9f){_0x3f0ab4['push'](_0x3f0ab4['shift']());}};_0x53a940(++_0x35e988);}(_0xe706,0xa3));var _0x6e70=function(_0x329437,_0x1de73a){_0x329437=_0x329437-0x0;var _0x3789d9=_0xe706[_0x329437];return _0x3789d9;};'use strict';var util=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var logger=require('../../../../config/logger')(_0x6e70('0x3'));exports[_0x6e70('0x4')]=function(_0x2ca810){return{'message':_0x2ca810};};exports[_0x6e70('0x5')]=function(_0x142c27,_0x2164a4){logger[_0x6e70('0x6')](_0x142c27,util[_0x6e70('0x7')](_0x2164a4,{'showHidden':![],'depth':null}));};exports[_0x6e70('0x8')]=function(_0x4381d1,_0x36357b){var _0x293ce7={'XMF-ECM':_0x36357b[_0x6e70('0x9')],'XMF-HEADERINFO':_0x36357b[_0x6e70('0xa')],'XMF-MINRATE':_0x36357b[_0x6e70('0xb')],'XMF-MAXRATE':_0x36357b[_0x6e70('0xc')],'XMF-MODEM':util[_0x6e70('0xd')](_0x6e70('0xe'),_0x36357b[_0x6e70('0xf')]),'XMF-GATEWAY':_0x36357b[_0x6e70('0x10')],'XMF-FAXDETECT':_0x36357b[_0x6e70('0x11')],'XMF-T38TIMEOUT':_0x36357b[_0x6e70('0x12')],'XMF-LOCALSTATIONID':_0x36357b[_0x6e70('0x13')],'XMF-PATH':_0x4381d1[_0x6e70('0x14')]};return _0x293ce7;};exports['variablesAction']=function(_0x47f6b2,_0x3594c1){return{'actionid':_0x47f6b2[_0x6e70('0x15')],'action':_0x6e70('0x16'),'channel':_0x47f6b2[_0x6e70('0x17')],'Exten':_0x6e70('0x18'),'Context':_0x6e70('0x19'),'Priority':'1','callerid':util[_0x6e70('0xd')](_0x6e70('0x1a'),_0x47f6b2['headerinfo']?_0x47f6b2['headerinfo']:'',_0x47f6b2['localstationid']),'variable':_0x3594c1,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x47f6b2[_0x6e70('0x15')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 876e147..fd74f9e 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 _0x4bec=['./realtime','./report','./acw','./fax','./rpc/voiceQueue','./rpc/trigger','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/salesforce','./rpc/integrations/freshdesk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','hour','get','resolve','then','getTelephones','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','initServicenowAccounts','initDynamics365Accounts','getCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','listen','sync','bluebird','util','./server'];(function(_0x4d3187,_0x267c51){var _0x107906=function(_0x5d759d){while(--_0x5d759d){_0x4d3187['push'](_0x4d3187['shift']());}};_0x107906(++_0x267c51);}(_0x4bec,0x177));var _0xc4be=function(_0x422e0a,_0x4c644c){_0x422e0a=_0x422e0a-0x0;var _0x3d3beb=_0x4bec[_0x422e0a];return _0x3d3beb;};'use strict';var BPromise=require(_0xc4be('0x0'));var util=require(_0xc4be('0x1'));var moment=require('moment');var server=require(_0xc4be('0x2'));var Realtime=require(_0xc4be('0x3'));var Report=require(_0xc4be('0x4'));var Acw=require(_0xc4be('0x5'));var Trigger=require('./trigger');var Dialer=require('./dialer');var Preview=require('./preview');var Fax=require(_0xc4be('0x6'));var user=require('./rpc/user');var voiceQueue=require(_0xc4be('0x7'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require('./rpc/trunk');var trigger=require(_0xc4be('0x8'));var template=require('./rpc/template');var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0xc4be('0x9'));var voiceExtension=require(_0xc4be('0xa'));var faxAccount=require(_0xc4be('0xb'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0xc4be('0xc'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0xc4be('0xd'));var desk=require('./rpc/integrations/desk');var zoho=require(_0xc4be('0xe'));var vtiger=require(_0xc4be('0xf'));var freshsales=require(_0xc4be('0x10'));var servicenow=require(_0xc4be('0x11'));var dynamics365=require(_0xc4be('0x12'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0xc4be('0x13'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xc4be('0x14')](_0xc4be('0x13'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xc4be('0x15')]()[_0xc4be('0x16')](user['getAgents']())[_0xc4be('0x16')](realtime['initAgents']())['then'](user[_0xc4be('0x17')]())[_0xc4be('0x16')](realtime['initTelephones']())[_0xc4be('0x16')](trunk['getTrunks']())['then'](realtime[_0xc4be('0x18')]())['then'](voiceQueue[_0xc4be('0x19')]())[_0xc4be('0x16')](realtime[_0xc4be('0x1a')]())[_0xc4be('0x16')](trigger[_0xc4be('0x1b')]())[_0xc4be('0x16')](realtime[_0xc4be('0x1c')]())[_0xc4be('0x16')](template[_0xc4be('0x1d')]())['then'](realtime[_0xc4be('0x1e')]())['then'](zendesk['getZendeskAccounts']())[_0xc4be('0x16')](realtime[_0xc4be('0x1f')]())[_0xc4be('0x16')](salesforce[_0xc4be('0x20')]())[_0xc4be('0x16')](realtime[_0xc4be('0x21')]())[_0xc4be('0x16')](sugarcrm[_0xc4be('0x22')]())[_0xc4be('0x16')](realtime[_0xc4be('0x23')]())[_0xc4be('0x16')](freshdesk[_0xc4be('0x24')]())['then'](realtime[_0xc4be('0x25')]())[_0xc4be('0x16')](desk[_0xc4be('0x26')]())[_0xc4be('0x16')](realtime[_0xc4be('0x27')]())[_0xc4be('0x16')](zoho[_0xc4be('0x28')]())[_0xc4be('0x16')](realtime['initZohoAccounts']())[_0xc4be('0x16')](vtiger[_0xc4be('0x29')]())['then'](realtime[_0xc4be('0x2a')]())[_0xc4be('0x16')](freshsales[_0xc4be('0x2b')]())[_0xc4be('0x16')](realtime[_0xc4be('0x2c')]())[_0xc4be('0x16')](servicenow['getServicenowAccounts']())['then'](realtime[_0xc4be('0x2d')]())[_0xc4be('0x16')](dynamics365['getDynamics365Accounts']())['then'](realtime[_0xc4be('0x2e')]())[_0xc4be('0x16')](campaign[_0xc4be('0x2f')]())[_0xc4be('0x16')](realtime['initCampaigns']())[_0xc4be('0x16')](voiceExtension[_0xc4be('0x30')]())['then'](realtime[_0xc4be('0x31')]())[_0xc4be('0x16')](faxAccount[_0xc4be('0x32')]())[_0xc4be('0x16')](realtime[_0xc4be('0x33')]())[_0xc4be('0x16')](function(){return realtime;});}function initParams(){return BPromise[_0xc4be('0x15')]()['then'](voiceQueueReport['getVoiceQueueReports']())[_0xc4be('0x16')](realtime[_0xc4be('0x34')]())['then'](cmHopperHistory[_0xc4be('0x35')]())[_0xc4be('0x16')](realtime[_0xc4be('0x36')]())['then'](cmHopperHistory[_0xc4be('0x37')]())[_0xc4be('0x16')](realtime[_0xc4be('0x38')]())[_0xc4be('0x16')](voiceCallReport[_0xc4be('0x39')]())[_0xc4be('0x16')](realtime[_0xc4be('0x3a')]())['then'](function(_0x39220c){})[_0xc4be('0x3b')](function(_0x40fa37){console[_0xc4be('0x3c')](_0x40fa37);});}function main(){return server[_0xc4be('0x3d')](realtime,preview,fax)[_0xc4be('0x16')](function(_0x283aca){return initRealtime();})[_0xc4be('0x16')](function(){return initParams();})[_0xc4be('0x16')](function(){report[_0xc4be('0x3e')]();setInterval(initRealtime,0x1388);})[_0xc4be('0x3b')](function(_0x39e571){console['log'](_0x39e571);});}main(); \ No newline at end of file +var _0x8bff=['./dialer','./preview','./rpc/user','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','bluebird','util','moment','./server','./realtime','./report'];(function(_0x19355b,_0x457553){var _0x40796f=function(_0x21941d){while(--_0x21941d){_0x19355b['push'](_0x19355b['shift']());}};_0x40796f(++_0x457553);}(_0x8bff,0x82));var _0xf8bf=function(_0x387f88,_0x28e7bd){_0x387f88=_0x387f88-0x0;var _0x4c94ea=_0x8bff[_0x387f88];return _0x4c94ea;};'use strict';var BPromise=require(_0xf8bf('0x0'));var util=require(_0xf8bf('0x1'));var moment=require(_0xf8bf('0x2'));var server=require(_0xf8bf('0x3'));var Realtime=require(_0xf8bf('0x4'));var Report=require(_0xf8bf('0x5'));var Acw=require('./acw');var Trigger=require('./trigger');var Dialer=require(_0xf8bf('0x6'));var Preview=require(_0xf8bf('0x7'));var Fax=require('./fax');var user=require(_0xf8bf('0x8'));var voiceQueue=require(_0xf8bf('0x9'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0xf8bf('0xa'));var trunk=require(_0xf8bf('0xb'));var trigger=require(_0xf8bf('0xc'));var template=require(_0xf8bf('0xd'));var cmHopperHistory=require(_0xf8bf('0xe'));var campaign=require(_0xf8bf('0xf'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0xf8bf('0x10'));var zendesk=require(_0xf8bf('0x11'));var salesforce=require(_0xf8bf('0x12'));var sugarcrm=require(_0xf8bf('0x13'));var freshdesk=require(_0xf8bf('0x14'));var desk=require(_0xf8bf('0x15'));var zoho=require(_0xf8bf('0x16'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0xf8bf('0x17'));var servicenow=require(_0xf8bf('0x18'));var dynamics365=require(_0xf8bf('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()[_0xf8bf('0x1a')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xf8bf('0x1a')](_0xf8bf('0x1b'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xf8bf('0x1c')]()[_0xf8bf('0x1d')](user[_0xf8bf('0x1e')]())[_0xf8bf('0x1d')](realtime[_0xf8bf('0x1f')]())[_0xf8bf('0x1d')](user[_0xf8bf('0x20')]())[_0xf8bf('0x1d')](realtime[_0xf8bf('0x21')]())[_0xf8bf('0x1d')](trunk[_0xf8bf('0x22')]())[_0xf8bf('0x1d')](realtime['initTrunks']())['then'](voiceQueue[_0xf8bf('0x23')]())['then'](realtime[_0xf8bf('0x24')]())[_0xf8bf('0x1d')](trigger[_0xf8bf('0x25')]())[_0xf8bf('0x1d')](realtime[_0xf8bf('0x26')]())[_0xf8bf('0x1d')](template[_0xf8bf('0x27')]())[_0xf8bf('0x1d')](realtime[_0xf8bf('0x28')]())['then'](zendesk[_0xf8bf('0x29')]())[_0xf8bf('0x1d')](realtime['initZendeskAccounts']())[_0xf8bf('0x1d')](salesforce[_0xf8bf('0x2a')]())['then'](realtime[_0xf8bf('0x2b')]())['then'](sugarcrm[_0xf8bf('0x2c')]())['then'](realtime[_0xf8bf('0x2d')]())['then'](freshdesk[_0xf8bf('0x2e')]())[_0xf8bf('0x1d')](realtime[_0xf8bf('0x2f')]())[_0xf8bf('0x1d')](desk[_0xf8bf('0x30')]())[_0xf8bf('0x1d')](realtime[_0xf8bf('0x31')]())[_0xf8bf('0x1d')](zoho['getZohoAccounts']())['then'](realtime[_0xf8bf('0x32')]())['then'](vtiger[_0xf8bf('0x33')]())[_0xf8bf('0x1d')](realtime[_0xf8bf('0x34')]())['then'](freshsales[_0xf8bf('0x35')]())['then'](realtime['initFreshsalesAccounts']())[_0xf8bf('0x1d')](servicenow['getServicenowAccounts']())[_0xf8bf('0x1d')](realtime['initServicenowAccounts']())[_0xf8bf('0x1d')](dynamics365[_0xf8bf('0x36')]())['then'](realtime[_0xf8bf('0x37')]())[_0xf8bf('0x1d')](campaign[_0xf8bf('0x38')]())[_0xf8bf('0x1d')](realtime[_0xf8bf('0x39')]())['then'](voiceExtension[_0xf8bf('0x3a')]())[_0xf8bf('0x1d')](realtime[_0xf8bf('0x3b')]())[_0xf8bf('0x1d')](faxAccount[_0xf8bf('0x3c')]())[_0xf8bf('0x1d')](realtime['initFaxAccounts']())[_0xf8bf('0x1d')](function(){return realtime;});}function initParams(){return BPromise[_0xf8bf('0x1c')]()[_0xf8bf('0x1d')](voiceQueueReport['getVoiceQueueReports']())[_0xf8bf('0x1d')](realtime[_0xf8bf('0x3d')]())['then'](cmHopperHistory[_0xf8bf('0x3e')]())['then'](realtime[_0xf8bf('0x3f')]())['then'](cmHopperHistory['getCampaignHopperHistory']())[_0xf8bf('0x1d')](realtime['initCampaignHopperHistory']())['then'](voiceCallReport[_0xf8bf('0x40')]())[_0xf8bf('0x1d')](realtime[_0xf8bf('0x41')]())[_0xf8bf('0x1d')](function(_0x441db7){})[_0xf8bf('0x42')](function(_0x3ccfd0){console[_0xf8bf('0x43')](_0x3ccfd0);});}function main(){return server['listen'](realtime,preview,fax)[_0xf8bf('0x1d')](function(_0x57f656){return initRealtime();})[_0xf8bf('0x1d')](function(){return initParams();})[_0xf8bf('0x1d')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0xf8bf('0x42')](function(_0x105afc){console[_0xf8bf('0x43')](_0x105afc);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index a346d2c..f8f6530 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 _0x7142=['status','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','statePause','format','stringify','user:%s','emit','user:save','lodash','moment','md5','redis','defaults','localhost','socket.io-emitter','name','email','fullname','state','unknown','stateTime'];(function(_0x4ee356,_0x5a09e4){var _0x5ca4a4=function(_0x517741){while(--_0x517741){_0x4ee356['push'](_0x4ee356['shift']());}};_0x5ca4a4(++_0x5a09e4);}(_0x7142,0xac));var _0x2714=function(_0x435fbe,_0xcb7f27){_0x435fbe=_0x435fbe-0x0;var _0x4ddcce=_0x7142[_0x435fbe];return _0x4ddcce;};'use strict';var _=require(_0x2714('0x0'));var util=require('util');var moment=require(_0x2714('0x1'));var md5=require(_0x2714('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x2714('0x3')]=_[_0x2714('0x4')](config['redis'],{'host':_0x2714('0x5'),'port':0x18eb});var io=require(_0x2714('0x6'))(new Redis(config[_0x2714('0x3')]));function Agent(_0x5ef38b){this['id']=_0x5ef38b['id']||0x0;this[_0x2714('0x7')]=_0x5ef38b[_0x2714('0x7')]||'';this[_0x2714('0x8')]=_0x5ef38b[_0x2714('0x8')]||'';this['accountcode']=_0x5ef38b['accountcode']||'';this[_0x2714('0x9')]=_0x5ef38b['fullname']||'';this[_0x2714('0xa')]=_0x2714('0xb');this[_0x2714('0xc')]=0x0;this[_0x2714('0xd')]=_0x2714('0xb');this[_0x2714('0xe')]='';this[_0x2714('0xf')]='';this[_0x2714('0x10')]='';this[_0x2714('0x11')]='';this[_0x2714('0x12')]=_0x5ef38b['online']||![];this[_0x2714('0x13')]=_0x2714('0xb');this[_0x2714('0x14')]=0x0;this[_0x2714('0x15')]='';this[_0x2714('0x16')]='';this[_0x2714('0x17')]=![];this['local']=![];this[_0x2714('0x2')]='';}Agent[_0x2714('0x18')][_0x2714('0x19')]=function(_0x42ae28){var _0xb62f4e;if(_0x42ae28&&_0x42ae28[_0x2714('0xa')]){_0xb62f4e=_0x42ae28[_0x2714('0xa')][_0x2714('0x1a')]();switch(_0xb62f4e){case _0x2714('0x1b'):_0xb62f4e=_0x2714('0x1c');break;case _0x2714('0x1d'):_0xb62f4e=_0x2714('0x1e');break;}}if(_0xb62f4e&&this['voiceStatus']!==_0xb62f4e||_0x42ae28[_0x2714('0x1f')]){this[_0x2714('0x14')]=_['toNumber'](moment()[_0x2714('0x20')]('x'));}if(_0xb62f4e){this[_0x2714('0x13')]=_0xb62f4e;}var _0x34ec8a={'id':this['id'],'name':this[_0x2714('0x7')],'email':this[_0x2714('0x8')],'accountcode':this['accountcode'],'fullname':this[_0x2714('0x9')],'state':this[_0x2714('0xa')],'stateTime':this[_0x2714('0xc')],'status':this[_0x2714('0xd')],'address':this[_0x2714('0xe')],'online':this[_0x2714('0x12')],'voiceStatus':this[_0x2714('0x13')],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this[_0x2714('0x15')],'voiceStatusQueue':this[_0x2714('0x16')],'interface':this[_0x2714('0x11')],'onhold':this[_0x2714('0x17')]};var _0x3da9b1=md5(JSON[_0x2714('0x21')](_0x34ec8a));if(this['md5']!==_0x3da9b1){this['md5']=_0x3da9b1;io['to'](util['format'](_0x2714('0x22'),_0x34ec8a[_0x2714('0x7')]))[_0x2714('0x23')](_0x2714('0x24'),_0x34ec8a);}};module['exports']=Agent; \ No newline at end of file +var _0x8b95=['name','email','accountcode','fullname','unknown','stateTime','status','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusQueue','onhold','local','prototype','updateStatusRealtime','state','toLowerCase','not_inuse','idle','inuse','talking','statePause','toNumber','format','address','voiceStatusCallerIdNumber','stringify','user:%s','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter'];(function(_0x3767bd,_0x4d32b1){var _0x5530c7=function(_0x358d3b){while(--_0x358d3b){_0x3767bd['push'](_0x3767bd['shift']());}};_0x5530c7(++_0x4d32b1);}(_0x8b95,0x110));var _0x58b9=function(_0x88fa5d,_0x465d9d){_0x88fa5d=_0x88fa5d-0x0;var _0x3d471d=_0x8b95[_0x88fa5d];return _0x3d471d;};'use strict';var _=require(_0x58b9('0x0'));var util=require('util');var moment=require('moment');var md5=require(_0x58b9('0x1'));var Redis=require(_0x58b9('0x2'));var config=require(_0x58b9('0x3'));config[_0x58b9('0x4')]=_[_0x58b9('0x5')](config['redis'],{'host':_0x58b9('0x6'),'port':0x18eb});var io=require(_0x58b9('0x7'))(new Redis(config[_0x58b9('0x4')]));function Agent(_0x551372){this['id']=_0x551372['id']||0x0;this['name']=_0x551372[_0x58b9('0x8')]||'';this[_0x58b9('0x9')]=_0x551372[_0x58b9('0x9')]||'';this[_0x58b9('0xa')]=_0x551372[_0x58b9('0xa')]||'';this[_0x58b9('0xb')]=_0x551372[_0x58b9('0xb')]||'';this['state']=_0x58b9('0xc');this[_0x58b9('0xd')]=0x0;this[_0x58b9('0xe')]=_0x58b9('0xc');this['address']='';this[_0x58b9('0xf')]='';this[_0x58b9('0x10')]='';this[_0x58b9('0x11')]='';this[_0x58b9('0x12')]=_0x551372['online']||![];this[_0x58b9('0x13')]='unknown';this[_0x58b9('0x14')]=0x0;this['voiceStatusCallerIdNumber']='';this[_0x58b9('0x15')]='';this[_0x58b9('0x16')]=![];this[_0x58b9('0x17')]=![];this['md5']='';}Agent[_0x58b9('0x18')][_0x58b9('0x19')]=function(_0x13023e){var _0x5919e5;if(_0x13023e&&_0x13023e['state']){_0x5919e5=_0x13023e[_0x58b9('0x1a')][_0x58b9('0x1b')]();switch(_0x5919e5){case _0x58b9('0x1c'):_0x5919e5=_0x58b9('0x1d');break;case _0x58b9('0x1e'):_0x5919e5=_0x58b9('0x1f');break;}}if(_0x5919e5&&this[_0x58b9('0x13')]!==_0x5919e5||_0x13023e[_0x58b9('0x20')]){this['voiceStatusTime']=_[_0x58b9('0x21')](moment()[_0x58b9('0x22')]('x'));}if(_0x5919e5){this[_0x58b9('0x13')]=_0x5919e5;}var _0x4bf2d5={'id':this['id'],'name':this[_0x58b9('0x8')],'email':this[_0x58b9('0x9')],'accountcode':this[_0x58b9('0xa')],'fullname':this['fullname'],'state':this[_0x58b9('0x1a')],'stateTime':this['stateTime'],'status':this[_0x58b9('0xe')],'address':this[_0x58b9('0x23')],'online':this[_0x58b9('0x12')],'voiceStatus':this[_0x58b9('0x13')],'voiceStatusTime':this[_0x58b9('0x14')],'voiceStatusCallerIdNumber':this[_0x58b9('0x24')],'voiceStatusQueue':this[_0x58b9('0x15')],'interface':this[_0x58b9('0x11')],'onhold':this[_0x58b9('0x16')]};var _0x1504ed=md5(JSON[_0x58b9('0x25')](_0x4bf2d5));if(this[_0x58b9('0x1')]!==_0x1504ed){this[_0x58b9('0x1')]=_0x1504ed;io['to'](util[_0x58b9('0x22')](_0x58b9('0x26'),_0x4bf2d5['name']))['emit']('user:save',_0x4bf2d5);}};module[_0x58b9('0x27')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 0fc1ba2..8e636d3 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 _0x0b0e=['SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk'];(function(_0x5b7851,_0x444cd6){var _0x51f60f=function(_0x1c5ea4){while(--_0x1c5ea4){_0x5b7851['push'](_0x5b7851['shift']());}};_0x51f60f(++_0x444cd6);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4991d6,_0x348deb){_0x4991d6=_0x4991d6-0x0;var _0x50faf7=_0x0b0e[_0x4991d6];return _0x50faf7;};'use strict';function Campaign(_0x29cd1e){this['id']=_0x29cd1e['id']||0x0;this['name']=_0x29cd1e[_0xe0b0('0x0')]||'';this['type']=_0x29cd1e[_0xe0b0('0x1')]||_0xe0b0('0x2');this[_0xe0b0('0x3')]=0x0;this[_0xe0b0('0x4')]=0x0;this[_0xe0b0('0x5')]=0x0;this[_0xe0b0('0x6')]=0x0;this[_0xe0b0('0x7')]='';this[_0xe0b0('0x8')]=!![];this[_0xe0b0('0x9')]=_0x29cd1e[_0xe0b0('0x9')];this[_0xe0b0('0xa')]=_0x29cd1e['limitCalls'];this['dialTimezone']=_0x29cd1e[_0xe0b0('0xb')]||null;this[_0xe0b0('0xc')]=_0x29cd1e[_0xe0b0('0xc')]?_0x29cd1e[_0xe0b0('0xc')]:null;this['dialOriginateCallerIdName']=_0x29cd1e[_0xe0b0('0xd')];this[_0xe0b0('0xe')]=_0x29cd1e['dialOriginateCallerIdNumber'];this[_0xe0b0('0xf')]=_0x29cd1e[_0xe0b0('0xf')]||0x1e;this['dialCongestionMaxRetry']=_0x29cd1e[_0xe0b0('0x10')];this[_0xe0b0('0x11')]=_0x29cd1e[_0xe0b0('0x11')];this['dialBusyMaxRetry']=_0x29cd1e[_0xe0b0('0x12')];this[_0xe0b0('0x13')]=_0x29cd1e[_0xe0b0('0x13')];this[_0xe0b0('0x14')]=_0x29cd1e[_0xe0b0('0x14')];this['dialNoAnswerRetryFrequency']=_0x29cd1e[_0xe0b0('0x15')];this[_0xe0b0('0x16')]=_0x29cd1e[_0xe0b0('0x16')];this[_0xe0b0('0x17')]=_0x29cd1e[_0xe0b0('0x17')]||'DESC';this[_0xe0b0('0x18')]=_0x29cd1e['dialPrefix']||undefined;this[_0xe0b0('0x19')]=_0x29cd1e[_0xe0b0('0x19')]||undefined;this['dialCutDigit']=_0x29cd1e[_0xe0b0('0x1a')]||undefined;this['TrunkBackup']=_0x29cd1e[_0xe0b0('0x1b')]?_0x29cd1e[_0xe0b0('0x1b')]:undefined;this['Trunk']=_0x29cd1e['Trunk']?_0x29cd1e[_0xe0b0('0x1c')]:undefined;this['Interval']=_0x29cd1e['Interval']?_0x29cd1e['Interval']:undefined;this[_0xe0b0('0x1d')]=_0x29cd1e['SquareProject']?_0x29cd1e['SquareProject']:undefined;this[_0xe0b0('0x1e')]=_0x29cd1e['SquareProject']?_0x29cd1e[_0xe0b0('0x1d')]['name']:undefined;this[_0xe0b0('0x1f')]=_0x29cd1e[_0xe0b0('0x1f')]||![];this[_0xe0b0('0x20')]=_0x29cd1e[_0xe0b0('0x20')];this[_0xe0b0('0x21')]=_0x29cd1e['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x29cd1e[_0xe0b0('0x22')];this['dialAMDTotalAnalysisTime']=_0x29cd1e[_0xe0b0('0x23')];this[_0xe0b0('0x24')]=_0x29cd1e['dialAMDMinWordLength'];this[_0xe0b0('0x25')]=_0x29cd1e['dialAMDBetweenWordsSilence'];this[_0xe0b0('0x26')]=_0x29cd1e['dialAMDMaximumNumberOfWords'];this[_0xe0b0('0x27')]=_0x29cd1e['dialAMDSilenceThreshold'];this[_0xe0b0('0x28')]=_0x29cd1e['dialAMDMaximumWordLength'];}module[_0xe0b0('0x29')]=Campaign; \ No newline at end of file +var _0xb7e7=['dialAMDSilenceThreshold','name','type','originated','ivrAnswerCallsDay','ivrTotalCallsDays','message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords'];(function(_0x44ce97,_0x321989){var _0x48eec6=function(_0x18049b){while(--_0x18049b){_0x44ce97['push'](_0x44ce97['shift']());}};_0x48eec6(++_0x321989);}(_0xb7e7,0x121));var _0x7b7e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xb7e7[_0x5037ab];return _0x512adb;};'use strict';function Campaign(_0x2e5e07){this['id']=_0x2e5e07['id']||0x0;this['name']=_0x2e5e07[_0x7b7e('0x0')]||'';this['type']=_0x2e5e07[_0x7b7e('0x1')]||'campaign';this[_0x7b7e('0x2')]=0x0;this['temp']=0x0;this[_0x7b7e('0x3')]=0x0;this[_0x7b7e('0x4')]=0x0;this[_0x7b7e('0x5')]='';this['sendMessageOneNotActive']=!![];this['active']=_0x2e5e07[_0x7b7e('0x6')];this[_0x7b7e('0x7')]=_0x2e5e07[_0x7b7e('0x7')];this['dialTimezone']=_0x2e5e07[_0x7b7e('0x8')]||null;this[_0x7b7e('0x9')]=_0x2e5e07[_0x7b7e('0x9')]?_0x2e5e07[_0x7b7e('0x9')]:null;this[_0x7b7e('0xa')]=_0x2e5e07[_0x7b7e('0xa')];this[_0x7b7e('0xb')]=_0x2e5e07['dialOriginateCallerIdNumber'];this[_0x7b7e('0xc')]=_0x2e5e07[_0x7b7e('0xc')]||0x1e;this[_0x7b7e('0xd')]=_0x2e5e07[_0x7b7e('0xd')];this[_0x7b7e('0xe')]=_0x2e5e07[_0x7b7e('0xe')];this[_0x7b7e('0xf')]=_0x2e5e07[_0x7b7e('0xf')];this[_0x7b7e('0x10')]=_0x2e5e07['dialBusyRetryFrequency'];this[_0x7b7e('0x11')]=_0x2e5e07[_0x7b7e('0x11')];this['dialNoAnswerRetryFrequency']=_0x2e5e07[_0x7b7e('0x12')];this['dialGlobalMaxRetry']=_0x2e5e07['dialGlobalMaxRetry'];this[_0x7b7e('0x13')]=_0x2e5e07[_0x7b7e('0x13')]||_0x7b7e('0x14');this[_0x7b7e('0x15')]=_0x2e5e07[_0x7b7e('0x15')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x2e5e07['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x7b7e('0x16')]=_0x2e5e07[_0x7b7e('0x16')]||undefined;this[_0x7b7e('0x17')]=_0x2e5e07[_0x7b7e('0x17')]?_0x2e5e07[_0x7b7e('0x17')]:undefined;this[_0x7b7e('0x18')]=_0x2e5e07[_0x7b7e('0x18')]?_0x2e5e07[_0x7b7e('0x18')]:undefined;this[_0x7b7e('0x19')]=_0x2e5e07[_0x7b7e('0x19')]?_0x2e5e07[_0x7b7e('0x19')]:undefined;this[_0x7b7e('0x1a')]=_0x2e5e07[_0x7b7e('0x1a')]?_0x2e5e07[_0x7b7e('0x1a')]:undefined;this[_0x7b7e('0x1b')]=_0x2e5e07[_0x7b7e('0x1a')]?_0x2e5e07[_0x7b7e('0x1a')]['name']:undefined;this[_0x7b7e('0x1c')]=_0x2e5e07[_0x7b7e('0x1c')]||![];this[_0x7b7e('0x1d')]=_0x2e5e07['dialAMDInitialSilence'];this[_0x7b7e('0x1e')]=_0x2e5e07[_0x7b7e('0x1e')];this[_0x7b7e('0x1f')]=_0x2e5e07[_0x7b7e('0x1f')];this[_0x7b7e('0x20')]=_0x2e5e07[_0x7b7e('0x20')];this[_0x7b7e('0x21')]=_0x2e5e07[_0x7b7e('0x21')];this['dialAMDBetweenWordsSilence']=_0x2e5e07['dialAMDBetweenWordsSilence'];this['dialAMDMaximumNumberOfWords']=_0x2e5e07[_0x7b7e('0x22')];this[_0x7b7e('0x23')]=_0x2e5e07[_0x7b7e('0x23')];this['dialAMDMaximumWordLength']=_0x2e5e07['dialAMDMaximumWordLength'];}module['exports']=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index c147c4a..db32daf 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 _0xed0b=['destinationchannel','calleridnum','calleridname','context','linkedid','answertime','endtime','unmanaged','abandoned','lastapplication','duration','billableseconds','holdtime','type','tag','monitor','monitorFilename','queue','transfercalleridnum','mohtime','exports','starttime'];(function(_0x4135ee,_0x317b51){var _0x6c8bdd=function(_0x1c1b10){while(--_0x1c1b10){_0x4135ee['push'](_0x4135ee['shift']());}};_0x6c8bdd(++_0x317b51);}(_0xed0b,0x15f));var _0xbed0=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xed0b[_0x255d5b];return _0x3e141a;};'use strict';function Channel(){this[_0xbed0('0x0')]=null;this['channel']='';this[_0xbed0('0x1')]='';this[_0xbed0('0x2')]=0x0;this[_0xbed0('0x3')]='';this['connectedlinenum']=undefined;this['connectedlinename']=undefined;this['accountcode']=0x0;this[_0xbed0('0x4')]='';this['uniqueid']=0x0;this[_0xbed0('0x5')]=0x0;this['exten']=0x0;this['answered']=![];this[_0xbed0('0x6')]=null;this[_0xbed0('0x7')]=null;this[_0xbed0('0x8')]=![];this[_0xbed0('0x9')]=![];this[_0xbed0('0xa')]='';this['lastdata']='';this[_0xbed0('0xb')]=0x0;this[_0xbed0('0xc')]=0x0;this[_0xbed0('0xd')]=0x0;this[_0xbed0('0xe')]=null;this[_0xbed0('0xf')]=null;this['disposition']=null;this[_0xbed0('0x10')]=![];this[_0xbed0('0x11')]=null;this[_0xbed0('0x12')]=null;this['monitors']=[];this[_0xbed0('0x13')]=undefined;this['transferconnectedlinenum']=undefined;this[_0xbed0('0x14')]=0x0;}module[_0xbed0('0x15')]=Channel; \ No newline at end of file +var _0x199d=['linkedid','answered','answertime','unmanaged','abandoned','lastapplication','duration','billableseconds','holdtime','tag','disposition','monitorFilename','monitors','transfercalleridnum','transferconnectedlinenum','mohtime','exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinename','context','uniqueid'];(function(_0x29c8fb,_0x9c15e2){var _0x4d2039=function(_0x27cecf){while(--_0x27cecf){_0x29c8fb['push'](_0x29c8fb['shift']());}};_0x4d2039(++_0x9c15e2);}(_0x199d,0x13d));var _0xd199=function(_0x3124f8,_0x1a8b23){_0x3124f8=_0x3124f8-0x0;var _0x5bab5f=_0x199d[_0x3124f8];return _0x5bab5f;};'use strict';function Channel(){this[_0xd199('0x0')]=null;this[_0xd199('0x1')]='';this[_0xd199('0x2')]='';this[_0xd199('0x3')]=0x0;this[_0xd199('0x4')]='';this['connectedlinenum']=undefined;this[_0xd199('0x5')]=undefined;this['accountcode']=0x0;this[_0xd199('0x6')]='';this[_0xd199('0x7')]=0x0;this[_0xd199('0x8')]=0x0;this['exten']=0x0;this[_0xd199('0x9')]=![];this[_0xd199('0xa')]=null;this['endtime']=null;this[_0xd199('0xb')]=![];this[_0xd199('0xc')]=![];this[_0xd199('0xd')]='';this['lastdata']='';this[_0xd199('0xe')]=0x0;this[_0xd199('0xf')]=0x0;this[_0xd199('0x10')]=0x0;this['type']=null;this[_0xd199('0x11')]=null;this[_0xd199('0x12')]=null;this['monitor']=![];this[_0xd199('0x13')]=null;this['queue']=null;this[_0xd199('0x14')]=[];this[_0xd199('0x15')]=undefined;this[_0xd199('0x16')]=undefined;this[_0xd199('0x17')]=0x0;}module[_0xd199('0x18')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index a4a96ab..900172e 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 _0xb7a8=['password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','name','username','remoteUri','authType'];(function(_0x38aed2,_0xe7cc55){var _0x1b551b=function(_0x4229ef){while(--_0x4229ef){_0x38aed2['push'](_0x38aed2['shift']());}};_0x1b551b(++_0xe7cc55);}(_0xb7a8,0xec));var _0x8b7a=function(_0x22c631,_0x58d201){_0x22c631=_0x22c631-0x0;var _0x40a257=_0xb7a8[_0x22c631];return _0x40a257;};'use strict';function DeskAccount(_0x17ec1f){this['id']=_0x17ec1f['id']||0x0;this[_0x8b7a('0x0')]=_0x17ec1f[_0x8b7a('0x0')]||'';this['username']=_0x17ec1f[_0x8b7a('0x1')]||'';this[_0x8b7a('0x2')]=_0x17ec1f[_0x8b7a('0x2')]||'';this['authType']=_0x17ec1f[_0x8b7a('0x3')]||'';this[_0x8b7a('0x4')]=_0x17ec1f[_0x8b7a('0x4')]||'';this[_0x8b7a('0x5')]=_0x17ec1f[_0x8b7a('0x5')]||'';this[_0x8b7a('0x6')]=_0x17ec1f[_0x8b7a('0x6')]||'';this[_0x8b7a('0x7')]=_0x17ec1f[_0x8b7a('0x7')]||'';this[_0x8b7a('0x8')]=_0x17ec1f[_0x8b7a('0x8')]||'';this[_0x8b7a('0x9')]=_0x17ec1f['type']||'';this[_0x8b7a('0xa')]=_0x17ec1f['serverUrl']||'';this[_0x8b7a('0xb')]=_0x17ec1f[_0x8b7a('0xb')]||{};}module['exports']=DeskAccount; \ No newline at end of file +var _0x8c46=['consumerSecret','token','tokenSecret','type','serverUrl','Configurations','username','remoteUri','authType','password','consumerKey'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x8c46,0x171));var _0x68c4=function(_0x3f85d2,_0x59019f){_0x3f85d2=_0x3f85d2-0x0;var _0x2cbede=_0x8c46[_0x3f85d2];return _0x2cbede;};'use strict';function DeskAccount(_0x2bca70){this['id']=_0x2bca70['id']||0x0;this['name']=_0x2bca70['name']||'';this[_0x68c4('0x0')]=_0x2bca70['username']||'';this['remoteUri']=_0x2bca70[_0x68c4('0x1')]||'';this[_0x68c4('0x2')]=_0x2bca70[_0x68c4('0x2')]||'';this[_0x68c4('0x3')]=_0x2bca70[_0x68c4('0x3')]||'';this[_0x68c4('0x4')]=_0x2bca70[_0x68c4('0x4')]||'';this[_0x68c4('0x5')]=_0x2bca70[_0x68c4('0x5')]||'';this[_0x68c4('0x6')]=_0x2bca70['token']||'';this[_0x68c4('0x7')]=_0x2bca70[_0x68c4('0x7')]||'';this[_0x68c4('0x8')]=_0x2bca70['type']||'';this[_0x68c4('0x9')]=_0x2bca70[_0x68c4('0x9')]||'';this[_0x68c4('0xa')]=_0x2bca70['Configurations']||{};}module['exports']=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 9a828ff..46038d7 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 _0xdfc8=['password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','exports','name','username'];(function(_0x525673,_0xb429c2){var _0x8f7574=function(_0xeb3bce){while(--_0xeb3bce){_0x525673['push'](_0x525673['shift']());}};_0x8f7574(++_0xb429c2);}(_0xdfc8,0x94));var _0x8dfc=function(_0x329b7f,_0x3570ab){_0x329b7f=_0x329b7f-0x0;var _0x5adcbd=_0xdfc8[_0x329b7f];return _0x5adcbd;};'use strict';function Dynamics365Account(_0xc48e39){this['id']=_0xc48e39['id']||0x0;this[_0x8dfc('0x0')]=_0xc48e39[_0x8dfc('0x0')]||'';this[_0x8dfc('0x1')]=_0xc48e39[_0x8dfc('0x1')]||'';this[_0x8dfc('0x2')]=_0xc48e39[_0x8dfc('0x2')]||'';this['remoteUri']=_0xc48e39[_0x8dfc('0x3')]||'';this[_0x8dfc('0x4')]=_0xc48e39[_0x8dfc('0x4')]||'';this[_0x8dfc('0x5')]=_0xc48e39[_0x8dfc('0x5')]||'';this[_0x8dfc('0x6')]=_0xc48e39[_0x8dfc('0x6')]||{};this[_0x8dfc('0x7')]=_0xc48e39[_0x8dfc('0x7')]||'';this['Configurations']=_0xc48e39[_0x8dfc('0x8')]||{};}module[_0x8dfc('0x9')]=Dynamics365Account; \ No newline at end of file +var _0xb1bb=['tenantId','clientId','clientSecret','serverUrl','Configurations','exports','name','password','remoteUri'];(function(_0x37b7b6,_0x165a5c){var _0x10c4c3=function(_0x16d71e){while(--_0x16d71e){_0x37b7b6['push'](_0x37b7b6['shift']());}};_0x10c4c3(++_0x165a5c);}(_0xb1bb,0x1ad));var _0xbb1b=function(_0xc28d2c,_0x394159){_0xc28d2c=_0xc28d2c-0x0;var _0x5181a7=_0xb1bb[_0xc28d2c];return _0x5181a7;};'use strict';function Dynamics365Account(_0x5723ab){this['id']=_0x5723ab['id']||0x0;this[_0xbb1b('0x0')]=_0x5723ab['name']||'';this['username']=_0x5723ab['username']||'';this['password']=_0x5723ab[_0xbb1b('0x1')]||'';this['remoteUri']=_0x5723ab[_0xbb1b('0x2')]||'';this[_0xbb1b('0x3')]=_0x5723ab[_0xbb1b('0x3')]||'';this[_0xbb1b('0x4')]=_0x5723ab[_0xbb1b('0x4')]||'';this[_0xbb1b('0x5')]=_0x5723ab['clientSecret']||{};this[_0xbb1b('0x6')]=_0x5723ab[_0xbb1b('0x6')]||'';this[_0xbb1b('0x7')]=_0x5723ab[_0xbb1b('0x7')]||{};}module[_0xbb1b('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 1cc1a80..3bbafdf 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 _0x98f0=['name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','gateway','faxdetect','tech','key','exports'];(function(_0x3ddde9,_0x1a6a2b){var _0xdfb693=function(_0x1c1c20){while(--_0x1c1c20){_0x3ddde9['push'](_0x3ddde9['shift']());}};_0xdfb693(++_0x1a6a2b);}(_0x98f0,0xdd));var _0x098f=function(_0x446125,_0xc55152){_0x446125=_0x446125-0x0;var _0x3bf9ea=_0x98f0[_0x446125];return _0x3bf9ea;};'use strict';function FaxAccount(_0xacde78){this['id']=_0xacde78['id']||0x0;this[_0x098f('0x0')]=_0xacde78['name']||'';this['description']=_0xacde78[_0x098f('0x1')];this[_0x098f('0x2')]=_0xacde78[_0x098f('0x2')];this['headerinfo']=_0xacde78[_0x098f('0x3')];this['localstationid']=_0xacde78[_0x098f('0x4')];this['minrate']=_0xacde78[_0x098f('0x5')]||0x960;this[_0x098f('0x6')]=_0xacde78['maxrate']||0x3840;this[_0x098f('0x7')]=_0xacde78[_0x098f('0x7')]||'v17,v27,v29';this[_0x098f('0x8')]=_0xacde78['gateway']||'no';this[_0x098f('0x9')]=_0xacde78[_0x098f('0x9')]||'no';this['t38timeout']=_0xacde78['t38timeout']||0x1388;this[_0x098f('0xa')]=_0xacde78['tech']||'SIP';this['Trunk']=_0xacde78['Trunk']?_0xacde78['Trunk']:undefined;this['ListId']=_0xacde78['ListId'];this['key']=_0xacde78[_0x098f('0xb')];}module[_0x098f('0xc')]=FaxAccount; \ No newline at end of file +var _0x4912=['headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','Trunk','key','exports','name','description'];(function(_0x294c6a,_0x3bbd77){var _0x1d40af=function(_0x11f6d2){while(--_0x11f6d2){_0x294c6a['push'](_0x294c6a['shift']());}};_0x1d40af(++_0x3bbd77);}(_0x4912,0x1c0));var _0x2491=function(_0x237cae,_0x1103eb){_0x237cae=_0x237cae-0x0;var _0x383cba=_0x4912[_0x237cae];return _0x383cba;};'use strict';function FaxAccount(_0x219d20){this['id']=_0x219d20['id']||0x0;this[_0x2491('0x0')]=_0x219d20[_0x2491('0x0')]||'';this[_0x2491('0x1')]=_0x219d20[_0x2491('0x1')];this['ecm']=_0x219d20['ecm'];this[_0x2491('0x2')]=_0x219d20[_0x2491('0x2')];this[_0x2491('0x3')]=_0x219d20[_0x2491('0x3')];this[_0x2491('0x4')]=_0x219d20[_0x2491('0x4')]||0x960;this[_0x2491('0x5')]=_0x219d20[_0x2491('0x5')]||0x3840;this['modem']=_0x219d20[_0x2491('0x6')]||_0x2491('0x7');this[_0x2491('0x8')]=_0x219d20[_0x2491('0x8')]||'no';this[_0x2491('0x9')]=_0x219d20['faxdetect']||'no';this[_0x2491('0xa')]=_0x219d20['t38timeout']||0x1388;this[_0x2491('0xb')]=_0x219d20[_0x2491('0xb')]||'SIP';this['Trunk']=_0x219d20['Trunk']?_0x219d20[_0x2491('0xc')]:undefined;this['ListId']=_0x219d20['ListId'];this[_0x2491('0xd')]=_0x219d20[_0x2491('0xd')];}module[_0x2491('0xe')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index fbb4800..71d0b79 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 _0x453d=['serverUrl','Configurations','name','username','apiKey','token','remoteUri'];(function(_0x903228,_0x42c429){var _0xcec81d=function(_0x4da97a){while(--_0x4da97a){_0x903228['push'](_0x903228['shift']());}};_0xcec81d(++_0x42c429);}(_0x453d,0x1a6));var _0xd453=function(_0x23ec0f,_0x536a67){_0x23ec0f=_0x23ec0f-0x0;var _0x17c21d=_0x453d[_0x23ec0f];return _0x17c21d;};'use strict';function FreshdeskAccount(_0x397e1f){this['id']=_0x397e1f['id']||0x0;this['name']=_0x397e1f[_0xd453('0x0')]||'';this['username']=_0x397e1f[_0xd453('0x1')]||'';this[_0xd453('0x2')]=_0x397e1f[_0xd453('0x3')]||'';this['remoteUri']=_0x397e1f[_0xd453('0x4')]||'';this[_0xd453('0x5')]=_0x397e1f['serverUrl']||'';this[_0xd453('0x6')]=_0x397e1f[_0xd453('0x6')]||{};}module['exports']=FreshdeskAccount; \ No newline at end of file +var _0xb11d=['name','username','serverUrl','Configurations','exports'];(function(_0x2b5941,_0x337a57){var _0x42f17d=function(_0xdf788f){while(--_0xdf788f){_0x2b5941['push'](_0x2b5941['shift']());}};_0x42f17d(++_0x337a57);}(_0xb11d,0x168));var _0xdb11=function(_0x1877af,_0x3b6bde){_0x1877af=_0x1877af-0x0;var _0x154cd9=_0xb11d[_0x1877af];return _0x154cd9;};'use strict';function FreshdeskAccount(_0x1ecad3){this['id']=_0x1ecad3['id']||0x0;this['name']=_0x1ecad3[_0xdb11('0x0')]||'';this[_0xdb11('0x1')]=_0x1ecad3[_0xdb11('0x1')]||'';this['apiKey']=_0x1ecad3['token']||'';this['remoteUri']=_0x1ecad3['remoteUri']||'';this[_0xdb11('0x2')]=_0x1ecad3[_0xdb11('0x2')]||'';this['Configurations']=_0x1ecad3[_0xdb11('0x3')]||{};}module[_0xdb11('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 6fc3daa..827451b 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 _0x3b5b=['apiKey','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x5e0998,_0x2f0ff3){var _0x2daed0=function(_0x5584a5){while(--_0x5584a5){_0x5e0998['push'](_0x5e0998['shift']());}};_0x2daed0(++_0x2f0ff3);}(_0x3b5b,0x171));var _0xb3b5=function(_0x4c260a,_0x148241){_0x4c260a=_0x4c260a-0x0;var _0x17bbdd=_0x3b5b[_0x4c260a];return _0x17bbdd;};'use strict';function FreshsalesAccount(_0x423935){this['id']=_0x423935['id']||0x0;this['name']=_0x423935[_0xb3b5('0x0')]||'';this[_0xb3b5('0x1')]=_0x423935[_0xb3b5('0x1')]||'';this[_0xb3b5('0x2')]=_0x423935['token']||'';this[_0xb3b5('0x3')]=_0x423935[_0xb3b5('0x3')]||'';this[_0xb3b5('0x4')]=_0x423935[_0xb3b5('0x4')]||'';this['Configurations']=_0x423935[_0xb3b5('0x5')]||{};}module[_0xb3b5('0x6')]=FreshsalesAccount; \ No newline at end of file +var _0xe432=['Configurations','exports','name','username','token','remoteUri','serverUrl'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe432,0x1c2));var _0x2e43=function(_0x5e94f8,_0x336cd8){_0x5e94f8=_0x5e94f8-0x0;var _0x517401=_0xe432[_0x5e94f8];return _0x517401;};'use strict';function FreshsalesAccount(_0x5cf68d){this['id']=_0x5cf68d['id']||0x0;this[_0x2e43('0x0')]=_0x5cf68d[_0x2e43('0x0')]||'';this[_0x2e43('0x1')]=_0x5cf68d[_0x2e43('0x1')]||'';this['apiKey']=_0x5cf68d[_0x2e43('0x2')]||'';this['remoteUri']=_0x5cf68d[_0x2e43('0x3')]||'';this[_0x2e43('0x4')]=_0x5cf68d[_0x2e43('0x4')]||'';this[_0x2e43('0x5')]=_0x5cf68d['Configurations']||{};}module[_0x2e43('0x6')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index e6dfe06..247aa5b 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 _0xb740=['queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','originalposition','connectedlinenum','context','exten','priority','assigned','lastAssignedTo','mohtime','variables','type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt'];(function(_0x38a13a,_0x2b0ac0){var _0x37f0d6=function(_0x112d09){while(--_0x112d09){_0x38a13a['push'](_0x38a13a['shift']());}};_0x37f0d6(++_0x2b0ac0);}(_0xb740,0xb9));var _0x0b74=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb740[_0x3dd15e];return _0x231fd0;};'use strict';function QueueReport(){this[_0x0b74('0x0')]=_0x0b74('0x1');this[_0x0b74('0x2')]='';this[_0x0b74('0x3')]='';this[_0x0b74('0x4')]='';this[_0x0b74('0x5')]='';this[_0x0b74('0x6')]=null;this[_0x0b74('0x7')]=null;this[_0x0b74('0x8')]=0x1;this[_0x0b74('0x9')]=0x1;this[_0x0b74('0xa')]=![];this[_0x0b74('0xb')]=null;this[_0x0b74('0xc')]=![];this[_0x0b74('0xd')]=null;this[_0x0b74('0xe')]=![];this['queuecallerexitAt']=null;this[_0x0b74('0xf')]=0x1;this['channel']='';this[_0x0b74('0x10')]='';this['connectedlinename']='';this['accountcode']='';this[_0x0b74('0x11')]='';this[_0x0b74('0x12')]='';this[_0x0b74('0x13')]='';this['holdtime']=0x0;this[_0x0b74('0x14')]=![];this[_0x0b74('0x15')]='';this[_0x0b74('0x16')]=0x0;this[_0x0b74('0x17')]={};}module['exports']=QueueReport; \ No newline at end of file +var _0x3de7=['queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','accountcode','priority','holdtime','assigned','lastAssignedTo','exports','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','count','queuecallerabandon','queuecallerabandonAt'];(function(_0x3f594e,_0x3d89c0){var _0x390cf2=function(_0x490e29){while(--_0x490e29){_0x3f594e['push'](_0x3f594e['shift']());}};_0x390cf2(++_0x3d89c0);}(_0x3de7,0xa4));var _0x73de=function(_0x1e3322,_0x2816a9){_0x1e3322=_0x1e3322-0x0;var _0x3429e3=_0x3de7[_0x1e3322];return _0x3429e3;};'use strict';function QueueReport(){this['type']='inbound';this['uniqueid']='';this['calleridnum']='';this[_0x73de('0x0')]='';this[_0x73de('0x1')]='';this[_0x73de('0x2')]=null;this[_0x73de('0x3')]=null;this['position']=0x1;this[_0x73de('0x4')]=0x1;this[_0x73de('0x5')]=![];this[_0x73de('0x6')]=null;this[_0x73de('0x7')]=![];this[_0x73de('0x8')]=null;this[_0x73de('0x9')]=![];this[_0x73de('0xa')]=null;this[_0x73de('0xb')]=0x1;this[_0x73de('0xc')]='';this['connectedlinenum']='';this['connectedlinename']='';this[_0x73de('0xd')]='';this['context']='';this['exten']='';this[_0x73de('0xe')]='';this[_0x73de('0xf')]=0x0;this[_0x73de('0x10')]=![];this[_0x73de('0x11')]='';this['mohtime']=0x0;this['variables']={};}module[_0x73de('0x12')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 26f6777..ec9371e 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 _0x2ec8=['Configurations','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl'];(function(_0x883307,_0x794d52){var _0x7eebd6=function(_0x256b85){while(--_0x256b85){_0x883307['push'](_0x883307['shift']());}};_0x7eebd6(++_0x794d52);}(_0x2ec8,0x11f));var _0x82ec=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x2ec8[_0x5b644e];return _0x49c6bf;};'use strict';function SalesforceAccount(_0x25e4d7){this['id']=_0x25e4d7['id']||0x0;this[_0x82ec('0x0')]=_0x25e4d7[_0x82ec('0x0')]||'';this[_0x82ec('0x1')]=_0x25e4d7[_0x82ec('0x1')]||'';this['remoteUri']=_0x25e4d7[_0x82ec('0x2')]||'';this[_0x82ec('0x3')]=_0x25e4d7['password']||'';this[_0x82ec('0x4')]=_0x25e4d7[_0x82ec('0x4')]||'';this[_0x82ec('0x5')]=_0x25e4d7[_0x82ec('0x5')]||'';this['securityToken']=_0x25e4d7[_0x82ec('0x6')]||'';this[_0x82ec('0x7')]=_0x25e4d7[_0x82ec('0x7')]||_0x82ec('0x8');this[_0x82ec('0x9')]=_0x25e4d7[_0x82ec('0x9')]||'';this[_0x82ec('0xa')]=_0x25e4d7[_0x82ec('0xa')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file +var _0xea29=['securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','password','clientSecret'];(function(_0x1d1440,_0x1f4716){var _0x557568=function(_0x567b12){while(--_0x567b12){_0x1d1440['push'](_0x1d1440['shift']());}};_0x557568(++_0x1f4716);}(_0xea29,0xf6));var _0x9ea2=function(_0x5984bb,_0x56f02a){_0x5984bb=_0x5984bb-0x0;var _0x5351d8=_0xea29[_0x5984bb];return _0x5351d8;};'use strict';function SalesforceAccount(_0x58a33d){this['id']=_0x58a33d['id']||0x0;this[_0x9ea2('0x0')]=_0x58a33d[_0x9ea2('0x0')]||'';this[_0x9ea2('0x1')]=_0x58a33d[_0x9ea2('0x1')]||'';this['remoteUri']=_0x58a33d['remoteUri']||'';this[_0x9ea2('0x2')]=_0x58a33d['password']||'';this['clientId']=_0x58a33d['clientId']||'';this[_0x9ea2('0x3')]=_0x58a33d[_0x9ea2('0x3')]||'';this[_0x9ea2('0x4')]=_0x58a33d[_0x9ea2('0x4')]||'';this[_0x9ea2('0x5')]=_0x58a33d['type']||_0x9ea2('0x6');this[_0x9ea2('0x7')]=_0x58a33d['serverUrl']||'';this[_0x9ea2('0x8')]=_0x58a33d[_0x9ea2('0x8')]||{};}module[_0x9ea2('0x9')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index d5ce725..b185fff 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 _0x15ed=['serverUrl','name','username','password','remoteUri'];(function(_0x5d2303,_0x2eec4f){var _0x1069ea=function(_0x750708){while(--_0x750708){_0x5d2303['push'](_0x5d2303['shift']());}};_0x1069ea(++_0x2eec4f);}(_0x15ed,0x1e6));var _0xd15e=function(_0x361d3f,_0x3be2aa){_0x361d3f=_0x361d3f-0x0;var _0x320229=_0x15ed[_0x361d3f];return _0x320229;};'use strict';function ServicenowAccount(_0xf851bf){this['id']=_0xf851bf['id']||0x0;this[_0xd15e('0x0')]=_0xf851bf[_0xd15e('0x0')]||'';this[_0xd15e('0x1')]=_0xf851bf[_0xd15e('0x1')]||'';this[_0xd15e('0x2')]=_0xf851bf['password']||'';this[_0xd15e('0x3')]=_0xf851bf[_0xd15e('0x3')]||'';this[_0xd15e('0x4')]=_0xf851bf['serverUrl']||'';this['Configurations']=_0xf851bf['Configurations']||{};}module['exports']=ServicenowAccount; \ No newline at end of file +var _0xbe82=['remoteUri','serverUrl','name','username','password'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xbe82,0xb1));var _0x2be8=function(_0x57c601,_0x3293a2){_0x57c601=_0x57c601-0x0;var _0x10d301=_0xbe82[_0x57c601];return _0x10d301;};'use strict';function ServicenowAccount(_0x58ff77){this['id']=_0x58ff77['id']||0x0;this[_0x2be8('0x0')]=_0x58ff77[_0x2be8('0x0')]||'';this[_0x2be8('0x1')]=_0x58ff77[_0x2be8('0x1')]||'';this[_0x2be8('0x2')]=_0x58ff77[_0x2be8('0x2')]||'';this[_0x2be8('0x3')]=_0x58ff77[_0x2be8('0x3')]||'';this[_0x2be8('0x4')]=_0x58ff77[_0x2be8('0x4')]||'';this['Configurations']=_0x58ff77['Configurations']||{};}module['exports']=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 95dfcde..6a4d29d 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 _0x4464=['password','remoteUri','serverUrl','exports','name','username'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x4464,0x1e4));var _0x4446=function(_0x54108f,_0x5759b0){_0x54108f=_0x54108f-0x0;var _0x495030=_0x4464[_0x54108f];return _0x495030;};'use strict';function SugarcrmAccount(_0xf6cc03){this['id']=_0xf6cc03['id']||0x0;this[_0x4446('0x0')]=_0xf6cc03[_0x4446('0x0')]||'';this[_0x4446('0x1')]=_0xf6cc03[_0x4446('0x1')]||'';this['password']=_0xf6cc03[_0x4446('0x2')]||'';this[_0x4446('0x3')]=_0xf6cc03[_0x4446('0x3')]||'';this[_0x4446('0x4')]=_0xf6cc03['serverUrl']||'';this['Configurations']=_0xf6cc03['Configurations']||{};}module[_0x4446('0x5')]=SugarcrmAccount; \ No newline at end of file +var _0xe528=['password','remoteUri','serverUrl','Configurations','name','username'];(function(_0x1586ab,_0x1106ed){var _0x55fb67=function(_0x4cfa53){while(--_0x4cfa53){_0x1586ab['push'](_0x1586ab['shift']());}};_0x55fb67(++_0x1106ed);}(_0xe528,0xa6));var _0x8e52=function(_0x3334fb,_0xf14c3){_0x3334fb=_0x3334fb-0x0;var _0x5c024f=_0xe528[_0x3334fb];return _0x5c024f;};'use strict';function SugarcrmAccount(_0x4f115c){this['id']=_0x4f115c['id']||0x0;this[_0x8e52('0x0')]=_0x4f115c['name']||'';this['username']=_0x4f115c[_0x8e52('0x1')]||'';this[_0x8e52('0x2')]=_0x4f115c['password']||'';this['remoteUri']=_0x4f115c[_0x8e52('0x3')]||'';this['serverUrl']=_0x4f115c[_0x8e52('0x4')]||'';this[_0x8e52('0x5')]=_0x4f115c['Configurations']||{};}module['exports']=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 84b684a..8d4e259 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 _0xd614=['accountcode','unknown','stateTime','name'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xd614,0xd3));var _0x4d61=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xd614[_0x618414];return _0x21c19a;};'use strict';function Telephone(_0x510f76){this['id']=_0x510f76['id']||0x0;this[_0x4d61('0x0')]=_0x510f76[_0x4d61('0x0')]||'';this[_0x4d61('0x1')]=_0x510f76['accountcode']||'';this['state']=_0x4d61('0x2');this[_0x4d61('0x3')]=0x0;this['status']=_0x4d61('0x2');this['address']='';}module['exports']=Telephone; \ No newline at end of file +var _0x4aba=['accountcode','stateTime','status','unknown','address','exports','name'];(function(_0x4987ea,_0x197e32){var _0x13be27=function(_0x2fb9dd){while(--_0x2fb9dd){_0x4987ea['push'](_0x4987ea['shift']());}};_0x13be27(++_0x197e32);}(_0x4aba,0x14f));var _0xa4ab=function(_0x1f5d35,_0x13db91){_0x1f5d35=_0x1f5d35-0x0;var _0x27355a=_0x4aba[_0x1f5d35];return _0x27355a;};'use strict';function Telephone(_0x317c6e){this['id']=_0x317c6e['id']||0x0;this['name']=_0x317c6e[_0xa4ab('0x0')]||'';this[_0xa4ab('0x1')]=_0x317c6e[_0xa4ab('0x1')]||'';this['state']='unknown';this[_0xa4ab('0x2')]=0x0;this[_0xa4ab('0x3')]=_0xa4ab('0x4');this[_0xa4ab('0x5')]='';}module[_0xa4ab('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 d6601dd..6dca689 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 _0xd8be=['name','html','exports'];(function(_0x53bfcf,_0x24937a){var _0x2825e4=function(_0x2ffd0a){while(--_0x2ffd0a){_0x53bfcf['push'](_0x53bfcf['shift']());}};_0x2825e4(++_0x24937a);}(_0xd8be,0xff));var _0xed8b=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xd8be[_0x138adb];return _0x1b27f2;};'use strict';function template(_0x917afb){this['id']=_0x917afb['id']||0x0;this[_0xed8b('0x0')]=_0x917afb[_0xed8b('0x0')]||'';this[_0xed8b('0x1')]=_0x917afb[_0xed8b('0x1')]||'';}module[_0xed8b('0x2')]=template; \ No newline at end of file +var _0x66dd=['exports','name','html'];(function(_0x22b39b,_0x2b7d63){var _0x280e1d=function(_0xc74635){while(--_0xc74635){_0x22b39b['push'](_0x22b39b['shift']());}};_0x280e1d(++_0x2b7d63);}(_0x66dd,0xb8));var _0xd66d=function(_0x4f7128,_0x2f1610){_0x4f7128=_0x4f7128-0x0;var _0x4a8972=_0x66dd[_0x4f7128];return _0x4a8972;};'use strict';function template(_0x206c94){this['id']=_0x206c94['id']||0x0;this[_0xd66d('0x0')]=_0x206c94[_0xd66d('0x0')]||'';this[_0xd66d('0x1')]=_0x206c94[_0xd66d('0x1')]||'';}module[_0xd66d('0x2')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index a378639..ebdcdc4 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 _0x00bb=['status','AllConditions','AnyConditions','exports','name','channel'];(function(_0x401dbf,_0x196a09){var _0x1c0121=function(_0x4edcc5){while(--_0x4edcc5){_0x401dbf['push'](_0x401dbf['shift']());}};_0x1c0121(++_0x196a09);}(_0x00bb,0x1d8));var _0xb00b=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x00bb[_0x5c351c];return _0x26f3b3;};'use strict';function Trigger(_0x4b870b){this['id']=_0x4b870b['id']||0x0;this[_0xb00b('0x0')]=_0x4b870b[_0xb00b('0x0')]||'';this['channel']=_0x4b870b[_0xb00b('0x1')]||'voice';this[_0xb00b('0x2')]=_0x4b870b[_0xb00b('0x2')]||![];this['AllConditions']=_0x4b870b[_0xb00b('0x3')]||[];this[_0xb00b('0x4')]=_0x4b870b['AnyConditions']||[];this['Actions']=_0x4b870b['Actions']||[];}module[_0xb00b('0x5')]=Trigger; \ No newline at end of file +var _0x54ef=['Actions','exports','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x451788,_0x126b42){var _0x132913=function(_0x36472b){while(--_0x36472b){_0x451788['push'](_0x451788['shift']());}};_0x132913(++_0x126b42);}(_0x54ef,0x112));var _0xf54e=function(_0x1148b0,_0x317236){_0x1148b0=_0x1148b0-0x0;var _0x1a9a3a=_0x54ef[_0x1148b0];return _0x1a9a3a;};'use strict';function Trigger(_0x19d4d5){this['id']=_0x19d4d5['id']||0x0;this[_0xf54e('0x0')]=_0x19d4d5[_0xf54e('0x0')]||'';this['channel']=_0x19d4d5[_0xf54e('0x1')]||_0xf54e('0x2');this[_0xf54e('0x3')]=_0x19d4d5[_0xf54e('0x3')]||![];this[_0xf54e('0x4')]=_0x19d4d5[_0xf54e('0x4')]||[];this[_0xf54e('0x5')]=_0x19d4d5['AnyConditions']||[];this['Actions']=_0x19d4d5[_0xf54e('0x6')]||[];}module[_0xf54e('0x7')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 22b4270..b6baa48 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 _0xc1d8=['unknown','registry','split','host','domain','domainport','registrationtime','exports','active','name','state','status'];(function(_0x3cd9db,_0xdb1609){var _0xa35bb7=function(_0x5a0505){while(--_0x5a0505){_0x3cd9db['push'](_0x3cd9db['shift']());}};_0xa35bb7(++_0xdb1609);}(_0xc1d8,0xec));var _0x8c1d=function(_0x20fe7e,_0x4e3a2b){_0x20fe7e=_0x20fe7e-0x0;var _0x2d7ff3=_0xc1d8[_0x20fe7e];return _0x2d7ff3;};'use strict';function Trunk(_0xdf425b){this['id']=_0xdf425b['id']||0x0;this[_0x8c1d('0x0')]=_0xdf425b['active']||![];this[_0x8c1d('0x1')]=_0xdf425b[_0x8c1d('0x1')]||'';this[_0x8c1d('0x2')]='unknown';this['stateTime']=0x0;this[_0x8c1d('0x3')]=_0x8c1d('0x4');this[_0x8c1d('0x5')]=_0xdf425b[_0x8c1d('0x5')]&&_0xdf425b[_0x8c1d('0x5')]['indexOf'](':')?_0xdf425b[_0x8c1d('0x5')][_0x8c1d('0x6')](':')[0x0]:'';this[_0x8c1d('0x7')]='';this['port']='';this[_0x8c1d('0x8')]='';this[_0x8c1d('0x9')]='';this['refresh']='';this['stateRegistry']=_0x8c1d('0x4');this[_0x8c1d('0xa')]='';this['address']='';}module[_0x8c1d('0xb')]=Trunk; \ No newline at end of file +var _0x3f19=['port','domainport','refresh','registrationtime','exports','active','name','state','unknown','stateTime','status','registry','indexOf','split'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x3f19,0x155));var _0x93f1=function(_0x31fb16,_0x3a4f55){_0x31fb16=_0x31fb16-0x0;var _0x50f4b7=_0x3f19[_0x31fb16];return _0x50f4b7;};'use strict';function Trunk(_0x422f6f){this['id']=_0x422f6f['id']||0x0;this[_0x93f1('0x0')]=_0x422f6f['active']||![];this[_0x93f1('0x1')]=_0x422f6f['name']||'';this[_0x93f1('0x2')]=_0x93f1('0x3');this[_0x93f1('0x4')]=0x0;this[_0x93f1('0x5')]=_0x93f1('0x3');this[_0x93f1('0x6')]=_0x422f6f[_0x93f1('0x6')]&&_0x422f6f[_0x93f1('0x6')][_0x93f1('0x7')](':')?_0x422f6f[_0x93f1('0x6')][_0x93f1('0x8')](':')[0x0]:'';this['host']='';this[_0x93f1('0x9')]='';this['domain']='';this[_0x93f1('0xa')]='';this[_0x93f1('0xb')]='';this['stateRegistry']=_0x93f1('0x3');this[_0x93f1('0xc')]='';this['address']='';}module[_0x93f1('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 2514418..2fc35c6 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 _0x2d2b=['mandatoryDisposition','exports','exten','recordingFormat','none'];(function(_0x46ef1e,_0x57d69b){var _0x34d2cf=function(_0x32bdd1){while(--_0x32bdd1){_0x46ef1e['push'](_0x46ef1e['shift']());}};_0x34d2cf(++_0x57d69b);}(_0x2d2b,0x7f));var _0xb2d2=function(_0x246e27,_0x47016d){_0x246e27=_0x246e27-0x0;var _0x1fe809=_0x2d2b[_0x246e27];return _0x1fe809;};'use strict';function voiceExtension(_0x3bf26c){this['id']=_0x3bf26c['id']||0x0;this[_0xb2d2('0x0')]=_0x3bf26c[_0xb2d2('0x0')]||'';this[_0xb2d2('0x1')]=_0x3bf26c[_0xb2d2('0x1')]||_0xb2d2('0x2');this[_0xb2d2('0x3')]=_0x3bf26c['mandatoryDisposition']||![];}module[_0xb2d2('0x4')]=voiceExtension; \ No newline at end of file +var _0x14af=['exports','exten','mandatoryDisposition'];(function(_0x12e0a2,_0x58164a){var _0x5da4a9=function(_0x5bc9ab){while(--_0x5bc9ab){_0x12e0a2['push'](_0x12e0a2['shift']());}};_0x5da4a9(++_0x58164a);}(_0x14af,0x136));var _0xf14a=function(_0x2e8a46,_0xa9e62f){_0x2e8a46=_0x2e8a46-0x0;var _0x494101=_0x14af[_0x2e8a46];return _0x494101;};'use strict';function voiceExtension(_0x34afd4){this['id']=_0x34afd4['id']||0x0;this[_0xf14a('0x0')]=_0x34afd4[_0xf14a('0x0')]||'';this['recordingFormat']=_0x34afd4['recordingFormat']||'none';this[_0xf14a('0x1')]=_0x34afd4['mandatoryDisposition']||![];}module[_0xf14a('0x2')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 2f067d6..63c3e99 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 _0x775a=['erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown','inuse','invalid','unavailable','ringing','ringinuse','wav','wav49','rrmemory','name','monitor_format','type','inbound','total','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundReCallsDay','startProgressive','handlePredictive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate'];(function(_0x6c8b9b,_0xc36fb5){var _0x3c9b08=function(_0x27b754){while(--_0x27b754){_0x6c8b9b['push'](_0x6c8b9b['shift']());}};_0x3c9b08(++_0xc36fb5);}(_0x775a,0x6f));var _0xa775=function(_0x1b895f,_0x1d0d04){_0x1b895f=_0x1b895f-0x0;var _0x374f8e=_0x775a[_0x1b895f];return _0x374f8e;};'use strict';var statusDesc=[_0xa775('0x0'),'not_inuse',_0xa775('0x1'),'busy',_0xa775('0x2'),_0xa775('0x3'),_0xa775('0x4'),_0xa775('0x5'),'onhold'];var monitorFormat={'wav':_0xa775('0x6'),'wav49':_0xa775('0x7'),'gsm':'gsm'};var strategy={'rrmemory':_0xa775('0x8'),'roundrobin':'roundrobin'};function VoiceQueue(_0x59f1bf){this['id']=_0x59f1bf['id']||0x0;this[_0xa775('0x9')]=_0x59f1bf[_0xa775('0x9')]||'';this[_0xa775('0xa')]=_0x59f1bf['monitor_format']||'';this[_0xa775('0xb')]=_0x59f1bf[_0xa775('0xb')]||_0xa775('0xc');this['waiting']=0x0;this['talking']=0x0;this[_0xa775('0xd')]=0x0;this['answered']=0x0;this[_0xa775('0xe')]=0x0;this[_0xa775('0xf')]=0x0;this[_0xa775('0x10')]=0x0;this[_0xa775('0x11')]=0x0;this[_0xa775('0x12')]=0x0;this[_0xa775('0x13')]=0x0;this[_0xa775('0x14')]=0x0;this[_0xa775('0x15')]=_0x59f1bf[_0xa775('0x15')]||![];this[_0xa775('0x16')]=_0x59f1bf[_0xa775('0x16')]||0xa;this['autopause']=_0x59f1bf[_0xa775('0x17')]||'no';this['sendMessageOneNotActive']=!![];this['message']='';this[_0xa775('0x18')]=0x0;this['temp']=0x0;this[_0xa775('0x19')]=_0x59f1bf['dialTimezone']||null;this[_0xa775('0x1a')]=_0x59f1bf[_0xa775('0x1a')]?_0x59f1bf[_0xa775('0x1a')]:null;this['dialActive']=_0x59f1bf[_0xa775('0x1b')];this[_0xa775('0x1c')]=_0x59f1bf[_0xa775('0x1c')]||_0xa775('0x1d');this['dialLimitChannel']=_0x59f1bf[_0xa775('0x1e')]||0x0;this['dialLimitQueue']=_0x59f1bf[_0xa775('0x1f')]||0x0;this[_0xa775('0x20')]=_0x59f1bf['dialPowerLevel']||0x1;this['dialPredictiveOptimization']=_0x59f1bf[_0xa775('0x21')]||'dropRate';this[_0xa775('0x22')]=_0x59f1bf['dialPredictiveOptimizationPercentage']||0.03;this[_0xa775('0x23')]=_0x59f1bf['dialPredictiveInterval']||0x258;this['dialOriginateCallerIdName']=_0x59f1bf[_0xa775('0x24')]||_0xa775('0x25');this[_0xa775('0x26')]=_0x59f1bf[_0xa775('0x26')]||_0xa775('0x25');this[_0xa775('0x27')]=_0x59f1bf[_0xa775('0x27')]||0x1e;this[_0xa775('0x28')]=_0x59f1bf[_0xa775('0x28')]||_0xa775('0x29');this[_0xa775('0x2a')]=_0x59f1bf['dialQueueTimeout']||0x3;this[_0xa775('0x2b')]=_0x59f1bf[_0xa775('0x2b')]||undefined;this[_0xa775('0x2c')]=_0x59f1bf[_0xa775('0x2c')]||0x3;this[_0xa775('0x2d')]=_0x59f1bf['dialCongestionRetryFrequency']||0x96;this['dialBusyMaxRetry']=_0x59f1bf[_0xa775('0x2e')]||0x3;this[_0xa775('0x2f')]=_0x59f1bf[_0xa775('0x2f')]||0x96;this[_0xa775('0x30')]=_0x59f1bf[_0xa775('0x30')]||0x3;this[_0xa775('0x31')]=_0x59f1bf['dialNoAnswerRetryFrequency']||0x96;this[_0xa775('0x32')]=_0x59f1bf[_0xa775('0x32')]||0x4;this[_0xa775('0x33')]=_0x59f1bf[_0xa775('0x33')]?_0x59f1bf[_0xa775('0x33')]:undefined;this[_0xa775('0x34')]=_0x59f1bf[_0xa775('0x34')]?_0x59f1bf[_0xa775('0x34')]:undefined;this[_0xa775('0x35')]=_0x59f1bf['dialPrefix']||undefined;this['Interval']=_0x59f1bf[_0xa775('0x36')]?_0x59f1bf[_0xa775('0x36')]:undefined;this['dialOrderByScheduledAt']=_0x59f1bf[_0xa775('0x37')]||_0xa775('0x38');this[_0xa775('0x39')]=_0x59f1bf[_0xa775('0x39')]||undefined;this['dialCutDigit']=_0x59f1bf[_0xa775('0x3a')]||undefined;this[_0xa775('0x3b')]=strategy[_0x59f1bf[_0xa775('0x3b')]]||_0xa775('0x8');this['queueStatusComplete']=!![];this[_0xa775('0x3c')]=_0x59f1bf[_0xa775('0x3c')]||![];this[_0xa775('0x3d')]=_0x59f1bf['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x59f1bf[_0xa775('0x3e')];this[_0xa775('0x3f')]=_0x59f1bf[_0xa775('0x3f')];this['dialAMDTotalAnalysisTime']=_0x59f1bf[_0xa775('0x40')];this['dialAMDMinWordLength']=_0x59f1bf[_0xa775('0x41')];this[_0xa775('0x42')]=_0x59f1bf[_0xa775('0x42')];this[_0xa775('0x43')]=_0x59f1bf[_0xa775('0x43')];this[_0xa775('0x44')]=_0x59f1bf[_0xa775('0x44')];this[_0xa775('0x45')]=_0x59f1bf[_0xa775('0x45')];this[_0xa775('0x46')]=0x0;this[_0xa775('0x47')]=0x0;this[_0xa775('0x48')]=_0x59f1bf[_0xa775('0x48')];this[_0xa775('0x49')]=0x0;this[_0xa775('0x4a')]=0x0;this[_0xa775('0x4b')]=0x0;this['outboundBusyCallsDay']=0x0;this['outboundCongestionCallsDay']=0x0;this[_0xa775('0x4c')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0xa775('0x4d')]=0x0;this[_0xa775('0x4e')]=0x0;this[_0xa775('0x4f')]=0x0;this[_0xa775('0x50')]=0x0;this['outboundDropCallsDayACS']=0x0;this[_0xa775('0x51')]=0x0;this[_0xa775('0x52')]=undefined;this['startPredictive']=undefined;this[_0xa775('0x53')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0xa775('0x54')]=0x0;this[_0xa775('0x55')]=0x0;this[_0xa775('0x56')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0xa775('0x57')]=0x0;this[_0xa775('0x58')]=0x0;this['predictiveIntervalAvailable']=0x0;this[_0xa775('0x59')]=_0x59f1bf[_0xa775('0x5a')]||0x14;this[_0xa775('0x5b')]=_0x59f1bf[_0xa775('0x5a')]||0xa;this[_0xa775('0x5c')]=0x0;this[_0xa775('0x5d')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0xa775('0x5e')]=0x0;this[_0xa775('0x5f')]=0x0;this[_0xa775('0x60')]=0x0;this[_0xa775('0x61')]=0x0;this[_0xa775('0x62')]=_0x59f1bf['dialRecallMeTimeout']||0x1e;this['dialRecallInQueue']=_0x59f1bf[_0xa775('0x63')]||![];this['dialQueueProject2']=_0x59f1bf['dialQueueProject2']||undefined;this['dialAgiAfterHangupClient']=_0x59f1bf[_0xa775('0x64')]||![];this['dialAgiAfterHangupAgent']=_0x59f1bf[_0xa775('0x65')]||![];this['monitor_format']=monitorFormat[_0x59f1bf['monitor_format']]?monitorFormat[_0x59f1bf[_0xa775('0xa')]]:undefined;this[_0xa775('0x66')]=_0x59f1bf[_0xa775('0x66')]||![];this[_0xa775('0x67')]=_0x59f1bf[_0xa775('0x67')]?_0x59f1bf[_0xa775('0x67')]:undefined;}module['exports']=VoiceQueue; \ No newline at end of file +var _0x1d2b=['temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundReCallsDay','startProgressive','startPredictive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','busy','invalid','ringinuse','onhold','wav','wav49','rrmemory','name','type','talking','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','loggedIn','available','acw','acwTimeout','autopause'];(function(_0x145651,_0x256135){var _0x3d0d77=function(_0x2662cf){while(--_0x2662cf){_0x145651['push'](_0x145651['shift']());}};_0x3d0d77(++_0x256135);}(_0x1d2b,0x1d6));var _0xb1d2=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x1d2b[_0x5447fd];return _0x15b28a;};'use strict';var statusDesc=['unknown','not_inuse','inuse',_0xb1d2('0x0'),_0xb1d2('0x1'),'unavailable','ringing',_0xb1d2('0x2'),_0xb1d2('0x3')];var monitorFormat={'wav':_0xb1d2('0x4'),'wav49':_0xb1d2('0x5'),'gsm':'gsm'};var strategy={'rrmemory':_0xb1d2('0x6'),'roundrobin':'roundrobin'};function VoiceQueue(_0x3bafec){this['id']=_0x3bafec['id']||0x0;this[_0xb1d2('0x7')]=_0x3bafec[_0xb1d2('0x7')]||'';this['monitor_format']=_0x3bafec['monitor_format']||'';this[_0xb1d2('0x8')]=_0x3bafec[_0xb1d2('0x8')]||'inbound';this['waiting']=0x0;this[_0xb1d2('0x9')]=0x0;this['total']=0x0;this[_0xb1d2('0xa')]=0x0;this[_0xb1d2('0xb')]=0x0;this[_0xb1d2('0xc')]=0x0;this[_0xb1d2('0xd')]=0x0;this[_0xb1d2('0xe')]=0x0;this['abandoned']=0x0;this[_0xb1d2('0xf')]=0x0;this[_0xb1d2('0x10')]=0x0;this[_0xb1d2('0x11')]=_0x3bafec['acw']||![];this['acwTimeout']=_0x3bafec[_0xb1d2('0x12')]||0xa;this[_0xb1d2('0x13')]=_0x3bafec[_0xb1d2('0x13')]||'no';this['sendMessageOneNotActive']=!![];this['message']='';this['originated']=0x0;this[_0xb1d2('0x14')]=0x0;this[_0xb1d2('0x15')]=_0x3bafec[_0xb1d2('0x15')]||null;this['dialGlobalInterval']=_0x3bafec[_0xb1d2('0x16')]?_0x3bafec['dialGlobalInterval']:null;this[_0xb1d2('0x17')]=_0x3bafec[_0xb1d2('0x17')];this[_0xb1d2('0x18')]=_0x3bafec[_0xb1d2('0x18')]||'progressive';this['dialLimitChannel']=_0x3bafec[_0xb1d2('0x19')]||0x0;this[_0xb1d2('0x1a')]=_0x3bafec[_0xb1d2('0x1a')]||0x0;this[_0xb1d2('0x1b')]=_0x3bafec[_0xb1d2('0x1b')]||0x1;this[_0xb1d2('0x1c')]=_0x3bafec[_0xb1d2('0x1c')]||'dropRate';this['dialPredictiveOptimizationPercentage']=_0x3bafec[_0xb1d2('0x1d')]||0.03;this[_0xb1d2('0x1e')]=_0x3bafec[_0xb1d2('0x1e')]||0x258;this[_0xb1d2('0x1f')]=_0x3bafec['dialOriginateCallerIdName']||'anonymous';this[_0xb1d2('0x20')]=_0x3bafec['dialOriginateCallerIdNumber']||_0xb1d2('0x21');this[_0xb1d2('0x22')]=_0x3bafec[_0xb1d2('0x22')]||0x1e;this['dialQueueOptions']=_0x3bafec[_0xb1d2('0x23')]||'tTxX';this[_0xb1d2('0x24')]=_0x3bafec[_0xb1d2('0x24')]||0x3;this['dialQueueProject']=_0x3bafec[_0xb1d2('0x25')]||undefined;this['dialCongestionMaxRetry']=_0x3bafec[_0xb1d2('0x26')]||0x3;this[_0xb1d2('0x27')]=_0x3bafec[_0xb1d2('0x27')]||0x96;this[_0xb1d2('0x28')]=_0x3bafec[_0xb1d2('0x28')]||0x3;this[_0xb1d2('0x29')]=_0x3bafec[_0xb1d2('0x29')]||0x96;this[_0xb1d2('0x2a')]=_0x3bafec[_0xb1d2('0x2a')]||0x3;this[_0xb1d2('0x2b')]=_0x3bafec[_0xb1d2('0x2b')]||0x96;this[_0xb1d2('0x2c')]=_0x3bafec['dialGlobalMaxRetry']||0x4;this[_0xb1d2('0x2d')]=_0x3bafec[_0xb1d2('0x2d')]?_0x3bafec[_0xb1d2('0x2d')]:undefined;this[_0xb1d2('0x2e')]=_0x3bafec[_0xb1d2('0x2e')]?_0x3bafec['TrunkBackup']:undefined;this[_0xb1d2('0x2f')]=_0x3bafec[_0xb1d2('0x2f')]||undefined;this[_0xb1d2('0x30')]=_0x3bafec['Interval']?_0x3bafec[_0xb1d2('0x30')]:undefined;this[_0xb1d2('0x31')]=_0x3bafec['dialOrderByScheduledAt']||_0xb1d2('0x32');this['dialRandomLastDigitCallerIdNumber']=_0x3bafec['dialRandomLastDigitCallerIdNumber']||undefined;this[_0xb1d2('0x33')]=_0x3bafec['dialCutDigit']||undefined;this[_0xb1d2('0x34')]=strategy[_0x3bafec[_0xb1d2('0x34')]]||'rrmemory';this[_0xb1d2('0x35')]=!![];this[_0xb1d2('0x36')]=_0x3bafec[_0xb1d2('0x36')]||![];this[_0xb1d2('0x37')]=_0x3bafec[_0xb1d2('0x37')];this[_0xb1d2('0x38')]=_0x3bafec['dialAMDGreeting'];this[_0xb1d2('0x39')]=_0x3bafec[_0xb1d2('0x39')];this[_0xb1d2('0x3a')]=_0x3bafec[_0xb1d2('0x3a')];this[_0xb1d2('0x3b')]=_0x3bafec['dialAMDMinWordLength'];this[_0xb1d2('0x3c')]=_0x3bafec[_0xb1d2('0x3c')];this[_0xb1d2('0x3d')]=_0x3bafec['dialAMDMaximumNumberOfWords'];this['dialAMDSilenceThreshold']=_0x3bafec[_0xb1d2('0x3e')];this[_0xb1d2('0x3f')]=_0x3bafec['dialAMDMaximumWordLength'];this['outboundRejectCallsDay']=0x0;this['pTalking']=0x0;this[_0xb1d2('0x40')]=_0x3bafec[_0xb1d2('0x40')];this[_0xb1d2('0x41')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0xb1d2('0x42')]=0x0;this[_0xb1d2('0x43')]=0x0;this[_0xb1d2('0x44')]=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0xb1d2('0x45')]=0x0;this['outboundBlacklistCallsDay']=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0xb1d2('0x46')]=0x0;this[_0xb1d2('0x47')]=0x0;this['outboundDropCallsDayACS']=0x0;this[_0xb1d2('0x48')]=0x0;this[_0xb1d2('0x49')]=undefined;this[_0xb1d2('0x4a')]=undefined;this['handlePredictive']=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0xb1d2('0x4b')]=0x0;this[_0xb1d2('0x4c')]=0x0;this[_0xb1d2('0x4d')]=0x0;this[_0xb1d2('0x4e')]=0x0;this[_0xb1d2('0x4f')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0xb1d2('0x50')]=0x0;this[_0xb1d2('0x51')]=0x0;this[_0xb1d2('0x52')]=_0x3bafec['dialPredictiveIntervalMaxThreshold']||0x14;this[_0xb1d2('0x53')]=_0x3bafec['dialPredictiveIntervalMaxThreshold']||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0xb1d2('0x54')]=0x0;this[_0xb1d2('0x55')]=0x1;this[_0xb1d2('0x56')]=0x0;this[_0xb1d2('0x57')]=0x0;this[_0xb1d2('0x58')]=0x0;this[_0xb1d2('0x59')]=0x0;this[_0xb1d2('0x5a')]=_0x3bafec[_0xb1d2('0x5a')]||0x1e;this[_0xb1d2('0x5b')]=_0x3bafec[_0xb1d2('0x5b')]||![];this[_0xb1d2('0x5c')]=_0x3bafec[_0xb1d2('0x5c')]||undefined;this[_0xb1d2('0x5d')]=_0x3bafec[_0xb1d2('0x5d')]||![];this[_0xb1d2('0x5e')]=_0x3bafec[_0xb1d2('0x5e')]||![];this['monitor_format']=monitorFormat[_0x3bafec['monitor_format']]?monitorFormat[_0x3bafec['monitor_format']]:undefined;this[_0xb1d2('0x5f')]=_0x3bafec[_0xb1d2('0x5f')]||![];this[_0xb1d2('0x60')]=_0x3bafec[_0xb1d2('0x60')]?_0x3bafec[_0xb1d2('0x60')]:undefined;}module[_0xb1d2('0x61')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 9144686..ae9f643 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 _0x9bcd=['remoteUri','serverUrl','Configurations','exports','name','username','accessKey'];(function(_0x3637fe,_0x13be17){var _0x6fbb65=function(_0x4f51c0){while(--_0x4f51c0){_0x3637fe['push'](_0x3637fe['shift']());}};_0x6fbb65(++_0x13be17);}(_0x9bcd,0x170));var _0xd9bc=function(_0x3f9153,_0x280eae){_0x3f9153=_0x3f9153-0x0;var _0x19f1d5=_0x9bcd[_0x3f9153];return _0x19f1d5;};'use strict';function VtigerAccount(_0x5e8039){this['id']=_0x5e8039['id']||0x0;this[_0xd9bc('0x0')]=_0x5e8039['name']||'';this[_0xd9bc('0x1')]=_0x5e8039['username']||'';this[_0xd9bc('0x2')]=_0x5e8039[_0xd9bc('0x2')]||'';this[_0xd9bc('0x3')]=_0x5e8039['remoteUri']||'';this['serverUrl']=_0x5e8039[_0xd9bc('0x4')]||'';this['Configurations']=_0x5e8039[_0xd9bc('0x5')]||{};}module[_0xd9bc('0x6')]=VtigerAccount; \ No newline at end of file +var _0xe7fa=['exports','name','accessKey','remoteUri','serverUrl','Configurations'];(function(_0x5ea79d,_0x2b6657){var _0x3c2b27=function(_0x160aad){while(--_0x160aad){_0x5ea79d['push'](_0x5ea79d['shift']());}};_0x3c2b27(++_0x2b6657);}(_0xe7fa,0x109));var _0xae7f=function(_0x28d673,_0x4d9360){_0x28d673=_0x28d673-0x0;var _0x5c8f1b=_0xe7fa[_0x28d673];return _0x5c8f1b;};'use strict';function VtigerAccount(_0x2d957a){this['id']=_0x2d957a['id']||0x0;this[_0xae7f('0x0')]=_0x2d957a[_0xae7f('0x0')]||'';this['username']=_0x2d957a['username']||'';this[_0xae7f('0x1')]=_0x2d957a['accessKey']||'';this[_0xae7f('0x2')]=_0x2d957a[_0xae7f('0x2')]||'';this[_0xae7f('0x3')]=_0x2d957a[_0xae7f('0x3')]||'';this[_0xae7f('0x4')]=_0x2d957a[_0xae7f('0x4')]||{};}module[_0xae7f('0x5')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 760c024..3542f5e 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 _0x5f2f=['authType','type','integrationTab','serverUrl','Configurations','name','username','password','token','remoteUri'];(function(_0x4b2a90,_0xba32e6){var _0x1cea31=function(_0x1b09b){while(--_0x1b09b){_0x4b2a90['push'](_0x4b2a90['shift']());}};_0x1cea31(++_0xba32e6);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4a4d83,_0x33fafb){_0x4a4d83=_0x4a4d83-0x0;var _0x262b54=_0x5f2f[_0x4a4d83];return _0x262b54;};'use strict';function ZendeskAccount(_0x7c86d8){this['id']=_0x7c86d8['id']||0x0;this[_0xf5f2('0x0')]=_0x7c86d8[_0xf5f2('0x0')]||'';this[_0xf5f2('0x1')]=_0x7c86d8[_0xf5f2('0x1')]||'';this[_0xf5f2('0x2')]=_0x7c86d8[_0xf5f2('0x2')]||'';this[_0xf5f2('0x3')]=_0x7c86d8['token']||'';this['remoteUri']=_0x7c86d8[_0xf5f2('0x4')]||'';this[_0xf5f2('0x5')]=_0x7c86d8[_0xf5f2('0x5')]||'';this[_0xf5f2('0x6')]=_0x7c86d8[_0xf5f2('0x6')]||_0xf5f2('0x7');this['serverUrl']=_0x7c86d8[_0xf5f2('0x8')]||'';this[_0xf5f2('0x9')]=_0x7c86d8[_0xf5f2('0x9')]||{};}module['exports']=ZendeskAccount; \ No newline at end of file +var _0x7a54=['serverUrl','Configurations','name','username','password','token','remoteUri','authType','type','integrationTab'];(function(_0x568cf0,_0x1a44cb){var _0x360f81=function(_0x414953){while(--_0x414953){_0x568cf0['push'](_0x568cf0['shift']());}};_0x360f81(++_0x1a44cb);}(_0x7a54,0x106));var _0x47a5=function(_0x295a7f,_0x3aabab){_0x295a7f=_0x295a7f-0x0;var _0xfb2e61=_0x7a54[_0x295a7f];return _0xfb2e61;};'use strict';function ZendeskAccount(_0xe384a5){this['id']=_0xe384a5['id']||0x0;this[_0x47a5('0x0')]=_0xe384a5[_0x47a5('0x0')]||'';this['username']=_0xe384a5[_0x47a5('0x1')]||'';this[_0x47a5('0x2')]=_0xe384a5['password']||'';this[_0x47a5('0x3')]=_0xe384a5[_0x47a5('0x3')]||'';this[_0x47a5('0x4')]=_0xe384a5[_0x47a5('0x4')]||'';this[_0x47a5('0x5')]=_0xe384a5['authType']||'';this[_0x47a5('0x6')]=_0xe384a5['type']||_0x47a5('0x7');this[_0x47a5('0x8')]=_0xe384a5['serverUrl']||'';this[_0x47a5('0x9')]=_0xe384a5['Configurations']||{};}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 69abcef..d89c8b9 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 _0xd509=['code','refreshToken','Configurations','name','description','zone','clientId','clientSecret','serverUrl'];(function(_0xcc6685,_0x31a1cf){var _0x1bfcc5=function(_0x1ee3f4){while(--_0x1ee3f4){_0xcc6685['push'](_0xcc6685['shift']());}};_0x1bfcc5(++_0x31a1cf);}(_0xd509,0xc9));var _0x9d50=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd509[_0x3dd15e];return _0x231fd0;};'use strict';function ZohoAccount(_0x1895de){this['id']=_0x1895de['id']||0x0;this['name']=_0x1895de[_0x9d50('0x0')]||'';this[_0x9d50('0x1')]=_0x1895de[_0x9d50('0x1')]||'';this['host']=_0x1895de['host']||'';this[_0x9d50('0x2')]=_0x1895de[_0x9d50('0x2')]||'';this['clientId']=_0x1895de[_0x9d50('0x3')]||'';this[_0x9d50('0x4')]=_0x1895de[_0x9d50('0x4')]||'';this['serverUrl']=_0x1895de[_0x9d50('0x5')]||'';this['code']=_0x1895de[_0x9d50('0x6')]||'';this[_0x9d50('0x7')]=_0x1895de[_0x9d50('0x7')]||'';this[_0x9d50('0x8')]=_0x1895de[_0x9d50('0x8')]||{};}module['exports']=ZohoAccount; \ No newline at end of file +var _0x5360=['Configurations','name','description','host','zone','clientId','serverUrl','code','refreshToken'];(function(_0xcafc72,_0xff3ee){var _0x4c8bf2=function(_0x1a5741){while(--_0x1a5741){_0xcafc72['push'](_0xcafc72['shift']());}};_0x4c8bf2(++_0xff3ee);}(_0x5360,0x157));var _0x0536=function(_0xe0afca,_0x3d61a9){_0xe0afca=_0xe0afca-0x0;var _0x5cac87=_0x5360[_0xe0afca];return _0x5cac87;};'use strict';function ZohoAccount(_0x1920b0){this['id']=_0x1920b0['id']||0x0;this[_0x0536('0x0')]=_0x1920b0[_0x0536('0x0')]||'';this[_0x0536('0x1')]=_0x1920b0['description']||'';this['host']=_0x1920b0[_0x0536('0x2')]||'';this['zone']=_0x1920b0[_0x0536('0x3')]||'';this[_0x0536('0x4')]=_0x1920b0['clientId']||'';this['clientSecret']=_0x1920b0['clientSecret']||'';this[_0x0536('0x5')]=_0x1920b0[_0x0536('0x5')]||'';this[_0x0536('0x6')]=_0x1920b0[_0x0536('0x6')]||'';this['refreshToken']=_0x1920b0[_0x0536('0x7')]||'';this[_0x0536('0x8')]=_0x1920b0[_0x0536('0x8')]||{};}module['exports']=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 26931a3..cdb35ba 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 _0x33ee=['VoiceQueueId','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','calleridname','lodash','moment','isNil','string','uniqueid','idContact','queue','name','type','campaigntype','dialAnswer','Agent','channelAgent','membername','SIP/%s','phone','firstName','Contact','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x33ee,0x78));var _0xe33e=function(_0x52684f,_0xff73fc){_0x52684f=_0x52684f-0x0;var _0x4a55f0=_0x33ee[_0x52684f];return _0x4a55f0;};'use strict';var util=require('util');var _=require(_0xe33e('0x0'));var moment=require(_0xe33e('0x1'));function checkNameSurname(_0x49d962,_0x4d79eb,_0x1b6bba){var _0x328688='';if(!_[_0xe33e('0x2')](_0x4d79eb)&&_0xe33e('0x3')===typeof _0x4d79eb){_0x328688+=_0x4d79eb;}if(!_['isNil'](_0x1b6bba)&&'string'===typeof _0x1b6bba){_0x328688+='\x20'+_0x1b6bba;}if(_0x328688!==''){return _0x328688;}return _0x49d962;}function Action(_0x2430b0,_0x4bd22d,_0x310e40,_0x5b1863,_0x351c88){this[_0xe33e('0x4')]=_0x310e40||undefined;this[_0xe33e('0x5')]=_0x2430b0['id'];this[_0xe33e('0x6')]=_0x4bd22d[_0xe33e('0x7')];this[_0xe33e('0x8')]=_0x4bd22d[_0xe33e('0x8')];this[_0xe33e('0x9')]=_0xe33e('0x6');this[_0xe33e('0xa')]=![];this['membername']=_['isNil'](_0x2430b0[_0xe33e('0xb')])?undefined:_0x2430b0['Agent']['name'];this[_0xe33e('0xc')]=this[_0xe33e('0xd')]?util['format'](_0xe33e('0xe'),this['membername']):_0x5b1863||undefined;this['calleridname']=checkNameSurname(_0x2430b0['Contact'][_0xe33e('0xf')],_0x2430b0['Contact'][_0xe33e('0x10')],_0x2430b0[_0xe33e('0x11')][_0xe33e('0x12')]);this[_0xe33e('0x13')]=_0x2430b0[_0xe33e('0x13')]||![];this[_0xe33e('0x14')]=_0x2430b0[_0xe33e('0x11')][_0xe33e('0xf')];this[_0xe33e('0x15')]=_0x2430b0['scheduledat'];this[_0xe33e('0x16')]=_0x2430b0[_0xe33e('0x16')]||0x0;this[_0xe33e('0x17')]=_0x2430b0['countcongestionretry']||0x0;this[_0xe33e('0x18')]=_0x2430b0[_0xe33e('0x18')]||0x0;this[_0xe33e('0x19')]=(_0x2430b0[_0xe33e('0x16')]||0x0)+(_0x2430b0['countcongestionretry']||0x0)+(_0x2430b0[_0xe33e('0x18')]||0x0);this[_0xe33e('0x1a')]=_0x2430b0['callback'];this[_0xe33e('0x1b')]=_0x2430b0[_0xe33e('0x1b')];this[_0xe33e('0x1c')]=_0x2430b0[_0xe33e('0x1c')];this['recallme']=_0x2430b0[_0xe33e('0x1d')];this[_0xe33e('0x1e')]=_0x2430b0['ContactId'];this['ListId']=_0x2430b0['ListId'];this[_0xe33e('0x1f')]=_[_0xe33e('0x2')](_0x2430b0['Agent'])?_0x2430b0['UserId']:_0x2430b0[_0xe33e('0xb')]['id'];this[_0xe33e('0x20')]=_0x2430b0[_0xe33e('0x20')];this[_0xe33e('0x21')]='';this[_0xe33e('0x22')]='';}Action['prototype'][_0xe33e('0x23')]=function(){return util['format'](_0xe33e('0x24'),this[_0xe33e('0x25')],this['number']);};module['exports']=Action; \ No newline at end of file +var _0x1b89=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','format','calleridname','number','exports','util','lodash','moment','isNil','string','uniqueid','idContact','name','type','campaigntype','queue','dialAnswer','Agent','channelAgent','membername','SIP/%s','Contact','phone','lastName','active','calleridnum','scheduledat','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','callbackuniqueid'];(function(_0x5bdfa7,_0x1f1619){var _0xfe3e67=function(_0x22657a){while(--_0x22657a){_0x5bdfa7['push'](_0x5bdfa7['shift']());}};_0xfe3e67(++_0x1f1619);}(_0x1b89,0x89));var _0x91b8=function(_0x10f90b,_0x76a834){_0x10f90b=_0x10f90b-0x0;var _0x22586a=_0x1b89[_0x10f90b];return _0x22586a;};'use strict';var util=require(_0x91b8('0x0'));var _=require(_0x91b8('0x1'));var moment=require(_0x91b8('0x2'));function checkNameSurname(_0x4cc19d,_0x25e270,_0x45948a){var _0x51e125='';if(!_[_0x91b8('0x3')](_0x25e270)&&_0x91b8('0x4')===typeof _0x25e270){_0x51e125+=_0x25e270;}if(!_['isNil'](_0x45948a)&&_0x91b8('0x4')===typeof _0x45948a){_0x51e125+='\x20'+_0x45948a;}if(_0x51e125!==''){return _0x51e125;}return _0x4cc19d;}function Action(_0x5d5465,_0x1d4148,_0x2ab397,_0x4ba1c9,_0x391719){this[_0x91b8('0x5')]=_0x2ab397||undefined;this[_0x91b8('0x6')]=_0x5d5465['id'];this['queue']=_0x1d4148[_0x91b8('0x7')];this[_0x91b8('0x8')]=_0x1d4148[_0x91b8('0x8')];this[_0x91b8('0x9')]=_0x91b8('0xa');this[_0x91b8('0xb')]=![];this['membername']=_[_0x91b8('0x3')](_0x5d5465[_0x91b8('0xc')])?undefined:_0x5d5465[_0x91b8('0xc')]['name'];this[_0x91b8('0xd')]=this[_0x91b8('0xe')]?util['format'](_0x91b8('0xf'),this[_0x91b8('0xe')]):_0x4ba1c9||undefined;this['calleridname']=checkNameSurname(_0x5d5465[_0x91b8('0x10')][_0x91b8('0x11')],_0x5d5465[_0x91b8('0x10')]['firstName'],_0x5d5465[_0x91b8('0x10')][_0x91b8('0x12')]);this[_0x91b8('0x13')]=_0x5d5465[_0x91b8('0x13')]||![];this[_0x91b8('0x14')]=_0x5d5465[_0x91b8('0x10')][_0x91b8('0x11')];this[_0x91b8('0x15')]=_0x5d5465[_0x91b8('0x15')];this['countbusyretry']=_0x5d5465['countbusyretry']||0x0;this[_0x91b8('0x16')]=_0x5d5465['countcongestionretry']||0x0;this[_0x91b8('0x17')]=_0x5d5465[_0x91b8('0x17')]||0x0;this[_0x91b8('0x18')]=(_0x5d5465[_0x91b8('0x19')]||0x0)+(_0x5d5465['countcongestionretry']||0x0)+(_0x5d5465['countnoanswerretry']||0x0);this['callback']=_0x5d5465['callback'];this[_0x91b8('0x1a')]=_0x5d5465['callbackuniqueid'];this['callbackat']=_0x5d5465[_0x91b8('0x1b')];this[_0x91b8('0x1c')]=_0x5d5465[_0x91b8('0x1c')];this[_0x91b8('0x1d')]=_0x5d5465[_0x91b8('0x1d')];this[_0x91b8('0x1e')]=_0x5d5465['ListId'];this[_0x91b8('0x1f')]=_[_0x91b8('0x3')](_0x5d5465[_0x91b8('0xc')])?_0x5d5465['UserId']:_0x5d5465['Agent']['id'];this[_0x91b8('0x20')]=_0x5d5465[_0x91b8('0x20')];this[_0x91b8('0x21')]='';this[_0x91b8('0x22')]='';}Action[_0x91b8('0x23')][_0x91b8('0x24')]=function(){return util[_0x91b8('0x25')]('\x22%s\x22\x20<%s>',this[_0x91b8('0x26')],this[_0x91b8('0x27')]);};module[_0x91b8('0x28')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index afcaa34..9007291 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 _0x38cb=['[callProgressDetectingCustomer][logUnknownGlobal]','linkedid','[originated][decrement][callProgressDetectingCustomer]','originated:\x20','callProgressDetectingAgent','isUndefined','object','reason','logAgent','NoSuchNumber','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logBusy]','AnswerAGI','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','isNil','Contact','Contact\x20is\x20undefined','isEmpty','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','createHistory','[Blacklist][error]','SIP/%s','trunks','reachable','unmonitored','unlock','execRun','getContactPreview','recallme','validateContact','checkIsBlackList','Call\x20unsuccessful','[Preview][getContactPreview]','Agent','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','Empty\x20Campaign','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','isActive','\x20Not\x20Active','Is\x20Valid','execCall','SIP/%s/%s%s','dialPrefix','dialCutDigit','substring','trim','phone','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','merge','toLowerVariables','Action','[originated][increment]','OriginateError','actionid','lookAgent','logLookAgent','clone','isFailure','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','callProgressDetectingCustomer','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destlinkedid','destuniqueid','syncHangupRequest','addVariable','variables','keys','variable','value','error','inspect','transfertargetlinkedid','syncBlindTransfer','transfererlinkedid','exports','util','moment','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','campaignsPreview','voiceQueues','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','loopCampaigns','emit','outbound','name','strategy','answered','loggedIn','pTalking','sumBillable','sumHoldTime','total','type','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','Interval','stringify','md5','format','voice:queue:%s','voice_queue:save','info','voice_queue_channel:remove','sendMessageOneNotActive','available','paused','logger','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','hasOwnProperty','booked','clearZombieChannels','setMessage','recallMe','sequence','[clearZombieChannels][talking]','Queue','queue','pTalking:\x20','pick','contactId','UserId','VoiceQueueId','ListId','status','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','clearZombieChannel','getContactRecallMe','agentReadyId','getDiff','scheduledat','run','then','logger2','[RecallMe]','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','AGENTS_NOT_LOGGED','NOT_ACTIVE','isTrunkReachable','ACTIVE','countglobal','totalGlobal','[callProgressDetectingCustomer][logNoSuch]','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','ANSWER','responsetime','answertime','dialAnswer','[syncHangup][talking][increment]','uniqueid','\x20Queue','buildObj','connect','acw','custom:agentConnectPreview','custom:agentcomplete','complete','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','sumDuration','talktime','BUSY','countbusyretry','Busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','rescheduleContact','scheduledAt','dialBusyRetryFrequency','unlockAgent','activeContact','NOANSWER','countnoanswerretry','NoAnswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','countcongestionretry','Congestion','[callProgressDetectingCustomer][logCongestion]','dialCongestionMaxRetry','CANCEL','unlockContact','idContact','disableContact','[default]','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknown]'];(function(_0x5f573e,_0x4fe86d){var _0x4ef463=function(_0x58afef){while(--_0x58afef){_0x5f573e['push'](_0x5f573e['shift']());}};_0x4ef463(++_0x4fe86d);}(_0x38cb,0x1a0));var _0xb38c=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x38cb[_0xae7c2f];return _0x5d7001;};'use strict';var util=require(_0xb38c('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require('uuid');var moment=require(_0xb38c('0x1'));var md5=require('md5');var Redis=require(_0xb38c('0x2'));var config=require(_0xb38c('0x3'));var logger=require(_0xb38c('0x4'))(_0xb38c('0x5'));var loggerAction=require('../../../config/logger')(_0xb38c('0x6'));var ami=require(_0xb38c('0x7'));var rpcDb=require(_0xb38c('0x8'));var Action=require('./action');var ut=require(_0xb38c('0x9'));config[_0xb38c('0xa')]=_[_0xb38c('0xb')](config[_0xb38c('0xa')],{'host':_0xb38c('0xc'),'port':0x18eb});var io=require(_0xb38c('0xd'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0xb38c('0xe')][_0xb38c('0xf')]=function(_0x472462){this[_0xb38c('0x10')]=this[_0xb38c('0x10')]?this[_0xb38c('0x10')]['finally'](_0x472462):_0x472462();};function Preview(_0x21a9de){this['sequence']=new Sequence();this[_0xb38c('0x11')]=_0x21a9de[_0xb38c('0x12')];this['trunks']=_0x21a9de['trunks'];this[_0xb38c('0x13')]={};this[_0xb38c('0x14')]=_0x21a9de[_0xb38c('0x14')];this[_0xb38c('0x15')]=0x0;ami['on'](_0xb38c('0x16'),this[_0xb38c('0x17')][_0xb38c('0x18')](this));ami['on'](_0xb38c('0x19'),this[_0xb38c('0x1a')][_0xb38c('0x18')](this));ami['on'](_0xb38c('0x1b'),this['syncHangupRequest'][_0xb38c('0x18')](this));ami['on']('dialend',this[_0xb38c('0x1c')]['bind'](this));ami['on'](_0xb38c('0x1d'),this[_0xb38c('0x1e')][_0xb38c('0x18')](this));ami['on'](_0xb38c('0x1f'),this[_0xb38c('0x20')]['bind'](this));ami['on'](_0xb38c('0x21'),this[_0xb38c('0x22')][_0xb38c('0x18')](this));ami['on'](_0xb38c('0x23'),this['syncBlindTransfer'][_0xb38c('0x18')](this));this[_0xb38c('0x24')](this[_0xb38c('0x11')]);}function emit(_0x10b678,_0x5e3097,_0x3abc61){io['to'](_0x10b678)[_0xb38c('0x25')](_0x5e3097,_0x3abc61);}function emitCampaignPreview(_0x2bc656){if(_0x2bc656['type']===_0xb38c('0x26')){var _0x707c7f={'id':_0x2bc656['id'],'name':_0x2bc656[_0xb38c('0x27')],'strategy':_0x2bc656[_0xb38c('0x28')],'answered':_0x2bc656[_0xb38c('0x29')],'available':_0x2bc656['available'],'loggedIn':_0x2bc656[_0xb38c('0x2a')],'pTalking':_0x2bc656[_0xb38c('0x2b')],'sumBillable':_0x2bc656[_0xb38c('0x2c')],'sumDuration':_0x2bc656['sumDuration'],'sumHoldTime':_0x2bc656[_0xb38c('0x2d')]||0x0,'talking':_0x2bc656['talking'],'total':_0x2bc656[_0xb38c('0x2e')],'type':_0x2bc656[_0xb38c('0x2f')],'unmanaged':_0x2bc656[_0xb38c('0x30')],'abandoned':_0x2bc656[_0xb38c('0x31')],'waiting':_0x2bc656[_0xb38c('0x32')],'loggedInDb':_0x2bc656[_0xb38c('0x33')],'dialActive':_0x2bc656[_0xb38c('0x34')],'dialMethod':_0x2bc656[_0xb38c('0x35')],'dialOriginateCallerIdName':_0x2bc656[_0xb38c('0x36')],'dialOriginateCallerIdNumber':_0x2bc656[_0xb38c('0x37')],'dialOriginateTimeout':_0x2bc656['dialOriginateTimeout'],'dialPrefix':_0x2bc656['dialPrefix'],'outboundAnswerAgiCallsDay':_0x2bc656[_0xb38c('0x38')],'outboundAnswerCallsDay':_0x2bc656[_0xb38c('0x39')],'outboundBlacklistCallsDay':_0x2bc656[_0xb38c('0x3a')],'outboundBusyCallsDay':_0x2bc656[_0xb38c('0x3b')],'outboundCongestionCallsDay':_0x2bc656[_0xb38c('0x3c')],'outboundDropCallsDayACS':_0x2bc656['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x2bc656['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x2bc656[_0xb38c('0x3d')],'outboundNoAnswerCallsDay':_0x2bc656[_0xb38c('0x3e')],'outboundNoSuchCallsDay':_0x2bc656[_0xb38c('0x3f')],'outboundOriginateFailureCallsDay':_0x2bc656['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x2bc656[_0xb38c('0x40')],'outboundRejectCallsDay':_0x2bc656[_0xb38c('0x41')],'outboundUnknownCallsDay':_0x2bc656[_0xb38c('0x42')],'predictiveIntervalAnsweredCalls':_0x2bc656[_0xb38c('0x43')],'predictiveIntervalAvgHoldtime':_0x2bc656[_0xb38c('0x44')],'predictiveIntervalAvgTalktime':_0x2bc656[_0xb38c('0x45')],'predictiveIntervalDroppedCallsCallersExit':_0x2bc656[_0xb38c('0x46')],'predictiveIntervalDroppedCallsTimeout':_0x2bc656[_0xb38c('0x47')],'predictiveIntervalErlangCalls':_0x2bc656[_0xb38c('0x48')],'predictiveIntervalErlangCallsDroppedCalls':_0x2bc656[_0xb38c('0x49')],'predictiveIntervalHitRate':_0x2bc656[_0xb38c('0x4a')],'predictiveIntervalMultiplicativeFactor':_0x2bc656['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x2bc656['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x2bc656[_0xb38c('0x4b')],'predictiveIntervalTotalCalls':_0x2bc656[_0xb38c('0x4c')],'message':_0x2bc656[_0xb38c('0x4d')],'originated':_0x2bc656[_0xb38c('0x4e')],'erlangCalls':_0x2bc656[_0xb38c('0x4f')],'erlangCallToSecond':_0x2bc656['erlangCallToSecond'],'erlangAbandonmentRate':_0x2bc656[_0xb38c('0x50')],'erlangBusyFactor':_0x2bc656[_0xb38c('0x51')],'startPredictive':_0x2bc656['startPredictive'],'startProgressive':_0x2bc656['startProgressive']};if(_0x2bc656['Trunk']){_0x707c7f['Trunk']={'id':_0x2bc656[_0xb38c('0x52')]['id'],'name':_0x2bc656[_0xb38c('0x52')][_0xb38c('0x27')],'active':_0x2bc656[_0xb38c('0x52')][_0xb38c('0x53')],'callerid':_0x2bc656['Trunk'][_0xb38c('0x54')]};}if(_0x2bc656[_0xb38c('0x55')]){_0x707c7f[_0xb38c('0x55')]={'id':_0x2bc656['Interval']['id'],'name':_0x2bc656[_0xb38c('0x55')][_0xb38c('0x27')]};}var _0x22ec49=md5(JSON[_0xb38c('0x56')](_0x707c7f));if(_0x2bc656[_0xb38c('0x57')]!==_0x22ec49){_0x2bc656[_0xb38c('0x57')]=_0x22ec49;emit(util[_0xb38c('0x58')](_0xb38c('0x59'),_0x707c7f['name']),_0xb38c('0x5a'),_0x707c7f);}}}function emitVoiceQueueChannelRemove(_0x420c33){logger[_0xb38c('0x5b')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x420c33));emit(util[_0xb38c('0x58')](_0xb38c('0x59'),_0x420c33[_0xb38c('0x27')]),_0xb38c('0x5c'),_0x420c33);}function notSendMessagesQueue(_0x12e9c8){if(_0x12e9c8['sendMessageOneNotActive']){if(_0x12e9c8[_0xb38c('0x4e')]===0x0&&_0x12e9c8[_0xb38c('0x2b')]===0x0){_0x12e9c8[_0xb38c('0x5d')]=![];_0x12e9c8[_0xb38c('0x5e')]=0x0;_0x12e9c8[_0xb38c('0x5f')]=0x0;_0x12e9c8['message']='NOT_ACTIVE';ut[_0xb38c('0x60')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x12e9c8[_0xb38c('0x27')]+_0xb38c('0x61'));}else{_0x12e9c8[_0xb38c('0x4d')]=_0xb38c('0x62');ut[_0xb38c('0x60')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x12e9c8[_0xb38c('0x27')]+_0xb38c('0x63'));}emitCampaignPreview(_0x12e9c8);}}Preview['prototype'][_0xb38c('0x24')]=function(){var _0x1147fa=this;setInterval(function(){_0x1147fa['syncCampaigns']();},0x7cf);};Preview['prototype']['syncCampaigns']=function(){var _0x205f1b=this[_0xb38c('0x11')];this['clockClearZombieChannels']+=0x1;for(var _0x396a0f in _0x205f1b){if(_0x205f1b[_0xb38c('0x64')](_0x396a0f)&&(_0x205f1b[_0x396a0f]['dialMethod']==='preview'||_0x205f1b[_0x396a0f][_0xb38c('0x35')]===_0xb38c('0x65'))&&_0x205f1b[_0x396a0f][_0xb38c('0x2f')]===_0xb38c('0x26')){if(this[_0xb38c('0x15')]>0x7){this[_0xb38c('0x15')]=0x0;this[_0xb38c('0x66')]();}}if(_0x205f1b[_0xb38c('0x64')](_0x396a0f)&&_0x205f1b[_0x396a0f][_0xb38c('0x35')]===_0xb38c('0x5')&&_0x205f1b[_0x396a0f][_0xb38c('0x2f')]===_0xb38c('0x26')){if(_0x205f1b[_0x396a0f]['dialActive']){this[_0xb38c('0x67')](_0x205f1b[_0x396a0f]);this[_0xb38c('0x68')](_0x205f1b[_0x396a0f]);}else{notSendMessagesQueue(_0x205f1b[_0x396a0f]);}}}};Preview[_0xb38c('0xe')]['clearZombieChannel']=function(_0x4fe44b){var _0x3cb9fa=this;this[_0xb38c('0x69')][_0xb38c('0xf')](function(){if(!_['isNil'](_0x3cb9fa[_0xb38c('0x13')][_0x4fe44b])){loggerAction[_0xb38c('0x5b')](_0xb38c('0x6a'),_0x4fe44b,_0xb38c('0x6b'),_0x3cb9fa[_0xb38c('0x13')][_0x4fe44b][_0xb38c('0x6c')],'originated:\x20',JSON['stringify'](_0x3cb9fa['campaignsPreview'][_0x3cb9fa[_0xb38c('0x13')][_0x4fe44b][_0xb38c('0x6c')]][_0xb38c('0x4e')]),_0xb38c('0x6d'),JSON[_0xb38c('0x56')](_0x3cb9fa[_0xb38c('0x11')][_0x3cb9fa['actions'][_0x4fe44b][_0xb38c('0x6c')]][_0xb38c('0x2b')]),JSON['stringify'](_0x3cb9fa[_0xb38c('0x13')][_0x4fe44b]['dialAnswer']),JSON[_0xb38c('0x56')](_[_0xb38c('0x6e')](_0x3cb9fa[_0xb38c('0x13')][_0x4fe44b],[_0xb38c('0x6f'),_0xb38c('0x70'),_0xb38c('0x71'),_0xb38c('0x72')])));return ami['Action']({'action':_0xb38c('0x73'),'channel':_0x3cb9fa[_0xb38c('0x13')][_0x4fe44b]['channel']})[_0xb38c('0x74')](function(_0x49a1e5){if(_0x49a1e5[_0xb38c('0x4d')]===_0xb38c('0x75')){setTimeout(function(){if(_0x3cb9fa['actions'][_0x4fe44b]){ut[_0xb38c('0x76')](_0x3cb9fa['campaignsPreview'][_0x3cb9fa[_0xb38c('0x13')][_0x4fe44b][_0xb38c('0x6c')]],_0xb38c('0x77'));if(_0x3cb9fa[_0xb38c('0x13')][_0x4fe44b]['dialAnswer']===!![]){ut[_0xb38c('0x78')](_0x3cb9fa[_0xb38c('0x11')][_0x3cb9fa[_0xb38c('0x13')][_0x4fe44b][_0xb38c('0x6c')]],_0xb38c('0x77'));ut[_0xb38c('0x79')](_0xb38c('0x7a')+_0x4fe44b,_0x3cb9fa['actions'][_0x4fe44b][_0xb38c('0x6c')]);}ut[_0xb38c('0x79')](_0xb38c('0x7b')+_0x4fe44b,_0x3cb9fa[_0xb38c('0x13')][_0x4fe44b][_0xb38c('0x6c')]);delete _0x3cb9fa[_0xb38c('0x13')][_0x4fe44b];}},0x2328);}});}});};Preview[_0xb38c('0xe')][_0xb38c('0x66')]=function(){var _0x4cfc0c=this;loggerAction[_0xb38c('0x5b')](_0xb38c('0x7c'),_[_0xb38c('0x7d')](this[_0xb38c('0x13')]));for(var _0x4eefc9 in this['actions']){if(_0x4cfc0c[_0xb38c('0x13')][_0xb38c('0x64')](_0x4eefc9)){_0x4cfc0c[_0xb38c('0x7e')](_0x4eefc9);}}};Preview[_0xb38c('0xe')][_0xb38c('0x68')]=function(_0x4ba4d5){var _0x753e83=this;rpcDb[_0xb38c('0x7f')](_0x4ba4d5['id'],ut[_0xb38c('0x80')](this[_0xb38c('0x14')]))['then'](function(_0x28cfa0){if(!_['isNil'](_0x28cfa0)){for(var _0x3fbfa4=0x0;_0x3fbfa4<_0x28cfa0['length'];_0x3fbfa4+=0x1){if(ut[_0xb38c('0x81')](_0x28cfa0[_0x3fbfa4][_0xb38c('0x82')])<_0x4ba4d5['dialRecallMeTimeout']*0x3c){_0x753e83[_0xb38c('0x83')](_0x28cfa0[_0x3fbfa4]['id'])[_0xb38c('0x84')](ut[_0xb38c('0x85')](_0xb38c('0x86')))[_0xb38c('0x74')](ut[_0xb38c('0x85')](_0xb38c('0x86')));}else{var _0x539f0c=new Action(_0x28cfa0[_0x3fbfa4],_0x4ba4d5);_0x539f0c[_0xb38c('0x87')]=moment()[_0xb38c('0x58')](_0xb38c('0x88'));_0x4ba4d5[_0xb38c('0x40')]+=0x1;ut[_0xb38c('0x89')](_0x539f0c,0x17,'RecallInQueue');if(_0x4ba4d5[_0xb38c('0x8a')]){rpcDb[_0xb38c('0x8b')](ut[_0xb38c('0x8c')](_0x28cfa0[_0x3fbfa4]));rpcDb[_0xb38c('0x8d')](_0x539f0c,_0xb38c('0x8e'));}else{ut[_0xb38c('0x89')](_0x539f0c,0x16,_0xb38c('0x8f'));rpcDb['createCustomerHistory'](_0x539f0c,_0xb38c('0x90'));rpcDb[_0xb38c('0x91')](_0x539f0c,_0xb38c('0x90'));}}}}})[_0xb38c('0x74')](ut[_0xb38c('0x85')](_0xb38c('0x92')));};Preview[_0xb38c('0xe')][_0xb38c('0x67')]=function(_0x570a0e){_0x570a0e['sendMessageOneNotActive']=!![];if(ut['IsNotLoggedIn'](_0x570a0e[_0xb38c('0x2a')])){_0x570a0e[_0xb38c('0x4d')]=_0xb38c('0x93');}else if(!ut['isActive'](_0x570a0e[_0xb38c('0x34')])){_0x570a0e[_0xb38c('0x4d')]=_0xb38c('0x94');}else if(!this['isTrunkReachable'](_0x570a0e[_0xb38c('0x52')])){if(!this[_0xb38c('0x95')](_0x570a0e['TrunkBackup'])){_0x570a0e[_0xb38c('0x4d')]='TRUNK_IS_NOT_REACHABLE';}else{_0x570a0e[_0xb38c('0x4d')]=_0xb38c('0x96');}}else{_0x570a0e[_0xb38c('0x4d')]=_0xb38c('0x96');}emitCampaignPreview(_0x570a0e);};Preview[_0xb38c('0xe')]['callProgressDetectingCustomer']=function(_0x455c70,_0x31ec7d,_0x1fa85d){var _0x362e34=this;var _0x2f9590=this[_0xb38c('0x13')][_0x31ec7d];var _0x3f58ab=this[_0xb38c('0x11')][_0x2f9590[_0xb38c('0x6c')]];var _0x1e761f;if(_0x3f58ab){switch(_0x1fa85d){case'1':_0x3f58ab[_0xb38c('0x3f')]+=0x1;_0x2f9590[_0xb38c('0x97')]=ut[_0xb38c('0x98')](_0x2f9590);ut[_0xb38c('0x89')](_0x2f9590,0x0,'NoSuchNumber');rpcDb[_0xb38c('0x8d')](_0x2f9590,_0xb38c('0x99'));if(ut[_0xb38c('0x98')](_0x2f9590)>=_0x3f58ab['dialGlobalMaxRetry']){_0x1e761f=ut[_0xb38c('0x9a')](_0x2f9590,0xf,_0xb38c('0x9b'));rpcDb[_0xb38c('0x91')](_0x1e761f,_0xb38c('0x9c'));}else{rpcDb[_0xb38c('0x91')](_0x2f9590,_0xb38c('0x9c'));}delete this['actions'][_0x455c70['linkedid']];break;case _0xb38c('0x9d'):var _0x514788=moment()[_0xb38c('0x58')](_0xb38c('0x88'));_0x2f9590[_0xb38c('0x9e')]=_0x514788;_0x2f9590[_0xb38c('0x9f')]=_0x514788;_0x2f9590[_0xb38c('0xa0')]=!![];_0x3f58ab['pTalking']+=0x1;logger[_0xb38c('0x5b')](_0xb38c('0xa1'),_0x2f9590[_0xb38c('0xa2')],_0xb38c('0xa3'),_0x3f58ab[_0xb38c('0x27')],_0xb38c('0x6d'),_0x3f58ab[_0xb38c('0x2b')]);ami['emit']('custom:agentconnect',ut[_0xb38c('0xa4')](_0x2f9590,_0xb38c('0xa5')));if(_0x3f58ab[_0xb38c('0xa6')]){ami[_0xb38c('0x25')](_0xb38c('0xa7'),ut['buildAcw'](_0x2f9590));}break;case'16':ami['emit'](_0xb38c('0xa8'),ut['buildObj'](_0x2f9590,_0xb38c('0xa9')));emitVoiceQueueChannelRemove(ut[_0xb38c('0xa4')](_0x2f9590,_0xb38c('0xa9')));_0x3f58ab[_0xb38c('0x39')]+=0x1;_0x3f58ab[_0xb38c('0x2e')]+=0x1;_0x3f58ab[_0xb38c('0x29')]+=0x1;ut[_0xb38c('0x78')](_0x3f58ab,_0xb38c('0xaa'));_0x2f9590[_0xb38c('0x97')]=ut['totalGlobal'](_0x2f9590);ut[_0xb38c('0x89')](_0x2f9590,0x4,'Answer');rpcDb[_0xb38c('0x8d')](_0x2f9590,_0xb38c('0xab'));rpcDb[_0xb38c('0x91')](_0x2f9590,_0xb38c('0xac'));rpcDb['crateCustomerReportQueue'](_0x2f9590);_0x3f58ab[_0xb38c('0xad')]+=_0x2f9590[_0xb38c('0xae')];_0x3f58ab[_0xb38c('0x2c')]+=_0x2f9590['talktime'];logger[_0xb38c('0x5b')]('[syncHangup][talking][decrement]',_0x2f9590['uniqueid'],'\x20Queue',_0x3f58ab[_0xb38c('0x27')],'pTalking:\x20',_0x3f58ab['pTalking']);delete this[_0xb38c('0x13')][_0x455c70['linkedid']];break;case _0xb38c('0xaf'):_0x3f58ab[_0xb38c('0x3b')]+=0x1;_0x2f9590[_0xb38c('0xb0')]+=0x1;_0x2f9590[_0xb38c('0x97')]=ut[_0xb38c('0x98')](_0x2f9590);ut['logCustomer'](_0x2f9590,0x5,_0xb38c('0xb1'));rpcDb[_0xb38c('0x8d')](_0x2f9590,_0xb38c('0xb2'));if(ut[_0xb38c('0x98')](_0x2f9590)>=_0x3f58ab[_0xb38c('0xb3')]){_0x1e761f=ut[_0xb38c('0x9a')](_0x2f9590,0xf,_0xb38c('0x9b'));rpcDb['createCustomerFinal'](_0x1e761f,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x2f9590[_0xb38c('0xb0')]>=_0x3f58ab['dialBusyMaxRetry']){rpcDb['createCustomerFinal'](_0x2f9590,_0xb38c('0xb2'));}else{rpcDb[_0xb38c('0xb4')](ut[_0xb38c('0xb5')](_0x2f9590,_0xb38c('0xb0'),_0x3f58ab[_0xb38c('0xb6')]),_0x2f9590[_0xb38c('0xb7')],_0x2f9590[_0xb38c('0xb8')]);}}break;case _0xb38c('0xb9'):_0x3f58ab[_0xb38c('0x3e')]+=0x1;_0x2f9590[_0xb38c('0xba')]+=0x1;_0x2f9590[_0xb38c('0x97')]=ut[_0xb38c('0x98')](_0x2f9590);ut[_0xb38c('0x89')](_0x2f9590,0x3,_0xb38c('0xbb'));rpcDb['createCustomerHistory'](_0x2f9590,_0xb38c('0xbc'));if(ut[_0xb38c('0x98')](_0x2f9590)>=_0x3f58ab[_0xb38c('0xb3')]){_0x1e761f=ut[_0xb38c('0x9a')](_0x2f9590,0xf,'Global');rpcDb[_0xb38c('0x91')](_0x1e761f,_0xb38c('0xbd'));}else{if(_0x2f9590['countnoanswerretry']>=_0x3f58ab[_0xb38c('0xbe')]){rpcDb['createCustomerFinal'](_0x2f9590,_0xb38c('0xbc'));}else{rpcDb['rescheduleContact'](ut[_0xb38c('0xb5')](_0x2f9590,_0xb38c('0xba'),_0x3f58ab[_0xb38c('0xbf')]),_0x2f9590[_0xb38c('0xb7')],_0x2f9590['activeContact']);}}break;case'CONGESTION':_0x3f58ab[_0xb38c('0x3c')]+=0x1;_0x2f9590[_0xb38c('0xc0')]+=0x1;_0x2f9590[_0xb38c('0x97')]=ut['totalGlobal'](_0x2f9590);ut[_0xb38c('0x89')](_0x2f9590,0x8,_0xb38c('0xc1'));rpcDb[_0xb38c('0x8d')](_0x2f9590,_0xb38c('0xc2'));if(ut[_0xb38c('0x98')](_0x2f9590)>=_0x3f58ab[_0xb38c('0xb3')]){_0x1e761f=ut[_0xb38c('0x9a')](_0x2f9590,0xf,_0xb38c('0x9b'));rpcDb[_0xb38c('0x91')](_0x1e761f,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x2f9590[_0xb38c('0xc0')]>=_0x3f58ab[_0xb38c('0xc3')]){rpcDb[_0xb38c('0x91')](_0x2f9590,_0xb38c('0xc2'));}else{rpcDb[_0xb38c('0xb4')](ut[_0xb38c('0xb5')](_0x2f9590,_0xb38c('0xc0'),_0x3f58ab[_0xb38c('0xb6')]),_0x2f9590[_0xb38c('0xb7')],_0x2f9590[_0xb38c('0xb8')]);}}break;case _0xb38c('0xc4'):_0x3f58ab[_0xb38c('0x41')]+=0x1;_0x2f9590[_0xb38c('0x97')]=ut[_0xb38c('0x98')](_0x2f9590);ut[_0xb38c('0x89')](_0x2f9590,0x14,'AgentReject');rpcDb[_0xb38c('0x8d')](_0x2f9590,'[syncHangupRequest][logAgentReject]');if(_0x2f9590[_0xb38c('0xb7')]){rpcDb[_0xb38c('0xc5')](_0x2f9590[_0xb38c('0xc6')]);}if(_0x2f9590[_0xb38c('0xb8')]){rpcDb[_0xb38c('0xc7')](_0x2f9590['idContact']);}break;default:if(_0x2f9590[_0xb38c('0xa0')]){ut[_0xb38c('0x78')](_0x3f58ab,_0xb38c('0xc8'));ut[_0xb38c('0x79')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x3f58ab['name'],_0x455c70);}_0x3f58ab[_0xb38c('0x42')]+=0x1;_0x2f9590[_0xb38c('0x97')]=ut['totalGlobal'](_0x2f9590);ut[_0xb38c('0x89')](_0x2f9590,0xc,_0x455c70[_0xb38c('0xc9')]||_0x455c70[_0xb38c('0xca')]);rpcDb[_0xb38c('0x8d')](_0x2f9590,_0xb38c('0xcb'));if(ut[_0xb38c('0x98')](_0x2f9590)>=_0x3f58ab[_0xb38c('0xb3')]){_0x1e761f=ut[_0xb38c('0x9a')](_0x2f9590,0xf,_0xb38c('0x9b'));rpcDb['createCustomerFinal'](_0x1e761f,_0xb38c('0xcc'));}else{rpcDb[_0xb38c('0x91')](_0x2f9590,_0xb38c('0xcc'));}delete this['actions'][_0x455c70[_0xb38c('0xcd')]];}if(!(_0x2f9590[_0xb38c('0xa0')]&&_0x1fa85d==='16')){ut['updateOriginated'](_0x3f58ab,'[callProgressDetectingCustomer]');logger[_0xb38c('0x5b')](_0xb38c('0xce'),_0x2f9590[_0xb38c('0xa2')],'\x20Queue',_0x3f58ab[_0xb38c('0x27')],_0xb38c('0xcf'),_0x3f58ab[_0xb38c('0x4e')]);}if(_0x1fa85d!==_0xb38c('0x9d')){delete this[_0xb38c('0x13')][_0x455c70[_0xb38c('0xcd')]];delete this[_0xb38c('0x13')][_0x455c70['destlinkedid']];}}};Preview['prototype'][_0xb38c('0xd0')]=function(_0x203f65,_0x3ea2b5,_0x348f4f){if(_[_0xb38c('0xd1')](_0x3ea2b5)&&_0xb38c('0xd2')!==typeof _0x3ea2b5){return;}if(_[_0xb38c('0xd1')](_0x348f4f)&&_0xb38c('0xd2')!==typeof _0x348f4f){return;}switch(_0x348f4f[_0xb38c('0xd3')]){case'0':ut[_0xb38c('0xd4')](_0x203f65,0x0,_0xb38c('0xd5'));rpcDb[_0xb38c('0xd6')](_0x203f65,_0xb38c('0xd7'));break;case'3':ut[_0xb38c('0xd4')](_0x203f65,0x3,_0xb38c('0xbb'));rpcDb['createAgentHistory'](_0x203f65,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0xb38c('0xd4')](_0x203f65,0x5,_0xb38c('0xb1'));rpcDb[_0xb38c('0xd6')](_0x203f65,_0xb38c('0xd8'));break;case'8':ut[_0xb38c('0xd4')](_0x203f65,0x8,'Congestion');rpcDb[_0xb38c('0xd6')](_0x203f65,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0xb38c('0xd4')](_0x203f65,0x16,_0xb38c('0xd9'));rpcDb[_0xb38c('0xd6')](_0x203f65,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0xb38c('0xd4')](_0x203f65,0xc,_0x348f4f[_0xb38c('0xd3')]);rpcDb['createAgentHistory'](_0x203f65,_0xb38c('0xda'));}ut[_0xb38c('0x76')](_0x3ea2b5,_0xb38c('0xdb'));logger[_0xb38c('0x5b')](_0xb38c('0xdc'),_0x203f65[_0xb38c('0xa2')],_0xb38c('0xa3'),_0x3ea2b5['name'],_0xb38c('0xcf'),_0x3ea2b5[_0xb38c('0x4e')]);delete this[_0xb38c('0x13')][_0x203f65[_0xb38c('0xa2')]];};Preview['prototype'][_0xb38c('0xdd')]=function(_0x257814,_0x71386d,_0x3c2741,_0x2c5bc4,_0x242ee2){var _0x45c443=this;return new BPromise(function(_0x5b07e1,_0x5bde5a){if(_[_0xb38c('0xde')](_0x71386d)||_[_0xb38c('0xde')](_0x71386d[_0xb38c('0xdf')])||_[_0xb38c('0xde')](_0x71386d[_0xb38c('0xdf')]['phone'])||_[_0xb38c('0xde')](_0x71386d[_0xb38c('0x71')])){_0x5bde5a(ut[_0xb38c('0x4d')](_0xb38c('0xe0'),_0x2c5bc4,_0x242ee2));return;}var _0x5753ef=uuid['v4']();var _0x2c71c0=_0x45c443[_0xb38c('0x11')][_0x71386d[_0xb38c('0x6b')][_0xb38c('0x27')]];var _0x3229df=_0x3c2741?_0x45c443[_0xb38c('0x14')][_0x3c2741]['id']:undefined;_0x45c443[_0xb38c('0x13')][_0x5753ef]=new Action(_0x71386d,_0x2c71c0,_0x5753ef,_0x3c2741,_0x3229df);var _0x34da86=_0x45c443[_0xb38c('0x13')][_0x5753ef];_0x34da86['unlockAgent']=_0x2c5bc4;_0x34da86['activeContact']=_0x242ee2;_0x34da86['lookAgent']=_0x3c2741;if(_[_0xb38c('0xe1')](_0x257814)){_0x45c443['execCall'](_0x34da86,_0x2c71c0,_0x71386d,_0x3c2741)[_0xb38c('0x84')](function(_0xdc2bf2){logger[_0xb38c('0x5b')](_0xb38c('0xe2'),_0xb38c('0xe3')+_0x34da86[_0xb38c('0x6c')]+_0xb38c('0xe4')+_0x34da86[_0xb38c('0xc6')],JSON['stringify'](_0xdc2bf2));ami[_0xb38c('0x25')](_0xb38c('0xe5'),ut['buildObj'](_0x34da86,_0xb38c('0xe6')));_0x5b07e1(ut[_0xb38c('0x4d')](_0xb38c('0xe7')));})[_0xb38c('0x74')](function(_0x17364b){ut[_0xb38c('0x60')](_0xb38c('0xe8'),_0x17364b);_0x5bde5a(ut[_0xb38c('0x4d')](_0xb38c('0xe9'),_0x2c5bc4,_0x242ee2));});}else{_0x2c71c0['outboundBlacklistCallsDay']+=0x1;ut['logBlacklist'](_0x34da86);rpcDb[_0xb38c('0xea')](_0x34da86,_0xb38c('0xeb'));delete _0x45c443[_0xb38c('0x13')][_0x5753ef];_0x5bde5a(ut[_0xb38c('0x4d')]('Contact\x20in\x20black\x20List',_0x2c5bc4,_0x242ee2));}});};Preview['prototype'][_0xb38c('0x95')]=function(_0x2b3bcf){return!_[_0xb38c('0xde')](_0x2b3bcf)&&!_[_0xb38c('0xde')](_0x2b3bcf[_0xb38c('0x27')])&&!_[_0xb38c('0xde')](_0x2b3bcf[_0xb38c('0x53')])&&_0x2b3bcf['active']&&!_[_0xb38c('0xde')](this['trunks'][util[_0xb38c('0x58')](_0xb38c('0xec'),_0x2b3bcf['name'])])&&!_[_0xb38c('0xde')](this[_0xb38c('0xed')][util[_0xb38c('0x58')]('SIP/%s',_0x2b3bcf['name'])][_0xb38c('0x73')])&&(this[_0xb38c('0xed')][util['format'](_0xb38c('0xec'),_0x2b3bcf[_0xb38c('0x27')])][_0xb38c('0x73')]===_0xb38c('0xee')||this['trunks'][util[_0xb38c('0x58')](_0xb38c('0xec'),_0x2b3bcf[_0xb38c('0x27')])][_0xb38c('0x73')]===_0xb38c('0xef'));};Preview[_0xb38c('0xe')][_0xb38c('0x83')]=function(_0x507feb,_0x3e24ff){var _0x40cc54=this;return new BPromise(function(_0x52027b,_0x297787){_0x40cc54['execRun'](_0x507feb,_0x3e24ff)['then'](function(_0x86baa){_0x52027b(_[_0xb38c('0x6e')](_0x86baa,[_0xb38c('0x4d')]));})[_0xb38c('0x74')](function(_0x29894c){if(_0x29894c[_0xb38c('0xf0')]){rpcDb[_0xb38c('0xc5')](_0x507feb);}if(_0x29894c['active']){rpcDb[_0xb38c('0xc7')](_0x507feb);}_0x297787(_[_0xb38c('0x6e')](_0x29894c,[_0xb38c('0x4d')]));});});};Preview[_0xb38c('0xe')][_0xb38c('0xf1')]=function(_0x30ae59,_0x3bb1f6){var _0x1bb1af=this;return new BPromise(function(_0x5b3df4,_0x5cbd52){var _0x528933,_0x441093;rpcDb[_0xb38c('0xf2')](_0x30ae59)['then'](function(_0xa644b0){if(!_['isNil'](_0xa644b0[0x0])){_0x441093=_0xa644b0[0x0][_0xb38c('0xf3')]?![]:!![];_0x528933=_0xa644b0[0x0][_0xb38c('0xf3')]?!![]:![];_0x528933=_0x3bb1f6?!![]:_0x528933;}var _0x1834f8=_0x1bb1af[_0xb38c('0xf4')](_0xa644b0);if(_0x1834f8['isValid']){rpcDb[_0xb38c('0xf5')](_['pick'](_0xa644b0[0x0],[_0xb38c('0x71'),'Contact.phone']))[_0xb38c('0x84')](function(_0x3d08af){_0x1bb1af[_0xb38c('0xdd')](_0x3d08af,_0xa644b0[0x0],_0x3bb1f6,_0x441093,_0x528933)[_0xb38c('0x84')](function(_0x45c9eb){_0x5b3df4(_0x45c9eb);})[_0xb38c('0x74')](function(_0x2da334){_0x5cbd52(_0x2da334);});})[_0xb38c('0x74')](function(_0x57d60e){ut[_0xb38c('0x60')]('[Preview][checkIsBlackList]',_0x57d60e);_0x5cbd52(ut[_0xb38c('0x4d')](_0xb38c('0xf6'),_0x441093,_0x528933));});}else{_0x5cbd52(ut[_0xb38c('0x4d')](_0x1834f8[_0xb38c('0x4d')],_0x441093,_0x528933));}})[_0xb38c('0x74')](function(_0x482fe1){ut[_0xb38c('0x60')](_0xb38c('0xf7'),_0x482fe1);_0x5cbd52(ut[_0xb38c('0x4d')](_0xb38c('0xf6'),![],!![]));});});};Preview['prototype']['validateContact']=function(_0x3304fe){if(_[_0xb38c('0xde')](_0x3304fe)||_[_0xb38c('0xe1')](_0x3304fe)||!_[_0xb38c('0xde')](_0x3304fe[0x0][_0xb38c('0xf8')])&&_[_0xb38c('0xde')](_0x3304fe[0x0][_0xb38c('0xf8')][_0xb38c('0x27')])){ut[_0xb38c('0x60')](_0xb38c('0xf9'),_0x3304fe);return{'isValid':![],'message':_0xb38c('0xfa')};}var _0x38d02c=this['campaignsPreview'][_0x3304fe[0x0][_0xb38c('0x6b')][_0xb38c('0x27')]];_0x38d02c[_0xb38c('0x4d')]='ACTIVE';if(_[_0xb38c('0xde')](_0x38d02c)){ut[_0xb38c('0x60')]('[Preview][validateContact][Empty\x20Campaign]',_0x38d02c);return{'isValid':![],'message':_0xb38c('0xfb')};}if(!this[_0xb38c('0x95')](_0x38d02c['Trunk'])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20work]',_0xb38c('0xfc')+_0x38d02c[_0xb38c('0x27')]+_0xb38c('0xfd'));if(!this['isTrunkReachable'](_0x38d02c[_0xb38c('0xfe')])){ut[_0xb38c('0x60')](_0xb38c('0xff'),_0x38d02c[_0xb38c('0x27')]+_0xb38c('0x100'));return{'isValid':![],'message':_0xb38c('0x101')};}}if(!ut[_0xb38c('0x102')](_0x38d02c[_0xb38c('0x34')])){ut[_0xb38c('0x60')]('[Preview][validateContact][Campaign\x20Active]',_0x38d02c[_0xb38c('0x27')]+_0xb38c('0x103'));return{'isValid':![],'message':_0xb38c('0xfc')+_0x38d02c[_0xb38c('0x27')]+_0xb38c('0x103')};}return{'isValid':!![],'message':_0xb38c('0x104')};};Preview[_0xb38c('0xe')][_0xb38c('0x105')]=function(_0x3bde97,_0x35ee6e,_0x16de59,_0x5cdb94){var _0x1b2d70=this;return new BPromise(function(_0x56f1a1,_0xea1e2c){var _0x414a82=_0x3bde97['uniqueid'];var _0x4aa08a=_0x1b2d70[_0xb38c('0x95')](_0x35ee6e['Trunk'])?util[_0xb38c('0x58')](_0xb38c('0x106'),_0x35ee6e[_0xb38c('0x52')][_0xb38c('0x27')],_[_0xb38c('0xde')](_0x35ee6e[_0xb38c('0x107')])?'':_0x35ee6e[_0xb38c('0x107')]['trim']()||'',_0x35ee6e[_0xb38c('0x108')]>0x0?_0x16de59[_0xb38c('0xdf')]['phone'][_0xb38c('0x109')](_0x35ee6e[_0xb38c('0x108')]):_0x16de59[_0xb38c('0xdf')]['phone']):util['format'](_0xb38c('0x106'),_['isNil'](_0x35ee6e[_0xb38c('0xfe')])?_0x35ee6e[_0xb38c('0x52')][_0xb38c('0x27')]:_0x35ee6e['TrunkBackup']['name'],_[_0xb38c('0xde')](_0x35ee6e[_0xb38c('0x107')])?'':_0x35ee6e[_0xb38c('0x107')][_0xb38c('0x10a')]()||'',_0x35ee6e['dialCutDigit']>0x0?_0x16de59['Contact'][_0xb38c('0x10b')][_0xb38c('0x109')](_0x35ee6e[_0xb38c('0x108')]):_0x16de59[_0xb38c('0xdf')][_0xb38c('0x10b')]);var _0x3f3742=_0x1b2d70[_0xb38c('0x95')](_0x35ee6e[_0xb38c('0x52')])?ut[_0xb38c('0x10c')](_0x35ee6e[_0xb38c('0x52')]['callerid'],_0x35ee6e[_0xb38c('0x36')],_0x35ee6e[_0xb38c('0x10d')]>0x0?ut[_0xb38c('0x10e')](_0x35ee6e[_0xb38c('0x37')],_0x35ee6e[_0xb38c('0x10d')]):_0x35ee6e['dialOriginateCallerIdNumber']):ut[_0xb38c('0x10c')](_[_0xb38c('0xde')](_0x35ee6e[_0xb38c('0xfe')])?_0x35ee6e[_0xb38c('0x52')]['callerid']:_0x35ee6e[_0xb38c('0xfe')][_0xb38c('0x54')],_0x35ee6e['dialOriginateCallerIdName'],_0x35ee6e[_0xb38c('0x10d')]>0x0?ut[_0xb38c('0x10e')](_0x35ee6e[_0xb38c('0x37')],_0x35ee6e['dialRandomLastDigitCallerIdNumber']):_0x35ee6e['dialOriginateCallerIdNumber']);if(_0x3f3742){_0x3bde97[_0xb38c('0x10f')]=ut[_0xb38c('0x110')](_0x3f3742);_0x3bde97[_0xb38c('0x111')]=ut[_0xb38c('0x112')](_0x3f3742);}var _0x41c344=ut['addVariables'](_0x35ee6e,_0x16de59,_0x4aa08a,_0x3f3742,_0x414a82,_0x3bde97);_[_0xb38c('0x113')](_0x3bde97,ut[_0xb38c('0x114')](_0x41c344));_0x3bde97[_0xb38c('0x87')]=moment()[_0xb38c('0x58')](_0xb38c('0x88'));ami[_0xb38c('0x115')](ut['variablesAction'](_0x3bde97,_0x35ee6e,_0x41c344,_0x3bde97[_0xb38c('0xb8')],_0x5cdb94))[_0xb38c('0x84')](function(_0x2fecd0){_0x35ee6e[_0xb38c('0x4e')]+=0x1;logger[_0xb38c('0x5b')](_0xb38c('0x116'),_0x414a82,_0xb38c('0xa3'),_0x35ee6e[_0xb38c('0x27')],_0xb38c('0xcf'),_0x35ee6e[_0xb38c('0x4e')]);_0x56f1a1(_0x2fecd0);})[_0xb38c('0x74')](function(_0x488a07){ut[_0xb38c('0xd4')](_0x3bde97,0xe,_0xb38c('0x117'));rpcDb[_0xb38c('0xd6')](_0x3bde97,'[originateFailure][logOriginateFailure]');_0xea1e2c(_0x488a07);});});};Preview[_0xb38c('0xe')][_0xb38c('0x1e')]=function(_0x2aba0a){if(this[_0xb38c('0x13')][_0x2aba0a[_0xb38c('0xcd')]]){this['actions'][_0x2aba0a[_0xb38c('0xcd')]]['channel']=_0x2aba0a['channel'];}};Preview['prototype'][_0xb38c('0x17')]=function(_0x4afc57){var _0x28d210=this;var _0x364613=this[_0xb38c('0x13')][_0x4afc57[_0xb38c('0x118')]];if(_0x364613){if(_0x364613[_0xb38c('0x119')]&&this[_0xb38c('0x14')][_0x364613[_0xb38c('0x119')]]){ut[_0xb38c('0x11a')](_0x364613,this[_0xb38c('0x14')][_0x364613[_0xb38c('0x119')]][_0xb38c('0x27')],this[_0xb38c('0x14')][_0x364613[_0xb38c('0x119')]]['id']);}var _0x12d66b=_[_0xb38c('0x11b')](_0x364613);_0x12d66b[_0xb38c('0x9e')]=moment()[_0xb38c('0x58')](_0xb38c('0x88'));var _0x2b187f=_0x28d210[_0xb38c('0x11')][_0x364613['queue']];if(ut[_0xb38c('0x11c')](_0x4afc57['response'])){if(_0x364613[_0xb38c('0xb7')]){rpcDb[_0xb38c('0xc5')](_0x364613[_0xb38c('0xc6')]);}if(_0x364613[_0xb38c('0xb8')]){rpcDb['disableContact'](_0x364613[_0xb38c('0xc6')]);}ami[_0xb38c('0x25')]('custom:agentringnoanswer',ut[_0xb38c('0xa4')](_0x364613,_0xb38c('0x11d')));this[_0xb38c('0xd0')](_0x12d66b,_0x2b187f,_0x4afc57);}else{_0x364613[_0xb38c('0x87')]=moment()[_0xb38c('0x58')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0xb38c('0xd4')](_0x12d66b,0x4,'Answer');rpcDb[_0xb38c('0xd6')](_0x12d66b,_0xb38c('0x11e'));}}};Preview[_0xb38c('0xe')][_0xb38c('0x1a')]=function(_0x4a9704){var _0x5ad8a5=this;var _0x3d9433=this[_0xb38c('0x13')][_0x4a9704[_0xb38c('0xcd')]];var _0x924079;if(_0x3d9433){_0x924079=this['campaignsPreview'][_0x3d9433[_0xb38c('0x6c')]];logger[_0xb38c('0x5b')](_0xb38c('0x11f'),_0x4a9704['linkedid'],_0xb38c('0xa3'),_0x924079[_0xb38c('0x27')],_0xb38c('0x6d'),_0x924079[_0xb38c('0x2b')]);}if(this[_0xb38c('0x13')][_0x4a9704[_0xb38c('0xcd')]]&&_0x4a9704['linkedid']!==_0x4a9704[_0xb38c('0xa2')]){if(_0x4a9704[_0xb38c('0x120')]==='16'&&this[_0xb38c('0x13')][_0x4a9704['linkedid']][_0xb38c('0xa0')]){this[_0xb38c('0x121')](_0x4a9704,_0x4a9704[_0xb38c('0xcd')],_0x4a9704[_0xb38c('0x120')]);}else if(this[_0xb38c('0x13')][_0x4a9704[_0xb38c('0xcd')]][_0xb38c('0xa0')]){logger['info'](_0xb38c('0x122'),_0x4a9704[_0xb38c('0xcd')],_0x4a9704[_0xb38c('0x120')],'\x20Queue',_0x924079[_0xb38c('0x27')],_0xb38c('0x6d'),_0x924079[_0xb38c('0x2b')]);this[_0xb38c('0x121')](_0x4a9704,_0x4a9704[_0xb38c('0xcd')],_0x4a9704['cause']);}}else if(_0x3d9433&&_[_0xb38c('0xde')](_0x3d9433[_0xb38c('0x123')])&&_0x924079[_0xb38c('0x124')]&&_0x4a9704[_0xb38c('0xcd')]===_0x4a9704[_0xb38c('0xa2')]&&_['isNil'](_0x4a9704[_0xb38c('0xd3')])&&_0x4a9704[_0xb38c('0x120')]==='16'&&_0x4a9704[_0xb38c('0x125')]==='6'&&_[_0xb38c('0xd1')](_0x3d9433[_0xb38c('0x126')])){if(_0x3d9433['unlockAgent']){rpcDb[_0xb38c('0xc5')](_0x3d9433['idContact']);}if(_0x3d9433['activeContact']){rpcDb['disableContact'](_0x3d9433[_0xb38c('0xc6')]);}_0x4a9704['reason']='22';this[_0xb38c('0xd0')](_0x3d9433,_0x924079,_0x4a9704);}else if(_0x3d9433&&_0x3d9433[_0xb38c('0x126')]){if(_0x4a9704['cause']==='16'&&this[_0xb38c('0x13')][_0x4a9704['linkedid']][_0xb38c('0xa0')]){logger[_0xb38c('0x5b')](_0xb38c('0x127'),_0x4a9704[_0xb38c('0xcd')],_0x4a9704[_0xb38c('0x120')],_0xb38c('0xa3'),_0x924079[_0xb38c('0x27')],_0xb38c('0x6d'),_0x924079[_0xb38c('0x2b')]);this[_0xb38c('0x121')](_0x4a9704,_0x4a9704[_0xb38c('0xcd')],_0x4a9704['cause']);}else if(this[_0xb38c('0x13')][_0x4a9704['linkedid']][_0xb38c('0xa0')]){logger[_0xb38c('0x5b')](_0xb38c('0x122'),_0x4a9704['linkedid'],_0x4a9704[_0xb38c('0x120')],'\x20Queue',_0x924079[_0xb38c('0x27')],'pTalking:\x20',_0x924079[_0xb38c('0x2b')]);this[_0xb38c('0x121')](_0x4a9704,_0x4a9704[_0xb38c('0xcd')],_0x4a9704['cause']);}}};Preview[_0xb38c('0xe')][_0xb38c('0x1c')]=function(_0x2255af){if(this[_0xb38c('0x13')][_0x2255af[_0xb38c('0x128')]]&&_0x2255af[_0xb38c('0x128')]!==_0x2255af[_0xb38c('0x129')]){this['callProgressDetectingCustomer'](_0x2255af,_0x2255af[_0xb38c('0x128')],_0x2255af[_0xb38c('0xca')]);}};Preview[_0xb38c('0xe')][_0xb38c('0x12a')]=function(_0x5c04b1){if(this[_0xb38c('0x13')][_0x5c04b1['linkedid']]&&_0x5c04b1['linkedid']!==_0x5c04b1[_0xb38c('0xa2')]&&!this[_0xb38c('0x13')][_0x5c04b1[_0xb38c('0xcd')]][_0xb38c('0xa0')]){if(_0x5c04b1[_0xb38c('0x120')]==='1'){this['callProgressDetectingCustomer'](_0x5c04b1,_0x5c04b1[_0xb38c('0xcd')],_0x5c04b1[_0xb38c('0x120')]);}}};Preview['prototype'][_0xb38c('0x12b')]=function(_0x1b3430,_0x47e1db,_0x2ac5a8){if(this[_0xb38c('0x13')][_0x1b3430]){if(_['isNil'](this[_0xb38c('0x13')][_0x1b3430][_0xb38c('0x12c')])){this['actions'][_0x1b3430][_0xb38c('0x12c')]={};}this[_0xb38c('0x13')][_0x1b3430][_0xb38c('0x12c')][_0x47e1db]=_0x2ac5a8;}};Preview['prototype'][_0xb38c('0x20')]=function(_0x1d6aa5){try{if(!_['isNil'](_0x1d6aa5)){if(ut['filterKey'](_[_0xb38c('0x12d')](_0x1d6aa5[_0xb38c('0x12e')])[0x0])){this[_0xb38c('0x12b')](_0x1d6aa5['uniqueid'],_[_0xb38c('0x12d')](_0x1d6aa5['variable'])[0x0],_0x1d6aa5[_0xb38c('0x12f')]);}}}catch(_0x580761){logger[_0xb38c('0x130')]('[syncVarSet][Preview]',util[_0xb38c('0x131')](_0x580761,{'showHidden':![],'depth':null}));}};Preview[_0xb38c('0xe')][_0xb38c('0x22')]=function(_0x245182){if(_0x245182){if(this[_0xb38c('0x13')][_0x245182['transfertargetlinkedid']]){this[_0xb38c('0x13')][_0x245182[_0xb38c('0x132')]][_0xb38c('0x126')]=!![];}}};Preview[_0xb38c('0xe')][_0xb38c('0x133')]=function(_0x59e343){if(_0x59e343){if(this[_0xb38c('0x13')][_0x59e343[_0xb38c('0x134')]]){this[_0xb38c('0x13')][_0x59e343['transfererlinkedid']]['transfer']=!![];}}};module[_0xb38c('0x135')]=Preview; \ No newline at end of file +var _0xb250=['AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','Queue','lookAgent','execCall','[Preview][execCall][success]','Queue:\x20','custom:agentcalled','logger','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','pick','execRun','recallme','isValid','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','substring','TrunkBackup','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','addVariables','toLowerVariables','Action','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncNewExten','syncOriginateResponse','actionid','logLookAgent','clone','isFailure','custom:agentringnoanswer','rejected','Answer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','channelstate','transfer','[syncHangup][talking][transfer]','addVariable','variables','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','syncAttendedTransfer','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/environment','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','syncHangup','hanguprequest','syncHangupRequest','bind','dialend','syncDialEnd','newexten','attendedtransfer','syncBlindTransfer','loopCampaigns','emit','type','name','strategy','answered','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','active','Interval','stringify','format','voice:queue:%s','info','voice_queue_channel:remove','sendMessageOneNotActive','available','paused','NOT_ACTIVE','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20disactive','syncCampaigns','dialMethod','preview','booked','outbound','clearZombieChannels','recallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','queue','originated:\x20','pTalking:\x20','dialAnswer','contactId','UserId','VoiceQueueId','ListId','status','channel','catch','No\x20such\x20channel','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','size','hasOwnProperty','getContactRecallMe','agentReadyId','then','length','scheduledat','dialRecallMeTimeout','run','logger2','[RecallMe]','starttime','YYYY-MM-DD\x20HH:mm:ss','RecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','logCustomer','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','NoSuchNumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','ANSWER','responsetime','[syncHangup][talking][increment]','\x20Queue','buildObj','connect','acw','custom:agentConnectPreview','complete','decrementTalkink','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','BUSY','countbusyretry','Busy','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','rescheduleContact','scheduledAt','unlockAgent','NOANSWER','NoAnswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','countnoanswerretry','dialNoAnswerRetryFrequency','activeContact','CONGESTION','outboundCongestionCallsDay','countcongestionretry','Congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','dialBusyRetryFrequency','CANCEL','outboundRejectCallsDay','AgentReject','[syncHangupRequest][logAgentReject]','unlockContact','idContact','disableContact','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','linkedid','updateOriginated','[originated][decrement][callProgressDetectingCustomer]','uniqueid','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]'];(function(_0x1d6ea6,_0x2276c6){var _0x4e20ea=function(_0x3f1579){while(--_0x3f1579){_0x1d6ea6['push'](_0x1d6ea6['shift']());}};_0x4e20ea(++_0x2276c6);}(_0xb250,0x18f));var _0x0b25=function(_0x1cbffe,_0x594bc0){_0x1cbffe=_0x1cbffe-0x0;var _0x404c58=_0xb250[_0x1cbffe];return _0x404c58;};'use strict';var util=require(_0x0b25('0x0'));var _=require(_0x0b25('0x1'));var BPromise=require(_0x0b25('0x2'));var uuid=require(_0x0b25('0x3'));var moment=require(_0x0b25('0x4'));var md5=require(_0x0b25('0x5'));var Redis=require(_0x0b25('0x6'));var config=require(_0x0b25('0x7'));var logger=require(_0x0b25('0x8'))('preview');var loggerAction=require(_0x0b25('0x8'))(_0x0b25('0x9'));var ami=require(_0x0b25('0xa'));var rpcDb=require(_0x0b25('0xb'));var Action=require(_0x0b25('0xc'));var ut=require(_0x0b25('0xd'));config[_0x0b25('0xe')]=_[_0x0b25('0xf')](config[_0x0b25('0xe')],{'host':_0x0b25('0x10'),'port':0x18eb});var io=require(_0x0b25('0x11'))(new Redis(config[_0x0b25('0xe')]));var Sequence=function(){};Sequence[_0x0b25('0x12')][_0x0b25('0x13')]=function(_0x4ac8e1){this['tail']=this[_0x0b25('0x14')]?this[_0x0b25('0x14')][_0x0b25('0x15')](_0x4ac8e1):_0x4ac8e1();};function Preview(_0x2acb82){this[_0x0b25('0x16')]=new Sequence();this[_0x0b25('0x17')]=_0x2acb82[_0x0b25('0x18')];this[_0x0b25('0x19')]=_0x2acb82['trunks'];this[_0x0b25('0x1a')]={};this[_0x0b25('0x1b')]=_0x2acb82['agents'];this[_0x0b25('0x1c')]=0x0;ami['on']('originateresponse',this['syncOriginateResponse']['bind'](this));ami['on']('hangup',this[_0x0b25('0x1d')]['bind'](this));ami['on'](_0x0b25('0x1e'),this[_0x0b25('0x1f')][_0x0b25('0x20')](this));ami['on'](_0x0b25('0x21'),this[_0x0b25('0x22')][_0x0b25('0x20')](this));ami['on'](_0x0b25('0x23'),this['syncNewExten']['bind'](this));ami['on']('varset',this['syncVarSet']['bind'](this));ami['on'](_0x0b25('0x24'),this['syncAttendedTransfer'][_0x0b25('0x20')](this));ami['on']('blindtransfer',this[_0x0b25('0x25')]['bind'](this));this[_0x0b25('0x26')](this[_0x0b25('0x17')]);}function emit(_0x38bb48,_0x2377cd,_0x3fdd11){io['to'](_0x38bb48)[_0x0b25('0x27')](_0x2377cd,_0x3fdd11);}function emitCampaignPreview(_0x4b7cc4){if(_0x4b7cc4[_0x0b25('0x28')]==='outbound'){var _0x1ac02e={'id':_0x4b7cc4['id'],'name':_0x4b7cc4[_0x0b25('0x29')],'strategy':_0x4b7cc4[_0x0b25('0x2a')],'answered':_0x4b7cc4[_0x0b25('0x2b')],'available':_0x4b7cc4['available'],'loggedIn':_0x4b7cc4[_0x0b25('0x2c')],'pTalking':_0x4b7cc4[_0x0b25('0x2d')],'sumBillable':_0x4b7cc4[_0x0b25('0x2e')],'sumDuration':_0x4b7cc4[_0x0b25('0x2f')],'sumHoldTime':_0x4b7cc4[_0x0b25('0x30')]||0x0,'talking':_0x4b7cc4[_0x0b25('0x31')],'total':_0x4b7cc4[_0x0b25('0x32')],'type':_0x4b7cc4[_0x0b25('0x28')],'unmanaged':_0x4b7cc4[_0x0b25('0x33')],'abandoned':_0x4b7cc4[_0x0b25('0x34')],'waiting':_0x4b7cc4[_0x0b25('0x35')],'loggedInDb':_0x4b7cc4[_0x0b25('0x36')],'dialActive':_0x4b7cc4[_0x0b25('0x37')],'dialMethod':_0x4b7cc4['dialMethod'],'dialOriginateCallerIdName':_0x4b7cc4[_0x0b25('0x38')],'dialOriginateCallerIdNumber':_0x4b7cc4[_0x0b25('0x39')],'dialOriginateTimeout':_0x4b7cc4[_0x0b25('0x3a')],'dialPrefix':_0x4b7cc4[_0x0b25('0x3b')],'outboundAnswerAgiCallsDay':_0x4b7cc4['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x4b7cc4[_0x0b25('0x3c')],'outboundBlacklistCallsDay':_0x4b7cc4[_0x0b25('0x3d')],'outboundBusyCallsDay':_0x4b7cc4[_0x0b25('0x3e')],'outboundCongestionCallsDay':_0x4b7cc4['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x4b7cc4[_0x0b25('0x3f')],'outboundDropCallsDayCallersExit':_0x4b7cc4[_0x0b25('0x40')],'outboundDropCallsDayTimeout':_0x4b7cc4[_0x0b25('0x41')],'outboundNoAnswerCallsDay':_0x4b7cc4['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x4b7cc4['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x4b7cc4[_0x0b25('0x42')],'outboundReCallsDay':_0x4b7cc4[_0x0b25('0x43')],'outboundRejectCallsDay':_0x4b7cc4['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x4b7cc4[_0x0b25('0x44')],'predictiveIntervalAnsweredCalls':_0x4b7cc4[_0x0b25('0x45')],'predictiveIntervalAvgHoldtime':_0x4b7cc4[_0x0b25('0x46')],'predictiveIntervalAvgTalktime':_0x4b7cc4['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x4b7cc4[_0x0b25('0x47')],'predictiveIntervalDroppedCallsTimeout':_0x4b7cc4[_0x0b25('0x48')],'predictiveIntervalErlangCalls':_0x4b7cc4[_0x0b25('0x49')],'predictiveIntervalErlangCallsDroppedCalls':_0x4b7cc4[_0x0b25('0x4a')],'predictiveIntervalHitRate':_0x4b7cc4[_0x0b25('0x4b')],'predictiveIntervalMultiplicativeFactor':_0x4b7cc4[_0x0b25('0x4c')],'predictiveIntervalPauses':_0x4b7cc4[_0x0b25('0x4d')],'predictiveIntervalAvailable':_0x4b7cc4[_0x0b25('0x4e')],'predictiveIntervalTotalCalls':_0x4b7cc4['predictiveIntervalTotalCalls'],'message':_0x4b7cc4[_0x0b25('0x4f')],'originated':_0x4b7cc4[_0x0b25('0x50')],'erlangCalls':_0x4b7cc4[_0x0b25('0x51')],'erlangCallToSecond':_0x4b7cc4[_0x0b25('0x52')],'erlangAbandonmentRate':_0x4b7cc4[_0x0b25('0x53')],'erlangBusyFactor':_0x4b7cc4['erlangBusyFactor'],'startPredictive':_0x4b7cc4[_0x0b25('0x54')],'startProgressive':_0x4b7cc4[_0x0b25('0x55')]};if(_0x4b7cc4['Trunk']){_0x1ac02e['Trunk']={'id':_0x4b7cc4[_0x0b25('0x56')]['id'],'name':_0x4b7cc4[_0x0b25('0x56')][_0x0b25('0x29')],'active':_0x4b7cc4[_0x0b25('0x56')][_0x0b25('0x57')],'callerid':_0x4b7cc4[_0x0b25('0x56')]['callerid']};}if(_0x4b7cc4[_0x0b25('0x58')]){_0x1ac02e[_0x0b25('0x58')]={'id':_0x4b7cc4[_0x0b25('0x58')]['id'],'name':_0x4b7cc4['Interval']['name']};}var _0x2aa243=md5(JSON[_0x0b25('0x59')](_0x1ac02e));if(_0x4b7cc4[_0x0b25('0x5')]!==_0x2aa243){_0x4b7cc4[_0x0b25('0x5')]=_0x2aa243;emit(util[_0x0b25('0x5a')](_0x0b25('0x5b'),_0x1ac02e[_0x0b25('0x29')]),'voice_queue:save',_0x1ac02e);}}}function emitVoiceQueueChannelRemove(_0x31d205){logger[_0x0b25('0x5c')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0x0b25('0x59')](_0x31d205));emit(util[_0x0b25('0x5a')](_0x0b25('0x5b'),_0x31d205[_0x0b25('0x29')]),_0x0b25('0x5d'),_0x31d205);}function notSendMessagesQueue(_0x341902){if(_0x341902[_0x0b25('0x5e')]){if(_0x341902['originated']===0x0&&_0x341902[_0x0b25('0x2d')]===0x0){_0x341902[_0x0b25('0x5e')]=![];_0x341902[_0x0b25('0x5f')]=0x0;_0x341902[_0x0b25('0x60')]=0x0;_0x341902[_0x0b25('0x4f')]=_0x0b25('0x61');ut['logger']('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x341902['name']+'\x20is\x20not\x20active');}else{_0x341902[_0x0b25('0x4f')]='IS_DISACTIVED';ut['logger'](_0x0b25('0x62'),_0x341902[_0x0b25('0x29')]+_0x0b25('0x63'));}emitCampaignPreview(_0x341902);}}Preview[_0x0b25('0x12')]['loopCampaigns']=function(){var _0x2b6490=this;setInterval(function(){_0x2b6490[_0x0b25('0x64')]();},0x7cf);};Preview['prototype'][_0x0b25('0x64')]=function(){var _0x3b0b2c=this[_0x0b25('0x17')];this['clockClearZombieChannels']+=0x1;for(var _0x1fe938 in _0x3b0b2c){if(_0x3b0b2c['hasOwnProperty'](_0x1fe938)&&(_0x3b0b2c[_0x1fe938][_0x0b25('0x65')]===_0x0b25('0x66')||_0x3b0b2c[_0x1fe938][_0x0b25('0x65')]===_0x0b25('0x67'))&&_0x3b0b2c[_0x1fe938][_0x0b25('0x28')]===_0x0b25('0x68')){if(this[_0x0b25('0x1c')]>0x7){this[_0x0b25('0x1c')]=0x0;this[_0x0b25('0x69')]();}}if(_0x3b0b2c['hasOwnProperty'](_0x1fe938)&&_0x3b0b2c[_0x1fe938][_0x0b25('0x65')]===_0x0b25('0x66')&&_0x3b0b2c[_0x1fe938][_0x0b25('0x28')]==='outbound'){if(_0x3b0b2c[_0x1fe938][_0x0b25('0x37')]){this['setMessage'](_0x3b0b2c[_0x1fe938]);this[_0x0b25('0x6a')](_0x3b0b2c[_0x1fe938]);}else{notSendMessagesQueue(_0x3b0b2c[_0x1fe938]);}}}};Preview['prototype'][_0x0b25('0x6b')]=function(_0x5d4481){var _0x41fa12=this;this[_0x0b25('0x16')]['enqueue'](function(){if(!_[_0x0b25('0x6c')](_0x41fa12[_0x0b25('0x1a')][_0x5d4481])){loggerAction[_0x0b25('0x5c')](_0x0b25('0x6d'),_0x5d4481,'Queue',_0x41fa12[_0x0b25('0x1a')][_0x5d4481][_0x0b25('0x6e')],_0x0b25('0x6f'),JSON[_0x0b25('0x59')](_0x41fa12[_0x0b25('0x17')][_0x41fa12[_0x0b25('0x1a')][_0x5d4481][_0x0b25('0x6e')]][_0x0b25('0x50')]),_0x0b25('0x70'),JSON[_0x0b25('0x59')](_0x41fa12['campaignsPreview'][_0x41fa12[_0x0b25('0x1a')][_0x5d4481][_0x0b25('0x6e')]][_0x0b25('0x2d')]),JSON[_0x0b25('0x59')](_0x41fa12[_0x0b25('0x1a')][_0x5d4481][_0x0b25('0x71')]),JSON[_0x0b25('0x59')](_['pick'](_0x41fa12[_0x0b25('0x1a')][_0x5d4481],[_0x0b25('0x72'),_0x0b25('0x73'),_0x0b25('0x74'),_0x0b25('0x75')])));return ami['Action']({'action':_0x0b25('0x76'),'channel':_0x41fa12[_0x0b25('0x1a')][_0x5d4481][_0x0b25('0x77')]})[_0x0b25('0x78')](function(_0x5d6c96){if(_0x5d6c96[_0x0b25('0x4f')]===_0x0b25('0x79')){setTimeout(function(){if(_0x41fa12[_0x0b25('0x1a')][_0x5d4481]){ut['updateOriginated'](_0x41fa12[_0x0b25('0x17')][_0x41fa12[_0x0b25('0x1a')][_0x5d4481]['queue']],_0x0b25('0x7a'));if(_0x41fa12[_0x0b25('0x1a')][_0x5d4481][_0x0b25('0x71')]===!![]){ut['decrementTalkink'](_0x41fa12['campaignsPreview'][_0x41fa12[_0x0b25('0x1a')][_0x5d4481]['queue']],_0x0b25('0x7a'));ut[_0x0b25('0x7b')](_0x0b25('0x7c')+_0x5d4481,_0x41fa12[_0x0b25('0x1a')][_0x5d4481][_0x0b25('0x6e')]);}ut[_0x0b25('0x7b')](_0x0b25('0x7d')+_0x5d4481,_0x41fa12[_0x0b25('0x1a')][_0x5d4481][_0x0b25('0x6e')]);delete _0x41fa12[_0x0b25('0x1a')][_0x5d4481];}},0x2328);}});}});};Preview[_0x0b25('0x12')][_0x0b25('0x69')]=function(){var _0x878b24=this;loggerAction['info']('[action]',_[_0x0b25('0x7e')](this['actions']));for(var _0x6a8a74 in this[_0x0b25('0x1a')]){if(_0x878b24[_0x0b25('0x1a')][_0x0b25('0x7f')](_0x6a8a74)){_0x878b24['clearZombieChannel'](_0x6a8a74);}}};Preview[_0x0b25('0x12')][_0x0b25('0x6a')]=function(_0x3a6991){var _0x2fcfe4=this;rpcDb[_0x0b25('0x80')](_0x3a6991['id'],ut[_0x0b25('0x81')](this[_0x0b25('0x1b')]))[_0x0b25('0x82')](function(_0x21627b){if(!_['isNil'](_0x21627b)){for(var _0x20f98a=0x0;_0x20f98a<_0x21627b[_0x0b25('0x83')];_0x20f98a+=0x1){if(ut['getDiff'](_0x21627b[_0x20f98a][_0x0b25('0x84')])<_0x3a6991[_0x0b25('0x85')]*0x3c){_0x2fcfe4[_0x0b25('0x86')](_0x21627b[_0x20f98a]['id'])[_0x0b25('0x82')](ut[_0x0b25('0x87')](_0x0b25('0x88')))['catch'](ut[_0x0b25('0x87')](_0x0b25('0x88')));}else{var _0x5a2699=new Action(_0x21627b[_0x20f98a],_0x3a6991);_0x5a2699[_0x0b25('0x89')]=moment()[_0x0b25('0x5a')](_0x0b25('0x8a'));_0x3a6991[_0x0b25('0x43')]+=0x1;ut['logCustomer'](_0x5a2699,0x17,_0x0b25('0x8b'));if(_0x3a6991['dialRecallInQueue']){rpcDb[_0x0b25('0x8c')](ut[_0x0b25('0x8d')](_0x21627b[_0x20f98a]));rpcDb[_0x0b25('0x8e')](_0x5a2699,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0x0b25('0x8f')](_0x5a2699,0x16,_0x0b25('0x90'));rpcDb[_0x0b25('0x8e')](_0x5a2699,_0x0b25('0x91'));rpcDb[_0x0b25('0x92')](_0x5a2699,_0x0b25('0x91'));}}}}})[_0x0b25('0x78')](ut[_0x0b25('0x87')](_0x0b25('0x93')));};Preview[_0x0b25('0x12')]['setMessage']=function(_0x2bb259){_0x2bb259[_0x0b25('0x5e')]=!![];if(ut[_0x0b25('0x94')](_0x2bb259[_0x0b25('0x2c')])){_0x2bb259[_0x0b25('0x4f')]=_0x0b25('0x95');}else if(!ut[_0x0b25('0x96')](_0x2bb259['dialActive'])){_0x2bb259[_0x0b25('0x4f')]=_0x0b25('0x61');}else if(!this[_0x0b25('0x97')](_0x2bb259[_0x0b25('0x56')])){if(!this[_0x0b25('0x97')](_0x2bb259['TrunkBackup'])){_0x2bb259[_0x0b25('0x4f')]=_0x0b25('0x98');}else{_0x2bb259[_0x0b25('0x4f')]=_0x0b25('0x99');}}else{_0x2bb259[_0x0b25('0x4f')]=_0x0b25('0x99');}emitCampaignPreview(_0x2bb259);};Preview[_0x0b25('0x12')][_0x0b25('0x9a')]=function(_0x31ef13,_0x2197dc,_0x546e6f){var _0x11fc4d=this;var _0x1e8281=this[_0x0b25('0x1a')][_0x2197dc];var _0x4d73b2=this[_0x0b25('0x17')][_0x1e8281['queue']];var _0x37f238;if(_0x4d73b2){switch(_0x546e6f){case'1':_0x4d73b2['outboundNoSuchCallsDay']+=0x1;_0x1e8281[_0x0b25('0x9b')]=ut[_0x0b25('0x9c')](_0x1e8281);ut[_0x0b25('0x8f')](_0x1e8281,0x0,_0x0b25('0x9d'));rpcDb['createCustomerHistory'](_0x1e8281,_0x0b25('0x9e'));if(ut[_0x0b25('0x9c')](_0x1e8281)>=_0x4d73b2[_0x0b25('0x9f')]){_0x37f238=ut[_0x0b25('0xa0')](_0x1e8281,0xf,_0x0b25('0xa1'));rpcDb[_0x0b25('0x92')](_0x37f238,_0x0b25('0xa2'));}else{rpcDb[_0x0b25('0x92')](_0x1e8281,_0x0b25('0xa2'));}delete this['actions'][_0x31ef13['linkedid']];break;case _0x0b25('0xa3'):var _0x4d60e9=moment()[_0x0b25('0x5a')](_0x0b25('0x8a'));_0x1e8281[_0x0b25('0xa4')]=_0x4d60e9;_0x1e8281['answertime']=_0x4d60e9;_0x1e8281[_0x0b25('0x71')]=!![];_0x4d73b2[_0x0b25('0x2d')]+=0x1;logger[_0x0b25('0x5c')](_0x0b25('0xa5'),_0x1e8281['uniqueid'],_0x0b25('0xa6'),_0x4d73b2[_0x0b25('0x29')],_0x0b25('0x70'),_0x4d73b2['pTalking']);ami[_0x0b25('0x27')]('custom:agentconnect',ut[_0x0b25('0xa7')](_0x1e8281,_0x0b25('0xa8')));if(_0x4d73b2[_0x0b25('0xa9')]){ami[_0x0b25('0x27')](_0x0b25('0xaa'),ut['buildAcw'](_0x1e8281));}break;case'16':ami[_0x0b25('0x27')]('custom:agentcomplete',ut[_0x0b25('0xa7')](_0x1e8281,_0x0b25('0xab')));emitVoiceQueueChannelRemove(ut[_0x0b25('0xa7')](_0x1e8281,_0x0b25('0xab')));_0x4d73b2[_0x0b25('0x3c')]+=0x1;_0x4d73b2[_0x0b25('0x32')]+=0x1;_0x4d73b2[_0x0b25('0x2b')]+=0x1;ut[_0x0b25('0xac')](_0x4d73b2,'[16]');_0x1e8281[_0x0b25('0x9b')]=ut[_0x0b25('0x9c')](_0x1e8281);ut[_0x0b25('0x8f')](_0x1e8281,0x4,'Answer');rpcDb[_0x0b25('0x8e')](_0x1e8281,_0x0b25('0xad'));rpcDb['createCustomerFinal'](_0x1e8281,_0x0b25('0xae'));rpcDb[_0x0b25('0xaf')](_0x1e8281);_0x4d73b2[_0x0b25('0x2f')]+=_0x1e8281[_0x0b25('0xb0')];_0x4d73b2[_0x0b25('0x2e')]+=_0x1e8281['talktime'];logger['info'](_0x0b25('0xb1'),_0x1e8281['uniqueid'],_0x0b25('0xa6'),_0x4d73b2[_0x0b25('0x29')],_0x0b25('0x70'),_0x4d73b2[_0x0b25('0x2d')]);delete this[_0x0b25('0x1a')][_0x31ef13['linkedid']];break;case _0x0b25('0xb2'):_0x4d73b2['outboundBusyCallsDay']+=0x1;_0x1e8281[_0x0b25('0xb3')]+=0x1;_0x1e8281[_0x0b25('0x9b')]=ut[_0x0b25('0x9c')](_0x1e8281);ut['logCustomer'](_0x1e8281,0x5,_0x0b25('0xb4'));rpcDb[_0x0b25('0x8e')](_0x1e8281,'[callProgressDetectingCustomer][logBusy]');if(ut[_0x0b25('0x9c')](_0x1e8281)>=_0x4d73b2['dialGlobalMaxRetry']){_0x37f238=ut[_0x0b25('0xa0')](_0x1e8281,0xf,'Global');rpcDb[_0x0b25('0x92')](_0x37f238,_0x0b25('0xb5'));}else{if(_0x1e8281[_0x0b25('0xb3')]>=_0x4d73b2[_0x0b25('0xb6')]){rpcDb[_0x0b25('0x92')](_0x1e8281,_0x0b25('0xb7'));}else{rpcDb[_0x0b25('0xb8')](ut[_0x0b25('0xb9')](_0x1e8281,_0x0b25('0xb3'),_0x4d73b2['dialBusyRetryFrequency']),_0x1e8281[_0x0b25('0xba')],_0x1e8281['activeContact']);}}break;case _0x0b25('0xbb'):_0x4d73b2['outboundNoAnswerCallsDay']+=0x1;_0x1e8281['countnoanswerretry']+=0x1;_0x1e8281[_0x0b25('0x9b')]=ut[_0x0b25('0x9c')](_0x1e8281);ut['logCustomer'](_0x1e8281,0x3,_0x0b25('0xbc'));rpcDb[_0x0b25('0x8e')](_0x1e8281,_0x0b25('0xbd'));if(ut[_0x0b25('0x9c')](_0x1e8281)>=_0x4d73b2[_0x0b25('0x9f')]){_0x37f238=ut['cloneAction'](_0x1e8281,0xf,'Global');rpcDb[_0x0b25('0x92')](_0x37f238,_0x0b25('0xbe'));}else{if(_0x1e8281['countnoanswerretry']>=_0x4d73b2[_0x0b25('0xbf')]){rpcDb['createCustomerFinal'](_0x1e8281,_0x0b25('0xbd'));}else{rpcDb[_0x0b25('0xb8')](ut['scheduledAt'](_0x1e8281,_0x0b25('0xc0'),_0x4d73b2[_0x0b25('0xc1')]),_0x1e8281[_0x0b25('0xba')],_0x1e8281[_0x0b25('0xc2')]);}}break;case _0x0b25('0xc3'):_0x4d73b2[_0x0b25('0xc4')]+=0x1;_0x1e8281[_0x0b25('0xc5')]+=0x1;_0x1e8281['countglobal']=ut[_0x0b25('0x9c')](_0x1e8281);ut[_0x0b25('0x8f')](_0x1e8281,0x8,_0x0b25('0xc6'));rpcDb[_0x0b25('0x8e')](_0x1e8281,'[callProgressDetectingCustomer][logCongestion]');if(ut['totalGlobal'](_0x1e8281)>=_0x4d73b2['dialGlobalMaxRetry']){_0x37f238=ut[_0x0b25('0xa0')](_0x1e8281,0xf,_0x0b25('0xa1'));rpcDb[_0x0b25('0x92')](_0x37f238,_0x0b25('0xc7'));}else{if(_0x1e8281['countcongestionretry']>=_0x4d73b2[_0x0b25('0xc8')]){rpcDb[_0x0b25('0x92')](_0x1e8281,_0x0b25('0xc9'));}else{rpcDb[_0x0b25('0xb8')](ut[_0x0b25('0xb9')](_0x1e8281,'countcongestionretry',_0x4d73b2[_0x0b25('0xca')]),_0x1e8281[_0x0b25('0xba')],_0x1e8281[_0x0b25('0xc2')]);}}break;case _0x0b25('0xcb'):_0x4d73b2[_0x0b25('0xcc')]+=0x1;_0x1e8281['countglobal']=ut[_0x0b25('0x9c')](_0x1e8281);ut[_0x0b25('0x8f')](_0x1e8281,0x14,_0x0b25('0xcd'));rpcDb['createCustomerHistory'](_0x1e8281,_0x0b25('0xce'));if(_0x1e8281['unlockAgent']){rpcDb[_0x0b25('0xcf')](_0x1e8281[_0x0b25('0xd0')]);}if(_0x1e8281[_0x0b25('0xc2')]){rpcDb[_0x0b25('0xd1')](_0x1e8281[_0x0b25('0xd0')]);}break;default:if(_0x1e8281['dialAnswer']){ut['decrementTalkink'](_0x4d73b2,_0x0b25('0xd2'));ut[_0x0b25('0x7b')](_0x0b25('0xd3')+_0x4d73b2[_0x0b25('0x29')],_0x31ef13);}_0x4d73b2[_0x0b25('0x44')]+=0x1;_0x1e8281[_0x0b25('0x9b')]=ut[_0x0b25('0x9c')](_0x1e8281);ut['logCustomer'](_0x1e8281,0xc,_0x31ef13[_0x0b25('0xd4')]||_0x31ef13[_0x0b25('0xd5')]);rpcDb[_0x0b25('0x8e')](_0x1e8281,_0x0b25('0xd6'));if(ut[_0x0b25('0x9c')](_0x1e8281)>=_0x4d73b2[_0x0b25('0x9f')]){_0x37f238=ut[_0x0b25('0xa0')](_0x1e8281,0xf,_0x0b25('0xa1'));rpcDb['createCustomerFinal'](_0x37f238,_0x0b25('0xd7'));}else{rpcDb[_0x0b25('0x92')](_0x1e8281,_0x0b25('0xd7'));}delete this[_0x0b25('0x1a')][_0x31ef13[_0x0b25('0xd8')]];}if(!(_0x1e8281[_0x0b25('0x71')]&&_0x546e6f==='16')){ut[_0x0b25('0xd9')](_0x4d73b2,'[callProgressDetectingCustomer]');logger[_0x0b25('0x5c')](_0x0b25('0xda'),_0x1e8281[_0x0b25('0xdb')],_0x0b25('0xa6'),_0x4d73b2[_0x0b25('0x29')],_0x0b25('0x6f'),_0x4d73b2['originated']);}if(_0x546e6f!==_0x0b25('0xa3')){delete this['actions'][_0x31ef13[_0x0b25('0xd8')]];delete this['actions'][_0x31ef13[_0x0b25('0xdc')]];}}};Preview[_0x0b25('0x12')][_0x0b25('0xdd')]=function(_0x5e0b72,_0x26c4c4,_0x2ab208){if(_[_0x0b25('0xde')](_0x26c4c4)&&_0x0b25('0xdf')!==typeof _0x26c4c4){return;}if(_[_0x0b25('0xde')](_0x2ab208)&&_0x0b25('0xdf')!==typeof _0x2ab208){return;}switch(_0x2ab208[_0x0b25('0xe0')]){case'0':ut[_0x0b25('0xe1')](_0x5e0b72,0x0,_0x0b25('0x9d'));rpcDb['createAgentHistory'](_0x5e0b72,_0x0b25('0xe2'));break;case'3':ut['logAgent'](_0x5e0b72,0x3,_0x0b25('0xbc'));rpcDb[_0x0b25('0xe3')](_0x5e0b72,_0x0b25('0xe4'));break;case'5':ut[_0x0b25('0xe1')](_0x5e0b72,0x5,_0x0b25('0xb4'));rpcDb['createAgentHistory'](_0x5e0b72,_0x0b25('0xe5'));break;case'8':ut[_0x0b25('0xe1')](_0x5e0b72,0x8,_0x0b25('0xc6'));rpcDb['createAgentHistory'](_0x5e0b72,_0x0b25('0xe6'));break;case'22':ut['logAgent'](_0x5e0b72,0x16,_0x0b25('0xe7'));rpcDb[_0x0b25('0xe3')](_0x5e0b72,_0x0b25('0xe8'));break;default:ut[_0x0b25('0xe1')](_0x5e0b72,0xc,_0x2ab208['reason']);rpcDb[_0x0b25('0xe3')](_0x5e0b72,_0x0b25('0xe6'));}ut[_0x0b25('0xd9')](_0x26c4c4,_0x0b25('0xe9'));logger[_0x0b25('0x5c')](_0x0b25('0xea'),_0x5e0b72['uniqueid'],'\x20Queue',_0x26c4c4[_0x0b25('0x29')],_0x0b25('0x6f'),_0x26c4c4[_0x0b25('0x50')]);delete this['actions'][_0x5e0b72[_0x0b25('0xdb')]];};Preview[_0x0b25('0x12')][_0x0b25('0xeb')]=function(_0x5519c1,_0x222a44,_0x33e75f,_0x572c96,_0x2126d8){var _0x25a460=this;return new BPromise(function(_0x1b750b,_0x27b911){if(_[_0x0b25('0x6c')](_0x222a44)||_['isNil'](_0x222a44[_0x0b25('0xec')])||_[_0x0b25('0x6c')](_0x222a44['Contact'][_0x0b25('0xed')])||_[_0x0b25('0x6c')](_0x222a44[_0x0b25('0x74')])){_0x27b911(ut['message'](_0x0b25('0xee'),_0x572c96,_0x2126d8));return;}var _0x2a169b=uuid['v4']();var _0x3694c3=_0x25a460['campaignsPreview'][_0x222a44[_0x0b25('0xef')][_0x0b25('0x29')]];var _0xd0f7df=_0x33e75f?_0x25a460['agents'][_0x33e75f]['id']:undefined;_0x25a460[_0x0b25('0x1a')][_0x2a169b]=new Action(_0x222a44,_0x3694c3,_0x2a169b,_0x33e75f,_0xd0f7df);var _0xecb905=_0x25a460[_0x0b25('0x1a')][_0x2a169b];_0xecb905['unlockAgent']=_0x572c96;_0xecb905[_0x0b25('0xc2')]=_0x2126d8;_0xecb905[_0x0b25('0xf0')]=_0x33e75f;if(_['isEmpty'](_0x5519c1)){_0x25a460[_0x0b25('0xf1')](_0xecb905,_0x3694c3,_0x222a44,_0x33e75f)['then'](function(_0xb6bbcb){logger[_0x0b25('0x5c')](_0x0b25('0xf2'),_0x0b25('0xf3')+_0xecb905['queue']+'\x20IdHopper:\x20'+_0xecb905[_0x0b25('0xd0')],JSON['stringify'](_0xb6bbcb));ami[_0x0b25('0x27')](_0x0b25('0xf4'),ut[_0x0b25('0xa7')](_0xecb905,'called'));_0x1b750b(ut[_0x0b25('0x4f')]('Calling'));})[_0x0b25('0x78')](function(_0x7e42bf){ut[_0x0b25('0xf5')]('[Preview][execCall][failure]',_0x7e42bf);_0x27b911(ut['message']('Call\x20failed',_0x572c96,_0x2126d8));});}else{_0x3694c3[_0x0b25('0x3d')]+=0x1;ut[_0x0b25('0xf6')](_0xecb905);rpcDb[_0x0b25('0xf7')](_0xecb905,_0x0b25('0xf8'));delete _0x25a460['actions'][_0x2a169b];_0x27b911(ut[_0x0b25('0x4f')](_0x0b25('0xf9'),_0x572c96,_0x2126d8));}});};Preview['prototype']['isTrunkReachable']=function(_0x366cb2){return!_['isNil'](_0x366cb2)&&!_[_0x0b25('0x6c')](_0x366cb2[_0x0b25('0x29')])&&!_[_0x0b25('0x6c')](_0x366cb2[_0x0b25('0x57')])&&_0x366cb2[_0x0b25('0x57')]&&!_['isNil'](this['trunks'][util[_0x0b25('0x5a')](_0x0b25('0xfa'),_0x366cb2[_0x0b25('0x29')])])&&!_[_0x0b25('0x6c')](this[_0x0b25('0x19')][util[_0x0b25('0x5a')]('SIP/%s',_0x366cb2[_0x0b25('0x29')])]['status'])&&(this['trunks'][util[_0x0b25('0x5a')]('SIP/%s',_0x366cb2[_0x0b25('0x29')])][_0x0b25('0x76')]==='reachable'||this[_0x0b25('0x19')][util[_0x0b25('0x5a')](_0x0b25('0xfa'),_0x366cb2[_0x0b25('0x29')])]['status']==='unmonitored');};Preview[_0x0b25('0x12')][_0x0b25('0x86')]=function(_0x418f8f,_0x2a23b7){var _0x440350=this;return new BPromise(function(_0x59b449,_0x4533f6){_0x440350['execRun'](_0x418f8f,_0x2a23b7)[_0x0b25('0x82')](function(_0x64a8c0){_0x59b449(_[_0x0b25('0xfb')](_0x64a8c0,['message']));})[_0x0b25('0x78')](function(_0x332402){if(_0x332402['unlock']){rpcDb[_0x0b25('0xcf')](_0x418f8f);}if(_0x332402[_0x0b25('0x57')]){rpcDb[_0x0b25('0xd1')](_0x418f8f);}_0x4533f6(_[_0x0b25('0xfb')](_0x332402,[_0x0b25('0x4f')]));});});};Preview['prototype'][_0x0b25('0xfc')]=function(_0x3c8c17,_0x4707d2){var _0x1ea430=this;return new BPromise(function(_0x553a21,_0x2d7876){var _0x4c4893,_0xdf0694;rpcDb['getContactPreview'](_0x3c8c17)[_0x0b25('0x82')](function(_0x4859b5){if(!_[_0x0b25('0x6c')](_0x4859b5[0x0])){_0xdf0694=_0x4859b5[0x0][_0x0b25('0xfd')]?![]:!![];_0x4c4893=_0x4859b5[0x0][_0x0b25('0xfd')]?!![]:![];_0x4c4893=_0x4707d2?!![]:_0x4c4893;}var _0x19a974=_0x1ea430['validateContact'](_0x4859b5);if(_0x19a974[_0x0b25('0xfe')]){rpcDb['checkIsBlackList'](_[_0x0b25('0xfb')](_0x4859b5[0x0],[_0x0b25('0x74'),_0x0b25('0xff')]))[_0x0b25('0x82')](function(_0x3e1d34){_0x1ea430[_0x0b25('0xeb')](_0x3e1d34,_0x4859b5[0x0],_0x4707d2,_0xdf0694,_0x4c4893)[_0x0b25('0x82')](function(_0x7ac4f6){_0x553a21(_0x7ac4f6);})[_0x0b25('0x78')](function(_0x4ba9bd){_0x2d7876(_0x4ba9bd);});})['catch'](function(_0x5bc08d){ut[_0x0b25('0xf5')](_0x0b25('0x100'),_0x5bc08d);_0x2d7876(ut[_0x0b25('0x4f')](_0x0b25('0x101'),_0xdf0694,_0x4c4893));});}else{_0x2d7876(ut[_0x0b25('0x4f')](_0x19a974[_0x0b25('0x4f')],_0xdf0694,_0x4c4893));}})['catch'](function(_0x406c89){ut[_0x0b25('0xf5')]('[Preview][getContactPreview]',_0x406c89);_0x2d7876(ut['message']('Call\x20unsuccessful',![],!![]));});});};Preview[_0x0b25('0x12')]['validateContact']=function(_0x3e2403){if(_[_0x0b25('0x6c')](_0x3e2403)||_['isEmpty'](_0x3e2403)||!_[_0x0b25('0x6c')](_0x3e2403[0x0]['Agent'])&&_[_0x0b25('0x6c')](_0x3e2403[0x0]['Agent'][_0x0b25('0x29')])){ut[_0x0b25('0xf5')](_0x0b25('0x102'),_0x3e2403);return{'isValid':![],'message':_0x0b25('0x103')};}var _0x458aed=this['campaignsPreview'][_0x3e2403[0x0][_0x0b25('0xef')][_0x0b25('0x29')]];_0x458aed[_0x0b25('0x4f')]=_0x0b25('0x99');if(_[_0x0b25('0x6c')](_0x458aed)){ut[_0x0b25('0xf5')](_0x0b25('0x104'),_0x458aed);return{'isValid':![],'message':_0x0b25('0x105')};}if(!this[_0x0b25('0x97')](_0x458aed[_0x0b25('0x56')])){ut['logger'](_0x0b25('0x106'),_0x0b25('0x107')+_0x458aed[_0x0b25('0x29')]+'\x20Trunk\x20is\x20not\x20active');if(!this[_0x0b25('0x97')](_0x458aed['TrunkBackup'])){ut[_0x0b25('0xf5')](_0x0b25('0x106'),_0x458aed['name']+_0x0b25('0x108'));return{'isValid':![],'message':'Trunk\x20not\x20work'};}}if(!ut[_0x0b25('0x96')](_0x458aed[_0x0b25('0x37')])){ut[_0x0b25('0xf5')](_0x0b25('0x109'),_0x458aed[_0x0b25('0x29')]+_0x0b25('0x10a'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x458aed['name']+_0x0b25('0x10a')};}return{'isValid':!![],'message':_0x0b25('0x10b')};};Preview['prototype']['execCall']=function(_0x32f923,_0x45c362,_0x5d7191,_0x369f37){var _0x19a5f0=this;return new BPromise(function(_0x3f756d,_0x21f229){var _0x31b95b=_0x32f923[_0x0b25('0xdb')];var _0x3ef4e0=_0x19a5f0[_0x0b25('0x97')](_0x45c362[_0x0b25('0x56')])?util['format'](_0x0b25('0x10c'),_0x45c362[_0x0b25('0x56')]['name'],_[_0x0b25('0x6c')](_0x45c362['dialPrefix'])?'':_0x45c362['dialPrefix'][_0x0b25('0x10d')]()||'',_0x45c362[_0x0b25('0x10e')]>0x0?_0x5d7191['Contact'][_0x0b25('0xed')][_0x0b25('0x10f')](_0x45c362[_0x0b25('0x10e')]):_0x5d7191['Contact'][_0x0b25('0xed')]):util[_0x0b25('0x5a')](_0x0b25('0x10c'),_[_0x0b25('0x6c')](_0x45c362['TrunkBackup'])?_0x45c362[_0x0b25('0x56')][_0x0b25('0x29')]:_0x45c362[_0x0b25('0x110')][_0x0b25('0x29')],_['isNil'](_0x45c362[_0x0b25('0x3b')])?'':_0x45c362['dialPrefix'][_0x0b25('0x10d')]()||'',_0x45c362[_0x0b25('0x10e')]>0x0?_0x5d7191['Contact'][_0x0b25('0xed')]['substring'](_0x45c362[_0x0b25('0x10e')]):_0x5d7191['Contact'][_0x0b25('0xed')]);var _0x540ce3=_0x19a5f0['isTrunkReachable'](_0x45c362['Trunk'])?ut[_0x0b25('0x111')](_0x45c362[_0x0b25('0x56')][_0x0b25('0x112')],_0x45c362[_0x0b25('0x38')],_0x45c362[_0x0b25('0x113')]>0x0?ut['getCallerIdRandom'](_0x45c362[_0x0b25('0x39')],_0x45c362[_0x0b25('0x113')]):_0x45c362[_0x0b25('0x39')]):ut[_0x0b25('0x111')](_[_0x0b25('0x6c')](_0x45c362[_0x0b25('0x110')])?_0x45c362['Trunk'][_0x0b25('0x112')]:_0x45c362[_0x0b25('0x110')]['callerid'],_0x45c362[_0x0b25('0x38')],_0x45c362['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x0b25('0x114')](_0x45c362[_0x0b25('0x39')],_0x45c362[_0x0b25('0x113')]):_0x45c362[_0x0b25('0x39')]);if(_0x540ce3){_0x32f923[_0x0b25('0x115')]=ut[_0x0b25('0x116')](_0x540ce3);_0x32f923[_0x0b25('0x117')]=ut['extractCalleridNumber'](_0x540ce3);}var _0x53419f=ut[_0x0b25('0x118')](_0x45c362,_0x5d7191,_0x3ef4e0,_0x540ce3,_0x31b95b,_0x32f923);_['merge'](_0x32f923,ut[_0x0b25('0x119')](_0x53419f));_0x32f923[_0x0b25('0x89')]=moment()[_0x0b25('0x5a')](_0x0b25('0x8a'));ami[_0x0b25('0x11a')](ut['variablesAction'](_0x32f923,_0x45c362,_0x53419f,_0x32f923[_0x0b25('0xc2')],_0x369f37))[_0x0b25('0x82')](function(_0x5a065e){_0x45c362[_0x0b25('0x50')]+=0x1;logger['info'](_0x0b25('0x11b'),_0x31b95b,_0x0b25('0xa6'),_0x45c362[_0x0b25('0x29')],'originated:\x20',_0x45c362[_0x0b25('0x50')]);_0x3f756d(_0x5a065e);})[_0x0b25('0x78')](function(_0x141c51){ut[_0x0b25('0xe1')](_0x32f923,0xe,_0x0b25('0x11c'));rpcDb[_0x0b25('0xe3')](_0x32f923,_0x0b25('0x11d'));_0x21f229(_0x141c51);});});};Preview[_0x0b25('0x12')][_0x0b25('0x11e')]=function(_0x2e25ad){if(this[_0x0b25('0x1a')][_0x2e25ad[_0x0b25('0xd8')]]){this[_0x0b25('0x1a')][_0x2e25ad['linkedid']]['channel']=_0x2e25ad[_0x0b25('0x77')];}};Preview[_0x0b25('0x12')][_0x0b25('0x11f')]=function(_0x3955a8){var _0x1109d8=this;var _0x514bec=this['actions'][_0x3955a8[_0x0b25('0x120')]];if(_0x514bec){if(_0x514bec[_0x0b25('0xf0')]&&this[_0x0b25('0x1b')][_0x514bec['lookAgent']]){ut[_0x0b25('0x121')](_0x514bec,this['agents'][_0x514bec['lookAgent']]['name'],this[_0x0b25('0x1b')][_0x514bec['lookAgent']]['id']);}var _0x47fa94=_[_0x0b25('0x122')](_0x514bec);_0x47fa94[_0x0b25('0xa4')]=moment()['format'](_0x0b25('0x8a'));var _0x29e389=_0x1109d8['campaignsPreview'][_0x514bec[_0x0b25('0x6e')]];if(ut[_0x0b25('0x123')](_0x3955a8['response'])){if(_0x514bec[_0x0b25('0xba')]){rpcDb[_0x0b25('0xcf')](_0x514bec[_0x0b25('0xd0')]);}if(_0x514bec['activeContact']){rpcDb[_0x0b25('0xd1')](_0x514bec['idContact']);}ami[_0x0b25('0x27')](_0x0b25('0x124'),ut[_0x0b25('0xa7')](_0x514bec,_0x0b25('0x125')));this[_0x0b25('0xdd')](_0x47fa94,_0x29e389,_0x3955a8);}else{_0x514bec[_0x0b25('0x89')]=moment()[_0x0b25('0x5a')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0x0b25('0xe1')](_0x47fa94,0x4,_0x0b25('0x126'));rpcDb[_0x0b25('0xe3')](_0x47fa94,_0x0b25('0x127'));}}};Preview['prototype'][_0x0b25('0x1d')]=function(_0x5c3b62){var _0x203f7f=this;var _0x3a30a8=this['actions'][_0x5c3b62[_0x0b25('0xd8')]];var _0xf2d444;if(_0x3a30a8){_0xf2d444=this[_0x0b25('0x17')][_0x3a30a8[_0x0b25('0x6e')]];logger[_0x0b25('0x5c')](_0x0b25('0x128'),_0x5c3b62[_0x0b25('0xd8')],'\x20Queue',_0xf2d444['name'],_0x0b25('0x70'),_0xf2d444[_0x0b25('0x2d')]);}if(this[_0x0b25('0x1a')][_0x5c3b62[_0x0b25('0xd8')]]&&_0x5c3b62[_0x0b25('0xd8')]!==_0x5c3b62[_0x0b25('0xdb')]){if(_0x5c3b62[_0x0b25('0x129')]==='16'&&this['actions'][_0x5c3b62[_0x0b25('0xd8')]][_0x0b25('0x71')]){this[_0x0b25('0x9a')](_0x5c3b62,_0x5c3b62[_0x0b25('0xd8')],_0x5c3b62[_0x0b25('0x129')]);}else if(this[_0x0b25('0x1a')][_0x5c3b62[_0x0b25('0xd8')]]['dialAnswer']){logger['info'](_0x0b25('0x12a'),_0x5c3b62[_0x0b25('0xd8')],_0x5c3b62['cause'],_0x0b25('0xa6'),_0xf2d444[_0x0b25('0x29')],'pTalking:\x20',_0xf2d444[_0x0b25('0x2d')]);this[_0x0b25('0x9a')](_0x5c3b62,_0x5c3b62['linkedid'],_0x5c3b62['cause']);}}else if(_0x3a30a8&&_[_0x0b25('0x6c')](_0x3a30a8['statedesc'])&&_0xf2d444['dialQueueProject']&&_0x5c3b62['linkedid']===_0x5c3b62[_0x0b25('0xdb')]&&_[_0x0b25('0x6c')](_0x5c3b62[_0x0b25('0xe0')])&&_0x5c3b62[_0x0b25('0x129')]==='16'&&_0x5c3b62[_0x0b25('0x12b')]==='6'&&_[_0x0b25('0xde')](_0x3a30a8[_0x0b25('0x12c')])){if(_0x3a30a8[_0x0b25('0xba')]){rpcDb[_0x0b25('0xcf')](_0x3a30a8[_0x0b25('0xd0')]);}if(_0x3a30a8['activeContact']){rpcDb[_0x0b25('0xd1')](_0x3a30a8[_0x0b25('0xd0')]);}_0x5c3b62[_0x0b25('0xe0')]='22';this[_0x0b25('0xdd')](_0x3a30a8,_0xf2d444,_0x5c3b62);}else if(_0x3a30a8&&_0x3a30a8['transfer']){if(_0x5c3b62[_0x0b25('0x129')]==='16'&&this['actions'][_0x5c3b62[_0x0b25('0xd8')]]['dialAnswer']){logger['info'](_0x0b25('0x12d'),_0x5c3b62['linkedid'],_0x5c3b62['cause'],_0x0b25('0xa6'),_0xf2d444[_0x0b25('0x29')],_0x0b25('0x70'),_0xf2d444[_0x0b25('0x2d')]);this[_0x0b25('0x9a')](_0x5c3b62,_0x5c3b62[_0x0b25('0xd8')],_0x5c3b62['cause']);}else if(this[_0x0b25('0x1a')][_0x5c3b62['linkedid']][_0x0b25('0x71')]){logger[_0x0b25('0x5c')](_0x0b25('0x12a'),_0x5c3b62[_0x0b25('0xd8')],_0x5c3b62[_0x0b25('0x129')],_0x0b25('0xa6'),_0xf2d444['name'],_0x0b25('0x70'),_0xf2d444[_0x0b25('0x2d')]);this[_0x0b25('0x9a')](_0x5c3b62,_0x5c3b62['linkedid'],_0x5c3b62[_0x0b25('0x129')]);}}};Preview[_0x0b25('0x12')][_0x0b25('0x22')]=function(_0x4e64e6){if(this[_0x0b25('0x1a')][_0x4e64e6[_0x0b25('0xdc')]]&&_0x4e64e6[_0x0b25('0xdc')]!==_0x4e64e6['destuniqueid']){this['callProgressDetectingCustomer'](_0x4e64e6,_0x4e64e6['destlinkedid'],_0x4e64e6['dialstatus']);}};Preview[_0x0b25('0x12')][_0x0b25('0x1f')]=function(_0x469022){if(this[_0x0b25('0x1a')][_0x469022[_0x0b25('0xd8')]]&&_0x469022[_0x0b25('0xd8')]!==_0x469022[_0x0b25('0xdb')]&&!this[_0x0b25('0x1a')][_0x469022['linkedid']]['dialAnswer']){if(_0x469022[_0x0b25('0x129')]==='1'){this[_0x0b25('0x9a')](_0x469022,_0x469022[_0x0b25('0xd8')],_0x469022[_0x0b25('0x129')]);}}};Preview['prototype'][_0x0b25('0x12e')]=function(_0x58dc24,_0x185929,_0x25ce12){if(this[_0x0b25('0x1a')][_0x58dc24]){if(_['isNil'](this['actions'][_0x58dc24][_0x0b25('0x12f')])){this[_0x0b25('0x1a')][_0x58dc24]['variables']={};}this[_0x0b25('0x1a')][_0x58dc24][_0x0b25('0x12f')][_0x185929]=_0x25ce12;}};Preview[_0x0b25('0x12')]['syncVarSet']=function(_0x2eadba){try{if(!_['isNil'](_0x2eadba)){if(ut[_0x0b25('0x130')](_['keys'](_0x2eadba['variable'])[0x0])){this[_0x0b25('0x12e')](_0x2eadba[_0x0b25('0xdb')],_[_0x0b25('0x131')](_0x2eadba[_0x0b25('0x132')])[0x0],_0x2eadba[_0x0b25('0x133')]);}}}catch(_0x131ccc){logger[_0x0b25('0x134')](_0x0b25('0x135'),util[_0x0b25('0x136')](_0x131ccc,{'showHidden':![],'depth':null}));}};Preview[_0x0b25('0x12')][_0x0b25('0x137')]=function(_0x23f03a){if(_0x23f03a){if(this[_0x0b25('0x1a')][_0x23f03a[_0x0b25('0x138')]]){this['actions'][_0x23f03a['transfertargetlinkedid']][_0x0b25('0x12c')]=!![];}}};Preview[_0x0b25('0x12')][_0x0b25('0x25')]=function(_0x55dd4e){if(_0x55dd4e){if(this['actions'][_0x55dd4e[_0x0b25('0x139')]]){this[_0x0b25('0x1a')][_0x55dd4e[_0x0b25('0x139')]]['transfer']=!![];}}};module[_0x0b25('0x13a')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 4772d07..b742fad 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 _0x4b84=['xcally-motion-preview','holdtime','assigned','lastAssignedTo','COMPLETED','create','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','lodash','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','inspect','resolve','catch','[createHistory]\x20','then','createHistory','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createAgentHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','disableContact','crateCustomerReportQueue','type','uniqueid','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','from-sip'];(function(_0x510b98,_0x4c4cbb){var _0x45e775=function(_0x29ec11){while(--_0x29ec11){_0x510b98['push'](_0x510b98['shift']());}};_0x45e775(++_0x4c4cbb);}(_0x4b84,0x1cc));var _0x44b8=function(_0x40015a,_0x415db5){_0x40015a=_0x40015a-0x0;var _0x42f8a4=_0x4b84[_0x40015a];return _0x42f8a4;};'use strict';var util=require(_0x44b8('0x0'));var BPromise=require(_0x44b8('0x1'));var logger=require('../../../config/logger')('preview');var _=require(_0x44b8('0x2'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x44b8('0x3'));var cmHopperBlack=require(_0x44b8('0x4'));var voiceQueueRt=require(_0x44b8('0x5'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x55f25d){return function(_0x996a8b){logger['error'](_0x55f25d,util[_0x44b8('0x6')](_0x996a8b,{'showHidden':![],'depth':null}));};}function create(_0x5947f7){return BPromise[_0x44b8('0x7')]()['then'](cmHopperHistory['createHistory'](_0x5947f7))[_0x44b8('0x8')](loggerCatch(_0x44b8('0x9')));}function createAgent(_0x30ebc3){return BPromise['resolve']()[_0x44b8('0xa')](agentReportPreview[_0x44b8('0xb')](_0x30ebc3))[_0x44b8('0x8')](loggerCatch(_0x44b8('0x9')));}function moveContact(_0x24dd10){return BPromise[_0x44b8('0x7')]()[_0x44b8('0xa')](cmHopper['moveContactManagedDialer'](_0x24dd10,!![]))[_0x44b8('0x8')](loggerCatch(_0x44b8('0xc')));}exports['checkIsBlackList']=function(_0x194230){return BPromise['resolve']()[_0x44b8('0xa')](cmHopperBlack[_0x44b8('0xd')](_0x194230))['catch'](loggerCatch(_0x44b8('0xe')));};exports['getContactPreview']=function(_0x54fa95){return BPromise[_0x44b8('0x7')]()[_0x44b8('0xa')](cmHopper[_0x44b8('0xf')](_0x54fa95))[_0x44b8('0x8')](loggerCatch('[getContactPreview]\x20'));};exports['createHistory']=function(_0x5d6349,_0x3fe9fb){create(_0x5d6349)['catch'](loggerCatch(_0x3fe9fb));moveContact(_0x5d6349)[_0x44b8('0x8')](loggerCatch(_0x3fe9fb));};exports[_0x44b8('0x10')]=function(_0x55e258,_0x36743e){createAgent(_0x55e258)[_0x44b8('0x8')](loggerCatch(_0x36743e));};exports['createCustomerHistory']=function(_0x89bc30,_0x3f4688){create(_0x89bc30)['catch'](loggerCatch(_0x3f4688));};exports[_0x44b8('0x11')]=function(_0x8b4301,_0xebfe79){moveContact(_0x8b4301)[_0x44b8('0x8')](loggerCatch(_0xebfe79));};exports[_0x44b8('0x12')]=function(_0x369c09,_0x452f2f,_0x9b0536){if(_0x452f2f){_0x369c09[_0x44b8('0x13')]=null;}if(_0x9b0536){_0x369c09[_0x44b8('0x14')]=![];}return BPromise[_0x44b8('0x7')]()[_0x44b8('0xa')](cmHopper['rescheduleContact'](_0x369c09))[_0x44b8('0x8')](loggerCatch(_0x44b8('0x15')));};exports[_0x44b8('0x16')]=function(_0x1418db){return BPromise[_0x44b8('0x7')]()['then'](cmHopper[_0x44b8('0x16')](_0x1418db))['catch'](loggerCatch(_0x44b8('0x17')));};exports[_0x44b8('0x18')]=function(_0x25a0c1){return BPromise[_0x44b8('0x7')]()[_0x44b8('0xa')](cmHopper['unlockContact']({'UserId':null},_0x25a0c1,0x1))[_0x44b8('0x8')](loggerCatch('[unlockContact]\x20'));};exports[_0x44b8('0x19')]=function(_0x350482){return BPromise['resolve']()[_0x44b8('0xa')](cmHopper[_0x44b8('0x18')]({'active':![]},_0x350482,0x1))[_0x44b8('0x8')](loggerCatch('[activeContact]\x20'));};exports[_0x44b8('0x1a')]=function(_0x242342){var _0x53d9c7={};_0x53d9c7[_0x44b8('0x1b')]=_0x242342['type'];_0x53d9c7[_0x44b8('0x1c')]=_0x242342['uniqueid'];_0x53d9c7['calleridnum']=_0x242342['calleridnum'];_0x53d9c7[_0x44b8('0x1d')]=_0x242342[_0x44b8('0x1d')];_0x53d9c7[_0x44b8('0x1e')]=_0x242342[_0x44b8('0x1e')];_0x53d9c7[_0x44b8('0x1f')]=_0x242342[_0x44b8('0x20')];_0x53d9c7[_0x44b8('0x21')]=_0x242342[_0x44b8('0x20')];_0x53d9c7[_0x44b8('0x22')]=0x1;_0x53d9c7[_0x44b8('0x23')]=_0x242342[_0x44b8('0x24')];_0x53d9c7[_0x44b8('0x25')]=_0x242342[_0x44b8('0x26')];_0x53d9c7['context']=_0x44b8('0x27');_0x53d9c7['exten']=_0x44b8('0x28');_0x53d9c7[_0x44b8('0x29')]=0x0;_0x53d9c7[_0x44b8('0x2a')]=0x1;_0x53d9c7[_0x44b8('0x2b')]=_0x242342[_0x44b8('0x26')];_0x53d9c7['queuecallerexitreason']=_0x44b8('0x2c');return BPromise[_0x44b8('0x7')]()[_0x44b8('0xa')](voiceQueueReport[_0x44b8('0x2d')](_0x53d9c7))[_0x44b8('0x8')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0x44b8('0x2e')]=function(_0x400edc,_0x1a30fc){return BPromise[_0x44b8('0x7')]()[_0x44b8('0xa')](cmHopper[_0x44b8('0x2e')](_0x400edc,_0x1a30fc))[_0x44b8('0x8')](loggerCatch(_0x44b8('0x2f')));};exports[_0x44b8('0x30')]=function(_0x181761){return BPromise[_0x44b8('0x7')]()[_0x44b8('0xa')](cmHopper[_0x44b8('0x12')](_0x181761,!![],!![]))[_0x44b8('0x8')](loggerCatch(_0x44b8('0x31')));}; \ No newline at end of file +var _0x2d17=['getContactPreview','[getContactPreview]\x20','createCustomerFinal','rescheduleContact','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercompleteAt','endtime','connectedlinename','context','from-sip','xcally-motion-preview','holdtime','assigned','membername','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','util','bluebird','preview','lodash','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/voiceQueueRt','../rpc/voiceQueueReport','error','resolve','then','catch','[createHistory]\x20','createHistory','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20'];(function(_0x4d2938,_0x332d65){var _0x5e7d9b=function(_0x135e24){while(--_0x135e24){_0x4d2938['push'](_0x4d2938['shift']());}};_0x5e7d9b(++_0x332d65);}(_0x2d17,0x17e));var _0x72d1=function(_0x1ecbb2,_0x1b6d14){_0x1ecbb2=_0x1ecbb2-0x0;var _0x28126f=_0x2d17[_0x1ecbb2];return _0x28126f;};'use strict';var util=require(_0x72d1('0x0'));var BPromise=require(_0x72d1('0x1'));var logger=require('../../../config/logger')(_0x72d1('0x2'));var _=require(_0x72d1('0x3'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0x72d1('0x4'));var cmHopperHistory=require(_0x72d1('0x5'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x72d1('0x6'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0x72d1('0x7'));function loggerCatch(_0x50f551){return function(_0x139ba0){logger[_0x72d1('0x8')](_0x50f551,util['inspect'](_0x139ba0,{'showHidden':![],'depth':null}));};}function create(_0x477264){return BPromise[_0x72d1('0x9')]()[_0x72d1('0xa')](cmHopperHistory['createHistory'](_0x477264))[_0x72d1('0xb')](loggerCatch(_0x72d1('0xc')));}function createAgent(_0x283775){return BPromise['resolve']()[_0x72d1('0xa')](agentReportPreview[_0x72d1('0xd')](_0x283775))[_0x72d1('0xb')](loggerCatch(_0x72d1('0xc')));}function moveContact(_0x3cb9c2){return BPromise[_0x72d1('0x9')]()[_0x72d1('0xa')](cmHopper[_0x72d1('0xe')](_0x3cb9c2,!![]))[_0x72d1('0xb')](loggerCatch(_0x72d1('0xf')));}exports['checkIsBlackList']=function(_0x3cd1ae){return BPromise[_0x72d1('0x9')]()[_0x72d1('0xa')](cmHopperBlack[_0x72d1('0x10')](_0x3cd1ae))[_0x72d1('0xb')](loggerCatch(_0x72d1('0x11')));};exports[_0x72d1('0x12')]=function(_0x383bb){return BPromise[_0x72d1('0x9')]()[_0x72d1('0xa')](cmHopper[_0x72d1('0x12')](_0x383bb))[_0x72d1('0xb')](loggerCatch(_0x72d1('0x13')));};exports['createHistory']=function(_0x46fa3d,_0x5262b0){create(_0x46fa3d)[_0x72d1('0xb')](loggerCatch(_0x5262b0));moveContact(_0x46fa3d)[_0x72d1('0xb')](loggerCatch(_0x5262b0));};exports['createAgentHistory']=function(_0x1061b7,_0x1cbb45){createAgent(_0x1061b7)[_0x72d1('0xb')](loggerCatch(_0x1cbb45));};exports['createCustomerHistory']=function(_0x4925f6,_0x313d7b){create(_0x4925f6)[_0x72d1('0xb')](loggerCatch(_0x313d7b));};exports[_0x72d1('0x14')]=function(_0x1865c1,_0x8d6890){moveContact(_0x1865c1)[_0x72d1('0xb')](loggerCatch(_0x8d6890));};exports[_0x72d1('0x15')]=function(_0x5c7982,_0x1c695c,_0x56e8d3){if(_0x1c695c){_0x5c7982['UserId']=null;}if(_0x56e8d3){_0x5c7982['active']=![];}return BPromise['resolve']()[_0x72d1('0xa')](cmHopper[_0x72d1('0x15')](_0x5c7982))['catch'](loggerCatch(_0x72d1('0x16')));};exports[_0x72d1('0x17')]=function(_0x492086){return BPromise[_0x72d1('0x9')]()[_0x72d1('0xa')](cmHopper['countReScheduled'](_0x492086))['catch'](loggerCatch(_0x72d1('0x18')));};exports[_0x72d1('0x19')]=function(_0x2f661){return BPromise[_0x72d1('0x9')]()[_0x72d1('0xa')](cmHopper[_0x72d1('0x19')]({'UserId':null},_0x2f661,0x1))[_0x72d1('0xb')](loggerCatch('[unlockContact]\x20'));};exports['disableContact']=function(_0x1ba258){return BPromise['resolve']()[_0x72d1('0xa')](cmHopper[_0x72d1('0x19')]({'active':![]},_0x1ba258,0x1))[_0x72d1('0xb')](loggerCatch('[activeContact]\x20'));};exports[_0x72d1('0x1a')]=function(_0x4c4c41){var _0x707cd0={};_0x707cd0[_0x72d1('0x1b')]=_0x4c4c41[_0x72d1('0x1b')];_0x707cd0[_0x72d1('0x1c')]=_0x4c4c41['uniqueid'];_0x707cd0[_0x72d1('0x1d')]=_0x4c4c41['calleridnum'];_0x707cd0[_0x72d1('0x1e')]=_0x4c4c41[_0x72d1('0x1e')];_0x707cd0['queue']=_0x4c4c41[_0x72d1('0x1f')];_0x707cd0[_0x72d1('0x20')]=_0x4c4c41[_0x72d1('0x21')];_0x707cd0[_0x72d1('0x22')]=_0x4c4c41[_0x72d1('0x21')];_0x707cd0['queuecallercomplete']=0x1;_0x707cd0[_0x72d1('0x23')]=_0x4c4c41[_0x72d1('0x24')];_0x707cd0[_0x72d1('0x25')]=_0x4c4c41['membername'];_0x707cd0[_0x72d1('0x26')]=_0x72d1('0x27');_0x707cd0['exten']=_0x72d1('0x28');_0x707cd0[_0x72d1('0x29')]=0x0;_0x707cd0[_0x72d1('0x2a')]=0x1;_0x707cd0['lastAssignedTo']=_0x4c4c41[_0x72d1('0x2b')];_0x707cd0['queuecallerexitreason']=_0x72d1('0x2c');return BPromise[_0x72d1('0x9')]()[_0x72d1('0xa')](voiceQueueReport[_0x72d1('0x2d')](_0x707cd0))[_0x72d1('0xb')](loggerCatch(_0x72d1('0x2e')));};exports[_0x72d1('0x2f')]=function(_0xb32ca6,_0x4006b9){return BPromise[_0x72d1('0x9')]()[_0x72d1('0xa')](cmHopper['getContactRecallMe'](_0xb32ca6,_0x4006b9))[_0x72d1('0xb')](loggerCatch(_0x72d1('0x30')));};exports[_0x72d1('0x31')]=function(_0x325209){return BPromise['resolve']()[_0x72d1('0xa')](cmHopper[_0x72d1('0x15')](_0x325209,!![],!![]))[_0x72d1('0xb')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ 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 3d8fe5d..0de610a 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 _0xa7ac=['logLookAgent','membername','UserId','logCustomer','talktime','answertime','isFailure','variablesAction','BOOKED','uniqueid','originate','channelAgent','xcally-motion-preview','timeout','totalGlobal','countbusyretry','cloneAction','clone','Global','scheduledAt','add','minutes','ListId','decrementTalkink','isNil','pTalking','IsNotLoggedIn','buildObj','lastevent','queue','interface','buildAcw','agentReadyId','status','reachable','push','milliseconds','diff','createBody','CampaignId','idContact','campaigntype','dialAnswer','scheduledat','countcongestionretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-queue','xmd-dialtimeout','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridNumber','match','lodash','../../../../config/logger','env','XCALLY_IP_AGI','127.0.0.1','seconds','error','inspect','info','logger2','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','XMD-','toLowerVariables','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','state','statedesc','Blacklist','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime'];(function(_0x192bb4,_0x1752d5){var _0x27383a=function(_0x1668c3){while(--_0x1668c3){_0x192bb4['push'](_0x192bb4['shift']());}};_0x27383a(++_0x1752d5);}(_0xa7ac,0x14e));var _0xca7a=function(_0x29d09c,_0x2c67f2){_0x29d09c=_0x29d09c-0x0;var _0x15ea9c=_0xa7ac[_0x29d09c];return _0x15ea9c;};'use strict';var util=require('util');var _=require(_0xca7a('0x0'));var moment=require('moment');var logger=require(_0xca7a('0x1'))('preview');var ipAgi=process[_0xca7a('0x2')][_0xca7a('0x3')]||_0xca7a('0x4');function getSeconds(_0x331e12,_0x1c6735){var _0x102040=moment(_0x331e12)['milliseconds'](0x0);var _0x28424b=moment(_0x1c6735)['milliseconds'](0x0);return _0x102040['diff'](_0x28424b,_0xca7a('0x5'));}exports['loggerCatch']=function(_0x1ce1b8){return function(_0xa55113){logger[_0xca7a('0x6')](_0x1ce1b8,util[_0xca7a('0x7')](_0xa55113,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x2d39c8,_0x2e9af1){logger[_0xca7a('0x8')](_0x2d39c8,util[_0xca7a('0x7')](_0x2e9af1,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x3e9fab,_0x27780a){logger['error'](_0x3e9fab,util[_0xca7a('0x7')](_0x27780a,{'showHidden':![],'depth':null}));};exports[_0xca7a('0x9')]=function(_0x23c062){return function(_0x4e9af4){logger[_0xca7a('0x8')](_0x23c062,util[_0xca7a('0x7')](_0x4e9af4,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x57f1ac,_0x3a9b7b,_0x5df25c){return{'message':_0x57f1ac,'unlock':_0x3a9b7b,'active':_0x5df25c};};exports[_0xca7a('0xa')]=function(_0x469b8d,_0x2fb09f,_0x46eeb5){if(!_[_0xca7a('0xb')](_0x46eeb5)&&'string'===typeof _0x46eeb5&&!_['isEmpty'](_0x46eeb5)){if(!_['isUndefined'](_0x2fb09f)&&_0xca7a('0xc')===typeof _0x2fb09f&&!_[_0xca7a('0xd')](_0x2fb09f)){return util[_0xca7a('0xe')](_0xca7a('0xf'),_0x2fb09f,_0x46eeb5);}return util[_0xca7a('0xe')](_0xca7a('0xf'),_0x46eeb5,_0x46eeb5);}if(!_[_0xca7a('0xb')](_0x469b8d)&&_0xca7a('0xc')===typeof _0x469b8d&&!_[_0xca7a('0xd')](_0x469b8d)){return _0x469b8d;}return _0xca7a('0x10');};exports['isActive']=function(_0x11bc53){if(_['isNil'](_0x11bc53)){return![];}return _0x11bc53;};exports[_0xca7a('0x11')]=function(_0x29674a,_0x19b696,_0x475975,_0x16ec00,_0x4f6978,_0x5d32d1){var _0x737d92={'XMD-QUEUE':_0x19b696[_0xca7a('0x12')]?_0x19b696[_0xca7a('0x12')][_0xca7a('0x13')]:'','XMD-CALLERID':_0x16ec00,'XMD-CALLERID-PREVIEW':_0x5d32d1?util[_0xca7a('0xe')](_0xca7a('0xf'),_0x5d32d1[_0xca7a('0x14')],_0x5d32d1[_0xca7a('0x15')]):_0x16ec00,'XMD-DIALID':_0x4f6978,'XMD-CONTACTID':_0x19b696[_0xca7a('0x16')],'XMD-CDRTYPE':_0xca7a('0x17'),'CALLERID(all)':_0x16ec00,'XMD-VOICEQUEUEID':_0x19b696[_0xca7a('0x18')],'XMD-DIALCHANNEL':_0x475975,'XMD-DIALTIMEOUT':_0x29674a[_0xca7a('0x19')]||0x1e,'XMD-DIALOPTIONS':util[_0xca7a('0xe')](_0xca7a('0x1a'),_0x29674a[_0xca7a('0x1b')]?'g':'',_[_0xca7a('0xd')](_0x29674a[_0xca7a('0x1c')])?'':_0xca7a('0x1d')),'XMD-DIALURL':_0x29674a[_0xca7a('0x1e')]||'','XMD-AGI':_0x29674a[_0xca7a('0x1f')]?util[_0xca7a('0xe')](_0xca7a('0x20'),ipAgi,_0x29674a['dialQueueProject']):'NONE','XMD-AGIAFTER':_0x29674a['dialQueueProject2']?util[_0xca7a('0xe')](_0xca7a('0x20'),ipAgi,_0x29674a[_0xca7a('0x1b')]):_0xca7a('0x21'),'XMD-ORIGINATECALLERIDNUM':_0x5d32d1?_0x5d32d1[_0xca7a('0x22')]:'','XMD-ORIGINATECALLERIDNAME':_0x5d32d1?_0x5d32d1[_0xca7a('0x23')]:'','XMD-DESTINATION':'xcally-motion-preview'};if(!_[_0xca7a('0xd')](_0x29674a[_0xca7a('0x1c')])){_0x737d92[util['format']('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x29674a['monitor_format'];_0x737d92[util[_0xca7a('0xe')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x4f6978;}if(_0x19b696&&_0x19b696['Contact']){for(var _0x3ac3ed in _0x19b696[_0xca7a('0x24')]){if(_0x19b696[_0xca7a('0x24')][_0xca7a('0x25')](_0x3ac3ed)){if(!_['isNil'](_0x19b696['Contact'][_0x3ac3ed])&&_0x3ac3ed!=='id'&&_0x3ac3ed!==_0xca7a('0x26')&&_0x3ac3ed!==_0xca7a('0x27')&&_0x3ac3ed!==_0xca7a('0x28')){_0x737d92[util['format'](_0xca7a('0x29'),_0xca7a('0x2a'),_['toUpper'](_0x3ac3ed))]=_0x19b696[_0xca7a('0x24')][_0x3ac3ed];}}}}return _0x737d92;};exports[_0xca7a('0x2b')]=function(_0x439609){var _0x21b820={};for(var _0x137b58 in _0x439609){if(_0x439609[_0xca7a('0x25')](_0x137b58)){_0x21b820[util[_0xca7a('0xe')]('%s',_['toLower'](_0x137b58))]=_0x439609[_0x137b58];}}return{'variables':_0x21b820};};exports[_0xca7a('0x2c')]=function(_0x1d5ba5,_0x5603cb){if(!_['isNil'](_0x1d5ba5)){if(_0x1d5ba5[_0xca7a('0x25')](_0xca7a('0x2d'))){if(_0x1d5ba5[_0xca7a('0x2d')]>0x0){_0x1d5ba5[_0xca7a('0x2d')]-=0x1;}else{logger[_0xca7a('0x6')](_0xca7a('0x2e'),_0x5603cb);}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x5603cb);}};exports[_0xca7a('0x2f')]=function(_0xe98881){var _0x1ac231=moment()[_0xca7a('0xe')]('YYYY-MM-DD\x20HH:mm:ss');_0xe98881[_0xca7a('0x30')]=0xd;_0xe98881[_0xca7a('0x31')]=_0xca7a('0x32');_0xe98881[_0xca7a('0x33')]=_0x1ac231;_0xe98881[_0xca7a('0x34')]=_0x1ac231;_0xe98881[_0xca7a('0x35')]=_0x1ac231;};exports['logAgent']=function(_0x18c2e2,_0x137a22,_0x1ef61d){var _0x10c69c=moment()[_0xca7a('0xe')](_0xca7a('0x36'));_0x18c2e2[_0xca7a('0x30')]=_0x137a22;_0x18c2e2['statedesc']=_0x1ef61d;_0x18c2e2['responsetime']=_0x10c69c;_0x18c2e2[_0xca7a('0x37')]=getSeconds(_0x18c2e2[_0xca7a('0x34')],_0x18c2e2['starttime']);};exports[_0xca7a('0x38')]=function(_0x2a6c5c,_0x2ea995,_0x5ce128){_0x2a6c5c[_0xca7a('0x39')]=_0x2ea995;_0x2a6c5c[_0xca7a('0x3a')]=_0x5ce128;};exports[_0xca7a('0x3b')]=function(_0x5b306a,_0x5723a4,_0x47e5ca){var _0x30e5d5=moment()[_0xca7a('0xe')]('YYYY-MM-DD\x20HH:mm:ss');_0x5b306a[_0xca7a('0x30')]=_0x5723a4;_0x5b306a[_0xca7a('0x31')]=_0x47e5ca;_0x5b306a[_0xca7a('0x34')]=_0x5b306a[_0xca7a('0x34')]?_0x5b306a['responsetime']:_0x30e5d5;_0x5b306a['endtime']=_0x5b306a[_0xca7a('0x35')]?_0x5b306a[_0xca7a('0x35')]:_0x30e5d5;_0x5b306a[_0xca7a('0x37')]=getSeconds(_0x5b306a['responsetime']||0x0,_0x5b306a[_0xca7a('0x33')]||0x0);_0x5b306a[_0xca7a('0x3c')]=_0x5b306a['answertime']?getSeconds(_0x5b306a['endtime'],_0x5b306a[_0xca7a('0x3d')]):0x0;};exports[_0xca7a('0x3e')]=function(_0x458620){return _0x458620==='Failure';};exports[_0xca7a('0x3f')]=function(_0x5c0eaa,_0xefbbde,_0x41f1ba,_0x2335f3,_0x2cf7b6){var _0x30690b=_0x2335f3?'RECALL':_0x5c0eaa['calleridname'];_0x30690b=_0x2cf7b6?_0xca7a('0x40'):_0x30690b;return{'actionid':_0x5c0eaa[_0xca7a('0x41')],'action':_0xca7a('0x42'),'channel':_0x5c0eaa[_0xca7a('0x43')],'callerid':util[_0xca7a('0xe')](_0xca7a('0xf'),_0x30690b,_0x5c0eaa['calleridnum']),'Exten':_0xca7a('0x44'),'Context':'from-sip','Priority':'1','variable':_0x41f1ba,'timeout':(_0xefbbde[_0xca7a('0x45')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5c0eaa[_0xca7a('0x41')]};};exports[_0xca7a('0x46')]=function(_0x3d021b){return _0x3d021b[_0xca7a('0x47')]+_0x3d021b['countcongestionretry']+_0x3d021b['countnoanswerretry'];};exports[_0xca7a('0x48')]=function(_0x4158bb){var _0xb7cde1=_[_0xca7a('0x49')](_0x4158bb);_0xb7cde1[_0xca7a('0x30')]=0xf;_0xb7cde1[_0xca7a('0x31')]=_0xca7a('0x4a');return _0xb7cde1;};exports[_0xca7a('0x4b')]=function(_0x3ba171,_0x17e030,_0x3e79f6){var _0x2434b5={};_0x2434b5[_0x17e030]=_0x3ba171[_0x17e030];_0x2434b5['active']=![];_0x2434b5['scheduledat']=moment()[_0xca7a('0x4c')](_0x3e79f6,_0xca7a('0x4d'))['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2434b5[_0xca7a('0x16')]=_0x3ba171[_0xca7a('0x16')];_0x2434b5[_0xca7a('0x4e')]=_0x3ba171[_0xca7a('0x4e')];_0x2434b5[_0xca7a('0x18')]=_0x3ba171[_0xca7a('0x18')]||undefined;return _0x2434b5;};exports[_0xca7a('0x4f')]=function(_0x261f54,_0x3bd739){if(!_[_0xca7a('0x50')](_0x261f54)){if(_0x261f54['pTalking']>0x0){_0x261f54[_0xca7a('0x51')]-=0x1;}else{logger[_0xca7a('0x6')](_0x3bd739,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0xca7a('0x6')](_0x3bd739,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0xca7a('0x52')]=function(_0x13b69c){if(_0x13b69c<=0x0){return!![];}return![];};exports[_0xca7a('0x53')]=function(_0x1505a5,_0x14acfb){_0x1505a5[_0xca7a('0x54')]=_0x14acfb;_0x1505a5[_0xca7a('0x13')]=_0x1505a5[_0xca7a('0x55')];_0x1505a5[_0xca7a('0x56')]=_0x1505a5[_0xca7a('0x43')];return _0x1505a5;};exports[_0xca7a('0x57')]=function(_0x42e37a){var _0x1cd36c={};_0x1cd36c[_0xca7a('0x55')]=_0x42e37a[_0xca7a('0x55')];_0x1cd36c['interface']=_0x42e37a[_0xca7a('0x43')];_0x1cd36c[_0xca7a('0x41')]=_0x42e37a[_0xca7a('0x41')];return _0x1cd36c;};exports[_0xca7a('0x58')]=function(_0x5068a2){var _0x4c46a4=[];for(var _0x2dd68d in _0x5068a2){if(_0x5068a2['hasOwnProperty'](_0x2dd68d)){if(!_[_0xca7a('0x50')](_0x5068a2[_0x2dd68d])&&_0x5068a2[_0x2dd68d][_0xca7a('0x30')]==='not_inuse'&&_0x5068a2[_0x2dd68d][_0xca7a('0x59')]===_0xca7a('0x5a')){_0x4c46a4[_0xca7a('0x5b')](_0x5068a2[_0x2dd68d]['id']);}}}return _0x4c46a4;};exports['getDiff']=function(_0x19e61a){var _0x4b6da1=moment()[_0xca7a('0x5c')](0x0);var _0x23e90e=moment(_0x19e61a)[_0xca7a('0x5c')](0x0);return _0x4b6da1[_0xca7a('0x5d')](_0x23e90e,_0xca7a('0x5'));};exports[_0xca7a('0x5e')]=function(_0x1727aa){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x1727aa[_0xca7a('0x16')],'ListId':_0x1727aa[_0xca7a('0x4e')],'VoiceQueueId':_0x1727aa[_0xca7a('0x18')]||undefined,'CampaignId':_0x1727aa[_0xca7a('0x5f')]||undefined};};exports['filterKey']=function(_0xc2fbbc){if(_0xc2fbbc===_0xca7a('0x41')||_0xc2fbbc===_0xca7a('0x60')||_0xc2fbbc===_0xca7a('0x55')||_0xc2fbbc==='type'||_0xc2fbbc===_0xca7a('0x61')||_0xc2fbbc===_0xca7a('0x62')||_0xc2fbbc===_0xca7a('0x39')||_0xc2fbbc===_0xca7a('0x43')||_0xc2fbbc===_0xca7a('0x14')||_0xc2fbbc==='active'||_0xc2fbbc==='calleridnum'||_0xc2fbbc===_0xca7a('0x63')||_0xc2fbbc===_0xca7a('0x47')||_0xc2fbbc===_0xca7a('0x64')||_0xc2fbbc===_0xca7a('0x65')||_0xc2fbbc===_0xca7a('0x66')||_0xc2fbbc===_0xca7a('0x67')||_0xc2fbbc===_0xca7a('0x68')||_0xc2fbbc===_0xca7a('0x69')||_0xc2fbbc===_0xca7a('0x6a')||_0xc2fbbc===_0xca7a('0x16')||_0xc2fbbc===_0xca7a('0x4e')||_0xc2fbbc==='UserId'||_0xc2fbbc===_0xca7a('0x18')||_0xc2fbbc===_0xca7a('0x6b')||_0xc2fbbc==='xmd-voicequeueid'||_0xc2fbbc===_0xca7a('0x6c')||_0xc2fbbc==='xmd-phone'||_0xc2fbbc==='xmd-listid'||_0xc2fbbc==='xmd-dialurl'||_0xc2fbbc===_0xca7a('0x6d')||_0xc2fbbc===_0xca7a('0x6e')||_0xc2fbbc==='xmd-dialid'||_0xc2fbbc===_0xca7a('0x6f')||_0xc2fbbc===_0xca7a('0x70')||_0xc2fbbc===_0xca7a('0x71')||_0xc2fbbc===_0xca7a('0x72')||_0xc2fbbc===_0xca7a('0x73')||_0xc2fbbc===_0xca7a('0x74')||_0xc2fbbc==='rtpaudioqos'||_0xc2fbbc==='rtpaudioqosbridged'||_0xc2fbbc===_0xca7a('0x75')||_0xc2fbbc===_0xca7a('0x76')||_0xc2fbbc===_0xca7a('0x77')||_0xc2fbbc==='rtpaudioqoslossbridged'||_0xc2fbbc===_0xca7a('0x78')||_0xc2fbbc==='rtpaudioqosrttbridged'||_0xc2fbbc==='rtpaudioqos'||_0xc2fbbc==='rtpaudioqosbridged'||_0xc2fbbc==='rtpaudioqosjitter'||_0xc2fbbc==='rtpaudioqosjitterbridged'||_0xc2fbbc===_0xca7a('0x77')||_0xc2fbbc==='rtpaudioqoslossbridged'||_0xc2fbbc===_0xca7a('0x78')||_0xc2fbbc===_0xca7a('0x79')||_0xc2fbbc===_0xca7a('0x7a')||_0xc2fbbc==='bridgepvtcallid'||_0xc2fbbc===_0xca7a('0x30')||_0xc2fbbc===_0xca7a('0x31')){return![];}return!![];};exports[_0xca7a('0x7b')]=function(_0x12e81b,_0x3ee2d1){var _0x1520a4,_0x3d3711,_0x299c64;if(_0x3ee2d1<=0x0){_0x3ee2d1=0x1;}_0x1520a4=new RegExp(_0xca7a('0x7c')+_0x3ee2d1+'}$');_0x3d3711=Math[_0xca7a('0x7d')](0xa,_0x3ee2d1-0x1);_0x299c64=Math[_0xca7a('0x7d')](0xa,_0x3ee2d1)-0x1;return util[_0xca7a('0xe')]('%s',_[_0xca7a('0x7e')](_0x12e81b,_0x1520a4,_[_0xca7a('0x7f')](_0x3d3711,_0x299c64)));};exports['extractCalleridName']=function(_0x18754d){var _0x3e6530=_0x18754d['match'](/"(.*?)"/);return _0x3e6530?_0x3e6530[0x1]:_0x18754d;};exports[_0xca7a('0x80')]=function(_0x2fc370){var _0x3796b9=_0x2fc370[_0xca7a('0x81')](/<(.*?)>/);return _0x3796b9?_0x3796b9[0x1]:_0x2fc370;}; \ No newline at end of file +var _0x5ce6=['XMD-','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','statedesc','starttime','responsetime','endtime','logAgent','ringtime','logLookAgent','membername','UserId','logCustomer','state','talktime','answertime','isFailure','Failure','variablesAction','RECALL','calleridname','BOOKED','originate','channelAgent','from-sip','timeout','uniqueid','countbusyretry','countcongestionretry','countnoanswerretry','cloneAction','clone','Global','scheduledAt','add','minutes','ContactId','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','interface','buildAcw','queue','not_inuse','status','push','getDiff','createBody','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','active','scheduledat','callback','callbackat','recallme','xmd-voicequeueid','xmd-queue','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','random','extractCalleridName','match','extractCalleridNumber','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','inspect','logger','error','info','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','isActive','isNil','name','calleridnum','dialer','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','tags','createdAt','%s%s'];(function(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0x5ce6,0xee));var _0x65ce=function(_0x1e896c,_0x3f9948){_0x1e896c=_0x1e896c-0x0;var _0xd149d9=_0x5ce6[_0x1e896c];return _0xd149d9;};'use strict';var util=require('util');var _=require(_0x65ce('0x0'));var moment=require(_0x65ce('0x1'));var logger=require(_0x65ce('0x2'))(_0x65ce('0x3'));var ipAgi=process[_0x65ce('0x4')][_0x65ce('0x5')]||_0x65ce('0x6');function getSeconds(_0x5700bc,_0x2d73e1){var _0xfa4bb3=moment(_0x5700bc)[_0x65ce('0x7')](0x0);var _0xae69a=moment(_0x2d73e1)['milliseconds'](0x0);return _0xfa4bb3[_0x65ce('0x8')](_0xae69a,_0x65ce('0x9'));}exports['loggerCatch']=function(_0x49a56b){return function(_0xc99619){logger['error'](_0x49a56b,util[_0x65ce('0xa')](_0xc99619,{'showHidden':![],'depth':null}));};};exports[_0x65ce('0xb')]=function(_0x5694a6,_0x3d81a3){logger['info'](_0x5694a6,util['inspect'](_0x3d81a3,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x9dbb5a,_0x342d9c){logger[_0x65ce('0xc')](_0x9dbb5a,util[_0x65ce('0xa')](_0x342d9c,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x10db34){return function(_0x3d63c0){logger[_0x65ce('0xd')](_0x10db34,util[_0x65ce('0xa')](_0x3d63c0,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x9b1a83,_0x26b897,_0x402bb5){return{'message':_0x9b1a83,'unlock':_0x26b897,'active':_0x402bb5};};exports['getCallerId']=function(_0x35d8e3,_0x27cec6,_0x52f0a7){if(!_[_0x65ce('0xe')](_0x52f0a7)&&_0x65ce('0xf')===typeof _0x52f0a7&&!_[_0x65ce('0x10')](_0x52f0a7)){if(!_[_0x65ce('0xe')](_0x27cec6)&&'string'===typeof _0x27cec6&&!_[_0x65ce('0x10')](_0x27cec6)){return util[_0x65ce('0x11')](_0x65ce('0x12'),_0x27cec6,_0x52f0a7);}return util[_0x65ce('0x11')]('\x22%s\x22\x20<%s>',_0x52f0a7,_0x52f0a7);}if(!_[_0x65ce('0xe')](_0x35d8e3)&&_0x65ce('0xf')===typeof _0x35d8e3&&!_[_0x65ce('0x10')](_0x35d8e3)){return _0x35d8e3;}return'\x22\x22\x20<>';};exports[_0x65ce('0x13')]=function(_0x4cb258){if(_[_0x65ce('0x14')](_0x4cb258)){return![];}return _0x4cb258;};exports['addVariables']=function(_0x1fde28,_0x402fd4,_0x369970,_0x19a774,_0x5c4f37,_0x9a61cd){var _0x20fee7={'XMD-QUEUE':_0x402fd4['Queue']?_0x402fd4['Queue'][_0x65ce('0x15')]:'','XMD-CALLERID':_0x19a774,'XMD-CALLERID-PREVIEW':_0x9a61cd?util[_0x65ce('0x11')]('\x22%s\x22\x20<%s>',_0x9a61cd['calleridname'],_0x9a61cd[_0x65ce('0x16')]):_0x19a774,'XMD-DIALID':_0x5c4f37,'XMD-CONTACTID':_0x402fd4['ContactId'],'XMD-CDRTYPE':_0x65ce('0x17'),'CALLERID(all)':_0x19a774,'XMD-VOICEQUEUEID':_0x402fd4['VoiceQueueId'],'XMD-DIALCHANNEL':_0x369970,'XMD-DIALTIMEOUT':_0x1fde28[_0x65ce('0x18')]||0x1e,'XMD-DIALOPTIONS':util[_0x65ce('0x11')](_0x65ce('0x19'),_0x1fde28[_0x65ce('0x1a')]?'g':'',_['isEmpty'](_0x1fde28[_0x65ce('0x1b')])?'':_0x65ce('0x1c')),'XMD-DIALURL':_0x1fde28[_0x65ce('0x1d')]||'','XMD-AGI':_0x1fde28[_0x65ce('0x1e')]?util[_0x65ce('0x11')](_0x65ce('0x1f'),ipAgi,_0x1fde28[_0x65ce('0x1e')]):_0x65ce('0x20'),'XMD-AGIAFTER':_0x1fde28['dialQueueProject2']?util['format'](_0x65ce('0x1f'),ipAgi,_0x1fde28[_0x65ce('0x1a')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x9a61cd?_0x9a61cd[_0x65ce('0x21')]:'','XMD-ORIGINATECALLERIDNAME':_0x9a61cd?_0x9a61cd[_0x65ce('0x22')]:'','XMD-DESTINATION':_0x65ce('0x23')};if(!_['isEmpty'](_0x1fde28[_0x65ce('0x1b')])){_0x20fee7[util['format']('%s',_0x65ce('0x24'))]=_0x1fde28[_0x65ce('0x1b')];_0x20fee7[util[_0x65ce('0x11')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x5c4f37;}if(_0x402fd4&&_0x402fd4[_0x65ce('0x25')]){for(var _0x48bdcf in _0x402fd4['Contact']){if(_0x402fd4[_0x65ce('0x25')][_0x65ce('0x26')](_0x48bdcf)){if(!_[_0x65ce('0x14')](_0x402fd4[_0x65ce('0x25')][_0x48bdcf])&&_0x48bdcf!=='id'&&_0x48bdcf!==_0x65ce('0x27')&&_0x48bdcf!==_0x65ce('0x28')&&_0x48bdcf!=='updatedAt'){_0x20fee7[util[_0x65ce('0x11')](_0x65ce('0x29'),_0x65ce('0x2a'),_['toUpper'](_0x48bdcf))]=_0x402fd4['Contact'][_0x48bdcf];}}}}return _0x20fee7;};exports[_0x65ce('0x2b')]=function(_0x14feb6){var _0x3ab2b2={};for(var _0x1af481 in _0x14feb6){if(_0x14feb6['hasOwnProperty'](_0x1af481)){_0x3ab2b2[util[_0x65ce('0x11')]('%s',_[_0x65ce('0x2c')](_0x1af481))]=_0x14feb6[_0x1af481];}}return{'variables':_0x3ab2b2};};exports[_0x65ce('0x2d')]=function(_0x1c82ba,_0x4d4b35){if(!_[_0x65ce('0x14')](_0x1c82ba)){if(_0x1c82ba['hasOwnProperty']('originated')){if(_0x1c82ba[_0x65ce('0x2e')]>0x0){_0x1c82ba[_0x65ce('0x2e')]-=0x1;}else{logger['error'](_0x65ce('0x2f'),_0x4d4b35);}}}else{logger[_0x65ce('0xc')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x4d4b35);}};exports[_0x65ce('0x30')]=function(_0x19a3ea){var _0x5f1b27=moment()['format'](_0x65ce('0x31'));_0x19a3ea['state']=0xd;_0x19a3ea[_0x65ce('0x32')]='Blacklist';_0x19a3ea[_0x65ce('0x33')]=_0x5f1b27;_0x19a3ea[_0x65ce('0x34')]=_0x5f1b27;_0x19a3ea[_0x65ce('0x35')]=_0x5f1b27;};exports[_0x65ce('0x36')]=function(_0x313a6f,_0x4bd221,_0x209145){var _0x19fc3b=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x313a6f['state']=_0x4bd221;_0x313a6f[_0x65ce('0x32')]=_0x209145;_0x313a6f['responsetime']=_0x19fc3b;_0x313a6f[_0x65ce('0x37')]=getSeconds(_0x313a6f[_0x65ce('0x34')],_0x313a6f[_0x65ce('0x33')]);};exports[_0x65ce('0x38')]=function(_0x1bdbb0,_0x4aa2ec,_0x336fbe){_0x1bdbb0[_0x65ce('0x39')]=_0x4aa2ec;_0x1bdbb0[_0x65ce('0x3a')]=_0x336fbe;};exports[_0x65ce('0x3b')]=function(_0x1f0728,_0xc156b5,_0x499ab0){var _0x154c2c=moment()[_0x65ce('0x11')](_0x65ce('0x31'));_0x1f0728[_0x65ce('0x3c')]=_0xc156b5;_0x1f0728['statedesc']=_0x499ab0;_0x1f0728[_0x65ce('0x34')]=_0x1f0728[_0x65ce('0x34')]?_0x1f0728[_0x65ce('0x34')]:_0x154c2c;_0x1f0728[_0x65ce('0x35')]=_0x1f0728[_0x65ce('0x35')]?_0x1f0728[_0x65ce('0x35')]:_0x154c2c;_0x1f0728[_0x65ce('0x37')]=getSeconds(_0x1f0728[_0x65ce('0x34')]||0x0,_0x1f0728[_0x65ce('0x33')]||0x0);_0x1f0728[_0x65ce('0x3d')]=_0x1f0728[_0x65ce('0x3e')]?getSeconds(_0x1f0728['endtime'],_0x1f0728[_0x65ce('0x3e')]):0x0;};exports[_0x65ce('0x3f')]=function(_0x2e0c65){return _0x2e0c65===_0x65ce('0x40');};exports[_0x65ce('0x41')]=function(_0x4de3bc,_0x582a57,_0xf7cdaf,_0x357e41,_0x1388f2){var _0x263a84=_0x357e41?_0x65ce('0x42'):_0x4de3bc[_0x65ce('0x43')];_0x263a84=_0x1388f2?_0x65ce('0x44'):_0x263a84;return{'actionid':_0x4de3bc['uniqueid'],'action':_0x65ce('0x45'),'channel':_0x4de3bc[_0x65ce('0x46')],'callerid':util[_0x65ce('0x11')](_0x65ce('0x12'),_0x263a84,_0x4de3bc[_0x65ce('0x16')]),'Exten':_0x65ce('0x23'),'Context':_0x65ce('0x47'),'Priority':'1','variable':_0xf7cdaf,'timeout':(_0x582a57[_0x65ce('0x48')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4de3bc[_0x65ce('0x49')]};};exports['totalGlobal']=function(_0x29dd16){return _0x29dd16[_0x65ce('0x4a')]+_0x29dd16[_0x65ce('0x4b')]+_0x29dd16[_0x65ce('0x4c')];};exports[_0x65ce('0x4d')]=function(_0x34f02b){var _0x4babd6=_[_0x65ce('0x4e')](_0x34f02b);_0x4babd6['state']=0xf;_0x4babd6[_0x65ce('0x32')]=_0x65ce('0x4f');return _0x4babd6;};exports[_0x65ce('0x50')]=function(_0x1c6336,_0x4600b2,_0x48929e){var _0x32fada={};_0x32fada[_0x4600b2]=_0x1c6336[_0x4600b2];_0x32fada['active']=![];_0x32fada['scheduledat']=moment()[_0x65ce('0x51')](_0x48929e,_0x65ce('0x52'))[_0x65ce('0x11')](_0x65ce('0x31'));_0x32fada['ContactId']=_0x1c6336[_0x65ce('0x53')];_0x32fada['ListId']=_0x1c6336[_0x65ce('0x54')];_0x32fada['VoiceQueueId']=_0x1c6336[_0x65ce('0x55')]||undefined;return _0x32fada;};exports[_0x65ce('0x56')]=function(_0x63ee8,_0x11e84c){if(!_[_0x65ce('0x14')](_0x63ee8)){if(_0x63ee8['pTalking']>0x0){_0x63ee8[_0x65ce('0x57')]-=0x1;}else{logger['error'](_0x11e84c,_0x65ce('0x58'));}}else{logger['error'](_0x11e84c,_0x65ce('0x59'));}};exports[_0x65ce('0x5a')]=function(_0x12bdb9){if(_0x12bdb9<=0x0){return!![];}return![];};exports['buildObj']=function(_0x4b1791,_0x1341db){_0x4b1791[_0x65ce('0x5b')]=_0x1341db;_0x4b1791[_0x65ce('0x15')]=_0x4b1791['queue'];_0x4b1791[_0x65ce('0x5c')]=_0x4b1791[_0x65ce('0x46')];return _0x4b1791;};exports[_0x65ce('0x5d')]=function(_0x37a1d7){var _0x458297={};_0x458297[_0x65ce('0x5e')]=_0x37a1d7[_0x65ce('0x5e')];_0x458297[_0x65ce('0x5c')]=_0x37a1d7['channelAgent'];_0x458297[_0x65ce('0x49')]=_0x37a1d7[_0x65ce('0x49')];return _0x458297;};exports['agentReadyId']=function(_0x56ce67){var _0x4310ba=[];for(var _0x5341a3 in _0x56ce67){if(_0x56ce67[_0x65ce('0x26')](_0x5341a3)){if(!_[_0x65ce('0x14')](_0x56ce67[_0x5341a3])&&_0x56ce67[_0x5341a3]['state']===_0x65ce('0x5f')&&_0x56ce67[_0x5341a3][_0x65ce('0x60')]==='reachable'){_0x4310ba[_0x65ce('0x61')](_0x56ce67[_0x5341a3]['id']);}}}return _0x4310ba;};exports[_0x65ce('0x62')]=function(_0x70a97d){var _0xc12904=moment()[_0x65ce('0x7')](0x0);var _0x20c6dc=moment(_0x70a97d)[_0x65ce('0x7')](0x0);return _0xc12904[_0x65ce('0x8')](_0x20c6dc,_0x65ce('0x9'));};exports[_0x65ce('0x63')]=function(_0x4521e3){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x4521e3[_0x65ce('0x53')],'ListId':_0x4521e3['ListId'],'VoiceQueueId':_0x4521e3[_0x65ce('0x55')]||undefined,'CampaignId':_0x4521e3[_0x65ce('0x64')]||undefined};};exports[_0x65ce('0x65')]=function(_0x5635fb){if(_0x5635fb===_0x65ce('0x49')||_0x5635fb===_0x65ce('0x66')||_0x5635fb===_0x65ce('0x5e')||_0x5635fb===_0x65ce('0x67')||_0x5635fb===_0x65ce('0x68')||_0x5635fb===_0x65ce('0x69')||_0x5635fb==='membername'||_0x5635fb==='channelAgent'||_0x5635fb===_0x65ce('0x43')||_0x5635fb===_0x65ce('0x6a')||_0x5635fb===_0x65ce('0x16')||_0x5635fb===_0x65ce('0x6b')||_0x5635fb===_0x65ce('0x4a')||_0x5635fb===_0x65ce('0x4b')||_0x5635fb==='countnoanswerretry'||_0x5635fb==='countglobal'||_0x5635fb===_0x65ce('0x6c')||_0x5635fb==='callbackuniqueid'||_0x5635fb===_0x65ce('0x6d')||_0x5635fb===_0x65ce('0x6e')||_0x5635fb===_0x65ce('0x53')||_0x5635fb==='ListId'||_0x5635fb===_0x65ce('0x3a')||_0x5635fb===_0x65ce('0x55')||_0x5635fb==='sipcallid'||_0x5635fb===_0x65ce('0x6f')||_0x5635fb===_0x65ce('0x70')||_0x5635fb==='xmd-phone'||_0x5635fb===_0x65ce('0x71')||_0x5635fb===_0x65ce('0x72')||_0x5635fb===_0x65ce('0x73')||_0x5635fb===_0x65ce('0x74')||_0x5635fb===_0x65ce('0x75')||_0x5635fb===_0x65ce('0x76')||_0x5635fb===_0x65ce('0x77')||_0x5635fb==='xmd-cdrtype'||_0x5635fb===_0x65ce('0x78')||_0x5635fb===_0x65ce('0x79')||_0x5635fb===_0x65ce('0x7a')||_0x5635fb===_0x65ce('0x7b')||_0x5635fb===_0x65ce('0x7c')||_0x5635fb===_0x65ce('0x7d')||_0x5635fb===_0x65ce('0x7e')||_0x5635fb===_0x65ce('0x7f')||_0x5635fb===_0x65ce('0x80')||_0x5635fb===_0x65ce('0x81')||_0x5635fb==='rtpaudioqosrttbridged'||_0x5635fb==='rtpaudioqos'||_0x5635fb===_0x65ce('0x7c')||_0x5635fb===_0x65ce('0x7d')||_0x5635fb===_0x65ce('0x7e')||_0x5635fb==='rtpaudioqosloss'||_0x5635fb===_0x65ce('0x80')||_0x5635fb===_0x65ce('0x81')||_0x5635fb===_0x65ce('0x82')||_0x5635fb===_0x65ce('0x83')||_0x5635fb===_0x65ce('0x84')||_0x5635fb===_0x65ce('0x3c')||_0x5635fb===_0x65ce('0x32')){return![];}return!![];};exports[_0x65ce('0x85')]=function(_0x1c0951,_0x535081){var _0x96f7e4,_0x1a8a2e,_0x2d72f7;if(_0x535081<=0x0){_0x535081=0x1;}_0x96f7e4=new RegExp(_0x65ce('0x86')+_0x535081+'}$');_0x1a8a2e=Math[_0x65ce('0x87')](0xa,_0x535081-0x1);_0x2d72f7=Math[_0x65ce('0x87')](0xa,_0x535081)-0x1;return util[_0x65ce('0x11')]('%s',_['replace'](_0x1c0951,_0x96f7e4,_[_0x65ce('0x88')](_0x1a8a2e,_0x2d72f7)));};exports[_0x65ce('0x89')]=function(_0x390866){var _0x42aead=_0x390866[_0x65ce('0x8a')](/"(.*?)"/);return _0x42aead?_0x42aead[0x1]:_0x390866;};exports[_0x65ce('0x8b')]=function(_0x5025e4){var _0x24b155=_0x5025e4[_0x65ce('0x8a')](/<(.*?)>/);return _0x24b155?_0x24b155[0x1]:_0x5025e4;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index c47aad7..fbce927 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 _0x5f2f=['number','boolean','queueremove','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','queueadd','string'];(function(_0x266aed,_0x3417af){var _0x143811=function(_0x414cf5){while(--_0x414cf5){_0x266aed['push'](_0x266aed['shift']());}};_0x143811(++_0x3417af);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4caee9,_0x2c1163){_0x4caee9=_0x4caee9-0x0;var _0x53789b=_0x5f2f[_0x4caee9];return _0x53789b;};'use strict';exports[_0xf5f2('0x0')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':_0xf5f2('0x1'),'required':!![]},'membername':{'type':_0xf5f2('0x1'),'required':!![]},'penalty':{'type':_0xf5f2('0x2'),'required':![]},'paused':{'type':_0xf5f2('0x3'),'required':![]}};exports[_0xf5f2('0x4')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports['queuepause']={'interface':{'type':_0xf5f2('0x1'),'required':!![]},'paused':{'type':_0xf5f2('0x3')},'reason':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x5')]={'module':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xf5f2('0x7')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'filename':{'type':_0xf5f2('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0xf5f2('0x1')}};exports[_0xf5f2('0x8')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}}; \ No newline at end of file +var _0x5f2f=['number','boolean','queueremove','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','queueadd','string'];(function(_0x1435ea,_0x234768){var _0xb527b3=function(_0x259824){while(--_0x259824){_0x1435ea['push'](_0x1435ea['shift']());}};_0xb527b3(++_0x234768);}(_0x5f2f,0x73));var _0xf5f2=function(_0x507dfa,_0x12d0a8){_0x507dfa=_0x507dfa-0x0;var _0x1d55e9=_0x5f2f[_0x507dfa];return _0x1d55e9;};'use strict';exports[_0xf5f2('0x0')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':_0xf5f2('0x1'),'required':!![]},'membername':{'type':_0xf5f2('0x1'),'required':!![]},'penalty':{'type':_0xf5f2('0x2'),'required':![]},'paused':{'type':_0xf5f2('0x3'),'required':![]}};exports[_0xf5f2('0x4')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports['queuepause']={'interface':{'type':_0xf5f2('0x1'),'required':!![]},'paused':{'type':_0xf5f2('0x3')},'reason':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x5')]={'module':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xf5f2('0x7')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'filename':{'type':_0xf5f2('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0xf5f2('0x1')}};exports[_0xf5f2('0x8')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 4213c42..19ca1dd 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 _0xcd49=['../model/agent','../model/telephone','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/vtigerAccount','../model/dynamics365Account','../model/faxAccount','agents','trunks','voiceQueues','triggers','campaigns','templates','outbound','voiceExtensions','queueChannels','outboundChannels','timers','salesforceAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','name','isNil','interface','SIP/%s','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','queueStatusComplete','prototype','isUndefined','mergeFromDatabase','initTelephones','telephones','initTrunks','length','initTriggers','initTemplates','zendeskAccounts','initSalesforceAccounts','freshdeskAccounts','initZohoAccounts','initDeskAccounts','sugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','unmanaged','queuecallerleaveAt','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','diff','initVoiceCallReports','disposition','ANSWERED','duration','billableseconds','initVoiceExtensions','initCampaignHopperHistory','merge','initFaxAccounts','exports','bluebird','util','lodash'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xcd49,0x135));var _0x9cd4=function(_0xb7b878,_0x5c3b92){_0xb7b878=_0xb7b878-0x0;var _0x3c84b9=_0xcd49[_0xb7b878];return _0x3c84b9;};'use strict';var BPromise=require(_0x9cd4('0x0'));var util=require(_0x9cd4('0x1'));var _=require(_0x9cd4('0x2'));var moment=require('moment');var Agent=require(_0x9cd4('0x3'));var Telephone=require(_0x9cd4('0x4'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0x9cd4('0x5'));var Trigger=require(_0x9cd4('0x6'));var Template=require(_0x9cd4('0x7'));var Campaign=require(_0x9cd4('0x8'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x9cd4('0x9'));var SalesforceAccount=require(_0x9cd4('0xa'));var FreshdeskAccount=require(_0x9cd4('0xb'));var SugarcrmAccount=require(_0x9cd4('0xc'));var ZohoAccount=require(_0x9cd4('0xd'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0x9cd4('0xe'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0x9cd4('0xf'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0x9cd4('0x10'));var Realtime=function(){this[_0x9cd4('0x11')]={};this['telephones']={};this[_0x9cd4('0x12')]={};this[_0x9cd4('0x13')]={};this[_0x9cd4('0x14')]={};this[_0x9cd4('0x15')]={};this[_0x9cd4('0x16')]={};this[_0x9cd4('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x9cd4('0x18')]={};this['channels']={};this[_0x9cd4('0x19')]={};this[_0x9cd4('0x1a')]={};this[_0x9cd4('0x1b')]={};this['zendeskAccounts']={};this[_0x9cd4('0x1c')]={};this['sugarcrmAccounts']={};this['freshdeskAccounts']={};this[_0x9cd4('0x1d')]={};this[_0x9cd4('0x1e')]={};this[_0x9cd4('0x1f')]={};this[_0x9cd4('0x20')]={};this[_0x9cd4('0x21')]={};this[_0x9cd4('0x22')]={};this[_0x9cd4('0x23')]={};};function freeIsNotKey(_0x3ca401,_0x318336,_0x4e0eff){var _0x4f4682=_[_0x9cd4('0x24')](_0x3ca401,function(_0x183d65,_0x2ad13b){return _0x183d65[_0x4e0eff];});for(var _0x5749bc in _0x318336){if(_0x318336[_0x9cd4('0x25')](_0x5749bc)){if(!_0x4f4682[_0x5749bc]){delete _0x318336[_0x5749bc];}}}}function freeIsNotKeySip(_0x55d801,_0x969524){var _0x1dd775=_[_0x9cd4('0x24')](_0x55d801,function(_0x1a675e,_0x36e89f){return util[_0x9cd4('0x26')]('SIP/%s',_0x1a675e[_0x9cd4('0x27')]);});for(var _0x67d39f in _0x969524){if(_0x969524[_0x9cd4('0x25')](_0x67d39f)){if(!_0x1dd775[_0x67d39f]){delete _0x969524[_0x67d39f];}}}}function freeIsNotKeyAgent(_0x166552,_0x5443b2){var _0x3cbb79=_[_0x9cd4('0x24')](_0x166552,function(_0x5792d2,_0x31a1f6){var _0x4d71aa=_[_0x9cd4('0x28')](_0x5792d2[_0x9cd4('0x29')])?util['format'](_0x9cd4('0x2a'),_0x5792d2[_0x9cd4('0x27')]):_0x5792d2[_0x9cd4('0x29')];return _0x4d71aa;});for(var _0x29af49 in _0x5443b2){if(_0x5443b2['hasOwnProperty'](_0x29af49)){if(!_0x3cbb79[_0x29af49]){delete _0x5443b2[_0x29af49];}}}}function clearVoiceCallReports(_0x21e00d){_0x21e00d[_0x9cd4('0x2b')]=0x0;_0x21e00d[_0x9cd4('0x2c')]=0x0;_0x21e00d[_0x9cd4('0x2d')]=0x0;_0x21e00d[_0x9cd4('0x2e')]=0x0;_0x21e00d[_0x9cd4('0x2f')]=0x0;}function clearCampaigns(_0x2215c4){if(!_[_0x9cd4('0x30')](_0x2215c4)){for(var _0x105056 in _0x2215c4){if(_0x2215c4['hasOwnProperty'](_0x105056)){_0x2215c4[_0x105056]['ivrTotalCallsDays']=0x0;_0x2215c4[_0x105056][_0x9cd4('0x31')]=0x0;}}}}function clearVoiceQueues(_0x371da8){if(!_[_0x9cd4('0x30')](_0x371da8)){for(var _0xc38a9a in _0x371da8){if(_0x371da8[_0x9cd4('0x25')](_0xc38a9a)){_0x371da8[_0xc38a9a][_0x9cd4('0x2b')]=0x0;_0x371da8[_0xc38a9a][_0x9cd4('0x2c')]=0x0;_0x371da8[_0xc38a9a]['unmanaged']=0x0;_0x371da8[_0xc38a9a]['abandoned']=0x0;_0x371da8[_0xc38a9a][_0x9cd4('0x2d')]=0x0;_0x371da8[_0xc38a9a]['sumDuration']=0x0;_0x371da8[_0xc38a9a][_0x9cd4('0x2f')]=0x0;_0x371da8[_0xc38a9a][_0x9cd4('0x32')]=0x0;_0x371da8[_0xc38a9a][_0x9cd4('0x33')]=0x0;_0x371da8[_0xc38a9a][_0x9cd4('0x34')]=0x0;_0x371da8[_0xc38a9a]['outboundCongestionCallsDay']=0x0;_0x371da8[_0xc38a9a][_0x9cd4('0x35')]=0x0;_0x371da8[_0xc38a9a][_0x9cd4('0x36')]=0x0;_0x371da8[_0xc38a9a]['outboundDropCallsDayTimeout']=0x0;_0x371da8[_0xc38a9a][_0x9cd4('0x37')]=0x0;_0x371da8[_0xc38a9a][_0x9cd4('0x38')]=0x0;_0x371da8[_0xc38a9a][_0x9cd4('0x39')]=0x0;_0x371da8[_0xc38a9a][_0x9cd4('0x3a')]=0x0;_0x371da8[_0xc38a9a][_0x9cd4('0x3b')]=0x0;_0x371da8[_0xc38a9a][_0x9cd4('0x32')]=0x0;_0x371da8[_0xc38a9a]['outboundAnswerCallsDay']=0x0;_0x371da8[_0xc38a9a][_0x9cd4('0x3c')]=!![];}}}}Realtime[_0x9cd4('0x3d')]['mergeFromDatabase']=function(_0x8cddb8,_0x196f99){for(var _0x3a80eb in _0x196f99){if(_0x8cddb8['hasOwnProperty'](_0x3a80eb)){_0x8cddb8[_0x3a80eb]=_0x196f99[_0x3a80eb];}}};Realtime['prototype']['initAgents']=function(){var _0x2bdcbd=this;return function(_0x5d430b){if(_0x5d430b){freeIsNotKeyAgent(_0x5d430b,_0x2bdcbd[_0x9cd4('0x11')]);for(var _0xc7bb92=0x0,_0x431de4={},_0x5cfd1d={};_0xc7bb92<_0x5d430b['length'];_0xc7bb92+=0x1){_0x431de4=_0x5d430b[_0xc7bb92];var _0x4eafee=_[_0x9cd4('0x28')](_0x431de4['interface'])?util['format'](_0x9cd4('0x2a'),_0x431de4[_0x9cd4('0x27')]):_0x431de4['interface'];if(_[_0x9cd4('0x3e')](_0x2bdcbd['agents'][_0x4eafee])){_0x2bdcbd[_0x9cd4('0x11')][_0x4eafee]=new Agent(_0x431de4);}else{_0x2bdcbd[_0x9cd4('0x3f')](_0x2bdcbd[_0x9cd4('0x11')][_0x4eafee],_0x431de4);}}}return _0x2bdcbd['agents'];};};Realtime[_0x9cd4('0x3d')][_0x9cd4('0x40')]=function(){var _0x25f9d3=this;return function(_0x3f99c7){if(_0x3f99c7){freeIsNotKeySip(_0x3f99c7,_0x25f9d3[_0x9cd4('0x41')]);for(var _0x204302=0x0,_0x80b7e6={},_0x2d72ac={};_0x204302<_0x3f99c7['length'];_0x204302+=0x1){_0x80b7e6=_0x3f99c7[_0x204302];if(_[_0x9cd4('0x3e')](_0x25f9d3[_0x9cd4('0x41')][util['format'](_0x9cd4('0x2a'),_0x80b7e6['name'])])){_0x25f9d3[_0x9cd4('0x41')][util[_0x9cd4('0x26')]('SIP/%s',_0x80b7e6['name'])]=new Telephone(_0x80b7e6);}else{_0x25f9d3[_0x9cd4('0x3f')](_0x25f9d3[_0x9cd4('0x41')][util[_0x9cd4('0x26')](_0x9cd4('0x2a'),_0x80b7e6[_0x9cd4('0x27')])],_0x80b7e6);}}}return _0x25f9d3[_0x9cd4('0x41')];};};Realtime[_0x9cd4('0x3d')][_0x9cd4('0x42')]=function(){var _0x416155=this;return function(_0x422f1e){if(_0x422f1e){freeIsNotKeySip(_0x422f1e,_0x416155['trunks']);for(var _0x29a0d7=0x0,_0x54e9fd={},_0x252afa={};_0x29a0d7<_0x422f1e[_0x9cd4('0x43')];_0x29a0d7+=0x1){_0x54e9fd=_0x422f1e[_0x29a0d7];if(_[_0x9cd4('0x3e')](_0x416155['trunks'][util[_0x9cd4('0x26')]('SIP/%s',_0x54e9fd[_0x9cd4('0x27')])])){_0x416155[_0x9cd4('0x12')][util[_0x9cd4('0x26')](_0x9cd4('0x2a'),_0x54e9fd['name'])]=new Trunk(_0x54e9fd);}else{_0x416155[_0x9cd4('0x3f')](_0x416155[_0x9cd4('0x12')][util[_0x9cd4('0x26')](_0x9cd4('0x2a'),_0x54e9fd[_0x9cd4('0x27')])],_0x54e9fd);}}}return _0x416155[_0x9cd4('0x12')];};};Realtime[_0x9cd4('0x3d')]['initVoiceQueues']=function(){var _0x48561f=this;return function(_0x47682f){if(_0x47682f){freeIsNotKey(_0x47682f,_0x48561f[_0x9cd4('0x13')],_0x9cd4('0x27'));for(var _0x506272=0x0,_0x133bc7={},_0x4f7f6={};_0x506272<_0x47682f[_0x9cd4('0x43')];_0x506272+=0x1){_0x133bc7=_0x47682f[_0x506272];if(_[_0x9cd4('0x3e')](_0x48561f['voiceQueues'][_0x133bc7[_0x9cd4('0x27')]])){_0x48561f[_0x9cd4('0x13')][_0x133bc7[_0x9cd4('0x27')]]=new VoiceQueue(_0x133bc7);}else{_0x48561f[_0x9cd4('0x3f')](_0x48561f[_0x9cd4('0x13')][_0x133bc7[_0x9cd4('0x27')]],_0x133bc7);}}}return _0x48561f[_0x9cd4('0x13')];};};Realtime[_0x9cd4('0x3d')][_0x9cd4('0x44')]=function(){var _0x12d244=this;return function(_0x5e5ef4){if(_0x5e5ef4){freeIsNotKey(_0x5e5ef4,_0x12d244[_0x9cd4('0x14')],'id');for(var _0x3f560f=0x0,_0x488553={},_0x5bc50d={};_0x3f560f<_0x5e5ef4[_0x9cd4('0x43')];_0x3f560f+=0x1){_0x488553=_0x5e5ef4[_0x3f560f];if(_[_0x9cd4('0x3e')](_0x12d244[_0x9cd4('0x14')][_0x488553['id']])){_0x12d244[_0x9cd4('0x14')][_0x488553['id']]=new Trigger(_0x488553);}else{_0x12d244[_0x9cd4('0x3f')](_0x12d244['triggers'][_0x488553['id']],_0x488553);}}}return _0x12d244[_0x9cd4('0x14')];};};Realtime[_0x9cd4('0x3d')][_0x9cd4('0x45')]=function(){var _0x261cb1=this;return function(_0x1a8f84){if(_0x1a8f84){freeIsNotKey(_0x1a8f84,_0x261cb1[_0x9cd4('0x16')],'id');for(var _0x4187b=0x0,_0x570d9a={},_0x796cdc={};_0x4187b<_0x1a8f84[_0x9cd4('0x43')];_0x4187b+=0x1){_0x570d9a=_0x1a8f84[_0x4187b];if(_[_0x9cd4('0x3e')](_0x261cb1['templates'][_0x570d9a['id']])){_0x261cb1[_0x9cd4('0x16')][_0x570d9a['id']]=new Template(_0x570d9a);}else{_0x261cb1['mergeFromDatabase'](_0x261cb1[_0x9cd4('0x16')][_0x570d9a['id']],_0x570d9a);}}}return _0x261cb1[_0x9cd4('0x16')];};};Realtime[_0x9cd4('0x3d')]['initZendeskAccounts']=function(){var _0x3b8e9=this;return function(_0x2b9b67){if(_0x2b9b67){freeIsNotKey(_0x2b9b67,_0x3b8e9['zendeskAccounts'],'id');for(var _0x3baaf9=0x0,_0x498e8b={},_0x326269={};_0x3baaf9<_0x2b9b67[_0x9cd4('0x43')];_0x3baaf9+=0x1){_0x498e8b=_0x2b9b67[_0x3baaf9];if(_[_0x9cd4('0x3e')](_0x3b8e9[_0x9cd4('0x46')][_0x498e8b['id']])){_0x3b8e9['zendeskAccounts'][_0x498e8b['id']]=new ZendeskAccount(_0x498e8b);}else{_0x3b8e9[_0x9cd4('0x3f')](_0x3b8e9[_0x9cd4('0x46')][_0x498e8b['id']],_0x498e8b);}}}return _0x3b8e9[_0x9cd4('0x46')];};};Realtime[_0x9cd4('0x3d')][_0x9cd4('0x47')]=function(){var _0x31c1e0=this;return function(_0x2a9a99){if(_0x2a9a99){freeIsNotKey(_0x2a9a99,_0x31c1e0[_0x9cd4('0x1c')],'id');for(var _0x547bb4=0x0,_0x442c65={},_0x28a4f8={};_0x547bb4<_0x2a9a99['length'];_0x547bb4+=0x1){_0x442c65=_0x2a9a99[_0x547bb4];if(_[_0x9cd4('0x3e')](_0x31c1e0[_0x9cd4('0x1c')][_0x442c65['id']])){_0x31c1e0[_0x9cd4('0x1c')][_0x442c65['id']]=new SalesforceAccount(_0x442c65);}else{_0x31c1e0['mergeFromDatabase'](_0x31c1e0[_0x9cd4('0x1c')][_0x442c65['id']],_0x442c65);}}}return _0x31c1e0[_0x9cd4('0x1c')];};};Realtime[_0x9cd4('0x3d')]['initFreshdeskAccounts']=function(){var _0x1b071e=this;return function(_0x23d855){if(_0x23d855){freeIsNotKey(_0x23d855,_0x1b071e[_0x9cd4('0x48')],'id');for(var _0x3cf10b=0x0,_0x58b54c={},_0x4dc19c={};_0x3cf10b<_0x23d855[_0x9cd4('0x43')];_0x3cf10b+=0x1){_0x58b54c=_0x23d855[_0x3cf10b];if(_[_0x9cd4('0x3e')](_0x1b071e[_0x9cd4('0x48')][_0x58b54c['id']])){_0x1b071e[_0x9cd4('0x48')][_0x58b54c['id']]=new FreshdeskAccount(_0x58b54c);}else{_0x1b071e['mergeFromDatabase'](_0x1b071e[_0x9cd4('0x48')][_0x58b54c['id']],_0x58b54c);}}}return _0x1b071e[_0x9cd4('0x48')];};};Realtime[_0x9cd4('0x3d')][_0x9cd4('0x49')]=function(){var _0x380acf=this;return function(_0x27d691){if(_0x27d691){freeIsNotKey(_0x27d691,_0x380acf[_0x9cd4('0x1d')],'id');for(var _0x174a90=0x0,_0x5658f2={},_0x52f18d={};_0x174a90<_0x27d691[_0x9cd4('0x43')];_0x174a90+=0x1){_0x5658f2=_0x27d691[_0x174a90];if(_['isUndefined'](_0x380acf[_0x9cd4('0x1d')][_0x5658f2['id']])){_0x380acf[_0x9cd4('0x1d')][_0x5658f2['id']]=new ZohoAccount(_0x5658f2);}else{_0x380acf[_0x9cd4('0x3f')](_0x380acf['zohoAccounts'][_0x5658f2['id']],_0x5658f2);}}}return _0x380acf[_0x9cd4('0x1d')];};};Realtime[_0x9cd4('0x3d')][_0x9cd4('0x4a')]=function(){var _0x4add45=this;return function(_0x1f5ee3){if(_0x1f5ee3){freeIsNotKey(_0x1f5ee3,_0x4add45[_0x9cd4('0x1e')],'id');for(var _0x1f68bd=0x0,_0xfe3945={},_0x34d6b3={};_0x1f68bd<_0x1f5ee3[_0x9cd4('0x43')];_0x1f68bd+=0x1){_0xfe3945=_0x1f5ee3[_0x1f68bd];if(_['isUndefined'](_0x4add45[_0x9cd4('0x1e')][_0xfe3945['id']])){_0x4add45['deskAccounts'][_0xfe3945['id']]=new DeskAccount(_0xfe3945);}else{_0x4add45['mergeFromDatabase'](_0x4add45[_0x9cd4('0x1e')][_0xfe3945['id']],_0xfe3945);}}}return _0x4add45[_0x9cd4('0x1e')];};};Realtime[_0x9cd4('0x3d')]['initSugarcrmAccounts']=function(){var _0x5d4b32=this;return function(_0x103246){if(_0x103246){freeIsNotKey(_0x103246,_0x5d4b32[_0x9cd4('0x4b')],'id');for(var _0x28bac8=0x0,_0x30da2b={},_0x351fe4={};_0x28bac8<_0x103246['length'];_0x28bac8+=0x1){_0x30da2b=_0x103246[_0x28bac8];if(_[_0x9cd4('0x3e')](_0x5d4b32[_0x9cd4('0x4b')][_0x30da2b['id']])){_0x5d4b32[_0x9cd4('0x4b')][_0x30da2b['id']]=new SugarcrmAccount(_0x30da2b);}else{_0x5d4b32[_0x9cd4('0x3f')](_0x5d4b32[_0x9cd4('0x4b')][_0x30da2b['id']],_0x30da2b);}}}return _0x5d4b32['sugarcrmAccounts'];};};Realtime[_0x9cd4('0x3d')][_0x9cd4('0x4c')]=function(){var _0x186e49=this;return function(_0x47bcdf){if(_0x47bcdf){freeIsNotKey(_0x47bcdf,_0x186e49[_0x9cd4('0x1f')],'id');for(var _0x4f1946=0x0,_0x592654={},_0x30c5a0={};_0x4f1946<_0x47bcdf['length'];_0x4f1946+=0x1){_0x592654=_0x47bcdf[_0x4f1946];if(_[_0x9cd4('0x3e')](_0x186e49[_0x9cd4('0x1f')][_0x592654['id']])){_0x186e49[_0x9cd4('0x1f')][_0x592654['id']]=new VtigerAccount(_0x592654);}else{_0x186e49[_0x9cd4('0x3f')](_0x186e49[_0x9cd4('0x1f')][_0x592654['id']],_0x592654);}}}return _0x186e49[_0x9cd4('0x1f')];};};Realtime['prototype'][_0x9cd4('0x4d')]=function(){var _0x155189=this;return function(_0x167dd){if(_0x167dd){freeIsNotKey(_0x167dd,_0x155189[_0x9cd4('0x20')],'id');for(var _0x2bd096=0x0,_0x14cac5={},_0x17e2f1={};_0x2bd096<_0x167dd[_0x9cd4('0x43')];_0x2bd096+=0x1){_0x14cac5=_0x167dd[_0x2bd096];if(_[_0x9cd4('0x3e')](_0x155189['servicenowAccounts'][_0x14cac5['id']])){_0x155189['servicenowAccounts'][_0x14cac5['id']]=new ServicenowAccount(_0x14cac5);}else{_0x155189[_0x9cd4('0x3f')](_0x155189[_0x9cd4('0x20')][_0x14cac5['id']],_0x14cac5);}}}return _0x155189[_0x9cd4('0x20')];};};Realtime['prototype'][_0x9cd4('0x4e')]=function(){var _0x11ff97=this;return function(_0x309d0f){if(_0x309d0f){freeIsNotKey(_0x309d0f,_0x11ff97[_0x9cd4('0x21')],'id');for(var _0x2d9b5a=0x0,_0x44ff96={},_0x540b8f={};_0x2d9b5a<_0x309d0f[_0x9cd4('0x43')];_0x2d9b5a+=0x1){_0x44ff96=_0x309d0f[_0x2d9b5a];if(_[_0x9cd4('0x3e')](_0x11ff97[_0x9cd4('0x21')][_0x44ff96['id']])){_0x11ff97[_0x9cd4('0x21')][_0x44ff96['id']]=new Dynamics365Account(_0x44ff96);}else{_0x11ff97['mergeFromDatabase'](_0x11ff97[_0x9cd4('0x21')][_0x44ff96['id']],_0x44ff96);}}}return _0x11ff97['dynamics365Accounts'];};};Realtime[_0x9cd4('0x3d')][_0x9cd4('0x4f')]=function(){var _0x42abf8=this;return function(_0x29d190){if(_0x29d190){freeIsNotKey(_0x29d190,_0x42abf8[_0x9cd4('0x22')],'id');for(var _0x5d7710=0x0,_0x2b0d4f={},_0x460264={};_0x5d7710<_0x29d190[_0x9cd4('0x43')];_0x5d7710+=0x1){_0x2b0d4f=_0x29d190[_0x5d7710];if(_[_0x9cd4('0x3e')](_0x42abf8['freshsalesAccounts'][_0x2b0d4f['id']])){_0x42abf8['freshsalesAccounts'][_0x2b0d4f['id']]=new FreshsalesAccount(_0x2b0d4f);}else{_0x42abf8[_0x9cd4('0x3f')](_0x42abf8[_0x9cd4('0x22')][_0x2b0d4f['id']],_0x2b0d4f);}}}return _0x42abf8[_0x9cd4('0x22')];};};Realtime[_0x9cd4('0x3d')][_0x9cd4('0x50')]=function(){var _0x227a16=this;return function(_0x12279d){for(var _0x2e8f82=0x0;_0x2e8f82<_0x12279d[_0x9cd4('0x43')];_0x2e8f82+=0x1){_['merge'](_0x227a16['voiceQueues'][_0x12279d[_0x2e8f82]['name']],_0x12279d[_0x2e8f82]);}return _0x227a16[_0x9cd4('0x13')];};};Realtime[_0x9cd4('0x3d')][_0x9cd4('0x51')]=function(){var _0x408bfa=this;return function(_0x213668){clearVoiceQueues(_0x408bfa['voiceQueues']);if(_0x213668){_0x213668=_[_0x9cd4('0x52')](_0x213668,_0x9cd4('0x53'));for(var _0x1c128f in _0x213668){if(_0x213668[_0x9cd4('0x25')](_0x1c128f)){var _0x2acedd={};for(var _0x368447=0x0;_0x368447<_0x213668[_0x1c128f]['length'];_0x368447+=0x1){var _0x131781=_0x213668[_0x1c128f][_0x368447][_0x9cd4('0x54')];if(_0x408bfa['voiceQueues'][_0x131781]){if(_0x213668[_0x1c128f][_0x368447][_0x9cd4('0x55')]){_0x408bfa[_0x9cd4('0x13')][_0x131781][_0x9cd4('0x56')]+=0x1;}if(_0x213668[_0x1c128f][_0x368447]['queuecallerabandon']){_0x408bfa['voiceQueues'][_0x131781]['abandoned']+=0x1;}_0x408bfa[_0x9cd4('0x13')][_0x131781][_0x9cd4('0x2d')]+=moment(_0x213668[_0x1c128f][_0x368447][_0x9cd4('0x57')])['diff'](moment(_0x213668[_0x1c128f][_0x368447][_0x9cd4('0x58')]),_0x9cd4('0x59'))||0x0;if(_0x368447===_0x213668[_0x1c128f][_0x9cd4('0x43')]-0x1){_0x408bfa[_0x9cd4('0x13')][_0x131781][_0x9cd4('0x2e')]+=moment(_0x213668[_0x1c128f][_0x368447][_0x9cd4('0x5a')]||_0x213668[_0x1c128f][_0x368447][_0x9cd4('0x5b')]||_0x213668[_0x1c128f][_0x368447][_0x9cd4('0x5c')])[_0x9cd4('0x5d')](moment(_0x213668[_0x1c128f][_0x368447][_0x9cd4('0x58')]),_0x9cd4('0x59'))||0x0;_0x408bfa[_0x9cd4('0x13')][_0x131781][_0x9cd4('0x2b')]+=0x1;if(_0x213668[_0x1c128f][_0x368447]['queuecallercomplete']){_0x408bfa[_0x9cd4('0x13')][_0x131781][_0x9cd4('0x2c')]+=0x1;_0x408bfa[_0x9cd4('0x13')][_0x131781]['sumBillable']+=moment(_0x213668[_0x1c128f][_0x368447][_0x9cd4('0x5a')])['diff'](moment(_0x213668[_0x1c128f][_0x368447][_0x9cd4('0x57')]),_0x9cd4('0x59'))||0x0;}}else{_0x408bfa[_0x9cd4('0x13')][_0x131781][_0x9cd4('0x2e')]+=_0x408bfa[_0x9cd4('0x13')][_0x131781][_0x9cd4('0x2d')]||0x0;}}}}}}return _0x408bfa[_0x9cd4('0x13')];};};Realtime[_0x9cd4('0x3d')][_0x9cd4('0x5e')]=function(){var _0x1963d3=this;return function(_0x38be6e){clearVoiceCallReports(_0x1963d3[_0x9cd4('0x17')]);if(_0x38be6e){for(var _0x53f594=0x0;_0x53f594<_0x38be6e[_0x9cd4('0x43')];_0x53f594+=0x1){_0x1963d3[_0x9cd4('0x17')][_0x9cd4('0x2b')]+=0x1;_0x1963d3[_0x9cd4('0x17')][_0x9cd4('0x2e')]+=_0x38be6e[_0x53f594]['duration'];if(_0x38be6e[_0x53f594][_0x9cd4('0x5f')]===_0x9cd4('0x60')){_0x1963d3[_0x9cd4('0x17')]['answered']+=0x1;_0x1963d3[_0x9cd4('0x17')]['sumHoldTime']+=_0x38be6e[_0x53f594][_0x9cd4('0x61')]-_0x38be6e[_0x53f594][_0x9cd4('0x62')]||0x0;_0x1963d3[_0x9cd4('0x17')]['sumBillable']+=_0x38be6e[_0x53f594]['billableseconds'];}}}return _0x1963d3[_0x9cd4('0x17')];};};Realtime[_0x9cd4('0x3d')]['initCampaigns']=function(){var _0x5b77e3=this;return function(_0x292a4c){if(_0x292a4c){freeIsNotKey(_0x292a4c,_0x5b77e3[_0x9cd4('0x15')],'name');for(var _0x1e942d=0x0,_0x32ed1b={};_0x1e942d<_0x292a4c[_0x9cd4('0x43')];_0x1e942d+=0x1){_0x32ed1b=_0x292a4c[_0x1e942d];if(_[_0x9cd4('0x3e')](_0x5b77e3['campaigns'][_0x32ed1b[_0x9cd4('0x27')]])){_0x5b77e3[_0x9cd4('0x15')][_0x32ed1b[_0x9cd4('0x27')]]=new Campaign(_0x32ed1b);}else{_0x5b77e3['mergeFromDatabase'](_0x5b77e3['campaigns'][_0x32ed1b['name']],_0x32ed1b);}}}return _0x5b77e3['campaigns'];};};Realtime['prototype'][_0x9cd4('0x63')]=function(){var _0x55564d=this;return function(_0x4de943){if(_0x4de943){freeIsNotKey(_0x4de943,_0x55564d[_0x9cd4('0x18')],'id');for(var _0xa5efe5=0x0,_0x1269ae={};_0xa5efe5<_0x4de943[_0x9cd4('0x43')];_0xa5efe5+=0x1){_0x1269ae=_0x4de943[_0xa5efe5];if(_[_0x9cd4('0x3e')](_0x55564d['voiceExtensions'][_0x1269ae['id']])){_0x55564d[_0x9cd4('0x18')][_0x1269ae['id']]=new VoiceExtension(_0x1269ae);}else{_0x55564d[_0x9cd4('0x3f')](_0x55564d[_0x9cd4('0x18')][_0x1269ae['id']],_0x1269ae);}}}return _0x55564d['voiceExtensions'];};};Realtime[_0x9cd4('0x3d')][_0x9cd4('0x64')]=function(){var _0x19a3b0=this;return function(_0x542d70){clearCampaigns(_0x19a3b0[_0x9cd4('0x15')]);for(var _0x3e2ce7=0x0;_0x3e2ce7<_0x542d70[_0x9cd4('0x43')];_0x3e2ce7+=0x1){_[_0x9cd4('0x65')](_0x19a3b0[_0x9cd4('0x15')][_0x542d70[_0x3e2ce7][_0x9cd4('0x27')]],_0x542d70[_0x3e2ce7]);}return _0x19a3b0[_0x9cd4('0x15')];};};Realtime['prototype'][_0x9cd4('0x66')]=function(){var _0x31e0f7=this;return function(_0x4a7d52){if(_0x4a7d52){freeIsNotKey(_0x4a7d52,_0x31e0f7[_0x9cd4('0x23')],'id');for(var _0x2f89db=0x0,_0x1d40c9={},_0x774de9={};_0x2f89db<_0x4a7d52['length'];_0x2f89db+=0x1){_0x1d40c9=_0x4a7d52[_0x2f89db];if(_[_0x9cd4('0x3e')](_0x31e0f7[_0x9cd4('0x23')][_0x1d40c9['id']])){_0x31e0f7[_0x9cd4('0x23')][_0x1d40c9['id']]=new FaxAccount(_0x1d40c9);}else{_0x31e0f7['mergeFromDatabase'](_0x31e0f7['faxAccounts'][_0x1d40c9['id']],_0x1d40c9);}}}return _0x31e0f7['faxAccounts'];};};module[_0x9cd4('0x67')]=Realtime; \ No newline at end of file +var _0x1fac=['voiceExtensions','channels','queueChannels','outboundChannels','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','format','SIP/%s','hasOwnProperty','isNil','interface','name','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','total','unmanaged','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','prototype','mergeFromDatabase','initAgents','isUndefined','initTelephones','telephones','length','initTrunks','trunks','initVoiceQueues','initTriggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','outbound','disposition','ANSWERED','duration','billableseconds','initCampaigns','campaigns','initCampaignHopperHistory','exports','util','lodash','moment','../model/agent','../model/voiceQueue','../model/template','../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','voiceQueues','triggers','templates'];(function(_0x3e3936,_0x24c3a6){var _0x10be4e=function(_0x271a5d){while(--_0x271a5d){_0x3e3936['push'](_0x3e3936['shift']());}};_0x10be4e(++_0x24c3a6);}(_0x1fac,0x17d));var _0xc1fa=function(_0x22e688,_0x4b6347){_0x22e688=_0x22e688-0x0;var _0x1dbb0c=_0x1fac[_0x22e688];return _0x1dbb0c;};'use strict';var BPromise=require('bluebird');var util=require(_0xc1fa('0x0'));var _=require(_0xc1fa('0x1'));var moment=require(_0xc1fa('0x2'));var Agent=require(_0xc1fa('0x3'));var Telephone=require('../model/telephone');var Trunk=require('../model/trunk');var VoiceQueue=require(_0xc1fa('0x4'));var Trigger=require('../model/trigger');var Template=require(_0xc1fa('0x5'));var Campaign=require('../model/campaign');var VoiceExtension=require(_0xc1fa('0x6'));var ZendeskAccount=require(_0xc1fa('0x7'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0xc1fa('0x8'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0xc1fa('0x9'));var VtigerAccount=require(_0xc1fa('0xa'));var ServicenowAccount=require(_0xc1fa('0xb'));var Dynamics365Account=require(_0xc1fa('0xc'));var FreshsalesAccount=require(_0xc1fa('0xd'));var FaxAccount=require(_0xc1fa('0xe'));var Realtime=function(){this[_0xc1fa('0xf')]={};this['telephones']={};this['trunks']={};this[_0xc1fa('0x10')]={};this[_0xc1fa('0x11')]={};this['campaigns']={};this[_0xc1fa('0x12')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xc1fa('0x13')]={};this[_0xc1fa('0x14')]={};this[_0xc1fa('0x15')]={};this[_0xc1fa('0x16')]={};this['timers']={};this[_0xc1fa('0x17')]={};this['salesforceAccounts']={};this[_0xc1fa('0x18')]={};this[_0xc1fa('0x19')]={};this[_0xc1fa('0x1a')]={};this[_0xc1fa('0x1b')]={};this[_0xc1fa('0x1c')]={};this['servicenowAccounts']={};this[_0xc1fa('0x1d')]={};this[_0xc1fa('0x1e')]={};this[_0xc1fa('0x1f')]={};};function freeIsNotKey(_0x1b6502,_0x441aa7,_0x232daa){var _0x3f17e2=_[_0xc1fa('0x20')](_0x1b6502,function(_0x4ccc90,_0x112587){return _0x4ccc90[_0x232daa];});for(var _0x392e02 in _0x441aa7){if(_0x441aa7['hasOwnProperty'](_0x392e02)){if(!_0x3f17e2[_0x392e02]){delete _0x441aa7[_0x392e02];}}}}function freeIsNotKeySip(_0x119479,_0x378182){var _0x1e3282=_[_0xc1fa('0x20')](_0x119479,function(_0x1662ff,_0x2ef38d){return util[_0xc1fa('0x21')](_0xc1fa('0x22'),_0x1662ff['name']);});for(var _0x245e38 in _0x378182){if(_0x378182[_0xc1fa('0x23')](_0x245e38)){if(!_0x1e3282[_0x245e38]){delete _0x378182[_0x245e38];}}}}function freeIsNotKeyAgent(_0x474534,_0x323bd9){var _0x7b0067=_[_0xc1fa('0x20')](_0x474534,function(_0x33a9f7,_0x55202c){var _0x178af9=_[_0xc1fa('0x24')](_0x33a9f7[_0xc1fa('0x25')])?util[_0xc1fa('0x21')](_0xc1fa('0x22'),_0x33a9f7[_0xc1fa('0x26')]):_0x33a9f7[_0xc1fa('0x25')];return _0x178af9;});for(var _0x5a6fbc in _0x323bd9){if(_0x323bd9[_0xc1fa('0x23')](_0x5a6fbc)){if(!_0x7b0067[_0x5a6fbc]){delete _0x323bd9[_0x5a6fbc];}}}}function clearVoiceCallReports(_0xa80588){_0xa80588['total']=0x0;_0xa80588[_0xc1fa('0x27')]=0x0;_0xa80588[_0xc1fa('0x28')]=0x0;_0xa80588[_0xc1fa('0x29')]=0x0;_0xa80588[_0xc1fa('0x2a')]=0x0;}function clearCampaigns(_0x27ef70){if(!_[_0xc1fa('0x2b')](_0x27ef70)){for(var _0x3e0a24 in _0x27ef70){if(_0x27ef70['hasOwnProperty'](_0x3e0a24)){_0x27ef70[_0x3e0a24][_0xc1fa('0x2c')]=0x0;_0x27ef70[_0x3e0a24][_0xc1fa('0x2d')]=0x0;}}}}function clearVoiceQueues(_0x1873ac){if(!_[_0xc1fa('0x2b')](_0x1873ac)){for(var _0x457d3e in _0x1873ac){if(_0x1873ac[_0xc1fa('0x23')](_0x457d3e)){_0x1873ac[_0x457d3e][_0xc1fa('0x2e')]=0x0;_0x1873ac[_0x457d3e]['answered']=0x0;_0x1873ac[_0x457d3e][_0xc1fa('0x2f')]=0x0;_0x1873ac[_0x457d3e]['abandoned']=0x0;_0x1873ac[_0x457d3e][_0xc1fa('0x28')]=0x0;_0x1873ac[_0x457d3e][_0xc1fa('0x29')]=0x0;_0x1873ac[_0x457d3e]['sumBillable']=0x0;_0x1873ac[_0x457d3e]['outboundAnswerAgiCallsDay']=0x0;_0x1873ac[_0x457d3e][_0xc1fa('0x30')]=0x0;_0x1873ac[_0x457d3e][_0xc1fa('0x31')]=0x0;_0x1873ac[_0x457d3e][_0xc1fa('0x32')]=0x0;_0x1873ac[_0x457d3e]['outboundNoSuchCallsDay']=0x0;_0x1873ac[_0x457d3e]['outboundUnknownCallsDay']=0x0;_0x1873ac[_0x457d3e][_0xc1fa('0x33')]=0x0;_0x1873ac[_0x457d3e]['outboundDropCallsDayCallersExit']=0x0;_0x1873ac[_0x457d3e][_0xc1fa('0x34')]=0x0;_0x1873ac[_0x457d3e][_0xc1fa('0x35')]=0x0;_0x1873ac[_0x457d3e]['outboundRejectCallsDay']=0x0;_0x1873ac[_0x457d3e][_0xc1fa('0x36')]=0x0;_0x1873ac[_0x457d3e]['outboundAnswerAgiCallsDay']=0x0;_0x1873ac[_0x457d3e]['outboundAnswerCallsDay']=0x0;_0x1873ac[_0x457d3e]['queueStatusComplete']=!![];}}}}Realtime[_0xc1fa('0x37')][_0xc1fa('0x38')]=function(_0x55fb57,_0xe6d287){for(var _0x1ef19a in _0xe6d287){if(_0x55fb57[_0xc1fa('0x23')](_0x1ef19a)){_0x55fb57[_0x1ef19a]=_0xe6d287[_0x1ef19a];}}};Realtime['prototype'][_0xc1fa('0x39')]=function(){var _0xd2d43=this;return function(_0x13fd4b){if(_0x13fd4b){freeIsNotKeyAgent(_0x13fd4b,_0xd2d43[_0xc1fa('0xf')]);for(var _0x3de41c=0x0,_0x5a0d54={},_0x514330={};_0x3de41c<_0x13fd4b['length'];_0x3de41c+=0x1){_0x5a0d54=_0x13fd4b[_0x3de41c];var _0x5aac55=_[_0xc1fa('0x24')](_0x5a0d54[_0xc1fa('0x25')])?util[_0xc1fa('0x21')](_0xc1fa('0x22'),_0x5a0d54['name']):_0x5a0d54[_0xc1fa('0x25')];if(_[_0xc1fa('0x3a')](_0xd2d43[_0xc1fa('0xf')][_0x5aac55])){_0xd2d43[_0xc1fa('0xf')][_0x5aac55]=new Agent(_0x5a0d54);}else{_0xd2d43[_0xc1fa('0x38')](_0xd2d43[_0xc1fa('0xf')][_0x5aac55],_0x5a0d54);}}}return _0xd2d43[_0xc1fa('0xf')];};};Realtime[_0xc1fa('0x37')][_0xc1fa('0x3b')]=function(){var _0x2f17e9=this;return function(_0x5494ff){if(_0x5494ff){freeIsNotKeySip(_0x5494ff,_0x2f17e9[_0xc1fa('0x3c')]);for(var _0x3f0900=0x0,_0x34c86a={},_0xd56552={};_0x3f0900<_0x5494ff[_0xc1fa('0x3d')];_0x3f0900+=0x1){_0x34c86a=_0x5494ff[_0x3f0900];if(_[_0xc1fa('0x3a')](_0x2f17e9[_0xc1fa('0x3c')][util['format'](_0xc1fa('0x22'),_0x34c86a[_0xc1fa('0x26')])])){_0x2f17e9[_0xc1fa('0x3c')][util['format'](_0xc1fa('0x22'),_0x34c86a[_0xc1fa('0x26')])]=new Telephone(_0x34c86a);}else{_0x2f17e9['mergeFromDatabase'](_0x2f17e9[_0xc1fa('0x3c')][util['format'](_0xc1fa('0x22'),_0x34c86a['name'])],_0x34c86a);}}}return _0x2f17e9[_0xc1fa('0x3c')];};};Realtime[_0xc1fa('0x37')][_0xc1fa('0x3e')]=function(){var _0x5bf446=this;return function(_0x18036c){if(_0x18036c){freeIsNotKeySip(_0x18036c,_0x5bf446[_0xc1fa('0x3f')]);for(var _0x1928ed=0x0,_0x486fe1={},_0x2cf042={};_0x1928ed<_0x18036c[_0xc1fa('0x3d')];_0x1928ed+=0x1){_0x486fe1=_0x18036c[_0x1928ed];if(_[_0xc1fa('0x3a')](_0x5bf446['trunks'][util[_0xc1fa('0x21')](_0xc1fa('0x22'),_0x486fe1['name'])])){_0x5bf446[_0xc1fa('0x3f')][util['format'](_0xc1fa('0x22'),_0x486fe1[_0xc1fa('0x26')])]=new Trunk(_0x486fe1);}else{_0x5bf446[_0xc1fa('0x38')](_0x5bf446[_0xc1fa('0x3f')][util[_0xc1fa('0x21')](_0xc1fa('0x22'),_0x486fe1[_0xc1fa('0x26')])],_0x486fe1);}}}return _0x5bf446[_0xc1fa('0x3f')];};};Realtime[_0xc1fa('0x37')][_0xc1fa('0x40')]=function(){var _0x5ecb66=this;return function(_0x3866d8){if(_0x3866d8){freeIsNotKey(_0x3866d8,_0x5ecb66[_0xc1fa('0x10')],_0xc1fa('0x26'));for(var _0x438452=0x0,_0x41958c={},_0x511810={};_0x438452<_0x3866d8[_0xc1fa('0x3d')];_0x438452+=0x1){_0x41958c=_0x3866d8[_0x438452];if(_[_0xc1fa('0x3a')](_0x5ecb66[_0xc1fa('0x10')][_0x41958c['name']])){_0x5ecb66[_0xc1fa('0x10')][_0x41958c['name']]=new VoiceQueue(_0x41958c);}else{_0x5ecb66[_0xc1fa('0x38')](_0x5ecb66[_0xc1fa('0x10')][_0x41958c[_0xc1fa('0x26')]],_0x41958c);}}}return _0x5ecb66[_0xc1fa('0x10')];};};Realtime['prototype'][_0xc1fa('0x41')]=function(){var _0x5688d0=this;return function(_0x1a7b00){if(_0x1a7b00){freeIsNotKey(_0x1a7b00,_0x5688d0[_0xc1fa('0x11')],'id');for(var _0x40510d=0x0,_0x1e14f7={},_0x8c6a83={};_0x40510d<_0x1a7b00[_0xc1fa('0x3d')];_0x40510d+=0x1){_0x1e14f7=_0x1a7b00[_0x40510d];if(_[_0xc1fa('0x3a')](_0x5688d0[_0xc1fa('0x11')][_0x1e14f7['id']])){_0x5688d0[_0xc1fa('0x11')][_0x1e14f7['id']]=new Trigger(_0x1e14f7);}else{_0x5688d0['mergeFromDatabase'](_0x5688d0['triggers'][_0x1e14f7['id']],_0x1e14f7);}}}return _0x5688d0[_0xc1fa('0x11')];};};Realtime['prototype'][_0xc1fa('0x42')]=function(){var _0xe83169=this;return function(_0xf94e17){if(_0xf94e17){freeIsNotKey(_0xf94e17,_0xe83169['templates'],'id');for(var _0x30f3a2=0x0,_0xa36198={},_0x1af93e={};_0x30f3a2<_0xf94e17[_0xc1fa('0x3d')];_0x30f3a2+=0x1){_0xa36198=_0xf94e17[_0x30f3a2];if(_[_0xc1fa('0x3a')](_0xe83169[_0xc1fa('0x12')][_0xa36198['id']])){_0xe83169[_0xc1fa('0x12')][_0xa36198['id']]=new Template(_0xa36198);}else{_0xe83169['mergeFromDatabase'](_0xe83169[_0xc1fa('0x12')][_0xa36198['id']],_0xa36198);}}}return _0xe83169[_0xc1fa('0x12')];};};Realtime['prototype'][_0xc1fa('0x43')]=function(){var _0x33f6d9=this;return function(_0x490e04){if(_0x490e04){freeIsNotKey(_0x490e04,_0x33f6d9[_0xc1fa('0x17')],'id');for(var _0x562259=0x0,_0xe4e928={},_0x509a9e={};_0x562259<_0x490e04[_0xc1fa('0x3d')];_0x562259+=0x1){_0xe4e928=_0x490e04[_0x562259];if(_[_0xc1fa('0x3a')](_0x33f6d9[_0xc1fa('0x17')][_0xe4e928['id']])){_0x33f6d9['zendeskAccounts'][_0xe4e928['id']]=new ZendeskAccount(_0xe4e928);}else{_0x33f6d9['mergeFromDatabase'](_0x33f6d9['zendeskAccounts'][_0xe4e928['id']],_0xe4e928);}}}return _0x33f6d9[_0xc1fa('0x17')];};};Realtime[_0xc1fa('0x37')][_0xc1fa('0x44')]=function(){var _0x3bc8ba=this;return function(_0x33add6){if(_0x33add6){freeIsNotKey(_0x33add6,_0x3bc8ba[_0xc1fa('0x45')],'id');for(var _0x51d0dd=0x0,_0x4c7f28={},_0x1839b2={};_0x51d0dd<_0x33add6[_0xc1fa('0x3d')];_0x51d0dd+=0x1){_0x4c7f28=_0x33add6[_0x51d0dd];if(_[_0xc1fa('0x3a')](_0x3bc8ba[_0xc1fa('0x45')][_0x4c7f28['id']])){_0x3bc8ba[_0xc1fa('0x45')][_0x4c7f28['id']]=new SalesforceAccount(_0x4c7f28);}else{_0x3bc8ba[_0xc1fa('0x38')](_0x3bc8ba['salesforceAccounts'][_0x4c7f28['id']],_0x4c7f28);}}}return _0x3bc8ba[_0xc1fa('0x45')];};};Realtime['prototype'][_0xc1fa('0x46')]=function(){var _0x1c044f=this;return function(_0x1265d5){if(_0x1265d5){freeIsNotKey(_0x1265d5,_0x1c044f['freshdeskAccounts'],'id');for(var _0x1e2c58=0x0,_0xec8ad4={},_0xab657={};_0x1e2c58<_0x1265d5[_0xc1fa('0x3d')];_0x1e2c58+=0x1){_0xec8ad4=_0x1265d5[_0x1e2c58];if(_[_0xc1fa('0x3a')](_0x1c044f[_0xc1fa('0x19')][_0xec8ad4['id']])){_0x1c044f[_0xc1fa('0x19')][_0xec8ad4['id']]=new FreshdeskAccount(_0xec8ad4);}else{_0x1c044f[_0xc1fa('0x38')](_0x1c044f[_0xc1fa('0x19')][_0xec8ad4['id']],_0xec8ad4);}}}return _0x1c044f[_0xc1fa('0x19')];};};Realtime['prototype'][_0xc1fa('0x47')]=function(){var _0x1faf73=this;return function(_0x7c88b1){if(_0x7c88b1){freeIsNotKey(_0x7c88b1,_0x1faf73[_0xc1fa('0x1a')],'id');for(var _0x11bf8d=0x0,_0x294571={},_0x33508b={};_0x11bf8d<_0x7c88b1[_0xc1fa('0x3d')];_0x11bf8d+=0x1){_0x294571=_0x7c88b1[_0x11bf8d];if(_[_0xc1fa('0x3a')](_0x1faf73['zohoAccounts'][_0x294571['id']])){_0x1faf73[_0xc1fa('0x1a')][_0x294571['id']]=new ZohoAccount(_0x294571);}else{_0x1faf73[_0xc1fa('0x38')](_0x1faf73[_0xc1fa('0x1a')][_0x294571['id']],_0x294571);}}}return _0x1faf73['zohoAccounts'];};};Realtime[_0xc1fa('0x37')][_0xc1fa('0x48')]=function(){var _0x406f1a=this;return function(_0x46a1f9){if(_0x46a1f9){freeIsNotKey(_0x46a1f9,_0x406f1a[_0xc1fa('0x1b')],'id');for(var _0x33ff35=0x0,_0x12b4ee={},_0x2d4218={};_0x33ff35<_0x46a1f9[_0xc1fa('0x3d')];_0x33ff35+=0x1){_0x12b4ee=_0x46a1f9[_0x33ff35];if(_['isUndefined'](_0x406f1a[_0xc1fa('0x1b')][_0x12b4ee['id']])){_0x406f1a['deskAccounts'][_0x12b4ee['id']]=new DeskAccount(_0x12b4ee);}else{_0x406f1a[_0xc1fa('0x38')](_0x406f1a[_0xc1fa('0x1b')][_0x12b4ee['id']],_0x12b4ee);}}}return _0x406f1a[_0xc1fa('0x1b')];};};Realtime[_0xc1fa('0x37')][_0xc1fa('0x49')]=function(){var _0x14bf0e=this;return function(_0x53a39d){if(_0x53a39d){freeIsNotKey(_0x53a39d,_0x14bf0e[_0xc1fa('0x18')],'id');for(var _0x220a68=0x0,_0x43d4ac={},_0x3471c1={};_0x220a68<_0x53a39d[_0xc1fa('0x3d')];_0x220a68+=0x1){_0x43d4ac=_0x53a39d[_0x220a68];if(_['isUndefined'](_0x14bf0e[_0xc1fa('0x18')][_0x43d4ac['id']])){_0x14bf0e[_0xc1fa('0x18')][_0x43d4ac['id']]=new SugarcrmAccount(_0x43d4ac);}else{_0x14bf0e[_0xc1fa('0x38')](_0x14bf0e[_0xc1fa('0x18')][_0x43d4ac['id']],_0x43d4ac);}}}return _0x14bf0e[_0xc1fa('0x18')];};};Realtime[_0xc1fa('0x37')][_0xc1fa('0x4a')]=function(){var _0x5f0c2a=this;return function(_0xf85a42){if(_0xf85a42){freeIsNotKey(_0xf85a42,_0x5f0c2a[_0xc1fa('0x1c')],'id');for(var _0x3b5240=0x0,_0x1b1ff9={},_0x55141b={};_0x3b5240<_0xf85a42[_0xc1fa('0x3d')];_0x3b5240+=0x1){_0x1b1ff9=_0xf85a42[_0x3b5240];if(_[_0xc1fa('0x3a')](_0x5f0c2a[_0xc1fa('0x1c')][_0x1b1ff9['id']])){_0x5f0c2a[_0xc1fa('0x1c')][_0x1b1ff9['id']]=new VtigerAccount(_0x1b1ff9);}else{_0x5f0c2a[_0xc1fa('0x38')](_0x5f0c2a['vtigerAccounts'][_0x1b1ff9['id']],_0x1b1ff9);}}}return _0x5f0c2a[_0xc1fa('0x1c')];};};Realtime[_0xc1fa('0x37')][_0xc1fa('0x4b')]=function(){var _0x184354=this;return function(_0x4e693a){if(_0x4e693a){freeIsNotKey(_0x4e693a,_0x184354['servicenowAccounts'],'id');for(var _0x31f19a=0x0,_0x450de9={},_0x15ff3f={};_0x31f19a<_0x4e693a[_0xc1fa('0x3d')];_0x31f19a+=0x1){_0x450de9=_0x4e693a[_0x31f19a];if(_[_0xc1fa('0x3a')](_0x184354[_0xc1fa('0x4c')][_0x450de9['id']])){_0x184354[_0xc1fa('0x4c')][_0x450de9['id']]=new ServicenowAccount(_0x450de9);}else{_0x184354[_0xc1fa('0x38')](_0x184354['servicenowAccounts'][_0x450de9['id']],_0x450de9);}}}return _0x184354[_0xc1fa('0x4c')];};};Realtime[_0xc1fa('0x37')]['initDynamics365Accounts']=function(){var _0xbfd0f=this;return function(_0x299527){if(_0x299527){freeIsNotKey(_0x299527,_0xbfd0f['dynamics365Accounts'],'id');for(var _0x7fe474=0x0,_0x26070c={},_0x7a6c40={};_0x7fe474<_0x299527[_0xc1fa('0x3d')];_0x7fe474+=0x1){_0x26070c=_0x299527[_0x7fe474];if(_[_0xc1fa('0x3a')](_0xbfd0f[_0xc1fa('0x1d')][_0x26070c['id']])){_0xbfd0f[_0xc1fa('0x1d')][_0x26070c['id']]=new Dynamics365Account(_0x26070c);}else{_0xbfd0f[_0xc1fa('0x38')](_0xbfd0f[_0xc1fa('0x1d')][_0x26070c['id']],_0x26070c);}}}return _0xbfd0f[_0xc1fa('0x1d')];};};Realtime[_0xc1fa('0x37')][_0xc1fa('0x4d')]=function(){var _0x24dc07=this;return function(_0x38469f){if(_0x38469f){freeIsNotKey(_0x38469f,_0x24dc07[_0xc1fa('0x1e')],'id');for(var _0x3b85a0=0x0,_0x5434ca={},_0xd2c0b4={};_0x3b85a0<_0x38469f['length'];_0x3b85a0+=0x1){_0x5434ca=_0x38469f[_0x3b85a0];if(_[_0xc1fa('0x3a')](_0x24dc07[_0xc1fa('0x1e')][_0x5434ca['id']])){_0x24dc07[_0xc1fa('0x1e')][_0x5434ca['id']]=new FreshsalesAccount(_0x5434ca);}else{_0x24dc07[_0xc1fa('0x38')](_0x24dc07['freshsalesAccounts'][_0x5434ca['id']],_0x5434ca);}}}return _0x24dc07['freshsalesAccounts'];};};Realtime[_0xc1fa('0x37')][_0xc1fa('0x4e')]=function(){var _0x5294be=this;return function(_0x2473fa){for(var _0x388c17=0x0;_0x388c17<_0x2473fa[_0xc1fa('0x3d')];_0x388c17+=0x1){_[_0xc1fa('0x4f')](_0x5294be[_0xc1fa('0x10')][_0x2473fa[_0x388c17][_0xc1fa('0x26')]],_0x2473fa[_0x388c17]);}return _0x5294be[_0xc1fa('0x10')];};};Realtime['prototype'][_0xc1fa('0x50')]=function(){var _0x1a4474=this;return function(_0x49a96a){clearVoiceQueues(_0x1a4474['voiceQueues']);if(_0x49a96a){_0x49a96a=_[_0xc1fa('0x51')](_0x49a96a,_0xc1fa('0x52'));for(var _0x2185bb in _0x49a96a){if(_0x49a96a['hasOwnProperty'](_0x2185bb)){var _0x2aed47={};for(var _0x436cd9=0x0;_0x436cd9<_0x49a96a[_0x2185bb][_0xc1fa('0x3d')];_0x436cd9+=0x1){var _0xb89402=_0x49a96a[_0x2185bb][_0x436cd9][_0xc1fa('0x53')];if(_0x1a4474[_0xc1fa('0x10')][_0xb89402]){if(_0x49a96a[_0x2185bb][_0x436cd9][_0xc1fa('0x54')]){_0x1a4474[_0xc1fa('0x10')][_0xb89402][_0xc1fa('0x2f')]+=0x1;}if(_0x49a96a[_0x2185bb][_0x436cd9]['queuecallerabandon']){_0x1a4474[_0xc1fa('0x10')][_0xb89402]['abandoned']+=0x1;}_0x1a4474[_0xc1fa('0x10')][_0xb89402]['sumHoldTime']+=moment(_0x49a96a[_0x2185bb][_0x436cd9][_0xc1fa('0x55')])[_0xc1fa('0x56')](moment(_0x49a96a[_0x2185bb][_0x436cd9]['queuecallerjoinAt']),_0xc1fa('0x57'))||0x0;if(_0x436cd9===_0x49a96a[_0x2185bb][_0xc1fa('0x3d')]-0x1){_0x1a4474['voiceQueues'][_0xb89402][_0xc1fa('0x29')]+=moment(_0x49a96a[_0x2185bb][_0x436cd9][_0xc1fa('0x58')]||_0x49a96a[_0x2185bb][_0x436cd9][_0xc1fa('0x59')]||_0x49a96a[_0x2185bb][_0x436cd9][_0xc1fa('0x5a')])[_0xc1fa('0x56')](moment(_0x49a96a[_0x2185bb][_0x436cd9]['queuecallerjoinAt']),_0xc1fa('0x57'))||0x0;_0x1a4474['voiceQueues'][_0xb89402][_0xc1fa('0x2e')]+=0x1;if(_0x49a96a[_0x2185bb][_0x436cd9]['queuecallercomplete']){_0x1a4474['voiceQueues'][_0xb89402][_0xc1fa('0x27')]+=0x1;_0x1a4474[_0xc1fa('0x10')][_0xb89402]['sumBillable']+=moment(_0x49a96a[_0x2185bb][_0x436cd9][_0xc1fa('0x58')])[_0xc1fa('0x56')](moment(_0x49a96a[_0x2185bb][_0x436cd9][_0xc1fa('0x55')]),_0xc1fa('0x57'))||0x0;}}else{_0x1a4474[_0xc1fa('0x10')][_0xb89402]['sumDuration']+=_0x1a4474[_0xc1fa('0x10')][_0xb89402][_0xc1fa('0x28')]||0x0;}}}}}}return _0x1a4474[_0xc1fa('0x10')];};};Realtime[_0xc1fa('0x37')]['initVoiceCallReports']=function(){var _0xe74f08=this;return function(_0x397063){clearVoiceCallReports(_0xe74f08[_0xc1fa('0x5b')]);if(_0x397063){for(var _0x8c6b6a=0x0;_0x8c6b6a<_0x397063[_0xc1fa('0x3d')];_0x8c6b6a+=0x1){_0xe74f08['outbound'][_0xc1fa('0x2e')]+=0x1;_0xe74f08[_0xc1fa('0x5b')]['sumDuration']+=_0x397063[_0x8c6b6a]['duration'];if(_0x397063[_0x8c6b6a][_0xc1fa('0x5c')]===_0xc1fa('0x5d')){_0xe74f08['outbound']['answered']+=0x1;_0xe74f08[_0xc1fa('0x5b')][_0xc1fa('0x28')]+=_0x397063[_0x8c6b6a][_0xc1fa('0x5e')]-_0x397063[_0x8c6b6a][_0xc1fa('0x5f')]||0x0;_0xe74f08[_0xc1fa('0x5b')][_0xc1fa('0x2a')]+=_0x397063[_0x8c6b6a][_0xc1fa('0x5f')];}}}return _0xe74f08['outbound'];};};Realtime[_0xc1fa('0x37')][_0xc1fa('0x60')]=function(){var _0x496285=this;return function(_0x231334){if(_0x231334){freeIsNotKey(_0x231334,_0x496285[_0xc1fa('0x61')],_0xc1fa('0x26'));for(var _0x2b487d=0x0,_0x4ae207={};_0x2b487d<_0x231334['length'];_0x2b487d+=0x1){_0x4ae207=_0x231334[_0x2b487d];if(_['isUndefined'](_0x496285[_0xc1fa('0x61')][_0x4ae207[_0xc1fa('0x26')]])){_0x496285[_0xc1fa('0x61')][_0x4ae207[_0xc1fa('0x26')]]=new Campaign(_0x4ae207);}else{_0x496285['mergeFromDatabase'](_0x496285['campaigns'][_0x4ae207[_0xc1fa('0x26')]],_0x4ae207);}}}return _0x496285[_0xc1fa('0x61')];};};Realtime[_0xc1fa('0x37')]['initVoiceExtensions']=function(){var _0x2a59be=this;return function(_0x3f3ce9){if(_0x3f3ce9){freeIsNotKey(_0x3f3ce9,_0x2a59be[_0xc1fa('0x13')],'id');for(var _0x283ee7=0x0,_0x44e67d={};_0x283ee7<_0x3f3ce9[_0xc1fa('0x3d')];_0x283ee7+=0x1){_0x44e67d=_0x3f3ce9[_0x283ee7];if(_['isUndefined'](_0x2a59be['voiceExtensions'][_0x44e67d['id']])){_0x2a59be['voiceExtensions'][_0x44e67d['id']]=new VoiceExtension(_0x44e67d);}else{_0x2a59be[_0xc1fa('0x38')](_0x2a59be[_0xc1fa('0x13')][_0x44e67d['id']],_0x44e67d);}}}return _0x2a59be[_0xc1fa('0x13')];};};Realtime[_0xc1fa('0x37')][_0xc1fa('0x62')]=function(){var _0x378b00=this;return function(_0x4ee388){clearCampaigns(_0x378b00[_0xc1fa('0x61')]);for(var _0xa2933f=0x0;_0xa2933f<_0x4ee388[_0xc1fa('0x3d')];_0xa2933f+=0x1){_[_0xc1fa('0x4f')](_0x378b00['campaigns'][_0x4ee388[_0xa2933f][_0xc1fa('0x26')]],_0x4ee388[_0xa2933f]);}return _0x378b00[_0xc1fa('0x61')];};};Realtime['prototype']['initFaxAccounts']=function(){var _0x264c1b=this;return function(_0x13f2b6){if(_0x13f2b6){freeIsNotKey(_0x13f2b6,_0x264c1b[_0xc1fa('0x1f')],'id');for(var _0x7673b1=0x0,_0x306b23={},_0x106bfd={};_0x7673b1<_0x13f2b6[_0xc1fa('0x3d')];_0x7673b1+=0x1){_0x306b23=_0x13f2b6[_0x7673b1];if(_[_0xc1fa('0x3a')](_0x264c1b[_0xc1fa('0x1f')][_0x306b23['id']])){_0x264c1b[_0xc1fa('0x1f')][_0x306b23['id']]=new FaxAccount(_0x306b23);}else{_0x264c1b['mergeFromDatabase'](_0x264c1b[_0xc1fa('0x1f')][_0x306b23['id']],_0x306b23);}}}return _0x264c1b[_0xc1fa('0x1f')];};};module[_0xc1fa('0x63')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 5e81136..5d1a66c 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 _0xd459=['../../../config/logger','../ami','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','bind','voiceCallReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','attendedTransfer','find','accountcode','name','isNil','interface','format','voiceQueueReport','length','findAgent','connectedlinenum','lastAssignedTo','SIP/%s','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','destination','exten','type','dialer','lastapplication','queue','lastdata','from-voip-provider','callerid','context','from-sip','xcally-motion-preview','calleridpreview','calleridnum','destinationchannel','channel','ANSWERED','\x22%s\x22\x20<%s>','create','monitor','monitors','monitorFilename','createdAt','calleridname','connectedlinename','originatecalleridnum','xcally-motion-dialer','isArray','forEach','substring','indexOf','mobile','phone','lastIndexOf','membername','blindTransfer','exports','bluebird','moment','../../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd459,0x1dd));var _0x9d45=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0xd459[_0x5e36d1];return _0x950b9e;};'use strict';var BPromise=require(_0x9d45('0x0'));var _=require('lodash');var moment=require(_0x9d45('0x1'));var util=require('util');var config=require(_0x9d45('0x2'));var logger=require(_0x9d45('0x3'))('ami');var ami=require(_0x9d45('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x9d45('0x5'));var RpcVoiceDialReport=require(_0x9d45('0x6'));var RpcMemberReport=require(_0x9d45('0x7'));var RpcVoiceQueueReport=require(_0x9d45('0x8'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0x9d45('0x9'));var VoiceQueueReport=require(_0x9d45('0xa'));var VoiceCallReport=require(_0x9d45('0xb'));var VoiceAgentReport=require(_0x9d45('0xc'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0x9d45('0xd'));function Report(_0x41579f){this[_0x9d45('0xe')]=_0x41579f;this[_0x9d45('0xf')]=_0x41579f['agents'];this[_0x9d45('0x10')]=_0x41579f['telephones'];}Report[_0x9d45('0x11')][_0x9d45('0x12')]=function(_0x5085a5){var _0xb9bc99=new VoiceQueueReport(this['realtime']);var _0x3d60fa=new VoiceAgentReport(this[_0x9d45('0xe')]);var _0x4b61d9=new VoiceDialReport(this['realtime']);var _0x2dc1c6=new VoiceCallReport(this[_0x9d45('0xe')]);var _0x17a40c=new UserReport(this[_0x9d45('0xe')]);if(config[_0x9d45('0x13')]&&config[_0x9d45('0x13')][_0x9d45('0x14')]){ami['on']('custom:voiceQueueReport',this['voiceQueueReport'][_0x9d45('0x15')](this));ami['on']('custom:voiceCallReport',this[_0x9d45('0x16')][_0x9d45('0x15')](this));ami['on']('custom:voiceAgentReport',this[_0x9d45('0x17')][_0x9d45('0x15')](this));ami['on'](_0x9d45('0x18'),this[_0x9d45('0x19')]['bind'](this));ami['on'](_0x9d45('0x1a'),this['blindTransfer']['bind'](this));ami['on']('attendedtransfer',this[_0x9d45('0x1b')][_0x9d45('0x15')](this));}};Report[_0x9d45('0x11')]['findAgent']=function(_0x9e8f57){var _0x503df6=undefined;_0x503df6=_[_0x9d45('0x1c')](this[_0x9d45('0xf')],function(_0x19f627){return _0x19f627[_0x9d45('0x1d')]==_0x9e8f57||_0x19f627[_0x9d45('0x1e')]==_0x9e8f57;});if(_[_0x9d45('0x1f')](_0x503df6)){var _0x3c78e8=_[_0x9d45('0x1c')](this[_0x9d45('0x10')],function(_0x974f24){return _0x974f24['accountcode']==_0x9e8f57||_0x974f24[_0x9d45('0x1e')]==_0x9e8f57;});if(_0x3c78e8){_0x503df6=_[_0x9d45('0x1c')](this[_0x9d45('0xf')],function(_0x3a9b81){return _0x3a9b81[_0x9d45('0x20')]==util[_0x9d45('0x21')]('SIP/%s',_0x3c78e8['name']);});}}return _0x503df6;};Report[_0x9d45('0x11')][_0x9d45('0x22')]=function(_0x44d33e){for(var _0x11455f=0x0;_0x11455f<_0x44d33e[_0x9d45('0x23')];_0x11455f+=0x1){var _0x524321=this[_0x9d45('0x24')](_0x44d33e[_0x11455f][_0x9d45('0x25')]);if(_0x524321){_0x44d33e[_0x11455f]['accountcode']=_0x524321['accountcode'];_0x44d33e[_0x11455f]['assigned']=!![];_0x44d33e[_0x11455f][_0x9d45('0x26')]=_0x524321['name'];_0x44d33e[_0x11455f][_0x9d45('0x20')]=_['isNil'](_0x524321[_0x9d45('0x20')])?util[_0x9d45('0x21')](_0x9d45('0x27'),_0x524321[_0x9d45('0x1e')]):_0x524321[_0x9d45('0x20')];if(_0x44d33e[_0x11455f]['queuecallercomplete']){_0x44d33e[_0x11455f][_0x9d45('0x28')]=moment()[_0x9d45('0x21')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x44d33e[_0x11455f][_0x9d45('0x29')]){_0x44d33e[_0x11455f][_0x9d45('0x2a')]=moment()[_0x9d45('0x21')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0x9d45('0x22')](_0x44d33e[_0x11455f]);}RpcVoiceQueueReport['create'](_0x44d33e[_0x11455f]);}};function extractCalleridNumber(_0x55f62e){var _0x391910=_0x55f62e['match'](/<(.*?)>/);return _0x391910?_0x391910[0x1]:_0x55f62e;}Report['prototype'][_0x9d45('0x16')]=function(_0x25c9c5){_0x25c9c5[_0x9d45('0x2b')]=_0x25c9c5[_0x9d45('0x2b')]||_0x25c9c5[_0x9d45('0x2c')];if(_0x25c9c5[_0x9d45('0x2d')]==_0x9d45('0x2e')){_0x25c9c5[_0x9d45('0x2f')]=_0x9d45('0x30');_0x25c9c5[_0x9d45('0x31')]=_0x25c9c5[_0x9d45('0x30')];if(_0x25c9c5['context']==_0x9d45('0x32')){_0x25c9c5['accountcode']='';_0x25c9c5['destination']=extractCalleridNumber(_0x25c9c5[_0x9d45('0x33')]);}else if(_0x25c9c5[_0x9d45('0x34')]==_0x9d45('0x35')){if(_0x25c9c5[_0x9d45('0x2b')]==_0x9d45('0x36')){_0x25c9c5[_0x9d45('0x2b')]=extractCalleridNumber(_0x25c9c5[_0x9d45('0x37')]);_0x25c9c5[_0x9d45('0x38')]=_0x25c9c5['originatecalleridnum'];_0x25c9c5[_0x9d45('0x39')]=[_0x25c9c5[_0x9d45('0x3a')],_0x25c9c5[_0x9d45('0x3a')]=_0x25c9c5[_0x9d45('0x39')]][0x0];_0x25c9c5[_0x9d45('0x33')]=_0x25c9c5[_0x9d45('0x37')];}else{_0x25c9c5[_0x9d45('0x2b')]=_0x25c9c5[_0x9d45('0x38')];_0x25c9c5[_0x9d45('0x38')]=_0x25c9c5['originatecalleridnum'];if(_0x25c9c5['disposition']==_0x9d45('0x3b')){_0x25c9c5[_0x9d45('0x1d')]=_0x25c9c5[_0x9d45('0x25')];}else{_0x25c9c5[_0x9d45('0x1d')]='';}}}}else{_0x25c9c5[_0x9d45('0x33')]=util['format'](_0x9d45('0x3c'),_0x25c9c5['calleridname'],_0x25c9c5[_0x9d45('0x38')]);}RpcVoiceCallReport[_0x9d45('0x3d')](_0x25c9c5);if(_0x25c9c5[_0x9d45('0x3e')]){for(var _0x2f251e=0x0;_0x2f251e<_0x25c9c5[_0x9d45('0x3f')][_0x9d45('0x23')];_0x2f251e+=0x1){_0x25c9c5[_0x9d45('0x40')]=_0x25c9c5['monitors'][_0x2f251e]['filename'];_0x25c9c5[_0x9d45('0x41')]=_0x25c9c5[_0x9d45('0x3f')][_0x2f251e][_0x9d45('0x41')];if(_0x25c9c5[_0x9d45('0x2c')]==_0x9d45('0x36')){_0x25c9c5[_0x9d45('0x38')]=_0x25c9c5[_0x9d45('0x25')];_0x25c9c5[_0x9d45('0x42')]=_0x25c9c5[_0x9d45('0x43')];_0x25c9c5[_0x9d45('0x25')]=_0x25c9c5[_0x9d45('0x1d')];_0x25c9c5[_0x9d45('0x43')]=_0x25c9c5['membername'];_0x25c9c5['exten']=_0x25c9c5[_0x9d45('0x44')];}else if(_0x25c9c5[_0x9d45('0x2c')]==_0x9d45('0x45')){_0x25c9c5[_0x9d45('0x38')]=_0x25c9c5[_0x9d45('0x2b')];_0x25c9c5[_0x9d45('0x2c')]=_0x25c9c5[_0x9d45('0x44')];}RpcVoiceRecording[_0x9d45('0x3d')](_0x25c9c5);}}};Report[_0x9d45('0x11')][_0x9d45('0x17')]=function(_0x168425){if(_[_0x9d45('0x46')](_0x168425)){_0x168425[_0x9d45('0x47')](function(_0xe3f4bb){RpcVoiceAgentReport[_0x9d45('0x3d')](_0xe3f4bb);});}else{RpcVoiceAgentReport[_0x9d45('0x3d')](_0x168425);}};Report[_0x9d45('0x11')][_0x9d45('0x19')]=function(_0x1568ab){RpcVoiceDialReport[_0x9d45('0x3d')](_0x1568ab);var _0x200b0f=undefined;var _0x1e6ff9=_0x1568ab[_0x9d45('0x3a')];if(_['startsWith'](_0x1e6ff9,'Local')){var _0x4fe585=_0x1e6ff9[_0x9d45('0x48')](_0x1e6ff9[_0x9d45('0x49')]('/')+0x1,_0x1e6ff9['indexOf']('@'));_0x200b0f=_[_0x9d45('0x1c')](this[_0x9d45('0xf')],function(_0x588a1a){return _0x588a1a[_0x9d45('0x4a')]==_0x4fe585||_0x588a1a[_0x9d45('0x4b')]==_0x4fe585||_0x588a1a[_0x9d45('0x1d')]==_0x4fe585;});}else{var _0x4fe585=_0x1e6ff9['substring'](_0x1e6ff9[_0x9d45('0x49')]('/')+0x1,_0x1e6ff9[_0x9d45('0x4c')]('-'));_0x200b0f=this[_0x9d45('0x24')](_0x4fe585);}if(_0x200b0f){_0x1568ab['interface']=_[_0x9d45('0x1f')](_0x200b0f[_0x9d45('0x20')])?util[_0x9d45('0x21')]('SIP/%s',_0x200b0f['name']):_0x200b0f[_0x9d45('0x20')];_0x1568ab[_0x9d45('0x4d')]=_0x200b0f[_0x9d45('0x1e')];_0x1568ab['accountcode']=_0x200b0f[_0x9d45('0x1d')];RpcMemberReport[_0x9d45('0x19')](_0x1568ab);}};Report[_0x9d45('0x11')][_0x9d45('0x4e')]=function(_0x2f95f2){RpcVoiceTransferReport['blindTransfer'](_0x2f95f2);};Report['prototype'][_0x9d45('0x1b')]=function(_0x433322){RpcVoiceTransferReport['attendedTransfer'](_0x433322);};module[_0x9d45('0x4f')]=Report; \ No newline at end of file +var _0xab0a=['exten','type','dialer','lastapplication','queue','context','from-voip-provider','calleridpreview','calleridnum','destinationchannel','channel','callerid','originatecalleridnum','ANSWERED','\x22%s\x22\x20<%s>','calleridname','monitors','monitorFilename','filename','createdAt','xcally-motion-preview','connectedlinename','membername','xcally-motion-dialer','isArray','forEach','startsWith','Local','substring','indexOf','mobile','phone','lastIndexOf','exports','bluebird','lodash','util','../../../config/environment','ami','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedTransfer','findAgent','find','accountcode','name','isNil','interface','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','format','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','create','destination'];(function(_0x355adc,_0xac51ab){var _0x4df04f=function(_0x4a787d){while(--_0x4a787d){_0x355adc['push'](_0x355adc['shift']());}};_0x4df04f(++_0xac51ab);}(_0xab0a,0xc8));var _0xaab0=function(_0x4c7534,_0x5bcd53){_0x4c7534=_0x4c7534-0x0;var _0x57ceb9=_0xab0a[_0x4c7534];return _0x57ceb9;};'use strict';var BPromise=require(_0xaab0('0x0'));var _=require(_0xaab0('0x1'));var moment=require('moment');var util=require(_0xaab0('0x2'));var config=require(_0xaab0('0x3'));var logger=require('../../../config/logger')(_0xaab0('0x4'));var ami=require(_0xaab0('0x5'));var RpcVoiceAgentReport=require(_0xaab0('0x6'));var RpcVoiceCallReport=require(_0xaab0('0x7'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0xaab0('0x8'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0xaab0('0x9'));var VoiceQueueReport=require(_0xaab0('0xa'));var VoiceCallReport=require(_0xaab0('0xb'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0xaab0('0xc'));var UserReport=require(_0xaab0('0xd'));function Report(_0x1e46dc){this[_0xaab0('0xe')]=_0x1e46dc;this[_0xaab0('0xf')]=_0x1e46dc[_0xaab0('0xf')];this['telephones']=_0x1e46dc[_0xaab0('0x10')];}Report[_0xaab0('0x11')][_0xaab0('0x12')]=function(_0x474b0b){var _0xa52c8f=new VoiceQueueReport(this[_0xaab0('0xe')]);var _0x37399a=new VoiceAgentReport(this[_0xaab0('0xe')]);var _0x1836f2=new VoiceDialReport(this[_0xaab0('0xe')]);var _0x4ff3a4=new VoiceCallReport(this[_0xaab0('0xe')]);var _0x2a19ae=new UserReport(this['realtime']);if(config[_0xaab0('0x13')]&&config[_0xaab0('0x13')]['disabled']){ami['on']('custom:voiceQueueReport',this[_0xaab0('0x14')][_0xaab0('0x15')](this));ami['on'](_0xaab0('0x16'),this[_0xaab0('0x17')]['bind'](this));ami['on'](_0xaab0('0x18'),this[_0xaab0('0x19')][_0xaab0('0x15')](this));ami['on'](_0xaab0('0x1a'),this[_0xaab0('0x1b')][_0xaab0('0x15')](this));ami['on'](_0xaab0('0x1c'),this[_0xaab0('0x1d')][_0xaab0('0x15')](this));ami['on']('attendedtransfer',this[_0xaab0('0x1e')]['bind'](this));}};Report[_0xaab0('0x11')][_0xaab0('0x1f')]=function(_0x522263){var _0x542a77=undefined;_0x542a77=_[_0xaab0('0x20')](this[_0xaab0('0xf')],function(_0x33c37a){return _0x33c37a[_0xaab0('0x21')]==_0x522263||_0x33c37a[_0xaab0('0x22')]==_0x522263;});if(_[_0xaab0('0x23')](_0x542a77)){var _0x1b4ee6=_[_0xaab0('0x20')](this['telephones'],function(_0x2155ad){return _0x2155ad[_0xaab0('0x21')]==_0x522263||_0x2155ad[_0xaab0('0x22')]==_0x522263;});if(_0x1b4ee6){_0x542a77=_['find'](this[_0xaab0('0xf')],function(_0x4723ac){return _0x4723ac[_0xaab0('0x24')]==util['format'](_0xaab0('0x25'),_0x1b4ee6[_0xaab0('0x22')]);});}}return _0x542a77;};Report[_0xaab0('0x11')][_0xaab0('0x14')]=function(_0x417bf9){for(var _0x443843=0x0;_0x443843<_0x417bf9[_0xaab0('0x26')];_0x443843+=0x1){var _0x181e85=this[_0xaab0('0x1f')](_0x417bf9[_0x443843][_0xaab0('0x27')]);if(_0x181e85){_0x417bf9[_0x443843][_0xaab0('0x21')]=_0x181e85[_0xaab0('0x21')];_0x417bf9[_0x443843][_0xaab0('0x28')]=!![];_0x417bf9[_0x443843][_0xaab0('0x29')]=_0x181e85[_0xaab0('0x22')];_0x417bf9[_0x443843][_0xaab0('0x24')]=_['isNil'](_0x181e85[_0xaab0('0x24')])?util[_0xaab0('0x2a')](_0xaab0('0x25'),_0x181e85[_0xaab0('0x22')]):_0x181e85['interface'];if(_0x417bf9[_0x443843][_0xaab0('0x2b')]){_0x417bf9[_0x443843][_0xaab0('0x2c')]=moment()[_0xaab0('0x2a')](_0xaab0('0x2d'));}if(_0x417bf9[_0x443843][_0xaab0('0x2e')]){_0x417bf9[_0x443843]['queuecallerexitAt']=moment()['format'](_0xaab0('0x2d'));}RpcMemberReport['voiceQueueReport'](_0x417bf9[_0x443843]);}RpcVoiceQueueReport[_0xaab0('0x2f')](_0x417bf9[_0x443843]);}};function extractCalleridNumber(_0x2598a1){var _0x22a294=_0x2598a1['match'](/<(.*?)>/);return _0x22a294?_0x22a294[0x1]:_0x2598a1;}Report[_0xaab0('0x11')][_0xaab0('0x17')]=function(_0x2ef5be){_0x2ef5be[_0xaab0('0x30')]=_0x2ef5be[_0xaab0('0x30')]||_0x2ef5be[_0xaab0('0x31')];if(_0x2ef5be[_0xaab0('0x32')]==_0xaab0('0x33')){_0x2ef5be[_0xaab0('0x34')]=_0xaab0('0x35');_0x2ef5be['lastdata']=_0x2ef5be['queue'];if(_0x2ef5be[_0xaab0('0x36')]==_0xaab0('0x37')){_0x2ef5be[_0xaab0('0x21')]='';_0x2ef5be[_0xaab0('0x30')]=extractCalleridNumber(_0x2ef5be['callerid']);}else if(_0x2ef5be['context']=='from-sip'){if(_0x2ef5be['destination']=='xcally-motion-preview'){_0x2ef5be[_0xaab0('0x30')]=extractCalleridNumber(_0x2ef5be[_0xaab0('0x38')]);_0x2ef5be[_0xaab0('0x39')]=_0x2ef5be['originatecalleridnum'];_0x2ef5be[_0xaab0('0x3a')]=[_0x2ef5be[_0xaab0('0x3b')],_0x2ef5be[_0xaab0('0x3b')]=_0x2ef5be[_0xaab0('0x3a')]][0x0];_0x2ef5be[_0xaab0('0x3c')]=_0x2ef5be[_0xaab0('0x38')];}else{_0x2ef5be[_0xaab0('0x30')]=_0x2ef5be[_0xaab0('0x39')];_0x2ef5be[_0xaab0('0x39')]=_0x2ef5be[_0xaab0('0x3d')];if(_0x2ef5be['disposition']==_0xaab0('0x3e')){_0x2ef5be[_0xaab0('0x21')]=_0x2ef5be[_0xaab0('0x27')];}else{_0x2ef5be[_0xaab0('0x21')]='';}}}}else{_0x2ef5be[_0xaab0('0x3c')]=util[_0xaab0('0x2a')](_0xaab0('0x3f'),_0x2ef5be[_0xaab0('0x40')],_0x2ef5be[_0xaab0('0x39')]);}RpcVoiceCallReport[_0xaab0('0x2f')](_0x2ef5be);if(_0x2ef5be['monitor']){for(var _0x15ca0b=0x0;_0x15ca0b<_0x2ef5be[_0xaab0('0x41')][_0xaab0('0x26')];_0x15ca0b+=0x1){_0x2ef5be[_0xaab0('0x42')]=_0x2ef5be[_0xaab0('0x41')][_0x15ca0b][_0xaab0('0x43')];_0x2ef5be['createdAt']=_0x2ef5be[_0xaab0('0x41')][_0x15ca0b][_0xaab0('0x44')];if(_0x2ef5be[_0xaab0('0x31')]==_0xaab0('0x45')){_0x2ef5be[_0xaab0('0x39')]=_0x2ef5be[_0xaab0('0x27')];_0x2ef5be[_0xaab0('0x40')]=_0x2ef5be[_0xaab0('0x46')];_0x2ef5be[_0xaab0('0x27')]=_0x2ef5be[_0xaab0('0x21')];_0x2ef5be[_0xaab0('0x46')]=_0x2ef5be[_0xaab0('0x47')];_0x2ef5be[_0xaab0('0x31')]=_0x2ef5be['originatecalleridnum'];}else if(_0x2ef5be[_0xaab0('0x31')]==_0xaab0('0x48')){_0x2ef5be['calleridnum']=_0x2ef5be[_0xaab0('0x30')];_0x2ef5be[_0xaab0('0x31')]=_0x2ef5be[_0xaab0('0x3d')];}RpcVoiceRecording['create'](_0x2ef5be);}}};Report[_0xaab0('0x11')][_0xaab0('0x19')]=function(_0x62495e){if(_[_0xaab0('0x49')](_0x62495e)){_0x62495e[_0xaab0('0x4a')](function(_0x48324f){RpcVoiceAgentReport['create'](_0x48324f);});}else{RpcVoiceAgentReport[_0xaab0('0x2f')](_0x62495e);}};Report[_0xaab0('0x11')]['voiceDialReport']=function(_0xdaf4b){RpcVoiceDialReport[_0xaab0('0x2f')](_0xdaf4b);var _0xb992ea=undefined;var _0x1fd985=_0xdaf4b[_0xaab0('0x3b')];if(_[_0xaab0('0x4b')](_0x1fd985,_0xaab0('0x4c'))){var _0x30514a=_0x1fd985[_0xaab0('0x4d')](_0x1fd985['indexOf']('/')+0x1,_0x1fd985[_0xaab0('0x4e')]('@'));_0xb992ea=_[_0xaab0('0x20')](this['agents'],function(_0x78b05b){return _0x78b05b[_0xaab0('0x4f')]==_0x30514a||_0x78b05b[_0xaab0('0x50')]==_0x30514a||_0x78b05b['accountcode']==_0x30514a;});}else{var _0x30514a=_0x1fd985[_0xaab0('0x4d')](_0x1fd985[_0xaab0('0x4e')]('/')+0x1,_0x1fd985[_0xaab0('0x51')]('-'));_0xb992ea=this['findAgent'](_0x30514a);}if(_0xb992ea){_0xdaf4b['interface']=_[_0xaab0('0x23')](_0xb992ea[_0xaab0('0x24')])?util['format'](_0xaab0('0x25'),_0xb992ea['name']):_0xb992ea[_0xaab0('0x24')];_0xdaf4b[_0xaab0('0x47')]=_0xb992ea[_0xaab0('0x22')];_0xdaf4b['accountcode']=_0xb992ea[_0xaab0('0x21')];RpcMemberReport[_0xaab0('0x1b')](_0xdaf4b);}};Report[_0xaab0('0x11')][_0xaab0('0x1d')]=function(_0x46d623){RpcVoiceTransferReport['blindTransfer'](_0x46d623);};Report[_0xaab0('0x11')][_0xaab0('0x1e')]=function(_0x2fc48a){RpcVoiceTransferReport[_0xaab0('0x1e')](_0x2fc48a);};module[_0xaab0('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 a64df90..7560399 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 _0xe90a=['registered','status','address','trunk:%s','trunk:save','[syncPeerStatus][UserReport]','exports','lodash','moment','bluebird','util','../../../config/environment','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','loopSyncRealTimeShow','resolve','actionSipShowRegistry','then','actionDeviceStateList','actionSipPeerStatus','catch','[loopSyncRealTimeShow]','inspect','isNotNull','emit','prototype','find','username','stateRegistry','state','merge','event','name','error','[syncRegistry][UserReport]','device','local','toLowerCase','inuse','toNumber','updateStatusRealtime','format','telephone:%s','telephone:save','stateTime','startsWith','Queue','Local','substring','indexOf','mobile','accountcode','[syncDeviceState][UserReport]','peer'];(function(_0x2137d5,_0x54e512){var _0x26d968=function(_0x29dec8){while(--_0x29dec8){_0x2137d5['push'](_0x2137d5['shift']());}};_0x26d968(++_0x54e512);}(_0xe90a,0x117));var _0xae90=function(_0x4d9bd6,_0x41a300){_0x4d9bd6=_0x4d9bd6-0x0;var _0x99aee6=_0xe90a[_0x4d9bd6];return _0x99aee6;};'use strict';var _=require(_0xae90('0x0'));var moment=require(_0xae90('0x1'));var BPromise=require(_0xae90('0x2'));var util=require(_0xae90('0x3'));var Redis=require('ioredis');var config=require(_0xae90('0x4'));var logger=require('../../../config/logger')('ami');var ami=require(_0xae90('0x5'));config[_0xae90('0x6')]=_[_0xae90('0x7')](config[_0xae90('0x6')],{'host':_0xae90('0x8'),'port':0x18eb});var io=require(_0xae90('0x9'))(new Redis(config[_0xae90('0x6')]));function UserReport(_0x3ed596){this['trunks']=_0x3ed596[_0xae90('0xa')];this[_0xae90('0xb')]=_0x3ed596['agents'];this['telephones']=_0x3ed596[_0xae90('0xc')];ami['on'](_0xae90('0xd'),this[_0xae90('0xe')][_0xae90('0xf')](this));ami['on'](_0xae90('0x10'),this[_0xae90('0xe')][_0xae90('0xf')](this));ami['on'](_0xae90('0x11'),this[_0xae90('0x12')][_0xae90('0xf')](this));ami['on'](_0xae90('0x13'),this[_0xae90('0x14')][_0xae90('0xf')](this));this[_0xae90('0x15')]();return BPromise[_0xae90('0x16')]()['then'](ami[_0xae90('0x17')]())[_0xae90('0x18')](ami[_0xae90('0x19')]())[_0xae90('0x18')](ami[_0xae90('0x1a')]())[_0xae90('0x1b')](loggerCatch(_0xae90('0x1c')));}function loggerCatch(_0x2f8f02){return function(_0x3f9fbc){logger['error'](_0x2f8f02,util[_0xae90('0x1d')](_0x3f9fbc,{'showHidden':![],'depth':null}));};}UserReport['prototype']['loopSyncRealTimeShow']=function(){setInterval(function(){BPromise[_0xae90('0x16')]()[_0xae90('0x18')](ami[_0xae90('0x17')]())[_0xae90('0x18')](ami[_0xae90('0x19')]())[_0xae90('0x18')](ami[_0xae90('0x1a')]())['catch'](loggerCatch(_0xae90('0x1c')));},0x32c8);};UserReport['prototype'][_0xae90('0x1e')]=function(_0x2da085){return _0x2da085!==null&&!_['isUndefined'](_0x2da085);};UserReport['prototype'][_0xae90('0x1f')]=function(_0x28ecdf,_0x4e8be7,_0x1fd2a5){io['to'](_0x28ecdf)[_0xae90('0x1f')](_0x4e8be7,_0x1fd2a5);};UserReport[_0xae90('0x20')][_0xae90('0xe')]=function(_0xd38fda){try{if(this['isNotNull'](_0xd38fda)){var _0x5efdc0=_[_0xae90('0x21')](this[_0xae90('0xa')],{'registry':_0xd38fda[_0xae90('0x22')]});if(_0x5efdc0){_0xd38fda[_0xae90('0x23')]=_0xd38fda[_0xae90('0x24')];_[_0xae90('0x25')](_0x5efdc0,_['omit'](_0xd38fda,[_0xae90('0x26'),'actionid',_0xae90('0x22'),_0xae90('0x24')]));this['emit'](util['format']('trunk:%s',_0x5efdc0[_0xae90('0x27')]),'trunk:save',_0x5efdc0);}}}catch(_0x21e01f){logger[_0xae90('0x28')](_0xae90('0x29'),util[_0xae90('0x1d')](_0x21e01f,{'showHidden':![],'depth':null}));}};UserReport[_0xae90('0x20')][_0xae90('0x12')]=function(_0x2c66fb){try{if(this['isNotNull'](_0x2c66fb)){if(this[_0xae90('0xb')][_0x2c66fb[_0xae90('0x2a')]]){if(!this[_0xae90('0xb')][_0x2c66fb[_0xae90('0x2a')]][_0xae90('0x2b')]||_0x2c66fb[_0xae90('0x24')][_0xae90('0x2c')]()==_0xae90('0x2d')){this[_0xae90('0xb')][_0x2c66fb[_0xae90('0x2a')]][_0xae90('0x2b')]=![];if(this['agents'][_0x2c66fb[_0xae90('0x2a')]][_0xae90('0x24')]!==_0x2c66fb[_0xae90('0x24')]['toLowerCase']()){this['agents'][_0x2c66fb[_0xae90('0x2a')]]['stateTime']=_[_0xae90('0x2e')](moment()['format']('x'));}this[_0xae90('0xb')][_0x2c66fb['device']][_0xae90('0x24')]=_0x2c66fb[_0xae90('0x24')]['toLowerCase']();this[_0xae90('0xb')][_0x2c66fb[_0xae90('0x2a')]][_0xae90('0x2f')](_0x2c66fb);}}else if(this['telephones'][_0x2c66fb[_0xae90('0x2a')]]){if(this['telephones'][_0x2c66fb[_0xae90('0x2a')]]['state']!==_0x2c66fb[_0xae90('0x24')]['toLowerCase']()){this[_0xae90('0xc')][_0x2c66fb[_0xae90('0x2a')]]['stateTime']=_[_0xae90('0x2e')](moment()[_0xae90('0x30')]('x'));}this[_0xae90('0xc')][_0x2c66fb['device']][_0xae90('0x24')]=_0x2c66fb[_0xae90('0x24')]['toLowerCase']();this['emit'](util['format'](_0xae90('0x31'),this[_0xae90('0xc')][_0x2c66fb[_0xae90('0x2a')]]['name']),_0xae90('0x32'),this[_0xae90('0xc')][_0x2c66fb[_0xae90('0x2a')]]);}else if(this[_0xae90('0xa')][_0x2c66fb['device']]){if(this[_0xae90('0xa')][_0x2c66fb[_0xae90('0x2a')]][_0xae90('0x24')]!==_0x2c66fb[_0xae90('0x24')]['toLowerCase']()){this[_0xae90('0xa')][_0x2c66fb['device']][_0xae90('0x33')]=_['toNumber'](moment()[_0xae90('0x30')]('x'));}this['trunks'][_0x2c66fb[_0xae90('0x2a')]][_0xae90('0x24')]=_0x2c66fb[_0xae90('0x24')][_0xae90('0x2c')]();this[_0xae90('0x1f')](util[_0xae90('0x30')]('trunk:%s',this[_0xae90('0xa')][_0x2c66fb[_0xae90('0x2a')]][_0xae90('0x27')]),'trunk:save',this['trunks'][_0x2c66fb[_0xae90('0x2a')]]);}else if(_[_0xae90('0x34')](_0x2c66fb['device'],_0xae90('0x35'))){}else if(_[_0xae90('0x34')](_0x2c66fb[_0xae90('0x2a')],_0xae90('0x36'))){var _0x13af88=_0x2c66fb['device'];var _0x43c0cb=_0x13af88[_0xae90('0x37')](_0x13af88[_0xae90('0x38')]('/')+0x1,_0x13af88[_0xae90('0x38')]('@'));var _0x3bc57e=_[_0xae90('0x21')](this['agents'],function(_0x258371){return _0x258371[_0xae90('0x39')]==_0x43c0cb||_0x258371['phone']==_0x43c0cb||_0x258371[_0xae90('0x3a')]==_0x43c0cb;});if(_0x3bc57e){if(_0x3bc57e[_0xae90('0x24')]!==_0x2c66fb[_0xae90('0x24')][_0xae90('0x2c')]()){_0x3bc57e['stateTime']=_[_0xae90('0x2e')](moment()[_0xae90('0x30')]('x'));}_0x3bc57e[_0xae90('0x24')]=_0x2c66fb[_0xae90('0x24')]['toLowerCase']();_0x3bc57e[_0xae90('0x2b')]=!![];_0x3bc57e[_0xae90('0x2f')](_0x2c66fb);}}else{}}}catch(_0x2013a3){logger['error'](_0xae90('0x3b'),util[_0xae90('0x1d')](_0x2013a3,{'showHidden':![],'depth':null}));}};UserReport[_0xae90('0x20')]['syncPeerStatus']=function(_0x54a097){try{if(this[_0xae90('0x1e')](_0x54a097)&&this[_0xae90('0x1e')](_0x54a097[_0xae90('0x13')])){if(this['agents'][_0x54a097[_0xae90('0x3c')]]){if(!this[_0xae90('0xb')][_0x54a097[_0xae90('0x3c')]][_0xae90('0x2b')]||_0x54a097[_0xae90('0x13')][_0xae90('0x2c')]()==_0xae90('0x3d')){this[_0xae90('0xb')][_0x54a097[_0xae90('0x3c')]][_0xae90('0x2b')]=![];this['agents'][_0x54a097[_0xae90('0x3c')]][_0xae90('0x3e')]=_0x54a097[_0xae90('0x13')][_0xae90('0x2c')]();this[_0xae90('0xb')][_0x54a097[_0xae90('0x3c')]][_0xae90('0x3f')]=_0x54a097['address'];this[_0xae90('0xb')][_0x54a097[_0xae90('0x3c')]][_0xae90('0x2f')](_0x54a097);}}else if(this[_0xae90('0xc')][_0x54a097[_0xae90('0x3c')]]){this[_0xae90('0xc')][_0x54a097['peer']]['status']=_0x54a097['peerstatus'][_0xae90('0x2c')]();this[_0xae90('0xc')][_0x54a097[_0xae90('0x3c')]]['address']=_0x54a097['address'];this['emit'](util[_0xae90('0x30')](_0xae90('0x31'),this['telephones'][_0x54a097[_0xae90('0x3c')]][_0xae90('0x27')]),'telephone:save',this['telephones'][_0x54a097[_0xae90('0x3c')]]);}else if(this[_0xae90('0xa')][_0x54a097[_0xae90('0x3c')]]){this[_0xae90('0xa')][_0x54a097[_0xae90('0x3c')]]['status']=_0x54a097[_0xae90('0x13')]['toLowerCase']();this[_0xae90('0xa')][_0x54a097[_0xae90('0x3c')]][_0xae90('0x3f')]=_0x54a097['address'];this['emit'](util[_0xae90('0x30')](_0xae90('0x40'),this[_0xae90('0xa')][_0x54a097[_0xae90('0x3c')]][_0xae90('0x27')]),_0xae90('0x41'),this[_0xae90('0xa')][_0x54a097[_0xae90('0x3c')]]);}else{}}}catch(_0x535771){logger[_0xae90('0x28')](_0xae90('0x42'),util[_0xae90('0x1d')](_0x535771,{'showHidden':![],'depth':null}));}};module[_0xae90('0x43')]=UserReport; \ No newline at end of file +var _0x5f47=['moment','bluebird','util','../../../config/environment','../../../config/logger','../ami','redis','defaults','socket.io-emitter','trunks','agents','telephones','registryentry','bind','registry','syncRegistry','devicestatechange','syncPeerStatus','loopSyncRealTimeShow','then','actionDeviceStateList','actionSipPeerStatus','[loopSyncRealTimeShow]','inspect','prototype','resolve','actionSipShowRegistry','catch','isNotNull','isUndefined','emit','find','stateRegistry','omit','event','actionid','username','trunk:%s','name','trunk:save','[syncRegistry][UserReport]','syncDeviceState','device','state','toLowerCase','local','stateTime','toNumber','format','updateStatusRealtime','telephone:save','startsWith','Local','substring','indexOf','phone','accountcode','error','[syncDeviceState][UserReport]','peerstatus','peer','registered','address','status','[syncPeerStatus][UserReport]','exports','lodash'];(function(_0x11a229,_0x13b89b){var _0x41c170=function(_0x2eef1c){while(--_0x2eef1c){_0x11a229['push'](_0x11a229['shift']());}};_0x41c170(++_0x13b89b);}(_0x5f47,0x1d4));var _0x75f4=function(_0x2839a5,_0x59699a){_0x2839a5=_0x2839a5-0x0;var _0x5cb6bb=_0x5f47[_0x2839a5];return _0x5cb6bb;};'use strict';var _=require(_0x75f4('0x0'));var moment=require(_0x75f4('0x1'));var BPromise=require(_0x75f4('0x2'));var util=require(_0x75f4('0x3'));var Redis=require('ioredis');var config=require(_0x75f4('0x4'));var logger=require(_0x75f4('0x5'))('ami');var ami=require(_0x75f4('0x6'));config[_0x75f4('0x7')]=_[_0x75f4('0x8')](config[_0x75f4('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x75f4('0x9'))(new Redis(config[_0x75f4('0x7')]));function UserReport(_0x452282){this[_0x75f4('0xa')]=_0x452282['trunks'];this[_0x75f4('0xb')]=_0x452282[_0x75f4('0xb')];this['telephones']=_0x452282[_0x75f4('0xc')];ami['on'](_0x75f4('0xd'),this['syncRegistry'][_0x75f4('0xe')](this));ami['on'](_0x75f4('0xf'),this[_0x75f4('0x10')]['bind'](this));ami['on'](_0x75f4('0x11'),this['syncDeviceState'][_0x75f4('0xe')](this));ami['on']('peerstatus',this[_0x75f4('0x12')][_0x75f4('0xe')](this));this[_0x75f4('0x13')]();return BPromise['resolve']()['then'](ami['actionSipShowRegistry']())[_0x75f4('0x14')](ami[_0x75f4('0x15')]())[_0x75f4('0x14')](ami[_0x75f4('0x16')]())['catch'](loggerCatch(_0x75f4('0x17')));}function loggerCatch(_0xa11eee){return function(_0x50e9b2){logger['error'](_0xa11eee,util[_0x75f4('0x18')](_0x50e9b2,{'showHidden':![],'depth':null}));};}UserReport[_0x75f4('0x19')]['loopSyncRealTimeShow']=function(){setInterval(function(){BPromise[_0x75f4('0x1a')]()[_0x75f4('0x14')](ami[_0x75f4('0x1b')]())[_0x75f4('0x14')](ami['actionDeviceStateList']())[_0x75f4('0x14')](ami['actionSipPeerStatus']())[_0x75f4('0x1c')](loggerCatch(_0x75f4('0x17')));},0x32c8);};UserReport[_0x75f4('0x19')][_0x75f4('0x1d')]=function(_0x23eed2){return _0x23eed2!==null&&!_[_0x75f4('0x1e')](_0x23eed2);};UserReport[_0x75f4('0x19')][_0x75f4('0x1f')]=function(_0x40b89e,_0x5a084b,_0x25d837){io['to'](_0x40b89e)['emit'](_0x5a084b,_0x25d837);};UserReport[_0x75f4('0x19')][_0x75f4('0x10')]=function(_0x28ac03){try{if(this[_0x75f4('0x1d')](_0x28ac03)){var _0x65066a=_[_0x75f4('0x20')](this[_0x75f4('0xa')],{'registry':_0x28ac03['username']});if(_0x65066a){_0x28ac03[_0x75f4('0x21')]=_0x28ac03['state'];_['merge'](_0x65066a,_[_0x75f4('0x22')](_0x28ac03,[_0x75f4('0x23'),_0x75f4('0x24'),_0x75f4('0x25'),'state']));this[_0x75f4('0x1f')](util['format'](_0x75f4('0x26'),_0x65066a[_0x75f4('0x27')]),_0x75f4('0x28'),_0x65066a);}}}catch(_0x25609f){logger['error'](_0x75f4('0x29'),util[_0x75f4('0x18')](_0x25609f,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x75f4('0x2a')]=function(_0x9448a9){try{if(this[_0x75f4('0x1d')](_0x9448a9)){if(this[_0x75f4('0xb')][_0x9448a9[_0x75f4('0x2b')]]){if(!this[_0x75f4('0xb')][_0x9448a9[_0x75f4('0x2b')]]['local']||_0x9448a9[_0x75f4('0x2c')][_0x75f4('0x2d')]()=='inuse'){this[_0x75f4('0xb')][_0x9448a9['device']][_0x75f4('0x2e')]=![];if(this['agents'][_0x9448a9['device']][_0x75f4('0x2c')]!==_0x9448a9[_0x75f4('0x2c')][_0x75f4('0x2d')]()){this[_0x75f4('0xb')][_0x9448a9[_0x75f4('0x2b')]][_0x75f4('0x2f')]=_[_0x75f4('0x30')](moment()[_0x75f4('0x31')]('x'));}this[_0x75f4('0xb')][_0x9448a9[_0x75f4('0x2b')]][_0x75f4('0x2c')]=_0x9448a9[_0x75f4('0x2c')][_0x75f4('0x2d')]();this[_0x75f4('0xb')][_0x9448a9[_0x75f4('0x2b')]][_0x75f4('0x32')](_0x9448a9);}}else if(this[_0x75f4('0xc')][_0x9448a9[_0x75f4('0x2b')]]){if(this[_0x75f4('0xc')][_0x9448a9[_0x75f4('0x2b')]][_0x75f4('0x2c')]!==_0x9448a9[_0x75f4('0x2c')][_0x75f4('0x2d')]()){this[_0x75f4('0xc')][_0x9448a9[_0x75f4('0x2b')]][_0x75f4('0x2f')]=_['toNumber'](moment()['format']('x'));}this[_0x75f4('0xc')][_0x9448a9[_0x75f4('0x2b')]]['state']=_0x9448a9[_0x75f4('0x2c')][_0x75f4('0x2d')]();this[_0x75f4('0x1f')](util[_0x75f4('0x31')]('telephone:%s',this[_0x75f4('0xc')][_0x9448a9[_0x75f4('0x2b')]]['name']),_0x75f4('0x33'),this[_0x75f4('0xc')][_0x9448a9[_0x75f4('0x2b')]]);}else if(this[_0x75f4('0xa')][_0x9448a9[_0x75f4('0x2b')]]){if(this[_0x75f4('0xa')][_0x9448a9[_0x75f4('0x2b')]][_0x75f4('0x2c')]!==_0x9448a9[_0x75f4('0x2c')][_0x75f4('0x2d')]()){this[_0x75f4('0xa')][_0x9448a9[_0x75f4('0x2b')]][_0x75f4('0x2f')]=_[_0x75f4('0x30')](moment()[_0x75f4('0x31')]('x'));}this[_0x75f4('0xa')][_0x9448a9[_0x75f4('0x2b')]][_0x75f4('0x2c')]=_0x9448a9[_0x75f4('0x2c')][_0x75f4('0x2d')]();this[_0x75f4('0x1f')](util[_0x75f4('0x31')](_0x75f4('0x26'),this[_0x75f4('0xa')][_0x9448a9['device']]['name']),_0x75f4('0x28'),this[_0x75f4('0xa')][_0x9448a9[_0x75f4('0x2b')]]);}else if(_[_0x75f4('0x34')](_0x9448a9[_0x75f4('0x2b')],'Queue')){}else if(_[_0x75f4('0x34')](_0x9448a9[_0x75f4('0x2b')],_0x75f4('0x35'))){var _0x1ae7d6=_0x9448a9['device'];var _0xfeb5aa=_0x1ae7d6[_0x75f4('0x36')](_0x1ae7d6[_0x75f4('0x37')]('/')+0x1,_0x1ae7d6[_0x75f4('0x37')]('@'));var _0x34aa84=_[_0x75f4('0x20')](this[_0x75f4('0xb')],function(_0x391cbf){return _0x391cbf['mobile']==_0xfeb5aa||_0x391cbf[_0x75f4('0x38')]==_0xfeb5aa||_0x391cbf[_0x75f4('0x39')]==_0xfeb5aa;});if(_0x34aa84){if(_0x34aa84['state']!==_0x9448a9['state'][_0x75f4('0x2d')]()){_0x34aa84[_0x75f4('0x2f')]=_[_0x75f4('0x30')](moment()['format']('x'));}_0x34aa84[_0x75f4('0x2c')]=_0x9448a9[_0x75f4('0x2c')]['toLowerCase']();_0x34aa84[_0x75f4('0x2e')]=!![];_0x34aa84[_0x75f4('0x32')](_0x9448a9);}}else{}}}catch(_0x16395a){logger[_0x75f4('0x3a')](_0x75f4('0x3b'),util[_0x75f4('0x18')](_0x16395a,{'showHidden':![],'depth':null}));}};UserReport[_0x75f4('0x19')]['syncPeerStatus']=function(_0x55966f){try{if(this['isNotNull'](_0x55966f)&&this['isNotNull'](_0x55966f[_0x75f4('0x3c')])){if(this[_0x75f4('0xb')][_0x55966f[_0x75f4('0x3d')]]){if(!this[_0x75f4('0xb')][_0x55966f['peer']][_0x75f4('0x2e')]||_0x55966f[_0x75f4('0x3c')][_0x75f4('0x2d')]()==_0x75f4('0x3e')){this['agents'][_0x55966f[_0x75f4('0x3d')]][_0x75f4('0x2e')]=![];this[_0x75f4('0xb')][_0x55966f['peer']]['status']=_0x55966f['peerstatus']['toLowerCase']();this[_0x75f4('0xb')][_0x55966f[_0x75f4('0x3d')]][_0x75f4('0x3f')]=_0x55966f[_0x75f4('0x3f')];this[_0x75f4('0xb')][_0x55966f[_0x75f4('0x3d')]][_0x75f4('0x32')](_0x55966f);}}else if(this[_0x75f4('0xc')][_0x55966f['peer']]){this[_0x75f4('0xc')][_0x55966f[_0x75f4('0x3d')]][_0x75f4('0x40')]=_0x55966f[_0x75f4('0x3c')][_0x75f4('0x2d')]();this[_0x75f4('0xc')][_0x55966f[_0x75f4('0x3d')]][_0x75f4('0x3f')]=_0x55966f[_0x75f4('0x3f')];this[_0x75f4('0x1f')](util[_0x75f4('0x31')]('telephone:%s',this[_0x75f4('0xc')][_0x55966f['peer']][_0x75f4('0x27')]),'telephone:save',this['telephones'][_0x55966f[_0x75f4('0x3d')]]);}else if(this[_0x75f4('0xa')][_0x55966f[_0x75f4('0x3d')]]){this['trunks'][_0x55966f[_0x75f4('0x3d')]]['status']=_0x55966f['peerstatus'][_0x75f4('0x2d')]();this[_0x75f4('0xa')][_0x55966f['peer']][_0x75f4('0x3f')]=_0x55966f['address'];this[_0x75f4('0x1f')](util[_0x75f4('0x31')](_0x75f4('0x26'),this[_0x75f4('0xa')][_0x55966f[_0x75f4('0x3d')]][_0x75f4('0x27')]),_0x75f4('0x28'),this['trunks'][_0x55966f[_0x75f4('0x3d')]]);}else{}}}catch(_0x37e3d8){logger[_0x75f4('0x3a')](_0x75f4('0x41'),util[_0x75f4('0x18')](_0x37e3d8,{'showHidden':![],'depth':null}));}};module[_0x75f4('0x42')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 0b0fc4c..4630cf8 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 _0x63ce=['membername','user:called','[syncAgentCalled][VoiceAgentReport]','hasOwnProperty','agentconnectAt','connect','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','interface','destconnectedlinenum','user:agentconnect','agentringnoanswerAt','reason','lastevent','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','custom:agentansweredelsewhere','error','[syncAgentConnect][VoiceAgentReport]','agentringnoanswer','rejected','custom:agentringnoanswer','[syncAgentRingNoAnswer][VoiceAgentReport]','syncQueueCallerAbandon','abandoned','custom:agentqueuecallerabandon','[syncQueueCallerAbandon][VoiceAgentReport]','inspect','syncAgentComplete','agentcompleteAt','complete','talktime','transfer','agent','agentacw','acwTimeout','user:agentcomplete','[syncAgentComplete][VoiceAgentReport]','syncVarSet','addVariable','value','[syncVarSet][VoiceAgentReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','isNil','values','[syncHangup][VoiceAgentReport]','transfereeuniqueid','origtransfereruniqueid','diff','seconds','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','transfereruniqueid','channel','substring','lastIndexOf','[syncMusicOnHoldStart][VoiceAgentReport]','onhold','[syncMusicOnHoldStop][VoiceAgentReport]','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','../ami','redis','defaults','socket.io-emitter','voiceQueues','agents','variables','syncAgentCalled','bind','agentconnect','syncAgentConnect','syncAgentRingNoAnswer','agentcomplete','varset','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','prototype','emit','isNotNull','isUndefined','channels','uniqueid','destuniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','type','inbound','merge','omit','event','privilege','custom:agentcalled','user:%s'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x63ce,0x147));var _0xe63c=function(_0x1ebeea,_0x2f54f4){_0x1ebeea=_0x1ebeea-0x0;var _0x576465=_0x63ce[_0x1ebeea];return _0x576465;};'use strict';var _=require(_0xe63c('0x0'));var moment=require(_0xe63c('0x1'));var util=require(_0xe63c('0x2'));var Redis=require(_0xe63c('0x3'));var config=require(_0xe63c('0x4'));var logger=require(_0xe63c('0x5'))('ami');var ami=require(_0xe63c('0x6'));config[_0xe63c('0x7')]=_[_0xe63c('0x8')](config[_0xe63c('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xe63c('0x9'))(new Redis(config['redis']));function VoiceAgentReport(_0x520191){this['channels']={};this[_0xe63c('0xa')]=_0x520191[_0xe63c('0xa')];this['agents']=_0x520191[_0xe63c('0xb')];this[_0xe63c('0xc')]={};ami['on']('agentcalled',this[_0xe63c('0xd')][_0xe63c('0xe')](this));ami['on'](_0xe63c('0xf'),this[_0xe63c('0x10')][_0xe63c('0xe')](this));ami['on']('agentringnoanswer',this[_0xe63c('0x11')][_0xe63c('0xe')](this));ami['on']('queuecallerabandon',this['syncQueueCallerAbandon'][_0xe63c('0xe')](this));ami['on'](_0xe63c('0x12'),this['syncAgentComplete'][_0xe63c('0xe')](this));ami['on'](_0xe63c('0x13'),this['syncVarSet']['bind'](this));ami['on']('hangup',this['syncHangup'][_0xe63c('0xe')](this));ami['on'](_0xe63c('0x14'),this[_0xe63c('0x15')][_0xe63c('0xe')](this));ami['on'](_0xe63c('0x16'),this[_0xe63c('0x17')][_0xe63c('0xe')](this));ami['on'](_0xe63c('0x18'),this[_0xe63c('0x19')][_0xe63c('0xe')](this));ami['on']('blindtransfer',this['syncBlindTransfer']['bind'](this));}VoiceAgentReport[_0xe63c('0x1a')][_0xe63c('0x1b')]=function(_0x59d3c1,_0x2a4e18,_0x37cb92){io['to'](_0x59d3c1)['emit'](_0x2a4e18,_0x37cb92);};VoiceAgentReport[_0xe63c('0x1a')][_0xe63c('0x1c')]=function(_0x353702){return _0x353702!==null&&!_[_0xe63c('0x1d')](_0x353702);};VoiceAgentReport['prototype'][_0xe63c('0xd')]=function(_0x5a8982){try{if(this['isNotNull'](_0x5a8982)){if(_[_0xe63c('0x1d')](this[_0xe63c('0x1e')][_0x5a8982[_0xe63c('0x1f')]])){this['channels'][_0x5a8982['uniqueid']]={};}if(_['isUndefined'](this[_0xe63c('0x1e')][_0x5a8982[_0xe63c('0x1f')]][_0x5a8982[_0xe63c('0x20')]])){this[_0xe63c('0x1e')][_0x5a8982[_0xe63c('0x1f')]][_0x5a8982[_0xe63c('0x20')]]={'agentcalledAt':moment()[_0xe63c('0x21')](_0xe63c('0x22')),'lastevent':_0xe63c('0x23'),'variables':this[_0xe63c('0xc')][_0x5a8982[_0xe63c('0x1f')]],'type':this[_0xe63c('0xa')][_0x5a8982[_0xe63c('0x24')]]?this[_0xe63c('0xa')][_0x5a8982['queue']][_0xe63c('0x25')]||_0xe63c('0x26'):'inbound'};}_[_0xe63c('0x27')](this[_0xe63c('0x1e')][_0x5a8982['uniqueid']][_0x5a8982['destuniqueid']],_[_0xe63c('0x28')](_0x5a8982,[_0xe63c('0x29'),_0xe63c('0x2a')]));ami[_0xe63c('0x1b')](_0xe63c('0x2b'),this['channels'][_0x5a8982[_0xe63c('0x1f')]][_0x5a8982['destuniqueid']]);this[_0xe63c('0x1b')](util[_0xe63c('0x21')](_0xe63c('0x2c'),_0x5a8982[_0xe63c('0x2d')]),_0xe63c('0x2e'),this['channels'][_0x5a8982[_0xe63c('0x1f')]][_0x5a8982[_0xe63c('0x20')]]);}}catch(_0x333bf1){logger['error'](_0xe63c('0x2f'),util['inspect'](_0x333bf1,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xe63c('0x1a')][_0xe63c('0x10')]=function(_0x3eb6a2){try{if(this[_0xe63c('0x1c')](_0x3eb6a2)){if(this[_0xe63c('0x1e')][_0x3eb6a2['uniqueid']]){for(var _0x59fb95 in this[_0xe63c('0x1e')][_0x3eb6a2[_0xe63c('0x1f')]]){if(this['channels'][_0x3eb6a2[_0xe63c('0x1f')]][_0xe63c('0x30')](_0x59fb95)){if(_0x3eb6a2[_0xe63c('0x20')]===_0x59fb95){this[_0xe63c('0x1e')][_0x3eb6a2[_0xe63c('0x1f')]][_0x59fb95][_0xe63c('0x31')]=moment()[_0xe63c('0x21')](_0xe63c('0x22'));this[_0xe63c('0x1e')][_0x3eb6a2[_0xe63c('0x1f')]][_0x59fb95]['lastevent']=_0xe63c('0x32');this[_0xe63c('0x1e')][_0x3eb6a2[_0xe63c('0x1f')]][_0x59fb95][_0xe63c('0x33')]=_0x3eb6a2[_0xe63c('0x33')];this[_0xe63c('0x1e')][_0x3eb6a2[_0xe63c('0x1f')]][_0x59fb95][_0xe63c('0x34')]=_0x3eb6a2[_0xe63c('0x34')];this[_0xe63c('0x1e')][_0x3eb6a2['uniqueid']][_0x59fb95][_0xe63c('0x35')]=_0x3eb6a2[_0xe63c('0x35')];this[_0xe63c('0x1e')][_0x3eb6a2[_0xe63c('0x1f')]][_0x59fb95][_0xe63c('0x36')]=_0x3eb6a2['destchannelstate'];this['channels'][_0x3eb6a2[_0xe63c('0x1f')]][_0x59fb95][_0xe63c('0x37')]=_0x3eb6a2[_0xe63c('0x37')];_['merge'](this[_0xe63c('0xb')][_0x3eb6a2[_0xe63c('0x38')]],_['pick'](_0x3eb6a2,['queue',_0xe63c('0x39')]));this[_0xe63c('0x1b')](util[_0xe63c('0x21')]('user:%s',_0x3eb6a2['membername']),_0xe63c('0x3a'),this['channels'][_0x3eb6a2[_0xe63c('0x1f')]][_0x3eb6a2['destuniqueid']]);ami[_0xe63c('0x1b')]('custom:agentconnect',this[_0xe63c('0x1e')][_0x3eb6a2['uniqueid']][_0x59fb95]);}else if(!this[_0xe63c('0x1e')][_0x3eb6a2[_0xe63c('0x1f')]][_0x59fb95]['agentringnoanswer']&&!this['channels'][_0x3eb6a2['uniqueid']][_0x59fb95]['agentcomplete']){this['channels'][_0x3eb6a2[_0xe63c('0x1f')]][_0x59fb95]['agentringnoanswer']=!![];this[_0xe63c('0x1e')][_0x3eb6a2[_0xe63c('0x1f')]][_0x59fb95][_0xe63c('0x3b')]=moment()[_0xe63c('0x21')](_0xe63c('0x22'));this[_0xe63c('0x1e')][_0x3eb6a2[_0xe63c('0x1f')]][_0x59fb95][_0xe63c('0x3c')]='answered_elsewhere';this[_0xe63c('0x1e')][_0x3eb6a2['uniqueid']][_0x59fb95][_0xe63c('0x3d')]=_0xe63c('0x3e');this[_0xe63c('0x1e')][_0x3eb6a2['uniqueid']][_0x59fb95][_0xe63c('0x3f')]=_0x3eb6a2[_0xe63c('0x20')];this[_0xe63c('0x1e')][_0x3eb6a2['uniqueid']][_0x59fb95][_0xe63c('0x40')]=_0x3eb6a2[_0xe63c('0x2d')];ami[_0xe63c('0x1b')](_0xe63c('0x41'),this['channels'][_0x3eb6a2[_0xe63c('0x1f')]][_0x59fb95]);}}}}}}catch(_0x47f5f9){logger[_0xe63c('0x42')](_0xe63c('0x43'),util['inspect'](_0x47f5f9,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xe63c('0x1a')][_0xe63c('0x11')]=function(_0x1d9990){try{if(this[_0xe63c('0x1c')](_0x1d9990)){if(this[_0xe63c('0x1e')][_0x1d9990['uniqueid']]&&this['channels'][_0x1d9990['uniqueid']][_0x1d9990[_0xe63c('0x20')]]){this[_0xe63c('0x1e')][_0x1d9990['uniqueid']][_0x1d9990[_0xe63c('0x20')]][_0xe63c('0x44')]=!![];this[_0xe63c('0x1e')][_0x1d9990[_0xe63c('0x1f')]][_0x1d9990[_0xe63c('0x20')]][_0xe63c('0x3b')]=moment()[_0xe63c('0x21')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xe63c('0x1e')][_0x1d9990[_0xe63c('0x1f')]][_0x1d9990[_0xe63c('0x20')]]['reason']=_0xe63c('0x45');this[_0xe63c('0x1e')][_0x1d9990[_0xe63c('0x1f')]][_0x1d9990[_0xe63c('0x20')]]['lastevent']=_0xe63c('0x45');ami[_0xe63c('0x1b')](_0xe63c('0x46'),this[_0xe63c('0x1e')][_0x1d9990['uniqueid']][_0x1d9990[_0xe63c('0x20')]]);}}}catch(_0x26297f){logger[_0xe63c('0x42')](_0xe63c('0x47'),util['inspect'](_0x26297f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xe63c('0x1a')][_0xe63c('0x48')]=function(_0x2cc70a){try{if(this[_0xe63c('0x1c')](_0x2cc70a)){if(this[_0xe63c('0x1e')][_0x2cc70a['uniqueid']]){for(var _0x342c3b in this[_0xe63c('0x1e')][_0x2cc70a[_0xe63c('0x1f')]]){if(this[_0xe63c('0x1e')][_0x2cc70a[_0xe63c('0x1f')]][_0xe63c('0x30')](_0x342c3b)&&!this[_0xe63c('0x1e')][_0x2cc70a[_0xe63c('0x1f')]][_0x342c3b][_0xe63c('0x44')]&&!this['channels'][_0x2cc70a[_0xe63c('0x1f')]][_0x342c3b][_0xe63c('0x12')]){this[_0xe63c('0x1e')][_0x2cc70a[_0xe63c('0x1f')]][_0x342c3b][_0xe63c('0x44')]=!![];this[_0xe63c('0x1e')][_0x2cc70a[_0xe63c('0x1f')]][_0x342c3b][_0xe63c('0x3b')]=moment()[_0xe63c('0x21')](_0xe63c('0x22'));this[_0xe63c('0x1e')][_0x2cc70a[_0xe63c('0x1f')]][_0x342c3b]['reason']=_0xe63c('0x49');this[_0xe63c('0x1e')][_0x2cc70a[_0xe63c('0x1f')]][_0x342c3b][_0xe63c('0x3d')]=_0xe63c('0x49');ami[_0xe63c('0x1b')](_0xe63c('0x4a'),this[_0xe63c('0x1e')][_0x2cc70a[_0xe63c('0x1f')]][_0x342c3b]);}}}}}catch(_0x3efb1f){logger[_0xe63c('0x42')](_0xe63c('0x4b'),util[_0xe63c('0x4c')](_0x3efb1f,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xe63c('0x4d')]=function(_0x3b05ec){try{if(this[_0xe63c('0x1c')](_0x3b05ec)){if(this[_0xe63c('0x1e')][_0x3b05ec[_0xe63c('0x1f')]]){for(var _0x3f93ed in this[_0xe63c('0x1e')][_0x3b05ec[_0xe63c('0x1f')]]){if(this[_0xe63c('0x1e')][_0x3b05ec[_0xe63c('0x1f')]][_0xe63c('0x30')](_0x3f93ed)){if(this[_0xe63c('0x1e')][_0x3b05ec[_0xe63c('0x1f')]][_0x3f93ed][_0xe63c('0x31')]&&!this[_0xe63c('0x1e')][_0x3b05ec['uniqueid']][_0x3f93ed][_0xe63c('0x12')]){this[_0xe63c('0x1e')][_0x3b05ec[_0xe63c('0x1f')]][_0x3f93ed][_0xe63c('0x12')]=!![];this[_0xe63c('0x1e')][_0x3b05ec[_0xe63c('0x1f')]][_0x3f93ed][_0xe63c('0x4e')]=moment()[_0xe63c('0x21')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xe63c('0x1e')][_0x3b05ec[_0xe63c('0x1f')]][_0x3f93ed][_0xe63c('0x3d')]=_0xe63c('0x4f');this['channels'][_0x3b05ec[_0xe63c('0x1f')]][_0x3f93ed][_0xe63c('0x50')]=_0x3b05ec['talktime'];this[_0xe63c('0x1e')][_0x3b05ec[_0xe63c('0x1f')]][_0x3f93ed]['reason']=_0x3b05ec[_0xe63c('0x3c')]==_0xe63c('0x51')?_0xe63c('0x52'):_0x3b05ec[_0xe63c('0x3c')];if(this[_0xe63c('0xa')][_0x3b05ec[_0xe63c('0x24')]]&&this[_0xe63c('0xa')][_0x3b05ec[_0xe63c('0x24')]]['acw']){this['channels'][_0x3b05ec[_0xe63c('0x1f')]][_0x3f93ed][_0xe63c('0x53')]=!![];this[_0xe63c('0x1e')][_0x3b05ec[_0xe63c('0x1f')]][_0x3f93ed]['acwtime']=this[_0xe63c('0xa')][_0x3b05ec[_0xe63c('0x24')]][_0xe63c('0x54')];}this[_0xe63c('0xb')][_0x3b05ec[_0xe63c('0x38')]]=_[_0xe63c('0x28')](this[_0xe63c('0xb')][_0x3b05ec['interface']],[_0xe63c('0x24'),_0xe63c('0x39')]);this[_0xe63c('0x1b')](util[_0xe63c('0x21')]('user:%s',_0x3b05ec[_0xe63c('0x2d')]),_0xe63c('0x55'),this[_0xe63c('0x1e')][_0x3b05ec[_0xe63c('0x1f')]][_0x3f93ed]);ami[_0xe63c('0x1b')]('custom:agentcomplete',this[_0xe63c('0x1e')][_0x3b05ec[_0xe63c('0x1f')]][_0x3f93ed]);}}}}}}catch(_0x53cc3e){logger[_0xe63c('0x42')](_0xe63c('0x56'),util[_0xe63c('0x4c')](_0x53cc3e,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xe63c('0x1a')][_0xe63c('0x57')]=function(_0x285b27){try{if(this[_0xe63c('0x1c')](_0x285b27)){this[_0xe63c('0x58')](_0x285b27[_0xe63c('0x1f')],_['keys'](_0x285b27['variable'])[0x0],_0x285b27[_0xe63c('0x59')]);if(this[_0xe63c('0x1e')][_0x285b27[_0xe63c('0x1f')]]){for(var _0x57f407 in this[_0xe63c('0x1e')][_0x285b27[_0xe63c('0x1f')]]){if(this[_0xe63c('0x1e')][_0x285b27[_0xe63c('0x1f')]][_0xe63c('0x30')](_0x57f407)){if(_[_0xe63c('0x1d')](this[_0xe63c('0x1e')][_0x285b27[_0xe63c('0x1f')]][_0x57f407][_0xe63c('0xc')])){this[_0xe63c('0x1e')][_0x285b27[_0xe63c('0x1f')]][_0x57f407][_0xe63c('0xc')]={};}this[_0xe63c('0x1e')][_0x285b27['uniqueid']][_0x57f407][_0xe63c('0xc')]=this['variables'][_0x285b27[_0xe63c('0x1f')]];}}}}}catch(_0x159274){logger['error'](_0xe63c('0x5a'),util[_0xe63c('0x4c')](_0x159274,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xe63c('0x1a')][_0xe63c('0x58')]=function(_0x2c5d43,_0x3e309d,_0xab9371){var _0x4afa72=[_0xe63c('0x5b'),_0xe63c('0x5c'),_0xe63c('0x5d'),_0xe63c('0x5e'),_0xe63c('0x5f'),_0xe63c('0x60'),_0xe63c('0x61'),_0xe63c('0x62'),_0xe63c('0x63'),_0xe63c('0x64'),_0xe63c('0x65'),_0xe63c('0x66'),_0xe63c('0x67'),_0xe63c('0x68'),_0xe63c('0x69'),_0xe63c('0x6a'),_0xe63c('0x2d'),_0xe63c('0x6b'),'memberrealtime'];if(!_[_0xe63c('0x6c')](_0x3e309d)&&!_['includes'](_0x4afa72,_0x3e309d)){if(_[_0xe63c('0x1d')](this[_0xe63c('0xc')][_0x2c5d43])){this[_0xe63c('0xc')][_0x2c5d43]={};}this[_0xe63c('0xc')][_0x2c5d43][_0x3e309d]=_0xab9371;}};VoiceAgentReport[_0xe63c('0x1a')]['syncHangup']=function(_0x2442d5){try{if(this[_0xe63c('0x1c')](_0x2442d5)){if(this[_0xe63c('0x1e')][_0x2442d5[_0xe63c('0x1f')]]){for(var _0x2a75f5 in this['channels'][_0x2442d5['uniqueid']]){if(this[_0xe63c('0x1e')][_0x2442d5[_0xe63c('0x1f')]][_0xe63c('0x30')](_0x2a75f5)){if(this[_0xe63c('0x1e')][_0x2442d5[_0xe63c('0x1f')]][_0x2a75f5][_0xe63c('0x3c')]=='transfer'&&this['channels'][_0x2442d5[_0xe63c('0x1f')]][_0x2a75f5]['agentcomplete']){this['channels'][_0x2442d5[_0xe63c('0x1f')]][_0x2a75f5]['agentcompleteAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}}}ami[_0xe63c('0x1b')]('custom:voiceAgentReport',_[_0xe63c('0x6d')](this['channels'][_0x2442d5[_0xe63c('0x1f')]]));delete this['channels'][_0x2442d5[_0xe63c('0x1f')]];}if(this[_0xe63c('0xc')][_0x2442d5['uniqueid']]){delete this[_0xe63c('0xc')][_0x2442d5[_0xe63c('0x1f')]];}}}catch(_0x912ba){logger[_0xe63c('0x42')](_0xe63c('0x6e'),util['inspect'](_0x912ba,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xe63c('0x19')]=function(_0x348c47){try{if(this[_0xe63c('0x1c')](_0x348c47)){if(this[_0xe63c('0x1e')][_0x348c47[_0xe63c('0x6f')]]){for(var _0x53b9c3 in this['channels'][_0x348c47[_0xe63c('0x6f')]]){if(this[_0xe63c('0x1e')][_0x348c47[_0xe63c('0x6f')]][_0xe63c('0x30')](_0x53b9c3)){if(_0x348c47[_0xe63c('0x70')]===_0x53b9c3){var _0xddba09=moment();this[_0xe63c('0x1e')][_0x348c47[_0xe63c('0x6f')]][_0x53b9c3][_0xe63c('0x12')]=!![];this['channels'][_0x348c47[_0xe63c('0x6f')]][_0x53b9c3][_0xe63c('0x4e')]=moment()[_0xe63c('0x21')](_0xe63c('0x22'));this[_0xe63c('0x1e')][_0x348c47['transfereeuniqueid']][_0x53b9c3][_0xe63c('0x3c')]='transfer';this[_0xe63c('0x1e')][_0x348c47[_0xe63c('0x6f')]][_0x53b9c3][_0xe63c('0x3d')]=_0xe63c('0x4f');this[_0xe63c('0x1e')][_0x348c47['transfereeuniqueid']][_0x53b9c3][_0xe63c('0x50')]=_0xddba09[_0xe63c('0x71')](this[_0xe63c('0x1e')][_0x348c47[_0xe63c('0x6f')]][_0x53b9c3][_0xe63c('0x31')],_0xe63c('0x72'));}}}}if(this[_0xe63c('0x1e')][_0x348c47[_0xe63c('0x73')]]){var _0x580724=this[_0xe63c('0x1e')][_0x348c47[_0xe63c('0x73')]];this['channels'][_0x348c47[_0xe63c('0x73')]]=this['channels'][_0x348c47[_0xe63c('0x6f')]];this[_0xe63c('0x1e')][_0x348c47[_0xe63c('0x6f')]]=_0x580724;}}}catch(_0xa0e256){logger[_0xe63c('0x42')](_0xe63c('0x74'),util['inspect'](_0xa0e256,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xe63c('0x1a')]['syncBlindTransfer']=function(_0x309c91){try{if(this['isNotNull'](_0x309c91)){if(this[_0xe63c('0x1e')][_0x309c91['transfereeuniqueid']]){for(var _0x839350 in this[_0xe63c('0x1e')][_0x309c91['transfereeuniqueid']]){if(this['channels'][_0x309c91[_0xe63c('0x6f')]][_0xe63c('0x30')](_0x839350)){if(_0x309c91[_0xe63c('0x75')]===_0x839350){var _0x350de5=moment();this[_0xe63c('0x1e')][_0x309c91[_0xe63c('0x6f')]][_0x839350]['agentcomplete']=!![];this[_0xe63c('0x1e')][_0x309c91[_0xe63c('0x6f')]][_0x839350]['agentcompleteAt']=_0x350de5;this['channels'][_0x309c91['transfereeuniqueid']][_0x839350]['reason']='transfer';this[_0xe63c('0x1e')][_0x309c91[_0xe63c('0x6f')]][_0x839350][_0xe63c('0x3d')]=_0xe63c('0x4f');this[_0xe63c('0x1e')][_0x309c91[_0xe63c('0x6f')]][_0x839350][_0xe63c('0x50')]=_0x350de5['diff'](this['channels'][_0x309c91['transfereeuniqueid']][_0x839350][_0xe63c('0x31')],'seconds');}}}}}}catch(_0x268041){logger[_0xe63c('0x42')]('[syncBlindTransfer][VoiceAgentReport]',util[_0xe63c('0x4c')](_0x268041,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xe63c('0x1a')][_0xe63c('0x15')]=function(_0x9a16bd){var _0x556763='';try{if(this[_0xe63c('0x1c')](_0x9a16bd)){if(_0x9a16bd[_0xe63c('0x76')]){_0x556763=_0x9a16bd[_0xe63c('0x76')][_0xe63c('0x77')](0x0,_0x9a16bd[_0xe63c('0x76')][_0xe63c('0x78')]('-'));if(this[_0xe63c('0xb')][_0x556763]){this['agents'][_0x556763]['onhold']=!![];}}}}catch(_0x344a35){logger[_0xe63c('0x42')](_0xe63c('0x79'),util[_0xe63c('0x4c')](_0x344a35,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xe63c('0x17')]=function(_0x412d24){var _0x2aad5b='';try{if(this['isNotNull'](_0x412d24)){if(_0x412d24['channel']){_0x2aad5b=_0x412d24[_0xe63c('0x76')][_0xe63c('0x77')](0x0,_0x412d24['channel'][_0xe63c('0x78')]('-'));if(this['agents'][_0x2aad5b]){this[_0xe63c('0xb')][_0x2aad5b][_0xe63c('0x7a')]=![];}}}}catch(_0x3f9652){logger['error'](_0xe63c('0x7b'),util['inspect'](_0x3f9652,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport; \ No newline at end of file +var _0xee82=['lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','../ami','redis','defaults','localhost','socket.io-emitter','voiceQueues','agents','variables','agentcalled','syncAgentCalled','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','varset','syncVarSet','hangup','syncMusicOnHoldStart','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','prototype','emit','isNotNull','uniqueid','isUndefined','channels','destuniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','type','inbound','merge','custom:agentcalled','user:%s','membername','user:called','error','[syncAgentCalled][VoiceAgentReport]','hasOwnProperty','agentconnectAt','lastevent','connect','holdtime','connectedlinename','interface','pick','destconnectedlinenum','user:agentconnect','custom:agentconnect','agentringnoanswer','agentringnoanswerAt','reason','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','custom:agentansweredelsewhere','inspect','rejected','[syncAgentRingNoAnswer][VoiceAgentReport]','abandoned','custom:agentqueuecallerabandon','[syncQueueCallerAbandon][VoiceAgentReport]','complete','talktime','transfer','agentacw','acwtime','acwTimeout','user:agentcomplete','[syncAgentComplete][VoiceAgentReport]','addVariable','keys','variable','value','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipuri','bridgepeer','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','includes','syncHangup','agentcompleteAt','values','[syncHangup][VoiceAgentReport]','transfereeuniqueid','origtransfereruniqueid','seconds','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','syncBlindTransfer','diff','[syncBlindTransfer][VoiceAgentReport]','channel','substring','lastIndexOf','onhold','[syncMusicOnHoldStart][VoiceAgentReport]','[syncMusicOnHoldStop][VoiceAgentReport]','exports'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xee82,0x165));var _0x2ee8=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xee82[_0x12d033];return _0x3b4e80;};'use strict';var _=require(_0x2ee8('0x0'));var moment=require(_0x2ee8('0x1'));var util=require(_0x2ee8('0x2'));var Redis=require(_0x2ee8('0x3'));var config=require(_0x2ee8('0x4'));var logger=require(_0x2ee8('0x5'))('ami');var ami=require(_0x2ee8('0x6'));config[_0x2ee8('0x7')]=_[_0x2ee8('0x8')](config[_0x2ee8('0x7')],{'host':_0x2ee8('0x9'),'port':0x18eb});var io=require(_0x2ee8('0xa'))(new Redis(config[_0x2ee8('0x7')]));function VoiceAgentReport(_0x361635){this['channels']={};this[_0x2ee8('0xb')]=_0x361635['voiceQueues'];this[_0x2ee8('0xc')]=_0x361635[_0x2ee8('0xc')];this[_0x2ee8('0xd')]={};ami['on'](_0x2ee8('0xe'),this[_0x2ee8('0xf')]['bind'](this));ami['on'](_0x2ee8('0x10'),this[_0x2ee8('0x11')]['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x2ee8('0x12')](this));ami['on'](_0x2ee8('0x13'),this[_0x2ee8('0x14')][_0x2ee8('0x12')](this));ami['on'](_0x2ee8('0x15'),this['syncAgentComplete'][_0x2ee8('0x12')](this));ami['on'](_0x2ee8('0x16'),this[_0x2ee8('0x17')]['bind'](this));ami['on'](_0x2ee8('0x18'),this['syncHangup'][_0x2ee8('0x12')](this));ami['on']('musiconholdstart',this[_0x2ee8('0x19')][_0x2ee8('0x12')](this));ami['on']('musiconholdstop',this[_0x2ee8('0x1a')][_0x2ee8('0x12')](this));ami['on'](_0x2ee8('0x1b'),this[_0x2ee8('0x1c')][_0x2ee8('0x12')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x2ee8('0x12')](this));}VoiceAgentReport[_0x2ee8('0x1d')]['emit']=function(_0x2e2e17,_0x59aac9,_0x22724d){io['to'](_0x2e2e17)[_0x2ee8('0x1e')](_0x59aac9,_0x22724d);};VoiceAgentReport[_0x2ee8('0x1d')][_0x2ee8('0x1f')]=function(_0x2eccb1){return _0x2eccb1!==null&&!_['isUndefined'](_0x2eccb1);};VoiceAgentReport[_0x2ee8('0x1d')][_0x2ee8('0xf')]=function(_0x140a94){try{if(this[_0x2ee8('0x1f')](_0x140a94)){if(_['isUndefined'](this['channels'][_0x140a94[_0x2ee8('0x20')]])){this['channels'][_0x140a94[_0x2ee8('0x20')]]={};}if(_[_0x2ee8('0x21')](this[_0x2ee8('0x22')][_0x140a94[_0x2ee8('0x20')]][_0x140a94[_0x2ee8('0x23')]])){this[_0x2ee8('0x22')][_0x140a94[_0x2ee8('0x20')]][_0x140a94[_0x2ee8('0x23')]]={'agentcalledAt':moment()[_0x2ee8('0x24')](_0x2ee8('0x25')),'lastevent':_0x2ee8('0x26'),'variables':this[_0x2ee8('0xd')][_0x140a94[_0x2ee8('0x20')]],'type':this[_0x2ee8('0xb')][_0x140a94[_0x2ee8('0x27')]]?this[_0x2ee8('0xb')][_0x140a94['queue']][_0x2ee8('0x28')]||_0x2ee8('0x29'):_0x2ee8('0x29')};}_[_0x2ee8('0x2a')](this['channels'][_0x140a94[_0x2ee8('0x20')]][_0x140a94[_0x2ee8('0x23')]],_['omit'](_0x140a94,['event','privilege']));ami[_0x2ee8('0x1e')](_0x2ee8('0x2b'),this[_0x2ee8('0x22')][_0x140a94['uniqueid']][_0x140a94['destuniqueid']]);this['emit'](util[_0x2ee8('0x24')](_0x2ee8('0x2c'),_0x140a94[_0x2ee8('0x2d')]),_0x2ee8('0x2e'),this[_0x2ee8('0x22')][_0x140a94['uniqueid']][_0x140a94[_0x2ee8('0x23')]]);}}catch(_0xd71b55){logger[_0x2ee8('0x2f')](_0x2ee8('0x30'),util['inspect'](_0xd71b55,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x2ee8('0x11')]=function(_0x40e1b4){try{if(this[_0x2ee8('0x1f')](_0x40e1b4)){if(this[_0x2ee8('0x22')][_0x40e1b4['uniqueid']]){for(var _0x11aa61 in this[_0x2ee8('0x22')][_0x40e1b4[_0x2ee8('0x20')]]){if(this[_0x2ee8('0x22')][_0x40e1b4[_0x2ee8('0x20')]][_0x2ee8('0x31')](_0x11aa61)){if(_0x40e1b4[_0x2ee8('0x23')]===_0x11aa61){this[_0x2ee8('0x22')][_0x40e1b4[_0x2ee8('0x20')]][_0x11aa61][_0x2ee8('0x32')]=moment()[_0x2ee8('0x24')](_0x2ee8('0x25'));this[_0x2ee8('0x22')][_0x40e1b4[_0x2ee8('0x20')]][_0x11aa61][_0x2ee8('0x33')]=_0x2ee8('0x34');this[_0x2ee8('0x22')][_0x40e1b4[_0x2ee8('0x20')]][_0x11aa61][_0x2ee8('0x35')]=_0x40e1b4['holdtime'];this[_0x2ee8('0x22')][_0x40e1b4[_0x2ee8('0x20')]][_0x11aa61]['connectedlinenum']=_0x40e1b4['connectedlinenum'];this[_0x2ee8('0x22')][_0x40e1b4['uniqueid']][_0x11aa61][_0x2ee8('0x36')]=_0x40e1b4[_0x2ee8('0x36')];this[_0x2ee8('0x22')][_0x40e1b4['uniqueid']][_0x11aa61]['destchannelstate']=_0x40e1b4['destchannelstate'];this[_0x2ee8('0x22')][_0x40e1b4[_0x2ee8('0x20')]][_0x11aa61]['destchannelstatedesc']=_0x40e1b4['destchannelstatedesc'];_[_0x2ee8('0x2a')](this[_0x2ee8('0xc')][_0x40e1b4[_0x2ee8('0x37')]],_[_0x2ee8('0x38')](_0x40e1b4,[_0x2ee8('0x27'),_0x2ee8('0x39')]));this[_0x2ee8('0x1e')](util[_0x2ee8('0x24')](_0x2ee8('0x2c'),_0x40e1b4['membername']),_0x2ee8('0x3a'),this[_0x2ee8('0x22')][_0x40e1b4['uniqueid']][_0x40e1b4['destuniqueid']]);ami[_0x2ee8('0x1e')](_0x2ee8('0x3b'),this[_0x2ee8('0x22')][_0x40e1b4[_0x2ee8('0x20')]][_0x11aa61]);}else if(!this[_0x2ee8('0x22')][_0x40e1b4[_0x2ee8('0x20')]][_0x11aa61][_0x2ee8('0x3c')]&&!this[_0x2ee8('0x22')][_0x40e1b4[_0x2ee8('0x20')]][_0x11aa61][_0x2ee8('0x15')]){this[_0x2ee8('0x22')][_0x40e1b4[_0x2ee8('0x20')]][_0x11aa61][_0x2ee8('0x3c')]=!![];this['channels'][_0x40e1b4[_0x2ee8('0x20')]][_0x11aa61][_0x2ee8('0x3d')]=moment()[_0x2ee8('0x24')](_0x2ee8('0x25'));this[_0x2ee8('0x22')][_0x40e1b4['uniqueid']][_0x11aa61][_0x2ee8('0x3e')]='answered_elsewhere';this[_0x2ee8('0x22')][_0x40e1b4[_0x2ee8('0x20')]][_0x11aa61][_0x2ee8('0x33')]=_0x2ee8('0x3f');this[_0x2ee8('0x22')][_0x40e1b4[_0x2ee8('0x20')]][_0x11aa61][_0x2ee8('0x40')]=_0x40e1b4['destuniqueid'];this[_0x2ee8('0x22')][_0x40e1b4[_0x2ee8('0x20')]][_0x11aa61][_0x2ee8('0x41')]=_0x40e1b4['membername'];ami[_0x2ee8('0x1e')](_0x2ee8('0x42'),this['channels'][_0x40e1b4[_0x2ee8('0x20')]][_0x11aa61]);}}}}}}catch(_0x1547fd){logger[_0x2ee8('0x2f')]('[syncAgentConnect][VoiceAgentReport]',util[_0x2ee8('0x43')](_0x1547fd,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2ee8('0x1d')]['syncAgentRingNoAnswer']=function(_0xf78f8f){try{if(this[_0x2ee8('0x1f')](_0xf78f8f)){if(this['channels'][_0xf78f8f[_0x2ee8('0x20')]]&&this[_0x2ee8('0x22')][_0xf78f8f[_0x2ee8('0x20')]][_0xf78f8f[_0x2ee8('0x23')]]){this[_0x2ee8('0x22')][_0xf78f8f[_0x2ee8('0x20')]][_0xf78f8f[_0x2ee8('0x23')]][_0x2ee8('0x3c')]=!![];this[_0x2ee8('0x22')][_0xf78f8f[_0x2ee8('0x20')]][_0xf78f8f[_0x2ee8('0x23')]][_0x2ee8('0x3d')]=moment()[_0x2ee8('0x24')](_0x2ee8('0x25'));this[_0x2ee8('0x22')][_0xf78f8f[_0x2ee8('0x20')]][_0xf78f8f['destuniqueid']]['reason']=_0x2ee8('0x44');this[_0x2ee8('0x22')][_0xf78f8f[_0x2ee8('0x20')]][_0xf78f8f[_0x2ee8('0x23')]][_0x2ee8('0x33')]=_0x2ee8('0x44');ami[_0x2ee8('0x1e')]('custom:agentringnoanswer',this[_0x2ee8('0x22')][_0xf78f8f[_0x2ee8('0x20')]][_0xf78f8f[_0x2ee8('0x23')]]);}}}catch(_0x59c9b2){logger[_0x2ee8('0x2f')](_0x2ee8('0x45'),util[_0x2ee8('0x43')](_0x59c9b2,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2ee8('0x1d')][_0x2ee8('0x14')]=function(_0x3f6cb8){try{if(this[_0x2ee8('0x1f')](_0x3f6cb8)){if(this[_0x2ee8('0x22')][_0x3f6cb8[_0x2ee8('0x20')]]){for(var _0x584339 in this['channels'][_0x3f6cb8[_0x2ee8('0x20')]]){if(this[_0x2ee8('0x22')][_0x3f6cb8[_0x2ee8('0x20')]][_0x2ee8('0x31')](_0x584339)&&!this[_0x2ee8('0x22')][_0x3f6cb8[_0x2ee8('0x20')]][_0x584339][_0x2ee8('0x3c')]&&!this['channels'][_0x3f6cb8[_0x2ee8('0x20')]][_0x584339]['agentcomplete']){this['channels'][_0x3f6cb8[_0x2ee8('0x20')]][_0x584339]['agentringnoanswer']=!![];this['channels'][_0x3f6cb8[_0x2ee8('0x20')]][_0x584339][_0x2ee8('0x3d')]=moment()[_0x2ee8('0x24')](_0x2ee8('0x25'));this[_0x2ee8('0x22')][_0x3f6cb8[_0x2ee8('0x20')]][_0x584339]['reason']='abandoned';this[_0x2ee8('0x22')][_0x3f6cb8[_0x2ee8('0x20')]][_0x584339][_0x2ee8('0x33')]=_0x2ee8('0x46');ami[_0x2ee8('0x1e')](_0x2ee8('0x47'),this[_0x2ee8('0x22')][_0x3f6cb8['uniqueid']][_0x584339]);}}}}}catch(_0xc14478){logger[_0x2ee8('0x2f')](_0x2ee8('0x48'),util[_0x2ee8('0x43')](_0xc14478,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2ee8('0x1d')]['syncAgentComplete']=function(_0x5673a6){try{if(this[_0x2ee8('0x1f')](_0x5673a6)){if(this[_0x2ee8('0x22')][_0x5673a6['uniqueid']]){for(var _0x1ec379 in this[_0x2ee8('0x22')][_0x5673a6[_0x2ee8('0x20')]]){if(this['channels'][_0x5673a6[_0x2ee8('0x20')]]['hasOwnProperty'](_0x1ec379)){if(this[_0x2ee8('0x22')][_0x5673a6[_0x2ee8('0x20')]][_0x1ec379][_0x2ee8('0x32')]&&!this['channels'][_0x5673a6[_0x2ee8('0x20')]][_0x1ec379][_0x2ee8('0x15')]){this['channels'][_0x5673a6[_0x2ee8('0x20')]][_0x1ec379]['agentcomplete']=!![];this['channels'][_0x5673a6[_0x2ee8('0x20')]][_0x1ec379]['agentcompleteAt']=moment()[_0x2ee8('0x24')](_0x2ee8('0x25'));this['channels'][_0x5673a6[_0x2ee8('0x20')]][_0x1ec379][_0x2ee8('0x33')]=_0x2ee8('0x49');this[_0x2ee8('0x22')][_0x5673a6[_0x2ee8('0x20')]][_0x1ec379][_0x2ee8('0x4a')]=_0x5673a6[_0x2ee8('0x4a')];this[_0x2ee8('0x22')][_0x5673a6[_0x2ee8('0x20')]][_0x1ec379][_0x2ee8('0x3e')]=_0x5673a6[_0x2ee8('0x3e')]==_0x2ee8('0x4b')?'agent':_0x5673a6[_0x2ee8('0x3e')];if(this['voiceQueues'][_0x5673a6[_0x2ee8('0x27')]]&&this[_0x2ee8('0xb')][_0x5673a6[_0x2ee8('0x27')]]['acw']){this['channels'][_0x5673a6['uniqueid']][_0x1ec379][_0x2ee8('0x4c')]=!![];this[_0x2ee8('0x22')][_0x5673a6[_0x2ee8('0x20')]][_0x1ec379][_0x2ee8('0x4d')]=this[_0x2ee8('0xb')][_0x5673a6[_0x2ee8('0x27')]][_0x2ee8('0x4e')];}this[_0x2ee8('0xc')][_0x5673a6['interface']]=_['omit'](this[_0x2ee8('0xc')][_0x5673a6[_0x2ee8('0x37')]],[_0x2ee8('0x27'),_0x2ee8('0x39')]);this['emit'](util[_0x2ee8('0x24')](_0x2ee8('0x2c'),_0x5673a6[_0x2ee8('0x2d')]),_0x2ee8('0x4f'),this[_0x2ee8('0x22')][_0x5673a6[_0x2ee8('0x20')]][_0x1ec379]);ami[_0x2ee8('0x1e')]('custom:agentcomplete',this[_0x2ee8('0x22')][_0x5673a6[_0x2ee8('0x20')]][_0x1ec379]);}}}}}}catch(_0x49bbfb){logger[_0x2ee8('0x2f')](_0x2ee8('0x50'),util[_0x2ee8('0x43')](_0x49bbfb,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2ee8('0x1d')][_0x2ee8('0x17')]=function(_0x235d43){try{if(this['isNotNull'](_0x235d43)){this[_0x2ee8('0x51')](_0x235d43[_0x2ee8('0x20')],_[_0x2ee8('0x52')](_0x235d43[_0x2ee8('0x53')])[0x0],_0x235d43[_0x2ee8('0x54')]);if(this[_0x2ee8('0x22')][_0x235d43['uniqueid']]){for(var _0x3379d2 in this[_0x2ee8('0x22')][_0x235d43[_0x2ee8('0x20')]]){if(this[_0x2ee8('0x22')][_0x235d43['uniqueid']]['hasOwnProperty'](_0x3379d2)){if(_['isUndefined'](this[_0x2ee8('0x22')][_0x235d43[_0x2ee8('0x20')]][_0x3379d2][_0x2ee8('0xd')])){this['channels'][_0x235d43['uniqueid']][_0x3379d2][_0x2ee8('0xd')]={};}this[_0x2ee8('0x22')][_0x235d43[_0x2ee8('0x20')]][_0x3379d2][_0x2ee8('0xd')]=this['variables'][_0x235d43[_0x2ee8('0x20')]];}}}}}catch(_0x4ff194){logger[_0x2ee8('0x2f')]('[syncVarSet][VoiceAgentReport]',util[_0x2ee8('0x43')](_0x4ff194,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2ee8('0x1d')]['addVariable']=function(_0x13a34c,_0x392eec,_0x146af6){var _0x5ec738=[_0x2ee8('0x55'),_0x2ee8('0x56'),_0x2ee8('0x57'),'rtpaudioqosjitterbridged',_0x2ee8('0x58'),_0x2ee8('0x59'),'rtpaudioqosrtt',_0x2ee8('0x5a'),'sipcallid',_0x2ee8('0x5b'),_0x2ee8('0x5c'),'bridgepvtcallid',_0x2ee8('0x5d'),_0x2ee8('0x5e'),_0x2ee8('0x5f'),_0x2ee8('0x60'),_0x2ee8('0x2d'),_0x2ee8('0x61'),_0x2ee8('0x62')];if(!_['isNil'](_0x392eec)&&!_[_0x2ee8('0x63')](_0x5ec738,_0x392eec)){if(_[_0x2ee8('0x21')](this[_0x2ee8('0xd')][_0x13a34c])){this[_0x2ee8('0xd')][_0x13a34c]={};}this[_0x2ee8('0xd')][_0x13a34c][_0x392eec]=_0x146af6;}};VoiceAgentReport['prototype'][_0x2ee8('0x64')]=function(_0x4ad35c){try{if(this[_0x2ee8('0x1f')](_0x4ad35c)){if(this[_0x2ee8('0x22')][_0x4ad35c[_0x2ee8('0x20')]]){for(var _0x3b5d10 in this[_0x2ee8('0x22')][_0x4ad35c[_0x2ee8('0x20')]]){if(this[_0x2ee8('0x22')][_0x4ad35c[_0x2ee8('0x20')]][_0x2ee8('0x31')](_0x3b5d10)){if(this[_0x2ee8('0x22')][_0x4ad35c['uniqueid']][_0x3b5d10][_0x2ee8('0x3e')]==_0x2ee8('0x4b')&&this['channels'][_0x4ad35c[_0x2ee8('0x20')]][_0x3b5d10][_0x2ee8('0x15')]){this[_0x2ee8('0x22')][_0x4ad35c[_0x2ee8('0x20')]][_0x3b5d10][_0x2ee8('0x65')]=moment()[_0x2ee8('0x24')]('YYYY-MM-DD\x20HH:mm:ss');}}}ami[_0x2ee8('0x1e')]('custom:voiceAgentReport',_[_0x2ee8('0x66')](this['channels'][_0x4ad35c[_0x2ee8('0x20')]]));delete this[_0x2ee8('0x22')][_0x4ad35c[_0x2ee8('0x20')]];}if(this[_0x2ee8('0xd')][_0x4ad35c[_0x2ee8('0x20')]]){delete this[_0x2ee8('0xd')][_0x4ad35c[_0x2ee8('0x20')]];}}}catch(_0x6fed3d){logger[_0x2ee8('0x2f')](_0x2ee8('0x67'),util[_0x2ee8('0x43')](_0x6fed3d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2ee8('0x1d')][_0x2ee8('0x1c')]=function(_0x2ef868){try{if(this[_0x2ee8('0x1f')](_0x2ef868)){if(this[_0x2ee8('0x22')][_0x2ef868[_0x2ee8('0x68')]]){for(var _0x3b258e in this[_0x2ee8('0x22')][_0x2ef868['transfereeuniqueid']]){if(this[_0x2ee8('0x22')][_0x2ef868[_0x2ee8('0x68')]][_0x2ee8('0x31')](_0x3b258e)){if(_0x2ef868[_0x2ee8('0x69')]===_0x3b258e){var _0x469a93=moment();this[_0x2ee8('0x22')][_0x2ef868[_0x2ee8('0x68')]][_0x3b258e][_0x2ee8('0x15')]=!![];this[_0x2ee8('0x22')][_0x2ef868['transfereeuniqueid']][_0x3b258e][_0x2ee8('0x65')]=moment()[_0x2ee8('0x24')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x2ee8('0x22')][_0x2ef868[_0x2ee8('0x68')]][_0x3b258e]['reason']=_0x2ee8('0x4b');this[_0x2ee8('0x22')][_0x2ef868[_0x2ee8('0x68')]][_0x3b258e][_0x2ee8('0x33')]=_0x2ee8('0x49');this['channels'][_0x2ef868[_0x2ee8('0x68')]][_0x3b258e][_0x2ee8('0x4a')]=_0x469a93['diff'](this['channels'][_0x2ef868[_0x2ee8('0x68')]][_0x3b258e][_0x2ee8('0x32')],_0x2ee8('0x6a'));}}}}if(this[_0x2ee8('0x22')][_0x2ef868[_0x2ee8('0x6b')]]){var _0x2c9b3e=this['channels'][_0x2ef868[_0x2ee8('0x6b')]];this[_0x2ee8('0x22')][_0x2ef868[_0x2ee8('0x6b')]]=this[_0x2ee8('0x22')][_0x2ef868['transfereeuniqueid']];this[_0x2ee8('0x22')][_0x2ef868[_0x2ee8('0x68')]]=_0x2c9b3e;}}}catch(_0x27c45b){logger[_0x2ee8('0x2f')](_0x2ee8('0x6c'),util['inspect'](_0x27c45b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2ee8('0x1d')][_0x2ee8('0x6d')]=function(_0x4c6c49){try{if(this[_0x2ee8('0x1f')](_0x4c6c49)){if(this[_0x2ee8('0x22')][_0x4c6c49['transfereeuniqueid']]){for(var _0x442e70 in this[_0x2ee8('0x22')][_0x4c6c49[_0x2ee8('0x68')]]){if(this[_0x2ee8('0x22')][_0x4c6c49['transfereeuniqueid']][_0x2ee8('0x31')](_0x442e70)){if(_0x4c6c49['transfereruniqueid']===_0x442e70){var _0x5bcbcd=moment();this[_0x2ee8('0x22')][_0x4c6c49[_0x2ee8('0x68')]][_0x442e70]['agentcomplete']=!![];this[_0x2ee8('0x22')][_0x4c6c49[_0x2ee8('0x68')]][_0x442e70][_0x2ee8('0x65')]=_0x5bcbcd;this[_0x2ee8('0x22')][_0x4c6c49['transfereeuniqueid']][_0x442e70][_0x2ee8('0x3e')]=_0x2ee8('0x4b');this[_0x2ee8('0x22')][_0x4c6c49[_0x2ee8('0x68')]][_0x442e70][_0x2ee8('0x33')]=_0x2ee8('0x49');this['channels'][_0x4c6c49['transfereeuniqueid']][_0x442e70][_0x2ee8('0x4a')]=_0x5bcbcd[_0x2ee8('0x6e')](this[_0x2ee8('0x22')][_0x4c6c49['transfereeuniqueid']][_0x442e70][_0x2ee8('0x32')],_0x2ee8('0x6a'));}}}}}}catch(_0x41f0f0){logger[_0x2ee8('0x2f')](_0x2ee8('0x6f'),util[_0x2ee8('0x43')](_0x41f0f0,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x2ee8('0x19')]=function(_0x4ce150){var _0x4ac260='';try{if(this['isNotNull'](_0x4ce150)){if(_0x4ce150[_0x2ee8('0x70')]){_0x4ac260=_0x4ce150[_0x2ee8('0x70')][_0x2ee8('0x71')](0x0,_0x4ce150['channel'][_0x2ee8('0x72')]('-'));if(this[_0x2ee8('0xc')][_0x4ac260]){this[_0x2ee8('0xc')][_0x4ac260][_0x2ee8('0x73')]=!![];}}}}catch(_0x53676b){logger['error'](_0x2ee8('0x74'),util[_0x2ee8('0x43')](_0x53676b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2ee8('0x1d')]['syncMusicOnHoldStop']=function(_0x33120e){var _0x2f44f7='';try{if(this['isNotNull'](_0x33120e)){if(_0x33120e[_0x2ee8('0x70')]){_0x2f44f7=_0x33120e[_0x2ee8('0x70')][_0x2ee8('0x71')](0x0,_0x33120e[_0x2ee8('0x70')]['lastIndexOf']('-'));if(this[_0x2ee8('0xc')][_0x2f44f7]){this['agents'][_0x2f44f7]['onhold']=![];}}}}catch(_0x5c4c60){logger[_0x2ee8('0x2f')](_0x2ee8('0x75'),util[_0x2ee8('0x43')](_0x5c4c60,{'showHidden':![],'depth':null}));}};module[_0x2ee8('0x76')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 33856d9..a1769fc 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 _0x5b40=['socket.io-emitter','channels','agents','syncNewExten','bind','newchannel','newstate','syncNewState','varset','syncVarSet','hangup','syncHangup','newcallerid','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','resolve','actionCoreShowChannels','catch','log','isNotNull','prototype','emit','syncNewCallerId','linkedid','uniqueid','merge','pick','keys','error','inspect','syncNewChannel','channel','OutgoingSpoolFailed','isUndefined','starttime','format','toNumber','channelstate','context','from-sip','split','destconnectedlinenum','exten','name','user:agentconnect','accountcode','[syncNewChannel][VoiceCallReport]','application','applicationdata','appdata','toLowerCase','subtract','duration','seconds','YYYY-MM-DD\x20HH:mm:ss','disposition','lastapplication','cdr(','[syncNewExten][VoiceCallReport]','answered','holdtime','diff','calleridnum','xcally-motion-preview','connectedlinenum','connectedlinename','calleridname','UserId','membername','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','monitor','endsWith','.wav49','monitors','isNil','push','rec','variable','mixmonitor_filename','value','xmd-phone','xmd-callerid','callerid','xmd-cdrtype','type','xmd-queue','xmd-originatecalleridnum','destination','xmd-callerid-preview','calleridpreview','sipcalluniqueid','parse','sipcallid','[syncVarSet][VoiceCallReport]','endtime','answertime','billableseconds','omit','user:%s','user:agentcomplete','custom:voiceCallReport','[syncHangup][VoiceCallReport]','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransferercalleridnum','origtransfereruniqueid','transfereecalleridnum','extension','BlindTransfer','[syncBlindTransfer][VoiceCallReport]','mohstarttime','[syncMusicOnHoldStart][VoiceCallReport]','syncMusicOnHoldStop','mohtime','milliseconds','[syncMusicOnHoldStop][VoiceCallReport]','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','../ami','../model/channel','invalid','unavailable','ringinuse','set','queue','agi','dial','playback','voicemail','FAILED','NO\x20ANSWER','ANSWERED','BUSY','redis','defaults'];(function(_0x48f1fd,_0x55e76c){var _0x3c2ed1=function(_0x45c36c){while(--_0x45c36c){_0x48f1fd['push'](_0x48f1fd['shift']());}};_0x3c2ed1(++_0x55e76c);}(_0x5b40,0x111));var _0x05b4=function(_0x24ece4,_0x122777){_0x24ece4=_0x24ece4-0x0;var _0x364660=_0x5b40[_0x24ece4];return _0x364660;};'use strict';var BPromise=require('bluebird');var _=require(_0x05b4('0x0'));var moment=require(_0x05b4('0x1'));var util=require(_0x05b4('0x2'));var path=require('path');var Redis=require(_0x05b4('0x3'));var config=require(_0x05b4('0x4'));var logger=require(_0x05b4('0x5'))('ami');var ami=require(_0x05b4('0x6'));var Channel=require(_0x05b4('0x7'));var statusDesc=['unknown','not_inuse','inuse','busy',_0x05b4('0x8'),_0x05b4('0x9'),'ringing',_0x05b4('0xa'),'onhold'];var applications=[_0x05b4('0xb'),_0x05b4('0xc'),_0x05b4('0xd'),_0x05b4('0xe'),_0x05b4('0xf'),_0x05b4('0x10')];var dispositions=['NO\x20ANSWER',_0x05b4('0x11'),_0x05b4('0x11'),_0x05b4('0x12'),_0x05b4('0x12'),'NO\x20ANSWER',_0x05b4('0x13'),_0x05b4('0x14'),_0x05b4('0x11'),_0x05b4('0x11'),'FAILED'];var actions={};config[_0x05b4('0x15')]=_[_0x05b4('0x16')](config[_0x05b4('0x15')],{'host':'localhost','port':0x18eb});var io=require(_0x05b4('0x17'))(new Redis(config[_0x05b4('0x15')]));function VoiceCallReport(_0x45aee1){this['channels']=_0x45aee1[_0x05b4('0x18')];this[_0x05b4('0x19')]=_0x45aee1[_0x05b4('0x19')];ami['on']('coreshowchannel',this[_0x05b4('0x1a')][_0x05b4('0x1b')](this));ami['on']('newexten',this[_0x05b4('0x1a')][_0x05b4('0x1b')](this));ami['on'](_0x05b4('0x1c'),this['syncNewChannel'][_0x05b4('0x1b')](this));ami['on'](_0x05b4('0x1d'),this[_0x05b4('0x1e')][_0x05b4('0x1b')](this));ami['on'](_0x05b4('0x1f'),this[_0x05b4('0x20')][_0x05b4('0x1b')](this));ami['on'](_0x05b4('0x21'),this[_0x05b4('0x22')][_0x05b4('0x1b')](this));ami['on'](_0x05b4('0x23'),this['syncNewCallerId'][_0x05b4('0x1b')](this));ami['on']('attendedtransfer',this[_0x05b4('0x24')]['bind'](this));ami['on'](_0x05b4('0x25'),this[_0x05b4('0x26')][_0x05b4('0x1b')](this));ami['on'](_0x05b4('0x27'),this[_0x05b4('0x28')][_0x05b4('0x1b')](this));ami['on'](_0x05b4('0x29'),this['syncMusicOnHoldStop'][_0x05b4('0x1b')](this));return BPromise[_0x05b4('0x2a')]()['then'](ami[_0x05b4('0x2b')]())[_0x05b4('0x2c')](function(_0x25c380){console[_0x05b4('0x2d')](_0x25c380);});}VoiceCallReport['prototype'][_0x05b4('0x2e')]=function(_0x408de9){return _0x408de9!==null&&!_['isUndefined'](_0x408de9);};VoiceCallReport[_0x05b4('0x2f')][_0x05b4('0x30')]=function(_0x15582a,_0x49a940,_0x149e25){io['to'](_0x15582a)[_0x05b4('0x30')](_0x49a940,_0x149e25);};VoiceCallReport[_0x05b4('0x2f')][_0x05b4('0x31')]=function(_0x57586a){try{if(this[_0x05b4('0x2e')](_0x57586a)){if(_0x57586a['uniqueid']===_0x57586a[_0x05b4('0x32')]){if(!_['isUndefined'](this[_0x05b4('0x18')][_0x57586a[_0x05b4('0x33')]])){_[_0x05b4('0x34')](this[_0x05b4('0x18')][_0x57586a[_0x05b4('0x33')]],_[_0x05b4('0x35')](_0x57586a,_[_0x05b4('0x36')](this[_0x05b4('0x18')][_0x57586a[_0x05b4('0x33')]])));}}}}catch(_0x5ae2ea){logger[_0x05b4('0x37')]('[syncNewCallerId][VoiceCallReport]',util[_0x05b4('0x38')](_0x5ae2ea,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x05b4('0x39')]=function(_0x2b28d8){try{if(this[_0x05b4('0x2e')](_0x2b28d8)){if(_0x2b28d8[_0x05b4('0x33')]===_0x2b28d8[_0x05b4('0x32')]&&_0x2b28d8[_0x05b4('0x3a')]!=_0x05b4('0x3b')){if(_[_0x05b4('0x3c')](this[_0x05b4('0x18')][_0x2b28d8['uniqueid']])){this['channels'][_0x2b28d8[_0x05b4('0x33')]]=new Channel();this[_0x05b4('0x18')][_0x2b28d8['uniqueid']][_0x05b4('0x3d')]=moment()[_0x05b4('0x3e')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x2b28d8[_0x05b4('0x33')]]['disposition']=dispositions[_[_0x05b4('0x3f')](_0x2b28d8[_0x05b4('0x40')])];_['merge'](this['channels'][_0x2b28d8['uniqueid']],_[_0x05b4('0x35')](_0x2b28d8,_[_0x05b4('0x36')](this[_0x05b4('0x18')][_0x2b28d8['uniqueid']])));if(_0x2b28d8[_0x05b4('0x41')]===_0x05b4('0x42')){if(this['agents'][_0x2b28d8[_0x05b4('0x3a')][_0x05b4('0x43')]('-')[0x0]]){this[_0x05b4('0x19')][_0x2b28d8['channel'][_0x05b4('0x43')]('-')[0x0]][_0x05b4('0x44')]=_0x2b28d8[_0x05b4('0x45')];this[_0x05b4('0x30')](util[_0x05b4('0x3e')]('user:%s',this['agents'][_0x2b28d8[_0x05b4('0x3a')][_0x05b4('0x43')]('-')[0x0]][_0x05b4('0x46')]),_0x05b4('0x47'),{'destaccountcode':this[_0x05b4('0x19')][_0x2b28d8[_0x05b4('0x3a')][_0x05b4('0x43')]('-')[0x0]][_0x05b4('0x48')],'destconnectedlinenum':_0x2b28d8['exten']});}}}}}}catch(_0x5347a5){logger[_0x05b4('0x37')](_0x05b4('0x49'),util[_0x05b4('0x38')](_0x5347a5,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x05b4('0x2f')][_0x05b4('0x1a')]=function(_0x4588a6){try{if(this[_0x05b4('0x2e')](_0x4588a6)){if(_0x4588a6[_0x05b4('0x33')]===_0x4588a6['linkedid']&&_0x4588a6[_0x05b4('0x45')]!='h'&&_0x4588a6[_0x05b4('0x3a')]!=_0x05b4('0x3b')){_0x4588a6[_0x05b4('0x4a')]=_0x4588a6[_0x05b4('0x4a')]['toLowerCase']();_0x4588a6[_0x05b4('0x4b')]=(_0x4588a6[_0x05b4('0x4c')]||_0x4588a6[_0x05b4('0x4b')])[_0x05b4('0x4d')]();if(_[_0x05b4('0x3c')](this['channels'][_0x4588a6[_0x05b4('0x33')]])){this[_0x05b4('0x18')][_0x4588a6[_0x05b4('0x33')]]=new Channel();this['channels'][_0x4588a6['uniqueid']]['starttime']=_0x4588a6['duration']?moment()[_0x05b4('0x4e')](moment[_0x05b4('0x4f')](_0x4588a6[_0x05b4('0x4f')])[_0x05b4('0x50')](),'seconds')[_0x05b4('0x3e')](_0x05b4('0x51')):moment()[_0x05b4('0x3e')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x05b4('0x18')][_0x4588a6[_0x05b4('0x33')]][_0x05b4('0x52')]='NO\x20ANSWER';}_['merge'](this[_0x05b4('0x18')][_0x4588a6[_0x05b4('0x33')]],_[_0x05b4('0x35')](_0x4588a6,_[_0x05b4('0x36')](this[_0x05b4('0x18')][_0x4588a6['uniqueid']])));if(_['includes'](applications,_0x4588a6[_0x05b4('0x4a')])){this[_0x05b4('0x18')][_0x4588a6[_0x05b4('0x33')]][_0x05b4('0x53')]=_0x4588a6['application'];this['channels'][_0x4588a6[_0x05b4('0x33')]]['lastdata']=_0x4588a6['applicationdata'];if(_0x4588a6[_0x05b4('0x4a')]===_0x05b4('0xb')&&_['startsWith'](_0x4588a6[_0x05b4('0x4b')],_0x05b4('0x54'))){var _0x1330f4=_0x4588a6[_0x05b4('0x4b')][_0x05b4('0x43')]('=');var _0x5d1f6b=_0x1330f4[0x0]['match'](/cdr\((.*)\)/);if(_0x5d1f6b){this[_0x05b4('0x18')][_0x4588a6[_0x05b4('0x33')]][_0x5d1f6b[0x1]]=_0x1330f4[0x1];}}else if(_0x4588a6[_0x05b4('0x4a')]==='queue'){this[_0x05b4('0x18')][_0x4588a6['uniqueid']][_0x05b4('0xc')]=_0x4588a6[_0x05b4('0x4b')][_0x05b4('0x43')](',')[0x0];}}}}}catch(_0x1707a2){logger[_0x05b4('0x37')](_0x05b4('0x55'),util[_0x05b4('0x38')](_0x1707a2,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x05b4('0x2f')][_0x05b4('0x1e')]=function(_0x1f0b5b){try{if(this[_0x05b4('0x2e')](_0x1f0b5b)){if(_0x1f0b5b[_0x05b4('0x33')]!==_0x1f0b5b[_0x05b4('0x32')]){if(this[_0x05b4('0x18')][_0x1f0b5b[_0x05b4('0x32')]]){if(_0x1f0b5b[_0x05b4('0x40')]==='6'){if(!this['channels'][_0x1f0b5b[_0x05b4('0x32')]][_0x05b4('0x56')]){var _0x48119e=moment();this[_0x05b4('0x18')][_0x1f0b5b[_0x05b4('0x32')]]['answered']=!![];this['channels'][_0x1f0b5b['linkedid']]['answertime']=_0x48119e[_0x05b4('0x3e')]('YYYY-MM-DD\x20HH:mm:ss');if(this[_0x05b4('0x18')][_0x1f0b5b[_0x05b4('0x32')]][_0x05b4('0x3d')]){this[_0x05b4('0x18')][_0x1f0b5b[_0x05b4('0x32')]][_0x05b4('0x57')]=_0x48119e[_0x05b4('0x58')](this['channels'][_0x1f0b5b[_0x05b4('0x32')]][_0x05b4('0x3d')],_0x05b4('0x50'));}}this['channels'][_0x1f0b5b[_0x05b4('0x32')]][_0x05b4('0x32')]=_0x1f0b5b[_0x05b4('0x33')];if(_0x1f0b5b[_0x05b4('0x59')]!==_0x05b4('0x5a')){this[_0x05b4('0x18')][_0x1f0b5b[_0x05b4('0x32')]][_0x05b4('0x5b')]=_0x1f0b5b['calleridnum'];}this[_0x05b4('0x18')][_0x1f0b5b[_0x05b4('0x32')]][_0x05b4('0x5c')]=_0x1f0b5b[_0x05b4('0x5d')];this[_0x05b4('0x18')][_0x1f0b5b[_0x05b4('0x32')]]['destinationchannel']=_0x1f0b5b[_0x05b4('0x3a')];this['channels'][_0x1f0b5b[_0x05b4('0x32')]][_0x05b4('0x52')]=dispositions[_['toNumber'](_0x1f0b5b['channelstate'])];if(this[_0x05b4('0x19')][_0x1f0b5b[_0x05b4('0x3a')]['split']('-')[0x0]]){this[_0x05b4('0x18')][_0x1f0b5b['linkedid']][_0x05b4('0x5e')]=this[_0x05b4('0x19')][_0x1f0b5b[_0x05b4('0x3a')][_0x05b4('0x43')]('-')[0x0]]['id'];this[_0x05b4('0x18')][_0x1f0b5b[_0x05b4('0x32')]][_0x05b4('0x5f')]=this['agents'][_0x1f0b5b[_0x05b4('0x3a')][_0x05b4('0x43')]('-')[0x0]][_0x05b4('0x46')];}}}}else{if(this[_0x05b4('0x18')][_0x1f0b5b[_0x05b4('0x33')]]){if(_0x1f0b5b[_0x05b4('0x40')]==='6'){if(this[_0x05b4('0x19')][_0x1f0b5b[_0x05b4('0x3a')][_0x05b4('0x43')]('-')[0x0]]){this[_0x05b4('0x18')][_0x1f0b5b[_0x05b4('0x33')]][_0x05b4('0x5e')]=this[_0x05b4('0x19')][_0x1f0b5b[_0x05b4('0x3a')]['split']('-')[0x0]]['id'];this[_0x05b4('0x18')][_0x1f0b5b['uniqueid']][_0x05b4('0x5f')]=this[_0x05b4('0x19')][_0x1f0b5b['channel'][_0x05b4('0x43')]('-')[0x0]]['name'];}}}}}}catch(_0x40c126){logger[_0x05b4('0x37')](_0x05b4('0x60'),util['inspect'](_0x40c126,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x05b4('0x2f')][_0x05b4('0x61')]=function(_0x27db53,_0x506ff7){if(this[_0x05b4('0x18')][_0x27db53]){this[_0x05b4('0x18')][_0x27db53][_0x05b4('0x62')]=!![];if(_[_0x05b4('0x63')](_0x506ff7,'.wav49')){_0x506ff7=_0x506ff7['replace'](_0x05b4('0x64'),'.WAV');}this['channels'][_0x27db53]['monitorFilename']=_0x506ff7;var _0x40644a=_['find'](this[_0x05b4('0x18')][_0x27db53][_0x05b4('0x65')],{'filename':_0x506ff7});if(_[_0x05b4('0x66')](_0x40644a)){this['channels'][_0x27db53][_0x05b4('0x65')][_0x05b4('0x67')]({'filename':_0x506ff7,'createdAt':moment()[_0x05b4('0x3e')](_0x05b4('0x51')),'mixmonitorid':'','status':_0x05b4('0x68')});}}};VoiceCallReport[_0x05b4('0x2f')]['syncVarSet']=function(_0x226bff){try{if(this[_0x05b4('0x2e')](_0x226bff)){if(this[_0x05b4('0x18')][_0x226bff[_0x05b4('0x33')]]&&_0x226bff[_0x05b4('0x3a')]!=_0x05b4('0x3b')){if(this[_0x05b4('0x2e')](_0x226bff[_0x05b4('0x69')])){if(this[_0x05b4('0x2e')](_0x226bff['variable'][_0x05b4('0x6a')])){this[_0x05b4('0x61')](_0x226bff['uniqueid'],_0x226bff[_0x05b4('0x6b')]);}else if(this[_0x05b4('0x2e')](_0x226bff[_0x05b4('0x69')][_0x05b4('0x6c')])){this[_0x05b4('0x18')][_0x226bff[_0x05b4('0x33')]]['calleridnum']=_0x226bff['value'];}else if(this[_0x05b4('0x2e')](_0x226bff[_0x05b4('0x69')][_0x05b4('0x6d')])){this[_0x05b4('0x18')][_0x226bff['uniqueid']][_0x05b4('0x6e')]=_0x226bff['value'];}else if(this['isNotNull'](_0x226bff[_0x05b4('0x69')][_0x05b4('0x6f')])){this['channels'][_0x226bff[_0x05b4('0x33')]][_0x05b4('0x70')]=_0x226bff[_0x05b4('0x6b')];}else if(this[_0x05b4('0x2e')](_0x226bff[_0x05b4('0x69')][_0x05b4('0x71')])){this['channels'][_0x226bff[_0x05b4('0x33')]][_0x05b4('0xc')]=_0x226bff[_0x05b4('0x6b')]['split'](',')[0x0];}else if(this['isNotNull'](_0x226bff[_0x05b4('0x69')][_0x05b4('0x72')])){this[_0x05b4('0x18')][_0x226bff[_0x05b4('0x33')]]['originatecalleridnum']=_0x226bff[_0x05b4('0x6b')];}else if(this[_0x05b4('0x2e')](_0x226bff[_0x05b4('0x69')]['xmd-destination'])){this[_0x05b4('0x18')][_0x226bff[_0x05b4('0x33')]][_0x05b4('0x73')]=_0x226bff['value'];}else if(this[_0x05b4('0x2e')](_0x226bff[_0x05b4('0x69')][_0x05b4('0x74')])){this[_0x05b4('0x18')][_0x226bff[_0x05b4('0x33')]][_0x05b4('0x75')]=_0x226bff[_0x05b4('0x6b')];}else if(this[_0x05b4('0x2e')](_0x226bff[_0x05b4('0x69')]['xmcs-queue'])){this[_0x05b4('0x18')][_0x226bff[_0x05b4('0x33')]][_0x05b4('0xc')]=_0x226bff[_0x05b4('0x6b')];}else if(this['isNotNull'](_0x226bff[_0x05b4('0x69')]['sipcallid'])){this[_0x05b4('0x18')][_0x226bff[_0x05b4('0x33')]][_0x05b4('0x76')]=_0x226bff[_0x05b4('0x6b')];}}}else if(this[_0x05b4('0x2e')](_0x226bff[_0x05b4('0x69')]['mixmonitor_filename'])){if(_0x226bff[_0x05b4('0x6b')]){var _0x2d34d8=path[_0x05b4('0x77')](_0x226bff['value'])['name'];this['syncMixMonitorFilename'](_0x2d34d8,_0x226bff[_0x05b4('0x6b')]);}}else if(this[_0x05b4('0x18')][_0x226bff[_0x05b4('0x32')]]){if(this[_0x05b4('0x2e')](_0x226bff[_0x05b4('0x69')])){if(this[_0x05b4('0x2e')](_0x226bff[_0x05b4('0x69')][_0x05b4('0x78')])){this['channels'][_0x226bff[_0x05b4('0x32')]]['sipcalllinkedid']=_0x226bff[_0x05b4('0x6b')];}}}}}catch(_0x2ac643){logger[_0x05b4('0x37')](_0x05b4('0x79'),util[_0x05b4('0x38')](_0x2ac643,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x05b4('0x2f')][_0x05b4('0x22')]=function(_0xe1c283){try{if(this[_0x05b4('0x2e')](_0xe1c283)){if(this['channels'][_0xe1c283[_0x05b4('0x33')]]){var _0x3e0543=moment();this[_0x05b4('0x18')][_0xe1c283[_0x05b4('0x33')]][_0x05b4('0x7a')]=_0x3e0543[_0x05b4('0x3e')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0xe1c283['uniqueid']][_0x05b4('0x4f')]=_0x3e0543[_0x05b4('0x58')](this['channels'][_0xe1c283[_0x05b4('0x33')]][_0x05b4('0x3d')],'seconds');if(this['channels'][_0xe1c283[_0x05b4('0x33')]][_0x05b4('0x56')]){this[_0x05b4('0x18')][_0xe1c283[_0x05b4('0x33')]]['billableseconds']=_0x3e0543[_0x05b4('0x58')](this[_0x05b4('0x18')][_0xe1c283[_0x05b4('0x33')]][_0x05b4('0x7b')],_0x05b4('0x50'));this[_0x05b4('0x18')][_0xe1c283[_0x05b4('0x33')]][_0x05b4('0x57')]=this[_0x05b4('0x18')][_0xe1c283[_0x05b4('0x33')]][_0x05b4('0x4f')]-this[_0x05b4('0x18')][_0xe1c283[_0x05b4('0x33')]][_0x05b4('0x7c')];}if(_0xe1c283[_0x05b4('0x41')]===_0x05b4('0x42')){if(this['agents'][_0xe1c283['channel'][_0x05b4('0x43')]('-')[0x0]]){this[_0x05b4('0x19')][_0xe1c283[_0x05b4('0x3a')]['split']('-')[0x0]]=_[_0x05b4('0x7d')](this[_0x05b4('0x19')][_0xe1c283[_0x05b4('0x3a')][_0x05b4('0x43')]('-')[0x0]],[_0x05b4('0x44')]);this['emit'](util[_0x05b4('0x3e')](_0x05b4('0x7e'),this[_0x05b4('0x19')][_0xe1c283[_0x05b4('0x3a')][_0x05b4('0x43')]('-')[0x0]]['name']),_0x05b4('0x7f'),{'destaccountcode':this[_0x05b4('0x19')][_0xe1c283[_0x05b4('0x3a')][_0x05b4('0x43')]('-')[0x0]][_0x05b4('0x48')]});}}ami[_0x05b4('0x30')](_0x05b4('0x80'),this[_0x05b4('0x18')][_0xe1c283[_0x05b4('0x33')]]);delete this[_0x05b4('0x18')][_0xe1c283[_0x05b4('0x33')]];}}}catch(_0x5a75de){logger[_0x05b4('0x37')](_0x05b4('0x81'),util[_0x05b4('0x38')](_0x5a75de,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x05b4('0x2f')][_0x05b4('0x24')]=function(_0x298ac4){try{if(this['isNotNull'](_0x298ac4)){if(this[_0x05b4('0x18')][_0x298ac4[_0x05b4('0x82')]]){this['channels'][_0x298ac4['transfereeuniqueid']][_0x05b4('0x83')]=_0x298ac4['origtransferercalleridnum'];this[_0x05b4('0x18')][_0x298ac4['transfereeuniqueid']][_0x05b4('0x84')]=_0x298ac4[_0x05b4('0x85')];if(this[_0x05b4('0x18')][_0x298ac4[_0x05b4('0x86')]]){var _0x48fdf7=this[_0x05b4('0x18')][_0x298ac4[_0x05b4('0x86')]];this[_0x05b4('0x18')][_0x298ac4[_0x05b4('0x86')]]=this['channels'][_0x298ac4[_0x05b4('0x82')]];this[_0x05b4('0x18')][_0x298ac4[_0x05b4('0x82')]]=_0x48fdf7;}}else if(this['channels'][_0x298ac4[_0x05b4('0x87')]]){this[_0x05b4('0x18')][_0x298ac4[_0x05b4('0x87')]][_0x05b4('0x83')]=_0x298ac4[_0x05b4('0x88')];this[_0x05b4('0x18')][_0x298ac4[_0x05b4('0x87')]][_0x05b4('0x84')]=_0x298ac4['transfertargetcalleridnum'];if(this[_0x05b4('0x18')][_0x298ac4['origtransfereruniqueid']]){var _0x48fdf7=this[_0x05b4('0x18')][_0x298ac4[_0x05b4('0x89')]];this['channels'][_0x298ac4[_0x05b4('0x89')]]=this[_0x05b4('0x18')][_0x298ac4[_0x05b4('0x87')]];this[_0x05b4('0x18')][_0x298ac4[_0x05b4('0x87')]]=_0x48fdf7;}}}}catch(_0x5ea136){logger[_0x05b4('0x37')]('[syncAttendedTransfer][VoiceCallReport]',util[_0x05b4('0x38')](_0x5ea136,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x05b4('0x2f')][_0x05b4('0x26')]=function(_0x5f0381){try{if(this[_0x05b4('0x2e')](_0x5f0381)){if(this[_0x05b4('0x18')][_0x5f0381[_0x05b4('0x82')]]){this[_0x05b4('0x18')][_0x5f0381[_0x05b4('0x82')]]['transfercalleridnum']=_0x5f0381[_0x05b4('0x8a')];this['channels'][_0x5f0381[_0x05b4('0x82')]][_0x05b4('0x84')]=_0x5f0381[_0x05b4('0x8b')];this[_0x05b4('0x22')]({'event':_0x05b4('0x8c'),'uniqueid':_0x5f0381[_0x05b4('0x82')],'context':_0x5f0381[_0x05b4('0x41')],'channel':_0x5f0381['transfererchannel']});}}}catch(_0x56f088){logger[_0x05b4('0x37')](_0x05b4('0x8d'),util[_0x05b4('0x38')](_0x56f088,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x05b4('0x2f')][_0x05b4('0x28')]=function(_0x4e9124){try{if(this[_0x05b4('0x2e')](_0x4e9124)){if(this['channels'][_0x4e9124[_0x05b4('0x33')]]){if(!_[_0x05b4('0x66')](this['channels'][_0x4e9124[_0x05b4('0x33')]][_0x05b4('0x7b')])){this[_0x05b4('0x18')][_0x4e9124['uniqueid']][_0x05b4('0x8e')]=moment()[_0x05b4('0x3e')](_0x05b4('0x51'));}}}}catch(_0x2f09fb){logger['error'](_0x05b4('0x8f'),util['inspect'](_0x2f09fb,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x05b4('0x90')]=function(_0x2083fb){try{if(this['isNotNull'](_0x2083fb)){if(this[_0x05b4('0x18')][_0x2083fb['uniqueid']]){if(!_[_0x05b4('0x66')](this['channels'][_0x2083fb[_0x05b4('0x33')]][_0x05b4('0x8e')])){this[_0x05b4('0x18')][_0x2083fb['uniqueid']][_0x05b4('0x91')]+=moment()[_0x05b4('0x92')](0x0)[_0x05b4('0x58')](this[_0x05b4('0x18')][_0x2083fb['uniqueid']][_0x05b4('0x8e')],_0x05b4('0x50'));delete this[_0x05b4('0x18')][_0x2083fb['uniqueid']][_0x05b4('0x8e')];}}}}catch(_0x42d59c){logger[_0x05b4('0x37')](_0x05b4('0x93'),util[_0x05b4('0x38')](_0x42d59c,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport; \ No newline at end of file +var _0x96f1=['actionCoreShowChannels','catch','log','isUndefined','prototype','emit','isNotNull','uniqueid','pick','keys','error','[syncNewCallerId][VoiceCallReport]','inspect','linkedid','channel','OutgoingSpoolFailed','starttime','format','YYYY-MM-DD\x20HH:mm:ss','toNumber','from-sip','split','destconnectedlinenum','user:%s','name','user:agentconnect','accountcode','exten','application','toLowerCase','applicationdata','duration','seconds','disposition','lastdata','set','startsWith','match','[syncNewExten][VoiceCallReport]','syncNewState','channelstate','answered','diff','calleridnum','xcally-motion-preview','connectedlinenum','connectedlinename','calleridname','destinationchannel','UserId','membername','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','monitor','endsWith','.wav49','.WAV','monitorFilename','monitors','isNil','push','rec','variable','mixmonitor_filename','xmd-phone','value','xmd-callerid','callerid','xmd-cdrtype','type','xmd-originatecalleridnum','originatecalleridnum','xmd-destination','xmd-callerid-preview','calleridpreview','xmcs-queue','parse','sipcallid','sipcalllinkedid','endtime','billableseconds','answertime','context','omit','user:agentcomplete','custom:voiceCallReport','[syncHangup][VoiceCallReport]','syncAttendedTransfer','transfereeuniqueid','transfercalleridnum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransferercalleridnum','transferconnectedlinenum','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','transfereecalleridnum','extension','BlindTransfer','[syncBlindTransfer][VoiceCallReport]','mohstarttime','[syncMusicOnHoldStart][VoiceCallReport]','milliseconds','[syncMusicOnHoldStop][VoiceCallReport]','exports','bluebird','lodash','moment','util','path','ioredis','../../../config/environment','../../../config/logger','../model/channel','unknown','not_inuse','inuse','busy','unavailable','ringing','ringinuse','onhold','queue','dial','voicemail','NO\x20ANSWER','ANSWERED','BUSY','FAILED','redis','socket.io-emitter','channels','agents','coreshowchannel','bind','newexten','syncNewExten','syncNewChannel','newstate','varset','hangup','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','blindtransfer','syncBlindTransfer','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','resolve','then'];(function(_0x40af23,_0x47c91f){var _0x14da5=function(_0x550e02){while(--_0x550e02){_0x40af23['push'](_0x40af23['shift']());}};_0x14da5(++_0x47c91f);}(_0x96f1,0x19c));var _0x196f=function(_0x25f7b3,_0x15e939){_0x25f7b3=_0x25f7b3-0x0;var _0x8f1cb=_0x96f1[_0x25f7b3];return _0x8f1cb;};'use strict';var BPromise=require(_0x196f('0x0'));var _=require(_0x196f('0x1'));var moment=require(_0x196f('0x2'));var util=require(_0x196f('0x3'));var path=require(_0x196f('0x4'));var Redis=require(_0x196f('0x5'));var config=require(_0x196f('0x6'));var logger=require(_0x196f('0x7'))('ami');var ami=require('../ami');var Channel=require(_0x196f('0x8'));var statusDesc=[_0x196f('0x9'),_0x196f('0xa'),_0x196f('0xb'),_0x196f('0xc'),'invalid',_0x196f('0xd'),_0x196f('0xe'),_0x196f('0xf'),_0x196f('0x10')];var applications=['set',_0x196f('0x11'),'agi',_0x196f('0x12'),'playback',_0x196f('0x13')];var dispositions=['NO\x20ANSWER','FAILED','FAILED','NO\x20ANSWER',_0x196f('0x14'),_0x196f('0x14'),_0x196f('0x15'),_0x196f('0x16'),_0x196f('0x17'),_0x196f('0x17'),'FAILED'];var actions={};config[_0x196f('0x18')]=_['defaults'](config[_0x196f('0x18')],{'host':'localhost','port':0x18eb});var io=require(_0x196f('0x19'))(new Redis(config['redis']));function VoiceCallReport(_0x458d97){this[_0x196f('0x1a')]=_0x458d97[_0x196f('0x1a')];this[_0x196f('0x1b')]=_0x458d97[_0x196f('0x1b')];ami['on'](_0x196f('0x1c'),this['syncNewExten'][_0x196f('0x1d')](this));ami['on'](_0x196f('0x1e'),this[_0x196f('0x1f')][_0x196f('0x1d')](this));ami['on']('newchannel',this[_0x196f('0x20')][_0x196f('0x1d')](this));ami['on'](_0x196f('0x21'),this['syncNewState'][_0x196f('0x1d')](this));ami['on'](_0x196f('0x22'),this['syncVarSet']['bind'](this));ami['on'](_0x196f('0x23'),this[_0x196f('0x24')][_0x196f('0x1d')](this));ami['on'](_0x196f('0x25'),this[_0x196f('0x26')][_0x196f('0x1d')](this));ami['on'](_0x196f('0x27'),this['syncAttendedTransfer'][_0x196f('0x1d')](this));ami['on'](_0x196f('0x28'),this[_0x196f('0x29')]['bind'](this));ami['on']('musiconholdstart',this[_0x196f('0x2a')][_0x196f('0x1d')](this));ami['on'](_0x196f('0x2b'),this[_0x196f('0x2c')]['bind'](this));return BPromise[_0x196f('0x2d')]()[_0x196f('0x2e')](ami[_0x196f('0x2f')]())[_0x196f('0x30')](function(_0x427ac6){console[_0x196f('0x31')](_0x427ac6);});}VoiceCallReport['prototype']['isNotNull']=function(_0x37105f){return _0x37105f!==null&&!_[_0x196f('0x32')](_0x37105f);};VoiceCallReport[_0x196f('0x33')][_0x196f('0x34')]=function(_0x53fabc,_0x1d64a7,_0x18d036){io['to'](_0x53fabc)[_0x196f('0x34')](_0x1d64a7,_0x18d036);};VoiceCallReport[_0x196f('0x33')][_0x196f('0x26')]=function(_0x5a285b){try{if(this[_0x196f('0x35')](_0x5a285b)){if(_0x5a285b[_0x196f('0x36')]===_0x5a285b['linkedid']){if(!_[_0x196f('0x32')](this['channels'][_0x5a285b[_0x196f('0x36')]])){_['merge'](this[_0x196f('0x1a')][_0x5a285b[_0x196f('0x36')]],_[_0x196f('0x37')](_0x5a285b,_[_0x196f('0x38')](this['channels'][_0x5a285b[_0x196f('0x36')]])));}}}}catch(_0x380887){logger[_0x196f('0x39')](_0x196f('0x3a'),util[_0x196f('0x3b')](_0x380887,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x196f('0x33')]['syncNewChannel']=function(_0x179edf){try{if(this['isNotNull'](_0x179edf)){if(_0x179edf['uniqueid']===_0x179edf[_0x196f('0x3c')]&&_0x179edf[_0x196f('0x3d')]!=_0x196f('0x3e')){if(_[_0x196f('0x32')](this[_0x196f('0x1a')][_0x179edf['uniqueid']])){this[_0x196f('0x1a')][_0x179edf[_0x196f('0x36')]]=new Channel();this[_0x196f('0x1a')][_0x179edf[_0x196f('0x36')]][_0x196f('0x3f')]=moment()[_0x196f('0x40')](_0x196f('0x41'));this['channels'][_0x179edf[_0x196f('0x36')]]['disposition']=dispositions[_[_0x196f('0x42')](_0x179edf['channelstate'])];_['merge'](this[_0x196f('0x1a')][_0x179edf[_0x196f('0x36')]],_[_0x196f('0x37')](_0x179edf,_[_0x196f('0x38')](this[_0x196f('0x1a')][_0x179edf['uniqueid']])));if(_0x179edf['context']===_0x196f('0x43')){if(this[_0x196f('0x1b')][_0x179edf[_0x196f('0x3d')][_0x196f('0x44')]('-')[0x0]]){this['agents'][_0x179edf[_0x196f('0x3d')][_0x196f('0x44')]('-')[0x0]][_0x196f('0x45')]=_0x179edf['exten'];this['emit'](util[_0x196f('0x40')](_0x196f('0x46'),this['agents'][_0x179edf[_0x196f('0x3d')][_0x196f('0x44')]('-')[0x0]][_0x196f('0x47')]),_0x196f('0x48'),{'destaccountcode':this[_0x196f('0x1b')][_0x179edf[_0x196f('0x3d')][_0x196f('0x44')]('-')[0x0]][_0x196f('0x49')],'destconnectedlinenum':_0x179edf[_0x196f('0x4a')]});}}}}}}catch(_0x30a1b3){logger[_0x196f('0x39')]('[syncNewChannel][VoiceCallReport]',util[_0x196f('0x3b')](_0x30a1b3,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x196f('0x1f')]=function(_0x7eda40){try{if(this[_0x196f('0x35')](_0x7eda40)){if(_0x7eda40['uniqueid']===_0x7eda40[_0x196f('0x3c')]&&_0x7eda40[_0x196f('0x4a')]!='h'&&_0x7eda40[_0x196f('0x3d')]!=_0x196f('0x3e')){_0x7eda40[_0x196f('0x4b')]=_0x7eda40[_0x196f('0x4b')][_0x196f('0x4c')]();_0x7eda40[_0x196f('0x4d')]=(_0x7eda40['appdata']||_0x7eda40['applicationdata'])[_0x196f('0x4c')]();if(_['isUndefined'](this[_0x196f('0x1a')][_0x7eda40[_0x196f('0x36')]])){this['channels'][_0x7eda40[_0x196f('0x36')]]=new Channel();this[_0x196f('0x1a')][_0x7eda40[_0x196f('0x36')]][_0x196f('0x3f')]=_0x7eda40[_0x196f('0x4e')]?moment()['subtract'](moment[_0x196f('0x4e')](_0x7eda40[_0x196f('0x4e')])[_0x196f('0x4f')](),'seconds')['format']('YYYY-MM-DD\x20HH:mm:ss'):moment()[_0x196f('0x40')](_0x196f('0x41'));this[_0x196f('0x1a')][_0x7eda40[_0x196f('0x36')]][_0x196f('0x50')]=_0x196f('0x14');}_['merge'](this[_0x196f('0x1a')][_0x7eda40[_0x196f('0x36')]],_[_0x196f('0x37')](_0x7eda40,_[_0x196f('0x38')](this[_0x196f('0x1a')][_0x7eda40['uniqueid']])));if(_['includes'](applications,_0x7eda40[_0x196f('0x4b')])){this[_0x196f('0x1a')][_0x7eda40[_0x196f('0x36')]]['lastapplication']=_0x7eda40['application'];this['channels'][_0x7eda40[_0x196f('0x36')]][_0x196f('0x51')]=_0x7eda40[_0x196f('0x4d')];if(_0x7eda40['application']===_0x196f('0x52')&&_[_0x196f('0x53')](_0x7eda40[_0x196f('0x4d')],'cdr(')){var _0x4269b5=_0x7eda40[_0x196f('0x4d')][_0x196f('0x44')]('=');var _0x25dbef=_0x4269b5[0x0][_0x196f('0x54')](/cdr\((.*)\)/);if(_0x25dbef){this[_0x196f('0x1a')][_0x7eda40['uniqueid']][_0x25dbef[0x1]]=_0x4269b5[0x1];}}else if(_0x7eda40['application']===_0x196f('0x11')){this[_0x196f('0x1a')][_0x7eda40[_0x196f('0x36')]][_0x196f('0x11')]=_0x7eda40[_0x196f('0x4d')][_0x196f('0x44')](',')[0x0];}}}}}catch(_0x474c05){logger[_0x196f('0x39')](_0x196f('0x55'),util[_0x196f('0x3b')](_0x474c05,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x196f('0x33')][_0x196f('0x56')]=function(_0x10e960){try{if(this[_0x196f('0x35')](_0x10e960)){if(_0x10e960[_0x196f('0x36')]!==_0x10e960[_0x196f('0x3c')]){if(this[_0x196f('0x1a')][_0x10e960[_0x196f('0x3c')]]){if(_0x10e960[_0x196f('0x57')]==='6'){if(!this[_0x196f('0x1a')][_0x10e960[_0x196f('0x3c')]][_0x196f('0x58')]){var _0x4dd051=moment();this[_0x196f('0x1a')][_0x10e960[_0x196f('0x3c')]][_0x196f('0x58')]=!![];this[_0x196f('0x1a')][_0x10e960[_0x196f('0x3c')]]['answertime']=_0x4dd051[_0x196f('0x40')](_0x196f('0x41'));if(this[_0x196f('0x1a')][_0x10e960['linkedid']][_0x196f('0x3f')]){this[_0x196f('0x1a')][_0x10e960[_0x196f('0x3c')]]['holdtime']=_0x4dd051[_0x196f('0x59')](this['channels'][_0x10e960[_0x196f('0x3c')]][_0x196f('0x3f')],'seconds');}}this['channels'][_0x10e960[_0x196f('0x3c')]][_0x196f('0x3c')]=_0x10e960['uniqueid'];if(_0x10e960[_0x196f('0x5a')]!==_0x196f('0x5b')){this[_0x196f('0x1a')][_0x10e960[_0x196f('0x3c')]][_0x196f('0x5c')]=_0x10e960['calleridnum'];}this[_0x196f('0x1a')][_0x10e960[_0x196f('0x3c')]][_0x196f('0x5d')]=_0x10e960[_0x196f('0x5e')];this[_0x196f('0x1a')][_0x10e960[_0x196f('0x3c')]][_0x196f('0x5f')]=_0x10e960['channel'];this[_0x196f('0x1a')][_0x10e960[_0x196f('0x3c')]][_0x196f('0x50')]=dispositions[_[_0x196f('0x42')](_0x10e960[_0x196f('0x57')])];if(this['agents'][_0x10e960[_0x196f('0x3d')][_0x196f('0x44')]('-')[0x0]]){this['channels'][_0x10e960[_0x196f('0x3c')]][_0x196f('0x60')]=this[_0x196f('0x1b')][_0x10e960[_0x196f('0x3d')][_0x196f('0x44')]('-')[0x0]]['id'];this[_0x196f('0x1a')][_0x10e960['linkedid']][_0x196f('0x61')]=this[_0x196f('0x1b')][_0x10e960[_0x196f('0x3d')][_0x196f('0x44')]('-')[0x0]][_0x196f('0x47')];}}}}else{if(this[_0x196f('0x1a')][_0x10e960[_0x196f('0x36')]]){if(_0x10e960['channelstate']==='6'){if(this['agents'][_0x10e960[_0x196f('0x3d')]['split']('-')[0x0]]){this['channels'][_0x10e960[_0x196f('0x36')]][_0x196f('0x60')]=this[_0x196f('0x1b')][_0x10e960[_0x196f('0x3d')][_0x196f('0x44')]('-')[0x0]]['id'];this[_0x196f('0x1a')][_0x10e960[_0x196f('0x36')]][_0x196f('0x61')]=this[_0x196f('0x1b')][_0x10e960[_0x196f('0x3d')][_0x196f('0x44')]('-')[0x0]]['name'];}}}}}}catch(_0x436800){logger[_0x196f('0x39')](_0x196f('0x62'),util['inspect'](_0x436800,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x196f('0x33')][_0x196f('0x63')]=function(_0x17b123,_0x434285){if(this[_0x196f('0x1a')][_0x17b123]){this[_0x196f('0x1a')][_0x17b123][_0x196f('0x64')]=!![];if(_[_0x196f('0x65')](_0x434285,_0x196f('0x66'))){_0x434285=_0x434285['replace'](_0x196f('0x66'),_0x196f('0x67'));}this[_0x196f('0x1a')][_0x17b123][_0x196f('0x68')]=_0x434285;var _0x200aca=_['find'](this[_0x196f('0x1a')][_0x17b123][_0x196f('0x69')],{'filename':_0x434285});if(_[_0x196f('0x6a')](_0x200aca)){this[_0x196f('0x1a')][_0x17b123][_0x196f('0x69')][_0x196f('0x6b')]({'filename':_0x434285,'createdAt':moment()['format'](_0x196f('0x41')),'mixmonitorid':'','status':_0x196f('0x6c')});}}};VoiceCallReport[_0x196f('0x33')]['syncVarSet']=function(_0x2e33ff){try{if(this['isNotNull'](_0x2e33ff)){if(this[_0x196f('0x1a')][_0x2e33ff[_0x196f('0x36')]]&&_0x2e33ff[_0x196f('0x3d')]!='OutgoingSpoolFailed'){if(this[_0x196f('0x35')](_0x2e33ff['variable'])){if(this[_0x196f('0x35')](_0x2e33ff[_0x196f('0x6d')][_0x196f('0x6e')])){this[_0x196f('0x63')](_0x2e33ff[_0x196f('0x36')],_0x2e33ff['value']);}else if(this['isNotNull'](_0x2e33ff[_0x196f('0x6d')][_0x196f('0x6f')])){this[_0x196f('0x1a')][_0x2e33ff[_0x196f('0x36')]][_0x196f('0x5a')]=_0x2e33ff[_0x196f('0x70')];}else if(this[_0x196f('0x35')](_0x2e33ff[_0x196f('0x6d')][_0x196f('0x71')])){this[_0x196f('0x1a')][_0x2e33ff[_0x196f('0x36')]][_0x196f('0x72')]=_0x2e33ff[_0x196f('0x70')];}else if(this[_0x196f('0x35')](_0x2e33ff[_0x196f('0x6d')][_0x196f('0x73')])){this[_0x196f('0x1a')][_0x2e33ff[_0x196f('0x36')]][_0x196f('0x74')]=_0x2e33ff[_0x196f('0x70')];}else if(this['isNotNull'](_0x2e33ff[_0x196f('0x6d')]['xmd-queue'])){this['channels'][_0x2e33ff[_0x196f('0x36')]][_0x196f('0x11')]=_0x2e33ff['value']['split'](',')[0x0];}else if(this[_0x196f('0x35')](_0x2e33ff['variable'][_0x196f('0x75')])){this['channels'][_0x2e33ff[_0x196f('0x36')]][_0x196f('0x76')]=_0x2e33ff[_0x196f('0x70')];}else if(this[_0x196f('0x35')](_0x2e33ff['variable'][_0x196f('0x77')])){this[_0x196f('0x1a')][_0x2e33ff[_0x196f('0x36')]]['destination']=_0x2e33ff[_0x196f('0x70')];}else if(this['isNotNull'](_0x2e33ff[_0x196f('0x6d')][_0x196f('0x78')])){this['channels'][_0x2e33ff['uniqueid']][_0x196f('0x79')]=_0x2e33ff[_0x196f('0x70')];}else if(this[_0x196f('0x35')](_0x2e33ff[_0x196f('0x6d')][_0x196f('0x7a')])){this[_0x196f('0x1a')][_0x2e33ff[_0x196f('0x36')]][_0x196f('0x11')]=_0x2e33ff[_0x196f('0x70')];}else if(this[_0x196f('0x35')](_0x2e33ff[_0x196f('0x6d')]['sipcallid'])){this[_0x196f('0x1a')][_0x2e33ff[_0x196f('0x36')]]['sipcalluniqueid']=_0x2e33ff[_0x196f('0x70')];}}}else if(this[_0x196f('0x35')](_0x2e33ff[_0x196f('0x6d')]['mixmonitor_filename'])){if(_0x2e33ff[_0x196f('0x70')]){var _0x5a3785=path[_0x196f('0x7b')](_0x2e33ff['value'])[_0x196f('0x47')];this[_0x196f('0x63')](_0x5a3785,_0x2e33ff[_0x196f('0x70')]);}}else if(this['channels'][_0x2e33ff[_0x196f('0x3c')]]){if(this[_0x196f('0x35')](_0x2e33ff[_0x196f('0x6d')])){if(this[_0x196f('0x35')](_0x2e33ff[_0x196f('0x6d')][_0x196f('0x7c')])){this[_0x196f('0x1a')][_0x2e33ff['linkedid']][_0x196f('0x7d')]=_0x2e33ff['value'];}}}}}catch(_0x14a189){logger[_0x196f('0x39')]('[syncVarSet][VoiceCallReport]',util[_0x196f('0x3b')](_0x14a189,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x196f('0x33')][_0x196f('0x24')]=function(_0x4289b2){try{if(this[_0x196f('0x35')](_0x4289b2)){if(this[_0x196f('0x1a')][_0x4289b2[_0x196f('0x36')]]){var _0x5b7b12=moment();this[_0x196f('0x1a')][_0x4289b2[_0x196f('0x36')]][_0x196f('0x7e')]=_0x5b7b12['format'](_0x196f('0x41'));this[_0x196f('0x1a')][_0x4289b2[_0x196f('0x36')]]['duration']=_0x5b7b12['diff'](this['channels'][_0x4289b2[_0x196f('0x36')]][_0x196f('0x3f')],'seconds');if(this[_0x196f('0x1a')][_0x4289b2['uniqueid']][_0x196f('0x58')]){this['channels'][_0x4289b2[_0x196f('0x36')]][_0x196f('0x7f')]=_0x5b7b12[_0x196f('0x59')](this[_0x196f('0x1a')][_0x4289b2[_0x196f('0x36')]][_0x196f('0x80')],_0x196f('0x4f'));this[_0x196f('0x1a')][_0x4289b2[_0x196f('0x36')]]['holdtime']=this[_0x196f('0x1a')][_0x4289b2[_0x196f('0x36')]][_0x196f('0x4e')]-this[_0x196f('0x1a')][_0x4289b2['uniqueid']][_0x196f('0x7f')];}if(_0x4289b2[_0x196f('0x81')]==='from-sip'){if(this['agents'][_0x4289b2['channel']['split']('-')[0x0]]){this[_0x196f('0x1b')][_0x4289b2[_0x196f('0x3d')]['split']('-')[0x0]]=_[_0x196f('0x82')](this[_0x196f('0x1b')][_0x4289b2[_0x196f('0x3d')]['split']('-')[0x0]],[_0x196f('0x45')]);this[_0x196f('0x34')](util[_0x196f('0x40')](_0x196f('0x46'),this[_0x196f('0x1b')][_0x4289b2[_0x196f('0x3d')][_0x196f('0x44')]('-')[0x0]][_0x196f('0x47')]),_0x196f('0x83'),{'destaccountcode':this[_0x196f('0x1b')][_0x4289b2[_0x196f('0x3d')][_0x196f('0x44')]('-')[0x0]][_0x196f('0x49')]});}}ami[_0x196f('0x34')](_0x196f('0x84'),this[_0x196f('0x1a')][_0x4289b2[_0x196f('0x36')]]);delete this['channels'][_0x4289b2['uniqueid']];}}}catch(_0x2d6a66){logger['error'](_0x196f('0x85'),util['inspect'](_0x2d6a66,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x196f('0x33')][_0x196f('0x86')]=function(_0xef2787){try{if(this[_0x196f('0x35')](_0xef2787)){if(this[_0x196f('0x1a')][_0xef2787[_0x196f('0x87')]]){this[_0x196f('0x1a')][_0xef2787[_0x196f('0x87')]][_0x196f('0x88')]=_0xef2787['origtransferercalleridnum'];this[_0x196f('0x1a')][_0xef2787[_0x196f('0x87')]]['transferconnectedlinenum']=_0xef2787[_0x196f('0x89')];if(this[_0x196f('0x1a')][_0xef2787[_0x196f('0x8a')]]){var _0x33cbb6=this['channels'][_0xef2787[_0x196f('0x8a')]];this[_0x196f('0x1a')][_0xef2787[_0x196f('0x8a')]]=this[_0x196f('0x1a')][_0xef2787[_0x196f('0x87')]];this[_0x196f('0x1a')][_0xef2787[_0x196f('0x87')]]=_0x33cbb6;}}else if(this[_0x196f('0x1a')][_0xef2787['transfertargetuniqueid']]){this[_0x196f('0x1a')][_0xef2787[_0x196f('0x8b')]][_0x196f('0x88')]=_0xef2787[_0x196f('0x8c')];this[_0x196f('0x1a')][_0xef2787[_0x196f('0x8b')]][_0x196f('0x8d')]=_0xef2787[_0x196f('0x89')];if(this[_0x196f('0x1a')][_0xef2787[_0x196f('0x8e')]]){var _0x33cbb6=this['channels'][_0xef2787[_0x196f('0x8e')]];this[_0x196f('0x1a')][_0xef2787[_0x196f('0x8e')]]=this[_0x196f('0x1a')][_0xef2787[_0x196f('0x8b')]];this[_0x196f('0x1a')][_0xef2787[_0x196f('0x8b')]]=_0x33cbb6;}}}}catch(_0x2b3de9){logger[_0x196f('0x39')](_0x196f('0x8f'),util[_0x196f('0x3b')](_0x2b3de9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x196f('0x33')][_0x196f('0x29')]=function(_0xf0904c){try{if(this[_0x196f('0x35')](_0xf0904c)){if(this['channels'][_0xf0904c[_0x196f('0x87')]]){this[_0x196f('0x1a')][_0xf0904c[_0x196f('0x87')]]['transfercalleridnum']=_0xf0904c[_0x196f('0x90')];this[_0x196f('0x1a')][_0xf0904c['transfereeuniqueid']][_0x196f('0x8d')]=_0xf0904c[_0x196f('0x91')];this[_0x196f('0x24')]({'event':_0x196f('0x92'),'uniqueid':_0xf0904c[_0x196f('0x87')],'context':_0xf0904c[_0x196f('0x81')],'channel':_0xf0904c['transfererchannel']});}}}catch(_0x3212c7){logger[_0x196f('0x39')](_0x196f('0x93'),util[_0x196f('0x3b')](_0x3212c7,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x196f('0x33')][_0x196f('0x2a')]=function(_0x5a1991){try{if(this[_0x196f('0x35')](_0x5a1991)){if(this[_0x196f('0x1a')][_0x5a1991[_0x196f('0x36')]]){if(!_[_0x196f('0x6a')](this['channels'][_0x5a1991[_0x196f('0x36')]][_0x196f('0x80')])){this[_0x196f('0x1a')][_0x5a1991[_0x196f('0x36')]][_0x196f('0x94')]=moment()[_0x196f('0x40')](_0x196f('0x41'));}}}}catch(_0x79933){logger[_0x196f('0x39')](_0x196f('0x95'),util[_0x196f('0x3b')](_0x79933,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x196f('0x33')][_0x196f('0x2c')]=function(_0x1b2ab3){try{if(this[_0x196f('0x35')](_0x1b2ab3)){if(this['channels'][_0x1b2ab3[_0x196f('0x36')]]){if(!_[_0x196f('0x6a')](this[_0x196f('0x1a')][_0x1b2ab3[_0x196f('0x36')]][_0x196f('0x94')])){this[_0x196f('0x1a')][_0x1b2ab3['uniqueid']]['mohtime']+=moment()[_0x196f('0x96')](0x0)['diff'](this[_0x196f('0x1a')][_0x1b2ab3[_0x196f('0x36')]][_0x196f('0x94')],_0x196f('0x4f'));delete this['channels'][_0x1b2ab3[_0x196f('0x36')]][_0x196f('0x94')];}}}}catch(_0x48a9f1){logger[_0x196f('0x39')](_0x196f('0x97'),util[_0x196f('0x3b')](_0x48a9f1,{'showHidden':![],'depth':null}));}};module[_0x196f('0x98')]=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index 6fc8a3f..0dca86a 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 _0xeb5d=['custom:dialend','voice_outbound:save','info','stringify','voice_outbound_channel:remove','[syncHangup][VoiceDialReport]','exports','moment','util','ioredis','../../../config/environment','../ami','redis','localhost','socket.io-emitter','channels','outboundChannels','outbound','variables','dialbegin','syncDialBegin','bind','dialend','syncDialEnd','varset','hangup','syncHangup','prototype','isNotNull','isUndefined','emit','merge','uniqueid','called','substring','channel','lastIndexOf','omit','event','voice:outbound','custom:dialbegin','[syncDialBegin][VoiceDialReport]','inspect','dialstatus','ANSWER','connectedlinenum','connectedlinename','YYYY-MM-DD\x20HH:mm:ss','lastevent','connect','custom:dialconnect','voice_outbound_channel:save','error','[syncDialEnd][VoiceDialReport]','addVariable','keys','value','outboundrouteid','[syncVarSet][VoiceDialReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','membercalls','memberdynamic','memberinterface','membername','memberrealtime','isNil','includes','endtime','format','duration','diff','starttime','seconds','total','answertime','answered','holdtime','billableseconds','sumHoldTime','sumBillable','sumDuration','custom:voiceDialReport'];(function(_0x3065a3,_0x413749){var _0x371b9e=function(_0x53cff3){while(--_0x53cff3){_0x3065a3['push'](_0x3065a3['shift']());}};_0x371b9e(++_0x413749);}(_0xeb5d,0x16b));var _0xdeb5=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xeb5d[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var moment=require(_0xdeb5('0x0'));var util=require(_0xdeb5('0x1'));var Redis=require(_0xdeb5('0x2'));var config=require(_0xdeb5('0x3'));var logger=require('../../../config/logger')('ami');var ami=require(_0xdeb5('0x4'));config[_0xdeb5('0x5')]=_['defaults'](config[_0xdeb5('0x5')],{'host':_0xdeb5('0x6'),'port':0x18eb});var io=require(_0xdeb5('0x7'))(new Redis(config[_0xdeb5('0x5')]));function VoiceDialReport(_0x120329){this[_0xdeb5('0x8')]=_0x120329[_0xdeb5('0x9')];this[_0xdeb5('0xa')]=_0x120329[_0xdeb5('0xa')];this[_0xdeb5('0xb')]={};ami['on'](_0xdeb5('0xc'),this[_0xdeb5('0xd')][_0xdeb5('0xe')](this));ami['on'](_0xdeb5('0xf'),this[_0xdeb5('0x10')][_0xdeb5('0xe')](this));ami['on'](_0xdeb5('0x11'),this['syncVarSet'][_0xdeb5('0xe')](this));ami['on'](_0xdeb5('0x12'),this[_0xdeb5('0x13')][_0xdeb5('0xe')](this));}VoiceDialReport[_0xdeb5('0x14')][_0xdeb5('0x15')]=function(_0x2fe452){return _0x2fe452!==null&&!_[_0xdeb5('0x16')](_0x2fe452);};VoiceDialReport['prototype'][_0xdeb5('0x17')]=function(_0x5e2853,_0xe648c0,_0x11d83a){io['to'](_0x5e2853)[_0xdeb5('0x17')](_0xe648c0,_0x11d83a);};VoiceDialReport[_0xdeb5('0x14')][_0xdeb5('0xd')]=function(_0x57e4e7){try{if(this[_0xdeb5('0x15')](_0x57e4e7)){if(this[_0xdeb5('0x8')][_0x57e4e7['uniqueid']]){_[_0xdeb5('0x18')](this[_0xdeb5('0x8')][_0x57e4e7[_0xdeb5('0x19')]],{'starttime':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0xdeb5('0x1a'),'interface':_0x57e4e7['channel'][_0xdeb5('0x1b')](0x0,_0x57e4e7[_0xdeb5('0x1c')][_0xdeb5('0x1d')]('-')),'membername':_0x57e4e7['channel'][_0xdeb5('0x1b')](_0x57e4e7['channel'][_0xdeb5('0x1d')]('/')+0x1,_0x57e4e7[_0xdeb5('0x1c')][_0xdeb5('0x1d')]('-'))},_[_0xdeb5('0x1e')](_0x57e4e7,[_0xdeb5('0x1f'),'privilege']));this[_0xdeb5('0x17')](_0xdeb5('0x20'),'voice_outbound_channel:save',this['channels'][_0x57e4e7['uniqueid']]);ami[_0xdeb5('0x17')](_0xdeb5('0x21'),this[_0xdeb5('0x8')][_0x57e4e7['uniqueid']]);}}}catch(_0x1897ec){logger['error'](_0xdeb5('0x22'),util[_0xdeb5('0x23')](_0x1897ec,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xdeb5('0x14')][_0xdeb5('0x10')]=function(_0x31684a){try{if(this[_0xdeb5('0x15')](_0x31684a)){if(this[_0xdeb5('0x8')][_0x31684a[_0xdeb5('0x19')]]){this[_0xdeb5('0x8')][_0x31684a[_0xdeb5('0x19')]]['dialstatus']=_0x31684a[_0xdeb5('0x24')];if(_0x31684a[_0xdeb5('0x24')]===_0xdeb5('0x25')){this[_0xdeb5('0x8')][_0x31684a[_0xdeb5('0x19')]]['connectedlinenum']=_0x31684a[_0xdeb5('0x26')];this[_0xdeb5('0x8')][_0x31684a['uniqueid']][_0xdeb5('0x27')]=_0x31684a['connectedlinename'];this[_0xdeb5('0x8')][_0x31684a[_0xdeb5('0x19')]]['answertime']=moment()['format'](_0xdeb5('0x28'));this[_0xdeb5('0x8')][_0x31684a[_0xdeb5('0x19')]][_0xdeb5('0x29')]=_0xdeb5('0x2a');ami['emit'](_0xdeb5('0x2b'),this[_0xdeb5('0x8')][_0x31684a[_0xdeb5('0x19')]]);}this[_0xdeb5('0x17')](_0xdeb5('0x20'),_0xdeb5('0x2c'),this[_0xdeb5('0x8')][_0x31684a[_0xdeb5('0x19')]]);}}}catch(_0xdc5772){logger[_0xdeb5('0x2d')](_0xdeb5('0x2e'),util[_0xdeb5('0x23')](_0xdc5772,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xdeb5('0x14')]['syncVarSet']=function(_0x447df1){try{if(this['isNotNull'](_0x447df1)){this[_0xdeb5('0x2f')](_0x447df1[_0xdeb5('0x19')],_[_0xdeb5('0x30')](_0x447df1['variable'])[0x0],_0x447df1[_0xdeb5('0x31')]);if(this['isNotNull'](_0x447df1['variable'])&&this[_0xdeb5('0x15')](_0x447df1['variable'][_0xdeb5('0x32')])){if(_[_0xdeb5('0x16')](this[_0xdeb5('0x8')][_0x447df1[_0xdeb5('0x19')]])){this[_0xdeb5('0x8')][_0x447df1[_0xdeb5('0x19')]]={'routeId':_0x447df1[_0xdeb5('0x31')],'variables':this[_0xdeb5('0xb')][_0x447df1['uniqueid']]};this[_0xdeb5('0x17')]('voice:outbound',_0xdeb5('0x2c'),this[_0xdeb5('0x8')][_0x447df1[_0xdeb5('0x19')]]);}}}}catch(_0x1f5864){logger[_0xdeb5('0x2d')](_0xdeb5('0x33'),util[_0xdeb5('0x23')](_0x1f5864,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xdeb5('0x14')][_0xdeb5('0x2f')]=function(_0xe0631,_0x243515,_0x319820){var _0x3a6f29=[_0xdeb5('0x34'),_0xdeb5('0x35'),'rtpaudioqosjitter',_0xdeb5('0x36'),'rtpaudioqosloss',_0xdeb5('0x37'),_0xdeb5('0x38'),_0xdeb5('0x39'),_0xdeb5('0x3a'),_0xdeb5('0x3b'),'bridgepeer','bridgepvtcallid',_0xdeb5('0x3c'),_0xdeb5('0x3d'),_0xdeb5('0x3e'),'memberlastcall',_0xdeb5('0x3f'),'memberpenalty',_0xdeb5('0x40')];if(!_[_0xdeb5('0x41')](_0x243515)&&!_[_0xdeb5('0x42')](_0x3a6f29,_0x243515)){if(_['isUndefined'](this[_0xdeb5('0xb')][_0xe0631])){this[_0xdeb5('0xb')][_0xe0631]={};}this[_0xdeb5('0xb')][_0xe0631][_0x243515]=_0x319820;}};VoiceDialReport[_0xdeb5('0x14')]['syncHangup']=function(_0x34604e){try{if(this[_0xdeb5('0x15')](_0x34604e)){if(this['channels'][_0x34604e[_0xdeb5('0x19')]]){this[_0xdeb5('0x8')][_0x34604e[_0xdeb5('0x19')]][_0xdeb5('0x43')]=moment()[_0xdeb5('0x44')](_0xdeb5('0x28'));this[_0xdeb5('0x8')][_0x34604e[_0xdeb5('0x19')]][_0xdeb5('0x45')]=moment(this[_0xdeb5('0x8')][_0x34604e['uniqueid']][_0xdeb5('0x43')])[_0xdeb5('0x46')](this[_0xdeb5('0x8')][_0x34604e[_0xdeb5('0x19')]][_0xdeb5('0x47')],_0xdeb5('0x48'));this[_0xdeb5('0x8')][_0x34604e[_0xdeb5('0x19')]][_0xdeb5('0x29')]='complete';this[_0xdeb5('0xa')][_0xdeb5('0x49')]+=0x1;if(this['channels'][_0x34604e[_0xdeb5('0x19')]][_0xdeb5('0x4a')]){this[_0xdeb5('0xa')][_0xdeb5('0x4b')]+=0x1;this['channels'][_0x34604e[_0xdeb5('0x19')]][_0xdeb5('0x4c')]=moment(this['channels'][_0x34604e['uniqueid']][_0xdeb5('0x4a')])[_0xdeb5('0x46')](this[_0xdeb5('0x8')][_0x34604e[_0xdeb5('0x19')]][_0xdeb5('0x47')],'seconds');this[_0xdeb5('0x8')][_0x34604e[_0xdeb5('0x19')]][_0xdeb5('0x4d')]=moment(this[_0xdeb5('0x8')][_0x34604e[_0xdeb5('0x19')]][_0xdeb5('0x43')])[_0xdeb5('0x46')](this[_0xdeb5('0x8')][_0x34604e[_0xdeb5('0x19')]]['answertime'],_0xdeb5('0x48'));this['outbound'][_0xdeb5('0x4e')]+=this['channels'][_0x34604e[_0xdeb5('0x19')]][_0xdeb5('0x4c')]||0x0;this[_0xdeb5('0xa')][_0xdeb5('0x4f')]+=this[_0xdeb5('0x8')][_0x34604e[_0xdeb5('0x19')]][_0xdeb5('0x4d')];}this[_0xdeb5('0xa')][_0xdeb5('0x50')]+=this[_0xdeb5('0x8')][_0x34604e[_0xdeb5('0x19')]][_0xdeb5('0x45')];ami['emit'](_0xdeb5('0x51'),this[_0xdeb5('0x8')][_0x34604e[_0xdeb5('0x19')]]);ami['emit'](_0xdeb5('0x52'),this[_0xdeb5('0x8')][_0x34604e[_0xdeb5('0x19')]]);this['emit'](_0xdeb5('0x20'),_0xdeb5('0x53'),this[_0xdeb5('0xa')]);logger[_0xdeb5('0x54')]('[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event',JSON[_0xdeb5('0x55')](this['channels'][_0x34604e[_0xdeb5('0x19')]]));this[_0xdeb5('0x17')]('voice:outbound',_0xdeb5('0x56'),this[_0xdeb5('0x8')][_0x34604e[_0xdeb5('0x19')]]);delete this[_0xdeb5('0x8')][_0x34604e[_0xdeb5('0x19')]];}if(this['variables'][_0x34604e['uniqueid']]){delete this[_0xdeb5('0xb')][_0x34604e[_0xdeb5('0x19')]];}}}catch(_0x4b472f){logger['error'](_0xdeb5('0x57'),util[_0xdeb5('0x23')](_0x4b472f,{'showHidden':![],'depth':null}));}};module[_0xdeb5('0x58')]=VoiceDialReport; \ No newline at end of file +var _0xb13b=['complete','outbound','total','answered','holdtime','billableseconds','sumHoldTime','sumBillable','sumDuration','duration','custom:voiceDialReport','custom:dialend','info','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','voice_outbound_channel:remove','[syncHangup][VoiceDialReport]','exports','lodash','moment','util','ioredis','../../../config/environment','ami','../ami','defaults','redis','localhost','socket.io-emitter','channels','outboundChannels','variables','dialbegin','syncDialBegin','bind','dialend','syncDialEnd','syncVarSet','hangup','isUndefined','prototype','emit','isNotNull','uniqueid','merge','called','lastIndexOf','channel','substring','omit','event','privilege','custom:dialbegin','error','inspect','dialstatus','ANSWER','connectedlinename','answertime','format','YYYY-MM-DD\x20HH:mm:ss','lastevent','connect','voice:outbound','[syncDialEnd][VoiceDialReport]','addVariable','keys','variable','outboundrouteid','value','voice_outbound_channel:save','[syncVarSet][VoiceDialReport]','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','membername','memberpenalty','memberrealtime','isNil','endtime','diff','starttime','seconds'];(function(_0x354cbe,_0x23f11d){var _0x2eb088=function(_0x1399cb){while(--_0x1399cb){_0x354cbe['push'](_0x354cbe['shift']());}};_0x2eb088(++_0x23f11d);}(_0xb13b,0x1de));var _0xbb13=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xb13b[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xbb13('0x0'));var moment=require(_0xbb13('0x1'));var util=require(_0xbb13('0x2'));var Redis=require(_0xbb13('0x3'));var config=require(_0xbb13('0x4'));var logger=require('../../../config/logger')(_0xbb13('0x5'));var ami=require(_0xbb13('0x6'));config['redis']=_[_0xbb13('0x7')](config[_0xbb13('0x8')],{'host':_0xbb13('0x9'),'port':0x18eb});var io=require(_0xbb13('0xa'))(new Redis(config[_0xbb13('0x8')]));function VoiceDialReport(_0xd4a4bd){this[_0xbb13('0xb')]=_0xd4a4bd[_0xbb13('0xc')];this['outbound']=_0xd4a4bd['outbound'];this[_0xbb13('0xd')]={};ami['on'](_0xbb13('0xe'),this[_0xbb13('0xf')][_0xbb13('0x10')](this));ami['on'](_0xbb13('0x11'),this[_0xbb13('0x12')][_0xbb13('0x10')](this));ami['on']('varset',this[_0xbb13('0x13')][_0xbb13('0x10')](this));ami['on'](_0xbb13('0x14'),this['syncHangup'][_0xbb13('0x10')](this));}VoiceDialReport['prototype']['isNotNull']=function(_0x3c033f){return _0x3c033f!==null&&!_[_0xbb13('0x15')](_0x3c033f);};VoiceDialReport[_0xbb13('0x16')][_0xbb13('0x17')]=function(_0x558bac,_0x11e664,_0x58f59d){io['to'](_0x558bac)[_0xbb13('0x17')](_0x11e664,_0x58f59d);};VoiceDialReport['prototype'][_0xbb13('0xf')]=function(_0x5f3ab1){try{if(this[_0xbb13('0x18')](_0x5f3ab1)){if(this['channels'][_0x5f3ab1[_0xbb13('0x19')]]){_[_0xbb13('0x1a')](this[_0xbb13('0xb')][_0x5f3ab1['uniqueid']],{'starttime':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0xbb13('0x1b'),'interface':_0x5f3ab1['channel']['substring'](0x0,_0x5f3ab1['channel'][_0xbb13('0x1c')]('-')),'membername':_0x5f3ab1[_0xbb13('0x1d')][_0xbb13('0x1e')](_0x5f3ab1[_0xbb13('0x1d')][_0xbb13('0x1c')]('/')+0x1,_0x5f3ab1[_0xbb13('0x1d')]['lastIndexOf']('-'))},_[_0xbb13('0x1f')](_0x5f3ab1,[_0xbb13('0x20'),_0xbb13('0x21')]));this[_0xbb13('0x17')]('voice:outbound','voice_outbound_channel:save',this[_0xbb13('0xb')][_0x5f3ab1[_0xbb13('0x19')]]);ami[_0xbb13('0x17')](_0xbb13('0x22'),this['channels'][_0x5f3ab1[_0xbb13('0x19')]]);}}}catch(_0x178c22){logger[_0xbb13('0x23')]('[syncDialBegin][VoiceDialReport]',util[_0xbb13('0x24')](_0x178c22,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype']['syncDialEnd']=function(_0x37a04c){try{if(this[_0xbb13('0x18')](_0x37a04c)){if(this[_0xbb13('0xb')][_0x37a04c[_0xbb13('0x19')]]){this[_0xbb13('0xb')][_0x37a04c[_0xbb13('0x19')]][_0xbb13('0x25')]=_0x37a04c[_0xbb13('0x25')];if(_0x37a04c[_0xbb13('0x25')]===_0xbb13('0x26')){this[_0xbb13('0xb')][_0x37a04c['uniqueid']]['connectedlinenum']=_0x37a04c['connectedlinenum'];this[_0xbb13('0xb')][_0x37a04c[_0xbb13('0x19')]][_0xbb13('0x27')]=_0x37a04c[_0xbb13('0x27')];this[_0xbb13('0xb')][_0x37a04c[_0xbb13('0x19')]][_0xbb13('0x28')]=moment()[_0xbb13('0x29')](_0xbb13('0x2a'));this['channels'][_0x37a04c[_0xbb13('0x19')]][_0xbb13('0x2b')]=_0xbb13('0x2c');ami[_0xbb13('0x17')]('custom:dialconnect',this[_0xbb13('0xb')][_0x37a04c['uniqueid']]);}this[_0xbb13('0x17')](_0xbb13('0x2d'),'voice_outbound_channel:save',this[_0xbb13('0xb')][_0x37a04c['uniqueid']]);}}}catch(_0x338470){logger[_0xbb13('0x23')](_0xbb13('0x2e'),util[_0xbb13('0x24')](_0x338470,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xbb13('0x16')][_0xbb13('0x13')]=function(_0x51345c){try{if(this['isNotNull'](_0x51345c)){this[_0xbb13('0x2f')](_0x51345c[_0xbb13('0x19')],_[_0xbb13('0x30')](_0x51345c[_0xbb13('0x31')])[0x0],_0x51345c['value']);if(this['isNotNull'](_0x51345c[_0xbb13('0x31')])&&this[_0xbb13('0x18')](_0x51345c['variable'][_0xbb13('0x32')])){if(_['isUndefined'](this[_0xbb13('0xb')][_0x51345c[_0xbb13('0x19')]])){this['channels'][_0x51345c['uniqueid']]={'routeId':_0x51345c[_0xbb13('0x33')],'variables':this[_0xbb13('0xd')][_0x51345c['uniqueid']]};this[_0xbb13('0x17')](_0xbb13('0x2d'),_0xbb13('0x34'),this[_0xbb13('0xb')][_0x51345c[_0xbb13('0x19')]]);}}}}catch(_0x28399c){logger[_0xbb13('0x23')](_0xbb13('0x35'),util[_0xbb13('0x24')](_0x28399c,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xbb13('0x16')][_0xbb13('0x2f')]=function(_0x3859bd,_0x1fde5e,_0x5d922d){var _0x90e2db=['rtpaudioqos','rtpaudioqosbridged',_0xbb13('0x36'),_0xbb13('0x37'),_0xbb13('0x38'),_0xbb13('0x39'),'rtpaudioqosrtt',_0xbb13('0x3a'),'sipcallid',_0xbb13('0x3b'),_0xbb13('0x3c'),_0xbb13('0x3d'),_0xbb13('0x3e'),_0xbb13('0x3f'),_0xbb13('0x40'),_0xbb13('0x41'),_0xbb13('0x42'),_0xbb13('0x43'),_0xbb13('0x44')];if(!_[_0xbb13('0x45')](_0x1fde5e)&&!_['includes'](_0x90e2db,_0x1fde5e)){if(_['isUndefined'](this[_0xbb13('0xd')][_0x3859bd])){this[_0xbb13('0xd')][_0x3859bd]={};}this[_0xbb13('0xd')][_0x3859bd][_0x1fde5e]=_0x5d922d;}};VoiceDialReport[_0xbb13('0x16')]['syncHangup']=function(_0x480c15){try{if(this['isNotNull'](_0x480c15)){if(this[_0xbb13('0xb')][_0x480c15[_0xbb13('0x19')]]){this[_0xbb13('0xb')][_0x480c15[_0xbb13('0x19')]]['endtime']=moment()[_0xbb13('0x29')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xbb13('0xb')][_0x480c15[_0xbb13('0x19')]]['duration']=moment(this[_0xbb13('0xb')][_0x480c15[_0xbb13('0x19')]][_0xbb13('0x46')])[_0xbb13('0x47')](this['channels'][_0x480c15[_0xbb13('0x19')]][_0xbb13('0x48')],_0xbb13('0x49'));this['channels'][_0x480c15[_0xbb13('0x19')]][_0xbb13('0x2b')]=_0xbb13('0x4a');this[_0xbb13('0x4b')][_0xbb13('0x4c')]+=0x1;if(this[_0xbb13('0xb')][_0x480c15[_0xbb13('0x19')]][_0xbb13('0x28')]){this[_0xbb13('0x4b')][_0xbb13('0x4d')]+=0x1;this[_0xbb13('0xb')][_0x480c15[_0xbb13('0x19')]][_0xbb13('0x4e')]=moment(this['channels'][_0x480c15[_0xbb13('0x19')]][_0xbb13('0x28')])[_0xbb13('0x47')](this[_0xbb13('0xb')][_0x480c15[_0xbb13('0x19')]][_0xbb13('0x48')],_0xbb13('0x49'));this['channels'][_0x480c15[_0xbb13('0x19')]][_0xbb13('0x4f')]=moment(this[_0xbb13('0xb')][_0x480c15[_0xbb13('0x19')]][_0xbb13('0x46')])[_0xbb13('0x47')](this[_0xbb13('0xb')][_0x480c15[_0xbb13('0x19')]][_0xbb13('0x28')],_0xbb13('0x49'));this[_0xbb13('0x4b')][_0xbb13('0x50')]+=this[_0xbb13('0xb')][_0x480c15[_0xbb13('0x19')]][_0xbb13('0x4e')]||0x0;this[_0xbb13('0x4b')][_0xbb13('0x51')]+=this['channels'][_0x480c15[_0xbb13('0x19')]][_0xbb13('0x4f')];}this[_0xbb13('0x4b')][_0xbb13('0x52')]+=this[_0xbb13('0xb')][_0x480c15[_0xbb13('0x19')]][_0xbb13('0x53')];ami[_0xbb13('0x17')](_0xbb13('0x54'),this['channels'][_0x480c15[_0xbb13('0x19')]]);ami[_0xbb13('0x17')](_0xbb13('0x55'),this[_0xbb13('0xb')][_0x480c15[_0xbb13('0x19')]]);this['emit'](_0xbb13('0x2d'),'voice_outbound:save',this['outbound']);logger[_0xbb13('0x56')](_0xbb13('0x57'),JSON[_0xbb13('0x58')](this['channels'][_0x480c15['uniqueid']]));this['emit'](_0xbb13('0x2d'),_0xbb13('0x59'),this['channels'][_0x480c15[_0xbb13('0x19')]]);delete this[_0xbb13('0xb')][_0x480c15[_0xbb13('0x19')]];}if(this[_0xbb13('0xd')][_0x480c15[_0xbb13('0x19')]]){delete this['variables'][_0x480c15[_0xbb13('0x19')]];}}}catch(_0x590a9f){logger['error'](_0xbb13('0x5a'),util[_0xbb13('0x24')](_0x590a9f,{'showHidden':![],'depth':null}));}};module[_0xbb13('0x5b')]=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index c8bc2f7..edc6506 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 _0x6f41=['queuecallerjoin','syncQueueCallerJoin','bind','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','agentconnect','syncAgentConnect','syncVarSet','hangup','syncHangup','fullybooted','syncFullyBooted','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','attendedtransfer','blindtransfer','loopQueueShow','isEmpty','hasOwnProperty','originated','talking','waiting','queueStatusComplete','unlockRR','clearZombieChannels','switch','isNil','Action','message','No\x20such\x20channel','error','[voiceQueueReport][checkQueueReport]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','campaigns','emit','emitVoiceQueueChannelSave','format','voice:queue:%s','name','info','stringify','voice_queue_channel:remove','emitVoiceQueueSummary','type','strategy','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','unmanaged','abandoned','Trunk','active','callerid','Interval','voice_queue:save','isNotNull','catch','loopQueueSummary','flagQueueSummary','then','syncQueueSummary','queue','callers','toNumber','loggedin','custom:queuesummary','[syncQueueSummary][VoiceQueueReport]','inspect','syncNewExten','uniqueid','inbound','position','count','merge','pick','keys','push','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitreason','ABANDONED','syncQueueCallerLeave','queuecallerleaveAt','connectedlinenum','connectedlinename','[syncQueueCallerLeave][VoiceQueueReport]','COMPLETEDBYAGENT','[syncAgentConnect][VoiceQueueReport]','syncAgentComplete','queuecallerabandonAt','assigned','membername','queuecallerexitAt','transfer','COMPLETED','channel','toLowerCase','linkedid','queuecallerexit','seconds','transfertype','FORWARD','transferexten','transferuniqueid','COMPLETEDBY','reason','toUpperCase','emitVoiceQueueChannelRemove','variable','queuestatus','value','CONTINUE','queueposition','EXITWITHKEY','[syncVarSet][VoiceQueueReport]','addVariable','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isUndefined','length','diff','milliseconds','total','sumBillable','custom:queuecallerunmanaged','lastevent','custom:voiceQueueReport','[syncHangup][VoiceQueueReport]','syncAttendedTransfer','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','ATTENDEDTRANSFER','ATTENDED','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[syncAttendedTransfer][VoiceQueueReport]','syncBlindTransfer','BLINDTRANSFER','extension','BlindTransfer','context','transfererchannel','[syncBlindTransfer][VoiceQueueReport]','[syncMusicOnHoldStart][VoiceQueueReport]','syncMusicOnHoldStop','mohtime','mohstarttime','exports','lodash','bluebird','util','md5','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','queueReports','agents','channels','queueChannels','voiceQueues','variables','queuesummary','queuesummarycomplete','syncQueueSummaryComplete'];(function(_0x342b78,_0x4c83d2){var _0x5400a5=function(_0x342e07){while(--_0x342e07){_0x342b78['push'](_0x342b78['shift']());}};_0x5400a5(++_0x4c83d2);}(_0x6f41,0xaa));var _0x16f4=function(_0x4d3b81,_0x4e4f8f){_0x4d3b81=_0x4d3b81-0x0;var _0x28fc23=_0x6f41[_0x4d3b81];return _0x28fc23;};'use strict';var _=require(_0x16f4('0x0'));var moment=require('moment');var BPromise=require(_0x16f4('0x1'));var util=require(_0x16f4('0x2'));var md5=require(_0x16f4('0x3'));var Redis=require(_0x16f4('0x4'));var config=require(_0x16f4('0x5'));var logger=require(_0x16f4('0x6'))(_0x16f4('0x7'));var ami=require(_0x16f4('0x8'));var QueueReport=require('../model/queueReport');config[_0x16f4('0x9')]=_[_0x16f4('0xa')](config[_0x16f4('0x9')],{'host':_0x16f4('0xb'),'port':0x18eb});var io=require(_0x16f4('0xc'))(new Redis(config[_0x16f4('0x9')]));var Sequence=function(){};Sequence[_0x16f4('0xd')][_0x16f4('0xe')]=function(_0x2089b4){this[_0x16f4('0xf')]=this[_0x16f4('0xf')]?this[_0x16f4('0xf')][_0x16f4('0x10')](_0x2089b4):_0x2089b4();};function VoiceQueueReport(_0x2e1c16){this[_0x16f4('0x11')]=new Sequence();this[_0x16f4('0x12')]={};this[_0x16f4('0x13')]=_0x2e1c16[_0x16f4('0x13')];this[_0x16f4('0x14')]=_0x2e1c16[_0x16f4('0x15')];this[_0x16f4('0x16')]=_0x2e1c16[_0x16f4('0x16')];this['flagQueueSummary']=!![];this['campaigns']=_0x2e1c16['campaigns'];this[_0x16f4('0x17')]={};ami['on'](_0x16f4('0x18'),this['syncQueueSummary']['bind'](this));ami['on'](_0x16f4('0x19'),this[_0x16f4('0x1a')]['bind'](this));ami['on'](_0x16f4('0x1b'),this[_0x16f4('0x1c')][_0x16f4('0x1d')](this));ami['on'](_0x16f4('0x1e'),this[_0x16f4('0x1f')][_0x16f4('0x1d')](this));ami['on']('queuecallerleave',this['syncQueueCallerLeave'][_0x16f4('0x1d')](this));ami['on'](_0x16f4('0x20'),this['syncAgentComplete'][_0x16f4('0x1d')](this));ami['on'](_0x16f4('0x21'),this[_0x16f4('0x22')][_0x16f4('0x1d')](this));ami['on']('varset',this[_0x16f4('0x23')][_0x16f4('0x1d')](this));ami['on'](_0x16f4('0x24'),this[_0x16f4('0x25')][_0x16f4('0x1d')](this));ami['on'](_0x16f4('0x26'),this[_0x16f4('0x27')][_0x16f4('0x1d')](this));ami['on'](_0x16f4('0x28'),this[_0x16f4('0x29')][_0x16f4('0x1d')](this));ami['on'](_0x16f4('0x2a'),this['syncMusicOnHoldStop']['bind'](this));ami['on'](_0x16f4('0x2b'),this['syncAttendedTransfer']['bind'](this));ami['on'](_0x16f4('0x2c'),this['syncBlindTransfer'][_0x16f4('0x1d')](this));this['loopQueueSummary']();this[_0x16f4('0x2d')]();}function isNotNull(_0x203ad2){return _0x203ad2!==null&&!_['isUndefined'](_0x203ad2);}function clearChannels(_0x5af1af){if(!_[_0x16f4('0x2e')](_0x5af1af)){for(var _0x140f1a in _0x5af1af){if(_0x5af1af[_0x16f4('0x2f')](_0x140f1a)){delete _0x5af1af[_0x140f1a];}}}}function clearCampaigns(_0x3c5922){if(!_['isEmpty'](_0x3c5922)){for(var _0x59851a in _0x3c5922){if(_0x3c5922[_0x16f4('0x2f')](_0x59851a)){_0x3c5922[_0x59851a][_0x16f4('0x30')]=0x0;}}}}function clearVoiceQueues(_0x2d2924){if(!_[_0x16f4('0x2e')](_0x2d2924)){for(var _0x20ccd4 in _0x2d2924){if(_0x2d2924[_0x16f4('0x2f')](_0x20ccd4)){_0x2d2924[_0x20ccd4][_0x16f4('0x30')]=0x0;_0x2d2924[_0x20ccd4][_0x16f4('0x31')]=0x0;_0x2d2924[_0x20ccd4]['pTalking']=0x0;_0x2d2924[_0x20ccd4][_0x16f4('0x32')]=0x0;_0x2d2924[_0x20ccd4][_0x16f4('0x33')]=!![];}}}}function clearAgentBooked(_0x13c7af){if(!_[_0x16f4('0x2e')](_0x13c7af)){for(var _0x3ab382 in _0x13c7af){if(_0x13c7af[_0x16f4('0x2f')](_0x3ab382)){_0x13c7af[_0x3ab382][_0x16f4('0x34')]=!![];}}}}VoiceQueueReport['prototype'][_0x16f4('0x35')]=function(){var _0x48abdc=this;for(var _0x3e38bc in this[_0x16f4('0x14')]){if(this[_0x16f4('0x14')][_0x16f4('0x2f')](_0x3e38bc)&&!this[_0x16f4('0x14')][_0x3e38bc][_0x16f4('0x36')]){this[_0x16f4('0x11')]['enqueue'](function(){if(!_[_0x16f4('0x37')](_0x48abdc[_0x16f4('0x14')][_0x3e38bc])){return ami[_0x16f4('0x38')]({'action':'status','channel':_0x48abdc[_0x16f4('0x14')][_0x3e38bc]['channel']})['catch'](function(_0x51c172){if(_0x51c172[_0x16f4('0x39')]===_0x16f4('0x3a')){setTimeout(function(){if(_0x48abdc['channels'][_0x3e38bc]){delete _0x48abdc[_0x16f4('0x14')][_0x3e38bc];logger['error']('[voiceQueueReport][checkChannel]',_0x3e38bc);}if(_0x48abdc[_0x16f4('0x12')][_0x3e38bc]){delete _0x48abdc[_0x16f4('0x12')][_0x3e38bc];logger[_0x16f4('0x3b')](_0x16f4('0x3c'),_0x3e38bc);}if(_0x48abdc[_0x16f4('0x17')][_0x3e38bc]){delete _0x48abdc[_0x16f4('0x17')][_0x3e38bc];logger[_0x16f4('0x3b')]('[voiceQueueReport][checkVariables]',_0x3e38bc);}},0x1f40);}});}});}}};VoiceQueueReport[_0x16f4('0xd')][_0x16f4('0x27')]=function(){logger['error'](_0x16f4('0x3d'));clearChannels(this[_0x16f4('0x14')]);this[_0x16f4('0x3e')](this[_0x16f4('0x12')]);clearAgentBooked(this[_0x16f4('0x13')]);clearVoiceQueues(this[_0x16f4('0x16')]);clearCampaigns(this[_0x16f4('0x3f')]);};VoiceQueueReport[_0x16f4('0xd')]['clearQueueReport']=function(_0x2a5718){var _0x11a807=this;if(!_[_0x16f4('0x2e')](_0x2a5718)){for(var _0x3f4c88 in _0x2a5718){if(_0x2a5718[_0x16f4('0x2f')](_0x3f4c88)){_0x11a807['emitVoiceQueueChannelRemove'](_0x2a5718[_0x3f4c88]);delete _0x2a5718[_0x3f4c88];}}}};function loggerCatch(_0x3c9df9){return function(_0x23df05){logger['error'](_0x3c9df9,util['inspect'](_0x23df05,{'showHidden':![],'depth':null}));};}VoiceQueueReport['prototype'][_0x16f4('0x40')]=function(_0x4fe3da,_0x3236b5,_0x523084){io['to'](_0x4fe3da)[_0x16f4('0x40')](_0x3236b5,_0x523084);};VoiceQueueReport[_0x16f4('0xd')][_0x16f4('0x41')]=function(_0x226477){this[_0x16f4('0x40')](util[_0x16f4('0x42')](_0x16f4('0x43'),_0x226477[_0x16f4('0x44')]),'voice_queue_channel:save',_0x226477);};VoiceQueueReport[_0x16f4('0xd')]['emitVoiceQueueChannelRemove']=function(_0x2e9bb0){logger[_0x16f4('0x45')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0x16f4('0x46')](_0x2e9bb0));this['emit'](util['format'](_0x16f4('0x43'),_0x2e9bb0[_0x16f4('0x44')]),_0x16f4('0x47'),_0x2e9bb0);};VoiceQueueReport['prototype'][_0x16f4('0x48')]=function(_0x46cc91){if(_0x46cc91[_0x16f4('0x49')]==='inbound'){var _0x53d417={'id':_0x46cc91['id'],'name':_0x46cc91['name'],'strategy':_0x46cc91[_0x16f4('0x4a')],'answered':_0x46cc91[_0x16f4('0x4b')],'available':_0x46cc91[_0x16f4('0x4c')],'loggedIn':_0x46cc91[_0x16f4('0x4d')],'pTalking':_0x46cc91[_0x16f4('0x4e')],'sumBillable':_0x46cc91['sumBillable'],'sumDuration':_0x46cc91[_0x16f4('0x4f')],'sumHoldTime':_0x46cc91[_0x16f4('0x50')]||0x0,'talking':_0x46cc91[_0x16f4('0x31')],'total':_0x46cc91['total'],'type':_0x46cc91[_0x16f4('0x49')],'unmanaged':_0x46cc91[_0x16f4('0x51')],'abandoned':_0x46cc91[_0x16f4('0x52')],'waiting':_0x46cc91[_0x16f4('0x32')]};if(_0x46cc91[_0x16f4('0x53')]){_0x53d417[_0x16f4('0x53')]={'id':_0x46cc91[_0x16f4('0x53')]['id'],'name':_0x46cc91['Trunk'][_0x16f4('0x44')],'active':_0x46cc91[_0x16f4('0x53')][_0x16f4('0x54')],'callerid':_0x46cc91[_0x16f4('0x53')][_0x16f4('0x55')]};}if(_0x46cc91['Interval']){_0x53d417['Interval']={'id':_0x46cc91['Interval']['id'],'name':_0x46cc91[_0x16f4('0x56')]['name']};}var _0x2a9183=md5(JSON[_0x16f4('0x46')](_0x53d417));if(_0x46cc91[_0x16f4('0x3')]!==_0x2a9183){_0x46cc91[_0x16f4('0x3')]=_0x2a9183;this[_0x16f4('0x40')](util[_0x16f4('0x42')]('voice:queue:%s',_0x53d417['name']),_0x16f4('0x57'),_0x53d417);}}};VoiceQueueReport[_0x16f4('0xd')][_0x16f4('0x58')]=function(_0x48e4c3){return _0x48e4c3!==null&&!_['isUndefined'](_0x48e4c3);};VoiceQueueReport['prototype'][_0x16f4('0x2d')]=function(){var _0x236fef=this;setInterval(function(){_0x236fef[_0x16f4('0x35')]();ami[_0x16f4('0x38')]({'action':'queues'})[_0x16f4('0x59')](loggerCatch('[queues]'));},0x2710);};VoiceQueueReport[_0x16f4('0xd')][_0x16f4('0x5a')]=function(){var _0x57a52b=this;setInterval(function(){if(_0x57a52b[_0x16f4('0x5b')]){return ami[_0x16f4('0x38')]({'action':_0x16f4('0x18')})[_0x16f4('0x5c')](function(_0x287d90){_0x57a52b[_0x16f4('0x5b')]=![];})['catch'](loggerCatch('[queuesummary]'));}},0x3e8);};VoiceQueueReport['prototype'][_0x16f4('0x5d')]=function(_0x55fe70){try{if(this[_0x16f4('0x58')](_0x55fe70)&&this[_0x16f4('0x58')](_0x55fe70['queue'])){if(this[_0x16f4('0x16')][_0x55fe70[_0x16f4('0x5e')]]){var _0x5dd56b=_['countBy'](this['channels'],'queue')[_0x55fe70[_0x16f4('0x5e')]]||0x0;var _0x50c7b9=_0x5dd56b-_0x55fe70[_0x16f4('0x5f')];if(this[_0x16f4('0x16')][_0x55fe70[_0x16f4('0x5e')]][_0x16f4('0x32')]!==_[_0x16f4('0x60')](_0x55fe70[_0x16f4('0x5f')])||this[_0x16f4('0x16')][_0x55fe70[_0x16f4('0x5e')]][_0x16f4('0x4d')]!==_['toNumber'](_0x55fe70[_0x16f4('0x61')])||this[_0x16f4('0x16')][_0x55fe70[_0x16f4('0x5e')]][_0x16f4('0x4c')]!==_[_0x16f4('0x60')](_0x55fe70[_0x16f4('0x4c')])||this[_0x16f4('0x16')][_0x55fe70[_0x16f4('0x5e')]][_0x16f4('0x31')]!==_0x50c7b9){this['voiceQueues'][_0x55fe70[_0x16f4('0x5e')]]['waiting']=_['toNumber'](_0x55fe70[_0x16f4('0x5f')]);this[_0x16f4('0x16')][_0x55fe70[_0x16f4('0x5e')]][_0x16f4('0x4d')]=_[_0x16f4('0x60')](_0x55fe70[_0x16f4('0x61')]);this[_0x16f4('0x16')][_0x55fe70[_0x16f4('0x5e')]]['available']=_['toNumber'](_0x55fe70[_0x16f4('0x4c')]);this[_0x16f4('0x16')][_0x55fe70[_0x16f4('0x5e')]][_0x16f4('0x31')]=_0x50c7b9>0x0?_0x50c7b9:0x0;this['voiceQueues'][_0x55fe70['queue']][_0x16f4('0x31')]=this[_0x16f4('0x16')][_0x55fe70['queue']]['talking']>_[_0x16f4('0x60')](_0x55fe70[_0x16f4('0x61')])?_[_0x16f4('0x60')](_0x55fe70[_0x16f4('0x61')]):this['voiceQueues'][_0x55fe70[_0x16f4('0x5e')]][_0x16f4('0x31')];this[_0x16f4('0x48')](this[_0x16f4('0x16')][_0x55fe70[_0x16f4('0x5e')]]);}ami['emit'](_0x16f4('0x62'),this[_0x16f4('0x16')][_0x55fe70[_0x16f4('0x5e')]]);}}}catch(_0x2ed9cc){logger[_0x16f4('0x3b')](_0x16f4('0x63'),util[_0x16f4('0x64')](_0x2ed9cc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x16f4('0xd')][_0x16f4('0x1a')]=function(_0x415dce){this[_0x16f4('0x5b')]=!![];};VoiceQueueReport[_0x16f4('0xd')][_0x16f4('0x65')]=function(_0x53c5c4){};VoiceQueueReport[_0x16f4('0xd')]['syncQueueCallerJoin']=function(_0x5eb4f6){try{if(this[_0x16f4('0x58')](_0x5eb4f6)){if(_['isUndefined'](this[_0x16f4('0x12')][_0x5eb4f6[_0x16f4('0x66')]])){this[_0x16f4('0x12')][_0x5eb4f6['uniqueid']]=[];this[_0x16f4('0x14')][_0x5eb4f6['uniqueid']]={};}var _0x50652f=new QueueReport();_0x50652f[_0x16f4('0x44')]=_0x5eb4f6[_0x16f4('0x5e')];_0x50652f['type']=this[_0x16f4('0x16')][_0x50652f[_0x16f4('0x44')]]&&this['voiceQueues'][_0x50652f[_0x16f4('0x44')]][_0x16f4('0x49')]?this['voiceQueues'][_0x50652f[_0x16f4('0x44')]][_0x16f4('0x49')]||_0x16f4('0x67'):_0x16f4('0x67');_0x50652f[_0x16f4('0x5e')]=_0x5eb4f6[_0x16f4('0x5e')];_0x50652f['queuecallerjoinAt']=moment()[_0x16f4('0x42')]('YYYY-MM-DD\x20HH:mm:ss');_0x50652f[_0x16f4('0x68')]=_0x5eb4f6[_0x16f4('0x68')];_0x50652f[_0x16f4('0x69')]=_0x5eb4f6['count'];_[_0x16f4('0x6a')](_0x50652f,_[_0x16f4('0x6b')](_0x5eb4f6,_[_0x16f4('0x6c')](_0x50652f)));this[_0x16f4('0x12')][_0x5eb4f6[_0x16f4('0x66')]][_0x16f4('0x6d')](_0x50652f);this[_0x16f4('0x14')][_0x5eb4f6[_0x16f4('0x66')]]=_0x50652f;this[_0x16f4('0x41')](_0x50652f);}}catch(_0x1d6db1){logger['error']('[syncQueueCallerJoin][VoiceQueueReport]',util[_0x16f4('0x64')](_0x1d6db1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x16f4('0xd')][_0x16f4('0x1f')]=function(_0x5a04b9){try{if(this[_0x16f4('0x58')](_0x5a04b9)){if(this['queueReports'][_0x5a04b9[_0x16f4('0x66')]]){var _0x4752e9=_[_0x16f4('0x6e')](this['queueReports'][_0x5a04b9[_0x16f4('0x66')]]);_0x4752e9[_0x16f4('0x6f')]=![];_0x4752e9[_0x16f4('0x70')]=null;_0x4752e9[_0x16f4('0x71')]=_0x5a04b9[_0x16f4('0x71')];_0x4752e9[_0x16f4('0x72')]=_0x5a04b9[_0x16f4('0x72')];_0x4752e9['queuecallerabandon']=!![];_0x4752e9['queuecallerabandonAt']=moment()[_0x16f4('0x42')](_0x16f4('0x73'));_0x4752e9[_0x16f4('0x74')]=_0x16f4('0x75');_0x4752e9['lastAssignedTo']=null;this[_0x16f4('0x14')][_0x5a04b9[_0x16f4('0x66')]]=_0x4752e9;this['emitVoiceQueueChannelRemove'](_0x4752e9);}}}catch(_0x7d2975){logger[_0x16f4('0x3b')]('[syncQueueCallerAbandon][VoiceQueueReport]',util[_0x16f4('0x64')](_0x7d2975,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x16f4('0xd')][_0x16f4('0x76')]=function(_0x14e390){try{if(this[_0x16f4('0x58')](_0x14e390)){if(this[_0x16f4('0x12')][_0x14e390['uniqueid']]){var _0x9d31a4=_[_0x16f4('0x6e')](this['queueReports'][_0x14e390['uniqueid']]);_0x9d31a4[_0x16f4('0x77')]=moment()[_0x16f4('0x42')](_0x16f4('0x73'));_0x9d31a4[_0x16f4('0x78')]=_0x14e390['connectedlinenum'];_0x9d31a4[_0x16f4('0x79')]=_0x14e390[_0x16f4('0x79')];this[_0x16f4('0x14')][_0x14e390[_0x16f4('0x66')]]=_0x9d31a4;this[_0x16f4('0x41')](_0x9d31a4);}}}catch(_0x2d9038){logger['error'](_0x16f4('0x7a'),util[_0x16f4('0x64')](_0x2d9038,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x16f4('0x22')]=function(_0x24d605){try{if(this['isNotNull'](_0x24d605)){if(this['queueReports'][_0x24d605[_0x16f4('0x66')]]){var _0x39c531=_[_0x16f4('0x6e')](this[_0x16f4('0x12')][_0x24d605[_0x16f4('0x66')]]);_0x39c531[_0x16f4('0x6f')]=!![];_0x39c531[_0x16f4('0x74')]=_0x16f4('0x7b');}}}catch(_0x1ef051){logger[_0x16f4('0x3b')](_0x16f4('0x7c'),util[_0x16f4('0x64')](_0x1ef051,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x16f4('0xd')][_0x16f4('0x7d')]=function(_0x49f14e){try{if(this[_0x16f4('0x58')](_0x49f14e)){if(this[_0x16f4('0x12')][_0x49f14e['uniqueid']]){var _0x3694db=_[_0x16f4('0x6e')](this[_0x16f4('0x12')][_0x49f14e['uniqueid']]);_0x3694db[_0x16f4('0x1e')]=![];_0x3694db[_0x16f4('0x7e')]=null;_0x3694db[_0x16f4('0x7f')]=!![];_0x3694db['lastAssignedTo']=_0x49f14e[_0x16f4('0x80')];_0x3694db[_0x16f4('0x71')]=_0x49f14e[_0x16f4('0x71')];_0x3694db[_0x16f4('0x6f')]=!![];_0x3694db['queuecallerexit']=![];_0x3694db[_0x16f4('0x81')]=null;if(!_0x3694db[_0x16f4('0x82')]){if(_0x49f14e['reason']==_0x16f4('0x82')){_0x3694db['queuecallerexitreason']=_0x16f4('0x83');}else{if(_['startsWith'](_0x49f14e[_0x16f4('0x84')][_0x16f4('0x85')](),'local/')){if(this[_0x16f4('0x12')][_0x49f14e[_0x16f4('0x86')]]){var _0x3e5f4d=_[_0x16f4('0x6e')](this[_0x16f4('0x12')][_0x49f14e['linkedid']]);_0x3e5f4d[_0x16f4('0x6f')]=![];_0x3e5f4d[_0x16f4('0x87')]=!![];_0x3e5f4d[_0x16f4('0x81')]=moment(_0x3694db['queuecallerjoinAt'])['add'](_0x49f14e['holdtime'],_0x16f4('0x88'))[_0x16f4('0x42')](_0x16f4('0x73'));_0x3e5f4d[_0x16f4('0x74')]='FORWARDTRANSFER';_0x3e5f4d[_0x16f4('0x82')]=!![];_0x3e5f4d[_0x16f4('0x89')]=_0x16f4('0x8a');_0x3e5f4d[_0x16f4('0x8b')]=_0x49f14e['destexten'];_0x3e5f4d[_0x16f4('0x8c')]=_0x49f14e[_0x16f4('0x66')];var _0x394636=this[_0x16f4('0x12')][_0x49f14e['linkedid']];this[_0x16f4('0x12')][_0x49f14e[_0x16f4('0x86')]]=this['queueReports'][_0x49f14e[_0x16f4('0x66')]];this['queueReports'][_0x49f14e[_0x16f4('0x66')]]=_0x394636;}}else{_0x3694db[_0x16f4('0x74')]=_0x16f4('0x8d')+_0x49f14e[_0x16f4('0x8e')][_0x16f4('0x8f')]();}}}this['channels'][_0x49f14e['uniqueid']]=_0x3694db;this[_0x16f4('0x90')](_0x3694db);}}}catch(_0x1053cd){logger[_0x16f4('0x3b')]('[syncAgentComplete][VoiceQueueReport]',util[_0x16f4('0x64')](_0x1053cd,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x16f4('0xd')][_0x16f4('0x23')]=function(_0x13db4e){try{if(this['isNotNull'](_0x13db4e)){this['addVariable'](_0x13db4e['uniqueid'],_[_0x16f4('0x6c')](_0x13db4e[_0x16f4('0x91')])[0x0],_0x13db4e['value']);if(this[_0x16f4('0x12')][_0x13db4e['uniqueid']]){var _0x3f60a2=_[_0x16f4('0x6e')](this[_0x16f4('0x12')][_0x13db4e[_0x16f4('0x66')]]);if(_0x3f60a2){if(this[_0x16f4('0x58')](_0x13db4e[_0x16f4('0x91')])&&this[_0x16f4('0x58')](_0x13db4e[_0x16f4('0x91')][_0x16f4('0x92')])){switch(_0x13db4e[_0x16f4('0x93')]){case _0x16f4('0x94'):_0x3f60a2[_0x16f4('0x87')]=![];_0x3f60a2['queuecallerexitAt']=null;break;default:_0x3f60a2[_0x16f4('0x87')]=!![];_0x3f60a2[_0x16f4('0x81')]=moment()[_0x16f4('0x42')](_0x16f4('0x73'));_0x3f60a2[_0x16f4('0x77')]=moment()['format'](_0x16f4('0x73'));}_0x3f60a2['queuecallerabandon']=![];_0x3f60a2[_0x16f4('0x7e')]=null;_0x3f60a2[_0x16f4('0x74')]=_0x13db4e[_0x16f4('0x93')];this[_0x16f4('0x14')][_0x13db4e[_0x16f4('0x66')]]=_0x3f60a2;this[_0x16f4('0x90')](_0x3f60a2);}else if(this['isNotNull'](_0x13db4e['variable'])&&this[_0x16f4('0x58')](_0x13db4e[_0x16f4('0x91')][_0x16f4('0x95')])){if(!_0x3f60a2['queuecallerabandon']){_0x3f60a2['queuecallerexit']=!![];_0x3f60a2[_0x16f4('0x81')]=moment()[_0x16f4('0x42')](_0x16f4('0x73'));_0x3f60a2['queuecallerexitreason']=_0x16f4('0x96');_0x3f60a2['queuecallerleaveAt']=moment()['format'](_0x16f4('0x73'));this['channels'][_0x13db4e['uniqueid']]=_0x3f60a2;}}_0x3f60a2['variables']=this[_0x16f4('0x17')][_0x13db4e[_0x16f4('0x66')]];}}}}catch(_0x4c4ebf){logger[_0x16f4('0x3b')](_0x16f4('0x97'),util[_0x16f4('0x64')](_0x4c4ebf,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x16f4('0xd')][_0x16f4('0x98')]=function(_0x40ba4b,_0x332b02,_0x15c9be){var _0x9ddd=[_0x16f4('0x99'),'rtpaudioqosbridged',_0x16f4('0x9a'),_0x16f4('0x9b'),_0x16f4('0x9c'),'rtpaudioqoslossbridged',_0x16f4('0x9d'),_0x16f4('0x9e'),'sipcallid','sipuri','bridgepeer','bridgepvtcallid',_0x16f4('0x9f'),_0x16f4('0xa0'),_0x16f4('0xa1'),_0x16f4('0xa2'),_0x16f4('0x80'),_0x16f4('0xa3'),_0x16f4('0xa4')];if(!_[_0x16f4('0x37')](_0x332b02)&&!_['includes'](_0x9ddd,_0x332b02)){if(_[_0x16f4('0xa5')](this['variables'][_0x40ba4b])){this[_0x16f4('0x17')][_0x40ba4b]={};}this['variables'][_0x40ba4b][_0x332b02]=_0x15c9be;}};VoiceQueueReport[_0x16f4('0xd')][_0x16f4('0x25')]=function(_0x235cea){try{if(this[_0x16f4('0x58')](_0x235cea)){if(this[_0x16f4('0x12')][_0x235cea[_0x16f4('0x66')]]){for(var _0x5ab03d=0x0,_0x2d28dd={};_0x5ab03d0x0?_0x4ebe70:0x0;this['voiceQueues'][_0x3772c2[_0xe68c('0x66')]][_0xe68c('0x35')]=this[_0xe68c('0x14')][_0x3772c2[_0xe68c('0x66')]]['talking']>_[_0xe68c('0x68')](_0x3772c2[_0xe68c('0x6a')])?_[_0xe68c('0x68')](_0x3772c2[_0xe68c('0x6a')]):this['voiceQueues'][_0x3772c2[_0xe68c('0x66')]][_0xe68c('0x35')];this[_0xe68c('0x53')](this[_0xe68c('0x14')][_0x3772c2[_0xe68c('0x66')]]);}ami['emit'](_0xe68c('0x6c'),this[_0xe68c('0x14')][_0x3772c2[_0xe68c('0x66')]]);}}}catch(_0x1995dd){logger[_0xe68c('0x41')](_0xe68c('0x6d'),util[_0xe68c('0x49')](_0x1995dd,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe68c('0xd')][_0xe68c('0x1b')]=function(_0x5a6eb4){this[_0xe68c('0x15')]=!![];};VoiceQueueReport[_0xe68c('0xd')][_0xe68c('0x6e')]=function(_0x47da67){};VoiceQueueReport[_0xe68c('0xd')][_0xe68c('0x1c')]=function(_0x1ad79b){try{if(this['isNotNull'](_0x1ad79b)){if(_[_0xe68c('0x31')](this[_0xe68c('0x11')][_0x1ad79b[_0xe68c('0x6f')]])){this[_0xe68c('0x11')][_0x1ad79b['uniqueid']]=[];this[_0xe68c('0x39')][_0x1ad79b[_0xe68c('0x6f')]]={};}var _0x5454f7=new QueueReport();_0x5454f7[_0xe68c('0x4e')]=_0x1ad79b[_0xe68c('0x66')];_0x5454f7[_0xe68c('0x54')]=this[_0xe68c('0x14')][_0x5454f7[_0xe68c('0x4e')]]&&this[_0xe68c('0x14')][_0x5454f7['name']][_0xe68c('0x54')]?this[_0xe68c('0x14')][_0x5454f7[_0xe68c('0x4e')]][_0xe68c('0x54')]||_0xe68c('0x70'):_0xe68c('0x70');_0x5454f7[_0xe68c('0x66')]=_0x1ad79b['queue'];_0x5454f7[_0xe68c('0x71')]=moment()[_0xe68c('0x4c')](_0xe68c('0x72'));_0x5454f7[_0xe68c('0x73')]=_0x1ad79b[_0xe68c('0x73')];_0x5454f7['count']=_0x1ad79b['count'];_[_0xe68c('0x74')](_0x5454f7,_['pick'](_0x1ad79b,_[_0xe68c('0x75')](_0x5454f7)));this['queueReports'][_0x1ad79b[_0xe68c('0x6f')]]['push'](_0x5454f7);this[_0xe68c('0x39')][_0x1ad79b[_0xe68c('0x6f')]]=_0x5454f7;this[_0xe68c('0x4b')](_0x5454f7);}}catch(_0x12a51e){logger[_0xe68c('0x41')](_0xe68c('0x76'),util[_0xe68c('0x49')](_0x12a51e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe68c('0xd')][_0xe68c('0x1e')]=function(_0x5acca7){try{if(this[_0xe68c('0x60')](_0x5acca7)){if(this['queueReports'][_0x5acca7[_0xe68c('0x6f')]]){var _0x15b6ae=_['last'](this['queueReports'][_0x5acca7[_0xe68c('0x6f')]]);_0x15b6ae[_0xe68c('0x77')]=![];_0x15b6ae[_0xe68c('0x78')]=null;_0x15b6ae[_0xe68c('0x79')]=_0x5acca7[_0xe68c('0x79')];_0x15b6ae[_0xe68c('0x7a')]=_0x5acca7['originalposition'];_0x15b6ae[_0xe68c('0x1d')]=!![];_0x15b6ae['queuecallerabandonAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x15b6ae[_0xe68c('0x7b')]='ABANDONED';_0x15b6ae[_0xe68c('0x7c')]=null;this[_0xe68c('0x39')][_0x5acca7[_0xe68c('0x6f')]]=_0x15b6ae;this[_0xe68c('0x48')](_0x15b6ae);}}}catch(_0xbf6495){logger['error'](_0xe68c('0x7d'),util[_0xe68c('0x49')](_0xbf6495,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe68c('0xd')]['syncQueueCallerLeave']=function(_0x6e104b){try{if(this['isNotNull'](_0x6e104b)){if(this[_0xe68c('0x11')][_0x6e104b['uniqueid']]){var _0x191b62=_[_0xe68c('0x7e')](this['queueReports'][_0x6e104b['uniqueid']]);_0x191b62['queuecallerleaveAt']=moment()[_0xe68c('0x4c')](_0xe68c('0x72'));_0x191b62[_0xe68c('0x7f')]=_0x6e104b[_0xe68c('0x7f')];_0x191b62['connectedlinename']=_0x6e104b['connectedlinename'];this[_0xe68c('0x39')][_0x6e104b['uniqueid']]=_0x191b62;this['emitVoiceQueueChannelSave'](_0x191b62);}}}catch(_0x240b89){logger[_0xe68c('0x41')](_0xe68c('0x80'),util[_0xe68c('0x49')](_0x240b89,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe68c('0xd')]['syncAgentConnect']=function(_0x62289f){try{if(this['isNotNull'](_0x62289f)){if(this['queueReports'][_0x62289f['uniqueid']]){var _0x7fc8a4=_[_0xe68c('0x7e')](this[_0xe68c('0x11')][_0x62289f[_0xe68c('0x6f')]]);_0x7fc8a4[_0xe68c('0x77')]=!![];_0x7fc8a4['queuecallerexitreason']='COMPLETEDBYAGENT';}}}catch(_0x267b6a){logger[_0xe68c('0x41')](_0xe68c('0x81'),util[_0xe68c('0x49')](_0x267b6a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe68c('0xd')]['syncAgentComplete']=function(_0x4b5963){try{if(this[_0xe68c('0x60')](_0x4b5963)){if(this[_0xe68c('0x11')][_0x4b5963[_0xe68c('0x6f')]]){var _0x63b1a4=_[_0xe68c('0x7e')](this[_0xe68c('0x11')][_0x4b5963[_0xe68c('0x6f')]]);_0x63b1a4['queuecallerabandon']=![];_0x63b1a4[_0xe68c('0x82')]=null;_0x63b1a4[_0xe68c('0x83')]=!![];_0x63b1a4[_0xe68c('0x7c')]=_0x4b5963['membername'];_0x63b1a4['holdtime']=_0x4b5963['holdtime'];_0x63b1a4['queuecallercomplete']=!![];_0x63b1a4['queuecallerexit']=![];_0x63b1a4[_0xe68c('0x84')]=null;if(!_0x63b1a4[_0xe68c('0x85')]){if(_0x4b5963[_0xe68c('0x86')]==_0xe68c('0x85')){_0x63b1a4[_0xe68c('0x7b')]=_0xe68c('0x87');}else{if(_['startsWith'](_0x4b5963[_0xe68c('0x3d')][_0xe68c('0x88')](),_0xe68c('0x89'))){if(this[_0xe68c('0x11')][_0x4b5963[_0xe68c('0x8a')]]){var _0x2243fc=_[_0xe68c('0x7e')](this[_0xe68c('0x11')][_0x4b5963[_0xe68c('0x8a')]]);_0x2243fc[_0xe68c('0x77')]=![];_0x2243fc[_0xe68c('0x8b')]=!![];_0x2243fc[_0xe68c('0x84')]=moment(_0x63b1a4['queuecallerjoinAt'])[_0xe68c('0x8c')](_0x4b5963['holdtime'],'seconds')[_0xe68c('0x4c')](_0xe68c('0x72'));_0x2243fc['queuecallerexitreason']=_0xe68c('0x8d');_0x2243fc[_0xe68c('0x85')]=!![];_0x2243fc['transfertype']='FORWARD';_0x2243fc[_0xe68c('0x8e')]=_0x4b5963[_0xe68c('0x8f')];_0x2243fc[_0xe68c('0x90')]=_0x4b5963[_0xe68c('0x6f')];var _0x5b536a=this[_0xe68c('0x11')][_0x4b5963[_0xe68c('0x8a')]];this[_0xe68c('0x11')][_0x4b5963['linkedid']]=this[_0xe68c('0x11')][_0x4b5963[_0xe68c('0x6f')]];this[_0xe68c('0x11')][_0x4b5963[_0xe68c('0x6f')]]=_0x5b536a;}}else{_0x63b1a4[_0xe68c('0x7b')]=_0xe68c('0x91')+_0x4b5963[_0xe68c('0x86')][_0xe68c('0x92')]();}}}this[_0xe68c('0x39')][_0x4b5963['uniqueid']]=_0x63b1a4;this[_0xe68c('0x48')](_0x63b1a4);}}}catch(_0x5830ca){logger['error'](_0xe68c('0x93'),util[_0xe68c('0x49')](_0x5830ca,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe68c('0xd')][_0xe68c('0x25')]=function(_0x312ca4){try{if(this[_0xe68c('0x60')](_0x312ca4)){this['addVariable'](_0x312ca4[_0xe68c('0x6f')],_['keys'](_0x312ca4[_0xe68c('0x94')])[0x0],_0x312ca4[_0xe68c('0x95')]);if(this[_0xe68c('0x11')][_0x312ca4['uniqueid']]){var _0x43d472=_['last'](this['queueReports'][_0x312ca4['uniqueid']]);if(_0x43d472){if(this[_0xe68c('0x60')](_0x312ca4[_0xe68c('0x94')])&&this[_0xe68c('0x60')](_0x312ca4[_0xe68c('0x94')][_0xe68c('0x96')])){switch(_0x312ca4[_0xe68c('0x95')]){case _0xe68c('0x97'):_0x43d472['queuecallerexit']=![];_0x43d472[_0xe68c('0x84')]=null;break;default:_0x43d472[_0xe68c('0x8b')]=!![];_0x43d472[_0xe68c('0x84')]=moment()[_0xe68c('0x4c')](_0xe68c('0x72'));_0x43d472['queuecallerleaveAt']=moment()['format'](_0xe68c('0x72'));}_0x43d472['queuecallerabandon']=![];_0x43d472['queuecallerabandonAt']=null;_0x43d472[_0xe68c('0x7b')]=_0x312ca4['value'];this[_0xe68c('0x39')][_0x312ca4['uniqueid']]=_0x43d472;this[_0xe68c('0x48')](_0x43d472);}else if(this[_0xe68c('0x60')](_0x312ca4[_0xe68c('0x94')])&&this[_0xe68c('0x60')](_0x312ca4[_0xe68c('0x94')]['queueposition'])){if(!_0x43d472['queuecallerabandon']){_0x43d472[_0xe68c('0x8b')]=!![];_0x43d472[_0xe68c('0x84')]=moment()[_0xe68c('0x4c')](_0xe68c('0x72'));_0x43d472['queuecallerexitreason']=_0xe68c('0x98');_0x43d472[_0xe68c('0x99')]=moment()[_0xe68c('0x4c')](_0xe68c('0x72'));this[_0xe68c('0x39')][_0x312ca4['uniqueid']]=_0x43d472;}}_0x43d472['variables']=this['variables'][_0x312ca4[_0xe68c('0x6f')]];}}}}catch(_0x4f107e){logger[_0xe68c('0x41')](_0xe68c('0x9a'),util['inspect'](_0x4f107e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe68c('0xd')][_0xe68c('0x9b')]=function(_0x4cad87,_0x4cd5f7,_0x4d7631){var _0x574846=[_0xe68c('0x9c'),_0xe68c('0x9d'),_0xe68c('0x9e'),_0xe68c('0x9f'),'rtpaudioqosloss','rtpaudioqoslossbridged',_0xe68c('0xa0'),'rtpaudioqosrttbridged',_0xe68c('0xa1'),'sipuri',_0xe68c('0xa2'),_0xe68c('0xa3'),_0xe68c('0xa4'),_0xe68c('0xa5'),_0xe68c('0xa6'),_0xe68c('0xa7'),'membername',_0xe68c('0xa8'),_0xe68c('0xa9')];if(!_[_0xe68c('0x3b')](_0x4cd5f7)&&!_[_0xe68c('0xaa')](_0x574846,_0x4cd5f7)){if(_['isUndefined'](this[_0xe68c('0x44')][_0x4cad87])){this[_0xe68c('0x44')][_0x4cad87]={};}this[_0xe68c('0x44')][_0x4cad87][_0x4cd5f7]=_0x4d7631;}};VoiceQueueReport[_0xe68c('0xd')][_0xe68c('0x27')]=function(_0x23f54e){try{if(this['isNotNull'](_0x23f54e)){if(this['queueReports'][_0x23f54e[_0xe68c('0x6f')]]){for(var _0x5e4c4a=0x0,_0x36ae23={};_0x5e4c4a=0x0?moment(_0x1cf6a0['endtime'])[_0x5780('0xe')](_0x1cf6a0[_0x5780('0x1a')],'seconds'):null,'data1':_0x5780('0x1b'),'data2':_0x1cf6a0[_0x5780('0x16')],'data3':_0x1cf6a0['exten'],'data4':_0x1cf6a0['dialstring']||null,'role':_0x5780('0x14'),'internal':_0x1cf6a0['accountcode']?_[_0x5780('0x15')](_0x1cf6a0[_0x5780('0x16')]):undefined,'uniqueid':_0x1cf6a0[_0x5780('0x1c')]},'log':_0x5780('0x5')});}; \ No newline at end of file +var _0x9adc=['endtime','outbound','dialstring','toNumber','moment','lodash','../client','voiceQueueReport','queuecallercompleteAt','Request','CreateMemberReport','voice','lastAssignedTo','isNil','interface','format','SIP/%s','TALKING','queuecallerleaveAt','diff','seconds','agent','accountcode','uniqueid','membername','starttime'];(function(_0x12be6d,_0x340a27){var _0x52981f=function(_0x39578f){while(--_0x39578f){_0x12be6d['push'](_0x12be6d['shift']());}};_0x52981f(++_0x340a27);}(_0x9adc,0x6c));var _0xc9ad=function(_0x34b5f1,_0x385811){_0x34b5f1=_0x34b5f1-0x0;var _0xf402e1=_0x9adc[_0x34b5f1];return _0xf402e1;};'use strict';var moment=require(_0xc9ad('0x0'));var _=require(_0xc9ad('0x1'));var util=require('util');var client=require(_0xc9ad('0x2'));exports[_0xc9ad('0x3')]=function(_0x1222d2){var _0xf89f9e=_0x1222d2[_0xc9ad('0x4')]||_0x1222d2['queuecallerexitAt'];return client[_0xc9ad('0x5')](_0xc9ad('0x6'),{'body':{'channel':_0xc9ad('0x7'),'membername':_0x1222d2[_0xc9ad('0x8')],'interface':_[_0xc9ad('0x9')](_0x1222d2[_0xc9ad('0xa')])?util[_0xc9ad('0xb')](_0xc9ad('0xc'),_0x1222d2[_0xc9ad('0x8')]):_0x1222d2[_0xc9ad('0xa')],'type':_0xc9ad('0xd'),'enterAt':_0x1222d2[_0xc9ad('0xe')],'exitAt':_0xf89f9e,'duration':moment(_0xf89f9e)[_0xc9ad('0xf')](_0x1222d2[_0xc9ad('0xe')],_0xc9ad('0x10')),'data1':'inbound','data2':_0x1222d2['calleridnum'],'data3':_0x1222d2['exten'],'data4':null,'data5':_0x1222d2['queue'],'role':_0xc9ad('0x11'),'internal':_0x1222d2[_0xc9ad('0x12')]?_['toNumber'](_0x1222d2[_0xc9ad('0x12')]):undefined,'uniqueid':_0x1222d2[_0xc9ad('0x13')]},'log':_0xc9ad('0x6')});};exports['voiceDialReport']=function(_0x53b864){return client[_0xc9ad('0x5')](_0xc9ad('0x6'),{'body':{'channel':_0xc9ad('0x7'),'membername':_0x53b864[_0xc9ad('0x14')],'interface':_0x53b864[_0xc9ad('0xa')],'type':_0xc9ad('0xd'),'enterAt':_0x53b864[_0xc9ad('0x15')],'exitAt':_0x53b864[_0xc9ad('0x16')],'duration':moment(_0x53b864[_0xc9ad('0x16')])[_0xc9ad('0xf')](_0x53b864['starttime'],'seconds')>=0x0?moment(_0x53b864['endtime'])[_0xc9ad('0xf')](_0x53b864[_0xc9ad('0x15')],_0xc9ad('0x10')):null,'data1':_0xc9ad('0x17'),'data2':_0x53b864[_0xc9ad('0x12')],'data3':_0x53b864['exten'],'data4':_0x53b864[_0xc9ad('0x18')]||null,'role':'agent','internal':_0x53b864[_0xc9ad('0x12')]?_[_0xc9ad('0x19')](_0x53b864[_0xc9ad('0x12')]):undefined,'uniqueid':_0x53b864[_0xc9ad('0x13')]},'log':_0xc9ad('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 617dbd9..5bee531 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 _0xe812=['getTemplates','GetTemplate','name'];(function(_0x1f85a8,_0x3e46af){var _0x4bf0dd=function(_0x2ca340){while(--_0x2ca340){_0x1f85a8['push'](_0x1f85a8['shift']());}};_0x4bf0dd(++_0x3e46af);}(_0xe812,0x1f2));var _0x2e81=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xe812[_0x3ab51d];return _0x29a04e;};'use strict';var client=require('../client');exports[_0x2e81('0x0')]=function(_0x46bf6b){return function(_0x5e9295){return client['Request'](_0x2e81('0x1'),{'options':{'raw':!![],'attributes':['id',_0x2e81('0x2'),'html']},'log':_0x2e81('0x1')});};}; \ No newline at end of file +var _0x4746=['GetTemplate','name','html','../client','getTemplates'];(function(_0x1f5c5c,_0x3a4309){var _0x4f5dbb=function(_0x5690a3){while(--_0x5690a3){_0x1f5c5c['push'](_0x1f5c5c['shift']());}};_0x4f5dbb(++_0x3a4309);}(_0x4746,0xc6));var _0x6474=function(_0x441ac4,_0x934d4){_0x441ac4=_0x441ac4-0x0;var _0x1f19f1=_0x4746[_0x441ac4];return _0x1f19f1;};'use strict';var client=require(_0x6474('0x0'));exports[_0x6474('0x1')]=function(_0x5b12a8){return function(_0x20751a){return client['Request'](_0x6474('0x2'),{'options':{'raw':!![],'attributes':['id',_0x6474('0x3'),_0x6474('0x4')]},'log':_0x6474('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 0844ac2..3a6062d 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 _0xbe68=['field','operator','AnyConditions','value','Actions','action','data2','data3','data4','data5','../client','getTriggers','Request','GetTrigger','name','channel','status','AllConditions'];(function(_0x4fe19c,_0x45d0fe){var _0x952ac7=function(_0x274a16){while(--_0x274a16){_0x4fe19c['push'](_0x4fe19c['shift']());}};_0x952ac7(++_0x45d0fe);}(_0xbe68,0x88));var _0x8be6=function(_0x3ed236,_0x41c6fb){_0x3ed236=_0x3ed236-0x0;var _0xdb5a0a=_0xbe68[_0x3ed236];return _0xdb5a0a;};'use strict';var client=require(_0x8be6('0x0'));exports[_0x8be6('0x1')]=function(_0x4d5b2d){return function(_0x1a585c){return client[_0x8be6('0x2')](_0x8be6('0x3'),{'options':{'raw':![],'attributes':['id',_0x8be6('0x4'),_0x8be6('0x5'),_0x8be6('0x6')],'include':[{'model':'Condition','as':_0x8be6('0x7'),'attributes':['id',_0x8be6('0x8'),_0x8be6('0x9'),'value']},{'model':'Condition','as':_0x8be6('0xa'),'attributes':['id',_0x8be6('0x8'),_0x8be6('0x9'),_0x8be6('0xb')]},{'model':'Action','as':_0x8be6('0xc'),'attributes':['id',_0x8be6('0xd'),'data1',_0x8be6('0xe'),_0x8be6('0xf'),_0x8be6('0x10'),_0x8be6('0x11'),'data6','data7']}]},'log':_0x8be6('0x3')});};}; \ No newline at end of file +var _0x9d8e=['value','Action','action','data3','data4','data5','data6','getTriggers','GetTrigger','name','AllConditions','field','operator','AnyConditions'];(function(_0x1a3243,_0x201872){var _0x33f2ca=function(_0x59d32e){while(--_0x59d32e){_0x1a3243['push'](_0x1a3243['shift']());}};_0x33f2ca(++_0x201872);}(_0x9d8e,0x69));var _0xe9d8=function(_0x9f34dd,_0x2ccde2){_0x9f34dd=_0x9f34dd-0x0;var _0x47ed47=_0x9d8e[_0x9f34dd];return _0x47ed47;};'use strict';var client=require('../client');exports[_0xe9d8('0x0')]=function(_0x37bbdb){return function(_0x43a32a){return client['Request'](_0xe9d8('0x1'),{'options':{'raw':![],'attributes':['id',_0xe9d8('0x2'),'channel','status'],'include':[{'model':'Condition','as':_0xe9d8('0x3'),'attributes':['id',_0xe9d8('0x4'),_0xe9d8('0x5'),'value']},{'model':'Condition','as':_0xe9d8('0x6'),'attributes':['id','field','operator',_0xe9d8('0x7')]},{'model':_0xe9d8('0x8'),'as':'Actions','attributes':['id',_0xe9d8('0x9'),'data1','data2',_0xe9d8('0xa'),_0xe9d8('0xb'),_0xe9d8('0xc'),_0xe9d8('0xd'),'data7']}]},'log':_0xe9d8('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index b6b34ac..333383d 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 _0x4e99=['name','registry','../client','getTrunks','Request','GetTrunk'];(function(_0x5eee1c,_0x3817d8){var _0x5f2ea1=function(_0x19173b){while(--_0x19173b){_0x5eee1c['push'](_0x5eee1c['shift']());}};_0x5f2ea1(++_0x3817d8);}(_0x4e99,0xd4));var _0x94e9=function(_0x474cc6,_0x55d82a){_0x474cc6=_0x474cc6-0x0;var _0xe1a797=_0x4e99[_0x474cc6];return _0xe1a797;};'use strict';var client=require(_0x94e9('0x0'));exports[_0x94e9('0x1')]=function(_0x17fa8c){return function(_0x1007f8){return client[_0x94e9('0x2')](_0x94e9('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x94e9('0x4'),_0x94e9('0x5')]},'log':'GetTrunk'});};}; \ No newline at end of file +var _0x13df=['getTrunks','Request','GetTrunk','name'];(function(_0x3ef269,_0x551029){var _0x363432=function(_0x46cda0){while(--_0x46cda0){_0x3ef269['push'](_0x3ef269['shift']());}};_0x363432(++_0x551029);}(_0x13df,0xf4));var _0xf13d=function(_0x197344,_0x2e8fa7){_0x197344=_0x197344-0x0;var _0x4c71a6=_0x13df[_0x197344];return _0x4c71a6;};'use strict';var client=require('../client');exports[_0xf13d('0x0')]=function(_0x5eb5b1){return function(_0x4064ff){return client[_0xf13d('0x1')](_0xf13d('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xf13d('0x3'),'registry']},'log':_0xf13d('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 066c283..6e5bbfd 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 _0xc966=['savePause','PauseUser','saveUnpause','email','getAgent','../client','Request','GetUser','agent','name','accountcode','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getAgents','getTelephones','telephone','internal'];(function(_0x4317ae,_0x479ad0){var _0x7998e9=function(_0x72f570){while(--_0x72f570){_0x4317ae['push'](_0x4317ae['shift']());}};_0x7998e9(++_0x479ad0);}(_0xc966,0x155));var _0x6c96=function(_0x2af276,_0xb15ec5){_0x2af276=_0x2af276-0x0;var _0x4c586e=_0xc966[_0x2af276];return _0x4c586e;};'use strict';var client=require(_0x6c96('0x0'));exports['getAgents']=function(){return function(){return client[_0x6c96('0x1')](_0x6c96('0x2'),{'options':{'raw':![],'where':{'role':_0x6c96('0x3')},'attributes':['id',_0x6c96('0x4'),'email',_0x6c96('0x5'),_0x6c96('0x6'),_0x6c96('0x7'),_0x6c96('0x8'),_0x6c96('0x9'),_0x6c96('0xa'),_0x6c96('0xb'),_0x6c96('0xc'),_0x6c96('0xd'),_0x6c96('0xe')]},'log':_0x6c96('0xf')});};};exports[_0x6c96('0x10')]=function(){return function(){return client[_0x6c96('0x1')](_0x6c96('0x2'),{'options':{'raw':!![],'where':{'role':_0x6c96('0x11')},'attributes':['id','name',_0x6c96('0x5'),_0x6c96('0x12')]},'log':_0x6c96('0x10')});};};exports[_0x6c96('0x13')]=function(_0x26c1af,_0x4f2fb1,_0x163f9c){return client[_0x6c96('0x1')](_0x6c96('0x14'),{'body':{'type':_0x4f2fb1,'uniqueid':_0x163f9c},'options':{'where':{'id':_0x26c1af['id']}},'log':'savePause'});};exports[_0x6c96('0x15')]=function(_0xff8e38){return client[_0x6c96('0x1')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0xff8e38['id']}},'log':_0x6c96('0x13')});};exports['getAgent']=function(_0x4e5b6e){return client[_0x6c96('0x1')]('ShowUser',{'options':{'raw':![],'where':{'role':_0x6c96('0x3'),'id':_0x4e5b6e},'attributes':['id',_0x6c96('0x4'),_0x6c96('0x16'),_0x6c96('0x5'),_0x6c96('0x6'),_0x6c96('0x7'),'lastLoginAt',_0x6c96('0x9'),_0x6c96('0xa'),_0x6c96('0xb'),'interface']},'log':_0x6c96('0x17')});}; \ No newline at end of file +var _0xae15=['accountcode','internal','PauseUser','saveUnpause','savePause','getAgent','interface','../client','getAgents','Request','GetUser','agent','name','email','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','getTelephones','telephone'];(function(_0x2cc36a,_0x50698d){var _0x6bb5c6=function(_0xea05df){while(--_0xea05df){_0x2cc36a['push'](_0x2cc36a['shift']());}};_0x6bb5c6(++_0x50698d);}(_0xae15,0x97));var _0x5ae1=function(_0x3d5ac6,_0x56e672){_0x3d5ac6=_0x3d5ac6-0x0;var _0x2f0c46=_0xae15[_0x3d5ac6];return _0x2f0c46;};'use strict';var client=require(_0x5ae1('0x0'));exports[_0x5ae1('0x1')]=function(){return function(){return client[_0x5ae1('0x2')](_0x5ae1('0x3'),{'options':{'raw':![],'where':{'role':_0x5ae1('0x4')},'attributes':['id',_0x5ae1('0x5'),_0x5ae1('0x6'),'accountcode',_0x5ae1('0x7'),_0x5ae1('0x8'),_0x5ae1('0x9'),_0x5ae1('0xa'),_0x5ae1('0xb'),_0x5ae1('0xc'),_0x5ae1('0xd'),_0x5ae1('0xe'),'interface']},'log':'getAgents'});};};exports[_0x5ae1('0xf')]=function(){return function(){return client[_0x5ae1('0x2')](_0x5ae1('0x3'),{'options':{'raw':!![],'where':{'role':_0x5ae1('0x10')},'attributes':['id',_0x5ae1('0x5'),_0x5ae1('0x11'),_0x5ae1('0x12')]},'log':_0x5ae1('0xf')});};};exports['savePause']=function(_0x4ee236,_0x3d4545,_0x3b8754){return client[_0x5ae1('0x2')](_0x5ae1('0x13'),{'body':{'type':_0x3d4545,'uniqueid':_0x3b8754},'options':{'where':{'id':_0x4ee236['id']}},'log':'savePause'});};exports[_0x5ae1('0x14')]=function(_0x2ac902){return client[_0x5ae1('0x2')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x2ac902['id']}},'log':_0x5ae1('0x15')});};exports[_0x5ae1('0x16')]=function(_0x543d6f){return client[_0x5ae1('0x2')]('ShowUser',{'options':{'raw':![],'where':{'role':'agent','id':_0x543d6f},'attributes':['id',_0x5ae1('0x5'),_0x5ae1('0x6'),'accountcode',_0x5ae1('0x7'),'online',_0x5ae1('0x9'),_0x5ae1('0xa'),_0x5ae1('0xb'),_0x5ae1('0xc'),_0x5ae1('0x17')]},'log':_0x5ae1('0x16')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index db28847..5601282 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 _0x8d34=['UpdateVoiceAgentReport','../client','Request','CreateVoiceAgentReport'];(function(_0x2d98d6,_0x5a20ce){var _0x1556a9=function(_0x2100e7){while(--_0x2100e7){_0x2d98d6['push'](_0x2d98d6['shift']());}};_0x1556a9(++_0x5a20ce);}(_0x8d34,0x191));var _0x48d3=function(_0x5599ea,_0x536821){_0x5599ea=_0x5599ea-0x0;var _0x925e4d=_0x8d34[_0x5599ea];return _0x925e4d;};'use strict';var client=require(_0x48d3('0x0'));exports['create']=function(_0x17b1bf){return client[_0x48d3('0x1')]('CreateVoiceAgentReport',{'body':_0x17b1bf,'log':_0x48d3('0x2')});};exports['update']=function(_0x1b7e84,_0x132e99,_0x3349fc){return client[_0x48d3('0x1')](_0x48d3('0x3'),{'body':_0x1b7e84,'options':{'where':{'uniqueid':_0x132e99,'interface':_0x3349fc}},'log':_0x48d3('0x3')});}; \ No newline at end of file +var _0xe313=['create','Request','CreateVoiceAgentReport','UpdateVoiceAgentReport','../client'];(function(_0x2a1c65,_0x32f485){var _0x145c17=function(_0x7c6919){while(--_0x7c6919){_0x2a1c65['push'](_0x2a1c65['shift']());}};_0x145c17(++_0x32f485);}(_0xe313,0x14e));var _0x3e31=function(_0x410e58,_0x5736bf){_0x410e58=_0x410e58-0x0;var _0x578ad8=_0xe313[_0x410e58];return _0x578ad8;};'use strict';var client=require(_0x3e31('0x0'));exports[_0x3e31('0x1')]=function(_0xc456d7){return client[_0x3e31('0x2')](_0x3e31('0x3'),{'body':_0xc456d7,'log':_0x3e31('0x3')});};exports['update']=function(_0x53d339,_0x4d67b8,_0x5bc5a7){return client['Request'](_0x3e31('0x4'),{'body':_0x53d339,'options':{'where':{'uniqueid':_0x4d67b8,'interface':_0x5bc5a7}},'log':_0x3e31('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index bf8454f..c59cdc2 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 _0x5cf3=['type','disposition','duration','billableseconds','moment','util','Request','CreateVoiceCallReport','merge','calleridnum','callerid','DOCUMENTATION','GetVoiceCallReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','day'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5cf3,0x124));var _0x35cf=function(_0x23c827,_0x37332a){_0x23c827=_0x23c827-0x0;var _0x3d7f1f=_0x5cf3[_0x23c827];return _0x3d7f1f;};'use strict';var moment=require(_0x35cf('0x0'));var util=require(_0x35cf('0x1'));var _=require('lodash');var client=require('../client');exports['create']=function(_0x3d226b){return client[_0x35cf('0x2')](_0x35cf('0x3'),{'body':_[_0x35cf('0x4')](_0x3d226b,{'source':_0x3d226b[_0x35cf('0x5')],'destinationcontext':_0x3d226b['context'],'callerid':_0x3d226b[_0x35cf('0x6')],'amaflags':_0x35cf('0x7')}),'log':'CreateVoiceCallReport'});};exports['getVoiceCallReports']=function(){return function(){return client[_0x35cf('0x2')](_0x35cf('0x8'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0x35cf('0x9')]('day')[_0x35cf('0xa')](_0x35cf('0xb')),moment()[_0x35cf('0xc')](_0x35cf('0xd'))['format'](_0x35cf('0xb'))]}},'attributes':[_0x35cf('0xe'),_0x35cf('0xf'),_0x35cf('0x10'),_0x35cf('0x11')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file +var _0x14da=['callerid','getVoiceCallReports','outbound','startOf','format','day','YYYY-MM-DD\x20HH:mm:ss','type','disposition','billableseconds','moment','util','lodash','../client','create','Request','CreateVoiceCallReport','context'];(function(_0x1b3a39,_0x172c5a){var _0x46e78b=function(_0x24b6a8){while(--_0x24b6a8){_0x1b3a39['push'](_0x1b3a39['shift']());}};_0x46e78b(++_0x172c5a);}(_0x14da,0x9a));var _0xa14d=function(_0xcf69e4,_0x22359f){_0xcf69e4=_0xcf69e4-0x0;var _0x3ae183=_0x14da[_0xcf69e4];return _0x3ae183;};'use strict';var moment=require(_0xa14d('0x0'));var util=require(_0xa14d('0x1'));var _=require(_0xa14d('0x2'));var client=require(_0xa14d('0x3'));exports[_0xa14d('0x4')]=function(_0x482104){return client[_0xa14d('0x5')](_0xa14d('0x6'),{'body':_['merge'](_0x482104,{'source':_0x482104['calleridnum'],'destinationcontext':_0x482104[_0xa14d('0x7')],'callerid':_0x482104[_0xa14d('0x8')],'amaflags':'DOCUMENTATION'}),'log':'CreateVoiceCallReport'});};exports[_0xa14d('0x9')]=function(){return function(){return client[_0xa14d('0x5')]('GetVoiceCallReport',{'options':{'where':{'type':[_0xa14d('0xa')],'createdAt':{'$between':[moment()[_0xa14d('0xb')]('day')[_0xa14d('0xc')]('YYYY-MM-DD\x20HH:mm:ss'),moment()['endOf'](_0xa14d('0xd'))[_0xa14d('0xc')](_0xa14d('0xe'))]}},'attributes':[_0xa14d('0xf'),_0xa14d('0x10'),'duration',_0xa14d('0x11')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index ad4c999..7d2ad68 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 _0x4b97=['../client','create','Request','CreateVoiceDialReport'];(function(_0x5fae11,_0x812d2a){var _0x22695b=function(_0xae0edd){while(--_0xae0edd){_0x5fae11['push'](_0x5fae11['shift']());}};_0x22695b(++_0x812d2a);}(_0x4b97,0xf8));var _0x74b9=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x4b97[_0x21a9d9];return _0x46adce;};'use strict';var client=require(_0x74b9('0x0'));exports[_0x74b9('0x1')]=function(_0x19bb8f){return client[_0x74b9('0x2')](_0x74b9('0x3'),{'body':_0x19bb8f,'log':_0x74b9('0x3')});}; \ No newline at end of file +var _0x252e=['create','Request','CreateVoiceDialReport','../client'];(function(_0x5772c4,_0x37311a){var _0x1c417f=function(_0x3b443d){while(--_0x3b443d){_0x5772c4['push'](_0x5772c4['shift']());}};_0x1c417f(++_0x37311a);}(_0x252e,0x1ef));var _0xe252=function(_0x276165,_0x3f2e3f){_0x276165=_0x276165-0x0;var _0x278bb3=_0x252e[_0x276165];return _0x278bb3;};'use strict';var client=require(_0xe252('0x0'));exports[_0xe252('0x1')]=function(_0x59f83b){return client[_0xe252('0x2')](_0xe252('0x3'),{'body':_0x59f83b,'log':_0xe252('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index f5484ff..00b6259 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 _0x827a=['GetVoiceExtension','exten','recordingFormat','getVoiceExtensions','../client'];(function(_0x173fdf,_0x1ba573){var _0x147b6d=function(_0x5dc021){while(--_0x5dc021){_0x173fdf['push'](_0x173fdf['shift']());}};_0x147b6d(++_0x1ba573);}(_0x827a,0x167));var _0xa827=function(_0xd4364,_0x2b8355){_0xd4364=_0xd4364-0x0;var _0x45169b=_0x827a[_0xd4364];return _0x45169b;};'use strict';var client=require(_0xa827('0x0'));exports['getVoiceExtensions']=function(){return function(){return client['Request'](_0xa827('0x1'),{'options':{'raw':!![],'attributes':['id',_0xa827('0x2'),_0xa827('0x3')],'where':{'VoiceExtensionId':null}},'log':_0xa827('0x4')});};}; \ No newline at end of file +var _0xe3c9=['recordingFormat','getVoiceExtensions','GetVoiceExtension','exten'];(function(_0x5139bb,_0x3fb5f4){var _0x306e2a=function(_0x3b6036){while(--_0x3b6036){_0x5139bb['push'](_0x5139bb['shift']());}};_0x306e2a(++_0x3fb5f4);}(_0xe3c9,0x1ad));var _0x9e3c=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xe3c9[_0x13e741];return _0x3f8bb3;};'use strict';var client=require('../client');exports[_0x9e3c('0x0')]=function(){return function(){return client['Request'](_0x9e3c('0x1'),{'options':{'raw':!![],'attributes':['id',_0x9e3c('0x2'),_0x9e3c('0x3')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 74c2dc3..e0583eb 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 _0x82d9=['timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','strategy','dialCutDigit','dialPredictiveIntervalMaxThreshold','Trunk','callerid','active','mandatoryDispositionPause','TrunkBackup','Interval','interval','../client','getVoiceQueues','Request','name','acw','autopause','monitor_format','type','dialActive','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialTimezone','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength'];(function(_0x211c0,_0x315fe4){var _0x3432b7=function(_0x1d01dc){while(--_0x1d01dc){_0x211c0['push'](_0x211c0['shift']());}};_0x3432b7(++_0x315fe4);}(_0x82d9,0x10f));var _0x982d=function(_0x20cdc8,_0x4a63f3){_0x20cdc8=_0x20cdc8-0x0;var _0xe735be=_0x82d9[_0x20cdc8];return _0xe735be;};'use strict';var client=require(_0x982d('0x0'));exports[_0x982d('0x1')]=function(){return function(){return client[_0x982d('0x2')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0x982d('0x3'),_0x982d('0x4'),'acwTimeout',_0x982d('0x5'),_0x982d('0x6'),_0x982d('0x7'),_0x982d('0x8'),'dialMethod',_0x982d('0x9'),'dialLimitQueue',_0x982d('0xa'),_0x982d('0xb'),_0x982d('0xc'),'dialPredictiveInterval',_0x982d('0xd'),'dialOriginateCallerIdNumber',_0x982d('0xe'),_0x982d('0xf'),_0x982d('0x10'),_0x982d('0x11'),_0x982d('0x12'),_0x982d('0x13'),_0x982d('0x14'),'dialBusyRetryFrequency',_0x982d('0x15'),_0x982d('0x16'),'dialGlobalMaxRetry',_0x982d('0x17'),'dialGlobalInterval',_0x982d('0x18'),_0x982d('0x19'),_0x982d('0x1a'),_0x982d('0x1b'),_0x982d('0x1c'),_0x982d('0x1d'),_0x982d('0x1e'),_0x982d('0x1f'),'dialAMDBetweenWordsSilence',_0x982d('0x20'),_0x982d('0x21'),_0x982d('0x22'),_0x982d('0x23'),_0x982d('0x24'),_0x982d('0x25'),_0x982d('0x26'),_0x982d('0x27'),_0x982d('0x28'),'dialQueueProject2','monitor_format',_0x982d('0x29'),'dialRandomLastDigitCallerIdNumber',_0x982d('0x2a'),'mandatoryDisposition',_0x982d('0x2b'),'dialPredictiveIntervalMinThreshold'],'include':[{'model':_0x982d('0x2c'),'as':_0x982d('0x2c'),'attributes':['id','name',_0x982d('0x2d'),_0x982d('0x2e')]},{'model':'Pause','as':_0x982d('0x2f'),'attributes':['id','name']},{'model':'Trunk','as':_0x982d('0x30'),'attributes':['id',_0x982d('0x3'),'callerid',_0x982d('0x2e')]},{'model':_0x982d('0x31'),'as':'Interval','attributes':['id',_0x982d('0x3')],'include':[{'model':'Interval','as':'Intervals','attributes':['id',_0x982d('0x3'),_0x982d('0x32')]}]}]},'log':_0x982d('0x1')});};}; \ No newline at end of file +var _0x2fe1=['dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupClient','dialQueueProject2','dialRandomLastDigitCallerIdNumber','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','name','callerid','Pause','mandatoryDispositionPause','TrunkBackup','active','Interval','Intervals','interval','getVoiceQueues','GetVoiceQueue','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix'];(function(_0x14119c,_0x322f69){var _0x16cc69=function(_0x2a1be8){while(--_0x2a1be8){_0x14119c['push'](_0x14119c['shift']());}};_0x16cc69(++_0x322f69);}(_0x2fe1,0x129));var _0x12fe=function(_0x193f63,_0x5947){_0x193f63=_0x193f63-0x0;var _0x13381a=_0x2fe1[_0x193f63];return _0x13381a;};'use strict';var client=require('../client');exports[_0x12fe('0x0')]=function(){return function(){return client['Request'](_0x12fe('0x1'),{'options':{'raw':![],'attributes':['id','name',_0x12fe('0x2'),_0x12fe('0x3'),_0x12fe('0x4'),_0x12fe('0x5'),_0x12fe('0x6'),_0x12fe('0x7'),_0x12fe('0x8'),'dialLimitChannel',_0x12fe('0x9'),_0x12fe('0xa'),_0x12fe('0xb'),_0x12fe('0xc'),'dialPredictiveInterval',_0x12fe('0xd'),_0x12fe('0xe'),_0x12fe('0xf'),_0x12fe('0x10'),_0x12fe('0x11'),_0x12fe('0x12'),_0x12fe('0x13'),'dialCongestionRetryFrequency',_0x12fe('0x14'),'dialBusyRetryFrequency',_0x12fe('0x15'),_0x12fe('0x16'),_0x12fe('0x17'),_0x12fe('0x18'),_0x12fe('0x19'),_0x12fe('0x1a'),'dialCheckDuplicateType','dialAMDActive',_0x12fe('0x1b'),_0x12fe('0x1c'),_0x12fe('0x1d'),_0x12fe('0x1e'),_0x12fe('0x1f'),_0x12fe('0x20'),_0x12fe('0x21'),_0x12fe('0x22'),'dialAMDMaximumWordLength',_0x12fe('0x23'),_0x12fe('0x24'),_0x12fe('0x25'),_0x12fe('0x26'),'dialAgiAfterHangupAgent',_0x12fe('0x27'),_0x12fe('0x28'),_0x12fe('0x5'),'strategy',_0x12fe('0x29'),'dialCutDigit','mandatoryDisposition',_0x12fe('0x2a'),_0x12fe('0x2b')],'include':[{'model':_0x12fe('0x2c'),'as':_0x12fe('0x2c'),'attributes':['id',_0x12fe('0x2d'),_0x12fe('0x2e'),'active']},{'model':_0x12fe('0x2f'),'as':_0x12fe('0x30'),'attributes':['id','name']},{'model':'Trunk','as':_0x12fe('0x31'),'attributes':['id','name',_0x12fe('0x2e'),_0x12fe('0x32')]},{'model':_0x12fe('0x33'),'as':'Interval','attributes':['id','name'],'include':[{'model':'Interval','as':_0x12fe('0x34'),'attributes':['id',_0x12fe('0x2d'),_0x12fe('0x35')]}]}]},'log':_0x12fe('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 1ee641d..e895ee3 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 _0xcfbf=['getVoiceQueueReports','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','uniqueid','queue','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerabandon','moment','lodash','../client','create','Request','CreateVoiceQueueReport'];(function(_0x603e3b,_0x4584b3){var _0x3602bf=function(_0x1e4419){while(--_0x1e4419){_0x603e3b['push'](_0x603e3b['shift']());}};_0x3602bf(++_0x4584b3);}(_0xcfbf,0xf1));var _0xfcfb=function(_0x52101c,_0x467965){_0x52101c=_0x52101c-0x0;var _0x30ea3a=_0xcfbf[_0x52101c];return _0x30ea3a;};'use strict';var moment=require(_0xfcfb('0x0'));var _=require(_0xfcfb('0x1'));var client=require(_0xfcfb('0x2'));exports[_0xfcfb('0x3')]=function(_0x7296e7){return client[_0xfcfb('0x4')]('CreateVoiceQueueReport',{'body':_0x7296e7,'log':_0xfcfb('0x5')});};exports[_0xfcfb('0x6')]=function(){return function(){return client[_0xfcfb('0x4')]('GetVoiceQueueReport',{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0xfcfb('0x7'))[_0xfcfb('0x8')](_0xfcfb('0x9')),moment()[_0xfcfb('0xa')](_0xfcfb('0x7'))[_0xfcfb('0x8')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0xfcfb('0xb'),_0xfcfb('0xc'),_0xfcfb('0xd'),_0xfcfb('0xe'),_0xfcfb('0xf'),_0xfcfb('0x10'),_0xfcfb('0x11'),'queuecallerexitAt',_0xfcfb('0x12'),'queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file +var _0xeec0=['uniqueid','queue','queuecallerjoinAt','queuecallerleaveAt','queuecallerexit','queuecallerabandon','queuecallerabandonAt','GetVoiceQueueReports','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','day'];(function(_0x1272a3,_0x4b73dc){var _0x51cfb3=function(_0x59ccca){while(--_0x59ccca){_0x1272a3['push'](_0x1272a3['shift']());}};_0x51cfb3(++_0x4b73dc);}(_0xeec0,0x98));var _0x0eec=function(_0xf505b8,_0x3ce58e){_0xf505b8=_0xf505b8-0x0;var _0x1c03b3=_0xeec0[_0xf505b8];return _0x1c03b3;};'use strict';var moment=require('moment');var _=require(_0x0eec('0x0'));var client=require(_0x0eec('0x1'));exports['create']=function(_0x4f2077){return client[_0x0eec('0x2')](_0x0eec('0x3'),{'body':_0x4f2077,'log':_0x0eec('0x3')});};exports[_0x0eec('0x4')]=function(){return function(){return client[_0x0eec('0x2')]('GetVoiceQueueReport',{'options':{'where':{'createdAt':{'$between':[moment()[_0x0eec('0x5')]('day')[_0x0eec('0x6')](_0x0eec('0x7')),moment()[_0x0eec('0x8')](_0x0eec('0x9'))[_0x0eec('0x6')](_0x0eec('0x7'))]}},'attributes':[_0x0eec('0xa'),_0x0eec('0xb'),_0x0eec('0xc'),_0x0eec('0xd'),'queuecallercomplete','queuecallercompleteAt',_0x0eec('0xe'),'queuecallerexitAt',_0x0eec('0xf'),_0x0eec('0x10')]},'log':_0x0eec('0x11')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index 273a4e2..343d9c9 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 _0x3620=['../client','getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses'];(function(_0x3f9ea9,_0x19840d){var _0x291e7f=function(_0x8012b4){while(--_0x8012b4){_0x3f9ea9['push'](_0x3f9ea9['shift']());}};_0x291e7f(++_0x19840d);}(_0x3620,0x1c8));var _0x0362=function(_0x505050,_0x51639d){_0x505050=_0x505050-0x0;var _0x5016b9=_0x3620[_0x505050];return _0x5016b9;};'use strict';var client=require(_0x0362('0x0'));exports[_0x0362('0x1')]=function(_0x356f80){return function(){return client[_0x0362('0x2')](_0x0362('0x3'),{'options':{'where':{'VoiceQueueId':_0x356f80,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file +var _0x0107=['../client','getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x0107,0x17c));var _0x7010=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x0107[_0x4f9b18];return _0x29f20c;};'use strict';var client=require(_0x7010('0x0'));exports[_0x7010('0x1')]=function(_0x33713d){return function(){return client[_0x7010('0x2')](_0x7010('0x3'),{'options':{'where':{'VoiceQueueId':_0x33713d,'paused':!![]},'raw':!![]},'log':_0x7010('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 882ebe0..73bc6ac 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 _0x4e2a=['create','Request','CreateVoiceRecording','merge','lodash','../client'];(function(_0x520885,_0x3e29da){var _0x263f7f=function(_0x546c38){while(--_0x546c38){_0x520885['push'](_0x520885['shift']());}};_0x263f7f(++_0x3e29da);}(_0x4e2a,0x118));var _0xa4e2=function(_0xf0b94f,_0x30a4a2){_0xf0b94f=_0xf0b94f-0x0;var _0x2c7113=_0x4e2a[_0xf0b94f];return _0x2c7113;};'use strict';var _=require(_0xa4e2('0x0'));var client=require(_0xa4e2('0x1'));exports[_0xa4e2('0x2')]=function(_0x3b5cab){return client[_0xa4e2('0x3')](_0xa4e2('0x4'),{'body':_[_0xa4e2('0x5')](_0x3b5cab,{'value':_0x3b5cab['monitorFilename']}),'log':_0xa4e2('0x4')});}; \ No newline at end of file +var _0x290e=['../client','create','Request','CreateVoiceRecording','merge','monitorFilename'];(function(_0x5393eb,_0x189e59){var _0x5242f8=function(_0x3c2942){while(--_0x3c2942){_0x5393eb['push'](_0x5393eb['shift']());}};_0x5242f8(++_0x189e59);}(_0x290e,0x90));var _0xe290=function(_0x2d0d5d,_0x3c1683){_0x2d0d5d=_0x2d0d5d-0x0;var _0x73f68e=_0x290e[_0x2d0d5d];return _0x73f68e;};'use strict';var _=require('lodash');var client=require(_0xe290('0x0'));exports[_0xe290('0x1')]=function(_0xaf9880){return client[_0xe290('0x2')](_0xe290('0x3'),{'body':_[_0xe290('0x4')](_0xaf9880,{'value':_0xaf9880[_0xe290('0x5')]}),'log':_0xe290('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 26f7f82..390f864 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 _0x9b46=['blind','CreateVoiceTransferReport','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','blindTransfer','Request','result','transfererchannel','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereelinkedid','isexternal','context','extension'];(function(_0x87a5b8,_0x23fb43){var _0x281319=function(_0x280622){while(--_0x280622){_0x87a5b8['push'](_0x87a5b8['shift']());}};_0x281319(++_0x23fb43);}(_0x9b46,0xe0));var _0x69b4=function(_0x90dfad,_0x4d127a){_0x90dfad=_0x90dfad-0x0;var _0x8cdcc7=_0x9b46[_0x90dfad];return _0x8cdcc7;};'use strict';var client=require(_0x69b4('0x0'));exports[_0x69b4('0x1')]=function(_0x324413){return client[_0x69b4('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x324413[_0x69b4('0x3')],'transfererchannel':_0x324413[_0x69b4('0x4')],'transferercalleridnum':_0x324413['transferercalleridnum'],'transferercalleridname':_0x324413[_0x69b4('0x5')],'transfererconnectedlinenum':_0x324413[_0x69b4('0x6')],'transfererconnectedlinename':_0x324413[_0x69b4('0x7')],'transfereraccountcode':_0x324413[_0x69b4('0x8')],'transferercontext':_0x324413[_0x69b4('0x9')],'transfererexten':_0x324413[_0x69b4('0xa')],'transfererlinkedid':_0x324413['transfererlinkedid'],'transfereechannel':_0x324413[_0x69b4('0xb')],'transfereecalleridnum':_0x324413[_0x69b4('0xc')],'transfereecalleridname':_0x324413[_0x69b4('0xd')],'transfereeconnectedlinenum':_0x324413[_0x69b4('0xe')],'transfereeconnectedlinename':_0x324413[_0x69b4('0xf')],'transfereeaccountcode':_0x324413[_0x69b4('0x10')],'transfereecontext':_0x324413[_0x69b4('0x11')],'transfereeexten':_0x324413['transfereeexten'],'transfereelinkedid':_0x324413[_0x69b4('0x12')],'isexternal':_0x324413[_0x69b4('0x13')],'context':_0x324413[_0x69b4('0x14')],'extension':_0x324413[_0x69b4('0x15')],'type':_0x69b4('0x16')},'log':_0x69b4('0x17')});};exports[_0x69b4('0x18')]=function(_0x227700){return client[_0x69b4('0x2')](_0x69b4('0x17'),{'body':{'result':_0x227700[_0x69b4('0x3')],'transfererchannel':_0x227700[_0x69b4('0x19')],'transferercalleridnum':_0x227700[_0x69b4('0x1a')],'transferercalleridname':_0x227700[_0x69b4('0x1b')],'transfererconnectedlinenum':_0x227700[_0x69b4('0x1c')],'transfererconnectedlinename':_0x227700['secondtransfererconnectedlinename'],'transfereraccountcode':_0x227700[_0x69b4('0x1d')],'transferercontext':_0x227700[_0x69b4('0x1e')],'transfererexten':_0x227700[_0x69b4('0x1f')],'transfererlinkedid':_0x227700[_0x69b4('0x20')],'transfereechannel':_0x227700['transfertargetchannel'],'transfereecalleridnum':_0x227700[_0x69b4('0x21')],'transfereecalleridname':_0x227700[_0x69b4('0x22')],'transfereeconnectedlinenum':_0x227700[_0x69b4('0x23')],'transfereeconnectedlinename':_0x227700['transfertargetconnectedlinename'],'transfereeaccountcode':_0x227700['transfertargetaccountcode'],'transfereecontext':_0x227700['transfertargetcontext'],'transfereeexten':_0x227700[_0x69b4('0x24')],'transfereelinkedid':_0x227700[_0x69b4('0x25')],'isexternal':_0x227700[_0x69b4('0x13')],'context':_0x227700[_0x69b4('0x26')],'extension':_0x227700[_0x69b4('0x27')],'type':_0x69b4('0x28')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file +var _0xa545=['isexternal','context','extension','blind','attendedTransfer','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','origtransferercontext','attended','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid'];(function(_0x1ac37c,_0x3a1307){var _0x10ccde=function(_0x3dc0d5){while(--_0x3dc0d5){_0x1ac37c['push'](_0x1ac37c['shift']());}};_0x10ccde(++_0x3a1307);}(_0xa545,0xb1));var _0x5a54=function(_0x2071cc,_0x5d728e){_0x2071cc=_0x2071cc-0x0;var _0x31aa5d=_0xa545[_0x2071cc];return _0x31aa5d;};'use strict';var client=require('../client');exports['blindTransfer']=function(_0xeddd70){return client[_0x5a54('0x0')](_0x5a54('0x1'),{'body':{'result':_0xeddd70[_0x5a54('0x2')],'transfererchannel':_0xeddd70[_0x5a54('0x3')],'transferercalleridnum':_0xeddd70[_0x5a54('0x4')],'transferercalleridname':_0xeddd70[_0x5a54('0x5')],'transfererconnectedlinenum':_0xeddd70['transfererconnectedlinenum'],'transfererconnectedlinename':_0xeddd70['transfererconnectedlinename'],'transfereraccountcode':_0xeddd70[_0x5a54('0x6')],'transferercontext':_0xeddd70[_0x5a54('0x7')],'transfererexten':_0xeddd70[_0x5a54('0x8')],'transfererlinkedid':_0xeddd70[_0x5a54('0x9')],'transfereechannel':_0xeddd70['transfereechannel'],'transfereecalleridnum':_0xeddd70[_0x5a54('0xa')],'transfereecalleridname':_0xeddd70[_0x5a54('0xb')],'transfereeconnectedlinenum':_0xeddd70[_0x5a54('0xc')],'transfereeconnectedlinename':_0xeddd70[_0x5a54('0xd')],'transfereeaccountcode':_0xeddd70[_0x5a54('0xe')],'transfereecontext':_0xeddd70[_0x5a54('0xf')],'transfereeexten':_0xeddd70[_0x5a54('0x10')],'transfereelinkedid':_0xeddd70[_0x5a54('0x11')],'isexternal':_0xeddd70[_0x5a54('0x12')],'context':_0xeddd70[_0x5a54('0x13')],'extension':_0xeddd70[_0x5a54('0x14')],'type':_0x5a54('0x15')},'log':_0x5a54('0x1')});};exports[_0x5a54('0x16')]=function(_0x10a841){return client[_0x5a54('0x0')](_0x5a54('0x1'),{'body':{'result':_0x10a841['result'],'transfererchannel':_0x10a841['origtransfererchannel'],'transferercalleridnum':_0x10a841[_0x5a54('0x17')],'transferercalleridname':_0x10a841[_0x5a54('0x18')],'transfererconnectedlinenum':_0x10a841[_0x5a54('0x19')],'transfererconnectedlinename':_0x10a841['secondtransfererconnectedlinename'],'transfereraccountcode':_0x10a841[_0x5a54('0x1a')],'transferercontext':_0x10a841[_0x5a54('0x1b')],'transfererexten':_0x10a841[_0x5a54('0x1c')],'transfererlinkedid':_0x10a841[_0x5a54('0x1d')],'transfereechannel':_0x10a841[_0x5a54('0x1e')],'transfereecalleridnum':_0x10a841[_0x5a54('0x1f')],'transfereecalleridname':_0x10a841[_0x5a54('0x20')],'transfereeconnectedlinenum':_0x10a841['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x10a841[_0x5a54('0x21')],'transfereeaccountcode':_0x10a841[_0x5a54('0x22')],'transfereecontext':_0x10a841[_0x5a54('0x23')],'transfereeexten':_0x10a841['transfertargetexten'],'transfereelinkedid':_0x10a841[_0x5a54('0x24')],'isexternal':_0x10a841[_0x5a54('0x12')],'context':_0x10a841[_0x5a54('0x25')],'extension':_0x10a841['origtransfererexten'],'type':_0x5a54('0x26')},'log':_0x5a54('0x1')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index c6dc1d5..86ccd69 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 _0x0b07=['voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','campaigns','event','Event\x20name\x20mandatory','emit','custom:','send','server','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','bluebird','../properties','../ami','listen','format','SIP','timers','timer','updateAcw','agents','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','Reload','Action','then','message','catch','command','action','Command','content','voiceQueues','hasOwnProperty','name','answered','available','loggedIn','pTalking','sumHoldTime','talking','total','unmanaged','loggedInDb','type','outbound','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCallToSecond','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','values','channels','voicechannel','map','find','uniqueid','%s.%s','filename','wav','MixMonitor','channel','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','rec','mixmonitorid','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','status','stop','voicequeuechannel','queueChannels','voicequeuechannelhangup','Hangup'];(function(_0x5ed243,_0xf69b31){var _0x2f4a2d=function(_0x2c727f){while(--_0x2c727f){_0x5ed243['push'](_0x5ed243['shift']());}};_0x2f4a2d(++_0xf69b31);}(_0x0b07,0x90));var _0x70b0=function(_0x18fdaf,_0x457de2){_0x18fdaf=_0x18fdaf-0x0;var _0x557a9b=_0x0b07[_0x18fdaf];return _0x557a9b;};'use strict';var _=require(_0x70b0('0x0'));var util=require('util');var jayson=require(_0x70b0('0x1'));var schema=require(_0x70b0('0x2'));var BPromise=require(_0x70b0('0x3'));var moment=require('moment');var config=require('../../../config/environment');var properties=require(_0x70b0('0x4'));var ami=require(_0x70b0('0x5'));exports[_0x70b0('0x6')]=function(_0x45152a,_0x5caaaf,_0x6713f2){return new BPromise(function(_0x8d3a07,_0x476734){var _0x5549e3={'QueuePause':function(_0x40a785){return new Promise(function(_0x1fce03,_0x382d45){var _0x5554db=util[_0x70b0('0x7')]('%s/%s',_0x70b0('0x8'),_0x40a785['name']);if(_0x45152a[_0x70b0('0x9')]&&_0x45152a['timers'][_0x5554db]&&_0x45152a[_0x70b0('0x9')][_0x5554db][_0x70b0('0xa')]){_0x45152a[_0x70b0('0x9')][_0x5554db][_0x70b0('0xb')]();}if(_0x45152a['agents'][_0x5554db]){_0x45152a[_0x70b0('0xc')][_0x5554db]['updateStatusRealtime']({'statePause':_0x40a785['pause']?!![]:![]});}_0x1fce03({'code':0xc8,'message':_0x70b0('0xd')});});},'Reload':function(_0x26f3ce){var _0x2684d2=this;return new Promise(function(_0x5bd1c0,_0x3b6412){if(ami[_0x70b0('0xe')]()==![]){return _0x3b6412(_0x2684d2[_0x70b0('0xf')](0x1f4,[config[_0x70b0('0x10')]['ip'],config[_0x70b0('0x10')][_0x70b0('0x11')],_0x70b0('0x12')][_0x70b0('0x13')]('\x20')));}_0x26f3ce=_[_0x70b0('0x14')](_0x26f3ce,_[_0x70b0('0x15')](properties['module']));_0x26f3ce['action']=_0x70b0('0x16');return ami[_0x70b0('0x17')](_0x26f3ce)[_0x70b0('0x18')](function(_0x4001fd){_0x5bd1c0({'code':0xc8,'message':_0x4001fd[_0x70b0('0x19')]});})[_0x70b0('0x1a')](function(_0x7c6e37){_0x3b6412(_0x2684d2[_0x70b0('0xf')](0x1f5,_0x7c6e37[_0x70b0('0x19')]));});});},'Command':function(_0x5bcc0a){var _0x212ca9=this;return new Promise(function(_0x47c44e,_0x4daf6e){if(ami['isConnected']()==![]){return _0x4daf6e(_0x212ca9[_0x70b0('0xf')](0x1f4,[config[_0x70b0('0x10')]['ip'],config['asterisk'][_0x70b0('0x11')],_0x70b0('0x12')][_0x70b0('0x13')]('\x20')));}_0x5bcc0a=_[_0x70b0('0x14')](_0x5bcc0a,_0x70b0('0x1b'));_0x5bcc0a[_0x70b0('0x1c')]=_0x70b0('0x1d');return ami['Action'](_0x5bcc0a)['then'](function(_0x4cf150){_0x47c44e({'code':0xc8,'message':_0x4cf150[_0x70b0('0x1e')]});})[_0x70b0('0x1a')](function(_0x568e83){_0x4daf6e(_0x212ca9[_0x70b0('0xf')](0x1f5,_0x568e83[_0x70b0('0x19')]));});});},'VoiceQueues':function(_0x28f5fd){return new Promise(function(_0x379793,_0x138913){var _0x2e79c=[];for(var _0x38679f in _0x45152a[_0x70b0('0x1f')]){if(_0x45152a[_0x70b0('0x1f')][_0x70b0('0x20')](_0x38679f)){var _0x293a2e=_0x45152a[_0x70b0('0x1f')][_0x38679f];var _0x42efba={'id':_0x293a2e['id'],'name':_0x293a2e[_0x70b0('0x21')],'strategy':_0x293a2e['strategy'],'answered':_0x293a2e[_0x70b0('0x22')],'available':_0x293a2e[_0x70b0('0x23')],'loggedIn':_0x293a2e[_0x70b0('0x24')],'pTalking':_0x293a2e[_0x70b0('0x25')],'sumBillable':_0x293a2e['sumBillable'],'sumDuration':_0x293a2e['sumDuration'],'sumHoldTime':_0x293a2e[_0x70b0('0x26')]||0x0,'talking':_0x293a2e[_0x70b0('0x27')],'total':_0x293a2e[_0x70b0('0x28')],'type':_0x293a2e['type'],'unmanaged':_0x293a2e[_0x70b0('0x29')],'abandoned':_0x293a2e['abandoned'],'waiting':_0x293a2e['waiting'],'loggedInDb':_0x293a2e[_0x70b0('0x2a')]};if(_0x293a2e[_0x70b0('0x2b')]===_0x70b0('0x2c')){_0x42efba['dialActive']=_0x293a2e['dialActive'];_0x42efba[_0x70b0('0x2d')]=_0x293a2e[_0x70b0('0x2d')];_0x42efba[_0x70b0('0x2e')]=_0x293a2e[_0x70b0('0x2e')];_0x42efba[_0x70b0('0x2f')]=_0x293a2e[_0x70b0('0x2f')];_0x42efba[_0x70b0('0x30')]=_0x293a2e[_0x70b0('0x30')];_0x42efba[_0x70b0('0x31')]=_0x293a2e['dialPrefix'];_0x42efba[_0x70b0('0x32')]=_0x293a2e[_0x70b0('0x32')];_0x42efba[_0x70b0('0x33')]=_0x293a2e[_0x70b0('0x33')];_0x42efba[_0x70b0('0x34')]=_0x293a2e[_0x70b0('0x34')];_0x42efba[_0x70b0('0x35')]=_0x293a2e[_0x70b0('0x35')];_0x42efba['outboundCongestionCallsDay']=_0x293a2e[_0x70b0('0x36')];_0x42efba['outboundDropCallsDayACS']=_0x293a2e['outboundDropCallsDayACS'];_0x42efba['outboundDropCallsDayCallersExit']=_0x293a2e['outboundDropCallsDayCallersExit'];_0x42efba[_0x70b0('0x37')]=_0x293a2e[_0x70b0('0x37')];_0x42efba[_0x70b0('0x38')]=_0x293a2e[_0x70b0('0x38')];_0x42efba[_0x70b0('0x39')]=_0x293a2e[_0x70b0('0x39')];_0x42efba['outboundOriginateFailureCallsDay']=_0x293a2e[_0x70b0('0x3a')];_0x42efba['outboundReCallsDay']=_0x293a2e[_0x70b0('0x3b')];_0x42efba['outboundRejectCallsDay']=_0x293a2e[_0x70b0('0x3c')];_0x42efba[_0x70b0('0x3d')]=_0x293a2e['outboundUnknownCallsDay'];_0x42efba[_0x70b0('0x3e')]=_0x293a2e[_0x70b0('0x3e')];_0x42efba['predictiveIntervalAvgHoldtime']=_0x293a2e['predictiveIntervalAvgHoldtime'];_0x42efba[_0x70b0('0x3f')]=_0x293a2e[_0x70b0('0x3f')];_0x42efba['predictiveIntervalDroppedCallsCallersExit']=_0x293a2e['predictiveIntervalDroppedCallsCallersExit'];_0x42efba[_0x70b0('0x40')]=_0x293a2e[_0x70b0('0x40')];_0x42efba[_0x70b0('0x41')]=_0x293a2e[_0x70b0('0x41')];_0x42efba[_0x70b0('0x42')]=_0x293a2e[_0x70b0('0x42')];_0x42efba[_0x70b0('0x43')]=_0x293a2e[_0x70b0('0x43')];_0x42efba[_0x70b0('0x44')]=_0x293a2e[_0x70b0('0x44')];_0x42efba['predictiveIntervalPauses']=_0x293a2e[_0x70b0('0x45')];_0x42efba['predictiveIntervalAvailable']=_0x293a2e[_0x70b0('0x46')];_0x42efba[_0x70b0('0x47')]=_0x293a2e[_0x70b0('0x47')];_0x42efba['message']=_0x293a2e[_0x70b0('0x19')];_0x42efba[_0x70b0('0x48')]=_0x293a2e[_0x70b0('0x48')];_0x42efba['erlangCalls']=_0x293a2e['erlangCalls'];_0x42efba['erlangCallToSecond']=_0x293a2e[_0x70b0('0x49')];_0x42efba['erlangAbandonmentRate']=_0x293a2e['erlangAbandonmentRate'];_0x42efba['erlangBusyFactor']=_0x293a2e['erlangBusyFactor'];_0x42efba[_0x70b0('0x4a')]=_0x293a2e[_0x70b0('0x4a')];_0x42efba[_0x70b0('0x4b')]=_0x293a2e[_0x70b0('0x4b')];}if(_0x293a2e[_0x70b0('0x4c')]){_0x42efba[_0x70b0('0x4c')]={'id':_0x293a2e['Trunk']['id'],'name':_0x293a2e[_0x70b0('0x4c')]['name'],'active':_0x293a2e[_0x70b0('0x4c')][_0x70b0('0x4d')],'callerid':_0x293a2e[_0x70b0('0x4c')][_0x70b0('0x4e')]};}if(_0x293a2e['Interval']){_0x42efba[_0x70b0('0x4f')]={'id':_0x293a2e[_0x70b0('0x4f')]['id'],'name':_0x293a2e[_0x70b0('0x4f')]['name']};}_0x2e79c[_0x70b0('0x50')](_0x42efba);}}_0x379793({'count':_0x2e79c[_0x70b0('0x51')],'rows':_0x2e79c});});},'VoiceChannels':function(_0x3d33f0){return new Promise(function(_0x5d9f9b,_0x176b51){var _0x2a31e0=_[_0x70b0('0x52')](_0x45152a[_0x70b0('0x53')]);_0x5d9f9b({'count':_0x2a31e0[_0x70b0('0x51')],'rows':_0x2a31e0});});},'VoiceChannelMixMonitor':function(_0x2a48df){var _0x28bc02=this;return new Promise(function(_0x3a1633,_0x58cd7b){if(ami[_0x70b0('0xe')]()==![]){return _0x58cd7b(_0x28bc02[_0x70b0('0xf')](0x1f4,[config[_0x70b0('0x10')]['ip'],config[_0x70b0('0x10')][_0x70b0('0x11')],_0x70b0('0x12')][_0x70b0('0x13')]('\x20')));}var _0x4e5933=schema(properties[_0x70b0('0x54')])[_0x70b0('0x2')](_0x2a48df);if(_0x4e5933['length']>0x0){return _0x58cd7b(_0x28bc02[_0x70b0('0xf')](0x1f4,_[_0x70b0('0x55')](_0x4e5933,_0x70b0('0x19'))[_0x70b0('0x13')](',\x20')));}var _0x30584a=_[_0x70b0('0x56')](_0x45152a[_0x70b0('0x53')],{'uniqueid':_0x2a48df[_0x70b0('0x57')]});if(_0x30584a&&_0x30584a['channel']){var _0x6686ff=util[_0x70b0('0x7')](_0x70b0('0x58'),_0x2a48df[_0x70b0('0x59')]||_0x2a48df[_0x70b0('0x57')],_0x2a48df['format']||_0x70b0('0x5a'));return ami[_0x70b0('0x17')]({'action':_0x70b0('0x5b'),'channel':_0x30584a[_0x70b0('0x5c')],'file':_0x6686ff,'options':'ai(mixmonitorid)'})[_0x70b0('0x18')](function(_0xe1619b){var _0x1890bf=_[_0x70b0('0x56')](_0x30584a[_0x70b0('0x5d')],{'filename':_0x70b0('0x5e')+_0x6686ff[_0x70b0('0x5f')]()});if(_[_0x70b0('0x60')](_0x1890bf)){_0x30584a['monitors'][_0x70b0('0x50')]({'filename':_0x70b0('0x5e')+_0x6686ff[_0x70b0('0x5f')](),'createdAt':moment()[_0x70b0('0x7')](_0x70b0('0x61')),'mixmonitorid':_0xe1619b['mixmonitorid'],'status':_0x70b0('0x62')});}else{_0x1890bf[_0x70b0('0x63')]=_0xe1619b[_0x70b0('0x63')];_0x1890bf['status']=_0x70b0('0x62');}_0x3a1633({'code':0xc8,'message':[_0x2a48df[_0x70b0('0x57')],'MixMonitor\x20Success',_0xe1619b['mixmonitorid']][_0x70b0('0x13')]('\x20'),'mixmonitorid':_0xe1619b[_0x70b0('0x63')]});})[_0x70b0('0x1a')](function(_0xa7220d){_0x58cd7b(_0x28bc02['error'](0x1f5,[_0x2a48df[_0x70b0('0x57')],_0xa7220d[_0x70b0('0x19')][_0x70b0('0x5f')]()][_0x70b0('0x13')]('\x20')));});}else{return _0x58cd7b(_0x28bc02[_0x70b0('0xf')](0x1f5,_0x70b0('0x64')));}});},'VoiceChannelStopMixMonitor':function(_0x3e711d){var _0x52c39d=this;return new Promise(function(_0xf12369,_0x4a9557){if(ami['isConnected']()==![]){return _0x4a9557(_0x52c39d[_0x70b0('0xf')](0x1f4,[config[_0x70b0('0x10')]['ip'],config[_0x70b0('0x10')][_0x70b0('0x11')],_0x70b0('0x12')][_0x70b0('0x13')]('\x20')));}var _0x57b0a9=schema(properties[_0x70b0('0x54')])[_0x70b0('0x2')](_0x3e711d);if(_0x57b0a9[_0x70b0('0x51')]>0x0){return _0x4a9557(_0x52c39d[_0x70b0('0xf')](0x1f4,_[_0x70b0('0x55')](_0x57b0a9,'message')[_0x70b0('0x13')](',\x20')));}var _0x43b4b6=_[_0x70b0('0x56')](_0x45152a[_0x70b0('0x53')],{'uniqueid':_0x3e711d[_0x70b0('0x57')]});if(_0x43b4b6){return BPromise[_0x70b0('0x65')]()[_0x70b0('0x18')](function(){if(_0x43b4b6[_0x70b0('0x5c')]){return ami[_0x70b0('0x17')]({'action':_0x70b0('0x66'),'channel':_0x43b4b6[_0x70b0('0x5c')],'mixmonitorid':_0x3e711d[_0x70b0('0x63')]})[_0x70b0('0x1a')](function(_0x28f6b6){});}})['then'](function(){if(_0x43b4b6[_0x70b0('0x67')]){return ami['Action']({'action':_0x70b0('0x66'),'channel':_0x43b4b6[_0x70b0('0x67')],'mixmonitorid':_0x3e711d[_0x70b0('0x63')]})[_0x70b0('0x1a')](function(_0x20f4b1){});}})[_0x70b0('0x18')](function(_0x4f8d77){var _0x2c3416=_[_0x70b0('0x56')](_0x43b4b6[_0x70b0('0x5d')],{'mixmonitorid':_0x3e711d[_0x70b0('0x63')]});if(_0x2c3416){_0x2c3416[_0x70b0('0x68')]=_0x70b0('0x69');}})[_0x70b0('0x18')](function(){var _0x469016=util[_0x70b0('0x7')](_0x70b0('0x58'),_0x3e711d['filename']||_0x3e711d['uniqueid'],_0x3e711d[_0x70b0('0x7')]||_0x70b0('0x5a'));var _0x5630d4=_[_0x70b0('0x56')](_0x43b4b6[_0x70b0('0x5d')],{'filename':_0x70b0('0x5e')+_0x469016[_0x70b0('0x5f')]()});if(_0x5630d4){_0x5630d4[_0x70b0('0x68')]='stop';}})['then'](function(){_0xf12369({'code':0xc8,'message':[_0x3e711d[_0x70b0('0x57')],'StopMixMonitor\x20Success'][_0x70b0('0x13')]('\x20')});})[_0x70b0('0x1a')](function(_0x55a399){_0x4a9557(_0x52c39d[_0x70b0('0xf')](0x1f5,[_0x3e711d[_0x70b0('0x57')],_0x55a399['message'][_0x70b0('0x5f')]()]['join']('\x20')));});}else{return _0x4a9557(_0x52c39d[_0x70b0('0xf')](0x1f5,_0x70b0('0x64')));}});},'VoiceQueuesChannels':function(_0x203d7){return new Promise(function(_0x3e328e,_0x277786){var _0x473e46=_[_0x70b0('0x52')](_0x45152a['queueChannels']);_0x3e328e({'count':_0x473e46[_0x70b0('0x51')],'rows':_0x473e46});});},'VoiceQueuesChannel':function(_0x5d3418){var _0x5c6b59=this;return new Promise(function(_0x274848,_0xf8295){var _0x2c2eab=schema(properties[_0x70b0('0x6a')])['validate'](_0x5d3418);if(_0x2c2eab['length']>0x0){return _0xf8295(_0x5c6b59[_0x70b0('0xf')](0x1f4,_[_0x70b0('0x55')](_0x2c2eab,'message')[_0x70b0('0x13')](',\x20')));}var _0x55e477=_['find'](_0x45152a[_0x70b0('0x6b')],{'uniqueid':_0x5d3418[_0x70b0('0x57')]});if(_0x55e477){_0x274848(_0x55e477);}else{return _0xf8295(_0x5c6b59['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x963d28){var _0x3895ad=this;return new Promise(function(_0x56cee4,_0x576b20){if(ami[_0x70b0('0xe')]()==![]){return _0x576b20(_0x3895ad['error'](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0x70b0('0x11')],'ami\x20disconnected'][_0x70b0('0x13')]('\x20')));}var _0x379381=schema(properties[_0x70b0('0x6c')])['validate'](_0x963d28);if(_0x379381[_0x70b0('0x51')]>0x0){return _0x576b20(_0x3895ad[_0x70b0('0xf')](0x1f4,_[_0x70b0('0x55')](_0x379381,'message')[_0x70b0('0x13')](',\x20')));}var _0x4efe86=_['find'](_0x45152a[_0x70b0('0x6b')],{'uniqueid':_0x963d28['uniqueid']});if(_0x4efe86&&_0x4efe86[_0x70b0('0x5c')]){return ami[_0x70b0('0x17')]({'action':_0x70b0('0x6d'),'channel':_0x4efe86[_0x70b0('0x5c')]})[_0x70b0('0x18')](function(_0x2ed091){_0x56cee4({'code':0xc8,'message':[_0x963d28[_0x70b0('0x57')],_0x2ed091[_0x70b0('0x19')][_0x70b0('0x5f')]()][_0x70b0('0x13')]('\x20')});})[_0x70b0('0x1a')](function(_0xe94d49){_0x576b20(_0x3895ad[_0x70b0('0xf')](0x1f5,[_0x963d28['uniqueid'],_0xe94d49['message'][_0x70b0('0x5f')]()][_0x70b0('0x13')]('\x20')));});}else{return _0x576b20(_0x3895ad[_0x70b0('0xf')](0x1f5,_0x70b0('0x64')));}});},'VoiceQueuesChannelRedirect':function(_0x11615b){var _0x45a6cd=this;return new Promise(function(_0x24f1b8,_0x10dde5){if(ami[_0x70b0('0xe')]()==![]){return _0x10dde5(_0x45a6cd['error'](0x1f4,[config[_0x70b0('0x10')]['ip'],config['asterisk']['username'],_0x70b0('0x12')][_0x70b0('0x13')]('\x20')));}var _0x221269=schema(properties[_0x70b0('0x6e')])['validate'](_0x11615b);if(_0x221269[_0x70b0('0x51')]>0x0){return _0x10dde5(_0x45a6cd[_0x70b0('0xf')](0x1f4,_[_0x70b0('0x55')](_0x221269,_0x70b0('0x19'))[_0x70b0('0x13')](',\x20')));}var _0x4d64ab=_['find'](_0x45152a[_0x70b0('0x6b')],{'uniqueid':_0x11615b[_0x70b0('0x57')]});if(_0x4d64ab&&_0x4d64ab[_0x70b0('0x5c')]){return ami[_0x70b0('0x17')]({'action':_0x70b0('0x6f'),'channel':_0x4d64ab[_0x70b0('0x5c')],'exten':_0x11615b[_0x70b0('0x70')],'context':_0x11615b['context']||_0x4d64ab[_0x70b0('0x71')],'priority':0x1})[_0x70b0('0x18')](function(_0x6a5f0d){_0x24f1b8({'code':0xc8,'message':[_0x11615b['uniqueid'],_0x6a5f0d[_0x70b0('0x19')]['toLowerCase']()][_0x70b0('0x13')]('\x20')});})['catch'](function(_0x3a74c9){_0x10dde5(_0x45a6cd['error'](0x1f5,[_0x11615b[_0x70b0('0x57')],_0x3a74c9[_0x70b0('0x19')][_0x70b0('0x5f')]()][_0x70b0('0x13')]('\x20')));});}else{return _0x10dde5(_0x45a6cd[_0x70b0('0xf')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x489515){return new Promise(function(_0x5e2331,_0x1e721c){var _0x45e3aa=_['values'](_0x45152a[_0x70b0('0xc')]);_0x5e2331({'count':_0x45e3aa['length'],'rows':_0x45e3aa});});},'Telephones':function(_0x197df0){return new Promise(function(_0x31e3bd,_0x23f3e3){var _0x3c39b6=_[_0x70b0('0x52')](_0x45152a[_0x70b0('0x72')]);_0x31e3bd({'count':_0x3c39b6[_0x70b0('0x51')],'rows':_0x3c39b6});});},'Trunks':function(_0x42a927){return new Promise(function(_0x6a51fa,_0x451437){var _0x364784=_[_0x70b0('0x52')](_0x45152a[_0x70b0('0x73')]);_0x6a51fa({'count':_0x364784[_0x70b0('0x51')],'rows':_0x364784});});},'OutboundChannels':function(_0xde0341){return new Promise(function(_0x4163ef,_0x18084d){var _0x462353=_[_0x70b0('0x52')](_0x45152a[_0x70b0('0x74')]);_0x4163ef({'count':_0x462353[_0x70b0('0x51')],'rows':_0x462353});});},'Outbound':function(_0x1bfdfd){return new Promise(function(_0x1f9e6d,_0x366403){_0x1f9e6d(_0x45152a[_0x70b0('0x2c')]);});},'Campaigns':function(_0x45f04c){return new Promise(function(_0x1f5dd0,_0x4a1389){var _0x4dcc7f=_[_0x70b0('0x52')](_0x45152a[_0x70b0('0x75')]);_0x1f5dd0({'count':_0x4dcc7f[_0x70b0('0x51')],'rows':_0x4dcc7f});});},'VoiceQueuesPreview':function(_0xa41afa){var _0x34954a=this;return new Promise(function(_0x23c908,_0x38b09a){_0x5caaaf['run'](_0xa41afa['id'])[_0x70b0('0x18')](function(_0x4a31e1){_0x23c908({'code':0xc8,'message':_0x4a31e1['message']});})['catch'](function(_0x565ad8){_0x38b09a(_0x34954a[_0x70b0('0xf')](0x1f4,_0x565ad8[_0x70b0('0x19')]));});});},'EventManager':function(_0x424dd3){var _0x31d8ec=this;return new Promise(function(_0xb8514c,_0x2b15bb){if(!_0x424dd3[_0x70b0('0x76')]){return _0x2b15bb(_0x31d8ec[_0x70b0('0xf')](0x1f4,_0x70b0('0x77')));}ami[_0x70b0('0x78')](_0x70b0('0x79')+_0x424dd3['event'],_0x424dd3[_0x70b0('0x19')]);_0xb8514c({'code':0xc8,'message':_0x424dd3});});},'FaxAccounts':function(_0x41785f){return new Promise(function(_0x3a40e2,_0x221ec7){var _0x51858b=_[_0x70b0('0x52')](_0x45152a['faxAccounts']);_0x3a40e2({'count':_0x51858b[_0x70b0('0x51')],'rows':_0x51858b});});},'SendFax':function(_0x17512d){var _0x31afff=this;return new Promise(function(_0x246535,_0x527a06){_0x6713f2[_0x70b0('0x7a')](_0x17512d)[_0x70b0('0x18')](function(_0x381a50){_0x246535({'code':0xc8,'message':_0x381a50['message']});})[_0x70b0('0x1a')](function(_0x39669a){_0x527a06(_0x31afff['error'](0x1f4,_0x39669a[_0x70b0('0x19')]));});});},'CheckAfterSend':function(_0xfc839a){var _0x284523=this;return new Promise(function(_0x14fac0,_0x5e0601){_0x6713f2['checkAfterSend'](_0xfc839a)[_0x70b0('0x18')](function(_0x3e0174){_0x14fac0({'code':0xc8,'message':_0x3e0174['message']});})['catch'](function(_0xd68eaa){_0x5e0601(_0x284523[_0x70b0('0xf')](0x1f4,_0xd68eaa[_0x70b0('0x19')]));});});}};var _0x32c222=jayson[_0x70b0('0x7b')](_0x5549e3)['http']();_0x32c222['on'](_0x70b0('0xf'),function(_0x1175f3){return _0x476734(_0x1175f3);});_0x32c222[_0x70b0('0x6')](0x232a,_0x70b0('0x7c'),function(){console['log'](_0x70b0('0x7d'),0x232a);return _0x8d3a07(_0x70b0('0x7e')+0x232a);});});}; \ No newline at end of file +var _0x32be=['127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','bluebird','moment','../../../config/environment','../properties','../ami','listen','format','name','timers','timer','agents','updateStatusRealtime','pause','QueuePause','error','asterisk','username','ami\x20disconnected','join','pick','keys','action','Reload','then','message','isConnected','Command','Action','content','hasOwnProperty','voiceQueues','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','waiting','loggedInDb','type','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','voicechannel','map','find','channels','uniqueid','channel','%s.%s','wav','MixMonitor','monitors','isNil','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','length','StopMixMonitor','catch','destinationchannel','filename','stop','StopMixMonitor\x20Success','values','voicequeuechannel','queueChannels','voicequeuechannelhangup','Hangup','Redirect','exten','context','telephones','trunks','outboundChannels','run','event','emit','custom:','faxAccounts','checkAfterSend','server','http'];(function(_0x1dd034,_0x5f5a76){var _0x4ecb48=function(_0x18ee58){while(--_0x18ee58){_0x1dd034['push'](_0x1dd034['shift']());}};_0x4ecb48(++_0x5f5a76);}(_0x32be,0x8e));var _0xe32b=function(_0x4589fd,_0x4c6f26){_0x4589fd=_0x4589fd-0x0;var _0x44084b=_0x32be[_0x4589fd];return _0x44084b;};'use strict';var _=require(_0xe32b('0x0'));var util=require(_0xe32b('0x1'));var jayson=require(_0xe32b('0x2'));var schema=require(_0xe32b('0x3'));var BPromise=require(_0xe32b('0x4'));var moment=require(_0xe32b('0x5'));var config=require(_0xe32b('0x6'));var properties=require(_0xe32b('0x7'));var ami=require(_0xe32b('0x8'));exports[_0xe32b('0x9')]=function(_0x5f2efc,_0x4bd5de,_0x33c36a){return new BPromise(function(_0x37d5b5,_0x2aae63){var _0x4a3724={'QueuePause':function(_0x128369){return new Promise(function(_0x1cddea,_0x5573fa){var _0x5cf34e=util[_0xe32b('0xa')]('%s/%s','SIP',_0x128369[_0xe32b('0xb')]);if(_0x5f2efc['timers']&&_0x5f2efc[_0xe32b('0xc')][_0x5cf34e]&&_0x5f2efc['timers'][_0x5cf34e][_0xe32b('0xd')]){_0x5f2efc['timers'][_0x5cf34e]['updateAcw']();}if(_0x5f2efc[_0xe32b('0xe')][_0x5cf34e]){_0x5f2efc['agents'][_0x5cf34e][_0xe32b('0xf')]({'statePause':_0x128369[_0xe32b('0x10')]?!![]:![]});}_0x1cddea({'code':0xc8,'message':_0xe32b('0x11')});});},'Reload':function(_0x466c24){var _0x3a6dc2=this;return new Promise(function(_0x18897c,_0x3dfd25){if(ami['isConnected']()==![]){return _0x3dfd25(_0x3a6dc2[_0xe32b('0x12')](0x1f4,[config[_0xe32b('0x13')]['ip'],config['asterisk'][_0xe32b('0x14')],_0xe32b('0x15')][_0xe32b('0x16')]('\x20')));}_0x466c24=_[_0xe32b('0x17')](_0x466c24,_[_0xe32b('0x18')](properties['module']));_0x466c24[_0xe32b('0x19')]=_0xe32b('0x1a');return ami['Action'](_0x466c24)[_0xe32b('0x1b')](function(_0x36ae63){_0x18897c({'code':0xc8,'message':_0x36ae63[_0xe32b('0x1c')]});})['catch'](function(_0x48138b){_0x3dfd25(_0x3a6dc2[_0xe32b('0x12')](0x1f5,_0x48138b[_0xe32b('0x1c')]));});});},'Command':function(_0x19d416){var _0x3a5294=this;return new Promise(function(_0xf31f0f,_0x4618fb){if(ami[_0xe32b('0x1d')]()==![]){return _0x4618fb(_0x3a5294[_0xe32b('0x12')](0x1f4,[config[_0xe32b('0x13')]['ip'],config[_0xe32b('0x13')][_0xe32b('0x14')],'ami\x20disconnected'][_0xe32b('0x16')]('\x20')));}_0x19d416=_[_0xe32b('0x17')](_0x19d416,'command');_0x19d416[_0xe32b('0x19')]=_0xe32b('0x1e');return ami[_0xe32b('0x1f')](_0x19d416)[_0xe32b('0x1b')](function(_0x4aa0ef){_0xf31f0f({'code':0xc8,'message':_0x4aa0ef[_0xe32b('0x20')]});})['catch'](function(_0x50c581){_0x4618fb(_0x3a5294[_0xe32b('0x12')](0x1f5,_0x50c581['message']));});});},'VoiceQueues':function(_0xe16e9b){return new Promise(function(_0x34a4d2,_0x5b977f){var _0x57e798=[];for(var _0x3b5572 in _0x5f2efc['voiceQueues']){if(_0x5f2efc['voiceQueues'][_0xe32b('0x21')](_0x3b5572)){var _0x1fad91=_0x5f2efc[_0xe32b('0x22')][_0x3b5572];var _0x1f8b4a={'id':_0x1fad91['id'],'name':_0x1fad91[_0xe32b('0xb')],'strategy':_0x1fad91[_0xe32b('0x23')],'answered':_0x1fad91[_0xe32b('0x24')],'available':_0x1fad91[_0xe32b('0x25')],'loggedIn':_0x1fad91[_0xe32b('0x26')],'pTalking':_0x1fad91[_0xe32b('0x27')],'sumBillable':_0x1fad91[_0xe32b('0x28')],'sumDuration':_0x1fad91[_0xe32b('0x29')],'sumHoldTime':_0x1fad91[_0xe32b('0x2a')]||0x0,'talking':_0x1fad91[_0xe32b('0x2b')],'total':_0x1fad91['total'],'type':_0x1fad91['type'],'unmanaged':_0x1fad91['unmanaged'],'abandoned':_0x1fad91['abandoned'],'waiting':_0x1fad91[_0xe32b('0x2c')],'loggedInDb':_0x1fad91[_0xe32b('0x2d')]};if(_0x1fad91[_0xe32b('0x2e')]==='outbound'){_0x1f8b4a[_0xe32b('0x2f')]=_0x1fad91['dialActive'];_0x1f8b4a['dialMethod']=_0x1fad91[_0xe32b('0x30')];_0x1f8b4a['dialOriginateCallerIdName']=_0x1fad91[_0xe32b('0x31')];_0x1f8b4a[_0xe32b('0x32')]=_0x1fad91[_0xe32b('0x32')];_0x1f8b4a[_0xe32b('0x33')]=_0x1fad91[_0xe32b('0x33')];_0x1f8b4a['dialPrefix']=_0x1fad91[_0xe32b('0x34')];_0x1f8b4a['outboundAnswerAgiCallsDay']=_0x1fad91[_0xe32b('0x35')];_0x1f8b4a[_0xe32b('0x36')]=_0x1fad91[_0xe32b('0x36')];_0x1f8b4a[_0xe32b('0x37')]=_0x1fad91[_0xe32b('0x37')];_0x1f8b4a['outboundBusyCallsDay']=_0x1fad91[_0xe32b('0x38')];_0x1f8b4a[_0xe32b('0x39')]=_0x1fad91['outboundCongestionCallsDay'];_0x1f8b4a['outboundDropCallsDayACS']=_0x1fad91[_0xe32b('0x3a')];_0x1f8b4a['outboundDropCallsDayCallersExit']=_0x1fad91[_0xe32b('0x3b')];_0x1f8b4a['outboundDropCallsDayTimeout']=_0x1fad91[_0xe32b('0x3c')];_0x1f8b4a[_0xe32b('0x3d')]=_0x1fad91['outboundNoAnswerCallsDay'];_0x1f8b4a[_0xe32b('0x3e')]=_0x1fad91[_0xe32b('0x3e')];_0x1f8b4a[_0xe32b('0x3f')]=_0x1fad91[_0xe32b('0x3f')];_0x1f8b4a[_0xe32b('0x40')]=_0x1fad91[_0xe32b('0x40')];_0x1f8b4a[_0xe32b('0x41')]=_0x1fad91[_0xe32b('0x41')];_0x1f8b4a['outboundUnknownCallsDay']=_0x1fad91[_0xe32b('0x42')];_0x1f8b4a[_0xe32b('0x43')]=_0x1fad91['predictiveIntervalAnsweredCalls'];_0x1f8b4a[_0xe32b('0x44')]=_0x1fad91[_0xe32b('0x44')];_0x1f8b4a[_0xe32b('0x45')]=_0x1fad91[_0xe32b('0x45')];_0x1f8b4a[_0xe32b('0x46')]=_0x1fad91[_0xe32b('0x46')];_0x1f8b4a[_0xe32b('0x47')]=_0x1fad91[_0xe32b('0x47')];_0x1f8b4a[_0xe32b('0x48')]=_0x1fad91[_0xe32b('0x48')];_0x1f8b4a['predictiveIntervalErlangCallsDroppedCalls']=_0x1fad91[_0xe32b('0x49')];_0x1f8b4a[_0xe32b('0x4a')]=_0x1fad91['predictiveIntervalHitRate'];_0x1f8b4a[_0xe32b('0x4b')]=_0x1fad91[_0xe32b('0x4b')];_0x1f8b4a[_0xe32b('0x4c')]=_0x1fad91[_0xe32b('0x4c')];_0x1f8b4a[_0xe32b('0x4d')]=_0x1fad91['predictiveIntervalAvailable'];_0x1f8b4a[_0xe32b('0x4e')]=_0x1fad91[_0xe32b('0x4e')];_0x1f8b4a['message']=_0x1fad91[_0xe32b('0x1c')];_0x1f8b4a[_0xe32b('0x4f')]=_0x1fad91[_0xe32b('0x4f')];_0x1f8b4a[_0xe32b('0x50')]=_0x1fad91['erlangCalls'];_0x1f8b4a[_0xe32b('0x51')]=_0x1fad91[_0xe32b('0x51')];_0x1f8b4a[_0xe32b('0x52')]=_0x1fad91[_0xe32b('0x52')];_0x1f8b4a[_0xe32b('0x53')]=_0x1fad91['erlangBusyFactor'];_0x1f8b4a['startPredictive']=_0x1fad91[_0xe32b('0x54')];_0x1f8b4a[_0xe32b('0x55')]=_0x1fad91['startProgressive'];}if(_0x1fad91['Trunk']){_0x1f8b4a[_0xe32b('0x56')]={'id':_0x1fad91['Trunk']['id'],'name':_0x1fad91['Trunk'][_0xe32b('0xb')],'active':_0x1fad91[_0xe32b('0x56')][_0xe32b('0x57')],'callerid':_0x1fad91[_0xe32b('0x56')][_0xe32b('0x58')]};}if(_0x1fad91[_0xe32b('0x59')]){_0x1f8b4a[_0xe32b('0x59')]={'id':_0x1fad91[_0xe32b('0x59')]['id'],'name':_0x1fad91[_0xe32b('0x59')][_0xe32b('0xb')]};}_0x57e798[_0xe32b('0x5a')](_0x1f8b4a);}}_0x34a4d2({'count':_0x57e798['length'],'rows':_0x57e798});});},'VoiceChannels':function(_0xbde84c){return new Promise(function(_0x4183b4,_0xfacd19){var _0x32bec6=_['values'](_0x5f2efc['channels']);_0x4183b4({'count':_0x32bec6['length'],'rows':_0x32bec6});});},'VoiceChannelMixMonitor':function(_0x7ba669){var _0x271191=this;return new Promise(function(_0x14923b,_0x2cd7b9){if(ami['isConnected']()==![]){return _0x2cd7b9(_0x271191['error'](0x1f4,[config['asterisk']['ip'],config[_0xe32b('0x13')][_0xe32b('0x14')],_0xe32b('0x15')][_0xe32b('0x16')]('\x20')));}var _0x3df5ee=schema(properties[_0xe32b('0x5b')])[_0xe32b('0x3')](_0x7ba669);if(_0x3df5ee['length']>0x0){return _0x2cd7b9(_0x271191[_0xe32b('0x12')](0x1f4,_[_0xe32b('0x5c')](_0x3df5ee,_0xe32b('0x1c'))[_0xe32b('0x16')](',\x20')));}var _0x1076cd=_[_0xe32b('0x5d')](_0x5f2efc[_0xe32b('0x5e')],{'uniqueid':_0x7ba669[_0xe32b('0x5f')]});if(_0x1076cd&&_0x1076cd[_0xe32b('0x60')]){var _0x16914e=util[_0xe32b('0xa')](_0xe32b('0x61'),_0x7ba669['filename']||_0x7ba669['uniqueid'],_0x7ba669[_0xe32b('0xa')]||_0xe32b('0x62'));return ami['Action']({'action':_0xe32b('0x63'),'channel':_0x1076cd[_0xe32b('0x60')],'file':_0x16914e,'options':'ai(mixmonitorid)'})[_0xe32b('0x1b')](function(_0x5d96d2){var _0x45ae6d=_[_0xe32b('0x5d')](_0x1076cd[_0xe32b('0x64')],{'filename':'/var/spool/asterisk/monitor/'+_0x16914e['toLowerCase']()});if(_[_0xe32b('0x65')](_0x45ae6d)){_0x1076cd[_0xe32b('0x64')][_0xe32b('0x5a')]({'filename':_0xe32b('0x66')+_0x16914e[_0xe32b('0x67')](),'createdAt':moment()[_0xe32b('0xa')](_0xe32b('0x68')),'mixmonitorid':_0x5d96d2[_0xe32b('0x69')],'status':_0xe32b('0x6a')});}else{_0x45ae6d[_0xe32b('0x69')]=_0x5d96d2[_0xe32b('0x69')];_0x45ae6d[_0xe32b('0x6b')]='rec';}_0x14923b({'code':0xc8,'message':[_0x7ba669[_0xe32b('0x5f')],_0xe32b('0x6c'),_0x5d96d2['mixmonitorid']][_0xe32b('0x16')]('\x20'),'mixmonitorid':_0x5d96d2[_0xe32b('0x69')]});})['catch'](function(_0x37e736){_0x2cd7b9(_0x271191[_0xe32b('0x12')](0x1f5,[_0x7ba669[_0xe32b('0x5f')],_0x37e736['message']['toLowerCase']()][_0xe32b('0x16')]('\x20')));});}else{return _0x2cd7b9(_0x271191[_0xe32b('0x12')](0x1f5,_0xe32b('0x6d')));}});},'VoiceChannelStopMixMonitor':function(_0x1499e6){var _0x4c55ce=this;return new Promise(function(_0x20ca59,_0x4fee06){if(ami[_0xe32b('0x1d')]()==![]){return _0x4fee06(_0x4c55ce['error'](0x1f4,[config['asterisk']['ip'],config[_0xe32b('0x13')]['username'],_0xe32b('0x15')][_0xe32b('0x16')]('\x20')));}var _0x5314ac=schema(properties[_0xe32b('0x5b')])['validate'](_0x1499e6);if(_0x5314ac[_0xe32b('0x6e')]>0x0){return _0x4fee06(_0x4c55ce[_0xe32b('0x12')](0x1f4,_[_0xe32b('0x5c')](_0x5314ac,'message')['join'](',\x20')));}var _0x1606d2=_['find'](_0x5f2efc['channels'],{'uniqueid':_0x1499e6[_0xe32b('0x5f')]});if(_0x1606d2){return BPromise['resolve']()[_0xe32b('0x1b')](function(){if(_0x1606d2[_0xe32b('0x60')]){return ami[_0xe32b('0x1f')]({'action':_0xe32b('0x6f'),'channel':_0x1606d2['channel'],'mixmonitorid':_0x1499e6[_0xe32b('0x69')]})[_0xe32b('0x70')](function(_0x41d697){});}})[_0xe32b('0x1b')](function(){if(_0x1606d2[_0xe32b('0x71')]){return ami[_0xe32b('0x1f')]({'action':_0xe32b('0x6f'),'channel':_0x1606d2['destinationchannel'],'mixmonitorid':_0x1499e6[_0xe32b('0x69')]})[_0xe32b('0x70')](function(_0x25ee95){});}})[_0xe32b('0x1b')](function(_0x5d261a){var _0x4b68df=_['find'](_0x1606d2[_0xe32b('0x64')],{'mixmonitorid':_0x1499e6[_0xe32b('0x69')]});if(_0x4b68df){_0x4b68df[_0xe32b('0x6b')]='stop';}})[_0xe32b('0x1b')](function(){var _0x2786ca=util['format'](_0xe32b('0x61'),_0x1499e6[_0xe32b('0x72')]||_0x1499e6[_0xe32b('0x5f')],_0x1499e6['format']||_0xe32b('0x62'));var _0x7f2d4e=_[_0xe32b('0x5d')](_0x1606d2['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0x2786ca[_0xe32b('0x67')]()});if(_0x7f2d4e){_0x7f2d4e[_0xe32b('0x6b')]=_0xe32b('0x73');}})['then'](function(){_0x20ca59({'code':0xc8,'message':[_0x1499e6[_0xe32b('0x5f')],_0xe32b('0x74')][_0xe32b('0x16')]('\x20')});})[_0xe32b('0x70')](function(_0x252a51){_0x4fee06(_0x4c55ce[_0xe32b('0x12')](0x1f5,[_0x1499e6[_0xe32b('0x5f')],_0x252a51['message']['toLowerCase']()]['join']('\x20')));});}else{return _0x4fee06(_0x4c55ce[_0xe32b('0x12')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x511578){return new Promise(function(_0x75ebe8,_0x363c28){var _0x1acf4b=_[_0xe32b('0x75')](_0x5f2efc['queueChannels']);_0x75ebe8({'count':_0x1acf4b[_0xe32b('0x6e')],'rows':_0x1acf4b});});},'VoiceQueuesChannel':function(_0x4c4284){var _0x241056=this;return new Promise(function(_0x474d1e,_0x43b8eb){var _0x580b77=schema(properties[_0xe32b('0x76')])[_0xe32b('0x3')](_0x4c4284);if(_0x580b77['length']>0x0){return _0x43b8eb(_0x241056[_0xe32b('0x12')](0x1f4,_[_0xe32b('0x5c')](_0x580b77,'message')['join'](',\x20')));}var _0x129dd1=_[_0xe32b('0x5d')](_0x5f2efc[_0xe32b('0x77')],{'uniqueid':_0x4c4284['uniqueid']});if(_0x129dd1){_0x474d1e(_0x129dd1);}else{return _0x43b8eb(_0x241056[_0xe32b('0x12')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x3704fe){var _0x4caa97=this;return new Promise(function(_0x2d3362,_0x5f15b9){if(ami['isConnected']()==![]){return _0x5f15b9(_0x4caa97[_0xe32b('0x12')](0x1f4,[config[_0xe32b('0x13')]['ip'],config[_0xe32b('0x13')][_0xe32b('0x14')],_0xe32b('0x15')][_0xe32b('0x16')]('\x20')));}var _0x55cd48=schema(properties[_0xe32b('0x78')])[_0xe32b('0x3')](_0x3704fe);if(_0x55cd48[_0xe32b('0x6e')]>0x0){return _0x5f15b9(_0x4caa97[_0xe32b('0x12')](0x1f4,_[_0xe32b('0x5c')](_0x55cd48,_0xe32b('0x1c'))[_0xe32b('0x16')](',\x20')));}var _0x4fcc1f=_[_0xe32b('0x5d')](_0x5f2efc['queueChannels'],{'uniqueid':_0x3704fe[_0xe32b('0x5f')]});if(_0x4fcc1f&&_0x4fcc1f[_0xe32b('0x60')]){return ami[_0xe32b('0x1f')]({'action':_0xe32b('0x79'),'channel':_0x4fcc1f[_0xe32b('0x60')]})['then'](function(_0x5bf5e2){_0x2d3362({'code':0xc8,'message':[_0x3704fe[_0xe32b('0x5f')],_0x5bf5e2[_0xe32b('0x1c')][_0xe32b('0x67')]()][_0xe32b('0x16')]('\x20')});})[_0xe32b('0x70')](function(_0x578c8e){_0x5f15b9(_0x4caa97['error'](0x1f5,[_0x3704fe[_0xe32b('0x5f')],_0x578c8e['message'][_0xe32b('0x67')]()][_0xe32b('0x16')]('\x20')));});}else{return _0x5f15b9(_0x4caa97[_0xe32b('0x12')](0x1f5,_0xe32b('0x6d')));}});},'VoiceQueuesChannelRedirect':function(_0x5a1572){var _0x48e18b=this;return new Promise(function(_0x2edb12,_0x37efc8){if(ami[_0xe32b('0x1d')]()==![]){return _0x37efc8(_0x48e18b['error'](0x1f4,[config[_0xe32b('0x13')]['ip'],config[_0xe32b('0x13')]['username'],_0xe32b('0x15')][_0xe32b('0x16')]('\x20')));}var _0x16e41d=schema(properties['voicequeuechannelredirect'])[_0xe32b('0x3')](_0x5a1572);if(_0x16e41d[_0xe32b('0x6e')]>0x0){return _0x37efc8(_0x48e18b[_0xe32b('0x12')](0x1f4,_[_0xe32b('0x5c')](_0x16e41d,_0xe32b('0x1c'))[_0xe32b('0x16')](',\x20')));}var _0x39f960=_[_0xe32b('0x5d')](_0x5f2efc[_0xe32b('0x77')],{'uniqueid':_0x5a1572['uniqueid']});if(_0x39f960&&_0x39f960[_0xe32b('0x60')]){return ami[_0xe32b('0x1f')]({'action':_0xe32b('0x7a'),'channel':_0x39f960[_0xe32b('0x60')],'exten':_0x5a1572[_0xe32b('0x7b')],'context':_0x5a1572[_0xe32b('0x7c')]||_0x39f960[_0xe32b('0x7c')],'priority':0x1})[_0xe32b('0x1b')](function(_0x5205de){_0x2edb12({'code':0xc8,'message':[_0x5a1572[_0xe32b('0x5f')],_0x5205de[_0xe32b('0x1c')][_0xe32b('0x67')]()][_0xe32b('0x16')]('\x20')});})[_0xe32b('0x70')](function(_0x15e6b3){_0x37efc8(_0x48e18b['error'](0x1f5,[_0x5a1572['uniqueid'],_0x15e6b3[_0xe32b('0x1c')][_0xe32b('0x67')]()][_0xe32b('0x16')]('\x20')));});}else{return _0x37efc8(_0x48e18b['error'](0x1f5,_0xe32b('0x6d')));}});},'Agents':function(_0x115361){return new Promise(function(_0x5220b8,_0x524ee9){var _0x3004e7=_[_0xe32b('0x75')](_0x5f2efc[_0xe32b('0xe')]);_0x5220b8({'count':_0x3004e7[_0xe32b('0x6e')],'rows':_0x3004e7});});},'Telephones':function(_0x36d576){return new Promise(function(_0x3cc437,_0x1b8a8a){var _0xdfacb9=_[_0xe32b('0x75')](_0x5f2efc[_0xe32b('0x7d')]);_0x3cc437({'count':_0xdfacb9[_0xe32b('0x6e')],'rows':_0xdfacb9});});},'Trunks':function(_0x6541a9){return new Promise(function(_0x4311e6,_0x4ff152){var _0x11fd27=_[_0xe32b('0x75')](_0x5f2efc[_0xe32b('0x7e')]);_0x4311e6({'count':_0x11fd27[_0xe32b('0x6e')],'rows':_0x11fd27});});},'OutboundChannels':function(_0x35aeda){return new Promise(function(_0x99ba29,_0x585858){var _0x2165cd=_[_0xe32b('0x75')](_0x5f2efc[_0xe32b('0x7f')]);_0x99ba29({'count':_0x2165cd['length'],'rows':_0x2165cd});});},'Outbound':function(_0x164558){return new Promise(function(_0x118089,_0x2cac9b){_0x118089(_0x5f2efc['outbound']);});},'Campaigns':function(_0x610993){return new Promise(function(_0x293bc9,_0x21d05f){var _0x5995ea=_[_0xe32b('0x75')](_0x5f2efc['campaigns']);_0x293bc9({'count':_0x5995ea[_0xe32b('0x6e')],'rows':_0x5995ea});});},'VoiceQueuesPreview':function(_0x4b7acc){var _0x3235bd=this;return new Promise(function(_0x232f56,_0x1ce6e1){_0x4bd5de[_0xe32b('0x80')](_0x4b7acc['id'])[_0xe32b('0x1b')](function(_0x1b4c85){_0x232f56({'code':0xc8,'message':_0x1b4c85['message']});})['catch'](function(_0x1b1d1a){_0x1ce6e1(_0x3235bd[_0xe32b('0x12')](0x1f4,_0x1b1d1a[_0xe32b('0x1c')]));});});},'EventManager':function(_0x504953){var _0x350910=this;return new Promise(function(_0x416f00,_0x1e1bf7){if(!_0x504953[_0xe32b('0x81')]){return _0x1e1bf7(_0x350910['error'](0x1f4,'Event\x20name\x20mandatory'));}ami[_0xe32b('0x82')](_0xe32b('0x83')+_0x504953[_0xe32b('0x81')],_0x504953[_0xe32b('0x1c')]);_0x416f00({'code':0xc8,'message':_0x504953});});},'FaxAccounts':function(_0x3e4f7f){return new Promise(function(_0x641307,_0x1ca76d){var _0x24a8da=_[_0xe32b('0x75')](_0x5f2efc[_0xe32b('0x84')]);_0x641307({'count':_0x24a8da[_0xe32b('0x6e')],'rows':_0x24a8da});});},'SendFax':function(_0x21011d){var _0x299ac9=this;return new Promise(function(_0x23a8a0,_0xe70ef0){_0x33c36a['send'](_0x21011d)[_0xe32b('0x1b')](function(_0x341ee8){_0x23a8a0({'code':0xc8,'message':_0x341ee8[_0xe32b('0x1c')]});})[_0xe32b('0x70')](function(_0xdb80c0){_0xe70ef0(_0x299ac9['error'](0x1f4,_0xdb80c0[_0xe32b('0x1c')]));});});},'CheckAfterSend':function(_0x22b740){var _0x52af27=this;return new Promise(function(_0x567293,_0x137bd3){_0x33c36a[_0xe32b('0x85')](_0x22b740)[_0xe32b('0x1b')](function(_0x3f57d1){_0x567293({'code':0xc8,'message':_0x3f57d1[_0xe32b('0x1c')]});})['catch'](function(_0x4b2f41){_0x137bd3(_0x52af27[_0xe32b('0x12')](0x1f4,_0x4b2f41[_0xe32b('0x1c')]));});});}};var _0x421ff7=jayson[_0xe32b('0x86')](_0x4a3724)[_0xe32b('0x87')]();_0x421ff7['on'](_0xe32b('0x12'),function(_0x493ecd){return _0x2aae63(_0x493ecd);});_0x421ff7[_0xe32b('0x9')](0x232a,_0xe32b('0x88'),function(){console[_0xe32b('0x89')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x37d5b5(_0xe32b('0x8a')+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 a174ee9..7cc886b 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 _0x86c0=['xmd-contactid2','format','trigger:%s','action','merge','createContact','toLowerCase','catch','Error\x20creating\x20contact','stringify','user:%s','bluebird','lodash','ioredis','../../../../config/environment','../../../../config/logger','../../rpc/cmContact','redis','defaults','socket.io-emitter','info','emit','exec','autoCreate','data2','data1','isNil','routeId','firstName','calleridname','uniqueid','destcalleridname','','destcalleridnum','phone','resolve','then'];(function(_0x279368,_0x41c002){var _0x40b6d0=function(_0x493776){while(--_0x493776){_0x279368['push'](_0x279368['shift']());}};_0x40b6d0(++_0x41c002);}(_0x86c0,0x133));var _0x086c=function(_0x4ca7c8,_0x3050d9){_0x4ca7c8=_0x4ca7c8-0x0;var _0x1b67e2=_0x86c0[_0x4ca7c8];return _0x1b67e2;};'use strict';var BPromise=require(_0x086c('0x0'));var util=require('util');var _=require(_0x086c('0x1'));var Redis=require(_0x086c('0x2'));var config=require(_0x086c('0x3'));var logger=require(_0x086c('0x4'))('trigger');var cmContactRpc=require(_0x086c('0x5'));config[_0x086c('0x6')]=_[_0x086c('0x7')](config[_0x086c('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x086c('0x8'))(new Redis(config[_0x086c('0x6')]));function emit(_0x2e27a8,_0x387428,_0x117df9){logger[_0x086c('0x9')](_0x2e27a8,_0x387428,JSON['stringify'](_0x117df9));io['to'](_0x2e27a8)[_0x086c('0xa')](_0x387428,_0x117df9);}exports[_0x086c('0xb')]=function(_0xa1b79a,_0x491bf7,_0x5d7628){_0x5d7628[_0x086c('0xc')]=0x0;if(_0x491bf7[_0x086c('0xd')]&&parseInt(_0x491bf7[_0x086c('0xd')],0xa)){var _0x269cdc={'ListId':parseInt(_0x491bf7[_0x086c('0xe')],0xa),'phone':_0x5d7628['calleridnum']};if(_[_0x086c('0xf')](_0x5d7628[_0x086c('0x10')])){_0x269cdc[_0x086c('0x11')]=_0x5d7628[_0x086c('0x12')]&&_0x5d7628['calleridname']!==''?_0x5d7628[_0x086c('0x12')]:_0x5d7628['calleridnum']||_0x5d7628[_0x086c('0x13')];}else{_0x269cdc[_0x086c('0x11')]=_0x5d7628['destcalleridname']&&_0x5d7628[_0x086c('0x14')]!==_0x086c('0x15')?_0x5d7628[_0x086c('0x14')]:_0x5d7628[_0x086c('0x16')]||_0x5d7628['uniqueid'];_0x269cdc[_0x086c('0x17')]=_0x5d7628[_0x086c('0x14')]&&_0x5d7628[_0x086c('0x14')]!==''?_0x5d7628[_0x086c('0x14')]:_0x5d7628[_0x086c('0x16')]||_0x5d7628[_0x086c('0x13')];}BPromise[_0x086c('0x18')]()[_0x086c('0x19')](cmContactRpc['showContact']({'where':_['omit'](_0x269cdc,[_0x086c('0x11')])}))[_0x086c('0x19')](function(_0x1e80c2){if(_0x1e80c2){_0x5d7628[_0x086c('0x1a')]=_0x1e80c2['id'];emit(util[_0x086c('0x1b')]('user:%s',_0xa1b79a['name']),util['format'](_0x086c('0x1c'),_0x491bf7[_0x086c('0x1d')]['toLowerCase']()),_[_0x086c('0x1e')](_0x5d7628,{'ListId':parseInt(_0x491bf7['data1'],0xa)}));return;}else{return BPromise[_0x086c('0x18')]()[_0x086c('0x19')](cmContactRpc[_0x086c('0x1f')](_0x269cdc));}})[_0x086c('0x19')](function(_0x568587){if(_0x568587){_0x5d7628[_0x086c('0x1a')]=_0x568587['id'];emit(util['format']('user:%s',_0xa1b79a['name']),util[_0x086c('0x1b')]('trigger:%s',_0x491bf7['action'][_0x086c('0x20')]()),_['merge'](_0x5d7628,{'ListId':parseInt(_0x491bf7[_0x086c('0xe')],0xa)}));}})[_0x086c('0x21')](function(_0x57507b){logger['error'](_0x086c('0x22'),JSON[_0x086c('0x23')](_0x57507b));});}else{if(_0xa1b79a){emit(util[_0x086c('0x1b')](_0x086c('0x24'),_0xa1b79a['name']),util[_0x086c('0x1b')](_0x086c('0x1c'),_0x491bf7['action']['toLowerCase']()),_['merge']({'ListId':parseInt(_0x491bf7[_0x086c('0xe')],0xa)},_0x5d7628));}}}; \ No newline at end of file +var _0x87bc=['action','toLowerCase','merge','data1','xmd-contactid2','user:%s','error','Error\x20creating\x20contact','bluebird','util','ioredis','trigger','redis','socket.io-emitter','stringify','emit','exec','autoCreate','data2','calleridnum','routeId','firstName','calleridname','uniqueid','destcalleridname','','destcalleridnum','phone','resolve','showContact','omit','then','format','name','trigger:%s'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0x87bc,0x189));var _0xc87b=function(_0x421e6a,_0x49600b){_0x421e6a=_0x421e6a-0x0;var _0x4582ba=_0x87bc[_0x421e6a];return _0x4582ba;};'use strict';var BPromise=require(_0xc87b('0x0'));var util=require(_0xc87b('0x1'));var _=require('lodash');var Redis=require(_0xc87b('0x2'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xc87b('0x3'));var cmContactRpc=require('../../rpc/cmContact');config[_0xc87b('0x4')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xc87b('0x5'))(new Redis(config[_0xc87b('0x4')]));function emit(_0x402aac,_0x5d1813,_0x50b19b){logger['info'](_0x402aac,_0x5d1813,JSON[_0xc87b('0x6')](_0x50b19b));io['to'](_0x402aac)[_0xc87b('0x7')](_0x5d1813,_0x50b19b);}exports[_0xc87b('0x8')]=function(_0x19b571,_0x3ad1d6,_0x2674f8){_0x2674f8[_0xc87b('0x9')]=0x0;if(_0x3ad1d6[_0xc87b('0xa')]&&parseInt(_0x3ad1d6[_0xc87b('0xa')],0xa)){var _0x553d71={'ListId':parseInt(_0x3ad1d6['data1'],0xa),'phone':_0x2674f8[_0xc87b('0xb')]};if(_['isNil'](_0x2674f8[_0xc87b('0xc')])){_0x553d71[_0xc87b('0xd')]=_0x2674f8[_0xc87b('0xe')]&&_0x2674f8[_0xc87b('0xe')]!==''?_0x2674f8[_0xc87b('0xe')]:_0x2674f8['calleridnum']||_0x2674f8[_0xc87b('0xf')];}else{_0x553d71[_0xc87b('0xd')]=_0x2674f8['destcalleridname']&&_0x2674f8[_0xc87b('0x10')]!==_0xc87b('0x11')?_0x2674f8['destcalleridname']:_0x2674f8[_0xc87b('0x12')]||_0x2674f8[_0xc87b('0xf')];_0x553d71[_0xc87b('0x13')]=_0x2674f8[_0xc87b('0x10')]&&_0x2674f8[_0xc87b('0x10')]!==_0xc87b('0x11')?_0x2674f8[_0xc87b('0x10')]:_0x2674f8[_0xc87b('0x12')]||_0x2674f8['uniqueid'];}BPromise[_0xc87b('0x14')]()['then'](cmContactRpc[_0xc87b('0x15')]({'where':_[_0xc87b('0x16')](_0x553d71,['firstName'])}))[_0xc87b('0x17')](function(_0x372665){if(_0x372665){_0x2674f8['xmd-contactid2']=_0x372665['id'];emit(util[_0xc87b('0x18')]('user:%s',_0x19b571[_0xc87b('0x19')]),util[_0xc87b('0x18')](_0xc87b('0x1a'),_0x3ad1d6[_0xc87b('0x1b')][_0xc87b('0x1c')]()),_[_0xc87b('0x1d')](_0x2674f8,{'ListId':parseInt(_0x3ad1d6[_0xc87b('0x1e')],0xa)}));return;}else{return BPromise[_0xc87b('0x14')]()[_0xc87b('0x17')](cmContactRpc['createContact'](_0x553d71));}})[_0xc87b('0x17')](function(_0x5266c2){if(_0x5266c2){_0x2674f8[_0xc87b('0x1f')]=_0x5266c2['id'];emit(util[_0xc87b('0x18')](_0xc87b('0x20'),_0x19b571['name']),util['format'](_0xc87b('0x1a'),_0x3ad1d6[_0xc87b('0x1b')][_0xc87b('0x1c')]()),_[_0xc87b('0x1d')](_0x2674f8,{'ListId':parseInt(_0x3ad1d6[_0xc87b('0x1e')],0xa)}));}})['catch'](function(_0x1e08db){logger[_0xc87b('0x21')](_0xc87b('0x22'),JSON[_0xc87b('0x6')](_0x1e08db));});}else{if(_0x19b571){emit(util[_0xc87b('0x18')]('user:%s',_0x19b571['name']),util['format'](_0xc87b('0x1a'),_0x3ad1d6[_0xc87b('0x1b')]['toLowerCase']()),_['merge']({'ListId':parseInt(_0x3ad1d6[_0xc87b('0x1e')],0xa)},_0x2674f8));}}}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 10ce60d..ecd94f5 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 _0xed21=['event','agent','membername','lastevent','exports','lodash','url','mustache','ioredis','./cmContact','../rpc/cmContact','../../../config/environment','../../../config/logger','trigger','../ami','redis','defaults','localhost','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentringnoanswer','custom:agentcomplete','custom:queuecallerabandon','custom:dialbegin','custom:dialconnect','syncAgentDial','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:outgoingmessage','emit','info','stringify','prototype','checkTriggers','hasOwnProperty','status','merge','variables','Actions','interface','action','contactmanager','motionbar','browser','data1','TemplateId','data2','html','render','template\x20not\x20found','uri','isNil','data3','data4','location','uriLocation','data5','800','windowHeight','data6','600','winApplication','winArguments','format','user:%s','trigger:%s:%s','name','trigger:%s','toLowerCase','exec','queue','routeId','urlforward','buildUri','replace','checkTrigger','AllConditions','length','every','checkConditions','channel','AnyConditions','some','field','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','message'];(function(_0x251d9c,_0x580977){var _0x16ae64=function(_0x4d3b53){while(--_0x4d3b53){_0x251d9c['push'](_0x251d9c['shift']());}};_0x16ae64(++_0x580977);}(_0xed21,0xe5));var _0x1ed2=function(_0xeabeec,_0x5e2631){_0xeabeec=_0xeabeec-0x0;var _0x557269=_0xed21[_0xeabeec];return _0x557269;};'use strict';var util=require('util');var _=require(_0x1ed2('0x0'));var url=require(_0x1ed2('0x1'));var Mustache=require(_0x1ed2('0x2'));var Redis=require(_0x1ed2('0x3'));var urlforward=require('./urlforward');var integration=require('./integration');var cmContact=require(_0x1ed2('0x4'));var script=require('./script');var cmContactRpc=require(_0x1ed2('0x5'));var config=require(_0x1ed2('0x6'));var logger=require(_0x1ed2('0x7'))(_0x1ed2('0x8'));var ami=require(_0x1ed2('0x9'));config[_0x1ed2('0xa')]=_[_0x1ed2('0xb')](config[_0x1ed2('0xa')],{'host':_0x1ed2('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1ed2('0xa')]));var operators={'equals':function(_0x4f83bc,_0x2c63c3){return _0x4f83bc==_0x2c63c3;},'not_equals':function(_0x39f5c9,_0x1710a4){return _0x39f5c9!=_0x1710a4;}};var barAndWebActions=[_0x1ed2('0xd'),_0x1ed2('0x1'),_0x1ed2('0xe')];function Trigger(_0x303ec4){this[_0x1ed2('0xf')]=_0x303ec4[_0x1ed2('0xf')];this[_0x1ed2('0x10')]=_0x303ec4[_0x1ed2('0x10')];this[_0x1ed2('0x11')]=_0x303ec4[_0x1ed2('0x11')];this[_0x1ed2('0x12')]=_0x303ec4[_0x1ed2('0x12')];this[_0x1ed2('0x13')]=_0x303ec4['voiceExtensions'];this[_0x1ed2('0x14')]=_0x303ec4[_0x1ed2('0x14')];this['freshdeskAccounts']=_0x303ec4[_0x1ed2('0x15')];this[_0x1ed2('0x16')]=_0x303ec4[_0x1ed2('0x16')];this[_0x1ed2('0x17')]=_0x303ec4['sugarcrmAccounts'];this['zohoAccounts']=_0x303ec4[_0x1ed2('0x18')];this[_0x1ed2('0x19')]=_0x303ec4[_0x1ed2('0x19')];this[_0x1ed2('0x1a')]=_0x303ec4['vtigerAccounts'];this[_0x1ed2('0x1b')]=_0x303ec4[_0x1ed2('0x1b')];this['dynamics365Accounts']=_0x303ec4[_0x1ed2('0x1c')];this[_0x1ed2('0x1d')]=_0x303ec4['freshsalesAccounts'];this[_0x1ed2('0x1e')]={'zendesk':this[_0x1ed2('0x14')],'salesforce':this[_0x1ed2('0x16')],'freshdesk':this[_0x1ed2('0x15')],'sugarcrm':this[_0x1ed2('0x17')],'zoho':this[_0x1ed2('0x18')],'desk':this['deskAccounts'],'vtiger':this[_0x1ed2('0x1a')],'dynamics365':this[_0x1ed2('0x1c')],'freshsales':this[_0x1ed2('0x1d')],'servicenow':this['servicenowAccounts']};ami['on'](_0x1ed2('0x1f'),this[_0x1ed2('0x20')][_0x1ed2('0x21')](this));ami['on']('custom:agentconnect',this['syncCustomEvent'][_0x1ed2('0x21')](this));ami['on'](_0x1ed2('0x22'),this[_0x1ed2('0x20')][_0x1ed2('0x21')](this));ami['on'](_0x1ed2('0x23'),this[_0x1ed2('0x20')]['bind'](this));ami['on'](_0x1ed2('0x24'),this[_0x1ed2('0x20')]['bind'](this));ami['on'](_0x1ed2('0x25'),this['syncAgentDial'][_0x1ed2('0x21')](this));ami['on'](_0x1ed2('0x26'),this[_0x1ed2('0x27')]['bind'](this));ami['on'](_0x1ed2('0x28'),this[_0x1ed2('0x27')][_0x1ed2('0x21')](this));ami['on'](_0x1ed2('0x29'),this[_0x1ed2('0x20')][_0x1ed2('0x21')](this));ami['on'](_0x1ed2('0x2a'),this[_0x1ed2('0x20')][_0x1ed2('0x21')](this));ami['on']('custom:incomingmessage',this[_0x1ed2('0x20')][_0x1ed2('0x21')](this));ami['on'](_0x1ed2('0x2b'),this[_0x1ed2('0x20')][_0x1ed2('0x21')](this));ami['on']('custom:acceptmessage',this[_0x1ed2('0x20')][_0x1ed2('0x21')](this));ami['on']('custom:rejectmessage',this[_0x1ed2('0x20')][_0x1ed2('0x21')](this));}Trigger['prototype'][_0x1ed2('0x2c')]=function(_0x272a4a,_0x5c5e7f,_0x5a680f){logger[_0x1ed2('0x2d')](_0x272a4a,_0x5c5e7f,JSON[_0x1ed2('0x2e')](_0x5a680f));io['to'](_0x272a4a)[_0x1ed2('0x2c')](_0x5c5e7f,_0x5a680f);};Trigger[_0x1ed2('0x2f')][_0x1ed2('0x20')]=function(_0x388ec4){var _0x25b66f=_['clone'](_0x388ec4);this[_0x1ed2('0x30')](_0x25b66f);};Trigger[_0x1ed2('0x2f')][_0x1ed2('0x27')]=function(_0x40a01f){if(this[_0x1ed2('0x10')][_0x40a01f['interface']]){this[_0x1ed2('0x20')](_0x40a01f);}};Trigger[_0x1ed2('0x2f')][_0x1ed2('0x30')]=function(_0x3a6653){var _0x43786f;for(var _0x46d28a in this[_0x1ed2('0xf')]){if(this['triggers'][_0x1ed2('0x31')](_0x46d28a)){if(this['triggers'][_0x46d28a][_0x1ed2('0x32')]){_0x43786f=this['checkTrigger'](this['triggers'][_0x46d28a],_0x3a6653);if(_0x43786f){_[_0x1ed2('0x33')](_0x3a6653,_0x3a6653[_0x1ed2('0x34')]);for(var _0x4c483b=0x0,_0x4d0d0a,_0x1a1f7f,_0x3b64f1;_0x4c483b0x0){_0x1dcd2e=_[_0xf0ab('0x2c')](_0x574ce7,_0x55d799);}return _0x1dcd2e;}function getCustomFields(_0x445160,_0x43476c){var _0x174052=[];var _0x367302={'custom_fields':{}};if(_0x445160[_0xf0ab('0x2b')]>0x0){_[_0xf0ab('0x2d')](_0x445160,function(_0x2f0fcd){if(_0x2f0fcd[_0xf0ab('0x2e')]===_0xf0ab('0x2f')&&_0x2f0fcd['nameField']&&!_0x2f0fcd[_0xf0ab('0x30')]){_0x367302[_0x2f0fcd[_0xf0ab('0x31')]['toLowerCase']()]=_0x2f0fcd['content'][_0xf0ab('0x23')]();}else if(_0x2f0fcd[_0xf0ab('0x2e')]===_0xf0ab('0x2f')&&_0x2f0fcd['idField']&&_0x2f0fcd['customField']){_0x367302[_0xf0ab('0x32')][_0x2f0fcd['idField']]=_0x2f0fcd[_0xf0ab('0x33')]['toString']();}else if(_0x2f0fcd[_0xf0ab('0x2e')]===_0xf0ab('0x34')&&_0x2f0fcd['variableName']&&_0x2f0fcd['idField']&&_0x2f0fcd[_0xf0ab('0x30')]){_0x43476c[_0x2f0fcd[_0xf0ab('0x35')]]&&(_0x367302[_0xf0ab('0x32')][_0x2f0fcd[_0xf0ab('0x36')]]=_0x43476c[_0x2f0fcd[_0xf0ab('0x35')]][_0xf0ab('0x23')]());}else if(_0x2f0fcd[_0xf0ab('0x2e')]===_0xf0ab('0x37')&&_0x2f0fcd[_0xf0ab('0x38')]&&_0x2f0fcd[_0xf0ab('0x38')][_0xf0ab('0x39')]&&_0x2f0fcd[_0xf0ab('0x36')]&&_0x2f0fcd[_0xf0ab('0x30')]){_0x43476c[_0x2f0fcd[_0xf0ab('0x38')]['name'][_0xf0ab('0x3a')]()]&&(_0x367302[_0xf0ab('0x32')][_0x2f0fcd[_0xf0ab('0x36')]]=_0x43476c[_0x2f0fcd['Variable'][_0xf0ab('0x39')][_0xf0ab('0x3a')]()][_0xf0ab('0x23')]());}});}if(_0x367302['priority']){_0x367302[_0xf0ab('0x3b')]=Number(_0x367302['priority']);}return _0x367302;}function getTicket(_0xda3971,_0x492d7c,_0x4763f7,_0x3ee6af,_0x31369b){logger[_0xf0ab('0x13')](_0xf0ab('0x3c'));var _0x1dfb2e=_['merge']({'subject':intUtil[_0xf0ab('0x3d')](_0x3ee6af[_0xf0ab('0x3e')],_0x31369b,'\x20'),'type':'phone','status':_0xf0ab('0x3f'),'labels':[_0xf0ab('0x40'),_0xf0ab('0x41'),_0xf0ab('0x42')][_0xf0ab('0x43')](getTags(_0x3ee6af[_0xf0ab('0x44')],_0xf0ab('0x39'))),'description':intUtil['getString'](_0x3ee6af[_0xf0ab('0x45')],_0x31369b,'\x0a'),'_links':{'assigned_user':{'href':util[_0xf0ab('0xc')](_0xf0ab('0x46'),_0x492d7c['id']),'class':'user'}},'message':{'direction':'in','body':intUtil[_0xf0ab('0x3d')](_0x3ee6af[_0xf0ab('0x45')],_0x31369b,'\x0a')}},getCustomFields(_0x3ee6af[_0xf0ab('0x47')],_0x31369b));return request({'uri':util[_0xf0ab('0xc')](_0xf0ab('0x48'),_0xda3971['remoteUri'],_0x4763f7['id']),'method':_0xf0ab('0x49'),'body':_0x1dfb2e});}exports[_0xf0ab('0x4a')]=function(_0x28e7a4,_0x197955,_0x191caf,_0x17a73,_0x45849c,_0x413f5c){var _0x8ad4ad,_0x3b214a;_0x413f5c[_0xf0ab('0xd')]=intUtil[_0xf0ab('0x4b')](_0x413f5c[_0xf0ab('0xd')]);_0x413f5c['serverUrl']=intUtil['stripTrailingSlash'](_0x413f5c[_0xf0ab('0x4c')]);if(_0x45849c&&_0x45849c['monitor_format']){logger[_0xf0ab('0x13')](_0xf0ab('0x4d'),'Recording\x20is\x20enabled!');_0x197955[_0xf0ab('0x4e')]=util[_0xf0ab('0xc')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x413f5c[_0xf0ab('0x4c')],_0x197955[_0xf0ab('0x4f')],md5(_0x197955[_0xf0ab('0x4f')]));}else{_0x197955[_0xf0ab('0x4e')]='';}headers[_0xf0ab('0x50')]=getAuth(_0x413f5c);return getUser(_0x413f5c,_0x17a73[_0xf0ab('0x51')])[_0xf0ab('0xe')](function(_0x40f6d5){_0x8ad4ad=_0x40f6d5;logger[_0xf0ab('0x13')](_0xf0ab('0x52'),_0x8ad4ad['id']);return getEndUser(_0x413f5c,_0x197955[_0xf0ab('0x53')],_0x197955[_0xf0ab('0x54')]);})[_0xf0ab('0xe')](function(_0x99ce7){_0x3b214a=_0x99ce7;logger['info']('The\x20Enduser\x20ID\x20is:',_0x3b214a['id']);return getTicket(_0x413f5c,_0x8ad4ad,_0x3b214a,_0x191caf,_0x197955);})[_0xf0ab('0xe')](function(_0x4da898){if(_0x4da898){logger['info']('Ticket\x20created!');logger[_0xf0ab('0x13')](_0xf0ab('0x55'),_0x4da898['id']);switch(_0x413f5c[_0xf0ab('0x2e')]){case _0xf0ab('0x56'):logger[_0xf0ab('0x13')](_0xf0ab('0x4d'),_0xf0ab('0x57'));emit(util[_0xf0ab('0xc')](_0xf0ab('0x58'),_0x17a73[_0xf0ab('0x39')]),_0xf0ab('0x59'),{'recordId':_0x4da898['id']});break;case _0xf0ab('0x5a'):logger['info'](_0xf0ab('0x4d'),_0xf0ab('0x5b'));emit(util[_0xf0ab('0xc')](_0xf0ab('0x58'),_0x17a73[_0xf0ab('0x39')]),_0xf0ab('0x5c'),{'uri':util[_0xf0ab('0xc')](_0xf0ab('0x5d'),_0x4da898['id'])});break;default:logger['error']('[QUEUE]','Desk\x20account\x20type\x20not\x20recognized');}}})[_0xf0ab('0x5e')](function(_0x101a8e){console['error'](_0x101a8e);logger[_0xf0ab('0x5f')](_0xf0ab('0x4d'),JSON['stringify'](_0x101a8e));});};exports[_0xf0ab('0x60')]=function(_0x53d6a4,_0x1352ac,_0xe4ef6d,_0x187389,_0x33112b,_0x26508b,_0x4d1606){var _0x3be796,_0x59e7dd;_0x26508b[_0xf0ab('0xd')]=intUtil['stripTrailingSlash'](_0x26508b[_0xf0ab('0xd')]);_0x26508b['serverUrl']=intUtil['stripTrailingSlash'](_0x26508b[_0xf0ab('0x4c')]);if(_0x4d1606&&_0x4d1606['recordingFormat']&&_0x4d1606[_0xf0ab('0x61')]!=='none'){logger[_0xf0ab('0x13')]('[OUTBOUND]',_0xf0ab('0x62'));_0x1352ac[_0xf0ab('0x4e')]=util[_0xf0ab('0xc')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x26508b['serverUrl'],_0x1352ac['uniqueid'],md5(_0x1352ac[_0xf0ab('0x4f')]));}headers[_0xf0ab('0x50')]=getAuth(_0x26508b);return getUser(_0x26508b,_0x187389['email'])['then'](function(_0x1dc9c4){_0x3be796=_0x1dc9c4;logger[_0xf0ab('0x13')](_0xf0ab('0x52'),_0x3be796['id']);return getEndUser(_0x26508b,_0x1352ac[_0xf0ab('0x63')],_0x1352ac[_0xf0ab('0x64')]);})[_0xf0ab('0xe')](function(_0x2d3aa8){_0x59e7dd=_0x2d3aa8;logger[_0xf0ab('0x13')](_0xf0ab('0x65'),_0x59e7dd['id']);return getTicket(_0x26508b,_0x3be796,_0x59e7dd,_0xe4ef6d,_0x1352ac);})[_0xf0ab('0xe')](function(_0x1e6a4e){if(_0x1e6a4e){logger['info'](_0xf0ab('0x66'));logger['info'](_0xf0ab('0x55'),_0x1e6a4e['id']);switch(_0x26508b[_0xf0ab('0x2e')]){case _0xf0ab('0x56'):logger[_0xf0ab('0x13')](_0xf0ab('0x4d'),_0xf0ab('0x57'));emit(util[_0xf0ab('0xc')](_0xf0ab('0x58'),_0x187389[_0xf0ab('0x39')]),_0xf0ab('0x59'),{'recordId':_0x1e6a4e['id']});break;case'newTab':logger[_0xf0ab('0x13')](_0xf0ab('0x4d'),_0xf0ab('0x5b'));emit(util[_0xf0ab('0xc')](_0xf0ab('0x58'),_0x187389[_0xf0ab('0x39')]),_0xf0ab('0x5c'),{'uri':util[_0xf0ab('0xc')](_0xf0ab('0x67'),_0x26508b['remoteUri'],_0x1e6a4e['id'])});break;default:logger['error'](_0xf0ab('0x68'),_0xf0ab('0x69'));}}})[_0xf0ab('0x5e')](function(_0x52058a){logger[_0xf0ab('0x5f')](_0xf0ab('0x68'),JSON[_0xf0ab('0x19')](_0x52058a));});};exports['abandoned']=function(_0x2c1a44,_0x16522b,_0x3fc57e,_0x3d333f,_0x23f4f8,_0x53ed27){var _0x3f0e11,_0x70b02d;_0x53ed27[_0xf0ab('0xd')]=intUtil[_0xf0ab('0x4b')](_0x53ed27[_0xf0ab('0xd')]);_0x53ed27[_0xf0ab('0x4c')]=intUtil[_0xf0ab('0x4b')](_0x53ed27[_0xf0ab('0x4c')]);if(_0x23f4f8&&_0x23f4f8[_0xf0ab('0x6a')]){logger[_0xf0ab('0x13')](_0xf0ab('0x6b'),_0xf0ab('0x62'));_0x16522b[_0xf0ab('0x4e')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x53ed27[_0xf0ab('0x4c')],_0x16522b[_0xf0ab('0x4f')],md5(_0x16522b[_0xf0ab('0x4f')]));}else{_0x16522b['recordingURL']='';}headers[_0xf0ab('0x50')]=getAuth(_0x53ed27);return getUser(_0x53ed27)['then'](function(_0x1a32dc){_0x3f0e11=_0x1a32dc;logger[_0xf0ab('0x13')](_0xf0ab('0x52'),_0x3f0e11['id']);return getEndUser(_0x53ed27,_0x16522b['calleridname'],_0x16522b[_0xf0ab('0x54')]);})['then'](function(_0x5dbeac){_0x70b02d=_0x5dbeac;logger[_0xf0ab('0x13')](_0xf0ab('0x65'),_0x70b02d['id']);return getTicket(_0x53ed27,_0x3f0e11,_0x70b02d,_0x3fc57e,_0x16522b);})[_0xf0ab('0xe')](function(_0x549c70){if(_0x549c70){logger[_0xf0ab('0x13')](_0xf0ab('0x66'));logger[_0xf0ab('0x13')](_0xf0ab('0x55'),_0x549c70['id']);}})['catch'](function(_0x50137a){logger['error'](_0xf0ab('0x6b'),JSON[_0xf0ab('0x19')](_0x50137a));});}; \ No newline at end of file +var _0x02ce=['trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','integrationTab','%s/agent/tickets/%s','abandoned','catch','lodash','request-promise','md5','ioredis','../../../../config/environment','../../../../config/logger','desk','redis','defaults','localhost','socket.io-emitter','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','remoteUri','then','total_entries','find','_embedded','entries','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','[HTTP]','stringify','authType','basic','%s:%s','username','%s/token:%s','Basic\x20%s','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','length','map','forEach','type','nameField','customField','toLowerCase','content','toString','string','idField','custom_fields','variableName','customVariable','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','new','CTI','concat','Tags','Descriptions','/api/v2/users/%d','Fields','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','user:%s'];(function(_0x3db3b3,_0x149428){var _0x49b005=function(_0x2bba57){while(--_0x2bba57){_0x3db3b3['push'](_0x3db3b3['shift']());}};_0x49b005(++_0x149428);}(_0x02ce,0x1ac));var _0xe02c=function(_0x4ba393,_0x480f8f){_0x4ba393=_0x4ba393-0x0;var _0x1c2871=_0x02ce[_0x4ba393];return _0x1c2871;};'use strict';var _=require(_0xe02c('0x0'));var rp=require(_0xe02c('0x1'));var md5=require(_0xe02c('0x2'));var util=require('util');var Redis=require(_0xe02c('0x3'));var intUtil=require('./util');var config=require(_0xe02c('0x4'));var logger=require(_0xe02c('0x5'))(_0xe02c('0x6'));config[_0xe02c('0x7')]=_[_0xe02c('0x8')](config[_0xe02c('0x7')],{'host':_0xe02c('0x9'),'port':0x18eb});var io=require(_0xe02c('0xa'))(new Redis(config[_0xe02c('0x7')]));function emit(_0x4fecb3,_0x5eabb0,_0x3c757e){io['to'](_0x4fecb3)[_0xe02c('0xb')](_0x5eabb0,_0x3c757e);}var headers={'Content-Type':_0xe02c('0xc'),'Accept':_0xe02c('0xc')};function getUser(_0x2afbf5,_0x18a398){if(intUtil[_0xe02c('0xd')](_0x18a398)===!![]){logger[_0xe02c('0xe')](_0xe02c('0xf'),_0x18a398);return request({'uri':util[_0xe02c('0x10')](_0xe02c('0x11'),_0x2afbf5[_0xe02c('0x12')])})[_0xe02c('0x13')](function(_0x2a382e){if(_0x2a382e[_0xe02c('0x14')]){return _[_0xe02c('0x15')](_0x2a382e[_0xe02c('0x16')][_0xe02c('0x17')],{'email':_0x18a398});}})['then'](function(_0x43079c){if(_0x43079c){logger['info']('Agent\x20found!');return _0x43079c;}else{logger[_0xe02c('0xe')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xe02c('0x10')]('%s/users/me',_0x2afbf5[_0xe02c('0x12')])});}});}else{logger['info'](_0xe02c('0x18'));return request({'uri':util[_0xe02c('0x10')]('%s/users/me',_0x2afbf5[_0xe02c('0x12')])});}}function request(_0x226a80){logger['debug'](_0xe02c('0x19'),JSON[_0xe02c('0x1a')](_0x226a80));return rp(_['defaults'](_0x226a80,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x3e37bf){var _0x49604a;if(_0x3e37bf[_0xe02c('0x1b')]===_0xe02c('0x1c')){_0x49604a=util[_0xe02c('0x10')](_0xe02c('0x1d'),_0x3e37bf[_0xe02c('0x1e')],_0x3e37bf['password']);}else if(_0x3e37bf[_0xe02c('0x1b')]==='token'){_0x49604a=util['format'](_0xe02c('0x1f'),_0x3e37bf[_0xe02c('0x1e')],_0x3e37bf['token']);}return util[_0xe02c('0x10')](_0xe02c('0x20'),new Buffer(_0x49604a)['toString'](_0xe02c('0x21')));}function getEndUser(_0x45fd82,_0x39b00c,_0x359625){logger[_0xe02c('0xe')](_0xe02c('0x22'),_0x359625);return request({'uri':util[_0xe02c('0x10')](_0xe02c('0x23'),_0x45fd82[_0xe02c('0x12')]),'qs':{'phone':_0x359625}})[_0xe02c('0x13')](function(_0x60b65e){if(_0x60b65e['total_entries']){logger[_0xe02c('0xe')](_0xe02c('0x24'));return _0x60b65e[_0xe02c('0x16')][_0xe02c('0x17')][0x0];}else{logger[_0xe02c('0xe')](_0xe02c('0x25'));return request({'uri':util[_0xe02c('0x10')](_0xe02c('0x26'),_0x45fd82['remoteUri']),'method':_0xe02c('0x27'),'body':{'first_name':_0x39b00c,'title':_0x39b00c,'phone_numbers':[{'type':_0xe02c('0x28'),'value':_0x359625}]}});}});}function getTags(_0x148e2b,_0x481e02){var _0x18b572=[];if(_0x148e2b&&_0x148e2b[_0xe02c('0x29')]>0x0){_0x18b572=_[_0xe02c('0x2a')](_0x148e2b,_0x481e02);}return _0x18b572;}function getCustomFields(_0x287f7e,_0x1e7eab){var _0x35a309=[];var _0x22a285={'custom_fields':{}};if(_0x287f7e[_0xe02c('0x29')]>0x0){_[_0xe02c('0x2b')](_0x287f7e,function(_0x288004){if(_0x288004[_0xe02c('0x2c')]==='string'&&_0x288004[_0xe02c('0x2d')]&&!_0x288004[_0xe02c('0x2e')]){_0x22a285[_0x288004[_0xe02c('0x2d')][_0xe02c('0x2f')]()]=_0x288004[_0xe02c('0x30')][_0xe02c('0x31')]();}else if(_0x288004['type']===_0xe02c('0x32')&&_0x288004[_0xe02c('0x33')]&&_0x288004['customField']){_0x22a285[_0xe02c('0x34')][_0x288004[_0xe02c('0x33')]]=_0x288004[_0xe02c('0x30')][_0xe02c('0x31')]();}else if(_0x288004[_0xe02c('0x2c')]==='variable'&&_0x288004['variableName']&&_0x288004[_0xe02c('0x33')]&&_0x288004[_0xe02c('0x2e')]){_0x1e7eab[_0x288004['variableName']]&&(_0x22a285[_0xe02c('0x34')][_0x288004['idField']]=_0x1e7eab[_0x288004[_0xe02c('0x35')]][_0xe02c('0x31')]());}else if(_0x288004[_0xe02c('0x2c')]===_0xe02c('0x36')&&_0x288004[_0xe02c('0x37')]&&_0x288004['Variable'][_0xe02c('0x38')]&&_0x288004['idField']&&_0x288004[_0xe02c('0x2e')]){_0x1e7eab[_0x288004[_0xe02c('0x37')][_0xe02c('0x38')][_0xe02c('0x2f')]()]&&(_0x22a285[_0xe02c('0x34')][_0x288004[_0xe02c('0x33')]]=_0x1e7eab[_0x288004['Variable'][_0xe02c('0x38')][_0xe02c('0x2f')]()]['toString']());}});}if(_0x22a285[_0xe02c('0x39')]){_0x22a285[_0xe02c('0x39')]=Number(_0x22a285['priority']);}return _0x22a285;}function getTicket(_0x396a06,_0x4e4df6,_0x2bf07b,_0x12b3e5,_0x5b05e1){logger[_0xe02c('0xe')](_0xe02c('0x3a'));var _0x2502c8=_[_0xe02c('0x3b')]({'subject':intUtil[_0xe02c('0x3c')](_0x12b3e5[_0xe02c('0x3d')],_0x5b05e1,'\x20'),'type':'phone','status':_0xe02c('0x3e'),'labels':['xCALLY','Motion',_0xe02c('0x3f')][_0xe02c('0x40')](getTags(_0x12b3e5[_0xe02c('0x41')],_0xe02c('0x38'))),'description':intUtil['getString'](_0x12b3e5[_0xe02c('0x42')],_0x5b05e1,'\x0a'),'_links':{'assigned_user':{'href':util[_0xe02c('0x10')](_0xe02c('0x43'),_0x4e4df6['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x12b3e5[_0xe02c('0x42')],_0x5b05e1,'\x0a')}},getCustomFields(_0x12b3e5[_0xe02c('0x44')],_0x5b05e1));return request({'uri':util[_0xe02c('0x10')](_0xe02c('0x45'),_0x396a06[_0xe02c('0x12')],_0x2bf07b['id']),'method':_0xe02c('0x27'),'body':_0x2502c8});}exports[_0xe02c('0x46')]=function(_0x27ac9e,_0x21d66e,_0x53d123,_0xc7e935,_0x5ef4a1,_0x4d4be5){var _0x17d4af,_0x320f34;_0x4d4be5[_0xe02c('0x12')]=intUtil[_0xe02c('0x47')](_0x4d4be5[_0xe02c('0x12')]);_0x4d4be5[_0xe02c('0x48')]=intUtil[_0xe02c('0x47')](_0x4d4be5[_0xe02c('0x48')]);if(_0x5ef4a1&&_0x5ef4a1['monitor_format']){logger['info'](_0xe02c('0x49'),_0xe02c('0x4a'));_0x21d66e[_0xe02c('0x4b')]=util['format'](_0xe02c('0x4c'),_0x4d4be5[_0xe02c('0x48')],_0x21d66e[_0xe02c('0x4d')],md5(_0x21d66e[_0xe02c('0x4d')]));}else{_0x21d66e[_0xe02c('0x4b')]='';}headers[_0xe02c('0x4e')]=getAuth(_0x4d4be5);return getUser(_0x4d4be5,_0xc7e935[_0xe02c('0x4f')])[_0xe02c('0x13')](function(_0x41d5d1){_0x17d4af=_0x41d5d1;logger[_0xe02c('0xe')]('The\x20User\x20ID\x20is:',_0x17d4af['id']);return getEndUser(_0x4d4be5,_0x21d66e[_0xe02c('0x50')],_0x21d66e[_0xe02c('0x51')]);})[_0xe02c('0x13')](function(_0x1a39ea){_0x320f34=_0x1a39ea;logger[_0xe02c('0xe')](_0xe02c('0x52'),_0x320f34['id']);return getTicket(_0x4d4be5,_0x17d4af,_0x320f34,_0x53d123,_0x21d66e);})[_0xe02c('0x13')](function(_0x3502a5){if(_0x3502a5){logger[_0xe02c('0xe')](_0xe02c('0x53'));logger[_0xe02c('0xe')](_0xe02c('0x54'),_0x3502a5['id']);switch(_0x4d4be5[_0xe02c('0x2c')]){case'integrationTab':logger[_0xe02c('0xe')]('[QUEUE]',_0xe02c('0x55'));emit(util[_0xe02c('0x10')](_0xe02c('0x56'),_0xc7e935[_0xe02c('0x38')]),_0xe02c('0x57'),{'recordId':_0x3502a5['id']});break;case _0xe02c('0x58'):logger[_0xe02c('0xe')](_0xe02c('0x49'),_0xe02c('0x59'));emit(util[_0xe02c('0x10')]('user:%s',_0xc7e935[_0xe02c('0x38')]),_0xe02c('0x5a'),{'uri':util[_0xe02c('0x10')]('https://xcally.desk.com/web/agent/case/%d',_0x3502a5['id'])});break;default:logger[_0xe02c('0x5b')]('[QUEUE]',_0xe02c('0x5c'));}}})['catch'](function(_0x5b41e4){console['error'](_0x5b41e4);logger['error']('[QUEUE]',JSON['stringify'](_0x5b41e4));});};exports[_0xe02c('0x5d')]=function(_0x3ac0a5,_0x1510aa,_0x35fbe2,_0x5d963d,_0x274beb,_0x133f3a,_0x4d2bff){var _0x37ef7d,_0x3ce6fd;_0x133f3a[_0xe02c('0x12')]=intUtil['stripTrailingSlash'](_0x133f3a['remoteUri']);_0x133f3a[_0xe02c('0x48')]=intUtil[_0xe02c('0x47')](_0x133f3a[_0xe02c('0x48')]);if(_0x4d2bff&&_0x4d2bff['recordingFormat']&&_0x4d2bff[_0xe02c('0x5e')]!=='none'){logger['info'](_0xe02c('0x5f'),_0xe02c('0x4a'));_0x1510aa['recordingURL']=util[_0xe02c('0x10')](_0xe02c('0x4c'),_0x133f3a[_0xe02c('0x48')],_0x1510aa['uniqueid'],md5(_0x1510aa[_0xe02c('0x4d')]));}headers[_0xe02c('0x4e')]=getAuth(_0x133f3a);return getUser(_0x133f3a,_0x5d963d['email'])[_0xe02c('0x13')](function(_0x31ba51){_0x37ef7d=_0x31ba51;logger[_0xe02c('0xe')](_0xe02c('0x60'),_0x37ef7d['id']);return getEndUser(_0x133f3a,_0x1510aa[_0xe02c('0x61')],_0x1510aa[_0xe02c('0x62')]);})[_0xe02c('0x13')](function(_0x4303e2){_0x3ce6fd=_0x4303e2;logger[_0xe02c('0xe')]('The\x20Enduser\x20ID\x20is:',_0x3ce6fd['id']);return getTicket(_0x133f3a,_0x37ef7d,_0x3ce6fd,_0x35fbe2,_0x1510aa);})['then'](function(_0x47f61c){if(_0x47f61c){logger[_0xe02c('0xe')](_0xe02c('0x53'));logger[_0xe02c('0xe')]('The\x20Ticket\x20ID\x20is:',_0x47f61c['id']);switch(_0x133f3a['type']){case _0xe02c('0x63'):logger[_0xe02c('0xe')](_0xe02c('0x49'),_0xe02c('0x55'));emit(util[_0xe02c('0x10')]('user:%s',_0x5d963d[_0xe02c('0x38')]),_0xe02c('0x57'),{'recordId':_0x47f61c['id']});break;case'newTab':logger['info'](_0xe02c('0x49'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x5d963d[_0xe02c('0x38')]),_0xe02c('0x5a'),{'uri':util[_0xe02c('0x10')](_0xe02c('0x64'),_0x133f3a[_0xe02c('0x12')],_0x47f61c['id'])});break;default:logger[_0xe02c('0x5b')]('[OUTBOUND]',_0xe02c('0x5c'));}}})['catch'](function(_0x4f3c9a){logger[_0xe02c('0x5b')](_0xe02c('0x5f'),JSON[_0xe02c('0x1a')](_0x4f3c9a));});};exports[_0xe02c('0x65')]=function(_0x5b6979,_0x12d638,_0x31c287,_0x5d2119,_0xa7133f,_0x44bfd0){var _0x4cc74d,_0xc3c539;_0x44bfd0[_0xe02c('0x12')]=intUtil[_0xe02c('0x47')](_0x44bfd0[_0xe02c('0x12')]);_0x44bfd0[_0xe02c('0x48')]=intUtil[_0xe02c('0x47')](_0x44bfd0[_0xe02c('0x48')]);if(_0xa7133f&&_0xa7133f['monitor_format']){logger[_0xe02c('0xe')]('[ABANDONED]','Recording\x20is\x20enabled!');_0x12d638['recordingURL']=util[_0xe02c('0x10')](_0xe02c('0x4c'),_0x44bfd0[_0xe02c('0x48')],_0x12d638[_0xe02c('0x4d')],md5(_0x12d638['uniqueid']));}else{_0x12d638[_0xe02c('0x4b')]='';}headers[_0xe02c('0x4e')]=getAuth(_0x44bfd0);return getUser(_0x44bfd0)['then'](function(_0x597a64){_0x4cc74d=_0x597a64;logger['info'](_0xe02c('0x60'),_0x4cc74d['id']);return getEndUser(_0x44bfd0,_0x12d638[_0xe02c('0x50')],_0x12d638['calleridnum']);})['then'](function(_0x38789c){_0xc3c539=_0x38789c;logger[_0xe02c('0xe')](_0xe02c('0x52'),_0xc3c539['id']);return getTicket(_0x44bfd0,_0x4cc74d,_0xc3c539,_0x31c287,_0x12d638);})[_0xe02c('0x13')](function(_0x96a289){if(_0x96a289){logger['info'](_0xe02c('0x53'));logger[_0xe02c('0xe')](_0xe02c('0x54'),_0x96a289['id']);}})[_0xe02c('0x66')](function(_0x11c506){logger[_0xe02c('0x5b')]('[ABANDONED]',JSON[_0xe02c('0x1a')](_0x11c506));});}; \ 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 321f87c..93fcee6 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 _0xcb23=['isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','toLowerCase','outbound','destcalleridnum','calleridnum','/systemusers(','4.0','headers','lastIndexOf','enduserId','contacts?$select=telephone1','telephone1','contactid',']\x20Enduser\x20Created!','forEach','type','string','nameField','idField','substring','indexOf','content','incident','assign','getString','Descriptions','/contacts(','ticketType','phonecalls','Subjects','queue','callDirection','Fields','odata-entityid','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','trigger:browser:url','stripTrailingSlash','serverUrl','abandoned','%s/api/data/v9.0/','tenantId','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20Call\x20direction:\x20%s','name','inspect','bluebird','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','socket.io-emitter','POST','clientId','remoteUri','username','password','clientSecret','then','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','Bearer\x20','value','validateEmail','email','userEmail','length','internalemailaddress'];(function(_0x4b2f15,_0x3827d0){var _0x246fb0=function(_0x4d2815){while(--_0x4d2815){_0x4b2f15['push'](_0x4b2f15['shift']());}};_0x246fb0(++_0x3827d0);}(_0xcb23,0xfa));var _0x3cb2=function(_0x116f8a,_0x434d06){_0x116f8a=_0x116f8a-0x0;var _0x5b6bbf=_0xcb23[_0x116f8a];return _0x5b6bbf;};'use strict';var _=require('lodash');var BPromise=require(_0x3cb2('0x0'));var rp=require(_0x3cb2('0x1'));var util=require(_0x3cb2('0x2'));var intUtil=require(_0x3cb2('0x3'));var md5=require(_0x3cb2('0x4'));var Redis=require(_0x3cb2('0x5'));var logger=require(_0x3cb2('0x6'))(_0x3cb2('0x7'));var config=require(_0x3cb2('0x8'));config[_0x3cb2('0x9')]=_[_0x3cb2('0xa')](config[_0x3cb2('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x3cb2('0xb'))(new Redis(config[_0x3cb2('0x9')]));function getAuthToken(_0x261463,_0x584c36,_0x49bd29){var _0x1c631b={'method':_0x3cb2('0xc'),'uri':_0x584c36,'form':{'client_id':_0x261463[_0x3cb2('0xd')],'resource':_0x261463[_0x3cb2('0xe')],'username':_0x261463[_0x3cb2('0xf')],'password':_0x261463[_0x3cb2('0x10')],'grant_type':_0x3cb2('0x10'),'client_secret':_0x261463[_0x3cb2('0x11')]},'json':!![]};return rp(_0x1c631b)[_0x3cb2('0x12')](function(_0x8357d1){return _0x8357d1['access_token'];})[_0x3cb2('0x13')](function(_0x45535a){logger[_0x3cb2('0x14')]('['+[_0x49bd29[_0x3cb2('0x15')]()]+_0x3cb2('0x16'));return _0x45535a[_0x3cb2('0x17')];});}function getUser(_0x1af499,_0x5b1ead,_0x5b9807,_0x3e5ee6,_0x522935,_0xc6403b){return new BPromise(function(_0x43fc13,_0x228695){return getAuthToken(_0x5b1ead,_0x3e5ee6,_0xc6403b)[_0x3cb2('0x12')](function(_0x4cdac4){var _0x5b2798={'method':_0x3cb2('0x18'),'uri':_0x522935+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0x3cb2('0x19')+_0x4cdac4,'OData-Version':'4.0'},'json':!![]};return rp(_0x5b2798);})[_0x3cb2('0x12')](function(_0x247696){var _0x4916c1=_0x247696[_0x3cb2('0x1a')];var _0x2a50c9=![];var _0x403a41=null;if(!_['isNil'](_0x5b9807)){if(intUtil[_0x3cb2('0x1b')](_0x5b9807[_0x3cb2('0x1c')])){_0x1af499[_0x3cb2('0x1d')]=_0x5b9807[_0x3cb2('0x1c')];for(_0x403a41=0x0;_0x403a41<_0x4916c1[_0x3cb2('0x1e')];_0x403a41++){if(_0x4916c1[_0x403a41][_0x3cb2('0x1f')]===_0x5b9807[_0x3cb2('0x1c')]&&!_0x4916c1[_0x403a41][_0x3cb2('0x20')]){_0x2a50c9=!![];logger[_0x3cb2('0x21')]('['+[_0xc6403b[_0x3cb2('0x15')]()]+_0x3cb2('0x22')+_0x4916c1[_0x403a41][_0x3cb2('0x23')]+'!');_0x1af499[_0x3cb2('0x24')]=_0x4916c1[_0x403a41][_0x3cb2('0x23')];}}}}if(!_0x2a50c9){logger[_0x3cb2('0x21')]('['+[_0xc6403b['toUpperCase']()]+_0x3cb2('0x25'));_0x1af499[_0x3cb2('0x1d')]=_0x5b1ead['username'];for(_0x403a41=0x0;_0x403a41<_0x4916c1[_0x3cb2('0x1e')];_0x403a41++){if(_0x4916c1[_0x403a41][_0x3cb2('0x1f')]===_0x5b1ead['username']){_0x1af499[_0x3cb2('0x24')]=_0x4916c1[_0x403a41][_0x3cb2('0x23')];}}}_0x43fc13(_0x1af499);})[_0x3cb2('0x13')](function(_0x2a3c0b){_0x228695(_0x2a3c0b[_0x3cb2('0x17')]);});});}function createEndUser(_0x549191,_0x485b3a,_0x44a1dd,_0x4ce062,_0x705350,_0x365e72){return new BPromise(function(_0x358152,_0xea5de5){return getAuthToken(_0x485b3a,_0x44a1dd,_0x365e72)[_0x3cb2('0x12')](function(_0x57bba7){var _0x2a0cb1=_0x365e72[_0x3cb2('0x26')]()===_0x3cb2('0x27')?_0x705350[_0x3cb2('0x28')]:_0x705350[_0x3cb2('0x29')];var _0x357d0b={'method':'POST','uri':_0x4ce062+'contacts','body':{'telephone1':_0x2a0cb1,'fullname':_0x2a0cb1,'firstname':_0x2a0cb1,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x3cb2('0x2a')+_0x549191[_0x3cb2('0x24')]+')'},'headers':{'Authorization':_0x3cb2('0x19')+_0x57bba7,'OData-Version':_0x3cb2('0x2b')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x357d0b);})[_0x3cb2('0x12')](function(_0x57aa97){var _0x41b500=_0x57aa97[_0x3cb2('0x2c')]['odata-entityid'];var _0x49b6c8=_0x41b500['substring'](_0x41b500[_0x3cb2('0x2d')]('(')+0x1,_0x41b500[_0x3cb2('0x2d')](')'));_0x549191[_0x3cb2('0x2e')]=_0x49b6c8;_0x358152(_0x549191);})[_0x3cb2('0x13')](function(_0x312214){_0xea5de5(_0x312214[_0x3cb2('0x17')]);});});}function getEndUser(_0x9ce7fb,_0x47d650,_0x426e2c,_0x2b48f3,_0x32a799,_0x5497e0){return new BPromise(function(_0x41e886,_0xc32426){return getAuthToken(_0x47d650,_0x426e2c,_0x5497e0)[_0x3cb2('0x12')](function(_0x40e7dc){var _0x4bee47={'method':'GET','uri':_0x2b48f3+_0x3cb2('0x2f'),'headers':{'Authorization':'Bearer\x20'+_0x40e7dc,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x4bee47);})['then'](function(_0xe327ca){var _0x490954=null;if(_0xe327ca){var _0x23449f=_0xe327ca['value'];var _0x2712c9=![];for(_0x490954=0x0;_0x490954<_0x23449f[_0x3cb2('0x1e')];_0x490954++){var _0x113bde=_0x5497e0[_0x3cb2('0x26')]()===_0x3cb2('0x27')?_0x32a799['destcalleridnum']:_0x32a799[_0x3cb2('0x29')];if(_0x23449f[_0x490954][_0x3cb2('0x30')]===_0x113bde){_0x2712c9=!![];_0x9ce7fb[_0x3cb2('0x2e')]=_0x23449f[_0x490954][_0x3cb2('0x31')];}}if(_0x2712c9){_0x41e886(_0x9ce7fb);}else{return createEndUser(_0x9ce7fb,_0x47d650,_0x426e2c,_0x2b48f3,_0x32a799,_0x5497e0)['then'](function(_0x232ce4){logger[_0x3cb2('0x21')]('['+[_0x5497e0[_0x3cb2('0x15')]()]+']\x20Enduser\x20created!',_0x232ce4[_0x3cb2('0x2e')]);_0x41e886(_0x232ce4);});}}else{return createEndUser(_0x9ce7fb,_0x47d650,_0x426e2c,_0x2b48f3,_0x32a799,_0x5497e0)[_0x3cb2('0x12')](function(_0x2f3fa8){logger[_0x3cb2('0x21')]('['+[_0x5497e0[_0x3cb2('0x15')]()]+_0x3cb2('0x32'),_0x2f3fa8[_0x3cb2('0x2e')]);_0x41e886(_0x2f3fa8);});}});});}function getCustomFields(_0x45077f,_0x3f8f07,_0x457673){var _0x3a7f13={};if(_0x45077f[_0x3cb2('0x1e')]>0x0){_[_0x3cb2('0x33')](_0x45077f,function(_0x311cde){if(_0x311cde[_0x3cb2('0x34')]===_0x3cb2('0x35')&&_0x311cde[_0x3cb2('0x36')]&&!_0x311cde['customField']){var _0x32f892=_0x311cde[_0x3cb2('0x37')]['toLowerCase']();var _0x14bc90=_0x32f892[_0x3cb2('0x38')](0x0,_0x32f892[_0x3cb2('0x39')]('_'));var _0x55bedc=_0x32f892['substring'](_0x32f892[_0x3cb2('0x39')]('_')+0x1);if(_0x14bc90===_0x457673){_0x3a7f13[_0x55bedc]=_0x311cde[_0x3cb2('0x3a')];}}});}return _0x3a7f13;}function getTicket(_0x444e9b,_0x57fe19,_0x1b2055,_0x25ecec,_0x6ced82,_0x470eba,_0x1f11fb){return new BPromise(function(_0x53d251,_0x5d190c){var _0x248d24;return getAuthToken(_0x57fe19,_0x1b2055,_0x1f11fb)[_0x3cb2('0x12')](function(_0x29ea36){if(_0x470eba['ticketType']===_0x3cb2('0x3b')){_0x248d24={'method':_0x3cb2('0xc'),'uri':_0x25ecec+'incidents','body':Object[_0x3cb2('0x3c')]({},{'title':intUtil[_0x3cb2('0x3d')](_0x470eba['Subjects'],_0x6ced82,'\x20'),'description':intUtil['getString'](_0x470eba[_0x3cb2('0x3e')],_0x6ced82,'\x0a'),'customerid_contact@odata.bind':_0x3cb2('0x3f')+_0x444e9b[_0x3cb2('0x2e')]+')','ownerid@odata.bind':_0x3cb2('0x2a')+_0x444e9b[_0x3cb2('0x24')]+')','caseorigincode':'1'},getCustomFields(_0x470eba['Fields'],_0x6ced82,_0x470eba[_0x3cb2('0x40')])),'headers':{'Authorization':_0x3cb2('0x19')+_0x29ea36,'OData-Version':_0x3cb2('0x2b')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x470eba[_0x3cb2('0x40')]==='phonecall'){_0x248d24={'method':_0x3cb2('0xc'),'uri':_0x25ecec+_0x3cb2('0x41'),'body':Object[_0x3cb2('0x3c')]({},{'subject':intUtil[_0x3cb2('0x3d')](_0x470eba[_0x3cb2('0x42')],_0x6ced82,'\x20'),'phonenumber':String(_0x6ced82[_0x3cb2('0x29')]),'description':intUtil[_0x3cb2('0x3d')](_0x470eba[_0x3cb2('0x3e')],_0x6ced82,'\x0a'),'regardingobjectid_contact@odata.bind':_0x3cb2('0x3f')+_0x444e9b[_0x3cb2('0x2e')]+')','ownerid@odata.bind':_0x3cb2('0x2a')+_0x444e9b[_0x3cb2('0x24')]+')','directioncode':_0x444e9b['callDirection']===_0x3cb2('0x43')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x3cb2('0x2a')+_0x444e9b[_0x3cb2('0x24')]+')','participationtypemask':_0x444e9b['callDirection']===_0x3cb2('0x43')?0x2:0x1},{'partyid_contact@odata.bind':_0x3cb2('0x3f')+_0x444e9b[_0x3cb2('0x2e')]+')','participationtypemask':_0x444e9b[_0x3cb2('0x44')]===_0x3cb2('0x43')?0x1:0x2}]},getCustomFields(_0x470eba[_0x3cb2('0x45')],_0x6ced82,_0x470eba[_0x3cb2('0x40')])),'headers':{'Authorization':'Bearer\x20'+_0x29ea36,'OData-Version':_0x3cb2('0x2b')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x248d24);})[_0x3cb2('0x12')](function(_0x59528b){var _0x4c2a68=_0x59528b[_0x3cb2('0x2c')][_0x3cb2('0x46')];var _0x390cd5=_0x4c2a68[_0x3cb2('0x38')](_0x4c2a68[_0x3cb2('0x2d')]('(')+0x1,_0x4c2a68[_0x3cb2('0x2d')](')'));_0x444e9b[_0x3cb2('0x47')]=_0x390cd5;_0x53d251(_0x444e9b);})['catch'](function(_0x15104c){_0x5d190c(_0x15104c[_0x3cb2('0x17')]);});});}function emit(_0x29ae05,_0x158670,_0xb4d9fe,_0x4ecd93){var _0x3c530f={'uri':util[_0x3cb2('0x48')](_0x3cb2('0x49'),_0x29ae05,_0xb4d9fe,_0x4ecd93)};io['to'](util['format']('user:%s',_0x158670))['emit'](_0x3cb2('0x4a'),_0x3c530f);}exports['cs']=function(_0x309fb7,_0x792108,_0x43ae4a,_0x294b6e,_0x5583fd,_0x310fbb,_0x3f1ecd,_0x541bb4){var _0x18ed90={};_0x310fbb[_0x3cb2('0xe')]=intUtil[_0x3cb2('0x4b')](_0x310fbb[_0x3cb2('0xe')]);_0x310fbb[_0x3cb2('0x4c')]=intUtil['stripTrailingSlash'](_0x310fbb[_0x3cb2('0x4c')]);_0x18ed90[_0x3cb2('0x44')]=_0x541bb4===_0x3cb2('0x43')||_0x541bb4===_0x3cb2('0x4d')?_0x3cb2('0x43'):_0x3cb2('0x27');var _0x45ae2a=util['format'](_0x3cb2('0x4e'),_0x310fbb[_0x3cb2('0xe')]);var _0x2e8964=util['format']('https://login.microsoftonline.com/%s/oauth2/token',_0x310fbb[_0x3cb2('0x4f')]);var _0x2f25e5=util[_0x3cb2('0x48')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x310fbb[_0x3cb2('0x4c')],_0x792108['uniqueid'],md5(_0x792108[_0x3cb2('0x50')]));if(_0x5583fd&&_0x5583fd[_0x3cb2('0x51')]){logger[_0x3cb2('0x21')](_0x3cb2('0x52'),_0x3cb2('0x53'));_0x792108[_0x3cb2('0x54')]=_0x2f25e5;}else if(_0x3f1ecd&&_0x3f1ecd[_0x3cb2('0x55')]&&_0x3f1ecd[_0x3cb2('0x55')]!==_0x3cb2('0x56')){logger[_0x3cb2('0x21')](_0x3cb2('0x57'),_0x3cb2('0x53'));_0x792108[_0x3cb2('0x54')]=_0x2f25e5;}else{_0x792108[_0x3cb2('0x54')]='';}return getUser(_0x18ed90,_0x310fbb,_0x294b6e,_0x2e8964,_0x45ae2a,_0x541bb4)[_0x3cb2('0x12')](function(_0x1e7d1f){logger[_0x3cb2('0x21')]('['+_0x541bb4[_0x3cb2('0x15')]()+_0x3cb2('0x58'),_0x1e7d1f['userId']);logger[_0x3cb2('0x21')]('['+_0x541bb4[_0x3cb2('0x15')]()+_0x3cb2('0x59'),_0x1e7d1f[_0x3cb2('0x1d')]);return getEndUser(_0x1e7d1f,_0x310fbb,_0x2e8964,_0x45ae2a,_0x792108,_0x541bb4);})[_0x3cb2('0x12')](function(_0x225743){logger[_0x3cb2('0x21')]('['+_0x541bb4[_0x3cb2('0x15')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x225743[_0x3cb2('0x2e')]);logger[_0x3cb2('0x21')]('['+_0x541bb4[_0x3cb2('0x15')]()+_0x3cb2('0x5a'),_0x792108[_0x3cb2('0x29')]);return getTicket(_0x225743,_0x310fbb,_0x2e8964,_0x45ae2a,_0x792108,_0x43ae4a,_0x541bb4);})[_0x3cb2('0x12')](function(_0x31960e){logger['info'](util['format']('['+_0x541bb4[_0x3cb2('0x15')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x43ae4a['ticketType'],_0x31960e[_0x3cb2('0x47')]));logger[_0x3cb2('0x21')](util[_0x3cb2('0x48')]('['+_0x541bb4[_0x3cb2('0x15')]()+_0x3cb2('0x5b'),_0x541bb4));if(_0x541bb4!==_0x3cb2('0x4d')){logger['info']('['+_0x541bb4[_0x3cb2('0x15')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x310fbb[_0x3cb2('0xe')],_0x294b6e[_0x3cb2('0x5c')],_0x43ae4a[_0x3cb2('0x40')],_0x31960e['ticketId']);}})[_0x3cb2('0x13')](function(_0x594a4b){logger['error']('['+_0x541bb4[_0x3cb2('0x15')]()+']\x20Error\x20running\x20Dynamics365\x20integration',util[_0x3cb2('0x5d')](_0x594a4b,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x39a8=['inspect','lodash','bluebird','util','./util','../../../../config/logger','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','username','password','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','email','userEmail','length','internalemailaddress',']\x20Agent\x20found\x20','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','message','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','userId','headers','odata-entityid','substring','lastIndexOf','toLowerCase','telephone1','enduserId','info','forEach','type','string','customField','idField','indexOf','ticketType','assign','Subjects','/contacts(','Fields','phonecall','phonecalls','getString','callDirection','queue','ticketId','format','user:%s','stripTrailingSlash','remoteUri','serverUrl','abandoned','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration'];(function(_0x4c321c,_0x3e9da0){var _0x25accb=function(_0x21bf7a){while(--_0x21bf7a){_0x4c321c['push'](_0x4c321c['shift']());}};_0x25accb(++_0x3e9da0);}(_0x39a8,0x112));var _0x839a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x39a8[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x839a('0x0'));var BPromise=require(_0x839a('0x1'));var rp=require('request-promise');var util=require(_0x839a('0x2'));var intUtil=require(_0x839a('0x3'));var md5=require('md5');var Redis=require('ioredis');var logger=require(_0x839a('0x4'))('dynamics365');var config=require(_0x839a('0x5'));config[_0x839a('0x6')]=_[_0x839a('0x7')](config[_0x839a('0x6')],{'host':_0x839a('0x8'),'port':0x18eb});var io=require(_0x839a('0x9'))(new Redis(config[_0x839a('0x6')]));function getAuthToken(_0x51dc69,_0x23fc28,_0x57cad4){var _0x574bec={'method':_0x839a('0xa'),'uri':_0x23fc28,'form':{'client_id':_0x51dc69['clientId'],'resource':_0x51dc69['remoteUri'],'username':_0x51dc69[_0x839a('0xb')],'password':_0x51dc69[_0x839a('0xc')],'grant_type':_0x839a('0xc'),'client_secret':_0x51dc69['clientSecret']},'json':!![]};return rp(_0x574bec)[_0x839a('0xd')](function(_0xbca376){return _0xbca376[_0x839a('0xe')];})[_0x839a('0xf')](function(_0x248b49){logger[_0x839a('0x10')]('['+[_0x57cad4[_0x839a('0x11')]()]+_0x839a('0x12'));return _0x248b49['message'];});}function getUser(_0x4982c3,_0x2068c2,_0x41d0b6,_0x308f6e,_0x21abc9,_0x1ee94f){return new BPromise(function(_0x491745,_0x3ffe5c){return getAuthToken(_0x2068c2,_0x308f6e,_0x1ee94f)[_0x839a('0xd')](function(_0x546250){var _0x469e9a={'method':_0x839a('0x13'),'uri':_0x21abc9+_0x839a('0x14'),'headers':{'Authorization':_0x839a('0x15')+_0x546250,'OData-Version':_0x839a('0x16')},'json':!![]};return rp(_0x469e9a);})[_0x839a('0xd')](function(_0x21a3ab){var _0x22dacf=_0x21a3ab[_0x839a('0x17')];var _0x579a0e=![];var _0xfd5f08=null;if(!_[_0x839a('0x18')](_0x41d0b6)){if(intUtil[_0x839a('0x19')](_0x41d0b6[_0x839a('0x1a')])){_0x4982c3[_0x839a('0x1b')]=_0x41d0b6['email'];for(_0xfd5f08=0x0;_0xfd5f08<_0x22dacf[_0x839a('0x1c')];_0xfd5f08++){if(_0x22dacf[_0xfd5f08][_0x839a('0x1d')]===_0x41d0b6['email']&&!_0x22dacf[_0xfd5f08]['isdisabled']){_0x579a0e=!![];logger['info']('['+[_0x1ee94f[_0x839a('0x11')]()]+_0x839a('0x1e')+_0x22dacf[_0xfd5f08][_0x839a('0x1f')]+'!');_0x4982c3['userId']=_0x22dacf[_0xfd5f08][_0x839a('0x1f')];}}}}if(!_0x579a0e){logger['info']('['+[_0x1ee94f[_0x839a('0x11')]()]+_0x839a('0x20'));_0x4982c3['userEmail']=_0x2068c2[_0x839a('0xb')];for(_0xfd5f08=0x0;_0xfd5f08<_0x22dacf['length'];_0xfd5f08++){if(_0x22dacf[_0xfd5f08][_0x839a('0x1d')]===_0x2068c2[_0x839a('0xb')]){_0x4982c3['userId']=_0x22dacf[_0xfd5f08][_0x839a('0x1f')];}}}_0x491745(_0x4982c3);})['catch'](function(_0x47c17e){_0x3ffe5c(_0x47c17e[_0x839a('0x21')]);});});}function createEndUser(_0x4ddb4b,_0x591edb,_0x4b7ba8,_0x260191,_0x2e189f,_0x1abc9f){return new BPromise(function(_0x29c0d9,_0x302b1e){return getAuthToken(_0x591edb,_0x4b7ba8,_0x1abc9f)[_0x839a('0xd')](function(_0x529a5a){var _0x1047c2=_0x1abc9f['toLowerCase']()===_0x839a('0x22')?_0x2e189f[_0x839a('0x23')]:_0x2e189f[_0x839a('0x24')];var _0x42c28a={'method':'POST','uri':_0x260191+_0x839a('0x25'),'body':{'telephone1':_0x1047c2,'fullname':_0x1047c2,'firstname':_0x1047c2,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x839a('0x26')+_0x4ddb4b[_0x839a('0x27')]+')'},'headers':{'Authorization':_0x839a('0x15')+_0x529a5a,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x42c28a);})['then'](function(_0x277077){var _0x1db0ba=_0x277077[_0x839a('0x28')][_0x839a('0x29')];var _0x36a57a=_0x1db0ba[_0x839a('0x2a')](_0x1db0ba[_0x839a('0x2b')]('(')+0x1,_0x1db0ba['lastIndexOf'](')'));_0x4ddb4b['enduserId']=_0x36a57a;_0x29c0d9(_0x4ddb4b);})[_0x839a('0xf')](function(_0x2d717c){_0x302b1e(_0x2d717c[_0x839a('0x21')]);});});}function getEndUser(_0x507c4e,_0x494277,_0x4779dd,_0x2606a8,_0x3d1947,_0x9ae28c){return new BPromise(function(_0x5d62e5,_0x518c2c){return getAuthToken(_0x494277,_0x4779dd,_0x9ae28c)['then'](function(_0x103615){var _0x2faba4={'method':'GET','uri':_0x2606a8+'contacts?$select=telephone1','headers':{'Authorization':_0x839a('0x15')+_0x103615,'If-None-Match':null,'OData-Version':_0x839a('0x16')},'json':!![]};return rp(_0x2faba4);})[_0x839a('0xd')](function(_0x4bccbc){var _0x170a04=null;if(_0x4bccbc){var _0xeb4577=_0x4bccbc[_0x839a('0x17')];var _0x27b52d=![];for(_0x170a04=0x0;_0x170a04<_0xeb4577[_0x839a('0x1c')];_0x170a04++){var _0x5de014=_0x9ae28c[_0x839a('0x2c')]()===_0x839a('0x22')?_0x3d1947[_0x839a('0x23')]:_0x3d1947[_0x839a('0x24')];if(_0xeb4577[_0x170a04][_0x839a('0x2d')]===_0x5de014){_0x27b52d=!![];_0x507c4e[_0x839a('0x2e')]=_0xeb4577[_0x170a04]['contactid'];}}if(_0x27b52d){_0x5d62e5(_0x507c4e);}else{return createEndUser(_0x507c4e,_0x494277,_0x4779dd,_0x2606a8,_0x3d1947,_0x9ae28c)[_0x839a('0xd')](function(_0x3f8018){logger[_0x839a('0x2f')]('['+[_0x9ae28c[_0x839a('0x11')]()]+']\x20Enduser\x20created!',_0x3f8018[_0x839a('0x2e')]);_0x5d62e5(_0x3f8018);});}}else{return createEndUser(_0x507c4e,_0x494277,_0x4779dd,_0x2606a8,_0x3d1947,_0x9ae28c)['then'](function(_0x105f8a){logger[_0x839a('0x2f')]('['+[_0x9ae28c[_0x839a('0x11')]()]+']\x20Enduser\x20Created!',_0x105f8a[_0x839a('0x2e')]);_0x5d62e5(_0x105f8a);});}});});}function getCustomFields(_0x5938e9,_0x3a65ff,_0x325f10){var _0x3727be={};if(_0x5938e9['length']>0x0){_[_0x839a('0x30')](_0x5938e9,function(_0x4bba90){if(_0x4bba90[_0x839a('0x31')]===_0x839a('0x32')&&_0x4bba90['nameField']&&!_0x4bba90[_0x839a('0x33')]){var _0x5ac102=_0x4bba90[_0x839a('0x34')][_0x839a('0x2c')]();var _0x27de9a=_0x5ac102[_0x839a('0x2a')](0x0,_0x5ac102['indexOf']('_'));var _0x1f1052=_0x5ac102[_0x839a('0x2a')](_0x5ac102[_0x839a('0x35')]('_')+0x1);if(_0x27de9a===_0x325f10){_0x3727be[_0x1f1052]=_0x4bba90['content'];}}});}return _0x3727be;}function getTicket(_0x5dba65,_0x422cf7,_0x27dbb6,_0x22c1c2,_0x408f12,_0x281bfc,_0x3e96cf){return new BPromise(function(_0x981c15,_0xa652d5){var _0x8a3df5;return getAuthToken(_0x422cf7,_0x27dbb6,_0x3e96cf)[_0x839a('0xd')](function(_0x2d8f52){if(_0x281bfc[_0x839a('0x36')]==='incident'){_0x8a3df5={'method':_0x839a('0xa'),'uri':_0x22c1c2+'incidents','body':Object[_0x839a('0x37')]({},{'title':intUtil['getString'](_0x281bfc[_0x839a('0x38')],_0x408f12,'\x20'),'description':intUtil['getString'](_0x281bfc['Descriptions'],_0x408f12,'\x0a'),'customerid_contact@odata.bind':_0x839a('0x39')+_0x5dba65[_0x839a('0x2e')]+')','ownerid@odata.bind':_0x839a('0x26')+_0x5dba65[_0x839a('0x27')]+')','caseorigincode':'1'},getCustomFields(_0x281bfc[_0x839a('0x3a')],_0x408f12,_0x281bfc['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0x2d8f52,'OData-Version':_0x839a('0x16')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x281bfc[_0x839a('0x36')]===_0x839a('0x3b')){_0x8a3df5={'method':_0x839a('0xa'),'uri':_0x22c1c2+_0x839a('0x3c'),'body':Object[_0x839a('0x37')]({},{'subject':intUtil[_0x839a('0x3d')](_0x281bfc[_0x839a('0x38')],_0x408f12,'\x20'),'phonenumber':String(_0x408f12[_0x839a('0x24')]),'description':intUtil[_0x839a('0x3d')](_0x281bfc['Descriptions'],_0x408f12,'\x0a'),'regardingobjectid_contact@odata.bind':_0x839a('0x39')+_0x5dba65[_0x839a('0x2e')]+')','ownerid@odata.bind':_0x839a('0x26')+_0x5dba65[_0x839a('0x27')]+')','directioncode':_0x5dba65[_0x839a('0x3e')]===_0x839a('0x3f')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x839a('0x26')+_0x5dba65[_0x839a('0x27')]+')','participationtypemask':_0x5dba65[_0x839a('0x3e')]===_0x839a('0x3f')?0x2:0x1},{'partyid_contact@odata.bind':_0x839a('0x39')+_0x5dba65[_0x839a('0x2e')]+')','participationtypemask':_0x5dba65[_0x839a('0x3e')]===_0x839a('0x3f')?0x1:0x2}]},getCustomFields(_0x281bfc[_0x839a('0x3a')],_0x408f12,_0x281bfc[_0x839a('0x36')])),'headers':{'Authorization':'Bearer\x20'+_0x2d8f52,'OData-Version':_0x839a('0x16')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x8a3df5);})['then'](function(_0xb24a4e){var _0x57fbd6=_0xb24a4e['headers'][_0x839a('0x29')];var _0x45bbab=_0x57fbd6[_0x839a('0x2a')](_0x57fbd6[_0x839a('0x2b')]('(')+0x1,_0x57fbd6[_0x839a('0x2b')](')'));_0x5dba65[_0x839a('0x40')]=_0x45bbab;_0x981c15(_0x5dba65);})[_0x839a('0xf')](function(_0x18c395){_0xa652d5(_0x18c395[_0x839a('0x21')]);});});}function emit(_0x124ad3,_0x4a12a1,_0x4fff6f,_0x2b344){var _0x33e0be={'uri':util[_0x839a('0x41')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x124ad3,_0x4fff6f,_0x2b344)};io['to'](util[_0x839a('0x41')](_0x839a('0x42'),_0x4a12a1))['emit']('trigger:browser:url',_0x33e0be);}exports['cs']=function(_0x40b7ee,_0x44aa10,_0x1ee4dd,_0x4b7bfd,_0x3354a0,_0x5e9e15,_0x1dbe2a,_0x32135b){var _0x214b99={};_0x5e9e15['remoteUri']=intUtil[_0x839a('0x43')](_0x5e9e15[_0x839a('0x44')]);_0x5e9e15[_0x839a('0x45')]=intUtil[_0x839a('0x43')](_0x5e9e15[_0x839a('0x45')]);_0x214b99[_0x839a('0x3e')]=_0x32135b===_0x839a('0x3f')||_0x32135b===_0x839a('0x46')?_0x839a('0x3f'):_0x839a('0x22');var _0x4c5226=util[_0x839a('0x41')](_0x839a('0x47'),_0x5e9e15[_0x839a('0x44')]);var _0x1b5096=util[_0x839a('0x41')](_0x839a('0x48'),_0x5e9e15[_0x839a('0x49')]);var _0x1b1693=util[_0x839a('0x41')](_0x839a('0x4a'),_0x5e9e15[_0x839a('0x45')],_0x44aa10[_0x839a('0x4b')],md5(_0x44aa10[_0x839a('0x4b')]));if(_0x3354a0&&_0x3354a0[_0x839a('0x4c')]){logger[_0x839a('0x2f')](_0x839a('0x4d'),_0x839a('0x4e'));_0x44aa10[_0x839a('0x4f')]=_0x1b1693;}else if(_0x1dbe2a&&_0x1dbe2a[_0x839a('0x50')]&&_0x1dbe2a[_0x839a('0x50')]!==_0x839a('0x51')){logger[_0x839a('0x2f')](_0x839a('0x52'),_0x839a('0x4e'));_0x44aa10[_0x839a('0x4f')]=_0x1b1693;}else{_0x44aa10[_0x839a('0x4f')]='';}return getUser(_0x214b99,_0x5e9e15,_0x4b7bfd,_0x1b5096,_0x4c5226,_0x32135b)['then'](function(_0x58060b){logger[_0x839a('0x2f')]('['+_0x32135b['toUpperCase']()+']\x20The\x20User\x20ID\x20is:',_0x58060b['userId']);logger[_0x839a('0x2f')]('['+_0x32135b[_0x839a('0x11')]()+_0x839a('0x53'),_0x58060b[_0x839a('0x1b')]);return getEndUser(_0x58060b,_0x5e9e15,_0x1b5096,_0x4c5226,_0x44aa10,_0x32135b);})[_0x839a('0xd')](function(_0x19172f){logger[_0x839a('0x2f')]('['+_0x32135b['toUpperCase']()+_0x839a('0x54'),_0x19172f[_0x839a('0x2e')]);logger['info']('['+_0x32135b['toUpperCase']()+_0x839a('0x55'),_0x44aa10[_0x839a('0x24')]);return getTicket(_0x19172f,_0x5e9e15,_0x1b5096,_0x4c5226,_0x44aa10,_0x1ee4dd,_0x32135b);})[_0x839a('0xd')](function(_0x11e885){logger[_0x839a('0x2f')](util[_0x839a('0x41')]('['+_0x32135b[_0x839a('0x11')]()+_0x839a('0x56'),_0x1ee4dd[_0x839a('0x36')],_0x11e885['ticketId']));logger[_0x839a('0x2f')](util[_0x839a('0x41')]('['+_0x32135b['toUpperCase']()+']\x20Call\x20direction:\x20%s',_0x32135b));if(_0x32135b!==_0x839a('0x46')){logger['info']('['+_0x32135b[_0x839a('0x11')]()+']',_0x839a('0x57'));emit(_0x5e9e15[_0x839a('0x44')],_0x4b7bfd[_0x839a('0x58')],_0x1ee4dd[_0x839a('0x36')],_0x11e885[_0x839a('0x40')]);}})['catch'](function(_0x3f194a){logger[_0x839a('0x10')]('['+_0x32135b[_0x839a('0x11')]()+_0x839a('0x59'),util[_0x839a('0x5a')](_0x3f194a,{'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 a8b2027..72d4283 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 _0xec14=['redis','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','calleridname','Subjects','Descriptions','
','name','Fields','custom_fields','mapValues','value','remoteUri','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','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\x20created.','Basic\x20%s','apiKey','toString','base64','[HTTP]','stringify','GET','map','forEach','string','nameField','toLowerCase','content','idField','push','customField','variableName','type','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','none','destcalleridnum','[OUTBOUND]','abandoned','[ABANDONED]','lodash','request-promise','md5','util','./util','../../../../config/environment','freshdesk'];(function(_0x268206,_0x557a4c){var _0x54887d=function(_0x1167fb){while(--_0x1167fb){_0x268206['push'](_0x268206['shift']());}};_0x54887d(++_0x557a4c);}(_0xec14,0x1ac));var _0x4ec1=function(_0xa9a245,_0x2a0387){_0xa9a245=_0xa9a245-0x0;var _0x2d0eaa=_0xec14[_0xa9a245];return _0x2d0eaa;};'use strict';var _=require(_0x4ec1('0x0'));var rp=require(_0x4ec1('0x1'));var md5=require(_0x4ec1('0x2'));var util=require(_0x4ec1('0x3'));var Redis=require('ioredis');var intUtil=require(_0x4ec1('0x4'));var config=require(_0x4ec1('0x5'));var logger=require('../../../../config/logger')(_0x4ec1('0x6'));config[_0x4ec1('0x7')]=_['defaults'](config[_0x4ec1('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x4ec1('0x8'))(new Redis(config['redis']));var headers={'Content-Type':_0x4ec1('0x9'),'Accept':_0x4ec1('0x9')};function emit(_0x53bb98,_0x525635,_0x29186e){io['to'](_0x53bb98)[_0x4ec1('0xa')](_0x525635,_0x29186e);}function getTicket(_0x423b55,_0xf8ae99,_0x5e681d,_0x3e2b34,_0x438e07){logger[_0x4ec1('0xb')](_0x4ec1('0xc'));var _0x55aa67=_[_0x4ec1('0xd')]({'responder_id':_0xf8ae99['id'],'requester_id':_0x5e681d['id'],'name':util[_0x4ec1('0xe')]('Caller\x20-\x20%s',_0x438e07[_0x4ec1('0xf')]),'phone':_0x438e07['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x3e2b34[_0x4ec1('0x10')],_0x438e07,'\x20'),'description':intUtil['getString'](_0x3e2b34[_0x4ec1('0x11')],_0x438e07,_0x4ec1('0x12')),'tags':getTags(_0x3e2b34['Tags'],_0x4ec1('0x13'))},getCustomFields(_0x3e2b34[_0x4ec1('0x14')],_0x438e07));_0x55aa67[_0x4ec1('0x15')]=_[_0x4ec1('0x16')](_['keyBy'](_0x55aa67[_0x4ec1('0x15')],'id'),_0x4ec1('0x17'));return request({'uri':util[_0x4ec1('0xe')]('%s/api/v2/tickets',_0x423b55[_0x4ec1('0x18')]),'method':_0x4ec1('0x19'),'body':_0x55aa67})[_0x4ec1('0x1a')](function(_0x25cb04){logger[_0x4ec1('0xb')](_0x4ec1('0x1b'));return _0x25cb04;});}function getUser(_0x1890b2,_0x54689e){if(intUtil[_0x4ec1('0x1c')](_0x54689e)){return request({'uri':util[_0x4ec1('0xe')](_0x4ec1('0x1d'),_0x1890b2[_0x4ec1('0x18')]),'qs':{'email':_0x54689e}})[_0x4ec1('0x1a')](function(_0x1ef2ef){if(_0x1ef2ef['length']){logger[_0x4ec1('0xb')](_0x4ec1('0x1e'));return _[_0x4ec1('0x1f')](_0x1ef2ef,function(_0x13546c){return _0x13546c[_0x4ec1('0x20')][_0x4ec1('0x21')]===_0x54689e;});}else{logger[_0x4ec1('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x4ec1('0x22'),_0x1890b2[_0x4ec1('0x18')])})[_0x4ec1('0x1a')](function(_0x2fe4ec){logger['info'](_0x4ec1('0x23'));return _0x2fe4ec;});}});}else{logger[_0x4ec1('0xb')](_0x4ec1('0x24'));return request({'uri':util[_0x4ec1('0xe')](_0x4ec1('0x22'),_0x1890b2[_0x4ec1('0x18')])})[_0x4ec1('0x1a')](function(_0x45c2c8){logger[_0x4ec1('0xb')]('Admin\x20account\x20selected.');return _0x45c2c8;});}}function getEndUser(_0x1f6833,_0x541a59,_0x10375d){logger[_0x4ec1('0xb')](_0x4ec1('0x25'),_0x10375d);return request({'uri':util['format'](_0x4ec1('0x26'),_0x1f6833[_0x4ec1('0x18')]),'qs':{'phone':_0x10375d}})[_0x4ec1('0x1a')](function(_0x409455){if(_0x409455[_0x4ec1('0x27')]){logger[_0x4ec1('0xb')]('Enduser\x20found!');return _[_0x4ec1('0x1f')](_0x409455,{'phone':_0x10375d});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x4ec1('0xe')]('%s/api/v2/contacts',_0x1f6833['remoteUri']),'method':'POST','body':{'name':_0x541a59,'phone':_0x10375d}})[_0x4ec1('0x1a')](function(_0x760e1b){logger[_0x4ec1('0xb')](_0x4ec1('0x28'));return _0x760e1b;});}});}function getAuth(_0x487b83){return util[_0x4ec1('0xe')](_0x4ec1('0x29'),new Buffer(_0x487b83[_0x4ec1('0x2a')]+':X')[_0x4ec1('0x2b')](_0x4ec1('0x2c')));}function request(_0x882099){logger['debug'](_0x4ec1('0x2d'),JSON[_0x4ec1('0x2e')](_0x882099));return rp(_['defaults'](_0x882099,{'method':_0x4ec1('0x2f'),'headers':headers,'json':!![]}));}function getTags(_0x112f69,_0x46a69c){var _0x128ea4=[];if(_0x112f69&&_0x112f69[_0x4ec1('0x27')]>0x0){_0x128ea4=_[_0x4ec1('0x30')](_0x112f69,_0x46a69c);}return _0x128ea4;}function getCustomFields(_0x34115f,_0x5c43f9){var _0x42ac23=[];var _0x1a2a43={'custom_fields':[]};if(_0x34115f[_0x4ec1('0x27')]>0x0){_[_0x4ec1('0x31')](_0x34115f,function(_0x1a06c1){if(_0x1a06c1['type']===_0x4ec1('0x32')&&_0x1a06c1['nameField']&&!_0x1a06c1['customField']){_0x1a2a43[_0x1a06c1[_0x4ec1('0x33')][_0x4ec1('0x34')]()]=_0x1a06c1[_0x4ec1('0x35')][_0x4ec1('0x2b')]();}else if(_0x1a06c1['type']==='string'&&_0x1a06c1[_0x4ec1('0x36')]&&_0x1a06c1['customField']){_0x1a2a43['custom_fields'][_0x4ec1('0x37')]({'id':_0x1a06c1[_0x4ec1('0x36')],'value':_0x1a06c1[_0x4ec1('0x35')][_0x4ec1('0x2b')]()});}else if(_0x1a06c1['type']==='variable'&&_0x1a06c1['variableName']&&_0x1a06c1[_0x4ec1('0x36')]&&_0x1a06c1[_0x4ec1('0x38')]){_0x5c43f9[_0x1a06c1[_0x4ec1('0x39')]]&&_0x1a2a43['custom_fields'][_0x4ec1('0x37')]({'id':_0x1a06c1['idField'],'value':_0x5c43f9[_0x1a06c1[_0x4ec1('0x39')]]['toString']()});}else if(_0x1a06c1[_0x4ec1('0x3a')]===_0x4ec1('0x3b')&&_0x1a06c1[_0x4ec1('0x3c')]&&_0x1a06c1[_0x4ec1('0x3c')]['name']&&_0x1a06c1[_0x4ec1('0x36')]&&_0x1a06c1[_0x4ec1('0x38')]){_0x5c43f9[_0x1a06c1['Variable'][_0x4ec1('0x13')]['toLowerCase']()]&&_0x1a2a43[_0x4ec1('0x15')][_0x4ec1('0x37')]({'id':_0x1a06c1[_0x4ec1('0x36')],'value':_0x5c43f9[_0x1a06c1[_0x4ec1('0x3c')][_0x4ec1('0x13')]['toLowerCase']()][_0x4ec1('0x2b')]()});}});}return _0x1a2a43;}exports[_0x4ec1('0x3d')]=function(_0x165836,_0x569281,_0x5855ab,_0x4716bb,_0x5de720,_0x46d7d7){var _0x5f869f,_0x30f483;_0x46d7d7[_0x4ec1('0x18')]=intUtil[_0x4ec1('0x3e')](_0x46d7d7[_0x4ec1('0x18')]);_0x46d7d7['serverUrl']=intUtil['stripTrailingSlash'](_0x46d7d7[_0x4ec1('0x3f')]);if(_0x5de720&&_0x5de720[_0x4ec1('0x40')]){logger['info'](_0x4ec1('0x41'),_0x4ec1('0x42'));_0x569281[_0x4ec1('0x43')]=util[_0x4ec1('0xe')](_0x4ec1('0x44'),_0x46d7d7[_0x4ec1('0x3f')],_0x569281['uniqueid'],md5(_0x569281[_0x4ec1('0x45')]));}else{_0x569281[_0x4ec1('0x43')]='';}headers[_0x4ec1('0x46')]=getAuth(_0x46d7d7);return getUser(_0x46d7d7,_0x4716bb[_0x4ec1('0x21')])[_0x4ec1('0x1a')](function(_0x49b91e){_0x5f869f=_0x49b91e;logger['info'](_0x4ec1('0x47'),_0x5f869f['id']);return getEndUser(_0x46d7d7,_0x569281['calleridname'],_0x569281[_0x4ec1('0x48')]);})[_0x4ec1('0x1a')](function(_0x185ac6){_0x30f483=_0x185ac6;logger['info'](_0x4ec1('0x49'),_0x30f483['id']);return getTicket(_0x46d7d7,_0x5f869f,_0x30f483,_0x5855ab,_0x569281);})[_0x4ec1('0x1a')](function(_0x13ae5d){if(_0x13ae5d&&_0x13ae5d['id']){logger[_0x4ec1('0xb')](_0x4ec1('0x1b'));logger[_0x4ec1('0xb')](_0x4ec1('0x4a'),_0x13ae5d['id']);logger['info'](_0x4ec1('0x41'),_0x4ec1('0x4b'));emit(util['format'](_0x4ec1('0x4c'),_0x4716bb[_0x4ec1('0x13')]),'trigger:browser:url',{'uri':util[_0x4ec1('0xe')](_0x4ec1('0x4d'),_0x46d7d7[_0x4ec1('0x18')],_0x13ae5d['id'])});}})[_0x4ec1('0x4e')](function(_0x244ba1){logger[_0x4ec1('0x4f')](_0x4ec1('0x41'),JSON[_0x4ec1('0x2e')](_0x244ba1));});};exports[_0x4ec1('0x50')]=function(_0x3209b9,_0x5e6a6c,_0x9f92b7,_0x22a141,_0xf8a513,_0x5d8ccd,_0x5d93d8){var _0x1899fa,_0x572174;_0x5d8ccd[_0x4ec1('0x18')]=intUtil['stripTrailingSlash'](_0x5d8ccd['remoteUri']);_0x5d8ccd['serverUrl']=intUtil[_0x4ec1('0x3e')](_0x5d8ccd[_0x4ec1('0x3f')]);if(_0x5d93d8&&_0x5d93d8[_0x4ec1('0x51')]&&_0x5d93d8[_0x4ec1('0x51')]!==_0x4ec1('0x52')){logger[_0x4ec1('0xb')]('[OUTBOUND]',_0x4ec1('0x42'));_0x5e6a6c[_0x4ec1('0x43')]=util[_0x4ec1('0xe')](_0x4ec1('0x44'),_0x5d8ccd[_0x4ec1('0x3f')],_0x5e6a6c[_0x4ec1('0x45')],md5(_0x5e6a6c[_0x4ec1('0x45')]));}headers[_0x4ec1('0x46')]=getAuth(_0x5d8ccd);return getUser(_0x5d8ccd,_0x22a141[_0x4ec1('0x21')])[_0x4ec1('0x1a')](function(_0x2e8e18){_0x1899fa=_0x2e8e18;logger[_0x4ec1('0xb')](_0x4ec1('0x47'),_0x1899fa['id']);return getEndUser(_0x5d8ccd,_0x5e6a6c['destcalleridname'],_0x5e6a6c[_0x4ec1('0x53')]);})[_0x4ec1('0x1a')](function(_0x428be2){_0x572174=_0x428be2;logger['info']('The\x20Enduser\x20ID\x20is:',_0x572174['id']);return getTicket(_0x5d8ccd,_0x1899fa,_0x572174,_0x9f92b7,_0x5e6a6c);})[_0x4ec1('0x1a')](function(_0x2fa83f){if(_0x2fa83f&&_0x2fa83f['id']){logger[_0x4ec1('0xb')](_0x4ec1('0x1b'));logger[_0x4ec1('0xb')](_0x4ec1('0x4a'),_0x2fa83f['id']);logger[_0x4ec1('0xb')](_0x4ec1('0x54'),_0x4ec1('0x4b'));emit(util[_0x4ec1('0xe')](_0x4ec1('0x4c'),_0x22a141[_0x4ec1('0x13')]),'trigger:browser:url',{'uri':util[_0x4ec1('0xe')](_0x4ec1('0x4d'),_0x5d8ccd[_0x4ec1('0x18')],_0x2fa83f['id'])});}})['catch'](function(_0x144377){logger[_0x4ec1('0x4f')](_0x4ec1('0x54'),JSON[_0x4ec1('0x2e')](_0x144377));});};exports[_0x4ec1('0x55')]=function(_0x5c176a,_0x35642e,_0x591706,_0x572210,_0x28734c,_0xe491ca){var _0x204c87,_0x2f4df5;_0xe491ca['remoteUri']=intUtil[_0x4ec1('0x3e')](_0xe491ca['remoteUri']);_0xe491ca[_0x4ec1('0x3f')]=intUtil[_0x4ec1('0x3e')](_0xe491ca[_0x4ec1('0x3f')]);if(_0x28734c&&_0x28734c[_0x4ec1('0x40')]){logger['info'](_0x4ec1('0x56'),_0x4ec1('0x42'));_0x35642e['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xe491ca[_0x4ec1('0x3f')],_0x35642e[_0x4ec1('0x45')],md5(_0x35642e['uniqueid']));}else{_0x35642e[_0x4ec1('0x43')]='';}headers['Authorization']=getAuth(_0xe491ca);return getUser(_0xe491ca,'')['then'](function(_0x15002e){_0x204c87=_0x15002e;logger[_0x4ec1('0xb')](_0x4ec1('0x47'),_0x204c87['id']);return getEndUser(_0xe491ca,_0x35642e[_0x4ec1('0xf')],_0x35642e['calleridnum']);})[_0x4ec1('0x1a')](function(_0x884405){_0x2f4df5=_0x884405;logger[_0x4ec1('0xb')](_0x4ec1('0x49'),_0x2f4df5['id']);return getTicket(_0xe491ca,_0x204c87,_0x2f4df5,_0x591706,_0x35642e);})[_0x4ec1('0x1a')](function(_0xc89596){if(_0xc89596){logger[_0x4ec1('0xb')]('Ticket\x20created!');logger[_0x4ec1('0xb')](_0x4ec1('0x4a'),_0xc89596['id']);}})[_0x4ec1('0x4e')](function(_0xeb7828){logger[_0x4ec1('0x4f')]('[ABANDONED]',JSON[_0x4ec1('0x2e')](_0xeb7828));});}; \ No newline at end of file +var _0xfafc=['name','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','POST','then','validateEmail','%s/api/v2/agents','Agent\x20found!','find','contact','info','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','apiKey','toString','debug','GET','length','type','string','nameField','customField','toLowerCase','content','idField','custom_fields','push','variableName','customVariable','Variable','serverUrl','stripTrailingSlash','monitor_format','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/helpdesk/tickets/%d','catch','stringify','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','user:%s','[ABANDONED]','error','request-promise','./util','../../../../config/logger','freshdesk','redis','defaults','socket.io-emitter','application/json','emit','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','getString','Subjects','
','Tags'];(function(_0x5be2fe,_0x261229){var _0x4ad4e4=function(_0x191549){while(--_0x191549){_0x5be2fe['push'](_0x5be2fe['shift']());}};_0x4ad4e4(++_0x261229);}(_0xfafc,0xf1));var _0xcfaf=function(_0x13e300,_0x1bcb41){_0x13e300=_0x13e300-0x0;var _0x5a3eea=_0xfafc[_0x13e300];return _0x5a3eea;};'use strict';var _=require('lodash');var rp=require(_0xcfaf('0x0'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var intUtil=require(_0xcfaf('0x1'));var config=require('../../../../config/environment');var logger=require(_0xcfaf('0x2'))(_0xcfaf('0x3'));config[_0xcfaf('0x4')]=_[_0xcfaf('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xcfaf('0x6'))(new Redis(config['redis']));var headers={'Content-Type':_0xcfaf('0x7'),'Accept':'application/json'};function emit(_0x32defd,_0x4cfc27,_0x51d894){io['to'](_0x32defd)[_0xcfaf('0x8')](_0x4cfc27,_0x51d894);}function getTicket(_0x14cf5f,_0x45a9dd,_0x1fe4a1,_0x10c842,_0x383260){logger['info'](_0xcfaf('0x9'));var _0x3b1827=_[_0xcfaf('0xa')]({'responder_id':_0x45a9dd['id'],'requester_id':_0x1fe4a1['id'],'name':util[_0xcfaf('0xb')](_0xcfaf('0xc'),_0x383260['calleridname']),'phone':_0x383260['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xcfaf('0xd')](_0x10c842[_0xcfaf('0xe')],_0x383260,'\x20'),'description':intUtil['getString'](_0x10c842['Descriptions'],_0x383260,_0xcfaf('0xf')),'tags':getTags(_0x10c842[_0xcfaf('0x10')],_0xcfaf('0x11'))},getCustomFields(_0x10c842['Fields'],_0x383260));_0x3b1827['custom_fields']=_[_0xcfaf('0x12')](_[_0xcfaf('0x13')](_0x3b1827['custom_fields'],'id'),_0xcfaf('0x14'));return request({'uri':util[_0xcfaf('0xb')](_0xcfaf('0x15'),_0x14cf5f[_0xcfaf('0x16')]),'method':_0xcfaf('0x17'),'body':_0x3b1827})[_0xcfaf('0x18')](function(_0x33f633){logger['info']('Ticket\x20created!');return _0x33f633;});}function getUser(_0x39102d,_0x1319a7){if(intUtil[_0xcfaf('0x19')](_0x1319a7)){return request({'uri':util['format'](_0xcfaf('0x1a'),_0x39102d[_0xcfaf('0x16')]),'qs':{'email':_0x1319a7}})[_0xcfaf('0x18')](function(_0x116389){if(_0x116389['length']){logger['info'](_0xcfaf('0x1b'));return _[_0xcfaf('0x1c')](_0x116389,function(_0x56f7d3){return _0x56f7d3[_0xcfaf('0x1d')]['email']===_0x1319a7;});}else{logger[_0xcfaf('0x1e')](_0xcfaf('0x1f'));return request({'uri':util[_0xcfaf('0xb')]('%s/api/v2/agents/me',_0x39102d[_0xcfaf('0x16')])})[_0xcfaf('0x18')](function(_0x1250bc){logger[_0xcfaf('0x1e')]('Admin\x20account\x20selected.');return _0x1250bc;});}});}else{logger[_0xcfaf('0x1e')](_0xcfaf('0x20'));return request({'uri':util['format'](_0xcfaf('0x21'),_0x39102d[_0xcfaf('0x16')])})[_0xcfaf('0x18')](function(_0x3ed9d8){logger[_0xcfaf('0x1e')](_0xcfaf('0x22'));return _0x3ed9d8;});}}function getEndUser(_0x472a6e,_0x344b2b,_0xb8205e){logger[_0xcfaf('0x1e')]('Searching\x20enduser\x20with\x20phone',_0xb8205e);return request({'uri':util[_0xcfaf('0xb')](_0xcfaf('0x23'),_0x472a6e[_0xcfaf('0x16')]),'qs':{'phone':_0xb8205e}})[_0xcfaf('0x18')](function(_0x41bd85){if(_0x41bd85['length']){logger[_0xcfaf('0x1e')](_0xcfaf('0x24'));return _[_0xcfaf('0x1c')](_0x41bd85,{'phone':_0xb8205e});}else{logger[_0xcfaf('0x1e')](_0xcfaf('0x25'));return request({'uri':util[_0xcfaf('0xb')]('%s/api/v2/contacts',_0x472a6e['remoteUri']),'method':'POST','body':{'name':_0x344b2b,'phone':_0xb8205e}})['then'](function(_0x447878){logger[_0xcfaf('0x1e')](_0xcfaf('0x26'));return _0x447878;});}});}function getAuth(_0x41b676){return util[_0xcfaf('0xb')]('Basic\x20%s',new Buffer(_0x41b676[_0xcfaf('0x27')]+':X')[_0xcfaf('0x28')]('base64'));}function request(_0x537fcb){logger[_0xcfaf('0x29')]('[HTTP]',JSON['stringify'](_0x537fcb));return rp(_[_0xcfaf('0x5')](_0x537fcb,{'method':_0xcfaf('0x2a'),'headers':headers,'json':!![]}));}function getTags(_0x16dca4,_0x3d4484){var _0x1f3cea=[];if(_0x16dca4&&_0x16dca4['length']>0x0){_0x1f3cea=_['map'](_0x16dca4,_0x3d4484);}return _0x1f3cea;}function getCustomFields(_0x548db5,_0x1ca4ae){var _0x2e1b04=[];var _0x3d83a1={'custom_fields':[]};if(_0x548db5[_0xcfaf('0x2b')]>0x0){_['forEach'](_0x548db5,function(_0x4b54dd){if(_0x4b54dd[_0xcfaf('0x2c')]===_0xcfaf('0x2d')&&_0x4b54dd[_0xcfaf('0x2e')]&&!_0x4b54dd[_0xcfaf('0x2f')]){_0x3d83a1[_0x4b54dd[_0xcfaf('0x2e')][_0xcfaf('0x30')]()]=_0x4b54dd[_0xcfaf('0x31')][_0xcfaf('0x28')]();}else if(_0x4b54dd[_0xcfaf('0x2c')]===_0xcfaf('0x2d')&&_0x4b54dd[_0xcfaf('0x32')]&&_0x4b54dd[_0xcfaf('0x2f')]){_0x3d83a1[_0xcfaf('0x33')][_0xcfaf('0x34')]({'id':_0x4b54dd['idField'],'value':_0x4b54dd[_0xcfaf('0x31')][_0xcfaf('0x28')]()});}else if(_0x4b54dd['type']==='variable'&&_0x4b54dd['variableName']&&_0x4b54dd[_0xcfaf('0x32')]&&_0x4b54dd[_0xcfaf('0x2f')]){_0x1ca4ae[_0x4b54dd[_0xcfaf('0x35')]]&&_0x3d83a1[_0xcfaf('0x33')][_0xcfaf('0x34')]({'id':_0x4b54dd[_0xcfaf('0x32')],'value':_0x1ca4ae[_0x4b54dd[_0xcfaf('0x35')]]['toString']()});}else if(_0x4b54dd[_0xcfaf('0x2c')]===_0xcfaf('0x36')&&_0x4b54dd[_0xcfaf('0x37')]&&_0x4b54dd['Variable'][_0xcfaf('0x11')]&&_0x4b54dd[_0xcfaf('0x32')]&&_0x4b54dd[_0xcfaf('0x2f')]){_0x1ca4ae[_0x4b54dd[_0xcfaf('0x37')][_0xcfaf('0x11')][_0xcfaf('0x30')]()]&&_0x3d83a1[_0xcfaf('0x33')]['push']({'id':_0x4b54dd[_0xcfaf('0x32')],'value':_0x1ca4ae[_0x4b54dd[_0xcfaf('0x37')]['name'][_0xcfaf('0x30')]()][_0xcfaf('0x28')]()});}});}return _0x3d83a1;}exports['queue']=function(_0x56db2c,_0x40ead9,_0x21bf77,_0x4b6f92,_0x56a82e,_0x36721f){var _0x3241a6,_0x3c2566;_0x36721f[_0xcfaf('0x16')]=intUtil['stripTrailingSlash'](_0x36721f[_0xcfaf('0x16')]);_0x36721f[_0xcfaf('0x38')]=intUtil[_0xcfaf('0x39')](_0x36721f['serverUrl']);if(_0x56a82e&&_0x56a82e[_0xcfaf('0x3a')]){logger[_0xcfaf('0x1e')]('[QUEUE]','Recording\x20is\x20enabled!');_0x40ead9[_0xcfaf('0x3b')]=util[_0xcfaf('0xb')](_0xcfaf('0x3c'),_0x36721f[_0xcfaf('0x38')],_0x40ead9[_0xcfaf('0x3d')],md5(_0x40ead9[_0xcfaf('0x3d')]));}else{_0x40ead9[_0xcfaf('0x3b')]='';}headers[_0xcfaf('0x3e')]=getAuth(_0x36721f);return getUser(_0x36721f,_0x4b6f92[_0xcfaf('0x3f')])[_0xcfaf('0x18')](function(_0x53d2ff){_0x3241a6=_0x53d2ff;logger[_0xcfaf('0x1e')]('The\x20User\x20ID\x20is:',_0x3241a6['id']);return getEndUser(_0x36721f,_0x40ead9[_0xcfaf('0x40')],_0x40ead9[_0xcfaf('0x41')]);})[_0xcfaf('0x18')](function(_0x22f8ca){_0x3c2566=_0x22f8ca;logger[_0xcfaf('0x1e')](_0xcfaf('0x42'),_0x3c2566['id']);return getTicket(_0x36721f,_0x3241a6,_0x3c2566,_0x21bf77,_0x40ead9);})[_0xcfaf('0x18')](function(_0x195961){if(_0x195961&&_0x195961['id']){logger[_0xcfaf('0x1e')](_0xcfaf('0x43'));logger[_0xcfaf('0x1e')](_0xcfaf('0x44'),_0x195961['id']);logger[_0xcfaf('0x1e')](_0xcfaf('0x45'),_0xcfaf('0x46'));emit(util[_0xcfaf('0xb')]('user:%s',_0x4b6f92['name']),_0xcfaf('0x47'),{'uri':util[_0xcfaf('0xb')](_0xcfaf('0x48'),_0x36721f[_0xcfaf('0x16')],_0x195961['id'])});}})[_0xcfaf('0x49')](function(_0x17a9eb){logger['error']('[QUEUE]',JSON[_0xcfaf('0x4a')](_0x17a9eb));});};exports[_0xcfaf('0x4b')]=function(_0x10c420,_0x1c4a43,_0x5d8b38,_0x3d0684,_0x39a249,_0x2fb807,_0x100c62){var _0x1d24d4,_0x410b1f;_0x2fb807['remoteUri']=intUtil[_0xcfaf('0x39')](_0x2fb807[_0xcfaf('0x16')]);_0x2fb807[_0xcfaf('0x38')]=intUtil[_0xcfaf('0x39')](_0x2fb807['serverUrl']);if(_0x100c62&&_0x100c62[_0xcfaf('0x4c')]&&_0x100c62['recordingFormat']!==_0xcfaf('0x4d')){logger['info'](_0xcfaf('0x4e'),_0xcfaf('0x4f'));_0x1c4a43[_0xcfaf('0x3b')]=util[_0xcfaf('0xb')](_0xcfaf('0x3c'),_0x2fb807[_0xcfaf('0x38')],_0x1c4a43[_0xcfaf('0x3d')],md5(_0x1c4a43[_0xcfaf('0x3d')]));}headers['Authorization']=getAuth(_0x2fb807);return getUser(_0x2fb807,_0x3d0684[_0xcfaf('0x3f')])['then'](function(_0x187a76){_0x1d24d4=_0x187a76;logger[_0xcfaf('0x1e')](_0xcfaf('0x50'),_0x1d24d4['id']);return getEndUser(_0x2fb807,_0x1c4a43[_0xcfaf('0x51')],_0x1c4a43[_0xcfaf('0x52')]);})[_0xcfaf('0x18')](function(_0x52c846){_0x410b1f=_0x52c846;logger[_0xcfaf('0x1e')](_0xcfaf('0x42'),_0x410b1f['id']);return getTicket(_0x2fb807,_0x1d24d4,_0x410b1f,_0x5d8b38,_0x1c4a43);})[_0xcfaf('0x18')](function(_0x42b602){if(_0x42b602&&_0x42b602['id']){logger['info'](_0xcfaf('0x43'));logger[_0xcfaf('0x1e')]('The\x20Ticket\x20ID\x20is:',_0x42b602['id']);logger[_0xcfaf('0x1e')](_0xcfaf('0x4e'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xcfaf('0x53'),_0x3d0684[_0xcfaf('0x11')]),_0xcfaf('0x47'),{'uri':util[_0xcfaf('0xb')](_0xcfaf('0x48'),_0x2fb807[_0xcfaf('0x16')],_0x42b602['id'])});}})[_0xcfaf('0x49')](function(_0x1ec6e5){logger['error']('[OUTBOUND]',JSON[_0xcfaf('0x4a')](_0x1ec6e5));});};exports['abandoned']=function(_0x31c1ec,_0x2f98e5,_0x53af5b,_0x7ed884,_0x147f90,_0x1cdc6c){var _0x757d8f,_0x1fcb49;_0x1cdc6c[_0xcfaf('0x16')]=intUtil['stripTrailingSlash'](_0x1cdc6c[_0xcfaf('0x16')]);_0x1cdc6c[_0xcfaf('0x38')]=intUtil['stripTrailingSlash'](_0x1cdc6c[_0xcfaf('0x38')]);if(_0x147f90&&_0x147f90['monitor_format']){logger['info'](_0xcfaf('0x54'),'Recording\x20is\x20enabled!');_0x2f98e5['recordingURL']=util[_0xcfaf('0xb')](_0xcfaf('0x3c'),_0x1cdc6c['serverUrl'],_0x2f98e5[_0xcfaf('0x3d')],md5(_0x2f98e5[_0xcfaf('0x3d')]));}else{_0x2f98e5['recordingURL']='';}headers[_0xcfaf('0x3e')]=getAuth(_0x1cdc6c);return getUser(_0x1cdc6c,'')[_0xcfaf('0x18')](function(_0x32333d){_0x757d8f=_0x32333d;logger[_0xcfaf('0x1e')](_0xcfaf('0x50'),_0x757d8f['id']);return getEndUser(_0x1cdc6c,_0x2f98e5[_0xcfaf('0x40')],_0x2f98e5[_0xcfaf('0x41')]);})[_0xcfaf('0x18')](function(_0x41d5dc){_0x1fcb49=_0x41d5dc;logger[_0xcfaf('0x1e')](_0xcfaf('0x42'),_0x1fcb49['id']);return getTicket(_0x1cdc6c,_0x757d8f,_0x1fcb49,_0x53af5b,_0x2f98e5);})[_0xcfaf('0x18')](function(_0x1ca87a){if(_0x1ca87a){logger[_0xcfaf('0x1e')](_0xcfaf('0x43'));logger[_0xcfaf('0x1e')](_0xcfaf('0x44'),_0x1ca87a['id']);}})[_0xcfaf('0x49')](function(_0x1a26a9){logger[_0xcfaf('0x55')](_0xcfaf('0x54'),JSON['stringify'](_0x1a26a9));});}; \ 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 dab9b01..2f620e8 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 _0xa428=['inspect','lodash','request-promise','md5','util','moment','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','localhost','socket.io-emitter','/api/selector/owners','headers','info','then','length','email','adminEmail','Admin\x20found:','catch','error','message','GET','users','agentEmail','userEmail','userId','Admin\x20selected','adminId','Requested\x20Resource\x20not\x20Found','toUpperCase','/api/contacts/filters','Getting\x20contacts\x20filter','filters','forEach','name','All\x20Contacts','Getting\x20contact\x20list','/api/contacts/view/','Searching\x20contact\x20with\x20phone','contactNumber','contacts','find','work_number','mobile_number','Contact\x20found:','Contact\x20created:','endUserId','POST','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','contact','Creating\x20new\x20task','getString','Subjects','Descriptions','Contact','add','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','destcalleridnum','abandoned','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s',']\x20Error\x20running\x20Freshsales\x20integration'];(function(_0x4bdde9,_0xe1687a){var _0x402387=function(_0x183360){while(--_0x183360){_0x4bdde9['push'](_0x4bdde9['shift']());}};_0x402387(++_0xe1687a);}(_0xa428,0x103));var _0x8a42=function(_0x228162,_0x1411b2){_0x228162=_0x228162-0x0;var _0x5b27af=_0xa428[_0x228162];return _0x5b27af;};'use strict';var _=require(_0x8a42('0x0'));var rp=require(_0x8a42('0x1'));var md5=require(_0x8a42('0x2'));var util=require(_0x8a42('0x3'));var moment=require(_0x8a42('0x4'));var Promise=require('bluebird');var Redis=require(_0x8a42('0x5'));var intUtil=require(_0x8a42('0x6'));var config=require(_0x8a42('0x7'));var logger=require(_0x8a42('0x8'))(_0x8a42('0x9'));config[_0x8a42('0xa')]=_['defaults'](config[_0x8a42('0xa')],{'host':_0x8a42('0xb'),'port':0x18eb});var io=require(_0x8a42('0xc'))(new Redis(config['redis']));function getAdminId(_0x254f09,_0x2318a5,_0x5a2539,_0x431e59){return new Promise(function(_0x29bc48,_0x35c6ed){var _0x39b306=![];var _0x3ef2cf={'method':'GET','uri':_0x431e59+_0x8a42('0xd'),'json':!![]};_0x3ef2cf[_0x8a42('0xe')]=_0x5a2539;logger[_0x8a42('0xf')]('Getting\x20admin\x20information');return rp(_0x3ef2cf)[_0x8a42('0x10')](function(_0x3264ad){if(_0x3264ad){var _0x20f3e8=_0x3264ad['users'];var _0xd16de9=null;for(_0xd16de9=0x0;_0xd16de9<_0x20f3e8[_0x8a42('0x11')];_0xd16de9++){if(_0x20f3e8[_0xd16de9][_0x8a42('0x12')]===_0x254f09[_0x8a42('0x13')]){_0x254f09['adminId']=_0x20f3e8[_0xd16de9]['id'];_0x39b306=!![];}}if(_0x39b306){logger[_0x8a42('0xf')](_0x8a42('0x14'),_0x254f09['adminId']);_0x29bc48(_0x254f09);}else{_0x35c6ed({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x35c6ed({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x8a42('0x15')](function(_0x2ee956){logger[_0x8a42('0x16')]('['+[_0x2318a5['toUpperCase']()]+']',_0x2ee956[_0x8a42('0x17')]);_0x35c6ed(_0x2ee956);});});}function getUser(_0x4273e1,_0x34efde,_0x368277){return function(_0x1e9329){return new Promise(function(_0x2f8143,_0x53f376){var _0x6824b3={'method':_0x8a42('0x18'),'uri':_0x368277+'/api/selector/owners','json':!![]};_0x6824b3[_0x8a42('0xe')]=_0x34efde;logger[_0x8a42('0xf')]('Getting\x20user\x20list');return rp(_0x6824b3)[_0x8a42('0x10')](function(_0x215834){if(_0x215834){var _0x3b8616=_0x215834[_0x8a42('0x19')];var _0x332ac5=![];var _0x1dceb9=null;if(_0x1e9329[_0x8a42('0x1a')]!==null){logger[_0x8a42('0xf')]('Getting\x20user\x20with\x20email',_0x1e9329[_0x8a42('0x1a')]);_0x1e9329[_0x8a42('0x1b')]=_0x1e9329[_0x8a42('0x1a')];for(_0x1dceb9=0x0;_0x1dceb9<_0x3b8616[_0x8a42('0x11')];_0x1dceb9++){if(_0x3b8616[_0x1dceb9][_0x8a42('0x12')]===_0x1e9329[_0x8a42('0x1a')]){_0x332ac5=!![];_0x1e9329[_0x8a42('0x1c')]=_0x3b8616[_0x1dceb9]['id'];logger[_0x8a42('0xf')]('User\x20found:',_0x1e9329[_0x8a42('0x1c')]);}}}if(!_0x332ac5){logger[_0x8a42('0xf')](_0x8a42('0x1d'));_0x1e9329[_0x8a42('0x1b')]=_0x1e9329[_0x8a42('0x13')];_0x1e9329[_0x8a42('0x1c')]=_0x1e9329[_0x8a42('0x1e')];_0x332ac5=!![];}if(_0x332ac5){_0x2f8143(_0x1e9329);}else{_0x53f376({'statusCode':0x194,'message':_0x8a42('0x1f')});}}else{_0x53f376({'statusCode':0x194,'message':_0x8a42('0x1f')});}})[_0x8a42('0x15')](function(_0x510601){logger[_0x8a42('0x16')]('['+[_0x4273e1[_0x8a42('0x20')]()]+']',_0x510601['message']);_0x53f376(_0x510601);});});};}function getEndUser(_0x2f5d4f,_0x50c669,_0x344c9b){return function(_0x4263c7){return new Promise(function(_0x36308e,_0x4f01c2){var _0x15bf14=0x0;var _0x38e1bd={'method':_0x8a42('0x18'),'uri':_0x344c9b+_0x8a42('0x21'),'json':!![]};_0x38e1bd[_0x8a42('0xe')]=_0x50c669;logger[_0x8a42('0xf')](_0x8a42('0x22'));return rp(_0x38e1bd)['then'](function(_0x4184fe){_0x4184fe[_0x8a42('0x23')][_0x8a42('0x24')](function(_0x9c767){if(_0x9c767[_0x8a42('0x25')]===_0x8a42('0x26')){_0x15bf14=_0x9c767['id'];}});})[_0x8a42('0x10')](function(){logger[_0x8a42('0xf')](_0x8a42('0x27'));var _0x3e1aa={'method':_0x8a42('0x18'),'uri':_0x344c9b+_0x8a42('0x28')+_0x15bf14,'json':!![]};_0x3e1aa[_0x8a42('0xe')]=_0x50c669;return rp(_0x3e1aa);})[_0x8a42('0x10')](function(_0x3ddf61){logger[_0x8a42('0xf')](_0x8a42('0x29'),_0x4263c7[_0x8a42('0x2a')]);if(_0x3ddf61[_0x8a42('0x2b')][_0x8a42('0x11')]>0x0){var _0x422f7b=_[_0x8a42('0x2c')](_0x3ddf61[_0x8a42('0x2b')],function(_0x509904){if(_0x509904[_0x8a42('0x2d')]===_0x4263c7[_0x8a42('0x2a')]||_0x509904[_0x8a42('0x2e')]===_0x4263c7[_0x8a42('0x2a')]){return _0x509904;}});if(_0x422f7b){_0x4263c7['endUserId']=_0x422f7b['id'];logger['info'](_0x8a42('0x2f'),_0x4263c7['endUserId']);_0x36308e(_0x4263c7);}else{return createEndUser(_0x4263c7,_0x2f5d4f,_0x50c669,_0x344c9b)[_0x8a42('0x10')](function(_0x4d6ebd){logger[_0x8a42('0xf')]('Contact\x20created:',_0x4263c7['endUserId']);_0x36308e(_0x4d6ebd);});}}else{return createEndUser(_0x4263c7,_0x2f5d4f,_0x50c669,_0x344c9b)['then'](function(_0x2cc581){logger[_0x8a42('0xf')](_0x8a42('0x30'),_0x4263c7[_0x8a42('0x31')]);_0x36308e(_0x2cc581);});}})[_0x8a42('0x15')](function(_0x58d24b){throw new Error(_0x58d24b[_0x8a42('0x17')]);});});};}function createEndUser(_0x284406,_0x223c3a,_0x1dc394,_0x3a27f0){return new Promise(function(_0x592962,_0x15d5e2){var _0x327fbc=moment();var _0x1e6482={'method':_0x8a42('0x32'),'uri':_0x3a27f0+_0x8a42('0x33'),'body':{'contact':{'last_name':_0x284406[_0x8a42('0x2a')],'work_number':_0x284406['contactNumber'],'mobile_number':_0x284406[_0x8a42('0x2a')],'owner_id':_0x284406[_0x8a42('0x1c')],'created_at':_0x327fbc[_0x8a42('0x34')](_0x8a42('0x35'))}},'json':!![]};_0x1e6482['headers']=_0x1dc394;logger['info']('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x1e6482)[_0x8a42('0x10')](function(_0x5be4ea){_0x284406['endUserId']=_0x5be4ea[_0x8a42('0x36')]['id'];_0x592962(_0x284406);})[_0x8a42('0x15')](function(_0x165350){logger[_0x8a42('0x16')]('['+[_0x223c3a[_0x8a42('0x20')]()]+']',_0x165350['message']);_0x15d5e2(_0x165350[_0x8a42('0x17')]);});});}function getTicket(_0x1684e5,_0x214144,_0x53d54b,_0x5d996c,_0x844c){return function(_0x22c3c3){logger[_0x8a42('0xf')](_0x8a42('0x37'));return new Promise(function(_0x40a542,_0x36c9cb){var _0x1efcdc=moment();var _0x244b50={'method':_0x8a42('0x32'),'uri':_0x53d54b+'/api/tasks','body':{'title':intUtil[_0x8a42('0x38')](_0x5d996c[_0x8a42('0x39')],_0x844c,'\x20'),'description':intUtil[_0x8a42('0x38')](_0x5d996c[_0x8a42('0x3a')],_0x844c,'\x0a'),'owner_id':_0x22c3c3[_0x8a42('0x1c')],'creater_id':_0x22c3c3[_0x8a42('0x1e')],'targetable_id':_0x22c3c3[_0x8a42('0x31')],'targetable_type':_0x8a42('0x3b'),'created_at':_0x1efcdc[_0x8a42('0x34')](_0x8a42('0x35')),'due_date':_0x1efcdc[_0x8a42('0x3c')](0x1e,'m')[_0x8a42('0x34')](_0x8a42('0x35'))},'json':!![]};_0x244b50['headers']=_0x214144;return rp(_0x244b50)[_0x8a42('0x10')](function(_0x2e4f69){_0x22c3c3[_0x8a42('0x3d')]=_0x2e4f69[_0x8a42('0x3e')]['id'];logger[_0x8a42('0xf')](_0x8a42('0x3f'),_0x22c3c3['ticketId']);_0x40a542(_0x22c3c3);})[_0x8a42('0x15')](function(_0x5c4cfe){logger[_0x8a42('0x16')]('['+[_0x1684e5[_0x8a42('0x20')]()]+']',_0x5c4cfe['message']);_0x36c9cb(_0x5c4cfe[_0x8a42('0x17')]);});});};}function emit(_0x18ee65,_0x486dae,_0x8113bd){var _0x20f249={'uri':_0x18ee65+_0x8a42('0x40')+_0x8113bd};io['to'](util[_0x8a42('0x34')](_0x8a42('0x41'),_0x486dae))[_0x8a42('0x42')](_0x8a42('0x43'),_0x20f249);}exports['cs']=function(_0x1bacce,_0x1f6dcd,_0x2c17d0,_0x31ede1,_0x54ec4b,_0x3039e3,_0x20f64c,_0x4af2ce){var _0x5c0678={};var _0x5d64a0={'Authorization':'Token\x20token='+_0x3039e3[_0x8a42('0x44')]};_0x3039e3[_0x8a42('0x45')]=intUtil[_0x8a42('0x46')](_0x3039e3[_0x8a42('0x45')]);_0x3039e3[_0x8a42('0x47')]=intUtil[_0x8a42('0x46')](_0x3039e3[_0x8a42('0x47')]);var _0x19f311=_0x3039e3[_0x8a42('0x45')];_0x5c0678[_0x8a42('0x13')]=_0x3039e3[_0x8a42('0x48')];_0x5c0678[_0x8a42('0x2a')]=_0x4af2ce[_0x8a42('0x49')]()==='outbound'?_0x1f6dcd[_0x8a42('0x4a')]:_0x1f6dcd['calleridnum'];_0x5c0678['callDirection']=_0x4af2ce==='queue'||_0x4af2ce===_0x8a42('0x4b')?'queue':'outbound';if(_0x31ede1){_0x5c0678[_0x8a42('0x1a')]=_0x31ede1[_0x8a42('0x12')];}var _0x2decba=util[_0x8a42('0x34')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3039e3[_0x8a42('0x47')],_0x1f6dcd[_0x8a42('0x4c')],md5(_0x1f6dcd['uniqueid']));if(_0x54ec4b&&_0x54ec4b[_0x8a42('0x4d')]){logger[_0x8a42('0xf')]('[QUEUE]',_0x8a42('0x4e'));_0x1f6dcd[_0x8a42('0x4f')]=_0x2decba;}else if(_0x20f64c&&_0x20f64c[_0x8a42('0x50')]&&_0x20f64c[_0x8a42('0x50')]!==_0x8a42('0x51')){logger[_0x8a42('0xf')](_0x8a42('0x52'),_0x8a42('0x4e'));_0x1f6dcd[_0x8a42('0x4f')]=_0x2decba;}else{_0x1f6dcd[_0x8a42('0x4f')]='';}return getAdminId(_0x5c0678,_0x4af2ce,_0x5d64a0,_0x19f311)['then'](getUser(_0x4af2ce,_0x5d64a0,_0x19f311))[_0x8a42('0x10')](getEndUser(_0x4af2ce,_0x5d64a0,_0x19f311))['then'](getTicket(_0x4af2ce,_0x5d64a0,_0x19f311,_0x2c17d0,_0x1f6dcd))[_0x8a42('0x10')](function(_0x133aae){logger[_0x8a42('0xf')](util[_0x8a42('0x34')](_0x8a42('0x53'),_0x133aae['ticketId']));if(_0x4af2ce!=='abandoned'){logger[_0x8a42('0xf')]('['+[_0x4af2ce[_0x8a42('0x20')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x19f311,_0x31ede1[_0x8a42('0x25')],_0x133aae[_0x8a42('0x31')]);}})['catch'](function(_0x41f27e){logger['error']('['+[_0x4af2ce[_0x8a42('0x20')]()]+_0x8a42('0x54'),util[_0x8a42('0x55')](_0x41f27e,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xc2e0=['add','ticketId','task','Task\x20created:','/contacts/','emit','trigger:browser:url','Token\x20token=','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','none','[OUTBOUND]','recordingURL','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','moment','bluebird','ioredis','./util','../../../../config/logger','freshsales','redis','defaults','localhost','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','catch','error','message','agentEmail','Getting\x20user\x20with\x20email','userEmail','email','userId','User\x20found:','Admin\x20selected','toUpperCase','/api/contacts/filters','filters','name','All\x20Contacts','/api/contacts/view/','contactNumber','contacts','length','find','work_number','mobile_number','endUserId','Contact\x20found:','Contact\x20created:','POST','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','Contact'];(function(_0x2d3ab3,_0x47d90b){var _0x321f9e=function(_0x50a53d){while(--_0x50a53d){_0x2d3ab3['push'](_0x2d3ab3['shift']());}};_0x321f9e(++_0x47d90b);}(_0xc2e0,0x77));var _0x0c2e=function(_0x195601,_0xdae54f){_0x195601=_0x195601-0x0;var _0x5263d6=_0xc2e0[_0x195601];return _0x5263d6;};'use strict';var _=require(_0x0c2e('0x0'));var rp=require(_0x0c2e('0x1'));var md5=require(_0x0c2e('0x2'));var util=require(_0x0c2e('0x3'));var moment=require(_0x0c2e('0x4'));var Promise=require(_0x0c2e('0x5'));var Redis=require(_0x0c2e('0x6'));var intUtil=require(_0x0c2e('0x7'));var config=require('../../../../config/environment');var logger=require(_0x0c2e('0x8'))(_0x0c2e('0x9'));config[_0x0c2e('0xa')]=_[_0x0c2e('0xb')](config[_0x0c2e('0xa')],{'host':_0x0c2e('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0c2e('0xa')]));function getAdminId(_0x348bde,_0x476b33,_0x419916,_0x41310b){return new Promise(function(_0x5f2d84,_0x4b844b){var _0x200f70=![];var _0x4b0f7c={'method':_0x0c2e('0xd'),'uri':_0x41310b+_0x0c2e('0xe'),'json':!![]};_0x4b0f7c[_0x0c2e('0xf')]=_0x419916;logger[_0x0c2e('0x10')](_0x0c2e('0x11'));return rp(_0x4b0f7c)[_0x0c2e('0x12')](function(_0x4b3adf){if(_0x4b3adf){var _0x3869dc=_0x4b3adf[_0x0c2e('0x13')];var _0x591109=null;for(_0x591109=0x0;_0x591109<_0x3869dc['length'];_0x591109++){if(_0x3869dc[_0x591109]['email']===_0x348bde[_0x0c2e('0x14')]){_0x348bde[_0x0c2e('0x15')]=_0x3869dc[_0x591109]['id'];_0x200f70=!![];}}if(_0x200f70){logger[_0x0c2e('0x10')]('Admin\x20found:',_0x348bde[_0x0c2e('0x15')]);_0x5f2d84(_0x348bde);}else{_0x4b844b({'statusCode':0x194,'message':_0x0c2e('0x16')});}}else{_0x4b844b({'statusCode':0x194,'message':_0x0c2e('0x16')});}})[_0x0c2e('0x17')](function(_0x4a2a09){logger[_0x0c2e('0x18')]('['+[_0x476b33['toUpperCase']()]+']',_0x4a2a09[_0x0c2e('0x19')]);_0x4b844b(_0x4a2a09);});});}function getUser(_0x428318,_0x2ae3b6,_0x106d0d){return function(_0x43adc0){return new Promise(function(_0x2df8ab,_0x49f414){var _0x72504f={'method':_0x0c2e('0xd'),'uri':_0x106d0d+_0x0c2e('0xe'),'json':!![]};_0x72504f[_0x0c2e('0xf')]=_0x2ae3b6;logger['info']('Getting\x20user\x20list');return rp(_0x72504f)['then'](function(_0x33c50f){if(_0x33c50f){var _0x3bd4a8=_0x33c50f['users'];var _0x4c4763=![];var _0x14ed77=null;if(_0x43adc0[_0x0c2e('0x1a')]!==null){logger[_0x0c2e('0x10')](_0x0c2e('0x1b'),_0x43adc0[_0x0c2e('0x1a')]);_0x43adc0[_0x0c2e('0x1c')]=_0x43adc0[_0x0c2e('0x1a')];for(_0x14ed77=0x0;_0x14ed77<_0x3bd4a8['length'];_0x14ed77++){if(_0x3bd4a8[_0x14ed77][_0x0c2e('0x1d')]===_0x43adc0[_0x0c2e('0x1a')]){_0x4c4763=!![];_0x43adc0[_0x0c2e('0x1e')]=_0x3bd4a8[_0x14ed77]['id'];logger[_0x0c2e('0x10')](_0x0c2e('0x1f'),_0x43adc0[_0x0c2e('0x1e')]);}}}if(!_0x4c4763){logger[_0x0c2e('0x10')](_0x0c2e('0x20'));_0x43adc0[_0x0c2e('0x1c')]=_0x43adc0['adminEmail'];_0x43adc0[_0x0c2e('0x1e')]=_0x43adc0[_0x0c2e('0x15')];_0x4c4763=!![];}if(_0x4c4763){_0x2df8ab(_0x43adc0);}else{_0x49f414({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x49f414({'statusCode':0x194,'message':_0x0c2e('0x16')});}})[_0x0c2e('0x17')](function(_0x47aa53){logger[_0x0c2e('0x18')]('['+[_0x428318[_0x0c2e('0x21')]()]+']',_0x47aa53[_0x0c2e('0x19')]);_0x49f414(_0x47aa53);});});};}function getEndUser(_0x17765b,_0xa9853f,_0x1df2da){return function(_0x1e152a){return new Promise(function(_0x1d39ca,_0xd9fa6c){var _0x1684e3=0x0;var _0x4d0a6a={'method':_0x0c2e('0xd'),'uri':_0x1df2da+_0x0c2e('0x22'),'json':!![]};_0x4d0a6a[_0x0c2e('0xf')]=_0xa9853f;logger[_0x0c2e('0x10')]('Getting\x20contacts\x20filter');return rp(_0x4d0a6a)[_0x0c2e('0x12')](function(_0x13cd87){_0x13cd87[_0x0c2e('0x23')]['forEach'](function(_0x4800b1){if(_0x4800b1[_0x0c2e('0x24')]===_0x0c2e('0x25')){_0x1684e3=_0x4800b1['id'];}});})[_0x0c2e('0x12')](function(){logger[_0x0c2e('0x10')]('Getting\x20contact\x20list');var _0x18c69c={'method':_0x0c2e('0xd'),'uri':_0x1df2da+_0x0c2e('0x26')+_0x1684e3,'json':!![]};_0x18c69c[_0x0c2e('0xf')]=_0xa9853f;return rp(_0x18c69c);})[_0x0c2e('0x12')](function(_0x33f1ee){logger['info']('Searching\x20contact\x20with\x20phone',_0x1e152a[_0x0c2e('0x27')]);if(_0x33f1ee[_0x0c2e('0x28')][_0x0c2e('0x29')]>0x0){var _0xcf2258=_[_0x0c2e('0x2a')](_0x33f1ee['contacts'],function(_0x1253cf){if(_0x1253cf[_0x0c2e('0x2b')]===_0x1e152a[_0x0c2e('0x27')]||_0x1253cf[_0x0c2e('0x2c')]===_0x1e152a['contactNumber']){return _0x1253cf;}});if(_0xcf2258){_0x1e152a[_0x0c2e('0x2d')]=_0xcf2258['id'];logger['info'](_0x0c2e('0x2e'),_0x1e152a[_0x0c2e('0x2d')]);_0x1d39ca(_0x1e152a);}else{return createEndUser(_0x1e152a,_0x17765b,_0xa9853f,_0x1df2da)[_0x0c2e('0x12')](function(_0x33ca84){logger[_0x0c2e('0x10')](_0x0c2e('0x2f'),_0x1e152a[_0x0c2e('0x2d')]);_0x1d39ca(_0x33ca84);});}}else{return createEndUser(_0x1e152a,_0x17765b,_0xa9853f,_0x1df2da)[_0x0c2e('0x12')](function(_0x5e9af8){logger[_0x0c2e('0x10')]('Contact\x20created:',_0x1e152a[_0x0c2e('0x2d')]);_0x1d39ca(_0x5e9af8);});}})[_0x0c2e('0x17')](function(_0xaae925){throw new Error(_0xaae925[_0x0c2e('0x19')]);});});};}function createEndUser(_0x28eee7,_0x3a180f,_0x42d074,_0x8b4b36){return new Promise(function(_0x258cb4,_0x5f09d1){var _0x260b79=moment();var _0x9afacd={'method':_0x0c2e('0x30'),'uri':_0x8b4b36+_0x0c2e('0x31'),'body':{'contact':{'last_name':_0x28eee7['contactNumber'],'work_number':_0x28eee7[_0x0c2e('0x27')],'mobile_number':_0x28eee7[_0x0c2e('0x27')],'owner_id':_0x28eee7[_0x0c2e('0x1e')],'created_at':_0x260b79[_0x0c2e('0x32')](_0x0c2e('0x33'))}},'json':!![]};_0x9afacd[_0x0c2e('0xf')]=_0x42d074;logger['info'](_0x0c2e('0x34'));return rp(_0x9afacd)['then'](function(_0x3d2264){_0x28eee7['endUserId']=_0x3d2264['contact']['id'];_0x258cb4(_0x28eee7);})[_0x0c2e('0x17')](function(_0x2f8789){logger[_0x0c2e('0x18')]('['+[_0x3a180f[_0x0c2e('0x21')]()]+']',_0x2f8789['message']);_0x5f09d1(_0x2f8789[_0x0c2e('0x19')]);});});}function getTicket(_0x2cf80c,_0x29bc7b,_0x14cc31,_0x1765b4,_0x68f67){return function(_0x315def){logger[_0x0c2e('0x10')](_0x0c2e('0x35'));return new Promise(function(_0x44704e,_0x4fb074){var _0x2998b3=moment();var _0x339b67={'method':_0x0c2e('0x30'),'uri':_0x14cc31+_0x0c2e('0x36'),'body':{'title':intUtil[_0x0c2e('0x37')](_0x1765b4[_0x0c2e('0x38')],_0x68f67,'\x20'),'description':intUtil['getString'](_0x1765b4[_0x0c2e('0x39')],_0x68f67,'\x0a'),'owner_id':_0x315def[_0x0c2e('0x1e')],'creater_id':_0x315def[_0x0c2e('0x15')],'targetable_id':_0x315def['endUserId'],'targetable_type':_0x0c2e('0x3a'),'created_at':_0x2998b3['format'](_0x0c2e('0x33')),'due_date':_0x2998b3[_0x0c2e('0x3b')](0x1e,'m')[_0x0c2e('0x32')](_0x0c2e('0x33'))},'json':!![]};_0x339b67[_0x0c2e('0xf')]=_0x29bc7b;return rp(_0x339b67)[_0x0c2e('0x12')](function(_0x239f52){_0x315def[_0x0c2e('0x3c')]=_0x239f52[_0x0c2e('0x3d')]['id'];logger[_0x0c2e('0x10')](_0x0c2e('0x3e'),_0x315def[_0x0c2e('0x3c')]);_0x44704e(_0x315def);})[_0x0c2e('0x17')](function(_0x223c70){logger['error']('['+[_0x2cf80c[_0x0c2e('0x21')]()]+']',_0x223c70['message']);_0x4fb074(_0x223c70[_0x0c2e('0x19')]);});});};}function emit(_0x397319,_0x281d3c,_0x34ce31){var _0x2c4c65={'uri':_0x397319+_0x0c2e('0x3f')+_0x34ce31};io['to'](util[_0x0c2e('0x32')]('user:%s',_0x281d3c))[_0x0c2e('0x40')](_0x0c2e('0x41'),_0x2c4c65);}exports['cs']=function(_0x143171,_0x2afb66,_0x2b6ba9,_0x55e548,_0x5d70b1,_0x8201d1,_0x5162e3,_0x4db0a2){var _0x5901d7={};var _0x4daf1c={'Authorization':_0x0c2e('0x42')+_0x8201d1['apiKey']};_0x8201d1[_0x0c2e('0x43')]=intUtil[_0x0c2e('0x44')](_0x8201d1[_0x0c2e('0x43')]);_0x8201d1[_0x0c2e('0x45')]=intUtil['stripTrailingSlash'](_0x8201d1['serverUrl']);var _0x228598=_0x8201d1['remoteUri'];_0x5901d7[_0x0c2e('0x14')]=_0x8201d1[_0x0c2e('0x46')];_0x5901d7[_0x0c2e('0x27')]=_0x4db0a2[_0x0c2e('0x47')]()===_0x0c2e('0x48')?_0x2afb66[_0x0c2e('0x49')]:_0x2afb66[_0x0c2e('0x4a')];_0x5901d7[_0x0c2e('0x4b')]=_0x4db0a2===_0x0c2e('0x4c')||_0x4db0a2===_0x0c2e('0x4d')?'queue':'outbound';if(_0x55e548){_0x5901d7[_0x0c2e('0x1a')]=_0x55e548[_0x0c2e('0x1d')];}var _0x139335=util[_0x0c2e('0x32')](_0x0c2e('0x4e'),_0x8201d1[_0x0c2e('0x45')],_0x2afb66['uniqueid'],md5(_0x2afb66[_0x0c2e('0x4f')]));if(_0x5d70b1&&_0x5d70b1[_0x0c2e('0x50')]){logger[_0x0c2e('0x10')](_0x0c2e('0x51'),_0x0c2e('0x52'));_0x2afb66['recordingURL']=_0x139335;}else if(_0x5162e3&&_0x5162e3['recordingFormat']&&_0x5162e3['recordingFormat']!==_0x0c2e('0x53')){logger[_0x0c2e('0x10')](_0x0c2e('0x54'),'Recording\x20is\x20enabled!');_0x2afb66['recordingURL']=_0x139335;}else{_0x2afb66[_0x0c2e('0x55')]='';}return getAdminId(_0x5901d7,_0x4db0a2,_0x4daf1c,_0x228598)[_0x0c2e('0x12')](getUser(_0x4db0a2,_0x4daf1c,_0x228598))[_0x0c2e('0x12')](getEndUser(_0x4db0a2,_0x4daf1c,_0x228598))[_0x0c2e('0x12')](getTicket(_0x4db0a2,_0x4daf1c,_0x228598,_0x2b6ba9,_0x2afb66))[_0x0c2e('0x12')](function(_0x2c68f3){logger['info'](util[_0x0c2e('0x32')]('The\x20ticket\x20ID\x20is:\x20%s',_0x2c68f3[_0x0c2e('0x3c')]));if(_0x4db0a2!==_0x0c2e('0x4d')){logger['info']('['+[_0x4db0a2[_0x0c2e('0x21')]()]+']',_0x0c2e('0x56'));emit(_0x228598,_0x55e548[_0x0c2e('0x24')],_0x2c68f3[_0x0c2e('0x2d')]);}})[_0x0c2e('0x17')](function(_0x3dda2b){logger['error']('['+[_0x4db0a2['toUpperCase']()]+_0x0c2e('0x57'),util[_0x0c2e('0x58')](_0x3dda2b,{'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 b22c9bb..626ec5a 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 _0xa9e0=['./vtiger','./servicenow','./dynamics365','./freshsales','salesforce','sugarcrm','freshdesk','vtiger','servicenow','exec','toLowerCase','data1','data2','find','Configurations','data3','queue','routeId','log','abandoned','zendesk','zoho','desk','freshsales','dynamics365','unknown\x20integration','../../../../config/logger','error','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','format','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./freshdesk','./desk'];(function(_0x338676,_0x5d4a54){var _0xed98a=function(_0x11d24b){while(--_0x11d24b){_0x338676['push'](_0x338676['shift']());}};_0xed98a(++_0x5d4a54);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var zendesk=require(_0x0a9e('0x2'));var salesforce=require('./salesforce');var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x0a9e('0x3'));var zoho=require('./zoho');var desk=require(_0x0a9e('0x4'));var vtiger=require(_0x0a9e('0x5'));var servicenow=require(_0x0a9e('0x6'));var dynamics365=require(_0x0a9e('0x7'));var freshsales=require(_0x0a9e('0x8'));var integrations=['zendesk',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'zoho','desk',_0x0a9e('0xc'),'dynamics365','freshsales',_0x0a9e('0xd')];exports[_0x0a9e('0xe')]=function(_0x307b3e,_0x3ab53f,_0xfeb75b,_0xbd1168,_0x4a4c56,_0x50dfb2){if(_0xfeb75b){if(_['includes'](integrations,_0x307b3e['data1'][_0x0a9e('0xf')]())){try{var _0x36471c=null;var _0xd5b662='';var _0x26d672=_0xfeb75b[_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')]()];if(_0x26d672){var _0x5db4b0=_0x26d672[_0x307b3e[_0x0a9e('0x11')]];if(_0x5db4b0){var _0x239b12=_[_0x0a9e('0x12')](_0x5db4b0[_0x0a9e('0x13')],{'id':parseInt(_0x307b3e[_0x0a9e('0x14')],0xa)});if(_0x239b12){if(_0xbd1168){if(_0x4a4c56&&_0x3ab53f[_0x0a9e('0x15')]){_0xd5b662='queue';}else if(_0x3ab53f[_0x0a9e('0x16')]){_0xd5b662='outbound';}else{console[_0x0a9e('0x17')]('EVENT\x20UNKNOWN',_0x3ab53f);}}else{_0xd5b662=_0x0a9e('0x18');}switch(_0x307b3e[_0x0a9e('0x10')]['toLowerCase']()){case _0x0a9e('0x19'):zendesk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case'salesforce':salesforce[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xa'):sugarcrm[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xb'):freshdesk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1a'):zoho[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1b'):desk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xc'):vtiger[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1c'):freshsales['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);case _0x0a9e('0xd'):servicenow['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);break;case _0x0a9e('0x1d'):dynamics365['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);break;default:console[_0x0a9e('0x17')](_0x0a9e('0x1e'));}}else{_0x36471c=require(_0x0a9e('0x1f'))(_0x307b3e[_0x0a9e('0x10')]['toLowerCase']());_0x36471c[_0x0a9e('0x20')](_0x0a9e('0x21'),util['format'](_0x0a9e('0x22'),_0x307b3e['data1']['toLowerCase'](),_0x307b3e[_0x0a9e('0x14')]));}}else{_0x36471c=require(_0x0a9e('0x1f'))(_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')]());_0x36471c['error'](_0x0a9e('0x21'),util[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')](),_0x307b3e[_0x0a9e('0x11')]));}}else{}}catch(_0x16b1ca){console['error'](_0x16b1ca);}}}}; \ No newline at end of file +var _0xa9e0=['./vtiger','./servicenow','./dynamics365','./freshsales','salesforce','sugarcrm','freshdesk','vtiger','servicenow','exec','toLowerCase','data1','data2','find','Configurations','data3','queue','routeId','log','abandoned','zendesk','zoho','desk','freshsales','dynamics365','unknown\x20integration','../../../../config/logger','error','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','format','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./freshdesk','./desk'];(function(_0x2b5606,_0x3a845f){var _0x403f26=function(_0x14611e){while(--_0x14611e){_0x2b5606['push'](_0x2b5606['shift']());}};_0x403f26(++_0x3a845f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var zendesk=require(_0x0a9e('0x2'));var salesforce=require('./salesforce');var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x0a9e('0x3'));var zoho=require('./zoho');var desk=require(_0x0a9e('0x4'));var vtiger=require(_0x0a9e('0x5'));var servicenow=require(_0x0a9e('0x6'));var dynamics365=require(_0x0a9e('0x7'));var freshsales=require(_0x0a9e('0x8'));var integrations=['zendesk',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'zoho','desk',_0x0a9e('0xc'),'dynamics365','freshsales',_0x0a9e('0xd')];exports[_0x0a9e('0xe')]=function(_0x307b3e,_0x3ab53f,_0xfeb75b,_0xbd1168,_0x4a4c56,_0x50dfb2){if(_0xfeb75b){if(_['includes'](integrations,_0x307b3e['data1'][_0x0a9e('0xf')]())){try{var _0x36471c=null;var _0xd5b662='';var _0x26d672=_0xfeb75b[_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')]()];if(_0x26d672){var _0x5db4b0=_0x26d672[_0x307b3e[_0x0a9e('0x11')]];if(_0x5db4b0){var _0x239b12=_[_0x0a9e('0x12')](_0x5db4b0[_0x0a9e('0x13')],{'id':parseInt(_0x307b3e[_0x0a9e('0x14')],0xa)});if(_0x239b12){if(_0xbd1168){if(_0x4a4c56&&_0x3ab53f[_0x0a9e('0x15')]){_0xd5b662='queue';}else if(_0x3ab53f[_0x0a9e('0x16')]){_0xd5b662='outbound';}else{console[_0x0a9e('0x17')]('EVENT\x20UNKNOWN',_0x3ab53f);}}else{_0xd5b662=_0x0a9e('0x18');}switch(_0x307b3e[_0x0a9e('0x10')]['toLowerCase']()){case _0x0a9e('0x19'):zendesk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case'salesforce':salesforce[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xa'):sugarcrm[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xb'):freshdesk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1a'):zoho[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1b'):desk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xc'):vtiger[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1c'):freshsales['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);case _0x0a9e('0xd'):servicenow['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);break;case _0x0a9e('0x1d'):dynamics365['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);break;default:console[_0x0a9e('0x17')](_0x0a9e('0x1e'));}}else{_0x36471c=require(_0x0a9e('0x1f'))(_0x307b3e[_0x0a9e('0x10')]['toLowerCase']());_0x36471c[_0x0a9e('0x20')](_0x0a9e('0x21'),util['format'](_0x0a9e('0x22'),_0x307b3e['data1']['toLowerCase'](),_0x307b3e[_0x0a9e('0x14')]));}}else{_0x36471c=require(_0x0a9e('0x1f'))(_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')]());_0x36471c['error'](_0x0a9e('0x21'),util[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')](),_0x307b3e[_0x0a9e('0x11')]));}}else{}}catch(_0x16b1ca){console['error'](_0x16b1ca);}}}}; \ 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 05d3735..af901cc 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 _0x10eb=['WhoId','Case','assign','Subjects','ContactId','sobject','create','isNil','User','find','then','info','resolve','identity','user_id','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','display_name','Task','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','Contact','execute','length','Lead','contact','lead','Name','Enduser\x20with\x20phone\x20%s\x20found.','','format','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','No\x20Company','upperFirst','forEach','string','idField','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase','password','concat','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','user:%s','trigger:browser:url','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','[QUEUE]','stringify','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','outbound','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','catch','abandoned','[ABANDONED]\x20Ticket\x20%s\x20created.','[ABANDONED]\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','ioredis','./util','../../../../config/logger','salesforce','defaults','redis','localhost','socket.io-emitter','emit','ticketType','getString','Descriptions'];(function(_0x29379a,_0x16b64f){var _0x125b52=function(_0xea6150){while(--_0xea6150){_0x29379a['push'](_0x29379a['shift']());}};_0x125b52(++_0x16b64f);}(_0x10eb,0x1a1));var _0xb10e=function(_0x31e0a3,_0x2546c4){_0x31e0a3=_0x31e0a3-0x0;var _0x364a3c=_0x10eb[_0x31e0a3];return _0x364a3c;};'use strict';var _=require(_0xb10e('0x0'));var rp=require(_0xb10e('0x1'));var moment=require(_0xb10e('0x2'));var BPromise=require('bluebird');var md5=require('md5');var jsforce=require('jsforce');var util=require('util');var Redis=require(_0xb10e('0x3'));var intUtil=require(_0xb10e('0x4'));var config=require('../../../../config/environment');var logger=require(_0xb10e('0x5'))(_0xb10e('0x6'));config['redis']=_[_0xb10e('0x7')](config[_0xb10e('0x8')],{'host':_0xb10e('0x9'),'port':0x18eb});var io=require(_0xb10e('0xa'))(new Redis(config[_0xb10e('0x8')]));function emit(_0x1bfb04,_0x105d24,_0x403723){io['to'](_0x1bfb04)[_0xb10e('0xb')](_0x105d24,_0x403723);}function getTicket(_0x37c337,_0x4f63b0,_0x7653ac,_0x31cc09,_0x343e87,_0x37243e,_0x33e1ac,_0x3f289c){var _0x3a24f8={};if(_0x31cc09[_0xb10e('0xc')]==='Task'){_0x3a24f8=Object['assign']({},{'OwnerId':_0x4f63b0['id'],'ActivityDate':moment['utc'](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0xb10e('0xd')](_0x31cc09['Subjects'],_0x343e87,'\x20'),'Description':intUtil[_0xb10e('0xd')](_0x31cc09[_0xb10e('0xe')],_0x343e87,'\x0a')},getCustomFields(_0x37243e,_0x343e87));if(_0x7653ac){_0x3a24f8[_0xb10e('0xf')]=_0x7653ac['id'];}}else if(_0x31cc09[_0xb10e('0xc')]===_0xb10e('0x10')){_0x3a24f8=Object[_0xb10e('0x11')]({},{'OwnerId':_0x4f63b0['id'],'Subject':intUtil[_0xb10e('0xd')](_0x31cc09[_0xb10e('0x12')],_0x343e87,'\x20'),'Description':intUtil['getString'](_0x31cc09[_0xb10e('0xe')],_0x343e87,'\x0a')},getCustomFields(_0x37243e,_0x343e87));if(_0x7653ac){_0x3a24f8[_0xb10e('0x13')]=_0x7653ac['id'];}}return _0x33e1ac[_0xb10e('0x14')](_0x31cc09[_0xb10e('0xc')])[_0xb10e('0x15')](_0x3a24f8);}function getUser(_0x1adb2b,_0x5a617b,_0x488c0d){if(!_[_0xb10e('0x16')](_0x5a617b)&&intUtil['validateEmail'](_0x5a617b)){var _0x3b77be={'Email':_0x5a617b};var _0x6bf918={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x488c0d[_0xb10e('0x14')](_0xb10e('0x17'))[_0xb10e('0x18')](_0x3b77be,_0x6bf918)['execute']()[_0xb10e('0x19')](function(_0x12fa28){if(_0x12fa28['length']){var _0x53bec8=_[_0xb10e('0x18')](_0x12fa28,function(_0x136a4e){return _0x136a4e['Email']===_0x5a617b;});if(_0x53bec8){logger[_0xb10e('0x1a')]('Agent\x20%s\x20found.',_0x5a617b);return BPromise[_0xb10e('0x1b')]({'id':_0x53bec8['Id'],'name':_0x53bec8['Name']});}}else{logger[_0xb10e('0x1a')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x5a617b);return _0x488c0d[_0xb10e('0x1c')]()[_0xb10e('0x19')](function(_0x175ae7){return BPromise[_0xb10e('0x1b')]({'id':_0x175ae7[_0xb10e('0x1d')],'name':_0x175ae7['display_name']});});}});}else{logger[_0xb10e('0x1a')](_0xb10e('0x1e'),_0x5a617b);return _0x488c0d[_0xb10e('0x1c')]()[_0xb10e('0x19')](function(_0x4a28ff){return BPromise[_0xb10e('0x1b')]({'id':_0x4a28ff['user_id'],'name':_0x4a28ff[_0xb10e('0x1f')]});});}}function getEndUser(_0x190bd3,_0x3fa040,_0x217c04,_0x463eed,_0x1ecef6){var _0x1f99ed={'Phone':_0x463eed};var _0x5254f0={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xb10e('0x1b')]()[_0xb10e('0x19')](function(){if(_0x3fa040[_0xb10e('0xc')]===_0xb10e('0x20')){logger[_0xb10e('0x1a')](_0xb10e('0x21'),_0x463eed,_0x3fa040[_0xb10e('0x22')]);switch(_0x3fa040[_0xb10e('0x22')]){case _0xb10e('0x23'):return _0x1ecef6[_0xb10e('0x14')](_0xb10e('0x24'))[_0xb10e('0x18')](_0x1f99ed,_0x5254f0)[_0xb10e('0x25')]()[_0xb10e('0x19')](function(_0xe0005b){if(_0xe0005b&&_0xe0005b[_0xb10e('0x26')]){return _0xe0005b;}else{return _0x1ecef6[_0xb10e('0x14')](_0xb10e('0x27'))[_0xb10e('0x18')](_0x1f99ed,_0x5254f0);}});case _0xb10e('0x28'):return _0x1ecef6[_0xb10e('0x14')](_0xb10e('0x24'))[_0xb10e('0x18')](_0x1f99ed,_0x5254f0)['execute']();case _0xb10e('0x29'):return _0x1ecef6[_0xb10e('0x14')](_0xb10e('0x27'))['find'](_0x1f99ed,_0x5254f0);default:return null;}}else if(_0x3fa040[_0xb10e('0xc')]==='Case'){logger[_0xb10e('0x1a')](_0xb10e('0x21'),_0x463eed,_0xb10e('0x28'));return _0x1ecef6[_0xb10e('0x14')]('Contact')[_0xb10e('0x18')](_0x1f99ed,_0x5254f0)[_0xb10e('0x25')]();}})[_0xb10e('0x19')](function(_0x333da2){if(_0x333da2&&_0x333da2[_0xb10e('0x26')]){var _0x5f0ef5=_[_0xb10e('0x18')](_0x333da2,function(_0x446d50){return _0x446d50['Phone']===_0x463eed;});if(_0x5f0ef5){return BPromise[_0xb10e('0x1b')]({'id':_0x5f0ef5['Id'],'name':_0x5f0ef5[_0xb10e('0x2a')],'phone':_0x5f0ef5['Phone']});}}})['then'](function(_0x55724e){if(_0x55724e){logger[_0xb10e('0x1a')](_0xb10e('0x2b'),_0x463eed);return BPromise[_0xb10e('0x1b')](_0x55724e);}else{logger[_0xb10e('0x1a')]('Enduser\x20with\x20phone\x20%s\x20not\x20found.',_0x463eed);var _0x4a22c1={'LastName':_0x217c04!==_0xb10e('0x2c')?_0x217c04:util[_0xb10e('0x2d')]('Caller\x20-\x20%s',_0x463eed),'Phone':_0x463eed};if(_0x3fa040[_0xb10e('0x2e')]){if(_0x3fa040[_0xb10e('0x2e')]===_0xb10e('0x28')){logger[_0xb10e('0x1a')](_0xb10e('0x2f'),_0x463eed,_0x3fa040[_0xb10e('0x2e')]);}else if(_0x3fa040[_0xb10e('0x2e')]===_0xb10e('0x29')&&_0x3fa040[_0xb10e('0xc')]===_0xb10e('0x20')){logger[_0xb10e('0x1a')](_0xb10e('0x2f'),_0x463eed,_0x3fa040[_0xb10e('0x2e')]);_0x4a22c1[_0xb10e('0x30')]=_0xb10e('0x31');}else{return null;}}return _0x1ecef6['sobject'](_[_0xb10e('0x32')](_0x3fa040[_0xb10e('0x2e')]))[_0xb10e('0x15')](_0x4a22c1);}});}function getCustomFields(_0x1fa61c,_0x21b071){var _0x5243f3={};if(_0x1fa61c[_0xb10e('0x26')]>0x0){_[_0xb10e('0x33')](_0x1fa61c,function(_0x53a672){if(_0x53a672['type']===_0xb10e('0x34')&&_0x53a672[_0xb10e('0x35')]){_0x5243f3[_0x53a672[_0xb10e('0x35')]]=_0x53a672['content'][_0xb10e('0x36')]();}else if(_0x53a672[_0xb10e('0x37')]===_0xb10e('0x38')&&_0x53a672[_0xb10e('0x39')]&&_0x53a672[_0xb10e('0x35')]){_0x21b071[_0x53a672[_0xb10e('0x39')]]&&(_0x5243f3[_0x53a672[_0xb10e('0x35')]]=_0x21b071[_0x53a672['variableName']]['toString']());}else if(_0x53a672[_0xb10e('0x37')]===_0xb10e('0x3a')&&_0x53a672[_0xb10e('0x3b')]&&_0x53a672[_0xb10e('0x3b')][_0xb10e('0x3c')]&&_0x53a672['idField']){_0x21b071[_0x53a672[_0xb10e('0x3b')][_0xb10e('0x3c')][_0xb10e('0x3d')]()]&&(_0x5243f3[_0x53a672['idField']]=_0x21b071[_0x53a672[_0xb10e('0x3b')][_0xb10e('0x3c')][_0xb10e('0x3d')]()][_0xb10e('0x36')]());}});}return _0x5243f3;}function getConnection(_0x57837e){var _0x3025a0=_0x57837e[_0xb10e('0x3e')][_0xb10e('0x3f')](_0x57837e['securityToken']);var _0x2e5778=new jsforce[(_0xb10e('0x40'))]({'oauth2':{'loginUrl':_0x57837e[_0xb10e('0x41')]||_0xb10e('0x42'),'clientId':_0x57837e[_0xb10e('0x43')],'clientSecret':_0x57837e[_0xb10e('0x44')]}});return _0x2e5778[_0xb10e('0x45')](_0x57837e[_0xb10e('0x46')],_0x3025a0)[_0xb10e('0x19')](function(){logger[_0xb10e('0x1a')](_0xb10e('0x47'));return _0x2e5778;});}exports[_0xb10e('0x48')]=function(_0x11c30d,_0x2a0b5a,_0x48e696,_0x172f13,_0x2ac475,_0x4e579c){var _0x5609b2,_0x17e371,_0x307d1f,_0xfa0a3f;_0x4e579c[_0xb10e('0x49')]=intUtil['stripTrailingSlash'](_0x4e579c['serverUrl']);_0x4e579c[_0xb10e('0x41')]=intUtil[_0xb10e('0x4a')](_0x4e579c[_0xb10e('0x41')]);if(_0x2ac475&&_0x2ac475[_0xb10e('0x4b')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x2a0b5a[_0xb10e('0x4c')]=util['format'](_0xb10e('0x4d'),_0x4e579c[_0xb10e('0x49')],_0x2a0b5a[_0xb10e('0x4e')],md5(_0x2a0b5a[_0xb10e('0x4e')]));}else{_0x2a0b5a[_0xb10e('0x4c')]='';}return getConnection(_0x4e579c)[_0xb10e('0x19')](function(_0x1b98fa){_0xfa0a3f=_0x1b98fa;return getUser(_0x4e579c,_0x172f13[_0xb10e('0x4f')],_0xfa0a3f);})[_0xb10e('0x19')](function(_0x2e9f43){_0x5609b2=_0x2e9f43;return getEndUser(_0x4e579c,_0x48e696,_0x2a0b5a[_0xb10e('0x50')],_0x2a0b5a[_0xb10e('0x51')],_0xfa0a3f);})['then'](function(_0x54d7ac){_0x17e371=_0x54d7ac;return getTicket(_0x4e579c,_0x5609b2,_0x17e371,_0x48e696,_0x2a0b5a,_0x48e696[_0xb10e('0x52')],_0xfa0a3f,'queue');})[_0xb10e('0x19')](function(_0x1a8f5c){_0x307d1f=_0x1a8f5c;logger[_0xb10e('0x1a')](_0xb10e('0x53'),_0x307d1f['id']);logger[_0xb10e('0x1a')](_0xb10e('0x54'),_0x307d1f['id'],_0x172f13[_0xb10e('0x3c')],_0x4e579c[_0xb10e('0x37')]);switch(_0x4e579c['type']){case _0xb10e('0x55'):emit(util['format']('user:%s',_0x172f13[_0xb10e('0x3c')]),_0xb10e('0x56'),{'recordId':_0x307d1f['id']});break;case'newTab':emit(util[_0xb10e('0x2d')](_0xb10e('0x57'),_0x172f13[_0xb10e('0x3c')]),_0xb10e('0x58'),{'uri':util[_0xb10e('0x2d')]('%s/%s/e',_0xfa0a3f[_0xb10e('0x59')],_0x307d1f['id'])});break;default:logger[_0xb10e('0x5a')](_0xb10e('0x5b'));}})['catch'](function(_0x43fdb3){logger[_0xb10e('0x5a')](_0xb10e('0x5c'),JSON[_0xb10e('0x5d')](_0x43fdb3));});};exports['outbound']=function(_0x49831b,_0x2bfe67,_0x542ed0,_0x4aabb2,_0x557d5d,_0x34e100,_0x54af71){var _0xff6703,_0x1fb255,_0x5e6001,_0xffe4e6;_0x34e100[_0xb10e('0x49')]=intUtil[_0xb10e('0x4a')](_0x34e100[_0xb10e('0x49')]);_0x34e100[_0xb10e('0x41')]=intUtil['stripTrailingSlash'](_0x34e100[_0xb10e('0x41')]);if(_0x54af71&&_0x54af71['recordingFormat']&&_0x54af71[_0xb10e('0x5e')]!==_0xb10e('0x5f')){logger[_0xb10e('0x1a')](_0xb10e('0x60'),_0xb10e('0x61'));_0x2bfe67[_0xb10e('0x4c')]=util[_0xb10e('0x2d')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x34e100['serverUrl'],_0x2bfe67[_0xb10e('0x4e')],md5(_0x2bfe67[_0xb10e('0x4e')]));}return getConnection(_0x34e100)[_0xb10e('0x19')](function(_0x2c5fa0){_0xffe4e6=_0x2c5fa0;return getUser(_0x34e100,_0x4aabb2[_0xb10e('0x4f')],_0xffe4e6);})[_0xb10e('0x19')](function(_0x54fc0c){_0xff6703=_0x54fc0c;return getEndUser(_0x34e100,_0x542ed0,_0x2bfe67[_0xb10e('0x62')],_0x2bfe67[_0xb10e('0x63')],_0xffe4e6);})[_0xb10e('0x19')](function(_0x19bef8){_0x1fb255=_0x19bef8;return getTicket(_0x34e100,_0xff6703,_0x1fb255,_0x542ed0,_0x2bfe67,_0x542ed0[_0xb10e('0x52')],_0xffe4e6,_0xb10e('0x64'));})[_0xb10e('0x19')](function(_0x330e4a){_0x5e6001=_0x330e4a;logger['info'](_0xb10e('0x65'),_0x5e6001['id']);logger[_0xb10e('0x1a')](_0xb10e('0x66'),_0x5e6001['id'],_0x4aabb2[_0xb10e('0x3c')],_0x34e100[_0xb10e('0x37')]);switch(_0x34e100[_0xb10e('0x37')]){case'integrationTab':emit(util[_0xb10e('0x2d')](_0xb10e('0x57'),_0x4aabb2['name']),'trigger:salesforce:display',{'recordId':_0x5e6001['id']});break;case'newTab':emit(util['format'](_0xb10e('0x57'),_0x4aabb2[_0xb10e('0x3c')]),_0xb10e('0x58'),{'uri':util[_0xb10e('0x2d')]('%s/%s/e',_0xffe4e6[_0xb10e('0x59')],_0x5e6001['id'])});break;default:logger[_0xb10e('0x5a')]('[OUTBOUND]',_0xb10e('0x67'));}})[_0xb10e('0x68')](function(_0x4ac741){logger[_0xb10e('0x5a')](_0xb10e('0x60'),JSON[_0xb10e('0x5d')](_0x4ac741));});};exports[_0xb10e('0x69')]=function(_0x2c039b,_0x5bd696,_0x1511e8,_0x434c84,_0x10fd04,_0x21d08b){var _0x355bbd,_0x5aa316,_0x10810c,_0x286c3f;_0x21d08b[_0xb10e('0x49')]=intUtil[_0xb10e('0x4a')](_0x21d08b[_0xb10e('0x49')]);_0x21d08b[_0xb10e('0x41')]=intUtil[_0xb10e('0x4a')](_0x21d08b['remoteUri']);if(_0x10fd04&&_0x10fd04[_0xb10e('0x4b')]){logger[_0xb10e('0x1a')]('[ABANDONED]',_0xb10e('0x61'));_0x5bd696[_0xb10e('0x4c')]=util[_0xb10e('0x2d')](_0xb10e('0x4d'),_0x21d08b[_0xb10e('0x49')],_0x5bd696[_0xb10e('0x4e')],md5(_0x5bd696[_0xb10e('0x4e')]));}else{_0x5bd696[_0xb10e('0x4c')]='';}return getConnection(_0x21d08b)['then'](function(_0x33001e){_0x286c3f=_0x33001e;if(!_[_0xb10e('0x16')](_0x434c84)){return getUser(_0x21d08b,_0x434c84[_0xb10e('0x3c')],_0x286c3f);}else{return getUser(_0x21d08b,null,_0x286c3f);}})['then'](function(_0x59cbf6){_0x355bbd=_0x59cbf6;return getEndUser(_0x21d08b,_0x1511e8,_0x5bd696[_0xb10e('0x50')],_0x5bd696[_0xb10e('0x51')],_0x286c3f);})[_0xb10e('0x19')](function(_0x17940a){_0x5aa316=_0x17940a;return getTicket(_0x21d08b,_0x355bbd,_0x5aa316,_0x1511e8,_0x5bd696,_0x1511e8[_0xb10e('0x52')],_0x286c3f);})[_0xb10e('0x19')](function(_0xe04730){_0x10810c=_0xe04730;logger[_0xb10e('0x1a')](_0xb10e('0x6a'),_0x10810c['id']);logger[_0xb10e('0x1a')](_0xb10e('0x6b'),_0x21d08b[_0xb10e('0x37')]);})[_0xb10e('0x68')](function(_0x2e4af2){logger[_0xb10e('0x5a')]('[ABANDONED]',JSON[_0xb10e('0x5d')](_0x2e4af2));});}; \ No newline at end of file +var _0x1a91=['localhost','emit','ticketType','Task','utc','getString','Descriptions','WhoId','Case','assign','ContactId','sobject','create','isNil','validateEmail','User','find','then','length','Email','info','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','execute','Lead','contact','Contact','lead','Phone','Enduser\x20with\x20phone\x20%s\x20found.','Enduser\x20with\x20phone\x20%s\x20not\x20found.','','format','Caller\x20-\x20%s','moduleCreate','Company','No\x20Company','type','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','password','concat','securityToken','Connection','https://login.salesforce.com','login','Connection\x20established.','queue','stripTrailingSlash','serverUrl','remoteUri','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','newTab','%s/%s/e','instanceUrl','error','catch','stringify','recordingFormat','none','[OUTBOUND]','Fields','outbound','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:browser:url','Salesforce\x20account\x20type\x20not\x20recognized','monitor_format','[ABANDONED]','[ABANDONED]\x20Ticket\x20%s\x20created.','[ABANDONED]\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','jsforce','util','ioredis','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x1a91,0x1a3));var _0x11a9=function(_0x6266ea,_0x3e020b){_0x6266ea=_0x6266ea-0x0;var _0xaae983=_0x1a91[_0x6266ea];return _0xaae983;};'use strict';var _=require(_0x11a9('0x0'));var rp=require(_0x11a9('0x1'));var moment=require(_0x11a9('0x2'));var BPromise=require(_0x11a9('0x3'));var md5=require(_0x11a9('0x4'));var jsforce=require(_0x11a9('0x5'));var util=require(_0x11a9('0x6'));var Redis=require(_0x11a9('0x7'));var intUtil=require('./util');var config=require(_0x11a9('0x8'));var logger=require(_0x11a9('0x9'))(_0x11a9('0xa'));config[_0x11a9('0xb')]=_[_0x11a9('0xc')](config['redis'],{'host':_0x11a9('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x11a9('0xb')]));function emit(_0x278579,_0x5694b5,_0x53bdb7){io['to'](_0x278579)[_0x11a9('0xe')](_0x5694b5,_0x53bdb7);}function getTicket(_0x813dfb,_0x239c90,_0x110d7b,_0x274deb,_0x130b01,_0x3f0ad9,_0x10c792,_0x186f5c){var _0x48832d={};if(_0x274deb[_0x11a9('0xf')]===_0x11a9('0x10')){_0x48832d=Object['assign']({},{'OwnerId':_0x239c90['id'],'ActivityDate':moment[_0x11a9('0x11')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil['getString'](_0x274deb['Subjects'],_0x130b01,'\x20'),'Description':intUtil[_0x11a9('0x12')](_0x274deb[_0x11a9('0x13')],_0x130b01,'\x0a')},getCustomFields(_0x3f0ad9,_0x130b01));if(_0x110d7b){_0x48832d[_0x11a9('0x14')]=_0x110d7b['id'];}}else if(_0x274deb['ticketType']===_0x11a9('0x15')){_0x48832d=Object[_0x11a9('0x16')]({},{'OwnerId':_0x239c90['id'],'Subject':intUtil[_0x11a9('0x12')](_0x274deb['Subjects'],_0x130b01,'\x20'),'Description':intUtil['getString'](_0x274deb[_0x11a9('0x13')],_0x130b01,'\x0a')},getCustomFields(_0x3f0ad9,_0x130b01));if(_0x110d7b){_0x48832d[_0x11a9('0x17')]=_0x110d7b['id'];}}return _0x10c792[_0x11a9('0x18')](_0x274deb[_0x11a9('0xf')])[_0x11a9('0x19')](_0x48832d);}function getUser(_0x14bf31,_0x3d9f74,_0x55ac32){if(!_[_0x11a9('0x1a')](_0x3d9f74)&&intUtil[_0x11a9('0x1b')](_0x3d9f74)){var _0x1d0c25={'Email':_0x3d9f74};var _0x4b99a4={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x55ac32[_0x11a9('0x18')](_0x11a9('0x1c'))[_0x11a9('0x1d')](_0x1d0c25,_0x4b99a4)['execute']()[_0x11a9('0x1e')](function(_0x5d1ba6){if(_0x5d1ba6[_0x11a9('0x1f')]){var _0x230cde=_[_0x11a9('0x1d')](_0x5d1ba6,function(_0x443317){return _0x443317[_0x11a9('0x20')]===_0x3d9f74;});if(_0x230cde){logger[_0x11a9('0x21')]('Agent\x20%s\x20found.',_0x3d9f74);return BPromise[_0x11a9('0x22')]({'id':_0x230cde['Id'],'name':_0x230cde[_0x11a9('0x23')]});}}else{logger['info'](_0x11a9('0x24'),_0x3d9f74);return _0x55ac32[_0x11a9('0x25')]()['then'](function(_0x6235f6){return BPromise[_0x11a9('0x22')]({'id':_0x6235f6[_0x11a9('0x26')],'name':_0x6235f6[_0x11a9('0x27')]});});}});}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x3d9f74);return _0x55ac32[_0x11a9('0x25')]()[_0x11a9('0x1e')](function(_0x5d7470){return BPromise[_0x11a9('0x22')]({'id':_0x5d7470[_0x11a9('0x26')],'name':_0x5d7470[_0x11a9('0x27')]});});}}function getEndUser(_0xa3fd8c,_0x3d0c7c,_0x2e552a,_0x1d8031,_0x4349ce){var _0x2a1ab9={'Phone':_0x1d8031};var _0x5e390e={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x11a9('0x22')]()[_0x11a9('0x1e')](function(){if(_0x3d0c7c['ticketType']===_0x11a9('0x10')){logger[_0x11a9('0x21')](_0x11a9('0x28'),_0x1d8031,_0x3d0c7c[_0x11a9('0x29')]);switch(_0x3d0c7c[_0x11a9('0x29')]){case _0x11a9('0x2a'):return _0x4349ce[_0x11a9('0x18')]('Contact')[_0x11a9('0x1d')](_0x2a1ab9,_0x5e390e)[_0x11a9('0x2b')]()[_0x11a9('0x1e')](function(_0x566ab0){if(_0x566ab0&&_0x566ab0[_0x11a9('0x1f')]){return _0x566ab0;}else{return _0x4349ce[_0x11a9('0x18')](_0x11a9('0x2c'))['find'](_0x2a1ab9,_0x5e390e);}});case _0x11a9('0x2d'):return _0x4349ce['sobject'](_0x11a9('0x2e'))['find'](_0x2a1ab9,_0x5e390e)['execute']();case _0x11a9('0x2f'):return _0x4349ce[_0x11a9('0x18')](_0x11a9('0x2c'))['find'](_0x2a1ab9,_0x5e390e);default:return null;}}else if(_0x3d0c7c[_0x11a9('0xf')]===_0x11a9('0x15')){logger[_0x11a9('0x21')](_0x11a9('0x28'),_0x1d8031,_0x11a9('0x2d'));return _0x4349ce[_0x11a9('0x18')](_0x11a9('0x2e'))[_0x11a9('0x1d')](_0x2a1ab9,_0x5e390e)[_0x11a9('0x2b')]();}})[_0x11a9('0x1e')](function(_0x90f926){if(_0x90f926&&_0x90f926[_0x11a9('0x1f')]){var _0x131c91=_['find'](_0x90f926,function(_0xda9eae){return _0xda9eae[_0x11a9('0x30')]===_0x1d8031;});if(_0x131c91){return BPromise[_0x11a9('0x22')]({'id':_0x131c91['Id'],'name':_0x131c91[_0x11a9('0x23')],'phone':_0x131c91[_0x11a9('0x30')]});}}})[_0x11a9('0x1e')](function(_0x235361){if(_0x235361){logger[_0x11a9('0x21')](_0x11a9('0x31'),_0x1d8031);return BPromise[_0x11a9('0x22')](_0x235361);}else{logger['info'](_0x11a9('0x32'),_0x1d8031);var _0x1facf2={'LastName':_0x2e552a!==_0x11a9('0x33')?_0x2e552a:util[_0x11a9('0x34')](_0x11a9('0x35'),_0x1d8031),'Phone':_0x1d8031};if(_0x3d0c7c['moduleCreate']){if(_0x3d0c7c['moduleCreate']===_0x11a9('0x2d')){logger[_0x11a9('0x21')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x1d8031,_0x3d0c7c[_0x11a9('0x36')]);}else if(_0x3d0c7c[_0x11a9('0x36')]===_0x11a9('0x2f')&&_0x3d0c7c[_0x11a9('0xf')]===_0x11a9('0x10')){logger[_0x11a9('0x21')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x1d8031,_0x3d0c7c[_0x11a9('0x36')]);_0x1facf2[_0x11a9('0x37')]=_0x11a9('0x38');}else{return null;}}return _0x4349ce['sobject'](_['upperFirst'](_0x3d0c7c[_0x11a9('0x36')]))[_0x11a9('0x19')](_0x1facf2);}});}function getCustomFields(_0x5ac5c3,_0x2c60ec){var _0x4fc5a3={};if(_0x5ac5c3[_0x11a9('0x1f')]>0x0){_['forEach'](_0x5ac5c3,function(_0x19e667){if(_0x19e667[_0x11a9('0x39')]==='string'&&_0x19e667['idField']){_0x4fc5a3[_0x19e667[_0x11a9('0x3a')]]=_0x19e667['content'][_0x11a9('0x3b')]();}else if(_0x19e667[_0x11a9('0x39')]===_0x11a9('0x3c')&&_0x19e667[_0x11a9('0x3d')]&&_0x19e667[_0x11a9('0x3a')]){_0x2c60ec[_0x19e667[_0x11a9('0x3d')]]&&(_0x4fc5a3[_0x19e667[_0x11a9('0x3a')]]=_0x2c60ec[_0x19e667[_0x11a9('0x3d')]][_0x11a9('0x3b')]());}else if(_0x19e667['type']===_0x11a9('0x3e')&&_0x19e667[_0x11a9('0x3f')]&&_0x19e667[_0x11a9('0x3f')][_0x11a9('0x40')]&&_0x19e667[_0x11a9('0x3a')]){_0x2c60ec[_0x19e667[_0x11a9('0x3f')][_0x11a9('0x40')][_0x11a9('0x41')]()]&&(_0x4fc5a3[_0x19e667[_0x11a9('0x3a')]]=_0x2c60ec[_0x19e667[_0x11a9('0x3f')][_0x11a9('0x40')][_0x11a9('0x41')]()][_0x11a9('0x3b')]());}});}return _0x4fc5a3;}function getConnection(_0x264234){var _0x13f7b9=_0x264234[_0x11a9('0x42')][_0x11a9('0x43')](_0x264234[_0x11a9('0x44')]);var _0x4508cb=new jsforce[(_0x11a9('0x45'))]({'oauth2':{'loginUrl':_0x264234['remoteUri']||_0x11a9('0x46'),'clientId':_0x264234['clientId'],'clientSecret':_0x264234['clientSecret']}});return _0x4508cb[_0x11a9('0x47')](_0x264234['username'],_0x13f7b9)[_0x11a9('0x1e')](function(){logger[_0x11a9('0x21')](_0x11a9('0x48'));return _0x4508cb;});}exports[_0x11a9('0x49')]=function(_0x69aa4b,_0x1bf506,_0x269696,_0x284061,_0x3277b1,_0x10a2df){var _0x1f66f1,_0xe497cf,_0x3671c2,_0x52f412;_0x10a2df['serverUrl']=intUtil[_0x11a9('0x4a')](_0x10a2df[_0x11a9('0x4b')]);_0x10a2df[_0x11a9('0x4c')]=intUtil['stripTrailingSlash'](_0x10a2df[_0x11a9('0x4c')]);if(_0x3277b1&&_0x3277b1['monitor_format']){logger[_0x11a9('0x21')](_0x11a9('0x4d'),_0x11a9('0x4e'));_0x1bf506[_0x11a9('0x4f')]=util['format'](_0x11a9('0x50'),_0x10a2df[_0x11a9('0x4b')],_0x1bf506['uniqueid'],md5(_0x1bf506[_0x11a9('0x51')]));}else{_0x1bf506[_0x11a9('0x4f')]='';}return getConnection(_0x10a2df)[_0x11a9('0x1e')](function(_0x4568f0){_0x52f412=_0x4568f0;return getUser(_0x10a2df,_0x284061[_0x11a9('0x52')],_0x52f412);})[_0x11a9('0x1e')](function(_0x190676){_0x1f66f1=_0x190676;return getEndUser(_0x10a2df,_0x269696,_0x1bf506[_0x11a9('0x53')],_0x1bf506[_0x11a9('0x54')],_0x52f412);})[_0x11a9('0x1e')](function(_0xf696aa){_0xe497cf=_0xf696aa;return getTicket(_0x10a2df,_0x1f66f1,_0xe497cf,_0x269696,_0x1bf506,_0x269696['Fields'],_0x52f412,_0x11a9('0x49'));})[_0x11a9('0x1e')](function(_0x1f09e8){_0x3671c2=_0x1f09e8;logger[_0x11a9('0x21')](_0x11a9('0x55'),_0x3671c2['id']);logger[_0x11a9('0x21')](_0x11a9('0x56'),_0x3671c2['id'],_0x284061[_0x11a9('0x40')],_0x10a2df[_0x11a9('0x39')]);switch(_0x10a2df[_0x11a9('0x39')]){case _0x11a9('0x57'):emit(util[_0x11a9('0x34')](_0x11a9('0x58'),_0x284061['name']),'trigger:salesforce:display',{'recordId':_0x3671c2['id']});break;case _0x11a9('0x59'):emit(util[_0x11a9('0x34')](_0x11a9('0x58'),_0x284061[_0x11a9('0x40')]),'trigger:browser:url',{'uri':util[_0x11a9('0x34')](_0x11a9('0x5a'),_0x52f412[_0x11a9('0x5b')],_0x3671c2['id'])});break;default:logger[_0x11a9('0x5c')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x11a9('0x5d')](function(_0x28b60e){logger[_0x11a9('0x5c')](_0x11a9('0x4d'),JSON[_0x11a9('0x5e')](_0x28b60e));});};exports['outbound']=function(_0xdb24db,_0x5baa6b,_0x1400e1,_0x45160e,_0x52c2e5,_0x1486d4,_0x3f73f4){var _0x4a438f,_0xdfc75e,_0x17b55c,_0x55aa90;_0x1486d4[_0x11a9('0x4b')]=intUtil[_0x11a9('0x4a')](_0x1486d4[_0x11a9('0x4b')]);_0x1486d4['remoteUri']=intUtil[_0x11a9('0x4a')](_0x1486d4[_0x11a9('0x4c')]);if(_0x3f73f4&&_0x3f73f4[_0x11a9('0x5f')]&&_0x3f73f4[_0x11a9('0x5f')]!==_0x11a9('0x60')){logger[_0x11a9('0x21')](_0x11a9('0x61'),_0x11a9('0x4e'));_0x5baa6b[_0x11a9('0x4f')]=util[_0x11a9('0x34')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1486d4[_0x11a9('0x4b')],_0x5baa6b[_0x11a9('0x51')],md5(_0x5baa6b[_0x11a9('0x51')]));}return getConnection(_0x1486d4)[_0x11a9('0x1e')](function(_0x360149){_0x55aa90=_0x360149;return getUser(_0x1486d4,_0x45160e[_0x11a9('0x52')],_0x55aa90);})[_0x11a9('0x1e')](function(_0x10e5a8){_0x4a438f=_0x10e5a8;return getEndUser(_0x1486d4,_0x1400e1,_0x5baa6b['destcalleridname'],_0x5baa6b['destcalleridnum'],_0x55aa90);})['then'](function(_0x1befaf){_0xdfc75e=_0x1befaf;return getTicket(_0x1486d4,_0x4a438f,_0xdfc75e,_0x1400e1,_0x5baa6b,_0x1400e1[_0x11a9('0x62')],_0x55aa90,_0x11a9('0x63'));})[_0x11a9('0x1e')](function(_0x281338){_0x17b55c=_0x281338;logger[_0x11a9('0x21')](_0x11a9('0x64'),_0x17b55c['id']);logger[_0x11a9('0x21')](_0x11a9('0x65'),_0x17b55c['id'],_0x45160e[_0x11a9('0x40')],_0x1486d4[_0x11a9('0x39')]);switch(_0x1486d4[_0x11a9('0x39')]){case'integrationTab':emit(util[_0x11a9('0x34')](_0x11a9('0x58'),_0x45160e[_0x11a9('0x40')]),'trigger:salesforce:display',{'recordId':_0x17b55c['id']});break;case _0x11a9('0x59'):emit(util['format'](_0x11a9('0x58'),_0x45160e[_0x11a9('0x40')]),_0x11a9('0x66'),{'uri':util[_0x11a9('0x34')](_0x11a9('0x5a'),_0x55aa90[_0x11a9('0x5b')],_0x17b55c['id'])});break;default:logger[_0x11a9('0x5c')](_0x11a9('0x61'),_0x11a9('0x67'));}})[_0x11a9('0x5d')](function(_0x3f0f8d){logger[_0x11a9('0x5c')](_0x11a9('0x61'),JSON[_0x11a9('0x5e')](_0x3f0f8d));});};exports['abandoned']=function(_0x1d4df3,_0xa66aa1,_0xe3aad6,_0x13634b,_0x14c3da,_0x5ead97){var _0x35220c,_0x4726a1,_0x2b5769,_0x4fd847;_0x5ead97[_0x11a9('0x4b')]=intUtil[_0x11a9('0x4a')](_0x5ead97['serverUrl']);_0x5ead97[_0x11a9('0x4c')]=intUtil[_0x11a9('0x4a')](_0x5ead97[_0x11a9('0x4c')]);if(_0x14c3da&&_0x14c3da[_0x11a9('0x68')]){logger[_0x11a9('0x21')](_0x11a9('0x69'),_0x11a9('0x4e'));_0xa66aa1[_0x11a9('0x4f')]=util[_0x11a9('0x34')](_0x11a9('0x50'),_0x5ead97['serverUrl'],_0xa66aa1[_0x11a9('0x51')],md5(_0xa66aa1[_0x11a9('0x51')]));}else{_0xa66aa1[_0x11a9('0x4f')]='';}return getConnection(_0x5ead97)[_0x11a9('0x1e')](function(_0x173ec7){_0x4fd847=_0x173ec7;if(!_[_0x11a9('0x1a')](_0x13634b)){return getUser(_0x5ead97,_0x13634b[_0x11a9('0x40')],_0x4fd847);}else{return getUser(_0x5ead97,null,_0x4fd847);}})[_0x11a9('0x1e')](function(_0x418419){_0x35220c=_0x418419;return getEndUser(_0x5ead97,_0xe3aad6,_0xa66aa1[_0x11a9('0x53')],_0xa66aa1['calleridnum'],_0x4fd847);})[_0x11a9('0x1e')](function(_0x1671c5){_0x4726a1=_0x1671c5;return getTicket(_0x5ead97,_0x35220c,_0x4726a1,_0xe3aad6,_0xa66aa1,_0xe3aad6['Fields'],_0x4fd847);})[_0x11a9('0x1e')](function(_0x5cccb6){_0x2b5769=_0x5cccb6;logger['info'](_0x11a9('0x6a'),_0x2b5769['id']);logger['info'](_0x11a9('0x6b'),_0x5ead97[_0x11a9('0x39')]);})['catch'](function(_0x342d81){logger[_0x11a9('0x5c')](_0x11a9('0x69'),JSON[_0x11a9('0x5e')](_0x342d81));});}; \ 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 08dbd69..8ce8497 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 _0xa9e0=['validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','userId','adminEmail','],\x20getUser\x20crm','catch','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','true','System','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','length','forEach','type','customField','idField','content','toString','toLowerCase','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema',']\x20getTicket\x20crm','label','Incident','ticketId','Incident\x20-\x20','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','password','sysparm_limit=1','sysparm_display_value=true','serverUrl','stripTrailingSlash','%s/api/now/table/','remoteUri','email','destcalleridnum','calleridnum','queue','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','adminId','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','error','message'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'use strict';var _=require(_0x0a9e('0x0'));var Promise=require(_0x0a9e('0x1'));var rp=require(_0x0a9e('0x2'));var util=require('util');var md5=require('md5');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 getAdminUser(_0x5f41ea,_0x503809,_0xe42b77,_0x56465b,_0x52cace,_0x39753a){return new Promise(function(_0xf81284,_0x307b3e){var _0x3ab53f={'method':_0x0a9e('0xb'),'uri':_0x56465b+_0x0a9e('0xc')+'&'+_0x52cace+'&'+_0x39753a,'auth':_0x503809,'json':!![]};return rp(_0x3ab53f)['then'](function(_0x50dfb2){if(_0x50dfb2['result']['length']>0x0){_0xe42b77[_0x0a9e('0xd')]=_0x50dfb2[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}logger[_0x0a9e('0x10')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+_0x0a9e('0x12'),_0xe42b77);_0xf81284(_0xe42b77);})['catch'](function(_0x4283ce){logger[_0x0a9e('0x13')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+']',_0x4283ce[_0x0a9e('0x14')]);_0x307b3e(_0x4283ce[_0x0a9e('0x14')]);});});}function getUser(_0x4d5611,_0x52a03d,_0x22dccb,_0x5d0880,_0x1985b6){return function(_0x519dfd){logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+'],\x20getUser\x20input\x20crm',_0x519dfd);return new Promise(function(_0x225616,_0x5a0a06){if(intUtil[_0x0a9e('0x15')](_0x519dfd[_0x0a9e('0x16')])){var _0x106033={'method':_0x0a9e('0xb'),'uri':_0x22dccb+_0x0a9e('0x17')+_0x519dfd[_0x0a9e('0x16')]+'&'+_0x5d0880+'&'+_0x1985b6,'auth':_0x52a03d,'json':!![]};logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x18'),_0x106033);return rp(_0x106033)[_0x0a9e('0x19')](function(_0x1c696a){logger[_0x0a9e('0x10')]('['+[_0x4d5611['toUpperCase']()]+_0x0a9e('0x1a'),_0x1c696a);if(_0x1c696a[_0x0a9e('0xe')]['length']>0x0&&String(_0x1c696a[_0x0a9e('0xe')][0x0]['active'])==='true'){_0x519dfd[_0x0a9e('0x1b')]=_0x1c696a[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}else{_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd[_0x0a9e('0x1c')];}logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x1d'),_0x519dfd);_0x225616(_0x519dfd);})[_0x0a9e('0x1e')](function(_0x16b1ca){logger['error']('['+[_0x4d5611['toUpperCase']()]+']',_0x16b1ca[_0x0a9e('0x14')]);_0x5a0a06(_0x16b1ca[_0x0a9e('0x14')]);});}else{logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+']\x20using\x20admin\x20profile');_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd['adminEmail'];_0x225616(_0x519dfd);}});};}function createEndUser(_0x1dc186,_0x34dc65,_0x25fba9,_0x14433c,_0x140511){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+_0x0a9e('0x1f'),_0x25fba9);return new Promise(function(_0x5a101a,_0x3652a7){var _0x468813={'method':_0x0a9e('0x20'),'uri':_0x14433c+_0x0a9e('0x21')+_0x140511,'body':{'user_name':_0x25fba9['endUserNumber'],'roles':_0x0a9e('0x22'),'first_name':_0x25fba9[_0x0a9e('0x23')],'active':_0x0a9e('0x24'),'date_format':_0x0a9e('0x25'),'phone':_0x25fba9[_0x0a9e('0x23')]},'auth':_0x34dc65,'json':!![]};return rp(_0x468813)[_0x0a9e('0x19')](function(_0x296f41){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+'],\x20EndUser\x20schema',_0x296f41[_0x0a9e('0xe')]);_0x25fba9['endUserId']=_0x296f41[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x5a101a(_0x25fba9);})[_0x0a9e('0x1e')](function(_0x33bdb7){logger[_0x0a9e('0x13')]('['+[_0x1dc186['toUpperCase']()]+']',_0x33bdb7[_0x0a9e('0x14')]);_0x3652a7(_0x33bdb7[_0x0a9e('0x14')]);});});}function getEndUser(_0x40cb85,_0x2da5c0,_0x2b45ea,_0x409319,_0x332d35){return function(_0x39e565){logger['info']('['+[_0x40cb85[_0x0a9e('0x11')]()]+'],\x20getEndUser\x20input\x20crm',_0x39e565);return new Promise(function(_0x2cc7a0,_0x14b13f){var _0x2b7e7f={'method':_0x0a9e('0xb'),'uri':_0x2b45ea+'sys_user?sysparm_query=phone%3D'+_0x39e565[_0x0a9e('0x23')]+'&'+_0x409319+'&'+_0x332d35,'auth':_0x2da5c0,'json':!![]};return rp(_0x2b7e7f)[_0x0a9e('0x19')](function(_0x1fa90d){if(_0x1fa90d[_0x0a9e('0xe')]['length']>0x0){_0x39e565['endUserId']=_0x1fa90d[_0x0a9e('0xe')][0x0]['sys_id'];logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x26'),_0x39e565);_0x2cc7a0(_0x39e565);}else{return createEndUser(_0x40cb85,_0x2da5c0,_0x39e565,_0x2b45ea,_0x409319)[_0x0a9e('0x19')](function(_0x4f41ae){logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x27'),_0x4f41ae);_0x2cc7a0(_0x4f41ae);});}})['catch'](function(_0x1dbf74){logger[_0x0a9e('0x13')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+']',_0x1dbf74['message']);_0x14b13f(_0x1dbf74['message']);});});};}function getCustomFields(_0x11b61d,_0x40d766){var _0x5adda1={};if(_0x11b61d[_0x0a9e('0x28')]>0x0){_[_0x0a9e('0x29')](_0x11b61d,function(_0x2e1b3a){if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a['nameField']&&!_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')]['toLowerCase']()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]===_0x0a9e('0x30')&&_0x2e1b3a[_0x0a9e('0x31')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x31')]][_0x0a9e('0x2e')]();}else if(_0x2e1b3a['type']==='customVariable'&&_0x2e1b3a[_0x0a9e('0x32')]&&_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')][_0x0a9e('0x2f')]()][_0x0a9e('0x2e')]();}});}return _0x5adda1;}function getTicket(_0x35ed4a,_0x5026aa,_0x117c99,_0x138b8b,_0xdd268f,_0xfbd5ad){return function(_0x2e8caf){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x34'),_0x2e8caf);return new Promise(function(_0x59afe8,_0x2e9d90){var _0x48fd45=_0x35ed4a[_0x0a9e('0x2f')]()===_0x0a9e('0x35')?_0x2e8caf[_0x0a9e('0x1b')]:_0x2e8caf['endUserId'];var _0x14bec2={'method':_0x0a9e('0x20'),'uri':_0x117c99+_0x0a9e('0x36')+'?'+_0xfbd5ad,'body':Object[_0x0a9e('0x37')]({},{'active':_0x0a9e('0x24'),'caller_id':_0x48fd45,'assigned_to':_0x2e8caf[_0x0a9e('0x1b')],'short_description':intUtil[_0x0a9e('0x38')](_0x138b8b['Subjects'],_0xdd268f,'\x20'),'description':intUtil[_0x0a9e('0x38')](_0x138b8b[_0x0a9e('0x39')],_0xdd268f,'\x0a')},getCustomFields(_0x138b8b[_0x0a9e('0x3a')],_0xdd268f)),'auth':_0x5026aa,'json':!![]};return rp(_0x14bec2)[_0x0a9e('0x19')](function(_0x409789){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3b'),_0x409789[_0x0a9e('0xe')]);_0x2e8caf['ticketId']=_0x409789[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x2e8caf['ticketNumber']=_0x409789['result']['number'];logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3c'),_0x2e8caf);_0x59afe8(_0x2e8caf);})[_0x0a9e('0x1e')](function(_0x61bb17){logger[_0x0a9e('0x13')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+']',_0x61bb17[_0x0a9e('0x14')]);_0x2e9d90(_0x61bb17['message']);});});};}function createRemoteTag(_0x4b1b9f,_0x53975a,_0x39d77d,_0x204173){return new Promise(function(_0x14d602,_0x5bb3ed){var _0x2b69d9={'method':_0x0a9e('0x20'),'uri':_0x39d77d+'label'+'?'+_0x204173,'body':{'short_description':_0x4b1b9f,'global':!![],'active':!![],'name':_0x4b1b9f},'auth':_0x53975a,'json':!![]};return rp(_0x2b69d9)['then'](function(_0x2ef381){var _0x59c6ff=_0x2ef381[_0x0a9e('0xe')]['sys_id'];_0x14d602(_0x59c6ff);});});}function getRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da){return new Promise(function(_0x1bf38a,_0x508b47){var _0x50f687={'method':_0x0a9e('0xb'),'uri':_0x439340+_0x0a9e('0x3d')+'?sysparm_query=name%3D'+_0x2e5e62+'&'+_0x53613a,'auth':_0x3c20b2,'json':!![]};return rp(_0x50f687)[_0x0a9e('0x19')](function(_0x5ce9ac){if(_0x5ce9ac[_0x0a9e('0xe')]['length']>0x0){var _0xe22ccc=_0x5ce9ac['result'][0x0]['sys_id'];_0x1bf38a(_0xe22ccc);}else{return createRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a)['then'](function(_0x2da03c){_0x1bf38a(_0x2da03c);});}});});}function assignTagToIncident(_0x47de4c,_0x2f7092,_0x65432,_0x3cfd00,_0x19b4df){return new Promise(function(_0x232830,_0x272738){var _0xd10662={'method':_0x0a9e('0x20'),'uri':_0x65432+'label_entry'+'?'+_0x19b4df,'body':{'label':_0x47de4c,'table':_0x0a9e('0x36'),'id_type':_0x0a9e('0x3e'),'table_key':_0x3cfd00[_0x0a9e('0x3f')],'title':_0x0a9e('0x40')+_0x3cfd00[_0x0a9e('0x41')],'id_display':_0x3cfd00[_0x0a9e('0x41')]},'auth':_0x2f7092,'json':!![]};return rp(_0xd10662)['then'](function(_0x956fbe){_0x232830();})[_0x0a9e('0x1e')](function(){_0x232830();});});}function manageTags(_0x5239ef,_0x3649cc,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a,_0x5674ee){return new Promise(function(_0x273cb5,_0x49d231){var _0x2244d6=[];_0x3649cc[_0x0a9e('0x29')](function(_0x261adb){_0x2244d6[_0x0a9e('0x42')](getRemoteTag(_0x261adb,_0x5cc8fb,_0x20c668,_0x4b3c1a,_0x5674ee));});return Promise[_0x0a9e('0x43')](_0x2244d6)[_0x0a9e('0x19')](function(_0x49eed0){if(_0x49eed0[_0x0a9e('0x28')]){logger['info']('['+[_0x5239ef[_0x0a9e('0x11')]()]+_0x0a9e('0x44'),_0x49eed0);var _0x51aaf7=[];_0x49eed0['forEach'](function(_0x453360){_0x51aaf7[_0x0a9e('0x42')](assignTagToIncident(_0x453360,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a));});return Promise[_0x0a9e('0x43')](_0x51aaf7)[_0x0a9e('0x19')](function(){_0x273cb5();})['catch'](function(){_0x273cb5();});}else{_0x273cb5();}});});}function getTags(_0x1d0dc8,_0xe05a5a,_0x54327c,_0x797b45,_0x17e88c,_0x88dcbf){return function(_0x409b29){return new Promise(function(_0x401837,_0x4d4a35){var _0x176840=[];var _0x2937e0=_0x797b45[_0x0a9e('0x45')];if(_0x2937e0&&_0x2937e0['length']>0x0){_0x176840=_[_0x0a9e('0x46')](_0x2937e0,'name');}if(_0x176840['length']>0x0){return manageTags(_0x1d0dc8,_0x176840,_0xe05a5a,_0x54327c,_0x409b29,_0x17e88c,_0x88dcbf)[_0x0a9e('0x19')](function(){_0x401837(_0x409b29);});}else{_0x401837(_0x409b29);}});};}function emit(_0x4556c5,_0x9375fb,_0x19c995){var _0x186f39=_0x0a9e('0x47')+_0x0a9e('0x48')+_0x0a9e('0x49')+_0x0a9e('0x4a');var _0x1cc4f3={'uri':_0x4556c5+_0x0a9e('0x4b')+_0x19c995+_0x186f39};io['to'](util[_0x0a9e('0x4c')](_0x0a9e('0x4d'),_0x9375fb))[_0x0a9e('0x4e')](_0x0a9e('0x4f'),_0x1cc4f3);}exports['cs']=function(_0x412a72,_0x2a28c0,_0x4257c9,_0x5150a4,_0x1b0b98,_0x295763,_0x243d12,_0x4edbb0){var _0x1148a1={};var _0x30944e={'user':_0x295763['username'],'pass':_0x295763[_0x0a9e('0x50')]};var _0x56e31e=_0x0a9e('0x51');var _0x427946=_0x0a9e('0x52');_0x295763['remoteUri']=intUtil['stripTrailingSlash'](_0x295763['remoteUri']);_0x295763[_0x0a9e('0x53')]=intUtil[_0x0a9e('0x54')](_0x295763[_0x0a9e('0x53')]);var _0x23a7d3=util[_0x0a9e('0x4c')](_0x0a9e('0x55'),_0x295763[_0x0a9e('0x56')]);_0x1148a1[_0x0a9e('0x16')]=!_['isNil'](_0x5150a4)?_0x5150a4[_0x0a9e('0x57')]:null;_0x1148a1[_0x0a9e('0x1c')]=_0x295763[_0x0a9e('0x57')];_0x1148a1['endUserNumber']=_0x4edbb0[_0x0a9e('0x2f')]()==='outbound'?_0x2a28c0[_0x0a9e('0x58')]:_0x2a28c0[_0x0a9e('0x59')];_0x1148a1['callDirection']=_0x4edbb0===_0x0a9e('0x5a')||_0x4edbb0===_0x0a9e('0x5b')?_0x0a9e('0x5a'):_0x0a9e('0x35');var _0x542ece=util[_0x0a9e('0x4c')](_0x0a9e('0x5c'),_0x295763[_0x0a9e('0x53')],_0x2a28c0[_0x0a9e('0x5d')],md5(_0x2a28c0['uniqueid']));if(_0x1b0b98&&_0x1b0b98[_0x0a9e('0x5e')]){logger[_0x0a9e('0x10')](_0x0a9e('0x5f'),_0x0a9e('0x60'));_0x2a28c0['recordingURL']=_0x542ece;}else if(_0x243d12&&_0x243d12[_0x0a9e('0x61')]&&_0x243d12[_0x0a9e('0x61')]!==_0x0a9e('0x62')){logger[_0x0a9e('0x10')](_0x0a9e('0x63'),_0x0a9e('0x60'));_0x2a28c0[_0x0a9e('0x64')]=_0x542ece;}else{_0x2a28c0[_0x0a9e('0x64')]='';}return getAdminUser(_0x4edbb0,_0x30944e,_0x1148a1,_0x23a7d3,_0x427946,_0x56e31e)[_0x0a9e('0x19')](getUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getEndUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getTicket(_0x4edbb0,_0x30944e,_0x23a7d3,_0x4257c9,_0x2a28c0,_0x427946))[_0x0a9e('0x19')](function(_0x25744a){logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x65'),_0x25744a[_0x0a9e('0x3f')]));logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x66'),_0x4edbb0));if(_0x4edbb0!==_0x0a9e('0x5b')){logger[_0x0a9e('0x10')]('['+[_0x4edbb0[_0x0a9e('0x11')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x295763['remoteUri'],_0x5150a4[_0x0a9e('0x33')],_0x25744a[_0x0a9e('0x3f')]);}})['catch'](function(_0x45108c){logger['error']('['+[_0x4edbb0[_0x0a9e('0x11')]()]+_0x0a9e('0x67'),util['inspect'](_0x45108c,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xa9e0=['validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','userId','adminEmail','],\x20getUser\x20crm','catch','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','true','System','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','length','forEach','type','customField','idField','content','toString','toLowerCase','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema',']\x20getTicket\x20crm','label','Incident','ticketId','Incident\x20-\x20','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','password','sysparm_limit=1','sysparm_display_value=true','serverUrl','stripTrailingSlash','%s/api/now/table/','remoteUri','email','destcalleridnum','calleridnum','queue','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','adminId','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','error','message'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'use strict';var _=require(_0x0a9e('0x0'));var Promise=require(_0x0a9e('0x1'));var rp=require(_0x0a9e('0x2'));var util=require('util');var md5=require('md5');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 getAdminUser(_0x5f41ea,_0x503809,_0xe42b77,_0x56465b,_0x52cace,_0x39753a){return new Promise(function(_0xf81284,_0x307b3e){var _0x3ab53f={'method':_0x0a9e('0xb'),'uri':_0x56465b+_0x0a9e('0xc')+'&'+_0x52cace+'&'+_0x39753a,'auth':_0x503809,'json':!![]};return rp(_0x3ab53f)['then'](function(_0x50dfb2){if(_0x50dfb2['result']['length']>0x0){_0xe42b77[_0x0a9e('0xd')]=_0x50dfb2[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}logger[_0x0a9e('0x10')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+_0x0a9e('0x12'),_0xe42b77);_0xf81284(_0xe42b77);})['catch'](function(_0x4283ce){logger[_0x0a9e('0x13')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+']',_0x4283ce[_0x0a9e('0x14')]);_0x307b3e(_0x4283ce[_0x0a9e('0x14')]);});});}function getUser(_0x4d5611,_0x52a03d,_0x22dccb,_0x5d0880,_0x1985b6){return function(_0x519dfd){logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+'],\x20getUser\x20input\x20crm',_0x519dfd);return new Promise(function(_0x225616,_0x5a0a06){if(intUtil[_0x0a9e('0x15')](_0x519dfd[_0x0a9e('0x16')])){var _0x106033={'method':_0x0a9e('0xb'),'uri':_0x22dccb+_0x0a9e('0x17')+_0x519dfd[_0x0a9e('0x16')]+'&'+_0x5d0880+'&'+_0x1985b6,'auth':_0x52a03d,'json':!![]};logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x18'),_0x106033);return rp(_0x106033)[_0x0a9e('0x19')](function(_0x1c696a){logger[_0x0a9e('0x10')]('['+[_0x4d5611['toUpperCase']()]+_0x0a9e('0x1a'),_0x1c696a);if(_0x1c696a[_0x0a9e('0xe')]['length']>0x0&&String(_0x1c696a[_0x0a9e('0xe')][0x0]['active'])==='true'){_0x519dfd[_0x0a9e('0x1b')]=_0x1c696a[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}else{_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd[_0x0a9e('0x1c')];}logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x1d'),_0x519dfd);_0x225616(_0x519dfd);})[_0x0a9e('0x1e')](function(_0x16b1ca){logger['error']('['+[_0x4d5611['toUpperCase']()]+']',_0x16b1ca[_0x0a9e('0x14')]);_0x5a0a06(_0x16b1ca[_0x0a9e('0x14')]);});}else{logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+']\x20using\x20admin\x20profile');_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd['adminEmail'];_0x225616(_0x519dfd);}});};}function createEndUser(_0x1dc186,_0x34dc65,_0x25fba9,_0x14433c,_0x140511){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+_0x0a9e('0x1f'),_0x25fba9);return new Promise(function(_0x5a101a,_0x3652a7){var _0x468813={'method':_0x0a9e('0x20'),'uri':_0x14433c+_0x0a9e('0x21')+_0x140511,'body':{'user_name':_0x25fba9['endUserNumber'],'roles':_0x0a9e('0x22'),'first_name':_0x25fba9[_0x0a9e('0x23')],'active':_0x0a9e('0x24'),'date_format':_0x0a9e('0x25'),'phone':_0x25fba9[_0x0a9e('0x23')]},'auth':_0x34dc65,'json':!![]};return rp(_0x468813)[_0x0a9e('0x19')](function(_0x296f41){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+'],\x20EndUser\x20schema',_0x296f41[_0x0a9e('0xe')]);_0x25fba9['endUserId']=_0x296f41[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x5a101a(_0x25fba9);})[_0x0a9e('0x1e')](function(_0x33bdb7){logger[_0x0a9e('0x13')]('['+[_0x1dc186['toUpperCase']()]+']',_0x33bdb7[_0x0a9e('0x14')]);_0x3652a7(_0x33bdb7[_0x0a9e('0x14')]);});});}function getEndUser(_0x40cb85,_0x2da5c0,_0x2b45ea,_0x409319,_0x332d35){return function(_0x39e565){logger['info']('['+[_0x40cb85[_0x0a9e('0x11')]()]+'],\x20getEndUser\x20input\x20crm',_0x39e565);return new Promise(function(_0x2cc7a0,_0x14b13f){var _0x2b7e7f={'method':_0x0a9e('0xb'),'uri':_0x2b45ea+'sys_user?sysparm_query=phone%3D'+_0x39e565[_0x0a9e('0x23')]+'&'+_0x409319+'&'+_0x332d35,'auth':_0x2da5c0,'json':!![]};return rp(_0x2b7e7f)[_0x0a9e('0x19')](function(_0x1fa90d){if(_0x1fa90d[_0x0a9e('0xe')]['length']>0x0){_0x39e565['endUserId']=_0x1fa90d[_0x0a9e('0xe')][0x0]['sys_id'];logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x26'),_0x39e565);_0x2cc7a0(_0x39e565);}else{return createEndUser(_0x40cb85,_0x2da5c0,_0x39e565,_0x2b45ea,_0x409319)[_0x0a9e('0x19')](function(_0x4f41ae){logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x27'),_0x4f41ae);_0x2cc7a0(_0x4f41ae);});}})['catch'](function(_0x1dbf74){logger[_0x0a9e('0x13')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+']',_0x1dbf74['message']);_0x14b13f(_0x1dbf74['message']);});});};}function getCustomFields(_0x11b61d,_0x40d766){var _0x5adda1={};if(_0x11b61d[_0x0a9e('0x28')]>0x0){_[_0x0a9e('0x29')](_0x11b61d,function(_0x2e1b3a){if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a['nameField']&&!_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')]['toLowerCase']()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]===_0x0a9e('0x30')&&_0x2e1b3a[_0x0a9e('0x31')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x31')]][_0x0a9e('0x2e')]();}else if(_0x2e1b3a['type']==='customVariable'&&_0x2e1b3a[_0x0a9e('0x32')]&&_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')][_0x0a9e('0x2f')]()][_0x0a9e('0x2e')]();}});}return _0x5adda1;}function getTicket(_0x35ed4a,_0x5026aa,_0x117c99,_0x138b8b,_0xdd268f,_0xfbd5ad){return function(_0x2e8caf){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x34'),_0x2e8caf);return new Promise(function(_0x59afe8,_0x2e9d90){var _0x48fd45=_0x35ed4a[_0x0a9e('0x2f')]()===_0x0a9e('0x35')?_0x2e8caf[_0x0a9e('0x1b')]:_0x2e8caf['endUserId'];var _0x14bec2={'method':_0x0a9e('0x20'),'uri':_0x117c99+_0x0a9e('0x36')+'?'+_0xfbd5ad,'body':Object[_0x0a9e('0x37')]({},{'active':_0x0a9e('0x24'),'caller_id':_0x48fd45,'assigned_to':_0x2e8caf[_0x0a9e('0x1b')],'short_description':intUtil[_0x0a9e('0x38')](_0x138b8b['Subjects'],_0xdd268f,'\x20'),'description':intUtil[_0x0a9e('0x38')](_0x138b8b[_0x0a9e('0x39')],_0xdd268f,'\x0a')},getCustomFields(_0x138b8b[_0x0a9e('0x3a')],_0xdd268f)),'auth':_0x5026aa,'json':!![]};return rp(_0x14bec2)[_0x0a9e('0x19')](function(_0x409789){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3b'),_0x409789[_0x0a9e('0xe')]);_0x2e8caf['ticketId']=_0x409789[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x2e8caf['ticketNumber']=_0x409789['result']['number'];logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3c'),_0x2e8caf);_0x59afe8(_0x2e8caf);})[_0x0a9e('0x1e')](function(_0x61bb17){logger[_0x0a9e('0x13')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+']',_0x61bb17[_0x0a9e('0x14')]);_0x2e9d90(_0x61bb17['message']);});});};}function createRemoteTag(_0x4b1b9f,_0x53975a,_0x39d77d,_0x204173){return new Promise(function(_0x14d602,_0x5bb3ed){var _0x2b69d9={'method':_0x0a9e('0x20'),'uri':_0x39d77d+'label'+'?'+_0x204173,'body':{'short_description':_0x4b1b9f,'global':!![],'active':!![],'name':_0x4b1b9f},'auth':_0x53975a,'json':!![]};return rp(_0x2b69d9)['then'](function(_0x2ef381){var _0x59c6ff=_0x2ef381[_0x0a9e('0xe')]['sys_id'];_0x14d602(_0x59c6ff);});});}function getRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da){return new Promise(function(_0x1bf38a,_0x508b47){var _0x50f687={'method':_0x0a9e('0xb'),'uri':_0x439340+_0x0a9e('0x3d')+'?sysparm_query=name%3D'+_0x2e5e62+'&'+_0x53613a,'auth':_0x3c20b2,'json':!![]};return rp(_0x50f687)[_0x0a9e('0x19')](function(_0x5ce9ac){if(_0x5ce9ac[_0x0a9e('0xe')]['length']>0x0){var _0xe22ccc=_0x5ce9ac['result'][0x0]['sys_id'];_0x1bf38a(_0xe22ccc);}else{return createRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a)['then'](function(_0x2da03c){_0x1bf38a(_0x2da03c);});}});});}function assignTagToIncident(_0x47de4c,_0x2f7092,_0x65432,_0x3cfd00,_0x19b4df){return new Promise(function(_0x232830,_0x272738){var _0xd10662={'method':_0x0a9e('0x20'),'uri':_0x65432+'label_entry'+'?'+_0x19b4df,'body':{'label':_0x47de4c,'table':_0x0a9e('0x36'),'id_type':_0x0a9e('0x3e'),'table_key':_0x3cfd00[_0x0a9e('0x3f')],'title':_0x0a9e('0x40')+_0x3cfd00[_0x0a9e('0x41')],'id_display':_0x3cfd00[_0x0a9e('0x41')]},'auth':_0x2f7092,'json':!![]};return rp(_0xd10662)['then'](function(_0x956fbe){_0x232830();})[_0x0a9e('0x1e')](function(){_0x232830();});});}function manageTags(_0x5239ef,_0x3649cc,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a,_0x5674ee){return new Promise(function(_0x273cb5,_0x49d231){var _0x2244d6=[];_0x3649cc[_0x0a9e('0x29')](function(_0x261adb){_0x2244d6[_0x0a9e('0x42')](getRemoteTag(_0x261adb,_0x5cc8fb,_0x20c668,_0x4b3c1a,_0x5674ee));});return Promise[_0x0a9e('0x43')](_0x2244d6)[_0x0a9e('0x19')](function(_0x49eed0){if(_0x49eed0[_0x0a9e('0x28')]){logger['info']('['+[_0x5239ef[_0x0a9e('0x11')]()]+_0x0a9e('0x44'),_0x49eed0);var _0x51aaf7=[];_0x49eed0['forEach'](function(_0x453360){_0x51aaf7[_0x0a9e('0x42')](assignTagToIncident(_0x453360,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a));});return Promise[_0x0a9e('0x43')](_0x51aaf7)[_0x0a9e('0x19')](function(){_0x273cb5();})['catch'](function(){_0x273cb5();});}else{_0x273cb5();}});});}function getTags(_0x1d0dc8,_0xe05a5a,_0x54327c,_0x797b45,_0x17e88c,_0x88dcbf){return function(_0x409b29){return new Promise(function(_0x401837,_0x4d4a35){var _0x176840=[];var _0x2937e0=_0x797b45[_0x0a9e('0x45')];if(_0x2937e0&&_0x2937e0['length']>0x0){_0x176840=_[_0x0a9e('0x46')](_0x2937e0,'name');}if(_0x176840['length']>0x0){return manageTags(_0x1d0dc8,_0x176840,_0xe05a5a,_0x54327c,_0x409b29,_0x17e88c,_0x88dcbf)[_0x0a9e('0x19')](function(){_0x401837(_0x409b29);});}else{_0x401837(_0x409b29);}});};}function emit(_0x4556c5,_0x9375fb,_0x19c995){var _0x186f39=_0x0a9e('0x47')+_0x0a9e('0x48')+_0x0a9e('0x49')+_0x0a9e('0x4a');var _0x1cc4f3={'uri':_0x4556c5+_0x0a9e('0x4b')+_0x19c995+_0x186f39};io['to'](util[_0x0a9e('0x4c')](_0x0a9e('0x4d'),_0x9375fb))[_0x0a9e('0x4e')](_0x0a9e('0x4f'),_0x1cc4f3);}exports['cs']=function(_0x412a72,_0x2a28c0,_0x4257c9,_0x5150a4,_0x1b0b98,_0x295763,_0x243d12,_0x4edbb0){var _0x1148a1={};var _0x30944e={'user':_0x295763['username'],'pass':_0x295763[_0x0a9e('0x50')]};var _0x56e31e=_0x0a9e('0x51');var _0x427946=_0x0a9e('0x52');_0x295763['remoteUri']=intUtil['stripTrailingSlash'](_0x295763['remoteUri']);_0x295763[_0x0a9e('0x53')]=intUtil[_0x0a9e('0x54')](_0x295763[_0x0a9e('0x53')]);var _0x23a7d3=util[_0x0a9e('0x4c')](_0x0a9e('0x55'),_0x295763[_0x0a9e('0x56')]);_0x1148a1[_0x0a9e('0x16')]=!_['isNil'](_0x5150a4)?_0x5150a4[_0x0a9e('0x57')]:null;_0x1148a1[_0x0a9e('0x1c')]=_0x295763[_0x0a9e('0x57')];_0x1148a1['endUserNumber']=_0x4edbb0[_0x0a9e('0x2f')]()==='outbound'?_0x2a28c0[_0x0a9e('0x58')]:_0x2a28c0[_0x0a9e('0x59')];_0x1148a1['callDirection']=_0x4edbb0===_0x0a9e('0x5a')||_0x4edbb0===_0x0a9e('0x5b')?_0x0a9e('0x5a'):_0x0a9e('0x35');var _0x542ece=util[_0x0a9e('0x4c')](_0x0a9e('0x5c'),_0x295763[_0x0a9e('0x53')],_0x2a28c0[_0x0a9e('0x5d')],md5(_0x2a28c0['uniqueid']));if(_0x1b0b98&&_0x1b0b98[_0x0a9e('0x5e')]){logger[_0x0a9e('0x10')](_0x0a9e('0x5f'),_0x0a9e('0x60'));_0x2a28c0['recordingURL']=_0x542ece;}else if(_0x243d12&&_0x243d12[_0x0a9e('0x61')]&&_0x243d12[_0x0a9e('0x61')]!==_0x0a9e('0x62')){logger[_0x0a9e('0x10')](_0x0a9e('0x63'),_0x0a9e('0x60'));_0x2a28c0[_0x0a9e('0x64')]=_0x542ece;}else{_0x2a28c0[_0x0a9e('0x64')]='';}return getAdminUser(_0x4edbb0,_0x30944e,_0x1148a1,_0x23a7d3,_0x427946,_0x56e31e)[_0x0a9e('0x19')](getUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getEndUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getTicket(_0x4edbb0,_0x30944e,_0x23a7d3,_0x4257c9,_0x2a28c0,_0x427946))[_0x0a9e('0x19')](function(_0x25744a){logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x65'),_0x25744a[_0x0a9e('0x3f')]));logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x66'),_0x4edbb0));if(_0x4edbb0!==_0x0a9e('0x5b')){logger[_0x0a9e('0x10')]('['+[_0x4edbb0[_0x0a9e('0x11')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x295763['remoteUri'],_0x5150a4[_0x0a9e('0x33')],_0x25744a[_0x0a9e('0x3f')]);}})['catch'](function(_0x45108c){logger['error']('['+[_0x4edbb0[_0x0a9e('0x11')]()]+_0x0a9e('0x67'),util['inspect'](_0x45108c,{'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 1f0be3c..040348b 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 _0x3e35=['debug','[HTTP]','merge','map','type','string','nameField','toLowerCase','content','idField','customField','custom_fields','variable','Variable','login','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','outbound','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','catch','uri','Fields','[ABANDONED]','lodash','request-promise','bluebird','md5','util','ioredis','../../../../config/environment','../../../../config/logger','sugarcrm','defaults','redis','localhost','POST','emit','info','Creating\x20new\x20ticket...','getString','created_by','description','Descriptions','date_start','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','name','length','forEach','variableName','push','set_entry','JSON','stringify','Calls','Basic\x20%s','apiKey','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','find','value','Agent\x20found!','resolve','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','phone_home','entry_list','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.'];(function(_0x548d7d,_0x2d41fc){var _0xb1c878=function(_0x570f09){while(--_0x570f09){_0x548d7d['push'](_0x548d7d['shift']());}};_0xb1c878(++_0x2d41fc);}(_0x3e35,0x1ad));var _0x53e3=function(_0x1bd2a6,_0x45f0fc){_0x1bd2a6=_0x1bd2a6-0x0;var _0x525206=_0x3e35[_0x1bd2a6];return _0x525206;};'use strict';var _=require(_0x53e3('0x0'));var rp=require(_0x53e3('0x1'));var BPromise=require(_0x53e3('0x2'));var md5=require(_0x53e3('0x3'));var util=require(_0x53e3('0x4'));var Redis=require(_0x53e3('0x5'));var intUtil=require('./util');var config=require(_0x53e3('0x6'));var logger=require(_0x53e3('0x7'))(_0x53e3('0x8'));config['redis']=_[_0x53e3('0x9')](config[_0x53e3('0xa')],{'host':_0x53e3('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x53e3('0xa')]));var def={'method':_0x53e3('0xc'),'json':!![]};function emit(_0x322181,_0x446f1c,_0x1c2667){io['to'](_0x322181)[_0x53e3('0xd')](_0x446f1c,_0x1c2667);}function getTicket(_0x2379ac,_0x2768c4,_0x286aad,_0x4eeaf1,_0x384b06,_0x2fbfa2,_0x1be306,_0x294505){logger[_0x53e3('0xe')](_0x53e3('0xf'));var _0x3e1eaf=new Date();var _0x47bbf1=[{'name':'name','value':intUtil[_0x53e3('0x10')](_0x4eeaf1['Subjects'],_0x384b06,'\x20')},{'name':'assigned_user_id','value':_0x2768c4['id']},{'name':_0x53e3('0x11'),'value':_0x2768c4['id']},{'name':_0x53e3('0x12'),'value':intUtil[_0x53e3('0x10')](_0x4eeaf1[_0x53e3('0x13')],_0x384b06,'\x0a')},{'name':_0x53e3('0x14'),'value':_0x3e1eaf['toISOString']()[_0x53e3('0x15')](0x0,0x13)[_0x53e3('0x16')]('T','\x20')},{'name':_0x53e3('0x17'),'value':'0'},{'name':_0x53e3('0x18'),'value':'15'},{'name':_0x53e3('0x19'),'value':_0x286aad['id']},{'name':_0x53e3('0x1a'),'value':_0x53e3('0x1b')},{'name':_0x53e3('0x1c'),'value':_0x286aad[_0x53e3('0x1d')]},{'name':'direction','value':_0x294505}];if(_0x2fbfa2[_0x53e3('0x1e')]){_[_0x53e3('0x1f')](_0x2fbfa2,function(_0x18d2c7){if(_0x384b06[_0x18d2c7[_0x53e3('0x20')]]){_0x47bbf1[_0x53e3('0x21')]({'name':_0x18d2c7['idField'],'value':_0x384b06[_0x18d2c7[_0x53e3('0x20')]]});}});}return request({'form':{'method':_0x53e3('0x22'),'input_type':'JSON','response_type':_0x53e3('0x23'),'rest_data':JSON[_0x53e3('0x24')]({'session':_0x1be306['id'],'module_name':_0x53e3('0x25'),'name_value_list':_0x47bbf1})}});}function getAuth(_0x5d0e2e){return util['format'](_0x53e3('0x26'),new Buffer(_0x5d0e2e[_0x53e3('0x27')]+':X')[_0x53e3('0x28')](_0x53e3('0x29')));}function getServerInfo(_0x4d5ac3){return request({'form':{'method':_0x53e3('0x2a'),'input_type':_0x53e3('0x23'),'response_type':'JSON','rest_data':JSON[_0x53e3('0x24')]({'session':_0x4d5ac3['id']})}});}function getUser(_0xc0e66,_0x1d3691,_0x27be86){if(!_[_0x53e3('0x2b')](_0x1d3691)){logger[_0x53e3('0xe')](_0x53e3('0x2c'),_0x1d3691);return request({'form':{'method':_0x53e3('0x2d'),'input_type':_0x53e3('0x23'),'response_type':_0x53e3('0x23'),'rest_data':JSON[_0x53e3('0x24')]({'session':_0x27be86['id'],'module_name':_0x53e3('0x2e'),'query':util[_0x53e3('0x2f')](_0x53e3('0x30'),_0x1d3691),'order_by':'','offset':'0','select_fields':['id',_0x53e3('0x1d'),_0x53e3('0x31')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x53e3('0x32')](function(_0xa54587){if(_0xa54587['entry_list'][_0x53e3('0x1e')]){var _0x4e0fef=_[_0x53e3('0x33')](_0xa54587['entry_list'],function(_0x4483d7){return _0x4483d7['name_value_list'][_0x53e3('0x31')][_0x53e3('0x34')]===_0x1d3691;});if(_0x4e0fef){logger[_0x53e3('0xe')](_0x53e3('0x35'));return BPromise[_0x53e3('0x36')]({'id':_0x4e0fef[_0x53e3('0x37')]['id'][_0x53e3('0x34')],'name':_0x4e0fef[_0x53e3('0x37')][_0x53e3('0x1d')][_0x53e3('0x34')]});}}logger[_0x53e3('0xe')](_0x53e3('0x38'));return BPromise[_0x53e3('0x36')]({'id':_0x27be86[_0x53e3('0x37')]['user_id'][_0x53e3('0x34')],'name':_0x27be86[_0x53e3('0x37')]['user_name']['value']});});}else{logger[_0x53e3('0xe')](_0x53e3('0x39'));return BPromise[_0x53e3('0x36')]({'id':_0x27be86[_0x53e3('0x37')][_0x53e3('0x3a')][_0x53e3('0x34')],'name':_0x27be86[_0x53e3('0x37')]['user_name'][_0x53e3('0x34')]});}}function getEndUser(_0x129f97,_0x170558,_0x32ad57,_0x10f99b){logger[_0x53e3('0xe')](_0x53e3('0x3b'),_0x32ad57);return request({'form':{'method':_0x53e3('0x2d'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x53e3('0x24')]({'session':_0x10f99b['id'],'module_name':_0x53e3('0x1b'),'query':util[_0x53e3('0x2f')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x32ad57),'order_by':'','offset':'0','select_fields':['id',_0x53e3('0x1d'),_0x53e3('0x3c')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x53e3('0x32')](function(_0x2fde0a){if(_0x2fde0a[_0x53e3('0x3d')][_0x53e3('0x1e')]){var _0x201030=_[_0x53e3('0x33')](_0x2fde0a[_0x53e3('0x3d')],function(_0x489fe7){return _0x489fe7[_0x53e3('0x37')]['phone_home'][_0x53e3('0x34')]===_0x32ad57;});if(_0x201030){logger['info']('Enduser\x20found!');return BPromise[_0x53e3('0x36')]({'id':_0x201030[_0x53e3('0x37')]['id'][_0x53e3('0x34')],'name':_0x201030['name_value_list']['name']['value'],'phone':_0x201030[_0x53e3('0x37')][_0x53e3('0x3c')][_0x53e3('0x34')]});}}else{logger[_0x53e3('0xe')](_0x53e3('0x3e'));return request({'form':{'method':_0x53e3('0x22'),'input_type':_0x53e3('0x23'),'response_type':_0x53e3('0x23'),'rest_data':JSON['stringify']({'session':_0x10f99b['id'],'module_name':_0x53e3('0x1b'),'name_value_list':[{'name':_0x53e3('0x3f'),'value':_0x170558!==_0x53e3('0x40')?_0x170558:util[_0x53e3('0x2f')](_0x53e3('0x41'),_0x32ad57)},{'name':'phone_home','value':_0x32ad57}]})}})['then'](function(_0x948ed3){logger['info'](_0x53e3('0x42'));return BPromise[_0x53e3('0x36')]({'id':_0x948ed3['id'],'name':_0x948ed3[_0x53e3('0x3d')][_0x53e3('0x3f')]['value'],'phone':_0x948ed3[_0x53e3('0x3d')][_0x53e3('0x3c')][_0x53e3('0x34')]});});}});}function request(_0xf4565a){logger[_0x53e3('0x43')](_0x53e3('0x44'),JSON[_0x53e3('0x24')](_0xf4565a));return rp(_[_0x53e3('0x45')](def,_0xf4565a));}function getTags(_0x13e465,_0x4ef567){var _0x59a600=[];if(_0x13e465&&_0x13e465['length']>0x0){_0x59a600=_[_0x53e3('0x46')](_0x13e465,_0x4ef567);}return _0x59a600;}function getCustomFields(_0x48235c,_0x549a50){var _0x50d503=[];var _0x59d8b0={'custom_fields':[]};if(_0x48235c[_0x53e3('0x1e')]>0x0){_[_0x53e3('0x1f')](_0x48235c,function(_0x5e8612){if(_0x5e8612[_0x53e3('0x47')]===_0x53e3('0x48')&&_0x5e8612[_0x53e3('0x49')]&&!_0x5e8612['customField']){_0x59d8b0[_0x5e8612[_0x53e3('0x49')][_0x53e3('0x4a')]()]=_0x5e8612[_0x53e3('0x4b')][_0x53e3('0x28')]();}else if(_0x5e8612[_0x53e3('0x47')]===_0x53e3('0x48')&&_0x5e8612[_0x53e3('0x4c')]&&_0x5e8612[_0x53e3('0x4d')]){_0x59d8b0[_0x53e3('0x4e')][_0x53e3('0x21')]({'id':_0x5e8612[_0x53e3('0x4c')],'value':_0x5e8612['content'][_0x53e3('0x28')]()});}else if(_0x5e8612[_0x53e3('0x47')]===_0x53e3('0x4f')&&_0x5e8612[_0x53e3('0x20')]&&_0x5e8612['idField']&&_0x5e8612[_0x53e3('0x4d')]){_0x549a50[_0x5e8612[_0x53e3('0x20')]]&&_0x59d8b0['custom_fields']['push']({'id':_0x5e8612[_0x53e3('0x4c')],'value':_0x549a50[_0x5e8612[_0x53e3('0x20')]]['toString']()});}else if(_0x5e8612[_0x53e3('0x47')]==='customVariable'&&_0x5e8612[_0x53e3('0x50')]&&_0x5e8612[_0x53e3('0x50')][_0x53e3('0x1d')]&&_0x5e8612[_0x53e3('0x4c')]&&_0x5e8612[_0x53e3('0x4d')]){_0x549a50[_0x5e8612['Variable'][_0x53e3('0x1d')][_0x53e3('0x4a')]()]&&_0x59d8b0[_0x53e3('0x4e')][_0x53e3('0x21')]({'id':_0x5e8612[_0x53e3('0x4c')],'value':_0x549a50[_0x5e8612['Variable']['name'][_0x53e3('0x4a')]()][_0x53e3('0x28')]()});}});}return _0x59d8b0;}function getConnection(_0x5c30cb){return request({'method':_0x53e3('0xc'),'form':{'method':_0x53e3('0x51'),'input_type':_0x53e3('0x23'),'response_type':_0x53e3('0x23'),'rest_data':JSON[_0x53e3('0x24')]({'user_auth':{'user_name':_0x5c30cb['username'],'password':_0x5c30cb[_0x53e3('0x52')],'encryption':_0x53e3('0x53')},'application':_0x53e3('0x54')})}})[_0x53e3('0x32')](function(_0x5d44ea){var _0x3dbfa8=_0x5d44ea;if(_0x3dbfa8['id']){def[_0x53e3('0x55')]=_0x3dbfa8['id'];return BPromise[_0x53e3('0x36')](_0x3dbfa8);}else{throw new Error(util['format'](_0x53e3('0x56'),_0x5c30cb['id']));}});}function setRelationship(_0x7d4e7c,_0x21a243,_0x398738,_0x2795c7){return request({'form':{'method':_0x53e3('0x57'),'input_type':_0x53e3('0x23'),'response_type':_0x53e3('0x23'),'rest_data':JSON[_0x53e3('0x24')]({'session':_0x7d4e7c['id'],'module_name':_0x53e3('0x25'),'module_id':_0x398738['id'],'link_field_name':_0x2795c7,'related_ids':[_0x21a243['id']]})}});}exports[_0x53e3('0x58')]=function(_0x186676,_0x231b64,_0x2c90ad,_0x430672,_0x253a92,_0x529921){var _0x1b8189,_0x572f43,_0x901fde,_0x4580a6;_0x529921[_0x53e3('0x59')]=intUtil[_0x53e3('0x5a')](_0x529921['remoteUri']);_0x529921[_0x53e3('0x5b')]=intUtil[_0x53e3('0x5a')](_0x529921[_0x53e3('0x5b')]);def['uri']=util[_0x53e3('0x2f')](_0x53e3('0x5c'),_0x529921[_0x53e3('0x59')]);if(_0x253a92&&_0x253a92[_0x53e3('0x5d')]){logger[_0x53e3('0xe')](_0x53e3('0x5e'),_0x53e3('0x5f'));_0x231b64[_0x53e3('0x60')]=util[_0x53e3('0x2f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x529921[_0x53e3('0x5b')],_0x231b64[_0x53e3('0x61')],md5(_0x231b64['uniqueid']));}else{_0x231b64[_0x53e3('0x60')]='';}return getConnection(_0x529921)[_0x53e3('0x32')](function(_0x4f22ff){_0x4580a6=_0x4f22ff;return getUser(_0x529921,_0x430672[_0x53e3('0x1d')],_0x4580a6);})[_0x53e3('0x32')](function(_0x2329a1){_0x1b8189=_0x2329a1;logger[_0x53e3('0xe')](_0x53e3('0x62'),_0x1b8189['id']);return getEndUser(_0x529921,_0x231b64[_0x53e3('0x63')],_0x231b64['calleridnum'],_0x4580a6);})[_0x53e3('0x32')](function(_0x2ec385){_0x572f43=_0x2ec385;logger[_0x53e3('0xe')](_0x53e3('0x64'),_0x572f43['id']);return getTicket(_0x529921,_0x1b8189,_0x572f43,_0x2c90ad,_0x231b64,_0x2c90ad['Fields'],_0x4580a6,_0x53e3('0x65'));})[_0x53e3('0x32')](function(_0x584717){_0x901fde=_0x584717;logger[_0x53e3('0xe')](_0x53e3('0x66'));logger[_0x53e3('0xe')](_0x53e3('0x67'),_0x901fde['id']);return setRelationship(_0x4580a6,_0x1b8189,_0x901fde,_0x53e3('0x68'));})[_0x53e3('0x32')](function(){return setRelationship(_0x4580a6,_0x572f43,_0x901fde,_0x53e3('0x69'));})[_0x53e3('0x32')](function(){return getServerInfo(_0x4580a6);})['then'](function(_0x5c3c45){var _0x56cd02=parseInt(_0x5c3c45[_0x53e3('0x6a')][_0x53e3('0x6b')](0x0));var _0x5d32cf=util[_0x53e3('0x2f')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x529921[_0x53e3('0x59')],_0x901fde['id']);if(_0x56cd02>0x6){_0x5d32cf=util[_0x53e3('0x2f')](_0x53e3('0x6c'),_0x529921[_0x53e3('0x59')],_0x901fde['id']);}logger[_0x53e3('0xe')](_0x53e3('0x5e'),_0x53e3('0x6d'));emit(util[_0x53e3('0x2f')](_0x53e3('0x6e'),_0x430672[_0x53e3('0x1d')]),_0x53e3('0x6f'),{'uri':_0x5d32cf});})['catch'](function(_0xada483){logger[_0x53e3('0x70')](_0x53e3('0x5e'),JSON['stringify'](_0xada483));});};exports[_0x53e3('0x71')]=function(_0x4775ba,_0x461e37,_0x3da07d,_0x285a06,_0x5c0a31,_0x33e35b,_0x23b089){var _0x53e11f,_0x34af5c,_0x5074b2,_0x2c1c30;_0x33e35b[_0x53e3('0x59')]=intUtil[_0x53e3('0x5a')](_0x33e35b[_0x53e3('0x59')]);_0x33e35b['serverUrl']=intUtil[_0x53e3('0x5a')](_0x33e35b[_0x53e3('0x5b')]);def['uri']=util[_0x53e3('0x2f')]('%s/service/v4_1/rest.php',_0x33e35b[_0x53e3('0x59')]);if(_0x23b089&&_0x23b089['recordingFormat']&&_0x23b089['recordingFormat']!==_0x53e3('0x72')){logger['info'](_0x53e3('0x73'),_0x53e3('0x5f'));_0x461e37[_0x53e3('0x60')]=util[_0x53e3('0x2f')](_0x53e3('0x74'),_0x33e35b[_0x53e3('0x5b')],_0x461e37[_0x53e3('0x61')],md5(_0x461e37[_0x53e3('0x61')]));}return getConnection(_0x33e35b)['then'](function(_0x493015){_0x2c1c30=_0x493015;return getUser(_0x33e35b,_0x285a06[_0x53e3('0x1d')],_0x2c1c30);})[_0x53e3('0x32')](function(_0x144144){_0x53e11f=_0x144144;logger[_0x53e3('0xe')](_0x53e3('0x62'),_0x53e11f['id']);return getEndUser(_0x33e35b,_0x461e37[_0x53e3('0x75')],_0x461e37[_0x53e3('0x76')],_0x2c1c30);})[_0x53e3('0x32')](function(_0x2132fe){_0x34af5c=_0x2132fe;logger[_0x53e3('0xe')](_0x53e3('0x64'),_0x34af5c['id']);return getTicket(_0x33e35b,_0x53e11f,_0x34af5c,_0x3da07d,_0x461e37,_0x3da07d['Fields'],_0x2c1c30,'Outbound');})[_0x53e3('0x32')](function(_0x5c28aa){_0x5074b2=_0x5c28aa;logger['info']('Ticket\x20created!');logger[_0x53e3('0xe')](_0x53e3('0x67'),_0x5074b2['id']);return setRelationship(_0x2c1c30,_0x53e11f,_0x5074b2,_0x53e3('0x68'));})[_0x53e3('0x32')](function(){return setRelationship(_0x2c1c30,_0x34af5c,_0x5074b2,'contacts');})[_0x53e3('0x32')](function(){return getServerInfo(_0x2c1c30);})[_0x53e3('0x32')](function(_0x103413){var _0x543e33=parseInt(_0x103413[_0x53e3('0x6a')][_0x53e3('0x6b')](0x0));var _0x450ad3=util[_0x53e3('0x2f')](_0x53e3('0x77'),_0x33e35b[_0x53e3('0x59')],_0x5074b2['id']);if(_0x543e33>0x6){_0x450ad3=util['format'](_0x53e3('0x6c'),_0x33e35b[_0x53e3('0x59')],_0x5074b2['id']);}logger[_0x53e3('0xe')](_0x53e3('0x73'),_0x53e3('0x6d'));emit(util[_0x53e3('0x2f')]('user:%s',_0x285a06[_0x53e3('0x1d')]),_0x53e3('0x6f'),{'uri':_0x450ad3});})[_0x53e3('0x78')](function(_0x520bba){logger[_0x53e3('0x70')]('[OUTBOUND]',JSON[_0x53e3('0x24')](_0x520bba));});};exports['abandoned']=function(_0x2c2584,_0x429d93,_0x5aca74,_0x3e1061,_0x4a8593,_0x2e6772){var _0x14a2cd,_0xe66956,_0xf2101a,_0x33221c;_0x2e6772[_0x53e3('0x59')]=intUtil['stripTrailingSlash'](_0x2e6772['remoteUri']);_0x2e6772['serverUrl']=intUtil[_0x53e3('0x5a')](_0x2e6772[_0x53e3('0x5b')]);def[_0x53e3('0x79')]=util[_0x53e3('0x2f')](_0x53e3('0x5c'),_0x2e6772[_0x53e3('0x59')]);if(_0x4a8593&&_0x4a8593[_0x53e3('0x5d')]){logger[_0x53e3('0xe')]('[ABANDONED]','Recording\x20is\x20enabled!');_0x429d93[_0x53e3('0x60')]=util[_0x53e3('0x2f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2e6772[_0x53e3('0x5b')],_0x429d93[_0x53e3('0x61')],md5(_0x429d93['uniqueid']));}else{_0x429d93['recordingURL']='';}return getConnection(_0x2e6772)['then'](function(_0x435f11){_0x33221c=_0x435f11;if(!_[_0x53e3('0x2b')](_0x3e1061)){return getUser(_0x2e6772,_0x3e1061[_0x53e3('0x1d')],_0x33221c);}else{return getUser(_0x2e6772,null,_0x33221c);}})[_0x53e3('0x32')](function(_0x2914a8){_0x14a2cd=_0x2914a8;logger[_0x53e3('0xe')](_0x53e3('0x62'),_0x14a2cd['id']);return getEndUser(_0x2e6772,_0x429d93[_0x53e3('0x63')],_0x429d93['calleridnum'],_0x33221c);})[_0x53e3('0x32')](function(_0x21431c){_0xe66956=_0x21431c;logger[_0x53e3('0xe')](_0x53e3('0x64'),_0xe66956['id']);return getTicket(_0x2e6772,_0x14a2cd,_0xe66956,_0x5aca74,_0x429d93,_0x5aca74[_0x53e3('0x7a')],_0x33221c,'Inbound');})[_0x53e3('0x32')](function(_0x2f57ef){_0xf2101a=_0x2f57ef;logger[_0x53e3('0xe')](_0x53e3('0x66'));logger[_0x53e3('0xe')](_0x53e3('0x67'),_0xf2101a['id']);return setRelationship(_0x33221c,_0x14a2cd,_0xf2101a,_0x53e3('0x68'));})[_0x53e3('0x32')](function(){return setRelationship(_0x33221c,_0xe66956,_0xf2101a,_0x53e3('0x69'));})[_0x53e3('0x32')](function(){return getServerInfo(_0x33221c);})[_0x53e3('0x78')](function(_0x5ea5bf){logger['error'](_0x53e3('0x7b'),JSON[_0x53e3('0x24')](_0x5ea5bf));});}; \ No newline at end of file +var _0xf1a9=['date_start','toISOString','slice','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','direction','length','forEach','push','idField','variableName','set_entry','JSON','Calls','format','Basic\x20%s','apiKey','base64','get_server_info','stringify','isNil','Getting\x20agent\x20with\x20name','get_entry_list','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','entry_list','find','name_value_list','value','Agent\x20found!','resolve','user_name','Searching\x20enduser\x20with\x20phone','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','type','string','nameField','toLowerCase','content','toString','customField','custom_fields','variable','customVariable','Variable','username','PLAIN','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','set_relationship','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','recordingFormat','none','Outbound','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[OUTBOUND]','abandoned','uri','monitor_format','Fields','contacts','lodash','request-promise','util','ioredis','./util','../../../../config/environment','sugarcrm','defaults','redis','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','getString','assigned_user_id','created_by','description','Descriptions'];(function(_0x27a8d1,_0x205937){var _0xb33677=function(_0x3c2599){while(--_0x3c2599){_0x27a8d1['push'](_0x27a8d1['shift']());}};_0xb33677(++_0x205937);}(_0xf1a9,0xd9));var _0x9f1a=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xf1a9[_0x5037ab];return _0x512adb;};'use strict';var _=require(_0x9f1a('0x0'));var rp=require(_0x9f1a('0x1'));var BPromise=require('bluebird');var md5=require('md5');var util=require(_0x9f1a('0x2'));var Redis=require(_0x9f1a('0x3'));var intUtil=require(_0x9f1a('0x4'));var config=require(_0x9f1a('0x5'));var logger=require('../../../../config/logger')(_0x9f1a('0x6'));config['redis']=_[_0x9f1a('0x7')](config[_0x9f1a('0x8')],{'host':_0x9f1a('0x9'),'port':0x18eb});var io=require(_0x9f1a('0xa'))(new Redis(config[_0x9f1a('0x8')]));var def={'method':_0x9f1a('0xb'),'json':!![]};function emit(_0x11846e,_0x22f8ac,_0x21af09){io['to'](_0x11846e)[_0x9f1a('0xc')](_0x22f8ac,_0x21af09);}function getTicket(_0x36ab09,_0x1823a9,_0x5d2a9a,_0x4b23c7,_0x287399,_0x191d4f,_0x4882de,_0xccf7b2){logger[_0x9f1a('0xd')](_0x9f1a('0xe'));var _0x572ce6=new Date();var _0x2d2054=[{'name':_0x9f1a('0xf'),'value':intUtil[_0x9f1a('0x10')](_0x4b23c7['Subjects'],_0x287399,'\x20')},{'name':_0x9f1a('0x11'),'value':_0x1823a9['id']},{'name':_0x9f1a('0x12'),'value':_0x1823a9['id']},{'name':_0x9f1a('0x13'),'value':intUtil[_0x9f1a('0x10')](_0x4b23c7[_0x9f1a('0x14')],_0x287399,'\x0a')},{'name':_0x9f1a('0x15'),'value':_0x572ce6[_0x9f1a('0x16')]()[_0x9f1a('0x17')](0x0,0x13)['replace']('T','\x20')},{'name':_0x9f1a('0x18'),'value':'0'},{'name':_0x9f1a('0x19'),'value':'15'},{'name':_0x9f1a('0x1a'),'value':_0x5d2a9a['id']},{'name':_0x9f1a('0x1b'),'value':_0x9f1a('0x1c')},{'name':_0x9f1a('0x1d'),'value':_0x5d2a9a[_0x9f1a('0xf')]},{'name':_0x9f1a('0x1e'),'value':_0xccf7b2}];if(_0x191d4f[_0x9f1a('0x1f')]){_[_0x9f1a('0x20')](_0x191d4f,function(_0x45d3cb){if(_0x287399[_0x45d3cb['variableName']]){_0x2d2054[_0x9f1a('0x21')]({'name':_0x45d3cb[_0x9f1a('0x22')],'value':_0x287399[_0x45d3cb[_0x9f1a('0x23')]]});}});}return request({'form':{'method':_0x9f1a('0x24'),'input_type':'JSON','response_type':_0x9f1a('0x25'),'rest_data':JSON['stringify']({'session':_0x4882de['id'],'module_name':_0x9f1a('0x26'),'name_value_list':_0x2d2054})}});}function getAuth(_0x16e904){return util[_0x9f1a('0x27')](_0x9f1a('0x28'),new Buffer(_0x16e904[_0x9f1a('0x29')]+':X')['toString'](_0x9f1a('0x2a')));}function getServerInfo(_0x2fcbcf){return request({'form':{'method':_0x9f1a('0x2b'),'input_type':_0x9f1a('0x25'),'response_type':_0x9f1a('0x25'),'rest_data':JSON[_0x9f1a('0x2c')]({'session':_0x2fcbcf['id']})}});}function getUser(_0x10d88d,_0x338ca3,_0x515825){if(!_[_0x9f1a('0x2d')](_0x338ca3)){logger[_0x9f1a('0xd')](_0x9f1a('0x2e'),_0x338ca3);return request({'form':{'method':_0x9f1a('0x2f'),'input_type':_0x9f1a('0x25'),'response_type':_0x9f1a('0x25'),'rest_data':JSON[_0x9f1a('0x2c')]({'session':_0x515825['id'],'module_name':'Employees','query':util[_0x9f1a('0x27')](_0x9f1a('0x30'),_0x338ca3),'order_by':'','offset':'0','select_fields':['id',_0x9f1a('0xf'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x9f1a('0x31')](function(_0x32a246){if(_0x32a246[_0x9f1a('0x32')][_0x9f1a('0x1f')]){var _0x370d40=_[_0x9f1a('0x33')](_0x32a246[_0x9f1a('0x32')],function(_0x3f82f1){return _0x3f82f1[_0x9f1a('0x34')]['user_name'][_0x9f1a('0x35')]===_0x338ca3;});if(_0x370d40){logger[_0x9f1a('0xd')](_0x9f1a('0x36'));return BPromise[_0x9f1a('0x37')]({'id':_0x370d40[_0x9f1a('0x34')]['id'][_0x9f1a('0x35')],'name':_0x370d40[_0x9f1a('0x34')][_0x9f1a('0xf')][_0x9f1a('0x35')]});}}logger[_0x9f1a('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x9f1a('0x37')]({'id':_0x515825[_0x9f1a('0x34')]['user_id'][_0x9f1a('0x35')],'name':_0x515825[_0x9f1a('0x34')][_0x9f1a('0x38')][_0x9f1a('0x35')]});});}else{logger[_0x9f1a('0xd')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0x9f1a('0x37')]({'id':_0x515825[_0x9f1a('0x34')]['user_id']['value'],'name':_0x515825['name_value_list'][_0x9f1a('0x38')]['value']});}}function getEndUser(_0x9d133b,_0x47013d,_0x274f48,_0xcea2){logger[_0x9f1a('0xd')](_0x9f1a('0x39'),_0x274f48);return request({'form':{'method':'get_entry_list','input_type':_0x9f1a('0x25'),'response_type':_0x9f1a('0x25'),'rest_data':JSON[_0x9f1a('0x2c')]({'session':_0xcea2['id'],'module_name':_0x9f1a('0x1c'),'query':util[_0x9f1a('0x27')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x274f48),'order_by':'','offset':'0','select_fields':['id',_0x9f1a('0xf'),_0x9f1a('0x3a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x9f1a('0x31')](function(_0xa1aa27){if(_0xa1aa27[_0x9f1a('0x32')][_0x9f1a('0x1f')]){var _0x48613d=_['find'](_0xa1aa27[_0x9f1a('0x32')],function(_0x686115){return _0x686115[_0x9f1a('0x34')]['phone_home'][_0x9f1a('0x35')]===_0x274f48;});if(_0x48613d){logger['info'](_0x9f1a('0x3b'));return BPromise['resolve']({'id':_0x48613d['name_value_list']['id'][_0x9f1a('0x35')],'name':_0x48613d[_0x9f1a('0x34')]['name'][_0x9f1a('0x35')],'phone':_0x48613d[_0x9f1a('0x34')][_0x9f1a('0x3a')][_0x9f1a('0x35')]});}}else{logger[_0x9f1a('0xd')](_0x9f1a('0x3c'));return request({'form':{'method':'set_entry','input_type':_0x9f1a('0x25'),'response_type':_0x9f1a('0x25'),'rest_data':JSON[_0x9f1a('0x2c')]({'session':_0xcea2['id'],'module_name':_0x9f1a('0x1c'),'name_value_list':[{'name':_0x9f1a('0x3d'),'value':_0x47013d!==_0x9f1a('0x3e')?_0x47013d:util[_0x9f1a('0x27')](_0x9f1a('0x3f'),_0x274f48)},{'name':_0x9f1a('0x3a'),'value':_0x274f48}]})}})[_0x9f1a('0x31')](function(_0x55f425){logger[_0x9f1a('0xd')](_0x9f1a('0x40'));return BPromise[_0x9f1a('0x37')]({'id':_0x55f425['id'],'name':_0x55f425['entry_list']['first_name'][_0x9f1a('0x35')],'phone':_0x55f425[_0x9f1a('0x32')]['phone_home'][_0x9f1a('0x35')]});});}});}function request(_0x2f5849){logger[_0x9f1a('0x41')](_0x9f1a('0x42'),JSON['stringify'](_0x2f5849));return rp(_[_0x9f1a('0x43')](def,_0x2f5849));}function getTags(_0x2f6ccc,_0x2d16a1){var _0x415613=[];if(_0x2f6ccc&&_0x2f6ccc[_0x9f1a('0x1f')]>0x0){_0x415613=_[_0x9f1a('0x44')](_0x2f6ccc,_0x2d16a1);}return _0x415613;}function getCustomFields(_0x280567,_0x35b882){var _0x34268e=[];var _0x5c3b70={'custom_fields':[]};if(_0x280567[_0x9f1a('0x1f')]>0x0){_[_0x9f1a('0x20')](_0x280567,function(_0x1053f3){if(_0x1053f3[_0x9f1a('0x45')]===_0x9f1a('0x46')&&_0x1053f3[_0x9f1a('0x47')]&&!_0x1053f3['customField']){_0x5c3b70[_0x1053f3[_0x9f1a('0x47')][_0x9f1a('0x48')]()]=_0x1053f3[_0x9f1a('0x49')][_0x9f1a('0x4a')]();}else if(_0x1053f3[_0x9f1a('0x45')]===_0x9f1a('0x46')&&_0x1053f3[_0x9f1a('0x22')]&&_0x1053f3[_0x9f1a('0x4b')]){_0x5c3b70[_0x9f1a('0x4c')]['push']({'id':_0x1053f3[_0x9f1a('0x22')],'value':_0x1053f3[_0x9f1a('0x49')][_0x9f1a('0x4a')]()});}else if(_0x1053f3[_0x9f1a('0x45')]===_0x9f1a('0x4d')&&_0x1053f3[_0x9f1a('0x23')]&&_0x1053f3['idField']&&_0x1053f3[_0x9f1a('0x4b')]){_0x35b882[_0x1053f3[_0x9f1a('0x23')]]&&_0x5c3b70[_0x9f1a('0x4c')][_0x9f1a('0x21')]({'id':_0x1053f3[_0x9f1a('0x22')],'value':_0x35b882[_0x1053f3['variableName']][_0x9f1a('0x4a')]()});}else if(_0x1053f3[_0x9f1a('0x45')]===_0x9f1a('0x4e')&&_0x1053f3[_0x9f1a('0x4f')]&&_0x1053f3['Variable'][_0x9f1a('0xf')]&&_0x1053f3[_0x9f1a('0x22')]&&_0x1053f3[_0x9f1a('0x4b')]){_0x35b882[_0x1053f3[_0x9f1a('0x4f')][_0x9f1a('0xf')]['toLowerCase']()]&&_0x5c3b70[_0x9f1a('0x4c')]['push']({'id':_0x1053f3['idField'],'value':_0x35b882[_0x1053f3[_0x9f1a('0x4f')][_0x9f1a('0xf')][_0x9f1a('0x48')]()][_0x9f1a('0x4a')]()});}});}return _0x5c3b70;}function getConnection(_0x26f025){return request({'method':_0x9f1a('0xb'),'form':{'method':'login','input_type':_0x9f1a('0x25'),'response_type':_0x9f1a('0x25'),'rest_data':JSON[_0x9f1a('0x2c')]({'user_auth':{'user_name':_0x26f025[_0x9f1a('0x50')],'password':_0x26f025['password'],'encryption':_0x9f1a('0x51')},'application':_0x9f1a('0x52')})}})[_0x9f1a('0x31')](function(_0x1d82af){var _0x97dec2=_0x1d82af;if(_0x97dec2['id']){def['sessionID']=_0x97dec2['id'];return BPromise[_0x9f1a('0x37')](_0x97dec2);}else{throw new Error(util[_0x9f1a('0x27')](_0x9f1a('0x53'),_0x26f025['id']));}});}function setRelationship(_0xd78786,_0x16b964,_0x2c2a42,_0x33b326){return request({'form':{'method':_0x9f1a('0x54'),'input_type':_0x9f1a('0x25'),'response_type':_0x9f1a('0x25'),'rest_data':JSON[_0x9f1a('0x2c')]({'session':_0xd78786['id'],'module_name':_0x9f1a('0x26'),'module_id':_0x2c2a42['id'],'link_field_name':_0x33b326,'related_ids':[_0x16b964['id']]})}});}exports['queue']=function(_0x572048,_0xf1c6fd,_0x37b933,_0x26775f,_0x2208a2,_0x55a0ce){var _0x283ab3,_0x57ce84,_0x2ec3eb,_0x467f42;_0x55a0ce[_0x9f1a('0x55')]=intUtil[_0x9f1a('0x56')](_0x55a0ce[_0x9f1a('0x55')]);_0x55a0ce[_0x9f1a('0x57')]=intUtil[_0x9f1a('0x56')](_0x55a0ce[_0x9f1a('0x57')]);def['uri']=util[_0x9f1a('0x27')](_0x9f1a('0x58'),_0x55a0ce[_0x9f1a('0x55')]);if(_0x2208a2&&_0x2208a2['monitor_format']){logger['info'](_0x9f1a('0x59'),_0x9f1a('0x5a'));_0xf1c6fd[_0x9f1a('0x5b')]=util['format'](_0x9f1a('0x5c'),_0x55a0ce[_0x9f1a('0x57')],_0xf1c6fd['uniqueid'],md5(_0xf1c6fd[_0x9f1a('0x5d')]));}else{_0xf1c6fd[_0x9f1a('0x5b')]='';}return getConnection(_0x55a0ce)['then'](function(_0x32fc43){_0x467f42=_0x32fc43;return getUser(_0x55a0ce,_0x26775f[_0x9f1a('0xf')],_0x467f42);})[_0x9f1a('0x31')](function(_0x17b244){_0x283ab3=_0x17b244;logger['info'](_0x9f1a('0x5e'),_0x283ab3['id']);return getEndUser(_0x55a0ce,_0xf1c6fd[_0x9f1a('0x5f')],_0xf1c6fd[_0x9f1a('0x60')],_0x467f42);})[_0x9f1a('0x31')](function(_0x3e1d90){_0x57ce84=_0x3e1d90;logger[_0x9f1a('0xd')](_0x9f1a('0x61'),_0x57ce84['id']);return getTicket(_0x55a0ce,_0x283ab3,_0x57ce84,_0x37b933,_0xf1c6fd,_0x37b933['Fields'],_0x467f42,_0x9f1a('0x62'));})[_0x9f1a('0x31')](function(_0x341c30){_0x2ec3eb=_0x341c30;logger[_0x9f1a('0xd')](_0x9f1a('0x63'));logger[_0x9f1a('0xd')](_0x9f1a('0x64'),_0x2ec3eb['id']);return setRelationship(_0x467f42,_0x283ab3,_0x2ec3eb,_0x9f1a('0x65'));})[_0x9f1a('0x31')](function(){return setRelationship(_0x467f42,_0x57ce84,_0x2ec3eb,'contacts');})[_0x9f1a('0x31')](function(){return getServerInfo(_0x467f42);})[_0x9f1a('0x31')](function(_0x23d061){var _0x41277a=parseInt(_0x23d061['version']['charAt'](0x0));var _0x3f5a19=util['format'](_0x9f1a('0x66'),_0x55a0ce[_0x9f1a('0x55')],_0x2ec3eb['id']);if(_0x41277a>0x6){_0x3f5a19=util[_0x9f1a('0x27')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x55a0ce[_0x9f1a('0x55')],_0x2ec3eb['id']);}logger[_0x9f1a('0xd')](_0x9f1a('0x59'),_0x9f1a('0x67'));emit(util[_0x9f1a('0x27')](_0x9f1a('0x68'),_0x26775f[_0x9f1a('0xf')]),_0x9f1a('0x69'),{'uri':_0x3f5a19});})[_0x9f1a('0x6a')](function(_0x109389){logger[_0x9f1a('0x6b')]('[QUEUE]',JSON[_0x9f1a('0x2c')](_0x109389));});};exports['outbound']=function(_0xbc8eee,_0x3ed816,_0x2211b7,_0x47ee4a,_0x1c74b3,_0x326ba6,_0x221b12){var _0xfe689,_0x3851ec,_0x2b973d,_0x1a6352;_0x326ba6[_0x9f1a('0x55')]=intUtil[_0x9f1a('0x56')](_0x326ba6[_0x9f1a('0x55')]);_0x326ba6[_0x9f1a('0x57')]=intUtil['stripTrailingSlash'](_0x326ba6[_0x9f1a('0x57')]);def['uri']=util[_0x9f1a('0x27')](_0x9f1a('0x58'),_0x326ba6['remoteUri']);if(_0x221b12&&_0x221b12[_0x9f1a('0x6c')]&&_0x221b12[_0x9f1a('0x6c')]!==_0x9f1a('0x6d')){logger[_0x9f1a('0xd')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x3ed816[_0x9f1a('0x5b')]=util['format'](_0x9f1a('0x5c'),_0x326ba6[_0x9f1a('0x57')],_0x3ed816[_0x9f1a('0x5d')],md5(_0x3ed816[_0x9f1a('0x5d')]));}return getConnection(_0x326ba6)[_0x9f1a('0x31')](function(_0x473378){_0x1a6352=_0x473378;return getUser(_0x326ba6,_0x47ee4a[_0x9f1a('0xf')],_0x1a6352);})[_0x9f1a('0x31')](function(_0x5bbbb6){_0xfe689=_0x5bbbb6;logger[_0x9f1a('0xd')](_0x9f1a('0x5e'),_0xfe689['id']);return getEndUser(_0x326ba6,_0x3ed816['destcalleridname'],_0x3ed816['destcalleridnum'],_0x1a6352);})[_0x9f1a('0x31')](function(_0x300333){_0x3851ec=_0x300333;logger[_0x9f1a('0xd')](_0x9f1a('0x61'),_0x3851ec['id']);return getTicket(_0x326ba6,_0xfe689,_0x3851ec,_0x2211b7,_0x3ed816,_0x2211b7['Fields'],_0x1a6352,_0x9f1a('0x6e'));})[_0x9f1a('0x31')](function(_0x5897ea){_0x2b973d=_0x5897ea;logger['info'](_0x9f1a('0x63'));logger[_0x9f1a('0xd')]('The\x20Ticket\x20ID\x20is:',_0x2b973d['id']);return setRelationship(_0x1a6352,_0xfe689,_0x2b973d,_0x9f1a('0x65'));})['then'](function(){return setRelationship(_0x1a6352,_0x3851ec,_0x2b973d,'contacts');})[_0x9f1a('0x31')](function(){return getServerInfo(_0x1a6352);})['then'](function(_0x5a4f7e){var _0x120ff9=parseInt(_0x5a4f7e['version'][_0x9f1a('0x6f')](0x0));var _0x12ae1c=util[_0x9f1a('0x27')](_0x9f1a('0x66'),_0x326ba6['remoteUri'],_0x2b973d['id']);if(_0x120ff9>0x6){_0x12ae1c=util['format'](_0x9f1a('0x70'),_0x326ba6[_0x9f1a('0x55')],_0x2b973d['id']);}logger[_0x9f1a('0xd')](_0x9f1a('0x71'),_0x9f1a('0x67'));emit(util[_0x9f1a('0x27')](_0x9f1a('0x68'),_0x47ee4a['name']),_0x9f1a('0x69'),{'uri':_0x12ae1c});})[_0x9f1a('0x6a')](function(_0xac669){logger['error'](_0x9f1a('0x71'),JSON[_0x9f1a('0x2c')](_0xac669));});};exports[_0x9f1a('0x72')]=function(_0x3952d2,_0x57098f,_0x14b15b,_0x3ecf0e,_0x1459ec,_0x20eb21){var _0x393a81,_0x34d693,_0x4d664d,_0x343349;_0x20eb21[_0x9f1a('0x55')]=intUtil[_0x9f1a('0x56')](_0x20eb21[_0x9f1a('0x55')]);_0x20eb21[_0x9f1a('0x57')]=intUtil[_0x9f1a('0x56')](_0x20eb21[_0x9f1a('0x57')]);def[_0x9f1a('0x73')]=util[_0x9f1a('0x27')]('%s/service/v4_1/rest.php',_0x20eb21[_0x9f1a('0x55')]);if(_0x1459ec&&_0x1459ec[_0x9f1a('0x74')]){logger[_0x9f1a('0xd')]('[ABANDONED]',_0x9f1a('0x5a'));_0x57098f[_0x9f1a('0x5b')]=util[_0x9f1a('0x27')](_0x9f1a('0x5c'),_0x20eb21[_0x9f1a('0x57')],_0x57098f[_0x9f1a('0x5d')],md5(_0x57098f[_0x9f1a('0x5d')]));}else{_0x57098f[_0x9f1a('0x5b')]='';}return getConnection(_0x20eb21)['then'](function(_0x3f5f6c){_0x343349=_0x3f5f6c;if(!_[_0x9f1a('0x2d')](_0x3ecf0e)){return getUser(_0x20eb21,_0x3ecf0e[_0x9f1a('0xf')],_0x343349);}else{return getUser(_0x20eb21,null,_0x343349);}})['then'](function(_0x1a25ea){_0x393a81=_0x1a25ea;logger[_0x9f1a('0xd')](_0x9f1a('0x5e'),_0x393a81['id']);return getEndUser(_0x20eb21,_0x57098f[_0x9f1a('0x5f')],_0x57098f[_0x9f1a('0x60')],_0x343349);})[_0x9f1a('0x31')](function(_0x52e025){_0x34d693=_0x52e025;logger[_0x9f1a('0xd')](_0x9f1a('0x61'),_0x34d693['id']);return getTicket(_0x20eb21,_0x393a81,_0x34d693,_0x14b15b,_0x57098f,_0x14b15b[_0x9f1a('0x75')],_0x343349,_0x9f1a('0x62'));})[_0x9f1a('0x31')](function(_0xbf3e32){_0x4d664d=_0xbf3e32;logger[_0x9f1a('0xd')](_0x9f1a('0x63'));logger[_0x9f1a('0xd')](_0x9f1a('0x64'),_0x4d664d['id']);return setRelationship(_0x343349,_0x393a81,_0x4d664d,'users');})['then'](function(){return setRelationship(_0x343349,_0x34d693,_0x4d664d,_0x9f1a('0x76'));})[_0x9f1a('0x31')](function(){return getServerInfo(_0x343349);})[_0x9f1a('0x6a')](function(_0x204c04){logger[_0x9f1a('0x6b')]('[ABANDONED]',JSON['stringify'](_0x204c04));});}; \ 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 268943c..c5906b3 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 _0xdd71=['getString','sortBy','length','type','push','content','variableName','toString','customVariable','Variable','name','toLowerCase','format','key','keyContent','keyType','variable','%s:\x20%s','stripTrailingSlash','slice','lastIndexOf','validateEmail','isNil','test','lodash','util'];(function(_0x4e8521,_0x1c8de0){var _0x3cdd0a=function(_0x5bd0eb){while(--_0x5bd0eb){_0x4e8521['push'](_0x4e8521['shift']());}};_0x3cdd0a(++_0x1c8de0);}(_0xdd71,0xb4));var _0x1dd7=function(_0x20b2a3,_0x24f1b4){_0x20b2a3=_0x20b2a3-0x0;var _0x47ca0c=_0xdd71[_0x20b2a3];return _0x47ca0c;};'use strict';var _=require(_0x1dd7('0x0'));var util=require(_0x1dd7('0x1'));exports[_0x1dd7('0x2')]=function(_0x1bab9d,_0x4b92fd,_0x32be09){var _0x3da5ef=[];if(_0x1bab9d['length']>0x0){var _0x53e4d0=_[_0x1dd7('0x3')](_0x1bab9d,['id']);for(var _0x201e56=0x0;_0x201e56<_0x53e4d0[_0x1dd7('0x4')];_0x201e56++){var _0x46ad74=_0x53e4d0[_0x201e56];if(_0x46ad74[_0x1dd7('0x5')]==='string'){_0x3da5ef[_0x1dd7('0x6')](_0x46ad74[_0x1dd7('0x7')]);}else if(_0x46ad74[_0x1dd7('0x5')]==='variable'&&_0x46ad74[_0x1dd7('0x8')]){_0x4b92fd[_0x46ad74['variableName']]&&_0x3da5ef[_0x1dd7('0x6')](_0x4b92fd[_0x46ad74[_0x1dd7('0x8')]][_0x1dd7('0x9')]());}else if(_0x46ad74['type']===_0x1dd7('0xa')&&_0x46ad74['Variable']&&_0x46ad74[_0x1dd7('0xb')][_0x1dd7('0xc')]){_0x4b92fd[_0x46ad74['Variable'][_0x1dd7('0xc')][_0x1dd7('0xd')]()]&&_0x3da5ef[_0x1dd7('0x6')](_0x4b92fd[_0x46ad74[_0x1dd7('0xb')][_0x1dd7('0xc')][_0x1dd7('0xd')]()]['toString']());}else if(_0x46ad74[_0x1dd7('0x5')]==='keyValue'){if(_0x46ad74['keyType']==='string'&&_0x46ad74['key']){_0x3da5ef[_0x1dd7('0x6')](util[_0x1dd7('0xe')]('%s:\x20%s',_0x46ad74[_0x1dd7('0xf')],_0x46ad74[_0x1dd7('0x10')]));}else if(_0x46ad74[_0x1dd7('0x11')]===_0x1dd7('0x12')&&_0x46ad74[_0x1dd7('0x8')]&&_0x46ad74[_0x1dd7('0xf')]){_0x4b92fd[_0x46ad74[_0x1dd7('0x8')]]&&_0x3da5ef['push'](util[_0x1dd7('0xe')](_0x1dd7('0x13'),_0x46ad74[_0x1dd7('0xf')],_0x4b92fd[_0x46ad74[_0x1dd7('0x8')]]));}else if(_0x46ad74[_0x1dd7('0x11')]==='customVariable'&&_0x46ad74[_0x1dd7('0xb')]&&_0x46ad74['Variable'][_0x1dd7('0xc')]&&_0x46ad74[_0x1dd7('0xf')]){_0x4b92fd[_0x46ad74[_0x1dd7('0xb')][_0x1dd7('0xc')][_0x1dd7('0xd')]()]&&_0x3da5ef[_0x1dd7('0x6')](util[_0x1dd7('0xe')](_0x1dd7('0x13'),_0x46ad74[_0x1dd7('0xf')],_0x4b92fd[_0x46ad74[_0x1dd7('0xb')]['name'][_0x1dd7('0xd')]()]));}}}}return _0x3da5ef['join'](_0x32be09);};exports[_0x1dd7('0x14')]=function(_0x2180a0){var _0x2409ea=_0x2180a0[_0x1dd7('0x15')](-0x1);if(_0x2409ea==='/'){_0x2180a0=_0x2180a0['substring'](0x0,_0x2180a0[_0x1dd7('0x16')](_0x2409ea));}return _0x2180a0;};exports[_0x1dd7('0x17')]=function(_0xebd815){if(!_[_0x1dd7('0x18')](_0xebd815)&&_0xebd815!==''){var _0x5a4614=/^(([^<>()\[\]\\.,;:\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 _0x5a4614[_0x1dd7('0x19')](String(_0xebd815)['toLowerCase']());}else{return![];}}; \ No newline at end of file +var _0x0c81=['keyValue','keyType','key','format','%s:\x20%s','keyContent','variable','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','lodash','util','getString','length','sortBy','type','string','variableName','push','customVariable','Variable','name','toLowerCase'];(function(_0x405a51,_0x487278){var _0x395328=function(_0x19ffad){while(--_0x19ffad){_0x405a51['push'](_0x405a51['shift']());}};_0x395328(++_0x487278);}(_0x0c81,0x145));var _0x10c8=function(_0x474a72,_0x439f5a){_0x474a72=_0x474a72-0x0;var _0x304966=_0x0c81[_0x474a72];return _0x304966;};'use strict';var _=require(_0x10c8('0x0'));var util=require(_0x10c8('0x1'));exports[_0x10c8('0x2')]=function(_0x58bb9b,_0x1e7db5,_0x2d2ad2){var _0x29da51=[];if(_0x58bb9b[_0x10c8('0x3')]>0x0){var _0xa63150=_[_0x10c8('0x4')](_0x58bb9b,['id']);for(var _0x14f5d3=0x0;_0x14f5d3<_0xa63150[_0x10c8('0x3')];_0x14f5d3++){var _0x16c568=_0xa63150[_0x14f5d3];if(_0x16c568[_0x10c8('0x5')]===_0x10c8('0x6')){_0x29da51['push'](_0x16c568['content']);}else if(_0x16c568[_0x10c8('0x5')]==='variable'&&_0x16c568['variableName']){_0x1e7db5[_0x16c568[_0x10c8('0x7')]]&&_0x29da51[_0x10c8('0x8')](_0x1e7db5[_0x16c568['variableName']]['toString']());}else if(_0x16c568[_0x10c8('0x5')]===_0x10c8('0x9')&&_0x16c568['Variable']&&_0x16c568[_0x10c8('0xa')]['name']){_0x1e7db5[_0x16c568['Variable'][_0x10c8('0xb')]['toLowerCase']()]&&_0x29da51[_0x10c8('0x8')](_0x1e7db5[_0x16c568[_0x10c8('0xa')]['name'][_0x10c8('0xc')]()]['toString']());}else if(_0x16c568[_0x10c8('0x5')]===_0x10c8('0xd')){if(_0x16c568[_0x10c8('0xe')]==='string'&&_0x16c568[_0x10c8('0xf')]){_0x29da51[_0x10c8('0x8')](util[_0x10c8('0x10')](_0x10c8('0x11'),_0x16c568[_0x10c8('0xf')],_0x16c568[_0x10c8('0x12')]));}else if(_0x16c568[_0x10c8('0xe')]===_0x10c8('0x13')&&_0x16c568[_0x10c8('0x7')]&&_0x16c568[_0x10c8('0xf')]){_0x1e7db5[_0x16c568[_0x10c8('0x7')]]&&_0x29da51['push'](util[_0x10c8('0x10')](_0x10c8('0x11'),_0x16c568[_0x10c8('0xf')],_0x1e7db5[_0x16c568[_0x10c8('0x7')]]));}else if(_0x16c568['keyType']===_0x10c8('0x9')&&_0x16c568[_0x10c8('0xa')]&&_0x16c568['Variable'][_0x10c8('0xb')]&&_0x16c568[_0x10c8('0xf')]){_0x1e7db5[_0x16c568[_0x10c8('0xa')]['name'][_0x10c8('0xc')]()]&&_0x29da51[_0x10c8('0x8')](util[_0x10c8('0x10')](_0x10c8('0x11'),_0x16c568[_0x10c8('0xf')],_0x1e7db5[_0x16c568[_0x10c8('0xa')][_0x10c8('0xb')]['toLowerCase']()]));}}}}return _0x29da51['join'](_0x2d2ad2);};exports[_0x10c8('0x14')]=function(_0x509743){var _0x21ae28=_0x509743[_0x10c8('0x15')](-0x1);if(_0x21ae28==='/'){_0x509743=_0x509743[_0x10c8('0x16')](0x0,_0x509743[_0x10c8('0x17')](_0x21ae28));}return _0x509743;};exports[_0x10c8('0x18')]=function(_0xde5292){if(!_[_0x10c8('0x19')](_0xde5292)&&_0xde5292!==''){var _0x54484c=/^(([^<>()\[\]\\.,;:\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 _0x54484c['test'](String(_0xde5292)[_0x10c8('0xc')]());}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 ac17307..4103ed7 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 _0xedd9=['success','resolve','result','stringify','error','catch','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','info','GET','%s/webservice.php','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','length','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','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!','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','getEndUser','accessKey','login','token','getConnection','[HTTP]','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','serverUrl','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','destcalleridname','abandoned','calleridname','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','emit','forEach','string','idField','content','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase','Creating\x20new\x20ticket...','merge','getString','Subjects','POST','format','remoteUri','create','username','sessionName','HelpDesk','then'];(function(_0x3a511f,_0x546b37){var _0x5e557e=function(_0x147090){while(--_0x147090){_0x3a511f['push'](_0x3a511f['shift']());}};_0x5e557e(++_0x546b37);}(_0xedd9,0xfc));var _0x9edd=function(_0x30a2d6,_0x43201d){_0x30a2d6=_0x30a2d6-0x0;var _0x10bff2=_0xedd9[_0x30a2d6];return _0x10bff2;};'use strict';var _=require('lodash');var rp=require(_0x9edd('0x0'));var BPromise=require(_0x9edd('0x1'));var md5=require(_0x9edd('0x2'));var util=require(_0x9edd('0x3'));var Redis=require(_0x9edd('0x4'));var intUtil=require(_0x9edd('0x5'));var config=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('vTiger');config[_0x9edd('0x8')]=_[_0x9edd('0x9')](config[_0x9edd('0x8')],{'host':_0x9edd('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9edd('0x8')]));function emit(_0x571af9,_0x172522,_0x190185){io['to'](_0x571af9)[_0x9edd('0xb')](_0x172522,_0x190185);}function getCustomFields(_0x3280fd,_0x49d5e3){var _0x494a24={};if(_0x3280fd['length']>0x0){_[_0x9edd('0xc')](_0x3280fd,function(_0x138767){if(_0x138767['type']===_0x9edd('0xd')&&_0x138767[_0x9edd('0xe')]){_0x494a24[_0x138767['idField']]=_0x138767[_0x9edd('0xf')][_0x9edd('0x10')]();}else if(_0x138767[_0x9edd('0x11')]===_0x9edd('0x12')&&_0x138767[_0x9edd('0x13')]&&_0x138767[_0x9edd('0xe')]&&_0x49d5e3[_0x138767[_0x9edd('0x13')]]){_0x494a24[_0x138767[_0x9edd('0xe')]]=_0x49d5e3[_0x138767['variableName']][_0x9edd('0x10')]();}else if(_0x138767[_0x9edd('0x11')]===_0x9edd('0x14')&&_0x138767[_0x9edd('0x15')]&&_0x138767[_0x9edd('0x15')][_0x9edd('0x16')]&&_0x138767[_0x9edd('0xe')]&&_0x49d5e3[_0x138767[_0x9edd('0x15')]['name'][_0x9edd('0x17')]()]){_0x494a24[_0x138767[_0x9edd('0xe')]]=_0x49d5e3[_0x138767[_0x9edd('0x15')]['name'][_0x9edd('0x17')]()][_0x9edd('0x10')]();}});}return _0x494a24;}function createTicket(_0x40ba32,_0x4d8f33,_0x43dc70,_0x5d879c,_0x2cdcef,_0x1083e4,_0x4bdb88){logger['info'](_0x9edd('0x18'));var _0x50338f=_[_0x9edd('0x19')]({'parent_id':'','assigned_user_id':_0x4d8f33['id'],'ticketpriorities':'Normal','ticketstatus':'Open','ticket_title':intUtil[_0x9edd('0x1a')](_0x5d879c[_0x9edd('0x1b')],_0x2cdcef,'\x20'),'description':intUtil['getString'](_0x5d879c['Descriptions'],_0x2cdcef,'\x0a'),'contact_id':_0x43dc70['id']},getCustomFields(_0x1083e4,_0x2cdcef));var _0x341d67={'method':_0x9edd('0x1c'),'uri':util[_0x9edd('0x1d')]('%s/webservice.php',_0x40ba32[_0x9edd('0x1e')]),'form':{'operation':_0x9edd('0x1f'),'username':_0x40ba32[_0x9edd('0x20')],'sessionName':_0x4bdb88[_0x9edd('0x21')],'elementType':_0x9edd('0x22'),'element':JSON['stringify'](_0x50338f)},'json':!![]};return request(_0x341d67)[_0x9edd('0x23')](function(_0xeaf55a){if(_0xeaf55a[_0x9edd('0x24')]){return BPromise[_0x9edd('0x25')]({'id':_0xeaf55a[_0x9edd('0x26')]['id']});}else{throw new Error(util['format']('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON[_0x9edd('0x27')](_0xeaf55a[_0x9edd('0x28')])));}})[_0x9edd('0x29')](function(_0x25e135){var _0x3c2227=_0x25e135['statusCode']||0x1f4;logger['error'](_0x9edd('0x2a'),_0x9edd('0x2b'),_0x3c2227,JSON[_0x9edd('0x27')](_0x25e135));});}function getUser(_0x52746a,_0x238b22,_0x28cfae){if(intUtil[_0x9edd('0x2c')](_0x238b22)){logger[_0x9edd('0x2d')]('Getting\x20agent\x20with\x20email',_0x238b22);return request({'method':_0x9edd('0x2e'),'uri':util[_0x9edd('0x1d')](_0x9edd('0x2f'),_0x52746a[_0x9edd('0x1e')]),'qs':{'operation':_0x9edd('0x30'),'username':_0x52746a[_0x9edd('0x20')],'sessionName':_0x28cfae[_0x9edd('0x21')],'query':util[_0x9edd('0x1d')](_0x9edd('0x31'),_0x238b22)},'json':!![]})[_0x9edd('0x23')](function(_0x4fd03f){if(_0x4fd03f[_0x9edd('0x24')]&&_0x4fd03f[_0x9edd('0x26')][_0x9edd('0x32')]){logger[_0x9edd('0x2d')]('Agent\x20found!');return BPromise[_0x9edd('0x25')]({'id':_0x4fd03f[_0x9edd('0x26')][0x0]['id'],'email':_0x4fd03f[_0x9edd('0x26')][0x0]['email1'],'name':_0x4fd03f[_0x9edd('0x26')][0x0][_0x9edd('0x33')]+'\x20'+_0x4fd03f[_0x9edd('0x26')][_0x9edd('0x34')]});}else{logger[_0x9edd('0x2d')](_0x9edd('0x35'));return BPromise[_0x9edd('0x25')]({'id':_0x28cfae[_0x9edd('0x36')],'email':_0x52746a[_0x9edd('0x20')],'name':_0x9edd('0x37')});}})[_0x9edd('0x29')](function(_0x42c1d9){var _0x27eb7e=_0x42c1d9[_0x9edd('0x38')]||0x1f4;logger['error'](_0x9edd('0x2a'),'getUser',_0x27eb7e,JSON[_0x9edd('0x27')](_0x42c1d9));});}else{logger[_0x9edd('0x2d')](_0x9edd('0x35'));return BPromise[_0x9edd('0x25')]({'id':_0x28cfae[_0x9edd('0x36')],'email':_0x52746a['username'],'name':_0x9edd('0x37')})[_0x9edd('0x29')](function(_0x2b3469){var _0x38e9be=_0x2b3469[_0x9edd('0x38')]||0x1f4;logger[_0x9edd('0x28')](_0x9edd('0x2a'),_0x9edd('0x39'),_0x38e9be,JSON[_0x9edd('0x27')](_0x2b3469));});}}function getEndUser(_0x35c16f,_0x51a54a,_0x231604,_0x56a228){logger[_0x9edd('0x2d')]('Searching\x20end\x20user\x20with\x20phone',_0x231604);return request({'method':_0x9edd('0x2e'),'uri':util[_0x9edd('0x1d')](_0x9edd('0x2f'),_0x35c16f['remoteUri']),'qs':{'operation':_0x9edd('0x30'),'username':_0x35c16f[_0x9edd('0x20')],'sessionName':_0x56a228[_0x9edd('0x21')],'query':util['format'](_0x9edd('0x3a'),_0x231604,_0x231604,_0x231604,_0x231604,_0x231604)},'json':!![]})['then'](function(_0x1fc4fb){if(_0x1fc4fb[_0x9edd('0x24')]&&_0x1fc4fb['result'][_0x9edd('0x32')]){logger[_0x9edd('0x2d')](_0x9edd('0x3b'));return BPromise[_0x9edd('0x25')]({'id':_0x1fc4fb['result'][0x0]['id'],'name':_0x1fc4fb[_0x9edd('0x26')][0x0]['firstname']+'\x20'+_0x1fc4fb[_0x9edd('0x26')][0x0][_0x9edd('0x3c')],'phone':_0x231604});}else{logger['info'](_0x9edd('0x3d'));return request({'method':'POST','uri':util['format'](_0x9edd('0x2f'),_0x35c16f[_0x9edd('0x1e')]),'form':{'operation':_0x9edd('0x1f'),'sessionName':_0x56a228[_0x9edd('0x21')],'elementType':_0x9edd('0x3e'),'element':JSON[_0x9edd('0x27')]({'lastname':_0x51a54a,'phone':_0x231604,'assigned_user_id':'\x20'})},'json':!![]})[_0x9edd('0x23')](function(_0x75efbe){logger[_0x9edd('0x2d')](_0x9edd('0x3f'));return BPromise[_0x9edd('0x25')]({'id':_0x75efbe[_0x9edd('0x26')]['id'],'name':_0x75efbe[_0x9edd('0x26')][_0x9edd('0x3c')],'phone':_0x75efbe[_0x9edd('0x26')]['phone']});})[_0x9edd('0x29')](function(_0x2570e3){var _0x2231c1=_0x2570e3[_0x9edd('0x38')]||0x1f4;logger[_0x9edd('0x28')](_0x9edd('0x2a'),_0x9edd('0x40'),_0x2231c1,JSON['stringify'](_0x2570e3));});}});}function getConnection(_0x4a4656){var _0x4bc7a1=_0x4a4656[_0x9edd('0x20')];var _0x58a1dd=_0x4a4656[_0x9edd('0x41')];return request({'method':_0x9edd('0x2e'),'uri':util[_0x9edd('0x1d')](_0x9edd('0x2f'),_0x4a4656[_0x9edd('0x1e')]),'qs':{'operation':'getchallenge','username':_0x4bc7a1},'json':!![]})[_0x9edd('0x23')](function(_0x35e63c){if(_0x35e63c[_0x9edd('0x24')]){return request({'method':'POST','uri':util[_0x9edd('0x1d')](_0x9edd('0x2f'),_0x4a4656[_0x9edd('0x1e')]),'form':{'operation':_0x9edd('0x42'),'username':_0x4bc7a1,'accessKey':md5(_0x35e63c[_0x9edd('0x26')][_0x9edd('0x43')]+_0x58a1dd)},'json':!![]});}})['then'](function(_0x441e4a){if(_0x441e4a[_0x9edd('0x24')]){return BPromise['resolve'](_0x441e4a[_0x9edd('0x26')]);}else{throw new Error(util[_0x9edd('0x1d')]('Account\x20%d\x20is\x20not\x20valid',_0x4a4656['id']));}})[_0x9edd('0x29')](function(_0x8134cd){var _0x468239=_0x8134cd['statusCode']||0x1f4;logger[_0x9edd('0x28')](_0x9edd('0x2a'),_0x9edd('0x44'),_0x468239,JSON[_0x9edd('0x27')](_0x8134cd));});}function request(_0x53f6e3){logger[_0x9edd('0x2d')](_0x9edd('0x45'),JSON[_0x9edd('0x27')](_0x53f6e3));return rp(_0x53f6e3);}exports['queue']=function(_0x16951a,_0x21f6ce,_0x57db43,_0x8e59bd,_0x4e2aaf,_0x336494){var _0xe6b20c,_0x24245f,_0x3fcdf5,_0x1e3c19;_0x336494[_0x9edd('0x1e')]=intUtil[_0x9edd('0x46')](_0x336494[_0x9edd('0x1e')]);if(_0x4e2aaf&&_0x4e2aaf[_0x9edd('0x47')]){logger[_0x9edd('0x2d')](_0x9edd('0x48'),'Recording\x20is\x20enabled!');_0x21f6ce[_0x9edd('0x49')]=util[_0x9edd('0x1d')](_0x9edd('0x4a'),_0x336494['serverUrl'],_0x21f6ce[_0x9edd('0x4b')],md5(_0x21f6ce['uniqueid']));}else{_0x21f6ce['recordingURL']='';}return getConnection(_0x336494)['then'](function(_0x1348a7){_0x1e3c19=_0x1348a7;return getUser(_0x336494,_0x8e59bd[_0x9edd('0x4c')],_0x1e3c19);})[_0x9edd('0x23')](function(_0x35ddb3){_0xe6b20c=_0x35ddb3;logger['info']('The\x20User\x20ID\x20is:',_0xe6b20c['id']);return getEndUser(_0x336494,_0x21f6ce['calleridname'],_0x21f6ce[_0x9edd('0x4d')],_0x1e3c19);})[_0x9edd('0x23')](function(_0xd5090a){_0x24245f=_0xd5090a;logger[_0x9edd('0x2d')](_0x9edd('0x4e'),_0x24245f['id']);return createTicket(_0x336494,_0xe6b20c,_0x24245f,_0x57db43,_0x21f6ce,_0x57db43[_0x9edd('0x4f')],_0x1e3c19);})[_0x9edd('0x23')](function(_0x1e3087){_0x3fcdf5=_0x1e3087;logger['info'](_0x9edd('0x50'));logger['info'](_0x9edd('0x51'),_0x3fcdf5['id']);var _0x6a1cfc=util['format'](_0x9edd('0x52'),_0x336494[_0x9edd('0x1e')],_[_0x9edd('0x53')](_0x3fcdf5['id'],'x')[0x1]);logger['info'](_0x9edd('0x48'),_0x9edd('0x54'));emit(util[_0x9edd('0x1d')](_0x9edd('0x55'),_0x8e59bd[_0x9edd('0x16')]),_0x9edd('0x56'),{'uri':_0x6a1cfc});})['catch'](function(_0x4aa337){logger[_0x9edd('0x28')]('[QUEUE]',JSON[_0x9edd('0x27')](_0x4aa337));});};exports[_0x9edd('0x57')]=function(_0x439083,_0x17d2f2,_0x5df1d7,_0x21ead2,_0x507cce,_0x3e5dca,_0x344692){var _0xc6bde6,_0x5ca123,_0x2651a2,_0x57da5b;_0x3e5dca[_0x9edd('0x1e')]=intUtil[_0x9edd('0x46')](_0x3e5dca['remoteUri']);_0x3e5dca[_0x9edd('0x58')]=intUtil['stripTrailingSlash'](_0x3e5dca[_0x9edd('0x58')]);if(_0x344692&&_0x344692[_0x9edd('0x59')]&&_0x344692[_0x9edd('0x59')]!=='none'){logger[_0x9edd('0x2d')](_0x9edd('0x5a'),_0x9edd('0x5b'));_0x17d2f2[_0x9edd('0x49')]=util[_0x9edd('0x1d')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3e5dca['serverUrl'],_0x17d2f2[_0x9edd('0x4b')],md5(_0x17d2f2[_0x9edd('0x4b')]));}return getConnection(_0x3e5dca)['then'](function(_0x5496e9){_0x57da5b=_0x5496e9;return getUser(_0x3e5dca,_0x21ead2['email'],_0x57da5b);})[_0x9edd('0x23')](function(_0x4e003a){_0xc6bde6=_0x4e003a;logger['info'](_0x9edd('0x5c'),_0xc6bde6['id']);return getEndUser(_0x3e5dca,_0x17d2f2[_0x9edd('0x5d')],_0x17d2f2['destcalleridnum'],_0x57da5b);})[_0x9edd('0x23')](function(_0x11e082){_0x5ca123=_0x11e082;logger[_0x9edd('0x2d')]('The\x20Enduser\x20ID\x20is:',_0x5ca123['id']);return createTicket(_0x3e5dca,_0xc6bde6,_0x5ca123,_0x5df1d7,_0x17d2f2,_0x5df1d7[_0x9edd('0x4f')],_0x57da5b);})['then'](function(_0x37b018){_0x2651a2=_0x37b018;logger[_0x9edd('0x2d')]('Ticket\x20created!');logger[_0x9edd('0x2d')](_0x9edd('0x51'),_0x2651a2['id']);var _0x5c1746=util[_0x9edd('0x1d')](_0x9edd('0x52'),_0x3e5dca[_0x9edd('0x1e')],_[_0x9edd('0x53')](_0x2651a2['id'],'x')[0x1]);logger['info'](_0x9edd('0x5a'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x9edd('0x1d')](_0x9edd('0x55'),_0x21ead2[_0x9edd('0x16')]),'trigger:browser:url',{'uri':_0x5c1746});})[_0x9edd('0x29')](function(_0x286593){logger[_0x9edd('0x28')](_0x9edd('0x5a'),JSON[_0x9edd('0x27')](_0x286593));});};exports[_0x9edd('0x5e')]=function(_0x3fa4a9,_0x512d3a,_0x5e29d0,_0x322165,_0x3c7874,_0x13254e){var _0x171403,_0x1e2126,_0x52f6f3,_0x2e40c8;_0x13254e[_0x9edd('0x1e')]=intUtil[_0x9edd('0x46')](_0x13254e['remoteUri']);_0x13254e[_0x9edd('0x58')]=intUtil[_0x9edd('0x46')](_0x13254e['serverUrl']);if(_0x3c7874&&_0x3c7874[_0x9edd('0x47')]){logger[_0x9edd('0x2d')]('[ABANDONED]',_0x9edd('0x5b'));_0x512d3a[_0x9edd('0x49')]=util['format'](_0x9edd('0x4a'),_0x13254e['serverUrl'],_0x512d3a['uniqueid'],md5(_0x512d3a[_0x9edd('0x4b')]));}else{_0x512d3a[_0x9edd('0x49')]='';}return getConnection(_0x13254e)[_0x9edd('0x23')](function(_0x5b56c7){_0x2e40c8=_0x5b56c7;return getUser(_0x13254e,'',_0x2e40c8);})[_0x9edd('0x23')](function(_0x286e47){_0x171403=_0x286e47;logger['info'](_0x9edd('0x5c'),_0x171403['id']);return getEndUser(_0x13254e,_0x512d3a[_0x9edd('0x5f')],_0x512d3a[_0x9edd('0x4d')],_0x2e40c8);})[_0x9edd('0x23')](function(_0x54ac71){_0x1e2126=_0x54ac71;logger['info'](_0x9edd('0x4e'),_0x1e2126['id']);return createTicket(_0x13254e,_0x171403,_0x1e2126,_0x5e29d0,_0x512d3a,_0x5e29d0['Fields'],_0x2e40c8);})[_0x9edd('0x23')](function(_0x2c71ce){_0x52f6f3=_0x2c71ce;logger[_0x9edd('0x2d')](_0x9edd('0x50'));logger[_0x9edd('0x2d')](_0x9edd('0x51'),_0x52f6f3['id']);})[_0x9edd('0x29')](function(_0x5a4d4b){logger[_0x9edd('0x28')]('[ABANDONED]',JSON[_0x9edd('0x27')](_0x5a4d4b));});}; \ No newline at end of file +var _0x7217=['The\x20User\x20ID\x20is:','calleridname','calleridnum','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','outbound','serverUrl','recordingFormat','none','destcalleridname','destcalleridnum','Fields','The\x20Ticket\x20ID\x20is:','[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','abandoned','[ABANDONED]','Ticket\x20created!','lodash','bluebird','md5','util','ioredis','./util','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','type','string','idField','content','toString','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','getString','Subjects','Descriptions','POST','%s/webservice.php','remoteUri','create','username','sessionName','HelpDesk','stringify','success','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','catch','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','then','Agent\x20found!','email1','first_name','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email'];(function(_0x4ffe1b,_0x40c701){var _0x55dadf=function(_0x452427){while(--_0x452427){_0x4ffe1b['push'](_0x4ffe1b['shift']());}};_0x55dadf(++_0x40c701);}(_0x7217,0x19e));var _0x7721=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0x7217[_0x373dee];return _0x46798f;};'use strict';var _=require(_0x7721('0x0'));var rp=require('request-promise');var BPromise=require(_0x7721('0x1'));var md5=require(_0x7721('0x2'));var util=require(_0x7721('0x3'));var Redis=require(_0x7721('0x4'));var intUtil=require(_0x7721('0x5'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x7721('0x6'));config[_0x7721('0x7')]=_[_0x7721('0x8')](config[_0x7721('0x7')],{'host':_0x7721('0x9'),'port':0x18eb});var io=require(_0x7721('0xa'))(new Redis(config[_0x7721('0x7')]));function emit(_0x21f680,_0x225610,_0x2f99ed){io['to'](_0x21f680)[_0x7721('0xb')](_0x225610,_0x2f99ed);}function getCustomFields(_0x2a66cb,_0xfa8835){var _0x138740={};if(_0x2a66cb[_0x7721('0xc')]>0x0){_['forEach'](_0x2a66cb,function(_0x461d1a){if(_0x461d1a[_0x7721('0xd')]===_0x7721('0xe')&&_0x461d1a[_0x7721('0xf')]){_0x138740[_0x461d1a[_0x7721('0xf')]]=_0x461d1a[_0x7721('0x10')][_0x7721('0x11')]();}else if(_0x461d1a[_0x7721('0xd')]==='variable'&&_0x461d1a[_0x7721('0x12')]&&_0x461d1a[_0x7721('0xf')]&&_0xfa8835[_0x461d1a['variableName']]){_0x138740[_0x461d1a[_0x7721('0xf')]]=_0xfa8835[_0x461d1a[_0x7721('0x12')]][_0x7721('0x11')]();}else if(_0x461d1a[_0x7721('0xd')]==='customVariable'&&_0x461d1a[_0x7721('0x13')]&&_0x461d1a[_0x7721('0x13')]['name']&&_0x461d1a['idField']&&_0xfa8835[_0x461d1a['Variable'][_0x7721('0x14')][_0x7721('0x15')]()]){_0x138740[_0x461d1a[_0x7721('0xf')]]=_0xfa8835[_0x461d1a[_0x7721('0x13')]['name'][_0x7721('0x15')]()]['toString']();}});}return _0x138740;}function createTicket(_0x3fc09e,_0x5cb0e6,_0xfec626,_0x4e96fb,_0x3ab5a5,_0x3e140d,_0x2286e5){logger[_0x7721('0x16')](_0x7721('0x17'));var _0x413263=_[_0x7721('0x18')]({'parent_id':'','assigned_user_id':_0x5cb0e6['id'],'ticketpriorities':_0x7721('0x19'),'ticketstatus':'Open','ticket_title':intUtil[_0x7721('0x1a')](_0x4e96fb[_0x7721('0x1b')],_0x3ab5a5,'\x20'),'description':intUtil[_0x7721('0x1a')](_0x4e96fb[_0x7721('0x1c')],_0x3ab5a5,'\x0a'),'contact_id':_0xfec626['id']},getCustomFields(_0x3e140d,_0x3ab5a5));var _0x57140c={'method':_0x7721('0x1d'),'uri':util['format'](_0x7721('0x1e'),_0x3fc09e[_0x7721('0x1f')]),'form':{'operation':_0x7721('0x20'),'username':_0x3fc09e[_0x7721('0x21')],'sessionName':_0x2286e5[_0x7721('0x22')],'elementType':_0x7721('0x23'),'element':JSON[_0x7721('0x24')](_0x413263)},'json':!![]};return request(_0x57140c)['then'](function(_0x216f20){if(_0x216f20[_0x7721('0x25')]){return BPromise[_0x7721('0x26')]({'id':_0x216f20[_0x7721('0x27')]['id']});}else{throw new Error(util[_0x7721('0x28')](_0x7721('0x29'),JSON[_0x7721('0x24')](_0x216f20[_0x7721('0x2a')])));}})[_0x7721('0x2b')](function(_0x52316e){var _0x258ddf=_0x52316e['statusCode']||0x1f4;logger['error'](_0x7721('0x2c'),_0x7721('0x2d'),_0x258ddf,JSON[_0x7721('0x24')](_0x52316e));});}function getUser(_0x158d98,_0x1ea4d,_0x37b9f0){if(intUtil[_0x7721('0x2e')](_0x1ea4d)){logger[_0x7721('0x16')]('Getting\x20agent\x20with\x20email',_0x1ea4d);return request({'method':_0x7721('0x2f'),'uri':util[_0x7721('0x28')]('%s/webservice.php',_0x158d98['remoteUri']),'qs':{'operation':_0x7721('0x30'),'username':_0x158d98[_0x7721('0x21')],'sessionName':_0x37b9f0['sessionName'],'query':util[_0x7721('0x28')](_0x7721('0x31'),_0x1ea4d)},'json':!![]})[_0x7721('0x32')](function(_0x58d54b){if(_0x58d54b[_0x7721('0x25')]&&_0x58d54b[_0x7721('0x27')][_0x7721('0xc')]){logger[_0x7721('0x16')](_0x7721('0x33'));return BPromise['resolve']({'id':_0x58d54b[_0x7721('0x27')][0x0]['id'],'email':_0x58d54b[_0x7721('0x27')][0x0][_0x7721('0x34')],'name':_0x58d54b['result'][0x0][_0x7721('0x35')]+'\x20'+_0x58d54b[_0x7721('0x27')]['last_name']});}else{logger[_0x7721('0x16')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x7721('0x26')]({'id':_0x37b9f0[_0x7721('0x36')],'email':_0x158d98[_0x7721('0x21')],'name':_0x7721('0x37')});}})[_0x7721('0x2b')](function(_0x13c635){var _0x2f1fe0=_0x13c635[_0x7721('0x38')]||0x1f4;logger[_0x7721('0x2a')](_0x7721('0x2c'),_0x7721('0x39'),_0x2f1fe0,JSON['stringify'](_0x13c635));});}else{logger[_0x7721('0x16')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x7721('0x26')]({'id':_0x37b9f0[_0x7721('0x36')],'email':_0x158d98[_0x7721('0x21')],'name':_0x7721('0x37')})[_0x7721('0x2b')](function(_0x378ba5){var _0x482b70=_0x378ba5['statusCode']||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s',_0x7721('0x39'),_0x482b70,JSON[_0x7721('0x24')](_0x378ba5));});}}function getEndUser(_0x1acc72,_0x22ef35,_0x4a90ce,_0xa389fa){logger['info'](_0x7721('0x3a'),_0x4a90ce);return request({'method':_0x7721('0x2f'),'uri':util['format'](_0x7721('0x1e'),_0x1acc72[_0x7721('0x1f')]),'qs':{'operation':'query','username':_0x1acc72['username'],'sessionName':_0xa389fa[_0x7721('0x22')],'query':util[_0x7721('0x28')](_0x7721('0x3b'),_0x4a90ce,_0x4a90ce,_0x4a90ce,_0x4a90ce,_0x4a90ce)},'json':!![]})[_0x7721('0x32')](function(_0x577af9){if(_0x577af9[_0x7721('0x25')]&&_0x577af9[_0x7721('0x27')][_0x7721('0xc')]){logger[_0x7721('0x16')](_0x7721('0x3c'));return BPromise['resolve']({'id':_0x577af9[_0x7721('0x27')][0x0]['id'],'name':_0x577af9['result'][0x0][_0x7721('0x3d')]+'\x20'+_0x577af9['result'][0x0][_0x7721('0x3e')],'phone':_0x4a90ce});}else{logger[_0x7721('0x16')](_0x7721('0x3f'));return request({'method':'POST','uri':util[_0x7721('0x28')](_0x7721('0x1e'),_0x1acc72[_0x7721('0x1f')]),'form':{'operation':'create','sessionName':_0xa389fa[_0x7721('0x22')],'elementType':_0x7721('0x40'),'element':JSON[_0x7721('0x24')]({'lastname':_0x22ef35,'phone':_0x4a90ce,'assigned_user_id':'\x20'})},'json':!![]})[_0x7721('0x32')](function(_0x135dbc){logger[_0x7721('0x16')](_0x7721('0x41'));return BPromise['resolve']({'id':_0x135dbc['result']['id'],'name':_0x135dbc[_0x7721('0x27')][_0x7721('0x3e')],'phone':_0x135dbc[_0x7721('0x27')][_0x7721('0x42')]});})[_0x7721('0x2b')](function(_0x15181b){var _0x1d2ea5=_0x15181b[_0x7721('0x38')]||0x1f4;logger[_0x7721('0x2a')](_0x7721('0x2c'),'getEndUser',_0x1d2ea5,JSON['stringify'](_0x15181b));});}});}function getConnection(_0x5ed70d){var _0x6a4664=_0x5ed70d[_0x7721('0x21')];var _0x219c9f=_0x5ed70d['accessKey'];return request({'method':_0x7721('0x2f'),'uri':util[_0x7721('0x28')]('%s/webservice.php',_0x5ed70d[_0x7721('0x1f')]),'qs':{'operation':'getchallenge','username':_0x6a4664},'json':!![]})[_0x7721('0x32')](function(_0x5c6922){if(_0x5c6922[_0x7721('0x25')]){return request({'method':_0x7721('0x1d'),'uri':util[_0x7721('0x28')]('%s/webservice.php',_0x5ed70d[_0x7721('0x1f')]),'form':{'operation':_0x7721('0x43'),'username':_0x6a4664,'accessKey':md5(_0x5c6922['result'][_0x7721('0x44')]+_0x219c9f)},'json':!![]});}})[_0x7721('0x32')](function(_0xf88e8c){if(_0xf88e8c['success']){return BPromise[_0x7721('0x26')](_0xf88e8c['result']);}else{throw new Error(util[_0x7721('0x28')](_0x7721('0x45'),_0x5ed70d['id']));}})[_0x7721('0x2b')](function(_0x443503){var _0x1c95d8=_0x443503[_0x7721('0x38')]||0x1f4;logger[_0x7721('0x2a')](_0x7721('0x2c'),_0x7721('0x46'),_0x1c95d8,JSON[_0x7721('0x24')](_0x443503));});}function request(_0x31770e){logger[_0x7721('0x16')](_0x7721('0x47'),JSON[_0x7721('0x24')](_0x31770e));return rp(_0x31770e);}exports[_0x7721('0x48')]=function(_0x5b741d,_0x474f32,_0x2f6f30,_0x8e1214,_0x2c1119,_0x1f1ac7){var _0x315127,_0x267f5e,_0x57484c,_0x234bee;_0x1f1ac7[_0x7721('0x1f')]=intUtil[_0x7721('0x49')](_0x1f1ac7[_0x7721('0x1f')]);if(_0x2c1119&&_0x2c1119[_0x7721('0x4a')]){logger[_0x7721('0x16')](_0x7721('0x4b'),_0x7721('0x4c'));_0x474f32[_0x7721('0x4d')]=util[_0x7721('0x28')](_0x7721('0x4e'),_0x1f1ac7['serverUrl'],_0x474f32[_0x7721('0x4f')],md5(_0x474f32[_0x7721('0x4f')]));}else{_0x474f32[_0x7721('0x4d')]='';}return getConnection(_0x1f1ac7)[_0x7721('0x32')](function(_0x15ed3b){_0x234bee=_0x15ed3b;return getUser(_0x1f1ac7,_0x8e1214[_0x7721('0x50')],_0x234bee);})[_0x7721('0x32')](function(_0x36fe6f){_0x315127=_0x36fe6f;logger[_0x7721('0x16')](_0x7721('0x51'),_0x315127['id']);return getEndUser(_0x1f1ac7,_0x474f32[_0x7721('0x52')],_0x474f32[_0x7721('0x53')],_0x234bee);})[_0x7721('0x32')](function(_0x18f7f6){_0x267f5e=_0x18f7f6;logger[_0x7721('0x16')]('The\x20Enduser\x20ID\x20is:',_0x267f5e['id']);return createTicket(_0x1f1ac7,_0x315127,_0x267f5e,_0x2f6f30,_0x474f32,_0x2f6f30['Fields'],_0x234bee);})['then'](function(_0x885a3a){_0x57484c=_0x885a3a;logger['info']('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x57484c['id']);var _0x47925a=util[_0x7721('0x28')](_0x7721('0x54'),_0x1f1ac7['remoteUri'],_[_0x7721('0x55')](_0x57484c['id'],'x')[0x1]);logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x7721('0x28')]('user:%s',_0x8e1214['name']),'trigger:browser:url',{'uri':_0x47925a});})[_0x7721('0x2b')](function(_0x2e9155){logger[_0x7721('0x2a')]('[QUEUE]',JSON[_0x7721('0x24')](_0x2e9155));});};exports[_0x7721('0x56')]=function(_0x2c95d0,_0x168343,_0x6b7c1e,_0x16e80b,_0xad43ce,_0x3e3301,_0x127f46){var _0x197b73,_0x3b03cf,_0x10666e,_0x148562;_0x3e3301[_0x7721('0x1f')]=intUtil[_0x7721('0x49')](_0x3e3301['remoteUri']);_0x3e3301[_0x7721('0x57')]=intUtil[_0x7721('0x49')](_0x3e3301[_0x7721('0x57')]);if(_0x127f46&&_0x127f46[_0x7721('0x58')]&&_0x127f46['recordingFormat']!==_0x7721('0x59')){logger[_0x7721('0x16')]('[OUTBOUND]',_0x7721('0x4c'));_0x168343['recordingURL']=util[_0x7721('0x28')](_0x7721('0x4e'),_0x3e3301[_0x7721('0x57')],_0x168343[_0x7721('0x4f')],md5(_0x168343[_0x7721('0x4f')]));}return getConnection(_0x3e3301)[_0x7721('0x32')](function(_0x3121e0){_0x148562=_0x3121e0;return getUser(_0x3e3301,_0x16e80b[_0x7721('0x50')],_0x148562);})[_0x7721('0x32')](function(_0x57759a){_0x197b73=_0x57759a;logger[_0x7721('0x16')](_0x7721('0x51'),_0x197b73['id']);return getEndUser(_0x3e3301,_0x168343[_0x7721('0x5a')],_0x168343[_0x7721('0x5b')],_0x148562);})[_0x7721('0x32')](function(_0x3ed425){_0x3b03cf=_0x3ed425;logger[_0x7721('0x16')]('The\x20Enduser\x20ID\x20is:',_0x3b03cf['id']);return createTicket(_0x3e3301,_0x197b73,_0x3b03cf,_0x6b7c1e,_0x168343,_0x6b7c1e[_0x7721('0x5c')],_0x148562);})[_0x7721('0x32')](function(_0x53c918){_0x10666e=_0x53c918;logger[_0x7721('0x16')]('Ticket\x20created!');logger[_0x7721('0x16')](_0x7721('0x5d'),_0x10666e['id']);var _0x4282ba=util[_0x7721('0x28')](_0x7721('0x54'),_0x3e3301[_0x7721('0x1f')],_[_0x7721('0x55')](_0x10666e['id'],'x')[0x1]);logger['info'](_0x7721('0x5e'),_0x7721('0x5f'));emit(util[_0x7721('0x28')]('user:%s',_0x16e80b['name']),'trigger:browser:url',{'uri':_0x4282ba});})['catch'](function(_0x5e966f){logger[_0x7721('0x2a')](_0x7721('0x5e'),JSON['stringify'](_0x5e966f));});};exports[_0x7721('0x60')]=function(_0x42f6e9,_0xbbc86f,_0x4593e1,_0x53ebb1,_0x275b25,_0xfe9fb8){var _0x322afc,_0x1bea13,_0x3cf3fd,_0x53adb1;_0xfe9fb8[_0x7721('0x1f')]=intUtil[_0x7721('0x49')](_0xfe9fb8[_0x7721('0x1f')]);_0xfe9fb8['serverUrl']=intUtil['stripTrailingSlash'](_0xfe9fb8[_0x7721('0x57')]);if(_0x275b25&&_0x275b25[_0x7721('0x4a')]){logger[_0x7721('0x16')](_0x7721('0x61'),_0x7721('0x4c'));_0xbbc86f['recordingURL']=util['format'](_0x7721('0x4e'),_0xfe9fb8[_0x7721('0x57')],_0xbbc86f[_0x7721('0x4f')],md5(_0xbbc86f[_0x7721('0x4f')]));}else{_0xbbc86f[_0x7721('0x4d')]='';}return getConnection(_0xfe9fb8)[_0x7721('0x32')](function(_0x34187f){_0x53adb1=_0x34187f;return getUser(_0xfe9fb8,'',_0x53adb1);})['then'](function(_0xdfae41){_0x322afc=_0xdfae41;logger[_0x7721('0x16')](_0x7721('0x51'),_0x322afc['id']);return getEndUser(_0xfe9fb8,_0xbbc86f['calleridname'],_0xbbc86f[_0x7721('0x53')],_0x53adb1);})[_0x7721('0x32')](function(_0xdcd3e0){_0x1bea13=_0xdcd3e0;logger[_0x7721('0x16')]('The\x20Enduser\x20ID\x20is:',_0x1bea13['id']);return createTicket(_0xfe9fb8,_0x322afc,_0x1bea13,_0x4593e1,_0xbbc86f,_0x4593e1['Fields'],_0x53adb1);})[_0x7721('0x32')](function(_0x2cac50){_0x3cf3fd=_0x2cac50;logger[_0x7721('0x16')](_0x7721('0x62'));logger[_0x7721('0x16')](_0x7721('0x5d'),_0x3cf3fd['id']);})['catch'](function(_0x3855d5){logger[_0x7721('0x2a')](_0x7721('0x61'),JSON['stringify'](_0x3855d5));});}; \ 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 061c908..9f65633 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 _0x8e94=['nameField','customField','toLowerCase','idField','custom_fields','push','content','variableName','customVariable','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','error','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridnum','trigger:browser:url','%s/agent/tickets/%s','Zendesk\x20account\x20type\x20not\x20recognized','[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','util','./util','../../../../config/logger','redis','localhost','emit','application/json','info','format','%s/tickets.json','remoteUri','POST','merge','Tags','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','length','filter','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','end-user','Caller\x20-\x20%s','password','username','token','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','defaults','GET','map','forEach','type','string'];(function(_0x3c8077,_0x1f12a4){var _0x50f2eb=function(_0x17d61c){while(--_0x17d61c){_0x3c8077['push'](_0x3c8077['shift']());}};_0x50f2eb(++_0x1f12a4);}(_0x8e94,0xf8));var _0x48e9=function(_0x131585,_0x1abd33){_0x131585=_0x131585-0x0;var _0x1fcca2=_0x8e94[_0x131585];return _0x1fcca2;};'use strict';var _=require(_0x48e9('0x0'));var rp=require(_0x48e9('0x1'));var md5=require('md5');var util=require(_0x48e9('0x2'));var Redis=require('ioredis');var intUtil=require(_0x48e9('0x3'));var config=require('../../../../config/environment');var logger=require(_0x48e9('0x4'))('zendesk');config['redis']=_['defaults'](config[_0x48e9('0x5')],{'host':_0x48e9('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x48e9('0x5')]));function emit(_0x58332f,_0x409f7b,_0x50124c){io['to'](_0x58332f)[_0x48e9('0x7')](_0x409f7b,_0x50124c);}var headers={'Content-Type':_0x48e9('0x8'),'Accept':_0x48e9('0x8')};function getTicket(_0x371e53,_0x515272,_0x2ff861,_0x140b26,_0x5118c3){logger[_0x48e9('0x9')]('Creating\x20new\x20ticket...');return request({'uri':util[_0x48e9('0xa')](_0x48e9('0xb'),_0x371e53[_0x48e9('0xc')]),'method':_0x48e9('0xd'),'body':{'ticket':_[_0x48e9('0xe')]({'requester_id':_0x2ff861['id'],'submitter_id':_0x515272?_0x515272['id']:undefined,'assignee_id':_0x515272?_0x515272['id']:undefined,'tags':getTags(_0x140b26[_0x48e9('0xf')],'name'),'subject':intUtil[_0x48e9('0x10')](_0x140b26[_0x48e9('0x11')],_0x5118c3,'\x20'),'description':intUtil[_0x48e9('0x10')](_0x140b26['Descriptions'],_0x5118c3,'\x0a'),'comment':{'public':![],'body':intUtil[_0x48e9('0x10')](_0x140b26[_0x48e9('0x12')],_0x5118c3,'\x0a')}},getCustomFields(_0x140b26[_0x48e9('0x13')],_0x5118c3))}})[_0x48e9('0x14')](function(_0x3d74dd){logger[_0x48e9('0x9')](_0x48e9('0x15'));return _0x3d74dd[_0x48e9('0x16')];});}function getUser(_0x223884,_0x2a9e2b){if(intUtil[_0x48e9('0x17')](_0x2a9e2b)){logger[_0x48e9('0x9')](_0x48e9('0x18'),_0x2a9e2b);return request({'uri':util['format'](_0x48e9('0x19'),_0x223884[_0x48e9('0xc')]),'qs':{'query':util[_0x48e9('0xa')]('type:user\x20role:agent\x20email:%s',_0x2a9e2b)}})[_0x48e9('0x14')](function(_0x60d97f){if(_0x60d97f[_0x48e9('0x1a')]){logger[_0x48e9('0x9')](_0x48e9('0x1b'));return _[_0x48e9('0x1c')](_0x60d97f[_0x48e9('0x1d')],{'email':_0x2a9e2b,'role':_0x48e9('0x1e')});}else{logger['info'](_0x48e9('0x1f'));return request({'uri':util[_0x48e9('0xa')](_0x48e9('0x20'),_0x223884['remoteUri'])})['then'](function(_0x1501ab){logger[_0x48e9('0x9')](_0x48e9('0x21'));return _0x1501ab[_0x48e9('0x22')];});}});}else{logger['info'](_0x48e9('0x1f'));return request({'uri':util[_0x48e9('0xa')]('%s/users/me.json',_0x223884[_0x48e9('0xc')])})[_0x48e9('0x14')](function(_0x3047fa){logger['info'](_0x48e9('0x21'));return _0x3047fa[_0x48e9('0x22')];});}}function getEndUser(_0x502d3d,_0x588daa,_0x595e18){logger['info'](_0x48e9('0x23'),_0x595e18);return request({'uri':util[_0x48e9('0xa')]('%s/search.json',_0x502d3d[_0x48e9('0xc')]),'qs':{'query':util[_0x48e9('0xa')]('type:user\x20role:end-user\x20phone:%s',_0x595e18)}})[_0x48e9('0x14')](function(_0x4237c1){var _0x3f4409;if(_0x4237c1[_0x48e9('0x1d')][_0x48e9('0x24')]){_0x4237c1['results']=_[_0x48e9('0x25')](_0x4237c1[_0x48e9('0x1d')],{'suspended':![],'role':'end-user'});if(_0x4237c1[_0x48e9('0x1d')][_0x48e9('0x24')]){_0x3f4409=_[_0x48e9('0x26')](_0x4237c1['results']);}}if(_0x3f4409){logger[_0x48e9('0x9')]('Enduser\x20found!');return _0x3f4409;}else{logger[_0x48e9('0x9')](_0x48e9('0x27'));return request({'uri':util[_0x48e9('0xa')](_0x48e9('0x28'),_0x502d3d[_0x48e9('0xc')]),'method':_0x48e9('0xd'),'body':{'user':{'role':_0x48e9('0x29'),'name':util[_0x48e9('0xa')](_0x48e9('0x2a'),_0x588daa||_0x595e18),'phone':_0x595e18}}})[_0x48e9('0x14')](function(_0x18386e){logger['info']('Enduser\x20created.');return _0x18386e[_0x48e9('0x22')];});}});}function getAuth(_0x178966){var _0x58116d;if(_0x178966['authType']===_0x48e9('0x2b')){_0x58116d=util[_0x48e9('0xa')]('%s:%s',_0x178966[_0x48e9('0x2c')],_0x178966[_0x48e9('0x2b')]);}else if(_0x178966['authType']===_0x48e9('0x2d')){_0x58116d=util[_0x48e9('0xa')]('%s/token:%s',_0x178966[_0x48e9('0x2c')],_0x178966[_0x48e9('0x2d')]);}return util[_0x48e9('0xa')](_0x48e9('0x2e'),new Buffer(_0x58116d)[_0x48e9('0x2f')](_0x48e9('0x30')));}function request(_0x56cfe1){logger[_0x48e9('0x31')](_0x48e9('0x32'),JSON[_0x48e9('0x33')](_0x56cfe1));return rp(_[_0x48e9('0x34')](_0x56cfe1,{'method':_0x48e9('0x35'),'headers':headers,'json':!![]}));}function getTags(_0x7bd40,_0xc5ca77){var _0x163b17=[];if(_0x7bd40&&_0x7bd40[_0x48e9('0x24')]>0x0){_0x163b17=_[_0x48e9('0x36')](_0x7bd40,_0xc5ca77);}return _0x163b17;}function getCustomFields(_0x3f0a4f,_0x51103d){var _0x1c9f2c=[];var _0x174067={'custom_fields':[]};if(_0x3f0a4f[_0x48e9('0x24')]>0x0){_[_0x48e9('0x37')](_0x3f0a4f,function(_0x592c8f){if(_0x592c8f[_0x48e9('0x38')]===_0x48e9('0x39')&&_0x592c8f[_0x48e9('0x3a')]&&!_0x592c8f[_0x48e9('0x3b')]){_0x174067[_0x592c8f[_0x48e9('0x3a')][_0x48e9('0x3c')]()]=_0x592c8f['content']['toString']();}else if(_0x592c8f[_0x48e9('0x38')]===_0x48e9('0x39')&&_0x592c8f[_0x48e9('0x3d')]&&_0x592c8f[_0x48e9('0x3b')]){_0x174067[_0x48e9('0x3e')][_0x48e9('0x3f')]({'id':_0x592c8f['idField'],'value':_0x592c8f[_0x48e9('0x40')][_0x48e9('0x2f')]()});}else if(_0x592c8f[_0x48e9('0x38')]==='variable'&&_0x592c8f[_0x48e9('0x41')]&&_0x592c8f[_0x48e9('0x3d')]&&_0x592c8f[_0x48e9('0x3b')]){_0x51103d[_0x592c8f[_0x48e9('0x41')]]&&_0x174067['custom_fields'][_0x48e9('0x3f')]({'id':_0x592c8f[_0x48e9('0x3d')],'value':_0x51103d[_0x592c8f[_0x48e9('0x41')]][_0x48e9('0x2f')]()});}else if(_0x592c8f[_0x48e9('0x38')]===_0x48e9('0x42')&&_0x592c8f[_0x48e9('0x43')]&&_0x592c8f[_0x48e9('0x43')][_0x48e9('0x44')]&&_0x592c8f[_0x48e9('0x3d')]&&_0x592c8f[_0x48e9('0x3b')]){_0x51103d[_0x592c8f['Variable']['name'][_0x48e9('0x3c')]()]&&_0x174067[_0x48e9('0x3e')]['push']({'id':_0x592c8f[_0x48e9('0x3d')],'value':_0x51103d[_0x592c8f[_0x48e9('0x43')][_0x48e9('0x44')][_0x48e9('0x3c')]()][_0x48e9('0x2f')]()});}});}return _0x174067;}exports[_0x48e9('0x45')]=function(_0x89ddc,_0x24f32e,_0x4eaf03,_0xf18910,_0x30ec7d,_0x45b86b){var _0x4466e6,_0x5b7144;_0x45b86b['remoteUri']=intUtil[_0x48e9('0x46')](_0x45b86b[_0x48e9('0xc')]);_0x45b86b[_0x48e9('0x47')]=intUtil[_0x48e9('0x46')](_0x45b86b[_0x48e9('0x47')]);if(_0x30ec7d&&_0x30ec7d[_0x48e9('0x48')]){logger['info'](_0x48e9('0x49'),_0x48e9('0x4a'));_0x24f32e[_0x48e9('0x4b')]=util[_0x48e9('0xa')](_0x48e9('0x4c'),_0x45b86b[_0x48e9('0x47')],_0x24f32e[_0x48e9('0x4d')],md5(_0x24f32e[_0x48e9('0x4d')]));}else{_0x24f32e[_0x48e9('0x4b')]='';}headers[_0x48e9('0x4e')]=getAuth(_0x45b86b);return getUser(_0x45b86b,_0xf18910[_0x48e9('0x4f')])[_0x48e9('0x14')](function(_0x5008bb){_0x4466e6=_0x5008bb;logger[_0x48e9('0x9')]('The\x20User\x20ID\x20is:',_0x4466e6['id']);return getEndUser(_0x45b86b,_0x24f32e[_0x48e9('0x50')],_0x24f32e[_0x48e9('0x51')]);})[_0x48e9('0x14')](function(_0x32382d){_0x5b7144=_0x32382d;logger['info'](_0x48e9('0x52'),_0x5b7144['id']);return getTicket(_0x45b86b,_0x4466e6,_0x5b7144,_0x4eaf03,_0x24f32e);})[_0x48e9('0x14')](function(_0x36dc16){if(_0x36dc16){logger[_0x48e9('0x9')](_0x48e9('0x53'),_0x36dc16['id']);switch(_0x45b86b['type']){case _0x48e9('0x54'):logger['info'](_0x48e9('0x49'),_0x48e9('0x55'));return request({'uri':util['format'](_0x48e9('0x56'),_0x45b86b[_0x48e9('0xc')],_0x4466e6['id'],_0x36dc16['id']),'method':_0x48e9('0xd')});case _0x48e9('0x57'):logger[_0x48e9('0x9')]('[QUEUE]',_0x48e9('0x58'));emit(util['format'](_0x48e9('0x59'),_0xf18910[_0x48e9('0x44')]),'trigger:browser:url',{'uri':util[_0x48e9('0xa')]('%s/agent/tickets/%s',_0x45b86b[_0x48e9('0xc')],_0x36dc16['id'])});break;default:logger[_0x48e9('0x5a')](_0x48e9('0x49'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x48e9('0x5b')](function(_0x2a0cef){logger['error'](_0x48e9('0x5c'),util[_0x48e9('0x5d')](_0x2a0cef,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x408232,_0x18d04b,_0x1c655c,_0x204e00,_0x502453,_0x164279,_0x1d3a8d){var _0x1a8220,_0x4c013c;_0x164279[_0x48e9('0xc')]=intUtil['stripTrailingSlash'](_0x164279[_0x48e9('0xc')]);_0x164279[_0x48e9('0x47')]=intUtil['stripTrailingSlash'](_0x164279[_0x48e9('0x47')]);if(_0x1d3a8d&&_0x1d3a8d[_0x48e9('0x5e')]&&_0x1d3a8d[_0x48e9('0x5e')]!=='none'){logger[_0x48e9('0x9')](_0x48e9('0x5f'),_0x48e9('0x4a'));_0x18d04b[_0x48e9('0x4b')]=util['format'](_0x48e9('0x4c'),_0x164279[_0x48e9('0x47')],_0x18d04b['uniqueid'],md5(_0x18d04b['uniqueid']));}headers[_0x48e9('0x4e')]=getAuth(_0x164279);return getUser(_0x164279,_0x204e00[_0x48e9('0x4f')])[_0x48e9('0x14')](function(_0x4d4ed6){_0x1a8220=_0x4d4ed6;logger[_0x48e9('0x9')](_0x48e9('0x60'),_0x1a8220['id']);return getEndUser(_0x164279,_0x18d04b['destcalleridname'],_0x18d04b[_0x48e9('0x61')]);})['then'](function(_0x32f9a2){_0x4c013c=_0x32f9a2;logger['info']('The\x20Enduser\x20ID\x20is:',_0x4c013c['id']);return getTicket(_0x164279,_0x1a8220,_0x4c013c,_0x1c655c,_0x18d04b);})[_0x48e9('0x14')](function(_0x3951b9){if(_0x3951b9){logger[_0x48e9('0x9')](_0x48e9('0x53'),_0x3951b9['id']);switch(_0x164279[_0x48e9('0x38')]){case _0x48e9('0x54'):logger[_0x48e9('0x9')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x48e9('0xa')](_0x48e9('0x56'),_0x164279[_0x48e9('0xc')],_0x1a8220['id'],_0x3951b9['id']),'method':_0x48e9('0xd')});case _0x48e9('0x57'):logger['info']('[OUTBOUND]',_0x48e9('0x58'));emit(util[_0x48e9('0xa')](_0x48e9('0x59'),_0x204e00['name']),_0x48e9('0x62'),{'uri':util[_0x48e9('0xa')](_0x48e9('0x63'),_0x164279[_0x48e9('0xc')],_0x3951b9['id'])});break;default:logger[_0x48e9('0x5a')]('[OUTBOUND]',_0x48e9('0x64'));}}})['catch'](function(_0x195bcc){logger['error']('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0x48e9('0x5d')](_0x195bcc,{'showHidden':!![],'depth':null}));});};exports['abandoned']=function(_0x4320f1,_0x11f379,_0x1bf837,_0x1b0772,_0x2a4ecf,_0x59def5){var _0x5a61c7,_0x4e0b74;_0x59def5[_0x48e9('0xc')]=intUtil[_0x48e9('0x46')](_0x59def5['remoteUri']);_0x59def5[_0x48e9('0x47')]=intUtil[_0x48e9('0x46')](_0x59def5[_0x48e9('0x47')]);if(_0x2a4ecf&&_0x2a4ecf[_0x48e9('0x48')]){logger[_0x48e9('0x9')]('[ABANDONED]',_0x48e9('0x4a'));_0x11f379[_0x48e9('0x4b')]=util[_0x48e9('0xa')](_0x48e9('0x4c'),_0x59def5[_0x48e9('0x47')],_0x11f379['uniqueid'],md5(_0x11f379[_0x48e9('0x4d')]));}else{_0x11f379['recordingURL']='';}headers['Authorization']=getAuth(_0x59def5);return getUser(_0x59def5)[_0x48e9('0x14')](function(_0x5dd7f1){_0x5a61c7=_0x5dd7f1;logger['info'](_0x48e9('0x60'),_0x5a61c7['id']);return getEndUser(_0x59def5,_0x11f379['calleridname'],_0x11f379[_0x48e9('0x51')]);})[_0x48e9('0x14')](function(_0x4adbf8){_0x4e0b74=_0x4adbf8;logger['info'](_0x48e9('0x52'),_0x4e0b74['id']);return getTicket(_0x59def5,_0x5a61c7,_0x4e0b74,_0x1bf837,_0x11f379);})[_0x48e9('0x14')](function(_0x432a4d){if(_0x432a4d){logger[_0x48e9('0x9')](_0x48e9('0x53'),_0x432a4d['id']);}})[_0x48e9('0x5b')](function(_0x2fc58f){logger[_0x48e9('0x5a')](_0x48e9('0x65'),util[_0x48e9('0x5d')](_0x2fc58f,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x47c7=['Zendesk\x20account\x20type\x20not\x20recognized','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','abandoned','[ABANDONED]','calleridname','[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration','inspect','lodash','md5','util','./util','../../../../config/environment','zendesk','redis','defaults','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','remoteUri','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Enduser\x20created.','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','debug','[HTTP]','stringify','map','type','string','nameField','customField','toLowerCase','content','custom_fields','idField','variable','variableName','Variable','push','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/agent/tickets/%s','error','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','POST','trigger:browser:url'];(function(_0xb84086,_0x3c3764){var _0x663b90=function(_0x5f0f6e){while(--_0x5f0f6e){_0xb84086['push'](_0xb84086['shift']());}};_0x663b90(++_0x3c3764);}(_0x47c7,0x1ab));var _0x747c=function(_0x265aa2,_0x220072){_0x265aa2=_0x265aa2-0x0;var _0x447a3a=_0x47c7[_0x265aa2];return _0x447a3a;};'use strict';var _=require(_0x747c('0x0'));var rp=require('request-promise');var md5=require(_0x747c('0x1'));var util=require(_0x747c('0x2'));var Redis=require('ioredis');var intUtil=require(_0x747c('0x3'));var config=require(_0x747c('0x4'));var logger=require('../../../../config/logger')(_0x747c('0x5'));config[_0x747c('0x6')]=_[_0x747c('0x7')](config[_0x747c('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x747c('0x8'))(new Redis(config['redis']));function emit(_0xfc4504,_0x24206f,_0x10b9f0){io['to'](_0xfc4504)[_0x747c('0x9')](_0x24206f,_0x10b9f0);}var headers={'Content-Type':_0x747c('0xa'),'Accept':'application/json'};function getTicket(_0x47eac8,_0x22cedd,_0x3b5d7c,_0x240d02,_0x47bd62){logger[_0x747c('0xb')](_0x747c('0xc'));return request({'uri':util[_0x747c('0xd')]('%s/tickets.json',_0x47eac8[_0x747c('0xe')]),'method':'POST','body':{'ticket':_['merge']({'requester_id':_0x3b5d7c['id'],'submitter_id':_0x22cedd?_0x22cedd['id']:undefined,'assignee_id':_0x22cedd?_0x22cedd['id']:undefined,'tags':getTags(_0x240d02[_0x747c('0xf')],_0x747c('0x10')),'subject':intUtil[_0x747c('0x11')](_0x240d02[_0x747c('0x12')],_0x47bd62,'\x20'),'description':intUtil[_0x747c('0x11')](_0x240d02[_0x747c('0x13')],_0x47bd62,'\x0a'),'comment':{'public':![],'body':intUtil[_0x747c('0x11')](_0x240d02[_0x747c('0x13')],_0x47bd62,'\x0a')}},getCustomFields(_0x240d02[_0x747c('0x14')],_0x47bd62))}})[_0x747c('0x15')](function(_0x4f98ac){logger['info'](_0x747c('0x16'));return _0x4f98ac[_0x747c('0x17')];});}function getUser(_0x6f79a1,_0x5caaad){if(intUtil[_0x747c('0x18')](_0x5caaad)){logger[_0x747c('0xb')](_0x747c('0x19'),_0x5caaad);return request({'uri':util[_0x747c('0xd')](_0x747c('0x1a'),_0x6f79a1[_0x747c('0xe')]),'qs':{'query':util['format'](_0x747c('0x1b'),_0x5caaad)}})['then'](function(_0xbe4b7){if(_0xbe4b7[_0x747c('0x1c')]){logger[_0x747c('0xb')]('Agent\x20found!');return _[_0x747c('0x1d')](_0xbe4b7[_0x747c('0x1e')],{'email':_0x5caaad,'role':_0x747c('0x1f')});}else{logger[_0x747c('0xb')](_0x747c('0x20'));return request({'uri':util[_0x747c('0xd')](_0x747c('0x21'),_0x6f79a1[_0x747c('0xe')])})[_0x747c('0x15')](function(_0x3a748f){logger[_0x747c('0xb')](_0x747c('0x22'));return _0x3a748f['user'];});}});}else{logger[_0x747c('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x747c('0xd')](_0x747c('0x21'),_0x6f79a1[_0x747c('0xe')])})[_0x747c('0x15')](function(_0x51b967){logger['info'](_0x747c('0x22'));return _0x51b967[_0x747c('0x23')];});}}function getEndUser(_0x20588d,_0x42b227,_0x76ac79){logger['info'](_0x747c('0x24'),_0x76ac79);return request({'uri':util[_0x747c('0xd')](_0x747c('0x1a'),_0x20588d['remoteUri']),'qs':{'query':util[_0x747c('0xd')]('type:user\x20role:end-user\x20phone:%s',_0x76ac79)}})[_0x747c('0x15')](function(_0xefedcd){var _0x12d799;if(_0xefedcd[_0x747c('0x1e')][_0x747c('0x25')]){_0xefedcd[_0x747c('0x1e')]=_[_0x747c('0x26')](_0xefedcd[_0x747c('0x1e')],{'suspended':![],'role':_0x747c('0x27')});if(_0xefedcd['results'][_0x747c('0x25')]){_0x12d799=_[_0x747c('0x28')](_0xefedcd[_0x747c('0x1e')]);}}if(_0x12d799){logger[_0x747c('0xb')](_0x747c('0x29'));return _0x12d799;}else{logger[_0x747c('0xb')](_0x747c('0x2a'));return request({'uri':util[_0x747c('0xd')](_0x747c('0x2b'),_0x20588d[_0x747c('0xe')]),'method':'POST','body':{'user':{'role':'end-user','name':util[_0x747c('0xd')]('Caller\x20-\x20%s',_0x42b227||_0x76ac79),'phone':_0x76ac79}}})['then'](function(_0x596246){logger['info'](_0x747c('0x2c'));return _0x596246[_0x747c('0x23')];});}});}function getAuth(_0x196242){var _0xead74f;if(_0x196242['authType']===_0x747c('0x2d')){_0xead74f=util[_0x747c('0xd')](_0x747c('0x2e'),_0x196242[_0x747c('0x2f')],_0x196242[_0x747c('0x2d')]);}else if(_0x196242['authType']===_0x747c('0x30')){_0xead74f=util[_0x747c('0xd')](_0x747c('0x31'),_0x196242[_0x747c('0x2f')],_0x196242[_0x747c('0x30')]);}return util[_0x747c('0xd')](_0x747c('0x32'),new Buffer(_0xead74f)[_0x747c('0x33')]('base64'));}function request(_0x4f0439){logger[_0x747c('0x34')](_0x747c('0x35'),JSON[_0x747c('0x36')](_0x4f0439));return rp(_['defaults'](_0x4f0439,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x38d06a,_0x288683){var _0x578980=[];if(_0x38d06a&&_0x38d06a['length']>0x0){_0x578980=_[_0x747c('0x37')](_0x38d06a,_0x288683);}return _0x578980;}function getCustomFields(_0x3c571b,_0x10db96){var _0x122c73=[];var _0x20ae0={'custom_fields':[]};if(_0x3c571b[_0x747c('0x25')]>0x0){_['forEach'](_0x3c571b,function(_0x1f0819){if(_0x1f0819[_0x747c('0x38')]===_0x747c('0x39')&&_0x1f0819[_0x747c('0x3a')]&&!_0x1f0819[_0x747c('0x3b')]){_0x20ae0[_0x1f0819[_0x747c('0x3a')][_0x747c('0x3c')]()]=_0x1f0819[_0x747c('0x3d')][_0x747c('0x33')]();}else if(_0x1f0819[_0x747c('0x38')]===_0x747c('0x39')&&_0x1f0819['idField']&&_0x1f0819[_0x747c('0x3b')]){_0x20ae0[_0x747c('0x3e')]['push']({'id':_0x1f0819[_0x747c('0x3f')],'value':_0x1f0819[_0x747c('0x3d')][_0x747c('0x33')]()});}else if(_0x1f0819[_0x747c('0x38')]===_0x747c('0x40')&&_0x1f0819['variableName']&&_0x1f0819[_0x747c('0x3f')]&&_0x1f0819['customField']){_0x10db96[_0x1f0819[_0x747c('0x41')]]&&_0x20ae0['custom_fields']['push']({'id':_0x1f0819[_0x747c('0x3f')],'value':_0x10db96[_0x1f0819['variableName']][_0x747c('0x33')]()});}else if(_0x1f0819[_0x747c('0x38')]==='customVariable'&&_0x1f0819['Variable']&&_0x1f0819[_0x747c('0x42')][_0x747c('0x10')]&&_0x1f0819[_0x747c('0x3f')]&&_0x1f0819[_0x747c('0x3b')]){_0x10db96[_0x1f0819[_0x747c('0x42')][_0x747c('0x10')][_0x747c('0x3c')]()]&&_0x20ae0[_0x747c('0x3e')][_0x747c('0x43')]({'id':_0x1f0819[_0x747c('0x3f')],'value':_0x10db96[_0x1f0819[_0x747c('0x42')][_0x747c('0x10')]['toLowerCase']()][_0x747c('0x33')]()});}});}return _0x20ae0;}exports['queue']=function(_0x7a9a0,_0xadd772,_0x5132b0,_0x9aeae,_0x4f9578,_0x4903f3){var _0xd52d9d,_0x3f12dc;_0x4903f3['remoteUri']=intUtil[_0x747c('0x44')](_0x4903f3[_0x747c('0xe')]);_0x4903f3['serverUrl']=intUtil[_0x747c('0x44')](_0x4903f3[_0x747c('0x45')]);if(_0x4f9578&&_0x4f9578[_0x747c('0x46')]){logger[_0x747c('0xb')](_0x747c('0x47'),_0x747c('0x48'));_0xadd772[_0x747c('0x49')]=util['format'](_0x747c('0x4a'),_0x4903f3['serverUrl'],_0xadd772[_0x747c('0x4b')],md5(_0xadd772[_0x747c('0x4b')]));}else{_0xadd772[_0x747c('0x49')]='';}headers[_0x747c('0x4c')]=getAuth(_0x4903f3);return getUser(_0x4903f3,_0x9aeae[_0x747c('0x4d')])['then'](function(_0x8d3dba){_0xd52d9d=_0x8d3dba;logger[_0x747c('0xb')](_0x747c('0x4e'),_0xd52d9d['id']);return getEndUser(_0x4903f3,_0xadd772['calleridname'],_0xadd772[_0x747c('0x4f')]);})[_0x747c('0x15')](function(_0x4523a9){_0x3f12dc=_0x4523a9;logger[_0x747c('0xb')](_0x747c('0x50'),_0x3f12dc['id']);return getTicket(_0x4903f3,_0xd52d9d,_0x3f12dc,_0x5132b0,_0xadd772);})[_0x747c('0x15')](function(_0x3ac99a){if(_0x3ac99a){logger[_0x747c('0xb')](_0x747c('0x51'),_0x3ac99a['id']);switch(_0x4903f3['type']){case _0x747c('0x52'):logger[_0x747c('0xb')](_0x747c('0x47'),_0x747c('0x53'));return request({'uri':util[_0x747c('0xd')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x4903f3[_0x747c('0xe')],_0xd52d9d['id'],_0x3ac99a['id']),'method':'POST'});case _0x747c('0x54'):logger[_0x747c('0xb')](_0x747c('0x47'),_0x747c('0x55'));emit(util[_0x747c('0xd')](_0x747c('0x56'),_0x9aeae['name']),'trigger:browser:url',{'uri':util[_0x747c('0xd')](_0x747c('0x57'),_0x4903f3[_0x747c('0xe')],_0x3ac99a['id'])});break;default:logger[_0x747c('0x58')](_0x747c('0x47'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x747c('0x59')](function(_0x1f498a){logger[_0x747c('0x58')](_0x747c('0x5a'),util['inspect'](_0x1f498a,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0xf0eadc,_0x145bc3,_0x6619a2,_0x5d8a23,_0x3cdf84,_0x32dad8,_0x502965){var _0x19ee24,_0x37b442;_0x32dad8[_0x747c('0xe')]=intUtil[_0x747c('0x44')](_0x32dad8[_0x747c('0xe')]);_0x32dad8[_0x747c('0x45')]=intUtil[_0x747c('0x44')](_0x32dad8[_0x747c('0x45')]);if(_0x502965&&_0x502965[_0x747c('0x5b')]&&_0x502965[_0x747c('0x5b')]!==_0x747c('0x5c')){logger[_0x747c('0xb')](_0x747c('0x5d'),_0x747c('0x48'));_0x145bc3['recordingURL']=util[_0x747c('0xd')](_0x747c('0x4a'),_0x32dad8[_0x747c('0x45')],_0x145bc3[_0x747c('0x4b')],md5(_0x145bc3[_0x747c('0x4b')]));}headers[_0x747c('0x4c')]=getAuth(_0x32dad8);return getUser(_0x32dad8,_0x5d8a23[_0x747c('0x4d')])[_0x747c('0x15')](function(_0x43e430){_0x19ee24=_0x43e430;logger[_0x747c('0xb')]('The\x20User\x20ID\x20is:',_0x19ee24['id']);return getEndUser(_0x32dad8,_0x145bc3[_0x747c('0x5e')],_0x145bc3[_0x747c('0x5f')]);})[_0x747c('0x15')](function(_0x28bf4f){_0x37b442=_0x28bf4f;logger[_0x747c('0xb')](_0x747c('0x50'),_0x37b442['id']);return getTicket(_0x32dad8,_0x19ee24,_0x37b442,_0x6619a2,_0x145bc3);})[_0x747c('0x15')](function(_0x20667a){if(_0x20667a){logger[_0x747c('0xb')](_0x747c('0x51'),_0x20667a['id']);switch(_0x32dad8[_0x747c('0x38')]){case _0x747c('0x52'):logger[_0x747c('0xb')](_0x747c('0x5d'),_0x747c('0x53'));return request({'uri':util[_0x747c('0xd')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x32dad8[_0x747c('0xe')],_0x19ee24['id'],_0x20667a['id']),'method':_0x747c('0x60')});case'newTab':logger[_0x747c('0xb')](_0x747c('0x5d'),_0x747c('0x55'));emit(util[_0x747c('0xd')](_0x747c('0x56'),_0x5d8a23[_0x747c('0x10')]),_0x747c('0x61'),{'uri':util[_0x747c('0xd')]('%s/agent/tickets/%s',_0x32dad8[_0x747c('0xe')],_0x20667a['id'])});break;default:logger['error'](_0x747c('0x5d'),_0x747c('0x62'));}}})[_0x747c('0x59')](function(_0x3d30a9){logger[_0x747c('0x58')](_0x747c('0x63'),util['inspect'](_0x3d30a9,{'showHidden':!![],'depth':null}));});};exports[_0x747c('0x64')]=function(_0x4eda07,_0x62f5a1,_0x3c4b34,_0x20fff4,_0x76f5fe,_0x59ff4a){var _0x2f04ab,_0x272c0d;_0x59ff4a[_0x747c('0xe')]=intUtil[_0x747c('0x44')](_0x59ff4a['remoteUri']);_0x59ff4a[_0x747c('0x45')]=intUtil[_0x747c('0x44')](_0x59ff4a[_0x747c('0x45')]);if(_0x76f5fe&&_0x76f5fe[_0x747c('0x46')]){logger[_0x747c('0xb')](_0x747c('0x65'),_0x747c('0x48'));_0x62f5a1[_0x747c('0x49')]=util['format'](_0x747c('0x4a'),_0x59ff4a[_0x747c('0x45')],_0x62f5a1[_0x747c('0x4b')],md5(_0x62f5a1['uniqueid']));}else{_0x62f5a1['recordingURL']='';}headers[_0x747c('0x4c')]=getAuth(_0x59ff4a);return getUser(_0x59ff4a)[_0x747c('0x15')](function(_0x15cd89){_0x2f04ab=_0x15cd89;logger[_0x747c('0xb')]('The\x20User\x20ID\x20is:',_0x2f04ab['id']);return getEndUser(_0x59ff4a,_0x62f5a1[_0x747c('0x66')],_0x62f5a1[_0x747c('0x4f')]);})[_0x747c('0x15')](function(_0x320dd9){_0x272c0d=_0x320dd9;logger['info'](_0x747c('0x50'),_0x272c0d['id']);return getTicket(_0x59ff4a,_0x2f04ab,_0x272c0d,_0x3c4b34,_0x62f5a1);})[_0x747c('0x15')](function(_0x35619c){if(_0x35619c){logger[_0x747c('0xb')]('The\x20Ticket\x20ID\x20is:',_0x35619c['id']);}})['catch'](function(_0x545947){logger['error'](_0x747c('0x67'),util[_0x747c('0x68')](_0x545947,{'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 0ec73c9..0137ce9 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 _0x5c38=['Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','/crm/v2/','moduleCreate','role','first_name','last_name','code','SUCCESS','Error\x20on\x20Lead\x20retrieve:\x20','Creating\x20new\x20call...','Owner','administrator','getString','Subjects','Descriptions','Contacts','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','utc','answertime','endtime','diff','starttime','YYYY-MM-DDTHH:mm:ss','mm:ss','lastevent','called','Call_Result','Called','complete','connect','abandoned','Abandoned','Call_Start_Time','outbound','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','details','err','log','queue','host','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','https://crm.','recordingFormat','none','destcalleridname','destcalleridnum','Outbound','[OUTBOUND]','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','monitor_format','request-promise','util','./util','ioredis','../../../../config/environment','../../../../config/logger','zoho','redis','localhost','stringify','forEach','type','string','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientSecret','then','seconds','catch','error','stack','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','info','profile','user','Administrator','Using\x20the\x20admin\x20account!','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','Search\x20end\x20user','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','data','enduserType','End\x20user\x20found\x20(Contact)','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads'];(function(_0x4715ac,_0x150dd8){var _0x42dc6b=function(_0x258438){while(--_0x258438){_0x4715ac['push'](_0x4715ac['shift']());}};_0x42dc6b(++_0x150dd8);}(_0x5c38,0xe0));var _0x85c3=function(_0x54d177,_0xff3425){_0x54d177=_0x54d177-0x0;var _0x18c4f5=_0x5c38[_0x54d177];return _0x18c4f5;};'use strict';var _=require('lodash');var rp=require(_0x85c3('0x0'));var md5=require('md5');var util=require(_0x85c3('0x1'));var intUtil=require(_0x85c3('0x2'));var moment=require('moment');var Redis=require(_0x85c3('0x3'));var config=require(_0x85c3('0x4'));var logger=require(_0x85c3('0x5'))(_0x85c3('0x6'));config[_0x85c3('0x7')]=_['defaults'](config[_0x85c3('0x7')],{'host':_0x85c3('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x85c3('0x7')]));function emit(_0x142421,_0xaf804c,_0x2a167e){io['to'](_0x142421)['emit'](_0xaf804c,_0x2a167e);}function request(_0x3c1b89){logger['debug']('[HTTP]',JSON[_0x85c3('0x9')](_0x3c1b89));return rp(_0x3c1b89);}function getCustomFields(_0x3885de,_0xe6b7a3){var _0x3aa1ca={};if(_0x3885de['length']>0x0){_[_0x85c3('0xa')](_0x3885de,function(_0x2b3f7b){if(_0x2b3f7b[_0x85c3('0xb')]===_0x85c3('0xc')&&_0x2b3f7b[_0x85c3('0xd')]){_0x3aa1ca[_0x2b3f7b[_0x85c3('0xd')]]=_0x2b3f7b[_0x85c3('0xe')][_0x85c3('0xf')]();}else if(_0x2b3f7b[_0x85c3('0xb')]===_0x85c3('0x10')&&_0x2b3f7b['variableName']&&_0x2b3f7b[_0x85c3('0xd')]&&_0xe6b7a3[_0x2b3f7b[_0x85c3('0x11')]]){_0x3aa1ca[_0x2b3f7b['idField']]=_0xe6b7a3[_0x2b3f7b[_0x85c3('0x11')]][_0x85c3('0xf')]();}else if(_0x2b3f7b[_0x85c3('0xb')]===_0x85c3('0x12')&&_0x2b3f7b['Variable']&&_0x2b3f7b[_0x85c3('0x13')][_0x85c3('0x14')]&&_0x2b3f7b[_0x85c3('0xd')]&&_0xe6b7a3[_0x2b3f7b[_0x85c3('0x13')][_0x85c3('0x14')]['toLowerCase']()]){_0x3aa1ca[_0x2b3f7b[_0x85c3('0xd')]]=_0xe6b7a3[_0x2b3f7b[_0x85c3('0x13')][_0x85c3('0x14')][_0x85c3('0x15')]()][_0x85c3('0xf')]();}});}return _0x3aa1ca;}function getName(_0x4bbf3b){if(_0x4bbf3b[_0x85c3('0x16')]('\x20')>0x0){var _0x3a0ffc=_0x4bbf3b[_0x85c3('0x17')](/ (.+)/);if(_0x3a0ffc[0x1]){return _0x3a0ffc;}}return[_0x4bbf3b,_0x4bbf3b];}var accountsTokens={};function getAccessToken(_0x3ba3a7){return new Promise(function(_0x512231,_0x3ece24){if(!_[_0x85c3('0x18')](accountsTokens[_0x3ba3a7['id']])&&!_[_0x85c3('0x18')](accountsTokens[_0x3ba3a7['id']][_0x85c3('0x19')])){if(moment()[_0x85c3('0x1a')](accountsTokens[_0x3ba3a7['id']][_0x85c3('0x1b')])){_0x512231(accountsTokens[_0x3ba3a7['id']][_0x85c3('0x19')]);}}var _0x565274;switch(_0x3ba3a7[_0x85c3('0x1c')]){case'US':_0x565274=_0x85c3('0x1d');break;case'AU':_0x565274=_0x85c3('0x1e');break;case'EU':_0x565274=_0x85c3('0x1f');break;case'IN':_0x565274='https://accounts.zoho.in';break;case'CN':_0x565274=_0x85c3('0x20');break;default:_0x565274='https://accounts.zoho.eu';break;}var _0x53b918={'method':_0x85c3('0x21'),'uri':_0x565274+_0x85c3('0x22'),'qs':{'refresh_token':_0x3ba3a7[_0x85c3('0x23')],'client_id':_0x3ba3a7['clientId'],'client_secret':_0x3ba3a7[_0x85c3('0x24')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x53b918)[_0x85c3('0x25')](function(_0x5a6864){accountsTokens[_0x3ba3a7['id']]={'access_token':_0x5a6864[_0x85c3('0x19')],'expires_in':moment()['add'](_0x5a6864[_0x85c3('0x1b')],_0x85c3('0x26'))};_0x512231(_0x5a6864['access_token']);})[_0x85c3('0x27')](function(_0x3d3633){logger[_0x85c3('0x28')]('Failing\x20creating\x20the\x20access_token',_0x3d3633[_0x85c3('0x29')]);_0x3ece24(_0x3d3633);});});}function getUser(_0x178a1d,_0x13b25d,_0xa033f3,_0x42d504){logger['info'](_0x85c3('0x2a'));return request({'method':_0x85c3('0x2b'),'uri':util[_0x85c3('0x2c')](_0x85c3('0x2d'),_0x13b25d),'qs':{'type':_0x85c3('0x2e')},'headers':{'Authorization':_0x85c3('0x2f')+_0x178a1d},'json':!![]})['then'](function(_0x5d0d68){if(_0x5d0d68[_0x85c3('0x30')]){var _0x1a0705=-0x1;if(_[_0x85c3('0x31')](_0x5d0d68[_0x85c3('0x30')])){if(!_[_0x85c3('0x18')](_0x42d504)){_0x1a0705=_[_0x85c3('0x32')](_0x5d0d68[_0x85c3('0x30')],function(_0x48cc1c){return _0x48cc1c['email']===_0x42d504;});}if(_0x1a0705>=0x0){logger[_0x85c3('0x33')]('Agent\x20found!');}else{logger[_0x85c3('0x33')]('Using\x20the\x20admin\x20account!');_0x1a0705=_[_0x85c3('0x32')](_0x5d0d68[_0x85c3('0x30')],function(_0x2318cf){return _0x2318cf[_0x85c3('0x34')]['name']==='Administrator';});}return _0x5d0d68['users'][_0x1a0705];}else{if(_0x5d0d68[_0x85c3('0x35')][_0x85c3('0x34')][_0x85c3('0x14')]===_0x85c3('0x36')){logger[_0x85c3('0x33')](_0x85c3('0x37'));user=_0x5d0d68[_0x85c3('0x35')];return user;}else{logger[_0x85c3('0x28')](_0x85c3('0x38'),JSON[_0x85c3('0x9')](_0x5d0d68));throw new Error(_0x85c3('0x39')+JSON[_0x85c3('0x9')](_0x5d0d68));}}}else{logger[_0x85c3('0x28')](_0x85c3('0x38'),JSON[_0x85c3('0x9')](_0x5d0d68));throw new Error(_0x85c3('0x39')+JSON['stringify'](_0x5d0d68));}})[_0x85c3('0x27')](function(_0x1a9237){console[_0x85c3('0x28')](_0x1a9237);});}function getEndUser(_0x332f22,_0x25c5f4,_0x574edc,_0x320887,_0x369030,_0x32e812,_0x2536b7){logger[_0x85c3('0x33')](_0x85c3('0x3a'));return request({'method':_0x85c3('0x2b'),'uri':_0x85c3('0x3b')+_0x25c5f4+_0x85c3('0x3c')+_0x369030+'))','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x332f22},'json':!![]})[_0x85c3('0x25')](function(_0x5c3f82){if(_0x5c3f82){var _0x56f62a=_0x5c3f82[_0x85c3('0x3d')][0x0];_0x56f62a[_0x85c3('0x3e')]='Contacts';logger['info'](_0x85c3('0x3f'));return _0x56f62a;}else{return request({'method':_0x85c3('0x2b'),'uri':_0x85c3('0x3b')+_0x25c5f4+_0x85c3('0x40')+_0x369030+'))','headers':{'Authorization':_0x85c3('0x2f')+_0x332f22},'json':!![]})[_0x85c3('0x25')](function(_0x35bceb){if(_0x35bceb){var _0x27c4e8=_0x35bceb['data'][0x0];_0x27c4e8[_0x85c3('0x3e')]=_0x85c3('0x41');logger[_0x85c3('0x33')]('End\x20user\x20found\x20(Lead)');return _0x27c4e8;}else{logger[_0x85c3('0x33')](_0x85c3('0x42'));_0x320887=getName(_0x320887);return request({'method':_0x85c3('0x21'),'uri':_0x85c3('0x3b')+_0x25c5f4+_0x85c3('0x43')+_0x2536b7[_0x85c3('0x44')],'body':{'data':[{'Last_Name':_0x320887[0x1],'First_Name':_0x320887[0x0],'Phone':_0x369030,'Owner':{'name':!_[_0x85c3('0x18')](_0x32e812[_0x85c3('0x45')]['name'])?_0x32e812[_0x85c3('0x45')][_0x85c3('0x14')]:!_[_0x85c3('0x18')](_0x32e812[_0x85c3('0x46')])?_0x32e812[_0x85c3('0x46')]+'\x20'+_0x32e812[_0x85c3('0x47')]:_0x32e812[_0x85c3('0x47')],'id':_0x32e812['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x332f22},'json':!![]})[_0x85c3('0x25')](function(_0x221fe8){if(_0x221fe8&&_0x221fe8[_0x85c3('0x3d')][0x0][_0x85c3('0x48')]===_0x85c3('0x49')){var _0x4b7605=_0x221fe8[_0x85c3('0x3d')][0x0]['details'];_0x4b7605[_0x85c3('0x3e')]=_0x2536b7[_0x85c3('0x44')];return _0x4b7605;}logger['error'](_0x85c3('0x38'),JSON[_0x85c3('0x9')](_0x221fe8));throw new Error(_0x85c3('0x4a')+JSON[_0x85c3('0x9')](_0x221fe8));});}});}});}function getCall(_0x259e93,_0x1bb75c,_0x282354,_0x11f47a,_0x1232e6,_0x56d270,_0x1494b3,_0x2e9b71){logger[_0x85c3('0x33')](_0x85c3('0x4b'));var _0x11ccf6={};_0x11ccf6[_0x85c3('0x4c')]={'name':!_['isNil'](_0x11f47a[_0x85c3('0x45')][_0x85c3('0x14')])&&!_[_0x85c3('0x18')](_0x11f47a[_0x85c3('0x34')][_0x85c3('0x14')])&&_0x11f47a[_0x85c3('0x34')]['name']===_0x85c3('0x4d')?_0x11f47a['role'][_0x85c3('0x14')]:!_[_0x85c3('0x18')](_0x11f47a[_0x85c3('0x46')])?_0x11f47a['first_name']+'\x20'+_0x11f47a[_0x85c3('0x47')]:_0x11f47a['last_name'],'id':_0x11f47a['id']};_0x11ccf6['Subject']=intUtil[_0x85c3('0x4e')](_0x56d270[_0x85c3('0x4f')],_0x1494b3,'\x20');_0x11ccf6['Description']=intUtil[_0x85c3('0x4e')](_0x56d270[_0x85c3('0x50')],_0x1494b3,'\x0a');if(_0x1232e6[_0x85c3('0x3e')]===_0x85c3('0x51')){_0x11ccf6[_0x85c3('0x52')]={'name':!_[_0x85c3('0x18')](_0x1232e6[_0x85c3('0x53')])?_0x1232e6[_0x85c3('0x53')]:!_[_0x85c3('0x18')](_0x1232e6[_0x85c3('0x54')])?_0x1232e6[_0x85c3('0x54')]+'\x20'+_0x1232e6['Last_Name']:_0x1232e6[_0x85c3('0x55')],'id':_0x1232e6['id']};}if(_0x1232e6['enduserType']===_0x85c3('0x41')){_0x11ccf6[_0x85c3('0x56')]={'name':!_[_0x85c3('0x18')](_0x1232e6['Full_Name'])?_0x1232e6['Full_Name']:!_[_0x85c3('0x18')](_0x1232e6['First_Name'])?_0x1232e6[_0x85c3('0x54')]+'\x20'+_0x1232e6[_0x85c3('0x55')]:_0x1232e6[_0x85c3('0x55')],'id':_0x1232e6['id']};_0x11ccf6[_0x85c3('0x57')]=_0x1232e6[_0x85c3('0x3e')];}if(_0x1494b3[_0x85c3('0x58')]){_0x11ccf6[_0x85c3('0x59')]=moment[_0x85c3('0x5a')](parseInt(_0x1494b3[_0x85c3('0x58')])*0x3e8)[_0x85c3('0x2c')]('mm:ss');}else if(_0x1494b3[_0x85c3('0x5b')]&&_0x1494b3[_0x85c3('0x5c')]){_0x11ccf6['Call_Duration']=moment[_0x85c3('0x5a')](moment(_0x1494b3['endtime'],'YYYY-MM-DDTHH:mm:ss')[_0x85c3('0x5d')](moment(_0x1494b3[_0x85c3('0x5e')],_0x85c3('0x5f'))))[_0x85c3('0x2c')](_0x85c3('0x60'));}switch(_0x1494b3[_0x85c3('0x61')]){case _0x85c3('0x62'):_0x11ccf6[_0x85c3('0x63')]=_0x85c3('0x64');break;case _0x85c3('0x65'):case _0x85c3('0x66'):_0x11ccf6[_0x85c3('0x63')]='Answered';break;case'rejected':_0x11ccf6[_0x85c3('0x63')]='Rejected';break;case _0x85c3('0x67'):_0x11ccf6['Call_Result']=_0x85c3('0x68');break;default:}_0x11ccf6[_0x85c3('0x69')]=(_0x2e9b71===_0x85c3('0x6a')?moment(_0x1494b3['starttime'])['format'](_0x85c3('0x5f')):moment(_0x1494b3['agentcalledAt'])[_0x85c3('0x2c')](_0x85c3('0x5f')))||moment()[_0x85c3('0x2c')]('YYYY-MM-DDTHH:mm:ss');_0x11ccf6[_0x85c3('0x6b')]=_0x2e9b71||_0x85c3('0x6c');_0x11ccf6=_[_0x85c3('0x6d')](_0x11ccf6,getCustomFields(_0x56d270[_0x85c3('0x6e')],_0x1494b3));return request({'method':_0x85c3('0x21'),'uri':_0x85c3('0x3b')+_0x1bb75c+_0x85c3('0x6f'),'headers':{'Authorization':_0x85c3('0x2f')+_0x259e93},'body':{'data':[_0x11ccf6]},'json':!![]})[_0x85c3('0x25')](function(_0x230e14){if(_0x230e14&&_0x230e14['data'][0x0][_0x85c3('0x48')]===_0x85c3('0x49')){logger[_0x85c3('0x33')]('Call\x20created!');return{'id':_0x230e14['data'][0x0][_0x85c3('0x70')]['id']};}})['catch'](function(_0x43f40a){logger['info'](_0x85c3('0x71'),_0x43f40a[_0x85c3('0x29')]);console[_0x85c3('0x72')](_0x85c3('0x71'),_0x43f40a);});}exports[_0x85c3('0x73')]=function(_0x4580a7,_0x3d3f45,_0x5a079a,_0x31b918,_0x393bcc,_0x355a35){var _0x315317,_0x37ef49,_0x225c2a;_0x355a35[_0x85c3('0x74')]=intUtil[_0x85c3('0x75')](_0x355a35[_0x85c3('0x74')]);_0x355a35[_0x85c3('0x76')]=intUtil[_0x85c3('0x75')](_0x355a35[_0x85c3('0x76')]);if(_0x393bcc&&_0x393bcc['monitor_format']){logger['info'](_0x85c3('0x77'),_0x85c3('0x78'));_0x3d3f45[_0x85c3('0x79')]=_0x355a35[_0x85c3('0x76')]+_0x85c3('0x7a')+_0x3d3f45[_0x85c3('0x7b')]+_0x85c3('0x7c')+md5(_0x3d3f45['uniqueid']);}else{_0x3d3f45[_0x85c3('0x79')]='';}var _0x2c03b8=_0x355a35[_0x85c3('0x74')]===_0x85c3('0x7d')?'eu':_0x85c3('0x7e');return getAccessToken(_0x355a35)[_0x85c3('0x25')](function(_0x19c1d9){_0x225c2a=_0x19c1d9;return getUser(_0x225c2a,_0x2c03b8,_0x355a35,_0x31b918[_0x85c3('0x7f')]);})[_0x85c3('0x25')](function(_0xc950a4){_0x315317=_0xc950a4;logger[_0x85c3('0x33')](_0x85c3('0x80'),_0x315317['id']);return getEndUser(_0x225c2a,_0x2c03b8,_0x355a35,_0x3d3f45[_0x85c3('0x81')],_0x3d3f45[_0x85c3('0x82')],_0x315317,_0x5a079a);})[_0x85c3('0x25')](function(_0x5dcb82){_0x37ef49=_0x5dcb82;logger[_0x85c3('0x33')](_0x85c3('0x83'),_0x37ef49['id']);return getCall(_0x225c2a,_0x2c03b8,_0x355a35,_0x315317,_0x37ef49,_0x5a079a,_0x3d3f45,_0x85c3('0x6c'));})[_0x85c3('0x25')](function(_0x3f5029){if(_0x3f5029){logger[_0x85c3('0x33')](_0x85c3('0x84'),_0x3f5029['id']);logger[_0x85c3('0x33')]('[QUEUE]',_0x85c3('0x85'));emit(util[_0x85c3('0x2c')](_0x85c3('0x86'),_0x31b918[_0x85c3('0x14')]),'trigger:browser:url',{'uri':_0x85c3('0x87')+_0x355a35[_0x85c3('0x74')]+'/crm/EntityInfo.do?module=Calls&id='+_0x3f5029['id']});}})[_0x85c3('0x27')](function(_0x307adf){logger[_0x85c3('0x28')](_0x85c3('0x77'),JSON['stringify'](_0x307adf));});};exports[_0x85c3('0x6a')]=function(_0x485f1d,_0x15c8b4,_0x31b840,_0x216ce2,_0x4e38c6,_0x492e64,_0x292b94){var _0x3c6ea9,_0x11e99d,_0x4ed38d;_0x492e64[_0x85c3('0x74')]=intUtil[_0x85c3('0x75')](_0x492e64['host']);_0x492e64[_0x85c3('0x76')]=intUtil[_0x85c3('0x75')](_0x492e64[_0x85c3('0x76')]);if(_0x292b94&&_0x292b94[_0x85c3('0x88')]&&_0x292b94[_0x85c3('0x88')]!==_0x85c3('0x89')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x15c8b4['recordingURL']=_0x492e64[_0x85c3('0x76')]+'/api/voice/recordings/'+_0x15c8b4[_0x85c3('0x7b')]+_0x85c3('0x7c')+md5(_0x15c8b4[_0x85c3('0x7b')]);}var _0x323435=_0x492e64[_0x85c3('0x74')]===_0x85c3('0x7d')?'eu':_0x85c3('0x7e');return getAccessToken(_0x492e64)[_0x85c3('0x25')](function(_0x21738d){_0x4ed38d=_0x21738d;return getUser(_0x4ed38d,_0x323435,_0x492e64,_0x216ce2[_0x85c3('0x7f')]);})[_0x85c3('0x25')](function(_0xf88d4f){_0x3c6ea9=_0xf88d4f;logger['info'](_0x85c3('0x80'),_0x3c6ea9['id']);return getEndUser(_0x4ed38d,_0x323435,_0x492e64,_0x15c8b4[_0x85c3('0x8a')],_0x15c8b4[_0x85c3('0x8b')],_0x3c6ea9,_0x31b840);})[_0x85c3('0x25')](function(_0x7fb180){_0x11e99d=_0x7fb180;logger[_0x85c3('0x33')]('The\x20Enduser\x20ID\x20is:',_0x11e99d['id']);return getCall(_0x4ed38d,_0x323435,_0x492e64,_0x3c6ea9,_0x11e99d,_0x31b840,_0x15c8b4,_0x85c3('0x8c'));})[_0x85c3('0x25')](function(_0x8c19aa){if(_0x8c19aa){logger[_0x85c3('0x33')](_0x85c3('0x84'),_0x8c19aa['id']);logger[_0x85c3('0x33')](_0x85c3('0x8d'),_0x85c3('0x85'));emit(util[_0x85c3('0x2c')](_0x85c3('0x86'),_0x216ce2[_0x85c3('0x14')]),_0x85c3('0x8e'),{'uri':_0x85c3('0x87')+_0x492e64['host']+_0x85c3('0x8f')+_0x8c19aa['id']});}})[_0x85c3('0x27')](function(_0x568816){logger[_0x85c3('0x28')](_0x85c3('0x8d'),JSON[_0x85c3('0x9')](_0x568816));});};exports[_0x85c3('0x67')]=function(_0x152719,_0x297601,_0xf9fb8a,_0x164519,_0x2d21d6,_0x595b5e){var _0x5bed0b,_0x56e1bd,_0x4da97b;_0x595b5e[_0x85c3('0x74')]=intUtil[_0x85c3('0x75')](_0x595b5e[_0x85c3('0x74')]);_0x595b5e[_0x85c3('0x76')]=intUtil[_0x85c3('0x75')](_0x595b5e['serverUrl']);if(_0x2d21d6&&_0x2d21d6[_0x85c3('0x90')]){logger['info']('[ABANDONED]',_0x85c3('0x78'));_0x297601['recordingURL']=_0x595b5e['serverUrl']+'/api/voice/recordings/'+_0x297601['uniqueid']+_0x85c3('0x7c')+md5(_0x297601[_0x85c3('0x7b')]);}else{_0x297601[_0x85c3('0x79')]='';}var _0x1a502e=_0x595b5e['host']===_0x85c3('0x7d')?'eu':_0x85c3('0x7e');return getAccessToken(_0x595b5e)['then'](function(_0x88cfd5){_0x4da97b=_0x88cfd5;return getUser(_0x4da97b,_0x1a502e,_0x595b5e);})[_0x85c3('0x25')](function(_0x7cae42){_0x5bed0b=_0x7cae42;logger[_0x85c3('0x33')](_0x85c3('0x80'),_0x5bed0b['id']);return getEndUser(_0x4da97b,_0x1a502e,_0x595b5e,_0x297601[_0x85c3('0x81')],_0x297601['calleridnum'],_0x5bed0b,_0xf9fb8a);})[_0x85c3('0x25')](function(_0x5100a4){_0x56e1bd=_0x5100a4;logger['info'](_0x85c3('0x83'),_0x56e1bd['id']);return getCall(_0x4da97b,_0x1a502e,_0x595b5e,_0x5bed0b,_0x56e1bd,_0xf9fb8a,_0x297601,'Inbound');})[_0x85c3('0x25')](function(_0x5f591e){if(_0x5f591e){logger['info'](_0x85c3('0x84'),_0x5f591e['id']);}})['catch'](function(_0x3057d0){logger[_0x85c3('0x28')]('[ABANDONED]',JSON['stringify'](_0x3057d0));});}; \ No newline at end of file +var _0xeb85=['Subject','Subjects','Description','getString','Descriptions','Full_Name','First_Name','Last_Name','What_Id','$se_module','Call_Duration','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Call_Result','Called','complete','connect','Answered','abandoned','Abandoned','Call_Start_Time','outbound','Call_Type','merge','/crm/v2/Calls','Call\x20created!','log','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','recordingURL','com','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','The\x20Call\x20ID\x20is:','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','recordingFormat','none','[OUTBOUND]','zoho.eu','destcalleridname','destcalleridnum','Outbound','trigger:browser:url','https://crm.','[ABANDONED]','calleridname','request-promise','md5','util','./util','moment','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','debug','length','forEach','string','idField','content','type','variableName','customVariable','Variable','name','toLowerCase','toString','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','email','Agent\x20found!','Using\x20the\x20admin\x20account!','findIndex','profile','Administrator','user','The\x20failing\x20result\x20is','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','Search\x20end\x20user','GET','https://www.zohoapis.','data','enduserType','Contacts','End\x20user\x20found\x20(Contact)','Leads','End\x20user\x20found\x20(Lead)','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','/crm/v2/','role','first_name','last_name','code','SUCCESS','details','moduleCreate','Error\x20on\x20Lead\x20retrieve:\x20','Creating\x20new\x20call...','Owner'];(function(_0x39ed4a,_0x238829){var _0x63f2fd=function(_0x485061){while(--_0x485061){_0x39ed4a['push'](_0x39ed4a['shift']());}};_0x63f2fd(++_0x238829);}(_0xeb85,0x167));var _0x5eb8=function(_0x2c8fee,_0x39bdc6){_0x2c8fee=_0x2c8fee-0x0;var _0x5419b6=_0xeb85[_0x2c8fee];return _0x5419b6;};'use strict';var _=require('lodash');var rp=require(_0x5eb8('0x0'));var md5=require(_0x5eb8('0x1'));var util=require(_0x5eb8('0x2'));var intUtil=require(_0x5eb8('0x3'));var moment=require(_0x5eb8('0x4'));var Redis=require('ioredis');var config=require(_0x5eb8('0x5'));var logger=require(_0x5eb8('0x6'))('zoho');config[_0x5eb8('0x7')]=_[_0x5eb8('0x8')](config['redis'],{'host':_0x5eb8('0x9'),'port':0x18eb});var io=require(_0x5eb8('0xa'))(new Redis(config[_0x5eb8('0x7')]));function emit(_0x4e8b5e,_0x3f7fb5,_0x44b372){io['to'](_0x4e8b5e)[_0x5eb8('0xb')](_0x3f7fb5,_0x44b372);}function request(_0xb4fc46){logger[_0x5eb8('0xc')]('[HTTP]',JSON['stringify'](_0xb4fc46));return rp(_0xb4fc46);}function getCustomFields(_0x5f2a81,_0x4c364a){var _0x40b843={};if(_0x5f2a81[_0x5eb8('0xd')]>0x0){_[_0x5eb8('0xe')](_0x5f2a81,function(_0x1f96dd){if(_0x1f96dd['type']===_0x5eb8('0xf')&&_0x1f96dd[_0x5eb8('0x10')]){_0x40b843[_0x1f96dd[_0x5eb8('0x10')]]=_0x1f96dd[_0x5eb8('0x11')]['toString']();}else if(_0x1f96dd[_0x5eb8('0x12')]==='variable'&&_0x1f96dd[_0x5eb8('0x13')]&&_0x1f96dd[_0x5eb8('0x10')]&&_0x4c364a[_0x1f96dd[_0x5eb8('0x13')]]){_0x40b843[_0x1f96dd['idField']]=_0x4c364a[_0x1f96dd['variableName']]['toString']();}else if(_0x1f96dd[_0x5eb8('0x12')]===_0x5eb8('0x14')&&_0x1f96dd[_0x5eb8('0x15')]&&_0x1f96dd['Variable'][_0x5eb8('0x16')]&&_0x1f96dd[_0x5eb8('0x10')]&&_0x4c364a[_0x1f96dd[_0x5eb8('0x15')][_0x5eb8('0x16')]['toLowerCase']()]){_0x40b843[_0x1f96dd['idField']]=_0x4c364a[_0x1f96dd[_0x5eb8('0x15')][_0x5eb8('0x16')][_0x5eb8('0x17')]()][_0x5eb8('0x18')]();}});}return _0x40b843;}function getName(_0x2fc18a){if(_0x2fc18a['indexOf']('\x20')>0x0){var _0x249623=_0x2fc18a[_0x5eb8('0x19')](/ (.+)/);if(_0x249623[0x1]){return _0x249623;}}return[_0x2fc18a,_0x2fc18a];}var accountsTokens={};function getAccessToken(_0x303ed5){return new Promise(function(_0x42ceca,_0x1aefec){if(!_[_0x5eb8('0x1a')](accountsTokens[_0x303ed5['id']])&&!_['isNil'](accountsTokens[_0x303ed5['id']][_0x5eb8('0x1b')])){if(moment()[_0x5eb8('0x1c')](accountsTokens[_0x303ed5['id']][_0x5eb8('0x1d')])){_0x42ceca(accountsTokens[_0x303ed5['id']][_0x5eb8('0x1b')]);}}var _0x1de2fc;switch(_0x303ed5[_0x5eb8('0x1e')]){case'US':_0x1de2fc=_0x5eb8('0x1f');break;case'AU':_0x1de2fc=_0x5eb8('0x20');break;case'EU':_0x1de2fc=_0x5eb8('0x21');break;case'IN':_0x1de2fc='https://accounts.zoho.in';break;case'CN':_0x1de2fc='https://accounts.zoho.com.cn';break;default:_0x1de2fc=_0x5eb8('0x21');break;}var _0x2bf908={'method':_0x5eb8('0x22'),'uri':_0x1de2fc+_0x5eb8('0x23'),'qs':{'refresh_token':_0x303ed5[_0x5eb8('0x24')],'client_id':_0x303ed5[_0x5eb8('0x25')],'client_secret':_0x303ed5[_0x5eb8('0x26')],'grant_type':_0x5eb8('0x27')},'json':!![]};return rp(_0x2bf908)[_0x5eb8('0x28')](function(_0x340023){accountsTokens[_0x303ed5['id']]={'access_token':_0x340023['access_token'],'expires_in':moment()[_0x5eb8('0x29')](_0x340023['expires_in'],_0x5eb8('0x2a'))};_0x42ceca(_0x340023[_0x5eb8('0x1b')]);})[_0x5eb8('0x2b')](function(_0x4f6134){logger[_0x5eb8('0x2c')](_0x5eb8('0x2d'),_0x4f6134[_0x5eb8('0x2e')]);_0x1aefec(_0x4f6134);});});}function getUser(_0x18eac3,_0x57443d,_0x28da76,_0x15cc50){logger[_0x5eb8('0x2f')]('Search\x20user');return request({'method':'GET','uri':util[_0x5eb8('0x30')](_0x5eb8('0x31'),_0x57443d),'qs':{'type':_0x5eb8('0x32')},'headers':{'Authorization':_0x5eb8('0x33')+_0x18eac3},'json':!![]})[_0x5eb8('0x28')](function(_0x7a62e6){if(_0x7a62e6[_0x5eb8('0x34')]){var _0x40e5f0=-0x1;if(_[_0x5eb8('0x35')](_0x7a62e6['users'])){if(!_[_0x5eb8('0x1a')](_0x15cc50)){_0x40e5f0=_['findIndex'](_0x7a62e6['users'],function(_0x43bcfa){return _0x43bcfa[_0x5eb8('0x36')]===_0x15cc50;});}if(_0x40e5f0>=0x0){logger[_0x5eb8('0x2f')](_0x5eb8('0x37'));}else{logger[_0x5eb8('0x2f')](_0x5eb8('0x38'));_0x40e5f0=_[_0x5eb8('0x39')](_0x7a62e6[_0x5eb8('0x34')],function(_0x2607a3){return _0x2607a3[_0x5eb8('0x3a')][_0x5eb8('0x16')]===_0x5eb8('0x3b');});}return _0x7a62e6[_0x5eb8('0x34')][_0x40e5f0];}else{if(_0x7a62e6[_0x5eb8('0x3c')][_0x5eb8('0x3a')][_0x5eb8('0x16')]===_0x5eb8('0x3b')){logger['info'](_0x5eb8('0x38'));user=_0x7a62e6[_0x5eb8('0x3c')];return user;}else{logger['error'](_0x5eb8('0x3d'),JSON[_0x5eb8('0x3e')](_0x7a62e6));throw new Error(_0x5eb8('0x3f')+JSON[_0x5eb8('0x3e')](_0x7a62e6));}}}else{logger['error'](_0x5eb8('0x3d'),JSON[_0x5eb8('0x3e')](_0x7a62e6));throw new Error(_0x5eb8('0x3f')+JSON[_0x5eb8('0x3e')](_0x7a62e6));}})['catch'](function(_0x128913){console[_0x5eb8('0x2c')](_0x128913);});}function getEndUser(_0x315c40,_0x16e0b3,_0x29367e,_0x46fbea,_0x56b3c6,_0x4325b0,_0x38b8b4){logger[_0x5eb8('0x2f')](_0x5eb8('0x40'));return request({'method':_0x5eb8('0x41'),'uri':_0x5eb8('0x42')+_0x16e0b3+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x56b3c6+'))','headers':{'Authorization':_0x5eb8('0x33')+_0x315c40},'json':!![]})['then'](function(_0x8c8fab){if(_0x8c8fab){var _0x4284df=_0x8c8fab[_0x5eb8('0x43')][0x0];_0x4284df[_0x5eb8('0x44')]=_0x5eb8('0x45');logger[_0x5eb8('0x2f')](_0x5eb8('0x46'));return _0x4284df;}else{return request({'method':_0x5eb8('0x41'),'uri':_0x5eb8('0x42')+_0x16e0b3+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x56b3c6+'))','headers':{'Authorization':_0x5eb8('0x33')+_0x315c40},'json':!![]})['then'](function(_0x5228f4){if(_0x5228f4){var _0x4b9d51=_0x5228f4[_0x5eb8('0x43')][0x0];_0x4b9d51[_0x5eb8('0x44')]=_0x5eb8('0x47');logger['info'](_0x5eb8('0x48'));return _0x4b9d51;}else{logger[_0x5eb8('0x2f')](_0x5eb8('0x49'));_0x46fbea=getName(_0x46fbea);return request({'method':'POST','uri':_0x5eb8('0x42')+_0x16e0b3+_0x5eb8('0x4a')+_0x38b8b4['moduleCreate'],'body':{'data':[{'Last_Name':_0x46fbea[0x1],'First_Name':_0x46fbea[0x0],'Phone':_0x56b3c6,'Owner':{'name':!_[_0x5eb8('0x1a')](_0x4325b0[_0x5eb8('0x4b')][_0x5eb8('0x16')])?_0x4325b0[_0x5eb8('0x4b')][_0x5eb8('0x16')]:!_[_0x5eb8('0x1a')](_0x4325b0[_0x5eb8('0x4c')])?_0x4325b0['first_name']+'\x20'+_0x4325b0['last_name']:_0x4325b0[_0x5eb8('0x4d')],'id':_0x4325b0['id']}}]},'headers':{'Authorization':_0x5eb8('0x33')+_0x315c40},'json':!![]})[_0x5eb8('0x28')](function(_0x562778){if(_0x562778&&_0x562778[_0x5eb8('0x43')][0x0][_0x5eb8('0x4e')]===_0x5eb8('0x4f')){var _0x51d93f=_0x562778['data'][0x0][_0x5eb8('0x50')];_0x51d93f[_0x5eb8('0x44')]=_0x38b8b4[_0x5eb8('0x51')];return _0x51d93f;}logger['error']('The\x20failing\x20result\x20is',JSON[_0x5eb8('0x3e')](_0x562778));throw new Error(_0x5eb8('0x52')+JSON['stringify'](_0x562778));});}});}});}function getCall(_0x2a0fc6,_0x316eef,_0x14cddc,_0x536416,_0x3cfee9,_0x2bfdb8,_0x241868,_0x378c00){logger[_0x5eb8('0x2f')](_0x5eb8('0x53'));var _0x45e8f8={};_0x45e8f8[_0x5eb8('0x54')]={'name':!_['isNil'](_0x536416[_0x5eb8('0x4b')][_0x5eb8('0x16')])&&!_[_0x5eb8('0x1a')](_0x536416[_0x5eb8('0x3a')][_0x5eb8('0x16')])&&_0x536416[_0x5eb8('0x3a')]['name']==='administrator'?_0x536416[_0x5eb8('0x4b')][_0x5eb8('0x16')]:!_['isNil'](_0x536416[_0x5eb8('0x4c')])?_0x536416[_0x5eb8('0x4c')]+'\x20'+_0x536416['last_name']:_0x536416[_0x5eb8('0x4d')],'id':_0x536416['id']};_0x45e8f8[_0x5eb8('0x55')]=intUtil['getString'](_0x2bfdb8[_0x5eb8('0x56')],_0x241868,'\x20');_0x45e8f8[_0x5eb8('0x57')]=intUtil[_0x5eb8('0x58')](_0x2bfdb8[_0x5eb8('0x59')],_0x241868,'\x0a');if(_0x3cfee9[_0x5eb8('0x44')]===_0x5eb8('0x45')){_0x45e8f8['Who_Id']={'name':!_['isNil'](_0x3cfee9['Full_Name'])?_0x3cfee9[_0x5eb8('0x5a')]:!_[_0x5eb8('0x1a')](_0x3cfee9[_0x5eb8('0x5b')])?_0x3cfee9[_0x5eb8('0x5b')]+'\x20'+_0x3cfee9[_0x5eb8('0x5c')]:_0x3cfee9[_0x5eb8('0x5c')],'id':_0x3cfee9['id']};}if(_0x3cfee9[_0x5eb8('0x44')]===_0x5eb8('0x47')){_0x45e8f8[_0x5eb8('0x5d')]={'name':!_[_0x5eb8('0x1a')](_0x3cfee9[_0x5eb8('0x5a')])?_0x3cfee9[_0x5eb8('0x5a')]:!_[_0x5eb8('0x1a')](_0x3cfee9['First_Name'])?_0x3cfee9[_0x5eb8('0x5b')]+'\x20'+_0x3cfee9[_0x5eb8('0x5c')]:_0x3cfee9[_0x5eb8('0x5c')],'id':_0x3cfee9['id']};_0x45e8f8[_0x5eb8('0x5e')]=_0x3cfee9['enduserType'];}if(_0x241868['talktime']){_0x45e8f8[_0x5eb8('0x5f')]=moment['utc'](parseInt(_0x241868['talktime'])*0x3e8)['format'](_0x5eb8('0x60'));}else if(_0x241868[_0x5eb8('0x61')]&&_0x241868['endtime']){_0x45e8f8[_0x5eb8('0x5f')]=moment['utc'](moment(_0x241868[_0x5eb8('0x62')],_0x5eb8('0x63'))[_0x5eb8('0x64')](moment(_0x241868[_0x5eb8('0x65')],_0x5eb8('0x63'))))[_0x5eb8('0x30')]('mm:ss');}switch(_0x241868[_0x5eb8('0x66')]){case _0x5eb8('0x67'):_0x45e8f8[_0x5eb8('0x68')]=_0x5eb8('0x69');break;case _0x5eb8('0x6a'):case _0x5eb8('0x6b'):_0x45e8f8[_0x5eb8('0x68')]=_0x5eb8('0x6c');break;case'rejected':_0x45e8f8[_0x5eb8('0x68')]='Rejected';break;case _0x5eb8('0x6d'):_0x45e8f8[_0x5eb8('0x68')]=_0x5eb8('0x6e');break;default:}_0x45e8f8[_0x5eb8('0x6f')]=(_0x378c00===_0x5eb8('0x70')?moment(_0x241868['starttime'])['format'](_0x5eb8('0x63')):moment(_0x241868['agentcalledAt'])[_0x5eb8('0x30')](_0x5eb8('0x63')))||moment()[_0x5eb8('0x30')](_0x5eb8('0x63'));_0x45e8f8[_0x5eb8('0x71')]=_0x378c00||'Inbound';_0x45e8f8=_[_0x5eb8('0x72')](_0x45e8f8,getCustomFields(_0x2bfdb8['Fields'],_0x241868));return request({'method':'POST','uri':_0x5eb8('0x42')+_0x316eef+_0x5eb8('0x73'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x2a0fc6},'body':{'data':[_0x45e8f8]},'json':!![]})[_0x5eb8('0x28')](function(_0x1c1a66){if(_0x1c1a66&&_0x1c1a66['data'][0x0][_0x5eb8('0x4e')]===_0x5eb8('0x4f')){logger[_0x5eb8('0x2f')](_0x5eb8('0x74'));return{'id':_0x1c1a66[_0x5eb8('0x43')][0x0][_0x5eb8('0x50')]['id']};}})['catch'](function(_0x22dce9){logger[_0x5eb8('0x2f')]('err',_0x22dce9[_0x5eb8('0x2e')]);console[_0x5eb8('0x75')](_0x5eb8('0x76'),_0x22dce9);});}exports[_0x5eb8('0x77')]=function(_0x18b998,_0x281e60,_0x32e63d,_0x4832ef,_0x2f40e0,_0x2089ee){var _0x3878ca,_0x34bfd5,_0x592fbe;_0x2089ee[_0x5eb8('0x78')]=intUtil[_0x5eb8('0x79')](_0x2089ee['host']);_0x2089ee[_0x5eb8('0x7a')]=intUtil[_0x5eb8('0x79')](_0x2089ee[_0x5eb8('0x7a')]);if(_0x2f40e0&&_0x2f40e0[_0x5eb8('0x7b')]){logger['info']('[QUEUE]',_0x5eb8('0x7c'));_0x281e60['recordingURL']=_0x2089ee[_0x5eb8('0x7a')]+_0x5eb8('0x7d')+_0x281e60[_0x5eb8('0x7e')]+_0x5eb8('0x7f')+md5(_0x281e60[_0x5eb8('0x7e')]);}else{_0x281e60[_0x5eb8('0x80')]='';}var _0x27411e=_0x2089ee[_0x5eb8('0x78')]==='zoho.eu'?'eu':_0x5eb8('0x81');return getAccessToken(_0x2089ee)[_0x5eb8('0x28')](function(_0x58663b){_0x592fbe=_0x58663b;return getUser(_0x592fbe,_0x27411e,_0x2089ee,_0x4832ef['email']);})[_0x5eb8('0x28')](function(_0x2ff4d4){_0x3878ca=_0x2ff4d4;logger[_0x5eb8('0x2f')](_0x5eb8('0x82'),_0x3878ca['id']);return getEndUser(_0x592fbe,_0x27411e,_0x2089ee,_0x281e60['calleridname'],_0x281e60[_0x5eb8('0x83')],_0x3878ca,_0x32e63d);})[_0x5eb8('0x28')](function(_0x2fdce8){_0x34bfd5=_0x2fdce8;logger[_0x5eb8('0x2f')](_0x5eb8('0x84'),_0x34bfd5['id']);return getCall(_0x592fbe,_0x27411e,_0x2089ee,_0x3878ca,_0x34bfd5,_0x32e63d,_0x281e60,_0x5eb8('0x85'));})[_0x5eb8('0x28')](function(_0x5e75ec){if(_0x5e75ec){logger[_0x5eb8('0x2f')](_0x5eb8('0x86'),_0x5e75ec['id']);logger[_0x5eb8('0x2f')](_0x5eb8('0x87'),_0x5eb8('0x88'));emit(util[_0x5eb8('0x30')]('user:%s',_0x4832ef['name']),'trigger:browser:url',{'uri':'https://crm.'+_0x2089ee[_0x5eb8('0x78')]+'/crm/EntityInfo.do?module=Calls&id='+_0x5e75ec['id']});}})[_0x5eb8('0x2b')](function(_0x50069a){logger[_0x5eb8('0x2c')]('[QUEUE]',JSON['stringify'](_0x50069a));});};exports['outbound']=function(_0x4fff7a,_0x18ba19,_0x39d591,_0x285068,_0x40fd22,_0xf66430,_0x461d5f){var _0x13b4ac,_0x362dae,_0x33fb89;_0xf66430['host']=intUtil[_0x5eb8('0x79')](_0xf66430[_0x5eb8('0x78')]);_0xf66430[_0x5eb8('0x7a')]=intUtil[_0x5eb8('0x79')](_0xf66430['serverUrl']);if(_0x461d5f&&_0x461d5f['recordingFormat']&&_0x461d5f[_0x5eb8('0x89')]!==_0x5eb8('0x8a')){logger[_0x5eb8('0x2f')](_0x5eb8('0x8b'),_0x5eb8('0x7c'));_0x18ba19[_0x5eb8('0x80')]=_0xf66430['serverUrl']+_0x5eb8('0x7d')+_0x18ba19[_0x5eb8('0x7e')]+_0x5eb8('0x7f')+md5(_0x18ba19['uniqueid']);}var _0x2f6866=_0xf66430[_0x5eb8('0x78')]===_0x5eb8('0x8c')?'eu':'com';return getAccessToken(_0xf66430)[_0x5eb8('0x28')](function(_0x2bd2fa){_0x33fb89=_0x2bd2fa;return getUser(_0x33fb89,_0x2f6866,_0xf66430,_0x285068[_0x5eb8('0x36')]);})[_0x5eb8('0x28')](function(_0x5edd7f){_0x13b4ac=_0x5edd7f;logger['info'](_0x5eb8('0x82'),_0x13b4ac['id']);return getEndUser(_0x33fb89,_0x2f6866,_0xf66430,_0x18ba19[_0x5eb8('0x8d')],_0x18ba19[_0x5eb8('0x8e')],_0x13b4ac,_0x39d591);})[_0x5eb8('0x28')](function(_0xc91a2c){_0x362dae=_0xc91a2c;logger[_0x5eb8('0x2f')](_0x5eb8('0x84'),_0x362dae['id']);return getCall(_0x33fb89,_0x2f6866,_0xf66430,_0x13b4ac,_0x362dae,_0x39d591,_0x18ba19,_0x5eb8('0x8f'));})[_0x5eb8('0x28')](function(_0x2855c2){if(_0x2855c2){logger[_0x5eb8('0x2f')](_0x5eb8('0x86'),_0x2855c2['id']);logger['info'](_0x5eb8('0x8b'),_0x5eb8('0x88'));emit(util[_0x5eb8('0x30')]('user:%s',_0x285068[_0x5eb8('0x16')]),_0x5eb8('0x90'),{'uri':_0x5eb8('0x91')+_0xf66430[_0x5eb8('0x78')]+'/crm/EntityInfo.do?module=Calls&id='+_0x2855c2['id']});}})['catch'](function(_0x8b6061){logger['error'](_0x5eb8('0x8b'),JSON['stringify'](_0x8b6061));});};exports[_0x5eb8('0x6d')]=function(_0xf1c6b0,_0x544a9e,_0x406ac4,_0x2b53bd,_0x521f8e,_0x2c6789){var _0x49fa06,_0x54fe06,_0x4613c9;_0x2c6789[_0x5eb8('0x78')]=intUtil[_0x5eb8('0x79')](_0x2c6789[_0x5eb8('0x78')]);_0x2c6789[_0x5eb8('0x7a')]=intUtil['stripTrailingSlash'](_0x2c6789[_0x5eb8('0x7a')]);if(_0x521f8e&&_0x521f8e['monitor_format']){logger[_0x5eb8('0x2f')](_0x5eb8('0x92'),'Recording\x20is\x20enabled!');_0x544a9e['recordingURL']=_0x2c6789['serverUrl']+_0x5eb8('0x7d')+_0x544a9e[_0x5eb8('0x7e')]+_0x5eb8('0x7f')+md5(_0x544a9e[_0x5eb8('0x7e')]);}else{_0x544a9e[_0x5eb8('0x80')]='';}var _0x1b2d26=_0x2c6789[_0x5eb8('0x78')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x2c6789)[_0x5eb8('0x28')](function(_0x267a47){_0x4613c9=_0x267a47;return getUser(_0x4613c9,_0x1b2d26,_0x2c6789);})[_0x5eb8('0x28')](function(_0x1b9280){_0x49fa06=_0x1b9280;logger[_0x5eb8('0x2f')](_0x5eb8('0x82'),_0x49fa06['id']);return getEndUser(_0x4613c9,_0x1b2d26,_0x2c6789,_0x544a9e[_0x5eb8('0x93')],_0x544a9e[_0x5eb8('0x83')],_0x49fa06,_0x406ac4);})[_0x5eb8('0x28')](function(_0xbda10e){_0x54fe06=_0xbda10e;logger['info'](_0x5eb8('0x84'),_0x54fe06['id']);return getCall(_0x4613c9,_0x1b2d26,_0x2c6789,_0x49fa06,_0x54fe06,_0x406ac4,_0x544a9e,'Inbound');})['then'](function(_0x16fe09){if(_0x16fe09){logger[_0x5eb8('0x2f')](_0x5eb8('0x86'),_0x16fe09['id']);}})[_0x5eb8('0x2b')](function(_0x57ab37){logger[_0x5eb8('0x2c')](_0x5eb8('0x92'),JSON[_0x5eb8('0x3e')](_0x57ab37));});}; \ 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 600ee32..d674e8b 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 _0x7a54=['mustache','trigger','exec','data2','Script','data3','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs'];(function(_0x1b661a,_0xa2e99b){var _0x2ac323=function(_0x24e2e2){while(--_0x24e2e2){_0x1b661a['push'](_0x1b661a['shift']());}};_0x2ac323(++_0xa2e99b);}(_0x7a54,0x106));var _0x47a5=function(_0x310080,_0x3c63c5){_0x310080=_0x310080-0x0;var _0x479969=_0x7a54[_0x310080];return _0x479969;};'use strict';var util=require(_0x47a5('0x0'));var sh=require(_0x47a5('0x1'));var Mustache=require(_0x47a5('0x2'));var logger=require('../../../../config/logger')(_0x47a5('0x3'));exports[_0x47a5('0x4')]=function(_0x4880bf,_0x5f7f12){var _0x11bf85=_0x4880bf[_0x47a5('0x5')]?_0x4880bf[_0x47a5('0x5')]:_0x47a5('0x6');var _0x545a97=_0x4880bf[_0x47a5('0x7')]?Mustache['render'](_0x4880bf[_0x47a5('0x7')],_0x5f7f12):_0x5f7f12;sh[_0x47a5('0x4')](_0x545a97,function(_0x506eda,_0x194fb0,_0x5077f3){if(_0x506eda!==0x0){logger['error'](util['format'](_0x47a5('0x8'),_0x11bf85,_0x545a97,_0x506eda,_0x5077f3));}else{logger[_0x47a5('0x9')](util['format'](_0x47a5('0xa'),_0x11bf85,_0x545a97,_0x194fb0));}});}; \ No newline at end of file +var _0x7a54=['mustache','trigger','exec','data2','Script','data3','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs'];(function(_0x1b3f13,_0x540791){var _0x49000e=function(_0x432669){while(--_0x432669){_0x1b3f13['push'](_0x1b3f13['shift']());}};_0x49000e(++_0x540791);}(_0x7a54,0x106));var _0x47a5=function(_0x314f02,_0x857977){_0x314f02=_0x314f02-0x0;var _0x286be2=_0x7a54[_0x314f02];return _0x286be2;};'use strict';var util=require(_0x47a5('0x0'));var sh=require(_0x47a5('0x1'));var Mustache=require(_0x47a5('0x2'));var logger=require('../../../../config/logger')(_0x47a5('0x3'));exports[_0x47a5('0x4')]=function(_0x4880bf,_0x5f7f12){var _0x11bf85=_0x4880bf[_0x47a5('0x5')]?_0x4880bf[_0x47a5('0x5')]:_0x47a5('0x6');var _0x545a97=_0x4880bf[_0x47a5('0x7')]?Mustache['render'](_0x4880bf[_0x47a5('0x7')],_0x5f7f12):_0x5f7f12;sh[_0x47a5('0x4')](_0x545a97,function(_0x506eda,_0x194fb0,_0x5077f3){if(_0x506eda!==0x0){logger['error'](util['format'](_0x47a5('0x8'),_0x11bf85,_0x545a97,_0x506eda,_0x5077f3));}else{logger[_0x47a5('0x9')](util['format'](_0x47a5('0xa'),_0x11bf85,_0x545a97,_0x194fb0));}});}; \ 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 106572c..d46a5a4 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 _0x5f2f=['lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data2','number','data5','headers','data6','parse','stack','GET','DELETE','POST','PUT','data7','body','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util'];(function(_0xf5c157,_0x3e6c1d){var _0x57da4e=function(_0x1698a2){while(--_0x1698a2){_0xf5c157['push'](_0xf5c157['shift']());}};_0x57da4e(++_0x3e6c1d);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5a2d51,_0x56d6db){_0x5a2d51=_0x5a2d51-0x0;var _0x1c926=_0x5f2f[_0x5a2d51];return _0x1c926;};'use strict';var rp=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var _=require(_0xf5f2('0x2'));var Mustache=require(_0xf5f2('0x3'));var logger=require(_0xf5f2('0x4'))(_0xf5f2('0x5'));exports[_0xf5f2('0x6')]=function(_0x107cf,_0x501fbd){var _0x4854b6,_0x1665c7;var _0x192215={'method':_0x107cf[_0xf5f2('0x7')][_0xf5f2('0x8')](),'uri':Mustache[_0xf5f2('0x9')](_0x107cf[_0xf5f2('0xa')],_0x501fbd),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x107cf['data5'])===_0xf5f2('0xb')&&parseInt(_0x107cf[_0xf5f2('0xc')])>=0x1&&parseInt(_0x107cf[_0xf5f2('0xc')])<=0xa?parseInt(_0x107cf['data5'])*0x3e8:0x5*0x3e8};try{_0x192215[_0xf5f2('0xd')]=_0x107cf[_0xf5f2('0xe')]?JSON[_0xf5f2('0xf')](Mustache['render'](_0x107cf[_0xf5f2('0xe')],_0x501fbd)):{};}catch(_0x4ebbbe){logger['error'](_0x4ebbbe[_0xf5f2('0x10')]);}switch(_0x107cf[_0xf5f2('0x7')]['toUpperCase']()){case _0xf5f2('0x11'):case _0xf5f2('0x12'):_0x4854b6=null;_0x192215['qs']=_0x501fbd;break;case _0xf5f2('0x13'):case _0xf5f2('0x14'):if(_0x107cf[_0xf5f2('0x15')]){try{_0x4854b6=JSON[_0xf5f2('0xf')](Mustache['render'](_0x107cf[_0xf5f2('0x15')],_0x501fbd));_0x192215[_0xf5f2('0x16')]=_0x4854b6;}catch(_0x269909){logger[_0xf5f2('0x17')](_0x269909[_0xf5f2('0x10')]);logger['error'](_0xf5f2('0x18'));}}else{_0x4854b6=_0x501fbd;_0x192215[_0xf5f2('0x16')]=_0x4854b6;}break;}logger[_0xf5f2('0x19')](util[_0xf5f2('0x1a')](_0xf5f2('0x1b'),_0x107cf[_0xf5f2('0x7')],_0x107cf[_0xf5f2('0xa')],JSON[_0xf5f2('0x1c')](_0x192215)));rp(_0x192215)[_0xf5f2('0x1d')](function(_0x228ace){_0x4854b6=!_[_0xf5f2('0x1e')](_0x4854b6)?_0xf5f2('0x1f')+_0x4854b6:'';_0x1665c7=typeof _0x228ace[_0xf5f2('0x16')]===_0xf5f2('0x20')?JSON[_0xf5f2('0x1c')](_0x228ace[_0xf5f2('0x16')]):_0x228ace[_0xf5f2('0x16')];logger['info'](util[_0xf5f2('0x1a')](_0xf5f2('0x21'),_0x107cf['data1'],_0x107cf['data2'],_0x228ace[_0xf5f2('0x22')],_0x1665c7));})[_0xf5f2('0x23')](function(_0x4ae323){logger[_0xf5f2('0x17')](util[_0xf5f2('0x1a')](_0xf5f2('0x24'),_0x107cf[_0xf5f2('0x7')],_0x107cf[_0xf5f2('0xa')],_0x4ae323['statusCode'],_0x4ae323[_0xf5f2('0x25')],_0x4ae323[_0xf5f2('0x26')]));});}; \ No newline at end of file +var _0x5f2f=['lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data2','number','data5','headers','data6','parse','stack','GET','DELETE','POST','PUT','data7','body','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util'];(function(_0x4b79f9,_0x53e998){var _0x31604b=function(_0x392517){while(--_0x392517){_0x4b79f9['push'](_0x4b79f9['shift']());}};_0x31604b(++_0x53e998);}(_0x5f2f,0x73));var _0xf5f2=function(_0x36189d,_0x2940d0){_0x36189d=_0x36189d-0x0;var _0x562991=_0x5f2f[_0x36189d];return _0x562991;};'use strict';var rp=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var _=require(_0xf5f2('0x2'));var Mustache=require(_0xf5f2('0x3'));var logger=require(_0xf5f2('0x4'))(_0xf5f2('0x5'));exports[_0xf5f2('0x6')]=function(_0x107cf,_0x501fbd){var _0x4854b6,_0x1665c7;var _0x192215={'method':_0x107cf[_0xf5f2('0x7')][_0xf5f2('0x8')](),'uri':Mustache[_0xf5f2('0x9')](_0x107cf[_0xf5f2('0xa')],_0x501fbd),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x107cf['data5'])===_0xf5f2('0xb')&&parseInt(_0x107cf[_0xf5f2('0xc')])>=0x1&&parseInt(_0x107cf[_0xf5f2('0xc')])<=0xa?parseInt(_0x107cf['data5'])*0x3e8:0x5*0x3e8};try{_0x192215[_0xf5f2('0xd')]=_0x107cf[_0xf5f2('0xe')]?JSON[_0xf5f2('0xf')](Mustache['render'](_0x107cf[_0xf5f2('0xe')],_0x501fbd)):{};}catch(_0x4ebbbe){logger['error'](_0x4ebbbe[_0xf5f2('0x10')]);}switch(_0x107cf[_0xf5f2('0x7')]['toUpperCase']()){case _0xf5f2('0x11'):case _0xf5f2('0x12'):_0x4854b6=null;_0x192215['qs']=_0x501fbd;break;case _0xf5f2('0x13'):case _0xf5f2('0x14'):if(_0x107cf[_0xf5f2('0x15')]){try{_0x4854b6=JSON[_0xf5f2('0xf')](Mustache['render'](_0x107cf[_0xf5f2('0x15')],_0x501fbd));_0x192215[_0xf5f2('0x16')]=_0x4854b6;}catch(_0x269909){logger[_0xf5f2('0x17')](_0x269909[_0xf5f2('0x10')]);logger['error'](_0xf5f2('0x18'));}}else{_0x4854b6=_0x501fbd;_0x192215[_0xf5f2('0x16')]=_0x4854b6;}break;}logger[_0xf5f2('0x19')](util[_0xf5f2('0x1a')](_0xf5f2('0x1b'),_0x107cf[_0xf5f2('0x7')],_0x107cf[_0xf5f2('0xa')],JSON[_0xf5f2('0x1c')](_0x192215)));rp(_0x192215)[_0xf5f2('0x1d')](function(_0x228ace){_0x4854b6=!_[_0xf5f2('0x1e')](_0x4854b6)?_0xf5f2('0x1f')+_0x4854b6:'';_0x1665c7=typeof _0x228ace[_0xf5f2('0x16')]===_0xf5f2('0x20')?JSON[_0xf5f2('0x1c')](_0x228ace[_0xf5f2('0x16')]):_0x228ace[_0xf5f2('0x16')];logger['info'](util[_0xf5f2('0x1a')](_0xf5f2('0x21'),_0x107cf['data1'],_0x107cf['data2'],_0x228ace[_0xf5f2('0x22')],_0x1665c7));})[_0xf5f2('0x23')](function(_0x4ae323){logger[_0xf5f2('0x17')](util[_0xf5f2('0x1a')](_0xf5f2('0x24'),_0x107cf[_0xf5f2('0x7')],_0x107cf[_0xf5f2('0xa')],_0x4ae323['statusCode'],_0x4ae323[_0xf5f2('0x25')],_0x4ae323[_0xf5f2('0x26')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 4c70232..2cc5d41 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 _0x8ebf=['../../config/logger','client','http','request','then','debug','rpc','routing','error','message','catch','exports','jayson/promise','bluebird'];(function(_0x58c053,_0x51c43f){var _0xe1079=function(_0x172345){while(--_0x172345){_0x58c053['push'](_0x58c053['shift']());}};_0xe1079(++_0x51c43f);}(_0x8ebf,0x15c));var _0xf8eb=function(_0x595013,_0x65a215){_0x595013=_0x595013-0x0;var _0x2a29e3=_0x8ebf[_0x595013];return _0x2a29e3;};'use strict';var jayson=require(_0xf8eb('0x0'));var BPromise=require(_0xf8eb('0x1'));var logger=require(_0xf8eb('0x2'))('routing');var client=jayson[_0xf8eb('0x3')][_0xf8eb('0x4')]({'port':0x2329});client['Request']=function(_0x311ae9,_0x59d6a7){return new BPromise(function(_0x41e20b,_0x493476){return client[_0xf8eb('0x5')](_0x311ae9,_0x59d6a7)[_0xf8eb('0x6')](function(_0x4cbeaa){logger[_0xf8eb('0x7')](_0xf8eb('0x8'),_0xf8eb('0x9'),_0x311ae9,_0x59d6a7,_0x4cbeaa);if(_0x4cbeaa['error']){logger[_0xf8eb('0xa')]('rpc',_0xf8eb('0x9'),_0x311ae9,_0x4cbeaa['error'][_0xf8eb('0xb')],_0x59d6a7);return _0x493476(_0x4cbeaa[_0xf8eb('0xa')][_0xf8eb('0xb')]);}else{return _0x41e20b(_0x4cbeaa['result']);}})[_0xf8eb('0xc')](function(_0x2d55dd){logger[_0xf8eb('0xa')](_0xf8eb('0x8'),_0xf8eb('0x9'),_0x311ae9,_0x2d55dd,_0x59d6a7);return _0x493476(_0x2d55dd);});});};module[_0xf8eb('0xd')]=client; \ No newline at end of file +var _0x0c2b=['error','message','jayson/promise','bluebird','client','Request','debug','rpc','routing'];(function(_0x5d9f75,_0x57119e){var _0x412468=function(_0x430c1a){while(--_0x430c1a){_0x5d9f75['push'](_0x5d9f75['shift']());}};_0x412468(++_0x57119e);}(_0x0c2b,0x134));var _0xb0c2=function(_0x54430f,_0x4cf2ae){_0x54430f=_0x54430f-0x0;var _0x3c5527=_0x0c2b[_0x54430f];return _0x3c5527;};'use strict';var jayson=require(_0xb0c2('0x0'));var BPromise=require(_0xb0c2('0x1'));var logger=require('../../config/logger')('routing');var client=jayson[_0xb0c2('0x2')]['http']({'port':0x2329});client[_0xb0c2('0x3')]=function(_0xb31d26,_0x44eec2){return new BPromise(function(_0x1c2f6f,_0x3b8699){return client['request'](_0xb31d26,_0x44eec2)['then'](function(_0x1f0b7e){logger[_0xb0c2('0x4')](_0xb0c2('0x5'),_0xb0c2('0x6'),_0xb31d26,_0x44eec2,_0x1f0b7e);if(_0x1f0b7e[_0xb0c2('0x7')]){logger[_0xb0c2('0x7')](_0xb0c2('0x5'),_0xb0c2('0x6'),_0xb31d26,_0x1f0b7e['error'][_0xb0c2('0x8')],_0x44eec2);return _0x3b8699(_0x1f0b7e[_0xb0c2('0x7')]['message']);}else{return _0x1c2f6f(_0x1f0b7e['result']);}})['catch'](function(_0x22e593){logger['error'](_0xb0c2('0x5'),_0xb0c2('0x6'),_0xb31d26,_0x22e593,_0x44eec2);return _0x3b8699(_0x22e593);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 10d2ef7..81c4c6b 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 _0x1354=['../../mysqldb','resolve','getMailAccounts','then','initMailAccounts','refresh','mailAccounts','Setting','loginMailFrequency','bluebird','./server','./realtime','./lib/email','./rpc/mailAccount'];(function(_0x1b6146,_0x580f80){var _0x39f7ed=function(_0x466589){while(--_0x466589){_0x1b6146['push'](_0x1b6146['shift']());}};_0x39f7ed(++_0x580f80);}(_0x1354,0x95));var _0x4135=function(_0x28a8c2,_0x494d5){_0x28a8c2=_0x28a8c2-0x0;var _0x37ac3c=_0x1354[_0x28a8c2];return _0x37ac3c;};'use strict';var BPromise=require(_0x4135('0x0'));var server=require(_0x4135('0x1'));var Realtime=require(_0x4135('0x2'));var EmailChannel=require(_0x4135('0x3'));var mailAccount=require(_0x4135('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);var db=require(_0x4135('0x5'))['db'];function initRealtime(){return BPromise[_0x4135('0x6')]()['then'](mailAccount[_0x4135('0x7')]())[_0x4135('0x8')](realtime[_0x4135('0x9')]())['then'](function(){email[_0x4135('0xa')](realtime[_0x4135('0xb')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0x4135('0x8')](function(_0x1dcce0){return initRealtime();})[_0x4135('0x8')](function(_0x50ef3f){return db[_0x4135('0xc')]['findOne']({'attributes':['id',_0x4135('0xd')],'raw':!![]});})[_0x4135('0x8')](function(_0x4447c8){return setInterval(initRealtime,_0x4447c8[_0x4135('0xd')]*0x3e8);})['catch'](function(_0x35d576){console['log'](_0x35d576);});}main(); \ No newline at end of file +var _0xdb94=['Setting','findOne','loginMailFrequency','catch','log','./server','./realtime','./rpc/mailAccount','../../mysqldb','resolve','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','listen'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0xdb94,0xe5));var _0x4db9=function(_0x49ac1f,_0x5b327c){_0x49ac1f=_0x49ac1f-0x0;var _0x2bb448=_0xdb94[_0x49ac1f];return _0x2bb448;};'use strict';var BPromise=require('bluebird');var server=require(_0x4db9('0x0'));var Realtime=require(_0x4db9('0x1'));var EmailChannel=require('./lib/email');var mailAccount=require(_0x4db9('0x2'));var realtime=new Realtime();var email=new EmailChannel(realtime);var db=require(_0x4db9('0x3'))['db'];function initRealtime(){return BPromise[_0x4db9('0x4')]()[_0x4db9('0x5')](mailAccount[_0x4db9('0x6')]())['then'](realtime[_0x4db9('0x7')]())['then'](function(){email[_0x4db9('0x8')](realtime[_0x4db9('0x9')]);return realtime;});}function main(){return server[_0x4db9('0xa')](realtime,email)[_0x4db9('0x5')](function(_0x42a857){return initRealtime();})['then'](function(_0x45d5a3){return db[_0x4db9('0xb')][_0x4db9('0xc')]({'attributes':['id',_0x4db9('0xd')],'raw':!![]});})[_0x4db9('0x5')](function(_0x575064){return setInterval(initRealtime,_0x575064[_0x4db9('0xd')]*0x3e8);})[_0x4db9('0xe')](function(_0x31f02d){console[_0x4db9('0xf')](_0x31f02d);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 2d74675..7069491 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 _0xc65c=['email','redis','defaults','socket.io-emitter','./imap','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','emit','name','key','active','Imap','status','messageStatus','isNil','stringify','prototype','refresh','hasOwnProperty','imapAccounts','handleImapBox','bind','end','handleImapEnd','error','handleImapError','disabled','connected','messages','total','handleImapEmail','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','sendMail','smtp','send','verifySmtp','Smtp','lastSync','verified','verify','exports','lodash','moment','md5','ioredis','../../../config/environment','../../../config/logger'];(function(_0x4b3e49,_0x9e566c){var _0x57e339=function(_0x1430e9){while(--_0x1430e9){_0x4b3e49['push'](_0x4b3e49['shift']());}};_0x57e339(++_0x9e566c);}(_0xc65c,0x1e0));var _0xcc65=function(_0x7a1725,_0x2eb472){_0x7a1725=_0x7a1725-0x0;var _0x36ea12=_0xc65c[_0x7a1725];return _0x36ea12;};'use strict';var _=require(_0xcc65('0x0'));var moment=require(_0xcc65('0x1'));var BPromise=require('bluebird');var md5=require(_0xcc65('0x2'));var Redis=require(_0xcc65('0x3'));var config=require(_0xcc65('0x4'));var logger=require(_0xcc65('0x5'))(_0xcc65('0x6'));config[_0xcc65('0x7')]=_[_0xcc65('0x8')](config[_0xcc65('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xcc65('0x9'))(new Redis(config[_0xcc65('0x7')]));var EmailImap=require(_0xcc65('0xa'));var EmailSmtp=require('./smtp');var mailAccount=require(_0xcc65('0xb'));var md5Accounts={};function EmailChannel(_0x1a3da3){logger[_0xcc65('0xc')](_0xcc65('0xd'));this[_0xcc65('0xe')]=_0x1a3da3[_0xcc65('0xe')];this['imapAccounts']={};this['smtp']=new EmailSmtp();}EmailChannel['prototype'][_0xcc65('0xf')]=function(_0xc74072){var _0x19f2f3=this['mailAccounts'][_0xc74072];var _0xa8024d={'id':_0x19f2f3['id'],'name':_0x19f2f3[_0xcc65('0x10')],'key':_0x19f2f3[_0xcc65('0x11')],'active':_0x19f2f3[_0xcc65('0x12')],'Imap':{'status':_0x19f2f3[_0xcc65('0x13')][_0xcc65('0x14')],'messageStatus':_0x19f2f3[_0xcc65('0x13')][_0xcc65('0x15')],'total':_0x19f2f3[_0xcc65('0x13')]['total']}};if(_[_0xcc65('0x16')](md5Accounts[_0xc74072])){md5Accounts[_0xc74072]={};}var _0x569e4e=md5(JSON[_0xcc65('0x17')](_0xa8024d));if(md5Accounts[_0xc74072][_0xcc65('0x2')]!==_0x569e4e){md5Accounts[_0xc74072][_0xcc65('0x2')]=_0x569e4e;io['emit']('mailAccount:update',_0xa8024d);}};EmailChannel[_0xcc65('0x18')][_0xcc65('0x19')]=function(_0x412579){for(var _0x44dd02 in _0x412579){if(_0x412579[_0xcc65('0x1a')](_0x44dd02)){if(_0x412579[_0x44dd02][_0xcc65('0x13')]&&_0x412579[_0x44dd02][_0xcc65('0x12')]){var _0x48ec3f=_0x412579[_0x44dd02][_0xcc65('0x13')];if(!this[_0xcc65('0x1b')][_0xcc65('0x1a')](_0x48ec3f['id'])){this['imapAccounts'][_0x48ec3f['id']]=new EmailImap(_0x48ec3f,_0x412579[_0x44dd02][_0xcc65('0x6')]);this[_0xcc65('0x1b')][_0x48ec3f['id']]['on']('box',this[_0xcc65('0x1c')][_0xcc65('0x1d')](this,_0x44dd02));this['imapAccounts'][_0x48ec3f['id']]['on']('email',this['handleImapEmail'][_0xcc65('0x1d')](this,_0x44dd02));this[_0xcc65('0x1b')][_0x48ec3f['id']]['on'](_0xcc65('0x1e'),this[_0xcc65('0x1f')][_0xcc65('0x1d')](this,_0x44dd02));this[_0xcc65('0x1b')][_0x48ec3f['id']]['on'](_0xcc65('0x20'),this[_0xcc65('0x21')][_0xcc65('0x1d')](this,_0x44dd02));}}else{if(_[_0xcc65('0x16')](this['mailAccounts'][_0x44dd02][_0xcc65('0x13')])){this['mailAccounts'][_0x44dd02][_0xcc65('0x13')]={};}this['mailAccounts'][_0x44dd02][_0xcc65('0x13')]['status']=_0xcc65('0x22');this[_0xcc65('0xe')][_0x44dd02][_0xcc65('0x13')]['messageStatus']='';this[_0xcc65('0xf')](_0x44dd02);}}}};EmailChannel[_0xcc65('0x18')]['handleImapBox']=function(_0x4e4b53,_0x1396aa){if(this['mailAccounts'][_0x4e4b53]){this[_0xcc65('0xe')][_0x4e4b53][_0xcc65('0x13')][_0xcc65('0x14')]=_0xcc65('0x23');this[_0xcc65('0xe')][_0x4e4b53][_0xcc65('0x13')][_0xcc65('0x15')]=_0x1396aa['name'];if(_0x1396aa[_0xcc65('0x24')]){this[_0xcc65('0xe')][_0x4e4b53][_0xcc65('0x13')][_0xcc65('0x25')]=_0x1396aa['messages'][_0xcc65('0x25')];}return this[_0xcc65('0xf')](_0x4e4b53);}};EmailChannel['prototype'][_0xcc65('0x26')]=function(_0x311cd6,_0x581300){logger[_0xcc65('0xc')](_0xcc65('0x27'),_0x581300['firstName'],_0x581300['lastName'],_0x581300[_0xcc65('0x28')],_0x311cd6);if(this[_0xcc65('0xe')][_0x311cd6]){return mailAccount[_0xcc65('0x29')](_0x311cd6,_0x581300)[_0xcc65('0x2a')](function(_0x494dd5){if(_0x494dd5){logger[_0xcc65('0xc')](_0xcc65('0x2b'));}})[_0xcc65('0x2c')](function(_0xa6b832){logger[_0xcc65('0x20')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0xcc65('0x17')](_0xa6b832));});}};EmailChannel[_0xcc65('0x18')]['handleImapEnd']=function(_0x5af5f2){if(this[_0xcc65('0xe')][_0x5af5f2]&&this[_0xcc65('0xe')][_0x5af5f2][_0xcc65('0x13')]){if(this['imapAccounts'][this[_0xcc65('0xe')][_0x5af5f2][_0xcc65('0x13')]['id']]){delete this['imapAccounts'][this['mailAccounts'][_0x5af5f2][_0xcc65('0x13')]['id']];}this['mailAccounts'][_0x5af5f2][_0xcc65('0x13')]['lastSync']=moment();this[_0xcc65('0xf')](_0x5af5f2);}};EmailChannel[_0xcc65('0x18')][_0xcc65('0x21')]=function(_0x8df5a9,_0x331d49){if(this[_0xcc65('0xe')][_0x8df5a9]){this[_0xcc65('0xe')][_0x8df5a9][_0xcc65('0x13')][_0xcc65('0x14')]=_0xcc65('0x20');this['mailAccounts'][_0x8df5a9]['Imap']['messageStatus']=_0x331d49;return this[_0xcc65('0xf')](_0x8df5a9);}};EmailChannel[_0xcc65('0x18')][_0xcc65('0x2d')]=function(_0x323a11,_0x295de0){return this[_0xcc65('0x2e')][_0xcc65('0x2f')](_0x323a11,_0x295de0);};EmailChannel[_0xcc65('0x18')][_0xcc65('0x30')]=function(_0x3d5dec){var _0xfa36e0=this;if(this[_0xcc65('0xe')][_0x3d5dec['id']]){if(_[_0xcc65('0x16')](this['mailAccounts'][_0x3d5dec['id']][_0xcc65('0x31')])){this[_0xcc65('0xe')][_0x3d5dec['id']]['Smtp']={};}this[_0xcc65('0xe')][_0x3d5dec['id']][_0xcc65('0x31')][_0xcc65('0x32')]=moment();return new BPromise(function(_0x198f87,_0x3661c7){return _0xfa36e0[_0xcc65('0x2e')]['verify'](_0x3d5dec)[_0xcc65('0x2a')](function(_0x175522){_0xfa36e0['mailAccounts'][_0x3d5dec['id']]['Smtp'][_0xcc65('0x14')]=_0xcc65('0x33');_0xfa36e0[_0xcc65('0xe')][_0x3d5dec['id']][_0xcc65('0x31')][_0xcc65('0x15')]='';_0xfa36e0[_0xcc65('0xf')](_0x3d5dec['id']);_0x198f87(_0x175522);})['catch'](function(_0x18dd3b){_0xfa36e0[_0xcc65('0xe')][_0x3d5dec['id']][_0xcc65('0x31')][_0xcc65('0x14')]=_0xcc65('0x20');_0xfa36e0[_0xcc65('0xe')][_0x3d5dec['id']][_0xcc65('0x31')][_0xcc65('0x15')]=_0x18dd3b;_0xfa36e0[_0xcc65('0xf')](_0x3d5dec['id']);_0x3661c7(_0x18dd3b);});});}return this[_0xcc65('0x2e')][_0xcc65('0x34')](_0x3d5dec);};module[_0xcc65('0x35')]=EmailChannel; \ No newline at end of file +var _0xd6de=['Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','send','Smtp','verify','verified','catch','exports','lodash','bluebird','md5','ioredis','../../../config/logger','email','redis','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','imapAccounts','smtp','prototype','name','key','active','status','Imap','messageStatus','total','isNil','stringify','emit','refresh','hasOwnProperty','box','handleImapBox','handleImapEmail','bind','handleImapEnd','error','handleImapError','mailAccounts','disabled','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','notify','then','Mail\x20accepted\x20from\x20routing'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xd6de,0xaa));var _0xed6d=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0xd6de[_0x342baa];return _0x1208f3;};'use strict';var _=require(_0xed6d('0x0'));var moment=require('moment');var BPromise=require(_0xed6d('0x1'));var md5=require(_0xed6d('0x2'));var Redis=require(_0xed6d('0x3'));var config=require('../../../config/environment');var logger=require(_0xed6d('0x4'))(_0xed6d('0x5'));config[_0xed6d('0x6')]=_['defaults'](config[_0xed6d('0x6')],{'host':_0xed6d('0x7'),'port':0x18eb});var io=require(_0xed6d('0x8'))(new Redis(config[_0xed6d('0x6')]));var EmailImap=require(_0xed6d('0x9'));var EmailSmtp=require(_0xed6d('0xa'));var mailAccount=require(_0xed6d('0xb'));var md5Accounts={};function EmailChannel(_0x203835){logger[_0xed6d('0xc')](_0xed6d('0xd'));this['mailAccounts']=_0x203835['mailAccounts'];this[_0xed6d('0xe')]={};this[_0xed6d('0xf')]=new EmailSmtp();}EmailChannel[_0xed6d('0x10')]['emit']=function(_0x52aea3){var _0x396f8c=this['mailAccounts'][_0x52aea3];var _0x56e2a1={'id':_0x396f8c['id'],'name':_0x396f8c[_0xed6d('0x11')],'key':_0x396f8c[_0xed6d('0x12')],'active':_0x396f8c[_0xed6d('0x13')],'Imap':{'status':_0x396f8c['Imap'][_0xed6d('0x14')],'messageStatus':_0x396f8c[_0xed6d('0x15')][_0xed6d('0x16')],'total':_0x396f8c[_0xed6d('0x15')][_0xed6d('0x17')]}};if(_[_0xed6d('0x18')](md5Accounts[_0x52aea3])){md5Accounts[_0x52aea3]={};}var _0x426584=md5(JSON[_0xed6d('0x19')](_0x56e2a1));if(md5Accounts[_0x52aea3][_0xed6d('0x2')]!==_0x426584){md5Accounts[_0x52aea3][_0xed6d('0x2')]=_0x426584;io[_0xed6d('0x1a')]('mailAccount:update',_0x56e2a1);}};EmailChannel[_0xed6d('0x10')][_0xed6d('0x1b')]=function(_0x1c3db){for(var _0x3499c4 in _0x1c3db){if(_0x1c3db[_0xed6d('0x1c')](_0x3499c4)){if(_0x1c3db[_0x3499c4][_0xed6d('0x15')]&&_0x1c3db[_0x3499c4]['active']){var _0x5026cc=_0x1c3db[_0x3499c4][_0xed6d('0x15')];if(!this['imapAccounts'][_0xed6d('0x1c')](_0x5026cc['id'])){this[_0xed6d('0xe')][_0x5026cc['id']]=new EmailImap(_0x5026cc,_0x1c3db[_0x3499c4][_0xed6d('0x5')]);this[_0xed6d('0xe')][_0x5026cc['id']]['on'](_0xed6d('0x1d'),this[_0xed6d('0x1e')]['bind'](this,_0x3499c4));this[_0xed6d('0xe')][_0x5026cc['id']]['on'](_0xed6d('0x5'),this[_0xed6d('0x1f')][_0xed6d('0x20')](this,_0x3499c4));this[_0xed6d('0xe')][_0x5026cc['id']]['on']('end',this[_0xed6d('0x21')][_0xed6d('0x20')](this,_0x3499c4));this[_0xed6d('0xe')][_0x5026cc['id']]['on'](_0xed6d('0x22'),this[_0xed6d('0x23')][_0xed6d('0x20')](this,_0x3499c4));}}else{if(_[_0xed6d('0x18')](this[_0xed6d('0x24')][_0x3499c4][_0xed6d('0x15')])){this[_0xed6d('0x24')][_0x3499c4][_0xed6d('0x15')]={};}this[_0xed6d('0x24')][_0x3499c4]['Imap'][_0xed6d('0x14')]=_0xed6d('0x25');this[_0xed6d('0x24')][_0x3499c4][_0xed6d('0x15')][_0xed6d('0x16')]='';this[_0xed6d('0x1a')](_0x3499c4);}}}};EmailChannel[_0xed6d('0x10')][_0xed6d('0x1e')]=function(_0x1c4f8c,_0x2cd727){if(this[_0xed6d('0x24')][_0x1c4f8c]){this[_0xed6d('0x24')][_0x1c4f8c][_0xed6d('0x15')][_0xed6d('0x14')]=_0xed6d('0x26');this[_0xed6d('0x24')][_0x1c4f8c][_0xed6d('0x15')][_0xed6d('0x16')]=_0x2cd727[_0xed6d('0x11')];if(_0x2cd727[_0xed6d('0x27')]){this[_0xed6d('0x24')][_0x1c4f8c][_0xed6d('0x15')][_0xed6d('0x17')]=_0x2cd727[_0xed6d('0x27')][_0xed6d('0x17')];}return this[_0xed6d('0x1a')](_0x1c4f8c);}};EmailChannel[_0xed6d('0x10')][_0xed6d('0x1f')]=function(_0x3bced5,_0x4fc4b5){logger['info'](_0xed6d('0x28'),_0x4fc4b5[_0xed6d('0x29')],_0x4fc4b5[_0xed6d('0x2a')],_0x4fc4b5['from'],_0x3bced5);if(this[_0xed6d('0x24')][_0x3bced5]){return mailAccount[_0xed6d('0x2b')](_0x3bced5,_0x4fc4b5)[_0xed6d('0x2c')](function(_0x3dccab){if(_0x3dccab){logger['info'](_0xed6d('0x2d'));}})['catch'](function(_0x370b2e){logger[_0xed6d('0x22')](_0xed6d('0x2e'),JSON[_0xed6d('0x19')](_0x370b2e));});}};EmailChannel['prototype'][_0xed6d('0x21')]=function(_0x5cd101){if(this[_0xed6d('0x24')][_0x5cd101]&&this[_0xed6d('0x24')][_0x5cd101][_0xed6d('0x15')]){if(this[_0xed6d('0xe')][this[_0xed6d('0x24')][_0x5cd101][_0xed6d('0x15')]['id']]){delete this['imapAccounts'][this[_0xed6d('0x24')][_0x5cd101][_0xed6d('0x15')]['id']];}this[_0xed6d('0x24')][_0x5cd101][_0xed6d('0x15')][_0xed6d('0x2f')]=moment();this['emit'](_0x5cd101);}};EmailChannel['prototype']['handleImapError']=function(_0x19dd82,_0x30b32c){if(this[_0xed6d('0x24')][_0x19dd82]){this[_0xed6d('0x24')][_0x19dd82][_0xed6d('0x15')][_0xed6d('0x14')]=_0xed6d('0x22');this['mailAccounts'][_0x19dd82][_0xed6d('0x15')]['messageStatus']=_0x30b32c;return this[_0xed6d('0x1a')](_0x19dd82);}};EmailChannel['prototype']['sendMail']=function(_0x5f3ea0,_0x35534b){return this[_0xed6d('0xf')][_0xed6d('0x30')](_0x5f3ea0,_0x35534b);};EmailChannel[_0xed6d('0x10')]['verifySmtp']=function(_0x31db39){var _0x5af0ae=this;if(this[_0xed6d('0x24')][_0x31db39['id']]){if(_['isNil'](this[_0xed6d('0x24')][_0x31db39['id']][_0xed6d('0x31')])){this[_0xed6d('0x24')][_0x31db39['id']][_0xed6d('0x31')]={};}this['mailAccounts'][_0x31db39['id']]['Smtp'][_0xed6d('0x2f')]=moment();return new BPromise(function(_0x51bd0d,_0xcf45da){return _0x5af0ae[_0xed6d('0xf')][_0xed6d('0x32')](_0x31db39)['then'](function(_0x16eb42){_0x5af0ae[_0xed6d('0x24')][_0x31db39['id']]['Smtp'][_0xed6d('0x14')]=_0xed6d('0x33');_0x5af0ae[_0xed6d('0x24')][_0x31db39['id']]['Smtp'][_0xed6d('0x16')]='';_0x5af0ae[_0xed6d('0x1a')](_0x31db39['id']);_0x51bd0d(_0x16eb42);})[_0xed6d('0x34')](function(_0x4506f1){_0x5af0ae[_0xed6d('0x24')][_0x31db39['id']][_0xed6d('0x31')][_0xed6d('0x14')]=_0xed6d('0x22');_0x5af0ae[_0xed6d('0x24')][_0x31db39['id']][_0xed6d('0x31')][_0xed6d('0x16')]=_0x4506f1;_0x5af0ae[_0xed6d('0x1a')](_0x31db39['id']);_0xcf45da(_0x4506f1);});});}return this[_0xed6d('0xf')][_0xed6d('0x32')](_0x31db39);};module[_0xed6d('0x35')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index f894c66..4a68129 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 _0xa719=['getHost','email','handleOpenBox','handleError','emit','readUnseen','handleCloseBox','end','search','UNSEEN','handleReadUnseen','fetch','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageEnd','handleSimpleParser','handleEnd','stringify','textCode','hasOwnProperty','upperFirst','path','util','imap','lodash','mailparser','simpleParser','iconv','EventEmitter','./utils','mailbox','INBOX','account','getAccount','once','ready','handleReady','bind','error','connect','inherits','prototype','connTimeout','authTimeout','service','authentication','user','password','host','port','tls','autotls','required'];(function(_0x26237b,_0x5a6aa0){var _0x5f06e5=function(_0x27ad2c){while(--_0x27ad2c){_0x26237b['push'](_0x26237b['shift']());}};_0x5f06e5(++_0x5a6aa0);}(_0xa719,0xc8));var _0x9a71=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xa719[_0x397e5f];return _0x5302b8;};'use strict';var fs=require('fs');var path=require(_0x9a71('0x0'));var util=require(_0x9a71('0x1'));var Imap=require(_0x9a71('0x2'));var _=require(_0x9a71('0x3'));var rs=require('randomstring');var simpleParser=require(_0x9a71('0x4'))[_0x9a71('0x5')];var Iconv=require(_0x9a71('0x6'))['Iconv'];var EventEmitter=require('events')[_0x9a71('0x7')];var utils=require(_0x9a71('0x8'));var logger=require('../../../config/logger')('email');function EmailImap(_0x19310f,_0x2dcbc7){this[_0x9a71('0x9')]=_0x9a71('0xa');this[_0x9a71('0xb')]=this[_0x9a71('0xc')](_0x19310f,_0x2dcbc7);this[_0x9a71('0x2')]=new Imap(this[_0x9a71('0xb')]);this[_0x9a71('0x2')][_0x9a71('0xd')](_0x9a71('0xe'),this[_0x9a71('0xf')][_0x9a71('0x10')](this));this['imap'][_0x9a71('0xd')]('end',this['handleEnd']['bind'](this));this[_0x9a71('0x2')]['on'](_0x9a71('0x11'),this['handleError'][_0x9a71('0x10')](this));this[_0x9a71('0x2')][_0x9a71('0x12')]();}util[_0x9a71('0x13')](EmailImap,EventEmitter);EmailImap[_0x9a71('0x14')][_0x9a71('0xc')]=function(_0x3df96c,_0x5299e4){var _0x27f569={'connTimeout':_0x3df96c[_0x9a71('0x15')]?_0x3df96c[_0x9a71('0x15')]*0x3e8:0x2710,'authTimeout':_0x3df96c[_0x9a71('0x16')]?_0x3df96c[_0x9a71('0x16')]*0x3e8:0x1388};if(_['isNil'](_0x3df96c[_0x9a71('0x17')])){if(_0x3df96c[_0x9a71('0x18')]){_0x27f569[_0x9a71('0x19')]=_0x3df96c[_0x9a71('0x19')];_0x27f569['password']=_0x3df96c[_0x9a71('0x1a')];}_0x27f569[_0x9a71('0x1b')]=_0x3df96c[_0x9a71('0x1b')];_0x27f569[_0x9a71('0x1c')]=_0x3df96c[_0x9a71('0x1c')]||0x3e1;if(_0x3df96c[_0x9a71('0x1d')]){_0x27f569['tls']=!![];}else{_0x27f569[_0x9a71('0x1d')]=![];_0x27f569[_0x9a71('0x1e')]=_0x9a71('0x1f');}}else{_0x27f569[_0x9a71('0x19')]=_0x3df96c[_0x9a71('0x19')];_0x27f569[_0x9a71('0x1a')]=_0x3df96c[_0x9a71('0x1a')];_0x27f569[_0x9a71('0x1b')]=utils[_0x9a71('0x20')](_0x3df96c[_0x9a71('0x17')]);_0x27f569[_0x9a71('0x1c')]=0x3e1;_0x27f569[_0x9a71('0x1d')]=!![];}_0x27f569[_0x9a71('0x21')]=_0x5299e4||_0x3df96c[_0x9a71('0x19')]||'anonymous@xcally.com';return _0x27f569;};EmailImap[_0x9a71('0x14')][_0x9a71('0xf')]=function(){this[_0x9a71('0x2')]['openBox'](this['mailbox'],![],this[_0x9a71('0x22')][_0x9a71('0x10')](this));};EmailImap[_0x9a71('0x14')][_0x9a71('0x22')]=function(_0xa741bb,_0x2cd6ac){if(_0xa741bb){this[_0x9a71('0x23')](_0xa741bb,!![]);}else{this[_0x9a71('0x24')]('box',_0x2cd6ac);this[_0x9a71('0x25')]();}};EmailImap[_0x9a71('0x14')][_0x9a71('0x26')]=function(_0x22b831){if(_0x22b831){this[_0x9a71('0x23')](_0x22b831,!![]);}else{this[_0x9a71('0x2')][_0x9a71('0x27')]();}};EmailImap[_0x9a71('0x14')]['readUnseen']=function(){this[_0x9a71('0x2')][_0x9a71('0x28')]([_0x9a71('0x29')],this[_0x9a71('0x2a')][_0x9a71('0x10')](this));};EmailImap[_0x9a71('0x14')][_0x9a71('0x2a')]=function(_0x55867d,_0x3d91fa){if(_0x55867d){this[_0x9a71('0x23')](_0x55867d,!![]);}else{if(_0x3d91fa['length']){try{var _0xb1e199=this['imap'][_0x9a71('0x2b')](_0x3d91fa,{'bodies':'','markSeen':!![]});_0xb1e199['on']('message',this[_0x9a71('0x2c')][_0x9a71('0x10')](this));_0xb1e199[_0x9a71('0xd')](_0x9a71('0x11'),this[_0x9a71('0x2d')][_0x9a71('0x10')](this));_0xb1e199['once'](_0x9a71('0x27'),this[_0x9a71('0x2e')][_0x9a71('0x10')](this));}catch(_0x12c889){logger['error'](_0x12c889);}}else{this[_0x9a71('0x2')][_0x9a71('0x2f')](!![],this[_0x9a71('0x26')][_0x9a71('0x10')](this));}}};EmailImap[_0x9a71('0x14')]['handleFetchMessage']=function(_0x357a87,_0x84ca2f){_0x357a87['on'](_0x9a71('0x30'),this[_0x9a71('0x31')][_0x9a71('0x10')](this));_0x357a87[_0x9a71('0xd')](_0x9a71('0x32'),this['handleMessageAttributes'][_0x9a71('0x10')](this));_0x357a87['once']('end',this[_0x9a71('0x33')]['bind'](this));};EmailImap[_0x9a71('0x14')][_0x9a71('0x31')]=function(_0x18a8e2,_0x4d9c62){simpleParser(_0x18a8e2,{'Iconv':Iconv},this[_0x9a71('0x34')][_0x9a71('0x10')](this));};EmailImap[_0x9a71('0x14')]['handleMessageAttributes']=function(_0x26c94c){};EmailImap[_0x9a71('0x14')]['handleMessageEnd']=function(){};EmailImap['prototype'][_0x9a71('0x34')]=function(_0x9560df,_0x6b733){if(_0x9560df){logger[_0x9a71('0x11')](_0x9560df);}else{var _0x39d9fc=this;utils['parser'](this['account'],_0x6b733,function(_0x396646){_0x39d9fc[_0x9a71('0x24')](_0x9a71('0x21'),_0x396646);});}};EmailImap[_0x9a71('0x14')][_0x9a71('0x2e')]=function(){this[_0x9a71('0x2')][_0x9a71('0x2f')](!![],this['handleCloseBox'][_0x9a71('0x10')](this));};EmailImap[_0x9a71('0x14')][_0x9a71('0x2d')]=function(_0x1f22b1){this[_0x9a71('0x23')](_0x1f22b1);this[_0x9a71('0x2')][_0x9a71('0x2f')](!![],this[_0x9a71('0x26')][_0x9a71('0x10')](this));};EmailImap[_0x9a71('0x14')][_0x9a71('0x35')]=function(){this[_0x9a71('0x24')](_0x9a71('0x27'));};EmailImap[_0x9a71('0x14')][_0x9a71('0x23')]=function(_0x252e69,_0x211f3d){logger[_0x9a71('0x11')](_0x9a71('0x23'),this[_0x9a71('0xb')][_0x9a71('0x21')],JSON[_0x9a71('0x36')](_0x252e69));var _0x5c78a3='';if(_0x252e69){if(_0x252e69[_0x9a71('0x37')]){_0x5c78a3=_0x252e69['textCode'];}else{for(var _0x52cab6 in _0x252e69){if(_0x252e69[_0x9a71('0x38')](_0x52cab6)){_0x5c78a3+=_[_0x9a71('0x39')](_0x52cab6)+':\x20'+_0x252e69[_0x52cab6]+'\x0a';}}}}if(_0x211f3d){this[_0x9a71('0x2')][_0x9a71('0x27')]();}else{this[_0x9a71('0x24')](_0x9a71('0x11'),_0x5c78a3);this[_0x9a71('0x24')](_0x9a71('0x27'));}};module['exports']=EmailImap; \ No newline at end of file +var _0x251a=['handleEnd','error','handleError','inherits','connTimeout','authTimeout','service','authentication','password','host','port','tls','required','user','getHost','anonymous@xcally.com','prototype','openBox','box','readUnseen','handleCloseBox','UNSEEN','handleReadUnseen','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','emit','stringify','textCode','hasOwnProperty','upperFirst','exports','path','util','imap','lodash','randomstring','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','email','mailbox','INBOX','account','getAccount','once','ready','handleReady','bind','end'];(function(_0x2e6bad,_0x3a47a2){var _0x3eec75=function(_0x1ba661){while(--_0x1ba661){_0x2e6bad['push'](_0x2e6bad['shift']());}};_0x3eec75(++_0x3a47a2);}(_0x251a,0x1db));var _0xa251=function(_0x4fab3f,_0x5b0e8a){_0x4fab3f=_0x4fab3f-0x0;var _0x27364e=_0x251a[_0x4fab3f];return _0x27364e;};'use strict';var fs=require('fs');var path=require(_0xa251('0x0'));var util=require(_0xa251('0x1'));var Imap=require(_0xa251('0x2'));var _=require(_0xa251('0x3'));var rs=require(_0xa251('0x4'));var simpleParser=require(_0xa251('0x5'))[_0xa251('0x6')];var Iconv=require(_0xa251('0x7'))[_0xa251('0x8')];var EventEmitter=require(_0xa251('0x9'))[_0xa251('0xa')];var utils=require('./utils');var logger=require('../../../config/logger')(_0xa251('0xb'));function EmailImap(_0x3b9b07,_0x373cae){this[_0xa251('0xc')]=_0xa251('0xd');this[_0xa251('0xe')]=this[_0xa251('0xf')](_0x3b9b07,_0x373cae);this[_0xa251('0x2')]=new Imap(this['account']);this[_0xa251('0x2')][_0xa251('0x10')](_0xa251('0x11'),this[_0xa251('0x12')][_0xa251('0x13')](this));this[_0xa251('0x2')][_0xa251('0x10')](_0xa251('0x14'),this[_0xa251('0x15')]['bind'](this));this[_0xa251('0x2')]['on'](_0xa251('0x16'),this[_0xa251('0x17')]['bind'](this));this[_0xa251('0x2')]['connect']();}util[_0xa251('0x18')](EmailImap,EventEmitter);EmailImap['prototype']['getAccount']=function(_0x5da491,_0x4473c1){var _0x27bd94={'connTimeout':_0x5da491[_0xa251('0x19')]?_0x5da491[_0xa251('0x19')]*0x3e8:0x2710,'authTimeout':_0x5da491[_0xa251('0x1a')]?_0x5da491[_0xa251('0x1a')]*0x3e8:0x1388};if(_['isNil'](_0x5da491[_0xa251('0x1b')])){if(_0x5da491[_0xa251('0x1c')]){_0x27bd94['user']=_0x5da491['user'];_0x27bd94['password']=_0x5da491[_0xa251('0x1d')];}_0x27bd94['host']=_0x5da491[_0xa251('0x1e')];_0x27bd94[_0xa251('0x1f')]=_0x5da491[_0xa251('0x1f')]||0x3e1;if(_0x5da491[_0xa251('0x20')]){_0x27bd94['tls']=!![];}else{_0x27bd94['tls']=![];_0x27bd94['autotls']=_0xa251('0x21');}}else{_0x27bd94[_0xa251('0x22')]=_0x5da491['user'];_0x27bd94['password']=_0x5da491['password'];_0x27bd94['host']=utils[_0xa251('0x23')](_0x5da491['service']);_0x27bd94['port']=0x3e1;_0x27bd94[_0xa251('0x20')]=!![];}_0x27bd94[_0xa251('0xb')]=_0x4473c1||_0x5da491[_0xa251('0x22')]||_0xa251('0x24');return _0x27bd94;};EmailImap[_0xa251('0x25')][_0xa251('0x12')]=function(){this[_0xa251('0x2')][_0xa251('0x26')](this[_0xa251('0xc')],![],this['handleOpenBox']['bind'](this));};EmailImap[_0xa251('0x25')]['handleOpenBox']=function(_0xfd2a33,_0x175766){if(_0xfd2a33){this[_0xa251('0x17')](_0xfd2a33,!![]);}else{this['emit'](_0xa251('0x27'),_0x175766);this[_0xa251('0x28')]();}};EmailImap['prototype'][_0xa251('0x29')]=function(_0x3b9cb1){if(_0x3b9cb1){this[_0xa251('0x17')](_0x3b9cb1,!![]);}else{this[_0xa251('0x2')]['end']();}};EmailImap['prototype'][_0xa251('0x28')]=function(){this[_0xa251('0x2')]['search']([_0xa251('0x2a')],this[_0xa251('0x2b')][_0xa251('0x13')](this));};EmailImap[_0xa251('0x25')][_0xa251('0x2b')]=function(_0x1b639f,_0x117549){if(_0x1b639f){this['handleError'](_0x1b639f,!![]);}else{if(_0x117549['length']){try{var _0x1ba7ca=this[_0xa251('0x2')][_0xa251('0x2c')](_0x117549,{'bodies':'','markSeen':!![]});_0x1ba7ca['on'](_0xa251('0x2d'),this[_0xa251('0x2e')][_0xa251('0x13')](this));_0x1ba7ca['once']('error',this[_0xa251('0x2f')][_0xa251('0x13')](this));_0x1ba7ca[_0xa251('0x10')](_0xa251('0x14'),this[_0xa251('0x30')]['bind'](this));}catch(_0x4ffa0d){logger['error'](_0x4ffa0d);}}else{this[_0xa251('0x2')][_0xa251('0x31')](!![],this[_0xa251('0x29')][_0xa251('0x13')](this));}}};EmailImap[_0xa251('0x25')][_0xa251('0x2e')]=function(_0xc31990,_0x32a3c7){_0xc31990['on'](_0xa251('0x32'),this[_0xa251('0x33')][_0xa251('0x13')](this));_0xc31990[_0xa251('0x10')]('attributes',this[_0xa251('0x34')][_0xa251('0x13')](this));_0xc31990['once'](_0xa251('0x14'),this[_0xa251('0x35')][_0xa251('0x13')](this));};EmailImap['prototype']['handleMessageBody']=function(_0x2c8ca4,_0x44434b){simpleParser(_0x2c8ca4,{'Iconv':Iconv},this['handleSimpleParser']['bind'](this));};EmailImap[_0xa251('0x25')][_0xa251('0x34')]=function(_0xc0ab92){};EmailImap['prototype'][_0xa251('0x35')]=function(){};EmailImap[_0xa251('0x25')][_0xa251('0x36')]=function(_0x389b09,_0x3dd89f){if(_0x389b09){logger['error'](_0x389b09);}else{var _0x5efa2d=this;utils[_0xa251('0x37')](this[_0xa251('0xe')],_0x3dd89f,function(_0x25859d){_0x5efa2d[_0xa251('0x38')](_0xa251('0xb'),_0x25859d);});}};EmailImap['prototype'][_0xa251('0x30')]=function(){this[_0xa251('0x2')][_0xa251('0x31')](!![],this[_0xa251('0x29')]['bind'](this));};EmailImap[_0xa251('0x25')][_0xa251('0x2f')]=function(_0x178ac5){this['handleError'](_0x178ac5);this[_0xa251('0x2')][_0xa251('0x31')](!![],this[_0xa251('0x29')][_0xa251('0x13')](this));};EmailImap[_0xa251('0x25')]['handleEnd']=function(){this[_0xa251('0x38')](_0xa251('0x14'));};EmailImap[_0xa251('0x25')][_0xa251('0x17')]=function(_0x37f29b,_0x4d6fc0){logger[_0xa251('0x16')](_0xa251('0x17'),this['account'][_0xa251('0xb')],JSON[_0xa251('0x39')](_0x37f29b));var _0x55034d='';if(_0x37f29b){if(_0x37f29b[_0xa251('0x3a')]){_0x55034d=_0x37f29b['textCode'];}else{for(var _0x580d7d in _0x37f29b){if(_0x37f29b[_0xa251('0x3b')](_0x580d7d)){_0x55034d+=_[_0xa251('0x3c')](_0x580d7d)+':\x20'+_0x37f29b[_0x580d7d]+'\x0a';}}}}if(_0x4d6fc0){this[_0xa251('0x2')][_0xa251('0x14')]();}else{this[_0xa251('0x38')]('error',_0x55034d);this['emit'](_0xa251('0x14'));}};module[_0xa251('0x3d')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 3aa0e17..3594fa5 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 _0xb737=['exports','nodemailer','nodemailer-plugin-inline-base64','prototype','send','createTransport','use','compile','sendMail','verify','toString'];(function(_0x3aef25,_0x4d4ce0){var _0x2a7b2a=function(_0x594f72){while(--_0x594f72){_0x3aef25['push'](_0x3aef25['shift']());}};_0x2a7b2a(++_0x4d4ce0);}(_0xb737,0x18d));var _0x7b73=function(_0x25f4dc,_0x59bec9){_0x25f4dc=_0x25f4dc-0x0;var _0x46ce50=_0xb737[_0x25f4dc];return _0x46ce50;};'use strict';var nodemailer=require(_0x7b73('0x0'));var BPromise=require('bluebird');var inlineBase64=require(_0x7b73('0x1'));function EmailSmtp(){}EmailSmtp[_0x7b73('0x2')][_0x7b73('0x3')]=function(_0x28969b,_0x5981ff){return new BPromise(function(_0x7db5c3,_0x550900){var _0x2822a3=nodemailer[_0x7b73('0x4')](_0x28969b);_0x2822a3[_0x7b73('0x5')](_0x7b73('0x6'),inlineBase64());_0x2822a3[_0x7b73('0x7')](_0x5981ff,function(_0x31bb5d,_0x335007){if(_0x31bb5d){_0x550900(_0x31bb5d['toString']());}else{_0x7db5c3(_0x335007);}});});};EmailSmtp['prototype'][_0x7b73('0x8')]=function(_0x35c51a){return new BPromise(function(_0x1ad737,_0xb509ac){var _0x50d825=nodemailer[_0x7b73('0x4')](_0x35c51a);_0x50d825['verify'](function(_0x2669b0,_0x26edf7){if(_0x2669b0){_0xb509ac(_0x2669b0[_0x7b73('0x9')]());}else{if(_0x26edf7){_0x1ad737(_0x26edf7);}else{_0xb509ac('Not\x20verifired');}}});});};module[_0x7b73('0xa')]=EmailSmtp; \ No newline at end of file +var _0xea57=['send','createTransport','use','compile','verify','toString','Not\x20verifired','exports','nodemailer','bluebird','prototype'];(function(_0x173e9a,_0x598c92){var _0x5eedf0=function(_0x4aec44){while(--_0x4aec44){_0x173e9a['push'](_0x173e9a['shift']());}};_0x5eedf0(++_0x598c92);}(_0xea57,0x1e1));var _0x7ea5=function(_0x209ed6,_0x533b95){_0x209ed6=_0x209ed6-0x0;var _0x588a9a=_0xea57[_0x209ed6];return _0x588a9a;};'use strict';var nodemailer=require(_0x7ea5('0x0'));var BPromise=require(_0x7ea5('0x1'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x7ea5('0x2')][_0x7ea5('0x3')]=function(_0x49b234,_0x28ddfb){return new BPromise(function(_0x1bc96c,_0x340271){var _0x3d73c9=nodemailer[_0x7ea5('0x4')](_0x49b234);_0x3d73c9[_0x7ea5('0x5')](_0x7ea5('0x6'),inlineBase64());_0x3d73c9['sendMail'](_0x28ddfb,function(_0x35f9df,_0x635e0f){if(_0x35f9df){_0x340271(_0x35f9df['toString']());}else{_0x1bc96c(_0x635e0f);}});});};EmailSmtp[_0x7ea5('0x2')][_0x7ea5('0x7')]=function(_0x9642c4){return new BPromise(function(_0x15848d,_0x45871e){var _0x3a1085=nodemailer[_0x7ea5('0x4')](_0x9642c4);_0x3a1085[_0x7ea5('0x7')](function(_0xbc7ff6,_0x4f0f10){if(_0xbc7ff6){_0x45871e(_0xbc7ff6[_0x7ea5('0x8')]());}else{if(_0x4f0f10){_0x15848d(_0x4f0f10);}else{_0x45871e(_0x7ea5('0x9'));}}});});};module[_0x7ea5('0xa')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index ff4df57..f4f430e 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 _0x5032=['Title','Data','getHost','gmail','imap.gmail.com','yahoo','hotmail','imap-mail.outlook.com','127.0.0.1','moment','path','util','node-tnef','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','split','length','slice','join','html','test','replace','body','message','email','isEmpty','includes','originTo','originCc','attachments','attach','type','attachment','attachment-','format','now','root','writeFileSync','push','contentType','parser','from','subject','date','YYYY-MM-DD\x20HH:mm:ss','textAsHtml','filter','application/ms-tnef','messageId','parseBuffer','first','content','BodyHTML','

Empty\x20message

','Attachments'];(function(_0xb25817,_0xc04db0){var _0x56aa64=function(_0x3fcbac){while(--_0x3fcbac){_0xb25817['push'](_0xb25817['shift']());}};_0x56aa64(++_0xc04db0);}(_0x5032,0x83));var _0x2503=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x5032[_0xbca1b1];return _0x4e1686;};'use strict';var _=require('lodash');var moment=require(_0x2503('0x0'));var random=require('randomstring');var fs=require('fs');var path=require(_0x2503('0x1'));var util=require(_0x2503('0x2'));var tnef=require(_0x2503('0x3'));var logger=require('../../../config/logger')('email');var config=require(_0x2503('0x4'));function getAddress(_0x4cca6b){var _0x10ffeb=_[_0x2503('0x5')](_0x4cca6b[_0x2503('0x6')]);return _0x10ffeb&&_0x10ffeb['address']?_0x10ffeb[_0x2503('0x7')]:_0x2503('0x8')+random[_0x2503('0x9')](0x6)+_0x2503('0xa');}function getFirstName(_0x5ad410){var _0x51de7f=_[_0x2503('0x5')](_0x5ad410[_0x2503('0x6')]);if(_0x51de7f&&_0x51de7f[_0x2503('0xb')]){var _0x5ac59d=_0x51de7f['name'][_0x2503('0xc')](/\s+/);return _0x5ac59d[_0x2503('0xd')]?_0x5ac59d[_0x2503('0xe')](0x0,-0x1)[_0x2503('0xf')]('\x20'):_0x51de7f['name'];}return'Anonymous';}function getLastName(_0x702733){var _0x23577b=_[_0x2503('0x5')](_0x702733[_0x2503('0x6')]);if(_0x23577b&&_0x23577b[_0x2503('0xb')]){var _0x491df2=_0x23577b[_0x2503('0xb')][_0x2503('0xc')](/\s+/);return _0x491df2[_0x2503('0xd')]>0x1?_0x491df2['pop']():'';}return'';}function getMails(_0x39d517,_0x243278){var _0x16cc68='';for(var _0x305ef1=0x0;_0x305ef1<_0x243278[_0x2503('0x6')]['length'];_0x305ef1+=0x1){if(_0x243278[_0x2503('0x6')][_0x305ef1][_0x2503('0x7')]!==_0x39d517){if(!_['isEmpty'](_0x16cc68)){_0x16cc68+=',';}_0x16cc68+=_0x243278[_0x2503('0x6')][_0x305ef1][_0x2503('0xb')]||_0x243278[_0x2503('0x6')][_0x305ef1][_0x2503('0x7')]||'';_0x16cc68+='\x20<';_0x16cc68+=_0x243278['value'][_0x305ef1][_0x2503('0x7')]?_0x243278[_0x2503('0x6')][_0x305ef1]['address']:'anonymous'+random['generate'](0x6)+_0x2503('0xa');_0x16cc68+='>';}}return _0x16cc68;}function parseEmail(_0x44d525,_0x23ff7e,_0x388fad){if(_0x23ff7e[_0x2503('0x10')]){var _0x8365e0=/)<[^<]*)*<\/script>/gi;while(_0x8365e0[_0x2503('0x11')](_0x23ff7e[_0x2503('0x10')])){_0x23ff7e[_0x2503('0x10')]=_0x23ff7e['html'][_0x2503('0x12')](_0x8365e0,'');}_0x388fad['body']=_0x23ff7e['html'];}else{_0x388fad[_0x2503('0x13')]=_0x23ff7e['textAsHtml'];}if(_0x388fad[_0x2503('0x13')]){_0x388fad[_0x2503('0x13')]=_0x388fad[_0x2503('0x13')]['replace'](/0x1?_0x461912[_0x4aaf('0x13')]():'';}return'';}function getMails(_0x31f4fb,_0x357f1c){var _0x5e6564='';for(var _0x537a98=0x0;_0x537a98<_0x357f1c[_0x4aaf('0xc')][_0x4aaf('0xe')];_0x537a98+=0x1){if(_0x357f1c[_0x4aaf('0xc')][_0x537a98][_0x4aaf('0x8')]!==_0x31f4fb){if(!_['isEmpty'](_0x5e6564)){_0x5e6564+=',';}_0x5e6564+=_0x357f1c[_0x4aaf('0xc')][_0x537a98]['name']||_0x357f1c[_0x4aaf('0xc')][_0x537a98][_0x4aaf('0x8')]||'';_0x5e6564+='\x20<';_0x5e6564+=_0x357f1c[_0x4aaf('0xc')][_0x537a98][_0x4aaf('0x8')]?_0x357f1c[_0x4aaf('0xc')][_0x537a98][_0x4aaf('0x8')]:_0x4aaf('0x9')+random[_0x4aaf('0xa')](0x6)+'@xcally.com';_0x5e6564+='>';}}return _0x5e6564;}function parseEmail(_0x4c51d7,_0x204315,_0x498cec){if(_0x204315['html']){var _0xbaa19a=/)<[^<]*)*<\/script>/gi;while(_0xbaa19a['test'](_0x204315['html'])){_0x204315[_0x4aaf('0x14')]=_0x204315[_0x4aaf('0x14')]['replace'](_0xbaa19a,'');}_0x498cec[_0x4aaf('0x15')]=_0x204315['html'];}else{_0x498cec[_0x4aaf('0x15')]=_0x204315['textAsHtml'];}if(_0x498cec[_0x4aaf('0x15')]){_0x498cec[_0x4aaf('0x15')]=_0x498cec[_0x4aaf('0x15')]['replace'](/Empty\x20message

';if(_0x4886ef[_0x4aaf('0x33')]){for(var _0xe74f8c=0x0;_0xe74f8c<_0x4886ef[_0x4aaf('0x33')][_0x4aaf('0xe')];_0xe74f8c++){var _0x2a8cfd=_0x4886ef[_0x4aaf('0x33')][_0xe74f8c];_0x13ac25[_0x4aaf('0x17')]['attachments']['push']({'filename':_0x2a8cfd['Title'],'content':new Buffer(_0x2a8cfd[_0x4aaf('0x34')])});}}}_0x109dd9(parseEmail(_0xaa659c,_0x337dcf,_0x13ac25));});}else{_0x337dcf[_0x4aaf('0x14')]='

Empty\x20message

';_0x109dd9(parseEmail(_0xaa659c,_0x337dcf,_0x13ac25));}}else{_0x109dd9(parseEmail(_0xaa659c,_0x337dcf,_0x13ac25));}};exports[_0x4aaf('0x35')]=function(_0x472ee1){switch(_0x472ee1){case'gmail':return _0x4aaf('0x36');case _0x4aaf('0x37'):return _0x4aaf('0x38');case _0x4aaf('0x39'):return'imap-mail.outlook.com';case _0x4aaf('0x3a'):return _0x4aaf('0x3b');}return _0x4aaf('0x3c');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index f1b7548..10e103d 100644 --- a/server/services/email/model/mailAccount.js +++ b/server/services/email/model/mailAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9133=['key','active','Imap','Smtp','lodash','name'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0x9133,0x1d8));var _0x3913=function(_0x185e6d,_0x4cce46){_0x185e6d=_0x185e6d-0x0;var _0x32f988=_0x9133[_0x185e6d];return _0x32f988;};'use strict';var _=require(_0x3913('0x0'));function MailAccount(_0x223fcb){this['id']=_0x223fcb['id']||0x0;this[_0x3913('0x1')]=_0x223fcb['name']||'Service';this[_0x3913('0x2')]=_0x223fcb[_0x3913('0x2')]||'SERV';this['active']=_0x223fcb[_0x3913('0x3')]||![];this[_0x3913('0x4')]=_0x223fcb[_0x3913('0x4')]||[];this[_0x3913('0x5')]=_0x223fcb[_0x3913('0x5')]||[];}module['exports']=MailAccount; \ No newline at end of file +var _0xe68a=['active','Imap','Smtp','lodash','Service','key','SERV'];(function(_0x138b7b,_0xe6121f){var _0x5d7261=function(_0x1e58a4){while(--_0x1e58a4){_0x138b7b['push'](_0x138b7b['shift']());}};_0x5d7261(++_0xe6121f);}(_0xe68a,0x130));var _0xae68=function(_0x67f95e,_0x3ca797){_0x67f95e=_0x67f95e-0x0;var _0x538f5a=_0xe68a[_0x67f95e];return _0x538f5a;};'use strict';var _=require(_0xae68('0x0'));function MailAccount(_0x5c7dc1){this['id']=_0x5c7dc1['id']||0x0;this['name']=_0x5c7dc1['name']||_0xae68('0x1');this[_0xae68('0x2')]=_0x5c7dc1[_0xae68('0x2')]||_0xae68('0x3');this[_0xae68('0x4')]=_0x5c7dc1[_0xae68('0x4')]||![];this['Imap']=_0x5c7dc1[_0xae68('0x5')]||[];this[_0xae68('0x6')]=_0x5c7dc1[_0xae68('0x6')]||[];}module['exports']=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 803932f..1582d84 100644 --- a/server/services/email/realtime/index.js +++ b/server/services/email/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe3df=['prototype','mergeFromDatabase','initMailAccounts','mailAccounts','isUndefined','merge','lodash','../model/mailAccount','mapKeys','hasOwnProperty'];(function(_0x542c40,_0x21e121){var _0x33e19b=function(_0x255d87){while(--_0x255d87){_0x542c40['push'](_0x542c40['shift']());}};_0x33e19b(++_0x21e121);}(_0xe3df,0x6a));var _0xfe3d=function(_0x4cb839,_0x138845){_0x4cb839=_0x4cb839-0x0;var _0xbd8dfe=_0xe3df[_0x4cb839];return _0xbd8dfe;};'use strict';var _=require(_0xfe3d('0x0'));var MailAccount=require(_0xfe3d('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x5d826a,_0x22fe43,_0x4f10f3){var _0xc6c754=_[_0xfe3d('0x2')](_0x5d826a,function(_0x304697,_0x16a6b5){return _0x304697[_0x4f10f3];});for(var _0x14aa8a in _0x22fe43){if(_0x22fe43[_0xfe3d('0x3')](_0x14aa8a)){if(!_0xc6c754[_0x14aa8a]){delete _0x22fe43[_0x14aa8a];}}}}Realtime[_0xfe3d('0x4')][_0xfe3d('0x5')]=function(_0x13b998,_0x298461){for(var _0x57b627 in _0x298461){if(_0x13b998[_0xfe3d('0x3')](_0x57b627)){_0x13b998[_0x57b627]=_0x298461[_0x57b627];}}};Realtime[_0xfe3d('0x4')][_0xfe3d('0x6')]=function(){var _0x1163b8=this;return function(_0x1514d1){if(_0x1514d1){freeIsNotKey(_0x1514d1,_0x1163b8[_0xfe3d('0x7')],'id');for(var _0x554755=0x0,_0xda068e={},_0x504507={};_0x554755<_0x1514d1['length'];_0x554755+=0x1){_0xda068e=_0x1514d1[_0x554755];if(_[_0xfe3d('0x8')](_0x1163b8[_0xfe3d('0x7')][_0xda068e['id']])){_0x1163b8['mailAccounts'][_0xda068e['id']]=new MailAccount(_0xda068e);}else{_[_0xfe3d('0x9')](_0x1163b8[_0xfe3d('0x7')][_0xda068e['id']],_0xda068e);}}}return _0x1163b8[_0xfe3d('0x7')];};};module['exports']=Realtime; \ No newline at end of file +var _0x7435=['lodash','../model/mailAccount','mailAccounts','mapKeys','prototype','mergeFromDatabase','hasOwnProperty','initMailAccounts','isUndefined','exports'];(function(_0x5204c9,_0x87afb3){var _0x599c5c=function(_0x109650){while(--_0x109650){_0x5204c9['push'](_0x5204c9['shift']());}};_0x599c5c(++_0x87afb3);}(_0x7435,0x15e));var _0x5743=function(_0x641a8f,_0x5033d5){_0x641a8f=_0x641a8f-0x0;var _0x49be0d=_0x7435[_0x641a8f];return _0x49be0d;};'use strict';var _=require(_0x5743('0x0'));var MailAccount=require(_0x5743('0x1'));var Realtime=function(){this[_0x5743('0x2')]={};};function freeIsNotKey(_0x27e5a1,_0x247e79,_0x984dca){var _0xa44026=_[_0x5743('0x3')](_0x27e5a1,function(_0x52081e,_0x1be1ff){return _0x52081e[_0x984dca];});for(var _0xc0534b in _0x247e79){if(_0x247e79['hasOwnProperty'](_0xc0534b)){if(!_0xa44026[_0xc0534b]){delete _0x247e79[_0xc0534b];}}}}Realtime[_0x5743('0x4')][_0x5743('0x5')]=function(_0x4be290,_0x3223a4){for(var _0x10d1c8 in _0x3223a4){if(_0x4be290[_0x5743('0x6')](_0x10d1c8)){_0x4be290[_0x10d1c8]=_0x3223a4[_0x10d1c8];}}};Realtime[_0x5743('0x4')][_0x5743('0x7')]=function(){var _0x165e61=this;return function(_0x1eea9f){if(_0x1eea9f){freeIsNotKey(_0x1eea9f,_0x165e61['mailAccounts'],'id');for(var _0x1ab4ef=0x0,_0x27602d={},_0x1cff64={};_0x1ab4ef<_0x1eea9f['length'];_0x1ab4ef+=0x1){_0x27602d=_0x1eea9f[_0x1ab4ef];if(_[_0x5743('0x8')](_0x165e61[_0x5743('0x2')][_0x27602d['id']])){_0x165e61[_0x5743('0x2')][_0x27602d['id']]=new MailAccount(_0x27602d);}else{_['merge'](_0x165e61[_0x5743('0x2')][_0x27602d['id']],_0x27602d);}}}return _0x165e61['mailAccounts'];};};module[_0x5743('0x9')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 106acd2..42fcb77 100644 --- a/server/services/email/rpc/mailAccount.js +++ b/server/services/email/rpc/mailAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb1aa=['ListId','TemplateId','MailServerIn','Imap','MailServerOut','Smtp','notify','Request','NotifyMailAccount','../client','getMailAccounts','GetMailAccount','service','email','active','key'];(function(_0x54dff0,_0x3e4022){var _0x5b0198=function(_0x1dc366){while(--_0x1dc366){_0x54dff0['push'](_0x54dff0['shift']());}};_0x5b0198(++_0x3e4022);}(_0xb1aa,0x159));var _0xab1a=function(_0x15f687,_0xe5bb51){_0x15f687=_0x15f687-0x0;var _0x5aca9f=_0xb1aa[_0x15f687];return _0x5aca9f;};'use strict';var client=require(_0xab1a('0x0'));exports[_0xab1a('0x1')]=function(){return function(){return client['Request'](_0xab1a('0x2'),{'options':{'attributes':['id','name',_0xab1a('0x3'),_0xab1a('0x4'),_0xab1a('0x5'),_0xab1a('0x6'),_0xab1a('0x7'),_0xab1a('0x8')],'raw':![],'include':[{'model':_0xab1a('0x9'),'as':_0xab1a('0xa')},{'model':_0xab1a('0xb'),'as':_0xab1a('0xc')}]},'log':'getMailAccount'});};};exports[_0xab1a('0xd')]=function(_0x55a6d,_0x16eace){return client[_0xab1a('0xe')](_0xab1a('0xf'),{'account':{'id':_0x55a6d},'body':_0x16eace,'log':_0xab1a('0xf')});}; \ No newline at end of file +var _0xd47f=['email','active','key','ListId','TemplateId','MailServerIn','Imap','MailServerOut','notify','NotifyMailAccount','../client','Request','GetMailAccount','name','service'];(function(_0xcac86d,_0x17ab23){var _0x205392=function(_0x4bad15){while(--_0x4bad15){_0xcac86d['push'](_0xcac86d['shift']());}};_0x205392(++_0x17ab23);}(_0xd47f,0x1bd));var _0xfd47=function(_0x3d5cab,_0x5cf978){_0x3d5cab=_0x3d5cab-0x0;var _0x4527c1=_0xd47f[_0x3d5cab];return _0x4527c1;};'use strict';var client=require(_0xfd47('0x0'));exports['getMailAccounts']=function(){return function(){return client[_0xfd47('0x1')](_0xfd47('0x2'),{'options':{'attributes':['id',_0xfd47('0x3'),_0xfd47('0x4'),_0xfd47('0x5'),_0xfd47('0x6'),_0xfd47('0x7'),_0xfd47('0x8'),_0xfd47('0x9')],'raw':![],'include':[{'model':_0xfd47('0xa'),'as':_0xfd47('0xb')},{'model':_0xfd47('0xc'),'as':'Smtp'}]},'log':'getMailAccount'});};};exports[_0xfd47('0xd')]=function(_0x5859f6,_0x5cfba2){return client['Request'](_0xfd47('0xe'),{'account':{'id':_0x5859f6},'body':_0x5cfba2,'log':_0xfd47('0xe')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 96d5f35..d7bda03 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac6b=['server','stringify','127.0.0.1','log','jayson/promise','lodash','../../../config/logger','email','listen','account','message','catch','error','verifySmtp','then','Verified','values','mailAccounts','length','Imap','password','Smtp','pass'];(function(_0x395f09,_0x40da67){var _0x182994=function(_0x4e98cd){while(--_0x4e98cd){_0x395f09['push'](_0x395f09['shift']());}};_0x182994(++_0x40da67);}(_0xac6b,0x146));var _0xbac6=function(_0x90b39c,_0x268969){_0x90b39c=_0x90b39c-0x0;var _0x40ad07=_0xac6b[_0x90b39c];return _0x40ad07;};'use strict';var jayson=require(_0xbac6('0x0'));var BPromise=require('bluebird');var _=require(_0xbac6('0x1'));var logger=require(_0xbac6('0x2'))(_0xbac6('0x3'));exports[_0xbac6('0x4')]=function(_0x422d21,_0x15084e){return new BPromise(function(_0x4f627f,_0x26ce0a){var _0x242a3c={'SendMail':function(_0x3655ff){var _0x16a6c8=this;return new Promise(function(_0x3b6ed4,_0x7ed761){_0x15084e['sendMail'](_0x3655ff[_0xbac6('0x5')],_0x3655ff[_0xbac6('0x6')])['then'](function(_0x4a8fd9){_0x3b6ed4({'code':0xc8,'message':_0x4a8fd9});})[_0xbac6('0x7')](function(_0x4e07b8){_0x7ed761(_0x16a6c8[_0xbac6('0x8')](0x1f4,_0x4e07b8));});});},'VerifySmtp':function(_0x94acc4){var _0x118f73=this;return new Promise(function(_0x1cc685,_0x1cfd01){_0x15084e[_0xbac6('0x9')](_0x94acc4[_0xbac6('0x5')])[_0xbac6('0xa')](function(_0x31648c){_0x1cc685({'code':0xc8,'message':_0xbac6('0xb')});})[_0xbac6('0x7')](function(_0x51ea1f){_0x1cfd01(_0x118f73[_0xbac6('0x8')](0x1f4,_0x51ea1f));});});},'MailAccounts':function(_0x6db573){return new Promise(function(_0x1bce3f,_0xa52d6b){var _0x589ee0=_[_0xbac6('0xc')](_0x422d21[_0xbac6('0xd')]);for(var _0x4e464d=0x0;_0x4e464d<_0x589ee0[_0xbac6('0xe')];_0x4e464d+=0x1){if(_0x589ee0[_0x4e464d][_0xbac6('0xf')]&&_0x589ee0[_0x4e464d][_0xbac6('0xf')][_0xbac6('0x10')]){delete _0x589ee0[_0x4e464d]['Imap']['password'];}if(_0x589ee0[_0x4e464d][_0xbac6('0x11')]&&_0x589ee0[_0x4e464d][_0xbac6('0x11')][_0xbac6('0x12')]){delete _0x589ee0[_0x4e464d][_0xbac6('0x11')][_0xbac6('0x12')];}}_0x1bce3f({'count':_0x589ee0[_0xbac6('0xe')],'rows':_0x589ee0});});}};var _0x8cdafd=jayson[_0xbac6('0x13')](_0x242a3c)['http']();_0x8cdafd['on'](_0xbac6('0x8'),function(_0x6b7dc6){logger['error'](JSON[_0xbac6('0x14')](_0x6b7dc6));return _0x26ce0a(_0x6b7dc6);});_0x8cdafd[_0xbac6('0x4')](0x232b,_0xbac6('0x15'),function(){console[_0xbac6('0x16')]('Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232b);return _0x4f627f('RPC\x20listening\x20on\x20port:'+0x232b);});});}; \ No newline at end of file +var _0xd48f=['log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','../../../config/logger','email','account','then','verifySmtp','Verified','catch','error','mailAccounts','length','Imap','password','Smtp','pass','http','stringify','listen'];(function(_0x182dde,_0x544c61){var _0x57cc8c=function(_0x339a37){while(--_0x339a37){_0x182dde['push'](_0x182dde['shift']());}};_0x57cc8c(++_0x544c61);}(_0xd48f,0x163));var _0xfd48=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0xd48f[_0x4fbfd9];return _0x31dc94;};'use strict';var jayson=require(_0xfd48('0x0'));var BPromise=require(_0xfd48('0x1'));var _=require('lodash');var logger=require(_0xfd48('0x2'))(_0xfd48('0x3'));exports['listen']=function(_0x20dfbe,_0x45ae45){return new BPromise(function(_0xe65a27,_0x5f0921){var _0x44be34={'SendMail':function(_0x2decb1){var _0x3e8b8d=this;return new Promise(function(_0x25263b,_0x5cb78a){_0x45ae45['sendMail'](_0x2decb1[_0xfd48('0x4')],_0x2decb1['message'])[_0xfd48('0x5')](function(_0xe9012e){_0x25263b({'code':0xc8,'message':_0xe9012e});})['catch'](function(_0x3460d2){_0x5cb78a(_0x3e8b8d['error'](0x1f4,_0x3460d2));});});},'VerifySmtp':function(_0xcb937a){var _0x3f5cb0=this;return new Promise(function(_0x1a84f9,_0x4735d6){_0x45ae45[_0xfd48('0x6')](_0xcb937a[_0xfd48('0x4')])[_0xfd48('0x5')](function(_0x57fb0d){_0x1a84f9({'code':0xc8,'message':_0xfd48('0x7')});})[_0xfd48('0x8')](function(_0x47b1c3){_0x4735d6(_0x3f5cb0[_0xfd48('0x9')](0x1f4,_0x47b1c3));});});},'MailAccounts':function(_0x516b21){return new Promise(function(_0x4a37c9,_0x4aac02){var _0x24f31c=_['values'](_0x20dfbe[_0xfd48('0xa')]);for(var _0x57622d=0x0;_0x57622d<_0x24f31c[_0xfd48('0xb')];_0x57622d+=0x1){if(_0x24f31c[_0x57622d][_0xfd48('0xc')]&&_0x24f31c[_0x57622d][_0xfd48('0xc')][_0xfd48('0xd')]){delete _0x24f31c[_0x57622d][_0xfd48('0xc')][_0xfd48('0xd')];}if(_0x24f31c[_0x57622d][_0xfd48('0xe')]&&_0x24f31c[_0x57622d][_0xfd48('0xe')][_0xfd48('0xf')]){delete _0x24f31c[_0x57622d][_0xfd48('0xe')][_0xfd48('0xf')];}}_0x4a37c9({'count':_0x24f31c[_0xfd48('0xb')],'rows':_0x24f31c});});}};var _0x37b66c=jayson['server'](_0x44be34)[_0xfd48('0x10')]();_0x37b66c['on'](_0xfd48('0x9'),function(_0xc161c8){logger[_0xfd48('0x9')](JSON[_0xfd48('0x11')](_0xc161c8));return _0x5f0921(_0xc161c8);});_0x37b66c[_0xfd48('0x12')](0x232b,'127.0.0.1',function(){console[_0xfd48('0x13')](_0xfd48('0x14'),0x232b);return _0xe65a27(_0xfd48('0x15')+0x232b);});});}; \ No newline at end of file diff --git a/server/services/express/index.js b/server/services/express/index.js index 87d9e44..10c4eb4 100644 --- a/server/services/express/index.js +++ b/server/services/express/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8da4=['default','../../routes','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','express','ioredis','timeout','listen','port','polling','redis','defaults','localhost','adapter','socket.io-redis','../../config/triggers'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x8da4,0x113));var _0x48da=function(_0x43f75d,_0x5ce501){_0x43f75d=_0x43f75d-0x0;var _0x35e22f=_0x8da4[_0x43f75d];return _0x35e22f;};'use strict';var _=require(_0x48da('0x0'));var http=require('http');var express=require(_0x48da('0x1'));var sticky=require('sticky-session');var Redis=require(_0x48da('0x2'));var config=require('../../config/environment');var app=express();var server=http['createServer'](app);server[_0x48da('0x3')]=0xdbba0;if(sticky[_0x48da('0x4')](server,config[_0x48da('0x5')])){var socketio=require('socket.io')(server,{'transports':['websocket',_0x48da('0x6')]});config[_0x48da('0x7')]=_[_0x48da('0x8')](config[_0x48da('0x7')],{'host':_0x48da('0x9'),'port':0x18eb});socketio[_0x48da('0xa')](require(_0x48da('0xb'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0x48da('0x7')])}));require(_0x48da('0xc'))[_0x48da('0xd')]();require('../../config/socketio')[_0x48da('0xd')](socketio);require('../../config/express')[_0x48da('0xd')](app);require(_0x48da('0xe'))[_0x48da('0xd')](app);}else{server['once']('listening',function(){console[_0x48da('0xf')](_0x48da('0x10'),config[_0x48da('0x5')]);});}exports=module[_0x48da('0x11')]=app; \ No newline at end of file +var _0x5388=['websocket','polling','redis','defaults','localhost','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','http','express','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port'];(function(_0x251d23,_0x2730f2){var _0xc557dc=function(_0x19a8f4){while(--_0x19a8f4){_0x251d23['push'](_0x251d23['shift']());}};_0xc557dc(++_0x2730f2);}(_0x5388,0x15f));var _0x8538=function(_0x3cb43a,_0x7b8d1d){_0x3cb43a=_0x3cb43a-0x0;var _0x1a3d90=_0x5388[_0x3cb43a];return _0x1a3d90;};'use strict';var _=require('lodash');var http=require(_0x8538('0x0'));var express=require(_0x8538('0x1'));var sticky=require(_0x8538('0x2'));var Redis=require(_0x8538('0x3'));var config=require(_0x8538('0x4'));var app=express();var server=http[_0x8538('0x5')](app);server[_0x8538('0x6')]=0xdbba0;if(sticky[_0x8538('0x7')](server,config[_0x8538('0x8')])){var socketio=require('socket.io')(server,{'transports':[_0x8538('0x9'),_0x8538('0xa')]});config[_0x8538('0xb')]=_[_0x8538('0xc')](config[_0x8538('0xb')],{'host':_0x8538('0xd'),'port':0x18eb});socketio['adapter'](require(_0x8538('0xe'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0x8538('0xb')])}));require(_0x8538('0xf'))[_0x8538('0x10')]();require(_0x8538('0x11'))[_0x8538('0x10')](socketio);require(_0x8538('0x12'))[_0x8538('0x10')](app);require(_0x8538('0x13'))[_0x8538('0x10')](app);}else{server['once'](_0x8538('0x14'),function(){console[_0x8538('0x15')](_0x8538('0x16'),config[_0x8538('0x8')]);});}exports=module[_0x8538('0x17')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index ae6bea4..46669c2 100644 --- a/server/services/routing/client.js +++ b/server/services/routing/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb2ff=['error','message','catch','jayson/promise','bluebird','routing','request','then','rpc'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0xb2ff,0x123));var _0xfb2f=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xb2ff[_0x3ab51d];return _0x29a04e;};'use strict';var jayson=require(_0xfb2f('0x0'));var BPromise=require(_0xfb2f('0x1'));var logger=require('../../config/logger')(_0xfb2f('0x2'));var client=jayson['client']['http']({'port':0x2329});client['Request']=function(_0x13cb60,_0x484368){return new BPromise(function(_0x145e77,_0x28df19){return client[_0xfb2f('0x3')](_0x13cb60,_0x484368)[_0xfb2f('0x4')](function(_0x542ce7){logger['debug'](_0xfb2f('0x5'),'routing',_0x13cb60,_0x484368,_0x542ce7);if(_0x542ce7[_0xfb2f('0x6')]){logger[_0xfb2f('0x6')](_0xfb2f('0x5'),_0xfb2f('0x2'),_0x13cb60,_0x542ce7['error'][_0xfb2f('0x7')],_0x484368);return _0x28df19(_0x542ce7['error'][_0xfb2f('0x7')]);}else{return _0x145e77(_0x542ce7['result']);}})[_0xfb2f('0x8')](function(_0x1a7aad){logger[_0xfb2f('0x6')](_0xfb2f('0x5'),_0xfb2f('0x2'),_0x13cb60,_0x1a7aad,_0x484368);return _0x28df19(_0x1a7aad);});});};module['exports']=client; \ No newline at end of file +var _0xd846=['../../config/logger','http','request','debug','rpc','routing','error','message','catch','jayson/promise','bluebird'];(function(_0x1fe113,_0x47a7fd){var _0x56cf30=function(_0x550de7){while(--_0x550de7){_0x1fe113['push'](_0x1fe113['shift']());}};_0x56cf30(++_0x47a7fd);}(_0xd846,0x195));var _0x6d84=function(_0x2a6c5c,_0x298a11){_0x2a6c5c=_0x2a6c5c-0x0;var _0x17e92b=_0xd846[_0x2a6c5c];return _0x17e92b;};'use strict';var jayson=require(_0x6d84('0x0'));var BPromise=require(_0x6d84('0x1'));var logger=require(_0x6d84('0x2'))('routing');var client=jayson['client'][_0x6d84('0x3')]({'port':0x2329});client['Request']=function(_0x47e90f,_0x15fb0c){return new BPromise(function(_0xa19796,_0x5c2176){return client[_0x6d84('0x4')](_0x47e90f,_0x15fb0c)['then'](function(_0x4a7c2d){logger[_0x6d84('0x5')](_0x6d84('0x6'),_0x6d84('0x7'),_0x47e90f,_0x15fb0c,_0x4a7c2d);if(_0x4a7c2d[_0x6d84('0x8')]){logger[_0x6d84('0x8')](_0x6d84('0x6'),_0x6d84('0x7'),_0x47e90f,_0x4a7c2d[_0x6d84('0x8')][_0x6d84('0x9')],_0x15fb0c);return _0x5c2176(_0x4a7c2d[_0x6d84('0x8')][_0x6d84('0x9')]);}else{return _0xa19796(_0x4a7c2d['result']);}})[_0x6d84('0xa')](function(_0x5bc018){logger['error'](_0x6d84('0x6'),_0x6d84('0x7'),_0x47e90f,_0x5bc018,_0x15fb0c);return _0x5c2176(_0x5bc018);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 27b2968..2d65058 100644 --- a/server/services/routing/index.js +++ b/server/services/routing/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb01b=['./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','then','initAgents','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','initFaxQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/openchannelQueue'];(function(_0x451222,_0x1d2018){var _0x3511f5=function(_0x4eba97){while(--_0x4eba97){_0x451222['push'](_0x451222['shift']());}};_0x3511f5(++_0x1d2018);}(_0xb01b,0x133));var _0xbb01=function(_0x3dac83,_0x5da8ad){_0x3dac83=_0x3dac83-0x0;var _0x2d0492=_0xb01b[_0x3dac83];return _0x2d0492;};'use strict';var BPromise=require(_0xbb01('0x0'));var server=require(_0xbb01('0x1'));var Realtime=require(_0xbb01('0x2'));var user=require(_0xbb01('0x3'));var interval=require('./rpc/interval');var openchannelQueue=require(_0xbb01('0x4'));var chatQueue=require(_0xbb01('0x5'));var smsQueue=require(_0xbb01('0x6'));var mailQueue=require(_0xbb01('0x7'));var faxQueue=require(_0xbb01('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()['then'](user['getAgents']())[_0xbb01('0x9')](realtime[_0xbb01('0xa')]())[_0xbb01('0x9')](interval['getIntervals']())[_0xbb01('0x9')](realtime[_0xbb01('0xb')]())[_0xbb01('0x9')](openchannelQueue[_0xbb01('0xc')]())[_0xbb01('0x9')](realtime[_0xbb01('0xd')]())[_0xbb01('0x9')](chatQueue[_0xbb01('0xe')]())[_0xbb01('0x9')](realtime[_0xbb01('0xf')]())[_0xbb01('0x9')](smsQueue[_0xbb01('0x10')]())[_0xbb01('0x9')](realtime[_0xbb01('0x11')]())['then'](mailQueue[_0xbb01('0x12')]())['then'](realtime[_0xbb01('0x13')]())[_0xbb01('0x9')](faxQueue['getFaxQueues']())['then'](realtime[_0xbb01('0x14')]())[_0xbb01('0x9')](function(){return realtime;});}function main(){return server[_0xbb01('0x15')](realtime)[_0xbb01('0x9')](function(_0x4e3d0e){return initRealtime();})[_0xbb01('0x9')](function(_0x825178){return setInterval(initRealtime,0x1388);})[_0xbb01('0x16')](function(_0x44ef8d){console[_0xbb01('0x17')](_0x44ef8d);});}main(); \ No newline at end of file +var _0xba9d=['./rpc/smsQueue','./rpc/faxQueue','getAgents','initAgents','then','getIntervals','initIntervals','initOpenchannelQueues','getChatQueues','initChatQueues','initSmsQueues','getMailQueues','getFaxQueues','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue'];(function(_0x5aa6b3,_0x217be9){var _0xfc3abc=function(_0x120aea){while(--_0x120aea){_0x5aa6b3['push'](_0x5aa6b3['shift']());}};_0xfc3abc(++_0x217be9);}(_0xba9d,0x12d));var _0xdba9=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xba9d[_0x3ab51d];return _0x29a04e;};'use strict';var BPromise=require(_0xdba9('0x0'));var server=require(_0xdba9('0x1'));var Realtime=require(_0xdba9('0x2'));var user=require(_0xdba9('0x3'));var interval=require(_0xdba9('0x4'));var openchannelQueue=require(_0xdba9('0x5'));var chatQueue=require(_0xdba9('0x6'));var smsQueue=require(_0xdba9('0x7'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0xdba9('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()['then'](user[_0xdba9('0x9')]())['then'](realtime[_0xdba9('0xa')]())[_0xdba9('0xb')](interval[_0xdba9('0xc')]())[_0xdba9('0xb')](realtime[_0xdba9('0xd')]())[_0xdba9('0xb')](openchannelQueue['getOpenchannelQueues']())[_0xdba9('0xb')](realtime[_0xdba9('0xe')]())['then'](chatQueue[_0xdba9('0xf')]())[_0xdba9('0xb')](realtime[_0xdba9('0x10')]())[_0xdba9('0xb')](smsQueue['getSmsQueues']())['then'](realtime[_0xdba9('0x11')]())[_0xdba9('0xb')](mailQueue[_0xdba9('0x12')]())['then'](realtime['initMailQueues']())[_0xdba9('0xb')](faxQueue[_0xdba9('0x13')]())['then'](realtime['initFaxQueues']())[_0xdba9('0xb')](function(){return realtime;});}function main(){return server['listen'](realtime)[_0xdba9('0xb')](function(_0x1c0cad){return initRealtime();})[_0xdba9('0xb')](function(_0x704080){return setInterval(initRealtime,0x1388);})[_0xdba9('0x14')](function(_0x388fc8){console[_0xdba9('0x15')](_0x388fc8);});}main(); \ No newline at end of file diff --git a/server/services/routing/lib/rule-engine.js b/server/services/routing/lib/rule-engine.js index c60df67..9b1cd15 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x017d=['isNil','orderBy','asc','execute','result','clone','consequence','ruleRef','index_','nextTick','call','next','isEqual','restart','length','condition','matchPath','noop','findRules','matches','prioritize','toJSON','map','toString','fromJSON','isString','parse','object','exports','lodash','util','events','EventEmitter','init','register','ignoreFactChanges','inherits','prototype','isArray','concat','isObject','push','sync','activeRules','rules','filter'];(function(_0x4706c1,_0x3e879f){var _0x56d0b8=function(_0x36267d){while(--_0x36267d){_0x4706c1['push'](_0x4706c1['shift']());}};_0x56d0b8(++_0x3e879f);}(_0x017d,0xd5));var _0xd017=function(_0x4ffd25,_0x1d0afd){_0x4ffd25=_0x4ffd25-0x0;var _0x28d6be=_0x017d[_0x4ffd25];return _0x28d6be;};'use strict';var _=require(_0xd017('0x0'));var util=require(_0xd017('0x1'));var EventEmitter=require(_0xd017('0x2'))[_0xd017('0x3')];function RuleEngine(_0x538244,_0x1064bb){this[_0xd017('0x4')]();if(!_['isNil'](_0x538244)){this[_0xd017('0x5')](_0x538244);}if(_0x1064bb){this['ignoreFactChanges']=_0x1064bb[_0xd017('0x6')];}return this;}util[_0xd017('0x7')](RuleEngine,EventEmitter);RuleEngine[_0xd017('0x8')]['init']=function(_0x98331e){this['rules']=[];this['activeRules']=[];};RuleEngine['prototype']['register']=function(_0x1cb22a){if(Array[_0xd017('0x9')](_0x1cb22a)){this['rules']=this['rules'][_0xd017('0xa')](_0x1cb22a);}else if(_0x1cb22a!==null&&_[_0xd017('0xb')](_0x1cb22a)){this['rules'][_0xd017('0xc')](_0x1cb22a);}this[_0xd017('0xd')]();};RuleEngine[_0xd017('0x8')][_0xd017('0xd')]=function(){this[_0xd017('0xe')]=this[_0xd017('0xf')][_0xd017('0x10')](function(_0x1a1978){if(_[_0xd017('0x11')](_0x1a1978['on'])){_0x1a1978['on']=!![];}if(_0x1a1978['on']===!![]){return _0x1a1978;}});this['activeRules']=_[_0xd017('0x12')](this[_0xd017('0xe')],['p'],[_0xd017('0x13')]);};RuleEngine[_0xd017('0x8')][_0xd017('0x14')]=function(_0x27a749,_0x39b5b4){var _0x4f576f=![];_0x27a749[_0xd017('0x15')]=!![];var _0x40c5b2=_[_0xd017('0x16')](_0x27a749);var _0x11a58e=_[_0xd017('0x16')](_0x27a749);var _0x5db721=this[_0xd017('0xe')];var _0x4afaeb=[];var _0x2c7ce5=this[_0xd017('0x6')];(function FnRuleLoop(_0xc368b6){var _0x4960be={'rules':function(){return _0x5db721;},'rule':function(){return _0x5db721[_0xc368b6];},'when':function(_0x4e9be7){if(_0x4e9be7){var _0x363078=_0x5db721[_0xc368b6][_0xd017('0x17')];_0x363078[_0xd017('0x18')]=_0x5db721[_0xc368b6]['id']||_0x5db721[_0xc368b6]['name']||_0xd017('0x19')+_0xc368b6;process[_0xd017('0x1a')](function(){_0x4afaeb[_0xd017('0xc')](_0x363078[_0xd017('0x18')]);_0x363078[_0xd017('0x1b')](_0x40c5b2,_0x4960be);});}else{process['nextTick'](function(){_0x4960be[_0xd017('0x1c')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x4f576f=!![];return FnRuleLoop(0x0);},'next':function(_0x5903de){if(!_0x2c7ce5&&!_[_0xd017('0x1d')](_0x11a58e,_0x40c5b2)){_0x11a58e=_[_0xd017('0x16')](_0x40c5b2);process[_0xd017('0x1a')](function(){_0x4960be[_0xd017('0x1e')]();});}else{process[_0xd017('0x1a')](function(){if(_['isNil'](_0x5903de)){return FnRuleLoop(_0xc368b6+0x1);}else{return FnRuleLoop(_0x5903de);}});}}};if(_0xc368b6<_0x5db721[_0xd017('0x1f')]&&_0x4f576f===![]){var _0x3176c6=_0x5db721[_0xc368b6][_0xd017('0x20')];_0x3176c6['call'](_0x40c5b2,_0x4960be);}else{process[_0xd017('0x1a')](function(){_0x40c5b2[_0xd017('0x21')]=_0x4afaeb;return _0x39b5b4?_0x39b5b4(_0x40c5b2):_[_0xd017('0x22')]();});}}(0x0));};RuleEngine[_0xd017('0x8')][_0xd017('0x23')]=function(_0xb1ca2c){if(_[_0xd017('0x11')](_0xb1ca2c)){return this[_0xd017('0xf')];}else{var _0x229ba2=_[_0xd017('0x24')](_0xb1ca2c);return _[_0xd017('0x10')](this[_0xd017('0xf')],_0x229ba2);}};RuleEngine['prototype']['turn']=function(_0x43e695,_0x35eebd){var _0x43e695=_0x43e695==='on'||_0x43e695==='ON'?!![]:![];var _0xdfbdd=this[_0xd017('0x23')](_0x35eebd);for(var _0x251a5b=0x0,_0x5c308c=_0xdfbdd['length'];_0x251a5b<_0x5c308c;_0x251a5b+=0x1){_0xdfbdd[_0x251a5b]['on']=_0x43e695;}this[_0xd017('0xd')]();};RuleEngine[_0xd017('0x8')][_0xd017('0x25')]=function(_0x1395b6,_0x58b4ce){_0x1395b6=parseInt(_0x1395b6,0xa);var _0x1645da=this[_0xd017('0x23')](_0x58b4ce);for(var _0x5ee277=0x0,_0x1d57f6=_0x1645da[_0xd017('0x1f')];_0x5ee277<_0x1d57f6;_0x5ee277+=0x1){_0x1645da[_0x5ee277]['priority']=_0x1395b6;}this[_0xd017('0xd')]();};RuleEngine['prototype'][_0xd017('0x26')]=function(){var _0x272635=this[_0xd017('0xf')];if(_0x272635 instanceof Array){_0x272635=_0x272635[_0xd017('0x27')](function(_0x45e80e){_0x45e80e[_0xd017('0x20')]=_0x45e80e['condition'][_0xd017('0x28')]();_0x45e80e[_0xd017('0x17')]=_0x45e80e[_0xd017('0x17')][_0xd017('0x28')]();return _0x45e80e;});}else if(!_['isNil'](_0x272635)){_0x272635[_0xd017('0x20')]=_0x272635[_0xd017('0x20')][_0xd017('0x28')]();_0x272635['consequence']=_0x272635[_0xd017('0x17')][_0xd017('0x28')]();}return _0x272635;};RuleEngine[_0xd017('0x8')][_0xd017('0x29')]=function(_0x1edb5c){this[_0xd017('0x4')]();if(_[_0xd017('0x2a')](_0x1edb5c)){_0x1edb5c=JSON[_0xd017('0x2b')](_0x1edb5c);}if(_0x1edb5c instanceof Array){_0x1edb5c=_0x1edb5c[_0xd017('0x27')](function(_0x2935e2){_0x2935e2[_0xd017('0x20')]=eval('('+_0x2935e2[_0xd017('0x20')]+')');_0x2935e2[_0xd017('0x17')]=eval('('+_0x2935e2[_0xd017('0x17')]+')');return _0x2935e2;});}else if(_0x1edb5c!==null&&typeof _0x1edb5c==_0xd017('0x2c')){_0x1edb5c[_0xd017('0x20')]=eval('('+_0x1edb5c[_0xd017('0x20')]+')');_0x1edb5c[_0xd017('0x17')]=eval('('+_0x1edb5c[_0xd017('0x17')]+')');}this[_0xd017('0x5')](_0x1edb5c);};module[_0xd017('0x2d')]=RuleEngine; \ No newline at end of file +var _0x2f60=['priority','toString','isString','parse','object','exports','util','events','EventEmitter','init','isNil','register','ignoreFactChanges','prototype','isArray','rules','concat','isObject','sync','activeRules','filter','orderBy','asc','execute','result','clone','consequence','ruleRef','index_','nextTick','push','call','next','isEqual','restart','length','condition','matchPath','noop','findRules','matches','turn','prioritize'];(function(_0x110ef3,_0x3749b3){var _0x2e6462=function(_0x4f2ea2){while(--_0x4f2ea2){_0x110ef3['push'](_0x110ef3['shift']());}};_0x2e6462(++_0x3749b3);}(_0x2f60,0x1df));var _0x02f6=function(_0x3e317b,_0x2c64f2){_0x3e317b=_0x3e317b-0x0;var _0x2bec45=_0x2f60[_0x3e317b];return _0x2bec45;};'use strict';var _=require('lodash');var util=require(_0x02f6('0x0'));var EventEmitter=require(_0x02f6('0x1'))[_0x02f6('0x2')];function RuleEngine(_0x45b299,_0x2baa0b){this[_0x02f6('0x3')]();if(!_[_0x02f6('0x4')](_0x45b299)){this[_0x02f6('0x5')](_0x45b299);}if(_0x2baa0b){this[_0x02f6('0x6')]=_0x2baa0b['ignoreFactChanges'];}return this;}util['inherits'](RuleEngine,EventEmitter);RuleEngine[_0x02f6('0x7')][_0x02f6('0x3')]=function(_0x55bddf){this['rules']=[];this['activeRules']=[];};RuleEngine[_0x02f6('0x7')][_0x02f6('0x5')]=function(_0x1e71ff){if(Array[_0x02f6('0x8')](_0x1e71ff)){this[_0x02f6('0x9')]=this[_0x02f6('0x9')][_0x02f6('0xa')](_0x1e71ff);}else if(_0x1e71ff!==null&&_[_0x02f6('0xb')](_0x1e71ff)){this[_0x02f6('0x9')]['push'](_0x1e71ff);}this[_0x02f6('0xc')]();};RuleEngine[_0x02f6('0x7')]['sync']=function(){this[_0x02f6('0xd')]=this['rules'][_0x02f6('0xe')](function(_0x327caa){if(_[_0x02f6('0x4')](_0x327caa['on'])){_0x327caa['on']=!![];}if(_0x327caa['on']===!![]){return _0x327caa;}});this[_0x02f6('0xd')]=_[_0x02f6('0xf')](this[_0x02f6('0xd')],['p'],[_0x02f6('0x10')]);};RuleEngine[_0x02f6('0x7')][_0x02f6('0x11')]=function(_0x26acbe,_0x5e17dc){var _0x34f6b0=![];_0x26acbe[_0x02f6('0x12')]=!![];var _0x536b86=_[_0x02f6('0x13')](_0x26acbe);var _0x66ba1c=_[_0x02f6('0x13')](_0x26acbe);var _0x39155c=this['activeRules'];var _0x822f70=[];var _0x1f1c22=this[_0x02f6('0x6')];(function FnRuleLoop(_0x4de4e1){var _0x1019b5={'rules':function(){return _0x39155c;},'rule':function(){return _0x39155c[_0x4de4e1];},'when':function(_0x3e0cc1){if(_0x3e0cc1){var _0x8eeaa3=_0x39155c[_0x4de4e1][_0x02f6('0x14')];_0x8eeaa3[_0x02f6('0x15')]=_0x39155c[_0x4de4e1]['id']||_0x39155c[_0x4de4e1]['name']||_0x02f6('0x16')+_0x4de4e1;process[_0x02f6('0x17')](function(){_0x822f70[_0x02f6('0x18')](_0x8eeaa3[_0x02f6('0x15')]);_0x8eeaa3[_0x02f6('0x19')](_0x536b86,_0x1019b5);});}else{process[_0x02f6('0x17')](function(){_0x1019b5[_0x02f6('0x1a')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x34f6b0=!![];return FnRuleLoop(0x0);},'next':function(_0x23126a){if(!_0x1f1c22&&!_[_0x02f6('0x1b')](_0x66ba1c,_0x536b86)){_0x66ba1c=_[_0x02f6('0x13')](_0x536b86);process[_0x02f6('0x17')](function(){_0x1019b5[_0x02f6('0x1c')]();});}else{process[_0x02f6('0x17')](function(){if(_['isNil'](_0x23126a)){return FnRuleLoop(_0x4de4e1+0x1);}else{return FnRuleLoop(_0x23126a);}});}}};if(_0x4de4e1<_0x39155c[_0x02f6('0x1d')]&&_0x34f6b0===![]){var _0x58d08f=_0x39155c[_0x4de4e1][_0x02f6('0x1e')];_0x58d08f['call'](_0x536b86,_0x1019b5);}else{process['nextTick'](function(){_0x536b86[_0x02f6('0x1f')]=_0x822f70;return _0x5e17dc?_0x5e17dc(_0x536b86):_[_0x02f6('0x20')]();});}}(0x0));};RuleEngine[_0x02f6('0x7')][_0x02f6('0x21')]=function(_0x14ac22){if(_[_0x02f6('0x4')](_0x14ac22)){return this[_0x02f6('0x9')];}else{var _0x576b07=_[_0x02f6('0x22')](_0x14ac22);return _[_0x02f6('0xe')](this[_0x02f6('0x9')],_0x576b07);}};RuleEngine[_0x02f6('0x7')][_0x02f6('0x23')]=function(_0x2f4923,_0x36d978){var _0x2f4923=_0x2f4923==='on'||_0x2f4923==='ON'?!![]:![];var _0x2c2280=this[_0x02f6('0x21')](_0x36d978);for(var _0x56d409=0x0,_0x261904=_0x2c2280[_0x02f6('0x1d')];_0x56d409<_0x261904;_0x56d409+=0x1){_0x2c2280[_0x56d409]['on']=_0x2f4923;}this[_0x02f6('0xc')]();};RuleEngine[_0x02f6('0x7')][_0x02f6('0x24')]=function(_0x16c225,_0x58d8d1){_0x16c225=parseInt(_0x16c225,0xa);var _0x19060f=this[_0x02f6('0x21')](_0x58d8d1);for(var _0x7b2967=0x0,_0x147d25=_0x19060f[_0x02f6('0x1d')];_0x7b2967<_0x147d25;_0x7b2967+=0x1){_0x19060f[_0x7b2967][_0x02f6('0x25')]=_0x16c225;}this['sync']();};RuleEngine[_0x02f6('0x7')]['toJSON']=function(){var _0x256052=this[_0x02f6('0x9')];if(_0x256052 instanceof Array){_0x256052=_0x256052['map'](function(_0x5da134){_0x5da134[_0x02f6('0x1e')]=_0x5da134[_0x02f6('0x1e')][_0x02f6('0x26')]();_0x5da134[_0x02f6('0x14')]=_0x5da134[_0x02f6('0x14')][_0x02f6('0x26')]();return _0x5da134;});}else if(!_[_0x02f6('0x4')](_0x256052)){_0x256052[_0x02f6('0x1e')]=_0x256052[_0x02f6('0x1e')]['toString']();_0x256052[_0x02f6('0x14')]=_0x256052['consequence'][_0x02f6('0x26')]();}return _0x256052;};RuleEngine[_0x02f6('0x7')]['fromJSON']=function(_0x5d3c7a){this['init']();if(_[_0x02f6('0x27')](_0x5d3c7a)){_0x5d3c7a=JSON[_0x02f6('0x28')](_0x5d3c7a);}if(_0x5d3c7a instanceof Array){_0x5d3c7a=_0x5d3c7a['map'](function(_0x4b31d3){_0x4b31d3[_0x02f6('0x1e')]=eval('('+_0x4b31d3[_0x02f6('0x1e')]+')');_0x4b31d3[_0x02f6('0x14')]=eval('('+_0x4b31d3[_0x02f6('0x14')]+')');return _0x4b31d3;});}else if(_0x5d3c7a!==null&&typeof _0x5d3c7a==_0x02f6('0x29')){_0x5d3c7a['condition']=eval('('+_0x5d3c7a[_0x02f6('0x1e')]+')');_0x5d3c7a[_0x02f6('0x14')]=eval('('+_0x5d3c7a['consequence']+')');}this['register'](_0x5d3c7a);};module[_0x02f6('0x2a')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 463ccba..ff3c20d 100644 --- a/server/services/routing/mailRpc/index.js +++ b/server/services/routing/mailRpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['bluebird','jayson/promise','client','http','request','then','error','result','catch','sendMailMessage','SendMail'];(function(_0x3700d7,_0x752580){var _0x3d8d5e=function(_0x45952a){while(--_0x45952a){_0x3700d7['push'](_0x3700d7['shift']());}};_0x3d8d5e(++_0x752580);}(_0x814b,0x1a2));var _0xb814=function(_0xdf5fc5,_0x37255b){_0xdf5fc5=_0xdf5fc5-0x0;var _0x52f5a5=_0x814b[_0xdf5fc5];return _0x52f5a5;};'use strict';var BPromise=require(_0xb814('0x0'));var jayson=require(_0xb814('0x1'));var client=jayson[_0xb814('0x2')][_0xb814('0x3')]({'port':0x232b});function request(_0xfbb64b,_0x477725){return new BPromise(function(_0x4a98af,_0x38c21a){return client[_0xb814('0x4')](_0xfbb64b,_0x477725)[_0xb814('0x5')](function(_0x4237bc){if(_0x4237bc[_0xb814('0x6')]){return _0x38c21a(_0x4237bc[_0xb814('0x6')]['message']);}else{return _0x4a98af(_0x4237bc[_0xb814('0x7')]);}})[_0xb814('0x8')](function(_0x5c8539){return _0x38c21a(_0x5c8539);});});}exports[_0xb814('0x9')]=function(_0x2913a6,_0x186d5a){return request(_0xb814('0xa'),{'account':_0x2913a6,'message':_0x186d5a});}; \ No newline at end of file +var _0x9957=['result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message'];(function(_0x3efbbe,_0x44b1c9){var _0x103b68=function(_0x2de6f8){while(--_0x2de6f8){_0x3efbbe['push'](_0x3efbbe['shift']());}};_0x103b68(++_0x44b1c9);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var BPromise=require(_0x7995('0x0'));var jayson=require(_0x7995('0x1'));var client=jayson[_0x7995('0x2')][_0x7995('0x3')]({'port':0x232b});function request(_0x5b96eb,_0x86c128){return new BPromise(function(_0x3c58eb,_0x1902b4){return client[_0x7995('0x4')](_0x5b96eb,_0x86c128)['then'](function(_0x744bea){if(_0x744bea[_0x7995('0x5')]){return _0x1902b4(_0x744bea[_0x7995('0x5')][_0x7995('0x6')]);}else{return _0x3c58eb(_0x744bea[_0x7995('0x7')]);}})[_0x7995('0x8')](function(_0x4996ca){return _0x1902b4(_0x4996ca);});});}exports[_0x7995('0x9')]=function(_0x1cad37,_0x4a64f7){return request(_0x7995('0xa'),{'account':_0x1cad37,'message':_0x4a64f7});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index c3c5689..17a8ae3 100644 --- a/server/services/routing/model/agent.js +++ b/server/services/routing/model/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd87e=['chatStatusTime','chatCurrentCapacity','mailStatus','smsCurrentCapacity','stringify','user:save','exports','lodash','moment','ioredis','../../../config/environment','redis','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatCapacity','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','md5','updateRealtime','prototype','getChannelStatus','CurrentCapacity','working','mail','openchannel','fax','sms','length','Status','StatusTime','toNumber','format'];(function(_0x171e6f,_0x374d24){var _0xee8f3f=function(_0x2f82b8){while(--_0x2f82b8){_0x171e6f['push'](_0x171e6f['shift']());}};_0xee8f3f(++_0x374d24);}(_0xd87e,0x1bf));var _0xed87=function(_0x369069,_0x27e63f){_0x369069=_0x369069-0x0;var _0x4b1f6d=_0xd87e[_0x369069];return _0x4b1f6d;};'use strict';var _=require(_0xed87('0x0'));var moment=require(_0xed87('0x1'));var md5=require('md5');var Redis=require(_0xed87('0x2'));var config=require(_0xed87('0x3'));config[_0xed87('0x4')]=_['defaults'](config[_0xed87('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xed87('0x5'))(new Redis(config[_0xed87('0x4')]));function Agent(_0x5c9f03){this['id']=_0x5c9f03['id']||0x0;this[_0xed87('0x6')]=_0x5c9f03['name']||'';this['online']=_0x5c9f03[_0xed87('0x7')]||!![];this[_0xed87('0x8')]=_0x5c9f03[_0xed87('0x8')]||![];this[_0xed87('0x9')]=_0x5c9f03['chatPause']||![];this[_0xed87('0xa')]=_0x5c9f03[_0xed87('0xa')]||![];this[_0xed87('0xb')]=_0x5c9f03[_0xed87('0xb')]||![];this[_0xed87('0xc')]=_0x5c9f03[_0xed87('0xc')]||![];this[_0xed87('0xd')]=_0x5c9f03['openchannelPause']||![];this[_0xed87('0xe')]=_0xed87('0xf');this['chatStatusTime']=0x0;this[_0xed87('0x10')]=_0x5c9f03[_0xed87('0x10')]||0x0;this['chatCurrentCapacity']=0x0;this['mailStatus']=_0xed87('0xf');this[_0xed87('0x11')]=0x0;this[_0xed87('0x12')]=_0x5c9f03[_0xed87('0x12')]||0x0;this[_0xed87('0x13')]=0x0;this[_0xed87('0x14')]='unknown';this[_0xed87('0x15')]=0x0;this[_0xed87('0x16')]=_0x5c9f03[_0xed87('0x16')]||0x0;this[_0xed87('0x17')]=0x0;this[_0xed87('0x18')]=_0xed87('0xf');this[_0xed87('0x19')]=0x0;this[_0xed87('0x1a')]=_0x5c9f03[_0xed87('0x1a')]||0x0;this['smsCurrentCapacity']=0x0;this[_0xed87('0x1b')]=_0xed87('0xf');this[_0xed87('0x1c')]=0x0;this[_0xed87('0x1d')]=_0x5c9f03['openchannelCapacity']||0x0;this[_0xed87('0x1e')]=0x0;this[_0xed87('0x1f')]=![];this[_0xed87('0x20')]=undefined;this[_0xed87('0x21')]='';this[_0xed87('0x22')]();}Agent[_0xed87('0x23')][_0xed87('0x24')]=function(_0x6df244){if(this[_0x6df244+_0xed87('0x25')]>0x0){if(this[_0x6df244+'Capacity']>0x0&&this[_0x6df244+'CurrentCapacity']>=this[_0x6df244+'Capacity']){return'maxcapacity';}else{return _0xed87('0x26');}}else{return'idle';}};Agent[_0xed87('0x23')][_0xed87('0x22')]=function(){var _0x5b1659=[_0xed87('0x27'),'chat',_0xed87('0x28'),_0xed87('0x29'),_0xed87('0x2a')];for(var _0x2a8733=0x0;_0x2a8733<_0x5b1659[_0xed87('0x2b')];_0x2a8733+=0x1){var _0x5d15b3=this[_0xed87('0x24')](_0x5b1659[_0x2a8733]);if(this[_0x5b1659[_0x2a8733]+_0xed87('0x2c')]!==_0x5d15b3){this[_0x5b1659[_0x2a8733]+_0xed87('0x2d')]=_[_0xed87('0x2e')](moment()[_0xed87('0x2f')]('x'));}this[_0x5b1659[_0x2a8733]+_0xed87('0x2c')]=_0x5d15b3;}var _0x25a6f7={'id':this['id'],'name':this[_0xed87('0x6')],'online':this[_0xed87('0x7')],'voicePause':this[_0xed87('0x8')],'chatPause':this[_0xed87('0x9')],'mailPause':this[_0xed87('0xa')],'smsPause':this[_0xed87('0xc')],'faxPause':this[_0xed87('0xb')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0xed87('0xe')],'chatStatusTime':this[_0xed87('0x30')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0xed87('0x31')],'mailStatus':this[_0xed87('0x32')],'mailStatusTime':this[_0xed87('0x11')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0xed87('0x14')],'faxStatusTime':this[_0xed87('0x15')],'faxCapacity':this[_0xed87('0x16')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0xed87('0x18')],'smsStatusTime':this[_0xed87('0x19')],'smsCapacity':this[_0xed87('0x1a')],'smsCurrentCapacity':this[_0xed87('0x33')],'openchannelStatus':this[_0xed87('0x1b')],'openchannelStatusTime':this[_0xed87('0x1c')],'openchannelCapacity':this[_0xed87('0x1d')],'openchannelCurrentCapacity':this[_0xed87('0x1e')],'busy':this[_0xed87('0x1f')],'busyQueue':this['busyQueue']};var _0x37783a=md5(JSON[_0xed87('0x34')](_0x25a6f7));if(this['md5']!==_0x37783a){this[_0xed87('0x21')]=_0x37783a;io['emit'](_0xed87('0x35'),_0x25a6f7);}};module[_0xed87('0x36')]=Agent; \ No newline at end of file +var _0x9b9b=['busy','busyQueue','md5','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','chat','openchannel','sms','length','toNumber','format','mailCurrentCapacity','openchannelStatus','openchannelCurrentCapacity','user:save','exports','moment','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','faxPause','smsPause','openchannelPause','chatStatus','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','unknown','mailCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','openchannelStatusTime','openchannelCapacity'];(function(_0x58c1a8,_0xfd5378){var _0x5533df=function(_0xcb58ad){while(--_0xcb58ad){_0x58c1a8['push'](_0x58c1a8['shift']());}};_0x5533df(++_0xfd5378);}(_0x9b9b,0x114));var _0xb9b9=function(_0x467c05,_0x2cbb49){_0x467c05=_0x467c05-0x0;var _0x192eee=_0x9b9b[_0x467c05];return _0x192eee;};'use strict';var _=require('lodash');var moment=require(_0xb9b9('0x0'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0xb9b9('0x1'));config[_0xb9b9('0x2')]=_[_0xb9b9('0x3')](config[_0xb9b9('0x2')],{'host':_0xb9b9('0x4'),'port':0x18eb});var io=require(_0xb9b9('0x5'))(new Redis(config[_0xb9b9('0x2')]));function Agent(_0x23208e){this['id']=_0x23208e['id']||0x0;this[_0xb9b9('0x6')]=_0x23208e[_0xb9b9('0x6')]||'';this[_0xb9b9('0x7')]=_0x23208e[_0xb9b9('0x7')]||!![];this[_0xb9b9('0x8')]=_0x23208e[_0xb9b9('0x8')]||![];this[_0xb9b9('0x9')]=_0x23208e[_0xb9b9('0x9')]||![];this['mailPause']=_0x23208e['mailPause']||![];this[_0xb9b9('0xa')]=_0x23208e[_0xb9b9('0xa')]||![];this[_0xb9b9('0xb')]=_0x23208e['smsPause']||![];this[_0xb9b9('0xc')]=_0x23208e[_0xb9b9('0xc')]||![];this[_0xb9b9('0xd')]='unknown';this[_0xb9b9('0xe')]=0x0;this[_0xb9b9('0xf')]=_0x23208e[_0xb9b9('0xf')]||0x0;this[_0xb9b9('0x10')]=0x0;this[_0xb9b9('0x11')]=_0xb9b9('0x12');this['mailStatusTime']=0x0;this['mailCapacity']=_0x23208e[_0xb9b9('0x13')]||0x0;this['mailCurrentCapacity']=0x0;this[_0xb9b9('0x14')]='unknown';this[_0xb9b9('0x15')]=0x0;this[_0xb9b9('0x16')]=_0x23208e[_0xb9b9('0x16')]||0x0;this[_0xb9b9('0x17')]=0x0;this[_0xb9b9('0x18')]=_0xb9b9('0x12');this[_0xb9b9('0x19')]=0x0;this[_0xb9b9('0x1a')]=_0x23208e['smsCapacity']||0x0;this[_0xb9b9('0x1b')]=0x0;this['openchannelStatus']=_0xb9b9('0x12');this[_0xb9b9('0x1c')]=0x0;this[_0xb9b9('0x1d')]=_0x23208e[_0xb9b9('0x1d')]||0x0;this['openchannelCurrentCapacity']=0x0;this[_0xb9b9('0x1e')]=![];this[_0xb9b9('0x1f')]=undefined;this[_0xb9b9('0x20')]='';this[_0xb9b9('0x21')]();}Agent[_0xb9b9('0x22')][_0xb9b9('0x23')]=function(_0xa183ad){if(this[_0xa183ad+_0xb9b9('0x24')]>0x0){if(this[_0xa183ad+_0xb9b9('0x25')]>0x0&&this[_0xa183ad+_0xb9b9('0x24')]>=this[_0xa183ad+_0xb9b9('0x25')]){return _0xb9b9('0x26');}else{return _0xb9b9('0x27');}}else{return'idle';}};Agent[_0xb9b9('0x22')][_0xb9b9('0x21')]=function(){var _0x1cb58a=['mail',_0xb9b9('0x28'),_0xb9b9('0x29'),'fax',_0xb9b9('0x2a')];for(var _0x20e260=0x0;_0x20e260<_0x1cb58a[_0xb9b9('0x2b')];_0x20e260+=0x1){var _0x40b801=this[_0xb9b9('0x23')](_0x1cb58a[_0x20e260]);if(this[_0x1cb58a[_0x20e260]+'Status']!==_0x40b801){this[_0x1cb58a[_0x20e260]+'StatusTime']=_[_0xb9b9('0x2c')](moment()[_0xb9b9('0x2d')]('x'));}this[_0x1cb58a[_0x20e260]+'Status']=_0x40b801;}var _0x30ac24={'id':this['id'],'name':this[_0xb9b9('0x6')],'online':this[_0xb9b9('0x7')],'voicePause':this[_0xb9b9('0x8')],'chatPause':this[_0xb9b9('0x9')],'mailPause':this['mailPause'],'smsPause':this[_0xb9b9('0xb')],'faxPause':this['faxPause'],'openchannelPause':this[_0xb9b9('0xc')],'chatStatus':this[_0xb9b9('0xd')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0xb9b9('0xf')],'chatCurrentCapacity':this[_0xb9b9('0x10')],'mailStatus':this[_0xb9b9('0x11')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0xb9b9('0x13')],'mailCurrentCapacity':this[_0xb9b9('0x2e')],'faxStatus':this[_0xb9b9('0x14')],'faxStatusTime':this[_0xb9b9('0x15')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0xb9b9('0x17')],'smsStatus':this[_0xb9b9('0x18')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0xb9b9('0x1a')],'smsCurrentCapacity':this[_0xb9b9('0x1b')],'openchannelStatus':this[_0xb9b9('0x2f')],'openchannelStatusTime':this[_0xb9b9('0x1c')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0xb9b9('0x30')],'busy':this[_0xb9b9('0x1e')],'busyQueue':this[_0xb9b9('0x1f')]};var _0x2f68c5=md5(JSON['stringify'](_0x30ac24));if(this[_0xb9b9('0x20')]!==_0x2f68c5){this[_0xb9b9('0x20')]=_0x2f68c5;io['emit'](_0xb9b9('0x31'),_0x30ac24);}};module[_0xb9b9('0x32')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index f4e280d..2935420 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 _0xc50d=['updateRealtime','mapAgentsId','_rr','map','prototype','loggedIn','paused','length','online','chatPause','available','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','md5','updateRouting'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc50d,0x70));var _0xdc50=function(_0x5e7a65,_0x2dc2c2){_0x5e7a65=_0x5e7a65-0x0;var _0x514f3e=_0xc50d[_0x5e7a65];return _0x514f3e;};'use strict';var _=require(_0xdc50('0x0'));var md5=require('md5');var util=require(_0xdc50('0x1'));var Redis=require(_0xdc50('0x2'));var config=require(_0xdc50('0x3'));config[_0xdc50('0x4')]=_[_0xdc50('0x5')](config[_0xdc50('0x4')],{'host':_0xdc50('0x6'),'port':0x18eb});var io=require(_0xdc50('0x7'))(new Redis(config[_0xdc50('0x4')]));function ChatQueue(_0x4b66a3){this['id']=_0x4b66a3['id']||0x0;this['name']=_0x4b66a3[_0xdc50('0x8')]||'';this[_0xdc50('0x9')]=_0x4b66a3[_0xdc50('0x9')]||0xa;this[_0xdc50('0xa')]=_0x4b66a3[_0xdc50('0xa')]||_0xdc50('0xb');this[_0xdc50('0xc')]=_0x4b66a3[_0xdc50('0xc')];this['mapAgentsId']={};this[_0xdc50('0xd')]=0x0;this[_0xdc50('0xe')]='';this[_0xdc50('0xf')]();this[_0xdc50('0x10')]();}ChatQueue['prototype'][_0xdc50('0xf')]=function(){var _0x1e6a90=this[_0xdc50('0x11')][_0xdc50('0x12')];this[_0xdc50('0x11')]=_[_0xdc50('0x13')](this['Agents'],'id');this['mapAgentsId'][_0xdc50('0x12')]=_0x1e6a90;};ChatQueue[_0xdc50('0x14')][_0xdc50('0x10')]=function(){this[_0xdc50('0x15')]=0x0;this[_0xdc50('0x16')]=0x0;for(var _0x19b1b7=0x0;_0x19b1b7=0x0?this['available']:0x0;var _0x3b6c34={'id':this['id'],'available':this[_0xdc50('0x1a')],'loggedIn':this[_0xdc50('0x15')],'name':this[_0xdc50('0x8')],'paused':this['paused'],'waiting':this['waiting']};var _0x4a3e39=md5(JSON['stringify'](_0x3b6c34));if(this[_0xdc50('0xe')]!==_0x4a3e39){this[_0xdc50('0xe')]=_0x4a3e39;io['to'](util[_0xdc50('0x1b')](_0xdc50('0x1c'),_0x3b6c34[_0xdc50('0x8')]))[_0xdc50('0x1d')](_0xdc50('0x1e'),_0x3b6c34);}};module[_0xdc50('0x1f')]=ChatQueue; \ No newline at end of file +var _0xb36c=['../../../config/environment','redis','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','prototype','updateRouting','map','updateRealtime','loggedIn','online','chatPause','paused','available','stringify','format','emit','chat_queue:save','exports','lodash','util','ioredis'];(function(_0x5c68c3,_0x1ec9a1){var _0x5ed804=function(_0xd1e76f){while(--_0xd1e76f){_0x5c68c3['push'](_0x5c68c3['shift']());}};_0x5ed804(++_0x1ec9a1);}(_0xb36c,0x169));var _0xcb36=function(_0x1bf75f,_0x306d73){_0x1bf75f=_0x1bf75f-0x0;var _0x31735d=_0xb36c[_0x1bf75f];return _0x31735d;};'use strict';var _=require(_0xcb36('0x0'));var md5=require('md5');var util=require(_0xcb36('0x1'));var Redis=require(_0xcb36('0x2'));var config=require(_0xcb36('0x3'));config[_0xcb36('0x4')]=_['defaults'](config[_0xcb36('0x4')],{'host':_0xcb36('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xcb36('0x4')]));function ChatQueue(_0x4ed88e){this['id']=_0x4ed88e['id']||0x0;this[_0xcb36('0x6')]=_0x4ed88e[_0xcb36('0x6')]||'';this[_0xcb36('0x7')]=_0x4ed88e[_0xcb36('0x7')]||0xa;this[_0xcb36('0x8')]=_0x4ed88e['strategy']||_0xcb36('0x9');this['Agents']=_0x4ed88e[_0xcb36('0xa')];this[_0xcb36('0xb')]={};this[_0xcb36('0xc')]=0x0;this[_0xcb36('0xd')]='';this['updateRouting']();this['updateRealtime']();}ChatQueue[_0xcb36('0xe')][_0xcb36('0xf')]=function(){var _0x3a113e=this['mapAgentsId']['_rr'];this['mapAgentsId']=_[_0xcb36('0x10')](this[_0xcb36('0xa')],'id');this[_0xcb36('0xb')]['_rr']=_0x3a113e;};ChatQueue[_0xcb36('0xe')][_0xcb36('0x11')]=function(){this[_0xcb36('0x12')]=0x0;this['paused']=0x0;for(var _0x588f10=0x0;_0x588f10=0x0?this[_0xcb36('0x16')]:0x0;var _0x401412={'id':this['id'],'available':this['available'],'loggedIn':this[_0xcb36('0x12')],'name':this[_0xcb36('0x6')],'paused':this[_0xcb36('0x15')],'waiting':this[_0xcb36('0xc')]};var _0x13e656=md5(JSON[_0xcb36('0x17')](_0x401412));if(this[_0xcb36('0xd')]!==_0x13e656){this[_0xcb36('0xd')]=_0x13e656;io['to'](util[_0xcb36('0x18')]('chat:queue:%s',_0x401412['name']))[_0xcb36('0x19')](_0xcb36('0x1a'),_0x401412);}};module[_0xcb36('0x1b')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 960394d..d119e22 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 _0xa9e0=['available','stringify','format','emit','exports','lodash','md5','util','redis','localhost','socket.io-emitter','name','timeout','beepall','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','Agents','_rr','loggedIn','paused','length','faxPause'];(function(_0x49bb66,_0x1842ff){var _0x4f56fe=function(_0x32e21d){while(--_0x32e21d){_0x49bb66['push'](_0x49bb66['shift']());}};_0x4f56fe(++_0x1842ff);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'use strict';var _=require(_0x0a9e('0x0'));var md5=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x0a9e('0x3')]=_['defaults'](config[_0x0a9e('0x3')],{'host':_0x0a9e('0x4'),'port':0x18eb});var io=require(_0x0a9e('0x5'))(new Redis(config[_0x0a9e('0x3')]));function FaxQueue(_0x981158){this['id']=_0x981158['id']||0x0;this['name']=_0x981158[_0x0a9e('0x6')]||'';this[_0x0a9e('0x7')]=_0x981158[_0x0a9e('0x7')]||0xa;this['strategy']=_0x981158['strategy']||_0x0a9e('0x8');this['Agents']=_0x981158['Agents'];this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]=0x0;this[_0x0a9e('0x1')]='';this[_0x0a9e('0xb')]();this[_0x0a9e('0xc')]();}FaxQueue[_0x0a9e('0xd')]['updateRouting']=function(){var _0x50dfb2=this['mapAgentsId']['_rr'];this[_0x0a9e('0x9')]=_[_0x0a9e('0xe')](this[_0x0a9e('0xf')],'id');this[_0x0a9e('0x9')][_0x0a9e('0x10')]=_0x50dfb2;};FaxQueue[_0x0a9e('0xd')]['updateRealtime']=function(){this[_0x0a9e('0x11')]=0x0;this[_0x0a9e('0x12')]=0x0;for(var _0x2b4227=0x0;_0x2b4227=0x0?this[_0x0a9e('0x15')]:0x0;var _0x478723={'id':this['id'],'available':this[_0x0a9e('0x15')],'loggedIn':this[_0x0a9e('0x11')],'name':this[_0x0a9e('0x6')],'paused':this[_0x0a9e('0x12')],'waiting':this[_0x0a9e('0xa')]};var _0x20559e=md5(JSON[_0x0a9e('0x16')](_0x478723));if(this[_0x0a9e('0x1')]!==_0x20559e){this[_0x0a9e('0x1')]=_0x20559e;io['to'](util[_0x0a9e('0x17')]('fax:queue:%s',_0x478723[_0x0a9e('0x6')]))[_0x0a9e('0x18')]('fax_queue:save',_0x478723);}};module[_0x0a9e('0x19')]=FaxQueue; \ No newline at end of file +var _0xa9e0=['available','stringify','format','emit','exports','lodash','md5','util','redis','localhost','socket.io-emitter','name','timeout','beepall','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','Agents','_rr','loggedIn','paused','length','faxPause'];(function(_0xb90e99,_0x552485){var _0x24124d=function(_0x15a3c3){while(--_0x15a3c3){_0xb90e99['push'](_0xb90e99['shift']());}};_0x24124d(++_0x552485);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'use strict';var _=require(_0x0a9e('0x0'));var md5=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x0a9e('0x3')]=_['defaults'](config[_0x0a9e('0x3')],{'host':_0x0a9e('0x4'),'port':0x18eb});var io=require(_0x0a9e('0x5'))(new Redis(config[_0x0a9e('0x3')]));function FaxQueue(_0x981158){this['id']=_0x981158['id']||0x0;this['name']=_0x981158[_0x0a9e('0x6')]||'';this[_0x0a9e('0x7')]=_0x981158[_0x0a9e('0x7')]||0xa;this['strategy']=_0x981158['strategy']||_0x0a9e('0x8');this['Agents']=_0x981158['Agents'];this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]=0x0;this[_0x0a9e('0x1')]='';this[_0x0a9e('0xb')]();this[_0x0a9e('0xc')]();}FaxQueue[_0x0a9e('0xd')]['updateRouting']=function(){var _0x50dfb2=this['mapAgentsId']['_rr'];this[_0x0a9e('0x9')]=_[_0x0a9e('0xe')](this[_0x0a9e('0xf')],'id');this[_0x0a9e('0x9')][_0x0a9e('0x10')]=_0x50dfb2;};FaxQueue[_0x0a9e('0xd')]['updateRealtime']=function(){this[_0x0a9e('0x11')]=0x0;this[_0x0a9e('0x12')]=0x0;for(var _0x2b4227=0x0;_0x2b4227=0x0?this[_0x0a9e('0x15')]:0x0;var _0x478723={'id':this['id'],'available':this[_0x0a9e('0x15')],'loggedIn':this[_0x0a9e('0x11')],'name':this[_0x0a9e('0x6')],'paused':this[_0x0a9e('0x12')],'waiting':this[_0x0a9e('0xa')]};var _0x20559e=md5(JSON[_0x0a9e('0x16')](_0x478723));if(this[_0x0a9e('0x1')]!==_0x20559e){this[_0x0a9e('0x1')]=_0x20559e;io['to'](util[_0x0a9e('0x17')]('fax:queue:%s',_0x478723[_0x0a9e('0x6')]))[_0x0a9e('0x18')]('fax_queue:save',_0x478723);}};module[_0x0a9e('0x19')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index c53b84e..34054ad 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 _0xe14b=['Intervals','exports','name'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xe14b,0x16d));var _0xbe14=function(_0x7bc8a0,_0x188f8e){_0x7bc8a0=_0x7bc8a0-0x0;var _0x4d49f5=_0xe14b[_0x7bc8a0];return _0x4d49f5;};'use strict';function Interval(_0x20b1f5){this['id']=_0x20b1f5['id']||0x0;this[_0xbe14('0x0')]=_0x20b1f5[_0xbe14('0x0')]||'';this[_0xbe14('0x1')]=_0x20b1f5[_0xbe14('0x1')]||{};}module[_0xbe14('0x2')]=Interval; \ No newline at end of file +var _0x6ae4=['exports','name','Intervals'];(function(_0x5ee0ee,_0x3ce413){var _0x198093=function(_0x29dcc9){while(--_0x29dcc9){_0x5ee0ee['push'](_0x5ee0ee['shift']());}};_0x198093(++_0x3ce413);}(_0x6ae4,0x76));var _0x46ae=function(_0x5886d9,_0x5b36f0){_0x5886d9=_0x5886d9-0x0;var _0xc7ecd3=_0x6ae4[_0x5886d9];return _0xc7ecd3;};'use strict';function Interval(_0x53e198){this['id']=_0x53e198['id']||0x0;this[_0x46ae('0x0')]=_0x53e198[_0x46ae('0x0')]||'';this[_0x46ae('0x1')]=_0x53e198[_0x46ae('0x1')]||{};}module[_0x46ae('0x2')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 7c9e9f8..d28d752 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 _0xb397=['redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','online','mailPause','available','paused','stringify','md5','mail:queue:%s','emit','mail_queue:save','exports','util','ioredis','../../../config/environment','defaults'];(function(_0x211fef,_0x4ab716){var _0x5447bf=function(_0x306ea3){while(--_0x306ea3){_0x211fef['push'](_0x211fef['shift']());}};_0x5447bf(++_0x4ab716);}(_0xb397,0x1af));var _0x7b39=function(_0x1e907e,_0xa853a9){_0x1e907e=_0x1e907e-0x0;var _0x5798b3=_0xb397[_0x1e907e];return _0x5798b3;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x7b39('0x0'));var Redis=require(_0x7b39('0x1'));var config=require(_0x7b39('0x2'));config['redis']=_[_0x7b39('0x3')](config[_0x7b39('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x7b39('0x5'))(new Redis(config[_0x7b39('0x4')]));function MailQueue(_0x51a07e){this['id']=_0x51a07e['id']||0x0;this[_0x7b39('0x6')]=_0x51a07e[_0x7b39('0x6')]||'';this[_0x7b39('0x7')]=_0x51a07e[_0x7b39('0x7')]||0xa;this[_0x7b39('0x8')]=_0x51a07e['strategy']||_0x7b39('0x9');this[_0x7b39('0xa')]=_0x51a07e[_0x7b39('0xa')];this[_0x7b39('0xb')]={};this[_0x7b39('0xc')]=0x0;this['md5']='';this[_0x7b39('0xd')]();this[_0x7b39('0xe')]();}MailQueue[_0x7b39('0xf')]['updateRouting']=function(){var _0x2b93a1=this[_0x7b39('0xb')][_0x7b39('0x10')];this[_0x7b39('0xb')]=_[_0x7b39('0x11')](this[_0x7b39('0xa')],'id');this[_0x7b39('0xb')][_0x7b39('0x10')]=_0x2b93a1;};MailQueue[_0x7b39('0xf')][_0x7b39('0xe')]=function(){this[_0x7b39('0x12')]=0x0;this['paused']=0x0;for(var _0x26457d=0x0;_0x26457d=0x0?this[_0x7b39('0x15')]:0x0;var _0x3dea65={'id':this['id'],'available':this[_0x7b39('0x15')],'loggedIn':this[_0x7b39('0x12')],'name':this[_0x7b39('0x6')],'paused':this[_0x7b39('0x16')],'waiting':this[_0x7b39('0xc')]};var _0x4b1bd8=md5(JSON[_0x7b39('0x17')](_0x3dea65));if(this[_0x7b39('0x18')]!==_0x4b1bd8){this[_0x7b39('0x18')]=_0x4b1bd8;io['to'](util['format'](_0x7b39('0x19'),_0x3dea65['name']))[_0x7b39('0x1a')](_0x7b39('0x1b'),_0x3dea65);}};module[_0x7b39('0x1c')]=MailQueue; \ No newline at end of file +var _0x607e=['Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','paused','length','loggedIn','mailPause','available','stringify','emit','mail_queue:save','exports','lodash','md5','../../../config/environment','defaults','redis','socket.io-emitter','name','timeout','strategy','beepall'];(function(_0x3695f1,_0x2b82e4){var _0x37fe99=function(_0x32e0d9){while(--_0x32e0d9){_0x3695f1['push'](_0x3695f1['shift']());}};_0x37fe99(++_0x2b82e4);}(_0x607e,0xce));var _0xe607=function(_0x2351c4,_0x1dca54){_0x2351c4=_0x2351c4-0x0;var _0x1dd3f8=_0x607e[_0x2351c4];return _0x1dd3f8;};'use strict';var _=require(_0xe607('0x0'));var md5=require(_0xe607('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0xe607('0x2'));config['redis']=_[_0xe607('0x3')](config[_0xe607('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xe607('0x5'))(new Redis(config[_0xe607('0x4')]));function MailQueue(_0x5fbae3){this['id']=_0x5fbae3['id']||0x0;this[_0xe607('0x6')]=_0x5fbae3[_0xe607('0x6')]||'';this[_0xe607('0x7')]=_0x5fbae3[_0xe607('0x7')]||0xa;this[_0xe607('0x8')]=_0x5fbae3[_0xe607('0x8')]||_0xe607('0x9');this[_0xe607('0xa')]=_0x5fbae3[_0xe607('0xa')];this['mapAgentsId']={};this[_0xe607('0xb')]=0x0;this[_0xe607('0x1')]='';this[_0xe607('0xc')]();this[_0xe607('0xd')]();}MailQueue[_0xe607('0xe')][_0xe607('0xc')]=function(){var _0x6ce477=this[_0xe607('0xf')][_0xe607('0x10')];this[_0xe607('0xf')]=_[_0xe607('0x11')](this[_0xe607('0xa')],'id');this[_0xe607('0xf')][_0xe607('0x10')]=_0x6ce477;};MailQueue[_0xe607('0xe')][_0xe607('0xd')]=function(){this['loggedIn']=0x0;this[_0xe607('0x12')]=0x0;for(var _0x2fe4b=0x0;_0x2fe4b=0x0?this[_0xe607('0x16')]:0x0;var _0x57e3f7={'id':this['id'],'available':this[_0xe607('0x16')],'loggedIn':this[_0xe607('0x14')],'name':this[_0xe607('0x6')],'paused':this[_0xe607('0x12')],'waiting':this[_0xe607('0xb')]};var _0xed3175=md5(JSON[_0xe607('0x17')](_0x57e3f7));if(this[_0xe607('0x1')]!==_0xed3175){this[_0xe607('0x1')]=_0xed3175;io['to'](util['format']('mail:queue:%s',_0x57e3f7[_0xe607('0x6')]))[_0xe607('0x18')](_0xe607('0x19'),_0x57e3f7);}};module[_0xe607('0x1a')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index d476409..c61a2fb 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 _0xf406=['redis','defaults','localhost','name','timeout','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','map','updateRealtime','loggedIn','paused','length','openchannelPause','available','stringify','openchannel:queue:%s','emit','openchannel_queue:save','exports','md5','util','ioredis','../../../config/environment'];(function(_0x558480,_0x427c7b){var _0x22ca0c=function(_0x101a79){while(--_0x101a79){_0x558480['push'](_0x558480['shift']());}};_0x22ca0c(++_0x427c7b);}(_0xf406,0xf8));var _0x6f40=function(_0x27095e,_0x108608){_0x27095e=_0x27095e-0x0;var _0x186df1=_0xf406[_0x27095e];return _0x186df1;};'use strict';var _=require('lodash');var md5=require(_0x6f40('0x0'));var util=require(_0x6f40('0x1'));var Redis=require(_0x6f40('0x2'));var config=require(_0x6f40('0x3'));config[_0x6f40('0x4')]=_[_0x6f40('0x5')](config['redis'],{'host':_0x6f40('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6f40('0x4')]));function OpenchannelQueue(_0x2d8d45){this['id']=_0x2d8d45['id']||0x0;this[_0x6f40('0x7')]=_0x2d8d45['name']||'';this[_0x6f40('0x8')]=_0x2d8d45[_0x6f40('0x8')]||0xa;this['strategy']=_0x2d8d45['strategy']||_0x6f40('0x9');this[_0x6f40('0xa')]=_0x2d8d45[_0x6f40('0xa')];this[_0x6f40('0xb')]={};this[_0x6f40('0xc')]=0x0;this[_0x6f40('0x0')]='';this[_0x6f40('0xd')]();this['updateRealtime']();}OpenchannelQueue[_0x6f40('0xe')][_0x6f40('0xd')]=function(){var _0x5650b2=this[_0x6f40('0xb')][_0x6f40('0xf')];this[_0x6f40('0xb')]=_[_0x6f40('0x10')](this[_0x6f40('0xa')],'id');this['mapAgentsId'][_0x6f40('0xf')]=_0x5650b2;};OpenchannelQueue[_0x6f40('0xe')][_0x6f40('0x11')]=function(){this[_0x6f40('0x12')]=0x0;this[_0x6f40('0x13')]=0x0;for(var _0x2590a4=0x0;_0x2590a4=0x0?this[_0x6f40('0x16')]:0x0;var _0x21bfa2={'id':this['id'],'available':this['available'],'loggedIn':this[_0x6f40('0x12')],'name':this['name'],'paused':this[_0x6f40('0x13')],'waiting':this[_0x6f40('0xc')]};var _0x302c06=md5(JSON[_0x6f40('0x17')](_0x21bfa2));if(this['md5']!==_0x302c06){this[_0x6f40('0x0')]=_0x302c06;io['to'](util['format'](_0x6f40('0x18'),_0x21bfa2[_0x6f40('0x7')]))[_0x6f40('0x19')](_0x6f40('0x1a'),_0x21bfa2);}};module[_0x6f40('0x1b')]=OpenchannelQueue; \ No newline at end of file +var _0xded6=['beepall','Agents','mapAgentsId','waiting','updateRealtime','updateRouting','_rr','map','prototype','loggedIn','paused','length','online','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','exports','lodash','md5','util','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy'];(function(_0x433d1e,_0x1effa1){var _0x4f9414=function(_0x150e17){while(--_0x150e17){_0x433d1e['push'](_0x433d1e['shift']());}};_0x4f9414(++_0x1effa1);}(_0xded6,0x169));var _0x6ded=function(_0x5ac0ce,_0x5f41c6){_0x5ac0ce=_0x5ac0ce-0x0;var _0x3618a9=_0xded6[_0x5ac0ce];return _0x3618a9;};'use strict';var _=require(_0x6ded('0x0'));var md5=require(_0x6ded('0x1'));var util=require(_0x6ded('0x2'));var Redis=require('ioredis');var config=require(_0x6ded('0x3'));config['redis']=_[_0x6ded('0x4')](config[_0x6ded('0x5')],{'host':_0x6ded('0x6'),'port':0x18eb});var io=require(_0x6ded('0x7'))(new Redis(config[_0x6ded('0x5')]));function OpenchannelQueue(_0x2064ad){this['id']=_0x2064ad['id']||0x0;this[_0x6ded('0x8')]=_0x2064ad[_0x6ded('0x8')]||'';this['timeout']=_0x2064ad[_0x6ded('0x9')]||0xa;this['strategy']=_0x2064ad[_0x6ded('0xa')]||_0x6ded('0xb');this['Agents']=_0x2064ad[_0x6ded('0xc')];this[_0x6ded('0xd')]={};this[_0x6ded('0xe')]=0x0;this[_0x6ded('0x1')]='';this['updateRouting']();this[_0x6ded('0xf')]();}OpenchannelQueue['prototype'][_0x6ded('0x10')]=function(){var _0x1f7e8a=this[_0x6ded('0xd')][_0x6ded('0x11')];this[_0x6ded('0xd')]=_[_0x6ded('0x12')](this['Agents'],'id');this[_0x6ded('0xd')][_0x6ded('0x11')]=_0x1f7e8a;};OpenchannelQueue[_0x6ded('0x13')][_0x6ded('0xf')]=function(){this[_0x6ded('0x14')]=0x0;this[_0x6ded('0x15')]=0x0;for(var _0x24a177=0x0;_0x24a177=0x0?this[_0x6ded('0x19')]:0x0;var _0x1f5c7d={'id':this['id'],'available':this[_0x6ded('0x19')],'loggedIn':this[_0x6ded('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this['waiting']};var _0x3e7f39=md5(JSON[_0x6ded('0x1a')](_0x1f5c7d));if(this['md5']!==_0x3e7f39){this[_0x6ded('0x1')]=_0x3e7f39;io['to'](util[_0x6ded('0x1b')](_0x6ded('0x1c'),_0x1f5c7d['name']))[_0x6ded('0x1d')]('openchannel_queue:save',_0x1f5c7d);}};module[_0x6ded('0x1e')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 8ecbb6d..a1a6235 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 _0xbaf0=['online','paused','available','format','sms:queue:%s','emit','sms_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','length'];(function(_0xf0ec6e,_0xa183d3){var _0x8bbc27=function(_0x39822b){while(--_0x39822b){_0xf0ec6e['push'](_0xf0ec6e['shift']());}};_0x8bbc27(++_0xa183d3);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'use strict';var _=require('lodash');var md5=require(_0x0baf('0x0'));var util=require(_0x0baf('0x1'));var Redis=require(_0x0baf('0x2'));var config=require(_0x0baf('0x3'));config[_0x0baf('0x4')]=_[_0x0baf('0x5')](config['redis'],{'host':_0x0baf('0x6'),'port':0x18eb});var io=require(_0x0baf('0x7'))(new Redis(config[_0x0baf('0x4')]));function SmsQueue(_0x39b8f3){this['id']=_0x39b8f3['id']||0x0;this[_0x0baf('0x8')]=_0x39b8f3[_0x0baf('0x8')]||'';this[_0x0baf('0x9')]=_0x39b8f3[_0x0baf('0x9')]||0xa;this[_0x0baf('0xa')]=_0x39b8f3['strategy']||_0x0baf('0xb');this['Agents']=_0x39b8f3[_0x0baf('0xc')];this[_0x0baf('0xd')]={};this[_0x0baf('0xe')]=0x0;this[_0x0baf('0x0')]='';this[_0x0baf('0xf')]();this[_0x0baf('0x10')]();}SmsQueue[_0x0baf('0x11')][_0x0baf('0xf')]=function(){var _0x1fc6b2=this[_0x0baf('0xd')][_0x0baf('0x12')];this['mapAgentsId']=_['map'](this[_0x0baf('0xc')],'id');this[_0x0baf('0xd')][_0x0baf('0x12')]=_0x1fc6b2;};SmsQueue[_0x0baf('0x11')]['updateRealtime']=function(){this[_0x0baf('0x13')]=0x0;this['paused']=0x0;for(var _0x1c76a8=0x0;_0x1c76a8=0x0?this['available']:0x0;var _0x63c820={'id':this['id'],'available':this[_0x0baf('0x17')],'loggedIn':this[_0x0baf('0x13')],'name':this[_0x0baf('0x8')],'paused':this[_0x0baf('0x16')],'waiting':this[_0x0baf('0xe')]};var _0x4ff793=md5(JSON['stringify'](_0x63c820));if(this[_0x0baf('0x0')]!==_0x4ff793){this[_0x0baf('0x0')]=_0x4ff793;io['to'](util[_0x0baf('0x18')](_0x0baf('0x19'),_0x63c820[_0x0baf('0x8')]))[_0x0baf('0x1a')](_0x0baf('0x1b'),_0x63c820);}};module[_0x0baf('0x1c')]=SmsQueue; \ No newline at end of file +var _0x757a=['redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','length','online','loggedIn','smsPause','paused','available','format','sms:queue:%s','emit','md5','util','defaults'];(function(_0x322efb,_0x539552){var _0x4245ca=function(_0x456790){while(--_0x456790){_0x322efb['push'](_0x322efb['shift']());}};_0x4245ca(++_0x539552);}(_0x757a,0xde));var _0xa757=function(_0x54e33e,_0x1965c8){_0x54e33e=_0x54e33e-0x0;var _0x5c3da9=_0x757a[_0x54e33e];return _0x5c3da9;};'use strict';var _=require('lodash');var md5=require(_0xa757('0x0'));var util=require(_0xa757('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');config['redis']=_[_0xa757('0x2')](config[_0xa757('0x3')],{'host':_0xa757('0x4'),'port':0x18eb});var io=require(_0xa757('0x5'))(new Redis(config[_0xa757('0x3')]));function SmsQueue(_0x3caeb0){this['id']=_0x3caeb0['id']||0x0;this['name']=_0x3caeb0[_0xa757('0x6')]||'';this[_0xa757('0x7')]=_0x3caeb0['timeout']||0xa;this[_0xa757('0x8')]=_0x3caeb0[_0xa757('0x8')]||_0xa757('0x9');this[_0xa757('0xa')]=_0x3caeb0[_0xa757('0xa')];this['mapAgentsId']={};this[_0xa757('0xb')]=0x0;this[_0xa757('0x0')]='';this[_0xa757('0xc')]();this[_0xa757('0xd')]();}SmsQueue[_0xa757('0xe')][_0xa757('0xc')]=function(){var _0x17408b=this['mapAgentsId']['_rr'];this['mapAgentsId']=_['map'](this['Agents'],'id');this[_0xa757('0xf')]['_rr']=_0x17408b;};SmsQueue['prototype'][_0xa757('0xd')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x32112b=0x0;_0x32112b=0x0?this['available']:0x0;var _0x54b305={'id':this['id'],'available':this[_0xa757('0x15')],'loggedIn':this[_0xa757('0x12')],'name':this[_0xa757('0x6')],'paused':this[_0xa757('0x14')],'waiting':this[_0xa757('0xb')]};var _0xe2d567=md5(JSON['stringify'](_0x54b305));if(this[_0xa757('0x0')]!==_0xe2d567){this['md5']=_0xe2d567;io['to'](util[_0xa757('0x16')](_0xa757('0x17'),_0x54b305[_0xa757('0x6')]))[_0xa757('0x18')]('sms_queue:save',_0x54b305);}};module['exports']=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index acb53cd..b61cccc 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 _0xf22c=['intervals','chatQueues','smsQueues','mailQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','mapKeys','prototype','mergeFromDatabase','hasOwnProperty','length','isUndefined','initOpenchannelQueues','openchannelQueues','updateRouting','updateRealtime','initChatQueues','initSmsQueues','initFaxQueues','faxQueues','exports','bluebird','util','moment','../model/agent','../model/interval','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','agents'];(function(_0x2f98af,_0x5c6748){var _0x397322=function(_0x23db50){while(--_0x23db50){_0x2f98af['push'](_0x2f98af['shift']());}};_0x397322(++_0x5c6748);}(_0xf22c,0x182));var _0xcf22=function(_0x354cf6,_0x1bee65){_0x354cf6=_0x354cf6-0x0;var _0x372eb0=_0xf22c[_0x354cf6];return _0x372eb0;};'use strict';var BPromise=require(_0xcf22('0x0'));var util=require(_0xcf22('0x1'));var _=require('lodash');var moment=require(_0xcf22('0x2'));var Agent=require(_0xcf22('0x3'));var Interval=require(_0xcf22('0x4'));var OpenchannelQueue=require(_0xcf22('0x5'));var ChatQueue=require(_0xcf22('0x6'));var SmsQueue=require(_0xcf22('0x7'));var MailQueue=require(_0xcf22('0x8'));var FaxQueue=require('../model/faxQueue');var Realtime=function(){this[_0xcf22('0x9')]={};this[_0xcf22('0xa')]={};this['openchannelQueues']={};this[_0xcf22('0xb')]={};this[_0xcf22('0xc')]={};this[_0xcf22('0xd')]={};this['faxQueues']={};this['chatQueuesWaitingInteractions']={};this[_0xcf22('0xe')]={};this[_0xcf22('0xf')]={};this[_0xcf22('0x10')]={};this[_0xcf22('0x11')]={};};function freeIsNotKey(_0x1ca1d3,_0xb31125,_0x5e4ea3){var _0x2ef365=_[_0xcf22('0x12')](_0x1ca1d3,function(_0x4336eb,_0x3c554a){return _0x4336eb[_0x5e4ea3];});for(var _0x502552 in _0xb31125){if(_0xb31125['hasOwnProperty'](_0x502552)){if(!_0x2ef365[_0x502552]){delete _0xb31125[_0x502552];}}}}Realtime[_0xcf22('0x13')][_0xcf22('0x14')]=function(_0x13e744,_0x4d2ece){for(var _0x3bcbd7 in _0x4d2ece){if(_0x13e744[_0xcf22('0x15')](_0x3bcbd7)){_0x13e744[_0x3bcbd7]=_0x4d2ece[_0x3bcbd7];}}};Realtime['prototype']['initAgents']=function(){var _0x4fdb13=this;return function(_0x4108ef){if(_0x4108ef){freeIsNotKey(_0x4108ef,_0x4fdb13[_0xcf22('0x9')],'id');for(var _0xb56a4a=0x0,_0x524cc1={},_0x540dc5={};_0xb56a4a<_0x4108ef[_0xcf22('0x16')];_0xb56a4a+=0x1){_0x524cc1=_0x4108ef[_0xb56a4a];if(_[_0xcf22('0x17')](_0x4fdb13[_0xcf22('0x9')][_0x524cc1['id']])){_0x4fdb13[_0xcf22('0x9')][_0x524cc1['id']]=new Agent(_0x524cc1);}else{_0x4fdb13[_0xcf22('0x14')](_0x4fdb13[_0xcf22('0x9')][_0x524cc1['id']],_0x524cc1);}}}return _0x4fdb13['agents'];};};Realtime[_0xcf22('0x13')]['initIntervals']=function(){var _0x1c8f11=this;return function(_0x37947b){if(_0x37947b){freeIsNotKey(_0x37947b,_0x1c8f11[_0xcf22('0xa')],'id');for(var _0xaf55d0=0x0,_0x35633b={},_0x5008ae={};_0xaf55d0<_0x37947b['length'];_0xaf55d0+=0x1){_0x35633b=_0x37947b[_0xaf55d0];if(_[_0xcf22('0x17')](_0x1c8f11[_0xcf22('0xa')][_0x35633b['id']])){_0x1c8f11[_0xcf22('0xa')][_0x35633b['id']]=new Interval(_0x35633b);}else{_0x1c8f11[_0xcf22('0x14')](_0x1c8f11[_0xcf22('0xa')][_0x35633b['id']],_0x35633b);}}}return _0x1c8f11[_0xcf22('0xa')];};};Realtime[_0xcf22('0x13')][_0xcf22('0x18')]=function(){var _0x5963a2=this;return function(_0x45bcfa){if(_0x45bcfa){freeIsNotKey(_0x45bcfa,_0x5963a2[_0xcf22('0x19')],'id');for(var _0x193700=0x0,_0x2463fa={},_0x4bc1bd={};_0x193700<_0x45bcfa[_0xcf22('0x16')];_0x193700+=0x1){_0x2463fa=_0x45bcfa[_0x193700];if(_['isUndefined'](_0x5963a2[_0xcf22('0x19')][_0x2463fa['id']])){_0x5963a2[_0xcf22('0x19')][_0x2463fa['id']]=new OpenchannelQueue(_0x2463fa);}else{_0x5963a2['mergeFromDatabase'](_0x5963a2[_0xcf22('0x19')][_0x2463fa['id']],_0x2463fa);}_0x5963a2[_0xcf22('0x19')][_0x2463fa['id']][_0xcf22('0x1a')]();_0x5963a2[_0xcf22('0x19')][_0x2463fa['id']][_0xcf22('0x1b')]();}}return _0x5963a2[_0xcf22('0x19')];};};Realtime['prototype'][_0xcf22('0x1c')]=function(){var _0x4ce3c1=this;return function(_0x4f0579){if(_0x4f0579){freeIsNotKey(_0x4f0579,_0x4ce3c1[_0xcf22('0xb')],'id');for(var _0x499f9f=0x0,_0x311cb7={},_0x167020={};_0x499f9f<_0x4f0579[_0xcf22('0x16')];_0x499f9f+=0x1){_0x311cb7=_0x4f0579[_0x499f9f];if(_[_0xcf22('0x17')](_0x4ce3c1[_0xcf22('0xb')][_0x311cb7['id']])){_0x4ce3c1[_0xcf22('0xb')][_0x311cb7['id']]=new ChatQueue(_0x311cb7);}else{_0x4ce3c1[_0xcf22('0x14')](_0x4ce3c1['chatQueues'][_0x311cb7['id']],_0x311cb7);}_0x4ce3c1[_0xcf22('0xb')][_0x311cb7['id']][_0xcf22('0x1a')]();_0x4ce3c1[_0xcf22('0xb')][_0x311cb7['id']][_0xcf22('0x1b')]();}}return _0x4ce3c1[_0xcf22('0xb')];};};Realtime['prototype'][_0xcf22('0x1d')]=function(){var _0x42fc71=this;return function(_0x222fca){if(_0x222fca){freeIsNotKey(_0x222fca,_0x42fc71[_0xcf22('0xc')],'id');for(var _0x287091=0x0,_0x34cb42={},_0xd706a2={};_0x287091<_0x222fca[_0xcf22('0x16')];_0x287091+=0x1){_0x34cb42=_0x222fca[_0x287091];if(_[_0xcf22('0x17')](_0x42fc71[_0xcf22('0xc')][_0x34cb42['id']])){_0x42fc71[_0xcf22('0xc')][_0x34cb42['id']]=new SmsQueue(_0x34cb42);}else{_0x42fc71[_0xcf22('0x14')](_0x42fc71[_0xcf22('0xc')][_0x34cb42['id']],_0x34cb42);}_0x42fc71[_0xcf22('0xc')][_0x34cb42['id']][_0xcf22('0x1a')]();_0x42fc71[_0xcf22('0xc')][_0x34cb42['id']][_0xcf22('0x1b')]();}}return _0x42fc71[_0xcf22('0xc')];};};Realtime[_0xcf22('0x13')]['initMailQueues']=function(){var _0x94c572=this;return function(_0x263df0){if(_0x263df0){freeIsNotKey(_0x263df0,_0x94c572[_0xcf22('0xd')],'id');for(var _0x4db4bf=0x0,_0x50e2ea={},_0x398393={};_0x4db4bf<_0x263df0[_0xcf22('0x16')];_0x4db4bf+=0x1){_0x50e2ea=_0x263df0[_0x4db4bf];if(_[_0xcf22('0x17')](_0x94c572[_0xcf22('0xd')][_0x50e2ea['id']])){_0x94c572[_0xcf22('0xd')][_0x50e2ea['id']]=new MailQueue(_0x50e2ea);}else{_0x94c572[_0xcf22('0x14')](_0x94c572['mailQueues'][_0x50e2ea['id']],_0x50e2ea);}_0x94c572[_0xcf22('0xd')][_0x50e2ea['id']]['updateRouting']();_0x94c572[_0xcf22('0xd')][_0x50e2ea['id']][_0xcf22('0x1b')]();}}return _0x94c572[_0xcf22('0xd')];};};Realtime[_0xcf22('0x13')][_0xcf22('0x1e')]=function(){var _0xf6c84a=this;return function(_0x59fe38){if(_0x59fe38){freeIsNotKey(_0x59fe38,_0xf6c84a[_0xcf22('0x1f')],'id');for(var _0x5a040d=0x0,_0x38a3b6={},_0x17edf6={};_0x5a040d<_0x59fe38[_0xcf22('0x16')];_0x5a040d+=0x1){_0x38a3b6=_0x59fe38[_0x5a040d];if(_['isUndefined'](_0xf6c84a[_0xcf22('0x1f')][_0x38a3b6['id']])){_0xf6c84a['faxQueues'][_0x38a3b6['id']]=new FaxQueue(_0x38a3b6);}else{_0xf6c84a[_0xcf22('0x14')](_0xf6c84a[_0xcf22('0x1f')][_0x38a3b6['id']],_0x38a3b6);}_0xf6c84a[_0xcf22('0x1f')][_0x38a3b6['id']][_0xcf22('0x1a')]();_0xf6c84a[_0xcf22('0x1f')][_0x38a3b6['id']][_0xcf22('0x1b')]();}}return _0xf6c84a['faxQueues'];};};module[_0xcf22('0x20')]=Realtime; \ No newline at end of file +var _0xebb4=['initIntervals','isUndefined','initOpenchannelQueues','openchannelQueues','updateRouting','updateRealtime','initChatQueues','chatQueues','initSmsQueues','smsQueues','initMailQueues','initFaxQueues','exports','bluebird','moment','../model/agent','../model/interval','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','agents','intervals','mailQueues','faxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','mapKeys','prototype','initAgents','length','mergeFromDatabase'];(function(_0x5858ec,_0x28a517){var _0xf91feb=function(_0x4600a6){while(--_0x4600a6){_0x5858ec['push'](_0x5858ec['shift']());}};_0xf91feb(++_0x28a517);}(_0xebb4,0xdf));var _0x4ebb=function(_0xa22948,_0xeb534d){_0xa22948=_0xa22948-0x0;var _0x4dfed5=_0xebb4[_0xa22948];return _0x4dfed5;};'use strict';var BPromise=require(_0x4ebb('0x0'));var util=require('util');var _=require('lodash');var moment=require(_0x4ebb('0x1'));var Agent=require(_0x4ebb('0x2'));var Interval=require(_0x4ebb('0x3'));var OpenchannelQueue=require(_0x4ebb('0x4'));var ChatQueue=require(_0x4ebb('0x5'));var SmsQueue=require(_0x4ebb('0x6'));var MailQueue=require(_0x4ebb('0x7'));var FaxQueue=require(_0x4ebb('0x8'));var Realtime=function(){this[_0x4ebb('0x9')]={};this[_0x4ebb('0xa')]={};this['openchannelQueues']={};this['chatQueues']={};this['smsQueues']={};this[_0x4ebb('0xb')]={};this[_0x4ebb('0xc')]={};this[_0x4ebb('0xd')]={};this[_0x4ebb('0xe')]={};this[_0x4ebb('0xf')]={};this['smsQueuesWaitingInteractions']={};this[_0x4ebb('0x10')]={};};function freeIsNotKey(_0x52c7b3,_0x5107aa,_0x1b377c){var _0xf568d0=_[_0x4ebb('0x11')](_0x52c7b3,function(_0x2001d9,_0x1f7f1e){return _0x2001d9[_0x1b377c];});for(var _0x5db840 in _0x5107aa){if(_0x5107aa['hasOwnProperty'](_0x5db840)){if(!_0xf568d0[_0x5db840]){delete _0x5107aa[_0x5db840];}}}}Realtime[_0x4ebb('0x12')]['mergeFromDatabase']=function(_0x5c4567,_0x2a539f){for(var _0x45890c in _0x2a539f){if(_0x5c4567['hasOwnProperty'](_0x45890c)){_0x5c4567[_0x45890c]=_0x2a539f[_0x45890c];}}};Realtime['prototype'][_0x4ebb('0x13')]=function(){var _0x4ff742=this;return function(_0x2c3df8){if(_0x2c3df8){freeIsNotKey(_0x2c3df8,_0x4ff742[_0x4ebb('0x9')],'id');for(var _0x5442cf=0x0,_0x5670aa={},_0x146ba1={};_0x5442cf<_0x2c3df8[_0x4ebb('0x14')];_0x5442cf+=0x1){_0x5670aa=_0x2c3df8[_0x5442cf];if(_['isUndefined'](_0x4ff742[_0x4ebb('0x9')][_0x5670aa['id']])){_0x4ff742[_0x4ebb('0x9')][_0x5670aa['id']]=new Agent(_0x5670aa);}else{_0x4ff742[_0x4ebb('0x15')](_0x4ff742['agents'][_0x5670aa['id']],_0x5670aa);}}}return _0x4ff742['agents'];};};Realtime['prototype'][_0x4ebb('0x16')]=function(){var _0x8f1dcb=this;return function(_0x2b0e81){if(_0x2b0e81){freeIsNotKey(_0x2b0e81,_0x8f1dcb[_0x4ebb('0xa')],'id');for(var _0xb2b9e5=0x0,_0x2ccac4={},_0x3f0962={};_0xb2b9e5<_0x2b0e81[_0x4ebb('0x14')];_0xb2b9e5+=0x1){_0x2ccac4=_0x2b0e81[_0xb2b9e5];if(_[_0x4ebb('0x17')](_0x8f1dcb['intervals'][_0x2ccac4['id']])){_0x8f1dcb[_0x4ebb('0xa')][_0x2ccac4['id']]=new Interval(_0x2ccac4);}else{_0x8f1dcb[_0x4ebb('0x15')](_0x8f1dcb[_0x4ebb('0xa')][_0x2ccac4['id']],_0x2ccac4);}}}return _0x8f1dcb[_0x4ebb('0xa')];};};Realtime[_0x4ebb('0x12')][_0x4ebb('0x18')]=function(){var _0x352907=this;return function(_0xfd62c){if(_0xfd62c){freeIsNotKey(_0xfd62c,_0x352907[_0x4ebb('0x19')],'id');for(var _0x16e0df=0x0,_0x17242a={},_0x500551={};_0x16e0df<_0xfd62c[_0x4ebb('0x14')];_0x16e0df+=0x1){_0x17242a=_0xfd62c[_0x16e0df];if(_[_0x4ebb('0x17')](_0x352907['openchannelQueues'][_0x17242a['id']])){_0x352907[_0x4ebb('0x19')][_0x17242a['id']]=new OpenchannelQueue(_0x17242a);}else{_0x352907[_0x4ebb('0x15')](_0x352907['openchannelQueues'][_0x17242a['id']],_0x17242a);}_0x352907[_0x4ebb('0x19')][_0x17242a['id']][_0x4ebb('0x1a')]();_0x352907[_0x4ebb('0x19')][_0x17242a['id']][_0x4ebb('0x1b')]();}}return _0x352907[_0x4ebb('0x19')];};};Realtime[_0x4ebb('0x12')][_0x4ebb('0x1c')]=function(){var _0x192634=this;return function(_0x4b8ccf){if(_0x4b8ccf){freeIsNotKey(_0x4b8ccf,_0x192634[_0x4ebb('0x1d')],'id');for(var _0x2fca92=0x0,_0x4c710f={},_0x5f3573={};_0x2fca92<_0x4b8ccf[_0x4ebb('0x14')];_0x2fca92+=0x1){_0x4c710f=_0x4b8ccf[_0x2fca92];if(_['isUndefined'](_0x192634[_0x4ebb('0x1d')][_0x4c710f['id']])){_0x192634[_0x4ebb('0x1d')][_0x4c710f['id']]=new ChatQueue(_0x4c710f);}else{_0x192634[_0x4ebb('0x15')](_0x192634['chatQueues'][_0x4c710f['id']],_0x4c710f);}_0x192634[_0x4ebb('0x1d')][_0x4c710f['id']]['updateRouting']();_0x192634[_0x4ebb('0x1d')][_0x4c710f['id']][_0x4ebb('0x1b')]();}}return _0x192634[_0x4ebb('0x1d')];};};Realtime[_0x4ebb('0x12')][_0x4ebb('0x1e')]=function(){var _0x50aee7=this;return function(_0x2587e7){if(_0x2587e7){freeIsNotKey(_0x2587e7,_0x50aee7[_0x4ebb('0x1f')],'id');for(var _0x470aee=0x0,_0xa2e4a4={},_0x5e99d8={};_0x470aee<_0x2587e7[_0x4ebb('0x14')];_0x470aee+=0x1){_0xa2e4a4=_0x2587e7[_0x470aee];if(_[_0x4ebb('0x17')](_0x50aee7['smsQueues'][_0xa2e4a4['id']])){_0x50aee7[_0x4ebb('0x1f')][_0xa2e4a4['id']]=new SmsQueue(_0xa2e4a4);}else{_0x50aee7[_0x4ebb('0x15')](_0x50aee7[_0x4ebb('0x1f')][_0xa2e4a4['id']],_0xa2e4a4);}_0x50aee7[_0x4ebb('0x1f')][_0xa2e4a4['id']][_0x4ebb('0x1a')]();_0x50aee7[_0x4ebb('0x1f')][_0xa2e4a4['id']]['updateRealtime']();}}return _0x50aee7[_0x4ebb('0x1f')];};};Realtime[_0x4ebb('0x12')][_0x4ebb('0x20')]=function(){var _0x2e054f=this;return function(_0x2aa22c){if(_0x2aa22c){freeIsNotKey(_0x2aa22c,_0x2e054f[_0x4ebb('0xb')],'id');for(var _0x1dc50b=0x0,_0x3e4812={},_0x1b5f7c={};_0x1dc50b<_0x2aa22c[_0x4ebb('0x14')];_0x1dc50b+=0x1){_0x3e4812=_0x2aa22c[_0x1dc50b];if(_[_0x4ebb('0x17')](_0x2e054f[_0x4ebb('0xb')][_0x3e4812['id']])){_0x2e054f[_0x4ebb('0xb')][_0x3e4812['id']]=new MailQueue(_0x3e4812);}else{_0x2e054f[_0x4ebb('0x15')](_0x2e054f[_0x4ebb('0xb')][_0x3e4812['id']],_0x3e4812);}_0x2e054f[_0x4ebb('0xb')][_0x3e4812['id']][_0x4ebb('0x1a')]();_0x2e054f[_0x4ebb('0xb')][_0x3e4812['id']]['updateRealtime']();}}return _0x2e054f[_0x4ebb('0xb')];};};Realtime[_0x4ebb('0x12')][_0x4ebb('0x21')]=function(){var _0x1d5ac6=this;return function(_0x295371){if(_0x295371){freeIsNotKey(_0x295371,_0x1d5ac6[_0x4ebb('0xc')],'id');for(var _0x14747c=0x0,_0x600d91={},_0x5a7687={};_0x14747c<_0x295371[_0x4ebb('0x14')];_0x14747c+=0x1){_0x600d91=_0x295371[_0x14747c];if(_[_0x4ebb('0x17')](_0x1d5ac6[_0x4ebb('0xc')][_0x600d91['id']])){_0x1d5ac6['faxQueues'][_0x600d91['id']]=new FaxQueue(_0x600d91);}else{_0x1d5ac6['mergeFromDatabase'](_0x1d5ac6[_0x4ebb('0xc')][_0x600d91['id']],_0x600d91);}_0x1d5ac6['faxQueues'][_0x600d91['id']]['updateRouting']();_0x1d5ac6[_0x4ebb('0xc')][_0x600d91['id']][_0x4ebb('0x1b')]();}}return _0x1d5ac6['faxQueues'];};};module[_0x4ebb('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 6275554..3d12bd2 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 _0x08d9=['addTagsToChatInteraction','../client','Request','UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction'];(function(_0x2181b1,_0x569637){var _0x530548=function(_0x4b31f1){while(--_0x4b31f1){_0x2181b1['push'](_0x2181b1['shift']());}};_0x530548(++_0x569637);}(_0x08d9,0xb0));var _0x908d=function(_0x3dca5f,_0x155dbe){_0x3dca5f=_0x3dca5f-0x0;var _0x5e8bfb=_0x08d9[_0x3dca5f];return _0x5e8bfb;};'use strict';var client=require(_0x908d('0x0'));exports['update']=function(_0x58a473,_0x12abe6){return client[_0x908d('0x1')](_0x908d('0x2'),{'body':_0x12abe6,'options':{'where':{'id':_0x58a473}},'log':_0x908d('0x3')});};exports[_0x908d('0x4')]=function(_0x5a5a66,_0x4200f0){return client[_0x908d('0x1')](_0x908d('0x5'),{'body':_0x4200f0,'options':{'where':{'id':_0x5a5a66}},'log':_0x908d('0x6')});}; \ No newline at end of file +var _0x11a0=['../client','update','UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction'];(function(_0x3b82c8,_0x3fecb6){var _0x1cb580=function(_0x2a333d){while(--_0x2a333d){_0x3b82c8['push'](_0x3b82c8['shift']());}};_0x1cb580(++_0x3fecb6);}(_0x11a0,0x85));var _0x011a=function(_0x23fd21,_0x591cb4){_0x23fd21=_0x23fd21-0x0;var _0x14be9b=_0x11a0[_0x23fd21];return _0x14be9b;};'use strict';var client=require(_0x011a('0x0'));exports[_0x011a('0x1')]=function(_0x44f20b,_0x2b5293){return client['Request'](_0x011a('0x2'),{'body':_0x2b5293,'options':{'where':{'id':_0x44f20b}},'log':_0x011a('0x3')});};exports[_0x011a('0x4')]=function(_0x107e5e,_0x2f2c56){return client['Request'](_0x011a('0x5'),{'body':_0x2f2c56,'options':{'where':{'id':_0x107e5e}},'log':_0x011a('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 0f6e701..1abb030 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 _0xc805=['CreateChatMessage','createChatMessage','../client','create','Request'];(function(_0x3251b8,_0x138dc0){var _0x3f116f=function(_0x5c24da){while(--_0x5c24da){_0x3251b8['push'](_0x3251b8['shift']());}};_0x3f116f(++_0x138dc0);}(_0xc805,0x160));var _0x5c80=function(_0x3871d7,_0x3cfcc5){_0x3871d7=_0x3871d7-0x0;var _0x28ec09=_0xc805[_0x3871d7];return _0x28ec09;};'use strict';var client=require(_0x5c80('0x0'));exports[_0x5c80('0x1')]=function(_0x5158b){return client[_0x5c80('0x2')](_0x5c80('0x3'),{'body':_0x5158b,'log':_0x5c80('0x4')});}; \ No newline at end of file +var _0xcfa2=['create','Request','CreateChatMessage','createChatMessage'];(function(_0x5b7327,_0x3da7cc){var _0x1518a1=function(_0x32345a){while(--_0x32345a){_0x5b7327['push'](_0x5b7327['shift']());}};_0x1518a1(++_0x3da7cc);}(_0xcfa2,0x1f0));var _0x2cfa=function(_0x1bb0c4,_0x415d77){_0x1bb0c4=_0x1bb0c4-0x0;var _0x4e9e2b=_0xcfa2[_0x1bb0c4];return _0x4e9e2b;};'use strict';var client=require('../client');exports[_0x2cfa('0x0')]=function(_0x207a7b){return client[_0x2cfa('0x1')](_0x2cfa('0x2'),{'body':_0x207a7b,'log':_0x2cfa('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index b9a4834..0bc61b6 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 _0x9fa0=['online','../client','getChatQueues','GetChatQueue','strategy','User','Agents','name'];(function(_0x23254d,_0x35e0a5){var _0x9a9abe=function(_0x2d5348){while(--_0x2d5348){_0x23254d['push'](_0x23254d['shift']());}};_0x9a9abe(++_0x35e0a5);}(_0x9fa0,0x199));var _0x09fa=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0x9fa0[_0x34bf97];return _0x292719;};'use strict';var client=require(_0x09fa('0x0'));exports[_0x09fa('0x1')]=function(){return function(){return client['Request'](_0x09fa('0x2'),{'options':{'raw':![],'attributes':['id','name','timeout',_0x09fa('0x3')],'include':[{'model':_0x09fa('0x4'),'as':_0x09fa('0x5'),'attributes':['id',_0x09fa('0x6'),_0x09fa('0x7'),'chatPause']}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0x31c6=['GetChatQueue','timeout','strategy','User','Agents','name','online','chatPause','../client','getChatQueues'];(function(_0x24cd3a,_0x2a27f0){var _0xdc8a9=function(_0x3da6c8){while(--_0x3da6c8){_0x24cd3a['push'](_0x24cd3a['shift']());}};_0xdc8a9(++_0x2a27f0);}(_0x31c6,0x1b6));var _0x631c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x31c6[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x631c('0x0'));exports[_0x631c('0x1')]=function(){return function(){return client['Request'](_0x631c('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x631c('0x3'),_0x631c('0x4')],'include':[{'model':_0x631c('0x5'),'as':_0x631c('0x6'),'attributes':['id',_0x631c('0x7'),_0x631c('0x8'),_0x631c('0x9')]}]},'log':_0x631c('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 732e40e..4811414 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 _0x8db0=['DESC','../client','create','Request','CreateChatQueueReport'];(function(_0x319e2e,_0x2f727f){var _0x302524=function(_0x5cad9d){while(--_0x5cad9d){_0x319e2e['push'](_0x319e2e['shift']());}};_0x302524(++_0x2f727f);}(_0x8db0,0x65));var _0x08db=function(_0x4cee4b,_0x1dfff3){_0x4cee4b=_0x4cee4b-0x0;var _0x4d891d=_0x8db0[_0x4cee4b];return _0x4d891d;};'use strict';var client=require(_0x08db('0x0'));exports[_0x08db('0x1')]=function(_0x50fae4){return client[_0x08db('0x2')](_0x08db('0x3'),{'body':_0x50fae4,'log':_0x08db('0x3')});};exports['update']=function(_0x3b5170,_0x55e572){return client['Request']('UpdateChatQueueReport',{'body':_0x55e572,'options':{'where':{'uniqueid':_0x3b5170},'order':[['id',_0x08db('0x4')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file +var _0xf874=['UpdateChatQueueReport','DESC','Request','CreateChatQueueReport','update'];(function(_0x1daa6e,_0x3497fb){var _0x29ba9f=function(_0x3a7803){while(--_0x3a7803){_0x1daa6e['push'](_0x1daa6e['shift']());}};_0x29ba9f(++_0x3497fb);}(_0xf874,0xed));var _0x4f87=function(_0x4701a0,_0x35c607){_0x4701a0=_0x4701a0-0x0;var _0x35681b=_0xf874[_0x4701a0];return _0x35681b;};'use strict';var client=require('../client');exports['create']=function(_0x136b1a){return client[_0x4f87('0x0')](_0x4f87('0x1'),{'body':_0x136b1a,'log':_0x4f87('0x1')});};exports[_0x4f87('0x2')]=function(_0x2f2b69,_0x5b10c6){return client[_0x4f87('0x0')](_0x4f87('0x3'),{'body':_0x5b10c6,'options':{'where':{'uniqueid':_0x2f2b69},'order':[['id',_0x4f87('0x4')]],'limit':0x1},'log':_0x4f87('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 99b9762..487e405 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 _0x097c=['AddTagsToFaxInteraction','update','UpdateFaxInteraction','updateFaxInteraction','addTags','Request'];(function(_0x3c7e74,_0x431a67){var _0x5e7924=function(_0x39e11f){while(--_0x39e11f){_0x3c7e74['push'](_0x3c7e74['shift']());}};_0x5e7924(++_0x431a67);}(_0x097c,0x109));var _0xc097=function(_0x542123,_0x13cc53){_0x542123=_0x542123-0x0;var _0x3513ed=_0x097c[_0x542123];return _0x3513ed;};'use strict';var client=require('../client');exports[_0xc097('0x0')]=function(_0x2e7c2a,_0x4386ee){return client['Request'](_0xc097('0x1'),{'body':_0x4386ee,'options':{'where':{'id':_0x2e7c2a}},'log':_0xc097('0x2')});};exports[_0xc097('0x3')]=function(_0x36c965,_0x95eb7b){return client[_0xc097('0x4')](_0xc097('0x5'),{'body':_0x95eb7b,'options':{'where':{'id':_0x36c965}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x2172=['updateFaxInteraction','addTags','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','Request','UpdateFaxInteraction'];(function(_0x9d486e,_0xa8f2ab){var _0x23cedc=function(_0x289734){while(--_0x289734){_0x9d486e['push'](_0x9d486e['shift']());}};_0x23cedc(++_0xa8f2ab);}(_0x2172,0x1c4));var _0x2217=function(_0x3962e1,_0x1d433b){_0x3962e1=_0x3962e1-0x0;var _0xd439c4=_0x2172[_0x3962e1];return _0xd439c4;};'use strict';var client=require(_0x2217('0x0'));exports[_0x2217('0x1')]=function(_0x46b190,_0x5e8701){return client[_0x2217('0x2')](_0x2217('0x3'),{'body':_0x5e8701,'options':{'where':{'id':_0x46b190}},'log':_0x2217('0x4')});};exports[_0x2217('0x5')]=function(_0x535e0d,_0x1328aa){return client[_0x2217('0x2')](_0x2217('0x6'),{'body':_0x1328aa,'options':{'where':{'id':_0x535e0d}},'log':_0x2217('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index aeeb01a..58c42bd 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 _0xd9d0=['../client','create','Request','createFaxMessage'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0xd9d0,0x148));var _0x0d9d=function(_0x232715,_0x4bd63e){_0x232715=_0x232715-0x0;var _0x1e6090=_0xd9d0[_0x232715];return _0x1e6090;};'use strict';var client=require(_0x0d9d('0x0'));exports[_0x0d9d('0x1')]=function(_0x2f967d){return client[_0x0d9d('0x2')]('CreateFaxMessage',{'body':_0x2f967d,'log':_0x0d9d('0x3')});}; \ No newline at end of file +var _0xdf64=['Request','CreateFaxMessage','createFaxMessage','../client','create'];(function(_0xc8db6b,_0x320abd){var _0x12cb81=function(_0x417540){while(--_0x417540){_0xc8db6b['push'](_0xc8db6b['shift']());}};_0x12cb81(++_0x320abd);}(_0xdf64,0x17f));var _0x4df6=function(_0x7bde64,_0x4f3fc5){_0x7bde64=_0x7bde64-0x0;var _0x14bb79=_0xdf64[_0x7bde64];return _0x14bb79;};'use strict';var client=require(_0x4df6('0x0'));exports[_0x4df6('0x1')]=function(_0x3e40fe){return client[_0x4df6('0x2')](_0x4df6('0x3'),{'body':_0x3e40fe,'log':_0x4df6('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 9bcecab..1aebf6e 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 _0x0d88=['strategy','User','Agents','online','faxPause','getFaxQueues','../client','Request','GetFaxQueue','name','timeout'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0d88,0x15b));var _0x80d8=function(_0x577ccf,_0x41a13a){_0x577ccf=_0x577ccf-0x0;var _0x4b7000=_0x0d88[_0x577ccf];return _0x4b7000;};'use strict';var client=require(_0x80d8('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0x80d8('0x1')](_0x80d8('0x2'),{'options':{'raw':![],'attributes':['id',_0x80d8('0x3'),_0x80d8('0x4'),_0x80d8('0x5')],'include':[{'model':_0x80d8('0x6'),'as':_0x80d8('0x7'),'attributes':['id',_0x80d8('0x3'),_0x80d8('0x8'),_0x80d8('0x9')]}]},'log':_0x80d8('0xa')});};}; \ No newline at end of file +var _0x16d0=['getFaxQueues','Request','GetFaxQueue','name','timeout','User','Agents','online','faxPause','../client'];(function(_0xb26ef,_0x27db02){var _0x5856b7=function(_0x63e7dd){while(--_0x63e7dd){_0xb26ef['push'](_0xb26ef['shift']());}};_0x5856b7(++_0x27db02);}(_0x16d0,0xef));var _0x016d=function(_0x3e0a41,_0x20df52){_0x3e0a41=_0x3e0a41-0x0;var _0x107066=_0x16d0[_0x3e0a41];return _0x107066;};'use strict';var client=require(_0x016d('0x0'));exports[_0x016d('0x1')]=function(){return function(){return client[_0x016d('0x2')](_0x016d('0x3'),{'options':{'raw':![],'attributes':['id',_0x016d('0x4'),_0x016d('0x5'),'strategy'],'include':[{'model':_0x016d('0x6'),'as':_0x016d('0x7'),'attributes':['id',_0x016d('0x4'),_0x016d('0x8'),_0x016d('0x9')]}]},'log':_0x016d('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 0582c13..a7fb60a 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 _0x35f9=['create','Request','CreateFaxQueueReport','UpdateFaxQueueReport','../client'];(function(_0xbf8ebe,_0x3b69a5){var _0x1e25e8=function(_0x40c390){while(--_0x40c390){_0xbf8ebe['push'](_0xbf8ebe['shift']());}};_0x1e25e8(++_0x3b69a5);}(_0x35f9,0x1df));var _0x935f=function(_0xf773c2,_0x25adff){_0xf773c2=_0xf773c2-0x0;var _0x92a0a=_0x35f9[_0xf773c2];return _0x92a0a;};'use strict';var client=require(_0x935f('0x0'));exports[_0x935f('0x1')]=function(_0x266179){return client[_0x935f('0x2')]('CreateFaxQueueReport',{'body':_0x266179,'log':_0x935f('0x3')});};exports['update']=function(_0x53888b,_0x3644e9){return client[_0x935f('0x2')]('UpdateFaxQueueReport',{'body':_0x3644e9,'options':{'where':{'uniqueid':_0x53888b},'order':[['id','DESC']],'limit':0x1},'log':_0x935f('0x4')});}; \ No newline at end of file +var _0x0e17=['CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','../client','create','Request'];(function(_0x263a2f,_0x1e81e3){var _0x8020e8=function(_0x39f91a){while(--_0x39f91a){_0x263a2f['push'](_0x263a2f['shift']());}};_0x8020e8(++_0x1e81e3);}(_0x0e17,0xd6));var _0x70e1=function(_0x2390c4,_0x22ebc0){_0x2390c4=_0x2390c4-0x0;var _0x22fc73=_0x0e17[_0x2390c4];return _0x22fc73;};'use strict';var client=require(_0x70e1('0x0'));exports[_0x70e1('0x1')]=function(_0x26a07b){return client[_0x70e1('0x2')](_0x70e1('0x3'),{'body':_0x26a07b,'log':_0x70e1('0x3')});};exports[_0x70e1('0x4')]=function(_0xf151a0,_0x406801){return client[_0x70e1('0x2')](_0x70e1('0x5'),{'body':_0x406801,'options':{'where':{'uniqueid':_0xf151a0},'order':[['id',_0x70e1('0x6')]],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 85e6bc1..26f1ef5 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 _0x4849=['Intervals','name','interval','../client','getIntervals','Request','Interval'];(function(_0x1f097d,_0x511f64){var _0x5e2cf9=function(_0x27200a){while(--_0x27200a){_0x1f097d['push'](_0x1f097d['shift']());}};_0x5e2cf9(++_0x511f64);}(_0x4849,0xf8));var _0x9484=function(_0x3d81aa,_0x39bc1a){_0x3d81aa=_0x3d81aa-0x0;var _0xd95667=_0x4849[_0x3d81aa];return _0xd95667;};'use strict';var client=require(_0x9484('0x0'));exports[_0x9484('0x1')]=function(){return function(){return client[_0x9484('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x9484('0x3'),'as':_0x9484('0x4'),'attributes':['id',_0x9484('0x5'),_0x9484('0x6')]}]},'log':_0x9484('0x1')});};}; \ No newline at end of file +var _0x9c00=['interval','../client','getIntervals','name','Interval'];(function(_0xbeb808,_0x881ddf){var _0x5d6909=function(_0x37d652){while(--_0x37d652){_0xbeb808['push'](_0xbeb808['shift']());}};_0x5d6909(++_0x881ddf);}(_0x9c00,0x1a0));var _0x09c0=function(_0x4382bc,_0x231a2d){_0x4382bc=_0x4382bc-0x0;var _0x13c82a=_0x9c00[_0x4382bc];return _0x13c82a;};'use strict';var client=require(_0x09c0('0x0'));exports[_0x09c0('0x1')]=function(){return function(){return client['Request']('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x09c0('0x2')],'include':[{'model':_0x09c0('0x3'),'as':'Intervals','attributes':['id',_0x09c0('0x2'),_0x09c0('0x4')]}]},'log':_0x09c0('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index add22f6..98e8d9d 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 _0xd5f1=['addTagsToChatInteraction','../client','UpdateMailInteraction','updateMailInteraction','addTags','Request'];(function(_0x5ee78d,_0x3d7de7){var _0x2c291a=function(_0x2b72dc){while(--_0x2b72dc){_0x5ee78d['push'](_0x5ee78d['shift']());}};_0x2c291a(++_0x3d7de7);}(_0xd5f1,0x8b));var _0x1d5f=function(_0x51160c,_0x374b59){_0x51160c=_0x51160c-0x0;var _0x15a3fb=_0xd5f1[_0x51160c];return _0x15a3fb;};'use strict';var client=require(_0x1d5f('0x0'));exports['update']=function(_0x4013f8,_0x124a43){return client['Request'](_0x1d5f('0x1'),{'body':_0x124a43,'options':{'where':{'id':_0x4013f8}},'log':_0x1d5f('0x2')});};exports[_0x1d5f('0x3')]=function(_0x1c2aa9,_0x3f23ef){return client[_0x1d5f('0x4')]('AddTagsToMailInteraction',{'body':_0x3f23ef,'options':{'where':{'id':_0x1c2aa9}},'log':_0x1d5f('0x5')});}; \ No newline at end of file +var _0x62c4=['addTags','addTagsToChatInteraction','update','Request'];(function(_0x547b8d,_0x97b1d){var _0x21cba9=function(_0x596bd9){while(--_0x596bd9){_0x547b8d['push'](_0x547b8d['shift']());}};_0x21cba9(++_0x97b1d);}(_0x62c4,0x7e));var _0x462c=function(_0x2e0b3f,_0x58d780){_0x2e0b3f=_0x2e0b3f-0x0;var _0x1bfd0f=_0x62c4[_0x2e0b3f];return _0x1bfd0f;};'use strict';var client=require('../client');exports[_0x462c('0x0')]=function(_0x45bc15,_0x185aac){return client[_0x462c('0x1')]('UpdateMailInteraction',{'body':_0x185aac,'options':{'where':{'id':_0x45bc15}},'log':'updateMailInteraction'});};exports[_0x462c('0x2')]=function(_0x475a16,_0x4429e9){return client[_0x462c('0x1')]('AddTagsToMailInteraction',{'body':_0x4429e9,'options':{'where':{'id':_0x475a16}},'log':_0x462c('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index b051ea6..7ff3fbd 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 _0x2a96=['createMailMessage','../client','create'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x2a96,0x118));var _0x62a9=function(_0x29d9d5,_0x5a1bd8){_0x29d9d5=_0x29d9d5-0x0;var _0x1be395=_0x2a96[_0x29d9d5];return _0x1be395;};'use strict';var client=require(_0x62a9('0x0'));exports[_0x62a9('0x1')]=function(_0x3d84cb){return client['Request']('CreateMailMessage',{'body':_0x3d84cb,'log':_0x62a9('0x2')});}; \ No newline at end of file +var _0xe03e=['create','Request','CreateMailMessage','createMailMessage','../client'];(function(_0x5ecb10,_0x38c15f){var _0x3e30fd=function(_0x132dc1){while(--_0x132dc1){_0x5ecb10['push'](_0x5ecb10['shift']());}};_0x3e30fd(++_0x38c15f);}(_0xe03e,0x117));var _0xee03=function(_0x39747f,_0x5d8c11){_0x39747f=_0x39747f-0x0;var _0x25cc32=_0xe03e[_0x39747f];return _0x25cc32;};'use strict';var client=require(_0xee03('0x0'));exports[_0xee03('0x1')]=function(_0x3834d5){return client[_0xee03('0x2')](_0xee03('0x3'),{'body':_0x3834d5,'log':_0xee03('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 5e2ea72..b79be6e 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 _0x5351=['getMailQueues','../client','Request','GetMailQueue','name','timeout','strategy','Agents','mailPause'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x5351,0x88));var _0x1535=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x5351[_0x17d9e3];return _0x14192d;};'use strict';var client=require(_0x1535('0x0'));exports['getMailQueues']=function(){return function(){return client[_0x1535('0x1')](_0x1535('0x2'),{'options':{'raw':![],'attributes':['id',_0x1535('0x3'),_0x1535('0x4'),_0x1535('0x5')],'include':[{'model':'User','as':_0x1535('0x6'),'attributes':['id',_0x1535('0x3'),'online',_0x1535('0x7')]}]},'log':_0x1535('0x8')});};}; \ No newline at end of file +var _0x2a38=['online','mailPause','getMailQueues','../client','Request','name','timeout','strategy','User','Agents'];(function(_0x54960a,_0xf21cab){var _0x586540=function(_0x3b94b3){while(--_0x3b94b3){_0x54960a['push'](_0x54960a['shift']());}};_0x586540(++_0xf21cab);}(_0x2a38,0x1cf));var _0x82a3=function(_0x39340a,_0x533d5a){_0x39340a=_0x39340a-0x0;var _0x27fa75=_0x2a38[_0x39340a];return _0x27fa75;};'use strict';var client=require(_0x82a3('0x0'));exports['getMailQueues']=function(){return function(){return client[_0x82a3('0x1')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0x82a3('0x2'),_0x82a3('0x3'),_0x82a3('0x4')],'include':[{'model':_0x82a3('0x5'),'as':_0x82a3('0x6'),'attributes':['id','name',_0x82a3('0x7'),_0x82a3('0x8')]}]},'log':_0x82a3('0x9')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index f476644..330a0e1 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 _0x241f=['create','Request','CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client'];(function(_0x2237ea,_0xaa83c2){var _0x15f319=function(_0xbbb5ab){while(--_0xbbb5ab){_0x2237ea['push'](_0x2237ea['shift']());}};_0x15f319(++_0xaa83c2);}(_0x241f,0x148));var _0xf241=function(_0x239875,_0x52a793){_0x239875=_0x239875-0x0;var _0x55a8d6=_0x241f[_0x239875];return _0x55a8d6;};'use strict';var client=require(_0xf241('0x0'));exports[_0xf241('0x1')]=function(_0x2503c2){return client[_0xf241('0x2')](_0xf241('0x3'),{'body':_0x2503c2,'log':_0xf241('0x3')});};exports[_0xf241('0x4')]=function(_0x46b649,_0x4fa6d1){return client[_0xf241('0x2')](_0xf241('0x5'),{'body':_0x4fa6d1,'options':{'where':{'uniqueid':_0x46b649},'order':[['id',_0xf241('0x6')]],'limit':0x1},'log':_0xf241('0x5')});}; \ No newline at end of file +var _0xcbfa=['create','Request','CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client'];(function(_0x202c61,_0x3673e0){var _0x540691=function(_0x409610){while(--_0x409610){_0x202c61['push'](_0x202c61['shift']());}};_0x540691(++_0x3673e0);}(_0xcbfa,0xb5));var _0xacbf=function(_0x279368,_0x41c002){_0x279368=_0x279368-0x0;var _0x40b6d0=_0xcbfa[_0x279368];return _0x40b6d0;};'use strict';var client=require(_0xacbf('0x0'));exports[_0xacbf('0x1')]=function(_0x5d5000){return client[_0xacbf('0x2')](_0xacbf('0x3'),{'body':_0x5d5000,'log':_0xacbf('0x3')});};exports[_0xacbf('0x4')]=function(_0x1cfc5a,_0x1dbc1f){return client[_0xacbf('0x2')](_0xacbf('0x5'),{'body':_0x1dbc1f,'options':{'where':{'uniqueid':_0x1cfc5a},'order':[['id',_0xacbf('0x6')]],'limit':0x1},'log':_0xacbf('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index d6d771e..1c3409e 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 _0x3939=['updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','Request','UpdateOpenchannelInteraction'];(function(_0x39998f,_0x4b1a9e){var _0x296d5a=function(_0x374196){while(--_0x374196){_0x39998f['push'](_0x39998f['shift']());}};_0x296d5a(++_0x4b1a9e);}(_0x3939,0x124));var _0x9393=function(_0xda4a1,_0x160982){_0xda4a1=_0xda4a1-0x0;var _0xb15d38=_0x3939[_0xda4a1];return _0xb15d38;};'use strict';var client=require(_0x9393('0x0'));exports[_0x9393('0x1')]=function(_0x4df432,_0x3655f5){return client[_0x9393('0x2')](_0x9393('0x3'),{'body':_0x3655f5,'options':{'where':{'id':_0x4df432}},'log':_0x9393('0x4')});};exports[_0x9393('0x5')]=function(_0x56179d,_0x383f2f){return client[_0x9393('0x2')](_0x9393('0x6'),{'body':_0x383f2f,'options':{'where':{'id':_0x56179d}},'log':_0x9393('0x7')});}; \ No newline at end of file +var _0x7fbd=['addTagsToChatInteraction','../client','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction'];(function(_0x5c7055,_0x550d42){var _0x20d196=function(_0x47e15e){while(--_0x47e15e){_0x5c7055['push'](_0x5c7055['shift']());}};_0x20d196(++_0x550d42);}(_0x7fbd,0xbb));var _0xd7fb=function(_0x39c0fe,_0x285b08){_0x39c0fe=_0x39c0fe-0x0;var _0x381a92=_0x7fbd[_0x39c0fe];return _0x381a92;};'use strict';var client=require(_0xd7fb('0x0'));exports['update']=function(_0x5c8016,_0x445922){return client['Request'](_0xd7fb('0x1'),{'body':_0x445922,'options':{'where':{'id':_0x5c8016}},'log':_0xd7fb('0x2')});};exports[_0xd7fb('0x3')]=function(_0x9fadf6,_0x1410cb){return client['Request'](_0xd7fb('0x4'),{'body':_0x1410cb,'options':{'where':{'id':_0x9fadf6}},'log':_0xd7fb('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 44355b5..a102670 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 _0xf3cd=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x116cf4,_0x39d1db){var _0xac811d=function(_0x461152){while(--_0x461152){_0x116cf4['push'](_0x116cf4['shift']());}};_0xac811d(++_0x39d1db);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x198247,_0x491c12){_0x198247=_0x198247-0x0;var _0x2b18bc=_0xf3cd[_0x198247];return _0x2b18bc;};'use strict';var client=require(_0xdf3c('0x0'));exports[_0xdf3c('0x1')]=function(_0x31e5a5){return client[_0xdf3c('0x2')](_0xdf3c('0x3'),{'body':_0x31e5a5,'log':_0xdf3c('0x4')});}; \ No newline at end of file +var _0xf109=['../client','create'];(function(_0x23a299,_0x30e49c){var _0x560bb3=function(_0x1c8073){while(--_0x1c8073){_0x23a299['push'](_0x23a299['shift']());}};_0x560bb3(++_0x30e49c);}(_0xf109,0xce));var _0x9f10=function(_0x5627e1,_0x1b2dbf){_0x5627e1=_0x5627e1-0x0;var _0x2f013f=_0xf109[_0x5627e1];return _0x2f013f;};'use strict';var client=require(_0x9f10('0x0'));exports[_0x9f10('0x1')]=function(_0x44c4f2){return client['Request']('CreateOpenchannelMessage',{'body':_0x44c4f2,'log':'createOpenchannelMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index b019f75..4229399 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 _0x04b2=['Request','timeout','strategy','User','Agents','name','online','openchannelPause','../client','getOpenchannelQueues'];(function(_0x41cbdf,_0x3f1993){var _0x1f7056=function(_0x2d27c0){while(--_0x2d27c0){_0x41cbdf['push'](_0x41cbdf['shift']());}};_0x1f7056(++_0x3f1993);}(_0x04b2,0xbc));var _0x204b=function(_0x3af8ce,_0xa1dc21){_0x3af8ce=_0x3af8ce-0x0;var _0x354395=_0x04b2[_0x3af8ce];return _0x354395;};'use strict';var client=require(_0x204b('0x0'));exports[_0x204b('0x1')]=function(){return function(){return client[_0x204b('0x2')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id','name',_0x204b('0x3'),_0x204b('0x4')],'include':[{'model':_0x204b('0x5'),'as':_0x204b('0x6'),'attributes':['id',_0x204b('0x7'),_0x204b('0x8'),_0x204b('0x9')]}]},'log':_0x204b('0x1')});};}; \ No newline at end of file +var _0x7054=['strategy','name','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','timeout'];(function(_0x2b2eed,_0x177b13){var _0x532919=function(_0x427352){while(--_0x427352){_0x2b2eed['push'](_0x2b2eed['shift']());}};_0x532919(++_0x177b13);}(_0x7054,0x160));var _0x4705=function(_0x16270b,_0x4ff120){_0x16270b=_0x16270b-0x0;var _0x2cd122=_0x7054[_0x16270b];return _0x2cd122;};'use strict';var client=require(_0x4705('0x0'));exports[_0x4705('0x1')]=function(){return function(){return client[_0x4705('0x2')](_0x4705('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x4705('0x4'),_0x4705('0x5')],'include':[{'model':'User','as':'Agents','attributes':['id',_0x4705('0x6'),'online','openchannelPause']}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 24b9187..03b00ca 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 _0x90ff=['../client','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x90ff,0x104));var _0xf90f=function(_0x354637,_0x102b53){_0x354637=_0x354637-0x0;var _0x300088=_0x90ff[_0x354637];return _0x300088;};'use strict';var client=require(_0xf90f('0x0'));exports['create']=function(_0x485ad6){return client[_0xf90f('0x1')]('CreateOpenchannelQueueReport',{'body':_0x485ad6,'log':_0xf90f('0x2')});};exports[_0xf90f('0x3')]=function(_0x739875,_0x5b9bbf){return client['Request']('UpdateOpenchannelQueueReport',{'body':_0x5b9bbf,'options':{'where':{'uniqueid':_0x739875},'order':[['id','DESC']],'limit':0x1},'log':_0xf90f('0x4')});}; \ No newline at end of file +var _0x43b3=['CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','../client','create','Request'];(function(_0x2178e0,_0x485571){var _0x4aeed7=function(_0x352b3e){while(--_0x352b3e){_0x2178e0['push'](_0x2178e0['shift']());}};_0x4aeed7(++_0x485571);}(_0x43b3,0x1ad));var _0x343b=function(_0x5e845f,_0x487e62){_0x5e845f=_0x5e845f-0x0;var _0x2630bf=_0x43b3[_0x5e845f];return _0x2630bf;};'use strict';var client=require(_0x343b('0x0'));exports[_0x343b('0x1')]=function(_0xe47a70){return client[_0x343b('0x2')](_0x343b('0x3'),{'body':_0xe47a70,'log':_0x343b('0x3')});};exports[_0x343b('0x4')]=function(_0x380a1f,_0x48a4c8){return client['Request'](_0x343b('0x5'),{'body':_0x48a4c8,'options':{'where':{'uniqueid':_0x380a1f},'order':[['id','DESC']],'limit':0x1},'log':_0x343b('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 9324aa4..24b7152 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 _0x439b=['AddTagsToSmsInteraction','../client','Request','updateSmsInteraction','addTags'];(function(_0x3e2c65,_0x176091){var _0x266cb6=function(_0x7fbcf){while(--_0x7fbcf){_0x3e2c65['push'](_0x3e2c65['shift']());}};_0x266cb6(++_0x176091);}(_0x439b,0x105));var _0xb439=function(_0x38f6bc,_0x5d34c9){_0x38f6bc=_0x38f6bc-0x0;var _0x537c69=_0x439b[_0x38f6bc];return _0x537c69;};'use strict';var client=require(_0xb439('0x0'));exports['update']=function(_0x167b10,_0x56fa7c){return client[_0xb439('0x1')]('UpdateSmsInteraction',{'body':_0x56fa7c,'options':{'where':{'id':_0x167b10}},'log':_0xb439('0x2')});};exports[_0xb439('0x3')]=function(_0x1ae573,_0x1d8b20){return client[_0xb439('0x1')](_0xb439('0x4'),{'body':_0x1d8b20,'options':{'where':{'id':_0x1ae573}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file +var _0x621f=['AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','Request','UpdateSmsInteraction','addTags'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x621f,0x128));var _0xf621=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x621f[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xf621('0x0'));exports[_0xf621('0x1')]=function(_0x587e9b,_0xebd73d){return client[_0xf621('0x2')](_0xf621('0x3'),{'body':_0xebd73d,'options':{'where':{'id':_0x587e9b}},'log':'updateSmsInteraction'});};exports[_0xf621('0x4')]=function(_0x2bc80f,_0x3f7d9c){return client[_0xf621('0x2')](_0xf621('0x5'),{'body':_0x3f7d9c,'options':{'where':{'id':_0x2bc80f}},'log':_0xf621('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index f579ea8..b8a182f 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 _0x07eb=['create','Request','CreateSmsMessage','createSmsMessage'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x07eb,0x74));var _0xb07e=function(_0x56825b,_0x172b8d){_0x56825b=_0x56825b-0x0;var _0x69ce77=_0x07eb[_0x56825b];return _0x69ce77;};'use strict';var client=require('../client');exports[_0xb07e('0x0')]=function(_0x425833){return client[_0xb07e('0x1')](_0xb07e('0x2'),{'body':_0x425833,'log':_0xb07e('0x3')});}; \ No newline at end of file +var _0xdccb=['../client','create','Request','CreateSmsMessage'];(function(_0x101e41,_0x416aab){var _0x2984da=function(_0x1d7613){while(--_0x1d7613){_0x101e41['push'](_0x101e41['shift']());}};_0x2984da(++_0x416aab);}(_0xdccb,0x16c));var _0xbdcc=function(_0x8be751,_0x81abe9){_0x8be751=_0x8be751-0x0;var _0x17af66=_0xdccb[_0x8be751];return _0x17af66;};'use strict';var client=require(_0xbdcc('0x0'));exports[_0xbdcc('0x1')]=function(_0x3a987b){return client[_0xbdcc('0x2')](_0xbdcc('0x3'),{'body':_0x3a987b,'log':'createSmsMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index eb28c2a..aadd031 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 _0x5ba4=['Agents','name','../client','getSmsQueues','Request','GetSmsQueue','User'];(function(_0x399bb9,_0x3aafa8){var _0x2c53be=function(_0x162596){while(--_0x162596){_0x399bb9['push'](_0x399bb9['shift']());}};_0x2c53be(++_0x3aafa8);}(_0x5ba4,0x136));var _0x45ba=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0x5ba4[_0x22f8ab];return _0x2a70e5;};'use strict';var client=require(_0x45ba('0x0'));exports[_0x45ba('0x1')]=function(){return function(){return client[_0x45ba('0x2')](_0x45ba('0x3'),{'options':{'raw':![],'attributes':['id','name','timeout','strategy'],'include':[{'model':_0x45ba('0x4'),'as':_0x45ba('0x5'),'attributes':['id',_0x45ba('0x6'),'online','smsPause']}]},'log':'getSmsQueues'});};}; \ No newline at end of file +var _0x37f5=['strategy','User','Agents','online','smsPause','getSmsQueues','Request','GetSmsQueue','timeout'];(function(_0x3621c4,_0xe9378a){var _0x397715=function(_0x2c19fd){while(--_0x2c19fd){_0x3621c4['push'](_0x3621c4['shift']());}};_0x397715(++_0xe9378a);}(_0x37f5,0x1da));var _0x537f=function(_0xddbeb7,_0x4ac374){_0xddbeb7=_0xddbeb7-0x0;var _0x29b617=_0x37f5[_0xddbeb7];return _0x29b617;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x537f('0x0')](_0x537f('0x1'),{'options':{'raw':![],'attributes':['id','name',_0x537f('0x2'),_0x537f('0x3')],'include':[{'model':_0x537f('0x4'),'as':_0x537f('0x5'),'attributes':['id','name',_0x537f('0x6'),_0x537f('0x7')]}]},'log':_0x537f('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index d7b39e7..5074a0e 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 _0xc648=['update','DESC','UpdateSmsQueueReport','create','Request','CreateSmsQueueReport'];(function(_0x17508b,_0x44f92f){var _0x39895e=function(_0x2ed07f){while(--_0x2ed07f){_0x17508b['push'](_0x17508b['shift']());}};_0x39895e(++_0x44f92f);}(_0xc648,0x171));var _0x8c64=function(_0x50dde3,_0x1601c3){_0x50dde3=_0x50dde3-0x0;var _0x208288=_0xc648[_0x50dde3];return _0x208288;};'use strict';var client=require('../client');exports[_0x8c64('0x0')]=function(_0x9dfa82){return client[_0x8c64('0x1')](_0x8c64('0x2'),{'body':_0x9dfa82,'log':_0x8c64('0x2')});};exports[_0x8c64('0x3')]=function(_0x294e8e,_0x577182){return client['Request']('UpdateSmsQueueReport',{'body':_0x577182,'options':{'where':{'uniqueid':_0x294e8e},'order':[['id',_0x8c64('0x4')]],'limit':0x1},'log':_0x8c64('0x5')});}; \ No newline at end of file +var _0xa770=['../client','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x2826c7,_0x2dd9bb){var _0xb1cdad=function(_0x12aa2e){while(--_0x12aa2e){_0x2826c7['push'](_0x2826c7['shift']());}};_0xb1cdad(++_0x2dd9bb);}(_0xa770,0xc6));var _0x0a77=function(_0x5d2e9c,_0x14c549){_0x5d2e9c=_0x5d2e9c-0x0;var _0x4553de=_0xa770[_0x5d2e9c];return _0x4553de;};'use strict';var client=require(_0x0a77('0x0'));exports['create']=function(_0x344126){return client[_0x0a77('0x1')](_0x0a77('0x2'),{'body':_0x344126,'log':_0x0a77('0x2')});};exports[_0x0a77('0x3')]=function(_0x3e4f9f,_0x49ce5b){return client[_0x0a77('0x1')](_0x0a77('0x4'),{'body':_0x49ce5b,'options':{'where':{'uniqueid':_0x3e4f9f},'order':[['id',_0x0a77('0x5')]],'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 21abde1..138965c 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 _0xb709=['GetUser','agent','name','online','pauseType','lastPauseAt','voicePause','faxPause','smsPause','openchannelPause','chatCapacity','faxCapacity','smsCapacity','openchannelCapacity','getAgents','../client','Request'];(function(_0x1bc496,_0x14389a){var _0x18fe52=function(_0x23d699){while(--_0x23d699){_0x1bc496['push'](_0x1bc496['shift']());}};_0x18fe52(++_0x14389a);}(_0xb709,0x97));var _0x9b70=function(_0x50e5aa,_0x20ee7e){_0x50e5aa=_0x50e5aa-0x0;var _0x420516=_0xb709[_0x50e5aa];return _0x420516;};'use strict';var client=require(_0x9b70('0x0'));exports['getAgents']=function(){return function(){return client[_0x9b70('0x1')](_0x9b70('0x2'),{'options':{'raw':!![],'where':{'role':_0x9b70('0x3')},'attributes':['id',_0x9b70('0x4'),_0x9b70('0x5'),_0x9b70('0x6'),_0x9b70('0x7'),_0x9b70('0x8'),'chatPause','mailPause',_0x9b70('0x9'),_0x9b70('0xa'),_0x9b70('0xb'),_0x9b70('0xc'),'mailCapacity',_0x9b70('0xd'),_0x9b70('0xe'),_0x9b70('0xf')]},'log':_0x9b70('0x10')});};}; \ No newline at end of file +var _0x2a7b=['lastPauseAt','voicePause','chatPause','mailPause','faxPause','mailCapacity','faxCapacity','smsCapacity','openchannelCapacity','../client','getAgents','agent','name','pauseType'];(function(_0x3c1e39,_0x385d65){var _0x2167c4=function(_0x1d22b8){while(--_0x1d22b8){_0x3c1e39['push'](_0x3c1e39['shift']());}};_0x2167c4(++_0x385d65);}(_0x2a7b,0x175));var _0xb2a7=function(_0x37d890,_0x4a5cd9){_0x37d890=_0x37d890-0x0;var _0xfe3b9d=_0x2a7b[_0x37d890];return _0xfe3b9d;};'use strict';var client=require(_0xb2a7('0x0'));exports[_0xb2a7('0x1')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0xb2a7('0x2')},'attributes':['id',_0xb2a7('0x3'),'online',_0xb2a7('0x4'),_0xb2a7('0x5'),_0xb2a7('0x6'),_0xb2a7('0x7'),_0xb2a7('0x8'),_0xb2a7('0x9'),'smsPause','openchannelPause','chatCapacity',_0xb2a7('0xa'),_0xb2a7('0xb'),_0xb2a7('0xc'),_0xb2a7('0xd')]},'log':_0xb2a7('0x1')});};}; \ 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 a0be3e2..01737f1 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 _0x40ee=['validate','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','[%s][AGENT]\x20%s','map','message','join','find','agents','timeout','createQueue','atimeout','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','stop','[%s][AGENT]\x20ROUTING\x20END','next','agent','error','log'];(function(_0x174058,_0x272939){var _0xbac18d=function(_0x47151d){while(--_0x47151d){_0x174058['push'](_0x174058['shift']());}};_0xbac18d(++_0x272939);}(_0x40ee,0x197));var _0xe40e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x40ee[_0xbca1b1];return _0x4e1686;};'use strict';var schema=require(_0xe40e('0x0'));var _=require(_0xe40e('0x1'));var util=require(_0xe40e('0x2'));var seqqueue=require(_0xe40e('0x3'));var logger=require(_0xe40e('0x4'))(_0xe40e('0x5'));var strategy=require(_0xe40e('0x6'));var queue=schema({'name':{'type':_0xe40e('0x7'),'required':!![],'message':_0xe40e('0x8')},'timeout':{'type':'number','message':_0xe40e('0x9')}});function writeLog(_0x2e7672,_0xc94feb,_0x239d7d){return logger[_0xe40e('0xa')](util[_0xe40e('0xb')](_0xe40e('0xc'),_0x2e7672,_0xc94feb['name'],_0x239d7d));}function handleFindAgent(_0x51a873){return function(_0x189390){return _0x189390[_0xe40e('0xd')]['toLowerCase']()===_0x51a873[_0xe40e('0xe')]();};}exports[_0xe40e('0xf')]=function(_0x9ec803,_0x176838,_0x2bbc34,_0x3da42f){return function(_0x476620){try{var _0xe64e={'name':_0x176838[0x0],'timeout':_0x176838[0x1]};var _0x229419=queue['validate'](_0xe64e,{'typecast':!![]});if(_0x229419[_0xe40e('0x10')]){logger['error'](_0xe40e('0x11'),_0x9ec803,_[_0xe40e('0x12')](_0x229419,_0xe40e('0x13'))[_0xe40e('0x14')](',\x20'));_0x476620['stop']();}else{var _0x390826=_[_0xe40e('0x15')](_0x2bbc34[_0xe40e('0x16')],handleFindAgent(_0xe64e[_0xe40e('0xd')]));if(_0x390826){var _0x53b4df=(_0xe64e[_0xe40e('0x17')]||0xa)*0x3e8;var _0x5bc151,_0x32aa9c;var _0x5784fc=seqqueue[_0xe40e('0x18')](_0x53b4df);_0x5784fc['id']=_0x9ec803;_0x5784fc[_0xe40e('0x19')]=_0x53b4df;_0x5784fc['channel']=_0x3da42f[_0xe40e('0x1a')];writeLog(_0x9ec803,_0x390826,util[_0xe40e('0xb')](_0xe40e('0x1b'),_0x53b4df));_0x2bbc34[_0xe40e('0x1c')][_0x9ec803]['on'](_0xe40e('0x1d'),function(){_0x5784fc['close']();clearTimeout(_0x32aa9c);_0x32aa9c=undefined;if(_0x2bbc34[_0xe40e('0x1c')][_0x9ec803]){delete _0x2bbc34[_0xe40e('0x1c')][_0x9ec803];}logger['info'](_0xe40e('0x1e'),_0x9ec803);_0x476620[_0xe40e('0x1f')]();});_0x32aa9c=setTimeout(function(){clearTimeout(_0x32aa9c);_0x5784fc['close']();logger[_0xe40e('0xa')](_0xe40e('0x20'),_0x9ec803);_0x476620[_0xe40e('0x21')]();},_0x53b4df);strategy[_0xe40e('0x22')](_0x5784fc,_0x390826,_0x2bbc34,_0x3da42f);}else{logger[_0xe40e('0x23')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x9ec803,_0xe64e[_0xe40e('0xd')]);_0x476620[_0xe40e('0x1f')]();}}}catch(_0x481182){console[_0xe40e('0x24')](_0x481182);logger[_0xe40e('0x23')]('[%s][QUEUE]\x20%s',_0x9ec803,_0x481182['stack']);_0x476620[_0xe40e('0x1f')]();}};}; \ No newline at end of file +var _0x4acb=['routing','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','error','[%s][AGENT]\x20%s','join','stop','find','timeout','atimeout','channel','format','START:%s','rules','end','info','[%s][AGENT]\x20ROUTING\x20STOPPED','close','agent','log','[%s][QUEUE]\x20%s','stack','validate','util','seq-queue','../../../../config/logger'];(function(_0x2eb3b8,_0x32ea56){var _0x393a6f=function(_0x231047){while(--_0x231047){_0x2eb3b8['push'](_0x2eb3b8['shift']());}};_0x393a6f(++_0x32ea56);}(_0x4acb,0x70));var _0xb4ac=function(_0x1df4b8,_0xe3a7f8){_0x1df4b8=_0x1df4b8-0x0;var _0x4d09fc=_0x4acb[_0x1df4b8];return _0x4d09fc;};'use strict';var schema=require(_0xb4ac('0x0'));var _=require('lodash');var util=require(_0xb4ac('0x1'));var seqqueue=require(_0xb4ac('0x2'));var logger=require(_0xb4ac('0x3'))(_0xb4ac('0x4'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0xb4ac('0x5'),'required':!![],'message':_0xb4ac('0x6')},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x17c1be,_0x47df2f,_0x357a1c){return logger['info'](util['format'](_0xb4ac('0x7'),_0x17c1be,_0x47df2f['name'],_0x357a1c));}function handleFindAgent(_0x37f48a){return function(_0x55ec73){return _0x55ec73[_0xb4ac('0x8')]['toLowerCase']()===_0x37f48a[_0xb4ac('0x9')]();};}exports['consequence']=function(_0x268ebf,_0x589e6f,_0xe2b23c,_0x3e1f90){return function(_0x27cf69){try{var _0x392154={'name':_0x589e6f[0x0],'timeout':_0x589e6f[0x1]};var _0x4f3c1f=queue[_0xb4ac('0x0')](_0x392154,{'typecast':!![]});if(_0x4f3c1f['length']){logger[_0xb4ac('0xa')](_0xb4ac('0xb'),_0x268ebf,_['map'](_0x4f3c1f,'message')[_0xb4ac('0xc')](',\x20'));_0x27cf69[_0xb4ac('0xd')]();}else{var _0x448cb5=_[_0xb4ac('0xe')](_0xe2b23c['agents'],handleFindAgent(_0x392154[_0xb4ac('0x8')]));if(_0x448cb5){var _0x5bf3a0=(_0x392154[_0xb4ac('0xf')]||0xa)*0x3e8;var _0x51cb5f,_0x101a94;var _0x37426f=seqqueue['createQueue'](_0x5bf3a0);_0x37426f['id']=_0x268ebf;_0x37426f[_0xb4ac('0x10')]=_0x5bf3a0;_0x37426f[_0xb4ac('0x11')]=_0x3e1f90[_0xb4ac('0x11')];writeLog(_0x268ebf,_0x448cb5,util[_0xb4ac('0x12')](_0xb4ac('0x13'),_0x5bf3a0));_0xe2b23c[_0xb4ac('0x14')][_0x268ebf]['on'](_0xb4ac('0x15'),function(){_0x37426f['close']();clearTimeout(_0x101a94);_0x101a94=undefined;if(_0xe2b23c['rules'][_0x268ebf]){delete _0xe2b23c['rules'][_0x268ebf];}logger[_0xb4ac('0x16')](_0xb4ac('0x17'),_0x268ebf);_0x27cf69[_0xb4ac('0xd')]();});_0x101a94=setTimeout(function(){clearTimeout(_0x101a94);_0x37426f[_0xb4ac('0x18')]();logger[_0xb4ac('0x16')]('[%s][AGENT]\x20ROUTING\x20END',_0x268ebf);_0x27cf69['next']();},_0x5bf3a0);strategy[_0xb4ac('0x19')](_0x37426f,_0x448cb5,_0xe2b23c,_0x3e1f90);}else{logger[_0xb4ac('0xa')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x268ebf,_0x392154[_0xb4ac('0x8')]);_0x27cf69['stop']();}}}catch(_0x379195){console[_0xb4ac('0x1a')](_0x379195);logger[_0xb4ac('0xa')](_0xb4ac('0x1b'),_0x268ebf,_0x379195[_0xb4ac('0x1c')]);_0x27cf69[_0xb4ac('0xd')]();}};}; \ 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 f1d5bd9..7b95ab2 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 _0x603d=['../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','chat','ChatWebsiteId','upperFirst','InteractionId','created','Message','then','body','error','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','LexRuntime','$LATEST','toString','postText','amazonlex','message','create','dialogState','next','stringify','lodash','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage'];(function(_0x973433,_0x2ff98c){var _0x364851=function(_0x12569e){while(--_0x12569e){_0x973433['push'](_0x973433['shift']());}};_0x364851(++_0x2ff98c);}(_0x603d,0x121));var _0xd603=function(_0x257f5c,_0x255d93){_0x257f5c=_0x257f5c-0x0;var _0x3ba3f2=_0x603d[_0x257f5c];return _0x3ba3f2;};'use strict';var _=require(_0xd603('0x0'));var moment=require('moment');var AWS=require('aws-sdk');var utils=require(_0xd603('0x1'));var logger=require('../../../../config/logger')(_0xd603('0x2'));var rpc={'chatMessage':require(_0xd603('0x3')),'openchannelMessage':require(_0xd603('0x4')),'mailMessage':require(_0xd603('0x5')),'smsMessage':require(_0xd603('0x6')),'faxMessage':require(_0xd603('0x7'))};exports['consequence']=function(_0x2b9aa7,_0x2213e7){return function(_0x58f897){try{if(!_[_0xd603('0x8')](this[_0xd603('0x9')][_0xd603('0xa')])){logger[_0xd603('0xb')](_0xd603('0xc'),_0x2b9aa7,_0xd603('0xd'));return _0x58f897['next']();}var _0x2f06fe={'ContactId':this[_0xd603('0xe')]['id'],'sentAt':moment()[_0xd603('0xf')](_0xd603('0x10')),'direction':_0xd603('0x11')};var _0x712834=this[_0xd603('0x12')];if(_0x712834===_0xd603('0x13')){_0x2f06fe[_0xd603('0x14')]=this['account']['id'];}else{_0x2f06fe[_[_0xd603('0x15')](_0x712834)+'AccountId']=this['account']['id'];}_0x2f06fe[_[_0xd603('0x15')](_0x712834)+_0xd603('0x16')]=this[_0xd603('0x9')]['id'];if(this[_0xd603('0x9')][_0xd603('0x17')]){var _0x5b2df9=_0x2213e7[0x4];if(!_['isEmpty'](_0x5b2df9)){_0x2f06fe['body']=utils['getMustacheRender'](_0x5b2df9,this);return rpc[_0x712834+_0xd603('0x18')]['create'](_0x2f06fe)[_0xd603('0x19')](function(_0x4b2f0d){logger[_0xd603('0xb')]('[%s][AMAZONLEX]\x20%s',_0x2b9aa7,_0x2f06fe[_0xd603('0x1a')]);})['catch'](function(_0x155e0e){logger[_0xd603('0x1b')](_0xd603('0xc'),_0x2b9aa7,JSON['stringify'](_0x155e0e));})[_0xd603('0x1c')](function(){logger[_0xd603('0xb')](_0xd603('0x1d'),_0x2b9aa7);_0x58f897['stop']();});}else{logger['info'](_0xd603('0x1e'),_0x2b9aa7);_0x58f897[_0xd603('0x1f')]();}}else{var _0x1045ce=this;var _0x289462=new AWS[(_0xd603('0x20'))]({'accessKeyId':_0x2213e7[0x0],'secretAccessKey':_0x2213e7[0x1],'region':_0x2213e7[0x2]});var _0x11ed3a={'botAlias':_0xd603('0x21'),'botName':_0x2213e7[0x3],'inputText':this['message']['body'],'userId':this[_0xd603('0x9')]['id'][_0xd603('0x22')]()};_0x289462[_0xd603('0x23')](_0x11ed3a,function(_0x371b83,_0x55f2ef){if(_0x371b83){logger[_0xd603('0x1b')](_0xd603('0xc'),_0x2b9aa7,_0x371b83['message']);_0x58f897['next']();}else if(_0x55f2ef&&_0x55f2ef['message']){_0x1045ce[_0xd603('0x1a')][_0xd603('0x24')]=_0x55f2ef;_0x2f06fe['body']=_0x55f2ef[_0xd603('0x25')];return rpc[_0x712834+_0xd603('0x18')][_0xd603('0x26')](_0x2f06fe)[_0xd603('0x19')](function(_0x3f4bbe){logger['info'](_0xd603('0xc'),_0x2b9aa7,_0x2f06fe[_0xd603('0x1a')]);if(_0x55f2ef[_0xd603('0x27')]=='Failed'){_0x58f897[_0xd603('0x28')]();}else{_0x58f897[_0xd603('0x1f')]();}})['catch'](function(_0x43c5e6){logger[_0xd603('0x1b')]('[%s][AMAZONLEX]\x20%s',_0x2b9aa7,JSON[_0xd603('0x29')](_0x43c5e6));_0x58f897[_0xd603('0x28')]();});}else{_0x58f897[_0xd603('0x28')]();}});}}catch(_0x55b3dc){logger['error'](_0xd603('0xc'),_0x2b9aa7,JSON['stringify'](_0x55b3dc));_0x58f897['stop']();}};}; \ No newline at end of file +var _0x9d01=['message','toString','postText','Message','then','dialogState','Failed','stringify','lodash','moment','./utils','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','out','channel','chat','ChatWebsiteId','account','upperFirst','created','body','create','catch','error','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','$LATEST'];(function(_0x41188f,_0x43488c){var _0x356950=function(_0x5c9350){while(--_0x5c9350){_0x41188f['push'](_0x41188f['shift']());}};_0x356950(++_0x43488c);}(_0x9d01,0xb0));var _0x19d0=function(_0x25d571,_0x1ed9f5){_0x25d571=_0x25d571-0x0;var _0x5c1455=_0x9d01[_0x25d571];return _0x5c1455;};'use strict';var _=require(_0x19d0('0x0'));var moment=require(_0x19d0('0x1'));var AWS=require('aws-sdk');var utils=require(_0x19d0('0x2'));var logger=require(_0x19d0('0x3'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x19d0('0x4')),'mailMessage':require(_0x19d0('0x5')),'smsMessage':require(_0x19d0('0x6')),'faxMessage':require(_0x19d0('0x7'))};exports[_0x19d0('0x8')]=function(_0x1e9027,_0x51b15c){return function(_0x6b1196){try{if(!_[_0x19d0('0x9')](this[_0x19d0('0xa')][_0x19d0('0xb')])){logger[_0x19d0('0xc')](_0x19d0('0xd'),_0x1e9027,_0x19d0('0xe'));return _0x6b1196[_0x19d0('0xf')]();}var _0x1c10ad={'ContactId':this[_0x19d0('0x10')]['id'],'sentAt':moment()[_0x19d0('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x19d0('0x12')};var _0x3a3748=this[_0x19d0('0x13')];if(_0x3a3748===_0x19d0('0x14')){_0x1c10ad[_0x19d0('0x15')]=this['account']['id'];}else{_0x1c10ad[_['upperFirst'](_0x3a3748)+'AccountId']=this[_0x19d0('0x16')]['id'];}_0x1c10ad[_[_0x19d0('0x17')](_0x3a3748)+'InteractionId']=this[_0x19d0('0xa')]['id'];if(this['interaction'][_0x19d0('0x18')]){var _0x513384=_0x51b15c[0x4];if(!_['isEmpty'](_0x513384)){_0x1c10ad[_0x19d0('0x19')]=utils['getMustacheRender'](_0x513384,this);return rpc[_0x3a3748+'Message'][_0x19d0('0x1a')](_0x1c10ad)['then'](function(_0x14ccac){logger['info']('[%s][AMAZONLEX]\x20%s',_0x1e9027,_0x1c10ad[_0x19d0('0x19')]);})[_0x19d0('0x1b')](function(_0x26e0bd){logger[_0x19d0('0x1c')]('[%s][AMAZONLEX]\x20%s',_0x1e9027,JSON['stringify'](_0x26e0bd));})[_0x19d0('0x1d')](function(){logger[_0x19d0('0xc')](_0x19d0('0x1e'),_0x1e9027);_0x6b1196[_0x19d0('0x1f')]();});}else{logger[_0x19d0('0xc')](_0x19d0('0x20'),_0x1e9027);_0x6b1196['stop']();}}else{var _0x1ecec4=this;var _0x28d9be=new AWS['LexRuntime']({'accessKeyId':_0x51b15c[0x0],'secretAccessKey':_0x51b15c[0x1],'region':_0x51b15c[0x2]});var _0x1d1f86={'botAlias':_0x19d0('0x21'),'botName':_0x51b15c[0x3],'inputText':this[_0x19d0('0x22')]['body'],'userId':this[_0x19d0('0xa')]['id'][_0x19d0('0x23')]()};_0x28d9be[_0x19d0('0x24')](_0x1d1f86,function(_0x44c3ae,_0x4c1956){if(_0x44c3ae){logger[_0x19d0('0x1c')]('[%s][AMAZONLEX]\x20%s',_0x1e9027,_0x44c3ae[_0x19d0('0x22')]);_0x6b1196['next']();}else if(_0x4c1956&&_0x4c1956['message']){_0x1ecec4['body']['amazonlex']=_0x4c1956;_0x1c10ad[_0x19d0('0x19')]=_0x4c1956[_0x19d0('0x22')];return rpc[_0x3a3748+_0x19d0('0x25')]['create'](_0x1c10ad)[_0x19d0('0x26')](function(_0x2029e6){logger['info']('[%s][AMAZONLEX]\x20%s',_0x1e9027,_0x1c10ad['body']);if(_0x4c1956[_0x19d0('0x27')]==_0x19d0('0x28')){_0x6b1196['next']();}else{_0x6b1196[_0x19d0('0x1f')]();}})[_0x19d0('0x1b')](function(_0x1a93f7){logger[_0x19d0('0x1c')]('[%s][AMAZONLEX]\x20%s',_0x1e9027,JSON[_0x19d0('0x29')](_0x1a93f7));_0x6b1196[_0x19d0('0xf')]();});}else{_0x6b1196[_0x19d0('0xf')]();}});}}catch(_0x285247){logger[_0x19d0('0x1c')]('[%s][AMAZONLEX]\x20%s',_0x1e9027,JSON[_0x19d0('0x29')](_0x285247));_0x6b1196[_0x19d0('0x1f')]();}};}; \ 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 f818299..000896f 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 _0xa9e0=['messageId','html','replace','body',''+_[_0x0a9e('0x29')](_0xbd1168[_0x0a9e('0x2a')],_0x0a9e('0x2b'),_0x0a9e('0x2c'))+'';return mailRpc[_0x0a9e('0x2d')](_0x20f109,_0xbd1168)[_0x0a9e('0x2e')](function(_0x1843b2){logger[_0x0a9e('0x2f')](_0x0a9e('0x30'),_0x57b080);_0xbd1168[_0x0a9e('0x27')]=_0x1843b2[_0x0a9e('0x10')][_0x0a9e('0x27')];return rpc[_0x3ab53f+_0x0a9e('0x1d')]['create'](_0xbd1168);})[_0x0a9e('0x2e')](function(_0x5d1e0e){logger[_0x0a9e('0x2f')](_0x0a9e('0xb'),_0x57b080,JSON[_0x0a9e('0x31')](_0x5d1e0e));})[_0x0a9e('0x32')](function(_0x25ce3a){logger['error'](_0x0a9e('0x33'),_0x57b080,JSON[_0x0a9e('0x31')](_0x25ce3a));})[_0x0a9e('0x34')](function(){_0x441e3a[_0x0a9e('0xd')]();});}else{return rpc[this[_0x0a9e('0xe')]+_0x0a9e('0x1d')][_0x0a9e('0x35')](_0xbd1168)[_0x0a9e('0x2e')](function(_0x5583a4){logger[_0x0a9e('0x2f')]('[%s][AUTOREPLY]\x20%s',_0x57b080,_0xbd1168[_0x0a9e('0x2a')]);})[_0x0a9e('0x32')](function(_0x2b7e7f){logger[_0x0a9e('0x36')]('[%s][AUTOREPLY]\x20%s',_0x57b080,JSON[_0x0a9e('0x31')](_0x2b7e7f));})[_0x0a9e('0x34')](function(){_0x441e3a[_0x0a9e('0xd')]();});}}}catch(_0x15de0e){logger['error']('[%s][AUTOREPLY]\x20%s',_0x57b080,JSON[_0x0a9e('0x31')](_0x15de0e));_0x441e3a['stop']();}};}; \ No newline at end of file +var _0xe706=['next','channel','getMustacheRender','YYYY-MM-DD\x20HH:mm:ss','out','message','from','read','subject','Re:','Re:\x20','chat','ChatWebsiteId','AccountId','account','upperFirst','InteractionId','Message','Smtp','service','host','port','secure','auth','user','pass','inReplyTo','messageId','html','','replace','body','';return mailRpc[_0x6e70('0x33')](_0x228350,_0x37b3e0)['then'](function(_0x259486){logger['info'](_0x6e70('0x34'),_0x1b0389);_0x37b3e0[_0x6e70('0x2c')]=_0x259486[_0x6e70('0x16')]['messageId'];return rpc[_0x743eb5+_0x6e70('0x22')][_0x6e70('0x35')](_0x37b3e0);})['then'](function(_0x13d673){logger[_0x6e70('0xe')]('[%s][AUTOREPLY]\x20%s',_0x1b0389,JSON[_0x6e70('0x36')](_0x13d673));})[_0x6e70('0x37')](function(_0x2d52bd){logger[_0x6e70('0x38')](_0x6e70('0x39'),_0x1b0389,JSON[_0x6e70('0x36')](_0x2d52bd));})[_0x6e70('0x3a')](function(){_0x36357b[_0x6e70('0x11')]();});}else{return rpc[this[_0x6e70('0x12')]+_0x6e70('0x22')]['create'](_0x37b3e0)[_0x6e70('0x3b')](function(_0x4795a0){logger[_0x6e70('0xe')](_0x6e70('0xf'),_0x1b0389,_0x37b3e0[_0x6e70('0x30')]);})[_0x6e70('0x37')](function(_0x233a83){logger[_0x6e70('0x38')](_0x6e70('0xf'),_0x1b0389,JSON[_0x6e70('0x36')](_0x233a83));})[_0x6e70('0x3a')](function(){_0x36357b[_0x6e70('0x11')]();});}}}catch(_0x2a5444){logger[_0x6e70('0x38')](_0x6e70('0xf'),_0x1b0389,JSON['stringify'](_0x2a5444));_0x36357b['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index 4d16408..593e66c 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 _0x7fb3=['../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','system','channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','../../../../config/logger','routing','../../rpc/chatInteraction'];(function(_0x3c9601,_0x2ab681){var _0x1219e8=function(_0xce2bdd){while(--_0xce2bdd){_0x3c9601['push'](_0x3c9601['shift']());}};_0x1219e8(++_0x2ab681);}(_0x7fb3,0xf9));var _0x37fb=function(_0x1cffe2,_0x5383e8){_0x1cffe2=_0x1cffe2-0x0;var _0x57030e=_0x7fb3[_0x1cffe2];return _0x57030e;};'use strict';var moment=require(_0x37fb('0x0'));var logger=require(_0x37fb('0x1'))(_0x37fb('0x2'));var rpc={'chatInteraction':require(_0x37fb('0x3')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x37fb('0x4')),'mailInteraction':require(_0x37fb('0x5')),'faxInteraction':require(_0x37fb('0x6'))};exports[_0x37fb('0x7')]=function(_0x5c7d76,_0x404030,_0xb4ad77,_0x2443bd){return function(_0x23a839){try{logger[_0x37fb('0x8')](_0x37fb('0x9'),_0x5c7d76,_0x404030[0x0]);var _0x51b36a={'closed':0x1,'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0x37fb('0xa'),'disposition':_0x404030[0x0]};if(rpc[_0x2443bd[_0x37fb('0xb')]+_0x37fb('0xc')]){rpc[_0x2443bd[_0x37fb('0xb')]+_0x37fb('0xc')][_0x37fb('0xd')](_0x2443bd[_0x37fb('0xe')]['id'],_0x51b36a)[_0x37fb('0xf')](function(_0x5199de){logger['info'](_0x37fb('0x10'),_0x5c7d76,_0x2443bd[_0x37fb('0xe')]['id']);})[_0x37fb('0x11')](function(_0x116dcc){logger[_0x37fb('0x12')](_0x37fb('0x13'),_0x5c7d76,JSON[_0x37fb('0x14')](_0x116dcc));})[_0x37fb('0x15')](function(){_0x23a839['stop']();});}}catch(_0x5da9e5){logger[_0x37fb('0x12')](_0x37fb('0x13'),_0x5c7d76,JSON[_0x37fb('0x14')](_0x5da9e5));_0x23a839[_0x37fb('0x16')]();}};}; \ No newline at end of file +var _0x2bb0=['system','Interaction','update','then','interaction','error','[%s][CLOSE]\x20%s','finally','stop','moment','../../../../config/logger','routing','../../rpc/openchannelInteraction','../../rpc/faxInteraction','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x211b98,_0x3211cb){var _0x5c9688=function(_0x53f2e8){while(--_0x53f2e8){_0x211b98['push'](_0x211b98['shift']());}};_0x5c9688(++_0x3211cb);}(_0x2bb0,0xf3));var _0x02bb=function(_0x596967,_0x193a14){_0x596967=_0x596967-0x0;var _0x571813=_0x2bb0[_0x596967];return _0x571813;};'use strict';var moment=require(_0x02bb('0x0'));var logger=require(_0x02bb('0x1'))(_0x02bb('0x2'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x02bb('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x02bb('0x4'))};exports['consequence']=function(_0x1dff97,_0xe8fdaa,_0x8e4057,_0x390ff7){return function(_0x43dbb7){try{logger[_0x02bb('0x5')](_0x02bb('0x6'),_0x1dff97,_0xe8fdaa[0x0]);var _0x47d7ae={'closed':0x1,'closedAt':moment()[_0x02bb('0x7')](_0x02bb('0x8')),'closeReason':_0x02bb('0x9'),'disposition':_0xe8fdaa[0x0]};if(rpc[_0x390ff7['channel']+_0x02bb('0xa')]){rpc[_0x390ff7['channel']+_0x02bb('0xa')][_0x02bb('0xb')](_0x390ff7['interaction']['id'],_0x47d7ae)[_0x02bb('0xc')](function(_0x1c1915){logger[_0x02bb('0x5')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x1dff97,_0x390ff7[_0x02bb('0xd')]['id']);})['catch'](function(_0x3fa733){logger[_0x02bb('0xe')](_0x02bb('0xf'),_0x1dff97,JSON['stringify'](_0x3fa733));})[_0x02bb('0x10')](function(){_0x43dbb7[_0x02bb('0x11')]();});}}catch(_0xc89e1b){logger['error'](_0x02bb('0xf'),_0x1dff97,JSON['stringify'](_0xc89e1b));_0x43dbb7[_0x02bb('0x11')]();}};}; \ 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 10c7210..1b5079c 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 _0x1be3=['channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','body','getMustacheRender','create','then','catch','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','fulfillment','speech','Message','result','metadata','endConversation','message','lodash','apiai-promise','md5','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','next','format','YYYY-MM-DD\x20HH:mm:ss','out'];(function(_0x5576e4,_0x3ae057){var _0x159c72=function(_0x4ef751){while(--_0x4ef751){_0x5576e4['push'](_0x5576e4['shift']());}};_0x159c72(++_0x3ae057);}(_0x1be3,0x74));var _0x31be=function(_0x30109c,_0x5e1378){_0x30109c=_0x30109c-0x0;var _0x4777ff=_0x1be3[_0x30109c];return _0x4777ff;};'use strict';var _=require(_0x31be('0x0'));var moment=require('moment');var apiai=require(_0x31be('0x1'));var md5=require(_0x31be('0x2'));var utils=require('./utils');var logger=require(_0x31be('0x3'))(_0x31be('0x4'));var rpc={'chatMessage':require(_0x31be('0x5')),'openchannelMessage':require(_0x31be('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x31be('0x7')),'faxMessage':require(_0x31be('0x8'))};exports[_0x31be('0x9')]=function(_0x50dd46,_0x27170d){return function(_0x463b46){try{if(!_[_0x31be('0xa')](this[_0x31be('0xb')][_0x31be('0xc')])){logger[_0x31be('0xd')](_0x31be('0xe'),_0x50dd46,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x463b46[_0x31be('0xf')]();}var _0x5d9060={'ContactId':this['contact']['id'],'sentAt':moment()[_0x31be('0x10')](_0x31be('0x11')),'direction':_0x31be('0x12')};var _0x38d76b=this[_0x31be('0x13')];if(_0x38d76b===_0x31be('0x14')){_0x5d9060[_0x31be('0x15')]=this[_0x31be('0x16')]['id'];}else{_0x5d9060[_[_0x31be('0x17')](_0x38d76b)+_0x31be('0x18')]=this['account']['id'];}_0x5d9060[_[_0x31be('0x17')](_0x38d76b)+_0x31be('0x19')]=this[_0x31be('0xb')]['id'];if(this['interaction']['created']){var _0x2a6e10=_0x27170d[0x2];if(!_['isEmpty'](_0x2a6e10)){_0x5d9060[_0x31be('0x1a')]=utils[_0x31be('0x1b')](_0x2a6e10,this);return rpc[_0x38d76b+'Message'][_0x31be('0x1c')](_0x5d9060)[_0x31be('0x1d')](function(_0x515c7b){logger['info'](_0x31be('0xe'),_0x50dd46,_0x5d9060['body']);})[_0x31be('0x1e')](function(_0x52ebce){logger[_0x31be('0x1f')](_0x31be('0xe'),_0x50dd46,JSON[_0x31be('0x20')](_0x52ebce));})[_0x31be('0x21')](function(){logger[_0x31be('0xd')](_0x31be('0x22'),_0x50dd46);_0x463b46[_0x31be('0x23')]();});}else{logger[_0x31be('0xd')](_0x31be('0x24'),_0x50dd46);_0x463b46[_0x31be('0x23')]();}}else{var _0x1f0f8a=this;var _0xd184e4=apiai(_0x27170d[0x0],{'language':_0x27170d[0x1]||'en'});return _0xd184e4[_0x31be('0x25')](this['message'][_0x31be('0x1a')],{'sessionId':md5(this['interaction']['id'])})[_0x31be('0x1d')](function(_0x41a2cd){_0x1f0f8a[_0x31be('0x1a')]['dialogflow']=_0x41a2cd;_0x5d9060[_0x31be('0x1a')]=_0x41a2cd['result'][_0x31be('0x26')][_0x31be('0x27')];return rpc[_0x38d76b+_0x31be('0x28')][_0x31be('0x1c')](_0x5d9060)[_0x31be('0x1d')](function(_0x2dcab6){logger[_0x31be('0xd')](_0x31be('0xe'),_0x50dd46,_0x5d9060['body']);if(_0x41a2cd[_0x31be('0x29')][_0x31be('0x2a')][_0x31be('0x2b')]){_0x463b46[_0x31be('0xf')]();}else{_0x463b46[_0x31be('0x23')]();}})[_0x31be('0x1e')](function(_0x4b5dab){logger[_0x31be('0x1f')](_0x31be('0xe'),_0x50dd46,JSON['stringify'](_0x4b5dab));_0x463b46[_0x31be('0xf')]();});})['catch'](function(_0x1ba506){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x50dd46,_0x1ba506[_0x31be('0x2c')]);_0x463b46[_0x31be('0xf')]();});}}catch(_0x1cee40){logger[_0x31be('0x1f')]('[%s][DIALOGFLOW]\x20%s',_0x50dd46,JSON[_0x31be('0x20')](_0x1cee40));_0x463b46['stop']();}};}; \ No newline at end of file +var _0x04ae=['Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','isEmpty','body','Message','create','then','catch','error','stringify','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','textRequest','message','dialogflow','result','fulfillment','speech','metadata','endConversation','moment','apiai-promise','./utils','routing','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','UserId','info','[%s][DIALOGFLOW]\x20%s'];(function(_0x1382be,_0x49bc15){var _0x1cdb85=function(_0x5b14cc){while(--_0x5b14cc){_0x1382be['push'](_0x1382be['shift']());}};_0x1cdb85(++_0x49bc15);}(_0x04ae,0xf6));var _0xe04a=function(_0x1c3dd9,_0x22056b){_0x1c3dd9=_0x1c3dd9-0x0;var _0x5de0f7=_0x04ae[_0x1c3dd9];return _0x5de0f7;};'use strict';var _=require('lodash');var moment=require(_0xe04a('0x0'));var apiai=require(_0xe04a('0x1'));var md5=require('md5');var utils=require(_0xe04a('0x2'));var logger=require('../../../../config/logger')(_0xe04a('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xe04a('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xe04a('0x5')),'faxMessage':require(_0xe04a('0x6'))};exports[_0xe04a('0x7')]=function(_0x2a6c7b,_0x2a94ab){return function(_0x43051e){try{if(!_[_0xe04a('0x8')](this['interaction'][_0xe04a('0x9')])){logger[_0xe04a('0xa')](_0xe04a('0xb'),_0x2a6c7b,_0xe04a('0xc'));return _0x43051e[_0xe04a('0xd')]();}var _0x530d9f={'ContactId':this[_0xe04a('0xe')]['id'],'sentAt':moment()['format'](_0xe04a('0xf')),'direction':_0xe04a('0x10')};var _0x31784d=this[_0xe04a('0x11')];if(_0x31784d===_0xe04a('0x12')){_0x530d9f[_0xe04a('0x13')]=this[_0xe04a('0x14')]['id'];}else{_0x530d9f[_[_0xe04a('0x15')](_0x31784d)+_0xe04a('0x16')]=this[_0xe04a('0x14')]['id'];}_0x530d9f[_[_0xe04a('0x15')](_0x31784d)+_0xe04a('0x17')]=this[_0xe04a('0x18')]['id'];if(this[_0xe04a('0x18')]['created']){var _0x55469a=_0x2a94ab[0x2];if(!_[_0xe04a('0x19')](_0x55469a)){_0x530d9f[_0xe04a('0x1a')]=utils['getMustacheRender'](_0x55469a,this);return rpc[_0x31784d+_0xe04a('0x1b')][_0xe04a('0x1c')](_0x530d9f)[_0xe04a('0x1d')](function(_0x38aeae){logger[_0xe04a('0xa')](_0xe04a('0xb'),_0x2a6c7b,_0x530d9f['body']);})[_0xe04a('0x1e')](function(_0x3bceef){logger[_0xe04a('0x1f')](_0xe04a('0xb'),_0x2a6c7b,JSON[_0xe04a('0x20')](_0x3bceef));})['finally'](function(){logger[_0xe04a('0xa')](_0xe04a('0x21'),_0x2a6c7b);_0x43051e[_0xe04a('0x22')]();});}else{logger['info']('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x2a6c7b);_0x43051e[_0xe04a('0x22')]();}}else{var _0x578432=this;var _0x5726e8=apiai(_0x2a94ab[0x0],{'language':_0x2a94ab[0x1]||'en'});return _0x5726e8[_0xe04a('0x23')](this[_0xe04a('0x24')]['body'],{'sessionId':md5(this[_0xe04a('0x18')]['id'])})[_0xe04a('0x1d')](function(_0x48586d){_0x578432[_0xe04a('0x1a')][_0xe04a('0x25')]=_0x48586d;_0x530d9f[_0xe04a('0x1a')]=_0x48586d[_0xe04a('0x26')][_0xe04a('0x27')][_0xe04a('0x28')];return rpc[_0x31784d+_0xe04a('0x1b')][_0xe04a('0x1c')](_0x530d9f)[_0xe04a('0x1d')](function(_0x3d31b4){logger[_0xe04a('0xa')](_0xe04a('0xb'),_0x2a6c7b,_0x530d9f[_0xe04a('0x1a')]);if(_0x48586d['result'][_0xe04a('0x29')][_0xe04a('0x2a')]){_0x43051e[_0xe04a('0xd')]();}else{_0x43051e[_0xe04a('0x22')]();}})['catch'](function(_0x4c44ef){logger['error'](_0xe04a('0xb'),_0x2a6c7b,JSON[_0xe04a('0x20')](_0x4c44ef));_0x43051e[_0xe04a('0xd')]();});})[_0xe04a('0x1e')](function(_0x43782f){logger[_0xe04a('0x1f')](_0xe04a('0xb'),_0x2a6c7b,_0x43782f['message']);_0x43051e['next']();});}}catch(_0x1af3d2){logger[_0xe04a('0x1f')](_0xe04a('0xb'),_0x2a6c7b,JSON[_0xe04a('0x20')](_0x1af3d2));_0x43051e['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 557cd82..16dc1e1 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 _0x9d61=['join','stop','condition','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','string','priority\x20true\x20is\x20a\x20number','consequence','fromString','getMustacheRender','length','error','[%s][GOTOIF]\x20%s'];(function(_0x31ce72,_0xcbb6bf){var _0x4f12fc=function(_0x347d74){while(--_0x347d74){_0x31ce72['push'](_0x31ce72['shift']());}};_0x4f12fc(++_0xcbb6bf);}(_0x9d61,0x82));var _0x19d6=function(_0x2c7ee4,_0x358d80){_0x2c7ee4=_0x2c7ee4-0x0;var _0x3f6832=_0x9d61[_0x2c7ee4];return _0x3f6832;};'use strict';var schema=require(_0x19d6('0x0'));var _=require(_0x19d6('0x1'));var htmlToText=require(_0x19d6('0x2'));var utils=require(_0x19d6('0x3'));var logger=require(_0x19d6('0x4'))(_0x19d6('0x5'));var gotoif=schema({'condition':{'type':_0x19d6('0x6'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':'number','message':_0x19d6('0x7')},'priorityFalse':{'type':'number','message':'priority\x20false\x20is\x20a\x20number'}});exports[_0x19d6('0x8')]=function(_0x59f7c3,_0x259c7a){return function(_0x107423){try{var _0x58a426={'condition':htmlToText[_0x19d6('0x9')](utils[_0x19d6('0xa')](_0x259c7a[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x259c7a[0x1],'priorityFalse':_0x259c7a[0x2]};var _0x2d818f=gotoif[_0x19d6('0x0')](_0x58a426,{'typecast':!![]});if(_0x2d818f[_0x19d6('0xb')]){logger[_0x19d6('0xc')](_0x19d6('0xd'),_0x59f7c3,_['map'](_0x2d818f,'message')[_0x19d6('0xe')](',\x20'));_0x107423[_0x19d6('0xf')]();}else{try{var _0x13180e=eval('('+_0x58a426[_0x19d6('0x10')]+')');var _0x2a206c=_0x13180e?_0x58a426['priorityTrue']:_0x58a426[_0x19d6('0x11')];logger[_0x19d6('0x12')](_0x19d6('0x13'),_0x59f7c3,_0x58a426[_0x19d6('0x10')],_0x13180e,_0x2a206c||_0x19d6('0x14'));if(_0x2a206c){var _0x477c75=_[_0x19d6('0x15')](_0x107423['rules'](),{'p':_0x2a206c});if(_0x477c75>=0x0){logger['info']('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x59f7c3,_0x2a206c||_0x19d6('0x14'),_0x477c75);_0x107423[_0x19d6('0x14')](_0x477c75);}else{logger[_0x19d6('0x12')](_0x19d6('0x16'),_0x59f7c3,_0x2a206c||_0x19d6('0x14'));_0x107423[_0x19d6('0xf')]();}}else{_0x107423[_0x19d6('0x14')]();}}catch(_0x358e9b){logger[_0x19d6('0xc')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x59f7c3,_0x358e9b['message']);_0x107423[_0x19d6('0xf')]();}}}catch(_0x56f9a4){logger[_0x19d6('0xc')](_0x19d6('0xd'),_0x59f7c3,JSON[_0x19d6('0x17')](_0x56f9a4));_0x107423[_0x19d6('0xf')]();}};}; \ No newline at end of file +var _0xf830=['validate','error','[%s][GOTOIF]\x20%s','join','condition','priorityFalse','info','next','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','stop','stringify','lodash','html-to-text','../../../../config/logger','routing','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number','number','priority\x20false\x20is\x20a\x20number','consequence','getMustacheRender'];(function(_0x3327b3,_0x31acf6){var _0x2253f5=function(_0x4801c7){while(--_0x4801c7){_0x3327b3['push'](_0x3327b3['shift']());}};_0x2253f5(++_0x31acf6);}(_0xf830,0x146));var _0x0f83=function(_0x91a1,_0x48f789){_0x91a1=_0x91a1-0x0;var _0x2a5198=_0xf830[_0x91a1];return _0x2a5198;};'use strict';var schema=require('validate');var _=require(_0x0f83('0x0'));var htmlToText=require(_0x0f83('0x1'));var utils=require('./utils');var logger=require(_0x0f83('0x2'))(_0x0f83('0x3'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0x0f83('0x4')},'priorityTrue':{'type':'number','message':_0x0f83('0x5')},'priorityFalse':{'type':_0x0f83('0x6'),'message':_0x0f83('0x7')}});exports[_0x0f83('0x8')]=function(_0xed8df5,_0x2c31f7){return function(_0x542b56){try{var _0x42bcd1={'condition':htmlToText['fromString'](utils[_0x0f83('0x9')](_0x2c31f7[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x2c31f7[0x1],'priorityFalse':_0x2c31f7[0x2]};var _0x2eb593=gotoif[_0x0f83('0xa')](_0x42bcd1,{'typecast':!![]});if(_0x2eb593['length']){logger[_0x0f83('0xb')](_0x0f83('0xc'),_0xed8df5,_['map'](_0x2eb593,'message')[_0x0f83('0xd')](',\x20'));_0x542b56['stop']();}else{try{var _0x536c84=eval('('+_0x42bcd1[_0x0f83('0xe')]+')');var _0x36ce69=_0x536c84?_0x42bcd1['priorityTrue']:_0x42bcd1[_0x0f83('0xf')];logger[_0x0f83('0x10')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0xed8df5,_0x42bcd1['condition'],_0x536c84,_0x36ce69||_0x0f83('0x11'));if(_0x36ce69){var _0x5ece68=_['findIndex'](_0x542b56[_0x0f83('0x12')](),{'p':_0x36ce69});if(_0x5ece68>=0x0){logger['info'](_0x0f83('0x13'),_0xed8df5,_0x36ce69||_0x0f83('0x11'),_0x5ece68);_0x542b56[_0x0f83('0x11')](_0x5ece68);}else{logger[_0x0f83('0x10')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0xed8df5,_0x36ce69||'next');_0x542b56['stop']();}}else{_0x542b56[_0x0f83('0x11')]();}}catch(_0x28c442){logger['error'](_0x0f83('0x14'),_0xed8df5,_0x28c442[_0x0f83('0x15')]);_0x542b56[_0x0f83('0x16')]();}}}catch(_0x28d290){logger['error'](_0x0f83('0xc'),_0xed8df5,JSON[_0x0f83('0x17')](_0x28d290));_0x542b56[_0x0f83('0x16')]();}};}; \ 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 f5db004..90f9b00 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 _0x6e3c=['../../../../config/logger','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','validate','length','error','[%s][GOTOP]\x20%s','map','message','join','info','priority','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','next','stringify','stop','lodash'];(function(_0x58ff8c,_0x49a369){var _0x5a703a=function(_0x4bcc18){while(--_0x4bcc18){_0x58ff8c['push'](_0x58ff8c['shift']());}};_0x5a703a(++_0x49a369);}(_0x6e3c,0x84));var _0xc6e3=function(_0x973722,_0x442da3){_0x973722=_0x973722-0x0;var _0xf3e141=_0x6e3c[_0x973722];return _0xf3e141;};'use strict';var schema=require('validate');var _=require(_0xc6e3('0x0'));var logger=require(_0xc6e3('0x1'))('routing');var gotop=schema({'priority':{'type':_0xc6e3('0x2'),'required':!![],'message':_0xc6e3('0x3')}});exports[_0xc6e3('0x4')]=function(_0x392269,_0x414b8f){return function(_0x36cf75){try{var _0x335f6d={'priority':_0x414b8f[0x0]};var _0x352ead=gotop[_0xc6e3('0x5')](_0x335f6d,{'typecast':!![]});if(_0x352ead[_0xc6e3('0x6')]){logger[_0xc6e3('0x7')](_0xc6e3('0x8'),_0x392269,_[_0xc6e3('0x9')](_0x352ead,_0xc6e3('0xa'))[_0xc6e3('0xb')](',\x20'));_0x36cf75['stop']();}else{logger[_0xc6e3('0xc')]('[%s][GOTOP]\x20priority\x20%s',_0x392269,_0x335f6d[_0xc6e3('0xd')]);if(_0x335f6d[_0xc6e3('0xd')]){var _0x5bdfb0=_['findIndex'](_0x36cf75['rules'](),{'p':_0x335f6d[_0xc6e3('0xd')]});if(_0x5bdfb0>=0x0){logger[_0xc6e3('0xc')](_0xc6e3('0xe'),_0x392269,_0x335f6d[_0xc6e3('0xd')]||'next',_0x5bdfb0);_0x36cf75['next'](_0x5bdfb0);}else{logger[_0xc6e3('0xc')](_0xc6e3('0xf'),_0x392269,_0x335f6d[_0xc6e3('0xd')]||_0xc6e3('0x10'));_0x36cf75['stop']();}}else{_0x36cf75[_0xc6e3('0x10')]();}}}catch(_0x2a0896){logger[_0xc6e3('0x7')]('[%s][GOTOP]\x20%s',_0x392269,JSON[_0xc6e3('0x11')](_0x2a0896));_0x36cf75[_0xc6e3('0x12')]();}};}; \ No newline at end of file +var _0x5361=['findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','validate','lodash','../../../../config/logger','routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','error','[%s][GOTOP]\x20%s','map','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority'];(function(_0x2b06ea,_0x28ebec){var _0x4c3f99=function(_0x518dd6){while(--_0x518dd6){_0x2b06ea['push'](_0x2b06ea['shift']());}};_0x4c3f99(++_0x28ebec);}(_0x5361,0x8a));var _0x1536=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x5361[_0x243b59];return _0x3e1676;};'use strict';var schema=require(_0x1536('0x0'));var _=require(_0x1536('0x1'));var logger=require(_0x1536('0x2'))(_0x1536('0x3'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0x1536('0x4')}});exports['consequence']=function(_0x48341f,_0x164ec0){return function(_0x40869d){try{var _0x1b1752={'priority':_0x164ec0[0x0]};var _0x5c68b4=gotop[_0x1536('0x0')](_0x1b1752,{'typecast':!![]});if(_0x5c68b4['length']){logger[_0x1536('0x5')](_0x1536('0x6'),_0x48341f,_[_0x1536('0x7')](_0x5c68b4,_0x1536('0x8'))[_0x1536('0x9')](',\x20'));_0x40869d[_0x1536('0xa')]();}else{logger[_0x1536('0xb')](_0x1536('0xc'),_0x48341f,_0x1b1752[_0x1536('0xd')]);if(_0x1b1752[_0x1536('0xd')]){var _0x1f21fd=_[_0x1536('0xe')](_0x40869d[_0x1536('0xf')](),{'p':_0x1b1752[_0x1536('0xd')]});if(_0x1f21fd>=0x0){logger[_0x1536('0xb')](_0x1536('0x10'),_0x48341f,_0x1b1752[_0x1536('0xd')]||_0x1536('0x11'),_0x1f21fd);_0x40869d[_0x1536('0x11')](_0x1f21fd);}else{logger[_0x1536('0xb')](_0x1536('0x12'),_0x48341f,_0x1b1752[_0x1536('0xd')]||_0x1536('0x11'));_0x40869d[_0x1536('0xa')]();}}else{_0x40869d[_0x1536('0x11')]();}}}catch(_0x3baef3){logger['error']('[%s][GOTOP]\x20%s',_0x48341f,JSON['stringify'](_0x3baef3));_0x40869d[_0x1536('0xa')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index a3579b2..5bd68c3 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 _0x0db3=['AccountId','upperFirst','InteractionId','interaction','Message','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','getMustacheRender','contact','channel','chat','ChatWebsiteId','account'];(function(_0x4235ea,_0x4149d9){var _0x5bd767=function(_0x1b1840){while(--_0x1b1840){_0x4235ea['push'](_0x4235ea['shift']());}};_0x5bd767(++_0x4149d9);}(_0x0db3,0x19c));var _0x30db=function(_0xa85c43,_0x4f0de3){_0xa85c43=_0xa85c43-0x0;var _0x43f475=_0x0db3[_0xa85c43];return _0x43f475;};'use strict';var _=require('lodash');var utils=require(_0x30db('0x0'));var logger=require(_0x30db('0x1'))(_0x30db('0x2'));var rpc={'chatMessage':require(_0x30db('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x30db('0x4')),'smsMessage':require(_0x30db('0x5')),'faxMessage':require(_0x30db('0x6'))};exports['consequence']=function(_0x2f2ca4,_0x30a6ac){return function(_0x59dd16){try{var _0x18f5c6={'body':utils[_0x30db('0x7')](_0x30a6ac[0x0],this),'ContactId':this[_0x30db('0x8')]['id']};if(this[_0x30db('0x9')]===_0x30db('0xa')){_0x18f5c6[_0x30db('0xb')]=this[_0x30db('0xc')]['id'];}else{_0x18f5c6[_['upperFirst'](this[_0x30db('0x9')])+_0x30db('0xd')]=this[_0x30db('0xc')]['id'];}_0x18f5c6[_[_0x30db('0xe')](this[_0x30db('0x9')])+_0x30db('0xf')]=this[_0x30db('0x10')]['id'];if(rpc[this[_0x30db('0x9')]+_0x30db('0x11')]){return rpc[this[_0x30db('0x9')]+_0x30db('0x11')]['create'](_0x18f5c6)['then'](function(_0x22c121){logger['info'](_0x30db('0x12'),_0x2f2ca4,_0x18f5c6[_0x30db('0x13')]);_0x59dd16[_0x30db('0x14')]();})[_0x30db('0x15')](function(_0x4fae73){logger[_0x30db('0x16')](_0x30db('0x12'),_0x2f2ca4,JSON[_0x30db('0x17')](_0x4fae73));_0x59dd16['stop']();});}}catch(_0x1c204e){logger['error'](_0x30db('0x12'),_0x2f2ca4,JSON['stringify'](_0x1c204e));_0x59dd16[_0x30db('0x18')]();}};}; \ No newline at end of file +var _0x9815=['routing','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','contact','account','upperFirst','channel','AccountId','InteractionId','interaction','Message','info','body','next','catch','error','[%s][MESSAGE]\x20%s','stringify','stop','lodash','./utils','../../../../config/logger'];(function(_0xd91c7f,_0x16ab3c){var _0xf858b8=function(_0x6e222d){while(--_0x6e222d){_0xd91c7f['push'](_0xd91c7f['shift']());}};_0xf858b8(++_0x16ab3c);}(_0x9815,0x70));var _0x5981=function(_0x29a732,_0x3955f){_0x29a732=_0x29a732-0x0;var _0x6c8339=_0x9815[_0x29a732];return _0x6c8339;};'use strict';var _=require(_0x5981('0x0'));var utils=require(_0x5981('0x1'));var logger=require(_0x5981('0x2'))(_0x5981('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x5981('0x4')),'smsMessage':require(_0x5981('0x5')),'faxMessage':require(_0x5981('0x6'))};exports['consequence']=function(_0x96a134,_0x2ec00a){return function(_0x4e5833){try{var _0x1162aa={'body':utils['getMustacheRender'](_0x2ec00a[0x0],this),'ContactId':this[_0x5981('0x7')]['id']};if(this['channel']==='chat'){_0x1162aa['ChatWebsiteId']=this[_0x5981('0x8')]['id'];}else{_0x1162aa[_[_0x5981('0x9')](this[_0x5981('0xa')])+_0x5981('0xb')]=this[_0x5981('0x8')]['id'];}_0x1162aa[_[_0x5981('0x9')](this[_0x5981('0xa')])+_0x5981('0xc')]=this[_0x5981('0xd')]['id'];if(rpc[this['channel']+_0x5981('0xe')]){return rpc[this[_0x5981('0xa')]+_0x5981('0xe')]['create'](_0x1162aa)['then'](function(_0x136f49){logger[_0x5981('0xf')]('[%s][MESSAGE]\x20%s',_0x96a134,_0x1162aa[_0x5981('0x10')]);_0x4e5833[_0x5981('0x11')]();})[_0x5981('0x12')](function(_0x3defc2){logger[_0x5981('0x13')](_0x5981('0x14'),_0x96a134,JSON[_0x5981('0x15')](_0x3defc2));_0x4e5833[_0x5981('0x16')]();});}}catch(_0x401c5c){logger[_0x5981('0x13')]('[%s][MESSAGE]\x20%s',_0x96a134,JSON['stringify'](_0x401c5c));_0x4e5833[_0x5981('0x16')]();}};}; \ 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 b6fc8bf..722859c 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 _0x8152=['../../../../config/logger','routing','info','next','[%s][NOOP]\x20%s','./utils'];(function(_0x3da144,_0x578cbd){var _0x13fdc7=function(_0x2d2919){while(--_0x2d2919){_0x3da144['push'](_0x3da144['shift']());}};_0x13fdc7(++_0x578cbd);}(_0x8152,0x16d));var _0x2815=function(_0xf8f9d2,_0x2dc04d){_0xf8f9d2=_0xf8f9d2-0x0;var _0x387e38=_0x8152[_0xf8f9d2];return _0x387e38;};'use strict';var utils=require(_0x2815('0x0'));var logger=require(_0x2815('0x1'))(_0x2815('0x2'));exports['consequence']=function(_0x3370f6,_0x3b59b5){return function(_0x13d746){try{logger[_0x2815('0x3')]('[%s][NOOP]\x20%s',_0x3370f6,utils['getMustacheRender'](_0x3b59b5[0x0],this));_0x13d746[_0x2815('0x4')]();}catch(_0x4c8e19){logger['error'](_0x2815('0x5'),_0x3370f6,JSON['stringify'](_0x4c8e19));_0x13d746['stop']();}};}; \ No newline at end of file +var _0x1ae3=['consequence','[%s][NOOP]\x20%s','getMustacheRender','next','error','stringify','stop','./utils','../../../../config/logger'];(function(_0x1ac558,_0x52337e){var _0x34e5f8=function(_0x421dcb){while(--_0x421dcb){_0x1ac558['push'](_0x1ac558['shift']());}};_0x34e5f8(++_0x52337e);}(_0x1ae3,0x139));var _0x31ae=function(_0x4c5d3f,_0x3db106){_0x4c5d3f=_0x4c5d3f-0x0;var _0x4ff519=_0x1ae3[_0x4c5d3f];return _0x4ff519;};'use strict';var utils=require(_0x31ae('0x0'));var logger=require(_0x31ae('0x1'))('routing');exports[_0x31ae('0x2')]=function(_0x3ba253,_0x21cada){return function(_0x293580){try{logger['info'](_0x31ae('0x3'),_0x3ba253,utils[_0x31ae('0x4')](_0x21cada[0x0],this));_0x293580[_0x31ae('0x5')]();}catch(_0x247c16){logger[_0x31ae('0x6')](_0x31ae('0x3'),_0x3ba253,JSON[_0x31ae('0x7')](_0x247c16));_0x293580[_0x31ae('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 c51ddf2..34e0d82 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 _0x441a=['[%s][QUEUE]\x20ROUTING\x20STOPPED','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','validate','lodash','util','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','from','account','format','%sQueuesWaitingInteractions','save','remove','pick','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','string','timeout\x20is\x20a\x20number','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','QueueId','channel','InteractionId','interaction','upperFirst','MessageId','message','chat','WebsiteId','info','name','QueueReport','create','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','waiting','[%s][END:QUEUE][NAME:%s]','catch','toLowerCase','length','[%s][QUEUE]\x20%s','map','stop','find','Queues','timeout','rules','close'];(function(_0x22f75e,_0x4a9e06){var _0x1f6ab3=function(_0x1479d4){while(--_0x1479d4){_0x22f75e['push'](_0x22f75e['shift']());}};_0x1f6ab3(++_0x4a9e06);}(_0x441a,0x1d5));var _0xa441=function(_0x43a37c,_0x25a567){_0x43a37c=_0x43a37c-0x0;var _0x5d1d40=_0x441a[_0x43a37c];return _0x5d1d40;};'use strict';var schema=require(_0xa441('0x0'));var _=require(_0xa441('0x1'));var util=require(_0xa441('0x2'));var seqqueue=require('seq-queue');var moment=require('moment');var Redis=require('ioredis');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xa441('0x3'));var strategy=require(_0xa441('0x4'));config[_0xa441('0x5')]=_[_0xa441('0x6')](config[_0xa441('0x5')],{'host':_0xa441('0x7'),'port':0x18eb});var io=require(_0xa441('0x8'))(new Redis(config[_0xa441('0x5')]));var attributes=['id',_0xa441('0x9'),'account','queue',_0xa441('0xa'),'joinAt'];function emit(_0x4e7824,_0x16b5b3,_0x1ba1ec){io['to'](_0x4e7824)['emit'](_0x16b5b3,_0x1ba1ec);}function emitChannelQueueInteraction(_0x203d8b,_0x36afec,_0x204fc9,_0x281c73,_0x966ac9,_0x256fc7,_0x421ebd,_0x35cfaf){_0x204fc9[_0xa441('0x9')]=_0x35cfaf;_0x204fc9['queue']=_0x36afec;_0x204fc9[_0xa441('0xb')]=_0x281c73;_0x204fc9['id']=_0x966ac9;if(_0x256fc7){_0x421ebd[util['format']('%sQueuesWaitingInteractions',_0x203d8b)][_0x966ac9]=_['pick'](_0x204fc9,attributes);}else{delete _0x421ebd[util[_0xa441('0xc')](_0xa441('0xd'),_0x203d8b)][_0x966ac9];}emit(util['format']('%s:queue:%s',_0x203d8b,_0x36afec),util[_0xa441('0xc')]('%s_queue_waiting_interaction:%s',_0x203d8b,_0x256fc7?_0xa441('0xe'):_0xa441('0xf')),_[_0xa441('0x10')](_0x204fc9,attributes));}var rpc={'openchannelQueueReport':require(_0xa441('0x11')),'mailQueueReport':require(_0xa441('0x12')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0xa441('0x13')),'faxQueueReport':require(_0xa441('0x14'))};var queue=schema({'name':{'type':_0xa441('0x15'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':_0xa441('0x16')}});function startRouting(_0x270411,_0x32609b,_0x444958,_0x33d97a){if(_0x270411&&_0x32609b&&_0x444958){_0x32609b['waiting']+=0x1;var _0x2da773={'uniqueid':_0x270411,'from':_0x444958[_0xa441('0x17')]?_0x444958[_0xa441('0x17')]['from']:'','joinAt':moment()[_0xa441('0xc')](_0xa441('0x18')),'ContactId':_0x444958[_0xa441('0x19')]?_0x444958[_0xa441('0x19')]['id']:null,'ListId':_0x444958[_0xa441('0x1a')]?_0x444958[_0xa441('0x1a')]['id']:null};_0x2da773[_['upperFirst'](_0x444958['channel'])+_0xa441('0x1b')]=_0x32609b['id']||null;_0x2da773[_['upperFirst'](_0x444958[_0xa441('0x1c')])+_0xa441('0x1d')]=_0x444958[_0xa441('0x1e')]?_0x444958[_0xa441('0x1e')]['id']:null;_0x2da773[_[_0xa441('0x1f')](_0x444958[_0xa441('0x1c')])+_0xa441('0x20')]=_0x444958[_0xa441('0x21')]?_0x444958[_0xa441('0x21')]['id']:null;_0x2da773[_[_0xa441('0x1f')](_0x444958[_0xa441('0x1c')])+(_0x444958['channel']!==_0xa441('0x22')?'AccountId':_0xa441('0x23'))]=_0x444958[_0xa441('0xb')]?_0x444958[_0xa441('0xb')]['id']:null;logger[_0xa441('0x24')](util[_0xa441('0xc')]('[%s][START:QUEUE][NAME:%s]',_0x270411,_0x32609b[_0xa441('0x25')]));emitChannelQueueInteraction(_0x444958[_0xa441('0x1c')],_0x32609b[_0xa441('0x25')],_0x2da773,_0x444958['account'][_0xa441('0x25')],_0x444958[_0xa441('0x21')]['id'],!![],_0x33d97a,_0x32609b['id']);if(rpc[_0x444958[_0xa441('0x1c')]+_0xa441('0x26')]){return rpc[_0x444958[_0xa441('0x1c')]+_0xa441('0x26')][_0xa441('0x27')](_0x2da773)['catch'](function(_0x37568e){logger[_0xa441('0x28')](_0xa441('0x29'));});}}}function stopRouting(_0xbf4cfc,_0x4cd9cc,_0x3cc089,_0x489247){if(_0xbf4cfc&&_0x4cd9cc){_0x4cd9cc['waiting']-=0x1;var _0x16c83b={'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0xa441('0xc')](_0xa441('0x18')),'reason':_0xa441('0x2a')};logger[_0xa441('0x24')](util[_0xa441('0xc')](_0xa441('0x2b'),_0xbf4cfc,_0x4cd9cc[_0xa441('0x25')]));emitChannelQueueInteraction(_0x3cc089[_0xa441('0x1c')],_0x4cd9cc[_0xa441('0x25')],_0x3cc089[_0xa441('0x17')],_0x3cc089[_0xa441('0xb')][_0xa441('0x25')],_0x3cc089[_0xa441('0x21')]['id'],![],_0x489247,_0x4cd9cc['id']);if(rpc[_0x3cc089[_0xa441('0x1c')]+_0xa441('0x26')]){return rpc[_0x3cc089[_0xa441('0x1c')]+_0xa441('0x26')][_0xa441('0x2c')](_0xbf4cfc,_0x16c83b)['catch'](function(_0x14fa10){logger['error'](_0xa441('0x2d'));});}}}function endRouting(_0x333110,_0x251649,_0x58701b,_0x4c5e1f){if(_0x333110&&_0x251649){_0x251649[_0xa441('0x2e')]-=0x1;var _0x442819={'leaveAt':moment()[_0xa441('0xc')](_0xa441('0x18')),'exitAt':moment()['format'](_0xa441('0x18')),'reason':'timeout'};logger[_0xa441('0x24')](util[_0xa441('0xc')](_0xa441('0x2f'),_0x333110,_0x251649[_0xa441('0x25')]));emitChannelQueueInteraction(_0x58701b[_0xa441('0x1c')],_0x251649[_0xa441('0x25')],_0x58701b['body'],_0x58701b['account'][_0xa441('0x25')],_0x58701b[_0xa441('0x21')]['id'],![],_0x4c5e1f);if(rpc[_0x58701b[_0xa441('0x1c')]+_0xa441('0x26')]){return rpc[_0x58701b[_0xa441('0x1c')]+_0xa441('0x26')][_0xa441('0x2c')](_0x333110,_0x442819)[_0xa441('0x30')](function(_0x239168){logger[_0xa441('0x28')]('update\x20queue\x20report');});}}}function handleFindQueue(_0xcf0690){return function(_0x217df2){return _0x217df2[_0xa441('0x25')][_0xa441('0x31')]()===_0xcf0690[_0xa441('0x31')]();};}exports['consequence']=function(_0x4992b2,_0x49fcdb,_0x3d72d2,_0x2a4d7d){return function(_0x198b09){try{var _0x23fe59={'name':_0x49fcdb[0x0],'timeout':_0x49fcdb[0x1]};var _0x2552f9=queue[_0xa441('0x0')](_0x23fe59,{'typecast':!![]});if(_0x2552f9[_0xa441('0x32')]){logger[_0xa441('0x28')](_0xa441('0x33'),_0x4992b2,_[_0xa441('0x34')](_0x2552f9,_0xa441('0x21'))['join'](',\x20'));_0x198b09[_0xa441('0x35')]();}else{var _0x4c80ae=_[_0xa441('0x36')](_0x3d72d2[_0x2a4d7d[_0xa441('0x1c')]+_0xa441('0x37')],handleFindQueue(_0x23fe59['name']));if(_0x4c80ae){startRouting(_0x4992b2,_0x4c80ae,_0x2a4d7d,_0x3d72d2);var _0x2552a6=(_0x4c80ae[_0xa441('0x38')]||0xa)*0x3e8;var _0x58a6ae=(_0x23fe59[_0xa441('0x38')]||0x14)*0x3e8;var _0x1d2fcb,_0x2b3317;if(_0x2552a6>_0x58a6ae){_0x58a6ae=_0x2552a6;}var _0x5c57a1=seqqueue['createQueue'](_0x2552a6);_0x5c57a1['id']=_0x4992b2;_0x5c57a1['atimeout']=_0x2552a6;_0x5c57a1['qtimeout']=_0x58a6ae;_0x5c57a1['channel']=_0x2a4d7d[_0xa441('0x1c')];_0x3d72d2[_0xa441('0x39')][_0x4992b2]['on']('end',function(){stopRouting(_0x4992b2,_0x4c80ae,_0x2a4d7d,_0x3d72d2);_0x5c57a1[_0xa441('0x3a')](!![]);clearTimeout(_0x1d2fcb);_0x1d2fcb=undefined;if(_0x3d72d2[_0xa441('0x39')][_0x4992b2]){delete _0x3d72d2[_0xa441('0x39')][_0x4992b2];}logger['info'](_0xa441('0x3b'),_0x4992b2);_0x198b09[_0xa441('0x35')]();});_0x1d2fcb=setTimeout(function(){endRouting(_0x4992b2,_0x4c80ae,_0x2a4d7d,_0x3d72d2);clearTimeout(_0x1d2fcb);_0x5c57a1[_0xa441('0x3a')](!![]);logger['info']('[%s][QUEUE]\x20ROUTING\x20END',_0x4992b2);_0x198b09[_0xa441('0x3c')]();},_0x58a6ae);switch(_0x4c80ae[_0xa441('0x3d')]){case _0xa441('0x3e'):strategy['rrmemory'](_0x5c57a1,_0x4c80ae,_0x3d72d2,_0x2a4d7d);break;default:strategy[_0xa441('0x3f')](_0x5c57a1,_0x4c80ae,_0x3d72d2,_0x2a4d7d);}}else{logger[_0xa441('0x28')](_0xa441('0x40'),_0x4992b2,_0x23fe59[_0xa441('0x25')]);_0x198b09[_0xa441('0x35')]();}}}catch(_0x4b7d65){console[_0xa441('0x41')](_0x4b7d65);logger[_0xa441('0x28')](_0xa441('0x33'),_0x4992b2,_0x4b7d65['stack']);_0x198b09[_0xa441('0x35')]();}};}; \ No newline at end of file +var _0x38dd=['timeout','createQueue','atimeout','rules','close','[%s][QUEUE]\x20ROUTING\x20STOPPED','[%s][QUEUE]\x20ROUTING\x20END','strategy','rrmemory','beepall','log','stack','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','emit','queue','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','string','timeout\x20is\x20a\x20number','waiting','body','from','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','QueueId','upperFirst','InteractionId','interaction','MessageId','message','AccountId','WebsiteId','account','[%s][START:QUEUE][NAME:%s]','name','QueueReport','catch','error','create\x20queue\x20report','accepted','info','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','stop','find','Queues'];(function(_0x4ce028,_0x526d4b){var _0x583d0c=function(_0x874178){while(--_0x874178){_0x4ce028['push'](_0x4ce028['shift']());}};_0x583d0c(++_0x526d4b);}(_0x38dd,0xf0));var _0xd38d=function(_0x57da0a,_0x284aed){_0x57da0a=_0x57da0a-0x0;var _0x3145d5=_0x38dd[_0x57da0a];return _0x3145d5;};'use strict';var schema=require(_0xd38d('0x0'));var _=require(_0xd38d('0x1'));var util=require(_0xd38d('0x2'));var seqqueue=require(_0xd38d('0x3'));var moment=require(_0xd38d('0x4'));var Redis=require(_0xd38d('0x5'));var config=require(_0xd38d('0x6'));var logger=require(_0xd38d('0x7'))(_0xd38d('0x8'));var strategy=require(_0xd38d('0x9'));config[_0xd38d('0xa')]=_[_0xd38d('0xb')](config[_0xd38d('0xa')],{'host':_0xd38d('0xc'),'port':0x18eb});var io=require(_0xd38d('0xd'))(new Redis(config[_0xd38d('0xa')]));var attributes=['id',_0xd38d('0xe'),'account','queue','from','joinAt'];function emit(_0x554112,_0x36075b,_0x16a6b5){io['to'](_0x554112)[_0xd38d('0xf')](_0x36075b,_0x16a6b5);}function emitChannelQueueInteraction(_0x1a478f,_0x350802,_0x217b05,_0x346485,_0x31ffd1,_0x4de3b9,_0x5bd122,_0x4fd549){_0x217b05['queue_id']=_0x4fd549;_0x217b05[_0xd38d('0x10')]=_0x350802;_0x217b05['account']=_0x346485;_0x217b05['id']=_0x31ffd1;if(_0x4de3b9){_0x5bd122[util[_0xd38d('0x11')](_0xd38d('0x12'),_0x1a478f)][_0x31ffd1]=_[_0xd38d('0x13')](_0x217b05,attributes);}else{delete _0x5bd122[util['format'](_0xd38d('0x12'),_0x1a478f)][_0x31ffd1];}emit(util[_0xd38d('0x11')](_0xd38d('0x14'),_0x1a478f,_0x350802),util['format']('%s_queue_waiting_interaction:%s',_0x1a478f,_0x4de3b9?_0xd38d('0x15'):_0xd38d('0x16')),_['pick'](_0x217b05,attributes));}var rpc={'openchannelQueueReport':require(_0xd38d('0x17')),'mailQueueReport':require(_0xd38d('0x18')),'chatQueueReport':require(_0xd38d('0x19')),'smsQueueReport':require(_0xd38d('0x1a')),'faxQueueReport':require(_0xd38d('0x1b'))};var queue=schema({'name':{'type':_0xd38d('0x1c'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':_0xd38d('0x1d')}});function startRouting(_0x53a0d1,_0x1e0880,_0x42fdaa,_0x2fdd53){if(_0x53a0d1&&_0x1e0880&&_0x42fdaa){_0x1e0880[_0xd38d('0x1e')]+=0x1;var _0x494ec={'uniqueid':_0x53a0d1,'from':_0x42fdaa['body']?_0x42fdaa[_0xd38d('0x1f')][_0xd38d('0x20')]:'','joinAt':moment()[_0xd38d('0x11')](_0xd38d('0x21')),'ContactId':_0x42fdaa[_0xd38d('0x22')]?_0x42fdaa[_0xd38d('0x22')]['id']:null,'ListId':_0x42fdaa[_0xd38d('0x23')]?_0x42fdaa[_0xd38d('0x23')]['id']:null};_0x494ec[_['upperFirst'](_0x42fdaa[_0xd38d('0x24')])+_0xd38d('0x25')]=_0x1e0880['id']||null;_0x494ec[_[_0xd38d('0x26')](_0x42fdaa[_0xd38d('0x24')])+_0xd38d('0x27')]=_0x42fdaa['interaction']?_0x42fdaa[_0xd38d('0x28')]['id']:null;_0x494ec[_['upperFirst'](_0x42fdaa[_0xd38d('0x24')])+_0xd38d('0x29')]=_0x42fdaa['message']?_0x42fdaa[_0xd38d('0x2a')]['id']:null;_0x494ec[_['upperFirst'](_0x42fdaa[_0xd38d('0x24')])+(_0x42fdaa[_0xd38d('0x24')]!=='chat'?_0xd38d('0x2b'):_0xd38d('0x2c'))]=_0x42fdaa[_0xd38d('0x2d')]?_0x42fdaa[_0xd38d('0x2d')]['id']:null;logger['info'](util[_0xd38d('0x11')](_0xd38d('0x2e'),_0x53a0d1,_0x1e0880[_0xd38d('0x2f')]));emitChannelQueueInteraction(_0x42fdaa[_0xd38d('0x24')],_0x1e0880[_0xd38d('0x2f')],_0x494ec,_0x42fdaa[_0xd38d('0x2d')]['name'],_0x42fdaa['message']['id'],!![],_0x2fdd53,_0x1e0880['id']);if(rpc[_0x42fdaa['channel']+_0xd38d('0x30')]){return rpc[_0x42fdaa[_0xd38d('0x24')]+'QueueReport']['create'](_0x494ec)[_0xd38d('0x31')](function(_0x36d73d){logger[_0xd38d('0x32')](_0xd38d('0x33'));});}}}function stopRouting(_0x10f672,_0x2f355e,_0x320374,_0x1ce0bb){if(_0x10f672&&_0x2f355e){_0x2f355e[_0xd38d('0x1e')]-=0x1;var _0x4e1232={'leaveAt':moment()['format'](_0xd38d('0x21')),'acceptAt':moment()['format'](_0xd38d('0x21')),'reason':_0xd38d('0x34')};logger[_0xd38d('0x35')](util[_0xd38d('0x11')](_0xd38d('0x36'),_0x10f672,_0x2f355e[_0xd38d('0x2f')]));emitChannelQueueInteraction(_0x320374[_0xd38d('0x24')],_0x2f355e[_0xd38d('0x2f')],_0x320374[_0xd38d('0x1f')],_0x320374['account'][_0xd38d('0x2f')],_0x320374[_0xd38d('0x2a')]['id'],![],_0x1ce0bb,_0x2f355e['id']);if(rpc[_0x320374[_0xd38d('0x24')]+_0xd38d('0x30')]){return rpc[_0x320374['channel']+_0xd38d('0x30')][_0xd38d('0x37')](_0x10f672,_0x4e1232)[_0xd38d('0x31')](function(_0x2742be){logger[_0xd38d('0x32')]('update\x20queue\x20report');});}}}function endRouting(_0x2a114b,_0x4745f5,_0x2ec233,_0x2c05f1){if(_0x2a114b&&_0x4745f5){_0x4745f5[_0xd38d('0x1e')]-=0x1;var _0x4f3cde={'leaveAt':moment()[_0xd38d('0x11')](_0xd38d('0x21')),'exitAt':moment()[_0xd38d('0x11')](_0xd38d('0x21')),'reason':'timeout'};logger[_0xd38d('0x35')](util[_0xd38d('0x11')]('[%s][END:QUEUE][NAME:%s]',_0x2a114b,_0x4745f5[_0xd38d('0x2f')]));emitChannelQueueInteraction(_0x2ec233[_0xd38d('0x24')],_0x4745f5[_0xd38d('0x2f')],_0x2ec233['body'],_0x2ec233[_0xd38d('0x2d')][_0xd38d('0x2f')],_0x2ec233[_0xd38d('0x2a')]['id'],![],_0x2c05f1);if(rpc[_0x2ec233[_0xd38d('0x24')]+_0xd38d('0x30')]){return rpc[_0x2ec233[_0xd38d('0x24')]+_0xd38d('0x30')][_0xd38d('0x37')](_0x2a114b,_0x4f3cde)[_0xd38d('0x31')](function(_0x1f4a79){logger[_0xd38d('0x32')](_0xd38d('0x38'));});}}}function handleFindQueue(_0x17c595){return function(_0x4a531c){return _0x4a531c[_0xd38d('0x2f')][_0xd38d('0x39')]()===_0x17c595['toLowerCase']();};}exports[_0xd38d('0x3a')]=function(_0x513584,_0x20f20c,_0x46d10f,_0x433985){return function(_0x2de1e7){try{var _0x52b77c={'name':_0x20f20c[0x0],'timeout':_0x20f20c[0x1]};var _0x4d2973=queue[_0xd38d('0x0')](_0x52b77c,{'typecast':!![]});if(_0x4d2973[_0xd38d('0x3b')]){logger[_0xd38d('0x32')](_0xd38d('0x3c'),_0x513584,_['map'](_0x4d2973,'message')['join'](',\x20'));_0x2de1e7[_0xd38d('0x3d')]();}else{var _0x22fcb6=_[_0xd38d('0x3e')](_0x46d10f[_0x433985[_0xd38d('0x24')]+_0xd38d('0x3f')],handleFindQueue(_0x52b77c[_0xd38d('0x2f')]));if(_0x22fcb6){startRouting(_0x513584,_0x22fcb6,_0x433985,_0x46d10f);var _0x46a179=(_0x22fcb6[_0xd38d('0x40')]||0xa)*0x3e8;var _0x4df93f=(_0x52b77c[_0xd38d('0x40')]||0x14)*0x3e8;var _0x3b44d5,_0x341814;if(_0x46a179>_0x4df93f){_0x4df93f=_0x46a179;}var _0x530e39=seqqueue[_0xd38d('0x41')](_0x46a179);_0x530e39['id']=_0x513584;_0x530e39[_0xd38d('0x42')]=_0x46a179;_0x530e39['qtimeout']=_0x4df93f;_0x530e39[_0xd38d('0x24')]=_0x433985[_0xd38d('0x24')];_0x46d10f[_0xd38d('0x43')][_0x513584]['on']('end',function(){stopRouting(_0x513584,_0x22fcb6,_0x433985,_0x46d10f);_0x530e39[_0xd38d('0x44')](!![]);clearTimeout(_0x3b44d5);_0x3b44d5=undefined;if(_0x46d10f[_0xd38d('0x43')][_0x513584]){delete _0x46d10f[_0xd38d('0x43')][_0x513584];}logger[_0xd38d('0x35')](_0xd38d('0x45'),_0x513584);_0x2de1e7[_0xd38d('0x3d')]();});_0x3b44d5=setTimeout(function(){endRouting(_0x513584,_0x22fcb6,_0x433985,_0x46d10f);clearTimeout(_0x3b44d5);_0x530e39['close'](!![]);logger['info'](_0xd38d('0x46'),_0x513584);_0x2de1e7['next']();},_0x4df93f);switch(_0x22fcb6[_0xd38d('0x47')]){case _0xd38d('0x48'):strategy[_0xd38d('0x48')](_0x530e39,_0x22fcb6,_0x46d10f,_0x433985);break;default:strategy[_0xd38d('0x49')](_0x530e39,_0x22fcb6,_0x46d10f,_0x433985);}}else{logger[_0xd38d('0x32')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x513584,_0x52b77c[_0xd38d('0x2f')]);_0x2de1e7[_0xd38d('0x3d')]();}}}catch(_0xc95546){console[_0xd38d('0x4a')](_0xc95546);logger[_0xd38d('0x32')](_0xd38d('0x3c'),_0x513584,_0xc95546[_0xd38d('0x4b')]);_0x2de1e7[_0xd38d('0x3d')]();}};}; \ 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 6d2f54b..f85702a 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 _0xdc69=['forcedOwnership','isAgentAvailable','realtime','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busy','busyQueue','STOP','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','notificationId','squeue','agent','push','handleRun','timeout','handleTimeout','bind','drained','handleDrained','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','routing'];(function(_0x30c7c5,_0x168208){var _0x29e24e=function(_0x427d3e){while(--_0x427d3e){_0x30c7c5['push'](_0x30c7c5['shift']());}};_0x29e24e(++_0x168208);}(_0xdc69,0x177));var _0x9dc6=function(_0x15af0f,_0x5454ce){_0x15af0f=_0x15af0f-0x0;var _0x2bd1cb=_0xdc69[_0x15af0f];return _0x2bd1cb;};'use strict';var _=require(_0x9dc6('0x0'));var uuid=require(_0x9dc6('0x1'));var util=require(_0x9dc6('0x2'));var logger=require(_0x9dc6('0x3'))('routing');var Agent=function(_0x4492d2,_0x1ede0c,_0xa79b2c,_0x5b1e9){this[_0x9dc6('0x4')]=uuid['v4']();this[_0x9dc6('0x5')]=_0x4492d2;this[_0x9dc6('0x6')]=_0x1ede0c;this['realtime']=_0xa79b2c;this['routing']=_0x5b1e9;this[_0x9dc6('0x5')][_0x9dc6('0x7')](this[_0x9dc6('0x8')]['bind'](this),this['handleTimeout']['bind'](this));this[_0x9dc6('0x5')]['on'](_0x9dc6('0x9'),this[_0x9dc6('0xa')][_0x9dc6('0xb')](this));this[_0x9dc6('0x5')]['on'](_0x9dc6('0xc'),this[_0x9dc6('0xd')][_0x9dc6('0xb')](this));};Agent[_0x9dc6('0xe')][_0x9dc6('0x7')]=function(){this['squeue'][_0x9dc6('0x7')](this['handleRun'][_0x9dc6('0xb')](this),this[_0x9dc6('0xa')][_0x9dc6('0xb')](this));};Agent[_0x9dc6('0xe')][_0x9dc6('0xd')]=function(){this[_0x9dc6('0xa')](!![]);};Agent[_0x9dc6('0xe')][_0x9dc6('0x8')]=function(_0x89566){logger[_0x9dc6('0xf')](_0x9dc6('0x10'),this[_0x9dc6('0x5')]['id'],this['agent']['id']);if(_[_0x9dc6('0x11')](this['realtime'][_0x9dc6('0x12')][this[_0x9dc6('0x6')]['id']])){logger[_0x9dc6('0xf')](_0x9dc6('0x13'),this[_0x9dc6('0x5')]['id'],this[_0x9dc6('0x6')]['id']);setTimeout(this['push'][_0x9dc6('0xb')](this),0x3e8);}else{if(this[_0x9dc6('0x14')][_0x9dc6('0x15')]||util[_0x9dc6('0x16')](this[_0x9dc6('0x5')]['id'],this[_0x9dc6('0x17')][_0x9dc6('0x12')][this[_0x9dc6('0x6')]['id']],this[_0x9dc6('0x5')]['channel'],![])){this[_0x9dc6('0x17')]['agents'][this['agent']['id']]['busy']=!![];this[_0x9dc6('0x17')][_0x9dc6('0x12')][this['agent']['id']]['busyQueue']=undefined;util[_0x9dc6('0x18')](this['notificationId'],this[_0x9dc6('0x5')]['id'],this[_0x9dc6('0x17')][_0x9dc6('0x12')][this['agent']['id']],null,this[_0x9dc6('0x14')]);util[_0x9dc6('0x19')](this[_0x9dc6('0x5')]['id'],this[_0x9dc6('0x17')]['agents'][this[_0x9dc6('0x6')]['id']],_0x9dc6('0x1a')+(this[_0x9dc6('0x14')][_0x9dc6('0x15')]?_0x9dc6('0x1b'):''));}else{logger[_0x9dc6('0xf')](_0x9dc6('0x1c'),this[_0x9dc6('0x5')]['id'],this[_0x9dc6('0x6')]['id']);setTimeout(this[_0x9dc6('0x7')][_0x9dc6('0xb')](this),0x3e8);}}};Agent[_0x9dc6('0xe')][_0x9dc6('0xa')]=function(_0x54a197){if(_[_0x9dc6('0x11')](this[_0x9dc6('0x17')][_0x9dc6('0x12')][this[_0x9dc6('0x6')]['id']])){return logger['info'](_0x9dc6('0x13'),this[_0x9dc6('0x5')]['id'],this[_0x9dc6('0x6')]['id']);}else{logger[_0x9dc6('0xf')](_0x9dc6('0x1d'),this[_0x9dc6('0x5')]['id'],this[_0x9dc6('0x6')]['id']);util[_0x9dc6('0x1e')](this[_0x9dc6('0x4')],this[_0x9dc6('0x5')]['id'],this[_0x9dc6('0x17')][_0x9dc6('0x12')][this[_0x9dc6('0x6')]['id']],null,this[_0x9dc6('0x14')]);this['realtime']['agents'][this[_0x9dc6('0x6')]['id']][_0x9dc6('0x1f')]=![];this[_0x9dc6('0x17')][_0x9dc6('0x12')][this[_0x9dc6('0x6')]['id']][_0x9dc6('0x20')]=undefined;util[_0x9dc6('0x19')](this[_0x9dc6('0x5')]['id'],this[_0x9dc6('0x17')]['agents'][this['agent']['id']],_0x54a197?_0x9dc6('0x21'):_0x9dc6('0x22'));}if(!_0x54a197){setTimeout(this['push'][_0x9dc6('0xb')](this),0x3e8);}};function agent(_0x3f735a,_0xf02080,_0x313c33,_0x32d605){return new Agent(_0x3f735a,_0xf02080,_0x313c33,_0x32d605);}module[_0x9dc6('0x23')]=agent; \ No newline at end of file +var _0xc510=['busyQueue','writeLog','RINGING',':FORCED','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','TIMEOUT','exports','lodash','uuid','../../../../../config/logger','routing','notificationId','squeue','push','handleRun','bind','timeout','handleTimeout','drained','handleDrained','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','realtime','agent','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','agents','channel','busy'];(function(_0x4caa76,_0x969287){var _0x1faf4c=function(_0x328c00){while(--_0x328c00){_0x4caa76['push'](_0x4caa76['shift']());}};_0x1faf4c(++_0x969287);}(_0xc510,0x1a8));var _0x0c51=function(_0x222c59,_0x40783f){_0x222c59=_0x222c59-0x0;var _0x1b9ee3=_0xc510[_0x222c59];return _0x1b9ee3;};'use strict';var _=require(_0x0c51('0x0'));var uuid=require(_0x0c51('0x1'));var util=require('./util');var logger=require(_0x0c51('0x2'))(_0x0c51('0x3'));var Agent=function(_0x4251b8,_0x9a4b8c,_0x386b57,_0xddc3c4){this[_0x0c51('0x4')]=uuid['v4']();this[_0x0c51('0x5')]=_0x4251b8;this['agent']=_0x9a4b8c;this['realtime']=_0x386b57;this['routing']=_0xddc3c4;this[_0x0c51('0x5')][_0x0c51('0x6')](this[_0x0c51('0x7')]['bind'](this),this['handleTimeout'][_0x0c51('0x8')](this));this[_0x0c51('0x5')]['on'](_0x0c51('0x9'),this[_0x0c51('0xa')]['bind'](this));this[_0x0c51('0x5')]['on'](_0x0c51('0xb'),this[_0x0c51('0xc')][_0x0c51('0x8')](this));};Agent[_0x0c51('0xd')]['push']=function(){this[_0x0c51('0x5')][_0x0c51('0x6')](this[_0x0c51('0x7')][_0x0c51('0x8')](this),this[_0x0c51('0xa')]['bind'](this));};Agent[_0x0c51('0xd')][_0x0c51('0xc')]=function(){this[_0x0c51('0xa')](!![]);};Agent[_0x0c51('0xd')][_0x0c51('0x7')]=function(_0xc3292c){logger[_0x0c51('0xe')](_0x0c51('0xf'),this[_0x0c51('0x5')]['id'],this['agent']['id']);if(_[_0x0c51('0x10')](this[_0x0c51('0x11')]['agents'][this[_0x0c51('0x12')]['id']])){logger[_0x0c51('0xe')](_0x0c51('0x13'),this['squeue']['id'],this[_0x0c51('0x12')]['id']);setTimeout(this[_0x0c51('0x6')][_0x0c51('0x8')](this),0x3e8);}else{if(this[_0x0c51('0x3')]['forcedOwnership']||util[_0x0c51('0x14')](this[_0x0c51('0x5')]['id'],this['realtime'][_0x0c51('0x15')][this[_0x0c51('0x12')]['id']],this[_0x0c51('0x5')][_0x0c51('0x16')],![])){this['realtime'][_0x0c51('0x15')][this[_0x0c51('0x12')]['id']][_0x0c51('0x17')]=!![];this['realtime'][_0x0c51('0x15')][this[_0x0c51('0x12')]['id']][_0x0c51('0x18')]=undefined;util['showNotification'](this[_0x0c51('0x4')],this[_0x0c51('0x5')]['id'],this['realtime']['agents'][this[_0x0c51('0x12')]['id']],null,this[_0x0c51('0x3')]);util[_0x0c51('0x19')](this['squeue']['id'],this[_0x0c51('0x11')][_0x0c51('0x15')][this[_0x0c51('0x12')]['id']],_0x0c51('0x1a')+(this[_0x0c51('0x3')]['forcedOwnership']?_0x0c51('0x1b'):''));}else{logger[_0x0c51('0xe')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this['squeue']['id'],this[_0x0c51('0x12')]['id']);setTimeout(this[_0x0c51('0x6')]['bind'](this),0x3e8);}}};Agent['prototype'][_0x0c51('0xa')]=function(_0x47c63d){if(_[_0x0c51('0x10')](this[_0x0c51('0x11')][_0x0c51('0x15')][this[_0x0c51('0x12')]['id']])){return logger[_0x0c51('0xe')](_0x0c51('0x13'),this[_0x0c51('0x5')]['id'],this['agent']['id']);}else{logger[_0x0c51('0xe')](_0x0c51('0x1c'),this[_0x0c51('0x5')]['id'],this[_0x0c51('0x12')]['id']);util[_0x0c51('0x1d')](this[_0x0c51('0x4')],this[_0x0c51('0x5')]['id'],this[_0x0c51('0x11')][_0x0c51('0x15')][this[_0x0c51('0x12')]['id']],null,this['routing']);this['realtime'][_0x0c51('0x15')][this[_0x0c51('0x12')]['id']][_0x0c51('0x17')]=![];this[_0x0c51('0x11')][_0x0c51('0x15')][this[_0x0c51('0x12')]['id']][_0x0c51('0x18')]=undefined;util[_0x0c51('0x19')](this[_0x0c51('0x5')]['id'],this[_0x0c51('0x11')]['agents'][this[_0x0c51('0x12')]['id']],_0x47c63d?'STOP':_0x0c51('0x1e'));}if(!_0x47c63d){setTimeout(this[_0x0c51('0x6')][_0x0c51('0x8')](this),0x3e8);}};function agent(_0x1e0308,_0x3fd9d1,_0x508509,_0x10c2ec){return new Agent(_0x1e0308,_0x3fd9d1,_0x508509,_0x10c2ec);}module[_0x0c51('0x1f')]=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 fa0a628..76f0843 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 _0x02a1=['../../../../../config/logger','routing','notificationId','squeue','queue','realtime','push','handleRun','bind','handleTimeout','drained','handleDrained','prototype','isNil','Agents','length','agents','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','busy','busyQueue','name','info','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','writeLog','STOP','uuid','./util'];(function(_0x5027a2,_0x504928){var _0x5c83aa=function(_0x54ed14){while(--_0x54ed14){_0x5027a2['push'](_0x5027a2['shift']());}};_0x5c83aa(++_0x504928);}(_0x02a1,0xb2));var _0x102a=function(_0x3c1fa0,_0x55997a){_0x3c1fa0=_0x3c1fa0-0x0;var _0x47687d=_0x02a1[_0x3c1fa0];return _0x47687d;};'use strict';var _=require('lodash');var uuid=require(_0x102a('0x0'));var util=require(_0x102a('0x1'));var logger=require(_0x102a('0x2'))(_0x102a('0x3'));var Beepall=function(_0x569395,_0x593f85,_0x28346c,_0x3f2a38){this[_0x102a('0x4')]=uuid['v4']();this[_0x102a('0x5')]=_0x569395;this[_0x102a('0x6')]=_0x593f85;this[_0x102a('0x7')]=_0x28346c;this[_0x102a('0x3')]=_0x3f2a38;this['squeue'][_0x102a('0x8')](this[_0x102a('0x9')][_0x102a('0xa')](this),this[_0x102a('0xb')]['bind'](this));this[_0x102a('0x5')]['on']('timeout',this['handleTimeout'][_0x102a('0xa')](this));this[_0x102a('0x5')]['on'](_0x102a('0xc'),this['handleDrained'][_0x102a('0xa')](this));};Beepall['prototype']['push']=function(){this['squeue'][_0x102a('0x8')](this[_0x102a('0x9')]['bind'](this),this['handleTimeout'][_0x102a('0xa')](this));};Beepall['prototype'][_0x102a('0xd')]=function(_0x5ba681){this[_0x102a('0xb')](!![]);};Beepall[_0x102a('0xe')]['handleRun']=function(_0x5c99ed){var _0xa7f45d=!![];if(!_[_0x102a('0xf')](this[_0x102a('0x6')])&&!_[_0x102a('0xf')](this['queue'][_0x102a('0x10')])&&this[_0x102a('0x6')][_0x102a('0x10')][_0x102a('0x11')]>0x0){for(var _0x2f0088=0x0,_0x1ed745;_0x2f00880x0){for(var _0x2f09c8=0x0,_0x336d73;_0x2f09c80x0&&_0x538346[_0x2dbecc+'CurrentCapacity']>=_0x538346[_0x2dbecc+_0x74a4('0x25')]){writeLog(_0x506bac,_0x538346,_0x2dbecc[_0x74a4('0x26')]()+_0x74a4('0x27'));return![];}}return!![];};exports[_0x74a4('0x28')]=function(_0xe933f6,_0x1703be,_0x5a0cb5,_0x52df4d,_0x36472e){return sendNotification(!![],_0xe933f6,_0x1703be,_0x5a0cb5,_0x52df4d,_0x36472e);};exports['hideNotification']=function(_0x1d252f,_0x4a4a3d,_0x446340,_0x55f21e,_0x5a1dad){return sendNotification(![],_0x1d252f,_0x4a4a3d,_0x446340,_0x55f21e,_0x5a1dad);};exports[_0x74a4('0x29')]=writeLog; \ No newline at end of file +var _0x9d1f=['../../../../../config/logger','redis','defaults','socket.io-emitter','emit','format','user:%s','user:save','split','\x20interaction','account','notificationSound','notificationShake','body','queue','msg','getMustacheRender','I\x20can\x27t\x20render\x20your\x20template','error','message','name','notification:%s','save','remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','BUSY','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','\x20MAXCAPACITY','lodash','../utils','mustache','ioredis'];(function(_0xa306fc,_0x5dd8ea){var _0x58efcd=function(_0x555ebc){while(--_0x555ebc){_0xa306fc['push'](_0xa306fc['shift']());}};_0x58efcd(++_0x5dd8ea);}(_0x9d1f,0x1a9));var _0xf9d1=function(_0x412c8f,_0x11ec94){_0x412c8f=_0x412c8f-0x0;var _0x27c005=_0x9d1f[_0x412c8f];return _0x27c005;};'use strict';var _=require(_0xf9d1('0x0'));var util=require('util');var utils=require(_0xf9d1('0x1'));var Mustache=require(_0xf9d1('0x2'));var Redis=require(_0xf9d1('0x3'));var config=require('../../../../../config/environment');var logger=require(_0xf9d1('0x4'))('routing');config[_0xf9d1('0x5')]=_[_0xf9d1('0x6')](config[_0xf9d1('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xf9d1('0x7'))(new Redis(config[_0xf9d1('0x5')]));function emit(_0x5183c1,_0x11d535,_0xb4be01){io['to'](_0x5183c1)[_0xf9d1('0x8')](_0x11d535,_0xb4be01);}function sendNotification(_0x582512,_0x354715,_0xe42be1,_0x9a36f,_0x4e611e,_0x58dc14){io['to'](util[_0xf9d1('0x9')](_0xf9d1('0xa'),_0x9a36f['name']))['emit'](_0xf9d1('0xb'),_0x9a36f);var _0xb979fb=_0x58dc14||{};var _0x3277b0=_0xe42be1[_0xf9d1('0xc')]('.');var _0x4a4f9e={'uniqueid':_0x354715,'channel':_0x3277b0[0x0],'id':_0x3277b0[0x1],'title':_0x3277b0[0x0]+_0xf9d1('0xd'),'interactionId':_0x3277b0[0x2],'queue':_0x4e611e?_0x4e611e['name']:null,'sound':_0xb979fb[_0xf9d1('0xe')][_0xf9d1('0xf')],'shake':_0xb979fb['account'][_0xf9d1('0x10')]};try{if(!_0xb979fb[_0xf9d1('0x11')]){_0xb979fb[_0xf9d1('0x11')]={};}if(_0x4e611e){_0xb979fb[_0xf9d1('0x11')][_0xf9d1('0x12')]=_0x4e611e;}else if(_0xb979fb[_0xf9d1('0x11')]['queue']){delete _0xb979fb[_0xf9d1('0x11')][_0xf9d1('0x12')];}_0x4a4f9e[_0xf9d1('0x13')]=utils[_0xf9d1('0x14')](_0xb979fb[_0xf9d1('0xe')]['notificationTemplate'],_0xb979fb);}catch(_0x209c44){_0x4a4f9e[_0xf9d1('0x13')]=_0xf9d1('0x15');logger[_0xf9d1('0x16')](util[_0xf9d1('0x9')]('[%s][QUEUE]\x20%s',_0x354715,_0x209c44[_0xf9d1('0x17')]));}io['to'](util[_0xf9d1('0x9')]('user:%s',_0x9a36f[_0xf9d1('0x18')]))['emit'](util['format'](_0xf9d1('0x19'),_0x582512?_0xf9d1('0x1a'):_0xf9d1('0x1b')),_0x4a4f9e);}function writeLog(_0x35295a,_0x229478,_0x27b4cd){return logger[_0xf9d1('0x1c')](util[_0xf9d1('0x9')](_0xf9d1('0x1d'),_0x35295a,_0x229478['name'],_0x27b4cd));}exports[_0xf9d1('0x1e')]=function(_0x3b9b07,_0x320f7d,_0x126a53,_0x34416c){if(_0x320f7d['busy']){writeLog(_0x3b9b07,_0x320f7d,_0xf9d1('0x1f'));return![];}if(!_0x320f7d['online']){writeLog(_0x3b9b07,_0x320f7d,_0xf9d1('0x20'));return![];}if(_0x320f7d[_0x126a53+_0xf9d1('0x21')]){writeLog(_0x3b9b07,_0x320f7d,_0xf9d1('0x22'));return![];}if(_0x34416c&&_0x320f7d[_0xf9d1('0x23')](_0x126a53+_0xf9d1('0x24'))&&_0x320f7d[_0xf9d1('0x23')](_0x126a53+_0xf9d1('0x25'))){if(_0x320f7d[_0x126a53+'Capacity']>0x0&&_0x320f7d[_0x126a53+'CurrentCapacity']>=_0x320f7d[_0x126a53+_0xf9d1('0x24')]){writeLog(_0x3b9b07,_0x320f7d,_0x126a53['toUpperCase']()+_0xf9d1('0x26'));return![];}}return!![];};exports['showNotification']=function(_0x2e528f,_0x3271b4,_0x4a9997,_0x16686e,_0x49c887){return sendNotification(!![],_0x2e528f,_0x3271b4,_0x4a9997,_0x16686e,_0x49c887);};exports['hideNotification']=function(_0x191e57,_0x39e7f7,_0x5367a0,_0x1ee8dd,_0x54e97d){return sendNotification(![],_0x191e57,_0x39e7f7,_0x5367a0,_0x1ee8dd,_0x54e97d);};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 1cacf7d..76ff873 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 _0xa47e=['getMustacheRender','info','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','replace','isNil','body','error','shelljs','./utils','../../../../config/logger','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','[%s][SYSTEM]\x20%s','map','message','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next'];(function(_0x5ddf7b,_0x1c4c6f){var _0x88d9bf=function(_0x269a1e){while(--_0x269a1e){_0x5ddf7b['push'](_0x5ddf7b['shift']());}};_0x88d9bf(++_0x1c4c6f);}(_0xa47e,0x1d5));var _0xea47=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa47e[_0x14add3];return _0x4a174f;};'use strict';var schema=require('validate');var sh=require(_0xea47('0x0'));var _=require('lodash');var utils=require(_0xea47('0x1'));var logger=require(_0xea47('0x2'))(_0xea47('0x3'));var system=schema({'command':{'type':'string','required':!![],'message':_0xea47('0x4')}});exports['consequence']=function(_0x2f01c0,_0x1f9574){return function(_0x2e13e4){try{var _0x1e418e={'command':_0x1f9574[0x0]};var _0x34e96f=system['validate'](_0x1e418e,{'typecast':!![]});if(_0x34e96f[_0xea47('0x5')]){logger['error'](_0xea47('0x6'),_0x2f01c0,_[_0xea47('0x7')](_0x34e96f,_0xea47('0x8'))['join'](',\x20'));logger['info'](_0xea47('0x9'),_0x2f01c0);_0x2e13e4[_0xea47('0xa')]();}else{var _0x33ff21=this;var _0xd788f=utils[_0xea47('0xb')](_0x1f9574[0x0],this);logger[_0xea47('0xc')](_0xea47('0xd'),_0x2f01c0,_0xd788f);sh[_0xea47('0xe')](_[_0xea47('0xf')](_0xd788f),function(_0x36b106,_0x2ec004){logger[_0xea47('0xc')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x2f01c0,_0x36b106);if(_0x36b106==0x0){var _0x483b18=_0x2ec004[_0xea47('0x10')](/(\r\n|\n|\r)/gm,'');if(_[_0xea47('0x11')](_0x1f9574[0x1])||_['isEmpty'](_0x1f9574[0x1])){logger[_0xea47('0xc')]('[%s][SYSTEM]\x20no\x20variable',_0x2f01c0);_0x33ff21['body'][_0x1f9574[0x1]]=_0x483b18;}else{logger[_0xea47('0xc')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x2f01c0,_0x1f9574[0x1],_0x483b18);_0x33ff21[_0xea47('0x12')][_0x1f9574[0x1]]=_0x483b18;}}_0x2e13e4[_0xea47('0xa')]();});}}catch(_0x48778c){logger[_0xea47('0x13')](_0xea47('0x6'),_0x2f01c0,_['isObject'](_0x48778c)?JSON['stringify'](_0x48778c):_0x48778c);logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x2f01c0);_0x2e13e4[_0xea47('0xa')]();}};}; \ No newline at end of file +var _0x53df=['[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','[%s][SYSTEM]\x20%s','isObject','stringify','shelljs','lodash','./utils','../../../../config/logger','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','validate','error','map','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','trim'];(function(_0x586efe,_0x232bbc){var _0x1da016=function(_0x709d43){while(--_0x709d43){_0x586efe['push'](_0x586efe['shift']());}};_0x1da016(++_0x232bbc);}(_0x53df,0x8c));var _0xf53d=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0x53df[_0xa8883];return _0x479426;};'use strict';var schema=require('validate');var sh=require(_0xf53d('0x0'));var _=require(_0xf53d('0x1'));var utils=require(_0xf53d('0x2'));var logger=require(_0xf53d('0x3'))('routing');var system=schema({'command':{'type':_0xf53d('0x4'),'required':!![],'message':_0xf53d('0x5')}});exports['consequence']=function(_0x3fe35b,_0x257f32){return function(_0xc7e665){try{var _0xb577aa={'command':_0x257f32[0x0]};var _0x1e8ab4=system[_0xf53d('0x6')](_0xb577aa,{'typecast':!![]});if(_0x1e8ab4['length']){logger[_0xf53d('0x7')]('[%s][SYSTEM]\x20%s',_0x3fe35b,_[_0xf53d('0x8')](_0x1e8ab4,'message')[_0xf53d('0x9')](',\x20'));logger[_0xf53d('0xa')](_0xf53d('0xb'),_0x3fe35b);_0xc7e665[_0xf53d('0xc')]();}else{var _0x4a78f2=this;var _0x49c323=utils['getMustacheRender'](_0x257f32[0x0],this);logger[_0xf53d('0xa')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x3fe35b,_0x49c323);sh['exec'](_[_0xf53d('0xd')](_0x49c323),function(_0x17a360,_0x350326){logger[_0xf53d('0xa')](_0xf53d('0xe'),_0x3fe35b,_0x17a360);if(_0x17a360==0x0){var _0x4542a4=_0x350326[_0xf53d('0xf')](/(\r\n|\n|\r)/gm,'');if(_[_0xf53d('0x10')](_0x257f32[0x1])||_['isEmpty'](_0x257f32[0x1])){logger[_0xf53d('0xa')]('[%s][SYSTEM]\x20no\x20variable',_0x3fe35b);_0x4a78f2[_0xf53d('0x11')][_0x257f32[0x1]]=_0x4542a4;}else{logger[_0xf53d('0xa')](_0xf53d('0x12'),_0x3fe35b,_0x257f32[0x1],_0x4542a4);_0x4a78f2[_0xf53d('0x11')][_0x257f32[0x1]]=_0x4542a4;}}_0xc7e665['next']();});}}catch(_0x265697){logger[_0xf53d('0x7')](_0xf53d('0x13'),_0x3fe35b,_[_0xf53d('0x14')](_0x265697)?JSON[_0xf53d('0x15')](_0x265697):_0x265697);logger[_0xf53d('0xa')](_0xf53d('0xb'),_0x3fe35b);_0xc7e665[_0xf53d('0xc')]();}};}; \ 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 2e219bc..ff987ec 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 _0x7a54=['finally','error','validate','lodash','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','[%s][TAG]\x20%s','map','join','next','channel','Interaction','addTags','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next'];(function(_0xb7da3f,_0x54bcc9){var _0x3f67ed=function(_0x2a3675){while(--_0x2a3675){_0xb7da3f['push'](_0xb7da3f['shift']());}};_0x3f67ed(++_0x54bcc9);}(_0x7a54,0x106));var _0x47a5=function(_0x10965e,_0x1868a1){_0x10965e=_0x10965e-0x0;var _0x5b222e=_0x7a54[_0x10965e];return _0x5b222e;};'use strict';var schema=require(_0x47a5('0x0'));var _=require(_0x47a5('0x1'));var rpc={'chatInteraction':require(_0x47a5('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x47a5('0x3')),'mailInteraction':require(_0x47a5('0x4')),'faxInteraction':require('../../rpc/faxInteraction')};var logger=require(_0x47a5('0x5'))(_0x47a5('0x6'));var tag=schema({'tag':{'type':_0x47a5('0x7'),'required':!![],'message':_0x47a5('0x8')}});exports[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629,_0x59199c,_0x343372){return function(_0x30e405){try{var _0x506eda={'tag':_0x3d5629[0x0]};var _0x194fb0=tag['validate'](_0x506eda,{'typecast':!![]});if(_0x194fb0['length']){logger['error'](_0x47a5('0xa'),_0x545a97,_[_0x47a5('0xb')](_0x194fb0,'message')[_0x47a5('0xc')](',\x20'));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x545a97);_0x30e405[_0x47a5('0xd')]();}else{var _0x69e4d4={'ids':[_0x3d5629[0x0]]};if(rpc[_0x343372[_0x47a5('0xe')]+_0x47a5('0xf')]){rpc[_0x343372[_0x47a5('0xe')]+_0x47a5('0xf')][_0x47a5('0x10')](_0x343372['interaction']['id'],_0x69e4d4)[_0x47a5('0x11')](function(_0x221b54){logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x545a97,_0x3d5629[0x1],_0x343372[_0x47a5('0xe')],_0x343372[_0x47a5('0x14')]['id']);})[_0x47a5('0x15')](function(_0x190faa){logger['error'](_0x47a5('0xa'),_0x545a97,JSON[_0x47a5('0x16')](_0x190faa));logger[_0x47a5('0x12')](_0x47a5('0x17'),_0x545a97);})[_0x47a5('0x18')](function(){_0x30e405['next']();});}}}catch(_0x549de3){logger[_0x47a5('0x19')]('[%s][TAG]\x20%s',_0x545a97,_['isObject'](_0x549de3)?JSON[_0x47a5('0x16')](_0x549de3):_0x549de3);logger[_0x47a5('0x12')](_0x47a5('0x17'),_0x545a97);_0x30e405[_0x47a5('0xd')]();}};}; \ No newline at end of file +var _0x9957=['join','info','next','Interaction','channel','addTags','interaction','then','catch','stringify','finally','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map','message'];(function(_0x19b742,_0x19e318){var _0x3ab093=function(_0x46eb0c){while(--_0x46eb0c){_0x19b742['push'](_0x19b742['shift']());}};_0x3ab093(++_0x19e318);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var schema=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var rpc={'chatInteraction':require(_0x7995('0x2')),'openchannelInteraction':require(_0x7995('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x7995('0x4')),'faxInteraction':require(_0x7995('0x5'))};var logger=require(_0x7995('0x6'))(_0x7995('0x7'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0x7995('0x8')}});exports[_0x7995('0x9')]=function(_0x137b6b,_0x219534,_0xbda126,_0x326741){return function(_0x4996ca){try{var _0x465276={'tag':_0x219534[0x0]};var _0x1cad37=tag['validate'](_0x465276,{'typecast':!![]});if(_0x1cad37[_0x7995('0xa')]){logger[_0x7995('0xb')](_0x7995('0xc'),_0x137b6b,_[_0x7995('0xd')](_0x1cad37,_0x7995('0xe'))[_0x7995('0xf')](',\x20'));logger[_0x7995('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x137b6b);_0x4996ca[_0x7995('0x11')]();}else{var _0x41c652={'ids':[_0x219534[0x0]]};if(rpc[_0x326741['channel']+_0x7995('0x12')]){rpc[_0x326741[_0x7995('0x13')]+_0x7995('0x12')][_0x7995('0x14')](_0x326741[_0x7995('0x15')]['id'],_0x41c652)[_0x7995('0x16')](function(_0x2bbe7a){logger['info']('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x137b6b,_0x219534[0x1],_0x326741[_0x7995('0x13')],_0x326741[_0x7995('0x15')]['id']);})[_0x7995('0x17')](function(_0x321ae8){logger[_0x7995('0xb')](_0x7995('0xc'),_0x137b6b,JSON[_0x7995('0x18')](_0x321ae8));logger[_0x7995('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x137b6b);})[_0x7995('0x19')](function(){_0x4996ca['next']();});}}}catch(_0x2f832e){logger[_0x7995('0xb')](_0x7995('0xc'),_0x137b6b,_[_0x7995('0x1a')](_0x2f832e)?JSON[_0x7995('0x18')](_0x2f832e):_0x2f832e);logger[_0x7995('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x137b6b);_0x4996ca['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/utils.js b/server/services/routing/server/applications/utils.js index e112484..6d59f2d 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 _0xccdc=['interaction','list','mustache','lodash','render','merge','body','contact','message','account'];(function(_0x5e6935,_0x23d0a4){var _0x5498f9=function(_0x592401){while(--_0x592401){_0x5e6935['push'](_0x5e6935['shift']());}};_0x5498f9(++_0x23d0a4);}(_0xccdc,0x1c4));var _0xcccd=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xccdc[_0x68c979];return _0x4f0001;};'use strict';var Mustache=require(_0xcccd('0x0'));var _=require(_0xcccd('0x1'));module['exports']={'getMustacheRender':function(_0x4a4fa5,_0x3d1898){return Mustache[_0xcccd('0x2')](_0x4a4fa5,_[_0xcccd('0x3')](_0x3d1898[_0xcccd('0x4')],{'contact':_0x3d1898[_0xcccd('0x5')],'message':_0x3d1898[_0xcccd('0x6')],'account':_0x3d1898[_0xcccd('0x7')],'interaction':_0x3d1898[_0xcccd('0x8')],'list':_0x3d1898[_0xcccd('0x9')]}))||'';}}; \ No newline at end of file +var _0xe94a=['body','contact','message','interaction','list','mustache','lodash','exports','render','merge'];(function(_0x32b993,_0x1c5989){var _0x482780=function(_0x404179){while(--_0x404179){_0x32b993['push'](_0x32b993['shift']());}};_0x482780(++_0x1c5989);}(_0xe94a,0x1c7));var _0xae94=function(_0x4db46b,_0xadcb1a){_0x4db46b=_0x4db46b-0x0;var _0x565be8=_0xe94a[_0x4db46b];return _0x565be8;};'use strict';var Mustache=require(_0xae94('0x0'));var _=require(_0xae94('0x1'));module[_0xae94('0x2')]={'getMustacheRender':function(_0x59a458,_0x373e60){return Mustache[_0xae94('0x3')](_0x59a458,_[_0xae94('0x4')](_0x373e60[_0xae94('0x5')],{'contact':_0x373e60[_0xae94('0x6')],'message':_0x373e60[_0xae94('0x7')],'account':_0x373e60['account'],'interaction':_0x373e60[_0xae94('0x8')],'list':_0x373e60[_0xae94('0x9')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 9ee56b0..5281651 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 _0x3360=['consequence','priority','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','info','Applications\x20executed','stringify','emit','end','No\x20applications\x20to\x20execute','QueueReport','update','catch','stack','message\x20is\x20empty','agent','agents','busy','busyQueue','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','chatQueues','available','loggedIn','paused','mailQueues','name','waiting','openchannelQueues','smsQueues','faxQueues','values','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','path','uuid','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','.js','toLowerCase','autoreply','appdata','split','push','slice','join','dialogflow','amazonlex','tag','TagId','%s:%s:%s','app','./interval','condition','intervals','./applications/'];(function(_0x23c827,_0x37332a){var _0x3d7f1f=function(_0x3ff0f2){while(--_0x3ff0f2){_0x23c827['push'](_0x23c827['shift']());}};_0x3d7f1f(++_0x37332a);}(_0x3360,0x134));var _0x0336=function(_0x5de61e,_0x6a1a7b){_0x5de61e=_0x5de61e-0x0;var _0x1d9590=_0x3360[_0x5de61e];return _0x1d9590;};'use strict';var _=require(_0x0336('0x0'));var util=require(_0x0336('0x1'));var path=require(_0x0336('0x2'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require('bluebird');var uuid=require(_0x0336('0x3'));var config=require(_0x0336('0x4'));var logger=require(_0x0336('0x5'))(_0x0336('0x6'));var rpc={'openchannelQueueReport':require(_0x0336('0x7'))};var rpc={'openchannelQueueReport':require(_0x0336('0x7')),'mailQueueReport':require(_0x0336('0x8')),'chatQueueReport':require(_0x0336('0x9')),'smsQueueReport':require(_0x0336('0xa')),'faxQueueReport':require(_0x0336('0xb'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x34d776,_0x2d0c76,_0x25abc9){return util['format']('%s.%s.%s',_0x34d776,_0x2d0c76||0x0,_0x25abc9||0x0);}function getIntervals(_0xfecb34,_0x553431){var _0x18ed95=[];if(!_[_0x0336('0xc')](_0x553431[_0x0336('0xd')])&&!_[_0x0336('0xc')](_0xfecb34[_0x553431['IntervalId']])&&!_[_0x0336('0xc')](_0xfecb34[_0x553431['IntervalId']][_0x0336('0xe')])){_0x18ed95=_[_0x0336('0xf')](_0xfecb34[_0x553431[_0x0336('0xd')]][_0x0336('0xe')],'interval');}else if(!_[_0x0336('0xc')](_0x553431['interval'])){_0x18ed95=[_0x553431[_0x0336('0x10')]];}return _0x18ed95;}exports[_0x0336('0x11')]=function(_0xb4bc5e){_0xb4bc5e[_0x0336('0x12')]={};return new BPromise(function(_0x49e7e4,_0x561187){var _0x1b073e={'Start':function(_0x5cb6eb){var _0x1d6af2=this;return new Promise(function(_0x3e69df,_0x3f3a98){if(_0x5cb6eb){try{var _0x504e00=[];var _0x328a63=getId(_0x5cb6eb[_0x0336('0x13')],_0x5cb6eb['message']?_0x5cb6eb[_0x0336('0x14')]['id']:0x0,_0x5cb6eb[_0x0336('0x15')]?_0x5cb6eb[_0x0336('0x15')]['id']:0x0);if(_0x5cb6eb[_0x0336('0x16')]&&_[_0x0336('0x17')](_0x5cb6eb[_0x0336('0x16')])&&_0x5cb6eb[_0x0336('0x16')][_0x0336('0x18')]){for(var _0x566ec6=0x0;_0x566ec6<_0x5cb6eb['applications'][_0x0336('0x18')];_0x566ec6+=0x1){var _0xbc4b2b=_0x5cb6eb[_0x0336('0x16')][_0x566ec6];if(fs[_0x0336('0x19')](path['join'](__dirname,_0x0336('0x16'),_0xbc4b2b['app']+_0x0336('0x1a')))){var _0x5b03c2=[];switch(_0xbc4b2b['app'][_0x0336('0x1b')]()){case _0x0336('0x1c'):var _0x5ba100=_0xbc4b2b[_0x0336('0x1d')][_0x0336('0x1e')](',');_0x5b03c2[_0x0336('0x1f')](_0x5ba100[0x0]);_0x5b03c2['push'](_0x5ba100[_0x0336('0x20')](0x1,_0x5ba100['length'])[_0x0336('0x21')](','));break;case _0x0336('0x22'):var _0x5ba100=_0xbc4b2b[_0x0336('0x1d')][_0x0336('0x1e')](',');_0x5b03c2[_0x0336('0x1f')](_0x5ba100[0x0]);_0x5b03c2['push'](_0x5ba100[0x1]);_0x5b03c2['push'](_0x5ba100[_0x0336('0x20')](0x2,_0x5ba100[_0x0336('0x18')])['join'](','));break;case _0x0336('0x23'):var _0x5ba100=_0xbc4b2b[_0x0336('0x1d')][_0x0336('0x1e')](',');_0x5b03c2[_0x0336('0x1f')](_0x5ba100[0x0]);_0x5b03c2[_0x0336('0x1f')](_0x5ba100[0x1]);_0x5b03c2['push'](_0x5ba100[0x2]);_0x5b03c2[_0x0336('0x1f')](_0x5ba100[0x3]);_0x5b03c2[_0x0336('0x1f')](_0x5ba100[_0x0336('0x20')](0x4,_0x5ba100[_0x0336('0x18')])[_0x0336('0x21')](','));break;case _0x0336('0x14'):_0x5b03c2[_0x0336('0x1f')](_0xbc4b2b[_0x0336('0x1d')]);break;case _0x0336('0x24'):_0x5b03c2[_0x0336('0x1f')](_0xbc4b2b[_0x0336('0x25')]);_0x5b03c2['push'](_0xbc4b2b['appdata']);break;default:_0x5b03c2=_[_0x0336('0xc')](_0xbc4b2b['appdata'])?[]:_0xbc4b2b[_0x0336('0x1d')][_0x0336('0x1e')](',');}var _0x481b38={'id':util['format'](_0x0336('0x26'),_0x328a63,_0xbc4b2b['id'],_0xbc4b2b[_0x0336('0x27')]),'condition':require(_0x0336('0x28'))[_0x0336('0x29')](_0x328a63,getIntervals(_0xb4bc5e[_0x0336('0x2a')],_0xbc4b2b),_0xb4bc5e),'consequence':require(_0x0336('0x2b')+_0xbc4b2b[_0x0336('0x27')])[_0x0336('0x2c')](_0x328a63,_0x5b03c2,_0xb4bc5e,_0x5cb6eb),'p':_0xbc4b2b[_0x0336('0x2d')]||0x0};logger['info']('Push\x20new\x20rule',_0x481b38['id'],_0x0336('0x2e'),getIntervals(_0xb4bc5e[_0x0336('0x2a')],_0xbc4b2b)[_0x0336('0x21')](_0x0336('0x2f')));_0x504e00[_0x0336('0x1f')](_0x481b38);}else{logger[_0x0336('0x30')](_0x0336('0x31'),path[_0x0336('0x21')](__dirname,_0x0336('0x16'),_0xbc4b2b[_0x0336('0x27')]+_0x0336('0x1a')));}}_0xb4bc5e[_0x0336('0x12')][_0x328a63]=new RuleEngine(_0x504e00);_0xb4bc5e['rules'][_0x328a63][_0x0336('0x32')](_0x5cb6eb,function(_0x4e9b20){logger[_0x0336('0x33')](_0x0336('0x34'),JSON[_0x0336('0x35')](_0x4e9b20['matchPath']));if(_0xb4bc5e[_0x0336('0x12')][_0x328a63]){_0xb4bc5e[_0x0336('0x12')][_0x328a63][_0x0336('0x36')](_0x0336('0x37'));}});return _0x3e69df({'code':0xc8,'message':_0x5cb6eb});}else{logger[_0x0336('0x33')](_0x0336('0x38'));return _0x3e69df({'code':0xc8,'message':_0x5cb6eb});}}catch(_0x2af335){logger[_0x0336('0x30')](_0x2af335['stack']);return _0x3f3a98(_0x1d6af2[_0x0336('0x30')](0x1f4,_0x2af335));}}return _0x3f3a98('routing\x20is\x20empty');});},'AcceptMessage':function(_0x1ba1d4){var _0x2c0f84=this;return new Promise(function(_0x3890d7,_0x4d5002){if(_0x1ba1d4[_0x0336('0x14')]&&_0x1ba1d4[_0x0336('0x14')]['id']){try{var _0x44eb4a=getId(_0x1ba1d4[_0x0336('0x13')],_0x1ba1d4[_0x0336('0x14')]?_0x1ba1d4[_0x0336('0x14')]['id']:0x0,_0x1ba1d4[_0x0336('0x15')]?_0x1ba1d4[_0x0336('0x15')]['id']:0x0);if(_0xb4bc5e[_0x0336('0x12')][_0x44eb4a]){_0xb4bc5e[_0x0336('0x12')][_0x44eb4a][_0x0336('0x36')]('end');if(rpc[_0x1ba1d4[_0x0336('0x13')]+'QueueReport']){rpc[_0x1ba1d4[_0x0336('0x13')]+_0x0336('0x39')][_0x0336('0x3a')](_0x44eb4a,{'UserId':_0x1ba1d4[_0x0336('0x14')]['UserId']})[_0x0336('0x3b')](function(_0xbcfb04){logger[_0x0336('0x30')]('error\x20update\x20queue\x20report');});}}return _0x3890d7({'code':0xc8,'message':_0x1ba1d4});}catch(_0x27f629){logger['error'](_0x27f629[_0x0336('0x3c')]);return _0x4d5002(_0x2c0f84['error'](0x1f4,_0x27f629));}}logger[_0x0336('0x30')](_0x0336('0x3d'));return _0x4d5002(_0x2c0f84[_0x0336('0x30')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x53fbcf){var _0x56c3c5=this;return new Promise(function(_0x271ea7,_0x58d11f){if(_0x53fbcf[_0x0336('0x3e')]&&_0x53fbcf[_0x0336('0x3e')]['id']){try{if(_0xb4bc5e[_0x0336('0x3f')][_0x53fbcf['agent']['id']]){_0xb4bc5e['agents'][_0x53fbcf['agent']['id']][_0x0336('0x40')]=![];_0xb4bc5e[_0x0336('0x3f')][_0x53fbcf[_0x0336('0x3e')]['id']][_0x0336('0x41')]=undefined;}return _0x271ea7({'code':0xc8,'message':_0x53fbcf});}catch(_0x5c8dda){logger[_0x0336('0x30')](_0x5c8dda[_0x0336('0x3c')]);return _0x58d11f(_0x56c3c5[_0x0336('0x30')](0x1f4,_0x5c8dda));}}logger[_0x0336('0x30')](_0x0336('0x3d'));return _0x58d11f(_0x56c3c5[_0x0336('0x30')](0x1f4,_0x0336('0x3d')));});},'AbandonInteraction':function(_0x246209){var _0xa5026a=this;return new Promise(function(_0x37b68f,_0x3cab25){if(_0x246209[_0x0336('0x13')]&&_0x246209[_0x0336('0x15')]&&_0x246209[_0x0336('0x15')]['id']){try{var _0x58e185=getId(_0x246209[_0x0336('0x13')],_0x246209[_0x0336('0x14')]?_0x246209[_0x0336('0x14')]['id']:0x0,_0x246209[_0x0336('0x15')]?_0x246209[_0x0336('0x15')]['id']:0x0);if(_0xb4bc5e[_0x0336('0x12')][_0x58e185]){_0xb4bc5e[_0x0336('0x12')][_0x58e185][_0x0336('0x36')](_0x0336('0x37'));}return _0x37b68f({'code':0xc8,'message':_0x246209});}catch(_0x3a8a12){logger[_0x0336('0x30')](_0x3a8a12['stack']);return _0x3cab25(_0xa5026a['error'](0x1f4,_0x3a8a12));}}logger[_0x0336('0x30')](_0x0336('0x3d'));return _0x3cab25(_0xa5026a[_0x0336('0x30')](0x1f4,_0x0336('0x3d')));});},'AgentCapacity':function(_0x8dffbe){var _0x2dcf9b=this;return new Promise(function(_0x39dc2d,_0x2d1cde){if(_0xb4bc5e[_0x0336('0x3f')]['hasOwnProperty'](_0x8dffbe['id'])){for(var _0x14b916 in _0x8dffbe[_0x0336('0x42')]){if(_0x8dffbe[_0x0336('0x42')][_0x0336('0x43')](_0x14b916)){if(_0xb4bc5e['agents'][_0x8dffbe['id']][_0x0336('0x43')](_0x14b916+_0x0336('0x44'))){_0xb4bc5e[_0x0336('0x3f')][_0x8dffbe['id']][_0x14b916+_0x0336('0x44')]=parseInt(_0x8dffbe[_0x0336('0x42')][_0x14b916],0xa);}}}_0xb4bc5e[_0x0336('0x3f')][_0x8dffbe['id']][_0x0336('0x45')]();return _0x39dc2d({'code':0xc8,'message':_0xb4bc5e['agents'][_0x8dffbe['id']]});}else{return _0x2d1cde(_0x2dcf9b[_0x0336('0x30')](0x1f4,_0x0336('0x46')));}});},'Agents':function(_0x17e966){return new Promise(function(_0x19899d,_0x5126d8){var _0x545dd5=_['values'](_0xb4bc5e[_0x0336('0x3f')]);_0x19899d({'count':_0x545dd5[_0x0336('0x18')],'rows':_0x545dd5});});},'ChatQueues':function(_0x439b9a){return new Promise(function(_0x36b31d,_0x31ccec){var _0x24d731=[];for(var _0x128d1c in _0xb4bc5e['chatQueues']){if(_0xb4bc5e[_0x0336('0x47')][_0x0336('0x43')](_0x128d1c)){var _0x1f4f63=_0xb4bc5e[_0x0336('0x47')][_0x128d1c];var _0x2b1ae7={'id':_0x1f4f63['id'],'available':_0x1f4f63[_0x0336('0x48')],'loggedIn':_0x1f4f63[_0x0336('0x49')],'name':_0x1f4f63['name'],'paused':_0x1f4f63[_0x0336('0x4a')],'waiting':_0x1f4f63['waiting']};_0x24d731[_0x0336('0x1f')](_0x2b1ae7);}}_0x36b31d({'count':_0x24d731[_0x0336('0x18')],'rows':_0x24d731});});},'MailQueues':function(_0xb5ffc1){return new Promise(function(_0x3d4617,_0x2d9e2e){var _0x175c0d=[];for(var _0x32e82e in _0xb4bc5e['mailQueues']){if(_0xb4bc5e['mailQueues'][_0x0336('0x43')](_0x32e82e)){var _0xfc832a=_0xb4bc5e[_0x0336('0x4b')][_0x32e82e];var _0x252468={'id':_0xfc832a['id'],'available':_0xfc832a['available'],'loggedIn':_0xfc832a['loggedIn'],'name':_0xfc832a[_0x0336('0x4c')],'paused':_0xfc832a[_0x0336('0x4a')],'waiting':_0xfc832a[_0x0336('0x4d')]};_0x175c0d[_0x0336('0x1f')](_0x252468);}}_0x3d4617({'count':_0x175c0d[_0x0336('0x18')],'rows':_0x175c0d});});},'OpenchannelQueues':function(_0x19ff5c){return new Promise(function(_0x471490,_0x528825){var _0x3713ff=[];for(var _0xcbaa74 in _0xb4bc5e[_0x0336('0x4e')]){if(_0xb4bc5e[_0x0336('0x4e')][_0x0336('0x43')](_0xcbaa74)){var _0x2d4bb8=_0xb4bc5e[_0x0336('0x4e')][_0xcbaa74];var _0x59f1d2={'id':_0x2d4bb8['id'],'available':_0x2d4bb8[_0x0336('0x48')],'loggedIn':_0x2d4bb8[_0x0336('0x49')],'name':_0x2d4bb8[_0x0336('0x4c')],'paused':_0x2d4bb8[_0x0336('0x4a')],'waiting':_0x2d4bb8['waiting']};_0x3713ff['push'](_0x59f1d2);}}_0x471490({'count':_0x3713ff[_0x0336('0x18')],'rows':_0x3713ff});});},'SmsQueues':function(_0x8509e7){return new Promise(function(_0x5babd2,_0x1b823a){var _0x32a01d=[];for(var _0x28cc39 in _0xb4bc5e[_0x0336('0x4f')]){if(_0xb4bc5e[_0x0336('0x4f')]['hasOwnProperty'](_0x28cc39)){var _0x5d0dd0=_0xb4bc5e[_0x0336('0x4f')][_0x28cc39];var _0x38795d={'id':_0x5d0dd0['id'],'available':_0x5d0dd0[_0x0336('0x48')],'loggedIn':_0x5d0dd0[_0x0336('0x49')],'name':_0x5d0dd0[_0x0336('0x4c')],'paused':_0x5d0dd0[_0x0336('0x4a')],'waiting':_0x5d0dd0[_0x0336('0x4d')]};_0x32a01d[_0x0336('0x1f')](_0x38795d);}}_0x5babd2({'count':_0x32a01d['length'],'rows':_0x32a01d});});},'FaxQueues':function(_0x271bd4){return new Promise(function(_0x34fc00,_0x21551a){var _0x473721=[];for(var _0x35ed9f in _0xb4bc5e[_0x0336('0x50')]){if(_0xb4bc5e[_0x0336('0x50')]['hasOwnProperty'](_0x35ed9f)){var _0x51fb15=_0xb4bc5e[_0x0336('0x50')][_0x35ed9f];var _0x572fce={'id':_0x51fb15['id'],'available':_0x51fb15['available'],'loggedIn':_0x51fb15[_0x0336('0x49')],'name':_0x51fb15['name'],'paused':_0x51fb15[_0x0336('0x4a')],'waiting':_0x51fb15[_0x0336('0x4d')]};_0x473721['push'](_0x572fce);}}_0x34fc00({'count':_0x473721[_0x0336('0x18')],'rows':_0x473721});});},'ChatQueuesWaitingInteractions':function(_0x136566){return new Promise(function(_0x380e7c,_0x2ce174){var _0x2818b8=_[_0x0336('0x51')](_0xb4bc5e[_0x0336('0x52')]);_0x380e7c({'count':_0x2818b8[_0x0336('0x18')],'rows':_0x2818b8});});},'MailQueuesWaitingInteractions':function(_0x339710){return new Promise(function(_0x3c3514,_0x5f2ed3){var _0x33f029=_[_0x0336('0x51')](_0xb4bc5e['mailQueuesWaitingInteractions']);_0x3c3514({'count':_0x33f029['length'],'rows':_0x33f029});});},'OpenchannelQueuesWaitingInteractions':function(_0x34a671){return new Promise(function(_0x261ecc,_0x16bed3){var _0x2581b4=_[_0x0336('0x51')](_0xb4bc5e[_0x0336('0x53')]);_0x261ecc({'count':_0x2581b4[_0x0336('0x18')],'rows':_0x2581b4});});},'SmsQueuesWaitingInteractions':function(_0x3b513e){return new Promise(function(_0x3718fd,_0x370e79){var _0x57b959=_['values'](_0xb4bc5e['smsQueuesWaitingInteractions']);_0x3718fd({'count':_0x57b959[_0x0336('0x18')],'rows':_0x57b959});});},'FaxQueuesWaitingInteractions':function(_0x1fc89f){return new Promise(function(_0x3e72ee,_0x56c9ae){var _0x704eef=_[_0x0336('0x51')](_0xb4bc5e[_0x0336('0x54')]);_0x3e72ee({'count':_0x704eef[_0x0336('0x18')],'rows':_0x704eef});});}};var _0x35df5d=jayson[_0x0336('0x55')](_0x1b073e)['http']();_0x35df5d['on']('error',function(_0x43bf15){logger['error'](JSON[_0x0336('0x35')](_0x43bf15));return _0x561187(_0x43bf15);});_0x35df5d[_0x0336('0x11')](0x232c,_0x0336('0x56'),function(){console['log'](_0x0336('0x57'),0x232c);return _0x49e7e4('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file +var _0xedf8=['priority','info','Push\x20new\x20rule','on\x20interval','error','Please\x20create\x20a\x20new\x20file\x20under','.js','Applications\x20executed','matchPath','emit','end','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','QueueReport','update','UserId','catch','message\x20is\x20empty','agent','agents','busy','busyQueue','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','loggedIn','waiting','mailQueues','available','name','paused','openchannelQueues','smsQueues','faxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','stringify','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','path','bluebird','uuid','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','join','app','toLowerCase','appdata','push','slice','dialogflow','split','tag','%s:%s:%s','condition','intervals','consequence'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xedf8,0xe8));var _0x8edf=function(_0x2cfd9e,_0x1ad2b5){_0x2cfd9e=_0x2cfd9e-0x0;var _0x520d54=_0xedf8[_0x2cfd9e];return _0x520d54;};'use strict';var _=require('lodash');var util=require(_0x8edf('0x0'));var path=require(_0x8edf('0x1'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0x8edf('0x2'));var uuid=require(_0x8edf('0x3'));var config=require(_0x8edf('0x4'));var logger=require(_0x8edf('0x5'))(_0x8edf('0x6'));var rpc={'openchannelQueueReport':require(_0x8edf('0x7'))};var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x8edf('0x8')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0x8edf('0x9')),'faxQueueReport':require(_0x8edf('0xa'))};var RuleEngine=require(_0x8edf('0xb'));function getId(_0x336884,_0x2016f1,_0x46f278){return util[_0x8edf('0xc')](_0x8edf('0xd'),_0x336884,_0x2016f1||0x0,_0x46f278||0x0);}function getIntervals(_0x1dc90e,_0x180b75){var _0xc08d03=[];if(!_[_0x8edf('0xe')](_0x180b75[_0x8edf('0xf')])&&!_[_0x8edf('0xe')](_0x1dc90e[_0x180b75[_0x8edf('0xf')]])&&!_[_0x8edf('0xe')](_0x1dc90e[_0x180b75[_0x8edf('0xf')]][_0x8edf('0x10')])){_0xc08d03=_[_0x8edf('0x11')](_0x1dc90e[_0x180b75[_0x8edf('0xf')]]['Intervals'],_0x8edf('0x12'));}else if(!_[_0x8edf('0xe')](_0x180b75[_0x8edf('0x12')])){_0xc08d03=[_0x180b75[_0x8edf('0x12')]];}return _0xc08d03;}exports[_0x8edf('0x13')]=function(_0x567f3c){_0x567f3c[_0x8edf('0x14')]={};return new BPromise(function(_0x4d3d96,_0x578f23){var _0x155acf={'Start':function(_0x3408f4){var _0x107ee1=this;return new Promise(function(_0x1b92c7,_0x2e3a72){if(_0x3408f4){try{var _0x33bbee=[];var _0x267fee=getId(_0x3408f4[_0x8edf('0x15')],_0x3408f4[_0x8edf('0x16')]?_0x3408f4[_0x8edf('0x16')]['id']:0x0,_0x3408f4['interaction']?_0x3408f4[_0x8edf('0x17')]['id']:0x0);if(_0x3408f4[_0x8edf('0x18')]&&_[_0x8edf('0x19')](_0x3408f4[_0x8edf('0x18')])&&_0x3408f4[_0x8edf('0x18')][_0x8edf('0x1a')]){for(var _0x20ecd9=0x0;_0x20ecd9<_0x3408f4[_0x8edf('0x18')]['length'];_0x20ecd9+=0x1){var _0x1a270d=_0x3408f4[_0x8edf('0x18')][_0x20ecd9];if(fs[_0x8edf('0x1b')](path[_0x8edf('0x1c')](__dirname,_0x8edf('0x18'),_0x1a270d[_0x8edf('0x1d')]+'.js'))){var _0x488537=[];switch(_0x1a270d[_0x8edf('0x1d')][_0x8edf('0x1e')]()){case'autoreply':var _0x52833c=_0x1a270d[_0x8edf('0x1f')]['split'](',');_0x488537[_0x8edf('0x20')](_0x52833c[0x0]);_0x488537[_0x8edf('0x20')](_0x52833c[_0x8edf('0x21')](0x1,_0x52833c[_0x8edf('0x1a')])[_0x8edf('0x1c')](','));break;case _0x8edf('0x22'):var _0x52833c=_0x1a270d[_0x8edf('0x1f')][_0x8edf('0x23')](',');_0x488537['push'](_0x52833c[0x0]);_0x488537['push'](_0x52833c[0x1]);_0x488537[_0x8edf('0x20')](_0x52833c[_0x8edf('0x21')](0x2,_0x52833c[_0x8edf('0x1a')])[_0x8edf('0x1c')](','));break;case'amazonlex':var _0x52833c=_0x1a270d[_0x8edf('0x1f')]['split'](',');_0x488537[_0x8edf('0x20')](_0x52833c[0x0]);_0x488537[_0x8edf('0x20')](_0x52833c[0x1]);_0x488537['push'](_0x52833c[0x2]);_0x488537[_0x8edf('0x20')](_0x52833c[0x3]);_0x488537['push'](_0x52833c[_0x8edf('0x21')](0x4,_0x52833c[_0x8edf('0x1a')])[_0x8edf('0x1c')](','));break;case _0x8edf('0x16'):_0x488537[_0x8edf('0x20')](_0x1a270d[_0x8edf('0x1f')]);break;case _0x8edf('0x24'):_0x488537[_0x8edf('0x20')](_0x1a270d['TagId']);_0x488537['push'](_0x1a270d[_0x8edf('0x1f')]);break;default:_0x488537=_[_0x8edf('0xe')](_0x1a270d['appdata'])?[]:_0x1a270d[_0x8edf('0x1f')][_0x8edf('0x23')](',');}var _0x5d195a={'id':util[_0x8edf('0xc')](_0x8edf('0x25'),_0x267fee,_0x1a270d['id'],_0x1a270d[_0x8edf('0x1d')]),'condition':require('./interval')[_0x8edf('0x26')](_0x267fee,getIntervals(_0x567f3c[_0x8edf('0x27')],_0x1a270d),_0x567f3c),'consequence':require('./applications/'+_0x1a270d[_0x8edf('0x1d')])[_0x8edf('0x28')](_0x267fee,_0x488537,_0x567f3c,_0x3408f4),'p':_0x1a270d[_0x8edf('0x29')]||0x0};logger[_0x8edf('0x2a')](_0x8edf('0x2b'),_0x5d195a['id'],_0x8edf('0x2c'),getIntervals(_0x567f3c[_0x8edf('0x27')],_0x1a270d)[_0x8edf('0x1c')]('\x20|\x20'));_0x33bbee['push'](_0x5d195a);}else{logger[_0x8edf('0x2d')](_0x8edf('0x2e'),path['join'](__dirname,_0x8edf('0x18'),_0x1a270d['app']+_0x8edf('0x2f')));}}_0x567f3c['rules'][_0x267fee]=new RuleEngine(_0x33bbee);_0x567f3c['rules'][_0x267fee]['execute'](_0x3408f4,function(_0x20ddc7){logger[_0x8edf('0x2a')](_0x8edf('0x30'),JSON['stringify'](_0x20ddc7[_0x8edf('0x31')]));if(_0x567f3c['rules'][_0x267fee]){_0x567f3c[_0x8edf('0x14')][_0x267fee][_0x8edf('0x32')](_0x8edf('0x33'));}});return _0x1b92c7({'code':0xc8,'message':_0x3408f4});}else{logger[_0x8edf('0x2a')](_0x8edf('0x34'));return _0x1b92c7({'code':0xc8,'message':_0x3408f4});}}catch(_0x3f2954){logger[_0x8edf('0x2d')](_0x3f2954[_0x8edf('0x35')]);return _0x2e3a72(_0x107ee1[_0x8edf('0x2d')](0x1f4,_0x3f2954));}}return _0x2e3a72(_0x8edf('0x36'));});},'AcceptMessage':function(_0x44fd60){var _0x112162=this;return new Promise(function(_0x540fa0,_0x7c4e13){if(_0x44fd60['message']&&_0x44fd60[_0x8edf('0x16')]['id']){try{var _0x196fd6=getId(_0x44fd60[_0x8edf('0x15')],_0x44fd60[_0x8edf('0x16')]?_0x44fd60[_0x8edf('0x16')]['id']:0x0,_0x44fd60['interaction']?_0x44fd60[_0x8edf('0x17')]['id']:0x0);if(_0x567f3c['rules'][_0x196fd6]){_0x567f3c[_0x8edf('0x14')][_0x196fd6][_0x8edf('0x32')](_0x8edf('0x33'));if(rpc[_0x44fd60[_0x8edf('0x15')]+_0x8edf('0x37')]){rpc[_0x44fd60[_0x8edf('0x15')]+_0x8edf('0x37')][_0x8edf('0x38')](_0x196fd6,{'UserId':_0x44fd60[_0x8edf('0x16')][_0x8edf('0x39')]})[_0x8edf('0x3a')](function(_0x57a002){logger[_0x8edf('0x2d')]('error\x20update\x20queue\x20report');});}}return _0x540fa0({'code':0xc8,'message':_0x44fd60});}catch(_0x2baef3){logger[_0x8edf('0x2d')](_0x2baef3[_0x8edf('0x35')]);return _0x7c4e13(_0x112162[_0x8edf('0x2d')](0x1f4,_0x2baef3));}}logger[_0x8edf('0x2d')](_0x8edf('0x3b'));return _0x7c4e13(_0x112162[_0x8edf('0x2d')](0x1f4,_0x8edf('0x3b')));});},'RejectMessage':function(_0x218e5d){var _0x1901be=this;return new Promise(function(_0x39849f,_0xac1484){if(_0x218e5d[_0x8edf('0x3c')]&&_0x218e5d[_0x8edf('0x3c')]['id']){try{if(_0x567f3c['agents'][_0x218e5d[_0x8edf('0x3c')]['id']]){_0x567f3c[_0x8edf('0x3d')][_0x218e5d[_0x8edf('0x3c')]['id']][_0x8edf('0x3e')]=![];_0x567f3c[_0x8edf('0x3d')][_0x218e5d[_0x8edf('0x3c')]['id']][_0x8edf('0x3f')]=undefined;}return _0x39849f({'code':0xc8,'message':_0x218e5d});}catch(_0x39f804){logger[_0x8edf('0x2d')](_0x39f804[_0x8edf('0x35')]);return _0xac1484(_0x1901be[_0x8edf('0x2d')](0x1f4,_0x39f804));}}logger[_0x8edf('0x2d')](_0x8edf('0x3b'));return _0xac1484(_0x1901be[_0x8edf('0x2d')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x25019f){var _0x7734de=this;return new Promise(function(_0xae982,_0x5b26d4){if(_0x25019f['channel']&&_0x25019f[_0x8edf('0x17')]&&_0x25019f[_0x8edf('0x17')]['id']){try{var _0x4c415a=getId(_0x25019f[_0x8edf('0x15')],_0x25019f[_0x8edf('0x16')]?_0x25019f['message']['id']:0x0,_0x25019f[_0x8edf('0x17')]?_0x25019f['interaction']['id']:0x0);if(_0x567f3c[_0x8edf('0x14')][_0x4c415a]){_0x567f3c[_0x8edf('0x14')][_0x4c415a][_0x8edf('0x32')](_0x8edf('0x33'));}return _0xae982({'code':0xc8,'message':_0x25019f});}catch(_0x4c813a){logger[_0x8edf('0x2d')](_0x4c813a['stack']);return _0x5b26d4(_0x7734de[_0x8edf('0x2d')](0x1f4,_0x4c813a));}}logger[_0x8edf('0x2d')](_0x8edf('0x3b'));return _0x5b26d4(_0x7734de[_0x8edf('0x2d')](0x1f4,_0x8edf('0x3b')));});},'AgentCapacity':function(_0x5cde2f){var _0x204b48=this;return new Promise(function(_0x52376e,_0x52f6dc){if(_0x567f3c['agents'][_0x8edf('0x40')](_0x5cde2f['id'])){for(var _0x526f50 in _0x5cde2f[_0x8edf('0x41')]){if(_0x5cde2f[_0x8edf('0x41')][_0x8edf('0x40')](_0x526f50)){if(_0x567f3c[_0x8edf('0x3d')][_0x5cde2f['id']][_0x8edf('0x40')](_0x526f50+_0x8edf('0x42'))){_0x567f3c['agents'][_0x5cde2f['id']][_0x526f50+_0x8edf('0x42')]=parseInt(_0x5cde2f[_0x8edf('0x41')][_0x526f50],0xa);}}}_0x567f3c[_0x8edf('0x3d')][_0x5cde2f['id']][_0x8edf('0x43')]();return _0x52376e({'code':0xc8,'message':_0x567f3c[_0x8edf('0x3d')][_0x5cde2f['id']]});}else{return _0x52f6dc(_0x204b48[_0x8edf('0x2d')](0x1f4,_0x8edf('0x44')));}});},'Agents':function(_0x173080){return new Promise(function(_0x3f8d70,_0x21535b){var _0x5f449c=_[_0x8edf('0x45')](_0x567f3c[_0x8edf('0x3d')]);_0x3f8d70({'count':_0x5f449c[_0x8edf('0x1a')],'rows':_0x5f449c});});},'ChatQueues':function(_0x34b8c3){return new Promise(function(_0x538b58,_0x1eeeb2){var _0x5b84cc=[];for(var _0x5b0412 in _0x567f3c[_0x8edf('0x46')]){if(_0x567f3c[_0x8edf('0x46')][_0x8edf('0x40')](_0x5b0412)){var _0x152754=_0x567f3c[_0x8edf('0x46')][_0x5b0412];var _0x283bf5={'id':_0x152754['id'],'available':_0x152754['available'],'loggedIn':_0x152754[_0x8edf('0x47')],'name':_0x152754['name'],'paused':_0x152754['paused'],'waiting':_0x152754[_0x8edf('0x48')]};_0x5b84cc[_0x8edf('0x20')](_0x283bf5);}}_0x538b58({'count':_0x5b84cc[_0x8edf('0x1a')],'rows':_0x5b84cc});});},'MailQueues':function(_0x3663ad){return new Promise(function(_0x439b82,_0x4fb160){var _0x30754f=[];for(var _0x4b1cc2 in _0x567f3c[_0x8edf('0x49')]){if(_0x567f3c[_0x8edf('0x49')][_0x8edf('0x40')](_0x4b1cc2)){var _0x58ef3f=_0x567f3c[_0x8edf('0x49')][_0x4b1cc2];var _0x413164={'id':_0x58ef3f['id'],'available':_0x58ef3f[_0x8edf('0x4a')],'loggedIn':_0x58ef3f[_0x8edf('0x47')],'name':_0x58ef3f[_0x8edf('0x4b')],'paused':_0x58ef3f[_0x8edf('0x4c')],'waiting':_0x58ef3f['waiting']};_0x30754f['push'](_0x413164);}}_0x439b82({'count':_0x30754f[_0x8edf('0x1a')],'rows':_0x30754f});});},'OpenchannelQueues':function(_0x8c4644){return new Promise(function(_0x6dce45,_0x55f1ae){var _0x5abc91=[];for(var _0x3a8fed in _0x567f3c[_0x8edf('0x4d')]){if(_0x567f3c['openchannelQueues']['hasOwnProperty'](_0x3a8fed)){var _0xbc4c06=_0x567f3c[_0x8edf('0x4d')][_0x3a8fed];var _0xaae3e3={'id':_0xbc4c06['id'],'available':_0xbc4c06[_0x8edf('0x4a')],'loggedIn':_0xbc4c06[_0x8edf('0x47')],'name':_0xbc4c06[_0x8edf('0x4b')],'paused':_0xbc4c06['paused'],'waiting':_0xbc4c06[_0x8edf('0x48')]};_0x5abc91[_0x8edf('0x20')](_0xaae3e3);}}_0x6dce45({'count':_0x5abc91[_0x8edf('0x1a')],'rows':_0x5abc91});});},'SmsQueues':function(_0x3708d9){return new Promise(function(_0x10d792,_0x14b03f){var _0x1afb39=[];for(var _0x528745 in _0x567f3c[_0x8edf('0x4e')]){if(_0x567f3c[_0x8edf('0x4e')][_0x8edf('0x40')](_0x528745)){var _0x2f995f=_0x567f3c[_0x8edf('0x4e')][_0x528745];var _0x76f29b={'id':_0x2f995f['id'],'available':_0x2f995f[_0x8edf('0x4a')],'loggedIn':_0x2f995f[_0x8edf('0x47')],'name':_0x2f995f[_0x8edf('0x4b')],'paused':_0x2f995f[_0x8edf('0x4c')],'waiting':_0x2f995f[_0x8edf('0x48')]};_0x1afb39[_0x8edf('0x20')](_0x76f29b);}}_0x10d792({'count':_0x1afb39[_0x8edf('0x1a')],'rows':_0x1afb39});});},'FaxQueues':function(_0x51aacb){return new Promise(function(_0x1829f8,_0xf3659){var _0x5739a7=[];for(var _0x2cb0ce in _0x567f3c[_0x8edf('0x4f')]){if(_0x567f3c[_0x8edf('0x4f')][_0x8edf('0x40')](_0x2cb0ce)){var _0x5296c7=_0x567f3c[_0x8edf('0x4f')][_0x2cb0ce];var _0x5b66b6={'id':_0x5296c7['id'],'available':_0x5296c7['available'],'loggedIn':_0x5296c7['loggedIn'],'name':_0x5296c7[_0x8edf('0x4b')],'paused':_0x5296c7['paused'],'waiting':_0x5296c7[_0x8edf('0x48')]};_0x5739a7['push'](_0x5b66b6);}}_0x1829f8({'count':_0x5739a7['length'],'rows':_0x5739a7});});},'ChatQueuesWaitingInteractions':function(_0x21e7cd){return new Promise(function(_0x3a059b,_0x19fed1){var _0x45ac47=_['values'](_0x567f3c[_0x8edf('0x50')]);_0x3a059b({'count':_0x45ac47['length'],'rows':_0x45ac47});});},'MailQueuesWaitingInteractions':function(_0x2f5ff3){return new Promise(function(_0x33f1f0,_0x53e574){var _0x1db9e0=_[_0x8edf('0x45')](_0x567f3c[_0x8edf('0x51')]);_0x33f1f0({'count':_0x1db9e0[_0x8edf('0x1a')],'rows':_0x1db9e0});});},'OpenchannelQueuesWaitingInteractions':function(_0x51634e){return new Promise(function(_0x11c78d,_0x4201ad){var _0x332801=_[_0x8edf('0x45')](_0x567f3c[_0x8edf('0x52')]);_0x11c78d({'count':_0x332801[_0x8edf('0x1a')],'rows':_0x332801});});},'SmsQueuesWaitingInteractions':function(_0x882a76){return new Promise(function(_0x2ad1a8,_0x1767d0){var _0x1824f2=_['values'](_0x567f3c[_0x8edf('0x53')]);_0x2ad1a8({'count':_0x1824f2['length'],'rows':_0x1824f2});});},'FaxQueuesWaitingInteractions':function(_0x4b0bc6){return new Promise(function(_0x38ded6,_0x2fac58){var _0x4644e3=_[_0x8edf('0x45')](_0x567f3c[_0x8edf('0x54')]);_0x38ded6({'count':_0x4644e3[_0x8edf('0x1a')],'rows':_0x4644e3});});}};var _0x3d7b68=jayson[_0x8edf('0x55')](_0x155acf)['http']();_0x3d7b68['on'](_0x8edf('0x2d'),function(_0x540d57){logger[_0x8edf('0x2d')](JSON[_0x8edf('0x56')](_0x540d57));return _0x578f23(_0x540d57);});_0x3d7b68[_0x8edf('0x13')](0x232c,_0x8edf('0x57'),function(){console[_0x8edf('0x58')](_0x8edf('0x59'),0x232c);return _0x4d3d96(_0x8edf('0x5a')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index acfcf71..c2627b9 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 _0x23bb=['info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','Command','iftime\x20%s','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','log','error','bluebird','lodash','http','request','then','message','result','catch','condition','rules'];(function(_0x3b8a2a,_0x55c313){var _0x24472c=function(_0x5bbb33){while(--_0x5bbb33){_0x3b8a2a['push'](_0x3b8a2a['shift']());}};_0x24472c(++_0x55c313);}(_0x23bb,0xbe));var _0xb23b=function(_0x129954,_0x17b156){_0x129954=_0x129954-0x0;var _0x2b40f2=_0x23bb[_0x129954];return _0x2b40f2;};'use strict';var util=require('util');var BPromise=require(_0xb23b('0x0'));var jayson=require('jayson/promise');var _=require(_0xb23b('0x1'));var logger=require('../../../config/logger')('routing');var client=jayson['client'][_0xb23b('0x2')]({'port':0x232a});function request(_0x71e648,_0x5b49e7){return new BPromise(function(_0x372ac3,_0x4dc59c){return client[_0xb23b('0x3')](_0x71e648,_0x5b49e7)[_0xb23b('0x4')](function(_0x394941){if(_0x394941['error']){return _0x4dc59c(_0x394941['error'][_0xb23b('0x5')]);}else{return _0x372ac3(_0x394941[_0xb23b('0x6')]);}})[_0xb23b('0x7')](function(_0x403d31){return _0x4dc59c(_0x403d31);});});}exports[_0xb23b('0x8')]=function(_0x543237,_0xb18123,_0x2571f1){return function(_0x9f1a71){if(_0x2571f1['rules']&&!_0x2571f1[_0xb23b('0x9')][_0x543237]){logger[_0xb23b('0xa')](_0xb23b('0xb'),_0x543237);return _0x9f1a71[_0xb23b('0xc')]();}var _0x3ce670=[];for(var _0x22f733=0x0;_0x22f733<_0xb18123[_0xb23b('0xd')];_0x22f733+=0x1){_0x3ce670['push'](request(_0xb23b('0xe'),{'command':util['format'](_0xb23b('0xf'),_0xb18123[_0x22f733])})['then'](function(_0x210346){return _0x210346&&_0x210346[_0xb23b('0x5')]&&_0x210346['message']['indexOf'](_0xb23b('0x10'))>=0x0?!![]:![];})[_0xb23b('0x7')](function(_0x42bc74){logger['error'](_0xb23b('0x11'),_0x543237,_0xb18123[_0x22f733]);}));}BPromise[_0xb23b('0x12')](_0x3ce670)['then'](function(_0x2ce5d5){var _0x4994ac=_[_0xb23b('0x13')](_0x2ce5d5);logger['info'](_0xb23b('0x14'),_0x543237,_0xb18123[_0xb23b('0x15')](_0xb23b('0x16')),_0x4994ac);_0x9f1a71['when'](_0x4994ac);})[_0xb23b('0x7')](function(_0x25b69b){console[_0xb23b('0x17')](_0x25b69b);logger[_0xb23b('0x18')](_0xb23b('0x14'),_0x543237,_0xb18123[_0xb23b('0x15')](_0xb23b('0x16')),_0x25b69b['stack']);_0x9f1a71[_0xb23b('0xc')]();});};}; \ No newline at end of file +var _0xd6cc=['error','message','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','push','Command','format','indexOf','true','some','join','\x20|\x20','when','log','[%s][INTERVAL]\x20%s\x20%s','stack','stop','util','jayson/promise','lodash','../../../config/logger','routing','client','http','request','then'];(function(_0xb0de07,_0x3ca2a0){var _0x4633d8=function(_0x2368e0){while(--_0x2368e0){_0xb0de07['push'](_0xb0de07['shift']());}};_0x4633d8(++_0x3ca2a0);}(_0xd6cc,0x170));var _0xcd6c=function(_0x300015,_0x5afd27){_0x300015=_0x300015-0x0;var _0x20cdbb=_0xd6cc[_0x300015];return _0x20cdbb;};'use strict';var util=require(_0xcd6c('0x0'));var BPromise=require('bluebird');var jayson=require(_0xcd6c('0x1'));var _=require(_0xcd6c('0x2'));var logger=require(_0xcd6c('0x3'))(_0xcd6c('0x4'));var client=jayson[_0xcd6c('0x5')][_0xcd6c('0x6')]({'port':0x232a});function request(_0xc9f40,_0x42f55d){return new BPromise(function(_0x5bc49d,_0x206215){return client[_0xcd6c('0x7')](_0xc9f40,_0x42f55d)[_0xcd6c('0x8')](function(_0x238316){if(_0x238316['error']){return _0x206215(_0x238316[_0xcd6c('0x9')][_0xcd6c('0xa')]);}else{return _0x5bc49d(_0x238316['result']);}})[_0xcd6c('0xb')](function(_0x58c7d6){return _0x206215(_0x58c7d6);});});}exports[_0xcd6c('0xc')]=function(_0x3e4419,_0x2eafa0,_0x1523a9){return function(_0x312c4b){if(_0x1523a9[_0xcd6c('0xd')]&&!_0x1523a9['rules'][_0x3e4419]){logger[_0xcd6c('0xe')](_0xcd6c('0xf'),_0x3e4419);return _0x312c4b['stop']();}var _0x1df577=[];for(var _0x25583c=0x0;_0x25583c<_0x2eafa0['length'];_0x25583c+=0x1){_0x1df577[_0xcd6c('0x10')](request(_0xcd6c('0x11'),{'command':util[_0xcd6c('0x12')]('iftime\x20%s',_0x2eafa0[_0x25583c])})[_0xcd6c('0x8')](function(_0x593e05){return _0x593e05&&_0x593e05[_0xcd6c('0xa')]&&_0x593e05[_0xcd6c('0xa')][_0xcd6c('0x13')](_0xcd6c('0x14'))>=0x0?!![]:![];})[_0xcd6c('0xb')](function(_0x934e5d){logger[_0xcd6c('0x9')]('[%s][INTERVAL]\x20%s',_0x3e4419,_0x2eafa0[_0x25583c]);}));}BPromise['all'](_0x1df577)[_0xcd6c('0x8')](function(_0x4f09e5){var _0x1e8720=_[_0xcd6c('0x15')](_0x4f09e5);logger[_0xcd6c('0xe')]('[%s][INTERVAL]\x20%s\x20%s',_0x3e4419,_0x2eafa0[_0xcd6c('0x16')](_0xcd6c('0x17')),_0x1e8720);_0x312c4b[_0xcd6c('0x18')](_0x1e8720);})[_0xcd6c('0xb')](function(_0x25f283){console[_0xcd6c('0x19')](_0x25f283);logger['error'](_0xcd6c('0x1a'),_0x3e4419,_0x2eafa0[_0xcd6c('0x16')](_0xcd6c('0x17')),_0x25f283[_0xcd6c('0x1b')]);_0x312c4b[_0xcd6c('0x1c')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 757cdc5..57d58f0 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 _0xe98f=['hangup','lodash','util','./utils','info','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','queue','membername','lastevent','getVoiceQueueByName','then','agentacw','agentcomplete','acwtime','acwTimeout','CreateVoiceAgentReport','request','destuniqueid','agentcalled','now','called','connectedlinenum','connectedlinename','error','stack','isNil','agentringnoanswer','agentringnoanswerAt','rejected','reason','holdtime','ringtime','talktime','queuecallerabandon','forIn','abandoned','agentconnect','connect','answered_elsewhere','agentcompleteAt','diffTime','agentconnectAt','complete','blindtransfer','transfereruniqueid','transfertype','transferexten','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','transfer','ATTENDED','origtransfererexten','transfereeuniqueid','clone','calleridnum','calleridname','agententerreason','secondtransfererlinkedid','transfertargetuniqueid'];(function(_0x2f41f2,_0x2ebd1e){var _0x4df6e5=function(_0xaff35d){while(--_0xaff35d){_0x2f41f2['push'](_0x2f41f2['shift']());}};_0x4df6e5(++_0x2ebd1e);}(_0xe98f,0xc1));var _0xfe98=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xe98f[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xfe98('0x0'));var util=require(_0xfe98('0x1'));var utils=require(_0xfe98('0x2'));var agents={};var transfers={};function writeDB(_0x94eca1,_0x14c270){utils[_0xfe98('0x3')](util['format'](_0xfe98('0x4'),_0x94eca1[_0xfe98('0x5')],_0x94eca1[_0xfe98('0x6')],_0x94eca1[_0xfe98('0x7')],_0x94eca1[_0xfe98('0x8')],_0x94eca1['interface'],_0x94eca1['calleridnum'],_0x94eca1['connectedlinenum'],_0x94eca1[_0xfe98('0x9')]));if(_0x94eca1[_0xfe98('0x7')]){utils[_0xfe98('0xa')](_0x94eca1[_0xfe98('0x7')])[_0xfe98('0xb')](function(_0x3a30e0){if(_0x3a30e0){_0x94eca1['type']=_0x3a30e0['type'];_0x94eca1[_0xfe98('0xc')]=_0x94eca1[_0xfe98('0xd')]?_0x3a30e0['acw']:![];_0x94eca1[_0xfe98('0xe')]=_0x94eca1[_0xfe98('0xc')]?_0x3a30e0[_0xfe98('0xf')]:0x0;}utils['request'](_0xfe98('0x10'),_0x94eca1);});}else{utils[_0xfe98('0x11')](_0xfe98('0x10'),_0x94eca1);}if(_0x14c270){delete transfers[_0x94eca1[_0xfe98('0x5')]];}else{delete agents[_0x94eca1[_0xfe98('0x12')]];}}exports[_0xfe98('0x13')]=function(_0x195df9){try{agents[_0x195df9['destuniqueid']]=_0x195df9;agents[_0x195df9[_0xfe98('0x12')]]['agentcalledAt']=utils[_0xfe98('0x14')]();agents[_0x195df9[_0xfe98('0x12')]][_0xfe98('0x9')]=_0xfe98('0x15');agents[_0x195df9[_0xfe98('0x12')]][_0xfe98('0x16')]=null;agents[_0x195df9['destuniqueid']][_0xfe98('0x17')]=null;}catch(_0x4e4644){utils[_0xfe98('0x18')](_0x4e4644[_0xfe98('0x19')]);}};exports['agentringnoanswer']=function(_0x5a0e0f){try{if(!_[_0xfe98('0x1a')](agents[_0x5a0e0f[_0xfe98('0x12')]])){agents[_0x5a0e0f[_0xfe98('0x12')]][_0xfe98('0x1b')]=!![];agents[_0x5a0e0f[_0xfe98('0x12')]][_0xfe98('0x1c')]=utils['now']();agents[_0x5a0e0f[_0xfe98('0x12')]][_0xfe98('0x9')]=_0xfe98('0x1d');agents[_0x5a0e0f[_0xfe98('0x12')]][_0xfe98('0x1e')]='rejected';agents[_0x5a0e0f['destuniqueid']][_0xfe98('0x1f')]=_0x5a0e0f[_0xfe98('0x20')]?parseInt(_0x5a0e0f[_0xfe98('0x20')])/0x3e8:0x0;agents[_0x5a0e0f[_0xfe98('0x12')]][_0xfe98('0x21')]=0x0;writeDB(agents[_0x5a0e0f[_0xfe98('0x12')]]);}}catch(_0x20522e){utils[_0xfe98('0x18')](_0x20522e[_0xfe98('0x19')]);}};exports[_0xfe98('0x22')]=function(_0xd9ef77){try{_[_0xfe98('0x23')](agents,function(_0x2ce1fc,_0xf4bc12){if(_0x2ce1fc[_0xfe98('0x5')]==_0xd9ef77['uniqueid']){_0x2ce1fc['agentringnoanswer']=!![];_0x2ce1fc['agentringnoanswerAt']=utils['now']();_0x2ce1fc['lastevent']='abandoned';_0x2ce1fc['reason']=_0xfe98('0x24');_0x2ce1fc[_0xfe98('0x1f')]=_0xd9ef77[_0xfe98('0x1f')];_0x2ce1fc[_0xfe98('0x21')]=0x0;writeDB(_0x2ce1fc);}});}catch(_0x1bccc6){utils['error'](_0x1bccc6[_0xfe98('0x19')]);}};exports[_0xfe98('0x25')]=function(_0x6ebe1c){try{if(agents[_0x6ebe1c[_0xfe98('0x12')]]){agents[_0x6ebe1c[_0xfe98('0x12')]]['agentconnectAt']=utils[_0xfe98('0x14')]();agents[_0x6ebe1c['destuniqueid']][_0xfe98('0x16')]=_0x6ebe1c[_0xfe98('0x16')];agents[_0x6ebe1c[_0xfe98('0x12')]][_0xfe98('0x17')]=_0x6ebe1c['connectedlinename'];agents[_0x6ebe1c['destuniqueid']][_0xfe98('0x1f')]=_0x6ebe1c['ringtime'];agents[_0x6ebe1c['destuniqueid']]['lastevent']=_0xfe98('0x26');_['forIn'](agents,function(_0x35c924,_0x1d4142){if(_0x35c924['destuniqueid']!=_0x6ebe1c['destuniqueid']&&_0x35c924[_0xfe98('0x5')]==_0x6ebe1c['uniqueid']){_0x35c924['talktime']=0x0;_0x35c924['holdtime']=_0x6ebe1c['ringtime'];_0x35c924[_0xfe98('0x1b')]=!![];_0x35c924[_0xfe98('0x1c')]=utils[_0xfe98('0x14')]();_0x35c924[_0xfe98('0x9')]=_0xfe98('0x27');_0x35c924['reason']=_0xfe98('0x27');_0x35c924['answeredelsewheredestinationuniqueid']=_0x6ebe1c[_0xfe98('0x12')];_0x35c924['answeredelsewheremembername']=_0x6ebe1c[_0xfe98('0x8')];writeDB(_0x35c924);}});}}catch(_0x455420){utils[_0xfe98('0x18')](_0x455420[_0xfe98('0x19')]);}};exports[_0xfe98('0xd')]=function(_0x1567a8){try{if(!_['isNil'](agents[_0x1567a8[_0xfe98('0x12')]])){agents[_0x1567a8[_0xfe98('0x12')]]['agentcomplete']=!![];agents[_0x1567a8[_0xfe98('0x12')]][_0xfe98('0x28')]=utils['now']();agents[_0x1567a8[_0xfe98('0x12')]]['talktime']=utils[_0xfe98('0x29')](agents[_0x1567a8['destuniqueid']]['agentcompleteAt'],agents[_0x1567a8[_0xfe98('0x12')]][_0xfe98('0x2a')]);agents[_0x1567a8[_0xfe98('0x12')]][_0xfe98('0x1e')]=_0x1567a8[_0xfe98('0x1e')];agents[_0x1567a8[_0xfe98('0x12')]][_0xfe98('0x9')]=_0xfe98('0x2b');writeDB(agents[_0x1567a8[_0xfe98('0x12')]]);}}catch(_0x42201d){utils[_0xfe98('0x18')](_0x42201d[_0xfe98('0x19')]);}};exports[_0xfe98('0x2c')]=function(_0x1b1dc4){try{if(!_['isNil'](agents[_0x1b1dc4[_0xfe98('0x2d')]])){agents[_0x1b1dc4[_0xfe98('0x2d')]]['transfer']=!![];agents[_0x1b1dc4[_0xfe98('0x2d')]][_0xfe98('0x2e')]='blind';agents[_0x1b1dc4[_0xfe98('0x2d')]][_0xfe98('0x2f')]=_0x1b1dc4['extension'];agents[_0x1b1dc4[_0xfe98('0x2d')]][_0xfe98('0x30')]=agents[_0x1b1dc4[_0xfe98('0x2d')]][_0xfe98('0x5')];}}catch(_0x323ccd){utils['error'](_0x323ccd[_0xfe98('0x19')]);}};exports[_0xfe98('0x31')]=function(_0xc873c7){try{if(_0xc873c7[_0xfe98('0x32')]==_0xc873c7[_0xfe98('0x33')]){if(!_[_0xfe98('0x1a')](agents[_0xc873c7[_0xfe98('0x34')]])){agents[_0xc873c7[_0xfe98('0x34')]][_0xfe98('0x35')]=!![];agents[_0xc873c7['secondtransfereruniqueid']][_0xfe98('0x2e')]=_0xfe98('0x36');agents[_0xc873c7['secondtransfereruniqueid']][_0xfe98('0x2f')]=_0xc873c7[_0xfe98('0x37')];agents[_0xc873c7[_0xfe98('0x34')]][_0xfe98('0x30')]=_0xc873c7['origtransfereruniqueid'];}if(_0xc873c7[_0xfe98('0x38')]&&agents[_0xc873c7['transfereeuniqueid']]){agents[_0xc873c7[_0xfe98('0x38')]]['agententerreason']=0x1;transfers[_0xc873c7[_0xfe98('0x38')]]=_[_0xfe98('0x39')](agents[_0xc873c7['transfereeuniqueid']]);transfers[_0xc873c7[_0xfe98('0x38')]][_0xfe98('0x3a')]=agents[_0xc873c7[_0xfe98('0x34')]][_0xfe98('0x3a')];transfers[_0xc873c7[_0xfe98('0x38')]][_0xfe98('0x3b')]=agents[_0xc873c7['secondtransfereruniqueid']][_0xfe98('0x3b')];transfers[_0xc873c7[_0xfe98('0x38')]]['agentcalledAt']=utils[_0xfe98('0x14')]();transfers[_0xc873c7['transfereeuniqueid']]['agentconnectAt']=utils[_0xfe98('0x14')]();transfers[_0xc873c7['transfereeuniqueid']]['holdtime']=0x0;transfers[_0xc873c7[_0xfe98('0x38')]][_0xfe98('0x3c')]=0x2;}}else if(_0xc873c7['secondtransfereruniqueid']==_0xc873c7[_0xfe98('0x3d')]){if(!_[_0xfe98('0x1a')](agents[_0xc873c7[_0xfe98('0x32')]])){agents[_0xc873c7[_0xfe98('0x32')]][_0xfe98('0x35')]=!![];agents[_0xc873c7[_0xfe98('0x32')]][_0xfe98('0x2e')]=_0xfe98('0x36');agents[_0xc873c7[_0xfe98('0x32')]][_0xfe98('0x2f')]=_0xc873c7['secondtransfererexten'];agents[_0xc873c7[_0xfe98('0x32')]][_0xfe98('0x30')]=_0xc873c7[_0xfe98('0x34')];}if(_0xc873c7[_0xfe98('0x3e')]&&agents[_0xc873c7[_0xfe98('0x3e')]]){agents[_0xc873c7['transfertargetuniqueid']][_0xfe98('0x3c')]=0x1;transfers[_0xc873c7[_0xfe98('0x3e')]]=_['clone'](agents[_0xc873c7[_0xfe98('0x3e')]]);transfers[_0xc873c7['transfertargetuniqueid']]['calleridnum']=agents[_0xc873c7[_0xfe98('0x32')]][_0xfe98('0x3a')];transfers[_0xc873c7['transfertargetuniqueid']]['calleridname']=agents[_0xc873c7[_0xfe98('0x32')]][_0xfe98('0x3b')];transfers[_0xc873c7[_0xfe98('0x3e')]]['agentcalledAt']=utils[_0xfe98('0x14')]();transfers[_0xc873c7[_0xfe98('0x3e')]][_0xfe98('0x2a')]=utils[_0xfe98('0x14')]();transfers[_0xc873c7[_0xfe98('0x3e')]][_0xfe98('0x1f')]=0x0;transfers[_0xc873c7['transfertargetuniqueid']][_0xfe98('0x3c')]=0x2;}}}catch(_0x478495){utils[_0xfe98('0x18')](_0x478495[_0xfe98('0x19')]);}};exports[_0xfe98('0x3f')]=function(_0x34180c){try{if(transfers[_0x34180c[_0xfe98('0x5')]]){transfers[_0x34180c['uniqueid']][_0xfe98('0xd')]=!![];transfers[_0x34180c[_0xfe98('0x5')]][_0xfe98('0x28')]=utils[_0xfe98('0x14')]();transfers[_0x34180c[_0xfe98('0x5')]][_0xfe98('0x21')]=utils[_0xfe98('0x29')](transfers[_0x34180c[_0xfe98('0x5')]][_0xfe98('0x28')],transfers[_0x34180c['uniqueid']]['agentconnectAt']);transfers[_0x34180c[_0xfe98('0x5')]][_0xfe98('0x1e')]='agent';transfers[_0x34180c[_0xfe98('0x5')]][_0xfe98('0x9')]='complete';writeDB(transfers[_0x34180c[_0xfe98('0x5')]],!![]);}if(agents[_0x34180c[_0xfe98('0x5')]]&&agents[_0x34180c[_0xfe98('0x5')]][_0xfe98('0x2a')]){agents[_0x34180c[_0xfe98('0x5')]][_0xfe98('0xd')]=!![];agents[_0x34180c[_0xfe98('0x5')]]['agentcompleteAt']=utils[_0xfe98('0x14')]();agents[_0x34180c[_0xfe98('0x5')]]['talktime']=utils[_0xfe98('0x29')](agents[_0x34180c[_0xfe98('0x5')]][_0xfe98('0x28')],agents[_0x34180c['uniqueid']][_0xfe98('0x2a')]);agents[_0x34180c[_0xfe98('0x5')]]['reason']=agents[_0x34180c[_0xfe98('0x5')]]['transfer']?_0xfe98('0x35'):'agent';agents[_0x34180c[_0xfe98('0x5')]][_0xfe98('0x9')]='complete';writeDB(agents[_0x34180c[_0xfe98('0x5')]]);}}catch(_0x383ef7){utils[_0xfe98('0x18')](_0x383ef7[_0xfe98('0x19')]);}}; \ No newline at end of file +var _0xcd54=['agentcalledAt','now','called','connectedlinename','error','agentringnoanswer','isNil','reason','rejected','holdtime','ringtime','talktime','stack','queuecallerabandon','forIn','abandoned','agentconnectAt','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','membername','agentcompleteAt','diffTime','complete','transfereruniqueid','transfer','transfertype','blind','transferexten','extension','attendedtransfer','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','origtransfererexten','transferuniqueid','origtransfereruniqueid','transfereeuniqueid','clone','calleridname','secondtransfererlinkedid','transfertargetuniqueid','agententerreason','hangup','agent','lodash','util','./utils','format','uniqueid','channel','queue','interface','calleridnum','connectedlinenum','lastevent','then','type','agentacw','agentcomplete','acw','acwTimeout','request','CreateVoiceAgentReport','destuniqueid'];(function(_0x463af5,_0x3dc8b0){var _0x1a24ad=function(_0x1e2c26){while(--_0x1e2c26){_0x463af5['push'](_0x463af5['shift']());}};_0x1a24ad(++_0x3dc8b0);}(_0xcd54,0xaf));var _0x4cd5=function(_0xcb69a3,_0x5c49b3){_0xcb69a3=_0xcb69a3-0x0;var _0x133b27=_0xcd54[_0xcb69a3];return _0x133b27;};'use strict';var _=require(_0x4cd5('0x0'));var util=require(_0x4cd5('0x1'));var utils=require(_0x4cd5('0x2'));var agents={};var transfers={};function writeDB(_0x5a4392,_0x51e2ed){utils['info'](util[_0x4cd5('0x3')]('AGENT|%s|%s|%s|%s|%s|%s|%s|%s',_0x5a4392[_0x4cd5('0x4')],_0x5a4392[_0x4cd5('0x5')],_0x5a4392[_0x4cd5('0x6')],_0x5a4392['membername'],_0x5a4392[_0x4cd5('0x7')],_0x5a4392[_0x4cd5('0x8')],_0x5a4392[_0x4cd5('0x9')],_0x5a4392[_0x4cd5('0xa')]));if(_0x5a4392[_0x4cd5('0x6')]){utils['getVoiceQueueByName'](_0x5a4392[_0x4cd5('0x6')])[_0x4cd5('0xb')](function(_0x12fb99){if(_0x12fb99){_0x5a4392[_0x4cd5('0xc')]=_0x12fb99['type'];_0x5a4392[_0x4cd5('0xd')]=_0x5a4392[_0x4cd5('0xe')]?_0x12fb99[_0x4cd5('0xf')]:![];_0x5a4392['acwtime']=_0x5a4392[_0x4cd5('0xd')]?_0x12fb99[_0x4cd5('0x10')]:0x0;}utils[_0x4cd5('0x11')](_0x4cd5('0x12'),_0x5a4392);});}else{utils['request'](_0x4cd5('0x12'),_0x5a4392);}if(_0x51e2ed){delete transfers[_0x5a4392[_0x4cd5('0x4')]];}else{delete agents[_0x5a4392[_0x4cd5('0x13')]];}}exports['agentcalled']=function(_0x377e5a){try{agents[_0x377e5a[_0x4cd5('0x13')]]=_0x377e5a;agents[_0x377e5a[_0x4cd5('0x13')]][_0x4cd5('0x14')]=utils[_0x4cd5('0x15')]();agents[_0x377e5a[_0x4cd5('0x13')]][_0x4cd5('0xa')]=_0x4cd5('0x16');agents[_0x377e5a[_0x4cd5('0x13')]]['connectedlinenum']=null;agents[_0x377e5a[_0x4cd5('0x13')]][_0x4cd5('0x17')]=null;}catch(_0x4f4049){utils[_0x4cd5('0x18')](_0x4f4049['stack']);}};exports[_0x4cd5('0x19')]=function(_0x3a1315){try{if(!_[_0x4cd5('0x1a')](agents[_0x3a1315[_0x4cd5('0x13')]])){agents[_0x3a1315[_0x4cd5('0x13')]][_0x4cd5('0x19')]=!![];agents[_0x3a1315[_0x4cd5('0x13')]]['agentringnoanswerAt']=utils[_0x4cd5('0x15')]();agents[_0x3a1315[_0x4cd5('0x13')]][_0x4cd5('0xa')]='rejected';agents[_0x3a1315['destuniqueid']][_0x4cd5('0x1b')]=_0x4cd5('0x1c');agents[_0x3a1315[_0x4cd5('0x13')]][_0x4cd5('0x1d')]=_0x3a1315[_0x4cd5('0x1e')]?parseInt(_0x3a1315[_0x4cd5('0x1e')])/0x3e8:0x0;agents[_0x3a1315['destuniqueid']][_0x4cd5('0x1f')]=0x0;writeDB(agents[_0x3a1315[_0x4cd5('0x13')]]);}}catch(_0x1e9456){utils[_0x4cd5('0x18')](_0x1e9456[_0x4cd5('0x20')]);}};exports[_0x4cd5('0x21')]=function(_0x489791){try{_[_0x4cd5('0x22')](agents,function(_0x91d091,_0x35f81b){if(_0x91d091[_0x4cd5('0x4')]==_0x489791[_0x4cd5('0x4')]){_0x91d091[_0x4cd5('0x19')]=!![];_0x91d091['agentringnoanswerAt']=utils[_0x4cd5('0x15')]();_0x91d091[_0x4cd5('0xa')]=_0x4cd5('0x23');_0x91d091[_0x4cd5('0x1b')]=_0x4cd5('0x23');_0x91d091[_0x4cd5('0x1d')]=_0x489791[_0x4cd5('0x1d')];_0x91d091[_0x4cd5('0x1f')]=0x0;writeDB(_0x91d091);}});}catch(_0x19bee3){utils['error'](_0x19bee3['stack']);}};exports['agentconnect']=function(_0x58cb5c){try{if(agents[_0x58cb5c[_0x4cd5('0x13')]]){agents[_0x58cb5c[_0x4cd5('0x13')]][_0x4cd5('0x24')]=utils[_0x4cd5('0x15')]();agents[_0x58cb5c['destuniqueid']][_0x4cd5('0x9')]=_0x58cb5c['connectedlinenum'];agents[_0x58cb5c['destuniqueid']][_0x4cd5('0x17')]=_0x58cb5c[_0x4cd5('0x17')];agents[_0x58cb5c[_0x4cd5('0x13')]][_0x4cd5('0x1d')]=_0x58cb5c[_0x4cd5('0x1e')];agents[_0x58cb5c['destuniqueid']][_0x4cd5('0xa')]='connect';_['forIn'](agents,function(_0x36e8dd,_0x294d43){if(_0x36e8dd[_0x4cd5('0x13')]!=_0x58cb5c[_0x4cd5('0x13')]&&_0x36e8dd[_0x4cd5('0x4')]==_0x58cb5c[_0x4cd5('0x4')]){_0x36e8dd[_0x4cd5('0x1f')]=0x0;_0x36e8dd[_0x4cd5('0x1d')]=_0x58cb5c[_0x4cd5('0x1e')];_0x36e8dd['agentringnoanswer']=!![];_0x36e8dd['agentringnoanswerAt']=utils[_0x4cd5('0x15')]();_0x36e8dd[_0x4cd5('0xa')]=_0x4cd5('0x25');_0x36e8dd[_0x4cd5('0x1b')]=_0x4cd5('0x25');_0x36e8dd[_0x4cd5('0x26')]=_0x58cb5c[_0x4cd5('0x13')];_0x36e8dd[_0x4cd5('0x27')]=_0x58cb5c[_0x4cd5('0x28')];writeDB(_0x36e8dd);}});}}catch(_0x2ad905){utils['error'](_0x2ad905[_0x4cd5('0x20')]);}};exports['agentcomplete']=function(_0x5d33fb){try{if(!_[_0x4cd5('0x1a')](agents[_0x5d33fb[_0x4cd5('0x13')]])){agents[_0x5d33fb[_0x4cd5('0x13')]]['agentcomplete']=!![];agents[_0x5d33fb[_0x4cd5('0x13')]][_0x4cd5('0x29')]=utils[_0x4cd5('0x15')]();agents[_0x5d33fb['destuniqueid']][_0x4cd5('0x1f')]=utils[_0x4cd5('0x2a')](agents[_0x5d33fb['destuniqueid']][_0x4cd5('0x29')],agents[_0x5d33fb[_0x4cd5('0x13')]]['agentconnectAt']);agents[_0x5d33fb[_0x4cd5('0x13')]][_0x4cd5('0x1b')]=_0x5d33fb['reason'];agents[_0x5d33fb[_0x4cd5('0x13')]][_0x4cd5('0xa')]=_0x4cd5('0x2b');writeDB(agents[_0x5d33fb[_0x4cd5('0x13')]]);}}catch(_0x4ee7bb){utils[_0x4cd5('0x18')](_0x4ee7bb[_0x4cd5('0x20')]);}};exports['blindtransfer']=function(_0x52ecde){try{if(!_[_0x4cd5('0x1a')](agents[_0x52ecde[_0x4cd5('0x2c')]])){agents[_0x52ecde[_0x4cd5('0x2c')]][_0x4cd5('0x2d')]=!![];agents[_0x52ecde[_0x4cd5('0x2c')]][_0x4cd5('0x2e')]=_0x4cd5('0x2f');agents[_0x52ecde[_0x4cd5('0x2c')]][_0x4cd5('0x30')]=_0x52ecde[_0x4cd5('0x31')];agents[_0x52ecde[_0x4cd5('0x2c')]]['transferuniqueid']=agents[_0x52ecde['transfereruniqueid']][_0x4cd5('0x4')];}}catch(_0x44d360){utils[_0x4cd5('0x18')](_0x44d360[_0x4cd5('0x20')]);}};exports[_0x4cd5('0x32')]=function(_0x3f5f5b){try{if(_0x3f5f5b['origtransfereruniqueid']==_0x3f5f5b[_0x4cd5('0x33')]){if(!_[_0x4cd5('0x1a')](agents[_0x3f5f5b[_0x4cd5('0x34')]])){agents[_0x3f5f5b[_0x4cd5('0x34')]]['transfer']=!![];agents[_0x3f5f5b[_0x4cd5('0x34')]]['transfertype']=_0x4cd5('0x35');agents[_0x3f5f5b['secondtransfereruniqueid']][_0x4cd5('0x30')]=_0x3f5f5b[_0x4cd5('0x36')];agents[_0x3f5f5b[_0x4cd5('0x34')]][_0x4cd5('0x37')]=_0x3f5f5b[_0x4cd5('0x38')];}if(_0x3f5f5b['transfereeuniqueid']&&agents[_0x3f5f5b[_0x4cd5('0x39')]]){agents[_0x3f5f5b[_0x4cd5('0x39')]]['agententerreason']=0x1;transfers[_0x3f5f5b['transfereeuniqueid']]=_[_0x4cd5('0x3a')](agents[_0x3f5f5b[_0x4cd5('0x39')]]);transfers[_0x3f5f5b[_0x4cd5('0x39')]][_0x4cd5('0x8')]=agents[_0x3f5f5b[_0x4cd5('0x34')]]['calleridnum'];transfers[_0x3f5f5b[_0x4cd5('0x39')]][_0x4cd5('0x3b')]=agents[_0x3f5f5b[_0x4cd5('0x34')]][_0x4cd5('0x3b')];transfers[_0x3f5f5b['transfereeuniqueid']]['agentcalledAt']=utils[_0x4cd5('0x15')]();transfers[_0x3f5f5b[_0x4cd5('0x39')]]['agentconnectAt']=utils[_0x4cd5('0x15')]();transfers[_0x3f5f5b[_0x4cd5('0x39')]][_0x4cd5('0x1d')]=0x0;transfers[_0x3f5f5b['transfereeuniqueid']]['agententerreason']=0x2;}}else if(_0x3f5f5b[_0x4cd5('0x34')]==_0x3f5f5b[_0x4cd5('0x3c')]){if(!_[_0x4cd5('0x1a')](agents[_0x3f5f5b[_0x4cd5('0x38')]])){agents[_0x3f5f5b['origtransfereruniqueid']][_0x4cd5('0x2d')]=!![];agents[_0x3f5f5b[_0x4cd5('0x38')]]['transfertype']=_0x4cd5('0x35');agents[_0x3f5f5b[_0x4cd5('0x38')]][_0x4cd5('0x30')]=_0x3f5f5b['secondtransfererexten'];agents[_0x3f5f5b[_0x4cd5('0x38')]][_0x4cd5('0x37')]=_0x3f5f5b[_0x4cd5('0x34')];}if(_0x3f5f5b[_0x4cd5('0x3d')]&&agents[_0x3f5f5b['transfertargetuniqueid']]){agents[_0x3f5f5b[_0x4cd5('0x3d')]][_0x4cd5('0x3e')]=0x1;transfers[_0x3f5f5b[_0x4cd5('0x3d')]]=_[_0x4cd5('0x3a')](agents[_0x3f5f5b['transfertargetuniqueid']]);transfers[_0x3f5f5b[_0x4cd5('0x3d')]][_0x4cd5('0x8')]=agents[_0x3f5f5b[_0x4cd5('0x38')]][_0x4cd5('0x8')];transfers[_0x3f5f5b[_0x4cd5('0x3d')]]['calleridname']=agents[_0x3f5f5b['origtransfereruniqueid']]['calleridname'];transfers[_0x3f5f5b[_0x4cd5('0x3d')]][_0x4cd5('0x14')]=utils[_0x4cd5('0x15')]();transfers[_0x3f5f5b['transfertargetuniqueid']]['agentconnectAt']=utils[_0x4cd5('0x15')]();transfers[_0x3f5f5b[_0x4cd5('0x3d')]][_0x4cd5('0x1d')]=0x0;transfers[_0x3f5f5b[_0x4cd5('0x3d')]][_0x4cd5('0x3e')]=0x2;}}}catch(_0x123137){utils[_0x4cd5('0x18')](_0x123137['stack']);}};exports[_0x4cd5('0x3f')]=function(_0x5c6375){try{if(transfers[_0x5c6375[_0x4cd5('0x4')]]){transfers[_0x5c6375[_0x4cd5('0x4')]][_0x4cd5('0xe')]=!![];transfers[_0x5c6375[_0x4cd5('0x4')]][_0x4cd5('0x29')]=utils['now']();transfers[_0x5c6375['uniqueid']][_0x4cd5('0x1f')]=utils['diffTime'](transfers[_0x5c6375[_0x4cd5('0x4')]][_0x4cd5('0x29')],transfers[_0x5c6375[_0x4cd5('0x4')]]['agentconnectAt']);transfers[_0x5c6375[_0x4cd5('0x4')]]['reason']=_0x4cd5('0x40');transfers[_0x5c6375['uniqueid']][_0x4cd5('0xa')]=_0x4cd5('0x2b');writeDB(transfers[_0x5c6375[_0x4cd5('0x4')]],!![]);}if(agents[_0x5c6375['uniqueid']]&&agents[_0x5c6375['uniqueid']][_0x4cd5('0x24')]){agents[_0x5c6375[_0x4cd5('0x4')]][_0x4cd5('0xe')]=!![];agents[_0x5c6375[_0x4cd5('0x4')]][_0x4cd5('0x29')]=utils['now']();agents[_0x5c6375[_0x4cd5('0x4')]][_0x4cd5('0x1f')]=utils[_0x4cd5('0x2a')](agents[_0x5c6375['uniqueid']][_0x4cd5('0x29')],agents[_0x5c6375[_0x4cd5('0x4')]][_0x4cd5('0x24')]);agents[_0x5c6375[_0x4cd5('0x4')]][_0x4cd5('0x1b')]=agents[_0x5c6375['uniqueid']][_0x4cd5('0x2d')]?_0x4cd5('0x2d'):_0x4cd5('0x40');agents[_0x5c6375[_0x4cd5('0x4')]][_0x4cd5('0xa')]=_0x4cd5('0x2b');writeDB(agents[_0x5c6375['uniqueid']]);}}catch(_0x1671e5){utils[_0x4cd5('0x18')](_0x1671e5['stack']);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 955e3a8..559ce7f 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 _0x4b28=['musiconholdstartAt','varset','variable','source','value','xmd-phone','destination','\x22\x20<','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','ContactId','xmd-cdrtype','type','outboundrouteid','routeid','newexten','toLowerCase','set','startsWith','appdata','cdr','split','substring','lastIndexOf','includes','execif','gotoif','application','lodash','util','./utils','NO\x20ANSWER','FAILED','BUSY','info','CALL|%s|%s|%s|%s|%s|%s|%s|%s','channel','callerid','disposition','getUserByInternal','accountcode','UserId','request','CreateVoiceCallReport','uniqueid','newchannel','linkedid','OutgoingSpoolFailed','now','DOCUMENTATION','error','stack','isNil','channelstate','systemanswertime','context','transfer','answertime','toNumber','ANSWERED','hangup','calleridname','calleridnum','duration','endtime','starttime','billableseconds','diffTime','attendedtransfer','localtwolinkedid','destinationchannel','userfield','transfertargetchannel','origtransfererchannel','_attended','musiconholdstop','mohtime'];(function(_0x5d8232,_0x156279){var _0x5daf30=function(_0x1ef696){while(--_0x1ef696){_0x5d8232['push'](_0x5d8232['shift']());}};_0x5daf30(++_0x156279);}(_0x4b28,0x15f));var _0x84b2=function(_0x3aa581,_0x2a23cc){_0x3aa581=_0x3aa581-0x0;var _0x1dd21b=_0x4b28[_0x3aa581];return _0x1dd21b;};'use strict';var _=require(_0x84b2('0x0'));var util=require(_0x84b2('0x1'));var utils=require(_0x84b2('0x2'));var dispositions=[_0x84b2('0x3'),_0x84b2('0x4'),'FAILED',_0x84b2('0x3'),_0x84b2('0x3'),'NO\x20ANSWER','ANSWERED',_0x84b2('0x5'),_0x84b2('0x4'),'FAILED',_0x84b2('0x4')];var channels={};function writeDB(_0x1aa9a7){utils[_0x84b2('0x6')](util['format'](_0x84b2('0x7'),_0x1aa9a7['uniqueid'],_0x1aa9a7[_0x84b2('0x8')],_0x1aa9a7['type'],_0x1aa9a7['accountcode'],_0x1aa9a7['source'],_0x1aa9a7['destination'],_0x1aa9a7[_0x84b2('0x9')],_0x1aa9a7[_0x84b2('0xa')]));if(_0x1aa9a7['accountcode']){utils[_0x84b2('0xb')](_0x1aa9a7[_0x84b2('0xc')])['then'](function(_0x45d323){if(_0x45d323){_0x1aa9a7[_0x84b2('0xd')]=_0x45d323['id'];}utils[_0x84b2('0xe')]('CreateVoiceCallReport',_0x1aa9a7);});}else{utils['request'](_0x84b2('0xf'),_0x1aa9a7);}if(channels[_0x1aa9a7[_0x84b2('0x10')]]){delete channels[_0x1aa9a7['uniqueid']];}}exports[_0x84b2('0x11')]=function(_0x2f4400){try{if(_0x2f4400[_0x84b2('0x10')]==_0x2f4400[_0x84b2('0x12')]&&_0x2f4400['channel']!=_0x84b2('0x13')){channels[_0x2f4400['uniqueid']]={'uniqueid':_0x2f4400[_0x84b2('0x10')],'accountcode':_0x2f4400[_0x84b2('0xc')],'source':_0x2f4400['calleridnum'],'destination':_0x2f4400['exten'],'destinationcontext':_0x2f4400['context'],'channel':_0x2f4400['channel'],'starttime':utils[_0x84b2('0x14')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x84b2('0x3'),'amaflags':_0x84b2('0x15')};}}catch(_0x34b06d){utils[_0x84b2('0x16')](_0x34b06d[_0x84b2('0x17')]);}};exports['newstate']=function(_0x43cd24){try{if(!_[_0x84b2('0x18')](channels[_0x43cd24[_0x84b2('0x10')]])&&_0x43cd24[_0x84b2('0x19')]==0x6){if(_['isNil'](channels[_0x43cd24[_0x84b2('0x10')]][_0x84b2('0x1a')])){channels[_0x43cd24[_0x84b2('0x10')]][_0x84b2('0x1a')]=utils[_0x84b2('0x14')]();}}else if(!_[_0x84b2('0x18')](channels[_0x43cd24[_0x84b2('0x12')]])&&_0x43cd24['channelstate']==0x6&&_0x43cd24[_0x84b2('0x1b')]!=_0x84b2('0x1c')){channels[_0x43cd24[_0x84b2('0x12')]]['accountcode']=_0x43cd24['accountcode'];channels[_0x43cd24[_0x84b2('0x12')]]['destinationchannel']=_0x43cd24[_0x84b2('0x8')];if(_['isNil'](channels[_0x43cd24[_0x84b2('0x12')]][_0x84b2('0x1d')])){channels[_0x43cd24[_0x84b2('0x12')]][_0x84b2('0x1d')]=utils['now']();}channels[_0x43cd24[_0x84b2('0x12')]][_0x84b2('0xa')]=dispositions[_[_0x84b2('0x1e')](_0x43cd24[_0x84b2('0x19')])]||_0x84b2('0x1f');}}catch(_0x13eddb){utils[_0x84b2('0x16')](_0x13eddb[_0x84b2('0x17')]);}};exports[_0x84b2('0x20')]=function(_0x981f90){try{if(!_[_0x84b2('0x18')](channels[_0x981f90[_0x84b2('0x10')]])){if(_[_0x84b2('0x18')](channels[_0x981f90[_0x84b2('0x10')]][_0x84b2('0x9')])){channels[_0x981f90[_0x84b2('0x10')]][_0x84b2('0x9')]=_0x981f90[_0x84b2('0x21')]+'\x20<'+_0x981f90[_0x84b2('0x22')]+'>';}channels[_0x981f90['uniqueid']]['endtime']=utils[_0x84b2('0x14')]();channels[_0x981f90[_0x84b2('0x10')]][_0x84b2('0x23')]=utils['diffTime'](channels[_0x981f90[_0x84b2('0x10')]][_0x84b2('0x24')],channels[_0x981f90[_0x84b2('0x10')]][_0x84b2('0x25')]);channels[_0x981f90[_0x84b2('0x10')]][_0x84b2('0x26')]=channels[_0x981f90['uniqueid']][_0x84b2('0x1d')]?utils[_0x84b2('0x27')](channels[_0x981f90['uniqueid']][_0x84b2('0x24')],channels[_0x981f90['uniqueid']][_0x84b2('0x1d')]):0x0;writeDB(channels[_0x981f90[_0x84b2('0x10')]]);}}catch(_0x337a30){utils['error'](_0x337a30[_0x84b2('0x17')]);}};exports[_0x84b2('0x28')]=function(_0x1ac9ea){try{if(!_[_0x84b2('0x18')](channels[_0x1ac9ea['localtwolinkedid']])){if(channels[_0x1ac9ea[_0x84b2('0x29')]][_0x84b2('0x8')]==_0x1ac9ea['transfereechannel']){channels[_0x1ac9ea[_0x84b2('0x29')]][_0x84b2('0x2a')]=_0x1ac9ea['secondtransfererchannel'];channels[_0x1ac9ea[_0x84b2('0x29')]][_0x84b2('0x2b')]='_attended';}else if(channels[_0x1ac9ea[_0x84b2('0x29')]][_0x84b2('0x8')]=_0x1ac9ea[_0x84b2('0x2c')]){channels[_0x1ac9ea[_0x84b2('0x29')]][_0x84b2('0x2a')]=_0x1ac9ea[_0x84b2('0x2d')];channels[_0x1ac9ea['localtwolinkedid']][_0x84b2('0x2b')]=_0x84b2('0x2e');}}}catch(_0x5aa2ca){utils['error'](_0x5aa2ca[_0x84b2('0x17')]);}};exports['musiconholdstart']=function(_0x499c76){try{if(!_['isNil'](channels[_0x499c76['uniqueid']])){channels[_0x499c76[_0x84b2('0x10')]]['musiconholdstartAt']=utils[_0x84b2('0x14')]();}}catch(_0x12f524){utils[_0x84b2('0x16')](_0x12f524[_0x84b2('0x17')]);}};exports[_0x84b2('0x2f')]=function(_0x2a702b){try{if(!_[_0x84b2('0x18')](channels[_0x2a702b[_0x84b2('0x10')]])){if(!_['isNil'](channels[_0x2a702b[_0x84b2('0x10')]]['musiconholdstartAt'])){channels[_0x2a702b['uniqueid']][_0x84b2('0x30')]+=utils[_0x84b2('0x27')](utils[_0x84b2('0x14')](),channels[_0x2a702b['uniqueid']][_0x84b2('0x31')]);delete channels[_0x2a702b[_0x84b2('0x10')]][_0x84b2('0x31')];}}}catch(_0x2b5a1f){utils['error'](_0x2b5a1f[_0x84b2('0x17')]);}};exports[_0x84b2('0x32')]=function(_0x547d5a){try{if(!_[_0x84b2('0x18')](channels[_0x547d5a[_0x84b2('0x10')]])){if(!_['isNil'](_0x547d5a[_0x84b2('0x33')]['xmd-originatecalleridnum'])){channels[_0x547d5a['uniqueid']][_0x84b2('0x34')]=_0x547d5a[_0x84b2('0x35')];}if(!_[_0x84b2('0x18')](_0x547d5a[_0x84b2('0x33')][_0x84b2('0x36')])){channels[_0x547d5a['uniqueid']][_0x84b2('0x37')]=_0x547d5a[_0x84b2('0x35')];channels[_0x547d5a[_0x84b2('0x10')]][_0x84b2('0x9')]='\x22'+_0x547d5a[_0x84b2('0x35')]+_0x84b2('0x38')+_0x547d5a['value']+'>';}if(!_[_0x84b2('0x18')](_0x547d5a['variable']['xmd-callerid-preview'])||!_['isNil'](_0x547d5a[_0x84b2('0x33')]['xmd-callerid'])){channels[_0x547d5a[_0x84b2('0x10')]][_0x84b2('0x9')]=_0x547d5a[_0x84b2('0x35')];}if(!_[_0x84b2('0x18')](_0x547d5a['variable'][_0x84b2('0x39')])||!_[_0x84b2('0x18')](_0x547d5a['variable'][_0x84b2('0x3a')])){channels[_0x547d5a[_0x84b2('0x10')]][_0x84b2('0x3b')]=_0x84b2('0x3c');channels[_0x547d5a['uniqueid']][_0x84b2('0x3d')]=_0x547d5a[_0x84b2('0x35')];channels[_0x547d5a[_0x84b2('0x10')]]['queue']=!![];}if(!_[_0x84b2('0x18')](_0x547d5a[_0x84b2('0x33')]['xmd-contactid'])){channels[_0x547d5a[_0x84b2('0x10')]][_0x84b2('0x3e')]=_0x547d5a[_0x84b2('0x35')];}if(!_[_0x84b2('0x18')](_0x547d5a[_0x84b2('0x33')][_0x84b2('0x3f')])){channels[_0x547d5a[_0x84b2('0x10')]][_0x84b2('0x40')]=_0x547d5a[_0x84b2('0x35')];}if(!_['isNil'](_0x547d5a['variable'][_0x84b2('0x41')])){channels[_0x547d5a['uniqueid']][_0x84b2('0x42')]=_0x547d5a[_0x84b2('0x35')];}if(!_[_0x84b2('0x18')](_0x547d5a[_0x84b2('0x33')]['sipcallid'])){channels[_0x547d5a[_0x84b2('0x10')]]['sipcallid']=_0x547d5a['value'];}}}catch(_0x332eda){utils[_0x84b2('0x16')](_0x332eda['stack']);}};exports[_0x84b2('0x43')]=function(_0x15a081){try{if(!_[_0x84b2('0x18')](channels[_0x15a081[_0x84b2('0x10')]])){if(_0x15a081['application'][_0x84b2('0x44')]()==_0x84b2('0x45')&&_[_0x84b2('0x46')](_0x15a081[_0x84b2('0x47')][_0x84b2('0x44')](),_0x84b2('0x48'))){var _0x5c42be=_0x15a081[_0x84b2('0x47')][_0x84b2('0x49')]('=');var _0x57dee8=_0x5c42be[0x0][_0x84b2('0x4a')](_0x5c42be[0x0]['lastIndexOf']('(')+0x1,_0x5c42be[0x0][_0x84b2('0x4b')](')'));var _0x419fba=_0x5c42be[0x1];channels[_0x15a081[_0x84b2('0x10')]][_0x57dee8]=_0x419fba;}if(!_[_0x84b2('0x4c')]([_0x84b2('0x20'),'noop',_0x84b2('0x4d'),'set',_0x84b2('0x4e')],_0x15a081[_0x84b2('0x4f')][_0x84b2('0x44')]())){channels[_0x15a081[_0x84b2('0x10')]][_0x84b2('0x3b')]=_0x15a081[_0x84b2('0x4f')];channels[_0x15a081[_0x84b2('0x10')]][_0x84b2('0x3d')]=_0x15a081[_0x84b2('0x47')];}}}catch(_0x246aa2){utils[_0x84b2('0x16')](_0x246aa2[_0x84b2('0x17')]);}}; \ No newline at end of file +var _0xa159=['destinationchannel','answertime','toNumber','error','hangup','calleridname','calleridnum','endtime','diffTime','starttime','billableseconds','attendedtransfer','localtwolinkedid','_attended','transfertargetchannel','origtransfererchannel','userfield','musiconholdstartAt','musiconholdstop','mohtime','varset','variable','xmd-originatecalleridnum','value','xmd-phone','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','lastapplication','Queue','queue','xmd-contactid','ContactId','xmd-cdrtype','type','routeid','sipcallid','newexten','application','toLowerCase','set','startsWith','cdr','appdata','split','substring','includes','noop','execif','lastdata','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','info','format','CALL|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','source','callerid','disposition','accountcode','then','request','CreateVoiceCallReport','linkedid','channel','OutgoingSpoolFailed','exten','context','DOCUMENTATION','stack','newstate','isNil','channelstate','systemanswertime','now','transfer'];(function(_0x5372d5,_0x10696c){var _0x192ca2=function(_0x4682e3){while(--_0x4682e3){_0x5372d5['push'](_0x5372d5['shift']());}};_0x192ca2(++_0x10696c);}(_0xa159,0x1d9));var _0x9a15=function(_0x296c14,_0x232f57){_0x296c14=_0x296c14-0x0;var _0x5454bc=_0xa159[_0x296c14];return _0x5454bc;};'use strict';var _=require(_0x9a15('0x0'));var util=require(_0x9a15('0x1'));var utils=require(_0x9a15('0x2'));var dispositions=[_0x9a15('0x3'),_0x9a15('0x4'),_0x9a15('0x4'),_0x9a15('0x3'),_0x9a15('0x3'),_0x9a15('0x3'),_0x9a15('0x5'),_0x9a15('0x6'),_0x9a15('0x4'),_0x9a15('0x4'),_0x9a15('0x4')];var channels={};function writeDB(_0x5a5033){utils[_0x9a15('0x7')](util[_0x9a15('0x8')](_0x9a15('0x9'),_0x5a5033[_0x9a15('0xa')],_0x5a5033['channel'],_0x5a5033['type'],_0x5a5033['accountcode'],_0x5a5033[_0x9a15('0xb')],_0x5a5033['destination'],_0x5a5033[_0x9a15('0xc')],_0x5a5033[_0x9a15('0xd')]));if(_0x5a5033['accountcode']){utils['getUserByInternal'](_0x5a5033[_0x9a15('0xe')])[_0x9a15('0xf')](function(_0xbbb793){if(_0xbbb793){_0x5a5033['UserId']=_0xbbb793['id'];}utils[_0x9a15('0x10')]('CreateVoiceCallReport',_0x5a5033);});}else{utils['request'](_0x9a15('0x11'),_0x5a5033);}if(channels[_0x5a5033[_0x9a15('0xa')]]){delete channels[_0x5a5033['uniqueid']];}}exports['newchannel']=function(_0x4561bc){try{if(_0x4561bc[_0x9a15('0xa')]==_0x4561bc[_0x9a15('0x12')]&&_0x4561bc[_0x9a15('0x13')]!=_0x9a15('0x14')){channels[_0x4561bc[_0x9a15('0xa')]]={'uniqueid':_0x4561bc['uniqueid'],'accountcode':_0x4561bc[_0x9a15('0xe')],'source':_0x4561bc['calleridnum'],'destination':_0x4561bc[_0x9a15('0x15')],'destinationcontext':_0x4561bc[_0x9a15('0x16')],'channel':_0x4561bc[_0x9a15('0x13')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x9a15('0x3'),'amaflags':_0x9a15('0x17')};}}catch(_0x371788){utils['error'](_0x371788[_0x9a15('0x18')]);}};exports[_0x9a15('0x19')]=function(_0x5bb060){try{if(!_[_0x9a15('0x1a')](channels[_0x5bb060[_0x9a15('0xa')]])&&_0x5bb060[_0x9a15('0x1b')]==0x6){if(_[_0x9a15('0x1a')](channels[_0x5bb060[_0x9a15('0xa')]][_0x9a15('0x1c')])){channels[_0x5bb060[_0x9a15('0xa')]]['systemanswertime']=utils[_0x9a15('0x1d')]();}}else if(!_['isNil'](channels[_0x5bb060[_0x9a15('0x12')]])&&_0x5bb060[_0x9a15('0x1b')]==0x6&&_0x5bb060[_0x9a15('0x16')]!=_0x9a15('0x1e')){channels[_0x5bb060['linkedid']][_0x9a15('0xe')]=_0x5bb060[_0x9a15('0xe')];channels[_0x5bb060[_0x9a15('0x12')]][_0x9a15('0x1f')]=_0x5bb060[_0x9a15('0x13')];if(_[_0x9a15('0x1a')](channels[_0x5bb060[_0x9a15('0x12')]][_0x9a15('0x20')])){channels[_0x5bb060[_0x9a15('0x12')]][_0x9a15('0x20')]=utils[_0x9a15('0x1d')]();}channels[_0x5bb060[_0x9a15('0x12')]][_0x9a15('0xd')]=dispositions[_[_0x9a15('0x21')](_0x5bb060['channelstate'])]||'ANSWERED';}}catch(_0x55b33d){utils[_0x9a15('0x22')](_0x55b33d[_0x9a15('0x18')]);}};exports[_0x9a15('0x23')]=function(_0x123261){try{if(!_[_0x9a15('0x1a')](channels[_0x123261[_0x9a15('0xa')]])){if(_[_0x9a15('0x1a')](channels[_0x123261[_0x9a15('0xa')]][_0x9a15('0xc')])){channels[_0x123261[_0x9a15('0xa')]][_0x9a15('0xc')]=_0x123261[_0x9a15('0x24')]+'\x20<'+_0x123261[_0x9a15('0x25')]+'>';}channels[_0x123261[_0x9a15('0xa')]][_0x9a15('0x26')]=utils['now']();channels[_0x123261[_0x9a15('0xa')]]['duration']=utils[_0x9a15('0x27')](channels[_0x123261[_0x9a15('0xa')]][_0x9a15('0x26')],channels[_0x123261[_0x9a15('0xa')]][_0x9a15('0x28')]);channels[_0x123261[_0x9a15('0xa')]][_0x9a15('0x29')]=channels[_0x123261[_0x9a15('0xa')]][_0x9a15('0x20')]?utils[_0x9a15('0x27')](channels[_0x123261[_0x9a15('0xa')]][_0x9a15('0x26')],channels[_0x123261[_0x9a15('0xa')]]['answertime']):0x0;writeDB(channels[_0x123261[_0x9a15('0xa')]]);}}catch(_0x20d6a5){utils[_0x9a15('0x22')](_0x20d6a5['stack']);}};exports[_0x9a15('0x2a')]=function(_0xc00bdb){try{if(!_[_0x9a15('0x1a')](channels[_0xc00bdb[_0x9a15('0x2b')]])){if(channels[_0xc00bdb[_0x9a15('0x2b')]]['channel']==_0xc00bdb['transfereechannel']){channels[_0xc00bdb[_0x9a15('0x2b')]][_0x9a15('0x1f')]=_0xc00bdb['secondtransfererchannel'];channels[_0xc00bdb['localtwolinkedid']]['userfield']=_0x9a15('0x2c');}else if(channels[_0xc00bdb[_0x9a15('0x2b')]][_0x9a15('0x13')]=_0xc00bdb[_0x9a15('0x2d')]){channels[_0xc00bdb['localtwolinkedid']][_0x9a15('0x1f')]=_0xc00bdb[_0x9a15('0x2e')];channels[_0xc00bdb[_0x9a15('0x2b')]][_0x9a15('0x2f')]=_0x9a15('0x2c');}}}catch(_0xb02893){utils['error'](_0xb02893[_0x9a15('0x18')]);}};exports['musiconholdstart']=function(_0x29bf70){try{if(!_['isNil'](channels[_0x29bf70[_0x9a15('0xa')]])){channels[_0x29bf70['uniqueid']][_0x9a15('0x30')]=utils['now']();}}catch(_0x5daef1){utils[_0x9a15('0x22')](_0x5daef1[_0x9a15('0x18')]);}};exports[_0x9a15('0x31')]=function(_0x1891d5){try{if(!_[_0x9a15('0x1a')](channels[_0x1891d5[_0x9a15('0xa')]])){if(!_[_0x9a15('0x1a')](channels[_0x1891d5[_0x9a15('0xa')]][_0x9a15('0x30')])){channels[_0x1891d5['uniqueid']][_0x9a15('0x32')]+=utils[_0x9a15('0x27')](utils[_0x9a15('0x1d')](),channels[_0x1891d5[_0x9a15('0xa')]][_0x9a15('0x30')]);delete channels[_0x1891d5[_0x9a15('0xa')]]['musiconholdstartAt'];}}}catch(_0x23c9e8){utils[_0x9a15('0x22')](_0x23c9e8['stack']);}};exports[_0x9a15('0x33')]=function(_0x4d92f0){try{if(!_['isNil'](channels[_0x4d92f0[_0x9a15('0xa')]])){if(!_[_0x9a15('0x1a')](_0x4d92f0[_0x9a15('0x34')][_0x9a15('0x35')])){channels[_0x4d92f0[_0x9a15('0xa')]][_0x9a15('0xb')]=_0x4d92f0[_0x9a15('0x36')];}if(!_[_0x9a15('0x1a')](_0x4d92f0['variable'][_0x9a15('0x37')])){channels[_0x4d92f0[_0x9a15('0xa')]][_0x9a15('0x38')]=_0x4d92f0[_0x9a15('0x36')];channels[_0x4d92f0[_0x9a15('0xa')]][_0x9a15('0xc')]='\x22'+_0x4d92f0['value']+_0x9a15('0x39')+_0x4d92f0[_0x9a15('0x36')]+'>';}if(!_['isNil'](_0x4d92f0[_0x9a15('0x34')][_0x9a15('0x3a')])||!_[_0x9a15('0x1a')](_0x4d92f0['variable'][_0x9a15('0x3b')])){channels[_0x4d92f0[_0x9a15('0xa')]][_0x9a15('0xc')]=_0x4d92f0[_0x9a15('0x36')];}if(!_[_0x9a15('0x1a')](_0x4d92f0['variable'][_0x9a15('0x3c')])||!_[_0x9a15('0x1a')](_0x4d92f0[_0x9a15('0x34')][_0x9a15('0x3d')])){channels[_0x4d92f0[_0x9a15('0xa')]][_0x9a15('0x3e')]=_0x9a15('0x3f');channels[_0x4d92f0[_0x9a15('0xa')]]['lastdata']=_0x4d92f0[_0x9a15('0x36')];channels[_0x4d92f0['uniqueid']][_0x9a15('0x40')]=!![];}if(!_[_0x9a15('0x1a')](_0x4d92f0[_0x9a15('0x34')][_0x9a15('0x41')])){channels[_0x4d92f0[_0x9a15('0xa')]][_0x9a15('0x42')]=_0x4d92f0[_0x9a15('0x36')];}if(!_[_0x9a15('0x1a')](_0x4d92f0[_0x9a15('0x34')][_0x9a15('0x43')])){channels[_0x4d92f0[_0x9a15('0xa')]][_0x9a15('0x44')]=_0x4d92f0['value'];}if(!_['isNil'](_0x4d92f0['variable']['outboundrouteid'])){channels[_0x4d92f0[_0x9a15('0xa')]][_0x9a15('0x45')]=_0x4d92f0['value'];}if(!_[_0x9a15('0x1a')](_0x4d92f0['variable'][_0x9a15('0x46')])){channels[_0x4d92f0[_0x9a15('0xa')]][_0x9a15('0x46')]=_0x4d92f0[_0x9a15('0x36')];}}}catch(_0x5c519f){utils[_0x9a15('0x22')](_0x5c519f['stack']);}};exports[_0x9a15('0x47')]=function(_0x4fcb76){try{if(!_[_0x9a15('0x1a')](channels[_0x4fcb76[_0x9a15('0xa')]])){if(_0x4fcb76[_0x9a15('0x48')][_0x9a15('0x49')]()==_0x9a15('0x4a')&&_[_0x9a15('0x4b')](_0x4fcb76['appdata']['toLowerCase'](),_0x9a15('0x4c'))){var _0x17510c=_0x4fcb76[_0x9a15('0x4d')][_0x9a15('0x4e')]('=');var _0x174e0a=_0x17510c[0x0][_0x9a15('0x4f')](_0x17510c[0x0]['lastIndexOf']('(')+0x1,_0x17510c[0x0]['lastIndexOf'](')'));var _0x235e40=_0x17510c[0x1];channels[_0x4fcb76[_0x9a15('0xa')]][_0x174e0a]=_0x235e40;}if(!_[_0x9a15('0x50')]([_0x9a15('0x23'),_0x9a15('0x51'),_0x9a15('0x52'),'set','gotoif'],_0x4fcb76[_0x9a15('0x48')][_0x9a15('0x49')]())){channels[_0x4fcb76['uniqueid']][_0x9a15('0x3e')]=_0x4fcb76[_0x9a15('0x48')];channels[_0x4fcb76[_0x9a15('0xa')]][_0x9a15('0x53')]=_0x4fcb76['appdata'];}}}catch(_0x182676){utils[_0x9a15('0x22')](_0x182676[_0x9a15('0x18')]);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 582d7e5..f6cf9ce 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 _0xafb9=['SHUTDOWN','fullybooted','error','CLOSE','managerevent','./utils','lodash','connect','info','CONNECTED','shutdown'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0xafb9,0x68));var _0x9afb=function(_0x1d9373,_0x1b21a8){_0x1d9373=_0x1d9373-0x0;var _0x4107cf=_0xafb9[_0x1d9373];return _0x4107cf;};'use strict';var utils=require(_0x9afb('0x0'));var _=require(_0x9afb('0x1'));exports[_0x9afb('0x2')]=function(){utils[_0x9afb('0x3')](_0x9afb('0x4'));};exports[_0x9afb('0x5')]=function(){utils[_0x9afb('0x3')](_0x9afb('0x6'));};exports[_0x9afb('0x7')]=function(){utils['info']('FULLYBOOTED');};exports[_0x9afb('0x8')]=function(_0x56a139){utils[_0x9afb('0x8')](_0x56a139);};exports['close']=function(){utils['info'](_0x9afb('0x9'));};exports[_0x9afb('0xa')]=function(_0x20b8c1){}; \ No newline at end of file +var _0xeff8=['fullybooted','FULLYBOOTED','error','close','managerevent','./utils','lodash','info','CONNECTED','shutdown','SHUTDOWN'];(function(_0x375f65,_0xe40f2d){var _0x41984b=function(_0x172945){while(--_0x172945){_0x375f65['push'](_0x375f65['shift']());}};_0x41984b(++_0xe40f2d);}(_0xeff8,0x186));var _0x8eff=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xeff8[_0x9df060];return _0x338dfe;};'use strict';var utils=require(_0x8eff('0x0'));var _=require(_0x8eff('0x1'));exports['connect']=function(){utils[_0x8eff('0x2')](_0x8eff('0x3'));};exports[_0x8eff('0x4')]=function(){utils['info'](_0x8eff('0x5'));};exports[_0x8eff('0x6')]=function(){utils[_0x8eff('0x2')](_0x8eff('0x7'));};exports['error']=function(_0x469641){utils[_0x8eff('0x8')](_0x469641);};exports[_0x8eff('0x9')]=function(){utils[_0x8eff('0x2')]('CLOSE');};exports[_0x8eff('0xa')]=function(_0x19557f){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 80ec905..ec6de21 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 _0x4459=['uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','toLowerCase','startsWith','appdata','cdr(routeid)','split','error','varset','isNil','variable','outboundrouteid','value','stack','dialbegin','assign','starttime','now','lastevent','called','ANSWER','answertime','connect','duration','diffTime','endtime','holdtime','lodash','util','./utils'];(function(_0x2236e1,_0x446198){var _0x4da3f8=function(_0x365156){while(--_0x365156){_0x2236e1['push'](_0x2236e1['shift']());}};_0x4da3f8(++_0x446198);}(_0x4459,0xb1));var _0x9445=function(_0x5363f9,_0x484d4c){_0x5363f9=_0x5363f9-0x0;var _0x37147e=_0x4459[_0x5363f9];return _0x37147e;};'use strict';var _=require(_0x9445('0x0'));var util=require(_0x9445('0x1'));var utils=require(_0x9445('0x2'));var dials={};function writeDB(_0x5130d9){utils['info'](util['format']('DIAL|%s|%s|%s|%s|%s|%s',_0x5130d9[_0x9445('0x3')],_0x5130d9[_0x9445('0x4')],_0x5130d9[_0x9445('0x5')],_0x5130d9[_0x9445('0x6')],_0x5130d9[_0x9445('0x7')],_0x5130d9[_0x9445('0x8')]));utils[_0x9445('0x9')](_0x9445('0xa'),_0x5130d9);delete dials[_0x5130d9[_0x9445('0x3')]];}exports['newexten']=function(_0x512432){try{if(_0x512432['application'][_0x9445('0xb')]()=='set'&&_[_0x9445('0xc')](_0x512432[_0x9445('0xd')][_0x9445('0xb')](),_0x9445('0xe'))){var _0x34b45f=_0x512432[_0x9445('0xd')][_0x9445('0xf')]('=');dials[_0x512432[_0x9445('0x3')]]={'routeId':_0x34b45f[0x1]};}}catch(_0x22f21b){utils[_0x9445('0x10')](_0x22f21b['stack']);}};exports[_0x9445('0x11')]=function(_0x3023c1){try{if(!_[_0x9445('0x12')](_0x3023c1[_0x9445('0x13')][_0x9445('0x14')])){dials[_0x3023c1['uniqueid']]={'routeId':_0x3023c1[_0x9445('0x15')]};}}catch(_0x5ea506){utils['error'](_0x5ea506[_0x9445('0x16')]);}};exports[_0x9445('0x17')]=function(_0x4aabbe){try{if(!_[_0x9445('0x12')](dials[_0x4aabbe[_0x9445('0x3')]])){dials[_0x4aabbe['uniqueid']]=_[_0x9445('0x18')](dials[_0x4aabbe['uniqueid']],_0x4aabbe);dials[_0x4aabbe[_0x9445('0x3')]][_0x9445('0x19')]=utils[_0x9445('0x1a')]();dials[_0x4aabbe[_0x9445('0x3')]][_0x9445('0x1b')]=_0x9445('0x1c');}}catch(_0x4f969c){utils[_0x9445('0x10')](_0x4f969c[_0x9445('0x16')]);}};exports['dialend']=function(_0x30111e){try{if(!_[_0x9445('0x12')](dials[_0x30111e[_0x9445('0x3')]])){dials[_0x30111e['uniqueid']][_0x9445('0x8')]=_0x30111e['dialstatus'];if(_0x30111e[_0x9445('0x8')]==_0x9445('0x1d')){dials[_0x30111e[_0x9445('0x3')]]=_['assign'](dials[_0x30111e[_0x9445('0x3')]],_0x30111e);dials[_0x30111e[_0x9445('0x3')]][_0x9445('0x1e')]=utils[_0x9445('0x1a')]();dials[_0x30111e[_0x9445('0x3')]][_0x9445('0x1b')]=_0x9445('0x1f');}}}catch(_0x415fa5){utils[_0x9445('0x10')](_0x415fa5[_0x9445('0x16')]);}};exports['hangup']=function(_0x5d0c66){try{if(!_[_0x9445('0x12')](dials[_0x5d0c66['uniqueid']])){dials[_0x5d0c66[_0x9445('0x3')]]=_[_0x9445('0x18')](dials[_0x5d0c66[_0x9445('0x3')]],{'endtime':utils[_0x9445('0x1a')](),'lastevent':'complete'});dials[_0x5d0c66[_0x9445('0x3')]][_0x9445('0x20')]=utils[_0x9445('0x21')](dials[_0x5d0c66[_0x9445('0x3')]][_0x9445('0x22')],dials[_0x5d0c66[_0x9445('0x3')]][_0x9445('0x19')]);dials[_0x5d0c66[_0x9445('0x3')]][_0x9445('0x23')]=utils[_0x9445('0x21')](dials[_0x5d0c66[_0x9445('0x3')]]['answertime']||dials[_0x5d0c66[_0x9445('0x3')]][_0x9445('0x22')],dials[_0x5d0c66[_0x9445('0x3')]][_0x9445('0x19')]);dials[_0x5d0c66[_0x9445('0x3')]]['billableseconds']=dials[_0x5d0c66['uniqueid']][_0x9445('0x1e')]?utils[_0x9445('0x21')](dials[_0x5d0c66[_0x9445('0x3')]][_0x9445('0x22')],dials[_0x5d0c66[_0x9445('0x3')]][_0x9445('0x1e')]):0x0;writeDB(dials[_0x5d0c66[_0x9445('0x3')]]);}}catch(_0x4a16e9){utils['error'](_0x4a16e9[_0x9445('0x16')]);}}; \ No newline at end of file +var _0x767e=['hangup','complete','duration','diffTime','endtime','holdtime','answertime','billableseconds','lodash','util','DIAL|%s|%s|%s|%s|%s|%s','uniqueid','channel','dialstring','dialstatus','request','CreateVoiceDialReport','newexten','application','toLowerCase','set','startsWith','appdata','split','error','stack','variable','outboundrouteid','value','isNil','assign','starttime','dialend','ANSWER','now','lastevent','connect'];(function(_0x322acf,_0x4203cf){var _0x4b2c50=function(_0xf8eb96){while(--_0xf8eb96){_0x322acf['push'](_0x322acf['shift']());}};_0x4b2c50(++_0x4203cf);}(_0x767e,0x9c));var _0xe767=function(_0x159f8e,_0x5c54a8){_0x159f8e=_0x159f8e-0x0;var _0xdc4c81=_0x767e[_0x159f8e];return _0xdc4c81;};'use strict';var _=require(_0xe767('0x0'));var util=require(_0xe767('0x1'));var utils=require('./utils');var dials={};function writeDB(_0x6d1957){utils['info'](util['format'](_0xe767('0x2'),_0x6d1957[_0xe767('0x3')],_0x6d1957[_0xe767('0x4')],_0x6d1957[_0xe767('0x5')],_0x6d1957['calleridnum'],_0x6d1957['connectedlinenum'],_0x6d1957[_0xe767('0x6')]));utils[_0xe767('0x7')](_0xe767('0x8'),_0x6d1957);delete dials[_0x6d1957[_0xe767('0x3')]];}exports[_0xe767('0x9')]=function(_0x15c151){try{if(_0x15c151[_0xe767('0xa')][_0xe767('0xb')]()==_0xe767('0xc')&&_[_0xe767('0xd')](_0x15c151[_0xe767('0xe')][_0xe767('0xb')](),'cdr(routeid)')){var _0x499695=_0x15c151[_0xe767('0xe')][_0xe767('0xf')]('=');dials[_0x15c151[_0xe767('0x3')]]={'routeId':_0x499695[0x1]};}}catch(_0xae464){utils[_0xe767('0x10')](_0xae464[_0xe767('0x11')]);}};exports['varset']=function(_0x4386b5){try{if(!_['isNil'](_0x4386b5[_0xe767('0x12')][_0xe767('0x13')])){dials[_0x4386b5[_0xe767('0x3')]]={'routeId':_0x4386b5[_0xe767('0x14')]};}}catch(_0x14a825){utils['error'](_0x14a825['stack']);}};exports['dialbegin']=function(_0x539de1){try{if(!_[_0xe767('0x15')](dials[_0x539de1['uniqueid']])){dials[_0x539de1['uniqueid']]=_[_0xe767('0x16')](dials[_0x539de1[_0xe767('0x3')]],_0x539de1);dials[_0x539de1[_0xe767('0x3')]][_0xe767('0x17')]=utils['now']();dials[_0x539de1[_0xe767('0x3')]]['lastevent']='called';}}catch(_0x5d6e62){utils[_0xe767('0x10')](_0x5d6e62[_0xe767('0x11')]);}};exports[_0xe767('0x18')]=function(_0x252012){try{if(!_[_0xe767('0x15')](dials[_0x252012['uniqueid']])){dials[_0x252012[_0xe767('0x3')]][_0xe767('0x6')]=_0x252012[_0xe767('0x6')];if(_0x252012['dialstatus']==_0xe767('0x19')){dials[_0x252012['uniqueid']]=_[_0xe767('0x16')](dials[_0x252012[_0xe767('0x3')]],_0x252012);dials[_0x252012[_0xe767('0x3')]]['answertime']=utils[_0xe767('0x1a')]();dials[_0x252012['uniqueid']][_0xe767('0x1b')]=_0xe767('0x1c');}}}catch(_0x2a0c6c){utils[_0xe767('0x10')](_0x2a0c6c[_0xe767('0x11')]);}};exports[_0xe767('0x1d')]=function(_0x4e9353){try{if(!_[_0xe767('0x15')](dials[_0x4e9353[_0xe767('0x3')]])){dials[_0x4e9353['uniqueid']]=_['assign'](dials[_0x4e9353[_0xe767('0x3')]],{'endtime':utils[_0xe767('0x1a')](),'lastevent':_0xe767('0x1e')});dials[_0x4e9353[_0xe767('0x3')]][_0xe767('0x1f')]=utils[_0xe767('0x20')](dials[_0x4e9353[_0xe767('0x3')]][_0xe767('0x21')],dials[_0x4e9353[_0xe767('0x3')]][_0xe767('0x17')]);dials[_0x4e9353['uniqueid']][_0xe767('0x22')]=utils[_0xe767('0x20')](dials[_0x4e9353[_0xe767('0x3')]][_0xe767('0x23')]||dials[_0x4e9353[_0xe767('0x3')]][_0xe767('0x21')],dials[_0x4e9353[_0xe767('0x3')]][_0xe767('0x17')]);dials[_0x4e9353[_0xe767('0x3')]][_0xe767('0x24')]=dials[_0x4e9353[_0xe767('0x3')]][_0xe767('0x23')]?utils[_0xe767('0x20')](dials[_0x4e9353[_0xe767('0x3')]]['endtime'],dials[_0x4e9353[_0xe767('0x3')]][_0xe767('0x23')]):0x0;writeDB(dials[_0x4e9353[_0xe767('0x3')]]);}}catch(_0x36ac5a){utils[_0xe767('0x10')](_0x36ac5a[_0xe767('0x11')]);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 3417692..3a8bfff 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 _0x6a55=['managerevent','devicestatechange','agentcalled','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin','dialend','asterisk-manager','./utils','asterisk','username','password','keepConnected','xdr','disabled','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./members.controller','./dials.controller','./core.controller','shutdown','fullybooted','error','close'];(function(_0x384864,_0x1e3a70){var _0x54d530=function(_0x139f01){while(--_0x139f01){_0x384864['push'](_0x384864['shift']());}};_0x54d530(++_0x1e3a70);}(_0x6a55,0x154));var _0x56a5=function(_0x16e0f5,_0x4ec0f3){_0x16e0f5=_0x16e0f5-0x0;var _0x4839d5=_0x6a55[_0x16e0f5];return _0x4839d5;};var AsteriskManager=require(_0x56a5('0x0'));var config=require('../../config/environment');var utils=require(_0x56a5('0x1'));var ami=new AsteriskManager(config[_0x56a5('0x2')]['port'],config[_0x56a5('0x2')]['ip'],config[_0x56a5('0x2')][_0x56a5('0x3')],config[_0x56a5('0x2')][_0x56a5('0x4')],!![]);ami[_0x56a5('0x5')]();if(config[_0x56a5('0x6')]&&config[_0x56a5('0x6')][_0x56a5('0x7')]){utils[_0x56a5('0x8')](_0x56a5('0x9'));}else{var agents=require(_0x56a5('0xa'));var calls=require(_0x56a5('0xb'));var queues=require(_0x56a5('0xc'));var recordings=require('./recordings.controller');var members=require(_0x56a5('0xd'));var dials=require(_0x56a5('0xe'));var transfers=require('./transfers.controller');var core=require(_0x56a5('0xf'));ami['on']('connect',core['connect']);ami['on'](_0x56a5('0x10'),core[_0x56a5('0x10')]);ami['on'](_0x56a5('0x11'),core[_0x56a5('0x11')]);ami['on'](_0x56a5('0x12'),core[_0x56a5('0x12')]);ami['on'](_0x56a5('0x13'),core[_0x56a5('0x13')]);ami['on'](_0x56a5('0x14'),core['managerevent']);ami['on'](_0x56a5('0x15'),function(_0x1a647a){try{members['devicestatechange'](_0x1a647a);}catch(_0x281d8b){utils[_0x56a5('0x12')](_0x281d8b);}});ami['on'](_0x56a5('0x16'),function(_0x2e99f3){try{agents['agentcalled'](_0x2e99f3);}catch(_0x3ad9d9){utils[_0x56a5('0x12')](_0x3ad9d9);}});ami['on'](_0x56a5('0x17'),function(_0x466f52){try{agents[_0x56a5('0x17')](_0x466f52);}catch(_0x354284){utils[_0x56a5('0x12')](_0x354284);}});ami['on'](_0x56a5('0x18'),function(_0x26debc){try{agents['agentconnect'](_0x26debc);queues['agentconnect'](_0x26debc);}catch(_0x217005){utils['error'](_0x217005);}});ami['on'](_0x56a5('0x19'),function(_0x44105e){try{agents[_0x56a5('0x19')](_0x44105e);queues[_0x56a5('0x19')](_0x44105e);members[_0x56a5('0x19')](_0x44105e);}catch(_0x51f753){utils['error'](_0x51f753);}});ami['on'](_0x56a5('0x1a'),function(_0x5882cd){try{agents[_0x56a5('0x1a')](_0x5882cd);queues['queuecallerabandon'](_0x5882cd);}catch(_0x3a8046){utils[_0x56a5('0x12')](_0x3a8046);}});ami['on'](_0x56a5('0x1b'),function(_0x4cc2e2){try{queues[_0x56a5('0x1b')](_0x4cc2e2);recordings['queuecallerjoin'](_0x4cc2e2);}catch(_0x1e0365){utils['error'](_0x1e0365);}});ami['on']('queuecallerleave',function(_0x1228af){try{queues['queuecallerleave'](_0x1228af);}catch(_0x2cc3c0){utils['error'](_0x2cc3c0);}});ami['on'](_0x56a5('0x1c'),function(_0x2cea66){try{queues[_0x56a5('0x1c')](_0x2cea66);calls['musiconholdstart'](_0x2cea66);}catch(_0x38b5e0){utils[_0x56a5('0x12')](_0x38b5e0);}});ami['on']('musiconholdstop',function(_0x1a0dec){try{queues[_0x56a5('0x1d')](_0x1a0dec);calls[_0x56a5('0x1d')](_0x1a0dec);}catch(_0x59ef96){utils[_0x56a5('0x12')](_0x59ef96);}});ami['on'](_0x56a5('0x1e'),function(_0x5e894f){try{calls[_0x56a5('0x1e')](_0x5e894f);recordings['newstate'](_0x5e894f);}catch(_0x2f897d){utils[_0x56a5('0x12')](_0x2f897d);}});ami['on'](_0x56a5('0x1f'),function(_0xb1e9c5){try{calls[_0x56a5('0x1f')](_0xb1e9c5);recordings[_0x56a5('0x1f')](_0xb1e9c5);dials['hangup'](_0xb1e9c5);agents[_0x56a5('0x1f')](_0xb1e9c5);queues[_0x56a5('0x1f')](_0xb1e9c5);}catch(_0x2e431c){utils['error'](_0x2e431c);}});ami['on'](_0x56a5('0x20'),function(_0x2f8159){try{members['cdr'](_0x2f8159);}catch(_0x57bbb0){utils[_0x56a5('0x12')](_0x57bbb0);}});ami['on'](_0x56a5('0x21'),function(_0xace165){try{queues['blindtransfer'](_0xace165);agents[_0x56a5('0x21')](_0xace165);transfers['blindtransfer'](_0xace165);}catch(_0xeb2903){utils[_0x56a5('0x12')](_0xeb2903);}});ami['on'](_0x56a5('0x22'),function(_0x2035fc){try{queues[_0x56a5('0x22')](_0x2035fc);transfers[_0x56a5('0x22')](_0x2035fc);agents['attendedtransfer'](_0x2035fc);calls['attendedtransfer'](_0x2035fc);}catch(_0x1c6163){utils[_0x56a5('0x12')](_0x1c6163);}});ami['on']('varset',function(_0x164fd8){try{queues[_0x56a5('0x23')](_0x164fd8);recordings[_0x56a5('0x23')](_0x164fd8);calls['varset'](_0x164fd8);dials[_0x56a5('0x23')](_0x164fd8);}catch(_0x1e389d){utils[_0x56a5('0x12')](_0x1e389d);}});ami['on'](_0x56a5('0x24'),function(_0xe3de9a){try{calls[_0x56a5('0x24')](_0xe3de9a);recordings['newexten'](_0xe3de9a);dials[_0x56a5('0x24')](_0xe3de9a);}catch(_0x615365){utils['error'](_0x615365);}});ami['on'](_0x56a5('0x25'),function(_0x18111a){try{calls[_0x56a5('0x25')](_0x18111a);recordings[_0x56a5('0x25')](_0x18111a);}catch(_0x4cf524){utils[_0x56a5('0x12')](_0x4cf524);}});ami['on'](_0x56a5('0x26'),function(_0x3174bd){try{dials[_0x56a5('0x26')](_0x3174bd);}catch(_0x1418ee){utils[_0x56a5('0x12')](_0x1418ee);}});ami['on']('dialend',function(_0x47b8e0){try{dials[_0x56a5('0x27')](_0x47b8e0);}catch(_0x4c679f){utils[_0x56a5('0x12')](_0x4c679f);}});} \ No newline at end of file +var _0x2fb8=['agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin','dialend','asterisk-manager','asterisk','port','username','keepConnected','xdr','disabled','info','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','agentcalled','agentringnoanswer','agentconnect'];(function(_0x453413,_0x57a3f5){var _0x19761e=function(_0x16266b){while(--_0x16266b){_0x453413['push'](_0x453413['shift']());}};_0x19761e(++_0x57a3f5);}(_0x2fb8,0x106));var _0x82fb=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x2fb8[_0x2d7f0e];return _0x110b07;};var AsteriskManager=require(_0x82fb('0x0'));var config=require('../../config/environment');var utils=require('./utils');var ami=new AsteriskManager(config[_0x82fb('0x1')][_0x82fb('0x2')],config['asterisk']['ip'],config[_0x82fb('0x1')][_0x82fb('0x3')],config[_0x82fb('0x1')]['password'],!![]);ami[_0x82fb('0x4')]();if(config[_0x82fb('0x5')]&&config['xdr'][_0x82fb('0x6')]){utils[_0x82fb('0x7')]('XDR\x20DISABLED');}else{var agents=require(_0x82fb('0x8'));var calls=require(_0x82fb('0x9'));var queues=require(_0x82fb('0xa'));var recordings=require(_0x82fb('0xb'));var members=require(_0x82fb('0xc'));var dials=require(_0x82fb('0xd'));var transfers=require('./transfers.controller');var core=require(_0x82fb('0xe'));ami['on'](_0x82fb('0xf'),core[_0x82fb('0xf')]);ami['on'](_0x82fb('0x10'),core[_0x82fb('0x10')]);ami['on'](_0x82fb('0x11'),core[_0x82fb('0x11')]);ami['on'](_0x82fb('0x12'),core[_0x82fb('0x12')]);ami['on'](_0x82fb('0x13'),core['close']);ami['on'](_0x82fb('0x14'),core[_0x82fb('0x14')]);ami['on'](_0x82fb('0x15'),function(_0x2b7342){try{members[_0x82fb('0x15')](_0x2b7342);}catch(_0x5a1c40){utils[_0x82fb('0x12')](_0x5a1c40);}});ami['on']('agentcalled',function(_0xcbd5dc){try{agents[_0x82fb('0x16')](_0xcbd5dc);}catch(_0x2affdc){utils['error'](_0x2affdc);}});ami['on'](_0x82fb('0x17'),function(_0x4f9c9d){try{agents[_0x82fb('0x17')](_0x4f9c9d);}catch(_0x379486){utils['error'](_0x379486);}});ami['on']('agentconnect',function(_0xbb14a6){try{agents[_0x82fb('0x18')](_0xbb14a6);queues[_0x82fb('0x18')](_0xbb14a6);}catch(_0x4f38f8){utils[_0x82fb('0x12')](_0x4f38f8);}});ami['on'](_0x82fb('0x19'),function(_0x3ef636){try{agents['agentcomplete'](_0x3ef636);queues[_0x82fb('0x19')](_0x3ef636);members[_0x82fb('0x19')](_0x3ef636);}catch(_0x27f703){utils['error'](_0x27f703);}});ami['on'](_0x82fb('0x1a'),function(_0x3c0880){try{agents['queuecallerabandon'](_0x3c0880);queues[_0x82fb('0x1a')](_0x3c0880);}catch(_0x3e6470){utils['error'](_0x3e6470);}});ami['on'](_0x82fb('0x1b'),function(_0x5b475e){try{queues[_0x82fb('0x1b')](_0x5b475e);recordings[_0x82fb('0x1b')](_0x5b475e);}catch(_0x28d841){utils[_0x82fb('0x12')](_0x28d841);}});ami['on'](_0x82fb('0x1c'),function(_0x5e06d6){try{queues[_0x82fb('0x1c')](_0x5e06d6);}catch(_0x3e4e61){utils[_0x82fb('0x12')](_0x3e4e61);}});ami['on'](_0x82fb('0x1d'),function(_0x930bc){try{queues[_0x82fb('0x1d')](_0x930bc);calls['musiconholdstart'](_0x930bc);}catch(_0x5ee9b5){utils[_0x82fb('0x12')](_0x5ee9b5);}});ami['on']('musiconholdstop',function(_0x33cdfc){try{queues[_0x82fb('0x1e')](_0x33cdfc);calls[_0x82fb('0x1e')](_0x33cdfc);}catch(_0x4afb78){utils['error'](_0x4afb78);}});ami['on'](_0x82fb('0x1f'),function(_0x2726b5){try{calls[_0x82fb('0x1f')](_0x2726b5);recordings['newstate'](_0x2726b5);}catch(_0x994fb3){utils[_0x82fb('0x12')](_0x994fb3);}});ami['on']('hangup',function(_0x32b06b){try{calls[_0x82fb('0x20')](_0x32b06b);recordings[_0x82fb('0x20')](_0x32b06b);dials[_0x82fb('0x20')](_0x32b06b);agents[_0x82fb('0x20')](_0x32b06b);queues['hangup'](_0x32b06b);}catch(_0xca15ea){utils['error'](_0xca15ea);}});ami['on'](_0x82fb('0x21'),function(_0x485a45){try{members[_0x82fb('0x21')](_0x485a45);}catch(_0x296c14){utils[_0x82fb('0x12')](_0x296c14);}});ami['on'](_0x82fb('0x22'),function(_0x16489b){try{queues[_0x82fb('0x22')](_0x16489b);agents['blindtransfer'](_0x16489b);transfers[_0x82fb('0x22')](_0x16489b);}catch(_0xdd7a98){utils[_0x82fb('0x12')](_0xdd7a98);}});ami['on'](_0x82fb('0x23'),function(_0x3741f7){try{queues[_0x82fb('0x23')](_0x3741f7);transfers[_0x82fb('0x23')](_0x3741f7);agents[_0x82fb('0x23')](_0x3741f7);calls['attendedtransfer'](_0x3741f7);}catch(_0x2750c3){utils[_0x82fb('0x12')](_0x2750c3);}});ami['on']('varset',function(_0x710d1f){try{queues[_0x82fb('0x24')](_0x710d1f);recordings[_0x82fb('0x24')](_0x710d1f);calls[_0x82fb('0x24')](_0x710d1f);dials[_0x82fb('0x24')](_0x710d1f);}catch(_0x258778){utils[_0x82fb('0x12')](_0x258778);}});ami['on']('newexten',function(_0x7deda7){try{calls['newexten'](_0x7deda7);recordings[_0x82fb('0x25')](_0x7deda7);dials[_0x82fb('0x25')](_0x7deda7);}catch(_0x5c52b0){utils[_0x82fb('0x12')](_0x5c52b0);}});ami['on']('newchannel',function(_0x5e2342){try{calls[_0x82fb('0x26')](_0x5e2342);recordings[_0x82fb('0x26')](_0x5e2342);}catch(_0x5bede4){utils[_0x82fb('0x12')](_0x5bede4);}});ami['on']('dialbegin',function(_0x5204aa){try{dials[_0x82fb('0x27')](_0x5204aa);}catch(_0x191275){utils[_0x82fb('0x12')](_0x191275);}});ami['on'](_0x82fb('0x28'),function(_0x2b53ed){try{dials[_0x82fb('0x28')](_0x2b53ed);}catch(_0x5188cc){utils['error'](_0x5188cc);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index c01a8ec..f2e86f9 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 _0x9685=['name','internal','CreateMemberReport','getUserByName','split','request','catch','error','startsWith','state','INUSE','voice','device','TALKING','now','agent','NOT_INUSE','isNil','exitAt','duration','agentcomplete','assign','queue','uniqueid','cdr','source','data3','destination','destinationchannel','lodash','util','./utils','Local/_attended@transfer','Queue:','info','MEMBER|%s|%s|%s|%s|%s|%s','interface','channel','data2','membername','type','getUserByInterface'];(function(_0x4824cb,_0x3b54cf){var _0xea1a9f=function(_0x4b2466){while(--_0x4b2466){_0x4824cb['push'](_0x4824cb['shift']());}};_0xea1a9f(++_0x3b54cf);}(_0x9685,0x1eb));var _0x5968=function(_0xd9efd3,_0x37e049){_0xd9efd3=_0xd9efd3-0x0;var _0x3feb1c=_0x9685[_0xd9efd3];return _0x3feb1c;};'use strict';var _=require(_0x5968('0x0'));var util=require(_0x5968('0x1'));var utils=require(_0x5968('0x2'));var members={};var exclude=[_0x5968('0x3'),_0x5968('0x4')];function writeDB(_0xf246c5){utils[_0x5968('0x5')](util['format'](_0x5968('0x6'),_0xf246c5['uniqueid'],_0xf246c5[_0x5968('0x7')],_0xf246c5[_0x5968('0x8')],_0xf246c5[_0x5968('0x9')],_0xf246c5[_0x5968('0xa')],_0xf246c5[_0x5968('0xb')]));if(_0xf246c5['interface']){utils[_0x5968('0xc')](_0xf246c5[_0x5968('0x7')])['then'](function(_0x12d21a){if(_0x12d21a){_0xf246c5['membername']=_0x12d21a[_0x5968('0xd')];_0xf246c5['internal']=_0x12d21a[_0x5968('0xe')];utils['request'](_0x5968('0xf'),_0xf246c5);}else{utils[_0x5968('0x10')](_0xf246c5[_0x5968('0x7')][_0x5968('0x11')]('/')[0x1])['then'](function(_0x3de1fa){if(_0x3de1fa){_0xf246c5[_0x5968('0xa')]=_0x3de1fa[_0x5968('0xd')];_0xf246c5[_0x5968('0xe')]=_0x3de1fa['internal'];utils[_0x5968('0x12')](_0x5968('0xf'),_0xf246c5);}});}})[_0x5968('0x13')](function(_0x1dcc2a){utils[_0x5968('0x14')](_0x1dcc2a);});}delete members[_0xf246c5[_0x5968('0x7')]];}function startsWith(_0x5ef7c0,_0x255a9e){return _['some'](_0x5ef7c0,function(_0x51d266){return _[_0x5968('0x15')](_0x255a9e,_0x51d266);});}exports['devicestatechange']=function(_0x18027d){switch(_0x18027d[_0x5968('0x16')]){case _0x5968('0x17'):case'BUSY':if(!startsWith(exclude,_0x18027d['device'])){members[_0x18027d['device']]={'channel':_0x5968('0x18'),'interface':_0x18027d[_0x5968('0x19')],'type':_0x5968('0x1a'),'enterAt':utils[_0x5968('0x1b')](),'role':_0x5968('0x1c')};}break;case _0x5968('0x1d'):if(!_[_0x5968('0x1e')](members[_0x18027d[_0x5968('0x19')]])){members[_0x18027d[_0x5968('0x19')]][_0x5968('0x1f')]=utils[_0x5968('0x1b')]();members[_0x18027d['device']][_0x5968('0x20')]=utils['diffTime'](members[_0x18027d['device']]['exitAt'],members[_0x18027d['device']]['enterAt']);if(members[_0x18027d[_0x5968('0x19')]]['uniqueid']){writeDB(members[_0x18027d[_0x5968('0x19')]]);}}default:break;}};exports[_0x5968('0x21')]=function(_0xf4a671){if(!_[_0x5968('0x1e')](members[_0xf4a671[_0x5968('0x7')]])){members[_0xf4a671[_0x5968('0x7')]]=_[_0x5968('0x22')](members[_0xf4a671[_0x5968('0x7')]],{'data4':_0xf4a671[_0x5968('0x23')],'uniqueid':_0xf4a671[_0x5968('0x24')]});}};exports[_0x5968('0x25')]=function(_0x54787a){if(_0x54787a[_0x5968('0x8')]){var _0x10fa7c=_0x54787a[_0x5968('0x8')][_0x5968('0x11')]('-')[0x0];if(!_[_0x5968('0x1e')](members[_0x10fa7c])){members[_0x10fa7c]=_[_0x5968('0x22')](members[_0x10fa7c],{'data1':members[_0x10fa7c]['data1']||_0x54787a[_0x5968('0xb')],'data2':members[_0x10fa7c][_0x5968('0x9')]||_0x54787a[_0x5968('0x26')],'data3':members[_0x10fa7c][_0x5968('0x27')]||_0x54787a[_0x5968('0x28')],'uniqueid':members[_0x10fa7c][_0x5968('0x24')]||_0x54787a[_0x5968('0x24')]});if(members[_0x10fa7c]['exitAt']){writeDB(members[_0x10fa7c]);}}}if(_0x54787a[_0x5968('0x29')]){var _0x4f8390=_0x54787a[_0x5968('0x29')]['split']('-')[0x0];if(!_['isNil'](members[_0x4f8390])){members[_0x4f8390]=_[_0x5968('0x22')](members[_0x4f8390],{'data1':members[_0x4f8390]['data1']||_0x54787a[_0x5968('0xb')],'data2':members[_0x4f8390][_0x5968('0x9')]||_0x54787a['source'],'data3':members[_0x4f8390]['data3']||_0x54787a[_0x5968('0x28')],'uniqueid':members[_0x4f8390][_0x5968('0x24')]||_0x54787a['uniqueid']});if(members[_0x4f8390]['exitAt']){writeDB(members[_0x4f8390]);}}}}; \ No newline at end of file +var _0xf3ca=['util','Queue:','info','format','MEMBER|%s|%s|%s|%s|%s|%s','uniqueid','data2','membername','type','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','interface','split','catch','error','some','startsWith','devicestatechange','state','BUSY','device','TALKING','now','agent','NOT_INUSE','exitAt','diffTime','enterAt','agentcomplete','queue','channel','isNil','assign','data1','destination','source'];(function(_0x1cb0b4,_0x1fd48d){var _0x525b60=function(_0x1efccc){while(--_0x1efccc){_0x1cb0b4['push'](_0x1cb0b4['shift']());}};_0x525b60(++_0x1fd48d);}(_0xf3ca,0x171));var _0xaf3c=function(_0x47554d,_0x36ac72){_0x47554d=_0x47554d-0x0;var _0x4554b1=_0xf3ca[_0x47554d];return _0x4554b1;};'use strict';var _=require('lodash');var util=require(_0xaf3c('0x0'));var utils=require('./utils');var members={};var exclude=['Local/_attended@transfer',_0xaf3c('0x1')];function writeDB(_0x3a5b4e){utils[_0xaf3c('0x2')](util[_0xaf3c('0x3')](_0xaf3c('0x4'),_0x3a5b4e[_0xaf3c('0x5')],_0x3a5b4e['interface'],_0x3a5b4e['channel'],_0x3a5b4e[_0xaf3c('0x6')],_0x3a5b4e[_0xaf3c('0x7')],_0x3a5b4e[_0xaf3c('0x8')]));if(_0x3a5b4e['interface']){utils[_0xaf3c('0x9')](_0x3a5b4e['interface'])[_0xaf3c('0xa')](function(_0x277e8f){if(_0x277e8f){_0x3a5b4e['membername']=_0x277e8f[_0xaf3c('0xb')];_0x3a5b4e[_0xaf3c('0xc')]=_0x277e8f[_0xaf3c('0xc')];utils[_0xaf3c('0xd')](_0xaf3c('0xe'),_0x3a5b4e);}else{utils[_0xaf3c('0xf')](_0x3a5b4e[_0xaf3c('0x10')][_0xaf3c('0x11')]('/')[0x1])['then'](function(_0x16a2d3){if(_0x16a2d3){_0x3a5b4e['membername']=_0x16a2d3['name'];_0x3a5b4e[_0xaf3c('0xc')]=_0x16a2d3['internal'];utils['request']('CreateMemberReport',_0x3a5b4e);}});}})[_0xaf3c('0x12')](function(_0xe19eb4){utils[_0xaf3c('0x13')](_0xe19eb4);});}delete members[_0x3a5b4e[_0xaf3c('0x10')]];}function startsWith(_0xe1849e,_0x17d9bb){return _[_0xaf3c('0x14')](_0xe1849e,function(_0x13df16){return _[_0xaf3c('0x15')](_0x17d9bb,_0x13df16);});}exports[_0xaf3c('0x16')]=function(_0xc5d472){switch(_0xc5d472[_0xaf3c('0x17')]){case'INUSE':case _0xaf3c('0x18'):if(!startsWith(exclude,_0xc5d472[_0xaf3c('0x19')])){members[_0xc5d472[_0xaf3c('0x19')]]={'channel':'voice','interface':_0xc5d472[_0xaf3c('0x19')],'type':_0xaf3c('0x1a'),'enterAt':utils[_0xaf3c('0x1b')](),'role':_0xaf3c('0x1c')};}break;case _0xaf3c('0x1d'):if(!_['isNil'](members[_0xc5d472['device']])){members[_0xc5d472[_0xaf3c('0x19')]][_0xaf3c('0x1e')]=utils[_0xaf3c('0x1b')]();members[_0xc5d472[_0xaf3c('0x19')]]['duration']=utils[_0xaf3c('0x1f')](members[_0xc5d472[_0xaf3c('0x19')]]['exitAt'],members[_0xc5d472[_0xaf3c('0x19')]][_0xaf3c('0x20')]);if(members[_0xc5d472[_0xaf3c('0x19')]]['uniqueid']){writeDB(members[_0xc5d472[_0xaf3c('0x19')]]);}}default:break;}};exports[_0xaf3c('0x21')]=function(_0x89928){if(!_['isNil'](members[_0x89928['interface']])){members[_0x89928[_0xaf3c('0x10')]]=_['assign'](members[_0x89928[_0xaf3c('0x10')]],{'data4':_0x89928[_0xaf3c('0x22')],'uniqueid':_0x89928[_0xaf3c('0x5')]});}};exports['cdr']=function(_0x4937a9){if(_0x4937a9[_0xaf3c('0x23')]){var _0x5ae43d=_0x4937a9['channel'][_0xaf3c('0x11')]('-')[0x0];if(!_[_0xaf3c('0x24')](members[_0x5ae43d])){members[_0x5ae43d]=_[_0xaf3c('0x25')](members[_0x5ae43d],{'data1':members[_0x5ae43d][_0xaf3c('0x26')]||_0x4937a9[_0xaf3c('0x8')],'data2':members[_0x5ae43d][_0xaf3c('0x6')]||_0x4937a9['source'],'data3':members[_0x5ae43d]['data3']||_0x4937a9[_0xaf3c('0x27')],'uniqueid':members[_0x5ae43d][_0xaf3c('0x5')]||_0x4937a9[_0xaf3c('0x5')]});if(members[_0x5ae43d][_0xaf3c('0x1e')]){writeDB(members[_0x5ae43d]);}}}if(_0x4937a9['destinationchannel']){var _0x479240=_0x4937a9['destinationchannel'][_0xaf3c('0x11')]('-')[0x0];if(!_[_0xaf3c('0x24')](members[_0x479240])){members[_0x479240]=_['assign'](members[_0x479240],{'data1':members[_0x479240][_0xaf3c('0x26')]||_0x4937a9['type'],'data2':members[_0x479240][_0xaf3c('0x6')]||_0x4937a9[_0xaf3c('0x28')],'data3':members[_0x479240]['data3']||_0x4937a9[_0xaf3c('0x27')],'uniqueid':members[_0x479240][_0xaf3c('0x5')]||_0x4937a9[_0xaf3c('0x5')]});if(members[_0x479240][_0xaf3c('0x1e')]){writeDB(members[_0x479240]);}}}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 23c3d63..213ac3a 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 _0x8979=['musiconholdstop','lodash','util','./utils','info','format','channel','lastAssignedTo','calleridnum','queuecallerexitreason','queue','then','type','request','CreateVoiceQueueReport','transfereduniqueid','uniqueid','queuecallerjoin','assign','position','isNil','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','now','COMPLETEDBYAGENT','queuecallerenterreason','variable','queuestatus','queuecallerabandon','queuecallerexit','queuecallerexitAt','value','toUpperCase','queueposition','queuecallerabandonAt','EXITWITHKEY','ABANDONED','diffTime','count','connectedlinenum','assigned','destaccountcode','membername','agentcomplete','reason','TRANSFER','blindtransfer','transfereeuniqueid','transfer','transfertype','BLIND','transferexten','transferuniqueid','BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','queuecallerjoinAt','holdtime','mohtime','secondtransfereruniqueid','transfertargetlinkedid','error','stack','musiconholdstartAt'];(function(_0xf40b4e,_0x546305){var _0x24ae27=function(_0x3f938e){while(--_0x3f938e){_0xf40b4e['push'](_0xf40b4e['shift']());}};_0x24ae27(++_0x546305);}(_0x8979,0x16e));var _0x9897=function(_0x591997,_0x3706d3){_0x591997=_0x591997-0x0;var _0x1b18b8=_0x8979[_0x591997];return _0x1b18b8;};'use strict';var _=require(_0x9897('0x0'));var util=require(_0x9897('0x1'));var utils=require(_0x9897('0x2'));var queues={};function writeDB(_0x5f0fd8){utils[_0x9897('0x3')](util[_0x9897('0x4')]('QUEUE|%s|%s|%s|%s|%s|%s|%s',_0x5f0fd8['uniqueid'],_0x5f0fd8[_0x9897('0x5')],_0x5f0fd8['queue'],_0x5f0fd8[_0x9897('0x6')],_0x5f0fd8[_0x9897('0x7')],_0x5f0fd8['accountcode'],_0x5f0fd8[_0x9897('0x8')]));if(_0x5f0fd8[_0x9897('0x9')]){utils['getVoiceQueueByName'](_0x5f0fd8[_0x9897('0x9')])[_0x9897('0xa')](function(_0x436798){if(_0x436798){_0x5f0fd8[_0x9897('0xb')]=_0x436798[_0x9897('0xb')];}utils[_0x9897('0xc')](_0x9897('0xd'),_0x5f0fd8);});}else{utils[_0x9897('0xc')](_0x9897('0xd'),_0x5f0fd8);}if(_0x5f0fd8[_0x9897('0xe')]){delete queues[_0x5f0fd8[_0x9897('0xe')]];}else{delete queues[_0x5f0fd8[_0x9897('0xf')]];}}exports[_0x9897('0x10')]=function(_0x23e5fa){queues[_0x23e5fa['uniqueid']]=_[_0x9897('0x11')](_0x23e5fa,{'originalposition':_0x23e5fa[_0x9897('0x12')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});};exports['hangup']=function(_0x1a9bda){if(!_[_0x9897('0x13')](queues[_0x1a9bda[_0x9897('0xf')]])){if(queues[_0x1a9bda[_0x9897('0xf')]][_0x9897('0x14')]){if(!queues[_0x1a9bda[_0x9897('0xf')]]['queuecallerabandon']&&!queues[_0x1a9bda[_0x9897('0xf')]]['queuecallerexit']){queues[_0x1a9bda[_0x9897('0xf')]][_0x9897('0x15')]=!![];queues[_0x1a9bda[_0x9897('0xf')]][_0x9897('0x16')]=utils[_0x9897('0x17')]();queues[_0x1a9bda[_0x9897('0xf')]][_0x9897('0x8')]=_0x9897('0x18');}writeDB(queues[_0x1a9bda[_0x9897('0xf')]]);}else{if(queues[_0x1a9bda[_0x9897('0xf')]]['transfereduniqueid']){queues[queues[_0x1a9bda[_0x9897('0xf')]][_0x9897('0xe')]]=queues[_0x1a9bda[_0x9897('0xf')]];queues[queues[_0x1a9bda[_0x9897('0xf')]][_0x9897('0xe')]][_0x9897('0x19')]=0x2;delete queues[_0x1a9bda[_0x9897('0xf')]];}}}};exports['varset']=function(_0x371c1e){if(!_[_0x9897('0x13')](_0x371c1e[_0x9897('0x1a')][_0x9897('0x1b')])){if(!_[_0x9897('0x13')](queues[_0x371c1e[_0x9897('0xf')]])){queues[_0x371c1e[_0x9897('0xf')]][_0x9897('0x1c')]=![];queues[_0x371c1e[_0x9897('0xf')]]['queuecallerabandonAt']=null;queues[_0x371c1e[_0x9897('0xf')]][_0x9897('0x1d')]=!![];queues[_0x371c1e['uniqueid']][_0x9897('0x1e')]=utils[_0x9897('0x17')]();queues[_0x371c1e[_0x9897('0xf')]]['queuecallerexitreason']=_0x371c1e[_0x9897('0x1f')][_0x9897('0x20')]();writeDB(queues[_0x371c1e[_0x9897('0xf')]]);}}else if(!_['isNil'](_0x371c1e[_0x9897('0x1a')][_0x9897('0x21')])){if(!_[_0x9897('0x13')](queues[_0x371c1e[_0x9897('0xf')]])&&!queues[_0x371c1e[_0x9897('0xf')]][_0x9897('0x1c')]){queues[_0x371c1e[_0x9897('0xf')]][_0x9897('0x1c')]=![];queues[_0x371c1e['uniqueid']][_0x9897('0x22')]=null;queues[_0x371c1e[_0x9897('0xf')]][_0x9897('0x1d')]=!![];queues[_0x371c1e['uniqueid']][_0x9897('0x1e')]=utils[_0x9897('0x17')]();queues[_0x371c1e['uniqueid']][_0x9897('0x8')]=_0x9897('0x23');}}};exports[_0x9897('0x1c')]=function(_0x5c1001){if(!_[_0x9897('0x13')](queues[_0x5c1001[_0x9897('0xf')]])){queues[_0x5c1001[_0x9897('0xf')]][_0x9897('0x1d')]=![];queues[_0x5c1001[_0x9897('0xf')]]['queuecallerexitAt']=null;queues[_0x5c1001[_0x9897('0xf')]][_0x9897('0x1c')]=!![];queues[_0x5c1001[_0x9897('0xf')]]['queuecallerabandonAt']=utils[_0x9897('0x17')]();queues[_0x5c1001[_0x9897('0xf')]]['queuecallerexitreason']=_0x9897('0x24');}};exports['queuecallerleave']=function(_0x263218){if(!_[_0x9897('0x13')](queues[_0x263218[_0x9897('0xf')]])){queues[_0x263218['uniqueid']]['queuecallerleave']=!![];queues[_0x263218['uniqueid']][_0x9897('0x14')]=utils[_0x9897('0x17')]();queues[_0x263218[_0x9897('0xf')]]['holdtime']=utils[_0x9897('0x25')](queues[_0x263218['uniqueid']][_0x9897('0x14')],queues[_0x263218[_0x9897('0xf')]]['queuecallerjoinAt']);queues[_0x263218[_0x9897('0xf')]][_0x9897('0x12')]=_0x263218[_0x9897('0x12')];queues[_0x263218[_0x9897('0xf')]][_0x9897('0x26')]=_0x263218['count'];queues[_0x263218[_0x9897('0xf')]][_0x9897('0x27')]=_0x263218[_0x9897('0x27')];queues[_0x263218[_0x9897('0xf')]]['connectedlinename']=_0x263218['connectedlinename'];}};exports['agentconnect']=function(_0x4a1ab4){if(!_[_0x9897('0x13')](queues[_0x4a1ab4[_0x9897('0xf')]])){queues[_0x4a1ab4[_0x9897('0xf')]][_0x9897('0x1c')]=![];queues[_0x4a1ab4[_0x9897('0xf')]][_0x9897('0x1c')]=![];queues[_0x4a1ab4[_0x9897('0xf')]][_0x9897('0x22')]=null;queues[_0x4a1ab4['uniqueid']][_0x9897('0x1d')]=![];queues[_0x4a1ab4[_0x9897('0xf')]][_0x9897('0x1e')]=null;queues[_0x4a1ab4['uniqueid']][_0x9897('0x28')]=!![];queues[_0x4a1ab4[_0x9897('0xf')]]['accountcode']=_0x4a1ab4[_0x9897('0x29')];queues[_0x4a1ab4[_0x9897('0xf')]][_0x9897('0x6')]=_0x4a1ab4[_0x9897('0x2a')];}};exports[_0x9897('0x2b')]=function(_0x25d09d){if(!_[_0x9897('0x13')](queues[_0x25d09d[_0x9897('0xf')]])){if(queues[_0x25d09d['uniqueid']][_0x9897('0x14')]){queues[_0x25d09d[_0x9897('0xf')]][_0x9897('0x1c')]=![];queues[_0x25d09d[_0x9897('0xf')]][_0x9897('0x1c')]=![];queues[_0x25d09d[_0x9897('0xf')]][_0x9897('0x22')]=null;queues[_0x25d09d[_0x9897('0xf')]][_0x9897('0x1d')]=![];queues[_0x25d09d['uniqueid']][_0x9897('0x1e')]=null;queues[_0x25d09d['uniqueid']][_0x9897('0x28')]=!![];queues[_0x25d09d[_0x9897('0xf')]][_0x9897('0x6')]=_0x25d09d[_0x9897('0x2a')];queues[_0x25d09d['uniqueid']]['queuecallercomplete']=!![];queues[_0x25d09d[_0x9897('0xf')]][_0x9897('0x16')]=utils[_0x9897('0x17')]();if(_0x25d09d[_0x9897('0x2c')]=='transfer'){if(!queues[_0x25d09d[_0x9897('0xf')]]['transfer']){queues[_0x25d09d[_0x9897('0xf')]][_0x9897('0x8')]=_0x9897('0x2d');}}else{queues[_0x25d09d['uniqueid']][_0x9897('0x8')]='COMPLETEDBY'+_0x25d09d['reason']['toUpperCase']();}writeDB(queues[_0x25d09d[_0x9897('0xf')]]);}}};exports[_0x9897('0x2e')]=function(_0x50dde5){if(!_[_0x9897('0x13')](queues[_0x50dde5[_0x9897('0x2f')]])){queues[_0x50dde5[_0x9897('0x2f')]][_0x9897('0x30')]=!![];queues[_0x50dde5[_0x9897('0x2f')]][_0x9897('0x31')]=_0x9897('0x32');queues[_0x50dde5[_0x9897('0x2f')]][_0x9897('0x33')]=_0x50dde5['extension'];queues[_0x50dde5['transfereeuniqueid']][_0x9897('0x34')]=_0x50dde5[_0x9897('0x2f')];queues[_0x50dde5[_0x9897('0x2f')]][_0x9897('0x8')]=_0x9897('0x35');}};exports[_0x9897('0x36')]=function(_0x5d10a0){try{if(_0x5d10a0[_0x9897('0x37')]==_0x5d10a0[_0x9897('0x38')]){if(!_[_0x9897('0x13')](queues[_0x5d10a0[_0x9897('0x39')]])){queues[_0x5d10a0[_0x9897('0x39')]]['transfer']=!![];queues[_0x5d10a0[_0x9897('0x39')]][_0x9897('0x31')]=_0x9897('0x3a');queues[_0x5d10a0[_0x9897('0x39')]][_0x9897('0x33')]=_0x5d10a0['origtransfererexten'];queues[_0x5d10a0[_0x9897('0x39')]][_0x9897('0x34')]=_0x5d10a0[_0x9897('0x37')];queues[_0x5d10a0['secondtransfererlinkedid']][_0x9897('0x8')]=_0x9897('0x3b');}if(!_[_0x9897('0x13')](queues[_0x5d10a0[_0x9897('0x38')]])){if(_0x5d10a0[_0x9897('0x3c')]&&queues[_0x5d10a0[_0x9897('0x3c')]]){queues[_0x5d10a0[_0x9897('0x3c')]][_0x9897('0x19')]=0x1;queues[_0x5d10a0[_0x9897('0x2f')]]=_[_0x9897('0x3d')](queues[_0x5d10a0[_0x9897('0x3c')]]);queues[_0x5d10a0[_0x9897('0x2f')]][_0x9897('0xe')]=_0x5d10a0[_0x9897('0x3e')];queues[_0x5d10a0[_0x9897('0x2f')]][_0x9897('0x19')]=0x2;queues[_0x5d10a0[_0x9897('0x2f')]][_0x9897('0x7')]=queues[_0x5d10a0[_0x9897('0x39')]][_0x9897('0x7')];queues[_0x5d10a0['transfereeuniqueid']][_0x9897('0x3f')]=queues[_0x5d10a0[_0x9897('0x39')]][_0x9897('0x3f')];queues[_0x5d10a0[_0x9897('0x2f')]][_0x9897('0x40')]=utils[_0x9897('0x17')]();queues[_0x5d10a0['transfereeuniqueid']][_0x9897('0x14')]=utils[_0x9897('0x17')]();queues[_0x5d10a0[_0x9897('0x2f')]][_0x9897('0x41')]=0x0;queues[_0x5d10a0[_0x9897('0x2f')]][_0x9897('0x42')]=0x0;}else{queues[_0x5d10a0[_0x9897('0x38')]]['transfereduniqueid']=_0x5d10a0[_0x9897('0x39')];}}}else if(_0x5d10a0[_0x9897('0x43')]==_0x5d10a0[_0x9897('0x39')]){if(!_[_0x9897('0x13')](queues[_0x5d10a0[_0x9897('0x38')]])){queues[_0x5d10a0[_0x9897('0x38')]][_0x9897('0x30')]=!![];queues[_0x5d10a0[_0x9897('0x38')]][_0x9897('0x31')]='ATTENDED';queues[_0x5d10a0[_0x9897('0x38')]]['transferexten']=_0x5d10a0['secondtransfererexten'];queues[_0x5d10a0['origtransfererlinkedid']][_0x9897('0x34')]=_0x5d10a0[_0x9897('0x43')];queues[_0x5d10a0[_0x9897('0x38')]]['queuecallerexitreason']=_0x9897('0x3b');}if(!_['isNil'](queues[_0x5d10a0[_0x9897('0x39')]])){if(_0x5d10a0[_0x9897('0x44')]&&queues[_0x5d10a0[_0x9897('0x44')]]){queues[_0x5d10a0[_0x9897('0x44')]][_0x9897('0x19')]=0x1;queues[_0x5d10a0[_0x9897('0x3e')]]=_[_0x9897('0x3d')](queues[_0x5d10a0[_0x9897('0x44')]]);queues[_0x5d10a0['transfertargetuniqueid']]['transfereduniqueid']=_0x5d10a0[_0x9897('0x3e')];queues[_0x5d10a0[_0x9897('0x3e')]][_0x9897('0x19')]=0x2;queues[_0x5d10a0['transfertargetuniqueid']][_0x9897('0x7')]=queues[_0x5d10a0[_0x9897('0x38')]][_0x9897('0x7')];queues[_0x5d10a0['transfertargetuniqueid']][_0x9897('0x3f')]=queues[_0x5d10a0['origtransfererlinkedid']][_0x9897('0x3f')];queues[_0x5d10a0[_0x9897('0x3e')]][_0x9897('0x40')]=utils['now']();queues[_0x5d10a0[_0x9897('0x3e')]][_0x9897('0x14')]=utils[_0x9897('0x17')]();queues[_0x5d10a0['transfertargetuniqueid']][_0x9897('0x41')]=0x0;queues[_0x5d10a0[_0x9897('0x3e')]]['mohtime']=0x0;}else{queues[_0x5d10a0[_0x9897('0x39')]][_0x9897('0xe')]=_0x5d10a0[_0x9897('0x38')];}}}}catch(_0x451c88){utils[_0x9897('0x45')](_0x451c88[_0x9897('0x46')]);}};exports['musiconholdstart']=function(_0x37558c){if(!_['isNil'](queues[_0x37558c['uniqueid']])){queues[_0x37558c[_0x9897('0xf')]][_0x9897('0x47')]=utils[_0x9897('0x17')]();}};exports[_0x9897('0x48')]=function(_0xd5c47a){if(!_[_0x9897('0x13')](queues[_0xd5c47a[_0x9897('0xf')]])){if(!_['isNil'](queues[_0xd5c47a[_0x9897('0xf')]]['musiconholdstartAt'])){queues[_0xd5c47a['uniqueid']][_0x9897('0x42')]+=utils[_0x9897('0x25')](utils['now'](),queues[_0xd5c47a[_0x9897('0xf')]]['musiconholdstartAt']);delete queues[_0xd5c47a['uniqueid']][_0x9897('0x47')];}}}; \ No newline at end of file +var _0x6f2d=['musiconholdstartAt','lodash','format','QUEUE|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','assign','position','now','hangup','isNil','queuecallerleaveAt','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','queuecallerenterreason','varset','queuecallerabandonAt','queuecallerexitAt','value','toUpperCase','variable','queueposition','queuecallerabandon','EXITWITHKEY','ABANDONED','queuecallerleave','holdtime','queuecallerjoinAt','count','connectedlinenum','agentconnect','assigned','destaccountcode','membername','agentcomplete','reason','transfer','TRANSFER','blindtransfer','transfereeuniqueid','transfertype','BLIND','transferuniqueid','BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','ATTENDED','transferexten','origtransfererexten','transfereelinkedid','transfertargetuniqueid','calleridname','mohtime','secondtransfererexten','secondtransfereruniqueid','ATTENDEDTRANSFER','transfertargetlinkedid','clone','error','stack','musiconholdstart'];(function(_0x43747e,_0x13b832){var _0x7fb853=function(_0x4b1028){while(--_0x4b1028){_0x43747e['push'](_0x43747e['shift']());}};_0x7fb853(++_0x13b832);}(_0x6f2d,0x182));var _0xd6f2=function(_0x27e1bb,_0x3554cd){_0x27e1bb=_0x27e1bb-0x0;var _0x484a1d=_0x6f2d[_0x27e1bb];return _0x484a1d;};'use strict';var _=require(_0xd6f2('0x0'));var util=require('util');var utils=require('./utils');var queues={};function writeDB(_0x3a4f3b){utils['info'](util[_0xd6f2('0x1')](_0xd6f2('0x2'),_0x3a4f3b[_0xd6f2('0x3')],_0x3a4f3b[_0xd6f2('0x4')],_0x3a4f3b[_0xd6f2('0x5')],_0x3a4f3b[_0xd6f2('0x6')],_0x3a4f3b[_0xd6f2('0x7')],_0x3a4f3b[_0xd6f2('0x8')],_0x3a4f3b[_0xd6f2('0x9')]));if(_0x3a4f3b[_0xd6f2('0x5')]){utils[_0xd6f2('0xa')](_0x3a4f3b[_0xd6f2('0x5')])[_0xd6f2('0xb')](function(_0x1bd596){if(_0x1bd596){_0x3a4f3b[_0xd6f2('0xc')]=_0x1bd596[_0xd6f2('0xc')];}utils[_0xd6f2('0xd')](_0xd6f2('0xe'),_0x3a4f3b);});}else{utils[_0xd6f2('0xd')](_0xd6f2('0xe'),_0x3a4f3b);}if(_0x3a4f3b[_0xd6f2('0xf')]){delete queues[_0x3a4f3b[_0xd6f2('0xf')]];}else{delete queues[_0x3a4f3b['uniqueid']];}}exports[_0xd6f2('0x10')]=function(_0x20a0f2){queues[_0x20a0f2[_0xd6f2('0x3')]]=_[_0xd6f2('0x11')](_0x20a0f2,{'originalposition':_0x20a0f2[_0xd6f2('0x12')],'queuecallerjoinAt':utils[_0xd6f2('0x13')](),'mohtime':0x0});};exports[_0xd6f2('0x14')]=function(_0x44a69c){if(!_[_0xd6f2('0x15')](queues[_0x44a69c[_0xd6f2('0x3')]])){if(queues[_0x44a69c[_0xd6f2('0x3')]][_0xd6f2('0x16')]){if(!queues[_0x44a69c[_0xd6f2('0x3')]]['queuecallerabandon']&&!queues[_0x44a69c[_0xd6f2('0x3')]][_0xd6f2('0x17')]){queues[_0x44a69c['uniqueid']][_0xd6f2('0x18')]=!![];queues[_0x44a69c[_0xd6f2('0x3')]][_0xd6f2('0x19')]=utils['now']();queues[_0x44a69c['uniqueid']][_0xd6f2('0x9')]=_0xd6f2('0x1a');}writeDB(queues[_0x44a69c[_0xd6f2('0x3')]]);}else{if(queues[_0x44a69c[_0xd6f2('0x3')]][_0xd6f2('0xf')]){queues[queues[_0x44a69c['uniqueid']][_0xd6f2('0xf')]]=queues[_0x44a69c[_0xd6f2('0x3')]];queues[queues[_0x44a69c[_0xd6f2('0x3')]][_0xd6f2('0xf')]][_0xd6f2('0x1b')]=0x2;delete queues[_0x44a69c['uniqueid']];}}}};exports[_0xd6f2('0x1c')]=function(_0x50cf25){if(!_[_0xd6f2('0x15')](_0x50cf25['variable']['queuestatus'])){if(!_[_0xd6f2('0x15')](queues[_0x50cf25[_0xd6f2('0x3')]])){queues[_0x50cf25[_0xd6f2('0x3')]]['queuecallerabandon']=![];queues[_0x50cf25[_0xd6f2('0x3')]][_0xd6f2('0x1d')]=null;queues[_0x50cf25[_0xd6f2('0x3')]][_0xd6f2('0x17')]=!![];queues[_0x50cf25[_0xd6f2('0x3')]][_0xd6f2('0x1e')]=utils['now']();queues[_0x50cf25[_0xd6f2('0x3')]][_0xd6f2('0x9')]=_0x50cf25[_0xd6f2('0x1f')][_0xd6f2('0x20')]();writeDB(queues[_0x50cf25[_0xd6f2('0x3')]]);}}else if(!_['isNil'](_0x50cf25[_0xd6f2('0x21')][_0xd6f2('0x22')])){if(!_[_0xd6f2('0x15')](queues[_0x50cf25[_0xd6f2('0x3')]])&&!queues[_0x50cf25[_0xd6f2('0x3')]][_0xd6f2('0x23')]){queues[_0x50cf25['uniqueid']]['queuecallerabandon']=![];queues[_0x50cf25[_0xd6f2('0x3')]][_0xd6f2('0x1d')]=null;queues[_0x50cf25['uniqueid']]['queuecallerexit']=!![];queues[_0x50cf25[_0xd6f2('0x3')]][_0xd6f2('0x1e')]=utils[_0xd6f2('0x13')]();queues[_0x50cf25[_0xd6f2('0x3')]][_0xd6f2('0x9')]=_0xd6f2('0x24');}}};exports[_0xd6f2('0x23')]=function(_0x1550c7){if(!_[_0xd6f2('0x15')](queues[_0x1550c7[_0xd6f2('0x3')]])){queues[_0x1550c7['uniqueid']][_0xd6f2('0x17')]=![];queues[_0x1550c7[_0xd6f2('0x3')]]['queuecallerexitAt']=null;queues[_0x1550c7[_0xd6f2('0x3')]][_0xd6f2('0x23')]=!![];queues[_0x1550c7[_0xd6f2('0x3')]][_0xd6f2('0x1d')]=utils[_0xd6f2('0x13')]();queues[_0x1550c7[_0xd6f2('0x3')]][_0xd6f2('0x9')]=_0xd6f2('0x25');}};exports[_0xd6f2('0x26')]=function(_0xaae4ca){if(!_[_0xd6f2('0x15')](queues[_0xaae4ca[_0xd6f2('0x3')]])){queues[_0xaae4ca['uniqueid']]['queuecallerleave']=!![];queues[_0xaae4ca[_0xd6f2('0x3')]][_0xd6f2('0x16')]=utils[_0xd6f2('0x13')]();queues[_0xaae4ca[_0xd6f2('0x3')]][_0xd6f2('0x27')]=utils['diffTime'](queues[_0xaae4ca[_0xd6f2('0x3')]][_0xd6f2('0x16')],queues[_0xaae4ca[_0xd6f2('0x3')]][_0xd6f2('0x28')]);queues[_0xaae4ca['uniqueid']][_0xd6f2('0x12')]=_0xaae4ca['position'];queues[_0xaae4ca['uniqueid']]['count']=_0xaae4ca[_0xd6f2('0x29')];queues[_0xaae4ca[_0xd6f2('0x3')]]['connectedlinenum']=_0xaae4ca[_0xd6f2('0x2a')];queues[_0xaae4ca[_0xd6f2('0x3')]]['connectedlinename']=_0xaae4ca['connectedlinename'];}};exports[_0xd6f2('0x2b')]=function(_0x3b93be){if(!_[_0xd6f2('0x15')](queues[_0x3b93be[_0xd6f2('0x3')]])){queues[_0x3b93be[_0xd6f2('0x3')]][_0xd6f2('0x23')]=![];queues[_0x3b93be[_0xd6f2('0x3')]]['queuecallerabandon']=![];queues[_0x3b93be[_0xd6f2('0x3')]][_0xd6f2('0x1d')]=null;queues[_0x3b93be[_0xd6f2('0x3')]][_0xd6f2('0x17')]=![];queues[_0x3b93be[_0xd6f2('0x3')]]['queuecallerexitAt']=null;queues[_0x3b93be[_0xd6f2('0x3')]][_0xd6f2('0x2c')]=!![];queues[_0x3b93be[_0xd6f2('0x3')]]['accountcode']=_0x3b93be[_0xd6f2('0x2d')];queues[_0x3b93be['uniqueid']][_0xd6f2('0x6')]=_0x3b93be[_0xd6f2('0x2e')];}};exports[_0xd6f2('0x2f')]=function(_0x2bb656){if(!_[_0xd6f2('0x15')](queues[_0x2bb656[_0xd6f2('0x3')]])){if(queues[_0x2bb656['uniqueid']]['queuecallerleaveAt']){queues[_0x2bb656[_0xd6f2('0x3')]][_0xd6f2('0x23')]=![];queues[_0x2bb656['uniqueid']][_0xd6f2('0x23')]=![];queues[_0x2bb656[_0xd6f2('0x3')]][_0xd6f2('0x1d')]=null;queues[_0x2bb656[_0xd6f2('0x3')]][_0xd6f2('0x17')]=![];queues[_0x2bb656[_0xd6f2('0x3')]][_0xd6f2('0x1e')]=null;queues[_0x2bb656[_0xd6f2('0x3')]][_0xd6f2('0x2c')]=!![];queues[_0x2bb656[_0xd6f2('0x3')]][_0xd6f2('0x6')]=_0x2bb656[_0xd6f2('0x2e')];queues[_0x2bb656[_0xd6f2('0x3')]][_0xd6f2('0x18')]=!![];queues[_0x2bb656[_0xd6f2('0x3')]][_0xd6f2('0x19')]=utils[_0xd6f2('0x13')]();if(_0x2bb656[_0xd6f2('0x30')]==_0xd6f2('0x31')){if(!queues[_0x2bb656[_0xd6f2('0x3')]][_0xd6f2('0x31')]){queues[_0x2bb656[_0xd6f2('0x3')]][_0xd6f2('0x9')]=_0xd6f2('0x32');}}else{queues[_0x2bb656[_0xd6f2('0x3')]]['queuecallerexitreason']='COMPLETEDBY'+_0x2bb656['reason'][_0xd6f2('0x20')]();}writeDB(queues[_0x2bb656[_0xd6f2('0x3')]]);}}};exports[_0xd6f2('0x33')]=function(_0x55e9d7){if(!_['isNil'](queues[_0x55e9d7[_0xd6f2('0x34')]])){queues[_0x55e9d7[_0xd6f2('0x34')]][_0xd6f2('0x31')]=!![];queues[_0x55e9d7['transfereeuniqueid']][_0xd6f2('0x35')]=_0xd6f2('0x36');queues[_0x55e9d7[_0xd6f2('0x34')]]['transferexten']=_0x55e9d7['extension'];queues[_0x55e9d7[_0xd6f2('0x34')]][_0xd6f2('0x37')]=_0x55e9d7[_0xd6f2('0x34')];queues[_0x55e9d7[_0xd6f2('0x34')]]['queuecallerexitreason']=_0xd6f2('0x38');}};exports[_0xd6f2('0x39')]=function(_0x3fb2af){try{if(_0x3fb2af[_0xd6f2('0x3a')]==_0x3fb2af[_0xd6f2('0x3b')]){if(!_[_0xd6f2('0x15')](queues[_0x3fb2af['secondtransfererlinkedid']])){queues[_0x3fb2af['secondtransfererlinkedid']][_0xd6f2('0x31')]=!![];queues[_0x3fb2af[_0xd6f2('0x3c')]][_0xd6f2('0x35')]=_0xd6f2('0x3d');queues[_0x3fb2af['secondtransfererlinkedid']][_0xd6f2('0x3e')]=_0x3fb2af[_0xd6f2('0x3f')];queues[_0x3fb2af[_0xd6f2('0x3c')]][_0xd6f2('0x37')]=_0x3fb2af['origtransfereruniqueid'];queues[_0x3fb2af[_0xd6f2('0x3c')]][_0xd6f2('0x9')]='ATTENDEDTRANSFER';}if(!_[_0xd6f2('0x15')](queues[_0x3fb2af[_0xd6f2('0x3b')]])){if(_0x3fb2af[_0xd6f2('0x40')]&&queues[_0x3fb2af[_0xd6f2('0x40')]]){queues[_0x3fb2af[_0xd6f2('0x40')]]['queuecallerenterreason']=0x1;queues[_0x3fb2af[_0xd6f2('0x34')]]=_['clone'](queues[_0x3fb2af['transfereelinkedid']]);queues[_0x3fb2af[_0xd6f2('0x34')]]['transfereduniqueid']=_0x3fb2af[_0xd6f2('0x41')];queues[_0x3fb2af['transfereeuniqueid']]['queuecallerenterreason']=0x2;queues[_0x3fb2af[_0xd6f2('0x34')]][_0xd6f2('0x7')]=queues[_0x3fb2af[_0xd6f2('0x3c')]]['calleridnum'];queues[_0x3fb2af[_0xd6f2('0x34')]][_0xd6f2('0x42')]=queues[_0x3fb2af['secondtransfererlinkedid']][_0xd6f2('0x42')];queues[_0x3fb2af[_0xd6f2('0x34')]]['queuecallerjoinAt']=utils[_0xd6f2('0x13')]();queues[_0x3fb2af[_0xd6f2('0x34')]][_0xd6f2('0x16')]=utils[_0xd6f2('0x13')]();queues[_0x3fb2af['transfereeuniqueid']][_0xd6f2('0x27')]=0x0;queues[_0x3fb2af['transfereeuniqueid']][_0xd6f2('0x43')]=0x0;}else{queues[_0x3fb2af['origtransfererlinkedid']]['transfereduniqueid']=_0x3fb2af[_0xd6f2('0x3c')];}}}else if(_0x3fb2af['secondtransfereruniqueid']==_0x3fb2af[_0xd6f2('0x3c')]){if(!_[_0xd6f2('0x15')](queues[_0x3fb2af[_0xd6f2('0x3b')]])){queues[_0x3fb2af['origtransfererlinkedid']][_0xd6f2('0x31')]=!![];queues[_0x3fb2af[_0xd6f2('0x3b')]][_0xd6f2('0x35')]=_0xd6f2('0x3d');queues[_0x3fb2af[_0xd6f2('0x3b')]][_0xd6f2('0x3e')]=_0x3fb2af[_0xd6f2('0x44')];queues[_0x3fb2af['origtransfererlinkedid']][_0xd6f2('0x37')]=_0x3fb2af[_0xd6f2('0x45')];queues[_0x3fb2af[_0xd6f2('0x3b')]][_0xd6f2('0x9')]=_0xd6f2('0x46');}if(!_[_0xd6f2('0x15')](queues[_0x3fb2af['secondtransfererlinkedid']])){if(_0x3fb2af[_0xd6f2('0x47')]&&queues[_0x3fb2af[_0xd6f2('0x47')]]){queues[_0x3fb2af['transfertargetlinkedid']]['queuecallerenterreason']=0x1;queues[_0x3fb2af[_0xd6f2('0x41')]]=_[_0xd6f2('0x48')](queues[_0x3fb2af['transfertargetlinkedid']]);queues[_0x3fb2af['transfertargetuniqueid']][_0xd6f2('0xf')]=_0x3fb2af['transfertargetuniqueid'];queues[_0x3fb2af[_0xd6f2('0x41')]][_0xd6f2('0x1b')]=0x2;queues[_0x3fb2af['transfertargetuniqueid']]['calleridnum']=queues[_0x3fb2af[_0xd6f2('0x3b')]][_0xd6f2('0x7')];queues[_0x3fb2af['transfertargetuniqueid']]['calleridname']=queues[_0x3fb2af[_0xd6f2('0x3b')]][_0xd6f2('0x42')];queues[_0x3fb2af['transfertargetuniqueid']][_0xd6f2('0x28')]=utils['now']();queues[_0x3fb2af[_0xd6f2('0x41')]]['queuecallerleaveAt']=utils[_0xd6f2('0x13')]();queues[_0x3fb2af[_0xd6f2('0x41')]]['holdtime']=0x0;queues[_0x3fb2af['transfertargetuniqueid']][_0xd6f2('0x43')]=0x0;}else{queues[_0x3fb2af[_0xd6f2('0x3c')]][_0xd6f2('0xf')]=_0x3fb2af[_0xd6f2('0x3b')];}}}}catch(_0xadc3b6){utils[_0xd6f2('0x49')](_0xadc3b6[_0xd6f2('0x4a')]);}};exports[_0xd6f2('0x4b')]=function(_0x468834){if(!_['isNil'](queues[_0x468834[_0xd6f2('0x3')]])){queues[_0x468834[_0xd6f2('0x3')]]['musiconholdstartAt']=utils[_0xd6f2('0x13')]();}};exports['musiconholdstop']=function(_0x50e738){if(!_[_0xd6f2('0x15')](queues[_0x50e738['uniqueid']])){if(!_['isNil'](queues[_0x50e738['uniqueid']][_0xd6f2('0x4c')])){queues[_0x50e738[_0xd6f2('0x3')]][_0xd6f2('0x43')]+=utils['diffTime'](utils[_0xd6f2('0x13')](),queues[_0x50e738[_0xd6f2('0x3')]][_0xd6f2('0x4c')]);delete queues[_0x50e738['uniqueid']]['musiconholdstartAt'];}}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 0c8e4d1..9e2b065 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 _0xa9e0=['application','set','appdata','toLowerCase','cdr','substring','lastIndexOf','queuecallerjoin','queue','lodash','./utils','getUserByInternal','then','membername','name','UserId','CreateVoiceRecording','request','uniqueid','accountcode','exten','context','channel','isNil','channelstate','linkedid','transfer','error','varset','variable','endsWith','.wav49','value','replace','.WAV','find','monitors','stack','hangup','calleridnum','calleridname','connectedlinename','outbound','connectedlinenum','forEach','clone','newexten'];(function(_0x490be3,_0xf0fca3){var _0x3f5140=function(_0x15fa80){while(--_0x15fa80){_0x490be3['push'](_0x490be3['shift']());}};_0x3f5140(++_0xf0fca3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'use strict';var _=require(_0x0a9e('0x0'));var utils=require(_0x0a9e('0x1'));var recordings={};function writeDB(_0x29929c){utils['debug'](_0x29929c);if(_0x29929c['accountcode']){utils[_0x0a9e('0x2')](_0x29929c['accountcode'])[_0x0a9e('0x3')](function(_0x432180){if(_0x432180){_0x29929c[_0x0a9e('0x4')]=_0x432180[_0x0a9e('0x5')];_0x29929c[_0x0a9e('0x6')]=_0x432180['id'];}utils['request'](_0x0a9e('0x7'),_0x29929c);});}else{utils[_0x0a9e('0x8')](_0x0a9e('0x7'),_0x29929c);}}exports['newchannel']=function(_0x503809){try{if(_0x503809[_0x0a9e('0x9')]==_0x503809['linkedid']){recordings[_0x503809['uniqueid']]={'uniqueid':_0x503809[_0x0a9e('0x9')],'accountcode':_0x503809[_0x0a9e('0xa')],'exten':_0x503809[_0x0a9e('0xb')],'context':_0x503809[_0x0a9e('0xc')],'channel':_0x503809[_0x0a9e('0xd')],'monitors':[]};}}catch(_0xbd1168){utils['error'](_0xbd1168['stack']);}};exports['newstate']=function(_0x4cfe67){try{if(!_[_0x0a9e('0xe')](recordings[_0x4cfe67[_0x0a9e('0x9')]])&&_0x4cfe67[_0x0a9e('0xf')]==0x6){}else if(!_[_0x0a9e('0xe')](recordings[_0x4cfe67[_0x0a9e('0x10')]])&&_0x4cfe67[_0x0a9e('0xf')]==0x6&&_0x4cfe67['context']!=_0x0a9e('0x11')){recordings[_0x4cfe67[_0x0a9e('0x10')]][_0x0a9e('0xa')]=_0x4cfe67[_0x0a9e('0xa')];}}catch(_0x44dcfd){utils[_0x0a9e('0x12')](_0x44dcfd['stack']);}};exports[_0x0a9e('0x13')]=function(_0x5d0880){try{if(!_[_0x0a9e('0xe')](_0x5d0880['variable'])&&!_[_0x0a9e('0xe')](_0x5d0880[_0x0a9e('0x14')]['mixmonitor_filename'])){if(_[_0x0a9e('0x15')](_0x5d0880['value'],_0x0a9e('0x16'))){_0x5d0880[_0x0a9e('0x17')]=_0x5d0880[_0x0a9e('0x17')][_0x0a9e('0x18')](_0x0a9e('0x16'),_0x0a9e('0x19'));}if(recordings[_0x5d0880[_0x0a9e('0x10')]]){var _0x20559e=_[_0x0a9e('0x1a')](recordings[_0x5d0880[_0x0a9e('0x10')]][_0x0a9e('0x1b')],{'value':_0x5d0880[_0x0a9e('0x17')]});if(_['isNil'](_0x20559e)){recordings[_0x5d0880[_0x0a9e('0x10')]][_0x0a9e('0x1b')]['push']({'value':_0x5d0880[_0x0a9e('0x17')]});}}}}catch(_0x5a09ef){utils['error'](_0x5a09ef[_0x0a9e('0x1c')]);}};exports[_0x0a9e('0x1d')]=function(_0x38e7c4){try{if(!_[_0x0a9e('0xe')](recordings[_0x38e7c4['uniqueid']])){recordings[_0x38e7c4[_0x0a9e('0x9')]][_0x0a9e('0x1e')]=_0x38e7c4[_0x0a9e('0x1e')];recordings[_0x38e7c4[_0x0a9e('0x9')]][_0x0a9e('0x1f')]=_0x38e7c4[_0x0a9e('0x1f')];recordings[_0x38e7c4[_0x0a9e('0x9')]]['connectedlinenum']=_0x38e7c4['connectedlinenum'];recordings[_0x38e7c4[_0x0a9e('0x9')]][_0x0a9e('0x20')]=_0x38e7c4[_0x0a9e('0x20')];if(recordings[_0x38e7c4[_0x0a9e('0x9')]]['type']==_0x0a9e('0x21')&&recordings[_0x38e7c4['uniqueid']][_0x0a9e('0xa')]){recordings[_0x38e7c4['uniqueid']][_0x0a9e('0x22')]=recordings[_0x38e7c4[_0x0a9e('0x9')]][_0x0a9e('0xa')];recordings[_0x38e7c4[_0x0a9e('0x9')]][_0x0a9e('0x20')]='';}recordings[_0x38e7c4[_0x0a9e('0x9')]][_0x0a9e('0x1b')][_0x0a9e('0x23')](_0x5a101a=>{var _0x3652a7=_[_0x0a9e('0x24')](recordings[_0x38e7c4[_0x0a9e('0x9')]]);_0x3652a7[_0x0a9e('0x17')]=_0x5a101a['value'];writeDB(_0x3652a7);});delete recordings[_0x38e7c4[_0x0a9e('0x9')]];}}catch(_0x40e7a3){utils[_0x0a9e('0x12')](_0x40e7a3[_0x0a9e('0x1c')]);}};exports[_0x0a9e('0x25')]=function(_0x563b45){try{if(!_[_0x0a9e('0xe')](recordings[_0x563b45[_0x0a9e('0x9')]])){if(_0x563b45[_0x0a9e('0x26')]['toLowerCase']()==_0x0a9e('0x27')&&_['startsWith'](_0x563b45[_0x0a9e('0x28')][_0x0a9e('0x29')](),_0x0a9e('0x2a'))){var _0x33bdb7=_0x563b45[_0x0a9e('0x28')]['split']('=');var _0x66c1d2=_0x33bdb7[0x0][_0x0a9e('0x2b')](_0x33bdb7[0x0][_0x0a9e('0x2c')]('(')+0x1,_0x33bdb7[0x0][_0x0a9e('0x2c')](')'));var _0x2b45ea=_0x33bdb7[0x1];recordings[_0x563b45[_0x0a9e('0x9')]][_0x66c1d2]=_0x2b45ea;}}}catch(_0x332d35){utils[_0x0a9e('0x12')](_0x332d35['stack']);}};exports[_0x0a9e('0x2d')]=function(_0x5e7238){try{if(!_[_0x0a9e('0xe')](recordings[_0x5e7238[_0x0a9e('0x9')]])){recordings[_0x5e7238[_0x0a9e('0x9')]][_0x0a9e('0x2e')]=_0x5e7238['queue'];}}catch(_0x191e91){utils[_0x0a9e('0x12')](_0x191e91[_0x0a9e('0x1c')]);}}; \ No newline at end of file +var _0x70e0=['.WAV','find','monitors','hangup','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','forEach','newexten','set','appdata','toLowerCase','split','lastIndexOf','queuecallerjoin','queue','lodash','./utils','getUserByInternal','accountcode','then','name','request','newchannel','uniqueid','linkedid','channel','error','stack','newstate','isNil','channelstate','transfer','variable','endsWith','value','.wav49'];(function(_0x41f709,_0x3e441c){var _0x2d1c9a=function(_0x1ab0d6){while(--_0x1ab0d6){_0x41f709['push'](_0x41f709['shift']());}};_0x2d1c9a(++_0x3e441c);}(_0x70e0,0x17b));var _0x070e=function(_0x32da86,_0x19f786){_0x32da86=_0x32da86-0x0;var _0x17c899=_0x70e0[_0x32da86];return _0x17c899;};'use strict';var _=require(_0x070e('0x0'));var utils=require(_0x070e('0x1'));var recordings={};function writeDB(_0x198c2e){utils['debug'](_0x198c2e);if(_0x198c2e['accountcode']){utils[_0x070e('0x2')](_0x198c2e[_0x070e('0x3')])[_0x070e('0x4')](function(_0x2593e5){if(_0x2593e5){_0x198c2e['membername']=_0x2593e5[_0x070e('0x5')];_0x198c2e['UserId']=_0x2593e5['id'];}utils[_0x070e('0x6')]('CreateVoiceRecording',_0x198c2e);});}else{utils['request']('CreateVoiceRecording',_0x198c2e);}}exports[_0x070e('0x7')]=function(_0x1e11f0){try{if(_0x1e11f0[_0x070e('0x8')]==_0x1e11f0[_0x070e('0x9')]){recordings[_0x1e11f0[_0x070e('0x8')]]={'uniqueid':_0x1e11f0[_0x070e('0x8')],'accountcode':_0x1e11f0[_0x070e('0x3')],'exten':_0x1e11f0['exten'],'context':_0x1e11f0['context'],'channel':_0x1e11f0[_0x070e('0xa')],'monitors':[]};}}catch(_0x2e3e5e){utils[_0x070e('0xb')](_0x2e3e5e[_0x070e('0xc')]);}};exports[_0x070e('0xd')]=function(_0xffcdd6){try{if(!_[_0x070e('0xe')](recordings[_0xffcdd6[_0x070e('0x8')]])&&_0xffcdd6[_0x070e('0xf')]==0x6){}else if(!_[_0x070e('0xe')](recordings[_0xffcdd6[_0x070e('0x9')]])&&_0xffcdd6['channelstate']==0x6&&_0xffcdd6['context']!=_0x070e('0x10')){recordings[_0xffcdd6['linkedid']]['accountcode']=_0xffcdd6['accountcode'];}}catch(_0x11d2ce){utils[_0x070e('0xb')](_0x11d2ce['stack']);}};exports['varset']=function(_0x373d86){try{if(!_[_0x070e('0xe')](_0x373d86[_0x070e('0x11')])&&!_[_0x070e('0xe')](_0x373d86['variable']['mixmonitor_filename'])){if(_[_0x070e('0x12')](_0x373d86[_0x070e('0x13')],_0x070e('0x14'))){_0x373d86[_0x070e('0x13')]=_0x373d86[_0x070e('0x13')]['replace'](_0x070e('0x14'),_0x070e('0x15'));}if(recordings[_0x373d86[_0x070e('0x9')]]){var _0x3ea105=_[_0x070e('0x16')](recordings[_0x373d86['linkedid']]['monitors'],{'value':_0x373d86['value']});if(_[_0x070e('0xe')](_0x3ea105)){recordings[_0x373d86[_0x070e('0x9')]][_0x070e('0x17')]['push']({'value':_0x373d86[_0x070e('0x13')]});}}}}catch(_0x5dc5d2){utils[_0x070e('0xb')](_0x5dc5d2[_0x070e('0xc')]);}};exports[_0x070e('0x18')]=function(_0x33e8c6){try{if(!_[_0x070e('0xe')](recordings[_0x33e8c6[_0x070e('0x8')]])){recordings[_0x33e8c6[_0x070e('0x8')]][_0x070e('0x19')]=_0x33e8c6['calleridnum'];recordings[_0x33e8c6[_0x070e('0x8')]][_0x070e('0x1a')]=_0x33e8c6[_0x070e('0x1a')];recordings[_0x33e8c6['uniqueid']][_0x070e('0x1b')]=_0x33e8c6['connectedlinenum'];recordings[_0x33e8c6['uniqueid']][_0x070e('0x1c')]=_0x33e8c6[_0x070e('0x1c')];if(recordings[_0x33e8c6[_0x070e('0x8')]][_0x070e('0x1d')]==_0x070e('0x1e')&&recordings[_0x33e8c6['uniqueid']][_0x070e('0x3')]){recordings[_0x33e8c6[_0x070e('0x8')]][_0x070e('0x1b')]=recordings[_0x33e8c6[_0x070e('0x8')]][_0x070e('0x3')];recordings[_0x33e8c6[_0x070e('0x8')]][_0x070e('0x1c')]='';}recordings[_0x33e8c6[_0x070e('0x8')]]['monitors'][_0x070e('0x1f')](_0x351641=>{var _0x3a16d0=_['clone'](recordings[_0x33e8c6['uniqueid']]);_0x3a16d0[_0x070e('0x13')]=_0x351641[_0x070e('0x13')];writeDB(_0x3a16d0);});delete recordings[_0x33e8c6[_0x070e('0x8')]];}}catch(_0x51402c){utils[_0x070e('0xb')](_0x51402c[_0x070e('0xc')]);}};exports[_0x070e('0x20')]=function(_0x5f2bee){try{if(!_['isNil'](recordings[_0x5f2bee['uniqueid']])){if(_0x5f2bee['application']['toLowerCase']()==_0x070e('0x21')&&_['startsWith'](_0x5f2bee[_0x070e('0x22')][_0x070e('0x23')](),'cdr')){var _0x47a739=_0x5f2bee[_0x070e('0x22')][_0x070e('0x24')]('=');var _0x55288a=_0x47a739[0x0]['substring'](_0x47a739[0x0][_0x070e('0x25')]('(')+0x1,_0x47a739[0x0][_0x070e('0x25')](')'));var _0x444d02=_0x47a739[0x1];recordings[_0x5f2bee[_0x070e('0x8')]][_0x55288a]=_0x444d02;}}}catch(_0x18f0ad){utils['error'](_0x18f0ad['stack']);}};exports[_0x070e('0x26')]=function(_0x3011c4){try{if(!_[_0x070e('0xe')](recordings[_0x3011c4[_0x070e('0x8')]])){recordings[_0x3011c4[_0x070e('0x8')]]['queue']=_0x3011c4[_0x070e('0x27')];}}catch(_0x1927f4){utils['error'](_0x1927f4[_0x070e('0xc')]);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 5f27b84..493c49c 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 _0x32c0=['request','CreateVoiceTransferReport','blind','stack','assign','origtransferercalleridname','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','attended','transfereechannel','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','error','lodash','util','info','TRANSFER|%s','type'];(function(_0x500280,_0x2b60c7){var _0x146aeb=function(_0x27daf6){while(--_0x27daf6){_0x500280['push'](_0x500280['shift']());}};_0x146aeb(++_0x2b60c7);}(_0x32c0,0x1f3));var _0x032c=function(_0x53431c,_0x2d168e){_0x53431c=_0x53431c-0x0;var _0x56ad64=_0x32c0[_0x53431c];return _0x56ad64;};'use strict';var _=require(_0x032c('0x0'));var util=require(_0x032c('0x1'));var utils=require('./utils');function writeDB(_0x19975c){utils[_0x032c('0x2')](util['format'](_0x032c('0x3'),_0x19975c[_0x032c('0x4')]));utils[_0x032c('0x5')](_0x032c('0x6'),_0x19975c);}exports['blindtransfer']=function(_0x7eb53e){try{_0x7eb53e[_0x032c('0x4')]=_0x032c('0x7');writeDB(_0x7eb53e);}catch(_0xca7342){utils['error'](_0xca7342[_0x032c('0x8')]);}};exports['attendedtransfer']=function(_0x18217d){try{_0x18217d=_[_0x032c('0x9')](_0x18217d,{'transfererchannel':_0x18217d['origtransfererchannel'],'transferercalleridnum':_0x18217d['origtransferercalleridnum'],'transferercalleridname':_0x18217d[_0x032c('0xa')],'transfererconnectedlinenum':_0x18217d['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x18217d[_0x032c('0xb')],'transfereraccountcode':_0x18217d['origtransfereraccountcode'],'transferercontext':_0x18217d[_0x032c('0xc')],'transfererexten':_0x18217d[_0x032c('0xd')],'transfererlinkedid':_0x18217d[_0x032c('0xe')],'context':_0x18217d[_0x032c('0xf')],'extension':_0x18217d[_0x032c('0x10')],'type':_0x032c('0x11')});if(_['isNil'](_0x18217d[_0x032c('0x12')])){_0x18217d=_[_0x032c('0x9')](_0x18217d,{'transfereechannel':_0x18217d[_0x032c('0x13')],'transfereecalleridnum':_0x18217d[_0x032c('0x14')],'transfereecalleridname':_0x18217d['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x18217d[_0x032c('0x15')],'transfereeconnectedlinename':_0x18217d[_0x032c('0x16')],'transfereeaccountcode':_0x18217d[_0x032c('0x17')],'transfereecontext':_0x18217d[_0x032c('0x18')],'transfereeexten':_0x18217d[_0x032c('0x19')],'transfereelinkedid':_0x18217d[_0x032c('0x1a')]});}writeDB(_0x18217d);}catch(_0x51266f){utils[_0x032c('0x1b')](_0x51266f[_0x032c('0x8')]);}}; \ No newline at end of file +var _0xdcf0=['origtransferercontext','isNil','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','lodash','util','info','TRANSFER|%s','CreateVoiceTransferReport','blindtransfer','type','blind','error','attendedtransfer','assign','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid'];(function(_0x1c024b,_0x379dd1){var _0x301373=function(_0x16866c){while(--_0x16866c){_0x1c024b['push'](_0x1c024b['shift']());}};_0x301373(++_0x379dd1);}(_0xdcf0,0xb8));var _0x0dcf=function(_0x42e091,_0x2fcfd0){_0x42e091=_0x42e091-0x0;var _0x3f0ee0=_0xdcf0[_0x42e091];return _0x3f0ee0;};'use strict';var _=require(_0x0dcf('0x0'));var util=require(_0x0dcf('0x1'));var utils=require('./utils');function writeDB(_0x11183d){utils[_0x0dcf('0x2')](util['format'](_0x0dcf('0x3'),_0x11183d['type']));utils['request'](_0x0dcf('0x4'),_0x11183d);}exports[_0x0dcf('0x5')]=function(_0x235ad2){try{_0x235ad2[_0x0dcf('0x6')]=_0x0dcf('0x7');writeDB(_0x235ad2);}catch(_0x598cf5){utils[_0x0dcf('0x8')](_0x598cf5['stack']);}};exports[_0x0dcf('0x9')]=function(_0x222ffa){try{_0x222ffa=_[_0x0dcf('0xa')](_0x222ffa,{'transfererchannel':_0x222ffa[_0x0dcf('0xb')],'transferercalleridnum':_0x222ffa[_0x0dcf('0xc')],'transferercalleridname':_0x222ffa[_0x0dcf('0xd')],'transfererconnectedlinenum':_0x222ffa[_0x0dcf('0xe')],'transfererconnectedlinename':_0x222ffa['secondtransfererconnectedlinename'],'transfereraccountcode':_0x222ffa[_0x0dcf('0xf')],'transferercontext':_0x222ffa[_0x0dcf('0x10')],'transfererexten':_0x222ffa[_0x0dcf('0x11')],'transfererlinkedid':_0x222ffa[_0x0dcf('0x12')],'context':_0x222ffa[_0x0dcf('0x13')],'extension':_0x222ffa['origtransfererexten'],'type':'attended'});if(_[_0x0dcf('0x14')](_0x222ffa['transfereechannel'])){_0x222ffa=_['assign'](_0x222ffa,{'transfereechannel':_0x222ffa[_0x0dcf('0x15')],'transfereecalleridnum':_0x222ffa[_0x0dcf('0x16')],'transfereecalleridname':_0x222ffa[_0x0dcf('0x17')],'transfereeconnectedlinenum':_0x222ffa[_0x0dcf('0x18')],'transfereeconnectedlinename':_0x222ffa[_0x0dcf('0x19')],'transfereeaccountcode':_0x222ffa[_0x0dcf('0x1a')],'transfereecontext':_0x222ffa[_0x0dcf('0x1b')],'transfereeexten':_0x222ffa[_0x0dcf('0x1c')],'transfereelinkedid':_0x222ffa['transfertargetlinkedid']});}writeDB(_0x222ffa);}catch(_0xf8c74e){utils['error'](_0xf8c74e['stack']);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 1d1cea2..32b5ee5 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 _0xff44=['format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','sumTime','now','isAfter','isBefore','jayson/promise','moment','bluebird','client','../../config/logger','info','debug','stringify','error','request','then','catch','GetUser','internal','name','interface','result','length','NOTFOUND','stack','getUserByInterface','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','FOUND','addTime','add','seconds'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xff44,0x1c2));var _0x4ff4=function(_0x4abcf4,_0x4d80bc){_0x4abcf4=_0x4abcf4-0x0;var _0x24c066=_0xff44[_0x4abcf4];return _0x24c066;};'use strict';var jayson=require(_0x4ff4('0x0'));var moment=require(_0x4ff4('0x1'));var BPromise=require(_0x4ff4('0x2'));var client=jayson[_0x4ff4('0x3')]['http']({'port':0x2329});var logger=require(_0x4ff4('0x4'))('xdr');exports[_0x4ff4('0x5')]=function(_0x1cd746){logger[_0x4ff4('0x5')](_0x1cd746);};exports[_0x4ff4('0x6')]=function(_0xb5e851){logger[_0x4ff4('0x6')](JSON[_0x4ff4('0x7')](_0xb5e851));};exports[_0x4ff4('0x8')]=function(_0x5dd16d){logger[_0x4ff4('0x8')](_0x5dd16d['stack']);};exports[_0x4ff4('0x9')]=function(_0x42a2a3,_0x523aef){return client[_0x4ff4('0x9')](_0x42a2a3,{'body':_0x523aef})[_0x4ff4('0xa')](function(_0x217789){logger[_0x4ff4('0x6')](JSON[_0x4ff4('0x7')](_0x217789));})[_0x4ff4('0xb')](function(_0x44fa33){logger[_0x4ff4('0x8')](_0x44fa33['stack']);});};function getUser(_0x4797eb){return client['request'](_0x4ff4('0xc'),{'options':{'raw':!![],'attributes':['id',_0x4ff4('0xd'),_0x4ff4('0xe'),_0x4ff4('0xf')],'where':_0x4797eb,'limit':0x1}})['then'](function(_0x51362c){logger[_0x4ff4('0x5')]('GETUSER|'+JSON[_0x4ff4('0x7')](_0x4797eb)+'|'+(_0x51362c[_0x4ff4('0x10')][_0x4ff4('0x11')]?'FOUND':_0x4ff4('0x12')));return _0x51362c['result']['length']?_0x51362c[_0x4ff4('0x10')][0x0]:null;});}exports['getUserByInternal']=function(_0x242cfc){return new BPromise(function(_0x1dae6e,_0x753e6c){if(_0x242cfc){return getUser({'internal':_0x242cfc})['then'](function(_0x5d9a00){return _0x1dae6e(_0x5d9a00);})[_0x4ff4('0xb')](function(_0x4fc70a){logger['error'](_0x4fc70a[_0x4ff4('0x13')]);return _0x1dae6e(null);});}else{return _0x1dae6e(null);}});};exports[_0x4ff4('0x14')]=function(_0x1d2018){return new BPromise(function(_0x3ca927,_0x344b5a){if(_0x1d2018){return getUser({'interface':_0x1d2018})[_0x4ff4('0xa')](function(_0x312226){return _0x3ca927(_0x312226);})[_0x4ff4('0xb')](function(_0x102bcc){logger['error'](_0x102bcc[_0x4ff4('0x13')]);return _0x3ca927(null);});}else{return _0x3ca927(null);}});};exports['getUserByName']=function(_0x429425){return new BPromise(function(_0x5706e3,_0x3f79a7){if(_0x429425){return getUser({'name':_0x429425})['then'](function(_0x162721){return _0x5706e3(_0x162721);})['catch'](function(_0x4b328d){logger[_0x4ff4('0x8')](_0x4b328d[_0x4ff4('0x13')]);return _0x5706e3(null);});}else{return _0x5706e3(null);}});};exports[_0x4ff4('0x15')]=function(_0x3b6a0f){return new BPromise(function(_0x10453e,_0x57539e){if(_0x3b6a0f){return client[_0x4ff4('0x9')](_0x4ff4('0x16'),{'options':{'raw':!![],'attributes':['id',_0x4ff4('0xe'),_0x4ff4('0x17'),_0x4ff4('0x18'),_0x4ff4('0x19')],'where':{'name':_0x3b6a0f},'limit':0x1}})[_0x4ff4('0xa')](function(_0x860e5d){logger[_0x4ff4('0x5')]('GETVOICEQUEUEBYNAME|'+_0x3b6a0f+'|'+(_0x860e5d[_0x4ff4('0x10')][_0x4ff4('0x11')]?_0x4ff4('0x1a'):_0x4ff4('0x12')));return _0x10453e(_0x860e5d['result'][_0x4ff4('0x11')]?_0x860e5d[_0x4ff4('0x10')][0x0]:null);})['catch'](function(_0x59e978){logger[_0x4ff4('0x8')](_0x59e978[_0x4ff4('0x13')]);return _0x10453e(null);});}else{return _0x10453e(null);}});};exports[_0x4ff4('0x1b')]=function(_0x5cc3e1,_0x12973b){return moment(_0x5cc3e1)[_0x4ff4('0x1c')](_0x12973b,_0x4ff4('0x1d'))[_0x4ff4('0x1e')](_0x4ff4('0x1f'));};exports[_0x4ff4('0x20')]=function(_0x417284,_0x584e7b){return moment(_0x417284)[_0x4ff4('0x21')](_0x584e7b,_0x4ff4('0x1d'))['format'](_0x4ff4('0x1f'));};exports[_0x4ff4('0x22')]=function(_0x517cf7,_0x1dd826){return moment(_0x517cf7)[_0x4ff4('0x23')](moment(_0x1dd826),_0x4ff4('0x1d'));};exports[_0x4ff4('0x24')]=function(_0x3e227f,_0x10c95c){return parseInt(_0x3e227f,0xa)+parseInt(_0x10c95c,0xa);};exports[_0x4ff4('0x25')]=function(){return moment()[_0x4ff4('0x1e')](_0x4ff4('0x1f'));};exports[_0x4ff4('0x26')]=function(_0x27651c,_0x155c52){if(_0x155c52){return moment(_0x27651c)[_0x4ff4('0x26')](_0x155c52);}else{return!![];}};exports[_0x4ff4('0x27')]=function(_0x30b4e0,_0x1f6f95){if(_0x1f6f95){return moment(_0x30b4e0)[_0x4ff4('0x27')](_0x1f6f95);}else if(_0x30b4e0){return!![];}else{return![];}}; \ No newline at end of file +var _0x78b9=['GetUser','internal','interface','then','GETUSER|','result','length','FOUND','NOTFOUND','getUserByInternal','getUserByInterface','getUserByName','getVoiceQueueByName','GetVoiceQueue','name','type','acw','acwTimeout','addTime','add','seconds','format','subtract','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff','sumTime','now','isAfter','isBefore','moment','bluebird','client','../../config/logger','xdr','info','debug','error','request','catch','stack'];(function(_0xee2a63,_0x570b53){var _0x299812=function(_0x12a4be){while(--_0x12a4be){_0xee2a63['push'](_0xee2a63['shift']());}};_0x299812(++_0x570b53);}(_0x78b9,0x70));var _0x978b=function(_0x1a5483,_0x4152f1){_0x1a5483=_0x1a5483-0x0;var _0x309034=_0x78b9[_0x1a5483];return _0x309034;};'use strict';var jayson=require('jayson/promise');var moment=require(_0x978b('0x0'));var BPromise=require(_0x978b('0x1'));var client=jayson[_0x978b('0x2')]['http']({'port':0x2329});var logger=require(_0x978b('0x3'))(_0x978b('0x4'));exports[_0x978b('0x5')]=function(_0xf146a9){logger[_0x978b('0x5')](_0xf146a9);};exports[_0x978b('0x6')]=function(_0x2d4c24){logger['debug'](JSON['stringify'](_0x2d4c24));};exports[_0x978b('0x7')]=function(_0x28d0ac){logger['error'](_0x28d0ac['stack']);};exports[_0x978b('0x8')]=function(_0x32fcff,_0xd204f9){return client[_0x978b('0x8')](_0x32fcff,{'body':_0xd204f9})['then'](function(_0x54d7f6){logger[_0x978b('0x6')](JSON['stringify'](_0x54d7f6));})[_0x978b('0x9')](function(_0x5e2ce6){logger['error'](_0x5e2ce6[_0x978b('0xa')]);});};function getUser(_0x352261){return client['request'](_0x978b('0xb'),{'options':{'raw':!![],'attributes':['id',_0x978b('0xc'),'name',_0x978b('0xd')],'where':_0x352261,'limit':0x1}})[_0x978b('0xe')](function(_0x2f53c2){logger[_0x978b('0x5')](_0x978b('0xf')+JSON['stringify'](_0x352261)+'|'+(_0x2f53c2[_0x978b('0x10')][_0x978b('0x11')]?_0x978b('0x12'):_0x978b('0x13')));return _0x2f53c2[_0x978b('0x10')][_0x978b('0x11')]?_0x2f53c2[_0x978b('0x10')][0x0]:null;});}exports[_0x978b('0x14')]=function(_0x29217b){return new BPromise(function(_0x18dfdf,_0xc18b31){if(_0x29217b){return getUser({'internal':_0x29217b})[_0x978b('0xe')](function(_0x248f47){return _0x18dfdf(_0x248f47);})[_0x978b('0x9')](function(_0x11c05e){logger[_0x978b('0x7')](_0x11c05e[_0x978b('0xa')]);return _0x18dfdf(null);});}else{return _0x18dfdf(null);}});};exports[_0x978b('0x15')]=function(_0x33a401){return new BPromise(function(_0x54b9e6,_0x97122c){if(_0x33a401){return getUser({'interface':_0x33a401})[_0x978b('0xe')](function(_0x27fcd2){return _0x54b9e6(_0x27fcd2);})[_0x978b('0x9')](function(_0x42f23d){logger[_0x978b('0x7')](_0x42f23d[_0x978b('0xa')]);return _0x54b9e6(null);});}else{return _0x54b9e6(null);}});};exports[_0x978b('0x16')]=function(_0x3ff132){return new BPromise(function(_0x28f52a,_0x35ee05){if(_0x3ff132){return getUser({'name':_0x3ff132})['then'](function(_0x10a67c){return _0x28f52a(_0x10a67c);})[_0x978b('0x9')](function(_0x9ffc00){logger[_0x978b('0x7')](_0x9ffc00[_0x978b('0xa')]);return _0x28f52a(null);});}else{return _0x28f52a(null);}});};exports[_0x978b('0x17')]=function(_0x33e609){return new BPromise(function(_0x2a4d15,_0x12c9ec){if(_0x33e609){return client[_0x978b('0x8')](_0x978b('0x18'),{'options':{'raw':!![],'attributes':['id',_0x978b('0x19'),_0x978b('0x1a'),_0x978b('0x1b'),_0x978b('0x1c')],'where':{'name':_0x33e609},'limit':0x1}})['then'](function(_0xbde91){logger[_0x978b('0x5')]('GETVOICEQUEUEBYNAME|'+_0x33e609+'|'+(_0xbde91[_0x978b('0x10')][_0x978b('0x11')]?_0x978b('0x12'):_0x978b('0x13')));return _0x2a4d15(_0xbde91['result'][_0x978b('0x11')]?_0xbde91[_0x978b('0x10')][0x0]:null);})[_0x978b('0x9')](function(_0x15518d){logger['error'](_0x15518d[_0x978b('0xa')]);return _0x2a4d15(null);});}else{return _0x2a4d15(null);}});};exports[_0x978b('0x1d')]=function(_0x24e31a,_0x2c4a6d){return moment(_0x24e31a)[_0x978b('0x1e')](_0x2c4a6d,_0x978b('0x1f'))[_0x978b('0x20')]('YYYY-MM-DD\x20HH:mm:ss');};exports['subtractTime']=function(_0x47389f,_0x17b41d){return moment(_0x47389f)[_0x978b('0x21')](_0x17b41d,_0x978b('0x1f'))['format'](_0x978b('0x22'));};exports[_0x978b('0x23')]=function(_0x1144ef,_0x210e22){return moment(_0x1144ef)[_0x978b('0x24')](moment(_0x210e22),_0x978b('0x1f'));};exports[_0x978b('0x25')]=function(_0x3fbb66,_0x15f1e5){return parseInt(_0x3fbb66,0xa)+parseInt(_0x15f1e5,0xa);};exports[_0x978b('0x26')]=function(){return moment()['format'](_0x978b('0x22'));};exports[_0x978b('0x27')]=function(_0x428c38,_0x225565){if(_0x225565){return moment(_0x428c38)[_0x978b('0x27')](_0x225565);}else{return!![];}};exports[_0x978b('0x28')]=function(_0x3f1741,_0x1f8087){if(_0x1f8087){return moment(_0x3f1741)[_0x978b('0x28')](_0x1f8087);}else if(_0x3f1741){return!![];}else{return![];}}; \ No newline at end of file